Import Cobalt 21.master.0.270962

Includes the following patches:
  https://cobalt-review.googlesource.com/c/cobalt/+/5690
    by n1214.hwang@samsung.com
diff --git a/src/README.md b/src/README.md
index ced1010..8ca8618 100644
--- a/src/README.md
+++ b/src/README.md
@@ -40,13 +40,11 @@
     on even a budget desktop computer. Minor performance concerns can be greatly
     exaggerated, which seriously affects priorities.
   * **Fewer cores.** CE System-on-a-Chip (SoC) processors often do not have as
-    many processor cores as we are used to in modern computers. Many deployed
-    devices still only have a single core.
-  * **Sometimes No GPU.** Not all CE devices have a monster GPU to throw shaders
-    at to offload CPU work. A different strategy is required to maximize
-    leverage of an accelerated blitter, which is all some older devices
-    have. Some newer CE devices have a GPU, but it's not nearly as powerful as
-    what one would even see on a laptop.
+    many processor cores as we are used to in modern computers.
+  * **Minimal GPU.** Not all CE devices have a monster GPU to throw shaders at
+    to offload CPU work. As CE devices now have a standard GPU (though not
+    nearly as powerful as even a laptop), OpenGL ES 2.0 is now required
+    by Cobalt.
   * **Sometimes No JIT.** Many CE devices are dealing with "High-Value Content,"
     and, as such, are very sensitive to security concerns. Ensuring that
     writable pages are not executable is a strong security protocol that can
@@ -55,8 +53,8 @@
   * **Heterogenous Development Environments.** This is slowly evening out, but
     all CE devices run on custom hardware, often with proprietary methods of
     building, packaging, deploying, and running programs. Almost all CE devices
-    have ARM or MIPS processors instead of the more familiar x86. Sometimes the
-    toolchain doesn't support contemporary C++11 features. Sometimes the OS
+    have ARM processors instead of the more familiar x86. Sometimes the
+    toolchain doesn't support contemporary C++11/14 features. Sometimes the OS
     isn't POSIX, or it tries to be, but it is only partially implemented.
     Sometimes the program entry point is in another language or architecture
     that requires a "trampoline" over to native binary code.
@@ -97,13 +95,11 @@
     incremental layouts can be sped up.
   * **Renderer/Skia** - The Renderer walks a Render Tree produced by the Layout
     Engine, rasterizes it using the third-party graphics library Skia, and swaps
-    it to the front buffer. There are two major paths here, one using Hardware
-    Skia on OpenGL ES 2.0, and one using Software Skia combined with the
-    hardware-accelerated Starboard Blitter. Note that the renderer runs in a
-    different thread from the Layout Engine, and can interpolate animations that
-    do not require re-layout. This decouples rendering from Layout and
-    JavaScript, allowing for smooth, consistent animations on platforms with a
-    variety of capabilities.
+    it to the front buffer. This is accomplished using Hardware Skia on OpenGL
+    ES 2.0. Note that the renderer runs in a different thread from the Layout
+    Engine, and can interpolate animations that do not require re-layout. This
+    decouples rendering from Layout and JavaScript, allowing for smooth,
+    consistent animations on platforms with a variety of capabilities.
   * **Net / Media** - These are Chromium's Network and Media engines. We are
     using them directly, as they don't cause any particular problems with the
     extra constraints listed above.
@@ -129,22 +125,16 @@
     to GLES2. **ANGLE** Is a third-party library that adapts DirectX to GLES2,
     similar to Glimp, but only for DirectX.
 
-Cobalt is like a flaky layered pastry - perhaps Baklava. It shouldn't be too
-difficult to rip the Web Implementation and Layout off the top, and just use the
-Renderer, or even to just use Base + Starboard + GLES2 as the basis of a new
-project.
-
-
 ## The Cobalt Subset
 
 > Oh, we got both kinds of HTML tags,\
-> we got `<span>` and `<div>`!
+> we got `<span>` and `<div>`! \
+> We even have CSS Flexbox now, hooray!
 
-See the [Cobalt Subset specification](TODO) for more details on which tags,
-properties, and Web APIs are supported in Cobalt.
-
-*More to come.*
-
+See the [Cobalt Subset
+specification](https://cobalt.dev/development/reference/supported-features.html)
+for more details on which tags, properties, and Web APIs are supported in
+Cobalt.
 
 ## Interesting Source Locations
 
@@ -162,6 +152,9 @@
       * `cobalt/build/` - The core build generation system, `gyp_cobalt`, and
         configurations for supported platforms. (NOTE: This should eventually be
         mostly moved into `starboard/`.)
+      * `cobalt/doc/` - Contains a wide range of detailed information and guides
+        on Cobalt features, functionality and best practices for Cobalt
+        development.
       * `cobalt/media/` - Chromium's Media library. Contains all the code that
         parses, processes, and manages buffers of video and audio data. It
         send the buffers to the SbPlayer implementation for playback.
@@ -178,63 +171,11 @@
 
 ## Building and Running the Code
 
-Here's a quick and dirty guide to get to build the code on Linux.
+  See the below reference port setup guides for more details:
 
-  1. Pull `depot_tools` into your favorite directory. It has been slightly
-     modified from Chromium's `depot_tools`.
-
-         git clone https://cobalt.googlesource.com/depot_tools
-
-  2. Add that directory to the end of your `$PATH`.
-  3. Ensure you have these packages installed:
-
-         sudo apt-get install libgles2-mesa-dev libpulse-dev libavformat-dev \
-         libavresample-dev libasound2-dev libxrender-dev libxcomposite-dev
-
-  4. Ensure you have the standard C++ header files installed
-     (e.g. `libstdc++-4.8-dev`).
-  5. For now, we also require ruby:
-
-         sudo apt-get install ruby
-
-  6. Remove bison-3 and install bison-2.7. (NOTE: We plan on moving to bison-3
-     in the future.)
-
-         $ sudo apt-get remove bison
-         $ sudo apt-get install m4
-         $ wget http://ftp.gnu.org/gnu/bison/bison-2.7.1.tar.gz
-         $ tar zxf bison-2.7.1.tar.gz
-         $ cd bison-2.7.1
-         $ sh configure && make && sudo make install
-         $ which bison
-         /usr/local/bin/bison
-         $ bison --version
-         bison (GNU Bison) 2.7.12-4996
-
-  7. (From this directory) run GYP:
-
-         cobalt/build/gyp_cobalt -C debug linux-x64x11
-
-  8. Run Ninja:
-
-         ninja -C out/linux-x64x11_debug cobalt
-
-  9. Run Cobalt:
-
-         out/linux-x64x11_debug/cobalt [--url=<url>]
-
-      * If you want to connect to an `https` host that doesn't have a
-        certificate validatable by our set of root CAs, you must pass the
-        `--ignore_certificate_errors` flag to the Cobalt command-line.
-      * Cobalt requires that the HTML5 content be fetched over HTTPS and
-        enforces CSP when compiled in the "gold" configuration. However, if
-        CSP is served in other builds, Cobalt still respects it. Currently
-        Cobalt is at CSP level 2.
-      * When the HTML5 content is served with a special "h5vcc-location-src"
-        CSP directive, a navigation jail is enabled in Cobalt that cannot be
-        disabled via Cobalt options.
-      * See [`cobalt/browser/switches.cc`](cobalt/browser/switches.cc) for more
-        command-line options.
+  * [Linux](cobalt/site/docs/development/setup-linux.md)
+  * [Raspi](cobalt/site/docs/development/setup-raspi.md)
+  * [Android](cobalt/site/docs/development/setup-android.md)
 
 
 ## Build Types
@@ -253,12 +194,6 @@
 When building for release, you should always use a gold build for the final
 product.
 
-    $ cobalt/build/gyp_cobalt -C gold linux-x64x11
-    $ ninja -C out/linux-x64x11_gold cobalt
-    $ out/linux-x64x11_gold/cobalt
-
-
 ## Origin of this Repository
 
-This is a fork of the chromium repository at http://git.chromium.org/git/chromium.git
-
+This is a fork of the chromium repository at http://git.chromium.org/git/chromium.git
\ No newline at end of file
diff --git a/src/base/files/file_unittest.cc b/src/base/files/file_unittest.cc
index ac0813c..4dbf3ad 100644
--- a/src/base/files/file_unittest.cc
+++ b/src/base/files/file_unittest.cc
@@ -580,7 +580,16 @@
 
   const char kData[] = "this file is sparse.";
   const int kDataLen = sizeof(kData) - 1;
+#if defined(STARBOARD)
+#if SB_IS(32_BIT)
+  // Maximum off_t for lseek() on 32-bit builds is just below 2^31.
+  const int64_t kLargeFileOffset = (1LL << 31) - 2;
+#else  // SB_IS(32_BIT)
   const int64_t kLargeFileOffset = (1LL << 31);
+#endif  // SB_IS(32_BIT)
+#else  // defined(STARBOARD)
+  const int64_t kLargeFileOffset = (1LL << 31);
+#endif  // defined(STARBOARD)
 
   // If the file fails to write, it is probably we are running out of disk space
   // and the file system doesn't support sparse file.
diff --git a/src/build/build_config.h b/src/build/build_config.h
index 7506ad9..23e2665 100644
--- a/src/build/build_config.h
+++ b/src/build/build_config.h
@@ -10,8 +10,6 @@
 //    COMPILER_MSVC / COMPILER_GCC
 //  Processor:
 //    ARCH_CPU_X86 / ARCH_CPU_X86_64 / ARCH_CPU_X86_FAMILY (X86 or X86_64)
-//    ARCH_CPU_PPC_FAMILY
-//    ARCH_CPU_MIPS / ARCH_CPU_MIPSEL / ARCH_CPU_MIPS_FAMILY
 //    ARCH_CPU_ARM / ARCH_CPU_ARMEL / ARCH_CPU_ARM_FAMILY
 //    ARCH_CPU_32_BITS / ARCH_CPU_64_BITS
 //    ARCH_CPU_BIG_ENDIAN / ARCH_CPU_LITTLE_ENDIAN
@@ -151,11 +149,6 @@
 #define ARCH_CPU_LITTLE_ENDIAN 1
 #elif defined(__pnacl__)
 #define ARCH_CPU_32_BITS 1
-#elif defined(__MIPSEL__)
-#define ARCH_CPU_MIPS_FAMILY 1
-#define ARCH_CPU_MIPSEL 1
-#define ARCH_CPU_32_BITS 1
-#define ARCH_CPU_LITTLE_ENDIAN 1
 #else
 #error Please add support for your architecture in build/build_config.h
 #endif
@@ -195,8 +188,6 @@
 #  endif
 #elif defined(__ARMEL__) && !defined(OS_IOS)
 #define WCHAR_T_IS_UNSIGNED 1
-#elif defined(__MIPSEL__)
-#define WCHAR_T_IS_UNSIGNED 0
 #endif
 
 // TODO: Worry about these defines if/when we need to support Android.
diff --git a/src/cobalt/CHANGELOG.md b/src/cobalt/CHANGELOG.md
index 6d46b58..aadb628 100644
--- a/src/cobalt/CHANGELOG.md
+++ b/src/cobalt/CHANGELOG.md
@@ -86,6 +86,17 @@
    version from 2.6.2 to 2.10.2. For a full list of FreeType updates included in
    this change, visit www.freetype.org.
 
+ - **Added support for Lottie animations.**
+
+   Cobalt can now embed and play Lottie animations
+   (https://airbnb.design/lottie/), i.e. animations created in Adobe After
+   Effects and exported to JSON via the Bodymovin plugin. These animations
+   improve the user experience and can readily be incorporated into apps as if
+   they were static images. Cobalt implements a "lottie-player" custom element
+   with a playback API modeled after the Lottie Web Player
+   (https://lottiefiles.com/web-player). In order to support Lottie, Cobalt
+   updated its Skia port from m61 to m79.
+
 ## Version 20
 
  - **Support for QUIC and SPDY is now enabled.**
diff --git a/src/cobalt/browser/application.cc b/src/cobalt/browser/application.cc
index 8ceff23..408f6ec 100644
--- a/src/cobalt/browser/application.cc
+++ b/src/cobalt/browser/application.cc
@@ -343,9 +343,9 @@
     // width. This calculates the height at 4:3 aspect ratio for smaller
     // viewport widths, and 16:9 for viewports 1280 pixels wide or larger.
     if (width >= 1280) {
-      return ViewportSize(width, 9 * width / 16, 0);
+      return ViewportSize(width, 9 * width / 16);
     }
-    return ViewportSize(width, 3 * width / 4, 0);
+    return ViewportSize(width, 3 * width / 4);
   }
 
   int height = 0;
@@ -358,13 +358,25 @@
     return ViewportSize(width, height);
   }
 
-  double screen_diagonal_inches = 0.0;
-  if (!base::StringToDouble(lengths[2], &screen_diagonal_inches)) {
-    DLOG(ERROR) << "Viewport " << switch_value
-                << " has invalid screen_diagonal_inches.";
-    return base::nullopt;
+  double screen_diagonal_inches = 0.0f;
+  if (lengths.size() >= 3) {
+    if (!base::StringToDouble(lengths[2], &screen_diagonal_inches)) {
+      DLOG(ERROR) << "Viewport " << switch_value
+                  << " has invalid screen_diagonal_inches.";
+      return base::nullopt;
+    }
   }
-  return ViewportSize(width, height,
+
+  double video_pixel_ratio = 1.0f;
+  if (lengths.size() >= 4) {
+    if (!base::StringToDouble(lengths[3], &video_pixel_ratio)) {
+      DLOG(ERROR) << "Viewport " << switch_value
+                  << " has invalid video_pixel_ratio.";
+      return base::nullopt;
+    }
+  }
+
+  return ViewportSize(width, height, static_cast<float>(video_pixel_ratio),
                       static_cast<float>(screen_diagonal_inches));
 }
 
@@ -1190,8 +1202,14 @@
   float diagonal = 0.0f;  // Special value meaning diagonal size is not known.
 #endif
 
-  cssom::ViewportSize viewport_size(size.width, size.height, diagonal);
-  browser_module_->OnWindowSizeChanged(viewport_size, size.video_pixel_ratio);
+  // A value of 0.0 for the video pixel ratio means that the ratio could not be
+  // determined. In that case it should be assumed to be the same as the
+  // graphics resolution, which corresponds to a device pixel ratio of 1.0.
+  float device_pixel_ratio =
+      (size.video_pixel_ratio == 0) ? 1.0f : size.video_pixel_ratio;
+  cssom::ViewportSize viewport_size(size.width, size.height, diagonal,
+                                    device_pixel_ratio);
+  browser_module_->OnWindowSizeChanged(viewport_size);
 }
 #endif  // SB_API_VERSION >= 8
 
diff --git a/src/cobalt/browser/browser.gyp b/src/cobalt/browser/browser.gyp
index 92009cb..dc3fb4d 100644
--- a/src/cobalt/browser/browser.gyp
+++ b/src/cobalt/browser/browser.gyp
@@ -124,7 +124,6 @@
         '<(DEPTH)/cobalt/media_session/media_session.gyp:media_session',
         '<(DEPTH)/cobalt/network/network.gyp:network',
         '<(DEPTH)/cobalt/overlay_info/overlay_info.gyp:overlay_info',
-        '<(DEPTH)/cobalt/page_visibility/page_visibility.gyp:page_visibility',
         '<(DEPTH)/cobalt/renderer/renderer.gyp:renderer',
         '<(DEPTH)/cobalt/renderer/test/png_utils/png_utils.gyp:png_utils',
         '<(DEPTH)/cobalt/script/engine.gyp:engine',
diff --git a/src/cobalt/browser/browser_bindings_gen.gyp b/src/cobalt/browser/browser_bindings_gen.gyp
index 2d9c0f1..017ecb3 100644
--- a/src/cobalt/browser/browser_bindings_gen.gyp
+++ b/src/cobalt/browser/browser_bindings_gen.gyp
@@ -114,6 +114,7 @@
         '../dom/intersection_observer_entry.idl',
         '../dom/keyboard_event.idl',
         '../dom/location.idl',
+        '../dom/lottie_frame_custom_event.idl',
         '../dom/lottie_player.idl',
         '../dom/media_error.idl',
         '../dom/media_query_list.idl',
@@ -178,6 +179,7 @@
         '../h5vcc/h5vcc_settings.idl',
         '../h5vcc/h5vcc_sso.idl',
         '../h5vcc/h5vcc_storage.idl',
+        '../h5vcc/h5vcc_screen.idl',
         '../h5vcc/h5vcc_system.idl',
         '../h5vcc/h5vcc_trace_event.idl',
         '../h5vcc/h5vcc_updater.idl',
@@ -265,6 +267,7 @@
         '../dom/intersection_observer_entry_init.idl',
         '../dom/intersection_observer_init.idl',
         '../dom/keyboard_event_init.idl',
+        '../dom/lottie_frame_custom_event_detail.idl',
         '../dom/media_source_end_of_stream_error.idl',
         '../dom/media_source_ready_state.idl',
         '../dom/mouse_event_init.idl',
@@ -273,7 +276,9 @@
         '../dom/source_buffer_append_mode.idl',
         '../dom/track_default_type.idl',
         '../dom/ui_event_init.idl',
+        '../dom/visibility_state.idl',
         '../dom/wheel_event_init.idl',
+        '../h5vcc/h5vcc_crash_type.idl',
         '../media_capture/blob_event_init.idl',
         '../media_capture/media_device_kind.idl',
         '../media_capture/media_recorder_options.idl',
@@ -286,7 +291,6 @@
         '../media_session/media_session_playback_state.idl',
         '../media_stream/media_stream_constraints.idl',
         '../media_stream/media_track_settings.idl',
-        '../page_visibility/visibility_state.idl',
         '../speech/speech_recognition_error_code.idl',
         '../speech/speech_synthesis_error_code.idl',
         '../subtlecrypto/aes_ctr_params.idl',
@@ -314,6 +318,7 @@
         '../dom/document_cobalt.idl',
         '../dom/document_cssom.idl',
         '../dom/document_html5.idl',
+        '../dom/document_page_visibility.idl',
         '../dom/element_css_inline_style.idl',
         '../dom/element_cssom_view.idl',
         '../dom/element_dom_parsing_and_serialization.idl',
@@ -347,7 +352,6 @@
         '../dom/window_timers.idl',
         '../media_capture/navigator.idl',
         '../media_session/navigator_media_session.idl',
-        '../page_visibility/document.idl',
     ],
 
     'conditions': [
diff --git a/src/cobalt/browser/browser_module.cc b/src/cobalt/browser/browser_module.cc
index 54e0395..0c285df 100644
--- a/src/cobalt/browser/browser_module.cc
+++ b/src/cobalt/browser/browser_module.cc
@@ -606,11 +606,6 @@
     options.camera_3d = input_device_manager_->camera_3d();
   }
 
-  float video_pixel_ratio = 1.0f;
-  if (system_window_) {
-    video_pixel_ratio = system_window_->GetVideoPixelRatio();
-  }
-
   // Make sure that automem has been run before creating the WebModule, so that
   // we use properly configured options for all parameters.
   DCHECK(auto_mem_);
@@ -642,8 +637,8 @@
       base::Bind(&BrowserModule::OnWindowClose, base::Unretained(this)),
       base::Bind(&BrowserModule::OnWindowMinimize, base::Unretained(this)),
       can_play_type_handler_.get(), media_module_.get(), network_module_,
-      viewport_size, video_pixel_ratio, GetResourceProvider(),
-      kLayoutMaxRefreshFrequencyInHz, options));
+      viewport_size, GetResourceProvider(), kLayoutMaxRefreshFrequencyInHz,
+      options));
   lifecycle_observers_.AddObserver(web_module_.get());
   if (!web_module_recreated_callback_.is_null()) {
     web_module_recreated_callback_.Run();
@@ -943,18 +938,17 @@
 }
 
 #if SB_API_VERSION >= 8
-void BrowserModule::OnWindowSizeChanged(const ViewportSize& viewport_size,
-                                        float video_pixel_ratio) {
+void BrowserModule::OnWindowSizeChanged(const ViewportSize& viewport_size) {
   if (web_module_) {
-    web_module_->SetSize(viewport_size, video_pixel_ratio);
+    web_module_->SetSize(viewport_size);
   }
 #if defined(ENABLE_DEBUGGER)
   if (debug_console_) {
-    debug_console_->web_module().SetSize(viewport_size, video_pixel_ratio);
+    debug_console_->web_module().SetSize(viewport_size);
   }
 #endif  // defined(ENABLE_DEBUGGER)
   if (splash_screen_) {
-    splash_screen_->web_module().SetSize(viewport_size, video_pixel_ratio);
+    splash_screen_->web_module().SetSize(viewport_size);
   }
 
   return;
@@ -1691,19 +1685,18 @@
 
 void BrowserModule::UpdateScreenSize() {
   ViewportSize size = GetViewportSize();
-  float video_pixel_ratio = system_window_->GetVideoPixelRatio();
 #if defined(ENABLE_DEBUGGER)
   if (debug_console_) {
-    debug_console_->SetSize(size, video_pixel_ratio);
+    debug_console_->SetSize(size);
   }
 #endif  // defined(ENABLE_DEBUGGER)
 
   if (splash_screen_) {
-    splash_screen_->SetSize(size, video_pixel_ratio);
+    splash_screen_->SetSize(size);
   }
 
   if (web_module_) {
-    web_module_->SetSize(size, video_pixel_ratio);
+    web_module_->SetSize(size);
   }
 
   if (qr_code_overlay_) {
@@ -1794,8 +1787,11 @@
     math::Size target_size = renderer_module_->render_target_size();
     // ...but get the diagonal from one of the other modules.
     float diagonal_inches = 0;
+    float device_pixel_ratio = 1.0f;
     if (system_window_) {
       diagonal_inches = system_window_->GetDiagonalSizeInches();
+      device_pixel_ratio = system_window_->GetDevicePixelRatio();
+
       // For those platforms that can have a main window size smaller than the
       // render target size, the system_window_ size (if exists) should be
       // trusted over the renderer_module_ render target size.
@@ -1806,9 +1802,12 @@
       }
     } else if (options_.requested_viewport_size) {
       diagonal_inches = options_.requested_viewport_size->diagonal_inches();
+      device_pixel_ratio =
+          options_.requested_viewport_size->device_pixel_ratio();
     }
 
-    ViewportSize v(target_size.width(), target_size.height(), diagonal_inches);
+    ViewportSize v(target_size.width(), target_size.height(), diagonal_inches,
+                   device_pixel_ratio);
     return v;
   }
 
@@ -1816,7 +1815,8 @@
   if (system_window_) {
     math::Size size = system_window_->GetWindowSize();
     ViewportSize v(size.width(), size.height(),
-                   system_window_->GetDiagonalSizeInches());
+                   system_window_->GetDiagonalSizeInches(),
+                   system_window_->GetDevicePixelRatio());
     return v;
   }
 
@@ -1830,7 +1830,7 @@
 
   // No window and no viewport size was requested, so we return a conservative
   // default.
-  ViewportSize view_size(1280, 720, 0);
+  ViewportSize view_size(1280, 720);
   return view_size;
 }
 
diff --git a/src/cobalt/browser/browser_module.h b/src/cobalt/browser/browser_module.h
index e439415..ee6dabd 100644
--- a/src/cobalt/browser/browser_module.h
+++ b/src/cobalt/browser/browser_module.h
@@ -192,8 +192,7 @@
 
 #if SB_API_VERSION >= 8
   // Called when a kSbEventTypeWindowSizeChange event is fired.
-  void OnWindowSizeChanged(const cssom::ViewportSize& viewport_size,
-                           float video_pixel_ratio);
+  void OnWindowSizeChanged(const cssom::ViewportSize& viewport_size);
 #endif  // SB_API_VERSION >= 8
 
 #if SB_API_VERSION >= 12 || SB_HAS(ON_SCREEN_KEYBOARD)
diff --git a/src/cobalt/browser/debug_console.cc b/src/cobalt/browser/debug_console.cc
index 2657b27..0503509 100644
--- a/src/cobalt/browser/debug_console.cc
+++ b/src/cobalt/browser/debug_console.cc
@@ -141,8 +141,8 @@
       WebModule::CloseCallback(), /* window_close_callback */
       base::Closure(),            /* window_minimize_callback */
       NULL /* can_play_type_handler */, NULL /* web_media_player_factory */,
-      network_module, window_dimensions, 1.f /*video_pixel_ratio*/,
-      resource_provider, layout_refresh_rate, web_module_options));
+      network_module, window_dimensions, resource_provider, layout_refresh_rate,
+      web_module_options));
 }
 
 DebugConsole::~DebugConsole() {}
diff --git a/src/cobalt/browser/debug_console.h b/src/cobalt/browser/debug_console.h
index 93f53a0..adb5d34 100644
--- a/src/cobalt/browser/debug_console.h
+++ b/src/cobalt/browser/debug_console.h
@@ -89,9 +89,8 @@
     return (GetMode() != debug::console::kDebugConsoleModeOff);
   }
 
-  void SetSize(const cssom::ViewportSize& window_dimensions,
-               float video_pixel_ratio) {
-    web_module_->SetSize(window_dimensions, video_pixel_ratio);
+  void SetSize(const cssom::ViewportSize& viewport_size) {
+    web_module_->SetSize(viewport_size);
   }
 
   // LifecycleObserver implementation.
diff --git a/src/cobalt/browser/splash_screen.cc b/src/cobalt/browser/splash_screen.cc
index a380247..962142f 100644
--- a/src/cobalt/browser/splash_screen.cc
+++ b/src/cobalt/browser/splash_screen.cc
@@ -105,8 +105,8 @@
       base::Bind(&OnError), on_window_close,
       base::Closure(),  // window_minimize_callback
       NULL /* can_play_type_handler */, NULL /* web_media_player_factory */,
-      network_module, window_dimensions, 1.f /*video_pixel_ratio*/,
-      resource_provider, layout_refresh_rate, web_module_options));
+      network_module, window_dimensions, resource_provider, layout_refresh_rate,
+      web_module_options));
 }
 
 SplashScreen::~SplashScreen() {
diff --git a/src/cobalt/browser/splash_screen.h b/src/cobalt/browser/splash_screen.h
index 6a98c9d..853c584 100644
--- a/src/cobalt/browser/splash_screen.h
+++ b/src/cobalt/browser/splash_screen.h
@@ -48,9 +48,8 @@
                    on_splash_screen_shutdown_complete);
   ~SplashScreen();
 
-  void SetSize(const cssom::ViewportSize& window_dimensions,
-               float video_pixel_ratio) {
-    web_module_->SetSize(window_dimensions, video_pixel_ratio);
+  void SetSize(const cssom::ViewportSize& viewport_size) {
+    web_module_->SetSize(viewport_size);
   }
 
   // LifecycleObserver implementation.
diff --git a/src/cobalt/browser/user_agent_string.cc b/src/cobalt/browser/user_agent_string.cc
index 45869c4..2240e74 100644
--- a/src/cobalt/browser/user_agent_string.cc
+++ b/src/cobalt/browser/user_agent_string.cc
@@ -118,8 +118,12 @@
   // Fill platform info if it is a hardware TV device.
   SbSystemDeviceType device_type = SbSystemGetDeviceType();
 
+#if SB_API_VERSION >= 12
+  // System Integrator
+  result = SbSystemGetProperty(kSbSystemPropertySystemIntegratorName, value,
+                               kSystemPropertyMaxLength);
+#elif SB_API_VERSION == 11
   // Original Design Manufacturer (ODM)
-#if SB_API_VERSION >= 11
   result = SbSystemGetProperty(kSbSystemPropertyOriginalDesignManufacturerName,
                                value, kSystemPropertyMaxLength);
 #else
diff --git a/src/cobalt/browser/web_module.cc b/src/cobalt/browser/web_module.cc
index 6446317..0630d7c 100644
--- a/src/cobalt/browser/web_module.cc
+++ b/src/cobalt/browser/web_module.cc
@@ -56,6 +56,7 @@
 #include "cobalt/dom/storage.h"
 #include "cobalt/dom/ui_event.h"
 #include "cobalt/dom/url.h"
+#include "cobalt/dom/visibility_state.h"
 #include "cobalt/dom/wheel_event.h"
 #include "cobalt/dom/window.h"
 #include "cobalt/dom_parser/parser.h"
@@ -63,7 +64,6 @@
 #include "cobalt/loader/image/animated_image_tracker.h"
 #include "cobalt/loader/switches.h"
 #include "cobalt/media_session/media_session_client.h"
-#include "cobalt/page_visibility/visibility_state.h"
 #include "cobalt/script/error_report.h"
 #include "cobalt/script/javascript_engine.h"
 #include "cobalt/storage/storage_manager.h"
@@ -213,7 +213,7 @@
   }
 #endif  // defined(ENABLE_DEBUGGER)
 
-  void SetSize(cssom::ViewportSize window_dimensions, float video_pixel_ratio);
+  void SetSize(cssom::ViewportSize viewport_size);
   void SetCamera3D(const scoped_refptr<input::Camera3D>& camera_3d);
   void SetWebMediaPlayerFactory(
       media::WebMediaPlayerFactory* web_media_player_factory);
@@ -633,9 +633,9 @@
 
   window_ = new dom::Window(
       environment_settings_.get(), data.window_dimensions,
-      data.video_pixel_ratio, data.initial_application_state, css_parser_.get(),
-      dom_parser_.get(), fetcher_factory_.get(), loader_factory_.get(),
-      &resource_provider_, animated_image_tracker_.get(), image_cache_.get(),
+      data.initial_application_state, css_parser_.get(), dom_parser_.get(),
+      fetcher_factory_.get(), loader_factory_.get(), &resource_provider_,
+      animated_image_tracker_.get(), image_cache_.get(),
       reduced_image_cache_capacity_manager_.get(), remote_typeface_cache_.get(),
       mesh_cache_.get(), local_storage_database_.get(),
       data.can_play_type_handler, data.web_media_player_factory,
@@ -1058,14 +1058,8 @@
   remote_typeface_cache_->SetCapacity(static_cast<uint32>(bytes));
 }
 
-void WebModule::Impl::SetSize(cssom::ViewportSize window_dimensions,
-                              float video_pixel_ratio) {
-  // A value of 0.0 for the video pixel ratio means that the ratio could not be
-  // determined. In that case it should be assumed to be the same as the
-  // graphics resolution, which corresponds to a device pixel ratio of 1.0.
-  float device_pixel_ratio =
-      video_pixel_ratio == 0.0f ? 1.0f : video_pixel_ratio;
-  window_->SetSize(window_dimensions, device_pixel_ratio);
+void WebModule::Impl::SetSize(cssom::ViewportSize viewport_size) {
+  window_->SetSize(viewport_size);
 }
 
 void WebModule::Impl::SetCamera3D(
@@ -1314,7 +1308,7 @@
     media::CanPlayTypeHandler* can_play_type_handler,
     media::WebMediaPlayerFactory* web_media_player_factory,
     network::NetworkModule* network_module,
-    const ViewportSize& window_dimensions, float video_pixel_ratio,
+    const ViewportSize& window_dimensions,
     render_tree::ResourceProvider* resource_provider, float layout_refresh_rate,
     const Options& options)
     : thread_(options.name.c_str()),
@@ -1326,8 +1320,8 @@
       initial_url, initial_application_state, render_tree_produced_callback,
       error_callback, window_close_callback, window_minimize_callback,
       can_play_type_handler, web_media_player_factory, network_module,
-      window_dimensions, video_pixel_ratio, resource_provider,
-      kDOMMaxElementDepth, layout_refresh_rate, ui_nav_root_, options);
+      window_dimensions, resource_provider, kDOMMaxElementDepth,
+      layout_refresh_rate, ui_nav_root_, options);
 
   // Start the dedicated thread and create the internal implementation
   // object on that thread.
@@ -1575,12 +1569,10 @@
 }
 #endif  // defined(ENABLE_DEBUGGER)
 
-void WebModule::SetSize(const ViewportSize& viewport_size,
-                        float video_pixel_ratio) {
+void WebModule::SetSize(const ViewportSize& viewport_size) {
   message_loop()->task_runner()->PostTask(
-      FROM_HERE,
-      base::Bind(&WebModule::Impl::SetSize, base::Unretained(impl_.get()),
-                 viewport_size, video_pixel_ratio));
+      FROM_HERE, base::Bind(&WebModule::Impl::SetSize,
+                            base::Unretained(impl_.get()), viewport_size));
 }
 
 void WebModule::SetCamera3D(const scoped_refptr<input::Camera3D>& camera_3d) {
diff --git a/src/cobalt/browser/web_module.h b/src/cobalt/browser/web_module.h
index 8ad8dc2..4e659f0 100644
--- a/src/cobalt/browser/web_module.h
+++ b/src/cobalt/browser/web_module.h
@@ -290,7 +290,6 @@
             media::WebMediaPlayerFactory* web_media_player_factory,
             network::NetworkModule* network_module,
             const cssom::ViewportSize& window_dimensions,
-            float video_pixel_ratio,
             render_tree::ResourceProvider* resource_provider,
             float layout_refresh_rate, const Options& options);
   ~WebModule();
@@ -361,11 +360,10 @@
   std::unique_ptr<debug::backend::DebuggerState> FreezeDebugger();
 #endif  // ENABLE_DEBUGGER
 
-  // Sets the size and pixel ratio of this web module, possibly causing relayout
-  // and re-render with the new parameters. Does nothing if the parameters are
-  // not different from the current parameters.
-  void SetSize(const cssom::ViewportSize& view_port_size,
-               float video_pixel_ratio);
+  // Sets the size of this web module, possibly causing relayout and re-render
+  // with the new parameters. Does nothing if the parameters are not different
+  // from the current parameters.
+  void SetSize(const cssom::ViewportSize& viewport_size);
 
   void SetCamera3D(const scoped_refptr<input::Camera3D>& camera_3d);
   void SetWebMediaPlayerFactory(
@@ -413,7 +411,7 @@
         media::CanPlayTypeHandler* can_play_type_handler,
         media::WebMediaPlayerFactory* web_media_player_factory,
         network::NetworkModule* network_module,
-        const cssom::ViewportSize& window_dimensions, float video_pixel_ratio,
+        const cssom::ViewportSize& window_dimensions,
         render_tree::ResourceProvider* resource_provider,
         int dom_max_element_depth, float layout_refresh_rate,
         const scoped_refptr<ui_navigation::NavItem>& ui_nav_root,
@@ -428,7 +426,6 @@
           web_media_player_factory(web_media_player_factory),
           network_module(network_module),
           window_dimensions(window_dimensions),
-          video_pixel_ratio(video_pixel_ratio),
           resource_provider(resource_provider),
           dom_max_element_depth(dom_max_element_depth),
           layout_refresh_rate(layout_refresh_rate),
@@ -445,7 +442,6 @@
     media::WebMediaPlayerFactory* web_media_player_factory;
     network::NetworkModule* network_module;
     cssom::ViewportSize window_dimensions;
-    float video_pixel_ratio;
     render_tree::ResourceProvider* resource_provider;
     int dom_max_element_depth;
     float layout_refresh_rate;
diff --git a/src/cobalt/build/all.gyp b/src/cobalt/build/all.gyp
index d73ca7dd..9131a86 100644
--- a/src/cobalt/build/all.gyp
+++ b/src/cobalt/build/all.gyp
@@ -65,7 +65,6 @@
         '<(DEPTH)/cobalt/media_stream/media_stream_test.gyp:*',
         '<(DEPTH)/cobalt/network/network.gyp:*',
         '<(DEPTH)/cobalt/overlay_info/overlay_info.gyp:*',
-        '<(DEPTH)/cobalt/page_visibility/page_visibility.gyp:*',
         '<(DEPTH)/cobalt/render_tree/render_tree.gyp:*',
         '<(DEPTH)/cobalt/renderer/renderer.gyp:*',
         '<(DEPTH)/cobalt/renderer/sandbox/sandbox.gyp:*',
diff --git a/src/cobalt/build/build.id b/src/cobalt/build/build.id
index 5741ef3..ed5660c 100644
--- a/src/cobalt/build/build.id
+++ b/src/cobalt/build/build.id
@@ -1 +1 @@
-267865
\ No newline at end of file
+270962
\ No newline at end of file
diff --git a/src/cobalt/build/cobalt_configuration.gypi b/src/cobalt/build/cobalt_configuration.gypi
index b58645d..33e8adb 100644
--- a/src/cobalt/build/cobalt_configuration.gypi
+++ b/src/cobalt/build/cobalt_configuration.gypi
@@ -218,7 +218,7 @@
     'enable_account_manager%': 0,
 
     # Set to 1 to enable H5vccCrashLog.
-    'enable_crash_log%': 0,
+    'enable_crash_log%': 1,
 
     # Set to 1 to enable H5vccSSO (Single Sign On).
     'enable_sso%': 0,
diff --git a/src/cobalt/build/cobalt_configuration.py b/src/cobalt/build/cobalt_configuration.py
index 691c283..4e8d6bc 100644
--- a/src/cobalt/build/cobalt_configuration.py
+++ b/src/cobalt/build/cobalt_configuration.py
@@ -144,7 +144,6 @@
         'nb_test',
         'net_unittests',
         'network_test',
-        'page_visibility_test',
         'poem_unittests',
         'render_tree_test',
         'renderer_test',
diff --git a/src/cobalt/content/ssl/certs/157753a5.0 b/src/cobalt/content/ssl/certs/157753a5.0
deleted file mode 100644
index 20585f1..0000000
--- a/src/cobalt/content/ssl/certs/157753a5.0
+++ /dev/null
@@ -1,25 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU
-MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs
-IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290
-MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux
-FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h
-bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v
-dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt
-H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9
-uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX
-mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX
-a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN
-E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0
-WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD
-VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0
-Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU
-cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx
-IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN
-AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH
-YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5
-6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC
-Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX
-c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a
-mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
------END CERTIFICATE-----
diff --git a/src/cobalt/cssom/media_feature.cc b/src/cobalt/cssom/media_feature.cc
index 840ee74..ec31b15 100644
--- a/src/cobalt/cssom/media_feature.cc
+++ b/src/cobalt/cssom/media_feature.cc
@@ -55,12 +55,6 @@
 //   https://www.w3.org/TR/css3-mediaqueries/#grid
 static const int kGridMediaFeatureValue = 0;
 
-// The 'resolution' media feature describes the resolution of the output device,
-// i.e. the density of the pixels.
-//   https://www.w3.org/TR/css3-mediaqueries/#resolution
-// We calculate the pixel density from the length of the screen diagonal.
-static const float kScreenDefaultDiagonalInInches = 55.0f;
-
 // The 'scan' media feature describes the scanning process of "tv" output
 // devices.
 //   https://www.w3.org/TR/css3-mediaqueries/#scan
@@ -170,16 +164,7 @@
 bool MediaFeature::CompareResolution(const cssom::ViewportSize& viewport_size) {
   ResolutionValue* specified_value =
       base::polymorphic_downcast<ResolutionValue*>(value_.get());
-
-  float diagonal_pixels = sqrtf(
-      static_cast<float>(viewport_size.width() * viewport_size.width() +
-                         viewport_size.height() * viewport_size.height()));
-
-  float viewport_diagonal = viewport_size.diagonal_inches() > 0
-                                ? viewport_size.diagonal_inches()
-                                : kScreenDefaultDiagonalInInches;
-
-  float media_dpi = diagonal_pixels / viewport_diagonal;
+  float media_dpi = viewport_size.device_pixel_ratio() * 96;
 
   switch (operator_) {
     case kNonZero:
diff --git a/src/cobalt/cssom/media_feature_test.cc b/src/cobalt/cssom/media_feature_test.cc
index 03b9865..91b0b7c 100644
--- a/src/cobalt/cssom/media_feature_test.cc
+++ b/src/cobalt/cssom/media_feature_test.cc
@@ -601,16 +601,27 @@
       new MediaFeature(kResolutionMediaFeature));
   media_feature->set_operator(kNonZero);
 
-  EXPECT_FALSE(media_feature->EvaluateConditionValue(ViewportSize(0, 0)));
+  EXPECT_FALSE(media_feature->EvaluateConditionValue(
+      ViewportSize(1920, 1080, 55, 0.0f)));
 }
 
-TEST(MediaFeatureTest, ResolutionEqualsShouldEvaluateTrue) {
-  scoped_refptr<ResolutionValue> property(new ResolutionValue(100, kDPIUnit));
+TEST(MediaFeatureTest, ResolutionEqualsDefaultShouldEvaluateTrue) {
+  scoped_refptr<ResolutionValue> property(new ResolutionValue(96, kDPIUnit));
   scoped_refptr<MediaFeature> media_feature(
       new MediaFeature(kResolutionMediaFeature, property));
   media_feature->set_operator(kEquals);
 
-  EXPECT_TRUE(media_feature->EvaluateConditionValue(ViewportSize(5500, 0)));
+  EXPECT_TRUE(media_feature->EvaluateConditionValue(ViewportSize(1920, 1080)));
+}
+
+TEST(MediaFeatureTest, ResolutionEqualsHiDPIShouldEvaluateTrue) {
+  scoped_refptr<ResolutionValue> property(new ResolutionValue(192, kDPIUnit));
+  scoped_refptr<MediaFeature> media_feature(
+      new MediaFeature(kResolutionMediaFeature, property));
+  media_feature->set_operator(kEquals);
+
+  EXPECT_TRUE(media_feature->EvaluateConditionValue(
+      ViewportSize(1920, 1080, 55, 2.0f)));
 }
 
 TEST(MediaFeatureTest, ResolutionEqualsShouldEvaluateFalse) {
diff --git a/src/cobalt/cssom/viewport_size.h b/src/cobalt/cssom/viewport_size.h
index 656f69f..6efe128 100644
--- a/src/cobalt/cssom/viewport_size.h
+++ b/src/cobalt/cssom/viewport_size.h
@@ -28,21 +28,33 @@
   ViewportSize() = default;
   ViewportSize(const ViewportSize& other) = default;
   ViewportSize(int w, int h) : width_height_(w, h) {}
-  ViewportSize(int w, int h, float diag)
-      : width_height_(w, h), diagonal_inches_(diag) {}
+  ViewportSize(int w, int h, float diagonal_inches, float device_pixel_ratio)
+      : width_height_(w, h),
+        diagonal_inches_(diagonal_inches),
+        device_pixel_ratio_(device_pixel_ratio) {}
   int height() const { return width_height_.height(); }
   int width() const { return width_height_.width(); }
+  float device_pixel_ratio() const { return device_pixel_ratio_; }
   float diagonal_inches() const { return diagonal_inches_; }
   cobalt::math::Size width_height() const { return width_height_; }
   bool operator==(const ViewportSize& s) const {
     return width_height_ == s.width_height_ &&
-           diagonal_inches_ == s.diagonal_inches_;
+           diagonal_inches_ == s.diagonal_inches_ &&
+           device_pixel_ratio_ == s.device_pixel_ratio_;
   }
   bool operator!=(const ViewportSize& s) const { return !(*this == s); }
 
  private:
   cobalt::math::Size width_height_;
-  float diagonal_inches_ = 0;  // Note that 0 means "use a default".
+
+  // Size of the diagonal between two opposing screen corners in inches.
+  // A value of 0 means the size of the display is not known.
+  float diagonal_inches_ = 0;
+
+  // Ratio of CSS pixels per device pixel, matching the devicePixelRatio
+  // attribute.
+  //   https://www.w3.org/TR/2013/WD-cssom-view-20131217/#dom-window-devicepixelratio
+  float device_pixel_ratio_ = 1.0f;
 };
 
 }  // namespace cssom
diff --git a/src/cobalt/demos/content/crash-demo/crash-demo.html b/src/cobalt/demos/content/crash-demo/crash-demo.html
new file mode 100644
index 0000000..5ea1ebf
--- /dev/null
+++ b/src/cobalt/demos/content/crash-demo/crash-demo.html
@@ -0,0 +1,96 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+  <style>
+    body {
+      background-color: rgb(255, 255, 255);
+      font-family: Roboto;
+      font-size: 2em;
+    }
+
+    .highlight {
+      background-color: rgb(0, 255, 0);
+    }
+  </style>
+</head>
+
+<body>
+  <div>Previous exit status: <span id="status"></span></div>
+  <div id="menu"></div>
+  <script type="text/javascript">
+    const crash_types = {
+      out_of_memory: 'Out of memory',
+      null_dereference: 'Null dereference',
+      illegal_instruction: 'Illegal instruction',
+      debugger: 'Invoke debugger',
+      quit: 'Quit the demo'
+    }
+
+    const kIsDirty = "_exit_is_dirty";
+    const kDirtyValue = "1"
+
+    function log(str) {
+      console.log(str);
+    }
+    window.onunload = function () {
+      log("==Onunload called==");
+      localStorage.removeItem(kIsDirty);
+    }
+    window.onload = function () {
+      log("==Onload called==");
+      var menu = document.getElementById('menu');
+      for (key in crash_types) {
+        console.log("key" + key);
+        var el = document.createElement('div');
+        el.id = key;
+        el.textContent = crash_types[key];
+        menu.appendChild(el);
+      }
+      clean_exit = localStorage.getItem(kIsDirty) == kDirtyValue ? "crashed" : "clean";
+      localStorage.setItem(kIsDirty, kDirtyValue)
+
+      var menu = document.getElementById('menu').children;
+      var index = 0;
+
+      document.getElementById("status").textContent += clean_exit;
+
+      function refresh() {
+        log("Refresh");
+        var textBox = document.getElementById('textBox');
+        for (let i = 0; i < menu.length; i++) {
+          if (i == index) {
+            menu[i].classList.add('highlight');
+          } else {
+            menu[i].classList.remove('highlight');
+          }
+        }
+      }
+      document.addEventListener('keydown', function (e) {
+        if ([37, 38, 32782, 32780].includes(e.keyCode)) { // left, up, android left, up
+          index -= 1;
+        } else if ([39, 40, 32781, 32783].includes(e.keyCode)) { //right, down, android right, down
+          index += 1;
+        } else if ([13, 32768].includes(e.keyCode)) { // enter, android enter
+          var crashType = menu[index].id;
+          if (crashType === "quit") {
+            log("Calling window.close()");
+            window.close()
+            return;
+          }
+          if ('h5vcc' in window) {
+            log("Crashing with " + crashType);
+            h5vcc.crashLog.triggerCrash(crashType);
+          } else {
+            log("No h5vcc, will not crash " + crashType);
+          }
+        }
+        index = (index + menu.length) % menu.length;
+        refresh();
+      });
+      refresh();
+    }
+  </script>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/src/cobalt/demos/content/media-query/media-query-test.html b/src/cobalt/demos/content/media-query/media-query-test.html
index 7534b08..1f9e385 100644
--- a/src/cobalt/demos/content/media-query/media-query-test.html
+++ b/src/cobalt/demos/content/media-query/media-query-test.html
@@ -1,47 +1,60 @@
 <!DOCTYPE html>
 <html>
 <head>
-  <script type="text/javascript">
+  <script type='text/javascript'>
     // Demonstrates how media query can be used to get the value of the
-    // window resolution.
-    function PrintWindowWidth() {
-      for (var i = 0; i < 16000; ++i) {
-        query_str = "(max-width: " + i + "px)"
-        if (window.matchMedia(query_str).matches) {
-          console.log("Found window width: " + query_str);
-          return;
-        }
-      }
-      console.log("Error: Could not find window width.");
+    // window resolution, width, and height.
+
+    function log_info(message) {
+      console.log(message);
+      document.getElementById('info').innerHTML += message + '.\n';
+    }
+    function log_error(message) {
+      console.log('Error: ' + message);
+      document.getElementById('error').innerHTML += message + '.\n';
     }
 
-    function PrintWindowHeight() {
-      for (var i = 0; i < 16000; ++i) {
-        query_str = "(max-height: " + i + "px)";
+    function search(low, high, query, units) {
+      var precision = 1/32;
+      while (low < high - precision) {
+        var mid = Math.floor((low + high) / 2 / precision) * precision;
+        query_str = '(max-' + query + ':' + mid + units + ')'
         if (window.matchMedia(query_str).matches) {
-          console.log("Found window height: " + query_str);
-          return;
+          // The window value is less than or equal to result.
+          high = mid;
+        } else {
+          // The window value is greater than result.
+          low = mid;
         }
       }
-      console.log("Error: Could not find window height.");
+      return high;
+    }
+
+    function PrintWindowSize() {
+      var width = search(0, 16000, 'width', 'px');
+      var height = search(0, 16000, 'height', 'px');
+      log_info('media size: ' + width + 'x' + height);
+      if (Math.abs(width - window.innerWidth) >= 1) {
+        log_error('width does not match window.innerWidth');
+      }
+      if (Math.abs(height - window.innerHeight) >= 1) {
+        log_error('height does not match window.innerHeight');
+      }
     }
 
     function PrintDpi() {
-      for (var i = 1; i < 16000; ++i) {
-        query_str = "(max-resolution:" + i + "dpi)"
-        if (window.matchMedia(query_str).matches) {
-          console.log("Found dpi: " + query_str);
-          return;
-        }
+      var dpi = search(0, 16000, 'resolution', 'dpi');
+      log_info('resolution dpi: ' + dpi +
+               ', window.devicePixelRatio: ' + window.devicePixelRatio);
+      if (Math.abs(dpi - 96 * window.devicePixelRatio) > 1) {
+        log_error('resolution does not match devicePixelRatio');
       }
-      console.log("Error: Could not find window dpi.");
     }
 
 
     function intervalCallback() {
       PrintDpi();
-      PrintWindowHeight();
-      PrintWindowWidth();
+      PrintWindowSize();
     }
 
     window.setInterval(intervalCallback, 500);
@@ -49,5 +62,7 @@
 </head>
 
 <body>
+  <span id='error' style='white-space: pre; background-color:#FF0000'></span>
+  <span id='info' style='white-space: pre; background-color:#00FF00'></span>
 </body>
 </html>
diff --git a/src/cobalt/demos/content/screen_diagonal/screen_diagonal.html b/src/cobalt/demos/content/screen_diagonal/screen_diagonal.html
new file mode 100644
index 0000000..489be33
--- /dev/null
+++ b/src/cobalt/demos/content/screen_diagonal/screen_diagonal.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <script type="text/javascript">
+    // Demonstrates how to get the size of the screen diagonal.
+
+    function log_info(message) {
+      console.log(message);
+      document.getElementById('info').innerHTML += message + '.\n';
+    }
+    function log_error(message) {
+      console.log('Error: ' + message);
+      document.getElementById('error').innerHTML += message + '.\n';
+    }
+
+    function PrintScreenDiagonal() {
+      if (window.H5vccScreen && window.H5vccScreen.GetDiagonal) {
+        log_info("Screen Diagonal: " + H5vccScreen.GetDiagonal() + " inches.");
+      } else {
+        log_error("Screen Diagonal not available");
+      }
+    }
+
+
+    window.setInterval(PrintScreenDiagonal, 500);
+  </script>
+</head>
+
+<body>
+  <span id='error' style='white-space: pre; background-color:#FF0000'></span>
+  <span id='info' style='white-space: pre; background-color:#00FF00'></span>
+</body>
+</html>
diff --git a/src/cobalt/doc/performance_tuning.md b/src/cobalt/doc/performance_tuning.md
index 62a4af5..6e1f12a 100644
--- a/src/cobalt/doc/performance_tuning.md
+++ b/src/cobalt/doc/performance_tuning.md
@@ -200,14 +200,10 @@
 
 Some platforms require that the display buffer is swapped frequently, and
 so in these cases Cobalt will render the scene every frame, even if it is
-not changing, which consumes CPU resources.  This behavior is defined by the
-value of `SB_MUST_FREQUENTLY_FLIP_DISPLAY_BUFFER` in your platform's
-`configuration_public.h` file.  Unless your platform is restricted in this
-aspect, you should ensure that `SB_MUST_FREQUENTLY_FLIP_DISPLAY_BUFFER`
-is set to `0`.  If the platform needs a new frame submitted periodically,
-an alternative to setting `SB_MUST_FREQUENTLY_FLIP_DISPLAY_BUFFER` to `1`
-is to implement the Cobalt Extension "dev.cobalt.extension.Graphics" and
-report the maximum frame interval via `GetMaximumFrameIntervalInMilliseconds`.
+not changing, which consumes CPU resources.  If the platform needs a new frame
+submitted periodically implement the Cobalt Extension
+"dev.cobalt.extension.Graphics" and report the maximum frame interval via
+`GetMaximumFrameIntervalInMilliseconds`.
 
 See `SbSystemGetExtension` and
 [`CobaltExtensionGraphicsApi`](../extension/graphics.h).
@@ -252,7 +248,7 @@
 processed (e.g. in response to a key press) before images are decoded.  Thus
 having support for priorities can improve the overall performance of the
 application.  To enable thread priority support, you should set the value
-of `SB_HAS_THREAD_PRIORITY_SUPPORT` to `1` in your `configuration_public.h`
+of `kSbHasThreadPrioritySupport` to `true` in your `configuration_constants.h`
 file, and then also ensure that your platform's implementation of
 `SbThreadCreate()` properly forwards the priority parameter down to the
 platform.
@@ -297,15 +293,6 @@
 **Tags:** *framerate, startup, browse-to-watch, input latency*
 
 
-#### The GCC '-mplt' flag for MIPS architectures
-The '-mplt' flag has been found to improve all around performance by
-~20% on MIPS architecture platforms.  If your platform has a MIPS
-architecture, it is suggested that you enable this flag in gold builds.
-
-**Tags:** *gyp_configuration.gypi, framerate, startup, browse-to-watch,
-           input latency.*
-
-
 ### Close "Stats for Nerds" when measuring performance
 
 The YouTube web app offers a feature called "Stats for Nerds" that enables
diff --git a/src/cobalt/dom/custom_event_test.cc b/src/cobalt/dom/custom_event_test.cc
index 5d19f85..e68d44d 100644
--- a/src/cobalt/dom/custom_event_test.cc
+++ b/src/cobalt/dom/custom_event_test.cc
@@ -72,7 +72,7 @@
     engine_ = script::JavaScriptEngine::CreateEngine();
     global_environment_ = engine_->CreateGlobalEnvironment();
     window_ = new Window(
-        environment_settings_.get(), ViewportSize(1920, 1080), 1.f,
+        environment_settings_.get(), ViewportSize(1920, 1080),
         base::kApplicationStateStarted, css_parser_.get(), dom_parser_.get(),
         fetcher_factory_.get(), loader_factory_.get(), NULL, NULL, NULL, NULL,
         NULL, NULL, &local_storage_database_, NULL, NULL, NULL, NULL,
diff --git a/src/cobalt/dom/document.cc b/src/cobalt/dom/document.cc
index 9e93334..dceed45 100644
--- a/src/cobalt/dom/document.cc
+++ b/src/cobalt/dom/document.cc
@@ -992,8 +992,7 @@
   // Ignored by this class.
 }
 
-void Document::OnVisibilityStateChanged(
-    page_visibility::VisibilityState visibility_state) {
+void Document::OnVisibilityStateChanged(VisibilityState visibility_state) {
   DispatchEvent(new Event(base::Tokens::visibilitychange(), Event::kBubbles,
                           Event::kNotCancelable));
 }
diff --git a/src/cobalt/dom/document.h b/src/cobalt/dom/document.h
index b0bf4e6..03e11ce 100644
--- a/src/cobalt/dom/document.h
+++ b/src/cobalt/dom/document.h
@@ -45,12 +45,12 @@
 #include "cobalt/dom/intersection_observer_task_manager.h"
 #include "cobalt/dom/location.h"
 #include "cobalt/dom/node.h"
+#include "cobalt/dom/page_visibility_state.h"
 #include "cobalt/dom/pointer_state.h"
+#include "cobalt/dom/visibility_state.h"
 #include "cobalt/math/size.h"
 #include "cobalt/network_bridge/cookie_jar.h"
 #include "cobalt/network_bridge/net_poster.h"
-#include "cobalt/page_visibility/page_visibility_state.h"
-#include "cobalt/page_visibility/visibility_state.h"
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/wrappable.h"
 #include "url/gurl.h"
@@ -95,7 +95,7 @@
 //   https://www.w3.org/TR/dom/#document
 class Document : public Node,
                  public cssom::MutationObserver,
-                 public page_visibility::PageVisibilityState::Observer {
+                 public PageVisibilityState::Observer {
  public:
   struct Options {
     Options()
@@ -400,10 +400,8 @@
   void DisableJit();
 
   // Page Visibility fields.
-  bool hidden() const {
-    return visibility_state() == page_visibility::kVisibilityStateHidden;
-  }
-  page_visibility::VisibilityState visibility_state() const {
+  bool hidden() const { return visibility_state() == kVisibilityStateHidden; }
+  VisibilityState visibility_state() const {
     return page_visibility_state()->GetVisibilityState();
   }
   const EventListenerScriptValue* onvisibilitychange() const {
@@ -413,10 +411,9 @@
     SetAttributeEventListener(base::Tokens::visibilitychange(), event_listener);
   }
 
-  // page_visibility::PageVisibilityState::Observer implementation.
+  // PageVisibilityState::Observer implementation.
   void OnWindowFocusChanged(bool has_focus) override;
-  void OnVisibilityStateChanged(
-      page_visibility::VisibilityState visibility_state) override;
+  void OnVisibilityStateChanged(VisibilityState visibility_state) override;
 
   PointerState* pointer_state() { return &pointer_state_; }
 
@@ -439,11 +436,11 @@
  protected:
   ~Document() override;
 
-  page_visibility::PageVisibilityState* page_visibility_state() {
+  PageVisibilityState* page_visibility_state() {
     return html_element_context_->page_visibility_state().get();
   }
 
-  const page_visibility::PageVisibilityState* page_visibility_state() const {
+  const PageVisibilityState* page_visibility_state() const {
     return html_element_context_->page_visibility_state().get();
   }
 
@@ -472,7 +469,7 @@
   // It is possible that we destroy the page visibility state object before
   // Document, during shutdown, so this allows us to handle that situation
   // more gracefully than crashing.
-  base::WeakPtr<page_visibility::PageVisibilityState> page_visibility_state_;
+  base::WeakPtr<PageVisibilityState> page_visibility_state_;
 
   // Reference to the associated window object.
   Window* window_;
diff --git a/src/cobalt/page_visibility/document.idl b/src/cobalt/dom/document_page_visibility.idl
similarity index 100%
rename from src/cobalt/page_visibility/document.idl
rename to src/cobalt/dom/document_page_visibility.idl
diff --git a/src/cobalt/dom/dom.gyp b/src/cobalt/dom/dom.gyp
index 7ed14b7..e173cac 100644
--- a/src/cobalt/dom/dom.gyp
+++ b/src/cobalt/dom/dom.gyp
@@ -252,6 +252,8 @@
         'on_screen_keyboard.cc',
         'on_screen_keyboard.h',
         'on_screen_keyboard_bridge.h',
+        'page_visibility_state.cc',
+        'page_visibility_state.h',
         'performance.cc',
         'performance.h',
         'performance_timing.cc',
@@ -337,7 +339,6 @@
         '<(DEPTH)/cobalt/media_session/media_session.gyp:media_session',
         # Interface layer to avoid directly depending on network.
         '<(DEPTH)/cobalt/network_bridge/network_bridge.gyp:network_bridge',
-        '<(DEPTH)/cobalt/page_visibility/page_visibility.gyp:page_visibility',
         '<(DEPTH)/cobalt/script/script.gyp:script',
         '<(DEPTH)/cobalt/speech/speech.gyp:speech',
         '<(DEPTH)/cobalt/storage/storage.gyp:storage',
diff --git a/src/cobalt/dom/dom_test.gyp b/src/cobalt/dom/dom_test.gyp
index f0b181f..39f61d4 100644
--- a/src/cobalt/dom/dom_test.gyp
+++ b/src/cobalt/dom/dom_test.gyp
@@ -57,6 +57,7 @@
         'node_list_test.cc',
         'node_test.cc',
         'on_screen_keyboard_test.cc',
+        'page_visibility_state_test.cc',
         'performance_test.cc',
         'rule_matching_test.cc',
         'screen_test.cc',
diff --git a/src/cobalt/dom/error_event_test.cc b/src/cobalt/dom/error_event_test.cc
index 05d7bce..c4d4c7c 100644
--- a/src/cobalt/dom/error_event_test.cc
+++ b/src/cobalt/dom/error_event_test.cc
@@ -74,10 +74,10 @@
 
     ViewportSize view_size(1920, 1080);
     window_ = new Window(
-        environment_settings_.get(), view_size, 1.f,
-        base::kApplicationStateStarted, css_parser_.get(), dom_parser_.get(),
-        fetcher_factory_.get(), loader_factory_.get(), NULL, NULL, NULL, NULL,
-        NULL, NULL, &local_storage_database_, NULL, NULL, NULL, NULL,
+        environment_settings_.get(), view_size, base::kApplicationStateStarted,
+        css_parser_.get(), dom_parser_.get(), fetcher_factory_.get(),
+        loader_factory_.get(), NULL, NULL, NULL, NULL, NULL, NULL,
+        &local_storage_database_, NULL, NULL, NULL, NULL,
         global_environment_->script_value_factory(), NULL, NULL, url_, "",
         "en-US", "en", base::Callback<void(const GURL&)>(),
         base::Bind(&MockLoadCompleteCallback::Run,
diff --git a/src/cobalt/dom/html_element_context.h b/src/cobalt/dom/html_element_context.h
index 56d4295..ed55e92 100644
--- a/src/cobalt/dom/html_element_context.h
+++ b/src/cobalt/dom/html_element_context.h
@@ -23,6 +23,7 @@
 #include "cobalt/base/application_state.h"
 #include "cobalt/cssom/css_parser.h"
 #include "cobalt/dom/dom_stat_tracker.h"
+#include "cobalt/dom/page_visibility_state.h"
 #include "cobalt/dom/parser.h"
 #include "cobalt/dom/url_registry.h"
 #include "cobalt/loader/fetcher_factory.h"
@@ -32,7 +33,6 @@
 #include "cobalt/loader/mesh/mesh_cache.h"
 #include "cobalt/media/can_play_type_handler.h"
 #include "cobalt/media/web_media_player_factory.h"
-#include "cobalt/page_visibility/page_visibility_state.h"
 #include "cobalt/script/environment_settings.h"
 #include "cobalt/script/script_runner.h"
 #include "cobalt/script/script_value_factory.h"
@@ -156,7 +156,7 @@
     return reduced_image_cache_capacity_manager_;
   }
 
-  base::WeakPtr<page_visibility::PageVisibilityState> page_visibility_state() {
+  base::WeakPtr<PageVisibilityState> page_visibility_state() {
     return page_visibility_state_weak_ptr_factory_.GetWeakPtr();
   }
 
@@ -185,8 +185,8 @@
   loader::mesh::MeshCache* const mesh_cache_;
   DomStatTracker* const dom_stat_tracker_;
   const std::string font_language_script_;
-  page_visibility::PageVisibilityState page_visibility_state_;
-  base::WeakPtrFactory<page_visibility::PageVisibilityState>
+  PageVisibilityState page_visibility_state_;
+  base::WeakPtrFactory<PageVisibilityState>
       page_visibility_state_weak_ptr_factory_;
   const float video_playback_rate_multiplier_;
   base::WaitableEvent* synchronous_loader_interrupt_ = nullptr;
diff --git a/src/cobalt/dom/lottie_frame_custom_event.h b/src/cobalt/dom/lottie_frame_custom_event.h
new file mode 100644
index 0000000..d2cd62c
--- /dev/null
+++ b/src/cobalt/dom/lottie_frame_custom_event.h
@@ -0,0 +1,53 @@
+// Copyright 2020 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef COBALT_DOM_LOTTIE_FRAME_CUSTOM_EVENT_H_
+#define COBALT_DOM_LOTTIE_FRAME_CUSTOM_EVENT_H_
+
+#include <memory>
+#include <string>
+
+#include "cobalt/dom/event.h"
+#include "cobalt/dom/lottie_frame_custom_event_detail.h"
+
+namespace cobalt {
+namespace dom {
+
+// Lottie frame events carry custom data about the frame rendered and how far
+// the animation has played.
+//   https://lottiefiles.github.io/lottie-player/events.html
+class LottieFrameCustomEvent : public Event {
+ public:
+  explicit LottieFrameCustomEvent(const std::string& type) : Event(type) {}
+  LottieFrameCustomEvent(const std::string& type, const EventInit& init_dict)
+      : Event(type, init_dict) {}
+
+  void set_detail(const LottieFrameCustomEventDetail& detail) {
+    detail_ = detail;
+  }
+
+  const LottieFrameCustomEventDetail& detail() const { return detail_; }
+
+  DEFINE_WRAPPABLE_TYPE(LottieFrameCustomEvent);
+
+ protected:
+  ~LottieFrameCustomEvent() override {}
+
+  LottieFrameCustomEventDetail detail_;
+};
+
+}  // namespace dom
+}  // namespace cobalt
+
+#endif  // COBALT_DOM_LOTTIE_FRAME_CUSTOM_EVENT_H_
diff --git a/src/cobalt/dom/lottie_frame_custom_event.idl b/src/cobalt/dom/lottie_frame_custom_event.idl
new file mode 100644
index 0000000..da7b376
--- /dev/null
+++ b/src/cobalt/dom/lottie_frame_custom_event.idl
@@ -0,0 +1,20 @@
+// Copyright 2020 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Custom interface for the LottiePlayer frame event.
+// https://lottiefiles.github.io/lottie-player/events.html
+[Constructor(DOMString type, optional EventInit eventInitDict)]
+interface LottieFrameCustomEvent : Event {
+  attribute LottieFrameCustomEventDetail detail;
+};
diff --git a/src/cobalt/dom/lottie_frame_custom_event_detail.idl b/src/cobalt/dom/lottie_frame_custom_event_detail.idl
new file mode 100644
index 0000000..04054be
--- /dev/null
+++ b/src/cobalt/dom/lottie_frame_custom_event_detail.idl
@@ -0,0 +1,20 @@
+// Copyright 2020 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Custom dictionary for storing Lottie frame event information.
+// https://lottiefiles.github.io/lottie-player/events.html
+dictionary LottieFrameCustomEventDetail {
+  double frame = 0;
+  double seeker = 0;
+};
diff --git a/src/cobalt/dom/lottie_player.cc b/src/cobalt/dom/lottie_player.cc
index 5b3fc1e..3ee7c9d 100644
--- a/src/cobalt/dom/lottie_player.cc
+++ b/src/cobalt/dom/lottie_player.cc
@@ -17,7 +17,6 @@
 #include <memory>
 #include <string>
 
-#include "base/message_loop/message_loop.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/trace_event/trace_event.h"
 #include "cobalt/base/polymorphic_downcast.h"
@@ -25,6 +24,7 @@
 #include "cobalt/dom/document.h"
 #include "cobalt/dom/dom_settings.h"
 #include "cobalt/dom/html_element_context.h"
+#include "cobalt/dom/lottie_frame_custom_event.h"
 #include "cobalt/dom/window.h"
 #include "cobalt/script/global_environment.h"
 #include "url/gurl.h"
@@ -39,7 +39,8 @@
 LottiePlayer::LottiePlayer(Document* document)
     : HTMLElement(document, base::Token(kTagName)),
       autoplaying_(true),
-      ALLOW_THIS_IN_INITIALIZER_LIST(event_queue_(this)) {
+      ALLOW_THIS_IN_INITIALIZER_LIST(event_queue_(this)),
+      callback_task_runner_(base::MessageLoop::current()->task_runner()) {
   SetAnimationEventCallbacks();
 }
 
@@ -61,6 +62,14 @@
   }
 }
 
+std::string LottiePlayer::background() const {
+  return GetAttribute("background").value_or("");
+}
+
+void LottiePlayer::set_background(std::string background) {
+  SetAttribute("background", background);
+}
+
 int LottiePlayer::count() const { return properties_.count; }
 
 void LottiePlayer::set_count(int count) {
@@ -196,6 +205,8 @@
                                   const std::string& value) {
   if (name == "src") {
     UpdateAnimationData();
+  } else if (name == "background") {
+    SetStyleAttribute("background:" + value);
   } else if (name == "count") {
     int count;
     base::StringToInt32(value, &count);
@@ -220,6 +231,8 @@
 void LottiePlayer::OnRemoveAttribute(const std::string& name) {
   if (name == "src") {
     UpdateAnimationData();
+  } else if (name == "background") {
+    SetStyleAttribute("background:transparent");
   } else if (name == "count") {
     SetCount(LottieAnimation::LottieProperties::kDefaultCount);
   } else if (name == "direction") {
@@ -391,26 +404,30 @@
 }
 
 void LottiePlayer::SetAnimationEventCallbacks() {
-  properties_.onplay_callback = base::Bind(
-      base::IgnoreResult(&base::SingleThreadTaskRunner::PostTask),
-      base::Unretained(base::MessageLoop::current()->task_runner().get()),
-      FROM_HERE, base::Bind(&LottiePlayer::OnPlay, base::AsWeakPtr(this)));
-  properties_.onpause_callback = base::Bind(
-      base::IgnoreResult(&base::SingleThreadTaskRunner::PostTask),
-      base::Unretained(base::MessageLoop::current()->task_runner().get()),
-      FROM_HERE, base::Bind(&LottiePlayer::OnPause, base::AsWeakPtr(this)));
-  properties_.onstop_callback = base::Bind(
-      base::IgnoreResult(&base::SingleThreadTaskRunner::PostTask),
-      base::Unretained(base::MessageLoop::current()->task_runner().get()),
-      FROM_HERE, base::Bind(&LottiePlayer::OnStop, base::AsWeakPtr(this)));
-  properties_.oncomplete_callback = base::Bind(
-      base::IgnoreResult(&base::SingleThreadTaskRunner::PostTask),
-      base::Unretained(base::MessageLoop::current()->task_runner().get()),
-      FROM_HERE, base::Bind(&LottiePlayer::OnComplete, base::AsWeakPtr(this)));
-  properties_.onloop_callback = base::Bind(
-      base::IgnoreResult(&base::SingleThreadTaskRunner::PostTask),
-      base::Unretained(base::MessageLoop::current()->task_runner().get()),
-      FROM_HERE, base::Bind(&LottiePlayer::OnLoop, base::AsWeakPtr(this)));
+  DCHECK(callback_task_runner_);
+  properties_.onplay_callback =
+      base::Bind(base::IgnoreResult(&base::SingleThreadTaskRunner::PostTask),
+                 callback_task_runner_, FROM_HERE,
+                 base::Bind(&LottiePlayer::OnPlay, base::AsWeakPtr(this)));
+  properties_.onpause_callback =
+      base::Bind(base::IgnoreResult(&base::SingleThreadTaskRunner::PostTask),
+                 callback_task_runner_, FROM_HERE,
+                 base::Bind(&LottiePlayer::OnPause, base::AsWeakPtr(this)));
+  properties_.onstop_callback =
+      base::Bind(base::IgnoreResult(&base::SingleThreadTaskRunner::PostTask),
+                 callback_task_runner_, FROM_HERE,
+                 base::Bind(&LottiePlayer::OnStop, base::AsWeakPtr(this)));
+  properties_.oncomplete_callback =
+      base::Bind(base::IgnoreResult(&base::SingleThreadTaskRunner::PostTask),
+                 callback_task_runner_, FROM_HERE,
+                 base::Bind(&LottiePlayer::OnComplete, base::AsWeakPtr(this)));
+  properties_.onloop_callback =
+      base::Bind(base::IgnoreResult(&base::SingleThreadTaskRunner::PostTask),
+                 callback_task_runner_, FROM_HERE,
+                 base::Bind(&LottiePlayer::OnLoop, base::AsWeakPtr(this)));
+  properties_.onenterframe_callback = base::Bind(
+      &LottiePlayer::CallOnEnterFrame, callback_task_runner_,
+      base::Bind(&LottiePlayer::OnEnterFrame, base::AsWeakPtr(this)));
 }
 
 void LottiePlayer::OnPlay() { ScheduleEvent(base::Tokens::play()); }
@@ -423,5 +440,25 @@
 
 void LottiePlayer::OnLoop() { ScheduleEvent(base::Tokens::loop()); }
 
+void LottiePlayer::OnEnterFrame(double frame, double seeker) {
+  LottieFrameCustomEventDetail detail;
+  detail.set_frame(frame);
+  detail.set_seeker(seeker);
+
+  scoped_refptr<LottieFrameCustomEvent> lottie_frame_custom_event =
+      new LottieFrameCustomEvent("frame");
+  lottie_frame_custom_event->set_detail(detail);
+  lottie_frame_custom_event->set_target(this);
+  event_queue_.Enqueue(lottie_frame_custom_event);
+}
+
+void LottiePlayer::CallOnEnterFrame(
+    scoped_refptr<base::SingleThreadTaskRunner> callback_task_runner,
+    base::Callback<void(double, double)> enter_frame_callback, double frame,
+    double seeker) {
+  callback_task_runner->PostTask(
+      FROM_HERE, base::Bind(enter_frame_callback, frame, seeker));
+}
+
 }  // namespace dom
 }  // namespace cobalt
diff --git a/src/cobalt/dom/lottie_player.h b/src/cobalt/dom/lottie_player.h
index d246964..5151138 100644
--- a/src/cobalt/dom/lottie_player.h
+++ b/src/cobalt/dom/lottie_player.h
@@ -17,6 +17,7 @@
 
 #include <string>
 
+#include "base/message_loop/message_loop.h"
 #include "cobalt/dom/event_queue.h"
 #include "cobalt/dom/html_element.h"
 #include "cobalt/loader/image/image_cache.h"
@@ -52,6 +53,8 @@
   void set_src(const std::string& src);
   bool autoplay() const;
   void set_autoplay(bool loop);
+  std::string background() const;
+  void set_background(std::string background);
   int count() const;
   void set_count(int count);
   int direction() const;
@@ -122,11 +125,17 @@
   void ScheduleEvent(base::Token event_name);
   void SetAnimationEventCallbacks();
 
+  // These are callbacks triggered during animation playback.
   void OnPlay();
   void OnPause();
   void OnStop();
   void OnComplete();
   void OnLoop();
+  void OnEnterFrame(double frame, double seeker);
+  static void CallOnEnterFrame(
+      scoped_refptr<base::SingleThreadTaskRunner> callback_task_runner,
+      base::Callback<void(double, double)> enter_frame_callback, double frame,
+      double seeker);
 
   scoped_refptr<loader::image::CachedImage> cached_image_;
   std::unique_ptr<loader::image::CachedImage::OnLoadedCallbackHandler>
@@ -141,6 +150,7 @@
   LottieAnimation::LottieProperties properties_;
 
   EventQueue event_queue_;
+  scoped_refptr<base::SingleThreadTaskRunner> callback_task_runner_;
 };
 
 }  // namespace dom
diff --git a/src/cobalt/dom/lottie_player.idl b/src/cobalt/dom/lottie_player.idl
index 6da5242..ea4b975 100644
--- a/src/cobalt/dom/lottie_player.idl
+++ b/src/cobalt/dom/lottie_player.idl
@@ -19,6 +19,7 @@
 interface LottiePlayer : HTMLElement {
   attribute DOMString src;
   attribute boolean autoplay;
+  attribute DOMString background;
   attribute long count;
   attribute long direction;
   attribute DOMString mode;
diff --git a/src/cobalt/dom/media_query_list.cc b/src/cobalt/dom/media_query_list.cc
index 4a73af5..eac794a 100644
--- a/src/cobalt/dom/media_query_list.cc
+++ b/src/cobalt/dom/media_query_list.cc
@@ -42,7 +42,8 @@
   }
   ViewportSize viewport(math::ToRoundedInt(screen_->avail_width()),
                         math::ToRoundedInt(screen_->avail_height()),
-                        screen_->diagonal_inches());
+                        screen_->diagonal_inches(),
+                        screen_->device_pixel_ratio());
   return media_list_->EvaluateConditionValue(viewport);
 }
 
diff --git a/src/cobalt/dom/on_screen_keyboard_test.cc b/src/cobalt/dom/on_screen_keyboard_test.cc
index d5366b2..7a98f60 100644
--- a/src/cobalt/dom/on_screen_keyboard_test.cc
+++ b/src/cobalt/dom/on_screen_keyboard_test.cc
@@ -206,7 +206,7 @@
         global_environment_(engine_->CreateGlobalEnvironment()),
         on_screen_keyboard_bridge_(new OnScreenKeyboardMockBridge()),
         window_(new Window(
-            environment_settings_.get(), ViewportSize(1920, 1080), 1.f,
+            environment_settings_.get(), ViewportSize(1920, 1080),
             base::kApplicationStateStarted, css_parser_.get(),
             dom_parser_.get(), fetcher_factory_.get(), loader_factory_.get(),
             NULL, NULL, NULL, NULL, NULL, NULL, &local_storage_database_, NULL,
diff --git a/src/cobalt/dom/page_visibility_state.cc b/src/cobalt/dom/page_visibility_state.cc
new file mode 100644
index 0000000..19e7147
--- /dev/null
+++ b/src/cobalt/dom/page_visibility_state.cc
@@ -0,0 +1,178 @@
+// Copyright 2017 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "cobalt/dom/page_visibility_state.h"
+
+#include "base/strings/stringprintf.h"
+#include "base/trace_event/trace_event.h"
+
+namespace cobalt {
+namespace dom {
+
+#define STATE_STRING(state)                                             \
+  base::StringPrintf("%s (%d)", base::GetApplicationStateString(state), \
+                     static_cast<int>(state))
+
+namespace {
+// Converts an ApplicationState to a VisibilityState.
+VisibilityState ToVisibilityState(base::ApplicationState state) {
+  switch (state) {
+    case base::kApplicationStatePreloading:
+      return kVisibilityStatePrerender;
+    case base::kApplicationStateStarted:
+    case base::kApplicationStatePaused:
+      return kVisibilityStateVisible;
+    case base::kApplicationStateSuspended:
+    case base::kApplicationStateStopped:
+      return kVisibilityStateHidden;
+    default:
+      NOTREACHED() << "Invalid Application State: " << STATE_STRING(state);
+      return kVisibilityStateHidden;
+  }
+}
+
+bool HasFocus(base::ApplicationState state) {
+  switch (state) {
+    case base::kApplicationStateStarted:
+      return true;
+    case base::kApplicationStatePreloading:
+    case base::kApplicationStatePaused:
+    case base::kApplicationStateSuspended:
+    case base::kApplicationStateStopped:
+      return false;
+    default:
+      NOTREACHED() << "Invalid Application State: " << STATE_STRING(state);
+      return false;
+  }
+}
+}  // namespace
+
+PageVisibilityState::PageVisibilityState()
+    : application_state_(base::kApplicationStateStarted) {
+  DLOG(INFO) << __FUNCTION__
+             << ": app_state=" << STATE_STRING(application_state_);
+}
+
+PageVisibilityState::PageVisibilityState(
+    base::ApplicationState initial_application_state)
+    : application_state_(initial_application_state) {
+  DLOG(INFO) << __FUNCTION__
+             << ": app_state=" << STATE_STRING(application_state_);
+  DCHECK((application_state_ == base::kApplicationStateStarted) ||
+         (application_state_ == base::kApplicationStatePreloading) ||
+         (application_state_ == base::kApplicationStatePaused))
+      << "application_state_=" << STATE_STRING(application_state_);
+}
+
+bool PageVisibilityState::HasWindowFocus() const {
+  return HasFocus(application_state());
+}
+
+VisibilityState PageVisibilityState::GetVisibilityState() const {
+  return ToVisibilityState(application_state());
+}
+
+void PageVisibilityState::SetApplicationState(base::ApplicationState state) {
+  TRACE_EVENT1("cobalt::dom", "PageVisibilityState::SetApplicationState",
+               "state", STATE_STRING(state));
+  if (application_state_ == state) {
+    DLOG(WARNING) << __FUNCTION__ << ": Attempt to re-enter "
+                  << STATE_STRING(application_state_);
+    return;
+  }
+
+  // Audit that the transitions are correct.
+  if (DLOG_IS_ON(FATAL)) {
+    switch (application_state_) {
+      case base::kApplicationStatePaused:
+        DCHECK(state == base::kApplicationStateSuspended ||
+               state == base::kApplicationStateStarted)
+            << ": application_state_=" << STATE_STRING(application_state_)
+            << ", state=" << STATE_STRING(state);
+
+        break;
+      case base::kApplicationStatePreloading:
+        DCHECK(state == base::kApplicationStateSuspended ||
+               state == base::kApplicationStateStarted)
+            << ": application_state_=" << STATE_STRING(application_state_)
+            << ", state=" << STATE_STRING(state);
+        break;
+      case base::kApplicationStateStarted:
+        DCHECK(state == base::kApplicationStatePaused)
+            << ": application_state_=" << STATE_STRING(application_state_)
+            << ", state=" << STATE_STRING(state);
+        break;
+      case base::kApplicationStateStopped:
+        DCHECK(state == base::kApplicationStatePreloading ||
+               state == base::kApplicationStateStarted)
+            << ": application_state_=" << STATE_STRING(application_state_)
+            << ", state=" << STATE_STRING(state);
+        break;
+      case base::kApplicationStateSuspended:
+        DCHECK(state == base::kApplicationStatePaused ||
+               state == base::kApplicationStateStopped)
+            << ": application_state_=" << STATE_STRING(application_state_)
+            << ", state=" << STATE_STRING(state);
+        break;
+      default:
+        NOTREACHED() << ": application_state_="
+                     << STATE_STRING(application_state_)
+                     << ", state=" << STATE_STRING(state);
+
+        break;
+    }
+  }
+
+  bool old_has_focus = HasFocus(application_state_);
+  VisibilityState old_visibility_state = ToVisibilityState(application_state_);
+  DLOG(INFO) << __FUNCTION__ << ": " << STATE_STRING(application_state_)
+             << " -> " << STATE_STRING(state);
+  application_state_ = state;
+  bool has_focus = HasFocus(application_state_);
+  VisibilityState visibility_state = ToVisibilityState(application_state_);
+  bool focus_changed = has_focus != old_has_focus;
+  bool visibility_state_changed = visibility_state != old_visibility_state;
+
+  if (focus_changed && has_focus) {
+    // If going to a focused state, dispatch the visibility state first.
+    if (visibility_state_changed) {
+      DispatchVisibilityStateChanged(visibility_state);
+    }
+
+    DispatchWindowFocusChanged(has_focus);
+    return;
+  }
+
+  // Otherwise, we should dispatch the focus state first.
+  if (focus_changed) {
+    DispatchWindowFocusChanged(has_focus);
+  }
+
+  if (visibility_state_changed) {
+    DispatchVisibilityStateChanged(visibility_state);
+  }
+}
+
+void PageVisibilityState::DispatchWindowFocusChanged(bool has_focus) {
+  FOR_EACH_OBSERVER(Observer, observer_list_, OnWindowFocusChanged(has_focus));
+}
+
+void PageVisibilityState::DispatchVisibilityStateChanged(
+    VisibilityState visibility_state) {
+  FOR_EACH_OBSERVER(Observer, observer_list_,
+                    OnVisibilityStateChanged(visibility_state));
+}
+
+}  // namespace dom
+}  // namespace cobalt
diff --git a/src/cobalt/dom/page_visibility_state.h b/src/cobalt/dom/page_visibility_state.h
new file mode 100644
index 0000000..92771bd
--- /dev/null
+++ b/src/cobalt/dom/page_visibility_state.h
@@ -0,0 +1,94 @@
+// Copyright 2017 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef COBALT_DOM_PAGE_VISIBILITY_STATE_H_
+#define COBALT_DOM_PAGE_VISIBILITY_STATE_H_
+
+#include "base/observer_list.h"
+#include "cobalt/base/application_state.h"
+#include "cobalt/dom/visibility_state.h"
+
+namespace cobalt {
+namespace dom {
+
+// The visibility state of the Window and Document as controlled by the current
+// application state.
+class PageVisibilityState {
+ public:
+  // Pure virtual interface for classes that want to observe page visibility
+  // state changes.
+  class Observer : public base::CheckedObserver {
+   public:
+    // Called when the window focus state changes.
+    virtual void OnWindowFocusChanged(bool has_focus) = 0;
+    // Called when the VisibilityState changes.
+    virtual void OnVisibilityStateChanged(VisibilityState visibility_state) = 0;
+
+   protected:
+    virtual ~Observer() {}
+  };
+
+  PageVisibilityState();
+  explicit PageVisibilityState(
+      base::ApplicationState initial_application_state);
+
+  base::ApplicationState application_state() const {
+    return application_state_;
+  }
+
+  // Whether the current window has focus based on the current application
+  // state.
+  bool HasWindowFocus() const;
+
+  // Whether the current window has focus based on the current application
+  // state.
+  VisibilityState GetVisibilityState() const;
+
+  // Sets the current application state, and dispatches appropriate observation
+  // events.
+  void SetApplicationState(base::ApplicationState state);
+
+  // Adds a PageVisibiltyState::Observer to this PageVisibilityState.
+  void AddObserver(Observer* observer) { observer_list_.AddObserver(observer); }
+
+  // Removes a PageVisibiltyState::Observer from this PageVisibilityState, if it
+  // is registered.
+  void RemoveObserver(Observer* observer) {
+    observer_list_.RemoveObserver(observer);
+  }
+
+  // Returns whether a PageVisibiltyState::Observer is registered on this
+  // PageVisibilityState.
+  bool HasObserver(Observer* observer) const {
+    return observer_list_.HasObserver(observer);
+  }
+
+  // Clears all registered PageVisibiltyState::Observers, if any.
+  void ClearObservers() { observer_list_.Clear(); }
+
+ private:
+  void DispatchWindowFocusChanged(bool has_focus);
+  void DispatchVisibilityStateChanged(VisibilityState visibility_state);
+
+  // The current application state.
+  base::ApplicationState application_state_;
+
+  // The list of registered PageVisibiltyState::Observers;
+  base::ObserverList<Observer> observer_list_;
+};
+
+}  // namespace dom
+}  // namespace cobalt
+
+#endif  // COBALT_DOM_PAGE_VISIBILITY_STATE_H_
diff --git a/src/cobalt/dom/page_visibility_state_test.cc b/src/cobalt/dom/page_visibility_state_test.cc
new file mode 100644
index 0000000..988a8b2
--- /dev/null
+++ b/src/cobalt/dom/page_visibility_state_test.cc
@@ -0,0 +1,134 @@
+// Copyright 2017 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <memory>
+
+#include "cobalt/dom/page_visibility_state.h"
+
+#include "base/debug/stack_trace.h"
+#include "base/logging.h"
+#include "cobalt/base/application_state.h"
+#include "cobalt/dom/visibility_state.h"
+
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace cobalt {
+namespace dom {
+namespace {
+
+using ::testing::_;
+
+class MockPageVisibilityStateObserver : public PageVisibilityState::Observer {
+ public:
+  static std::unique_ptr<MockPageVisibilityStateObserver> Create() {
+    return std::unique_ptr<MockPageVisibilityStateObserver>(
+        new ::testing::StrictMock<MockPageVisibilityStateObserver>());
+  }
+
+  MOCK_METHOD1(OnWindowFocusChanged, void(bool has_focus));
+  MOCK_METHOD1(OnVisibilityStateChanged,
+               void(VisibilityState visibility_state));
+
+ protected:
+  MockPageVisibilityStateObserver() {}
+};
+
+TEST(PageVisibilityStateTest, DefaultConstructor) {
+  PageVisibilityState state;
+  EXPECT_TRUE(state.HasWindowFocus());
+  EXPECT_EQ(kVisibilityStateVisible, state.GetVisibilityState());
+}
+
+TEST(PageVisibilityStateTest, InitialStateConstructorStarted) {
+  PageVisibilityState state(base::kApplicationStateStarted);
+  EXPECT_TRUE(state.HasWindowFocus());
+  EXPECT_EQ(kVisibilityStateVisible, state.GetVisibilityState());
+}
+
+TEST(PageVisibilityStateTest, TransitionsAndObservations) {
+  PageVisibilityState state(base::kApplicationStateStarted);
+  std::unique_ptr<MockPageVisibilityStateObserver> observer =
+      MockPageVisibilityStateObserver::Create();
+
+  EXPECT_CALL(*observer, OnWindowFocusChanged(_)).Times(0);
+  EXPECT_CALL(*observer, OnVisibilityStateChanged(_)).Times(0);
+  EXPECT_TRUE(state.HasWindowFocus());
+  EXPECT_EQ(kVisibilityStateVisible, state.GetVisibilityState());
+  ::testing::Mock::VerifyAndClearExpectations(observer.get());
+
+  state.AddObserver(observer.get());
+
+  EXPECT_CALL(*observer, OnWindowFocusChanged(false));
+  EXPECT_CALL(*observer, OnVisibilityStateChanged(_)).Times(0);
+  state.SetApplicationState(base::kApplicationStatePaused);
+  EXPECT_FALSE(state.HasWindowFocus());
+  EXPECT_EQ(kVisibilityStateVisible, state.GetVisibilityState());
+  ::testing::Mock::VerifyAndClearExpectations(observer.get());
+
+  EXPECT_CALL(*observer, OnWindowFocusChanged(true));
+  EXPECT_CALL(*observer, OnVisibilityStateChanged(_)).Times(0);
+  state.SetApplicationState(base::kApplicationStateStarted);
+  EXPECT_TRUE(state.HasWindowFocus());
+  EXPECT_EQ(kVisibilityStateVisible, state.GetVisibilityState());
+  ::testing::Mock::VerifyAndClearExpectations(observer.get());
+
+  EXPECT_CALL(*observer, OnWindowFocusChanged(false));
+  EXPECT_CALL(*observer, OnVisibilityStateChanged(_)).Times(0);
+  state.SetApplicationState(base::kApplicationStatePaused);
+  EXPECT_FALSE(state.HasWindowFocus());
+  EXPECT_EQ(kVisibilityStateVisible, state.GetVisibilityState());
+  ::testing::Mock::VerifyAndClearExpectations(observer.get());
+
+  EXPECT_CALL(*observer, OnVisibilityStateChanged(kVisibilityStateHidden));
+  EXPECT_CALL(*observer, OnWindowFocusChanged(_)).Times(0);
+  state.SetApplicationState(base::kApplicationStateSuspended);
+  EXPECT_FALSE(state.HasWindowFocus());
+  EXPECT_EQ(kVisibilityStateHidden, state.GetVisibilityState());
+  ::testing::Mock::VerifyAndClearExpectations(observer.get());
+
+  EXPECT_CALL(*observer, OnVisibilityStateChanged(kVisibilityStateVisible));
+  EXPECT_CALL(*observer, OnWindowFocusChanged(_)).Times(0);
+  state.SetApplicationState(base::kApplicationStatePaused);
+  EXPECT_FALSE(state.HasWindowFocus());
+  EXPECT_EQ(kVisibilityStateVisible, state.GetVisibilityState());
+  ::testing::Mock::VerifyAndClearExpectations(observer.get());
+
+  EXPECT_CALL(*observer, OnWindowFocusChanged(true));
+  EXPECT_CALL(*observer, OnVisibilityStateChanged(_)).Times(0);
+  state.SetApplicationState(base::kApplicationStateStarted);
+  EXPECT_TRUE(state.HasWindowFocus());
+  EXPECT_EQ(kVisibilityStateVisible, state.GetVisibilityState());
+  ::testing::Mock::VerifyAndClearExpectations(observer.get());
+
+  state.RemoveObserver(observer.get());
+
+  EXPECT_CALL(*observer, OnWindowFocusChanged(_)).Times(0);
+  EXPECT_CALL(*observer, OnVisibilityStateChanged(_)).Times(0);
+  state.SetApplicationState(base::kApplicationStatePaused);
+  EXPECT_FALSE(state.HasWindowFocus());
+  EXPECT_EQ(kVisibilityStateVisible, state.GetVisibilityState());
+  ::testing::Mock::VerifyAndClearExpectations(observer.get());
+
+  EXPECT_CALL(*observer, OnWindowFocusChanged(_)).Times(0);
+  EXPECT_CALL(*observer, OnVisibilityStateChanged(_)).Times(0);
+  state.SetApplicationState(base::kApplicationStateSuspended);
+  EXPECT_FALSE(state.HasWindowFocus());
+  EXPECT_EQ(kVisibilityStateHidden, state.GetVisibilityState());
+  ::testing::Mock::VerifyAndClearExpectations(observer.get());
+}
+
+}  // namespace
+}  // namespace dom
+}  // namespace cobalt
diff --git a/src/cobalt/dom/screen.h b/src/cobalt/dom/screen.h
index e8c2e65..6e4f17c 100644
--- a/src/cobalt/dom/screen.h
+++ b/src/cobalt/dom/screen.h
@@ -28,8 +28,10 @@
  public:
   explicit Screen(const cssom::ViewportSize& view_size) { SetSize(view_size); }
 
-  void SetSize(int width, int height, float diagonal_inches) {
-    view_size_ = cssom::ViewportSize(width, height, diagonal_inches);
+  void SetSize(int width, int height, float video_pixel_ratio,
+               float diagonal_inches) {
+    view_size_ =
+        cssom::ViewportSize(width, height, video_pixel_ratio, diagonal_inches);
   }
 
   void SetSize(const cssom::ViewportSize& view_size) { view_size_ = view_size; }
@@ -59,9 +61,15 @@
   // The pixelDepth attribute must return 24.
   unsigned int pixel_depth() const { return 24; }
 
+  // Custom, not in any spec.
+  //
+
   // The length of the display screen as measured from opposing corners.
   float diagonal_inches() const { return view_size_.diagonal_inches(); }
 
+  // The ratio of video pixels to graphics pixels.
+  float device_pixel_ratio() const { return view_size_.device_pixel_ratio(); }
+
   DEFINE_WRAPPABLE_TYPE(Screen);
 
  private:
diff --git a/src/cobalt/dom/screen_test.cc b/src/cobalt/dom/screen_test.cc
index 8c8d360..a933d73 100644
--- a/src/cobalt/dom/screen_test.cc
+++ b/src/cobalt/dom/screen_test.cc
@@ -23,7 +23,7 @@
 namespace dom {
 
 TEST(ScreenTest, Size) {
-  ViewportSize view_size(ViewportSize(1280, 720, 55.f));
+  ViewportSize view_size(ViewportSize(1280, 720, 55.f, 2.f));
   scoped_refptr<Screen> screen = new Screen(view_size);
 
   EXPECT_FLOAT_EQ(screen->width(), 1280.0f);
@@ -33,6 +33,7 @@
   EXPECT_EQ(screen->color_depth(), 24);
   EXPECT_EQ(screen->pixel_depth(), 24);
   EXPECT_EQ(screen->diagonal_inches(), 55.f);
+  EXPECT_EQ(screen->device_pixel_ratio(), 2.f);
 }
 
 }  // namespace dom
diff --git a/src/cobalt/dom/testing/stub_window.h b/src/cobalt/dom/testing/stub_window.h
index 18a3b04..118a010 100644
--- a/src/cobalt/dom/testing/stub_window.h
+++ b/src/cobalt/dom/testing/stub_window.h
@@ -68,7 +68,7 @@
                   0, NULL, NULL, NULL, NULL, NULL, engine_.get(),
                   global_environment(), null_debugger_hooks_, NULL));
     window_ = new dom::Window(
-        environment_settings_.get(), cssom::ViewportSize(1920, 1080), 1.f,
+        environment_settings_.get(), cssom::ViewportSize(1920, 1080),
         base::kApplicationStateStarted, css_parser_.get(), dom_parser_.get(),
         fetcher_factory_.get(), loader_factory_.get(), NULL, NULL, NULL, NULL,
         NULL, NULL, &local_storage_database_, NULL, NULL, NULL, NULL,
diff --git a/src/cobalt/page_visibility/visibility_state.idl b/src/cobalt/dom/visibility_state.idl
similarity index 100%
rename from src/cobalt/page_visibility/visibility_state.idl
rename to src/cobalt/dom/visibility_state.idl
diff --git a/src/cobalt/dom/window.cc b/src/cobalt/dom/window.cc
index a436a39..a9e14c1 100644
--- a/src/cobalt/dom/window.cc
+++ b/src/cobalt/dom/window.cc
@@ -92,7 +92,7 @@
 
 Window::Window(
     script::EnvironmentSettings* settings, const ViewportSize& view_size,
-    float device_pixel_ratio, base::ApplicationState initial_application_state,
+    base::ApplicationState initial_application_state,
     cssom::CSSParser* css_parser, Parser* dom_parser,
     loader::FetcherFactory* fetcher_factory,
     loader::LoaderFactory* loader_factory,
@@ -141,7 +141,6 @@
     // see EventTarget constructor for more details.
     : EventTarget(settings, kUnpackOnErrorEvents),
       viewport_size_(view_size),
-      device_pixel_ratio_(device_pixel_ratio),
       is_resize_event_pending_(false),
       is_reporting_script_error_(false),
 #if defined(ENABLE_TEST_RUNNER)
@@ -618,19 +617,18 @@
   document_->set_synchronous_layout_and_produce_render_tree_callback(callback);
 }
 
-void Window::SetSize(ViewportSize size, float device_pixel_ratio) {
-  if (size == viewport_size_ && device_pixel_ratio == device_pixel_ratio_) {
+void Window::SetSize(ViewportSize size) {
+  if (size == viewport_size_) {
     return;
   }
 
   viewport_size_ = size;
-  device_pixel_ratio_ = device_pixel_ratio;
   screen_->SetSize(viewport_size_);
   // This will cause layout invalidation.
   document_->SetViewport(viewport_size_);
 
   if (html_element_context_->page_visibility_state()->GetVisibilityState() ==
-      page_visibility::kVisibilityStateVisible) {
+      kVisibilityStateVisible) {
     DispatchEvent(new Event(base::Tokens::resize()));
   } else {
     is_resize_event_pending_ = true;
@@ -647,10 +645,8 @@
       new Event(has_focus ? base::Tokens::focus() : base::Tokens::blur()));
 }
 
-void Window::OnVisibilityStateChanged(
-    page_visibility::VisibilityState visibility_state) {
-  if (is_resize_event_pending_ &&
-      visibility_state == page_visibility::kVisibilityStateVisible) {
+void Window::OnVisibilityStateChanged(VisibilityState visibility_state) {
+  if (is_resize_event_pending_ && visibility_state == kVisibilityStateVisible) {
     is_resize_event_pending_ = false;
     DispatchEvent(new Event(base::Tokens::resize()));
   }
@@ -663,7 +659,7 @@
   // pending resize event, so that the resize will occur once layouts are again
   // available.
   if (html_element_context_->page_visibility_state()->GetVisibilityState() !=
-      page_visibility::kVisibilityStateVisible) {
+      kVisibilityStateVisible) {
     is_resize_event_pending_ = true;
   }
 }
diff --git a/src/cobalt/dom/window.h b/src/cobalt/dom/window.h
index 0ae03d0..56d2f61 100644
--- a/src/cobalt/dom/window.h
+++ b/src/cobalt/dom/window.h
@@ -41,6 +41,7 @@
 #include "cobalt/dom/media_query_list.h"
 #include "cobalt/dom/on_screen_keyboard.h"
 #include "cobalt/dom/on_screen_keyboard_bridge.h"
+#include "cobalt/dom/page_visibility_state.h"
 #include "cobalt/dom/parser.h"
 #include "cobalt/dom/screenshot_manager.h"
 #if defined(ENABLE_TEST_RUNNER)
@@ -63,7 +64,6 @@
 #include "cobalt/media/web_media_player_factory.h"
 #include "cobalt/network_bridge/cookie_jar.h"
 #include "cobalt/network_bridge/net_poster.h"
-#include "cobalt/page_visibility/page_visibility_state.h"
 #include "cobalt/script/callback_function.h"
 #include "cobalt/script/environment_settings.h"
 #include "cobalt/script/error_report.h"
@@ -106,8 +106,7 @@
 //   https://www.w3.org/TR/html50/browsers.html#the-window-object
 //
 // TODO: Properly handle viewport resolution change event.
-class Window : public EventTarget,
-               public page_visibility::PageVisibilityState::Observer {
+class Window : public EventTarget, public PageVisibilityState::Observer {
  public:
   typedef AnimationFrameRequestCallbackList::FrameRequestCallback
       FrameRequestCallback;
@@ -132,7 +131,7 @@
 
   Window(
       script::EnvironmentSettings* settings,
-      const cssom::ViewportSize& view_size, float device_pixel_ratio,
+      const cssom::ViewportSize& view_size,
       base::ApplicationState initial_application_state,
       cssom::CSSParser* css_parser, Parser* dom_parser,
       loader::FetcherFactory* fetcher_factory,
@@ -266,7 +265,9 @@
   // The devicePixelRatio attribute returns the ratio of CSS pixels per device
   // pixel.
   //   https://www.w3.org/TR/2013/WD-cssom-view-20131217/#dom-window-devicepixelratio
-  float device_pixel_ratio() const { return device_pixel_ratio_; }
+  float device_pixel_ratio() const {
+    return viewport_size_.device_pixel_ratio();
+  }
 
   // Web API: GlobalCrypto (implements)
   //   https://www.w3.org/TR/WebCryptoAPI/#crypto-interface
@@ -347,7 +348,7 @@
       const SynchronousLayoutAndProduceRenderTreeCallback&
           synchronous_layout_callback);
 
-  void SetSize(cssom::ViewportSize size, float device_pixel_ratio);
+  void SetSize(cssom::ViewportSize size);
 
   void SetCamera3D(const scoped_refptr<input::Camera3D>& camera_3d);
 
@@ -367,10 +368,9 @@
   // Returns whether or not the script was handled.
   bool ReportScriptError(const script::ErrorReport& error_report);
 
-  // page_visibility::PageVisibilityState::Observer implementation.
+  // PageVisibilityState::Observer implementation.
   void OnWindowFocusChanged(bool has_focus) override;
-  void OnVisibilityStateChanged(
-      page_visibility::VisibilityState visibility_state) override;
+  void OnVisibilityStateChanged(VisibilityState visibility_state) override;
 
   // Called when the document's root element has its offset dimensions requested
   // and is unable to provide them.
@@ -425,8 +425,6 @@
 
   cssom::ViewportSize viewport_size_;
 
-  float device_pixel_ratio_;
-
   // A resize event can be pending if a resize occurs and the current visibility
   // state is not visible. In this case, the resize event will run when the
   // visibility state changes to visible.
diff --git a/src/cobalt/dom/window_test.cc b/src/cobalt/dom/window_test.cc
index 9a44ac4..8e44fb0 100644
--- a/src/cobalt/dom/window_test.cc
+++ b/src/cobalt/dom/window_test.cc
@@ -63,12 +63,11 @@
 
     ViewportSize view_size(1920, 1080);
     window_ = new Window(
-        environment_settings_.get(), view_size, 1.f,
-        base::kApplicationStateStarted, css_parser_.get(), dom_parser_.get(),
-        fetcher_factory_.get(), NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-        &local_storage_database_, NULL, NULL, NULL, NULL,
-        global_environment_->script_value_factory(), NULL, NULL, url_, "",
-        "en-US", "en", base::Callback<void(const GURL &)>(),
+        environment_settings_.get(), view_size, base::kApplicationStateStarted,
+        css_parser_.get(), dom_parser_.get(), fetcher_factory_.get(), NULL,
+        NULL, NULL, NULL, NULL, NULL, NULL, &local_storage_database_, NULL,
+        NULL, NULL, NULL, global_environment_->script_value_factory(), NULL,
+        NULL, url_, "", "en-US", "en", base::Callback<void(const GURL &)>(),
         base::Bind(&MockErrorCallback::Run,
                    base::Unretained(&mock_error_callback_)),
         NULL, network_bridge::PostSender(), csp::kCSPRequired,
diff --git a/src/cobalt/h5vcc/h5vcc.gyp b/src/cobalt/h5vcc/h5vcc.gyp
index ef98694..6486986 100644
--- a/src/cobalt/h5vcc/h5vcc.gyp
+++ b/src/cobalt/h5vcc/h5vcc.gyp
@@ -46,6 +46,8 @@
         'h5vcc_runtime.h',
         'h5vcc_runtime_event_target.cc',
         'h5vcc_runtime_event_target.h',
+        'h5vcc_screen.cc',
+        'h5vcc_screen.h',
         'h5vcc_settings.cc',
         'h5vcc_settings.h',
         'h5vcc_storage.cc',
diff --git a/src/cobalt/h5vcc/h5vcc_crash_log.cc b/src/cobalt/h5vcc/h5vcc_crash_log.cc
index 79f0e20..6eafc6f 100644
--- a/src/cobalt/h5vcc/h5vcc_crash_log.cc
+++ b/src/cobalt/h5vcc/h5vcc_crash_log.cc
@@ -54,7 +54,9 @@
 
  private:
   CrashLogDictionary() : accessing_log_data_(0) {
+#if SB_HAS(CORE_DUMP_HANDLER_SUPPORT)
     SbCoreDumpRegisterHandler(&CoreDumpHandler, this);
+#endif
   }
 
   static void CoreDumpHandler(void* context) {
@@ -64,6 +66,7 @@
   }
 
   void OnCrash() {
+#if SB_HAS(CORE_DUMP_HANDLER_SUPPORT)
     // Check that we're not already updating log data.  If we are, we just
     // give up and skip recording any crash data, but hopefully this is rare.
     if (base::subtle::Acquire_CompareAndSwap(&accessing_log_data_, 0, 1) == 0) {
@@ -73,6 +76,7 @@
       }
       base::subtle::Release_Store(&accessing_log_data_, 0);
     }
+#endif
   }
 
   friend struct base::DefaultSingletonTraits<CrashLogDictionary>;
@@ -100,5 +104,24 @@
   return true;
 }
 
+void H5vccCrashLog::TriggerCrash(H5vccCrashType intent) {
+  if (intent == kH5vccCrashTypeNullDereference) {
+    *(reinterpret_cast<volatile char*>(0)) = 0;
+  }
+  if (intent == kH5vccCrashTypeIllegalInstruction) {
+#if SB_IS(ARCH_ARM) || SB_IS(ARCH_ARM64)
+    __asm(".word 0xf7f0a000\n");
+#elif !SB_IS(ARCH_X64)  // inline asm not allowed on 64bit MSVC
+    __asm("ud2");
+#endif
+  }
+  if (intent == kH5vccCrashTypeDebugger) {
+    SbSystemBreakIntoDebugger();
+  }
+  if (intent == kH5vccCrashTypeOutOfMemory) {
+    SbMemoryAllocateAligned(128, SIZE_MAX);
+  }
+}
+
 }  // namespace h5vcc
 }  // namespace cobalt
diff --git a/src/cobalt/h5vcc/h5vcc_crash_log.h b/src/cobalt/h5vcc/h5vcc_crash_log.h
index 6ebf85e..1ea13dc 100644
--- a/src/cobalt/h5vcc/h5vcc_crash_log.h
+++ b/src/cobalt/h5vcc/h5vcc_crash_log.h
@@ -17,6 +17,7 @@
 
 #include <string>
 
+#include "cobalt/h5vcc/h5vcc_crash_type.h"
 #include "cobalt/script/wrappable.h"
 
 namespace cobalt {
@@ -28,6 +29,8 @@
 
   bool SetString(const std::string& key, const std::string& value);
 
+  void TriggerCrash(H5vccCrashType intent);
+
   DEFINE_WRAPPABLE_TYPE(H5vccCrashLog);
 
  private:
diff --git a/src/cobalt/h5vcc/h5vcc_crash_log.idl b/src/cobalt/h5vcc/h5vcc_crash_log.idl
index 885c13a..c5df849 100644
--- a/src/cobalt/h5vcc/h5vcc_crash_log.idl
+++ b/src/cobalt/h5vcc/h5vcc_crash_log.idl
@@ -26,4 +26,9 @@
   // if for some reason the string could not be set in the crash log.
   // Sets a (key, value) string pair that should be logged if a crash occurs.
   boolean setString(DOMString key, DOMString value);
+
+  // Induce a crash. This attempts, but does not guarantee, to cause a specified
+  // type of crash. The result may vary by platform. This API is intended for
+  // reliability testing only.
+  void triggerCrash(H5vccCrashType intent);
 };
diff --git a/src/cobalt/h5vcc/h5vcc_crash_type.idl b/src/cobalt/h5vcc/h5vcc_crash_type.idl
new file mode 100644
index 0000000..e9b88e9
--- /dev/null
+++ b/src/cobalt/h5vcc/h5vcc_crash_type.idl
@@ -0,0 +1,21 @@
+// Copyright 2020 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Types of crashes available to trigger
+enum H5vccCrashType {
+  "null_dereference",
+  "illegal_instruction",
+  "debugger",
+  "out_of_memory",
+};
diff --git a/src/cobalt/h5vcc/h5vcc_screen.cc b/src/cobalt/h5vcc/h5vcc_screen.cc
new file mode 100644
index 0000000..7d77fa6
--- /dev/null
+++ b/src/cobalt/h5vcc/h5vcc_screen.cc
@@ -0,0 +1,38 @@
+// Copyright 2020 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "cobalt/h5vcc/h5vcc_screen.h"
+
+#include "cobalt/base/polymorphic_downcast.h"
+#include "cobalt/dom/dom_settings.h"
+#include "cobalt/dom/window.h"
+
+namespace cobalt {
+namespace h5vcc {
+
+// static
+float H5vccScreen::GetDiagonal(script::EnvironmentSettings* settings) {
+#if SB_API_VERSION >= 11
+  DCHECK(settings);
+  dom::DOMSettings* dom_settings =
+      base::polymorphic_downcast<dom::DOMSettings*>(settings);
+  DCHECK(dom_settings->window());
+  return dom_settings->window()->viewport_diagonal_inches();
+#else   // SB_API_VERSION < 11
+  return 0;
+#endif  // SB_API_VERSION < 11
+}
+
+}  // namespace h5vcc
+}  // namespace cobalt
diff --git a/src/cobalt/h5vcc/h5vcc_screen.h b/src/cobalt/h5vcc/h5vcc_screen.h
new file mode 100644
index 0000000..34ad91d
--- /dev/null
+++ b/src/cobalt/h5vcc/h5vcc_screen.h
@@ -0,0 +1,37 @@
+// Copyright 2020 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef COBALT_H5VCC_H5VCC_SCREEN_H_
+#define COBALT_H5VCC_H5VCC_SCREEN_H_
+
+#include "cobalt/script/global_environment.h"
+#include "cobalt/script/wrappable.h"
+
+namespace cobalt {
+namespace h5vcc {
+
+class H5vccScreen : public script::Wrappable {
+ public:
+  static float GetDiagonal(script::EnvironmentSettings* settings);
+
+  DEFINE_WRAPPABLE_TYPE(H5vccScreen);
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(H5vccScreen);
+};
+
+}  // namespace h5vcc
+}  // namespace cobalt
+
+#endif  // COBALT_H5VCC_H5VCC_SCREEN_H_
diff --git a/src/cobalt/h5vcc/h5vcc_screen.idl b/src/cobalt/h5vcc/h5vcc_screen.idl
new file mode 100644
index 0000000..a075606
--- /dev/null
+++ b/src/cobalt/h5vcc/h5vcc_screen.idl
@@ -0,0 +1,22 @@
+// Copyright 2020 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+interface H5vccScreen {
+  // Return the physical of the screen diagonal in inches.  This returns the
+  // value reported by the platform from SbWindowGetDiagonalSizeInInches().
+  // A return value of 0 means that the platform does not know what the
+  // screen diagonal is.
+  [CallWith=EnvironmentSettings] static float GetDiagonal();
+};
+
diff --git a/src/cobalt/layout/box_generator.cc b/src/cobalt/layout/box_generator.cc
index b2b1d6b..c72355d 100644
--- a/src/cobalt/layout/box_generator.cc
+++ b/src/cobalt/layout/box_generator.cc
@@ -61,11 +61,7 @@
   TRACE_EVENT0("cobalt::layout", "GetVideoFrame()");
   SbDecodeTarget decode_target = frame_provider->GetCurrentSbDecodeTarget();
   if (SbDecodeTargetIsValid(decode_target)) {
-#if SB_HAS(GRAPHICS)
     return resource_provider->CreateImageFromSbDecodeTarget(decode_target);
-#else   // SB_HAS(GRAPHICS)
-    return NULL;
-#endif  // SB_HAS(GRAPHICS)
   } else {
     DCHECK(frame_provider);
     return NULL;
diff --git a/src/cobalt/layout_tests/layout_snapshot.cc b/src/cobalt/layout_tests/layout_snapshot.cc
index 26f8fe5..196247d 100644
--- a/src/cobalt/layout_tests/layout_snapshot.cc
+++ b/src/cobalt/layout_tests/layout_snapshot.cc
@@ -103,7 +103,7 @@
       browser::WebModule::CloseCallback() /* window_close_callback */,
       base::Closure() /* window_minimize_callback */,
       NULL /* can_play_type_handler */, NULL /* web_media_player_factory */,
-      &network_module, viewport_size, 1.f, resource_provider, 60.0f,
+      &network_module, viewport_size, resource_provider, 60.0f,
       web_module_options);
 
   run_loop.Run();
diff --git a/src/cobalt/layout_tests/layout_tests.cc b/src/cobalt/layout_tests/layout_tests.cc
index 0464c1b..a0e9eae 100644
--- a/src/cobalt/layout_tests/layout_tests.cc
+++ b/src/cobalt/layout_tests/layout_tests.cc
@@ -355,7 +355,16 @@
 // cases
 INSTANTIATE_TEST_CASE_P(
     IntersectionObserverLayoutTests, Layout,
-    ::testing::ValuesIn(EnumerateLayoutTests("intersection-observer")));
+    ::testing::ValuesIn(EnumerateLayoutTests("intersection-observer")),
+    GetTestName());
+
+// Blitter does not support Skottie.
+#if !SB_HAS(BLITTER)
+// Lottie (https://github.com/LottieFiles/lottie-player) test cases
+INSTANTIATE_TEST_CASE_P(
+    LottiePlayerLayoutTests, Layout,
+    ::testing::ValuesIn(EnumerateLayoutTests("lottie-player")), GetTestName());
+#endif  // !SB_HAS(BLITTER)
 
 // Disable on Windows until network stack is implemented.
 #if !defined(COBALT_WIN)
diff --git a/src/cobalt/layout_tests/testdata/lottie-player/layout_tests.txt b/src/cobalt/layout_tests/testdata/lottie-player/layout_tests.txt
new file mode 100644
index 0000000..204ea51
--- /dev/null
+++ b/src/cobalt/layout_tests/testdata/lottie-player/layout_tests.txt
@@ -0,0 +1,2 @@
+lottie-background-attribute
+lottie-playback-events
diff --git a/src/cobalt/layout_tests/testdata/lottie-player/lottie-background-attribute-expected.png b/src/cobalt/layout_tests/testdata/lottie-player/lottie-background-attribute-expected.png
new file mode 100644
index 0000000..de78ec2
--- /dev/null
+++ b/src/cobalt/layout_tests/testdata/lottie-player/lottie-background-attribute-expected.png
Binary files differ
diff --git a/src/cobalt/layout_tests/testdata/lottie-player/lottie-background-attribute.html b/src/cobalt/layout_tests/testdata/lottie-player/lottie-background-attribute.html
new file mode 100644
index 0000000..dd29701
--- /dev/null
+++ b/src/cobalt/layout_tests/testdata/lottie-player/lottie-background-attribute.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<!--
+ | This test checks that we can use the lottie-player's "background" attribute
+ | to set a background color.
+ | https://lottiefiles.github.io/lottie-player/properties.html
+-->
+<html>
+<head>
+  <meta http-equiv="Content-Security-Policy"
+        content="img-src 'self' data:;">
+  <style>
+    #lottie {
+      width:200px;
+      height:200px;
+    }
+  </style>
+</head>
+<body>
+  <lottie-player id="lottie" background="#ff6363"></lottie-player>
+
+  <script>
+    var lottie = document.querySelector('lottie-player');
+    var json = '{"v":"4.6.8","fr":29.9700012207031,"ip":0,"op":40.0000016292334,"w":256,"h":256,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 3","ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":20,"s":[208.6,127.969,0],"e":[208.6,88,0],"to":[0,-6.66145849227905,0],"ti":[0,-0.00520833348855,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":30,"s":[208.6,88,0],"e":[208.6,128,0],"to":[0,0.00520833348855,0],"ti":[0,-6.66666650772095,0]},{"t":40.0000016292334}]},"a":{"a":0,"k":[-70,-0.5,0]},"s":{"a":0,"k":[75,75,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[33.75,34.5]},"p":{"a":0,"k":[0,0]},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse"},{"ty":"fl","c":{"a":0,"k":[0.9843137,0.5490196,0,1]},"o":{"a":0,"k":100},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill"},{"ty":"tr","p":{"a":0,"k":[-70.125,-0.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group"}],"ip":0,"op":300.00001221925,"st":0,"bm":0,"sr":1},{"ddd":0,"ind":2,"ty":4,"nm":"Shape Layer 2","ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":15,"s":[168.6,128,0],"e":[168.6,88,0],"to":[0,-6.66666650772095,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":25,"s":[168.6,88,0],"e":[168.6,128,0],"to":[0,0,0],"ti":[0,-6.66666650772095,0]},{"t":35.0000014255792}]},"a":{"a":0,"k":[-70,-0.5,0]},"s":{"a":0,"k":[75,75,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[33.75,34.5]},"p":{"a":0,"k":[0,0]},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse"},{"ty":"fl","c":{"a":0,"k":[0.9921569,0.8470588,0.2078431,1]},"o":{"a":0,"k":100},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill"},{"ty":"tr","p":{"a":0,"k":[-70.125,-0.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group"}],"ip":0,"op":300.00001221925,"st":0,"bm":0,"sr":1},{"ddd":0,"ind":3,"ty":4,"nm":"Shape Layer 1","ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":10,"s":[128.594,127.969,0],"e":[128.594,88,0],"to":[0,-6.66145849227905,0],"ti":[0,-0.00520833348855,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":20,"s":[128.594,88,0],"e":[128.594,128,0],"to":[0,0.00520833348855,0],"ti":[0,-6.66666650772095,0]},{"t":30.0000012219251}]},"a":{"a":0,"k":[-70,-0.5,0]},"s":{"a":0,"k":[75,75,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[33.75,34.5]},"p":{"a":0,"k":[0,0]},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse"},{"ty":"fl","c":{"a":0,"k":[0.2627451,0.627451,0.2784314,1]},"o":{"a":0,"k":100},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill"},{"ty":"tr","p":{"a":0,"k":[-70.125,-0.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group"}],"ip":0,"op":300.00001221925,"st":0,"bm":0,"sr":1},{"ddd":0,"ind":4,"ty":4,"nm":"Shape Layer 4","ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":5,"s":[88.6,127.969,0],"e":[88.6,88,0],"to":[0,-6.66145849227905,0],"ti":[0,-0.00520833348855,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":15,"s":[88.6,88,0],"e":[88.6,128,0],"to":[0,0.00520833348855,0],"ti":[0,-6.66666650772095,0]},{"t":25.0000010182709}]},"a":{"a":0,"k":[-70,-0.5,0]},"s":{"a":0,"k":[75,75,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[33.75,34.5]},"p":{"a":0,"k":[0,0]},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse"},{"ty":"fl","c":{"a":0,"k":[0.1176471,0.5333334,0.8980392,1]},"o":{"a":0,"k":100},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill"},{"ty":"tr","p":{"a":0,"k":[-70.125,-0.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group"}],"ip":0,"op":300.00001221925,"st":0,"bm":0,"sr":1},{"ddd":0,"ind":5,"ty":4,"nm":"Shape Layer 5","ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":0,"s":[48.6,127.969,0],"e":[48.6,88,0],"to":[0,-6.66145849227905,0],"ti":[0,-0.00520833348855,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":10,"s":[48.6,88,0],"e":[48.6,128,0],"to":[0,0.00520833348855,0],"ti":[0,-6.66666650772095,0]},{"t":20.0000008146167}]},"a":{"a":0,"k":[-70,-0.5,0]},"s":{"a":0,"k":[75,75,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[33.75,34.5]},"p":{"a":0,"k":[0,0]},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse"},{"ty":"fl","c":{"a":0,"k":[0.8980392,0.2235294,0.2078431,1]},"o":{"a":0,"k":100},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill"},{"ty":"tr","p":{"a":0,"k":[-70.125,-0.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group"}],"ip":0,"op":300.00001221925,"st":0,"bm":0,"sr":1}]}';
+    lottie.src = 'data:application/json;raw,' + json;
+  </script>
+</body>
+</html>
diff --git a/src/cobalt/layout_tests/testdata/lottie-player/lottie-playback-events-expected.png b/src/cobalt/layout_tests/testdata/lottie-player/lottie-playback-events-expected.png
new file mode 100644
index 0000000..6e58dc6
--- /dev/null
+++ b/src/cobalt/layout_tests/testdata/lottie-player/lottie-playback-events-expected.png
Binary files differ
diff --git a/src/cobalt/layout_tests/testdata/lottie-player/lottie-playback-events.html b/src/cobalt/layout_tests/testdata/lottie-player/lottie-playback-events.html
new file mode 100644
index 0000000..9068ccc
--- /dev/null
+++ b/src/cobalt/layout_tests/testdata/lottie-player/lottie-playback-events.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<!--
+ | This test checks that Lottie playback events get fired for all possible
+ | scenarios and in the correct order.
+ | https://lottiefiles.github.io/lottie-player/events.html
+-->
+<html>
+<head>
+  <meta http-equiv="Content-Security-Policy"
+        content="img-src 'self' data:;">
+  <style>
+    #lottie {
+      width:200px;
+      height:200px;
+    }
+    #events {
+      color: red;
+      font-size: 25px;
+    }
+  </style>
+</head>
+<body>
+  <lottie-player id="lottie" autoplay></lottie-player>
+  <div id="events"></div>
+
+  <script>
+    if (window.testRunner) {
+      window.testRunner.waitUntilDone();
+    }
+
+    var lottie = document.querySelector('lottie-player');
+    var json = '{"v":"4.6.8","fr":29.9700012207031,"ip":0,"op":40.0000016292334,"w":256,"h":256,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 3","ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":20,"s":[208.6,127.969,0],"e":[208.6,88,0],"to":[0,-6.66145849227905,0],"ti":[0,-0.00520833348855,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":30,"s":[208.6,88,0],"e":[208.6,128,0],"to":[0,0.00520833348855,0],"ti":[0,-6.66666650772095,0]},{"t":40.0000016292334}]},"a":{"a":0,"k":[-70,-0.5,0]},"s":{"a":0,"k":[75,75,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[33.75,34.5]},"p":{"a":0,"k":[0,0]},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse"},{"ty":"fl","c":{"a":0,"k":[0.9843137,0.5490196,0,1]},"o":{"a":0,"k":100},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill"},{"ty":"tr","p":{"a":0,"k":[-70.125,-0.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group"}],"ip":0,"op":300.00001221925,"st":0,"bm":0,"sr":1},{"ddd":0,"ind":2,"ty":4,"nm":"Shape Layer 2","ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":15,"s":[168.6,128,0],"e":[168.6,88,0],"to":[0,-6.66666650772095,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":25,"s":[168.6,88,0],"e":[168.6,128,0],"to":[0,0,0],"ti":[0,-6.66666650772095,0]},{"t":35.0000014255792}]},"a":{"a":0,"k":[-70,-0.5,0]},"s":{"a":0,"k":[75,75,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[33.75,34.5]},"p":{"a":0,"k":[0,0]},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse"},{"ty":"fl","c":{"a":0,"k":[0.9921569,0.8470588,0.2078431,1]},"o":{"a":0,"k":100},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill"},{"ty":"tr","p":{"a":0,"k":[-70.125,-0.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group"}],"ip":0,"op":300.00001221925,"st":0,"bm":0,"sr":1},{"ddd":0,"ind":3,"ty":4,"nm":"Shape Layer 1","ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":10,"s":[128.594,127.969,0],"e":[128.594,88,0],"to":[0,-6.66145849227905,0],"ti":[0,-0.00520833348855,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":20,"s":[128.594,88,0],"e":[128.594,128,0],"to":[0,0.00520833348855,0],"ti":[0,-6.66666650772095,0]},{"t":30.0000012219251}]},"a":{"a":0,"k":[-70,-0.5,0]},"s":{"a":0,"k":[75,75,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[33.75,34.5]},"p":{"a":0,"k":[0,0]},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse"},{"ty":"fl","c":{"a":0,"k":[0.2627451,0.627451,0.2784314,1]},"o":{"a":0,"k":100},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill"},{"ty":"tr","p":{"a":0,"k":[-70.125,-0.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group"}],"ip":0,"op":300.00001221925,"st":0,"bm":0,"sr":1},{"ddd":0,"ind":4,"ty":4,"nm":"Shape Layer 4","ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":5,"s":[88.6,127.969,0],"e":[88.6,88,0],"to":[0,-6.66145849227905,0],"ti":[0,-0.00520833348855,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":15,"s":[88.6,88,0],"e":[88.6,128,0],"to":[0,0.00520833348855,0],"ti":[0,-6.66666650772095,0]},{"t":25.0000010182709}]},"a":{"a":0,"k":[-70,-0.5,0]},"s":{"a":0,"k":[75,75,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[33.75,34.5]},"p":{"a":0,"k":[0,0]},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse"},{"ty":"fl","c":{"a":0,"k":[0.1176471,0.5333334,0.8980392,1]},"o":{"a":0,"k":100},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill"},{"ty":"tr","p":{"a":0,"k":[-70.125,-0.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group"}],"ip":0,"op":300.00001221925,"st":0,"bm":0,"sr":1},{"ddd":0,"ind":5,"ty":4,"nm":"Shape Layer 5","ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":0,"s":[48.6,127.969,0],"e":[48.6,88,0],"to":[0,-6.66145849227905,0],"ti":[0,-0.00520833348855,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":10,"s":[48.6,88,0],"e":[48.6,128,0],"to":[0,0.00520833348855,0],"ti":[0,-6.66666650772095,0]},{"t":20.0000008146167}]},"a":{"a":0,"k":[-70,-0.5,0]},"s":{"a":0,"k":[75,75,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[33.75,34.5]},"p":{"a":0,"k":[0,0]},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse"},{"ty":"fl","c":{"a":0,"k":[0.8980392,0.2235294,0.2078431,1]},"o":{"a":0,"k":100},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill"},{"ty":"tr","p":{"a":0,"k":[-70.125,-0.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group"}],"ip":0,"op":300.00001221925,"st":0,"bm":0,"sr":1}]}';
+    lottie.src = 'data:application/json;raw,' + json;
+
+    var events = [];
+    lottie.addEventListener('play', function() {
+      events.push('play');
+    });
+    lottie.addEventListener('pause', function() {
+      events.push('pause');
+    });
+    lottie.addEventListener('stop', function() {
+      events.push('stop');
+    });
+
+    window.addEventListener("load", function() {
+      // Animation was autoplaying, now it is paused.
+      lottie.pause();
+      // Animation is playing.
+      lottie.togglePlay();
+      // Animation is paused.
+      lottie.togglePlay();
+      // Animation is playing.
+      lottie.play();
+      // Animated is stopped.
+      lottie.stop();
+
+      // Events fire asynchronously, so give the test runner enough time
+      // to register all of the events.
+      setTimeout(function() {
+        // events = ['play','pause','play','pause','play','stop']
+        document.getElementById('events').innerHTML = events;
+        if (window.testRunner) {
+          window.testRunner.notifyDone();
+        }
+      }, 1000);
+    });
+  </script>
+</body>
+</html>
diff --git a/src/cobalt/layout_tests/web_platform_tests.cc b/src/cobalt/layout_tests/web_platform_tests.cc
index d0777de..90b82a6 100644
--- a/src/cobalt/layout_tests/web_platform_tests.cc
+++ b/src/cobalt/layout_tests/web_platform_tests.cc
@@ -219,7 +219,7 @@
       browser::WebModule::CloseCallback() /* window_close_callback */,
       base::Closure() /* window_minimize_callback */,
       can_play_type_handler.get(), media_module.get(), &network_module,
-      kDefaultViewportSize, 1.f, &resource_provider, 60.0f, web_module_options);
+      kDefaultViewportSize, &resource_provider, 60.0f, web_module_options);
   run_loop.Run();
   const std::string extract_results =
       "document.getElementById(\"__testharness__results__\").textContent;";
diff --git a/src/cobalt/loader/fetcher_factory.cc b/src/cobalt/loader/fetcher_factory.cc
index 6c0326c..83531c6 100644
--- a/src/cobalt/loader/fetcher_factory.cc
+++ b/src/cobalt/loader/fetcher_factory.cc
@@ -102,7 +102,7 @@
 std::unique_ptr<Fetcher> FetcherFactory::CreateSecureFetcher(
     const GURL& url, const csp::SecurityCallback& url_security_callback,
     RequestMode request_mode, const Origin& origin, Fetcher::Handler* handler) {
-  DLOG(INFO) << "Fetching: " << ClipUrl(url, 80);
+  LOG(INFO) << "Fetching: " << ClipUrl(url, 200);
 
   if (!url.is_valid()) {
     std::stringstream error_message;
diff --git a/src/cobalt/loader/image/image_decoder.cc b/src/cobalt/loader/image/image_decoder.cc
index de6534a..0debb82 100644
--- a/src/cobalt/loader/image/image_decoder.cc
+++ b/src/cobalt/loader/image/image_decoder.cc
@@ -258,7 +258,7 @@
 }
 
 namespace {
-#if SB_HAS(GRAPHICS) && !SB_IS(EVERGREEN)
+
 const char* GetMimeTypeFromImageType(ImageDecoder::ImageType image_type) {
   switch (image_type) {
     case ImageDecoder::kImageTypeJPEG:
@@ -319,7 +319,6 @@
   }
   return std::unique_ptr<ImageDataDecoder>();
 }
-#endif  // SB_HAS(GRAPHICS) && !SB_IS(EVERGREEN)
 
 std::unique_ptr<ImageDataDecoder> CreateImageDecoderFromImageType(
     ImageDecoder::ImageType image_type,
@@ -368,11 +367,8 @@
     image_type_ = DetermineImageType(signature_cache_.data);
   }
 
-// TODO: Remove the EVERGREEN check once the EGL wiring is ready.
-#if SB_HAS(GRAPHICS) && !SB_IS(EVERGREEN)
   decoder_ =
       MaybeCreateStarboardDecoder(mime_type_, image_type_, resource_provider_);
-#endif  // SB_HAS(GRAPHICS) && !SB_IS(EVERGREEN)
 
   if (!decoder_) {
     decoder_ = CreateImageDecoderFromImageType(image_type_, resource_provider_);
diff --git a/src/cobalt/loader/image/image_decoder_starboard.cc b/src/cobalt/loader/image/image_decoder_starboard.cc
index 1fa4205..754e211 100644
--- a/src/cobalt/loader/image/image_decoder_starboard.cc
+++ b/src/cobalt/loader/image/image_decoder_starboard.cc
@@ -23,8 +23,6 @@
 #include "starboard/decode_target.h"
 #include "starboard/image.h"
 
-#if SB_HAS(GRAPHICS)
-
 namespace cobalt {
 namespace loader {
 namespace image {
@@ -73,6 +71,4 @@
 }  // namespace loader
 }  // namespace cobalt
 
-#endif  // SB_HAS(GRAPHICS)
-
-#endif  // #if defined(STARBOARD)
+#endif  // defined(STARBOARD)
diff --git a/src/cobalt/loader/image/image_decoder_starboard.h b/src/cobalt/loader/image/image_decoder_starboard.h
index da48fcc..d1b43e1 100644
--- a/src/cobalt/loader/image/image_decoder_starboard.h
+++ b/src/cobalt/loader/image/image_decoder_starboard.h
@@ -23,8 +23,6 @@
 #include "cobalt/loader/image/image_data_decoder.h"
 #include "starboard/decode_target.h"
 
-#if SB_HAS(GRAPHICS)
-
 namespace cobalt {
 namespace loader {
 namespace image {
@@ -55,6 +53,4 @@
 }  // namespace loader
 }  // namespace cobalt
 
-#endif  // SB_HAS(GRAPHICS)
-
 #endif  // COBALT_LOADER_IMAGE_IMAGE_DECODER_STARBOARD_H_
diff --git a/src/cobalt/loader/image/webp_image_decoder.cc b/src/cobalt/loader/image/webp_image_decoder.cc
index c0a4000..aafddaf 100644
--- a/src/cobalt/loader/image/webp_image_decoder.cc
+++ b/src/cobalt/loader/image/webp_image_decoder.cc
@@ -183,13 +183,7 @@
   config_.output.u.RGBA.stride = image_data_descriptor.pitch_in_bytes;
   config_.output.u.RGBA.size = image_data_descriptor.pitch_in_bytes *
                                image_data_descriptor.size.height();
-#if SB_HAS_QUIRK(GL_MAP_BUFFER_MEMORY_IS_SLOW_TO_READ)
-  // The webp decoder will allocate a main memory output buffer if it has to
-  // read from the output buffer.
-  config_.output.is_external_memory = 2;
-#else   // SB_HAS_QUIRK(GL_MAP_BUFFER_MEMORY_IS_SLOW_TO_READ)
   config_.output.is_external_memory = 1;
-#endif  // SB_HAS_QUIRK(GL_MAP_BUFFER_MEMORY_IS_SLOW_TO_READ)
   // Instantiate a new incremental decoder object with the requested
   // configuration.
   internal_decoder_ = WebPIDecode(NULL, 0, &config_);
diff --git a/src/cobalt/media/base/playback_statistics.cc b/src/cobalt/media/base/playback_statistics.cc
index 24ca1b8..00832ca 100644
--- a/src/cobalt/media/base/playback_statistics.cc
+++ b/src/cobalt/media/base/playback_statistics.cc
@@ -15,7 +15,7 @@
 #include "cobalt/media/base/playback_statistics.h"
 
 #include "starboard/atomic.h"
-#include "starboard/format_string.h"
+#include "starboard/common/format_string.h"
 
 namespace cobalt {
 namespace media {
diff --git a/src/cobalt/media/media_module.h b/src/cobalt/media/media_module.h
index c99ab8a..c4222ba 100644
--- a/src/cobalt/media/media_module.h
+++ b/src/cobalt/media/media_module.h
@@ -88,11 +88,7 @@
 
   SbDecodeTargetGraphicsContextProvider*
   GetSbDecodeTargetGraphicsContextProvider() {
-#if SB_HAS(GRAPHICS)
     return resource_provider_->GetSbDecodeTargetGraphicsContextProvider();
-#else   // SB_HAS(GRAPHICS)
-    return NULL;
-#endif  // SB_HAS(GRAPHICS)
   }
 
   // When the value of a particular player is true, it means the player is
diff --git a/src/cobalt/media/sandbox/web_media_player_sandbox.cc b/src/cobalt/media/sandbox/web_media_player_sandbox.cc
index 417b5ac..c947020 100644
--- a/src/cobalt/media/sandbox/web_media_player_sandbox.cc
+++ b/src/cobalt/media/sandbox/web_media_player_sandbox.cc
@@ -340,7 +340,6 @@
   }
 
   scoped_refptr<Image> FrameCB(const base::TimeDelta& time) {
-#if SB_HAS(GRAPHICS)
     SbDecodeTarget decode_target = player_helper_->GetCurrentDecodeTarget();
 
     if (SbDecodeTargetIsValid(decode_target)) {
@@ -348,9 +347,6 @@
           decode_target);
     }
     return NULL;
-#else   // SB_HAS(GRAPHICS)
-    return NULL;
-#endif  // SB_HAS(GRAPHICS)
   }
 
   const std::string kAudioId = "audio";
diff --git a/src/cobalt/page_visibility/page_visibility.gyp b/src/cobalt/page_visibility/page_visibility.gyp
deleted file mode 100644
index 4d85443..0000000
--- a/src/cobalt/page_visibility/page_visibility.gyp
+++ /dev/null
@@ -1,68 +0,0 @@
-# Copyright 2017 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-{
-  'variables': {
-    'sb_pedantic_warnings': 1,
-  },
-  'targets': [
-    {
-      'target_name': 'page_visibility',
-      'type': 'static_library',
-      'sources': [
-        'page_visibility_state.cc',
-        'page_visibility_state.h',
-      ],
-      'dependencies': [
-        '<(DEPTH)/cobalt/base/base.gyp:base',
-        '<(DEPTH)/cobalt/browser/browser_bindings_gen.gyp:generated_types',
-      ],
-      # This target doesn't generate any headers, but it exposes generated
-      # header files through this module's public header files. So mark this
-      # target as a hard dependency to ensure that any dependent targets wait
-      # until this target (and its hard dependencies) are built.
-      'hard_dependency': 1,
-      'export_dependent_settings': [
-        # Additionally, ensure that the include directories for generated
-        # headers are put on the include directories for targets that depend
-        # on this one.
-        '<(DEPTH)/cobalt/browser/browser_bindings_gen.gyp:generated_types',
-      ]
-    },
-    {
-      'target_name': 'page_visibility_test',
-      'type': '<(gtest_target_type)',
-      'sources': [
-        'page_visibility_state_test.cc',
-      ],
-      'dependencies': [
-        '<(DEPTH)/testing/gmock.gyp:gmock',
-        '<(DEPTH)/testing/gtest.gyp:gtest',
-        'page_visibility',
-      ],
-      'includes': [ '<(DEPTH)/cobalt/test/test.gypi' ],
-    },
-    {
-      'target_name': 'page_visibility_test_deploy',
-      'type': 'none',
-      'dependencies': [
-        'page_visibility_test',
-      ],
-      'variables': {
-        'executable_name': 'page_visibility_test',
-      },
-      'includes': [ '<(DEPTH)/starboard/build/deploy.gypi' ],
-    },
-  ],
-}
diff --git a/src/cobalt/page_visibility/page_visibility_state.cc b/src/cobalt/page_visibility/page_visibility_state.cc
deleted file mode 100644
index 17c16d0..0000000
--- a/src/cobalt/page_visibility/page_visibility_state.cc
+++ /dev/null
@@ -1,179 +0,0 @@
-// Copyright 2017 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "cobalt/page_visibility/page_visibility_state.h"
-
-#include "base/strings/stringprintf.h"
-#include "base/trace_event/trace_event.h"
-
-namespace cobalt {
-namespace page_visibility {
-
-#define STATE_STRING(state)                                             \
-  base::StringPrintf("%s (%d)", base::GetApplicationStateString(state), \
-                     static_cast<int>(state))
-
-namespace {
-// Converts an ApplicationState to a VisibilityState.
-VisibilityState ToVisibilityState(base::ApplicationState state) {
-  switch (state) {
-    case base::kApplicationStatePreloading:
-      return kVisibilityStatePrerender;
-    case base::kApplicationStateStarted:
-    case base::kApplicationStatePaused:
-      return kVisibilityStateVisible;
-    case base::kApplicationStateSuspended:
-    case base::kApplicationStateStopped:
-      return kVisibilityStateHidden;
-    default:
-      NOTREACHED() << "Invalid Application State: " << STATE_STRING(state);
-      return kVisibilityStateHidden;
-  }
-}
-
-bool HasFocus(base::ApplicationState state) {
-  switch (state) {
-    case base::kApplicationStateStarted:
-      return true;
-    case base::kApplicationStatePreloading:
-    case base::kApplicationStatePaused:
-    case base::kApplicationStateSuspended:
-    case base::kApplicationStateStopped:
-      return false;
-    default:
-      NOTREACHED() << "Invalid Application State: " << STATE_STRING(state);
-      return false;
-  }
-}
-}  // namespace
-
-PageVisibilityState::PageVisibilityState()
-    : application_state_(base::kApplicationStateStarted) {
-  DLOG(INFO) << __FUNCTION__
-             << ": app_state=" << STATE_STRING(application_state_);
-}
-
-PageVisibilityState::PageVisibilityState(
-    base::ApplicationState initial_application_state)
-    : application_state_(initial_application_state) {
-  DLOG(INFO) << __FUNCTION__
-             << ": app_state=" << STATE_STRING(application_state_);
-  DCHECK((application_state_ == base::kApplicationStateStarted) ||
-         (application_state_ == base::kApplicationStatePreloading) ||
-         (application_state_ == base::kApplicationStatePaused))
-      << "application_state_=" << STATE_STRING(application_state_);
-}
-
-bool PageVisibilityState::HasWindowFocus() const {
-  return HasFocus(application_state());
-}
-
-VisibilityState PageVisibilityState::GetVisibilityState() const {
-  return ToVisibilityState(application_state());
-}
-
-void PageVisibilityState::SetApplicationState(base::ApplicationState state) {
-  TRACE_EVENT1("cobalt::page_visibility",
-               "PageVisibilityState::SetApplicationState", "state",
-               STATE_STRING(state));
-  if (application_state_ == state) {
-    DLOG(WARNING) << __FUNCTION__ << ": Attempt to re-enter "
-                  << STATE_STRING(application_state_);
-    return;
-  }
-
-  // Audit that the transitions are correct.
-  if (DLOG_IS_ON(FATAL)) {
-    switch (application_state_) {
-      case base::kApplicationStatePaused:
-        DCHECK(state == base::kApplicationStateSuspended ||
-               state == base::kApplicationStateStarted)
-            << ": application_state_=" << STATE_STRING(application_state_)
-            << ", state=" << STATE_STRING(state);
-
-        break;
-      case base::kApplicationStatePreloading:
-        DCHECK(state == base::kApplicationStateSuspended ||
-               state == base::kApplicationStateStarted)
-            << ": application_state_=" << STATE_STRING(application_state_)
-            << ", state=" << STATE_STRING(state);
-        break;
-      case base::kApplicationStateStarted:
-        DCHECK(state == base::kApplicationStatePaused)
-            << ": application_state_=" << STATE_STRING(application_state_)
-            << ", state=" << STATE_STRING(state);
-        break;
-      case base::kApplicationStateStopped:
-        DCHECK(state == base::kApplicationStatePreloading ||
-               state == base::kApplicationStateStarted)
-            << ": application_state_=" << STATE_STRING(application_state_)
-            << ", state=" << STATE_STRING(state);
-        break;
-      case base::kApplicationStateSuspended:
-        DCHECK(state == base::kApplicationStatePaused ||
-               state == base::kApplicationStateStopped)
-            << ": application_state_=" << STATE_STRING(application_state_)
-            << ", state=" << STATE_STRING(state);
-        break;
-      default:
-        NOTREACHED() << ": application_state_="
-                     << STATE_STRING(application_state_)
-                     << ", state=" << STATE_STRING(state);
-
-        break;
-    }
-  }
-
-  bool old_has_focus = HasFocus(application_state_);
-  VisibilityState old_visibility_state = ToVisibilityState(application_state_);
-  DLOG(INFO) << __FUNCTION__ << ": " << STATE_STRING(application_state_)
-             << " -> " << STATE_STRING(state);
-  application_state_ = state;
-  bool has_focus = HasFocus(application_state_);
-  VisibilityState visibility_state = ToVisibilityState(application_state_);
-  bool focus_changed = has_focus != old_has_focus;
-  bool visibility_state_changed = visibility_state != old_visibility_state;
-
-  if (focus_changed && has_focus) {
-    // If going to a focused state, dispatch the visibility state first.
-    if (visibility_state_changed) {
-      DispatchVisibilityStateChanged(visibility_state);
-    }
-
-    DispatchWindowFocusChanged(has_focus);
-    return;
-  }
-
-  // Otherwise, we should dispatch the focus state first.
-  if (focus_changed) {
-    DispatchWindowFocusChanged(has_focus);
-  }
-
-  if (visibility_state_changed) {
-    DispatchVisibilityStateChanged(visibility_state);
-  }
-}
-
-void PageVisibilityState::DispatchWindowFocusChanged(bool has_focus) {
-  FOR_EACH_OBSERVER(Observer, observer_list_, OnWindowFocusChanged(has_focus));
-}
-
-void PageVisibilityState::DispatchVisibilityStateChanged(
-    VisibilityState visibility_state) {
-  FOR_EACH_OBSERVER(Observer, observer_list_,
-                    OnVisibilityStateChanged(visibility_state));
-}
-
-}  // namespace page_visibility
-}  // namespace cobalt
diff --git a/src/cobalt/page_visibility/page_visibility_state.h b/src/cobalt/page_visibility/page_visibility_state.h
deleted file mode 100644
index 393ea8c..0000000
--- a/src/cobalt/page_visibility/page_visibility_state.h
+++ /dev/null
@@ -1,94 +0,0 @@
-// Copyright 2017 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef COBALT_PAGE_VISIBILITY_PAGE_VISIBILITY_STATE_H_
-#define COBALT_PAGE_VISIBILITY_PAGE_VISIBILITY_STATE_H_
-
-#include "base/observer_list.h"
-#include "cobalt/base/application_state.h"
-#include "cobalt/page_visibility/visibility_state.h"
-
-namespace cobalt {
-namespace page_visibility {
-
-// The visibility state of the Window and Document as controlled by the current
-// application state.
-class PageVisibilityState {
- public:
-  // Pure virtual interface for classes that want to observe page visibility
-  // state changes.
-  class Observer : public base::CheckedObserver {
-   public:
-    // Called when the window focus state changes.
-    virtual void OnWindowFocusChanged(bool has_focus) = 0;
-    // Called when the VisibilityState changes.
-    virtual void OnVisibilityStateChanged(VisibilityState visibility_state) = 0;
-
-   protected:
-    virtual ~Observer() {}
-  };
-
-  PageVisibilityState();
-  explicit PageVisibilityState(
-      base::ApplicationState initial_application_state);
-
-  base::ApplicationState application_state() const {
-    return application_state_;
-  }
-
-  // Whether the current window has focus based on the current application
-  // state.
-  bool HasWindowFocus() const;
-
-  // Whether the current window has focus based on the current application
-  // state.
-  VisibilityState GetVisibilityState() const;
-
-  // Sets the current application state, and dispatches appropriate observation
-  // events.
-  void SetApplicationState(base::ApplicationState state);
-
-  // Adds a PageVisibiltyState::Observer to this PageVisibilityState.
-  void AddObserver(Observer* observer) { observer_list_.AddObserver(observer); }
-
-  // Removes a PageVisibiltyState::Observer from this PageVisibilityState, if it
-  // is registered.
-  void RemoveObserver(Observer* observer) {
-    observer_list_.RemoveObserver(observer);
-  }
-
-  // Returns whether a PageVisibiltyState::Observer is registered on this
-  // PageVisibilityState.
-  bool HasObserver(Observer* observer) const {
-    return observer_list_.HasObserver(observer);
-  }
-
-  // Clears all registered PageVisibiltyState::Observers, if any.
-  void ClearObservers() { observer_list_.Clear(); }
-
- private:
-  void DispatchWindowFocusChanged(bool has_focus);
-  void DispatchVisibilityStateChanged(VisibilityState visibility_state);
-
-  // The current application state.
-  base::ApplicationState application_state_;
-
-  // The list of registered PageVisibiltyState::Observers;
-  base::ObserverList<Observer> observer_list_;
-};
-
-}  // namespace page_visibility
-}  // namespace cobalt
-
-#endif  // COBALT_PAGE_VISIBILITY_PAGE_VISIBILITY_STATE_H_
diff --git a/src/cobalt/page_visibility/page_visibility_state_test.cc b/src/cobalt/page_visibility/page_visibility_state_test.cc
deleted file mode 100644
index cde7e69..0000000
--- a/src/cobalt/page_visibility/page_visibility_state_test.cc
+++ /dev/null
@@ -1,134 +0,0 @@
-// Copyright 2017 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include <memory>
-
-#include "cobalt/page_visibility/page_visibility_state.h"
-
-#include "base/debug/stack_trace.h"
-#include "base/logging.h"
-#include "cobalt/base/application_state.h"
-#include "cobalt/page_visibility/visibility_state.h"
-
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace cobalt {
-namespace page_visibility {
-namespace {
-
-using ::testing::_;
-
-class MockPageVisibilityStateObserver : public PageVisibilityState::Observer {
- public:
-  static std::unique_ptr<MockPageVisibilityStateObserver> Create() {
-    return std::unique_ptr<MockPageVisibilityStateObserver>(
-        new ::testing::StrictMock<MockPageVisibilityStateObserver>());
-  }
-
-  MOCK_METHOD1(OnWindowFocusChanged, void(bool has_focus));
-  MOCK_METHOD1(OnVisibilityStateChanged,
-               void(VisibilityState visibility_state));
-
- protected:
-  MockPageVisibilityStateObserver() {}
-};
-
-TEST(PageVisibilityStateTest, DefaultConstructor) {
-  PageVisibilityState state;
-  EXPECT_TRUE(state.HasWindowFocus());
-  EXPECT_EQ(kVisibilityStateVisible, state.GetVisibilityState());
-}
-
-TEST(PageVisibilityStateTest, InitialStateConstructorStarted) {
-  PageVisibilityState state(base::kApplicationStateStarted);
-  EXPECT_TRUE(state.HasWindowFocus());
-  EXPECT_EQ(kVisibilityStateVisible, state.GetVisibilityState());
-}
-
-TEST(PageVisibilityStateTest, TransitionsAndObservations) {
-  PageVisibilityState state(base::kApplicationStateStarted);
-  std::unique_ptr<MockPageVisibilityStateObserver> observer =
-      MockPageVisibilityStateObserver::Create();
-
-  EXPECT_CALL(*observer, OnWindowFocusChanged(_)).Times(0);
-  EXPECT_CALL(*observer, OnVisibilityStateChanged(_)).Times(0);
-  EXPECT_TRUE(state.HasWindowFocus());
-  EXPECT_EQ(kVisibilityStateVisible, state.GetVisibilityState());
-  ::testing::Mock::VerifyAndClearExpectations(observer.get());
-
-  state.AddObserver(observer.get());
-
-  EXPECT_CALL(*observer, OnWindowFocusChanged(false));
-  EXPECT_CALL(*observer, OnVisibilityStateChanged(_)).Times(0);
-  state.SetApplicationState(base::kApplicationStatePaused);
-  EXPECT_FALSE(state.HasWindowFocus());
-  EXPECT_EQ(kVisibilityStateVisible, state.GetVisibilityState());
-  ::testing::Mock::VerifyAndClearExpectations(observer.get());
-
-  EXPECT_CALL(*observer, OnWindowFocusChanged(true));
-  EXPECT_CALL(*observer, OnVisibilityStateChanged(_)).Times(0);
-  state.SetApplicationState(base::kApplicationStateStarted);
-  EXPECT_TRUE(state.HasWindowFocus());
-  EXPECT_EQ(kVisibilityStateVisible, state.GetVisibilityState());
-  ::testing::Mock::VerifyAndClearExpectations(observer.get());
-
-  EXPECT_CALL(*observer, OnWindowFocusChanged(false));
-  EXPECT_CALL(*observer, OnVisibilityStateChanged(_)).Times(0);
-  state.SetApplicationState(base::kApplicationStatePaused);
-  EXPECT_FALSE(state.HasWindowFocus());
-  EXPECT_EQ(kVisibilityStateVisible, state.GetVisibilityState());
-  ::testing::Mock::VerifyAndClearExpectations(observer.get());
-
-  EXPECT_CALL(*observer, OnVisibilityStateChanged(kVisibilityStateHidden));
-  EXPECT_CALL(*observer, OnWindowFocusChanged(_)).Times(0);
-  state.SetApplicationState(base::kApplicationStateSuspended);
-  EXPECT_FALSE(state.HasWindowFocus());
-  EXPECT_EQ(kVisibilityStateHidden, state.GetVisibilityState());
-  ::testing::Mock::VerifyAndClearExpectations(observer.get());
-
-  EXPECT_CALL(*observer, OnVisibilityStateChanged(kVisibilityStateVisible));
-  EXPECT_CALL(*observer, OnWindowFocusChanged(_)).Times(0);
-  state.SetApplicationState(base::kApplicationStatePaused);
-  EXPECT_FALSE(state.HasWindowFocus());
-  EXPECT_EQ(kVisibilityStateVisible, state.GetVisibilityState());
-  ::testing::Mock::VerifyAndClearExpectations(observer.get());
-
-  EXPECT_CALL(*observer, OnWindowFocusChanged(true));
-  EXPECT_CALL(*observer, OnVisibilityStateChanged(_)).Times(0);
-  state.SetApplicationState(base::kApplicationStateStarted);
-  EXPECT_TRUE(state.HasWindowFocus());
-  EXPECT_EQ(kVisibilityStateVisible, state.GetVisibilityState());
-  ::testing::Mock::VerifyAndClearExpectations(observer.get());
-
-  state.RemoveObserver(observer.get());
-
-  EXPECT_CALL(*observer, OnWindowFocusChanged(_)).Times(0);
-  EXPECT_CALL(*observer, OnVisibilityStateChanged(_)).Times(0);
-  state.SetApplicationState(base::kApplicationStatePaused);
-  EXPECT_FALSE(state.HasWindowFocus());
-  EXPECT_EQ(kVisibilityStateVisible, state.GetVisibilityState());
-  ::testing::Mock::VerifyAndClearExpectations(observer.get());
-
-  EXPECT_CALL(*observer, OnWindowFocusChanged(_)).Times(0);
-  EXPECT_CALL(*observer, OnVisibilityStateChanged(_)).Times(0);
-  state.SetApplicationState(base::kApplicationStateSuspended);
-  EXPECT_FALSE(state.HasWindowFocus());
-  EXPECT_EQ(kVisibilityStateHidden, state.GetVisibilityState());
-  ::testing::Mock::VerifyAndClearExpectations(observer.get());
-}
-
-}  // namespace
-}  // namespace page_visibility
-}  // namespace cobalt
diff --git a/src/cobalt/render_tree/lottie_animation.h b/src/cobalt/render_tree/lottie_animation.h
index 8b1a771..9cab513 100644
--- a/src/cobalt/render_tree/lottie_animation.h
+++ b/src/cobalt/render_tree/lottie_animation.h
@@ -198,6 +198,7 @@
     base::Closure onstop_callback;
     base::Closure oncomplete_callback;
     base::Closure onloop_callback;
+    base::Callback<void(double, double)> onenterframe_callback;
   };
 
   virtual void SetProperties(LottieProperties properties) = 0;
diff --git a/src/cobalt/render_tree/mock_resource_provider.h b/src/cobalt/render_tree/mock_resource_provider.h
index c17df9b..244d695 100644
--- a/src/cobalt/render_tree/mock_resource_provider.h
+++ b/src/cobalt/render_tree/mock_resource_provider.h
@@ -103,8 +103,6 @@
     return scoped_refptr<Image>(CreateImageMock(pixel_data.get()));
   }
 
-#if SB_HAS(GRAPHICS)
-
   scoped_refptr<Image> CreateImageFromSbDecodeTarget(SbDecodeTarget target) {
     return NULL;
   }
@@ -116,8 +114,6 @@
     return NULL;
   }
 
-#endif  // SB_HAS(GRAPHICS)
-
   std::unique_ptr<RawImageMemory> AllocateRawImageMemory(size_t size_in_bytes,
                                                          size_t alignment) {
     return std::unique_ptr<RawImageMemory>(
diff --git a/src/cobalt/render_tree/resource_provider.h b/src/cobalt/render_tree/resource_provider.h
index 8820eed..af51209 100644
--- a/src/cobalt/render_tree/resource_provider.h
+++ b/src/cobalt/render_tree/resource_provider.h
@@ -79,7 +79,6 @@
   virtual scoped_refptr<Image> CreateImage(
       std::unique_ptr<ImageData> pixel_data) = 0;
 
-#if SB_HAS(GRAPHICS)
   // This function will consume an SbDecodeTarget object produced by
   // SbDecodeTargetCreate(), wrap it in a render_tree::Image that can be used
   // in a render tree, and return it to the caller.
@@ -94,7 +93,6 @@
   // supported.
   virtual SbDecodeTargetGraphicsContextProvider*
   GetSbDecodeTargetGraphicsContextProvider() = 0;
-#endif  // SB_HAS(GRAPHICS)
 
   // Returns a raw chunk of memory that can later be passed into a function like
   // CreateMultiPlaneImageFromRawMemory() in order to create a texture.
diff --git a/src/cobalt/render_tree/resource_provider_stub.h b/src/cobalt/render_tree/resource_provider_stub.h
index bd1a72b..961b59b 100644
--- a/src/cobalt/render_tree/resource_provider_stub.h
+++ b/src/cobalt/render_tree/resource_provider_stub.h
@@ -282,7 +282,6 @@
     return base::WrapRefCounted(new ImageStub(std::move(skia_source_data)));
   }
 
-#if SB_HAS(GRAPHICS)
   scoped_refptr<Image> CreateImageFromSbDecodeTarget(
       SbDecodeTarget decode_target) override {
     NOTREACHED();
@@ -291,14 +290,11 @@
   }
 
   bool SupportsSbDecodeTarget() override { return false; }
-#endif  // SB_HAS(GRAPHICS)
 
-#if SB_HAS(GRAPHICS)
   SbDecodeTargetGraphicsContextProvider*
   GetSbDecodeTargetGraphicsContextProvider() override {
     return NULL;
   }
-#endif  // SB_HAS(GRAPHICS)
 
   std::unique_ptr<RawImageMemory> AllocateRawImageMemory(
       size_t size_in_bytes, size_t alignment) override {
diff --git a/src/cobalt/renderer/rasterizer/blitter/resource_provider.cc b/src/cobalt/renderer/rasterizer/blitter/resource_provider.cc
index c58628d..83d2baf 100644
--- a/src/cobalt/renderer/rasterizer/blitter/resource_provider.cc
+++ b/src/cobalt/renderer/rasterizer/blitter/resource_provider.cc
@@ -84,8 +84,6 @@
       new SinglePlaneImage(std::move(blitter_source_data)));
 }
 
-#if SB_HAS(GRAPHICS)
-
 scoped_refptr<render_tree::Image>
 ResourceProvider::CreateImageFromSbDecodeTarget(SbDecodeTarget decode_target) {
   SbDecodeTargetInfo info;
@@ -114,8 +112,6 @@
   return NULL;
 }
 
-#endif  // SB_HAS(GRAPHICS)
-
 std::unique_ptr<render_tree::RawImageMemory>
 ResourceProvider::AllocateRawImageMemory(size_t size_in_bytes,
                                          size_t alignment) {
diff --git a/src/cobalt/renderer/rasterizer/pixel_test.cc b/src/cobalt/renderer/rasterizer/pixel_test.cc
index 90ee177..55ab832 100644
--- a/src/cobalt/renderer/rasterizer/pixel_test.cc
+++ b/src/cobalt/renderer/rasterizer/pixel_test.cc
@@ -1496,6 +1496,23 @@
 
   TestTree(new ImageNode(image, math::Rect(output_surface_size())));
 }
+
+TEST_F(PixelTest, YUV422UYVYImageScaledAndTranslated) {
+  if (!GetResourceProvider()->PixelFormatSupported(
+          render_tree::kPixelFormatUYVY)) {
+    return;
+  }
+
+  // Use a particular image format to force textured mesh renderer path
+  // (i.e. Image::CanRenderInSkia() == false).
+  scoped_refptr<Image> image =
+      MakeAlternatingYUYVYImage(GetResourceProvider(), output_surface_size());
+
+  TestTree(new ImageNode(image, RectF(image->GetSize()),
+                         Matrix3F::FromValues(2.0f, 0.0f, -1.0f,
+                                              0.0f, 2.0f, -1.0f,
+                                              0.0f, 0.0f, 1.0f)));
+}
 #endif  // !SB_HAS(BLITTER)
 
 // The software rasterizer does not support NV12 images.
@@ -1546,6 +1563,16 @@
                          TranslateMatrix(0.5f, 0.5f)));
 }
 
+TEST_F(PixelTest, ImageNodeLocalTransformScaleAndTranslation) {
+  scoped_refptr<Image> image =
+      CreateColoredCheckersImage(GetResourceProvider(), output_surface_size());
+
+  TestTree(new ImageNode(image, RectF(image->GetSize()),
+                         Matrix3F::FromValues(2.0f, 0.0f, -1.0f,
+                                              0.0f, 2.0f, -1.0f,
+                                              0.0f, 0.0f, 1.0f)));
+}
+
 TEST_F(PixelTest, ImageNodeLocalTransformOfImageSmallerThanSurface) {
   scoped_refptr<Image> image =
       CreateColoredCheckersImage(GetResourceProvider(),
diff --git a/src/cobalt/renderer/rasterizer/skia/hardware_rasterizer.cc b/src/cobalt/renderer/rasterizer/skia/hardware_rasterizer.cc
index 49abfc1..8064da1 100644
--- a/src/cobalt/renderer/rasterizer/skia/hardware_rasterizer.cc
+++ b/src/cobalt/renderer/rasterizer/skia/hardware_rasterizer.cc
@@ -303,7 +303,7 @@
     // y-axis before passing it on to a GL renderer.
     math::Size image_size(image->GetSize());
     result.content_region = math::Rect::RoundFromRectF(math::RectF(
-        image_size.width() * local_transform.Get(0, 2) /
+        -image_size.width() * local_transform.Get(0, 2) /
             local_transform.Get(0, 0),
         image_size.height() *
             (1 + local_transform.Get(1, 2) / local_transform.Get(1, 1)),
diff --git a/src/cobalt/renderer/rasterizer/skia/hardware_resource_provider.cc b/src/cobalt/renderer/rasterizer/skia/hardware_resource_provider.cc
index 71ca3b8..fa0748f 100644
--- a/src/cobalt/renderer/rasterizer/skia/hardware_resource_provider.cc
+++ b/src/cobalt/renderer/rasterizer/skia/hardware_resource_provider.cc
@@ -13,6 +13,7 @@
 // limitations under the License.
 
 #include "starboard/configuration.h"
+
 #if SB_API_VERSION >= 12 || SB_HAS(GLES2)
 
 #include "cobalt/renderer/rasterizer/skia/hardware_resource_provider.h"
@@ -64,7 +65,6 @@
   // Initialize the font manager now to ensure that it doesn't get initialized
   // on multiple threads simultaneously later.
   SkFontMgr::RefDefault();
-#if SB_HAS(GRAPHICS)
   decode_target_graphics_context_provider_.egl_display =
       cobalt_context_->system_egl()->GetDisplay();
   decode_target_graphics_context_provider_.egl_context =
@@ -72,7 +72,6 @@
   decode_target_graphics_context_provider_.gles_context_runner =
       &HardwareResourceProvider::GraphicsContextRunner;
   decode_target_graphics_context_provider_.gles_context_runner_context = this;
-#endif  // SB_HAS(GRAPHICS)
 }
 
 HardwareResourceProvider::~HardwareResourceProvider() {
@@ -162,7 +161,6 @@
       self_message_loop_));
 }
 
-#if SB_HAS(GRAPHICS)
 namespace {
 
 uint32_t DecodeTargetFormatToGLFormat(
@@ -377,8 +375,6 @@
   }
 }
 
-#endif  // SB_HAS(GRAPHICS)
-
 std::unique_ptr<RawImageMemory>
 HardwareResourceProvider::AllocateRawImageMemory(size_t size_in_bytes,
                                                  size_t alignment) {
diff --git a/src/cobalt/renderer/rasterizer/skia/hardware_resource_provider.h b/src/cobalt/renderer/rasterizer/skia/hardware_resource_provider.h
index b5d71c2..63d4e5e 100644
--- a/src/cobalt/renderer/rasterizer/skia/hardware_resource_provider.h
+++ b/src/cobalt/renderer/rasterizer/skia/hardware_resource_provider.h
@@ -60,8 +60,6 @@
   scoped_refptr<render_tree::Image> CreateImage(
       std::unique_ptr<render_tree::ImageData> pixel_data) override;
 
-#if SB_HAS(GRAPHICS)
-
   scoped_refptr<render_tree::Image> CreateImageFromSbDecodeTarget(
       SbDecodeTarget decode_target) override;
 
@@ -75,8 +73,6 @@
   // Whether SbDecodeTargetIsSupported or not.
   bool SupportsSbDecodeTarget() override { return true; }
 
-#endif  // SB_HAS(GRAPHICS)
-
   std::unique_ptr<render_tree::RawImageMemory> AllocateRawImageMemory(
       size_t size_in_bytes, size_t alignment) override;
 
@@ -137,7 +133,6 @@
   TextShaper text_shaper_;
   int max_texture_size_;
 
-#if SB_HAS(GRAPHICS)
   static void GraphicsContextRunner(
       SbDecodeTargetGraphicsContextProvider* graphics_context_provider,
       SbDecodeTargetGlesContextRunnerTarget target_function,
@@ -145,7 +140,6 @@
 
   SbDecodeTargetGraphicsContextProvider
       decode_target_graphics_context_provider_;
-#endif  // SB_HAS(GRAPHICS)
 
   // We keep a handle to the message loop that this resource provider was
   // created on.  This message loop is used whenever we need to issue graphics
diff --git a/src/cobalt/renderer/rasterizer/skia/skia/config/SkUserConfig.h b/src/cobalt/renderer/rasterizer/skia/skia/config/SkUserConfig.h
index 9ba2a14..34dc4fc 100644
--- a/src/cobalt/renderer/rasterizer/skia/skia/config/SkUserConfig.h
+++ b/src/cobalt/renderer/rasterizer/skia/skia/config/SkUserConfig.h
@@ -260,12 +260,6 @@
 
 // GrGLConfig.h settings customization for Cobalt.
 
-#if defined(STARBOARD)
-#if SB_HAS_QUIRK(GL_NO_CONSTANT_ATTRIBUTE_SUPPORT)
-#define GR_GL_NO_CONSTANT_ATTRIBUTES 1
-#endif // SB_HAS_QUIRK(GL_NO_CONSTANT_ATTRIBUTE_SUPPORT)
-#endif // defined(STARBOARD)
-
 // Avoid calling glGetError() after glTexImage, glBufferData,
 // glRenderbufferStorage, etc...  It can be potentially expensive to call on
 // some platforms, and Cobalt is designed for devices where we can ensure we
diff --git a/src/cobalt/renderer/rasterizer/skia/skia/skia.gyp b/src/cobalt/renderer/rasterizer/skia/skia/skia.gyp
index 091f7bd..dfefca6 100644
--- a/src/cobalt/renderer/rasterizer/skia/skia/skia.gyp
+++ b/src/cobalt/renderer/rasterizer/skia/skia/skia.gyp
@@ -27,6 +27,9 @@
       # Skia's core code from the Skia repository.
       'target_name': 'skia_library',
       'type': 'static_library',
+      'dependencies': [
+        'skia_library_no_asan',
+      ],
       'includes': [
         'skia_common.gypi',
         'skia_library.gypi',
@@ -35,6 +38,28 @@
     },
 
     {
+      # Skia's core code from the Skia repository that should be compiled
+      # without ASAN. This is done to avoid drastic slowdown in debug unit
+      # tests.
+      'target_name': 'skia_library_no_asan',
+      'type': 'static_library',
+      'includes': [
+        'skia_common.gypi',
+        '<(DEPTH)/third_party/skia/gyp/effects_imagefilters.gypi',
+      ],
+      'sources': [
+        '<@(skia_effects_imagefilter_sources_no_asan)',
+      ],
+      'target_conditions': [
+        ['use_asan==1 and cobalt_config=="debug"', {
+          'cflags!': [
+            '-fsanitize=address',
+          ],
+        }],
+      ],
+    },
+
+    {
       # A small program imported from Chromium that tests Skia with fuzzed
       # filters.
       'target_name': 'filter_fuzz_stub',
diff --git a/src/cobalt/renderer/rasterizer/skia/skottie_animation.cc b/src/cobalt/renderer/rasterizer/skia/skottie_animation.cc
index 866c39f..71af29e 100644
--- a/src/cobalt/renderer/rasterizer/skia/skottie_animation.cc
+++ b/src/cobalt/renderer/rasterizer/skia/skottie_animation.cc
@@ -14,12 +14,15 @@
 
 #include "cobalt/renderer/rasterizer/skia/skottie_animation.h"
 
+#include "base/bind.h"
+
 namespace cobalt {
 namespace renderer {
 namespace rasterizer {
 namespace skia {
 
-SkottieAnimation::SkottieAnimation(const char* data, size_t length) {
+SkottieAnimation::SkottieAnimation(const char* data, size_t length)
+    : last_updated_animation_time_(base::TimeDelta()) {
   skottie::Animation::Builder builder;
   skottie_animation_ = builder.make(data, length);
   animation_size_ = math::Size(skottie_animation_->size().width(),
@@ -35,53 +38,62 @@
   // Seeking to a particular frame takes precedence over normal playback.
   // Check whether "seek()" has been called but has yet to occur.
   if (seek_counter_ != properties_.seek_counter) {
+    base::TimeDelta current_animation_time;
     if (properties_.seek_value_is_frame) {
       skottie_animation_->seekFrame(properties_.seek_value);
-      current_animation_time_ = base::TimeDelta::FromSecondsD(
-          properties_.seek_value * skottie_animation_->fps() *
-          skottie_animation_->duration());
+      current_animation_time = base::TimeDelta::FromSecondsD(
+          properties_.seek_value / skottie_animation_->fps());
     } else {
       skottie_animation_->seekFrameTime(properties_.seek_value *
                                         skottie_animation_->duration());
-      current_animation_time_ = base::TimeDelta::FromSecondsD(
+      current_animation_time = base::TimeDelta::FromSecondsD(
           properties_.seek_value * skottie_animation_->duration());
     }
-    last_updated_animate_function_time_ = animate_function_time;
     seek_counter_ = properties_.seek_counter;
     is_complete_ = false;
+    UpdateAnimationFrameAndAnimateFunctionTimes(current_animation_time,
+                                                animate_function_time);
     return;
   }
 
-  // Reset |current_animation_time| to the start of the animation if the
-  // animation is stopped.
+  // Reset the animation time to the start of the animation if the animation is
+  // stopped.
   if (properties_.state == LottieState::kStopped) {
     skottie_animation_->seekFrameTime(0);
-    current_animation_time_ = base::TimeDelta();
-    last_updated_animate_function_time_ = animate_function_time;
     is_complete_ = false;
+    UpdateAnimationFrameAndAnimateFunctionTimes(base::TimeDelta(),
+                                                animate_function_time);
     return;
   }
 
-  // Update |current_animation_time_| if the animation is playing.
-  if (properties_.state == LottieState::kPlaying) {
-    base::TimeDelta time_elapsed =
-        animate_function_time - last_updated_animate_function_time_;
-    current_animation_time_ += time_elapsed * properties_.speed;
+  // Do not update the animation time is the animation is paused.
+  if (properties_.state == LottieState::kPaused) {
+    skottie_animation_->seekFrameTime(
+        last_updated_animation_time_.InSecondsF());
+    UpdateAnimationFrameAndAnimateFunctionTimes(last_updated_animation_time_,
+                                                animate_function_time);
+    return;
   }
 
-  double current_frame_time = current_animation_time_.InSecondsF();
+  DCHECK(properties_.state == LottieState::kPlaying);
+  base::TimeDelta current_animation_time = last_updated_animation_time_;
+  base::TimeDelta time_elapsed =
+      animate_function_time - last_updated_animate_function_time_;
+  current_animation_time += time_elapsed * properties_.speed;
+  base::TimeDelta animation_duration =
+      base::TimeDelta::FromSecondsD(skottie_animation_->duration());
+
   if (properties_.loop) {
     // If the animation mode is "bounce", then the animation should change
     // the direction in which it plays after each loop.
-    int new_loop_count =
-        floor(current_frame_time / skottie_animation_->duration());
+    int new_loop_count = floor(current_animation_time / animation_duration);
 
     // Check whether the number of loops exceeds the limits set by
     // LottieProperties::count.
     // (Note: LottieProperties::count refers to the number of loops after the
     // animation plays once through.)
     if (properties_.count > 0 && new_loop_count > properties_.count) {
-      current_frame_time = skottie_animation_->duration();
+      current_animation_time = animation_duration;
     } else {
       // If the animation should continue playing, check whether the animation
       // has completed and needs to trigger a "loop" and potentially reverse
@@ -94,21 +106,47 @@
           direction_ *= -1;
         }
       }
-      current_frame_time =
-          std::fmod(current_frame_time, skottie_animation_->duration());
+      current_animation_time = base::TimeDelta::FromSecondsD(
+          std::fmod(current_animation_time.InSecondsF(),
+                    animation_duration.InSecondsF()));
     }
     total_loops_ = new_loop_count;
   }
+
   if (direction_ * properties_.direction == -1) {
-    current_frame_time = skottie_animation_->duration() - current_frame_time;
+    current_animation_time = animation_duration - current_animation_time;
   }
-  if (!is_complete_ && current_frame_time > skottie_animation_->duration() &&
+
+  if (!is_complete_ && current_animation_time > animation_duration &&
       !properties_.oncomplete_callback.is_null()) {
     is_complete_ = true;
     properties_.oncomplete_callback.Run();
   }
-  skottie_animation_->seekFrameTime(current_frame_time);
-  last_updated_animate_function_time_ = animate_function_time;
+
+  skottie_animation_->seekFrameTime(current_animation_time.InSecondsF());
+  UpdateAnimationFrameAndAnimateFunctionTimes(current_animation_time,
+                                              animate_function_time);
+}
+
+void SkottieAnimation::UpdateAnimationFrameAndAnimateFunctionTimes(
+    base::TimeDelta current_animation_time,
+    base::TimeDelta current_animate_function_time) {
+  if (current_animation_time == last_updated_animation_time_) {
+    return;
+  }
+
+  // Dispatch a frame event every time a new frame is entered, and if the
+  // animation is not complete.
+  double frame =
+      current_animation_time.InSecondsF() * skottie_animation_->fps();
+  double seeker = current_animation_time.InSecondsF() /
+                  skottie_animation_->duration() * 100;
+  if (!properties_.onenterframe_callback.is_null() && !is_complete_) {
+    properties_.onenterframe_callback.Run(frame, seeker);
+  }
+
+  last_updated_animation_time_ = current_animation_time;
+  last_updated_animate_function_time_ = current_animate_function_time;
 }
 
 }  // namespace skia
diff --git a/src/cobalt/renderer/rasterizer/skia/skottie_animation.h b/src/cobalt/renderer/rasterizer/skia/skottie_animation.h
index 3606a90..f6cd6eb 100644
--- a/src/cobalt/renderer/rasterizer/skia/skottie_animation.h
+++ b/src/cobalt/renderer/rasterizer/skia/skottie_animation.h
@@ -44,6 +44,10 @@
   sk_sp<skottie::Animation> GetSkottieAnimation() { return skottie_animation_; }
 
  private:
+  void UpdateAnimationFrameAndAnimateFunctionTimes(
+      base::TimeDelta current_animation_time,
+      base::TimeDelta current_animate_function_time);
+
   sk_sp<skottie::Animation> skottie_animation_;
   math::Size animation_size_;
   uint32 json_size_in_bytes_;
@@ -77,7 +81,7 @@
   base::TimeDelta last_updated_animate_function_time_;
 
   // The most recently updated frame time for |skottie_animation_|.
-  base::TimeDelta current_animation_time_;
+  base::TimeDelta last_updated_animation_time_;
 };
 
 }  // namespace skia
diff --git a/src/cobalt/renderer/rasterizer/skia/software_resource_provider.h b/src/cobalt/renderer/rasterizer/skia/software_resource_provider.h
index c906967..68d06ff 100644
--- a/src/cobalt/renderer/rasterizer/skia/software_resource_provider.h
+++ b/src/cobalt/renderer/rasterizer/skia/software_resource_provider.h
@@ -51,7 +51,6 @@
   scoped_refptr<render_tree::Image> CreateImage(
       std::unique_ptr<render_tree::ImageData> pixel_data) override;
 
-#if SB_HAS(GRAPHICS)
   scoped_refptr<render_tree::Image> CreateImageFromSbDecodeTarget(
       SbDecodeTarget decode_target) override {
     NOTREACHED();
@@ -65,7 +64,6 @@
   }
 
   bool SupportsSbDecodeTarget() override { return false; }
-#endif  // SB_HAS(GRAPHICS)
 
   std::unique_ptr<render_tree::RawImageMemory> AllocateRawImageMemory(
       size_t size_in_bytes, size_t alignment) override;
diff --git a/src/cobalt/renderer/rasterizer/testdata/ImageNodeLocalTransformScaleAndTranslation-expected.png b/src/cobalt/renderer/rasterizer/testdata/ImageNodeLocalTransformScaleAndTranslation-expected.png
new file mode 100644
index 0000000..af75907
--- /dev/null
+++ b/src/cobalt/renderer/rasterizer/testdata/ImageNodeLocalTransformScaleAndTranslation-expected.png
Binary files differ
diff --git a/src/cobalt/renderer/rasterizer/testdata/YUV422UYVYImageScaledAndTranslated-expected.png b/src/cobalt/renderer/rasterizer/testdata/YUV422UYVYImageScaledAndTranslated-expected.png
new file mode 100644
index 0000000..eb228d0
--- /dev/null
+++ b/src/cobalt/renderer/rasterizer/testdata/YUV422UYVYImageScaledAndTranslated-expected.png
Binary files differ
diff --git a/src/cobalt/script/v8c/v8c.gyp b/src/cobalt/script/v8c/v8c.gyp
index 404c352..e9c31d8 100644
--- a/src/cobalt/script/v8c/v8c.gyp
+++ b/src/cobalt/script/v8c/v8c.gyp
@@ -74,6 +74,7 @@
         'v8c_wrapper_handle.h',
         'wrapper_factory.cc',
         'wrapper_factory.h',
+        'wrapper_private.cc',
         'wrapper_private.h',
       ],
       'dependencies': [
diff --git a/src/cobalt/script/v8c/v8c_heap_tracer.cc b/src/cobalt/script/v8c/v8c_heap_tracer.cc
index e9b42c6..a6c1d86 100644
--- a/src/cobalt/script/v8c/v8c_heap_tracer.cc
+++ b/src/cobalt/script/v8c/v8c_heap_tracer.cc
@@ -32,10 +32,7 @@
         static_cast<WrapperPrivate*>(embedder_field.first);
     Wrappable* wrappable = wrapper_private->raw_wrappable();
     MaybeAddToFrontier(wrappable);
-
-    // We expect this field to always be null, since we only have it as a
-    // workaround for V8.  See "wrapper_private.h" for details.
-    DCHECK(embedder_field.second == nullptr);
+    DCHECK(embedder_field.second == WrapperPrivate::kInternalFieldIdValue);
   }
 }
 
diff --git a/src/cobalt/script/v8c/wrapper_private.cc b/src/cobalt/script/v8c/wrapper_private.cc
new file mode 100644
index 0000000..eac70f2
--- /dev/null
+++ b/src/cobalt/script/v8c/wrapper_private.cc
@@ -0,0 +1,29 @@
+// Copyright 2020 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "cobalt/script/v8c/wrapper_private.h"
+
+#include "starboard/types.h"
+
+namespace cobalt {
+namespace script {
+namespace v8c {
+
+// This magic number helps identify objects as Cobalt platform objects.
+void* const WrapperPrivate::kInternalFieldIdValue =
+    reinterpret_cast<void*>(uintptr_t(0xc0ba1700));
+
+}  // namespace v8c
+}  // namespace script
+}  // namespace cobalt
diff --git a/src/cobalt/script/v8c/wrapper_private.h b/src/cobalt/script/v8c/wrapper_private.h
index e41db18..4c37afb 100644
--- a/src/cobalt/script/v8c/wrapper_private.h
+++ b/src/cobalt/script/v8c/wrapper_private.h
@@ -17,6 +17,7 @@
 
 #include "base/memory/weak_ptr.h"
 #include "cobalt/base/polymorphic_downcast.h"
+#include "cobalt/script/wrappable.h"
 #include "v8/include/v8.h"
 
 namespace cobalt {
@@ -40,17 +41,21 @@
   // should never be called on objects that don't have private data.
   static WrapperPrivate* GetFromWrapperObject(v8::Local<v8::Object> object) {
     DCHECK(object->InternalFieldCount() == kInternalFieldCount);
+    DCHECK(object->GetAlignedPointerFromInternalField(kInternalFieldIdIndex) ==
+           kInternalFieldIdValue);
     return static_cast<WrapperPrivate*>(
         object->GetAlignedPointerFromInternalField(kInternalFieldDataIndex));
   }
 
   // Check whether |object| has private wrapper data.
   static bool HasWrapperPrivate(v8::Local<v8::Object> object) {
-    return object->InternalFieldCount() == kInternalFieldCount;
+    return object->InternalFieldCount() == kInternalFieldCount &&
+           object->GetAlignedPointerFromInternalField(kInternalFieldIdIndex) ==
+               kInternalFieldIdValue;
   }
 
   // The total amount of internal fields in |wrapper_| we use.  See
-  // |kInternalFieldDataIndex| and |kInternalFieldDummyIndex| below for
+  // |kInternalFieldDataIndex| and |kInternalFieldIdIndex| below for
   // further information.
   static const int kInternalFieldCount = 2;
 
@@ -58,6 +63,10 @@
   // Blink specific class ids in the future.
   static const int kClassId = 1009;
 
+  // This magic number is used to positively identify the object as a Cobalt
+  // platform object.
+  static void* const kInternalFieldIdValue;
+
   WrapperPrivate() = delete;
   WrapperPrivate(v8::Isolate* isolate,
                  const scoped_refptr<Wrappable>& wrappable,
@@ -66,8 +75,8 @@
         wrappable_(wrappable),
         traced_global_(isolate, wrapper) {
     wrapper->SetAlignedPointerInInternalField(kInternalFieldDataIndex, this);
-    wrapper->SetAlignedPointerInInternalField(kInternalFieldDummyIndex,
-                                              nullptr);
+    wrapper->SetAlignedPointerInInternalField(kInternalFieldIdIndex,
+                                              kInternalFieldIdValue);
     traced_global_.SetFinalizationCallback(this, &WrapperPrivate::Callback);
     traced_global_.SetWrapperClassId(kClassId);
   }
@@ -90,18 +99,9 @@
   // For the time being, we only use a single internal field, which stores a
   // pointer back to us (us being the |WrapperPrivate|).
   static const int kInternalFieldDataIndex = 0;
-  // Blink uses two fields, so V8 won't believe we're a potential wrapper
-  // unless we have two fields.
-  //      .-""""""-.
-  //    .'          '.
-  //   /   O      O   \
-  //  :                :
-  //  |                |
-  //  :    .------.    :
-  //   \  '        '  /
-  //    '.          .'
-  //      '-......-'
-  static const int kInternalFieldDummyIndex = 1;
+  // V8 built-in types may also use internal fields, so use a special Id to
+  // confirm that the object is a Cobalt platform object.
+  static const int kInternalFieldIdIndex = 1;
 
   v8::Isolate* isolate_;
   scoped_refptr<Wrappable> wrappable_;
diff --git a/src/cobalt/site/docs/development/reference/supported-features.md b/src/cobalt/site/docs/development/reference/supported-features.md
index 67dbabf..d4e41e4 100644
--- a/src/cobalt/site/docs/development/reference/supported-features.md
+++ b/src/cobalt/site/docs/development/reference/supported-features.md
@@ -5,20 +5,27 @@
 
 ## HTML elements
 
+*   `<a>`
+*   `<audio>`
 *   `<body>`
 *   `<br>`
 *   `<div>`
 *   `<head>`
 *   `<html>`
 *   `<link>` (with `type="text/css"`)
+*   `<lottie-player>`
 *   `<meta>`
 *   `<script>`
 *   `<span>`
 *   `<style>`
+*   `<title>`
 *   `<video>`
 
 ## CSS properties
 
+*   [align-content](https://www.w3.org/TR/css-flexbox-1/#propdef-align-content)
+*   [align-items](https://www.w3.org/TR/css-flexbox-1/#propdef-align-items)
+*   [align-self](https://www.w3.org/TR/css-flexbox-1/#propdef-align-self)
 *   [animation](
     https://www.w3.org/TR/css3-animations/#animation-shorthand-property)
 *   [background](https://www.w3.org/TR/css3-background/#the-background),
@@ -42,12 +49,23 @@
 *   [color](https://www.w3.org/TR/css3-color/#foreground)
 *   [content](https://www.w3.org/TR/CSS21/generate.html#content)
 *   [display](https://www.w3.org/TR/CSS21/visuren.html#propdef-display)
+*   [dpi](https://www.w3.org/TR/css-values-3/#resolution)
+*   [flex](https://www.w3.org/TR/css-flexbox-1/#propdef-flex)
+*   [flex-basis](https://www.w3.org/TR/css-flexbox-1/#propdef-flex-basis)
+*   [flex-direction](
+    https://www.w3.org/TR/css-flexbox-1/#flex-direction-property)
+*   [flex-flow](https://www.w3.org/TR/css-flexbox-1/#flex-flow-property)
+*   [flex-grow](https://www.w3.org/TR/css-flexbox-1/#propdef-flex-grow)
+*   [flex-shrink](https://www.w3.org/TR/css-flexbox-1/#propdef-flex-shrink)
+*   [flex-wrap](https://www.w3.org/TR/css-flexbox-1/#flex-wrap-property)
 *   [font](https://www.w3.org/TR/css-fonts-3/#font-prop)
 *   [@font-face](https://www.w3.org/TR/css-fonts-3/#font-face-rule)
 *   [font-family](https://www.w3.org/TR/css-fonts-3/#propdef-font-family)
 *   [font-size](https://www.w3.org/TR/css-fonts-3/#font-size-prop)
 *   [font-style](https://www.w3.org/TR/css-fonts-3/#font-style-prop)
 *   [font-weight](https://www.w3.org/TR/css-fonts-3/#font-weight-prop)
+*   [justify-content](
+    https://www.w3.org/TR/css-flexbox-1/#propdef-justify-content)
 *   [line-height](https://www.w3.org/TR/CSS2/visudet.html#propdef-line-height)
 *   [margin](https://www.w3.org/TR/CSS21/box.html#margin-properties),
     [margin-top](https://www.w3.org/TR/CSS21/box.html#margin-properties),
@@ -58,6 +76,7 @@
     [max-width](https://www.w3.org/TR/CSS2/visudet.html#min-max-widths)
 *   [@media](https://www.w3.org/TR/css3-mediaqueries/)
 *   [opacity](https://www.w3.org/TR/css3-color/#transparency)
+*   [order](https://www.w3.org/TR/css-flexbox-1/#order-property)
 *   [overflow](https://www.w3.org/TR/CSS2/visufx.html#overflow)
 *   [padding](https://www.w3.org/TR/CSS21/box.html#padding-properties),
     [padding-top](https://www.w3.org/TR/CSS21/box.html#padding-properties),
@@ -123,17 +142,28 @@
 *   [CSSOM View](https://www.w3.org/TR/cssom-view-1/)
     (no scrolling, moving, resizing)
 *   `Console.log`
+*   [CORS](https://www.w3.org/TR/2020/SPSD-cors-20200602/)
 *   [DOM4](http://www.w3.org/TR/dom/) (partial)
 *   [EncryptedMedia Extensions v0.1b](
     https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1b/encrypted-media/encrypted-media.html) (unprefixed)
+*   [Fetch](
+    https://www.w3.org/TR/cors/) (supports text(), JSON(), arrayBuffer(), types)
 *   `Image` (for preloading and caching only)
+*   [Intersection Observer](https://www.w3.org/TR/intersection-observer/)
+*   [Media Session](https://www.w3.org/TR/mediasession/)
 *   [Media Source Extensions, Editor's Draft 09 August 2012](
     https://rawgit.com/w3c/media-source/6747ed7a3206f646963d760100b0f37e2fc7e47e/media-source.html)
+*   [Streams API](https://www.w3.org/TR/streams-api/)
+*   [SubtleCrypto](https://www.w3.org/TR/WebCryptoAPI/#subtlecrypto-interface)
 *   [Typed Arrays](
     https://www.khronos.org/registry/typedarray/specs/latest/) (partial)
 *   [URL](https://url.spec.whatwg.org/#api) (partial)
 *   [Web Audio API](https://www.w3.org/TR/webaudio/) (partial)
 *   [Web Storage API](https://www.w3.org/TR/webstorage/)
+*   [WebIDL Level 2](http://dev.w3.org/2006/webapi/WebIDL/)
+*   [WebSocket API](https://www.w3.org/TR/websockets/)
+*   [`window.atob()` and `window.btoa()`](
+    https://html.spec.whatwg.org/multipage/webappapis.html#dom-windowbase64-btoa)
 *   [XMLHttpRequest Level 1](http://www.w3.org/TR/XMLHttpRequest/)
 
 ## Protocols
@@ -142,6 +172,8 @@
 *   h5vcc-embedded: (for embedded resources)
 *   [Content Security Policy Level 2](https://www.w3.org/TR/CSP2/)
     in HTTP headers is _required_, and report-only is disabled.
+*   QUIC
+*   SPDY
 
 ## Media formats
 
@@ -154,12 +186,16 @@
 
 ### Encodings (depending on platform support)
 
+*   16-bit stereo PCM audio (for sound effects)
 *   AAC
+*   AV1
 *   AVC (H.264) at 1080p/60fps ([Level
     4.2](https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Levels))
+*   Dolby Digital (AC-3)
+*   Dolby Digital Plus (Enhanced AC-3, or EAC-3)
+*   HEVC (H.265)
 *   VP8/Vorbis
 *   VP9/Opus
-*   16-bit stereo PCM audio (for sound effects)
 
 ### Images
 
diff --git a/src/cobalt/site/docs/reference/starboard/configuration-public.md b/src/cobalt/site/docs/reference/starboard/configuration-public.md
index 69a46d3..91ec75d 100644
--- a/src/cobalt/site/docs/reference/starboard/configuration-public.md
+++ b/src/cobalt/site/docs/reference/starboard/configuration-public.md
@@ -7,10 +7,8 @@
 
 | Properties |
 | :--- |
-| **`SB_HAS_CROSS_CORE_SCHEDULER`**<br><br>Whether the current platform's thread scheduler will automatically balance threads between cores, as opposed to systems where threads will only ever run on the specifically pinned core.<br><br>The default value in the Stub implementation is `1` |
 | **`SB_HAS_QUIRK_DOES_NOT_STACK_ALIGN_OVER_16_BYTES`**<br><br>Some platforms will not align variables on the stack with an alignment greater than 16 bytes. Platforms where this is the case should define the following quirk.<br><br>By default, this property is undefined. |
 | **`SB_HAS_QUIRK_THREAD_AFFINITY_UNSUPPORTED`**<br><br>Some platforms do not have thread affinity support. Platforms where this is the case should define the following quirk.<br><br>By default, this property is undefined. |
-| **`SB_HAS_QUIRK_GL_MAP_BUFFER_MEMORY_IS_SLOW_TO_READ`**<br><br>Some platforms the mapped GL buffer memory is slow to read from.  Platforms where this is the case should define the following quirk.<br><br>By default, this property is undefined. |
 
 
 ## Compiler Configuration
@@ -22,17 +20,6 @@
 | **`SB_C_NOINLINE`**<br><br>The platform's annotation for marking a C function as forcibly not inlined.<br><br>The default value in the Stub implementation is `__attribute__((noinline))` |
 | **`SB_EXPORT_PLATFORM`**<br><br>The platform's annotation for marking a symbol as exported outside of the current shared library.<br><br>The default value in the Stub implementation is <br>`__attribute__((visibility("default")))` |
 | **`SB_IMPORT_PLATFORM`**<br><br>The platform's annotation for marking a symbol as imported from outside of the current linking unit. |
-| **`SB_HAS_QUIRK_COMPILER_SAYS_GNUC_BUT_ISNT`**<br><br>On some platforms the &#95;&#95;GNUC&#95;&#95; is defined even though parts of the functionality are missing. Setting this to non-zero allows disabling missing functionality encountered.<br><br>By default, this property is undefined. |
-| **`SB_HAS_QUIRK_HASFEATURE_NOT_DEFINED_BUT_IT_IS`**<br><br>On some compilers, the frontend has a quirk such that #ifdef cannot correctly detect &#95;&#95;has_feature is defined, and an example error you get is:<br><br>By default, this property is undefined. |
-
-
-## Decoder-only Params
-
-| Properties |
-| :--- |
-| **`SB_MEDIA_VIDEO_FRAME_ALIGNMENT`**<br><br>Specifies how video frame buffers must be aligned on this platform.<br><br>The default value in the Stub implementation is `256U` |
-| **`SB_MEDIA_MAXIMUM_VIDEO_PREROLL_FRAMES`**<br><br>The encoded video frames are compressed in different ways, so their decoding time can vary a lot.  Occasionally a single frame can take longer time to decode than the average time per frame.  The player has to cache some frames to account for such inconsistency.  The number of frames being cached are controlled by SB_MEDIA_MAXIMUM_VIDEO_PREROLL_FRAMES and SB_MEDIA_MAXIMUM_VIDEO_FRAMES.  Specify the number of video frames to be cached before the playback starts. Note that setting this value too large may increase the playback start delay.<br><br>The default value in the Stub implementation is `4` |
-| **`SB_MEDIA_MAXIMUM_VIDEO_FRAMES`**<br><br>Specify the number of video frames to be cached during playback.  A large value leads to more stable fps but also causes the app to use more memory.<br><br>The default value in the Stub implementation is `12` |
 
 
 ## Extensions Configuration
@@ -48,22 +35,12 @@
 | **`SB_HASH_MAP_INCLUDE`**<br><br>The location to include hash_map on this platform.<br><br>The default value in the Stub implementation is `<ext/hash_map>` |
 | **`SB_HASH_NAMESPACE`**<br><br>C++'s hash_map and hash_set are often found in different namespaces depending on the compiler.<br><br>The default value in the Stub implementation is `__gnu_cxx` |
 | **`SB_HASH_SET_INCLUDE`**<br><br>The location to include hash_set on this platform.<br><br>The default value in the Stub implementation is `<ext/hash_set>` |
-| **`SB_VA_COPY(dest, source)`**<br><br>Define this to how this platform copies varargs blocks.<br><br>The default value in the Stub implementation is `va_copy(dest, source)` |
 
 
 ## Filesystem Configuration
 
 | Properties |
 | :--- |
-| **`SB_FILE_MAX_NAME`**<br><br>The current platform's maximum length of the name of a single directory entry, not including the absolute path.<br><br>The default value in the Stub implementation is `64` |
-| **`SB_FILE_MAX_PATH`**<br><br>The current platform's maximum length of an absolute path.<br><br>The default value in the Stub implementation is `4096` |
-| **`SB_FILE_MAX_OPEN`**<br><br>The current platform's maximum number of files that can be opened at the same time by one process.<br><br>The default value in the Stub implementation is `64` |
-| **`SB_FILE_SEP_CHAR`**<br><br>The current platform's file path component separator character. This is the character that appears after a directory in a file path. For example, the absolute canonical path of the file "/path/to/a/file.txt" uses '/' as a path component separator character.<br><br>The default value in the Stub implementation is `'/'` |
-| **`SB_FILE_ALT_SEP_CHAR`**<br><br>The current platform's alternate file path component separator character. This is like SB_FILE_SEP_CHAR, except if your platform supports an alternate character, then you can place that here. For example, on windows machines, the primary separator character is probably '\', but the alternate is '/'.<br><br>The default value in the Stub implementation is `'/'` |
-| **`SB_PATH_SEP_CHAR`**<br><br>The current platform's search path component separator character. When specifying an ordered list of absolute paths of directories to search for a given reason, this is the character that appears between entries. For example, the search path of "/etc/search/first:/etc/search/second" uses ':' as a search path component separator character.<br><br>The default value in the Stub implementation is `':'` |
-| **`SB_FILE_SEP_STRING`**<br><br>The string form of SB_FILE_SEP_CHAR.<br><br>The default value in the Stub implementation is `"/"` |
-| **`SB_FILE_ALT_SEP_STRING`**<br><br>The string form of SB_FILE_ALT_SEP_CHAR.<br><br>The default value in the Stub implementation is `"/"` |
-| **`SB_PATH_SEP_STRING`**<br><br>The string form of SB_PATH_SEP_CHAR.<br><br>The default value in the Stub implementation is `":"` |
 | **`SB_HAS_QUIRK_FILESYSTEM_ZERO_FILEINFO_TIME`**<br><br>Some operating systems constantly return zero values for creation, access and modification time for files and directories. When this quirk is defined, we need to ignore corresponded time values in applications as well as take this fact into account in unit tests.<br><br>By default, this property is undefined. |
 | **`SB_HAS_QUIRK_FILESYSTEM_COARSE_ACCESS_TIME`**<br><br>On some platforms the file system stores access times at a coarser granularity than other times. When this quirk is defined, we assume the access time is of 1 day precision.<br><br>By default, this property is undefined. |
 | **`SB_HAS_QUIRK_HASH_FILE_NAME`**<br><br>On some platforms the file system cannot access extremely long file names. We do not need this feature on stub.<br><br>By default, this property is undefined. |
@@ -73,83 +50,65 @@
 
 | Properties |
 | :--- |
-| **`SB_PREFERRED_RGBA_BYTE_ORDER`**<br><br>Specifies the preferred byte order of color channels in a pixel. Refer to starboard/configuration.h for the possible values. EGL/GLES platforms should generally prefer a byte order of RGBA, regardless of endianness.<br><br>The default value in the Stub implementation is <br>`SB_PREFERRED_RGBA_BYTE_ORDER_RGBA` |
+| **`SB_HAS_BLITTER`**<br><br>Specifies whether this platform supports a performant accelerated blitter API. The basic requirement is a scaled, clipped, alpha-blended blit.<br><br>The default value in the Stub implementation is `0` |
 | **`SB_HAS_BILINEAR_FILTERING_SUPPORT`**<br><br>Indicates whether or not the given platform supports bilinear filtering. This can be checked to enable/disable renderer tests that verify that this is working properly.<br><br>The default value in the Stub implementation is `1` |
 | **`SB_HAS_NV12_TEXTURE_SUPPORT`**<br><br>Indicates whether or not the given platform supports rendering of NV12 textures. These textures typically originate from video decoders.<br><br>The default value in the Stub implementation is `0` |
-| **`SB_MUST_FREQUENTLY_FLIP_DISPLAY_BUFFER`**<br><br>Whether the current platform should frequently flip its display buffer.  If this is not required (i.e. SB_MUST_FREQUENTLY_FLIP_DISPLAY_BUFFER is set to 0), then optimizations are enabled so the display buffer is not flipped if the scene hasn't changed.<br><br>The default value in the Stub implementation is `0` |
 | **`SB_HAS_VIRTUAL_REALITY`**<br><br>The default value in the Stub implementation is `1` |
 
 
+## I/O Configuration
+
+| Properties |
+| :--- |
+| **`SB_HAS_ON_SCREEN_KEYBOARD`**<br><br>Whether the current platform implements the on screen keyboard interface.<br><br>The default value in the Stub implementation is `0` |
+| **`SB_HAS_SPEECH_RECOGNIZER`**<br><br>Whether the current platform has speech recognizer.<br><br>The default value in the Stub implementation is `1` |
+| **`SB_HAS_SPEECH_SYNTHESIS`**<br><br>Whether the current platform has speech synthesis.<br><br>The default value in the Stub implementation is `1` |
+
+
 ## Media Configuration
 
 | Properties |
 | :--- |
-| **`SB_HAS_PLAYER_WITH_URL`**<br><br>Whether the current platform uses a media player that relies on a URL.<br><br>The default value in the Stub implementation is `0` |
 | **`SB_HAS_QUIRK_SEEK_TO_KEYFRAME`**<br><br>After a seek is triggerred, the default behavior is to append video frames from the last key frame before the seek time and append audio frames from the seek time because usually all audio frames are key frames.  On platforms that cannot decode video frames without displaying them, this will cause the video being played without audio for several seconds after seeking.  When the following macro is defined, the app will append audio frames start from the timestamp that is before the timestamp of the video key frame being appended.<br><br>By default, this property is undefined. |
 | **`SB_HAS_QUIRK_SUPPORT_INT16_AUDIO_SAMPLES`**<br><br>The implementation is allowed to support kSbMediaAudioSampleTypeInt16 only when this macro is defined.<br><br>By default, this property is undefined. |
 | **`SB_HAS_QUIRK_NO_FFS`**<br><br>dlmalloc will use the ffs intrinsic if available.  Platforms on which this is not available should define the following quirk.<br><br>By default, this property is undefined. |
-| **`SB_MEDIA_MAX_AUDIO_BITRATE_IN_BITS_PER_SECOND`**<br><br>The maximum audio bitrate the platform can decode.  The following value equals to 5M bytes per seconds which is more than enough for compressed audio.<br><br>The default value in the Stub implementation is `(40 * 1024 * 1024)` |
-| **`SB_MEDIA_MAX_VIDEO_BITRATE_IN_BITS_PER_SECOND`**<br><br>The maximum video bitrate the platform can decode.  The following value equals to 25M bytes per seconds which is more than enough for compressed video.<br><br>The default value in the Stub implementation is `(200 * 1024 * 1024)` |
-| **`SB_HAS_MEDIA_WEBM_VP9_SUPPORT`**<br><br>Specifies whether this platform has webm/vp9 support.  This should be set to non-zero on platforms with webm/vp9 support.<br><br>The default value in the Stub implementation is `0` |
-| **`SB_HAS_ASYNC_AUDIO_FRAMES_REPORTING`**<br><br>Specifies whether this platform updates audio frames asynchronously.  In such case an extra parameter will be added to |SbAudioSinkConsumeFramesFunc| to indicate the absolute time that the consumed audio frames are reported. Check document for |SbAudioSinkConsumeFramesFunc| in audio_sink.h for more details.<br><br>The default value in the Stub implementation is `0` |
-| **`SB_MEDIA_THREAD_STACK_SIZE`**<br><br>Specifies the stack size for threads created inside media stack.  Set to 0 to use the default thread stack size.  Set to non-zero to explicitly set the stack size for media stack threads.<br><br>The default value in the Stub implementation is `0U` |
 
 
 ## Memory Configuration
 
 | Properties |
 | :--- |
-| **`SB_MEMORY_PAGE_SIZE`**<br><br>The memory page size, which controls the size of chunks on memory that allocators deal with, and the alignment of those chunks. This doesn't have to be the hardware-defined physical page size, but it should be a multiple of it.<br><br>The default value in the Stub implementation is `4096` |
-| **`SB_CAN_MAP_EXECUTABLE_MEMORY`**<br><br>Whether this platform can map executable memory. Implies this system can map memory. This is required for platforms that want to JIT.<br><br>The default value in the Stub implementation is `1` |
-| **`SB_MALLOC_ALIGNMENT`**<br><br>Determines the alignment that allocations should have on this platform.<br><br>The default value in the Stub implementation is `((size_t)16U)` |
-| **`SB_DEFAULT_MMAP_THRESHOLD`**<br><br>Determines the threshhold of allocation size that should be done with mmap (if available), rather than allocated within the core heap.<br><br>The default value in the Stub implementation is `((size_t)(256 * 1024U))` |
-| **`SB_MEMORY_LOG_PATH`**<br><br>Defines the path where memory debugging logs should be written to.<br><br>The default value in the Stub implementation is `"/tmp/starboard"` |
+| **`SB_HAS_MMAP`**<br><br>Whether this platform has and should use an MMAP function to map physical memory to the virtual address space.<br><br>The default value in the Stub implementation is `1` |
+| **`SB_CAN_MAP_EXECUTABLE_MEMORY`**<br><br>Whether this platform can map executable memory. Implies SB_HAS_MMAP. This is required for platforms that want to JIT.<br><br>The default value in the Stub implementation is `1` |
 
 
 ## Network Configuration
 
 | Properties |
 | :--- |
+| **`SB_HAS_IPV6`**<br><br>Specifies whether this platform supports IPV6.<br><br>The default value in the Stub implementation is `1` |
 | **`SB_HAS_PIPE`**<br><br>Specifies whether this platform supports pipe.<br><br>The default value in the Stub implementation is `1` |
 
 
 ## System Header Configuration
 
- Standard C headers are expected to be available. System headers listed below that are not provided by the platfom will be emulated in starboard/types.h.
+ Any system headers listed here that are not provided by the platform will be emulated in starboard/types.h.
 
 | Properties |
 | :--- |
-| **`SB_HAS_SYS_TYPES_H`**<br><br>Whether the current platform provides the standard header sys/types.h.<br><br>The default value in the Stub implementation is `0` |
+| **`SB_HAS_SYS_TYPES_H`**<br><br> Whether the current platform provides the standard header sys/types.h.<br><br>The default value in the Stub implementation is `0` |
 | **`SB_HAS_SSIZE_T`**<br><br>Whether the current platform provides ssize_t.<br><br>The default value in the Stub implementation is `1` |
 | **`SB_IS_WCHAR_T_UTF32`**<br><br>Type detection for wchar_t.<br><br>The default value in the Stub implementation is `1` |
 | **`SB_IS_WCHAR_T_UTF16`**<br><br>The default value in the Stub implementation is `1` |
-| **`SB_IS_WCHAR_T_UNSIGNED`**<br><br>Chrome only defines these two if ARMEL or MIPSEL are defined. Chrome has an exclusion for iOS here, we should too when we support iOS.<br><br>The default value in the Stub implementation is `1` |
-| **`SB_IS_WCHAR_T_SIGNED`**<br><br>The default value in the Stub implementation is `1` |
-| **`SB_HAS_QUIRK_MEMSET_IN_SYSTEM_HEADERS`**<br><br>Some platforms have memset predefined in system headers. Platforms where this is the case should define the following quirk.<br><br>By default, this property is undefined. |
+| **`SB_IS_WCHAR_T_UNSIGNED`**<br><br>Chrome only defines this for ARMEL. Chrome has an exclusion for iOS here, we should too when we support iOS.<br><br>The default value in the Stub implementation is `1` |
 | **`SB_HAS_QUIRK_SOCKET_BSD_HEADERS`**<br><br>This quirk is used to switch the headers included in starboard/shared/linux/socket_get_interface_address.cc for darwin system headers. It may be removed at some point in favor of a different solution.<br><br>By default, this property is undefined. |
+| **`SB_HAS_QUIRK_NO_GMTIME_R`**<br><br>Some platforms don't support gmtime_r. Platforms where this is the case should define the following quirk.<br><br>By default, this property is undefined. |
 
 
-## Thread Configuration
+## Timing API
 
 | Properties |
 | :--- |
-| **`SB_HAS_THREAD_PRIORITY_SUPPORT`**<br><br>Whether the current platform supports thread priorities.<br><br>The default value in the Stub implementation is `0` |
-| **`SB_MAX_THREADS`**<br><br>Defines the maximum number of simultaneous threads for this platform. Some platforms require sharing thread handles with other kinds of system handles, like mutexes, so we want to keep this managable.<br><br>The default value in the Stub implementation is `90` |
-| **`SB_MAX_THREAD_LOCAL_KEYS`**<br><br>The maximum number of thread local storage keys supported by this platform.<br><br>The default value in the Stub implementation is `512` |
-| **`SB_MAX_THREAD_NAME_LENGTH`**<br><br>The maximum length of the name for a thread, including the NULL-terminator.<br><br>The default value in the Stub implementation is `16` |
-
-
-## Tuneable Parameters
-
-| Properties |
-| :--- |
-| **`SB_NETWORK_RECEIVE_BUFFER_SIZE`**<br><br>Specifies the network receive buffer size in bytes, set via SbSocketSetReceiveBufferSize().  Setting this to 0 indicates that SbSocketSetReceiveBufferSize() should not be called. Use this for OSs (such as Linux) where receive buffer auto-tuning is better.  On some platforms, this may affect max TCP window size which may dramatically affect throughput in the presence of latency.  If your platform does not have a good TCP auto-tuning mechanism, a setting of (128 * 1024) here is recommended.<br><br>The default value in the Stub implementation is `(0)` |
-
-
-## User Configuration
-
-| Properties |
-| :--- |
-| **`SB_USER_MAX_SIGNED_IN`**<br><br>The maximum number of users that can be signed in at the same time.<br><br>The default value in the Stub implementation is `1` |
+| **`SB_HAS_TIME_THREAD_NOW`**<br><br>Whether this platform has an API to retrieve how long the current thread has spent in the executing state.<br><br>The default value in the Stub implementation is `1` |
 
 
diff --git a/src/cobalt/site/docs/reference/starboard/gyp-configuration.md b/src/cobalt/site/docs/reference/starboard/gyp-configuration.md
index 1ff9b5a..dafe5e9 100644
--- a/src/cobalt/site/docs/reference/starboard/gyp-configuration.md
+++ b/src/cobalt/site/docs/reference/starboard/gyp-configuration.md
@@ -8,7 +8,9 @@
 | **`abort_on_allocation_failure`**<br><br> Halt execution on failure to allocate memory.<br><br>The default value is `1`. |
 | **`cobalt`**<br><br> Whether Cobalt is being built.<br><br>The default value is `1`. |
 | **`cobalt_config`**<br><br> Contains the current build configuration.<br><br>The default value is `'gold'`. |
-| **`cobalt_egl_swap_interval`**<br><br> Deprecated. Implement the CobaltExtensionConfigurationApi function CobaltEglSwapInterval instead.<br><br> Cobalt will call eglSwapInterval() and specify this value before calling eglSwapBuffers() each frame.<br><br>The default value is `1`. |
+| **`cobalt_egl_swap_interval`**<br><br> Deprecated. Implement the CobaltExtensionConfigurationApi function CobaltEglSwapInterval instead. Cobalt will call eglSwapInterval() and specify this value before calling eglSwapBuffers() each frame.<br><br>The default value is `-1`. |
+| **`cobalt_enable_jit`**<br><br> Deprecated. Implement the CobaltExtensionConfigurationApi function CobaltEnableJit instead.<br><br>The default value is `-1`. |
+| **`cobalt_enable_quic`**<br><br> Deprecated. Implement the CobaltExtensionConfigurationApi function CobaltEnableQuic instead.<br><br>The default value is `-1`. |
 | **`cobalt_fastbuild`**<br><br> Contains the current build configuration.<br><br>The default value is `0`. |
 | **`cobalt_font_package`**<br><br> Contains the current font package selection.  This can be used to trade font quality, coverage, and latency for different font package sizes. The font package can be one of the following options:<ul><li><code>standard</code> - The default package. It includes all sans-serif, serif, and FCC fonts, non-CJK fallback fonts in both 'normal' and 'bold' weights, 'normal' weight CJK ('bold' weight CJK is synthesized from it), historic script fonts, and color emojis. This package is ~38.3MB.<li><code>limited</code> - A significantly smaller package than 'standard'. This package removes all but 'normal' and 'bold' weighted sans-serif and serif, removes the FCC fonts (which must be provided by the system or downloaded from the web), replaces standard CJK with low quality CJK, removes historic script fonts, and replaces colored emojis with uncolored ones. Because low quality CJK cannot synthesize bold, bold glyphs are unavailable in Chinese, Japanese and Korean. This package is ~8.3MB.<li><code>minimal</code> - The smallest possible font package. It only includes Roboto's Basic Latin characters. Everything else must be provided by the system or downloaded from the web. This package is ~40.0KB.</li></ul> NOTE: When bold is needed, but unavailable, it is typically synthesized, resulting in lower quality glyphs than those generated directly from a bold font. However, this does not occur with low quality CJK, which is not high enough quality to synthesize. Its glyphs always have a 'normal' weight.<br><br>The default value is `'standard'`. |
 | **`cobalt_font_package_override_fallback_color_emoji`**<br><br> Font package overrides can be used to modify the files included within the selected package. The following values are available: -1 -- The package value for the specified category is not overridden. 0 -- The package value is overridden and no fonts for the specified category are included. 1 -- The package value is overridden and fonts from the specified category with a weight of 'normal' and a style of 'normal' are included. 2 -- The package value is overridden and fonts from the specified category with a weight of either 'normal' or bold' and a style of 'normal' are included. 3 -- The package value is overridden and fonts from the specified category with a weight of either 'normal' or 'bold' and a style of either 'normal' or 'italic' are included. 4 -- The package value is overridden and all available fonts from the specified category are included. This may include additional weights beyond 'normal' and 'bold'. See content/fonts/README.md for details on the specific values used by each of the packages use for the various font categories.<br><br>The default value is `-1`. |
@@ -21,76 +23,84 @@
 | **`cobalt_font_package_override_named_fcc_fonts`**<br><br> Font package overrides can be used to modify the files included within the selected package. The following values are available: -1 -- The package value for the specified category is not overridden. 0 -- The package value is overridden and no fonts for the specified category are included. 1 -- The package value is overridden and fonts from the specified category with a weight of 'normal' and a style of 'normal' are included. 2 -- The package value is overridden and fonts from the specified category with a weight of either 'normal' or bold' and a style of 'normal' are included. 3 -- The package value is overridden and fonts from the specified category with a weight of either 'normal' or 'bold' and a style of either 'normal' or 'italic' are included. 4 -- The package value is overridden and all available fonts from the specified category are included. This may include additional weights beyond 'normal' and 'bold'. See content/fonts/README.md for details on the specific values used by each of the packages use for the various font categories.<br><br>The default value is `-1`. |
 | **`cobalt_font_package_override_named_sans_serif`**<br><br> Font package overrides can be used to modify the files included within the selected package. The following values are available: -1 -- The package value for the specified category is not overridden. 0 -- The package value is overridden and no fonts for the specified category are included. 1 -- The package value is overridden and fonts from the specified category with a weight of 'normal' and a style of 'normal' are included. 2 -- The package value is overridden and fonts from the specified category with a weight of either 'normal' or bold' and a style of 'normal' are included. 3 -- The package value is overridden and fonts from the specified category with a weight of either 'normal' or 'bold' and a style of either 'normal' or 'italic' are included. 4 -- The package value is overridden and all available fonts from the specified category are included. This may include additional weights beyond 'normal' and 'bold'. See content/fonts/README.md for details on the specific values used by each of the packages use for the various font categories.<br><br>The default value is `-1`. |
 | **`cobalt_font_package_override_named_serif`**<br><br> Font package overrides can be used to modify the files included within the selected package. The following values are available: -1 -- The package value for the specified category is not overridden. 0 -- The package value is overridden and no fonts for the specified category are included. 1 -- The package value is overridden and fonts from the specified category with a weight of 'normal' and a style of 'normal' are included. 2 -- The package value is overridden and fonts from the specified category with a weight of either 'normal' or bold' and a style of 'normal' are included. 3 -- The package value is overridden and fonts from the specified category with a weight of either 'normal' or 'bold' and a style of either 'normal' or 'italic' are included. 4 -- The package value is overridden and all available fonts from the specified category are included. This may include additional weights beyond 'normal' and 'bold'. See content/fonts/README.md for details on the specific values used by each of the packages use for the various font categories.<br><br>The default value is `-1`. |
-| **`cobalt_gc_zeal`**<br><br> Deprecated. Implement the CobaltExtensionConfigurationApi function CobaltGcZeal instead.<br><br> Can be set to enable zealous garbage collection, if |javascript_engine| supports it.  Zealous garbage collection will cause garbage collection to occur much more frequently than normal, for the purpose of finding or reproducing bugs.<br><br>The default value is `0`. |
-| **`cobalt_media_buffer_alignment`**<br><br> The media buffer will be allocated using the following alignment.  Set this to a larger value may increase the memory consumption of media buffers.<br><br>The default value is `1`. |
-| **`cobalt_media_buffer_allocation_unit`**<br><br> When the media stack needs more memory to store media buffers, it will allocate extra memory in units of |cobalt_media_buffer_allocation_unit|. This can be set to 0, in which case the media stack will allocate extra memory on demand.  When |cobalt_media_buffer_initial_capacity| and this value are both set to 0, the media stack will allocate individual buffers directly using SbMemory functions.<br><br>The default value is `1 * 1024 * 1024`. |
-| **`cobalt_media_buffer_initial_capacity`**<br><br> The amount of memory that will be used to store media buffers allocated during system startup.  To allocate a large chunk at startup helps with reducing fragmentation and can avoid failures to allocate incrementally. This can be set to 0.<br><br>The default value is `21 * 1024 * 1024`. |
-| **`cobalt_media_buffer_max_capacity_1080p`**<br><br> The maximum amount of memory that will be used to store media buffers when video resolution is no larger than 1080p. This must be larger than sum of 1080p video budget and non-video budget.<br><br>The default value is `36 * 1024 * 1024`. |
-| **`cobalt_media_buffer_max_capacity_4k`**<br><br> The maximum amount of memory that will be used to store media buffers when video resolution is 4k. If 0, then memory can grow without bound. This must be larger than sum of 4k video budget and non-video budget.<br><br>The default value is `100 * 1024 * 1024`. |
-| **`cobalt_media_buffer_non_video_budget`**<br><br> Specifies the maximum amount of memory used by audio or text buffers of media source before triggering a garbage collection.  A large value will cause more memory being used by audio buffers but will also make JavaScript app less likely to re-download audio data.  Note that the JavaScript app may experience significant difficulty if this value is too low.<br><br>The default value is `5 * 1024 * 1024`. |
-| **`cobalt_media_buffer_padding`**<br><br> Extra bytes allocated at the end of a media buffer to ensure that the buffer can be use optimally by specific instructions like SIMD.  Set to 0 to remove any padding.<br><br>The default value is `0`. |
-| **`cobalt_media_buffer_pool_allocate_on_demand`**<br><br> When either |cobalt_media_buffer_initial_capacity| or |cobalt_media_buffer_allocation_unit| isn't zero, media buffers will be allocated using a memory pool.  Set the following variable to 1 to allocate the media buffer pool memory on demand and return all memory to the system when there is no media buffer allocated.  Setting the following value to 0 results in that Cobalt will allocate |cobalt_media_buffer_initial_capacity| bytes for media buffer on startup and will not release any media buffer memory back to the system even if there is no media buffers allocated.<br><br>The default value is `1`. |
-| **`cobalt_media_buffer_progressive_budget`**<br><br> The memory used when playing mp4 videos that is not in DASH format.  The resolution of such videos shouldn't go beyond 1080p.  Its value should be less than the sum of 'cobalt_media_buffer_non_video_budget' and 'cobalt_media_buffer_video_budget_1080p' but not less than 8 MB.<br><br>The default value is `12 * 1024 * 1024`. |
-| **`cobalt_media_buffer_storage_type`**<br><br> This can be set to "memory" or "file".  When it is set to "memory", the media buffers will be stored in main memory allocated by SbMemory functions.  When it is set to "file", the media buffers will be stored in a temporary file in the system cache folder acquired by calling SbSystemGetPath() with "kSbSystemPathCacheDirectory".  Note that when its value is "file" the media stack will still allocate memory to cache the the buffers in use.<br><br>The default value is `'memory'`. |
-| **`cobalt_media_buffer_video_budget_1080p`**<br><br> Specifies the maximum amount of memory used by video buffers of media source before triggering a garbage collection when the video resolution is lower than 1080p (1920x1080).  A large value will cause more memory being used by video buffers but will also make JavaScript app less likely to re-download video data.  Note that the JavaScript app may experience significant difficulty if this value is too low.<br><br>The default value is `16 * 1024 * 1024`. |
-| **`cobalt_media_buffer_video_budget_4k`**<br><br> Specifies the maximum amount of memory used by video buffers of media source before triggering a garbage collection when the video resolution is lower than 4k (3840x2160).  A large value will cause more memory being used by video buffers but will also make JavaScript app less likely to re-download video data.  Note that the JavaScript app may experience significant difficulty if this value is too low.<br><br>The default value is `60 * 1024 * 1024`. |
-| **`cobalt_media_source_garbage_collection_duration_threshold_in_seconds`**<br><br> Specifies the duration threshold of media source garbage collection.  When the accumulated duration in a source buffer exceeds this value, the media source implementation will try to eject existing buffers from the cache. This is usually triggered when the video being played has a simple content and the encoded data is small.  In such case this can limit how much is allocated for the book keeping data of the media buffers and avoid OOM of system heap. This should be set to 170 for most of the platforms.  But it can be further reduced on systems with extremely low memory.<br><br>The default value is `170`. |
-| **`cobalt_minimum_frame_time_in_milliseconds`**<br><br> Allow throttling of the frame rate. This is expressed in terms of milliseconds and can be a floating point number. Keep in mind that swapping frames may take some additional processing time, so it may be better to specify a lower delay. For example, '33' instead of '33.33' for 30 Hz refresh.<br><br>The default value is `'16.0'`. |
+| **`cobalt_gc_zeal`**<br><br> Deprecated. Implement the CobaltExtensionConfigurationApi function CobaltGcZeal instead. Can be set to enable zealous garbage collection, if |javascript_engine| supports it.  Zealous garbage collection will cause garbage collection to occur much more frequently than normal, for the purpose of finding or reproducing bugs.<br><br>The default value is `-1`. |
+| **`cobalt_media_buffer_alignment`**<br><br> The media buffer will be allocated using the following alignment.  Set this to a larger value may increase the memory consumption of media buffers.<br><br>The default value is `-1`. |
+| **`cobalt_media_buffer_allocation_unit`**<br><br> When the media stack needs more memory to store media buffers, it will allocate extra memory in units of |cobalt_media_buffer_allocation_unit|. This can be set to 0, in which case the media stack will allocate extra memory on demand.  When |cobalt_media_buffer_initial_capacity| and this value are both set to 0, the media stack will allocate individual buffers directly using SbMemory functions.<br><br>The default value is `-1`. |
+| **`cobalt_media_buffer_initial_capacity`**<br><br> The amount of memory that will be used to store media buffers allocated during system startup.  To allocate a large chunk at startup helps with reducing fragmentation and can avoid failures to allocate incrementally. This can be set to 0.<br><br>The default value is `-1`. |
+| **`cobalt_media_buffer_max_capacity_1080p`**<br><br> The maximum amount of memory that will be used to store media buffers when video resolution is no larger than 1080p. This must be larger than sum of 1080p video budget and non-video budget.<br><br>The default value is `-1`. |
+| **`cobalt_media_buffer_max_capacity_4k`**<br><br> The maximum amount of memory that will be used to store media buffers when video resolution is 4k. If 0, then memory can grow without bound. This must be larger than sum of 4k video budget and non-video budget.<br><br>The default value is `-1`. |
+| **`cobalt_media_buffer_non_video_budget`**<br><br> Specifies the maximum amount of memory used by audio or text buffers of media source before triggering a garbage collection.  A large value will cause more memory being used by audio buffers but will also make JavaScript app less likely to re-download audio data.  Note that the JavaScript app may experience significant difficulty if this value is too low.<br><br>The default value is `-1`. |
+| **`cobalt_media_buffer_padding`**<br><br> Extra bytes allocated at the end of a media buffer to ensure that the buffer can be use optimally by specific instructions like SIMD.  Set to 0 to remove any padding.<br><br>The default value is `-1`. |
+| **`cobalt_media_buffer_pool_allocate_on_demand`**<br><br> When either |cobalt_media_buffer_initial_capacity| or |cobalt_media_buffer_allocation_unit| isn't zero, media buffers will be allocated using a memory pool.  Set the following variable to 1 to allocate the media buffer pool memory on demand and return all memory to the system when there is no media buffer allocated.  Setting the following value to 0 results in that Cobalt will allocate |cobalt_media_buffer_initial_capacity| bytes for media buffer on startup and will not release any media buffer memory back to the system even if there is no media buffers allocated.<br><br>The default value is `-1`. |
+| **`cobalt_media_buffer_progressive_budget`**<br><br> The memory used when playing mp4 videos that is not in DASH format.  The resolution of such videos shouldn't go beyond 1080p.  Its value should be less than the sum of 'cobalt_media_buffer_non_video_budget' and 'cobalt_media_buffer_video_budget_1080p' but not less than 8 MB.<br><br>The default value is `-1`. |
+| **`cobalt_media_buffer_storage_type`**<br><br> This can be set to "memory" or "file".  When it is set to "memory", the media buffers will be stored in main memory allocated by SbMemory functions.  When it is set to "file", the media buffers will be stored in a temporary file in the system cache folder acquired by calling SbSystemGetPath() with "kSbSystemPathCacheDirectory".  Note that when its value is "file" the media stack will still allocate memory to cache the the buffers in use.<br><br>The default value is `''`. |
+| **`cobalt_media_buffer_video_budget_1080p`**<br><br> Specifies the maximum amount of memory used by video buffers of media source before triggering a garbage collection when the video resolution is lower than 1080p (1920x1080).  A large value will cause more memory being used by video buffers but will also make JavaScript app less likely to re-download video data.  Note that the JavaScript app may experience significant difficulty if this value is too low.<br><br>The default value is `-1`. |
+| **`cobalt_media_buffer_video_budget_4k`**<br><br> Specifies the maximum amount of memory used by video buffers of media source before triggering a garbage collection when the video resolution is lower than 4k (3840x2160).  A large value will cause more memory being used by video buffers but will also make JavaScript app less likely to re-download video data.  Note that the JavaScript app may experience significant difficulty if this value is too low.<br><br>The default value is `-1`. |
+| **`cobalt_media_source_garbage_collection_duration_threshold_in_seconds`**<br><br> Specifies the duration threshold of media source garbage collection.  When the accumulated duration in a source buffer exceeds this value, the media source implementation will try to eject existing buffers from the cache. This is usually triggered when the video being played has a simple content and the encoded data is small.  In such case this can limit how much is allocated for the book keeping data of the media buffers and avoid OOM of system heap. This should be set to 170 for most of the platforms.  But it can be further reduced on systems with extremely low memory.<br><br>The default value is `-1`. |
+| **`cobalt_minimum_frame_time_in_milliseconds`**<br><br> Allow throttling of the frame rate. This is expressed in terms of milliseconds and can be a floating point number. Keep in mind that swapping frames may take some additional processing time, so it may be better to specify a lower delay. For example, '33' instead of '33.33' for 30 Hz refresh. This value is deprecated in favor of the usage of CobaltExtensionGraphicsApi::GetMinimumFrameIntervalInMilliseconds API. The default value has been moved into cobalt/renderer/pipeline.cc.<br><br>The default value is `'-1'`. |
 | **`cobalt_platform_dependencies`**<br><br> List of platform-specific targets that get compiled into cobalt.<br><br>The default value is `[]`. |
 | **`cobalt_splash_screen_file`**<br><br> The path to a splash screen to copy into content/data/web which can be accessed via a file URL starting with "file:///cobalt/browser/splash_screen/". If '', no file is copied.<br><br>The default value is `''`. |
-| **`cobalt_user_on_exit_strategy`**<br><br> Deprecated. Implement the CobaltExtensionConfigurationApi function CobaltUserOnExitStrategy instead.<br><br> This variable defines what Cobalt's preferred strategy should be for handling internally triggered application exit requests (e.g. the user chooses to back out of the application).<ul><li><code>stop</code> - The application should call SbSystemRequestStop() on exit, resulting in a complete shutdown of the application.<li><code>suspend</code> - The application should call SbSystemRequestSuspend() on exit, resulting in the application being "minimized".<li><code>noexit</code> - The application should never allow the user to trigger an exit, this will be managed by the system.<br><br>The default value is `'stop'`. |
+| **`cobalt_user_on_exit_strategy`**<br><br> Deprecated. Implement the CobaltExtensionConfigurationApi function CobaltUserOnExitStrategy instead. This variable defines what Cobalt's preferred strategy should be for handling internally triggered application exit requests (e.g. the user chooses to back out of the application).<ul><li><code>stop</code> - The application should call SbSystemRequestStop() on exit, resulting in a complete shutdown of the application.<li><code>suspend</code> - The application should call SbSystemRequestSuspend() on exit, resulting in the application being "minimized".<li><code>noexit</code> - The application should never allow the user to trigger an exit, this will be managed by the system.<br><br>The default value is `''`. |
 | **`cobalt_v8_buildtime_snapshot`**<br><br> Set to "true" to enable v8 snapshot generation at Cobalt build time.<br><br>The default value is `'<(cobalt_v8_buildtime_snapshot)'`. |
-| **`cobalt_version`**<br><br> Build version number.<br><br>The default value is `0`. |
+| **`cobalt_v8_emit_builtins_as_inline_asm`**<br><br> Some compiler can not compile with raw assembly(.S files) and v8 converts asm to inline assembly for these platforms.<br><br>The default value is `1`. |
+| **`cobalt_v8_enable_embedded_builtins`**<br><br> We need to define some variables inside of an inner 'variables' scope so that they can be referenced by other outer variables here.  Also, it allows for the specification of default values that get referenced by a top level scope.<br><br>The default value is `1`. |
+| **`cobalt_version`**<br><br> Build version number.<br><br>The default value is `'<(BUILD_NUMBER)'`. |
 | **`cobalt_webapi_extension_generated_header_idl_files`**<br><br> We need to define some variables inside of an inner 'variables' scope so that they can be referenced by other outer variables here.  Also, it allows for the specification of default values that get referenced by a top level scope.<br><br>The default value is `[]`. |
 | **`cobalt_webapi_extension_source_idl_files`**<br><br> We need to define some variables inside of an inner 'variables' scope so that they can be referenced by other outer variables here.  Also, it allows for the specification of default values that get referenced by a top level scope.<br><br>The default value is `[]`. |
-| **`compiler_flags_<config>`**<br><br>The following configurations are supported: <ul><li><code>[default]</code></li><li><code>c_debug</code></li><li><code>c_devel</code></li><li><code>c_gold</code></li><li><code>c_host</code></li><li><code>c_qa</code></li><li><code>cc_debug</code></li><li><code>cc_devel</code></li><li><code>cc_gold</code></li><li><code>cc_host</code></li><li><code>cc_qa</code></li><li><code>debug</code></li><li><code>devel</code></li><li><code>gold</code></li><li><code>host</code></li><li><code>qa</ul> |
+| **`compiler_flags_<config>`**<br><br>The following configurations are supported: <ul><li><code>[default]</code></li><li><code>c_debug</code></li><li><code>c_devel</code></li><li><code>c_gold</code></li><li><code>c_gold_size</code></li><li><code>c_gold_speed</code></li><li><code>c_host</code></li><li><code>c_qa</code></li><li><code>c_qa_size</code></li><li><code>c_qa_speed</code></li><li><code>cc_debug</code></li><li><code>cc_devel</code></li><li><code>cc_gold</code></li><li><code>cc_gold_size</code></li><li><code>cc_gold_speed</code></li><li><code>cc_host</code></li><li><code>cc_qa</code></li><li><code>cc_qa_size</code></li><li><code>cc_qa_speed</code></li><li><code>debug</code></li><li><code>devel</code></li><li><code>gold</code></li><li><code>gold_size</code></li><li><code>gold_speed</code></li><li><code>host</code></li><li><code>qa</code></li><li><code>qa_size</code></li><li><code>qa_speed</ul> |
 | **`custom_media_session_client`**<br><br> Set to 1 to enable a custom MediaSessionClient.<br><br>The default value is `0`. |
 | **`default_renderer_options_dependency`**<br><br> Override this value to adjust the default rasterizer setting for your platform.<br><br>The default value is `'<(DEPTH)/cobalt/renderer/default_options_starboard.gyp:default_options'`. |
 | **`defines_debug`**<br><br> and linker_executable_flags_(config) to distinguish the flags for SharedLibraryLinker and ExecutableLinker.<br><br>The default value is `[]`. |
 | **`defines_devel`**<br><br>The default value is `[]`. |
 | **`defines_gold`**<br><br>The default value is `[]`. |
 | **`defines_host`**<br><br>The default value is `[]`. |
-| **`defines_qa`**<br><br>The default value is `[]`. |
+| **`defines_qa`**<br><br> For qa and gold configs, different compiler flags may be specified for gyp targets that should be built for size than for speed. Targets which specify 'optimize_target_for_speed == 1', will compile with flags: ['compiler_flags_*<config>', 'compiler_flags_*<config>_speed']. Otherwise, targets will use compiler flags: ['compiler_flags_*<config>', 'compiler_flags_*<config>_size']. Platforms may decide to use the same optimization flags for both target types by leaving the '*_size' and '*_speed' variables empty.<br><br>The default value is `[]`. |
 | **`enable_account_manager`**<br><br> Set to 1 to enable H5vccAccountManager.<br><br>The default value is `0`. |
 | **`enable_configure_request_job_factory`**<br><br> Set to 1 to enable setting Interceptors on the URLRequestJobFactory<br><br>The default value is `0`. |
 | **`enable_crash_log`**<br><br> Set to 1 to enable H5vccCrashLog.<br><br>The default value is `0`. |
-| **`enable_map_to_mesh`**<br><br> Enable support for the map to mesh filter, which is primarily used to implement spherical video playback.<br><br>The default value is `0`. |
+| **`enable_map_to_mesh`**<br><br> Enable support for the map to mesh filter, which is primarily used to implement spherical video playback. This setting is deprecated in favor of the cobalt graphics extension (CobaltGraphicsExtensionApi) function `IsMapToMeshEnabled()`. If the CobaltGraphicsExtensionApi is not implemented, then Cobalt will fall back onto a default. For starboard API versions 12 and later, the default is true (i.e. Cobalt will assume map to mesh is supported). For earlier starboard API versions, if this gyp variable is redefined to a value other than -1, it will use the new value as the default. If it is not redefined, the default is false.<br><br>The default value is `-1`. |
 | **`enable_sso`**<br><br> Set to 1 to enable H5vccSSO (Single Sign On).<br><br>The default value is `0`. |
 | **`enable_xhr_header_filtering`**<br><br> Set to 1 to enable filtering of HTTP headers before sending.<br><br>The default value is `0`. |
-| **`fallback_splash_screen_url`**<br><br> The URL of default build time splash screen - see cobalt/doc/splash_screen.md for information about this.<br><br>The default value is `'none'`. |
+| **`encoded_image_cache_size_in_bytes`**<br><br> Deprecated. Implement the CobaltExtensionConfigurationApi function CobaltEncodedImageCacheSizeInBytes instead. Determines the capacity of the encoded image cache, which manages encoded images downloaded from a web page. These images are cached within CPU memory.  This not only reduces network traffic to download the encoded images, but also allows the downloaded images to be held during suspend. Note that there is also a cache for the decoded images whose capacity is specified in |image_cache_size_in_bytes|.  The decoded images are often cached in the GPU memory and will be released during suspend.<br><br> If a system meet the following requirements: 1. Has a fast image decoder. 2. Has enough CPU memory, or has a unified memory architecture that allows sharing of CPU and GPU memory. Then it may consider to set |encoded_image_cache_size_in_bytes| to a much bigger value, and set the value of |image_cache_size_in_bytes| to a much smaller value. This allows the app to cache significant more images.<br><br> Set this to 0 can disable the cache completely.<br><br>The default value is `-1`. |
+| **`fallback_splash_screen_url`**<br><br> Deprecated. Implement the CobaltExtensionConfigurationApi function CobaltFallbackSplashScreenUrl instead. The URL of default build time splash screen - see cobalt/doc/splash_screen.md for information about this.<br><br>The default value is `''`. |
 | **`final_executable_type`**<br><br> The variables allow changing the target type on platforms where the native code may require an additional packaging step (ex. Android).<br><br>The default value is `'executable'`. |
-| **`gl_type`**<br><br> The source of EGL and GLES headers and libraries. Valid values (case and everything sensitive!):<ul><li><code>none</code> - No EGL + GLES implementation is available on this platform.<li><code>system_gles3</code> - Deprecated. Use system_gles2 instead.<br><br>Use the system implementation of EGL + GLES3. The headers and libraries must be on the system include and link paths.<li><code>system_gles2</code> - Use the system implementation of EGL + GLES2. The headers and libraries must be on the system include and link paths.<li><code>glimp</code> - Cobalt's own EGL + GLES2 implementation. This requires a valid Glimp implementation for the platform.<li><code>angle</code> - A DirectX-to-OpenGL adaptation layer. This requires a valid ANGLE implementation for the platform.</li></ul> Choosing an unsupported value will result in a GYP error: "cobalt/renderer/egl_and_gles/egl_and_gles_<gl_type>.gyp not found"<br><br>The default value is `'system_gles2'`. |
+| **`gl_type`**<br><br> The source of EGL and GLES headers and libraries. Valid values (case and everything sensitive!):<ul><li><code>none</code> - No EGL + GLES implementation is available on this platform.<li><code>system_gles3</code> - Deprecated. Use system_gles2 instead. Use the system implementation of EGL + GLES3. The headers and libraries must be on the system include and link paths.<li><code>system_gles2</code> - Use the system implementation of EGL + GLES2. The headers and libraries must be on the system include and link paths.<li><code>glimp</code> - Cobalt's own EGL + GLES2 implementation. This requires a valid Glimp implementation for the platform.<li><code>angle</code> - A DirectX-to-OpenGL adaptation layer. This requires a valid ANGLE implementation for the platform.</li></ul> Choosing an unsupported value will result in a GYP error: "cobalt/renderer/egl_and_gles/egl_and_gles_<gl_type>.gyp not found"<br><br>The default value is `'system_gles2'`. |
 | **`gtest_target_type`**<br><br> The variables allow changing the target type on platforms where the native code may require an additional packaging step (ex. Android).<br><br>The default value is `'executable'`. |
 | **`host_os`**<br><br> Contains the name of the hosting OS. The value is defined by the gyp wrapper script.<br><br>The default value is `'win'`. |
-| **`image_cache_capacity_multiplier_when_playing_video`**<br><br> Modifying this value to be non-1.0f will result in the image cache capacity being cleared and then temporarily reduced for the duration that a video is playing.  This can be useful for some platforms if they are particularly constrained for (GPU) memory during video playback.  When playing a video, the image cache is reduced to: image_cache_size_in_bytes * image_cache_capacity_multiplier_when_playing_video.<br><br>The default value is `'1.0f'`. |
-| **`image_cache_size_in_bytes`**<br><br> Determines the capacity of the image cache, which manages image surfaces downloaded from a web page.  While it depends on the platform, often (and ideally) these images are cached within GPU memory. Set to -1 to automatically calculate the value at runtime, based on features like windows dimensions and the value of SbSystemGetTotalGPUMemory().<br><br>The default value is `-1`. |
+| **`image_cache_capacity_multiplier_when_playing_video`**<br><br> Deprecated. Implement the CobaltExtensionConfigurationApi function CobaltImageCacheCapactityMultiplierWhenPlayingVideo. Modifying this value to be non-1.0f will result in the image cache capacity being cleared and then temporarily reduced for the duration that a video is playing.  This can be useful for some platforms if they are particularly constrained for (GPU) memory during video playback.  When playing a video, the image cache is reduced to: image_cache_size_in_bytes * image_cache_capacity_multiplier_when_playing_video.<br><br>The default value is `''`. |
+| **`image_cache_size_in_bytes`**<br><br> Deprecated. Implement the CobaltExtensionConfigurationApi function CobaltImageCacheSizeInBytes instead. Determines the capacity of the image cache, which manages image surfaces downloaded from a web page.  While it depends on the platform, often (and ideally) these images are cached within GPU memory. Set to -1 to automatically calculate the value at runtime, based on features like windows dimensions and the value of SbSystemGetTotalGPUMemory().<br><br>The default value is `-1`. |
 | **`in_app_dial`**<br><br> Set to 1 to build with DIAL support.<br><br>The default value is `0`. |
 | **`linker_flags_<config>`**<br><br>The following configurations are supported: <ul><li><code>[default]</code></li><li><code>debug</code></li><li><code>devel</code></li><li><code>gold</code></li><li><code>host</code></li><li><code>qa</ul> |
-| **`local_font_cache_size_in_bytes`**<br><br> Determines the capacity of the local font cache, which manages all fonts loaded from local files. Newly encountered sections of font files are lazily loaded into the cache, enabling subsequent requests to the same file sections to be handled via direct memory access. Once the limit is reached, further requests are handled via file stream. Setting the value to 0 disables memory caching and causes all font file accesses to be done using file streams.<br><br>The default value is `16 * 1024 * 1024`. |
-| **`max_cobalt_cpu_usage`**<br><br> This setting is deprecated. Implement starboard API function SbSystemGetTotalCPUMemory() instead.<br><br> Max Cobalt CPU usage specifies that the cobalt program should keep it's size below the specified size.<br><br>The default value is `-1`. |
-| **`max_cobalt_gpu_usage`**<br><br> This setting is deprecated. Implement starboard API function SbSystemGetTotalGPUMemory() instead.<br><br> Max Cobalt GPU usage specifies that the cobalt program should keep it's size below the specified size. A value of -1 causes this value to be assumed from the starboard API function: SbSystemGetTotalGPUMemory().<br><br>The default value is `-1`. |
-| **`mesh_cache_size_in_bytes`**<br><br> Determines the capacity of the mesh cache. Each mesh is held compressed in main memory, to be inflated into a GPU buffer when needed for projection. When set to 'auto', will be adjusted according to whether the enable_map_to_mesh is true or not.  If enable_map_to_mesh is false, then the mesh cache size will be set to 0.<br><br>The default value is `'auto'`. |
-| **`mozjs_garbage_collection_threshold_in_bytes`**<br><br> Determines the size of garbage collection threshold. After this many bytes have been allocated, the SpiderMonkey garbage collector will run. Lowering this has been found to reduce performance and decrease JavaScript memory usage. For example, we have measured on at least one platform that performance becomes 7% worse on average in certain cases when adjusting this number from 8MB to 1MB.<br><br>The default value is `8 * 1024 * 1024`. |
-| **`offscreen_target_cache_size_in_bytes`**<br><br> Determines the amount of GPU memory the offscreen target atlases will use. This is specific to the direct-GLES rasterizer and caches any render tree nodes which require skia for rendering. Two atlases will be allocated from this memory or multiple atlases of the frame size if the limit allows. It is recommended that enough memory be reserved for two RGBA atlases about a quarter of the frame size.<br><br>The default value is `-1`. |
+| **`local_font_cache_size_in_bytes`**<br><br> Deprecated. Implement the CobaltExtensionConfigurationApi function CobaltLocalTypeFaceCacheSizeInBytes instead. Determines the capacity of the local font cache, which manages all fonts loaded from local files. Newly encountered sections of font files are lazily loaded into the cache, enabling subsequent requests to the same file sections to be handled via direct memory access. Once the limit is reached, further requests are handled via file stream. Setting the value to 0 disables memory caching and causes all font file accesses to be done using file streams.<br><br>The default value is `-1`. |
+| **`max_cobalt_cpu_usage`**<br><br> Max Cobalt CPU usage specifies that the cobalt program should keep it's size below the specified size. This setting is deprecated. Implement starboard API function SbSystemGetTotalCPUMemory() instead.<br><br>The default value is `-1`. |
+| **`max_cobalt_gpu_usage`**<br><br> Max Cobalt GPU usage specifies that the cobalt program should keep it's size below the specified size. This setting is deprecated. Implement starboard API function SbSystemGetTotalGPUMemory() instead.<br><br>The default value is `-1`. |
+| **`mesh_cache_size_in_bytes`**<br><br> Deprecated. Implement the CobaltExtensionConfigurationApi function CobaltMeshCacheSizeInBytes instead. Determines the capacity of the mesh cache. Each mesh is held compressed in main memory, to be inflated into a GPU buffer when needed for projection. When set to 'auto', will be adjusted according to whether the enable_map_to_mesh is true or not.  If enable_map_to_mesh is false, then the mesh cache size will be set to 0.<br><br>The default value is `-1`. |
+| **`mozjs_garbage_collection_threshold_in_bytes`**<br><br> Deprecated. Implement the CobaltExtensionConfigurationApi function CobaltJsGarbageCollectionThresholdInBytes instead. Determines the size of garbage collection threshold. After this many bytes have been allocated, the SpiderMonkey garbage collector will run. Lowering this has been found to reduce performance and decrease JavaScript memory usage. For example, we have measured on at least one platform that performance becomes 7% worse on average in certain cases when adjusting this number from 8MB to 1MB.<br><br>The default value is `-1`. |
+| **`offscreen_target_cache_size_in_bytes`**<br><br> Deprecated. Implement the CobaltExtensionConfigurationApi function CobaltOffscreenTargetCacheSizeInBytes instead. Determines the amount of GPU memory the offscreen target atlases will use. This is specific to the direct-GLES rasterizer and caches any render tree nodes which require skia for rendering. Two atlases will be allocated from this memory or multiple atlases of the frame size if the limit allows. It is recommended that enough memory be reserved for two RGBA atlases about a quarter of the frame size.<br><br>The default value is `-1`. |
+| **`optimize_target_for_speed`**<br><br> This variable dictates whether a given gyp target should be compiled with optimization flags for size vs. speed.<br><br>The default value is `0`. |
 | **`path_to_yasm`**<br><br> Where yasm can be found on the target device.<br><br>The default value is `"yasm"`. |
 | **`platform_libraries`**<br><br>The default value is `[]`. |
-| **`rasterizer_type`**<br><br> Deprecated. Implement the CobaltExtensionConfigurationApi function CobaltRasterizerType instead.<br><br> Defines what kind of rasterizer will be used.  This can be adjusted to force a stub graphics implementation or software graphics implementation. It can be one of the following options:<ul><li><code>direct-gles</code> - Uses a light wrapper over OpenGL ES to handle most draw elements. This will fall back to the skia hardware rasterizer for some render tree node types, but is generally faster on the CPU and GPU. This can handle 360 rendering.<li><code>hardware</code> - As much hardware acceleration of graphics commands as possible. This uses skia to wrap OpenGL ES commands. Required for 360 rendering.<li><code>software</code> - Perform most rasterization using the CPU and only interact with the GPU to send the final image to the output window.<li><code>stub</code> - Stub graphics rasterization.  A rasterizer object will still be available and valid, but it will do nothing.<br><br>The default value is `'direct-gles'`. |
-| **`reduce_cpu_memory_by`**<br><br> When specified this value will reduce the cpu memory consumption by the specified amount. -1 disables the value. When this value is specified then max_cobalt_cpu_usage will not be used in memory_constrainer, but will still be used for triggering a warning if the engine consumes more memory than this value specifies.<br><br>The default value is `-1`. |
-| **`reduce_gpu_memory_by`**<br><br> When specified this value will reduce the gpu memory consumption by the specified amount. -1 disables the value. When this value is specified then max_cobalt_gpu_usage will not be used in memory_constrainer, but will still be used for triggering a warning if the engine consumes more memory than this value specifies.<br><br>The default value is `-1`. |
-| **`remote_font_cache_size_in_bytes`**<br><br> Determines the capacity of the remote font cache, which manages all fonts downloaded from a web page.<br><br>The default value is `4 * 1024 * 1024`. |
-| **`render_dirty_region_only`**<br><br> Deprecated. Implement the CobaltExtensionConfigurationApi function CobaltRenderDirtyRegionOnly instead.<br><br> If set to 1, will enable support for rendering only the regions of the display that are modified due to animations, instead of re-rendering the entire scene each frame.  This feature can reduce startup time where usually there is a small loading spinner animating on the screen.  On GLES renderers, Cobalt will attempt to implement this support by using eglSurfaceAttrib(..., EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED), otherwise the dirty region will be silently disabled.  On Blitter API platforms, if this is enabled, we explicitly create an extra offscreen full-size intermediate surface to render into.  Note that some GLES driver implementations may internally allocate an extra full screen surface to support this feature, and many have been noticed to not properly support this functionality (but they report that they do), and for these reasons this value is defaulted to 0.<br><br>The default value is `0`. |
+| **`rasterizer_type`**<br><br> Deprecated. Implement the CobaltExtensionConfigurationApi function CobaltRasterizerType instead. Defines what kind of rasterizer will be used.  This can be adjusted to force a stub graphics implementation. It can be one of the following options:<ul><li><code>direct-gles</code> - Uses a light wrapper over OpenGL ES to handle most draw elements. This will fall back to the skia hardware rasterizer for some render tree node types, but is generally faster on the CPU and GPU. This can handle 360 rendering.<li><code>hardware</code> - As much hardware acceleration of graphics commands as possible. This uses skia to wrap OpenGL ES commands. Required for 360 rendering.<li><code>stub</code> - Stub graphics rasterization.  A rasterizer object will still be available and valid, but it will do nothing.<br><br>The default value is `''`. |
+| **`reduce_cpu_memory_by`**<br><br> Deprecated. Implement the CobaltExtensionConfigurationApi function CobaltReduceCpuMemoryBy instead. When specified this value will reduce the cpu memory consumption by the specified amount. -1 disables the value. When this value is specified then max_cobalt_cpu_usage will not be used in memory_constrainer, but will still be used for triggering a warning if the engine consumes more memory than this value specifies.<br><br>The default value is `-1`. |
+| **`reduce_gpu_memory_by`**<br><br> Deprecated. Implement the CobaltExtensionConfigurationApi function CobaltReduceGpuMemoryBy instead. When specified this value will reduce the gpu memory consumption by the specified amount. -1 disables the value. When this value is specified then max_cobalt_gpu_usage will not be used in memory_constrainer, but will still be used for triggering a warning if the engine consumes more memory than this value specifies.<br><br>The default value is `-1`. |
+| **`remote_font_cache_size_in_bytes`**<br><br> Deprecated. Implement the CobaltExtensionConfigurationApi function CobaltRemoteTypefaceCacheSizeInBytes instead. Determines the capacity of the remote font cache, which manages all fonts downloaded from a web page.<br><br>The default value is `-1`. |
+| **`render_dirty_region_only`**<br><br> Deprecated. Implement the CobaltExtensionConfigurationApi function CobaltRenderDirtyRegionOnly instead. If set to 1, will enable support for rendering only the regions of the display that are modified due to animations, instead of re-rendering the entire scene each frame.  This feature can reduce startup time where usually there is a small loading spinner animating on the screen.  On GLES renderers, Cobalt will attempt to implement this support by using eglSurfaceAttrib(..., EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED), otherwise the dirty region will be silently disabled.  On Blitter API platforms, if this is enabled, we explicitly create an extra offscreen full-size intermediate surface to render into.  Note that some GLES driver implementations may internally allocate an extra full screen surface to support this feature, and many have been noticed to not properly support this functionality (but they report that they do), and for these reasons this value is defaulted to 0.<br><br>The default value is `-1`. |
+| **`sb_api_version`**<br><br> The Starboard API version of the current build configuration. The default value is meant to be overridden by a Starboard ABI file.<br><br>The default value is `0`. |
+| **`sb_deploy_output_dir`**<br><br> Top-level directory for staging deploy build output. Platform deploy actions should use <(target_deploy_dir) defined in deploy.gypi to place artifacts for each deploy target in its own subdirectoy.<br><br>The default value is `'<(sb_deploy_output_dir)'`. |
 | **`sb_disable_microphone_idl`**<br><br> When this is set to true, the web bindings for the microphone are disabled<br><br>The default value is `0`. |
+| **`sb_enable_benchmark`**<br><br> Used to enable benchmarks.<br><br>The default value is `0`. |
+| **`sb_enable_lib`**<br><br> Enables embedding Cobalt as a shared library within another app. This requires a 'lib' starboard implementation for the corresponding platform.<br><br>The default value is `'<(sb_enable_lib)'`. |
+| **`sb_evergreen`**<br><br> Whether this is an evergreen build.<br><br>The default value is `0`. |
+| **`sb_evergreen_compatible`**<br><br> Whether this is an evergreen compatible platform. A compatible platform can run the elf_loader and launch the evergreen build.<br><br>The default value is `'<(sb_evergreen_compatible)'`. |
 | **`sb_filter_based_player`**<br><br> Used to indicate that the player is filter based.<br><br>The default value is `1`. |
 | **`sb_libevent_method`**<br><br> The event polling mechanism available on this platform to support libevent. Platforms may redefine to 'poll' if necessary. Other mechanisms, e.g. devpoll, kqueue, select, are not yet supported.<br><br>The default value is `'epoll'`. |
 | **`sb_pedantic_warnings`**<br><br> Enabling this variable enables pedantic levels of warnings for the current toolchain.<br><br>The default value is `0`. |
-| **`sb_static_contents_output_base_dir`**<br><br> Directory path to static contents.<br><br>The default value is `'<(sb_static_contents_output_base_dir)'`. |
 | **`sb_static_contents_output_data_dir`**<br><br> Directory path to static contents' data.<br><br>The default value is `'<(sb_static_contents_output_data_dir)'`. |
 | **`sb_target_platform`**<br><br> The target platform id as a string, like 'linux-x64x11', 'win32', etc..<br><br>The default value is `''`. |
-| **`scratch_surface_cache_size_in_bytes`**<br><br> Determines the capacity of the scratch surface cache.  The scratch surface cache facilitates the reuse of temporary offscreen surfaces within a single frame.  This setting is only relevant when using the hardware-accelerated Skia rasterizer.<br><br>The default value is `0`. |
-| **`skia_cache_size_in_bytes`**<br><br> Determines the capacity of the skia cache.  The Skia cache is maintained within Skia and is used to cache the results of complicated effects such as shadows, so that Skia draw calls that are used repeatedly across frames can be cached into surfaces.  This setting is only relevant when using the hardware-accelerated Skia rasterizer (e.g. as opposed to the Blitter API).<br><br>The default value is `4 * 1024 * 1024`. |
-| **`skia_glyph_atlas_height`**<br><br> Determines the size in pixels of the glyph atlas where rendered glyphs are cached. The resulting memory usage is 2 bytes of GPU memory per pixel. When a value is used that is too small, thrashing may occur that will result in visible stutter. Such thrashing is more likely to occur when CJK language glyphs are rendered and when the size of the glyphs in pixels is larger, such as for higher resolution displays. The negative default values indicates to the engine that these settings should be automatically set.<br><br>The default value is `'-1'`. |
-| **`skia_glyph_atlas_width`**<br><br> Determines the size in pixels of the glyph atlas where rendered glyphs are cached. The resulting memory usage is 2 bytes of GPU memory per pixel. When a value is used that is too small, thrashing may occur that will result in visible stutter. Such thrashing is more likely to occur when CJK language glyphs are rendered and when the size of the glyphs in pixels is larger, such as for higher resolution displays. The negative default values indicates to the engine that these settings should be automatically set.<br><br>The default value is `'-1'`. |
-| **`software_surface_cache_size_in_bytes`**<br><br> Only relevant if you are using the Blitter API. Determines the capacity of the software surface cache, which is used to cache all surfaces that are rendered via a software rasterizer to avoid re-rendering them.<br><br>The default value is `8 * 1024 * 1024`. |
+| **`skia_cache_size_in_bytes`**<br><br> Determines the capacity of the skia cache.  The Skia cache is maintained within Skia and is used to cache the results of complicated effects such as shadows, so that Skia draw calls that are used repeatedly across frames can be cached into surfaces.  This setting is only relevant when using the hardware-accelerated Skia rasterizer (e.g. as opposed to the Blitter API).<br><br>The default value is `-1`. |
+| **`skia_glyph_atlas_height`**<br><br> Deprecated. Implement the CobaltExtensionConfigurationApi functions CobaltSkiaGlyphAtlasWidth and CobaltSkiaGlyphAtlasHeight, respectively. Determines the size in pixels of the glyph atlas where rendered glyphs are cached. The resulting memory usage is 2 bytes of GPU memory per pixel. When a value is used that is too small, thrashing may occur that will result in visible stutter. Such thrashing is more likely to occur when CJK language glyphs are rendered and when the size of the glyphs in pixels is larger, such as for higher resolution displays. The negative default values indicates to the engine that these settings should be automatically set.<br><br>The default value is `'-1'`. |
+| **`skia_glyph_atlas_width`**<br><br> Deprecated. Implement the CobaltExtensionConfigurationApi functions CobaltSkiaGlyphAtlasWidth and CobaltSkiaGlyphAtlasHeight, respectively. Determines the size in pixels of the glyph atlas where rendered glyphs are cached. The resulting memory usage is 2 bytes of GPU memory per pixel. When a value is used that is too small, thrashing may occur that will result in visible stutter. Such thrashing is more likely to occur when CJK language glyphs are rendered and when the size of the glyphs in pixels is larger, such as for higher resolution displays. The negative default values indicates to the engine that these settings should be automatically set.<br><br>The default value is `'-1'`. |
+| **`software_surface_cache_size_in_bytes`**<br><br> Deprecated. Implement the CobaltExtensionConfigurationApi function CobaltSoftwareSurfaceCacheSizeInBytes instead. Only relevant if you are using the Blitter API. Determines the capacity of the software surface cache, which is used to cache all surfaces that are rendered via a software rasterizer to avoid re-rendering them.<br><br>The default value is `-1`. |
 | **`starboard_path`**<br><br> The relative path from src/ to the directory containing the starboard_platform.gyp file.  It is currently set to 'starboard/<(target_arch)' to make semi-starboard platforms work. moved to starboard.<br><br>The default value is `'starboard/<(target_arch)'`. |
 | **`target_os`**<br><br> The operating system of the target, separate from the target_arch. In many cases, an 'unknown' value is fine, but, if set to 'linux', then we can assume some things, and it'll save us some configuration time.<br><br>The default value is `'unknown'`. |
 | **`tizen_os`**<br><br> Temporary indicator for Tizen - should eventually move to feature defines.<br><br>The default value is `0`. |
diff --git a/src/cobalt/site/docs/reference/starboard/modules/10/atomic.md b/src/cobalt/site/docs/reference/starboard/modules/10/atomic.md
index 6331e79..5f79990 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/10/atomic.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/10/atomic.md
@@ -29,7 +29,7 @@
 #### Definition ####
 
 ```
-typedef SbAtomic64 SbAtomicPtr
+typedef SbAtomic32 SbAtomicPtr
 ```
 
 ## Functions ##
diff --git a/src/cobalt/site/docs/reference/starboard/modules/10/audio_sink.md b/src/cobalt/site/docs/reference/starboard/modules/10/audio_sink.md
index c3c1cf7..47b12ed 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/10/audio_sink.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/10/audio_sink.md
@@ -27,7 +27,7 @@
 ### SbAudioSinkConsumeFramesFunc ###
 
 Callback used to report frames consumed. The consumed frames will be removed
-from the source frame buffer to free space for new audio frames.When
+from the source frame buffer to free space for new audio frames. When
 `frames_consumed` is updated asynchnously and the last time that it has been
 updated is known, it can be passed in `frames_consumed_at` so the audio time
 calculating can be more accurate.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/10/blitter.md b/src/cobalt/site/docs/reference/starboard/modules/10/blitter.md
index 00d40a7..b35275f 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/10/blitter.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/10/blitter.md
@@ -12,8 +12,7 @@
 acceleration, if it is available. Draw commands exist for solid-color rectangles
 and rasterization/blitting of rectangular images onto rectangular target
 patches.
-
-## Threading Concerns ##
+Threading Concerns
 
 Note that in general the Blitter API is not thread safe, except for all
 `SbBlitterDevice`-related functions. All functions that are not required to
@@ -24,8 +23,7 @@
 threads, but manual synchronization must be performed in order to ensure their
 parameters are not referenced at the same time on another thread by another
 function.
-
-### Examples ###
+Examples
 
 *   Multiple threads should not issue commands to the same `SbBlitterContext`
     object unless they are manually synchronized.
@@ -136,6 +134,23 @@
 
 ## Functions ##
 
+### SB_DEPRECATED ###
+
+This function achieves the same effect as calling `SbBlitterBlitRectToRect()`
+`num_rects` times with each of the `num_rects` values of `src_rects` and
+`dst_rects`. This function allows for greater efficiency than looped calls to
+`SbBlitterBlitRectToRect()`.
+
+This function is not thread-safe.
+
+The return value indicates whether the draw call succeeded.
+
+#### Declaration ####
+
+```
+SB_DEPRECATED(bool SbBlitterBlitRectsToRects(SbBlitterContext context, SbBlitterSurface source_surface, const SbBlitterRect *src_rects, const SbBlitterRect *dst_rects, int num_rects))
+```
+
 ### SbBlitterAFromColor ###
 
 Extract alpha from a `SbBlitterColor` object.
@@ -156,63 +171,6 @@
 static uint8_t SbBlitterBFromColor(SbBlitterColor color)
 ```
 
-### SbBlitterBlitRectToRect ###
-
-Issues a draw call on `context` that blits the area of `source_surface`
-specified by `src_rect` to `context`'s current render target at `dst_rect`. The
-source rectangle must lie within the dimensions of `source_surface`. Note that
-the `source_surface`'s alpha is modulated by `opacity` before being drawn. For
-`opacity`, a value of 0 implies complete invisibility, and a value of 255
-implies complete opacity.
-
-This function is not thread-safe.
-
-The return value indicates whether the draw call succeeded.
-
-`src_rect`: The area to be block transferred (blitted).
-
-#### Declaration ####
-
-```
-bool SbBlitterBlitRectToRect(SbBlitterContext context, SbBlitterSurface source_surface, SbBlitterRect src_rect, SbBlitterRect dst_rect)
-```
-
-### SbBlitterBlitRectToRectTiled ###
-
-This function functions identically to SbBlitterBlitRectToRect(), except it
-permits values of `src_rect` outside the dimensions of `source_surface`. In
-those regions, the pixel data from `source_surface` will be wrapped. Negative
-values for `src_rect.x` and `src_rect.y` are allowed.
-
-The output is all stretched to fit inside of `dst_rect`.
-
-This function is not thread-safe.
-
-The return value indicates whether the draw call succeeded.
-
-#### Declaration ####
-
-```
-bool SbBlitterBlitRectToRectTiled(SbBlitterContext context, SbBlitterSurface source_surface, SbBlitterRect src_rect, SbBlitterRect dst_rect)
-```
-
-### SbBlitterBlitRectsToRects ###
-
-This function achieves the same effect as calling `SbBlitterBlitRectToRect()`
-`num_rects` times with each of the `num_rects` values of `src_rects` and
-`dst_rects`. This function allows for greater efficiency than looped calls to
-`SbBlitterBlitRectToRect()`.
-
-This function is not thread-safe.
-
-The return value indicates whether the draw call succeeded.
-
-#### Declaration ####
-
-```
-bool SbBlitterBlitRectsToRects(SbBlitterContext context, SbBlitterSurface source_surface, const SbBlitterRect *src_rects, const SbBlitterRect *dst_rects, int num_rects)
-```
-
 ### SbBlitterBytesPerPixelForFormat ###
 
 A convenience function to return the number of bytes per pixel for a given pixel
@@ -235,313 +193,6 @@
 static SbBlitterColor SbBlitterColorFromRGBA(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
 ```
 
-### SbBlitterCreateContext ###
-
-Creates an `SbBlitterContext` object on `device`. The returned context can be
-used to set up draw state and issue draw calls.
-
-Note that there is a limit on the number of contexts that can exist
-simultaneously, which can be queried by calling `SbBlitterGetMaxContexts()`.
-(The limit is often `1`.)
-
-`SbBlitterContext` objects keep track of draw state between a series of draw
-calls. Please refer to the `SbBlitterContext()` definition for more information
-about contexts.
-
-This function is thread-safe.
-
-This function returns `kSbBlitterInvalidContext` upon failure. Note that the
-function fails if it has already been used to create the maximum number of
-contexts.
-
-`device`: The `SbBlitterDevice` for which the `SbBlitterContext` object is
-created.
-
-#### Declaration ####
-
-```
-SbBlitterContext SbBlitterCreateContext(SbBlitterDevice device)
-```
-
-### SbBlitterCreateDefaultDevice ###
-
-Creates and returns an `SbBlitterDevice` based on the Blitter API
-implementation's decision of which device should be the default. The returned
-`SbBlitterDevice` represents a connection to a device (like a GPU).
-
-On many platforms there is always one single obvious choice for a device to use,
-and that is the one that this function will return. For example, if this is
-called on a platform that has a single GPU, this call should return an object
-that represents that GPU. On a platform that has no GPU, an object representing
-a software CPU implementation may be returned.
-
-Only one default device can exist within a process at a time. This function is
-thread-safe.
-
-Returns `kSbBlitterInvalidDevice` on failure.
-
-#### Declaration ####
-
-```
-SbBlitterDevice SbBlitterCreateDefaultDevice()
-```
-
-### SbBlitterCreatePixelData ###
-
-Allocates an `SbBlitterPixelData` object through `device` with `width`, `height`
-and `pixel_format`. `pixel_format` must be supported by `device` (see
-`SbBlitterIsPixelFormatSupportedByPixelData()`).
-
-This function is thread-safe.
-
-Calling this function results in the allocation of CPU-accessible (though
-perhaps blitter-device-resident) memory to store pixel data of the requested
-size/format. An `SbBlitterPixelData` object should eventually be passed either
-into a call to `SbBlitterCreateSurfaceFromPixelData()` or into a call to
-`SbBlitterDestroyPixelData()`.
-
-Returns `kSbBlitterInvalidPixelData` upon failure.
-
-#### Declaration ####
-
-```
-SbBlitterPixelData SbBlitterCreatePixelData(SbBlitterDevice device, int width, int height, SbBlitterPixelDataFormat pixel_format)
-```
-
-### SbBlitterCreateRenderTargetSurface ###
-
-Creates a new surface with undefined pixel data on `device` with the specified
-`width`, `height` and `surface_format`. One can set the pixel data on the
-resulting surface by getting its associated SbBlitterRenderTarget object and
-then calling `SbBlitterGetRenderTargetFromSurface()`.
-
-This function is thread-safe.
-
-Returns `kSbBlitterInvalidSurface` upon failure.
-
-#### Declaration ####
-
-```
-SbBlitterSurface SbBlitterCreateRenderTargetSurface(SbBlitterDevice device, int width, int height, SbBlitterSurfaceFormat surface_format)
-```
-
-### SbBlitterCreateSurfaceFromPixelData ###
-
-Creates an `SbBlitterSurface` object on `device`. Note that `device` must match
-the device that was used to create the `SbBlitterPixelData` object provided via
-the `pixel_data` parameter.
-
-This function also destroys the input `pixel_data` object. As a result,
-`pixel_data` should not be accessed again after a call to this function.
-
-The returned object cannot be used as a render target (e.g. calling
-`SbBlitterGetRenderTargetFromSurface()` on it will return
-`kSbBlitterInvalidRenderTarget`).
-
-This function is thread-safe with respect to `device`, but `pixel_data` should
-not be modified on another thread while this function is called.
-
-Returns `kSbBlitterInvalidSurface` in the event of an error.
-
-#### Declaration ####
-
-```
-SbBlitterSurface SbBlitterCreateSurfaceFromPixelData(SbBlitterDevice device, SbBlitterPixelData pixel_data)
-```
-
-### SbBlitterCreateSwapChainFromWindow ###
-
-Creates and returns an `SbBlitterSwapChain` that can then be used to send
-graphics to the display. This function links `device` to `window`'s output, and
-drawing to the returned swap chain will result in `device` being used to render
-to `window`.
-
-This function must be called from the thread that called `SbWindowCreate()` to
-create `window`.
-
-Returns `kSbBlitterInvalidSwapChain` on failure.
-
-#### Declaration ####
-
-```
-SbBlitterSwapChain SbBlitterCreateSwapChainFromWindow(SbBlitterDevice device, SbWindow window)
-```
-
-### SbBlitterDestroyContext ###
-
-Destroys the specified `context`, freeing all its resources.
-
-This function is not thread-safe.
-
-The return value indicates whether the destruction succeeded.
-
-`context`: The object to be destroyed.
-
-#### Declaration ####
-
-```
-bool SbBlitterDestroyContext(SbBlitterContext context)
-```
-
-### SbBlitterDestroyDevice ###
-
-Destroys `device`, cleaning up all resources associated with it. This function
-is thread-safe, but it should not be called if `device` is still being accessed
-elsewhere.
-
-The return value indicates whether the destruction succeeded.
-
-`device`: The SbBlitterDevice object to be destroyed.
-
-#### Declaration ####
-
-```
-bool SbBlitterDestroyDevice(SbBlitterDevice device)
-```
-
-### SbBlitterDestroyPixelData ###
-
-Destroys `pixel_data`. Note that this function does not need to be called and
-should not be called if `SbBlitterCreateSurfaceFromPixelData()` has been called
-on `pixel_data` before.
-
-This function is thread-safe.
-
-The return value indicates whether the destruction succeeded.
-
-`pixel_data`: The object to be destroyed.
-
-#### Declaration ####
-
-```
-bool SbBlitterDestroyPixelData(SbBlitterPixelData pixel_data)
-```
-
-### SbBlitterDestroySurface ###
-
-Destroys the `surface` object, cleaning up all resources associated with it.
-
-This function is not thread safe.
-
-The return value indicates whether the destruction succeeded.
-
-`surface`: The object to be destroyed.
-
-#### Declaration ####
-
-```
-bool SbBlitterDestroySurface(SbBlitterSurface surface)
-```
-
-### SbBlitterDestroySwapChain ###
-
-Destroys `swap_chain`, cleaning up all resources associated with it. This
-function is not thread-safe and must be called on the same thread that called
-`SbBlitterCreateSwapChainFromWindow()`.
-
-The return value indicates whether the destruction succeeded.
-
-`swap_chain`: The SbBlitterSwapChain to be destroyed.
-
-#### Declaration ####
-
-```
-bool SbBlitterDestroySwapChain(SbBlitterSwapChain swap_chain)
-```
-
-### SbBlitterDownloadSurfacePixels ###
-
-Downloads `surface` pixel data into CPU memory pointed to by `out_pixel_data`,
-formatted according to the requested `pixel_format` and the requested
-`pitch_in_bytes`. Before calling this function, you can call
-`SbBlitterIsPixelFormatSupportedByDownloadSurfacePixels()` to confirm that
-`pixel_format` is, in fact, valid for `surface`.
-
-When this function is called, it first waits for all previously flushed graphics
-commands to be executed by the device before downloading the data. Since this
-function waits for the pipeline to empty, it should be used sparingly, such as
-within in debug or test environments.
-
-The return value indicates whether the pixel data was downloaded successfully.
-
-The returned alpha format is premultiplied.
-
-This function is not thread-safe.
-
-`out_pixel_data`: A pointer to a region of memory with a size of surface_height
-* `pitch_in_bytes` bytes.
-
-#### Declaration ####
-
-```
-bool SbBlitterDownloadSurfacePixels(SbBlitterSurface surface, SbBlitterPixelDataFormat pixel_format, int pitch_in_bytes, void *out_pixel_data)
-```
-
-### SbBlitterFillRect ###
-
-Issues a draw call on `context` that fills the specified rectangle `rect`. The
-rectangle's color is determined by the last call to `SbBlitterSetColor()`.
-
-This function is not thread-safe.
-
-The return value indicates whether the draw call succeeded.
-
-`context`: The context on which the draw call will operate. `rect`: The
-rectangle to be filled.
-
-#### Declaration ####
-
-```
-bool SbBlitterFillRect(SbBlitterContext context, SbBlitterRect rect)
-```
-
-### SbBlitterFlipSwapChain ###
-
-Flips the `swap_chain` by making the buffer previously accessible to draw
-commands via `SbBlitterGetRenderTargetFromSwapChain()` visible on the display,
-while another buffer in an initially undefined state is set up as the new draw
-command target. Note that you do not need to call
-`SbBlitterGetRenderTargetFromSwapChain()` again after flipping, the swap chain's
-render target always refers to its current back buffer.
-
-This function stalls the calling thread until the next vertical refresh. In
-addition, to ensure consistency with the Starboard Player API when rendering
-punch-out video, calls to `SbPlayerSetBounds()` do not take effect until this
-method is called.
-
-The return value indicates whether the flip succeeded.
-
-This function is not thread-safe.
-
-`swap_chain`: The SbBlitterSwapChain to be flipped.
-
-#### Declaration ####
-
-```
-bool SbBlitterFlipSwapChain(SbBlitterSwapChain swap_chain)
-```
-
-### SbBlitterFlushContext ###
-
-Flushes all draw calls previously issued to `context`. Calling this function
-guarantees that the device processes all draw calls issued to this point on this
-`context` before processing any subsequent draw calls on any context.
-
-Before calling `SbBlitterFlipSwapChain()`, it is often prudent to call this
-function to ensure that all draw calls are submitted before the flip occurs.
-
-This function is not thread-safe.
-
-The return value indicates whether the flush succeeded.
-
-`context`: The context for which draw calls are being flushed.
-
-#### Declaration ####
-
-```
-bool SbBlitterFlushContext(SbBlitterContext context)
-```
-
 ### SbBlitterGFromColor ###
 
 Extract green from a `SbBlitterColor` object.
@@ -552,110 +203,6 @@
 static uint8_t SbBlitterGFromColor(SbBlitterColor color)
 ```
 
-### SbBlitterGetMaxContexts ###
-
-Returns the maximum number of contexts that `device` can support in parallel.
-Note that devices often support only a single context.
-
-This function is thread-safe.
-
-This function returns `-1` upon failure.
-
-`device`: The SbBlitterDevice for which the maximum number of contexts is
-returned.
-
-#### Declaration ####
-
-```
-int SbBlitterGetMaxContexts(SbBlitterDevice device)
-```
-
-### SbBlitterGetPixelDataPitchInBytes ###
-
-Retrieves the pitch (in bytes) for `pixel_data`. This indicates the number of
-bytes per row of pixel data in the image.
-
-This function is not thread-safe.
-
-Returns `-1` in the event of an error.
-
-`pixel_data`: The object for which you are retrieving the pitch.
-
-#### Declaration ####
-
-```
-int SbBlitterGetPixelDataPitchInBytes(SbBlitterPixelData pixel_data)
-```
-
-### SbBlitterGetPixelDataPointer ###
-
-Retrieves a CPU-accessible pointer to the pixel data represented by
-`pixel_data`. This pixel data can be modified by the CPU to initialize it on the
-CPU before calling `SbBlitterCreateSurfaceFromPixelData()`.
-
-Note that the pointer returned here is valid as long as `pixel_data` is valid,
-which means it is valid until either `SbBlitterCreateSurfaceFromPixelData()` or
-`SbBlitterDestroyPixelData()` is called.
-
-This function is not thread-safe.
-
-Returns `NULL` in the event of an error.
-
-#### Declaration ####
-
-```
-void* SbBlitterGetPixelDataPointer(SbBlitterPixelData pixel_data)
-```
-
-### SbBlitterGetRenderTargetFromSurface ###
-
-Returns the `SbBlitterRenderTarget` object owned by `surface`. The returned
-object can be used as a target for draw calls.
-
-This function returns `kSbBlitterInvalidRenderTarget` if `surface` is not able
-to provide a render target or on any other error.
-
-This function is not thread-safe.
-
-#### Declaration ####
-
-```
-SbBlitterRenderTarget SbBlitterGetRenderTargetFromSurface(SbBlitterSurface surface)
-```
-
-### SbBlitterGetRenderTargetFromSwapChain ###
-
-Returns the `SbBlitterRenderTarget` object that is owned by `swap_chain`. The
-returned object can be used to provide a target to blitter draw calls that draw
-directly to the display buffer. This function is not thread-safe.
-
-Returns `kSbBlitterInvalidRenderTarget` on failure.
-
-`swap_chain`: The SbBlitterSwapChain for which the target object is being
-retrieved.
-
-#### Declaration ####
-
-```
-SbBlitterRenderTarget SbBlitterGetRenderTargetFromSwapChain(SbBlitterSwapChain swap_chain)
-```
-
-### SbBlitterGetSurfaceInfo ###
-
-Retrieves an `SbBlitterSurfaceInfo` structure, which describes immutable
-parameters of the `surface`, such as its width, height and pixel format. The
-results are set on the output parameter `surface_info`, which cannot be `NULL`.
-
-The return value indicates whether the information was retrieved successfully.
-
-This function is not thread-safe.
-
-#### Declaration ####
-
-```
-bool SbBlitterGetSurfaceInfo(SbBlitterSurface surface, SbBlitterSurfaceInfo *surface_info)
-```
-
 ### SbBlitterIsContextValid ###
 
 Checks whether a blitter context is invalid.
@@ -686,36 +233,6 @@
 static bool SbBlitterIsPixelDataValid(SbBlitterPixelData pixel_data)
 ```
 
-### SbBlitterIsPixelFormatSupportedByDownloadSurfacePixels ###
-
-Indicates whether the combination of parameter values is valid for calls to
-`SbBlitterDownloadSurfacePixels()`.
-
-This function is not thread-safe.
-
-`surface`: The surface being checked. `pixel_format`: The pixel format that
-would be used on the surface.
-
-#### Declaration ####
-
-```
-bool SbBlitterIsPixelFormatSupportedByDownloadSurfacePixels(SbBlitterSurface surface, SbBlitterPixelDataFormat pixel_format)
-```
-
-### SbBlitterIsPixelFormatSupportedByPixelData ###
-
-Indicates whether `device` supports calls to `SbBlitterCreatePixelData` with the
-specified `pixel_format`. This function is thread-safe.
-
-`device`: The device for which compatibility is being checked. `pixel_format`:
-The SbBlitterPixelDataFormat for which compatibility is being checked.
-
-#### Declaration ####
-
-```
-bool SbBlitterIsPixelFormatSupportedByPixelData(SbBlitterDevice device, SbBlitterPixelDataFormat pixel_format)
-```
-
 ### SbBlitterIsRenderTargetValid ###
 
 Checks whether a render target is invalid.
@@ -726,22 +243,6 @@
 static bool SbBlitterIsRenderTargetValid(SbBlitterRenderTarget render_target)
 ```
 
-### SbBlitterIsSurfaceFormatSupportedByRenderTargetSurface ###
-
-Indicates whether the `device` supports calls to
-`SbBlitterCreateRenderTargetSurface()` with `surface_format`.
-
-This function is thread-safe.
-
-`device`: The device being checked for compatibility. `surface_format`: The
-surface format being checked for compatibility.
-
-#### Declaration ####
-
-```
-bool SbBlitterIsSurfaceFormatSupportedByRenderTargetSurface(SbBlitterDevice device, SbBlitterSurfaceFormat surface_format)
-```
-
 ### SbBlitterIsSurfaceValid ###
 
 Checks whether a surface is invalid.
@@ -797,125 +298,3 @@
 static uint8_t SbBlitterRFromColor(SbBlitterColor color)
 ```
 
-### SbBlitterSetBlending ###
-
-Sets the blending state for the specified `context`. By default, blending is
-disabled on a `SbBlitterContext`.
-
-This function is not thread-safe.
-
-The return value indicates whether the blending state was set successfully.
-
-`context`: The context for which the blending state is being set.
-
-`blending`: The blending state for the `context`. If `blending` is `true`, the
-source alpha of subsequent draw calls is used to blend with the destination
-color. In particular,
-
-```
-Fc = Sc * Sa + Dc * (1 - Sa)
-
-```
-
-where:
-
-*   `Fc` is the final color.
-
-*   `Sc` is the source color.
-
-*   `Sa` is the source alpha.
-
-*   `Dc` is the destination color.
-
-If `blending` is `false`, the source color and source alpha overwrite the
-destination color and alpha.
-
-#### Declaration ####
-
-```
-bool SbBlitterSetBlending(SbBlitterContext context, bool blending)
-```
-
-### SbBlitterSetColor ###
-
-Sets the context's current color. The current color's default value is
-`SbBlitterColorFromRGBA(255, 255, 255 255)`.
-
-The current color affects the fill rectangle's color in calls to
-`SbBlitterFillRect()`. If `SbBlitterSetModulateBlitsWithColor()` has been called
-to enable blit color modulation, the source blit surface pixel color is also
-modulated by the color before being output.
-
-This function is not thread-safe.
-
-The return value indicates whether the color was set successfully.
-
-`context`: The context for which the color is being set. `color`: The context's
-new color, specified in unpremultiplied alpha format.
-
-#### Declaration ####
-
-```
-bool SbBlitterSetColor(SbBlitterContext context, SbBlitterColor color)
-```
-
-### SbBlitterSetModulateBlitsWithColor ###
-
-Sets whether or not blit calls should have their source pixels modulated by the
-current color, which is set using `SbBlitterSetColor()`, before being output.
-This function can apply opacity to blit calls, color alpha-only surfaces, and
-apply other effects.
-
-This function is not thread-safe.
-
-The return value indicates whether the state was set successfully.
-
-`modulate_blits_with_color`: Indicates whether to modulate source pixels in blit
-calls.
-
-#### Declaration ####
-
-```
-bool SbBlitterSetModulateBlitsWithColor(SbBlitterContext context, bool modulate_blits_with_color)
-```
-
-### SbBlitterSetRenderTarget ###
-
-Sets up `render_target` as the render target that all subsequent draw calls made
-on `context` will use.
-
-This function is not thread-safe.
-
-The return value indicates whether the render target was set successfully.
-
-`context`: The object for which the render target is being set. `render_target`:
-The target that the `context` should use for draw calls.
-
-#### Declaration ####
-
-```
-bool SbBlitterSetRenderTarget(SbBlitterContext context, SbBlitterRenderTarget render_target)
-```
-
-### SbBlitterSetScissor ###
-
-Sets the scissor rectangle, which dictates a visibility area that affects all
-draw calls. Only pixels within the scissor rectangle are rendered, and all
-drawing outside of that area is clipped.
-
-When `SbBlitterSetRenderTarget()` is called, that function automatically sets
-the scissor rectangle to the size of the specified render target. If a scissor
-rectangle is specified outside of the extents of the current render target
-bounds, it will be intersected with the render target bounds.
-
-This function is not thread-safe.
-
-Returns whether the scissor was successfully set. It returns an error if it is
-called before a render target has been specified for the context.
-
-#### Declaration ####
-
-```
-bool SbBlitterSetScissor(SbBlitterContext context, SbBlitterRect rect)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/10/configuration.md b/src/cobalt/site/docs/reference/starboard/modules/10/configuration.md
index be08866..6cb7819 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/10/configuration.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/10/configuration.md
@@ -38,11 +38,6 @@
 
 Determines a compile-time capability of the system.
 
-### SB_CAN_MEDIA_USE_STARBOARD_PIPELINE ###
-
-Specifies whether the starboard media pipeline components (SbPlayerPipeline and
-StarboardDecryptor) are used. Set to 0 means they are not used.
-
 ### SB_COMPILE_ASSERT(expr, msg) ###
 
 Will cause a compiler error with `msg` if `expr` is false. `msg` must be a valid
@@ -83,20 +78,13 @@
 
 Whether the current platform has 64-bit atomic operations.
 
-### SB_HAS_AC3_AUDIO_API_VERSION ###
+### SB_HAS_AUDIO_SPECIFIC_CONFIG_AS_POINTER ###
 
-Add support for audio in ac3.
-
-### SB_HAS_AV1_VERSION ###
-
-Replace kSbMediaVideoCodecVp10 by kSbMediaVideoCodecAv1. kSbMediaVideoCodecVp10
-in media.h is replaced by kSbMediaVideoCodecAv1.
-
-### SB_HAS_DRM_KEY_STATUSES ###
-
-Legal values for SB_PREFERRED_RGBA_BYTE_ORDER are defined in this file above as
-SB_PREFERRED_RGBA_BYTE_ORDER_*. If your platform uses GLES, you should set this
-to SB_PREFERRED_RGBA_BYTE_ORDER_RGBA.
+Deprecated feature macros These feature macros are deprecated in Starboard
+version 6 and later, and are no longer referenced by application code. They will
+be removed in a future version. Any Starboard implementation that supports
+Starboard version 6 or later should be modified to no longer depend on these
+macros, with the assumption that their values are always 1.
 
 ### SB_HAS_GLES2 ###
 
@@ -113,30 +101,6 @@
 
 Determines at compile-time whether this platform has a quirk.
 
-### SB_HAS_SCREEN_DIAGONAL_API_VERSION ###
-
-Adds support for allowing the platform to override its screen diagonal length
-via SbWindowGetDiagonalSizeInInches().
-
-### SB_HAS_STARTUP_URL_SIGNING_VERSION ###
-
-Add support for startup url signing by adding
-kSbSystemPropertyCertificationScope and
-kSbSystemPropertyBase64EncodedCertificationSecret system property enums to
-system.h.
-
-### SB_HAS_STD_UNORDERED_HASH_API_VERSION ###
-
-Add support for using C++11 standard unordered maps and sets. By setting
-SB_HAS_STD_UNORDERED_HASH to 1, a platform can be configured to use C++11
-standard hash table implementations, specifically, using: . std::unordered_map<>
-for base::hash_map<>, and . std::unordered_multimap<> for base::hash_multimap<>,
-and . std::unordered_set<> for base::hash_set<>, and . std::unordered_multiset<>
-for base::hash_multiset<>. When SB_HAS_STD_UNORDERED_HASH is used, it is no
-longer necessary to specify SB_HAS_LONG_LONG_HASH, SB_HAS_STRING_HASH,
-SB_HAS_HASH_USING, SB_HAS_HASH_VALUE, SB_HAS_HASH_WARNING, SB_HASH_MAP_INCLUDE,
-SB_HASH_NAMESPACE, or SB_HASH_SET_INCLUDE.
-
 ### SB_INT64_C(x) ###
 
 Declare numeric literals of signed 64-bit type.
@@ -147,7 +111,10 @@
 
 ### SB_IS_LITTLE_ENDIAN ###
 
-Whether the current platform is little endian.
+Legal values for SB_PREFERRED_RGBA_BYTE_ORDER are defined in this file above as
+SB_PREFERRED_RGBA_BYTE_ORDER_*. If your platform uses GLES, you should set this
+to SB_PREFERRED_RGBA_BYTE_ORDER_RGBA. Whether the current platform is little
+endian.
 
 ### SB_LIKELY(x) ###
 
@@ -158,13 +125,6 @@
 The maximum API version allowed by this version of the Starboard headers,
 inclusive.
 
-### SB_MEDIA_EOTF_CHECK_SUPPORT_VERSION ###
-
-Add SbMediaTransferId* argument `eotf` to SbMediaIsVideoSupported, so the
-platform may indicate support of resolution, bitrate, fps, and codec conditioned
-on eotf. Also, remove the function SbMediaIsTransferCharacteristicsSupported
-which is no longer necessary.
-
 ### SB_MINIMUM_API_VERSION ###
 
 The minimum API version allowed by this version of the Starboard headers,
@@ -182,10 +142,10 @@
 
 ### SB_PREFERRED_RGBA_BYTE_ORDER_RGBA ###
 
-An enumeration of values for the SB_PREFERRED_RGBA_BYTE_ORDER configuration
-variable. Setting this up properly means avoiding slow color swizzles when
-passing pixel data from one library to another. Note that these definitions are
-in byte-order and so are endianness-independent.
+An enumeration of values for the kSbPreferredByteOrder configuration variable.
+Setting this up properly means avoiding slow color swizzles when passing pixel
+data from one library to another. Note that these definitions are in byte-order
+and so are endianness-independent.
 
 ### SB_PRINTF_FORMAT(format_param, dots_param) ###
 
@@ -207,9 +167,17 @@
 
 Include the platform-specific configuration. This macro is set by GYP in
 starboard_base_target.gypi and passed in on the command line for all targets and
-all configurations.Makes a pointer-typed parameter restricted so that the
-compiler can make certain optimizations because it knows the pointers are
-unique.
+all configurations. After version 12, we start to use runtime constants instead
+of macros for certain platform dependent configurations. This file substitutes
+configuration macros for the corresponding runtime constants so we don't
+reference these constants when they aren't defined. Makes a pointer-typed
+parameter restricted so that the compiler can make certain optimizations because
+it knows the pointers are unique.
+
+### SB_SIZE_OF(DATATYPE) ###
+
+Determines at compile-time the size of a data type, or 0 if the data type that
+was specified was invalid.
 
 ### SB_STRINGIFY(x) ###
 
diff --git a/src/cobalt/site/docs/reference/starboard/modules/10/cryptography.md b/src/cobalt/site/docs/reference/starboard/modules/10/cryptography.md
index 1540465..0b9442b 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/10/cryptography.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/10/cryptography.md
@@ -7,8 +7,7 @@
 when there are **hardware-accelerated** hardware-accelerated cryptography
 facilities. Applications must fall back to platform-independent CPU-based
 algorithms if the cipher algorithm isn't supported in hardware.
-
-## Tips for Porters ##
+Tips for Porters
 
 You should implement cipher algorithms in this descending order of priority to
 maximize usage for SSL.
@@ -136,6 +135,8 @@
 `initialization_vector_size`: The size, in bytes, of the IV. `key`: The key to
 use for this transformation. `key_size`: The size, in bytes, of the key.
 
+presubmit: allow sb_export mismatch
+
 #### Declaration ####
 
 ```
@@ -146,6 +147,8 @@
 
 Destroys the given `transformer` instance.
 
+presubmit: allow sb_export mismatch
+
 #### Declaration ####
 
 ```
@@ -159,6 +162,8 @@
 tag, which mainly has to do with whether it is compatible with the current block
 cipher mode.
 
+presubmit: allow sb_export mismatch
+
 #### Declaration ####
 
 ```
@@ -182,6 +187,8 @@
 fail if the chaining mode doesn't support AAD, if the parameters are invalid, or
 if the internal state is invalid for setting AAD.
 
+presubmit: allow sb_export mismatch
+
 #### Declaration ####
 
 ```
@@ -195,6 +202,8 @@
 every block, so this is not necessary unless the stream is discontiguous in some
 way. This happens with AES-GCM in TLS.
 
+presubmit: allow sb_export mismatch
+
 #### Declaration ####
 
 ```
@@ -215,6 +224,8 @@
 transformed data should be placed. Must have at least capacity for
 `in_data_size` bytes. May point to the same memory as `in_data`.
 
+presubmit: allow sb_export mismatch
+
 #### Declaration ####
 
 ```
diff --git a/src/cobalt/site/docs/reference/starboard/modules/10/decode_target.md b/src/cobalt/site/docs/reference/starboard/modules/10/decode_target.md
index 88e2643..e35f05a 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/10/decode_target.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/10/decode_target.md
@@ -12,8 +12,7 @@
 data. This allows the application to allocate fast graphics memory, and have
 decoding done directly into this memory, avoiding unnecessary memory copies, and
 also avoiding pushing data between CPU and GPU memory unnecessarily.
-
-## SbDecodeTargetFormat ##
+SbDecodeTargetFormat
 
 SbDecodeTargets support several different formats that can be used to decode
 into and render from. Some formats may be easier to decode into, and others may
@@ -21,8 +20,7 @@
 the SbDecodeTargetFormat passed into it, or the decode will produce an error.
 Each decoder provides a way to check if a given SbDecodeTargetFormat is
 supported by that decoder.
-
-## SbDecodeTargetGraphicsContextProvider ##
+SbDecodeTargetGraphicsContextProvider
 
 Some components may need to acquire SbDecodeTargets compatible with a certain
 rendering context, which may need to be created on a particular thread. The
@@ -36,8 +34,7 @@
 
 The primary usage is likely to be the the SbPlayer implementation on some
 platforms.
-
-## SbDecodeTarget Example ##
+SbDecodeTarget Example
 
 Let's say that we are an application and we would like to use the interface
 defined in starboard/image.h to decode an imaginary "image/foo" image type.
@@ -78,6 +75,7 @@
 SbDecodeTargetGetInfo(target, &info);
 GLuint texture =
     info.planes[kSbDecodeTargetPlaneRGBA].texture;
+
 ```
 
 ## Macros ##
@@ -212,6 +210,26 @@
 
     The SbBlitterDevice object that will be used to render any produced
     SbDecodeTargets.
+*   `void * egl_display`
+
+    A reference to the EGLDisplay object that hosts the EGLContext that will be
+    used to render any produced SbDecodeTargets. Note that it has the type
+    `void*` in order to avoid #including the EGL header files here.
+*   `void * egl_context`
+
+    The EGLContext object that will be used to render any produced
+    SbDecodeTargets. Note that it has the type `void*` in order to avoid
+    #including the EGL header files here.
+*   `SbDecodeTargetGlesContextRunner gles_context_runner`
+
+    The `gles_context_runner` function pointer is passed in from the application
+    into the Starboard implementation, and can be invoked by the Starboard
+    implementation to allow running arbitrary code on the renderer's thread with
+    the EGLContext above held current.
+*   `void * gles_context_runner_context`
+
+    Context data that is to be passed in to `gles_context_runner` when it is
+    invoked.
 
 ### SbDecodeTargetInfo ###
 
@@ -254,6 +272,9 @@
 #### Members ####
 
 *   `int left`
+
+    These integer values are assumed to be in units of pixels, within the
+    texture's width and height.
 *   `int top`
 *   `int right`
 *   `int bottom`
@@ -267,6 +288,20 @@
 *   `SbBlitterSurface surface`
 
     A handle to the Blitter surface that can be used for rendering.
+*   `uint32_t texture`
+
+    A handle to the GL texture that can be used for rendering.
+*   `uint32_t gl_texture_target`
+
+    The GL texture target that should be used in calls to glBindTexture.
+    Typically this would be GL_TEXTURE_2D, but some platforms may require that
+    it be set to something else like GL_TEXTURE_EXTERNAL_OES.
+*   `uint32_t gl_texture_format`
+
+    For kSbDecodeTargetFormat2PlaneYUVNV12 planes: the format of the texture.
+    Usually, for the luma plane, this is either GL_ALPHA or GL_RED_EXT. For the
+    chroma plane, this is usually GL_LUMINANCE_ALPHA or GL_RG_EXT. Ignored for
+    other plane types.
 *   `int width`
 
     The width of the texture/surface for this particular plane.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/10/directory.md b/src/cobalt/site/docs/reference/starboard/modules/10/directory.md
index 7288d2d..2ec9cca 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/10/directory.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/10/directory.md
@@ -81,6 +81,10 @@
 Populates `out_entry` with the next entry in the specified directory stream, and
 moves the stream forward by one entry.
 
+Platforms may, but are not required to, return `.` (referring to the directory
+itself) and/or `..` (referring to the directory's parent directory) as entries
+in the directory stream.
+
 This function returns `true` if there was a next directory, and `false` at the
 end of the directory stream.
 
diff --git a/src/cobalt/site/docs/reference/starboard/modules/10/drm.md b/src/cobalt/site/docs/reference/starboard/modules/10/drm.md
index b76b672..9e40e05 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/10/drm.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/10/drm.md
@@ -101,19 +101,23 @@
 A callback that will receive generated session update request when requested
 from a SbDrmSystem. `drm_system` will be the DRM system that
 SbDrmGenerateSessionUpdateRequest() was called on. `context` will be the same
-context that was passed into the call to SbDrmCreateSystem().`status` is the
-status of the session request.
+context that was passed into the call to SbDrmCreateSystem().
+
+`status` is the status of the session request.
 
 `type` is the status of the session request.
 
 `error_message` may contain an optional error message when `status` isn't
 `kSbDrmStatusSuccess` to provide more details about the error. It may be NULL if
-`status` is `kSbDrmStatusSuccess` or if no error message can be
-provided.`ticket` will be the same ticket that was passed to
+`status` is `kSbDrmStatusSuccess` or if no error message can be provided.
+`ticket` will be the same ticket that was passed to
 SbDrmGenerateSessionUpdateRequest() or `kSbDrmTicketInvalid` if the update
 request was generated by the DRM system.
 
-`session_id` can be NULL if there was an error generating the request.
+`session_id` cannot be NULL when `ticket` is `kSbDrmTicketInvalid`, even when
+there was an error generating the request. This allows Cobalt to find and reject
+the correct Promise corresponding to the associated
+SbDrmGenerateSessionUpdateRequest().
 
 #### Definition ####
 
@@ -128,13 +132,14 @@
 system that SbDrmUpdateSession() was called on. `context` will be the same
 context passed into that call to SbDrmCreateSystem().
 
-`ticket` will be the same ticket that was passed to
-SbDrmUpdateSession().`status` is the status of the session request.
+`ticket` will be the same ticket that was passed to SbDrmUpdateSession().
+
+`status` is the status of the session request.
 
 `error_message` may contain an optional error message when `status` isn't
 `kSbDrmStatusSuccess` to provide more details about the error. It may be NULL if
-`status` is `kSbDrmStatusSuccess` or if no error message can be
-provided.`succeeded` is whether the session was successfully updated or not.
+`status` is `kSbDrmStatusSuccess` or if no error message can be provided.
+`succeeded` is whether the session was successfully updated or not.
 
 #### Definition ####
 
@@ -215,40 +220,6 @@
 void SbDrmCloseSession(SbDrmSystem drm_system, const void *session_id, int session_id_size)
 ```
 
-### SbDrmCreateSystem ###
-
-Creates a new DRM system that can be used when constructing an SbPlayer or an
-SbDecoder.
-
-This function returns kSbDrmSystemInvalid if `key_system` is unsupported.
-
-Also see the documentation of SbDrmGenerateSessionUpdateRequest() and
-SbDrmUpdateSession() for more details.
-
-`key_system`: The DRM key system to be created. The value should be in the form
-of "com.example.somesystem" as suggested by [https://w3c.github.io/encrypted-media/#key-system](https://w3c.github.io/encrypted-media/#key-system)) . All
-letters in the value should be lowercase and will be matched exactly with known
-DRM key systems of the platform. `context`: A value passed when any of this
-function's callback parameters are called. `update_request_callback`: A function
-that is called every time after SbDrmGenerateSessionUpdateRequest() is called.
-`session_updated_callback`: A function that is called every time after
-SbDrmUpdateSession() is called. `key_statuses_changed_callback`: A function that
-can be called to indicate that key statuses have changed.
-`server_certificate_updated_callback`: A function that is called to report
-whether the server certificate has been successfully updated. It is called once
-and only once. It is possible that the callback is called before the function
-returns. `session_closed_callback`: A function that can be called to indicate
-that a session has closed.If `NULL` is passed for any of the callbacks
-(`update_request_callback`, `session_updated_callback`,
-`key_statuses_changed_callback`, `server_certificate_updated_callback`, or
-`session_closed_callback`), then `kSbDrmSystemInvalid` must be returned.
-
-#### Declaration ####
-
-```
-SbDrmSystem SbDrmCreateSystem(const char *key_system, void *context, SbDrmSessionUpdateRequestFunc update_request_callback, SbDrmSessionUpdatedFunc session_updated_callback, SbDrmSessionKeyStatusesChangedFunc key_statuses_changed_callback, SbDrmServerCertificateUpdatedFunc server_certificate_updated_callback, SbDrmSessionClosedFunc session_closed_callback)
-```
-
 ### SbDrmDestroySystem ###
 
 Destroys `drm_system`, which implicitly removes all keys installed in it and
@@ -305,30 +276,6 @@
 void SbDrmGenerateSessionUpdateRequest(SbDrmSystem drm_system, int ticket, const char *type, const void *initialization_data, int initialization_data_size)
 ```
 
-### SbDrmGetKeyCount ###
-
-Returns the number of keys installed in `drm_system`.
-
-`drm_system`: The system for which the number of installed keys is retrieved.
-
-#### Declaration ####
-
-```
-int SbDrmGetKeyCount(SbDrmSystem drm_system)
-```
-
-### SbDrmGetKeyStatus ###
-
-Gets `out_key`, `out_key_size`, and `out_status` for the key with `index` in
-`drm_system`. Returns whether a key is installed at `index`. If not, the output
-parameters, which all must not be NULL, will not be modified.
-
-#### Declaration ####
-
-```
-bool SbDrmGetKeyStatus(SbDrmSystem drm_system, const void *session_id, int session_id_size, int index, void **out_key, int *out_key_size, SbDrmKeyStatus *out_status)
-```
-
 ### SbDrmIsServerCertificateUpdatable ###
 
 Returns true if server certificate of `drm_system` can be updated via
@@ -343,19 +290,6 @@
 bool SbDrmIsServerCertificateUpdatable(SbDrmSystem drm_system)
 ```
 
-### SbDrmRemoveAllKeys ###
-
-Removes all installed keys for `drm_system`. Any outstanding session update
-requests are also invalidated.
-
-`drm_system`: The DRM system for which keys should be removed.
-
-#### Declaration ####
-
-```
-void SbDrmRemoveAllKeys(SbDrmSystem drm_system)
-```
-
 ### SbDrmSystemIsValid ###
 
 Indicates whether `drm_system` is a valid SbDrmSystem.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/10/event.md b/src/cobalt/site/docs/reference/starboard/modules/10/event.md
index 4ea1f95..d25add0 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/10/event.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/10/event.md
@@ -4,8 +4,7 @@
 ---
 
 Defines the event system that wraps the Starboard main loop and entry point.
-
-## The Starboard Application Lifecycle ##
+The Starboard Application Lifecycle
 
 ```
     ---------- *
@@ -184,7 +183,11 @@
     The platform's accessibility settings have changed. The application should
     query the accessibility settings using the appropriate APIs to get the new
     settings. Note this excludes captions settings changes, which causes
-    kSbEventTypeAccessibilityCaptionSettingsChanged to fire.
+    kSbEventTypeAccessibilityCaptionSettingsChanged to fire. If the starboard
+    version has kSbEventTypeAccessiblityTextToSpeechSettingsChanged, then that
+    event should be used to signal text-to-speech settings changes instead;
+    platforms using older starboard versions should use
+    kSbEventTypeAccessiblitySettingsChanged for text-to-speech settings changes.
 *   `kSbEventTypeLowMemory`
 
     An optional event that platforms may send to indicate that the application
@@ -234,8 +237,8 @@
     kSbEventOnScreenKeyboardInvalidTicket.
 *   `kSbEventTypeAccessibilityCaptionSettingsChanged`
 
-    One or more of the fields returned by SbAccessibilityGetCaptionSettings has
-    changed.
+    SB_HAS(ON_SCREEN_KEYBOARD) One or more of the fields returned by
+    SbAccessibilityGetCaptionSettings has changed.
 
 ## Typedefs ##
 
diff --git a/src/cobalt/site/docs/reference/starboard/modules/10/export.md b/src/cobalt/site/docs/reference/starboard/modules/10/export.md
index a6907e2..ff79777 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/10/export.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/10/export.md
@@ -10,8 +10,15 @@
 
 ### SB_EXPORT ###
 
-COMPONENT_BUILD is defined when generating shared libraries for each project,
-rather than static libraries. This means we need to be careful about
-EXPORT/IMPORT. SB_IS_LIBRARY is defined when building Starboard as a shared
-library to be linked into a client app. In this case, we want to explicitly
-define EXPORT/IMPORT so that Starboard's symbols are visible to such clients.
+Specification for a symbol that should be exported when building the DLL and
+imported when building code that uses the DLL.
+
+### SB_EXPORT_PRIVATE ###
+
+Specification for a symbol that should be exported or imported for testing
+purposes only.
+
+### SB_IMPORT ###
+
+Specification for a symbol that is expected to be defined externally to this
+module.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/10/image.md b/src/cobalt/site/docs/reference/starboard/modules/10/image.md
index 634dab8..c911e41 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/10/image.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/10/image.md
@@ -10,8 +10,7 @@
 
 All functions in this module are safe to call from any thread at any point in
 time.
-
-## SbImageIsDecodeSupported and SbImageDecode Example ##
+SbImageIsDecodeSupported and SbImageDecode Example
 
 Let's assume that we're on a Blitter platform.
 
@@ -31,6 +30,7 @@
 SbBlitterSurface surface =
     SbDecodeTargetGetPlane(target, kSbDecodeTargetPlaneRGBA);
 // Do stuff with surface...
+
 ```
 
 ## Functions ##
diff --git a/src/cobalt/site/docs/reference/starboard/modules/10/input.md b/src/cobalt/site/docs/reference/starboard/modules/10/input.md
index d607e0a..3554af6 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/10/input.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/10/input.md
@@ -163,6 +163,9 @@
 *   `const char * input_text`
 
     The text to input for events of type `Input`.
+*   `bool is_composing`
+
+    Set to true if the input event is part of a composition event.
 
 ### SbInputVector ###
 
diff --git a/src/cobalt/site/docs/reference/starboard/modules/10/log.md b/src/cobalt/site/docs/reference/starboard/modules/10/log.md
index fd98e08..1ad6c24 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/10/log.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/10/log.md
@@ -3,7 +3,7 @@
 title: "Starboard Module Reference: log.h"
 ---
 
-Defines debug logging functions.
+Defines core debug logging functions.
 
 ## Enums ##
 
@@ -24,7 +24,8 @@
 
 ### SbLog ###
 
-Writes `message` to the platform's debug output log.
+Writes `message` to the platform's debug output log. This method is thread-safe,
+and responsible for ensuring that the output from multiple threads is not mixed.
 
 `priority`: The SbLogPriority at which the message should be logged. Note that
 passing `kSbLogPriorityFatal` does not terminate the program. Such a policy must
@@ -42,7 +43,8 @@
 
 ### SbLogFlush ###
 
-Flushes the log buffer on some platforms.
+Flushes the log buffer on some platforms. This method is safe to call from
+multiple threads.
 
 #### Declaration ####
 
diff --git a/src/cobalt/site/docs/reference/starboard/modules/10/media.md b/src/cobalt/site/docs/reference/starboard/modules/10/media.md
index 60ee90d..9b83d06 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/10/media.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/10/media.md
@@ -27,6 +27,7 @@
 *   `kSbMediaAudioCodecNone`
 *   `kSbMediaAudioCodecAac`
 *   `kSbMediaAudioCodecAc3`
+*   `kSbMediaAudioCodecEac3`
 *   `kSbMediaAudioCodecOpus`
 *   `kSbMediaAudioCodecVorbis`
 
@@ -156,10 +157,22 @@
 *   `kSbMediaVideoCodecMpeg2`
 *   `kSbMediaVideoCodecTheora`
 *   `kSbMediaVideoCodecVc1`
-*   `kSbMediaVideoCodecAv1`
+*   `kSbMediaVideoCodecVp10`
 *   `kSbMediaVideoCodecVp8`
 *   `kSbMediaVideoCodecVp9`
 
+## Typedefs ##
+
+### SbMediaAudioHeader ###
+
+SbMediaAudioHeader is same as SbMediaAudioSampleInfo in old starboard version.
+
+#### Definition ####
+
+```
+typedef SbMediaAudioSampleInfo SbMediaAudioHeader
+```
+
 ## Structs ##
 
 ### SbMediaAudioConfiguration ###
@@ -189,17 +202,22 @@
     `0` if this device cannot provide this information, in which case the caller
     can probably assume stereo output.
 
-### SbMediaAudioHeader ###
+### SbMediaAudioSampleInfo ###
 
-An audio sequence header, which is a description of a given audio stream. This,
-in hexadecimal string form, acts as a set of instructions to the audio decoder.
+An audio sample info, which is a description of a given audio sample. This, in
+hexadecimal string form, acts as a set of instructions to the audio decoder.
 
-The Sequence Header consists of a little-endian hexadecimal encoded
+The audio sample info consists of a little-endian hexadecimal encoded
 `WAVEFORMATEX` structure followed by an Audio-specific configuration field. The
 `WAVEFORMATEX` structure is specified at: [http://msdn.microsoft.com/en-us/library/dd390970(v=vs.85).aspx](http://msdn.microsoft.com/en-us/library/dd390970(v=vs.85).aspx)
 
 #### Members ####
 
+*   `const char * mime`
+
+    The mime of the audio stream when `codec` isn't kSbMediaAudioCodecNone. It
+    may point to an empty string if the mime is not available, and it can only
+    be set to NULL when `codec` is kSbMediaAudioCodecNone.
 *   `uint16_t format_tag`
 
     The waveform-audio format type code.
@@ -363,6 +381,23 @@
 
 #### Members ####
 
+*   `const char * mime`
+
+    The mime of the video stream when `codec` isn't kSbMediaVideoCodecNone. It
+    may point to an empty string if the mime is not available, and it can only
+    be set to NULL when `codec` is kSbMediaVideoCodecNone.
+*   `const char * max_video_capabilities`
+
+    Indicates the max video capabilities required. The web app will not provide
+    a video stream exceeding the maximums described by this parameter. Allows
+    the platform to optimize playback pipeline for low quality video streams if
+    it knows that it will never adapt to higher quality streams. The string uses
+    the same format as the string passed in to SbMediaCanPlayMimeAndKeySystem(),
+    for example, when it is set to "width=1920; height=1080; framerate=15;", the
+    video will never adapt to resolution higher than 1920x1080 or frame per
+    second higher than 15 fps. When the maximums are unknown, this will be set
+    to an empty string. It can only be set to NULL when `codec` is
+    kSbMediaVideoCodecNone.
 *   `bool is_key_frame`
 
     Indicates whether the associated sample is a key frame (I-frame). Video key
diff --git a/src/cobalt/site/docs/reference/starboard/modules/10/memory.md b/src/cobalt/site/docs/reference/starboard/modules/10/memory.md
index 676bd44..a3fecb6 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/10/memory.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/10/memory.md
@@ -4,14 +4,12 @@
 ---
 
 Defines functions for memory allocation, alignment, copying, and comparing.
-
-## Porters ##
+Porters
 
 All of the "Unchecked" and "Free" functions must be implemented, but they should
 not be called directly. The Starboard platform wraps them with extra accounting
 under certain circumstances.
-
-## Porters and Application Developers ##
+Porters and Application Developers
 
 Nobody should call the "Checked", "Unchecked" or "Free" functions directly
 because that evades Starboard's memory tracking. In both port implementations
@@ -48,7 +46,7 @@
 
 ### SbMemoryAlignToPageSize ###
 
-Rounds `size` up to SB_MEMORY_PAGE_SIZE.
+Rounds `size` up to kSbMemoryPageSize.
 
 #### Declaration ####
 
diff --git a/src/cobalt/site/docs/reference/starboard/modules/10/player.md b/src/cobalt/site/docs/reference/starboard/modules/10/player.md
index a4c97c1..129d94d 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/10/player.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/10/player.md
@@ -114,19 +114,6 @@
 typedef void(* SbPlayerDecoderStatusFunc) (SbPlayer player, void *context, SbMediaType type, SbPlayerDecoderState state, int ticket)
 ```
 
-### SbPlayerEncryptedMediaInitDataEncounteredCB ###
-
-Callback to queue an encrypted event for initialization data encountered in
-media data. `init_data_type` should be a string matching one of the EME
-initialization data types : "cenc", "fairplay", "keyids", or "webm", `init_data`
-is the initialization data, and `init_data_length` is the length of the data.
-
-#### Definition ####
-
-```
-typedef void(* SbPlayerEncryptedMediaInitDataEncounteredCB) (SbPlayer player, void *context, const char *init_data_type, const unsigned char *init_data, unsigned int init_data_length)
-```
-
 ### SbPlayerErrorFunc ###
 
 Callback for player errors, that may set a `message`. `error`: indicates the
@@ -154,6 +141,37 @@
 
 ## Structs ##
 
+### SbPlayerCreationParam ###
+
+The playback related parameters to pass into SbPlayerCreate() and
+SbPlayerGetPreferredOutputMode().
+
+#### Members ####
+
+*   `SbDrmSystem drm_system`
+
+    Provides an appropriate DRM system if the media stream has encrypted
+    portions. It will be `kSbDrmSystemInvalid` if the stream does not have
+    encrypted portions.
+*   `SbMediaAudioSampleInfo audio_sample_info`
+
+    Contains a populated SbMediaAudioSampleInfo if `audio_sample_info.codec`
+    isn't `kSbMediaAudioCodecNone`. When `audio_sample_info.codec` is
+    `kSbMediaAudioCodecNone`, the video doesn't have an audio track.
+*   `SbMediaVideoSampleInfo video_sample_info`
+
+    Contains a populated SbMediaVideoSampleInfo if `video_sample_info.codec`
+    isn't `kSbMediaVideoCodecNone`. When `video_sample_info.codec` is
+    `kSbMediaVideoCodecNone`, the video is audio only.
+*   `SbPlayerOutputMode output_mode`
+
+    Selects how the decoded video frames will be output. For example,
+    `kSbPlayerOutputModePunchOut` indicates that the decoded video frames will
+    be output to a background video layer by the platform, and
+    `kSbPlayerOutputDecodeToTexture` indicates that the decoded video frames
+    should be made available for the application to pull via calls to
+    SbPlayerGetCurrentFrame().
+
 ### SbPlayerInfo2 ###
 
 Information about the current media playback state.
@@ -204,12 +222,6 @@
     is at normal speed. When it is greater than one, the video is played in a
     faster than normal speed. When it is less than one, the video is played in a
     slower than normal speed. Negative speeds are not supported.
-*   `SbTime buffer_start_timestamp`
-
-    The position of the buffer head, as precisely as possible, in microseconds.
-*   `SbTime buffer_duration`
-
-    The known duration of the currently playing media buffer, in microseconds.
 
 ### SbPlayerSampleInfo ###
 
@@ -237,39 +249,71 @@
 
 ## Functions ##
 
-### SbPlayerCreateWithUrl ###
+### SbPlayerCreate ###
 
-Creates a URL-based SbPlayer that will be displayed on `window` for the
-specified URL `url`, acquiring all resources needed to operate it, and returning
-an opaque handle to it. The expectation is that a new player will be created and
-destroyed for every playback.
+Creates a player that will be displayed on `window` for the specified
+`video_codec` and `audio_codec`, acquiring all resources needed to operate it,
+and returning an opaque handle to it. The expectation is that a new player will
+be created and destroyed for every playback.
 
-In many ways this function is similar to SbPlayerCreate, but it is missing the
-input arguments related to the configuration and format of the audio and video
-stream, as well as the DRM system. The DRM system for a player created with
-SbPlayerCreateWithUrl can be set after creation using SbPlayerSetDrmSystem.
-Because the DRM system is not available at the time of SbPlayerCreateWithUrl, it
-takes in a callback, `encrypted_media_init_data_encountered_cb`, which is run
-when encrypted media initial data is encountered.If the callback is `NULL`, then
-`kSbPlayerInvalid` must be returned.
+This function returns the created player. Note the following:
+
+*   The associated decoder of the returned player should be assumed to not be in
+    `kSbPlayerDecoderStateNeedsData` until SbPlayerSeek() has been called on it.
+
+*   It is expected either that the thread that calls SbPlayerCreate is the same
+    thread that calls the other `SbPlayer` functions for that player, or that
+    there is a mutex guarding calls into each `SbPlayer` instance.
+
+*   If there is a platform limitation on how many players can coexist
+    simultaneously, then calls made to this function that attempt to exceed that
+    limit must return `kSbPlayerInvalid`. Multiple calls to SbPlayerCreate must
+    not cause a crash.
+
+`window`: The window that will display the player. `window` can be
+`kSbWindowInvalid` for platforms where video is only displayed on a particular
+window that the underlying implementation already has access to.
+
+`video_codec`: The video codec used for the player. If `video_codec` is
+`kSbMediaVideoCodecNone`, the player is an audio-only player. If `video_codec`
+is any other value, the player is an audio/video decoder. This can be set to
+`kSbMediaVideoCodecNone` to play a video with only an audio track.
+
+`audio_codec`: The audio codec used for the player. The caller must provide a
+populated `audio_sample_info` if audio codec is `kSbMediaAudioCodecAac`. Can be
+set to `kSbMediaAudioCodecNone` to play a video without any audio track. In such
+case `audio_sample_info` must be NULL.
+
+`drm_system`: If the media stream has encrypted portions, then this parameter
+provides an appropriate DRM system, created with `SbDrmCreateSystem()`. If the
+stream does not have encrypted portions, then `drm_system` may be
+`kSbDrmSystemInvalid`. `audio_header`: `audio_header` is same as
+`audio_sample_info` in old starboard version. When `audio_codec` is
+`kSbMediaAudioCodecNone`, this must be set to NULL. Note that
+`audio_specific_config` is a pointer and the content it points to is no longer
+valid after this function returns. The implementation has to make a copy of the
+content if it is needed after the function returns.
 
 #### Declaration ####
 
 ```
-SbPlayer SbPlayerCreateWithUrl(const char *url, SbWindow window, SbPlayerStatusFunc player_status_func, SbPlayerEncryptedMediaInitDataEncounteredCB encrypted_media_init_data_encountered_cb, SbPlayerErrorFunc player_error_func, void *context)
+SbPlayer SbPlayerCreate(SbWindow window, const SbPlayerCreationParam *creation_param, SbPlayerDeallocateSampleFunc sample_deallocate_func, SbPlayerDecoderStatusFunc decoder_status_func, SbPlayerStatusFunc player_status_func, SbPlayerErrorFunc player_error_func, void *context, SbDecodeTargetGraphicsContextProvider *context_provider)
 ```
 
 ### SbPlayerDestroy ###
 
-Destroys `player`, freeing all associated resources. Each callback must receive
-one more callback to say that the player was destroyed. Callbacks may be in-
-flight when SbPlayerDestroy is called, and should be ignored once this function
-is called.
+Destroys `player`, freeing all associated resources.
 
-It is not allowed to pass `player` into any other `SbPlayer` function once
-SbPlayerDestroy has been called on that player.
+*   Upon calling this method, there should be one call to the player status
+    callback (i.e. `player_status_func` used in the creation of the player)
+    which indicates the player is destroyed. Note, the callback has to be in-
+    flight when SbPlayerDestroyed is called.
 
-`player`: The player to be destroyed.
+*   No more other callbacks should be issued after this function returns.
+
+*   It is not allowed to pass `player` into any other `SbPlayer` function once
+    SbPlayerDestroy has been called on that player. `player`: The player to be
+    destroyed.
 
 #### Declaration ####
 
@@ -327,6 +371,30 @@
 int SbPlayerGetMaximumNumberOfSamplesPerWrite(SbPlayer player, SbMediaType sample_type)
 ```
 
+### SbPlayerGetPreferredOutputMode ###
+
+Returns the preferred output mode of the implementation when a video described
+by `creation_param` is played. It is assumed that it is okay to call
+SbPlayerCreate() with the same video described by `creation_param`, with its
+`output_mode` member replaced by the returned output mode. When the caller has
+no preference on the output mode, it will set `creation_param->output_mode` to
+`kSbPlayerOutputModeInvalid`, and the implementation can return its preferred
+output mode based on the information contained in `creation_param`. The caller
+can also set `creation_param->output_mode` to its preferred output mode, and the
+implementation should return the same output mode if it is supported, otherwise
+the implementation should return an output mode that it is supported, as if
+`creation_param->output_mode` is set to `kSbPlayerOutputModeInvalid` prior to
+the call. Note that it is not the responsibility of this function to verify
+whether the video described by `creation_param` can be played on the platform,
+and the implementation should try its best effort to return a valid output mode.
+`creation_param` will never be NULL.
+
+#### Declaration ####
+
+```
+SbPlayerOutputMode SbPlayerGetPreferredOutputMode(const SbPlayerCreationParam *creation_param)
+```
+
 ### SbPlayerIsValid ###
 
 Returns whether the given player handle is valid.
@@ -337,18 +405,6 @@
 static bool SbPlayerIsValid(SbPlayer player)
 ```
 
-### SbPlayerOutputModeSupportedWithUrl ###
-
-Returns true if the given URL player output mode is supported by the platform.
-If this function returns true, it is okay to call SbPlayerCreate() with the
-given `output_mode`.
-
-#### Declaration ####
-
-```
-bool SbPlayerOutputModeSupportedWithUrl(SbPlayerOutputMode output_mode)
-```
-
 ### SbPlayerSetBounds ###
 
 Sets the player bounds to the given graphics plane coordinates. The changes do
@@ -376,17 +432,6 @@
 void SbPlayerSetBounds(SbPlayer player, int z_index, int x, int y, int width, int height)
 ```
 
-### SbPlayerSetDrmSystem ###
-
-Sets the DRM system of a running URL-based SbPlayer created with
-SbPlayerCreateWithUrl. This may only be run once for a given SbPlayer.
-
-#### Declaration ####
-
-```
-void SbPlayerSetDrmSystem(SbPlayer player, SbDrmSystem drm_system)
-```
-
 ### SbPlayerSetPlaybackRate ###
 
 Set the playback rate of the `player`. `rate` is default to 1.0 which indicates
@@ -439,42 +484,15 @@
 
 ### SbPlayerWriteSample2 ###
 
-Writes a single sample of the given media type to `player`'s input stream. Its
-data may be passed in via more than one buffers. The lifetime of
-`sample_buffers`, `sample_buffer_sizes`, `video_sample_info`, and
-`sample_drm_info` (as well as member `subsample_mapping` contained inside it)
-are not guaranteed past the call to SbPlayerWriteSample. That means that before
-returning, the implementation must synchronously copy any information it wants
-to retain from those structures.
-
-`player`: The player to which the sample is written. `sample_type`: The type of
-sample being written. See the `SbMediaType` enum in media.h. `sample_buffers`: A
-pointer to an array of buffers with `number_of_sample_buffers` elements that
-hold the data for this sample. The buffers are expected to be a portion of a
-bytestream of the codec type that the player was created with. The buffers
-should contain a sequence of whole NAL Units for video, or a complete audio
-frame. `sample_buffers` cannot be assumed to live past the call into
-SbPlayerWriteSample(), so it must be copied if its content will be used after
-SbPlayerWriteSample() returns. `sample_buffer_sizes`: A pointer to an array of
-sizes with `number_of_sample_buffers` elements. Each of them specify the number
-of bytes in the corresponding buffer contained in `sample_buffers`. None of them
-can be 0. `sample_buffer_sizes` cannot be assumed to live past the call into
-SbPlayerWriteSample(), so it must be copied if its content will be used after
-SbPlayerWriteSample() returns. `number_of_sample_buffers`: Specify the number of
-elements contained inside `sample_buffers` and `sample_buffer_sizes`. It has to
-be at least one, or the call will be ignored. `sample_pts`: The timestamp of the
-sample in 90KHz ticks (PTS). Note that samples MAY be written "slightly" out of
-order. `video_sample_info`: Information about a video sample. This value is
-required if `sample_type` is `kSbMediaTypeVideo`. Otherwise, it must be `NULL`.
-`sample_drm_info`: The DRM system related info for the media sample. This value
-is required for encrypted samples. Otherwise, it must be `NULL`.Writes samples
-of the given media type to `player`'s input stream. The lifetime of
-`sample_infos`, and the members of its elements like `buffer`,
+Writes samples of the given media type to `player`'s input stream. The lifetime
+of `sample_infos`, and the members of its elements like `buffer`,
 `video_sample_info`, and `drm_info` (as well as member `subsample_mapping`
 contained inside it) are not guaranteed past the call to SbPlayerWriteSample2.
 That means that before returning, the implementation must synchronously copy any
 information it wants to retain from those structures.
 
+SbPlayerWriteSample2 allows writing of multiple samples in one call.
+
 `player`: The player to which the sample is written. `sample_type`: The type of
 sample being written. See the `SbMediaType` enum in media.h. `sample_infos`: A
 pointer to an array of SbPlayerSampleInfo with `number_of_sample_infos`
diff --git a/src/cobalt/site/docs/reference/starboard/modules/10/queue.md b/src/cobalt/site/docs/reference/starboard/modules/10/queue.md
deleted file mode 100644
index 6fdf231..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/10/queue.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: queue.h"
----
-
-Defines a C++-only synchronized queue implementation, built entirely on top of
-Starboard synchronization primitives. It can be safely used by both clients and
-implementations.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/10/spin_lock.md b/src/cobalt/site/docs/reference/starboard/modules/10/spin_lock.md
deleted file mode 100644
index dc1989d..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/10/spin_lock.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: spin_lock.h"
----
-
-Defines a C++-only spin-lock implementation, built entirely on top of Starboard
-atomics and threads. It can be safely used by both clients and implementations.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/10/storage.md b/src/cobalt/site/docs/reference/starboard/modules/10/storage.md
index a2afdf5..c98207b 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/10/storage.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/10/storage.md
@@ -149,9 +149,7 @@
 `SbStorageCloseRecord()` is called.
 
 `record`: The record to be written to. `data`: The data to write to the record.
-`data_size`: The amount of `data`, in bytes, to write to the record. Thus, if
-`data_size` is smaller than the total size of `data`, only part of `data` is
-written to the record.
+`data_size`: The amount of `data`, in bytes, to write to the record.
 
 #### Declaration ####
 
diff --git a/src/cobalt/site/docs/reference/starboard/modules/10/system.md b/src/cobalt/site/docs/reference/starboard/modules/10/system.md
index 5958fb9..3c2acee 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/10/system.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/10/system.md
@@ -156,13 +156,6 @@
 
 #### Values ####
 
-*   `kSbSystemPropertyCertificationScope`
-
-    The certification scope that identifies a group of devices.
-*   `kSbSystemPropertyBase64EncodedCertificationSecret`
-
-    The HMAC-SHA256 base64 encoded symmetric key used to sign a subset of the
-    query parameters from the application startup URL.
 *   `kSbSystemPropertyChipsetModelNumber`
 
     The full model number of the main platform chipset, including any vendor-
@@ -306,11 +299,7 @@
 
 ### SbSystemClearPlatformError ###
 
-Clears a platform error that was previously raised by a call to
-`SbSystemRaisePlatformError`. The platform may use this, for example, to close a
-dialog that was opened in response to the error.
-
-`handle`: The platform error to be cleared.
+presubmit: allow sb_export mismatch
 
 #### Declaration ####
 
@@ -400,32 +389,6 @@
 int SbSystemGetNumberOfProcessors()
 ```
 
-### SbSystemGetPath ###
-
-Retrieves the platform-defined system path specified by `path_id` and places it
-as a zero-terminated string into the user-allocated `out_path` unless it is
-longer than `path_length` - 1. This implementation must be thread-safe.
-
-This function returns `true` if the path is retrieved successfully. It returns
-`false` under any of the following conditions and, in any such case, `out_path`
-is not changed:
-
-*   `path_id` is invalid for this platform
-
-*   `path_length` is too short for the given result
-
-*   `out_path` is NULL
-
-`path_id`: The system path to be retrieved. `out_path`: The platform-defined
-system path specified by `path_id`. `path_length`: The length of the system
-path.
-
-#### Declaration ####
-
-```
-bool SbSystemGetPath(SbSystemPathId path_id, char *out_path, int path_length)
-```
-
 ### SbSystemGetProperty ###
 
 Retrieves the platform-defined system property specified by `property_id` and
diff --git a/src/cobalt/site/docs/reference/starboard/modules/10/thread_types.md b/src/cobalt/site/docs/reference/starboard/modules/10/thread_types.md
deleted file mode 100644
index 5f4da0e..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/10/thread_types.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: thread_types.h"
----
-
-Defines platform-specific threading and synchronization primitive types and
-initializers. We hide, but pass through, the platform's primitives to avoid
-doing a lot of work to replicate initialization-less synchronization primitives.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/10/window.md b/src/cobalt/site/docs/reference/starboard/modules/10/window.md
index 9c84139..8355b67 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/10/window.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/10/window.md
@@ -163,19 +163,6 @@
 void SbWindowFocusOnScreenKeyboard(SbWindow window, int ticket)
 ```
 
-### SbWindowGetDiagonalSizeInInches ###
-
-Gets the size of the diagonal between two opposing screen corners.
-
-A return value of 0 means that starboard does not know what the screen diagonal
-is.
-
-#### Declaration ####
-
-```
-float SbWindowGetDiagonalSizeInInches(SbWindow window)
-```
-
 ### SbWindowGetOnScreenKeyboardBoundingRect ###
 
 Get the rectangle of the on screen keyboard in screen pixel coordinates. Return
@@ -251,7 +238,10 @@
 
 ### SbWindowSetDefaultOptions ###
 
-Sets the default options for system windows.
+Gets the size of the diagonal between two opposing screen corners.
+
+A return value of 0 means that starboard does not know what the screen diagonal
+is. Sets the default options for system windows.
 
 `options`: The option values to use as default values. This object must not be
 `NULL`.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/accessibility.md b/src/cobalt/site/docs/reference/starboard/modules/11/accessibility.md
similarity index 100%
rename from src/cobalt/site/docs/reference/starboard/modules/4/accessibility.md
rename to src/cobalt/site/docs/reference/starboard/modules/11/accessibility.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/11/atomic.md b/src/cobalt/site/docs/reference/starboard/modules/11/atomic.md
new file mode 100644
index 0000000..5f79990
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/11/atomic.md
@@ -0,0 +1,111 @@
+---
+layout: doc
+title: "Starboard Module Reference: atomic.h"
+---
+
+Defines a set of atomic integer operations that can be used as lightweight
+synchronization or as building blocks for heavier synchronization primitives.
+Their use is very subtle and requires detailed understanding of the behavior of
+supported architectures, so their direct use is not recommended except when
+rigorously deemed absolutely necessary for performance reasons.
+
+## Typedefs ##
+
+### SbAtomic64 ###
+
+64-bit atomic operations (only available on 64-bit processors).
+
+#### Definition ####
+
+```
+typedef int64_t SbAtomic64
+```
+
+### SbAtomicPtr ###
+
+Pointer-sized atomic operations. Forwards to either 32-bit or 64-bit functions
+as appropriate.
+
+#### Definition ####
+
+```
+typedef SbAtomic32 SbAtomicPtr
+```
+
+## Functions ##
+
+### SbAtomicAcquire_CompareAndSwap ###
+
+These following lower-level operations are typically useful only to people
+implementing higher-level synchronization operations like spinlocks, mutexes,
+and condition-variables. They combine CompareAndSwap(), a load, or a store with
+appropriate memory-ordering instructions. "Acquire" operations ensure that no
+later memory access can be reordered ahead of the operation. "Release"
+operations ensure that no previous memory access can be reordered after the
+operation. "Barrier" operations have both "Acquire" and "Release" semantics. A
+SbAtomicMemoryBarrier() has "Barrier" semantics, but does no memory access.
+
+#### Declaration ####
+
+```
+static SbAtomic32 SbAtomicAcquire_CompareAndSwap(volatile SbAtomic32 *ptr, SbAtomic32 old_value, SbAtomic32 new_value)
+```
+
+### SbAtomicBarrier_Increment ###
+
+Same as SbAtomicNoBarrier_Increment, but with a memory barrier.
+
+#### Declaration ####
+
+```
+static SbAtomic32 SbAtomicBarrier_Increment(volatile SbAtomic32 *ptr, SbAtomic32 increment)
+```
+
+### SbAtomicNoBarrier_CompareAndSwap ###
+
+Atomically execute: result = *ptr; if (*ptr == old_value) *ptr = new_value;
+return result;
+
+I.e., replace "*ptr" with "new_value" if "*ptr" used to be "old_value". Always
+return the old value of "*ptr"
+
+This routine implies no memory barriers.
+
+#### Declaration ####
+
+```
+static SbAtomic32 SbAtomicNoBarrier_CompareAndSwap(volatile SbAtomic32 *ptr, SbAtomic32 old_value, SbAtomic32 new_value)
+```
+
+### SbAtomicNoBarrier_Exchange ###
+
+Atomically store new_value into *ptr, returning the previous value held in *ptr.
+This routine implies no memory barriers.
+
+#### Declaration ####
+
+```
+static SbAtomic32 SbAtomicNoBarrier_Exchange(volatile SbAtomic32 *ptr, SbAtomic32 new_value)
+```
+
+### SbAtomicNoBarrier_Increment ###
+
+Atomically increment *ptr by "increment". Returns the new value of *ptr with the
+increment applied. This routine implies no memory barriers.
+
+#### Declaration ####
+
+```
+static SbAtomic32 SbAtomicNoBarrier_Increment(volatile SbAtomic32 *ptr, SbAtomic32 increment)
+```
+
+### SbAtomicRelease_CompareAndSwap8 ###
+
+Overloaded functions for Atomic8.
+
+#### Declaration ####
+
+```
+static SbAtomic8 SbAtomicRelease_CompareAndSwap8(volatile SbAtomic8 *ptr, SbAtomic8 old_value, SbAtomic8 new_value)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/11/audio_sink.md b/src/cobalt/site/docs/reference/starboard/modules/11/audio_sink.md
new file mode 100644
index 0000000..45d0469
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/11/audio_sink.md
@@ -0,0 +1,171 @@
+---
+layout: doc
+title: "Starboard Module Reference: audio_sink.h"
+---
+
+Provides an interface to output raw audio data.
+
+## Macros ##
+
+### kSbAudioSinkInvalid ###
+
+Well-defined value for an invalid audio sink.
+
+## Typedefs ##
+
+### SbAudioSink ###
+
+An opaque handle to an implementation-private structure representing an audio
+sink.
+
+#### Definition ####
+
+```
+typedef struct SbAudioSinkPrivate* SbAudioSink
+```
+
+### SbAudioSinkConsumeFramesFunc ###
+
+Callback used to report frames consumed. The consumed frames will be removed
+from the source frame buffer to free space for new audio frames. When
+`frames_consumed` is updated asynchnously and the last time that it has been
+updated is known, it can be passed in `frames_consumed_at` so the audio time
+calculating can be more accurate.
+
+#### Definition ####
+
+```
+typedef void(* SbAudioSinkConsumeFramesFunc) (int frames_consumed, SbTime frames_consumed_at, void *context)
+```
+
+### SbAudioSinkFrameBuffers ###
+
+An array of frame buffers. For interleaved audio streams, there will be only one
+element in the array. For planar audio streams, the number of elements in the
+array equal to the number of channels.
+
+#### Definition ####
+
+```
+typedef void** SbAudioSinkFrameBuffers
+```
+
+### SbAudioSinkUpdateSourceStatusFunc ###
+
+Callback being called periodically to retrieve the status of the audio source.
+The first two output parameters indicating the filling level of the audio frame
+buffer passed to SbAudioSinkCreate as `frame_buffers`. As `frame_buffers` is a
+circular buffer, `offset_in_frames` can be used to calculate the number of
+continuous frames towards the end of the buffer. The audio sink can play the
+frames only when `is_playing` is true. It should pause the playback when
+`is_playing` is false. The audio sink may cache certain amount of audio frames
+before start playback. It will start playback immediately when `is_eos_reached`
+is true even if the amount of cached audio frames are not enough as no more
+frames will be appended into the buffer when `is_eos_reached` is true. It is
+possible for a host to set `is_eos_reached` to false after setting it to true,
+usually this is caused by a seek. All parameters except `context` cannot be
+NULL. Note that this function only reports the status of the source, it doesn't
+remove audio data from the source frame buffer.
+
+#### Definition ####
+
+```
+typedef void(* SbAudioSinkUpdateSourceStatusFunc) (int *frames_in_buffer, int *offset_in_frames, bool *is_playing, bool *is_eos_reached, void *context)
+```
+
+## Functions ##
+
+### SbAudioSinkDestroy ###
+
+Destroys `audio_sink`, freeing all associated resources. Before returning, the
+function waits until all callbacks that are in progress have finished. After the
+function returns, no further calls are made callbacks passed into
+SbAudioSinkCreate. In addition, you can not pass `audio_sink` to any other
+SbAudioSink functions after SbAudioSinkDestroy has been called on it.
+
+This function can be called on any thread. However, it cannot be called within
+any of the callbacks passed into SbAudioSinkCreate.
+
+`audio_sink`: The audio sink to destroy.
+
+#### Declaration ####
+
+```
+void SbAudioSinkDestroy(SbAudioSink audio_sink)
+```
+
+### SbAudioSinkGetMaxChannels ###
+
+Returns the maximum number of channels supported on the platform. For example,
+the number would be `2` if the platform only supports stereo.
+
+#### Declaration ####
+
+```
+int SbAudioSinkGetMaxChannels()
+```
+
+### SbAudioSinkGetMinBufferSizeInFrames ###
+
+Returns the minimum frames required by audio sink to play without underflows.
+Returns -1, if `channels`, `sample_type` or `sampling_frequency_hz` is not
+supported. It's user's responsibility to ensure that there're enough frames
+written into audio sink during playing, or it may have underflows.
+
+`channels`: The number of audio channels, such as left and right channels in
+stereo audio. `audio_sample_type`: The type of each sample of the audio data –
+`int16`, `float32`, etc. `sampling_frequency_hz`: The sample frequency of the
+audio data being streamed. For example, 22,000 Hz means 22,000 sample elements
+represents one second of audio data.
+
+#### Declaration ####
+
+```
+int SbAudioSinkGetMinBufferSizeInFrames(int channels, SbMediaAudioSampleType sample_type, int sampling_frequency_hz)
+```
+
+### SbAudioSinkGetNearestSupportedSampleFrequency ###
+
+Returns the supported sample rate closest to `sampling_frequency_hz`. On
+platforms that don't support all sample rates, it is the caller's responsibility
+to resample the audio frames into the supported sample rate returned by this
+function.
+
+#### Declaration ####
+
+```
+int SbAudioSinkGetNearestSupportedSampleFrequency(int sampling_frequency_hz)
+```
+
+### SbAudioSinkIsAudioFrameStorageTypeSupported ###
+
+Indicates whether `audio_frame_storage_type` is supported on this platform.
+
+#### Declaration ####
+
+```
+bool SbAudioSinkIsAudioFrameStorageTypeSupported(SbMediaAudioFrameStorageType audio_frame_storage_type)
+```
+
+### SbAudioSinkIsAudioSampleTypeSupported ###
+
+Indicates whether `audio_sample_type` is supported on this platform.
+
+#### Declaration ####
+
+```
+bool SbAudioSinkIsAudioSampleTypeSupported(SbMediaAudioSampleType audio_sample_type)
+```
+
+### SbAudioSinkIsValid ###
+
+Indicates whether the given audio sink handle is valid.
+
+`audio_sink`: The audio sink handle to check.
+
+#### Declaration ####
+
+```
+bool SbAudioSinkIsValid(SbAudioSink audio_sink)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/11/blitter.md b/src/cobalt/site/docs/reference/starboard/modules/11/blitter.md
new file mode 100644
index 0000000..b35275f
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/11/blitter.md
@@ -0,0 +1,300 @@
+---
+layout: doc
+title: "Starboard Module Reference: blitter.h"
+---
+
+The Blitter API provides support for issuing simple blit-style draw commands to
+either an offscreen surface or to a Starboard `SbWindow` object. Blitter is
+jargon that means "BLock Transfer," which might be abbreviated as BLT and,
+hence, the word "blit."
+
+This API is designed to allow implementations make use of GPU hardware
+acceleration, if it is available. Draw commands exist for solid-color rectangles
+and rasterization/blitting of rectangular images onto rectangular target
+patches.
+Threading Concerns
+
+Note that in general the Blitter API is not thread safe, except for all
+`SbBlitterDevice`-related functions. All functions that are not required to
+internally ensure any thread safety guarantees are prefaced with a comment
+indicating that they are not thread safe.
+
+Functions which claim to not be thread safe can still be used from multiple
+threads, but manual synchronization must be performed in order to ensure their
+parameters are not referenced at the same time on another thread by another
+function.
+Examples
+
+*   Multiple threads should not issue commands to the same `SbBlitterContext`
+    object unless they are manually synchronized.
+
+*   Multiple threads should not issue draw calls to the same render target, even
+    if the draw calls are made within separate contexts. In this case, be sure
+    to manually synchronize through the use of syncrhonization primitives and
+    use of the `SbBlitterFlushContext()` command.
+
+*   Multiple threads can operate on the swap chain, but they must perform manual
+    synchronization.
+
+## Enums ##
+
+### SbBlitterPixelDataFormat ###
+
+Defines the set of pixel formats that can be used with the Blitter API
+`SbBlitterPixelData` objects. Note that not all of these formats are guaranteed
+to be supported by a particular device, so before using these formats in pixel
+data creation commands, it should be checked that they are supported first (e.g.
+via `SbBlitterIsPixelFormatSupportedByPixelData()`). `SbBlitterPixelDataFormat`
+specifies specific orderings of the color channels, and when doing so, byte-
+order is used, e.g. "RGBA" implies that a value for red is stored in the byte
+with the lowest memory address. All pixel values are assumed to be in
+premultiplied alpha format.
+
+#### Values ####
+
+*   `kSbBlitterPixelDataFormatARGB8`
+
+    32-bit pixels with 8-bits per channel, the alpha component in the byte with
+    the lowest address and blue in the byte with the highest address.
+*   `kSbBlitterPixelDataFormatBGRA8`
+
+    32-bit pixels with 8-bits per channel, the blue component in the byte with
+    the lowest address and alpha in the byte with the highest address.
+*   `kSbBlitterPixelDataFormatRGBA8`
+
+    32-bit pixels with 8-bits per channel, the red component in the byte with
+    the lowest address and alpha in the byte with the highest address.
+*   `kSbBlitterPixelDataFormatA8`
+
+    8-bit pixels that contain only a single alpha channel. When rendered,
+    surfaces in this format will have `(R, G, B)` values of `(255, 255, 255)`.
+*   `kSbBlitterNumPixelDataFormats`
+
+    Constant that indicates how many unique pixel formats Starboard supports.
+*   `kSbBlitterInvalidPixelDataFormat`
+
+### SbBlitterSurfaceFormat ###
+
+Enumeration that describes the color format of surfaces. Note that
+`SbBlitterSurfaceFormat` does not differentiate between permutations of the
+color channel ordering (e.g. RGBA vs ARGB) since client code will never be able
+to access surface pixels directly. This is the main difference between
+`SbBlitterPixelDataFormat`, which does explicitly dictate an ordering.
+
+#### Values ####
+
+*   `kSbBlitterSurfaceFormatRGBA8`
+
+    32-bit RGBA color, with 8 bits per channel.
+*   `kSbBlitterSurfaceFormatA8`
+
+    8-bit alpha-only color.
+*   `kSbBlitterNumSurfaceFormats`
+
+    Constant that indicates how many unique surface formats Starboard supports.
+*   `kSbBlitterInvalidSurfaceFormat`
+
+## Typedefs ##
+
+### SbBlitterColor ###
+
+A simple 32-bit color representation that is a parameter to many Blitter
+functions.
+
+#### Definition ####
+
+```
+typedef uint32_t SbBlitterColor
+```
+
+## Structs ##
+
+### SbBlitterRect ###
+
+Defines a rectangle via a point `(x, y)` and a size `(width, height)`. This
+structure is used as a parameter type in various blit calls.
+
+#### Members ####
+
+*   `int x`
+*   `int y`
+*   `int width`
+*   `int height`
+
+### SbBlitterSurfaceInfo ###
+
+`SbBlitterSurfaceInfo` collects information about surfaces that can be queried
+from them at any time.
+
+#### Members ####
+
+*   `int width`
+*   `int height`
+*   `SbBlitterSurfaceFormat format`
+
+## Functions ##
+
+### SB_DEPRECATED ###
+
+This function achieves the same effect as calling `SbBlitterBlitRectToRect()`
+`num_rects` times with each of the `num_rects` values of `src_rects` and
+`dst_rects`. This function allows for greater efficiency than looped calls to
+`SbBlitterBlitRectToRect()`.
+
+This function is not thread-safe.
+
+The return value indicates whether the draw call succeeded.
+
+#### Declaration ####
+
+```
+SB_DEPRECATED(bool SbBlitterBlitRectsToRects(SbBlitterContext context, SbBlitterSurface source_surface, const SbBlitterRect *src_rects, const SbBlitterRect *dst_rects, int num_rects))
+```
+
+### SbBlitterAFromColor ###
+
+Extract alpha from a `SbBlitterColor` object.
+
+#### Declaration ####
+
+```
+static uint8_t SbBlitterAFromColor(SbBlitterColor color)
+```
+
+### SbBlitterBFromColor ###
+
+Extract blue from a `SbBlitterColor` object.
+
+#### Declaration ####
+
+```
+static uint8_t SbBlitterBFromColor(SbBlitterColor color)
+```
+
+### SbBlitterBytesPerPixelForFormat ###
+
+A convenience function to return the number of bytes per pixel for a given pixel
+format.
+
+#### Declaration ####
+
+```
+static int SbBlitterBytesPerPixelForFormat(SbBlitterPixelDataFormat format)
+```
+
+### SbBlitterColorFromRGBA ###
+
+A convenience function to create a `SbBlitterColor` object from separate 8-bit
+RGBA components.
+
+#### Declaration ####
+
+```
+static SbBlitterColor SbBlitterColorFromRGBA(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
+```
+
+### SbBlitterGFromColor ###
+
+Extract green from a `SbBlitterColor` object.
+
+#### Declaration ####
+
+```
+static uint8_t SbBlitterGFromColor(SbBlitterColor color)
+```
+
+### SbBlitterIsContextValid ###
+
+Checks whether a blitter context is invalid.
+
+#### Declaration ####
+
+```
+static bool SbBlitterIsContextValid(SbBlitterContext context)
+```
+
+### SbBlitterIsDeviceValid ###
+
+Checks whether a blitter device is invalid.
+
+#### Declaration ####
+
+```
+static bool SbBlitterIsDeviceValid(SbBlitterDevice device)
+```
+
+### SbBlitterIsPixelDataValid ###
+
+Checks whether a pixel data object is invalid.
+
+#### Declaration ####
+
+```
+static bool SbBlitterIsPixelDataValid(SbBlitterPixelData pixel_data)
+```
+
+### SbBlitterIsRenderTargetValid ###
+
+Checks whether a render target is invalid.
+
+#### Declaration ####
+
+```
+static bool SbBlitterIsRenderTargetValid(SbBlitterRenderTarget render_target)
+```
+
+### SbBlitterIsSurfaceValid ###
+
+Checks whether a surface is invalid.
+
+#### Declaration ####
+
+```
+static bool SbBlitterIsSurfaceValid(SbBlitterSurface surface)
+```
+
+### SbBlitterIsSwapChainValid ###
+
+Checks whether a swap chain is invalid.
+
+#### Declaration ####
+
+```
+static bool SbBlitterIsSwapChainValid(SbBlitterSwapChain swap_chain)
+```
+
+### SbBlitterMakeRect ###
+
+Convenience function to setup a rectangle with the specified parameters.
+
+#### Declaration ####
+
+```
+static SbBlitterRect SbBlitterMakeRect(int x, int y, int width, int height)
+```
+
+### SbBlitterPixelDataFormatToSurfaceFormat ###
+
+This function maps SbBlitterPixelDataFormat values to their corresponding
+`SbBlitterSurfaceFormat` value. Note that many `SbBlitterPixelDataFormat`s
+correspond to the same `SbBlitterSurfaceFormat`, so this function is not
+invertible. When creating a `SbBlitterSurface` object from a
+`SbBlitterPixelData` object, the `SbBlitterSurface`'s format will be computed
+from the `SbBlitterPixelData` object by using this function.
+
+#### Declaration ####
+
+```
+static SbBlitterSurfaceFormat SbBlitterPixelDataFormatToSurfaceFormat(SbBlitterPixelDataFormat pixel_format)
+```
+
+### SbBlitterRFromColor ###
+
+Extract red from a `SbBlitterColor` object.
+
+#### Declaration ####
+
+```
+static uint8_t SbBlitterRFromColor(SbBlitterColor color)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/byte_swap.md b/src/cobalt/site/docs/reference/starboard/modules/11/byte_swap.md
similarity index 100%
rename from src/cobalt/site/docs/reference/starboard/modules/4/byte_swap.md
rename to src/cobalt/site/docs/reference/starboard/modules/11/byte_swap.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/character.md b/src/cobalt/site/docs/reference/starboard/modules/11/character.md
similarity index 100%
rename from src/cobalt/site/docs/reference/starboard/modules/4/character.md
rename to src/cobalt/site/docs/reference/starboard/modules/11/character.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/condition_variable.md b/src/cobalt/site/docs/reference/starboard/modules/11/condition_variable.md
similarity index 100%
rename from src/cobalt/site/docs/reference/starboard/modules/4/condition_variable.md
rename to src/cobalt/site/docs/reference/starboard/modules/11/condition_variable.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/11/configuration.md b/src/cobalt/site/docs/reference/starboard/modules/11/configuration.md
new file mode 100644
index 0000000..78739ad
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/11/configuration.md
@@ -0,0 +1,205 @@
+---
+layout: doc
+title: "Starboard Module Reference: configuration.h"
+---
+
+Provides a description of the current platform in lurid detail so that common
+code never needs to actually know what the current operating system and
+architecture are.
+
+It is both very pragmatic and canonical in that if any application code finds
+itself needing to make a platform decision, it should always define a Starboard
+Configuration feature instead. This implies the continued existence of very
+narrowly-defined configuration features, but it retains porting control in
+Starboard.
+
+## Macros ##
+
+### SB_ALIGNAS(byte_alignment) ###
+
+Specifies the alignment for a class, struct, union, enum, class/struct field, or
+stack variable.
+
+### SB_ALIGNOF(type) ###
+
+Returns the alignment reqiured for any instance of the type indicated by `type`.
+
+### SB_ARRAY_SIZE(array) ###
+
+A constant expression that evaluates to the size_t size of a statically-sized
+array.
+
+### SB_ARRAY_SIZE_INT(array) ###
+
+A constant expression that evaluates to the int size of a statically-sized
+array.
+
+### SB_CAN(SB_FEATURE) ###
+
+Determines a compile-time capability of the system.
+
+### SB_COMPILE_ASSERT(expr, msg) ###
+
+Will cause a compiler error with `msg` if `expr` is false. `msg` must be a valid
+identifier, and must be a unique type in the scope of the declaration.
+
+### SB_DEPRECATED(FUNC) ###
+
+SB_DEPRECATED(int Foo(int bar)); Annotates the function as deprecated, which
+will trigger a compiler warning when referenced.
+
+### SB_DEPRECATED_EXTERNAL(FUNC) ###
+
+SB_DEPRECATED_EXTERNAL(...) annotates the function as deprecated for external
+clients, but not deprecated for starboard.
+
+### SB_DISALLOW_COPY_AND_ASSIGN(TypeName) ###
+
+A macro to disallow the copy constructor and operator= functions This should be
+used in the private: declarations for a class
+
+### SB_EXPERIMENTAL_API_VERSION ###
+
+The API version that is currently open for changes, and therefore is not stable
+or frozen. Production-oriented ports should avoid declaring that they implement
+the experimental Starboard API version.
+
+### SB_FUNCTION ###
+
+Whether we use **PRETTY_FUNCTION** PRETTY_FUNCTION or **FUNCTION** FUNCTION for
+logging.
+
+### SB_HAS(SB_FEATURE) ###
+
+Determines at compile-time whether this platform has a standard feature or
+header available.
+
+### SB_HAS_64_BIT_ATOMICS ###
+
+Whether the current platform has 64-bit atomic operations.
+
+### SB_HAS_AUDIO_SPECIFIC_CONFIG_AS_POINTER ###
+
+Deprecated feature macros These feature macros are deprecated in Starboard
+version 6 and later, and are no longer referenced by application code. They will
+be removed in a future version. Any Starboard implementation that supports
+Starboard version 6 or later should be modified to no longer depend on these
+macros, with the assumption that their values are always 1.
+
+### SB_HAS_GLES2 ###
+
+Specifies whether this platform has a performant OpenGL ES 2 implementation,
+which allows client applications to use GL rendering paths. Derived from the gyp
+variable `gl_type` gl_type which indicates what kind of GL implementation is
+available.
+
+### SB_HAS_GRAPHICS ###
+
+Specifies whether this platform has any kind of supported graphics system.
+
+### SB_HAS_MEDIA_IS_VIDEO_SUPPORTED_REFINEMENT ###
+
+Legal values for SB_PREFERRED_RGBA_BYTE_ORDER are defined in this file above as
+SB_PREFERRED_RGBA_BYTE_ORDER_*. If your platform uses GLES, you should set this
+to SB_PREFERRED_RGBA_BYTE_ORDER_RGBA.
+
+### SB_HAS_QUIRK(SB_FEATURE) ###
+
+Determines at compile-time whether this platform has a quirk.
+
+### SB_INT64_C(x) ###
+
+Declare numeric literals of signed 64-bit type.
+
+### SB_IS(SB_FEATURE) ###
+
+Determines at compile-time an inherent aspect of this platform.
+
+### SB_IS_LITTLE_ENDIAN ###
+
+Whether the current platform is little endian.
+
+### SB_LIKELY(x) ###
+
+Macro for hinting that an expression is likely to be true.
+
+### SB_MAXIMUM_API_VERSION ###
+
+The maximum API version allowed by this version of the Starboard headers,
+inclusive.
+
+### SB_MINIMUM_API_VERSION ###
+
+The minimum API version allowed by this version of the Starboard headers,
+inclusive.
+
+### SB_NORETURN ###
+
+Macro to annotate a function as noreturn, which signals to the compiler that the
+function cannot return.
+
+### SB_OVERRIDE ###
+
+Declares a function as overriding a virtual function on compilers that support
+it.
+
+### SB_PREFERRED_RGBA_BYTE_ORDER_RGBA ###
+
+An enumeration of values for the kSbPreferredByteOrder configuration variable.
+Setting this up properly means avoiding slow color swizzles when passing pixel
+data from one library to another. Note that these definitions are in byte-order
+and so are endianness-independent.
+
+### SB_PRINTF_FORMAT(format_param, dots_param) ###
+
+Tells the compiler a function is using a printf-style format string.
+`format_param` is the one-based index of the format string parameter;
+`dots_param` is the one-based index of the "..." parameter. For v*printf
+functions (which take a va_list), pass 0 for dots_param. (This is undocumented
+but matches what the system C headers do.) (Partially taken from
+base/compiler_specific.h)
+
+### SB_RELEASE_CANDIDATE_API_VERSION ###
+
+The next API version to be frozen, but is still subject to emergency changes. It
+is reasonable to base a port on the Release Candidate API version, but be aware
+that small incompatible changes may still be made to it. The following will be
+uncommented when an API version is a release candidate.
+
+### SB_RESTRICT ###
+
+Include the platform-specific configuration. This macro is set by GYP in
+starboard_base_target.gypi and passed in on the command line for all targets and
+all configurations. After version 12, we start to use runtime constants instead
+of macros for certain platform dependent configurations. This file substitutes
+configuration macros for the corresponding runtime constants so we don't
+reference these constants when they aren't defined. Makes a pointer-typed
+parameter restricted so that the compiler can make certain optimizations because
+it knows the pointers are unique.
+
+### SB_SIZE_OF(DATATYPE) ###
+
+Determines at compile-time the size of a data type, or 0 if the data type that
+was specified was invalid.
+
+### SB_STRINGIFY(x) ###
+
+Standard CPP trick to stringify an evaluated macro definition.
+
+### SB_UINT64_C(x) ###
+
+Declare numeric literals of unsigned 64-bit type.
+
+### SB_UNLIKELY(x) ###
+
+Macro for hinting that an expression is likely to be false.
+
+### SB_UNREFERENCED_PARAMETER(x) ###
+
+Trivially references a parameter that is otherwise unreferenced, preventing a
+compiler warning on some platforms.
+
+### SB_WARN_UNUSED_RESULT ###
+
+Causes the annotated (at the end) function to generate a warning if the result
+is not accessed.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/11/cpu_features.md b/src/cobalt/site/docs/reference/starboard/modules/11/cpu_features.md
new file mode 100644
index 0000000..7847ee2
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/11/cpu_features.md
@@ -0,0 +1,256 @@
+---
+layout: doc
+title: "Starboard Module Reference: cpu_features.h"
+---
+
+## Structs ##
+
+### SbCPUFeatures ###
+
+#### Members ####
+
+*   `SbCPUFeaturesArchitecture architecture`
+
+    Architecture of the processor.
+*   `const char * brand`
+
+    Processor brand string retrievable by CPUID or from /proc/cpuinfo under the
+    key "model name" or "Processor".
+*   `int32_t icache_line_size`
+
+    Processor cache line size in bytes of Level 1 instruction cache and data
+    cache. Queried by sysconf(_SC_LEVEL1_ICACHE_LINESIZE) and
+    sysconf(_SC_LEVEL1_DCACHE_LINESIZE), or from files /proc/cpuinfo,
+    /proc/self/auxv, or CPUID with CLFLUSH instruction.
+*   `int32_t dcache_line_size`
+*   `bool has_fpu`
+
+    Processor has floating-point unit on-chip.
+*   `uint32_t hwcap`
+
+    Bit-mask containing processor features flags. Queried by getauxval(AT_HWCAP)
+    if it is supported.
+*   `uint32_t hwcap2`
+
+    Similar to hwcap. Queried by getauxval(AT_HWCAP2) if it is supported.
+*   `SbCPUFeaturesARM arm`
+
+    Processor features specific to each architecture. Set the appropriate
+    `SbCPUFeatures<ARCH_NAME>` for the underlying architecture. Set the other
+    `SbCPUFeatures<OTHER_ARCH>` to be invalid, meaning:
+
+    *   '-1' for signed integer fields
+
+    *   'false' for feature flag fields
+
+    *   '0' for feature flag bitmasks
+
+    *   empty string for string fields
+
+*   `SbCPUFeaturesMIPS mips_arch`
+
+    The reason that the "_arch" suffix exists for mips is because on some
+    platforms that use MIPS as the underlying architecture, "mips" is already
+    defined as a macro.
+*   `SbCPUFeaturesX86 x86`
+
+### SbCPUFeaturesARM ###
+
+#### Members ####
+
+*   `int16_t implementer`
+
+    Processor implementer/implementor code. ARM is 0x41, NVIDIA is 0x4e, etc.
+*   `int16_t variant`
+
+    Processor variant number, indicating the major revision number.
+*   `int16_t revision`
+
+    Processor revision number, indicating the minor revision number.
+*   `int16_t architecture_generation`
+
+    Processor architecture generation number, indicating the generations
+    (ARMv6-M, ARMv7, etc) within an architecture family. This field is called
+    "Architecture" or "Constant" in the processor ID register.
+*   `int16_t part`
+
+    Processor part number, indicating Cortex-M0, Cortex-A8, etc.
+*   `bool has_neon`
+
+    ARM Advanced SIMD (NEON) vector instruction set extension.
+*   `bool has_thumb2`
+
+    Thumb-2 mode.
+*   `bool has_vfp`
+
+    VFP (SIMD vector floating point instructions).
+*   `bool has_vfp3`
+
+    VFP version 3
+*   `bool has_vfp3_d32`
+
+    VFP version 3 with 32 D-registers.
+*   `bool has_idiva`
+
+    SDIV and UDIV hardware division in ARM mode.
+*   `bool has_aes`
+
+    Arm 64 feature flags
+
+    AES instructions.
+*   `bool has_crc32`
+
+    CRC32 instructions.
+*   `bool has_sha1`
+
+    SHA-1 instructions.
+*   `bool has_sha2`
+
+    SHA-256 instructions.
+*   `bool has_pmull`
+
+    64-bit PMULL and PMULL2 instructions.
+
+### SbCPUFeaturesMIPS ###
+
+#### Members ####
+
+*   `bool has_msa`
+
+    MIPS SIMD Architecture (MSA).
+
+### SbCPUFeaturesX86 ###
+
+#### Members ####
+
+*   `const char * vendor`
+
+    Processor vendor ID string, e.g. "GenuineIntel", "AuthenticAMD", etc
+*   `int16_t family`
+
+    Processor family ID
+*   `int16_t ext_family`
+
+    Processor extended family ID, needs to be examined only when the family ID
+    is 0FH.
+*   `int16_t model`
+
+    Processor model ID
+*   `int16_t ext_model`
+
+    Processor extended model ID, needs to be examined only when the family ID is
+    06H or 0FH.
+*   `int16_t stepping`
+
+    Processor stepping ID, a product revision number
+*   `int16_t type`
+
+    Processor type ID
+*   `int32_t signature`
+
+    A raw form of collection of processor stepping, model, and family
+    information
+*   `bool has_cmov`
+
+    Conditional Move Instructions (plus FCMOVcc, FCOMI with FPU).
+*   `bool has_mmx`
+
+    Multimedia extensions.
+*   `bool has_sse`
+
+    SSE (Streaming SIMD Extensions).
+*   `bool has_sse2`
+
+    SSE2 extensions.
+*   `bool has_tsc`
+
+    Time Stamp Counter.
+*   `bool has_sse3`
+
+    SSE3 extensions.
+*   `bool has_ssse3`
+
+    Supplemental SSE3 extensions.
+*   `bool has_sse41`
+
+    SSE-4.1 extensions.
+*   `bool has_sse42`
+
+    SSE-4.2 extensions.
+*   `bool has_movbe`
+
+    MOVBE instruction.
+*   `bool has_popcnt`
+
+    POPCNT instruction.
+*   `bool has_osxsave`
+
+    XSAVE/XRSTOR/XGETBV/XSETBV instruction enabled in this OS.
+*   `bool has_avx`
+
+    AVX (Advanced Vector Extensions).
+*   `bool has_f16c`
+
+    16-bit FP conversions.
+*   `bool has_fma3`
+
+    Fused multiply-add.
+*   `bool has_aesni`
+
+    AES new instructions (AES-NI).
+*   `bool has_avx2`
+
+    AVX2 Extensions.
+*   `bool has_avx512f`
+
+    AVX-512 Foundation.
+*   `bool has_avx512dq`
+
+    AVX-512 DQ (Double/Quad granular) Instructions.
+*   `bool has_avx512ifma`
+
+    AVX-512 Integer Fused Multiply-Add instructions.
+*   `bool has_avx512pf`
+
+    AVX-512 Prefetch.
+*   `bool has_avx512er`
+
+    AVX-512 Exponential and Reciprocal.
+*   `bool has_avx512cd`
+
+    AVX-512 Conflict Detection.
+*   `bool has_avx512bw`
+
+    AVX-512 BW (Byte/Word granular) Instructions.
+*   `bool has_avx512vl`
+
+    AVX-512 VL (128/256 Vector Length) Extensions.
+*   `bool has_bmi1`
+
+    First group of bit manipulation extensions.
+*   `bool has_bmi2`
+
+    Second group of bit manipulation extensions.
+*   `bool has_lzcnt`
+
+    Bit manipulation instruction LZCNT.
+*   `bool has_sahf`
+
+    SAHF in long mode.
+
+## Functions ##
+
+### SbCPUFeaturesGet ###
+
+Retrieve the underlying CPU features and place it in `features`, which must not
+be NULL.
+
+If this function returns false, it means the CPU architecture is unknown and all
+fields in `features` are invalid.
+
+#### Declaration ####
+
+```
+bool SbCPUFeaturesGet(SbCPUFeatures *features)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/11/cryptography.md b/src/cobalt/site/docs/reference/starboard/modules/11/cryptography.md
new file mode 100644
index 0000000..0b9442b
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/11/cryptography.md
@@ -0,0 +1,234 @@
+---
+layout: doc
+title: "Starboard Module Reference: cryptography.h"
+---
+
+Hardware-accelerated cryptography. Platforms should **only** only implement this
+when there are **hardware-accelerated** hardware-accelerated cryptography
+facilities. Applications must fall back to platform-independent CPU-based
+algorithms if the cipher algorithm isn't supported in hardware.
+Tips for Porters
+
+You should implement cipher algorithms in this descending order of priority to
+maximize usage for SSL.
+
+1.  GCM - The preferred block cipher mode for OpenSSL, mainly due to speed.
+
+1.  CTR - This can be used internally with GCM, as long as the CTR
+    implementation only uses the last 4 bytes of the IV for the counter. (i.e.
+    96-bit IV, 32-bit counter)
+
+1.  ECB - This can be used (with a null IV) with any of the other cipher block
+    modes to accelerate the core AES algorithm if none of the streaming modes
+    can be accelerated.
+
+1.  CBC - GCM is always preferred if the server and client both support it. If
+    not, they will generally negotiate down to AES-CBC. If this happens, and CBC
+    is supported by SbCryptography, then it will be accelerated appropriately.
+    But, most servers should support GCM, so it is not likely to come up much,
+    which is why it is the lowest priority.
+
+Further reading on block cipher modes:
+
+[https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation)
+
+[https://crbug.com/442572](https://crbug.com/442572)
+
+[https://crypto.stackexchange.com/questions/10775/practical-disadvantages-of-gcm-mode-encryption](https://crypto.stackexchange.com/questions/10775/practical-disadvantages-of-gcm-mode-encryption)
+
+## Macros ##
+
+### kSbCryptographyAlgorithmAes ###
+
+String literal for the AES symmetric block cipher. [https://en.wikipedia.org/wiki/Advanced_Encryption_Standard](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard)
+
+### kSbCryptographyInvalidTransformer ###
+
+Well-defined value for an invalid transformer.
+
+## Enums ##
+
+### SbCryptographyBlockCipherMode ###
+
+The method of chaining encrypted blocks in a sequence. [https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation)
+
+#### Values ####
+
+*   `kSbCryptographyBlockCipherModeCbc`
+
+    Cipher Block Chaining mode.
+*   `kSbCryptographyBlockCipherModeCfb`
+
+    Cipher Feedback mode.
+*   `kSbCryptographyBlockCipherModeCtr`
+
+    Counter mode: A nonce is combined with an increasing counter.
+*   `kSbCryptographyBlockCipherModeEcb`
+
+    Electronic Code Book mode: No chaining.
+*   `kSbCryptographyBlockCipherModeOfb`
+
+    Output Feedback mode.
+*   `kSbCryptographyBlockCipherModeGcm`
+
+    Galois/Counter Mode.
+
+### SbCryptographyDirection ###
+
+The direction of a cryptographic transformation.
+
+#### Values ####
+
+*   `kSbCryptographyDirectionEncode`
+
+    Cryptographic transformations that encode/encrypt data into a target format.
+*   `kSbCryptographyDirectionDecode`
+
+    Cryptographic transformations that decode/decrypt data into its original
+    form.
+
+## Typedefs ##
+
+### SbCryptographyTransformer ###
+
+A handle to a cryptographic transformer.
+
+#### Definition ####
+
+```
+typedef SbCryptographyTransformerPrivate* SbCryptographyTransformer
+```
+
+## Functions ##
+
+### SbCryptographyCreateTransformer ###
+
+Creates an SbCryptographyTransformer with the given initialization data. It can
+then be used to transform a series of data blocks. Returns
+kSbCryptographyInvalidTransformer if the algorithm isn't supported, or if the
+parameters are not compatible with the algorithm.
+
+An SbCryptographyTransformer contains all state to start decrypting a sequence
+of cipher blocks according to the cipher block mode. It is not thread-safe, but
+implementations must allow different SbCryptographyTransformer instances to
+operate on different threads.
+
+All parameters must not be assumed to live longer than the call to this
+function. They must be copied by the implementation to be retained.
+
+This function determines success mainly based on whether the combination of
+`algorithm`, `direction`, `block_size_bits`, and `mode` is supported and whether
+all the sizes passed in are sufficient for the selected parameters. In
+particular, this function cannot verify that the key and IV used were correct
+for the ciphertext, were it to be used in the decode direction. The caller must
+make that verification.
+
+For example, to decrypt AES-128-CTR:
+SbCryptographyCreateTransformer(kSbCryptographyAlgorithmAes, 128,
+kSbCryptographyDirectionDecode, kSbCryptographyBlockCipherModeCtr, ...);
+
+`algorithm`: A string that represents the cipher algorithm. `block_size_bits`:
+The block size variant of the algorithm to use, in bits. `direction`: The
+direction in which to transform the data. `mode`: The block cipher mode to use.
+`initialization_vector`: The Initialization Vector (IV) to use. May be NULL for
+block cipher modes that don't use it, or don't set it at init time.
+`initialization_vector_size`: The size, in bytes, of the IV. `key`: The key to
+use for this transformation. `key_size`: The size, in bytes, of the key.
+
+presubmit: allow sb_export mismatch
+
+#### Declaration ####
+
+```
+SbCryptographyTransformer SbCryptographyCreateTransformer(const char *algorithm, int block_size_bits, SbCryptographyDirection direction, SbCryptographyBlockCipherMode mode, const void *initialization_vector, int initialization_vector_size, const void *key, int key_size)
+```
+
+### SbCryptographyDestroyTransformer ###
+
+Destroys the given `transformer` instance.
+
+presubmit: allow sb_export mismatch
+
+#### Declaration ####
+
+```
+void SbCryptographyDestroyTransformer(SbCryptographyTransformer transformer)
+```
+
+### SbCryptographyGetTag ###
+
+Calculates the authenticator tag for a transformer and places up to
+`out_tag_size` bytes of it in `out_tag`. Returns whether it was able to get the
+tag, which mainly has to do with whether it is compatible with the current block
+cipher mode.
+
+presubmit: allow sb_export mismatch
+
+#### Declaration ####
+
+```
+bool SbCryptographyGetTag(SbCryptographyTransformer transformer, void *out_tag, int out_tag_size)
+```
+
+### SbCryptographyIsTransformerValid ###
+
+Returns whether the given transformer handle is valid.
+
+#### Declaration ####
+
+```
+static bool SbCryptographyIsTransformerValid(SbCryptographyTransformer transformer)
+```
+
+### SbCryptographySetAuthenticatedData ###
+
+Sets additional authenticated data (AAD) for a transformer, for chaining modes
+that support it (GCM). Returns whether the data was successfully set. This can
+fail if the chaining mode doesn't support AAD, if the parameters are invalid, or
+if the internal state is invalid for setting AAD.
+
+presubmit: allow sb_export mismatch
+
+#### Declaration ####
+
+```
+bool SbCryptographySetAuthenticatedData(SbCryptographyTransformer transformer, const void *data, int data_size)
+```
+
+### SbCryptographySetInitializationVector ###
+
+Sets the initialization vector (IV) for a transformer, replacing the internally-
+set IV. The block cipher mode algorithm will update the IV appropriately after
+every block, so this is not necessary unless the stream is discontiguous in some
+way. This happens with AES-GCM in TLS.
+
+presubmit: allow sb_export mismatch
+
+#### Declaration ####
+
+```
+void SbCryptographySetInitializationVector(SbCryptographyTransformer transformer, const void *initialization_vector, int initialization_vector_size)
+```
+
+### SbCryptographyTransform ###
+
+Transforms one or more `block_size_bits`-sized blocks of `in_data`, with the
+given `transformer`, placing the result in `out_data`. Returns the number of
+bytes that were written to `out_data`, unless there was an error, in which case
+it will return a negative number.
+
+`transformer`: A transformer initialized with an algorithm, IV, cipherkey, and
+so on. `in_data`: The data to be transformed. `in_data_size`: The size of the
+data to be transformed, in bytes. Must be a multiple of the transformer's
+`block-size_bits`, or an error will be returned. `out_data`: A buffer where the
+transformed data should be placed. Must have at least capacity for
+`in_data_size` bytes. May point to the same memory as `in_data`.
+
+presubmit: allow sb_export mismatch
+
+#### Declaration ####
+
+```
+int SbCryptographyTransform(SbCryptographyTransformer transformer, const void *in_data, int in_data_size, void *out_data)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/11/decode_target.md b/src/cobalt/site/docs/reference/starboard/modules/11/decode_target.md
new file mode 100644
index 0000000..90d87fb
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/11/decode_target.md
@@ -0,0 +1,402 @@
+---
+layout: doc
+title: "Starboard Module Reference: decode_target.h"
+---
+
+A target for decoding image and video data into. This corresponds roughly to an
+EGLImage, but that extension may not be fully supported on all GL platforms.
+SbDecodeTarget supports multi-plane targets. The SbBlitter API is supported as
+well, and this is able to more-or-less unify the two.
+
+An SbDecodeTarget can be passed into any function which decodes video or image
+data. This allows the application to allocate fast graphics memory, and have
+decoding done directly into this memory, avoiding unnecessary memory copies, and
+also avoiding pushing data between CPU and GPU memory unnecessarily.
+SbDecodeTargetFormat
+
+SbDecodeTargets support several different formats that can be used to decode
+into and render from. Some formats may be easier to decode into, and others may
+be easier to render. Some may take less memory. Each decoder needs to support
+the SbDecodeTargetFormat passed into it, or the decode will produce an error.
+Each decoder provides a way to check if a given SbDecodeTargetFormat is
+supported by that decoder.
+SbDecodeTargetGraphicsContextProvider
+
+Some components may need to acquire SbDecodeTargets compatible with a certain
+rendering context, which may need to be created on a particular thread. The
+SbDecodeTargetGraphicsContextProvider are passed in to the Starboard
+implementation from the application and provide information about the rendering
+context that will be used to render the SbDecodeTarget objects. For GLES
+renderers, it also provides functionality to enable the Starboard implementation
+to run arbitrary code on the application's renderer thread with the renderer's
+EGLContext held current. This may be useful if your SbDecodeTarget creation code
+needs to execute GLES commands like, for example, glGenTextures().
+
+The primary usage is likely to be the the SbPlayer implementation on some
+platforms.
+SbDecodeTarget Example
+
+Let's say that we are an application and we would like to use the interface
+defined in starboard/image.h to decode an imaginary "image/foo" image type.
+
+First, the application should enumerate which SbDecodeTargetFormats are
+supported by that decoder.
+
+```
+SbDecodeTargetFormat kPreferredFormats[] = {
+    kSbDecodeTargetFormat3PlaneYUVI420,
+    kSbDecodeTargetFormat1PlaneRGBA,
+    kSbDecodeTargetFormat1PlaneBGRA,
+};
+
+SbDecodeTargetFormat format = kSbDecodeTargetFormatInvalid;
+for (int i = 0; i < SB_ARRAY_SIZE_INT(kPreferredFormats); ++i) {
+  if (SbImageIsDecodeSupported("image/foo", kPreferredFormats[i])) {
+    format = kPreferredFormats[i];
+    break;
+  }
+}
+
+```
+
+Now that the application has a format, it can create a decode target that it
+will use to decode the .foo file into. Let's assume format is
+kSbDecodeTargetFormat1PlaneRGBA, that we are on an EGL/GLES2 platform. Also, we
+won't do any error checking, to keep things even simpler.
+
+```
+SbDecodeTarget target = SbImageDecode(
+    context_provider, encoded_foo_data, encoded_foo_data_size,
+    "image/foo", format);
+
+// If the decode works, you can get the texture out and render it.
+SbDecodeTargetInfo info;
+SbMemorySet(&info, 0, sizeof(info));
+SbDecodeTargetGetInfo(target, &info);
+GLuint texture =
+    info.planes[kSbDecodeTargetPlaneRGBA].texture;
+
+```
+
+## Macros ##
+
+### kSbDecodeTargetInvalid ###
+
+Well-defined value for an invalid decode target handle.
+
+## Enums ##
+
+### SbDecodeTargetFormat ###
+
+The list of all possible decoder target formats. An SbDecodeTarget consists of
+one or more planes of data, each plane corresponding with a surface. For some
+formats, different planes will be different sizes for the same dimensions.
+
+NOTE: For enumeration entries with an alpha component, the alpha will always be
+premultiplied unless otherwise explicitly specified.
+
+#### Values ####
+
+*   `kSbDecodeTargetFormat1PlaneRGBA`
+
+    A decoder target format consisting of a single RGBA plane, in that channel
+    order.
+*   `kSbDecodeTargetFormat1PlaneBGRA`
+
+    A decoder target format consisting of a single BGRA plane, in that channel
+    order.
+*   `kSbDecodeTargetFormat2PlaneYUVNV12`
+
+    A decoder target format consisting of Y and interleaved UV planes, in that
+    plane and channel order.
+*   `kSbDecodeTargetFormat3PlaneYUVI420`
+
+    A decoder target format consisting of Y, U, and V planes, in that order.
+*   `kSbDecodeTargetFormat3Plane10BitYUVI420`
+
+    A decoder target format consisting of 10bit Y, U, and V planes, in that
+    order.
+*   `kSbDecodeTargetFormat1PlaneUYVY`
+
+    A decoder target format consisting of a single plane with pixels layed out
+    in the format UYVY. Since there are two Y values per sample, but only one U
+    value and only one V value, horizontally the Y resolution is twice the size
+    of both the U and V resolutions. Vertically, they Y, U and V all have the
+    same resolution. This is a YUV 422 format. When using this format with GL
+    platforms, it is expected that the underlying texture will be set to the
+    GL_RGBA format, and the width of the texture will be equal to the number of
+    UYVY tuples per row (e.g. the u/v width resolution). Content region
+    left/right should be specified in u/v width resolution.
+*   `kSbDecodeTargetFormatInvalid`
+
+    An invalid decode target format.
+
+### SbDecodeTargetPlane ###
+
+All the planes supported by SbDecodeTarget.
+
+#### Values ####
+
+*   `kSbDecodeTargetPlaneRGBA`
+
+    The RGBA plane for the RGBA format.
+*   `kSbDecodeTargetPlaneBGRA`
+
+    The BGRA plane for the BGRA format.
+*   `kSbDecodeTargetPlaneY`
+
+    The Y plane for multi-plane YUV formats.
+*   `kSbDecodeTargetPlaneUV`
+
+    The UV plane for 2-plane YUV formats.
+*   `kSbDecodeTargetPlaneU`
+
+    The U plane for 3-plane YUV formats.
+*   `kSbDecodeTargetPlaneV`
+
+    The V plane for 3-plane YUV formats.
+
+## Typedefs ##
+
+### SbDecodeTarget ###
+
+A handle to a target for image data decoding.
+
+#### Definition ####
+
+```
+typedef SbDecodeTargetPrivate* SbDecodeTarget
+```
+
+### SbDecodeTargetGlesContextRunner ###
+
+Signature for a function provided by the application to the Starboard
+implementation that will let the Starboard implementation run arbitrary code on
+the application's renderer thread with the application's EGLContext held
+current.
+
+#### Definition ####
+
+```
+typedef void(* SbDecodeTargetGlesContextRunner) (struct SbDecodeTargetGraphicsContextProvider *graphics_context_provider, SbDecodeTargetGlesContextRunnerTarget target_function, void *target_function_context)
+```
+
+### SbDecodeTargetGlesContextRunnerTarget ###
+
+Signature for a Starboard implementaion function that is to be run by a
+SbDecodeTargetGlesContextRunner callback.
+
+#### Definition ####
+
+```
+typedef void(* SbDecodeTargetGlesContextRunnerTarget) (void *gles_context_runner_target_context)
+```
+
+## Structs ##
+
+### SbDecodeTargetGraphicsContextProvider ###
+
+In general, the SbDecodeTargetGraphicsContextProvider structure provides
+information about the graphics context that will be used to render
+SbDecodeTargets. Some Starboard implementations may need to have references to
+some graphics objects when creating/destroying resources used by SbDecodeTarget.
+References to SbDecodeTargetGraphicsContextProvider objects should be provided
+to all Starboard functions that might create SbDecodeTargets (e.g.
+SbImageDecode()).
+
+#### Members ####
+
+*   `SbBlitterDevice device`
+
+    The SbBlitterDevice object that will be used to render any produced
+    SbDecodeTargets.
+*   `void * egl_display`
+
+    A reference to the EGLDisplay object that hosts the EGLContext that will be
+    used to render any produced SbDecodeTargets. Note that it has the type
+    `void*` in order to avoid #including the EGL header files here.
+*   `void * egl_context`
+
+    The EGLContext object that will be used to render any produced
+    SbDecodeTargets. Note that it has the type `void*` in order to avoid
+    #including the EGL header files here.
+*   `SbDecodeTargetGlesContextRunner gles_context_runner`
+
+    The `gles_context_runner` function pointer is passed in from the application
+    into the Starboard implementation, and can be invoked by the Starboard
+    implementation to allow running arbitrary code on the renderer's thread with
+    the EGLContext above held current.
+*   `void * gles_context_runner_context`
+
+    Context data that is to be passed in to `gles_context_runner` when it is
+    invoked.
+
+### SbDecodeTargetInfo ###
+
+Contains all information about a decode target, including all of its planes.
+This can be queried via calls to SbDecodeTargetGetInfo().
+
+#### Members ####
+
+*   `SbDecodeTargetFormat format`
+
+    The decode target format, which would dictate how many planes can be
+    expected in `planes`.
+*   `bool is_opaque`
+
+    Specifies whether the decode target is opaque. The underlying source of this
+    value is expected to be properly maintained by the Starboard implementation.
+    So, for example, if an opaque only image type were decoded into an
+    SbDecodeTarget, then the implementation would configure things in such a way
+    that this value is set to true. By opaque, it is meant that all alpha values
+    are guaranteed to be 255, if the decode target is of a format that has alpha
+    values. If the decode target is of a format that does not have alpha values,
+    then this value should be set to true. Applications may rely on this value
+    in order to implement certain optimizations such as occlusion culling.
+*   `int width`
+
+    The width of the image represented by this decode target.
+*   `int height`
+
+    The height of the image represented by this decode target.
+*   `SbDecodeTargetInfoPlane planes`
+
+    The image planes (e.g. kSbDecodeTargetPlaneRGBA, or {kSbDecodeTargetPlaneY,
+    kSbDecodeTargetPlaneU, kSbDecodeTargetPlaneV} associated with this decode
+    target.
+
+### SbDecodeTargetInfoContentRegion ###
+
+Defines a rectangular content region within a SbDecodeTargetInfoPlane structure.
+
+#### Members ####
+
+*   `float left`
+
+    If the texture (width, height) is set to (1, 1), then these values will be
+    interpreted as normalized coordinates, and depending on the platform (for
+    example GLES 2.0 provides no method of obtaining the texture width/height)
+    this may be more natural than specifying absolute pixel offsets.
+*   `float top`
+*   `float right`
+*   `float bottom`
+
+### SbDecodeTargetInfoPlane ###
+
+Defines an image plane within a SbDecodeTargetInfo object.
+
+#### Members ####
+
+*   `SbBlitterSurface surface`
+
+    A handle to the Blitter surface that can be used for rendering.
+*   `uint32_t texture`
+
+    A handle to the GL texture that can be used for rendering.
+*   `uint32_t gl_texture_target`
+
+    The GL texture target that should be used in calls to glBindTexture.
+    Typically this would be GL_TEXTURE_2D, but some platforms may require that
+    it be set to something else like GL_TEXTURE_EXTERNAL_OES.
+*   `uint32_t gl_texture_format`
+
+    For kSbDecodeTargetFormat2PlaneYUVNV12 planes: the format of the texture.
+    Usually, for the luma plane, this is either GL_ALPHA or GL_RED_EXT. For the
+    chroma plane, this is usually GL_LUMINANCE_ALPHA or GL_RG_EXT. Ignored for
+    other plane types.
+*   `int width`
+
+    The width of the texture/surface for this particular plane.
+*   `int height`
+
+    The height of the texture/surface for this particular plane.
+*   `SbDecodeTargetInfoContentRegion content_region`
+
+    The following properties specify a rectangle indicating a region within the
+    texture/surface that contains valid image data. The top-left corner is (0,
+    0) and increases to the right and to the bottom. The units specified by
+    these parameters are number of pixels. The range for left/right is [0,
+    width], and for top/bottom it is [0, height].
+
+## Functions ##
+
+### PrivateDecodeTargetReleaser ###
+
+This function is just an implementation detail of
+SbDecodeTargetReleaseInGlesContext() and should not be called directly.
+
+#### Declaration ####
+
+```
+static void PrivateDecodeTargetReleaser(void *context)
+```
+
+### SbDecodeTargetGetInfo ###
+
+Writes all information about `decode_target` into `out_info`. Returns false if
+the provided `out_info` structure is not zero initialized.
+
+#### Declaration ####
+
+```
+bool SbDecodeTargetGetInfo(SbDecodeTarget decode_target, SbDecodeTargetInfo *out_info)
+```
+
+### SbDecodeTargetIsFormatValid ###
+
+Returns whether a given format is valid.
+
+#### Declaration ####
+
+```
+static bool SbDecodeTargetIsFormatValid(SbDecodeTargetFormat format)
+```
+
+### SbDecodeTargetIsValid ###
+
+Returns whether the given file handle is valid.
+
+#### Declaration ####
+
+```
+static bool SbDecodeTargetIsValid(SbDecodeTarget handle)
+```
+
+### SbDecodeTargetRelease ###
+
+Returns ownership of `decode_target` to the Starboard implementation. This
+function will likely result in the destruction of the SbDecodeTarget and all its
+associated surfaces, though in some cases, platforms may simply adjust a
+reference count. In the case where SB_HAS(GLES2), this function must be called
+on a thread with the context
+
+#### Declaration ####
+
+```
+void SbDecodeTargetRelease(SbDecodeTarget decode_target)
+```
+
+### SbDecodeTargetReleaseInGlesContext ###
+
+Helper function that is possibly useful to Starboard implementations that will
+release a decode target on the thread with the GLES context current.
+
+#### Declaration ####
+
+```
+static void SbDecodeTargetReleaseInGlesContext(SbDecodeTargetGraphicsContextProvider *provider, SbDecodeTarget decode_target)
+```
+
+### SbDecodeTargetRunInGlesContext ###
+
+Inline convenience function to run an arbitrary
+SbDecodeTargetGlesContextRunnerTarget function through a
+SbDecodeTargetGraphicsContextProvider . This is intended to be called by
+Starboard implementations, if it is necessary.
+
+#### Declaration ####
+
+```
+static void SbDecodeTargetRunInGlesContext(SbDecodeTargetGraphicsContextProvider *provider, SbDecodeTargetGlesContextRunnerTarget target, void *target_context)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/11/directory.md b/src/cobalt/site/docs/reference/starboard/modules/11/directory.md
new file mode 100644
index 0000000..2ec9cca
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/11/directory.md
@@ -0,0 +1,126 @@
+---
+layout: doc
+title: "Starboard Module Reference: directory.h"
+---
+
+Provides directory listing functions.
+
+## Macros ##
+
+### kSbDirectoryInvalid ###
+
+Well-defined value for an invalid directory stream handle.
+
+## Typedefs ##
+
+### SbDirectory ###
+
+A handle to an open directory stream.
+
+#### Definition ####
+
+```
+typedef struct SbDirectoryPrivate* SbDirectory
+```
+
+## Structs ##
+
+### SbDirectoryEntry ###
+
+Represents a directory entry.
+
+#### Members ####
+
+*   `char name`
+
+    The name of this directory entry.
+
+## Functions ##
+
+### SbDirectoryCanOpen ###
+
+Indicates whether SbDirectoryOpen is allowed for the given `path`.
+
+`path`: The path to be checked.
+
+#### Declaration ####
+
+```
+bool SbDirectoryCanOpen(const char *path)
+```
+
+### SbDirectoryClose ###
+
+Closes an open directory stream handle. The return value indicates whether the
+directory was closed successfully.
+
+`directory`: The directory stream handle to close.
+
+#### Declaration ####
+
+```
+bool SbDirectoryClose(SbDirectory directory)
+```
+
+### SbDirectoryCreate ###
+
+Creates the directory `path`, assuming the parent directory already exists. This
+function returns `true` if the directory now exists (even if it existed before)
+and returns `false` if the directory does not exist.
+
+`path`: The path to be created.
+
+#### Declaration ####
+
+```
+bool SbDirectoryCreate(const char *path)
+```
+
+### SbDirectoryGetNext ###
+
+Populates `out_entry` with the next entry in the specified directory stream, and
+moves the stream forward by one entry.
+
+Platforms may, but are not required to, return `.` (referring to the directory
+itself) and/or `..` (referring to the directory's parent directory) as entries
+in the directory stream.
+
+This function returns `true` if there was a next directory, and `false` at the
+end of the directory stream.
+
+`directory`: The directory stream from which to retrieve the next directory.
+`out_entry`: The variable to be populated with the next directory entry.
+
+#### Declaration ####
+
+```
+bool SbDirectoryGetNext(SbDirectory directory, SbDirectoryEntry *out_entry)
+```
+
+### SbDirectoryIsValid ###
+
+Returns whether the given directory stream handle is valid.
+
+#### Declaration ####
+
+```
+static bool SbDirectoryIsValid(SbDirectory directory)
+```
+
+### SbDirectoryOpen ###
+
+Opens the given existing directory for listing. This function returns
+kSbDirectoryInvalidHandle if it is not successful.
+
+If `out_error` is provided by the caller, it will be set to the appropriate
+SbFileError code on failure.
+
+`out_error`: An output parameter that, in case of an error, is set to the reason
+that the directory could not be opened.
+
+#### Declaration ####
+
+```
+SbDirectory SbDirectoryOpen(const char *path, SbFileError *out_error)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/double.md b/src/cobalt/site/docs/reference/starboard/modules/11/double.md
similarity index 100%
rename from src/cobalt/site/docs/reference/starboard/modules/4/double.md
rename to src/cobalt/site/docs/reference/starboard/modules/11/double.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/11/drm.md b/src/cobalt/site/docs/reference/starboard/modules/11/drm.md
new file mode 100644
index 0000000..9e40e05
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/11/drm.md
@@ -0,0 +1,358 @@
+---
+layout: doc
+title: "Starboard Module Reference: drm.h"
+---
+
+Provides definitions that allow for DRM support, which are common between Player
+and Decoder interfaces.
+
+## Macros ##
+
+### kSbDrmSystemInvalid ###
+
+An invalid SbDrmSystem.
+
+### kSbDrmTicketInvalid ###
+
+A ticket for callback invocations initiated by the DRM system.
+
+## Enums ##
+
+### SbDrmKeyStatus ###
+
+Status of a particular media key. [https://w3c.github.io/encrypted-media/#idl-def-MediaKeyStatus](https://w3c.github.io/encrypted-media/#idl-def-MediaKeyStatus)
+
+#### Values ####
+
+*   `kSbDrmKeyStatusUsable`
+*   `kSbDrmKeyStatusExpired`
+*   `kSbDrmKeyStatusReleased`
+*   `kSbDrmKeyStatusRestricted`
+*   `kSbDrmKeyStatusDownscaled`
+*   `kSbDrmKeyStatusPending`
+*   `kSbDrmKeyStatusError`
+
+### SbDrmSessionRequestType ###
+
+The type of the session request. [https://www.w3.org/TR/encrypted-media/#idl-def-mediakeymessagetype](https://www.w3.org/TR/encrypted-media/#idl-def-mediakeymessagetype)
+
+#### Values ####
+
+*   `kSbDrmSessionRequestTypeLicenseRequest`
+*   `kSbDrmSessionRequestTypeLicenseRenewal`
+*   `kSbDrmSessionRequestTypeLicenseRelease`
+*   `kSbDrmSessionRequestTypeIndividualizationRequest`
+
+### SbDrmStatus ###
+
+The status of session related operations. Used by
+`SbDrmSessionUpdateRequestFunc`, `SbDrmSessionUpdatedFunc`, and
+`SbDrmServerCertificateUpdatedFunc` to indicate the status of the operation. [https://w3c.github.io/encrypted-media/#error-names](https://w3c.github.io/encrypted-media/#error-names)
+
+#### Values ####
+
+*   `kSbDrmStatusSuccess`
+*   `kSbDrmStatusTypeError`
+*   `kSbDrmStatusNotSupportedError`
+*   `kSbDrmStatusInvalidStateError`
+*   `kSbDrmStatusQuotaExceededError`
+*   `kSbDrmStatusUnknownError`
+
+    The following error can be used when the error status cannot be mapped to
+    one of the above errors.
+
+## Typedefs ##
+
+### SbDrmServerCertificateUpdatedFunc ###
+
+A callback to notify the caller of SbDrmUpdateServerCertificate() whether the
+update has been successfully updated or not.
+
+#### Definition ####
+
+```
+typedef void(* SbDrmServerCertificateUpdatedFunc) (SbDrmSystem drm_system, void *context, int ticket, SbDrmStatus status, const char *error_message)
+```
+
+### SbDrmSessionClosedFunc ###
+
+A callback for signalling that a session has been closed by the SbDrmSystem
+
+#### Definition ####
+
+```
+typedef void(* SbDrmSessionClosedFunc) (SbDrmSystem drm_system, void *context, const void *session_id, int session_id_size)
+```
+
+### SbDrmSessionKeyStatusesChangedFunc ###
+
+A callback for notifications that the status of one or more keys in a session
+has been changed. All keys of the session and their new status will be passed
+along. Any keys not in the list is considered as deleted.
+
+#### Definition ####
+
+```
+typedef void(* SbDrmSessionKeyStatusesChangedFunc) (SbDrmSystem drm_system, void *context, const void *session_id, int session_id_size, int number_of_keys, const SbDrmKeyId *key_ids, const SbDrmKeyStatus *key_statuses)
+```
+
+### SbDrmSessionUpdateRequestFunc ###
+
+A callback that will receive generated session update request when requested
+from a SbDrmSystem. `drm_system` will be the DRM system that
+SbDrmGenerateSessionUpdateRequest() was called on. `context` will be the same
+context that was passed into the call to SbDrmCreateSystem().
+
+`status` is the status of the session request.
+
+`type` is the status of the session request.
+
+`error_message` may contain an optional error message when `status` isn't
+`kSbDrmStatusSuccess` to provide more details about the error. It may be NULL if
+`status` is `kSbDrmStatusSuccess` or if no error message can be provided.
+`ticket` will be the same ticket that was passed to
+SbDrmGenerateSessionUpdateRequest() or `kSbDrmTicketInvalid` if the update
+request was generated by the DRM system.
+
+`session_id` cannot be NULL when `ticket` is `kSbDrmTicketInvalid`, even when
+there was an error generating the request. This allows Cobalt to find and reject
+the correct Promise corresponding to the associated
+SbDrmGenerateSessionUpdateRequest().
+
+#### Definition ####
+
+```
+typedef void(* SbDrmSessionUpdateRequestFunc) (SbDrmSystem drm_system, void *context, int ticket, SbDrmStatus status, SbDrmSessionRequestType type, const char *error_message, const void *session_id, int session_id_size, const void *content, int content_size, const char *url)
+```
+
+### SbDrmSessionUpdatedFunc ###
+
+A callback for notifications that a session has been added, and subsequent
+encrypted samples are actively ready to be decoded. `drm_system` will be the DRM
+system that SbDrmUpdateSession() was called on. `context` will be the same
+context passed into that call to SbDrmCreateSystem().
+
+`ticket` will be the same ticket that was passed to SbDrmUpdateSession().
+
+`status` is the status of the session request.
+
+`error_message` may contain an optional error message when `status` isn't
+`kSbDrmStatusSuccess` to provide more details about the error. It may be NULL if
+`status` is `kSbDrmStatusSuccess` or if no error message can be provided.
+`succeeded` is whether the session was successfully updated or not.
+
+#### Definition ####
+
+```
+typedef void(* SbDrmSessionUpdatedFunc) (SbDrmSystem drm_system, void *context, int ticket, SbDrmStatus status, const char *error_message, const void *session_id, int session_id_size)
+```
+
+### SbDrmSystem ###
+
+A handle to a DRM system which can be used with either an SbDecoder or a
+SbPlayer.
+
+#### Definition ####
+
+```
+typedef struct SbDrmSystemPrivate* SbDrmSystem
+```
+
+## Structs ##
+
+### SbDrmKeyId ###
+
+#### Members ####
+
+*   `uint8_t identifier`
+
+    The ID of the license (or key) required to decrypt this sample. For
+    PlayReady, this is the license GUID in packed little-endian binary form.
+*   `int identifier_size`
+
+### SbDrmSampleInfo ###
+
+All the optional information needed per sample for encrypted samples.
+
+#### Members ####
+
+*   `uint8_t initialization_vector`
+
+    The Initialization Vector needed to decrypt this sample.
+*   `int initialization_vector_size`
+*   `uint8_t identifier`
+
+    The ID of the license (or key) required to decrypt this sample. For
+    PlayReady, this is the license GUID in packed little-endian binary form.
+*   `int identifier_size`
+*   `int32_t subsample_count`
+
+    The number of subsamples in this sample, must be at least 1.
+*   `constSbDrmSubSampleMapping* subsample_mapping`
+
+    The clear/encrypted mapping of each subsample in this sample. This must be
+    an array of `subsample_count` mappings.
+
+### SbDrmSubSampleMapping ###
+
+A mapping of clear and encrypted bytes for a single subsample. All subsamples
+within a sample must be encrypted with the same encryption parameters. The clear
+bytes always appear first in the sample.
+
+#### Members ####
+
+*   `int32_t clear_byte_count`
+
+    How many bytes of the corresponding subsample are not encrypted
+*   `int32_t encrypted_byte_count`
+
+    How many bytes of the corresponding subsample are encrypted.
+
+## Functions ##
+
+### SbDrmCloseSession ###
+
+Clear any internal states/resources related to the specified `session_id`.
+
+#### Declaration ####
+
+```
+void SbDrmCloseSession(SbDrmSystem drm_system, const void *session_id, int session_id_size)
+```
+
+### SbDrmDestroySystem ###
+
+Destroys `drm_system`, which implicitly removes all keys installed in it and
+invalidates all outstanding session update requests. A DRM system cannot be
+destroyed unless any associated SbPlayer or SbDecoder has first been destroyed.
+
+All callbacks are guaranteed to be finished when this function returns. As a
+result, if this function is called from a callback that is passed to
+SbDrmCreateSystem(), a deadlock will occur.
+
+`drm_system`: The DRM system to be destroyed.
+
+#### Declaration ####
+
+```
+void SbDrmDestroySystem(SbDrmSystem drm_system)
+```
+
+### SbDrmGenerateSessionUpdateRequest ###
+
+Asynchronously generates a session update request payload for
+`initialization_data`, of `initialization_data_size`, in case sensitive `type`,
+extracted from the media stream, in `drm_system`'s key system.
+
+This function calls `drm_system`'s `update_request_callback` function, which is
+defined when the DRM system is created by SbDrmCreateSystem. When calling that
+function, this function either sends `context` (also from `SbDrmCreateSystem`)
+and a populated request, or it sends NULL `session_id` if an error occurred.
+
+`drm_system`'s `context` may be used to route callbacks back to an object
+instance.
+
+Callbacks may be called either from the current thread before this function
+returns or from another thread.
+
+`drm_system`: The DRM system that defines the key system used for the session
+update request payload as well as the callback function that is called as a
+result of the function being called.
+
+`ticket`: The opaque ID that allows to distinguish callbacks from multiple
+concurrent calls to SbDrmGenerateSessionUpdateRequest(), which will be passed to
+`update_request_callback` as-is. It is the responsibility of the caller to
+establish ticket uniqueness, issuing multiple requests with the same ticket may
+result in undefined behavior. The value `kSbDrmTicketInvalid` must not be used.
+
+`type`: The case-sensitive type of the session update request payload.
+`initialization_data`: The data for which the session update request payload is
+created. `initialization_data_size`: The size of the session update request
+payload.
+
+#### Declaration ####
+
+```
+void SbDrmGenerateSessionUpdateRequest(SbDrmSystem drm_system, int ticket, const char *type, const void *initialization_data, int initialization_data_size)
+```
+
+### SbDrmIsServerCertificateUpdatable ###
+
+Returns true if server certificate of `drm_system` can be updated via
+SbDrmUpdateServerCertificate(). The return value should remain the same during
+the life time of `drm_system`.
+
+`drm_system`: The DRM system to check if its server certificate is updatable.
+
+#### Declaration ####
+
+```
+bool SbDrmIsServerCertificateUpdatable(SbDrmSystem drm_system)
+```
+
+### SbDrmSystemIsValid ###
+
+Indicates whether `drm_system` is a valid SbDrmSystem.
+
+#### Declaration ####
+
+```
+static bool SbDrmSystemIsValid(SbDrmSystem drm)
+```
+
+### SbDrmTicketIsValid ###
+
+Indicates whether `ticket` is a valid ticket.
+
+#### Declaration ####
+
+```
+static bool SbDrmTicketIsValid(int ticket)
+```
+
+### SbDrmUpdateServerCertificate ###
+
+Update the server certificate of `drm_system`. The function can be called
+multiple times. It is possible that a call to it happens before the callback of
+a previous call is called. Note that this function should only be called after
+`SbDrmIsServerCertificateUpdatable` is called first and returned true.
+
+`drm_system`: The DRM system whose server certificate is being updated.
+`ticket`: The opaque ID that allows to distinguish callbacks from multiple
+concurrent calls to SbDrmUpdateServerCertificate(), which will be passed to
+`server_certificate_updated_callback` as-is. It is the responsibility of the
+caller to establish ticket uniqueness, issuing multiple requests with the same
+ticket may result in undefined behavior. The value `kSbDrmTicketInvalid` must
+not be used. `certificate`: Pointer to the server certificate data.
+`certificate_size`: Size of the server certificate data.
+
+#### Declaration ####
+
+```
+void SbDrmUpdateServerCertificate(SbDrmSystem drm_system, int ticket, const void *certificate, int certificate_size)
+```
+
+### SbDrmUpdateSession ###
+
+Update session with `key`, in `drm_system`'s key system, from the license server
+response. Calls `session_updated_callback` with `context` and whether the update
+succeeded. `context` may be used to route callbacks back to an object instance.
+
+`ticket` is the opaque ID that allows to distinguish callbacks from multiple
+concurrent calls to SbDrmUpdateSession(), which will be passed to
+`session_updated_callback` as-is. It is the responsibility of the caller to
+establish ticket uniqueness, issuing multiple calls with the same ticket may
+result in undefined behavior.
+
+Once the session is successfully updated, an SbPlayer or SbDecoder associated
+with that DRM key system will be able to decrypt encrypted samples.
+
+`drm_system`'s `session_updated_callback` may called either from the current
+thread before this function returns or from another thread.
+
+#### Declaration ####
+
+```
+void SbDrmUpdateSession(SbDrmSystem drm_system, int ticket, const void *key, int key_size, const void *session_id, int session_id_size)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/11/egl.md b/src/cobalt/site/docs/reference/starboard/modules/11/egl.md
new file mode 100644
index 0000000..1938b5b
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/11/egl.md
@@ -0,0 +1,119 @@
+---
+layout: doc
+title: "Starboard Module Reference: egl.h"
+---
+
+The EGL API provides an interface with accompanying type declarations and
+defines that together provide a single consistent method of EGL usage across
+platforms.
+
+This API is designed to abstract the differences between EGL implementations and
+versions on different systems, and to remove the requirement for any other code
+to directly pull in and use these system libraries.
+EGL Version
+
+This API has the ability to support EGL 1.5, however it is not required to
+support anything beyond EGL 1.4. The user is responsible for ensuring that the
+functions from EGL 1.5 they are calling from the interface are valid.
+
+## Macros ##
+
+### SB_EGL_ALPHA_FORMAT ###
+
+EGL_VERSION_1_2
+
+### SB_EGL_ALPHA_SIZE ###
+
+EGL_VERSION_1_0
+
+### SB_EGL_BACK_BUFFER ###
+
+EGL_VERSION_1_1
+
+### SB_EGL_CONFORMANT ###
+
+EGL_VERSION_1_3
+
+### SB_EGL_CONTEXT_MAJOR_VERSION ###
+
+EGL_VERSION_1_5
+
+### SB_EGL_DEFAULT_DISPLAY ###
+
+EGL_VERSION_1_4
+
+## Typedefs ##
+
+### SbEglCastsToProperFunctionPointerType ###
+
+The following type definitions were adapted from the types declared in [https://www.khronos.org/registry/EGL/api/EGL/egl.h](https://www.khronos.org/registry/EGL/api/EGL/egl.h)
+.
+
+#### Definition ####
+
+```
+typedef void(* SbEglCastsToProperFunctionPointerType) (void)
+```
+
+### SbEglInt32 ###
+
+The following type definitions were adapted from the types declared in [https://www.khronos.org/registry/EGL/api/EGL/eglplatform.h](https://www.khronos.org/registry/EGL/api/EGL/eglplatform.h)
+.
+
+#### Definition ####
+
+```
+typedef int32_t SbEglInt32
+```
+
+## Structs ##
+
+### SbEglInterface ###
+
+#### Members ####
+
+*   `SbEglBoolean(* eglChooseConfig`
+*   `SbEglBoolean(* eglCopyBuffers`
+*   `SbEglContext(* eglCreateContext`
+*   `SbEglSurface(* eglCreatePbufferSurface`
+*   `SbEglSurface(* eglCreatePixmapSurface`
+*   `SbEglSurface(* eglCreateWindowSurface`
+*   `SbEglBoolean(* eglDestroyContext`
+*   `SbEglBoolean(* eglDestroySurface`
+*   `SbEglBoolean(* eglGetConfigAttrib`
+*   `SbEglBoolean(* eglGetConfigs`
+*   `SbEglDisplay(* eglGetCurrentDisplay`
+*   `SbEglSurface(* eglGetCurrentSurface`
+*   `SbEglDisplay(* eglGetDisplay`
+*   `SbEglInt32(* eglGetError`
+*   `SbEglCastsToProperFunctionPointerType(* eglGetProcAddress`
+*   `SbEglBoolean(* eglInitialize`
+*   `SbEglBoolean(* eglMakeCurrent`
+*   `SbEglBoolean(* eglQueryContext`
+*   `const char *(* eglQueryString`
+*   `SbEglBoolean(* eglQuerySurface`
+*   `SbEglBoolean(* eglSwapBuffers`
+*   `SbEglBoolean(* eglTerminate`
+*   `SbEglBoolean(* eglWaitGL`
+*   `SbEglBoolean(* eglWaitNative`
+*   `SbEglBoolean(* eglBindTexImage`
+*   `SbEglBoolean(* eglReleaseTexImage`
+*   `SbEglBoolean(* eglSurfaceAttrib`
+*   `SbEglBoolean(* eglSwapInterval`
+*   `SbEglBoolean(* eglBindAPI`
+*   `SbEglEnum(* eglQueryAPI`
+*   `SbEglSurface(* eglCreatePbufferFromClientBuffer`
+*   `SbEglBoolean(* eglReleaseThread`
+*   `SbEglBoolean(* eglWaitClient`
+*   `SbEglContext(* eglGetCurrentContext`
+*   `SbEglSync(* eglCreateSync`
+*   `SbEglBoolean(* eglDestroySync`
+*   `SbEglInt32(* eglClientWaitSync`
+*   `SbEglBoolean(* eglGetSyncAttrib`
+*   `SbEglImage(* eglCreateImage`
+*   `SbEglBoolean(* eglDestroyImage`
+*   `SbEglDisplay(* eglGetPlatformDisplay`
+*   `SbEglSurface(* eglCreatePlatformWindowSurface`
+*   `SbEglSurface(* eglCreatePlatformPixmapSurface`
+*   `SbEglBoolean(* eglWaitSync`
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/11/event.md b/src/cobalt/site/docs/reference/starboard/modules/11/event.md
new file mode 100644
index 0000000..2d0f9cc
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/11/event.md
@@ -0,0 +1,368 @@
+---
+layout: doc
+title: "Starboard Module Reference: event.h"
+---
+
+Defines the event system that wraps the Starboard main loop and entry point.
+The Starboard Application Lifecycle
+
+```
+    ---------- *
+   |           |
+   |        Preload
+   |           |
+   |           V
+ Start   [ PRELOADING ] ------------
+   |           |                    |
+   |         Start                  |
+   |           |                    |
+   |           V                    |
+    ----> [ STARTED ] <----         |
+               |           |        |
+             Pause       Unpause    |
+               |           |     Suspend
+               V           |        |
+    -----> [ PAUSED ] -----         |
+   |           |                    |
+Resume      Suspend                 |
+   |           |                    |
+   |           V                    |
+    ---- [ SUSPENDED ] <------------
+               |
+              Stop
+               |
+               V
+          [ STOPPED ]
+
+```
+
+The first event that a Starboard application receives is either `Start`
+(`kSbEventTypeStart`) or `Preload` (`kSbEventTypePreload`). `Start` puts the
+application in the `STARTED` state, whereas `Preload` puts the application in
+the `PRELOADING` state.
+
+`PRELOADING` can only happen as the first application state. In this state, the
+application should start and run as normal, but will not receive any input, and
+should not try to initialize graphics resources (via GL or `SbBlitter`). In
+`PRELOADING`, the application can receive `Start` or `Suspend` events. `Start`
+will receive the same data that was passed into `Preload`.
+
+In the `STARTED` state, the application is in the foreground and can expect to
+do all of the normal things it might want to do. Once in the `STARTED` state, it
+may receive a `Pause` event, putting the application into the `PAUSED` state.
+
+In the `PAUSED` state, the application is still visible, but has lost focus, or
+it is partially obscured by a modal dialog, or it is on its way to being shut
+down. The application should pause activity in this state. In this state, it can
+receive `Unpause` to be brought back to the foreground state (`STARTED`), or
+`Suspend` to be pushed further in the background to the `SUSPENDED` state.
+
+In the `SUSPENDED` state, the application is generally not visible. It should
+immediately release all graphics and video resources, and shut down all
+background activity (timers, rendering, etc). Additionally, the application
+should flush storage to ensure that if the application is killed, the storage
+will be up-to-date. The application may be killed at this point, but will
+ideally receive a `Stop` event for a more graceful shutdown.
+
+Note that the application is always expected to transition through `PAUSED` to
+`SUSPENDED` before receiving `Stop` or being killed.
+
+## Enums ##
+
+### SbEventType ###
+
+An enumeration of all possible event types dispatched directly by the system.
+Each event is accompanied by a void* data argument, and each event must define
+the type of the value pointed to by that data argument, if any.
+
+#### Values ####
+
+*   `kSbEventTypePreload`
+
+    Applications should perform initialization and prepare to react to
+    subsequent events, but must not initialize any graphics resources (through
+    GL or SbBlitter). The intent of this event is to allow the application to do
+    as much work as possible ahead of time, so that when the application is
+    first brought to the foreground, it's as fast as a resume.
+
+    The `kSbEventTypeStart` event may be sent at any time, regardless of
+    initialization state. Input events will not be sent in the `PRELOADING`
+    state. This event will only be sent once for a given process launch.
+    SbEventStartData is passed as the data argument.
+
+    The system may send `kSbEventTypeSuspend` in `PRELOADING` if it wants to
+    push the app into a lower resource consumption state. Applications can alo
+    call SbSystemRequestSuspend() when they are done preloading to request this.
+*   `kSbEventTypeStart`
+
+    The first event that an application receives on startup when starting
+    normally (i.e. not being preloaded). Applications should perform
+    initialization, start running, and prepare to react to subsequent events.
+    Applications that wish to run and then exit must call
+    `SbSystemRequestStop()` to terminate. This event will only be sent once for
+    a given process launch. `SbEventStartData` is passed as the data argument.
+    In case of preload, the `SbEventStartData` will be the same as what was
+    passed to `kSbEventTypePreload`.
+*   `kSbEventTypePause`
+
+    A dialog will be raised or the application will otherwise be put into a
+    background-but-visible or partially-obscured state (PAUSED). Graphics and
+    video resources will still be available, but the application should pause
+    foreground activity like animations and video playback. Can only be received
+    after a Start event. The only events that should be dispatched after a Pause
+    event are Unpause or Suspend. No data argument.
+*   `kSbEventTypeUnpause`
+
+    The application is returning to the foreground (STARTED) after having been
+    put in the PAUSED (e.g. partially-obscured) state. The application should
+    unpause foreground activity like animations and video playback. Can only be
+    received after a Pause or Resume event. No data argument.
+*   `kSbEventTypeSuspend`
+
+    The operating system will put the application into a Suspended state after
+    this event is handled. The application is expected to stop periodic
+    background work, release ALL graphics and video resources, and flush any
+    pending SbStorage writes. Some platforms will terminate the application if
+    work is done or resources are retained after suspension. Can only be
+    received after a Pause event. The only events that should be dispatched
+    after a Suspend event are Resume or Stop. On some platforms, the process may
+    also be killed after Suspend without a Stop event. No data argument.
+*   `kSbEventTypeResume`
+
+    The operating system has restored the application to the PAUSED state from
+    the SUSPENDED state. This is the first event the application will receive
+    coming out of SUSPENDED, and it will only be received after a Suspend event.
+    The application will now be in the PAUSED state. No data argument.
+*   `kSbEventTypeStop`
+
+    The operating system will shut the application down entirely after this
+    event is handled. Can only be recieved after a Suspend event, in the
+    SUSPENDED state. No data argument.
+*   `kSbEventTypeInput`
+
+    A user input event, including keyboard, mouse, gesture, or something else.
+    SbInputData (from input.h) is passed as the data argument.
+*   `kSbEventTypeUser`
+
+    A user change event, which means a new user signed-in or signed-out, or the
+    current user changed. No data argument, call SbUserGetSignedIn() and
+    SbUserGetCurrent() to get the latest changes.
+*   `kSbEventTypeLink`
+
+    A navigational link has come from the system, and the application should
+    consider handling it by navigating to the corresponding application
+    location. The data argument is an application-specific, null-terminated
+    string.
+*   `kSbEventTypeVerticalSync`
+
+    The beginning of a vertical sync has been detected. This event is very
+    timing-sensitive, so as little work as possible should be done on the main
+    thread if the application wants to receive this event in a timely manner. No
+    data argument.
+*   `kSbEventTypeScheduled`
+
+    An event type reserved for scheduled callbacks. It will only be sent in
+    response to an application call to SbEventSchedule(), and it will call the
+    callback directly, so SbEventHandle should never receive this event
+    directly. The data type is an internally-defined structure.
+*   `kSbEventTypeAccessiblitySettingsChanged`
+
+    The platform's accessibility settings have changed. The application should
+    query the accessibility settings using the appropriate APIs to get the new
+    settings. Note this excludes captions settings changes, which causes
+    kSbEventTypeAccessibilityCaptionSettingsChanged to fire. If the starboard
+    version has kSbEventTypeAccessiblityTextToSpeechSettingsChanged, then that
+    event should be used to signal text-to-speech settings changes instead;
+    platforms using older starboard versions should use
+    kSbEventTypeAccessiblitySettingsChanged for text-to-speech settings changes.
+*   `kSbEventTypeLowMemory`
+
+    An optional event that platforms may send to indicate that the application
+    may soon be terminated (or crash) due to low memory availability. The
+    application may respond by reducing memory consumption by running a Garbage
+    Collection, flushing caches, or something similar. There is no requirement
+    to respond to or handle this event, it is only advisory.
+*   `kSbEventTypeWindowSizeChanged`
+
+    The size or position of a SbWindow has changed. The data is
+    SbEventWindowSizeChangedData .
+*   `kSbEventTypeOnScreenKeyboardShown`
+
+    The platform has shown the on screen keyboard. This event is triggered by
+    the system or by the application's OnScreenKeyboard show method. The event
+    has int data representing a ticket. The ticket is used by the application to
+    mark individual calls to the show method as successfully completed. Events
+    triggered by the application have tickets passed in via
+    SbWindowShowOnScreenKeyboard. System-triggered events have ticket value
+    kSbEventOnScreenKeyboardInvalidTicket.
+*   `kSbEventTypeOnScreenKeyboardHidden`
+
+    The platform has hidden the on screen keyboard. This event is triggered by
+    the system or by the application's OnScreenKeyboard hide method. The event
+    has int data representing a ticket. The ticket is used by the application to
+    mark individual calls to the hide method as successfully completed. Events
+    triggered by the application have tickets passed in via
+    SbWindowHideOnScreenKeyboard. System-triggered events have ticket value
+    kSbEventOnScreenKeyboardInvalidTicket.
+*   `kSbEventTypeOnScreenKeyboardFocused`
+
+    The platform has focused the on screen keyboard. This event is triggered by
+    the system or by the application's OnScreenKeyboard focus method. The event
+    has int data representing a ticket. The ticket is used by the application to
+    mark individual calls to the focus method as successfully completed. Events
+    triggered by the application have tickets passed in via
+    SbWindowFocusOnScreenKeyboard. System-triggered events have ticket value
+    kSbEventOnScreenKeyboardInvalidTicket.
+*   `kSbEventTypeOnScreenKeyboardBlurred`
+
+    The platform has blurred the on screen keyboard. This event is triggered by
+    the system or by the application's OnScreenKeyboard blur method. The event
+    has int data representing a ticket. The ticket is used by the application to
+    mark individual calls to the blur method as successfully completed. Events
+    triggered by the application have tickets passed in via
+    SbWindowBlurOnScreenKeyboard. System-triggered events have ticket value
+    kSbEventOnScreenKeyboardInvalidTicket.
+*   `kSbEventTypeOnScreenKeyboardSuggestionsUpdated`
+
+    The platform has updated the on screen keyboard suggestions. This event is
+    triggered by the system or by the application's OnScreenKeyboard update
+    suggestions method. The event has int data representing a ticket. The ticket
+    is used by the application to mark individual calls to the update
+    suggestions method as successfully completed. Events triggered by the
+    application have tickets passed in via
+    SbWindowUpdateOnScreenKeyboardSuggestions. System-triggered events have
+    ticket value kSbEventOnScreenKeyboardInvalidTicket.
+*   `kSbEventTypeAccessibilityCaptionSettingsChanged`
+
+    SB_HAS(ON_SCREEN_KEYBOARD) One or more of the fields returned by
+    SbAccessibilityGetCaptionSettings has changed.
+
+## Typedefs ##
+
+### SbEventCallback ###
+
+A function that can be called back from the main Starboard event pump.
+
+#### Definition ####
+
+```
+typedef void(* SbEventCallback) (void *context)
+```
+
+### SbEventDataDestructor ###
+
+A function that will cleanly destroy an event data instance of a specific type.
+
+#### Definition ####
+
+```
+typedef void(* SbEventDataDestructor) (void *data)
+```
+
+### SbEventId ###
+
+An ID that can be used to refer to a scheduled event.
+
+#### Definition ####
+
+```
+typedef uint32_t SbEventId
+```
+
+## Structs ##
+
+### SbEvent ###
+
+Structure representing a Starboard event and its data.
+
+#### Members ####
+
+*   `SbEventType type`
+*   `void * data`
+
+### SbEventStartData ###
+
+Event data for kSbEventTypeStart events.
+
+#### Members ####
+
+*   `char ** argument_values`
+
+    The command-line argument values (argv).
+*   `int argument_count`
+
+    The command-line argument count (argc).
+*   `const char * link`
+
+    The startup link, if any.
+
+### SbEventWindowSizeChangedData ###
+
+Event data for kSbEventTypeWindowSizeChanged events.
+
+#### Members ####
+
+*   `SbWindow window`
+*   `SbWindowSize size`
+
+## Functions ##
+
+### SbEventCancel ###
+
+Cancels the specified `event_id`. Note that this function is a no-op if the
+event already fired. This function can be safely called from any thread, but the
+only way to guarantee that the event does not run anyway is to call it from the
+main Starboard event loop thread.
+
+#### Declaration ####
+
+```
+void SbEventCancel(SbEventId event_id)
+```
+
+### SbEventHandle ###
+
+The entry point that Starboard applications MUST implement. Any memory pointed
+at by `event` or the `data` field inside `event` is owned by the system, and
+that memory is reclaimed after this function returns, so the implementation must
+copy this data to extend its life. This behavior should also be assumed of all
+fields within the `data` object, unless otherwise explicitly specified.
+
+This function is only called from the main Starboard thread. There is no
+specification about what other work might happen on this thread, so the
+application should generally do as little work as possible on this thread, and
+just dispatch it over to another thread.
+
+#### Declaration ####
+
+```
+SB_IMPORT void SbEventHandle(const SbEvent *event)
+```
+
+### SbEventIsIdValid ###
+
+Returns whether the given event handle is valid.
+
+#### Declaration ####
+
+```
+static bool SbEventIsIdValid(SbEventId handle)
+```
+
+### SbEventSchedule ###
+
+Schedules an event `callback` into the main Starboard event loop. This function
+may be called from any thread, but `callback` is always called from the main
+Starboard thread, queued with other pending events.
+
+`callback`: The callback function to be called. `context`: The context that is
+passed to the `callback` function. `delay`: The minimum number of microseconds
+to wait before calling the `callback` function. Set `delay` to `0` to call the
+callback as soon as possible.
+
+#### Declaration ####
+
+```
+SbEventId SbEventSchedule(SbEventCallback callback, void *context, SbTime delay)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/11/export.md b/src/cobalt/site/docs/reference/starboard/modules/11/export.md
new file mode 100644
index 0000000..ff79777
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/11/export.md
@@ -0,0 +1,24 @@
+---
+layout: doc
+title: "Starboard Module Reference: export.h"
+---
+
+Provides macros for properly exporting or importing symbols from shared
+libraries.
+
+## Macros ##
+
+### SB_EXPORT ###
+
+Specification for a symbol that should be exported when building the DLL and
+imported when building code that uses the DLL.
+
+### SB_EXPORT_PRIVATE ###
+
+Specification for a symbol that should be exported or imported for testing
+purposes only.
+
+### SB_IMPORT ###
+
+Specification for a symbol that is expected to be defined externally to this
+module.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/11/file.md b/src/cobalt/site/docs/reference/starboard/modules/11/file.md
new file mode 100644
index 0000000..ad890dc
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/11/file.md
@@ -0,0 +1,389 @@
+---
+layout: doc
+title: "Starboard Module Reference: file.h"
+---
+
+Defines file system input/output functions.
+
+## Macros ##
+
+### kSbFileInvalid ###
+
+Well-defined value for an invalid file handle.
+
+## Enums ##
+
+### SbFileError ###
+
+kSbFileErrorAccessDenied is returned when a call fails because of a filesystem
+restriction. kSbFileErrorSecurity is returned when a security policy doesn't
+allow the operation to be executed.
+
+#### Values ####
+
+*   `kSbFileOk`
+*   `kSbFileErrorFailed`
+*   `kSbFileErrorInUse`
+*   `kSbFileErrorExists`
+*   `kSbFileErrorNotFound`
+*   `kSbFileErrorAccessDenied`
+*   `kSbFileErrorTooManyOpened`
+*   `kSbFileErrorNoMemory`
+*   `kSbFileErrorNoSpace`
+*   `kSbFileErrorNotADirectory`
+*   `kSbFileErrorInvalidOperation`
+*   `kSbFileErrorSecurity`
+*   `kSbFileErrorAbort`
+*   `kSbFileErrorNotAFile`
+*   `kSbFileErrorNotEmpty`
+*   `kSbFileErrorInvalidUrl`
+*   `kSbFileErrorIO`
+*   `kSbFileErrorMax`
+
+### SbFileFlags ###
+
+Flags that define how a file is used in the application. These flags should be
+or'd together when passed to SbFileOpen to open or create a file.
+
+The following five flags are mutually exclusive. You must specify exactly one of
+them:
+
+*   `kSbFileOpenAlways`
+
+*   `kSbFileOpenOnly`
+
+*   `kSbFileOpenTruncated`
+
+*   `kSbFileCreateAlways`
+
+*   `kSbFileCreateOnly`
+
+In addition, one or more of the following flags must be specified:
+
+*   `kSbFileRead`
+
+*   `kSbFileWrite`
+
+The `kSbFileAsync` flag is optional.
+
+#### Values ####
+
+*   `kSbFileOpenOnly`
+*   `kSbFileCreateOnly`
+*   `kSbFileOpenAlways`
+
+    does not already exist.
+*   `kSbFileCreateAlways`
+
+    path or creates a new file at that path.
+*   `kSbFileOpenTruncated`
+
+    or overwrites an existing file at that path.
+*   `kSbFileRead`
+
+    only if it exists.
+*   `kSbFileWrite`
+*   `kSbFileAsync`
+
+### SbFileWhence ###
+
+This explicit mapping matches both FILE_ on Windows and SEEK_ on Linux.
+
+#### Values ####
+
+*   `kSbFileFromBegin`
+*   `kSbFileFromCurrent`
+*   `kSbFileFromEnd`
+
+## Typedefs ##
+
+### SbFile ###
+
+A handle to an open file.
+
+#### Definition ####
+
+```
+typedef SbFilePrivate* SbFile
+```
+
+## Structs ##
+
+### SbFileInfo ###
+
+Used to hold information about a file.
+
+#### Members ####
+
+*   `int64_t size`
+
+    The size of the file in bytes. Undefined when is_directory is true.
+*   `bool is_directory`
+
+    Whether the file corresponds to a directory.
+*   `bool is_symbolic_link`
+
+    Whether the file corresponds to a symbolic link.
+*   `SbTime last_modified`
+
+    The last modified time of a file.
+*   `SbTime last_accessed`
+
+    The last accessed time of a file.
+*   `SbTime creation_time`
+
+    The creation time of a file.
+
+## Functions ##
+
+### SbFileCanOpen ###
+
+Indicates whether SbFileOpen() with the given `flags` is allowed for `path`.
+
+`path`: The absolute path to be checked. `flags`: The flags that are being
+evaluated for the given `path`.
+
+#### Declaration ####
+
+```
+bool SbFileCanOpen(const char *path, int flags)
+```
+
+### SbFileClose ###
+
+Closes `file`. The return value indicates whether the file was closed
+successfully.
+
+`file`: The absolute path of the file to be closed.
+
+#### Declaration ####
+
+```
+bool SbFileClose(SbFile file)
+```
+
+### SbFileDelete ###
+
+Deletes the regular file, symlink, or empty directory at `path`. This function
+is used primarily to clean up after unit tests. On some platforms, this function
+fails if the file in question is being held open.
+
+`path`: The absolute path fo the file, symlink, or directory to be deleted.
+
+#### Declaration ####
+
+```
+bool SbFileDelete(const char *path)
+```
+
+### SbFileExists ###
+
+Indicates whether a file or directory exists at `path`.
+
+`path`: The absolute path of the file or directory being checked.
+
+#### Declaration ####
+
+```
+bool SbFileExists(const char *path)
+```
+
+### SbFileFlush ###
+
+Flushes the write buffer to `file`. Data written via SbFileWrite is not
+necessarily committed until the SbFile is flushed or closed.
+
+`file`: The SbFile to which the write buffer is flushed.
+
+#### Declaration ####
+
+```
+bool SbFileFlush(SbFile file)
+```
+
+### SbFileGetInfo ###
+
+Retrieves information about `file`. The return value indicates whether the file
+information was retrieved successfully.
+
+`file`: The SbFile for which information is retrieved. `out_info`: The variable
+into which the retrieved data is placed. This variable is not touched if the
+operation is not successful.
+
+#### Declaration ####
+
+```
+bool SbFileGetInfo(SbFile file, SbFileInfo *out_info)
+```
+
+### SbFileGetPathInfo ###
+
+Retrieves information about the file at `path`. The return value indicates
+whether the file information was retrieved successfully.
+
+`file`: The absolute path of the file for which information is retrieved.
+`out_info`: The variable into which the retrieved data is placed. This variable
+is not touched if the operation is not successful.
+
+#### Declaration ####
+
+```
+bool SbFileGetPathInfo(const char *path, SbFileInfo *out_info)
+```
+
+### SbFileIsValid ###
+
+Returns whether the given file handle is valid.
+
+#### Declaration ####
+
+```
+static bool SbFileIsValid(SbFile file)
+```
+
+### SbFileModeStringToFlags ###
+
+Converts an ISO `fopen()` mode string into flags that can be equivalently passed
+into SbFileOpen().
+
+`mode`: The mode string to be converted into flags.
+
+#### Declaration ####
+
+```
+int SbFileModeStringToFlags(const char *mode)
+```
+
+### SbFileOpen ###
+
+Opens the file at `path`, which must be absolute, creating it if specified by
+`flags`. The read/write position is at the beginning of the file.
+
+Note that this function only guarantees the correct behavior when `path` points
+to a file. The behavior is undefined if `path` points to a directory.
+
+`path`: The absolute path of the file to be opened. `flags`: `SbFileFlags` that
+determine how the file is used in the application. Among other things, `flags`
+can indicate whether the application should create `path` if `path` does not
+already exist. `out_created`: Starboard sets this value to `true` if a new file
+is created or if an old file is truncated to zero length to simulate a new file,
+which can happen if the `kSbFileCreateAlways` flag is set. Otherwise, Starboard
+sets this value to `false`. `out_error`: If `path` cannot be created, this is
+set to `kSbFileInvalid`. Otherwise, it is `NULL`.
+
+#### Declaration ####
+
+```
+SbFile SbFileOpen(const char *path, int flags, bool *out_created, SbFileError *out_error)
+```
+
+### SbFileRead ###
+
+Reads `size` bytes (or until EOF is reached) from `file` into `data`, starting
+at the file's current position.
+
+The return value specifies the number of bytes read or `-1` if there was an
+error. Note that this function does NOT make a best effort to read all data on
+all platforms; rather, it just reads however many bytes are quickly available.
+However, this function can be run in a loop to make it a best-effort read.
+
+`file`: The SbFile from which to read data. `data`: The variable to which data
+is read. `size`: The amount of data (in bytes) to read.
+
+#### Declaration ####
+
+```
+int SbFileRead(SbFile file, char *data, int size)
+```
+
+### SbFileReadAll ###
+
+Reads `size` bytes (or until EOF is reached) from `file` into `data`, starting
+at the file's current position.
+
+The return value specifies the number of bytes read or `-1` if there was an
+error. Note that, unlike `SbFileRead`, this function does make a best effort to
+read all data on all platforms. As such, it is not intended for stream-oriented
+files but instead for cases when the normal expectation is that `size` bytes can
+be read unless there is an error.
+
+`file`: The SbFile from which to read data. `data`: The variable to which data
+is read. `size`: The amount of data (in bytes) to read.
+
+#### Declaration ####
+
+```
+static int SbFileReadAll(SbFile file, char *data, int size)
+```
+
+### SbFileSeek ###
+
+Changes the current read/write position in `file`. The return value identifies
+the resultant current read/write position in the file (relative to the start) or
+`-1` in case of an error. This function might not support seeking past the end
+of the file on some platforms.
+
+`file`: The SbFile in which the read/write position will be changed. `whence`:
+The starting read/write position. The position is modified relative to this
+value. `offset`: The amount that the read/write position is changed, relative to
+`whence`.
+
+#### Declaration ####
+
+```
+int64_t SbFileSeek(SbFile file, SbFileWhence whence, int64_t offset)
+```
+
+### SbFileTruncate ###
+
+Truncates the given `file` to the given `length`. The return value indicates
+whether the file was truncated successfully.
+
+`file`: The file to be truncated. `length`: The expected length of the file
+after it is truncated. If `length` is greater than the current size of the file,
+then the file is extended with zeros. If `length` is negative, then the function
+is a no-op and returns `false`.
+
+#### Declaration ####
+
+```
+bool SbFileTruncate(SbFile file, int64_t length)
+```
+
+### SbFileWrite ###
+
+Writes the given buffer into `file` at the file's current position, overwriting
+any data that was previously there.
+
+The return value identifies the number of bytes written, or `-1` on error. Note
+that this function does NOT make a best effort to write all data; rather, it
+writes however many bytes can be written quickly. Generally, this means that it
+writes however many bytes as possible without blocking on IO. Run this function
+in a loop to ensure that all data is written.
+
+`file`: The SbFile to which data will be written. `data`: The data to be
+written. `size`: The amount of data (in bytes) to write.
+
+#### Declaration ####
+
+```
+int SbFileWrite(SbFile file, const char *data, int size)
+```
+
+### SbFileWriteAll ###
+
+Writes the given buffer into `file`, starting at the beginning of the file, and
+overwriting any data that was previously there. Unlike SbFileWrite, this
+function does make a best effort to write all data on all platforms.
+
+The return value identifies the number of bytes written, or `-1` on error.
+
+`file`: The file to which data will be written. `data`: The data to be written.
+`size`: The amount of data (in bytes) to write.
+
+#### Declaration ####
+
+```
+static int SbFileWriteAll(SbFile file, const char *data, int size)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/11/gles.md b/src/cobalt/site/docs/reference/starboard/modules/11/gles.md
new file mode 100644
index 0000000..e3a5508
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/11/gles.md
@@ -0,0 +1,315 @@
+---
+layout: doc
+title: "Starboard Module Reference: gles.h"
+---
+
+The GLES API provides an interface with accompanying type declarations and
+defines that together provide a single consistent method of GLES usage across
+platforms.
+
+This API is designed to abstract the differences between GLES implementations
+and versions on different systems, and to remove the requirement for any other
+code to directly pull in and use these system libraries.
+GLES Version
+
+This API has the ability to support GLES 3.0, however platforms are not required
+to support anything beyond GLES 2.0. The caller is responsible for ensuring that
+the functions from GLES 3.0 they are calling from the interface are valid.
+
+## Macros ##
+
+### SB_GL_DEPTH_BUFFER_BIT ###
+
+Previously defined in [https://www.khronos.org/registry/OpenGL/api/GLES2/gl2.h](https://www.khronos.org/registry/OpenGL/api/GLES2/gl2.h)
+
+### SB_GL_READ_BUFFER ###
+
+Previously defined in [https://www.khronos.org/registry/OpenGL/api/GLES3/gl3.h](https://www.khronos.org/registry/OpenGL/api/GLES3/gl3.h)
+.
+
+## Typedefs ##
+
+### SbGlBoolean ###
+
+The following type definitions were adapted from the types declared in [https://www.khronos.org/registry/OpenGL/api/GLES2/gl2.h](https://www.khronos.org/registry/OpenGL/api/GLES2/gl2.h)
+.
+
+#### Definition ####
+
+```
+typedef uint8_t SbGlBoolean
+```
+
+### SbGlIntPtr ###
+
+Some compilers will transform the intptr_t to an int transparently behind the
+scenes, which is not equivalent to a long int, or long long int, as far as the
+compiler is concerned. We check the Starboard configuration and set the types to
+those exact types used by OpenGL ES 2.0 ( [https://www.khronos.org/registry/OpenGL/api/GLES2/gl2ext.h](https://www.khronos.org/registry/OpenGL/api/GLES2/gl2ext.h)
+).
+
+#### Definition ####
+
+```
+typedef long int SbGlIntPtr
+```
+
+## Structs ##
+
+### SbGlesInterface ###
+
+#### Members ####
+
+*   `void(* glActiveTexture`
+
+    The following prototypes were adapted from the prototypes declared in [https://www.khronos.org/registry/OpenGL/api/GLES2/gl2.h](https://www.khronos.org/registry/OpenGL/api/GLES2/gl2.h)
+    .
+*   `void(* glAttachShader`
+*   `void(* glBindAttribLocation`
+*   `void(* glBindBuffer`
+*   `void(* glBindFramebuffer`
+*   `void(* glBindRenderbuffer`
+*   `void(* glBindTexture`
+*   `void(* glBlendColor`
+*   `void(* glBlendEquation`
+*   `void(* glBlendEquationSeparate`
+*   `void(* glBlendFunc`
+*   `void(* glBlendFuncSeparate`
+*   `void(* glBufferData`
+*   `void(* glBufferSubData`
+*   `SbGlEnum(* glCheckFramebufferStatus`
+*   `void(* glClear`
+*   `void(* glClearColor`
+*   `void(* glClearDepthf`
+*   `void(* glClearStencil`
+*   `void(* glColorMask`
+*   `void(* glCompileShader`
+*   `void(* glCompressedTexImage2D`
+*   `void(* glCompressedTexSubImage2D`
+*   `void(* glCopyTexImage2D`
+*   `void(* glCopyTexSubImage2D`
+*   `SbGlUInt32(* glCreateProgram`
+*   `SbGlUInt32(* glCreateShader`
+*   `void(* glCullFace`
+*   `void(* glDeleteBuffers`
+*   `void(* glDeleteFramebuffers`
+*   `void(* glDeleteProgram`
+*   `void(* glDeleteRenderbuffers`
+*   `void(* glDeleteShader`
+*   `void(* glDeleteTextures`
+*   `void(* glDepthFunc`
+*   `void(* glDepthMask`
+*   `void(* glDepthRangef`
+*   `void(* glDetachShader`
+*   `void(* glDisable`
+*   `void(* glDisableVertexAttribArray`
+*   `void(* glDrawArrays`
+*   `void(* glDrawElements`
+*   `void(* glEnable`
+*   `void(* glEnableVertexAttribArray`
+*   `void(* glFinish`
+*   `void(* glFlush`
+*   `void(* glFramebufferRenderbuffer`
+*   `void(* glFramebufferTexture2D`
+*   `void(* glFrontFace`
+*   `void(* glGenBuffers`
+*   `void(* glGenerateMipmap`
+*   `void(* glGenFramebuffers`
+*   `void(* glGenRenderbuffers`
+*   `void(* glGenTextures`
+*   `void(* glGetActiveAttrib`
+*   `void(* glGetActiveUniform`
+*   `void(* glGetAttachedShaders`
+*   `SbGlInt32(* glGetAttribLocation`
+*   `void(* glGetBooleanv`
+*   `void(* glGetBufferParameteriv`
+*   `SbGlEnum(* glGetError`
+*   `void(* glGetFloatv`
+*   `void(* glGetFramebufferAttachmentParameteriv`
+*   `void(* glGetIntegerv`
+*   `void(* glGetProgramiv`
+*   `void(* glGetProgramInfoLog`
+*   `void(* glGetRenderbufferParameteriv`
+*   `void(* glGetShaderiv`
+*   `void(* glGetShaderInfoLog`
+*   `void(* glGetShaderPrecisionFormat`
+*   `void(* glGetShaderSource`
+*   `const SbGlUInt8 *(* glGetString`
+*   `void(* glGetTexParameterfv`
+*   `void(* glGetTexParameteriv`
+*   `void(* glGetUniformfv`
+*   `void(* glGetUniformiv`
+*   `SbGlInt32(* glGetUniformLocation`
+*   `void(* glGetVertexAttribfv`
+*   `void(* glGetVertexAttribiv`
+*   `void(* glGetVertexAttribPointerv`
+*   `void(* glHint`
+*   `SbGlBoolean(* glIsBuffer`
+*   `SbGlBoolean(* glIsEnabled`
+*   `SbGlBoolean(* glIsFramebuffer`
+*   `SbGlBoolean(* glIsProgram`
+*   `SbGlBoolean(* glIsRenderbuffer`
+*   `SbGlBoolean(* glIsShader`
+*   `SbGlBoolean(* glIsTexture`
+*   `void(* glLineWidth`
+*   `void(* glLinkProgram`
+*   `void(* glPixelStorei`
+*   `void(* glPolygonOffset`
+*   `void(* glReadPixels`
+*   `void(* glReleaseShaderCompiler`
+*   `void(* glRenderbufferStorage`
+*   `void(* glSampleCoverage`
+*   `void(* glScissor`
+*   `void(* glShaderBinary`
+*   `void(* glShaderSource`
+*   `void(* glStencilFunc`
+*   `void(* glStencilFuncSeparate`
+*   `void(* glStencilMask`
+*   `void(* glStencilMaskSeparate`
+*   `void(* glStencilOp`
+*   `void(* glStencilOpSeparate`
+*   `void(* glTexImage2D`
+*   `void(* glTexParameterf`
+*   `void(* glTexParameterfv`
+*   `void(* glTexParameteri`
+*   `void(* glTexParameteriv`
+*   `void(* glTexSubImage2D`
+*   `void(* glUniform1f`
+*   `void(* glUniform1fv`
+*   `void(* glUniform1i`
+*   `void(* glUniform1iv`
+*   `void(* glUniform2f`
+*   `void(* glUniform2fv`
+*   `void(* glUniform2i`
+*   `void(* glUniform2iv`
+*   `void(* glUniform3f`
+*   `void(* glUniform3fv`
+*   `void(* glUniform3i`
+*   `void(* glUniform3iv`
+*   `void(* glUniform4f`
+*   `void(* glUniform4fv`
+*   `void(* glUniform4i`
+*   `void(* glUniform4iv`
+*   `void(* glUniformMatrix2fv`
+*   `void(* glUniformMatrix3fv`
+*   `void(* glUniformMatrix4fv`
+*   `void(* glUseProgram`
+*   `void(* glValidateProgram`
+*   `void(* glVertexAttrib1f`
+*   `void(* glVertexAttrib1fv`
+*   `void(* glVertexAttrib2f`
+*   `void(* glVertexAttrib2fv`
+*   `void(* glVertexAttrib3f`
+*   `void(* glVertexAttrib3fv`
+*   `void(* glVertexAttrib4f`
+*   `void(* glVertexAttrib4fv`
+*   `void(* glVertexAttribPointer`
+*   `void(* glViewport`
+*   `void(* glReadBuffer`
+
+    The following prototypes were adapted from the prototypes declared in [https://www.khronos.org/registry/OpenGL/api/GLES3/gl3.h](https://www.khronos.org/registry/OpenGL/api/GLES3/gl3.h)
+    .
+*   `void(* glDrawRangeElements`
+*   `void(* glTexImage3D`
+*   `void(* glTexSubImage3D`
+*   `void(* glCopyTexSubImage3D`
+*   `void(* glCompressedTexImage3D`
+*   `void(* glCompressedTexSubImage3D`
+*   `void(* glGenQueries`
+*   `void(* glDeleteQueries`
+*   `SbGlBoolean(* glIsQuery`
+*   `void(* glBeginQuery`
+*   `void(* glEndQuery`
+*   `void(* glGetQueryiv`
+*   `void(* glGetQueryObjectuiv`
+*   `SbGlBoolean(* glUnmapBuffer`
+*   `void(* glGetBufferPointerv`
+*   `void(* glDrawBuffers`
+*   `void(* glUniformMatrix2x3fv`
+*   `void(* glUniformMatrix3x2fv`
+*   `void(* glUniformMatrix2x4fv`
+*   `void(* glUniformMatrix4x2fv`
+*   `void(* glUniformMatrix3x4fv`
+*   `void(* glUniformMatrix4x3fv`
+*   `void(* glBlitFramebuffer`
+*   `void(* glRenderbufferStorageMultisample`
+*   `void(* glFramebufferTextureLayer`
+*   `void *(* glMapBufferRange`
+*   `void(* glFlushMappedBufferRange`
+*   `void(* glBindVertexArray`
+*   `void(* glDeleteVertexArrays`
+*   `void(* glGenVertexArrays`
+*   `SbGlBoolean(* glIsVertexArray`
+*   `void(* glGetIntegeri_v`
+*   `void(* glBeginTransformFeedback`
+*   `void(* glEndTransformFeedback`
+*   `void(* glBindBufferRange`
+*   `void(* glBindBufferBase`
+*   `void(* glTransformFeedbackVaryings`
+*   `void(* glGetTransformFeedbackVarying`
+*   `void(* glVertexAttribIPointer`
+*   `void(* glGetVertexAttribIiv`
+*   `void(* glGetVertexAttribIuiv`
+*   `void(* glVertexAttribI4i`
+*   `void(* glVertexAttribI4ui`
+*   `void(* glVertexAttribI4iv`
+*   `void(* glVertexAttribI4uiv`
+*   `void(* glGetUniformuiv`
+*   `SbGlInt32(* glGetFragDataLocation`
+*   `void(* glUniform1ui`
+*   `void(* glUniform2ui`
+*   `void(* glUniform3ui`
+*   `void(* glUniform4ui`
+*   `void(* glUniform1uiv`
+*   `void(* glUniform2uiv`
+*   `void(* glUniform3uiv`
+*   `void(* glUniform4uiv`
+*   `void(* glClearBufferiv`
+*   `void(* glClearBufferuiv`
+*   `void(* glClearBufferfv`
+*   `void(* glClearBufferfi`
+*   `const SbGlUInt8 *(* glGetStringi`
+*   `void(* glCopyBufferSubData`
+*   `void(* glGetUniformIndices`
+*   `void(* glGetActiveUniformsiv`
+*   `SbGlUInt32(* glGetUniformBlockIndex`
+*   `void(* glGetActiveUniformBlockiv`
+*   `void(* glGetActiveUniformBlockName`
+*   `void(* glUniformBlockBinding`
+*   `void(* glDrawArraysInstanced`
+*   `void(* glDrawElementsInstanced`
+*   `SbGlSync(* glFenceSync`
+*   `SbGlBoolean(* glIsSync`
+*   `void(* glDeleteSync`
+*   `SbGlEnum(* glClientWaitSync`
+*   `void(* glWaitSync`
+*   `void(* glGetInteger64v`
+*   `void(* glGetSynciv`
+*   `void(* glGetInteger64i_v`
+*   `void(* glGetBufferParameteri64v`
+*   `void(* glGenSamplers`
+*   `void(* glDeleteSamplers`
+*   `SbGlBoolean(* glIsSampler`
+*   `void(* glBindSampler`
+*   `void(* glSamplerParameteri`
+*   `void(* glSamplerParameteriv`
+*   `void(* glSamplerParameterf`
+*   `void(* glSamplerParameterfv`
+*   `void(* glGetSamplerParameteriv`
+*   `void(* glGetSamplerParameterfv`
+*   `void(* glVertexAttribDivisor`
+*   `void(* glBindTransformFeedback`
+*   `void(* glDeleteTransformFeedbacks`
+*   `void(* glGenTransformFeedbacks`
+*   `SbGlBoolean(* glIsTransformFeedback`
+*   `void(* glPauseTransformFeedback`
+*   `void(* glResumeTransformFeedback`
+*   `void(* glGetProgramBinary`
+*   `void(* glProgramBinary`
+*   `void(* glProgramParameteri`
+*   `void(* glInvalidateFramebuffer`
+*   `void(* glInvalidateSubFramebuffer`
+*   `void(* glTexStorage2D`
+*   `void(* glTexStorage3D`
+*   `void(* glGetInternalformativ`
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/11/image.md b/src/cobalt/site/docs/reference/starboard/modules/11/image.md
new file mode 100644
index 0000000..c911e41
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/11/image.md
@@ -0,0 +1,82 @@
+---
+layout: doc
+title: "Starboard Module Reference: image.h"
+---
+
+API for hardware accelerated image decoding. This module allows for the client
+to feed in raw, encoded data to be decoded directly into an SbDecodeTarget. It
+also provides an interface for the client to query what combinations of encoded
+image formats and SbDecodeTargetFormats are supported or not.
+
+All functions in this module are safe to call from any thread at any point in
+time.
+SbImageIsDecodeSupported and SbImageDecode Example
+
+Let's assume that we're on a Blitter platform.
+
+```
+SbDecodeTargetProvider* provider = GetProviderFromSomewhere();
+void* data = GetCompressedJPEGFromSomewhere();
+int data_size = GetCompressedJPEGSizeFromSomewhere();
+const char* mime_type = "image/jpeg";
+SbDecodeTargetFormat format = kSbDecodeTargetFormat1PlaneRGBA;
+
+if (!SbImageIsDecodeSupported(mime_type, format)) {
+  return;
+}
+
+SbDecodeTarget result_target = SbDecodeImage(provider, data, data_size,
+                                             mime_type, format);
+SbBlitterSurface surface =
+    SbDecodeTargetGetPlane(target, kSbDecodeTargetPlaneRGBA);
+// Do stuff with surface...
+
+```
+
+## Functions ##
+
+### SbImageDecode ###
+
+Attempt to decode encoded `mime_type` image data `data` of size `data_size` into
+an SbDecodeTarget of SbDecodeFormatType `format`, possibly using
+SbDecodeTargetProvider `provider`, if it is non-null. Thus, four following
+scenarios regarding the provider may happen:
+
+1.  The provider is required by the `SbImageDecode` implementation and no
+    provider is given. The implementation should gracefully fail by immediately
+    returning kSbDecodeTargetInvalid.
+
+1.  The provider is required and is passed in. The implementation will proceed
+    forward, using the SbDecodeTarget from the provider.
+
+1.  The provider is not required and is passed in. The provider will NOT be
+    called, and the implementation will proceed to decoding however it desires.
+
+1.  The provider is not required and is not passed in. The implementation will
+    proceed forward.
+
+Thus, it is NOT safe for clients of this API to assume that the `provider` it
+passes in will be called. Finally, if the decode succeeds, a new SbDecodeTarget
+will be allocated. If `mime_type` image decoding for the requested format is not
+supported or the decode fails, kSbDecodeTargetInvalid will be returned, with any
+intermediate allocations being cleaned up in the implementation.
+
+#### Declaration ####
+
+```
+SbDecodeTarget SbImageDecode(SbDecodeTargetGraphicsContextProvider *context_provider, void *data, int data_size, const char *mime_type, SbDecodeTargetFormat format)
+```
+
+### SbImageIsDecodeSupported ###
+
+Whether the current platform supports hardware accelerated decoding an image of
+mime type `mime_type` into SbDecodeTargetFormat `format`. The result of this
+function must not change over the course of the program, which means that the
+results of this function may be cached indefinitely.
+
+#### Declaration ####
+
+```
+bool SbImageIsDecodeSupported(const char *mime_type, SbDecodeTargetFormat format)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/11/input.md b/src/cobalt/site/docs/reference/starboard/modules/11/input.md
new file mode 100644
index 0000000..3554af6
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/11/input.md
@@ -0,0 +1,178 @@
+---
+layout: doc
+title: "Starboard Module Reference: input.h"
+---
+
+Defines input events and associated data types.
+
+## Enums ##
+
+### SbInputDeviceType ###
+
+Identifies possible input subsystem types. The types of events that each device
+type produces correspond to `SbInputEventType` values.
+
+#### Values ####
+
+*   `kSbInputDeviceTypeGesture`
+
+    Input from a gesture-detection mechanism. Examples include Kinect, Wiimotes,
+    etc...
+
+    Produces `Move`, `Press` and `Unpress` events.
+*   `kSbInputDeviceTypeGamepad`
+
+    Input from a gamepad, following the layout provided in the W3C Web Gamepad
+    API. [ [https://www.w3.org/TR/gamepad/](https://www.w3.org/TR/gamepad/) ]
+
+    Produces `Move`, `Press` and `Unpress` events.
+*   `kSbInputDeviceTypeKeyboard`
+
+    Keyboard input from a traditional keyboard or game controller chatpad.
+
+    Produces `Press` and `Unpress` events.
+*   `kSbInputDeviceTypeMouse`
+
+    Input from a traditional mouse.
+
+    Produces `Move`, `Press`, and `Unpress` events.
+*   `kSbInputDeviceTypeRemote`
+
+    Input from a TV remote-control-style device.
+
+    Produces `Press` and `Unpress` events.
+*   `kSbInputDeviceTypeTouchScreen`
+
+    Input from a single- or multi-touchscreen.
+
+    Produces `Move`, `Press`, and `Unpress` events.
+*   `kSbInputDeviceTypeTouchPad`
+
+    Input from a touchpad that is not masquerading as a mouse.
+
+    Produces `Move`, `Press`, and `Unpress` events.
+*   `kSbInputDeviceTypeOnScreenKeyboard`
+
+    Keyboard input from an on screen keyboard.
+
+    Produces `Input` events.
+
+### SbInputEventType ###
+
+The action that an input event represents.
+
+#### Values ####
+
+*   `kSbInputEventTypeMove`
+
+    Device Movement. In the case of `Mouse`, and perhaps `Gesture`, the movement
+    tracks an absolute cursor position. In the case of `TouchPad`, only relative
+    movements are provided.
+*   `kSbInputEventTypePress`
+
+    Key or button press activation. This could be a key on a keyboard, a button
+    on a mouse or game controller, a push from a touch screen, or a gesture. An
+    `Unpress` event is subsequently delivered when the `Press` event terminates,
+    such as when the key/button/finger is raised. Injecting repeat presses is up
+    to the client.
+*   `kSbInputEventTypeUnpress`
+
+    Key or button deactivation. The counterpart to the `Press` event, this event
+    is sent when the key or button being pressed is released.
+*   `kSbInputEventTypeWheel`
+
+    Wheel movement. Provides relative movements of the `Mouse` wheel.
+*   `kSbInputEventTypeInput`
+
+    [https://w3c.github.io/uievents/#event-type-input](https://w3c.github.io/uievents/#event-type-input)
+
+## Structs ##
+
+### SbInputData ###
+
+Event data for `kSbEventTypeInput` events.
+
+#### Members ####
+
+*   `SbTimeMonotonic timestamp`
+
+    The time that should be reported for this event. This is intended to
+    facilitate calculation of time-sensitive information (e.g. velocity for
+    kSbInputEventTypeMove). This may be set to 0 to have the relevant systems
+    automatically set the timestamp. However, this may happen at a later time,
+    so the relative time between events may not be preserved.
+*   `SbWindow window`
+
+    The window in which the input was generated.
+*   `SbInputEventType type`
+
+    The type of input event that this represents.
+*   `SbInputDeviceType device_type`
+
+    The type of device that generated this input event.
+*   `int device_id`
+
+    An identifier that is unique among all connected devices.
+*   `SbKey key`
+
+    An identifier that indicates which keyboard key or mouse button was involved
+    in this event, if any. All known keys for all devices are mapped to a single
+    ID space, defined by the `SbKey` enum in `key.h`.
+*   `wchar_t character`
+
+    The character that corresponds to the key. For an external keyboard, this
+    character also depends on the keyboard language. The value is `0` if there
+    is no corresponding character.
+*   `SbKeyLocation key_location`
+
+    The location of the specified key, in cases where there are multiple
+    instances of the button on the keyboard. For example, some keyboards have
+    more than one "shift" key.
+*   `unsigned int key_modifiers`
+
+    Key modifiers (e.g. `Ctrl`, `Shift`) held down during this input event.
+*   `SbInputVector position`
+
+    The (x, y) coordinates of the persistent cursor controlled by this device.
+    The value is `0` if this data is not applicable. For events with type
+    kSbInputEventTypeMove and device_type kSbInputDeviceTypeGamepad, this field
+    is interpreted as a stick position with the range [-1, 1], with positive
+    values for the down and right direction.
+*   `SbInputVector delta`
+
+    The relative motion vector of this input. The value is `0` if this data is
+    not applicable.
+*   `float pressure`
+
+    The normalized pressure of the pointer input in the range of [0,1], where 0
+    and 1 represent the minimum and maximum pressure the hardware is capable of
+    detecting, respectively. Use NaN for devices that do not report pressure.
+    This value is used for input events with device type mouse or touch screen.
+*   `SbInputVector size`
+
+    The (width, height) of the contact geometry of the pointer. This defines the
+    size of the area under the pointer position. If (NaN, NaN) is specified, the
+    value (0,0) will be used. This value is used for input events with device
+    type mouse or touch screen.
+*   `SbInputVector tilt`
+
+    The (x, y) angle in degrees, in the range of [-90, 90] of the pointer,
+    relative to the z axis. Positive values are for tilt to the right (x), and
+    towards the user (y). Use (NaN, NaN) for devices that do not report tilt.
+    This value is used for input events with device type mouse or touch screen.
+*   `const char * input_text`
+
+    The text to input for events of type `Input`.
+*   `bool is_composing`
+
+    Set to true if the input event is part of a composition event.
+
+### SbInputVector ###
+
+A 2-dimensional vector used to represent points and motion vectors.
+
+#### Members ####
+
+*   `float x`
+*   `float y`
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/11/key.md b/src/cobalt/site/docs/reference/starboard/modules/11/key.md
new file mode 100644
index 0000000..16be3c1
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/11/key.md
@@ -0,0 +1,293 @@
+---
+layout: doc
+title: "Starboard Module Reference: key.h"
+---
+
+Defines the canonical set of Starboard key codes.
+
+## Enums ##
+
+### SbKey ###
+
+A standard set of key codes, ordered by value, that represent each possible
+input key across all kinds of devices. Starboard uses the semi-standard Windows
+virtual key codes documented at: [https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731%28v=vs.85%29.aspx](https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731%28v=vs.85%29.aspx)
+
+#### Values ####
+
+*   `kSbKeyUnknown`
+*   `kSbKeyCancel`
+*   `kSbKeyBackspace`
+*   `kSbKeyBack`
+*   `kSbKeyTab`
+
+    semantic "back".
+*   `kSbKeyBacktab`
+*   `kSbKeyClear`
+*   `kSbKeyReturn`
+*   `kSbKeyShift`
+*   `kSbKeyControl`
+*   `kSbKeyMenu`
+*   `kSbKeyPause`
+*   `kSbKeyCapital`
+*   `kSbKeyKana`
+*   `kSbKeyHangul`
+*   `kSbKeyJunja`
+*   `kSbKeyFinal`
+*   `kSbKeyHanja`
+*   `kSbKeyKanji`
+*   `kSbKeyEscape`
+*   `kSbKeyConvert`
+*   `kSbKeyNonconvert`
+*   `kSbKeyAccept`
+*   `kSbKeyModechange`
+*   `kSbKeySpace`
+*   `kSbKeyPrior`
+*   `kSbKeyNext`
+*   `kSbKeyEnd`
+*   `kSbKeyHome`
+*   `kSbKeyLeft`
+*   `kSbKeyUp`
+*   `kSbKeyRight`
+*   `kSbKeyDown`
+*   `kSbKeySelect`
+*   `kSbKeyPrint`
+*   `kSbKeyExecute`
+*   `kSbKeySnapshot`
+*   `kSbKeyInsert`
+*   `kSbKeyDelete`
+*   `kSbKeyHelp`
+*   `kSbKey0`
+*   `kSbKey1`
+*   `kSbKey2`
+*   `kSbKey3`
+*   `kSbKey4`
+*   `kSbKey5`
+*   `kSbKey6`
+*   `kSbKey7`
+*   `kSbKey8`
+*   `kSbKey9`
+*   `kSbKeyA`
+*   `kSbKeyB`
+*   `kSbKeyC`
+*   `kSbKeyD`
+*   `kSbKeyE`
+*   `kSbKeyF`
+*   `kSbKeyG`
+*   `kSbKeyH`
+*   `kSbKeyI`
+*   `kSbKeyJ`
+*   `kSbKeyK`
+*   `kSbKeyL`
+*   `kSbKeyM`
+*   `kSbKeyN`
+*   `kSbKeyO`
+*   `kSbKeyP`
+*   `kSbKeyQ`
+*   `kSbKeyR`
+*   `kSbKeyS`
+*   `kSbKeyT`
+*   `kSbKeyU`
+*   `kSbKeyV`
+*   `kSbKeyW`
+*   `kSbKeyX`
+*   `kSbKeyY`
+*   `kSbKeyZ`
+*   `kSbKeyLwin`
+*   `kSbKeyCommand`
+*   `kSbKeyRwin`
+*   `kSbKeyApps`
+*   `kSbKeySleep`
+*   `kSbKeyNumpad0`
+*   `kSbKeyNumpad1`
+*   `kSbKeyNumpad2`
+*   `kSbKeyNumpad3`
+*   `kSbKeyNumpad4`
+*   `kSbKeyNumpad5`
+*   `kSbKeyNumpad6`
+*   `kSbKeyNumpad7`
+*   `kSbKeyNumpad8`
+*   `kSbKeyNumpad9`
+*   `kSbKeyMultiply`
+*   `kSbKeyAdd`
+*   `kSbKeySeparator`
+*   `kSbKeySubtract`
+*   `kSbKeyDecimal`
+*   `kSbKeyDivide`
+*   `kSbKeyF1`
+*   `kSbKeyF2`
+*   `kSbKeyF3`
+*   `kSbKeyF4`
+*   `kSbKeyF5`
+*   `kSbKeyF6`
+*   `kSbKeyF7`
+*   `kSbKeyF8`
+*   `kSbKeyF9`
+*   `kSbKeyF10`
+*   `kSbKeyF11`
+*   `kSbKeyF12`
+*   `kSbKeyF13`
+*   `kSbKeyF14`
+*   `kSbKeyF15`
+*   `kSbKeyF16`
+*   `kSbKeyF17`
+*   `kSbKeyF18`
+*   `kSbKeyF19`
+*   `kSbKeyF20`
+*   `kSbKeyF21`
+*   `kSbKeyF22`
+*   `kSbKeyF23`
+*   `kSbKeyF24`
+*   `kSbKeyNumlock`
+*   `kSbKeyScroll`
+*   `kSbKeyWlan`
+*   `kSbKeyPower`
+*   `kSbKeyLshift`
+*   `kSbKeyRshift`
+*   `kSbKeyLcontrol`
+*   `kSbKeyRcontrol`
+*   `kSbKeyLmenu`
+*   `kSbKeyRmenu`
+*   `kSbKeyBrowserBack`
+*   `kSbKeyBrowserForward`
+*   `kSbKeyBrowserRefresh`
+*   `kSbKeyBrowserStop`
+*   `kSbKeyBrowserSearch`
+*   `kSbKeyBrowserFavorites`
+*   `kSbKeyBrowserHome`
+*   `kSbKeyVolumeMute`
+*   `kSbKeyVolumeDown`
+*   `kSbKeyVolumeUp`
+*   `kSbKeyMediaNextTrack`
+*   `kSbKeyMediaPrevTrack`
+*   `kSbKeyMediaStop`
+*   `kSbKeyMediaPlayPause`
+*   `kSbKeyMediaLaunchMail`
+*   `kSbKeyMediaLaunchMediaSelect`
+*   `kSbKeyMediaLaunchApp1`
+*   `kSbKeyMediaLaunchApp2`
+*   `kSbKeyOem1`
+*   `kSbKeyOemPlus`
+*   `kSbKeyOemComma`
+*   `kSbKeyOemMinus`
+*   `kSbKeyOemPeriod`
+*   `kSbKeyOem2`
+*   `kSbKeyOem3`
+*   `kSbKeyBrightnessDown`
+*   `kSbKeyBrightnessUp`
+*   `kSbKeyKbdBrightnessDown`
+*   `kSbKeyOem4`
+*   `kSbKeyOem5`
+*   `kSbKeyOem6`
+*   `kSbKeyOem7`
+*   `kSbKeyOem8`
+*   `kSbKeyOem102`
+*   `kSbKeyKbdBrightnessUp`
+*   `kSbKeyDbeSbcschar`
+*   `kSbKeyDbeDbcschar`
+*   `kSbKeyPlay`
+*   `kSbKeyMediaRewind`
+
+    Other supported CEA 2014 keys.
+*   `kSbKeyMediaFastForward`
+*   `kSbKeyRed`
+
+    Key codes from the DTV Application Software Environment, [http://www.atsc.org/wp-content/uploads/2015/03/a_100_4.pdf](http://www.atsc.org/wp-content/uploads/2015/03/a_100_4.pdf)
+*   `kSbKeyGreen`
+*   `kSbKeyYellow`
+*   `kSbKeyBlue`
+*   `kSbKeyChannelUp`
+*   `kSbKeyChannelDown`
+*   `kSbKeySubtitle`
+*   `kSbKeyClosedCaption`
+*   `kSbKeyInfo`
+*   `kSbKeyGuide`
+*   `kSbKeyLast`
+
+    Key codes from OCAP, [https://apps.cablelabs.com/specification/opencable-application-platform-ocap/](https://apps.cablelabs.com/specification/opencable-application-platform-ocap/)
+*   `kSbKeyPreviousChannel`
+*   `kSbKeyInstantReplay`
+
+    Also from OCAP
+*   `kSbKeyLaunchThisApplication`
+
+    A button that will directly launch the current application.
+*   `kSbKeyMediaAudioTrack`
+
+    A button that will switch between different available audio tracks.
+*   `kSbKeyMicrophone`
+
+    A button that will trigger voice input.
+*   `kSbKeyMouse1`
+
+    Mouse buttons, starting with the left mouse button.
+*   `kSbKeyMouse2`
+*   `kSbKeyMouse3`
+*   `kSbKeyMouse4`
+*   `kSbKeyMouse5`
+*   `kSbKeyGamepad1`
+
+    Xbox A, PS O or X (depending on region), Switch A
+*   `kSbKeyGamepad2`
+
+    Xbox B, PS X or O (depending on region), Switch B
+*   `kSbKeyGamepad3`
+
+    Xbox X, PS square, Switch X
+*   `kSbKeyGamepad4`
+
+    Xbox Y, PS triangle, Switch Y
+*   `kSbKeyGamepadLeftBumper`
+
+    Pretty much every gamepad has bumpers at the top front of the controller,
+    and triggers at the bottom front of the controller.
+*   `kSbKeyGamepadRightBumper`
+*   `kSbKeyGamepadLeftTrigger`
+*   `kSbKeyGamepadRightTrigger`
+*   `kSbKeyGamepad5`
+
+    Xbox 360 Back, XB1 minimize, PS and WiiU Select
+*   `kSbKeyGamepad6`
+
+    Xbox 360 Play, XB1 Menu, PS and WiiU Start
+*   `kSbKeyGamepadLeftStick`
+
+    This refers to pressing the left stick like a button.
+*   `kSbKeyGamepadRightStick`
+
+    This refers to pressing the right stick like a button.
+*   `kSbKeyGamepadDPadUp`
+*   `kSbKeyGamepadDPadDown`
+*   `kSbKeyGamepadDPadLeft`
+*   `kSbKeyGamepadDPadRight`
+*   `kSbKeyGamepadSystem`
+
+    The system key in the middle of the gamepad, if it exists.
+*   `kSbKeyGamepadLeftStickUp`
+
+    Codes for thumbstick to virtual dpad conversions.
+*   `kSbKeyGamepadLeftStickDown`
+*   `kSbKeyGamepadLeftStickLeft`
+*   `kSbKeyGamepadLeftStickRight`
+*   `kSbKeyGamepadRightStickUp`
+*   `kSbKeyGamepadRightStickDown`
+*   `kSbKeyGamepadRightStickLeft`
+*   `kSbKeyGamepadRightStickRight`
+
+### SbKeyModifiers ###
+
+Bit-mask of key modifiers.
+
+#### Values ####
+
+*   `kSbKeyModifiersNone`
+*   `kSbKeyModifiersAlt`
+*   `kSbKeyModifiersCtrl`
+*   `kSbKeyModifiersMeta`
+*   `kSbKeyModifiersShift`
+*   `kSbKeyModifiersPointerButtonLeft`
+*   `kSbKeyModifiersPointerButtonRight`
+*   `kSbKeyModifiersPointerButtonMiddle`
+*   `kSbKeyModifiersPointerButtonBack`
+*   `kSbKeyModifiersPointerButtonForward`
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/11/log.md b/src/cobalt/site/docs/reference/starboard/modules/11/log.md
new file mode 100644
index 0000000..1ad6c24
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/11/log.md
@@ -0,0 +1,137 @@
+---
+layout: doc
+title: "Starboard Module Reference: log.h"
+---
+
+Defines core debug logging functions.
+
+## Enums ##
+
+### SbLogPriority ###
+
+The priority at which a message should be logged. The platform may be configured
+to filter logs by priority, or render them differently.
+
+#### Values ####
+
+*   `kSbLogPriorityUnknown`
+*   `kSbLogPriorityInfo`
+*   `kSbLogPriorityWarning`
+*   `kSbLogPriorityError`
+*   `kSbLogPriorityFatal`
+
+## Functions ##
+
+### SbLog ###
+
+Writes `message` to the platform's debug output log. This method is thread-safe,
+and responsible for ensuring that the output from multiple threads is not mixed.
+
+`priority`: The SbLogPriority at which the message should be logged. Note that
+passing `kSbLogPriorityFatal` does not terminate the program. Such a policy must
+be enforced at the application level. In fact, `priority` may be completely
+ignored on many platforms. `message`: The message to be logged. No formatting is
+required to be done on the value, including newline termination. That said,
+platforms can adjust the message to be more suitable for their output method by
+wrapping the text, stripping unprintable characters, etc.
+
+#### Declaration ####
+
+```
+void SbLog(SbLogPriority priority, const char *message)
+```
+
+### SbLogFlush ###
+
+Flushes the log buffer on some platforms. This method is safe to call from
+multiple threads.
+
+#### Declaration ####
+
+```
+void SbLogFlush()
+```
+
+### SbLogFormat ###
+
+A log output method that additionally performs a string format on the data being
+logged.
+
+#### Declaration ####
+
+```
+void SbLogFormat(const char *format, va_list args) SB_PRINTF_FORMAT(1
+```
+
+### SbLogFormatF ###
+
+Inline wrapper of SbLogFormat that converts from ellipsis to va_args.
+
+#### Declaration ####
+
+```
+void static void void SbLogFormatF(const char *format,...) SB_PRINTF_FORMAT(1
+```
+
+### SbLogIsTty ###
+
+Indicates whether the log output goes to a TTY or is being redirected.
+
+#### Declaration ####
+
+```
+bool SbLogIsTty()
+```
+
+### SbLogRaw ###
+
+A bare-bones log output method that is async-signal-safe, i.e. safe to call from
+an asynchronous signal handler (e.g. a `SIGSEGV` handler). It should not do any
+additional formatting.
+
+`message`: The message to be logged.
+
+#### Declaration ####
+
+```
+void SbLogRaw(const char *message)
+```
+
+### SbLogRawDumpStack ###
+
+Dumps the stack of the current thread to the log in an async-signal-safe manner,
+i.e. safe to call from an asynchronous signal handler (e.g. a `SIGSEGV`
+handler). Does not include SbLogRawDumpStack itself.
+
+`frames_to_skip`: The number of frames to skip from the top of the stack when
+dumping the current thread to the log. This parameter lets you remove noise from
+helper functions that might end up on top of every stack dump so that the stack
+dump is just the relevant function stack where the problem occurred.
+
+#### Declaration ####
+
+```
+void SbLogRawDumpStack(int frames_to_skip)
+```
+
+### SbLogRawFormat ###
+
+A formatted log output method that is async-signal-safe, i.e. safe to call from
+an asynchronous signal handler (e.g. a `SIGSEGV` handler).
+
+#### Declaration ####
+
+```
+void SbLogRawFormat(const char *format, va_list args) SB_PRINTF_FORMAT(1
+```
+
+### SbLogRawFormatF ###
+
+Inline wrapper of SbLogFormat to convert from ellipsis to va_args.
+
+#### Declaration ####
+
+```
+void static void void SbLogRawFormatF(const char *format,...) SB_PRINTF_FORMAT(1
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/11/media.md b/src/cobalt/site/docs/reference/starboard/modules/11/media.md
new file mode 100644
index 0000000..8d94612
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/11/media.md
@@ -0,0 +1,720 @@
+---
+layout: doc
+title: "Starboard Module Reference: media.h"
+---
+
+Provides media definitions that are common between the Decoder and Player
+interfaces.
+
+## Macros ##
+
+### kSbMediaBitsPerPixelInvalid ###
+
+Value used when a video's bits per pixel is not known.
+
+### kSbMediaVideoResolutionDimensionInvalid ###
+
+Value used when a video's resolution is not known.
+
+## Enums ##
+
+### SbMediaAudioCodec ###
+
+Types of audio elementary streams that can be supported.
+
+#### Values ####
+
+*   `kSbMediaAudioCodecNone`
+*   `kSbMediaAudioCodecAac`
+*   `kSbMediaAudioCodecAc3`
+*   `kSbMediaAudioCodecEac3`
+*   `kSbMediaAudioCodecOpus`
+*   `kSbMediaAudioCodecVorbis`
+
+### SbMediaAudioCodingType ###
+
+Possible audio coding types.
+
+#### Values ####
+
+*   `kSbMediaAudioCodingTypeNone`
+*   `kSbMediaAudioCodingTypeAac`
+*   `kSbMediaAudioCodingTypeAc3`
+*   `kSbMediaAudioCodingTypeAtrac`
+*   `kSbMediaAudioCodingTypeBitstream`
+*   `kSbMediaAudioCodingTypeDolbyDigitalPlus`
+*   `kSbMediaAudioCodingTypeDts`
+*   `kSbMediaAudioCodingTypeMpeg1`
+*   `kSbMediaAudioCodingTypeMpeg2`
+*   `kSbMediaAudioCodingTypeMpeg3`
+*   `kSbMediaAudioCodingTypePcm`
+
+### SbMediaAudioConnector ###
+
+Possible audio connector types.
+
+#### Values ####
+
+*   `kSbMediaAudioConnectorNone`
+*   `kSbMediaAudioConnectorAnalog`
+*   `kSbMediaAudioConnectorBluetooth`
+*   `kSbMediaAudioConnectorHdmi`
+*   `kSbMediaAudioConnectorNetwork`
+*   `kSbMediaAudioConnectorSpdif`
+*   `kSbMediaAudioConnectorUsb`
+
+### SbMediaAudioFrameStorageType ###
+
+Possible audio frame storage types.
+
+#### Values ####
+
+*   `kSbMediaAudioFrameStorageTypeInterleaved`
+
+    The samples of a multi-channel audio stream are stored in one continuous
+    buffer. Samples at the same timestamp are stored one after another. For
+    example, for a stereo stream with channels L and R that contains samples
+    with timestamps 0, 1, 2, etc., the samples are stored in one buffer as "L0
+    R0 L1 R1 L2 R2 ...".
+*   `kSbMediaAudioFrameStorageTypePlanar`
+
+    The samples of each channel are stored in their own continuous buffer. For
+    example, for a stereo stream with channels L and R that contains samples
+    with timestamps 0, 1, 2, etc., the samples are stored in two buffers "L0 L1
+    L2 ..." and "R0 R1 R2 ...".
+
+### SbMediaAudioSampleType ###
+
+Possible audio sample types.
+
+#### Values ####
+
+*   `kSbMediaAudioSampleTypeInt16Deprecated`
+*   `kSbMediaAudioSampleTypeFloat32`
+
+### SbMediaRangeId ###
+
+This corresponds to the WebM Range enum which is part of WebM color data (see [http://www.webmproject.org/docs/container/#Range](http://www.webmproject.org/docs/container/#Range)
+). H.264 only uses a bool, which corresponds to the LIMITED/FULL values. Chrome-
+specific values start at 1000.
+
+#### Values ####
+
+*   `kSbMediaRangeIdUnspecified`
+
+    Range is not explicitly specified / unknown.
+*   `kSbMediaRangeIdLimited`
+
+    Limited Rec. 709 color range with RGB values ranging from 16 to 235.
+*   `kSbMediaRangeIdFull`
+
+    Full RGB color range with RGB valees from 0 to 255.
+*   `kSbMediaRangeIdDerived`
+
+    Range is defined by TransferId/MatrixId.
+*   `kSbMediaRangeIdLast`
+
+### SbMediaSupportType ###
+
+Indicates how confident the device is that it can play media resources of the
+given type. The values are a direct map of the canPlayType() method specified at
+the following link: [https://www.w3.org/TR/2011/WD-html5-20110113/video.html#dom-navigator-canplaytype](https://www.w3.org/TR/2011/WD-html5-20110113/video.html#dom-navigator-canplaytype)
+
+#### Values ####
+
+*   `kSbMediaSupportTypeNotSupported`
+
+    The media type cannot be played.
+*   `kSbMediaSupportTypeMaybe`
+
+    Cannot determinate if the media type is playable without playing it.
+*   `kSbMediaSupportTypeProbably`
+
+    The media type seems to be playable.
+
+### SbMediaType ###
+
+Types of media component streams.
+
+#### Values ####
+
+*   `kSbMediaTypeAudio`
+
+    Value used for audio streams.
+*   `kSbMediaTypeVideo`
+
+    Value used for video streams.
+
+### SbMediaVideoCodec ###
+
+Types of video elementary streams that could be supported.
+
+#### Values ####
+
+*   `kSbMediaVideoCodecNone`
+*   `kSbMediaVideoCodecH264`
+*   `kSbMediaVideoCodecH265`
+*   `kSbMediaVideoCodecMpeg2`
+*   `kSbMediaVideoCodecTheora`
+*   `kSbMediaVideoCodecVc1`
+*   `kSbMediaVideoCodecAv1`
+*   `kSbMediaVideoCodecVp8`
+*   `kSbMediaVideoCodecVp9`
+
+## Structs ##
+
+### SbMediaAudioConfiguration ###
+
+A structure describing the audio configuration parameters of a single audio
+output.
+
+#### Members ####
+
+*   `int index`
+
+    The platform-defined index of the associated audio output.
+*   `SbMediaAudioConnector connector`
+
+    The type of audio connector. Will be the empty `kSbMediaAudioConnectorNone`
+    if this device cannot provide this information.
+*   `SbTime latency`
+
+    The expected latency of audio over this output, in microseconds, or `0` if
+    this device cannot provide this information.
+*   `SbMediaAudioCodingType coding_type`
+
+    The type of audio coding used over this connection.
+*   `int number_of_channels`
+
+    The number of audio channels currently supported by this device output, or
+    `0` if this device cannot provide this information, in which case the caller
+    can probably assume stereo output.
+
+### SbMediaAudioSampleInfo ###
+
+An audio sample info, which is a description of a given audio sample. This, in
+hexadecimal string form, acts as a set of instructions to the audio decoder.
+
+The audio sample info consists of a little-endian hexadecimal encoded
+`WAVEFORMATEX` structure followed by an Audio-specific configuration field. The
+`WAVEFORMATEX` structure is specified at: [http://msdn.microsoft.com/en-us/library/dd390970(v=vs.85).aspx](http://msdn.microsoft.com/en-us/library/dd390970(v=vs.85).aspx)
+
+#### Members ####
+
+*   `SbMediaAudioCodec codec`
+
+    The audio codec of this sample.
+*   `const char * mime`
+
+    The mime of the audio stream when `codec` isn't kSbMediaAudioCodecNone. It
+    may point to an empty string if the mime is not available, and it can only
+    be set to NULL when `codec` is kSbMediaAudioCodecNone.
+*   `uint16_t format_tag`
+
+    The waveform-audio format type code.
+*   `uint16_t number_of_channels`
+
+    The number of audio channels in this format. `1` for mono, `2` for stereo.
+*   `uint32_t samples_per_second`
+
+    The sampling rate.
+*   `uint32_t average_bytes_per_second`
+
+    The number of bytes per second expected with this format.
+*   `uint16_t block_alignment`
+
+    Byte block alignment, e.g, 4.
+*   `uint16_t bits_per_sample`
+
+    The bit depth for the stream this represents, e.g. `8` or `16`.
+*   `uint16_t audio_specific_config_size`
+
+    The size, in bytes, of the audio_specific_config.
+*   `const void * audio_specific_config`
+
+    The AudioSpecificConfig, as specified in ISO/IEC-14496-3, section 1.6.2.1: [http://read.pudn.com/downloads98/doc/comm/401153/14496/ISO_IEC_14496-3%20Part%203%20Audio/C036083E_SUB1.PDF](http://read.pudn.com/downloads98/doc/comm/401153/14496/ISO_IEC_14496-3%20Part%203%20Audio/C036083E_SUB1.PDF)
+
+### SbMediaColorMetadata ###
+
+HDR (High Dynamic Range) Metadata common for HDR10 and WebM/VP9-based HDR
+formats, together with the ColorSpace. HDR reproduces a greater dynamic range of
+luminosity than is possible with standard digital imaging. See the Consumer
+Electronics Association press release: [https://www.cta.tech/News/Press-Releases/2015/August/CEA-Defines-%E2%80%98HDR-Compatible%E2%80%99-Displays.aspx](https://www.cta.tech/News/Press-Releases/2015/August/CEA-Defines-%E2%80%98HDR-Compatible%E2%80%99-Displays.aspx)
+
+#### Members ####
+
+*   `unsigned int bits_per_channel`
+
+    Number of decoded bits per channel. A value of 0 indicates that the
+    BitsPerChannel is unspecified.
+*   `unsigned int chroma_subsampling_horizontal`
+
+    The amount of pixels to remove in the Cr and Cb channels for every pixel not
+    removed horizontally. Example: For video with 4:2:0 chroma subsampling, the
+    `chroma_subsampling_horizontal` should be set to 1.
+*   `unsigned int chroma_subsampling_vertical`
+
+    The amount of pixels to remove in the Cr and Cb channels for every pixel not
+    removed vertically. Example: For video with 4:2:0 chroma subsampling, the
+    `chroma_subsampling_vertical` should be set to 1.
+*   `unsigned int cb_subsampling_horizontal`
+
+    The amount of pixels to remove in the Cb channel for every pixel not removed
+    horizontally. This is additive with ChromaSubsamplingHorz. Example: For
+    video with 4:2:1 chroma subsampling, the `chroma_subsampling_horizontal`
+    should be set to 1 and `cb_subsampling_horizontal` should be set to 1.
+*   `unsigned int cb_subsampling_vertical`
+
+    The amount of pixels to remove in the Cb channel for every pixel not removed
+    vertically. This is additive with `chroma_subsampling_vertical`.
+*   `unsigned int chroma_siting_horizontal`
+
+    How chroma is subsampled horizontally. (0: Unspecified, 1: Left Collocated,
+    2: Half)
+*   `unsigned int chroma_siting_vertical`
+
+    How chroma is subsampled vertically. (0: Unspecified, 1: Top Collocated, 2:
+    Half)
+*   `SbMediaMasteringMetadata mastering_metadata`
+
+    [HDR Metadata field] SMPTE 2086 mastering data.
+*   `unsigned int max_cll`
+
+    [HDR Metadata field] Maximum brightness of a single pixel (Maximum Content
+    Light Level) in candelas per square meter (cd/m^2).
+*   `unsigned int max_fall`
+
+    [HDR Metadata field] Maximum brightness of a single full frame (Maximum
+    Frame-Average Light Level) in candelas per square meter (cd/m^2).
+*   `SbMediaPrimaryId primaries`
+
+    [Color Space field] The colour primaries of the video. For clarity, the
+    value and meanings for Primaries are adopted from Table 2 of ISO/IEC
+    23001-8:2013/DCOR1. (0: Reserved, 1: ITU-R BT.709, 2: Unspecified, 3:
+    Reserved, 4: ITU-R BT.470M, 5: ITU-R BT.470BG, 6: SMPTE 170M, 7: SMPTE 240M,
+    8: FILM, 9: ITU-R BT.2020, 10: SMPTE ST 428-1, 22: JEDEC P22 phosphors)
+*   `SbMediaTransferId transfer`
+
+    [Color Space field] The transfer characteristics of the video. For clarity,
+    the value and meanings for TransferCharacteristics 1-15 are adopted from
+    Table 3 of ISO/IEC 23001-8:2013/DCOR1. TransferCharacteristics 16-18 are
+    proposed values. (0: Reserved, 1: ITU-R BT.709, 2: Unspecified, 3: Reserved,
+    4: Gamma 2.2 curve, 5: Gamma 2.8 curve, 6: SMPTE 170M, 7: SMPTE 240M, 8:
+    Linear, 9: Log, 10: Log Sqrt, 11: IEC 61966-2-4, 12: ITU-R BT.1361 Extended
+    Colour Gamut, 13: IEC 61966-2-1, 14: ITU-R BT.2020 10 bit, 15: ITU-R BT.2020
+    12 bit, 16: SMPTE ST 2084, 17: SMPTE ST 428-1 18: ARIB STD-B67 (HLG))
+*   `SbMediaMatrixId matrix`
+
+    [Color Space field] The Matrix Coefficients of the video used to derive luma
+    and chroma values from red, green, and blue color primaries. For clarity,
+    the value and meanings for MatrixCoefficients are adopted from Table 4 of
+    ISO/IEC 23001-8:2013/DCOR1. (0:GBR, 1: BT709, 2: Unspecified, 3: Reserved,
+    4: FCC, 5: BT470BG, 6: SMPTE 170M, 7: SMPTE 240M, 8: YCOCG, 9: BT2020 Non-
+    constant Luminance, 10: BT2020 Constant Luminance)
+*   `SbMediaRangeId range`
+
+    [Color Space field] Clipping of the color ranges. (0: Unspecified, 1:
+    Broadcast Range, 2: Full range (no clipping), 3: Defined by
+    MatrixCoefficients/TransferCharacteristics)
+*   `float custom_primary_matrix`
+
+    [Color Space field] Only used if primaries == kSbMediaPrimaryIdCustom. This
+    a row-major ordered 3 x 4 submatrix of the 4 x 4 transform matrix. The 4th
+    row is completed as (0, 0, 0, 1).
+
+### SbMediaMasteringMetadata ###
+
+SMPTE 2086 mastering data [http://ieeexplore.ieee.org/document/7291707/](http://ieeexplore.ieee.org/document/7291707/)
+This standard specifies the metadata items to specify the color volume (the
+color primaries, white point, and luminance range) of the display that was used
+in mastering video content. The metadata is specified as a set of values
+independent of any specific digital representation. Also see the WebM container
+guidelines: [https://www.webmproject.org/docs/container/](https://www.webmproject.org/docs/container/)
+
+#### Members ####
+
+*   `float primary_r_chromaticity_x`
+
+    Red X chromaticity coordinate as defined by CIE 1931. In range [0, 1].
+*   `float primary_r_chromaticity_y`
+
+    Red Y chromaticity coordinate as defined by CIE 1931. In range [0, 1].
+*   `float primary_g_chromaticity_x`
+
+    Green X chromaticity coordinate as defined by CIE 1931. In range [0, 1].
+*   `float primary_g_chromaticity_y`
+
+    Green Y chromaticity coordinate as defined by CIE 1931. In range [0, 1].
+*   `float primary_b_chromaticity_x`
+
+    Blue X chromaticity coordinate as defined by CIE 1931. In range [0, 1].
+*   `float primary_b_chromaticity_y`
+
+    Blue Y chromaticity coordinate as defined by CIE 1931. In range [0, 1].
+*   `float white_point_chromaticity_x`
+
+    White X chromaticity coordinate as defined by CIE 1931. In range [0, 1].
+*   `float white_point_chromaticity_y`
+
+    White Y chromaticity coordinate as defined by CIE 1931. In range [0, 1].
+*   `float luminance_max`
+
+    Maximum luminance. Shall be represented in candelas per square meter
+    (cd/m^2). In range [0, 9999.99].
+*   `float luminance_min`
+
+    Minimum luminance. Shall be represented in candelas per square meter
+    (cd/m^2). In range [0, 9999.99].
+
+### SbMediaVideoSampleInfo ###
+
+The set of information required by the decoder or player for each video sample.
+
+#### Members ####
+
+*   `SbMediaVideoCodec codec`
+
+    The video codec of this sample.
+*   `const char * mime`
+
+    The mime of the video stream when `codec` isn't kSbMediaVideoCodecNone. It
+    may point to an empty string if the mime is not available, and it can only
+    be set to NULL when `codec` is kSbMediaVideoCodecNone.
+*   `const char * max_video_capabilities`
+
+    Indicates the max video capabilities required. The web app will not provide
+    a video stream exceeding the maximums described by this parameter. Allows
+    the platform to optimize playback pipeline for low quality video streams if
+    it knows that it will never adapt to higher quality streams. The string uses
+    the same format as the string passed in to SbMediaCanPlayMimeAndKeySystem(),
+    for example, when it is set to "width=1920; height=1080; framerate=15;", the
+    video will never adapt to resolution higher than 1920x1080 or frame per
+    second higher than 15 fps. When the maximums are unknown, this will be set
+    to an empty string. It can only be set to NULL when `codec` is
+    kSbMediaVideoCodecNone.
+*   `bool is_key_frame`
+
+    Indicates whether the associated sample is a key frame (I-frame). Video key
+    frames must always start with SPS and PPS NAL units.
+*   `int frame_width`
+
+    The frame width of this sample, in pixels. Also could be parsed from the
+    Sequence Parameter Set (SPS) NAL Unit. Frame dimensions must only change on
+    key frames, but may change on any key frame.
+*   `int frame_height`
+
+    The frame height of this sample, in pixels. Also could be parsed from the
+    Sequence Parameter Set (SPS) NAL Unit. Frame dimensions must only change on
+    key frames, but may change on any key frame.
+*   `SbMediaColorMetadata color_metadata`
+
+    HDR metadata common for HDR10 and WebM/VP9-based HDR formats as well as the
+    Color Space, and Color elements: MatrixCoefficients, BitsPerChannel,
+    ChromaSubsamplingHorz, ChromaSubsamplingVert, CbSubsamplingHorz,
+    CbSubsamplingVert, ChromaSitingHorz, ChromaSitingVert, Range,
+    TransferCharacteristics, and Primaries described here: [https://matroska.org/technical/specs/index.html](https://matroska.org/technical/specs/index.html)
+    . This will only be specified on frames where the HDR metadata and color /
+    color space might have changed (e.g. keyframes).
+
+## Functions ##
+
+### SbMediaCanPlayMimeAndKeySystem ###
+
+Returns information about whether the playback of the specific media described
+by `mime` and encrypted using `key_system` can be played.
+
+Note that neither `mime` nor `key_system` can be NULL. This function returns
+`kSbMediaSupportNotSupported` if either is NULL.
+
+`mime`: The mime information of the media in the form of `video/webm` or
+`video/mp4; codecs="avc1.42001E"`. It may include arbitrary parameters like
+"codecs", "channels", etc. Note that the "codecs" parameter may contain more
+than one codec, delimited by comma. `key_system`: A lowercase value in fhe form
+of "com.example.somesystem" as suggested by [https://w3c.github.io/encrypted-media/#key-system](https://w3c.github.io/encrypted-media/#key-system)) that can
+be matched exactly with known DRM key systems of the platform. When `key_system`
+is an empty string, the return value is an indication for non-encrypted media.
+
+#### Declaration ####
+
+```
+SbMediaSupportType SbMediaCanPlayMimeAndKeySystem(const char *mime, const char *key_system)
+```
+
+### SbMediaGetAudioBufferBudget ###
+
+Specifies the maximum amount of memory used by audio buffers of media source
+before triggering a garbage collection. A large value will cause more memory
+being used by audio buffers but will also make the app less likely to re-
+download audio data. Note that the app may experience significant difficulty if
+this value is too low.
+
+#### Declaration ####
+
+```
+int SbMediaGetAudioBufferBudget()
+```
+
+### SbMediaGetAudioConfiguration ###
+
+Retrieves the current physical audio configuration of audio output
+`output_index` on this device and places it in `out_configuration`, which must
+not be NULL.
+
+This function returns `false` if nothing could be determined on this platform or
+if `output_index` does not exist on this device.
+
+`out_configuration`: The variable that holds the audio configuration
+information.
+
+#### Declaration ####
+
+```
+bool SbMediaGetAudioConfiguration(int output_index, SbMediaAudioConfiguration *out_configuration)
+```
+
+### SbMediaGetAudioOutputCount ###
+
+Returns the number of audio outputs currently available on this device. Even if
+the number of outputs or their audio configurations can't be determined, it is
+expected that the platform will at least return a single output that supports at
+least stereo.
+
+#### Declaration ####
+
+```
+int SbMediaGetAudioOutputCount()
+```
+
+### SbMediaGetBufferAlignment ###
+
+The media buffer will be allocated using the returned alignment. Set this to a
+larger value may increase the memory consumption of media buffers.
+
+`type`: the media type of the stream (audio or video).
+
+#### Declaration ####
+
+```
+int SbMediaGetBufferAlignment(SbMediaType type)
+```
+
+### SbMediaGetBufferAllocationUnit ###
+
+When the media stack needs more memory to store media buffers, it will allocate
+extra memory in units returned by SbMediaGetBufferAllocationUnit. This can
+return 0, in which case the media stack will allocate extra memory on demand.
+When SbMediaGetInitialBufferCapacity and this function both return 0, the media
+stack will allocate individual buffers directly using SbMemory functions.
+
+#### Declaration ####
+
+```
+int SbMediaGetBufferAllocationUnit()
+```
+
+### SbMediaGetBufferGarbageCollectionDurationThreshold ###
+
+Specifies the duration threshold of media source garbage collection. When the
+accumulated duration in a source buffer exceeds this value, the media source
+implementation will try to eject existing buffers from the cache. This is
+usually triggered when the video being played has a simple content and the
+encoded data is small. In such case this can limit how much is allocated for the
+book keeping data of the media buffers and avoid OOM of system heap. This should
+return 170 seconds for most of the platforms. But it can be further reduced on
+systems with extremely low memory.
+
+#### Declaration ####
+
+```
+SbTime SbMediaGetBufferGarbageCollectionDurationThreshold()
+```
+
+### SbMediaGetBufferPadding ###
+
+Extra bytes allocated at the end of a media buffer to ensure that the buffer can
+be use optimally by specific instructions like SIMD. Set to 0 to remove any
+padding.
+
+`type`: the media type of the stream (audio or video).
+
+#### Declaration ####
+
+```
+int SbMediaGetBufferPadding(SbMediaType type)
+```
+
+### SbMediaGetBufferStorageType ###
+
+Returns SbMediaBufferStorageType of type `SbMediaStorageTypeMemory` or
+`SbMediaStorageTypeFile`. For memory storage, the media buffers will be stored
+in main memory allocated by SbMemory functions. For file storage, the media
+buffers will be stored in a temporary file in the system cache folder acquired
+by calling SbSystemGetPath() with "kSbSystemPathCacheDirectory". Note that when
+its value is "file" the media stack will still allocate memory to cache the the
+buffers in use.
+
+#### Declaration ####
+
+```
+SbMediaBufferStorageType SbMediaGetBufferStorageType()
+```
+
+### SbMediaGetInitialBufferCapacity ###
+
+The amount of memory that will be used to store media buffers allocated during
+system startup. To allocate a large chunk at startup helps with reducing
+fragmentation and can avoid failures to allocate incrementally. This can return
+0.
+
+#### Declaration ####
+
+```
+int SbMediaGetInitialBufferCapacity()
+```
+
+### SbMediaGetMaxBufferCapacity ###
+
+The maximum amount of memory that will be used to store media buffers. This must
+be larger than sum of the video budget and audio budget.
+
+`codec`: the video codec associated with the buffer. `resolution_width`: the
+width of the video resolution. `resolution_height`: the height of the video
+resolution. `bits_per_pixel`: the bits per pixel. This value is larger for HDR
+than non- HDR video.
+
+#### Declaration ####
+
+```
+int SbMediaGetMaxBufferCapacity(SbMediaVideoCodec codec, int resolution_width, int resolution_height, int bits_per_pixel)
+```
+
+### SbMediaGetProgressiveBufferBudget ###
+
+The memory used when playing mp4 videos that is not in DASH format. The
+resolution of such videos shouldn't go beyond 1080p. Its value should be less
+than the sum of SbMediaGetAudioBufferBudget and
+'SbMediaGetVideoBufferBudget(..., 1920, 1080, ...) but not less than 8 MB.
+
+`codec`: the video codec associated with the buffer. `resolution_width`: the
+width of the video resolution. `resolution_height`: the height of the video
+resolution. `bits_per_pixel`: the bits per pixel. This value is larger for HDR
+than non- HDR video.
+
+#### Declaration ####
+
+```
+int SbMediaGetProgressiveBufferBudget(SbMediaVideoCodec codec, int resolution_width, int resolution_height, int bits_per_pixel)
+```
+
+### SbMediaGetVideoBufferBudget ###
+
+Specifies the maximum amount of memory used by video buffers of media source
+before triggering a garbage collection. A large value will cause more memory
+being used by video buffers but will also make app less likely to re-download
+video data. Note that the app may experience significant difficulty if this
+value is too low.
+
+`codec`: the video codec associated with the buffer. `resolution_width`: the
+width of the video resolution. `resolution_height`: the height of the video
+resolution. `bits_per_pixel`: the bits per pixel. This value is larger for HDR
+than non- HDR video.
+
+#### Declaration ####
+
+```
+int SbMediaGetVideoBufferBudget(SbMediaVideoCodec codec, int resolution_width, int resolution_height, int bits_per_pixel)
+```
+
+### SbMediaIsBufferPoolAllocateOnDemand ###
+
+When either SbMediaGetInitialBufferCapacity or SbMediaGetBufferAllocationUnit
+isn't zero, media buffers will be allocated using a memory pool. Set the
+following variable to true to allocate the media buffer pool memory on demand
+and return all memory to the system when there is no media buffer allocated.
+Setting the following value to false results in that Cobalt will allocate
+SbMediaGetInitialBufferCapacity bytes for media buffer on startup and will not
+release any media buffer memory back to the system even if there is no media
+buffers allocated.
+
+#### Declaration ####
+
+```
+bool SbMediaIsBufferPoolAllocateOnDemand()
+```
+
+### SbMediaIsBufferUsingMemoryPool ###
+
+If SbMediaGetBufferUsingMemoryPool returns true, it indicates that media buffer
+pools should be allocated on demand, as opposed to using SbMemory* functions.
+
+#### Declaration ####
+
+```
+bool SbMediaIsBufferUsingMemoryPool()
+```
+
+### SbMediaIsOutputProtected ###
+
+Indicates whether output copy protection is currently enabled on all capable
+outputs. If `true`, then non-protection-capable outputs are expected to be
+blanked.
+
+#### Declaration ####
+
+```
+bool SbMediaIsOutputProtected()
+```
+
+### SbMediaIsSupported ###
+
+Indicates whether this platform supports decoding `video_codec` and
+`audio_codec` along with decrypting using `key_system`. If `video_codec` is
+`kSbMediaVideoCodecNone` or if `audio_codec` is `kSbMediaAudioCodecNone`, this
+function should return `true` as long as `key_system` is supported on the
+platform to decode any supported input formats.
+
+`video_codec`: The `SbMediaVideoCodec` being checked for platform compatibility.
+`audio_codec`: The `SbMediaAudioCodec` being checked for platform compatibility.
+`key_system`: The key system being checked for platform compatibility.
+
+#### Declaration ####
+
+```
+bool SbMediaIsSupported(SbMediaVideoCodec video_codec, SbMediaAudioCodec audio_codec, const char *key_system)
+```
+
+### SbMediaSetAudioWriteDuration ###
+
+Communicate to the platform how far past `current_playback_position` the app
+will write audio samples. The app will write all samples between
+`current_playback_position` and `current_playback_position` + `duration`, as
+soon as they are available. The app may sometimes write more samples than that,
+but the app only guarantees to write `duration` past `current_playback_position`
+in general. The platform is responsible for guaranteeing that when only
+`duration` audio samples are written at a time, no playback issues occur (such
+as transient or indefinite hanging). The platform may assume `duration` >= 0.5
+seconds.
+
+#### Declaration ####
+
+```
+void SbMediaSetAudioWriteDuration(SbTime duration)
+```
+
+### SbMediaSetOutputProtection ###
+
+Enables or disables output copy protection on all capable outputs. If enabled,
+then non-protection-capable outputs are expected to be blanked.
+
+The return value indicates whether the operation was successful, and the
+function returns a success even if the call is redundant in that it doesn't
+change the current value.
+
+`enabled`: Indicates whether output protection is enabled (`true`) or disabled.
+
+#### Declaration ####
+
+```
+bool SbMediaSetOutputProtection(bool enabled)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/11/memory.md b/src/cobalt/site/docs/reference/starboard/modules/11/memory.md
new file mode 100644
index 0000000..a3fecb6
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/11/memory.md
@@ -0,0 +1,464 @@
+---
+layout: doc
+title: "Starboard Module Reference: memory.h"
+---
+
+Defines functions for memory allocation, alignment, copying, and comparing.
+Porters
+
+All of the "Unchecked" and "Free" functions must be implemented, but they should
+not be called directly. The Starboard platform wraps them with extra accounting
+under certain circumstances.
+Porters and Application Developers
+
+Nobody should call the "Checked", "Unchecked" or "Free" functions directly
+because that evades Starboard's memory tracking. In both port implementations
+and Starboard client application code, you should always call SbMemoryAllocate
+and SbMemoryDeallocate rather than SbMemoryAllocateUnchecked and SbMemoryFree.
+
+*   The "checked" functions are SbMemoryAllocateChecked(),
+    SbMemoryReallocateChecked(), and SbMemoryAllocateAlignedChecked().
+
+*   The "unchecked" functions are SbMemoryAllocateUnchecked(),
+    SbMemoryReallocateUnchecked(), and SbMemoryAllocateAlignedUnchecked().
+
+*   The "free" functions are SbMemoryFree() and SbMemoryFreeAligned().
+
+## Enums ##
+
+### SbMemoryMapFlags ###
+
+The bitwise OR of these flags should be passed to SbMemoryMap to indicate how
+the mapped memory can be used.
+
+#### Values ####
+
+*   `kSbMemoryMapProtectReserved`
+
+    No flags set: Reserves virtual address space. SbMemoryProtect() can later
+    make it accessible.
+*   `kSbMemoryMapProtectRead`
+*   `kSbMemoryMapProtectWrite`
+*   `kSbMemoryMapProtectExec`
+*   `kSbMemoryMapProtectReadWrite`
+
+## Functions ##
+
+### SbMemoryAlignToPageSize ###
+
+Rounds `size` up to kSbMemoryPageSize.
+
+#### Declaration ####
+
+```
+static size_t SbMemoryAlignToPageSize(size_t size)
+```
+
+### SbMemoryAllocate ###
+
+Allocates and returns a chunk of memory of at least `size` bytes. This function
+should be called from the client codebase. It is intended to be a drop-in
+replacement for `malloc`.
+
+Note that this function returns `NULL` if it is unable to allocate the memory.
+
+`size`: The amount of memory to be allocated. If `size` is 0, the function may
+return `NULL` or it may return a unique pointer value that can be passed to
+SbMemoryDeallocate.
+
+#### Declaration ####
+
+```
+void* SbMemoryAllocate(size_t size)
+```
+
+### SbMemoryAllocateAligned ###
+
+Allocates and returns a chunk of memory of at least `size` bytes, aligned to
+`alignment`. This function should be called from the client codebase. It is
+meant to be a drop-in replacement for `memalign`.
+
+The function returns `NULL` if it cannot allocate the memory. In addition, the
+function's behavior is undefined if `alignment` is not a power of two.
+
+`alignment`: The way that data is arranged and accessed in memory. The value
+must be a power of two. `size`: The size of the memory to be allocated. If
+`size` is `0`, the function may return `NULL` or it may return a unique aligned
+pointer value that can be passed to SbMemoryDeallocateAligned.
+
+#### Declaration ####
+
+```
+void* SbMemoryAllocateAligned(size_t alignment, size_t size)
+```
+
+### SbMemoryAllocateAlignedChecked ###
+
+Same as SbMemoryAllocateAlignedUnchecked, but will abort() in the case of an
+allocation failure.
+
+DO NOT CALL. Call SbMemoryAllocateAligned(...) instead.
+
+#### Declaration ####
+
+```
+void* SbMemoryAllocateAlignedChecked(size_t alignment, size_t size)
+```
+
+### SbMemoryAllocateAlignedUnchecked ###
+
+This is the implementation of SbMemoryAllocateAligned that must be provided by
+Starboard ports.
+
+DO NOT CALL. Call SbMemoryAllocateAligned(...) instead.
+
+#### Declaration ####
+
+```
+void* SbMemoryAllocateAlignedUnchecked(size_t alignment, size_t size)
+```
+
+### SbMemoryAllocateChecked ###
+
+Same as SbMemoryAllocateUnchecked, but will abort() in the case of an allocation
+failure.
+
+DO NOT CALL. Call SbMemoryAllocate(...) instead.
+
+#### Declaration ####
+
+```
+void* SbMemoryAllocateChecked(size_t size)
+```
+
+### SbMemoryAllocateNoReport ###
+
+Same as SbMemoryAllocate() but will not report memory to the tracker. Avoid
+using this unless absolutely necessary.
+
+#### Declaration ####
+
+```
+void* SbMemoryAllocateNoReport(size_t size)
+```
+
+### SbMemoryAllocateUnchecked ###
+
+This is the implementation of SbMemoryAllocate that must be provided by
+Starboard ports.
+
+DO NOT CALL. Call SbMemoryAllocate(...) instead.
+
+#### Declaration ####
+
+```
+void* SbMemoryAllocateUnchecked(size_t size)
+```
+
+### SbMemoryCalloc ###
+
+A wrapper that implements a drop-in replacement for `calloc`, which is used in
+some packages.
+
+#### Declaration ####
+
+```
+static void* SbMemoryCalloc(size_t count, size_t size)
+```
+
+### SbMemoryCompare ###
+
+Compares the contents of the first `count` bytes of `buffer1` and `buffer2`.
+This function returns:
+
+*   `-1` if `buffer1` is "less-than" `buffer2`
+
+*   `0` if `buffer1` and `buffer2` are equal
+
+*   `1` if `buffer1` is "greater-than" `buffer2`.
+
+This function is meant to be a drop-in replacement for `memcmp`.
+
+`buffer1`: The first buffer to be compared. `buffer2`: The second buffer to be
+compared. `count`: The number of bytes to be compared.
+
+#### Declaration ####
+
+```
+int SbMemoryCompare(const void *buffer1, const void *buffer2, size_t count)
+```
+
+### SbMemoryCopy ###
+
+Copies `count` sequential bytes from `source` to `destination`, without support
+for the `source` and `destination` regions overlapping. This function is meant
+to be a drop-in replacement for `memcpy`.
+
+The function's behavior is undefined if `destination` or `source` are NULL, and
+the function is a no-op if `count` is 0. The return value is `destination`.
+
+`destination`: The destination of the copied memory. `source`: The source of the
+copied memory. `count`: The number of sequential bytes to be copied.
+
+#### Declaration ####
+
+```
+void* SbMemoryCopy(void *destination, const void *source, size_t count)
+```
+
+### SbMemoryDeallocate ###
+
+Frees a previously allocated chunk of memory. If `memory` is NULL, then the
+operation is a no-op. This function should be called from the client codebase.
+It is meant to be a drop-in replacement for `free`.
+
+`memory`: The chunk of memory to be freed.
+
+#### Declaration ####
+
+```
+void SbMemoryDeallocate(void *memory)
+```
+
+### SbMemoryDeallocateAligned ###
+
+`memory`: The chunk of memory to be freed. If `memory` is NULL, then the
+function is a no-op.
+
+#### Declaration ####
+
+```
+void SbMemoryDeallocateAligned(void *memory)
+```
+
+### SbMemoryDeallocateNoReport ###
+
+Same as SbMemoryDeallocate() but will not report memory deallocation to the
+tracker. This function must be matched with SbMemoryAllocateNoReport().
+
+#### Declaration ####
+
+```
+void SbMemoryDeallocateNoReport(void *memory)
+```
+
+### SbMemoryFindByte ###
+
+Finds the lower 8-bits of `value` in the first `count` bytes of `buffer` and
+returns either a pointer to the first found occurrence or `NULL` if the value is
+not found. This function is meant to be a drop-in replacement for `memchr`.
+
+#### Declaration ####
+
+```
+const void* SbMemoryFindByte(const void *buffer, int value, size_t count)
+```
+
+### SbMemoryFlush ###
+
+Flushes any data in the given virtual address range that is cached locally in
+the current processor core to physical memory, ensuring that data and
+instruction caches are cleared. This is required to be called on executable
+memory that has been written to and might be executed in the future.
+
+#### Declaration ####
+
+```
+void SbMemoryFlush(void *virtual_address, int64_t size_bytes)
+```
+
+### SbMemoryFree ###
+
+This is the implementation of SbMemoryDeallocate that must be provided by
+Starboard ports.
+
+DO NOT CALL. Call SbMemoryDeallocate(...) instead.
+
+#### Declaration ####
+
+```
+void SbMemoryFree(void *memory)
+```
+
+### SbMemoryFreeAligned ###
+
+This is the implementation of SbMemoryFreeAligned that must be provided by
+Starboard ports.
+
+DO NOT CALL. Call SbMemoryDeallocateAligned(...) instead.
+
+#### Declaration ####
+
+```
+void SbMemoryFreeAligned(void *memory)
+```
+
+### SbMemoryGetStackBounds ###
+
+Gets the stack bounds for the current thread.
+
+`out_high`: The highest addressable byte + 1 for the current thread. `out_low`:
+The lowest addressable byte for the current thread.
+
+#### Declaration ####
+
+```
+void SbMemoryGetStackBounds(void **out_high, void **out_low)
+```
+
+### SbMemoryIsAligned ###
+
+Checks whether `memory` is aligned to `alignment` bytes.
+
+#### Declaration ####
+
+```
+static bool SbMemoryIsAligned(const void *memory, size_t alignment)
+```
+
+### SbMemoryIsZero ###
+
+Returns true if the first `count` bytes of `buffer` are set to zero.
+
+#### Declaration ####
+
+```
+static bool SbMemoryIsZero(const void *buffer, size_t count)
+```
+
+### SbMemoryMap ###
+
+Allocates `size_bytes` worth of physical memory pages and maps them into an
+available virtual region. This function returns `SB_MEMORY_MAP_FAILED` on
+failure. `NULL` is a valid return value.
+
+`size_bytes`: The amount of physical memory pages to be allocated. `flags`: The
+bitwise OR of the protection flags for the mapped memory as specified in
+`SbMemoryMapFlags`. Allocating executable memory is not allowed and will fail.
+If executable memory is needed, map non-executable memory first and then switch
+access to executable using SbMemoryProtect. When kSbMemoryMapProtectReserved is
+used, the address space will not be accessible and, if possible, the platform
+should not count it against any memory budget. `name`: A value that appears in
+the debugger on some platforms. The value can be up to 32 bytes.
+
+#### Declaration ####
+
+```
+void* SbMemoryMap(int64_t size_bytes, int flags, const char *name)
+```
+
+### SbMemoryMove ###
+
+Copies `count` sequential bytes from `source` to `destination`, with support for
+the `source` and `destination` regions overlapping. This function is meant to be
+a drop-in replacement for `memmove`.
+
+The function's behavior is undefined if `destination` or `source` are NULL, and
+the function is a no-op if `count` is 0. The return value is `destination`.
+
+`destination`: The destination of the copied memory. `source`: The source of the
+copied memory. `count`: The number of sequential bytes to be copied.
+
+#### Declaration ####
+
+```
+void* SbMemoryMove(void *destination, const void *source, size_t count)
+```
+
+### SbMemoryProtect ###
+
+Change the protection of `size_bytes` of memory regions, starting from
+`virtual_address`, to `flags`, returning `true` on success.
+
+#### Declaration ####
+
+```
+bool SbMemoryProtect(void *virtual_address, int64_t size_bytes, int flags)
+```
+
+### SbMemoryReallocate ###
+
+Attempts to resize `memory` to be at least `size` bytes, without touching the
+contents of memory.
+
+*   If the function cannot perform the fast resize, it allocates a new chunk of
+    memory, copies the contents over, and frees the previous chunk, returning a
+    pointer to the new chunk.
+
+*   If the function cannot perform the slow resize, it returns `NULL`, leaving
+    the given memory chunk unchanged.
+
+This function should be called from the client codebase. It is meant to be a
+drop-in replacement for `realloc`.
+
+`memory`: The chunk of memory to be resized. `memory` may be NULL, in which case
+it behaves exactly like SbMemoryAllocateUnchecked. `size`: The size to which
+`memory` will be resized. If `size` is `0`, the function may return `NULL` or it
+may return a unique pointer value that can be passed to SbMemoryDeallocate.
+
+#### Declaration ####
+
+```
+void* SbMemoryReallocate(void *memory, size_t size)
+```
+
+### SbMemoryReallocateChecked ###
+
+Same as SbMemoryReallocateUnchecked, but will abort() in the case of an
+allocation failure.
+
+DO NOT CALL. Call SbMemoryReallocate(...) instead.
+
+#### Declaration ####
+
+```
+void* SbMemoryReallocateChecked(void *memory, size_t size)
+```
+
+### SbMemoryReallocateUnchecked ###
+
+This is the implementation of SbMemoryReallocate that must be provided by
+Starboard ports.
+
+DO NOT CALL. Call SbMemoryReallocate(...) instead.
+
+#### Declaration ####
+
+```
+void* SbMemoryReallocateUnchecked(void *memory, size_t size)
+```
+
+### SbMemorySet ###
+
+Fills `count` sequential bytes starting at `destination`, with the unsigned char
+coercion of `byte_value`. This function is meant to be a drop-in replacement for
+`memset`.
+
+The function's behavior is undefined if `destination` is NULL, and the function
+is a no-op if `count` is 0. The return value is `destination`.
+
+`destination`: The destination of the copied memory. `count`: The number of
+sequential bytes to be set.
+
+#### Declaration ####
+
+```
+void* SbMemorySet(void *destination, int byte_value, size_t count)
+```
+
+### SbMemoryUnmap ###
+
+Unmap `size_bytes` of physical pages starting from `virtual_address`, returning
+`true` on success. After this function completes, [virtual_address,
+virtual_address + size_bytes) will not be read/writable. This function can unmap
+multiple contiguous regions that were mapped with separate calls to
+SbMemoryMap(). For example, if one call to `SbMemoryMap(0x1000)` returns
+`(void*)0xA000`, and another call to `SbMemoryMap(0x1000)` returns
+`(void*)0xB000`, `SbMemoryUnmap(0xA000, 0x2000)` should free both regions.
+
+#### Declaration ####
+
+```
+bool SbMemoryUnmap(void *virtual_address, int64_t size_bytes)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/memory_reporter.md b/src/cobalt/site/docs/reference/starboard/modules/11/memory_reporter.md
similarity index 100%
rename from src/cobalt/site/docs/reference/starboard/modules/4/memory_reporter.md
rename to src/cobalt/site/docs/reference/starboard/modules/11/memory_reporter.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/11/microphone.md b/src/cobalt/site/docs/reference/starboard/modules/11/microphone.md
new file mode 100644
index 0000000..1379f86
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/11/microphone.md
@@ -0,0 +1,263 @@
+---
+layout: doc
+title: "Starboard Module Reference: microphone.h"
+---
+
+Defines functions for microphone creation, control, audio data fetching, and
+destruction. This module supports multiple calls to `SbMicrophoneOpen` and
+`SbMicrophoneClose`, and the implementation should handle multiple calls to one
+of those functions on the same microphone. For example, your implementation
+should handle cases where `SbMicrophoneOpen` is called twice on the same
+microphone without a call to `SbMicrophoneClose` in between.
+
+This API is not thread-safe and must be called from a single thread.
+
+How to use this API:
+
+1.  Call `SbMicrophoneGetAvailableInfos` to get a list of available microphone
+    information.
+
+1.  Create a supported microphone, using `SbMicrophoneCreate`, with enough
+    buffer size and sample rate. Use `SbMicrophoneIsSampleRateSupported` to
+    verify the sample rate.
+
+1.  Use `SbMicrophoneOpen` to open the microphone port and start recording audio
+    data.
+
+1.  Periodically read out the data from microphone with `SbMicrophoneRead`.
+
+1.  Call `SbMicrophoneClose` to close the microphone port and stop recording
+    audio data.
+
+1.  Destroy the microphone with `SbMicrophoneDestroy`.
+
+## Macros ##
+
+### kSbMicrophoneIdInvalid ###
+
+Well-defined value for an invalid microphone ID handle.
+
+### kSbMicrophoneInvalid ###
+
+Well-defined value for an invalid microphone handle.
+
+## Enums ##
+
+### SbMicrophoneType ###
+
+All possible microphone types.
+
+#### Values ####
+
+*   `kSbMicrophoneCamera`
+
+    Built-in microphone in camera.
+*   `kSbMicrophoneUSBHeadset`
+
+    Microphone in the headset that can be a wired or wireless USB headset.
+*   `kSbMicrophoneVRHeadset`
+
+    Microphone in the VR headset.
+*   `kSBMicrophoneAnalogHeadset`
+
+    Microphone in the analog headset.
+*   `kSbMicrophoneUnknown`
+
+    Unknown microphone type. The microphone could be different than the other
+    enum descriptions or could fall under one of those descriptions.
+
+## Typedefs ##
+
+### SbMicrophone ###
+
+An opaque handle to an implementation-private structure that represents a
+microphone.
+
+#### Definition ####
+
+```
+typedef struct SbMicrophonePrivate* SbMicrophone
+```
+
+### SbMicrophoneId ###
+
+An opaque handle to an implementation-private structure that represents a
+microphone ID.
+
+#### Definition ####
+
+```
+typedef struct SbMicrophoneIdPrivate* SbMicrophoneId
+```
+
+## Structs ##
+
+### SbMicrophoneInfo ###
+
+Microphone information.
+
+#### Members ####
+
+*   `SbMicrophoneId id`
+
+    Microphone id.
+*   `SbMicrophoneType type`
+
+    Microphone type.
+*   `int max_sample_rate_hz`
+
+    The microphone's maximum supported sampling rate.
+*   `int min_read_size`
+
+    The minimum read size required for each read from microphone.
+*   `char label`
+
+    Name of the microphone. Can be empty. This should indicate the friendly name
+    of the microphone type. For example, "Headset Microphone". The string must
+    be null terminated.
+
+## Functions ##
+
+### SbMicrophoneClose ###
+
+Closes the microphone port, stops recording audio on `microphone`, and clears
+the unread buffer if it is not empty. If the microphone has already been
+stopped, this call is ignored. The return value indicates whether the microphone
+is closed.
+
+`microphone`: The microphone to close.
+
+#### Declaration ####
+
+```
+bool SbMicrophoneClose(SbMicrophone microphone)
+```
+
+### SbMicrophoneCreate ###
+
+Creates a microphone with the specified ID, audio sample rate, and cached audio
+buffer size. Starboard only requires support for creating one microphone at a
+time, and implementations may return an error if a second microphone is created
+before the first is destroyed.
+
+The function returns the newly created SbMicrophone object. However, if you try
+to create a microphone that has already been initialized, if the sample rate is
+unavailable, or if the buffer size is invalid, the function should return
+`kSbMicrophoneInvalid`.
+
+`id`: The ID that will be assigned to the newly created SbMicrophone.
+`sample_rate_in_hz`: The new microphone's audio sample rate in Hz.
+`buffer_size_bytes`: The size of the buffer where signed 16-bit integer audio
+data is temporarily cached to during the capturing. The audio data is removed
+from the audio buffer if it has been read, and new audio data can be read from
+this buffer in smaller chunks than this size. This parameter must be set to a
+value greater than zero and the ideal size is `2^n`.
+
+#### Declaration ####
+
+```
+SbMicrophone SbMicrophoneCreate(SbMicrophoneId id, int sample_rate_in_hz, int buffer_size_bytes)
+```
+
+### SbMicrophoneDestroy ###
+
+Destroys a microphone. If the microphone is in started state, it is first
+stopped and then destroyed. Any data that has been recorded and not read is
+thrown away.
+
+#### Declaration ####
+
+```
+void SbMicrophoneDestroy(SbMicrophone microphone)
+```
+
+### SbMicrophoneGetAvailable ###
+
+Retrieves all currently available microphone information and stores it in
+`out_info_array`. The return value is the number of the available microphones.
+If the number of available microphones is larger than `info_array_size`, then
+`out_info_array` is filled up with as many available microphones as possible and
+the actual number of available microphones is returned. A negative return value
+indicates that an internal error occurred.
+
+`out_info_array`: All currently available information about the microphone is
+placed into this output parameter. `info_array_size`: The size of
+`out_info_array`.
+
+#### Declaration ####
+
+```
+int SbMicrophoneGetAvailable(SbMicrophoneInfo *out_info_array, int info_array_size)
+```
+
+### SbMicrophoneIdIsValid ###
+
+Indicates whether the given microphone ID is valid.
+
+#### Declaration ####
+
+```
+static bool SbMicrophoneIdIsValid(SbMicrophoneId id)
+```
+
+### SbMicrophoneIsSampleRateSupported ###
+
+Indicates whether the microphone supports the sample rate.
+
+#### Declaration ####
+
+```
+bool SbMicrophoneIsSampleRateSupported(SbMicrophoneId id, int sample_rate_in_hz)
+```
+
+### SbMicrophoneIsValid ###
+
+Indicates whether the given microphone is valid.
+
+#### Declaration ####
+
+```
+static bool SbMicrophoneIsValid(SbMicrophone microphone)
+```
+
+### SbMicrophoneOpen ###
+
+Opens the microphone port and starts recording audio on `microphone`.
+
+Once started, the client needs to periodically call `SbMicrophoneRead` to
+receive the audio data. If the microphone has already been started, this call
+clears the unread buffer. The return value indicates whether the microphone is
+open. `microphone`: The microphone that will be opened and will start recording
+audio.
+
+#### Declaration ####
+
+```
+bool SbMicrophoneOpen(SbMicrophone microphone)
+```
+
+### SbMicrophoneRead ###
+
+Retrieves the recorded audio data from the microphone and writes that data to
+`out_audio_data`.
+
+The return value is zero or the positive number of bytes that were read. Neither
+the return value nor `audio_data_size` exceeds the buffer size. A negative
+return value indicates that an error occurred.
+
+This function should be called frequently. Otherwise, the microphone only
+buffers `buffer_size` bytes as configured in `SbMicrophoneCreate` and the new
+audio data is thrown out. No audio data is read from a stopped microphone.
+
+`microphone`: The microphone from which to retrieve recorded audio data.
+`out_audio_data`: The buffer to which the retrieved data will be written.
+`audio_data_size`: The number of requested bytes. If `audio_data_size` is
+smaller than `min_read_size` of `SbMicrophoneInfo`, the extra audio data that
+has already been read from the device is discarded.
+
+#### Declaration ####
+
+```
+int SbMicrophoneRead(SbMicrophone microphone, void *out_audio_data, int audio_data_size)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/mutex.md b/src/cobalt/site/docs/reference/starboard/modules/11/mutex.md
similarity index 100%
rename from src/cobalt/site/docs/reference/starboard/modules/4/mutex.md
rename to src/cobalt/site/docs/reference/starboard/modules/11/mutex.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/once.md b/src/cobalt/site/docs/reference/starboard/modules/11/once.md
similarity index 100%
rename from src/cobalt/site/docs/reference/starboard/modules/4/once.md
rename to src/cobalt/site/docs/reference/starboard/modules/11/once.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/11/player.md b/src/cobalt/site/docs/reference/starboard/modules/11/player.md
new file mode 100644
index 0000000..0a9ebd2
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/11/player.md
@@ -0,0 +1,564 @@
+---
+layout: doc
+title: "Starboard Module Reference: player.h"
+---
+
+Defines an interface for controlling playback of media elementary streams.
+
+## Macros ##
+
+### SB_PLAYER_INITIAL_TICKET ###
+
+The value of the initial ticket held by the player before the first seek. The
+player will use this ticket value to make the first call to SbPlayerStatusFunc
+with kSbPlayerStateInitialized.
+
+### SB_PLAYER_NO_DURATION ###
+
+The value to pass into SbPlayerCreate's `duration_pts` argument for cases where
+the duration is unknown, such as for live streams.
+
+### kSbPlayerInvalid ###
+
+Well-defined value for an invalid player.
+
+## Enums ##
+
+### SbPlayerDecoderState ###
+
+An indicator of whether the decoder can accept more samples.
+
+#### Values ####
+
+*   `kSbPlayerDecoderStateNeedsData`
+
+    The decoder is asking for one more sample.
+*   `kSbPlayerDecoderStateBufferFull`
+
+    The decoder is not ready for any more samples, so do not send them. Note
+    that this enum value has been deprecated and the SbPlayer implementation
+    should no longer use this value.
+*   `kSbPlayerDecoderStateDestroyed`
+
+    The player has been destroyed, and will send no more callbacks.
+
+### SbPlayerSampleSideDataType ###
+
+Identify the type of side data accompanied with `SbPlayerSampleInfo`, as side
+data may come from multiple sources.
+
+#### Values ####
+
+*   `kMatroskaBlockAdditional`
+
+    The side data comes from the BlockAdditional data in the Matroska/Webm
+    container, as specified in [https://tools.ietf.org/id/draft-lhomme-cellar-matroska-03.html#rfc.section.7.3.39](https://tools.ietf.org/id/draft-lhomme-cellar-matroska-03.html#rfc.section.7.3.39)9) andnd [https://www.webmproject.org/docs/container/#BlockAdditional](https://www.webmproject.org/docs/container/#BlockAdditional)l)
+    . The first 8 bytes of the data contains the value of BlockAddID in big
+    endian format, followed by the content of BlockAdditional.
+
+### SbPlayerState ###
+
+An indicator of the general playback state.
+
+#### Values ####
+
+*   `kSbPlayerStateInitialized`
+
+    The player has just been initialized. It is expecting an SbPlayerSeek() call
+    to enter the prerolling state.
+*   `kSbPlayerStatePrerolling`
+
+    The player is prerolling, collecting enough data to fill the pipeline before
+    presentation starts. After the first preroll is completed, there should
+    always be a video frame to render, even if the player goes back to
+    Prerolling after a Seek.
+*   `kSbPlayerStatePresenting`
+
+    The player is presenting media, and it is either paused or actively playing
+    in real-time. Note that the implementation should use this state to signal
+    that the preroll has been finished.
+*   `kSbPlayerStateEndOfStream`
+
+    The player is presenting media, but it is paused at the end of the stream.
+*   `kSbPlayerStateDestroyed`
+
+    The player has been destroyed, and will send no more callbacks.
+
+## Typedefs ##
+
+### SbPlayer ###
+
+An opaque handle to an implementation-private structure representing a player.
+
+#### Definition ####
+
+```
+typedef struct SbPlayerPrivate* SbPlayer
+```
+
+### SbPlayerDeallocateSampleFunc ###
+
+Callback to free the given sample buffer data. When more than one buffer are
+sent in SbPlayerWriteSample(), the implementation only has to call this callback
+with `sample_buffer` points to the the first buffer.
+
+#### Definition ####
+
+```
+typedef void(* SbPlayerDeallocateSampleFunc) (SbPlayer player, void *context, const void *sample_buffer)
+```
+
+### SbPlayerDecoderStatusFunc ###
+
+Callback for decoder status updates, called in response to a call to
+SbPlayerSeek() or SbPlayerWriteSample(). This callback will never be called
+until at least one call to SbPlayerSeek has occurred. `ticket` will be set to
+the ticket passed into the last received call to SbPlayerSeek() at the time this
+callback was dispatched. This is to distinguish status callbacks for
+interrupting seeks. These callbacks will happen on a different thread than the
+calling thread, and it is not valid to call SbPlayer functions from within this
+callback. After an update with kSbPlayerDecoderStateNeedsData, the user of the
+player will make at most one call to SbPlayerWriteSample() or
+SbPlayerWriteEndOfStream(). The player implementation should update the decoder
+status again after such call to notify its user to continue writing more frames.
+
+#### Definition ####
+
+```
+typedef void(* SbPlayerDecoderStatusFunc) (SbPlayer player, void *context, SbMediaType type, SbPlayerDecoderState state, int ticket)
+```
+
+### SbPlayerErrorFunc ###
+
+Callback for player errors, that may set a `message`. `error`: indicates the
+error code. `message`: provides specific informative diagnostic message about
+the error condition encountered. It is ok for the message to be an empty string
+or NULL if no information is available.
+
+#### Definition ####
+
+```
+typedef void(* SbPlayerErrorFunc) (SbPlayer player, void *context, SbPlayerError error, const char *message)
+```
+
+### SbPlayerStatusFunc ###
+
+Callback for player status updates. These callbacks will happen on a different
+thread than the calling thread, and it is not valid to call SbPlayer functions
+from within this callback.
+
+#### Definition ####
+
+```
+typedef void(* SbPlayerStatusFunc) (SbPlayer player, void *context, SbPlayerState state, int ticket)
+```
+
+## Structs ##
+
+### SbPlayerCreationParam ###
+
+The playback related parameters to pass into SbPlayerCreate() and
+SbPlayerGetPreferredOutputMode().
+
+#### Members ####
+
+*   `SbDrmSystem drm_system`
+
+    Provides an appropriate DRM system if the media stream has encrypted
+    portions. It will be `kSbDrmSystemInvalid` if the stream does not have
+    encrypted portions.
+*   `SbMediaAudioSampleInfo audio_sample_info`
+
+    Contains a populated SbMediaAudioSampleInfo if `audio_sample_info.codec`
+    isn't `kSbMediaAudioCodecNone`. When `audio_sample_info.codec` is
+    `kSbMediaAudioCodecNone`, the video doesn't have an audio track.
+*   `SbMediaVideoSampleInfo video_sample_info`
+
+    Contains a populated SbMediaVideoSampleInfo if `video_sample_info.codec`
+    isn't `kSbMediaVideoCodecNone`. When `video_sample_info.codec` is
+    `kSbMediaVideoCodecNone`, the video is audio only.
+*   `SbPlayerOutputMode output_mode`
+
+    Selects how the decoded video frames will be output. For example,
+    `kSbPlayerOutputModePunchOut` indicates that the decoded video frames will
+    be output to a background video layer by the platform, and
+    `kSbPlayerOutputDecodeToTexture` indicates that the decoded video frames
+    should be made available for the application to pull via calls to
+    SbPlayerGetCurrentFrame().
+
+### SbPlayerInfo2 ###
+
+Information about the current media playback state.
+
+#### Members ####
+
+*   `SbTime current_media_timestamp`
+
+    The position of the playback head, as precisely as possible, in
+    microseconds.
+*   `SbTime duration`
+
+    The known duration of the currently playing media stream, in microseconds.
+*   `SbTime start_date`
+
+    The result of getStartDate for the currently playing media stream, in
+    microseconds since the epoch of January 1, 1601 UTC.
+*   `int frame_width`
+
+    The width of the currently displayed frame, in pixels, or 0 if not provided
+    by this player.
+*   `int frame_height`
+
+    The height of the currently displayed frame, in pixels, or 0 if not provided
+    by this player.
+*   `bool is_paused`
+
+    Whether playback is currently paused.
+*   `double volume`
+
+    The current player volume in [0, 1].
+*   `int total_video_frames`
+
+    The number of video frames sent to the player since the creation of the
+    player.
+*   `int dropped_video_frames`
+
+    The number of video frames decoded but not displayed since the creation of
+    the player.
+*   `int corrupted_video_frames`
+
+    The number of video frames that failed to be decoded since the creation of
+    the player.
+*   `double playback_rate`
+
+    The rate of playback. The video is played back in a speed that is
+    proportional to this. By default it is 1.0 which indicates that the playback
+    is at normal speed. When it is greater than one, the video is played in a
+    faster than normal speed. When it is less than one, the video is played in a
+    slower than normal speed. Negative speeds are not supported.
+
+### SbPlayerSampleInfo ###
+
+Information about the samples to be written into SbPlayerWriteSample2.
+
+#### Members ####
+
+*   `SbMediaType type`
+*   `const void * buffer`
+
+    Points to the buffer containing the sample data.
+*   `int buffer_size`
+
+    Size of the data pointed to by `buffer`.
+*   `SbTime timestamp`
+
+    The timestamp of the sample in SbTime.
+*   `SbPlayerSampleSideData* side_data`
+
+    Points to an array of side data for the input, when available.
+*   `int side_data_count`
+
+    The number of side data pointed by `side_data`. It should be set to 0 if
+    there is no side data for the input.
+*   `SbMediaAudioSampleInfo audio_sample_info`
+
+    Information about an audio sample. This value can only be used when `type`
+    is kSbMediaTypeAudio.
+*   `SbMediaVideoSampleInfo video_sample_info`
+
+    Information about a video sample. This value can only be used when `type` is
+    kSbMediaTypeVideo.
+*   `union SbPlayerSampleInfo::@0 @1`
+*   `constSbDrmSampleInfo* drm_info`
+
+    The DRM system related info for the media sample. This value is required for
+    encrypted samples. Otherwise, it must be `NULL`.
+
+### SbPlayerSampleSideData ###
+
+Side data accompanied with `SbPlayerSampleInfo`, it can be arbitrary binary data
+coming from multiple sources.
+
+#### Members ####
+
+*   `SbPlayerSampleSideDataType type`
+*   `const uint8_t * data`
+
+    `data` will remain valid until SbPlayerDeallocateSampleFunc() is called on
+    the `SbPlayerSampleInfo::buffer` the data is associated with.
+*   `size_t size`
+
+    The size of the data pointed by `data`, in bytes.
+
+## Functions ##
+
+### SbPlayerCreate ###
+
+Creates a player that will be displayed on `window` for the specified
+`video_codec` and `audio_codec`, acquiring all resources needed to operate it,
+and returning an opaque handle to it. The expectation is that a new player will
+be created and destroyed for every playback.
+
+This function returns the created player. Note the following:
+
+*   The associated decoder of the returned player should be assumed to not be in
+    `kSbPlayerDecoderStateNeedsData` until SbPlayerSeek() has been called on it.
+
+*   It is expected either that the thread that calls SbPlayerCreate is the same
+    thread that calls the other `SbPlayer` functions for that player, or that
+    there is a mutex guarding calls into each `SbPlayer` instance.
+
+*   If there is a platform limitation on how many players can coexist
+    simultaneously, then calls made to this function that attempt to exceed that
+    limit must return `kSbPlayerInvalid`. Multiple calls to SbPlayerCreate must
+    not cause a crash.
+
+`window`: The window that will display the player. `window` can be
+`kSbWindowInvalid` for platforms where video is only displayed on a particular
+window that the underlying implementation already has access to.
+
+`video_codec`: The video codec used for the player. If `video_codec` is
+`kSbMediaVideoCodecNone`, the player is an audio-only player. If `video_codec`
+is any other value, the player is an audio/video decoder. This can be set to
+`kSbMediaVideoCodecNone` to play a video with only an audio track.
+
+`audio_codec`: The audio codec used for the player. The caller must provide a
+populated `audio_sample_info` if audio codec is `kSbMediaAudioCodecAac`. Can be
+set to `kSbMediaAudioCodecNone` to play a video without any audio track. In such
+case `audio_sample_info` must be NULL.
+
+`drm_system`: If the media stream has encrypted portions, then this parameter
+provides an appropriate DRM system, created with `SbDrmCreateSystem()`. If the
+stream does not have encrypted portions, then `drm_system` may be
+`kSbDrmSystemInvalid`. `audio_sample_info`: Note that the caller must provide a
+populated `audio_sample_info` if the audio codec is `kSbMediaAudioCodecAac`.
+Otherwise, `audio_sample_info` can be NULL. See media.h for the format of the
+`SbMediaAudioSampleInfo` struct. Note that `audio_specific_config` is a pointer
+and the content it points to is no longer valid after this function returns. The
+implementation has to make a copy of the content if it is needed after the
+function returns. `max_video_capabilities`: This string communicates the max
+video capabilities required to the platform. The web app will not provide a
+video stream exceeding the maximums described by this parameter. Allows the
+platform to optimize playback pipeline for low quality video streams if it knows
+that it will never adapt to higher quality streams. The string uses the same
+format as the string passed in to SbMediaCanPlayMimeAndKeySystem(), for example,
+when it is set to "width=1920; height=1080; framerate=15;", the video will never
+adapt to resolution higher than 1920x1080 or frame per second higher than 15
+fps. When the maximums are unknown, this will be set to NULL.
+
+#### Declaration ####
+
+```
+SbPlayer SbPlayerCreate(SbWindow window, const SbPlayerCreationParam *creation_param, SbPlayerDeallocateSampleFunc sample_deallocate_func, SbPlayerDecoderStatusFunc decoder_status_func, SbPlayerStatusFunc player_status_func, SbPlayerErrorFunc player_error_func, void *context, SbDecodeTargetGraphicsContextProvider *context_provider)
+```
+
+### SbPlayerDestroy ###
+
+Destroys `player`, freeing all associated resources.
+
+*   Upon calling this method, there should be one call to the player status
+    callback (i.e. `player_status_func` used in the creation of the player)
+    which indicates the player is destroyed. Note, the callback has to be in-
+    flight when SbPlayerDestroyed is called.
+
+*   No more other callbacks should be issued after this function returns.
+
+*   It is not allowed to pass `player` into any other `SbPlayer` function once
+    SbPlayerDestroy has been called on that player. `player`: The player to be
+    destroyed.
+
+#### Declaration ####
+
+```
+void SbPlayerDestroy(SbPlayer player)
+```
+
+### SbPlayerGetCurrentFrame ###
+
+Given a player created with the kSbPlayerOutputModeDecodeToTexture output mode,
+it will return a SbDecodeTarget representing the current frame to be rasterized.
+On GLES systems, this function must be called on a thread with an EGLContext
+current, and specifically the EGLContext that will be used to eventually render
+the frame. If this function is called with a `player` object that was created
+with an output mode other than kSbPlayerOutputModeDecodeToTexture,
+kSbDecodeTargetInvalid is returned.
+
+#### Declaration ####
+
+```
+SbDecodeTarget SbPlayerGetCurrentFrame(SbPlayer player)
+```
+
+### SbPlayerGetInfo2 ###
+
+Gets a snapshot of the current player state and writes it to `out_player_info`.
+This function may be called very frequently and is expected to be inexpensive.
+
+`player`: The player about which information is being retrieved.
+`out_player_info`: The information retrieved for the player.
+
+#### Declaration ####
+
+```
+void SbPlayerGetInfo2(SbPlayer player, SbPlayerInfo2 *out_player_info2)
+```
+
+### SbPlayerGetMaximumNumberOfSamplesPerWrite ###
+
+Writes a single sample of the given media type to `player`'s input stream. Its
+data may be passed in via more than one buffers. The lifetime of
+`sample_buffers`, `sample_buffer_sizes`, `video_sample_info`, and
+`sample_drm_info` (as well as member `subsample_mapping` contained inside it)
+are not guaranteed past the call to SbPlayerWriteSample. That means that before
+returning, the implementation must synchronously copy any information it wants
+to retain from those structures.
+
+`player`: The player for which the number is retrieved. `sample_type`: The type
+of sample for which the number is retrieved. See the `SbMediaType` enum in
+media.h.
+
+#### Declaration ####
+
+```
+int SbPlayerGetMaximumNumberOfSamplesPerWrite(SbPlayer player, SbMediaType sample_type)
+```
+
+### SbPlayerGetPreferredOutputMode ###
+
+Returns the preferred output mode of the implementation when a video described
+by `creation_param` is played. It is assumed that it is okay to call
+SbPlayerCreate() with the same video described by `creation_param`, with its
+`output_mode` member replaced by the returned output mode. When the caller has
+no preference on the output mode, it will set `creation_param->output_mode` to
+`kSbPlayerOutputModeInvalid`, and the implementation can return its preferred
+output mode based on the information contained in `creation_param`. The caller
+can also set `creation_param->output_mode` to its preferred output mode, and the
+implementation should return the same output mode if it is supported, otherwise
+the implementation should return an output mode that it is supported, as if
+`creation_param->output_mode` is set to `kSbPlayerOutputModeInvalid` prior to
+the call. Note that it is not the responsibility of this function to verify
+whether the video described by `creation_param` can be played on the platform,
+and the implementation should try its best effort to return a valid output mode.
+`creation_param` will never be NULL.
+
+#### Declaration ####
+
+```
+SbPlayerOutputMode SbPlayerGetPreferredOutputMode(const SbPlayerCreationParam *creation_param)
+```
+
+### SbPlayerIsValid ###
+
+Returns whether the given player handle is valid.
+
+#### Declaration ####
+
+```
+static bool SbPlayerIsValid(SbPlayer player)
+```
+
+### SbPlayerSetBounds ###
+
+Sets the player bounds to the given graphics plane coordinates. The changes do
+not take effect until the next graphics frame buffer swap. The default bounds
+for a player is the full screen. This function is only relevant when the
+`player` is created with the kSbPlayerOutputModePunchOut output mode, and if
+this is not the case then this function call can be ignored.
+
+This function is called on every graphics frame that changes the video bounds.
+For example, if the video bounds are being animated, then this will be called at
+up to 60 Hz. Since the function could be called up to once per frame,
+implementors should take care to avoid related performance concerns with such
+frequent calls.
+
+`player`: The player that is being resized. `z_index`: The z-index of the
+player. When the bounds of multiple players are overlapped, the one with larger
+z-index will be rendered on top of the ones with smaller z-index. `x`: The
+x-coordinate of the upper-left corner of the player. `y`: The y-coordinate of
+the upper-left corner of the player. `width`: The width of the player, in
+pixels. `height`: The height of the player, in pixels.
+
+#### Declaration ####
+
+```
+void SbPlayerSetBounds(SbPlayer player, int z_index, int x, int y, int width, int height)
+```
+
+### SbPlayerSetPlaybackRate ###
+
+Set the playback rate of the `player`. `rate` is default to 1.0 which indicates
+the playback is at its original speed. A `rate` greater than one will make the
+playback faster than its original speed. For example, when `rate` is 2, the
+video will be played at twice the speed as its original speed. A `rate` less
+than 1.0 will make the playback slower than its original speed. When `rate` is
+0, the playback will be paused. The function returns true when the playback rate
+is set to `playback_rate` or to a rate that is close to `playback_rate` which
+the implementation supports. It returns false when the playback rate is
+unchanged, this can happen when `playback_rate` is negative or if it is too high
+to support.
+
+#### Declaration ####
+
+```
+bool SbPlayerSetPlaybackRate(SbPlayer player, double playback_rate)
+```
+
+### SbPlayerSetVolume ###
+
+Sets the player's volume.
+
+`player`: The player in which the volume is being adjusted. `volume`: The new
+player volume. The value must be between `0.0` and `1.0`, inclusive. A value of
+`0.0` means that the audio should be muted, and a value of `1.0` means that it
+should be played at full volume.
+
+#### Declaration ####
+
+```
+void SbPlayerSetVolume(SbPlayer player, double volume)
+```
+
+### SbPlayerWriteEndOfStream ###
+
+Writes a marker to `player`'s input stream of `stream_type` indicating that
+there are no more samples for that media type for the remainder of this media
+stream. This marker is invalidated, along with the rest of the stream's
+contents, after a call to SbPlayerSeek.
+
+`player`: The player to which the marker is written. `stream_type`: The type of
+stream for which the marker is written.
+
+#### Declaration ####
+
+```
+void SbPlayerWriteEndOfStream(SbPlayer player, SbMediaType stream_type)
+```
+
+### SbPlayerWriteSample2 ###
+
+Writes samples of the given media type to `player`'s input stream. The lifetime
+of `sample_infos`, and the members of its elements like `buffer`,
+`video_sample_info`, and `drm_info` (as well as member `subsample_mapping`
+contained inside it) are not guaranteed past the call to SbPlayerWriteSample2.
+That means that before returning, the implementation must synchronously copy any
+information it wants to retain from those structures.
+
+SbPlayerWriteSample2 allows writing of multiple samples in one call.
+
+`player`: The player to which the sample is written. `sample_type`: The type of
+sample being written. See the `SbMediaType` enum in media.h. `sample_infos`: A
+pointer to an array of SbPlayerSampleInfo with `number_of_sample_infos`
+elements, each holds the data for an sample, i.e. a sequence of whole NAL Units
+for video, or a complete audio frame. `sample_infos` cannot be assumed to live
+past the call into SbPlayerWriteSample2(), so it must be copied if its content
+will be used after SbPlayerWriteSample2() returns. `number_of_sample_infos`:
+Specify the number of samples contained inside `sample_infos`. It has to be at
+least one, and less than the return value of
+SbPlayerGetMaximumNumberOfSamplesPerWrite().
+
+#### Declaration ####
+
+```
+void SbPlayerWriteSample2(SbPlayer player, SbMediaType sample_type, const SbPlayerSampleInfo *sample_infos, int number_of_sample_infos)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/socket.md b/src/cobalt/site/docs/reference/starboard/modules/11/socket.md
similarity index 100%
rename from src/cobalt/site/docs/reference/starboard/modules/4/socket.md
rename to src/cobalt/site/docs/reference/starboard/modules/11/socket.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/socket_waiter.md b/src/cobalt/site/docs/reference/starboard/modules/11/socket_waiter.md
similarity index 100%
rename from src/cobalt/site/docs/reference/starboard/modules/4/socket_waiter.md
rename to src/cobalt/site/docs/reference/starboard/modules/11/socket_waiter.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/speech_recognizer.md b/src/cobalt/site/docs/reference/starboard/modules/11/speech_recognizer.md
similarity index 100%
rename from src/cobalt/site/docs/reference/starboard/modules/6/speech_recognizer.md
rename to src/cobalt/site/docs/reference/starboard/modules/11/speech_recognizer.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/speech_synthesis.md b/src/cobalt/site/docs/reference/starboard/modules/11/speech_synthesis.md
similarity index 100%
rename from src/cobalt/site/docs/reference/starboard/modules/4/speech_synthesis.md
rename to src/cobalt/site/docs/reference/starboard/modules/11/speech_synthesis.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/11/storage.md b/src/cobalt/site/docs/reference/starboard/modules/11/storage.md
new file mode 100644
index 0000000..c98207b
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/11/storage.md
@@ -0,0 +1,159 @@
+---
+layout: doc
+title: "Starboard Module Reference: storage.h"
+---
+
+Defines a user-based Storage API. This is a simple, all-at-once BLOB storage and
+retrieval API that is intended for robust long-term, per-user storage. Some
+platforms have different mechanisms for this kind of storage, so this API exists
+to allow a client application to access this kind of storage.
+
+Note that there can be only one storage record per user and, thus, a maximum of
+one open storage record can exist for each user. Attempting to open a second
+record for a user will result in undefined behavior.
+
+These APIs are NOT expected to be thread-safe, so either call them from a single
+thread, or perform proper synchronization around all calls.
+
+## Macros ##
+
+### kSbStorageInvalidRecord ###
+
+Well-defined value for an invalid storage record handle.
+
+## Typedefs ##
+
+### SbStorageRecord ###
+
+A handle to an open storage record.
+
+#### Definition ####
+
+```
+typedef SbStorageRecordPrivate* SbStorageRecord
+```
+
+## Functions ##
+
+### SbStorageCloseRecord ###
+
+Closes `record`, synchronously ensuring that all written data is flushed. This
+function performs blocking I/O on the calling thread.
+
+The return value indicates whether the operation succeeded. Storage writes
+should be as atomic as possible, so the record should either be fully written or
+deleted (or, even better, untouched).
+
+`record`: The storage record to close. `record` is invalid after this point, and
+subsequent calls referring to `record` will fail.
+
+#### Declaration ####
+
+```
+bool SbStorageCloseRecord(SbStorageRecord record)
+```
+
+### SbStorageDeleteRecord ###
+
+Deletes the `SbStorageRecord` for `user` named `name`. The return value
+indicates whether the record existed and was successfully deleted. If the record
+did not exist or could not be deleted, the function returns `false`.
+
+If `name` is NULL, deletes the default storage record for the user, like what
+would have been deleted with the previous version of SbStorageDeleteRecord.
+
+This function must not be called while the user's storage record is open. This
+function performs blocking I/O on the calling thread.
+
+`user`: The user for whom the record will be deleted. `name`: The filesystem-
+safe name of the record to open.
+
+#### Declaration ####
+
+```
+bool SbStorageDeleteRecord(SbUser user, const char *name)
+```
+
+### SbStorageGetRecordSize ###
+
+Returns the size of `record`, or `-1` if there is an error. This function
+performs blocking I/O on the calling thread.
+
+`record`: The record to retrieve the size of.
+
+#### Declaration ####
+
+```
+int64_t SbStorageGetRecordSize(SbStorageRecord record)
+```
+
+### SbStorageIsValidRecord ###
+
+Returns whether the given storage record handle is valid.
+
+#### Declaration ####
+
+```
+static bool SbStorageIsValidRecord(SbStorageRecord record)
+```
+
+### SbStorageOpenRecord ###
+
+Opens and returns the SbStorageRecord for `user` named `name`, blocking I/O on
+the calling thread until the open is completed. If `user` is not a valid
+`SbUser`, the function returns `kSbStorageInvalidRecord`. Will return an
+`SbStorageRecord` of size zero if the record does not yet exist. Opening an
+already-open `SbStorageRecord` has undefined behavior.
+
+If `name` is NULL, opens the default storage record for the user, like what
+would have been saved with the previous version of SbStorageOpenRecord.
+
+`user`: The user for which the storage record will be opened. `name`: The
+filesystem-safe name of the record to open.
+
+#### Declaration ####
+
+```
+SbStorageRecord SbStorageOpenRecord(SbUser user, const char *name)
+```
+
+### SbStorageReadRecord ###
+
+Reads up to `data_size` bytes from `record`, starting at the beginning of the
+record. The function returns the actual number of bytes read, which must be <=
+`data_size`. The function returns `-1` in the event of an error. This function
+makes a best-effort to read the entire record, and it performs blocking I/O on
+the calling thread until the entire record is read or an error is encountered.
+
+`record`: The record to be read. `out_data`: The data read from the record.
+`data_size`: The amount of data, in bytes, to read.
+
+#### Declaration ####
+
+```
+int64_t SbStorageReadRecord(SbStorageRecord record, char *out_data, int64_t data_size)
+```
+
+### SbStorageWriteRecord ###
+
+Replaces the data in `record` with `data_size` bytes from `data`. This function
+always deletes any previous data in that record. The return value indicates
+whether the write succeeded. This function makes a best-effort to write the
+entire record, and it may perform blocking I/O on the calling thread until the
+entire record is written or an error is encountered.
+
+While `SbStorageWriteRecord()` may defer the persistence,
+`SbStorageReadRecord()` is expected to work as expected immediately afterwards,
+even without a call to `SbStorageCloseRecord()`. The data should be persisted
+after a short time, even if there is an unexpected process termination before
+`SbStorageCloseRecord()` is called.
+
+`record`: The record to be written to. `data`: The data to write to the record.
+`data_size`: The amount of `data`, in bytes, to write to the record.
+
+#### Declaration ####
+
+```
+bool SbStorageWriteRecord(SbStorageRecord record, const char *data, int64_t data_size)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/string.md b/src/cobalt/site/docs/reference/starboard/modules/11/string.md
similarity index 100%
rename from src/cobalt/site/docs/reference/starboard/modules/4/string.md
rename to src/cobalt/site/docs/reference/starboard/modules/11/string.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/11/system.md b/src/cobalt/site/docs/reference/starboard/modules/11/system.md
new file mode 100644
index 0000000..371d49d
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/11/system.md
@@ -0,0 +1,702 @@
+---
+layout: doc
+title: "Starboard Module Reference: system.h"
+---
+
+Defines a broad set of APIs that allow the client application to query build and
+runtime properties of the enclosing system.
+
+## Enums ##
+
+### SbSystemCapabilityId ###
+
+Runtime capabilities are boolean properties of a platform that can't be
+determined at compile-time. They may vary from device to device, but they will
+not change over the course of a single execution. They often specify particular
+behavior of other APIs within the bounds of their operating range.
+
+#### Values ####
+
+*   `kSbSystemCapabilityReversedEnterAndBack`
+
+    Whether this system has reversed Enter and Back keys.
+*   `kSbSystemCapabilityCanQueryGPUMemoryStats`
+
+    Whether this system has the ability to report on GPU memory usage. If (and
+    only if) a system has this capability will SbSystemGetTotalGPUMemory() and
+    SbSystemGetUsedGPUMemory() be valid to call.
+*   `kSbSystemCapabilitySetsInputTimestamp`
+
+    Whether this system sets the `timestamp` field of SbInputData . If the
+    system does not set this field, then it will automatically be set; however,
+    the relative time between input events likely will not be preserved, so
+    time-related calculations (e.g. velocity for move events) will be incorrect.
+
+### SbSystemConnectionType ###
+
+Enumeration of network connection types.
+
+#### Values ####
+
+*   `kSbSystemConnectionTypeWired`
+
+    The system is on a wired connection.
+*   `kSbSystemConnectionTypeWireless`
+
+    The system is on a wireless connection.
+*   `kSbSystemConnectionTypeUnknown`
+
+    The system connection type is unknown.
+
+### SbSystemDeviceType ###
+
+Enumeration of device types.
+
+#### Values ####
+
+*   `kSbSystemDeviceTypeBlueRayDiskPlayer`
+
+    Blue-ray Disc Player (BDP).
+*   `kSbSystemDeviceTypeGameConsole`
+
+    A relatively high-powered TV device used primarily for playing games.
+*   `kSbSystemDeviceTypeOverTheTopBox`
+
+    Over the top (OTT) devices stream content via the Internet over another type
+    of network, e.g. cable or satellite.
+*   `kSbSystemDeviceTypeSetTopBox`
+
+    Set top boxes (STBs) stream content primarily over cable or satellite. Some
+    STBs can also stream OTT content via the Internet.
+*   `kSbSystemDeviceTypeTV`
+
+    A Smart TV is a TV that can directly run applications that stream OTT
+    content via the Internet.
+*   `kSbSystemDeviceTypeDesktopPC`
+
+    Desktop PC.
+*   `kSbSystemDeviceTypeAndroidTV`
+
+    An Android TV Device.
+*   `kSbSystemDeviceTypeUnknown`
+
+    Unknown device.
+
+### SbSystemPathId ###
+
+Enumeration of special paths that the platform can define.
+
+#### Values ####
+
+*   `kSbSystemPathContentDirectory`
+
+    Path to where the local content files that ship with the binary are
+    available.
+*   `kSbSystemPathCacheDirectory`
+
+    Path to the directory that can be used as a local file cache, if available.
+*   `kSbSystemPathDebugOutputDirectory`
+
+    Path to the directory where debug output (e.g. logs, trace output,
+    screenshots) can be written into.
+*   `kSbSystemPathFontDirectory`
+
+    Path to a directory where system font files can be found. Should only be
+    specified on platforms that provide fonts usable by Starboard applications.
+*   `kSbSystemPathFontConfigurationDirectory`
+
+    Path to a directory where system font configuration metadata can be found.
+    May be the same directory as `kSbSystemPathFontDirectory`, but not
+    necessarily. Should only be specified on platforms that provide fonts usable
+    by Starboard applications.
+*   `kSbSystemPathTempDirectory`
+
+    Path to a directory where temporary files can be written.
+*   `kSbSystemPathTestOutputDirectory`
+
+    Path to a directory where test results can be written.
+*   `kSbSystemPathExecutableFile`
+
+    Full path to the executable file.
+
+### SbSystemPlatformErrorResponse ###
+
+Possible responses for `SbSystemPlatformErrorCallback`.
+
+#### Values ####
+
+*   `kSbSystemPlatformErrorResponsePositive`
+*   `kSbSystemPlatformErrorResponseNegative`
+*   `kSbSystemPlatformErrorResponseCancel`
+
+### SbSystemPlatformErrorType ###
+
+Enumeration of possible values for the `type` parameter passed to the
+`SbSystemRaisePlatformError` function.
+
+#### Values ####
+
+*   `kSbSystemPlatformErrorTypeConnectionError`
+
+    Cobalt received a network connection error, or a network disconnection
+    event. If the `response` passed to `SbSystemPlatformErrorCallback` is
+    `kSbSystemPlatformErrorResponsePositive` then the request should be retried,
+    otherwise the app should be stopped.
+
+### SbSystemPropertyId ###
+
+System properties that can be queried for. Many of these are used in User-Agent
+string generation.
+
+#### Values ####
+
+*   `kSbSystemPropertyCertificationScope`
+
+    The certification scope that identifies a group of devices.
+*   `kSbSystemPropertyBase64EncodedCertificationSecret`
+
+    The HMAC-SHA256 base64 encoded symmetric key used to sign a subset of the
+    query parameters from the application startup URL.
+*   `kSbSystemPropertyChipsetModelNumber`
+
+    The full model number of the main platform chipset, including any vendor-
+    specific prefixes.
+*   `kSbSystemPropertyFirmwareVersion`
+
+    The production firmware version number which the device is currently
+    running.
+*   `kSbSystemPropertyFriendlyName`
+
+    A friendly name for this actual device. It may include user-personalization
+    like "Upstairs Bedroom." It may be displayed to users as part of some kind
+    of device selection (e.g. in-app DIAL).
+*   `kSbSystemPropertyManufacturerName`
+
+    A deprecated alias for `kSbSystemPropertyBrandName`.
+*   `kSbSystemPropertyBrandName`
+
+    The name of the brand under which the device is being sold.
+*   `kSbSystemPropertyModelName`
+
+    The final production model number of the device.
+*   `kSbSystemPropertyModelYear`
+
+    The year the device was launched, e.g. "2016".
+*   `kSbSystemPropertyOriginalDesignManufacturerName`
+
+    The corporate entity responsible for the manufacturing/assembly of the
+    device on behalf of the business entity owning the brand. This is often
+    abbreviated as ODM.
+*   `kSbSystemPropertyPlatformName`
+
+    The name of the operating system and platform, suitable for inclusion in a
+    User-Agent, say.
+*   `kSbSystemPropertySpeechApiKey`
+
+    The Google Speech API key. The platform manufacturer is responsible for
+    registering a Google Speech API key for their products. In the API Console (
+    [http://developers.google.com/console](http://developers.google.com/console)
+    ), you can enable the Speech APIs and generate a Speech API key.
+*   `kSbSystemPropertyUserAgentAuxField`
+
+    A field that, if available, is appended to the user agent
+
+## Typedefs ##
+
+### SbSystemComparator ###
+
+Pointer to a function to compare two items. The return value uses standard
+`*cmp` semantics:
+
+*   `< 0` if `a` is less than `b`
+
+*   `0` if the two items are equal
+
+*   `> 1` if `a` is greater than `b`
+
+`a`: The first value to compare. `b`: The second value to compare.
+
+#### Definition ####
+
+```
+typedef int(* SbSystemComparator) (const void *a, const void *b)
+```
+
+### SbSystemError ###
+
+A type that can represent a system error code across all Starboard platforms.
+
+#### Definition ####
+
+```
+typedef int SbSystemError
+```
+
+### SbSystemPlatformErrorCallback ###
+
+Type of callback function that may be called in response to an error
+notification from `SbSystemRaisePlatformError`. `response` is a code to indicate
+the user's response, e.g. if the platform raised a dialog to notify the user of
+the error. `user_data` is the opaque pointer that was passed to the call to
+`SbSystemRaisePlatformError`.
+
+#### Definition ####
+
+```
+typedef void(* SbSystemPlatformErrorCallback) (SbSystemPlatformErrorResponse response, void *user_data)
+```
+
+## Functions ##
+
+### SbSystemBinarySearch ###
+
+Binary searches a sorted table `base` of `element_count` objects, each element
+`element_width` bytes in size for an element that `comparator` compares equal to
+`key`.
+
+This function is meant to be a drop-in replacement for `bsearch`.
+
+`key`: The key to search for in the table. `base`: The sorted table of elements
+to be searched. `element_count`: The number of elements in the table.
+`element_width`: The size, in bytes, of each element in the table. `comparator`:
+A value that indicates how the element in the table should compare to the
+specified `key`.
+
+#### Declaration ####
+
+```
+void* SbSystemBinarySearch(const void *key, const void *base, size_t element_count, size_t element_width, SbSystemComparator comparator)
+```
+
+### SbSystemBreakIntoDebugger ###
+
+Breaks the current program into the debugger, if a debugger is attached. If a
+debugger is not attached, this function aborts the program.
+
+#### Declaration ####
+
+```
+SB_NORETURN void SbSystemBreakIntoDebugger()
+```
+
+### SbSystemClearLastError ###
+
+Clears the last error set by a Starboard call in the current thread.
+
+#### Declaration ####
+
+```
+void SbSystemClearLastError()
+```
+
+### SbSystemGetConnectionType ###
+
+Returns the device's current network connection type.
+
+#### Declaration ####
+
+```
+SbSystemConnectionType SbSystemGetConnectionType()
+```
+
+### SbSystemGetDeviceType ###
+
+Returns the type of the device.
+
+#### Declaration ####
+
+```
+SbSystemDeviceType SbSystemGetDeviceType()
+```
+
+### SbSystemGetErrorString ###
+
+Generates a human-readable string for an error. The return value specifies the
+total desired length of the string.
+
+`error`: The error for which a human-readable string is generated. `out_string`:
+The generated string. This value may be null, and it is always terminated with a
+null byte. `string_length`: The maximum length of the error string.
+
+#### Declaration ####
+
+```
+int SbSystemGetErrorString(SbSystemError error, char *out_string, int string_length)
+```
+
+### SbSystemGetLastError ###
+
+Gets the last platform-specific error code produced by any Starboard call in the
+current thread for diagnostic purposes. Semantic reactions to Starboard function
+call results should be modeled explicitly.
+
+#### Declaration ####
+
+```
+SbSystemError SbSystemGetLastError()
+```
+
+### SbSystemGetLocaleId ###
+
+Gets the system's current POSIX-style Locale ID. The locale represents the
+location, language, and cultural conventions that the system wants to use, which
+affects which text is displayed to the user as well as how displayed numbers,
+dates, currency, and similar values are formatted.
+
+At its simplest, the locale ID can just be a BCP 47 language code, like `en_US`.
+Currently, POSIX also wants to include the encoding as in `en_US.UTF8`. POSIX
+also allows a couple very bare-bones locales, like "C" or "POSIX", but they are
+not supported here. POSIX also supports different locale settings for a few
+different purposes, but Starboard only exposes one locale at a time.
+
+RFC 5646 describes BCP 47 language codes: [https://tools.ietf.org/html/bcp47](https://tools.ietf.org/html/bcp47)
+
+For more information than you probably want about POSIX locales, see: [http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html)
+
+#### Declaration ####
+
+```
+const char* SbSystemGetLocaleId()
+```
+
+### SbSystemGetNumberOfProcessors ###
+
+Returns the number of processor cores available to this application. If the
+process is sandboxed to a subset of the physical cores, the function returns
+that sandboxed limit.
+
+#### Declaration ####
+
+```
+int SbSystemGetNumberOfProcessors()
+```
+
+### SbSystemGetProperty ###
+
+Retrieves the platform-defined system property specified by `property_id` and
+places its value as a zero-terminated string into the user-allocated `out_value`
+unless it is longer than `value_length` - 1. This implementation must be thread-
+safe.
+
+This function returns `true` if the property is retrieved successfully. It
+returns `false` under any of the following conditions and, in any such case,
+`out_value` is not changed:
+
+*   `property_id` is invalid for this platform
+
+*   `value_length` is too short for the given result
+
+*   `out_value` is NULL
+
+`property_id`: The system path to be retrieved. `out_value`: The platform-
+defined system property specified by `property_id`. `value_length`: The length
+of the system property.
+
+#### Declaration ####
+
+```
+bool SbSystemGetProperty(SbSystemPropertyId property_id, char *out_value, int value_length)
+```
+
+### SbSystemGetRandomData ###
+
+A cryptographically secure random number generator that produces an arbitrary,
+non-negative number of `buffer_size` random, non-negative bytes. The generated
+number is placed in `out_buffer`. This function does not require manual seeding.
+
+`out_buffer`: A pointer for the generated random number. This value must not be
+null. `buffer_size`: The size of the random number, in bytes.
+
+#### Declaration ####
+
+```
+void SbSystemGetRandomData(void *out_buffer, int buffer_size)
+```
+
+### SbSystemGetRandomUInt64 ###
+
+A cryptographically secure random number generator that gets 64 random bits and
+returns them as an `uint64_t`. This function does not require manual seeding.
+
+#### Declaration ####
+
+```
+uint64_t SbSystemGetRandomUInt64()
+```
+
+### SbSystemGetStack ###
+
+Places up to `stack_size` instruction pointer addresses of the current execution
+stack into `out_stack`. The return value specifies the number of entries added.
+
+The returned stack frames are in "downward" order from the calling frame toward
+the entry point of the thread. So, if all the stack frames do not fit, the ones
+truncated will be the less interesting ones toward the thread entry point.
+
+This function is used in crash signal handlers and, therefore, it must be async-
+signal-safe on platforms that support signals. The following document discusses
+what it means to be async-signal-safe on POSIX: [http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html#tag_02_04_03](http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html#tag_02_04_03)
+
+`out_stack`: A non-NULL array of `void *` of at least `stack_size` entries.
+`stack_size`: The maximum number of instruction pointer addresses to be placed
+into `out_stack` from the current execution stack.
+
+#### Declaration ####
+
+```
+int SbSystemGetStack(void **out_stack, int stack_size)
+```
+
+### SbSystemGetTotalCPUMemory ###
+
+Returns the total CPU memory (in bytes) potentially available to this
+application. If the process is sandboxed to a maximum allowable limit, the
+function returns the lesser of the physical and sandbox limits.
+
+#### Declaration ####
+
+```
+int64_t SbSystemGetTotalCPUMemory()
+```
+
+### SbSystemGetTotalGPUMemory ###
+
+Returns the total GPU memory (in bytes) available for use by this application.
+This function may only be called the return value for calls to
+SbSystemHasCapability(kSbSystemCapabilityCanQueryGPUMemoryStats) is `true`.
+
+#### Declaration ####
+
+```
+int64_t SbSystemGetTotalGPUMemory()
+```
+
+### SbSystemGetUsedCPUMemory ###
+
+Returns the total physical CPU memory (in bytes) used by this application. This
+value should always be less than (or, in particularly exciting situations, equal
+to) SbSystemGetTotalCPUMemory().
+
+#### Declaration ####
+
+```
+int64_t SbSystemGetUsedCPUMemory()
+```
+
+### SbSystemGetUsedGPUMemory ###
+
+Returns the current amount of GPU memory (in bytes) that is currently being used
+by this application. This function may only be called if the return value for
+calls to SbSystemHasCapability(kSbSystemCapabilityCanQueryGPUMemoryStats) is
+`true`.
+
+#### Declaration ####
+
+```
+int64_t SbSystemGetUsedGPUMemory()
+```
+
+### SbSystemHasCapability ###
+
+Returns whether the platform has the runtime capability specified by
+`capability_id`. Returns false for any unknown capabilities. This implementation
+must be thread-safe.
+
+`capability_id`: The runtime capability to check.
+
+#### Declaration ####
+
+```
+bool SbSystemHasCapability(SbSystemCapabilityId capability_id)
+```
+
+### SbSystemHideSplashScreen ###
+
+Hides the system splash screen on systems that support a splash screen that is
+displayed while the application is loading. This function may be called from any
+thread and must be idempotent.
+
+#### Declaration ####
+
+```
+void SbSystemHideSplashScreen()
+```
+
+### SbSystemIsDebuggerAttached ###
+
+Attempts to determine whether the current program is running inside or attached
+to a debugger. The function returns `false` if neither of those cases is true.
+
+#### Declaration ####
+
+```
+bool SbSystemIsDebuggerAttached()
+```
+
+### SbSystemRaisePlatformError ###
+
+Cobalt calls this function to notify the platform that an error has occurred in
+the application that the platform may need to handle. The platform is expected
+to then notify the user of the error and to provide a means for any required
+interaction, such as by showing a dialog.
+
+The return value is a boolean. If the platform cannot respond to the error, then
+this function should return `false`, otherwise it should return `true`.
+
+This function may be called from any thread, and it is the platform's
+responsibility to decide how to handle an error received while a previous error
+is still pending. If that platform can only handle one error at a time, then it
+may queue the second error or ignore it by returning
+`kSbSystemPlatformErrorInvalid`.
+
+`type`: An error type, from the SbSystemPlatformErrorType enum, that defines the
+error. `callback`: A function that may be called by the platform to let the
+caller know that the user has reacted to the error. `user_data`: An opaque
+pointer that the platform should pass as an argument to the callback function,
+if it is called.
+
+#### Declaration ####
+
+```
+bool SbSystemRaisePlatformError(SbSystemPlatformErrorType type, SbSystemPlatformErrorCallback callback, void *user_data)
+```
+
+### SbSystemRequestPause ###
+
+Requests that the application move into the Paused state at the next convenient
+point. This should roughly correspond to "unfocused application" in a
+traditional window manager, where the application may be partially visible.
+
+This function eventually causes a `kSbEventTypePause` event to be dispatched to
+the application. Before the `kSbEventTypePause` event is dispatched, some work
+may continue to be done, and unrelated system events may be dispatched.
+
+#### Declaration ####
+
+```
+void SbSystemRequestPause()
+```
+
+### SbSystemRequestStop ###
+
+Requests that the application be terminated gracefully at the next convenient
+point. In the meantime, some work may continue to be done, and unrelated system
+events may be dispatched. This function eventually causes a `kSbEventTypeStop`
+event to be dispatched to the application. When the process finally terminates,
+it returns `error_level`, if that has any meaning on the current platform.
+
+`error_level`: An integer that serves as the return value for the process that
+is eventually terminated as a result of a call to this function.
+
+#### Declaration ####
+
+```
+void SbSystemRequestStop(int error_level)
+```
+
+### SbSystemRequestSuspend ###
+
+Requests that the application move into the Suspended state at the next
+convenient point. This should roughly correspond to "minimization" in a
+traditional window manager, where the application is no longer visible.
+
+This function eventually causes a `kSbEventTypeSuspend` event to be dispatched
+to the application. Before the `kSbEventTypeSuspend` event is dispatched, some
+work may continue to be done, and unrelated system events may be dispatched.
+
+In the Suspended state, the application will be resident, but probably not
+running. The expectation is that an external system event will bring the
+application out of the Suspended state.
+
+#### Declaration ####
+
+```
+void SbSystemRequestSuspend()
+```
+
+### SbSystemRequestUnpause ###
+
+Requests that the application move into the Started state at the next convenient
+point. This should roughly correspond to a "focused application" in a
+traditional window manager, where the application is fully visible and the
+primary receiver of input events.
+
+This function eventually causes a `kSbEventTypeUnpause` event to be dispatched
+to the application. Before `kSbEventTypeUnpause` is dispatched, some work may
+continue to be done, and unrelated system events may be dispatched.
+
+#### Declaration ####
+
+```
+void SbSystemRequestUnpause()
+```
+
+### SbSystemSignWithCertificationSecretKey ###
+
+Computes a HMAC-SHA256 digest of `message` into `digest` using the application's
+certification secret.
+
+This function may be implemented as an alternative to implementing
+SbSystemGetProperty(kSbSystemPropertyBase64EncodedCertificationSecret), however
+both should not be implemented.
+
+The output will be written into `digest`. `digest_size_in_bytes` must be 32 (or
+greater), since 32-bytes will be written into it. Returns false in the case of
+an error, or if it is not implemented. In this case the contents of `digest`
+will be undefined.
+
+#### Declaration ####
+
+```
+bool SbSystemSignWithCertificationSecretKey(const uint8_t *message, size_t message_size_in_bytes, uint8_t *digest, size_t digest_size_in_bytes)
+```
+
+### SbSystemSort ###
+
+Sorts an array of elements `base`, with `element_count` elements of
+`element_width` bytes each, using `comparator` as the comparison function.
+
+This function is meant to be a drop-in replacement for `qsort`.
+
+`base`: The array of elements to be sorted. `element_count`: The number of
+elements in the array. `element_width`: The size, in bytes, of each element in
+the array. `comparator`: A value that indicates how the array should be sorted.
+
+#### Declaration ####
+
+```
+void SbSystemSort(void *base, size_t element_count, size_t element_width, SbSystemComparator comparator)
+```
+
+### SbSystemSupportsResume ###
+
+Returns false if the platform doesn't need resume after suspend support. In such
+case Cobalt will free up the resource it retains for resume after suspend. Note
+that if this function returns false, the Starboard implementation cannot send
+kSbEventTypeResume to the event handler. The return value of this function
+cannot change over the life time of the application.
+
+#### Declaration ####
+
+```
+bool SbSystemSupportsResume()
+```
+
+### SbSystemSymbolize ###
+
+Looks up `address` as an instruction pointer and places up to (`buffer_size -
+1`) characters of the symbol associated with it in `out_buffer`, which must not
+be NULL. `out_buffer` will be NULL-terminated.
+
+The return value indicates whether the function found a reasonable match for
+`address`. If the return value is `false`, then `out_buffer` is not modified.
+
+This function is used in crash signal handlers and, therefore, it must be async-
+signal-safe on platforms that support signals.
+
+#### Declaration ####
+
+```
+bool SbSystemSymbolize(const void *address, char *out_buffer, int buffer_size)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/11/thread.md b/src/cobalt/site/docs/reference/starboard/modules/11/thread.md
new file mode 100644
index 0000000..d1fa609
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/11/thread.md
@@ -0,0 +1,524 @@
+---
+layout: doc
+title: "Starboard Module Reference: thread.h"
+---
+
+Defines functionality related to thread creation and cleanup.
+
+## Macros ##
+
+### kSbThreadContextInvalid ###
+
+Well-defined value for an invalid thread context.
+
+### kSbThreadInvalidId ###
+
+Well-defined constant value to mean "no thread ID."
+
+### kSbThreadLocalKeyInvalid ###
+
+Well-defined constant value to mean "no thread local key."
+
+### kSbThreadNoAffinity ###
+
+Well-defined constant value to mean "no affinity."
+
+### kSbThreadSamplerInvalid ###
+
+Well-defined value for an invalid thread sampler.
+
+## Enums ##
+
+### SbThreadPriority ###
+
+A spectrum of thread priorities. Platforms map them appropriately to their own
+priority system. Note that scheduling is platform-specific, and what these
+priorities mean, if they mean anything at all, is also platform-specific.
+
+In particular, several of these priority values can map to the same priority on
+a given platform. The only guarantee is that each lower priority should be
+treated less-than-or-equal-to a higher priority.
+
+#### Values ####
+
+*   `kSbThreadPriorityLowest`
+
+    The lowest thread priority available on the current platform.
+*   `kSbThreadPriorityLow`
+
+    A lower-than-normal thread priority, if available on the current platform.
+*   `kSbThreadPriorityNormal`
+
+    Really, what is normal? You should spend time pondering that question more
+    than you consider less-important things, but less than you think about more-
+    important things.
+*   `kSbThreadPriorityHigh`
+
+    A higher-than-normal thread priority, if available on the current platform.
+*   `kSbThreadPriorityHighest`
+
+    The highest thread priority available on the current platform that isn't
+    considered "real-time" or "time-critical," if those terms have any meaning
+    on the current platform.
+*   `kSbThreadPriorityRealTime`
+
+    If the platform provides any kind of real-time or time-critical scheduling,
+    this priority will request that treatment. Real-time scheduling generally
+    means that the thread will have more consistency in scheduling than non-
+    real-time scheduled threads, often by being more deterministic in how
+    threads run in relation to each other. But exactly how being real-time
+    affects the thread scheduling is platform-specific.
+
+    For platforms where that is not offered, or otherwise not meaningful, this
+    will just be the highest priority available in the platform's scheme, which
+    may be the same as kSbThreadPriorityHighest.
+*   `kSbThreadNoPriority`
+
+    Well-defined constant value to mean "no priority." This means to use the
+    default priority assignment method of that platform. This may mean to
+    inherit the priority of the spawning thread, or it may mean a specific
+    default priority, or it may mean something else, depending on the platform.
+
+## Typedefs ##
+
+### SbThreadAffinity ###
+
+Type for thread core affinity. This generally will be a single cpu (or core or
+hyperthread) identifier. Some platforms may not support affinity, and some may
+have specific rules about how it must be used.
+
+#### Definition ####
+
+```
+typedef int32_t SbThreadAffinity
+```
+
+### SbThreadContext ###
+
+A handle to the context of a frozen thread.
+
+#### Definition ####
+
+```
+typedef SbThreadContextPrivate* SbThreadContext
+```
+
+### SbThreadEntryPoint ###
+
+Function pointer type for SbThreadCreate. `context` is a pointer-sized bit of
+data passed in from the calling thread.
+
+#### Definition ####
+
+```
+typedef void*(* SbThreadEntryPoint) (void *context)
+```
+
+### SbThreadId ###
+
+An ID type that is unique per thread.
+
+#### Definition ####
+
+```
+typedef int32_t SbThreadId
+```
+
+### SbThreadLocalDestructor ###
+
+Function pointer type for Thread-Local destructors.
+
+#### Definition ####
+
+```
+typedef void(* SbThreadLocalDestructor) (void *value)
+```
+
+### SbThreadLocalKey ###
+
+A handle to a thread-local key.
+
+#### Definition ####
+
+```
+typedef SbThreadLocalKeyPrivate* SbThreadLocalKey
+```
+
+### SbThreadSampler ###
+
+A handle to a thread sampler.
+
+#### Definition ####
+
+```
+typedef SbThreadSamplerPrivate* SbThreadSampler
+```
+
+## Functions ##
+
+### SbThreadContextGetPointer ###
+
+Gets the specified pointer-type `property` from the specified `context`. Returns
+`true` if successful and `out_value` has been modified, otherwise returns
+`false` and `out_value` is not modified.
+
+#### Declaration ####
+
+```
+bool SbThreadContextGetPointer(SbThreadContext context, SbThreadContextProperty property, void **out_value)
+```
+
+### SbThreadContextIsValid ###
+
+Returns whether the given thread context is valid.
+
+#### Declaration ####
+
+```
+static bool SbThreadContextIsValid(SbThreadContext context)
+```
+
+### SbThreadCreate ###
+
+Creates a new thread, which starts immediately.
+
+*   If the function succeeds, the return value is a handle to the newly created
+    thread.
+
+*   If the function fails, the return value is `kSbThreadInvalid`.
+
+`stack_size`: The amount of memory reserved for the thread. Set the value to `0`
+to indicate that the default stack size should be used. `priority`: The thread's
+priority. This value can be set to `kSbThreadNoPriority` to use the platform's
+default priority. As examples, it could be set to a fixed, standard priority or
+to a priority inherited from the thread that is calling SbThreadCreate(), or to
+something else. `affinity`: The thread's affinity. This value can be set to
+`kSbThreadNoAffinity` to use the platform's default affinity. `joinable`:
+Indicates whether the thread can be joined (`true`) or should start out
+"detached" (`false`). Note that for joinable threads, when you are done with the
+thread handle, you must call `SbThreadJoin` to release system resources
+associated with the thread. This is not necessary for detached threads, but
+detached threads cannot be joined. `name`: A name used to identify the thread.
+This value is used mainly for debugging, it can be `NULL`, and it might not be
+used in production builds. `entry_point`: A pointer to a function that will be
+executed on the newly created thread. `context`: This value will be passed to
+the `entry_point` function.
+
+#### Declaration ####
+
+```
+SbThread SbThreadCreate(int64_t stack_size, SbThreadPriority priority, SbThreadAffinity affinity, bool joinable, const char *name, SbThreadEntryPoint entry_point, void *context)
+```
+
+### SbThreadCreateLocalKey ###
+
+Creates and returns a new, unique key for thread local data. If the function
+does not succeed, the function returns `kSbThreadLocalKeyInvalid`.
+
+If `destructor` is specified, it will be called in the owning thread, and only
+in the owning thread, when the thread exits. In that case, it is called on the
+local value associated with the key in the current thread as long as the local
+value is not NULL.
+
+`destructor`: A pointer to a function. The value may be NULL if no clean up is
+needed.
+
+#### Declaration ####
+
+```
+SbThreadLocalKey SbThreadCreateLocalKey(SbThreadLocalDestructor destructor)
+```
+
+### SbThreadDestroyLocalKey ###
+
+Destroys thread local data for the specified key. The function is a no-op if the
+key is invalid (kSbThreadLocalKeyInvalid`) or has already been destroyed. This
+function does NOT call the destructor on any stored values.
+
+`key`: The key for which to destroy thread local data.
+
+#### Declaration ####
+
+```
+void SbThreadDestroyLocalKey(SbThreadLocalKey key)
+```
+
+### SbThreadDetach ###
+
+Detaches `thread`, which prevents it from being joined. This is sort of like a
+non-blocking join. This function is a no-op if the thread is already detached or
+if the thread is already being joined by another thread.
+
+`thread`: The thread to be detached.
+
+#### Declaration ####
+
+```
+void SbThreadDetach(SbThread thread)
+```
+
+### SbThreadGetCurrent ###
+
+Returns the handle of the currently executing thread.
+
+#### Declaration ####
+
+```
+SbThread SbThreadGetCurrent()
+```
+
+### SbThreadGetId ###
+
+Returns the Thread ID of the currently executing thread.
+
+#### Declaration ####
+
+```
+SbThreadId SbThreadGetId()
+```
+
+### SbThreadGetLocalValue ###
+
+Returns the pointer-sized value for `key` in the currently executing thread's
+local storage. Returns `NULL` if key is `kSbThreadLocalKeyInvalid` or if the key
+has already been destroyed.
+
+`key`: The key for which to return the value.
+
+#### Declaration ####
+
+```
+void* SbThreadGetLocalValue(SbThreadLocalKey key)
+```
+
+### SbThreadGetName ###
+
+Returns the debug name of the currently executing thread.
+
+#### Declaration ####
+
+```
+void SbThreadGetName(char *buffer, int buffer_size)
+```
+
+### SbThreadIsCurrent ###
+
+Returns whether `thread` is the current thread.
+
+`thread`: The thread to check.
+
+#### Declaration ####
+
+```
+static bool SbThreadIsCurrent(SbThread thread)
+```
+
+### SbThreadIsEqual ###
+
+Indicates whether `thread1` and `thread2` refer to the same thread.
+
+`thread1`: The first thread to compare. `thread2`: The second thread to compare.
+
+#### Declaration ####
+
+```
+bool SbThreadIsEqual(SbThread thread1, SbThread thread2)
+```
+
+### SbThreadIsValid ###
+
+Returns whether the given thread handle is valid.
+
+#### Declaration ####
+
+```
+static bool SbThreadIsValid(SbThread thread)
+```
+
+### SbThreadIsValidAffinity ###
+
+Returns whether the given thread affinity is valid.
+
+#### Declaration ####
+
+```
+static bool SbThreadIsValidAffinity(SbThreadAffinity affinity)
+```
+
+### SbThreadIsValidId ###
+
+Returns whether the given thread ID is valid.
+
+#### Declaration ####
+
+```
+static bool SbThreadIsValidId(SbThreadId id)
+```
+
+### SbThreadIsValidLocalKey ###
+
+Returns whether the given thread local variable key is valid.
+
+#### Declaration ####
+
+```
+static bool SbThreadIsValidLocalKey(SbThreadLocalKey key)
+```
+
+### SbThreadIsValidPriority ###
+
+Returns whether the given thread priority is valid.
+
+#### Declaration ####
+
+```
+static bool SbThreadIsValidPriority(SbThreadPriority priority)
+```
+
+### SbThreadJoin ###
+
+Joins the thread on which this function is called with joinable `thread`. This
+function blocks the caller until the designated thread exits, and then cleans up
+that thread's resources. The cleanup process essentially detaches thread.
+
+The return value is `true` if the function is successful and `false` if `thread`
+is invalid or detached.
+
+Each joinable thread can only be joined once and must be joined to be fully
+cleaned up. Once SbThreadJoin is called, the thread behaves as if it were
+detached to all threads other than the joining thread.
+
+`thread`: The thread to which the current thread will be joined. The `thread`
+must have been created with SbThreadCreate. `out_return`: If this is not `NULL`,
+then the SbThreadJoin function populates it with the return value of the
+thread's `main` function.
+
+#### Declaration ####
+
+```
+bool SbThreadJoin(SbThread thread, void **out_return)
+```
+
+### SbThreadSamplerCreate ###
+
+Creates a new thread sampler for the specified `thread`.
+
+If successful, this function returns the newly created handle. If unsuccessful,
+this function returns `kSbThreadSamplerInvalid`.
+
+#### Declaration ####
+
+```
+SbThreadSampler SbThreadSamplerCreate(SbThread thread)
+```
+
+### SbThreadSamplerDestroy ###
+
+Destroys the `sampler` and frees whatever resources it was using.
+
+#### Declaration ####
+
+```
+void SbThreadSamplerDestroy(SbThreadSampler sampler)
+```
+
+### SbThreadSamplerFreeze ###
+
+Suspends execution of the thread that `sampler` was created for.
+
+If successful, this function returns a `SbThreadContext` for the frozen thread,
+from which properties may be read while the thread remains frozen. If
+unsuccessful, this function returns `kSbThreadContextInvalid`.
+
+#### Declaration ####
+
+```
+SbThreadContext SbThreadSamplerFreeze(SbThreadSampler sampler)
+```
+
+### SbThreadSamplerIsSupported ###
+
+Whether the current platform supports thread sampling. The result of this
+function must not change over the course of the program, which means that the
+results of this function may be cached indefinitely. If this returns false,
+`SbThreadSamplerCreate` will return an invalid sampler.
+
+#### Declaration ####
+
+```
+bool SbThreadSamplerIsSupported()
+```
+
+### SbThreadSamplerIsValid ###
+
+Returns whether the given thread sampler is valid.
+
+#### Declaration ####
+
+```
+static bool SbThreadSamplerIsValid(SbThreadSampler sampler)
+```
+
+### SbThreadSamplerThaw ###
+
+Resumes execution of the thread that `sampler` was created for. This invalidates
+the context returned from `SbThreadSamplerFreeze`.
+
+#### Declaration ####
+
+```
+bool SbThreadSamplerThaw(SbThreadSampler sampler)
+```
+
+### SbThreadSetLocalValue ###
+
+Sets the pointer-sized value for `key` in the currently executing thread's local
+storage. The return value indicates whether `key` is valid and has not already
+been destroyed.
+
+`key`: The key for which to set the key value. `value`: The new pointer-sized
+key value.
+
+#### Declaration ####
+
+```
+bool SbThreadSetLocalValue(SbThreadLocalKey key, void *value)
+```
+
+### SbThreadSetName ###
+
+Sets the debug name of the currently executing thread by copying the specified
+name string.
+
+`name`: The name to assign to the thread.
+
+#### Declaration ####
+
+```
+void SbThreadSetName(const char *name)
+```
+
+### SbThreadSleep ###
+
+Sleeps the currently executing thread.
+
+`duration`: The minimum amount of time, in microseconds, that the currently
+executing thread should sleep. The function is a no-op if this value is negative
+or `0`.
+
+#### Declaration ####
+
+```
+void SbThreadSleep(SbTime duration)
+```
+
+### SbThreadYield ###
+
+Yields the currently executing thread, so another thread has a chance to run.
+
+#### Declaration ####
+
+```
+void SbThreadYield()
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/time.md b/src/cobalt/site/docs/reference/starboard/modules/11/time.md
similarity index 100%
rename from src/cobalt/site/docs/reference/starboard/modules/4/time.md
rename to src/cobalt/site/docs/reference/starboard/modules/11/time.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/time_zone.md b/src/cobalt/site/docs/reference/starboard/modules/11/time_zone.md
similarity index 100%
rename from src/cobalt/site/docs/reference/starboard/modules/6/time_zone.md
rename to src/cobalt/site/docs/reference/starboard/modules/11/time_zone.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/types.md b/src/cobalt/site/docs/reference/starboard/modules/11/types.md
similarity index 100%
rename from src/cobalt/site/docs/reference/starboard/modules/4/types.md
rename to src/cobalt/site/docs/reference/starboard/modules/11/types.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/user.md b/src/cobalt/site/docs/reference/starboard/modules/11/user.md
similarity index 100%
rename from src/cobalt/site/docs/reference/starboard/modules/4/user.md
rename to src/cobalt/site/docs/reference/starboard/modules/11/user.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/11/window.md b/src/cobalt/site/docs/reference/starboard/modules/11/window.md
new file mode 100644
index 0000000..d050f89
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/11/window.md
@@ -0,0 +1,321 @@
+---
+layout: doc
+title: "Starboard Module Reference: window.h"
+---
+
+Provides functionality to handle Window creation and management.
+
+## Macros ##
+
+### kSbEventOnScreenKeyboardInvalidTicket ###
+
+System-triggered OnScreenKeyboard events have ticket value
+kSbEventOnScreenKeyboardInvalidTicket.
+
+### kSbWindowInvalid ###
+
+Well-defined value for an invalid window handle.
+
+## Typedefs ##
+
+### SbWindow ###
+
+A handle to a window.
+
+#### Definition ####
+
+```
+typedef SbWindowPrivate* SbWindow
+```
+
+## Structs ##
+
+### SbWindowOptions ###
+
+Options that can be requested at window creation time.
+
+#### Members ####
+
+*   `SbWindowSize size`
+
+    The requested size of the new window. The value of `video_pixel_ratio` will
+    not be used or looked at.
+*   `bool windowed`
+
+    Whether the new window should be windowed or not. If not, the requested size
+    is really the requested resolution.
+*   `const char * name`
+
+    The name of the window to create.
+
+### SbWindowRect ###
+
+Defines a rectangle via a point `(x, y)` and a size `(width, height)`. This
+structure is used as output for SbWindowGetOnScreenKeyboardBoundingRect.
+
+#### Members ####
+
+*   `float x`
+*   `float y`
+*   `float width`
+*   `float height`
+
+### SbWindowSize ###
+
+The size of a window in graphics rendering coordinates. The width and height of
+a window should correspond to the size of the graphics surface used for drawing
+that would be created to back that window.
+
+#### Members ####
+
+*   `int width`
+
+    The width of the window in graphics pixels.
+*   `int height`
+
+    The height of the window in graphics pixels.
+*   `float video_pixel_ratio`
+
+    The ratio of video pixels to graphics pixels. This ratio must be applied
+    equally to width and height, meaning the aspect ratio is maintained.
+
+    A value of 1.0f means the video resolution is the same as the graphics
+    resolution. This is the most common case.
+
+    Values greater than 1.0f mean that the video resolution is higher (denser,
+    larger) than the graphics resolution. This is a common case as devices often
+    have more video decoding capabilities than graphics rendering capabilities
+    (or memory, etc...).
+
+    Values less than 1.0f mean that the maximum video resolution is smaller than
+    the graphics resolution.
+
+    A value of 0.0f means the ratio could not be determined, it should be
+    assumed to be the same as the graphics resolution (i.e. 1.0f).
+
+## Functions ##
+
+### SbWindowBlurOnScreenKeyboard ###
+
+Blur the on screen keyboard. Fire kSbEventTypeOnScreenKeyboardBlurred.
+kSbEventTypeOnScreenKeyboardBlurred has data `ticket`. Calling
+SbWindowBlurOnScreenKeyboard() when the keyboard is already blurred is
+permitted. Calling SbWindowBlurOnScreenKeyboard while the on screen keyboard is
+not showing does nothing and does not fire any event.
+
+#### Declaration ####
+
+```
+void SbWindowBlurOnScreenKeyboard(SbWindow window, int ticket)
+```
+
+### SbWindowCreate ###
+
+Creates and returns a new system window with the given `options`, which may be
+`NULL`. The function returns `kSbWindowInvalid` if it cannot create the
+requested `SbWindow` due to policy, unsatisfiable options, or any other reason.
+
+If `options` are not specified, this function uses all defaults, which must work
+on every platform. In general, it defaults to creating a fullscreen window at
+the highest 16:9 resolution possible. If the platform does not support
+fullscreen windows, then it creates a normal, windowed window.
+
+Some devices are fullscreen-only, including many production targets for
+Starboard. In those cases, only one SbWindow may be created, and it must be
+fullscreen. Additionally, in those cases, the requested size will actually be
+the requested resolution.
+
+An SbWindow must be created to receive window-based events, like input events,
+even on fullscreen-only devices. These events are dispatched to the Starboard
+entry point.
+
+`options`: Options that specify parameters for the window being created.
+
+#### Declaration ####
+
+```
+SbWindow SbWindowCreate(const SbWindowOptions *options)
+```
+
+### SbWindowDestroy ###
+
+Destroys `window`, reclaiming associated resources.
+
+`window`: The `SbWindow` to destroy.
+
+#### Declaration ####
+
+```
+bool SbWindowDestroy(SbWindow window)
+```
+
+### SbWindowFocusOnScreenKeyboard ###
+
+Focus the on screen keyboard. Fire kSbEventTypeOnScreenKeyboardFocused.
+kSbEventTypeOnScreenKeyboardFocused has data `ticket`. Calling
+SbWindowFocusOnScreenKeyboard() when the keyboard is already focused is
+permitted. Calling SbWindowFocusOnScreenKeyboard while the on screen keyboard is
+not showing does nothing and does not fire any event.
+
+#### Declaration ####
+
+```
+void SbWindowFocusOnScreenKeyboard(SbWindow window, int ticket)
+```
+
+### SbWindowGetDiagonalSizeInInches ###
+
+Gets the size of the diagonal between two opposing screen corners.
+
+A return value of 0 means that starboard does not know what the screen diagonal
+is.
+
+#### Declaration ####
+
+```
+float SbWindowGetDiagonalSizeInInches(SbWindow window)
+```
+
+### SbWindowGetOnScreenKeyboardBoundingRect ###
+
+Get the rectangle of the on screen keyboard in screen pixel coordinates. Return
+`true` if successful. Return `false` if the on screen keyboard is not showing.
+If the function returns `false`, then `rect` will not have been modified.
+
+#### Declaration ####
+
+```
+bool SbWindowGetOnScreenKeyboardBoundingRect(SbWindow window, SbWindowRect *bounding_rect)
+```
+
+### SbWindowGetPlatformHandle ###
+
+Gets the platform-specific handle for `window`, which can be passed as an
+EGLNativeWindowType to initialize EGL/GLES. This return value is entirely
+platform-specific, so there are no constraints about expected ranges.
+
+`window`: The SbWindow to retrieve the platform handle for.
+
+#### Declaration ####
+
+```
+void* SbWindowGetPlatformHandle(SbWindow window)
+```
+
+### SbWindowGetSize ###
+
+Retrieves the dimensions of `window` and sets `size` accordingly. This function
+returns `true` if it completes successfully. If the function returns `false`,
+then `size` will not have been modified.
+
+`window`: The SbWindow to retrieve the size of. `size`: The retrieved size.
+
+#### Declaration ####
+
+```
+bool SbWindowGetSize(SbWindow window, SbWindowSize *size)
+```
+
+### SbWindowHideOnScreenKeyboard ###
+
+Hide the on screen keyboard. Fire kSbEventTypeWindowSizeChange and
+kSbEventTypeOnScreenKeyboardHidden if necessary.
+kSbEventTypeOnScreenKeyboardHidden has data `ticket`. Calling
+SbWindowHideOnScreenKeyboard() when the keyboard is already hidden is permitted.
+
+#### Declaration ####
+
+```
+void SbWindowHideOnScreenKeyboard(SbWindow window, int ticket)
+```
+
+### SbWindowIsOnScreenKeyboardShown ###
+
+Determine if the on screen keyboard is shown.
+
+#### Declaration ####
+
+```
+bool SbWindowIsOnScreenKeyboardShown(SbWindow window)
+```
+
+### SbWindowIsValid ###
+
+Returns whether the given window handle is valid.
+
+#### Declaration ####
+
+```
+static bool SbWindowIsValid(SbWindow window)
+```
+
+### SbWindowOnScreenKeyboardSuggestionsSupported ###
+
+Determine if the on screen keyboard has suggestions implemented. If this returns
+false, then calling SbWindowUpdateOnScreenKeyboardSuggestions() will be
+undefined.
+
+#### Declaration ####
+
+```
+bool SbWindowOnScreenKeyboardSuggestionsSupported(SbWindow window)
+```
+
+### SbWindowSetDefaultOptions ###
+
+Sets the default options for system windows.
+
+`options`: The option values to use as default values. This object must not be
+`NULL`.
+
+#### Declaration ####
+
+```
+void SbWindowSetDefaultOptions(SbWindowOptions *options)
+```
+
+### SbWindowSetOnScreenKeyboardKeepFocus ###
+
+Notify the system that `keepFocus` has been set for the OnScreenKeyboard.
+`keepFocus` true indicates that the user may not navigate focus off of the
+OnScreenKeyboard via input; focus may only be moved via events sent by the app.
+`keepFocus` false indicates that the user may navigate focus off of the
+OnScreenKeyboard via input. `keepFocus` is initialized to false in the
+OnScreenKeyboard constructor.
+
+#### Declaration ####
+
+```
+void SbWindowSetOnScreenKeyboardKeepFocus(SbWindow window, bool keep_focus)
+```
+
+### SbWindowShowOnScreenKeyboard ###
+
+Show the on screen keyboard and populate the input with text `input_text`. Fire
+kSbEventTypeWindowSizeChange and kSbEventTypeOnScreenKeyboardShown if necessary.
+kSbEventTypeOnScreenKeyboardShown has data `ticket`. The passed in `input_text`
+will never be NULL, but may be an empty string. Calling
+SbWindowShowOnScreenKeyboard() when the keyboard is already shown is permitted,
+and the input will be replaced with `input_text`. Showing the on screen keyboard
+does not give it focus.
+
+#### Declaration ####
+
+```
+void SbWindowShowOnScreenKeyboard(SbWindow window, const char *input_text, int ticket)
+```
+
+### SbWindowUpdateOnScreenKeyboardSuggestions ###
+
+Update the on screen keyboard custom suggestions. Fire
+kSbEventTypeOnScreenKeyboardSuggestionsUpdated.
+kSbEventTypeOnScreenKeyboardSuggestionsUpdated has data `ticket`. The
+suggestions should remain up-to-date when the keyboard is shown after being
+hidden.
+
+#### Declaration ####
+
+```
+void SbWindowUpdateOnScreenKeyboardSuggestions(SbWindow window, const char *suggestions[], int num_suggestions, int ticket)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/accessibility.md b/src/cobalt/site/docs/reference/starboard/modules/12/accessibility.md
similarity index 100%
copy from src/cobalt/site/docs/reference/starboard/modules/4/accessibility.md
copy to src/cobalt/site/docs/reference/starboard/modules/12/accessibility.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/atomic.md b/src/cobalt/site/docs/reference/starboard/modules/12/atomic.md
new file mode 100644
index 0000000..5f79990
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/atomic.md
@@ -0,0 +1,111 @@
+---
+layout: doc
+title: "Starboard Module Reference: atomic.h"
+---
+
+Defines a set of atomic integer operations that can be used as lightweight
+synchronization or as building blocks for heavier synchronization primitives.
+Their use is very subtle and requires detailed understanding of the behavior of
+supported architectures, so their direct use is not recommended except when
+rigorously deemed absolutely necessary for performance reasons.
+
+## Typedefs ##
+
+### SbAtomic64 ###
+
+64-bit atomic operations (only available on 64-bit processors).
+
+#### Definition ####
+
+```
+typedef int64_t SbAtomic64
+```
+
+### SbAtomicPtr ###
+
+Pointer-sized atomic operations. Forwards to either 32-bit or 64-bit functions
+as appropriate.
+
+#### Definition ####
+
+```
+typedef SbAtomic32 SbAtomicPtr
+```
+
+## Functions ##
+
+### SbAtomicAcquire_CompareAndSwap ###
+
+These following lower-level operations are typically useful only to people
+implementing higher-level synchronization operations like spinlocks, mutexes,
+and condition-variables. They combine CompareAndSwap(), a load, or a store with
+appropriate memory-ordering instructions. "Acquire" operations ensure that no
+later memory access can be reordered ahead of the operation. "Release"
+operations ensure that no previous memory access can be reordered after the
+operation. "Barrier" operations have both "Acquire" and "Release" semantics. A
+SbAtomicMemoryBarrier() has "Barrier" semantics, but does no memory access.
+
+#### Declaration ####
+
+```
+static SbAtomic32 SbAtomicAcquire_CompareAndSwap(volatile SbAtomic32 *ptr, SbAtomic32 old_value, SbAtomic32 new_value)
+```
+
+### SbAtomicBarrier_Increment ###
+
+Same as SbAtomicNoBarrier_Increment, but with a memory barrier.
+
+#### Declaration ####
+
+```
+static SbAtomic32 SbAtomicBarrier_Increment(volatile SbAtomic32 *ptr, SbAtomic32 increment)
+```
+
+### SbAtomicNoBarrier_CompareAndSwap ###
+
+Atomically execute: result = *ptr; if (*ptr == old_value) *ptr = new_value;
+return result;
+
+I.e., replace "*ptr" with "new_value" if "*ptr" used to be "old_value". Always
+return the old value of "*ptr"
+
+This routine implies no memory barriers.
+
+#### Declaration ####
+
+```
+static SbAtomic32 SbAtomicNoBarrier_CompareAndSwap(volatile SbAtomic32 *ptr, SbAtomic32 old_value, SbAtomic32 new_value)
+```
+
+### SbAtomicNoBarrier_Exchange ###
+
+Atomically store new_value into *ptr, returning the previous value held in *ptr.
+This routine implies no memory barriers.
+
+#### Declaration ####
+
+```
+static SbAtomic32 SbAtomicNoBarrier_Exchange(volatile SbAtomic32 *ptr, SbAtomic32 new_value)
+```
+
+### SbAtomicNoBarrier_Increment ###
+
+Atomically increment *ptr by "increment". Returns the new value of *ptr with the
+increment applied. This routine implies no memory barriers.
+
+#### Declaration ####
+
+```
+static SbAtomic32 SbAtomicNoBarrier_Increment(volatile SbAtomic32 *ptr, SbAtomic32 increment)
+```
+
+### SbAtomicRelease_CompareAndSwap8 ###
+
+Overloaded functions for Atomic8.
+
+#### Declaration ####
+
+```
+static SbAtomic8 SbAtomicRelease_CompareAndSwap8(volatile SbAtomic8 *ptr, SbAtomic8 old_value, SbAtomic8 new_value)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/audio_sink.md b/src/cobalt/site/docs/reference/starboard/modules/12/audio_sink.md
new file mode 100644
index 0000000..8cf2329
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/audio_sink.md
@@ -0,0 +1,168 @@
+---
+layout: doc
+title: "Starboard Module Reference: audio_sink.h"
+---
+
+Provides an interface to output raw audio data.
+
+## Macros ##
+
+### kSbAudioSinkInvalid ###
+
+Well-defined value for an invalid audio sink.
+
+## Typedefs ##
+
+### SbAudioSink ###
+
+An opaque handle to an implementation-private structure representing an audio
+sink.
+
+#### Definition ####
+
+```
+typedef struct SbAudioSinkPrivate* SbAudioSink
+```
+
+### SbAudioSinkConsumeFramesFunc ###
+
+Callback used to report frames consumed. The consumed frames will be removed
+from the source frame buffer to free space for new audio frames.
+
+#### Definition ####
+
+```
+typedef void(* SbAudioSinkConsumeFramesFunc) (int frames_consumed, void *context)
+```
+
+### SbAudioSinkFrameBuffers ###
+
+An array of frame buffers. For interleaved audio streams, there will be only one
+element in the array. For planar audio streams, the number of elements in the
+array equal to the number of channels.
+
+#### Definition ####
+
+```
+typedef void** SbAudioSinkFrameBuffers
+```
+
+### SbAudioSinkUpdateSourceStatusFunc ###
+
+Callback being called periodically to retrieve the status of the audio source.
+The first two output parameters indicating the filling level of the audio frame
+buffer passed to SbAudioSinkCreate as `frame_buffers`. As `frame_buffers` is a
+circular buffer, `offset_in_frames` can be used to calculate the number of
+continuous frames towards the end of the buffer. The audio sink can play the
+frames only when `is_playing` is true. It should pause the playback when
+`is_playing` is false. The audio sink may cache certain amount of audio frames
+before start playback. It will start playback immediately when `is_eos_reached`
+is true even if the amount of cached audio frames are not enough as no more
+frames will be appended into the buffer when `is_eos_reached` is true. It is
+possible for a host to set `is_eos_reached` to false after setting it to true,
+usually this is caused by a seek. All parameters except `context` cannot be
+NULL. Note that this function only reports the status of the source, it doesn't
+remove audio data from the source frame buffer.
+
+#### Definition ####
+
+```
+typedef void(* SbAudioSinkUpdateSourceStatusFunc) (int *frames_in_buffer, int *offset_in_frames, bool *is_playing, bool *is_eos_reached, void *context)
+```
+
+## Functions ##
+
+### SbAudioSinkDestroy ###
+
+Destroys `audio_sink`, freeing all associated resources. Before returning, the
+function waits until all callbacks that are in progress have finished. After the
+function returns, no further calls are made callbacks passed into
+SbAudioSinkCreate. In addition, you can not pass `audio_sink` to any other
+SbAudioSink functions after SbAudioSinkDestroy has been called on it.
+
+This function can be called on any thread. However, it cannot be called within
+any of the callbacks passed into SbAudioSinkCreate.
+
+`audio_sink`: The audio sink to destroy.
+
+#### Declaration ####
+
+```
+void SbAudioSinkDestroy(SbAudioSink audio_sink)
+```
+
+### SbAudioSinkGetMaxChannels ###
+
+Returns the maximum number of channels supported on the platform. For example,
+the number would be `2` if the platform only supports stereo.
+
+#### Declaration ####
+
+```
+int SbAudioSinkGetMaxChannels()
+```
+
+### SbAudioSinkGetMinBufferSizeInFrames ###
+
+Returns the minimum frames required by audio sink to play without underflows.
+Returns -1, if `channels`, `sample_type` or `sampling_frequency_hz` is not
+supported. It's user's responsibility to ensure that there're enough frames
+written into audio sink during playing, or it may have underflows.
+
+`channels`: The number of audio channels, such as left and right channels in
+stereo audio. `audio_sample_type`: The type of each sample of the audio data –
+`int16`, `float32`, etc. `sampling_frequency_hz`: The sample frequency of the
+audio data being streamed. For example, 22,000 Hz means 22,000 sample elements
+represents one second of audio data.
+
+#### Declaration ####
+
+```
+int SbAudioSinkGetMinBufferSizeInFrames(int channels, SbMediaAudioSampleType sample_type, int sampling_frequency_hz)
+```
+
+### SbAudioSinkGetNearestSupportedSampleFrequency ###
+
+Returns the supported sample rate closest to `sampling_frequency_hz`. On
+platforms that don't support all sample rates, it is the caller's responsibility
+to resample the audio frames into the supported sample rate returned by this
+function.
+
+#### Declaration ####
+
+```
+int SbAudioSinkGetNearestSupportedSampleFrequency(int sampling_frequency_hz)
+```
+
+### SbAudioSinkIsAudioFrameStorageTypeSupported ###
+
+Indicates whether `audio_frame_storage_type` is supported on this platform.
+
+#### Declaration ####
+
+```
+bool SbAudioSinkIsAudioFrameStorageTypeSupported(SbMediaAudioFrameStorageType audio_frame_storage_type)
+```
+
+### SbAudioSinkIsAudioSampleTypeSupported ###
+
+Indicates whether `audio_sample_type` is supported on this platform.
+
+#### Declaration ####
+
+```
+bool SbAudioSinkIsAudioSampleTypeSupported(SbMediaAudioSampleType audio_sample_type)
+```
+
+### SbAudioSinkIsValid ###
+
+Indicates whether the given audio sink handle is valid.
+
+`audio_sink`: The audio sink handle to check.
+
+#### Declaration ####
+
+```
+bool SbAudioSinkIsValid(SbAudioSink audio_sink)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/byte_swap.md b/src/cobalt/site/docs/reference/starboard/modules/12/byte_swap.md
similarity index 100%
copy from src/cobalt/site/docs/reference/starboard/modules/4/byte_swap.md
copy to src/cobalt/site/docs/reference/starboard/modules/12/byte_swap.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/character.md b/src/cobalt/site/docs/reference/starboard/modules/12/character.md
similarity index 100%
copy from src/cobalt/site/docs/reference/starboard/modules/4/character.md
copy to src/cobalt/site/docs/reference/starboard/modules/12/character.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/condition_variable.md b/src/cobalt/site/docs/reference/starboard/modules/12/condition_variable.md
new file mode 100644
index 0000000..836c4b8
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/condition_variable.md
@@ -0,0 +1,141 @@
+---
+layout: doc
+title: "Starboard Module Reference: condition_variable.h"
+---
+
+Defines an interface for condition variables.
+
+## Macros ##
+
+### SB_CONDITION_VARIABLE_MAX_SIZE ###
+
+Max size of the SbConditionVariable type.
+
+## Enums ##
+
+### SbConditionVariableResult ###
+
+Enumeration of possible results from waiting on a condvar.
+
+#### Values ####
+
+*   `kSbConditionVariableSignaled`
+
+    The wait completed because the condition variable was signaled.
+*   `kSbConditionVariableTimedOut`
+
+    The wait completed because it timed out, and was not signaled.
+*   `kSbConditionVariableFailed`
+
+    The wait failed, either because a parameter wasn't valid, or the condition
+    variable has already been destroyed, or something similar.
+
+## Typedefs ##
+
+### SbConditionVariable ###
+
+An opaque handle to a condition variable type with reserved memory buffer of
+size SB_CONDITION_VARIABLE_MAX_SIZE and aligned at void pointer type.
+
+#### Definition ####
+
+```
+typedef union SbConditionVariable  SbConditionVariable
+```
+
+## Functions ##
+
+### SbConditionVariableBroadcast ###
+
+Broadcasts to all current waiters of `condition` to stop waiting. This function
+wakes all of the threads waiting on `condition` while SbConditionVariableSignal
+wakes a single thread.
+
+`condition`: The condition that should no longer be waited for.
+
+#### Declaration ####
+
+```
+bool SbConditionVariableBroadcast(SbConditionVariable *condition)
+```
+
+### SbConditionVariableCreate ###
+
+Creates a new condition variable to work with `opt_mutex`, which may be null,
+placing the newly created condition variable in `out_condition`.
+
+The return value indicates whether the condition variable could be created.
+
+#### Declaration ####
+
+```
+bool SbConditionVariableCreate(SbConditionVariable *out_condition, SbMutex *opt_mutex)
+```
+
+### SbConditionVariableDestroy ###
+
+Destroys the specified SbConditionVariable . The return value indicates whether
+the destruction was successful. The behavior is undefined if other threads are
+currently waiting on this condition variable.
+
+`condition`: The SbConditionVariable to be destroyed. This invalidates the
+condition variable.
+
+#### Declaration ####
+
+```
+bool SbConditionVariableDestroy(SbConditionVariable *condition)
+```
+
+### SbConditionVariableIsSignaled ###
+
+Returns whether the given result is a success.
+
+#### Declaration ####
+
+```
+static bool SbConditionVariableIsSignaled(SbConditionVariableResult result)
+```
+
+### SbConditionVariableSignal ###
+
+Signals the next waiter of `condition` to stop waiting. This function wakes a
+single thread waiting on `condition` while SbConditionVariableBroadcast wakes
+all threads waiting on it.
+
+`condition`: The condition that the waiter should stop waiting for.
+
+#### Declaration ####
+
+```
+bool SbConditionVariableSignal(SbConditionVariable *condition)
+```
+
+### SbConditionVariableWait ###
+
+Waits for `condition`, releasing the held lock `mutex`, blocking indefinitely,
+and returning the result. Behavior is undefined if `mutex` is not held.
+
+#### Declaration ####
+
+```
+SbConditionVariableResult SbConditionVariableWait(SbConditionVariable *condition, SbMutex *mutex)
+```
+
+### SbConditionVariableWaitTimed ###
+
+Waits for `condition`, releasing the held lock `mutex`, blocking up to
+`timeout_duration`, and returning the acquisition result. Behavior is undefined
+if `mutex` is not held.
+
+`timeout_duration`: The maximum amount of time that function should wait for
+`condition`. If the `timeout_duration` value is less than or equal to zero, the
+function returns as quickly as possible with a kSbConditionVariableTimedOut
+result.
+
+#### Declaration ####
+
+```
+SbConditionVariableResult SbConditionVariableWaitTimed(SbConditionVariable *condition, SbMutex *mutex, SbTime timeout_duration)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/configuration.md b/src/cobalt/site/docs/reference/starboard/modules/12/configuration.md
new file mode 100644
index 0000000..14ccc3e
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/configuration.md
@@ -0,0 +1,192 @@
+---
+layout: doc
+title: "Starboard Module Reference: configuration.h"
+---
+
+Provides a description of the current platform in lurid detail so that common
+code never needs to actually know what the current operating system and
+architecture are.
+
+It is both very pragmatic and canonical in that if any application code finds
+itself needing to make a platform decision, it should always define a Starboard
+Configuration feature instead. This implies the continued existence of very
+narrowly-defined configuration features, but it retains porting control in
+Starboard.
+
+## Macros ##
+
+### SB_ALIGNAS(byte_alignment) ###
+
+Specifies the alignment for a class, struct, union, enum, class/struct field, or
+stack variable.
+
+### SB_ALIGNOF(type) ###
+
+Returns the alignment reqiured for any instance of the type indicated by `type`.
+
+### SB_ARRAY_SIZE(array) ###
+
+A constant expression that evaluates to the size_t size of a statically-sized
+array.
+
+### SB_ARRAY_SIZE_INT(array) ###
+
+A constant expression that evaluates to the int size of a statically-sized
+array.
+
+### SB_CAN(SB_FEATURE) ###
+
+Determines a compile-time capability of the system.
+
+### SB_COMPILE_ASSERT(expr, msg) ###
+
+Will cause a compiler error with `msg` if `expr` is false. `msg` must be a valid
+identifier, and must be a unique type in the scope of the declaration.
+
+### SB_DEPRECATED(FUNC) ###
+
+SB_DEPRECATED(int Foo(int bar)); Annotates the function as deprecated, which
+will trigger a compiler warning when referenced.
+
+### SB_DEPRECATED_EXTERNAL(FUNC) ###
+
+SB_DEPRECATED_EXTERNAL(...) annotates the function as deprecated for external
+clients, but not deprecated for starboard.
+
+### SB_DISALLOW_COPY_AND_ASSIGN(TypeName) ###
+
+A macro to disallow the copy constructor and operator= functions This should be
+used in the private: declarations for a class
+
+### SB_EXPERIMENTAL_API_VERSION ###
+
+The API version that is currently open for changes, and therefore is not stable
+or frozen. Production-oriented ports should avoid declaring that they implement
+the experimental Starboard API version.
+
+### SB_FUNCTION ###
+
+Whether we use **PRETTY_FUNCTION** PRETTY_FUNCTION or **FUNCTION** FUNCTION for
+logging.
+
+### SB_HAS(SB_FEATURE) ###
+
+Determines at compile-time whether this platform has a standard feature or
+header available.
+
+### SB_HAS_64_BIT_ATOMICS ###
+
+Whether the current platform has 64-bit atomic operations.
+
+### SB_HAS_AUDIO_SPECIFIC_CONFIG_AS_POINTER ###
+
+Deprecated feature macros These feature macros are deprecated in Starboard
+version 6 and later, and are no longer referenced by application code. They will
+be removed in a future version. Any Starboard implementation that supports
+Starboard version 6 or later should be modified to no longer depend on these
+macros, with the assumption that their values are always 1.
+
+### SB_HAS_GLES2 ###
+
+Specifies whether this platform has a performant OpenGL ES 2 implementation,
+which allows client applications to use GL rendering paths. Derived from the gyp
+variable `gl_type` gl_type which indicates what kind of GL implementation is
+available.
+
+### SB_HAS_GRAPHICS ###
+
+Specifies whether this platform has any kind of supported graphics system.
+
+### SB_HAS_QUIRK(SB_FEATURE) ###
+
+Determines at compile-time whether this platform has a quirk.
+
+### SB_INT64_C(x) ###
+
+Declare numeric literals of signed 64-bit type.
+
+### SB_IS(SB_FEATURE) ###
+
+Determines at compile-time an inherent aspect of this platform.
+
+### SB_LIKELY(x) ###
+
+Macro for hinting that an expression is likely to be true.
+
+### SB_MAXIMUM_API_VERSION ###
+
+The maximum API version allowed by this version of the Starboard headers,
+inclusive.
+
+### SB_MINIMUM_API_VERSION ###
+
+The minimum API version allowed by this version of the Starboard headers,
+inclusive.
+
+### SB_NORETURN ###
+
+Macro to annotate a function as noreturn, which signals to the compiler that the
+function cannot return.
+
+### SB_OVERRIDE ###
+
+Declares a function as overriding a virtual function on compilers that support
+it.
+
+### SB_PREFERRED_RGBA_BYTE_ORDER_RGBA ###
+
+An enumeration of values for the kSbPreferredByteOrder configuration variable.
+Setting this up properly means avoiding slow color swizzles when passing pixel
+data from one library to another. Note that these definitions are in byte-order
+and so are endianness-independent.
+
+### SB_PRINTF_FORMAT(format_param, dots_param) ###
+
+Tells the compiler a function is using a printf-style format string.
+`format_param` is the one-based index of the format string parameter;
+`dots_param` is the one-based index of the "..." parameter. For v*printf
+functions (which take a va_list), pass 0 for dots_param. (This is undocumented
+but matches what the system C headers do.) (Partially taken from
+base/compiler_specific.h)
+
+### SB_RELEASE_CANDIDATE_API_VERSION ###
+
+The next API version to be frozen, but is still subject to emergency changes. It
+is reasonable to base a port on the Release Candidate API version, but be aware
+that small incompatible changes may still be made to it. The following will be
+uncommented when an API version is a release candidate.
+
+### SB_RESTRICT ###
+
+Include the platform-specific configuration. This macro is set by GYP in
+starboard_base_target.gypi and passed in on the command line for all targets and
+all configurations. Makes a pointer-typed parameter restricted so that the
+compiler can make certain optimizations because it knows the pointers are
+unique.
+
+### SB_SIZE_OF(DATATYPE) ###
+
+Determines at compile-time the size of a data type, or 0 if the data type that
+was specified was invalid.
+
+### SB_STRINGIFY(x) ###
+
+Standard CPP trick to stringify an evaluated macro definition.
+
+### SB_UINT64_C(x) ###
+
+Declare numeric literals of unsigned 64-bit type.
+
+### SB_UNLIKELY(x) ###
+
+Macro for hinting that an expression is likely to be false.
+
+### SB_UNREFERENCED_PARAMETER(x) ###
+
+Trivially references a parameter that is otherwise unreferenced, preventing a
+compiler warning on some platforms.
+
+### SB_WARN_UNUSED_RESULT ###
+
+Causes the annotated (at the end) function to generate a warning if the result
+is not accessed.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/configuration_constants.md b/src/cobalt/site/docs/reference/starboard/modules/12/configuration_constants.md
new file mode 100644
index 0000000..5c59a7c
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/configuration_constants.md
@@ -0,0 +1,161 @@
+---
+layout: doc
+title: "Starboard Module Reference: configuration_constants.h"
+---
+
+Declares all configuration variables we will need to use at runtime. These
+variables describe the current platform in detail to allow cobalt to make
+runtime decisions based on per platform configurations.
+
+## Variables ##
+
+### kSbDefaultMmapThreshold ###
+
+Determines the threshhold of allocation size that should be done with mmap (if
+available), rather than allocated within the core heap.
+
+### kSbFileAltSepChar ###
+
+The current platform's alternate file path component separator character. This
+is like SB_FILE_SEP_CHAR, except if your platform supports an alternate
+character, then you can place that here. For example, on windows machines, the
+primary separator character is probably '\', but the alternate is '/'.
+
+### kSbFileAltSepString ###
+
+The string form of SB_FILE_ALT_SEP_CHAR.
+
+### kSbFileMaxName ###
+
+The current platform's maximum length of the name of a single directory entry,
+not including the absolute path.
+
+### kSbFileMaxOpen ###
+
+The current platform's maximum number of files that can be opened at the same
+time by one process.
+
+### kSbFileMaxPath ###
+
+The current platform's maximum length of an absolute path.
+
+### kSbFileSepChar ###
+
+The current platform's file path component separator character. This is the
+character that appears after a directory in a file path. For example, the
+absolute canonical path of the file "/path/to/a/file.txt" uses '/' as a path
+component separator character.
+
+### kSbFileSepString ###
+
+The string form of SB_FILE_SEP_CHAR.
+
+### kSbHasAc3Audio ###
+
+Allow ac3 and ec3 support
+
+### kSbHasMediaWebmVp9Support ###
+
+Specifies whether this platform has webm/vp9 support. This should be set to non-
+zero on platforms with webm/vp9 support.
+
+### kSbHasThreadPrioritySupport ###
+
+Whether the current platform supports thread priorities.
+
+### kSbMallocAlignment ###
+
+Determines the alignment that allocations should have on this platform.
+
+### kSbMaxThreadLocalKeys ###
+
+The maximum number of thread local storage keys supported by this platform. This
+comes from _POSIX_THREAD_KEYS_MAX. The value of PTHREAD_KEYS_MAX is higher, but
+unit tests show that the implementation doesn't support nearly as many keys.
+
+### kSbMaxThreadNameLength ###
+
+The maximum length of the name for a thread, including the NULL-terminator.
+
+### kSbMaxThreads ###
+
+Defines the maximum number of simultaneous threads for this platform. Some
+platforms require sharing thread handles with other kinds of system handles,
+like mutexes, so we want to keep this manageable.
+
+### kSbMediaMaxAudioBitrateInBitsPerSecond ###
+
+The maximum audio bitrate the platform can decode. The following value equals to
+5M bytes per seconds which is more than enough for compressed audio.
+
+### kSbMediaMaxVideoBitrateInBitsPerSecond ###
+
+The maximum video bitrate the platform can decode. The following value equals to
+8M bytes per seconds which is more than enough for compressed video.
+
+### kSbMediaMaximumVideoFrames ###
+
+Specify the number of video frames to be cached during playback. A large value
+leads to more stable fps but also causes the app to use more memory.
+
+### kSbMediaMaximumVideoPrerollFrames ###
+
+The encoded video frames are compressed in different ways, so their decoding
+time can vary a lot. Occasionally a single frame can take longer time to decode
+than the average time per frame. The player has to cache some frames to account
+for such inconsistency. The number of frames being cached are controlled by
+SB_MEDIA_MAXIMUM_VIDEO_PREROLL_FRAMES and SB_MEDIA_MAXIMUM_VIDEO_FRAMES.
+
+Specify the number of video frames to be cached before the playback starts. Note
+that setting this value too large may increase the playback start delay.
+
+### kSbMediaVideoFrameAlignment ###
+
+Specifies how video frame buffers must be aligned on this platform.
+
+### kSbMemoryLogPath ###
+
+Defines the path where memory debugging logs should be written to.
+
+### kSbMemoryPageSize ###
+
+The memory page size, which controls the size of chunks on memory that
+allocators deal with, and the alignment of those chunks. This doesn't have to be
+the hardware-defined physical page size, but it should be a multiple of it.
+
+### kSbNetworkReceiveBufferSize ###
+
+Specifies the network receive buffer size in bytes, set via
+SbSocketSetReceiveBufferSize().
+
+Setting this to 0 indicates that SbSocketSetReceiveBufferSize() should not be
+called. Use this for OSs (such as Linux) where receive buffer auto-tuning is
+better.
+
+On some platforms, this may affect max TCP window size which may dramatically
+affect throughput in the presence of latency.
+
+If your platform does not have a good TCP auto-tuning mechanism, a setting of
+(128 * 1024) here is recommended.
+
+### kSbPathSepChar ###
+
+The current platform's search path component separator character. When
+specifying an ordered list of absolute paths of directories to search for a
+given reason, this is the character that appears between entries. For example,
+the search path of "/etc/search/first:/etc/search/second" uses ':' as a search
+path component separator character.
+
+### kSbPathSepString ###
+
+The string form of SB_PATH_SEP_CHAR.
+
+### kSbPreferredRgbaByteOrder ###
+
+Specifies the preferred byte order of color channels in a pixel. Refer to
+starboard/configuration.h for the possible values. EGL/GLES platforms should
+generally prefer a byte order of RGBA, regardless of endianness.
+
+### kSbUserMaxSignedIn ###
+
+The maximum number of users that can be signed in at the same time.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/cpu_features.md b/src/cobalt/site/docs/reference/starboard/modules/12/cpu_features.md
new file mode 100644
index 0000000..9cdb94c
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/cpu_features.md
@@ -0,0 +1,259 @@
+---
+layout: doc
+title: "Starboard Module Reference: cpu_features.h"
+---
+
+## Structs ##
+
+### SbCPUFeatures ###
+
+#### Members ####
+
+*   `SbCPUFeaturesArchitecture architecture`
+
+    Architecture of the processor.
+*   `const char * brand`
+
+    Processor brand string retrievable by CPUID or from /proc/cpuinfo under the
+    key "model name" or "Processor".
+*   `int32_t icache_line_size`
+
+    Processor cache line size in bytes of Level 1 instruction cache and data
+    cache. Queried by sysconf(_SC_LEVEL1_ICACHE_LINESIZE) and
+    sysconf(_SC_LEVEL1_DCACHE_LINESIZE), or from files /proc/cpuinfo,
+    /proc/self/auxv, or CPUID with CLFLUSH instruction.
+*   `int32_t dcache_line_size`
+*   `bool has_fpu`
+
+    Processor has floating-point unit on-chip.
+*   `uint32_t hwcap`
+
+    Bit-mask containing processor features flags. Queried by getauxval(AT_HWCAP)
+    if it is supported.
+*   `uint32_t hwcap2`
+
+    Similar to hwcap. Queried by getauxval(AT_HWCAP2) if it is supported.
+*   `SbCPUFeaturesARM arm`
+
+    Processor features specific to each architecture. Set the appropriate
+    `SbCPUFeatures<ARCH_NAME>` for the underlying architecture. Set the other
+    `SbCPUFeatures<OTHER_ARCH>` to be invalid, meaning:
+
+    *   '-1' for signed integer fields
+
+    *   'false' for feature flag fields
+
+    *   '0' for feature flag bitmasks
+
+    *   empty string for string fields
+
+*   `SbCPUFeaturesMIPS mips_arch`
+
+    The reason that the "_arch" suffix exists for mips is because on some
+    platforms that use MIPS as the underlying architecture, "mips" is already
+    defined as a macro.
+*   `SbCPUFeaturesX86 x86`
+
+### SbCPUFeaturesARM ###
+
+#### Members ####
+
+*   `int16_t implementer`
+
+    Processor implementer/implementor code. ARM is 0x41, NVIDIA is 0x4e, etc.
+*   `int16_t variant`
+
+    Processor variant number, indicating the major revision number.
+*   `int16_t revision`
+
+    Processor revision number, indicating the minor revision number.
+*   `int16_t architecture_generation`
+
+    Processor architecture generation number, indicating the generations
+    (ARMv6-M, ARMv7, etc) within an architecture family. This field is called
+    "Architecture" or "Constant" in the processor ID register.
+*   `int16_t part`
+
+    Processor part number, indicating Cortex-M0, Cortex-A8, etc.
+*   `bool has_neon`
+
+    ARM Advanced SIMD (NEON) vector instruction set extension.
+*   `bool has_thumb2`
+
+    Thumb-2 mode.
+*   `bool has_vfp`
+
+    VFP (SIMD vector floating point instructions).
+*   `bool has_vfp3`
+
+    VFP version 3
+*   `bool has_vfp3_d32`
+
+    VFP version 3 with 32 D-registers.
+*   `bool has_idiva`
+
+    SDIV and UDIV hardware division in ARM mode.
+*   `bool has_aes`
+
+    Arm 64 feature flags
+
+    AES instructions.
+*   `bool has_crc32`
+
+    CRC32 instructions.
+*   `bool has_sha1`
+
+    SHA-1 instructions.
+*   `bool has_sha2`
+
+    SHA-256 instructions.
+*   `bool has_pmull`
+
+    64-bit PMULL and PMULL2 instructions.
+
+### SbCPUFeaturesMIPS ###
+
+#### Members ####
+
+*   `bool has_msa`
+
+    MIPS SIMD Architecture (MSA).
+
+### SbCPUFeaturesX86 ###
+
+#### Members ####
+
+*   `const char * vendor`
+
+    Processor vendor ID string, e.g. "GenuineIntel", "AuthenticAMD", etc
+*   `int16_t family`
+
+    Processor family ID
+*   `int16_t ext_family`
+
+    Processor extended family ID, needs to be examined only when the family ID
+    is 0FH.
+*   `int16_t model`
+
+    Processor model ID
+*   `int16_t ext_model`
+
+    Processor extended model ID, needs to be examined only when the family ID is
+    06H or 0FH.
+*   `int16_t stepping`
+
+    Processor stepping ID, a product revision number
+*   `int16_t type`
+
+    Processor type ID
+*   `int32_t signature`
+
+    A raw form of collection of processor stepping, model, and family
+    information
+*   `bool has_cmov`
+
+    Conditional Move Instructions (plus FCMOVcc, FCOMI with FPU).
+*   `bool has_mmx`
+
+    Multimedia extensions.
+*   `bool has_sse`
+
+    SSE (Streaming SIMD Extensions).
+*   `bool has_sse2`
+
+    SSE2 extensions.
+*   `bool has_tsc`
+
+    Time Stamp Counter.
+*   `bool has_sse3`
+
+    SSE3 extensions.
+*   `bool has_pclmulqdq`
+
+    PCLMULQDQ instruction.
+*   `bool has_ssse3`
+
+    Supplemental SSE3 extensions.
+*   `bool has_sse41`
+
+    SSE-4.1 extensions.
+*   `bool has_sse42`
+
+    SSE-4.2 extensions.
+*   `bool has_movbe`
+
+    MOVBE instruction.
+*   `bool has_popcnt`
+
+    POPCNT instruction.
+*   `bool has_osxsave`
+
+    XSAVE/XRSTOR/XGETBV/XSETBV instruction enabled in this OS.
+*   `bool has_avx`
+
+    AVX (Advanced Vector Extensions).
+*   `bool has_f16c`
+
+    16-bit FP conversions.
+*   `bool has_fma3`
+
+    Fused multiply-add.
+*   `bool has_aesni`
+
+    AES new instructions (AES-NI).
+*   `bool has_avx2`
+
+    AVX2 Extensions.
+*   `bool has_avx512f`
+
+    AVX-512 Foundation.
+*   `bool has_avx512dq`
+
+    AVX-512 DQ (Double/Quad granular) Instructions.
+*   `bool has_avx512ifma`
+
+    AVX-512 Integer Fused Multiply-Add instructions.
+*   `bool has_avx512pf`
+
+    AVX-512 Prefetch.
+*   `bool has_avx512er`
+
+    AVX-512 Exponential and Reciprocal.
+*   `bool has_avx512cd`
+
+    AVX-512 Conflict Detection.
+*   `bool has_avx512bw`
+
+    AVX-512 BW (Byte/Word granular) Instructions.
+*   `bool has_avx512vl`
+
+    AVX-512 VL (128/256 Vector Length) Extensions.
+*   `bool has_bmi1`
+
+    First group of bit manipulation extensions.
+*   `bool has_bmi2`
+
+    Second group of bit manipulation extensions.
+*   `bool has_lzcnt`
+
+    Bit manipulation instruction LZCNT.
+*   `bool has_sahf`
+
+    SAHF in long mode.
+
+## Functions ##
+
+### SbCPUFeaturesGet ###
+
+Retrieve the underlying CPU features and place it in `features`, which must not
+be NULL.
+
+If this function returns false, it means the CPU architecture is unknown and all
+fields in `features` are invalid.
+
+#### Declaration ####
+
+```
+bool SbCPUFeaturesGet(SbCPUFeatures *features)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/decode_target.md b/src/cobalt/site/docs/reference/starboard/modules/12/decode_target.md
new file mode 100644
index 0000000..ae093b2
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/decode_target.md
@@ -0,0 +1,395 @@
+---
+layout: doc
+title: "Starboard Module Reference: decode_target.h"
+---
+
+A target for decoding image and video data into. This corresponds roughly to an
+EGLImage, but that extension may not be fully supported on all GL platforms.
+SbDecodeTarget supports multi-plane targets. The SbBlitter API is supported as
+well, and this is able to more-or-less unify the two.
+
+An SbDecodeTarget can be passed into any function which decodes video or image
+data. This allows the application to allocate fast graphics memory, and have
+decoding done directly into this memory, avoiding unnecessary memory copies, and
+also avoiding pushing data between CPU and GPU memory unnecessarily.
+SbDecodeTargetFormat
+
+SbDecodeTargets support several different formats that can be used to decode
+into and render from. Some formats may be easier to decode into, and others may
+be easier to render. Some may take less memory. Each decoder needs to support
+the SbDecodeTargetFormat passed into it, or the decode will produce an error.
+Each decoder provides a way to check if a given SbDecodeTargetFormat is
+supported by that decoder.
+SbDecodeTargetGraphicsContextProvider
+
+Some components may need to acquire SbDecodeTargets compatible with a certain
+rendering context, which may need to be created on a particular thread. The
+SbDecodeTargetGraphicsContextProvider are passed in to the Starboard
+implementation from the application and provide information about the rendering
+context that will be used to render the SbDecodeTarget objects. For GLES
+renderers, it also provides functionality to enable the Starboard implementation
+to run arbitrary code on the application's renderer thread with the renderer's
+EGLContext held current. This may be useful if your SbDecodeTarget creation code
+needs to execute GLES commands like, for example, glGenTextures().
+
+The primary usage is likely to be the the SbPlayer implementation on some
+platforms.
+SbDecodeTarget Example
+
+Let's say that we are an application and we would like to use the interface
+defined in starboard/image.h to decode an imaginary "image/foo" image type.
+
+First, the application should enumerate which SbDecodeTargetFormats are
+supported by that decoder.
+
+```
+SbDecodeTargetFormat kPreferredFormats[] = {
+    kSbDecodeTargetFormat3PlaneYUVI420,
+    kSbDecodeTargetFormat1PlaneRGBA,
+    kSbDecodeTargetFormat1PlaneBGRA,
+};
+
+SbDecodeTargetFormat format = kSbDecodeTargetFormatInvalid;
+for (int i = 0; i < SB_ARRAY_SIZE_INT(kPreferredFormats); ++i) {
+  if (SbImageIsDecodeSupported("image/foo", kPreferredFormats[i])) {
+    format = kPreferredFormats[i];
+    break;
+  }
+}
+
+```
+
+Now that the application has a format, it can create a decode target that it
+will use to decode the .foo file into. Let's assume format is
+kSbDecodeTargetFormat1PlaneRGBA, that we are on an EGL/GLES2 platform. Also, we
+won't do any error checking, to keep things even simpler.
+
+```
+SbDecodeTarget target = SbImageDecode(
+    context_provider, encoded_foo_data, encoded_foo_data_size,
+    "image/foo", format);
+
+// If the decode works, you can get the texture out and render it.
+SbDecodeTargetInfo info;
+SbMemorySet(&info, 0, sizeof(info));
+SbDecodeTargetGetInfo(target, &info);
+GLuint texture =
+    info.planes[kSbDecodeTargetPlaneRGBA].texture;
+
+```
+
+## Macros ##
+
+### kSbDecodeTargetInvalid ###
+
+Well-defined value for an invalid decode target handle.
+
+## Enums ##
+
+### SbDecodeTargetFormat ###
+
+The list of all possible decoder target formats. An SbDecodeTarget consists of
+one or more planes of data, each plane corresponding with a surface. For some
+formats, different planes will be different sizes for the same dimensions.
+
+NOTE: For enumeration entries with an alpha component, the alpha will always be
+premultiplied unless otherwise explicitly specified.
+
+#### Values ####
+
+*   `kSbDecodeTargetFormat1PlaneRGBA`
+
+    A decoder target format consisting of a single RGBA plane, in that channel
+    order.
+*   `kSbDecodeTargetFormat1PlaneBGRA`
+
+    A decoder target format consisting of a single BGRA plane, in that channel
+    order.
+*   `kSbDecodeTargetFormat2PlaneYUVNV12`
+
+    A decoder target format consisting of Y and interleaved UV planes, in that
+    plane and channel order.
+*   `kSbDecodeTargetFormat3PlaneYUVI420`
+
+    A decoder target format consisting of Y, U, and V planes, in that order.
+*   `kSbDecodeTargetFormat3Plane10BitYUVI420`
+
+    A decoder target format consisting of 10bit Y, U, and V planes, in that
+    order.
+*   `kSbDecodeTargetFormat1PlaneUYVY`
+
+    A decoder target format consisting of a single plane with pixels layed out
+    in the format UYVY. Since there are two Y values per sample, but only one U
+    value and only one V value, horizontally the Y resolution is twice the size
+    of both the U and V resolutions. Vertically, they Y, U and V all have the
+    same resolution. This is a YUV 422 format. When using this format with GL
+    platforms, it is expected that the underlying texture will be set to the
+    GL_RGBA format, and the width of the texture will be equal to the number of
+    UYVY tuples per row (e.g. the u/v width resolution). Content region
+    left/right should be specified in u/v width resolution.
+*   `kSbDecodeTargetFormatInvalid`
+
+    An invalid decode target format.
+
+### SbDecodeTargetPlane ###
+
+All the planes supported by SbDecodeTarget.
+
+#### Values ####
+
+*   `kSbDecodeTargetPlaneRGBA`
+
+    The RGBA plane for the RGBA format.
+*   `kSbDecodeTargetPlaneBGRA`
+
+    The BGRA plane for the BGRA format.
+*   `kSbDecodeTargetPlaneY`
+
+    The Y plane for multi-plane YUV formats.
+*   `kSbDecodeTargetPlaneUV`
+
+    The UV plane for 2-plane YUV formats.
+*   `kSbDecodeTargetPlaneU`
+
+    The U plane for 3-plane YUV formats.
+*   `kSbDecodeTargetPlaneV`
+
+    The V plane for 3-plane YUV formats.
+
+## Typedefs ##
+
+### SbDecodeTarget ###
+
+A handle to a target for image data decoding.
+
+#### Definition ####
+
+```
+typedef SbDecodeTargetPrivate* SbDecodeTarget
+```
+
+### SbDecodeTargetGlesContextRunner ###
+
+Signature for a function provided by the application to the Starboard
+implementation that will let the Starboard implementation run arbitrary code on
+the application's renderer thread with the application's EGLContext held
+current.
+
+#### Definition ####
+
+```
+typedef void(* SbDecodeTargetGlesContextRunner) (struct SbDecodeTargetGraphicsContextProvider *graphics_context_provider, SbDecodeTargetGlesContextRunnerTarget target_function, void *target_function_context)
+```
+
+### SbDecodeTargetGlesContextRunnerTarget ###
+
+Signature for a Starboard implementaion function that is to be run by a
+SbDecodeTargetGlesContextRunner callback.
+
+#### Definition ####
+
+```
+typedef void(* SbDecodeTargetGlesContextRunnerTarget) (void *gles_context_runner_target_context)
+```
+
+## Structs ##
+
+### SbDecodeTargetGraphicsContextProvider ###
+
+In general, the SbDecodeTargetGraphicsContextProvider structure provides
+information about the graphics context that will be used to render
+SbDecodeTargets. Some Starboard implementations may need to have references to
+some graphics objects when creating/destroying resources used by SbDecodeTarget.
+References to SbDecodeTargetGraphicsContextProvider objects should be provided
+to all Starboard functions that might create SbDecodeTargets (e.g.
+SbImageDecode()).
+
+#### Members ####
+
+*   `void * egl_display`
+
+    A reference to the EGLDisplay object that hosts the EGLContext that will be
+    used to render any produced SbDecodeTargets. Note that it has the type
+    `void*` in order to avoid #including the EGL header files here.
+*   `void * egl_context`
+
+    The EGLContext object that will be used to render any produced
+    SbDecodeTargets. Note that it has the type `void*` in order to avoid
+    #including the EGL header files here.
+*   `SbDecodeTargetGlesContextRunner gles_context_runner`
+
+    The `gles_context_runner` function pointer is passed in from the application
+    into the Starboard implementation, and can be invoked by the Starboard
+    implementation to allow running arbitrary code on the renderer's thread with
+    the EGLContext above held current.
+*   `void * gles_context_runner_context`
+
+    Context data that is to be passed in to `gles_context_runner` when it is
+    invoked.
+
+### SbDecodeTargetInfo ###
+
+Contains all information about a decode target, including all of its planes.
+This can be queried via calls to SbDecodeTargetGetInfo().
+
+#### Members ####
+
+*   `SbDecodeTargetFormat format`
+
+    The decode target format, which would dictate how many planes can be
+    expected in `planes`.
+*   `bool is_opaque`
+
+    Specifies whether the decode target is opaque. The underlying source of this
+    value is expected to be properly maintained by the Starboard implementation.
+    So, for example, if an opaque only image type were decoded into an
+    SbDecodeTarget, then the implementation would configure things in such a way
+    that this value is set to true. By opaque, it is meant that all alpha values
+    are guaranteed to be 255, if the decode target is of a format that has alpha
+    values. If the decode target is of a format that does not have alpha values,
+    then this value should be set to true. Applications may rely on this value
+    in order to implement certain optimizations such as occlusion culling.
+*   `int width`
+
+    The width of the image represented by this decode target.
+*   `int height`
+
+    The height of the image represented by this decode target.
+*   `SbDecodeTargetInfoPlane planes`
+
+    The image planes (e.g. kSbDecodeTargetPlaneRGBA, or {kSbDecodeTargetPlaneY,
+    kSbDecodeTargetPlaneU, kSbDecodeTargetPlaneV} associated with this decode
+    target.
+
+### SbDecodeTargetInfoContentRegion ###
+
+Defines a rectangular content region within a SbDecodeTargetInfoPlane structure.
+
+#### Members ####
+
+*   `float left`
+
+    If the texture (width, height) is set to (1, 1), then these values will be
+    interpreted as normalized coordinates, and depending on the platform (for
+    example GLES 2.0 provides no method of obtaining the texture width/height)
+    this may be more natural than specifying absolute pixel offsets.
+*   `float top`
+*   `float right`
+*   `float bottom`
+
+### SbDecodeTargetInfoPlane ###
+
+Defines an image plane within a SbDecodeTargetInfo object.
+
+#### Members ####
+
+*   `uint32_t texture`
+
+    A handle to the GL texture that can be used for rendering.
+*   `uint32_t gl_texture_target`
+
+    The GL texture target that should be used in calls to glBindTexture.
+    Typically this would be GL_TEXTURE_2D, but some platforms may require that
+    it be set to something else like GL_TEXTURE_EXTERNAL_OES.
+*   `uint32_t gl_texture_format`
+
+    For kSbDecodeTargetFormat2PlaneYUVNV12 planes: the format of the texture.
+    Usually, for the luma plane, this is either GL_ALPHA or GL_RED_EXT. For the
+    chroma plane, this is usually GL_LUMINANCE_ALPHA or GL_RG_EXT. Ignored for
+    other plane types.
+*   `int width`
+
+    The width of the texture/surface for this particular plane.
+*   `int height`
+
+    The height of the texture/surface for this particular plane.
+*   `SbDecodeTargetInfoContentRegion content_region`
+
+    The following properties specify a rectangle indicating a region within the
+    texture/surface that contains valid image data. The top-left corner is (0,
+    0) and increases to the right and to the bottom. The units specified by
+    these parameters are number of pixels. The range for left/right is [0,
+    width], and for top/bottom it is [0, height].
+
+## Functions ##
+
+### PrivateDecodeTargetReleaser ###
+
+This function is just an implementation detail of
+SbDecodeTargetReleaseInGlesContext() and should not be called directly.
+
+#### Declaration ####
+
+```
+static void PrivateDecodeTargetReleaser(void *context)
+```
+
+### SbDecodeTargetGetInfo ###
+
+Writes all information about `decode_target` into `out_info`. Returns false if
+the provided `out_info` structure is not zero initialized.
+
+#### Declaration ####
+
+```
+bool SbDecodeTargetGetInfo(SbDecodeTarget decode_target, SbDecodeTargetInfo *out_info)
+```
+
+### SbDecodeTargetIsFormatValid ###
+
+Returns whether a given format is valid.
+
+#### Declaration ####
+
+```
+static bool SbDecodeTargetIsFormatValid(SbDecodeTargetFormat format)
+```
+
+### SbDecodeTargetIsValid ###
+
+Returns whether the given file handle is valid.
+
+#### Declaration ####
+
+```
+static bool SbDecodeTargetIsValid(SbDecodeTarget handle)
+```
+
+### SbDecodeTargetRelease ###
+
+Returns ownership of `decode_target` to the Starboard implementation. This
+function will likely result in the destruction of the SbDecodeTarget and all its
+associated surfaces, though in some cases, platforms may simply adjust a
+reference count. In the case where SB_HAS(GLES2), this function must be called
+on a thread with the context
+
+#### Declaration ####
+
+```
+void SbDecodeTargetRelease(SbDecodeTarget decode_target)
+```
+
+### SbDecodeTargetReleaseInGlesContext ###
+
+Helper function that is possibly useful to Starboard implementations that will
+release a decode target on the thread with the GLES context current.
+
+#### Declaration ####
+
+```
+static void SbDecodeTargetReleaseInGlesContext(SbDecodeTargetGraphicsContextProvider *provider, SbDecodeTarget decode_target)
+```
+
+### SbDecodeTargetRunInGlesContext ###
+
+Inline convenience function to run an arbitrary
+SbDecodeTargetGlesContextRunnerTarget function through a
+SbDecodeTargetGraphicsContextProvider . This is intended to be called by
+Starboard implementations, if it is necessary.
+
+#### Declaration ####
+
+```
+static void SbDecodeTargetRunInGlesContext(SbDecodeTargetGraphicsContextProvider *provider, SbDecodeTargetGlesContextRunnerTarget target, void *target_context)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/directory.md b/src/cobalt/site/docs/reference/starboard/modules/12/directory.md
new file mode 100644
index 0000000..d46c9a1
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/directory.md
@@ -0,0 +1,118 @@
+---
+layout: doc
+title: "Starboard Module Reference: directory.h"
+---
+
+Provides directory listing functions.
+
+## Macros ##
+
+### kSbDirectoryInvalid ###
+
+Well-defined value for an invalid directory stream handle.
+
+## Typedefs ##
+
+### SbDirectory ###
+
+A handle to an open directory stream.
+
+#### Definition ####
+
+```
+typedef struct SbDirectoryPrivate* SbDirectory
+```
+
+## Functions ##
+
+### SbDirectoryCanOpen ###
+
+Indicates whether SbDirectoryOpen is allowed for the given `path`.
+
+`path`: The path to be checked.
+
+#### Declaration ####
+
+```
+bool SbDirectoryCanOpen(const char *path)
+```
+
+### SbDirectoryClose ###
+
+Closes an open directory stream handle. The return value indicates whether the
+directory was closed successfully.
+
+`directory`: The directory stream handle to close.
+
+#### Declaration ####
+
+```
+bool SbDirectoryClose(SbDirectory directory)
+```
+
+### SbDirectoryCreate ###
+
+Creates the directory `path`, assuming the parent directory already exists. This
+function returns `true` if the directory now exists (even if it existed before)
+and returns `false` if the directory does not exist.
+
+`path`: The path to be created.
+
+#### Declaration ####
+
+```
+bool SbDirectoryCreate(const char *path)
+```
+
+### SbDirectoryGetNext ###
+
+Populates `out_entry` with the next entry in the specified directory stream, and
+moves the stream forward by one entry.
+
+Platforms may, but are not required to, return `.` (referring to the directory
+itself) and/or `..` (referring to the directory's parent directory) as entries
+in the directory stream.
+
+This function returns `true` if there was a next directory, and `false` at the
+end of the directory stream or if `out_entry_size` is smaller than
+kSbFileMaxName.
+
+`directory`: The directory stream from which to retrieve the next directory.
+`out_entry`: The null terminated string to be populated with the next directory
+entry. The space allocated for this string should be equal to `out_entry_size`.
+`out_entry_size`: The size of the space allocated for `out_entry`. This should
+be at least equal to kSbFileMaxName.
+
+#### Declaration ####
+
+```
+bool SbDirectoryGetNext(SbDirectory directory, char *out_entry, size_t out_entry_size)
+```
+
+### SbDirectoryIsValid ###
+
+Returns whether the given directory stream handle is valid.
+
+#### Declaration ####
+
+```
+static bool SbDirectoryIsValid(SbDirectory directory)
+```
+
+### SbDirectoryOpen ###
+
+Opens the given existing directory for listing. This function returns
+kSbDirectoryInvalidHandle if it is not successful.
+
+If `out_error` is provided by the caller, it will be set to the appropriate
+SbFileError code on failure.
+
+`out_error`: An output parameter that, in case of an error, is set to the reason
+that the directory could not be opened.
+
+#### Declaration ####
+
+```
+SbDirectory SbDirectoryOpen(const char *path, SbFileError *out_error)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/double.md b/src/cobalt/site/docs/reference/starboard/modules/12/double.md
similarity index 100%
copy from src/cobalt/site/docs/reference/starboard/modules/4/double.md
copy to src/cobalt/site/docs/reference/starboard/modules/12/double.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/drm.md b/src/cobalt/site/docs/reference/starboard/modules/12/drm.md
new file mode 100644
index 0000000..3036863
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/drm.md
@@ -0,0 +1,412 @@
+---
+layout: doc
+title: "Starboard Module Reference: drm.h"
+---
+
+Provides definitions that allow for DRM support, which are common between Player
+and Decoder interfaces.
+
+## Macros ##
+
+### kSbDrmSystemInvalid ###
+
+An invalid SbDrmSystem.
+
+### kSbDrmTicketInvalid ###
+
+A ticket for callback invocations initiated by the DRM system.
+
+## Enums ##
+
+### SbDrmEncryptionScheme ###
+
+Encryption scheme of the input sample, as defined in ISO/IEC 23001 part 7.
+
+#### Values ####
+
+*   `kSbDrmEncryptionSchemeAesCtr`
+*   `kSbDrmEncryptionSchemeAesCbc`
+
+### SbDrmKeyStatus ###
+
+Status of a particular media key. [https://w3c.github.io/encrypted-media/#idl-def-MediaKeyStatus](https://w3c.github.io/encrypted-media/#idl-def-MediaKeyStatus)
+
+#### Values ####
+
+*   `kSbDrmKeyStatusUsable`
+*   `kSbDrmKeyStatusExpired`
+*   `kSbDrmKeyStatusReleased`
+*   `kSbDrmKeyStatusRestricted`
+*   `kSbDrmKeyStatusDownscaled`
+*   `kSbDrmKeyStatusPending`
+*   `kSbDrmKeyStatusError`
+
+### SbDrmSessionRequestType ###
+
+The type of the session request. [https://www.w3.org/TR/encrypted-media/#idl-def-mediakeymessagetype](https://www.w3.org/TR/encrypted-media/#idl-def-mediakeymessagetype)
+
+#### Values ####
+
+*   `kSbDrmSessionRequestTypeLicenseRequest`
+*   `kSbDrmSessionRequestTypeLicenseRenewal`
+*   `kSbDrmSessionRequestTypeLicenseRelease`
+*   `kSbDrmSessionRequestTypeIndividualizationRequest`
+
+### SbDrmStatus ###
+
+The status of session related operations. Used by
+`SbDrmSessionUpdateRequestFunc`, `SbDrmSessionUpdatedFunc`, and
+`SbDrmServerCertificateUpdatedFunc` to indicate the status of the operation. [https://w3c.github.io/encrypted-media/#error-names](https://w3c.github.io/encrypted-media/#error-names)
+
+#### Values ####
+
+*   `kSbDrmStatusSuccess`
+*   `kSbDrmStatusTypeError`
+*   `kSbDrmStatusNotSupportedError`
+*   `kSbDrmStatusInvalidStateError`
+*   `kSbDrmStatusQuotaExceededError`
+*   `kSbDrmStatusUnknownError`
+
+    The following error can be used when the error status cannot be mapped to
+    one of the above errors.
+
+## Typedefs ##
+
+### SbDrmServerCertificateUpdatedFunc ###
+
+A callback to notify the caller of SbDrmUpdateServerCertificate() whether the
+update has been successfully updated or not.
+
+#### Definition ####
+
+```
+typedef void(* SbDrmServerCertificateUpdatedFunc) (SbDrmSystem drm_system, void *context, int ticket, SbDrmStatus status, const char *error_message)
+```
+
+### SbDrmSessionClosedFunc ###
+
+A callback for signalling that a session has been closed by the SbDrmSystem
+
+#### Definition ####
+
+```
+typedef void(* SbDrmSessionClosedFunc) (SbDrmSystem drm_system, void *context, const void *session_id, int session_id_size)
+```
+
+### SbDrmSessionKeyStatusesChangedFunc ###
+
+A callback for notifications that the status of one or more keys in a session
+has been changed. All keys of the session and their new status will be passed
+along. Any keys not in the list is considered as deleted.
+
+#### Definition ####
+
+```
+typedef void(* SbDrmSessionKeyStatusesChangedFunc) (SbDrmSystem drm_system, void *context, const void *session_id, int session_id_size, int number_of_keys, const SbDrmKeyId *key_ids, const SbDrmKeyStatus *key_statuses)
+```
+
+### SbDrmSessionUpdateRequestFunc ###
+
+A callback that will receive generated session update request when requested
+from a SbDrmSystem. `drm_system` will be the DRM system that
+SbDrmGenerateSessionUpdateRequest() was called on. `context` will be the same
+context that was passed into the call to SbDrmCreateSystem().
+
+`status` is the status of the session request.
+
+`type` is the status of the session request.
+
+`error_message` may contain an optional error message when `status` isn't
+`kSbDrmStatusSuccess` to provide more details about the error. It may be NULL if
+`status` is `kSbDrmStatusSuccess` or if no error message can be provided.
+`ticket` will be the same ticket that was passed to
+SbDrmGenerateSessionUpdateRequest() or `kSbDrmTicketInvalid` if the update
+request was generated by the DRM system.
+
+`session_id` cannot be NULL when `ticket` is `kSbDrmTicketInvalid`, even when
+there was an error generating the request. This allows Cobalt to find and reject
+the correct Promise corresponding to the associated
+SbDrmGenerateSessionUpdateRequest().
+
+#### Definition ####
+
+```
+typedef void(* SbDrmSessionUpdateRequestFunc) (SbDrmSystem drm_system, void *context, int ticket, SbDrmStatus status, SbDrmSessionRequestType type, const char *error_message, const void *session_id, int session_id_size, const void *content, int content_size, const char *url)
+```
+
+### SbDrmSessionUpdatedFunc ###
+
+A callback for notifications that a session has been added, and subsequent
+encrypted samples are actively ready to be decoded. `drm_system` will be the DRM
+system that SbDrmUpdateSession() was called on. `context` will be the same
+context passed into that call to SbDrmCreateSystem().
+
+`ticket` will be the same ticket that was passed to SbDrmUpdateSession().
+
+`status` is the status of the session request.
+
+`error_message` may contain an optional error message when `status` isn't
+`kSbDrmStatusSuccess` to provide more details about the error. It may be NULL if
+`status` is `kSbDrmStatusSuccess` or if no error message can be provided.
+`succeeded` is whether the session was successfully updated or not.
+
+#### Definition ####
+
+```
+typedef void(* SbDrmSessionUpdatedFunc) (SbDrmSystem drm_system, void *context, int ticket, SbDrmStatus status, const char *error_message, const void *session_id, int session_id_size)
+```
+
+### SbDrmSystem ###
+
+A handle to a DRM system which can be used with either an SbDecoder or a
+SbPlayer.
+
+#### Definition ####
+
+```
+typedef struct SbDrmSystemPrivate* SbDrmSystem
+```
+
+## Structs ##
+
+### SbDrmEncryptionPattern ###
+
+Encryption pattern of the input sample, as defined in ISO/IEC 23001 part 7.
+
+#### Members ####
+
+*   `uint32_t crypt_byte_block`
+*   `uint32_t skip_byte_block`
+
+### SbDrmKeyId ###
+
+#### Members ####
+
+*   `uint8_t identifier`
+
+    The ID of the license (or key) required to decrypt this sample. For
+    PlayReady, this is the license GUID in packed little-endian binary form.
+*   `int identifier_size`
+
+### SbDrmSampleInfo ###
+
+All the optional information needed per sample for encrypted samples.
+
+#### Members ####
+
+*   `SbDrmEncryptionScheme encryption_scheme`
+
+    The encryption scheme of this sample.
+*   `SbDrmEncryptionPattern encryption_pattern`
+
+    The encryption pattern of this sample.
+*   `uint8_t initialization_vector`
+
+    The Initialization Vector needed to decrypt this sample.
+*   `int initialization_vector_size`
+*   `uint8_t identifier`
+
+    The ID of the license (or key) required to decrypt this sample. For
+    PlayReady, this is the license GUID in packed little-endian binary form.
+*   `int identifier_size`
+*   `int32_t subsample_count`
+
+    The number of subsamples in this sample, must be at least 1.
+*   `constSbDrmSubSampleMapping* subsample_mapping`
+
+    The clear/encrypted mapping of each subsample in this sample. This must be
+    an array of `subsample_count` mappings.
+
+### SbDrmSubSampleMapping ###
+
+A mapping of clear and encrypted bytes for a single subsample. All subsamples
+within a sample must be encrypted with the same encryption parameters. The clear
+bytes always appear first in the sample.
+
+#### Members ####
+
+*   `int32_t clear_byte_count`
+
+    How many bytes of the corresponding subsample are not encrypted
+*   `int32_t encrypted_byte_count`
+
+    How many bytes of the corresponding subsample are encrypted.
+
+## Functions ##
+
+### SbDrmCloseSession ###
+
+Clear any internal states/resources related to the specified `session_id`.
+
+#### Declaration ####
+
+```
+void SbDrmCloseSession(SbDrmSystem drm_system, const void *session_id, int session_id_size)
+```
+
+### SbDrmDestroySystem ###
+
+Destroys `drm_system`, which implicitly removes all keys installed in it and
+invalidates all outstanding session update requests. A DRM system cannot be
+destroyed unless any associated SbPlayer or SbDecoder has first been destroyed.
+
+All callbacks are guaranteed to be finished when this function returns. As a
+result, if this function is called from a callback that is passed to
+SbDrmCreateSystem(), a deadlock will occur.
+
+`drm_system`: The DRM system to be destroyed.
+
+#### Declaration ####
+
+```
+void SbDrmDestroySystem(SbDrmSystem drm_system)
+```
+
+### SbDrmGenerateSessionUpdateRequest ###
+
+Asynchronously generates a session update request payload for
+`initialization_data`, of `initialization_data_size`, in case sensitive `type`,
+extracted from the media stream, in `drm_system`'s key system.
+
+This function calls `drm_system`'s `update_request_callback` function, which is
+defined when the DRM system is created by SbDrmCreateSystem. When calling that
+function, this function either sends `context` (also from `SbDrmCreateSystem`)
+and a populated request, or it sends NULL `session_id` if an error occurred.
+
+`drm_system`'s `context` may be used to route callbacks back to an object
+instance.
+
+Callbacks may be called either from the current thread before this function
+returns or from another thread.
+
+`drm_system`: The DRM system that defines the key system used for the session
+update request payload as well as the callback function that is called as a
+result of the function being called.
+
+`ticket`: The opaque ID that allows to distinguish callbacks from multiple
+concurrent calls to SbDrmGenerateSessionUpdateRequest(), which will be passed to
+`update_request_callback` as-is. It is the responsibility of the caller to
+establish ticket uniqueness, issuing multiple requests with the same ticket may
+result in undefined behavior. The value `kSbDrmTicketInvalid` must not be used.
+
+`type`: The case-sensitive type of the session update request payload.
+`initialization_data`: The data for which the session update request payload is
+created. `initialization_data_size`: The size of the session update request
+payload.
+
+#### Declaration ####
+
+```
+void SbDrmGenerateSessionUpdateRequest(SbDrmSystem drm_system, int ticket, const char *type, const void *initialization_data, int initialization_data_size)
+```
+
+### SbDrmGetMetrics ###
+
+Get the metrics of the underlying drm system.
+
+When it is called on an implementation that supports drm system metrics, it
+should return a pointer containing the metrics as a blob, encoded using url safe
+base64 without padding and line wrapping, with the size of the encoded result in
+`size` on return. For example, on Android API level 28 or later, it should
+return the result of MediaDrm.getPropertyByteArray("metrics"), encoded using url
+safe base64 without padding and line wrapping. On systems using Widevine CE CDM
+with oemcrypto 16 or later, it should return the metrics retrieved via
+Cdm::getMetrics(), encoded using url safe base64 without padding and line
+wrapping. The returned pointer should remain valid and its content should remain
+unmodified until the next time this function is called on the associated
+`drm_system` or the `drm_system` is destroyed.
+
+When the metrics is empty on supported system, it should return a non-null
+pointer with `size` set to 0.
+
+It should return NULL when there is no metrics support in the underlying drm
+system, or when the drm system implementation fails to retrieve the metrics.
+
+The caller will never set `size` to NULL.
+
+#### Declaration ####
+
+```
+const void* SbDrmGetMetrics(SbDrmSystem drm_system, int *size)
+```
+
+### SbDrmIsServerCertificateUpdatable ###
+
+Returns true if server certificate of `drm_system` can be updated via
+SbDrmUpdateServerCertificate(). The return value should remain the same during
+the life time of `drm_system`.
+
+`drm_system`: The DRM system to check if its server certificate is updatable.
+
+#### Declaration ####
+
+```
+bool SbDrmIsServerCertificateUpdatable(SbDrmSystem drm_system)
+```
+
+### SbDrmSystemIsValid ###
+
+Indicates whether `drm_system` is a valid SbDrmSystem.
+
+#### Declaration ####
+
+```
+static bool SbDrmSystemIsValid(SbDrmSystem drm)
+```
+
+### SbDrmTicketIsValid ###
+
+Indicates whether `ticket` is a valid ticket.
+
+#### Declaration ####
+
+```
+static bool SbDrmTicketIsValid(int ticket)
+```
+
+### SbDrmUpdateServerCertificate ###
+
+Update the server certificate of `drm_system`. The function can be called
+multiple times. It is possible that a call to it happens before the callback of
+a previous call is called. Note that this function should only be called after
+`SbDrmIsServerCertificateUpdatable` is called first and returned true.
+
+`drm_system`: The DRM system whose server certificate is being updated.
+`ticket`: The opaque ID that allows to distinguish callbacks from multiple
+concurrent calls to SbDrmUpdateServerCertificate(), which will be passed to
+`server_certificate_updated_callback` as-is. It is the responsibility of the
+caller to establish ticket uniqueness, issuing multiple requests with the same
+ticket may result in undefined behavior. The value `kSbDrmTicketInvalid` must
+not be used. `certificate`: Pointer to the server certificate data.
+`certificate_size`: Size of the server certificate data.
+
+#### Declaration ####
+
+```
+void SbDrmUpdateServerCertificate(SbDrmSystem drm_system, int ticket, const void *certificate, int certificate_size)
+```
+
+### SbDrmUpdateSession ###
+
+Update session with `key`, in `drm_system`'s key system, from the license server
+response. Calls `session_updated_callback` with `context` and whether the update
+succeeded. `context` may be used to route callbacks back to an object instance.
+
+`ticket` is the opaque ID that allows to distinguish callbacks from multiple
+concurrent calls to SbDrmUpdateSession(), which will be passed to
+`session_updated_callback` as-is. It is the responsibility of the caller to
+establish ticket uniqueness, issuing multiple calls with the same ticket may
+result in undefined behavior.
+
+Once the session is successfully updated, an SbPlayer or SbDecoder associated
+with that DRM key system will be able to decrypt encrypted samples.
+
+`drm_system`'s `session_updated_callback` may called either from the current
+thread before this function returns or from another thread.
+
+#### Declaration ####
+
+```
+void SbDrmUpdateSession(SbDrmSystem drm_system, int ticket, const void *key, int key_size, const void *session_id, int session_id_size)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/egl.md b/src/cobalt/site/docs/reference/starboard/modules/12/egl.md
new file mode 100644
index 0000000..1938b5b
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/egl.md
@@ -0,0 +1,119 @@
+---
+layout: doc
+title: "Starboard Module Reference: egl.h"
+---
+
+The EGL API provides an interface with accompanying type declarations and
+defines that together provide a single consistent method of EGL usage across
+platforms.
+
+This API is designed to abstract the differences between EGL implementations and
+versions on different systems, and to remove the requirement for any other code
+to directly pull in and use these system libraries.
+EGL Version
+
+This API has the ability to support EGL 1.5, however it is not required to
+support anything beyond EGL 1.4. The user is responsible for ensuring that the
+functions from EGL 1.5 they are calling from the interface are valid.
+
+## Macros ##
+
+### SB_EGL_ALPHA_FORMAT ###
+
+EGL_VERSION_1_2
+
+### SB_EGL_ALPHA_SIZE ###
+
+EGL_VERSION_1_0
+
+### SB_EGL_BACK_BUFFER ###
+
+EGL_VERSION_1_1
+
+### SB_EGL_CONFORMANT ###
+
+EGL_VERSION_1_3
+
+### SB_EGL_CONTEXT_MAJOR_VERSION ###
+
+EGL_VERSION_1_5
+
+### SB_EGL_DEFAULT_DISPLAY ###
+
+EGL_VERSION_1_4
+
+## Typedefs ##
+
+### SbEglCastsToProperFunctionPointerType ###
+
+The following type definitions were adapted from the types declared in [https://www.khronos.org/registry/EGL/api/EGL/egl.h](https://www.khronos.org/registry/EGL/api/EGL/egl.h)
+.
+
+#### Definition ####
+
+```
+typedef void(* SbEglCastsToProperFunctionPointerType) (void)
+```
+
+### SbEglInt32 ###
+
+The following type definitions were adapted from the types declared in [https://www.khronos.org/registry/EGL/api/EGL/eglplatform.h](https://www.khronos.org/registry/EGL/api/EGL/eglplatform.h)
+.
+
+#### Definition ####
+
+```
+typedef int32_t SbEglInt32
+```
+
+## Structs ##
+
+### SbEglInterface ###
+
+#### Members ####
+
+*   `SbEglBoolean(* eglChooseConfig`
+*   `SbEglBoolean(* eglCopyBuffers`
+*   `SbEglContext(* eglCreateContext`
+*   `SbEglSurface(* eglCreatePbufferSurface`
+*   `SbEglSurface(* eglCreatePixmapSurface`
+*   `SbEglSurface(* eglCreateWindowSurface`
+*   `SbEglBoolean(* eglDestroyContext`
+*   `SbEglBoolean(* eglDestroySurface`
+*   `SbEglBoolean(* eglGetConfigAttrib`
+*   `SbEglBoolean(* eglGetConfigs`
+*   `SbEglDisplay(* eglGetCurrentDisplay`
+*   `SbEglSurface(* eglGetCurrentSurface`
+*   `SbEglDisplay(* eglGetDisplay`
+*   `SbEglInt32(* eglGetError`
+*   `SbEglCastsToProperFunctionPointerType(* eglGetProcAddress`
+*   `SbEglBoolean(* eglInitialize`
+*   `SbEglBoolean(* eglMakeCurrent`
+*   `SbEglBoolean(* eglQueryContext`
+*   `const char *(* eglQueryString`
+*   `SbEglBoolean(* eglQuerySurface`
+*   `SbEglBoolean(* eglSwapBuffers`
+*   `SbEglBoolean(* eglTerminate`
+*   `SbEglBoolean(* eglWaitGL`
+*   `SbEglBoolean(* eglWaitNative`
+*   `SbEglBoolean(* eglBindTexImage`
+*   `SbEglBoolean(* eglReleaseTexImage`
+*   `SbEglBoolean(* eglSurfaceAttrib`
+*   `SbEglBoolean(* eglSwapInterval`
+*   `SbEglBoolean(* eglBindAPI`
+*   `SbEglEnum(* eglQueryAPI`
+*   `SbEglSurface(* eglCreatePbufferFromClientBuffer`
+*   `SbEglBoolean(* eglReleaseThread`
+*   `SbEglBoolean(* eglWaitClient`
+*   `SbEglContext(* eglGetCurrentContext`
+*   `SbEglSync(* eglCreateSync`
+*   `SbEglBoolean(* eglDestroySync`
+*   `SbEglInt32(* eglClientWaitSync`
+*   `SbEglBoolean(* eglGetSyncAttrib`
+*   `SbEglImage(* eglCreateImage`
+*   `SbEglBoolean(* eglDestroyImage`
+*   `SbEglDisplay(* eglGetPlatformDisplay`
+*   `SbEglSurface(* eglCreatePlatformWindowSurface`
+*   `SbEglSurface(* eglCreatePlatformPixmapSurface`
+*   `SbEglBoolean(* eglWaitSync`
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/event.md b/src/cobalt/site/docs/reference/starboard/modules/12/event.md
new file mode 100644
index 0000000..65b6394
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/event.md
@@ -0,0 +1,371 @@
+---
+layout: doc
+title: "Starboard Module Reference: event.h"
+---
+
+Defines the event system that wraps the Starboard main loop and entry point.
+The Starboard Application Lifecycle
+
+```
+    ---------- *
+   |           |
+   |        Preload
+   |           |
+   |           V
+ Start   [ PRELOADING ] ------------
+   |           |                    |
+   |         Start                  |
+   |           |                    |
+   |           V                    |
+    ----> [ STARTED ] <----         |
+               |           |        |
+             Pause       Unpause    |
+               |           |     Suspend
+               V           |        |
+    -----> [ PAUSED ] -----         |
+   |           |                    |
+Resume      Suspend                 |
+   |           |                    |
+   |           V                    |
+    ---- [ SUSPENDED ] <------------
+               |
+              Stop
+               |
+               V
+          [ STOPPED ]
+
+```
+
+The first event that a Starboard application receives is either `Start`
+(`kSbEventTypeStart`) or `Preload` (`kSbEventTypePreload`). `Start` puts the
+application in the `STARTED` state, whereas `Preload` puts the application in
+the `PRELOADING` state.
+
+`PRELOADING` can only happen as the first application state. In this state, the
+application should start and run as normal, but will not receive any input, and
+should not try to initialize graphics resources (via GL or `SbBlitter`). In
+`PRELOADING`, the application can receive `Start` or `Suspend` events. `Start`
+will receive the same data that was passed into `Preload`.
+
+In the `STARTED` state, the application is in the foreground and can expect to
+do all of the normal things it might want to do. Once in the `STARTED` state, it
+may receive a `Pause` event, putting the application into the `PAUSED` state.
+
+In the `PAUSED` state, the application is still visible, but has lost focus, or
+it is partially obscured by a modal dialog, or it is on its way to being shut
+down. The application should pause activity in this state. In this state, it can
+receive `Unpause` to be brought back to the foreground state (`STARTED`), or
+`Suspend` to be pushed further in the background to the `SUSPENDED` state.
+
+In the `SUSPENDED` state, the application is generally not visible. It should
+immediately release all graphics and video resources, and shut down all
+background activity (timers, rendering, etc). Additionally, the application
+should flush storage to ensure that if the application is killed, the storage
+will be up-to-date. The application may be killed at this point, but will
+ideally receive a `Stop` event for a more graceful shutdown.
+
+Note that the application is always expected to transition through `PAUSED` to
+`SUSPENDED` before receiving `Stop` or being killed.
+
+## Enums ##
+
+### SbEventType ###
+
+An enumeration of all possible event types dispatched directly by the system.
+Each event is accompanied by a void* data argument, and each event must define
+the type of the value pointed to by that data argument, if any.
+
+#### Values ####
+
+*   `kSbEventTypePreload`
+
+    Applications should perform initialization and prepare to react to
+    subsequent events, but must not initialize any graphics resources (through
+    GL or SbBlitter). The intent of this event is to allow the application to do
+    as much work as possible ahead of time, so that when the application is
+    first brought to the foreground, it's as fast as a resume.
+
+    The `kSbEventTypeStart` event may be sent at any time, regardless of
+    initialization state. Input events will not be sent in the `PRELOADING`
+    state. This event will only be sent once for a given process launch.
+    SbEventStartData is passed as the data argument.
+
+    The system may send `kSbEventTypeSuspend` in `PRELOADING` if it wants to
+    push the app into a lower resource consumption state. Applications can alo
+    call SbSystemRequestSuspend() when they are done preloading to request this.
+*   `kSbEventTypeStart`
+
+    The first event that an application receives on startup when starting
+    normally (i.e. not being preloaded). Applications should perform
+    initialization, start running, and prepare to react to subsequent events.
+    Applications that wish to run and then exit must call
+    `SbSystemRequestStop()` to terminate. This event will only be sent once for
+    a given process launch. `SbEventStartData` is passed as the data argument.
+    In case of preload, the `SbEventStartData` will be the same as what was
+    passed to `kSbEventTypePreload`.
+*   `kSbEventTypePause`
+
+    A dialog will be raised or the application will otherwise be put into a
+    background-but-visible or partially-obscured state (PAUSED). Graphics and
+    video resources will still be available, but the application should pause
+    foreground activity like animations and video playback. Can only be received
+    after a Start event. The only events that should be dispatched after a Pause
+    event are Unpause or Suspend. No data argument.
+*   `kSbEventTypeUnpause`
+
+    The application is returning to the foreground (STARTED) after having been
+    put in the PAUSED (e.g. partially-obscured) state. The application should
+    unpause foreground activity like animations and video playback. Can only be
+    received after a Pause or Resume event. No data argument.
+*   `kSbEventTypeSuspend`
+
+    The operating system will put the application into a Suspended state after
+    this event is handled. The application is expected to stop periodic
+    background work, release ALL graphics and video resources, and flush any
+    pending SbStorage writes. Some platforms will terminate the application if
+    work is done or resources are retained after suspension. Can only be
+    received after a Pause event. The only events that should be dispatched
+    after a Suspend event are Resume or Stop. On some platforms, the process may
+    also be killed after Suspend without a Stop event. No data argument.
+*   `kSbEventTypeResume`
+
+    The operating system has restored the application to the PAUSED state from
+    the SUSPENDED state. This is the first event the application will receive
+    coming out of SUSPENDED, and it will only be received after a Suspend event.
+    The application will now be in the PAUSED state. No data argument.
+*   `kSbEventTypeStop`
+
+    The operating system will shut the application down entirely after this
+    event is handled. Can only be recieved after a Suspend event, in the
+    SUSPENDED state. No data argument.
+*   `kSbEventTypeInput`
+
+    A user input event, including keyboard, mouse, gesture, or something else.
+    SbInputData (from input.h) is passed as the data argument.
+*   `kSbEventTypeUser`
+
+    A user change event, which means a new user signed-in or signed-out, or the
+    current user changed. No data argument, call SbUserGetSignedIn() and
+    SbUserGetCurrent() to get the latest changes.
+*   `kSbEventTypeLink`
+
+    A navigational link has come from the system, and the application should
+    consider handling it by navigating to the corresponding application
+    location. The data argument is an application-specific, null-terminated
+    string.
+*   `kSbEventTypeVerticalSync`
+
+    The beginning of a vertical sync has been detected. This event is very
+    timing-sensitive, so as little work as possible should be done on the main
+    thread if the application wants to receive this event in a timely manner. No
+    data argument.
+*   `kSbEventTypeScheduled`
+
+    An event type reserved for scheduled callbacks. It will only be sent in
+    response to an application call to SbEventSchedule(), and it will call the
+    callback directly, so SbEventHandle should never receive this event
+    directly. The data type is an internally-defined structure.
+*   `kSbEventTypeAccessiblitySettingsChanged`
+
+    The platform's accessibility settings have changed. The application should
+    query the accessibility settings using the appropriate APIs to get the new
+    settings. Note this excludes captions settings changes, which causes
+    kSbEventTypeAccessibilityCaptionSettingsChanged to fire. If the starboard
+    version has kSbEventTypeAccessiblityTextToSpeechSettingsChanged, then that
+    event should be used to signal text-to-speech settings changes instead;
+    platforms using older starboard versions should use
+    kSbEventTypeAccessiblitySettingsChanged for text-to-speech settings changes.
+*   `kSbEventTypeLowMemory`
+
+    An optional event that platforms may send to indicate that the application
+    may soon be terminated (or crash) due to low memory availability. The
+    application may respond by reducing memory consumption by running a Garbage
+    Collection, flushing caches, or something similar. There is no requirement
+    to respond to or handle this event, it is only advisory.
+*   `kSbEventTypeWindowSizeChanged`
+
+    The size or position of a SbWindow has changed. The data is
+    SbEventWindowSizeChangedData .
+*   `kSbEventTypeOnScreenKeyboardShown`
+
+    The platform has shown the on screen keyboard. This event is triggered by
+    the system or by the application's OnScreenKeyboard show method. The event
+    has int data representing a ticket. The ticket is used by the application to
+    mark individual calls to the show method as successfully completed. Events
+    triggered by the application have tickets passed in via
+    SbWindowShowOnScreenKeyboard. System-triggered events have ticket value
+    kSbEventOnScreenKeyboardInvalidTicket.
+*   `kSbEventTypeOnScreenKeyboardHidden`
+
+    The platform has hidden the on screen keyboard. This event is triggered by
+    the system or by the application's OnScreenKeyboard hide method. The event
+    has int data representing a ticket. The ticket is used by the application to
+    mark individual calls to the hide method as successfully completed. Events
+    triggered by the application have tickets passed in via
+    SbWindowHideOnScreenKeyboard. System-triggered events have ticket value
+    kSbEventOnScreenKeyboardInvalidTicket.
+*   `kSbEventTypeOnScreenKeyboardFocused`
+
+    The platform has focused the on screen keyboard. This event is triggered by
+    the system or by the application's OnScreenKeyboard focus method. The event
+    has int data representing a ticket. The ticket is used by the application to
+    mark individual calls to the focus method as successfully completed. Events
+    triggered by the application have tickets passed in via
+    SbWindowFocusOnScreenKeyboard. System-triggered events have ticket value
+    kSbEventOnScreenKeyboardInvalidTicket.
+*   `kSbEventTypeOnScreenKeyboardBlurred`
+
+    The platform has blurred the on screen keyboard. This event is triggered by
+    the system or by the application's OnScreenKeyboard blur method. The event
+    has int data representing a ticket. The ticket is used by the application to
+    mark individual calls to the blur method as successfully completed. Events
+    triggered by the application have tickets passed in via
+    SbWindowBlurOnScreenKeyboard. System-triggered events have ticket value
+    kSbEventOnScreenKeyboardInvalidTicket.
+*   `kSbEventTypeOnScreenKeyboardSuggestionsUpdated`
+
+    The platform has updated the on screen keyboard suggestions. This event is
+    triggered by the system or by the application's OnScreenKeyboard update
+    suggestions method. The event has int data representing a ticket. The ticket
+    is used by the application to mark individual calls to the update
+    suggestions method as successfully completed. Events triggered by the
+    application have tickets passed in via
+    SbWindowUpdateOnScreenKeyboardSuggestions. System-triggered events have
+    ticket value kSbEventOnScreenKeyboardInvalidTicket.
+*   `kSbEventTypeAccessibilityCaptionSettingsChanged`
+
+    SB_HAS(ON_SCREEN_KEYBOARD) One or more of the fields returned by
+    SbAccessibilityGetCaptionSettings has changed.
+*   `kSbEventTypeAccessiblityTextToSpeechSettingsChanged`
+
+    The platform's text-to-speech settings have changed.
+
+## Typedefs ##
+
+### SbEventCallback ###
+
+A function that can be called back from the main Starboard event pump.
+
+#### Definition ####
+
+```
+typedef void(* SbEventCallback) (void *context)
+```
+
+### SbEventDataDestructor ###
+
+A function that will cleanly destroy an event data instance of a specific type.
+
+#### Definition ####
+
+```
+typedef void(* SbEventDataDestructor) (void *data)
+```
+
+### SbEventId ###
+
+An ID that can be used to refer to a scheduled event.
+
+#### Definition ####
+
+```
+typedef uint32_t SbEventId
+```
+
+## Structs ##
+
+### SbEvent ###
+
+Structure representing a Starboard event and its data.
+
+#### Members ####
+
+*   `SbEventType type`
+*   `void * data`
+
+### SbEventStartData ###
+
+Event data for kSbEventTypeStart events.
+
+#### Members ####
+
+*   `char ** argument_values`
+
+    The command-line argument values (argv).
+*   `int argument_count`
+
+    The command-line argument count (argc).
+*   `const char * link`
+
+    The startup link, if any.
+
+### SbEventWindowSizeChangedData ###
+
+Event data for kSbEventTypeWindowSizeChanged events.
+
+#### Members ####
+
+*   `SbWindow window`
+*   `SbWindowSize size`
+
+## Functions ##
+
+### SbEventCancel ###
+
+Cancels the specified `event_id`. Note that this function is a no-op if the
+event already fired. This function can be safely called from any thread, but the
+only way to guarantee that the event does not run anyway is to call it from the
+main Starboard event loop thread.
+
+#### Declaration ####
+
+```
+void SbEventCancel(SbEventId event_id)
+```
+
+### SbEventHandle ###
+
+The entry point that Starboard applications MUST implement. Any memory pointed
+at by `event` or the `data` field inside `event` is owned by the system, and
+that memory is reclaimed after this function returns, so the implementation must
+copy this data to extend its life. This behavior should also be assumed of all
+fields within the `data` object, unless otherwise explicitly specified.
+
+This function is only called from the main Starboard thread. There is no
+specification about what other work might happen on this thread, so the
+application should generally do as little work as possible on this thread, and
+just dispatch it over to another thread.
+
+#### Declaration ####
+
+```
+SB_IMPORT void SbEventHandle(const SbEvent *event)
+```
+
+### SbEventIsIdValid ###
+
+Returns whether the given event handle is valid.
+
+#### Declaration ####
+
+```
+static bool SbEventIsIdValid(SbEventId handle)
+```
+
+### SbEventSchedule ###
+
+Schedules an event `callback` into the main Starboard event loop. This function
+may be called from any thread, but `callback` is always called from the main
+Starboard thread, queued with other pending events.
+
+`callback`: The callback function to be called. `context`: The context that is
+passed to the `callback` function. `delay`: The minimum number of microseconds
+to wait before calling the `callback` function. Set `delay` to `0` to call the
+callback as soon as possible.
+
+#### Declaration ####
+
+```
+SbEventId SbEventSchedule(SbEventCallback callback, void *context, SbTime delay)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/export.md b/src/cobalt/site/docs/reference/starboard/modules/12/export.md
new file mode 100644
index 0000000..ff79777
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/export.md
@@ -0,0 +1,24 @@
+---
+layout: doc
+title: "Starboard Module Reference: export.h"
+---
+
+Provides macros for properly exporting or importing symbols from shared
+libraries.
+
+## Macros ##
+
+### SB_EXPORT ###
+
+Specification for a symbol that should be exported when building the DLL and
+imported when building code that uses the DLL.
+
+### SB_EXPORT_PRIVATE ###
+
+Specification for a symbol that should be exported or imported for testing
+purposes only.
+
+### SB_IMPORT ###
+
+Specification for a symbol that is expected to be defined externally to this
+module.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/file.md b/src/cobalt/site/docs/reference/starboard/modules/12/file.md
new file mode 100644
index 0000000..c3ba551
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/file.md
@@ -0,0 +1,405 @@
+---
+layout: doc
+title: "Starboard Module Reference: file.h"
+---
+
+Defines file system input/output functions.
+
+## Macros ##
+
+### kSbFileInvalid ###
+
+Well-defined value for an invalid file handle.
+
+## Enums ##
+
+### SbFileError ###
+
+kSbFileErrorAccessDenied is returned when a call fails because of a filesystem
+restriction. kSbFileErrorSecurity is returned when a security policy doesn't
+allow the operation to be executed.
+
+#### Values ####
+
+*   `kSbFileOk`
+*   `kSbFileErrorFailed`
+*   `kSbFileErrorInUse`
+*   `kSbFileErrorExists`
+*   `kSbFileErrorNotFound`
+*   `kSbFileErrorAccessDenied`
+*   `kSbFileErrorTooManyOpened`
+*   `kSbFileErrorNoMemory`
+*   `kSbFileErrorNoSpace`
+*   `kSbFileErrorNotADirectory`
+*   `kSbFileErrorInvalidOperation`
+*   `kSbFileErrorSecurity`
+*   `kSbFileErrorAbort`
+*   `kSbFileErrorNotAFile`
+*   `kSbFileErrorNotEmpty`
+*   `kSbFileErrorInvalidUrl`
+*   `kSbFileErrorIO`
+*   `kSbFileErrorMax`
+
+### SbFileFlags ###
+
+Flags that define how a file is used in the application. These flags should be
+or'd together when passed to SbFileOpen to open or create a file.
+
+The following five flags are mutually exclusive. You must specify exactly one of
+them:
+
+*   `kSbFileOpenAlways`
+
+*   `kSbFileOpenOnly`
+
+*   `kSbFileOpenTruncated`
+
+*   `kSbFileCreateAlways`
+
+*   `kSbFileCreateOnly`
+
+In addition, one or more of the following flags must be specified:
+
+*   `kSbFileRead`
+
+*   `kSbFileWrite`
+
+The `kSbFileAsync` flag is optional.
+
+#### Values ####
+
+*   `kSbFileOpenOnly`
+*   `kSbFileCreateOnly`
+*   `kSbFileOpenAlways`
+
+    does not already exist.
+*   `kSbFileCreateAlways`
+
+    path or creates a new file at that path.
+*   `kSbFileOpenTruncated`
+
+    or overwrites an existing file at that path.
+*   `kSbFileRead`
+
+    only if it exists.
+*   `kSbFileWrite`
+*   `kSbFileAsync`
+
+### SbFileWhence ###
+
+This explicit mapping matches both FILE_ on Windows and SEEK_ on Linux.
+
+#### Values ####
+
+*   `kSbFileFromBegin`
+*   `kSbFileFromCurrent`
+*   `kSbFileFromEnd`
+
+## Typedefs ##
+
+### SbFile ###
+
+A handle to an open file.
+
+#### Definition ####
+
+```
+typedef SbFilePrivate* SbFile
+```
+
+## Structs ##
+
+### SbFileInfo ###
+
+Used to hold information about a file.
+
+#### Members ####
+
+*   `int64_t size`
+
+    The size of the file in bytes. Undefined when is_directory is true.
+*   `bool is_directory`
+
+    Whether the file corresponds to a directory.
+*   `bool is_symbolic_link`
+
+    Whether the file corresponds to a symbolic link.
+*   `SbTime last_modified`
+
+    The last modified time of a file.
+*   `SbTime last_accessed`
+
+    The last accessed time of a file.
+*   `SbTime creation_time`
+
+    The creation time of a file.
+
+## Functions ##
+
+### SbFileAtomicReplace ###
+
+Replaces the content of the file at `path` with `data`. Returns whether the
+contents of the file were replaced. The replacement of the content is an atomic
+operation. The file will either have all of the data, or none.
+
+`path`: The path to the file whose contents should be replaced. `data`: The data
+to replace the file contents with. `data_size`: The amount of `data`, in bytes,
+to be written to the file.
+
+#### Declaration ####
+
+```
+bool SbFileAtomicReplace(const char *path, const char *data, int64_t data_size)
+```
+
+### SbFileCanOpen ###
+
+Indicates whether SbFileOpen() with the given `flags` is allowed for `path`.
+
+`path`: The absolute path to be checked. `flags`: The flags that are being
+evaluated for the given `path`.
+
+#### Declaration ####
+
+```
+bool SbFileCanOpen(const char *path, int flags)
+```
+
+### SbFileClose ###
+
+Closes `file`. The return value indicates whether the file was closed
+successfully.
+
+`file`: The absolute path of the file to be closed.
+
+#### Declaration ####
+
+```
+bool SbFileClose(SbFile file)
+```
+
+### SbFileDelete ###
+
+Deletes the regular file, symlink, or empty directory at `path`. This function
+is used primarily to clean up after unit tests. On some platforms, this function
+fails if the file in question is being held open.
+
+`path`: The absolute path fo the file, symlink, or directory to be deleted.
+
+#### Declaration ####
+
+```
+bool SbFileDelete(const char *path)
+```
+
+### SbFileExists ###
+
+Indicates whether a file or directory exists at `path`.
+
+`path`: The absolute path of the file or directory being checked.
+
+#### Declaration ####
+
+```
+bool SbFileExists(const char *path)
+```
+
+### SbFileFlush ###
+
+Flushes the write buffer to `file`. Data written via SbFileWrite is not
+necessarily committed until the SbFile is flushed or closed.
+
+`file`: The SbFile to which the write buffer is flushed.
+
+#### Declaration ####
+
+```
+bool SbFileFlush(SbFile file)
+```
+
+### SbFileGetInfo ###
+
+Retrieves information about `file`. The return value indicates whether the file
+information was retrieved successfully.
+
+`file`: The SbFile for which information is retrieved. `out_info`: The variable
+into which the retrieved data is placed. This variable is not touched if the
+operation is not successful.
+
+#### Declaration ####
+
+```
+bool SbFileGetInfo(SbFile file, SbFileInfo *out_info)
+```
+
+### SbFileGetPathInfo ###
+
+Retrieves information about the file at `path`. The return value indicates
+whether the file information was retrieved successfully.
+
+`file`: The absolute path of the file for which information is retrieved.
+`out_info`: The variable into which the retrieved data is placed. This variable
+is not touched if the operation is not successful.
+
+#### Declaration ####
+
+```
+bool SbFileGetPathInfo(const char *path, SbFileInfo *out_info)
+```
+
+### SbFileIsValid ###
+
+Returns whether the given file handle is valid.
+
+#### Declaration ####
+
+```
+static bool SbFileIsValid(SbFile file)
+```
+
+### SbFileModeStringToFlags ###
+
+Converts an ISO `fopen()` mode string into flags that can be equivalently passed
+into SbFileOpen().
+
+`mode`: The mode string to be converted into flags.
+
+#### Declaration ####
+
+```
+int SbFileModeStringToFlags(const char *mode)
+```
+
+### SbFileOpen ###
+
+Opens the file at `path`, which must be absolute, creating it if specified by
+`flags`. The read/write position is at the beginning of the file.
+
+Note that this function only guarantees the correct behavior when `path` points
+to a file. The behavior is undefined if `path` points to a directory.
+
+`path`: The absolute path of the file to be opened. `flags`: `SbFileFlags` that
+determine how the file is used in the application. Among other things, `flags`
+can indicate whether the application should create `path` if `path` does not
+already exist. `out_created`: Starboard sets this value to `true` if a new file
+is created or if an old file is truncated to zero length to simulate a new file,
+which can happen if the `kSbFileCreateAlways` flag is set. Otherwise, Starboard
+sets this value to `false`. `out_error`: If `path` cannot be created, this is
+set to `kSbFileInvalid`. Otherwise, it is `NULL`.
+
+#### Declaration ####
+
+```
+SbFile SbFileOpen(const char *path, int flags, bool *out_created, SbFileError *out_error)
+```
+
+### SbFileRead ###
+
+Reads `size` bytes (or until EOF is reached) from `file` into `data`, starting
+at the file's current position.
+
+The return value specifies the number of bytes read or `-1` if there was an
+error. Note that this function does NOT make a best effort to read all data on
+all platforms; rather, it just reads however many bytes are quickly available.
+However, this function can be run in a loop to make it a best-effort read.
+
+`file`: The SbFile from which to read data. `data`: The variable to which data
+is read. `size`: The amount of data (in bytes) to read.
+
+#### Declaration ####
+
+```
+int SbFileRead(SbFile file, char *data, int size)
+```
+
+### SbFileReadAll ###
+
+Reads `size` bytes (or until EOF is reached) from `file` into `data`, starting
+at the file's current position.
+
+The return value specifies the number of bytes read or `-1` if there was an
+error. Note that, unlike `SbFileRead`, this function does make a best effort to
+read all data on all platforms. As such, it is not intended for stream-oriented
+files but instead for cases when the normal expectation is that `size` bytes can
+be read unless there is an error.
+
+`file`: The SbFile from which to read data. `data`: The variable to which data
+is read. `size`: The amount of data (in bytes) to read.
+
+#### Declaration ####
+
+```
+static int SbFileReadAll(SbFile file, char *data, int size)
+```
+
+### SbFileSeek ###
+
+Changes the current read/write position in `file`. The return value identifies
+the resultant current read/write position in the file (relative to the start) or
+`-1` in case of an error. This function might not support seeking past the end
+of the file on some platforms.
+
+`file`: The SbFile in which the read/write position will be changed. `whence`:
+The starting read/write position. The position is modified relative to this
+value. `offset`: The amount that the read/write position is changed, relative to
+`whence`.
+
+#### Declaration ####
+
+```
+int64_t SbFileSeek(SbFile file, SbFileWhence whence, int64_t offset)
+```
+
+### SbFileTruncate ###
+
+Truncates the given `file` to the given `length`. The return value indicates
+whether the file was truncated successfully.
+
+`file`: The file to be truncated. `length`: The expected length of the file
+after it is truncated. If `length` is greater than the current size of the file,
+then the file is extended with zeros. If `length` is negative, then the function
+is a no-op and returns `false`.
+
+#### Declaration ####
+
+```
+bool SbFileTruncate(SbFile file, int64_t length)
+```
+
+### SbFileWrite ###
+
+Writes the given buffer into `file` at the file's current position, overwriting
+any data that was previously there.
+
+The return value identifies the number of bytes written, or `-1` on error. Note
+that this function does NOT make a best effort to write all data; rather, it
+writes however many bytes can be written quickly. Generally, this means that it
+writes however many bytes as possible without blocking on IO. Run this function
+in a loop to ensure that all data is written.
+
+`file`: The SbFile to which data will be written. `data`: The data to be
+written. `size`: The amount of data (in bytes) to write.
+
+#### Declaration ####
+
+```
+int SbFileWrite(SbFile file, const char *data, int size)
+```
+
+### SbFileWriteAll ###
+
+Writes the given buffer into `file`, starting at the beginning of the file, and
+overwriting any data that was previously there. Unlike SbFileWrite, this
+function does make a best effort to write all data on all platforms.
+
+The return value identifies the number of bytes written, or `-1` on error.
+
+`file`: The file to which data will be written. `data`: The data to be written.
+`size`: The amount of data (in bytes) to write.
+
+#### Declaration ####
+
+```
+static int SbFileWriteAll(SbFile file, const char *data, int size)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/gles.md b/src/cobalt/site/docs/reference/starboard/modules/12/gles.md
new file mode 100644
index 0000000..e3a5508
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/gles.md
@@ -0,0 +1,315 @@
+---
+layout: doc
+title: "Starboard Module Reference: gles.h"
+---
+
+The GLES API provides an interface with accompanying type declarations and
+defines that together provide a single consistent method of GLES usage across
+platforms.
+
+This API is designed to abstract the differences between GLES implementations
+and versions on different systems, and to remove the requirement for any other
+code to directly pull in and use these system libraries.
+GLES Version
+
+This API has the ability to support GLES 3.0, however platforms are not required
+to support anything beyond GLES 2.0. The caller is responsible for ensuring that
+the functions from GLES 3.0 they are calling from the interface are valid.
+
+## Macros ##
+
+### SB_GL_DEPTH_BUFFER_BIT ###
+
+Previously defined in [https://www.khronos.org/registry/OpenGL/api/GLES2/gl2.h](https://www.khronos.org/registry/OpenGL/api/GLES2/gl2.h)
+
+### SB_GL_READ_BUFFER ###
+
+Previously defined in [https://www.khronos.org/registry/OpenGL/api/GLES3/gl3.h](https://www.khronos.org/registry/OpenGL/api/GLES3/gl3.h)
+.
+
+## Typedefs ##
+
+### SbGlBoolean ###
+
+The following type definitions were adapted from the types declared in [https://www.khronos.org/registry/OpenGL/api/GLES2/gl2.h](https://www.khronos.org/registry/OpenGL/api/GLES2/gl2.h)
+.
+
+#### Definition ####
+
+```
+typedef uint8_t SbGlBoolean
+```
+
+### SbGlIntPtr ###
+
+Some compilers will transform the intptr_t to an int transparently behind the
+scenes, which is not equivalent to a long int, or long long int, as far as the
+compiler is concerned. We check the Starboard configuration and set the types to
+those exact types used by OpenGL ES 2.0 ( [https://www.khronos.org/registry/OpenGL/api/GLES2/gl2ext.h](https://www.khronos.org/registry/OpenGL/api/GLES2/gl2ext.h)
+).
+
+#### Definition ####
+
+```
+typedef long int SbGlIntPtr
+```
+
+## Structs ##
+
+### SbGlesInterface ###
+
+#### Members ####
+
+*   `void(* glActiveTexture`
+
+    The following prototypes were adapted from the prototypes declared in [https://www.khronos.org/registry/OpenGL/api/GLES2/gl2.h](https://www.khronos.org/registry/OpenGL/api/GLES2/gl2.h)
+    .
+*   `void(* glAttachShader`
+*   `void(* glBindAttribLocation`
+*   `void(* glBindBuffer`
+*   `void(* glBindFramebuffer`
+*   `void(* glBindRenderbuffer`
+*   `void(* glBindTexture`
+*   `void(* glBlendColor`
+*   `void(* glBlendEquation`
+*   `void(* glBlendEquationSeparate`
+*   `void(* glBlendFunc`
+*   `void(* glBlendFuncSeparate`
+*   `void(* glBufferData`
+*   `void(* glBufferSubData`
+*   `SbGlEnum(* glCheckFramebufferStatus`
+*   `void(* glClear`
+*   `void(* glClearColor`
+*   `void(* glClearDepthf`
+*   `void(* glClearStencil`
+*   `void(* glColorMask`
+*   `void(* glCompileShader`
+*   `void(* glCompressedTexImage2D`
+*   `void(* glCompressedTexSubImage2D`
+*   `void(* glCopyTexImage2D`
+*   `void(* glCopyTexSubImage2D`
+*   `SbGlUInt32(* glCreateProgram`
+*   `SbGlUInt32(* glCreateShader`
+*   `void(* glCullFace`
+*   `void(* glDeleteBuffers`
+*   `void(* glDeleteFramebuffers`
+*   `void(* glDeleteProgram`
+*   `void(* glDeleteRenderbuffers`
+*   `void(* glDeleteShader`
+*   `void(* glDeleteTextures`
+*   `void(* glDepthFunc`
+*   `void(* glDepthMask`
+*   `void(* glDepthRangef`
+*   `void(* glDetachShader`
+*   `void(* glDisable`
+*   `void(* glDisableVertexAttribArray`
+*   `void(* glDrawArrays`
+*   `void(* glDrawElements`
+*   `void(* glEnable`
+*   `void(* glEnableVertexAttribArray`
+*   `void(* glFinish`
+*   `void(* glFlush`
+*   `void(* glFramebufferRenderbuffer`
+*   `void(* glFramebufferTexture2D`
+*   `void(* glFrontFace`
+*   `void(* glGenBuffers`
+*   `void(* glGenerateMipmap`
+*   `void(* glGenFramebuffers`
+*   `void(* glGenRenderbuffers`
+*   `void(* glGenTextures`
+*   `void(* glGetActiveAttrib`
+*   `void(* glGetActiveUniform`
+*   `void(* glGetAttachedShaders`
+*   `SbGlInt32(* glGetAttribLocation`
+*   `void(* glGetBooleanv`
+*   `void(* glGetBufferParameteriv`
+*   `SbGlEnum(* glGetError`
+*   `void(* glGetFloatv`
+*   `void(* glGetFramebufferAttachmentParameteriv`
+*   `void(* glGetIntegerv`
+*   `void(* glGetProgramiv`
+*   `void(* glGetProgramInfoLog`
+*   `void(* glGetRenderbufferParameteriv`
+*   `void(* glGetShaderiv`
+*   `void(* glGetShaderInfoLog`
+*   `void(* glGetShaderPrecisionFormat`
+*   `void(* glGetShaderSource`
+*   `const SbGlUInt8 *(* glGetString`
+*   `void(* glGetTexParameterfv`
+*   `void(* glGetTexParameteriv`
+*   `void(* glGetUniformfv`
+*   `void(* glGetUniformiv`
+*   `SbGlInt32(* glGetUniformLocation`
+*   `void(* glGetVertexAttribfv`
+*   `void(* glGetVertexAttribiv`
+*   `void(* glGetVertexAttribPointerv`
+*   `void(* glHint`
+*   `SbGlBoolean(* glIsBuffer`
+*   `SbGlBoolean(* glIsEnabled`
+*   `SbGlBoolean(* glIsFramebuffer`
+*   `SbGlBoolean(* glIsProgram`
+*   `SbGlBoolean(* glIsRenderbuffer`
+*   `SbGlBoolean(* glIsShader`
+*   `SbGlBoolean(* glIsTexture`
+*   `void(* glLineWidth`
+*   `void(* glLinkProgram`
+*   `void(* glPixelStorei`
+*   `void(* glPolygonOffset`
+*   `void(* glReadPixels`
+*   `void(* glReleaseShaderCompiler`
+*   `void(* glRenderbufferStorage`
+*   `void(* glSampleCoverage`
+*   `void(* glScissor`
+*   `void(* glShaderBinary`
+*   `void(* glShaderSource`
+*   `void(* glStencilFunc`
+*   `void(* glStencilFuncSeparate`
+*   `void(* glStencilMask`
+*   `void(* glStencilMaskSeparate`
+*   `void(* glStencilOp`
+*   `void(* glStencilOpSeparate`
+*   `void(* glTexImage2D`
+*   `void(* glTexParameterf`
+*   `void(* glTexParameterfv`
+*   `void(* glTexParameteri`
+*   `void(* glTexParameteriv`
+*   `void(* glTexSubImage2D`
+*   `void(* glUniform1f`
+*   `void(* glUniform1fv`
+*   `void(* glUniform1i`
+*   `void(* glUniform1iv`
+*   `void(* glUniform2f`
+*   `void(* glUniform2fv`
+*   `void(* glUniform2i`
+*   `void(* glUniform2iv`
+*   `void(* glUniform3f`
+*   `void(* glUniform3fv`
+*   `void(* glUniform3i`
+*   `void(* glUniform3iv`
+*   `void(* glUniform4f`
+*   `void(* glUniform4fv`
+*   `void(* glUniform4i`
+*   `void(* glUniform4iv`
+*   `void(* glUniformMatrix2fv`
+*   `void(* glUniformMatrix3fv`
+*   `void(* glUniformMatrix4fv`
+*   `void(* glUseProgram`
+*   `void(* glValidateProgram`
+*   `void(* glVertexAttrib1f`
+*   `void(* glVertexAttrib1fv`
+*   `void(* glVertexAttrib2f`
+*   `void(* glVertexAttrib2fv`
+*   `void(* glVertexAttrib3f`
+*   `void(* glVertexAttrib3fv`
+*   `void(* glVertexAttrib4f`
+*   `void(* glVertexAttrib4fv`
+*   `void(* glVertexAttribPointer`
+*   `void(* glViewport`
+*   `void(* glReadBuffer`
+
+    The following prototypes were adapted from the prototypes declared in [https://www.khronos.org/registry/OpenGL/api/GLES3/gl3.h](https://www.khronos.org/registry/OpenGL/api/GLES3/gl3.h)
+    .
+*   `void(* glDrawRangeElements`
+*   `void(* glTexImage3D`
+*   `void(* glTexSubImage3D`
+*   `void(* glCopyTexSubImage3D`
+*   `void(* glCompressedTexImage3D`
+*   `void(* glCompressedTexSubImage3D`
+*   `void(* glGenQueries`
+*   `void(* glDeleteQueries`
+*   `SbGlBoolean(* glIsQuery`
+*   `void(* glBeginQuery`
+*   `void(* glEndQuery`
+*   `void(* glGetQueryiv`
+*   `void(* glGetQueryObjectuiv`
+*   `SbGlBoolean(* glUnmapBuffer`
+*   `void(* glGetBufferPointerv`
+*   `void(* glDrawBuffers`
+*   `void(* glUniformMatrix2x3fv`
+*   `void(* glUniformMatrix3x2fv`
+*   `void(* glUniformMatrix2x4fv`
+*   `void(* glUniformMatrix4x2fv`
+*   `void(* glUniformMatrix3x4fv`
+*   `void(* glUniformMatrix4x3fv`
+*   `void(* glBlitFramebuffer`
+*   `void(* glRenderbufferStorageMultisample`
+*   `void(* glFramebufferTextureLayer`
+*   `void *(* glMapBufferRange`
+*   `void(* glFlushMappedBufferRange`
+*   `void(* glBindVertexArray`
+*   `void(* glDeleteVertexArrays`
+*   `void(* glGenVertexArrays`
+*   `SbGlBoolean(* glIsVertexArray`
+*   `void(* glGetIntegeri_v`
+*   `void(* glBeginTransformFeedback`
+*   `void(* glEndTransformFeedback`
+*   `void(* glBindBufferRange`
+*   `void(* glBindBufferBase`
+*   `void(* glTransformFeedbackVaryings`
+*   `void(* glGetTransformFeedbackVarying`
+*   `void(* glVertexAttribIPointer`
+*   `void(* glGetVertexAttribIiv`
+*   `void(* glGetVertexAttribIuiv`
+*   `void(* glVertexAttribI4i`
+*   `void(* glVertexAttribI4ui`
+*   `void(* glVertexAttribI4iv`
+*   `void(* glVertexAttribI4uiv`
+*   `void(* glGetUniformuiv`
+*   `SbGlInt32(* glGetFragDataLocation`
+*   `void(* glUniform1ui`
+*   `void(* glUniform2ui`
+*   `void(* glUniform3ui`
+*   `void(* glUniform4ui`
+*   `void(* glUniform1uiv`
+*   `void(* glUniform2uiv`
+*   `void(* glUniform3uiv`
+*   `void(* glUniform4uiv`
+*   `void(* glClearBufferiv`
+*   `void(* glClearBufferuiv`
+*   `void(* glClearBufferfv`
+*   `void(* glClearBufferfi`
+*   `const SbGlUInt8 *(* glGetStringi`
+*   `void(* glCopyBufferSubData`
+*   `void(* glGetUniformIndices`
+*   `void(* glGetActiveUniformsiv`
+*   `SbGlUInt32(* glGetUniformBlockIndex`
+*   `void(* glGetActiveUniformBlockiv`
+*   `void(* glGetActiveUniformBlockName`
+*   `void(* glUniformBlockBinding`
+*   `void(* glDrawArraysInstanced`
+*   `void(* glDrawElementsInstanced`
+*   `SbGlSync(* glFenceSync`
+*   `SbGlBoolean(* glIsSync`
+*   `void(* glDeleteSync`
+*   `SbGlEnum(* glClientWaitSync`
+*   `void(* glWaitSync`
+*   `void(* glGetInteger64v`
+*   `void(* glGetSynciv`
+*   `void(* glGetInteger64i_v`
+*   `void(* glGetBufferParameteri64v`
+*   `void(* glGenSamplers`
+*   `void(* glDeleteSamplers`
+*   `SbGlBoolean(* glIsSampler`
+*   `void(* glBindSampler`
+*   `void(* glSamplerParameteri`
+*   `void(* glSamplerParameteriv`
+*   `void(* glSamplerParameterf`
+*   `void(* glSamplerParameterfv`
+*   `void(* glGetSamplerParameteriv`
+*   `void(* glGetSamplerParameterfv`
+*   `void(* glVertexAttribDivisor`
+*   `void(* glBindTransformFeedback`
+*   `void(* glDeleteTransformFeedbacks`
+*   `void(* glGenTransformFeedbacks`
+*   `SbGlBoolean(* glIsTransformFeedback`
+*   `void(* glPauseTransformFeedback`
+*   `void(* glResumeTransformFeedback`
+*   `void(* glGetProgramBinary`
+*   `void(* glProgramBinary`
+*   `void(* glProgramParameteri`
+*   `void(* glInvalidateFramebuffer`
+*   `void(* glInvalidateSubFramebuffer`
+*   `void(* glTexStorage2D`
+*   `void(* glTexStorage3D`
+*   `void(* glGetInternalformativ`
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/image.md b/src/cobalt/site/docs/reference/starboard/modules/12/image.md
new file mode 100644
index 0000000..c911e41
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/image.md
@@ -0,0 +1,82 @@
+---
+layout: doc
+title: "Starboard Module Reference: image.h"
+---
+
+API for hardware accelerated image decoding. This module allows for the client
+to feed in raw, encoded data to be decoded directly into an SbDecodeTarget. It
+also provides an interface for the client to query what combinations of encoded
+image formats and SbDecodeTargetFormats are supported or not.
+
+All functions in this module are safe to call from any thread at any point in
+time.
+SbImageIsDecodeSupported and SbImageDecode Example
+
+Let's assume that we're on a Blitter platform.
+
+```
+SbDecodeTargetProvider* provider = GetProviderFromSomewhere();
+void* data = GetCompressedJPEGFromSomewhere();
+int data_size = GetCompressedJPEGSizeFromSomewhere();
+const char* mime_type = "image/jpeg";
+SbDecodeTargetFormat format = kSbDecodeTargetFormat1PlaneRGBA;
+
+if (!SbImageIsDecodeSupported(mime_type, format)) {
+  return;
+}
+
+SbDecodeTarget result_target = SbDecodeImage(provider, data, data_size,
+                                             mime_type, format);
+SbBlitterSurface surface =
+    SbDecodeTargetGetPlane(target, kSbDecodeTargetPlaneRGBA);
+// Do stuff with surface...
+
+```
+
+## Functions ##
+
+### SbImageDecode ###
+
+Attempt to decode encoded `mime_type` image data `data` of size `data_size` into
+an SbDecodeTarget of SbDecodeFormatType `format`, possibly using
+SbDecodeTargetProvider `provider`, if it is non-null. Thus, four following
+scenarios regarding the provider may happen:
+
+1.  The provider is required by the `SbImageDecode` implementation and no
+    provider is given. The implementation should gracefully fail by immediately
+    returning kSbDecodeTargetInvalid.
+
+1.  The provider is required and is passed in. The implementation will proceed
+    forward, using the SbDecodeTarget from the provider.
+
+1.  The provider is not required and is passed in. The provider will NOT be
+    called, and the implementation will proceed to decoding however it desires.
+
+1.  The provider is not required and is not passed in. The implementation will
+    proceed forward.
+
+Thus, it is NOT safe for clients of this API to assume that the `provider` it
+passes in will be called. Finally, if the decode succeeds, a new SbDecodeTarget
+will be allocated. If `mime_type` image decoding for the requested format is not
+supported or the decode fails, kSbDecodeTargetInvalid will be returned, with any
+intermediate allocations being cleaned up in the implementation.
+
+#### Declaration ####
+
+```
+SbDecodeTarget SbImageDecode(SbDecodeTargetGraphicsContextProvider *context_provider, void *data, int data_size, const char *mime_type, SbDecodeTargetFormat format)
+```
+
+### SbImageIsDecodeSupported ###
+
+Whether the current platform supports hardware accelerated decoding an image of
+mime type `mime_type` into SbDecodeTargetFormat `format`. The result of this
+function must not change over the course of the program, which means that the
+results of this function may be cached indefinitely.
+
+#### Declaration ####
+
+```
+bool SbImageIsDecodeSupported(const char *mime_type, SbDecodeTargetFormat format)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/input.md b/src/cobalt/site/docs/reference/starboard/modules/12/input.md
new file mode 100644
index 0000000..3554af6
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/input.md
@@ -0,0 +1,178 @@
+---
+layout: doc
+title: "Starboard Module Reference: input.h"
+---
+
+Defines input events and associated data types.
+
+## Enums ##
+
+### SbInputDeviceType ###
+
+Identifies possible input subsystem types. The types of events that each device
+type produces correspond to `SbInputEventType` values.
+
+#### Values ####
+
+*   `kSbInputDeviceTypeGesture`
+
+    Input from a gesture-detection mechanism. Examples include Kinect, Wiimotes,
+    etc...
+
+    Produces `Move`, `Press` and `Unpress` events.
+*   `kSbInputDeviceTypeGamepad`
+
+    Input from a gamepad, following the layout provided in the W3C Web Gamepad
+    API. [ [https://www.w3.org/TR/gamepad/](https://www.w3.org/TR/gamepad/) ]
+
+    Produces `Move`, `Press` and `Unpress` events.
+*   `kSbInputDeviceTypeKeyboard`
+
+    Keyboard input from a traditional keyboard or game controller chatpad.
+
+    Produces `Press` and `Unpress` events.
+*   `kSbInputDeviceTypeMouse`
+
+    Input from a traditional mouse.
+
+    Produces `Move`, `Press`, and `Unpress` events.
+*   `kSbInputDeviceTypeRemote`
+
+    Input from a TV remote-control-style device.
+
+    Produces `Press` and `Unpress` events.
+*   `kSbInputDeviceTypeTouchScreen`
+
+    Input from a single- or multi-touchscreen.
+
+    Produces `Move`, `Press`, and `Unpress` events.
+*   `kSbInputDeviceTypeTouchPad`
+
+    Input from a touchpad that is not masquerading as a mouse.
+
+    Produces `Move`, `Press`, and `Unpress` events.
+*   `kSbInputDeviceTypeOnScreenKeyboard`
+
+    Keyboard input from an on screen keyboard.
+
+    Produces `Input` events.
+
+### SbInputEventType ###
+
+The action that an input event represents.
+
+#### Values ####
+
+*   `kSbInputEventTypeMove`
+
+    Device Movement. In the case of `Mouse`, and perhaps `Gesture`, the movement
+    tracks an absolute cursor position. In the case of `TouchPad`, only relative
+    movements are provided.
+*   `kSbInputEventTypePress`
+
+    Key or button press activation. This could be a key on a keyboard, a button
+    on a mouse or game controller, a push from a touch screen, or a gesture. An
+    `Unpress` event is subsequently delivered when the `Press` event terminates,
+    such as when the key/button/finger is raised. Injecting repeat presses is up
+    to the client.
+*   `kSbInputEventTypeUnpress`
+
+    Key or button deactivation. The counterpart to the `Press` event, this event
+    is sent when the key or button being pressed is released.
+*   `kSbInputEventTypeWheel`
+
+    Wheel movement. Provides relative movements of the `Mouse` wheel.
+*   `kSbInputEventTypeInput`
+
+    [https://w3c.github.io/uievents/#event-type-input](https://w3c.github.io/uievents/#event-type-input)
+
+## Structs ##
+
+### SbInputData ###
+
+Event data for `kSbEventTypeInput` events.
+
+#### Members ####
+
+*   `SbTimeMonotonic timestamp`
+
+    The time that should be reported for this event. This is intended to
+    facilitate calculation of time-sensitive information (e.g. velocity for
+    kSbInputEventTypeMove). This may be set to 0 to have the relevant systems
+    automatically set the timestamp. However, this may happen at a later time,
+    so the relative time between events may not be preserved.
+*   `SbWindow window`
+
+    The window in which the input was generated.
+*   `SbInputEventType type`
+
+    The type of input event that this represents.
+*   `SbInputDeviceType device_type`
+
+    The type of device that generated this input event.
+*   `int device_id`
+
+    An identifier that is unique among all connected devices.
+*   `SbKey key`
+
+    An identifier that indicates which keyboard key or mouse button was involved
+    in this event, if any. All known keys for all devices are mapped to a single
+    ID space, defined by the `SbKey` enum in `key.h`.
+*   `wchar_t character`
+
+    The character that corresponds to the key. For an external keyboard, this
+    character also depends on the keyboard language. The value is `0` if there
+    is no corresponding character.
+*   `SbKeyLocation key_location`
+
+    The location of the specified key, in cases where there are multiple
+    instances of the button on the keyboard. For example, some keyboards have
+    more than one "shift" key.
+*   `unsigned int key_modifiers`
+
+    Key modifiers (e.g. `Ctrl`, `Shift`) held down during this input event.
+*   `SbInputVector position`
+
+    The (x, y) coordinates of the persistent cursor controlled by this device.
+    The value is `0` if this data is not applicable. For events with type
+    kSbInputEventTypeMove and device_type kSbInputDeviceTypeGamepad, this field
+    is interpreted as a stick position with the range [-1, 1], with positive
+    values for the down and right direction.
+*   `SbInputVector delta`
+
+    The relative motion vector of this input. The value is `0` if this data is
+    not applicable.
+*   `float pressure`
+
+    The normalized pressure of the pointer input in the range of [0,1], where 0
+    and 1 represent the minimum and maximum pressure the hardware is capable of
+    detecting, respectively. Use NaN for devices that do not report pressure.
+    This value is used for input events with device type mouse or touch screen.
+*   `SbInputVector size`
+
+    The (width, height) of the contact geometry of the pointer. This defines the
+    size of the area under the pointer position. If (NaN, NaN) is specified, the
+    value (0,0) will be used. This value is used for input events with device
+    type mouse or touch screen.
+*   `SbInputVector tilt`
+
+    The (x, y) angle in degrees, in the range of [-90, 90] of the pointer,
+    relative to the z axis. Positive values are for tilt to the right (x), and
+    towards the user (y). Use (NaN, NaN) for devices that do not report tilt.
+    This value is used for input events with device type mouse or touch screen.
+*   `const char * input_text`
+
+    The text to input for events of type `Input`.
+*   `bool is_composing`
+
+    Set to true if the input event is part of a composition event.
+
+### SbInputVector ###
+
+A 2-dimensional vector used to represent points and motion vectors.
+
+#### Members ####
+
+*   `float x`
+*   `float y`
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/key.md b/src/cobalt/site/docs/reference/starboard/modules/12/key.md
new file mode 100644
index 0000000..16be3c1
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/key.md
@@ -0,0 +1,293 @@
+---
+layout: doc
+title: "Starboard Module Reference: key.h"
+---
+
+Defines the canonical set of Starboard key codes.
+
+## Enums ##
+
+### SbKey ###
+
+A standard set of key codes, ordered by value, that represent each possible
+input key across all kinds of devices. Starboard uses the semi-standard Windows
+virtual key codes documented at: [https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731%28v=vs.85%29.aspx](https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731%28v=vs.85%29.aspx)
+
+#### Values ####
+
+*   `kSbKeyUnknown`
+*   `kSbKeyCancel`
+*   `kSbKeyBackspace`
+*   `kSbKeyBack`
+*   `kSbKeyTab`
+
+    semantic "back".
+*   `kSbKeyBacktab`
+*   `kSbKeyClear`
+*   `kSbKeyReturn`
+*   `kSbKeyShift`
+*   `kSbKeyControl`
+*   `kSbKeyMenu`
+*   `kSbKeyPause`
+*   `kSbKeyCapital`
+*   `kSbKeyKana`
+*   `kSbKeyHangul`
+*   `kSbKeyJunja`
+*   `kSbKeyFinal`
+*   `kSbKeyHanja`
+*   `kSbKeyKanji`
+*   `kSbKeyEscape`
+*   `kSbKeyConvert`
+*   `kSbKeyNonconvert`
+*   `kSbKeyAccept`
+*   `kSbKeyModechange`
+*   `kSbKeySpace`
+*   `kSbKeyPrior`
+*   `kSbKeyNext`
+*   `kSbKeyEnd`
+*   `kSbKeyHome`
+*   `kSbKeyLeft`
+*   `kSbKeyUp`
+*   `kSbKeyRight`
+*   `kSbKeyDown`
+*   `kSbKeySelect`
+*   `kSbKeyPrint`
+*   `kSbKeyExecute`
+*   `kSbKeySnapshot`
+*   `kSbKeyInsert`
+*   `kSbKeyDelete`
+*   `kSbKeyHelp`
+*   `kSbKey0`
+*   `kSbKey1`
+*   `kSbKey2`
+*   `kSbKey3`
+*   `kSbKey4`
+*   `kSbKey5`
+*   `kSbKey6`
+*   `kSbKey7`
+*   `kSbKey8`
+*   `kSbKey9`
+*   `kSbKeyA`
+*   `kSbKeyB`
+*   `kSbKeyC`
+*   `kSbKeyD`
+*   `kSbKeyE`
+*   `kSbKeyF`
+*   `kSbKeyG`
+*   `kSbKeyH`
+*   `kSbKeyI`
+*   `kSbKeyJ`
+*   `kSbKeyK`
+*   `kSbKeyL`
+*   `kSbKeyM`
+*   `kSbKeyN`
+*   `kSbKeyO`
+*   `kSbKeyP`
+*   `kSbKeyQ`
+*   `kSbKeyR`
+*   `kSbKeyS`
+*   `kSbKeyT`
+*   `kSbKeyU`
+*   `kSbKeyV`
+*   `kSbKeyW`
+*   `kSbKeyX`
+*   `kSbKeyY`
+*   `kSbKeyZ`
+*   `kSbKeyLwin`
+*   `kSbKeyCommand`
+*   `kSbKeyRwin`
+*   `kSbKeyApps`
+*   `kSbKeySleep`
+*   `kSbKeyNumpad0`
+*   `kSbKeyNumpad1`
+*   `kSbKeyNumpad2`
+*   `kSbKeyNumpad3`
+*   `kSbKeyNumpad4`
+*   `kSbKeyNumpad5`
+*   `kSbKeyNumpad6`
+*   `kSbKeyNumpad7`
+*   `kSbKeyNumpad8`
+*   `kSbKeyNumpad9`
+*   `kSbKeyMultiply`
+*   `kSbKeyAdd`
+*   `kSbKeySeparator`
+*   `kSbKeySubtract`
+*   `kSbKeyDecimal`
+*   `kSbKeyDivide`
+*   `kSbKeyF1`
+*   `kSbKeyF2`
+*   `kSbKeyF3`
+*   `kSbKeyF4`
+*   `kSbKeyF5`
+*   `kSbKeyF6`
+*   `kSbKeyF7`
+*   `kSbKeyF8`
+*   `kSbKeyF9`
+*   `kSbKeyF10`
+*   `kSbKeyF11`
+*   `kSbKeyF12`
+*   `kSbKeyF13`
+*   `kSbKeyF14`
+*   `kSbKeyF15`
+*   `kSbKeyF16`
+*   `kSbKeyF17`
+*   `kSbKeyF18`
+*   `kSbKeyF19`
+*   `kSbKeyF20`
+*   `kSbKeyF21`
+*   `kSbKeyF22`
+*   `kSbKeyF23`
+*   `kSbKeyF24`
+*   `kSbKeyNumlock`
+*   `kSbKeyScroll`
+*   `kSbKeyWlan`
+*   `kSbKeyPower`
+*   `kSbKeyLshift`
+*   `kSbKeyRshift`
+*   `kSbKeyLcontrol`
+*   `kSbKeyRcontrol`
+*   `kSbKeyLmenu`
+*   `kSbKeyRmenu`
+*   `kSbKeyBrowserBack`
+*   `kSbKeyBrowserForward`
+*   `kSbKeyBrowserRefresh`
+*   `kSbKeyBrowserStop`
+*   `kSbKeyBrowserSearch`
+*   `kSbKeyBrowserFavorites`
+*   `kSbKeyBrowserHome`
+*   `kSbKeyVolumeMute`
+*   `kSbKeyVolumeDown`
+*   `kSbKeyVolumeUp`
+*   `kSbKeyMediaNextTrack`
+*   `kSbKeyMediaPrevTrack`
+*   `kSbKeyMediaStop`
+*   `kSbKeyMediaPlayPause`
+*   `kSbKeyMediaLaunchMail`
+*   `kSbKeyMediaLaunchMediaSelect`
+*   `kSbKeyMediaLaunchApp1`
+*   `kSbKeyMediaLaunchApp2`
+*   `kSbKeyOem1`
+*   `kSbKeyOemPlus`
+*   `kSbKeyOemComma`
+*   `kSbKeyOemMinus`
+*   `kSbKeyOemPeriod`
+*   `kSbKeyOem2`
+*   `kSbKeyOem3`
+*   `kSbKeyBrightnessDown`
+*   `kSbKeyBrightnessUp`
+*   `kSbKeyKbdBrightnessDown`
+*   `kSbKeyOem4`
+*   `kSbKeyOem5`
+*   `kSbKeyOem6`
+*   `kSbKeyOem7`
+*   `kSbKeyOem8`
+*   `kSbKeyOem102`
+*   `kSbKeyKbdBrightnessUp`
+*   `kSbKeyDbeSbcschar`
+*   `kSbKeyDbeDbcschar`
+*   `kSbKeyPlay`
+*   `kSbKeyMediaRewind`
+
+    Other supported CEA 2014 keys.
+*   `kSbKeyMediaFastForward`
+*   `kSbKeyRed`
+
+    Key codes from the DTV Application Software Environment, [http://www.atsc.org/wp-content/uploads/2015/03/a_100_4.pdf](http://www.atsc.org/wp-content/uploads/2015/03/a_100_4.pdf)
+*   `kSbKeyGreen`
+*   `kSbKeyYellow`
+*   `kSbKeyBlue`
+*   `kSbKeyChannelUp`
+*   `kSbKeyChannelDown`
+*   `kSbKeySubtitle`
+*   `kSbKeyClosedCaption`
+*   `kSbKeyInfo`
+*   `kSbKeyGuide`
+*   `kSbKeyLast`
+
+    Key codes from OCAP, [https://apps.cablelabs.com/specification/opencable-application-platform-ocap/](https://apps.cablelabs.com/specification/opencable-application-platform-ocap/)
+*   `kSbKeyPreviousChannel`
+*   `kSbKeyInstantReplay`
+
+    Also from OCAP
+*   `kSbKeyLaunchThisApplication`
+
+    A button that will directly launch the current application.
+*   `kSbKeyMediaAudioTrack`
+
+    A button that will switch between different available audio tracks.
+*   `kSbKeyMicrophone`
+
+    A button that will trigger voice input.
+*   `kSbKeyMouse1`
+
+    Mouse buttons, starting with the left mouse button.
+*   `kSbKeyMouse2`
+*   `kSbKeyMouse3`
+*   `kSbKeyMouse4`
+*   `kSbKeyMouse5`
+*   `kSbKeyGamepad1`
+
+    Xbox A, PS O or X (depending on region), Switch A
+*   `kSbKeyGamepad2`
+
+    Xbox B, PS X or O (depending on region), Switch B
+*   `kSbKeyGamepad3`
+
+    Xbox X, PS square, Switch X
+*   `kSbKeyGamepad4`
+
+    Xbox Y, PS triangle, Switch Y
+*   `kSbKeyGamepadLeftBumper`
+
+    Pretty much every gamepad has bumpers at the top front of the controller,
+    and triggers at the bottom front of the controller.
+*   `kSbKeyGamepadRightBumper`
+*   `kSbKeyGamepadLeftTrigger`
+*   `kSbKeyGamepadRightTrigger`
+*   `kSbKeyGamepad5`
+
+    Xbox 360 Back, XB1 minimize, PS and WiiU Select
+*   `kSbKeyGamepad6`
+
+    Xbox 360 Play, XB1 Menu, PS and WiiU Start
+*   `kSbKeyGamepadLeftStick`
+
+    This refers to pressing the left stick like a button.
+*   `kSbKeyGamepadRightStick`
+
+    This refers to pressing the right stick like a button.
+*   `kSbKeyGamepadDPadUp`
+*   `kSbKeyGamepadDPadDown`
+*   `kSbKeyGamepadDPadLeft`
+*   `kSbKeyGamepadDPadRight`
+*   `kSbKeyGamepadSystem`
+
+    The system key in the middle of the gamepad, if it exists.
+*   `kSbKeyGamepadLeftStickUp`
+
+    Codes for thumbstick to virtual dpad conversions.
+*   `kSbKeyGamepadLeftStickDown`
+*   `kSbKeyGamepadLeftStickLeft`
+*   `kSbKeyGamepadLeftStickRight`
+*   `kSbKeyGamepadRightStickUp`
+*   `kSbKeyGamepadRightStickDown`
+*   `kSbKeyGamepadRightStickLeft`
+*   `kSbKeyGamepadRightStickRight`
+
+### SbKeyModifiers ###
+
+Bit-mask of key modifiers.
+
+#### Values ####
+
+*   `kSbKeyModifiersNone`
+*   `kSbKeyModifiersAlt`
+*   `kSbKeyModifiersCtrl`
+*   `kSbKeyModifiersMeta`
+*   `kSbKeyModifiersShift`
+*   `kSbKeyModifiersPointerButtonLeft`
+*   `kSbKeyModifiersPointerButtonRight`
+*   `kSbKeyModifiersPointerButtonMiddle`
+*   `kSbKeyModifiersPointerButtonBack`
+*   `kSbKeyModifiersPointerButtonForward`
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/log.md b/src/cobalt/site/docs/reference/starboard/modules/12/log.md
new file mode 100644
index 0000000..1ad6c24
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/log.md
@@ -0,0 +1,137 @@
+---
+layout: doc
+title: "Starboard Module Reference: log.h"
+---
+
+Defines core debug logging functions.
+
+## Enums ##
+
+### SbLogPriority ###
+
+The priority at which a message should be logged. The platform may be configured
+to filter logs by priority, or render them differently.
+
+#### Values ####
+
+*   `kSbLogPriorityUnknown`
+*   `kSbLogPriorityInfo`
+*   `kSbLogPriorityWarning`
+*   `kSbLogPriorityError`
+*   `kSbLogPriorityFatal`
+
+## Functions ##
+
+### SbLog ###
+
+Writes `message` to the platform's debug output log. This method is thread-safe,
+and responsible for ensuring that the output from multiple threads is not mixed.
+
+`priority`: The SbLogPriority at which the message should be logged. Note that
+passing `kSbLogPriorityFatal` does not terminate the program. Such a policy must
+be enforced at the application level. In fact, `priority` may be completely
+ignored on many platforms. `message`: The message to be logged. No formatting is
+required to be done on the value, including newline termination. That said,
+platforms can adjust the message to be more suitable for their output method by
+wrapping the text, stripping unprintable characters, etc.
+
+#### Declaration ####
+
+```
+void SbLog(SbLogPriority priority, const char *message)
+```
+
+### SbLogFlush ###
+
+Flushes the log buffer on some platforms. This method is safe to call from
+multiple threads.
+
+#### Declaration ####
+
+```
+void SbLogFlush()
+```
+
+### SbLogFormat ###
+
+A log output method that additionally performs a string format on the data being
+logged.
+
+#### Declaration ####
+
+```
+void SbLogFormat(const char *format, va_list args) SB_PRINTF_FORMAT(1
+```
+
+### SbLogFormatF ###
+
+Inline wrapper of SbLogFormat that converts from ellipsis to va_args.
+
+#### Declaration ####
+
+```
+void static void void SbLogFormatF(const char *format,...) SB_PRINTF_FORMAT(1
+```
+
+### SbLogIsTty ###
+
+Indicates whether the log output goes to a TTY or is being redirected.
+
+#### Declaration ####
+
+```
+bool SbLogIsTty()
+```
+
+### SbLogRaw ###
+
+A bare-bones log output method that is async-signal-safe, i.e. safe to call from
+an asynchronous signal handler (e.g. a `SIGSEGV` handler). It should not do any
+additional formatting.
+
+`message`: The message to be logged.
+
+#### Declaration ####
+
+```
+void SbLogRaw(const char *message)
+```
+
+### SbLogRawDumpStack ###
+
+Dumps the stack of the current thread to the log in an async-signal-safe manner,
+i.e. safe to call from an asynchronous signal handler (e.g. a `SIGSEGV`
+handler). Does not include SbLogRawDumpStack itself.
+
+`frames_to_skip`: The number of frames to skip from the top of the stack when
+dumping the current thread to the log. This parameter lets you remove noise from
+helper functions that might end up on top of every stack dump so that the stack
+dump is just the relevant function stack where the problem occurred.
+
+#### Declaration ####
+
+```
+void SbLogRawDumpStack(int frames_to_skip)
+```
+
+### SbLogRawFormat ###
+
+A formatted log output method that is async-signal-safe, i.e. safe to call from
+an asynchronous signal handler (e.g. a `SIGSEGV` handler).
+
+#### Declaration ####
+
+```
+void SbLogRawFormat(const char *format, va_list args) SB_PRINTF_FORMAT(1
+```
+
+### SbLogRawFormatF ###
+
+Inline wrapper of SbLogFormat to convert from ellipsis to va_args.
+
+#### Declaration ####
+
+```
+void static void void SbLogRawFormatF(const char *format,...) SB_PRINTF_FORMAT(1
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/media.md b/src/cobalt/site/docs/reference/starboard/modules/12/media.md
new file mode 100644
index 0000000..8d94612
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/media.md
@@ -0,0 +1,720 @@
+---
+layout: doc
+title: "Starboard Module Reference: media.h"
+---
+
+Provides media definitions that are common between the Decoder and Player
+interfaces.
+
+## Macros ##
+
+### kSbMediaBitsPerPixelInvalid ###
+
+Value used when a video's bits per pixel is not known.
+
+### kSbMediaVideoResolutionDimensionInvalid ###
+
+Value used when a video's resolution is not known.
+
+## Enums ##
+
+### SbMediaAudioCodec ###
+
+Types of audio elementary streams that can be supported.
+
+#### Values ####
+
+*   `kSbMediaAudioCodecNone`
+*   `kSbMediaAudioCodecAac`
+*   `kSbMediaAudioCodecAc3`
+*   `kSbMediaAudioCodecEac3`
+*   `kSbMediaAudioCodecOpus`
+*   `kSbMediaAudioCodecVorbis`
+
+### SbMediaAudioCodingType ###
+
+Possible audio coding types.
+
+#### Values ####
+
+*   `kSbMediaAudioCodingTypeNone`
+*   `kSbMediaAudioCodingTypeAac`
+*   `kSbMediaAudioCodingTypeAc3`
+*   `kSbMediaAudioCodingTypeAtrac`
+*   `kSbMediaAudioCodingTypeBitstream`
+*   `kSbMediaAudioCodingTypeDolbyDigitalPlus`
+*   `kSbMediaAudioCodingTypeDts`
+*   `kSbMediaAudioCodingTypeMpeg1`
+*   `kSbMediaAudioCodingTypeMpeg2`
+*   `kSbMediaAudioCodingTypeMpeg3`
+*   `kSbMediaAudioCodingTypePcm`
+
+### SbMediaAudioConnector ###
+
+Possible audio connector types.
+
+#### Values ####
+
+*   `kSbMediaAudioConnectorNone`
+*   `kSbMediaAudioConnectorAnalog`
+*   `kSbMediaAudioConnectorBluetooth`
+*   `kSbMediaAudioConnectorHdmi`
+*   `kSbMediaAudioConnectorNetwork`
+*   `kSbMediaAudioConnectorSpdif`
+*   `kSbMediaAudioConnectorUsb`
+
+### SbMediaAudioFrameStorageType ###
+
+Possible audio frame storage types.
+
+#### Values ####
+
+*   `kSbMediaAudioFrameStorageTypeInterleaved`
+
+    The samples of a multi-channel audio stream are stored in one continuous
+    buffer. Samples at the same timestamp are stored one after another. For
+    example, for a stereo stream with channels L and R that contains samples
+    with timestamps 0, 1, 2, etc., the samples are stored in one buffer as "L0
+    R0 L1 R1 L2 R2 ...".
+*   `kSbMediaAudioFrameStorageTypePlanar`
+
+    The samples of each channel are stored in their own continuous buffer. For
+    example, for a stereo stream with channels L and R that contains samples
+    with timestamps 0, 1, 2, etc., the samples are stored in two buffers "L0 L1
+    L2 ..." and "R0 R1 R2 ...".
+
+### SbMediaAudioSampleType ###
+
+Possible audio sample types.
+
+#### Values ####
+
+*   `kSbMediaAudioSampleTypeInt16Deprecated`
+*   `kSbMediaAudioSampleTypeFloat32`
+
+### SbMediaRangeId ###
+
+This corresponds to the WebM Range enum which is part of WebM color data (see [http://www.webmproject.org/docs/container/#Range](http://www.webmproject.org/docs/container/#Range)
+). H.264 only uses a bool, which corresponds to the LIMITED/FULL values. Chrome-
+specific values start at 1000.
+
+#### Values ####
+
+*   `kSbMediaRangeIdUnspecified`
+
+    Range is not explicitly specified / unknown.
+*   `kSbMediaRangeIdLimited`
+
+    Limited Rec. 709 color range with RGB values ranging from 16 to 235.
+*   `kSbMediaRangeIdFull`
+
+    Full RGB color range with RGB valees from 0 to 255.
+*   `kSbMediaRangeIdDerived`
+
+    Range is defined by TransferId/MatrixId.
+*   `kSbMediaRangeIdLast`
+
+### SbMediaSupportType ###
+
+Indicates how confident the device is that it can play media resources of the
+given type. The values are a direct map of the canPlayType() method specified at
+the following link: [https://www.w3.org/TR/2011/WD-html5-20110113/video.html#dom-navigator-canplaytype](https://www.w3.org/TR/2011/WD-html5-20110113/video.html#dom-navigator-canplaytype)
+
+#### Values ####
+
+*   `kSbMediaSupportTypeNotSupported`
+
+    The media type cannot be played.
+*   `kSbMediaSupportTypeMaybe`
+
+    Cannot determinate if the media type is playable without playing it.
+*   `kSbMediaSupportTypeProbably`
+
+    The media type seems to be playable.
+
+### SbMediaType ###
+
+Types of media component streams.
+
+#### Values ####
+
+*   `kSbMediaTypeAudio`
+
+    Value used for audio streams.
+*   `kSbMediaTypeVideo`
+
+    Value used for video streams.
+
+### SbMediaVideoCodec ###
+
+Types of video elementary streams that could be supported.
+
+#### Values ####
+
+*   `kSbMediaVideoCodecNone`
+*   `kSbMediaVideoCodecH264`
+*   `kSbMediaVideoCodecH265`
+*   `kSbMediaVideoCodecMpeg2`
+*   `kSbMediaVideoCodecTheora`
+*   `kSbMediaVideoCodecVc1`
+*   `kSbMediaVideoCodecAv1`
+*   `kSbMediaVideoCodecVp8`
+*   `kSbMediaVideoCodecVp9`
+
+## Structs ##
+
+### SbMediaAudioConfiguration ###
+
+A structure describing the audio configuration parameters of a single audio
+output.
+
+#### Members ####
+
+*   `int index`
+
+    The platform-defined index of the associated audio output.
+*   `SbMediaAudioConnector connector`
+
+    The type of audio connector. Will be the empty `kSbMediaAudioConnectorNone`
+    if this device cannot provide this information.
+*   `SbTime latency`
+
+    The expected latency of audio over this output, in microseconds, or `0` if
+    this device cannot provide this information.
+*   `SbMediaAudioCodingType coding_type`
+
+    The type of audio coding used over this connection.
+*   `int number_of_channels`
+
+    The number of audio channels currently supported by this device output, or
+    `0` if this device cannot provide this information, in which case the caller
+    can probably assume stereo output.
+
+### SbMediaAudioSampleInfo ###
+
+An audio sample info, which is a description of a given audio sample. This, in
+hexadecimal string form, acts as a set of instructions to the audio decoder.
+
+The audio sample info consists of a little-endian hexadecimal encoded
+`WAVEFORMATEX` structure followed by an Audio-specific configuration field. The
+`WAVEFORMATEX` structure is specified at: [http://msdn.microsoft.com/en-us/library/dd390970(v=vs.85).aspx](http://msdn.microsoft.com/en-us/library/dd390970(v=vs.85).aspx)
+
+#### Members ####
+
+*   `SbMediaAudioCodec codec`
+
+    The audio codec of this sample.
+*   `const char * mime`
+
+    The mime of the audio stream when `codec` isn't kSbMediaAudioCodecNone. It
+    may point to an empty string if the mime is not available, and it can only
+    be set to NULL when `codec` is kSbMediaAudioCodecNone.
+*   `uint16_t format_tag`
+
+    The waveform-audio format type code.
+*   `uint16_t number_of_channels`
+
+    The number of audio channels in this format. `1` for mono, `2` for stereo.
+*   `uint32_t samples_per_second`
+
+    The sampling rate.
+*   `uint32_t average_bytes_per_second`
+
+    The number of bytes per second expected with this format.
+*   `uint16_t block_alignment`
+
+    Byte block alignment, e.g, 4.
+*   `uint16_t bits_per_sample`
+
+    The bit depth for the stream this represents, e.g. `8` or `16`.
+*   `uint16_t audio_specific_config_size`
+
+    The size, in bytes, of the audio_specific_config.
+*   `const void * audio_specific_config`
+
+    The AudioSpecificConfig, as specified in ISO/IEC-14496-3, section 1.6.2.1: [http://read.pudn.com/downloads98/doc/comm/401153/14496/ISO_IEC_14496-3%20Part%203%20Audio/C036083E_SUB1.PDF](http://read.pudn.com/downloads98/doc/comm/401153/14496/ISO_IEC_14496-3%20Part%203%20Audio/C036083E_SUB1.PDF)
+
+### SbMediaColorMetadata ###
+
+HDR (High Dynamic Range) Metadata common for HDR10 and WebM/VP9-based HDR
+formats, together with the ColorSpace. HDR reproduces a greater dynamic range of
+luminosity than is possible with standard digital imaging. See the Consumer
+Electronics Association press release: [https://www.cta.tech/News/Press-Releases/2015/August/CEA-Defines-%E2%80%98HDR-Compatible%E2%80%99-Displays.aspx](https://www.cta.tech/News/Press-Releases/2015/August/CEA-Defines-%E2%80%98HDR-Compatible%E2%80%99-Displays.aspx)
+
+#### Members ####
+
+*   `unsigned int bits_per_channel`
+
+    Number of decoded bits per channel. A value of 0 indicates that the
+    BitsPerChannel is unspecified.
+*   `unsigned int chroma_subsampling_horizontal`
+
+    The amount of pixels to remove in the Cr and Cb channels for every pixel not
+    removed horizontally. Example: For video with 4:2:0 chroma subsampling, the
+    `chroma_subsampling_horizontal` should be set to 1.
+*   `unsigned int chroma_subsampling_vertical`
+
+    The amount of pixels to remove in the Cr and Cb channels for every pixel not
+    removed vertically. Example: For video with 4:2:0 chroma subsampling, the
+    `chroma_subsampling_vertical` should be set to 1.
+*   `unsigned int cb_subsampling_horizontal`
+
+    The amount of pixels to remove in the Cb channel for every pixel not removed
+    horizontally. This is additive with ChromaSubsamplingHorz. Example: For
+    video with 4:2:1 chroma subsampling, the `chroma_subsampling_horizontal`
+    should be set to 1 and `cb_subsampling_horizontal` should be set to 1.
+*   `unsigned int cb_subsampling_vertical`
+
+    The amount of pixels to remove in the Cb channel for every pixel not removed
+    vertically. This is additive with `chroma_subsampling_vertical`.
+*   `unsigned int chroma_siting_horizontal`
+
+    How chroma is subsampled horizontally. (0: Unspecified, 1: Left Collocated,
+    2: Half)
+*   `unsigned int chroma_siting_vertical`
+
+    How chroma is subsampled vertically. (0: Unspecified, 1: Top Collocated, 2:
+    Half)
+*   `SbMediaMasteringMetadata mastering_metadata`
+
+    [HDR Metadata field] SMPTE 2086 mastering data.
+*   `unsigned int max_cll`
+
+    [HDR Metadata field] Maximum brightness of a single pixel (Maximum Content
+    Light Level) in candelas per square meter (cd/m^2).
+*   `unsigned int max_fall`
+
+    [HDR Metadata field] Maximum brightness of a single full frame (Maximum
+    Frame-Average Light Level) in candelas per square meter (cd/m^2).
+*   `SbMediaPrimaryId primaries`
+
+    [Color Space field] The colour primaries of the video. For clarity, the
+    value and meanings for Primaries are adopted from Table 2 of ISO/IEC
+    23001-8:2013/DCOR1. (0: Reserved, 1: ITU-R BT.709, 2: Unspecified, 3:
+    Reserved, 4: ITU-R BT.470M, 5: ITU-R BT.470BG, 6: SMPTE 170M, 7: SMPTE 240M,
+    8: FILM, 9: ITU-R BT.2020, 10: SMPTE ST 428-1, 22: JEDEC P22 phosphors)
+*   `SbMediaTransferId transfer`
+
+    [Color Space field] The transfer characteristics of the video. For clarity,
+    the value and meanings for TransferCharacteristics 1-15 are adopted from
+    Table 3 of ISO/IEC 23001-8:2013/DCOR1. TransferCharacteristics 16-18 are
+    proposed values. (0: Reserved, 1: ITU-R BT.709, 2: Unspecified, 3: Reserved,
+    4: Gamma 2.2 curve, 5: Gamma 2.8 curve, 6: SMPTE 170M, 7: SMPTE 240M, 8:
+    Linear, 9: Log, 10: Log Sqrt, 11: IEC 61966-2-4, 12: ITU-R BT.1361 Extended
+    Colour Gamut, 13: IEC 61966-2-1, 14: ITU-R BT.2020 10 bit, 15: ITU-R BT.2020
+    12 bit, 16: SMPTE ST 2084, 17: SMPTE ST 428-1 18: ARIB STD-B67 (HLG))
+*   `SbMediaMatrixId matrix`
+
+    [Color Space field] The Matrix Coefficients of the video used to derive luma
+    and chroma values from red, green, and blue color primaries. For clarity,
+    the value and meanings for MatrixCoefficients are adopted from Table 4 of
+    ISO/IEC 23001-8:2013/DCOR1. (0:GBR, 1: BT709, 2: Unspecified, 3: Reserved,
+    4: FCC, 5: BT470BG, 6: SMPTE 170M, 7: SMPTE 240M, 8: YCOCG, 9: BT2020 Non-
+    constant Luminance, 10: BT2020 Constant Luminance)
+*   `SbMediaRangeId range`
+
+    [Color Space field] Clipping of the color ranges. (0: Unspecified, 1:
+    Broadcast Range, 2: Full range (no clipping), 3: Defined by
+    MatrixCoefficients/TransferCharacteristics)
+*   `float custom_primary_matrix`
+
+    [Color Space field] Only used if primaries == kSbMediaPrimaryIdCustom. This
+    a row-major ordered 3 x 4 submatrix of the 4 x 4 transform matrix. The 4th
+    row is completed as (0, 0, 0, 1).
+
+### SbMediaMasteringMetadata ###
+
+SMPTE 2086 mastering data [http://ieeexplore.ieee.org/document/7291707/](http://ieeexplore.ieee.org/document/7291707/)
+This standard specifies the metadata items to specify the color volume (the
+color primaries, white point, and luminance range) of the display that was used
+in mastering video content. The metadata is specified as a set of values
+independent of any specific digital representation. Also see the WebM container
+guidelines: [https://www.webmproject.org/docs/container/](https://www.webmproject.org/docs/container/)
+
+#### Members ####
+
+*   `float primary_r_chromaticity_x`
+
+    Red X chromaticity coordinate as defined by CIE 1931. In range [0, 1].
+*   `float primary_r_chromaticity_y`
+
+    Red Y chromaticity coordinate as defined by CIE 1931. In range [0, 1].
+*   `float primary_g_chromaticity_x`
+
+    Green X chromaticity coordinate as defined by CIE 1931. In range [0, 1].
+*   `float primary_g_chromaticity_y`
+
+    Green Y chromaticity coordinate as defined by CIE 1931. In range [0, 1].
+*   `float primary_b_chromaticity_x`
+
+    Blue X chromaticity coordinate as defined by CIE 1931. In range [0, 1].
+*   `float primary_b_chromaticity_y`
+
+    Blue Y chromaticity coordinate as defined by CIE 1931. In range [0, 1].
+*   `float white_point_chromaticity_x`
+
+    White X chromaticity coordinate as defined by CIE 1931. In range [0, 1].
+*   `float white_point_chromaticity_y`
+
+    White Y chromaticity coordinate as defined by CIE 1931. In range [0, 1].
+*   `float luminance_max`
+
+    Maximum luminance. Shall be represented in candelas per square meter
+    (cd/m^2). In range [0, 9999.99].
+*   `float luminance_min`
+
+    Minimum luminance. Shall be represented in candelas per square meter
+    (cd/m^2). In range [0, 9999.99].
+
+### SbMediaVideoSampleInfo ###
+
+The set of information required by the decoder or player for each video sample.
+
+#### Members ####
+
+*   `SbMediaVideoCodec codec`
+
+    The video codec of this sample.
+*   `const char * mime`
+
+    The mime of the video stream when `codec` isn't kSbMediaVideoCodecNone. It
+    may point to an empty string if the mime is not available, and it can only
+    be set to NULL when `codec` is kSbMediaVideoCodecNone.
+*   `const char * max_video_capabilities`
+
+    Indicates the max video capabilities required. The web app will not provide
+    a video stream exceeding the maximums described by this parameter. Allows
+    the platform to optimize playback pipeline for low quality video streams if
+    it knows that it will never adapt to higher quality streams. The string uses
+    the same format as the string passed in to SbMediaCanPlayMimeAndKeySystem(),
+    for example, when it is set to "width=1920; height=1080; framerate=15;", the
+    video will never adapt to resolution higher than 1920x1080 or frame per
+    second higher than 15 fps. When the maximums are unknown, this will be set
+    to an empty string. It can only be set to NULL when `codec` is
+    kSbMediaVideoCodecNone.
+*   `bool is_key_frame`
+
+    Indicates whether the associated sample is a key frame (I-frame). Video key
+    frames must always start with SPS and PPS NAL units.
+*   `int frame_width`
+
+    The frame width of this sample, in pixels. Also could be parsed from the
+    Sequence Parameter Set (SPS) NAL Unit. Frame dimensions must only change on
+    key frames, but may change on any key frame.
+*   `int frame_height`
+
+    The frame height of this sample, in pixels. Also could be parsed from the
+    Sequence Parameter Set (SPS) NAL Unit. Frame dimensions must only change on
+    key frames, but may change on any key frame.
+*   `SbMediaColorMetadata color_metadata`
+
+    HDR metadata common for HDR10 and WebM/VP9-based HDR formats as well as the
+    Color Space, and Color elements: MatrixCoefficients, BitsPerChannel,
+    ChromaSubsamplingHorz, ChromaSubsamplingVert, CbSubsamplingHorz,
+    CbSubsamplingVert, ChromaSitingHorz, ChromaSitingVert, Range,
+    TransferCharacteristics, and Primaries described here: [https://matroska.org/technical/specs/index.html](https://matroska.org/technical/specs/index.html)
+    . This will only be specified on frames where the HDR metadata and color /
+    color space might have changed (e.g. keyframes).
+
+## Functions ##
+
+### SbMediaCanPlayMimeAndKeySystem ###
+
+Returns information about whether the playback of the specific media described
+by `mime` and encrypted using `key_system` can be played.
+
+Note that neither `mime` nor `key_system` can be NULL. This function returns
+`kSbMediaSupportNotSupported` if either is NULL.
+
+`mime`: The mime information of the media in the form of `video/webm` or
+`video/mp4; codecs="avc1.42001E"`. It may include arbitrary parameters like
+"codecs", "channels", etc. Note that the "codecs" parameter may contain more
+than one codec, delimited by comma. `key_system`: A lowercase value in fhe form
+of "com.example.somesystem" as suggested by [https://w3c.github.io/encrypted-media/#key-system](https://w3c.github.io/encrypted-media/#key-system)) that can
+be matched exactly with known DRM key systems of the platform. When `key_system`
+is an empty string, the return value is an indication for non-encrypted media.
+
+#### Declaration ####
+
+```
+SbMediaSupportType SbMediaCanPlayMimeAndKeySystem(const char *mime, const char *key_system)
+```
+
+### SbMediaGetAudioBufferBudget ###
+
+Specifies the maximum amount of memory used by audio buffers of media source
+before triggering a garbage collection. A large value will cause more memory
+being used by audio buffers but will also make the app less likely to re-
+download audio data. Note that the app may experience significant difficulty if
+this value is too low.
+
+#### Declaration ####
+
+```
+int SbMediaGetAudioBufferBudget()
+```
+
+### SbMediaGetAudioConfiguration ###
+
+Retrieves the current physical audio configuration of audio output
+`output_index` on this device and places it in `out_configuration`, which must
+not be NULL.
+
+This function returns `false` if nothing could be determined on this platform or
+if `output_index` does not exist on this device.
+
+`out_configuration`: The variable that holds the audio configuration
+information.
+
+#### Declaration ####
+
+```
+bool SbMediaGetAudioConfiguration(int output_index, SbMediaAudioConfiguration *out_configuration)
+```
+
+### SbMediaGetAudioOutputCount ###
+
+Returns the number of audio outputs currently available on this device. Even if
+the number of outputs or their audio configurations can't be determined, it is
+expected that the platform will at least return a single output that supports at
+least stereo.
+
+#### Declaration ####
+
+```
+int SbMediaGetAudioOutputCount()
+```
+
+### SbMediaGetBufferAlignment ###
+
+The media buffer will be allocated using the returned alignment. Set this to a
+larger value may increase the memory consumption of media buffers.
+
+`type`: the media type of the stream (audio or video).
+
+#### Declaration ####
+
+```
+int SbMediaGetBufferAlignment(SbMediaType type)
+```
+
+### SbMediaGetBufferAllocationUnit ###
+
+When the media stack needs more memory to store media buffers, it will allocate
+extra memory in units returned by SbMediaGetBufferAllocationUnit. This can
+return 0, in which case the media stack will allocate extra memory on demand.
+When SbMediaGetInitialBufferCapacity and this function both return 0, the media
+stack will allocate individual buffers directly using SbMemory functions.
+
+#### Declaration ####
+
+```
+int SbMediaGetBufferAllocationUnit()
+```
+
+### SbMediaGetBufferGarbageCollectionDurationThreshold ###
+
+Specifies the duration threshold of media source garbage collection. When the
+accumulated duration in a source buffer exceeds this value, the media source
+implementation will try to eject existing buffers from the cache. This is
+usually triggered when the video being played has a simple content and the
+encoded data is small. In such case this can limit how much is allocated for the
+book keeping data of the media buffers and avoid OOM of system heap. This should
+return 170 seconds for most of the platforms. But it can be further reduced on
+systems with extremely low memory.
+
+#### Declaration ####
+
+```
+SbTime SbMediaGetBufferGarbageCollectionDurationThreshold()
+```
+
+### SbMediaGetBufferPadding ###
+
+Extra bytes allocated at the end of a media buffer to ensure that the buffer can
+be use optimally by specific instructions like SIMD. Set to 0 to remove any
+padding.
+
+`type`: the media type of the stream (audio or video).
+
+#### Declaration ####
+
+```
+int SbMediaGetBufferPadding(SbMediaType type)
+```
+
+### SbMediaGetBufferStorageType ###
+
+Returns SbMediaBufferStorageType of type `SbMediaStorageTypeMemory` or
+`SbMediaStorageTypeFile`. For memory storage, the media buffers will be stored
+in main memory allocated by SbMemory functions. For file storage, the media
+buffers will be stored in a temporary file in the system cache folder acquired
+by calling SbSystemGetPath() with "kSbSystemPathCacheDirectory". Note that when
+its value is "file" the media stack will still allocate memory to cache the the
+buffers in use.
+
+#### Declaration ####
+
+```
+SbMediaBufferStorageType SbMediaGetBufferStorageType()
+```
+
+### SbMediaGetInitialBufferCapacity ###
+
+The amount of memory that will be used to store media buffers allocated during
+system startup. To allocate a large chunk at startup helps with reducing
+fragmentation and can avoid failures to allocate incrementally. This can return
+0.
+
+#### Declaration ####
+
+```
+int SbMediaGetInitialBufferCapacity()
+```
+
+### SbMediaGetMaxBufferCapacity ###
+
+The maximum amount of memory that will be used to store media buffers. This must
+be larger than sum of the video budget and audio budget.
+
+`codec`: the video codec associated with the buffer. `resolution_width`: the
+width of the video resolution. `resolution_height`: the height of the video
+resolution. `bits_per_pixel`: the bits per pixel. This value is larger for HDR
+than non- HDR video.
+
+#### Declaration ####
+
+```
+int SbMediaGetMaxBufferCapacity(SbMediaVideoCodec codec, int resolution_width, int resolution_height, int bits_per_pixel)
+```
+
+### SbMediaGetProgressiveBufferBudget ###
+
+The memory used when playing mp4 videos that is not in DASH format. The
+resolution of such videos shouldn't go beyond 1080p. Its value should be less
+than the sum of SbMediaGetAudioBufferBudget and
+'SbMediaGetVideoBufferBudget(..., 1920, 1080, ...) but not less than 8 MB.
+
+`codec`: the video codec associated with the buffer. `resolution_width`: the
+width of the video resolution. `resolution_height`: the height of the video
+resolution. `bits_per_pixel`: the bits per pixel. This value is larger for HDR
+than non- HDR video.
+
+#### Declaration ####
+
+```
+int SbMediaGetProgressiveBufferBudget(SbMediaVideoCodec codec, int resolution_width, int resolution_height, int bits_per_pixel)
+```
+
+### SbMediaGetVideoBufferBudget ###
+
+Specifies the maximum amount of memory used by video buffers of media source
+before triggering a garbage collection. A large value will cause more memory
+being used by video buffers but will also make app less likely to re-download
+video data. Note that the app may experience significant difficulty if this
+value is too low.
+
+`codec`: the video codec associated with the buffer. `resolution_width`: the
+width of the video resolution. `resolution_height`: the height of the video
+resolution. `bits_per_pixel`: the bits per pixel. This value is larger for HDR
+than non- HDR video.
+
+#### Declaration ####
+
+```
+int SbMediaGetVideoBufferBudget(SbMediaVideoCodec codec, int resolution_width, int resolution_height, int bits_per_pixel)
+```
+
+### SbMediaIsBufferPoolAllocateOnDemand ###
+
+When either SbMediaGetInitialBufferCapacity or SbMediaGetBufferAllocationUnit
+isn't zero, media buffers will be allocated using a memory pool. Set the
+following variable to true to allocate the media buffer pool memory on demand
+and return all memory to the system when there is no media buffer allocated.
+Setting the following value to false results in that Cobalt will allocate
+SbMediaGetInitialBufferCapacity bytes for media buffer on startup and will not
+release any media buffer memory back to the system even if there is no media
+buffers allocated.
+
+#### Declaration ####
+
+```
+bool SbMediaIsBufferPoolAllocateOnDemand()
+```
+
+### SbMediaIsBufferUsingMemoryPool ###
+
+If SbMediaGetBufferUsingMemoryPool returns true, it indicates that media buffer
+pools should be allocated on demand, as opposed to using SbMemory* functions.
+
+#### Declaration ####
+
+```
+bool SbMediaIsBufferUsingMemoryPool()
+```
+
+### SbMediaIsOutputProtected ###
+
+Indicates whether output copy protection is currently enabled on all capable
+outputs. If `true`, then non-protection-capable outputs are expected to be
+blanked.
+
+#### Declaration ####
+
+```
+bool SbMediaIsOutputProtected()
+```
+
+### SbMediaIsSupported ###
+
+Indicates whether this platform supports decoding `video_codec` and
+`audio_codec` along with decrypting using `key_system`. If `video_codec` is
+`kSbMediaVideoCodecNone` or if `audio_codec` is `kSbMediaAudioCodecNone`, this
+function should return `true` as long as `key_system` is supported on the
+platform to decode any supported input formats.
+
+`video_codec`: The `SbMediaVideoCodec` being checked for platform compatibility.
+`audio_codec`: The `SbMediaAudioCodec` being checked for platform compatibility.
+`key_system`: The key system being checked for platform compatibility.
+
+#### Declaration ####
+
+```
+bool SbMediaIsSupported(SbMediaVideoCodec video_codec, SbMediaAudioCodec audio_codec, const char *key_system)
+```
+
+### SbMediaSetAudioWriteDuration ###
+
+Communicate to the platform how far past `current_playback_position` the app
+will write audio samples. The app will write all samples between
+`current_playback_position` and `current_playback_position` + `duration`, as
+soon as they are available. The app may sometimes write more samples than that,
+but the app only guarantees to write `duration` past `current_playback_position`
+in general. The platform is responsible for guaranteeing that when only
+`duration` audio samples are written at a time, no playback issues occur (such
+as transient or indefinite hanging). The platform may assume `duration` >= 0.5
+seconds.
+
+#### Declaration ####
+
+```
+void SbMediaSetAudioWriteDuration(SbTime duration)
+```
+
+### SbMediaSetOutputProtection ###
+
+Enables or disables output copy protection on all capable outputs. If enabled,
+then non-protection-capable outputs are expected to be blanked.
+
+The return value indicates whether the operation was successful, and the
+function returns a success even if the call is redundant in that it doesn't
+change the current value.
+
+`enabled`: Indicates whether output protection is enabled (`true`) or disabled.
+
+#### Declaration ####
+
+```
+bool SbMediaSetOutputProtection(bool enabled)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/memory.md b/src/cobalt/site/docs/reference/starboard/modules/12/memory.md
new file mode 100644
index 0000000..a3fecb6
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/memory.md
@@ -0,0 +1,464 @@
+---
+layout: doc
+title: "Starboard Module Reference: memory.h"
+---
+
+Defines functions for memory allocation, alignment, copying, and comparing.
+Porters
+
+All of the "Unchecked" and "Free" functions must be implemented, but they should
+not be called directly. The Starboard platform wraps them with extra accounting
+under certain circumstances.
+Porters and Application Developers
+
+Nobody should call the "Checked", "Unchecked" or "Free" functions directly
+because that evades Starboard's memory tracking. In both port implementations
+and Starboard client application code, you should always call SbMemoryAllocate
+and SbMemoryDeallocate rather than SbMemoryAllocateUnchecked and SbMemoryFree.
+
+*   The "checked" functions are SbMemoryAllocateChecked(),
+    SbMemoryReallocateChecked(), and SbMemoryAllocateAlignedChecked().
+
+*   The "unchecked" functions are SbMemoryAllocateUnchecked(),
+    SbMemoryReallocateUnchecked(), and SbMemoryAllocateAlignedUnchecked().
+
+*   The "free" functions are SbMemoryFree() and SbMemoryFreeAligned().
+
+## Enums ##
+
+### SbMemoryMapFlags ###
+
+The bitwise OR of these flags should be passed to SbMemoryMap to indicate how
+the mapped memory can be used.
+
+#### Values ####
+
+*   `kSbMemoryMapProtectReserved`
+
+    No flags set: Reserves virtual address space. SbMemoryProtect() can later
+    make it accessible.
+*   `kSbMemoryMapProtectRead`
+*   `kSbMemoryMapProtectWrite`
+*   `kSbMemoryMapProtectExec`
+*   `kSbMemoryMapProtectReadWrite`
+
+## Functions ##
+
+### SbMemoryAlignToPageSize ###
+
+Rounds `size` up to kSbMemoryPageSize.
+
+#### Declaration ####
+
+```
+static size_t SbMemoryAlignToPageSize(size_t size)
+```
+
+### SbMemoryAllocate ###
+
+Allocates and returns a chunk of memory of at least `size` bytes. This function
+should be called from the client codebase. It is intended to be a drop-in
+replacement for `malloc`.
+
+Note that this function returns `NULL` if it is unable to allocate the memory.
+
+`size`: The amount of memory to be allocated. If `size` is 0, the function may
+return `NULL` or it may return a unique pointer value that can be passed to
+SbMemoryDeallocate.
+
+#### Declaration ####
+
+```
+void* SbMemoryAllocate(size_t size)
+```
+
+### SbMemoryAllocateAligned ###
+
+Allocates and returns a chunk of memory of at least `size` bytes, aligned to
+`alignment`. This function should be called from the client codebase. It is
+meant to be a drop-in replacement for `memalign`.
+
+The function returns `NULL` if it cannot allocate the memory. In addition, the
+function's behavior is undefined if `alignment` is not a power of two.
+
+`alignment`: The way that data is arranged and accessed in memory. The value
+must be a power of two. `size`: The size of the memory to be allocated. If
+`size` is `0`, the function may return `NULL` or it may return a unique aligned
+pointer value that can be passed to SbMemoryDeallocateAligned.
+
+#### Declaration ####
+
+```
+void* SbMemoryAllocateAligned(size_t alignment, size_t size)
+```
+
+### SbMemoryAllocateAlignedChecked ###
+
+Same as SbMemoryAllocateAlignedUnchecked, but will abort() in the case of an
+allocation failure.
+
+DO NOT CALL. Call SbMemoryAllocateAligned(...) instead.
+
+#### Declaration ####
+
+```
+void* SbMemoryAllocateAlignedChecked(size_t alignment, size_t size)
+```
+
+### SbMemoryAllocateAlignedUnchecked ###
+
+This is the implementation of SbMemoryAllocateAligned that must be provided by
+Starboard ports.
+
+DO NOT CALL. Call SbMemoryAllocateAligned(...) instead.
+
+#### Declaration ####
+
+```
+void* SbMemoryAllocateAlignedUnchecked(size_t alignment, size_t size)
+```
+
+### SbMemoryAllocateChecked ###
+
+Same as SbMemoryAllocateUnchecked, but will abort() in the case of an allocation
+failure.
+
+DO NOT CALL. Call SbMemoryAllocate(...) instead.
+
+#### Declaration ####
+
+```
+void* SbMemoryAllocateChecked(size_t size)
+```
+
+### SbMemoryAllocateNoReport ###
+
+Same as SbMemoryAllocate() but will not report memory to the tracker. Avoid
+using this unless absolutely necessary.
+
+#### Declaration ####
+
+```
+void* SbMemoryAllocateNoReport(size_t size)
+```
+
+### SbMemoryAllocateUnchecked ###
+
+This is the implementation of SbMemoryAllocate that must be provided by
+Starboard ports.
+
+DO NOT CALL. Call SbMemoryAllocate(...) instead.
+
+#### Declaration ####
+
+```
+void* SbMemoryAllocateUnchecked(size_t size)
+```
+
+### SbMemoryCalloc ###
+
+A wrapper that implements a drop-in replacement for `calloc`, which is used in
+some packages.
+
+#### Declaration ####
+
+```
+static void* SbMemoryCalloc(size_t count, size_t size)
+```
+
+### SbMemoryCompare ###
+
+Compares the contents of the first `count` bytes of `buffer1` and `buffer2`.
+This function returns:
+
+*   `-1` if `buffer1` is "less-than" `buffer2`
+
+*   `0` if `buffer1` and `buffer2` are equal
+
+*   `1` if `buffer1` is "greater-than" `buffer2`.
+
+This function is meant to be a drop-in replacement for `memcmp`.
+
+`buffer1`: The first buffer to be compared. `buffer2`: The second buffer to be
+compared. `count`: The number of bytes to be compared.
+
+#### Declaration ####
+
+```
+int SbMemoryCompare(const void *buffer1, const void *buffer2, size_t count)
+```
+
+### SbMemoryCopy ###
+
+Copies `count` sequential bytes from `source` to `destination`, without support
+for the `source` and `destination` regions overlapping. This function is meant
+to be a drop-in replacement for `memcpy`.
+
+The function's behavior is undefined if `destination` or `source` are NULL, and
+the function is a no-op if `count` is 0. The return value is `destination`.
+
+`destination`: The destination of the copied memory. `source`: The source of the
+copied memory. `count`: The number of sequential bytes to be copied.
+
+#### Declaration ####
+
+```
+void* SbMemoryCopy(void *destination, const void *source, size_t count)
+```
+
+### SbMemoryDeallocate ###
+
+Frees a previously allocated chunk of memory. If `memory` is NULL, then the
+operation is a no-op. This function should be called from the client codebase.
+It is meant to be a drop-in replacement for `free`.
+
+`memory`: The chunk of memory to be freed.
+
+#### Declaration ####
+
+```
+void SbMemoryDeallocate(void *memory)
+```
+
+### SbMemoryDeallocateAligned ###
+
+`memory`: The chunk of memory to be freed. If `memory` is NULL, then the
+function is a no-op.
+
+#### Declaration ####
+
+```
+void SbMemoryDeallocateAligned(void *memory)
+```
+
+### SbMemoryDeallocateNoReport ###
+
+Same as SbMemoryDeallocate() but will not report memory deallocation to the
+tracker. This function must be matched with SbMemoryAllocateNoReport().
+
+#### Declaration ####
+
+```
+void SbMemoryDeallocateNoReport(void *memory)
+```
+
+### SbMemoryFindByte ###
+
+Finds the lower 8-bits of `value` in the first `count` bytes of `buffer` and
+returns either a pointer to the first found occurrence or `NULL` if the value is
+not found. This function is meant to be a drop-in replacement for `memchr`.
+
+#### Declaration ####
+
+```
+const void* SbMemoryFindByte(const void *buffer, int value, size_t count)
+```
+
+### SbMemoryFlush ###
+
+Flushes any data in the given virtual address range that is cached locally in
+the current processor core to physical memory, ensuring that data and
+instruction caches are cleared. This is required to be called on executable
+memory that has been written to and might be executed in the future.
+
+#### Declaration ####
+
+```
+void SbMemoryFlush(void *virtual_address, int64_t size_bytes)
+```
+
+### SbMemoryFree ###
+
+This is the implementation of SbMemoryDeallocate that must be provided by
+Starboard ports.
+
+DO NOT CALL. Call SbMemoryDeallocate(...) instead.
+
+#### Declaration ####
+
+```
+void SbMemoryFree(void *memory)
+```
+
+### SbMemoryFreeAligned ###
+
+This is the implementation of SbMemoryFreeAligned that must be provided by
+Starboard ports.
+
+DO NOT CALL. Call SbMemoryDeallocateAligned(...) instead.
+
+#### Declaration ####
+
+```
+void SbMemoryFreeAligned(void *memory)
+```
+
+### SbMemoryGetStackBounds ###
+
+Gets the stack bounds for the current thread.
+
+`out_high`: The highest addressable byte + 1 for the current thread. `out_low`:
+The lowest addressable byte for the current thread.
+
+#### Declaration ####
+
+```
+void SbMemoryGetStackBounds(void **out_high, void **out_low)
+```
+
+### SbMemoryIsAligned ###
+
+Checks whether `memory` is aligned to `alignment` bytes.
+
+#### Declaration ####
+
+```
+static bool SbMemoryIsAligned(const void *memory, size_t alignment)
+```
+
+### SbMemoryIsZero ###
+
+Returns true if the first `count` bytes of `buffer` are set to zero.
+
+#### Declaration ####
+
+```
+static bool SbMemoryIsZero(const void *buffer, size_t count)
+```
+
+### SbMemoryMap ###
+
+Allocates `size_bytes` worth of physical memory pages and maps them into an
+available virtual region. This function returns `SB_MEMORY_MAP_FAILED` on
+failure. `NULL` is a valid return value.
+
+`size_bytes`: The amount of physical memory pages to be allocated. `flags`: The
+bitwise OR of the protection flags for the mapped memory as specified in
+`SbMemoryMapFlags`. Allocating executable memory is not allowed and will fail.
+If executable memory is needed, map non-executable memory first and then switch
+access to executable using SbMemoryProtect. When kSbMemoryMapProtectReserved is
+used, the address space will not be accessible and, if possible, the platform
+should not count it against any memory budget. `name`: A value that appears in
+the debugger on some platforms. The value can be up to 32 bytes.
+
+#### Declaration ####
+
+```
+void* SbMemoryMap(int64_t size_bytes, int flags, const char *name)
+```
+
+### SbMemoryMove ###
+
+Copies `count` sequential bytes from `source` to `destination`, with support for
+the `source` and `destination` regions overlapping. This function is meant to be
+a drop-in replacement for `memmove`.
+
+The function's behavior is undefined if `destination` or `source` are NULL, and
+the function is a no-op if `count` is 0. The return value is `destination`.
+
+`destination`: The destination of the copied memory. `source`: The source of the
+copied memory. `count`: The number of sequential bytes to be copied.
+
+#### Declaration ####
+
+```
+void* SbMemoryMove(void *destination, const void *source, size_t count)
+```
+
+### SbMemoryProtect ###
+
+Change the protection of `size_bytes` of memory regions, starting from
+`virtual_address`, to `flags`, returning `true` on success.
+
+#### Declaration ####
+
+```
+bool SbMemoryProtect(void *virtual_address, int64_t size_bytes, int flags)
+```
+
+### SbMemoryReallocate ###
+
+Attempts to resize `memory` to be at least `size` bytes, without touching the
+contents of memory.
+
+*   If the function cannot perform the fast resize, it allocates a new chunk of
+    memory, copies the contents over, and frees the previous chunk, returning a
+    pointer to the new chunk.
+
+*   If the function cannot perform the slow resize, it returns `NULL`, leaving
+    the given memory chunk unchanged.
+
+This function should be called from the client codebase. It is meant to be a
+drop-in replacement for `realloc`.
+
+`memory`: The chunk of memory to be resized. `memory` may be NULL, in which case
+it behaves exactly like SbMemoryAllocateUnchecked. `size`: The size to which
+`memory` will be resized. If `size` is `0`, the function may return `NULL` or it
+may return a unique pointer value that can be passed to SbMemoryDeallocate.
+
+#### Declaration ####
+
+```
+void* SbMemoryReallocate(void *memory, size_t size)
+```
+
+### SbMemoryReallocateChecked ###
+
+Same as SbMemoryReallocateUnchecked, but will abort() in the case of an
+allocation failure.
+
+DO NOT CALL. Call SbMemoryReallocate(...) instead.
+
+#### Declaration ####
+
+```
+void* SbMemoryReallocateChecked(void *memory, size_t size)
+```
+
+### SbMemoryReallocateUnchecked ###
+
+This is the implementation of SbMemoryReallocate that must be provided by
+Starboard ports.
+
+DO NOT CALL. Call SbMemoryReallocate(...) instead.
+
+#### Declaration ####
+
+```
+void* SbMemoryReallocateUnchecked(void *memory, size_t size)
+```
+
+### SbMemorySet ###
+
+Fills `count` sequential bytes starting at `destination`, with the unsigned char
+coercion of `byte_value`. This function is meant to be a drop-in replacement for
+`memset`.
+
+The function's behavior is undefined if `destination` is NULL, and the function
+is a no-op if `count` is 0. The return value is `destination`.
+
+`destination`: The destination of the copied memory. `count`: The number of
+sequential bytes to be set.
+
+#### Declaration ####
+
+```
+void* SbMemorySet(void *destination, int byte_value, size_t count)
+```
+
+### SbMemoryUnmap ###
+
+Unmap `size_bytes` of physical pages starting from `virtual_address`, returning
+`true` on success. After this function completes, [virtual_address,
+virtual_address + size_bytes) will not be read/writable. This function can unmap
+multiple contiguous regions that were mapped with separate calls to
+SbMemoryMap(). For example, if one call to `SbMemoryMap(0x1000)` returns
+`(void*)0xA000`, and another call to `SbMemoryMap(0x1000)` returns
+`(void*)0xB000`, `SbMemoryUnmap(0xA000, 0x2000)` should free both regions.
+
+#### Declaration ####
+
+```
+bool SbMemoryUnmap(void *virtual_address, int64_t size_bytes)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/memory_reporter.md b/src/cobalt/site/docs/reference/starboard/modules/12/memory_reporter.md
similarity index 100%
copy from src/cobalt/site/docs/reference/starboard/modules/4/memory_reporter.md
copy to src/cobalt/site/docs/reference/starboard/modules/12/memory_reporter.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/microphone.md b/src/cobalt/site/docs/reference/starboard/modules/12/microphone.md
new file mode 100644
index 0000000..1379f86
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/microphone.md
@@ -0,0 +1,263 @@
+---
+layout: doc
+title: "Starboard Module Reference: microphone.h"
+---
+
+Defines functions for microphone creation, control, audio data fetching, and
+destruction. This module supports multiple calls to `SbMicrophoneOpen` and
+`SbMicrophoneClose`, and the implementation should handle multiple calls to one
+of those functions on the same microphone. For example, your implementation
+should handle cases where `SbMicrophoneOpen` is called twice on the same
+microphone without a call to `SbMicrophoneClose` in between.
+
+This API is not thread-safe and must be called from a single thread.
+
+How to use this API:
+
+1.  Call `SbMicrophoneGetAvailableInfos` to get a list of available microphone
+    information.
+
+1.  Create a supported microphone, using `SbMicrophoneCreate`, with enough
+    buffer size and sample rate. Use `SbMicrophoneIsSampleRateSupported` to
+    verify the sample rate.
+
+1.  Use `SbMicrophoneOpen` to open the microphone port and start recording audio
+    data.
+
+1.  Periodically read out the data from microphone with `SbMicrophoneRead`.
+
+1.  Call `SbMicrophoneClose` to close the microphone port and stop recording
+    audio data.
+
+1.  Destroy the microphone with `SbMicrophoneDestroy`.
+
+## Macros ##
+
+### kSbMicrophoneIdInvalid ###
+
+Well-defined value for an invalid microphone ID handle.
+
+### kSbMicrophoneInvalid ###
+
+Well-defined value for an invalid microphone handle.
+
+## Enums ##
+
+### SbMicrophoneType ###
+
+All possible microphone types.
+
+#### Values ####
+
+*   `kSbMicrophoneCamera`
+
+    Built-in microphone in camera.
+*   `kSbMicrophoneUSBHeadset`
+
+    Microphone in the headset that can be a wired or wireless USB headset.
+*   `kSbMicrophoneVRHeadset`
+
+    Microphone in the VR headset.
+*   `kSBMicrophoneAnalogHeadset`
+
+    Microphone in the analog headset.
+*   `kSbMicrophoneUnknown`
+
+    Unknown microphone type. The microphone could be different than the other
+    enum descriptions or could fall under one of those descriptions.
+
+## Typedefs ##
+
+### SbMicrophone ###
+
+An opaque handle to an implementation-private structure that represents a
+microphone.
+
+#### Definition ####
+
+```
+typedef struct SbMicrophonePrivate* SbMicrophone
+```
+
+### SbMicrophoneId ###
+
+An opaque handle to an implementation-private structure that represents a
+microphone ID.
+
+#### Definition ####
+
+```
+typedef struct SbMicrophoneIdPrivate* SbMicrophoneId
+```
+
+## Structs ##
+
+### SbMicrophoneInfo ###
+
+Microphone information.
+
+#### Members ####
+
+*   `SbMicrophoneId id`
+
+    Microphone id.
+*   `SbMicrophoneType type`
+
+    Microphone type.
+*   `int max_sample_rate_hz`
+
+    The microphone's maximum supported sampling rate.
+*   `int min_read_size`
+
+    The minimum read size required for each read from microphone.
+*   `char label`
+
+    Name of the microphone. Can be empty. This should indicate the friendly name
+    of the microphone type. For example, "Headset Microphone". The string must
+    be null terminated.
+
+## Functions ##
+
+### SbMicrophoneClose ###
+
+Closes the microphone port, stops recording audio on `microphone`, and clears
+the unread buffer if it is not empty. If the microphone has already been
+stopped, this call is ignored. The return value indicates whether the microphone
+is closed.
+
+`microphone`: The microphone to close.
+
+#### Declaration ####
+
+```
+bool SbMicrophoneClose(SbMicrophone microphone)
+```
+
+### SbMicrophoneCreate ###
+
+Creates a microphone with the specified ID, audio sample rate, and cached audio
+buffer size. Starboard only requires support for creating one microphone at a
+time, and implementations may return an error if a second microphone is created
+before the first is destroyed.
+
+The function returns the newly created SbMicrophone object. However, if you try
+to create a microphone that has already been initialized, if the sample rate is
+unavailable, or if the buffer size is invalid, the function should return
+`kSbMicrophoneInvalid`.
+
+`id`: The ID that will be assigned to the newly created SbMicrophone.
+`sample_rate_in_hz`: The new microphone's audio sample rate in Hz.
+`buffer_size_bytes`: The size of the buffer where signed 16-bit integer audio
+data is temporarily cached to during the capturing. The audio data is removed
+from the audio buffer if it has been read, and new audio data can be read from
+this buffer in smaller chunks than this size. This parameter must be set to a
+value greater than zero and the ideal size is `2^n`.
+
+#### Declaration ####
+
+```
+SbMicrophone SbMicrophoneCreate(SbMicrophoneId id, int sample_rate_in_hz, int buffer_size_bytes)
+```
+
+### SbMicrophoneDestroy ###
+
+Destroys a microphone. If the microphone is in started state, it is first
+stopped and then destroyed. Any data that has been recorded and not read is
+thrown away.
+
+#### Declaration ####
+
+```
+void SbMicrophoneDestroy(SbMicrophone microphone)
+```
+
+### SbMicrophoneGetAvailable ###
+
+Retrieves all currently available microphone information and stores it in
+`out_info_array`. The return value is the number of the available microphones.
+If the number of available microphones is larger than `info_array_size`, then
+`out_info_array` is filled up with as many available microphones as possible and
+the actual number of available microphones is returned. A negative return value
+indicates that an internal error occurred.
+
+`out_info_array`: All currently available information about the microphone is
+placed into this output parameter. `info_array_size`: The size of
+`out_info_array`.
+
+#### Declaration ####
+
+```
+int SbMicrophoneGetAvailable(SbMicrophoneInfo *out_info_array, int info_array_size)
+```
+
+### SbMicrophoneIdIsValid ###
+
+Indicates whether the given microphone ID is valid.
+
+#### Declaration ####
+
+```
+static bool SbMicrophoneIdIsValid(SbMicrophoneId id)
+```
+
+### SbMicrophoneIsSampleRateSupported ###
+
+Indicates whether the microphone supports the sample rate.
+
+#### Declaration ####
+
+```
+bool SbMicrophoneIsSampleRateSupported(SbMicrophoneId id, int sample_rate_in_hz)
+```
+
+### SbMicrophoneIsValid ###
+
+Indicates whether the given microphone is valid.
+
+#### Declaration ####
+
+```
+static bool SbMicrophoneIsValid(SbMicrophone microphone)
+```
+
+### SbMicrophoneOpen ###
+
+Opens the microphone port and starts recording audio on `microphone`.
+
+Once started, the client needs to periodically call `SbMicrophoneRead` to
+receive the audio data. If the microphone has already been started, this call
+clears the unread buffer. The return value indicates whether the microphone is
+open. `microphone`: The microphone that will be opened and will start recording
+audio.
+
+#### Declaration ####
+
+```
+bool SbMicrophoneOpen(SbMicrophone microphone)
+```
+
+### SbMicrophoneRead ###
+
+Retrieves the recorded audio data from the microphone and writes that data to
+`out_audio_data`.
+
+The return value is zero or the positive number of bytes that were read. Neither
+the return value nor `audio_data_size` exceeds the buffer size. A negative
+return value indicates that an error occurred.
+
+This function should be called frequently. Otherwise, the microphone only
+buffers `buffer_size` bytes as configured in `SbMicrophoneCreate` and the new
+audio data is thrown out. No audio data is read from a stopped microphone.
+
+`microphone`: The microphone from which to retrieve recorded audio data.
+`out_audio_data`: The buffer to which the retrieved data will be written.
+`audio_data_size`: The number of requested bytes. If `audio_data_size` is
+smaller than `min_read_size` of `SbMicrophoneInfo`, the extra audio data that
+has already been read from the device is discarded.
+
+#### Declaration ####
+
+```
+int SbMicrophoneRead(SbMicrophone microphone, void *out_audio_data, int audio_data_size)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/mutex.md b/src/cobalt/site/docs/reference/starboard/modules/12/mutex.md
new file mode 100644
index 0000000..58f1907
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/mutex.md
@@ -0,0 +1,128 @@
+---
+layout: doc
+title: "Starboard Module Reference: mutex.h"
+---
+
+Defines a mutually exclusive lock that can be used to coordinate with other
+threads.
+
+## Macros ##
+
+### SB_MUTEX_MAX_SIZE ###
+
+Max size of the SbMutex type.
+
+## Enums ##
+
+### SbMutexResult ###
+
+Enumeration of possible results from acquiring a mutex.
+
+#### Values ####
+
+*   `kSbMutexAcquired`
+
+    The mutex was acquired successfully.
+*   `kSbMutexBusy`
+
+    The mutex was not acquired because it was held by someone else.
+*   `kSbMutexDestroyed`
+
+    The mutex has already been destroyed.
+
+## Typedefs ##
+
+### SbMutex ###
+
+An opaque handle to a mutex type with reserved memory buffer of size
+SB_MUTEX_MAX_SIZE and aligned at void pointer type.
+
+#### Definition ####
+
+```
+typedef union SbMutex  SbMutex
+```
+
+## Functions ##
+
+### SbMutexAcquire ###
+
+Acquires `mutex`, blocking indefinitely. The return value identifies the
+acquisition result. SbMutexes are not reentrant, so a recursive acquisition
+blocks forever.
+
+`mutex`: The mutex to be acquired.
+
+#### Declaration ####
+
+```
+SbMutexResult SbMutexAcquire(SbMutex *mutex)
+```
+
+### SbMutexAcquireTry ###
+
+Acquires `mutex`, without blocking. The return value identifies the acquisition
+result. SbMutexes are not reentrant, so a recursive acquisition has undefined
+behavior.
+
+`mutex`: The mutex to be acquired.
+
+#### Declaration ####
+
+```
+SbMutexResult SbMutexAcquireTry(SbMutex *mutex)
+```
+
+### SbMutexCreate ###
+
+Creates a new mutex. The return value indicates whether the function was able to
+create a new mutex.
+
+`out_mutex`: The handle to the newly created mutex.
+
+#### Declaration ####
+
+```
+bool SbMutexCreate(SbMutex *out_mutex)
+```
+
+### SbMutexDestroy ###
+
+Destroys a mutex. The return value indicates whether the destruction was
+successful. Destroying a locked mutex results in undefined behavior.
+
+`mutex`: The mutex to be invalidated.
+
+#### Declaration ####
+
+```
+bool SbMutexDestroy(SbMutex *mutex)
+```
+
+### SbMutexIsSuccess ###
+
+Indicates whether the given result is a success. A value of `true` indicates
+that the mutex was acquired.
+
+`result`: The result being checked.
+
+#### Declaration ####
+
+```
+static bool SbMutexIsSuccess(SbMutexResult result)
+```
+
+### SbMutexRelease ###
+
+Releases `mutex` held by the current thread. The return value indicates whether
+the release was successful. Releases should always be successful if `mutex` is
+held by the current thread.
+
+`mutex`: The mutex to be released.
+
+#### Declaration ####
+
+```
+bool SbMutexRelease(SbMutex *mutex)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/once.md b/src/cobalt/site/docs/reference/starboard/modules/12/once.md
new file mode 100644
index 0000000..ce3c4d6
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/once.md
@@ -0,0 +1,58 @@
+---
+layout: doc
+title: "Starboard Module Reference: once.h"
+---
+
+Onces represent initializations that should only ever happen once per process,
+in a thread-safe way.
+
+## Macros ##
+
+### SB_ONCE_MAX_SIZE ###
+
+Max size of the SbOnceControl type.
+
+## Typedefs ##
+
+### SbOnceControl ###
+
+An opaque handle to a once control type with reserved memory buffer of size
+SB_ONCE_MAX_SIZE and aligned at void pointer type.
+
+#### Definition ####
+
+```
+typedef union SbOnceControl  SbOnceControl
+```
+
+### SbOnceInitRoutine ###
+
+Function pointer type for methods that can be called via the SbOnce() system.
+
+#### Definition ####
+
+```
+typedef void(* SbOnceInitRoutine) (void)
+```
+
+## Functions ##
+
+### SbOnce ###
+
+Thread-safely runs `init_routine` only once.
+
+*   If this `once_control` has not run a function yet, this function runs
+    `init_routine` in a thread-safe way and then returns `true`.
+
+*   If SbOnce() was called with `once_control` before, the function returns
+    `true` immediately.
+
+*   If `once_control` or `init_routine` is invalid, the function returns
+    `false`.
+
+#### Declaration ####
+
+```
+bool SbOnce(SbOnceControl *once_control, SbOnceInitRoutine init_routine)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/player.md b/src/cobalt/site/docs/reference/starboard/modules/12/player.md
new file mode 100644
index 0000000..2f64632
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/player.md
@@ -0,0 +1,556 @@
+---
+layout: doc
+title: "Starboard Module Reference: player.h"
+---
+
+Defines an interface for controlling playback of media elementary streams.
+
+## Macros ##
+
+### SB_PLAYER_INITIAL_TICKET ###
+
+The value of the initial ticket held by the player before the first seek. The
+player will use this ticket value to make the first call to SbPlayerStatusFunc
+with kSbPlayerStateInitialized.
+
+### SB_PLAYER_NO_DURATION ###
+
+The value to pass into SbPlayerCreate's `duration_pts` argument for cases where
+the duration is unknown, such as for live streams.
+
+### kSbPlayerInvalid ###
+
+Well-defined value for an invalid player.
+
+## Enums ##
+
+### SbPlayerDecoderState ###
+
+An indicator of whether the decoder can accept more samples.
+
+#### Values ####
+
+*   `kSbPlayerDecoderStateNeedsData`
+
+    The decoder is asking for one more sample.
+
+### SbPlayerSampleSideDataType ###
+
+Identify the type of side data accompanied with `SbPlayerSampleInfo`, as side
+data may come from multiple sources.
+
+#### Values ####
+
+*   `kMatroskaBlockAdditional`
+
+    The side data comes from the BlockAdditional data in the Matroska/Webm
+    container, as specified in [https://tools.ietf.org/id/draft-lhomme-cellar-matroska-03.html#rfc.section.7.3.39](https://tools.ietf.org/id/draft-lhomme-cellar-matroska-03.html#rfc.section.7.3.39)9) andnd [https://www.webmproject.org/docs/container/#BlockAdditional](https://www.webmproject.org/docs/container/#BlockAdditional)l)
+    . The first 8 bytes of the data contains the value of BlockAddID in big
+    endian format, followed by the content of BlockAdditional.
+
+### SbPlayerState ###
+
+An indicator of the general playback state.
+
+#### Values ####
+
+*   `kSbPlayerStateInitialized`
+
+    The player has just been initialized. It is expecting an SbPlayerSeek() call
+    to enter the prerolling state.
+*   `kSbPlayerStatePrerolling`
+
+    The player is prerolling, collecting enough data to fill the pipeline before
+    presentation starts. After the first preroll is completed, there should
+    always be a video frame to render, even if the player goes back to
+    Prerolling after a Seek.
+*   `kSbPlayerStatePresenting`
+
+    The player is presenting media, and it is either paused or actively playing
+    in real-time. Note that the implementation should use this state to signal
+    that the preroll has been finished.
+*   `kSbPlayerStateEndOfStream`
+
+    The player is presenting media, but it is paused at the end of the stream.
+*   `kSbPlayerStateDestroyed`
+
+    The player has been destroyed, and will send no more callbacks.
+
+## Typedefs ##
+
+### SbPlayer ###
+
+An opaque handle to an implementation-private structure representing a player.
+
+#### Definition ####
+
+```
+typedef struct SbPlayerPrivate* SbPlayer
+```
+
+### SbPlayerDeallocateSampleFunc ###
+
+Callback to free the given sample buffer data. When more than one buffer are
+sent in SbPlayerWriteSample(), the implementation only has to call this callback
+with `sample_buffer` points to the the first buffer.
+
+#### Definition ####
+
+```
+typedef void(* SbPlayerDeallocateSampleFunc) (SbPlayer player, void *context, const void *sample_buffer)
+```
+
+### SbPlayerDecoderStatusFunc ###
+
+Callback for decoder status updates, called in response to a call to
+SbPlayerSeek() or SbPlayerWriteSample(). This callback will never be called
+until at least one call to SbPlayerSeek has occurred. `ticket` will be set to
+the ticket passed into the last received call to SbPlayerSeek() at the time this
+callback was dispatched. This is to distinguish status callbacks for
+interrupting seeks. These callbacks will happen on a different thread than the
+calling thread, and it is not valid to call SbPlayer functions from within this
+callback. After an update with kSbPlayerDecoderStateNeedsData, the user of the
+player will make at most one call to SbPlayerWriteSample() or
+SbPlayerWriteEndOfStream(). The player implementation should update the decoder
+status again after such call to notify its user to continue writing more frames.
+
+#### Definition ####
+
+```
+typedef void(* SbPlayerDecoderStatusFunc) (SbPlayer player, void *context, SbMediaType type, SbPlayerDecoderState state, int ticket)
+```
+
+### SbPlayerErrorFunc ###
+
+Callback for player errors, that may set a `message`. `error`: indicates the
+error code. `message`: provides specific informative diagnostic message about
+the error condition encountered. It is ok for the message to be an empty string
+or NULL if no information is available.
+
+#### Definition ####
+
+```
+typedef void(* SbPlayerErrorFunc) (SbPlayer player, void *context, SbPlayerError error, const char *message)
+```
+
+### SbPlayerStatusFunc ###
+
+Callback for player status updates. These callbacks will happen on a different
+thread than the calling thread, and it is not valid to call SbPlayer functions
+from within this callback.
+
+#### Definition ####
+
+```
+typedef void(* SbPlayerStatusFunc) (SbPlayer player, void *context, SbPlayerState state, int ticket)
+```
+
+## Structs ##
+
+### SbPlayerCreationParam ###
+
+The playback related parameters to pass into SbPlayerCreate() and
+SbPlayerGetPreferredOutputMode().
+
+#### Members ####
+
+*   `SbDrmSystem drm_system`
+
+    Provides an appropriate DRM system if the media stream has encrypted
+    portions. It will be `kSbDrmSystemInvalid` if the stream does not have
+    encrypted portions.
+*   `SbMediaAudioSampleInfo audio_sample_info`
+
+    Contains a populated SbMediaAudioSampleInfo if `audio_sample_info.codec`
+    isn't `kSbMediaAudioCodecNone`. When `audio_sample_info.codec` is
+    `kSbMediaAudioCodecNone`, the video doesn't have an audio track.
+*   `SbMediaVideoSampleInfo video_sample_info`
+
+    Contains a populated SbMediaVideoSampleInfo if `video_sample_info.codec`
+    isn't `kSbMediaVideoCodecNone`. When `video_sample_info.codec` is
+    `kSbMediaVideoCodecNone`, the video is audio only.
+*   `SbPlayerOutputMode output_mode`
+
+    Selects how the decoded video frames will be output. For example,
+    `kSbPlayerOutputModePunchOut` indicates that the decoded video frames will
+    be output to a background video layer by the platform, and
+    `kSbPlayerOutputDecodeToTexture` indicates that the decoded video frames
+    should be made available for the application to pull via calls to
+    SbPlayerGetCurrentFrame().
+
+### SbPlayerInfo2 ###
+
+Information about the current media playback state.
+
+#### Members ####
+
+*   `SbTime current_media_timestamp`
+
+    The position of the playback head, as precisely as possible, in
+    microseconds.
+*   `SbTime duration`
+
+    The known duration of the currently playing media stream, in microseconds.
+*   `SbTime start_date`
+
+    The result of getStartDate for the currently playing media stream, in
+    microseconds since the epoch of January 1, 1601 UTC.
+*   `int frame_width`
+
+    The width of the currently displayed frame, in pixels, or 0 if not provided
+    by this player.
+*   `int frame_height`
+
+    The height of the currently displayed frame, in pixels, or 0 if not provided
+    by this player.
+*   `bool is_paused`
+
+    Whether playback is currently paused.
+*   `double volume`
+
+    The current player volume in [0, 1].
+*   `int total_video_frames`
+
+    The number of video frames sent to the player since the creation of the
+    player.
+*   `int dropped_video_frames`
+
+    The number of video frames decoded but not displayed since the creation of
+    the player.
+*   `int corrupted_video_frames`
+
+    The number of video frames that failed to be decoded since the creation of
+    the player.
+*   `double playback_rate`
+
+    The rate of playback. The video is played back in a speed that is
+    proportional to this. By default it is 1.0 which indicates that the playback
+    is at normal speed. When it is greater than one, the video is played in a
+    faster than normal speed. When it is less than one, the video is played in a
+    slower than normal speed. Negative speeds are not supported.
+
+### SbPlayerSampleInfo ###
+
+Information about the samples to be written into SbPlayerWriteSample2.
+
+#### Members ####
+
+*   `SbMediaType type`
+*   `const void * buffer`
+
+    Points to the buffer containing the sample data.
+*   `int buffer_size`
+
+    Size of the data pointed to by `buffer`.
+*   `SbTime timestamp`
+
+    The timestamp of the sample in SbTime.
+*   `SbPlayerSampleSideData* side_data`
+
+    Points to an array of side data for the input, when available.
+*   `int side_data_count`
+
+    The number of side data pointed by `side_data`. It should be set to 0 if
+    there is no side data for the input.
+*   `SbMediaAudioSampleInfo audio_sample_info`
+
+    Information about an audio sample. This value can only be used when `type`
+    is kSbMediaTypeAudio.
+*   `SbMediaVideoSampleInfo video_sample_info`
+
+    Information about a video sample. This value can only be used when `type` is
+    kSbMediaTypeVideo.
+*   `union SbPlayerSampleInfo::@0 @1`
+*   `constSbDrmSampleInfo* drm_info`
+
+    The DRM system related info for the media sample. This value is required for
+    encrypted samples. Otherwise, it must be `NULL`.
+
+### SbPlayerSampleSideData ###
+
+Side data accompanied with `SbPlayerSampleInfo`, it can be arbitrary binary data
+coming from multiple sources.
+
+#### Members ####
+
+*   `SbPlayerSampleSideDataType type`
+*   `const uint8_t * data`
+
+    `data` will remain valid until SbPlayerDeallocateSampleFunc() is called on
+    the `SbPlayerSampleInfo::buffer` the data is associated with.
+*   `size_t size`
+
+    The size of the data pointed by `data`, in bytes.
+
+## Functions ##
+
+### SbPlayerCreate ###
+
+Creates a player that will be displayed on `window` for the specified
+`video_codec` and `audio_codec`, acquiring all resources needed to operate it,
+and returning an opaque handle to it. The expectation is that a new player will
+be created and destroyed for every playback.
+
+This function returns the created player. Note the following:
+
+*   The associated decoder of the returned player should be assumed to not be in
+    `kSbPlayerDecoderStateNeedsData` until SbPlayerSeek() has been called on it.
+
+*   It is expected either that the thread that calls SbPlayerCreate is the same
+    thread that calls the other `SbPlayer` functions for that player, or that
+    there is a mutex guarding calls into each `SbPlayer` instance.
+
+*   If there is a platform limitation on how many players can coexist
+    simultaneously, then calls made to this function that attempt to exceed that
+    limit must return `kSbPlayerInvalid`. Multiple calls to SbPlayerCreate must
+    not cause a crash.
+
+`window`: The window that will display the player. `window` can be
+`kSbWindowInvalid` for platforms where video is only displayed on a particular
+window that the underlying implementation already has access to.
+
+`video_codec`: The video codec used for the player. If `video_codec` is
+`kSbMediaVideoCodecNone`, the player is an audio-only player. If `video_codec`
+is any other value, the player is an audio/video decoder. This can be set to
+`kSbMediaVideoCodecNone` to play a video with only an audio track.
+
+`audio_codec`: The audio codec used for the player. The caller must provide a
+populated `audio_sample_info` if audio codec is `kSbMediaAudioCodecAac`. Can be
+set to `kSbMediaAudioCodecNone` to play a video without any audio track. In such
+case `audio_sample_info` must be NULL.
+
+`drm_system`: If the media stream has encrypted portions, then this parameter
+provides an appropriate DRM system, created with `SbDrmCreateSystem()`. If the
+stream does not have encrypted portions, then `drm_system` may be
+`kSbDrmSystemInvalid`. `audio_sample_info`: Note that the caller must provide a
+populated `audio_sample_info` if the audio codec is `kSbMediaAudioCodecAac`.
+Otherwise, `audio_sample_info` can be NULL. See media.h for the format of the
+`SbMediaAudioSampleInfo` struct. Note that `audio_specific_config` is a pointer
+and the content it points to is no longer valid after this function returns. The
+implementation has to make a copy of the content if it is needed after the
+function returns. `max_video_capabilities`: This string communicates the max
+video capabilities required to the platform. The web app will not provide a
+video stream exceeding the maximums described by this parameter. Allows the
+platform to optimize playback pipeline for low quality video streams if it knows
+that it will never adapt to higher quality streams. The string uses the same
+format as the string passed in to SbMediaCanPlayMimeAndKeySystem(), for example,
+when it is set to "width=1920; height=1080; framerate=15;", the video will never
+adapt to resolution higher than 1920x1080 or frame per second higher than 15
+fps. When the maximums are unknown, this will be set to NULL.
+
+#### Declaration ####
+
+```
+SbPlayer SbPlayerCreate(SbWindow window, const SbPlayerCreationParam *creation_param, SbPlayerDeallocateSampleFunc sample_deallocate_func, SbPlayerDecoderStatusFunc decoder_status_func, SbPlayerStatusFunc player_status_func, SbPlayerErrorFunc player_error_func, void *context, SbDecodeTargetGraphicsContextProvider *context_provider)
+```
+
+### SbPlayerDestroy ###
+
+Destroys `player`, freeing all associated resources.
+
+*   Upon calling this method, there should be one call to the player status
+    callback (i.e. `player_status_func` used in the creation of the player)
+    which indicates the player is destroyed. Note, the callback has to be in-
+    flight when SbPlayerDestroyed is called.
+
+*   No more other callbacks should be issued after this function returns.
+
+*   It is not allowed to pass `player` into any other `SbPlayer` function once
+    SbPlayerDestroy has been called on that player. `player`: The player to be
+    destroyed.
+
+#### Declaration ####
+
+```
+void SbPlayerDestroy(SbPlayer player)
+```
+
+### SbPlayerGetCurrentFrame ###
+
+Given a player created with the kSbPlayerOutputModeDecodeToTexture output mode,
+it will return a SbDecodeTarget representing the current frame to be rasterized.
+On GLES systems, this function must be called on a thread with an EGLContext
+current, and specifically the EGLContext that will be used to eventually render
+the frame. If this function is called with a `player` object that was created
+with an output mode other than kSbPlayerOutputModeDecodeToTexture,
+kSbDecodeTargetInvalid is returned.
+
+#### Declaration ####
+
+```
+SbDecodeTarget SbPlayerGetCurrentFrame(SbPlayer player)
+```
+
+### SbPlayerGetInfo2 ###
+
+Gets a snapshot of the current player state and writes it to `out_player_info`.
+This function may be called very frequently and is expected to be inexpensive.
+
+`player`: The player about which information is being retrieved.
+`out_player_info`: The information retrieved for the player.
+
+#### Declaration ####
+
+```
+void SbPlayerGetInfo2(SbPlayer player, SbPlayerInfo2 *out_player_info2)
+```
+
+### SbPlayerGetMaximumNumberOfSamplesPerWrite ###
+
+Writes a single sample of the given media type to `player`'s input stream. Its
+data may be passed in via more than one buffers. The lifetime of
+`sample_buffers`, `sample_buffer_sizes`, `video_sample_info`, and
+`sample_drm_info` (as well as member `subsample_mapping` contained inside it)
+are not guaranteed past the call to SbPlayerWriteSample. That means that before
+returning, the implementation must synchronously copy any information it wants
+to retain from those structures.
+
+`player`: The player for which the number is retrieved. `sample_type`: The type
+of sample for which the number is retrieved. See the `SbMediaType` enum in
+media.h.
+
+#### Declaration ####
+
+```
+int SbPlayerGetMaximumNumberOfSamplesPerWrite(SbPlayer player, SbMediaType sample_type)
+```
+
+### SbPlayerGetPreferredOutputMode ###
+
+Returns the preferred output mode of the implementation when a video described
+by `creation_param` is played. It is assumed that it is okay to call
+SbPlayerCreate() with the same video described by `creation_param`, with its
+`output_mode` member replaced by the returned output mode. When the caller has
+no preference on the output mode, it will set `creation_param->output_mode` to
+`kSbPlayerOutputModeInvalid`, and the implementation can return its preferred
+output mode based on the information contained in `creation_param`. The caller
+can also set `creation_param->output_mode` to its preferred output mode, and the
+implementation should return the same output mode if it is supported, otherwise
+the implementation should return an output mode that it is supported, as if
+`creation_param->output_mode` is set to `kSbPlayerOutputModeInvalid` prior to
+the call. Note that it is not the responsibility of this function to verify
+whether the video described by `creation_param` can be played on the platform,
+and the implementation should try its best effort to return a valid output mode.
+`creation_param` will never be NULL.
+
+#### Declaration ####
+
+```
+SbPlayerOutputMode SbPlayerGetPreferredOutputMode(const SbPlayerCreationParam *creation_param)
+```
+
+### SbPlayerIsValid ###
+
+Returns whether the given player handle is valid.
+
+#### Declaration ####
+
+```
+static bool SbPlayerIsValid(SbPlayer player)
+```
+
+### SbPlayerSetBounds ###
+
+Sets the player bounds to the given graphics plane coordinates. The changes do
+not take effect until the next graphics frame buffer swap. The default bounds
+for a player is the full screen. This function is only relevant when the
+`player` is created with the kSbPlayerOutputModePunchOut output mode, and if
+this is not the case then this function call can be ignored.
+
+This function is called on every graphics frame that changes the video bounds.
+For example, if the video bounds are being animated, then this will be called at
+up to 60 Hz. Since the function could be called up to once per frame,
+implementors should take care to avoid related performance concerns with such
+frequent calls.
+
+`player`: The player that is being resized. `z_index`: The z-index of the
+player. When the bounds of multiple players are overlapped, the one with larger
+z-index will be rendered on top of the ones with smaller z-index. `x`: The
+x-coordinate of the upper-left corner of the player. `y`: The y-coordinate of
+the upper-left corner of the player. `width`: The width of the player, in
+pixels. `height`: The height of the player, in pixels.
+
+#### Declaration ####
+
+```
+void SbPlayerSetBounds(SbPlayer player, int z_index, int x, int y, int width, int height)
+```
+
+### SbPlayerSetPlaybackRate ###
+
+Set the playback rate of the `player`. `rate` is default to 1.0 which indicates
+the playback is at its original speed. A `rate` greater than one will make the
+playback faster than its original speed. For example, when `rate` is 2, the
+video will be played at twice the speed as its original speed. A `rate` less
+than 1.0 will make the playback slower than its original speed. When `rate` is
+0, the playback will be paused. The function returns true when the playback rate
+is set to `playback_rate` or to a rate that is close to `playback_rate` which
+the implementation supports. It returns false when the playback rate is
+unchanged, this can happen when `playback_rate` is negative or if it is too high
+to support.
+
+#### Declaration ####
+
+```
+bool SbPlayerSetPlaybackRate(SbPlayer player, double playback_rate)
+```
+
+### SbPlayerSetVolume ###
+
+Sets the player's volume.
+
+`player`: The player in which the volume is being adjusted. `volume`: The new
+player volume. The value must be between `0.0` and `1.0`, inclusive. A value of
+`0.0` means that the audio should be muted, and a value of `1.0` means that it
+should be played at full volume.
+
+#### Declaration ####
+
+```
+void SbPlayerSetVolume(SbPlayer player, double volume)
+```
+
+### SbPlayerWriteEndOfStream ###
+
+Writes a marker to `player`'s input stream of `stream_type` indicating that
+there are no more samples for that media type for the remainder of this media
+stream. This marker is invalidated, along with the rest of the stream's
+contents, after a call to SbPlayerSeek.
+
+`player`: The player to which the marker is written. `stream_type`: The type of
+stream for which the marker is written.
+
+#### Declaration ####
+
+```
+void SbPlayerWriteEndOfStream(SbPlayer player, SbMediaType stream_type)
+```
+
+### SbPlayerWriteSample2 ###
+
+Writes samples of the given media type to `player`'s input stream. The lifetime
+of `sample_infos`, and the members of its elements like `buffer`,
+`video_sample_info`, and `drm_info` (as well as member `subsample_mapping`
+contained inside it) are not guaranteed past the call to SbPlayerWriteSample2.
+That means that before returning, the implementation must synchronously copy any
+information it wants to retain from those structures.
+
+SbPlayerWriteSample2 allows writing of multiple samples in one call.
+
+`player`: The player to which the sample is written. `sample_type`: The type of
+sample being written. See the `SbMediaType` enum in media.h. `sample_infos`: A
+pointer to an array of SbPlayerSampleInfo with `number_of_sample_infos`
+elements, each holds the data for an sample, i.e. a sequence of whole NAL Units
+for video, or a complete audio frame. `sample_infos` cannot be assumed to live
+past the call into SbPlayerWriteSample2(), so it must be copied if its content
+will be used after SbPlayerWriteSample2() returns. `number_of_sample_infos`:
+Specify the number of samples contained inside `sample_infos`. It has to be at
+least one, and less than the return value of
+SbPlayerGetMaximumNumberOfSamplesPerWrite().
+
+#### Declaration ####
+
+```
+void SbPlayerWriteSample2(SbPlayer player, SbMediaType sample_type, const SbPlayerSampleInfo *sample_infos, int number_of_sample_infos)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/socket.md b/src/cobalt/site/docs/reference/starboard/modules/12/socket.md
new file mode 100644
index 0000000..2bfb614
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/socket.md
@@ -0,0 +1,586 @@
+---
+layout: doc
+title: "Starboard Module Reference: socket.h"
+---
+
+Defines Starboard socket I/O functions. Starboard supports IPv4 and IPv6, TCP
+and UDP, server and client sockets. Some platforms may not support IPv6, some
+may not support listening sockets, and some may not support any kind of sockets
+at all (or only allow them in debug builds).
+
+Starboard ONLY supports non-blocking socket I/O, so all sockets are non-blocking
+at creation time.
+
+Note that, on some platforms, API calls on one end of a socket connection may
+not be instantaneously aware of manipulations on the socket at the other end of
+the connection, thus requiring use of either an SbSocketWaiter or spin-polling.
+
+TODO: For platforms that do not support sockets at all, they must support at
+least a high-level HTTP client API (to be defined later).
+
+## Macros ##
+
+### kSbSocketInvalid ###
+
+Well-defined value for an invalid socket handle.
+
+## Enums ##
+
+### SbSocketAddressType ###
+
+All possible address types.
+
+#### Values ####
+
+*   `kSbSocketAddressTypeIpv4`
+
+    An IPv4 address, using only the first 4 entries of the address buffer.
+*   `kSbSocketAddressTypeIpv6`
+
+    An IPv6 address, which uses 16 entries of the address buffer.
+
+### SbSocketError ###
+
+Enumeration of all Starboard socket operation results. Despite the enum name,
+note that the value actually describes the outcome of an operation, which is not
+always an error.
+
+#### Values ####
+
+*   `kSbSocketOk`
+
+    The operation succeeded.
+*   `kSbSocketPending`
+
+    The operation is blocked on I/O. Either try again "later," or be very clever
+    and wait on it with a SbSocketWaiter.
+*   `kSbSocketErrorConnectionReset`
+
+    This socket error is generated when the connection is reset unexpectedly and
+    the connection is now invalid. This might happen for example if an read
+    packet has the "TCP RST" bit set.
+*   `kSbSocketErrorFailed`
+
+    The operation failed for some other reason not specified above.
+
+### SbSocketProtocol ###
+
+All possible IP socket types.
+
+#### Values ####
+
+*   `kSbSocketProtocolTcp`
+
+    The TCP/IP protocol, a reliable, stateful, streaming protocol.
+*   `kSbSocketProtocolUdp`
+
+    The UDP/IP protocol, an unreliable, connectionless, discrete packet
+    (datagram) protocol.
+
+### SbSocketResolveFilter ###
+
+Bits that can be set when calling SbSocketResolve to filter the results.
+
+#### Values ####
+
+*   `kSbSocketResolveFilterNone`
+
+    No filters, include everything.
+*   `kSbSocketResolveFilterIpv4`
+
+    Include Ipv4 addresses.
+*   `kSbSocketResolveFilterIpv6`
+
+    Include Ipv6 addresses.
+
+## Typedefs ##
+
+### SbSocket ###
+
+A handle to a socket.
+
+#### Definition ####
+
+```
+typedef SbSocketPrivate* SbSocket
+```
+
+## Structs ##
+
+### SbSocketAddress ###
+
+A representation of any possible supported address type.
+
+#### Members ####
+
+*   `uint8_t address`
+
+    The storage for the address. For IPv4, only the first 4 bytes make up the
+    address. For IPv6, the entire buffer of 16 bytes is meaningful. An address
+    of all zeros means that the address is unspecified.
+*   `SbSocketAddressType type`
+
+    The type of address this represents (IPv4 vs IPv6).
+*   `int port`
+
+    The port component of this socket address. If not specified, it will be
+    zero, which is officially undefined.
+
+### SbSocketResolution ###
+
+The result of a host name resolution.
+
+#### Members ####
+
+*   `SbSocketAddress* addresses`
+
+    An array of addresses associated with the host name.
+*   `int address_count`
+
+    The length of the `addresses` array.
+
+## Functions ##
+
+### SbSocketAccept ###
+
+Accepts a pending connection on `socket` and returns a new SbSocket representing
+that connection. This function sets the error on `socket` and returns
+`kSbSocketInvalid` if it is unable to accept a new connection.
+
+`socket`: The SbSocket that is accepting a pending connection.
+
+#### Declaration ####
+
+```
+SbSocket SbSocketAccept(SbSocket socket)
+```
+
+### SbSocketBind ###
+
+Binds `socket` to a specific local interface and port specified by
+`local_address`. This function sets and returns the socket error if it is unable
+to bind to `local_address`.
+
+`socket`: The SbSocket to be bound to the local interface. `local_address`: The
+local address to which the socket is to be bound. This value must not be `NULL`.
+
+*   Setting the local address to port `0` (or not specifying a port) indicates
+    that the function should choose a port for you.
+
+*   Setting the IP address to `0.0.0.0` means that the socket should be bound to
+    all interfaces.
+
+#### Declaration ####
+
+```
+SbSocketError SbSocketBind(SbSocket socket, const SbSocketAddress *local_address)
+```
+
+### SbSocketClearLastError ###
+
+Clears the last error set on `socket`. The return value indicates whether the
+socket error was cleared.
+
+#### Declaration ####
+
+```
+bool SbSocketClearLastError(SbSocket socket)
+```
+
+### SbSocketConnect ###
+
+Opens a connection of `socket`'s type to the host and port specified by
+`address`. This function sets and returns the socket error if it is unable to
+connect to `address`. (It returns `kSbSocketOk` if it creates the connection
+successfully.)
+
+`socket`: The type of connection that should be opened. `address`: The host and
+port to which the socket should connect.
+
+#### Declaration ####
+
+```
+SbSocketError SbSocketConnect(SbSocket socket, const SbSocketAddress *address)
+```
+
+### SbSocketCreate ###
+
+Creates a new non-blocking socket for protocol `protocol` using address family
+`address_type`.
+
+*   If successful, this function returns the newly created handle.
+
+*   If unsuccessful, this function returns `kSbSocketInvalid` and also sets the
+    last system error appropriately.
+
+`address_type`: The type of IP address to use for the socket. `protocol`: The
+protocol to use for the socket.
+
+#### Declaration ####
+
+```
+SbSocket SbSocketCreate(SbSocketAddressType address_type, SbSocketProtocol protocol)
+```
+
+### SbSocketDestroy ###
+
+Destroys the `socket` by flushing it, closing any connection that may be active
+on it, and reclaiming any resources associated with it, including any
+registration with an `SbSocketWaiter`.
+
+The return value indicates whether the destruction was successful. However, even
+if this function returns `false`, you should not be able to use the socket any
+more.
+
+`socket`: The SbSocket to be destroyed.
+
+#### Declaration ####
+
+```
+bool SbSocketDestroy(SbSocket socket)
+```
+
+### SbSocketFreeResolution ###
+
+Frees a resolution allocated by SbSocketResolve.
+
+`resolution`: The resolution to be freed.
+
+#### Declaration ####
+
+```
+void SbSocketFreeResolution(SbSocketResolution *resolution)
+```
+
+### SbSocketGetInterfaceAddress ###
+
+Gets the source address and the netmask that would be used to connect to the
+destination. The netmask parameter is optional, and only populated if a non-NULL
+parameter is passed in. To determine which source IP will be used, the kernel
+takes into account the protocol, routes, destination ip, etc. The subnet mask,
+aka netmask, is used to find the routing prefix. In IPv6, this should be derived
+from the prefix value.
+
+Returns whether it was possible to determine the source address and the netmask
+(if non-NULL value is passed) to be used to connect to the destination. This
+function could fail if the destination is not reachable, if it an invalid
+address, etc.
+
+`destination`: The destination IP to be connected to. If IP addresses is not
+0.0.0.0 or ::, then temporary addresses may be returned.
+
+If the destination address is 0.0.0.0, and its `type` is
+`kSbSocketAddressTypeIpv4`, then any IPv4 local interface that is up and not a
+loopback interface is a valid return value.
+
+If the destination address is ::, and its `type` is `kSbSocketAddressTypeIpv6`
+then any IPv6 local interface that is up and not loopback or a link-local IP is
+a valid return value. However, in the case of IPv6, the address with the biggest
+scope must be returned. E.g., a globally scoped and routable IP is prefered over
+a unique local address (ULA). Also, the IP address that is returned must be
+permanent.
+
+If destination address is NULL, then any IP address that is valid for
+`destination` set to 0.0.0.0 (IPv4) or :: (IPv6) can be returned.
+
+`out_source_address`: This function places the address of the local interface in
+this output variable. `out_netmask`: This parameter is optional. If a non-NULL
+value is passed in, this function places the netmask associated with the source
+address in this output variable.
+
+#### Declaration ####
+
+```
+bool SbSocketGetInterfaceAddress(const SbSocketAddress *const destination, SbSocketAddress *out_source_address, SbSocketAddress *out_netmask)
+```
+
+### SbSocketGetLastError ###
+
+Returns the last error set on `socket`. If `socket` is not valid, this function
+returns `kSbSocketErrorFailed`.
+
+`socket`: The SbSocket that the last error is returned for.
+
+#### Declaration ####
+
+```
+SbSocketError SbSocketGetLastError(SbSocket socket)
+```
+
+### SbSocketGetLocalAddress ###
+
+Gets the address that this socket is bound to locally, if the socket is
+connected. The return value indicates whether the address was retrieved
+successfully.
+
+`socket`: The SbSocket for which the local address is retrieved. `out_address`:
+The SbSocket's local address.
+
+#### Declaration ####
+
+```
+bool SbSocketGetLocalAddress(SbSocket socket, SbSocketAddress *out_address)
+```
+
+### SbSocketIsConnected ###
+
+Indicates whether `socket` is connected to anything. Invalid sockets are not
+connected.
+
+`socket`: The SbSocket to be checked.
+
+#### Declaration ####
+
+```
+bool SbSocketIsConnected(SbSocket socket)
+```
+
+### SbSocketIsConnectedAndIdle ###
+
+Returns whether `socket` is connected to anything, and, if so, whether it is
+receiving any data.
+
+`socket`: The SbSocket to be checked.
+
+#### Declaration ####
+
+```
+bool SbSocketIsConnectedAndIdle(SbSocket socket)
+```
+
+### SbSocketIsIpv6Supported ###
+
+Returns whether IPV6 is supported on the current platform.
+
+#### Declaration ####
+
+```
+bool SbSocketIsIpv6Supported()
+```
+
+### SbSocketIsValid ###
+
+Returns whether the given socket handle is valid.
+
+#### Declaration ####
+
+```
+static bool SbSocketIsValid(SbSocket socket)
+```
+
+### SbSocketJoinMulticastGroup ###
+
+Joins `socket` to an IP multicast group identified by `address`. The equivalent
+of IP_ADD_MEMBERSHIP. The return value indicates whether the socket was joined
+to the group successfully.
+
+`socket`: The SbSocket to be joined to the IP multicast group. `address`: The
+location of the IP multicast group.
+
+#### Declaration ####
+
+```
+bool SbSocketJoinMulticastGroup(SbSocket socket, const SbSocketAddress *address)
+```
+
+### SbSocketListen ###
+
+Causes `socket` to listen on the local address that `socket` was previously
+bound to by SbSocketBind. This function sets and returns the socket error if it
+is unable to listen for some reason. (It returns `kSbSocketOk` if it creates the
+connection successfully.)
+
+`socket`: The SbSocket on which the function operates.
+
+#### Declaration ####
+
+```
+SbSocketError SbSocketListen(SbSocket socket)
+```
+
+### SbSocketReceiveFrom ###
+
+Reads up to `data_size` bytes from `socket` into `out_data` and places the
+source address of the packet in `out_source` if out_source is not NULL. Returns
+the number of bytes read, or a negative number if there is an error, in which
+case SbSocketGetLastError can provide the precise error encountered.
+
+Note that this function is NOT specified to make a best effort to read all data
+on all platforms, but it MAY still do so. It is specified to read however many
+bytes are available conveniently, meaning that it should avoid blocking until
+there is data. It can be run in a loop until SbSocketGetLastError returns
+`kSbSocketPending` to make it a best-effort read (but still only up to not
+blocking, unless you want to spin).
+
+The primary use of `out_source` is to receive datagram packets from multiple
+sources on a UDP server socket. TCP has two endpoints connected persistently, so
+the address is unnecessary, but allowed.
+
+`socket`: The SbSocket from which data is read. `out_data`: The data read from
+the socket. `data_size`: The number of bytes to read. `out_source`: The source
+address of the packet.
+
+#### Declaration ####
+
+```
+int SbSocketReceiveFrom(SbSocket socket, char *out_data, int data_size, SbSocketAddress *out_source)
+```
+
+### SbSocketResolve ###
+
+Synchronously resolves `hostname` into the returned SbSocketResolution , which
+must be freed with SbSocketFreeResolution. The function returns `NULL` if it is
+unable to resolve `hostname`.
+
+`hostname`: The hostname to be resolved. `filters`: A mask of
+SbSocketResolveFilter values used to filter the resolution. If `filters` does
+not specify an IP address family filter, all address families are included.
+However, if one IP address family filter is specified, only that address family
+is included. The function ignores unrecognized filter bits.
+
+#### Declaration ####
+
+```
+SbSocketResolution* SbSocketResolve(const char *hostname, int filters)
+```
+
+### SbSocketSendTo ###
+
+Writes up to `data_size` bytes of `data` to `destination` via `socket`. Returns
+the number of bytes written, or a negative number if there is an error, in which
+case `SbSocketGetLastError` can provide the precise error encountered.
+
+Note that this function is NOT specified to make a best effort to write all data
+on all platforms, but it MAY still do so. It is specified to write however many
+bytes are available conveniently. It can be run in a loop until
+SbSocketGetLastError returns `kSbSocketPending` to make it a best-effort write
+(but still only up to not blocking, unless you want to spin).
+
+`socket`: The SbSocket to use to write data. `data`: The data read from the
+socket. `data_size`: The number of bytes of `data` to write. `destination`: The
+location to which data is written. This value must be `NULL` for TCP
+connections, which can only have a single endpoint.
+
+The primary use of `destination` is to send datagram packets, which can go out
+to multiple sources from a single UDP server socket. TCP has two endpoints
+connected persistently, so setting `destination` when sending to a TCP socket
+will cause an error.
+
+#### Declaration ####
+
+```
+int SbSocketSendTo(SbSocket socket, const char *data, int data_size, const SbSocketAddress *destination)
+```
+
+### SbSocketSetBroadcast ###
+
+Sets the `SO_BROADCAST`, or equivalent, option to `value` on `socket`. The
+return value indicates whether the option was actually set.
+
+This option is only meaningful for UDP sockets and allows the socket to send to
+the broadcast address.
+
+`socket`: The SbSocket for which the option is set. `value`: The new value for
+the option.
+
+#### Declaration ####
+
+```
+bool SbSocketSetBroadcast(SbSocket socket, bool value)
+```
+
+### SbSocketSetReceiveBufferSize ###
+
+Sets the `SO_RCVBUF`, or equivalent, option to `size` on `socket`. The return
+value indicates whether the option was actually set.
+
+`socket`: The SbSocket for which the option is set. `size`: The value for the
+option.
+
+#### Declaration ####
+
+```
+bool SbSocketSetReceiveBufferSize(SbSocket socket, int32_t size)
+```
+
+### SbSocketSetReuseAddress ###
+
+Sets the `SO_REUSEADDR`, or equivalent, option to `value` on `socket`. The
+return value indicates whether the option was actually set.
+
+This option allows a bound address to be reused if a socket isn't actively bound
+to it.
+
+`socket`: The SbSocket for which the option is set. `value`: The new value for
+the option.
+
+#### Declaration ####
+
+```
+bool SbSocketSetReuseAddress(SbSocket socket, bool value)
+```
+
+### SbSocketSetSendBufferSize ###
+
+Sets the `SO_SNDBUF`, or equivalent, option to `size` on `socket`. The return
+value indicates whether the option was actually set.
+
+`socket`: The SbSocket for which the option is set. `size`: The value for the
+option.
+
+#### Declaration ####
+
+```
+bool SbSocketSetSendBufferSize(SbSocket socket, int32_t size)
+```
+
+### SbSocketSetTcpKeepAlive ###
+
+Sets the `SO_KEEPALIVE`, or equivalent, option to `value` on `socket`. The
+return value indicates whether the option was actually set.
+
+`socket`: The SbSocket for which the option is set. `value`: If set to `true`,
+then `period` specifies the minimum time (SbTime) is always in microseconds)
+between keep-alive packets. If set to `false`, `period` is ignored. `period`:
+The time between keep-alive packets. This value is only relevant if `value` is
+`true`.
+
+#### Declaration ####
+
+```
+bool SbSocketSetTcpKeepAlive(SbSocket socket, bool value, SbTime period)
+```
+
+### SbSocketSetTcpNoDelay ###
+
+Sets the `TCP_NODELAY`, or equivalent, option to `value` on `socket`. The return
+value indicates whether the option was actually set.
+
+This function disables the Nagle algorithm for reducing the number of packets
+sent when converting from a stream to packets. Disabling Nagle generally puts
+the data for each Send call into its own packet, but does not guarantee that
+behavior.
+
+`socket`: The SbSocket for which the option is set. `value`: Indicates whether
+the Nagle algorithm should be disabled (`value`=`true`).
+
+#### Declaration ####
+
+```
+bool SbSocketSetTcpNoDelay(SbSocket socket, bool value)
+```
+
+### SbSocketSetTcpWindowScaling ###
+
+Sets the `SO_WINSCALE`, or equivalent, option to `value` on `socket`. The return
+value indicates whether the option was actually set.
+
+`socket`: The SbSocket for which the option is set. `value`: The value for the
+option.
+
+#### Declaration ####
+
+```
+bool SbSocketSetTcpWindowScaling(SbSocket socket, bool value)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/socket_waiter.md b/src/cobalt/site/docs/reference/starboard/modules/12/socket_waiter.md
similarity index 100%
copy from src/cobalt/site/docs/reference/starboard/modules/4/socket_waiter.md
copy to src/cobalt/site/docs/reference/starboard/modules/12/socket_waiter.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/speech_recognizer.md b/src/cobalt/site/docs/reference/starboard/modules/12/speech_recognizer.md
new file mode 100644
index 0000000..0a1dc6b
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/speech_recognizer.md
@@ -0,0 +1,269 @@
+---
+layout: doc
+title: "Starboard Module Reference: speech_recognizer.h"
+---
+
+Defines a streaming speech recognizer API. It provides access to the platform
+speech recognition service.
+
+Note that there can be only one speech recognizer. Attempting to create a second
+speech recognizer without destroying the first one will result in undefined
+behavior.
+
+`SbSpeechRecognizerCreate`, `SbSpeechRecognizerStart`, `SbSpeechRecognizerStop`,
+`SbSpeechRecognizerCancel` and `SbSpeechRecognizerDestroy` should be called from
+a single thread. Callbacks defined in `SbSpeechRecognizerHandler` will happen on
+another thread, so calls back into the SbSpeechRecognizer from the callback
+thread are disallowed.
+
+## Macros ##
+
+### kSbSpeechRecognizerInvalid ###
+
+Well-defined value for an invalid speech recognizer handle.
+
+## Enums ##
+
+### SbSpeechRecognizerError ###
+
+Indicates what has gone wrong with the recognition.
+
+#### Values ####
+
+*   `kSbNoSpeechError`
+
+    No speech was detected. Speech timed out.
+*   `kSbAborted`
+
+    Speech input was aborted somehow.
+*   `kSbAudioCaptureError`
+
+    Audio capture failed.
+*   `kSbNetworkError`
+
+    Some network communication that was required to complete the recognition
+    failed.
+*   `kSbNotAllowed`
+
+    The implementation is not allowing any speech input to occur for reasons of
+    security, privacy or user preference.
+*   `kSbServiceNotAllowed`
+
+    The implementation is not allowing the application requested speech service,
+    but would allow some speech service, to be used either because the
+    implementation doesn't support the selected one or because of reasons of
+    security, privacy or user preference.
+*   `kSbBadGrammar`
+
+    There was an error in the speech recognition grammar or semantic tags, or
+    the grammar format or semantic tag format is supported.
+*   `kSbLanguageNotSupported`
+
+    The language was not supported.
+
+## Typedefs ##
+
+### SbSpeechRecognizer ###
+
+An opaque handle to an implementation-private structure that represents a speech
+recognizer.
+
+#### Definition ####
+
+```
+typedef struct SbSpeechRecognizerPrivate* SbSpeechRecognizer
+```
+
+### SbSpeechRecognizerErrorFunction ###
+
+A function to notify that a speech recognition error occurred. `error`: The
+occurred speech recognition error.
+
+#### Definition ####
+
+```
+typedef void(* SbSpeechRecognizerErrorFunction) (void *context, SbSpeechRecognizerError error)
+```
+
+### SbSpeechRecognizerResultsFunction ###
+
+A function to notify that the recognition results are ready. `results`: the list
+of recognition results. `results_size`: the number of `results`. `is_final`:
+indicates if the `results` is final.
+
+#### Definition ####
+
+```
+typedef void(* SbSpeechRecognizerResultsFunction) (void *context, SbSpeechResult *results, int results_size, bool is_final)
+```
+
+### SbSpeechRecognizerSpeechDetectedFunction ###
+
+A function to notify that the user has started to speak or stops speaking.
+`detected`: true if the user has started to speak, and false if the user stops
+speaking.
+
+#### Definition ####
+
+```
+typedef void(* SbSpeechRecognizerSpeechDetectedFunction) (void *context, bool detected)
+```
+
+## Structs ##
+
+### SbSpeechConfiguration ###
+
+#### Members ####
+
+*   `bool continuous`
+
+    When the continuous value is set to false, the implementation MUST return no
+    more than one final result in response to starting recognition. When the
+    continuous attribute is set to true, the implementation MUST return zero or
+    more final results representing multiple consecutive recognitions in
+    response to starting recognition. This attribute setting does not affect
+    interim results.
+*   `bool interim_results`
+
+    Controls whether interim results are returned. When set to true, interim
+    results SHOULD be returned. When set to false, interim results MUST NOT be
+    returned. This value setting does not affect final results.
+*   `int max_alternatives`
+
+    This sets the maximum number of SbSpeechResult in
+    `SbSpeechRecognizerOnResults` callback.
+
+### SbSpeechRecognizerHandler ###
+
+Allows receiving notifications from the device when recognition related events
+occur.
+
+The void* context is passed to every function.
+
+#### Members ####
+
+*   `SbSpeechRecognizerSpeechDetectedFunction on_speech_detected`
+
+    Function to notify the beginning/end of the speech.
+*   `SbSpeechRecognizerErrorFunction on_error`
+
+    Function to notify the speech error.
+*   `SbSpeechRecognizerResultsFunction on_results`
+
+    Function to notify that the recognition results are available.
+*   `void * context`
+
+    This is passed to handler functions as first argument.
+
+### SbSpeechResult ###
+
+The recognition response that is received from the recognizer.
+
+#### Members ####
+
+*   `char * transcript`
+
+    The raw words that the user spoke.
+*   `float confidence`
+
+    A numeric estimate between 0 and 1 of how confident the recognition system
+    is that the recognition is correct. A higher number means the system is more
+    confident. NaN represents an unavailable confidence score.
+
+## Functions ##
+
+### SbSpeechRecognizerCancel ###
+
+Cancels speech recognition. The speech recognizer stops listening to audio and
+does not return any information. When `SbSpeechRecognizerCancel` is called, the
+implementation MUST NOT collect additional audio, MUST NOT continue to listen to
+the user, and MUST stop recognizing. This is important for privacy reasons. If
+`SbSpeechRecognizerCancel` is called on a speech recognizer which is already
+stopped or cancelled, the implementation MUST ignore the call.
+
+#### Declaration ####
+
+```
+void SbSpeechRecognizerCancel(SbSpeechRecognizer recognizer)
+```
+
+### SbSpeechRecognizerCreate ###
+
+Creates a speech recognizer with a speech recognizer handler.
+
+If the system has a speech recognition service available, this function returns
+the newly created handle.
+
+If no speech recognition service is available on the device, this function
+returns `kSbSpeechRecognizerInvalid`.
+
+`SbSpeechRecognizerCreate` does not expect the passed SbSpeechRecognizerHandler
+structure to live after `SbSpeechRecognizerCreate` is called, so the
+implementation must copy the contents if necessary.
+
+#### Declaration ####
+
+```
+SbSpeechRecognizer SbSpeechRecognizerCreate(const SbSpeechRecognizerHandler *handler)
+```
+
+### SbSpeechRecognizerDestroy ###
+
+Destroys the given speech recognizer. If the speech recognizer is in the started
+state, it is first stopped and then destroyed.
+
+#### Declaration ####
+
+```
+void SbSpeechRecognizerDestroy(SbSpeechRecognizer recognizer)
+```
+
+### SbSpeechRecognizerIsSupported ###
+
+Returns whether the platform supports SbSpeechRecognizer.
+
+#### Declaration ####
+
+```
+bool SbSpeechRecognizerIsSupported()
+```
+
+### SbSpeechRecognizerIsValid ###
+
+Indicates whether the given speech recognizer is valid.
+
+#### Declaration ####
+
+```
+static bool SbSpeechRecognizerIsValid(SbSpeechRecognizer recognizer)
+```
+
+### SbSpeechRecognizerStart ###
+
+Starts listening to audio and recognizing speech with the specified speech
+configuration. If `SbSpeechRecognizerStart` is called on an already started
+speech recognizer, the implementation MUST ignore the call and return false.
+
+Returns whether the speech recognizer is started successfully.
+
+#### Declaration ####
+
+```
+bool SbSpeechRecognizerStart(SbSpeechRecognizer recognizer, const SbSpeechConfiguration *configuration)
+```
+
+### SbSpeechRecognizerStop ###
+
+Stops listening to audio and returns a result using just the audio that it has
+already received. Once `SbSpeechRecognizerStop` is called, the implementation
+MUST NOT collect additional audio and MUST NOT continue to listen to the user.
+This is important for privacy reasons. If `SbSpeechRecognizerStop` is called on
+a speech recognizer which is already stopped or being stopped, the
+implementation MUST ignore the call.
+
+#### Declaration ####
+
+```
+void SbSpeechRecognizerStop(SbSpeechRecognizer recognizer)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/speech_synthesis.md b/src/cobalt/site/docs/reference/starboard/modules/12/speech_synthesis.md
new file mode 100644
index 0000000..39bdec2
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/speech_synthesis.md
@@ -0,0 +1,52 @@
+---
+layout: doc
+title: "Starboard Module Reference: speech_synthesis.h"
+---
+
+A basic text-to-speech API intended to be used for audio accessibilty.
+
+Implementations of this API should audibly play back text to assist users in
+non-visual navigation of the application.
+
+Note that these functions do not have to be thread-safe. They must only be
+called from a single application thread.
+
+## Functions ##
+
+### SbSpeechSynthesisCancel ###
+
+Cancels all speaking and queued speech synthesis audio. Must return immediately.
+
+#### Declaration ####
+
+```
+void SbSpeechSynthesisCancel()
+```
+
+### SbSpeechSynthesisIsSupported ###
+
+Returns whether the platform supports speech synthesis
+
+#### Declaration ####
+
+```
+bool SbSpeechSynthesisIsSupported()
+```
+
+### SbSpeechSynthesisSpeak ###
+
+Enqueues `text`, a UTF-8 string, to be spoken. Returns immediately.
+
+Spoken language for the text should be the same as the locale returned by
+SbSystemGetLocaleId().
+
+If audio from previous SbSpeechSynthesisSpeak() invocations is still processing,
+the current speaking should continue and this new text should be queued to play
+when the previous utterances are complete.
+
+#### Declaration ####
+
+```
+void SbSpeechSynthesisSpeak(const char *text)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/storage.md b/src/cobalt/site/docs/reference/starboard/modules/12/storage.md
new file mode 100644
index 0000000..c98207b
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/storage.md
@@ -0,0 +1,159 @@
+---
+layout: doc
+title: "Starboard Module Reference: storage.h"
+---
+
+Defines a user-based Storage API. This is a simple, all-at-once BLOB storage and
+retrieval API that is intended for robust long-term, per-user storage. Some
+platforms have different mechanisms for this kind of storage, so this API exists
+to allow a client application to access this kind of storage.
+
+Note that there can be only one storage record per user and, thus, a maximum of
+one open storage record can exist for each user. Attempting to open a second
+record for a user will result in undefined behavior.
+
+These APIs are NOT expected to be thread-safe, so either call them from a single
+thread, or perform proper synchronization around all calls.
+
+## Macros ##
+
+### kSbStorageInvalidRecord ###
+
+Well-defined value for an invalid storage record handle.
+
+## Typedefs ##
+
+### SbStorageRecord ###
+
+A handle to an open storage record.
+
+#### Definition ####
+
+```
+typedef SbStorageRecordPrivate* SbStorageRecord
+```
+
+## Functions ##
+
+### SbStorageCloseRecord ###
+
+Closes `record`, synchronously ensuring that all written data is flushed. This
+function performs blocking I/O on the calling thread.
+
+The return value indicates whether the operation succeeded. Storage writes
+should be as atomic as possible, so the record should either be fully written or
+deleted (or, even better, untouched).
+
+`record`: The storage record to close. `record` is invalid after this point, and
+subsequent calls referring to `record` will fail.
+
+#### Declaration ####
+
+```
+bool SbStorageCloseRecord(SbStorageRecord record)
+```
+
+### SbStorageDeleteRecord ###
+
+Deletes the `SbStorageRecord` for `user` named `name`. The return value
+indicates whether the record existed and was successfully deleted. If the record
+did not exist or could not be deleted, the function returns `false`.
+
+If `name` is NULL, deletes the default storage record for the user, like what
+would have been deleted with the previous version of SbStorageDeleteRecord.
+
+This function must not be called while the user's storage record is open. This
+function performs blocking I/O on the calling thread.
+
+`user`: The user for whom the record will be deleted. `name`: The filesystem-
+safe name of the record to open.
+
+#### Declaration ####
+
+```
+bool SbStorageDeleteRecord(SbUser user, const char *name)
+```
+
+### SbStorageGetRecordSize ###
+
+Returns the size of `record`, or `-1` if there is an error. This function
+performs blocking I/O on the calling thread.
+
+`record`: The record to retrieve the size of.
+
+#### Declaration ####
+
+```
+int64_t SbStorageGetRecordSize(SbStorageRecord record)
+```
+
+### SbStorageIsValidRecord ###
+
+Returns whether the given storage record handle is valid.
+
+#### Declaration ####
+
+```
+static bool SbStorageIsValidRecord(SbStorageRecord record)
+```
+
+### SbStorageOpenRecord ###
+
+Opens and returns the SbStorageRecord for `user` named `name`, blocking I/O on
+the calling thread until the open is completed. If `user` is not a valid
+`SbUser`, the function returns `kSbStorageInvalidRecord`. Will return an
+`SbStorageRecord` of size zero if the record does not yet exist. Opening an
+already-open `SbStorageRecord` has undefined behavior.
+
+If `name` is NULL, opens the default storage record for the user, like what
+would have been saved with the previous version of SbStorageOpenRecord.
+
+`user`: The user for which the storage record will be opened. `name`: The
+filesystem-safe name of the record to open.
+
+#### Declaration ####
+
+```
+SbStorageRecord SbStorageOpenRecord(SbUser user, const char *name)
+```
+
+### SbStorageReadRecord ###
+
+Reads up to `data_size` bytes from `record`, starting at the beginning of the
+record. The function returns the actual number of bytes read, which must be <=
+`data_size`. The function returns `-1` in the event of an error. This function
+makes a best-effort to read the entire record, and it performs blocking I/O on
+the calling thread until the entire record is read or an error is encountered.
+
+`record`: The record to be read. `out_data`: The data read from the record.
+`data_size`: The amount of data, in bytes, to read.
+
+#### Declaration ####
+
+```
+int64_t SbStorageReadRecord(SbStorageRecord record, char *out_data, int64_t data_size)
+```
+
+### SbStorageWriteRecord ###
+
+Replaces the data in `record` with `data_size` bytes from `data`. This function
+always deletes any previous data in that record. The return value indicates
+whether the write succeeded. This function makes a best-effort to write the
+entire record, and it may perform blocking I/O on the calling thread until the
+entire record is written or an error is encountered.
+
+While `SbStorageWriteRecord()` may defer the persistence,
+`SbStorageReadRecord()` is expected to work as expected immediately afterwards,
+even without a call to `SbStorageCloseRecord()`. The data should be persisted
+after a short time, even if there is an unexpected process termination before
+`SbStorageCloseRecord()` is called.
+
+`record`: The record to be written to. `data`: The data to write to the record.
+`data_size`: The amount of `data`, in bytes, to write to the record.
+
+#### Declaration ####
+
+```
+bool SbStorageWriteRecord(SbStorageRecord record, const char *data, int64_t data_size)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/string.md b/src/cobalt/site/docs/reference/starboard/modules/12/string.md
similarity index 100%
copy from src/cobalt/site/docs/reference/starboard/modules/4/string.md
copy to src/cobalt/site/docs/reference/starboard/modules/12/string.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/system.md b/src/cobalt/site/docs/reference/starboard/modules/12/system.md
new file mode 100644
index 0000000..5ebc582
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/system.md
@@ -0,0 +1,707 @@
+---
+layout: doc
+title: "Starboard Module Reference: system.h"
+---
+
+Defines a broad set of APIs that allow the client application to query build and
+runtime properties of the enclosing system.
+
+## Enums ##
+
+### SbSystemCapabilityId ###
+
+Runtime capabilities are boolean properties of a platform that can't be
+determined at compile-time. They may vary from device to device, but they will
+not change over the course of a single execution. They often specify particular
+behavior of other APIs within the bounds of their operating range.
+
+#### Values ####
+
+*   `kSbSystemCapabilityReversedEnterAndBack`
+
+    Whether this system has reversed Enter and Back keys.
+*   `kSbSystemCapabilityCanQueryGPUMemoryStats`
+
+    Whether this system has the ability to report on GPU memory usage. If (and
+    only if) a system has this capability will SbSystemGetTotalGPUMemory() and
+    SbSystemGetUsedGPUMemory() be valid to call.
+*   `kSbSystemCapabilitySetsInputTimestamp`
+
+    Whether this system sets the `timestamp` field of SbInputData . If the
+    system does not set this field, then it will automatically be set; however,
+    the relative time between input events likely will not be preserved, so
+    time-related calculations (e.g. velocity for move events) will be incorrect.
+
+### SbSystemConnectionType ###
+
+Enumeration of network connection types.
+
+#### Values ####
+
+*   `kSbSystemConnectionTypeWired`
+
+    The system is on a wired connection.
+*   `kSbSystemConnectionTypeWireless`
+
+    The system is on a wireless connection.
+*   `kSbSystemConnectionTypeUnknown`
+
+    The system connection type is unknown.
+
+### SbSystemDeviceType ###
+
+Enumeration of device types.
+
+#### Values ####
+
+*   `kSbSystemDeviceTypeBlueRayDiskPlayer`
+
+    Blue-ray Disc Player (BDP).
+*   `kSbSystemDeviceTypeGameConsole`
+
+    A relatively high-powered TV device used primarily for playing games.
+*   `kSbSystemDeviceTypeOverTheTopBox`
+
+    Over the top (OTT) devices stream content via the Internet over another type
+    of network, e.g. cable or satellite.
+*   `kSbSystemDeviceTypeSetTopBox`
+
+    Set top boxes (STBs) stream content primarily over cable or satellite. Some
+    STBs can also stream OTT content via the Internet.
+*   `kSbSystemDeviceTypeTV`
+
+    A Smart TV is a TV that can directly run applications that stream OTT
+    content via the Internet.
+*   `kSbSystemDeviceTypeDesktopPC`
+
+    Desktop PC.
+*   `kSbSystemDeviceTypeAndroidTV`
+
+    An Android TV Device.
+*   `kSbSystemDeviceTypeUnknown`
+
+    Unknown device.
+
+### SbSystemPathId ###
+
+Enumeration of special paths that the platform can define.
+
+#### Values ####
+
+*   `kSbSystemPathContentDirectory`
+
+    Path to where the local content files that ship with the binary are
+    available.
+*   `kSbSystemPathCacheDirectory`
+
+    Path to the directory that can be used as a local file cache, if available.
+*   `kSbSystemPathDebugOutputDirectory`
+
+    Path to the directory where debug output (e.g. logs, trace output,
+    screenshots) can be written into.
+*   `kSbSystemPathFontDirectory`
+
+    Path to a directory where system font files can be found. Should only be
+    specified on platforms that provide fonts usable by Starboard applications.
+*   `kSbSystemPathFontConfigurationDirectory`
+
+    Path to a directory where system font configuration metadata can be found.
+    May be the same directory as `kSbSystemPathFontDirectory`, but not
+    necessarily. Should only be specified on platforms that provide fonts usable
+    by Starboard applications.
+*   `kSbSystemPathTempDirectory`
+
+    Path to a directory where temporary files can be written.
+*   `kSbSystemPathTestOutputDirectory`
+
+    Path to a directory where test results can be written.
+*   `kSbSystemPathExecutableFile`
+
+    Full path to the executable file.
+*   `kSbSystemPathStorageDirectory`
+
+    Path to a directory for permanent file storage. Both read and write access
+    is required. This is where an app may store its persistent settings. The
+    location should be user agnostic if possible.
+
+### SbSystemPlatformErrorResponse ###
+
+Possible responses for `SbSystemPlatformErrorCallback`.
+
+#### Values ####
+
+*   `kSbSystemPlatformErrorResponsePositive`
+*   `kSbSystemPlatformErrorResponseNegative`
+*   `kSbSystemPlatformErrorResponseCancel`
+
+### SbSystemPlatformErrorType ###
+
+Enumeration of possible values for the `type` parameter passed to the
+`SbSystemRaisePlatformError` function.
+
+#### Values ####
+
+*   `kSbSystemPlatformErrorTypeConnectionError`
+
+    Cobalt received a network connection error, or a network disconnection
+    event. If the `response` passed to `SbSystemPlatformErrorCallback` is
+    `kSbSystemPlatformErrorResponsePositive` then the request should be retried,
+    otherwise the app should be stopped.
+
+### SbSystemPropertyId ###
+
+System properties that can be queried for. Many of these are used in User-Agent
+string generation.
+
+#### Values ####
+
+*   `kSbSystemPropertyCertificationScope`
+
+    The certification scope that identifies a group of devices.
+*   `kSbSystemPropertyBase64EncodedCertificationSecret`
+
+    The HMAC-SHA256 base64 encoded symmetric key used to sign a subset of the
+    query parameters from the application startup URL.
+*   `kSbSystemPropertyChipsetModelNumber`
+
+    The full model number of the main platform chipset, including any vendor-
+    specific prefixes.
+*   `kSbSystemPropertyFirmwareVersion`
+
+    The production firmware version number which the device is currently
+    running.
+*   `kSbSystemPropertyFriendlyName`
+
+    A friendly name for this actual device. It may include user-personalization
+    like "Upstairs Bedroom." It may be displayed to users as part of some kind
+    of device selection (e.g. in-app DIAL).
+*   `kSbSystemPropertyManufacturerName`
+
+    A deprecated alias for `kSbSystemPropertyBrandName`.
+*   `kSbSystemPropertyBrandName`
+
+    The name of the brand under which the device is being sold.
+*   `kSbSystemPropertyModelName`
+
+    The final production model number of the device.
+*   `kSbSystemPropertyModelYear`
+
+    The year the device was launched, e.g. "2016".
+*   `kSbSystemPropertyOriginalDesignManufacturerName`
+
+    The corporate entity responsible for the manufacturing/assembly of the
+    device on behalf of the business entity owning the brand. This is often
+    abbreviated as ODM.
+*   `kSbSystemPropertyPlatformName`
+
+    The name of the operating system and platform, suitable for inclusion in a
+    User-Agent, say.
+*   `kSbSystemPropertySpeechApiKey`
+
+    The Google Speech API key. The platform manufacturer is responsible for
+    registering a Google Speech API key for their products. In the API Console (
+    [http://developers.google.com/console](http://developers.google.com/console)
+    ), you can enable the Speech APIs and generate a Speech API key.
+*   `kSbSystemPropertyUserAgentAuxField`
+
+    A field that, if available, is appended to the user agent
+
+## Typedefs ##
+
+### SbSystemComparator ###
+
+Pointer to a function to compare two items. The return value uses standard
+`*cmp` semantics:
+
+*   `< 0` if `a` is less than `b`
+
+*   `0` if the two items are equal
+
+*   `> 1` if `a` is greater than `b`
+
+`a`: The first value to compare. `b`: The second value to compare.
+
+#### Definition ####
+
+```
+typedef int(* SbSystemComparator) (const void *a, const void *b)
+```
+
+### SbSystemError ###
+
+A type that can represent a system error code across all Starboard platforms.
+
+#### Definition ####
+
+```
+typedef int SbSystemError
+```
+
+### SbSystemPlatformErrorCallback ###
+
+Type of callback function that may be called in response to an error
+notification from `SbSystemRaisePlatformError`. `response` is a code to indicate
+the user's response, e.g. if the platform raised a dialog to notify the user of
+the error. `user_data` is the opaque pointer that was passed to the call to
+`SbSystemRaisePlatformError`.
+
+#### Definition ####
+
+```
+typedef void(* SbSystemPlatformErrorCallback) (SbSystemPlatformErrorResponse response, void *user_data)
+```
+
+## Functions ##
+
+### SbSystemBinarySearch ###
+
+Binary searches a sorted table `base` of `element_count` objects, each element
+`element_width` bytes in size for an element that `comparator` compares equal to
+`key`.
+
+This function is meant to be a drop-in replacement for `bsearch`.
+
+`key`: The key to search for in the table. `base`: The sorted table of elements
+to be searched. `element_count`: The number of elements in the table.
+`element_width`: The size, in bytes, of each element in the table. `comparator`:
+A value that indicates how the element in the table should compare to the
+specified `key`.
+
+#### Declaration ####
+
+```
+void* SbSystemBinarySearch(const void *key, const void *base, size_t element_count, size_t element_width, SbSystemComparator comparator)
+```
+
+### SbSystemBreakIntoDebugger ###
+
+Breaks the current program into the debugger, if a debugger is attached. If a
+debugger is not attached, this function aborts the program.
+
+#### Declaration ####
+
+```
+SB_NORETURN void SbSystemBreakIntoDebugger()
+```
+
+### SbSystemClearLastError ###
+
+Clears the last error set by a Starboard call in the current thread.
+
+#### Declaration ####
+
+```
+void SbSystemClearLastError()
+```
+
+### SbSystemGetConnectionType ###
+
+Returns the device's current network connection type.
+
+#### Declaration ####
+
+```
+SbSystemConnectionType SbSystemGetConnectionType()
+```
+
+### SbSystemGetDeviceType ###
+
+Returns the type of the device.
+
+#### Declaration ####
+
+```
+SbSystemDeviceType SbSystemGetDeviceType()
+```
+
+### SbSystemGetErrorString ###
+
+Generates a human-readable string for an error. The return value specifies the
+total desired length of the string.
+
+`error`: The error for which a human-readable string is generated. `out_string`:
+The generated string. This value may be null, and it is always terminated with a
+null byte. `string_length`: The maximum length of the error string.
+
+#### Declaration ####
+
+```
+int SbSystemGetErrorString(SbSystemError error, char *out_string, int string_length)
+```
+
+### SbSystemGetLastError ###
+
+Gets the last platform-specific error code produced by any Starboard call in the
+current thread for diagnostic purposes. Semantic reactions to Starboard function
+call results should be modeled explicitly.
+
+#### Declaration ####
+
+```
+SbSystemError SbSystemGetLastError()
+```
+
+### SbSystemGetLocaleId ###
+
+Gets the system's current POSIX-style Locale ID. The locale represents the
+location, language, and cultural conventions that the system wants to use, which
+affects which text is displayed to the user as well as how displayed numbers,
+dates, currency, and similar values are formatted.
+
+At its simplest, the locale ID can just be a BCP 47 language code, like `en_US`.
+Currently, POSIX also wants to include the encoding as in `en_US.UTF8`. POSIX
+also allows a couple very bare-bones locales, like "C" or "POSIX", but they are
+not supported here. POSIX also supports different locale settings for a few
+different purposes, but Starboard only exposes one locale at a time.
+
+RFC 5646 describes BCP 47 language codes: [https://tools.ietf.org/html/bcp47](https://tools.ietf.org/html/bcp47)
+
+For more information than you probably want about POSIX locales, see: [http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html)
+
+#### Declaration ####
+
+```
+const char* SbSystemGetLocaleId()
+```
+
+### SbSystemGetNumberOfProcessors ###
+
+Returns the number of processor cores available to this application. If the
+process is sandboxed to a subset of the physical cores, the function returns
+that sandboxed limit.
+
+#### Declaration ####
+
+```
+int SbSystemGetNumberOfProcessors()
+```
+
+### SbSystemGetProperty ###
+
+Retrieves the platform-defined system property specified by `property_id` and
+places its value as a zero-terminated string into the user-allocated `out_value`
+unless it is longer than `value_length` - 1. This implementation must be thread-
+safe.
+
+This function returns `true` if the property is retrieved successfully. It
+returns `false` under any of the following conditions and, in any such case,
+`out_value` is not changed:
+
+*   `property_id` is invalid for this platform
+
+*   `value_length` is too short for the given result
+
+*   `out_value` is NULL
+
+`property_id`: The system path to be retrieved. `out_value`: The platform-
+defined system property specified by `property_id`. `value_length`: The length
+of the system property.
+
+#### Declaration ####
+
+```
+bool SbSystemGetProperty(SbSystemPropertyId property_id, char *out_value, int value_length)
+```
+
+### SbSystemGetRandomData ###
+
+A cryptographically secure random number generator that produces an arbitrary,
+non-negative number of `buffer_size` random, non-negative bytes. The generated
+number is placed in `out_buffer`. This function does not require manual seeding.
+
+`out_buffer`: A pointer for the generated random number. This value must not be
+null. `buffer_size`: The size of the random number, in bytes.
+
+#### Declaration ####
+
+```
+void SbSystemGetRandomData(void *out_buffer, int buffer_size)
+```
+
+### SbSystemGetRandomUInt64 ###
+
+A cryptographically secure random number generator that gets 64 random bits and
+returns them as an `uint64_t`. This function does not require manual seeding.
+
+#### Declaration ####
+
+```
+uint64_t SbSystemGetRandomUInt64()
+```
+
+### SbSystemGetStack ###
+
+Places up to `stack_size` instruction pointer addresses of the current execution
+stack into `out_stack`. The return value specifies the number of entries added.
+
+The returned stack frames are in "downward" order from the calling frame toward
+the entry point of the thread. So, if all the stack frames do not fit, the ones
+truncated will be the less interesting ones toward the thread entry point.
+
+This function is used in crash signal handlers and, therefore, it must be async-
+signal-safe on platforms that support signals. The following document discusses
+what it means to be async-signal-safe on POSIX: [http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html#tag_02_04_03](http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html#tag_02_04_03)
+
+`out_stack`: A non-NULL array of `void *` of at least `stack_size` entries.
+`stack_size`: The maximum number of instruction pointer addresses to be placed
+into `out_stack` from the current execution stack.
+
+#### Declaration ####
+
+```
+int SbSystemGetStack(void **out_stack, int stack_size)
+```
+
+### SbSystemGetTotalCPUMemory ###
+
+Returns the total CPU memory (in bytes) potentially available to this
+application. If the process is sandboxed to a maximum allowable limit, the
+function returns the lesser of the physical and sandbox limits.
+
+#### Declaration ####
+
+```
+int64_t SbSystemGetTotalCPUMemory()
+```
+
+### SbSystemGetTotalGPUMemory ###
+
+Returns the total GPU memory (in bytes) available for use by this application.
+This function may only be called the return value for calls to
+SbSystemHasCapability(kSbSystemCapabilityCanQueryGPUMemoryStats) is `true`.
+
+#### Declaration ####
+
+```
+int64_t SbSystemGetTotalGPUMemory()
+```
+
+### SbSystemGetUsedCPUMemory ###
+
+Returns the total physical CPU memory (in bytes) used by this application. This
+value should always be less than (or, in particularly exciting situations, equal
+to) SbSystemGetTotalCPUMemory().
+
+#### Declaration ####
+
+```
+int64_t SbSystemGetUsedCPUMemory()
+```
+
+### SbSystemGetUsedGPUMemory ###
+
+Returns the current amount of GPU memory (in bytes) that is currently being used
+by this application. This function may only be called if the return value for
+calls to SbSystemHasCapability(kSbSystemCapabilityCanQueryGPUMemoryStats) is
+`true`.
+
+#### Declaration ####
+
+```
+int64_t SbSystemGetUsedGPUMemory()
+```
+
+### SbSystemHasCapability ###
+
+Returns whether the platform has the runtime capability specified by
+`capability_id`. Returns false for any unknown capabilities. This implementation
+must be thread-safe.
+
+`capability_id`: The runtime capability to check.
+
+#### Declaration ####
+
+```
+bool SbSystemHasCapability(SbSystemCapabilityId capability_id)
+```
+
+### SbSystemHideSplashScreen ###
+
+Hides the system splash screen on systems that support a splash screen that is
+displayed while the application is loading. This function may be called from any
+thread and must be idempotent.
+
+#### Declaration ####
+
+```
+void SbSystemHideSplashScreen()
+```
+
+### SbSystemIsDebuggerAttached ###
+
+Attempts to determine whether the current program is running inside or attached
+to a debugger. The function returns `false` if neither of those cases is true.
+
+#### Declaration ####
+
+```
+bool SbSystemIsDebuggerAttached()
+```
+
+### SbSystemRaisePlatformError ###
+
+Cobalt calls this function to notify the platform that an error has occurred in
+the application that the platform may need to handle. The platform is expected
+to then notify the user of the error and to provide a means for any required
+interaction, such as by showing a dialog.
+
+The return value is a boolean. If the platform cannot respond to the error, then
+this function should return `false`, otherwise it should return `true`.
+
+This function may be called from any thread, and it is the platform's
+responsibility to decide how to handle an error received while a previous error
+is still pending. If that platform can only handle one error at a time, then it
+may queue the second error or ignore it by returning
+`kSbSystemPlatformErrorInvalid`.
+
+`type`: An error type, from the SbSystemPlatformErrorType enum, that defines the
+error. `callback`: A function that may be called by the platform to let the
+caller know that the user has reacted to the error. `user_data`: An opaque
+pointer that the platform should pass as an argument to the callback function,
+if it is called.
+
+#### Declaration ####
+
+```
+bool SbSystemRaisePlatformError(SbSystemPlatformErrorType type, SbSystemPlatformErrorCallback callback, void *user_data)
+```
+
+### SbSystemRequestPause ###
+
+Requests that the application move into the Paused state at the next convenient
+point. This should roughly correspond to "unfocused application" in a
+traditional window manager, where the application may be partially visible.
+
+This function eventually causes a `kSbEventTypePause` event to be dispatched to
+the application. Before the `kSbEventTypePause` event is dispatched, some work
+may continue to be done, and unrelated system events may be dispatched.
+
+#### Declaration ####
+
+```
+void SbSystemRequestPause()
+```
+
+### SbSystemRequestStop ###
+
+Requests that the application be terminated gracefully at the next convenient
+point. In the meantime, some work may continue to be done, and unrelated system
+events may be dispatched. This function eventually causes a `kSbEventTypeStop`
+event to be dispatched to the application. When the process finally terminates,
+it returns `error_level`, if that has any meaning on the current platform.
+
+`error_level`: An integer that serves as the return value for the process that
+is eventually terminated as a result of a call to this function.
+
+#### Declaration ####
+
+```
+void SbSystemRequestStop(int error_level)
+```
+
+### SbSystemRequestSuspend ###
+
+Requests that the application move into the Suspended state at the next
+convenient point. This should roughly correspond to "minimization" in a
+traditional window manager, where the application is no longer visible.
+
+This function eventually causes a `kSbEventTypeSuspend` event to be dispatched
+to the application. Before the `kSbEventTypeSuspend` event is dispatched, some
+work may continue to be done, and unrelated system events may be dispatched.
+
+In the Suspended state, the application will be resident, but probably not
+running. The expectation is that an external system event will bring the
+application out of the Suspended state.
+
+#### Declaration ####
+
+```
+void SbSystemRequestSuspend()
+```
+
+### SbSystemRequestUnpause ###
+
+Requests that the application move into the Started state at the next convenient
+point. This should roughly correspond to a "focused application" in a
+traditional window manager, where the application is fully visible and the
+primary receiver of input events.
+
+This function eventually causes a `kSbEventTypeUnpause` event to be dispatched
+to the application. Before `kSbEventTypeUnpause` is dispatched, some work may
+continue to be done, and unrelated system events may be dispatched.
+
+#### Declaration ####
+
+```
+void SbSystemRequestUnpause()
+```
+
+### SbSystemSignWithCertificationSecretKey ###
+
+Computes a HMAC-SHA256 digest of `message` into `digest` using the application's
+certification secret.
+
+This function may be implemented as an alternative to implementing
+SbSystemGetProperty(kSbSystemPropertyBase64EncodedCertificationSecret), however
+both should not be implemented.
+
+The output will be written into `digest`. `digest_size_in_bytes` must be 32 (or
+greater), since 32-bytes will be written into it. Returns false in the case of
+an error, or if it is not implemented. In this case the contents of `digest`
+will be undefined.
+
+#### Declaration ####
+
+```
+bool SbSystemSignWithCertificationSecretKey(const uint8_t *message, size_t message_size_in_bytes, uint8_t *digest, size_t digest_size_in_bytes)
+```
+
+### SbSystemSort ###
+
+Sorts an array of elements `base`, with `element_count` elements of
+`element_width` bytes each, using `comparator` as the comparison function.
+
+This function is meant to be a drop-in replacement for `qsort`.
+
+`base`: The array of elements to be sorted. `element_count`: The number of
+elements in the array. `element_width`: The size, in bytes, of each element in
+the array. `comparator`: A value that indicates how the array should be sorted.
+
+#### Declaration ####
+
+```
+void SbSystemSort(void *base, size_t element_count, size_t element_width, SbSystemComparator comparator)
+```
+
+### SbSystemSupportsResume ###
+
+Returns false if the platform doesn't need resume after suspend support. In such
+case Cobalt will free up the resource it retains for resume after suspend. Note
+that if this function returns false, the Starboard implementation cannot send
+kSbEventTypeResume to the event handler. The return value of this function
+cannot change over the life time of the application.
+
+#### Declaration ####
+
+```
+bool SbSystemSupportsResume()
+```
+
+### SbSystemSymbolize ###
+
+Looks up `address` as an instruction pointer and places up to (`buffer_size -
+1`) characters of the symbol associated with it in `out_buffer`, which must not
+be NULL. `out_buffer` will be NULL-terminated.
+
+The return value indicates whether the function found a reasonable match for
+`address`. If the return value is `false`, then `out_buffer` is not modified.
+
+This function is used in crash signal handlers and, therefore, it must be async-
+signal-safe on platforms that support signals.
+
+#### Declaration ####
+
+```
+bool SbSystemSymbolize(const void *address, char *out_buffer, int buffer_size)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/thread.md b/src/cobalt/site/docs/reference/starboard/modules/12/thread.md
new file mode 100644
index 0000000..8440477
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/thread.md
@@ -0,0 +1,534 @@
+---
+layout: doc
+title: "Starboard Module Reference: thread.h"
+---
+
+Defines functionality related to thread creation and cleanup.
+
+## Macros ##
+
+### kSbThreadContextInvalid ###
+
+Well-defined value for an invalid thread context.
+
+### kSbThreadInvalidId ###
+
+Well-defined constant value to mean "no thread ID."
+
+### kSbThreadLocalKeyInvalid ###
+
+Well-defined constant value to mean "no thread local key."
+
+### kSbThreadNoAffinity ###
+
+Well-defined constant value to mean "no affinity."
+
+### kSbThreadSamplerInvalid ###
+
+Well-defined value for an invalid thread sampler.
+
+## Enums ##
+
+### SbThreadPriority ###
+
+A spectrum of thread priorities. Platforms map them appropriately to their own
+priority system. Note that scheduling is platform-specific, and what these
+priorities mean, if they mean anything at all, is also platform-specific.
+
+In particular, several of these priority values can map to the same priority on
+a given platform. The only guarantee is that each lower priority should be
+treated less-than-or-equal-to a higher priority.
+
+#### Values ####
+
+*   `kSbThreadPriorityLowest`
+
+    The lowest thread priority available on the current platform.
+*   `kSbThreadPriorityLow`
+
+    A lower-than-normal thread priority, if available on the current platform.
+*   `kSbThreadPriorityNormal`
+
+    Really, what is normal? You should spend time pondering that question more
+    than you consider less-important things, but less than you think about more-
+    important things.
+*   `kSbThreadPriorityHigh`
+
+    A higher-than-normal thread priority, if available on the current platform.
+*   `kSbThreadPriorityHighest`
+
+    The highest thread priority available on the current platform that isn't
+    considered "real-time" or "time-critical," if those terms have any meaning
+    on the current platform.
+*   `kSbThreadPriorityRealTime`
+
+    If the platform provides any kind of real-time or time-critical scheduling,
+    this priority will request that treatment. Real-time scheduling generally
+    means that the thread will have more consistency in scheduling than non-
+    real-time scheduled threads, often by being more deterministic in how
+    threads run in relation to each other. But exactly how being real-time
+    affects the thread scheduling is platform-specific.
+
+    For platforms where that is not offered, or otherwise not meaningful, this
+    will just be the highest priority available in the platform's scheme, which
+    may be the same as kSbThreadPriorityHighest.
+*   `kSbThreadNoPriority`
+
+    Well-defined constant value to mean "no priority." This means to use the
+    default priority assignment method of that platform. This may mean to
+    inherit the priority of the spawning thread, or it may mean a specific
+    default priority, or it may mean something else, depending on the platform.
+
+## Typedefs ##
+
+### SbThread ###
+
+An opaque handle to a thread type.
+
+#### Definition ####
+
+```
+typedef void* SbThread
+```
+
+### SbThreadAffinity ###
+
+Type for thread core affinity. This generally will be a single cpu (or core or
+hyperthread) identifier. Some platforms may not support affinity, and some may
+have specific rules about how it must be used.
+
+#### Definition ####
+
+```
+typedef int32_t SbThreadAffinity
+```
+
+### SbThreadContext ###
+
+A handle to the context of a frozen thread.
+
+#### Definition ####
+
+```
+typedef SbThreadContextPrivate* SbThreadContext
+```
+
+### SbThreadEntryPoint ###
+
+Function pointer type for SbThreadCreate. `context` is a pointer-sized bit of
+data passed in from the calling thread.
+
+#### Definition ####
+
+```
+typedef void*(* SbThreadEntryPoint) (void *context)
+```
+
+### SbThreadId ###
+
+An ID type that is unique per thread.
+
+#### Definition ####
+
+```
+typedef int32_t SbThreadId
+```
+
+### SbThreadLocalDestructor ###
+
+Function pointer type for Thread-Local destructors.
+
+#### Definition ####
+
+```
+typedef void(* SbThreadLocalDestructor) (void *value)
+```
+
+### SbThreadLocalKey ###
+
+A handle to a thread-local key.
+
+#### Definition ####
+
+```
+typedef SbThreadLocalKeyPrivate* SbThreadLocalKey
+```
+
+### SbThreadSampler ###
+
+A handle to a thread sampler.
+
+#### Definition ####
+
+```
+typedef SbThreadSamplerPrivate* SbThreadSampler
+```
+
+## Functions ##
+
+### SbThreadContextGetPointer ###
+
+Gets the specified pointer-type `property` from the specified `context`. Returns
+`true` if successful and `out_value` has been modified, otherwise returns
+`false` and `out_value` is not modified.
+
+#### Declaration ####
+
+```
+bool SbThreadContextGetPointer(SbThreadContext context, SbThreadContextProperty property, void **out_value)
+```
+
+### SbThreadContextIsValid ###
+
+Returns whether the given thread context is valid.
+
+#### Declaration ####
+
+```
+static bool SbThreadContextIsValid(SbThreadContext context)
+```
+
+### SbThreadCreate ###
+
+Creates a new thread, which starts immediately.
+
+*   If the function succeeds, the return value is a handle to the newly created
+    thread.
+
+*   If the function fails, the return value is `kSbThreadInvalid`.
+
+`stack_size`: The amount of memory reserved for the thread. Set the value to `0`
+to indicate that the default stack size should be used. `priority`: The thread's
+priority. This value can be set to `kSbThreadNoPriority` to use the platform's
+default priority. As examples, it could be set to a fixed, standard priority or
+to a priority inherited from the thread that is calling SbThreadCreate(), or to
+something else. `affinity`: The thread's affinity. This value can be set to
+`kSbThreadNoAffinity` to use the platform's default affinity. `joinable`:
+Indicates whether the thread can be joined (`true`) or should start out
+"detached" (`false`). Note that for joinable threads, when you are done with the
+thread handle, you must call `SbThreadJoin` to release system resources
+associated with the thread. This is not necessary for detached threads, but
+detached threads cannot be joined. `name`: A name used to identify the thread.
+This value is used mainly for debugging, it can be `NULL`, and it might not be
+used in production builds. `entry_point`: A pointer to a function that will be
+executed on the newly created thread. `context`: This value will be passed to
+the `entry_point` function.
+
+#### Declaration ####
+
+```
+SbThread SbThreadCreate(int64_t stack_size, SbThreadPriority priority, SbThreadAffinity affinity, bool joinable, const char *name, SbThreadEntryPoint entry_point, void *context)
+```
+
+### SbThreadCreateLocalKey ###
+
+Creates and returns a new, unique key for thread local data. If the function
+does not succeed, the function returns `kSbThreadLocalKeyInvalid`.
+
+If `destructor` is specified, it will be called in the owning thread, and only
+in the owning thread, when the thread exits. In that case, it is called on the
+local value associated with the key in the current thread as long as the local
+value is not NULL.
+
+`destructor`: A pointer to a function. The value may be NULL if no clean up is
+needed.
+
+#### Declaration ####
+
+```
+SbThreadLocalKey SbThreadCreateLocalKey(SbThreadLocalDestructor destructor)
+```
+
+### SbThreadDestroyLocalKey ###
+
+Destroys thread local data for the specified key. The function is a no-op if the
+key is invalid (kSbThreadLocalKeyInvalid`) or has already been destroyed. This
+function does NOT call the destructor on any stored values.
+
+`key`: The key for which to destroy thread local data.
+
+#### Declaration ####
+
+```
+void SbThreadDestroyLocalKey(SbThreadLocalKey key)
+```
+
+### SbThreadDetach ###
+
+Detaches `thread`, which prevents it from being joined. This is sort of like a
+non-blocking join. This function is a no-op if the thread is already detached or
+if the thread is already being joined by another thread.
+
+`thread`: The thread to be detached.
+
+#### Declaration ####
+
+```
+void SbThreadDetach(SbThread thread)
+```
+
+### SbThreadGetCurrent ###
+
+Returns the handle of the currently executing thread.
+
+#### Declaration ####
+
+```
+SbThread SbThreadGetCurrent()
+```
+
+### SbThreadGetId ###
+
+Returns the Thread ID of the currently executing thread.
+
+#### Declaration ####
+
+```
+SbThreadId SbThreadGetId()
+```
+
+### SbThreadGetLocalValue ###
+
+Returns the pointer-sized value for `key` in the currently executing thread's
+local storage. Returns `NULL` if key is `kSbThreadLocalKeyInvalid` or if the key
+has already been destroyed.
+
+`key`: The key for which to return the value.
+
+#### Declaration ####
+
+```
+void* SbThreadGetLocalValue(SbThreadLocalKey key)
+```
+
+### SbThreadGetName ###
+
+Returns the debug name of the currently executing thread.
+
+#### Declaration ####
+
+```
+void SbThreadGetName(char *buffer, int buffer_size)
+```
+
+### SbThreadIsCurrent ###
+
+Returns whether `thread` is the current thread.
+
+`thread`: The thread to check.
+
+#### Declaration ####
+
+```
+static bool SbThreadIsCurrent(SbThread thread)
+```
+
+### SbThreadIsEqual ###
+
+Indicates whether `thread1` and `thread2` refer to the same thread.
+
+`thread1`: The first thread to compare. `thread2`: The second thread to compare.
+
+#### Declaration ####
+
+```
+bool SbThreadIsEqual(SbThread thread1, SbThread thread2)
+```
+
+### SbThreadIsValid ###
+
+Returns whether the given thread handle is valid.
+
+#### Declaration ####
+
+```
+static bool SbThreadIsValid(SbThread thread)
+```
+
+### SbThreadIsValidAffinity ###
+
+Returns whether the given thread affinity is valid.
+
+#### Declaration ####
+
+```
+static bool SbThreadIsValidAffinity(SbThreadAffinity affinity)
+```
+
+### SbThreadIsValidId ###
+
+Returns whether the given thread ID is valid.
+
+#### Declaration ####
+
+```
+static bool SbThreadIsValidId(SbThreadId id)
+```
+
+### SbThreadIsValidLocalKey ###
+
+Returns whether the given thread local variable key is valid.
+
+#### Declaration ####
+
+```
+static bool SbThreadIsValidLocalKey(SbThreadLocalKey key)
+```
+
+### SbThreadIsValidPriority ###
+
+Returns whether the given thread priority is valid.
+
+#### Declaration ####
+
+```
+static bool SbThreadIsValidPriority(SbThreadPriority priority)
+```
+
+### SbThreadJoin ###
+
+Joins the thread on which this function is called with joinable `thread`. This
+function blocks the caller until the designated thread exits, and then cleans up
+that thread's resources. The cleanup process essentially detaches thread.
+
+The return value is `true` if the function is successful and `false` if `thread`
+is invalid or detached.
+
+Each joinable thread can only be joined once and must be joined to be fully
+cleaned up. Once SbThreadJoin is called, the thread behaves as if it were
+detached to all threads other than the joining thread.
+
+`thread`: The thread to which the current thread will be joined. The `thread`
+must have been created with SbThreadCreate. `out_return`: If this is not `NULL`,
+then the SbThreadJoin function populates it with the return value of the
+thread's `main` function.
+
+#### Declaration ####
+
+```
+bool SbThreadJoin(SbThread thread, void **out_return)
+```
+
+### SbThreadSamplerCreate ###
+
+Creates a new thread sampler for the specified `thread`.
+
+If successful, this function returns the newly created handle. If unsuccessful,
+this function returns `kSbThreadSamplerInvalid`.
+
+#### Declaration ####
+
+```
+SbThreadSampler SbThreadSamplerCreate(SbThread thread)
+```
+
+### SbThreadSamplerDestroy ###
+
+Destroys the `sampler` and frees whatever resources it was using.
+
+#### Declaration ####
+
+```
+void SbThreadSamplerDestroy(SbThreadSampler sampler)
+```
+
+### SbThreadSamplerFreeze ###
+
+Suspends execution of the thread that `sampler` was created for.
+
+If successful, this function returns a `SbThreadContext` for the frozen thread,
+from which properties may be read while the thread remains frozen. If
+unsuccessful, this function returns `kSbThreadContextInvalid`.
+
+#### Declaration ####
+
+```
+SbThreadContext SbThreadSamplerFreeze(SbThreadSampler sampler)
+```
+
+### SbThreadSamplerIsSupported ###
+
+Whether the current platform supports thread sampling. The result of this
+function must not change over the course of the program, which means that the
+results of this function may be cached indefinitely. If this returns false,
+`SbThreadSamplerCreate` will return an invalid sampler.
+
+#### Declaration ####
+
+```
+bool SbThreadSamplerIsSupported()
+```
+
+### SbThreadSamplerIsValid ###
+
+Returns whether the given thread sampler is valid.
+
+#### Declaration ####
+
+```
+static bool SbThreadSamplerIsValid(SbThreadSampler sampler)
+```
+
+### SbThreadSamplerThaw ###
+
+Resumes execution of the thread that `sampler` was created for. This invalidates
+the context returned from `SbThreadSamplerFreeze`.
+
+#### Declaration ####
+
+```
+bool SbThreadSamplerThaw(SbThreadSampler sampler)
+```
+
+### SbThreadSetLocalValue ###
+
+Sets the pointer-sized value for `key` in the currently executing thread's local
+storage. The return value indicates whether `key` is valid and has not already
+been destroyed.
+
+`key`: The key for which to set the key value. `value`: The new pointer-sized
+key value.
+
+#### Declaration ####
+
+```
+bool SbThreadSetLocalValue(SbThreadLocalKey key, void *value)
+```
+
+### SbThreadSetName ###
+
+Sets the debug name of the currently executing thread by copying the specified
+name string.
+
+`name`: The name to assign to the thread.
+
+#### Declaration ####
+
+```
+void SbThreadSetName(const char *name)
+```
+
+### SbThreadSleep ###
+
+Sleeps the currently executing thread.
+
+`duration`: The minimum amount of time, in microseconds, that the currently
+executing thread should sleep. The function is a no-op if this value is negative
+or `0`.
+
+#### Declaration ####
+
+```
+void SbThreadSleep(SbTime duration)
+```
+
+### SbThreadYield ###
+
+Yields the currently executing thread, so another thread has a chance to run.
+
+#### Declaration ####
+
+```
+void SbThreadYield()
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/time.md b/src/cobalt/site/docs/reference/starboard/modules/12/time.md
new file mode 100644
index 0000000..17ea6ad
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/time.md
@@ -0,0 +1,153 @@
+---
+layout: doc
+title: "Starboard Module Reference: time.h"
+---
+
+Provides access to system time and timers.
+
+## Macros ##
+
+### kSbTimeDay ###
+
+One day in SbTime units (microseconds).
+
+### kSbTimeHour ###
+
+One hour in SbTime units (microseconds).
+
+### kSbTimeMax ###
+
+The maximum value of an SbTime.
+
+### kSbTimeMillisecond ###
+
+One millisecond in SbTime units (microseconds).
+
+### kSbTimeMinute ###
+
+One minute in SbTime units (microseconds).
+
+### kSbTimeNanosecondsPerMicrosecond ###
+
+How many nanoseconds in one SbTime unit (microseconds).
+
+### kSbTimeSecond ###
+
+One second in SbTime units (microseconds).
+
+### kSbTimeToPosixDelta ###
+
+A term that can be added to an SbTime to convert it into the number of
+microseconds since the POSIX epoch.
+
+## Typedefs ##
+
+### SbTime ###
+
+The number of microseconds since the epoch of January 1, 1601 UTC, or the number
+of microseconds between two times. Always microseconds, ALWAYS UTC.
+
+#### Definition ####
+
+```
+typedef int64_t SbTime
+```
+
+### SbTimeMonotonic ###
+
+A number of microseconds from some point. The main property of this time is that
+it increases monotonically. It should also be as high-resolution a timer as we
+can get on a platform. So, it is good for measuring the time between two calls
+without worrying about a system clock adjustment. It's not good for getting the
+wall clock time.
+
+#### Definition ####
+
+```
+typedef int64_t SbTimeMonotonic
+```
+
+## Functions ##
+
+### SbTimeFromPosix ###
+
+Converts microseconds from the POSIX epoch into an `SbTime`.
+
+`time`: A time that measures the number of microseconds since January 1, 1970,
+00:00:00, UTC.
+
+#### Declaration ####
+
+```
+static SbTime SbTimeFromPosix(int64_t time)
+```
+
+### SbTimeGetMonotonicNow ###
+
+Gets a monotonically increasing time representing right now.
+
+#### Declaration ####
+
+```
+SbTimeMonotonic SbTimeGetMonotonicNow()
+```
+
+### SbTimeGetMonotonicThreadNow ###
+
+Gets a monotonically increasing time representing how long the current thread
+has been in the executing state (i.e. not pre-empted nor waiting on an event).
+This is not necessarily total time and is intended to allow measuring thread
+execution time between two timestamps. If this is not available then
+SbTimeGetMonotonicNow() should be used.
+
+#### Declaration ####
+
+```
+SbTimeMonotonic SbTimeGetMonotonicThreadNow()
+```
+
+### SbTimeGetNow ###
+
+Gets the current system time as an `SbTime`.
+
+#### Declaration ####
+
+```
+SbTime SbTimeGetNow()
+```
+
+### SbTimeIsTimeThreadNowSupported ###
+
+Returns whether the current platform supports time thread now
+
+#### Declaration ####
+
+```
+bool SbTimeIsTimeThreadNowSupported()
+```
+
+### SbTimeNarrow ###
+
+Safely narrows a number from a more precise unit to a less precise one. This
+function rounds negative values toward negative infinity.
+
+#### Declaration ####
+
+```
+static int64_t SbTimeNarrow(int64_t time, int64_t divisor)
+```
+
+### SbTimeToPosix ###
+
+Converts `SbTime` into microseconds from the POSIX epoch.
+
+`time`: A time that is either measured in microseconds since the epoch of
+January 1, 1601, UTC, or that measures the number of microseconds between two
+times.
+
+#### Declaration ####
+
+```
+static int64_t SbTimeToPosix(SbTime time)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/time_zone.md b/src/cobalt/site/docs/reference/starboard/modules/12/time_zone.md
similarity index 100%
copy from src/cobalt/site/docs/reference/starboard/modules/6/time_zone.md
copy to src/cobalt/site/docs/reference/starboard/modules/12/time_zone.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/types.md b/src/cobalt/site/docs/reference/starboard/modules/12/types.md
similarity index 100%
copy from src/cobalt/site/docs/reference/starboard/modules/4/types.md
copy to src/cobalt/site/docs/reference/starboard/modules/12/types.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/ui_navigation.md b/src/cobalt/site/docs/reference/starboard/modules/12/ui_navigation.md
new file mode 100644
index 0000000..2239e79
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/ui_navigation.md
@@ -0,0 +1,268 @@
+---
+layout: doc
+title: "Starboard Module Reference: ui_navigation.h"
+---
+
+API to allow applications to take advantage of the platform's native UI engine.
+This is mainly to drive the animation of visual elements and to signal which of
+those elements have focus. The implementation should not render any visual
+elements; instead, it will be used to guide the app in where these elements
+should be drawn.
+
+When the application creates the user interface, it will create SbUiNavItems for
+interactable elements. Additionally, the app must specify the position and size
+of these navigation items. As the app's user interface changes, it will create
+and destroy navigation items as appropriate.
+
+For each render frame, the app will query the local transform for each
+SbUiNavItem in case the native UI engine moves individual items in response to
+user interaction. If the navigation item is a container, then the content offset
+will also be queried to determine the placement of its content items.
+
+## Macros ##
+
+### kSbUiNavItemInvalid ###
+
+Well-defined value for an invalid navigation item.
+
+## Enums ##
+
+### SbUiNavItemType ###
+
+Navigation items may be one of the following types. This must be specified upon
+item creation and may not change during the item's lifespan.
+
+#### Values ####
+
+*   `kSbUiNavItemTypeFocus`
+
+    This is a single focusable item.
+*   `kSbUiNavItemTypeContainer`
+
+    This is a container of navigation items which can also be containers
+    themselves or focusable items. Containers themselves cannot be focused.
+
+## Typedefs ##
+
+### SbUiNavItem ###
+
+An opaque handle to an implementation-private structure representing a
+navigation item.
+
+#### Definition ####
+
+```
+typedef struct SbUiNavItemPrivate* SbUiNavItem
+```
+
+## Structs ##
+
+### SbUiNavCallbacks ###
+
+This structure specifies all the callbacks which the platform UI engine should
+invoke for various interaction events on navigation items. These callbacks may
+be invoked from any thread at any frequency. The `callback_context` is the value
+that was passed on creation of the relevant SbUiNavItem.
+
+#### Members ####
+
+*   `void(* onblur`
+
+    Invoke when an item has lost focus. This is only used with focus items.
+*   `void(* onfocus`
+
+    Invoke when an item has gained focus. This is only used with focus items.
+*   `void(* onscroll`
+
+    Invoke when an item's content offset is changed. This is only used with
+    container items.
+
+### SbUiNavInterface ###
+
+This structure declares the interface to the UI navigation implementation. All
+function pointers must be specified if the platform supports UI navigation.
+
+#### Members ####
+
+*   `SbUiNavItem(* create_item`
+
+    Create a new navigation item. When the user interacts with this item the
+    appropriate SbUiNavCallbacks function will be invoked with the provided
+    `callback_context`. An item is not interactable until it is enabled.
+*   `void(* destroy_item`
+
+    Destroy the given navigation item. If this is a content of another item,
+    then it will first be unregistered. Additionally, if this item contains
+    other items, then those will be unregistered as well, but they will not be
+    automatically destroyed.
+*   `void(* set_focus`
+
+    This is used to manually force focus on a navigation item of type
+    kSbUiNavItemTypeFocus. Any previously focused navigation item should receive
+    the blur event. If the item is not transitively a content of the root item,
+    then this does nothing.
+*   `void(* set_item_enabled`
+
+    This is used to enable or disable user interaction with the specified
+    navigation item. All navigation items are disabled when created, and they
+    must be explicitly enabled to allow user interaction. If a container is
+    disabled, then all of its contents are not interactable even though they
+    remain enabled. If `enabled` is false, it must be guaranteed that once this
+    function returns, no callbacks associated with this item will be invoked
+    until the item is re-enabled.
+*   `void(* set_item_dir`
+
+    This specifies directionality for container items. Containers within
+    containers do not inherit directionality. Directionality must be specified
+    for each container explicitly.
+*   `void(* set_item_size`
+
+    Set the interactable size of the specified navigation item. By default, an
+    item's size is (0,0).
+*   `void(* set_item_transform`
+
+    Set the transform for the navigation item and its contents if the item is a
+    container. This specifies the placement of the item's center within its
+    container. The transform origin is the center of the item. Distance is
+    measured in pixels with the origin being the top-left of the item's
+    container. By default, an item's transform is identity.
+*   `bool(* get_item_focus_transform`
+
+    Retrieve the focus transform matrix for the navigation item. The UI engine
+    may translate, rotate, and/or tilt focus items to reflect user interaction.
+    This transform should be multiplied with the item's transform to get its
+    position inside its container. The transform origin is the center of the
+    item. Return false if the item position should not be changed (i.e. the
+    transform should be treated as identity).
+*   `bool(* get_item_focus_vector`
+
+    Retrieve a vector representing the focus location within a focused item.
+    This is used to provide feedback about user input that is too small to
+    result in a focus change. If there is no focus vector for the navigation
+    item, then return false and leave `out_x` and `out_y` unchanged. Otherwise,
+    return true and set the output values in the range of [-1, +1] with (out_x,
+    out_y) of (-1, -1) being the top-left corner of the navigation item and (0,
+    0) being the center.
+*   `void(* set_item_container_window`
+
+    This attaches the given navigation item (which must be a container) to the
+    specified window. Navigation items are only interactable if they are
+    transitively attached to a window.
+
+    A navigation item may only have a SbUiNavItem or SbWindow as its direct
+    container. The navigation item hierarchy is established using
+    set_item_container_item() with the root container attached to a SbWindow
+    using set_item_container_window() to enable interaction with all enabled
+    items in the hierarchy.
+
+    If `item` is already registered with a different window, then this will
+    unregister it from that window then attach it to the given `window`. It is
+    an error to register more than one navigation item with any given window. If
+    `window` is kSbWindowInvalid, then this will unregister the `item` from its
+    current window if any. Upon destruction of `item` or `window`, the `item` is
+    automatically unregistered from the `window`.
+*   `void(* set_item_container_item`
+
+    A container navigation item may contain other navigation items. However, it
+    is an error to have circular containment or for `container` to not be of
+    type kSbUiNavItemTypeContainer. If `item` already has a different container,
+    then this first severs that connection. If `container` is
+    kSbUiNavItemInvalid, then this removes `item` from its current container.
+    Upon destruction of `item` or `container`, the `item` is automatically
+    removed from the `container`.
+
+    The position of items within a container are specified relative to the
+    container's position. The position of these content items are further
+    modified by the container's "content offset".
+
+    For example, consider item A with position (5,5) and content offset (0,0).
+    Given item B with position (10,10) is registered as a content of item A.
+
+    1.  Item B should be drawn at position (15,15).
+
+    1.  If item A's content offset is changed to (10,0), then item B should be
+        drawn at position (5,15).
+
+    Essentially, content items should be drawn at: [container position] +
+    [content position] - [container content offset]
+*   `void(* set_item_content_offset`
+
+    Set the current content offset for the given container. This may be used to
+    force scrolling to make certain content items visible. A container item's
+    content offset helps determine where its content items should be drawn.
+    Essentially, a content item should be drawn at: [container position] +
+    [content position] - [container content offset] If `item` is not a
+    container, then this does nothing. By default, the content offset is (0,0).
+*   `void(* get_item_content_offset`
+
+    Retrieve the current content offset for the navigation item. If `item` is
+    not a container, then the content offset is (0,0).
+
+### SbUiNavItemDir ###
+
+Navigation items of type kSbUiNavItemTypeContainer have directionality. If
+directionality is not specified for a container, it should default to left-to-
+right and top-to-bottom.
+
+For left-to-right, content offset x = 0 shows the leftmost content. `< –
+Container Size-->` +----------------- – +----------------- – +-----------------
+– + ` Not selectable. ` Selectable. ` Selectable. ` ` Offscreen. ` Onscreen. `
+Offscreen. ` ` Negative position. ` Positive position. ` Positive position. `
++----------------- – +----------------- – +----------------- – + ^ Content
+Offset X = 0.
+
+For right-to-left, content offset x = 0 shows the rightmost content. `< –
+Container Size-->` +----------------- – +----------------- – +-----------------
+– + ` Selectable. ` Selectable. ` Not selectable. ` ` Offscreen. ` Onscreen. `
+Offscreen. ` ` Negative position. ` Positive position. ` Positive position. `
++----------------- – +----------------- – +----------------- – + ^ Content
+Offset X = 0.
+
+Top-to-bottom is similar to left-to-right, but for the Y position. Bottom-to-top
+is similar to right-to-left, but for the Y position.
+
+#### Members ####
+
+*   `bool is_left_to_right`
+*   `bool is_top_to_bottom`
+
+### SbUiNavMatrix2x3 ###
+
+This represents a 2x3 transform matrix in row-major order. ` a b tx ` ` c d ty `
+
+#### Members ####
+
+*   `float m`
+
+### SbUiNavMatrix4 ###
+
+This represents a 4x4 transform matrix in row-major order.
+
+#### Members ####
+
+*   `float m`
+
+## Functions ##
+
+### SbUiNavGetInterface ###
+
+Retrieve the platform's UI navigation implementation. If the platform does not
+provide one, then return false without modifying `out_interface`. Otherwise,
+initialize all members of `out_interface` and return true.
+
+#### Declaration ####
+
+```
+bool SbUiNavGetInterface(SbUiNavInterface *out_interface)
+```
+
+### SbUiNavItemIsValid ###
+
+Returns whether the given navigation item handle is valid.
+
+#### Declaration ####
+
+```
+static bool SbUiNavItemIsValid(SbUiNavItem item)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/user.md b/src/cobalt/site/docs/reference/starboard/modules/12/user.md
similarity index 100%
copy from src/cobalt/site/docs/reference/starboard/modules/4/user.md
copy to src/cobalt/site/docs/reference/starboard/modules/12/user.md
diff --git a/src/cobalt/site/docs/reference/starboard/modules/12/window.md b/src/cobalt/site/docs/reference/starboard/modules/12/window.md
new file mode 100644
index 0000000..53cda4a
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/12/window.md
@@ -0,0 +1,331 @@
+---
+layout: doc
+title: "Starboard Module Reference: window.h"
+---
+
+Provides functionality to handle Window creation and management.
+
+## Macros ##
+
+### kSbEventOnScreenKeyboardInvalidTicket ###
+
+System-triggered OnScreenKeyboard events have ticket value
+kSbEventOnScreenKeyboardInvalidTicket.
+
+### kSbWindowInvalid ###
+
+Well-defined value for an invalid window handle.
+
+## Typedefs ##
+
+### SbWindow ###
+
+A handle to a window.
+
+#### Definition ####
+
+```
+typedef SbWindowPrivate* SbWindow
+```
+
+## Structs ##
+
+### SbWindowOptions ###
+
+Options that can be requested at window creation time.
+
+#### Members ####
+
+*   `SbWindowSize size`
+
+    The requested size of the new window. The value of `video_pixel_ratio` will
+    not be used or looked at.
+*   `bool windowed`
+
+    Whether the new window should be windowed or not. If not, the requested size
+    is really the requested resolution.
+*   `const char * name`
+
+    The name of the window to create.
+
+### SbWindowRect ###
+
+Defines a rectangle via a point `(x, y)` and a size `(width, height)`. This
+structure is used as output for SbWindowGetOnScreenKeyboardBoundingRect.
+
+#### Members ####
+
+*   `float x`
+*   `float y`
+*   `float width`
+*   `float height`
+
+### SbWindowSize ###
+
+The size of a window in graphics rendering coordinates. The width and height of
+a window should correspond to the size of the graphics surface used for drawing
+that would be created to back that window.
+
+#### Members ####
+
+*   `int width`
+
+    The width of the window in graphics pixels.
+*   `int height`
+
+    The height of the window in graphics pixels.
+*   `float video_pixel_ratio`
+
+    The ratio of video pixels to graphics pixels. This ratio must be applied
+    equally to width and height, meaning the aspect ratio is maintained.
+
+    A value of 1.0f means the video resolution is the same as the graphics
+    resolution. This is the most common case.
+
+    Values greater than 1.0f mean that the video resolution is higher (denser,
+    larger) than the graphics resolution. This is a common case as devices often
+    have more video decoding capabilities than graphics rendering capabilities
+    (or memory, etc...).
+
+    Values less than 1.0f mean that the maximum video resolution is smaller than
+    the graphics resolution.
+
+    A value of 0.0f means the ratio could not be determined, it should be
+    assumed to be the same as the graphics resolution (i.e. 1.0f).
+
+## Functions ##
+
+### SbWindowBlurOnScreenKeyboard ###
+
+Blur the on screen keyboard. Fire kSbEventTypeOnScreenKeyboardBlurred.
+kSbEventTypeOnScreenKeyboardBlurred has data `ticket`. Calling
+SbWindowBlurOnScreenKeyboard() when the keyboard is already blurred is
+permitted. Calling SbWindowBlurOnScreenKeyboard while the on screen keyboard is
+not showing does nothing and does not fire any event.
+
+#### Declaration ####
+
+```
+void SbWindowBlurOnScreenKeyboard(SbWindow window, int ticket)
+```
+
+### SbWindowCreate ###
+
+Creates and returns a new system window with the given `options`, which may be
+`NULL`. The function returns `kSbWindowInvalid` if it cannot create the
+requested `SbWindow` due to policy, unsatisfiable options, or any other reason.
+
+If `options` are not specified, this function uses all defaults, which must work
+on every platform. In general, it defaults to creating a fullscreen window at
+the highest 16:9 resolution possible. If the platform does not support
+fullscreen windows, then it creates a normal, windowed window.
+
+Some devices are fullscreen-only, including many production targets for
+Starboard. In those cases, only one SbWindow may be created, and it must be
+fullscreen. Additionally, in those cases, the requested size will actually be
+the requested resolution.
+
+An SbWindow must be created to receive window-based events, like input events,
+even on fullscreen-only devices. These events are dispatched to the Starboard
+entry point.
+
+`options`: Options that specify parameters for the window being created.
+
+#### Declaration ####
+
+```
+SbWindow SbWindowCreate(const SbWindowOptions *options)
+```
+
+### SbWindowDestroy ###
+
+Destroys `window`, reclaiming associated resources.
+
+`window`: The `SbWindow` to destroy.
+
+#### Declaration ####
+
+```
+bool SbWindowDestroy(SbWindow window)
+```
+
+### SbWindowFocusOnScreenKeyboard ###
+
+Focus the on screen keyboard. Fire kSbEventTypeOnScreenKeyboardFocused.
+kSbEventTypeOnScreenKeyboardFocused has data `ticket`. Calling
+SbWindowFocusOnScreenKeyboard() when the keyboard is already focused is
+permitted. Calling SbWindowFocusOnScreenKeyboard while the on screen keyboard is
+not showing does nothing and does not fire any event.
+
+#### Declaration ####
+
+```
+void SbWindowFocusOnScreenKeyboard(SbWindow window, int ticket)
+```
+
+### SbWindowGetDiagonalSizeInInches ###
+
+Gets the size of the diagonal between two opposing screen corners.
+
+A return value of 0 means that starboard does not know what the screen diagonal
+is.
+
+#### Declaration ####
+
+```
+float SbWindowGetDiagonalSizeInInches(SbWindow window)
+```
+
+### SbWindowGetOnScreenKeyboardBoundingRect ###
+
+Get the rectangle of the on screen keyboard in screen pixel coordinates. Return
+`true` if successful. Return `false` if the on screen keyboard is not showing.
+If the function returns `false`, then `rect` will not have been modified.
+
+#### Declaration ####
+
+```
+bool SbWindowGetOnScreenKeyboardBoundingRect(SbWindow window, SbWindowRect *bounding_rect)
+```
+
+### SbWindowGetPlatformHandle ###
+
+Gets the platform-specific handle for `window`, which can be passed as an
+EGLNativeWindowType to initialize EGL/GLES. This return value is entirely
+platform-specific, so there are no constraints about expected ranges.
+
+`window`: The SbWindow to retrieve the platform handle for.
+
+#### Declaration ####
+
+```
+void* SbWindowGetPlatformHandle(SbWindow window)
+```
+
+### SbWindowGetSize ###
+
+Retrieves the dimensions of `window` and sets `size` accordingly. This function
+returns `true` if it completes successfully. If the function returns `false`,
+then `size` will not have been modified.
+
+`window`: The SbWindow to retrieve the size of. `size`: The retrieved size.
+
+#### Declaration ####
+
+```
+bool SbWindowGetSize(SbWindow window, SbWindowSize *size)
+```
+
+### SbWindowHideOnScreenKeyboard ###
+
+Hide the on screen keyboard. Fire kSbEventTypeWindowSizeChange and
+kSbEventTypeOnScreenKeyboardHidden if necessary.
+kSbEventTypeOnScreenKeyboardHidden has data `ticket`. Calling
+SbWindowHideOnScreenKeyboard() when the keyboard is already hidden is permitted.
+
+#### Declaration ####
+
+```
+void SbWindowHideOnScreenKeyboard(SbWindow window, int ticket)
+```
+
+### SbWindowIsOnScreenKeyboardShown ###
+
+Determine if the on screen keyboard is shown.
+
+#### Declaration ####
+
+```
+bool SbWindowIsOnScreenKeyboardShown(SbWindow window)
+```
+
+### SbWindowIsValid ###
+
+Returns whether the given window handle is valid.
+
+#### Declaration ####
+
+```
+static bool SbWindowIsValid(SbWindow window)
+```
+
+### SbWindowOnScreenKeyboardIsSupported ###
+
+Return whether the current platform supports an on screen keyboard
+
+#### Declaration ####
+
+```
+bool SbWindowOnScreenKeyboardIsSupported()
+```
+
+### SbWindowOnScreenKeyboardSuggestionsSupported ###
+
+Determine if the on screen keyboard has suggestions implemented. If this returns
+false, then calling SbWindowUpdateOnScreenKeyboardSuggestions() will be
+undefined.
+
+#### Declaration ####
+
+```
+bool SbWindowOnScreenKeyboardSuggestionsSupported(SbWindow window)
+```
+
+### SbWindowSetDefaultOptions ###
+
+Sets the default options for system windows.
+
+`options`: The option values to use as default values. This object must not be
+`NULL`.
+
+#### Declaration ####
+
+```
+void SbWindowSetDefaultOptions(SbWindowOptions *options)
+```
+
+### SbWindowSetOnScreenKeyboardKeepFocus ###
+
+Notify the system that `keepFocus` has been set for the OnScreenKeyboard.
+`keepFocus` true indicates that the user may not navigate focus off of the
+OnScreenKeyboard via input; focus may only be moved via events sent by the app.
+`keepFocus` false indicates that the user may navigate focus off of the
+OnScreenKeyboard via input. `keepFocus` is initialized to false in the
+OnScreenKeyboard constructor.
+
+#### Declaration ####
+
+```
+void SbWindowSetOnScreenKeyboardKeepFocus(SbWindow window, bool keep_focus)
+```
+
+### SbWindowShowOnScreenKeyboard ###
+
+Show the on screen keyboard and populate the input with text `input_text`. Fire
+kSbEventTypeWindowSizeChange and kSbEventTypeOnScreenKeyboardShown if necessary.
+kSbEventTypeOnScreenKeyboardShown has data `ticket`. The passed in `input_text`
+will never be NULL, but may be an empty string. Calling
+SbWindowShowOnScreenKeyboard() when the keyboard is already shown is permitted,
+and the input will be replaced with `input_text`. Showing the on screen keyboard
+does not give it focus.
+
+#### Declaration ####
+
+```
+void SbWindowShowOnScreenKeyboard(SbWindow window, const char *input_text, int ticket)
+```
+
+### SbWindowUpdateOnScreenKeyboardSuggestions ###
+
+Update the on screen keyboard custom suggestions. Fire
+kSbEventTypeOnScreenKeyboardSuggestionsUpdated.
+kSbEventTypeOnScreenKeyboardSuggestionsUpdated has data `ticket`. The
+suggestions should remain up-to-date when the keyboard is shown after being
+hidden.
+
+#### Declaration ####
+
+```
+void SbWindowUpdateOnScreenKeyboardSuggestions(SbWindow window, const char *suggestions[], int num_suggestions, int ticket)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/atomic.md b/src/cobalt/site/docs/reference/starboard/modules/4/atomic.md
deleted file mode 100644
index 49faa7f..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/atomic.md
+++ /dev/null
@@ -1,101 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: atomic.h"
----
-
-Defines a set of atomic integer operations that can be used as lightweight
-synchronization or as building blocks for heavier synchronization primitives.
-Their use is very subtle and requires detailed understanding of the behavior of
-supported architectures, so their direct use is not recommended except when
-rigorously deemed absolutely necessary for performance reasons.
-
-## Typedefs ##
-
-### SbAtomic64 ###
-
-64-bit atomic operations (only available on 64-bit processors).
-
-#### Definition ####
-
-```
-typedef int64_t SbAtomic64
-```
-
-### SbAtomicPtr ###
-
-Pointer-sized atomic operations. Forwards to either 32-bit or 64-bit functions
-as appropriate.
-
-#### Definition ####
-
-```
-typedef SbAtomic64 SbAtomicPtr
-```
-
-## Functions ##
-
-### SbAtomicAcquire_CompareAndSwap ###
-
-These following lower-level operations are typically useful only to people
-implementing higher-level synchronization operations like spinlocks, mutexes,
-and condition-variables. They combine CompareAndSwap(), a load, or a store with
-appropriate memory-ordering instructions. "Acquire" operations ensure that no
-later memory access can be reordered ahead of the operation. "Release"
-operations ensure that no previous memory access can be reordered after the
-operation. "Barrier" operations have both "Acquire" and "Release" semantics. A
-SbAtomicMemoryBarrier() has "Barrier" semantics, but does no memory access.
-
-#### Declaration ####
-
-```
-static SbAtomic32 SbAtomicAcquire_CompareAndSwap(volatile SbAtomic32 *ptr, SbAtomic32 old_value, SbAtomic32 new_value)
-```
-
-### SbAtomicBarrier_Increment ###
-
-Same as SbAtomicNoBarrier_Increment, but with a memory barrier.
-
-#### Declaration ####
-
-```
-static SbAtomic32 SbAtomicBarrier_Increment(volatile SbAtomic32 *ptr, SbAtomic32 increment)
-```
-
-### SbAtomicNoBarrier_CompareAndSwap ###
-
-Atomically execute: result = *ptr; if (*ptr == old_value) *ptr = new_value;
-return result;
-
-I.e., replace "*ptr" with "new_value" if "*ptr" used to be "old_value". Always
-return the old value of "*ptr"
-
-This routine implies no memory barriers.
-
-#### Declaration ####
-
-```
-static SbAtomic32 SbAtomicNoBarrier_CompareAndSwap(volatile SbAtomic32 *ptr, SbAtomic32 old_value, SbAtomic32 new_value)
-```
-
-### SbAtomicNoBarrier_Exchange ###
-
-Atomically store new_value into *ptr, returning the previous value held in *ptr.
-This routine implies no memory barriers.
-
-#### Declaration ####
-
-```
-static SbAtomic32 SbAtomicNoBarrier_Exchange(volatile SbAtomic32 *ptr, SbAtomic32 new_value)
-```
-
-### SbAtomicNoBarrier_Increment ###
-
-Atomically increment *ptr by "increment". Returns the new value of *ptr with the
-increment applied. This routine implies no memory barriers.
-
-#### Declaration ####
-
-```
-static SbAtomic32 SbAtomicNoBarrier_Increment(volatile SbAtomic32 *ptr, SbAtomic32 increment)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/audio_sink.md b/src/cobalt/site/docs/reference/starboard/modules/4/audio_sink.md
deleted file mode 100644
index c3c1cf7..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/audio_sink.md
+++ /dev/null
@@ -1,152 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: audio_sink.h"
----
-
-Provides an interface to output raw audio data.
-
-## Macros ##
-
-### kSbAudioSinkInvalid ###
-
-Well-defined value for an invalid audio sink.
-
-## Typedefs ##
-
-### SbAudioSink ###
-
-An opaque handle to an implementation-private structure representing an audio
-sink.
-
-#### Definition ####
-
-```
-typedef struct SbAudioSinkPrivate* SbAudioSink
-```
-
-### SbAudioSinkConsumeFramesFunc ###
-
-Callback used to report frames consumed. The consumed frames will be removed
-from the source frame buffer to free space for new audio frames.When
-`frames_consumed` is updated asynchnously and the last time that it has been
-updated is known, it can be passed in `frames_consumed_at` so the audio time
-calculating can be more accurate.
-
-#### Definition ####
-
-```
-typedef void(* SbAudioSinkConsumeFramesFunc) (int frames_consumed, SbTime frames_consumed_at, void *context)
-```
-
-### SbAudioSinkFrameBuffers ###
-
-An array of frame buffers. For interleaved audio streams, there will be only one
-element in the array. For planar audio streams, the number of elements in the
-array equal to the number of channels.
-
-#### Definition ####
-
-```
-typedef void** SbAudioSinkFrameBuffers
-```
-
-### SbAudioSinkUpdateSourceStatusFunc ###
-
-Callback being called periodically to retrieve the status of the audio source.
-The first two output parameters indicating the filling level of the audio frame
-buffer passed to SbAudioSinkCreate as `frame_buffers`. As `frame_buffers` is a
-circular buffer, `offset_in_frames` can be used to calculate the number of
-continuous frames towards the end of the buffer. The audio sink can play the
-frames only when `is_playing` is true. It should pause the playback when
-`is_playing` is false. The audio sink may cache certain amount of audio frames
-before start playback. It will start playback immediately when `is_eos_reached`
-is true even if the amount of cached audio frames are not enough as no more
-frames will be appended into the buffer when `is_eos_reached` is true. It is
-possible for a host to set `is_eos_reached` to false after setting it to true,
-usually this is caused by a seek. All parameters except `context` cannot be
-NULL. Note that this function only reports the status of the source, it doesn't
-remove audio data from the source frame buffer.
-
-#### Definition ####
-
-```
-typedef void(* SbAudioSinkUpdateSourceStatusFunc) (int *frames_in_buffer, int *offset_in_frames, bool *is_playing, bool *is_eos_reached, void *context)
-```
-
-## Functions ##
-
-### SbAudioSinkDestroy ###
-
-Destroys `audio_sink`, freeing all associated resources. Before returning, the
-function waits until all callbacks that are in progress have finished. After the
-function returns, no further calls are made callbacks passed into
-SbAudioSinkCreate. In addition, you can not pass `audio_sink` to any other
-SbAudioSink functions after SbAudioSinkDestroy has been called on it.
-
-This function can be called on any thread. However, it cannot be called within
-any of the callbacks passed into SbAudioSinkCreate.
-
-`audio_sink`: The audio sink to destroy.
-
-#### Declaration ####
-
-```
-void SbAudioSinkDestroy(SbAudioSink audio_sink)
-```
-
-### SbAudioSinkGetMaxChannels ###
-
-Returns the maximum number of channels supported on the platform. For example,
-the number would be `2` if the platform only supports stereo.
-
-#### Declaration ####
-
-```
-int SbAudioSinkGetMaxChannels()
-```
-
-### SbAudioSinkGetNearestSupportedSampleFrequency ###
-
-Returns the supported sample rate closest to `sampling_frequency_hz`. On
-platforms that don't support all sample rates, it is the caller's responsibility
-to resample the audio frames into the supported sample rate returned by this
-function.
-
-#### Declaration ####
-
-```
-int SbAudioSinkGetNearestSupportedSampleFrequency(int sampling_frequency_hz)
-```
-
-### SbAudioSinkIsAudioFrameStorageTypeSupported ###
-
-Indicates whether `audio_frame_storage_type` is supported on this platform.
-
-#### Declaration ####
-
-```
-bool SbAudioSinkIsAudioFrameStorageTypeSupported(SbMediaAudioFrameStorageType audio_frame_storage_type)
-```
-
-### SbAudioSinkIsAudioSampleTypeSupported ###
-
-Indicates whether `audio_sample_type` is supported on this platform.
-
-#### Declaration ####
-
-```
-bool SbAudioSinkIsAudioSampleTypeSupported(SbMediaAudioSampleType audio_sample_type)
-```
-
-### SbAudioSinkIsValid ###
-
-Indicates whether the given audio sink handle is valid.
-
-`audio_sink`: The audio sink handle to check.
-
-#### Declaration ####
-
-```
-bool SbAudioSinkIsValid(SbAudioSink audio_sink)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/blitter.md b/src/cobalt/site/docs/reference/starboard/modules/4/blitter.md
deleted file mode 100644
index 00d40a7..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/blitter.md
+++ /dev/null
@@ -1,921 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: blitter.h"
----
-
-The Blitter API provides support for issuing simple blit-style draw commands to
-either an offscreen surface or to a Starboard `SbWindow` object. Blitter is
-jargon that means "BLock Transfer," which might be abbreviated as BLT and,
-hence, the word "blit."
-
-This API is designed to allow implementations make use of GPU hardware
-acceleration, if it is available. Draw commands exist for solid-color rectangles
-and rasterization/blitting of rectangular images onto rectangular target
-patches.
-
-## Threading Concerns ##
-
-Note that in general the Blitter API is not thread safe, except for all
-`SbBlitterDevice`-related functions. All functions that are not required to
-internally ensure any thread safety guarantees are prefaced with a comment
-indicating that they are not thread safe.
-
-Functions which claim to not be thread safe can still be used from multiple
-threads, but manual synchronization must be performed in order to ensure their
-parameters are not referenced at the same time on another thread by another
-function.
-
-### Examples ###
-
-*   Multiple threads should not issue commands to the same `SbBlitterContext`
-    object unless they are manually synchronized.
-
-*   Multiple threads should not issue draw calls to the same render target, even
-    if the draw calls are made within separate contexts. In this case, be sure
-    to manually synchronize through the use of syncrhonization primitives and
-    use of the `SbBlitterFlushContext()` command.
-
-*   Multiple threads can operate on the swap chain, but they must perform manual
-    synchronization.
-
-## Enums ##
-
-### SbBlitterPixelDataFormat ###
-
-Defines the set of pixel formats that can be used with the Blitter API
-`SbBlitterPixelData` objects. Note that not all of these formats are guaranteed
-to be supported by a particular device, so before using these formats in pixel
-data creation commands, it should be checked that they are supported first (e.g.
-via `SbBlitterIsPixelFormatSupportedByPixelData()`). `SbBlitterPixelDataFormat`
-specifies specific orderings of the color channels, and when doing so, byte-
-order is used, e.g. "RGBA" implies that a value for red is stored in the byte
-with the lowest memory address. All pixel values are assumed to be in
-premultiplied alpha format.
-
-#### Values ####
-
-*   `kSbBlitterPixelDataFormatARGB8`
-
-    32-bit pixels with 8-bits per channel, the alpha component in the byte with
-    the lowest address and blue in the byte with the highest address.
-*   `kSbBlitterPixelDataFormatBGRA8`
-
-    32-bit pixels with 8-bits per channel, the blue component in the byte with
-    the lowest address and alpha in the byte with the highest address.
-*   `kSbBlitterPixelDataFormatRGBA8`
-
-    32-bit pixels with 8-bits per channel, the red component in the byte with
-    the lowest address and alpha in the byte with the highest address.
-*   `kSbBlitterPixelDataFormatA8`
-
-    8-bit pixels that contain only a single alpha channel. When rendered,
-    surfaces in this format will have `(R, G, B)` values of `(255, 255, 255)`.
-*   `kSbBlitterNumPixelDataFormats`
-
-    Constant that indicates how many unique pixel formats Starboard supports.
-*   `kSbBlitterInvalidPixelDataFormat`
-
-### SbBlitterSurfaceFormat ###
-
-Enumeration that describes the color format of surfaces. Note that
-`SbBlitterSurfaceFormat` does not differentiate between permutations of the
-color channel ordering (e.g. RGBA vs ARGB) since client code will never be able
-to access surface pixels directly. This is the main difference between
-`SbBlitterPixelDataFormat`, which does explicitly dictate an ordering.
-
-#### Values ####
-
-*   `kSbBlitterSurfaceFormatRGBA8`
-
-    32-bit RGBA color, with 8 bits per channel.
-*   `kSbBlitterSurfaceFormatA8`
-
-    8-bit alpha-only color.
-*   `kSbBlitterNumSurfaceFormats`
-
-    Constant that indicates how many unique surface formats Starboard supports.
-*   `kSbBlitterInvalidSurfaceFormat`
-
-## Typedefs ##
-
-### SbBlitterColor ###
-
-A simple 32-bit color representation that is a parameter to many Blitter
-functions.
-
-#### Definition ####
-
-```
-typedef uint32_t SbBlitterColor
-```
-
-## Structs ##
-
-### SbBlitterRect ###
-
-Defines a rectangle via a point `(x, y)` and a size `(width, height)`. This
-structure is used as a parameter type in various blit calls.
-
-#### Members ####
-
-*   `int x`
-*   `int y`
-*   `int width`
-*   `int height`
-
-### SbBlitterSurfaceInfo ###
-
-`SbBlitterSurfaceInfo` collects information about surfaces that can be queried
-from them at any time.
-
-#### Members ####
-
-*   `int width`
-*   `int height`
-*   `SbBlitterSurfaceFormat format`
-
-## Functions ##
-
-### SbBlitterAFromColor ###
-
-Extract alpha from a `SbBlitterColor` object.
-
-#### Declaration ####
-
-```
-static uint8_t SbBlitterAFromColor(SbBlitterColor color)
-```
-
-### SbBlitterBFromColor ###
-
-Extract blue from a `SbBlitterColor` object.
-
-#### Declaration ####
-
-```
-static uint8_t SbBlitterBFromColor(SbBlitterColor color)
-```
-
-### SbBlitterBlitRectToRect ###
-
-Issues a draw call on `context` that blits the area of `source_surface`
-specified by `src_rect` to `context`'s current render target at `dst_rect`. The
-source rectangle must lie within the dimensions of `source_surface`. Note that
-the `source_surface`'s alpha is modulated by `opacity` before being drawn. For
-`opacity`, a value of 0 implies complete invisibility, and a value of 255
-implies complete opacity.
-
-This function is not thread-safe.
-
-The return value indicates whether the draw call succeeded.
-
-`src_rect`: The area to be block transferred (blitted).
-
-#### Declaration ####
-
-```
-bool SbBlitterBlitRectToRect(SbBlitterContext context, SbBlitterSurface source_surface, SbBlitterRect src_rect, SbBlitterRect dst_rect)
-```
-
-### SbBlitterBlitRectToRectTiled ###
-
-This function functions identically to SbBlitterBlitRectToRect(), except it
-permits values of `src_rect` outside the dimensions of `source_surface`. In
-those regions, the pixel data from `source_surface` will be wrapped. Negative
-values for `src_rect.x` and `src_rect.y` are allowed.
-
-The output is all stretched to fit inside of `dst_rect`.
-
-This function is not thread-safe.
-
-The return value indicates whether the draw call succeeded.
-
-#### Declaration ####
-
-```
-bool SbBlitterBlitRectToRectTiled(SbBlitterContext context, SbBlitterSurface source_surface, SbBlitterRect src_rect, SbBlitterRect dst_rect)
-```
-
-### SbBlitterBlitRectsToRects ###
-
-This function achieves the same effect as calling `SbBlitterBlitRectToRect()`
-`num_rects` times with each of the `num_rects` values of `src_rects` and
-`dst_rects`. This function allows for greater efficiency than looped calls to
-`SbBlitterBlitRectToRect()`.
-
-This function is not thread-safe.
-
-The return value indicates whether the draw call succeeded.
-
-#### Declaration ####
-
-```
-bool SbBlitterBlitRectsToRects(SbBlitterContext context, SbBlitterSurface source_surface, const SbBlitterRect *src_rects, const SbBlitterRect *dst_rects, int num_rects)
-```
-
-### SbBlitterBytesPerPixelForFormat ###
-
-A convenience function to return the number of bytes per pixel for a given pixel
-format.
-
-#### Declaration ####
-
-```
-static int SbBlitterBytesPerPixelForFormat(SbBlitterPixelDataFormat format)
-```
-
-### SbBlitterColorFromRGBA ###
-
-A convenience function to create a `SbBlitterColor` object from separate 8-bit
-RGBA components.
-
-#### Declaration ####
-
-```
-static SbBlitterColor SbBlitterColorFromRGBA(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
-```
-
-### SbBlitterCreateContext ###
-
-Creates an `SbBlitterContext` object on `device`. The returned context can be
-used to set up draw state and issue draw calls.
-
-Note that there is a limit on the number of contexts that can exist
-simultaneously, which can be queried by calling `SbBlitterGetMaxContexts()`.
-(The limit is often `1`.)
-
-`SbBlitterContext` objects keep track of draw state between a series of draw
-calls. Please refer to the `SbBlitterContext()` definition for more information
-about contexts.
-
-This function is thread-safe.
-
-This function returns `kSbBlitterInvalidContext` upon failure. Note that the
-function fails if it has already been used to create the maximum number of
-contexts.
-
-`device`: The `SbBlitterDevice` for which the `SbBlitterContext` object is
-created.
-
-#### Declaration ####
-
-```
-SbBlitterContext SbBlitterCreateContext(SbBlitterDevice device)
-```
-
-### SbBlitterCreateDefaultDevice ###
-
-Creates and returns an `SbBlitterDevice` based on the Blitter API
-implementation's decision of which device should be the default. The returned
-`SbBlitterDevice` represents a connection to a device (like a GPU).
-
-On many platforms there is always one single obvious choice for a device to use,
-and that is the one that this function will return. For example, if this is
-called on a platform that has a single GPU, this call should return an object
-that represents that GPU. On a platform that has no GPU, an object representing
-a software CPU implementation may be returned.
-
-Only one default device can exist within a process at a time. This function is
-thread-safe.
-
-Returns `kSbBlitterInvalidDevice` on failure.
-
-#### Declaration ####
-
-```
-SbBlitterDevice SbBlitterCreateDefaultDevice()
-```
-
-### SbBlitterCreatePixelData ###
-
-Allocates an `SbBlitterPixelData` object through `device` with `width`, `height`
-and `pixel_format`. `pixel_format` must be supported by `device` (see
-`SbBlitterIsPixelFormatSupportedByPixelData()`).
-
-This function is thread-safe.
-
-Calling this function results in the allocation of CPU-accessible (though
-perhaps blitter-device-resident) memory to store pixel data of the requested
-size/format. An `SbBlitterPixelData` object should eventually be passed either
-into a call to `SbBlitterCreateSurfaceFromPixelData()` or into a call to
-`SbBlitterDestroyPixelData()`.
-
-Returns `kSbBlitterInvalidPixelData` upon failure.
-
-#### Declaration ####
-
-```
-SbBlitterPixelData SbBlitterCreatePixelData(SbBlitterDevice device, int width, int height, SbBlitterPixelDataFormat pixel_format)
-```
-
-### SbBlitterCreateRenderTargetSurface ###
-
-Creates a new surface with undefined pixel data on `device` with the specified
-`width`, `height` and `surface_format`. One can set the pixel data on the
-resulting surface by getting its associated SbBlitterRenderTarget object and
-then calling `SbBlitterGetRenderTargetFromSurface()`.
-
-This function is thread-safe.
-
-Returns `kSbBlitterInvalidSurface` upon failure.
-
-#### Declaration ####
-
-```
-SbBlitterSurface SbBlitterCreateRenderTargetSurface(SbBlitterDevice device, int width, int height, SbBlitterSurfaceFormat surface_format)
-```
-
-### SbBlitterCreateSurfaceFromPixelData ###
-
-Creates an `SbBlitterSurface` object on `device`. Note that `device` must match
-the device that was used to create the `SbBlitterPixelData` object provided via
-the `pixel_data` parameter.
-
-This function also destroys the input `pixel_data` object. As a result,
-`pixel_data` should not be accessed again after a call to this function.
-
-The returned object cannot be used as a render target (e.g. calling
-`SbBlitterGetRenderTargetFromSurface()` on it will return
-`kSbBlitterInvalidRenderTarget`).
-
-This function is thread-safe with respect to `device`, but `pixel_data` should
-not be modified on another thread while this function is called.
-
-Returns `kSbBlitterInvalidSurface` in the event of an error.
-
-#### Declaration ####
-
-```
-SbBlitterSurface SbBlitterCreateSurfaceFromPixelData(SbBlitterDevice device, SbBlitterPixelData pixel_data)
-```
-
-### SbBlitterCreateSwapChainFromWindow ###
-
-Creates and returns an `SbBlitterSwapChain` that can then be used to send
-graphics to the display. This function links `device` to `window`'s output, and
-drawing to the returned swap chain will result in `device` being used to render
-to `window`.
-
-This function must be called from the thread that called `SbWindowCreate()` to
-create `window`.
-
-Returns `kSbBlitterInvalidSwapChain` on failure.
-
-#### Declaration ####
-
-```
-SbBlitterSwapChain SbBlitterCreateSwapChainFromWindow(SbBlitterDevice device, SbWindow window)
-```
-
-### SbBlitterDestroyContext ###
-
-Destroys the specified `context`, freeing all its resources.
-
-This function is not thread-safe.
-
-The return value indicates whether the destruction succeeded.
-
-`context`: The object to be destroyed.
-
-#### Declaration ####
-
-```
-bool SbBlitterDestroyContext(SbBlitterContext context)
-```
-
-### SbBlitterDestroyDevice ###
-
-Destroys `device`, cleaning up all resources associated with it. This function
-is thread-safe, but it should not be called if `device` is still being accessed
-elsewhere.
-
-The return value indicates whether the destruction succeeded.
-
-`device`: The SbBlitterDevice object to be destroyed.
-
-#### Declaration ####
-
-```
-bool SbBlitterDestroyDevice(SbBlitterDevice device)
-```
-
-### SbBlitterDestroyPixelData ###
-
-Destroys `pixel_data`. Note that this function does not need to be called and
-should not be called if `SbBlitterCreateSurfaceFromPixelData()` has been called
-on `pixel_data` before.
-
-This function is thread-safe.
-
-The return value indicates whether the destruction succeeded.
-
-`pixel_data`: The object to be destroyed.
-
-#### Declaration ####
-
-```
-bool SbBlitterDestroyPixelData(SbBlitterPixelData pixel_data)
-```
-
-### SbBlitterDestroySurface ###
-
-Destroys the `surface` object, cleaning up all resources associated with it.
-
-This function is not thread safe.
-
-The return value indicates whether the destruction succeeded.
-
-`surface`: The object to be destroyed.
-
-#### Declaration ####
-
-```
-bool SbBlitterDestroySurface(SbBlitterSurface surface)
-```
-
-### SbBlitterDestroySwapChain ###
-
-Destroys `swap_chain`, cleaning up all resources associated with it. This
-function is not thread-safe and must be called on the same thread that called
-`SbBlitterCreateSwapChainFromWindow()`.
-
-The return value indicates whether the destruction succeeded.
-
-`swap_chain`: The SbBlitterSwapChain to be destroyed.
-
-#### Declaration ####
-
-```
-bool SbBlitterDestroySwapChain(SbBlitterSwapChain swap_chain)
-```
-
-### SbBlitterDownloadSurfacePixels ###
-
-Downloads `surface` pixel data into CPU memory pointed to by `out_pixel_data`,
-formatted according to the requested `pixel_format` and the requested
-`pitch_in_bytes`. Before calling this function, you can call
-`SbBlitterIsPixelFormatSupportedByDownloadSurfacePixels()` to confirm that
-`pixel_format` is, in fact, valid for `surface`.
-
-When this function is called, it first waits for all previously flushed graphics
-commands to be executed by the device before downloading the data. Since this
-function waits for the pipeline to empty, it should be used sparingly, such as
-within in debug or test environments.
-
-The return value indicates whether the pixel data was downloaded successfully.
-
-The returned alpha format is premultiplied.
-
-This function is not thread-safe.
-
-`out_pixel_data`: A pointer to a region of memory with a size of surface_height
-* `pitch_in_bytes` bytes.
-
-#### Declaration ####
-
-```
-bool SbBlitterDownloadSurfacePixels(SbBlitterSurface surface, SbBlitterPixelDataFormat pixel_format, int pitch_in_bytes, void *out_pixel_data)
-```
-
-### SbBlitterFillRect ###
-
-Issues a draw call on `context` that fills the specified rectangle `rect`. The
-rectangle's color is determined by the last call to `SbBlitterSetColor()`.
-
-This function is not thread-safe.
-
-The return value indicates whether the draw call succeeded.
-
-`context`: The context on which the draw call will operate. `rect`: The
-rectangle to be filled.
-
-#### Declaration ####
-
-```
-bool SbBlitterFillRect(SbBlitterContext context, SbBlitterRect rect)
-```
-
-### SbBlitterFlipSwapChain ###
-
-Flips the `swap_chain` by making the buffer previously accessible to draw
-commands via `SbBlitterGetRenderTargetFromSwapChain()` visible on the display,
-while another buffer in an initially undefined state is set up as the new draw
-command target. Note that you do not need to call
-`SbBlitterGetRenderTargetFromSwapChain()` again after flipping, the swap chain's
-render target always refers to its current back buffer.
-
-This function stalls the calling thread until the next vertical refresh. In
-addition, to ensure consistency with the Starboard Player API when rendering
-punch-out video, calls to `SbPlayerSetBounds()` do not take effect until this
-method is called.
-
-The return value indicates whether the flip succeeded.
-
-This function is not thread-safe.
-
-`swap_chain`: The SbBlitterSwapChain to be flipped.
-
-#### Declaration ####
-
-```
-bool SbBlitterFlipSwapChain(SbBlitterSwapChain swap_chain)
-```
-
-### SbBlitterFlushContext ###
-
-Flushes all draw calls previously issued to `context`. Calling this function
-guarantees that the device processes all draw calls issued to this point on this
-`context` before processing any subsequent draw calls on any context.
-
-Before calling `SbBlitterFlipSwapChain()`, it is often prudent to call this
-function to ensure that all draw calls are submitted before the flip occurs.
-
-This function is not thread-safe.
-
-The return value indicates whether the flush succeeded.
-
-`context`: The context for which draw calls are being flushed.
-
-#### Declaration ####
-
-```
-bool SbBlitterFlushContext(SbBlitterContext context)
-```
-
-### SbBlitterGFromColor ###
-
-Extract green from a `SbBlitterColor` object.
-
-#### Declaration ####
-
-```
-static uint8_t SbBlitterGFromColor(SbBlitterColor color)
-```
-
-### SbBlitterGetMaxContexts ###
-
-Returns the maximum number of contexts that `device` can support in parallel.
-Note that devices often support only a single context.
-
-This function is thread-safe.
-
-This function returns `-1` upon failure.
-
-`device`: The SbBlitterDevice for which the maximum number of contexts is
-returned.
-
-#### Declaration ####
-
-```
-int SbBlitterGetMaxContexts(SbBlitterDevice device)
-```
-
-### SbBlitterGetPixelDataPitchInBytes ###
-
-Retrieves the pitch (in bytes) for `pixel_data`. This indicates the number of
-bytes per row of pixel data in the image.
-
-This function is not thread-safe.
-
-Returns `-1` in the event of an error.
-
-`pixel_data`: The object for which you are retrieving the pitch.
-
-#### Declaration ####
-
-```
-int SbBlitterGetPixelDataPitchInBytes(SbBlitterPixelData pixel_data)
-```
-
-### SbBlitterGetPixelDataPointer ###
-
-Retrieves a CPU-accessible pointer to the pixel data represented by
-`pixel_data`. This pixel data can be modified by the CPU to initialize it on the
-CPU before calling `SbBlitterCreateSurfaceFromPixelData()`.
-
-Note that the pointer returned here is valid as long as `pixel_data` is valid,
-which means it is valid until either `SbBlitterCreateSurfaceFromPixelData()` or
-`SbBlitterDestroyPixelData()` is called.
-
-This function is not thread-safe.
-
-Returns `NULL` in the event of an error.
-
-#### Declaration ####
-
-```
-void* SbBlitterGetPixelDataPointer(SbBlitterPixelData pixel_data)
-```
-
-### SbBlitterGetRenderTargetFromSurface ###
-
-Returns the `SbBlitterRenderTarget` object owned by `surface`. The returned
-object can be used as a target for draw calls.
-
-This function returns `kSbBlitterInvalidRenderTarget` if `surface` is not able
-to provide a render target or on any other error.
-
-This function is not thread-safe.
-
-#### Declaration ####
-
-```
-SbBlitterRenderTarget SbBlitterGetRenderTargetFromSurface(SbBlitterSurface surface)
-```
-
-### SbBlitterGetRenderTargetFromSwapChain ###
-
-Returns the `SbBlitterRenderTarget` object that is owned by `swap_chain`. The
-returned object can be used to provide a target to blitter draw calls that draw
-directly to the display buffer. This function is not thread-safe.
-
-Returns `kSbBlitterInvalidRenderTarget` on failure.
-
-`swap_chain`: The SbBlitterSwapChain for which the target object is being
-retrieved.
-
-#### Declaration ####
-
-```
-SbBlitterRenderTarget SbBlitterGetRenderTargetFromSwapChain(SbBlitterSwapChain swap_chain)
-```
-
-### SbBlitterGetSurfaceInfo ###
-
-Retrieves an `SbBlitterSurfaceInfo` structure, which describes immutable
-parameters of the `surface`, such as its width, height and pixel format. The
-results are set on the output parameter `surface_info`, which cannot be `NULL`.
-
-The return value indicates whether the information was retrieved successfully.
-
-This function is not thread-safe.
-
-#### Declaration ####
-
-```
-bool SbBlitterGetSurfaceInfo(SbBlitterSurface surface, SbBlitterSurfaceInfo *surface_info)
-```
-
-### SbBlitterIsContextValid ###
-
-Checks whether a blitter context is invalid.
-
-#### Declaration ####
-
-```
-static bool SbBlitterIsContextValid(SbBlitterContext context)
-```
-
-### SbBlitterIsDeviceValid ###
-
-Checks whether a blitter device is invalid.
-
-#### Declaration ####
-
-```
-static bool SbBlitterIsDeviceValid(SbBlitterDevice device)
-```
-
-### SbBlitterIsPixelDataValid ###
-
-Checks whether a pixel data object is invalid.
-
-#### Declaration ####
-
-```
-static bool SbBlitterIsPixelDataValid(SbBlitterPixelData pixel_data)
-```
-
-### SbBlitterIsPixelFormatSupportedByDownloadSurfacePixels ###
-
-Indicates whether the combination of parameter values is valid for calls to
-`SbBlitterDownloadSurfacePixels()`.
-
-This function is not thread-safe.
-
-`surface`: The surface being checked. `pixel_format`: The pixel format that
-would be used on the surface.
-
-#### Declaration ####
-
-```
-bool SbBlitterIsPixelFormatSupportedByDownloadSurfacePixels(SbBlitterSurface surface, SbBlitterPixelDataFormat pixel_format)
-```
-
-### SbBlitterIsPixelFormatSupportedByPixelData ###
-
-Indicates whether `device` supports calls to `SbBlitterCreatePixelData` with the
-specified `pixel_format`. This function is thread-safe.
-
-`device`: The device for which compatibility is being checked. `pixel_format`:
-The SbBlitterPixelDataFormat for which compatibility is being checked.
-
-#### Declaration ####
-
-```
-bool SbBlitterIsPixelFormatSupportedByPixelData(SbBlitterDevice device, SbBlitterPixelDataFormat pixel_format)
-```
-
-### SbBlitterIsRenderTargetValid ###
-
-Checks whether a render target is invalid.
-
-#### Declaration ####
-
-```
-static bool SbBlitterIsRenderTargetValid(SbBlitterRenderTarget render_target)
-```
-
-### SbBlitterIsSurfaceFormatSupportedByRenderTargetSurface ###
-
-Indicates whether the `device` supports calls to
-`SbBlitterCreateRenderTargetSurface()` with `surface_format`.
-
-This function is thread-safe.
-
-`device`: The device being checked for compatibility. `surface_format`: The
-surface format being checked for compatibility.
-
-#### Declaration ####
-
-```
-bool SbBlitterIsSurfaceFormatSupportedByRenderTargetSurface(SbBlitterDevice device, SbBlitterSurfaceFormat surface_format)
-```
-
-### SbBlitterIsSurfaceValid ###
-
-Checks whether a surface is invalid.
-
-#### Declaration ####
-
-```
-static bool SbBlitterIsSurfaceValid(SbBlitterSurface surface)
-```
-
-### SbBlitterIsSwapChainValid ###
-
-Checks whether a swap chain is invalid.
-
-#### Declaration ####
-
-```
-static bool SbBlitterIsSwapChainValid(SbBlitterSwapChain swap_chain)
-```
-
-### SbBlitterMakeRect ###
-
-Convenience function to setup a rectangle with the specified parameters.
-
-#### Declaration ####
-
-```
-static SbBlitterRect SbBlitterMakeRect(int x, int y, int width, int height)
-```
-
-### SbBlitterPixelDataFormatToSurfaceFormat ###
-
-This function maps SbBlitterPixelDataFormat values to their corresponding
-`SbBlitterSurfaceFormat` value. Note that many `SbBlitterPixelDataFormat`s
-correspond to the same `SbBlitterSurfaceFormat`, so this function is not
-invertible. When creating a `SbBlitterSurface` object from a
-`SbBlitterPixelData` object, the `SbBlitterSurface`'s format will be computed
-from the `SbBlitterPixelData` object by using this function.
-
-#### Declaration ####
-
-```
-static SbBlitterSurfaceFormat SbBlitterPixelDataFormatToSurfaceFormat(SbBlitterPixelDataFormat pixel_format)
-```
-
-### SbBlitterRFromColor ###
-
-Extract red from a `SbBlitterColor` object.
-
-#### Declaration ####
-
-```
-static uint8_t SbBlitterRFromColor(SbBlitterColor color)
-```
-
-### SbBlitterSetBlending ###
-
-Sets the blending state for the specified `context`. By default, blending is
-disabled on a `SbBlitterContext`.
-
-This function is not thread-safe.
-
-The return value indicates whether the blending state was set successfully.
-
-`context`: The context for which the blending state is being set.
-
-`blending`: The blending state for the `context`. If `blending` is `true`, the
-source alpha of subsequent draw calls is used to blend with the destination
-color. In particular,
-
-```
-Fc = Sc * Sa + Dc * (1 - Sa)
-
-```
-
-where:
-
-*   `Fc` is the final color.
-
-*   `Sc` is the source color.
-
-*   `Sa` is the source alpha.
-
-*   `Dc` is the destination color.
-
-If `blending` is `false`, the source color and source alpha overwrite the
-destination color and alpha.
-
-#### Declaration ####
-
-```
-bool SbBlitterSetBlending(SbBlitterContext context, bool blending)
-```
-
-### SbBlitterSetColor ###
-
-Sets the context's current color. The current color's default value is
-`SbBlitterColorFromRGBA(255, 255, 255 255)`.
-
-The current color affects the fill rectangle's color in calls to
-`SbBlitterFillRect()`. If `SbBlitterSetModulateBlitsWithColor()` has been called
-to enable blit color modulation, the source blit surface pixel color is also
-modulated by the color before being output.
-
-This function is not thread-safe.
-
-The return value indicates whether the color was set successfully.
-
-`context`: The context for which the color is being set. `color`: The context's
-new color, specified in unpremultiplied alpha format.
-
-#### Declaration ####
-
-```
-bool SbBlitterSetColor(SbBlitterContext context, SbBlitterColor color)
-```
-
-### SbBlitterSetModulateBlitsWithColor ###
-
-Sets whether or not blit calls should have their source pixels modulated by the
-current color, which is set using `SbBlitterSetColor()`, before being output.
-This function can apply opacity to blit calls, color alpha-only surfaces, and
-apply other effects.
-
-This function is not thread-safe.
-
-The return value indicates whether the state was set successfully.
-
-`modulate_blits_with_color`: Indicates whether to modulate source pixels in blit
-calls.
-
-#### Declaration ####
-
-```
-bool SbBlitterSetModulateBlitsWithColor(SbBlitterContext context, bool modulate_blits_with_color)
-```
-
-### SbBlitterSetRenderTarget ###
-
-Sets up `render_target` as the render target that all subsequent draw calls made
-on `context` will use.
-
-This function is not thread-safe.
-
-The return value indicates whether the render target was set successfully.
-
-`context`: The object for which the render target is being set. `render_target`:
-The target that the `context` should use for draw calls.
-
-#### Declaration ####
-
-```
-bool SbBlitterSetRenderTarget(SbBlitterContext context, SbBlitterRenderTarget render_target)
-```
-
-### SbBlitterSetScissor ###
-
-Sets the scissor rectangle, which dictates a visibility area that affects all
-draw calls. Only pixels within the scissor rectangle are rendered, and all
-drawing outside of that area is clipped.
-
-When `SbBlitterSetRenderTarget()` is called, that function automatically sets
-the scissor rectangle to the size of the specified render target. If a scissor
-rectangle is specified outside of the extents of the current render target
-bounds, it will be intersected with the render target bounds.
-
-This function is not thread-safe.
-
-Returns whether the scissor was successfully set. It returns an error if it is
-called before a render target has been specified for the context.
-
-#### Declaration ####
-
-```
-bool SbBlitterSetScissor(SbBlitterContext context, SbBlitterRect rect)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/configuration.md b/src/cobalt/site/docs/reference/starboard/modules/4/configuration.md
deleted file mode 100644
index defaea0..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/configuration.md
+++ /dev/null
@@ -1,234 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: configuration.h"
----
-
-Provides a description of the current platform in lurid detail so that common
-code never needs to actually know what the current operating system and
-architecture are.
-
-It is both very pragmatic and canonical in that if any application code finds
-itself needing to make a platform decision, it should always define a Starboard
-Configuration feature instead. This implies the continued existence of very
-narrowly-defined configuration features, but it retains porting control in
-Starboard.
-
-## Macros ##
-
-### SB_ALIGNAS(byte_alignment) ###
-
-Specifies the alignment for a class, struct, union, enum, class/struct field, or
-stack variable.
-
-### SB_ALIGNOF(type) ###
-
-Returns the alignment reqiured for any instance of the type indicated by `type`.
-
-### SB_ARRAY_SIZE(array) ###
-
-A constant expression that evaluates to the size_t size of a statically-sized
-array.
-
-### SB_ARRAY_SIZE_INT(array) ###
-
-A constant expression that evaluates to the int size of a statically-sized
-array.
-
-### SB_CAN(SB_FEATURE) ###
-
-Determines a compile-time capability of the system.
-
-### SB_CAN_MEDIA_USE_STARBOARD_PIPELINE ###
-
-Specifies whether the starboard media pipeline components (SbPlayerPipeline and
-StarboardDecryptor) are used. Set to 0 means they are not used.
-
-### SB_COMPILE_ASSERT(expr, msg) ###
-
-Will cause a compiler error with `msg` if `expr` is false. `msg` must be a valid
-identifier, and must be a unique type in the scope of the declaration.
-
-### SB_DEPRECATED(FUNC) ###
-
-SB_DEPRECATED(int Foo(int bar)); Annotates the function as deprecated, which
-will trigger a compiler warning when referenced.
-
-### SB_DEPRECATED_EXTERNAL(FUNC) ###
-
-SB_DEPRECATED_EXTERNAL(...) annotates the function as deprecated for external
-clients, but not deprecated for starboard.
-
-### SB_DISALLOW_COPY_AND_ASSIGN(TypeName) ###
-
-A macro to disallow the copy constructor and operator= functions This should be
-used in the private: declarations for a class
-
-### SB_EXPERIMENTAL_API_VERSION ###
-
-The API version that is currently open for changes, and therefore is not stable
-or frozen. Production-oriented ports should avoid declaring that they implement
-the experimental Starboard API version.
-
-### SB_FUNCTION ###
-
-Whether we use **PRETTY_FUNCTION** PRETTY_FUNCTION or **FUNCTION** FUNCTION for
-logging.
-
-### SB_HAS(SB_FEATURE) ###
-
-Determines at compile-time whether this platform has a standard feature or
-header available.
-
-### SB_HAS_64_BIT_ATOMICS ###
-
-Whether the current platform has 64-bit atomic operations.
-
-### SB_HAS_AC3_AUDIO_API_VERSION ###
-
-Add support for audio in ac3.
-
-### SB_HAS_AV1_VERSION ###
-
-Replace kSbMediaVideoCodecVp10 by kSbMediaVideoCodecAv1. kSbMediaVideoCodecVp10
-in media.h is replaced by kSbMediaVideoCodecAv1.
-
-### SB_HAS_GLES2 ###
-
-Specifies whether this platform has a performant OpenGL ES 2 implementation,
-which allows client applications to use GL rendering paths. Derived from the gyp
-variable `gl_type` gl_type which indicates what kind of GL implementation is
-available.
-
-### SB_HAS_GRAPHICS ###
-
-Specifies whether this platform has any kind of supported graphics system.
-
-### SB_HAS_QUIRK(SB_FEATURE) ###
-
-Determines at compile-time whether this platform has a quirk.
-
-### SB_HAS_QUIRK_SUPPORT_INT16_AUDIO_SAMPLES ###
-
-Legal values for SB_PREFERRED_RGBA_BYTE_ORDER are defined in this file above as
-SB_PREFERRED_RGBA_BYTE_ORDER_*. If your platform uses GLES, you should set this
-to SB_PREFERRED_RGBA_BYTE_ORDER_RGBA.
-
-### SB_HAS_SCREEN_DIAGONAL_API_VERSION ###
-
-Adds support for allowing the platform to override its screen diagonal length
-via SbWindowGetDiagonalSizeInInches().
-
-### SB_HAS_STARTUP_URL_SIGNING_VERSION ###
-
-Add support for startup url signing by adding
-kSbSystemPropertyCertificationScope and
-kSbSystemPropertyBase64EncodedCertificationSecret system property enums to
-system.h.
-
-### SB_HAS_STD_UNORDERED_HASH_API_VERSION ###
-
-Add support for using C++11 standard unordered maps and sets. By setting
-SB_HAS_STD_UNORDERED_HASH to 1, a platform can be configured to use C++11
-standard hash table implementations, specifically, using: . std::unordered_map<>
-for base::hash_map<>, and . std::unordered_multimap<> for base::hash_multimap<>,
-and . std::unordered_set<> for base::hash_set<>, and . std::unordered_multiset<>
-for base::hash_multiset<>. When SB_HAS_STD_UNORDERED_HASH is used, it is no
-longer necessary to specify SB_HAS_LONG_LONG_HASH, SB_HAS_STRING_HASH,
-SB_HAS_HASH_USING, SB_HAS_HASH_VALUE, SB_HAS_HASH_WARNING, SB_HASH_MAP_INCLUDE,
-SB_HASH_NAMESPACE, or SB_HASH_SET_INCLUDE.
-
-### SB_INT64_C(x) ###
-
-Declare numeric literals of signed 64-bit type.
-
-### SB_IS(SB_FEATURE) ###
-
-Determines at compile-time an inherent aspect of this platform.
-
-### SB_IS_LITTLE_ENDIAN ###
-
-Whether the current platform is little endian.
-
-### SB_LIKELY(x) ###
-
-Macro for hinting that an expression is likely to be true.
-
-### SB_MAXIMUM_API_VERSION ###
-
-The maximum API version allowed by this version of the Starboard headers,
-inclusive.
-
-### SB_MEDIA_EOTF_CHECK_SUPPORT_VERSION ###
-
-Add SbMediaTransferId* argument `eotf` to SbMediaIsVideoSupported, so the
-platform may indicate support of resolution, bitrate, fps, and codec conditioned
-on eotf. Also, remove the function SbMediaIsTransferCharacteristicsSupported
-which is no longer necessary.
-
-### SB_MINIMUM_API_VERSION ###
-
-The minimum API version allowed by this version of the Starboard headers,
-inclusive.
-
-### SB_NORETURN ###
-
-Macro to annotate a function as noreturn, which signals to the compiler that the
-function cannot return.
-
-### SB_OVERRIDE ###
-
-Declares a function as overriding a virtual function on compilers that support
-it.
-
-### SB_PREFERRED_RGBA_BYTE_ORDER_RGBA ###
-
-An enumeration of values for the SB_PREFERRED_RGBA_BYTE_ORDER configuration
-variable. Setting this up properly means avoiding slow color swizzles when
-passing pixel data from one library to another. Note that these definitions are
-in byte-order and so are endianness-independent.
-
-### SB_PRINTF_FORMAT(format_param, dots_param) ###
-
-Tells the compiler a function is using a printf-style format string.
-`format_param` is the one-based index of the format string parameter;
-`dots_param` is the one-based index of the "..." parameter. For v*printf
-functions (which take a va_list), pass 0 for dots_param. (This is undocumented
-but matches what the system C headers do.) (Partially taken from
-base/compiler_specific.h)
-
-### SB_RELEASE_CANDIDATE_API_VERSION ###
-
-The next API version to be frozen, but is still subject to emergency changes. It
-is reasonable to base a port on the Release Candidate API version, but be aware
-that small incompatible changes may still be made to it. The following will be
-uncommented when an API version is a release candidate.
-
-### SB_RESTRICT ###
-
-Include the platform-specific configuration. This macro is set by GYP in
-starboard_base_target.gypi and passed in on the command line for all targets and
-all configurations.Makes a pointer-typed parameter restricted so that the
-compiler can make certain optimizations because it knows the pointers are
-unique.
-
-### SB_STRINGIFY(x) ###
-
-Standard CPP trick to stringify an evaluated macro definition.
-
-### SB_UINT64_C(x) ###
-
-Declare numeric literals of unsigned 64-bit type.
-
-### SB_UNLIKELY(x) ###
-
-Macro for hinting that an expression is likely to be false.
-
-### SB_UNREFERENCED_PARAMETER(x) ###
-
-Trivially references a parameter that is otherwise unreferenced, preventing a
-compiler warning on some platforms.
-
-### SB_WARN_UNUSED_RESULT ###
-
-Causes the annotated (at the end) function to generate a warning if the result
-is not accessed.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/cryptography.md b/src/cobalt/site/docs/reference/starboard/modules/4/cryptography.md
deleted file mode 100644
index 1540465..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/cryptography.md
+++ /dev/null
@@ -1,223 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: cryptography.h"
----
-
-Hardware-accelerated cryptography. Platforms should **only** only implement this
-when there are **hardware-accelerated** hardware-accelerated cryptography
-facilities. Applications must fall back to platform-independent CPU-based
-algorithms if the cipher algorithm isn't supported in hardware.
-
-## Tips for Porters ##
-
-You should implement cipher algorithms in this descending order of priority to
-maximize usage for SSL.
-
-1.  GCM - The preferred block cipher mode for OpenSSL, mainly due to speed.
-
-1.  CTR - This can be used internally with GCM, as long as the CTR
-    implementation only uses the last 4 bytes of the IV for the counter. (i.e.
-    96-bit IV, 32-bit counter)
-
-1.  ECB - This can be used (with a null IV) with any of the other cipher block
-    modes to accelerate the core AES algorithm if none of the streaming modes
-    can be accelerated.
-
-1.  CBC - GCM is always preferred if the server and client both support it. If
-    not, they will generally negotiate down to AES-CBC. If this happens, and CBC
-    is supported by SbCryptography, then it will be accelerated appropriately.
-    But, most servers should support GCM, so it is not likely to come up much,
-    which is why it is the lowest priority.
-
-Further reading on block cipher modes:
-
-[https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation)
-
-[https://crbug.com/442572](https://crbug.com/442572)
-
-[https://crypto.stackexchange.com/questions/10775/practical-disadvantages-of-gcm-mode-encryption](https://crypto.stackexchange.com/questions/10775/practical-disadvantages-of-gcm-mode-encryption)
-
-## Macros ##
-
-### kSbCryptographyAlgorithmAes ###
-
-String literal for the AES symmetric block cipher. [https://en.wikipedia.org/wiki/Advanced_Encryption_Standard](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard)
-
-### kSbCryptographyInvalidTransformer ###
-
-Well-defined value for an invalid transformer.
-
-## Enums ##
-
-### SbCryptographyBlockCipherMode ###
-
-The method of chaining encrypted blocks in a sequence. [https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation)
-
-#### Values ####
-
-*   `kSbCryptographyBlockCipherModeCbc`
-
-    Cipher Block Chaining mode.
-*   `kSbCryptographyBlockCipherModeCfb`
-
-    Cipher Feedback mode.
-*   `kSbCryptographyBlockCipherModeCtr`
-
-    Counter mode: A nonce is combined with an increasing counter.
-*   `kSbCryptographyBlockCipherModeEcb`
-
-    Electronic Code Book mode: No chaining.
-*   `kSbCryptographyBlockCipherModeOfb`
-
-    Output Feedback mode.
-*   `kSbCryptographyBlockCipherModeGcm`
-
-    Galois/Counter Mode.
-
-### SbCryptographyDirection ###
-
-The direction of a cryptographic transformation.
-
-#### Values ####
-
-*   `kSbCryptographyDirectionEncode`
-
-    Cryptographic transformations that encode/encrypt data into a target format.
-*   `kSbCryptographyDirectionDecode`
-
-    Cryptographic transformations that decode/decrypt data into its original
-    form.
-
-## Typedefs ##
-
-### SbCryptographyTransformer ###
-
-A handle to a cryptographic transformer.
-
-#### Definition ####
-
-```
-typedef SbCryptographyTransformerPrivate* SbCryptographyTransformer
-```
-
-## Functions ##
-
-### SbCryptographyCreateTransformer ###
-
-Creates an SbCryptographyTransformer with the given initialization data. It can
-then be used to transform a series of data blocks. Returns
-kSbCryptographyInvalidTransformer if the algorithm isn't supported, or if the
-parameters are not compatible with the algorithm.
-
-An SbCryptographyTransformer contains all state to start decrypting a sequence
-of cipher blocks according to the cipher block mode. It is not thread-safe, but
-implementations must allow different SbCryptographyTransformer instances to
-operate on different threads.
-
-All parameters must not be assumed to live longer than the call to this
-function. They must be copied by the implementation to be retained.
-
-This function determines success mainly based on whether the combination of
-`algorithm`, `direction`, `block_size_bits`, and `mode` is supported and whether
-all the sizes passed in are sufficient for the selected parameters. In
-particular, this function cannot verify that the key and IV used were correct
-for the ciphertext, were it to be used in the decode direction. The caller must
-make that verification.
-
-For example, to decrypt AES-128-CTR:
-SbCryptographyCreateTransformer(kSbCryptographyAlgorithmAes, 128,
-kSbCryptographyDirectionDecode, kSbCryptographyBlockCipherModeCtr, ...);
-
-`algorithm`: A string that represents the cipher algorithm. `block_size_bits`:
-The block size variant of the algorithm to use, in bits. `direction`: The
-direction in which to transform the data. `mode`: The block cipher mode to use.
-`initialization_vector`: The Initialization Vector (IV) to use. May be NULL for
-block cipher modes that don't use it, or don't set it at init time.
-`initialization_vector_size`: The size, in bytes, of the IV. `key`: The key to
-use for this transformation. `key_size`: The size, in bytes, of the key.
-
-#### Declaration ####
-
-```
-SbCryptographyTransformer SbCryptographyCreateTransformer(const char *algorithm, int block_size_bits, SbCryptographyDirection direction, SbCryptographyBlockCipherMode mode, const void *initialization_vector, int initialization_vector_size, const void *key, int key_size)
-```
-
-### SbCryptographyDestroyTransformer ###
-
-Destroys the given `transformer` instance.
-
-#### Declaration ####
-
-```
-void SbCryptographyDestroyTransformer(SbCryptographyTransformer transformer)
-```
-
-### SbCryptographyGetTag ###
-
-Calculates the authenticator tag for a transformer and places up to
-`out_tag_size` bytes of it in `out_tag`. Returns whether it was able to get the
-tag, which mainly has to do with whether it is compatible with the current block
-cipher mode.
-
-#### Declaration ####
-
-```
-bool SbCryptographyGetTag(SbCryptographyTransformer transformer, void *out_tag, int out_tag_size)
-```
-
-### SbCryptographyIsTransformerValid ###
-
-Returns whether the given transformer handle is valid.
-
-#### Declaration ####
-
-```
-static bool SbCryptographyIsTransformerValid(SbCryptographyTransformer transformer)
-```
-
-### SbCryptographySetAuthenticatedData ###
-
-Sets additional authenticated data (AAD) for a transformer, for chaining modes
-that support it (GCM). Returns whether the data was successfully set. This can
-fail if the chaining mode doesn't support AAD, if the parameters are invalid, or
-if the internal state is invalid for setting AAD.
-
-#### Declaration ####
-
-```
-bool SbCryptographySetAuthenticatedData(SbCryptographyTransformer transformer, const void *data, int data_size)
-```
-
-### SbCryptographySetInitializationVector ###
-
-Sets the initialization vector (IV) for a transformer, replacing the internally-
-set IV. The block cipher mode algorithm will update the IV appropriately after
-every block, so this is not necessary unless the stream is discontiguous in some
-way. This happens with AES-GCM in TLS.
-
-#### Declaration ####
-
-```
-void SbCryptographySetInitializationVector(SbCryptographyTransformer transformer, const void *initialization_vector, int initialization_vector_size)
-```
-
-### SbCryptographyTransform ###
-
-Transforms one or more `block_size_bits`-sized blocks of `in_data`, with the
-given `transformer`, placing the result in `out_data`. Returns the number of
-bytes that were written to `out_data`, unless there was an error, in which case
-it will return a negative number.
-
-`transformer`: A transformer initialized with an algorithm, IV, cipherkey, and
-so on. `in_data`: The data to be transformed. `in_data_size`: The size of the
-data to be transformed, in bytes. Must be a multiple of the transformer's
-`block-size_bits`, or an error will be returned. `out_data`: A buffer where the
-transformed data should be placed. Must have at least capacity for
-`in_data_size` bytes. May point to the same memory as `in_data`.
-
-#### Declaration ####
-
-```
-int SbCryptographyTransform(SbCryptographyTransformer transformer, const void *in_data, int in_data_size, void *out_data)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/decode_target.md b/src/cobalt/site/docs/reference/starboard/modules/4/decode_target.md
deleted file mode 100644
index e556249..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/decode_target.md
+++ /dev/null
@@ -1,350 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: decode_target.h"
----
-
-A target for decoding image and video data into. This corresponds roughly to an
-EGLImage, but that extension may not be fully supported on all GL platforms.
-SbDecodeTarget supports multi-plane targets. The SbBlitter API is supported as
-well, and this is able to more-or-less unify the two.
-
-An SbDecodeTarget can be passed into any function which decodes video or image
-data. This allows the application to allocate fast graphics memory, and have
-decoding done directly into this memory, avoiding unnecessary memory copies, and
-also avoiding pushing data between CPU and GPU memory unnecessarily.
-
-## SbDecodeTargetFormat ##
-
-SbDecodeTargets support several different formats that can be used to decode
-into and render from. Some formats may be easier to decode into, and others may
-be easier to render. Some may take less memory. Each decoder needs to support
-the SbDecodeTargetFormat passed into it, or the decode will produce an error.
-Each decoder provides a way to check if a given SbDecodeTargetFormat is
-supported by that decoder.
-
-## SbDecodeTargetGraphicsContextProvider ##
-
-Some components may need to acquire SbDecodeTargets compatible with a certain
-rendering context, which may need to be created on a particular thread. The
-SbDecodeTargetGraphicsContextProvider are passed in to the Starboard
-implementation from the application and provide information about the rendering
-context that will be used to render the SbDecodeTarget objects. For GLES
-renderers, it also provides functionality to enable the Starboard implementation
-to run arbitrary code on the application's renderer thread with the renderer's
-EGLContext held current. This may be useful if your SbDecodeTarget creation code
-needs to execute GLES commands like, for example, glGenTextures().
-
-The primary usage is likely to be the the SbPlayer implementation on some
-platforms.
-
-## SbDecodeTarget Example ##
-
-Let's say that we are an application and we would like to use the interface
-defined in starboard/image.h to decode an imaginary "image/foo" image type.
-
-First, the application should enumerate which SbDecodeTargetFormats are
-supported by that decoder.
-
-```
-SbDecodeTargetFormat kPreferredFormats[] = {
-    kSbDecodeTargetFormat3PlaneYUVI420,
-    kSbDecodeTargetFormat1PlaneRGBA,
-    kSbDecodeTargetFormat1PlaneBGRA,
-};
-
-SbDecodeTargetFormat format = kSbDecodeTargetFormatInvalid;
-for (int i = 0; i < SB_ARRAY_SIZE_INT(kPreferredFormats); ++i) {
-  if (SbImageIsDecodeSupported("image/foo", kPreferredFormats[i])) {
-    format = kPreferredFormats[i];
-    break;
-  }
-}
-
-```
-
-Now that the application has a format, it can create a decode target that it
-will use to decode the .foo file into. Let's assume format is
-kSbDecodeTargetFormat1PlaneRGBA, that we are on an EGL/GLES2 platform. Also, we
-won't do any error checking, to keep things even simpler.
-
-```
-SbDecodeTarget target = SbImageDecode(
-    context_provider, encoded_foo_data, encoded_foo_data_size,
-    "image/foo", format);
-
-// If the decode works, you can get the texture out and render it.
-SbDecodeTargetInfo info;
-SbMemorySet(&info, 0, sizeof(info));
-SbDecodeTargetGetInfo(target, &info);
-GLuint texture =
-    info.planes[kSbDecodeTargetPlaneRGBA].texture;
-```
-
-## Macros ##
-
-### kSbDecodeTargetInvalid ###
-
-Well-defined value for an invalid decode target handle.
-
-## Enums ##
-
-### SbDecodeTargetFormat ###
-
-The list of all possible decoder target formats. An SbDecodeTarget consists of
-one or more planes of data, each plane corresponding with a surface. For some
-formats, different planes will be different sizes for the same dimensions.
-
-NOTE: For enumeration entries with an alpha component, the alpha will always be
-premultiplied unless otherwise explicitly specified.
-
-#### Values ####
-
-*   `kSbDecodeTargetFormat1PlaneRGBA`
-
-    A decoder target format consisting of a single RGBA plane, in that channel
-    order.
-*   `kSbDecodeTargetFormat1PlaneBGRA`
-
-    A decoder target format consisting of a single BGRA plane, in that channel
-    order.
-*   `kSbDecodeTargetFormat2PlaneYUVNV12`
-
-    A decoder target format consisting of Y and interleaved UV planes, in that
-    plane and channel order.
-*   `kSbDecodeTargetFormat3PlaneYUVI420`
-
-    A decoder target format consisting of Y, U, and V planes, in that order.
-*   `kSbDecodeTargetFormatInvalid`
-
-    An invalid decode target format.
-
-### SbDecodeTargetPlane ###
-
-All the planes supported by SbDecodeTarget.
-
-#### Values ####
-
-*   `kSbDecodeTargetPlaneRGBA`
-
-    The RGBA plane for the RGBA format.
-*   `kSbDecodeTargetPlaneBGRA`
-
-    The BGRA plane for the BGRA format.
-*   `kSbDecodeTargetPlaneY`
-
-    The Y plane for multi-plane YUV formats.
-*   `kSbDecodeTargetPlaneUV`
-
-    The UV plane for 2-plane YUV formats.
-*   `kSbDecodeTargetPlaneU`
-
-    The U plane for 3-plane YUV formats.
-*   `kSbDecodeTargetPlaneV`
-
-    The V plane for 3-plane YUV formats.
-
-## Typedefs ##
-
-### SbDecodeTarget ###
-
-A handle to a target for image data decoding.
-
-#### Definition ####
-
-```
-typedef SbDecodeTargetPrivate* SbDecodeTarget
-```
-
-### SbDecodeTargetGlesContextRunner ###
-
-Signature for a function provided by the application to the Starboard
-implementation that will let the Starboard implementation run arbitrary code on
-the application's renderer thread with the application's EGLContext held
-current.
-
-#### Definition ####
-
-```
-typedef void(* SbDecodeTargetGlesContextRunner) (struct SbDecodeTargetGraphicsContextProvider *graphics_context_provider, SbDecodeTargetGlesContextRunnerTarget target_function, void *target_function_context)
-```
-
-### SbDecodeTargetGlesContextRunnerTarget ###
-
-Signature for a Starboard implementaion function that is to be run by a
-SbDecodeTargetGlesContextRunner callback.
-
-#### Definition ####
-
-```
-typedef void(* SbDecodeTargetGlesContextRunnerTarget) (void *gles_context_runner_target_context)
-```
-
-## Structs ##
-
-### SbDecodeTargetGraphicsContextProvider ###
-
-In general, the SbDecodeTargetGraphicsContextProvider structure provides
-information about the graphics context that will be used to render
-SbDecodeTargets. Some Starboard implementations may need to have references to
-some graphics objects when creating/destroying resources used by SbDecodeTarget.
-References to SbDecodeTargetGraphicsContextProvider objects should be provided
-to all Starboard functions that might create SbDecodeTargets (e.g.
-SbImageDecode()).
-
-#### Members ####
-
-*   `SbBlitterDevice device`
-
-    The SbBlitterDevice object that will be used to render any produced
-    SbDecodeTargets.
-
-### SbDecodeTargetInfo ###
-
-Contains all information about a decode target, including all of its planes.
-This can be queried via calls to SbDecodeTargetGetInfo().
-
-#### Members ####
-
-*   `SbDecodeTargetFormat format`
-
-    The decode target format, which would dictate how many planes can be
-    expected in `planes`.
-*   `bool is_opaque`
-
-    Specifies whether the decode target is opaque. The underlying source of this
-    value is expected to be properly maintained by the Starboard implementation.
-    So, for example, if an opaque only image type were decoded into an
-    SbDecodeTarget, then the implementation would configure things in such a way
-    that this value is set to true. By opaque, it is meant that all alpha values
-    are guaranteed to be 255, if the decode target is of a format that has alpha
-    values. If the decode target is of a format that does not have alpha values,
-    then this value should be set to true. Applications may rely on this value
-    in order to implement certain optimizations such as occlusion culling.
-*   `int width`
-
-    The width of the image represented by this decode target.
-*   `int height`
-
-    The height of the image represented by this decode target.
-*   `SbDecodeTargetInfoPlane planes`
-
-    The image planes (e.g. kSbDecodeTargetPlaneRGBA, or {kSbDecodeTargetPlaneY,
-    kSbDecodeTargetPlaneU, kSbDecodeTargetPlaneV} associated with this decode
-    target.
-
-### SbDecodeTargetInfoContentRegion ###
-
-Defines a rectangular content region within a SbDecodeTargetInfoPlane structure.
-
-#### Members ####
-
-*   `int left`
-*   `int top`
-*   `int right`
-*   `int bottom`
-
-### SbDecodeTargetInfoPlane ###
-
-Defines an image plane within a SbDecodeTargetInfo object.
-
-#### Members ####
-
-*   `SbBlitterSurface surface`
-
-    A handle to the Blitter surface that can be used for rendering.
-*   `int width`
-
-    The width of the texture/surface for this particular plane.
-*   `int height`
-
-    The height of the texture/surface for this particular plane.
-*   `SbDecodeTargetInfoContentRegion content_region`
-
-    The following properties specify a rectangle indicating a region within the
-    texture/surface that contains valid image data. The top-left corner is (0,
-    0) and increases to the right and to the bottom. The units specified by
-    these parameters are number of pixels. The range for left/right is [0,
-    width], and for top/bottom it is [0, height].
-
-## Functions ##
-
-### PrivateDecodeTargetReleaser ###
-
-This function is just an implementation detail of
-SbDecodeTargetReleaseInGlesContext() and should not be called directly.
-
-#### Declaration ####
-
-```
-static void PrivateDecodeTargetReleaser(void *context)
-```
-
-### SbDecodeTargetGetInfo ###
-
-Writes all information about `decode_target` into `out_info`. Returns false if
-the provided `out_info` structure is not zero initialized.
-
-#### Declaration ####
-
-```
-bool SbDecodeTargetGetInfo(SbDecodeTarget decode_target, SbDecodeTargetInfo *out_info)
-```
-
-### SbDecodeTargetIsFormatValid ###
-
-Returns whether a given format is valid.
-
-#### Declaration ####
-
-```
-static bool SbDecodeTargetIsFormatValid(SbDecodeTargetFormat format)
-```
-
-### SbDecodeTargetIsValid ###
-
-Returns whether the given file handle is valid.
-
-#### Declaration ####
-
-```
-static bool SbDecodeTargetIsValid(SbDecodeTarget handle)
-```
-
-### SbDecodeTargetRelease ###
-
-Returns ownership of `decode_target` to the Starboard implementation. This
-function will likely result in the destruction of the SbDecodeTarget and all its
-associated surfaces, though in some cases, platforms may simply adjust a
-reference count. In the case where SB_HAS(GLES2), this function must be called
-on a thread with the context
-
-#### Declaration ####
-
-```
-void SbDecodeTargetRelease(SbDecodeTarget decode_target)
-```
-
-### SbDecodeTargetReleaseInGlesContext ###
-
-Helper function that is possibly useful to Starboard implementations that will
-release a decode target on the thread with the GLES context current.
-
-#### Declaration ####
-
-```
-static void SbDecodeTargetReleaseInGlesContext(SbDecodeTargetGraphicsContextProvider *provider, SbDecodeTarget decode_target)
-```
-
-### SbDecodeTargetRunInGlesContext ###
-
-Inline convenience function to run an arbitrary
-SbDecodeTargetGlesContextRunnerTarget function through a
-SbDecodeTargetGraphicsContextProvider . This is intended to be called by
-Starboard implementations, if it is necessary.
-
-#### Declaration ####
-
-```
-static void SbDecodeTargetRunInGlesContext(SbDecodeTargetGraphicsContextProvider *provider, SbDecodeTargetGlesContextRunnerTarget target, void *target_context)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/directory.md b/src/cobalt/site/docs/reference/starboard/modules/4/directory.md
deleted file mode 100644
index 7288d2d..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/directory.md
+++ /dev/null
@@ -1,122 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: directory.h"
----
-
-Provides directory listing functions.
-
-## Macros ##
-
-### kSbDirectoryInvalid ###
-
-Well-defined value for an invalid directory stream handle.
-
-## Typedefs ##
-
-### SbDirectory ###
-
-A handle to an open directory stream.
-
-#### Definition ####
-
-```
-typedef struct SbDirectoryPrivate* SbDirectory
-```
-
-## Structs ##
-
-### SbDirectoryEntry ###
-
-Represents a directory entry.
-
-#### Members ####
-
-*   `char name`
-
-    The name of this directory entry.
-
-## Functions ##
-
-### SbDirectoryCanOpen ###
-
-Indicates whether SbDirectoryOpen is allowed for the given `path`.
-
-`path`: The path to be checked.
-
-#### Declaration ####
-
-```
-bool SbDirectoryCanOpen(const char *path)
-```
-
-### SbDirectoryClose ###
-
-Closes an open directory stream handle. The return value indicates whether the
-directory was closed successfully.
-
-`directory`: The directory stream handle to close.
-
-#### Declaration ####
-
-```
-bool SbDirectoryClose(SbDirectory directory)
-```
-
-### SbDirectoryCreate ###
-
-Creates the directory `path`, assuming the parent directory already exists. This
-function returns `true` if the directory now exists (even if it existed before)
-and returns `false` if the directory does not exist.
-
-`path`: The path to be created.
-
-#### Declaration ####
-
-```
-bool SbDirectoryCreate(const char *path)
-```
-
-### SbDirectoryGetNext ###
-
-Populates `out_entry` with the next entry in the specified directory stream, and
-moves the stream forward by one entry.
-
-This function returns `true` if there was a next directory, and `false` at the
-end of the directory stream.
-
-`directory`: The directory stream from which to retrieve the next directory.
-`out_entry`: The variable to be populated with the next directory entry.
-
-#### Declaration ####
-
-```
-bool SbDirectoryGetNext(SbDirectory directory, SbDirectoryEntry *out_entry)
-```
-
-### SbDirectoryIsValid ###
-
-Returns whether the given directory stream handle is valid.
-
-#### Declaration ####
-
-```
-static bool SbDirectoryIsValid(SbDirectory directory)
-```
-
-### SbDirectoryOpen ###
-
-Opens the given existing directory for listing. This function returns
-kSbDirectoryInvalidHandle if it is not successful.
-
-If `out_error` is provided by the caller, it will be set to the appropriate
-SbFileError code on failure.
-
-`out_error`: An output parameter that, in case of an error, is set to the reason
-that the directory could not be opened.
-
-#### Declaration ####
-
-```
-SbDirectory SbDirectoryOpen(const char *path, SbFileError *out_error)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/drm.md b/src/cobalt/site/docs/reference/starboard/modules/4/drm.md
deleted file mode 100644
index b15bf45..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/drm.md
+++ /dev/null
@@ -1,362 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: drm.h"
----
-
-Provides definitions that allow for DRM support, which are common between Player
-and Decoder interfaces.
-
-## Macros ##
-
-### kSbDrmSystemInvalid ###
-
-An invalid SbDrmSystem.
-
-### kSbDrmTicketInvalid ###
-
-A ticket for callback invocations initiated by the DRM system.
-
-## Enums ##
-
-### SbDrmKeyStatus ###
-
-Status of a particular media key. [https://w3c.github.io/encrypted-media/#idl-def-MediaKeyStatus](https://w3c.github.io/encrypted-media/#idl-def-MediaKeyStatus)
-
-#### Values ####
-
-*   `kSbDrmKeyStatusUsable`
-*   `kSbDrmKeyStatusExpired`
-*   `kSbDrmKeyStatusReleased`
-*   `kSbDrmKeyStatusRestricted`
-*   `kSbDrmKeyStatusDownscaled`
-*   `kSbDrmKeyStatusPending`
-*   `kSbDrmKeyStatusError`
-
-### SbDrmSessionRequestType ###
-
-The type of the session request. [https://www.w3.org/TR/encrypted-media/#idl-def-mediakeymessagetype](https://www.w3.org/TR/encrypted-media/#idl-def-mediakeymessagetype)
-
-#### Values ####
-
-*   `kSbDrmSessionRequestTypeLicenseRequest`
-*   `kSbDrmSessionRequestTypeLicenseRenewal`
-*   `kSbDrmSessionRequestTypeLicenseRelease`
-*   `kSbDrmSessionRequestTypeIndividualizationRequest`
-
-### SbDrmStatus ###
-
-The status of session related operations. Used by
-`SbDrmSessionUpdateRequestFunc`, `SbDrmSessionUpdatedFunc`, and
-`SbDrmServerCertificateUpdatedFunc` to indicate the status of the operation. [https://w3c.github.io/encrypted-media/#error-names](https://w3c.github.io/encrypted-media/#error-names)
-
-#### Values ####
-
-*   `kSbDrmStatusSuccess`
-*   `kSbDrmStatusTypeError`
-*   `kSbDrmStatusNotSupportedError`
-*   `kSbDrmStatusInvalidStateError`
-*   `kSbDrmStatusQuotaExceededError`
-*   `kSbDrmStatusUnknownError`
-
-    The following error can be used when the error status cannot be mapped to
-    one of the above errors.
-
-## Typedefs ##
-
-### SbDrmSessionClosedFunc ###
-
-A callback for signalling that a session has been closed by the SbDrmSystem
-
-#### Definition ####
-
-```
-typedef void(* SbDrmSessionClosedFunc) (SbDrmSystem drm_system, void *context, const void *session_id, int session_id_size)
-```
-
-### SbDrmSessionKeyStatusesChangedFunc ###
-
-A callback for notifications that the status of one or more keys in a session
-has been changed. All keys of the session and their new status will be passed
-along. Any keys not in the list is considered as deleted.
-
-#### Definition ####
-
-```
-typedef void(* SbDrmSessionKeyStatusesChangedFunc) (SbDrmSystem drm_system, void *context, const void *session_id, int session_id_size, int number_of_keys, const SbDrmKeyId *key_ids, const SbDrmKeyStatus *key_statuses)
-```
-
-### SbDrmSessionUpdateRequestFunc ###
-
-A callback that will receive generated session update request when requested
-from a SbDrmSystem. `drm_system` will be the DRM system that
-SbDrmGenerateSessionUpdateRequest() was called on. `context` will be the same
-context that was passed into the call to SbDrmCreateSystem().`ticket` will be
-the same ticket that was passed to SbDrmGenerateSessionUpdateRequest() or
-`kSbDrmTicketInvalid` if the update request was generated by the DRM system.
-
-`session_id` can be NULL if there was an error generating the request.
-
-#### Definition ####
-
-```
-typedef void(* SbDrmSessionUpdateRequestFunc) (SbDrmSystem drm_system, void *context, int ticket, const void *session_id, int session_id_size, const void *content, int content_size, const char *url)
-```
-
-### SbDrmSessionUpdatedFunc ###
-
-A callback for notifications that a session has been added, and subsequent
-encrypted samples are actively ready to be decoded. `drm_system` will be the DRM
-system that SbDrmUpdateSession() was called on. `context` will be the same
-context passed into that call to SbDrmCreateSystem().
-
-`ticket` will be the same ticket that was passed to
-SbDrmUpdateSession().`succeeded` is whether the session was successfully updated
-or not.
-
-#### Definition ####
-
-```
-typedef void(* SbDrmSessionUpdatedFunc) (SbDrmSystem drm_system, void *context, int ticket, const void *session_id, int session_id_size, bool succeeded)
-```
-
-### SbDrmSystem ###
-
-A handle to a DRM system which can be used with either an SbDecoder or a
-SbPlayer.
-
-#### Definition ####
-
-```
-typedef struct SbDrmSystemPrivate* SbDrmSystem
-```
-
-## Structs ##
-
-### SbDrmKeyId ###
-
-#### Members ####
-
-*   `uint8_t identifier`
-
-    The ID of the license (or key) required to decrypt this sample. For
-    PlayReady, this is the license GUID in packed little-endian binary form.
-*   `int identifier_size`
-
-### SbDrmSampleInfo ###
-
-All the optional information needed per sample for encrypted samples.
-
-#### Members ####
-
-*   `uint8_t initialization_vector`
-
-    The Initialization Vector needed to decrypt this sample.
-*   `int initialization_vector_size`
-*   `uint8_t identifier`
-
-    The ID of the license (or key) required to decrypt this sample. For
-    PlayReady, this is the license GUID in packed little-endian binary form.
-*   `int identifier_size`
-*   `int32_t subsample_count`
-
-    The number of subsamples in this sample, must be at least 1.
-*   `constSbDrmSubSampleMapping* subsample_mapping`
-
-    The clear/encrypted mapping of each subsample in this sample. This must be
-    an array of `subsample_count` mappings.
-
-### SbDrmSubSampleMapping ###
-
-A mapping of clear and encrypted bytes for a single subsample. All subsamples
-within a sample must be encrypted with the same encryption parameters. The clear
-bytes always appear first in the sample.
-
-#### Members ####
-
-*   `int32_t clear_byte_count`
-
-    How many bytes of the corresponding subsample are not encrypted
-*   `int32_t encrypted_byte_count`
-
-    How many bytes of the corresponding subsample are encrypted.
-
-## Functions ##
-
-### SbDrmCloseSession ###
-
-Clear any internal states/resources related to the specified `session_id`.
-
-#### Declaration ####
-
-```
-void SbDrmCloseSession(SbDrmSystem drm_system, const void *session_id, int session_id_size)
-```
-
-### SbDrmCreateSystem ###
-
-Creates a new DRM system that can be used when constructing an SbPlayer or an
-SbDecoder.
-
-This function returns kSbDrmSystemInvalid if `key_system` is unsupported.
-
-Also see the documentation of SbDrmGenerateSessionUpdateRequest() and
-SbDrmUpdateSession() for more details.
-
-`key_system`: The DRM key system to be created. The value should be in the form
-of "com.example.somesystem" as suggested by [https://w3c.github.io/encrypted-media/#key-system](https://w3c.github.io/encrypted-media/#key-system)) . All
-letters in the value should be lowercase and will be matched exactly with known
-DRM key systems of the platform. `context`: A value passed when any of this
-function's callback parameters are called. `update_request_callback`: A function
-that is called every time after SbDrmGenerateSessionUpdateRequest() is called.
-`session_updated_callback`: A function that is called every time after
-SbDrmUpdateSession() is called. `key_statuses_changed_callback`: A function that
-can be called to indicate that key statuses have changed.
-`server_certificate_updated_callback`: A function that is called to report
-whether the server certificate has been successfully updated. It is called once
-and only once. It is possible that the callback is called before the function
-returns. `session_closed_callback`: A function that can be called to indicate
-that a session has closed.
-
-#### Declaration ####
-
-```
-SbDrmSystem SbDrmCreateSystem(const char *key_system, void *context, SbDrmSessionUpdateRequestFunc update_request_callback, SbDrmSessionUpdatedFunc session_updated_callback, SbDrmSessionKeyStatusesChangedFunc key_statuses_changed_callback, SbDrmSessionClosedFunc session_closed_callback)
-```
-
-### SbDrmDestroySystem ###
-
-Destroys `drm_system`, which implicitly removes all keys installed in it and
-invalidates all outstanding session update requests. A DRM system cannot be
-destroyed unless any associated SbPlayer or SbDecoder has first been destroyed.
-
-All callbacks are guaranteed to be finished when this function returns. As a
-result, if this function is called from a callback that is passed to
-SbDrmCreateSystem(), a deadlock will occur.
-
-`drm_system`: The DRM system to be destroyed.
-
-#### Declaration ####
-
-```
-void SbDrmDestroySystem(SbDrmSystem drm_system)
-```
-
-### SbDrmGenerateSessionUpdateRequest ###
-
-Asynchronously generates a session update request payload for
-`initialization_data`, of `initialization_data_size`, in case sensitive `type`,
-extracted from the media stream, in `drm_system`'s key system.
-
-This function calls `drm_system`'s `update_request_callback` function, which is
-defined when the DRM system is created by SbDrmCreateSystem. When calling that
-function, this function either sends `context` (also from `SbDrmCreateSystem`)
-and a populated request, or it sends NULL `session_id` if an error occurred.
-
-`drm_system`'s `context` may be used to route callbacks back to an object
-instance.
-
-Callbacks may be called either from the current thread before this function
-returns or from another thread.
-
-`drm_system`: The DRM system that defines the key system used for the session
-update request payload as well as the callback function that is called as a
-result of the function being called.
-
-`ticket`: The opaque ID that allows to distinguish callbacks from multiple
-concurrent calls to SbDrmGenerateSessionUpdateRequest(), which will be passed to
-`update_request_callback` as-is. It is the responsibility of the caller to
-establish ticket uniqueness, issuing multiple requests with the same ticket may
-result in undefined behavior. The value `kSbDrmTicketInvalid` must not be used.
-
-`type`: The case-sensitive type of the session update request payload.
-`initialization_data`: The data for which the session update request payload is
-created. `initialization_data_size`: The size of the session update request
-payload.
-
-#### Declaration ####
-
-```
-void SbDrmGenerateSessionUpdateRequest(SbDrmSystem drm_system, int ticket, const char *type, const void *initialization_data, int initialization_data_size)
-```
-
-### SbDrmGetKeyCount ###
-
-Returns the number of keys installed in `drm_system`.
-
-`drm_system`: The system for which the number of installed keys is retrieved.
-
-#### Declaration ####
-
-```
-int SbDrmGetKeyCount(SbDrmSystem drm_system)
-```
-
-### SbDrmGetKeyStatus ###
-
-Gets `out_key`, `out_key_size`, and `out_status` for the key with `index` in
-`drm_system`. Returns whether a key is installed at `index`. If not, the output
-parameters, which all must not be NULL, will not be modified.
-
-#### Declaration ####
-
-```
-bool SbDrmGetKeyStatus(SbDrmSystem drm_system, const void *session_id, int session_id_size, int index, void **out_key, int *out_key_size, SbDrmKeyStatus *out_status)
-```
-
-### SbDrmRemoveAllKeys ###
-
-Removes all installed keys for `drm_system`. Any outstanding session update
-requests are also invalidated.
-
-`drm_system`: The DRM system for which keys should be removed.
-
-#### Declaration ####
-
-```
-void SbDrmRemoveAllKeys(SbDrmSystem drm_system)
-```
-
-### SbDrmSystemIsValid ###
-
-Indicates whether `drm_system` is a valid SbDrmSystem.
-
-#### Declaration ####
-
-```
-static bool SbDrmSystemIsValid(SbDrmSystem drm)
-```
-
-### SbDrmTicketIsValid ###
-
-Indicates whether `ticket` is a valid ticket.
-
-#### Declaration ####
-
-```
-static bool SbDrmTicketIsValid(int ticket)
-```
-
-### SbDrmUpdateSession ###
-
-Update session with `key`, in `drm_system`'s key system, from the license server
-response. Calls `session_updated_callback` with `context` and whether the update
-succeeded. `context` may be used to route callbacks back to an object instance.
-
-`ticket` is the opaque ID that allows to distinguish callbacks from multiple
-concurrent calls to SbDrmUpdateSession(), which will be passed to
-`session_updated_callback` as-is. It is the responsibility of the caller to
-establish ticket uniqueness, issuing multiple calls with the same ticket may
-result in undefined behavior.
-
-Once the session is successfully updated, an SbPlayer or SbDecoder associated
-with that DRM key system will be able to decrypt encrypted samples.
-
-`drm_system`'s `session_updated_callback` may called either from the current
-thread before this function returns or from another thread.
-
-#### Declaration ####
-
-```
-void SbDrmUpdateSession(SbDrmSystem drm_system, int ticket, const void *key, int key_size, const void *session_id, int session_id_size)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/event.md b/src/cobalt/site/docs/reference/starboard/modules/4/event.md
deleted file mode 100644
index ad42c4a..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/event.md
+++ /dev/null
@@ -1,332 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: event.h"
----
-
-Defines the event system that wraps the Starboard main loop and entry point.
-
-## The Starboard Application Lifecycle ##
-
-```
-    ---------- *
-   |           |
-   |        Preload
-   |           |
-   |           V
- Start   [ PRELOADING ] ------------
-   |           |                    |
-   |         Start                  |
-   |           |                    |
-   |           V                    |
-    ----> [ STARTED ] <----         |
-               |           |        |
-             Pause       Unpause    |
-               |           |     Suspend
-               V           |        |
-    -----> [ PAUSED ] -----         |
-   |           |                    |
-Resume      Suspend                 |
-   |           |                    |
-   |           V                    |
-    ---- [ SUSPENDED ] <------------
-               |
-              Stop
-               |
-               V
-          [ STOPPED ]
-
-```
-
-The first event that a Starboard application receives is either `Start`
-(`kSbEventTypeStart`) or `Preload` (`kSbEventTypePreload`). `Start` puts the
-application in the `STARTED` state, whereas `Preload` puts the application in
-the `PRELOADING` state.
-
-`PRELOADING` can only happen as the first application state. In this state, the
-application should start and run as normal, but will not receive any input, and
-should not try to initialize graphics resources (via GL or `SbBlitter`). In
-`PRELOADING`, the application can receive `Start` or `Suspend` events. `Start`
-will receive the same data that was passed into `Preload`.
-
-In the `STARTED` state, the application is in the foreground and can expect to
-do all of the normal things it might want to do. Once in the `STARTED` state, it
-may receive a `Pause` event, putting the application into the `PAUSED` state.
-
-In the `PAUSED` state, the application is still visible, but has lost focus, or
-it is partially obscured by a modal dialog, or it is on its way to being shut
-down. The application should pause activity in this state. In this state, it can
-receive `Unpause` to be brought back to the foreground state (`STARTED`), or
-`Suspend` to be pushed further in the background to the `SUSPENDED` state.
-
-In the `SUSPENDED` state, the application is generally not visible. It should
-immediately release all graphics and video resources, and shut down all
-background activity (timers, rendering, etc). Additionally, the application
-should flush storage to ensure that if the application is killed, the storage
-will be up-to-date. The application may be killed at this point, but will
-ideally receive a `Stop` event for a more graceful shutdown.
-
-Note that the application is always expected to transition through `PAUSED` to
-`SUSPENDED` before receiving `Stop` or being killed.
-
-## Enums ##
-
-### SbEventType ###
-
-An enumeration of all possible event types dispatched directly by the system.
-Each event is accompanied by a void* data argument, and each event must define
-the type of the value pointed to by that data argument, if any.
-
-#### Values ####
-
-*   `kSbEventTypeStart`
-
-    The first event that an application receives on startup when starting
-    normally (i.e. not being preloaded). Applications should perform
-    initialization, start running, and prepare to react to subsequent events.
-    Applications that wish to run and then exit must call
-    `SbSystemRequestStop()` to terminate. This event will only be sent once for
-    a given process launch. `SbEventStartData` is passed as the data argument.
-    In case of preload, the `SbEventStartData` will be the same as what was
-    passed to `kSbEventTypePreload`.
-*   `kSbEventTypePause`
-
-    A dialog will be raised or the application will otherwise be put into a
-    background-but-visible or partially-obscured state (PAUSED). Graphics and
-    video resources will still be available, but the application should pause
-    foreground activity like animations and video playback. Can only be received
-    after a Start event. The only events that should be dispatched after a Pause
-    event are Unpause or Suspend. No data argument.
-*   `kSbEventTypeUnpause`
-
-    The application is returning to the foreground (STARTED) after having been
-    put in the PAUSED (e.g. partially-obscured) state. The application should
-    unpause foreground activity like animations and video playback. Can only be
-    received after a Pause or Resume event. No data argument.
-*   `kSbEventTypeSuspend`
-
-    The operating system will put the application into a Suspended state after
-    this event is handled. The application is expected to stop periodic
-    background work, release ALL graphics and video resources, and flush any
-    pending SbStorage writes. Some platforms will terminate the application if
-    work is done or resources are retained after suspension. Can only be
-    received after a Pause event. The only events that should be dispatched
-    after a Suspend event are Resume or Stop. On some platforms, the process may
-    also be killed after Suspend without a Stop event. No data argument.
-*   `kSbEventTypeResume`
-
-    The operating system has restored the application to the PAUSED state from
-    the SUSPENDED state. This is the first event the application will receive
-    coming out of SUSPENDED, and it will only be received after a Suspend event.
-    The application will now be in the PAUSED state. No data argument.
-*   `kSbEventTypeStop`
-
-    The operating system will shut the application down entirely after this
-    event is handled. Can only be recieved after a Suspend event, in the
-    SUSPENDED state. No data argument.
-*   `kSbEventTypeInput`
-
-    A user input event, including keyboard, mouse, gesture, or something else.
-    SbInputData (from input.h) is passed as the data argument.
-*   `kSbEventTypeUser`
-
-    A user change event, which means a new user signed-in or signed-out, or the
-    current user changed. No data argument, call SbUserGetSignedIn() and
-    SbUserGetCurrent() to get the latest changes.
-*   `kSbEventTypeLink`
-
-    A navigational link has come from the system, and the application should
-    consider handling it by navigating to the corresponding application
-    location. The data argument is an application-specific, null-terminated
-    string.
-*   `kSbEventTypeVerticalSync`
-
-    The beginning of a vertical sync has been detected. This event is very
-    timing-sensitive, so as little work as possible should be done on the main
-    thread if the application wants to receive this event in a timely manner. No
-    data argument.
-*   `kSbEventTypeNetworkDisconnect`
-
-    The platform has detected a network disconnection. The platform should make
-    a best effort to send an event of this type when the network disconnects,
-    but there are likely to be cases where the platform cannot detect the
-    disconnection (e.g. if the connection is via a powered hub which becomes
-    disconnected), so the current network state cannot always be inferred from
-    the sequence of Connect/Disconnect events.
-*   `kSbEventTypeNetworkConnect`
-
-    The platform has detected a network connection. This event may be sent at
-    application start-up, and should always be sent if the network reconnects
-    since a disconnection event was sent.
-*   `kSbEventTypeScheduled`
-
-    An event type reserved for scheduled callbacks. It will only be sent in
-    response to an application call to SbEventSchedule(), and it will call the
-    callback directly, so SbEventHandle should never receive this event
-    directly. The data type is an internally-defined structure.
-*   `kSbEventTypeAccessiblitySettingsChanged`
-
-    The platform's accessibility settings have changed. The application should
-    query the accessibility settings using the appropriate APIs to get the new
-    settings. Note this excludes captions settings changes, which causes
-    kSbEventTypeAccessibilityCaptionSettingsChanged to fire.
-*   `kSbEventTypeOnScreenKeyboardShown`
-
-    The platform has shown the on screen keyboard. This event is triggered by
-    the system or by the application's OnScreenKeyboard show method. The event
-    has int data representing a ticket. The ticket is used by the application to
-    mark individual calls to the show method as successfully completed. Events
-    triggered by the application have tickets passed in via
-    SbWindowShowOnScreenKeyboard. System-triggered events have ticket value
-    kSbEventOnScreenKeyboardInvalidTicket.
-*   `kSbEventTypeOnScreenKeyboardHidden`
-
-    The platform has hidden the on screen keyboard. This event is triggered by
-    the system or by the application's OnScreenKeyboard hide method. The event
-    has int data representing a ticket. The ticket is used by the application to
-    mark individual calls to the hide method as successfully completed. Events
-    triggered by the application have tickets passed in via
-    SbWindowHideOnScreenKeyboard. System-triggered events have ticket value
-    kSbEventOnScreenKeyboardInvalidTicket.
-*   `kSbEventTypeOnScreenKeyboardFocused`
-
-    The platform has focused the on screen keyboard. This event is triggered by
-    the system or by the application's OnScreenKeyboard focus method. The event
-    has int data representing a ticket. The ticket is used by the application to
-    mark individual calls to the focus method as successfully completed. Events
-    triggered by the application have tickets passed in via
-    SbWindowFocusOnScreenKeyboard. System-triggered events have ticket value
-    kSbEventOnScreenKeyboardInvalidTicket.
-*   `kSbEventTypeOnScreenKeyboardBlurred`
-
-    The platform has blurred the on screen keyboard. This event is triggered by
-    the system or by the application's OnScreenKeyboard blur method. The event
-    has int data representing a ticket. The ticket is used by the application to
-    mark individual calls to the blur method as successfully completed. Events
-    triggered by the application have tickets passed in via
-    SbWindowBlurOnScreenKeyboard. System-triggered events have ticket value
-    kSbEventOnScreenKeyboardInvalidTicket.
-*   `kSbEventTypeAccessibilityCaptionSettingsChanged`
-
-    One or more of the fields returned by SbAccessibilityGetCaptionSettings has
-    changed.
-
-## Typedefs ##
-
-### SbEventCallback ###
-
-A function that can be called back from the main Starboard event pump.
-
-#### Definition ####
-
-```
-typedef void(* SbEventCallback) (void *context)
-```
-
-### SbEventDataDestructor ###
-
-A function that will cleanly destroy an event data instance of a specific type.
-
-#### Definition ####
-
-```
-typedef void(* SbEventDataDestructor) (void *data)
-```
-
-### SbEventId ###
-
-An ID that can be used to refer to a scheduled event.
-
-#### Definition ####
-
-```
-typedef uint32_t SbEventId
-```
-
-## Structs ##
-
-### SbEvent ###
-
-Structure representing a Starboard event and its data.
-
-#### Members ####
-
-*   `SbEventType type`
-*   `void * data`
-
-### SbEventStartData ###
-
-Event data for kSbEventTypeStart events.
-
-#### Members ####
-
-*   `char ** argument_values`
-
-    The command-line argument values (argv).
-*   `int argument_count`
-
-    The command-line argument count (argc).
-*   `const char * link`
-
-    The startup link, if any.
-
-## Functions ##
-
-### SbEventCancel ###
-
-Cancels the specified `event_id`. Note that this function is a no-op if the
-event already fired. This function can be safely called from any thread, but the
-only way to guarantee that the event does not run anyway is to call it from the
-main Starboard event loop thread.
-
-#### Declaration ####
-
-```
-void SbEventCancel(SbEventId event_id)
-```
-
-### SbEventHandle ###
-
-The entry point that Starboard applications MUST implement. Any memory pointed
-at by `event` or the `data` field inside `event` is owned by the system, and
-that memory is reclaimed after this function returns, so the implementation must
-copy this data to extend its life. This behavior should also be assumed of all
-fields within the `data` object, unless otherwise explicitly specified.
-
-This function is only called from the main Starboard thread. There is no
-specification about what other work might happen on this thread, so the
-application should generally do as little work as possible on this thread, and
-just dispatch it over to another thread.
-
-#### Declaration ####
-
-```
-SB_IMPORT void SbEventHandle(const SbEvent *event)
-```
-
-### SbEventIsIdValid ###
-
-Returns whether the given event handle is valid.
-
-#### Declaration ####
-
-```
-static bool SbEventIsIdValid(SbEventId handle)
-```
-
-### SbEventSchedule ###
-
-Schedules an event `callback` into the main Starboard event loop. This function
-may be called from any thread, but `callback` is always called from the main
-Starboard thread, queued with other pending events.
-
-`callback`: The callback function to be called. `context`: The context that is
-passed to the `callback` function. `delay`: The minimum number of microseconds
-to wait before calling the `callback` function. Set `delay` to `0` to call the
-callback as soon as possible.
-
-#### Declaration ####
-
-```
-SbEventId SbEventSchedule(SbEventCallback callback, void *context, SbTime delay)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/export.md b/src/cobalt/site/docs/reference/starboard/modules/4/export.md
deleted file mode 100644
index a6907e2..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/export.md
+++ /dev/null
@@ -1,17 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: export.h"
----
-
-Provides macros for properly exporting or importing symbols from shared
-libraries.
-
-## Macros ##
-
-### SB_EXPORT ###
-
-COMPONENT_BUILD is defined when generating shared libraries for each project,
-rather than static libraries. This means we need to be careful about
-EXPORT/IMPORT. SB_IS_LIBRARY is defined when building Starboard as a shared
-library to be linked into a client app. In this case, we want to explicitly
-define EXPORT/IMPORT so that Starboard's symbols are visible to such clients.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/file.md b/src/cobalt/site/docs/reference/starboard/modules/4/file.md
deleted file mode 100644
index b115501..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/file.md
+++ /dev/null
@@ -1,390 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: file.h"
----
-
-Defines file system input/output functions.
-
-## Macros ##
-
-### kSbFileInvalid ###
-
-Well-defined value for an invalid file handle.
-
-## Enums ##
-
-### SbFileError ###
-
-kSbFileErrorAccessDenied is returned when a call fails because of a filesystem
-restriction. kSbFileErrorSecurity is returned when a security policy doesn't
-allow the operation to be executed.
-
-#### Values ####
-
-*   `kSbFileOk`
-*   `kSbFileErrorFailed`
-*   `kSbFileErrorInUse`
-*   `kSbFileErrorExists`
-*   `kSbFileErrorNotFound`
-*   `kSbFileErrorAccessDenied`
-*   `kSbFileErrorTooManyOpened`
-*   `kSbFileErrorNoMemory`
-*   `kSbFileErrorNoSpace`
-*   `kSbFileErrorNotADirectory`
-*   `kSbFileErrorInvalidOperation`
-*   `kSbFileErrorSecurity`
-*   `kSbFileErrorAbort`
-*   `kSbFileErrorNotAFile`
-*   `kSbFileErrorNotEmpty`
-*   `kSbFileErrorInvalidUrl`
-*   `kSbFileErrorMax`
-
-    Put new entries here and increment kSbFileErrorMax.
-
-### SbFileFlags ###
-
-Flags that define how a file is used in the application. These flags should be
-or'd together when passed to SbFileOpen to open or create a file.
-
-The following five flags are mutually exclusive. You must specify exactly one of
-them:
-
-*   `kSbFileOpenAlways`
-
-*   `kSbFileOpenOnly`
-
-*   `kSbFileOpenTruncated`
-
-*   `kSbFileCreateAlways`
-
-*   `kSbFileCreateOnly`
-
-In addition, one or more of the following flags must be specified:
-
-*   `kSbFileRead`
-
-*   `kSbFileWrite`
-
-The `kSbFileAsync` flag is optional.
-
-#### Values ####
-
-*   `kSbFileOpenOnly`
-*   `kSbFileCreateOnly`
-*   `kSbFileOpenAlways`
-
-    does not already exist.
-*   `kSbFileCreateAlways`
-
-    path or creates a new file at that path.
-*   `kSbFileOpenTruncated`
-
-    or overwrites an existing file at that path.
-*   `kSbFileRead`
-
-    only if it exists.
-*   `kSbFileWrite`
-*   `kSbFileAsync`
-
-### SbFileWhence ###
-
-This explicit mapping matches both FILE_ on Windows and SEEK_ on Linux.
-
-#### Values ####
-
-*   `kSbFileFromBegin`
-*   `kSbFileFromCurrent`
-*   `kSbFileFromEnd`
-
-## Typedefs ##
-
-### SbFile ###
-
-A handle to an open file.
-
-#### Definition ####
-
-```
-typedef SbFilePrivate* SbFile
-```
-
-## Structs ##
-
-### SbFileInfo ###
-
-Used to hold information about a file.
-
-#### Members ####
-
-*   `int64_t size`
-
-    The size of the file in bytes. Undefined when is_directory is true.
-*   `bool is_directory`
-
-    Whether the file corresponds to a directory.
-*   `bool is_symbolic_link`
-
-    Whether the file corresponds to a symbolic link.
-*   `SbTime last_modified`
-
-    The last modified time of a file.
-*   `SbTime last_accessed`
-
-    The last accessed time of a file.
-*   `SbTime creation_time`
-
-    The creation time of a file.
-
-## Functions ##
-
-### SbFileCanOpen ###
-
-Indicates whether SbFileOpen() with the given `flags` is allowed for `path`.
-
-`path`: The absolute path to be checked. `flags`: The flags that are being
-evaluated for the given `path`.
-
-#### Declaration ####
-
-```
-bool SbFileCanOpen(const char *path, int flags)
-```
-
-### SbFileClose ###
-
-Closes `file`. The return value indicates whether the file was closed
-successfully.
-
-`file`: The absolute path of the file to be closed.
-
-#### Declaration ####
-
-```
-bool SbFileClose(SbFile file)
-```
-
-### SbFileDelete ###
-
-Deletes the regular file, symlink, or empty directory at `path`. This function
-is used primarily to clean up after unit tests. On some platforms, this function
-fails if the file in question is being held open.
-
-`path`: The absolute path fo the file, symlink, or directory to be deleted.
-
-#### Declaration ####
-
-```
-bool SbFileDelete(const char *path)
-```
-
-### SbFileExists ###
-
-Indicates whether a file or directory exists at `path`.
-
-`path`: The absolute path of the file or directory being checked.
-
-#### Declaration ####
-
-```
-bool SbFileExists(const char *path)
-```
-
-### SbFileFlush ###
-
-Flushes the write buffer to `file`. Data written via SbFileWrite is not
-necessarily committed until the SbFile is flushed or closed.
-
-`file`: The SbFile to which the write buffer is flushed.
-
-#### Declaration ####
-
-```
-bool SbFileFlush(SbFile file)
-```
-
-### SbFileGetInfo ###
-
-Retrieves information about `file`. The return value indicates whether the file
-information was retrieved successfully.
-
-`file`: The SbFile for which information is retrieved. `out_info`: The variable
-into which the retrieved data is placed. This variable is not touched if the
-operation is not successful.
-
-#### Declaration ####
-
-```
-bool SbFileGetInfo(SbFile file, SbFileInfo *out_info)
-```
-
-### SbFileGetPathInfo ###
-
-Retrieves information about the file at `path`. The return value indicates
-whether the file information was retrieved successfully.
-
-`file`: The absolute path of the file for which information is retrieved.
-`out_info`: The variable into which the retrieved data is placed. This variable
-is not touched if the operation is not successful.
-
-#### Declaration ####
-
-```
-bool SbFileGetPathInfo(const char *path, SbFileInfo *out_info)
-```
-
-### SbFileIsValid ###
-
-Returns whether the given file handle is valid.
-
-#### Declaration ####
-
-```
-static bool SbFileIsValid(SbFile file)
-```
-
-### SbFileModeStringToFlags ###
-
-Converts an ISO `fopen()` mode string into flags that can be equivalently passed
-into SbFileOpen().
-
-`mode`: The mode string to be converted into flags.
-
-#### Declaration ####
-
-```
-int SbFileModeStringToFlags(const char *mode)
-```
-
-### SbFileOpen ###
-
-Opens the file at `path`, which must be absolute, creating it if specified by
-`flags`. The read/write position is at the beginning of the file.
-
-Note that this function only guarantees the correct behavior when `path` points
-to a file. The behavior is undefined if `path` points to a directory.
-
-`path`: The absolute path of the file to be opened. `flags`: `SbFileFlags` that
-determine how the file is used in the application. Among other things, `flags`
-can indicate whether the application should create `path` if `path` does not
-already exist. `out_created`: Starboard sets this value to `true` if a new file
-is created or if an old file is truncated to zero length to simulate a new file,
-which can happen if the `kSbFileCreateAlways` flag is set. Otherwise, Starboard
-sets this value to `false`. `out_error`: If `path` cannot be created, this is
-set to `kSbFileInvalid`. Otherwise, it is `NULL`.
-
-#### Declaration ####
-
-```
-SbFile SbFileOpen(const char *path, int flags, bool *out_created, SbFileError *out_error)
-```
-
-### SbFileRead ###
-
-Reads `size` bytes (or until EOF is reached) from `file` into `data`, starting
-at the file's current position.
-
-The return value specifies the number of bytes read or `-1` if there was an
-error. Note that this function does NOT make a best effort to read all data on
-all platforms; rather, it just reads however many bytes are quickly available.
-However, this function can be run in a loop to make it a best-effort read.
-
-`file`: The SbFile from which to read data. `data`: The variable to which data
-is read. `size`: The amount of data (in bytes) to read.
-
-#### Declaration ####
-
-```
-int SbFileRead(SbFile file, char *data, int size)
-```
-
-### SbFileReadAll ###
-
-Reads `size` bytes (or until EOF is reached) from `file` into `data`, starting
-at the file's current position.
-
-The return value specifies the number of bytes read or `-1` if there was an
-error. Note that, unlike `SbFileRead`, this function does make a best effort to
-read all data on all platforms. As such, it is not intended for stream-oriented
-files but instead for cases when the normal expectation is that `size` bytes can
-be read unless there is an error.
-
-`file`: The SbFile from which to read data. `data`: The variable to which data
-is read. `size`: The amount of data (in bytes) to read.
-
-#### Declaration ####
-
-```
-static int SbFileReadAll(SbFile file, char *data, int size)
-```
-
-### SbFileSeek ###
-
-Changes the current read/write position in `file`. The return value identifies
-the resultant current read/write position in the file (relative to the start) or
-`-1` in case of an error. This function might not support seeking past the end
-of the file on some platforms.
-
-`file`: The SbFile in which the read/write position will be changed. `whence`:
-The starting read/write position. The position is modified relative to this
-value. `offset`: The amount that the read/write position is changed, relative to
-`whence`.
-
-#### Declaration ####
-
-```
-int64_t SbFileSeek(SbFile file, SbFileWhence whence, int64_t offset)
-```
-
-### SbFileTruncate ###
-
-Truncates the given `file` to the given `length`. The return value indicates
-whether the file was truncated successfully.
-
-`file`: The file to be truncated. `length`: The expected length of the file
-after it is truncated. If `length` is greater than the current size of the file,
-then the file is extended with zeros. If `length` is negative, then the function
-is a no-op and returns `false`.
-
-#### Declaration ####
-
-```
-bool SbFileTruncate(SbFile file, int64_t length)
-```
-
-### SbFileWrite ###
-
-Writes the given buffer into `file` at the file's current position, overwriting
-any data that was previously there.
-
-The return value identifies the number of bytes written, or `-1` on error. Note
-that this function does NOT make a best effort to write all data; rather, it
-writes however many bytes can be written quickly. Generally, this means that it
-writes however many bytes as possible without blocking on IO. Run this function
-in a loop to ensure that all data is written.
-
-`file`: The SbFile to which data will be written. `data`: The data to be
-written. `size`: The amount of data (in bytes) to write.
-
-#### Declaration ####
-
-```
-int SbFileWrite(SbFile file, const char *data, int size)
-```
-
-### SbFileWriteAll ###
-
-Writes the given buffer into `file`, starting at the beginning of the file, and
-overwriting any data that was previously there. Unlike SbFileWrite, this
-function does make a best effort to write all data on all platforms.
-
-The return value identifies the number of bytes written, or `-1` on error.
-
-`file`: The file to which data will be written. `data`: The data to be written.
-`size`: The amount of data (in bytes) to write.
-
-#### Declaration ####
-
-```
-static int SbFileWriteAll(SbFile file, const char *data, int size)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/image.md b/src/cobalt/site/docs/reference/starboard/modules/4/image.md
deleted file mode 100644
index 634dab8..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/image.md
+++ /dev/null
@@ -1,82 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: image.h"
----
-
-API for hardware accelerated image decoding. This module allows for the client
-to feed in raw, encoded data to be decoded directly into an SbDecodeTarget. It
-also provides an interface for the client to query what combinations of encoded
-image formats and SbDecodeTargetFormats are supported or not.
-
-All functions in this module are safe to call from any thread at any point in
-time.
-
-## SbImageIsDecodeSupported and SbImageDecode Example ##
-
-Let's assume that we're on a Blitter platform.
-
-```
-SbDecodeTargetProvider* provider = GetProviderFromSomewhere();
-void* data = GetCompressedJPEGFromSomewhere();
-int data_size = GetCompressedJPEGSizeFromSomewhere();
-const char* mime_type = "image/jpeg";
-SbDecodeTargetFormat format = kSbDecodeTargetFormat1PlaneRGBA;
-
-if (!SbImageIsDecodeSupported(mime_type, format)) {
-  return;
-}
-
-SbDecodeTarget result_target = SbDecodeImage(provider, data, data_size,
-                                             mime_type, format);
-SbBlitterSurface surface =
-    SbDecodeTargetGetPlane(target, kSbDecodeTargetPlaneRGBA);
-// Do stuff with surface...
-```
-
-## Functions ##
-
-### SbImageDecode ###
-
-Attempt to decode encoded `mime_type` image data `data` of size `data_size` into
-an SbDecodeTarget of SbDecodeFormatType `format`, possibly using
-SbDecodeTargetProvider `provider`, if it is non-null. Thus, four following
-scenarios regarding the provider may happen:
-
-1.  The provider is required by the `SbImageDecode` implementation and no
-    provider is given. The implementation should gracefully fail by immediately
-    returning kSbDecodeTargetInvalid.
-
-1.  The provider is required and is passed in. The implementation will proceed
-    forward, using the SbDecodeTarget from the provider.
-
-1.  The provider is not required and is passed in. The provider will NOT be
-    called, and the implementation will proceed to decoding however it desires.
-
-1.  The provider is not required and is not passed in. The implementation will
-    proceed forward.
-
-Thus, it is NOT safe for clients of this API to assume that the `provider` it
-passes in will be called. Finally, if the decode succeeds, a new SbDecodeTarget
-will be allocated. If `mime_type` image decoding for the requested format is not
-supported or the decode fails, kSbDecodeTargetInvalid will be returned, with any
-intermediate allocations being cleaned up in the implementation.
-
-#### Declaration ####
-
-```
-SbDecodeTarget SbImageDecode(SbDecodeTargetGraphicsContextProvider *context_provider, void *data, int data_size, const char *mime_type, SbDecodeTargetFormat format)
-```
-
-### SbImageIsDecodeSupported ###
-
-Whether the current platform supports hardware accelerated decoding an image of
-mime type `mime_type` into SbDecodeTargetFormat `format`. The result of this
-function must not change over the course of the program, which means that the
-results of this function may be cached indefinitely.
-
-#### Declaration ####
-
-```
-bool SbImageIsDecodeSupported(const char *mime_type, SbDecodeTargetFormat format)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/input.md b/src/cobalt/site/docs/reference/starboard/modules/4/input.md
deleted file mode 100644
index cad4690..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/input.md
+++ /dev/null
@@ -1,174 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: input.h"
----
-
-Defines input events and associated data types.
-
-## Enums ##
-
-### SbInputDeviceType ###
-
-Identifies possible input subsystem types. The types of events that each device
-type produces correspond to `SbInputEventType` values.
-
-#### Values ####
-
-*   `kSbInputDeviceTypeGesture`
-
-    Input from a gesture-detection mechanism. Examples include Kinect, Wiimotes,
-    etc...
-
-    Produces `Move`, `Press` and `Unpress` events.
-*   `kSbInputDeviceTypeGamepad`
-
-    Input from a gamepad, following the layout provided in the W3C Web Gamepad
-    API. [ [https://www.w3.org/TR/gamepad/](https://www.w3.org/TR/gamepad/) ]
-
-    Produces `Move`, `Press` and `Unpress` events.
-*   `kSbInputDeviceTypeKeyboard`
-
-    Keyboard input from a traditional keyboard or game controller chatpad.
-
-    Produces `Press` and `Unpress` events.
-*   `kSbInputDeviceTypeMicrophone`
-
-    Input from a microphone that would provide audio data to the caller, who may
-    then find some way to detect speech or other sounds within it. It may have
-    processed or filtered the audio in some way before it arrives.
-
-    Produces `Audio` events.
-*   `kSbInputDeviceTypeMouse`
-
-    Input from a traditional mouse.
-
-    Produces `Move`, `Press`, and `Unpress` events.
-*   `kSbInputDeviceTypeRemote`
-
-    Input from a TV remote-control-style device.
-
-    Produces `Press` and `Unpress` events.
-*   `kSbInputDeviceTypeSpeechCommand`
-
-    Input from a speech command analyzer, which is some hardware or software
-    that, given a set of known phrases, activates when one of the registered
-    phrases is heard.
-
-    Produces `Command` events.
-*   `kSbInputDeviceTypeTouchScreen`
-
-    Input from a single- or multi-touchscreen.
-
-    Produces `Move`, `Press`, and `Unpress` events.
-*   `kSbInputDeviceTypeTouchPad`
-
-    Input from a touchpad that is not masquerading as a mouse.
-
-    Produces `Move`, `Press`, and `Unpress` events.
-*   `kSbInputDeviceTypeOnScreenKeyboard`
-
-    Keyboard input from an on screen keyboard.
-
-    Produces `Input` events.
-
-### SbInputEventType ###
-
-The action that an input event represents.
-
-#### Values ####
-
-*   `kSbInputEventTypeAudio`
-
-    Receipt of Audio. Some audio data was received by the input microphone.
-*   `kSbInputEventTypeCommand`
-
-    Receipt of a command. A command was received from some semantic source, like
-    a speech recognizer.
-*   `kSbInputEventTypeGrab`
-
-    Grab activation. This event type is deprecated.
-*   `kSbInputEventTypeMove`
-
-    Device Movement. In the case of `Mouse`, and perhaps `Gesture`, the movement
-    tracks an absolute cursor position. In the case of `TouchPad`, only relative
-    movements are provided.
-*   `kSbInputEventTypePress`
-
-    Key or button press activation. This could be a key on a keyboard, a button
-    on a mouse or game controller, a push from a touch screen, or a gesture. An
-    `Unpress` event is subsequently delivered when the `Press` event terminates,
-    such as when the key/button/finger is raised. Injecting repeat presses is up
-    to the client.
-*   `kSbInputEventTypeUngrab`
-
-    Grab deactivation. This event type is deprecated.
-*   `kSbInputEventTypeUnpress`
-
-    Key or button deactivation. The counterpart to the `Press` event, this event
-    is sent when the key or button being pressed is released.
-*   `kSbInputEventTypeInput`
-
-    [https://w3c.github.io/uievents/#event-type-input](https://w3c.github.io/uievents/#event-type-input)
-
-## Structs ##
-
-### SbInputData ###
-
-Event data for `kSbEventTypeInput` events.
-
-#### Members ####
-
-*   `SbWindow window`
-
-    The window in which the input was generated.
-*   `SbInputEventType type`
-
-    The type of input event that this represents.
-*   `SbInputDeviceType device_type`
-
-    The type of device that generated this input event.
-*   `int device_id`
-
-    An identifier that is unique among all connected devices.
-*   `SbKey key`
-
-    An identifier that indicates which keyboard key or mouse button was involved
-    in this event, if any. All known keys for all devices are mapped to a single
-    ID space, defined by the `SbKey` enum in `key.h`.
-*   `wchar_t character`
-
-    The character that corresponds to the key. For an external keyboard, this
-    character also depends on the keyboard language. The value is `0` if there
-    is no corresponding character.
-*   `SbKeyLocation key_location`
-
-    The location of the specified key, in cases where there are multiple
-    instances of the button on the keyboard. For example, some keyboards have
-    more than one "shift" key.
-*   `unsigned int key_modifiers`
-
-    Key modifiers (e.g. `Ctrl`, `Shift`) held down during this input event.
-*   `SbInputVector position`
-
-    The (x, y) coordinates of the persistent cursor controlled by this device.
-    The value is `0` if this data is not applicable. For events with type
-    kSbInputEventTypeMove and device_type kSbInputDeviceTypeGamepad, this field
-    is interpreted as a stick position with the range [-1, 1], with positive
-    values for the down and right direction.
-*   `SbInputVector delta`
-
-    The relative motion vector of this input. The value is `0` if this data is
-    not applicable.
-*   `const char * input_text`
-
-    The text to input for events of type `Input`.
-
-### SbInputVector ###
-
-A 2-dimensional vector used to represent points and motion vectors.
-
-#### Members ####
-
-*   `float x`
-*   `float y`
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/key.md b/src/cobalt/site/docs/reference/starboard/modules/4/key.md
deleted file mode 100644
index 6e25962..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/key.md
+++ /dev/null
@@ -1,260 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: key.h"
----
-
-Defines the canonical set of Starboard key codes.
-
-## Enums ##
-
-### SbKey ###
-
-A standard set of key codes, ordered by value, that represent each possible
-input key across all kinds of devices. Starboard uses the semi-standard Windows
-virtual key codes documented at: [https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731%28v=vs.85%29.aspx](https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731%28v=vs.85%29.aspx)
-
-#### Values ####
-
-*   `kSbKeyUnknown`
-*   `kSbKeyCancel`
-*   `kSbKeyBackspace`
-*   `kSbKeyBack`
-*   `kSbKeyTab`
-
-    semantic "back".
-*   `kSbKeyBacktab`
-*   `kSbKeyClear`
-*   `kSbKeyReturn`
-*   `kSbKeyShift`
-*   `kSbKeyControl`
-*   `kSbKeyMenu`
-*   `kSbKeyPause`
-*   `kSbKeyCapital`
-*   `kSbKeyKana`
-*   `kSbKeyHangul`
-*   `kSbKeyJunja`
-*   `kSbKeyFinal`
-*   `kSbKeyHanja`
-*   `kSbKeyKanji`
-*   `kSbKeyEscape`
-*   `kSbKeyConvert`
-*   `kSbKeyNonconvert`
-*   `kSbKeyAccept`
-*   `kSbKeyModechange`
-*   `kSbKeySpace`
-*   `kSbKeyPrior`
-*   `kSbKeyNext`
-*   `kSbKeyEnd`
-*   `kSbKeyHome`
-*   `kSbKeyLeft`
-*   `kSbKeyUp`
-*   `kSbKeyRight`
-*   `kSbKeyDown`
-*   `kSbKeySelect`
-*   `kSbKeyPrint`
-*   `kSbKeyExecute`
-*   `kSbKeySnapshot`
-*   `kSbKeyInsert`
-*   `kSbKeyDelete`
-*   `kSbKeyHelp`
-*   `kSbKey0`
-*   `kSbKey1`
-*   `kSbKey2`
-*   `kSbKey3`
-*   `kSbKey4`
-*   `kSbKey5`
-*   `kSbKey6`
-*   `kSbKey7`
-*   `kSbKey8`
-*   `kSbKey9`
-*   `kSbKeyA`
-*   `kSbKeyB`
-*   `kSbKeyC`
-*   `kSbKeyD`
-*   `kSbKeyE`
-*   `kSbKeyF`
-*   `kSbKeyG`
-*   `kSbKeyH`
-*   `kSbKeyI`
-*   `kSbKeyJ`
-*   `kSbKeyK`
-*   `kSbKeyL`
-*   `kSbKeyM`
-*   `kSbKeyN`
-*   `kSbKeyO`
-*   `kSbKeyP`
-*   `kSbKeyQ`
-*   `kSbKeyR`
-*   `kSbKeyS`
-*   `kSbKeyT`
-*   `kSbKeyU`
-*   `kSbKeyV`
-*   `kSbKeyW`
-*   `kSbKeyX`
-*   `kSbKeyY`
-*   `kSbKeyZ`
-*   `kSbKeyLwin`
-*   `kSbKeyCommand`
-*   `kSbKeyRwin`
-*   `kSbKeyApps`
-*   `kSbKeySleep`
-*   `kSbKeyNumpad0`
-*   `kSbKeyNumpad1`
-*   `kSbKeyNumpad2`
-*   `kSbKeyNumpad3`
-*   `kSbKeyNumpad4`
-*   `kSbKeyNumpad5`
-*   `kSbKeyNumpad6`
-*   `kSbKeyNumpad7`
-*   `kSbKeyNumpad8`
-*   `kSbKeyNumpad9`
-*   `kSbKeyMultiply`
-*   `kSbKeyAdd`
-*   `kSbKeySeparator`
-*   `kSbKeySubtract`
-*   `kSbKeyDecimal`
-*   `kSbKeyDivide`
-*   `kSbKeyF1`
-*   `kSbKeyF2`
-*   `kSbKeyF3`
-*   `kSbKeyF4`
-*   `kSbKeyF5`
-*   `kSbKeyF6`
-*   `kSbKeyF7`
-*   `kSbKeyF8`
-*   `kSbKeyF9`
-*   `kSbKeyF10`
-*   `kSbKeyF11`
-*   `kSbKeyF12`
-*   `kSbKeyF13`
-*   `kSbKeyF14`
-*   `kSbKeyF15`
-*   `kSbKeyF16`
-*   `kSbKeyF17`
-*   `kSbKeyF18`
-*   `kSbKeyF19`
-*   `kSbKeyF20`
-*   `kSbKeyF21`
-*   `kSbKeyF22`
-*   `kSbKeyF23`
-*   `kSbKeyF24`
-*   `kSbKeyNumlock`
-*   `kSbKeyScroll`
-*   `kSbKeyWlan`
-*   `kSbKeyPower`
-*   `kSbKeyLshift`
-*   `kSbKeyRshift`
-*   `kSbKeyLcontrol`
-*   `kSbKeyRcontrol`
-*   `kSbKeyLmenu`
-*   `kSbKeyRmenu`
-*   `kSbKeyBrowserBack`
-*   `kSbKeyBrowserForward`
-*   `kSbKeyBrowserRefresh`
-*   `kSbKeyBrowserStop`
-*   `kSbKeyBrowserSearch`
-*   `kSbKeyBrowserFavorites`
-*   `kSbKeyBrowserHome`
-*   `kSbKeyVolumeMute`
-*   `kSbKeyVolumeDown`
-*   `kSbKeyVolumeUp`
-*   `kSbKeyMediaNextTrack`
-*   `kSbKeyMediaPrevTrack`
-*   `kSbKeyMediaStop`
-*   `kSbKeyMediaPlayPause`
-*   `kSbKeyMediaLaunchMail`
-*   `kSbKeyMediaLaunchMediaSelect`
-*   `kSbKeyMediaLaunchApp1`
-*   `kSbKeyMediaLaunchApp2`
-*   `kSbKeyOem1`
-*   `kSbKeyOemPlus`
-*   `kSbKeyOemComma`
-*   `kSbKeyOemMinus`
-*   `kSbKeyOemPeriod`
-*   `kSbKeyOem2`
-*   `kSbKeyOem3`
-*   `kSbKeyBrightnessDown`
-*   `kSbKeyBrightnessUp`
-*   `kSbKeyKbdBrightnessDown`
-*   `kSbKeyOem4`
-*   `kSbKeyOem5`
-*   `kSbKeyOem6`
-*   `kSbKeyOem7`
-*   `kSbKeyOem8`
-*   `kSbKeyOem102`
-*   `kSbKeyKbdBrightnessUp`
-*   `kSbKeyDbeSbcschar`
-*   `kSbKeyDbeDbcschar`
-*   `kSbKeyPlay`
-*   `kSbKeyMediaRewind`
-
-    Other supported CEA 2014 keys.
-*   `kSbKeyMediaFastForward`
-*   `kSbKeyMouse1`
-
-    Mouse buttons, starting with the left mouse button.
-*   `kSbKeyMouse2`
-*   `kSbKeyMouse3`
-*   `kSbKeyMouse4`
-*   `kSbKeyMouse5`
-*   `kSbKeyGamepad1`
-
-    Xbox A, PS O or X (depending on region), Switch A
-*   `kSbKeyGamepad2`
-
-    Xbox B, PS X or O (depending on region), Switch B
-*   `kSbKeyGamepad3`
-
-    Xbox X, PS square, Switch X
-*   `kSbKeyGamepad4`
-
-    Xbox Y, PS triangle, Switch Y
-*   `kSbKeyGamepadLeftBumper`
-
-    Pretty much every gamepad has bumpers at the top front of the controller,
-    and triggers at the bottom front of the controller.
-*   `kSbKeyGamepadRightBumper`
-*   `kSbKeyGamepadLeftTrigger`
-*   `kSbKeyGamepadRightTrigger`
-*   `kSbKeyGamepad5`
-
-    Xbox 360 Back, XB1 minimize, PS and WiiU Select
-*   `kSbKeyGamepad6`
-
-    Xbox 360 Play, XB1 Menu, PS and WiiU Start
-*   `kSbKeyGamepadLeftStick`
-
-    This refers to pressing the left stick like a button.
-*   `kSbKeyGamepadRightStick`
-
-    This refers to pressing the right stick like a button.
-*   `kSbKeyGamepadDPadUp`
-*   `kSbKeyGamepadDPadDown`
-*   `kSbKeyGamepadDPadLeft`
-*   `kSbKeyGamepadDPadRight`
-*   `kSbKeyGamepadSystem`
-
-    The system key in the middle of the gamepad, if it exists.
-*   `kSbKeyGamepadLeftStickUp`
-
-    Codes for thumbstick to virtual dpad conversions.
-*   `kSbKeyGamepadLeftStickDown`
-*   `kSbKeyGamepadLeftStickLeft`
-*   `kSbKeyGamepadLeftStickRight`
-*   `kSbKeyGamepadRightStickUp`
-*   `kSbKeyGamepadRightStickDown`
-*   `kSbKeyGamepadRightStickLeft`
-*   `kSbKeyGamepadRightStickRight`
-
-### SbKeyModifiers ###
-
-Bit-mask of key modifiers.
-
-#### Values ####
-
-*   `kSbKeyModifiersNone`
-*   `kSbKeyModifiersAlt`
-*   `kSbKeyModifiersCtrl`
-*   `kSbKeyModifiersMeta`
-*   `kSbKeyModifiersShift`
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/log.md b/src/cobalt/site/docs/reference/starboard/modules/4/log.md
deleted file mode 100644
index fd98e08..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/log.md
+++ /dev/null
@@ -1,135 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: log.h"
----
-
-Defines debug logging functions.
-
-## Enums ##
-
-### SbLogPriority ###
-
-The priority at which a message should be logged. The platform may be configured
-to filter logs by priority, or render them differently.
-
-#### Values ####
-
-*   `kSbLogPriorityUnknown`
-*   `kSbLogPriorityInfo`
-*   `kSbLogPriorityWarning`
-*   `kSbLogPriorityError`
-*   `kSbLogPriorityFatal`
-
-## Functions ##
-
-### SbLog ###
-
-Writes `message` to the platform's debug output log.
-
-`priority`: The SbLogPriority at which the message should be logged. Note that
-passing `kSbLogPriorityFatal` does not terminate the program. Such a policy must
-be enforced at the application level. In fact, `priority` may be completely
-ignored on many platforms. `message`: The message to be logged. No formatting is
-required to be done on the value, including newline termination. That said,
-platforms can adjust the message to be more suitable for their output method by
-wrapping the text, stripping unprintable characters, etc.
-
-#### Declaration ####
-
-```
-void SbLog(SbLogPriority priority, const char *message)
-```
-
-### SbLogFlush ###
-
-Flushes the log buffer on some platforms.
-
-#### Declaration ####
-
-```
-void SbLogFlush()
-```
-
-### SbLogFormat ###
-
-A log output method that additionally performs a string format on the data being
-logged.
-
-#### Declaration ####
-
-```
-void SbLogFormat(const char *format, va_list args) SB_PRINTF_FORMAT(1
-```
-
-### SbLogFormatF ###
-
-Inline wrapper of SbLogFormat that converts from ellipsis to va_args.
-
-#### Declaration ####
-
-```
-void static void void SbLogFormatF(const char *format,...) SB_PRINTF_FORMAT(1
-```
-
-### SbLogIsTty ###
-
-Indicates whether the log output goes to a TTY or is being redirected.
-
-#### Declaration ####
-
-```
-bool SbLogIsTty()
-```
-
-### SbLogRaw ###
-
-A bare-bones log output method that is async-signal-safe, i.e. safe to call from
-an asynchronous signal handler (e.g. a `SIGSEGV` handler). It should not do any
-additional formatting.
-
-`message`: The message to be logged.
-
-#### Declaration ####
-
-```
-void SbLogRaw(const char *message)
-```
-
-### SbLogRawDumpStack ###
-
-Dumps the stack of the current thread to the log in an async-signal-safe manner,
-i.e. safe to call from an asynchronous signal handler (e.g. a `SIGSEGV`
-handler). Does not include SbLogRawDumpStack itself.
-
-`frames_to_skip`: The number of frames to skip from the top of the stack when
-dumping the current thread to the log. This parameter lets you remove noise from
-helper functions that might end up on top of every stack dump so that the stack
-dump is just the relevant function stack where the problem occurred.
-
-#### Declaration ####
-
-```
-void SbLogRawDumpStack(int frames_to_skip)
-```
-
-### SbLogRawFormat ###
-
-A formatted log output method that is async-signal-safe, i.e. safe to call from
-an asynchronous signal handler (e.g. a `SIGSEGV` handler).
-
-#### Declaration ####
-
-```
-void SbLogRawFormat(const char *format, va_list args) SB_PRINTF_FORMAT(1
-```
-
-### SbLogRawFormatF ###
-
-Inline wrapper of SbLogFormat to convert from ellipsis to va_args.
-
-#### Declaration ####
-
-```
-void static void void SbLogRawFormatF(const char *format,...) SB_PRINTF_FORMAT(1
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/media.md b/src/cobalt/site/docs/reference/starboard/modules/4/media.md
deleted file mode 100644
index 24fe747..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/media.md
+++ /dev/null
@@ -1,499 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: media.h"
----
-
-Provides media definitions that are common between the Decoder and Player
-interfaces.
-
-## Macros ##
-
-### kSbMediaTimeSecond ###
-
-TODO: remove entirely. One second in SbMediaTime (90KHz ticks).
-
-## Enums ##
-
-### SbMediaAudioCodec ###
-
-Types of audio elementary streams that can be supported.
-
-#### Values ####
-
-*   `kSbMediaAudioCodecNone`
-*   `kSbMediaAudioCodecAac`
-*   `kSbMediaAudioCodecAc3`
-*   `kSbMediaAudioCodecOpus`
-*   `kSbMediaAudioCodecVorbis`
-
-### SbMediaAudioCodingType ###
-
-Possible audio coding types.
-
-#### Values ####
-
-*   `kSbMediaAudioCodingTypeNone`
-*   `kSbMediaAudioCodingTypeAac`
-*   `kSbMediaAudioCodingTypeAc3`
-*   `kSbMediaAudioCodingTypeAtrac`
-*   `kSbMediaAudioCodingTypeBitstream`
-*   `kSbMediaAudioCodingTypeDolbyDigitalPlus`
-*   `kSbMediaAudioCodingTypeDts`
-*   `kSbMediaAudioCodingTypeMpeg1`
-*   `kSbMediaAudioCodingTypeMpeg2`
-*   `kSbMediaAudioCodingTypeMpeg3`
-*   `kSbMediaAudioCodingTypePcm`
-
-### SbMediaAudioConnector ###
-
-Possible audio connector types.
-
-#### Values ####
-
-*   `kSbMediaAudioConnectorNone`
-*   `kSbMediaAudioConnectorAnalog`
-*   `kSbMediaAudioConnectorBluetooth`
-*   `kSbMediaAudioConnectorHdmi`
-*   `kSbMediaAudioConnectorNetwork`
-*   `kSbMediaAudioConnectorSpdif`
-*   `kSbMediaAudioConnectorUsb`
-
-### SbMediaAudioFrameStorageType ###
-
-Possible audio frame storage types.
-
-#### Values ####
-
-*   `kSbMediaAudioFrameStorageTypeInterleaved`
-
-    The samples of a multi-channel audio stream are stored in one continuous
-    buffer. Samples at the same timestamp are stored one after another. For
-    example, for a stereo stream with channels L and R that contains samples
-    with timestamps 0, 1, 2, etc., the samples are stored in one buffer as "L0
-    R0 L1 R1 L2 R2 ...".
-*   `kSbMediaAudioFrameStorageTypePlanar`
-
-    The samples of each channel are stored in their own continuous buffer. For
-    example, for a stereo stream with channels L and R that contains samples
-    with timestamps 0, 1, 2, etc., the samples are stored in two buffers "L0 L1
-    L2 ..." and "R0 R1 R2 ...".
-
-### SbMediaAudioSampleType ###
-
-Possible audio sample types.
-
-#### Values ####
-
-*   `kSbMediaAudioSampleTypeInt16Deprecated`
-*   `kSbMediaAudioSampleTypeFloat32`
-
-### SbMediaRangeId ###
-
-This corresponds to the WebM Range enum which is part of WebM color data (see [http://www.webmproject.org/docs/container/#Range](http://www.webmproject.org/docs/container/#Range)
-). H.264 only uses a bool, which corresponds to the LIMITED/FULL values. Chrome-
-specific values start at 1000.
-
-#### Values ####
-
-*   `kSbMediaRangeIdUnspecified`
-
-    Range is not explicitly specified / unknown.
-*   `kSbMediaRangeIdLimited`
-
-    Limited Rec. 709 color range with RGB values ranging from 16 to 235.
-*   `kSbMediaRangeIdFull`
-
-    Full RGB color range with RGB valees from 0 to 255.
-*   `kSbMediaRangeIdDerived`
-
-    Range is defined by TransferId/MatrixId.
-*   `kSbMediaRangeIdLast`
-
-### SbMediaSupportType ###
-
-Indicates how confident the device is that it can play media resources of the
-given type. The values are a direct map of the canPlayType() method specified at
-the following link: [https://www.w3.org/TR/2011/WD-html5-20110113/video.html#dom-navigator-canplaytype](https://www.w3.org/TR/2011/WD-html5-20110113/video.html#dom-navigator-canplaytype)
-
-#### Values ####
-
-*   `kSbMediaSupportTypeNotSupported`
-
-    The media type cannot be played.
-*   `kSbMediaSupportTypeMaybe`
-
-    Cannot determinate if the media type is playable without playing it.
-*   `kSbMediaSupportTypeProbably`
-
-    The media type seems to be playable.
-
-### SbMediaType ###
-
-Types of media component streams.
-
-#### Values ####
-
-*   `kSbMediaTypeAudio`
-
-    Value used for audio streams.
-*   `kSbMediaTypeVideo`
-
-    Value used for video streams.
-
-### SbMediaVideoCodec ###
-
-Types of video elementary streams that could be supported.
-
-#### Values ####
-
-*   `kSbMediaVideoCodecNone`
-*   `kSbMediaVideoCodecH264`
-*   `kSbMediaVideoCodecH265`
-*   `kSbMediaVideoCodecMpeg2`
-*   `kSbMediaVideoCodecTheora`
-*   `kSbMediaVideoCodecVc1`
-*   `kSbMediaVideoCodecAv1`
-*   `kSbMediaVideoCodecVp8`
-*   `kSbMediaVideoCodecVp9`
-
-## Typedefs ##
-
-### SbMediaTime ###
-
-Time represented in 90KHz ticks.
-
-#### Definition ####
-
-```
-typedef int64_t SbMediaTime
-```
-
-## Structs ##
-
-### SbMediaAudioConfiguration ###
-
-A structure describing the audio configuration parameters of a single audio
-output.
-
-#### Members ####
-
-*   `int index`
-
-    The platform-defined index of the associated audio output.
-*   `SbMediaAudioConnector connector`
-
-    The type of audio connector. Will be the empty `kSbMediaAudioConnectorNone`
-    if this device cannot provide this information.
-*   `SbTime latency`
-
-    The expected latency of audio over this output, in microseconds, or `0` if
-    this device cannot provide this information.
-*   `SbMediaAudioCodingType coding_type`
-
-    The type of audio coding used over this connection.
-*   `int number_of_channels`
-
-    The number of audio channels currently supported by this device output, or
-    `0` if this device cannot provide this information, in which case the caller
-    can probably assume stereo output.
-
-### SbMediaAudioHeader ###
-
-An audio sequence header, which is a description of a given audio stream. This,
-in hexadecimal string form, acts as a set of instructions to the audio decoder.
-
-The Sequence Header consists of a little-endian hexadecimal encoded
-`WAVEFORMATEX` structure followed by an Audio-specific configuration field. The
-`WAVEFORMATEX` structure is specified at: [http://msdn.microsoft.com/en-us/library/dd390970(v=vs.85).aspx](http://msdn.microsoft.com/en-us/library/dd390970(v=vs.85).aspx)
-
-#### Members ####
-
-*   `uint16_t format_tag`
-
-    The waveform-audio format type code.
-*   `uint16_t number_of_channels`
-
-    The number of audio channels in this format. `1` for mono, `2` for stereo.
-*   `uint32_t samples_per_second`
-
-    The sampling rate.
-*   `uint32_t average_bytes_per_second`
-
-    The number of bytes per second expected with this format.
-*   `uint16_t block_alignment`
-
-    Byte block alignment, e.g, 4.
-*   `uint16_t bits_per_sample`
-
-    The bit depth for the stream this represents, e.g. `8` or `16`.
-*   `uint16_t audio_specific_config_size`
-
-    The size, in bytes, of the audio_specific_config.
-*   `int8_t audio_specific_config`
-
-    The AudioSpecificConfig, as specified in ISO/IEC-14496-3, section 1.6.2.1: [http://read.pudn.com/downloads98/doc/comm/401153/14496/ISO_IEC_14496-3%20Part%203%20Audio/C036083E_SUB1.PDF](http://read.pudn.com/downloads98/doc/comm/401153/14496/ISO_IEC_14496-3%20Part%203%20Audio/C036083E_SUB1.PDF)
-
-### SbMediaColorMetadata ###
-
-HDR (High Dynamic Range) Metadata common for HDR10 and WebM/VP9-based HDR
-formats, together with the ColorSpace. HDR reproduces a greater dynamic range of
-luminosity than is possible with standard digital imaging. See the Consumer
-Electronics Association press release: [https://www.cta.tech/News/Press-Releases/2015/August/CEA-Defines-%E2%80%98HDR-Compatible%E2%80%99-Displays.aspx](https://www.cta.tech/News/Press-Releases/2015/August/CEA-Defines-%E2%80%98HDR-Compatible%E2%80%99-Displays.aspx)
-
-#### Members ####
-
-*   `unsigned int bits_per_channel`
-
-    Number of decoded bits per channel. A value of 0 indicates that the
-    BitsPerChannel is unspecified.
-*   `unsigned int chroma_subsampling_horizontal`
-
-    The amount of pixels to remove in the Cr and Cb channels for every pixel not
-    removed horizontally. Example: For video with 4:2:0 chroma subsampling, the
-    `chroma_subsampling_horizontal` should be set to 1.
-*   `unsigned int chroma_subsampling_vertical`
-
-    The amount of pixels to remove in the Cr and Cb channels for every pixel not
-    removed vertically. Example: For video with 4:2:0 chroma subsampling, the
-    `chroma_subsampling_vertical` should be set to 1.
-*   `unsigned int cb_subsampling_horizontal`
-
-    The amount of pixels to remove in the Cb channel for every pixel not removed
-    horizontally. This is additive with ChromaSubsamplingHorz. Example: For
-    video with 4:2:1 chroma subsampling, the `chroma_subsampling_horizontal`
-    should be set to 1 and `cb_subsampling_horizontal` should be set to 1.
-*   `unsigned int cb_subsampling_vertical`
-
-    The amount of pixels to remove in the Cb channel for every pixel not removed
-    vertically. This is additive with `chroma_subsampling_vertical`.
-*   `unsigned int chroma_siting_horizontal`
-
-    How chroma is subsampled horizontally. (0: Unspecified, 1: Left Collocated,
-    2: Half)
-*   `unsigned int chroma_siting_vertical`
-
-    How chroma is subsampled vertically. (0: Unspecified, 1: Top Collocated, 2:
-    Half)
-*   `SbMediaMasteringMetadata mastering_metadata`
-
-    [HDR Metadata field] SMPTE 2086 mastering data.
-*   `unsigned int max_cll`
-
-    [HDR Metadata field] Maximum brightness of a single pixel (Maximum Content
-    Light Level) in candelas per square meter (cd/m^2).
-*   `unsigned int max_fall`
-
-    [HDR Metadata field] Maximum brightness of a single full frame (Maximum
-    Frame-Average Light Level) in candelas per square meter (cd/m^2).
-*   `SbMediaPrimaryId primaries`
-
-    [Color Space field] The colour primaries of the video. For clarity, the
-    value and meanings for Primaries are adopted from Table 2 of ISO/IEC
-    23001-8:2013/DCOR1. (0: Reserved, 1: ITU-R BT.709, 2: Unspecified, 3:
-    Reserved, 4: ITU-R BT.470M, 5: ITU-R BT.470BG, 6: SMPTE 170M, 7: SMPTE 240M,
-    8: FILM, 9: ITU-R BT.2020, 10: SMPTE ST 428-1, 22: JEDEC P22 phosphors)
-*   `SbMediaTransferId transfer`
-
-    [Color Space field] The transfer characteristics of the video. For clarity,
-    the value and meanings for TransferCharacteristics 1-15 are adopted from
-    Table 3 of ISO/IEC 23001-8:2013/DCOR1. TransferCharacteristics 16-18 are
-    proposed values. (0: Reserved, 1: ITU-R BT.709, 2: Unspecified, 3: Reserved,
-    4: Gamma 2.2 curve, 5: Gamma 2.8 curve, 6: SMPTE 170M, 7: SMPTE 240M, 8:
-    Linear, 9: Log, 10: Log Sqrt, 11: IEC 61966-2-4, 12: ITU-R BT.1361 Extended
-    Colour Gamut, 13: IEC 61966-2-1, 14: ITU-R BT.2020 10 bit, 15: ITU-R BT.2020
-    12 bit, 16: SMPTE ST 2084, 17: SMPTE ST 428-1 18: ARIB STD-B67 (HLG))
-*   `SbMediaMatrixId matrix`
-
-    [Color Space field] The Matrix Coefficients of the video used to derive luma
-    and chroma values from red, green, and blue color primaries. For clarity,
-    the value and meanings for MatrixCoefficients are adopted from Table 4 of
-    ISO/IEC 23001-8:2013/DCOR1. (0:GBR, 1: BT709, 2: Unspecified, 3: Reserved,
-    4: FCC, 5: BT470BG, 6: SMPTE 170M, 7: SMPTE 240M, 8: YCOCG, 9: BT2020 Non-
-    constant Luminance, 10: BT2020 Constant Luminance)
-*   `SbMediaRangeId range`
-
-    [Color Space field] Clipping of the color ranges. (0: Unspecified, 1:
-    Broadcast Range, 2: Full range (no clipping), 3: Defined by
-    MatrixCoefficients/TransferCharacteristics)
-*   `float custom_primary_matrix`
-
-    [Color Space field] Only used if primaries == kSbMediaPrimaryIdCustom. This
-    a row-major ordered 3 x 4 submatrix of the 4 x 4 transform matrix. The 4th
-    row is completed as (0, 0, 0, 1).
-
-### SbMediaMasteringMetadata ###
-
-SMPTE 2086 mastering data [http://ieeexplore.ieee.org/document/7291707/](http://ieeexplore.ieee.org/document/7291707/)
-This standard specifies the metadata items to specify the color volume (the
-color primaries, white point, and luminance range) of the display that was used
-in mastering video content. The metadata is specified as a set of values
-independent of any specific digital representation. Also see the WebM container
-guidelines: [https://www.webmproject.org/docs/container/](https://www.webmproject.org/docs/container/)
-
-#### Members ####
-
-*   `float primary_r_chromaticity_x`
-
-    Red X chromaticity coordinate as defined by CIE 1931. In range [0, 1].
-*   `float primary_r_chromaticity_y`
-
-    Red Y chromaticity coordinate as defined by CIE 1931. In range [0, 1].
-*   `float primary_g_chromaticity_x`
-
-    Green X chromaticity coordinate as defined by CIE 1931. In range [0, 1].
-*   `float primary_g_chromaticity_y`
-
-    Green Y chromaticity coordinate as defined by CIE 1931. In range [0, 1].
-*   `float primary_b_chromaticity_x`
-
-    Blue X chromaticity coordinate as defined by CIE 1931. In range [0, 1].
-*   `float primary_b_chromaticity_y`
-
-    Blue Y chromaticity coordinate as defined by CIE 1931. In range [0, 1].
-*   `float white_point_chromaticity_x`
-
-    White X chromaticity coordinate as defined by CIE 1931. In range [0, 1].
-*   `float white_point_chromaticity_y`
-
-    White Y chromaticity coordinate as defined by CIE 1931. In range [0, 1].
-*   `float luminance_max`
-
-    Maximum luminance. Shall be represented in candelas per square meter
-    (cd/m^2). In range [0, 9999.99].
-*   `float luminance_min`
-
-    Minimum luminance. Shall be represented in candelas per square meter
-    (cd/m^2). In range [0, 9999.99].
-
-### SbMediaVideoSampleInfo ###
-
-The set of information required by the decoder or player for each video sample.
-
-#### Members ####
-
-*   `bool is_key_frame`
-
-    Indicates whether the associated sample is a key frame (I-frame). Video key
-    frames must always start with SPS and PPS NAL units.
-*   `int frame_width`
-
-    The frame width of this sample, in pixels. Also could be parsed from the
-    Sequence Parameter Set (SPS) NAL Unit. Frame dimensions must only change on
-    key frames, but may change on any key frame.
-*   `int frame_height`
-
-    The frame height of this sample, in pixels. Also could be parsed from the
-    Sequence Parameter Set (SPS) NAL Unit. Frame dimensions must only change on
-    key frames, but may change on any key frame.
-*   `SbMediaColorMetadata* color_metadata`
-
-    HDR metadata common for HDR10 and WebM/VP9-based HDR formats as well as the
-    Color Space, and Color elements: MatrixCoefficients, BitsPerChannel,
-    ChromaSubsamplingHorz, ChromaSubsamplingVert, CbSubsamplingHorz,
-    CbSubsamplingVert, ChromaSitingHorz, ChromaSitingVert, Range,
-    TransferCharacteristics, and Primaries described here: [https://matroska.org/technical/specs/index.html](https://matroska.org/technical/specs/index.html)
-    . This will only be specified on frames where the HDR metadata and color /
-    color space might have changed (e.g. keyframes).
-
-## Functions ##
-
-### SbMediaCanPlayMimeAndKeySystem ###
-
-Returns information about whether the playback of the specific media described
-by `mime` and encrypted using `key_system` can be played.
-
-Note that neither `mime` nor `key_system` can be NULL. This function returns
-`kSbMediaSupportNotSupported` if either is NULL.
-
-`mime`: The mime information of the media in the form of `video/webm` or
-`video/mp4; codecs="avc1.42001E"`. It may include arbitrary parameters like
-"codecs", "channels", etc. Note that the "codecs" parameter may contain more
-than one codec, delimited by comma. `key_system`: A lowercase value in fhe form
-of "com.example.somesystem" as suggested by [https://w3c.github.io/encrypted-media/#key-system](https://w3c.github.io/encrypted-media/#key-system)) that can
-be matched exactly with known DRM key systems of the platform. When `key_system`
-is an empty string, the return value is an indication for non-encrypted media.
-
-#### Declaration ####
-
-```
-SbMediaSupportType SbMediaCanPlayMimeAndKeySystem(const char *mime, const char *key_system)
-```
-
-### SbMediaGetAudioConfiguration ###
-
-Retrieves the current physical audio configuration of audio output
-`output_index` on this device and places it in `out_configuration`, which must
-not be NULL.
-
-This function returns `false` if nothing could be determined on this platform or
-if `output_index` does not exist on this device.
-
-`out_configuration`: The variable that holds the audio configuration
-information.
-
-#### Declaration ####
-
-```
-bool SbMediaGetAudioConfiguration(int output_index, SbMediaAudioConfiguration *out_configuration)
-```
-
-### SbMediaGetAudioOutputCount ###
-
-Returns the number of audio outputs currently available on this device. Even if
-the number of outputs or their audio configurations can't be determined, it is
-expected that the platform will at least return a single output that supports at
-least stereo.
-
-#### Declaration ####
-
-```
-int SbMediaGetAudioOutputCount()
-```
-
-### SbMediaIsOutputProtected ###
-
-Indicates whether output copy protection is currently enabled on all capable
-outputs. If `true`, then non-protection-capable outputs are expected to be
-blanked.
-
-#### Declaration ####
-
-```
-bool SbMediaIsOutputProtected()
-```
-
-### SbMediaIsSupported ###
-
-Indicates whether this platform supports decoding `video_codec` and
-`audio_codec` along with decrypting using `key_system`. If `video_codec` is
-`kSbMediaVideoCodecNone` or if `audio_codec` is `kSbMediaAudioCodecNone`, this
-function should return `true` as long as `key_system` is supported on the
-platform to decode any supported input formats.
-
-`video_codec`: The `SbMediaVideoCodec` being checked for platform compatibility.
-`audio_codec`: The `SbMediaAudioCodec` being checked for platform compatibility.
-`key_system`: The key system being checked for platform compatibility.
-
-#### Declaration ####
-
-```
-bool SbMediaIsSupported(SbMediaVideoCodec video_codec, SbMediaAudioCodec audio_codec, const char *key_system)
-```
-
-### SbMediaSetOutputProtection ###
-
-Enables or disables output copy protection on all capable outputs. If enabled,
-then non-protection-capable outputs are expected to be blanked.
-
-The return value indicates whether the operation was successful, and the
-function returns a success even if the call is redundant in that it doesn't
-change the current value.
-
-`enabled`: Indicates whether output protection is enabled (`true`) or disabled.
-
-#### Declaration ####
-
-```
-bool SbMediaSetOutputProtection(bool enabled)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/memory.md b/src/cobalt/site/docs/reference/starboard/modules/4/memory.md
deleted file mode 100644
index 142774d..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/memory.md
+++ /dev/null
@@ -1,454 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: memory.h"
----
-
-Defines functions for memory allocation, alignment, copying, and comparing.
-
-## Porters ##
-
-All of the "Unchecked" and "Free" functions must be implemented, but they should
-not be called directly. The Starboard platform wraps them with extra accounting
-under certain circumstances.
-
-## Porters and Application Developers ##
-
-Nobody should call the "Checked", "Unchecked" or "Free" functions directly
-because that evades Starboard's memory tracking. In both port implementations
-and Starboard client application code, you should always call SbMemoryAllocate
-and SbMemoryDeallocate rather than SbMemoryAllocateUnchecked and SbMemoryFree.
-
-*   The "checked" functions are SbMemoryAllocateChecked(),
-    SbMemoryReallocateChecked(), and SbMemoryAllocateAlignedChecked().
-
-*   The "unchecked" functions are SbMemoryAllocateUnchecked(),
-    SbMemoryReallocateUnchecked(), and SbMemoryAllocateAlignedUnchecked().
-
-*   The "free" functions are SbMemoryFree() and SbMemoryFreeAligned().
-
-## Enums ##
-
-### SbMemoryMapFlags ###
-
-The bitwise OR of these flags should be passed to SbMemoryMap to indicate how
-the mapped memory can be used.
-
-#### Values ####
-
-*   `kSbMemoryMapProtectRead`
-
-    No flags set: Reserves virtual address space. SbMemoryProtect() can later
-    make it accessible.
-*   `kSbMemoryMapProtectWrite`
-*   `kSbMemoryMapProtectExec`
-*   `kSbMemoryMapProtectReadWrite`
-
-## Functions ##
-
-### SbMemoryAlignToPageSize ###
-
-Rounds `size` up to SB_MEMORY_PAGE_SIZE.
-
-#### Declaration ####
-
-```
-static size_t SbMemoryAlignToPageSize(size_t size)
-```
-
-### SbMemoryAllocate ###
-
-Allocates and returns a chunk of memory of at least `size` bytes. This function
-should be called from the client codebase. It is intended to be a drop-in
-replacement for `malloc`.
-
-Note that this function returns `NULL` if it is unable to allocate the memory.
-
-`size`: The amount of memory to be allocated. If `size` is 0, the function may
-return `NULL` or it may return a unique pointer value that can be passed to
-SbMemoryDeallocate.
-
-#### Declaration ####
-
-```
-void* SbMemoryAllocate(size_t size)
-```
-
-### SbMemoryAllocateAligned ###
-
-Allocates and returns a chunk of memory of at least `size` bytes, aligned to
-`alignment`. This function should be called from the client codebase. It is
-meant to be a drop-in replacement for `memalign`.
-
-The function returns `NULL` if it cannot allocate the memory. In addition, the
-function's behavior is undefined if `alignment` is not a power of two.
-
-`alignment`: The way that data is arranged and accessed in memory. The value
-must be a power of two. `size`: The size of the memory to be allocated. If
-`size` is `0`, the function may return `NULL` or it may return a unique aligned
-pointer value that can be passed to SbMemoryDeallocateAligned.
-
-#### Declaration ####
-
-```
-void* SbMemoryAllocateAligned(size_t alignment, size_t size)
-```
-
-### SbMemoryAllocateAlignedChecked ###
-
-Same as SbMemoryAllocateAlignedUnchecked, but will abort() in the case of an
-allocation failure.
-
-DO NOT CALL. Call SbMemoryAllocateAligned(...) instead.
-
-#### Declaration ####
-
-```
-void* SbMemoryAllocateAlignedChecked(size_t alignment, size_t size)
-```
-
-### SbMemoryAllocateAlignedUnchecked ###
-
-This is the implementation of SbMemoryAllocateAligned that must be provided by
-Starboard ports.
-
-DO NOT CALL. Call SbMemoryAllocateAligned(...) instead.
-
-#### Declaration ####
-
-```
-void* SbMemoryAllocateAlignedUnchecked(size_t alignment, size_t size)
-```
-
-### SbMemoryAllocateChecked ###
-
-Same as SbMemoryAllocateUnchecked, but will abort() in the case of an allocation
-failure.
-
-DO NOT CALL. Call SbMemoryAllocate(...) instead.
-
-#### Declaration ####
-
-```
-void* SbMemoryAllocateChecked(size_t size)
-```
-
-### SbMemoryAllocateNoReport ###
-
-Same as SbMemoryAllocate() but will not report memory to the tracker. Avoid
-using this unless absolutely necessary.
-
-#### Declaration ####
-
-```
-void* SbMemoryAllocateNoReport(size_t size)
-```
-
-### SbMemoryAllocateUnchecked ###
-
-This is the implementation of SbMemoryAllocate that must be provided by
-Starboard ports.
-
-DO NOT CALL. Call SbMemoryAllocate(...) instead.
-
-#### Declaration ####
-
-```
-void* SbMemoryAllocateUnchecked(size_t size)
-```
-
-### SbMemoryCalloc ###
-
-A wrapper that implements a drop-in replacement for `calloc`, which is used in
-some packages.
-
-#### Declaration ####
-
-```
-static void* SbMemoryCalloc(size_t count, size_t size)
-```
-
-### SbMemoryCompare ###
-
-Compares the contents of the first `count` bytes of `buffer1` and `buffer2`.
-This function returns:
-
-*   `-1` if `buffer1` is "less-than" `buffer2`
-
-*   `0` if `buffer1` and `buffer2` are equal
-
-*   `1` if `buffer1` is "greater-than" `buffer2`.
-
-This function is meant to be a drop-in replacement for `memcmp`.
-
-`buffer1`: The first buffer to be compared. `buffer2`: The second buffer to be
-compared. `count`: The number of bytes to be compared.
-
-#### Declaration ####
-
-```
-int SbMemoryCompare(const void *buffer1, const void *buffer2, size_t count)
-```
-
-### SbMemoryCopy ###
-
-Copies `count` sequential bytes from `source` to `destination`, without support
-for the `source` and `destination` regions overlapping. This function is meant
-to be a drop-in replacement for `memcpy`.
-
-The function's behavior is undefined if `destination` or `source` are NULL, and
-the function is a no-op if `count` is 0. The return value is `destination`.
-
-`destination`: The destination of the copied memory. `source`: The source of the
-copied memory. `count`: The number of sequential bytes to be copied.
-
-#### Declaration ####
-
-```
-void* SbMemoryCopy(void *destination, const void *source, size_t count)
-```
-
-### SbMemoryDeallocate ###
-
-Frees a previously allocated chunk of memory. If `memory` is NULL, then the
-operation is a no-op. This function should be called from the client codebase.
-It is meant to be a drop-in replacement for `free`.
-
-`memory`: The chunk of memory to be freed.
-
-#### Declaration ####
-
-```
-void SbMemoryDeallocate(void *memory)
-```
-
-### SbMemoryDeallocateAligned ###
-
-`memory`: The chunk of memory to be freed. If `memory` is NULL, then the
-function is a no-op.
-
-#### Declaration ####
-
-```
-void SbMemoryDeallocateAligned(void *memory)
-```
-
-### SbMemoryDeallocateNoReport ###
-
-Same as SbMemoryDeallocate() but will not report memory deallocation to the
-tracker. This function must be matched with SbMemoryAllocateNoReport().
-
-#### Declaration ####
-
-```
-void SbMemoryDeallocateNoReport(void *memory)
-```
-
-### SbMemoryFindByte ###
-
-Finds the lower 8-bits of `value` in the first `count` bytes of `buffer` and
-returns either a pointer to the first found occurrence or `NULL` if the value is
-not found. This function is meant to be a drop-in replacement for `memchr`.
-
-#### Declaration ####
-
-```
-const void* SbMemoryFindByte(const void *buffer, int value, size_t count)
-```
-
-### SbMemoryFlush ###
-
-Flushes any data in the given virtual address range that is cached locally in
-the current processor core to physical memory, ensuring that data and
-instruction caches are cleared. This is required to be called on executable
-memory that has been written to and might be executed in the future.
-
-#### Declaration ####
-
-```
-void SbMemoryFlush(void *virtual_address, int64_t size_bytes)
-```
-
-### SbMemoryFree ###
-
-This is the implementation of SbMemoryDeallocate that must be provided by
-Starboard ports.
-
-DO NOT CALL. Call SbMemoryDeallocate(...) instead.
-
-#### Declaration ####
-
-```
-void SbMemoryFree(void *memory)
-```
-
-### SbMemoryFreeAligned ###
-
-This is the implementation of SbMemoryFreeAligned that must be provided by
-Starboard ports.
-
-DO NOT CALL. Call SbMemoryDeallocateAligned(...) instead.
-
-#### Declaration ####
-
-```
-void SbMemoryFreeAligned(void *memory)
-```
-
-### SbMemoryGetStackBounds ###
-
-Gets the stack bounds for the current thread.
-
-`out_high`: The highest addressable byte + 1 for the current thread. `out_low`:
-The lowest addressable byte for the current thread.
-
-#### Declaration ####
-
-```
-void SbMemoryGetStackBounds(void **out_high, void **out_low)
-```
-
-### SbMemoryIsAligned ###
-
-Checks whether `memory` is aligned to `alignment` bytes.
-
-#### Declaration ####
-
-```
-static bool SbMemoryIsAligned(const void *memory, size_t alignment)
-```
-
-### SbMemoryIsZero ###
-
-Returns true if the first `count` bytes of `buffer` are set to zero.
-
-#### Declaration ####
-
-```
-static bool SbMemoryIsZero(const void *buffer, size_t count)
-```
-
-### SbMemoryMap ###
-
-Allocates `size_bytes` worth of physical memory pages and maps them into an
-available virtual region. This function returns `SB_MEMORY_MAP_FAILED` on
-failure. `NULL` is a valid return value.
-
-`size_bytes`: The amount of physical memory pages to be allocated. `flags`: The
-bitwise OR of the protection flags for the mapped memory as specified in
-`SbMemoryMapFlags`. Allocating executable memory is not allowed and will fail.
-If executable memory is needed, map non-executable memory first and then switch
-access to executable using SbMemoryProtect. When kSbMemoryMapProtectReserved is
-used, the address space will not be accessible and, if possible, the platform
-should not count it against any memory budget. `name`: A value that appears in
-the debugger on some platforms. The value can be up to 32 bytes.
-
-#### Declaration ####
-
-```
-void* SbMemoryMap(int64_t size_bytes, int flags, const char *name)
-```
-
-### SbMemoryMove ###
-
-Copies `count` sequential bytes from `source` to `destination`, with support for
-the `source` and `destination` regions overlapping. This function is meant to be
-a drop-in replacement for `memmove`.
-
-The function's behavior is undefined if `destination` or `source` are NULL, and
-the function is a no-op if `count` is 0. The return value is `destination`.
-
-`destination`: The destination of the copied memory. `source`: The source of the
-copied memory. `count`: The number of sequential bytes to be copied.
-
-#### Declaration ####
-
-```
-void* SbMemoryMove(void *destination, const void *source, size_t count)
-```
-
-### SbMemoryReallocate ###
-
-Attempts to resize `memory` to be at least `size` bytes, without touching the
-contents of memory.
-
-*   If the function cannot perform the fast resize, it allocates a new chunk of
-    memory, copies the contents over, and frees the previous chunk, returning a
-    pointer to the new chunk.
-
-*   If the function cannot perform the slow resize, it returns `NULL`, leaving
-    the given memory chunk unchanged.
-
-This function should be called from the client codebase. It is meant to be a
-drop-in replacement for `realloc`.
-
-`memory`: The chunk of memory to be resized. `memory` may be NULL, in which case
-it behaves exactly like SbMemoryAllocateUnchecked. `size`: The size to which
-`memory` will be resized. If `size` is `0`, the function may return `NULL` or it
-may return a unique pointer value that can be passed to SbMemoryDeallocate.
-
-#### Declaration ####
-
-```
-void* SbMemoryReallocate(void *memory, size_t size)
-```
-
-### SbMemoryReallocateChecked ###
-
-Same as SbMemoryReallocateUnchecked, but will abort() in the case of an
-allocation failure.
-
-DO NOT CALL. Call SbMemoryReallocate(...) instead.
-
-#### Declaration ####
-
-```
-void* SbMemoryReallocateChecked(void *memory, size_t size)
-```
-
-### SbMemoryReallocateUnchecked ###
-
-This is the implementation of SbMemoryReallocate that must be provided by
-Starboard ports.
-
-DO NOT CALL. Call SbMemoryReallocate(...) instead.
-
-#### Declaration ####
-
-```
-void* SbMemoryReallocateUnchecked(void *memory, size_t size)
-```
-
-### SbMemorySet ###
-
-Fills `count` sequential bytes starting at `destination`, with the unsigned char
-coercion of `byte_value`. This function is meant to be a drop-in replacement for
-`memset`.
-
-The function's behavior is undefined if `destination` is NULL, and the function
-is a no-op if `count` is 0. The return value is `destination`.
-
-`destination`: The destination of the copied memory. `count`: The number of
-sequential bytes to be set.
-
-#### Declaration ####
-
-```
-void* SbMemorySet(void *destination, int byte_value, size_t count)
-```
-
-### SbMemoryUnmap ###
-
-Unmap `size_bytes` of physical pages starting from `virtual_address`, returning
-`true` on success. After this function completes, [virtual_address,
-virtual_address + size_bytes) will not be read/writable. This function can unmap
-multiple contiguous regions that were mapped with separate calls to
-SbMemoryMap(). For example, if one call to `SbMemoryMap(0x1000)` returns
-`(void*)0xA000`, and another call to `SbMemoryMap(0x1000)` returns
-`(void*)0xB000`, `SbMemoryUnmap(0xA000, 0x2000)` should free both regions.
-
-#### Declaration ####
-
-```
-bool SbMemoryUnmap(void *virtual_address, int64_t size_bytes)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/microphone.md b/src/cobalt/site/docs/reference/starboard/modules/4/microphone.md
deleted file mode 100644
index 0a8a60f..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/microphone.md
+++ /dev/null
@@ -1,258 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: microphone.h"
----
-
-Defines functions for microphone creation, control, audio data fetching, and
-destruction. This module supports multiple calls to `SbMicrophoneOpen` and
-`SbMicrophoneClose`, and the implementation should handle multiple calls to one
-of those functions on the same microphone. For example, your implementation
-should handle cases where `SbMicrophoneOpen` is called twice on the same
-microphone without a call to `SbMicrophoneClose` in between.
-
-This API is not thread-safe and must be called from a single thread.
-
-How to use this API:
-
-1.  Call `SbMicrophoneGetAvailableInfos` to get a list of available microphone
-    information.
-
-1.  Create a supported microphone, using `SbMicrophoneCreate`, with enough
-    buffer size and sample rate. Use `SbMicrophoneIsSampleRateSupported` to
-    verify the sample rate.
-
-1.  Use `SbMicrophoneOpen` to open the microphone port and start recording audio
-    data.
-
-1.  Periodically read out the data from microphone with `SbMicrophoneRead`.
-
-1.  Call `SbMicrophoneClose` to close the microphone port and stop recording
-    audio data.
-
-1.  Destroy the microphone with `SbMicrophoneDestroy`.
-
-## Macros ##
-
-### kSbMicrophoneIdInvalid ###
-
-Well-defined value for an invalid microphone ID handle.
-
-### kSbMicrophoneInvalid ###
-
-Well-defined value for an invalid microphone handle.
-
-## Enums ##
-
-### SbMicrophoneType ###
-
-All possible microphone types.
-
-#### Values ####
-
-*   `kSbMicrophoneCamera`
-
-    Built-in microphone in camera.
-*   `kSbMicrophoneUSBHeadset`
-
-    Microphone in the headset that can be a wired or wireless USB headset.
-*   `kSbMicrophoneVRHeadset`
-
-    Microphone in the VR headset.
-*   `kSBMicrophoneAnalogHeadset`
-
-    Microphone in the analog headset.
-*   `kSbMicrophoneUnknown`
-
-    Unknown microphone type. The microphone could be different than the other
-    enum descriptions or could fall under one of those descriptions.
-
-## Typedefs ##
-
-### SbMicrophone ###
-
-An opaque handle to an implementation-private structure that represents a
-microphone.
-
-#### Definition ####
-
-```
-typedef struct SbMicrophonePrivate* SbMicrophone
-```
-
-### SbMicrophoneId ###
-
-An opaque handle to an implementation-private structure that represents a
-microphone ID.
-
-#### Definition ####
-
-```
-typedef struct SbMicrophoneIdPrivate* SbMicrophoneId
-```
-
-## Structs ##
-
-### SbMicrophoneInfo ###
-
-Microphone information.
-
-#### Members ####
-
-*   `SbMicrophoneId id`
-
-    Microphone id.
-*   `SbMicrophoneType type`
-
-    Microphone type.
-*   `int max_sample_rate_hz`
-
-    The microphone's maximum supported sampling rate.
-*   `int min_read_size`
-
-    The minimum read size required for each read from microphone.
-
-## Functions ##
-
-### SbMicrophoneClose ###
-
-Closes the microphone port, stops recording audio on `microphone`, and clears
-the unread buffer if it is not empty. If the microphone has already been
-stopped, this call is ignored. The return value indicates whether the microphone
-is closed.
-
-`microphone`: The microphone to close.
-
-#### Declaration ####
-
-```
-bool SbMicrophoneClose(SbMicrophone microphone)
-```
-
-### SbMicrophoneCreate ###
-
-Creates a microphone with the specified ID, audio sample rate, and cached audio
-buffer size. Starboard only requires support for creating one microphone at a
-time, and implementations may return an error if a second microphone is created
-before the first is destroyed.
-
-The function returns the newly created SbMicrophone object. However, if you try
-to create a microphone that has already been initialized, if the sample rate is
-unavailable, or if the buffer size is invalid, the function should return
-`kSbMicrophoneInvalid`.
-
-`id`: The ID that will be assigned to the newly created SbMicrophone.
-`sample_rate_in_hz`: The new microphone's audio sample rate in Hz.
-`buffer_size_bytes`: The size of the buffer where signed 16-bit integer audio
-data is temporarily cached to during the capturing. The audio data is removed
-from the audio buffer if it has been read, and new audio data can be read from
-this buffer in smaller chunks than this size. This parameter must be set to a
-value greater than zero and the ideal size is `2^n`.
-
-#### Declaration ####
-
-```
-SbMicrophone SbMicrophoneCreate(SbMicrophoneId id, int sample_rate_in_hz, int buffer_size_bytes)
-```
-
-### SbMicrophoneDestroy ###
-
-Destroys a microphone. If the microphone is in started state, it is first
-stopped and then destroyed. Any data that has been recorded and not read is
-thrown away.
-
-#### Declaration ####
-
-```
-void SbMicrophoneDestroy(SbMicrophone microphone)
-```
-
-### SbMicrophoneGetAvailable ###
-
-Retrieves all currently available microphone information and stores it in
-`out_info_array`. The return value is the number of the available microphones.
-If the number of available microphones is larger than `info_array_size`, then
-`out_info_array` is filled up with as many available microphones as possible and
-the actual number of available microphones is returned. A negative return value
-indicates that an internal error occurred.
-
-`out_info_array`: All currently available information about the microphone is
-placed into this output parameter. `info_array_size`: The size of
-`out_info_array`.
-
-#### Declaration ####
-
-```
-int SbMicrophoneGetAvailable(SbMicrophoneInfo *out_info_array, int info_array_size)
-```
-
-### SbMicrophoneIdIsValid ###
-
-Indicates whether the given microphone ID is valid.
-
-#### Declaration ####
-
-```
-static bool SbMicrophoneIdIsValid(SbMicrophoneId id)
-```
-
-### SbMicrophoneIsSampleRateSupported ###
-
-Indicates whether the microphone supports the sample rate.
-
-#### Declaration ####
-
-```
-bool SbMicrophoneIsSampleRateSupported(SbMicrophoneId id, int sample_rate_in_hz)
-```
-
-### SbMicrophoneIsValid ###
-
-Indicates whether the given microphone is valid.
-
-#### Declaration ####
-
-```
-static bool SbMicrophoneIsValid(SbMicrophone microphone)
-```
-
-### SbMicrophoneOpen ###
-
-Opens the microphone port and starts recording audio on `microphone`.
-
-Once started, the client needs to periodically call `SbMicrophoneRead` to
-receive the audio data. If the microphone has already been started, this call
-clears the unread buffer. The return value indicates whether the microphone is
-open. `microphone`: The microphone that will be opened and will start recording
-audio.
-
-#### Declaration ####
-
-```
-bool SbMicrophoneOpen(SbMicrophone microphone)
-```
-
-### SbMicrophoneRead ###
-
-Retrieves the recorded audio data from the microphone and writes that data to
-`out_audio_data`.
-
-The return value is zero or the positive number of bytes that were read. Neither
-the return value nor `audio_data_size` exceeds the buffer size. A negative
-return value indicates that an error occurred.
-
-This function should be called frequently. Otherwise, the microphone only
-buffers `buffer_size` bytes as configured in `SbMicrophoneCreate` and the new
-audio data is thrown out. No audio data is read from a stopped microphone.
-
-`microphone`: The microphone from which to retrieve recorded audio data.
-`out_audio_data`: The buffer to which the retrieved data will be written.
-`audio_data_size`: The number of requested bytes. If `audio_data_size` is
-smaller than `min_read_size` of `SbMicrophoneInfo`, the extra audio data that
-has already been read from the device is discarded.
-
-#### Declaration ####
-
-```
-int SbMicrophoneRead(SbMicrophone microphone, void *out_audio_data, int audio_data_size)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/player.md b/src/cobalt/site/docs/reference/starboard/modules/4/player.md
deleted file mode 100644
index 525452a..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/player.md
+++ /dev/null
@@ -1,459 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: player.h"
----
-
-Defines an interface for controlling playback of media elementary streams.
-
-## Macros ##
-
-### SB_PLAYER_INITIAL_TICKET ###
-
-The value of the initial ticket held by the player before the first seek. The
-player will use this ticket value to make the first call to SbPlayerStatusFunc
-with kSbPlayerStateInitialized.
-
-### SB_PLAYER_NO_DURATION ###
-
-The value to pass into SbPlayerCreate's `duration_pts` argument for cases where
-the duration is unknown, such as for live streams.
-
-### kSbPlayerInvalid ###
-
-Well-defined value for an invalid player.
-
-## Enums ##
-
-### SbPlayerDecoderState ###
-
-An indicator of whether the decoder can accept more samples.
-
-#### Values ####
-
-*   `kSbPlayerDecoderStateNeedsData`
-
-    The decoder is asking for one more sample.
-*   `kSbPlayerDecoderStateBufferFull`
-
-    The decoder is not ready for any more samples, so do not send them. Note
-    that this enum value has been deprecated and the SbPlayer implementation
-    should no longer use this value.
-*   `kSbPlayerDecoderStateDestroyed`
-
-    The player has been destroyed, and will send no more callbacks.
-
-### SbPlayerState ###
-
-An indicator of the general playback state.
-
-#### Values ####
-
-*   `kSbPlayerStateInitialized`
-
-    The player has just been initialized. It is expecting an SbPlayerSeek() call
-    to enter the prerolling state.
-*   `kSbPlayerStatePrerolling`
-
-    The player is prerolling, collecting enough data to fill the pipeline before
-    presentation starts. After the first preroll is completed, there should
-    always be a video frame to render, even if the player goes back to
-    Prerolling after a Seek.
-*   `kSbPlayerStatePresenting`
-
-    The player is presenting media, and it is either paused or actively playing
-    in real-time. Note that the implementation should use this state to signal
-    that the preroll has been finished.
-*   `kSbPlayerStateEndOfStream`
-
-    The player is presenting media, but it is paused at the end of the stream.
-*   `kSbPlayerStateDestroyed`
-
-    The player has been destroyed, and will send no more callbacks.
-
-## Typedefs ##
-
-### SbPlayer ###
-
-An opaque handle to an implementation-private structure representing a player.
-
-#### Definition ####
-
-```
-typedef struct SbPlayerPrivate* SbPlayer
-```
-
-### SbPlayerDeallocateSampleFunc ###
-
-Callback to free the given sample buffer data. When more than one buffer are
-sent in SbPlayerWriteSample(), the implementation only has to call this callback
-with `sample_buffer` points to the the first buffer.
-
-#### Definition ####
-
-```
-typedef void(* SbPlayerDeallocateSampleFunc) (SbPlayer player, void *context, const void *sample_buffer)
-```
-
-### SbPlayerDecoderStatusFunc ###
-
-Callback for decoder status updates, called in response to a call to
-SbPlayerSeek() or SbPlayerWriteSample(). This callback will never be called
-until at least one call to SbPlayerSeek has occurred. `ticket` will be set to
-the ticket passed into the last received call to SbPlayerSeek() at the time this
-callback was dispatched. This is to distinguish status callbacks for
-interrupting seeks. These callbacks will happen on a different thread than the
-calling thread, and it is not valid to call SbPlayer functions from within this
-callback. After an update with kSbPlayerDecoderStateNeedsData, the user of the
-player will make at most one call to SbPlayerWriteSample() or
-SbPlayerWriteEndOfStream(). The player implementation should update the decoder
-status again after such call to notify its user to continue writing more frames.
-
-#### Definition ####
-
-```
-typedef void(* SbPlayerDecoderStatusFunc) (SbPlayer player, void *context, SbMediaType type, SbPlayerDecoderState state, int ticket)
-```
-
-### SbPlayerEncryptedMediaInitDataEncounteredCB ###
-
-Callback to queue an encrypted event for initialization data encountered in
-media data. `init_data_type` should be a string matching one of the EME
-initialization data types : "cenc", "fairplay", "keyids", or "webm", `init_data`
-is the initialization data, and `init_data_length` is the length of the data.
-
-#### Definition ####
-
-```
-typedef void(* SbPlayerEncryptedMediaInitDataEncounteredCB) (SbPlayer player, void *context, const char *init_data_type, const unsigned char *init_data, unsigned int init_data_length)
-```
-
-### SbPlayerErrorFunc ###
-
-Callback for player errors, that may set a `message`. `error`: indicates the
-error code. `message`: provides specific informative diagnostic message about
-the error condition encountered. It is ok for the message to be an empty string
-or NULL if no information is available.
-
-#### Definition ####
-
-```
-typedef void(* SbPlayerErrorFunc) (SbPlayer player, void *context, SbPlayerError error, const char *message)
-```
-
-### SbPlayerStatusFunc ###
-
-Callback for player status updates. These callbacks will happen on a different
-thread than the calling thread, and it is not valid to call SbPlayer functions
-from within this callback.
-
-#### Definition ####
-
-```
-typedef void(* SbPlayerStatusFunc) (SbPlayer player, void *context, SbPlayerState state, int ticket)
-```
-
-## Structs ##
-
-### SbPlayerInfo ###
-
-Information about the current media playback state.
-
-#### Members ####
-
-*   `SbMediaTime current_media_pts`
-
-    The position of the playback head, as precisely as possible, in 90KHz ticks
-    (PTS).
-*   `SbMediaTime duration_pts`
-
-    The known duration of the currently playing media stream, in 90KHz ticks
-    (PTS).
-*   `SbTime start_date`
-
-    The result of getStartDate for the currently playing media stream, in
-    microseconds since the epoch of January 1, 1601 UTC.
-*   `int frame_width`
-
-    The width of the currently displayed frame, in pixels, or 0 if not provided
-    by this player.
-*   `int frame_height`
-
-    The height of the currently displayed frame, in pixels, or 0 if not provided
-    by this player.
-*   `bool is_paused`
-
-    Whether playback is currently paused.
-*   `double volume`
-
-    The current player volume in [0, 1].
-*   `int total_video_frames`
-
-    The number of video frames sent to the player since the creation of the
-    player.
-*   `int dropped_video_frames`
-
-    The number of video frames decoded but not displayed since the creation of
-    the player.
-*   `int corrupted_video_frames`
-
-    The number of video frames that failed to be decoded since the creation of
-    the player.
-*   `double playback_rate`
-
-    The rate of playback. The video is played back in a speed that is
-    proportional to this. By default it is 1.0 which indicates that the playback
-    is at normal speed. When it is greater than one, the video is played in a
-    faster than normal speed. When it is less than one, the video is played in a
-    slower than normal speed. Negative speeds are not supported.
-*   `SbMediaTime buffer_start_pts`
-
-    The position of the buffer head, as precisely as possible, in 90KHz ticks
-    (PTS).
-*   `SbMediaTime buffer_duration_pts`
-
-    The known duration of the currently playing media buffer, in 90KHz ticks
-    (PTS).
-
-### SbPlayerSampleInfo ###
-
-Information about the samples to be written into SbPlayerWriteSample2.
-
-#### Members ####
-
-*   `const void * buffer`
-
-    Points to the buffer containing the sample data.
-*   `int buffer_size`
-
-    Size of the data pointed to by `buffer`.
-*   `SbTime timestamp`
-
-    The timestamp of the sample in SbTime.
-*   `constSbMediaVideoSampleInfo* video_sample_info`
-
-    Information about a video sample. This value is required for video samples.
-    Otherwise, it must be `NULL`.
-*   `constSbDrmSampleInfo* drm_info`
-
-    The DRM system related info for the media sample. This value is required for
-    encrypted samples. Otherwise, it must be `NULL`.
-
-## Functions ##
-
-### SbPlayerCreateWithUrl ###
-
-Creates a URL-based SbPlayer that will be displayed on `window` for the
-specified URL `url`, acquiring all resources needed to operate it, and returning
-an opaque handle to it. The expectation is that a new player will be created and
-destroyed for every playback.
-
-In many ways this function is similar to SbPlayerCreate, but it is missing the
-input arguments related to the configuration and format of the audio and video
-stream, as well as the DRM system. The DRM system for a player created with
-SbPlayerCreateWithUrl can be set after creation using SbPlayerSetDrmSystem.
-Because the DRM system is not available at the time of SbPlayerCreateWithUrl, it
-takes in a callback, `encrypted_media_init_data_encountered_cb`, which is run
-when encrypted media initial data is encountered.
-
-#### Declaration ####
-
-```
-SbPlayer SbPlayerCreateWithUrl(const char *url, SbWindow window, SbMediaTime duration_pts, SbPlayerStatusFunc player_status_func, SbPlayerEncryptedMediaInitDataEncounteredCB encrypted_media_init_data_encountered_cb, SbPlayerErrorFunc player_error_func, void *context)
-```
-
-### SbPlayerDestroy ###
-
-Destroys `player`, freeing all associated resources. Each callback must receive
-one more callback to say that the player was destroyed. Callbacks may be in-
-flight when SbPlayerDestroy is called, and should be ignored once this function
-is called.
-
-It is not allowed to pass `player` into any other `SbPlayer` function once
-SbPlayerDestroy has been called on that player.
-
-`player`: The player to be destroyed.
-
-#### Declaration ####
-
-```
-void SbPlayerDestroy(SbPlayer player)
-```
-
-### SbPlayerGetCurrentFrame ###
-
-Given a player created with the kSbPlayerOutputModeDecodeToTexture output mode,
-it will return a SbDecodeTarget representing the current frame to be rasterized.
-On GLES systems, this function must be called on a thread with an EGLContext
-current, and specifically the EGLContext that will be used to eventually render
-the frame. If this function is called with a `player` object that was created
-with an output mode other than kSbPlayerOutputModeDecodeToTexture,
-kSbDecodeTargetInvalid is returned.
-
-#### Declaration ####
-
-```
-SbDecodeTarget SbPlayerGetCurrentFrame(SbPlayer player)
-```
-
-### SbPlayerGetInfo ###
-
-Gets a snapshot of the current player state and writes it to `out_player_info`.
-This function may be called very frequently and is expected to be inexpensive.
-
-`player`: The player about which information is being retrieved.
-`out_player_info`: The information retrieved for the player.
-
-#### Declaration ####
-
-```
-void SbPlayerGetInfo(SbPlayer player, SbPlayerInfo *out_player_info)
-```
-
-### SbPlayerIsValid ###
-
-Returns whether the given player handle is valid.
-
-#### Declaration ####
-
-```
-static bool SbPlayerIsValid(SbPlayer player)
-```
-
-### SbPlayerOutputModeSupportedWithUrl ###
-
-Returns true if the given URL player output mode is supported by the platform.
-If this function returns true, it is okay to call SbPlayerCreate() with the
-given `output_mode`.
-
-#### Declaration ####
-
-```
-bool SbPlayerOutputModeSupportedWithUrl(SbPlayerOutputMode output_mode)
-```
-
-### SbPlayerSetBounds ###
-
-Sets the player bounds to the given graphics plane coordinates. The changes do
-not take effect until the next graphics frame buffer swap. The default bounds
-for a player is the full screen. This function is only relevant when the
-`player` is created with the kSbPlayerOutputModePunchOut output mode, and if
-this is not the case then this function call can be ignored.
-
-This function is called on every graphics frame that changes the video bounds.
-For example, if the video bounds are being animated, then this will be called at
-up to 60 Hz. Since the function could be called up to once per frame,
-implementors should take care to avoid related performance concerns with such
-frequent calls.
-
-`player`: The player that is being resized. `z_index`: The z-index of the
-player. When the bounds of multiple players are overlapped, the one with larger
-z-index will be rendered on top of the ones with smaller z-index. `x`: The
-x-coordinate of the upper-left corner of the player. `y`: The y-coordinate of
-the upper-left corner of the player. `width`: The width of the player, in
-pixels. `height`: The height of the player, in pixels.
-
-#### Declaration ####
-
-```
-void SbPlayerSetBounds(SbPlayer player, int z_index, int x, int y, int width, int height)
-```
-
-### SbPlayerSetDrmSystem ###
-
-Sets the DRM system of a running URL-based SbPlayer created with
-SbPlayerCreateWithUrl. This may only be run once for a given SbPlayer.
-
-#### Declaration ####
-
-```
-void SbPlayerSetDrmSystem(SbPlayer player, SbDrmSystem drm_system)
-```
-
-### SbPlayerSetPlaybackRate ###
-
-Set the playback rate of the `player`. `rate` is default to 1.0 which indicates
-the playback is at its original speed. A `rate` greater than one will make the
-playback faster than its original speed. For example, when `rate` is 2, the
-video will be played at twice the speed as its original speed. A `rate` less
-than 1.0 will make the playback slower than its original speed. When `rate` is
-0, the playback will be paused. The function returns true when the playback rate
-is set to `playback_rate` or to a rate that is close to `playback_rate` which
-the implementation supports. It returns false when the playback rate is
-unchanged, this can happen when `playback_rate` is negative or if it is too high
-to support.
-
-#### Declaration ####
-
-```
-bool SbPlayerSetPlaybackRate(SbPlayer player, double playback_rate)
-```
-
-### SbPlayerSetVolume ###
-
-Sets the player's volume.
-
-`player`: The player in which the volume is being adjusted. `volume`: The new
-player volume. The value must be between `0.0` and `1.0`, inclusive. A value of
-`0.0` means that the audio should be muted, and a value of `1.0` means that it
-should be played at full volume.
-
-#### Declaration ####
-
-```
-void SbPlayerSetVolume(SbPlayer player, double volume)
-```
-
-### SbPlayerWriteEndOfStream ###
-
-Writes a marker to `player`'s input stream of `stream_type` indicating that
-there are no more samples for that media type for the remainder of this media
-stream. This marker is invalidated, along with the rest of the stream's
-contents, after a call to SbPlayerSeek.
-
-`player`: The player to which the marker is written. `stream_type`: The type of
-stream for which the marker is written.
-
-#### Declaration ####
-
-```
-void SbPlayerWriteEndOfStream(SbPlayer player, SbMediaType stream_type)
-```
-
-### SbPlayerWriteSample ###
-
-Writes a single sample of the given media type to `player`'s input stream. Its
-data may be passed in via more than one buffers. The lifetime of
-`sample_buffers`, `sample_buffer_sizes`, `video_sample_info`, and
-`sample_drm_info` (as well as member `subsample_mapping` contained inside it)
-are not guaranteed past the call to SbPlayerWriteSample. That means that before
-returning, the implementation must synchronously copy any information it wants
-to retain from those structures.
-
-`player`: The player to which the sample is written. `sample_type`: The type of
-sample being written. See the `SbMediaType` enum in media.h. `sample_buffers`: A
-pointer to an array of buffers with `number_of_sample_buffers` elements that
-hold the data for this sample. The buffers are expected to be a portion of a
-bytestream of the codec type that the player was created with. The buffers
-should contain a sequence of whole NAL Units for video, or a complete audio
-frame. `sample_buffers` cannot be assumed to live past the call into
-SbPlayerWriteSample(), so it must be copied if its content will be used after
-SbPlayerWriteSample() returns. `sample_buffer_sizes`: A pointer to an array of
-sizes with `number_of_sample_buffers` elements. Each of them specify the number
-of bytes in the corresponding buffer contained in `sample_buffers`. None of them
-can be 0. `sample_buffer_sizes` cannot be assumed to live past the call into
-SbPlayerWriteSample(), so it must be copied if its content will be used after
-SbPlayerWriteSample() returns. `number_of_sample_buffers`: Specify the number of
-elements contained inside `sample_buffers` and `sample_buffer_sizes`. It has to
-be at least one, or the call will be ignored. `sample_pts`: The timestamp of the
-sample in 90KHz ticks (PTS). Note that samples MAY be written "slightly" out of
-order. `video_sample_info`: Information about a video sample. This value is
-required if `sample_type` is `kSbMediaTypeVideo`. Otherwise, it must be `NULL`.
-`sample_drm_info`: The DRM system related info for the media sample. This value
-is required for encrypted samples. Otherwise, it must be `NULL`.
-
-#### Declaration ####
-
-```
-void SbPlayerWriteSample(SbPlayer player, SbMediaType sample_type, const void **sample_buffers, int *sample_buffer_sizes, int number_of_sample_buffers, SbMediaTime sample_pts, const SbMediaVideoSampleInfo *video_sample_info, const SbDrmSampleInfo *sample_drm_info)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/queue.md b/src/cobalt/site/docs/reference/starboard/modules/4/queue.md
deleted file mode 100644
index 6fdf231..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/queue.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: queue.h"
----
-
-Defines a C++-only synchronized queue implementation, built entirely on top of
-Starboard synchronization primitives. It can be safely used by both clients and
-implementations.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/speech_recognizer.md b/src/cobalt/site/docs/reference/starboard/modules/4/speech_recognizer.md
deleted file mode 100644
index 5c35165..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/speech_recognizer.md
+++ /dev/null
@@ -1,17 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: speech_recognizer.h"
----
-
-Defines a streaming speech recognizer API. It provides access to the platform
-speech recognition service.
-
-Note that there can be only one speech recognizer. Attempting to create a second
-speech recognizer without destroying the first one will result in undefined
-behavior.
-
-`SbSpeechRecognizerCreate`, `SbSpeechRecognizerStart`, `SbSpeechRecognizerStop`,
-`SbSpeechRecognizerCancel` and `SbSpeechRecognizerDestroy` should be called from
-a single thread. Callbacks defined in `SbSpeechRecognizerHandler` will happen on
-another thread, so calls back into the SbSpeechRecognizer from the callback
-thread are disallowed.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/spin_lock.md b/src/cobalt/site/docs/reference/starboard/modules/4/spin_lock.md
deleted file mode 100644
index dc1989d..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/spin_lock.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: spin_lock.h"
----
-
-Defines a C++-only spin-lock implementation, built entirely on top of Starboard
-atomics and threads. It can be safely used by both clients and implementations.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/storage.md b/src/cobalt/site/docs/reference/starboard/modules/4/storage.md
deleted file mode 100644
index 95258ce..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/storage.md
+++ /dev/null
@@ -1,153 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: storage.h"
----
-
-Defines a user-based Storage API. This is a simple, all-at-once BLOB storage and
-retrieval API that is intended for robust long-term, per-user storage. Some
-platforms have different mechanisms for this kind of storage, so this API exists
-to allow a client application to access this kind of storage.
-
-Note that there can be only one storage record per user and, thus, a maximum of
-one open storage record can exist for each user. Attempting to open a second
-record for a user will result in undefined behavior.
-
-These APIs are NOT expected to be thread-safe, so either call them from a single
-thread, or perform proper synchronization around all calls.
-
-## Macros ##
-
-### kSbStorageInvalidRecord ###
-
-Well-defined value for an invalid storage record handle.
-
-## Typedefs ##
-
-### SbStorageRecord ###
-
-A handle to an open storage record.
-
-#### Definition ####
-
-```
-typedef SbStorageRecordPrivate* SbStorageRecord
-```
-
-## Functions ##
-
-### SbStorageCloseRecord ###
-
-Closes `record`, synchronously ensuring that all written data is flushed. This
-function performs blocking I/O on the calling thread.
-
-The return value indicates whether the operation succeeded. Storage writes
-should be as atomic as possible, so the record should either be fully written or
-deleted (or, even better, untouched).
-
-`record`: The storage record to close. `record` is invalid after this point, and
-subsequent calls referring to `record` will fail.
-
-#### Declaration ####
-
-```
-bool SbStorageCloseRecord(SbStorageRecord record)
-```
-
-### SbStorageDeleteRecord ###
-
-Deletes the default `SbStorageRecord` for the `user`. The return value indicates
-whether the record existed and was successfully deleted. If the record did not
-exist or could not be deleted, the function returns `false`.
-
-This function must not be called while the user's storage record is open. This
-function performs blocking I/O on the calling thread.
-
-`user`: The user for whom the record will be deleted.
-
-#### Declaration ####
-
-```
-bool SbStorageDeleteRecord(SbUser user)
-```
-
-### SbStorageGetRecordSize ###
-
-Returns the size of `record`, or `-1` if there is an error. This function
-performs blocking I/O on the calling thread.
-
-`record`: The record to retrieve the size of.
-
-#### Declaration ####
-
-```
-int64_t SbStorageGetRecordSize(SbStorageRecord record)
-```
-
-### SbStorageIsValidRecord ###
-
-Returns whether the given storage record handle is valid.
-
-#### Declaration ####
-
-```
-static bool SbStorageIsValidRecord(SbStorageRecord record)
-```
-
-### SbStorageOpenRecord ###
-
-Opens and returns the default SbStorageRecord for `user`, blocking I/O on the
-calling thread until the open is completed. If `user` is not a valid `SbUser`,
-the function returns `kSbStorageInvalidRecord`. Will return an `SbStorageRecord`
-of size zero if the record does not yet exist. Opening an already-open
-`SbStorageRecord` has undefined behavior.
-
-`user`: The user for which the storage record will be opened.
-
-#### Declaration ####
-
-```
-SbStorageRecord SbStorageOpenRecord(SbUser user)
-```
-
-### SbStorageReadRecord ###
-
-Reads up to `data_size` bytes from `record`, starting at the beginning of the
-record. The function returns the actual number of bytes read, which must be <=
-`data_size`. The function returns `-1` in the event of an error. This function
-makes a best-effort to read the entire record, and it performs blocking I/O on
-the calling thread until the entire record is read or an error is encountered.
-
-`record`: The record to be read. `out_data`: The data read from the record.
-`data_size`: The amount of data, in bytes, to read.
-
-#### Declaration ####
-
-```
-int64_t SbStorageReadRecord(SbStorageRecord record, char *out_data, int64_t data_size)
-```
-
-### SbStorageWriteRecord ###
-
-Replaces the data in `record` with `data_size` bytes from `data`. This function
-always deletes any previous data in that record. The return value indicates
-whether the write succeeded. This function makes a best-effort to write the
-entire record, and it may perform blocking I/O on the calling thread until the
-entire record is written or an error is encountered.
-
-While `SbStorageWriteRecord()` may defer the persistence,
-`SbStorageReadRecord()` is expected to work as expected immediately afterwards,
-even without a call to `SbStorageCloseRecord()`. The data should be persisted
-after a short time, even if there is an unexpected process termination before
-`SbStorageCloseRecord()` is called.
-
-`record`: The record to be written to. `data`: The data to write to the record.
-`data_size`: The amount of `data`, in bytes, to write to the record. Thus, if
-`data_size` is smaller than the total size of `data`, only part of `data` is
-written to the record.
-
-#### Declaration ####
-
-```
-bool SbStorageWriteRecord(SbStorageRecord record, const char *data, int64_t data_size)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/system.md b/src/cobalt/site/docs/reference/starboard/modules/4/system.md
deleted file mode 100644
index da36424..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/system.md
+++ /dev/null
@@ -1,742 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: system.h"
----
-
-Defines a broad set of APIs that allow the client application to query build and
-runtime properties of the enclosing system.
-
-## Macros ##
-
-### kSbSystemPlatformErrorInvalid ###
-
-Well-defined value for an invalid `SbSystemPlatformError`.
-
-## Enums ##
-
-### SbSystemCapabilityId ###
-
-Runtime capabilities are boolean properties of a platform that can't be
-determined at compile-time. They may vary from device to device, but they will
-not change over the course of a single execution. They often specify particular
-behavior of other APIs within the bounds of their operating range.
-
-#### Values ####
-
-*   `kSbSystemCapabilityReversedEnterAndBack`
-
-    Whether this system has reversed Enter and Back keys.
-*   `kSbSystemCapabilityCanQueryGPUMemoryStats`
-
-    Whether this system has the ability to report on GPU memory usage. If (and
-    only if) a system has this capability will SbSystemGetTotalGPUMemory() and
-    SbSystemGetUsedGPUMemory() be valid to call.
-
-### SbSystemConnectionType ###
-
-Enumeration of network connection types.
-
-#### Values ####
-
-*   `kSbSystemConnectionTypeWired`
-
-    The system is on a wired connection.
-*   `kSbSystemConnectionTypeWireless`
-
-    The system is on a wireless connection.
-*   `kSbSystemConnectionTypeUnknown`
-
-    The system connection type is unknown.
-
-### SbSystemDeviceType ###
-
-Enumeration of device types.
-
-#### Values ####
-
-*   `kSbSystemDeviceTypeBlueRayDiskPlayer`
-
-    Blue-ray Disc Player (BDP).
-*   `kSbSystemDeviceTypeGameConsole`
-
-    A relatively high-powered TV device used primarily for playing games.
-*   `kSbSystemDeviceTypeOverTheTopBox`
-
-    Over the top (OTT) devices stream content via the Internet over another type
-    of network, e.g. cable or satellite.
-*   `kSbSystemDeviceTypeSetTopBox`
-
-    Set top boxes (STBs) stream content primarily over cable or satellite. Some
-    STBs can also stream OTT content via the Internet.
-*   `kSbSystemDeviceTypeTV`
-
-    A Smart TV is a TV that can directly run applications that stream OTT
-    content via the Internet.
-*   `kSbSystemDeviceTypeDesktopPC`
-
-    Desktop PC.
-*   `kSbSystemDeviceTypeAndroidTV`
-
-    An Android TV Device.
-*   `kSbSystemDeviceTypeUnknown`
-
-    Unknown device.
-
-### SbSystemPathId ###
-
-Enumeration of special paths that the platform can define.
-
-#### Values ####
-
-*   `kSbSystemPathContentDirectory`
-
-    Path to where the local content files that ship with the binary are
-    available.
-*   `kSbSystemPathCacheDirectory`
-
-    Path to the directory that can be used as a local file cache, if available.
-*   `kSbSystemPathDebugOutputDirectory`
-
-    Path to the directory where debug output (e.g. logs, trace output,
-    screenshots) can be written into.
-*   `kSbSystemPathFontDirectory`
-
-    Path to a directory where system font files can be found. Should only be
-    specified on platforms that provide fonts usable by Starboard applications.
-*   `kSbSystemPathFontConfigurationDirectory`
-
-    Path to a directory where system font configuration metadata can be found.
-    May be the same directory as `kSbSystemPathFontDirectory`, but not
-    necessarily. Should only be specified on platforms that provide fonts usable
-    by Starboard applications.
-*   `kSbSystemPathSourceDirectory`
-
-    Deprecated and unused. Tests looking for static data should instead look in
-    the 'test' subdirectory of kSbSystemPathContentDirectory.
-*   `kSbSystemPathTempDirectory`
-
-    Path to a directory where temporary files can be written.
-*   `kSbSystemPathTestOutputDirectory`
-
-    Path to a directory where test results can be written.
-*   `kSbSystemPathExecutableFile`
-
-    Full path to the executable file.
-
-### SbSystemPlatformErrorResponse ###
-
-Possible responses for `SbSystemPlatformErrorCallback`.
-
-#### Values ####
-
-*   `kSbSystemPlatformErrorResponsePositive`
-*   `kSbSystemPlatformErrorResponseNegative`
-*   `kSbSystemPlatformErrorResponseCancel`
-
-### SbSystemPlatformErrorType ###
-
-Enumeration of possible values for the `type` parameter passed to the
-`SbSystemRaisePlatformError` function.
-
-#### Values ####
-
-*   `kSbSystemPlatformErrorTypeConnectionError`
-
-    Cobalt received a network connection error, or a network disconnection
-    event. If the `response` passed to `SbSystemPlatformErrorCallback` is
-    `kSbSystemPlatformErrorResponsePositive` then the request should be retried,
-    otherwise the app should be stopped.
-*   `kSbSystemPlatformErrorTypeUserSignedOut`
-
-    The current user is not signed in.
-*   `kSbSystemPlatformErrorTypeUserAgeRestricted`
-
-    The current user does not meet the age requirements to use the app.
-
-### SbSystemPropertyId ###
-
-System properties that can be queried for. Many of these are used in User-Agent
-string generation.
-
-#### Values ####
-
-*   `kSbSystemPropertyCertificationScope`
-
-    The certification scope that identifies a group of devices.
-*   `kSbSystemPropertyBase64EncodedCertificationSecret`
-
-    The HMAC-SHA256 base64 encoded symmetric key used to sign a subset of the
-    query parameters from the application startup URL.
-*   `kSbSystemPropertyChipsetModelNumber`
-
-    The full model number of the main platform chipset, including any vendor-
-    specific prefixes.
-*   `kSbSystemPropertyFirmwareVersion`
-
-    The production firmware version number which the device is currently
-    running.
-*   `kSbSystemPropertyFriendlyName`
-
-    A friendly name for this actual device. It may include user-personalization
-    like "Upstairs Bedroom." It may be displayed to users as part of some kind
-    of device selection (e.g. in-app DIAL).
-*   `kSbSystemPropertyManufacturerName`
-
-    A deprecated alias for `kSbSystemPropertyBrandName`.
-*   `kSbSystemPropertyBrandName`
-
-    The name of the brand under which the device is being sold.
-*   `kSbSystemPropertyModelName`
-
-    The final production model number of the device.
-*   `kSbSystemPropertyModelYear`
-
-    The year the device was launched, e.g. "2016".
-*   `kSbSystemPropertyNetworkOperatorName`
-
-    The name of the network operator that owns the target device, if applicable.
-*   `kSbSystemPropertyPlatformName`
-
-    The name of the operating system and platform, suitable for inclusion in a
-    User-Agent, say.
-*   `kSbSystemPropertyPlatformUuid`
-
-    A universally-unique ID for the current user.
-*   `kSbSystemPropertySpeechApiKey`
-
-    The Google Speech API key. The platform manufacturer is responsible for
-    registering a Google Speech API key for their products. In the API Console (
-    [http://developers.google.com/console](http://developers.google.com/console)
-    ), you can enable the Speech APIs and generate a Speech API key.
-
-## Typedefs ##
-
-### SbSystemComparator ###
-
-Pointer to a function to compare two items. The return value uses standard
-`*cmp` semantics:
-
-*   `< 0` if `a` is less than `b`
-
-*   `0` if the two items are equal
-
-*   `> 1` if `a` is greater than `b`
-
-`a`: The first value to compare. `b`: The second value to compare.
-
-#### Definition ####
-
-```
-typedef int(* SbSystemComparator) (const void *a, const void *b)
-```
-
-### SbSystemError ###
-
-A type that can represent a system error code across all Starboard platforms.
-
-#### Definition ####
-
-```
-typedef int SbSystemError
-```
-
-### SbSystemPlatformError ###
-
-Opaque handle returned by `SbSystemRaisePlatformError` that can be passed to
-`SbSystemClearPlatformError`.
-
-#### Definition ####
-
-```
-typedef SbSystemPlatformErrorPrivate* SbSystemPlatformError
-```
-
-### SbSystemPlatformErrorCallback ###
-
-Type of callback function that may be called in response to an error
-notification from `SbSystemRaisePlatformError`. `response` is a code to indicate
-the user's response, e.g. if the platform raised a dialog to notify the user of
-the error. `user_data` is the opaque pointer that was passed to the call to
-`SbSystemRaisePlatformError`.
-
-#### Definition ####
-
-```
-typedef void(* SbSystemPlatformErrorCallback) (SbSystemPlatformErrorResponse response, void *user_data)
-```
-
-## Functions ##
-
-### SbSystemBinarySearch ###
-
-Binary searches a sorted table `base` of `element_count` objects, each element
-`element_width` bytes in size for an element that `comparator` compares equal to
-`key`.
-
-This function is meant to be a drop-in replacement for `bsearch`.
-
-`key`: The key to search for in the table. `base`: The sorted table of elements
-to be searched. `element_count`: The number of elements in the table.
-`element_width`: The size, in bytes, of each element in the table. `comparator`:
-A value that indicates how the element in the table should compare to the
-specified `key`.
-
-#### Declaration ####
-
-```
-void* SbSystemBinarySearch(const void *key, const void *base, size_t element_count, size_t element_width, SbSystemComparator comparator)
-```
-
-### SbSystemBreakIntoDebugger ###
-
-Breaks the current program into the debugger, if a debugger is attached. If a
-debugger is not attached, this function aborts the program.
-
-#### Declaration ####
-
-```
-SB_NORETURN void SbSystemBreakIntoDebugger()
-```
-
-### SbSystemClearLastError ###
-
-Clears the last error set by a Starboard call in the current thread.
-
-#### Declaration ####
-
-```
-void SbSystemClearLastError()
-```
-
-### SbSystemClearPlatformError ###
-
-Clears a platform error that was previously raised by a call to
-`SbSystemRaisePlatformError`. The platform may use this, for example, to close a
-dialog that was opened in response to the error.
-
-`handle`: The platform error to be cleared.
-
-#### Declaration ####
-
-```
-void SbSystemClearPlatformError(SbSystemPlatformError handle)
-```
-
-### SbSystemGetConnectionType ###
-
-Returns the device's current network connection type.
-
-#### Declaration ####
-
-```
-SbSystemConnectionType SbSystemGetConnectionType()
-```
-
-### SbSystemGetDeviceType ###
-
-Returns the type of the device.
-
-#### Declaration ####
-
-```
-SbSystemDeviceType SbSystemGetDeviceType()
-```
-
-### SbSystemGetErrorString ###
-
-Generates a human-readable string for an error. The return value specifies the
-total desired length of the string.
-
-`error`: The error for which a human-readable string is generated. `out_string`:
-The generated string. This value may be null, and it is always terminated with a
-null byte. `string_length`: The maximum length of the error string.
-
-#### Declaration ####
-
-```
-int SbSystemGetErrorString(SbSystemError error, char *out_string, int string_length)
-```
-
-### SbSystemGetLastError ###
-
-Gets the last platform-specific error code produced by any Starboard call in the
-current thread for diagnostic purposes. Semantic reactions to Starboard function
-call results should be modeled explicitly.
-
-#### Declaration ####
-
-```
-SbSystemError SbSystemGetLastError()
-```
-
-### SbSystemGetLocaleId ###
-
-Gets the system's current POSIX-style Locale ID. The locale represents the
-location, language, and cultural conventions that the system wants to use, which
-affects which text is displayed to the user as well as how displayed numbers,
-dates, currency, and similar values are formatted.
-
-At its simplest, the locale ID can just be a BCP 47 language code, like `en_US`.
-Currently, POSIX also wants to include the encoding as in `en_US.UTF8`. POSIX
-also allows a couple very bare-bones locales, like "C" or "POSIX", but they are
-not supported here. POSIX also supports different locale settings for a few
-different purposes, but Starboard only exposes one locale at a time.
-
-RFC 5646 describes BCP 47 language codes: [https://tools.ietf.org/html/bcp47](https://tools.ietf.org/html/bcp47)
-
-For more information than you probably want about POSIX locales, see: [http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html)
-
-#### Declaration ####
-
-```
-const char* SbSystemGetLocaleId()
-```
-
-### SbSystemGetNumberOfProcessors ###
-
-Returns the number of processor cores available to this application. If the
-process is sandboxed to a subset of the physical cores, the function returns
-that sandboxed limit.
-
-#### Declaration ####
-
-```
-int SbSystemGetNumberOfProcessors()
-```
-
-### SbSystemGetPath ###
-
-Retrieves the platform-defined system path specified by `path_id` and places it
-as a zero-terminated string into the user-allocated `out_path` unless it is
-longer than `path_length` - 1. This implementation must be thread-safe.
-
-This function returns `true` if the path is retrieved successfully. It returns
-`false` under any of the following conditions and, in any such case, `out_path`
-is not changed:
-
-*   `path_id` is invalid for this platform
-
-*   `path_length` is too short for the given result
-
-*   `out_path` is NULL
-
-`path_id`: The system path to be retrieved. `out_path`: The platform-defined
-system path specified by `path_id`. `path_length`: The length of the system
-path.
-
-#### Declaration ####
-
-```
-bool SbSystemGetPath(SbSystemPathId path_id, char *out_path, int path_length)
-```
-
-### SbSystemGetProperty ###
-
-Retrieves the platform-defined system property specified by `property_id` and
-places its value as a zero-terminated string into the user-allocated `out_value`
-unless it is longer than `value_length` - 1. This implementation must be thread-
-safe.
-
-This function returns `true` if the property is retrieved successfully. It
-returns `false` under any of the following conditions and, in any such case,
-`out_value` is not changed:
-
-*   `property_id` is invalid for this platform
-
-*   `value_length` is too short for the given result
-
-*   `out_value` is NULL
-
-`property_id`: The system path to be retrieved. `out_value`: The platform-
-defined system property specified by `property_id`. `value_length`: The length
-of the system property.
-
-#### Declaration ####
-
-```
-bool SbSystemGetProperty(SbSystemPropertyId property_id, char *out_value, int value_length)
-```
-
-### SbSystemGetRandomData ###
-
-A cryptographically secure random number generator that produces an arbitrary,
-non-negative number of `buffer_size` random, non-negative bytes. The generated
-number is placed in `out_buffer`. This function does not require manual seeding.
-
-`out_buffer`: A pointer for the generated random number. This value must not be
-null. `buffer_size`: The size of the random number, in bytes.
-
-#### Declaration ####
-
-```
-void SbSystemGetRandomData(void *out_buffer, int buffer_size)
-```
-
-### SbSystemGetRandomUInt64 ###
-
-A cryptographically secure random number generator that gets 64 random bits and
-returns them as an `uint64_t`. This function does not require manual seeding.
-
-#### Declaration ####
-
-```
-uint64_t SbSystemGetRandomUInt64()
-```
-
-### SbSystemGetStack ###
-
-Places up to `stack_size` instruction pointer addresses of the current execution
-stack into `out_stack`. The return value specifies the number of entries added.
-
-The returned stack frames are in "downward" order from the calling frame toward
-the entry point of the thread. So, if all the stack frames do not fit, the ones
-truncated will be the less interesting ones toward the thread entry point.
-
-This function is used in crash signal handlers and, therefore, it must be async-
-signal-safe on platforms that support signals. The following document discusses
-what it means to be async-signal-safe on POSIX: [http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html#tag_02_04_03](http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html#tag_02_04_03)
-
-`out_stack`: A non-NULL array of `void *` of at least `stack_size` entries.
-`stack_size`: The maximum number of instruction pointer addresses to be placed
-into `out_stack` from the current execution stack.
-
-#### Declaration ####
-
-```
-int SbSystemGetStack(void **out_stack, int stack_size)
-```
-
-### SbSystemGetTotalCPUMemory ###
-
-Returns the total CPU memory (in bytes) potentially available to this
-application. If the process is sandboxed to a maximum allowable limit, the
-function returns the lesser of the physical and sandbox limits.
-
-#### Declaration ####
-
-```
-int64_t SbSystemGetTotalCPUMemory()
-```
-
-### SbSystemGetTotalGPUMemory ###
-
-Returns the total GPU memory (in bytes) available for use by this application.
-This function may only be called the return value for calls to
-SbSystemHasCapability(kSbSystemCapabilityCanQueryGPUMemoryStats) is `true`.
-
-#### Declaration ####
-
-```
-int64_t SbSystemGetTotalGPUMemory()
-```
-
-### SbSystemGetUsedCPUMemory ###
-
-Returns the total physical CPU memory (in bytes) used by this application. This
-value should always be less than (or, in particularly exciting situations, equal
-to) SbSystemGetTotalCPUMemory().
-
-#### Declaration ####
-
-```
-int64_t SbSystemGetUsedCPUMemory()
-```
-
-### SbSystemGetUsedGPUMemory ###
-
-Returns the current amount of GPU memory (in bytes) that is currently being used
-by this application. This function may only be called if the return value for
-calls to SbSystemHasCapability(kSbSystemCapabilityCanQueryGPUMemoryStats) is
-`true`.
-
-#### Declaration ####
-
-```
-int64_t SbSystemGetUsedGPUMemory()
-```
-
-### SbSystemHasCapability ###
-
-Returns whether the platform has the runtime capability specified by
-`capability_id`. Returns false for any unknown capabilities. This implementation
-must be thread-safe.
-
-`capability_id`: The runtime capability to check.
-
-#### Declaration ####
-
-```
-bool SbSystemHasCapability(SbSystemCapabilityId capability_id)
-```
-
-### SbSystemHideSplashScreen ###
-
-Hides the system splash screen on systems that support a splash screen that is
-displayed while the application is loading. This function may be called from any
-thread and must be idempotent.
-
-#### Declaration ####
-
-```
-void SbSystemHideSplashScreen()
-```
-
-### SbSystemIsDebuggerAttached ###
-
-Attempts to determine whether the current program is running inside or attached
-to a debugger. The function returns `false` if neither of those cases is true.
-
-#### Declaration ####
-
-```
-bool SbSystemIsDebuggerAttached()
-```
-
-### SbSystemPlatformErrorIsValid ###
-
-Checks whether a `SbSystemPlatformError` is valid.
-
-#### Declaration ####
-
-```
-static bool SbSystemPlatformErrorIsValid(SbSystemPlatformError handle)
-```
-
-### SbSystemRaisePlatformError ###
-
-Cobalt calls this function to notify the platform that an error has occurred in
-the application that the platform may need to handle. The platform is expected
-to then notify the user of the error and to provide a means for any required
-interaction, such as by showing a dialog.
-
-The return value is a handle that may be used in a subsequent call to
-`SbSystemClearPlatformError`. For example, the handle could be used to
-programatically dismiss a dialog that was raised in response to the error. The
-lifetime of the object referenced by the handle is until the user reacts to the
-error or the error is dismissed by a call to SbSystemClearPlatformError,
-whichever happens first. Note that if the platform cannot respond to the error,
-then this function should return `kSbSystemPlatformErrorInvalid`.
-
-This function may be called from any thread, and it is the platform's
-responsibility to decide how to handle an error received while a previous error
-is still pending. If that platform can only handle one error at a time, then it
-may queue the second error or ignore it by returning
-`kSbSystemPlatformErrorInvalid`.
-
-`type`: An error type, from the SbSystemPlatformErrorType enum, that defines the
-error. `callback`: A function that may be called by the platform to let the
-caller know that the user has reacted to the error. `user_data`: An opaque
-pointer that the platform should pass as an argument to the callback function,
-if it is called.
-
-#### Declaration ####
-
-```
-SbSystemPlatformError SbSystemRaisePlatformError(SbSystemPlatformErrorType type, SbSystemPlatformErrorCallback callback, void *user_data)
-```
-
-### SbSystemRequestPause ###
-
-Requests that the application move into the Paused state at the next convenient
-point. This should roughly correspond to "unfocused application" in a
-traditional window manager, where the application may be partially visible.
-
-This function eventually causes a `kSbEventTypePause` event to be dispatched to
-the application. Before the `kSbEventTypePause` event is dispatched, some work
-may continue to be done, and unrelated system events may be dispatched.
-
-#### Declaration ####
-
-```
-void SbSystemRequestPause()
-```
-
-### SbSystemRequestStop ###
-
-Requests that the application be terminated gracefully at the next convenient
-point. In the meantime, some work may continue to be done, and unrelated system
-events may be dispatched. This function eventually causes a `kSbEventTypeStop`
-event to be dispatched to the application. When the process finally terminates,
-it returns `error_level`, if that has any meaning on the current platform.
-
-`error_level`: An integer that serves as the return value for the process that
-is eventually terminated as a result of a call to this function.
-
-#### Declaration ####
-
-```
-void SbSystemRequestStop(int error_level)
-```
-
-### SbSystemRequestSuspend ###
-
-Requests that the application move into the Suspended state at the next
-convenient point. This should roughly correspond to "minimization" in a
-traditional window manager, where the application is no longer visible.
-
-This function eventually causes a `kSbEventTypeSuspend` event to be dispatched
-to the application. Before the `kSbEventTypeSuspend` event is dispatched, some
-work may continue to be done, and unrelated system events may be dispatched.
-
-In the Suspended state, the application will be resident, but probably not
-running. The expectation is that an external system event will bring the
-application out of the Suspended state.
-
-#### Declaration ####
-
-```
-void SbSystemRequestSuspend()
-```
-
-### SbSystemRequestUnpause ###
-
-Requests that the application move into the Started state at the next convenient
-point. This should roughly correspond to a "focused application" in a
-traditional window manager, where the application is fully visible and the
-primary receiver of input events.
-
-This function eventually causes a `kSbEventTypeUnpause` event to be dispatched
-to the application. Before `kSbEventTypeUnpause` is dispatched, some work may
-continue to be done, and unrelated system events may be dispatched.
-
-#### Declaration ####
-
-```
-void SbSystemRequestUnpause()
-```
-
-### SbSystemSort ###
-
-Sorts an array of elements `base`, with `element_count` elements of
-`element_width` bytes each, using `comparator` as the comparison function.
-
-This function is meant to be a drop-in replacement for `qsort`.
-
-`base`: The array of elements to be sorted. `element_count`: The number of
-elements in the array. `element_width`: The size, in bytes, of each element in
-the array. `comparator`: A value that indicates how the array should be sorted.
-
-#### Declaration ####
-
-```
-void SbSystemSort(void *base, size_t element_count, size_t element_width, SbSystemComparator comparator)
-```
-
-### SbSystemSymbolize ###
-
-Looks up `address` as an instruction pointer and places up to (`buffer_size -
-1`) characters of the symbol associated with it in `out_buffer`, which must not
-be NULL. `out_buffer` will be NULL-terminated.
-
-The return value indicates whether the function found a reasonable match for
-`address`. If the return value is `false`, then `out_buffer` is not modified.
-
-This function is used in crash signal handlers and, therefore, it must be async-
-signal-safe on platforms that support signals.
-
-#### Declaration ####
-
-```
-bool SbSystemSymbolize(const void *address, char *out_buffer, int buffer_size)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/thread.md b/src/cobalt/site/docs/reference/starboard/modules/4/thread.md
deleted file mode 100644
index 22b075b..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/thread.md
+++ /dev/null
@@ -1,403 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: thread.h"
----
-
-Defines functionality related to thread creation and cleanup.
-
-## Macros ##
-
-### kSbThreadInvalidId ###
-
-Well-defined constant value to mean "no thread ID."
-
-### kSbThreadLocalKeyInvalid ###
-
-Well-defined constant value to mean "no thread local key."
-
-### kSbThreadNoAffinity ###
-
-Well-defined constant value to mean "no affinity."
-
-## Enums ##
-
-### SbThreadPriority ###
-
-A spectrum of thread priorities. Platforms map them appropriately to their own
-priority system. Note that scheduling is platform-specific, and what these
-priorities mean, if they mean anything at all, is also platform-specific.
-
-In particular, several of these priority values can map to the same priority on
-a given platform. The only guarantee is that each lower priority should be
-treated less-than-or-equal-to a higher priority.
-
-#### Values ####
-
-*   `kSbThreadPriorityLowest`
-
-    The lowest thread priority available on the current platform.
-*   `kSbThreadPriorityLow`
-
-    A lower-than-normal thread priority, if available on the current platform.
-*   `kSbThreadPriorityNormal`
-
-    Really, what is normal? You should spend time pondering that question more
-    than you consider less-important things, but less than you think about more-
-    important things.
-*   `kSbThreadPriorityHigh`
-
-    A higher-than-normal thread priority, if available on the current platform.
-*   `kSbThreadPriorityHighest`
-
-    The highest thread priority available on the current platform that isn't
-    considered "real-time" or "time-critical," if those terms have any meaning
-    on the current platform.
-*   `kSbThreadPriorityRealTime`
-
-    If the platform provides any kind of real-time or time-critical scheduling,
-    this priority will request that treatment. Real-time scheduling generally
-    means that the thread will have more consistency in scheduling than non-
-    real-time scheduled threads, often by being more deterministic in how
-    threads run in relation to each other. But exactly how being real-time
-    affects the thread scheduling is platform-specific.
-
-    For platforms where that is not offered, or otherwise not meaningful, this
-    will just be the highest priority available in the platform's scheme, which
-    may be the same as kSbThreadPriorityHighest.
-*   `kSbThreadNoPriority`
-
-    Well-defined constant value to mean "no priority." This means to use the
-    default priority assignment method of that platform. This may mean to
-    inherit the priority of the spawning thread, or it may mean a specific
-    default priority, or it may mean something else, depending on the platform.
-
-## Typedefs ##
-
-### SbThreadAffinity ###
-
-Type for thread core affinity. This generally will be a single cpu (or core or
-hyperthread) identifier. Some platforms may not support affinity, and some may
-have specific rules about how it must be used.
-
-#### Definition ####
-
-```
-typedef int32_t SbThreadAffinity
-```
-
-### SbThreadEntryPoint ###
-
-Function pointer type for SbThreadCreate. `context` is a pointer-sized bit of
-data passed in from the calling thread.
-
-#### Definition ####
-
-```
-typedef void*(* SbThreadEntryPoint) (void *context)
-```
-
-### SbThreadId ###
-
-An ID type that is unique per thread.
-
-#### Definition ####
-
-```
-typedef int32_t SbThreadId
-```
-
-### SbThreadLocalDestructor ###
-
-Function pointer type for Thread-Local destructors.
-
-#### Definition ####
-
-```
-typedef void(* SbThreadLocalDestructor) (void *value)
-```
-
-### SbThreadLocalKey ###
-
-A handle to a thread-local key.
-
-#### Definition ####
-
-```
-typedef SbThreadLocalKeyPrivate* SbThreadLocalKey
-```
-
-## Functions ##
-
-### SbThreadCreate ###
-
-Creates a new thread, which starts immediately.
-
-*   If the function succeeds, the return value is a handle to the newly created
-    thread.
-
-*   If the function fails, the return value is `kSbThreadInvalid`.
-
-`stack_size`: The amount of memory reserved for the thread. Set the value to `0`
-to indicate that the default stack size should be used. `priority`: The thread's
-priority. This value can be set to `kSbThreadNoPriority` to use the platform's
-default priority. As examples, it could be set to a fixed, standard priority or
-to a priority inherited from the thread that is calling SbThreadCreate(), or to
-something else. `affinity`: The thread's affinity. This value can be set to
-`kSbThreadNoAffinity` to use the platform's default affinity. `joinable`:
-Indicates whether the thread can be joined (`true`) or should start out
-"detached" (`false`). Note that for joinable threads, when you are done with the
-thread handle, you must call `SbThreadJoin` to release system resources
-associated with the thread. This is not necessary for detached threads, but
-detached threads cannot be joined. `name`: A name used to identify the thread.
-This value is used mainly for debugging, it can be `NULL`, and it might not be
-used in production builds. `entry_point`: A pointer to a function that will be
-executed on the newly created thread. `context`: This value will be passed to
-the `entry_point` function.
-
-#### Declaration ####
-
-```
-SbThread SbThreadCreate(int64_t stack_size, SbThreadPriority priority, SbThreadAffinity affinity, bool joinable, const char *name, SbThreadEntryPoint entry_point, void *context)
-```
-
-### SbThreadCreateLocalKey ###
-
-Creates and returns a new, unique key for thread local data. If the function
-does not succeed, the function returns `kSbThreadLocalKeyInvalid`.
-
-If `destructor` is specified, it will be called in the owning thread, and only
-in the owning thread, when the thread exits. In that case, it is called on the
-local value associated with the key in the current thread as long as the local
-value is not NULL.
-
-`destructor`: A pointer to a function. The value may be NULL if no clean up is
-needed.
-
-#### Declaration ####
-
-```
-SbThreadLocalKey SbThreadCreateLocalKey(SbThreadLocalDestructor destructor)
-```
-
-### SbThreadDestroyLocalKey ###
-
-Destroys thread local data for the specified key. The function is a no-op if the
-key is invalid (kSbThreadLocalKeyInvalid`) or has already been destroyed. This
-function does NOT call the destructor on any stored values.
-
-`key`: The key for which to destroy thread local data.
-
-#### Declaration ####
-
-```
-void SbThreadDestroyLocalKey(SbThreadLocalKey key)
-```
-
-### SbThreadDetach ###
-
-Detaches `thread`, which prevents it from being joined. This is sort of like a
-non-blocking join. This function is a no-op if the thread is already detached or
-if the thread is already being joined by another thread.
-
-`thread`: The thread to be detached.
-
-#### Declaration ####
-
-```
-void SbThreadDetach(SbThread thread)
-```
-
-### SbThreadGetCurrent ###
-
-Returns the handle of the currently executing thread.
-
-#### Declaration ####
-
-```
-SbThread SbThreadGetCurrent()
-```
-
-### SbThreadGetId ###
-
-Returns the Thread ID of the currently executing thread.
-
-#### Declaration ####
-
-```
-SbThreadId SbThreadGetId()
-```
-
-### SbThreadGetLocalValue ###
-
-Returns the pointer-sized value for `key` in the currently executing thread's
-local storage. Returns `NULL` if key is `kSbThreadLocalKeyInvalid` or if the key
-has already been destroyed.
-
-`key`: The key for which to return the value.
-
-#### Declaration ####
-
-```
-void* SbThreadGetLocalValue(SbThreadLocalKey key)
-```
-
-### SbThreadGetName ###
-
-Returns the debug name of the currently executing thread.
-
-#### Declaration ####
-
-```
-void SbThreadGetName(char *buffer, int buffer_size)
-```
-
-### SbThreadIsCurrent ###
-
-Returns whether `thread` is the current thread.
-
-`thread`: The thread to check.
-
-#### Declaration ####
-
-```
-static bool SbThreadIsCurrent(SbThread thread)
-```
-
-### SbThreadIsEqual ###
-
-Indicates whether `thread1` and `thread2` refer to the same thread.
-
-`thread1`: The first thread to compare. `thread2`: The second thread to compare.
-
-#### Declaration ####
-
-```
-bool SbThreadIsEqual(SbThread thread1, SbThread thread2)
-```
-
-### SbThreadIsValid ###
-
-Returns whether the given thread handle is valid.
-
-#### Declaration ####
-
-```
-static bool SbThreadIsValid(SbThread thread)
-```
-
-### SbThreadIsValidAffinity ###
-
-Returns whether the given thread affinity is valid.
-
-#### Declaration ####
-
-```
-static bool SbThreadIsValidAffinity(SbThreadAffinity affinity)
-```
-
-### SbThreadIsValidId ###
-
-Returns whether the given thread ID is valid.
-
-#### Declaration ####
-
-```
-static bool SbThreadIsValidId(SbThreadId id)
-```
-
-### SbThreadIsValidLocalKey ###
-
-Returns whether the given thread local variable key is valid.
-
-#### Declaration ####
-
-```
-static bool SbThreadIsValidLocalKey(SbThreadLocalKey key)
-```
-
-### SbThreadIsValidPriority ###
-
-Returns whether the given thread priority is valid.
-
-#### Declaration ####
-
-```
-static bool SbThreadIsValidPriority(SbThreadPriority priority)
-```
-
-### SbThreadJoin ###
-
-Joins the thread on which this function is called with joinable `thread`. This
-function blocks the caller until the designated thread exits, and then cleans up
-that thread's resources. The cleanup process essentially detaches thread.
-
-The return value is `true` if the function is successful and `false` if `thread`
-is invalid or detached.
-
-Each joinable thread can only be joined once and must be joined to be fully
-cleaned up. Once SbThreadJoin is called, the thread behaves as if it were
-detached to all threads other than the joining thread.
-
-`thread`: The thread to which the current thread will be joined. The `thread`
-must have been created with SbThreadCreate. `out_return`: If this is not `NULL`,
-then the SbThreadJoin function populates it with the return value of the
-thread's `main` function.
-
-#### Declaration ####
-
-```
-bool SbThreadJoin(SbThread thread, void **out_return)
-```
-
-### SbThreadSetLocalValue ###
-
-Sets the pointer-sized value for `key` in the currently executing thread's local
-storage. The return value indicates whether `key` is valid and has not already
-been destroyed.
-
-`key`: The key for which to set the key value. `value`: The new pointer-sized
-key value.
-
-#### Declaration ####
-
-```
-bool SbThreadSetLocalValue(SbThreadLocalKey key, void *value)
-```
-
-### SbThreadSetName ###
-
-Sets the debug name of the currently executing thread by copying the specified
-name string.
-
-`name`: The name to assign to the thread.
-
-#### Declaration ####
-
-```
-void SbThreadSetName(const char *name)
-```
-
-### SbThreadSleep ###
-
-Sleeps the currently executing thread.
-
-`duration`: The minimum amount of time, in microseconds, that the currently
-executing thread should sleep. The function is a no-op if this value is negative
-or `0`.
-
-#### Declaration ####
-
-```
-void SbThreadSleep(SbTime duration)
-```
-
-### SbThreadYield ###
-
-Yields the currently executing thread, so another thread has a chance to run.
-
-#### Declaration ####
-
-```
-void SbThreadYield()
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/thread_types.md b/src/cobalt/site/docs/reference/starboard/modules/4/thread_types.md
deleted file mode 100644
index 5f4da0e..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/thread_types.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: thread_types.h"
----
-
-Defines platform-specific threading and synchronization primitive types and
-initializers. We hide, but pass through, the platform's primitives to avoid
-doing a lot of work to replicate initialization-less synchronization primitives.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/time_zone.md b/src/cobalt/site/docs/reference/starboard/modules/4/time_zone.md
deleted file mode 100644
index ee27d83..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/time_zone.md
+++ /dev/null
@@ -1,56 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: time_zone.h"
----
-
-Provides access to the system time zone information.
-
-## Typedefs ##
-
-### SbTimeZone ###
-
-The number of minutes west of the Greenwich Prime Meridian, NOT including
-Daylight Savings Time adjustments.
-
-For example: PST/PDT is 480 minutes (28800 seconds, 8 hours).
-
-#### Definition ####
-
-```
-typedef int SbTimeZone
-```
-
-## Functions ##
-
-### SbTimeZoneGetCurrent ###
-
-Gets the system's current SbTimeZone in minutes.
-
-#### Declaration ####
-
-```
-SbTimeZone SbTimeZoneGetCurrent()
-```
-
-### SbTimeZoneGetDstName ###
-
-Gets the three-letter code of the current timezone in Daylight Savings Time,
-regardless of current DST status. (e.g. "PDT")
-
-#### Declaration ####
-
-```
-const char* SbTimeZoneGetDstName()
-```
-
-### SbTimeZoneGetName ###
-
-Gets the three-letter code of the current timezone in standard time, regardless
-of current Daylight Savings Time status. (e.g. "PST")
-
-#### Declaration ####
-
-```
-const char* SbTimeZoneGetName()
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/4/window.md b/src/cobalt/site/docs/reference/starboard/modules/4/window.md
deleted file mode 100644
index 9c84139..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/4/window.md
+++ /dev/null
@@ -1,295 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: window.h"
----
-
-Provides functionality to handle Window creation and management.
-
-## Macros ##
-
-### kSbEventOnScreenKeyboardInvalidTicket ###
-
-System-triggered OnScreenKeyboard events have ticket value
-kSbEventOnScreenKeyboardInvalidTicket.
-
-### kSbWindowInvalid ###
-
-Well-defined value for an invalid window handle.
-
-## Typedefs ##
-
-### SbWindow ###
-
-A handle to a window.
-
-#### Definition ####
-
-```
-typedef SbWindowPrivate* SbWindow
-```
-
-## Structs ##
-
-### SbWindowOptions ###
-
-Options that can be requested at window creation time.
-
-#### Members ####
-
-*   `SbWindowSize size`
-
-    The requested size of the new window. The value of `video_pixel_ratio` will
-    not be used or looked at.
-*   `bool windowed`
-
-    Whether the new window should be windowed or not. If not, the requested size
-    is really the requested resolution.
-*   `const char * name`
-
-    The name of the window to create.
-
-### SbWindowRect ###
-
-Defines a rectangle via a point `(x, y)` and a size `(width, height)`. This
-structure is used as output for SbWindowGetOnScreenKeyboardBoundingRect.
-
-#### Members ####
-
-*   `float x`
-*   `float y`
-*   `float width`
-*   `float height`
-
-### SbWindowSize ###
-
-The size of a window in graphics rendering coordinates. The width and height of
-a window should correspond to the size of the graphics surface used for drawing
-that would be created to back that window.
-
-#### Members ####
-
-*   `int width`
-
-    The width of the window in graphics pixels.
-*   `int height`
-
-    The height of the window in graphics pixels.
-*   `float video_pixel_ratio`
-
-    The ratio of video pixels to graphics pixels. This ratio must be applied
-    equally to width and height, meaning the aspect ratio is maintained.
-
-    A value of 1.0f means the video resolution is the same as the graphics
-    resolution. This is the most common case.
-
-    Values greater than 1.0f mean that the video resolution is higher (denser,
-    larger) than the graphics resolution. This is a common case as devices often
-    have more video decoding capabilities than graphics rendering capabilities
-    (or memory, etc...).
-
-    Values less than 1.0f mean that the maximum video resolution is smaller than
-    the graphics resolution.
-
-    A value of 0.0f means the ratio could not be determined, it should be
-    assumed to be the same as the graphics resolution (i.e. 1.0f).
-
-## Functions ##
-
-### SbWindowBlurOnScreenKeyboard ###
-
-Blur the on screen keyboard. Fire kSbEventTypeOnScreenKeyboardBlurred.
-kSbEventTypeOnScreenKeyboardBlurred has data `ticket`. Calling
-SbWindowBlurOnScreenKeyboard() when the keyboard is already blurred is
-permitted. Calling SbWindowBlurOnScreenKeyboard while the on screen keyboard is
-not showing does nothing and does not fire any event.
-
-#### Declaration ####
-
-```
-void SbWindowBlurOnScreenKeyboard(SbWindow window, int ticket)
-```
-
-### SbWindowCreate ###
-
-Creates and returns a new system window with the given `options`, which may be
-`NULL`. The function returns `kSbWindowInvalid` if it cannot create the
-requested `SbWindow` due to policy, unsatisfiable options, or any other reason.
-
-If `options` are not specified, this function uses all defaults, which must work
-on every platform. In general, it defaults to creating a fullscreen window at
-the highest 16:9 resolution possible. If the platform does not support
-fullscreen windows, then it creates a normal, windowed window.
-
-Some devices are fullscreen-only, including many production targets for
-Starboard. In those cases, only one SbWindow may be created, and it must be
-fullscreen. Additionally, in those cases, the requested size will actually be
-the requested resolution.
-
-An SbWindow must be created to receive window-based events, like input events,
-even on fullscreen-only devices. These events are dispatched to the Starboard
-entry point.
-
-`options`: Options that specify parameters for the window being created.
-
-#### Declaration ####
-
-```
-SbWindow SbWindowCreate(const SbWindowOptions *options)
-```
-
-### SbWindowDestroy ###
-
-Destroys `window`, reclaiming associated resources.
-
-`window`: The `SbWindow` to destroy.
-
-#### Declaration ####
-
-```
-bool SbWindowDestroy(SbWindow window)
-```
-
-### SbWindowFocusOnScreenKeyboard ###
-
-Focus the on screen keyboard. Fire kSbEventTypeOnScreenKeyboardFocused.
-kSbEventTypeOnScreenKeyboardFocused has data `ticket`. Calling
-SbWindowFocusOnScreenKeyboard() when the keyboard is already focused is
-permitted. Calling SbWindowFocusOnScreenKeyboard while the on screen keyboard is
-not showing does nothing and does not fire any event.
-
-#### Declaration ####
-
-```
-void SbWindowFocusOnScreenKeyboard(SbWindow window, int ticket)
-```
-
-### SbWindowGetDiagonalSizeInInches ###
-
-Gets the size of the diagonal between two opposing screen corners.
-
-A return value of 0 means that starboard does not know what the screen diagonal
-is.
-
-#### Declaration ####
-
-```
-float SbWindowGetDiagonalSizeInInches(SbWindow window)
-```
-
-### SbWindowGetOnScreenKeyboardBoundingRect ###
-
-Get the rectangle of the on screen keyboard in screen pixel coordinates. Return
-`true` if successful. Return `false` if the on screen keyboard is not showing.
-If the function returns `false`, then `rect` will not have been modified.
-
-#### Declaration ####
-
-```
-bool SbWindowGetOnScreenKeyboardBoundingRect(SbWindow window, SbWindowRect *bounding_rect)
-```
-
-### SbWindowGetPlatformHandle ###
-
-Gets the platform-specific handle for `window`, which can be passed as an
-EGLNativeWindowType to initialize EGL/GLES. This return value is entirely
-platform-specific, so there are no constraints about expected ranges.
-
-`window`: The SbWindow to retrieve the platform handle for.
-
-#### Declaration ####
-
-```
-void* SbWindowGetPlatformHandle(SbWindow window)
-```
-
-### SbWindowGetSize ###
-
-Retrieves the dimensions of `window` and sets `size` accordingly. This function
-returns `true` if it completes successfully. If the function returns `false`,
-then `size` will not have been modified.
-
-`window`: The SbWindow to retrieve the size of. `size`: The retrieved size.
-
-#### Declaration ####
-
-```
-bool SbWindowGetSize(SbWindow window, SbWindowSize *size)
-```
-
-### SbWindowHideOnScreenKeyboard ###
-
-Hide the on screen keyboard. Fire kSbEventTypeWindowSizeChange and
-kSbEventTypeOnScreenKeyboardHidden if necessary.
-kSbEventTypeOnScreenKeyboardHidden has data `ticket`. Calling
-SbWindowHideOnScreenKeyboard() when the keyboard is already hidden is permitted.
-
-#### Declaration ####
-
-```
-void SbWindowHideOnScreenKeyboard(SbWindow window, int ticket)
-```
-
-### SbWindowIsOnScreenKeyboardShown ###
-
-Determine if the on screen keyboard is shown.
-
-#### Declaration ####
-
-```
-bool SbWindowIsOnScreenKeyboardShown(SbWindow window)
-```
-
-### SbWindowIsValid ###
-
-Returns whether the given window handle is valid.
-
-#### Declaration ####
-
-```
-static bool SbWindowIsValid(SbWindow window)
-```
-
-### SbWindowSetDefaultOptions ###
-
-Sets the default options for system windows.
-
-`options`: The option values to use as default values. This object must not be
-`NULL`.
-
-#### Declaration ####
-
-```
-void SbWindowSetDefaultOptions(SbWindowOptions *options)
-```
-
-### SbWindowSetOnScreenKeyboardKeepFocus ###
-
-Notify the system that `keepFocus` has been set for the OnScreenKeyboard.
-`keepFocus` true indicates that the user may not navigate focus off of the
-OnScreenKeyboard via input; focus may only be moved via events sent by the app.
-`keepFocus` false indicates that the user may navigate focus off of the
-OnScreenKeyboard via input. `keepFocus` is initialized to false in the
-OnScreenKeyboard constructor.
-
-#### Declaration ####
-
-```
-void SbWindowSetOnScreenKeyboardKeepFocus(SbWindow window, bool keep_focus)
-```
-
-### SbWindowShowOnScreenKeyboard ###
-
-Show the on screen keyboard and populate the input with text `input_text`. Fire
-kSbEventTypeWindowSizeChange and kSbEventTypeOnScreenKeyboardShown if necessary.
-kSbEventTypeOnScreenKeyboardShown has data `ticket`. The passed in `input_text`
-will never be NULL, but may be an empty string. Calling
-SbWindowShowOnScreenKeyboard() when the keyboard is already shown is permitted,
-and the input will be replaced with `input_text`. Showing the on screen keyboard
-does not give it focus.
-
-#### Declaration ####
-
-```
-void SbWindowShowOnScreenKeyboard(SbWindow window, const char *input_text, int ticket)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/accessibility.md b/src/cobalt/site/docs/reference/starboard/modules/6/accessibility.md
deleted file mode 100644
index 7e94192..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/accessibility.md
+++ /dev/null
@@ -1,254 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: accessibility.h"
----
-
-Provides access to the system options and settings related to accessibility.
-
-## Enums ##
-
-### SbAccessibilityCaptionCharacterEdgeStyle ###
-
-Enum for possible closed captioning character edge styles.
-
-#### Values ####
-
-*   `kSbAccessibilityCaptionCharacterEdgeStyleNone`
-*   `kSbAccessibilityCaptionCharacterEdgeStyleRaised`
-*   `kSbAccessibilityCaptionCharacterEdgeStyleDepressed`
-*   `kSbAccessibilityCaptionCharacterEdgeStyleUniform`
-*   `kSbAccessibilityCaptionCharacterEdgeStyleDropShadow`
-
-### SbAccessibilityCaptionColor ###
-
-Enum for possible closed captioning colors.
-
-#### Values ####
-
-*   `kSbAccessibilityCaptionColorBlue`
-*   `kSbAccessibilityCaptionColorBlack`
-*   `kSbAccessibilityCaptionColorCyan`
-*   `kSbAccessibilityCaptionColorGreen`
-*   `kSbAccessibilityCaptionColorMagenta`
-*   `kSbAccessibilityCaptionColorRed`
-*   `kSbAccessibilityCaptionColorWhite`
-*   `kSbAccessibilityCaptionColorYellow`
-
-### SbAccessibilityCaptionFontFamily ###
-
-Enum for possible closed captioning font families
-
-#### Values ####
-
-*   `kSbAccessibilityCaptionFontFamilyCasual`
-*   `kSbAccessibilityCaptionFontFamilyCursive`
-*   `kSbAccessibilityCaptionFontFamilyMonospaceSansSerif`
-*   `kSbAccessibilityCaptionFontFamilyMonospaceSerif`
-*   `kSbAccessibilityCaptionFontFamilyProportionalSansSerif`
-*   `kSbAccessibilityCaptionFontFamilyProportionalSerif`
-*   `kSbAccessibilityCaptionFontFamilySmallCapitals`
-
-### SbAccessibilityCaptionFontSizePercentage ###
-
-Enum for possible closed captioning font size percentages.
-
-#### Values ####
-
-*   `kSbAccessibilityCaptionFontSizePercentage25`
-*   `kSbAccessibilityCaptionFontSizePercentage50`
-*   `kSbAccessibilityCaptionFontSizePercentage75`
-*   `kSbAccessibilityCaptionFontSizePercentage100`
-*   `kSbAccessibilityCaptionFontSizePercentage125`
-*   `kSbAccessibilityCaptionFontSizePercentage150`
-*   `kSbAccessibilityCaptionFontSizePercentage175`
-*   `kSbAccessibilityCaptionFontSizePercentage200`
-*   `kSbAccessibilityCaptionFontSizePercentage225`
-*   `kSbAccessibilityCaptionFontSizePercentage250`
-*   `kSbAccessibilityCaptionFontSizePercentage275`
-*   `kSbAccessibilityCaptionFontSizePercentage300`
-
-### SbAccessibilityCaptionOpacityPercentage ###
-
-Enum for possible closed captioning opacity percentages.
-
-#### Values ####
-
-*   `kSbAccessibilityCaptionOpacityPercentage0`
-*   `kSbAccessibilityCaptionOpacityPercentage25`
-*   `kSbAccessibilityCaptionOpacityPercentage50`
-*   `kSbAccessibilityCaptionOpacityPercentage75`
-*   `kSbAccessibilityCaptionOpacityPercentage100`
-
-### SbAccessibilityCaptionState ###
-
-Enum for possible states of closed captioning properties.
-
-#### Values ####
-
-*   `kSbAccessibilityCaptionStateUnsupported`
-
-    The property is not supported by the system. The application should provide
-    a way to set this property, otherwise it will not be changeable. For any
-    given closed captioning property, if its corresponding state property has a
-    value of `kSbAccessibilityCaptionStateUnsupported`, then its own value is
-    undefined. For example, if
-    `SbAccessibilityCaptionColor::background_color_state` has a value of
-    `kSbAccessibilityCaptionStateUnsupported`, then the value of
-    `SbAccessibilityCaptionColor::background_color` is undefined.
-*   `kSbAccessibilityCaptionStateUnset`
-
-    The property is supported by the system, but the user has not set it. The
-    application should provide a default setting for the property to handle this
-    case.
-*   `kSbAccessibilityCaptionStateSet`
-
-    The user has set this property as a system default, meaning that it should
-    take priority over app defaults. If
-    SbAccessibilityCaptionSettings.supportsOverride contains true, this value
-    should be interpreted as explicitly saying "do not override." If it contains
-    false, it is up to the application to intepret any additional meaning of
-    this value.
-*   `kSbAccessibilityCaptionStateOverride`
-
-    This property should take priority over everything but application-level
-    overrides, including video caption data. If
-    SbAccessibilityCaptionSettings.supportsOverride contains false, then no
-    fields of SbAccessibilityCaptionSettings will ever contain this value.
-
-## Structs ##
-
-### SbAccessibilityCaptionSettings ###
-
-A group of settings related to system-level closed captioning settings, for
-platforms that expose closed captioning settings.
-
-#### Members ####
-
-*   `SbAccessibilityCaptionColor background_color`
-*   `SbAccessibilityCaptionState background_color_state`
-*   `SbAccessibilityCaptionOpacityPercentage background_opacity`
-*   `SbAccessibilityCaptionState background_opacity_state`
-*   `SbAccessibilityCaptionCharacterEdgeStyle character_edge_style`
-*   `SbAccessibilityCaptionState character_edge_style_state`
-*   `SbAccessibilityCaptionColor font_color`
-*   `SbAccessibilityCaptionState font_color_state`
-*   `SbAccessibilityCaptionFontFamily font_family`
-*   `SbAccessibilityCaptionState font_family_state`
-*   `SbAccessibilityCaptionOpacityPercentage font_opacity`
-*   `SbAccessibilityCaptionState font_opacity_state`
-*   `SbAccessibilityCaptionFontSizePercentage font_size`
-*   `SbAccessibilityCaptionState font_size_state`
-*   `SbAccessibilityCaptionColor window_color`
-*   `SbAccessibilityCaptionState window_color_state`
-*   `SbAccessibilityCaptionOpacityPercentage window_opacity`
-*   `SbAccessibilityCaptionState window_opacity_state`
-*   `bool is_enabled`
-
-    The `is_enabled` attribute determines if the user has chosen to enable
-    closed captions on their system.
-*   `bool supports_is_enabled`
-
-    Some platforms support enabling or disabling captions, some support reading
-    whether they are enabled from the system settings, and others support
-    neither. As a result, there are separate checks for getting and setting the
-    value that is contained in the `is_enabled` attribute. Modifying the
-    attribute via `SbAccessibilitySetCaptionsEnabled` will change the setting
-    system-wide. Attemping to read `is_enabled` when the value of
-    `supports_is_enabled` is false will always return false. Attemping to set
-    `is_enabled` via `SbAccessibilitySetCaptionsEnabled` when the value of
-    `supports_set_enabled` is false will fail silently.
-*   `bool supports_set_enabled`
-*   `bool supports_override`
-
-    Some platforms may specify that when setting a property, it should override
-    data from video streams and application settings (unless the application has
-    its own overrides). Depending on whether this attribute contains true or
-    false, the values of `SbAccessibilityCaptionState` should be interpreted
-    differently.
-
-### SbAccessibilityDisplaySettings ###
-
-#### Members ####
-
-*   `bool has_high_contrast_text_setting`
-
-    Whether this platform has a system setting for high contrast text or not.
-*   `bool is_high_contrast_text_enabled`
-
-    Whether the high contrast text setting is enabled or not.
-
-### SbAccessibilityTextToSpeechSettings ###
-
-A group of settings related to text-to-speech functionality, for platforms that
-expose system settings for text-to-speech.
-
-#### Members ####
-
-*   `bool has_text_to_speech_setting`
-
-    Whether this platform has a system setting for text-to-speech or not.
-*   `bool is_text_to_speech_enabled`
-
-    Whether the text-to-speech setting is enabled or not. This setting is only
-    valid if `has_text_to_speech_setting` is set to true.
-
-## Functions ##
-
-### SbAccessibilityGetCaptionSettings ###
-
-Get the platform's settings for system-level closed captions. This function
-returns false if `caption_settings` is NULL or if it is not zero-initialized.
-
-`caption_settings`: A pointer to a zero-initialized
-SbAccessibilityTextToSpeechSettings struct.
-
-#### Declaration ####
-
-```
-bool SbAccessibilityGetCaptionSettings(SbAccessibilityCaptionSettings *caption_settings)
-```
-
-### SbAccessibilityGetDisplaySettings ###
-
-Get the platform settings related to high contrast text. This function returns
-false if `out_settings` is NULL or if it is not zero-initialized.
-
-`out_settings`: A pointer to a zero-initialized SbAccessibilityDisplaySettings*
-struct.
-
-#### Declaration ####
-
-```
-bool SbAccessibilityGetDisplaySettings(SbAccessibilityDisplaySettings *out_settings)
-```
-
-### SbAccessibilityGetTextToSpeechSettings ###
-
-Get the platform settings related to the text-to-speech accessibility feature.
-This function returns false if `out_settings` is NULL or if it is not zero-
-initialized.
-
-`out_settings`: A pointer to a zero-initialized
-SbAccessibilityTextToSpeechSettings struct.
-
-#### Declaration ####
-
-```
-bool SbAccessibilityGetTextToSpeechSettings(SbAccessibilityTextToSpeechSettings *out_settings)
-```
-
-### SbAccessibilitySetCaptionsEnabled ###
-
-Modifies whether closed captions are enabled at a system level. This function
-returns false if this feature is not supported by the platform, or if changing
-the setting is unsuccessful. This function will modify the setting system-wide.
-
-`enabled`: A boolean indicating whether captions should be turned on (true) or
-off (false).
-
-#### Declaration ####
-
-```
-bool SbAccessibilitySetCaptionsEnabled(bool enabled)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/atomic.md b/src/cobalt/site/docs/reference/starboard/modules/6/atomic.md
deleted file mode 100644
index 49faa7f..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/atomic.md
+++ /dev/null
@@ -1,101 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: atomic.h"
----
-
-Defines a set of atomic integer operations that can be used as lightweight
-synchronization or as building blocks for heavier synchronization primitives.
-Their use is very subtle and requires detailed understanding of the behavior of
-supported architectures, so their direct use is not recommended except when
-rigorously deemed absolutely necessary for performance reasons.
-
-## Typedefs ##
-
-### SbAtomic64 ###
-
-64-bit atomic operations (only available on 64-bit processors).
-
-#### Definition ####
-
-```
-typedef int64_t SbAtomic64
-```
-
-### SbAtomicPtr ###
-
-Pointer-sized atomic operations. Forwards to either 32-bit or 64-bit functions
-as appropriate.
-
-#### Definition ####
-
-```
-typedef SbAtomic64 SbAtomicPtr
-```
-
-## Functions ##
-
-### SbAtomicAcquire_CompareAndSwap ###
-
-These following lower-level operations are typically useful only to people
-implementing higher-level synchronization operations like spinlocks, mutexes,
-and condition-variables. They combine CompareAndSwap(), a load, or a store with
-appropriate memory-ordering instructions. "Acquire" operations ensure that no
-later memory access can be reordered ahead of the operation. "Release"
-operations ensure that no previous memory access can be reordered after the
-operation. "Barrier" operations have both "Acquire" and "Release" semantics. A
-SbAtomicMemoryBarrier() has "Barrier" semantics, but does no memory access.
-
-#### Declaration ####
-
-```
-static SbAtomic32 SbAtomicAcquire_CompareAndSwap(volatile SbAtomic32 *ptr, SbAtomic32 old_value, SbAtomic32 new_value)
-```
-
-### SbAtomicBarrier_Increment ###
-
-Same as SbAtomicNoBarrier_Increment, but with a memory barrier.
-
-#### Declaration ####
-
-```
-static SbAtomic32 SbAtomicBarrier_Increment(volatile SbAtomic32 *ptr, SbAtomic32 increment)
-```
-
-### SbAtomicNoBarrier_CompareAndSwap ###
-
-Atomically execute: result = *ptr; if (*ptr == old_value) *ptr = new_value;
-return result;
-
-I.e., replace "*ptr" with "new_value" if "*ptr" used to be "old_value". Always
-return the old value of "*ptr"
-
-This routine implies no memory barriers.
-
-#### Declaration ####
-
-```
-static SbAtomic32 SbAtomicNoBarrier_CompareAndSwap(volatile SbAtomic32 *ptr, SbAtomic32 old_value, SbAtomic32 new_value)
-```
-
-### SbAtomicNoBarrier_Exchange ###
-
-Atomically store new_value into *ptr, returning the previous value held in *ptr.
-This routine implies no memory barriers.
-
-#### Declaration ####
-
-```
-static SbAtomic32 SbAtomicNoBarrier_Exchange(volatile SbAtomic32 *ptr, SbAtomic32 new_value)
-```
-
-### SbAtomicNoBarrier_Increment ###
-
-Atomically increment *ptr by "increment". Returns the new value of *ptr with the
-increment applied. This routine implies no memory barriers.
-
-#### Declaration ####
-
-```
-static SbAtomic32 SbAtomicNoBarrier_Increment(volatile SbAtomic32 *ptr, SbAtomic32 increment)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/audio_sink.md b/src/cobalt/site/docs/reference/starboard/modules/6/audio_sink.md
deleted file mode 100644
index c3c1cf7..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/audio_sink.md
+++ /dev/null
@@ -1,152 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: audio_sink.h"
----
-
-Provides an interface to output raw audio data.
-
-## Macros ##
-
-### kSbAudioSinkInvalid ###
-
-Well-defined value for an invalid audio sink.
-
-## Typedefs ##
-
-### SbAudioSink ###
-
-An opaque handle to an implementation-private structure representing an audio
-sink.
-
-#### Definition ####
-
-```
-typedef struct SbAudioSinkPrivate* SbAudioSink
-```
-
-### SbAudioSinkConsumeFramesFunc ###
-
-Callback used to report frames consumed. The consumed frames will be removed
-from the source frame buffer to free space for new audio frames.When
-`frames_consumed` is updated asynchnously and the last time that it has been
-updated is known, it can be passed in `frames_consumed_at` so the audio time
-calculating can be more accurate.
-
-#### Definition ####
-
-```
-typedef void(* SbAudioSinkConsumeFramesFunc) (int frames_consumed, SbTime frames_consumed_at, void *context)
-```
-
-### SbAudioSinkFrameBuffers ###
-
-An array of frame buffers. For interleaved audio streams, there will be only one
-element in the array. For planar audio streams, the number of elements in the
-array equal to the number of channels.
-
-#### Definition ####
-
-```
-typedef void** SbAudioSinkFrameBuffers
-```
-
-### SbAudioSinkUpdateSourceStatusFunc ###
-
-Callback being called periodically to retrieve the status of the audio source.
-The first two output parameters indicating the filling level of the audio frame
-buffer passed to SbAudioSinkCreate as `frame_buffers`. As `frame_buffers` is a
-circular buffer, `offset_in_frames` can be used to calculate the number of
-continuous frames towards the end of the buffer. The audio sink can play the
-frames only when `is_playing` is true. It should pause the playback when
-`is_playing` is false. The audio sink may cache certain amount of audio frames
-before start playback. It will start playback immediately when `is_eos_reached`
-is true even if the amount of cached audio frames are not enough as no more
-frames will be appended into the buffer when `is_eos_reached` is true. It is
-possible for a host to set `is_eos_reached` to false after setting it to true,
-usually this is caused by a seek. All parameters except `context` cannot be
-NULL. Note that this function only reports the status of the source, it doesn't
-remove audio data from the source frame buffer.
-
-#### Definition ####
-
-```
-typedef void(* SbAudioSinkUpdateSourceStatusFunc) (int *frames_in_buffer, int *offset_in_frames, bool *is_playing, bool *is_eos_reached, void *context)
-```
-
-## Functions ##
-
-### SbAudioSinkDestroy ###
-
-Destroys `audio_sink`, freeing all associated resources. Before returning, the
-function waits until all callbacks that are in progress have finished. After the
-function returns, no further calls are made callbacks passed into
-SbAudioSinkCreate. In addition, you can not pass `audio_sink` to any other
-SbAudioSink functions after SbAudioSinkDestroy has been called on it.
-
-This function can be called on any thread. However, it cannot be called within
-any of the callbacks passed into SbAudioSinkCreate.
-
-`audio_sink`: The audio sink to destroy.
-
-#### Declaration ####
-
-```
-void SbAudioSinkDestroy(SbAudioSink audio_sink)
-```
-
-### SbAudioSinkGetMaxChannels ###
-
-Returns the maximum number of channels supported on the platform. For example,
-the number would be `2` if the platform only supports stereo.
-
-#### Declaration ####
-
-```
-int SbAudioSinkGetMaxChannels()
-```
-
-### SbAudioSinkGetNearestSupportedSampleFrequency ###
-
-Returns the supported sample rate closest to `sampling_frequency_hz`. On
-platforms that don't support all sample rates, it is the caller's responsibility
-to resample the audio frames into the supported sample rate returned by this
-function.
-
-#### Declaration ####
-
-```
-int SbAudioSinkGetNearestSupportedSampleFrequency(int sampling_frequency_hz)
-```
-
-### SbAudioSinkIsAudioFrameStorageTypeSupported ###
-
-Indicates whether `audio_frame_storage_type` is supported on this platform.
-
-#### Declaration ####
-
-```
-bool SbAudioSinkIsAudioFrameStorageTypeSupported(SbMediaAudioFrameStorageType audio_frame_storage_type)
-```
-
-### SbAudioSinkIsAudioSampleTypeSupported ###
-
-Indicates whether `audio_sample_type` is supported on this platform.
-
-#### Declaration ####
-
-```
-bool SbAudioSinkIsAudioSampleTypeSupported(SbMediaAudioSampleType audio_sample_type)
-```
-
-### SbAudioSinkIsValid ###
-
-Indicates whether the given audio sink handle is valid.
-
-`audio_sink`: The audio sink handle to check.
-
-#### Declaration ####
-
-```
-bool SbAudioSinkIsValid(SbAudioSink audio_sink)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/blitter.md b/src/cobalt/site/docs/reference/starboard/modules/6/blitter.md
deleted file mode 100644
index 00d40a7..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/blitter.md
+++ /dev/null
@@ -1,921 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: blitter.h"
----
-
-The Blitter API provides support for issuing simple blit-style draw commands to
-either an offscreen surface or to a Starboard `SbWindow` object. Blitter is
-jargon that means "BLock Transfer," which might be abbreviated as BLT and,
-hence, the word "blit."
-
-This API is designed to allow implementations make use of GPU hardware
-acceleration, if it is available. Draw commands exist for solid-color rectangles
-and rasterization/blitting of rectangular images onto rectangular target
-patches.
-
-## Threading Concerns ##
-
-Note that in general the Blitter API is not thread safe, except for all
-`SbBlitterDevice`-related functions. All functions that are not required to
-internally ensure any thread safety guarantees are prefaced with a comment
-indicating that they are not thread safe.
-
-Functions which claim to not be thread safe can still be used from multiple
-threads, but manual synchronization must be performed in order to ensure their
-parameters are not referenced at the same time on another thread by another
-function.
-
-### Examples ###
-
-*   Multiple threads should not issue commands to the same `SbBlitterContext`
-    object unless they are manually synchronized.
-
-*   Multiple threads should not issue draw calls to the same render target, even
-    if the draw calls are made within separate contexts. In this case, be sure
-    to manually synchronize through the use of syncrhonization primitives and
-    use of the `SbBlitterFlushContext()` command.
-
-*   Multiple threads can operate on the swap chain, but they must perform manual
-    synchronization.
-
-## Enums ##
-
-### SbBlitterPixelDataFormat ###
-
-Defines the set of pixel formats that can be used with the Blitter API
-`SbBlitterPixelData` objects. Note that not all of these formats are guaranteed
-to be supported by a particular device, so before using these formats in pixel
-data creation commands, it should be checked that they are supported first (e.g.
-via `SbBlitterIsPixelFormatSupportedByPixelData()`). `SbBlitterPixelDataFormat`
-specifies specific orderings of the color channels, and when doing so, byte-
-order is used, e.g. "RGBA" implies that a value for red is stored in the byte
-with the lowest memory address. All pixel values are assumed to be in
-premultiplied alpha format.
-
-#### Values ####
-
-*   `kSbBlitterPixelDataFormatARGB8`
-
-    32-bit pixels with 8-bits per channel, the alpha component in the byte with
-    the lowest address and blue in the byte with the highest address.
-*   `kSbBlitterPixelDataFormatBGRA8`
-
-    32-bit pixels with 8-bits per channel, the blue component in the byte with
-    the lowest address and alpha in the byte with the highest address.
-*   `kSbBlitterPixelDataFormatRGBA8`
-
-    32-bit pixels with 8-bits per channel, the red component in the byte with
-    the lowest address and alpha in the byte with the highest address.
-*   `kSbBlitterPixelDataFormatA8`
-
-    8-bit pixels that contain only a single alpha channel. When rendered,
-    surfaces in this format will have `(R, G, B)` values of `(255, 255, 255)`.
-*   `kSbBlitterNumPixelDataFormats`
-
-    Constant that indicates how many unique pixel formats Starboard supports.
-*   `kSbBlitterInvalidPixelDataFormat`
-
-### SbBlitterSurfaceFormat ###
-
-Enumeration that describes the color format of surfaces. Note that
-`SbBlitterSurfaceFormat` does not differentiate between permutations of the
-color channel ordering (e.g. RGBA vs ARGB) since client code will never be able
-to access surface pixels directly. This is the main difference between
-`SbBlitterPixelDataFormat`, which does explicitly dictate an ordering.
-
-#### Values ####
-
-*   `kSbBlitterSurfaceFormatRGBA8`
-
-    32-bit RGBA color, with 8 bits per channel.
-*   `kSbBlitterSurfaceFormatA8`
-
-    8-bit alpha-only color.
-*   `kSbBlitterNumSurfaceFormats`
-
-    Constant that indicates how many unique surface formats Starboard supports.
-*   `kSbBlitterInvalidSurfaceFormat`
-
-## Typedefs ##
-
-### SbBlitterColor ###
-
-A simple 32-bit color representation that is a parameter to many Blitter
-functions.
-
-#### Definition ####
-
-```
-typedef uint32_t SbBlitterColor
-```
-
-## Structs ##
-
-### SbBlitterRect ###
-
-Defines a rectangle via a point `(x, y)` and a size `(width, height)`. This
-structure is used as a parameter type in various blit calls.
-
-#### Members ####
-
-*   `int x`
-*   `int y`
-*   `int width`
-*   `int height`
-
-### SbBlitterSurfaceInfo ###
-
-`SbBlitterSurfaceInfo` collects information about surfaces that can be queried
-from them at any time.
-
-#### Members ####
-
-*   `int width`
-*   `int height`
-*   `SbBlitterSurfaceFormat format`
-
-## Functions ##
-
-### SbBlitterAFromColor ###
-
-Extract alpha from a `SbBlitterColor` object.
-
-#### Declaration ####
-
-```
-static uint8_t SbBlitterAFromColor(SbBlitterColor color)
-```
-
-### SbBlitterBFromColor ###
-
-Extract blue from a `SbBlitterColor` object.
-
-#### Declaration ####
-
-```
-static uint8_t SbBlitterBFromColor(SbBlitterColor color)
-```
-
-### SbBlitterBlitRectToRect ###
-
-Issues a draw call on `context` that blits the area of `source_surface`
-specified by `src_rect` to `context`'s current render target at `dst_rect`. The
-source rectangle must lie within the dimensions of `source_surface`. Note that
-the `source_surface`'s alpha is modulated by `opacity` before being drawn. For
-`opacity`, a value of 0 implies complete invisibility, and a value of 255
-implies complete opacity.
-
-This function is not thread-safe.
-
-The return value indicates whether the draw call succeeded.
-
-`src_rect`: The area to be block transferred (blitted).
-
-#### Declaration ####
-
-```
-bool SbBlitterBlitRectToRect(SbBlitterContext context, SbBlitterSurface source_surface, SbBlitterRect src_rect, SbBlitterRect dst_rect)
-```
-
-### SbBlitterBlitRectToRectTiled ###
-
-This function functions identically to SbBlitterBlitRectToRect(), except it
-permits values of `src_rect` outside the dimensions of `source_surface`. In
-those regions, the pixel data from `source_surface` will be wrapped. Negative
-values for `src_rect.x` and `src_rect.y` are allowed.
-
-The output is all stretched to fit inside of `dst_rect`.
-
-This function is not thread-safe.
-
-The return value indicates whether the draw call succeeded.
-
-#### Declaration ####
-
-```
-bool SbBlitterBlitRectToRectTiled(SbBlitterContext context, SbBlitterSurface source_surface, SbBlitterRect src_rect, SbBlitterRect dst_rect)
-```
-
-### SbBlitterBlitRectsToRects ###
-
-This function achieves the same effect as calling `SbBlitterBlitRectToRect()`
-`num_rects` times with each of the `num_rects` values of `src_rects` and
-`dst_rects`. This function allows for greater efficiency than looped calls to
-`SbBlitterBlitRectToRect()`.
-
-This function is not thread-safe.
-
-The return value indicates whether the draw call succeeded.
-
-#### Declaration ####
-
-```
-bool SbBlitterBlitRectsToRects(SbBlitterContext context, SbBlitterSurface source_surface, const SbBlitterRect *src_rects, const SbBlitterRect *dst_rects, int num_rects)
-```
-
-### SbBlitterBytesPerPixelForFormat ###
-
-A convenience function to return the number of bytes per pixel for a given pixel
-format.
-
-#### Declaration ####
-
-```
-static int SbBlitterBytesPerPixelForFormat(SbBlitterPixelDataFormat format)
-```
-
-### SbBlitterColorFromRGBA ###
-
-A convenience function to create a `SbBlitterColor` object from separate 8-bit
-RGBA components.
-
-#### Declaration ####
-
-```
-static SbBlitterColor SbBlitterColorFromRGBA(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
-```
-
-### SbBlitterCreateContext ###
-
-Creates an `SbBlitterContext` object on `device`. The returned context can be
-used to set up draw state and issue draw calls.
-
-Note that there is a limit on the number of contexts that can exist
-simultaneously, which can be queried by calling `SbBlitterGetMaxContexts()`.
-(The limit is often `1`.)
-
-`SbBlitterContext` objects keep track of draw state between a series of draw
-calls. Please refer to the `SbBlitterContext()` definition for more information
-about contexts.
-
-This function is thread-safe.
-
-This function returns `kSbBlitterInvalidContext` upon failure. Note that the
-function fails if it has already been used to create the maximum number of
-contexts.
-
-`device`: The `SbBlitterDevice` for which the `SbBlitterContext` object is
-created.
-
-#### Declaration ####
-
-```
-SbBlitterContext SbBlitterCreateContext(SbBlitterDevice device)
-```
-
-### SbBlitterCreateDefaultDevice ###
-
-Creates and returns an `SbBlitterDevice` based on the Blitter API
-implementation's decision of which device should be the default. The returned
-`SbBlitterDevice` represents a connection to a device (like a GPU).
-
-On many platforms there is always one single obvious choice for a device to use,
-and that is the one that this function will return. For example, if this is
-called on a platform that has a single GPU, this call should return an object
-that represents that GPU. On a platform that has no GPU, an object representing
-a software CPU implementation may be returned.
-
-Only one default device can exist within a process at a time. This function is
-thread-safe.
-
-Returns `kSbBlitterInvalidDevice` on failure.
-
-#### Declaration ####
-
-```
-SbBlitterDevice SbBlitterCreateDefaultDevice()
-```
-
-### SbBlitterCreatePixelData ###
-
-Allocates an `SbBlitterPixelData` object through `device` with `width`, `height`
-and `pixel_format`. `pixel_format` must be supported by `device` (see
-`SbBlitterIsPixelFormatSupportedByPixelData()`).
-
-This function is thread-safe.
-
-Calling this function results in the allocation of CPU-accessible (though
-perhaps blitter-device-resident) memory to store pixel data of the requested
-size/format. An `SbBlitterPixelData` object should eventually be passed either
-into a call to `SbBlitterCreateSurfaceFromPixelData()` or into a call to
-`SbBlitterDestroyPixelData()`.
-
-Returns `kSbBlitterInvalidPixelData` upon failure.
-
-#### Declaration ####
-
-```
-SbBlitterPixelData SbBlitterCreatePixelData(SbBlitterDevice device, int width, int height, SbBlitterPixelDataFormat pixel_format)
-```
-
-### SbBlitterCreateRenderTargetSurface ###
-
-Creates a new surface with undefined pixel data on `device` with the specified
-`width`, `height` and `surface_format`. One can set the pixel data on the
-resulting surface by getting its associated SbBlitterRenderTarget object and
-then calling `SbBlitterGetRenderTargetFromSurface()`.
-
-This function is thread-safe.
-
-Returns `kSbBlitterInvalidSurface` upon failure.
-
-#### Declaration ####
-
-```
-SbBlitterSurface SbBlitterCreateRenderTargetSurface(SbBlitterDevice device, int width, int height, SbBlitterSurfaceFormat surface_format)
-```
-
-### SbBlitterCreateSurfaceFromPixelData ###
-
-Creates an `SbBlitterSurface` object on `device`. Note that `device` must match
-the device that was used to create the `SbBlitterPixelData` object provided via
-the `pixel_data` parameter.
-
-This function also destroys the input `pixel_data` object. As a result,
-`pixel_data` should not be accessed again after a call to this function.
-
-The returned object cannot be used as a render target (e.g. calling
-`SbBlitterGetRenderTargetFromSurface()` on it will return
-`kSbBlitterInvalidRenderTarget`).
-
-This function is thread-safe with respect to `device`, but `pixel_data` should
-not be modified on another thread while this function is called.
-
-Returns `kSbBlitterInvalidSurface` in the event of an error.
-
-#### Declaration ####
-
-```
-SbBlitterSurface SbBlitterCreateSurfaceFromPixelData(SbBlitterDevice device, SbBlitterPixelData pixel_data)
-```
-
-### SbBlitterCreateSwapChainFromWindow ###
-
-Creates and returns an `SbBlitterSwapChain` that can then be used to send
-graphics to the display. This function links `device` to `window`'s output, and
-drawing to the returned swap chain will result in `device` being used to render
-to `window`.
-
-This function must be called from the thread that called `SbWindowCreate()` to
-create `window`.
-
-Returns `kSbBlitterInvalidSwapChain` on failure.
-
-#### Declaration ####
-
-```
-SbBlitterSwapChain SbBlitterCreateSwapChainFromWindow(SbBlitterDevice device, SbWindow window)
-```
-
-### SbBlitterDestroyContext ###
-
-Destroys the specified `context`, freeing all its resources.
-
-This function is not thread-safe.
-
-The return value indicates whether the destruction succeeded.
-
-`context`: The object to be destroyed.
-
-#### Declaration ####
-
-```
-bool SbBlitterDestroyContext(SbBlitterContext context)
-```
-
-### SbBlitterDestroyDevice ###
-
-Destroys `device`, cleaning up all resources associated with it. This function
-is thread-safe, but it should not be called if `device` is still being accessed
-elsewhere.
-
-The return value indicates whether the destruction succeeded.
-
-`device`: The SbBlitterDevice object to be destroyed.
-
-#### Declaration ####
-
-```
-bool SbBlitterDestroyDevice(SbBlitterDevice device)
-```
-
-### SbBlitterDestroyPixelData ###
-
-Destroys `pixel_data`. Note that this function does not need to be called and
-should not be called if `SbBlitterCreateSurfaceFromPixelData()` has been called
-on `pixel_data` before.
-
-This function is thread-safe.
-
-The return value indicates whether the destruction succeeded.
-
-`pixel_data`: The object to be destroyed.
-
-#### Declaration ####
-
-```
-bool SbBlitterDestroyPixelData(SbBlitterPixelData pixel_data)
-```
-
-### SbBlitterDestroySurface ###
-
-Destroys the `surface` object, cleaning up all resources associated with it.
-
-This function is not thread safe.
-
-The return value indicates whether the destruction succeeded.
-
-`surface`: The object to be destroyed.
-
-#### Declaration ####
-
-```
-bool SbBlitterDestroySurface(SbBlitterSurface surface)
-```
-
-### SbBlitterDestroySwapChain ###
-
-Destroys `swap_chain`, cleaning up all resources associated with it. This
-function is not thread-safe and must be called on the same thread that called
-`SbBlitterCreateSwapChainFromWindow()`.
-
-The return value indicates whether the destruction succeeded.
-
-`swap_chain`: The SbBlitterSwapChain to be destroyed.
-
-#### Declaration ####
-
-```
-bool SbBlitterDestroySwapChain(SbBlitterSwapChain swap_chain)
-```
-
-### SbBlitterDownloadSurfacePixels ###
-
-Downloads `surface` pixel data into CPU memory pointed to by `out_pixel_data`,
-formatted according to the requested `pixel_format` and the requested
-`pitch_in_bytes`. Before calling this function, you can call
-`SbBlitterIsPixelFormatSupportedByDownloadSurfacePixels()` to confirm that
-`pixel_format` is, in fact, valid for `surface`.
-
-When this function is called, it first waits for all previously flushed graphics
-commands to be executed by the device before downloading the data. Since this
-function waits for the pipeline to empty, it should be used sparingly, such as
-within in debug or test environments.
-
-The return value indicates whether the pixel data was downloaded successfully.
-
-The returned alpha format is premultiplied.
-
-This function is not thread-safe.
-
-`out_pixel_data`: A pointer to a region of memory with a size of surface_height
-* `pitch_in_bytes` bytes.
-
-#### Declaration ####
-
-```
-bool SbBlitterDownloadSurfacePixels(SbBlitterSurface surface, SbBlitterPixelDataFormat pixel_format, int pitch_in_bytes, void *out_pixel_data)
-```
-
-### SbBlitterFillRect ###
-
-Issues a draw call on `context` that fills the specified rectangle `rect`. The
-rectangle's color is determined by the last call to `SbBlitterSetColor()`.
-
-This function is not thread-safe.
-
-The return value indicates whether the draw call succeeded.
-
-`context`: The context on which the draw call will operate. `rect`: The
-rectangle to be filled.
-
-#### Declaration ####
-
-```
-bool SbBlitterFillRect(SbBlitterContext context, SbBlitterRect rect)
-```
-
-### SbBlitterFlipSwapChain ###
-
-Flips the `swap_chain` by making the buffer previously accessible to draw
-commands via `SbBlitterGetRenderTargetFromSwapChain()` visible on the display,
-while another buffer in an initially undefined state is set up as the new draw
-command target. Note that you do not need to call
-`SbBlitterGetRenderTargetFromSwapChain()` again after flipping, the swap chain's
-render target always refers to its current back buffer.
-
-This function stalls the calling thread until the next vertical refresh. In
-addition, to ensure consistency with the Starboard Player API when rendering
-punch-out video, calls to `SbPlayerSetBounds()` do not take effect until this
-method is called.
-
-The return value indicates whether the flip succeeded.
-
-This function is not thread-safe.
-
-`swap_chain`: The SbBlitterSwapChain to be flipped.
-
-#### Declaration ####
-
-```
-bool SbBlitterFlipSwapChain(SbBlitterSwapChain swap_chain)
-```
-
-### SbBlitterFlushContext ###
-
-Flushes all draw calls previously issued to `context`. Calling this function
-guarantees that the device processes all draw calls issued to this point on this
-`context` before processing any subsequent draw calls on any context.
-
-Before calling `SbBlitterFlipSwapChain()`, it is often prudent to call this
-function to ensure that all draw calls are submitted before the flip occurs.
-
-This function is not thread-safe.
-
-The return value indicates whether the flush succeeded.
-
-`context`: The context for which draw calls are being flushed.
-
-#### Declaration ####
-
-```
-bool SbBlitterFlushContext(SbBlitterContext context)
-```
-
-### SbBlitterGFromColor ###
-
-Extract green from a `SbBlitterColor` object.
-
-#### Declaration ####
-
-```
-static uint8_t SbBlitterGFromColor(SbBlitterColor color)
-```
-
-### SbBlitterGetMaxContexts ###
-
-Returns the maximum number of contexts that `device` can support in parallel.
-Note that devices often support only a single context.
-
-This function is thread-safe.
-
-This function returns `-1` upon failure.
-
-`device`: The SbBlitterDevice for which the maximum number of contexts is
-returned.
-
-#### Declaration ####
-
-```
-int SbBlitterGetMaxContexts(SbBlitterDevice device)
-```
-
-### SbBlitterGetPixelDataPitchInBytes ###
-
-Retrieves the pitch (in bytes) for `pixel_data`. This indicates the number of
-bytes per row of pixel data in the image.
-
-This function is not thread-safe.
-
-Returns `-1` in the event of an error.
-
-`pixel_data`: The object for which you are retrieving the pitch.
-
-#### Declaration ####
-
-```
-int SbBlitterGetPixelDataPitchInBytes(SbBlitterPixelData pixel_data)
-```
-
-### SbBlitterGetPixelDataPointer ###
-
-Retrieves a CPU-accessible pointer to the pixel data represented by
-`pixel_data`. This pixel data can be modified by the CPU to initialize it on the
-CPU before calling `SbBlitterCreateSurfaceFromPixelData()`.
-
-Note that the pointer returned here is valid as long as `pixel_data` is valid,
-which means it is valid until either `SbBlitterCreateSurfaceFromPixelData()` or
-`SbBlitterDestroyPixelData()` is called.
-
-This function is not thread-safe.
-
-Returns `NULL` in the event of an error.
-
-#### Declaration ####
-
-```
-void* SbBlitterGetPixelDataPointer(SbBlitterPixelData pixel_data)
-```
-
-### SbBlitterGetRenderTargetFromSurface ###
-
-Returns the `SbBlitterRenderTarget` object owned by `surface`. The returned
-object can be used as a target for draw calls.
-
-This function returns `kSbBlitterInvalidRenderTarget` if `surface` is not able
-to provide a render target or on any other error.
-
-This function is not thread-safe.
-
-#### Declaration ####
-
-```
-SbBlitterRenderTarget SbBlitterGetRenderTargetFromSurface(SbBlitterSurface surface)
-```
-
-### SbBlitterGetRenderTargetFromSwapChain ###
-
-Returns the `SbBlitterRenderTarget` object that is owned by `swap_chain`. The
-returned object can be used to provide a target to blitter draw calls that draw
-directly to the display buffer. This function is not thread-safe.
-
-Returns `kSbBlitterInvalidRenderTarget` on failure.
-
-`swap_chain`: The SbBlitterSwapChain for which the target object is being
-retrieved.
-
-#### Declaration ####
-
-```
-SbBlitterRenderTarget SbBlitterGetRenderTargetFromSwapChain(SbBlitterSwapChain swap_chain)
-```
-
-### SbBlitterGetSurfaceInfo ###
-
-Retrieves an `SbBlitterSurfaceInfo` structure, which describes immutable
-parameters of the `surface`, such as its width, height and pixel format. The
-results are set on the output parameter `surface_info`, which cannot be `NULL`.
-
-The return value indicates whether the information was retrieved successfully.
-
-This function is not thread-safe.
-
-#### Declaration ####
-
-```
-bool SbBlitterGetSurfaceInfo(SbBlitterSurface surface, SbBlitterSurfaceInfo *surface_info)
-```
-
-### SbBlitterIsContextValid ###
-
-Checks whether a blitter context is invalid.
-
-#### Declaration ####
-
-```
-static bool SbBlitterIsContextValid(SbBlitterContext context)
-```
-
-### SbBlitterIsDeviceValid ###
-
-Checks whether a blitter device is invalid.
-
-#### Declaration ####
-
-```
-static bool SbBlitterIsDeviceValid(SbBlitterDevice device)
-```
-
-### SbBlitterIsPixelDataValid ###
-
-Checks whether a pixel data object is invalid.
-
-#### Declaration ####
-
-```
-static bool SbBlitterIsPixelDataValid(SbBlitterPixelData pixel_data)
-```
-
-### SbBlitterIsPixelFormatSupportedByDownloadSurfacePixels ###
-
-Indicates whether the combination of parameter values is valid for calls to
-`SbBlitterDownloadSurfacePixels()`.
-
-This function is not thread-safe.
-
-`surface`: The surface being checked. `pixel_format`: The pixel format that
-would be used on the surface.
-
-#### Declaration ####
-
-```
-bool SbBlitterIsPixelFormatSupportedByDownloadSurfacePixels(SbBlitterSurface surface, SbBlitterPixelDataFormat pixel_format)
-```
-
-### SbBlitterIsPixelFormatSupportedByPixelData ###
-
-Indicates whether `device` supports calls to `SbBlitterCreatePixelData` with the
-specified `pixel_format`. This function is thread-safe.
-
-`device`: The device for which compatibility is being checked. `pixel_format`:
-The SbBlitterPixelDataFormat for which compatibility is being checked.
-
-#### Declaration ####
-
-```
-bool SbBlitterIsPixelFormatSupportedByPixelData(SbBlitterDevice device, SbBlitterPixelDataFormat pixel_format)
-```
-
-### SbBlitterIsRenderTargetValid ###
-
-Checks whether a render target is invalid.
-
-#### Declaration ####
-
-```
-static bool SbBlitterIsRenderTargetValid(SbBlitterRenderTarget render_target)
-```
-
-### SbBlitterIsSurfaceFormatSupportedByRenderTargetSurface ###
-
-Indicates whether the `device` supports calls to
-`SbBlitterCreateRenderTargetSurface()` with `surface_format`.
-
-This function is thread-safe.
-
-`device`: The device being checked for compatibility. `surface_format`: The
-surface format being checked for compatibility.
-
-#### Declaration ####
-
-```
-bool SbBlitterIsSurfaceFormatSupportedByRenderTargetSurface(SbBlitterDevice device, SbBlitterSurfaceFormat surface_format)
-```
-
-### SbBlitterIsSurfaceValid ###
-
-Checks whether a surface is invalid.
-
-#### Declaration ####
-
-```
-static bool SbBlitterIsSurfaceValid(SbBlitterSurface surface)
-```
-
-### SbBlitterIsSwapChainValid ###
-
-Checks whether a swap chain is invalid.
-
-#### Declaration ####
-
-```
-static bool SbBlitterIsSwapChainValid(SbBlitterSwapChain swap_chain)
-```
-
-### SbBlitterMakeRect ###
-
-Convenience function to setup a rectangle with the specified parameters.
-
-#### Declaration ####
-
-```
-static SbBlitterRect SbBlitterMakeRect(int x, int y, int width, int height)
-```
-
-### SbBlitterPixelDataFormatToSurfaceFormat ###
-
-This function maps SbBlitterPixelDataFormat values to their corresponding
-`SbBlitterSurfaceFormat` value. Note that many `SbBlitterPixelDataFormat`s
-correspond to the same `SbBlitterSurfaceFormat`, so this function is not
-invertible. When creating a `SbBlitterSurface` object from a
-`SbBlitterPixelData` object, the `SbBlitterSurface`'s format will be computed
-from the `SbBlitterPixelData` object by using this function.
-
-#### Declaration ####
-
-```
-static SbBlitterSurfaceFormat SbBlitterPixelDataFormatToSurfaceFormat(SbBlitterPixelDataFormat pixel_format)
-```
-
-### SbBlitterRFromColor ###
-
-Extract red from a `SbBlitterColor` object.
-
-#### Declaration ####
-
-```
-static uint8_t SbBlitterRFromColor(SbBlitterColor color)
-```
-
-### SbBlitterSetBlending ###
-
-Sets the blending state for the specified `context`. By default, blending is
-disabled on a `SbBlitterContext`.
-
-This function is not thread-safe.
-
-The return value indicates whether the blending state was set successfully.
-
-`context`: The context for which the blending state is being set.
-
-`blending`: The blending state for the `context`. If `blending` is `true`, the
-source alpha of subsequent draw calls is used to blend with the destination
-color. In particular,
-
-```
-Fc = Sc * Sa + Dc * (1 - Sa)
-
-```
-
-where:
-
-*   `Fc` is the final color.
-
-*   `Sc` is the source color.
-
-*   `Sa` is the source alpha.
-
-*   `Dc` is the destination color.
-
-If `blending` is `false`, the source color and source alpha overwrite the
-destination color and alpha.
-
-#### Declaration ####
-
-```
-bool SbBlitterSetBlending(SbBlitterContext context, bool blending)
-```
-
-### SbBlitterSetColor ###
-
-Sets the context's current color. The current color's default value is
-`SbBlitterColorFromRGBA(255, 255, 255 255)`.
-
-The current color affects the fill rectangle's color in calls to
-`SbBlitterFillRect()`. If `SbBlitterSetModulateBlitsWithColor()` has been called
-to enable blit color modulation, the source blit surface pixel color is also
-modulated by the color before being output.
-
-This function is not thread-safe.
-
-The return value indicates whether the color was set successfully.
-
-`context`: The context for which the color is being set. `color`: The context's
-new color, specified in unpremultiplied alpha format.
-
-#### Declaration ####
-
-```
-bool SbBlitterSetColor(SbBlitterContext context, SbBlitterColor color)
-```
-
-### SbBlitterSetModulateBlitsWithColor ###
-
-Sets whether or not blit calls should have their source pixels modulated by the
-current color, which is set using `SbBlitterSetColor()`, before being output.
-This function can apply opacity to blit calls, color alpha-only surfaces, and
-apply other effects.
-
-This function is not thread-safe.
-
-The return value indicates whether the state was set successfully.
-
-`modulate_blits_with_color`: Indicates whether to modulate source pixels in blit
-calls.
-
-#### Declaration ####
-
-```
-bool SbBlitterSetModulateBlitsWithColor(SbBlitterContext context, bool modulate_blits_with_color)
-```
-
-### SbBlitterSetRenderTarget ###
-
-Sets up `render_target` as the render target that all subsequent draw calls made
-on `context` will use.
-
-This function is not thread-safe.
-
-The return value indicates whether the render target was set successfully.
-
-`context`: The object for which the render target is being set. `render_target`:
-The target that the `context` should use for draw calls.
-
-#### Declaration ####
-
-```
-bool SbBlitterSetRenderTarget(SbBlitterContext context, SbBlitterRenderTarget render_target)
-```
-
-### SbBlitterSetScissor ###
-
-Sets the scissor rectangle, which dictates a visibility area that affects all
-draw calls. Only pixels within the scissor rectangle are rendered, and all
-drawing outside of that area is clipped.
-
-When `SbBlitterSetRenderTarget()` is called, that function automatically sets
-the scissor rectangle to the size of the specified render target. If a scissor
-rectangle is specified outside of the extents of the current render target
-bounds, it will be intersected with the render target bounds.
-
-This function is not thread-safe.
-
-Returns whether the scissor was successfully set. It returns an error if it is
-called before a render target has been specified for the context.
-
-#### Declaration ####
-
-```
-bool SbBlitterSetScissor(SbBlitterContext context, SbBlitterRect rect)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/byte_swap.md b/src/cobalt/site/docs/reference/starboard/modules/6/byte_swap.md
deleted file mode 100644
index 580bc5d..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/byte_swap.md
+++ /dev/null
@@ -1,76 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: byte_swap.h"
----
-
-Specifies functions for swapping byte order. These functions are used to deal
-with endianness when performing I/O.
-
-## Functions ##
-
-### SbByteSwapS16 ###
-
-Unconditionally swaps the byte order in signed 16-bit `value`. `value`: The
-value for which the byte order will be swapped.
-
-#### Declaration ####
-
-```
-int16_t SbByteSwapS16(int16_t value)
-```
-
-### SbByteSwapS32 ###
-
-Unconditionally swaps the byte order in signed 32-bit `value`. `value`: The
-value for which the byte order will be swapped.
-
-#### Declaration ####
-
-```
-int32_t SbByteSwapS32(int32_t value)
-```
-
-### SbByteSwapS64 ###
-
-Unconditionally swaps the byte order in signed 64-bit `value`. `value`: The
-value for which the byte order will be swapped.
-
-#### Declaration ####
-
-```
-int64_t SbByteSwapS64(int64_t value)
-```
-
-### SbByteSwapU16 ###
-
-Unconditionally swaps the byte order in unsigned 16-bit `value`. `value`: The
-value for which the byte order will be swapped.
-
-#### Declaration ####
-
-```
-uint16_t SbByteSwapU16(uint16_t value)
-```
-
-### SbByteSwapU32 ###
-
-Unconditionally swaps the byte order in unsigned 32-bit `value`. `value`: The
-value for which the byte order will be swapped.
-
-#### Declaration ####
-
-```
-uint32_t SbByteSwapU32(uint32_t value)
-```
-
-### SbByteSwapU64 ###
-
-Unconditionally swaps the byte order in unsigned 64-bit `value`. `value`: The
-value for which the byte order will be swapped.
-
-#### Declaration ####
-
-```
-uint64_t SbByteSwapU64(uint64_t value)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/character.md b/src/cobalt/site/docs/reference/starboard/modules/6/character.md
deleted file mode 100644
index 432dcae..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/character.md
+++ /dev/null
@@ -1,104 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: character.h"
----
-
-Provides functions for interacting with characters.
-
-## Functions ##
-
-### SbCharacterIsAlphanumeric ###
-
-Indicates whether the given 8-bit character `c` (as an int) is alphanumeric in
-the current locale.
-
-`c`: The character to be evaluated.
-
-#### Declaration ####
-
-```
-bool SbCharacterIsAlphanumeric(int c)
-```
-
-### SbCharacterIsDigit ###
-
-Indicates whether the given 8-bit character `c` (as an int) is a decimal digit
-in the current locale.
-
-`c`: The character to be evaluated.
-
-#### Declaration ####
-
-```
-bool SbCharacterIsDigit(int c)
-```
-
-### SbCharacterIsHexDigit ###
-
-Indicates whether the given 8-bit character `c` (as an int) is a hexadecimal in
-the current locale.
-
-`c`: The character to be evaluated.
-
-#### Declaration ####
-
-```
-bool SbCharacterIsHexDigit(int c)
-```
-
-### SbCharacterIsSpace ###
-
-Indicates whether the given 8-bit character `c` (as an int) is a space in the
-current locale.
-
-`c`: The character to be evaluated.
-
-#### Declaration ####
-
-```
-bool SbCharacterIsSpace(int c)
-```
-
-### SbCharacterIsUpper ###
-
-Indicates whether the given 8-bit character `c` (as an int) is uppercase in the
-current locale.
-
-`c`: The character to be evaluated.
-
-#### Declaration ####
-
-```
-bool SbCharacterIsUpper(int c)
-```
-
-### SbCharacterToLower ###
-
-Converts the given 8-bit character (as an int) to lowercase in the current
-locale and returns an 8-bit character. If there is no lowercase version of the
-character, or the character is already lowercase, the function just returns the
-character as-is.
-
-`c`: The character to be converted.
-
-#### Declaration ####
-
-```
-int SbCharacterToLower(int c)
-```
-
-### SbCharacterToUpper ###
-
-Converts the given 8-bit character (as an int) to uppercase in the current
-locale and returns an 8-bit character. If there is no uppercase version of the
-character, or the character is already uppercase, the function just returns the
-character as-is.
-
-`c`: The character to be converted.
-
-#### Declaration ####
-
-```
-int SbCharacterToUpper(int c)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/condition_variable.md b/src/cobalt/site/docs/reference/starboard/modules/6/condition_variable.md
deleted file mode 100644
index 9fdcdb1..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/condition_variable.md
+++ /dev/null
@@ -1,122 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: condition_variable.h"
----
-
-Defines an interface for condition variables.
-
-## Enums ##
-
-### SbConditionVariableResult ###
-
-Enumeration of possible results from waiting on a condvar.
-
-#### Values ####
-
-*   `kSbConditionVariableSignaled`
-
-    The wait completed because the condition variable was signaled.
-*   `kSbConditionVariableTimedOut`
-
-    The wait completed because it timed out, and was not signaled.
-*   `kSbConditionVariableFailed`
-
-    The wait failed, either because a parameter wasn't valid, or the condition
-    variable has already been destroyed, or something similar.
-
-## Functions ##
-
-### SbConditionVariableBroadcast ###
-
-Broadcasts to all current waiters of `condition` to stop waiting. This function
-wakes all of the threads waiting on `condition` while SbConditionVariableSignal
-wakes a single thread.
-
-`condition`: The condition that should no longer be waited for.
-
-#### Declaration ####
-
-```
-bool SbConditionVariableBroadcast(SbConditionVariable *condition)
-```
-
-### SbConditionVariableCreate ###
-
-Creates a new condition variable to work with `opt_mutex`, which may be null,
-placing the newly created condition variable in `out_condition`.
-
-The return value indicates whether the condition variable could be created.
-
-#### Declaration ####
-
-```
-bool SbConditionVariableCreate(SbConditionVariable *out_condition, SbMutex *opt_mutex)
-```
-
-### SbConditionVariableDestroy ###
-
-Destroys the specified SbConditionVariable. The return value indicates whether
-the destruction was successful. The behavior is undefined if other threads are
-currently waiting on this condition variable.
-
-`condition`: The SbConditionVariable to be destroyed. This invalidates the
-condition variable.
-
-#### Declaration ####
-
-```
-bool SbConditionVariableDestroy(SbConditionVariable *condition)
-```
-
-### SbConditionVariableIsSignaled ###
-
-Returns whether the given result is a success.
-
-#### Declaration ####
-
-```
-static bool SbConditionVariableIsSignaled(SbConditionVariableResult result)
-```
-
-### SbConditionVariableSignal ###
-
-Signals the next waiter of `condition` to stop waiting. This function wakes a
-single thread waiting on `condition` while SbConditionVariableBroadcast wakes
-all threads waiting on it.
-
-`condition`: The condition that the waiter should stop waiting for.
-
-#### Declaration ####
-
-```
-bool SbConditionVariableSignal(SbConditionVariable *condition)
-```
-
-### SbConditionVariableWait ###
-
-Waits for `condition`, releasing the held lock `mutex`, blocking indefinitely,
-and returning the result. Behavior is undefined if `mutex` is not held.
-
-#### Declaration ####
-
-```
-SbConditionVariableResult SbConditionVariableWait(SbConditionVariable *condition, SbMutex *mutex)
-```
-
-### SbConditionVariableWaitTimed ###
-
-Waits for `condition`, releasing the held lock `mutex`, blocking up to
-`timeout_duration`, and returning the acquisition result. Behavior is undefined
-if `mutex` is not held.
-
-`timeout_duration`: The maximum amount of time that function should wait for
-`condition`. If the `timeout_duration` value is less than or equal to zero, the
-function returns as quickly as possible with a kSbConditionVariableTimedOut
-result.
-
-#### Declaration ####
-
-```
-SbConditionVariableResult SbConditionVariableWaitTimed(SbConditionVariable *condition, SbMutex *mutex, SbTime timeout_duration)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/configuration.md b/src/cobalt/site/docs/reference/starboard/modules/6/configuration.md
deleted file mode 100644
index be08866..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/configuration.md
+++ /dev/null
@@ -1,234 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: configuration.h"
----
-
-Provides a description of the current platform in lurid detail so that common
-code never needs to actually know what the current operating system and
-architecture are.
-
-It is both very pragmatic and canonical in that if any application code finds
-itself needing to make a platform decision, it should always define a Starboard
-Configuration feature instead. This implies the continued existence of very
-narrowly-defined configuration features, but it retains porting control in
-Starboard.
-
-## Macros ##
-
-### SB_ALIGNAS(byte_alignment) ###
-
-Specifies the alignment for a class, struct, union, enum, class/struct field, or
-stack variable.
-
-### SB_ALIGNOF(type) ###
-
-Returns the alignment reqiured for any instance of the type indicated by `type`.
-
-### SB_ARRAY_SIZE(array) ###
-
-A constant expression that evaluates to the size_t size of a statically-sized
-array.
-
-### SB_ARRAY_SIZE_INT(array) ###
-
-A constant expression that evaluates to the int size of a statically-sized
-array.
-
-### SB_CAN(SB_FEATURE) ###
-
-Determines a compile-time capability of the system.
-
-### SB_CAN_MEDIA_USE_STARBOARD_PIPELINE ###
-
-Specifies whether the starboard media pipeline components (SbPlayerPipeline and
-StarboardDecryptor) are used. Set to 0 means they are not used.
-
-### SB_COMPILE_ASSERT(expr, msg) ###
-
-Will cause a compiler error with `msg` if `expr` is false. `msg` must be a valid
-identifier, and must be a unique type in the scope of the declaration.
-
-### SB_DEPRECATED(FUNC) ###
-
-SB_DEPRECATED(int Foo(int bar)); Annotates the function as deprecated, which
-will trigger a compiler warning when referenced.
-
-### SB_DEPRECATED_EXTERNAL(FUNC) ###
-
-SB_DEPRECATED_EXTERNAL(...) annotates the function as deprecated for external
-clients, but not deprecated for starboard.
-
-### SB_DISALLOW_COPY_AND_ASSIGN(TypeName) ###
-
-A macro to disallow the copy constructor and operator= functions This should be
-used in the private: declarations for a class
-
-### SB_EXPERIMENTAL_API_VERSION ###
-
-The API version that is currently open for changes, and therefore is not stable
-or frozen. Production-oriented ports should avoid declaring that they implement
-the experimental Starboard API version.
-
-### SB_FUNCTION ###
-
-Whether we use **PRETTY_FUNCTION** PRETTY_FUNCTION or **FUNCTION** FUNCTION for
-logging.
-
-### SB_HAS(SB_FEATURE) ###
-
-Determines at compile-time whether this platform has a standard feature or
-header available.
-
-### SB_HAS_64_BIT_ATOMICS ###
-
-Whether the current platform has 64-bit atomic operations.
-
-### SB_HAS_AC3_AUDIO_API_VERSION ###
-
-Add support for audio in ac3.
-
-### SB_HAS_AV1_VERSION ###
-
-Replace kSbMediaVideoCodecVp10 by kSbMediaVideoCodecAv1. kSbMediaVideoCodecVp10
-in media.h is replaced by kSbMediaVideoCodecAv1.
-
-### SB_HAS_DRM_KEY_STATUSES ###
-
-Legal values for SB_PREFERRED_RGBA_BYTE_ORDER are defined in this file above as
-SB_PREFERRED_RGBA_BYTE_ORDER_*. If your platform uses GLES, you should set this
-to SB_PREFERRED_RGBA_BYTE_ORDER_RGBA.
-
-### SB_HAS_GLES2 ###
-
-Specifies whether this platform has a performant OpenGL ES 2 implementation,
-which allows client applications to use GL rendering paths. Derived from the gyp
-variable `gl_type` gl_type which indicates what kind of GL implementation is
-available.
-
-### SB_HAS_GRAPHICS ###
-
-Specifies whether this platform has any kind of supported graphics system.
-
-### SB_HAS_QUIRK(SB_FEATURE) ###
-
-Determines at compile-time whether this platform has a quirk.
-
-### SB_HAS_SCREEN_DIAGONAL_API_VERSION ###
-
-Adds support for allowing the platform to override its screen diagonal length
-via SbWindowGetDiagonalSizeInInches().
-
-### SB_HAS_STARTUP_URL_SIGNING_VERSION ###
-
-Add support for startup url signing by adding
-kSbSystemPropertyCertificationScope and
-kSbSystemPropertyBase64EncodedCertificationSecret system property enums to
-system.h.
-
-### SB_HAS_STD_UNORDERED_HASH_API_VERSION ###
-
-Add support for using C++11 standard unordered maps and sets. By setting
-SB_HAS_STD_UNORDERED_HASH to 1, a platform can be configured to use C++11
-standard hash table implementations, specifically, using: . std::unordered_map<>
-for base::hash_map<>, and . std::unordered_multimap<> for base::hash_multimap<>,
-and . std::unordered_set<> for base::hash_set<>, and . std::unordered_multiset<>
-for base::hash_multiset<>. When SB_HAS_STD_UNORDERED_HASH is used, it is no
-longer necessary to specify SB_HAS_LONG_LONG_HASH, SB_HAS_STRING_HASH,
-SB_HAS_HASH_USING, SB_HAS_HASH_VALUE, SB_HAS_HASH_WARNING, SB_HASH_MAP_INCLUDE,
-SB_HASH_NAMESPACE, or SB_HASH_SET_INCLUDE.
-
-### SB_INT64_C(x) ###
-
-Declare numeric literals of signed 64-bit type.
-
-### SB_IS(SB_FEATURE) ###
-
-Determines at compile-time an inherent aspect of this platform.
-
-### SB_IS_LITTLE_ENDIAN ###
-
-Whether the current platform is little endian.
-
-### SB_LIKELY(x) ###
-
-Macro for hinting that an expression is likely to be true.
-
-### SB_MAXIMUM_API_VERSION ###
-
-The maximum API version allowed by this version of the Starboard headers,
-inclusive.
-
-### SB_MEDIA_EOTF_CHECK_SUPPORT_VERSION ###
-
-Add SbMediaTransferId* argument `eotf` to SbMediaIsVideoSupported, so the
-platform may indicate support of resolution, bitrate, fps, and codec conditioned
-on eotf. Also, remove the function SbMediaIsTransferCharacteristicsSupported
-which is no longer necessary.
-
-### SB_MINIMUM_API_VERSION ###
-
-The minimum API version allowed by this version of the Starboard headers,
-inclusive.
-
-### SB_NORETURN ###
-
-Macro to annotate a function as noreturn, which signals to the compiler that the
-function cannot return.
-
-### SB_OVERRIDE ###
-
-Declares a function as overriding a virtual function on compilers that support
-it.
-
-### SB_PREFERRED_RGBA_BYTE_ORDER_RGBA ###
-
-An enumeration of values for the SB_PREFERRED_RGBA_BYTE_ORDER configuration
-variable. Setting this up properly means avoiding slow color swizzles when
-passing pixel data from one library to another. Note that these definitions are
-in byte-order and so are endianness-independent.
-
-### SB_PRINTF_FORMAT(format_param, dots_param) ###
-
-Tells the compiler a function is using a printf-style format string.
-`format_param` is the one-based index of the format string parameter;
-`dots_param` is the one-based index of the "..." parameter. For v*printf
-functions (which take a va_list), pass 0 for dots_param. (This is undocumented
-but matches what the system C headers do.) (Partially taken from
-base/compiler_specific.h)
-
-### SB_RELEASE_CANDIDATE_API_VERSION ###
-
-The next API version to be frozen, but is still subject to emergency changes. It
-is reasonable to base a port on the Release Candidate API version, but be aware
-that small incompatible changes may still be made to it. The following will be
-uncommented when an API version is a release candidate.
-
-### SB_RESTRICT ###
-
-Include the platform-specific configuration. This macro is set by GYP in
-starboard_base_target.gypi and passed in on the command line for all targets and
-all configurations.Makes a pointer-typed parameter restricted so that the
-compiler can make certain optimizations because it knows the pointers are
-unique.
-
-### SB_STRINGIFY(x) ###
-
-Standard CPP trick to stringify an evaluated macro definition.
-
-### SB_UINT64_C(x) ###
-
-Declare numeric literals of unsigned 64-bit type.
-
-### SB_UNLIKELY(x) ###
-
-Macro for hinting that an expression is likely to be false.
-
-### SB_UNREFERENCED_PARAMETER(x) ###
-
-Trivially references a parameter that is otherwise unreferenced, preventing a
-compiler warning on some platforms.
-
-### SB_WARN_UNUSED_RESULT ###
-
-Causes the annotated (at the end) function to generate a warning if the result
-is not accessed.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/cryptography.md b/src/cobalt/site/docs/reference/starboard/modules/6/cryptography.md
deleted file mode 100644
index 1540465..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/cryptography.md
+++ /dev/null
@@ -1,223 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: cryptography.h"
----
-
-Hardware-accelerated cryptography. Platforms should **only** only implement this
-when there are **hardware-accelerated** hardware-accelerated cryptography
-facilities. Applications must fall back to platform-independent CPU-based
-algorithms if the cipher algorithm isn't supported in hardware.
-
-## Tips for Porters ##
-
-You should implement cipher algorithms in this descending order of priority to
-maximize usage for SSL.
-
-1.  GCM - The preferred block cipher mode for OpenSSL, mainly due to speed.
-
-1.  CTR - This can be used internally with GCM, as long as the CTR
-    implementation only uses the last 4 bytes of the IV for the counter. (i.e.
-    96-bit IV, 32-bit counter)
-
-1.  ECB - This can be used (with a null IV) with any of the other cipher block
-    modes to accelerate the core AES algorithm if none of the streaming modes
-    can be accelerated.
-
-1.  CBC - GCM is always preferred if the server and client both support it. If
-    not, they will generally negotiate down to AES-CBC. If this happens, and CBC
-    is supported by SbCryptography, then it will be accelerated appropriately.
-    But, most servers should support GCM, so it is not likely to come up much,
-    which is why it is the lowest priority.
-
-Further reading on block cipher modes:
-
-[https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation)
-
-[https://crbug.com/442572](https://crbug.com/442572)
-
-[https://crypto.stackexchange.com/questions/10775/practical-disadvantages-of-gcm-mode-encryption](https://crypto.stackexchange.com/questions/10775/practical-disadvantages-of-gcm-mode-encryption)
-
-## Macros ##
-
-### kSbCryptographyAlgorithmAes ###
-
-String literal for the AES symmetric block cipher. [https://en.wikipedia.org/wiki/Advanced_Encryption_Standard](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard)
-
-### kSbCryptographyInvalidTransformer ###
-
-Well-defined value for an invalid transformer.
-
-## Enums ##
-
-### SbCryptographyBlockCipherMode ###
-
-The method of chaining encrypted blocks in a sequence. [https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation)
-
-#### Values ####
-
-*   `kSbCryptographyBlockCipherModeCbc`
-
-    Cipher Block Chaining mode.
-*   `kSbCryptographyBlockCipherModeCfb`
-
-    Cipher Feedback mode.
-*   `kSbCryptographyBlockCipherModeCtr`
-
-    Counter mode: A nonce is combined with an increasing counter.
-*   `kSbCryptographyBlockCipherModeEcb`
-
-    Electronic Code Book mode: No chaining.
-*   `kSbCryptographyBlockCipherModeOfb`
-
-    Output Feedback mode.
-*   `kSbCryptographyBlockCipherModeGcm`
-
-    Galois/Counter Mode.
-
-### SbCryptographyDirection ###
-
-The direction of a cryptographic transformation.
-
-#### Values ####
-
-*   `kSbCryptographyDirectionEncode`
-
-    Cryptographic transformations that encode/encrypt data into a target format.
-*   `kSbCryptographyDirectionDecode`
-
-    Cryptographic transformations that decode/decrypt data into its original
-    form.
-
-## Typedefs ##
-
-### SbCryptographyTransformer ###
-
-A handle to a cryptographic transformer.
-
-#### Definition ####
-
-```
-typedef SbCryptographyTransformerPrivate* SbCryptographyTransformer
-```
-
-## Functions ##
-
-### SbCryptographyCreateTransformer ###
-
-Creates an SbCryptographyTransformer with the given initialization data. It can
-then be used to transform a series of data blocks. Returns
-kSbCryptographyInvalidTransformer if the algorithm isn't supported, or if the
-parameters are not compatible with the algorithm.
-
-An SbCryptographyTransformer contains all state to start decrypting a sequence
-of cipher blocks according to the cipher block mode. It is not thread-safe, but
-implementations must allow different SbCryptographyTransformer instances to
-operate on different threads.
-
-All parameters must not be assumed to live longer than the call to this
-function. They must be copied by the implementation to be retained.
-
-This function determines success mainly based on whether the combination of
-`algorithm`, `direction`, `block_size_bits`, and `mode` is supported and whether
-all the sizes passed in are sufficient for the selected parameters. In
-particular, this function cannot verify that the key and IV used were correct
-for the ciphertext, were it to be used in the decode direction. The caller must
-make that verification.
-
-For example, to decrypt AES-128-CTR:
-SbCryptographyCreateTransformer(kSbCryptographyAlgorithmAes, 128,
-kSbCryptographyDirectionDecode, kSbCryptographyBlockCipherModeCtr, ...);
-
-`algorithm`: A string that represents the cipher algorithm. `block_size_bits`:
-The block size variant of the algorithm to use, in bits. `direction`: The
-direction in which to transform the data. `mode`: The block cipher mode to use.
-`initialization_vector`: The Initialization Vector (IV) to use. May be NULL for
-block cipher modes that don't use it, or don't set it at init time.
-`initialization_vector_size`: The size, in bytes, of the IV. `key`: The key to
-use for this transformation. `key_size`: The size, in bytes, of the key.
-
-#### Declaration ####
-
-```
-SbCryptographyTransformer SbCryptographyCreateTransformer(const char *algorithm, int block_size_bits, SbCryptographyDirection direction, SbCryptographyBlockCipherMode mode, const void *initialization_vector, int initialization_vector_size, const void *key, int key_size)
-```
-
-### SbCryptographyDestroyTransformer ###
-
-Destroys the given `transformer` instance.
-
-#### Declaration ####
-
-```
-void SbCryptographyDestroyTransformer(SbCryptographyTransformer transformer)
-```
-
-### SbCryptographyGetTag ###
-
-Calculates the authenticator tag for a transformer and places up to
-`out_tag_size` bytes of it in `out_tag`. Returns whether it was able to get the
-tag, which mainly has to do with whether it is compatible with the current block
-cipher mode.
-
-#### Declaration ####
-
-```
-bool SbCryptographyGetTag(SbCryptographyTransformer transformer, void *out_tag, int out_tag_size)
-```
-
-### SbCryptographyIsTransformerValid ###
-
-Returns whether the given transformer handle is valid.
-
-#### Declaration ####
-
-```
-static bool SbCryptographyIsTransformerValid(SbCryptographyTransformer transformer)
-```
-
-### SbCryptographySetAuthenticatedData ###
-
-Sets additional authenticated data (AAD) for a transformer, for chaining modes
-that support it (GCM). Returns whether the data was successfully set. This can
-fail if the chaining mode doesn't support AAD, if the parameters are invalid, or
-if the internal state is invalid for setting AAD.
-
-#### Declaration ####
-
-```
-bool SbCryptographySetAuthenticatedData(SbCryptographyTransformer transformer, const void *data, int data_size)
-```
-
-### SbCryptographySetInitializationVector ###
-
-Sets the initialization vector (IV) for a transformer, replacing the internally-
-set IV. The block cipher mode algorithm will update the IV appropriately after
-every block, so this is not necessary unless the stream is discontiguous in some
-way. This happens with AES-GCM in TLS.
-
-#### Declaration ####
-
-```
-void SbCryptographySetInitializationVector(SbCryptographyTransformer transformer, const void *initialization_vector, int initialization_vector_size)
-```
-
-### SbCryptographyTransform ###
-
-Transforms one or more `block_size_bits`-sized blocks of `in_data`, with the
-given `transformer`, placing the result in `out_data`. Returns the number of
-bytes that were written to `out_data`, unless there was an error, in which case
-it will return a negative number.
-
-`transformer`: A transformer initialized with an algorithm, IV, cipherkey, and
-so on. `in_data`: The data to be transformed. `in_data_size`: The size of the
-data to be transformed, in bytes. Must be a multiple of the transformer's
-`block-size_bits`, or an error will be returned. `out_data`: A buffer where the
-transformed data should be placed. Must have at least capacity for
-`in_data_size` bytes. May point to the same memory as `in_data`.
-
-#### Declaration ####
-
-```
-int SbCryptographyTransform(SbCryptographyTransformer transformer, const void *in_data, int in_data_size, void *out_data)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/decode_target.md b/src/cobalt/site/docs/reference/starboard/modules/6/decode_target.md
deleted file mode 100644
index 6390929..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/decode_target.md
+++ /dev/null
@@ -1,361 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: decode_target.h"
----
-
-A target for decoding image and video data into. This corresponds roughly to an
-EGLImage, but that extension may not be fully supported on all GL platforms.
-SbDecodeTarget supports multi-plane targets. The SbBlitter API is supported as
-well, and this is able to more-or-less unify the two.
-
-An SbDecodeTarget can be passed into any function which decodes video or image
-data. This allows the application to allocate fast graphics memory, and have
-decoding done directly into this memory, avoiding unnecessary memory copies, and
-also avoiding pushing data between CPU and GPU memory unnecessarily.
-
-## SbDecodeTargetFormat ##
-
-SbDecodeTargets support several different formats that can be used to decode
-into and render from. Some formats may be easier to decode into, and others may
-be easier to render. Some may take less memory. Each decoder needs to support
-the SbDecodeTargetFormat passed into it, or the decode will produce an error.
-Each decoder provides a way to check if a given SbDecodeTargetFormat is
-supported by that decoder.
-
-## SbDecodeTargetGraphicsContextProvider ##
-
-Some components may need to acquire SbDecodeTargets compatible with a certain
-rendering context, which may need to be created on a particular thread. The
-SbDecodeTargetGraphicsContextProvider are passed in to the Starboard
-implementation from the application and provide information about the rendering
-context that will be used to render the SbDecodeTarget objects. For GLES
-renderers, it also provides functionality to enable the Starboard implementation
-to run arbitrary code on the application's renderer thread with the renderer's
-EGLContext held current. This may be useful if your SbDecodeTarget creation code
-needs to execute GLES commands like, for example, glGenTextures().
-
-The primary usage is likely to be the the SbPlayer implementation on some
-platforms.
-
-## SbDecodeTarget Example ##
-
-Let's say that we are an application and we would like to use the interface
-defined in starboard/image.h to decode an imaginary "image/foo" image type.
-
-First, the application should enumerate which SbDecodeTargetFormats are
-supported by that decoder.
-
-```
-SbDecodeTargetFormat kPreferredFormats[] = {
-    kSbDecodeTargetFormat3PlaneYUVI420,
-    kSbDecodeTargetFormat1PlaneRGBA,
-    kSbDecodeTargetFormat1PlaneBGRA,
-};
-
-SbDecodeTargetFormat format = kSbDecodeTargetFormatInvalid;
-for (int i = 0; i < SB_ARRAY_SIZE_INT(kPreferredFormats); ++i) {
-  if (SbImageIsDecodeSupported("image/foo", kPreferredFormats[i])) {
-    format = kPreferredFormats[i];
-    break;
-  }
-}
-
-```
-
-Now that the application has a format, it can create a decode target that it
-will use to decode the .foo file into. Let's assume format is
-kSbDecodeTargetFormat1PlaneRGBA, that we are on an EGL/GLES2 platform. Also, we
-won't do any error checking, to keep things even simpler.
-
-```
-SbDecodeTarget target = SbImageDecode(
-    context_provider, encoded_foo_data, encoded_foo_data_size,
-    "image/foo", format);
-
-// If the decode works, you can get the texture out and render it.
-SbDecodeTargetInfo info;
-SbMemorySet(&info, 0, sizeof(info));
-SbDecodeTargetGetInfo(target, &info);
-GLuint texture =
-    info.planes[kSbDecodeTargetPlaneRGBA].texture;
-```
-
-## Macros ##
-
-### kSbDecodeTargetInvalid ###
-
-Well-defined value for an invalid decode target handle.
-
-## Enums ##
-
-### SbDecodeTargetFormat ###
-
-The list of all possible decoder target formats. An SbDecodeTarget consists of
-one or more planes of data, each plane corresponding with a surface. For some
-formats, different planes will be different sizes for the same dimensions.
-
-NOTE: For enumeration entries with an alpha component, the alpha will always be
-premultiplied unless otherwise explicitly specified.
-
-#### Values ####
-
-*   `kSbDecodeTargetFormat1PlaneRGBA`
-
-    A decoder target format consisting of a single RGBA plane, in that channel
-    order.
-*   `kSbDecodeTargetFormat1PlaneBGRA`
-
-    A decoder target format consisting of a single BGRA plane, in that channel
-    order.
-*   `kSbDecodeTargetFormat2PlaneYUVNV12`
-
-    A decoder target format consisting of Y and interleaved UV planes, in that
-    plane and channel order.
-*   `kSbDecodeTargetFormat3PlaneYUVI420`
-
-    A decoder target format consisting of Y, U, and V planes, in that order.
-*   `kSbDecodeTargetFormat1PlaneUYVY`
-
-    A decoder target format consisting of a single plane with pixels layed out
-    in the format UYVY. Since there are two Y values per sample, but only one U
-    value and only one V value, horizontally the Y resolution is twice the size
-    of both the U and V resolutions. Vertically, they Y, U and V all have the
-    same resolution. This is a YUV 422 format. When using this format with GL
-    platforms, it is expected that the underlying texture will be set to the
-    GL_RGBA format, and the width of the texture will be equal to the number of
-    UYVY tuples per row (e.g. the u/v width resolution). Content region
-    left/right should be specified in u/v width resolution.
-*   `kSbDecodeTargetFormatInvalid`
-
-    An invalid decode target format.
-
-### SbDecodeTargetPlane ###
-
-All the planes supported by SbDecodeTarget.
-
-#### Values ####
-
-*   `kSbDecodeTargetPlaneRGBA`
-
-    The RGBA plane for the RGBA format.
-*   `kSbDecodeTargetPlaneBGRA`
-
-    The BGRA plane for the BGRA format.
-*   `kSbDecodeTargetPlaneY`
-
-    The Y plane for multi-plane YUV formats.
-*   `kSbDecodeTargetPlaneUV`
-
-    The UV plane for 2-plane YUV formats.
-*   `kSbDecodeTargetPlaneU`
-
-    The U plane for 3-plane YUV formats.
-*   `kSbDecodeTargetPlaneV`
-
-    The V plane for 3-plane YUV formats.
-
-## Typedefs ##
-
-### SbDecodeTarget ###
-
-A handle to a target for image data decoding.
-
-#### Definition ####
-
-```
-typedef SbDecodeTargetPrivate* SbDecodeTarget
-```
-
-### SbDecodeTargetGlesContextRunner ###
-
-Signature for a function provided by the application to the Starboard
-implementation that will let the Starboard implementation run arbitrary code on
-the application's renderer thread with the application's EGLContext held
-current.
-
-#### Definition ####
-
-```
-typedef void(* SbDecodeTargetGlesContextRunner) (struct SbDecodeTargetGraphicsContextProvider *graphics_context_provider, SbDecodeTargetGlesContextRunnerTarget target_function, void *target_function_context)
-```
-
-### SbDecodeTargetGlesContextRunnerTarget ###
-
-Signature for a Starboard implementaion function that is to be run by a
-SbDecodeTargetGlesContextRunner callback.
-
-#### Definition ####
-
-```
-typedef void(* SbDecodeTargetGlesContextRunnerTarget) (void *gles_context_runner_target_context)
-```
-
-## Structs ##
-
-### SbDecodeTargetGraphicsContextProvider ###
-
-In general, the SbDecodeTargetGraphicsContextProvider structure provides
-information about the graphics context that will be used to render
-SbDecodeTargets. Some Starboard implementations may need to have references to
-some graphics objects when creating/destroying resources used by SbDecodeTarget.
-References to SbDecodeTargetGraphicsContextProvider objects should be provided
-to all Starboard functions that might create SbDecodeTargets (e.g.
-SbImageDecode()).
-
-#### Members ####
-
-*   `SbBlitterDevice device`
-
-    The SbBlitterDevice object that will be used to render any produced
-    SbDecodeTargets.
-
-### SbDecodeTargetInfo ###
-
-Contains all information about a decode target, including all of its planes.
-This can be queried via calls to SbDecodeTargetGetInfo().
-
-#### Members ####
-
-*   `SbDecodeTargetFormat format`
-
-    The decode target format, which would dictate how many planes can be
-    expected in `planes`.
-*   `bool is_opaque`
-
-    Specifies whether the decode target is opaque. The underlying source of this
-    value is expected to be properly maintained by the Starboard implementation.
-    So, for example, if an opaque only image type were decoded into an
-    SbDecodeTarget, then the implementation would configure things in such a way
-    that this value is set to true. By opaque, it is meant that all alpha values
-    are guaranteed to be 255, if the decode target is of a format that has alpha
-    values. If the decode target is of a format that does not have alpha values,
-    then this value should be set to true. Applications may rely on this value
-    in order to implement certain optimizations such as occlusion culling.
-*   `int width`
-
-    The width of the image represented by this decode target.
-*   `int height`
-
-    The height of the image represented by this decode target.
-*   `SbDecodeTargetInfoPlane planes`
-
-    The image planes (e.g. kSbDecodeTargetPlaneRGBA, or {kSbDecodeTargetPlaneY,
-    kSbDecodeTargetPlaneU, kSbDecodeTargetPlaneV} associated with this decode
-    target.
-
-### SbDecodeTargetInfoContentRegion ###
-
-Defines a rectangular content region within a SbDecodeTargetInfoPlane structure.
-
-#### Members ####
-
-*   `int left`
-*   `int top`
-*   `int right`
-*   `int bottom`
-
-### SbDecodeTargetInfoPlane ###
-
-Defines an image plane within a SbDecodeTargetInfo object.
-
-#### Members ####
-
-*   `SbBlitterSurface surface`
-
-    A handle to the Blitter surface that can be used for rendering.
-*   `int width`
-
-    The width of the texture/surface for this particular plane.
-*   `int height`
-
-    The height of the texture/surface for this particular plane.
-*   `SbDecodeTargetInfoContentRegion content_region`
-
-    The following properties specify a rectangle indicating a region within the
-    texture/surface that contains valid image data. The top-left corner is (0,
-    0) and increases to the right and to the bottom. The units specified by
-    these parameters are number of pixels. The range for left/right is [0,
-    width], and for top/bottom it is [0, height].
-
-## Functions ##
-
-### PrivateDecodeTargetReleaser ###
-
-This function is just an implementation detail of
-SbDecodeTargetReleaseInGlesContext() and should not be called directly.
-
-#### Declaration ####
-
-```
-static void PrivateDecodeTargetReleaser(void *context)
-```
-
-### SbDecodeTargetGetInfo ###
-
-Writes all information about `decode_target` into `out_info`. Returns false if
-the provided `out_info` structure is not zero initialized.
-
-#### Declaration ####
-
-```
-bool SbDecodeTargetGetInfo(SbDecodeTarget decode_target, SbDecodeTargetInfo *out_info)
-```
-
-### SbDecodeTargetIsFormatValid ###
-
-Returns whether a given format is valid.
-
-#### Declaration ####
-
-```
-static bool SbDecodeTargetIsFormatValid(SbDecodeTargetFormat format)
-```
-
-### SbDecodeTargetIsValid ###
-
-Returns whether the given file handle is valid.
-
-#### Declaration ####
-
-```
-static bool SbDecodeTargetIsValid(SbDecodeTarget handle)
-```
-
-### SbDecodeTargetRelease ###
-
-Returns ownership of `decode_target` to the Starboard implementation. This
-function will likely result in the destruction of the SbDecodeTarget and all its
-associated surfaces, though in some cases, platforms may simply adjust a
-reference count. In the case where SB_HAS(GLES2), this function must be called
-on a thread with the context
-
-#### Declaration ####
-
-```
-void SbDecodeTargetRelease(SbDecodeTarget decode_target)
-```
-
-### SbDecodeTargetReleaseInGlesContext ###
-
-Helper function that is possibly useful to Starboard implementations that will
-release a decode target on the thread with the GLES context current.
-
-#### Declaration ####
-
-```
-static void SbDecodeTargetReleaseInGlesContext(SbDecodeTargetGraphicsContextProvider *provider, SbDecodeTarget decode_target)
-```
-
-### SbDecodeTargetRunInGlesContext ###
-
-Inline convenience function to run an arbitrary
-SbDecodeTargetGlesContextRunnerTarget function through a
-SbDecodeTargetGraphicsContextProvider . This is intended to be called by
-Starboard implementations, if it is necessary.
-
-#### Declaration ####
-
-```
-static void SbDecodeTargetRunInGlesContext(SbDecodeTargetGraphicsContextProvider *provider, SbDecodeTargetGlesContextRunnerTarget target, void *target_context)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/directory.md b/src/cobalt/site/docs/reference/starboard/modules/6/directory.md
deleted file mode 100644
index 7288d2d..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/directory.md
+++ /dev/null
@@ -1,122 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: directory.h"
----
-
-Provides directory listing functions.
-
-## Macros ##
-
-### kSbDirectoryInvalid ###
-
-Well-defined value for an invalid directory stream handle.
-
-## Typedefs ##
-
-### SbDirectory ###
-
-A handle to an open directory stream.
-
-#### Definition ####
-
-```
-typedef struct SbDirectoryPrivate* SbDirectory
-```
-
-## Structs ##
-
-### SbDirectoryEntry ###
-
-Represents a directory entry.
-
-#### Members ####
-
-*   `char name`
-
-    The name of this directory entry.
-
-## Functions ##
-
-### SbDirectoryCanOpen ###
-
-Indicates whether SbDirectoryOpen is allowed for the given `path`.
-
-`path`: The path to be checked.
-
-#### Declaration ####
-
-```
-bool SbDirectoryCanOpen(const char *path)
-```
-
-### SbDirectoryClose ###
-
-Closes an open directory stream handle. The return value indicates whether the
-directory was closed successfully.
-
-`directory`: The directory stream handle to close.
-
-#### Declaration ####
-
-```
-bool SbDirectoryClose(SbDirectory directory)
-```
-
-### SbDirectoryCreate ###
-
-Creates the directory `path`, assuming the parent directory already exists. This
-function returns `true` if the directory now exists (even if it existed before)
-and returns `false` if the directory does not exist.
-
-`path`: The path to be created.
-
-#### Declaration ####
-
-```
-bool SbDirectoryCreate(const char *path)
-```
-
-### SbDirectoryGetNext ###
-
-Populates `out_entry` with the next entry in the specified directory stream, and
-moves the stream forward by one entry.
-
-This function returns `true` if there was a next directory, and `false` at the
-end of the directory stream.
-
-`directory`: The directory stream from which to retrieve the next directory.
-`out_entry`: The variable to be populated with the next directory entry.
-
-#### Declaration ####
-
-```
-bool SbDirectoryGetNext(SbDirectory directory, SbDirectoryEntry *out_entry)
-```
-
-### SbDirectoryIsValid ###
-
-Returns whether the given directory stream handle is valid.
-
-#### Declaration ####
-
-```
-static bool SbDirectoryIsValid(SbDirectory directory)
-```
-
-### SbDirectoryOpen ###
-
-Opens the given existing directory for listing. This function returns
-kSbDirectoryInvalidHandle if it is not successful.
-
-If `out_error` is provided by the caller, it will be set to the appropriate
-SbFileError code on failure.
-
-`out_error`: An output parameter that, in case of an error, is set to the reason
-that the directory could not be opened.
-
-#### Declaration ####
-
-```
-SbDirectory SbDirectoryOpen(const char *path, SbFileError *out_error)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/double.md b/src/cobalt/site/docs/reference/starboard/modules/6/double.md
deleted file mode 100644
index 6667b50..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/double.md
+++ /dev/null
@@ -1,73 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: double.h"
----
-
-Provides double-precision floating point helper functions.
-
-## Functions ##
-
-### SbDoubleAbsolute ###
-
-Returns the absolute value of the given double-precision floating-point number
-`d`, preserving `NaN` and infinity.
-
-`d`: The number to be adjusted.
-
-#### Declaration ####
-
-```
-double SbDoubleAbsolute(const double d)
-```
-
-### SbDoubleExponent ###
-
-Returns `base` taken to the power of `exponent`.
-
-`base`: The number to be adjusted. `exponent`: The power to which the `base`
-number should be raised.
-
-#### Declaration ####
-
-```
-double SbDoubleExponent(const double base, const double exponent)
-```
-
-### SbDoubleFloor ###
-
-Floors double-precision floating-point number `d` to the nearest integer.
-
-`d`: The number to be floored.
-
-#### Declaration ####
-
-```
-double SbDoubleFloor(const double d)
-```
-
-### SbDoubleIsFinite ###
-
-Determines whether double-precision floating-point number `d` represents a
-finite number.
-
-`d`: The number to be evaluated.
-
-#### Declaration ####
-
-```
-bool SbDoubleIsFinite(const double d)
-```
-
-### SbDoubleIsNan ###
-
-Determines whether double-precision floating-point number `d` represents "Not a
-Number."
-
-`d`: The number to be evaluated.
-
-#### Declaration ####
-
-```
-bool SbDoubleIsNan(const double d)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/drm.md b/src/cobalt/site/docs/reference/starboard/modules/6/drm.md
deleted file mode 100644
index b15bf45..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/drm.md
+++ /dev/null
@@ -1,362 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: drm.h"
----
-
-Provides definitions that allow for DRM support, which are common between Player
-and Decoder interfaces.
-
-## Macros ##
-
-### kSbDrmSystemInvalid ###
-
-An invalid SbDrmSystem.
-
-### kSbDrmTicketInvalid ###
-
-A ticket for callback invocations initiated by the DRM system.
-
-## Enums ##
-
-### SbDrmKeyStatus ###
-
-Status of a particular media key. [https://w3c.github.io/encrypted-media/#idl-def-MediaKeyStatus](https://w3c.github.io/encrypted-media/#idl-def-MediaKeyStatus)
-
-#### Values ####
-
-*   `kSbDrmKeyStatusUsable`
-*   `kSbDrmKeyStatusExpired`
-*   `kSbDrmKeyStatusReleased`
-*   `kSbDrmKeyStatusRestricted`
-*   `kSbDrmKeyStatusDownscaled`
-*   `kSbDrmKeyStatusPending`
-*   `kSbDrmKeyStatusError`
-
-### SbDrmSessionRequestType ###
-
-The type of the session request. [https://www.w3.org/TR/encrypted-media/#idl-def-mediakeymessagetype](https://www.w3.org/TR/encrypted-media/#idl-def-mediakeymessagetype)
-
-#### Values ####
-
-*   `kSbDrmSessionRequestTypeLicenseRequest`
-*   `kSbDrmSessionRequestTypeLicenseRenewal`
-*   `kSbDrmSessionRequestTypeLicenseRelease`
-*   `kSbDrmSessionRequestTypeIndividualizationRequest`
-
-### SbDrmStatus ###
-
-The status of session related operations. Used by
-`SbDrmSessionUpdateRequestFunc`, `SbDrmSessionUpdatedFunc`, and
-`SbDrmServerCertificateUpdatedFunc` to indicate the status of the operation. [https://w3c.github.io/encrypted-media/#error-names](https://w3c.github.io/encrypted-media/#error-names)
-
-#### Values ####
-
-*   `kSbDrmStatusSuccess`
-*   `kSbDrmStatusTypeError`
-*   `kSbDrmStatusNotSupportedError`
-*   `kSbDrmStatusInvalidStateError`
-*   `kSbDrmStatusQuotaExceededError`
-*   `kSbDrmStatusUnknownError`
-
-    The following error can be used when the error status cannot be mapped to
-    one of the above errors.
-
-## Typedefs ##
-
-### SbDrmSessionClosedFunc ###
-
-A callback for signalling that a session has been closed by the SbDrmSystem
-
-#### Definition ####
-
-```
-typedef void(* SbDrmSessionClosedFunc) (SbDrmSystem drm_system, void *context, const void *session_id, int session_id_size)
-```
-
-### SbDrmSessionKeyStatusesChangedFunc ###
-
-A callback for notifications that the status of one or more keys in a session
-has been changed. All keys of the session and their new status will be passed
-along. Any keys not in the list is considered as deleted.
-
-#### Definition ####
-
-```
-typedef void(* SbDrmSessionKeyStatusesChangedFunc) (SbDrmSystem drm_system, void *context, const void *session_id, int session_id_size, int number_of_keys, const SbDrmKeyId *key_ids, const SbDrmKeyStatus *key_statuses)
-```
-
-### SbDrmSessionUpdateRequestFunc ###
-
-A callback that will receive generated session update request when requested
-from a SbDrmSystem. `drm_system` will be the DRM system that
-SbDrmGenerateSessionUpdateRequest() was called on. `context` will be the same
-context that was passed into the call to SbDrmCreateSystem().`ticket` will be
-the same ticket that was passed to SbDrmGenerateSessionUpdateRequest() or
-`kSbDrmTicketInvalid` if the update request was generated by the DRM system.
-
-`session_id` can be NULL if there was an error generating the request.
-
-#### Definition ####
-
-```
-typedef void(* SbDrmSessionUpdateRequestFunc) (SbDrmSystem drm_system, void *context, int ticket, const void *session_id, int session_id_size, const void *content, int content_size, const char *url)
-```
-
-### SbDrmSessionUpdatedFunc ###
-
-A callback for notifications that a session has been added, and subsequent
-encrypted samples are actively ready to be decoded. `drm_system` will be the DRM
-system that SbDrmUpdateSession() was called on. `context` will be the same
-context passed into that call to SbDrmCreateSystem().
-
-`ticket` will be the same ticket that was passed to
-SbDrmUpdateSession().`succeeded` is whether the session was successfully updated
-or not.
-
-#### Definition ####
-
-```
-typedef void(* SbDrmSessionUpdatedFunc) (SbDrmSystem drm_system, void *context, int ticket, const void *session_id, int session_id_size, bool succeeded)
-```
-
-### SbDrmSystem ###
-
-A handle to a DRM system which can be used with either an SbDecoder or a
-SbPlayer.
-
-#### Definition ####
-
-```
-typedef struct SbDrmSystemPrivate* SbDrmSystem
-```
-
-## Structs ##
-
-### SbDrmKeyId ###
-
-#### Members ####
-
-*   `uint8_t identifier`
-
-    The ID of the license (or key) required to decrypt this sample. For
-    PlayReady, this is the license GUID in packed little-endian binary form.
-*   `int identifier_size`
-
-### SbDrmSampleInfo ###
-
-All the optional information needed per sample for encrypted samples.
-
-#### Members ####
-
-*   `uint8_t initialization_vector`
-
-    The Initialization Vector needed to decrypt this sample.
-*   `int initialization_vector_size`
-*   `uint8_t identifier`
-
-    The ID of the license (or key) required to decrypt this sample. For
-    PlayReady, this is the license GUID in packed little-endian binary form.
-*   `int identifier_size`
-*   `int32_t subsample_count`
-
-    The number of subsamples in this sample, must be at least 1.
-*   `constSbDrmSubSampleMapping* subsample_mapping`
-
-    The clear/encrypted mapping of each subsample in this sample. This must be
-    an array of `subsample_count` mappings.
-
-### SbDrmSubSampleMapping ###
-
-A mapping of clear and encrypted bytes for a single subsample. All subsamples
-within a sample must be encrypted with the same encryption parameters. The clear
-bytes always appear first in the sample.
-
-#### Members ####
-
-*   `int32_t clear_byte_count`
-
-    How many bytes of the corresponding subsample are not encrypted
-*   `int32_t encrypted_byte_count`
-
-    How many bytes of the corresponding subsample are encrypted.
-
-## Functions ##
-
-### SbDrmCloseSession ###
-
-Clear any internal states/resources related to the specified `session_id`.
-
-#### Declaration ####
-
-```
-void SbDrmCloseSession(SbDrmSystem drm_system, const void *session_id, int session_id_size)
-```
-
-### SbDrmCreateSystem ###
-
-Creates a new DRM system that can be used when constructing an SbPlayer or an
-SbDecoder.
-
-This function returns kSbDrmSystemInvalid if `key_system` is unsupported.
-
-Also see the documentation of SbDrmGenerateSessionUpdateRequest() and
-SbDrmUpdateSession() for more details.
-
-`key_system`: The DRM key system to be created. The value should be in the form
-of "com.example.somesystem" as suggested by [https://w3c.github.io/encrypted-media/#key-system](https://w3c.github.io/encrypted-media/#key-system)) . All
-letters in the value should be lowercase and will be matched exactly with known
-DRM key systems of the platform. `context`: A value passed when any of this
-function's callback parameters are called. `update_request_callback`: A function
-that is called every time after SbDrmGenerateSessionUpdateRequest() is called.
-`session_updated_callback`: A function that is called every time after
-SbDrmUpdateSession() is called. `key_statuses_changed_callback`: A function that
-can be called to indicate that key statuses have changed.
-`server_certificate_updated_callback`: A function that is called to report
-whether the server certificate has been successfully updated. It is called once
-and only once. It is possible that the callback is called before the function
-returns. `session_closed_callback`: A function that can be called to indicate
-that a session has closed.
-
-#### Declaration ####
-
-```
-SbDrmSystem SbDrmCreateSystem(const char *key_system, void *context, SbDrmSessionUpdateRequestFunc update_request_callback, SbDrmSessionUpdatedFunc session_updated_callback, SbDrmSessionKeyStatusesChangedFunc key_statuses_changed_callback, SbDrmSessionClosedFunc session_closed_callback)
-```
-
-### SbDrmDestroySystem ###
-
-Destroys `drm_system`, which implicitly removes all keys installed in it and
-invalidates all outstanding session update requests. A DRM system cannot be
-destroyed unless any associated SbPlayer or SbDecoder has first been destroyed.
-
-All callbacks are guaranteed to be finished when this function returns. As a
-result, if this function is called from a callback that is passed to
-SbDrmCreateSystem(), a deadlock will occur.
-
-`drm_system`: The DRM system to be destroyed.
-
-#### Declaration ####
-
-```
-void SbDrmDestroySystem(SbDrmSystem drm_system)
-```
-
-### SbDrmGenerateSessionUpdateRequest ###
-
-Asynchronously generates a session update request payload for
-`initialization_data`, of `initialization_data_size`, in case sensitive `type`,
-extracted from the media stream, in `drm_system`'s key system.
-
-This function calls `drm_system`'s `update_request_callback` function, which is
-defined when the DRM system is created by SbDrmCreateSystem. When calling that
-function, this function either sends `context` (also from `SbDrmCreateSystem`)
-and a populated request, or it sends NULL `session_id` if an error occurred.
-
-`drm_system`'s `context` may be used to route callbacks back to an object
-instance.
-
-Callbacks may be called either from the current thread before this function
-returns or from another thread.
-
-`drm_system`: The DRM system that defines the key system used for the session
-update request payload as well as the callback function that is called as a
-result of the function being called.
-
-`ticket`: The opaque ID that allows to distinguish callbacks from multiple
-concurrent calls to SbDrmGenerateSessionUpdateRequest(), which will be passed to
-`update_request_callback` as-is. It is the responsibility of the caller to
-establish ticket uniqueness, issuing multiple requests with the same ticket may
-result in undefined behavior. The value `kSbDrmTicketInvalid` must not be used.
-
-`type`: The case-sensitive type of the session update request payload.
-`initialization_data`: The data for which the session update request payload is
-created. `initialization_data_size`: The size of the session update request
-payload.
-
-#### Declaration ####
-
-```
-void SbDrmGenerateSessionUpdateRequest(SbDrmSystem drm_system, int ticket, const char *type, const void *initialization_data, int initialization_data_size)
-```
-
-### SbDrmGetKeyCount ###
-
-Returns the number of keys installed in `drm_system`.
-
-`drm_system`: The system for which the number of installed keys is retrieved.
-
-#### Declaration ####
-
-```
-int SbDrmGetKeyCount(SbDrmSystem drm_system)
-```
-
-### SbDrmGetKeyStatus ###
-
-Gets `out_key`, `out_key_size`, and `out_status` for the key with `index` in
-`drm_system`. Returns whether a key is installed at `index`. If not, the output
-parameters, which all must not be NULL, will not be modified.
-
-#### Declaration ####
-
-```
-bool SbDrmGetKeyStatus(SbDrmSystem drm_system, const void *session_id, int session_id_size, int index, void **out_key, int *out_key_size, SbDrmKeyStatus *out_status)
-```
-
-### SbDrmRemoveAllKeys ###
-
-Removes all installed keys for `drm_system`. Any outstanding session update
-requests are also invalidated.
-
-`drm_system`: The DRM system for which keys should be removed.
-
-#### Declaration ####
-
-```
-void SbDrmRemoveAllKeys(SbDrmSystem drm_system)
-```
-
-### SbDrmSystemIsValid ###
-
-Indicates whether `drm_system` is a valid SbDrmSystem.
-
-#### Declaration ####
-
-```
-static bool SbDrmSystemIsValid(SbDrmSystem drm)
-```
-
-### SbDrmTicketIsValid ###
-
-Indicates whether `ticket` is a valid ticket.
-
-#### Declaration ####
-
-```
-static bool SbDrmTicketIsValid(int ticket)
-```
-
-### SbDrmUpdateSession ###
-
-Update session with `key`, in `drm_system`'s key system, from the license server
-response. Calls `session_updated_callback` with `context` and whether the update
-succeeded. `context` may be used to route callbacks back to an object instance.
-
-`ticket` is the opaque ID that allows to distinguish callbacks from multiple
-concurrent calls to SbDrmUpdateSession(), which will be passed to
-`session_updated_callback` as-is. It is the responsibility of the caller to
-establish ticket uniqueness, issuing multiple calls with the same ticket may
-result in undefined behavior.
-
-Once the session is successfully updated, an SbPlayer or SbDecoder associated
-with that DRM key system will be able to decrypt encrypted samples.
-
-`drm_system`'s `session_updated_callback` may called either from the current
-thread before this function returns or from another thread.
-
-#### Declaration ####
-
-```
-void SbDrmUpdateSession(SbDrmSystem drm_system, int ticket, const void *key, int key_size, const void *session_id, int session_id_size)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/event.md b/src/cobalt/site/docs/reference/starboard/modules/6/event.md
deleted file mode 100644
index c851461..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/event.md
+++ /dev/null
@@ -1,355 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: event.h"
----
-
-Defines the event system that wraps the Starboard main loop and entry point.
-
-## The Starboard Application Lifecycle ##
-
-```
-    ---------- *
-   |           |
-   |        Preload
-   |           |
-   |           V
- Start   [ PRELOADING ] ------------
-   |           |                    |
-   |         Start                  |
-   |           |                    |
-   |           V                    |
-    ----> [ STARTED ] <----         |
-               |           |        |
-             Pause       Unpause    |
-               |           |     Suspend
-               V           |        |
-    -----> [ PAUSED ] -----         |
-   |           |                    |
-Resume      Suspend                 |
-   |           |                    |
-   |           V                    |
-    ---- [ SUSPENDED ] <------------
-               |
-              Stop
-               |
-               V
-          [ STOPPED ]
-
-```
-
-The first event that a Starboard application receives is either `Start`
-(`kSbEventTypeStart`) or `Preload` (`kSbEventTypePreload`). `Start` puts the
-application in the `STARTED` state, whereas `Preload` puts the application in
-the `PRELOADING` state.
-
-`PRELOADING` can only happen as the first application state. In this state, the
-application should start and run as normal, but will not receive any input, and
-should not try to initialize graphics resources (via GL or `SbBlitter`). In
-`PRELOADING`, the application can receive `Start` or `Suspend` events. `Start`
-will receive the same data that was passed into `Preload`.
-
-In the `STARTED` state, the application is in the foreground and can expect to
-do all of the normal things it might want to do. Once in the `STARTED` state, it
-may receive a `Pause` event, putting the application into the `PAUSED` state.
-
-In the `PAUSED` state, the application is still visible, but has lost focus, or
-it is partially obscured by a modal dialog, or it is on its way to being shut
-down. The application should pause activity in this state. In this state, it can
-receive `Unpause` to be brought back to the foreground state (`STARTED`), or
-`Suspend` to be pushed further in the background to the `SUSPENDED` state.
-
-In the `SUSPENDED` state, the application is generally not visible. It should
-immediately release all graphics and video resources, and shut down all
-background activity (timers, rendering, etc). Additionally, the application
-should flush storage to ensure that if the application is killed, the storage
-will be up-to-date. The application may be killed at this point, but will
-ideally receive a `Stop` event for a more graceful shutdown.
-
-Note that the application is always expected to transition through `PAUSED` to
-`SUSPENDED` before receiving `Stop` or being killed.
-
-## Enums ##
-
-### SbEventType ###
-
-An enumeration of all possible event types dispatched directly by the system.
-Each event is accompanied by a void* data argument, and each event must define
-the type of the value pointed to by that data argument, if any.
-
-#### Values ####
-
-*   `kSbEventTypePreload`
-
-    Applications should perform initialization and prepare to react to
-    subsequent events, but must not initialize any graphics resources (through
-    GL or SbBlitter). The intent of this event is to allow the application to do
-    as much work as possible ahead of time, so that when the application is
-    first brought to the foreground, it's as fast as a resume.
-
-    The `kSbEventTypeStart` event may be sent at any time, regardless of
-    initialization state. Input events will not be sent in the `PRELOADING`
-    state. This event will only be sent once for a given process launch.
-    SbEventStartData is passed as the data argument.
-
-    The system may send `kSbEventTypeSuspend` in `PRELOADING` if it wants to
-    push the app into a lower resource consumption state. Applications can alo
-    call SbSystemRequestSuspend() when they are done preloading to request this.
-*   `kSbEventTypeStart`
-
-    The first event that an application receives on startup when starting
-    normally (i.e. not being preloaded). Applications should perform
-    initialization, start running, and prepare to react to subsequent events.
-    Applications that wish to run and then exit must call
-    `SbSystemRequestStop()` to terminate. This event will only be sent once for
-    a given process launch. `SbEventStartData` is passed as the data argument.
-    In case of preload, the `SbEventStartData` will be the same as what was
-    passed to `kSbEventTypePreload`.
-*   `kSbEventTypePause`
-
-    A dialog will be raised or the application will otherwise be put into a
-    background-but-visible or partially-obscured state (PAUSED). Graphics and
-    video resources will still be available, but the application should pause
-    foreground activity like animations and video playback. Can only be received
-    after a Start event. The only events that should be dispatched after a Pause
-    event are Unpause or Suspend. No data argument.
-*   `kSbEventTypeUnpause`
-
-    The application is returning to the foreground (STARTED) after having been
-    put in the PAUSED (e.g. partially-obscured) state. The application should
-    unpause foreground activity like animations and video playback. Can only be
-    received after a Pause or Resume event. No data argument.
-*   `kSbEventTypeSuspend`
-
-    The operating system will put the application into a Suspended state after
-    this event is handled. The application is expected to stop periodic
-    background work, release ALL graphics and video resources, and flush any
-    pending SbStorage writes. Some platforms will terminate the application if
-    work is done or resources are retained after suspension. Can only be
-    received after a Pause event. The only events that should be dispatched
-    after a Suspend event are Resume or Stop. On some platforms, the process may
-    also be killed after Suspend without a Stop event. No data argument.
-*   `kSbEventTypeResume`
-
-    The operating system has restored the application to the PAUSED state from
-    the SUSPENDED state. This is the first event the application will receive
-    coming out of SUSPENDED, and it will only be received after a Suspend event.
-    The application will now be in the PAUSED state. No data argument.
-*   `kSbEventTypeStop`
-
-    The operating system will shut the application down entirely after this
-    event is handled. Can only be recieved after a Suspend event, in the
-    SUSPENDED state. No data argument.
-*   `kSbEventTypeInput`
-
-    A user input event, including keyboard, mouse, gesture, or something else.
-    SbInputData (from input.h) is passed as the data argument.
-*   `kSbEventTypeUser`
-
-    A user change event, which means a new user signed-in or signed-out, or the
-    current user changed. No data argument, call SbUserGetSignedIn() and
-    SbUserGetCurrent() to get the latest changes.
-*   `kSbEventTypeLink`
-
-    A navigational link has come from the system, and the application should
-    consider handling it by navigating to the corresponding application
-    location. The data argument is an application-specific, null-terminated
-    string.
-*   `kSbEventTypeVerticalSync`
-
-    The beginning of a vertical sync has been detected. This event is very
-    timing-sensitive, so as little work as possible should be done on the main
-    thread if the application wants to receive this event in a timely manner. No
-    data argument.
-*   `kSbEventTypeNetworkDisconnect`
-
-    The platform has detected a network disconnection. The platform should make
-    a best effort to send an event of this type when the network disconnects,
-    but there are likely to be cases where the platform cannot detect the
-    disconnection (e.g. if the connection is via a powered hub which becomes
-    disconnected), so the current network state cannot always be inferred from
-    the sequence of Connect/Disconnect events.
-*   `kSbEventTypeNetworkConnect`
-
-    The platform has detected a network connection. This event may be sent at
-    application start-up, and should always be sent if the network reconnects
-    since a disconnection event was sent.
-*   `kSbEventTypeScheduled`
-
-    An event type reserved for scheduled callbacks. It will only be sent in
-    response to an application call to SbEventSchedule(), and it will call the
-    callback directly, so SbEventHandle should never receive this event
-    directly. The data type is an internally-defined structure.
-*   `kSbEventTypeAccessiblitySettingsChanged`
-
-    The platform's accessibility settings have changed. The application should
-    query the accessibility settings using the appropriate APIs to get the new
-    settings. Note this excludes captions settings changes, which causes
-    kSbEventTypeAccessibilityCaptionSettingsChanged to fire.
-*   `kSbEventTypeLowMemory`
-
-    An optional event that platforms may send to indicate that the application
-    may soon be terminated (or crash) due to low memory availability. The
-    application may respond by reducing memory consumption by running a Garbage
-    Collection, flushing caches, or something similar. There is no requirement
-    to respond to or handle this event, it is only advisory.
-*   `kSbEventTypeOnScreenKeyboardShown`
-
-    The platform has shown the on screen keyboard. This event is triggered by
-    the system or by the application's OnScreenKeyboard show method. The event
-    has int data representing a ticket. The ticket is used by the application to
-    mark individual calls to the show method as successfully completed. Events
-    triggered by the application have tickets passed in via
-    SbWindowShowOnScreenKeyboard. System-triggered events have ticket value
-    kSbEventOnScreenKeyboardInvalidTicket.
-*   `kSbEventTypeOnScreenKeyboardHidden`
-
-    The platform has hidden the on screen keyboard. This event is triggered by
-    the system or by the application's OnScreenKeyboard hide method. The event
-    has int data representing a ticket. The ticket is used by the application to
-    mark individual calls to the hide method as successfully completed. Events
-    triggered by the application have tickets passed in via
-    SbWindowHideOnScreenKeyboard. System-triggered events have ticket value
-    kSbEventOnScreenKeyboardInvalidTicket.
-*   `kSbEventTypeOnScreenKeyboardFocused`
-
-    The platform has focused the on screen keyboard. This event is triggered by
-    the system or by the application's OnScreenKeyboard focus method. The event
-    has int data representing a ticket. The ticket is used by the application to
-    mark individual calls to the focus method as successfully completed. Events
-    triggered by the application have tickets passed in via
-    SbWindowFocusOnScreenKeyboard. System-triggered events have ticket value
-    kSbEventOnScreenKeyboardInvalidTicket.
-*   `kSbEventTypeOnScreenKeyboardBlurred`
-
-    The platform has blurred the on screen keyboard. This event is triggered by
-    the system or by the application's OnScreenKeyboard blur method. The event
-    has int data representing a ticket. The ticket is used by the application to
-    mark individual calls to the blur method as successfully completed. Events
-    triggered by the application have tickets passed in via
-    SbWindowBlurOnScreenKeyboard. System-triggered events have ticket value
-    kSbEventOnScreenKeyboardInvalidTicket.
-*   `kSbEventTypeAccessibilityCaptionSettingsChanged`
-
-    One or more of the fields returned by SbAccessibilityGetCaptionSettings has
-    changed.
-
-## Typedefs ##
-
-### SbEventCallback ###
-
-A function that can be called back from the main Starboard event pump.
-
-#### Definition ####
-
-```
-typedef void(* SbEventCallback) (void *context)
-```
-
-### SbEventDataDestructor ###
-
-A function that will cleanly destroy an event data instance of a specific type.
-
-#### Definition ####
-
-```
-typedef void(* SbEventDataDestructor) (void *data)
-```
-
-### SbEventId ###
-
-An ID that can be used to refer to a scheduled event.
-
-#### Definition ####
-
-```
-typedef uint32_t SbEventId
-```
-
-## Structs ##
-
-### SbEvent ###
-
-Structure representing a Starboard event and its data.
-
-#### Members ####
-
-*   `SbEventType type`
-*   `void * data`
-
-### SbEventStartData ###
-
-Event data for kSbEventTypeStart events.
-
-#### Members ####
-
-*   `char ** argument_values`
-
-    The command-line argument values (argv).
-*   `int argument_count`
-
-    The command-line argument count (argc).
-*   `const char * link`
-
-    The startup link, if any.
-
-## Functions ##
-
-### SbEventCancel ###
-
-Cancels the specified `event_id`. Note that this function is a no-op if the
-event already fired. This function can be safely called from any thread, but the
-only way to guarantee that the event does not run anyway is to call it from the
-main Starboard event loop thread.
-
-#### Declaration ####
-
-```
-void SbEventCancel(SbEventId event_id)
-```
-
-### SbEventHandle ###
-
-The entry point that Starboard applications MUST implement. Any memory pointed
-at by `event` or the `data` field inside `event` is owned by the system, and
-that memory is reclaimed after this function returns, so the implementation must
-copy this data to extend its life. This behavior should also be assumed of all
-fields within the `data` object, unless otherwise explicitly specified.
-
-This function is only called from the main Starboard thread. There is no
-specification about what other work might happen on this thread, so the
-application should generally do as little work as possible on this thread, and
-just dispatch it over to another thread.
-
-#### Declaration ####
-
-```
-SB_IMPORT void SbEventHandle(const SbEvent *event)
-```
-
-### SbEventIsIdValid ###
-
-Returns whether the given event handle is valid.
-
-#### Declaration ####
-
-```
-static bool SbEventIsIdValid(SbEventId handle)
-```
-
-### SbEventSchedule ###
-
-Schedules an event `callback` into the main Starboard event loop. This function
-may be called from any thread, but `callback` is always called from the main
-Starboard thread, queued with other pending events.
-
-`callback`: The callback function to be called. `context`: The context that is
-passed to the `callback` function. `delay`: The minimum number of microseconds
-to wait before calling the `callback` function. Set `delay` to `0` to call the
-callback as soon as possible.
-
-#### Declaration ####
-
-```
-SbEventId SbEventSchedule(SbEventCallback callback, void *context, SbTime delay)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/export.md b/src/cobalt/site/docs/reference/starboard/modules/6/export.md
deleted file mode 100644
index a6907e2..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/export.md
+++ /dev/null
@@ -1,17 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: export.h"
----
-
-Provides macros for properly exporting or importing symbols from shared
-libraries.
-
-## Macros ##
-
-### SB_EXPORT ###
-
-COMPONENT_BUILD is defined when generating shared libraries for each project,
-rather than static libraries. This means we need to be careful about
-EXPORT/IMPORT. SB_IS_LIBRARY is defined when building Starboard as a shared
-library to be linked into a client app. In this case, we want to explicitly
-define EXPORT/IMPORT so that Starboard's symbols are visible to such clients.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/file.md b/src/cobalt/site/docs/reference/starboard/modules/6/file.md
deleted file mode 100644
index b115501..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/file.md
+++ /dev/null
@@ -1,390 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: file.h"
----
-
-Defines file system input/output functions.
-
-## Macros ##
-
-### kSbFileInvalid ###
-
-Well-defined value for an invalid file handle.
-
-## Enums ##
-
-### SbFileError ###
-
-kSbFileErrorAccessDenied is returned when a call fails because of a filesystem
-restriction. kSbFileErrorSecurity is returned when a security policy doesn't
-allow the operation to be executed.
-
-#### Values ####
-
-*   `kSbFileOk`
-*   `kSbFileErrorFailed`
-*   `kSbFileErrorInUse`
-*   `kSbFileErrorExists`
-*   `kSbFileErrorNotFound`
-*   `kSbFileErrorAccessDenied`
-*   `kSbFileErrorTooManyOpened`
-*   `kSbFileErrorNoMemory`
-*   `kSbFileErrorNoSpace`
-*   `kSbFileErrorNotADirectory`
-*   `kSbFileErrorInvalidOperation`
-*   `kSbFileErrorSecurity`
-*   `kSbFileErrorAbort`
-*   `kSbFileErrorNotAFile`
-*   `kSbFileErrorNotEmpty`
-*   `kSbFileErrorInvalidUrl`
-*   `kSbFileErrorMax`
-
-    Put new entries here and increment kSbFileErrorMax.
-
-### SbFileFlags ###
-
-Flags that define how a file is used in the application. These flags should be
-or'd together when passed to SbFileOpen to open or create a file.
-
-The following five flags are mutually exclusive. You must specify exactly one of
-them:
-
-*   `kSbFileOpenAlways`
-
-*   `kSbFileOpenOnly`
-
-*   `kSbFileOpenTruncated`
-
-*   `kSbFileCreateAlways`
-
-*   `kSbFileCreateOnly`
-
-In addition, one or more of the following flags must be specified:
-
-*   `kSbFileRead`
-
-*   `kSbFileWrite`
-
-The `kSbFileAsync` flag is optional.
-
-#### Values ####
-
-*   `kSbFileOpenOnly`
-*   `kSbFileCreateOnly`
-*   `kSbFileOpenAlways`
-
-    does not already exist.
-*   `kSbFileCreateAlways`
-
-    path or creates a new file at that path.
-*   `kSbFileOpenTruncated`
-
-    or overwrites an existing file at that path.
-*   `kSbFileRead`
-
-    only if it exists.
-*   `kSbFileWrite`
-*   `kSbFileAsync`
-
-### SbFileWhence ###
-
-This explicit mapping matches both FILE_ on Windows and SEEK_ on Linux.
-
-#### Values ####
-
-*   `kSbFileFromBegin`
-*   `kSbFileFromCurrent`
-*   `kSbFileFromEnd`
-
-## Typedefs ##
-
-### SbFile ###
-
-A handle to an open file.
-
-#### Definition ####
-
-```
-typedef SbFilePrivate* SbFile
-```
-
-## Structs ##
-
-### SbFileInfo ###
-
-Used to hold information about a file.
-
-#### Members ####
-
-*   `int64_t size`
-
-    The size of the file in bytes. Undefined when is_directory is true.
-*   `bool is_directory`
-
-    Whether the file corresponds to a directory.
-*   `bool is_symbolic_link`
-
-    Whether the file corresponds to a symbolic link.
-*   `SbTime last_modified`
-
-    The last modified time of a file.
-*   `SbTime last_accessed`
-
-    The last accessed time of a file.
-*   `SbTime creation_time`
-
-    The creation time of a file.
-
-## Functions ##
-
-### SbFileCanOpen ###
-
-Indicates whether SbFileOpen() with the given `flags` is allowed for `path`.
-
-`path`: The absolute path to be checked. `flags`: The flags that are being
-evaluated for the given `path`.
-
-#### Declaration ####
-
-```
-bool SbFileCanOpen(const char *path, int flags)
-```
-
-### SbFileClose ###
-
-Closes `file`. The return value indicates whether the file was closed
-successfully.
-
-`file`: The absolute path of the file to be closed.
-
-#### Declaration ####
-
-```
-bool SbFileClose(SbFile file)
-```
-
-### SbFileDelete ###
-
-Deletes the regular file, symlink, or empty directory at `path`. This function
-is used primarily to clean up after unit tests. On some platforms, this function
-fails if the file in question is being held open.
-
-`path`: The absolute path fo the file, symlink, or directory to be deleted.
-
-#### Declaration ####
-
-```
-bool SbFileDelete(const char *path)
-```
-
-### SbFileExists ###
-
-Indicates whether a file or directory exists at `path`.
-
-`path`: The absolute path of the file or directory being checked.
-
-#### Declaration ####
-
-```
-bool SbFileExists(const char *path)
-```
-
-### SbFileFlush ###
-
-Flushes the write buffer to `file`. Data written via SbFileWrite is not
-necessarily committed until the SbFile is flushed or closed.
-
-`file`: The SbFile to which the write buffer is flushed.
-
-#### Declaration ####
-
-```
-bool SbFileFlush(SbFile file)
-```
-
-### SbFileGetInfo ###
-
-Retrieves information about `file`. The return value indicates whether the file
-information was retrieved successfully.
-
-`file`: The SbFile for which information is retrieved. `out_info`: The variable
-into which the retrieved data is placed. This variable is not touched if the
-operation is not successful.
-
-#### Declaration ####
-
-```
-bool SbFileGetInfo(SbFile file, SbFileInfo *out_info)
-```
-
-### SbFileGetPathInfo ###
-
-Retrieves information about the file at `path`. The return value indicates
-whether the file information was retrieved successfully.
-
-`file`: The absolute path of the file for which information is retrieved.
-`out_info`: The variable into which the retrieved data is placed. This variable
-is not touched if the operation is not successful.
-
-#### Declaration ####
-
-```
-bool SbFileGetPathInfo(const char *path, SbFileInfo *out_info)
-```
-
-### SbFileIsValid ###
-
-Returns whether the given file handle is valid.
-
-#### Declaration ####
-
-```
-static bool SbFileIsValid(SbFile file)
-```
-
-### SbFileModeStringToFlags ###
-
-Converts an ISO `fopen()` mode string into flags that can be equivalently passed
-into SbFileOpen().
-
-`mode`: The mode string to be converted into flags.
-
-#### Declaration ####
-
-```
-int SbFileModeStringToFlags(const char *mode)
-```
-
-### SbFileOpen ###
-
-Opens the file at `path`, which must be absolute, creating it if specified by
-`flags`. The read/write position is at the beginning of the file.
-
-Note that this function only guarantees the correct behavior when `path` points
-to a file. The behavior is undefined if `path` points to a directory.
-
-`path`: The absolute path of the file to be opened. `flags`: `SbFileFlags` that
-determine how the file is used in the application. Among other things, `flags`
-can indicate whether the application should create `path` if `path` does not
-already exist. `out_created`: Starboard sets this value to `true` if a new file
-is created or if an old file is truncated to zero length to simulate a new file,
-which can happen if the `kSbFileCreateAlways` flag is set. Otherwise, Starboard
-sets this value to `false`. `out_error`: If `path` cannot be created, this is
-set to `kSbFileInvalid`. Otherwise, it is `NULL`.
-
-#### Declaration ####
-
-```
-SbFile SbFileOpen(const char *path, int flags, bool *out_created, SbFileError *out_error)
-```
-
-### SbFileRead ###
-
-Reads `size` bytes (or until EOF is reached) from `file` into `data`, starting
-at the file's current position.
-
-The return value specifies the number of bytes read or `-1` if there was an
-error. Note that this function does NOT make a best effort to read all data on
-all platforms; rather, it just reads however many bytes are quickly available.
-However, this function can be run in a loop to make it a best-effort read.
-
-`file`: The SbFile from which to read data. `data`: The variable to which data
-is read. `size`: The amount of data (in bytes) to read.
-
-#### Declaration ####
-
-```
-int SbFileRead(SbFile file, char *data, int size)
-```
-
-### SbFileReadAll ###
-
-Reads `size` bytes (or until EOF is reached) from `file` into `data`, starting
-at the file's current position.
-
-The return value specifies the number of bytes read or `-1` if there was an
-error. Note that, unlike `SbFileRead`, this function does make a best effort to
-read all data on all platforms. As such, it is not intended for stream-oriented
-files but instead for cases when the normal expectation is that `size` bytes can
-be read unless there is an error.
-
-`file`: The SbFile from which to read data. `data`: The variable to which data
-is read. `size`: The amount of data (in bytes) to read.
-
-#### Declaration ####
-
-```
-static int SbFileReadAll(SbFile file, char *data, int size)
-```
-
-### SbFileSeek ###
-
-Changes the current read/write position in `file`. The return value identifies
-the resultant current read/write position in the file (relative to the start) or
-`-1` in case of an error. This function might not support seeking past the end
-of the file on some platforms.
-
-`file`: The SbFile in which the read/write position will be changed. `whence`:
-The starting read/write position. The position is modified relative to this
-value. `offset`: The amount that the read/write position is changed, relative to
-`whence`.
-
-#### Declaration ####
-
-```
-int64_t SbFileSeek(SbFile file, SbFileWhence whence, int64_t offset)
-```
-
-### SbFileTruncate ###
-
-Truncates the given `file` to the given `length`. The return value indicates
-whether the file was truncated successfully.
-
-`file`: The file to be truncated. `length`: The expected length of the file
-after it is truncated. If `length` is greater than the current size of the file,
-then the file is extended with zeros. If `length` is negative, then the function
-is a no-op and returns `false`.
-
-#### Declaration ####
-
-```
-bool SbFileTruncate(SbFile file, int64_t length)
-```
-
-### SbFileWrite ###
-
-Writes the given buffer into `file` at the file's current position, overwriting
-any data that was previously there.
-
-The return value identifies the number of bytes written, or `-1` on error. Note
-that this function does NOT make a best effort to write all data; rather, it
-writes however many bytes can be written quickly. Generally, this means that it
-writes however many bytes as possible without blocking on IO. Run this function
-in a loop to ensure that all data is written.
-
-`file`: The SbFile to which data will be written. `data`: The data to be
-written. `size`: The amount of data (in bytes) to write.
-
-#### Declaration ####
-
-```
-int SbFileWrite(SbFile file, const char *data, int size)
-```
-
-### SbFileWriteAll ###
-
-Writes the given buffer into `file`, starting at the beginning of the file, and
-overwriting any data that was previously there. Unlike SbFileWrite, this
-function does make a best effort to write all data on all platforms.
-
-The return value identifies the number of bytes written, or `-1` on error.
-
-`file`: The file to which data will be written. `data`: The data to be written.
-`size`: The amount of data (in bytes) to write.
-
-#### Declaration ####
-
-```
-static int SbFileWriteAll(SbFile file, const char *data, int size)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/image.md b/src/cobalt/site/docs/reference/starboard/modules/6/image.md
deleted file mode 100644
index 634dab8..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/image.md
+++ /dev/null
@@ -1,82 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: image.h"
----
-
-API for hardware accelerated image decoding. This module allows for the client
-to feed in raw, encoded data to be decoded directly into an SbDecodeTarget. It
-also provides an interface for the client to query what combinations of encoded
-image formats and SbDecodeTargetFormats are supported or not.
-
-All functions in this module are safe to call from any thread at any point in
-time.
-
-## SbImageIsDecodeSupported and SbImageDecode Example ##
-
-Let's assume that we're on a Blitter platform.
-
-```
-SbDecodeTargetProvider* provider = GetProviderFromSomewhere();
-void* data = GetCompressedJPEGFromSomewhere();
-int data_size = GetCompressedJPEGSizeFromSomewhere();
-const char* mime_type = "image/jpeg";
-SbDecodeTargetFormat format = kSbDecodeTargetFormat1PlaneRGBA;
-
-if (!SbImageIsDecodeSupported(mime_type, format)) {
-  return;
-}
-
-SbDecodeTarget result_target = SbDecodeImage(provider, data, data_size,
-                                             mime_type, format);
-SbBlitterSurface surface =
-    SbDecodeTargetGetPlane(target, kSbDecodeTargetPlaneRGBA);
-// Do stuff with surface...
-```
-
-## Functions ##
-
-### SbImageDecode ###
-
-Attempt to decode encoded `mime_type` image data `data` of size `data_size` into
-an SbDecodeTarget of SbDecodeFormatType `format`, possibly using
-SbDecodeTargetProvider `provider`, if it is non-null. Thus, four following
-scenarios regarding the provider may happen:
-
-1.  The provider is required by the `SbImageDecode` implementation and no
-    provider is given. The implementation should gracefully fail by immediately
-    returning kSbDecodeTargetInvalid.
-
-1.  The provider is required and is passed in. The implementation will proceed
-    forward, using the SbDecodeTarget from the provider.
-
-1.  The provider is not required and is passed in. The provider will NOT be
-    called, and the implementation will proceed to decoding however it desires.
-
-1.  The provider is not required and is not passed in. The implementation will
-    proceed forward.
-
-Thus, it is NOT safe for clients of this API to assume that the `provider` it
-passes in will be called. Finally, if the decode succeeds, a new SbDecodeTarget
-will be allocated. If `mime_type` image decoding for the requested format is not
-supported or the decode fails, kSbDecodeTargetInvalid will be returned, with any
-intermediate allocations being cleaned up in the implementation.
-
-#### Declaration ####
-
-```
-SbDecodeTarget SbImageDecode(SbDecodeTargetGraphicsContextProvider *context_provider, void *data, int data_size, const char *mime_type, SbDecodeTargetFormat format)
-```
-
-### SbImageIsDecodeSupported ###
-
-Whether the current platform supports hardware accelerated decoding an image of
-mime type `mime_type` into SbDecodeTargetFormat `format`. The result of this
-function must not change over the course of the program, which means that the
-results of this function may be cached indefinitely.
-
-#### Declaration ####
-
-```
-bool SbImageIsDecodeSupported(const char *mime_type, SbDecodeTargetFormat format)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/input.md b/src/cobalt/site/docs/reference/starboard/modules/6/input.md
deleted file mode 100644
index 62be171..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/input.md
+++ /dev/null
@@ -1,168 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: input.h"
----
-
-Defines input events and associated data types.
-
-## Enums ##
-
-### SbInputDeviceType ###
-
-Identifies possible input subsystem types. The types of events that each device
-type produces correspond to `SbInputEventType` values.
-
-#### Values ####
-
-*   `kSbInputDeviceTypeGesture`
-
-    Input from a gesture-detection mechanism. Examples include Kinect, Wiimotes,
-    etc...
-
-    Produces `Move`, `Press` and `Unpress` events.
-*   `kSbInputDeviceTypeGamepad`
-
-    Input from a gamepad, following the layout provided in the W3C Web Gamepad
-    API. [ [https://www.w3.org/TR/gamepad/](https://www.w3.org/TR/gamepad/) ]
-
-    Produces `Move`, `Press` and `Unpress` events.
-*   `kSbInputDeviceTypeKeyboard`
-
-    Keyboard input from a traditional keyboard or game controller chatpad.
-
-    Produces `Press` and `Unpress` events.
-*   `kSbInputDeviceTypeMouse`
-
-    Input from a traditional mouse.
-
-    Produces `Move`, `Press`, and `Unpress` events.
-*   `kSbInputDeviceTypeRemote`
-
-    Input from a TV remote-control-style device.
-
-    Produces `Press` and `Unpress` events.
-*   `kSbInputDeviceTypeTouchScreen`
-
-    Input from a single- or multi-touchscreen.
-
-    Produces `Move`, `Press`, and `Unpress` events.
-*   `kSbInputDeviceTypeTouchPad`
-
-    Input from a touchpad that is not masquerading as a mouse.
-
-    Produces `Move`, `Press`, and `Unpress` events.
-*   `kSbInputDeviceTypeOnScreenKeyboard`
-
-    Keyboard input from an on screen keyboard.
-
-    Produces `Input` events.
-
-### SbInputEventType ###
-
-The action that an input event represents.
-
-#### Values ####
-
-*   `kSbInputEventTypeMove`
-
-    Device Movement. In the case of `Mouse`, and perhaps `Gesture`, the movement
-    tracks an absolute cursor position. In the case of `TouchPad`, only relative
-    movements are provided.
-*   `kSbInputEventTypePress`
-
-    Key or button press activation. This could be a key on a keyboard, a button
-    on a mouse or game controller, a push from a touch screen, or a gesture. An
-    `Unpress` event is subsequently delivered when the `Press` event terminates,
-    such as when the key/button/finger is raised. Injecting repeat presses is up
-    to the client.
-*   `kSbInputEventTypeUnpress`
-
-    Key or button deactivation. The counterpart to the `Press` event, this event
-    is sent when the key or button being pressed is released.
-*   `kSbInputEventTypeWheel`
-
-    Wheel movement. Provides relative movements of the `Mouse` wheel.
-*   `kSbInputEventTypeInput`
-
-    [https://w3c.github.io/uievents/#event-type-input](https://w3c.github.io/uievents/#event-type-input)
-
-## Structs ##
-
-### SbInputData ###
-
-Event data for `kSbEventTypeInput` events.
-
-#### Members ####
-
-*   `SbWindow window`
-
-    The window in which the input was generated.
-*   `SbInputEventType type`
-
-    The type of input event that this represents.
-*   `SbInputDeviceType device_type`
-
-    The type of device that generated this input event.
-*   `int device_id`
-
-    An identifier that is unique among all connected devices.
-*   `SbKey key`
-
-    An identifier that indicates which keyboard key or mouse button was involved
-    in this event, if any. All known keys for all devices are mapped to a single
-    ID space, defined by the `SbKey` enum in `key.h`.
-*   `wchar_t character`
-
-    The character that corresponds to the key. For an external keyboard, this
-    character also depends on the keyboard language. The value is `0` if there
-    is no corresponding character.
-*   `SbKeyLocation key_location`
-
-    The location of the specified key, in cases where there are multiple
-    instances of the button on the keyboard. For example, some keyboards have
-    more than one "shift" key.
-*   `unsigned int key_modifiers`
-
-    Key modifiers (e.g. `Ctrl`, `Shift`) held down during this input event.
-*   `SbInputVector position`
-
-    The (x, y) coordinates of the persistent cursor controlled by this device.
-    The value is `0` if this data is not applicable. For events with type
-    kSbInputEventTypeMove and device_type kSbInputDeviceTypeGamepad, this field
-    is interpreted as a stick position with the range [-1, 1], with positive
-    values for the down and right direction.
-*   `SbInputVector delta`
-
-    The relative motion vector of this input. The value is `0` if this data is
-    not applicable.
-*   `float pressure`
-
-    The normalized pressure of the pointer input in the range of [0,1], where 0
-    and 1 represent the minimum and maximum pressure the hardware is capable of
-    detecting, respectively. Use NaN for devices that do not report pressure.
-    This value is used for input events with device type mouse or touch screen.
-*   `SbInputVector size`
-
-    The (width, height) of the contact geometry of the pointer. This defines the
-    size of the area under the pointer position. If (NaN, NaN) is specified, the
-    value (0,0) will be used. This value is used for input events with device
-    type mouse or touch screen.
-*   `SbInputVector tilt`
-
-    The (x, y) angle in degrees, in the range of [-90, 90] of the pointer,
-    relative to the z axis. Positive values are for tilt to the right (x), and
-    towards the user (y). Use (NaN, NaN) for devices that do not report tilt.
-    This value is used for input events with device type mouse or touch screen.
-*   `const char * input_text`
-
-    The text to input for events of type `Input`.
-
-### SbInputVector ###
-
-A 2-dimensional vector used to represent points and motion vectors.
-
-#### Members ####
-
-*   `float x`
-*   `float y`
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/key.md b/src/cobalt/site/docs/reference/starboard/modules/6/key.md
deleted file mode 100644
index 3d6afab..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/key.md
+++ /dev/null
@@ -1,287 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: key.h"
----
-
-Defines the canonical set of Starboard key codes.
-
-## Enums ##
-
-### SbKey ###
-
-A standard set of key codes, ordered by value, that represent each possible
-input key across all kinds of devices. Starboard uses the semi-standard Windows
-virtual key codes documented at: [https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731%28v=vs.85%29.aspx](https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731%28v=vs.85%29.aspx)
-
-#### Values ####
-
-*   `kSbKeyUnknown`
-*   `kSbKeyCancel`
-*   `kSbKeyBackspace`
-*   `kSbKeyBack`
-*   `kSbKeyTab`
-
-    semantic "back".
-*   `kSbKeyBacktab`
-*   `kSbKeyClear`
-*   `kSbKeyReturn`
-*   `kSbKeyShift`
-*   `kSbKeyControl`
-*   `kSbKeyMenu`
-*   `kSbKeyPause`
-*   `kSbKeyCapital`
-*   `kSbKeyKana`
-*   `kSbKeyHangul`
-*   `kSbKeyJunja`
-*   `kSbKeyFinal`
-*   `kSbKeyHanja`
-*   `kSbKeyKanji`
-*   `kSbKeyEscape`
-*   `kSbKeyConvert`
-*   `kSbKeyNonconvert`
-*   `kSbKeyAccept`
-*   `kSbKeyModechange`
-*   `kSbKeySpace`
-*   `kSbKeyPrior`
-*   `kSbKeyNext`
-*   `kSbKeyEnd`
-*   `kSbKeyHome`
-*   `kSbKeyLeft`
-*   `kSbKeyUp`
-*   `kSbKeyRight`
-*   `kSbKeyDown`
-*   `kSbKeySelect`
-*   `kSbKeyPrint`
-*   `kSbKeyExecute`
-*   `kSbKeySnapshot`
-*   `kSbKeyInsert`
-*   `kSbKeyDelete`
-*   `kSbKeyHelp`
-*   `kSbKey0`
-*   `kSbKey1`
-*   `kSbKey2`
-*   `kSbKey3`
-*   `kSbKey4`
-*   `kSbKey5`
-*   `kSbKey6`
-*   `kSbKey7`
-*   `kSbKey8`
-*   `kSbKey9`
-*   `kSbKeyA`
-*   `kSbKeyB`
-*   `kSbKeyC`
-*   `kSbKeyD`
-*   `kSbKeyE`
-*   `kSbKeyF`
-*   `kSbKeyG`
-*   `kSbKeyH`
-*   `kSbKeyI`
-*   `kSbKeyJ`
-*   `kSbKeyK`
-*   `kSbKeyL`
-*   `kSbKeyM`
-*   `kSbKeyN`
-*   `kSbKeyO`
-*   `kSbKeyP`
-*   `kSbKeyQ`
-*   `kSbKeyR`
-*   `kSbKeyS`
-*   `kSbKeyT`
-*   `kSbKeyU`
-*   `kSbKeyV`
-*   `kSbKeyW`
-*   `kSbKeyX`
-*   `kSbKeyY`
-*   `kSbKeyZ`
-*   `kSbKeyLwin`
-*   `kSbKeyCommand`
-*   `kSbKeyRwin`
-*   `kSbKeyApps`
-*   `kSbKeySleep`
-*   `kSbKeyNumpad0`
-*   `kSbKeyNumpad1`
-*   `kSbKeyNumpad2`
-*   `kSbKeyNumpad3`
-*   `kSbKeyNumpad4`
-*   `kSbKeyNumpad5`
-*   `kSbKeyNumpad6`
-*   `kSbKeyNumpad7`
-*   `kSbKeyNumpad8`
-*   `kSbKeyNumpad9`
-*   `kSbKeyMultiply`
-*   `kSbKeyAdd`
-*   `kSbKeySeparator`
-*   `kSbKeySubtract`
-*   `kSbKeyDecimal`
-*   `kSbKeyDivide`
-*   `kSbKeyF1`
-*   `kSbKeyF2`
-*   `kSbKeyF3`
-*   `kSbKeyF4`
-*   `kSbKeyF5`
-*   `kSbKeyF6`
-*   `kSbKeyF7`
-*   `kSbKeyF8`
-*   `kSbKeyF9`
-*   `kSbKeyF10`
-*   `kSbKeyF11`
-*   `kSbKeyF12`
-*   `kSbKeyF13`
-*   `kSbKeyF14`
-*   `kSbKeyF15`
-*   `kSbKeyF16`
-*   `kSbKeyF17`
-*   `kSbKeyF18`
-*   `kSbKeyF19`
-*   `kSbKeyF20`
-*   `kSbKeyF21`
-*   `kSbKeyF22`
-*   `kSbKeyF23`
-*   `kSbKeyF24`
-*   `kSbKeyNumlock`
-*   `kSbKeyScroll`
-*   `kSbKeyWlan`
-*   `kSbKeyPower`
-*   `kSbKeyLshift`
-*   `kSbKeyRshift`
-*   `kSbKeyLcontrol`
-*   `kSbKeyRcontrol`
-*   `kSbKeyLmenu`
-*   `kSbKeyRmenu`
-*   `kSbKeyBrowserBack`
-*   `kSbKeyBrowserForward`
-*   `kSbKeyBrowserRefresh`
-*   `kSbKeyBrowserStop`
-*   `kSbKeyBrowserSearch`
-*   `kSbKeyBrowserFavorites`
-*   `kSbKeyBrowserHome`
-*   `kSbKeyVolumeMute`
-*   `kSbKeyVolumeDown`
-*   `kSbKeyVolumeUp`
-*   `kSbKeyMediaNextTrack`
-*   `kSbKeyMediaPrevTrack`
-*   `kSbKeyMediaStop`
-*   `kSbKeyMediaPlayPause`
-*   `kSbKeyMediaLaunchMail`
-*   `kSbKeyMediaLaunchMediaSelect`
-*   `kSbKeyMediaLaunchApp1`
-*   `kSbKeyMediaLaunchApp2`
-*   `kSbKeyOem1`
-*   `kSbKeyOemPlus`
-*   `kSbKeyOemComma`
-*   `kSbKeyOemMinus`
-*   `kSbKeyOemPeriod`
-*   `kSbKeyOem2`
-*   `kSbKeyOem3`
-*   `kSbKeyBrightnessDown`
-*   `kSbKeyBrightnessUp`
-*   `kSbKeyKbdBrightnessDown`
-*   `kSbKeyOem4`
-*   `kSbKeyOem5`
-*   `kSbKeyOem6`
-*   `kSbKeyOem7`
-*   `kSbKeyOem8`
-*   `kSbKeyOem102`
-*   `kSbKeyKbdBrightnessUp`
-*   `kSbKeyDbeSbcschar`
-*   `kSbKeyDbeDbcschar`
-*   `kSbKeyPlay`
-*   `kSbKeyMediaRewind`
-
-    Other supported CEA 2014 keys.
-*   `kSbKeyMediaFastForward`
-*   `kSbKeyRed`
-
-    Key codes from the DTV Application Software Environment, [http://www.atsc.org/wp-content/uploads/2015/03/a_100_4.pdf](http://www.atsc.org/wp-content/uploads/2015/03/a_100_4.pdf)
-*   `kSbKeyGreen`
-*   `kSbKeyYellow`
-*   `kSbKeyBlue`
-*   `kSbKeyChannelUp`
-*   `kSbKeyChannelDown`
-*   `kSbKeySubtitle`
-*   `kSbKeyClosedCaption`
-*   `kSbKeyInfo`
-*   `kSbKeyGuide`
-*   `kSbKeyLast`
-
-    Key codes from OCAP, [https://apps.cablelabs.com/specification/opencable-application-platform-ocap/](https://apps.cablelabs.com/specification/opencable-application-platform-ocap/)
-*   `kSbKeyPreviousChannel`
-*   `kSbKeyLaunchThisApplication`
-
-    A button that will directly launch the current application.
-*   `kSbKeyMediaAudioTrack`
-
-    A button that will switch between different available audio tracks.
-*   `kSbKeyMouse1`
-
-    Mouse buttons, starting with the left mouse button.
-*   `kSbKeyMouse2`
-*   `kSbKeyMouse3`
-*   `kSbKeyMouse4`
-*   `kSbKeyMouse5`
-*   `kSbKeyGamepad1`
-
-    Xbox A, PS O or X (depending on region), Switch A
-*   `kSbKeyGamepad2`
-
-    Xbox B, PS X or O (depending on region), Switch B
-*   `kSbKeyGamepad3`
-
-    Xbox X, PS square, Switch X
-*   `kSbKeyGamepad4`
-
-    Xbox Y, PS triangle, Switch Y
-*   `kSbKeyGamepadLeftBumper`
-
-    Pretty much every gamepad has bumpers at the top front of the controller,
-    and triggers at the bottom front of the controller.
-*   `kSbKeyGamepadRightBumper`
-*   `kSbKeyGamepadLeftTrigger`
-*   `kSbKeyGamepadRightTrigger`
-*   `kSbKeyGamepad5`
-
-    Xbox 360 Back, XB1 minimize, PS and WiiU Select
-*   `kSbKeyGamepad6`
-
-    Xbox 360 Play, XB1 Menu, PS and WiiU Start
-*   `kSbKeyGamepadLeftStick`
-
-    This refers to pressing the left stick like a button.
-*   `kSbKeyGamepadRightStick`
-
-    This refers to pressing the right stick like a button.
-*   `kSbKeyGamepadDPadUp`
-*   `kSbKeyGamepadDPadDown`
-*   `kSbKeyGamepadDPadLeft`
-*   `kSbKeyGamepadDPadRight`
-*   `kSbKeyGamepadSystem`
-
-    The system key in the middle of the gamepad, if it exists.
-*   `kSbKeyGamepadLeftStickUp`
-
-    Codes for thumbstick to virtual dpad conversions.
-*   `kSbKeyGamepadLeftStickDown`
-*   `kSbKeyGamepadLeftStickLeft`
-*   `kSbKeyGamepadLeftStickRight`
-*   `kSbKeyGamepadRightStickUp`
-*   `kSbKeyGamepadRightStickDown`
-*   `kSbKeyGamepadRightStickLeft`
-*   `kSbKeyGamepadRightStickRight`
-
-### SbKeyModifiers ###
-
-Bit-mask of key modifiers.
-
-#### Values ####
-
-*   `kSbKeyModifiersNone`
-*   `kSbKeyModifiersAlt`
-*   `kSbKeyModifiersCtrl`
-*   `kSbKeyModifiersMeta`
-*   `kSbKeyModifiersShift`
-*   `kSbKeyModifiersPointerButtonLeft`
-*   `kSbKeyModifiersPointerButtonRight`
-*   `kSbKeyModifiersPointerButtonMiddle`
-*   `kSbKeyModifiersPointerButtonBack`
-*   `kSbKeyModifiersPointerButtonForward`
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/log.md b/src/cobalt/site/docs/reference/starboard/modules/6/log.md
deleted file mode 100644
index fd98e08..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/log.md
+++ /dev/null
@@ -1,135 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: log.h"
----
-
-Defines debug logging functions.
-
-## Enums ##
-
-### SbLogPriority ###
-
-The priority at which a message should be logged. The platform may be configured
-to filter logs by priority, or render them differently.
-
-#### Values ####
-
-*   `kSbLogPriorityUnknown`
-*   `kSbLogPriorityInfo`
-*   `kSbLogPriorityWarning`
-*   `kSbLogPriorityError`
-*   `kSbLogPriorityFatal`
-
-## Functions ##
-
-### SbLog ###
-
-Writes `message` to the platform's debug output log.
-
-`priority`: The SbLogPriority at which the message should be logged. Note that
-passing `kSbLogPriorityFatal` does not terminate the program. Such a policy must
-be enforced at the application level. In fact, `priority` may be completely
-ignored on many platforms. `message`: The message to be logged. No formatting is
-required to be done on the value, including newline termination. That said,
-platforms can adjust the message to be more suitable for their output method by
-wrapping the text, stripping unprintable characters, etc.
-
-#### Declaration ####
-
-```
-void SbLog(SbLogPriority priority, const char *message)
-```
-
-### SbLogFlush ###
-
-Flushes the log buffer on some platforms.
-
-#### Declaration ####
-
-```
-void SbLogFlush()
-```
-
-### SbLogFormat ###
-
-A log output method that additionally performs a string format on the data being
-logged.
-
-#### Declaration ####
-
-```
-void SbLogFormat(const char *format, va_list args) SB_PRINTF_FORMAT(1
-```
-
-### SbLogFormatF ###
-
-Inline wrapper of SbLogFormat that converts from ellipsis to va_args.
-
-#### Declaration ####
-
-```
-void static void void SbLogFormatF(const char *format,...) SB_PRINTF_FORMAT(1
-```
-
-### SbLogIsTty ###
-
-Indicates whether the log output goes to a TTY or is being redirected.
-
-#### Declaration ####
-
-```
-bool SbLogIsTty()
-```
-
-### SbLogRaw ###
-
-A bare-bones log output method that is async-signal-safe, i.e. safe to call from
-an asynchronous signal handler (e.g. a `SIGSEGV` handler). It should not do any
-additional formatting.
-
-`message`: The message to be logged.
-
-#### Declaration ####
-
-```
-void SbLogRaw(const char *message)
-```
-
-### SbLogRawDumpStack ###
-
-Dumps the stack of the current thread to the log in an async-signal-safe manner,
-i.e. safe to call from an asynchronous signal handler (e.g. a `SIGSEGV`
-handler). Does not include SbLogRawDumpStack itself.
-
-`frames_to_skip`: The number of frames to skip from the top of the stack when
-dumping the current thread to the log. This parameter lets you remove noise from
-helper functions that might end up on top of every stack dump so that the stack
-dump is just the relevant function stack where the problem occurred.
-
-#### Declaration ####
-
-```
-void SbLogRawDumpStack(int frames_to_skip)
-```
-
-### SbLogRawFormat ###
-
-A formatted log output method that is async-signal-safe, i.e. safe to call from
-an asynchronous signal handler (e.g. a `SIGSEGV` handler).
-
-#### Declaration ####
-
-```
-void SbLogRawFormat(const char *format, va_list args) SB_PRINTF_FORMAT(1
-```
-
-### SbLogRawFormatF ###
-
-Inline wrapper of SbLogFormat to convert from ellipsis to va_args.
-
-#### Declaration ####
-
-```
-void static void void SbLogRawFormatF(const char *format,...) SB_PRINTF_FORMAT(1
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/media.md b/src/cobalt/site/docs/reference/starboard/modules/6/media.md
deleted file mode 100644
index 4f37282..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/media.md
+++ /dev/null
@@ -1,499 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: media.h"
----
-
-Provides media definitions that are common between the Decoder and Player
-interfaces.
-
-## Macros ##
-
-### kSbMediaTimeSecond ###
-
-TODO: remove entirely. One second in SbMediaTime (90KHz ticks).
-
-## Enums ##
-
-### SbMediaAudioCodec ###
-
-Types of audio elementary streams that can be supported.
-
-#### Values ####
-
-*   `kSbMediaAudioCodecNone`
-*   `kSbMediaAudioCodecAac`
-*   `kSbMediaAudioCodecAc3`
-*   `kSbMediaAudioCodecOpus`
-*   `kSbMediaAudioCodecVorbis`
-
-### SbMediaAudioCodingType ###
-
-Possible audio coding types.
-
-#### Values ####
-
-*   `kSbMediaAudioCodingTypeNone`
-*   `kSbMediaAudioCodingTypeAac`
-*   `kSbMediaAudioCodingTypeAc3`
-*   `kSbMediaAudioCodingTypeAtrac`
-*   `kSbMediaAudioCodingTypeBitstream`
-*   `kSbMediaAudioCodingTypeDolbyDigitalPlus`
-*   `kSbMediaAudioCodingTypeDts`
-*   `kSbMediaAudioCodingTypeMpeg1`
-*   `kSbMediaAudioCodingTypeMpeg2`
-*   `kSbMediaAudioCodingTypeMpeg3`
-*   `kSbMediaAudioCodingTypePcm`
-
-### SbMediaAudioConnector ###
-
-Possible audio connector types.
-
-#### Values ####
-
-*   `kSbMediaAudioConnectorNone`
-*   `kSbMediaAudioConnectorAnalog`
-*   `kSbMediaAudioConnectorBluetooth`
-*   `kSbMediaAudioConnectorHdmi`
-*   `kSbMediaAudioConnectorNetwork`
-*   `kSbMediaAudioConnectorSpdif`
-*   `kSbMediaAudioConnectorUsb`
-
-### SbMediaAudioFrameStorageType ###
-
-Possible audio frame storage types.
-
-#### Values ####
-
-*   `kSbMediaAudioFrameStorageTypeInterleaved`
-
-    The samples of a multi-channel audio stream are stored in one continuous
-    buffer. Samples at the same timestamp are stored one after another. For
-    example, for a stereo stream with channels L and R that contains samples
-    with timestamps 0, 1, 2, etc., the samples are stored in one buffer as "L0
-    R0 L1 R1 L2 R2 ...".
-*   `kSbMediaAudioFrameStorageTypePlanar`
-
-    The samples of each channel are stored in their own continuous buffer. For
-    example, for a stereo stream with channels L and R that contains samples
-    with timestamps 0, 1, 2, etc., the samples are stored in two buffers "L0 L1
-    L2 ..." and "R0 R1 R2 ...".
-
-### SbMediaAudioSampleType ###
-
-Possible audio sample types.
-
-#### Values ####
-
-*   `kSbMediaAudioSampleTypeInt16Deprecated`
-*   `kSbMediaAudioSampleTypeFloat32`
-
-### SbMediaRangeId ###
-
-This corresponds to the WebM Range enum which is part of WebM color data (see [http://www.webmproject.org/docs/container/#Range](http://www.webmproject.org/docs/container/#Range)
-). H.264 only uses a bool, which corresponds to the LIMITED/FULL values. Chrome-
-specific values start at 1000.
-
-#### Values ####
-
-*   `kSbMediaRangeIdUnspecified`
-
-    Range is not explicitly specified / unknown.
-*   `kSbMediaRangeIdLimited`
-
-    Limited Rec. 709 color range with RGB values ranging from 16 to 235.
-*   `kSbMediaRangeIdFull`
-
-    Full RGB color range with RGB valees from 0 to 255.
-*   `kSbMediaRangeIdDerived`
-
-    Range is defined by TransferId/MatrixId.
-*   `kSbMediaRangeIdLast`
-
-### SbMediaSupportType ###
-
-Indicates how confident the device is that it can play media resources of the
-given type. The values are a direct map of the canPlayType() method specified at
-the following link: [https://www.w3.org/TR/2011/WD-html5-20110113/video.html#dom-navigator-canplaytype](https://www.w3.org/TR/2011/WD-html5-20110113/video.html#dom-navigator-canplaytype)
-
-#### Values ####
-
-*   `kSbMediaSupportTypeNotSupported`
-
-    The media type cannot be played.
-*   `kSbMediaSupportTypeMaybe`
-
-    Cannot determinate if the media type is playable without playing it.
-*   `kSbMediaSupportTypeProbably`
-
-    The media type seems to be playable.
-
-### SbMediaType ###
-
-Types of media component streams.
-
-#### Values ####
-
-*   `kSbMediaTypeAudio`
-
-    Value used for audio streams.
-*   `kSbMediaTypeVideo`
-
-    Value used for video streams.
-
-### SbMediaVideoCodec ###
-
-Types of video elementary streams that could be supported.
-
-#### Values ####
-
-*   `kSbMediaVideoCodecNone`
-*   `kSbMediaVideoCodecH264`
-*   `kSbMediaVideoCodecH265`
-*   `kSbMediaVideoCodecMpeg2`
-*   `kSbMediaVideoCodecTheora`
-*   `kSbMediaVideoCodecVc1`
-*   `kSbMediaVideoCodecAv1`
-*   `kSbMediaVideoCodecVp8`
-*   `kSbMediaVideoCodecVp9`
-
-## Typedefs ##
-
-### SbMediaTime ###
-
-Time represented in 90KHz ticks.
-
-#### Definition ####
-
-```
-typedef int64_t SbMediaTime
-```
-
-## Structs ##
-
-### SbMediaAudioConfiguration ###
-
-A structure describing the audio configuration parameters of a single audio
-output.
-
-#### Members ####
-
-*   `int index`
-
-    The platform-defined index of the associated audio output.
-*   `SbMediaAudioConnector connector`
-
-    The type of audio connector. Will be the empty `kSbMediaAudioConnectorNone`
-    if this device cannot provide this information.
-*   `SbTime latency`
-
-    The expected latency of audio over this output, in microseconds, or `0` if
-    this device cannot provide this information.
-*   `SbMediaAudioCodingType coding_type`
-
-    The type of audio coding used over this connection.
-*   `int number_of_channels`
-
-    The number of audio channels currently supported by this device output, or
-    `0` if this device cannot provide this information, in which case the caller
-    can probably assume stereo output.
-
-### SbMediaAudioHeader ###
-
-An audio sequence header, which is a description of a given audio stream. This,
-in hexadecimal string form, acts as a set of instructions to the audio decoder.
-
-The Sequence Header consists of a little-endian hexadecimal encoded
-`WAVEFORMATEX` structure followed by an Audio-specific configuration field. The
-`WAVEFORMATEX` structure is specified at: [http://msdn.microsoft.com/en-us/library/dd390970(v=vs.85).aspx](http://msdn.microsoft.com/en-us/library/dd390970(v=vs.85).aspx)
-
-#### Members ####
-
-*   `uint16_t format_tag`
-
-    The waveform-audio format type code.
-*   `uint16_t number_of_channels`
-
-    The number of audio channels in this format. `1` for mono, `2` for stereo.
-*   `uint32_t samples_per_second`
-
-    The sampling rate.
-*   `uint32_t average_bytes_per_second`
-
-    The number of bytes per second expected with this format.
-*   `uint16_t block_alignment`
-
-    Byte block alignment, e.g, 4.
-*   `uint16_t bits_per_sample`
-
-    The bit depth for the stream this represents, e.g. `8` or `16`.
-*   `uint16_t audio_specific_config_size`
-
-    The size, in bytes, of the audio_specific_config.
-*   `const void * audio_specific_config`
-
-    The AudioSpecificConfig, as specified in ISO/IEC-14496-3, section 1.6.2.1: [http://read.pudn.com/downloads98/doc/comm/401153/14496/ISO_IEC_14496-3%20Part%203%20Audio/C036083E_SUB1.PDF](http://read.pudn.com/downloads98/doc/comm/401153/14496/ISO_IEC_14496-3%20Part%203%20Audio/C036083E_SUB1.PDF)
-
-### SbMediaColorMetadata ###
-
-HDR (High Dynamic Range) Metadata common for HDR10 and WebM/VP9-based HDR
-formats, together with the ColorSpace. HDR reproduces a greater dynamic range of
-luminosity than is possible with standard digital imaging. See the Consumer
-Electronics Association press release: [https://www.cta.tech/News/Press-Releases/2015/August/CEA-Defines-%E2%80%98HDR-Compatible%E2%80%99-Displays.aspx](https://www.cta.tech/News/Press-Releases/2015/August/CEA-Defines-%E2%80%98HDR-Compatible%E2%80%99-Displays.aspx)
-
-#### Members ####
-
-*   `unsigned int bits_per_channel`
-
-    Number of decoded bits per channel. A value of 0 indicates that the
-    BitsPerChannel is unspecified.
-*   `unsigned int chroma_subsampling_horizontal`
-
-    The amount of pixels to remove in the Cr and Cb channels for every pixel not
-    removed horizontally. Example: For video with 4:2:0 chroma subsampling, the
-    `chroma_subsampling_horizontal` should be set to 1.
-*   `unsigned int chroma_subsampling_vertical`
-
-    The amount of pixels to remove in the Cr and Cb channels for every pixel not
-    removed vertically. Example: For video with 4:2:0 chroma subsampling, the
-    `chroma_subsampling_vertical` should be set to 1.
-*   `unsigned int cb_subsampling_horizontal`
-
-    The amount of pixels to remove in the Cb channel for every pixel not removed
-    horizontally. This is additive with ChromaSubsamplingHorz. Example: For
-    video with 4:2:1 chroma subsampling, the `chroma_subsampling_horizontal`
-    should be set to 1 and `cb_subsampling_horizontal` should be set to 1.
-*   `unsigned int cb_subsampling_vertical`
-
-    The amount of pixels to remove in the Cb channel for every pixel not removed
-    vertically. This is additive with `chroma_subsampling_vertical`.
-*   `unsigned int chroma_siting_horizontal`
-
-    How chroma is subsampled horizontally. (0: Unspecified, 1: Left Collocated,
-    2: Half)
-*   `unsigned int chroma_siting_vertical`
-
-    How chroma is subsampled vertically. (0: Unspecified, 1: Top Collocated, 2:
-    Half)
-*   `SbMediaMasteringMetadata mastering_metadata`
-
-    [HDR Metadata field] SMPTE 2086 mastering data.
-*   `unsigned int max_cll`
-
-    [HDR Metadata field] Maximum brightness of a single pixel (Maximum Content
-    Light Level) in candelas per square meter (cd/m^2).
-*   `unsigned int max_fall`
-
-    [HDR Metadata field] Maximum brightness of a single full frame (Maximum
-    Frame-Average Light Level) in candelas per square meter (cd/m^2).
-*   `SbMediaPrimaryId primaries`
-
-    [Color Space field] The colour primaries of the video. For clarity, the
-    value and meanings for Primaries are adopted from Table 2 of ISO/IEC
-    23001-8:2013/DCOR1. (0: Reserved, 1: ITU-R BT.709, 2: Unspecified, 3:
-    Reserved, 4: ITU-R BT.470M, 5: ITU-R BT.470BG, 6: SMPTE 170M, 7: SMPTE 240M,
-    8: FILM, 9: ITU-R BT.2020, 10: SMPTE ST 428-1, 22: JEDEC P22 phosphors)
-*   `SbMediaTransferId transfer`
-
-    [Color Space field] The transfer characteristics of the video. For clarity,
-    the value and meanings for TransferCharacteristics 1-15 are adopted from
-    Table 3 of ISO/IEC 23001-8:2013/DCOR1. TransferCharacteristics 16-18 are
-    proposed values. (0: Reserved, 1: ITU-R BT.709, 2: Unspecified, 3: Reserved,
-    4: Gamma 2.2 curve, 5: Gamma 2.8 curve, 6: SMPTE 170M, 7: SMPTE 240M, 8:
-    Linear, 9: Log, 10: Log Sqrt, 11: IEC 61966-2-4, 12: ITU-R BT.1361 Extended
-    Colour Gamut, 13: IEC 61966-2-1, 14: ITU-R BT.2020 10 bit, 15: ITU-R BT.2020
-    12 bit, 16: SMPTE ST 2084, 17: SMPTE ST 428-1 18: ARIB STD-B67 (HLG))
-*   `SbMediaMatrixId matrix`
-
-    [Color Space field] The Matrix Coefficients of the video used to derive luma
-    and chroma values from red, green, and blue color primaries. For clarity,
-    the value and meanings for MatrixCoefficients are adopted from Table 4 of
-    ISO/IEC 23001-8:2013/DCOR1. (0:GBR, 1: BT709, 2: Unspecified, 3: Reserved,
-    4: FCC, 5: BT470BG, 6: SMPTE 170M, 7: SMPTE 240M, 8: YCOCG, 9: BT2020 Non-
-    constant Luminance, 10: BT2020 Constant Luminance)
-*   `SbMediaRangeId range`
-
-    [Color Space field] Clipping of the color ranges. (0: Unspecified, 1:
-    Broadcast Range, 2: Full range (no clipping), 3: Defined by
-    MatrixCoefficients/TransferCharacteristics)
-*   `float custom_primary_matrix`
-
-    [Color Space field] Only used if primaries == kSbMediaPrimaryIdCustom. This
-    a row-major ordered 3 x 4 submatrix of the 4 x 4 transform matrix. The 4th
-    row is completed as (0, 0, 0, 1).
-
-### SbMediaMasteringMetadata ###
-
-SMPTE 2086 mastering data [http://ieeexplore.ieee.org/document/7291707/](http://ieeexplore.ieee.org/document/7291707/)
-This standard specifies the metadata items to specify the color volume (the
-color primaries, white point, and luminance range) of the display that was used
-in mastering video content. The metadata is specified as a set of values
-independent of any specific digital representation. Also see the WebM container
-guidelines: [https://www.webmproject.org/docs/container/](https://www.webmproject.org/docs/container/)
-
-#### Members ####
-
-*   `float primary_r_chromaticity_x`
-
-    Red X chromaticity coordinate as defined by CIE 1931. In range [0, 1].
-*   `float primary_r_chromaticity_y`
-
-    Red Y chromaticity coordinate as defined by CIE 1931. In range [0, 1].
-*   `float primary_g_chromaticity_x`
-
-    Green X chromaticity coordinate as defined by CIE 1931. In range [0, 1].
-*   `float primary_g_chromaticity_y`
-
-    Green Y chromaticity coordinate as defined by CIE 1931. In range [0, 1].
-*   `float primary_b_chromaticity_x`
-
-    Blue X chromaticity coordinate as defined by CIE 1931. In range [0, 1].
-*   `float primary_b_chromaticity_y`
-
-    Blue Y chromaticity coordinate as defined by CIE 1931. In range [0, 1].
-*   `float white_point_chromaticity_x`
-
-    White X chromaticity coordinate as defined by CIE 1931. In range [0, 1].
-*   `float white_point_chromaticity_y`
-
-    White Y chromaticity coordinate as defined by CIE 1931. In range [0, 1].
-*   `float luminance_max`
-
-    Maximum luminance. Shall be represented in candelas per square meter
-    (cd/m^2). In range [0, 9999.99].
-*   `float luminance_min`
-
-    Minimum luminance. Shall be represented in candelas per square meter
-    (cd/m^2). In range [0, 9999.99].
-
-### SbMediaVideoSampleInfo ###
-
-The set of information required by the decoder or player for each video sample.
-
-#### Members ####
-
-*   `bool is_key_frame`
-
-    Indicates whether the associated sample is a key frame (I-frame). Video key
-    frames must always start with SPS and PPS NAL units.
-*   `int frame_width`
-
-    The frame width of this sample, in pixels. Also could be parsed from the
-    Sequence Parameter Set (SPS) NAL Unit. Frame dimensions must only change on
-    key frames, but may change on any key frame.
-*   `int frame_height`
-
-    The frame height of this sample, in pixels. Also could be parsed from the
-    Sequence Parameter Set (SPS) NAL Unit. Frame dimensions must only change on
-    key frames, but may change on any key frame.
-*   `SbMediaColorMetadata* color_metadata`
-
-    HDR metadata common for HDR10 and WebM/VP9-based HDR formats as well as the
-    Color Space, and Color elements: MatrixCoefficients, BitsPerChannel,
-    ChromaSubsamplingHorz, ChromaSubsamplingVert, CbSubsamplingHorz,
-    CbSubsamplingVert, ChromaSitingHorz, ChromaSitingVert, Range,
-    TransferCharacteristics, and Primaries described here: [https://matroska.org/technical/specs/index.html](https://matroska.org/technical/specs/index.html)
-    . This will only be specified on frames where the HDR metadata and color /
-    color space might have changed (e.g. keyframes).
-
-## Functions ##
-
-### SbMediaCanPlayMimeAndKeySystem ###
-
-Returns information about whether the playback of the specific media described
-by `mime` and encrypted using `key_system` can be played.
-
-Note that neither `mime` nor `key_system` can be NULL. This function returns
-`kSbMediaSupportNotSupported` if either is NULL.
-
-`mime`: The mime information of the media in the form of `video/webm` or
-`video/mp4; codecs="avc1.42001E"`. It may include arbitrary parameters like
-"codecs", "channels", etc. Note that the "codecs" parameter may contain more
-than one codec, delimited by comma. `key_system`: A lowercase value in fhe form
-of "com.example.somesystem" as suggested by [https://w3c.github.io/encrypted-media/#key-system](https://w3c.github.io/encrypted-media/#key-system)) that can
-be matched exactly with known DRM key systems of the platform. When `key_system`
-is an empty string, the return value is an indication for non-encrypted media.
-
-#### Declaration ####
-
-```
-SbMediaSupportType SbMediaCanPlayMimeAndKeySystem(const char *mime, const char *key_system)
-```
-
-### SbMediaGetAudioConfiguration ###
-
-Retrieves the current physical audio configuration of audio output
-`output_index` on this device and places it in `out_configuration`, which must
-not be NULL.
-
-This function returns `false` if nothing could be determined on this platform or
-if `output_index` does not exist on this device.
-
-`out_configuration`: The variable that holds the audio configuration
-information.
-
-#### Declaration ####
-
-```
-bool SbMediaGetAudioConfiguration(int output_index, SbMediaAudioConfiguration *out_configuration)
-```
-
-### SbMediaGetAudioOutputCount ###
-
-Returns the number of audio outputs currently available on this device. Even if
-the number of outputs or their audio configurations can't be determined, it is
-expected that the platform will at least return a single output that supports at
-least stereo.
-
-#### Declaration ####
-
-```
-int SbMediaGetAudioOutputCount()
-```
-
-### SbMediaIsOutputProtected ###
-
-Indicates whether output copy protection is currently enabled on all capable
-outputs. If `true`, then non-protection-capable outputs are expected to be
-blanked.
-
-#### Declaration ####
-
-```
-bool SbMediaIsOutputProtected()
-```
-
-### SbMediaIsSupported ###
-
-Indicates whether this platform supports decoding `video_codec` and
-`audio_codec` along with decrypting using `key_system`. If `video_codec` is
-`kSbMediaVideoCodecNone` or if `audio_codec` is `kSbMediaAudioCodecNone`, this
-function should return `true` as long as `key_system` is supported on the
-platform to decode any supported input formats.
-
-`video_codec`: The `SbMediaVideoCodec` being checked for platform compatibility.
-`audio_codec`: The `SbMediaAudioCodec` being checked for platform compatibility.
-`key_system`: The key system being checked for platform compatibility.
-
-#### Declaration ####
-
-```
-bool SbMediaIsSupported(SbMediaVideoCodec video_codec, SbMediaAudioCodec audio_codec, const char *key_system)
-```
-
-### SbMediaSetOutputProtection ###
-
-Enables or disables output copy protection on all capable outputs. If enabled,
-then non-protection-capable outputs are expected to be blanked.
-
-The return value indicates whether the operation was successful, and the
-function returns a success even if the call is redundant in that it doesn't
-change the current value.
-
-`enabled`: Indicates whether output protection is enabled (`true`) or disabled.
-
-#### Declaration ####
-
-```
-bool SbMediaSetOutputProtection(bool enabled)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/memory.md b/src/cobalt/site/docs/reference/starboard/modules/6/memory.md
deleted file mode 100644
index 142774d..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/memory.md
+++ /dev/null
@@ -1,454 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: memory.h"
----
-
-Defines functions for memory allocation, alignment, copying, and comparing.
-
-## Porters ##
-
-All of the "Unchecked" and "Free" functions must be implemented, but they should
-not be called directly. The Starboard platform wraps them with extra accounting
-under certain circumstances.
-
-## Porters and Application Developers ##
-
-Nobody should call the "Checked", "Unchecked" or "Free" functions directly
-because that evades Starboard's memory tracking. In both port implementations
-and Starboard client application code, you should always call SbMemoryAllocate
-and SbMemoryDeallocate rather than SbMemoryAllocateUnchecked and SbMemoryFree.
-
-*   The "checked" functions are SbMemoryAllocateChecked(),
-    SbMemoryReallocateChecked(), and SbMemoryAllocateAlignedChecked().
-
-*   The "unchecked" functions are SbMemoryAllocateUnchecked(),
-    SbMemoryReallocateUnchecked(), and SbMemoryAllocateAlignedUnchecked().
-
-*   The "free" functions are SbMemoryFree() and SbMemoryFreeAligned().
-
-## Enums ##
-
-### SbMemoryMapFlags ###
-
-The bitwise OR of these flags should be passed to SbMemoryMap to indicate how
-the mapped memory can be used.
-
-#### Values ####
-
-*   `kSbMemoryMapProtectRead`
-
-    No flags set: Reserves virtual address space. SbMemoryProtect() can later
-    make it accessible.
-*   `kSbMemoryMapProtectWrite`
-*   `kSbMemoryMapProtectExec`
-*   `kSbMemoryMapProtectReadWrite`
-
-## Functions ##
-
-### SbMemoryAlignToPageSize ###
-
-Rounds `size` up to SB_MEMORY_PAGE_SIZE.
-
-#### Declaration ####
-
-```
-static size_t SbMemoryAlignToPageSize(size_t size)
-```
-
-### SbMemoryAllocate ###
-
-Allocates and returns a chunk of memory of at least `size` bytes. This function
-should be called from the client codebase. It is intended to be a drop-in
-replacement for `malloc`.
-
-Note that this function returns `NULL` if it is unable to allocate the memory.
-
-`size`: The amount of memory to be allocated. If `size` is 0, the function may
-return `NULL` or it may return a unique pointer value that can be passed to
-SbMemoryDeallocate.
-
-#### Declaration ####
-
-```
-void* SbMemoryAllocate(size_t size)
-```
-
-### SbMemoryAllocateAligned ###
-
-Allocates and returns a chunk of memory of at least `size` bytes, aligned to
-`alignment`. This function should be called from the client codebase. It is
-meant to be a drop-in replacement for `memalign`.
-
-The function returns `NULL` if it cannot allocate the memory. In addition, the
-function's behavior is undefined if `alignment` is not a power of two.
-
-`alignment`: The way that data is arranged and accessed in memory. The value
-must be a power of two. `size`: The size of the memory to be allocated. If
-`size` is `0`, the function may return `NULL` or it may return a unique aligned
-pointer value that can be passed to SbMemoryDeallocateAligned.
-
-#### Declaration ####
-
-```
-void* SbMemoryAllocateAligned(size_t alignment, size_t size)
-```
-
-### SbMemoryAllocateAlignedChecked ###
-
-Same as SbMemoryAllocateAlignedUnchecked, but will abort() in the case of an
-allocation failure.
-
-DO NOT CALL. Call SbMemoryAllocateAligned(...) instead.
-
-#### Declaration ####
-
-```
-void* SbMemoryAllocateAlignedChecked(size_t alignment, size_t size)
-```
-
-### SbMemoryAllocateAlignedUnchecked ###
-
-This is the implementation of SbMemoryAllocateAligned that must be provided by
-Starboard ports.
-
-DO NOT CALL. Call SbMemoryAllocateAligned(...) instead.
-
-#### Declaration ####
-
-```
-void* SbMemoryAllocateAlignedUnchecked(size_t alignment, size_t size)
-```
-
-### SbMemoryAllocateChecked ###
-
-Same as SbMemoryAllocateUnchecked, but will abort() in the case of an allocation
-failure.
-
-DO NOT CALL. Call SbMemoryAllocate(...) instead.
-
-#### Declaration ####
-
-```
-void* SbMemoryAllocateChecked(size_t size)
-```
-
-### SbMemoryAllocateNoReport ###
-
-Same as SbMemoryAllocate() but will not report memory to the tracker. Avoid
-using this unless absolutely necessary.
-
-#### Declaration ####
-
-```
-void* SbMemoryAllocateNoReport(size_t size)
-```
-
-### SbMemoryAllocateUnchecked ###
-
-This is the implementation of SbMemoryAllocate that must be provided by
-Starboard ports.
-
-DO NOT CALL. Call SbMemoryAllocate(...) instead.
-
-#### Declaration ####
-
-```
-void* SbMemoryAllocateUnchecked(size_t size)
-```
-
-### SbMemoryCalloc ###
-
-A wrapper that implements a drop-in replacement for `calloc`, which is used in
-some packages.
-
-#### Declaration ####
-
-```
-static void* SbMemoryCalloc(size_t count, size_t size)
-```
-
-### SbMemoryCompare ###
-
-Compares the contents of the first `count` bytes of `buffer1` and `buffer2`.
-This function returns:
-
-*   `-1` if `buffer1` is "less-than" `buffer2`
-
-*   `0` if `buffer1` and `buffer2` are equal
-
-*   `1` if `buffer1` is "greater-than" `buffer2`.
-
-This function is meant to be a drop-in replacement for `memcmp`.
-
-`buffer1`: The first buffer to be compared. `buffer2`: The second buffer to be
-compared. `count`: The number of bytes to be compared.
-
-#### Declaration ####
-
-```
-int SbMemoryCompare(const void *buffer1, const void *buffer2, size_t count)
-```
-
-### SbMemoryCopy ###
-
-Copies `count` sequential bytes from `source` to `destination`, without support
-for the `source` and `destination` regions overlapping. This function is meant
-to be a drop-in replacement for `memcpy`.
-
-The function's behavior is undefined if `destination` or `source` are NULL, and
-the function is a no-op if `count` is 0. The return value is `destination`.
-
-`destination`: The destination of the copied memory. `source`: The source of the
-copied memory. `count`: The number of sequential bytes to be copied.
-
-#### Declaration ####
-
-```
-void* SbMemoryCopy(void *destination, const void *source, size_t count)
-```
-
-### SbMemoryDeallocate ###
-
-Frees a previously allocated chunk of memory. If `memory` is NULL, then the
-operation is a no-op. This function should be called from the client codebase.
-It is meant to be a drop-in replacement for `free`.
-
-`memory`: The chunk of memory to be freed.
-
-#### Declaration ####
-
-```
-void SbMemoryDeallocate(void *memory)
-```
-
-### SbMemoryDeallocateAligned ###
-
-`memory`: The chunk of memory to be freed. If `memory` is NULL, then the
-function is a no-op.
-
-#### Declaration ####
-
-```
-void SbMemoryDeallocateAligned(void *memory)
-```
-
-### SbMemoryDeallocateNoReport ###
-
-Same as SbMemoryDeallocate() but will not report memory deallocation to the
-tracker. This function must be matched with SbMemoryAllocateNoReport().
-
-#### Declaration ####
-
-```
-void SbMemoryDeallocateNoReport(void *memory)
-```
-
-### SbMemoryFindByte ###
-
-Finds the lower 8-bits of `value` in the first `count` bytes of `buffer` and
-returns either a pointer to the first found occurrence or `NULL` if the value is
-not found. This function is meant to be a drop-in replacement for `memchr`.
-
-#### Declaration ####
-
-```
-const void* SbMemoryFindByte(const void *buffer, int value, size_t count)
-```
-
-### SbMemoryFlush ###
-
-Flushes any data in the given virtual address range that is cached locally in
-the current processor core to physical memory, ensuring that data and
-instruction caches are cleared. This is required to be called on executable
-memory that has been written to and might be executed in the future.
-
-#### Declaration ####
-
-```
-void SbMemoryFlush(void *virtual_address, int64_t size_bytes)
-```
-
-### SbMemoryFree ###
-
-This is the implementation of SbMemoryDeallocate that must be provided by
-Starboard ports.
-
-DO NOT CALL. Call SbMemoryDeallocate(...) instead.
-
-#### Declaration ####
-
-```
-void SbMemoryFree(void *memory)
-```
-
-### SbMemoryFreeAligned ###
-
-This is the implementation of SbMemoryFreeAligned that must be provided by
-Starboard ports.
-
-DO NOT CALL. Call SbMemoryDeallocateAligned(...) instead.
-
-#### Declaration ####
-
-```
-void SbMemoryFreeAligned(void *memory)
-```
-
-### SbMemoryGetStackBounds ###
-
-Gets the stack bounds for the current thread.
-
-`out_high`: The highest addressable byte + 1 for the current thread. `out_low`:
-The lowest addressable byte for the current thread.
-
-#### Declaration ####
-
-```
-void SbMemoryGetStackBounds(void **out_high, void **out_low)
-```
-
-### SbMemoryIsAligned ###
-
-Checks whether `memory` is aligned to `alignment` bytes.
-
-#### Declaration ####
-
-```
-static bool SbMemoryIsAligned(const void *memory, size_t alignment)
-```
-
-### SbMemoryIsZero ###
-
-Returns true if the first `count` bytes of `buffer` are set to zero.
-
-#### Declaration ####
-
-```
-static bool SbMemoryIsZero(const void *buffer, size_t count)
-```
-
-### SbMemoryMap ###
-
-Allocates `size_bytes` worth of physical memory pages and maps them into an
-available virtual region. This function returns `SB_MEMORY_MAP_FAILED` on
-failure. `NULL` is a valid return value.
-
-`size_bytes`: The amount of physical memory pages to be allocated. `flags`: The
-bitwise OR of the protection flags for the mapped memory as specified in
-`SbMemoryMapFlags`. Allocating executable memory is not allowed and will fail.
-If executable memory is needed, map non-executable memory first and then switch
-access to executable using SbMemoryProtect. When kSbMemoryMapProtectReserved is
-used, the address space will not be accessible and, if possible, the platform
-should not count it against any memory budget. `name`: A value that appears in
-the debugger on some platforms. The value can be up to 32 bytes.
-
-#### Declaration ####
-
-```
-void* SbMemoryMap(int64_t size_bytes, int flags, const char *name)
-```
-
-### SbMemoryMove ###
-
-Copies `count` sequential bytes from `source` to `destination`, with support for
-the `source` and `destination` regions overlapping. This function is meant to be
-a drop-in replacement for `memmove`.
-
-The function's behavior is undefined if `destination` or `source` are NULL, and
-the function is a no-op if `count` is 0. The return value is `destination`.
-
-`destination`: The destination of the copied memory. `source`: The source of the
-copied memory. `count`: The number of sequential bytes to be copied.
-
-#### Declaration ####
-
-```
-void* SbMemoryMove(void *destination, const void *source, size_t count)
-```
-
-### SbMemoryReallocate ###
-
-Attempts to resize `memory` to be at least `size` bytes, without touching the
-contents of memory.
-
-*   If the function cannot perform the fast resize, it allocates a new chunk of
-    memory, copies the contents over, and frees the previous chunk, returning a
-    pointer to the new chunk.
-
-*   If the function cannot perform the slow resize, it returns `NULL`, leaving
-    the given memory chunk unchanged.
-
-This function should be called from the client codebase. It is meant to be a
-drop-in replacement for `realloc`.
-
-`memory`: The chunk of memory to be resized. `memory` may be NULL, in which case
-it behaves exactly like SbMemoryAllocateUnchecked. `size`: The size to which
-`memory` will be resized. If `size` is `0`, the function may return `NULL` or it
-may return a unique pointer value that can be passed to SbMemoryDeallocate.
-
-#### Declaration ####
-
-```
-void* SbMemoryReallocate(void *memory, size_t size)
-```
-
-### SbMemoryReallocateChecked ###
-
-Same as SbMemoryReallocateUnchecked, but will abort() in the case of an
-allocation failure.
-
-DO NOT CALL. Call SbMemoryReallocate(...) instead.
-
-#### Declaration ####
-
-```
-void* SbMemoryReallocateChecked(void *memory, size_t size)
-```
-
-### SbMemoryReallocateUnchecked ###
-
-This is the implementation of SbMemoryReallocate that must be provided by
-Starboard ports.
-
-DO NOT CALL. Call SbMemoryReallocate(...) instead.
-
-#### Declaration ####
-
-```
-void* SbMemoryReallocateUnchecked(void *memory, size_t size)
-```
-
-### SbMemorySet ###
-
-Fills `count` sequential bytes starting at `destination`, with the unsigned char
-coercion of `byte_value`. This function is meant to be a drop-in replacement for
-`memset`.
-
-The function's behavior is undefined if `destination` is NULL, and the function
-is a no-op if `count` is 0. The return value is `destination`.
-
-`destination`: The destination of the copied memory. `count`: The number of
-sequential bytes to be set.
-
-#### Declaration ####
-
-```
-void* SbMemorySet(void *destination, int byte_value, size_t count)
-```
-
-### SbMemoryUnmap ###
-
-Unmap `size_bytes` of physical pages starting from `virtual_address`, returning
-`true` on success. After this function completes, [virtual_address,
-virtual_address + size_bytes) will not be read/writable. This function can unmap
-multiple contiguous regions that were mapped with separate calls to
-SbMemoryMap(). For example, if one call to `SbMemoryMap(0x1000)` returns
-`(void*)0xA000`, and another call to `SbMemoryMap(0x1000)` returns
-`(void*)0xB000`, `SbMemoryUnmap(0xA000, 0x2000)` should free both regions.
-
-#### Declaration ####
-
-```
-bool SbMemoryUnmap(void *virtual_address, int64_t size_bytes)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/memory_reporter.md b/src/cobalt/site/docs/reference/starboard/modules/6/memory_reporter.md
deleted file mode 100644
index 4b4a539..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/memory_reporter.md
+++ /dev/null
@@ -1,104 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: memory_reporter.h"
----
-
-Provides an interface for memory reporting.
-
-## Typedefs ##
-
-### SbMemoryReporterOnAlloc ###
-
-A function to report a memory allocation from SbMemoryAllocate(). Note that
-operator new calls SbMemoryAllocate which will delegate to this callback.
-
-#### Definition ####
-
-```
-typedef void(* SbMemoryReporterOnAlloc) (void *context, const void *memory, size_t size)
-```
-
-### SbMemoryReporterOnDealloc ###
-
-A function to report a memory deallocation from SbMemoryDeallcoate(). Note that
-operator delete calls SbMemoryDeallocate which will delegate to this callback.
-
-#### Definition ####
-
-```
-typedef void(* SbMemoryReporterOnDealloc) (void *context, const void *memory)
-```
-
-### SbMemoryReporterOnMapMemory ###
-
-A function to report a memory mapping from SbMemoryMap().
-
-#### Definition ####
-
-```
-typedef void(* SbMemoryReporterOnMapMemory) (void *context, const void *memory, size_t size)
-```
-
-### SbMemoryReporterOnUnMapMemory ###
-
-A function to report a memory unmapping from SbMemoryUnmap().
-
-#### Definition ####
-
-```
-typedef void(* SbMemoryReporterOnUnMapMemory) (void *context, const void *memory, size_t size)
-```
-
-## Structs ##
-
-### SbMemoryReporter ###
-
-SbMemoryReporter allows memory reporting via user-supplied functions. The void*
-context is passed to every call back. It's strongly recommended that C-Style
-struct initialization is used so that the arguments can be typed check by the
-compiler. For example, SbMemoryReporter mem_reporter = { MallocCallback, ....
-context };
-
-#### Members ####
-
-*   `SbMemoryReporterOnAlloc on_alloc_cb`
-
-    Callback to report allocations.
-*   `SbMemoryReporterOnDealloc on_dealloc_cb`
-
-    Callback to report deallocations.
-*   `SbMemoryReporterOnMapMemory on_mapmem_cb`
-
-    Callback to report memory map.
-*   `SbMemoryReporterOnUnMapMemory on_unmapmem_cb`
-
-    Callback to report memory unmap.
-*   `void * context`
-
-    Optional, is passed to callbacks as first argument.
-
-## Functions ##
-
-### SbMemorySetReporter ###
-
-Sets the MemoryReporter. Any previous memory reporter is unset. No lifetime
-management is done internally on input pointer.
-
-Returns true if the memory reporter was set with no errors. If an error was
-reported then check the log for why it failed.
-
-Note that other than a thread-barrier-write of the input pointer, there is no
-thread safety guarantees with this function due to performance considerations.
-It's recommended that this be called once during the lifetime of the program, or
-not at all. Do not delete the supplied pointer, ever. Example (Good):
-SbMemoryReporter* mem_reporter = new ...; SbMemorySetReporter(&mem_reporter);
-... SbMemorySetReporter(NULL); // allow value to leak. Example (Bad):
-SbMemoryReporter* mem_reporter = new ...; SbMemorySetReporter(&mem_reporter);
-... SbMemorySetReporter(NULL); delete mem_reporter; // May crash.
-
-#### Declaration ####
-
-```
-bool SbMemorySetReporter(struct SbMemoryReporter *tracker)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/microphone.md b/src/cobalt/site/docs/reference/starboard/modules/6/microphone.md
deleted file mode 100644
index 0a8a60f..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/microphone.md
+++ /dev/null
@@ -1,258 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: microphone.h"
----
-
-Defines functions for microphone creation, control, audio data fetching, and
-destruction. This module supports multiple calls to `SbMicrophoneOpen` and
-`SbMicrophoneClose`, and the implementation should handle multiple calls to one
-of those functions on the same microphone. For example, your implementation
-should handle cases where `SbMicrophoneOpen` is called twice on the same
-microphone without a call to `SbMicrophoneClose` in between.
-
-This API is not thread-safe and must be called from a single thread.
-
-How to use this API:
-
-1.  Call `SbMicrophoneGetAvailableInfos` to get a list of available microphone
-    information.
-
-1.  Create a supported microphone, using `SbMicrophoneCreate`, with enough
-    buffer size and sample rate. Use `SbMicrophoneIsSampleRateSupported` to
-    verify the sample rate.
-
-1.  Use `SbMicrophoneOpen` to open the microphone port and start recording audio
-    data.
-
-1.  Periodically read out the data from microphone with `SbMicrophoneRead`.
-
-1.  Call `SbMicrophoneClose` to close the microphone port and stop recording
-    audio data.
-
-1.  Destroy the microphone with `SbMicrophoneDestroy`.
-
-## Macros ##
-
-### kSbMicrophoneIdInvalid ###
-
-Well-defined value for an invalid microphone ID handle.
-
-### kSbMicrophoneInvalid ###
-
-Well-defined value for an invalid microphone handle.
-
-## Enums ##
-
-### SbMicrophoneType ###
-
-All possible microphone types.
-
-#### Values ####
-
-*   `kSbMicrophoneCamera`
-
-    Built-in microphone in camera.
-*   `kSbMicrophoneUSBHeadset`
-
-    Microphone in the headset that can be a wired or wireless USB headset.
-*   `kSbMicrophoneVRHeadset`
-
-    Microphone in the VR headset.
-*   `kSBMicrophoneAnalogHeadset`
-
-    Microphone in the analog headset.
-*   `kSbMicrophoneUnknown`
-
-    Unknown microphone type. The microphone could be different than the other
-    enum descriptions or could fall under one of those descriptions.
-
-## Typedefs ##
-
-### SbMicrophone ###
-
-An opaque handle to an implementation-private structure that represents a
-microphone.
-
-#### Definition ####
-
-```
-typedef struct SbMicrophonePrivate* SbMicrophone
-```
-
-### SbMicrophoneId ###
-
-An opaque handle to an implementation-private structure that represents a
-microphone ID.
-
-#### Definition ####
-
-```
-typedef struct SbMicrophoneIdPrivate* SbMicrophoneId
-```
-
-## Structs ##
-
-### SbMicrophoneInfo ###
-
-Microphone information.
-
-#### Members ####
-
-*   `SbMicrophoneId id`
-
-    Microphone id.
-*   `SbMicrophoneType type`
-
-    Microphone type.
-*   `int max_sample_rate_hz`
-
-    The microphone's maximum supported sampling rate.
-*   `int min_read_size`
-
-    The minimum read size required for each read from microphone.
-
-## Functions ##
-
-### SbMicrophoneClose ###
-
-Closes the microphone port, stops recording audio on `microphone`, and clears
-the unread buffer if it is not empty. If the microphone has already been
-stopped, this call is ignored. The return value indicates whether the microphone
-is closed.
-
-`microphone`: The microphone to close.
-
-#### Declaration ####
-
-```
-bool SbMicrophoneClose(SbMicrophone microphone)
-```
-
-### SbMicrophoneCreate ###
-
-Creates a microphone with the specified ID, audio sample rate, and cached audio
-buffer size. Starboard only requires support for creating one microphone at a
-time, and implementations may return an error if a second microphone is created
-before the first is destroyed.
-
-The function returns the newly created SbMicrophone object. However, if you try
-to create a microphone that has already been initialized, if the sample rate is
-unavailable, or if the buffer size is invalid, the function should return
-`kSbMicrophoneInvalid`.
-
-`id`: The ID that will be assigned to the newly created SbMicrophone.
-`sample_rate_in_hz`: The new microphone's audio sample rate in Hz.
-`buffer_size_bytes`: The size of the buffer where signed 16-bit integer audio
-data is temporarily cached to during the capturing. The audio data is removed
-from the audio buffer if it has been read, and new audio data can be read from
-this buffer in smaller chunks than this size. This parameter must be set to a
-value greater than zero and the ideal size is `2^n`.
-
-#### Declaration ####
-
-```
-SbMicrophone SbMicrophoneCreate(SbMicrophoneId id, int sample_rate_in_hz, int buffer_size_bytes)
-```
-
-### SbMicrophoneDestroy ###
-
-Destroys a microphone. If the microphone is in started state, it is first
-stopped and then destroyed. Any data that has been recorded and not read is
-thrown away.
-
-#### Declaration ####
-
-```
-void SbMicrophoneDestroy(SbMicrophone microphone)
-```
-
-### SbMicrophoneGetAvailable ###
-
-Retrieves all currently available microphone information and stores it in
-`out_info_array`. The return value is the number of the available microphones.
-If the number of available microphones is larger than `info_array_size`, then
-`out_info_array` is filled up with as many available microphones as possible and
-the actual number of available microphones is returned. A negative return value
-indicates that an internal error occurred.
-
-`out_info_array`: All currently available information about the microphone is
-placed into this output parameter. `info_array_size`: The size of
-`out_info_array`.
-
-#### Declaration ####
-
-```
-int SbMicrophoneGetAvailable(SbMicrophoneInfo *out_info_array, int info_array_size)
-```
-
-### SbMicrophoneIdIsValid ###
-
-Indicates whether the given microphone ID is valid.
-
-#### Declaration ####
-
-```
-static bool SbMicrophoneIdIsValid(SbMicrophoneId id)
-```
-
-### SbMicrophoneIsSampleRateSupported ###
-
-Indicates whether the microphone supports the sample rate.
-
-#### Declaration ####
-
-```
-bool SbMicrophoneIsSampleRateSupported(SbMicrophoneId id, int sample_rate_in_hz)
-```
-
-### SbMicrophoneIsValid ###
-
-Indicates whether the given microphone is valid.
-
-#### Declaration ####
-
-```
-static bool SbMicrophoneIsValid(SbMicrophone microphone)
-```
-
-### SbMicrophoneOpen ###
-
-Opens the microphone port and starts recording audio on `microphone`.
-
-Once started, the client needs to periodically call `SbMicrophoneRead` to
-receive the audio data. If the microphone has already been started, this call
-clears the unread buffer. The return value indicates whether the microphone is
-open. `microphone`: The microphone that will be opened and will start recording
-audio.
-
-#### Declaration ####
-
-```
-bool SbMicrophoneOpen(SbMicrophone microphone)
-```
-
-### SbMicrophoneRead ###
-
-Retrieves the recorded audio data from the microphone and writes that data to
-`out_audio_data`.
-
-The return value is zero or the positive number of bytes that were read. Neither
-the return value nor `audio_data_size` exceeds the buffer size. A negative
-return value indicates that an error occurred.
-
-This function should be called frequently. Otherwise, the microphone only
-buffers `buffer_size` bytes as configured in `SbMicrophoneCreate` and the new
-audio data is thrown out. No audio data is read from a stopped microphone.
-
-`microphone`: The microphone from which to retrieve recorded audio data.
-`out_audio_data`: The buffer to which the retrieved data will be written.
-`audio_data_size`: The number of requested bytes. If `audio_data_size` is
-smaller than `min_read_size` of `SbMicrophoneInfo`, the extra audio data that
-has already been read from the device is discarded.
-
-#### Declaration ####
-
-```
-int SbMicrophoneRead(SbMicrophone microphone, void *out_audio_data, int audio_data_size)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/mutex.md b/src/cobalt/site/docs/reference/starboard/modules/6/mutex.md
deleted file mode 100644
index 2081a74..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/mutex.md
+++ /dev/null
@@ -1,108 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: mutex.h"
----
-
-Defines a mutually exclusive lock that can be used to coordinate with other
-threads.
-
-## Enums ##
-
-### SbMutexResult ###
-
-Enumeration of possible results from acquiring a mutex.
-
-#### Values ####
-
-*   `kSbMutexAcquired`
-
-    The mutex was acquired successfully.
-*   `kSbMutexBusy`
-
-    The mutex was not acquired because it was held by someone else.
-*   `kSbMutexDestroyed`
-
-    The mutex has already been destroyed.
-
-## Functions ##
-
-### SbMutexAcquire ###
-
-Acquires `mutex`, blocking indefinitely. The return value identifies the
-acquisition result. SbMutexes are not reentrant, so a recursive acquisition
-blocks forever.
-
-`mutex`: The mutex to be acquired.
-
-#### Declaration ####
-
-```
-SbMutexResult SbMutexAcquire(SbMutex *mutex)
-```
-
-### SbMutexAcquireTry ###
-
-Acquires `mutex`, without blocking. The return value identifies the acquisition
-result. SbMutexes are not reentrant, so a recursive acquisition always fails.
-
-`mutex`: The mutex to be acquired.
-
-#### Declaration ####
-
-```
-SbMutexResult SbMutexAcquireTry(SbMutex *mutex)
-```
-
-### SbMutexCreate ###
-
-Creates a new mutex. The return value indicates whether the function was able to
-create a new mutex.
-
-`out_mutex`: The handle to the newly created mutex.
-
-#### Declaration ####
-
-```
-bool SbMutexCreate(SbMutex *out_mutex)
-```
-
-### SbMutexDestroy ###
-
-Destroys a mutex. The return value indicates whether the destruction was
-successful.
-
-`mutex`: The mutex to be invalidated.
-
-#### Declaration ####
-
-```
-bool SbMutexDestroy(SbMutex *mutex)
-```
-
-### SbMutexIsSuccess ###
-
-Indicates whether the given result is a success. A value of `true` indicates
-that the mutex was acquired.
-
-`result`: The result being checked.
-
-#### Declaration ####
-
-```
-static bool SbMutexIsSuccess(SbMutexResult result)
-```
-
-### SbMutexRelease ###
-
-Releases `mutex` held by the current thread. The return value indicates whether
-the release was successful. Releases should always be successful if `mutex` is
-held by the current thread.
-
-`mutex`: The mutex to be released.
-
-#### Declaration ####
-
-```
-bool SbMutexRelease(SbMutex *mutex)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/once.md b/src/cobalt/site/docs/reference/starboard/modules/6/once.md
deleted file mode 100644
index b226b4b..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/once.md
+++ /dev/null
@@ -1,41 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: once.h"
----
-
-Onces represent initializations that should only ever happen once per process,
-in a thread-safe way.
-
-## Typedefs ##
-
-### SbOnceInitRoutine ###
-
-Function pointer type for methods that can be called via the SbOnce() system.
-
-#### Definition ####
-
-```
-typedef void(* SbOnceInitRoutine) (void)
-```
-
-## Functions ##
-
-### SbOnce ###
-
-Thread-safely runs `init_routine` only once.
-
-*   If this `once_control` has not run a function yet, this function runs
-    `init_routine` in a thread-safe way and then returns `true`.
-
-*   If SbOnce() was called with `once_control` before, the function returns
-    `true` immediately.
-
-*   If `once_control` or `init_routine` is invalid, the function returns
-    `false`.
-
-#### Declaration ####
-
-```
-bool SbOnce(SbOnceControl *once_control, SbOnceInitRoutine init_routine)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/player.md b/src/cobalt/site/docs/reference/starboard/modules/6/player.md
deleted file mode 100644
index 9967922..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/player.md
+++ /dev/null
@@ -1,459 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: player.h"
----
-
-Defines an interface for controlling playback of media elementary streams.
-
-## Macros ##
-
-### SB_PLAYER_INITIAL_TICKET ###
-
-The value of the initial ticket held by the player before the first seek. The
-player will use this ticket value to make the first call to SbPlayerStatusFunc
-with kSbPlayerStateInitialized.
-
-### SB_PLAYER_NO_DURATION ###
-
-The value to pass into SbPlayerCreate's `duration_pts` argument for cases where
-the duration is unknown, such as for live streams.
-
-### kSbPlayerInvalid ###
-
-Well-defined value for an invalid player.
-
-## Enums ##
-
-### SbPlayerDecoderState ###
-
-An indicator of whether the decoder can accept more samples.
-
-#### Values ####
-
-*   `kSbPlayerDecoderStateNeedsData`
-
-    The decoder is asking for one more sample.
-*   `kSbPlayerDecoderStateBufferFull`
-
-    The decoder is not ready for any more samples, so do not send them. Note
-    that this enum value has been deprecated and the SbPlayer implementation
-    should no longer use this value.
-*   `kSbPlayerDecoderStateDestroyed`
-
-    The player has been destroyed, and will send no more callbacks.
-
-### SbPlayerState ###
-
-An indicator of the general playback state.
-
-#### Values ####
-
-*   `kSbPlayerStateInitialized`
-
-    The player has just been initialized. It is expecting an SbPlayerSeek() call
-    to enter the prerolling state.
-*   `kSbPlayerStatePrerolling`
-
-    The player is prerolling, collecting enough data to fill the pipeline before
-    presentation starts. After the first preroll is completed, there should
-    always be a video frame to render, even if the player goes back to
-    Prerolling after a Seek.
-*   `kSbPlayerStatePresenting`
-
-    The player is presenting media, and it is either paused or actively playing
-    in real-time. Note that the implementation should use this state to signal
-    that the preroll has been finished.
-*   `kSbPlayerStateEndOfStream`
-
-    The player is presenting media, but it is paused at the end of the stream.
-*   `kSbPlayerStateDestroyed`
-
-    The player has been destroyed, and will send no more callbacks.
-
-## Typedefs ##
-
-### SbPlayer ###
-
-An opaque handle to an implementation-private structure representing a player.
-
-#### Definition ####
-
-```
-typedef struct SbPlayerPrivate* SbPlayer
-```
-
-### SbPlayerDeallocateSampleFunc ###
-
-Callback to free the given sample buffer data. When more than one buffer are
-sent in SbPlayerWriteSample(), the implementation only has to call this callback
-with `sample_buffer` points to the the first buffer.
-
-#### Definition ####
-
-```
-typedef void(* SbPlayerDeallocateSampleFunc) (SbPlayer player, void *context, const void *sample_buffer)
-```
-
-### SbPlayerDecoderStatusFunc ###
-
-Callback for decoder status updates, called in response to a call to
-SbPlayerSeek() or SbPlayerWriteSample(). This callback will never be called
-until at least one call to SbPlayerSeek has occurred. `ticket` will be set to
-the ticket passed into the last received call to SbPlayerSeek() at the time this
-callback was dispatched. This is to distinguish status callbacks for
-interrupting seeks. These callbacks will happen on a different thread than the
-calling thread, and it is not valid to call SbPlayer functions from within this
-callback. After an update with kSbPlayerDecoderStateNeedsData, the user of the
-player will make at most one call to SbPlayerWriteSample() or
-SbPlayerWriteEndOfStream(). The player implementation should update the decoder
-status again after such call to notify its user to continue writing more frames.
-
-#### Definition ####
-
-```
-typedef void(* SbPlayerDecoderStatusFunc) (SbPlayer player, void *context, SbMediaType type, SbPlayerDecoderState state, int ticket)
-```
-
-### SbPlayerEncryptedMediaInitDataEncounteredCB ###
-
-Callback to queue an encrypted event for initialization data encountered in
-media data. `init_data_type` should be a string matching one of the EME
-initialization data types : "cenc", "fairplay", "keyids", or "webm", `init_data`
-is the initialization data, and `init_data_length` is the length of the data.
-
-#### Definition ####
-
-```
-typedef void(* SbPlayerEncryptedMediaInitDataEncounteredCB) (SbPlayer player, void *context, const char *init_data_type, const unsigned char *init_data, unsigned int init_data_length)
-```
-
-### SbPlayerErrorFunc ###
-
-Callback for player errors, that may set a `message`. `error`: indicates the
-error code. `message`: provides specific informative diagnostic message about
-the error condition encountered. It is ok for the message to be an empty string
-or NULL if no information is available.
-
-#### Definition ####
-
-```
-typedef void(* SbPlayerErrorFunc) (SbPlayer player, void *context, SbPlayerError error, const char *message)
-```
-
-### SbPlayerStatusFunc ###
-
-Callback for player status updates. These callbacks will happen on a different
-thread than the calling thread, and it is not valid to call SbPlayer functions
-from within this callback.
-
-#### Definition ####
-
-```
-typedef void(* SbPlayerStatusFunc) (SbPlayer player, void *context, SbPlayerState state, int ticket)
-```
-
-## Structs ##
-
-### SbPlayerInfo ###
-
-Information about the current media playback state.
-
-#### Members ####
-
-*   `SbMediaTime current_media_pts`
-
-    The position of the playback head, as precisely as possible, in 90KHz ticks
-    (PTS).
-*   `SbMediaTime duration_pts`
-
-    The known duration of the currently playing media stream, in 90KHz ticks
-    (PTS).
-*   `SbTime start_date`
-
-    The result of getStartDate for the currently playing media stream, in
-    microseconds since the epoch of January 1, 1601 UTC.
-*   `int frame_width`
-
-    The width of the currently displayed frame, in pixels, or 0 if not provided
-    by this player.
-*   `int frame_height`
-
-    The height of the currently displayed frame, in pixels, or 0 if not provided
-    by this player.
-*   `bool is_paused`
-
-    Whether playback is currently paused.
-*   `double volume`
-
-    The current player volume in [0, 1].
-*   `int total_video_frames`
-
-    The number of video frames sent to the player since the creation of the
-    player.
-*   `int dropped_video_frames`
-
-    The number of video frames decoded but not displayed since the creation of
-    the player.
-*   `int corrupted_video_frames`
-
-    The number of video frames that failed to be decoded since the creation of
-    the player.
-*   `double playback_rate`
-
-    The rate of playback. The video is played back in a speed that is
-    proportional to this. By default it is 1.0 which indicates that the playback
-    is at normal speed. When it is greater than one, the video is played in a
-    faster than normal speed. When it is less than one, the video is played in a
-    slower than normal speed. Negative speeds are not supported.
-*   `SbMediaTime buffer_start_pts`
-
-    The position of the buffer head, as precisely as possible, in 90KHz ticks
-    (PTS).
-*   `SbMediaTime buffer_duration_pts`
-
-    The known duration of the currently playing media buffer, in 90KHz ticks
-    (PTS).
-
-### SbPlayerSampleInfo ###
-
-Information about the samples to be written into SbPlayerWriteSample2.
-
-#### Members ####
-
-*   `const void * buffer`
-
-    Points to the buffer containing the sample data.
-*   `int buffer_size`
-
-    Size of the data pointed to by `buffer`.
-*   `SbTime timestamp`
-
-    The timestamp of the sample in SbTime.
-*   `constSbMediaVideoSampleInfo* video_sample_info`
-
-    Information about a video sample. This value is required for video samples.
-    Otherwise, it must be `NULL`.
-*   `constSbDrmSampleInfo* drm_info`
-
-    The DRM system related info for the media sample. This value is required for
-    encrypted samples. Otherwise, it must be `NULL`.
-
-## Functions ##
-
-### SbPlayerCreateWithUrl ###
-
-Creates a URL-based SbPlayer that will be displayed on `window` for the
-specified URL `url`, acquiring all resources needed to operate it, and returning
-an opaque handle to it. The expectation is that a new player will be created and
-destroyed for every playback.
-
-In many ways this function is similar to SbPlayerCreate, but it is missing the
-input arguments related to the configuration and format of the audio and video
-stream, as well as the DRM system. The DRM system for a player created with
-SbPlayerCreateWithUrl can be set after creation using SbPlayerSetDrmSystem.
-Because the DRM system is not available at the time of SbPlayerCreateWithUrl, it
-takes in a callback, `encrypted_media_init_data_encountered_cb`, which is run
-when encrypted media initial data is encountered.
-
-#### Declaration ####
-
-```
-SbPlayer SbPlayerCreateWithUrl(const char *url, SbWindow window, SbMediaTime duration_pts, SbPlayerStatusFunc player_status_func, SbPlayerEncryptedMediaInitDataEncounteredCB encrypted_media_init_data_encountered_cb, SbPlayerErrorFunc player_error_func, void *context)
-```
-
-### SbPlayerDestroy ###
-
-Destroys `player`, freeing all associated resources. Each callback must receive
-one more callback to say that the player was destroyed. Callbacks may be in-
-flight when SbPlayerDestroy is called, and should be ignored once this function
-is called.
-
-It is not allowed to pass `player` into any other `SbPlayer` function once
-SbPlayerDestroy has been called on that player.
-
-`player`: The player to be destroyed.
-
-#### Declaration ####
-
-```
-void SbPlayerDestroy(SbPlayer player)
-```
-
-### SbPlayerGetCurrentFrame ###
-
-Given a player created with the kSbPlayerOutputModeDecodeToTexture output mode,
-it will return a SbDecodeTarget representing the current frame to be rasterized.
-On GLES systems, this function must be called on a thread with an EGLContext
-current, and specifically the EGLContext that will be used to eventually render
-the frame. If this function is called with a `player` object that was created
-with an output mode other than kSbPlayerOutputModeDecodeToTexture,
-kSbDecodeTargetInvalid is returned.
-
-#### Declaration ####
-
-```
-SbDecodeTarget SbPlayerGetCurrentFrame(SbPlayer player)
-```
-
-### SbPlayerGetInfo ###
-
-Gets a snapshot of the current player state and writes it to `out_player_info`.
-This function may be called very frequently and is expected to be inexpensive.
-
-`player`: The player about which information is being retrieved.
-`out_player_info`: The information retrieved for the player.
-
-#### Declaration ####
-
-```
-void SbPlayerGetInfo(SbPlayer player, SbPlayerInfo *out_player_info)
-```
-
-### SbPlayerIsValid ###
-
-Returns whether the given player handle is valid.
-
-#### Declaration ####
-
-```
-static bool SbPlayerIsValid(SbPlayer player)
-```
-
-### SbPlayerOutputModeSupportedWithUrl ###
-
-Returns true if the given URL player output mode is supported by the platform.
-If this function returns true, it is okay to call SbPlayerCreate() with the
-given `output_mode`.
-
-#### Declaration ####
-
-```
-bool SbPlayerOutputModeSupportedWithUrl(SbPlayerOutputMode output_mode)
-```
-
-### SbPlayerSetBounds ###
-
-Sets the player bounds to the given graphics plane coordinates. The changes do
-not take effect until the next graphics frame buffer swap. The default bounds
-for a player is the full screen. This function is only relevant when the
-`player` is created with the kSbPlayerOutputModePunchOut output mode, and if
-this is not the case then this function call can be ignored.
-
-This function is called on every graphics frame that changes the video bounds.
-For example, if the video bounds are being animated, then this will be called at
-up to 60 Hz. Since the function could be called up to once per frame,
-implementors should take care to avoid related performance concerns with such
-frequent calls.
-
-`player`: The player that is being resized. `z_index`: The z-index of the
-player. When the bounds of multiple players are overlapped, the one with larger
-z-index will be rendered on top of the ones with smaller z-index. `x`: The
-x-coordinate of the upper-left corner of the player. `y`: The y-coordinate of
-the upper-left corner of the player. `width`: The width of the player, in
-pixels. `height`: The height of the player, in pixels.
-
-#### Declaration ####
-
-```
-void SbPlayerSetBounds(SbPlayer player, int z_index, int x, int y, int width, int height)
-```
-
-### SbPlayerSetDrmSystem ###
-
-Sets the DRM system of a running URL-based SbPlayer created with
-SbPlayerCreateWithUrl. This may only be run once for a given SbPlayer.
-
-#### Declaration ####
-
-```
-void SbPlayerSetDrmSystem(SbPlayer player, SbDrmSystem drm_system)
-```
-
-### SbPlayerSetPlaybackRate ###
-
-Set the playback rate of the `player`. `rate` is default to 1.0 which indicates
-the playback is at its original speed. A `rate` greater than one will make the
-playback faster than its original speed. For example, when `rate` is 2, the
-video will be played at twice the speed as its original speed. A `rate` less
-than 1.0 will make the playback slower than its original speed. When `rate` is
-0, the playback will be paused. The function returns true when the playback rate
-is set to `playback_rate` or to a rate that is close to `playback_rate` which
-the implementation supports. It returns false when the playback rate is
-unchanged, this can happen when `playback_rate` is negative or if it is too high
-to support.
-
-#### Declaration ####
-
-```
-bool SbPlayerSetPlaybackRate(SbPlayer player, double playback_rate)
-```
-
-### SbPlayerSetVolume ###
-
-Sets the player's volume.
-
-`player`: The player in which the volume is being adjusted. `volume`: The new
-player volume. The value must be between `0.0` and `1.0`, inclusive. A value of
-`0.0` means that the audio should be muted, and a value of `1.0` means that it
-should be played at full volume.
-
-#### Declaration ####
-
-```
-void SbPlayerSetVolume(SbPlayer player, double volume)
-```
-
-### SbPlayerWriteEndOfStream ###
-
-Writes a marker to `player`'s input stream of `stream_type` indicating that
-there are no more samples for that media type for the remainder of this media
-stream. This marker is invalidated, along with the rest of the stream's
-contents, after a call to SbPlayerSeek.
-
-`player`: The player to which the marker is written. `stream_type`: The type of
-stream for which the marker is written.
-
-#### Declaration ####
-
-```
-void SbPlayerWriteEndOfStream(SbPlayer player, SbMediaType stream_type)
-```
-
-### SbPlayerWriteSample ###
-
-Writes a single sample of the given media type to `player`'s input stream. Its
-data may be passed in via more than one buffers. The lifetime of
-`sample_buffers`, `sample_buffer_sizes`, `video_sample_info`, and
-`sample_drm_info` (as well as member `subsample_mapping` contained inside it)
-are not guaranteed past the call to SbPlayerWriteSample. That means that before
-returning, the implementation must synchronously copy any information it wants
-to retain from those structures.
-
-`player`: The player to which the sample is written. `sample_type`: The type of
-sample being written. See the `SbMediaType` enum in media.h. `sample_buffers`: A
-pointer to an array of buffers with `number_of_sample_buffers` elements that
-hold the data for this sample. The buffers are expected to be a portion of a
-bytestream of the codec type that the player was created with. The buffers
-should contain a sequence of whole NAL Units for video, or a complete audio
-frame. `sample_buffers` cannot be assumed to live past the call into
-SbPlayerWriteSample(), so it must be copied if its content will be used after
-SbPlayerWriteSample() returns. `sample_buffer_sizes`: A pointer to an array of
-sizes with `number_of_sample_buffers` elements. Each of them specify the number
-of bytes in the corresponding buffer contained in `sample_buffers`. None of them
-can be 0. `sample_buffer_sizes` cannot be assumed to live past the call into
-SbPlayerWriteSample(), so it must be copied if its content will be used after
-SbPlayerWriteSample() returns. `number_of_sample_buffers`: Specify the number of
-elements contained inside `sample_buffers` and `sample_buffer_sizes`. It has to
-be at least one, or the call will be ignored. `sample_pts`: The timestamp of the
-sample in 90KHz ticks (PTS). Note that samples MAY be written "slightly" out of
-order. `video_sample_info`: Information about a video sample. This value is
-required if `sample_type` is `kSbMediaTypeVideo`. Otherwise, it must be `NULL`.
-`sample_drm_info`: The DRM system related info for the media sample. This value
-is required for encrypted samples. Otherwise, it must be `NULL`.
-
-#### Declaration ####
-
-```
-void SbPlayerWriteSample(SbPlayer player, SbMediaType sample_type, const void *const *sample_buffers, const int *sample_buffer_sizes, int number_of_sample_buffers, SbMediaTime sample_pts, const SbMediaVideoSampleInfo *video_sample_info, const SbDrmSampleInfo *sample_drm_info)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/queue.md b/src/cobalt/site/docs/reference/starboard/modules/6/queue.md
deleted file mode 100644
index 6fdf231..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/queue.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: queue.h"
----
-
-Defines a C++-only synchronized queue implementation, built entirely on top of
-Starboard synchronization primitives. It can be safely used by both clients and
-implementations.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/socket.md b/src/cobalt/site/docs/reference/starboard/modules/6/socket.md
deleted file mode 100644
index 2098939..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/socket.md
+++ /dev/null
@@ -1,576 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: socket.h"
----
-
-Defines Starboard socket I/O functions. Starboard supports IPv4 and IPv6, TCP
-and UDP, server and client sockets. Some platforms may not support IPv6, some
-may not support listening sockets, and some may not support any kind of sockets
-at all (or only allow them in debug builds).
-
-Starboard ONLY supports non-blocking socket I/O, so all sockets are non-blocking
-at creation time.
-
-Note that, on some platforms, API calls on one end of a socket connection may
-not be instantaneously aware of manipulations on the socket at the other end of
-the connection, thus requiring use of either an SbSocketWaiter or spin-polling.
-
-TODO: For platforms that do not support sockets at all, they must support at
-least a high-level HTTP client API (to be defined later).
-
-## Macros ##
-
-### kSbSocketInvalid ###
-
-Well-defined value for an invalid socket handle.
-
-## Enums ##
-
-### SbSocketAddressType ###
-
-All possible address types.
-
-#### Values ####
-
-*   `kSbSocketAddressTypeIpv4`
-
-    An IPv4 address, using only the first 4 entries of the address buffer.
-*   `kSbSocketAddressTypeIpv6`
-
-    An IPv6 address, which uses 16 entries of the address buffer.
-
-### SbSocketError ###
-
-Enumeration of all Starboard socket operation results. Despite the enum name,
-note that the value actually describes the outcome of an operation, which is not
-always an error.
-
-#### Values ####
-
-*   `kSbSocketOk`
-
-    The operation succeeded.
-*   `kSbSocketPending`
-
-    The operation is blocked on I/O. Either try again "later," or be very clever
-    and wait on it with a SbSocketWaiter.
-*   `kSbSocketErrorConnectionReset`
-
-    This socket error is generated when the connection is reset unexpectedly and
-    the connection is now invalid. This might happen for example if an read
-    packet has the "TCP RST" bit set.
-*   `kSbSocketErrorFailed`
-
-    The operation failed for some other reason not specified above.
-
-### SbSocketProtocol ###
-
-All possible IP socket types.
-
-#### Values ####
-
-*   `kSbSocketProtocolTcp`
-
-    The TCP/IP protocol, a reliable, stateful, streaming protocol.
-*   `kSbSocketProtocolUdp`
-
-    The UDP/IP protocol, an unreliable, connectionless, discrete packet
-    (datagram) protocol.
-
-### SbSocketResolveFilter ###
-
-Bits that can be set when calling SbSocketResolve to filter the results.
-
-#### Values ####
-
-*   `kSbSocketResolveFilterNone`
-
-    No filters, include everything.
-*   `kSbSocketResolveFilterIpv4`
-
-    Include Ipv4 addresses.
-*   `kSbSocketResolveFilterIpv6`
-
-    Include Ipv6 addresses.
-
-## Typedefs ##
-
-### SbSocket ###
-
-A handle to a socket.
-
-#### Definition ####
-
-```
-typedef SbSocketPrivate* SbSocket
-```
-
-## Structs ##
-
-### SbSocketAddress ###
-
-A representation of any possible supported address type.
-
-#### Members ####
-
-*   `uint8_t address`
-
-    The storage for the address. For IPv4, only the first 4 bytes make up the
-    address. For IPv6, the entire buffer of 16 bytes is meaningful. An address
-    of all zeros means that the address is unspecified.
-*   `SbSocketAddressType type`
-
-    The type of address this represents (IPv4 vs IPv6).
-*   `int port`
-
-    The port component of this socket address. If not specified, it will be
-    zero, which is officially undefined.
-
-### SbSocketResolution ###
-
-The result of a host name resolution.
-
-#### Members ####
-
-*   `SbSocketAddress* addresses`
-
-    An array of addresses associated with the host name.
-*   `int address_count`
-
-    The length of the `addresses` array.
-
-## Functions ##
-
-### SbSocketAccept ###
-
-Accepts a pending connection on `socket` and returns a new SbSocket representing
-that connection. This function sets the error on `socket` and returns
-`kSbSocketInvalid` if it is unable to accept a new connection.
-
-`socket`: The SbSocket that is accepting a pending connection.
-
-#### Declaration ####
-
-```
-SbSocket SbSocketAccept(SbSocket socket)
-```
-
-### SbSocketBind ###
-
-Binds `socket` to a specific local interface and port specified by
-`local_address`. This function sets and returns the socket error if it is unable
-to bind to `local_address`.
-
-`socket`: The SbSocket to be bound to the local interface. `local_address`: The
-local address to which the socket is to be bound. This value must not be `NULL`.
-
-*   Setting the local address to port `0` (or not specifying a port) indicates
-    that the function should choose a port for you.
-
-*   Setting the IP address to `0.0.0.0` means that the socket should be bound to
-    all interfaces.
-
-#### Declaration ####
-
-```
-SbSocketError SbSocketBind(SbSocket socket, const SbSocketAddress *local_address)
-```
-
-### SbSocketClearLastError ###
-
-Clears the last error set on `socket`. The return value indicates whether the
-socket error was cleared.
-
-#### Declaration ####
-
-```
-bool SbSocketClearLastError(SbSocket socket)
-```
-
-### SbSocketConnect ###
-
-Opens a connection of `socket`'s type to the host and port specified by
-`address`. This function sets and returns the socket error if it is unable to
-connect to `address`. (It returns `kSbSocketOk` if it creates the connection
-successfully.)
-
-`socket`: The type of connection that should be opened. `address`: The host and
-port to which the socket should connect.
-
-#### Declaration ####
-
-```
-SbSocketError SbSocketConnect(SbSocket socket, const SbSocketAddress *address)
-```
-
-### SbSocketCreate ###
-
-Creates a new non-blocking socket for protocol `protocol` using address family
-`address_type`.
-
-*   If successful, this function returns the newly created handle.
-
-*   If unsuccessful, this function returns `kSbSocketInvalid` and also sets the
-    last system error appropriately.
-
-`address_type`: The type of IP address to use for the socket. `protocol`: The
-protocol to use for the socket.
-
-#### Declaration ####
-
-```
-SbSocket SbSocketCreate(SbSocketAddressType address_type, SbSocketProtocol protocol)
-```
-
-### SbSocketDestroy ###
-
-Destroys the `socket` by flushing it, closing any connection that may be active
-on it, and reclaiming any resources associated with it, including any
-registration with an `SbSocketWaiter`.
-
-The return value indicates whether the destruction was successful. However, even
-if this function returns `false`, you should not be able to use the socket any
-more.
-
-`socket`: The SbSocket to be destroyed.
-
-#### Declaration ####
-
-```
-bool SbSocketDestroy(SbSocket socket)
-```
-
-### SbSocketFreeResolution ###
-
-Frees a resolution allocated by SbSocketResolve.
-
-`resolution`: The resolution to be freed.
-
-#### Declaration ####
-
-```
-void SbSocketFreeResolution(SbSocketResolution *resolution)
-```
-
-### SbSocketGetInterfaceAddress ###
-
-Gets the source address and the netmask that would be used to connect to the
-destination. The netmask parameter is optional, and only populated if a non-NULL
-parameter is passed in. To determine which source IP will be used, the kernel
-takes into account the protocol, routes, destination ip, etc. The subnet mask,
-aka netmask, is used to find the routing prefix. In IPv6, this should be derived
-from the prefix value.
-
-Returns whether it was possible to determine the source address and the netmask
-(if non-NULL value is passed) to be used to connect to the destination. This
-function could fail if the destination is not reachable, if it an invalid
-address, etc.
-
-`destination`: The destination IP to be connected to. If IP addresses is not
-0.0.0.0 or ::, then temporary addresses may be returned.
-
-If the destination address is 0.0.0.0, and its `type` is
-`kSbSocketAddressTypeIpv4`, then any IPv4 local interface that is up and not a
-loopback interface is a valid return value.
-
-If the destination address is ::, and its `type` is `kSbSocketAddressTypeIpv6`
-then any IPv6 local interface that is up and not loopback or a link-local IP is
-a valid return value. However, in the case of IPv6, the address with the biggest
-scope must be returned. E.g., a globally scoped and routable IP is prefered over
-a unique local address (ULA). Also, the IP address that is returned must be
-permanent.
-
-If destination address is NULL, then any IP address that is valid for
-`destination` set to 0.0.0.0 (IPv4) or :: (IPv6) can be returned.
-
-`out_source_address`: This function places the address of the local interface in
-this output variable. `out_netmask`: This parameter is optional. If a non-NULL
-value is passed in, this function places the netmask associated with the source
-address in this output variable.
-
-#### Declaration ####
-
-```
-bool SbSocketGetInterfaceAddress(const SbSocketAddress *const destination, SbSocketAddress *out_source_address, SbSocketAddress *out_netmask)
-```
-
-### SbSocketGetLastError ###
-
-Returns the last error set on `socket`. If `socket` is not valid, this function
-returns `kSbSocketErrorFailed`.
-
-`socket`: The SbSocket that the last error is returned for.
-
-#### Declaration ####
-
-```
-SbSocketError SbSocketGetLastError(SbSocket socket)
-```
-
-### SbSocketGetLocalAddress ###
-
-Gets the address that this socket is bound to locally, if the socket is
-connected. The return value indicates whether the address was retrieved
-successfully.
-
-`socket`: The SbSocket for which the local address is retrieved. `out_address`:
-The SbSocket's local address.
-
-#### Declaration ####
-
-```
-bool SbSocketGetLocalAddress(SbSocket socket, SbSocketAddress *out_address)
-```
-
-### SbSocketIsConnected ###
-
-Indicates whether `socket` is connected to anything. Invalid sockets are not
-connected.
-
-`socket`: The SbSocket to be checked.
-
-#### Declaration ####
-
-```
-bool SbSocketIsConnected(SbSocket socket)
-```
-
-### SbSocketIsConnectedAndIdle ###
-
-Returns whether `socket` is connected to anything, and, if so, whether it is
-receiving any data.
-
-`socket`: The SbSocket to be checked.
-
-#### Declaration ####
-
-```
-bool SbSocketIsConnectedAndIdle(SbSocket socket)
-```
-
-### SbSocketIsValid ###
-
-Returns whether the given socket handle is valid.
-
-#### Declaration ####
-
-```
-static bool SbSocketIsValid(SbSocket socket)
-```
-
-### SbSocketJoinMulticastGroup ###
-
-Joins `socket` to an IP multicast group identified by `address`. The equivalent
-of IP_ADD_MEMBERSHIP. The return value indicates whether the socket was joined
-to the group successfully.
-
-`socket`: The SbSocket to be joined to the IP multicast group. `address`: The
-location of the IP multicast group.
-
-#### Declaration ####
-
-```
-bool SbSocketJoinMulticastGroup(SbSocket socket, const SbSocketAddress *address)
-```
-
-### SbSocketListen ###
-
-Causes `socket` to listen on the local address that `socket` was previously
-bound to by SbSocketBind. This function sets and returns the socket error if it
-is unable to listen for some reason. (It returns `kSbSocketOk` if it creates the
-connection successfully.)
-
-`socket`: The SbSocket on which the function operates.
-
-#### Declaration ####
-
-```
-SbSocketError SbSocketListen(SbSocket socket)
-```
-
-### SbSocketReceiveFrom ###
-
-Reads up to `data_size` bytes from `socket` into `out_data` and places the
-source address of the packet in `out_source` if out_source is not NULL. Returns
-the number of bytes read, or a negative number if there is an error, in which
-case SbSocketGetLastError can provide the precise error encountered.
-
-Note that this function is NOT specified to make a best effort to read all data
-on all platforms, but it MAY still do so. It is specified to read however many
-bytes are available conveniently, meaning that it should avoid blocking until
-there is data. It can be run in a loop until SbSocketGetLastError returns
-`kSbSocketPending` to make it a best-effort read (but still only up to not
-blocking, unless you want to spin).
-
-The primary use of `out_source` is to receive datagram packets from multiple
-sources on a UDP server socket. TCP has two endpoints connected persistently, so
-the address is unnecessary, but allowed.
-
-`socket`: The SbSocket from which data is read. `out_data`: The data read from
-the socket. `data_size`: The number of bytes to read. `out_source`: The source
-address of the packet.
-
-#### Declaration ####
-
-```
-int SbSocketReceiveFrom(SbSocket socket, char *out_data, int data_size, SbSocketAddress *out_source)
-```
-
-### SbSocketResolve ###
-
-Synchronously resolves `hostname` into the returned SbSocketResolution , which
-must be freed with SbSocketFreeResolution. The function returns `NULL` if it is
-unable to resolve `hostname`.
-
-`hostname`: The hostname to be resolved. `filters`: A mask of
-SbSocketResolveFilter values used to filter the resolution. If `filters` does
-not specify an IP address family filter, all address families are included.
-However, if one IP address family filter is specified, only that address family
-is included. The function ignores unrecognized filter bits.
-
-#### Declaration ####
-
-```
-SbSocketResolution* SbSocketResolve(const char *hostname, int filters)
-```
-
-### SbSocketSendTo ###
-
-Writes up to `data_size` bytes of `data` to `destination` via `socket`. Returns
-the number of bytes written, or a negative number if there is an error, in which
-case `SbSocketGetLastError` can provide the precise error encountered.
-
-Note that this function is NOT specified to make a best effort to write all data
-on all platforms, but it MAY still do so. It is specified to write however many
-bytes are available conveniently. It can be run in a loop until
-SbSocketGetLastError returns `kSbSocketPending` to make it a best-effort write
-(but still only up to not blocking, unless you want to spin).
-
-`socket`: The SbSocket to use to write data. `data`: The data read from the
-socket. `data_size`: The number of bytes of `data` to write. `destination`: The
-location to which data is written. This value must be `NULL` for TCP
-connections, which can only have a single endpoint.
-
-The primary use of `destination` is to send datagram packets, which can go out
-to multiple sources from a single UDP server socket. TCP has two endpoints
-connected persistently, so setting `destination` when sending to a TCP socket
-will cause an error.
-
-#### Declaration ####
-
-```
-int SbSocketSendTo(SbSocket socket, const char *data, int data_size, const SbSocketAddress *destination)
-```
-
-### SbSocketSetBroadcast ###
-
-Sets the `SO_BROADCAST`, or equivalent, option to `value` on `socket`. The
-return value indicates whether the option was actually set.
-
-This option is only meaningful for UDP sockets and allows the socket to send to
-the broadcast address.
-
-`socket`: The SbSocket for which the option is set. `value`: The new value for
-the option.
-
-#### Declaration ####
-
-```
-bool SbSocketSetBroadcast(SbSocket socket, bool value)
-```
-
-### SbSocketSetReceiveBufferSize ###
-
-Sets the `SO_RCVBUF`, or equivalent, option to `size` on `socket`. The return
-value indicates whether the option was actually set.
-
-`socket`: The SbSocket for which the option is set. `size`: The value for the
-option.
-
-#### Declaration ####
-
-```
-bool SbSocketSetReceiveBufferSize(SbSocket socket, int32_t size)
-```
-
-### SbSocketSetReuseAddress ###
-
-Sets the `SO_REUSEADDR`, or equivalent, option to `value` on `socket`. The
-return value indicates whether the option was actually set.
-
-This option allows a bound address to be reused if a socket isn't actively bound
-to it.
-
-`socket`: The SbSocket for which the option is set. `value`: The new value for
-the option.
-
-#### Declaration ####
-
-```
-bool SbSocketSetReuseAddress(SbSocket socket, bool value)
-```
-
-### SbSocketSetSendBufferSize ###
-
-Sets the `SO_SNDBUF`, or equivalent, option to `size` on `socket`. The return
-value indicates whether the option was actually set.
-
-`socket`: The SbSocket for which the option is set. `size`: The value for the
-option.
-
-#### Declaration ####
-
-```
-bool SbSocketSetSendBufferSize(SbSocket socket, int32_t size)
-```
-
-### SbSocketSetTcpKeepAlive ###
-
-Sets the `SO_KEEPALIVE`, or equivalent, option to `value` on `socket`. The
-return value indicates whether the option was actually set.
-
-`socket`: The SbSocket for which the option is set. `value`: If set to `true`,
-then `period` specifies the minimum time (SbTime) is always in microseconds)
-between keep-alive packets. If set to `false`, `period` is ignored. `period`:
-The time between keep-alive packets. This value is only relevant if `value` is
-`true`.
-
-#### Declaration ####
-
-```
-bool SbSocketSetTcpKeepAlive(SbSocket socket, bool value, SbTime period)
-```
-
-### SbSocketSetTcpNoDelay ###
-
-Sets the `TCP_NODELAY`, or equivalent, option to `value` on `socket`. The return
-value indicates whether the option was actually set.
-
-This function disables the Nagle algorithm for reducing the number of packets
-sent when converting from a stream to packets. Disabling Nagle generally puts
-the data for each Send call into its own packet, but does not guarantee that
-behavior.
-
-`socket`: The SbSocket for which the option is set. `value`: Indicates whether
-the Nagle algorithm should be disabled (`value`=`true`).
-
-#### Declaration ####
-
-```
-bool SbSocketSetTcpNoDelay(SbSocket socket, bool value)
-```
-
-### SbSocketSetTcpWindowScaling ###
-
-Sets the `SO_WINSCALE`, or equivalent, option to `value` on `socket`. The return
-value indicates whether the option was actually set.
-
-`socket`: The SbSocket for which the option is set. `value`: The value for the
-option.
-
-#### Declaration ####
-
-```
-bool SbSocketSetTcpWindowScaling(SbSocket socket, bool value)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/socket_waiter.md b/src/cobalt/site/docs/reference/starboard/modules/6/socket_waiter.md
deleted file mode 100644
index 409169f..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/socket_waiter.md
+++ /dev/null
@@ -1,237 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: socket_waiter.h"
----
-
-Allows a thread to wait on many sockets at once. The standard usage pattern
-would be for a single I/O thread to:
-
-1.  Create its own SbSocketWaiter.
-
-1.  Wait on the SbSocketWaiter, indefinitely if no scheduled tasks, or timed if
-    there are scheduled future tasks.
-
-1.  While waiting, the SbSocketWaiter will call back to service ready SbSockets.
-
-1.  Wake up, if signaled to do so.
-
-1.  If ready to exit, go to 7.
-
-1.  Add and remove SbSockets to and from the SbSocketWaiter, and go to 2.
-
-1.  Destroy its SbSocketWaiter and exit.
-
-If another thread wants to queue immediate or schedule future work on the I/O
-thread, it needs to call SbSocketWaiterWakeUp() on the SbSocketWaiter after
-queuing the work item, or the SbSocketWaiter is not otherwise guaranteed to wake
-up.
-
-## Macros ##
-
-### kSbSocketWaiterInvalid ###
-
-Well-defined value for an invalid socket watcher handle.
-
-## Enums ##
-
-### SbSocketWaiterInterest ###
-
-All the interests that a socket may register for on a waiter.
-
-#### Values ####
-
-*   `kSbSocketWaiterInterestNone`
-
-    No interests whatsoever.
-*   `kSbSocketWaiterInterestRead`
-
-    An interest in or readiness to read from a socket without blocking.
-*   `kSbSocketWaiterInterestWrite`
-
-    An interest in or readiness to write to a socket without blocking.
-
-### SbSocketWaiterResult ###
-
-Possible reasons why a call to SbSocketWaiterWaitTimed returned.
-
-#### Values ####
-
-*   `kSbSocketWaiterResultInvalid`
-
-    The wait didn't block because the waiter was invalid.
-*   `kSbSocketWaiterResultTimedOut`
-
-    The wait stopped because the timeout expired.
-*   `kSbSocketWaiterResultWokenUp`
-
-    The wait stopped because a call to SbSocketWaiterWakeUp was consumed.
-
-## Typedefs ##
-
-### SbSocketWaiter ###
-
-A handle to a socket waiter.
-
-#### Definition ####
-
-```
-typedef SbSocketWaiterPrivate* SbSocketWaiter
-```
-
-### SbSocketWaiterCallback ###
-
-Function pointer for socket waiter callbacks.
-
-#### Definition ####
-
-```
-typedef void(* SbSocketWaiterCallback) (SbSocketWaiter waiter, SbSocket socket, void *context, int ready_interests)
-```
-
-## Functions ##
-
-### SbSocketWaiterAdd ###
-
-Adds a new socket to be waited on by the `waiter` with a bitfield of
-`interests`. This function should only be called on the thread that waits on
-this waiter.
-
-If `socket` is already registered with this or another waiter, the function does
-nothing and returns `false`. The client must remove the socket and then add it
-back with the new `interests`.
-
-If `socket` is already ready for one or more of the operations set in the
-`interests` mask, then the callback will be called on the next call to either
-SbSocketWaiterWait() or SbSocketWaiterWaitTimed().
-
-`waiter`: An SbSocketWaiter that waits on the socket for the specified set of
-operations (`interests`). `socket`: The SbSocket on which the waiter waits.
-`context`: `callback`: The function that is called when the event fires. The
-`waiter`, `socket`, `context` are all passed to the callback, along with a
-bitfield of `interests` that the socket is actually ready for. `interests`: A
-bitfield that identifies operations for which the socket is waiting.
-`persistent`: Identifies the procedure that will be followed for removing the
-socket:
-
-*   If `persistent` is `true`, then `socket` stays registered with `waiter`
-    until SbSocketWaiterRemove() is called with `waiter` and `socket`.
-
-*   If `persistent` is `false`, then `socket` is removed after the next call to
-    `callback`, even if not all registered `interests` became ready.
-
-#### Declaration ####
-
-```
-bool SbSocketWaiterAdd(SbSocketWaiter waiter, SbSocket socket, void *context, SbSocketWaiterCallback callback, int interests, bool persistent)
-```
-
-### SbSocketWaiterCreate ###
-
-The results of two threads waiting on the same waiter is undefined and will not
-work. Except for the SbSocketWaiterWakeUp() function, SbSocketWaiters are not
-thread-safe and don't expect to be modified concurrently.
-
-#### Declaration ####
-
-```
-SbSocketWaiter SbSocketWaiterCreate()
-```
-
-### SbSocketWaiterDestroy ###
-
-Destroys `waiter` and removes all sockets still registered by way of
-SbSocketWaiterAdd. This function may be called on any thread as long as there is
-no risk of concurrent access to the waiter.
-
-`waiter`: The SbSocketWaiter to be destroyed.
-
-#### Declaration ####
-
-```
-bool SbSocketWaiterDestroy(SbSocketWaiter waiter)
-```
-
-### SbSocketWaiterIsValid ###
-
-Returns whether the given socket handle is valid.
-
-#### Declaration ####
-
-```
-static bool SbSocketWaiterIsValid(SbSocketWaiter watcher)
-```
-
-### SbSocketWaiterRemove ###
-
-Removes a socket, previously added with SbSocketWaiterAdd(), from a waiter. This
-function should only be called on the thread that waits on this waiter.
-
-The return value indicates whether the waiter still waits on the socket. If
-`socket` wasn't registered with `waiter`, then the function is a no-op and
-returns `true`.
-
-`waiter`: The waiter from which the socket is removed. `socket`: The socket to
-remove from the waiter.
-
-#### Declaration ####
-
-```
-bool SbSocketWaiterRemove(SbSocketWaiter waiter, SbSocket socket)
-```
-
-### SbSocketWaiterWait ###
-
-Waits on all registered sockets, calling the registered callbacks if and when
-the corresponding sockets become ready for an interested operation. This version
-exits only after SbSocketWaiterWakeUp() is called. This function should only be
-called on the thread that waits on this waiter.
-
-#### Declaration ####
-
-```
-void SbSocketWaiterWait(SbSocketWaiter waiter)
-```
-
-### SbSocketWaiterWaitTimed ###
-
-Behaves similarly to SbSocketWaiterWait(), but this function also causes
-`waiter` to exit on its own after at least `duration` has passed if
-SbSocketWaiterWakeUp() it not called by that time.
-
-The return value indicates the reason that the socket waiter exited. This
-function should only be called on the thread that waits on this waiter.
-
-`duration`: The minimum amount of time after which the socket waiter should exit
-if it is not woken up before then. As with SbThreadSleep() (see thread.h), this
-function may wait longer than `duration`, such as if the timeout expires while a
-callback is being fired.
-
-#### Declaration ####
-
-```
-SbSocketWaiterResult SbSocketWaiterWaitTimed(SbSocketWaiter waiter, SbTime duration)
-```
-
-### SbSocketWaiterWakeUp ###
-
-Wakes up `waiter` once. This is the only thread-safe waiter function. It can can
-be called from a SbSocketWaiterCallback to wake up its own waiter, and it can
-also be called from another thread at any time. In either case, the waiter will
-exit the next wait gracefully, first completing any in-progress callback.
-
-Each time this function is called, it causes the waiter to wake up once,
-regardless of whether the waiter is currently waiting. If the waiter is not
-waiting, the function takes effect immediately the next time the waiter waits.
-The number of wake-ups accumulates, and the queue is only consumed as the waiter
-waits and then is subsequently woken up again. For example, if you call this
-function 7 times, then SbSocketWaiterWait() and WaitTimed() will not block the
-next 7 times they are called.
-
-`waiter`: The socket waiter to be woken up.
-
-#### Declaration ####
-
-```
-void SbSocketWaiterWakeUp(SbSocketWaiter waiter)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/speech_synthesis.md b/src/cobalt/site/docs/reference/starboard/modules/6/speech_synthesis.md
deleted file mode 100644
index 2074650..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/speech_synthesis.md
+++ /dev/null
@@ -1,42 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: speech_synthesis.h"
----
-
-A basic text-to-speech API intended to be used for audio accessibilty.
-
-Implementations of this API should audibly play back text to assist users in
-non-visual navigation of the application.
-
-Note that these functions do not have to be thread-safe. They must only be
-called from a single application thread.
-
-## Functions ##
-
-### SbSpeechSynthesisCancel ###
-
-Cancels all speaking and queued speech synthesis audio. Must return immediately.
-
-#### Declaration ####
-
-```
-void SbSpeechSynthesisCancel()
-```
-
-### SbSpeechSynthesisSpeak ###
-
-Enqueues `text`, a UTF-8 string, to be spoken. Returns immediately.
-
-Spoken language for the text should be the same as the locale returned by
-SbSystemGetLocaleId().
-
-If audio from previous SbSpeechSynthesisSpeak() invocations is still processing,
-the current speaking should continue and this new text should be queued to play
-when the previous utterances are complete.
-
-#### Declaration ####
-
-```
-void SbSpeechSynthesisSpeak(const char *text)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/spin_lock.md b/src/cobalt/site/docs/reference/starboard/modules/6/spin_lock.md
deleted file mode 100644
index dc1989d..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/spin_lock.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: spin_lock.h"
----
-
-Defines a C++-only spin-lock implementation, built entirely on top of Starboard
-atomics and threads. It can be safely used by both clients and implementations.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/storage.md b/src/cobalt/site/docs/reference/starboard/modules/6/storage.md
deleted file mode 100644
index a2afdf5..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/storage.md
+++ /dev/null
@@ -1,161 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: storage.h"
----
-
-Defines a user-based Storage API. This is a simple, all-at-once BLOB storage and
-retrieval API that is intended for robust long-term, per-user storage. Some
-platforms have different mechanisms for this kind of storage, so this API exists
-to allow a client application to access this kind of storage.
-
-Note that there can be only one storage record per user and, thus, a maximum of
-one open storage record can exist for each user. Attempting to open a second
-record for a user will result in undefined behavior.
-
-These APIs are NOT expected to be thread-safe, so either call them from a single
-thread, or perform proper synchronization around all calls.
-
-## Macros ##
-
-### kSbStorageInvalidRecord ###
-
-Well-defined value for an invalid storage record handle.
-
-## Typedefs ##
-
-### SbStorageRecord ###
-
-A handle to an open storage record.
-
-#### Definition ####
-
-```
-typedef SbStorageRecordPrivate* SbStorageRecord
-```
-
-## Functions ##
-
-### SbStorageCloseRecord ###
-
-Closes `record`, synchronously ensuring that all written data is flushed. This
-function performs blocking I/O on the calling thread.
-
-The return value indicates whether the operation succeeded. Storage writes
-should be as atomic as possible, so the record should either be fully written or
-deleted (or, even better, untouched).
-
-`record`: The storage record to close. `record` is invalid after this point, and
-subsequent calls referring to `record` will fail.
-
-#### Declaration ####
-
-```
-bool SbStorageCloseRecord(SbStorageRecord record)
-```
-
-### SbStorageDeleteRecord ###
-
-Deletes the `SbStorageRecord` for `user` named `name`. The return value
-indicates whether the record existed and was successfully deleted. If the record
-did not exist or could not be deleted, the function returns `false`.
-
-If `name` is NULL, deletes the default storage record for the user, like what
-would have been deleted with the previous version of SbStorageDeleteRecord.
-
-This function must not be called while the user's storage record is open. This
-function performs blocking I/O on the calling thread.
-
-`user`: The user for whom the record will be deleted. `name`: The filesystem-
-safe name of the record to open.
-
-#### Declaration ####
-
-```
-bool SbStorageDeleteRecord(SbUser user, const char *name)
-```
-
-### SbStorageGetRecordSize ###
-
-Returns the size of `record`, or `-1` if there is an error. This function
-performs blocking I/O on the calling thread.
-
-`record`: The record to retrieve the size of.
-
-#### Declaration ####
-
-```
-int64_t SbStorageGetRecordSize(SbStorageRecord record)
-```
-
-### SbStorageIsValidRecord ###
-
-Returns whether the given storage record handle is valid.
-
-#### Declaration ####
-
-```
-static bool SbStorageIsValidRecord(SbStorageRecord record)
-```
-
-### SbStorageOpenRecord ###
-
-Opens and returns the SbStorageRecord for `user` named `name`, blocking I/O on
-the calling thread until the open is completed. If `user` is not a valid
-`SbUser`, the function returns `kSbStorageInvalidRecord`. Will return an
-`SbStorageRecord` of size zero if the record does not yet exist. Opening an
-already-open `SbStorageRecord` has undefined behavior.
-
-If `name` is NULL, opens the default storage record for the user, like what
-would have been saved with the previous version of SbStorageOpenRecord.
-
-`user`: The user for which the storage record will be opened. `name`: The
-filesystem-safe name of the record to open.
-
-#### Declaration ####
-
-```
-SbStorageRecord SbStorageOpenRecord(SbUser user, const char *name)
-```
-
-### SbStorageReadRecord ###
-
-Reads up to `data_size` bytes from `record`, starting at the beginning of the
-record. The function returns the actual number of bytes read, which must be <=
-`data_size`. The function returns `-1` in the event of an error. This function
-makes a best-effort to read the entire record, and it performs blocking I/O on
-the calling thread until the entire record is read or an error is encountered.
-
-`record`: The record to be read. `out_data`: The data read from the record.
-`data_size`: The amount of data, in bytes, to read.
-
-#### Declaration ####
-
-```
-int64_t SbStorageReadRecord(SbStorageRecord record, char *out_data, int64_t data_size)
-```
-
-### SbStorageWriteRecord ###
-
-Replaces the data in `record` with `data_size` bytes from `data`. This function
-always deletes any previous data in that record. The return value indicates
-whether the write succeeded. This function makes a best-effort to write the
-entire record, and it may perform blocking I/O on the calling thread until the
-entire record is written or an error is encountered.
-
-While `SbStorageWriteRecord()` may defer the persistence,
-`SbStorageReadRecord()` is expected to work as expected immediately afterwards,
-even without a call to `SbStorageCloseRecord()`. The data should be persisted
-after a short time, even if there is an unexpected process termination before
-`SbStorageCloseRecord()` is called.
-
-`record`: The record to be written to. `data`: The data to write to the record.
-`data_size`: The amount of `data`, in bytes, to write to the record. Thus, if
-`data_size` is smaller than the total size of `data`, only part of `data` is
-written to the record.
-
-#### Declaration ####
-
-```
-bool SbStorageWriteRecord(SbStorageRecord record, const char *data, int64_t data_size)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/string.md b/src/cobalt/site/docs/reference/starboard/modules/6/string.md
deleted file mode 100644
index eece136..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/string.md
+++ /dev/null
@@ -1,510 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: string.h"
----
-
-Defines functions for interacting with c-style strings.
-
-## Functions ##
-
-### SbStringAToI ###
-
-Parses a string into a base-10 integer. This is a shorthand replacement for
-`atoi`.
-
-`value`: The string to be converted.
-
-#### Declaration ####
-
-```
-static int SbStringAToI(const char *value)
-```
-
-### SbStringAToL ###
-
-Parses a string into a base-10, long integer. This is a shorthand replacement
-for `atol`.
-
-`value`: The string to be converted. NOLINTNEXTLINE(runtime/int)
-
-#### Declaration ####
-
-```
-static long SbStringAToL(const char *value)
-```
-
-### SbStringCompare ###
-
-Compares the first `count` characters of two 8-bit character strings. The return
-value is:
-
-*   `< 0` if `string1` is ASCII-betically lower than `string2`.
-
-*   `0` if the two strings are equal.
-
-*   `> 0` if `string1` is ASCII-betically higher than `string2`.
-
-This function is meant to be a drop-in replacement for `strncmp`.
-
-`string1`: The first 8-bit character string to compare. `string2`: The second
-8-bit character string to compare. `count`: The number of characters to compare.
-
-#### Declaration ####
-
-```
-int SbStringCompare(const char *string1, const char *string2, size_t count)
-```
-
-### SbStringCompareAll ###
-
-Compares two entire 8-bit character strings. The return value is:
-
-*   `< 0` if `string1` is ASCII-betically lower than `string2`.
-
-*   `0` if the two strings are equal.
-
-*   `> 0` if `string1` is ASCII-betically higher than `string2`.
-
-This function is meant to be a drop-in replacement for `strcmp`.
-
-`string1`: The first 8-bit character string to compare. `string2`: The second
-8-bit character string to compare.
-
-#### Declaration ####
-
-```
-int SbStringCompareAll(const char *string1, const char *string2)
-```
-
-### SbStringCompareNoCase ###
-
-Compares two strings, ignoring differences in case. The return value is:
-
-*   `< 0` if `string1` is ASCII-betically lower than `string2`.
-
-*   `0` if the two strings are equal.
-
-*   `> 0` if `string1` is ASCII-betically higher than `string2`.
-
-This function is meant to be a drop-in replacement for `strcasecmp`.
-
-`string1`: The first string to compare. `string2`: The second string to compare.
-
-#### Declaration ####
-
-```
-int SbStringCompareNoCase(const char *string1, const char *string2)
-```
-
-### SbStringCompareNoCaseN ###
-
-Compares the first `count` characters of two strings, ignoring differences in
-case. The return value is:
-
-*   `< 0` if `string1` is ASCII-betically lower than `string2`.
-
-*   `0` if the two strings are equal.
-
-*   `> 0` if `string1` is ASCII-betically higher than `string2`.
-
-This function is meant to be a drop-in replacement for `strncasecmp`.
-
-`string1`: The first string to compare. `string2`: The second string to compare.
-`count`: The number of characters to compare.
-
-#### Declaration ####
-
-```
-int SbStringCompareNoCaseN(const char *string1, const char *string2, size_t count)
-```
-
-### SbStringCompareWide ###
-
-Compares the first `count` characters of two 16-bit character strings. The
-return value is:
-
-*   `< 0` if `string1` is ASCII-betically lower than `string2`.
-
-*   `0` if the two strings are equal.
-
-*   `> 0` if `string1` is ASCII-betically higher than `string2`.
-
-This function is meant to be a drop-in replacement for `wcsncmp`.
-
-`string1`: The first 16-bit character string to compare.weird `string2`: The
-second 16-bit character string to compare. `count`: The number of characters to
-compare.
-
-#### Declaration ####
-
-```
-int SbStringCompareWide(const wchar_t *string1, const wchar_t *string2, size_t count)
-```
-
-### SbStringConcat ###
-
-Appends `source` to `out_destination` as long as `out_destination` has enough
-storage space to hold the concatenated string.
-
-This function is meant to be a drop-in replacement for `strlcat`. Also note that
-this function's signature is NOT compatible with `strncat`.
-
-`out_destination`: The string to which the `source` string is appended.
-`source`: The string to be appended to the destination string.
-`destination_size`: The amount of storage space available for the concatenated
-string.
-
-#### Declaration ####
-
-```
-int SbStringConcat(char *out_destination, const char *source, int destination_size)
-```
-
-### SbStringConcatUnsafe ###
-
-An inline wrapper for an unsafe SbStringConcat that assumes that the
-`out_destination` provides enough storage space for the concatenated string.
-Note that this function's signature is NOT compatible with `strcat`.
-
-`out_destination`: The string to which the `source` string is appended.
-`source`: The string to be appended to the destination string.
-
-#### Declaration ####
-
-```
-static int SbStringConcatUnsafe(char *out_destination, const char *source)
-```
-
-### SbStringConcatWide ###
-
-Identical to SbStringCat, but for wide characters.
-
-`out_destination`: The string to which the `source` string is appended.
-`source`: The string to be appended to the destination string.
-`destination_size`: The amount of storage space available for the concatenated
-string.
-
-#### Declaration ####
-
-```
-int SbStringConcatWide(wchar_t *out_destination, const wchar_t *source, int destination_size)
-```
-
-### SbStringCopy ###
-
-Copies as much of a `source` string as possible and null-terminates it, given
-that `destination_size` characters of storage are available. This function is
-meant to be a drop-in replacement for `strlcpy`.
-
-The return value specifies the length of `source`.
-
-`out_destination`: The location to which the string is copied. `source`: The
-string to be copied. `destination_size`: The amount of the source string to
-copy.
-
-#### Declaration ####
-
-```
-int SbStringCopy(char *out_destination, const char *source, int destination_size)
-```
-
-### SbStringCopyUnsafe ###
-
-An inline wrapper for an unsafe SbStringCopy that assumes that the destination
-provides enough storage space for the entire string. The return value is a
-pointer to the destination string. This function is meant to be a drop-in
-replacement for `strcpy`.
-
-`out_destination`: The location to which the string is copied. `source`: The
-string to be copied.
-
-#### Declaration ####
-
-```
-static char* SbStringCopyUnsafe(char *out_destination, const char *source)
-```
-
-### SbStringCopyWide ###
-
-Identical to SbStringCopy, but for wide characters.
-
-`out_destination`: The location to which the string is copied. `source`: The
-string to be copied. `destination_size`: The amount of the source string to
-copy.
-
-#### Declaration ####
-
-```
-int SbStringCopyWide(wchar_t *out_destination, const wchar_t *source, int destination_size)
-```
-
-### SbStringDuplicate ###
-
-Copies `source` into a buffer that is allocated by this function and that can be
-freed with SbMemoryDeallocate. This function is meant to be a drop-in
-replacement for `strdup`.
-
-`source`: The string to be copied.
-
-#### Declaration ####
-
-```
-char* SbStringDuplicate(const char *source)
-```
-
-### SbStringFindCharacter ###
-
-Finds the first occurrence of a `character` in `str`. The return value is a
-pointer to the found character in the given string or `NULL` if the character is
-not found. Note that this function's signature does NOT match that of the
-`strchr` function.
-
-`str`: The string to search for the character. `character`: The character to
-find in the string.
-
-#### Declaration ####
-
-```
-const char* SbStringFindCharacter(const char *str, char character)
-```
-
-### SbStringFindLastCharacter ###
-
-Finds the last occurrence of a specified character in a string. The return value
-is a pointer to the found character in the given string or `NULL` if the
-character is not found. Note that this function's signature does NOT match that
-of the `strrchr` function.
-
-`str`: The string to search for the character. `character`: The character to
-find in the string.
-
-#### Declaration ####
-
-```
-const char* SbStringFindLastCharacter(const char *str, char character)
-```
-
-### SbStringFindString ###
-
-Finds the first occurrence of `str2` in `str1`. The return value is a pointer to
-the beginning of the found string or `NULL` if the string is not found. This
-function is meant to be a drop-in replacement for `strstr`.
-
-`str1`: The string in which to search for the presence of `str2`. `str2`: The
-string to locate in `str1`.
-
-#### Declaration ####
-
-```
-const char* SbStringFindString(const char *str1, const char *str2)
-```
-
-### SbStringFormat ###
-
-Produces a string formatted with `format` and `arguments`, placing as much of
-the result that will fit into `out_buffer`. The return value specifies the
-number of characters that the format would produce if `buffer_size` were
-infinite.
-
-This function is meant to be a drop-in replacement for `vsnprintf`.
-
-`out_buffer`: The location where the formatted string is stored. `buffer_size`:
-The size of `out_buffer`. `format`: A string that specifies how the data should
-be formatted. `arguments`: Variable arguments used in the string.
-
-#### Declaration ####
-
-```
-int SbStringFormat(char *out_buffer, size_t buffer_size, const char *format, va_list arguments) SB_PRINTF_FORMAT(3
-```
-
-### SbStringFormatF ###
-
-An inline wrapper of SbStringFormat that converts from ellipsis to va_args. This
-function is meant to be a drop-in replacement for `snprintf`.
-
-`out_buffer`: The location where the formatted string is stored. `buffer_size`:
-The size of `out_buffer`. `format`: A string that specifies how the data should
-be formatted. `...`: Arguments used in the string.
-
-#### Declaration ####
-
-```
-int static int static int SbStringFormatF(char *out_buffer, size_t buffer_size, const char *format,...) SB_PRINTF_FORMAT(3
-```
-
-### SbStringFormatUnsafeF ###
-
-An inline wrapper of SbStringFormat that is meant to be a drop-in replacement
-for the unsafe but commonly used `sprintf`.
-
-`out_buffer`: The location where the formatted string is stored. `format`: A
-string that specifies how the data should be formatted. `...`: Arguments used in
-the string.
-
-#### Declaration ####
-
-```
-static int static int SbStringFormatUnsafeF(char *out_buffer, const char *format,...) SB_PRINTF_FORMAT(2
-```
-
-### SbStringFormatWide ###
-
-This function is identical to SbStringFormat, but is for wide characters. It is
-meant to be a drop-in replacement for `vswprintf`.
-
-`out_buffer`: The location where the formatted string is stored. `buffer_size`:
-The size of `out_buffer`. `format`: A string that specifies how the data should
-be formatted. `arguments`: Variable arguments used in the string.
-
-#### Declaration ####
-
-```
-int SbStringFormatWide(wchar_t *out_buffer, size_t buffer_size, const wchar_t *format, va_list arguments)
-```
-
-### SbStringFormatWideF ###
-
-An inline wrapper of SbStringFormatWide that converts from ellipsis to
-`va_args`.
-
-`out_buffer`: The location where the formatted string is stored. `buffer_size`:
-The size of `out_buffer`. `format`: A string that specifies how the data should
-be formatted. `...`: Arguments used in the string.
-
-#### Declaration ####
-
-```
-static int SbStringFormatWideF(wchar_t *out_buffer, size_t buffer_size, const wchar_t *format,...)
-```
-
-### SbStringGetLength ###
-
-Returns the length, in characters, of `str`.
-
-`str`: A zero-terminated ASCII string.
-
-#### Declaration ####
-
-```
-size_t SbStringGetLength(const char *str)
-```
-
-### SbStringGetLengthWide ###
-
-Returns the length of a wide character string. (This function is the same as
-SbStringGetLength, but for a string comprised of wide characters.) This function
-assumes that there are no multi-element characters.
-
-`str`: A zero-terminated ASCII string.
-
-#### Declaration ####
-
-```
-size_t SbStringGetLengthWide(const wchar_t *str)
-```
-
-### SbStringParseDouble ###
-
-Extracts a string that represents an integer from the beginning of `start` into
-a double.
-
-This function is meant to be a drop-in replacement for `strtod`, except that it
-is explicitly declared to return a double.
-
-`start`: The string that begins with the number to be converted. `out_end`: If
-provided, the function places a pointer to the end of the consumed portion of
-the string into `out_end`.
-
-#### Declaration ####
-
-```
-double SbStringParseDouble(const char *start, char **out_end)
-```
-
-### SbStringParseSignedInteger ###
-
-Extracts a string that represents an integer from the beginning of `start` into
-a signed integer in the given `base`. This function is meant to be a drop-in
-replacement for `strtol`.
-
-`start`: The string that begins with the number to be converted. `out_end`: If
-provided, the function places a pointer to the end of the consumed portion of
-the string into `out_end`. `base`: The base into which the number will be
-converted. The value must be between `2` and `36`, inclusive.
-NOLINTNEXTLINE(runtime/int)
-
-#### Declaration ####
-
-```
-long SbStringParseSignedInteger(const char *start, char **out_end, int base)
-```
-
-### SbStringParseUInt64 ###
-
-Extracts a string that represents an integer from the beginning of `start` into
-an unsigned 64-bit integer in the given `base`.
-
-This function is meant to be a drop-in replacement for `strtoull`, except that
-it is explicitly declared to return `uint64_t`.
-
-`start`: The string that begins with the number to be converted. `out_end`: If
-provided, the function places a pointer to the end of the consumed portion of
-the string into `out_end`. `base`: The base into which the number will be
-converted. The value must be between `2` and `36`, inclusive.
-
-#### Declaration ####
-
-```
-uint64_t SbStringParseUInt64(const char *start, char **out_end, int base)
-```
-
-### SbStringParseUnsignedInteger ###
-
-Extracts a string that represents an integer from the beginning of `start` into
-an unsigned integer in the given `base`. This function is meant to be a drop-in
-replacement for `strtoul`.
-
-`start`: The string that begins with the number to be converted. `out_end`: If
-provided, the function places a pointer to the end of the consumed portion of
-the string into `out_end`. `base`: The base into which the number will be
-converted. The value must be between `2` and `36`, inclusive.
-NOLINTNEXTLINE(runtime/int)
-
-#### Declaration ####
-
-```
-unsigned long SbStringParseUnsignedInteger(const char *start, char **out_end, int base)
-```
-
-### SbStringScan ###
-
-Scans `buffer` for `pattern`, placing the extracted values in `arguments`. The
-return value specifies the number of successfully matched items, which may be
-`0`.
-
-This function is meant to be a drop-in replacement for `vsscanf`.
-
-`buffer`: The string to scan for the pattern. `pattern`: The string to search
-for in `buffer`. `arguments`: Values matching `pattern` that were extracted from
-`buffer`.
-
-#### Declaration ####
-
-```
-int SbStringScan(const char *buffer, const char *pattern, va_list arguments)
-```
-
-### SbStringScanF ###
-
-An inline wrapper of SbStringScan that converts from ellipsis to `va_args`. This
-function is meant to be a drop-in replacement for `sscanf`. `buffer`: The string
-to scan for the pattern. `pattern`: The string to search for in `buffer`. `...`:
-Values matching `pattern` that were extracted from `buffer`.
-
-#### Declaration ####
-
-```
-static int SbStringScanF(const char *buffer, const char *pattern,...)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/system.md b/src/cobalt/site/docs/reference/starboard/modules/6/system.md
deleted file mode 100644
index a2fa671..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/system.md
+++ /dev/null
@@ -1,739 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: system.h"
----
-
-Defines a broad set of APIs that allow the client application to query build and
-runtime properties of the enclosing system.
-
-## Macros ##
-
-### kSbSystemPlatformErrorInvalid ###
-
-Well-defined value for an invalid `SbSystemPlatformError`.
-
-## Enums ##
-
-### SbSystemCapabilityId ###
-
-Runtime capabilities are boolean properties of a platform that can't be
-determined at compile-time. They may vary from device to device, but they will
-not change over the course of a single execution. They often specify particular
-behavior of other APIs within the bounds of their operating range.
-
-#### Values ####
-
-*   `kSbSystemCapabilityReversedEnterAndBack`
-
-    Whether this system has reversed Enter and Back keys.
-*   `kSbSystemCapabilityCanQueryGPUMemoryStats`
-
-    Whether this system has the ability to report on GPU memory usage. If (and
-    only if) a system has this capability will SbSystemGetTotalGPUMemory() and
-    SbSystemGetUsedGPUMemory() be valid to call.
-
-### SbSystemConnectionType ###
-
-Enumeration of network connection types.
-
-#### Values ####
-
-*   `kSbSystemConnectionTypeWired`
-
-    The system is on a wired connection.
-*   `kSbSystemConnectionTypeWireless`
-
-    The system is on a wireless connection.
-*   `kSbSystemConnectionTypeUnknown`
-
-    The system connection type is unknown.
-
-### SbSystemDeviceType ###
-
-Enumeration of device types.
-
-#### Values ####
-
-*   `kSbSystemDeviceTypeBlueRayDiskPlayer`
-
-    Blue-ray Disc Player (BDP).
-*   `kSbSystemDeviceTypeGameConsole`
-
-    A relatively high-powered TV device used primarily for playing games.
-*   `kSbSystemDeviceTypeOverTheTopBox`
-
-    Over the top (OTT) devices stream content via the Internet over another type
-    of network, e.g. cable or satellite.
-*   `kSbSystemDeviceTypeSetTopBox`
-
-    Set top boxes (STBs) stream content primarily over cable or satellite. Some
-    STBs can also stream OTT content via the Internet.
-*   `kSbSystemDeviceTypeTV`
-
-    A Smart TV is a TV that can directly run applications that stream OTT
-    content via the Internet.
-*   `kSbSystemDeviceTypeDesktopPC`
-
-    Desktop PC.
-*   `kSbSystemDeviceTypeAndroidTV`
-
-    An Android TV Device.
-*   `kSbSystemDeviceTypeUnknown`
-
-    Unknown device.
-
-### SbSystemPathId ###
-
-Enumeration of special paths that the platform can define.
-
-#### Values ####
-
-*   `kSbSystemPathContentDirectory`
-
-    Path to where the local content files that ship with the binary are
-    available.
-*   `kSbSystemPathCacheDirectory`
-
-    Path to the directory that can be used as a local file cache, if available.
-*   `kSbSystemPathDebugOutputDirectory`
-
-    Path to the directory where debug output (e.g. logs, trace output,
-    screenshots) can be written into.
-*   `kSbSystemPathFontDirectory`
-
-    Path to a directory where system font files can be found. Should only be
-    specified on platforms that provide fonts usable by Starboard applications.
-*   `kSbSystemPathFontConfigurationDirectory`
-
-    Path to a directory where system font configuration metadata can be found.
-    May be the same directory as `kSbSystemPathFontDirectory`, but not
-    necessarily. Should only be specified on platforms that provide fonts usable
-    by Starboard applications.
-*   `kSbSystemPathSourceDirectory`
-
-    Deprecated and unused. Tests looking for static data should instead look in
-    the 'test' subdirectory of kSbSystemPathContentDirectory.
-*   `kSbSystemPathTempDirectory`
-
-    Path to a directory where temporary files can be written.
-*   `kSbSystemPathTestOutputDirectory`
-
-    Path to a directory where test results can be written.
-*   `kSbSystemPathExecutableFile`
-
-    Full path to the executable file.
-
-### SbSystemPlatformErrorResponse ###
-
-Possible responses for `SbSystemPlatformErrorCallback`.
-
-#### Values ####
-
-*   `kSbSystemPlatformErrorResponsePositive`
-*   `kSbSystemPlatformErrorResponseNegative`
-*   `kSbSystemPlatformErrorResponseCancel`
-
-### SbSystemPlatformErrorType ###
-
-Enumeration of possible values for the `type` parameter passed to the
-`SbSystemRaisePlatformError` function.
-
-#### Values ####
-
-*   `kSbSystemPlatformErrorTypeConnectionError`
-
-    Cobalt received a network connection error, or a network disconnection
-    event. If the `response` passed to `SbSystemPlatformErrorCallback` is
-    `kSbSystemPlatformErrorResponsePositive` then the request should be retried,
-    otherwise the app should be stopped.
-
-### SbSystemPropertyId ###
-
-System properties that can be queried for. Many of these are used in User-Agent
-string generation.
-
-#### Values ####
-
-*   `kSbSystemPropertyCertificationScope`
-
-    The certification scope that identifies a group of devices.
-*   `kSbSystemPropertyBase64EncodedCertificationSecret`
-
-    The HMAC-SHA256 base64 encoded symmetric key used to sign a subset of the
-    query parameters from the application startup URL.
-*   `kSbSystemPropertyChipsetModelNumber`
-
-    The full model number of the main platform chipset, including any vendor-
-    specific prefixes.
-*   `kSbSystemPropertyFirmwareVersion`
-
-    The production firmware version number which the device is currently
-    running.
-*   `kSbSystemPropertyFriendlyName`
-
-    A friendly name for this actual device. It may include user-personalization
-    like "Upstairs Bedroom." It may be displayed to users as part of some kind
-    of device selection (e.g. in-app DIAL).
-*   `kSbSystemPropertyManufacturerName`
-
-    A deprecated alias for `kSbSystemPropertyBrandName`.
-*   `kSbSystemPropertyBrandName`
-
-    The name of the brand under which the device is being sold.
-*   `kSbSystemPropertyModelName`
-
-    The final production model number of the device.
-*   `kSbSystemPropertyModelYear`
-
-    The year the device was launched, e.g. "2016".
-*   `kSbSystemPropertyNetworkOperatorName`
-
-    The name of the network operator that owns the target device, if applicable.
-*   `kSbSystemPropertyPlatformName`
-
-    The name of the operating system and platform, suitable for inclusion in a
-    User-Agent, say.
-*   `kSbSystemPropertyPlatformUuid`
-
-    A universally-unique ID for the current user.
-*   `kSbSystemPropertySpeechApiKey`
-
-    The Google Speech API key. The platform manufacturer is responsible for
-    registering a Google Speech API key for their products. In the API Console (
-    [http://developers.google.com/console](http://developers.google.com/console)
-    ), you can enable the Speech APIs and generate a Speech API key.
-*   `kSbSystemPropertyUserAgentAuxField`
-
-    A field that, if available, is appended to the user agent
-
-## Typedefs ##
-
-### SbSystemComparator ###
-
-Pointer to a function to compare two items. The return value uses standard
-`*cmp` semantics:
-
-*   `< 0` if `a` is less than `b`
-
-*   `0` if the two items are equal
-
-*   `> 1` if `a` is greater than `b`
-
-`a`: The first value to compare. `b`: The second value to compare.
-
-#### Definition ####
-
-```
-typedef int(* SbSystemComparator) (const void *a, const void *b)
-```
-
-### SbSystemError ###
-
-A type that can represent a system error code across all Starboard platforms.
-
-#### Definition ####
-
-```
-typedef int SbSystemError
-```
-
-### SbSystemPlatformError ###
-
-Opaque handle returned by `SbSystemRaisePlatformError` that can be passed to
-`SbSystemClearPlatformError`.
-
-#### Definition ####
-
-```
-typedef SbSystemPlatformErrorPrivate* SbSystemPlatformError
-```
-
-### SbSystemPlatformErrorCallback ###
-
-Type of callback function that may be called in response to an error
-notification from `SbSystemRaisePlatformError`. `response` is a code to indicate
-the user's response, e.g. if the platform raised a dialog to notify the user of
-the error. `user_data` is the opaque pointer that was passed to the call to
-`SbSystemRaisePlatformError`.
-
-#### Definition ####
-
-```
-typedef void(* SbSystemPlatformErrorCallback) (SbSystemPlatformErrorResponse response, void *user_data)
-```
-
-## Functions ##
-
-### SbSystemBinarySearch ###
-
-Binary searches a sorted table `base` of `element_count` objects, each element
-`element_width` bytes in size for an element that `comparator` compares equal to
-`key`.
-
-This function is meant to be a drop-in replacement for `bsearch`.
-
-`key`: The key to search for in the table. `base`: The sorted table of elements
-to be searched. `element_count`: The number of elements in the table.
-`element_width`: The size, in bytes, of each element in the table. `comparator`:
-A value that indicates how the element in the table should compare to the
-specified `key`.
-
-#### Declaration ####
-
-```
-void* SbSystemBinarySearch(const void *key, const void *base, size_t element_count, size_t element_width, SbSystemComparator comparator)
-```
-
-### SbSystemBreakIntoDebugger ###
-
-Breaks the current program into the debugger, if a debugger is attached. If a
-debugger is not attached, this function aborts the program.
-
-#### Declaration ####
-
-```
-SB_NORETURN void SbSystemBreakIntoDebugger()
-```
-
-### SbSystemClearLastError ###
-
-Clears the last error set by a Starboard call in the current thread.
-
-#### Declaration ####
-
-```
-void SbSystemClearLastError()
-```
-
-### SbSystemClearPlatformError ###
-
-Clears a platform error that was previously raised by a call to
-`SbSystemRaisePlatformError`. The platform may use this, for example, to close a
-dialog that was opened in response to the error.
-
-`handle`: The platform error to be cleared.
-
-#### Declaration ####
-
-```
-void SbSystemClearPlatformError(SbSystemPlatformError handle)
-```
-
-### SbSystemGetConnectionType ###
-
-Returns the device's current network connection type.
-
-#### Declaration ####
-
-```
-SbSystemConnectionType SbSystemGetConnectionType()
-```
-
-### SbSystemGetDeviceType ###
-
-Returns the type of the device.
-
-#### Declaration ####
-
-```
-SbSystemDeviceType SbSystemGetDeviceType()
-```
-
-### SbSystemGetErrorString ###
-
-Generates a human-readable string for an error. The return value specifies the
-total desired length of the string.
-
-`error`: The error for which a human-readable string is generated. `out_string`:
-The generated string. This value may be null, and it is always terminated with a
-null byte. `string_length`: The maximum length of the error string.
-
-#### Declaration ####
-
-```
-int SbSystemGetErrorString(SbSystemError error, char *out_string, int string_length)
-```
-
-### SbSystemGetLastError ###
-
-Gets the last platform-specific error code produced by any Starboard call in the
-current thread for diagnostic purposes. Semantic reactions to Starboard function
-call results should be modeled explicitly.
-
-#### Declaration ####
-
-```
-SbSystemError SbSystemGetLastError()
-```
-
-### SbSystemGetLocaleId ###
-
-Gets the system's current POSIX-style Locale ID. The locale represents the
-location, language, and cultural conventions that the system wants to use, which
-affects which text is displayed to the user as well as how displayed numbers,
-dates, currency, and similar values are formatted.
-
-At its simplest, the locale ID can just be a BCP 47 language code, like `en_US`.
-Currently, POSIX also wants to include the encoding as in `en_US.UTF8`. POSIX
-also allows a couple very bare-bones locales, like "C" or "POSIX", but they are
-not supported here. POSIX also supports different locale settings for a few
-different purposes, but Starboard only exposes one locale at a time.
-
-RFC 5646 describes BCP 47 language codes: [https://tools.ietf.org/html/bcp47](https://tools.ietf.org/html/bcp47)
-
-For more information than you probably want about POSIX locales, see: [http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html)
-
-#### Declaration ####
-
-```
-const char* SbSystemGetLocaleId()
-```
-
-### SbSystemGetNumberOfProcessors ###
-
-Returns the number of processor cores available to this application. If the
-process is sandboxed to a subset of the physical cores, the function returns
-that sandboxed limit.
-
-#### Declaration ####
-
-```
-int SbSystemGetNumberOfProcessors()
-```
-
-### SbSystemGetPath ###
-
-Retrieves the platform-defined system path specified by `path_id` and places it
-as a zero-terminated string into the user-allocated `out_path` unless it is
-longer than `path_length` - 1. This implementation must be thread-safe.
-
-This function returns `true` if the path is retrieved successfully. It returns
-`false` under any of the following conditions and, in any such case, `out_path`
-is not changed:
-
-*   `path_id` is invalid for this platform
-
-*   `path_length` is too short for the given result
-
-*   `out_path` is NULL
-
-`path_id`: The system path to be retrieved. `out_path`: The platform-defined
-system path specified by `path_id`. `path_length`: The length of the system
-path.
-
-#### Declaration ####
-
-```
-bool SbSystemGetPath(SbSystemPathId path_id, char *out_path, int path_length)
-```
-
-### SbSystemGetProperty ###
-
-Retrieves the platform-defined system property specified by `property_id` and
-places its value as a zero-terminated string into the user-allocated `out_value`
-unless it is longer than `value_length` - 1. This implementation must be thread-
-safe.
-
-This function returns `true` if the property is retrieved successfully. It
-returns `false` under any of the following conditions and, in any such case,
-`out_value` is not changed:
-
-*   `property_id` is invalid for this platform
-
-*   `value_length` is too short for the given result
-
-*   `out_value` is NULL
-
-`property_id`: The system path to be retrieved. `out_value`: The platform-
-defined system property specified by `property_id`. `value_length`: The length
-of the system property.
-
-#### Declaration ####
-
-```
-bool SbSystemGetProperty(SbSystemPropertyId property_id, char *out_value, int value_length)
-```
-
-### SbSystemGetRandomData ###
-
-A cryptographically secure random number generator that produces an arbitrary,
-non-negative number of `buffer_size` random, non-negative bytes. The generated
-number is placed in `out_buffer`. This function does not require manual seeding.
-
-`out_buffer`: A pointer for the generated random number. This value must not be
-null. `buffer_size`: The size of the random number, in bytes.
-
-#### Declaration ####
-
-```
-void SbSystemGetRandomData(void *out_buffer, int buffer_size)
-```
-
-### SbSystemGetRandomUInt64 ###
-
-A cryptographically secure random number generator that gets 64 random bits and
-returns them as an `uint64_t`. This function does not require manual seeding.
-
-#### Declaration ####
-
-```
-uint64_t SbSystemGetRandomUInt64()
-```
-
-### SbSystemGetStack ###
-
-Places up to `stack_size` instruction pointer addresses of the current execution
-stack into `out_stack`. The return value specifies the number of entries added.
-
-The returned stack frames are in "downward" order from the calling frame toward
-the entry point of the thread. So, if all the stack frames do not fit, the ones
-truncated will be the less interesting ones toward the thread entry point.
-
-This function is used in crash signal handlers and, therefore, it must be async-
-signal-safe on platforms that support signals. The following document discusses
-what it means to be async-signal-safe on POSIX: [http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html#tag_02_04_03](http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html#tag_02_04_03)
-
-`out_stack`: A non-NULL array of `void *` of at least `stack_size` entries.
-`stack_size`: The maximum number of instruction pointer addresses to be placed
-into `out_stack` from the current execution stack.
-
-#### Declaration ####
-
-```
-int SbSystemGetStack(void **out_stack, int stack_size)
-```
-
-### SbSystemGetTotalCPUMemory ###
-
-Returns the total CPU memory (in bytes) potentially available to this
-application. If the process is sandboxed to a maximum allowable limit, the
-function returns the lesser of the physical and sandbox limits.
-
-#### Declaration ####
-
-```
-int64_t SbSystemGetTotalCPUMemory()
-```
-
-### SbSystemGetTotalGPUMemory ###
-
-Returns the total GPU memory (in bytes) available for use by this application.
-This function may only be called the return value for calls to
-SbSystemHasCapability(kSbSystemCapabilityCanQueryGPUMemoryStats) is `true`.
-
-#### Declaration ####
-
-```
-int64_t SbSystemGetTotalGPUMemory()
-```
-
-### SbSystemGetUsedCPUMemory ###
-
-Returns the total physical CPU memory (in bytes) used by this application. This
-value should always be less than (or, in particularly exciting situations, equal
-to) SbSystemGetTotalCPUMemory().
-
-#### Declaration ####
-
-```
-int64_t SbSystemGetUsedCPUMemory()
-```
-
-### SbSystemGetUsedGPUMemory ###
-
-Returns the current amount of GPU memory (in bytes) that is currently being used
-by this application. This function may only be called if the return value for
-calls to SbSystemHasCapability(kSbSystemCapabilityCanQueryGPUMemoryStats) is
-`true`.
-
-#### Declaration ####
-
-```
-int64_t SbSystemGetUsedGPUMemory()
-```
-
-### SbSystemHasCapability ###
-
-Returns whether the platform has the runtime capability specified by
-`capability_id`. Returns false for any unknown capabilities. This implementation
-must be thread-safe.
-
-`capability_id`: The runtime capability to check.
-
-#### Declaration ####
-
-```
-bool SbSystemHasCapability(SbSystemCapabilityId capability_id)
-```
-
-### SbSystemHideSplashScreen ###
-
-Hides the system splash screen on systems that support a splash screen that is
-displayed while the application is loading. This function may be called from any
-thread and must be idempotent.
-
-#### Declaration ####
-
-```
-void SbSystemHideSplashScreen()
-```
-
-### SbSystemIsDebuggerAttached ###
-
-Attempts to determine whether the current program is running inside or attached
-to a debugger. The function returns `false` if neither of those cases is true.
-
-#### Declaration ####
-
-```
-bool SbSystemIsDebuggerAttached()
-```
-
-### SbSystemPlatformErrorIsValid ###
-
-Checks whether a `SbSystemPlatformError` is valid.
-
-#### Declaration ####
-
-```
-static bool SbSystemPlatformErrorIsValid(SbSystemPlatformError handle)
-```
-
-### SbSystemRaisePlatformError ###
-
-Cobalt calls this function to notify the platform that an error has occurred in
-the application that the platform may need to handle. The platform is expected
-to then notify the user of the error and to provide a means for any required
-interaction, such as by showing a dialog.
-
-The return value is a handle that may be used in a subsequent call to
-`SbSystemClearPlatformError`. For example, the handle could be used to
-programatically dismiss a dialog that was raised in response to the error. The
-lifetime of the object referenced by the handle is until the user reacts to the
-error or the error is dismissed by a call to SbSystemClearPlatformError,
-whichever happens first. Note that if the platform cannot respond to the error,
-then this function should return `kSbSystemPlatformErrorInvalid`.
-
-This function may be called from any thread, and it is the platform's
-responsibility to decide how to handle an error received while a previous error
-is still pending. If that platform can only handle one error at a time, then it
-may queue the second error or ignore it by returning
-`kSbSystemPlatformErrorInvalid`.
-
-`type`: An error type, from the SbSystemPlatformErrorType enum, that defines the
-error. `callback`: A function that may be called by the platform to let the
-caller know that the user has reacted to the error. `user_data`: An opaque
-pointer that the platform should pass as an argument to the callback function,
-if it is called.
-
-#### Declaration ####
-
-```
-SbSystemPlatformError SbSystemRaisePlatformError(SbSystemPlatformErrorType type, SbSystemPlatformErrorCallback callback, void *user_data)
-```
-
-### SbSystemRequestPause ###
-
-Requests that the application move into the Paused state at the next convenient
-point. This should roughly correspond to "unfocused application" in a
-traditional window manager, where the application may be partially visible.
-
-This function eventually causes a `kSbEventTypePause` event to be dispatched to
-the application. Before the `kSbEventTypePause` event is dispatched, some work
-may continue to be done, and unrelated system events may be dispatched.
-
-#### Declaration ####
-
-```
-void SbSystemRequestPause()
-```
-
-### SbSystemRequestStop ###
-
-Requests that the application be terminated gracefully at the next convenient
-point. In the meantime, some work may continue to be done, and unrelated system
-events may be dispatched. This function eventually causes a `kSbEventTypeStop`
-event to be dispatched to the application. When the process finally terminates,
-it returns `error_level`, if that has any meaning on the current platform.
-
-`error_level`: An integer that serves as the return value for the process that
-is eventually terminated as a result of a call to this function.
-
-#### Declaration ####
-
-```
-void SbSystemRequestStop(int error_level)
-```
-
-### SbSystemRequestSuspend ###
-
-Requests that the application move into the Suspended state at the next
-convenient point. This should roughly correspond to "minimization" in a
-traditional window manager, where the application is no longer visible.
-
-This function eventually causes a `kSbEventTypeSuspend` event to be dispatched
-to the application. Before the `kSbEventTypeSuspend` event is dispatched, some
-work may continue to be done, and unrelated system events may be dispatched.
-
-In the Suspended state, the application will be resident, but probably not
-running. The expectation is that an external system event will bring the
-application out of the Suspended state.
-
-#### Declaration ####
-
-```
-void SbSystemRequestSuspend()
-```
-
-### SbSystemRequestUnpause ###
-
-Requests that the application move into the Started state at the next convenient
-point. This should roughly correspond to a "focused application" in a
-traditional window manager, where the application is fully visible and the
-primary receiver of input events.
-
-This function eventually causes a `kSbEventTypeUnpause` event to be dispatched
-to the application. Before `kSbEventTypeUnpause` is dispatched, some work may
-continue to be done, and unrelated system events may be dispatched.
-
-#### Declaration ####
-
-```
-void SbSystemRequestUnpause()
-```
-
-### SbSystemSort ###
-
-Sorts an array of elements `base`, with `element_count` elements of
-`element_width` bytes each, using `comparator` as the comparison function.
-
-This function is meant to be a drop-in replacement for `qsort`.
-
-`base`: The array of elements to be sorted. `element_count`: The number of
-elements in the array. `element_width`: The size, in bytes, of each element in
-the array. `comparator`: A value that indicates how the array should be sorted.
-
-#### Declaration ####
-
-```
-void SbSystemSort(void *base, size_t element_count, size_t element_width, SbSystemComparator comparator)
-```
-
-### SbSystemSymbolize ###
-
-Looks up `address` as an instruction pointer and places up to (`buffer_size -
-1`) characters of the symbol associated with it in `out_buffer`, which must not
-be NULL. `out_buffer` will be NULL-terminated.
-
-The return value indicates whether the function found a reasonable match for
-`address`. If the return value is `false`, then `out_buffer` is not modified.
-
-This function is used in crash signal handlers and, therefore, it must be async-
-signal-safe on platforms that support signals.
-
-#### Declaration ####
-
-```
-bool SbSystemSymbolize(const void *address, char *out_buffer, int buffer_size)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/thread.md b/src/cobalt/site/docs/reference/starboard/modules/6/thread.md
deleted file mode 100644
index 22b075b..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/thread.md
+++ /dev/null
@@ -1,403 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: thread.h"
----
-
-Defines functionality related to thread creation and cleanup.
-
-## Macros ##
-
-### kSbThreadInvalidId ###
-
-Well-defined constant value to mean "no thread ID."
-
-### kSbThreadLocalKeyInvalid ###
-
-Well-defined constant value to mean "no thread local key."
-
-### kSbThreadNoAffinity ###
-
-Well-defined constant value to mean "no affinity."
-
-## Enums ##
-
-### SbThreadPriority ###
-
-A spectrum of thread priorities. Platforms map them appropriately to their own
-priority system. Note that scheduling is platform-specific, and what these
-priorities mean, if they mean anything at all, is also platform-specific.
-
-In particular, several of these priority values can map to the same priority on
-a given platform. The only guarantee is that each lower priority should be
-treated less-than-or-equal-to a higher priority.
-
-#### Values ####
-
-*   `kSbThreadPriorityLowest`
-
-    The lowest thread priority available on the current platform.
-*   `kSbThreadPriorityLow`
-
-    A lower-than-normal thread priority, if available on the current platform.
-*   `kSbThreadPriorityNormal`
-
-    Really, what is normal? You should spend time pondering that question more
-    than you consider less-important things, but less than you think about more-
-    important things.
-*   `kSbThreadPriorityHigh`
-
-    A higher-than-normal thread priority, if available on the current platform.
-*   `kSbThreadPriorityHighest`
-
-    The highest thread priority available on the current platform that isn't
-    considered "real-time" or "time-critical," if those terms have any meaning
-    on the current platform.
-*   `kSbThreadPriorityRealTime`
-
-    If the platform provides any kind of real-time or time-critical scheduling,
-    this priority will request that treatment. Real-time scheduling generally
-    means that the thread will have more consistency in scheduling than non-
-    real-time scheduled threads, often by being more deterministic in how
-    threads run in relation to each other. But exactly how being real-time
-    affects the thread scheduling is platform-specific.
-
-    For platforms where that is not offered, or otherwise not meaningful, this
-    will just be the highest priority available in the platform's scheme, which
-    may be the same as kSbThreadPriorityHighest.
-*   `kSbThreadNoPriority`
-
-    Well-defined constant value to mean "no priority." This means to use the
-    default priority assignment method of that platform. This may mean to
-    inherit the priority of the spawning thread, or it may mean a specific
-    default priority, or it may mean something else, depending on the platform.
-
-## Typedefs ##
-
-### SbThreadAffinity ###
-
-Type for thread core affinity. This generally will be a single cpu (or core or
-hyperthread) identifier. Some platforms may not support affinity, and some may
-have specific rules about how it must be used.
-
-#### Definition ####
-
-```
-typedef int32_t SbThreadAffinity
-```
-
-### SbThreadEntryPoint ###
-
-Function pointer type for SbThreadCreate. `context` is a pointer-sized bit of
-data passed in from the calling thread.
-
-#### Definition ####
-
-```
-typedef void*(* SbThreadEntryPoint) (void *context)
-```
-
-### SbThreadId ###
-
-An ID type that is unique per thread.
-
-#### Definition ####
-
-```
-typedef int32_t SbThreadId
-```
-
-### SbThreadLocalDestructor ###
-
-Function pointer type for Thread-Local destructors.
-
-#### Definition ####
-
-```
-typedef void(* SbThreadLocalDestructor) (void *value)
-```
-
-### SbThreadLocalKey ###
-
-A handle to a thread-local key.
-
-#### Definition ####
-
-```
-typedef SbThreadLocalKeyPrivate* SbThreadLocalKey
-```
-
-## Functions ##
-
-### SbThreadCreate ###
-
-Creates a new thread, which starts immediately.
-
-*   If the function succeeds, the return value is a handle to the newly created
-    thread.
-
-*   If the function fails, the return value is `kSbThreadInvalid`.
-
-`stack_size`: The amount of memory reserved for the thread. Set the value to `0`
-to indicate that the default stack size should be used. `priority`: The thread's
-priority. This value can be set to `kSbThreadNoPriority` to use the platform's
-default priority. As examples, it could be set to a fixed, standard priority or
-to a priority inherited from the thread that is calling SbThreadCreate(), or to
-something else. `affinity`: The thread's affinity. This value can be set to
-`kSbThreadNoAffinity` to use the platform's default affinity. `joinable`:
-Indicates whether the thread can be joined (`true`) or should start out
-"detached" (`false`). Note that for joinable threads, when you are done with the
-thread handle, you must call `SbThreadJoin` to release system resources
-associated with the thread. This is not necessary for detached threads, but
-detached threads cannot be joined. `name`: A name used to identify the thread.
-This value is used mainly for debugging, it can be `NULL`, and it might not be
-used in production builds. `entry_point`: A pointer to a function that will be
-executed on the newly created thread. `context`: This value will be passed to
-the `entry_point` function.
-
-#### Declaration ####
-
-```
-SbThread SbThreadCreate(int64_t stack_size, SbThreadPriority priority, SbThreadAffinity affinity, bool joinable, const char *name, SbThreadEntryPoint entry_point, void *context)
-```
-
-### SbThreadCreateLocalKey ###
-
-Creates and returns a new, unique key for thread local data. If the function
-does not succeed, the function returns `kSbThreadLocalKeyInvalid`.
-
-If `destructor` is specified, it will be called in the owning thread, and only
-in the owning thread, when the thread exits. In that case, it is called on the
-local value associated with the key in the current thread as long as the local
-value is not NULL.
-
-`destructor`: A pointer to a function. The value may be NULL if no clean up is
-needed.
-
-#### Declaration ####
-
-```
-SbThreadLocalKey SbThreadCreateLocalKey(SbThreadLocalDestructor destructor)
-```
-
-### SbThreadDestroyLocalKey ###
-
-Destroys thread local data for the specified key. The function is a no-op if the
-key is invalid (kSbThreadLocalKeyInvalid`) or has already been destroyed. This
-function does NOT call the destructor on any stored values.
-
-`key`: The key for which to destroy thread local data.
-
-#### Declaration ####
-
-```
-void SbThreadDestroyLocalKey(SbThreadLocalKey key)
-```
-
-### SbThreadDetach ###
-
-Detaches `thread`, which prevents it from being joined. This is sort of like a
-non-blocking join. This function is a no-op if the thread is already detached or
-if the thread is already being joined by another thread.
-
-`thread`: The thread to be detached.
-
-#### Declaration ####
-
-```
-void SbThreadDetach(SbThread thread)
-```
-
-### SbThreadGetCurrent ###
-
-Returns the handle of the currently executing thread.
-
-#### Declaration ####
-
-```
-SbThread SbThreadGetCurrent()
-```
-
-### SbThreadGetId ###
-
-Returns the Thread ID of the currently executing thread.
-
-#### Declaration ####
-
-```
-SbThreadId SbThreadGetId()
-```
-
-### SbThreadGetLocalValue ###
-
-Returns the pointer-sized value for `key` in the currently executing thread's
-local storage. Returns `NULL` if key is `kSbThreadLocalKeyInvalid` or if the key
-has already been destroyed.
-
-`key`: The key for which to return the value.
-
-#### Declaration ####
-
-```
-void* SbThreadGetLocalValue(SbThreadLocalKey key)
-```
-
-### SbThreadGetName ###
-
-Returns the debug name of the currently executing thread.
-
-#### Declaration ####
-
-```
-void SbThreadGetName(char *buffer, int buffer_size)
-```
-
-### SbThreadIsCurrent ###
-
-Returns whether `thread` is the current thread.
-
-`thread`: The thread to check.
-
-#### Declaration ####
-
-```
-static bool SbThreadIsCurrent(SbThread thread)
-```
-
-### SbThreadIsEqual ###
-
-Indicates whether `thread1` and `thread2` refer to the same thread.
-
-`thread1`: The first thread to compare. `thread2`: The second thread to compare.
-
-#### Declaration ####
-
-```
-bool SbThreadIsEqual(SbThread thread1, SbThread thread2)
-```
-
-### SbThreadIsValid ###
-
-Returns whether the given thread handle is valid.
-
-#### Declaration ####
-
-```
-static bool SbThreadIsValid(SbThread thread)
-```
-
-### SbThreadIsValidAffinity ###
-
-Returns whether the given thread affinity is valid.
-
-#### Declaration ####
-
-```
-static bool SbThreadIsValidAffinity(SbThreadAffinity affinity)
-```
-
-### SbThreadIsValidId ###
-
-Returns whether the given thread ID is valid.
-
-#### Declaration ####
-
-```
-static bool SbThreadIsValidId(SbThreadId id)
-```
-
-### SbThreadIsValidLocalKey ###
-
-Returns whether the given thread local variable key is valid.
-
-#### Declaration ####
-
-```
-static bool SbThreadIsValidLocalKey(SbThreadLocalKey key)
-```
-
-### SbThreadIsValidPriority ###
-
-Returns whether the given thread priority is valid.
-
-#### Declaration ####
-
-```
-static bool SbThreadIsValidPriority(SbThreadPriority priority)
-```
-
-### SbThreadJoin ###
-
-Joins the thread on which this function is called with joinable `thread`. This
-function blocks the caller until the designated thread exits, and then cleans up
-that thread's resources. The cleanup process essentially detaches thread.
-
-The return value is `true` if the function is successful and `false` if `thread`
-is invalid or detached.
-
-Each joinable thread can only be joined once and must be joined to be fully
-cleaned up. Once SbThreadJoin is called, the thread behaves as if it were
-detached to all threads other than the joining thread.
-
-`thread`: The thread to which the current thread will be joined. The `thread`
-must have been created with SbThreadCreate. `out_return`: If this is not `NULL`,
-then the SbThreadJoin function populates it with the return value of the
-thread's `main` function.
-
-#### Declaration ####
-
-```
-bool SbThreadJoin(SbThread thread, void **out_return)
-```
-
-### SbThreadSetLocalValue ###
-
-Sets the pointer-sized value for `key` in the currently executing thread's local
-storage. The return value indicates whether `key` is valid and has not already
-been destroyed.
-
-`key`: The key for which to set the key value. `value`: The new pointer-sized
-key value.
-
-#### Declaration ####
-
-```
-bool SbThreadSetLocalValue(SbThreadLocalKey key, void *value)
-```
-
-### SbThreadSetName ###
-
-Sets the debug name of the currently executing thread by copying the specified
-name string.
-
-`name`: The name to assign to the thread.
-
-#### Declaration ####
-
-```
-void SbThreadSetName(const char *name)
-```
-
-### SbThreadSleep ###
-
-Sleeps the currently executing thread.
-
-`duration`: The minimum amount of time, in microseconds, that the currently
-executing thread should sleep. The function is a no-op if this value is negative
-or `0`.
-
-#### Declaration ####
-
-```
-void SbThreadSleep(SbTime duration)
-```
-
-### SbThreadYield ###
-
-Yields the currently executing thread, so another thread has a chance to run.
-
-#### Declaration ####
-
-```
-void SbThreadYield()
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/thread_types.md b/src/cobalt/site/docs/reference/starboard/modules/6/thread_types.md
deleted file mode 100644
index 5f4da0e..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/thread_types.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: thread_types.h"
----
-
-Defines platform-specific threading and synchronization primitive types and
-initializers. We hide, but pass through, the platform's primitives to avoid
-doing a lot of work to replicate initialization-less synchronization primitives.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/time.md b/src/cobalt/site/docs/reference/starboard/modules/6/time.md
deleted file mode 100644
index bd59b91..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/time.md
+++ /dev/null
@@ -1,143 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: time.h"
----
-
-Provides access to system time and timers.
-
-## Macros ##
-
-### kSbTimeDay ###
-
-One day in SbTime units (microseconds).
-
-### kSbTimeHour ###
-
-One hour in SbTime units (microseconds).
-
-### kSbTimeMax ###
-
-The maximum value of an SbTime.
-
-### kSbTimeMillisecond ###
-
-One millisecond in SbTime units (microseconds).
-
-### kSbTimeMinute ###
-
-One minute in SbTime units (microseconds).
-
-### kSbTimeNanosecondsPerMicrosecond ###
-
-How many nanoseconds in one SbTime unit (microseconds).
-
-### kSbTimeSecond ###
-
-One second in SbTime units (microseconds).
-
-### kSbTimeToPosixDelta ###
-
-A term that can be added to an SbTime to convert it into the number of
-microseconds since the POSIX epoch.
-
-## Typedefs ##
-
-### SbTime ###
-
-The number of microseconds since the epoch of January 1, 1601 UTC, or the number
-of microseconds between two times. Always microseconds, ALWAYS UTC.
-
-#### Definition ####
-
-```
-typedef int64_t SbTime
-```
-
-### SbTimeMonotonic ###
-
-A number of microseconds from some point. The main property of this time is that
-it increases monotonically. It should also be as high-resolution a timer as we
-can get on a platform. So, it is good for measuring the time between two calls
-without worrying about a system clock adjustment. It's not good for getting the
-wall clock time.
-
-#### Definition ####
-
-```
-typedef int64_t SbTimeMonotonic
-```
-
-## Functions ##
-
-### SbTimeFromPosix ###
-
-Converts microseconds from the POSIX epoch into an `SbTime`.
-
-`time`: A time that measures the number of microseconds since January 1, 1970,
-00:00:00, UTC.
-
-#### Declaration ####
-
-```
-static SbTime SbTimeFromPosix(int64_t time)
-```
-
-### SbTimeGetMonotonicNow ###
-
-Gets a monotonically increasing time representing right now.
-
-#### Declaration ####
-
-```
-SbTimeMonotonic SbTimeGetMonotonicNow()
-```
-
-### SbTimeGetMonotonicThreadNow ###
-
-Gets a monotonically increasing time representing how long the current thread
-has been in the executing state (i.e. not pre-empted nor waiting on an event).
-This is not necessarily total time and is intended to allow measuring thread
-execution time between two timestamps. If this is not available then
-SbTimeGetMonotonicNow() should be used.
-
-#### Declaration ####
-
-```
-SbTimeMonotonic SbTimeGetMonotonicThreadNow()
-```
-
-### SbTimeGetNow ###
-
-Gets the current system time as an `SbTime`.
-
-#### Declaration ####
-
-```
-SbTime SbTimeGetNow()
-```
-
-### SbTimeNarrow ###
-
-Safely narrows a number from a more precise unit to a less precise one. This
-function rounds negative values toward negative infinity.
-
-#### Declaration ####
-
-```
-static int64_t SbTimeNarrow(int64_t time, int64_t divisor)
-```
-
-### SbTimeToPosix ###
-
-Converts `SbTime` into microseconds from the POSIX epoch.
-
-`time`: A time that is either measured in microseconds since the epoch of
-January 1, 1601, UTC, or that measures the number of microseconds between two
-times.
-
-#### Declaration ####
-
-```
-static int64_t SbTimeToPosix(SbTime time)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/types.md b/src/cobalt/site/docs/reference/starboard/modules/6/types.md
deleted file mode 100644
index 90867a6..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/types.md
+++ /dev/null
@@ -1,15 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: types.h"
----
-
-Provides a suite of standard types that should be universally available on all
-platforms, specifically focused on explicitly-sized integer types and booleans.
-This module also includes some related ubiquitous definitions like limits of the
-explicitly-sized integer types, and standard pointer and int32 sentinel values.
-
-## Macros ##
-
-### kSbInvalidInt ###
-
-A value that represents an int that is probably invalid.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/user.md b/src/cobalt/site/docs/reference/starboard/modules/6/user.md
deleted file mode 100644
index a30cc95..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/user.md
+++ /dev/null
@@ -1,134 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: user.h"
----
-
-Defines a user management API. This module defines functions only for managing
-signed-in users. Platforms that do not have users must still implement this API,
-always reporting a single user that is current and signed in.
-
-These APIs are NOT expected to be thread-safe, so either call them from a single
-thread, or perform proper synchronization around all calls.
-
-## Macros ##
-
-### kSbUserInvalid ###
-
-Well-defined value for an invalid user.
-
-## Enums ##
-
-### SbUserPropertyId ###
-
-A set of string properties that can be queried on a user.
-
-#### Values ####
-
-*   `kSbUserPropertyAvatarUrl`
-
-    The URL to the avatar for a user. Avatars are not provided on all platforms.
-*   `kSbUserPropertyHomeDirectory`
-
-    The path to a user's home directory, if supported on this platform.
-*   `kSbUserPropertyUserName`
-
-    The username of a user, which may be the same as the User ID, or it may be
-    friendlier.
-*   `kSbUserPropertyUserId`
-
-    A unique user ID of a user.
-
-## Typedefs ##
-
-### SbUser ###
-
-A handle to a user.
-
-#### Definition ####
-
-```
-typedef SbUserPrivate* SbUser
-```
-
-## Functions ##
-
-### SbUserGetCurrent ###
-
-Gets the current primary user, if one exists. This is the user that is
-determined, in a platform-specific way, to be the primary user controlling the
-application. For example, the determination might be made because that user
-launched the app, though it should be made using whatever criteria are
-appropriate for the platform.
-
-It is expected that there will be a unique SbUser per signed-in user, and that
-the referenced objects will persist for the lifetime of the app.
-
-#### Declaration ####
-
-```
-SbUser SbUserGetCurrent()
-```
-
-### SbUserGetProperty ###
-
-Retrieves the value of `property_id` for `user` and places it in `out_value`.
-The function returns:
-
-*   `true` if the property value is retrieved successfully
-
-*   `false` if `user` is invalid; if `property_id` isn't recognized, supported,
-    or set for `user`; or if `value_size` is too small.
-
-`user`: The user for which property size data is being retrieved. `property_id`:
-The property for which the data is requested. `out_value`: The retrieved
-property value. `value_size`: The size of the retrieved property value.
-
-#### Declaration ####
-
-```
-bool SbUserGetProperty(SbUser user, SbUserPropertyId property_id, char *out_value, int value_size)
-```
-
-### SbUserGetPropertySize ###
-
-Returns the size of the value of `property_id` for `user`, INCLUDING the
-terminating null character. The function returns `0` if `user` is invalid or if
-`property_id` is not recognized, supported, or set for the user.
-
-`user`: The user for which property size data is being retrieved. `property_id`:
-The property for which the data is requested.
-
-#### Declaration ####
-
-```
-int SbUserGetPropertySize(SbUser user, SbUserPropertyId property_id)
-```
-
-### SbUserGetSignedIn ###
-
-Gets a list of up to `users_size` signed-in users and places the results in
-`out_users`. The return value identifies the actual number of signed-in users,
-which may be greater or less than `users_size`.
-
-It is expected that there will be a unique `SbUser` per signed-in user and that
-the referenced objects will persist for the lifetime of the app.
-
-`out_users`: Handles for the retrieved users. `users_size`: The maximum number
-of signed-in users to retrieve.
-
-#### Declaration ####
-
-```
-int SbUserGetSignedIn(SbUser *out_users, int users_size)
-```
-
-### SbUserIsValid ###
-
-Returns whether the given user handle is valid.
-
-#### Declaration ####
-
-```
-static bool SbUserIsValid(SbUser user)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/6/window.md b/src/cobalt/site/docs/reference/starboard/modules/6/window.md
deleted file mode 100644
index 9c84139..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/6/window.md
+++ /dev/null
@@ -1,295 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: window.h"
----
-
-Provides functionality to handle Window creation and management.
-
-## Macros ##
-
-### kSbEventOnScreenKeyboardInvalidTicket ###
-
-System-triggered OnScreenKeyboard events have ticket value
-kSbEventOnScreenKeyboardInvalidTicket.
-
-### kSbWindowInvalid ###
-
-Well-defined value for an invalid window handle.
-
-## Typedefs ##
-
-### SbWindow ###
-
-A handle to a window.
-
-#### Definition ####
-
-```
-typedef SbWindowPrivate* SbWindow
-```
-
-## Structs ##
-
-### SbWindowOptions ###
-
-Options that can be requested at window creation time.
-
-#### Members ####
-
-*   `SbWindowSize size`
-
-    The requested size of the new window. The value of `video_pixel_ratio` will
-    not be used or looked at.
-*   `bool windowed`
-
-    Whether the new window should be windowed or not. If not, the requested size
-    is really the requested resolution.
-*   `const char * name`
-
-    The name of the window to create.
-
-### SbWindowRect ###
-
-Defines a rectangle via a point `(x, y)` and a size `(width, height)`. This
-structure is used as output for SbWindowGetOnScreenKeyboardBoundingRect.
-
-#### Members ####
-
-*   `float x`
-*   `float y`
-*   `float width`
-*   `float height`
-
-### SbWindowSize ###
-
-The size of a window in graphics rendering coordinates. The width and height of
-a window should correspond to the size of the graphics surface used for drawing
-that would be created to back that window.
-
-#### Members ####
-
-*   `int width`
-
-    The width of the window in graphics pixels.
-*   `int height`
-
-    The height of the window in graphics pixels.
-*   `float video_pixel_ratio`
-
-    The ratio of video pixels to graphics pixels. This ratio must be applied
-    equally to width and height, meaning the aspect ratio is maintained.
-
-    A value of 1.0f means the video resolution is the same as the graphics
-    resolution. This is the most common case.
-
-    Values greater than 1.0f mean that the video resolution is higher (denser,
-    larger) than the graphics resolution. This is a common case as devices often
-    have more video decoding capabilities than graphics rendering capabilities
-    (or memory, etc...).
-
-    Values less than 1.0f mean that the maximum video resolution is smaller than
-    the graphics resolution.
-
-    A value of 0.0f means the ratio could not be determined, it should be
-    assumed to be the same as the graphics resolution (i.e. 1.0f).
-
-## Functions ##
-
-### SbWindowBlurOnScreenKeyboard ###
-
-Blur the on screen keyboard. Fire kSbEventTypeOnScreenKeyboardBlurred.
-kSbEventTypeOnScreenKeyboardBlurred has data `ticket`. Calling
-SbWindowBlurOnScreenKeyboard() when the keyboard is already blurred is
-permitted. Calling SbWindowBlurOnScreenKeyboard while the on screen keyboard is
-not showing does nothing and does not fire any event.
-
-#### Declaration ####
-
-```
-void SbWindowBlurOnScreenKeyboard(SbWindow window, int ticket)
-```
-
-### SbWindowCreate ###
-
-Creates and returns a new system window with the given `options`, which may be
-`NULL`. The function returns `kSbWindowInvalid` if it cannot create the
-requested `SbWindow` due to policy, unsatisfiable options, or any other reason.
-
-If `options` are not specified, this function uses all defaults, which must work
-on every platform. In general, it defaults to creating a fullscreen window at
-the highest 16:9 resolution possible. If the platform does not support
-fullscreen windows, then it creates a normal, windowed window.
-
-Some devices are fullscreen-only, including many production targets for
-Starboard. In those cases, only one SbWindow may be created, and it must be
-fullscreen. Additionally, in those cases, the requested size will actually be
-the requested resolution.
-
-An SbWindow must be created to receive window-based events, like input events,
-even on fullscreen-only devices. These events are dispatched to the Starboard
-entry point.
-
-`options`: Options that specify parameters for the window being created.
-
-#### Declaration ####
-
-```
-SbWindow SbWindowCreate(const SbWindowOptions *options)
-```
-
-### SbWindowDestroy ###
-
-Destroys `window`, reclaiming associated resources.
-
-`window`: The `SbWindow` to destroy.
-
-#### Declaration ####
-
-```
-bool SbWindowDestroy(SbWindow window)
-```
-
-### SbWindowFocusOnScreenKeyboard ###
-
-Focus the on screen keyboard. Fire kSbEventTypeOnScreenKeyboardFocused.
-kSbEventTypeOnScreenKeyboardFocused has data `ticket`. Calling
-SbWindowFocusOnScreenKeyboard() when the keyboard is already focused is
-permitted. Calling SbWindowFocusOnScreenKeyboard while the on screen keyboard is
-not showing does nothing and does not fire any event.
-
-#### Declaration ####
-
-```
-void SbWindowFocusOnScreenKeyboard(SbWindow window, int ticket)
-```
-
-### SbWindowGetDiagonalSizeInInches ###
-
-Gets the size of the diagonal between two opposing screen corners.
-
-A return value of 0 means that starboard does not know what the screen diagonal
-is.
-
-#### Declaration ####
-
-```
-float SbWindowGetDiagonalSizeInInches(SbWindow window)
-```
-
-### SbWindowGetOnScreenKeyboardBoundingRect ###
-
-Get the rectangle of the on screen keyboard in screen pixel coordinates. Return
-`true` if successful. Return `false` if the on screen keyboard is not showing.
-If the function returns `false`, then `rect` will not have been modified.
-
-#### Declaration ####
-
-```
-bool SbWindowGetOnScreenKeyboardBoundingRect(SbWindow window, SbWindowRect *bounding_rect)
-```
-
-### SbWindowGetPlatformHandle ###
-
-Gets the platform-specific handle for `window`, which can be passed as an
-EGLNativeWindowType to initialize EGL/GLES. This return value is entirely
-platform-specific, so there are no constraints about expected ranges.
-
-`window`: The SbWindow to retrieve the platform handle for.
-
-#### Declaration ####
-
-```
-void* SbWindowGetPlatformHandle(SbWindow window)
-```
-
-### SbWindowGetSize ###
-
-Retrieves the dimensions of `window` and sets `size` accordingly. This function
-returns `true` if it completes successfully. If the function returns `false`,
-then `size` will not have been modified.
-
-`window`: The SbWindow to retrieve the size of. `size`: The retrieved size.
-
-#### Declaration ####
-
-```
-bool SbWindowGetSize(SbWindow window, SbWindowSize *size)
-```
-
-### SbWindowHideOnScreenKeyboard ###
-
-Hide the on screen keyboard. Fire kSbEventTypeWindowSizeChange and
-kSbEventTypeOnScreenKeyboardHidden if necessary.
-kSbEventTypeOnScreenKeyboardHidden has data `ticket`. Calling
-SbWindowHideOnScreenKeyboard() when the keyboard is already hidden is permitted.
-
-#### Declaration ####
-
-```
-void SbWindowHideOnScreenKeyboard(SbWindow window, int ticket)
-```
-
-### SbWindowIsOnScreenKeyboardShown ###
-
-Determine if the on screen keyboard is shown.
-
-#### Declaration ####
-
-```
-bool SbWindowIsOnScreenKeyboardShown(SbWindow window)
-```
-
-### SbWindowIsValid ###
-
-Returns whether the given window handle is valid.
-
-#### Declaration ####
-
-```
-static bool SbWindowIsValid(SbWindow window)
-```
-
-### SbWindowSetDefaultOptions ###
-
-Sets the default options for system windows.
-
-`options`: The option values to use as default values. This object must not be
-`NULL`.
-
-#### Declaration ####
-
-```
-void SbWindowSetDefaultOptions(SbWindowOptions *options)
-```
-
-### SbWindowSetOnScreenKeyboardKeepFocus ###
-
-Notify the system that `keepFocus` has been set for the OnScreenKeyboard.
-`keepFocus` true indicates that the user may not navigate focus off of the
-OnScreenKeyboard via input; focus may only be moved via events sent by the app.
-`keepFocus` false indicates that the user may navigate focus off of the
-OnScreenKeyboard via input. `keepFocus` is initialized to false in the
-OnScreenKeyboard constructor.
-
-#### Declaration ####
-
-```
-void SbWindowSetOnScreenKeyboardKeepFocus(SbWindow window, bool keep_focus)
-```
-
-### SbWindowShowOnScreenKeyboard ###
-
-Show the on screen keyboard and populate the input with text `input_text`. Fire
-kSbEventTypeWindowSizeChange and kSbEventTypeOnScreenKeyboardShown if necessary.
-kSbEventTypeOnScreenKeyboardShown has data `ticket`. The passed in `input_text`
-will never be NULL, but may be an empty string. Calling
-SbWindowShowOnScreenKeyboard() when the keyboard is already shown is permitted,
-and the input will be replaced with `input_text`. Showing the on screen keyboard
-does not give it focus.
-
-#### Declaration ####
-
-```
-void SbWindowShowOnScreenKeyboard(SbWindow window, const char *input_text, int ticket)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/atomic.md b/src/cobalt/site/docs/reference/starboard/modules/atomic.md
index 6331e79..5f79990 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/atomic.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/atomic.md
@@ -29,7 +29,7 @@
 #### Definition ####
 
 ```
-typedef SbAtomic64 SbAtomicPtr
+typedef SbAtomic32 SbAtomicPtr
 ```
 
 ## Functions ##
diff --git a/src/cobalt/site/docs/reference/starboard/modules/audio_sink.md b/src/cobalt/site/docs/reference/starboard/modules/audio_sink.md
index c3c1cf7..8cf2329 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/audio_sink.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/audio_sink.md
@@ -27,15 +27,12 @@
 ### SbAudioSinkConsumeFramesFunc ###
 
 Callback used to report frames consumed. The consumed frames will be removed
-from the source frame buffer to free space for new audio frames.When
-`frames_consumed` is updated asynchnously and the last time that it has been
-updated is known, it can be passed in `frames_consumed_at` so the audio time
-calculating can be more accurate.
+from the source frame buffer to free space for new audio frames.
 
 #### Definition ####
 
 ```
-typedef void(* SbAudioSinkConsumeFramesFunc) (int frames_consumed, SbTime frames_consumed_at, void *context)
+typedef void(* SbAudioSinkConsumeFramesFunc) (int frames_consumed, void *context)
 ```
 
 ### SbAudioSinkFrameBuffers ###
@@ -105,6 +102,25 @@
 int SbAudioSinkGetMaxChannels()
 ```
 
+### SbAudioSinkGetMinBufferSizeInFrames ###
+
+Returns the minimum frames required by audio sink to play without underflows.
+Returns -1, if `channels`, `sample_type` or `sampling_frequency_hz` is not
+supported. It's user's responsibility to ensure that there're enough frames
+written into audio sink during playing, or it may have underflows.
+
+`channels`: The number of audio channels, such as left and right channels in
+stereo audio. `audio_sample_type`: The type of each sample of the audio data –
+`int16`, `float32`, etc. `sampling_frequency_hz`: The sample frequency of the
+audio data being streamed. For example, 22,000 Hz means 22,000 sample elements
+represents one second of audio data.
+
+#### Declaration ####
+
+```
+int SbAudioSinkGetMinBufferSizeInFrames(int channels, SbMediaAudioSampleType sample_type, int sampling_frequency_hz)
+```
+
 ### SbAudioSinkGetNearestSupportedSampleFrequency ###
 
 Returns the supported sample rate closest to `sampling_frequency_hz`. On
diff --git a/src/cobalt/site/docs/reference/starboard/modules/blitter.md b/src/cobalt/site/docs/reference/starboard/modules/blitter.md
deleted file mode 100644
index 00d40a7..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/blitter.md
+++ /dev/null
@@ -1,921 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: blitter.h"
----
-
-The Blitter API provides support for issuing simple blit-style draw commands to
-either an offscreen surface or to a Starboard `SbWindow` object. Blitter is
-jargon that means "BLock Transfer," which might be abbreviated as BLT and,
-hence, the word "blit."
-
-This API is designed to allow implementations make use of GPU hardware
-acceleration, if it is available. Draw commands exist for solid-color rectangles
-and rasterization/blitting of rectangular images onto rectangular target
-patches.
-
-## Threading Concerns ##
-
-Note that in general the Blitter API is not thread safe, except for all
-`SbBlitterDevice`-related functions. All functions that are not required to
-internally ensure any thread safety guarantees are prefaced with a comment
-indicating that they are not thread safe.
-
-Functions which claim to not be thread safe can still be used from multiple
-threads, but manual synchronization must be performed in order to ensure their
-parameters are not referenced at the same time on another thread by another
-function.
-
-### Examples ###
-
-*   Multiple threads should not issue commands to the same `SbBlitterContext`
-    object unless they are manually synchronized.
-
-*   Multiple threads should not issue draw calls to the same render target, even
-    if the draw calls are made within separate contexts. In this case, be sure
-    to manually synchronize through the use of syncrhonization primitives and
-    use of the `SbBlitterFlushContext()` command.
-
-*   Multiple threads can operate on the swap chain, but they must perform manual
-    synchronization.
-
-## Enums ##
-
-### SbBlitterPixelDataFormat ###
-
-Defines the set of pixel formats that can be used with the Blitter API
-`SbBlitterPixelData` objects. Note that not all of these formats are guaranteed
-to be supported by a particular device, so before using these formats in pixel
-data creation commands, it should be checked that they are supported first (e.g.
-via `SbBlitterIsPixelFormatSupportedByPixelData()`). `SbBlitterPixelDataFormat`
-specifies specific orderings of the color channels, and when doing so, byte-
-order is used, e.g. "RGBA" implies that a value for red is stored in the byte
-with the lowest memory address. All pixel values are assumed to be in
-premultiplied alpha format.
-
-#### Values ####
-
-*   `kSbBlitterPixelDataFormatARGB8`
-
-    32-bit pixels with 8-bits per channel, the alpha component in the byte with
-    the lowest address and blue in the byte with the highest address.
-*   `kSbBlitterPixelDataFormatBGRA8`
-
-    32-bit pixels with 8-bits per channel, the blue component in the byte with
-    the lowest address and alpha in the byte with the highest address.
-*   `kSbBlitterPixelDataFormatRGBA8`
-
-    32-bit pixels with 8-bits per channel, the red component in the byte with
-    the lowest address and alpha in the byte with the highest address.
-*   `kSbBlitterPixelDataFormatA8`
-
-    8-bit pixels that contain only a single alpha channel. When rendered,
-    surfaces in this format will have `(R, G, B)` values of `(255, 255, 255)`.
-*   `kSbBlitterNumPixelDataFormats`
-
-    Constant that indicates how many unique pixel formats Starboard supports.
-*   `kSbBlitterInvalidPixelDataFormat`
-
-### SbBlitterSurfaceFormat ###
-
-Enumeration that describes the color format of surfaces. Note that
-`SbBlitterSurfaceFormat` does not differentiate between permutations of the
-color channel ordering (e.g. RGBA vs ARGB) since client code will never be able
-to access surface pixels directly. This is the main difference between
-`SbBlitterPixelDataFormat`, which does explicitly dictate an ordering.
-
-#### Values ####
-
-*   `kSbBlitterSurfaceFormatRGBA8`
-
-    32-bit RGBA color, with 8 bits per channel.
-*   `kSbBlitterSurfaceFormatA8`
-
-    8-bit alpha-only color.
-*   `kSbBlitterNumSurfaceFormats`
-
-    Constant that indicates how many unique surface formats Starboard supports.
-*   `kSbBlitterInvalidSurfaceFormat`
-
-## Typedefs ##
-
-### SbBlitterColor ###
-
-A simple 32-bit color representation that is a parameter to many Blitter
-functions.
-
-#### Definition ####
-
-```
-typedef uint32_t SbBlitterColor
-```
-
-## Structs ##
-
-### SbBlitterRect ###
-
-Defines a rectangle via a point `(x, y)` and a size `(width, height)`. This
-structure is used as a parameter type in various blit calls.
-
-#### Members ####
-
-*   `int x`
-*   `int y`
-*   `int width`
-*   `int height`
-
-### SbBlitterSurfaceInfo ###
-
-`SbBlitterSurfaceInfo` collects information about surfaces that can be queried
-from them at any time.
-
-#### Members ####
-
-*   `int width`
-*   `int height`
-*   `SbBlitterSurfaceFormat format`
-
-## Functions ##
-
-### SbBlitterAFromColor ###
-
-Extract alpha from a `SbBlitterColor` object.
-
-#### Declaration ####
-
-```
-static uint8_t SbBlitterAFromColor(SbBlitterColor color)
-```
-
-### SbBlitterBFromColor ###
-
-Extract blue from a `SbBlitterColor` object.
-
-#### Declaration ####
-
-```
-static uint8_t SbBlitterBFromColor(SbBlitterColor color)
-```
-
-### SbBlitterBlitRectToRect ###
-
-Issues a draw call on `context` that blits the area of `source_surface`
-specified by `src_rect` to `context`'s current render target at `dst_rect`. The
-source rectangle must lie within the dimensions of `source_surface`. Note that
-the `source_surface`'s alpha is modulated by `opacity` before being drawn. For
-`opacity`, a value of 0 implies complete invisibility, and a value of 255
-implies complete opacity.
-
-This function is not thread-safe.
-
-The return value indicates whether the draw call succeeded.
-
-`src_rect`: The area to be block transferred (blitted).
-
-#### Declaration ####
-
-```
-bool SbBlitterBlitRectToRect(SbBlitterContext context, SbBlitterSurface source_surface, SbBlitterRect src_rect, SbBlitterRect dst_rect)
-```
-
-### SbBlitterBlitRectToRectTiled ###
-
-This function functions identically to SbBlitterBlitRectToRect(), except it
-permits values of `src_rect` outside the dimensions of `source_surface`. In
-those regions, the pixel data from `source_surface` will be wrapped. Negative
-values for `src_rect.x` and `src_rect.y` are allowed.
-
-The output is all stretched to fit inside of `dst_rect`.
-
-This function is not thread-safe.
-
-The return value indicates whether the draw call succeeded.
-
-#### Declaration ####
-
-```
-bool SbBlitterBlitRectToRectTiled(SbBlitterContext context, SbBlitterSurface source_surface, SbBlitterRect src_rect, SbBlitterRect dst_rect)
-```
-
-### SbBlitterBlitRectsToRects ###
-
-This function achieves the same effect as calling `SbBlitterBlitRectToRect()`
-`num_rects` times with each of the `num_rects` values of `src_rects` and
-`dst_rects`. This function allows for greater efficiency than looped calls to
-`SbBlitterBlitRectToRect()`.
-
-This function is not thread-safe.
-
-The return value indicates whether the draw call succeeded.
-
-#### Declaration ####
-
-```
-bool SbBlitterBlitRectsToRects(SbBlitterContext context, SbBlitterSurface source_surface, const SbBlitterRect *src_rects, const SbBlitterRect *dst_rects, int num_rects)
-```
-
-### SbBlitterBytesPerPixelForFormat ###
-
-A convenience function to return the number of bytes per pixel for a given pixel
-format.
-
-#### Declaration ####
-
-```
-static int SbBlitterBytesPerPixelForFormat(SbBlitterPixelDataFormat format)
-```
-
-### SbBlitterColorFromRGBA ###
-
-A convenience function to create a `SbBlitterColor` object from separate 8-bit
-RGBA components.
-
-#### Declaration ####
-
-```
-static SbBlitterColor SbBlitterColorFromRGBA(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
-```
-
-### SbBlitterCreateContext ###
-
-Creates an `SbBlitterContext` object on `device`. The returned context can be
-used to set up draw state and issue draw calls.
-
-Note that there is a limit on the number of contexts that can exist
-simultaneously, which can be queried by calling `SbBlitterGetMaxContexts()`.
-(The limit is often `1`.)
-
-`SbBlitterContext` objects keep track of draw state between a series of draw
-calls. Please refer to the `SbBlitterContext()` definition for more information
-about contexts.
-
-This function is thread-safe.
-
-This function returns `kSbBlitterInvalidContext` upon failure. Note that the
-function fails if it has already been used to create the maximum number of
-contexts.
-
-`device`: The `SbBlitterDevice` for which the `SbBlitterContext` object is
-created.
-
-#### Declaration ####
-
-```
-SbBlitterContext SbBlitterCreateContext(SbBlitterDevice device)
-```
-
-### SbBlitterCreateDefaultDevice ###
-
-Creates and returns an `SbBlitterDevice` based on the Blitter API
-implementation's decision of which device should be the default. The returned
-`SbBlitterDevice` represents a connection to a device (like a GPU).
-
-On many platforms there is always one single obvious choice for a device to use,
-and that is the one that this function will return. For example, if this is
-called on a platform that has a single GPU, this call should return an object
-that represents that GPU. On a platform that has no GPU, an object representing
-a software CPU implementation may be returned.
-
-Only one default device can exist within a process at a time. This function is
-thread-safe.
-
-Returns `kSbBlitterInvalidDevice` on failure.
-
-#### Declaration ####
-
-```
-SbBlitterDevice SbBlitterCreateDefaultDevice()
-```
-
-### SbBlitterCreatePixelData ###
-
-Allocates an `SbBlitterPixelData` object through `device` with `width`, `height`
-and `pixel_format`. `pixel_format` must be supported by `device` (see
-`SbBlitterIsPixelFormatSupportedByPixelData()`).
-
-This function is thread-safe.
-
-Calling this function results in the allocation of CPU-accessible (though
-perhaps blitter-device-resident) memory to store pixel data of the requested
-size/format. An `SbBlitterPixelData` object should eventually be passed either
-into a call to `SbBlitterCreateSurfaceFromPixelData()` or into a call to
-`SbBlitterDestroyPixelData()`.
-
-Returns `kSbBlitterInvalidPixelData` upon failure.
-
-#### Declaration ####
-
-```
-SbBlitterPixelData SbBlitterCreatePixelData(SbBlitterDevice device, int width, int height, SbBlitterPixelDataFormat pixel_format)
-```
-
-### SbBlitterCreateRenderTargetSurface ###
-
-Creates a new surface with undefined pixel data on `device` with the specified
-`width`, `height` and `surface_format`. One can set the pixel data on the
-resulting surface by getting its associated SbBlitterRenderTarget object and
-then calling `SbBlitterGetRenderTargetFromSurface()`.
-
-This function is thread-safe.
-
-Returns `kSbBlitterInvalidSurface` upon failure.
-
-#### Declaration ####
-
-```
-SbBlitterSurface SbBlitterCreateRenderTargetSurface(SbBlitterDevice device, int width, int height, SbBlitterSurfaceFormat surface_format)
-```
-
-### SbBlitterCreateSurfaceFromPixelData ###
-
-Creates an `SbBlitterSurface` object on `device`. Note that `device` must match
-the device that was used to create the `SbBlitterPixelData` object provided via
-the `pixel_data` parameter.
-
-This function also destroys the input `pixel_data` object. As a result,
-`pixel_data` should not be accessed again after a call to this function.
-
-The returned object cannot be used as a render target (e.g. calling
-`SbBlitterGetRenderTargetFromSurface()` on it will return
-`kSbBlitterInvalidRenderTarget`).
-
-This function is thread-safe with respect to `device`, but `pixel_data` should
-not be modified on another thread while this function is called.
-
-Returns `kSbBlitterInvalidSurface` in the event of an error.
-
-#### Declaration ####
-
-```
-SbBlitterSurface SbBlitterCreateSurfaceFromPixelData(SbBlitterDevice device, SbBlitterPixelData pixel_data)
-```
-
-### SbBlitterCreateSwapChainFromWindow ###
-
-Creates and returns an `SbBlitterSwapChain` that can then be used to send
-graphics to the display. This function links `device` to `window`'s output, and
-drawing to the returned swap chain will result in `device` being used to render
-to `window`.
-
-This function must be called from the thread that called `SbWindowCreate()` to
-create `window`.
-
-Returns `kSbBlitterInvalidSwapChain` on failure.
-
-#### Declaration ####
-
-```
-SbBlitterSwapChain SbBlitterCreateSwapChainFromWindow(SbBlitterDevice device, SbWindow window)
-```
-
-### SbBlitterDestroyContext ###
-
-Destroys the specified `context`, freeing all its resources.
-
-This function is not thread-safe.
-
-The return value indicates whether the destruction succeeded.
-
-`context`: The object to be destroyed.
-
-#### Declaration ####
-
-```
-bool SbBlitterDestroyContext(SbBlitterContext context)
-```
-
-### SbBlitterDestroyDevice ###
-
-Destroys `device`, cleaning up all resources associated with it. This function
-is thread-safe, but it should not be called if `device` is still being accessed
-elsewhere.
-
-The return value indicates whether the destruction succeeded.
-
-`device`: The SbBlitterDevice object to be destroyed.
-
-#### Declaration ####
-
-```
-bool SbBlitterDestroyDevice(SbBlitterDevice device)
-```
-
-### SbBlitterDestroyPixelData ###
-
-Destroys `pixel_data`. Note that this function does not need to be called and
-should not be called if `SbBlitterCreateSurfaceFromPixelData()` has been called
-on `pixel_data` before.
-
-This function is thread-safe.
-
-The return value indicates whether the destruction succeeded.
-
-`pixel_data`: The object to be destroyed.
-
-#### Declaration ####
-
-```
-bool SbBlitterDestroyPixelData(SbBlitterPixelData pixel_data)
-```
-
-### SbBlitterDestroySurface ###
-
-Destroys the `surface` object, cleaning up all resources associated with it.
-
-This function is not thread safe.
-
-The return value indicates whether the destruction succeeded.
-
-`surface`: The object to be destroyed.
-
-#### Declaration ####
-
-```
-bool SbBlitterDestroySurface(SbBlitterSurface surface)
-```
-
-### SbBlitterDestroySwapChain ###
-
-Destroys `swap_chain`, cleaning up all resources associated with it. This
-function is not thread-safe and must be called on the same thread that called
-`SbBlitterCreateSwapChainFromWindow()`.
-
-The return value indicates whether the destruction succeeded.
-
-`swap_chain`: The SbBlitterSwapChain to be destroyed.
-
-#### Declaration ####
-
-```
-bool SbBlitterDestroySwapChain(SbBlitterSwapChain swap_chain)
-```
-
-### SbBlitterDownloadSurfacePixels ###
-
-Downloads `surface` pixel data into CPU memory pointed to by `out_pixel_data`,
-formatted according to the requested `pixel_format` and the requested
-`pitch_in_bytes`. Before calling this function, you can call
-`SbBlitterIsPixelFormatSupportedByDownloadSurfacePixels()` to confirm that
-`pixel_format` is, in fact, valid for `surface`.
-
-When this function is called, it first waits for all previously flushed graphics
-commands to be executed by the device before downloading the data. Since this
-function waits for the pipeline to empty, it should be used sparingly, such as
-within in debug or test environments.
-
-The return value indicates whether the pixel data was downloaded successfully.
-
-The returned alpha format is premultiplied.
-
-This function is not thread-safe.
-
-`out_pixel_data`: A pointer to a region of memory with a size of surface_height
-* `pitch_in_bytes` bytes.
-
-#### Declaration ####
-
-```
-bool SbBlitterDownloadSurfacePixels(SbBlitterSurface surface, SbBlitterPixelDataFormat pixel_format, int pitch_in_bytes, void *out_pixel_data)
-```
-
-### SbBlitterFillRect ###
-
-Issues a draw call on `context` that fills the specified rectangle `rect`. The
-rectangle's color is determined by the last call to `SbBlitterSetColor()`.
-
-This function is not thread-safe.
-
-The return value indicates whether the draw call succeeded.
-
-`context`: The context on which the draw call will operate. `rect`: The
-rectangle to be filled.
-
-#### Declaration ####
-
-```
-bool SbBlitterFillRect(SbBlitterContext context, SbBlitterRect rect)
-```
-
-### SbBlitterFlipSwapChain ###
-
-Flips the `swap_chain` by making the buffer previously accessible to draw
-commands via `SbBlitterGetRenderTargetFromSwapChain()` visible on the display,
-while another buffer in an initially undefined state is set up as the new draw
-command target. Note that you do not need to call
-`SbBlitterGetRenderTargetFromSwapChain()` again after flipping, the swap chain's
-render target always refers to its current back buffer.
-
-This function stalls the calling thread until the next vertical refresh. In
-addition, to ensure consistency with the Starboard Player API when rendering
-punch-out video, calls to `SbPlayerSetBounds()` do not take effect until this
-method is called.
-
-The return value indicates whether the flip succeeded.
-
-This function is not thread-safe.
-
-`swap_chain`: The SbBlitterSwapChain to be flipped.
-
-#### Declaration ####
-
-```
-bool SbBlitterFlipSwapChain(SbBlitterSwapChain swap_chain)
-```
-
-### SbBlitterFlushContext ###
-
-Flushes all draw calls previously issued to `context`. Calling this function
-guarantees that the device processes all draw calls issued to this point on this
-`context` before processing any subsequent draw calls on any context.
-
-Before calling `SbBlitterFlipSwapChain()`, it is often prudent to call this
-function to ensure that all draw calls are submitted before the flip occurs.
-
-This function is not thread-safe.
-
-The return value indicates whether the flush succeeded.
-
-`context`: The context for which draw calls are being flushed.
-
-#### Declaration ####
-
-```
-bool SbBlitterFlushContext(SbBlitterContext context)
-```
-
-### SbBlitterGFromColor ###
-
-Extract green from a `SbBlitterColor` object.
-
-#### Declaration ####
-
-```
-static uint8_t SbBlitterGFromColor(SbBlitterColor color)
-```
-
-### SbBlitterGetMaxContexts ###
-
-Returns the maximum number of contexts that `device` can support in parallel.
-Note that devices often support only a single context.
-
-This function is thread-safe.
-
-This function returns `-1` upon failure.
-
-`device`: The SbBlitterDevice for which the maximum number of contexts is
-returned.
-
-#### Declaration ####
-
-```
-int SbBlitterGetMaxContexts(SbBlitterDevice device)
-```
-
-### SbBlitterGetPixelDataPitchInBytes ###
-
-Retrieves the pitch (in bytes) for `pixel_data`. This indicates the number of
-bytes per row of pixel data in the image.
-
-This function is not thread-safe.
-
-Returns `-1` in the event of an error.
-
-`pixel_data`: The object for which you are retrieving the pitch.
-
-#### Declaration ####
-
-```
-int SbBlitterGetPixelDataPitchInBytes(SbBlitterPixelData pixel_data)
-```
-
-### SbBlitterGetPixelDataPointer ###
-
-Retrieves a CPU-accessible pointer to the pixel data represented by
-`pixel_data`. This pixel data can be modified by the CPU to initialize it on the
-CPU before calling `SbBlitterCreateSurfaceFromPixelData()`.
-
-Note that the pointer returned here is valid as long as `pixel_data` is valid,
-which means it is valid until either `SbBlitterCreateSurfaceFromPixelData()` or
-`SbBlitterDestroyPixelData()` is called.
-
-This function is not thread-safe.
-
-Returns `NULL` in the event of an error.
-
-#### Declaration ####
-
-```
-void* SbBlitterGetPixelDataPointer(SbBlitterPixelData pixel_data)
-```
-
-### SbBlitterGetRenderTargetFromSurface ###
-
-Returns the `SbBlitterRenderTarget` object owned by `surface`. The returned
-object can be used as a target for draw calls.
-
-This function returns `kSbBlitterInvalidRenderTarget` if `surface` is not able
-to provide a render target or on any other error.
-
-This function is not thread-safe.
-
-#### Declaration ####
-
-```
-SbBlitterRenderTarget SbBlitterGetRenderTargetFromSurface(SbBlitterSurface surface)
-```
-
-### SbBlitterGetRenderTargetFromSwapChain ###
-
-Returns the `SbBlitterRenderTarget` object that is owned by `swap_chain`. The
-returned object can be used to provide a target to blitter draw calls that draw
-directly to the display buffer. This function is not thread-safe.
-
-Returns `kSbBlitterInvalidRenderTarget` on failure.
-
-`swap_chain`: The SbBlitterSwapChain for which the target object is being
-retrieved.
-
-#### Declaration ####
-
-```
-SbBlitterRenderTarget SbBlitterGetRenderTargetFromSwapChain(SbBlitterSwapChain swap_chain)
-```
-
-### SbBlitterGetSurfaceInfo ###
-
-Retrieves an `SbBlitterSurfaceInfo` structure, which describes immutable
-parameters of the `surface`, such as its width, height and pixel format. The
-results are set on the output parameter `surface_info`, which cannot be `NULL`.
-
-The return value indicates whether the information was retrieved successfully.
-
-This function is not thread-safe.
-
-#### Declaration ####
-
-```
-bool SbBlitterGetSurfaceInfo(SbBlitterSurface surface, SbBlitterSurfaceInfo *surface_info)
-```
-
-### SbBlitterIsContextValid ###
-
-Checks whether a blitter context is invalid.
-
-#### Declaration ####
-
-```
-static bool SbBlitterIsContextValid(SbBlitterContext context)
-```
-
-### SbBlitterIsDeviceValid ###
-
-Checks whether a blitter device is invalid.
-
-#### Declaration ####
-
-```
-static bool SbBlitterIsDeviceValid(SbBlitterDevice device)
-```
-
-### SbBlitterIsPixelDataValid ###
-
-Checks whether a pixel data object is invalid.
-
-#### Declaration ####
-
-```
-static bool SbBlitterIsPixelDataValid(SbBlitterPixelData pixel_data)
-```
-
-### SbBlitterIsPixelFormatSupportedByDownloadSurfacePixels ###
-
-Indicates whether the combination of parameter values is valid for calls to
-`SbBlitterDownloadSurfacePixels()`.
-
-This function is not thread-safe.
-
-`surface`: The surface being checked. `pixel_format`: The pixel format that
-would be used on the surface.
-
-#### Declaration ####
-
-```
-bool SbBlitterIsPixelFormatSupportedByDownloadSurfacePixels(SbBlitterSurface surface, SbBlitterPixelDataFormat pixel_format)
-```
-
-### SbBlitterIsPixelFormatSupportedByPixelData ###
-
-Indicates whether `device` supports calls to `SbBlitterCreatePixelData` with the
-specified `pixel_format`. This function is thread-safe.
-
-`device`: The device for which compatibility is being checked. `pixel_format`:
-The SbBlitterPixelDataFormat for which compatibility is being checked.
-
-#### Declaration ####
-
-```
-bool SbBlitterIsPixelFormatSupportedByPixelData(SbBlitterDevice device, SbBlitterPixelDataFormat pixel_format)
-```
-
-### SbBlitterIsRenderTargetValid ###
-
-Checks whether a render target is invalid.
-
-#### Declaration ####
-
-```
-static bool SbBlitterIsRenderTargetValid(SbBlitterRenderTarget render_target)
-```
-
-### SbBlitterIsSurfaceFormatSupportedByRenderTargetSurface ###
-
-Indicates whether the `device` supports calls to
-`SbBlitterCreateRenderTargetSurface()` with `surface_format`.
-
-This function is thread-safe.
-
-`device`: The device being checked for compatibility. `surface_format`: The
-surface format being checked for compatibility.
-
-#### Declaration ####
-
-```
-bool SbBlitterIsSurfaceFormatSupportedByRenderTargetSurface(SbBlitterDevice device, SbBlitterSurfaceFormat surface_format)
-```
-
-### SbBlitterIsSurfaceValid ###
-
-Checks whether a surface is invalid.
-
-#### Declaration ####
-
-```
-static bool SbBlitterIsSurfaceValid(SbBlitterSurface surface)
-```
-
-### SbBlitterIsSwapChainValid ###
-
-Checks whether a swap chain is invalid.
-
-#### Declaration ####
-
-```
-static bool SbBlitterIsSwapChainValid(SbBlitterSwapChain swap_chain)
-```
-
-### SbBlitterMakeRect ###
-
-Convenience function to setup a rectangle with the specified parameters.
-
-#### Declaration ####
-
-```
-static SbBlitterRect SbBlitterMakeRect(int x, int y, int width, int height)
-```
-
-### SbBlitterPixelDataFormatToSurfaceFormat ###
-
-This function maps SbBlitterPixelDataFormat values to their corresponding
-`SbBlitterSurfaceFormat` value. Note that many `SbBlitterPixelDataFormat`s
-correspond to the same `SbBlitterSurfaceFormat`, so this function is not
-invertible. When creating a `SbBlitterSurface` object from a
-`SbBlitterPixelData` object, the `SbBlitterSurface`'s format will be computed
-from the `SbBlitterPixelData` object by using this function.
-
-#### Declaration ####
-
-```
-static SbBlitterSurfaceFormat SbBlitterPixelDataFormatToSurfaceFormat(SbBlitterPixelDataFormat pixel_format)
-```
-
-### SbBlitterRFromColor ###
-
-Extract red from a `SbBlitterColor` object.
-
-#### Declaration ####
-
-```
-static uint8_t SbBlitterRFromColor(SbBlitterColor color)
-```
-
-### SbBlitterSetBlending ###
-
-Sets the blending state for the specified `context`. By default, blending is
-disabled on a `SbBlitterContext`.
-
-This function is not thread-safe.
-
-The return value indicates whether the blending state was set successfully.
-
-`context`: The context for which the blending state is being set.
-
-`blending`: The blending state for the `context`. If `blending` is `true`, the
-source alpha of subsequent draw calls is used to blend with the destination
-color. In particular,
-
-```
-Fc = Sc * Sa + Dc * (1 - Sa)
-
-```
-
-where:
-
-*   `Fc` is the final color.
-
-*   `Sc` is the source color.
-
-*   `Sa` is the source alpha.
-
-*   `Dc` is the destination color.
-
-If `blending` is `false`, the source color and source alpha overwrite the
-destination color and alpha.
-
-#### Declaration ####
-
-```
-bool SbBlitterSetBlending(SbBlitterContext context, bool blending)
-```
-
-### SbBlitterSetColor ###
-
-Sets the context's current color. The current color's default value is
-`SbBlitterColorFromRGBA(255, 255, 255 255)`.
-
-The current color affects the fill rectangle's color in calls to
-`SbBlitterFillRect()`. If `SbBlitterSetModulateBlitsWithColor()` has been called
-to enable blit color modulation, the source blit surface pixel color is also
-modulated by the color before being output.
-
-This function is not thread-safe.
-
-The return value indicates whether the color was set successfully.
-
-`context`: The context for which the color is being set. `color`: The context's
-new color, specified in unpremultiplied alpha format.
-
-#### Declaration ####
-
-```
-bool SbBlitterSetColor(SbBlitterContext context, SbBlitterColor color)
-```
-
-### SbBlitterSetModulateBlitsWithColor ###
-
-Sets whether or not blit calls should have their source pixels modulated by the
-current color, which is set using `SbBlitterSetColor()`, before being output.
-This function can apply opacity to blit calls, color alpha-only surfaces, and
-apply other effects.
-
-This function is not thread-safe.
-
-The return value indicates whether the state was set successfully.
-
-`modulate_blits_with_color`: Indicates whether to modulate source pixels in blit
-calls.
-
-#### Declaration ####
-
-```
-bool SbBlitterSetModulateBlitsWithColor(SbBlitterContext context, bool modulate_blits_with_color)
-```
-
-### SbBlitterSetRenderTarget ###
-
-Sets up `render_target` as the render target that all subsequent draw calls made
-on `context` will use.
-
-This function is not thread-safe.
-
-The return value indicates whether the render target was set successfully.
-
-`context`: The object for which the render target is being set. `render_target`:
-The target that the `context` should use for draw calls.
-
-#### Declaration ####
-
-```
-bool SbBlitterSetRenderTarget(SbBlitterContext context, SbBlitterRenderTarget render_target)
-```
-
-### SbBlitterSetScissor ###
-
-Sets the scissor rectangle, which dictates a visibility area that affects all
-draw calls. Only pixels within the scissor rectangle are rendered, and all
-drawing outside of that area is clipped.
-
-When `SbBlitterSetRenderTarget()` is called, that function automatically sets
-the scissor rectangle to the size of the specified render target. If a scissor
-rectangle is specified outside of the extents of the current render target
-bounds, it will be intersected with the render target bounds.
-
-This function is not thread-safe.
-
-Returns whether the scissor was successfully set. It returns an error if it is
-called before a render target has been specified for the context.
-
-#### Declaration ####
-
-```
-bool SbBlitterSetScissor(SbBlitterContext context, SbBlitterRect rect)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/condition_variable.md b/src/cobalt/site/docs/reference/starboard/modules/condition_variable.md
index 9fdcdb1..836c4b8 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/condition_variable.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/condition_variable.md
@@ -5,6 +5,12 @@
 
 Defines an interface for condition variables.
 
+## Macros ##
+
+### SB_CONDITION_VARIABLE_MAX_SIZE ###
+
+Max size of the SbConditionVariable type.
+
 ## Enums ##
 
 ### SbConditionVariableResult ###
@@ -24,6 +30,19 @@
     The wait failed, either because a parameter wasn't valid, or the condition
     variable has already been destroyed, or something similar.
 
+## Typedefs ##
+
+### SbConditionVariable ###
+
+An opaque handle to a condition variable type with reserved memory buffer of
+size SB_CONDITION_VARIABLE_MAX_SIZE and aligned at void pointer type.
+
+#### Definition ####
+
+```
+typedef union SbConditionVariable  SbConditionVariable
+```
+
 ## Functions ##
 
 ### SbConditionVariableBroadcast ###
@@ -55,7 +74,7 @@
 
 ### SbConditionVariableDestroy ###
 
-Destroys the specified SbConditionVariable. The return value indicates whether
+Destroys the specified SbConditionVariable . The return value indicates whether
 the destruction was successful. The behavior is undefined if other threads are
 currently waiting on this condition variable.
 
diff --git a/src/cobalt/site/docs/reference/starboard/modules/configuration.md b/src/cobalt/site/docs/reference/starboard/modules/configuration.md
index 42746df..14ccc3e 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/configuration.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/configuration.md
@@ -38,11 +38,6 @@
 
 Determines a compile-time capability of the system.
 
-### SB_CAN_MEDIA_USE_STARBOARD_PIPELINE ###
-
-Specifies whether the starboard media pipeline components (SbPlayerPipeline and
-StarboardDecryptor) are used. Set to 0 means they are not used.
-
 ### SB_COMPILE_ASSERT(expr, msg) ###
 
 Will cause a compiler error with `msg` if `expr` is false. `msg` must be a valid
@@ -83,20 +78,20 @@
 
 Whether the current platform has 64-bit atomic operations.
 
-### SB_HAS_AC3_AUDIO_API_VERSION ###
+### SB_HAS_AUDIO_SPECIFIC_CONFIG_AS_POINTER ###
 
-Add support for audio in ac3.
+Deprecated feature macros These feature macros are deprecated in Starboard
+version 6 and later, and are no longer referenced by application code. They will
+be removed in a future version. Any Starboard implementation that supports
+Starboard version 6 or later should be modified to no longer depend on these
+macros, with the assumption that their values are always 1.
 
-### SB_HAS_AV1_VERSION ###
+### SB_HAS_GLES2 ###
 
-Replace kSbMediaVideoCodecVp10 by kSbMediaVideoCodecAv1. kSbMediaVideoCodecVp10
-in media.h is replaced by kSbMediaVideoCodecAv1.
-
-### SB_HAS_DRM_KEY_STATUSES ###
-
-Legal values for SB_PREFERRED_RGBA_BYTE_ORDER are defined in this file above as
-SB_PREFERRED_RGBA_BYTE_ORDER_*. If your platform uses GLES, you should set this
-to SB_PREFERRED_RGBA_BYTE_ORDER_RGBA.
+Specifies whether this platform has a performant OpenGL ES 2 implementation,
+which allows client applications to use GL rendering paths. Derived from the gyp
+variable `gl_type` gl_type which indicates what kind of GL implementation is
+available.
 
 ### SB_HAS_GRAPHICS ###
 
@@ -106,30 +101,6 @@
 
 Determines at compile-time whether this platform has a quirk.
 
-### SB_HAS_SCREEN_DIAGONAL_API_VERSION ###
-
-Adds support for allowing the platform to override its screen diagonal length
-via SbWindowGetDiagonalSizeInInches().
-
-### SB_HAS_STARTUP_URL_SIGNING_VERSION ###
-
-Add support for startup url signing by adding
-kSbSystemPropertyCertificationScope and
-kSbSystemPropertyBase64EncodedCertificationSecret system property enums to
-system.h.
-
-### SB_HAS_STD_UNORDERED_HASH_API_VERSION ###
-
-Add support for using C++11 standard unordered maps and sets. By setting
-SB_HAS_STD_UNORDERED_HASH to 1, a platform can be configured to use C++11
-standard hash table implementations, specifically, using: . std::unordered_map<>
-for base::hash_map<>, and . std::unordered_multimap<> for base::hash_multimap<>,
-and . std::unordered_set<> for base::hash_set<>, and . std::unordered_multiset<>
-for base::hash_multiset<>. When SB_HAS_STD_UNORDERED_HASH is used, it is no
-longer necessary to specify SB_HAS_LONG_LONG_HASH, SB_HAS_STRING_HASH,
-SB_HAS_HASH_USING, SB_HAS_HASH_VALUE, SB_HAS_HASH_WARNING, SB_HASH_MAP_INCLUDE,
-SB_HASH_NAMESPACE, or SB_HASH_SET_INCLUDE.
-
 ### SB_INT64_C(x) ###
 
 Declare numeric literals of signed 64-bit type.
@@ -138,10 +109,6 @@
 
 Determines at compile-time an inherent aspect of this platform.
 
-### SB_IS_LITTLE_ENDIAN ###
-
-Whether the current platform is little endian.
-
 ### SB_LIKELY(x) ###
 
 Macro for hinting that an expression is likely to be true.
@@ -151,13 +118,6 @@
 The maximum API version allowed by this version of the Starboard headers,
 inclusive.
 
-### SB_MEDIA_EOTF_CHECK_SUPPORT_VERSION ###
-
-Add SbMediaTransferId* argument `eotf` to SbMediaIsVideoSupported, so the
-platform may indicate support of resolution, bitrate, fps, and codec conditioned
-on eotf. Also, remove the function SbMediaIsTransferCharacteristicsSupported
-which is no longer necessary.
-
 ### SB_MINIMUM_API_VERSION ###
 
 The minimum API version allowed by this version of the Starboard headers,
@@ -175,10 +135,10 @@
 
 ### SB_PREFERRED_RGBA_BYTE_ORDER_RGBA ###
 
-An enumeration of values for the SB_PREFERRED_RGBA_BYTE_ORDER configuration
-variable. Setting this up properly means avoiding slow color swizzles when
-passing pixel data from one library to another. Note that these definitions are
-in byte-order and so are endianness-independent.
+An enumeration of values for the kSbPreferredByteOrder configuration variable.
+Setting this up properly means avoiding slow color swizzles when passing pixel
+data from one library to another. Note that these definitions are in byte-order
+and so are endianness-independent.
 
 ### SB_PRINTF_FORMAT(format_param, dots_param) ###
 
@@ -200,10 +160,15 @@
 
 Include the platform-specific configuration. This macro is set by GYP in
 starboard_base_target.gypi and passed in on the command line for all targets and
-all configurations.Makes a pointer-typed parameter restricted so that the
+all configurations. Makes a pointer-typed parameter restricted so that the
 compiler can make certain optimizations because it knows the pointers are
 unique.
 
+### SB_SIZE_OF(DATATYPE) ###
+
+Determines at compile-time the size of a data type, or 0 if the data type that
+was specified was invalid.
+
 ### SB_STRINGIFY(x) ###
 
 Standard CPP trick to stringify an evaluated macro definition.
@@ -216,6 +181,11 @@
 
 Macro for hinting that an expression is likely to be false.
 
+### SB_UNREFERENCED_PARAMETER(x) ###
+
+Trivially references a parameter that is otherwise unreferenced, preventing a
+compiler warning on some platforms.
+
 ### SB_WARN_UNUSED_RESULT ###
 
 Causes the annotated (at the end) function to generate a warning if the result
diff --git a/src/cobalt/site/docs/reference/starboard/modules/configuration_constants.md b/src/cobalt/site/docs/reference/starboard/modules/configuration_constants.md
new file mode 100644
index 0000000..5c59a7c
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/configuration_constants.md
@@ -0,0 +1,161 @@
+---
+layout: doc
+title: "Starboard Module Reference: configuration_constants.h"
+---
+
+Declares all configuration variables we will need to use at runtime. These
+variables describe the current platform in detail to allow cobalt to make
+runtime decisions based on per platform configurations.
+
+## Variables ##
+
+### kSbDefaultMmapThreshold ###
+
+Determines the threshhold of allocation size that should be done with mmap (if
+available), rather than allocated within the core heap.
+
+### kSbFileAltSepChar ###
+
+The current platform's alternate file path component separator character. This
+is like SB_FILE_SEP_CHAR, except if your platform supports an alternate
+character, then you can place that here. For example, on windows machines, the
+primary separator character is probably '\', but the alternate is '/'.
+
+### kSbFileAltSepString ###
+
+The string form of SB_FILE_ALT_SEP_CHAR.
+
+### kSbFileMaxName ###
+
+The current platform's maximum length of the name of a single directory entry,
+not including the absolute path.
+
+### kSbFileMaxOpen ###
+
+The current platform's maximum number of files that can be opened at the same
+time by one process.
+
+### kSbFileMaxPath ###
+
+The current platform's maximum length of an absolute path.
+
+### kSbFileSepChar ###
+
+The current platform's file path component separator character. This is the
+character that appears after a directory in a file path. For example, the
+absolute canonical path of the file "/path/to/a/file.txt" uses '/' as a path
+component separator character.
+
+### kSbFileSepString ###
+
+The string form of SB_FILE_SEP_CHAR.
+
+### kSbHasAc3Audio ###
+
+Allow ac3 and ec3 support
+
+### kSbHasMediaWebmVp9Support ###
+
+Specifies whether this platform has webm/vp9 support. This should be set to non-
+zero on platforms with webm/vp9 support.
+
+### kSbHasThreadPrioritySupport ###
+
+Whether the current platform supports thread priorities.
+
+### kSbMallocAlignment ###
+
+Determines the alignment that allocations should have on this platform.
+
+### kSbMaxThreadLocalKeys ###
+
+The maximum number of thread local storage keys supported by this platform. This
+comes from _POSIX_THREAD_KEYS_MAX. The value of PTHREAD_KEYS_MAX is higher, but
+unit tests show that the implementation doesn't support nearly as many keys.
+
+### kSbMaxThreadNameLength ###
+
+The maximum length of the name for a thread, including the NULL-terminator.
+
+### kSbMaxThreads ###
+
+Defines the maximum number of simultaneous threads for this platform. Some
+platforms require sharing thread handles with other kinds of system handles,
+like mutexes, so we want to keep this manageable.
+
+### kSbMediaMaxAudioBitrateInBitsPerSecond ###
+
+The maximum audio bitrate the platform can decode. The following value equals to
+5M bytes per seconds which is more than enough for compressed audio.
+
+### kSbMediaMaxVideoBitrateInBitsPerSecond ###
+
+The maximum video bitrate the platform can decode. The following value equals to
+8M bytes per seconds which is more than enough for compressed video.
+
+### kSbMediaMaximumVideoFrames ###
+
+Specify the number of video frames to be cached during playback. A large value
+leads to more stable fps but also causes the app to use more memory.
+
+### kSbMediaMaximumVideoPrerollFrames ###
+
+The encoded video frames are compressed in different ways, so their decoding
+time can vary a lot. Occasionally a single frame can take longer time to decode
+than the average time per frame. The player has to cache some frames to account
+for such inconsistency. The number of frames being cached are controlled by
+SB_MEDIA_MAXIMUM_VIDEO_PREROLL_FRAMES and SB_MEDIA_MAXIMUM_VIDEO_FRAMES.
+
+Specify the number of video frames to be cached before the playback starts. Note
+that setting this value too large may increase the playback start delay.
+
+### kSbMediaVideoFrameAlignment ###
+
+Specifies how video frame buffers must be aligned on this platform.
+
+### kSbMemoryLogPath ###
+
+Defines the path where memory debugging logs should be written to.
+
+### kSbMemoryPageSize ###
+
+The memory page size, which controls the size of chunks on memory that
+allocators deal with, and the alignment of those chunks. This doesn't have to be
+the hardware-defined physical page size, but it should be a multiple of it.
+
+### kSbNetworkReceiveBufferSize ###
+
+Specifies the network receive buffer size in bytes, set via
+SbSocketSetReceiveBufferSize().
+
+Setting this to 0 indicates that SbSocketSetReceiveBufferSize() should not be
+called. Use this for OSs (such as Linux) where receive buffer auto-tuning is
+better.
+
+On some platforms, this may affect max TCP window size which may dramatically
+affect throughput in the presence of latency.
+
+If your platform does not have a good TCP auto-tuning mechanism, a setting of
+(128 * 1024) here is recommended.
+
+### kSbPathSepChar ###
+
+The current platform's search path component separator character. When
+specifying an ordered list of absolute paths of directories to search for a
+given reason, this is the character that appears between entries. For example,
+the search path of "/etc/search/first:/etc/search/second" uses ':' as a search
+path component separator character.
+
+### kSbPathSepString ###
+
+The string form of SB_PATH_SEP_CHAR.
+
+### kSbPreferredRgbaByteOrder ###
+
+Specifies the preferred byte order of color channels in a pixel. Refer to
+starboard/configuration.h for the possible values. EGL/GLES platforms should
+generally prefer a byte order of RGBA, regardless of endianness.
+
+### kSbUserMaxSignedIn ###
+
+The maximum number of users that can be signed in at the same time.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/cpu_features.md b/src/cobalt/site/docs/reference/starboard/modules/cpu_features.md
new file mode 100644
index 0000000..9cdb94c
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/cpu_features.md
@@ -0,0 +1,259 @@
+---
+layout: doc
+title: "Starboard Module Reference: cpu_features.h"
+---
+
+## Structs ##
+
+### SbCPUFeatures ###
+
+#### Members ####
+
+*   `SbCPUFeaturesArchitecture architecture`
+
+    Architecture of the processor.
+*   `const char * brand`
+
+    Processor brand string retrievable by CPUID or from /proc/cpuinfo under the
+    key "model name" or "Processor".
+*   `int32_t icache_line_size`
+
+    Processor cache line size in bytes of Level 1 instruction cache and data
+    cache. Queried by sysconf(_SC_LEVEL1_ICACHE_LINESIZE) and
+    sysconf(_SC_LEVEL1_DCACHE_LINESIZE), or from files /proc/cpuinfo,
+    /proc/self/auxv, or CPUID with CLFLUSH instruction.
+*   `int32_t dcache_line_size`
+*   `bool has_fpu`
+
+    Processor has floating-point unit on-chip.
+*   `uint32_t hwcap`
+
+    Bit-mask containing processor features flags. Queried by getauxval(AT_HWCAP)
+    if it is supported.
+*   `uint32_t hwcap2`
+
+    Similar to hwcap. Queried by getauxval(AT_HWCAP2) if it is supported.
+*   `SbCPUFeaturesARM arm`
+
+    Processor features specific to each architecture. Set the appropriate
+    `SbCPUFeatures<ARCH_NAME>` for the underlying architecture. Set the other
+    `SbCPUFeatures<OTHER_ARCH>` to be invalid, meaning:
+
+    *   '-1' for signed integer fields
+
+    *   'false' for feature flag fields
+
+    *   '0' for feature flag bitmasks
+
+    *   empty string for string fields
+
+*   `SbCPUFeaturesMIPS mips_arch`
+
+    The reason that the "_arch" suffix exists for mips is because on some
+    platforms that use MIPS as the underlying architecture, "mips" is already
+    defined as a macro.
+*   `SbCPUFeaturesX86 x86`
+
+### SbCPUFeaturesARM ###
+
+#### Members ####
+
+*   `int16_t implementer`
+
+    Processor implementer/implementor code. ARM is 0x41, NVIDIA is 0x4e, etc.
+*   `int16_t variant`
+
+    Processor variant number, indicating the major revision number.
+*   `int16_t revision`
+
+    Processor revision number, indicating the minor revision number.
+*   `int16_t architecture_generation`
+
+    Processor architecture generation number, indicating the generations
+    (ARMv6-M, ARMv7, etc) within an architecture family. This field is called
+    "Architecture" or "Constant" in the processor ID register.
+*   `int16_t part`
+
+    Processor part number, indicating Cortex-M0, Cortex-A8, etc.
+*   `bool has_neon`
+
+    ARM Advanced SIMD (NEON) vector instruction set extension.
+*   `bool has_thumb2`
+
+    Thumb-2 mode.
+*   `bool has_vfp`
+
+    VFP (SIMD vector floating point instructions).
+*   `bool has_vfp3`
+
+    VFP version 3
+*   `bool has_vfp3_d32`
+
+    VFP version 3 with 32 D-registers.
+*   `bool has_idiva`
+
+    SDIV and UDIV hardware division in ARM mode.
+*   `bool has_aes`
+
+    Arm 64 feature flags
+
+    AES instructions.
+*   `bool has_crc32`
+
+    CRC32 instructions.
+*   `bool has_sha1`
+
+    SHA-1 instructions.
+*   `bool has_sha2`
+
+    SHA-256 instructions.
+*   `bool has_pmull`
+
+    64-bit PMULL and PMULL2 instructions.
+
+### SbCPUFeaturesMIPS ###
+
+#### Members ####
+
+*   `bool has_msa`
+
+    MIPS SIMD Architecture (MSA).
+
+### SbCPUFeaturesX86 ###
+
+#### Members ####
+
+*   `const char * vendor`
+
+    Processor vendor ID string, e.g. "GenuineIntel", "AuthenticAMD", etc
+*   `int16_t family`
+
+    Processor family ID
+*   `int16_t ext_family`
+
+    Processor extended family ID, needs to be examined only when the family ID
+    is 0FH.
+*   `int16_t model`
+
+    Processor model ID
+*   `int16_t ext_model`
+
+    Processor extended model ID, needs to be examined only when the family ID is
+    06H or 0FH.
+*   `int16_t stepping`
+
+    Processor stepping ID, a product revision number
+*   `int16_t type`
+
+    Processor type ID
+*   `int32_t signature`
+
+    A raw form of collection of processor stepping, model, and family
+    information
+*   `bool has_cmov`
+
+    Conditional Move Instructions (plus FCMOVcc, FCOMI with FPU).
+*   `bool has_mmx`
+
+    Multimedia extensions.
+*   `bool has_sse`
+
+    SSE (Streaming SIMD Extensions).
+*   `bool has_sse2`
+
+    SSE2 extensions.
+*   `bool has_tsc`
+
+    Time Stamp Counter.
+*   `bool has_sse3`
+
+    SSE3 extensions.
+*   `bool has_pclmulqdq`
+
+    PCLMULQDQ instruction.
+*   `bool has_ssse3`
+
+    Supplemental SSE3 extensions.
+*   `bool has_sse41`
+
+    SSE-4.1 extensions.
+*   `bool has_sse42`
+
+    SSE-4.2 extensions.
+*   `bool has_movbe`
+
+    MOVBE instruction.
+*   `bool has_popcnt`
+
+    POPCNT instruction.
+*   `bool has_osxsave`
+
+    XSAVE/XRSTOR/XGETBV/XSETBV instruction enabled in this OS.
+*   `bool has_avx`
+
+    AVX (Advanced Vector Extensions).
+*   `bool has_f16c`
+
+    16-bit FP conversions.
+*   `bool has_fma3`
+
+    Fused multiply-add.
+*   `bool has_aesni`
+
+    AES new instructions (AES-NI).
+*   `bool has_avx2`
+
+    AVX2 Extensions.
+*   `bool has_avx512f`
+
+    AVX-512 Foundation.
+*   `bool has_avx512dq`
+
+    AVX-512 DQ (Double/Quad granular) Instructions.
+*   `bool has_avx512ifma`
+
+    AVX-512 Integer Fused Multiply-Add instructions.
+*   `bool has_avx512pf`
+
+    AVX-512 Prefetch.
+*   `bool has_avx512er`
+
+    AVX-512 Exponential and Reciprocal.
+*   `bool has_avx512cd`
+
+    AVX-512 Conflict Detection.
+*   `bool has_avx512bw`
+
+    AVX-512 BW (Byte/Word granular) Instructions.
+*   `bool has_avx512vl`
+
+    AVX-512 VL (128/256 Vector Length) Extensions.
+*   `bool has_bmi1`
+
+    First group of bit manipulation extensions.
+*   `bool has_bmi2`
+
+    Second group of bit manipulation extensions.
+*   `bool has_lzcnt`
+
+    Bit manipulation instruction LZCNT.
+*   `bool has_sahf`
+
+    SAHF in long mode.
+
+## Functions ##
+
+### SbCPUFeaturesGet ###
+
+Retrieve the underlying CPU features and place it in `features`, which must not
+be NULL.
+
+If this function returns false, it means the CPU architecture is unknown and all
+fields in `features` are invalid.
+
+#### Declaration ####
+
+```
+bool SbCPUFeaturesGet(SbCPUFeatures *features)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/cryptography.md b/src/cobalt/site/docs/reference/starboard/modules/cryptography.md
deleted file mode 100644
index 1540465..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/cryptography.md
+++ /dev/null
@@ -1,223 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: cryptography.h"
----
-
-Hardware-accelerated cryptography. Platforms should **only** only implement this
-when there are **hardware-accelerated** hardware-accelerated cryptography
-facilities. Applications must fall back to platform-independent CPU-based
-algorithms if the cipher algorithm isn't supported in hardware.
-
-## Tips for Porters ##
-
-You should implement cipher algorithms in this descending order of priority to
-maximize usage for SSL.
-
-1.  GCM - The preferred block cipher mode for OpenSSL, mainly due to speed.
-
-1.  CTR - This can be used internally with GCM, as long as the CTR
-    implementation only uses the last 4 bytes of the IV for the counter. (i.e.
-    96-bit IV, 32-bit counter)
-
-1.  ECB - This can be used (with a null IV) with any of the other cipher block
-    modes to accelerate the core AES algorithm if none of the streaming modes
-    can be accelerated.
-
-1.  CBC - GCM is always preferred if the server and client both support it. If
-    not, they will generally negotiate down to AES-CBC. If this happens, and CBC
-    is supported by SbCryptography, then it will be accelerated appropriately.
-    But, most servers should support GCM, so it is not likely to come up much,
-    which is why it is the lowest priority.
-
-Further reading on block cipher modes:
-
-[https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation)
-
-[https://crbug.com/442572](https://crbug.com/442572)
-
-[https://crypto.stackexchange.com/questions/10775/practical-disadvantages-of-gcm-mode-encryption](https://crypto.stackexchange.com/questions/10775/practical-disadvantages-of-gcm-mode-encryption)
-
-## Macros ##
-
-### kSbCryptographyAlgorithmAes ###
-
-String literal for the AES symmetric block cipher. [https://en.wikipedia.org/wiki/Advanced_Encryption_Standard](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard)
-
-### kSbCryptographyInvalidTransformer ###
-
-Well-defined value for an invalid transformer.
-
-## Enums ##
-
-### SbCryptographyBlockCipherMode ###
-
-The method of chaining encrypted blocks in a sequence. [https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation)
-
-#### Values ####
-
-*   `kSbCryptographyBlockCipherModeCbc`
-
-    Cipher Block Chaining mode.
-*   `kSbCryptographyBlockCipherModeCfb`
-
-    Cipher Feedback mode.
-*   `kSbCryptographyBlockCipherModeCtr`
-
-    Counter mode: A nonce is combined with an increasing counter.
-*   `kSbCryptographyBlockCipherModeEcb`
-
-    Electronic Code Book mode: No chaining.
-*   `kSbCryptographyBlockCipherModeOfb`
-
-    Output Feedback mode.
-*   `kSbCryptographyBlockCipherModeGcm`
-
-    Galois/Counter Mode.
-
-### SbCryptographyDirection ###
-
-The direction of a cryptographic transformation.
-
-#### Values ####
-
-*   `kSbCryptographyDirectionEncode`
-
-    Cryptographic transformations that encode/encrypt data into a target format.
-*   `kSbCryptographyDirectionDecode`
-
-    Cryptographic transformations that decode/decrypt data into its original
-    form.
-
-## Typedefs ##
-
-### SbCryptographyTransformer ###
-
-A handle to a cryptographic transformer.
-
-#### Definition ####
-
-```
-typedef SbCryptographyTransformerPrivate* SbCryptographyTransformer
-```
-
-## Functions ##
-
-### SbCryptographyCreateTransformer ###
-
-Creates an SbCryptographyTransformer with the given initialization data. It can
-then be used to transform a series of data blocks. Returns
-kSbCryptographyInvalidTransformer if the algorithm isn't supported, or if the
-parameters are not compatible with the algorithm.
-
-An SbCryptographyTransformer contains all state to start decrypting a sequence
-of cipher blocks according to the cipher block mode. It is not thread-safe, but
-implementations must allow different SbCryptographyTransformer instances to
-operate on different threads.
-
-All parameters must not be assumed to live longer than the call to this
-function. They must be copied by the implementation to be retained.
-
-This function determines success mainly based on whether the combination of
-`algorithm`, `direction`, `block_size_bits`, and `mode` is supported and whether
-all the sizes passed in are sufficient for the selected parameters. In
-particular, this function cannot verify that the key and IV used were correct
-for the ciphertext, were it to be used in the decode direction. The caller must
-make that verification.
-
-For example, to decrypt AES-128-CTR:
-SbCryptographyCreateTransformer(kSbCryptographyAlgorithmAes, 128,
-kSbCryptographyDirectionDecode, kSbCryptographyBlockCipherModeCtr, ...);
-
-`algorithm`: A string that represents the cipher algorithm. `block_size_bits`:
-The block size variant of the algorithm to use, in bits. `direction`: The
-direction in which to transform the data. `mode`: The block cipher mode to use.
-`initialization_vector`: The Initialization Vector (IV) to use. May be NULL for
-block cipher modes that don't use it, or don't set it at init time.
-`initialization_vector_size`: The size, in bytes, of the IV. `key`: The key to
-use for this transformation. `key_size`: The size, in bytes, of the key.
-
-#### Declaration ####
-
-```
-SbCryptographyTransformer SbCryptographyCreateTransformer(const char *algorithm, int block_size_bits, SbCryptographyDirection direction, SbCryptographyBlockCipherMode mode, const void *initialization_vector, int initialization_vector_size, const void *key, int key_size)
-```
-
-### SbCryptographyDestroyTransformer ###
-
-Destroys the given `transformer` instance.
-
-#### Declaration ####
-
-```
-void SbCryptographyDestroyTransformer(SbCryptographyTransformer transformer)
-```
-
-### SbCryptographyGetTag ###
-
-Calculates the authenticator tag for a transformer and places up to
-`out_tag_size` bytes of it in `out_tag`. Returns whether it was able to get the
-tag, which mainly has to do with whether it is compatible with the current block
-cipher mode.
-
-#### Declaration ####
-
-```
-bool SbCryptographyGetTag(SbCryptographyTransformer transformer, void *out_tag, int out_tag_size)
-```
-
-### SbCryptographyIsTransformerValid ###
-
-Returns whether the given transformer handle is valid.
-
-#### Declaration ####
-
-```
-static bool SbCryptographyIsTransformerValid(SbCryptographyTransformer transformer)
-```
-
-### SbCryptographySetAuthenticatedData ###
-
-Sets additional authenticated data (AAD) for a transformer, for chaining modes
-that support it (GCM). Returns whether the data was successfully set. This can
-fail if the chaining mode doesn't support AAD, if the parameters are invalid, or
-if the internal state is invalid for setting AAD.
-
-#### Declaration ####
-
-```
-bool SbCryptographySetAuthenticatedData(SbCryptographyTransformer transformer, const void *data, int data_size)
-```
-
-### SbCryptographySetInitializationVector ###
-
-Sets the initialization vector (IV) for a transformer, replacing the internally-
-set IV. The block cipher mode algorithm will update the IV appropriately after
-every block, so this is not necessary unless the stream is discontiguous in some
-way. This happens with AES-GCM in TLS.
-
-#### Declaration ####
-
-```
-void SbCryptographySetInitializationVector(SbCryptographyTransformer transformer, const void *initialization_vector, int initialization_vector_size)
-```
-
-### SbCryptographyTransform ###
-
-Transforms one or more `block_size_bits`-sized blocks of `in_data`, with the
-given `transformer`, placing the result in `out_data`. Returns the number of
-bytes that were written to `out_data`, unless there was an error, in which case
-it will return a negative number.
-
-`transformer`: A transformer initialized with an algorithm, IV, cipherkey, and
-so on. `in_data`: The data to be transformed. `in_data_size`: The size of the
-data to be transformed, in bytes. Must be a multiple of the transformer's
-`block-size_bits`, or an error will be returned. `out_data`: A buffer where the
-transformed data should be placed. Must have at least capacity for
-`in_data_size` bytes. May point to the same memory as `in_data`.
-
-#### Declaration ####
-
-```
-int SbCryptographyTransform(SbCryptographyTransformer transformer, const void *in_data, int in_data_size, void *out_data)
-```
-
diff --git a/src/cobalt/site/docs/reference/starboard/modules/decode_target.md b/src/cobalt/site/docs/reference/starboard/modules/decode_target.md
index d95a3d5..ae093b2 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/decode_target.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/decode_target.md
@@ -12,8 +12,7 @@
 data. This allows the application to allocate fast graphics memory, and have
 decoding done directly into this memory, avoiding unnecessary memory copies, and
 also avoiding pushing data between CPU and GPU memory unnecessarily.
-
-## SbDecodeTargetFormat ##
+SbDecodeTargetFormat
 
 SbDecodeTargets support several different formats that can be used to decode
 into and render from. Some formats may be easier to decode into, and others may
@@ -21,8 +20,7 @@
 the SbDecodeTargetFormat passed into it, or the decode will produce an error.
 Each decoder provides a way to check if a given SbDecodeTargetFormat is
 supported by that decoder.
-
-## SbDecodeTargetGraphicsContextProvider ##
+SbDecodeTargetGraphicsContextProvider
 
 Some components may need to acquire SbDecodeTargets compatible with a certain
 rendering context, which may need to be created on a particular thread. The
@@ -36,8 +34,7 @@
 
 The primary usage is likely to be the the SbPlayer implementation on some
 platforms.
-
-## SbDecodeTarget Example ##
+SbDecodeTarget Example
 
 Let's say that we are an application and we would like to use the interface
 defined in starboard/image.h to decode an imaginary "image/foo" image type.
@@ -78,6 +75,7 @@
 SbDecodeTargetGetInfo(target, &info);
 GLuint texture =
     info.planes[kSbDecodeTargetPlaneRGBA].texture;
+
 ```
 
 ## Macros ##
@@ -208,10 +206,26 @@
 
 #### Members ####
 
-*   `SbBlitterDevice device`
+*   `void * egl_display`
 
-    The SbBlitterDevice object that will be used to render any produced
-    SbDecodeTargets.
+    A reference to the EGLDisplay object that hosts the EGLContext that will be
+    used to render any produced SbDecodeTargets. Note that it has the type
+    `void*` in order to avoid #including the EGL header files here.
+*   `void * egl_context`
+
+    The EGLContext object that will be used to render any produced
+    SbDecodeTargets. Note that it has the type `void*` in order to avoid
+    #including the EGL header files here.
+*   `SbDecodeTargetGlesContextRunner gles_context_runner`
+
+    The `gles_context_runner` function pointer is passed in from the application
+    into the Starboard implementation, and can be invoked by the Starboard
+    implementation to allow running arbitrary code on the renderer's thread with
+    the EGLContext above held current.
+*   `void * gles_context_runner_context`
+
+    Context data that is to be passed in to `gles_context_runner` when it is
+    invoked.
 
 ### SbDecodeTargetInfo ###
 
@@ -253,10 +267,15 @@
 
 #### Members ####
 
-*   `int left`
-*   `int top`
-*   `int right`
-*   `int bottom`
+*   `float left`
+
+    If the texture (width, height) is set to (1, 1), then these values will be
+    interpreted as normalized coordinates, and depending on the platform (for
+    example GLES 2.0 provides no method of obtaining the texture width/height)
+    this may be more natural than specifying absolute pixel offsets.
+*   `float top`
+*   `float right`
+*   `float bottom`
 
 ### SbDecodeTargetInfoPlane ###
 
@@ -264,9 +283,20 @@
 
 #### Members ####
 
-*   `SbBlitterSurface surface`
+*   `uint32_t texture`
 
-    A handle to the Blitter surface that can be used for rendering.
+    A handle to the GL texture that can be used for rendering.
+*   `uint32_t gl_texture_target`
+
+    The GL texture target that should be used in calls to glBindTexture.
+    Typically this would be GL_TEXTURE_2D, but some platforms may require that
+    it be set to something else like GL_TEXTURE_EXTERNAL_OES.
+*   `uint32_t gl_texture_format`
+
+    For kSbDecodeTargetFormat2PlaneYUVNV12 planes: the format of the texture.
+    Usually, for the luma plane, this is either GL_ALPHA or GL_RED_EXT. For the
+    chroma plane, this is usually GL_LUMINANCE_ALPHA or GL_RG_EXT. Ignored for
+    other plane types.
 *   `int width`
 
     The width of the texture/surface for this particular plane.
@@ -330,8 +360,8 @@
 Returns ownership of `decode_target` to the Starboard implementation. This
 function will likely result in the destruction of the SbDecodeTarget and all its
 associated surfaces, though in some cases, platforms may simply adjust a
-reference count. In the case where `SbGetGlesInterface()` returns an interface,
-this function must be called on a thread with the context
+reference count. In the case where SB_HAS(GLES2), this function must be called
+on a thread with the context
 
 #### Declaration ####
 
diff --git a/src/cobalt/site/docs/reference/starboard/modules/directory.md b/src/cobalt/site/docs/reference/starboard/modules/directory.md
index 7288d2d..d46c9a1 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/directory.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/directory.md
@@ -23,18 +23,6 @@
 typedef struct SbDirectoryPrivate* SbDirectory
 ```
 
-## Structs ##
-
-### SbDirectoryEntry ###
-
-Represents a directory entry.
-
-#### Members ####
-
-*   `char name`
-
-    The name of this directory entry.
-
 ## Functions ##
 
 ### SbDirectoryCanOpen ###
@@ -81,16 +69,24 @@
 Populates `out_entry` with the next entry in the specified directory stream, and
 moves the stream forward by one entry.
 
+Platforms may, but are not required to, return `.` (referring to the directory
+itself) and/or `..` (referring to the directory's parent directory) as entries
+in the directory stream.
+
 This function returns `true` if there was a next directory, and `false` at the
-end of the directory stream.
+end of the directory stream or if `out_entry_size` is smaller than
+kSbFileMaxName.
 
 `directory`: The directory stream from which to retrieve the next directory.
-`out_entry`: The variable to be populated with the next directory entry.
+`out_entry`: The null terminated string to be populated with the next directory
+entry. The space allocated for this string should be equal to `out_entry_size`.
+`out_entry_size`: The size of the space allocated for `out_entry`. This should
+be at least equal to kSbFileMaxName.
 
 #### Declaration ####
 
 ```
-bool SbDirectoryGetNext(SbDirectory directory, SbDirectoryEntry *out_entry)
+bool SbDirectoryGetNext(SbDirectory directory, char *out_entry, size_t out_entry_size)
 ```
 
 ### SbDirectoryIsValid ###
diff --git a/src/cobalt/site/docs/reference/starboard/modules/drm.md b/src/cobalt/site/docs/reference/starboard/modules/drm.md
index 230ea16..3036863 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/drm.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/drm.md
@@ -18,6 +18,15 @@
 
 ## Enums ##
 
+### SbDrmEncryptionScheme ###
+
+Encryption scheme of the input sample, as defined in ISO/IEC 23001 part 7.
+
+#### Values ####
+
+*   `kSbDrmEncryptionSchemeAesCtr`
+*   `kSbDrmEncryptionSchemeAesCbc`
+
 ### SbDrmKeyStatus ###
 
 Status of a particular media key. [https://w3c.github.io/encrypted-media/#idl-def-MediaKeyStatus](https://w3c.github.io/encrypted-media/#idl-def-MediaKeyStatus)
@@ -101,19 +110,23 @@
 A callback that will receive generated session update request when requested
 from a SbDrmSystem. `drm_system` will be the DRM system that
 SbDrmGenerateSessionUpdateRequest() was called on. `context` will be the same
-context that was passed into the call to SbDrmCreateSystem().`status` is the
-status of the session request.
+context that was passed into the call to SbDrmCreateSystem().
+
+`status` is the status of the session request.
 
 `type` is the status of the session request.
 
 `error_message` may contain an optional error message when `status` isn't
 `kSbDrmStatusSuccess` to provide more details about the error. It may be NULL if
-`status` is `kSbDrmStatusSuccess` or if no error message can be
-provided.`ticket` will be the same ticket that was passed to
+`status` is `kSbDrmStatusSuccess` or if no error message can be provided.
+`ticket` will be the same ticket that was passed to
 SbDrmGenerateSessionUpdateRequest() or `kSbDrmTicketInvalid` if the update
 request was generated by the DRM system.
 
-`session_id` can be NULL if there was an error generating the request.
+`session_id` cannot be NULL when `ticket` is `kSbDrmTicketInvalid`, even when
+there was an error generating the request. This allows Cobalt to find and reject
+the correct Promise corresponding to the associated
+SbDrmGenerateSessionUpdateRequest().
 
 #### Definition ####
 
@@ -128,13 +141,14 @@
 system that SbDrmUpdateSession() was called on. `context` will be the same
 context passed into that call to SbDrmCreateSystem().
 
-`ticket` will be the same ticket that was passed to
-SbDrmUpdateSession().`status` is the status of the session request.
+`ticket` will be the same ticket that was passed to SbDrmUpdateSession().
+
+`status` is the status of the session request.
 
 `error_message` may contain an optional error message when `status` isn't
 `kSbDrmStatusSuccess` to provide more details about the error. It may be NULL if
-`status` is `kSbDrmStatusSuccess` or if no error message can be
-provided.`succeeded` is whether the session was successfully updated or not.
+`status` is `kSbDrmStatusSuccess` or if no error message can be provided.
+`succeeded` is whether the session was successfully updated or not.
 
 #### Definition ####
 
@@ -155,6 +169,15 @@
 
 ## Structs ##
 
+### SbDrmEncryptionPattern ###
+
+Encryption pattern of the input sample, as defined in ISO/IEC 23001 part 7.
+
+#### Members ####
+
+*   `uint32_t crypt_byte_block`
+*   `uint32_t skip_byte_block`
+
 ### SbDrmKeyId ###
 
 #### Members ####
@@ -171,6 +194,12 @@
 
 #### Members ####
 
+*   `SbDrmEncryptionScheme encryption_scheme`
+
+    The encryption scheme of this sample.
+*   `SbDrmEncryptionPattern encryption_pattern`
+
+    The encryption pattern of this sample.
 *   `uint8_t initialization_vector`
 
     The Initialization Vector needed to decrypt this sample.
@@ -215,40 +244,6 @@
 void SbDrmCloseSession(SbDrmSystem drm_system, const void *session_id, int session_id_size)
 ```
 
-### SbDrmCreateSystem ###
-
-Creates a new DRM system that can be used when constructing an SbPlayer or an
-SbDecoder.
-
-This function returns kSbDrmSystemInvalid if `key_system` is unsupported.
-
-Also see the documentation of SbDrmGenerateSessionUpdateRequest() and
-SbDrmUpdateSession() for more details.
-
-`key_system`: The DRM key system to be created. The value should be in the form
-of "com.example.somesystem" as suggested by [https://w3c.github.io/encrypted-media/#key-system](https://w3c.github.io/encrypted-media/#key-system)) . All
-letters in the value should be lowercase and will be matched exactly with known
-DRM key systems of the platform. `context`: A value passed when any of this
-function's callback parameters are called. `update_request_callback`: A function
-that is called every time after SbDrmGenerateSessionUpdateRequest() is called.
-`session_updated_callback`: A function that is called every time after
-SbDrmUpdateSession() is called. `key_statuses_changed_callback`: A function that
-can be called to indicate that key statuses have changed.
-`server_certificate_updated_callback`: A function that is called to report
-whether the server certificate has been successfully updated. It is called once
-and only once. It is possible that the callback is called before the function
-returns. `session_closed_callback`: A function that can be called to indicate
-that a session has closed.If `NULL` is passed for any of the callbacks
-(`update_request_callback`, `session_updated_callback`,
-`key_statuses_changed_callback`, `server_certificate_updated_callback`, or
-`session_closed_callback`), then `kSbDrmSystemInvalid` must be returned.
-
-#### Declaration ####
-
-```
-SbDrmSystem SbDrmCreateSystem(const char *key_system, void *context, SbDrmSessionUpdateRequestFunc update_request_callback, SbDrmSessionUpdatedFunc session_updated_callback, SbDrmSessionKeyStatusesChangedFunc key_statuses_changed_callback, SbDrmServerCertificateUpdatedFunc server_certificate_updated_callback, SbDrmSessionClosedFunc session_closed_callback)
-```
-
 ### SbDrmDestroySystem ###
 
 Destroys `drm_system`, which implicitly removes all keys installed in it and
@@ -305,6 +300,36 @@
 void SbDrmGenerateSessionUpdateRequest(SbDrmSystem drm_system, int ticket, const char *type, const void *initialization_data, int initialization_data_size)
 ```
 
+### SbDrmGetMetrics ###
+
+Get the metrics of the underlying drm system.
+
+When it is called on an implementation that supports drm system metrics, it
+should return a pointer containing the metrics as a blob, encoded using url safe
+base64 without padding and line wrapping, with the size of the encoded result in
+`size` on return. For example, on Android API level 28 or later, it should
+return the result of MediaDrm.getPropertyByteArray("metrics"), encoded using url
+safe base64 without padding and line wrapping. On systems using Widevine CE CDM
+with oemcrypto 16 or later, it should return the metrics retrieved via
+Cdm::getMetrics(), encoded using url safe base64 without padding and line
+wrapping. The returned pointer should remain valid and its content should remain
+unmodified until the next time this function is called on the associated
+`drm_system` or the `drm_system` is destroyed.
+
+When the metrics is empty on supported system, it should return a non-null
+pointer with `size` set to 0.
+
+It should return NULL when there is no metrics support in the underlying drm
+system, or when the drm system implementation fails to retrieve the metrics.
+
+The caller will never set `size` to NULL.
+
+#### Declaration ####
+
+```
+const void* SbDrmGetMetrics(SbDrmSystem drm_system, int *size)
+```
+
 ### SbDrmIsServerCertificateUpdatable ###
 
 Returns true if server certificate of `drm_system` can be updated via
diff --git a/src/cobalt/site/docs/reference/starboard/modules/egl.md b/src/cobalt/site/docs/reference/starboard/modules/egl.md
new file mode 100644
index 0000000..1938b5b
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/egl.md
@@ -0,0 +1,119 @@
+---
+layout: doc
+title: "Starboard Module Reference: egl.h"
+---
+
+The EGL API provides an interface with accompanying type declarations and
+defines that together provide a single consistent method of EGL usage across
+platforms.
+
+This API is designed to abstract the differences between EGL implementations and
+versions on different systems, and to remove the requirement for any other code
+to directly pull in and use these system libraries.
+EGL Version
+
+This API has the ability to support EGL 1.5, however it is not required to
+support anything beyond EGL 1.4. The user is responsible for ensuring that the
+functions from EGL 1.5 they are calling from the interface are valid.
+
+## Macros ##
+
+### SB_EGL_ALPHA_FORMAT ###
+
+EGL_VERSION_1_2
+
+### SB_EGL_ALPHA_SIZE ###
+
+EGL_VERSION_1_0
+
+### SB_EGL_BACK_BUFFER ###
+
+EGL_VERSION_1_1
+
+### SB_EGL_CONFORMANT ###
+
+EGL_VERSION_1_3
+
+### SB_EGL_CONTEXT_MAJOR_VERSION ###
+
+EGL_VERSION_1_5
+
+### SB_EGL_DEFAULT_DISPLAY ###
+
+EGL_VERSION_1_4
+
+## Typedefs ##
+
+### SbEglCastsToProperFunctionPointerType ###
+
+The following type definitions were adapted from the types declared in [https://www.khronos.org/registry/EGL/api/EGL/egl.h](https://www.khronos.org/registry/EGL/api/EGL/egl.h)
+.
+
+#### Definition ####
+
+```
+typedef void(* SbEglCastsToProperFunctionPointerType) (void)
+```
+
+### SbEglInt32 ###
+
+The following type definitions were adapted from the types declared in [https://www.khronos.org/registry/EGL/api/EGL/eglplatform.h](https://www.khronos.org/registry/EGL/api/EGL/eglplatform.h)
+.
+
+#### Definition ####
+
+```
+typedef int32_t SbEglInt32
+```
+
+## Structs ##
+
+### SbEglInterface ###
+
+#### Members ####
+
+*   `SbEglBoolean(* eglChooseConfig`
+*   `SbEglBoolean(* eglCopyBuffers`
+*   `SbEglContext(* eglCreateContext`
+*   `SbEglSurface(* eglCreatePbufferSurface`
+*   `SbEglSurface(* eglCreatePixmapSurface`
+*   `SbEglSurface(* eglCreateWindowSurface`
+*   `SbEglBoolean(* eglDestroyContext`
+*   `SbEglBoolean(* eglDestroySurface`
+*   `SbEglBoolean(* eglGetConfigAttrib`
+*   `SbEglBoolean(* eglGetConfigs`
+*   `SbEglDisplay(* eglGetCurrentDisplay`
+*   `SbEglSurface(* eglGetCurrentSurface`
+*   `SbEglDisplay(* eglGetDisplay`
+*   `SbEglInt32(* eglGetError`
+*   `SbEglCastsToProperFunctionPointerType(* eglGetProcAddress`
+*   `SbEglBoolean(* eglInitialize`
+*   `SbEglBoolean(* eglMakeCurrent`
+*   `SbEglBoolean(* eglQueryContext`
+*   `const char *(* eglQueryString`
+*   `SbEglBoolean(* eglQuerySurface`
+*   `SbEglBoolean(* eglSwapBuffers`
+*   `SbEglBoolean(* eglTerminate`
+*   `SbEglBoolean(* eglWaitGL`
+*   `SbEglBoolean(* eglWaitNative`
+*   `SbEglBoolean(* eglBindTexImage`
+*   `SbEglBoolean(* eglReleaseTexImage`
+*   `SbEglBoolean(* eglSurfaceAttrib`
+*   `SbEglBoolean(* eglSwapInterval`
+*   `SbEglBoolean(* eglBindAPI`
+*   `SbEglEnum(* eglQueryAPI`
+*   `SbEglSurface(* eglCreatePbufferFromClientBuffer`
+*   `SbEglBoolean(* eglReleaseThread`
+*   `SbEglBoolean(* eglWaitClient`
+*   `SbEglContext(* eglGetCurrentContext`
+*   `SbEglSync(* eglCreateSync`
+*   `SbEglBoolean(* eglDestroySync`
+*   `SbEglInt32(* eglClientWaitSync`
+*   `SbEglBoolean(* eglGetSyncAttrib`
+*   `SbEglImage(* eglCreateImage`
+*   `SbEglBoolean(* eglDestroyImage`
+*   `SbEglDisplay(* eglGetPlatformDisplay`
+*   `SbEglSurface(* eglCreatePlatformWindowSurface`
+*   `SbEglSurface(* eglCreatePlatformPixmapSurface`
+*   `SbEglBoolean(* eglWaitSync`
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/event.md b/src/cobalt/site/docs/reference/starboard/modules/event.md
index 4ea1f95..65b6394 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/event.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/event.md
@@ -4,8 +4,7 @@
 ---
 
 Defines the event system that wraps the Starboard main loop and entry point.
-
-## The Starboard Application Lifecycle ##
+The Starboard Application Lifecycle
 
 ```
     ---------- *
@@ -160,19 +159,6 @@
     timing-sensitive, so as little work as possible should be done on the main
     thread if the application wants to receive this event in a timely manner. No
     data argument.
-*   `kSbEventTypeNetworkDisconnect`
-
-    The platform has detected a network disconnection. The platform should make
-    a best effort to send an event of this type when the network disconnects,
-    but there are likely to be cases where the platform cannot detect the
-    disconnection (e.g. if the connection is via a powered hub which becomes
-    disconnected), so the current network state cannot always be inferred from
-    the sequence of Connect/Disconnect events.
-*   `kSbEventTypeNetworkConnect`
-
-    The platform has detected a network connection. This event may be sent at
-    application start-up, and should always be sent if the network reconnects
-    since a disconnection event was sent.
 *   `kSbEventTypeScheduled`
 
     An event type reserved for scheduled callbacks. It will only be sent in
@@ -184,7 +170,11 @@
     The platform's accessibility settings have changed. The application should
     query the accessibility settings using the appropriate APIs to get the new
     settings. Note this excludes captions settings changes, which causes
-    kSbEventTypeAccessibilityCaptionSettingsChanged to fire.
+    kSbEventTypeAccessibilityCaptionSettingsChanged to fire. If the starboard
+    version has kSbEventTypeAccessiblityTextToSpeechSettingsChanged, then that
+    event should be used to signal text-to-speech settings changes instead;
+    platforms using older starboard versions should use
+    kSbEventTypeAccessiblitySettingsChanged for text-to-speech settings changes.
 *   `kSbEventTypeLowMemory`
 
     An optional event that platforms may send to indicate that the application
@@ -232,10 +222,23 @@
     triggered by the application have tickets passed in via
     SbWindowBlurOnScreenKeyboard. System-triggered events have ticket value
     kSbEventOnScreenKeyboardInvalidTicket.
+*   `kSbEventTypeOnScreenKeyboardSuggestionsUpdated`
+
+    The platform has updated the on screen keyboard suggestions. This event is
+    triggered by the system or by the application's OnScreenKeyboard update
+    suggestions method. The event has int data representing a ticket. The ticket
+    is used by the application to mark individual calls to the update
+    suggestions method as successfully completed. Events triggered by the
+    application have tickets passed in via
+    SbWindowUpdateOnScreenKeyboardSuggestions. System-triggered events have
+    ticket value kSbEventOnScreenKeyboardInvalidTicket.
 *   `kSbEventTypeAccessibilityCaptionSettingsChanged`
 
-    One or more of the fields returned by SbAccessibilityGetCaptionSettings has
-    changed.
+    SB_HAS(ON_SCREEN_KEYBOARD) One or more of the fields returned by
+    SbAccessibilityGetCaptionSettings has changed.
+*   `kSbEventTypeAccessiblityTextToSpeechSettingsChanged`
+
+    The platform's text-to-speech settings have changed.
 
 ## Typedefs ##
 
diff --git a/src/cobalt/site/docs/reference/starboard/modules/export.md b/src/cobalt/site/docs/reference/starboard/modules/export.md
index 2fa8e8c..ff79777 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/export.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/export.md
@@ -10,6 +10,15 @@
 
 ### SB_EXPORT ###
 
-COMPONENT_BUILD is defined when generating shared libraries for each project,
-rather than static libraries. This means we need to be careful about
-EXPORT/IMPORT.
+Specification for a symbol that should be exported when building the DLL and
+imported when building code that uses the DLL.
+
+### SB_EXPORT_PRIVATE ###
+
+Specification for a symbol that should be exported or imported for testing
+purposes only.
+
+### SB_IMPORT ###
+
+Specification for a symbol that is expected to be defined externally to this
+module.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/file.md b/src/cobalt/site/docs/reference/starboard/modules/file.md
index b115501..c3ba551 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/file.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/file.md
@@ -37,10 +37,9 @@
 *   `kSbFileErrorNotAFile`
 *   `kSbFileErrorNotEmpty`
 *   `kSbFileErrorInvalidUrl`
+*   `kSbFileErrorIO`
 *   `kSbFileErrorMax`
 
-    Put new entries here and increment kSbFileErrorMax.
-
 ### SbFileFlags ###
 
 Flags that define how a file is used in the application. These flags should be
@@ -137,6 +136,22 @@
 
 ## Functions ##
 
+### SbFileAtomicReplace ###
+
+Replaces the content of the file at `path` with `data`. Returns whether the
+contents of the file were replaced. The replacement of the content is an atomic
+operation. The file will either have all of the data, or none.
+
+`path`: The path to the file whose contents should be replaced. `data`: The data
+to replace the file contents with. `data_size`: The amount of `data`, in bytes,
+to be written to the file.
+
+#### Declaration ####
+
+```
+bool SbFileAtomicReplace(const char *path, const char *data, int64_t data_size)
+```
+
 ### SbFileCanOpen ###
 
 Indicates whether SbFileOpen() with the given `flags` is allowed for `path`.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/gles.md b/src/cobalt/site/docs/reference/starboard/modules/gles.md
new file mode 100644
index 0000000..e3a5508
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/gles.md
@@ -0,0 +1,315 @@
+---
+layout: doc
+title: "Starboard Module Reference: gles.h"
+---
+
+The GLES API provides an interface with accompanying type declarations and
+defines that together provide a single consistent method of GLES usage across
+platforms.
+
+This API is designed to abstract the differences between GLES implementations
+and versions on different systems, and to remove the requirement for any other
+code to directly pull in and use these system libraries.
+GLES Version
+
+This API has the ability to support GLES 3.0, however platforms are not required
+to support anything beyond GLES 2.0. The caller is responsible for ensuring that
+the functions from GLES 3.0 they are calling from the interface are valid.
+
+## Macros ##
+
+### SB_GL_DEPTH_BUFFER_BIT ###
+
+Previously defined in [https://www.khronos.org/registry/OpenGL/api/GLES2/gl2.h](https://www.khronos.org/registry/OpenGL/api/GLES2/gl2.h)
+
+### SB_GL_READ_BUFFER ###
+
+Previously defined in [https://www.khronos.org/registry/OpenGL/api/GLES3/gl3.h](https://www.khronos.org/registry/OpenGL/api/GLES3/gl3.h)
+.
+
+## Typedefs ##
+
+### SbGlBoolean ###
+
+The following type definitions were adapted from the types declared in [https://www.khronos.org/registry/OpenGL/api/GLES2/gl2.h](https://www.khronos.org/registry/OpenGL/api/GLES2/gl2.h)
+.
+
+#### Definition ####
+
+```
+typedef uint8_t SbGlBoolean
+```
+
+### SbGlIntPtr ###
+
+Some compilers will transform the intptr_t to an int transparently behind the
+scenes, which is not equivalent to a long int, or long long int, as far as the
+compiler is concerned. We check the Starboard configuration and set the types to
+those exact types used by OpenGL ES 2.0 ( [https://www.khronos.org/registry/OpenGL/api/GLES2/gl2ext.h](https://www.khronos.org/registry/OpenGL/api/GLES2/gl2ext.h)
+).
+
+#### Definition ####
+
+```
+typedef long int SbGlIntPtr
+```
+
+## Structs ##
+
+### SbGlesInterface ###
+
+#### Members ####
+
+*   `void(* glActiveTexture`
+
+    The following prototypes were adapted from the prototypes declared in [https://www.khronos.org/registry/OpenGL/api/GLES2/gl2.h](https://www.khronos.org/registry/OpenGL/api/GLES2/gl2.h)
+    .
+*   `void(* glAttachShader`
+*   `void(* glBindAttribLocation`
+*   `void(* glBindBuffer`
+*   `void(* glBindFramebuffer`
+*   `void(* glBindRenderbuffer`
+*   `void(* glBindTexture`
+*   `void(* glBlendColor`
+*   `void(* glBlendEquation`
+*   `void(* glBlendEquationSeparate`
+*   `void(* glBlendFunc`
+*   `void(* glBlendFuncSeparate`
+*   `void(* glBufferData`
+*   `void(* glBufferSubData`
+*   `SbGlEnum(* glCheckFramebufferStatus`
+*   `void(* glClear`
+*   `void(* glClearColor`
+*   `void(* glClearDepthf`
+*   `void(* glClearStencil`
+*   `void(* glColorMask`
+*   `void(* glCompileShader`
+*   `void(* glCompressedTexImage2D`
+*   `void(* glCompressedTexSubImage2D`
+*   `void(* glCopyTexImage2D`
+*   `void(* glCopyTexSubImage2D`
+*   `SbGlUInt32(* glCreateProgram`
+*   `SbGlUInt32(* glCreateShader`
+*   `void(* glCullFace`
+*   `void(* glDeleteBuffers`
+*   `void(* glDeleteFramebuffers`
+*   `void(* glDeleteProgram`
+*   `void(* glDeleteRenderbuffers`
+*   `void(* glDeleteShader`
+*   `void(* glDeleteTextures`
+*   `void(* glDepthFunc`
+*   `void(* glDepthMask`
+*   `void(* glDepthRangef`
+*   `void(* glDetachShader`
+*   `void(* glDisable`
+*   `void(* glDisableVertexAttribArray`
+*   `void(* glDrawArrays`
+*   `void(* glDrawElements`
+*   `void(* glEnable`
+*   `void(* glEnableVertexAttribArray`
+*   `void(* glFinish`
+*   `void(* glFlush`
+*   `void(* glFramebufferRenderbuffer`
+*   `void(* glFramebufferTexture2D`
+*   `void(* glFrontFace`
+*   `void(* glGenBuffers`
+*   `void(* glGenerateMipmap`
+*   `void(* glGenFramebuffers`
+*   `void(* glGenRenderbuffers`
+*   `void(* glGenTextures`
+*   `void(* glGetActiveAttrib`
+*   `void(* glGetActiveUniform`
+*   `void(* glGetAttachedShaders`
+*   `SbGlInt32(* glGetAttribLocation`
+*   `void(* glGetBooleanv`
+*   `void(* glGetBufferParameteriv`
+*   `SbGlEnum(* glGetError`
+*   `void(* glGetFloatv`
+*   `void(* glGetFramebufferAttachmentParameteriv`
+*   `void(* glGetIntegerv`
+*   `void(* glGetProgramiv`
+*   `void(* glGetProgramInfoLog`
+*   `void(* glGetRenderbufferParameteriv`
+*   `void(* glGetShaderiv`
+*   `void(* glGetShaderInfoLog`
+*   `void(* glGetShaderPrecisionFormat`
+*   `void(* glGetShaderSource`
+*   `const SbGlUInt8 *(* glGetString`
+*   `void(* glGetTexParameterfv`
+*   `void(* glGetTexParameteriv`
+*   `void(* glGetUniformfv`
+*   `void(* glGetUniformiv`
+*   `SbGlInt32(* glGetUniformLocation`
+*   `void(* glGetVertexAttribfv`
+*   `void(* glGetVertexAttribiv`
+*   `void(* glGetVertexAttribPointerv`
+*   `void(* glHint`
+*   `SbGlBoolean(* glIsBuffer`
+*   `SbGlBoolean(* glIsEnabled`
+*   `SbGlBoolean(* glIsFramebuffer`
+*   `SbGlBoolean(* glIsProgram`
+*   `SbGlBoolean(* glIsRenderbuffer`
+*   `SbGlBoolean(* glIsShader`
+*   `SbGlBoolean(* glIsTexture`
+*   `void(* glLineWidth`
+*   `void(* glLinkProgram`
+*   `void(* glPixelStorei`
+*   `void(* glPolygonOffset`
+*   `void(* glReadPixels`
+*   `void(* glReleaseShaderCompiler`
+*   `void(* glRenderbufferStorage`
+*   `void(* glSampleCoverage`
+*   `void(* glScissor`
+*   `void(* glShaderBinary`
+*   `void(* glShaderSource`
+*   `void(* glStencilFunc`
+*   `void(* glStencilFuncSeparate`
+*   `void(* glStencilMask`
+*   `void(* glStencilMaskSeparate`
+*   `void(* glStencilOp`
+*   `void(* glStencilOpSeparate`
+*   `void(* glTexImage2D`
+*   `void(* glTexParameterf`
+*   `void(* glTexParameterfv`
+*   `void(* glTexParameteri`
+*   `void(* glTexParameteriv`
+*   `void(* glTexSubImage2D`
+*   `void(* glUniform1f`
+*   `void(* glUniform1fv`
+*   `void(* glUniform1i`
+*   `void(* glUniform1iv`
+*   `void(* glUniform2f`
+*   `void(* glUniform2fv`
+*   `void(* glUniform2i`
+*   `void(* glUniform2iv`
+*   `void(* glUniform3f`
+*   `void(* glUniform3fv`
+*   `void(* glUniform3i`
+*   `void(* glUniform3iv`
+*   `void(* glUniform4f`
+*   `void(* glUniform4fv`
+*   `void(* glUniform4i`
+*   `void(* glUniform4iv`
+*   `void(* glUniformMatrix2fv`
+*   `void(* glUniformMatrix3fv`
+*   `void(* glUniformMatrix4fv`
+*   `void(* glUseProgram`
+*   `void(* glValidateProgram`
+*   `void(* glVertexAttrib1f`
+*   `void(* glVertexAttrib1fv`
+*   `void(* glVertexAttrib2f`
+*   `void(* glVertexAttrib2fv`
+*   `void(* glVertexAttrib3f`
+*   `void(* glVertexAttrib3fv`
+*   `void(* glVertexAttrib4f`
+*   `void(* glVertexAttrib4fv`
+*   `void(* glVertexAttribPointer`
+*   `void(* glViewport`
+*   `void(* glReadBuffer`
+
+    The following prototypes were adapted from the prototypes declared in [https://www.khronos.org/registry/OpenGL/api/GLES3/gl3.h](https://www.khronos.org/registry/OpenGL/api/GLES3/gl3.h)
+    .
+*   `void(* glDrawRangeElements`
+*   `void(* glTexImage3D`
+*   `void(* glTexSubImage3D`
+*   `void(* glCopyTexSubImage3D`
+*   `void(* glCompressedTexImage3D`
+*   `void(* glCompressedTexSubImage3D`
+*   `void(* glGenQueries`
+*   `void(* glDeleteQueries`
+*   `SbGlBoolean(* glIsQuery`
+*   `void(* glBeginQuery`
+*   `void(* glEndQuery`
+*   `void(* glGetQueryiv`
+*   `void(* glGetQueryObjectuiv`
+*   `SbGlBoolean(* glUnmapBuffer`
+*   `void(* glGetBufferPointerv`
+*   `void(* glDrawBuffers`
+*   `void(* glUniformMatrix2x3fv`
+*   `void(* glUniformMatrix3x2fv`
+*   `void(* glUniformMatrix2x4fv`
+*   `void(* glUniformMatrix4x2fv`
+*   `void(* glUniformMatrix3x4fv`
+*   `void(* glUniformMatrix4x3fv`
+*   `void(* glBlitFramebuffer`
+*   `void(* glRenderbufferStorageMultisample`
+*   `void(* glFramebufferTextureLayer`
+*   `void *(* glMapBufferRange`
+*   `void(* glFlushMappedBufferRange`
+*   `void(* glBindVertexArray`
+*   `void(* glDeleteVertexArrays`
+*   `void(* glGenVertexArrays`
+*   `SbGlBoolean(* glIsVertexArray`
+*   `void(* glGetIntegeri_v`
+*   `void(* glBeginTransformFeedback`
+*   `void(* glEndTransformFeedback`
+*   `void(* glBindBufferRange`
+*   `void(* glBindBufferBase`
+*   `void(* glTransformFeedbackVaryings`
+*   `void(* glGetTransformFeedbackVarying`
+*   `void(* glVertexAttribIPointer`
+*   `void(* glGetVertexAttribIiv`
+*   `void(* glGetVertexAttribIuiv`
+*   `void(* glVertexAttribI4i`
+*   `void(* glVertexAttribI4ui`
+*   `void(* glVertexAttribI4iv`
+*   `void(* glVertexAttribI4uiv`
+*   `void(* glGetUniformuiv`
+*   `SbGlInt32(* glGetFragDataLocation`
+*   `void(* glUniform1ui`
+*   `void(* glUniform2ui`
+*   `void(* glUniform3ui`
+*   `void(* glUniform4ui`
+*   `void(* glUniform1uiv`
+*   `void(* glUniform2uiv`
+*   `void(* glUniform3uiv`
+*   `void(* glUniform4uiv`
+*   `void(* glClearBufferiv`
+*   `void(* glClearBufferuiv`
+*   `void(* glClearBufferfv`
+*   `void(* glClearBufferfi`
+*   `const SbGlUInt8 *(* glGetStringi`
+*   `void(* glCopyBufferSubData`
+*   `void(* glGetUniformIndices`
+*   `void(* glGetActiveUniformsiv`
+*   `SbGlUInt32(* glGetUniformBlockIndex`
+*   `void(* glGetActiveUniformBlockiv`
+*   `void(* glGetActiveUniformBlockName`
+*   `void(* glUniformBlockBinding`
+*   `void(* glDrawArraysInstanced`
+*   `void(* glDrawElementsInstanced`
+*   `SbGlSync(* glFenceSync`
+*   `SbGlBoolean(* glIsSync`
+*   `void(* glDeleteSync`
+*   `SbGlEnum(* glClientWaitSync`
+*   `void(* glWaitSync`
+*   `void(* glGetInteger64v`
+*   `void(* glGetSynciv`
+*   `void(* glGetInteger64i_v`
+*   `void(* glGetBufferParameteri64v`
+*   `void(* glGenSamplers`
+*   `void(* glDeleteSamplers`
+*   `SbGlBoolean(* glIsSampler`
+*   `void(* glBindSampler`
+*   `void(* glSamplerParameteri`
+*   `void(* glSamplerParameteriv`
+*   `void(* glSamplerParameterf`
+*   `void(* glSamplerParameterfv`
+*   `void(* glGetSamplerParameteriv`
+*   `void(* glGetSamplerParameterfv`
+*   `void(* glVertexAttribDivisor`
+*   `void(* glBindTransformFeedback`
+*   `void(* glDeleteTransformFeedbacks`
+*   `void(* glGenTransformFeedbacks`
+*   `SbGlBoolean(* glIsTransformFeedback`
+*   `void(* glPauseTransformFeedback`
+*   `void(* glResumeTransformFeedback`
+*   `void(* glGetProgramBinary`
+*   `void(* glProgramBinary`
+*   `void(* glProgramParameteri`
+*   `void(* glInvalidateFramebuffer`
+*   `void(* glInvalidateSubFramebuffer`
+*   `void(* glTexStorage2D`
+*   `void(* glTexStorage3D`
+*   `void(* glGetInternalformativ`
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/image.md b/src/cobalt/site/docs/reference/starboard/modules/image.md
index 634dab8..c911e41 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/image.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/image.md
@@ -10,8 +10,7 @@
 
 All functions in this module are safe to call from any thread at any point in
 time.
-
-## SbImageIsDecodeSupported and SbImageDecode Example ##
+SbImageIsDecodeSupported and SbImageDecode Example
 
 Let's assume that we're on a Blitter platform.
 
@@ -31,6 +30,7 @@
 SbBlitterSurface surface =
     SbDecodeTargetGetPlane(target, kSbDecodeTargetPlaneRGBA);
 // Do stuff with surface...
+
 ```
 
 ## Functions ##
diff --git a/src/cobalt/site/docs/reference/starboard/modules/input.md b/src/cobalt/site/docs/reference/starboard/modules/input.md
index d607e0a..3554af6 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/input.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/input.md
@@ -163,6 +163,9 @@
 *   `const char * input_text`
 
     The text to input for events of type `Input`.
+*   `bool is_composing`
+
+    Set to true if the input event is part of a composition event.
 
 ### SbInputVector ###
 
diff --git a/src/cobalt/site/docs/reference/starboard/modules/log.md b/src/cobalt/site/docs/reference/starboard/modules/log.md
index fd98e08..1ad6c24 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/log.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/log.md
@@ -3,7 +3,7 @@
 title: "Starboard Module Reference: log.h"
 ---
 
-Defines debug logging functions.
+Defines core debug logging functions.
 
 ## Enums ##
 
@@ -24,7 +24,8 @@
 
 ### SbLog ###
 
-Writes `message` to the platform's debug output log.
+Writes `message` to the platform's debug output log. This method is thread-safe,
+and responsible for ensuring that the output from multiple threads is not mixed.
 
 `priority`: The SbLogPriority at which the message should be logged. Note that
 passing `kSbLogPriorityFatal` does not terminate the program. Such a policy must
@@ -42,7 +43,8 @@
 
 ### SbLogFlush ###
 
-Flushes the log buffer on some platforms.
+Flushes the log buffer on some platforms. This method is safe to call from
+multiple threads.
 
 #### Declaration ####
 
diff --git a/src/cobalt/site/docs/reference/starboard/modules/media.md b/src/cobalt/site/docs/reference/starboard/modules/media.md
index 60ee90d..8d94612 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/media.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/media.md
@@ -27,6 +27,7 @@
 *   `kSbMediaAudioCodecNone`
 *   `kSbMediaAudioCodecAac`
 *   `kSbMediaAudioCodecAc3`
+*   `kSbMediaAudioCodecEac3`
 *   `kSbMediaAudioCodecOpus`
 *   `kSbMediaAudioCodecVorbis`
 
@@ -189,17 +190,25 @@
     `0` if this device cannot provide this information, in which case the caller
     can probably assume stereo output.
 
-### SbMediaAudioHeader ###
+### SbMediaAudioSampleInfo ###
 
-An audio sequence header, which is a description of a given audio stream. This,
-in hexadecimal string form, acts as a set of instructions to the audio decoder.
+An audio sample info, which is a description of a given audio sample. This, in
+hexadecimal string form, acts as a set of instructions to the audio decoder.
 
-The Sequence Header consists of a little-endian hexadecimal encoded
+The audio sample info consists of a little-endian hexadecimal encoded
 `WAVEFORMATEX` structure followed by an Audio-specific configuration field. The
 `WAVEFORMATEX` structure is specified at: [http://msdn.microsoft.com/en-us/library/dd390970(v=vs.85).aspx](http://msdn.microsoft.com/en-us/library/dd390970(v=vs.85).aspx)
 
 #### Members ####
 
+*   `SbMediaAudioCodec codec`
+
+    The audio codec of this sample.
+*   `const char * mime`
+
+    The mime of the audio stream when `codec` isn't kSbMediaAudioCodecNone. It
+    may point to an empty string if the mime is not available, and it can only
+    be set to NULL when `codec` is kSbMediaAudioCodecNone.
 *   `uint16_t format_tag`
 
     The waveform-audio format type code.
@@ -363,6 +372,26 @@
 
 #### Members ####
 
+*   `SbMediaVideoCodec codec`
+
+    The video codec of this sample.
+*   `const char * mime`
+
+    The mime of the video stream when `codec` isn't kSbMediaVideoCodecNone. It
+    may point to an empty string if the mime is not available, and it can only
+    be set to NULL when `codec` is kSbMediaVideoCodecNone.
+*   `const char * max_video_capabilities`
+
+    Indicates the max video capabilities required. The web app will not provide
+    a video stream exceeding the maximums described by this parameter. Allows
+    the platform to optimize playback pipeline for low quality video streams if
+    it knows that it will never adapt to higher quality streams. The string uses
+    the same format as the string passed in to SbMediaCanPlayMimeAndKeySystem(),
+    for example, when it is set to "width=1920; height=1080; framerate=15;", the
+    video will never adapt to resolution higher than 1920x1080 or frame per
+    second higher than 15 fps. When the maximums are unknown, this will be set
+    to an empty string. It can only be set to NULL when `codec` is
+    kSbMediaVideoCodecNone.
 *   `bool is_key_frame`
 
     Indicates whether the associated sample is a key frame (I-frame). Video key
@@ -377,7 +406,7 @@
     The frame height of this sample, in pixels. Also could be parsed from the
     Sequence Parameter Set (SPS) NAL Unit. Frame dimensions must only change on
     key frames, but may change on any key frame.
-*   `SbMediaColorMetadata* color_metadata`
+*   `SbMediaColorMetadata color_metadata`
 
     HDR metadata common for HDR10 and WebM/VP9-based HDR formats as well as the
     Color Space, and Color elements: MatrixCoefficients, BitsPerChannel,
@@ -654,6 +683,24 @@
 bool SbMediaIsSupported(SbMediaVideoCodec video_codec, SbMediaAudioCodec audio_codec, const char *key_system)
 ```
 
+### SbMediaSetAudioWriteDuration ###
+
+Communicate to the platform how far past `current_playback_position` the app
+will write audio samples. The app will write all samples between
+`current_playback_position` and `current_playback_position` + `duration`, as
+soon as they are available. The app may sometimes write more samples than that,
+but the app only guarantees to write `duration` past `current_playback_position`
+in general. The platform is responsible for guaranteeing that when only
+`duration` audio samples are written at a time, no playback issues occur (such
+as transient or indefinite hanging). The platform may assume `duration` >= 0.5
+seconds.
+
+#### Declaration ####
+
+```
+void SbMediaSetAudioWriteDuration(SbTime duration)
+```
+
 ### SbMediaSetOutputProtection ###
 
 Enables or disables output copy protection on all capable outputs. If enabled,
diff --git a/src/cobalt/site/docs/reference/starboard/modules/memory.md b/src/cobalt/site/docs/reference/starboard/modules/memory.md
index 676bd44..a3fecb6 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/memory.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/memory.md
@@ -4,14 +4,12 @@
 ---
 
 Defines functions for memory allocation, alignment, copying, and comparing.
-
-## Porters ##
+Porters
 
 All of the "Unchecked" and "Free" functions must be implemented, but they should
 not be called directly. The Starboard platform wraps them with extra accounting
 under certain circumstances.
-
-## Porters and Application Developers ##
+Porters and Application Developers
 
 Nobody should call the "Checked", "Unchecked" or "Free" functions directly
 because that evades Starboard's memory tracking. In both port implementations
@@ -48,7 +46,7 @@
 
 ### SbMemoryAlignToPageSize ###
 
-Rounds `size` up to SB_MEMORY_PAGE_SIZE.
+Rounds `size` up to kSbMemoryPageSize.
 
 #### Declaration ####
 
diff --git a/src/cobalt/site/docs/reference/starboard/modules/mutex.md b/src/cobalt/site/docs/reference/starboard/modules/mutex.md
index 2081a74..58f1907 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/mutex.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/mutex.md
@@ -6,6 +6,12 @@
 Defines a mutually exclusive lock that can be used to coordinate with other
 threads.
 
+## Macros ##
+
+### SB_MUTEX_MAX_SIZE ###
+
+Max size of the SbMutex type.
+
 ## Enums ##
 
 ### SbMutexResult ###
@@ -24,6 +30,19 @@
 
     The mutex has already been destroyed.
 
+## Typedefs ##
+
+### SbMutex ###
+
+An opaque handle to a mutex type with reserved memory buffer of size
+SB_MUTEX_MAX_SIZE and aligned at void pointer type.
+
+#### Definition ####
+
+```
+typedef union SbMutex  SbMutex
+```
+
 ## Functions ##
 
 ### SbMutexAcquire ###
@@ -43,7 +62,8 @@
 ### SbMutexAcquireTry ###
 
 Acquires `mutex`, without blocking. The return value identifies the acquisition
-result. SbMutexes are not reentrant, so a recursive acquisition always fails.
+result. SbMutexes are not reentrant, so a recursive acquisition has undefined
+behavior.
 
 `mutex`: The mutex to be acquired.
 
@@ -69,7 +89,7 @@
 ### SbMutexDestroy ###
 
 Destroys a mutex. The return value indicates whether the destruction was
-successful.
+successful. Destroying a locked mutex results in undefined behavior.
 
 `mutex`: The mutex to be invalidated.
 
diff --git a/src/cobalt/site/docs/reference/starboard/modules/once.md b/src/cobalt/site/docs/reference/starboard/modules/once.md
index b226b4b..ce3c4d6 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/once.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/once.md
@@ -6,8 +6,25 @@
 Onces represent initializations that should only ever happen once per process,
 in a thread-safe way.
 
+## Macros ##
+
+### SB_ONCE_MAX_SIZE ###
+
+Max size of the SbOnceControl type.
+
 ## Typedefs ##
 
+### SbOnceControl ###
+
+An opaque handle to a once control type with reserved memory buffer of size
+SB_ONCE_MAX_SIZE and aligned at void pointer type.
+
+#### Definition ####
+
+```
+typedef union SbOnceControl  SbOnceControl
+```
+
 ### SbOnceInitRoutine ###
 
 Function pointer type for methods that can be called via the SbOnce() system.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/player.md b/src/cobalt/site/docs/reference/starboard/modules/player.md
index e952591..2f64632 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/player.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/player.md
@@ -33,16 +33,20 @@
 *   `kSbPlayerDecoderStateNeedsData`
 
     The decoder is asking for one more sample.
-*   `kSbPlayerDecoderStateBufferFull`
 
-    The decoder is not ready for any more samples, so do not send them. Note
-    that this enum value has been deprecated and the SbPlayer implementation
-    should no longer use this value.
-*   `kSbPlayerDecoderStateDestroyed`
+### SbPlayerSampleSideDataType ###
 
-    The player has been destroyed, and will send no more callbacks. Note that
-    this enum value has been deprecated and the SbPlayer implementation should
-    no longer use this value.
+Identify the type of side data accompanied with `SbPlayerSampleInfo`, as side
+data may come from multiple sources.
+
+#### Values ####
+
+*   `kMatroskaBlockAdditional`
+
+    The side data comes from the BlockAdditional data in the Matroska/Webm
+    container, as specified in [https://tools.ietf.org/id/draft-lhomme-cellar-matroska-03.html#rfc.section.7.3.39](https://tools.ietf.org/id/draft-lhomme-cellar-matroska-03.html#rfc.section.7.3.39)9) andnd [https://www.webmproject.org/docs/container/#BlockAdditional](https://www.webmproject.org/docs/container/#BlockAdditional)l)
+    . The first 8 bytes of the data contains the value of BlockAddID in big
+    endian format, followed by the content of BlockAdditional.
 
 ### SbPlayerState ###
 
@@ -116,19 +120,6 @@
 typedef void(* SbPlayerDecoderStatusFunc) (SbPlayer player, void *context, SbMediaType type, SbPlayerDecoderState state, int ticket)
 ```
 
-### SbPlayerEncryptedMediaInitDataEncounteredCB ###
-
-Callback to queue an encrypted event for initialization data encountered in
-media data. `init_data_type` should be a string matching one of the EME
-initialization data types : "cenc", "fairplay", "keyids", or "webm", `init_data`
-is the initialization data, and `init_data_length` is the length of the data.
-
-#### Definition ####
-
-```
-typedef void(* SbPlayerEncryptedMediaInitDataEncounteredCB) (SbPlayer player, void *context, const char *init_data_type, const unsigned char *init_data, unsigned int init_data_length)
-```
-
 ### SbPlayerErrorFunc ###
 
 Callback for player errors, that may set a `message`. `error`: indicates the
@@ -156,6 +147,37 @@
 
 ## Structs ##
 
+### SbPlayerCreationParam ###
+
+The playback related parameters to pass into SbPlayerCreate() and
+SbPlayerGetPreferredOutputMode().
+
+#### Members ####
+
+*   `SbDrmSystem drm_system`
+
+    Provides an appropriate DRM system if the media stream has encrypted
+    portions. It will be `kSbDrmSystemInvalid` if the stream does not have
+    encrypted portions.
+*   `SbMediaAudioSampleInfo audio_sample_info`
+
+    Contains a populated SbMediaAudioSampleInfo if `audio_sample_info.codec`
+    isn't `kSbMediaAudioCodecNone`. When `audio_sample_info.codec` is
+    `kSbMediaAudioCodecNone`, the video doesn't have an audio track.
+*   `SbMediaVideoSampleInfo video_sample_info`
+
+    Contains a populated SbMediaVideoSampleInfo if `video_sample_info.codec`
+    isn't `kSbMediaVideoCodecNone`. When `video_sample_info.codec` is
+    `kSbMediaVideoCodecNone`, the video is audio only.
+*   `SbPlayerOutputMode output_mode`
+
+    Selects how the decoded video frames will be output. For example,
+    `kSbPlayerOutputModePunchOut` indicates that the decoded video frames will
+    be output to a background video layer by the platform, and
+    `kSbPlayerOutputDecodeToTexture` indicates that the decoded video frames
+    should be made available for the application to pull via calls to
+    SbPlayerGetCurrentFrame().
+
 ### SbPlayerInfo2 ###
 
 Information about the current media playback state.
@@ -206,12 +228,6 @@
     is at normal speed. When it is greater than one, the video is played in a
     faster than normal speed. When it is less than one, the video is played in a
     slower than normal speed. Negative speeds are not supported.
-*   `SbTime buffer_start_timestamp`
-
-    The position of the buffer head, as precisely as possible, in microseconds.
-*   `SbTime buffer_duration`
-
-    The known duration of the currently playing media buffer, in microseconds.
 
 ### SbPlayerSampleInfo ###
 
@@ -219,6 +235,7 @@
 
 #### Members ####
 
+*   `SbMediaType type`
 *   `const void * buffer`
 
     Points to the buffer containing the sample data.
@@ -228,50 +245,119 @@
 *   `SbTime timestamp`
 
     The timestamp of the sample in SbTime.
-*   `constSbMediaVideoSampleInfo* video_sample_info`
+*   `SbPlayerSampleSideData* side_data`
 
-    Information about a video sample. This value is required for video samples.
-    Otherwise, it must be `NULL`.
+    Points to an array of side data for the input, when available.
+*   `int side_data_count`
+
+    The number of side data pointed by `side_data`. It should be set to 0 if
+    there is no side data for the input.
+*   `SbMediaAudioSampleInfo audio_sample_info`
+
+    Information about an audio sample. This value can only be used when `type`
+    is kSbMediaTypeAudio.
+*   `SbMediaVideoSampleInfo video_sample_info`
+
+    Information about a video sample. This value can only be used when `type` is
+    kSbMediaTypeVideo.
+*   `union SbPlayerSampleInfo::@0 @1`
 *   `constSbDrmSampleInfo* drm_info`
 
     The DRM system related info for the media sample. This value is required for
     encrypted samples. Otherwise, it must be `NULL`.
 
+### SbPlayerSampleSideData ###
+
+Side data accompanied with `SbPlayerSampleInfo`, it can be arbitrary binary data
+coming from multiple sources.
+
+#### Members ####
+
+*   `SbPlayerSampleSideDataType type`
+*   `const uint8_t * data`
+
+    `data` will remain valid until SbPlayerDeallocateSampleFunc() is called on
+    the `SbPlayerSampleInfo::buffer` the data is associated with.
+*   `size_t size`
+
+    The size of the data pointed by `data`, in bytes.
+
 ## Functions ##
 
-### SbPlayerCreateWithUrl ###
+### SbPlayerCreate ###
 
-Creates a URL-based SbPlayer that will be displayed on `window` for the
-specified URL `url`, acquiring all resources needed to operate it, and returning
-an opaque handle to it. The expectation is that a new player will be created and
-destroyed for every playback.
+Creates a player that will be displayed on `window` for the specified
+`video_codec` and `audio_codec`, acquiring all resources needed to operate it,
+and returning an opaque handle to it. The expectation is that a new player will
+be created and destroyed for every playback.
 
-In many ways this function is similar to SbPlayerCreate, but it is missing the
-input arguments related to the configuration and format of the audio and video
-stream, as well as the DRM system. The DRM system for a player created with
-SbPlayerCreateWithUrl can be set after creation using SbPlayerSetDrmSystem.
-Because the DRM system is not available at the time of SbPlayerCreateWithUrl, it
-takes in a callback, `encrypted_media_init_data_encountered_cb`, which is run
-when encrypted media initial data is encountered.If the callback is `NULL`, then
-`kSbPlayerInvalid` must be returned.
+This function returns the created player. Note the following:
+
+*   The associated decoder of the returned player should be assumed to not be in
+    `kSbPlayerDecoderStateNeedsData` until SbPlayerSeek() has been called on it.
+
+*   It is expected either that the thread that calls SbPlayerCreate is the same
+    thread that calls the other `SbPlayer` functions for that player, or that
+    there is a mutex guarding calls into each `SbPlayer` instance.
+
+*   If there is a platform limitation on how many players can coexist
+    simultaneously, then calls made to this function that attempt to exceed that
+    limit must return `kSbPlayerInvalid`. Multiple calls to SbPlayerCreate must
+    not cause a crash.
+
+`window`: The window that will display the player. `window` can be
+`kSbWindowInvalid` for platforms where video is only displayed on a particular
+window that the underlying implementation already has access to.
+
+`video_codec`: The video codec used for the player. If `video_codec` is
+`kSbMediaVideoCodecNone`, the player is an audio-only player. If `video_codec`
+is any other value, the player is an audio/video decoder. This can be set to
+`kSbMediaVideoCodecNone` to play a video with only an audio track.
+
+`audio_codec`: The audio codec used for the player. The caller must provide a
+populated `audio_sample_info` if audio codec is `kSbMediaAudioCodecAac`. Can be
+set to `kSbMediaAudioCodecNone` to play a video without any audio track. In such
+case `audio_sample_info` must be NULL.
+
+`drm_system`: If the media stream has encrypted portions, then this parameter
+provides an appropriate DRM system, created with `SbDrmCreateSystem()`. If the
+stream does not have encrypted portions, then `drm_system` may be
+`kSbDrmSystemInvalid`. `audio_sample_info`: Note that the caller must provide a
+populated `audio_sample_info` if the audio codec is `kSbMediaAudioCodecAac`.
+Otherwise, `audio_sample_info` can be NULL. See media.h for the format of the
+`SbMediaAudioSampleInfo` struct. Note that `audio_specific_config` is a pointer
+and the content it points to is no longer valid after this function returns. The
+implementation has to make a copy of the content if it is needed after the
+function returns. `max_video_capabilities`: This string communicates the max
+video capabilities required to the platform. The web app will not provide a
+video stream exceeding the maximums described by this parameter. Allows the
+platform to optimize playback pipeline for low quality video streams if it knows
+that it will never adapt to higher quality streams. The string uses the same
+format as the string passed in to SbMediaCanPlayMimeAndKeySystem(), for example,
+when it is set to "width=1920; height=1080; framerate=15;", the video will never
+adapt to resolution higher than 1920x1080 or frame per second higher than 15
+fps. When the maximums are unknown, this will be set to NULL.
 
 #### Declaration ####
 
 ```
-SbPlayer SbPlayerCreateWithUrl(const char *url, SbWindow window, SbPlayerStatusFunc player_status_func, SbPlayerEncryptedMediaInitDataEncounteredCB encrypted_media_init_data_encountered_cb, SbPlayerErrorFunc player_error_func, void *context)
+SbPlayer SbPlayerCreate(SbWindow window, const SbPlayerCreationParam *creation_param, SbPlayerDeallocateSampleFunc sample_deallocate_func, SbPlayerDecoderStatusFunc decoder_status_func, SbPlayerStatusFunc player_status_func, SbPlayerErrorFunc player_error_func, void *context, SbDecodeTargetGraphicsContextProvider *context_provider)
 ```
 
 ### SbPlayerDestroy ###
 
-Destroys `player`, freeing all associated resources. Each callback must receive
-one more callback to say that the player was destroyed. Callbacks may be in-
-flight when SbPlayerDestroy is called, and should be ignored once this function
-is called.
+Destroys `player`, freeing all associated resources.
 
-It is not allowed to pass `player` into any other `SbPlayer` function once
-SbPlayerDestroy has been called on that player.
+*   Upon calling this method, there should be one call to the player status
+    callback (i.e. `player_status_func` used in the creation of the player)
+    which indicates the player is destroyed. Note, the callback has to be in-
+    flight when SbPlayerDestroyed is called.
 
-`player`: The player to be destroyed.
+*   No more other callbacks should be issued after this function returns.
+
+*   It is not allowed to pass `player` into any other `SbPlayer` function once
+    SbPlayerDestroy has been called on that player. `player`: The player to be
+    destroyed.
 
 #### Declaration ####
 
@@ -329,6 +415,30 @@
 int SbPlayerGetMaximumNumberOfSamplesPerWrite(SbPlayer player, SbMediaType sample_type)
 ```
 
+### SbPlayerGetPreferredOutputMode ###
+
+Returns the preferred output mode of the implementation when a video described
+by `creation_param` is played. It is assumed that it is okay to call
+SbPlayerCreate() with the same video described by `creation_param`, with its
+`output_mode` member replaced by the returned output mode. When the caller has
+no preference on the output mode, it will set `creation_param->output_mode` to
+`kSbPlayerOutputModeInvalid`, and the implementation can return its preferred
+output mode based on the information contained in `creation_param`. The caller
+can also set `creation_param->output_mode` to its preferred output mode, and the
+implementation should return the same output mode if it is supported, otherwise
+the implementation should return an output mode that it is supported, as if
+`creation_param->output_mode` is set to `kSbPlayerOutputModeInvalid` prior to
+the call. Note that it is not the responsibility of this function to verify
+whether the video described by `creation_param` can be played on the platform,
+and the implementation should try its best effort to return a valid output mode.
+`creation_param` will never be NULL.
+
+#### Declaration ####
+
+```
+SbPlayerOutputMode SbPlayerGetPreferredOutputMode(const SbPlayerCreationParam *creation_param)
+```
+
 ### SbPlayerIsValid ###
 
 Returns whether the given player handle is valid.
@@ -339,18 +449,6 @@
 static bool SbPlayerIsValid(SbPlayer player)
 ```
 
-### SbPlayerOutputModeSupportedWithUrl ###
-
-Returns true if the given URL player output mode is supported by the platform.
-If this function returns true, it is okay to call SbPlayerCreate() with the
-given `output_mode`.
-
-#### Declaration ####
-
-```
-bool SbPlayerOutputModeSupportedWithUrl(SbPlayerOutputMode output_mode)
-```
-
 ### SbPlayerSetBounds ###
 
 Sets the player bounds to the given graphics plane coordinates. The changes do
@@ -378,17 +476,6 @@
 void SbPlayerSetBounds(SbPlayer player, int z_index, int x, int y, int width, int height)
 ```
 
-### SbPlayerSetDrmSystem ###
-
-Sets the DRM system of a running URL-based SbPlayer created with
-SbPlayerCreateWithUrl. This may only be run once for a given SbPlayer.
-
-#### Declaration ####
-
-```
-void SbPlayerSetDrmSystem(SbPlayer player, SbDrmSystem drm_system)
-```
-
 ### SbPlayerSetPlaybackRate ###
 
 Set the playback rate of the `player`. `rate` is default to 1.0 which indicates
@@ -441,42 +528,15 @@
 
 ### SbPlayerWriteSample2 ###
 
-Writes a single sample of the given media type to `player`'s input stream. Its
-data may be passed in via more than one buffers. The lifetime of
-`sample_buffers`, `sample_buffer_sizes`, `video_sample_info`, and
-`sample_drm_info` (as well as member `subsample_mapping` contained inside it)
-are not guaranteed past the call to SbPlayerWriteSample. That means that before
-returning, the implementation must synchronously copy any information it wants
-to retain from those structures.
-
-`player`: The player to which the sample is written. `sample_type`: The type of
-sample being written. See the `SbMediaType` enum in media.h. `sample_buffers`: A
-pointer to an array of buffers with `number_of_sample_buffers` elements that
-hold the data for this sample. The buffers are expected to be a portion of a
-bytestream of the codec type that the player was created with. The buffers
-should contain a sequence of whole NAL Units for video, or a complete audio
-frame. `sample_buffers` cannot be assumed to live past the call into
-SbPlayerWriteSample(), so it must be copied if its content will be used after
-SbPlayerWriteSample() returns. `sample_buffer_sizes`: A pointer to an array of
-sizes with `number_of_sample_buffers` elements. Each of them specify the number
-of bytes in the corresponding buffer contained in `sample_buffers`. None of them
-can be 0. `sample_buffer_sizes` cannot be assumed to live past the call into
-SbPlayerWriteSample(), so it must be copied if its content will be used after
-SbPlayerWriteSample() returns. `number_of_sample_buffers`: Specify the number of
-elements contained inside `sample_buffers` and `sample_buffer_sizes`. It has to
-be at least one, or the call will be ignored. `sample_pts`: The timestamp of the
-sample in 90KHz ticks (PTS). Note that samples MAY be written "slightly" out of
-order. `video_sample_info`: Information about a video sample. This value is
-required if `sample_type` is `kSbMediaTypeVideo`. Otherwise, it must be `NULL`.
-`sample_drm_info`: The DRM system related info for the media sample. This value
-is required for encrypted samples. Otherwise, it must be `NULL`.Writes samples
-of the given media type to `player`'s input stream. The lifetime of
-`sample_infos`, and the members of its elements like `buffer`,
+Writes samples of the given media type to `player`'s input stream. The lifetime
+of `sample_infos`, and the members of its elements like `buffer`,
 `video_sample_info`, and `drm_info` (as well as member `subsample_mapping`
 contained inside it) are not guaranteed past the call to SbPlayerWriteSample2.
 That means that before returning, the implementation must synchronously copy any
 information it wants to retain from those structures.
 
+SbPlayerWriteSample2 allows writing of multiple samples in one call.
+
 `player`: The player to which the sample is written. `sample_type`: The type of
 sample being written. See the `SbMediaType` enum in media.h. `sample_infos`: A
 pointer to an array of SbPlayerSampleInfo with `number_of_sample_infos`
diff --git a/src/cobalt/site/docs/reference/starboard/modules/queue.md b/src/cobalt/site/docs/reference/starboard/modules/queue.md
deleted file mode 100644
index 6fdf231..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/queue.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: queue.h"
----
-
-Defines a C++-only synchronized queue implementation, built entirely on top of
-Starboard synchronization primitives. It can be safely used by both clients and
-implementations.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/socket.md b/src/cobalt/site/docs/reference/starboard/modules/socket.md
index 2098939..2bfb614 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/socket.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/socket.md
@@ -348,6 +348,16 @@
 bool SbSocketIsConnectedAndIdle(SbSocket socket)
 ```
 
+### SbSocketIsIpv6Supported ###
+
+Returns whether IPV6 is supported on the current platform.
+
+#### Declaration ####
+
+```
+bool SbSocketIsIpv6Supported()
+```
+
 ### SbSocketIsValid ###
 
 Returns whether the given socket handle is valid.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/speech_recognizer.md b/src/cobalt/site/docs/reference/starboard/modules/speech_recognizer.md
index 7755e5b..0a1dc6b 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/speech_recognizer.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/speech_recognizer.md
@@ -218,6 +218,16 @@
 void SbSpeechRecognizerDestroy(SbSpeechRecognizer recognizer)
 ```
 
+### SbSpeechRecognizerIsSupported ###
+
+Returns whether the platform supports SbSpeechRecognizer.
+
+#### Declaration ####
+
+```
+bool SbSpeechRecognizerIsSupported()
+```
+
 ### SbSpeechRecognizerIsValid ###
 
 Indicates whether the given speech recognizer is valid.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/speech_synthesis.md b/src/cobalt/site/docs/reference/starboard/modules/speech_synthesis.md
index 2074650..39bdec2 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/speech_synthesis.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/speech_synthesis.md
@@ -23,6 +23,16 @@
 void SbSpeechSynthesisCancel()
 ```
 
+### SbSpeechSynthesisIsSupported ###
+
+Returns whether the platform supports speech synthesis
+
+#### Declaration ####
+
+```
+bool SbSpeechSynthesisIsSupported()
+```
+
 ### SbSpeechSynthesisSpeak ###
 
 Enqueues `text`, a UTF-8 string, to be spoken. Returns immediately.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/spin_lock.md b/src/cobalt/site/docs/reference/starboard/modules/spin_lock.md
deleted file mode 100644
index dc1989d..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/spin_lock.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: spin_lock.h"
----
-
-Defines a C++-only spin-lock implementation, built entirely on top of Starboard
-atomics and threads. It can be safely used by both clients and implementations.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/storage.md b/src/cobalt/site/docs/reference/starboard/modules/storage.md
index a2afdf5..c98207b 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/storage.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/storage.md
@@ -149,9 +149,7 @@
 `SbStorageCloseRecord()` is called.
 
 `record`: The record to be written to. `data`: The data to write to the record.
-`data_size`: The amount of `data`, in bytes, to write to the record. Thus, if
-`data_size` is smaller than the total size of `data`, only part of `data` is
-written to the record.
+`data_size`: The amount of `data`, in bytes, to write to the record.
 
 #### Declaration ####
 
diff --git a/src/cobalt/site/docs/reference/starboard/modules/system.md b/src/cobalt/site/docs/reference/starboard/modules/system.md
index 5958fb9..e2b07d4 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/system.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/system.md
@@ -6,12 +6,6 @@
 Defines a broad set of APIs that allow the client application to query build and
 runtime properties of the enclosing system.
 
-## Macros ##
-
-### kSbSystemPlatformErrorInvalid ###
-
-Well-defined value for an invalid `SbSystemPlatformError`.
-
 ## Enums ##
 
 ### SbSystemCapabilityId ###
@@ -124,6 +118,11 @@
 *   `kSbSystemPathExecutableFile`
 
     Full path to the executable file.
+*   `kSbSystemPathStorageDirectory`
+
+    Path to a directory for permanent file storage. Both read and write access
+    is required. This is where an app may store its persistent settings. The
+    location should be user agnostic if possible.
 
 ### SbSystemPlatformErrorResponse ###
 
@@ -188,9 +187,10 @@
 *   `kSbSystemPropertyModelYear`
 
     The year the device was launched, e.g. "2016".
-*   `kSbSystemPropertyNetworkOperatorName`
+*   `kSbSystemPropertySystemIntegratorName`
 
-    The name of the network operator that owns the target device, if applicable.
+    The corporate entity responsible for submitting the device to YouTube
+    certification and for the device maintenance/updates.
 *   `kSbSystemPropertyPlatformName`
 
     The name of the operating system and platform, suitable for inclusion in a
@@ -236,17 +236,6 @@
 typedef int SbSystemError
 ```
 
-### SbSystemPlatformError ###
-
-Opaque handle returned by `SbSystemRaisePlatformError` that can be passed to
-`SbSystemClearPlatformError`.
-
-#### Definition ####
-
-```
-typedef SbSystemPlatformErrorPrivate* SbSystemPlatformError
-```
-
 ### SbSystemPlatformErrorCallback ###
 
 Type of callback function that may be called in response to an error
@@ -304,20 +293,6 @@
 void SbSystemClearLastError()
 ```
 
-### SbSystemClearPlatformError ###
-
-Clears a platform error that was previously raised by a call to
-`SbSystemRaisePlatformError`. The platform may use this, for example, to close a
-dialog that was opened in response to the error.
-
-`handle`: The platform error to be cleared.
-
-#### Declaration ####
-
-```
-void SbSystemClearPlatformError(SbSystemPlatformError handle)
-```
-
 ### SbSystemGetConnectionType ###
 
 Returns the device's current network connection type.
@@ -400,32 +375,6 @@
 int SbSystemGetNumberOfProcessors()
 ```
 
-### SbSystemGetPath ###
-
-Retrieves the platform-defined system path specified by `path_id` and places it
-as a zero-terminated string into the user-allocated `out_path` unless it is
-longer than `path_length` - 1. This implementation must be thread-safe.
-
-This function returns `true` if the path is retrieved successfully. It returns
-`false` under any of the following conditions and, in any such case, `out_path`
-is not changed:
-
-*   `path_id` is invalid for this platform
-
-*   `path_length` is too short for the given result
-
-*   `out_path` is NULL
-
-`path_id`: The system path to be retrieved. `out_path`: The platform-defined
-system path specified by `path_id`. `path_length`: The length of the system
-path.
-
-#### Declaration ####
-
-```
-bool SbSystemGetPath(SbSystemPathId path_id, char *out_path, int path_length)
-```
-
 ### SbSystemGetProperty ###
 
 Retrieves the platform-defined system property specified by `property_id` and
@@ -588,16 +537,6 @@
 bool SbSystemIsDebuggerAttached()
 ```
 
-### SbSystemPlatformErrorIsValid ###
-
-Checks whether a `SbSystemPlatformError` is valid.
-
-#### Declaration ####
-
-```
-static bool SbSystemPlatformErrorIsValid(SbSystemPlatformError handle)
-```
-
 ### SbSystemRaisePlatformError ###
 
 Cobalt calls this function to notify the platform that an error has occurred in
@@ -605,13 +544,8 @@
 to then notify the user of the error and to provide a means for any required
 interaction, such as by showing a dialog.
 
-The return value is a handle that may be used in a subsequent call to
-`SbSystemClearPlatformError`. For example, the handle could be used to
-programatically dismiss a dialog that was raised in response to the error. The
-lifetime of the object referenced by the handle is until the user reacts to the
-error or the error is dismissed by a call to SbSystemClearPlatformError,
-whichever happens first. Note that if the platform cannot respond to the error,
-then this function should return `kSbSystemPlatformErrorInvalid`.
+The return value is a boolean. If the platform cannot respond to the error, then
+this function should return `false`, otherwise it should return `true`.
 
 This function may be called from any thread, and it is the platform's
 responsibility to decide how to handle an error received while a previous error
@@ -628,7 +562,7 @@
 #### Declaration ####
 
 ```
-SbSystemPlatformError SbSystemRaisePlatformError(SbSystemPlatformErrorType type, SbSystemPlatformErrorCallback callback, void *user_data)
+bool SbSystemRaisePlatformError(SbSystemPlatformErrorType type, SbSystemPlatformErrorCallback callback, void *user_data)
 ```
 
 ### SbSystemRequestPause ###
@@ -701,6 +635,26 @@
 void SbSystemRequestUnpause()
 ```
 
+### SbSystemSignWithCertificationSecretKey ###
+
+Computes a HMAC-SHA256 digest of `message` into `digest` using the application's
+certification secret.
+
+This function may be implemented as an alternative to implementing
+SbSystemGetProperty(kSbSystemPropertyBase64EncodedCertificationSecret), however
+both should not be implemented.
+
+The output will be written into `digest`. `digest_size_in_bytes` must be 32 (or
+greater), since 32-bytes will be written into it. Returns false in the case of
+an error, or if it is not implemented. In this case the contents of `digest`
+will be undefined.
+
+#### Declaration ####
+
+```
+bool SbSystemSignWithCertificationSecretKey(const uint8_t *message, size_t message_size_in_bytes, uint8_t *digest, size_t digest_size_in_bytes)
+```
+
 ### SbSystemSort ###
 
 Sorts an array of elements `base`, with `element_count` elements of
diff --git a/src/cobalt/site/docs/reference/starboard/modules/thread.md b/src/cobalt/site/docs/reference/starboard/modules/thread.md
index 22b075b..8440477 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/thread.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/thread.md
@@ -7,6 +7,10 @@
 
 ## Macros ##
 
+### kSbThreadContextInvalid ###
+
+Well-defined value for an invalid thread context.
+
 ### kSbThreadInvalidId ###
 
 Well-defined constant value to mean "no thread ID."
@@ -19,6 +23,10 @@
 
 Well-defined constant value to mean "no affinity."
 
+### kSbThreadSamplerInvalid ###
+
+Well-defined value for an invalid thread sampler.
+
 ## Enums ##
 
 ### SbThreadPriority ###
@@ -73,6 +81,16 @@
 
 ## Typedefs ##
 
+### SbThread ###
+
+An opaque handle to a thread type.
+
+#### Definition ####
+
+```
+typedef void* SbThread
+```
+
 ### SbThreadAffinity ###
 
 Type for thread core affinity. This generally will be a single cpu (or core or
@@ -85,6 +103,16 @@
 typedef int32_t SbThreadAffinity
 ```
 
+### SbThreadContext ###
+
+A handle to the context of a frozen thread.
+
+#### Definition ####
+
+```
+typedef SbThreadContextPrivate* SbThreadContext
+```
+
 ### SbThreadEntryPoint ###
 
 Function pointer type for SbThreadCreate. `context` is a pointer-sized bit of
@@ -126,8 +154,40 @@
 typedef SbThreadLocalKeyPrivate* SbThreadLocalKey
 ```
 
+### SbThreadSampler ###
+
+A handle to a thread sampler.
+
+#### Definition ####
+
+```
+typedef SbThreadSamplerPrivate* SbThreadSampler
+```
+
 ## Functions ##
 
+### SbThreadContextGetPointer ###
+
+Gets the specified pointer-type `property` from the specified `context`. Returns
+`true` if successful and `out_value` has been modified, otherwise returns
+`false` and `out_value` is not modified.
+
+#### Declaration ####
+
+```
+bool SbThreadContextGetPointer(SbThreadContext context, SbThreadContextProperty property, void **out_value)
+```
+
+### SbThreadContextIsValid ###
+
+Returns whether the given thread context is valid.
+
+#### Declaration ####
+
+```
+static bool SbThreadContextIsValid(SbThreadContext context)
+```
+
 ### SbThreadCreate ###
 
 Creates a new thread, which starts immediately.
@@ -349,6 +409,77 @@
 bool SbThreadJoin(SbThread thread, void **out_return)
 ```
 
+### SbThreadSamplerCreate ###
+
+Creates a new thread sampler for the specified `thread`.
+
+If successful, this function returns the newly created handle. If unsuccessful,
+this function returns `kSbThreadSamplerInvalid`.
+
+#### Declaration ####
+
+```
+SbThreadSampler SbThreadSamplerCreate(SbThread thread)
+```
+
+### SbThreadSamplerDestroy ###
+
+Destroys the `sampler` and frees whatever resources it was using.
+
+#### Declaration ####
+
+```
+void SbThreadSamplerDestroy(SbThreadSampler sampler)
+```
+
+### SbThreadSamplerFreeze ###
+
+Suspends execution of the thread that `sampler` was created for.
+
+If successful, this function returns a `SbThreadContext` for the frozen thread,
+from which properties may be read while the thread remains frozen. If
+unsuccessful, this function returns `kSbThreadContextInvalid`.
+
+#### Declaration ####
+
+```
+SbThreadContext SbThreadSamplerFreeze(SbThreadSampler sampler)
+```
+
+### SbThreadSamplerIsSupported ###
+
+Whether the current platform supports thread sampling. The result of this
+function must not change over the course of the program, which means that the
+results of this function may be cached indefinitely. If this returns false,
+`SbThreadSamplerCreate` will return an invalid sampler.
+
+#### Declaration ####
+
+```
+bool SbThreadSamplerIsSupported()
+```
+
+### SbThreadSamplerIsValid ###
+
+Returns whether the given thread sampler is valid.
+
+#### Declaration ####
+
+```
+static bool SbThreadSamplerIsValid(SbThreadSampler sampler)
+```
+
+### SbThreadSamplerThaw ###
+
+Resumes execution of the thread that `sampler` was created for. This invalidates
+the context returned from `SbThreadSamplerFreeze`.
+
+#### Declaration ####
+
+```
+bool SbThreadSamplerThaw(SbThreadSampler sampler)
+```
+
 ### SbThreadSetLocalValue ###
 
 Sets the pointer-sized value for `key` in the currently executing thread's local
diff --git a/src/cobalt/site/docs/reference/starboard/modules/thread_types.md b/src/cobalt/site/docs/reference/starboard/modules/thread_types.md
deleted file mode 100644
index 5f4da0e..0000000
--- a/src/cobalt/site/docs/reference/starboard/modules/thread_types.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-layout: doc
-title: "Starboard Module Reference: thread_types.h"
----
-
-Defines platform-specific threading and synchronization primitive types and
-initializers. We hide, but pass through, the platform's primitives to avoid
-doing a lot of work to replicate initialization-less synchronization primitives.
diff --git a/src/cobalt/site/docs/reference/starboard/modules/time.md b/src/cobalt/site/docs/reference/starboard/modules/time.md
index bd59b91..17ea6ad 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/time.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/time.md
@@ -116,6 +116,16 @@
 SbTime SbTimeGetNow()
 ```
 
+### SbTimeIsTimeThreadNowSupported ###
+
+Returns whether the current platform supports time thread now
+
+#### Declaration ####
+
+```
+bool SbTimeIsTimeThreadNowSupported()
+```
+
 ### SbTimeNarrow ###
 
 Safely narrows a number from a more precise unit to a less precise one. This
diff --git a/src/cobalt/site/docs/reference/starboard/modules/ui_navigation.md b/src/cobalt/site/docs/reference/starboard/modules/ui_navigation.md
new file mode 100644
index 0000000..2239e79
--- /dev/null
+++ b/src/cobalt/site/docs/reference/starboard/modules/ui_navigation.md
@@ -0,0 +1,268 @@
+---
+layout: doc
+title: "Starboard Module Reference: ui_navigation.h"
+---
+
+API to allow applications to take advantage of the platform's native UI engine.
+This is mainly to drive the animation of visual elements and to signal which of
+those elements have focus. The implementation should not render any visual
+elements; instead, it will be used to guide the app in where these elements
+should be drawn.
+
+When the application creates the user interface, it will create SbUiNavItems for
+interactable elements. Additionally, the app must specify the position and size
+of these navigation items. As the app's user interface changes, it will create
+and destroy navigation items as appropriate.
+
+For each render frame, the app will query the local transform for each
+SbUiNavItem in case the native UI engine moves individual items in response to
+user interaction. If the navigation item is a container, then the content offset
+will also be queried to determine the placement of its content items.
+
+## Macros ##
+
+### kSbUiNavItemInvalid ###
+
+Well-defined value for an invalid navigation item.
+
+## Enums ##
+
+### SbUiNavItemType ###
+
+Navigation items may be one of the following types. This must be specified upon
+item creation and may not change during the item's lifespan.
+
+#### Values ####
+
+*   `kSbUiNavItemTypeFocus`
+
+    This is a single focusable item.
+*   `kSbUiNavItemTypeContainer`
+
+    This is a container of navigation items which can also be containers
+    themselves or focusable items. Containers themselves cannot be focused.
+
+## Typedefs ##
+
+### SbUiNavItem ###
+
+An opaque handle to an implementation-private structure representing a
+navigation item.
+
+#### Definition ####
+
+```
+typedef struct SbUiNavItemPrivate* SbUiNavItem
+```
+
+## Structs ##
+
+### SbUiNavCallbacks ###
+
+This structure specifies all the callbacks which the platform UI engine should
+invoke for various interaction events on navigation items. These callbacks may
+be invoked from any thread at any frequency. The `callback_context` is the value
+that was passed on creation of the relevant SbUiNavItem.
+
+#### Members ####
+
+*   `void(* onblur`
+
+    Invoke when an item has lost focus. This is only used with focus items.
+*   `void(* onfocus`
+
+    Invoke when an item has gained focus. This is only used with focus items.
+*   `void(* onscroll`
+
+    Invoke when an item's content offset is changed. This is only used with
+    container items.
+
+### SbUiNavInterface ###
+
+This structure declares the interface to the UI navigation implementation. All
+function pointers must be specified if the platform supports UI navigation.
+
+#### Members ####
+
+*   `SbUiNavItem(* create_item`
+
+    Create a new navigation item. When the user interacts with this item the
+    appropriate SbUiNavCallbacks function will be invoked with the provided
+    `callback_context`. An item is not interactable until it is enabled.
+*   `void(* destroy_item`
+
+    Destroy the given navigation item. If this is a content of another item,
+    then it will first be unregistered. Additionally, if this item contains
+    other items, then those will be unregistered as well, but they will not be
+    automatically destroyed.
+*   `void(* set_focus`
+
+    This is used to manually force focus on a navigation item of type
+    kSbUiNavItemTypeFocus. Any previously focused navigation item should receive
+    the blur event. If the item is not transitively a content of the root item,
+    then this does nothing.
+*   `void(* set_item_enabled`
+
+    This is used to enable or disable user interaction with the specified
+    navigation item. All navigation items are disabled when created, and they
+    must be explicitly enabled to allow user interaction. If a container is
+    disabled, then all of its contents are not interactable even though they
+    remain enabled. If `enabled` is false, it must be guaranteed that once this
+    function returns, no callbacks associated with this item will be invoked
+    until the item is re-enabled.
+*   `void(* set_item_dir`
+
+    This specifies directionality for container items. Containers within
+    containers do not inherit directionality. Directionality must be specified
+    for each container explicitly.
+*   `void(* set_item_size`
+
+    Set the interactable size of the specified navigation item. By default, an
+    item's size is (0,0).
+*   `void(* set_item_transform`
+
+    Set the transform for the navigation item and its contents if the item is a
+    container. This specifies the placement of the item's center within its
+    container. The transform origin is the center of the item. Distance is
+    measured in pixels with the origin being the top-left of the item's
+    container. By default, an item's transform is identity.
+*   `bool(* get_item_focus_transform`
+
+    Retrieve the focus transform matrix for the navigation item. The UI engine
+    may translate, rotate, and/or tilt focus items to reflect user interaction.
+    This transform should be multiplied with the item's transform to get its
+    position inside its container. The transform origin is the center of the
+    item. Return false if the item position should not be changed (i.e. the
+    transform should be treated as identity).
+*   `bool(* get_item_focus_vector`
+
+    Retrieve a vector representing the focus location within a focused item.
+    This is used to provide feedback about user input that is too small to
+    result in a focus change. If there is no focus vector for the navigation
+    item, then return false and leave `out_x` and `out_y` unchanged. Otherwise,
+    return true and set the output values in the range of [-1, +1] with (out_x,
+    out_y) of (-1, -1) being the top-left corner of the navigation item and (0,
+    0) being the center.
+*   `void(* set_item_container_window`
+
+    This attaches the given navigation item (which must be a container) to the
+    specified window. Navigation items are only interactable if they are
+    transitively attached to a window.
+
+    A navigation item may only have a SbUiNavItem or SbWindow as its direct
+    container. The navigation item hierarchy is established using
+    set_item_container_item() with the root container attached to a SbWindow
+    using set_item_container_window() to enable interaction with all enabled
+    items in the hierarchy.
+
+    If `item` is already registered with a different window, then this will
+    unregister it from that window then attach it to the given `window`. It is
+    an error to register more than one navigation item with any given window. If
+    `window` is kSbWindowInvalid, then this will unregister the `item` from its
+    current window if any. Upon destruction of `item` or `window`, the `item` is
+    automatically unregistered from the `window`.
+*   `void(* set_item_container_item`
+
+    A container navigation item may contain other navigation items. However, it
+    is an error to have circular containment or for `container` to not be of
+    type kSbUiNavItemTypeContainer. If `item` already has a different container,
+    then this first severs that connection. If `container` is
+    kSbUiNavItemInvalid, then this removes `item` from its current container.
+    Upon destruction of `item` or `container`, the `item` is automatically
+    removed from the `container`.
+
+    The position of items within a container are specified relative to the
+    container's position. The position of these content items are further
+    modified by the container's "content offset".
+
+    For example, consider item A with position (5,5) and content offset (0,0).
+    Given item B with position (10,10) is registered as a content of item A.
+
+    1.  Item B should be drawn at position (15,15).
+
+    1.  If item A's content offset is changed to (10,0), then item B should be
+        drawn at position (5,15).
+
+    Essentially, content items should be drawn at: [container position] +
+    [content position] - [container content offset]
+*   `void(* set_item_content_offset`
+
+    Set the current content offset for the given container. This may be used to
+    force scrolling to make certain content items visible. A container item's
+    content offset helps determine where its content items should be drawn.
+    Essentially, a content item should be drawn at: [container position] +
+    [content position] - [container content offset] If `item` is not a
+    container, then this does nothing. By default, the content offset is (0,0).
+*   `void(* get_item_content_offset`
+
+    Retrieve the current content offset for the navigation item. If `item` is
+    not a container, then the content offset is (0,0).
+
+### SbUiNavItemDir ###
+
+Navigation items of type kSbUiNavItemTypeContainer have directionality. If
+directionality is not specified for a container, it should default to left-to-
+right and top-to-bottom.
+
+For left-to-right, content offset x = 0 shows the leftmost content. `< –
+Container Size-->` +----------------- – +----------------- – +-----------------
+– + ` Not selectable. ` Selectable. ` Selectable. ` ` Offscreen. ` Onscreen. `
+Offscreen. ` ` Negative position. ` Positive position. ` Positive position. `
++----------------- – +----------------- – +----------------- – + ^ Content
+Offset X = 0.
+
+For right-to-left, content offset x = 0 shows the rightmost content. `< –
+Container Size-->` +----------------- – +----------------- – +-----------------
+– + ` Selectable. ` Selectable. ` Not selectable. ` ` Offscreen. ` Onscreen. `
+Offscreen. ` ` Negative position. ` Positive position. ` Positive position. `
++----------------- – +----------------- – +----------------- – + ^ Content
+Offset X = 0.
+
+Top-to-bottom is similar to left-to-right, but for the Y position. Bottom-to-top
+is similar to right-to-left, but for the Y position.
+
+#### Members ####
+
+*   `bool is_left_to_right`
+*   `bool is_top_to_bottom`
+
+### SbUiNavMatrix2x3 ###
+
+This represents a 2x3 transform matrix in row-major order. ` a b tx ` ` c d ty `
+
+#### Members ####
+
+*   `float m`
+
+### SbUiNavMatrix4 ###
+
+This represents a 4x4 transform matrix in row-major order.
+
+#### Members ####
+
+*   `float m`
+
+## Functions ##
+
+### SbUiNavGetInterface ###
+
+Retrieve the platform's UI navigation implementation. If the platform does not
+provide one, then return false without modifying `out_interface`. Otherwise,
+initialize all members of `out_interface` and return true.
+
+#### Declaration ####
+
+```
+bool SbUiNavGetInterface(SbUiNavInterface *out_interface)
+```
+
+### SbUiNavItemIsValid ###
+
+Returns whether the given navigation item handle is valid.
+
+#### Declaration ####
+
+```
+static bool SbUiNavItemIsValid(SbUiNavItem item)
+```
+
diff --git a/src/cobalt/site/docs/reference/starboard/modules/window.md b/src/cobalt/site/docs/reference/starboard/modules/window.md
index 9c84139..53cda4a 100644
--- a/src/cobalt/site/docs/reference/starboard/modules/window.md
+++ b/src/cobalt/site/docs/reference/starboard/modules/window.md
@@ -249,6 +249,28 @@
 static bool SbWindowIsValid(SbWindow window)
 ```
 
+### SbWindowOnScreenKeyboardIsSupported ###
+
+Return whether the current platform supports an on screen keyboard
+
+#### Declaration ####
+
+```
+bool SbWindowOnScreenKeyboardIsSupported()
+```
+
+### SbWindowOnScreenKeyboardSuggestionsSupported ###
+
+Determine if the on screen keyboard has suggestions implemented. If this returns
+false, then calling SbWindowUpdateOnScreenKeyboardSuggestions() will be
+undefined.
+
+#### Declaration ####
+
+```
+bool SbWindowOnScreenKeyboardSuggestionsSupported(SbWindow window)
+```
+
 ### SbWindowSetDefaultOptions ###
 
 Sets the default options for system windows.
@@ -293,3 +315,17 @@
 void SbWindowShowOnScreenKeyboard(SbWindow window, const char *input_text, int ticket)
 ```
 
+### SbWindowUpdateOnScreenKeyboardSuggestions ###
+
+Update the on screen keyboard custom suggestions. Fire
+kSbEventTypeOnScreenKeyboardSuggestionsUpdated.
+kSbEventTypeOnScreenKeyboardSuggestionsUpdated has data `ticket`. The
+suggestions should remain up-to-date when the keyboard is shown after being
+hidden.
+
+#### Declaration ####
+
+```
+void SbWindowUpdateOnScreenKeyboardSuggestions(SbWindow window, const char *suggestions[], int num_suggestions, int ticket)
+```
+
diff --git a/src/cobalt/site/docs/starboard/porting.md b/src/cobalt/site/docs/starboard/porting.md
index dfd630b..4c19ff2 100644
--- a/src/cobalt/site/docs/starboard/porting.md
+++ b/src/cobalt/site/docs/starboard/porting.md
@@ -54,24 +54,17 @@
     <family-name>-<binary-variant>
 
 For example, suppose a company named BobCo produces a variety of BobBox
-devices. Some of the devices use big-endian MIPS chips, while others use
-little-endian MIPS chips. BobCo might define two platform configurations:
+devices. Some of the devices use big-endian ARM chips, while others use
+little-endian ARM chips. BobCo might define two platform configurations:
 
-*   `bobbox-mipseb`
-*   `bobbox-mipsel`
+*   `bobbox-armeb`
+*   `bobbox-armel`
 
 In this example, `bobbox` is the family name and is used in both (all)
 of BobCo's platform configurations. The `binary-variant` for devices with
-big-endian MIPS chips is `mipseb`. For devices with little-endian MIPS chips,
-the `binary-variant` is `mipsel`.
+big-endian ARM chips is `armeb`. For devices with little-endian ARM chips,
+the `binary-variant` is `armel`.
 
-Starboard also supports sub-variant configurations to maximize your ability
-to share code between configurations. For example, if some of BobCo's devices
-that use little-endian chips use DirectFB, but other devices use OpenGL ES,
-BobCo could create two different configurations for little-endian chips:
-
-*   `bobbox-mipsel-dfb`
-*   `bobbox-mipsel-gles`
 
 ### 2. Add Source Tree Directories for your Starboard Port
 
@@ -95,16 +88,14 @@
     example, BobCo could create the following directories:
 
     *   `src/third_party/starboard/bobbox/shared/`
-    *   `src/third_party/starboard/bobbox/mipseb/`
-    *   `src/third_party/starboard/bobbox/mipsel/`
-    *   `src/third_party/starboard/bobbox/mipsel/dfb/`
-    *   `src/third_party/starboard/bobbox/mipsel/gles/`
+    *   `src/third_party/starboard/bobbox/armeb/`
+    *   `src/third_party/starboard/bobbox/armel/`
+    *   `src/third_party/starboard/bobbox/armel/gles/`
 
 Again, functions that work for all of the configurations would go in the
 `shared` directory. Functions that work for all little-endian devices would go
-in the `mipsel` directory. And functions specific to little-endian devices
-that use DirectFB or that use OpenGL ES would go in the `mipsel/dfb` or
-`mipsel/gles` directory.
+in the `armel` directory. And functions specific to little-endian devices
+that use OpenGL ES would go in the `armel/gles` directory.
 
 ### 3. Add required `binary-variant` files
 
@@ -279,7 +270,7 @@
 
     1.  Update the following properties in the `variables` dictionary:
         *   `target_arch` - Identifies your architecture. Supported values
-            are `arm`, `mips`, `ppc`, `x64`, and `x86`.
+            are `arm`, `x64`, and `x86`.
         *   `target_os` - Set to `linux` if your platform is Linux-based.
             Otherwise, remove this variable.
         *   `gl_type` - Set to `system_gles2` if you are using the system EGL
diff --git a/src/cobalt/system_window/system_window.cc b/src/cobalt/system_window/system_window.cc
index 8f726e9..f7cc85a 100644
--- a/src/cobalt/system_window/system_window.cc
+++ b/src/cobalt/system_window/system_window.cc
@@ -83,17 +83,22 @@
 #endif
 }
 
-float SystemWindow::GetVideoPixelRatio() const {
-  SbWindowSize window_size;
-  if (!SbWindowGetSize(window_, &window_size)) {
+float SystemWindow::GetDevicePixelRatio() const {
+  SbWindowSize size;
+  if (!SbWindowGetSize(window_, &size)) {
     DLOG(WARNING) << "SbWindowGetSize() failed.";
     return 1.0;
   }
-  return window_size.video_pixel_ratio;
+  // A value of 0.0 for the video pixel ratio means that the ratio could not be
+  // determined. In that case it should be assumed to be the same as the
+  // graphics resolution, which corresponds to a device pixel ratio of 1.0.
+  float device_pixel_ratio =
+      (size.video_pixel_ratio == 0) ? 1.0f : size.video_pixel_ratio;
+  return device_pixel_ratio;
 }
 
 math::Size SystemWindow::GetVideoOutputResolution() const {
-  float ratio = GetVideoPixelRatio();
+  float ratio = GetDevicePixelRatio();
   math::Size size = GetWindowSize();
   return math::Size(Round(size.width() * ratio), Round(size.height() * ratio));
 }
diff --git a/src/cobalt/system_window/system_window.h b/src/cobalt/system_window/system_window.h
index 5429229..255f6e3 100644
--- a/src/cobalt/system_window/system_window.h
+++ b/src/cobalt/system_window/system_window.h
@@ -42,14 +42,14 @@
   // screen. This is queried from the window_.
   float GetDiagonalSizeInches() const;
 
-  // video pixel ratio = resolution of video output / resolution of window.  Its
+  // device pixel ratio = resolution of video output / resolution of window. Its
   // value is usually 1.0.  Set it to a value greater than 1.0 allows the video
   // to be played in higher resolution than the window.
-  float GetVideoPixelRatio() const;
+  float GetDevicePixelRatio() const;
 
   // Returns the resolution of the video output size, which may be different
   // from the window size. This will generally be GetWindowSize() multiplied by
-  // GetVideoPixelRatio().
+  // GetDevicePixelRatio().
   math::Size GetVideoOutputResolution() const;
 
   base::EventDispatcher* event_dispatcher() const { return event_dispatcher_; }
diff --git a/src/cobalt/updater/configurator.cc b/src/cobalt/updater/configurator.cc
index b505f9a..d626083 100644
--- a/src/cobalt/updater/configurator.cc
+++ b/src/cobalt/updater/configurator.cc
@@ -109,14 +109,18 @@
 std::string Configurator::GetBrand() const { return {}; }
 
 std::string Configurator::GetLang() const {
-  std::string locale_id(SbSystemGetLocaleId());
+  const char* locale_id = SbSystemGetLocaleId();
+  if (!locale_id) {
+    return "";
+  }
+  std::string locale_string(locale_id);
   // POSIX platforms put time zone id at the end of the locale id, like
   // |en_US.UTF8|. We remove the time zone id.
-  int first_dot = locale_id.find_first_of(".");
+  int first_dot = locale_string.find_first_of(".");
   if (first_dot != std::string::npos) {
-    return locale_id.substr(0, first_dot);
+    return locale_string.substr(0, first_dot);
   }
-  return locale_id;
+  return locale_string;
 }
 
 std::string Configurator::GetOSLongName() const {
diff --git a/src/cobalt/updater/updater.gyp b/src/cobalt/updater/updater.gyp
index 4b3d57b..eed5845 100644
--- a/src/cobalt/updater/updater.gyp
+++ b/src/cobalt/updater/updater.gyp
@@ -69,6 +69,17 @@
       ],
     },
     {
+      'target_name': 'updater_sandbox_deploy',
+      'type': 'none',
+      'dependencies': [
+        'updater_sandbox',
+      ],
+      'variables': {
+        'executable_name': 'updater_sandbox',
+      },
+      'includes': [ '<(DEPTH)/starboard/build/deploy.gypi' ],
+    },
+    {
       'target_name': 'crash_sandbox',
       'type': '<(final_executable_type)',
       'dependencies': [
@@ -79,6 +90,17 @@
       ],
     },
     {
+      'target_name': 'crash_sandbox_deploy',
+      'type': 'none',
+      'dependencies': [
+        'crash_sandbox',
+      ],
+      'variables': {
+        'executable_name': 'crash_sandbox',
+      },
+      'includes': [ '<(DEPTH)/starboard/build/deploy.gypi' ],
+    },
+    {
       'target_name': 'noop_sandbox',
       'type': '<(final_executable_type)',
       'dependencies': [
@@ -88,5 +110,16 @@
         'noop_sandbox.cc',
       ],
     },
+    {
+      'target_name': 'noop_sandbox_deploy',
+      'type': 'none',
+      'dependencies': [
+        'noop_sandbox',
+      ],
+      'variables': {
+        'executable_name': 'noop_sandbox',
+      },
+      'includes': [ '<(DEPTH)/starboard/build/deploy.gypi' ],
+    },
   ]
 }
diff --git a/src/starboard/CHANGELOG.md b/src/starboard/CHANGELOG.md
index 5575e52..34bdb7c 100644
--- a/src/starboard/CHANGELOG.md
+++ b/src/starboard/CHANGELOG.md
@@ -208,6 +208,13 @@
 
 ### Enables a test that checks that Opus is supported.
 
+### Add `kSbSystemPropertySystemIntegratorName`
+
+This change also deprecates `kSbSystemPropertyOriginalDesignManufacturerName`.
+The `kSbSystemPropertySystemIntegratorName` value will represent the corporate
+entity responsible for submitting the device to YouTube certification and for
+the device maintenance/updates.
+
 ### Deprecated the Blitter API.
 
 Blitter API is no longer supported on any platform. Use the OpenGL ES
diff --git a/src/starboard/README.md b/src/starboard/README.md
index c5f3be7..75a97cd 100644
--- a/src/starboard/README.md
+++ b/src/starboard/README.md
@@ -63,11 +63,11 @@
 configurations.
 
 All the BobCo devices are called BobBox, so it's a reasonable choice as a
-product `<family-name>`. But they have both big- and little-endian MIPS
+product `<family-name>`. But they have both big- and little-endian ARM
 chips. So they might define two platform configurations:
 
-  1. `bobbox-mipseb` - For big-endian MIPS devices.
-  1. `bobbox-mipsel` - For little-endian MIPS devices.
+  1. `bobbox-armeb` - For big-endian ARM devices.
+  1. `bobbox-armel` - For little-endian ARM devices.
 
 
 ### II. Choose a Location in the Source Tree for Your Starboard Port
@@ -99,14 +99,14 @@
 
   * `src/third_party/starboard/bobbox/`
       * `shared/`
-      * `mipseb/`
+      * `armeb/`
           * `atomic_public.h`
           * `configuration_public.h`
           * `gyp_configuration.gypi`
           * `gyp_configuration.py`
           * `starboard_platform.gyp`
           * `thread_types_public.h`
-      * `mipsel/`
+      * `armel/`
           * `atomic_public.h`
           * `configuration_public.h`
           * `gyp_configuration.gypi`
@@ -126,14 +126,14 @@
 
   * `src/third_party/starboard/bobbox/`
       * `shared/`
-      * `mipseb/`
+      * `armeb/`
           * `buildconfig.gni`
           * `configuration.gni`
           * `atomic_public.h`
           * `BUILD.gn`
           * `configuration_public.h`
           * `thread_types_public.h`
-      * `mipsel/`
+      * `armel/`
           * `buildconfig.gni`
           * `configuration.gni`
           * `atomic_public.h`
@@ -164,10 +164,10 @@
 You may also choose to copy either the Desktop Linux or Raspberry Pi ports and
 work backwards fixing things that don't compile or work on your platform.
 
-For example, for `bobbox-mipsel`, you might do:
+For example, for `bobbox-armel`, you might do:
 
     mkdir -p src/third_party/starboard/bobbox
-    cp -R src/starboard/stub src/third_party/starboard/bobbox/mipsel
+    cp -R src/starboard/stub src/third_party/starboard/bobbox/armel
 
 Modify the files in `<binary-variant>/` as appropriate (you will probably be
 coming back to these files a lot).
@@ -185,8 +185,8 @@
 `thread_types_public.h`. `gyp_cobalt` will scan your directories for these
 files, and then calculate a port name based on the directories between
 `src/third_party/starboard` and your `gyp_configuration.*` files. (e.g. for
-`src/third_party/starboard/bobbox/mipseb/gyp_configuration.py`, it would choose
-the platform configuration name `bobbox-mipseb`.)
+`src/third_party/starboard/bobbox/armeb/gyp_configuration.py`, it would choose
+the platform configuration name `bobbox-armeb`.)
 
 #### GN Instructions
 
@@ -205,8 +205,8 @@
 build will scan your directories for these files, and then calculate a port name
 based on the directories between `src/third_party/starboard` and your
 `configuration.gni` files. (e.g. for
-`src/third_party/starboard/bobbox/mipseb/configuration.gni`, it would choose the
-platform configuration name `bobbox-mipseb`.)
+`src/third_party/starboard/bobbox/armeb/configuration.gni`, it would choose the
+platform configuration name `bobbox-armeb`.)
 
 
 ### IV. A New Port, Step-by-Step
@@ -218,7 +218,7 @@
   1. In `gyp_configuration.py`
       1. In the `CreatePlatformConfig()` function, pass your
          `<platform-configuration>` as the parameter to the PlatformConfig
-         constructor, like `return PlatformConfig('bobbox-mipseb')`.
+         constructor, like `return PlatformConfig('bobbox-armeb')`.
       1. In `GetVariables`
           1. Set `'clang': 1` if your toolchain is clang.
           1. Delete other variables in that function that are not needed for
@@ -231,8 +231,8 @@
          configuration name, where `<build-type>` is one of `debug`, `devel`,
          `qa`, `gold`.
       1. Update your platform variables.
-          1. Set `'target_arch'` to your architecture: `'arm'`, `'ppc'`,
-             `'x64'`, `'x86'`, `'mips'`
+          1. Set `'target_arch'` to your architecture: `'arm'`,
+             `'x64'`, `'x86'`
           1. Set `'target_os': 'linux'` if your platform is Linux-based.
           1. Set `'gl_type': 'system_gles2'` if you are using the system EGL +
              GLES2 implementation.
@@ -255,8 +255,8 @@
 
 You should now be able to run gyp with your new port. From your `src/` directory:
 
-    $ cobalt/build/gyp_cobalt -C debug bobbox-mipseb
-    $ ninja -C out/bobbox-mipseb_debug nplb
+    $ cobalt/build/gyp_cobalt -C debug bobbox-armeb
+    $ ninja -C out/bobbox-armeb_debug nplb
 
 This will attempt to build the "No Platform Left Behind" test suite with your
 new Starboard implementation, and you are ready to start porting!
@@ -275,8 +275,8 @@
       1. If you're not using a predefined toolchain, define one.
   1. In `buildconfig.gni`:
       1. If your platform is Linux-based, set `target_os_ = "linux"`.
-      1. Set `target_cpu_` to your target architecture (e.g. `arm`, `ppc`,
-         `x64`, `x86`, `mips`).
+      1. Set `target_cpu_` to your target architecture (e.g. `arm`,
+         `x64`, `x86`).
       1. Set the target and host toolchains. If you defined a target
          toolchain in `BUILD.gn`, you'll want to set it to that.
   1. In `configuration.gni`, set platform-specific defaults for any
@@ -287,16 +287,16 @@
 
 You should now be able to run GN with your new port. From your `src/` directory:
 
-    $ gn args out/bobbox-mipseb_debug
+    $ gn args out/bobbox-armeb_debug
 
 An editor will open up. Type into the editor:
 
     cobalt_config = "debug"
-    target_platform = "bobbox-mipseb"
+    target_platform = "bobbox-armeb"
 
 Save and close the editor. Then run
 
-    $ ninja -C out/bobbox-mipseb_debug nplb
+    $ ninja -C out/bobbox-armeb_debug nplb
 
 This will attempt to build the "No Platform Left Behind" test suite with your
 new Starboard implementation, and you are ready to start porting!
diff --git a/src/starboard/android/apk/app/build.gradle b/src/starboard/android/apk/app/build.gradle
index d166cce..fdf3b29 100644
--- a/src/starboard/android/apk/app/build.gradle
+++ b/src/starboard/android/apk/app/build.gradle
@@ -40,8 +40,8 @@
 println "TARGET: ${cobaltTarget}"
 
 android {
-    compileSdkVersion 'android-R'
-    buildToolsVersion '30.0.0-rc4'  // TODO: Update with release version.
+    compileSdkVersion 'android-30'
+    buildToolsVersion '30.0.0'
     ndkVersion NDK_VERSION
 
     aaptOptions {
diff --git a/src/starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java b/src/starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java
index 09ece25..93552ed 100644
--- a/src/starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java
+++ b/src/starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java
@@ -161,7 +161,10 @@
     List<String> args = new ArrayList<>(Arrays.asList(DEBUG_ARGS));
     if (argsExtra != null) {
       for (int i = 0; i < argsExtra.length; i++) {
-        args.add(argsExtra[i].toString());
+        // Replace escaped commas with commas. In order to have a comma in the arg string, it has
+        // to be escaped when forming the Intent with "am start --esa". However, "am" doesn't remove
+        // the escape after splitting on unescaped commas, so it's still in the string we get.
+        args.add(argsExtra[i].toString().replace("\\,", ","));
       }
     }
 
diff --git a/src/starboard/android/shared/configuration_public.h b/src/starboard/android/shared/configuration_public.h
index 4c1c8e9..371a413 100644
--- a/src/starboard/android/shared/configuration_public.h
+++ b/src/starboard/android/shared/configuration_public.h
@@ -31,49 +31,17 @@
 
 // --- Architecture Configuration --------------------------------------------
 
-// Configuration parameters that allow the application to make some general
-// compile-time decisions with respect to the the number of cores likely to be
-// available on this platform. For a definitive measure, the application should
-// still call SbSystemGetNumberOfProcessors at runtime.
-
-// Whether the current platform's thread scheduler will automatically balance
-// threads between cores, as opposed to systems where threads will only ever run
-// on the specifically pinned core.
-#define SB_HAS_CROSS_CORE_SCHEDULER 1
-
 // Indicates that there is no support for alignment at greater than 16 bytes for
 // items on the stack.
 #define SB_HAS_QUIRK_DOES_NOT_STACK_ALIGN_OVER_16_BYTES 1
 
-// This quirk is used to fix an issue caused by the rewriting of memset to
-// SbMemorySet in third_party/protobuf/src/google/protobuf/stubs/port.h.
-#define SB_HAS_QUIRK_MEMSET_IN_SYSTEM_HEADERS 1
-
 // --- System Header Configuration -------------------------------------------
 
 // Any system headers listed here that are not provided by the platform will be
 // emulated in starboard/types.h.
 
-// Whether the current platform provides the standard header stdarg.h.
-#define SB_HAS_STDARG_H 1
-
-// Whether the current platform provides the standard header stdbool.h.
-#define SB_HAS_STDBOOL_H 1
-
-// Whether the current platform provides the standard header stddef.h.
-#define SB_HAS_STDDEF_H 1
-
-// Whether the current platform provides the standard header stdint.h.
-#define SB_HAS_STDINT_H 1
-
-// Whether the current platform provides the standard header inttypes.h.
-#define SB_HAS_INTTYPES_H 1
-
-// Whether the current platform provides the standard header limits.h.
-#define SB_HAS_LIMITS_H 1
-
-// Whether the current platform provides the standard header float.h.
-#define SB_HAS_FLOAT_H 1
+// Whether the current platform provides the standard header sys/types.h.
+#define SB_HAS_SYS_TYPES_H 0
 
 // Whether the current platform provides ssize_t.
 #define SB_HAS_SSIZE_T 1
@@ -87,12 +55,10 @@
 #define SB_IS_WCHAR_T_UTF16 1
 #endif
 
-// Chrome only defines these two if ARMEL or MIPSEL are defined.
+// Chrome only defines this for ARMEL.
 #if defined(__ARMEL__)
 // Chrome has an exclusion for iOS here, we should too when we support iOS.
 #define SB_IS_WCHAR_T_UNSIGNED 1
-#elif defined(__MIPSEL__)
-#define SB_IS_WCHAR_T_SIGNED 1
 #endif
 
 // --- Compiler Configuration ------------------------------------------------
@@ -150,9 +116,6 @@
 // The location to include hash_set on this platform.
 #define SB_HASH_SET_INCLUDE <ext/hash_set>
 
-// Define this to how this platform copies varargs blocks.
-#define SB_VA_COPY(dest, source) va_copy(dest, source)
-
 // --- Graphics Configuration ------------------------------------------------
 
 // Specifies whether this platform supports a performant accelerated blitter
diff --git a/src/starboard/android/shared/gyp_configuration.py b/src/starboard/android/shared/gyp_configuration.py
index b0eef56..ce072b3 100644
--- a/src/starboard/android/shared/gyp_configuration.py
+++ b/src/starboard/android/shared/gyp_configuration.py
@@ -150,9 +150,6 @@
       cxx_path = cc_path + '++'
       ar_path = tool_prefix + _ABI_TOOL_NAMES[self.android_abi][1]
       clang_flags = [
-          # We'll pretend not to be Linux, but Starboard instead.
-          '-U__linux__',
-
           # libwebp uses the cpufeatures library to detect ARM NEON support
           '-I{}/sources/android/cpufeatures'.format(self.android_ndk_home),
 
@@ -325,7 +322,7 @@
           # This test is failing because localhost is not defined for IPv6 in
           # /etc/hosts.
           'SbSocketAddressTypes/SbSocketResolveTest.Localhost/1',
-          # SbDirectory has problems with empty Asset dirs. See b/154881065.
+          # SbDirectory has problems with empty Asset dirs.
           'SbDirectoryCanOpenTest.SunnyDayStaticContent',
           'SbDirectoryGetNextTest.SunnyDayStaticContent',
           'SbDirectoryOpenTest.SunnyDayStaticContent',
diff --git a/src/starboard/android/shared/media_codec_bridge.cc b/src/starboard/android/shared/media_codec_bridge.cc
index c4f070a..b47f43e 100644
--- a/src/starboard/android/shared/media_codec_bridge.cc
+++ b/src/starboard/android/shared/media_codec_bridge.cc
@@ -14,7 +14,7 @@
 
 #include "starboard/android/shared/media_codec_bridge.h"
 
-#include "starboard/format_string.h"
+#include "starboard/common/format_string.h"
 
 namespace starboard {
 namespace android {
diff --git a/src/starboard/android/shared/media_decoder.cc b/src/starboard/android/shared/media_decoder.cc
index 81038c7..9d3859d 100644
--- a/src/starboard/android/shared/media_decoder.cc
+++ b/src/starboard/android/shared/media_decoder.cc
@@ -18,9 +18,9 @@
 #include "starboard/android/shared/jni_utils.h"
 #include "starboard/android/shared/media_common.h"
 #include "starboard/audio_sink.h"
+#include "starboard/common/format_string.h"
 #include "starboard/common/log.h"
 #include "starboard/common/string.h"
-#include "starboard/format_string.h"
 #include "starboard/shared/pthread/thread_create_priority.h"
 
 namespace starboard {
diff --git a/src/starboard/android/shared/sdk_utils.py b/src/starboard/android/shared/sdk_utils.py
index b4d6a91..fd695a1 100644
--- a/src/starboard/android/shared/sdk_utils.py
+++ b/src/starboard/android/shared/sdk_utils.py
@@ -35,10 +35,9 @@
 _CMAKE_VERSION = '3.10.2.4988404'
 
 # Packages to install in the Android SDK.
-# We download ndk-bundle separately, so it's not in this list.
 # Get available packages from "sdkmanager --list --verbose"
 _ANDROID_SDK_PACKAGES = [
-    'build-tools;30.0.0-rc4',  # TODO: Change to the stable released SDK
+    'build-tools;30.0.0',
     'cmake;' + _CMAKE_VERSION,
     'cmdline-tools;1.0',
     'emulator',
@@ -46,7 +45,7 @@
     'extras;google;m2repository',
     'ndk;' + _NDK_VERSION,
     'patcher;v4',
-    'platforms;android-29',
+    'platforms;android-30',
     'platform-tools',
 ]
 
@@ -233,6 +232,8 @@
     _DownloadAndUnzipFile(_SDK_URL, _STARBOARD_TOOLCHAINS_SDK_DIR)
     # TODO: Remove this workaround for sdkmanager incorrectly picking up the
     # "tools" directory from the ZIP as the name of its component.
+    # https://issuetracker.google.com/issues/67495440#comment32
+    # https://issuetracker.google.com/issues/150943631
     if not os.access(_SDKMANAGER_TOOL, os.X_OK):
       old_tools_dir = os.path.join(_STARBOARD_TOOLCHAINS_SDK_DIR, 'tools')
       new_tools_dir = os.path.join(_STARBOARD_TOOLCHAINS_SDK_DIR,
@@ -258,10 +259,6 @@
       # Accept "Terms and Conditions" (android-sdk-license)
       time.sleep(_SDK_LICENSE_PROMPT_SLEEP_SECONDS)
       p.stdin.write('y\n')
-      # Accept "SDK Preview" license (android-sdk-preview-license)
-      # TODO: Remove when no longer on prerelease SDK (build-tools;30.0.0-rc4).
-      time.sleep(_SDK_LICENSE_PROMPT_SLEEP_SECONDS)
-      p.stdin.write('y\n')
     except IOError:
       logging.warning('There were no SDK licenses to accept.')
 
diff --git a/src/starboard/android/shared/system_get_property.cc b/src/starboard/android/shared/system_get_property.cc
index d4412d4..192dabc 100644
--- a/src/starboard/android/shared/system_get_property.cc
+++ b/src/starboard/android/shared/system_get_property.cc
@@ -106,11 +106,14 @@
                                       value_length, kUnknownValue);
     case kSbSystemPropertyModelYear:
        return false;
+#if SB_API_VERSION >= 12
+    case kSbSystemPropertySystemIntegratorName:
+#else
     case kSbSystemPropertyOriginalDesignManufacturerName:
+#endif
       return GetAndroidSystemProperty("ro.product.manufacturer", out_value,
                                       value_length, kUnknownValue);
 
-
     case kSbSystemPropertyFriendlyName:
       return CopyStringAndTestIfSuccess(out_value, value_length, kFriendlyName);
 
diff --git a/src/starboard/android/shared/video_render_algorithm.h b/src/starboard/android/shared/video_render_algorithm.h
index 959d5c2..187a1ca 100644
--- a/src/starboard/android/shared/video_render_algorithm.h
+++ b/src/starboard/android/shared/video_render_algorithm.h
@@ -30,7 +30,7 @@
   void Render(MediaTimeProvider* media_time_provider,
               std::list<scoped_refptr<VideoFrame>>* frames,
               VideoRendererSink::DrawFrameCB draw_frame_cb) override;
-  void Reset() override {}
+  void Seek(SbTime seek_to_time) override {}
   int GetDroppedFrames() override { return dropped_frames_; }
 
  private:
diff --git a/src/starboard/build/base_configuration.gypi b/src/starboard/build/base_configuration.gypi
index 9ba8c66..74bd2eb 100644
--- a/src/starboard/build/base_configuration.gypi
+++ b/src/starboard/build/base_configuration.gypi
@@ -208,8 +208,7 @@
     'conditions': [
       ['host_os=="linux"', {
         'conditions': [
-          ['target_arch=="arm" or target_arch=="x86" or target_arch=="mips" or \
-            target_arch=="mipsel" or target_arch=="ppc"', {
+          ['target_arch=="arm" or target_arch=="x86"', {
             # All the 32 bit CPU architectures v8 supports.
             'compiler_flags_cc_host%': [
               '-m32',
diff --git a/src/starboard/client_porting/poem/stdio_poem.h b/src/starboard/client_porting/poem/stdio_poem.h
index c7d15b7..8b1643a 100644
--- a/src/starboard/client_porting/poem/stdio_poem.h
+++ b/src/starboard/client_porting/poem/stdio_poem.h
@@ -21,8 +21,8 @@
 
 #if !defined(POEM_NO_EMULATION)
 
-#include "starboard/string.h"
 #include "starboard/memory.h"
+#include "starboard/string.h"
 
 #define wcsncmp(s1, s2, c) SbStringCompareWide(s1, s2, c)
 
@@ -47,6 +47,8 @@
 #define free(a) SbMemoryDeallocate(a)
 #undef realloc
 #define realloc(m, sz) SbMemoryReallocate(m, sz)
+#undef memalign
+#define memalign(a, l) SbMemoryAllocateAligned(a, l)
 
 #endif  // POEM_NO_EMULATION
 
diff --git a/src/starboard/common/common.gyp b/src/starboard/common/common.gyp
index 1784d73..e381f4e 100644
--- a/src/starboard/common/common.gyp
+++ b/src/starboard/common/common.gyp
@@ -31,6 +31,7 @@
         'configuration_defaults.cc',
         'configuration_defaults.h',
         'flat_map.h',
+        'format_string.h',
         'locked_ptr.h',
         'log.cc',
         'log.h',
diff --git a/src/starboard/common/format_string.h b/src/starboard/common/format_string.h
new file mode 100644
index 0000000..bf99ea3
--- /dev/null
+++ b/src/starboard/common/format_string.h
@@ -0,0 +1,57 @@
+// Copyright 2019 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Module Overview: Starboard String module
+//
+// Move the definition of FormatString from string.h to this header to break
+// the dependency between string.h and standard header <string>.
+
+#ifndef STARBOARD_COMMON_FORMAT_STRING_H_
+#define STARBOARD_COMMON_FORMAT_STRING_H_
+
+#include "starboard/common/string.h"
+
+#if SB_API_VERSION >= 11
+
+#include <string>
+#include <vector>
+
+namespace starboard {
+
+SB_C_INLINE std::string FormatString(const char* format, ...)
+    SB_PRINTF_FORMAT(1, 2);
+
+SB_C_INLINE std::string FormatString(const char* format, ...) {
+  va_list arguments;
+  va_start(arguments, format);
+  int expected_size = ::SbStringFormat(NULL, 0, format, arguments);
+  va_end(arguments);
+
+  std::string result;
+  if (expected_size <= 0) {
+    return result;
+  }
+
+  std::vector<char> buffer(expected_size + 1);
+  va_start(arguments, format);
+  ::SbStringFormat(buffer.data(), buffer.size(), format, arguments);
+  va_end(arguments);
+  return std::string(buffer.data(), expected_size);
+}
+
+}  // namespace starboard
+
+#endif  // SB_API_VERSION >= 11
+
+#endif  // STARBOARD_COMMON_FORMAT_STRING_H_
diff --git a/src/starboard/configuration.h b/src/starboard/configuration.h
index 8035099..a4b834b 100644
--- a/src/starboard/configuration.h
+++ b/src/starboard/configuration.h
@@ -682,13 +682,11 @@
 #endif
 
 #if SB_API_VERSION >= 11
-#if defined(SB_HAS_AC3_AUDIO)
-#if !SB_HAS(AC3_AUDIO)
-#error "SB_HAS_AC3_AUDIO is required in this API version."
-#endif  // !SB_HAS(AC3_AUDIO)
-#else   // defined(SB_HAS_AC3_AUDIO)
+#if !defined(SB_HAS_AC3_AUDIO)
 #define SB_HAS_AC3_AUDIO 1
-#endif  // defined(SB_HAS_AC3_AUDIO)
+#elif !SB_HAS(AC3_AUDIO)
+#error "SB_HAS_AC3_AUDIO is required in this API version."
+#endif
 #endif  // SB_API_VERSION >= 11
 
 #if SB_API_VERSION >= 12
@@ -895,15 +893,13 @@
 #endif  // defined(SB_HAS_AUDIOLESS_VIDEO)
 
 #if SB_API_VERSION >= 11
-#if defined(SB_HAS_MEDIA_IS_VIDEO_SUPPORTED_REFINEMENT)
-#if !SB_HAS(MEDIA_IS_VIDEO_SUPPORTED_REFINEMENT)
+#if !defined(SB_HAS_MEDIA_IS_VIDEO_SUPPORTED_REFINEMENT)
+#define SB_HAS_MEDIA_IS_VIDEO_SUPPORTED_REFINEMENT 1
+#elif !SB_HAS(MEDIA_IS_VIDEO_SUPPORTED_REFINEMENT)
 #error \
     "SB_HAS_MEDIA_IS_VIDEO_SUPPORTED_REFINEMENT is required in this API " \
         "version."
-#endif  // !SB_HAS(MEDIA_IS_VIDEO_SUPPORTED_REFINEMENT)
-#else   // defined(SB_HAS_MEDIA_IS_VIDEO_SUPPORTED_REFINEMENT)
-#define SB_HAS_MEDIA_IS_VIDEO_SUPPORTED_REFINEMENT 1
-#endif  // defined(SB_HAS_MEDIA_IS_VIDEO_SUPPORTED_REFINEMENT)
+#endif
 #endif  // SB_API_VERSION >= 11
 
 #if defined(SB_HAS_DRM_SESSION_CLOSED)
@@ -939,15 +935,13 @@
 #endif  // defined(SB_HAS_PLAYER_ERROR_MESSAGE)
 
 #if SB_API_VERSION >= 12
-#if defined(SB_HAS_PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
-#if !SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+#if !defined(SB_HAS_PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+#define SB_HAS_PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT 1
+#elif !SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
 #error \
     "SB_HAS_PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT is required in" \
     " this API version."
-#endif  // !SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
-#else   // defined(SB_HAS_PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
-#define SB_HAS_PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT 1
-#endif  // defined(SB_HAS_PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+#endif
 #endif  // SB_API_VERSION >= 12
 
 #if SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
@@ -1001,37 +995,12 @@
 #define SB_HAS_GLES2 !SB_GYP_GL_TYPE_IS_NONE
 #endif
 
-// Specifies whether this platform has any kind of supported graphics system.
-#if !defined(SB_HAS_GRAPHICS)
-#if SB_HAS(GLES2) || SB_API_VERSION >= 12 || SB_HAS(BLITTER)
-#define SB_HAS_GRAPHICS 1
-#else
-#define SB_HAS_GRAPHICS 0
-#endif
-#endif
+// --- Deprecated Feature Macros -----------------------------------------------
 
-// Deprecated feature macros
-// These feature macros are deprecated in Starboard version 6 and later, and are
-// no longer referenced by application code.  They will be removed in a future
-// version.  Any Starboard implementation that supports Starboard version 6 or
-// later should be modified to no longer depend on these macros, with the
-// assumption that their values are always 1.
-#if defined(SB_HAS_AUDIO_SPECIFIC_CONFIG_AS_POINTER)
-#if !SB_HAS(AUDIO_SPECIFIC_CONFIG_AS_POINTER)
-#error \
-    "SB_HAS_AUDIO_SPECIFIC_CONFIG_AS_POINTER is required for Starboard 6 " \
-       "or later."
-#endif  // !SB_HAS(AUDIO_SPECIFIC_CONFIG_AS_POINTER)
-#else   // defined(SB_HAS_AUDIO_SPECIFIC_CONFIG_AS_POINTER)
-#define SB_HAS_AUDIO_SPECIFIC_CONFIG_AS_POINTER 1
-#endif  // defined(SB_HAS_AUDIO_SPECIFIC_CONFIG_AS_POINTER)
-
-#if defined(SB_HAS_DRM_KEY_STATUSES)
-#if !SB_HAS(DRM_KEY_STATUSES)
-#error "SB_HAS_DRM_KEY_STATUSES is required for Starboard 6 or later."
-#endif  // !SB_HAS(DRM_KEY_STATUSES)
-#else   // defined(SB_HAS_DRM_KEY_STATUSES)
-#define SB_HAS_DRM_KEY_STATUSES 1
-#endif  // defined(SB_HAS_DRM_KEY_STATUSES)
+// Deprecated feature macros are no longer referenced by application code, and
+// will be removed in a later Starboard API version. Any Starboard
+// implementation that supports any of these macros should be modified to no
+// longer rely on them, and operate with the assumption that their values are
+// always 1.
 
 #endif  // STARBOARD_CONFIGURATION_H_
diff --git a/src/starboard/contrib/creator/README.md b/src/starboard/contrib/creator/README.md
deleted file mode 100644
index 2aec2d9..0000000
--- a/src/starboard/contrib/creator/README.md
+++ /dev/null
@@ -1,169 +0,0 @@
-# MIPS support
-
-starboard/contrib/creator directory contains port of Cobalt for Creator CI20 platform:
-https://www.elinux.org/MIPS_Creator_CI20
-
-
-# Building Cobalt for CI20
-
-Cobalt can be built for CI20 using LLVM toolchain (Clang and lld),
-GCC 4.9 and GCC MTI 6.3 toolchains. In all cases sysroot based on Debian is needed.
-For building Cobalt with Clang or GCC 4.9, Debian Jessie is used as sysroot,
-and for building with GCC MTI 6.3, sysroot is based on Debian Stretch due to
-dependance on newer versions of libstdc++. For this reason, Cobalt built with GCC MTI 6.3
-toolchain can only be executed on CI20 platform with Debian Stretch or later.
-
-## Sysroot
-
-Directory third_party/ci20 contains script mipsel-toolchain-sysroot-creator.sh,
-which will create Debian based sysroot. In addition this script will
-also build GCC 4.9 toolchain or download prebuilt GCC MTI 6.3 from https://codescape.mips.com.
-
-In order to create sysroot and toolchain run:
-
-    ./mipsel-toolchain-sysroot-creator.sh <toolchain>
-
-toolchain argument can be:
-
-clang - Creates sysroot based on Debian Jessie with addition of GCC 4.9 libs
-gcc_4-9 - Builds GCC 4.9 toolchain and creates sysroot based on Debian Jessie
-gcc_mti_6-3 - Downloads prebuilt MTI GCC 6.3 toolchain and creates sysroot
-              based on Debian Stretch
-
-Result will be a package:
-
-mipsel_clang_jessie_sysroot.tgz - contains Debian Jessie sysroot, and required GCC libs
-mipsel_gcc_4-9_jessie_sysroot.tgz - contains built GCC 4.9 toolchain and Debian Jessie sysroot
-mipsel_gcc_mti_6-3_stretch_sysroot.tgz - contains downloaded GCC MTI 6.3 toolchain and Debian Stretch sysroot
-
-Directory where this package is extracted should be exported as CI20_HOME.
-
-    export CI20_HOME=<PATH_TO_DIRECTORY_WHERE_PACKAGE_IS_EXTRACTED>
-
-## JavaScript engine
-
-Default configuration for JavaScript engine is V8 with JIT enabled.
-Alternative configuration is to use mozjs-45, which has JIT disabled by defualt.
-Configuration with mozjs-45 is only available when building Cobalt with Clang.
-
-## Building
-
-Follow all generic instructions from:
-
-    http://cobalt.foo/development/setup-linux.html
-
-### Building with Clang
-
-Clang is the default toolchain for building Cobalt for CI20.
-Configuration files are located in creator/ci20x11.
-
-Commands for building are:
-
-    cobalt/build/gyp_cobalt -C debug creator-ci20x11
-    ninja -j4 -C out/creator-ci20x11_debug all
-
-    cobalt/build/gyp_cobalt -C devel creator-ci20x11
-    ninja -j4 -C out/creator-ci20x11_devel all
-
-    cobalt/build/gyp_cobalt -C qa creator-ci20x11
-    ninja -j4 -C out/creator-ci20x11_qa cobalt
-
-    cobalt/build/gyp_cobalt -C gold creator-ci20x11
-    ninja -j4 -C out/creator-ci20x11_gold cobalt
-
-Using mozjs-45 JavaScript engine:
-
-    cobalt/build/gyp_cobalt -C debug creator-ci20x11-mozjs
-    ninja -j4 -C out/creator-ci20x11-mozjs_debug all
-
-    cobalt/build/gyp_cobalt -C devel creator-ci20x11-mozjs
-    ninja -j4 -C out/creator-ci20x11-mozjs_devel all
-
-    cobalt/build/gyp_cobalt -C qa creator-ci20x11-mozjs
-    ninja -j4 -C out/creator-ci20x11-mozjs_qa cobalt
-
-    cobalt/build/gyp_cobalt -C gold creator-ci20x11-mozjs
-    ninja -j4 -C out/creator-ci20x11-mozjs_gold cobalt
-
-### Building with GCC 4.9
-
-Configuration files for GCC build are located in creator/ci20x11/gcc/4.9
-
-Commands for building are:
-
-    cobalt/build/gyp_cobalt -C debug creator-ci20x11-gcc-4-9
-    ninja -j4 -C out/creator-ci20x11-gcc-4-9_debug all
-
-    cobalt/build/gyp_cobalt -C devel creator-ci20x11-gcc-4-9
-    ninja -j4 -C out/creator-ci20x11-gcc-4-9_devel all
-
-    cobalt/build/gyp_cobalt -C qa creator-ci20x11-gcc-4-9
-    ninja -j4 -C out/creator-ci20x11-gcc-4-9_qa cobalt
-
-    cobalt/build/gyp_cobalt -C gold creator-ci20x11-gcc-4-9
-    ninja -j4 -C out/creator-ci20x11-gcc-4-9_gold cobalt
-
-### Building with GCC MTI 6.3
-
-Configuration files for GCC build are located in creator/ci20x11/gcc/6.3.mti
-
-Commands for building are:
-
-    cobalt/build/gyp_cobalt -C debug creator-ci20x11-gcc-6-3-mti
-    ninja -j4 -C out/creator-ci20x11-gcc-6-3-mti_debug all
-
-    cobalt/build/gyp_cobalt -C devel creator-ci20x11-gcc-6-3-mti
-    ninja -j4 -C out/creator-ci20x11-gcc-6-3-mti_devel all
-
-    cobalt/build/gyp_cobalt -C qa creator-ci20x11-gcc-6-3-mti
-    ninja -j4 -C out/creator-ci20x11-gcc-6-3-mti_qa cobalt
-
-    cobalt/build/gyp_cobalt -C gold creator-ci20x11-gcc-6-3-mti
-    ninja -j4 -C out/creator-ci20x11-gcc-6-3-mti_gold cobalt
-
-
-# Running Cobalt on CI20
-
-Cobalt might complain about missing libraries on CI20 platform with stock
-Debian rootfs.
-
-To check which libraries are missing, run:
-
-    ldd ./cobalt
-
-And install missing libraries using apt-get.
-
-## Pulseaudio
-
-Before running Cobalt on CI20, pulseaudio must be disabled.
-
-a) Global config (all users):
-edit /etc/pulse/client.conf
-or
-b) Local config (single user):
-edit ~/.config/pulse/client.conf
-
-Add following new line to client.conf:
-autospawn = no
-
-## Starting Cobalt
-
-To start Cobalt on CI20, mount "out" directory on platform and run:
-
-    cd out/creator-ci20x11_gold
-    ./cobalt
-
-By default Cobalt will open youtube.com/tv page.
-
-
-# Notes about performance
-
-## Audio
-
-With pulseaudio disabled, audio on youtube.com/tv is working OK,
-with occasional audible artifacts.
-
-## Video
-
-Since CI20 still uses software video decoding, video performance is not good.
-Video playback will start, but most of the frames will be dropped.
diff --git a/src/starboard/contrib/creator/__init__.py b/src/starboard/contrib/creator/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/src/starboard/contrib/creator/__init__.py
+++ /dev/null
diff --git a/src/starboard/contrib/creator/_env.py b/src/starboard/contrib/creator/_env.py
deleted file mode 100644
index 021908e..0000000
--- a/src/starboard/contrib/creator/_env.py
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Copyright 2017 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-"""Ask the parent directory to load the project environment."""
-
-from imp import load_source
-from os import path
-import sys
-
-_ENV = path.abspath(path.join(path.dirname(__file__), path.pardir, '_env.py'))
-if not path.exists(_ENV):
-  print '%s: Can\'t find repo root.\nMissing parent: %s' % (__file__, _ENV)
-  sys.exit(1)
-load_source('', _ENV)
diff --git a/src/starboard/contrib/creator/ci20x11/__init__.py b/src/starboard/contrib/creator/ci20x11/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/src/starboard/contrib/creator/ci20x11/__init__.py
+++ /dev/null
diff --git a/src/starboard/contrib/creator/ci20x11/_env.py b/src/starboard/contrib/creator/ci20x11/_env.py
deleted file mode 100644
index 021908e..0000000
--- a/src/starboard/contrib/creator/ci20x11/_env.py
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Copyright 2017 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-"""Ask the parent directory to load the project environment."""
-
-from imp import load_source
-from os import path
-import sys
-
-_ENV = path.abspath(path.join(path.dirname(__file__), path.pardir, '_env.py'))
-if not path.exists(_ENV):
-  print '%s: Can\'t find repo root.\nMissing parent: %s' % (__file__, _ENV)
-  sys.exit(1)
-load_source('', _ENV)
diff --git a/src/starboard/contrib/creator/ci20x11/atomic_public.h b/src/starboard/contrib/creator/ci20x11/atomic_public.h
deleted file mode 100644
index 963d788..0000000
--- a/src/starboard/contrib/creator/ci20x11/atomic_public.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2016 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef STARBOARD_CONTRIB_CREATOR_CI20X11_ATOMIC_PUBLIC_H_
-#define STARBOARD_CONTRIB_CREATOR_CI20X11_ATOMIC_PUBLIC_H_
-
-#include "starboard/linux/shared/atomic_public.h"
-
-#endif  // STARBOARD_CONTRIB_CREATOR_CI20X11_ATOMIC_PUBLIC_H_
diff --git a/src/starboard/contrib/creator/ci20x11/configuration_public.h b/src/starboard/contrib/creator/ci20x11/configuration_public.h
deleted file mode 100644
index 67a4156..0000000
--- a/src/starboard/contrib/creator/ci20x11/configuration_public.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2016 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef STARBOARD_CONTRIB_CREATOR_CI20X11_CONFIGURATION_PUBLIC_H_
-#define STARBOARD_CONTRIB_CREATOR_CI20X11_CONFIGURATION_PUBLIC_H_
-
-#include "starboard/contrib/creator/shared/configuration_public.h"
-
-#endif  // STARBOARD_CONTRIB_CREATOR_CI20X11_CONFIGURATION_PUBLIC_H_
diff --git a/src/starboard/contrib/creator/ci20x11/egl_workaround.cc b/src/starboard/contrib/creator/ci20x11/egl_workaround.cc
deleted file mode 100644
index 62f5773..0000000
--- a/src/starboard/contrib/creator/ci20x11/egl_workaround.cc
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2018 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include <X11/Xlib.h>
-#include "cobalt/renderer/backend/egl/display.h"
-
-extern "C" EGLDisplay __real_eglGetDisplay(EGLNativeDisplayType native_display);
-extern "C" EGLDisplay __wrap_eglGetDisplay(EGLNativeDisplayType native_display);
-
-extern "C" EGLBoolean __real_eglTerminate(EGLDisplay display);
-extern "C" EGLBoolean __wrap_eglTerminate(EGLDisplay display);
-
-Display* native_display_;
-
-extern "C" EGLDisplay
-    __wrap_eglGetDisplay(EGLNativeDisplayType native_display) {
-  native_display_ = XOpenDisplay(0);
-  return __real_eglGetDisplay((EGLNativeDisplayType) native_display_);
-}
-
-extern "C" EGLBoolean __wrap_eglTerminate(EGLDisplay display) {
-  EGLBoolean result = __real_eglTerminate(display);
-  XCloseDisplay(native_display_);
-  return result;
-}
diff --git a/src/starboard/contrib/creator/ci20x11/gcc/4.9/atomic_public.h b/src/starboard/contrib/creator/ci20x11/gcc/4.9/atomic_public.h
deleted file mode 100644
index fdceb87..0000000
--- a/src/starboard/contrib/creator/ci20x11/gcc/4.9/atomic_public.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2016 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef STARBOARD_CONTRIB_CREATOR_CI20X11_GCC_4_9_ATOMIC_PUBLIC_H_
-#define STARBOARD_CONTRIB_CREATOR_CI20X11_GCC_4_9_ATOMIC_PUBLIC_H_
-
-#include "starboard/linux/shared/atomic_public.h"
-
-#endif  // STARBOARD_CONTRIB_CREATOR_CI20X11_GCC_4_9_ATOMIC_PUBLIC_H_
diff --git a/src/starboard/contrib/creator/ci20x11/gcc/4.9/compiler_flags.gypi b/src/starboard/contrib/creator/ci20x11/gcc/4.9/compiler_flags.gypi
deleted file mode 100644
index c1c5413..0000000
--- a/src/starboard/contrib/creator/ci20x11/gcc/4.9/compiler_flags.gypi
+++ /dev/null
@@ -1,128 +0,0 @@
-# Copyright 2016 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Platform specific compiler flags for Linux on Starboard. Included from
-# gyp_configuration.gypi.
-#
-{
-  'variables': {
-    'compiler_flags_host': [
-      '-O2',
-    ],
-    'linker_flags': [
-      '-Wl,-rpath=<@(toolchain_lib_path)',
-    ],
-    'compiler_flags_cc_debug': [
-      '-frtti',
-    ],
-    'compiler_flags_debug': [
-      '-O0',
-    ],
-    'compiler_flags_cc_devel': [
-      '-frtti',
-    ],
-    'compiler_flags_devel': [
-      '-O2',
-    ],
-    'compiler_flags_cc_qa': [
-      '-fno-rtti',
-    ],
-    'compiler_flags_qa': [
-      '-O2',
-    ],
-    'compiler_flags_cc_gold': [
-      '-fno-rtti',
-    ],
-    'compiler_flags_gold': [
-      '-O2',
-    ],
-    'common_compiler_flags': [
-      # Default visibility to hidden, to enable dead stripping.
-      '-fvisibility=hidden',
-      # protobuf uses hash_map.
-      '-fno-exceptions',
-      # Don't warn about the "struct foo f = {0};" initialization pattern.
-      '-Wno-missing-field-initializers',
-      '-fno-strict-aliasing',  # See http://crbug.com/32204
-      # Don't warn about any conversions.
-      '-Wno-conversion',
-      # Don't warn about unreachable code. See
-      # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46158
-      '-Wno-unreachable-code',
-      '-Wno-deprecated-declarations',
-      # Disable warning:
-      # 'comparison is always true due to limited range of data type'
-      '-Wno-extra',
-      # Don't warn about inlining
-      '-Wno-inline',
-      # Disable warning: 'typedef locally defined but not used'.
-      '-Wno-unused-local-typedefs',
-      # Disable warning: 'narrowing conversion'
-      '-Wno-narrowing',
-      # Do not remove null this checks.
-      '-fno-delete-null-pointer-checks',
-      '-Wno-unused-result',
-      '-Wno-unknown-pragmas',
-    ],
-    'conditions': [
-      ['cobalt_fastbuild==0', {
-        'compiler_flags_debug': [
-          '-g',
-        ],
-        'compiler_flags_devel': [
-          '-g',
-        ],
-        'compiler_flags_qa': [
-        ],
-        'compiler_flags_gold': [
-        ],
-      }],
-    ],
-  },
-
-  'target_defaults': {
-    'defines': [
-      # By default, <EGL/eglplatform.h> pulls in some X11 headers that have some
-      # nasty macros (|Status|, for example) that conflict with Chromium base.
-      'MESA_EGL_NO_X11_HEADERS'
-    ],
-    'cflags_c': [
-      # Limit to C99. This allows Linux to be a canary build for any
-      # C11 features that are not supported on some platforms' compilers.
-      '-std=c99',
-    ],
-    'cflags_cc': [
-      '-std=gnu++11',
-      # Don't warn for invalid access to non-static data member of NULL object.
-      '-Wno-invalid-offsetof',
-      # Don't warn about deprecated use
-      '-Wno-deprecated',
-    ],
-    'target_conditions': [
-      ['sb_pedantic_warnings==1', {
-        'cflags': [
-          '-Wall',
-          '-Wextra',
-          '<@(common_compiler_flags)',
-        ],
-      },{
-        'cflags': [
-          '<@(common_compiler_flags)',
-          # Do not warn about unused function params.
-          '-Wno-unused-parameter',
-        ],
-      }],
-    ],
-  }, # end of target_defaults
-}
diff --git a/src/starboard/contrib/creator/ci20x11/gcc/4.9/configuration_public.h b/src/starboard/contrib/creator/ci20x11/gcc/4.9/configuration_public.h
deleted file mode 100644
index 1db0b40..0000000
--- a/src/starboard/contrib/creator/ci20x11/gcc/4.9/configuration_public.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2016 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef STARBOARD_CONTRIB_CREATOR_CI20X11_GCC_4_9_CONFIGURATION_PUBLIC_H_
-#define STARBOARD_CONTRIB_CREATOR_CI20X11_GCC_4_9_CONFIGURATION_PUBLIC_H_
-
-#include "starboard/contrib/creator/shared/configuration_public.h"
-
-#endif  // STARBOARD_CONTRIB_CREATOR_CI20X11_GCC_4_9_CONFIGURATION_PUBLIC_H_
diff --git a/src/starboard/contrib/creator/ci20x11/gcc/4.9/gyp_configuration.gypi b/src/starboard/contrib/creator/ci20x11/gcc/4.9/gyp_configuration.gypi
deleted file mode 100644
index 42f0a6c..0000000
--- a/src/starboard/contrib/creator/ci20x11/gcc/4.9/gyp_configuration.gypi
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 2016 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-{
-  'variables': {
-    'linker_flags!': [
-            '-Wl,--wrap=malloc',
-            '-Wl,--wrap=free',
-    ],
-  },
-
-  'target_defaults': {
-    'default_configuration': 'creator-ci20x11-gcc-4-9_debug',
-    'configurations': {
-      'creator-ci20x11-gcc-4-9_debug': {
-        'inherit_from': ['debug_base'],
-      },
-      'creator-ci20x11-gcc-4-9_devel': {
-        'inherit_from': ['devel_base'],
-      },
-      'creator-ci20x11-gcc-4-9_qa': {
-        'inherit_from': ['qa_base'],
-      },
-      'creator-ci20x11-gcc-4-9_gold': {
-        'inherit_from': ['gold_base'],
-      },
-    }, # end of configurations
-  },
-
-  'includes': [
-    'compiler_flags.gypi',
-    '../gyp_configuration.gypi',
-  ],
-}
diff --git a/src/starboard/contrib/creator/ci20x11/gcc/4.9/gyp_configuration.py b/src/starboard/contrib/creator/ci20x11/gcc/4.9/gyp_configuration.py
deleted file mode 100644
index 1dad46c..0000000
--- a/src/starboard/contrib/creator/ci20x11/gcc/4.9/gyp_configuration.py
+++ /dev/null
@@ -1,77 +0,0 @@
-# Copyright 2016 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Starboard Creator CI20 X11 gcc 4.9 platform configuration."""
-
-import logging
-import os
-
-from starboard.contrib.creator.shared import gyp_configuration as shared_configuration
-from starboard.tools.testing import test_filter
-
-
-class PlatformConfig(shared_configuration.CreatorConfiguration):
-  """Starboard Creator platform configuration."""
-
-  def __init__(self, platform):
-    super(PlatformConfig, self).__init__(platform)
-
-  def GetVariables(self, configuration):
-    variables = super(PlatformConfig, self).GetVariables(configuration)
-    variables.update({
-        'clang': 0,
-    })
-    toolchain_lib_path = os.path.join(self.toolchain_dir, 'lib')
-    variables.update({
-        'toolchain_lib_path': toolchain_lib_path,
-    })
-    return variables
-
-  def GetEnvironmentVariables(self):
-    env_variables = super(PlatformConfig, self).GetEnvironmentVariables()
-    self.toolchain_dir = os.path.join(self.ci20_home)
-    toolchain_bin_dir = os.path.join(self.toolchain_dir, 'bin')
-    env_variables.update({
-        'CC': os.path.join(toolchain_bin_dir, 'mipsel-linux-gnu-gcc'),
-        'CXX': os.path.join(toolchain_bin_dir, 'mipsel-linux-gnu-g++'),
-        'CC_host': 'gcc',
-        'CXX_host': 'g++',
-        'LD_host': 'g++',
-        'ARFLAGS_host': 'rcs',
-        'ARTHINFLAGS_host': 'rcsT',
-    })
-    return env_variables
-
-  def GetTestFilters(self):
-    filters = super(PlatformConfig, self).GetTestFilters()
-    filters.extend([
-        # test fails when built with GCC 4.9, issue was fixed
-        # in later versions of GCC
-        test_filter.TestFilter('nplb', 'SbAlignTest.AlignAsStackVariable'),
-        # tests fail also on x86
-        test_filter.TestFilter('nplb', 'SbSystemSymbolizeTest.SunnyDay'),
-        test_filter.TestFilter('nplb',
-                               'SbSystemGetStackTest.SunnyDayStackDirection'),
-        test_filter.TestFilter('nplb', 'SbSystemGetStackTest.SunnyDay'),
-        test_filter.TestFilter('nplb',
-                               'SbSystemGetStackTest.SunnyDayShortStack'),
-    ])
-    return filters
-
-
-def CreatePlatformConfig():
-  try:
-    return PlatformConfig('creator-ci20x11-gcc-4-9')
-  except RuntimeError as e:
-    logging.critical(e)
-    return None
diff --git a/src/starboard/contrib/creator/ci20x11/gcc/4.9/starboard_platform.gyp b/src/starboard/contrib/creator/ci20x11/gcc/4.9/starboard_platform.gyp
deleted file mode 100644
index 3d68745..0000000
--- a/src/starboard/contrib/creator/ci20x11/gcc/4.9/starboard_platform.gyp
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright 2016 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-{
-  'includes': [
-    '../starboard_platform.gyp',
-  ],
-}
diff --git a/src/starboard/contrib/creator/ci20x11/gcc/4.9/thread_types_public.h b/src/starboard/contrib/creator/ci20x11/gcc/4.9/thread_types_public.h
deleted file mode 100644
index 1305e0e..0000000
--- a/src/starboard/contrib/creator/ci20x11/gcc/4.9/thread_types_public.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2016 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef STARBOARD_CONTRIB_CREATOR_CI20X11_GCC_4_9_THREAD_TYPES_PUBLIC_H_
-#define STARBOARD_CONTRIB_CREATOR_CI20X11_GCC_4_9_THREAD_TYPES_PUBLIC_H_
-
-#include "starboard/linux/shared/thread_types_public.h"
-
-#endif  // STARBOARD_CONTRIB_CREATOR_CI20X11_GCC_4_9_THREAD_TYPES_PUBLIC_H_
diff --git a/src/starboard/contrib/creator/ci20x11/gcc/6.3.mti/atomic_public.h b/src/starboard/contrib/creator/ci20x11/gcc/6.3.mti/atomic_public.h
deleted file mode 100644
index 468ef29..0000000
--- a/src/starboard/contrib/creator/ci20x11/gcc/6.3.mti/atomic_public.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2018 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef STARBOARD_CONTRIB_CREATOR_CI20X11_GCC_6_3_MTI_ATOMIC_PUBLIC_H_
-#define STARBOARD_CONTRIB_CREATOR_CI20X11_GCC_6_3_MTI_ATOMIC_PUBLIC_H_
-
-#include "starboard/linux/shared/atomic_public.h"
-
-#endif  // STARBOARD_CONTRIB_CREATOR_CI20X11_GCC_6_3_MTI_ATOMIC_PUBLIC_H_
diff --git a/src/starboard/contrib/creator/ci20x11/gcc/6.3.mti/compiler_flags.gypi b/src/starboard/contrib/creator/ci20x11/gcc/6.3.mti/compiler_flags.gypi
deleted file mode 100644
index 74837be..0000000
--- a/src/starboard/contrib/creator/ci20x11/gcc/6.3.mti/compiler_flags.gypi
+++ /dev/null
@@ -1,131 +0,0 @@
-# Copyright 2018 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Platform specific compiler flags for Linux on Starboard. Included from
-# gyp_configuration.gypi.
-#
-{
-  'variables': {
-    'compiler_flags_host': [
-      '-O2',
-    ],
-    'linker_flags': [
-      '-Wl,-rpath=<@(toolchain_lib_path)',
-    ],
-    'compiler_flags_cc_debug': [
-      '-frtti',
-    ],
-    'compiler_flags_debug': [
-      '-O0',
-    ],
-    'compiler_flags_cc_devel': [
-      '-frtti',
-    ],
-    'compiler_flags_devel': [
-      '-O2',
-    ],
-    'compiler_flags_cc_qa': [
-      '-fno-rtti',
-    ],
-    'compiler_flags_qa': [
-      '-O2',
-    ],
-    'compiler_flags_cc_gold': [
-      '-fno-rtti',
-    ],
-    'compiler_flags_gold': [
-      '-O2',
-    ],
-    'common_compiler_flags': [
-      # Default visibility to hidden, to enable dead stripping.
-      '-fvisibility=hidden',
-      # protobuf uses hash_map.
-      '-fno-exceptions',
-      # Don't warn about the "struct foo f = {0};" initialization pattern.
-      '-Wno-missing-field-initializers',
-      '-fno-strict-aliasing',  # See http://crbug.com/32204
-      # Don't warn about any conversions.
-      '-Wno-conversion',
-      # Don't warn about unreachable code. See
-      # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46158
-      '-Wno-unreachable-code',
-      '-Wno-deprecated-declarations',
-      # Disable warning:
-      # 'comparison is always true due to limited range of data type'
-      '-Wno-extra',
-      # Don't warn about inlining
-      '-Wno-inline',
-      # Disable warning: 'typedef locally defined but not used'.
-      '-Wno-unused-local-typedefs',
-      # Disable warning: 'narrowing conversion'
-      '-Wno-narrowing',
-      # Do not remove null this checks.
-      '-fno-delete-null-pointer-checks',
-      '-Wno-unused-result',
-      '-Wno-unknown-pragmas',
-    ],
-    'conditions': [
-      ['cobalt_fastbuild==0', {
-        'compiler_flags_debug': [
-          '-g',
-        ],
-        'compiler_flags_devel': [
-          '-g',
-        ],
-        'compiler_flags_qa': [
-        ],
-        'compiler_flags_gold': [
-        ],
-      }],
-    ],
-  },
-
-  'target_defaults': {
-    'defines': [
-      # By default, <EGL/eglplatform.h> pulls in some X11 headers that have some
-      # nasty macros (|Status|, for example) that conflict with Chromium base.
-      'MESA_EGL_NO_X11_HEADERS',
-      # LM TODO add comment
-      '_GLIBCXX_HAVE_OBSOLETE_ISINF=1',
-      '_GLIBCXX_HAVE_OBSOLETE_ISNAN=1'
-    ],
-    'cflags_c': [
-      # Limit to C99. This allows Linux to be a canary build for any
-      # C11 features that are not supported on some platforms' compilers.
-      '-std=c99',
-    ],
-    'cflags_cc': [
-      '-std=gnu++11',
-      # Don't warn for invalid access to non-static data member of NULL object.
-      '-Wno-invalid-offsetof',
-      # Don't warn about deprecated use
-      '-Wno-deprecated',
-    ],
-    'target_conditions': [
-      ['sb_pedantic_warnings==1', {
-        'cflags': [
-          '-Wall',
-          '-Wextra',
-          '<@(common_compiler_flags)',
-        ],
-      },{
-        'cflags': [
-          '<@(common_compiler_flags)',
-          # Do not warn about unused function params.
-          '-Wno-unused-parameter',
-        ],
-      }],
-    ],
-  }, # end of target_defaults
-}
diff --git a/src/starboard/contrib/creator/ci20x11/gcc/6.3.mti/configuration_public.h b/src/starboard/contrib/creator/ci20x11/gcc/6.3.mti/configuration_public.h
deleted file mode 100644
index 2271931..0000000
--- a/src/starboard/contrib/creator/ci20x11/gcc/6.3.mti/configuration_public.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2018 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef STARBOARD_CONTRIB_CREATOR_CI20X11_GCC_6_3_MTI_CONFIGURATION_PUBLIC_H_
-#define STARBOARD_CONTRIB_CREATOR_CI20X11_GCC_6_3_MTI_CONFIGURATION_PUBLIC_H_
-
-#include "starboard/contrib/creator/shared/configuration_public.h"
-
-#endif  // STARBOARD_CONTRIB_CREATOR_CI20X11_GCC_6_3_MTI_CONFIGURATION_PUBLIC_H_
diff --git a/src/starboard/contrib/creator/ci20x11/gcc/6.3.mti/gyp_configuration.gypi b/src/starboard/contrib/creator/ci20x11/gcc/6.3.mti/gyp_configuration.gypi
deleted file mode 100644
index a5a5343..0000000
--- a/src/starboard/contrib/creator/ci20x11/gcc/6.3.mti/gyp_configuration.gypi
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright 2018 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-{
-  'variables': {
-    'linker_flags!': [
-            '-Wl,--wrap=malloc',
-            '-Wl,--wrap=free',
-    ],
-    'compiler_flags': [
-      '-I<(sysroot)/mipsel-r2-hard/usr/include/mipsel-linux-gnu'
-    ],
-  },
-
-  'target_defaults': {
-    'default_configuration': 'creator-ci20x11-gcc-6-3-mti_debug',
-    'configurations': {
-      'creator-ci20x11-gcc-6-3-mti_debug': {
-        'inherit_from': ['debug_base'],
-      },
-      'creator-ci20x11-gcc-6-3-mti_devel': {
-        'inherit_from': ['devel_base'],
-      },
-      'creator-ci20x11-gcc-6-3-mti_qa': {
-        'inherit_from': ['qa_base'],
-      },
-      'creator-ci20x11-gcc-6-3-mti_gold': {
-        'inherit_from': ['gold_base'],
-      },
-    }, # end of configurations
-  },
-
-  'includes': [
-    'compiler_flags.gypi',
-    '../gyp_configuration.gypi',
-  ],
-}
diff --git a/src/starboard/contrib/creator/ci20x11/gcc/6.3.mti/gyp_configuration.py b/src/starboard/contrib/creator/ci20x11/gcc/6.3.mti/gyp_configuration.py
deleted file mode 100644
index bb6d085..0000000
--- a/src/starboard/contrib/creator/ci20x11/gcc/6.3.mti/gyp_configuration.py
+++ /dev/null
@@ -1,74 +0,0 @@
-# Copyright 2018 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Starboard Creator CI20 X11 MTI gcc 6.3 platform configuration."""
-
-import logging
-import os
-
-from starboard.contrib.creator.shared import gyp_configuration as shared_configuration
-from starboard.tools.testing import test_filter
-
-
-class PlatformConfig(shared_configuration.CreatorConfiguration):
-  """Starboard Creator platform configuration."""
-
-  def __init__(self, platform):
-    super(PlatformConfig, self).__init__(platform)
-
-  def GetVariables(self, configuration):
-    variables = super(PlatformConfig, self).GetVariables(configuration)
-    variables.update({
-        'clang': 0,
-    })
-    toolchain_lib_path = os.path.join(self.toolchain_dir, 'lib')
-    variables.update({
-        'toolchain_lib_path': toolchain_lib_path,
-    })
-    return variables
-
-  def GetEnvironmentVariables(self):
-    env_variables = super(PlatformConfig, self).GetEnvironmentVariables()
-    self.toolchain_dir = os.path.join(self.ci20_home, 'mti')
-    toolchain_bin_dir = os.path.join(self.toolchain_dir, 'bin')
-    env_variables.update({
-        'CC': os.path.join(toolchain_bin_dir, 'mips-mti-linux-gnu-gcc'),
-        'CXX': os.path.join(toolchain_bin_dir, 'mips-mti-linux-gnu-g++'),
-        'CC_host': 'gcc',
-        'CXX_host': 'g++',
-        'LD_host': 'g++',
-        'ARFLAGS_host': 'rcs',
-        'ARTHINFLAGS_host': 'rcsT',
-    })
-    return env_variables
-
-  def GetTestFilters(self):
-    filters = super(PlatformConfig, self).GetTestFilters()
-    filters.extend([
-        # tests fail also on x86
-        test_filter.TestFilter('nplb', 'SbSystemSymbolizeTest.SunnyDay'),
-        test_filter.TestFilter('nplb',
-                               'SbSystemGetStackTest.SunnyDayStackDirection'),
-        test_filter.TestFilter('nplb', 'SbSystemGetStackTest.SunnyDay'),
-        test_filter.TestFilter('nplb',
-                               'SbSystemGetStackTest.SunnyDayShortStack'),
-    ])
-    return filters
-
-
-def CreatePlatformConfig():
-  try:
-    return PlatformConfig('creator-ci20x11-gcc-6-3-mti')
-  except RuntimeError as e:
-    logging.critical(e)
-    return None
diff --git a/src/starboard/contrib/creator/ci20x11/gcc/6.3.mti/starboard_platform.gyp b/src/starboard/contrib/creator/ci20x11/gcc/6.3.mti/starboard_platform.gyp
deleted file mode 100644
index 62323ca..0000000
--- a/src/starboard/contrib/creator/ci20x11/gcc/6.3.mti/starboard_platform.gyp
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright 2018 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-{
-  'includes': [
-    '../starboard_platform.gyp',
-  ],
-}
diff --git a/src/starboard/contrib/creator/ci20x11/gcc/6.3.mti/thread_types_public.h b/src/starboard/contrib/creator/ci20x11/gcc/6.3.mti/thread_types_public.h
deleted file mode 100644
index 3b30f05..0000000
--- a/src/starboard/contrib/creator/ci20x11/gcc/6.3.mti/thread_types_public.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2018 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef STARBOARD_CONTRIB_CREATOR_CI20X11_GCC_6_3_MTI_THREAD_TYPES_PUBLIC_H_
-#define STARBOARD_CONTRIB_CREATOR_CI20X11_GCC_6_3_MTI_THREAD_TYPES_PUBLIC_H_
-
-#include "starboard/linux/shared/thread_types_public.h"
-
-#endif  // STARBOARD_CONTRIB_CREATOR_CI20X11_GCC_6_3_MTI_THREAD_TYPES_PUBLIC_H_
diff --git a/src/starboard/contrib/creator/ci20x11/gcc/gyp_configuration.gypi b/src/starboard/contrib/creator/ci20x11/gcc/gyp_configuration.gypi
deleted file mode 100644
index 306a753..0000000
--- a/src/starboard/contrib/creator/ci20x11/gcc/gyp_configuration.gypi
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright 2016 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-{
-  'variables': {
-
-  },
-  'includes': [
-    '../libraries.gypi',
-    '../../shared/gyp_configuration.gypi',
-  ],
-}
diff --git a/src/starboard/contrib/creator/ci20x11/gcc/starboard_platform.gyp b/src/starboard/contrib/creator/ci20x11/gcc/starboard_platform.gyp
deleted file mode 100644
index 3d68745..0000000
--- a/src/starboard/contrib/creator/ci20x11/gcc/starboard_platform.gyp
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright 2016 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-{
-  'includes': [
-    '../starboard_platform.gyp',
-  ],
-}
diff --git a/src/starboard/contrib/creator/ci20x11/gyp_configuration.gypi b/src/starboard/contrib/creator/ci20x11/gyp_configuration.gypi
deleted file mode 100644
index 58e1d66..0000000
--- a/src/starboard/contrib/creator/ci20x11/gyp_configuration.gypi
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright 2016 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-{
-  'variables': {
-    'gl_type': 'system_gles2',
-  },
-  'target_defaults': {
-    'default_configuration': 'creator-ci20x11_debug',
-    'configurations': {
-      'creator-ci20x11_debug': {
-        'inherit_from': ['debug_base'],
-      },
-      'creator-ci20x11_devel': {
-        'inherit_from': ['devel_base'],
-      },
-      'creator-ci20x11_qa': {
-        'inherit_from': ['qa_base'],
-      },
-      'creator-ci20x11_gold': {
-        'inherit_from': ['gold_base'],
-      },
-    }, # end of configurations
-  },
-
-  'includes': [
-    'libraries.gypi',
-    '../shared/compiler_flags.gypi',
-    '../shared/gyp_configuration.gypi',
-  ],
-}
diff --git a/src/starboard/contrib/creator/ci20x11/gyp_configuration.py b/src/starboard/contrib/creator/ci20x11/gyp_configuration.py
deleted file mode 100644
index b612663..0000000
--- a/src/starboard/contrib/creator/ci20x11/gyp_configuration.py
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright 2016 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Starboard Creator Ci20 X11 platform configuration."""
-
-from starboard.contrib.creator.shared import gyp_configuration as shared_configuration
-from starboard.tools.toolchain import ar
-from starboard.tools.toolchain import bash
-from starboard.tools.toolchain import clang
-from starboard.tools.toolchain import clangxx
-from starboard.tools.toolchain import cp
-from starboard.tools.toolchain import touch
-
-
-class CreatorCI20X11Configuration(shared_configuration.CreatorConfiguration):
-  """Starboard Creator X11 platform configuration."""
-
-  def __init__(self, platform_name='creator-ci20x11'):
-    super(CreatorCI20X11Configuration, self).__init__(platform_name)
-
-  def GetTargetToolchain(self, **kwargs):
-    return self.GetHostToolchain(**kwargs)
-
-  def GetHostToolchain(self, **kwargs):
-    environment_variables = self.GetEnvironmentVariables()
-    cc_path = environment_variables['CC']
-    cxx_path = environment_variables['CXX']
-
-    return [
-        clang.CCompiler(path=cc_path),
-        clang.CxxCompiler(path=cxx_path),
-        clang.AssemblerWithCPreprocessor(path=cc_path),
-        ar.StaticThinLinker(),
-        ar.StaticLinker(),
-        clangxx.ExecutableLinker(path=cxx_path),
-        clangxx.SharedLibraryLinker(path=cxx_path),
-        cp.Copy(),
-        touch.Stamp(),
-        bash.Shell(),
-    ]
-
-  def GetTestFilters(self):
-    filters = super(CreatorCI20X11Configuration, self).GetTestFilters()
-    return filters
-
-
-def CreatePlatformConfig():
-  return CreatorCI20X11Configuration()
diff --git a/src/starboard/contrib/creator/ci20x11/libraries.gypi b/src/starboard/contrib/creator/ci20x11/libraries.gypi
deleted file mode 100644
index 522384a..0000000
--- a/src/starboard/contrib/creator/ci20x11/libraries.gypi
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright 2014 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-{
-  'variables': {
-    # This platform uses a compositor to present the rendering output, so
-    # set the swap interval to update the buffer immediately. That buffer
-    # will then be presented by the compositor on its own time.
-    'cobalt_egl_swap_interval': 0,
-
-    # Hook into the swap buffers call to facilitate synchronization of the
-    # OpenGL output with the punch-through video layer.
-    'linker_flags': [
-      '-Wl,--wrap=eglSwapBuffers',
-    ],
-
-    'platform_libraries': [
-      '-lEGL',
-      '-lGLESv2',
-      '-lX11',
-      '-lXcomposite',
-      '-lXext',
-      '-lXrender',
-    ],
-  },
-}
diff --git a/src/starboard/contrib/creator/ci20x11/main.cc b/src/starboard/contrib/creator/ci20x11/main.cc
deleted file mode 100644
index 8176cff..0000000
--- a/src/starboard/contrib/creator/ci20x11/main.cc
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright 2016 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "starboard/configuration.h"
-#include "starboard/shared/signal/crash_signals.h"
-#include "starboard/shared/signal/suspend_signals.h"
-#include "starboard/shared/starboard/link_receiver.h"
-#include "starboard/shared/x11/application_x11.h"
-
-extern "C" SB_EXPORT_PLATFORM int main(int argc, char** argv) {
-  tzset();
-  starboard::shared::signal::InstallCrashSignalHandlers();
-  starboard::shared::signal::InstallSuspendSignalHandlers();
-  starboard::shared::x11::ApplicationX11 application;
-  int result = 0;
-  {
-    starboard::shared::starboard::LinkReceiver receiver(&application);
-    result = application.Run(argc, argv);
-  }
-  starboard::shared::signal::UninstallSuspendSignalHandlers();
-  starboard::shared::signal::UninstallCrashSignalHandlers();
-  return result;
-}
diff --git a/src/starboard/contrib/creator/ci20x11/mozjs/atomic_public.h b/src/starboard/contrib/creator/ci20x11/mozjs/atomic_public.h
deleted file mode 100644
index 534eeae..0000000
--- a/src/starboard/contrib/creator/ci20x11/mozjs/atomic_public.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2018 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef STARBOARD_CONTRIB_CREATOR_CI20X11_MOZJS_ATOMIC_PUBLIC_H_
-#define STARBOARD_CONTRIB_CREATOR_CI20X11_MOZJS_ATOMIC_PUBLIC_H_
-
-#include "starboard/linux/shared/atomic_public.h"
-
-#endif  // STARBOARD_CONTRIB_CREATOR_CI20X11_MOZJS_ATOMIC_PUBLIC_H_
diff --git a/src/starboard/contrib/creator/ci20x11/mozjs/configuration_public.h b/src/starboard/contrib/creator/ci20x11/mozjs/configuration_public.h
deleted file mode 100644
index 2dcdb7b..0000000
--- a/src/starboard/contrib/creator/ci20x11/mozjs/configuration_public.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2018 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef STARBOARD_CONTRIB_CREATOR_CI20X11_MOZJS_CONFIGURATION_PUBLIC_H_
-#define STARBOARD_CONTRIB_CREATOR_CI20X11_MOZJS_CONFIGURATION_PUBLIC_H_
-
-#include "starboard/contrib/creator/shared/configuration_public.h"
-
-#endif  // STARBOARD_CONTRIB_CREATOR_CI20X11_MOZJS_CONFIGURATION_PUBLIC_H_
diff --git a/src/starboard/contrib/creator/ci20x11/mozjs/gyp_configuration.gypi b/src/starboard/contrib/creator/ci20x11/mozjs/gyp_configuration.gypi
deleted file mode 100644
index 54be982..0000000
--- a/src/starboard/contrib/creator/ci20x11/mozjs/gyp_configuration.gypi
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright 2018 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-{
-  'variables': {
-    'gl_type': 'system_gles2',
-  },
-  'target_defaults': {
-    'default_configuration': 'creator-ci20x11-mozjs_debug',
-    'configurations': {
-      'creator-ci20x11-mozjs_debug': {
-        'inherit_from': ['debug_base'],
-      },
-      'creator-ci20x11-mozjs_devel': {
-        'inherit_from': ['devel_base'],
-      },
-      'creator-ci20x11-mozjs_qa': {
-        'inherit_from': ['qa_base'],
-      },
-      'creator-ci20x11-mozjs_gold': {
-        'inherit_from': ['gold_base'],
-      },
-    }, # end of configurations
-  },
-
-  'includes': [
-    '../libraries.gypi',
-    '../../shared/compiler_flags.gypi',
-    '../../shared/gyp_configuration.gypi',
-  ],
-}
diff --git a/src/starboard/contrib/creator/ci20x11/mozjs/gyp_configuration.py b/src/starboard/contrib/creator/ci20x11/mozjs/gyp_configuration.py
deleted file mode 100644
index a7c0f12..0000000
--- a/src/starboard/contrib/creator/ci20x11/mozjs/gyp_configuration.py
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright 2018 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Starboard Creator Ci20 X11 mozjs platform configuration."""
-
-from starboard.contrib.creator.shared import gyp_configuration as shared_configuration
-from starboard.tools.toolchain import ar
-from starboard.tools.toolchain import bash
-from starboard.tools.toolchain import clang
-from starboard.tools.toolchain import clangxx
-from starboard.tools.toolchain import cp
-from starboard.tools.toolchain import touch
-
-
-class CreatorCI20X11MozjsConfiguration(shared_configuration.CreatorConfiguration):
-  """Starboard Creator X11 mozjs platform configuration."""
-
-  def __init__(self, platform_name='creator-ci20x11-mozjs'):
-    super(CreatorCI20X11MozjsConfiguration, self).__init__(platform_name)
-
-  def GetVariables(self, config_name):
-    variables = super(CreatorCI20X11MozjsConfiguration, self).GetVariables(
-        config_name)
-    variables.update({
-        'javascript_engine': 'mozjs-45',
-        'cobalt_enable_jit': 0,
-    })
-
-    return variables
-
-def CreatePlatformConfig():
-  return CreatorCI20X11MozjsConfiguration()
diff --git a/src/starboard/contrib/creator/ci20x11/mozjs/starboard_platform.gyp b/src/starboard/contrib/creator/ci20x11/mozjs/starboard_platform.gyp
deleted file mode 100644
index bc313df..0000000
--- a/src/starboard/contrib/creator/ci20x11/mozjs/starboard_platform.gyp
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 2018 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-{
-  'includes': [
-    '../starboard_platform.gypi'
-  ],
-  'targets': [
-    {
-      'target_name': 'starboard_platform',
-      'type': 'static_library',
-      'sources': [
-        '<@(starboard_platform_sources)',
-        '<(DEPTH)/starboard/shared/starboard/player/video_dmp_common.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/video_dmp_common.h',
-        '<(DEPTH)/starboard/shared/starboard/player/video_dmp_writer.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/video_dmp_writer.h',
-      ],
-      'defines': [
-        'SB_PLAYER_ENABLE_VIDEO_DUMPER',
-        # This must be defined when building Starboard, and must not when
-        # building Starboard client code.
-        'STARBOARD_IMPLEMENTATION',
-      ],
-      'dependencies': [
-        '<@(starboard_platform_dependencies)',
-      ],
-    },
-  ],
-}
diff --git a/src/starboard/contrib/creator/ci20x11/mozjs/thread_types_public.h b/src/starboard/contrib/creator/ci20x11/mozjs/thread_types_public.h
deleted file mode 100644
index 5038e89..0000000
--- a/src/starboard/contrib/creator/ci20x11/mozjs/thread_types_public.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2018 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef STARBOARD_CONTRIB_CREATOR_CI20X11_MOZJS_THREAD_TYPES_PUBLIC_H_
-#define STARBOARD_CONTRIB_CREATOR_CI20X11_MOZJS_THREAD_TYPES_PUBLIC_H_
-
-#include "starboard/linux/shared/thread_types_public.h"
-
-#endif  // STARBOARD_CONTRIB_CREATOR_CI20X11_MOZJS_THREAD_TYPES_PUBLIC_H_
diff --git a/src/starboard/contrib/creator/ci20x11/starboard_platform.gyp b/src/starboard/contrib/creator/ci20x11/starboard_platform.gyp
deleted file mode 100644
index 87eb8bd..0000000
--- a/src/starboard/contrib/creator/ci20x11/starboard_platform.gyp
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 2016 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-{
-  'includes': [
-    'starboard_platform.gypi'
-  ],
-  'targets': [
-    {
-      'target_name': 'starboard_platform',
-      'type': 'static_library',
-      'sources': [
-        '<@(starboard_platform_sources)',
-        '<(DEPTH)/starboard/shared/starboard/player/video_dmp_common.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/video_dmp_common.h',
-        '<(DEPTH)/starboard/shared/starboard/player/video_dmp_writer.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/video_dmp_writer.h',
-      ],
-      'defines': [
-        'SB_PLAYER_ENABLE_VIDEO_DUMPER',
-        # This must be defined when building Starboard, and must not when
-        # building Starboard client code.
-        'STARBOARD_IMPLEMENTATION',
-      ],
-      'dependencies': [
-        '<@(starboard_platform_dependencies)',
-      ],
-    },
-  ],
-}
diff --git a/src/starboard/contrib/creator/ci20x11/starboard_platform.gypi b/src/starboard/contrib/creator/ci20x11/starboard_platform.gypi
deleted file mode 100644
index b7446e0..0000000
--- a/src/starboard/contrib/creator/ci20x11/starboard_platform.gypi
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright 2016 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-{
-  'includes': ['../shared/starboard_platform.gypi'],
-
-  'variables': {
-    'starboard_platform_sources': [
-      '<(DEPTH)/starboard/contrib/creator/ci20x11/atomic_public.h',
-      '<(DEPTH)/starboard/contrib/creator/ci20x11/configuration_public.h',
-      '<(DEPTH)/starboard/contrib/creator/ci20x11/main.cc',
-      '<(DEPTH)/starboard/contrib/creator/ci20x11/egl_workaround.cc',
-      '<(DEPTH)/starboard/contrib/creator/ci20x11/system_get_property.cc',
-      '<(DEPTH)/starboard/shared/starboard/link_receiver.cc',
-      '<(DEPTH)/starboard/shared/x11/application_x11.cc',
-      '<(DEPTH)/starboard/shared/x11/egl_swap_buffers.cc',
-      '<(DEPTH)/starboard/shared/x11/player_set_bounds.cc',
-      '<(DEPTH)/starboard/shared/x11/window_create.cc',
-      '<(DEPTH)/starboard/shared/x11/window_destroy.cc',
-      '<(DEPTH)/starboard/shared/x11/window_get_platform_handle.cc',
-      '<(DEPTH)/starboard/shared/x11/window_get_size.cc',
-      '<(DEPTH)/starboard/shared/x11/window_internal.cc',
-    ],
-
-    # Exclude shared implementations specified by the included .gypi if this
-    # file already specifies a platform-specific version.
-    'starboard_platform_sources!': [
-      '<(DEPTH)/starboard/shared/starboard/player/player_set_bounds.cc',
-    ],
-  },
-}
diff --git a/src/starboard/contrib/creator/ci20x11/system_get_property.cc b/src/starboard/contrib/creator/ci20x11/system_get_property.cc
deleted file mode 100644
index 43dabb3..0000000
--- a/src/starboard/contrib/creator/ci20x11/system_get_property.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright 2016 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "starboard/system.h"
-
-#include <netdb.h>
-#include <linux/if.h>  // NOLINT(build/include_alpha)
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-
-#include "starboard/common/log.h"
-#include "starboard/common/string.h"
-
-namespace {
-
-const char kFriendlyName[] = "Creator Ci20";
-const char kPlatformName[] = "Creator Ci20 JZ4780";
-
-bool CopyStringAndTestIfSuccess(char* out_value,
-                                int value_length,
-                                const char* from_value) {
-  if (SbStringGetLength(from_value) + 1 > value_length)
-    return false;
-  SbStringCopy(out_value, from_value, value_length);
-  return true;
-}
-
-}  // namespace
-
-bool SbSystemGetProperty(SbSystemPropertyId property_id,
-                         char* out_value,
-                         int value_length) {
-  if (!out_value || !value_length) {
-    return false;
-  }
-
-  switch (property_id) {
-    case kSbSystemPropertyBrandName:
-    case kSbSystemPropertyChipsetModelNumber:
-    case kSbSystemPropertyFirmwareVersion:
-    case kSbSystemPropertyModelName:
-    case kSbSystemPropertyModelYear:
-#if SB_API_VERSION >= 11
-    case kSbSystemPropertyOriginalDesignManufacturerName:
-#else
-    case kSbSystemPropertyNetworkOperatorName:
-#endif
-    case kSbSystemPropertySpeechApiKey:
-      return false;
-
-    case kSbSystemPropertyFriendlyName:
-      return CopyStringAndTestIfSuccess(out_value, value_length, kFriendlyName);
-
-    case kSbSystemPropertyPlatformName:
-      return CopyStringAndTestIfSuccess(out_value, value_length, kPlatformName);
-
-    default:
-      SB_DLOG(WARNING) << __FUNCTION__
-                       << ": Unrecognized property: " << property_id;
-      break;
-  }
-
-  return false;
-}
diff --git a/src/starboard/contrib/creator/ci20x11/thread_types_public.h b/src/starboard/contrib/creator/ci20x11/thread_types_public.h
deleted file mode 100644
index 3fcfca9..0000000
--- a/src/starboard/contrib/creator/ci20x11/thread_types_public.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2016 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef STARBOARD_CONTRIB_CREATOR_CI20X11_THREAD_TYPES_PUBLIC_H_
-#define STARBOARD_CONTRIB_CREATOR_CI20X11_THREAD_TYPES_PUBLIC_H_
-
-#include "starboard/linux/shared/thread_types_public.h"
-
-#endif  // STARBOARD_CONTRIB_CREATOR_CI20X11_THREAD_TYPES_PUBLIC_H_
diff --git a/src/starboard/contrib/creator/shared/__init__.py b/src/starboard/contrib/creator/shared/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/src/starboard/contrib/creator/shared/__init__.py
+++ /dev/null
diff --git a/src/starboard/contrib/creator/shared/_env.py b/src/starboard/contrib/creator/shared/_env.py
deleted file mode 100644
index 021908e..0000000
--- a/src/starboard/contrib/creator/shared/_env.py
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Copyright 2017 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-"""Ask the parent directory to load the project environment."""
-
-from imp import load_source
-from os import path
-import sys
-
-_ENV = path.abspath(path.join(path.dirname(__file__), path.pardir, '_env.py'))
-if not path.exists(_ENV):
-  print '%s: Can\'t find repo root.\nMissing parent: %s' % (__file__, _ENV)
-  sys.exit(1)
-load_source('', _ENV)
diff --git a/src/starboard/contrib/creator/shared/compiler_flags.gypi b/src/starboard/contrib/creator/shared/compiler_flags.gypi
deleted file mode 100644
index 28873bf..0000000
--- a/src/starboard/contrib/creator/shared/compiler_flags.gypi
+++ /dev/null
@@ -1,164 +0,0 @@
-# Copyright 2016 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Platform specific compiler flags for Linux on Starboard. Included from
-# gyp_configuration.gypi.
-#
-{
-  'variables': {
-    'compiler_flags_host': [
-      '-O2',
-    ],
-    'linker_flags': [
-    ],
-    'compiler_flags_debug': [
-      '-frtti',
-      '-O0',
-    ],
-    'compiler_flags_devel': [
-      '-frtti',
-      '-O2',
-    ],
-    'compiler_flags_qa': [
-      '-fno-rtti',
-      '-O2',
-      '-gline-tables-only',
-    ],
-    'compiler_flags_gold': [
-      '-fno-rtti',
-      '-O2',
-      '-gline-tables-only',
-    ],
-    'conditions': [
-      ['clang==1', {
-        'linker_flags': [
-          '-fuse-ld=lld',
-          '--target=mipsel-linux-gnu',
-          '--gcc-toolchain=<(sysroot)/..',
-        ],
-        'common_clang_flags': [
-          '-Werror',
-          '-fcolor-diagnostics',
-          # Default visibility to hidden, to enable dead stripping.
-          '-fvisibility=hidden',
-          # Warn for implicit type conversions that may change a value.
-          '-Wconversion',
-          '-Wno-c++11-compat',
-          # This complains about 'override', which we use heavily.
-          '-Wno-c++11-extensions',
-          # Warns on switches on enums that cover all enum values but
-          # also contain a default: branch. Chrome is full of that.
-          '-Wno-covered-switch-default',
-          # protobuf uses hash_map.
-          '-Wno-deprecated',
-          '-fno-exceptions',
-          # Don't warn about the "struct foo f = {0};" initialization pattern.
-          '-Wno-missing-field-initializers',
-          # Do not warn for implicit sign conversions.
-          '-Wno-sign-conversion',
-          '-fno-strict-aliasing',  # See http://crbug.com/32204
-          '-Wno-unnamed-type-template-args',
-          # Triggered by the COMPILE_ASSERT macro.
-          '-Wno-unused-local-typedef',
-          # Do not warn if a function or variable cannot be implicitly
-          # instantiated.
-          '-Wno-undefined-var-template',
-          # Do not warn about an implicit exception spec mismatch.
-          '-Wno-implicit-exception-spec-mismatch',
-          # needed for backtrace()
-          '-fasynchronous-unwind-tables',
-          '-Wno-tautological-constant-out-of-range-compare',
-          '-Wno-undefined-inline',
-        ],
-      }],
-      ['cobalt_fastbuild==0', {
-        'compiler_flags_debug': [
-          '-g',
-        ],
-        'compiler_flags_devel': [
-          '-g',
-        ],
-        'compiler_flags_qa': [
-          '-gline-tables-only',
-        ],
-        'compiler_flags_gold': [
-          '-gline-tables-only',
-        ],
-      }],
-    ],
-  },
-
-  'target_defaults': {
-    'defines': [
-      # By default, <EGL/eglplatform.h> pulls in some X11 headers that have some
-      # nasty macros (|Status|, for example) that conflict with Chromium base.
-      'MESA_EGL_NO_X11_HEADERS'
-    ],
-    'target_conditions': [
-      ['clang==1', {
-        'cflags_c': [
-          '-std=c11',
-          '--target=mipsel-linux-gnu',
-          '-march=mipsel',
-          '-mcpu=mips32r2',
-          '--gcc-toolchain=<(sysroot)/..',
-        ],
-        'cflags_cc': [
-          '-std=gnu++11',
-          '--target=mipsel-linux-gnu',
-          '-march=mipsel',
-          '-mcpu=mips32r2',
-        ],
-      },{
-        # gcc
-        'cflags_c': [
-          '-std=c11',
-          '-EL',
-        ],
-        'cflags_cc': [
-          '-std=gnu++11',
-          '-Wno-literal-suffix',
-          # needed for backtrace()
-          '-fasynchronous-unwind-tables',
-        ],
-      }],
-      ['sb_pedantic_warnings==1', {
-        'cflags': [
-          '-Wall',
-          '-Wextra',
-          '-Wunreachable-code',
-          '<@(common_clang_flags)',
-        ],
-      },{
-        'cflags': [
-          '<@(common_clang_flags)',
-          # 'this' pointer cannot be NULL...pointer may be assumed
-          # to always convert to true.
-          '-Wno-undefined-bool-conversion',
-          # Skia doesn't use overrides.
-          '-Wno-inconsistent-missing-override',
-          # Do not warn about unused function params.
-          '-Wno-unused-parameter',
-          # Do not warn for implicit type conversions that may change a value.
-          '-Wno-conversion',
-          # shifting a negative signed value is undefined
-          '-Wno-shift-negative-value',
-          # Width of bit-field exceeds width of its type- value will be truncated
-          '-Wno-bitfield-width',
-          '-Wno-undefined-var-template',
-        ],
-      }],
-    ],
-  }, # end of target_defaults
-}
diff --git a/src/starboard/contrib/creator/shared/configuration_public.h b/src/starboard/contrib/creator/shared/configuration_public.h
deleted file mode 100644
index fd0c46f..0000000
--- a/src/starboard/contrib/creator/shared/configuration_public.h
+++ /dev/null
@@ -1,420 +0,0 @@
-// Copyright 2016 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// The shared Starboard configuration for Creator devices.
-
-#ifndef STARBOARD_CONTRIB_CREATOR_SHARED_CONFIGURATION_PUBLIC_H_
-#define STARBOARD_CONTRIB_CREATOR_SHARED_CONFIGURATION_PUBLIC_H_
-
-// --- Architecture Configuration --------------------------------------------
-
-// Whether the current platform is big endian. SB_IS_LITTLE_ENDIAN will be
-// automatically set based on this.
-#define SB_IS_BIG_ENDIAN 0
-
-// Whether the current platform is an ARM architecture.
-#define SB_IS_ARCH_ARM 0
-
-// Whether the current platform is a MIPS architecture.
-#define SB_IS_ARCH_MIPS 1
-
-// Whether the current platform is a PPC architecture.
-#define SB_IS_ARCH_PPC 0
-
-// Whether the current platform is an x86 architecture.
-#define SB_IS_ARCH_X86 0
-
-// Whether the current platform is a 32-bit architecture.
-#define SB_IS_32_BIT 1
-
-// Whether the current platform is a 64-bit architecture.
-#define SB_IS_64_BIT 0
-
-// Whether the current platform's pointers are 32-bit.
-// Whether the current platform's longs are 32-bit.
-#if SB_IS(32_BIT)
-#define SB_HAS_32_BIT_POINTERS 1
-#define SB_HAS_32_BIT_LONG 1
-#else
-#define SB_HAS_32_BIT_POINTERS 0
-#define SB_HAS_32_BIT_LONG 0
-#endif
-
-// Whether the current platform's pointers are 64-bit.
-// Whether the current platform's longs are 64-bit.
-#if SB_IS(64_BIT)
-#define SB_HAS_64_BIT_POINTERS 1
-#define SB_HAS_64_BIT_LONG 1
-#else
-#define SB_HAS_64_BIT_POINTERS 0
-#define SB_HAS_64_BIT_LONG 0
-#endif
-
-// Configuration parameters that allow the application to make some general
-// compile-time decisions with respect to the the number of cores likely to be
-// available on this platform. For a definitive measure, the application should
-// still call SbSystemGetNumberOfProcessors at runtime.
-
-// Whether the current platform's thread scheduler will automatically balance
-// threads between cores, as opposed to systems where threads will only ever run
-// on the specifically pinned core.
-#define SB_HAS_CROSS_CORE_SCHEDULER 1
-
-// The API version implemented by this platform.
-#define SB_API_VERSION SB_EXPERIMENTAL_API_VERSION
-
-// --- System Header Configuration -------------------------------------------
-
-// Any system headers listed here that are not provided by the platform will be
-// emulated in starboard/types.h.
-
-// Whether the current platform provides the standard header stdarg.h.
-#define SB_HAS_STDARG_H 1
-
-// Whether the current platform provides the standard header stdbool.h.
-#define SB_HAS_STDBOOL_H 1
-
-// Whether the current platform provides the standard header stddef.h.
-#define SB_HAS_STDDEF_H 1
-
-// Whether the current platform provides the standard header stdint.h.
-#define SB_HAS_STDINT_H 1
-
-// Whether the current platform provides the standard header inttypes.h.
-#define SB_HAS_INTTYPES_H 1
-
-// Whether the current platform provides the standard header limits.h.
-#define SB_HAS_LIMITS_H 1
-
-// Whether the current platform provides the standard header float.h.
-#define SB_HAS_FLOAT_H 1
-
-// Whether the current platform provides ssize_t.
-#define SB_HAS_SSIZE_T 1
-
-// Type detection for wchar_t.
-#if defined(__WCHAR_MAX__) && \
-    (__WCHAR_MAX__ == 0x7fffffff || __WCHAR_MAX__ == 0xffffffff)
-#define SB_IS_WCHAR_T_UTF32 1
-#elif defined(__WCHAR_MAX__) && \
-    (__WCHAR_MAX__ == 0x7fff || __WCHAR_MAX__ == 0xffff)
-#define SB_IS_WCHAR_T_UTF16 1
-#endif
-
-// Chrome only defines these two if ARMEL or MIPSEL are defined.
-#if defined(__ARMEL__)
-// Chrome has an exclusion for iOS here, we should too when we support iOS.
-#define SB_IS_WCHAR_T_UNSIGNED 1
-#elif defined(__MIPSEL__)
-#define SB_IS_WCHAR_T_SIGNED 1
-#endif
-
-// --- Compiler Configuration ------------------------------------------------
-
-// The platform's annotation for forcing a C function to be inlined.
-#define SB_C_FORCE_INLINE __inline__ __attribute__((always_inline))
-
-// The platform's annotation for marking a C function as suggested to be
-// inlined.
-#define SB_C_INLINE inline
-
-// The platform's annotation for marking a C function as forcibly not
-// inlined.
-#define SB_C_NOINLINE __attribute__((noinline))
-
-// The platform's annotation for marking a symbol as exported outside of the
-// current shared library.
-#define SB_EXPORT_PLATFORM __attribute__((visibility("default")))
-
-// The platform's annotation for marking a symbol as imported from outside of
-// the current linking unit.
-#define SB_IMPORT_PLATFORM
-
-// --- Extensions Configuration ----------------------------------------------
-
-// Do not use <unordered_map> and <unordered_set> for the hash table types.
-#define SB_HAS_STD_UNORDERED_HASH 0
-
-// GCC/Clang doesn't define a long long hash function, except for Android and
-// Game consoles.
-#define SB_HAS_LONG_LONG_HASH 0
-
-// GCC/Clang doesn't define a string hash function, except for Game Consoles.
-#define SB_HAS_STRING_HASH 0
-
-// Desktop Linux needs a using statement for the hash functions.
-#define SB_HAS_HASH_USING 0
-
-// Set this to 1 if hash functions for custom types can be defined as a
-// hash_value() function. Otherwise, they need to be placed inside a
-// partially-specified hash struct template with an operator().
-#define SB_HAS_HASH_VALUE 0
-
-// Set this to 1 if use of hash_map or hash_set causes a deprecation warning
-// (which then breaks the build).
-#define SB_HAS_HASH_WARNING 1
-
-// The location to include hash_map on this platform.
-#define SB_HASH_MAP_INCLUDE <ext/hash_map>
-
-// C++'s hash_map and hash_set are often found in different namespaces depending
-// on the compiler.
-#define SB_HASH_NAMESPACE __gnu_cxx
-
-// The location to include hash_set on this platform.
-#define SB_HASH_SET_INCLUDE <ext/hash_set>
-
-// Define this to how this platform copies varargs blocks.
-#define SB_VA_COPY(dest, source) va_copy(dest, source)
-
-// --- Filesystem Configuration ----------------------------------------------
-
-// The current platform's maximum length of the name of a single directory
-// entry, not including the absolute path.
-#define SB_FILE_MAX_NAME 64
-
-// The current platform's maximum length of an absolute path.
-#define SB_FILE_MAX_PATH 4096
-
-// The current platform's maximum number of files that can be opened at the
-// same time by one process.
-#define SB_FILE_MAX_OPEN 256
-
-// The current platform's file path component separator character. This is the
-// character that appears after a directory in a file path. For example, the
-// absolute canonical path of the file "/path/to/a/file.txt" uses '/' as a path
-// component separator character.
-#define SB_FILE_SEP_CHAR '/'
-
-// The current platform's alternate file path component separator character.
-// This is like SB_FILE_SEP_CHAR, except if your platform supports an alternate
-// character, then you can place that here. For example, on windows machines,
-// the primary separator character is probably '\', but the alternate is '/'.
-#define SB_FILE_ALT_SEP_CHAR '/'
-
-// The current platform's search path component separator character. When
-// specifying an ordered list of absolute paths of directories to search for a
-// given reason, this is the character that appears between entries. For
-// example, the search path of "/etc/search/first:/etc/search/second" uses ':'
-// as a search path component separator character.
-#define SB_PATH_SEP_CHAR ':'
-
-// The string form of SB_FILE_SEP_CHAR.
-#define SB_FILE_SEP_STRING "/"
-
-// The string form of SB_FILE_ALT_SEP_CHAR.
-#define SB_FILE_ALT_SEP_STRING "/"
-
-// The string form of SB_PATH_SEP_CHAR.
-#define SB_PATH_SEP_STRING ":"
-
-// --- Graphics Configuration ------------------------------------------------
-
-// Specifies whether this platform supports a performant accelerated blitter
-// API. The basic requirement is a scaled, clipped, alpha-blended blit.
-#define SB_HAS_BLITTER 0
-
-// Specifies the preferred byte order of color channels in a pixel. Refer to
-// starboard/configuration.h for the possible values. EGL/GLES platforms should
-// generally prefer a byte order of RGBA, regardless of endianness.
-#define SB_PREFERRED_RGBA_BYTE_ORDER SB_PREFERRED_RGBA_BYTE_ORDER_RGBA
-
-// Indicates whether or not the given platform supports bilinear filtering.
-// This can be checked to enable/disable renderer tests that verify that this is
-// working properly.
-#define SB_HAS_BILINEAR_FILTERING_SUPPORT 1
-
-// Indicates whether or not the given platform supports rendering of NV12
-// textures. These textures typically originate from video decoders.
-#define SB_HAS_NV12_TEXTURE_SUPPORT 1
-
-// Whether the current platform should frequently flip their display buffer.
-// If this is not required (e.g. SB_MUST_FREQUENTLY_FLIP_DISPLAY_BUFFER is set
-// to 0), then optimizations where the display buffer is not flipped if the
-// scene hasn't changed are enabled.
-#define SB_MUST_FREQUENTLY_FLIP_DISPLAY_BUFFER 0
-
-// CI20 platform with 1.14 version of SGX libraries does not support
-// EGL_BIND_TO_TEXTURE_RGBA
-#define SB_HAS_QUIRK_NO_EGL_BIND_TO_TEXTURE 1
-
-// --- I/O Configuration -----------------------------------------------------
-
-// Whether the current platform has speech recognizer.
-#define SB_HAS_SPEECH_RECOGNIZER 0
-
-// Whether the current platform has speech synthesis.
-#define SB_HAS_SPEECH_SYNTHESIS 0
-
-#if SB_API_VERSION >= 8
-// Whether the current platform implements the on screen keyboard interface.
-#define SB_HAS_ON_SCREEN_KEYBOARD 0
-
-#endif  // SB_API_VERSION >= 8
-
-// --- Media Configuration ---------------------------------------------------
-
-// Specifies whether this platform has support for a possibly-decrypting
-// elementary stream player for at least H.264/AAC (and AES-128-CTR, if
-// decrypting). A player is responsible for ingesting an audio and video
-// elementary stream, optionally-encrypted, and ultimately producing
-// synchronized audio/video. If a player is defined, it must choose one of the
-// supported composition methods below.
-#define SB_HAS_PLAYER 1
-
-// The maximum audio bitrate the platform can decode.  The following value
-// equals to 5M bytes per seconds which is more than enough for compressed
-// audio.
-#define SB_MEDIA_MAX_AUDIO_BITRATE_IN_BITS_PER_SECOND (40 * 1024 * 1024)
-
-// The maximum video bitrate the platform can decode.  The following value
-// equals to 25M bytes per seconds which is more than enough for compressed
-// video.
-#define SB_MEDIA_MAX_VIDEO_BITRATE_IN_BITS_PER_SECOND (200 * 1024 * 1024)
-
-// Specifies whether this platform has webm/vp9 support.  This should be set to
-// non-zero on platforms with webm/vp9 support.
-#define SB_HAS_MEDIA_WEBM_VP9_SUPPORT 0
-
-// Specifies the stack size for threads created inside media stack.  Set to 0 to
-// use the default thread stack size.  Set to non-zero to explicitly set the
-// stack size for media stack threads.
-#define SB_MEDIA_THREAD_STACK_SIZE 0U
-
-// Specifies whether this platform updates audio frames asynchronously.  In such
-// case an extra parameter will be added to |SbAudioSinkConsumeFramesFunc| to
-// indicate the absolute time that the consumed audio frames are reported.
-// Check document for |SbAudioSinkConsumeFramesFunc| in audio_sink.h for more
-// details.
-#define SB_HAS_ASYNC_AUDIO_FRAMES_REPORTING 0
-
-// --- Decoder-only Params ---
-
-// Specifies how media buffers must be aligned on this platform as some
-// decoders may have special requirement on the alignment of buffers being
-// decoded.
-#define SB_MEDIA_BUFFER_ALIGNMENT 128U
-
-// Specifies how video frame buffers must be aligned on this platform.
-#define SB_MEDIA_VIDEO_FRAME_ALIGNMENT 256U
-
-// The encoded video frames are compressed in different ways, their decoding
-// time can vary a lot.  Occasionally a single frame can take longer time to
-// decode than the average time per frame.  The player has to cache some frames
-// to account for such inconsistency.  The number of frames being cached are
-// controlled by the following two macros.
-//
-// Specify the number of video frames to be cached before the playback starts.
-// Note that set this value too large may increase the playback start delay.
-#define SB_MEDIA_MAXIMUM_VIDEO_PREROLL_FRAMES 4
-
-// Specify the number of video frames to be cached during playback.  A large
-// value leads to more stable fps but also causes the app to use more memory.
-#define SB_MEDIA_MAXIMUM_VIDEO_FRAMES 12
-
-// --- Memory Configuration --------------------------------------------------
-
-// The memory page size, which controls the size of chunks on memory that
-// allocators deal with, and the alignment of those chunks. This doesn't have to
-// be the hardware-defined physical page size, but it should be a multiple of
-// it.
-#define SB_MEMORY_PAGE_SIZE 4096
-
-// Whether this platform has and should use an MMAP function to map physical
-// memory to the virtual address space.
-#if SB_API_VERSION < 12
-#define SB_HAS_MMAP 1
-#endif
-
-// Whether this platform can map executable memory. Implies SB_HAS_MMAP. This is
-// required for platforms that want to JIT.
-#define SB_CAN_MAP_EXECUTABLE_MEMORY 1
-
-// Whether this platform has and should use an growable heap (e.g. with sbrk())
-// to map physical memory to the virtual address space.
-#define SB_HAS_VIRTUAL_REGIONS 0
-
-// Specifies the alignment for IO Buffers, in bytes. Some low-level network APIs
-// may require buffers to have a specific alignment, and this is the place to
-// specify that.
-#define SB_NETWORK_IO_BUFFER_ALIGNMENT 16
-
-// Determines the alignment that allocations should have on this platform.
-#define SB_MALLOC_ALIGNMENT ((size_t)16U)
-
-// Determines the threshhold of allocation size that should be done with mmap
-// (if available), rather than allocated within the core heap.
-#define SB_DEFAULT_MMAP_THRESHOLD ((size_t)(256 * 1024U))
-
-// Defines the path where memory debugging logs should be written to.
-#define SB_MEMORY_LOG_PATH "/tmp/starboard"
-
-// --- Network Configuration -------------------------------------------------
-
-// Specifies whether this platform supports IPV6.
-#define SB_HAS_IPV6 1
-
-// Specifies whether this platform supports pipe.
-#define SB_HAS_PIPE 1
-
-// --- Thread Configuration --------------------------------------------------
-
-// Whether the current platform supports thread priorities.
-#define SB_HAS_THREAD_PRIORITY_SUPPORT 0
-
-// Defines the maximum number of simultaneous threads for this platform. Some
-// platforms require sharing thread handles with other kinds of system handles,
-// like mutexes, so we want to keep this managable.
-#define SB_MAX_THREADS 90
-
-// The maximum number of thread local storage keys supported by this platform.
-#define SB_MAX_THREAD_LOCAL_KEYS 512
-
-// The maximum length of the name for a thread, including the NULL-terminator.
-#define SB_MAX_THREAD_NAME_LENGTH 16
-
-// --- Timing API ------------------------------------------------------------
-
-// Whether this platform has an API to retrieve how long the current thread
-// has spent in the executing state.
-#define SB_HAS_TIME_THREAD_NOW 1
-
-// --- Tuneable Parameters ---------------------------------------------------
-
-// Specifies the network receive buffer size in bytes, set via
-// SbSocketSetReceiveBufferSize().
-//
-// Setting this to 0 indicates that SbSocketSetReceiveBufferSize() should
-// not be called. Use this for OSs (such as Linux) where receive buffer
-// auto-tuning is better.
-//
-// On some platforms, this may affect max TCP window size which may
-// dramatically affect throughput in the presence of latency.
-//
-// If your platform does not have a good TCP auto-tuning mechanism,
-// a setting of (128 * 1024) here is recommended.
-#define SB_NETWORK_RECEIVE_BUFFER_SIZE (0)
-
-// --- User Configuration ----------------------------------------------------
-
-// The maximum number of users that can be signed in at the same time.
-#define SB_USER_MAX_SIGNED_IN 1
-
-// --- Platform Specific Audits ----------------------------------------------
-
-#if !defined(__GNUC__)
-#error "CREATOR_SHARED builds need a GCC-like compiler (for the moment)."
-#endif
-
-#endif  // STARBOARD_CONTRIB_CREATOR_SHARED_CONFIGURATION_PUBLIC_H_
diff --git a/src/starboard/contrib/creator/shared/gyp_configuration.gypi b/src/starboard/contrib/creator/shared/gyp_configuration.gypi
deleted file mode 100644
index 68b7775..0000000
--- a/src/starboard/contrib/creator/shared/gyp_configuration.gypi
+++ /dev/null
@@ -1,76 +0,0 @@
-# Copyright 2016 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-{
-  'variables': {
-    # Override that omits the "data" subdirectory.
-    # TODO: Remove when omitted for all platforms in base_configuration.gypi.
-    'sb_static_contents_output_data_dir': '<(PRODUCT_DIR)/content',
-
-    'target_arch': 'mips',
-    'target_os': 'linux',
-
-    'cobalt_media_source_2016': 1,
-    'in_app_dial%': 0,
-    'rasterizer_type': 'direct-gles',
-    'scratch_surface_cache_size_in_bytes' : 0,
-
-    'platform_libraries': [
-      '-lasound',
-      '-lavcodec',
-      '-lavformat',
-      '-lavutil',
-      '-lm',
-      '-lpthread',
-      '-lrt',
-    ],
-
-    'compiler_flags': [
-      # We'll pretend not to be Linux, but Starboard instead.
-      '-U__linux__',
-      '--sysroot=<(sysroot)',
-      '-EL',
-    ],
-
-    'linker_flags': [
-      '--sysroot=<(sysroot)',
-      '-EL',
-
-      # We don't wrap these symbols, but this ensures that they aren't
-      # linked in.
-      '-Wl,--wrap=malloc',
-      '-Wl,--wrap=calloc',
-      '-Wl,--wrap=realloc',
-      '-Wl,--wrap=memalign',
-      '-Wl,--wrap=reallocalign',
-      '-Wl,--wrap=free',
-      '-Wl,--wrap=strdup',
-      '-Wl,--wrap=malloc_usable_size',
-      '-Wl,--wrap=malloc_stats_fast',
-      '-Wl,--wrap=__cxa_demangle',
-      '-Wl,--wrap=eglGetDisplay',
-      '-Wl,--wrap=eglTerminate',
-    ],
-  },
-
-  'target_defaults': {
-    'defines': [
-      # Cobalt on Linux flag
-      'COBALT_LINUX',
-      '__STDC_FORMAT_MACROS', # so that we get PRI*
-      # Enable GNU extensions to get prototypes like ffsl.
-      '_GNU_SOURCE=1',
-    ],
-  }, # end of target_defaults
-}
diff --git a/src/starboard/contrib/creator/shared/gyp_configuration.py b/src/starboard/contrib/creator/shared/gyp_configuration.py
deleted file mode 100644
index 0147acc..0000000
--- a/src/starboard/contrib/creator/shared/gyp_configuration.py
+++ /dev/null
@@ -1,144 +0,0 @@
-# Copyright 2016 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Starboard Creator Ci20 platform configuration."""
-
-import logging
-import os
-import sys
-
-from starboard.build import clang
-from starboard.build import platform_configuration
-from starboard.tools import build
-from starboard.tools.testing import test_filter
-
-
-class CreatorConfiguration(platform_configuration.PlatformConfiguration):
-  """Starboard ci20 platform configuration."""
-
-  def __init__(self, platform):
-    super(CreatorConfiguration, self).__init__(platform)
-    self.AppendApplicationConfigurationPath(os.path.dirname(__file__))
-
-  def _GetCi20Home(self):
-    try:
-      ci20_home = os.environ['CI20_HOME']
-    except KeyError:
-      logging.critical('ci20 builds require the `CI20_HOME\' '
-                       'environment variable to be set.')
-      sys.exit(1)
-    return ci20_home
-
-  def GetVariables(self, config_name):
-    relative_sysroot = os.path.join('sysroot')
-    sysroot = os.path.join(self.ci20_home, relative_sysroot)
-
-    if not os.path.isdir(sysroot):
-      logging.critical(
-          'ci20 builds require $CI20_HOME/%s to be a valid directory.',
-          relative_sysroot)
-      sys.exit(1)
-    variables = super(CreatorConfiguration, self).GetVariables(
-        config_name, use_clang=1)
-    variables.update({
-        'sysroot': sysroot,
-        'javascript_engine': 'v8',
-        'cobalt_enable_jit': 1,
-        'v8_target_arch': 'mipsel',
-        'mips_arch_variant': 'r2',
-        'mips_fpu_mode': 'fp32',
-        'mips_float_abi': 'hard',
-    })
-
-    return variables
-
-  def GetLauncherPath(self):
-    """Gets the path to the launcher module for this platform."""
-    # Use launcher.py from src/starboard/linux/shared/
-    linux_shared = os.path.join(
-        os.path.dirname(__file__), '..', '..', '..', 'linux', 'shared')
-    return linux_shared
-
-  def GetGeneratorVariables(self, config_name):
-    del config_name
-    generator_variables = {
-        'qtcreator_session_name_prefix': 'cobalt',
-    }
-    return generator_variables
-
-  def GetEnvironmentVariables(self):
-    self.ci20_home = self._GetCi20Home()
-    if not hasattr(self, 'host_compiler_environment'):
-      self.host_compiler_environment = build.GetHostCompilerEnvironment(
-          clang.GetClangSpecification(), False)
-    env_variables = self.host_compiler_environment
-    env_variables = {
-        'CC': self.host_compiler_environment['CC_host'],
-        'CXX': self.host_compiler_environment['CXX_host'],
-        'CC_host': 'gcc',
-        'CXX_host': 'g++',
-        'LD_host': 'g++',
-        'ARFLAGS_host': 'rcs',
-        'ARTHINFLAGS_host': 'rcsT',
-    }
-
-    return env_variables
-
-  def GetTestFilters(self):
-    filters = super(CreatorConfiguration, self).GetTestFilters()
-    filters.extend([
-        # test is disabled on x64
-        test_filter.TestFilter('bindings_test',
-                               ('GlobalInterfaceBindingsTest.'
-                                'PropertiesAndOperationsAreOwnProperties')),
-        # tests miss the defined delay
-        test_filter.TestFilter('nplb',
-                               'SbConditionVariableWaitTimedTest.SunnyDay'),
-        test_filter.TestFilter(
-            'nplb', 'SbConditionVariableWaitTimedTest.SunnyDayAutoInit'),
-        # tests sometimes miss the threshold of 10ms
-        test_filter.TestFilter(
-            'nplb', 'Semaphore.ThreadTakesWait_PutBeforeTimeExpires'),
-        test_filter.TestFilter('nplb', 'RWLock.HoldsLockForTime'),
-        # tests sometimes miss the threshold of 5ms
-        test_filter.TestFilter('nplb', 'Semaphore.ThreadTakesWait_TimeExpires'),
-        test_filter.TestFilter('nplb', 'SbWindowCreateTest.SunnyDayDefault'),
-        test_filter.TestFilter('nplb', 'SbWindowCreateTest.SunnyDayDefaultSet'),
-        test_filter.TestFilter('nplb',
-                               'SbWindowGetPlatformHandleTest.SunnyDay'),
-        test_filter.TestFilter('nplb', 'SbWindowGetSizeTest.SunnyDay'),
-        test_filter.TestFilter('nplb', 'SbPlayerTest.SunnyDay'),
-        # tests fail also on x86
-        test_filter.TestFilter(
-            'nplb',
-            ('SbSocketAddressTypes/SbSocketGetInterfaceAddressTest.'
-             'SunnyDayDestination/1')
-        ),
-        test_filter.TestFilter(
-            'nplb',
-            ('SbSocketAddressTypes/SbSocketGetInterfaceAddressTest.'
-             'SunnyDaySourceForDestination/1')
-        ),
-        test_filter.TestFilter(
-            'nplb',
-            ('SbSocketAddressTypes/SbSocketGetInterfaceAddressTest.'
-             'SunnyDaySourceNotLoopback/1')
-        ),
-        # there are no test cases in this test
-        test_filter.TestFilter('nplb_blitter_pixel_tests',
-                               test_filter.FILTER_ALL),
-        # test fails on x64 also
-        test_filter.TestFilter('net_unittests',
-                               'HostResolverImplDnsTest.DnsTaskUnspec'),
-    ])
-    return filters
diff --git a/src/starboard/contrib/creator/shared/media_is_video_supported.cc b/src/starboard/contrib/creator/shared/media_is_video_supported.cc
deleted file mode 100644
index 7775b0c..0000000
--- a/src/starboard/contrib/creator/shared/media_is_video_supported.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2017 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "starboard/shared/starboard/media/media_support_internal.h"
-
-#include "starboard/configuration.h"
-#include "starboard/configuration_constants.h"
-#include "starboard/media.h"
-#include "starboard/shared/starboard/media/media_util.h"
-
-bool SbMediaIsVideoSupported(SbMediaVideoCodec video_codec,
-                             int profile,
-                             int level,
-                             int bit_depth,
-                             SbMediaPrimaryId primary_id,
-                             SbMediaTransferId transfer_id,
-                             SbMediaMatrixId matrix_id,
-                             int frame_width,
-                             int frame_height,
-                             int64_t bitrate,
-                             int fps,
-                             bool decode_to_texture_required) {
-  using starboard::shared::starboard::media::IsSDRVideo;
-
-  if (!IsSDRVideo(bit_depth, primary_id, transfer_id, matrix_id)) {
-    return false;
-  }
-  if (decode_to_texture_required) {
-    // There is no Creator CI20 360 video implementation.
-    return false;
-  }
-  return video_codec == kSbMediaVideoCodecH264 && frame_width <= 1920 &&
-         frame_height <= 1080 &&
-         bitrate <= kSbMediaMaxVideoBitrateInBitsPerSecond && fps <= 30;
-}
diff --git a/src/starboard/contrib/creator/shared/player_components_impl.cc b/src/starboard/contrib/creator/shared/player_components_impl.cc
deleted file mode 100644
index 2e80e5a..0000000
--- a/src/starboard/contrib/creator/shared/player_components_impl.cc
+++ /dev/null
@@ -1,127 +0,0 @@
-// Copyright 2017 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "starboard/shared/starboard/player/filter/player_components.h"
-
-#include "starboard/common/ref_counted.h"
-#include "starboard/common/scoped_ptr.h"
-#include "starboard/media.h"
-#include "starboard/shared/ffmpeg/ffmpeg_audio_decoder.h"
-#include "starboard/shared/ffmpeg/ffmpeg_video_decoder.h"
-#include "starboard/shared/starboard/player/filter/adaptive_audio_decoder_internal.h"
-#include "starboard/shared/starboard/player/filter/audio_decoder_internal.h"
-#include "starboard/shared/starboard/player/filter/audio_renderer_sink.h"
-#include "starboard/shared/starboard/player/filter/audio_renderer_sink_impl.h"
-#include "starboard/shared/starboard/player/filter/punchout_video_renderer_sink.h"
-#include "starboard/shared/starboard/player/filter/video_decoder_internal.h"
-#include "starboard/shared/starboard/player/filter/video_render_algorithm.h"
-#include "starboard/shared/starboard/player/filter/video_render_algorithm_impl.h"
-#include "starboard/shared/starboard/player/filter/video_renderer_sink.h"
-
-namespace starboard {
-namespace shared {
-namespace starboard {
-namespace player {
-namespace filter {
-
-namespace {
-
-class PlayerComponentsImpl : public PlayerComponents {
-  void CreateAudioComponents(
-      const AudioParameters& audio_parameters,
-      scoped_ptr<AudioDecoder>* audio_decoder,
-      scoped_ptr<AudioRendererSink>* audio_renderer_sink) override {
-    SB_DCHECK(audio_decoder);
-    SB_DCHECK(audio_renderer_sink);
-
-#if SB_API_VERSION >= 11
-    auto decoder_creator = [](const SbMediaAudioSampleInfo& audio_sample_info,
-                              SbDrmSystem drm_system) {
-      typedef ::starboard::shared::ffmpeg::AudioDecoder AudioDecoderImpl;
-
-      scoped_ptr<AudioDecoderImpl> audio_decoder_impl(
-          AudioDecoderImpl::Create(audio_sample_info.codec, audio_sample_info));
-      if (audio_decoder_impl && audio_decoder_impl->is_valid()) {
-        return audio_decoder_impl.PassAs<AudioDecoder>();
-      }
-      return scoped_ptr<AudioDecoder>();
-    };
-
-    audio_decoder->reset(
-        new AdaptiveAudioDecoder(audio_parameters.audio_sample_info,
-                                 audio_parameters.drm_system, decoder_creator));
-#else   // SB_API_VERSION >= 11
-    typedef ::starboard::shared::ffmpeg::AudioDecoder AudioDecoderImpl;
-
-    scoped_ptr<AudioDecoderImpl> audio_decoder_impl(AudioDecoderImpl::Create(
-        audio_parameters.audio_codec, audio_parameters.audio_sample_info));
-    if (audio_decoder_impl && audio_decoder_impl->is_valid()) {
-      audio_decoder->reset(audio_decoder_impl.release());
-    } else {
-      audio_decoder->reset();
-    }
-#endif  // SB_API_VERSION >= 11
-    audio_renderer_sink->reset(new AudioRendererSinkImpl);
-  }
-
-  void CreateVideoComponents(
-      const VideoParameters& video_parameters,
-      scoped_ptr<VideoDecoder>* video_decoder,
-      scoped_ptr<VideoRenderAlgorithm>* video_render_algorithm,
-      scoped_refptr<VideoRendererSink>* video_renderer_sink) override {
-    typedef ::starboard::shared::ffmpeg::VideoDecoder FfmpegVideoDecoderImpl;
-
-    const SbTime kVideoSinkRenderInterval = 10 * kSbTimeMillisecond;
-
-    SB_DCHECK(video_decoder);
-    SB_DCHECK(video_render_algorithm);
-    SB_DCHECK(video_renderer_sink);
-
-    video_decoder->reset();
-
-    scoped_ptr<FfmpegVideoDecoderImpl> ffmpeg_video_decoder(
-        FfmpegVideoDecoderImpl::Create(
-            video_parameters.video_codec, video_parameters.output_mode,
-            video_parameters.decode_target_graphics_context_provider));
-    if (ffmpeg_video_decoder && ffmpeg_video_decoder->is_valid()) {
-      video_decoder->reset(ffmpeg_video_decoder.release());
-    }
-
-    video_render_algorithm->reset(new VideoRenderAlgorithmImpl);
-    *video_renderer_sink = new PunchoutVideoRendererSink(
-        video_parameters.player, kVideoSinkRenderInterval);
-  }
-
-  void GetAudioRendererParams(int* max_cached_frames,
-                              int* max_frames_per_append) const override {
-    SB_DCHECK(max_cached_frames);
-    SB_DCHECK(max_frames_per_append);
-
-    *max_cached_frames = 256 * 1024;
-    *max_frames_per_append = 16384;
-  }
-};
-
-}  // namespace
-
-// static
-scoped_ptr<PlayerComponents> PlayerComponents::Create() {
-  return make_scoped_ptr<PlayerComponents>(new PlayerComponentsImpl);
-}
-
-}  // namespace filter
-}  // namespace player
-}  // namespace starboard
-}  // namespace shared
-}  // namespace starboard
diff --git a/src/starboard/contrib/creator/shared/starboard_platform.gypi b/src/starboard/contrib/creator/shared/starboard_platform.gypi
deleted file mode 100644
index b63ce99..0000000
--- a/src/starboard/contrib/creator/shared/starboard_platform.gypi
+++ /dev/null
@@ -1,334 +0,0 @@
-# Copyright 2016 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-{
-  'includes': [
-    '<(DEPTH)/starboard/shared/starboard/player/filter/player_filter.gypi',
-  ],
-  'variables': {
-    'starboard_platform_sources': [
-      '<@(filter_based_player_sources)',
-      '<(DEPTH)/starboard/contrib/creator/shared/media_is_video_supported.cc',
-      '<(DEPTH)/starboard/contrib/creator/shared/player_components_impl.cc',
-      '<(DEPTH)/starboard/linux/shared/atomic_public.h',
-      '<(DEPTH)/starboard/linux/shared/decode_target_internal.h',
-      '<(DEPTH)/starboard/linux/shared/decode_target_internal.cc',
-      '<(DEPTH)/starboard/linux/shared/system_get_connection_type.cc',
-      '<(DEPTH)/starboard/linux/shared/system_get_device_type.cc',
-      '<(DEPTH)/starboard/linux/shared/system_get_path.cc',
-      '<(DEPTH)/starboard/linux/shared/system_has_capability.cc',
-      '<(DEPTH)/starboard/shared/alsa/alsa_audio_sink_type.cc',
-      '<(DEPTH)/starboard/shared/alsa/alsa_audio_sink_type.h',
-      '<(DEPTH)/starboard/shared/alsa/alsa_util.cc',
-      '<(DEPTH)/starboard/shared/alsa/alsa_util.h',
-      '<(DEPTH)/starboard/shared/alsa/audio_sink_get_max_channels.cc',
-      '<(DEPTH)/starboard/shared/alsa/audio_sink_get_nearest_supported_sample_frequency.cc',
-      '<(DEPTH)/starboard/shared/alsa/audio_sink_is_audio_frame_storage_type_supported.cc',
-      '<(DEPTH)/starboard/shared/alsa/audio_sink_is_audio_sample_type_supported.cc',
-      '<(DEPTH)/starboard/shared/dlmalloc/memory_allocate_aligned_unchecked.cc',
-      '<(DEPTH)/starboard/shared/dlmalloc/memory_allocate_unchecked.cc',
-      '<(DEPTH)/starboard/shared/dlmalloc/memory_free.cc',
-      '<(DEPTH)/starboard/shared/dlmalloc/memory_free_aligned.cc',
-      '<(DEPTH)/starboard/shared/dlmalloc/memory_map.cc',
-      '<(DEPTH)/starboard/shared/dlmalloc/memory_protect.cc',
-      '<(DEPTH)/starboard/shared/dlmalloc/memory_reallocate_unchecked.cc',
-      '<(DEPTH)/starboard/shared/dlmalloc/memory_unmap.cc',
-      '<(DEPTH)/starboard/shared/gcc/atomic_gcc_public.h',
-      '<(DEPTH)/starboard/shared/iso/character_is_alphanumeric.cc',
-      '<(DEPTH)/starboard/shared/iso/character_is_digit.cc',
-      '<(DEPTH)/starboard/shared/iso/character_is_hex_digit.cc',
-      '<(DEPTH)/starboard/shared/iso/character_is_space.cc',
-      '<(DEPTH)/starboard/shared/iso/character_is_upper.cc',
-      '<(DEPTH)/starboard/shared/iso/character_to_lower.cc',
-      '<(DEPTH)/starboard/shared/iso/character_to_upper.cc',
-      '<(DEPTH)/starboard/shared/iso/directory_close.cc',
-      '<(DEPTH)/starboard/shared/iso/directory_get_next.cc',
-      '<(DEPTH)/starboard/shared/iso/directory_open.cc',
-      '<(DEPTH)/starboard/shared/iso/double_absolute.cc',
-      '<(DEPTH)/starboard/shared/iso/double_exponent.cc',
-      '<(DEPTH)/starboard/shared/iso/double_floor.cc',
-      '<(DEPTH)/starboard/shared/iso/double_is_finite.cc',
-      '<(DEPTH)/starboard/shared/iso/double_is_nan.cc',
-      '<(DEPTH)/starboard/shared/iso/memory_compare.cc',
-      '<(DEPTH)/starboard/shared/iso/memory_copy.cc',
-      '<(DEPTH)/starboard/shared/iso/memory_find_byte.cc',
-      '<(DEPTH)/starboard/shared/iso/memory_move.cc',
-      '<(DEPTH)/starboard/shared/iso/memory_set.cc',
-      '<(DEPTH)/starboard/shared/iso/string_compare.cc',
-      '<(DEPTH)/starboard/shared/iso/string_compare_all.cc',
-      '<(DEPTH)/starboard/shared/iso/string_find_character.cc',
-      '<(DEPTH)/starboard/shared/iso/string_find_last_character.cc',
-      '<(DEPTH)/starboard/shared/iso/string_find_string.cc',
-      '<(DEPTH)/starboard/shared/iso/string_get_length.cc',
-      '<(DEPTH)/starboard/shared/iso/string_get_length_wide.cc',
-      '<(DEPTH)/starboard/shared/iso/string_parse_double.cc',
-      '<(DEPTH)/starboard/shared/iso/string_parse_signed_integer.cc',
-      '<(DEPTH)/starboard/shared/iso/string_parse_uint64.cc',
-      '<(DEPTH)/starboard/shared/iso/string_parse_unsigned_integer.cc',
-      '<(DEPTH)/starboard/shared/iso/string_scan.cc',
-      '<(DEPTH)/starboard/shared/iso/system_binary_search.cc',
-      '<(DEPTH)/starboard/shared/iso/system_sort.cc',
-      '<(DEPTH)/starboard/shared/libevent/socket_waiter_add.cc',
-      '<(DEPTH)/starboard/shared/libevent/socket_waiter_create.cc',
-      '<(DEPTH)/starboard/shared/libevent/socket_waiter_destroy.cc',
-      '<(DEPTH)/starboard/shared/libevent/socket_waiter_internal.cc',
-      '<(DEPTH)/starboard/shared/libevent/socket_waiter_remove.cc',
-      '<(DEPTH)/starboard/shared/libevent/socket_waiter_wait.cc',
-      '<(DEPTH)/starboard/shared/libevent/socket_waiter_wait_timed.cc',
-      '<(DEPTH)/starboard/shared/libevent/socket_waiter_wake_up.cc',
-      '<(DEPTH)/starboard/shared/linux/byte_swap.cc',
-      '<(DEPTH)/starboard/shared/linux/get_home_directory.cc',
-      '<(DEPTH)/starboard/shared/linux/dev_input/dev_input.cc',
-      '<(DEPTH)/starboard/shared/linux/memory_get_stack_bounds.cc',
-      '<(DEPTH)/starboard/shared/linux/page_internal.cc',
-      '<(DEPTH)/starboard/shared/linux/socket_get_interface_address.cc',
-      '<(DEPTH)/starboard/shared/linux/system_get_random_data.cc',
-      '<(DEPTH)/starboard/shared/linux/system_get_stack.cc',
-      '<(DEPTH)/starboard/shared/linux/system_get_total_cpu_memory.cc',
-      '<(DEPTH)/starboard/shared/linux/system_get_used_cpu_memory.cc',
-      '<(DEPTH)/starboard/shared/linux/system_is_debugger_attached.cc',
-      '<(DEPTH)/starboard/shared/linux/system_symbolize.cc',
-      '<(DEPTH)/starboard/shared/linux/thread_get_id.cc',
-      '<(DEPTH)/starboard/shared/linux/thread_get_name.cc',
-      '<(DEPTH)/starboard/shared/linux/thread_set_name.cc',
-      '<(DEPTH)/starboard/shared/nouser/user_get_current.cc',
-      '<(DEPTH)/starboard/shared/nouser/user_get_property.cc',
-      '<(DEPTH)/starboard/shared/nouser/user_get_signed_in.cc',
-      '<(DEPTH)/starboard/shared/nouser/user_internal.cc',
-      '<(DEPTH)/starboard/shared/posix/directory_create.cc',
-      '<(DEPTH)/starboard/shared/posix/file_atomic_replace.cc',
-      '<(DEPTH)/starboard/shared/posix/file_can_open.cc',
-      '<(DEPTH)/starboard/shared/posix/file_close.cc',
-      '<(DEPTH)/starboard/shared/posix/file_delete.cc',
-      '<(DEPTH)/starboard/shared/posix/file_exists.cc',
-      '<(DEPTH)/starboard/shared/posix/file_flush.cc',
-      '<(DEPTH)/starboard/shared/posix/file_get_info.cc',
-      '<(DEPTH)/starboard/shared/posix/file_get_path_info.cc',
-      '<(DEPTH)/starboard/shared/posix/file_open.cc',
-      '<(DEPTH)/starboard/shared/posix/file_read.cc',
-      '<(DEPTH)/starboard/shared/posix/file_seek.cc',
-      '<(DEPTH)/starboard/shared/posix/file_truncate.cc',
-      '<(DEPTH)/starboard/shared/posix/file_write.cc',
-      '<(DEPTH)/starboard/shared/posix/log.cc',
-      '<(DEPTH)/starboard/shared/posix/log_flush.cc',
-      '<(DEPTH)/starboard/shared/posix/log_format.cc',
-      '<(DEPTH)/starboard/shared/posix/log_is_tty.cc',
-      '<(DEPTH)/starboard/shared/posix/log_raw.cc',
-      '<(DEPTH)/starboard/shared/posix/memory_flush.cc',
-      '<(DEPTH)/starboard/shared/posix/set_non_blocking_internal.cc',
-      '<(DEPTH)/starboard/shared/posix/socket_accept.cc',
-      '<(DEPTH)/starboard/shared/posix/socket_bind.cc',
-      '<(DEPTH)/starboard/shared/posix/socket_clear_last_error.cc',
-      '<(DEPTH)/starboard/shared/posix/socket_connect.cc',
-      '<(DEPTH)/starboard/shared/posix/socket_create.cc',
-      '<(DEPTH)/starboard/shared/posix/socket_destroy.cc',
-      '<(DEPTH)/starboard/shared/posix/socket_free_resolution.cc',
-      '<(DEPTH)/starboard/shared/posix/socket_get_last_error.cc',
-      '<(DEPTH)/starboard/shared/posix/socket_get_local_address.cc',
-      '<(DEPTH)/starboard/shared/posix/socket_internal.cc',
-      '<(DEPTH)/starboard/shared/posix/socket_is_connected.cc',
-      '<(DEPTH)/starboard/shared/posix/socket_is_connected_and_idle.cc',
-      '<(DEPTH)/starboard/shared/posix/socket_is_ipv6_supportec.cc',
-      '<(DEPTH)/starboard/shared/posix/socket_join_multicast_group.cc',
-      '<(DEPTH)/starboard/shared/posix/socket_listen.cc',
-      '<(DEPTH)/starboard/shared/posix/socket_receive_from.cc',
-      '<(DEPTH)/starboard/shared/posix/socket_resolve.cc',
-      '<(DEPTH)/starboard/shared/posix/socket_send_to.cc',
-      '<(DEPTH)/starboard/shared/posix/socket_set_broadcast.cc',
-      '<(DEPTH)/starboard/shared/posix/socket_set_receive_buffer_size.cc',
-      '<(DEPTH)/starboard/shared/posix/socket_set_reuse_address.cc',
-      '<(DEPTH)/starboard/shared/posix/socket_set_send_buffer_size.cc',
-      '<(DEPTH)/starboard/shared/posix/socket_set_tcp_keep_alive.cc',
-      '<(DEPTH)/starboard/shared/posix/socket_set_tcp_no_delay.cc',
-      '<(DEPTH)/starboard/shared/posix/socket_set_tcp_window_scaling.cc',
-      '<(DEPTH)/starboard/shared/posix/storage_write_record.cc',
-      '<(DEPTH)/starboard/shared/posix/string_compare_no_case.cc',
-      '<(DEPTH)/starboard/shared/posix/string_compare_no_case_n.cc',
-      '<(DEPTH)/starboard/shared/posix/string_compare_wide.cc',
-      '<(DEPTH)/starboard/shared/posix/string_format.cc',
-      '<(DEPTH)/starboard/shared/posix/string_format_wide.cc',
-      '<(DEPTH)/starboard/shared/posix/system_break_into_debugger.cc',
-      '<(DEPTH)/starboard/shared/posix/system_clear_last_error.cc',
-      '<(DEPTH)/starboard/shared/posix/system_get_error_string.cc',
-      '<(DEPTH)/starboard/shared/posix/system_get_last_error.cc',
-      '<(DEPTH)/starboard/shared/posix/system_get_locale_id.cc',
-      '<(DEPTH)/starboard/shared/posix/system_get_number_of_processors.cc',
-      '<(DEPTH)/starboard/shared/posix/thread_sleep.cc',
-      '<(DEPTH)/starboard/shared/posix/time_get_monotonic_now.cc',
-      '<(DEPTH)/starboard/shared/posix/time_get_monotonic_thread_now.cc',
-      '<(DEPTH)/starboard/shared/posix/time_get_now.cc',
-      '<(DEPTH)/starboard/shared/posix/time_is_time_thread_now_supported.cc',
-      '<(DEPTH)/starboard/shared/posix/time_zone_get_current.cc',
-      '<(DEPTH)/starboard/shared/posix/time_zone_get_name.cc',
-      '<(DEPTH)/starboard/shared/pthread/condition_variable_broadcast.cc',
-      '<(DEPTH)/starboard/shared/pthread/condition_variable_create.cc',
-      '<(DEPTH)/starboard/shared/pthread/condition_variable_destroy.cc',
-      '<(DEPTH)/starboard/shared/pthread/condition_variable_signal.cc',
-      '<(DEPTH)/starboard/shared/pthread/condition_variable_wait.cc',
-      '<(DEPTH)/starboard/shared/pthread/condition_variable_wait_timed.cc',
-      '<(DEPTH)/starboard/shared/pthread/mutex_acquire.cc',
-      '<(DEPTH)/starboard/shared/pthread/mutex_acquire_try.cc',
-      '<(DEPTH)/starboard/shared/pthread/mutex_create.cc',
-      '<(DEPTH)/starboard/shared/pthread/mutex_destroy.cc',
-      '<(DEPTH)/starboard/shared/pthread/mutex_release.cc',
-      '<(DEPTH)/starboard/shared/pthread/once.cc',
-      '<(DEPTH)/starboard/shared/pthread/thread_create.cc',
-      '<(DEPTH)/starboard/shared/pthread/thread_create_local_key.cc',
-      '<(DEPTH)/starboard/shared/pthread/thread_create_priority.h',
-      '<(DEPTH)/starboard/shared/pthread/thread_destroy_local_key.cc',
-      '<(DEPTH)/starboard/shared/pthread/thread_detach.cc',
-      '<(DEPTH)/starboard/shared/pthread/thread_get_current.cc',
-      '<(DEPTH)/starboard/shared/pthread/thread_get_local_value.cc',
-      '<(DEPTH)/starboard/shared/pthread/thread_is_equal.cc',
-      '<(DEPTH)/starboard/shared/pthread/thread_join.cc',
-      '<(DEPTH)/starboard/shared/pthread/thread_set_local_value.cc',
-      '<(DEPTH)/starboard/shared/pthread/thread_yield.cc',
-      '<(DEPTH)/starboard/shared/signal/crash_signals.h',
-      '<(DEPTH)/starboard/shared/signal/crash_signals_sigaction.cc',
-      '<(DEPTH)/starboard/shared/signal/suspend_signals.cc',
-      '<(DEPTH)/starboard/shared/signal/suspend_signals.h',
-      '<(DEPTH)/starboard/shared/starboard/application.cc',
-      '<(DEPTH)/starboard/shared/starboard/command_line.cc',
-      '<(DEPTH)/starboard/shared/starboard/command_line.h',
-      '<(DEPTH)/starboard/shared/starboard/audio_sink/audio_sink_create.cc',
-      '<(DEPTH)/starboard/shared/starboard/audio_sink/audio_sink_destroy.cc',
-      '<(DEPTH)/starboard/shared/starboard/audio_sink/audio_sink_internal.cc',
-      '<(DEPTH)/starboard/shared/starboard/audio_sink/audio_sink_internal.h',
-      '<(DEPTH)/starboard/shared/starboard/audio_sink/audio_sink_is_valid.cc',
-      '<(DEPTH)/starboard/shared/starboard/audio_sink/stub_audio_sink_type.cc',
-      '<(DEPTH)/starboard/shared/starboard/audio_sink/stub_audio_sink_type.h',
-      '<(DEPTH)/starboard/shared/starboard/directory_can_open.cc',
-      '<(DEPTH)/starboard/shared/starboard/event_cancel.cc',
-      '<(DEPTH)/starboard/shared/starboard/event_schedule.cc',
-      '<(DEPTH)/starboard/shared/starboard/file_atomic_replace_write_file.cc',
-      '<(DEPTH)/starboard/shared/starboard/file_atomic_replace_write_file.h',
-      '<(DEPTH)/starboard/shared/starboard/file_mode_string_to_flags.cc',
-      '<(DEPTH)/starboard/shared/starboard/file_storage/storage_close_record.cc',
-      '<(DEPTH)/starboard/shared/starboard/file_storage/storage_delete_record.cc',
-      '<(DEPTH)/starboard/shared/starboard/file_storage/storage_get_record_size.cc',
-      '<(DEPTH)/starboard/shared/starboard/file_storage/storage_open_record.cc',
-      '<(DEPTH)/starboard/shared/starboard/file_storage/storage_read_record.cc',
-      '<(DEPTH)/starboard/shared/starboard/log_message.cc',
-      '<(DEPTH)/starboard/shared/starboard/log_raw_dump_stack.cc',
-      '<(DEPTH)/starboard/shared/starboard/log_raw_format.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/codec_util.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/codec_util.h',
-      '<(DEPTH)/starboard/shared/starboard/media/media_can_play_mime_and_key_system.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/media_get_audio_buffer_budget.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/media_get_audio_configuration_stereo_only.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/media_get_audio_output_count_single_audio_output.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/media_get_buffer_alignment.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/media_get_buffer_allocation_unit.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/media_get_buffer_garbage_collection_duration_threshold.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/media_get_buffer_padding.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/media_get_buffer_storage_type.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/media_get_initial_buffer_capacity.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/media_get_max_buffer_capacity.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/media_get_progressive_buffer_budget.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/media_get_video_buffer_budget.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/media_is_audio_supported_aac_only.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/media_is_output_protected.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/media_is_buffer_pool_allocate_on_demand.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/media_is_buffer_using_memory_pool.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/media_set_output_protection.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/media_util.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/media_util.h',
-      '<(DEPTH)/starboard/shared/starboard/media/mime_type.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/mime_type.h',
-      '<(DEPTH)/starboard/shared/starboard/media/codec_util.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/codec_util.h',
-      '<(DEPTH)/starboard/shared/starboard/media/media_can_play_mime_and_key_system.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/media_is_output_protected.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/media_set_output_protection.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/mime_type.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/mime_type.h',
-      '<(DEPTH)/starboard/shared/starboard/new.cc',
-      '<(DEPTH)/starboard/shared/starboard/player/decoded_audio_internal.cc',
-      '<(DEPTH)/starboard/shared/starboard/player/decoded_audio_internal.h',
-      '<(DEPTH)/starboard/shared/starboard/player/input_buffer_internal.cc',
-      '<(DEPTH)/starboard/shared/starboard/player/input_buffer_internal.h',
-      '<(DEPTH)/starboard/shared/starboard/player/job_queue.cc',
-      '<(DEPTH)/starboard/shared/starboard/player/job_queue.h',
-      '<(DEPTH)/starboard/shared/starboard/player/job_thread.cc',
-      '<(DEPTH)/starboard/shared/starboard/player/job_thread.h',
-      '<(DEPTH)/starboard/shared/starboard/player/player_create.cc',
-      '<(DEPTH)/starboard/shared/starboard/player/player_destroy.cc',
-      '<(DEPTH)/starboard/shared/starboard/player/player_get_current_frame.cc',
-      '<(DEPTH)/starboard/shared/starboard/player/player_get_info2.cc',
-      '<(DEPTH)/starboard/shared/starboard/player/player_get_maximum_number_of_samples_per_write.cc',
-      '<(DEPTH)/starboard/shared/starboard/player/player_output_mode_supported.cc',
-      '<(DEPTH)/starboard/shared/starboard/player/player_internal.cc',
-      '<(DEPTH)/starboard/shared/starboard/player/player_internal.h',
-      '<(DEPTH)/starboard/shared/starboard/player/player_seek2.cc',
-      '<(DEPTH)/starboard/shared/starboard/player/player_set_bounds.cc',
-      '<(DEPTH)/starboard/shared/starboard/player/player_set_playback_rate.cc',
-      '<(DEPTH)/starboard/shared/starboard/player/player_set_volume.cc',
-      '<(DEPTH)/starboard/shared/starboard/player/player_worker.cc',
-      '<(DEPTH)/starboard/shared/starboard/player/player_worker.h',
-      '<(DEPTH)/starboard/shared/starboard/player/player_write_end_of_stream.cc',
-      '<(DEPTH)/starboard/shared/starboard/player/player_write_sample2.cc',
-      '<(DEPTH)/starboard/shared/starboard/queue_application.cc',
-      '<(DEPTH)/starboard/shared/starboard/string_concat.cc',
-      '<(DEPTH)/starboard/shared/starboard/string_concat_wide.cc',
-      '<(DEPTH)/starboard/shared/starboard/string_copy.cc',
-      '<(DEPTH)/starboard/shared/starboard/string_copy_wide.cc',
-      '<(DEPTH)/starboard/shared/starboard/string_duplicate.cc',
-      '<(DEPTH)/starboard/shared/starboard/system_get_random_uint64.cc',
-      '<(DEPTH)/starboard/shared/starboard/system_request_pause.cc',
-      '<(DEPTH)/starboard/shared/starboard/system_request_stop.cc',
-      '<(DEPTH)/starboard/shared/starboard/system_request_suspend.cc',
-      '<(DEPTH)/starboard/shared/starboard/system_request_unpause.cc',
-      '<(DEPTH)/starboard/shared/starboard/system_supports_resume.cc',
-      '<(DEPTH)/starboard/shared/starboard/window_set_default_options.cc',
-      '<(DEPTH)/starboard/shared/stub/accessibility_get_caption_settings.cc',
-      '<(DEPTH)/starboard/shared/stub/accessibility_get_display_settings.cc',
-      '<(DEPTH)/starboard/shared/stub/accessibility_get_text_to_speech_settings.cc',
-      '<(DEPTH)/starboard/shared/stub/cpu_features_get.cc',
-      '<(DEPTH)/starboard/shared/stub/cryptography_create_transformer.cc',
-      '<(DEPTH)/starboard/shared/stub/cryptography_destroy_transformer.cc',
-      '<(DEPTH)/starboard/shared/stub/cryptography_get_tag.cc',
-      '<(DEPTH)/starboard/shared/stub/cryptography_set_authenticated_data.cc',
-      '<(DEPTH)/starboard/shared/stub/cryptography_set_initialization_vector.cc',
-      '<(DEPTH)/starboard/shared/stub/cryptography_transform.cc',
-      '<(DEPTH)/starboard/shared/stub/decode_target_get_info.cc',
-      '<(DEPTH)/starboard/shared/stub/decode_target_release.cc',
-      '<(DEPTH)/starboard/shared/stub/drm_close_session.cc',
-      '<(DEPTH)/starboard/shared/stub/drm_create_system.cc',
-      '<(DEPTH)/starboard/shared/stub/drm_destroy_system.cc',
-      '<(DEPTH)/starboard/shared/stub/drm_generate_session_update_request.cc',
-      '<(DEPTH)/starboard/shared/stub/drm_system_internal.h',
-      '<(DEPTH)/starboard/shared/stub/drm_update_session.cc',
-      '<(DEPTH)/starboard/shared/stub/drm_is_server_certificate_updatable.cc',
-      '<(DEPTH)/starboard/shared/stub/drm_update_server_certificate.cc',
-      '<(DEPTH)/starboard/shared/stub/image_decode.cc',
-      '<(DEPTH)/starboard/shared/stub/image_is_decode_supported.cc',
-      '<(DEPTH)/starboard/shared/stub/media_is_supported.cc',
-      '<(DEPTH)/starboard/shared/stub/media_is_transfer_characteristics_supported.cc',
-      '<(DEPTH)/starboard/shared/stub/system_clear_platform_error.cc',
-      '<(DEPTH)/starboard/shared/stub/system_get_total_gpu_memory.cc',
-      '<(DEPTH)/starboard/shared/stub/system_get_used_gpu_memory.cc',
-      '<(DEPTH)/starboard/shared/stub/system_hide_splash_screen.cc',
-      '<(DEPTH)/starboard/shared/stub/system_raise_platform_error.cc',
-      '<(DEPTH)/starboard/shared/stub/system_sign_with_certification_secret_key.cc',
-      '<(DEPTH)/starboard/shared/stub/ui_nav_get_interface.cc',
-      '<(DEPTH)/starboard/shared/stub/window_get_diagonal_size_in_inches.cc',
-    ],
-    'starboard_platform_dependencies': [
-      '<(DEPTH)/starboard/common/common.gyp:common',
-      '<(DEPTH)/starboard/linux/shared/starboard_base_symbolize.gyp:starboard_base_symbolize',
-      '<(DEPTH)/starboard/shared/ffmpeg/ffmpeg.gyp:ffmpeg_linked',
-      '<(DEPTH)/third_party/dlmalloc/dlmalloc.gyp:dlmalloc',
-      '<(DEPTH)/third_party/libevent/libevent.gyp:libevent',
-    ],
-  },
-}
diff --git a/src/starboard/contrib/linux/x64wl/configuration_public.h b/src/starboard/contrib/linux/x64wl/configuration_public.h
index 6a62d1e..bef9f29 100644
--- a/src/starboard/contrib/linux/x64wl/configuration_public.h
+++ b/src/starboard/contrib/linux/x64wl/configuration_public.h
@@ -31,12 +31,6 @@
 // Whether the current platform is an ARM architecture.
 #define SB_IS_ARCH_ARM 0
 
-// Whether the current platform is a MIPS architecture.
-#define SB_IS_ARCH_MIPS 0
-
-// Whether the current platform is a PPC architecture.
-#define SB_IS_ARCH_PPC 0
-
 // Whether the current platform is an x86 architecture.
 #define SB_IS_ARCH_X86 1
 
diff --git a/src/starboard/contrib/linux/x64wl/system_get_property.cc b/src/starboard/contrib/linux/x64wl/system_get_property.cc
index 552dc5a..337afbb 100644
--- a/src/starboard/contrib/linux/x64wl/system_get_property.cc
+++ b/src/starboard/contrib/linux/x64wl/system_get_property.cc
@@ -51,7 +51,9 @@
     case kSbSystemPropertyFirmwareVersion:
     case kSbSystemPropertyModelName:
     case kSbSystemPropertyModelYear:
-#if SB_API_VERSION >= 11
+#if SB_API_VERSION >= 12
+    case kSbSystemPropertySystemIntegratorName:
+#elif SB_API_VERSION == 11
     case kSbSystemPropertyOriginalDesignManufacturerName:
 #else
     case kSbSystemPropertyNetworkOperatorName:
diff --git a/src/starboard/contrib/tizen/armv7l/configuration_public.h b/src/starboard/contrib/tizen/armv7l/configuration_public.h
index 1342fe7..d3c0233 100644
--- a/src/starboard/contrib/tizen/armv7l/configuration_public.h
+++ b/src/starboard/contrib/tizen/armv7l/configuration_public.h
@@ -34,12 +34,6 @@
 // Whether the current platform is an ARM architecture.
 #define SB_IS_ARCH_ARM 1
 
-// Whether the current platform is a MIPS architecture.
-#define SB_IS_ARCH_MIPS 0
-
-// Whether the current platform is a PPC architecture.
-#define SB_IS_ARCH_PPC 0
-
 // Whether the current platform is an x86 architecture.
 #define SB_IS_ARCH_X86 0
 
diff --git a/src/starboard/contrib/tizen/armv7l/system_get_property.cc b/src/starboard/contrib/tizen/armv7l/system_get_property.cc
index aebf1a5..3566cee 100644
--- a/src/starboard/contrib/tizen/armv7l/system_get_property.cc
+++ b/src/starboard/contrib/tizen/armv7l/system_get_property.cc
@@ -60,7 +60,9 @@
       return CopyStringAndTestIfSuccess(out_value, value_length, kModelName);
     case kSbSystemPropertyModelYear:
       return CopyStringAndTestIfSuccess(out_value, value_length, kModelYear);
-#if SB_API_VERSION >= 11
+#if SB_API_VERSION >= 12
+    case kSbSystemPropertySystemIntegratorName:
+#elif SB_API_VERSION == 11
     case kSbSystemPropertyOriginalDesignManufacturerName:
 #else
     case kSbSystemPropertyNetworkOperatorName:
diff --git a/src/starboard/contrib/tizen/shared/configuration_public.h b/src/starboard/contrib/tizen/shared/configuration_public.h
index 0fd9c33..a1a3167 100644
--- a/src/starboard/contrib/tizen/shared/configuration_public.h
+++ b/src/starboard/contrib/tizen/shared/configuration_public.h
@@ -52,12 +52,10 @@
 #define SB_IS_WCHAR_T_UTF16 1
 #endif
 
-// Chrome only defines these two if ARMEL or MIPSEL are defined.
+// Chrome only defines this for ARMEL.
 #if defined(__ARMEL__)
 // Chrome has an exclusion for iOS here, we should too when we support iOS.
 #define SB_IS_WCHAR_T_UNSIGNED 1
-#elif defined(__MIPSEL__)
-#define SB_IS_WCHAR_T_SIGNED 1
 #endif
 
 // --- Architecture Configuration --------------------------------------------
diff --git a/src/starboard/doc/evergreen/cobalt_update_framework.md b/src/starboard/doc/evergreen/cobalt_update_framework.md
index 6ae81c0..cf916b7 100644
--- a/src/starboard/doc/evergreen/cobalt_update_framework.md
+++ b/src/starboard/doc/evergreen/cobalt_update_framework.md
@@ -36,7 +36,7 @@
 serving billions of users worldwide. We set up Cobalt updates on Google Update
 in a way that each type of device gets a unique update link (URL). The device
 type is identified by [Starboard
-ABI](https://drive.google.com/a/google.com/open?id=1r1vS_FFMV9F-YlNaudxFwhAVG7delVleKfYgLLRUn3o)
+ABI](../starboard_abi.md)
 (SABI) string. For instance, Raspberry Pi 2 and Linux desktop are two different
 types of devices. They are identified by two different SABI strings, and get two
 different update URLs on Google Update. The request sent by the Cobalt updater
diff --git a/src/starboard/egl_and_gles/egl_and_gles_glimp.gyp b/src/starboard/egl_and_gles/egl_and_gles_glimp.gyp
index 55dd8cd..4e9cd79 100644
--- a/src/starboard/egl_and_gles/egl_and_gles_glimp.gyp
+++ b/src/starboard/egl_and_gles/egl_and_gles_glimp.gyp
@@ -32,7 +32,7 @@
       'conditions': [
         ['enable_vr==1', {
           'dependencies': [
-            '<(DEPTH)/glimp/ps4/glimp_platform.gyp:glimp_platform',
+            '<(DEPTH)/glimp/<(sb_target_platform)/glimp_platform.gyp:glimp_platform',
           ],
         }],
       ],
diff --git a/src/starboard/evergreen/arm/hardfp/configuration_public.h b/src/starboard/evergreen/arm/hardfp/configuration_public.h
index cdeafc9..69ff7e3 100644
--- a/src/starboard/evergreen/arm/hardfp/configuration_public.h
+++ b/src/starboard/evergreen/arm/hardfp/configuration_public.h
@@ -21,40 +21,18 @@
 #ifndef STARBOARD_EVERGREEN_ARM_HARDFP_CONFIGURATION_PUBLIC_H_
 #define STARBOARD_EVERGREEN_ARM_HARDFP_CONFIGURATION_PUBLIC_H_
 
+// --- Architecture Configuration --------------------------------------------
+
 // --- System Header Configuration -------------------------------------------
 
 // Any system headers listed here that are not provided by the platform will be
 // emulated in starboard/types.h.
 
-// Whether the current platform provides the standard header stdarg.h.
-#define SB_HAS_STDARG_H 1
-
-// Whether the current platform provides the standard header stdbool.h.
-#define SB_HAS_STDBOOL_H 1
-
-// Whether the current platform provides the standard header stddef.h.
-#define SB_HAS_STDDEF_H 1
-
-// Whether the current platform provides the standard header stdint.h.
-#define SB_HAS_STDINT_H 1
-
-// Whether the current platform provides the standard header inttypes.h.
-#define SB_HAS_INTTYPES_H 1
-
 // Whether the current platform provides the standard header sys/types.h.
-#define SB_HAS_SYS_TYPES_H 1
-
-// Whether the current platform provides the standard header wchar.h.
-#define SB_HAS_WCHAR_H 1
-
-// Whether the current platform provides the standard header limits.h.
-#define SB_HAS_LIMITS_H 1
-
-// Whether the current platform provides the standard header float.h.
-#define SB_HAS_FLOAT_H 1
+#define SB_HAS_SYS_TYPES_H 0
 
 // Whether the current platform provides ssize_t.
-#define SB_HAS_SSIZE_T 1
+#define SB_HAS_SSIZE_T 0
 
 // Type detection for wchar_t.
 #if defined(__WCHAR_MAX__) && \
@@ -65,12 +43,10 @@
 #define SB_IS_WCHAR_T_UTF16 1
 #endif
 
-// Chrome only defines these two if ARMEL or MIPSEL are defined.
+// Chrome only defines this for ARMEL.
 #if defined(__ARMEL__)
 // Chrome has an exclusion for iOS here, we should too when we support iOS.
 #define SB_IS_WCHAR_T_UNSIGNED 1
-#elif defined(__MIPSEL__)
-#define SB_IS_WCHAR_T_SIGNED 1
 #endif
 
 // --- Compiler Configuration ------------------------------------------------
@@ -128,9 +104,6 @@
 // The location to include hash_set on this platform.
 #define SB_HASH_SET_INCLUDE <ext/hash_set>
 
-// Define this to how this platform copies varargs blocks.
-#define SB_VA_COPY(dest, source) va_copy(dest, source)
-
 // --- Graphics Configuration ------------------------------------------------
 
 // Specifies whether this platform supports a performant accelerated blitter
diff --git a/src/starboard/evergreen/arm/softfp/configuration_public.h b/src/starboard/evergreen/arm/softfp/configuration_public.h
index b6ced7d..10d58aa 100644
--- a/src/starboard/evergreen/arm/softfp/configuration_public.h
+++ b/src/starboard/evergreen/arm/softfp/configuration_public.h
@@ -21,40 +21,18 @@
 #ifndef STARBOARD_EVERGREEN_ARM_SOFTFP_CONFIGURATION_PUBLIC_H_
 #define STARBOARD_EVERGREEN_ARM_SOFTFP_CONFIGURATION_PUBLIC_H_
 
+// --- Architecture Configuration --------------------------------------------
+
 // --- System Header Configuration -------------------------------------------
 
 // Any system headers listed here that are not provided by the platform will be
 // emulated in starboard/types.h.
 
-// Whether the current platform provides the standard header stdarg.h.
-#define SB_HAS_STDARG_H 1
-
-// Whether the current platform provides the standard header stdbool.h.
-#define SB_HAS_STDBOOL_H 1
-
-// Whether the current platform provides the standard header stddef.h.
-#define SB_HAS_STDDEF_H 1
-
-// Whether the current platform provides the standard header stdint.h.
-#define SB_HAS_STDINT_H 1
-
-// Whether the current platform provides the standard header inttypes.h.
-#define SB_HAS_INTTYPES_H 1
-
 // Whether the current platform provides the standard header sys/types.h.
-#define SB_HAS_SYS_TYPES_H 1
-
-// Whether the current platform provides the standard header wchar.h.
-#define SB_HAS_WCHAR_H 1
-
-// Whether the current platform provides the standard header limits.h.
-#define SB_HAS_LIMITS_H 1
-
-// Whether the current platform provides the standard header float.h.
-#define SB_HAS_FLOAT_H 1
+#define SB_HAS_SYS_TYPES_H 0
 
 // Whether the current platform provides ssize_t.
-#define SB_HAS_SSIZE_T 1
+#define SB_HAS_SSIZE_T 0
 
 // Type detection for wchar_t.
 #if defined(__WCHAR_MAX__) && \
@@ -65,12 +43,10 @@
 #define SB_IS_WCHAR_T_UTF16 1
 #endif
 
-// Chrome only defines these two if ARMEL or MIPSEL are defined.
+// Chrome only defines this for ARMEL.
 #if defined(__ARMEL__)
 // Chrome has an exclusion for iOS here, we should too when we support iOS.
 #define SB_IS_WCHAR_T_UNSIGNED 1
-#elif defined(__MIPSEL__)
-#define SB_IS_WCHAR_T_SIGNED 1
 #endif
 
 // --- Compiler Configuration ------------------------------------------------
@@ -128,9 +104,6 @@
 // The location to include hash_set on this platform.
 #define SB_HASH_SET_INCLUDE <ext/hash_set>
 
-// Define this to how this platform copies varargs blocks.
-#define SB_VA_COPY(dest, source) va_copy(dest, source)
-
 // --- Graphics Configuration ------------------------------------------------
 
 // Specifies whether this platform supports a performant accelerated blitter
diff --git a/src/starboard/evergreen/arm64/configuration_public.h b/src/starboard/evergreen/arm64/configuration_public.h
index 73939b3..8cf2526 100644
--- a/src/starboard/evergreen/arm64/configuration_public.h
+++ b/src/starboard/evergreen/arm64/configuration_public.h
@@ -21,49 +21,19 @@
 #ifndef STARBOARD_EVERGREEN_ARM64_CONFIGURATION_PUBLIC_H_
 #define STARBOARD_EVERGREEN_ARM64_CONFIGURATION_PUBLIC_H_
 
-// Configuration parameters that allow the application to make some general
-// compile-time decisions with respect to the the number of cores likely to be
-// available on this platform. For a definitive measure, the application should
-// still call SbSystemGetNumberOfProcessors at runtime.
-
-// Whether the current platform's thread scheduler will automatically balance
-// threads between cores, as opposed to systems where threads will only ever run
-// on the specifically pinned core.
-#define SB_HAS_CROSS_CORE_SCHEDULER 1
+// --- Architecture Configuration --------------------------------------------
 
 // Indicates that there is no support for alignment at greater than 16 bytes for
 // items on the stack.
 #define SB_HAS_QUIRK_DOES_NOT_STACK_ALIGN_OVER_16_BYTES 1
 
-// This quirk is used to fix an issue caused by the rewriting of memset to
-// SbMemorySet in third_party/protobuf/src/google/protobuf/stubs/port.h.
-#define SB_HAS_QUIRK_MEMSET_IN_SYSTEM_HEADERS 1
-
 // --- System Header Configuration -------------------------------------------
 
 // Any system headers listed here that are not provided by the platform will be
 // emulated in starboard/types.h.
 
-// Whether the current platform provides the standard header stdarg.h.
-#define SB_HAS_STDARG_H 1
-
-// Whether the current platform provides the standard header stdbool.h.
-#define SB_HAS_STDBOOL_H 1
-
-// Whether the current platform provides the standard header stddef.h.
-#define SB_HAS_STDDEF_H 1
-
-// Whether the current platform provides the standard header stdint.h.
-#define SB_HAS_STDINT_H 1
-
-// Whether the current platform provides the standard header inttypes.h.
-#define SB_HAS_INTTYPES_H 1
-
-// Whether the current platform provides the standard header limits.h.
-#define SB_HAS_LIMITS_H 1
-
-// Whether the current platform provides the standard header float.h.
-#define SB_HAS_FLOAT_H 1
+// Whether the current platform provides the standard header sys/types.h.
+#define SB_HAS_SYS_TYPES_H 0
 
 // Whether the current platform provides ssize_t.
 #define SB_HAS_SSIZE_T 0
@@ -77,18 +47,12 @@
 #define SB_IS_WCHAR_T_UTF16 1
 #endif
 
-// Chrome only defines these two if ARMEL or MIPSEL are defined.
+// Chrome only defines this for ARMEL.
 #if defined(__ARMEL__)
 // Chrome has an exclusion for iOS here, we should too when we support iOS.
 #define SB_IS_WCHAR_T_UNSIGNED 1
-#elif defined(__MIPSEL__)
-#define SB_IS_WCHAR_T_SIGNED 1
 #endif
 
-// This quirk is used to fix an issue caused by the rewriting of memset to
-// SbMemorySet in third_party/protobuf/src/google/protobuf/stubs/port.h.
-#define SB_HAS_QUIRK_MEMSET_IN_SYSTEM_HEADERS 1
-
 // --- Compiler Configuration ------------------------------------------------
 
 // The platform's annotation for forcing a C function to be inlined.
@@ -144,9 +108,6 @@
 // The location to include hash_set on this platform.
 #define SB_HASH_SET_INCLUDE <ext/hash_set>
 
-// Define this to how this platform copies varargs blocks.
-#define SB_VA_COPY(dest, source) va_copy(dest, source)
-
 // --- Graphics Configuration ------------------------------------------------
 
 // Specifies whether this platform supports a performant accelerated blitter
diff --git a/src/starboard/evergreen/shared/gyp_configuration.gypi b/src/starboard/evergreen/shared/gyp_configuration.gypi
index ad8726b..4753fe3 100644
--- a/src/starboard/evergreen/shared/gyp_configuration.gypi
+++ b/src/starboard/evergreen/shared/gyp_configuration.gypi
@@ -35,16 +35,6 @@
     'final_executable_type': 'shared_library',
     'gtest_target_type': 'shared_library',
 
-    'compiler_flags': [
-      # We'll pretend not to be Linux, but Starboard instead.
-      '-U__linux__',
-
-      # Pretend not to be unix, so that _LIBCPP_HAS_CATOPEN is not defined in
-      # third_party/llvm-project/libcxx/include/__config. Then leaks catopen,
-      # catgets and catclose are plugged.
-      '-U__unix__',
-    ],
-
     # Using an inner scope for 'variables' so that it can be made a default
     # (and so overridden elsewhere), but yet still used immediately in this
     # file.
diff --git a/src/starboard/evergreen/x64/configuration_public.h b/src/starboard/evergreen/x64/configuration_public.h
index 89f8733..79a49dc 100644
--- a/src/starboard/evergreen/x64/configuration_public.h
+++ b/src/starboard/evergreen/x64/configuration_public.h
@@ -21,45 +21,16 @@
 #ifndef STARBOARD_EVERGREEN_X64_CONFIGURATION_PUBLIC_H_
 #define STARBOARD_EVERGREEN_X64_CONFIGURATION_PUBLIC_H_
 
-// Configuration parameters that allow the application to make some general
-// compile-time decisions with respect to the the number of cores likely to be
-// available on this platform. For a definitive measure, the application should
-// still call SbSystemGetNumberOfProcessors at runtime.
-
-// Whether the current platform's thread scheduler will automatically balance
-// threads between cores, as opposed to systems where threads will only ever run
-// on the specifically pinned core.
-#define SB_HAS_CROSS_CORE_SCHEDULER 1
+// --- Architecture Configuration --------------------------------------------
 
 // --- System Header Configuration -------------------------------------------
 
 // Any system headers listed here that are not provided by the platform will be
 // emulated in starboard/types.h.
 
-// Whether the current platform provides the standard header stdarg.h.
-#define SB_HAS_STDARG_H 1
-
-// Whether the current platform provides the standard header stdbool.h.
-#define SB_HAS_STDBOOL_H 1
-
-// Whether the current platform provides the standard header stddef.h.
-#define SB_HAS_STDDEF_H 1
-
-// Whether the current platform provides the standard header stdint.h.
-#define SB_HAS_STDINT_H 1
-
-// Whether the current platform provides the standard header inttypes.h.
-#define SB_HAS_INTTYPES_H 1
-
 // Whether the current platform provides the standard header sys/types.h.
 #define SB_HAS_SYS_TYPES_H 0
 
-// Whether the current platform provides the standard header limits.h.
-#define SB_HAS_LIMITS_H 1
-
-// Whether the current platform provides the standard header float.h.
-#define SB_HAS_FLOAT_H 1
-
 // Whether the current platform provides ssize_t.
 #define SB_HAS_SSIZE_T 0
 
@@ -72,18 +43,12 @@
 #define SB_IS_WCHAR_T_UTF16 1
 #endif
 
-// Chrome only defines these two if ARMEL or MIPSEL are defined.
+// Chrome only defines this for ARMEL.
 #if defined(__ARMEL__)
 // Chrome has an exclusion for iOS here, we should too when we support iOS.
 #define SB_IS_WCHAR_T_UNSIGNED 1
-#elif defined(__MIPSEL__)
-#define SB_IS_WCHAR_T_SIGNED 1
 #endif
 
-// This quirk is used to fix an issue caused by the rewriting of memset to
-// SbMemorySet in third_party/protobuf/src/google/protobuf/stubs/port.h.
-#define SB_HAS_QUIRK_MEMSET_IN_SYSTEM_HEADERS 1
-
 // --- Compiler Configuration ------------------------------------------------
 
 // The platform's annotation for forcing a C function to be inlined.
@@ -139,9 +104,6 @@
 // The location to include hash_set on this platform.
 #define SB_HASH_SET_INCLUDE <ext/hash_set>
 
-// Define this to how this platform copies varargs blocks.
-#define SB_VA_COPY(dest, source) va_copy(dest, source)
-
 // --- Graphics Configuration ------------------------------------------------
 
 // Specifies whether this platform supports a performant accelerated blitter
diff --git a/src/starboard/evergreen/x86/configuration_public.h b/src/starboard/evergreen/x86/configuration_public.h
index 56b5909..861c7fa 100644
--- a/src/starboard/evergreen/x86/configuration_public.h
+++ b/src/starboard/evergreen/x86/configuration_public.h
@@ -21,45 +21,16 @@
 #ifndef STARBOARD_EVERGREEN_X86_CONFIGURATION_PUBLIC_H_
 #define STARBOARD_EVERGREEN_X86_CONFIGURATION_PUBLIC_H_
 
-// Configuration parameters that allow the application to make some general
-// compile-time decisions with respect to the the number of cores likely to be
-// available on this platform. For a definitive measure, the application should
-// still call SbSystemGetNumberOfProcessors at runtime.
-
-// Whether the current platform's thread scheduler will automatically balance
-// threads between cores, as opposed to systems where threads will only ever run
-// on the specifically pinned core.
-#define SB_HAS_CROSS_CORE_SCHEDULER 1
+// --- Architecture Configuration --------------------------------------------
 
 // --- System Header Configuration -------------------------------------------
 
 // Any system headers listed here that are not provided by the platform will be
 // emulated in starboard/types.h.
 
-// Whether the current platform provides the standard header stdarg.h.
-#define SB_HAS_STDARG_H 1
-
-// Whether the current platform provides the standard header stdbool.h.
-#define SB_HAS_STDBOOL_H 1
-
-// Whether the current platform provides the standard header stddef.h.
-#define SB_HAS_STDDEF_H 1
-
-// Whether the current platform provides the standard header stdint.h.
-#define SB_HAS_STDINT_H 1
-
-// Whether the current platform provides the standard header inttypes.h.
-#define SB_HAS_INTTYPES_H 1
-
 // Whether the current platform provides the standard header sys/types.h.
 #define SB_HAS_SYS_TYPES_H 0
 
-// Whether the current platform provides the standard header limits.h.
-#define SB_HAS_LIMITS_H 1
-
-// Whether the current platform provides the standard header float.h.
-#define SB_HAS_FLOAT_H 1
-
 // Whether the current platform provides ssize_t.
 #define SB_HAS_SSIZE_T 0
 
@@ -72,12 +43,10 @@
 #define SB_IS_WCHAR_T_UTF16 1
 #endif
 
-// Chrome only defines these two if ARMEL or MIPSEL are defined.
+// Chrome only defines this for ARMEL.
 #if defined(__ARMEL__)
 // Chrome has an exclusion for iOS here, we should too when we support iOS.
 #define SB_IS_WCHAR_T_UNSIGNED 1
-#elif defined(__MIPSEL__)
-#define SB_IS_WCHAR_T_SIGNED 1
 #endif
 
 // --- Compiler Configuration ------------------------------------------------
@@ -135,9 +104,6 @@
 // The location to include hash_set on this platform.
 #define SB_HASH_SET_INCLUDE <ext/hash_set>
 
-// Define this to how this platform copies varargs blocks.
-#define SB_VA_COPY(dest, source) va_copy(dest, source)
-
 // --- Graphics Configuration ------------------------------------------------
 
 // Specifies whether this platform supports a performant accelerated blitter
diff --git a/src/starboard/export.h b/src/starboard/export.h
index ccf317f..3578e17 100644
--- a/src/starboard/export.h
+++ b/src/starboard/export.h
@@ -21,27 +21,34 @@
 
 #include "starboard/configuration.h"
 
-// SB_EXPORT: Specification for a symbol that should be exported when building
-// the DLL and imported when building code that uses the DLL.
-
-// SB_EXPORT_PRIVATE: Specification for a symbol that should be exported or
-// imported for testing purposes only.
-
-// SB_IMPORT: Specification for a symbol that is expected to be defined
-// externally to this module.
-
-#if defined(COMPONENT_BUILD) || SB_IS(EVERGREEN)
 // COMPONENT_BUILD is defined when generating shared libraries for each project,
 // rather than static libraries. This means we need to be careful about
 // EXPORT/IMPORT.
+//
+// SB_IS_EVERGREEN is defined when the binaries generated will be composed
+// entirely of the Starboard implementation and will provide the Starboard API,
+// with all client applications being built separately.
 
-#if defined(STARBOARD_IMPLEMENTATION)
+#if defined(COMPONENT_BUILD) || SB_IS(EVERGREEN)
+
 // STARBOARD_IMPLEMENTATION is defined when building the Starboard library
 // sources, and shouldn't be defined when building sources that are clients of
 // Starboard.
+
+#if defined(STARBOARD_IMPLEMENTATION)
+
+// Specification for a symbol that should be exported when building the DLL and
+// imported when building code that uses the DLL.
 #define SB_EXPORT SB_EXPORT_PLATFORM
+
+// Specification for a symbol that should be exported or imported for testing
+// purposes only.
 #define SB_EXPORT_PRIVATE SB_EXPORT_PLATFORM
+
+// Specification for a symbol that is expected to be defined externally to this
+// module.
 #define SB_IMPORT SB_IMPORT_PLATFORM
+
 #else  // defined(STARBOARD_IMPLEMENTATION)
 #define SB_EXPORT SB_IMPORT_PLATFORM
 #define SB_EXPORT_PRIVATE SB_IMPORT_PLATFORM
diff --git a/src/starboard/format_string.h b/src/starboard/format_string.h
deleted file mode 100644
index 35beb76..0000000
--- a/src/starboard/format_string.h
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2019 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Module Overview: Starboard String module
-//
-// Move the definition of FormatString from string.h to this header to break
-// the dependency between string.h and standard header <string>.
-
-#ifndef STARBOARD_FORMAT_STRING_H_
-#define STARBOARD_FORMAT_STRING_H_
-
-#include "starboard/common/string.h"
-
-#if SB_API_VERSION >= 11
-#ifdef __cplusplus
-
-extern "C++" {
-
-#include <string>
-#include <vector>
-
-namespace starboard {
-
-SB_C_INLINE std::string FormatString(const char* format, ...)
-    SB_PRINTF_FORMAT(1, 2);
-
-SB_C_INLINE std::string FormatString(const char* format, ...) {
-  va_list arguments;
-  va_start(arguments, format);
-  int expected_size = ::SbStringFormat(NULL, 0, format, arguments);
-  va_end(arguments);
-
-  std::string result;
-  if (expected_size <= 0) {
-    return result;
-  }
-
-  std::vector<char> buffer(expected_size + 1);
-  va_start(arguments, format);
-  ::SbStringFormat(buffer.data(), buffer.size(), format, arguments);
-  va_end(arguments);
-  return std::string(buffer.data(), expected_size);
-}
-
-}  // namespace starboard
-
-}  // extern "C++"
-
-#endif  // __cplusplus
-
-#endif  // SB_API_VERSION >= 11
-
-#endif  // STARBOARD_FORMAT_STRING_H_
diff --git a/src/starboard/linux/shared/BUILD.gn b/src/starboard/linux/shared/BUILD.gn
index 8e843ac..8c26a02 100644
--- a/src/starboard/linux/shared/BUILD.gn
+++ b/src/starboard/linux/shared/BUILD.gn
@@ -25,11 +25,6 @@
 # =============================================================================
 
 config("compiler_defaults") {
-  cflags = [
-     # We'll pretend not to be Linux, but Starboard instead.
-    "-U__linux__",
-  ]
-
   cflags_c = [
     # Limit to C99. This allows Linux to be a canary build for any
     # C11 features that are not supported on some platforms' compilers.
diff --git a/src/starboard/linux/shared/configuration_public.h b/src/starboard/linux/shared/configuration_public.h
index 1c32935..1990c44 100644
--- a/src/starboard/linux/shared/configuration_public.h
+++ b/src/starboard/linux/shared/configuration_public.h
@@ -28,30 +28,9 @@
 // Any system headers listed here that are not provided by the platform will be
 // emulated in starboard/types.h.
 
-// Whether the current platform provides the standard header stdarg.h.
-#define SB_HAS_STDARG_H 1
-
-// Whether the current platform provides the standard header stdbool.h.
-#define SB_HAS_STDBOOL_H 1
-
-// Whether the current platform provides the standard header stddef.h.
-#define SB_HAS_STDDEF_H 1
-
-// Whether the current platform provides the standard header stdint.h.
-#define SB_HAS_STDINT_H 1
-
-// Whether the current platform provides the standard header inttypes.h.
-#define SB_HAS_INTTYPES_H 1
-
 // Whether the current platform provides the standard header sys/types.h.
 #define SB_HAS_SYS_TYPES_H 1
 
-// Whether the current platform provides the standard header limits.h.
-#define SB_HAS_LIMITS_H 1
-
-// Whether the current platform provides the standard header float.h.
-#define SB_HAS_FLOAT_H 1
-
 // Whether the current platform provides ssize_t.
 #define SB_HAS_SSIZE_T 1
 
@@ -64,12 +43,10 @@
 #define SB_IS_WCHAR_T_UTF16 1
 #endif
 
-// Chrome only defines these two if ARMEL or MIPSEL are defined.
+// Chrome only defines this for ARMEL.
 #if defined(__ARMEL__)
 // Chrome has an exclusion for iOS here, we should too when we support iOS.
 #define SB_IS_WCHAR_T_UNSIGNED 1
-#elif defined(__MIPSEL__)
-#define SB_IS_WCHAR_T_SIGNED 1
 #endif
 
 // --- Attribute Configuration -----------------------------------------------
@@ -127,9 +104,6 @@
 // The location to include hash_set on this platform.
 #define SB_HASH_SET_INCLUDE <ext/hash_set>
 
-// Define this to how this platform copies varargs blocks.
-#define SB_VA_COPY(dest, source) va_copy(dest, source)
-
 // --- Filesystem Configuration ----------------------------------------------
 
 #if SB_API_VERSION < 12
diff --git a/src/starboard/linux/shared/gyp_configuration.gypi b/src/starboard/linux/shared/gyp_configuration.gypi
index cf8dc21..cafbc99 100644
--- a/src/starboard/linux/shared/gyp_configuration.gypi
+++ b/src/starboard/linux/shared/gyp_configuration.gypi
@@ -34,11 +34,6 @@
       '-lrt',
     ],
 
-    'compiler_flags': [
-      # We'll pretend not to be Linux, but Starboard instead.
-      '-U__linux__',
-    ],
-
     # Using an inner scope for 'variables' so that it can be made a default
     # (and so overridden elsewhere), but yet still used immediately in this
     # file.
diff --git a/src/starboard/linux/shared/player_components_factory.cc b/src/starboard/linux/shared/player_components_factory.cc
index 2171f7e..8bac0b1 100644
--- a/src/starboard/linux/shared/player_components_factory.cc
+++ b/src/starboard/linux/shared/player_components_factory.cc
@@ -12,13 +12,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include "starboard/common/format_string.h"
 #include "starboard/common/log.h"
 #include "starboard/common/ref_counted.h"
 #include "starboard/common/scoped_ptr.h"
-#include "starboard/format_string.h"
-#if SB_API_VERSION >= 11
 #include "starboard/gles.h"
-#endif  // SB_API_VERSION >= 11
 #include "starboard/media.h"
 #include "starboard/shared/ffmpeg/ffmpeg_audio_decoder.h"
 #include "starboard/shared/ffmpeg/ffmpeg_video_decoder.h"
diff --git a/src/starboard/linux/x64x11/system_get_property_impl.cc b/src/starboard/linux/x64x11/system_get_property_impl.cc
index c503210..d698805 100644
--- a/src/starboard/linux/x64x11/system_get_property_impl.cc
+++ b/src/starboard/linux/x64x11/system_get_property_impl.cc
@@ -56,7 +56,9 @@
     case kSbSystemPropertyFirmwareVersion:
     case kSbSystemPropertyModelName:
     case kSbSystemPropertyModelYear:
-#if SB_API_VERSION >= 11
+#if SB_API_VERSION >= 12
+    case kSbSystemPropertySystemIntegratorName:
+#elif SB_API_VERSION == 11
     case kSbSystemPropertyOriginalDesignManufacturerName:
 #else
     case kSbSystemPropertyNetworkOperatorName:
diff --git a/src/starboard/nplb/system_get_property_test.cc b/src/starboard/nplb/system_get_property_test.cc
index 1fe8f97..d7e29ca 100644
--- a/src/starboard/nplb/system_get_property_test.cc
+++ b/src/starboard/nplb/system_get_property_test.cc
@@ -81,7 +81,9 @@
 
   BasicTest(kSbSystemPropertyChipsetModelNumber, false, true, __LINE__);
   BasicTest(kSbSystemPropertyFirmwareVersion, false, true, __LINE__);
-#if SB_API_VERSION >= 11
+#if SB_API_VERSION >= 12
+  BasicTest(kSbSystemPropertySystemIntegratorName, false, true, __LINE__);
+#elif SB_API_VERSION == 11
   BasicTest(kSbSystemPropertyOriginalDesignManufacturerName,
             false, true, __LINE__);
 #else
@@ -126,7 +128,9 @@
   UnmodifiedOnFailureTest(kSbSystemPropertyBrandName, __LINE__);
   UnmodifiedOnFailureTest(kSbSystemPropertyModelName, __LINE__);
   UnmodifiedOnFailureTest(kSbSystemPropertyModelYear, __LINE__);
-#if SB_API_VERSION >= 11
+#if SB_API_VERSION >= 12
+  UnmodifiedOnFailureTest(kSbSystemPropertySystemIntegratorName, __LINE__);
+#elif SB_API_VERSION == 11
   UnmodifiedOnFailureTest(kSbSystemPropertyOriginalDesignManufacturerName,
                           __LINE__);
 #else
@@ -157,7 +161,9 @@
     kSbSystemPropertyManufacturerName,
     kSbSystemPropertyModelName,
     kSbSystemPropertyModelYear,
-#if SB_API_VERSION >= 11
+#if SB_API_VERSION >= 12
+    kSbSystemPropertySystemIntegratorName,
+#elif SB_API_VERSION == 11
     kSbSystemPropertyOriginalDesignManufacturerName,
 #else
     kSbSystemPropertyNetworkOperatorName,
diff --git a/src/starboard/raspi/2/sbversion/12/configuration_public.h b/src/starboard/raspi/2/sbversion/12/configuration_public.h
index da93315..c91229a 100644
--- a/src/starboard/raspi/2/sbversion/12/configuration_public.h
+++ b/src/starboard/raspi/2/sbversion/12/configuration_public.h
@@ -30,6 +30,9 @@
 // Whether the current platform provides the standard header sys/types.h.
 #define SB_HAS_SYS_TYPES_H 1
 
+// Whether the current platform provides ssize_t.
+#define SB_HAS_SSIZE_T 1
+
 // Type detection for wchar_t.
 #if defined(__WCHAR_MAX__) && \
     (__WCHAR_MAX__ == 0x7fffffff || __WCHAR_MAX__ == 0xffffffff)
diff --git a/src/starboard/raspi/shared/configuration_public.h b/src/starboard/raspi/shared/configuration_public.h
index 7237fde..05988f6 100644
--- a/src/starboard/raspi/shared/configuration_public.h
+++ b/src/starboard/raspi/shared/configuration_public.h
@@ -23,44 +23,18 @@
 "Starboard API version."
 #endif  // SB_API_VERSION != SB_EXPERIMENTAL_API_VERSION
 
-// Configuration parameters that allow the application to make some general
-// compile-time decisions with respect to the the number of cores likely to be
-// available on this platform. For a definitive measure, the application should
-// still call SbSystemGetNumberOfProcessors at runtime.
-
-// Whether the current platform's thread scheduler will automatically balance
-// threads between cores, as opposed to systems where threads will only ever run
-// on the specifically pinned core.
-#define SB_HAS_CROSS_CORE_SCHEDULER 1
+// --- Architecture Configuration --------------------------------------------
 
 // --- System Header Configuration -------------------------------------------
 
 // Any system headers listed here that are not provided by the platform will be
 // emulated in starboard/types.h.
 
-// Whether the current platform provides the standard header stdarg.h.
-#define SB_HAS_STDARG_H 1
-
-// Whether the current platform provides the standard header stdbool.h.
-#define SB_HAS_STDBOOL_H 1
-
-// Whether the current platform provides the standard header stddef.h.
-#define SB_HAS_STDDEF_H 1
-
-// Whether the current platform provides the standard header stdint.h.
-#define SB_HAS_STDINT_H 1
-
-// Whether the current platform provides the standard header inttypes.h.
-#define SB_HAS_INTTYPES_H 1
-
 // Whether the current platform provides the standard header sys/types.h.
 #define SB_HAS_SYS_TYPES_H 1
 
-// Whether the current platform provides the standard header limits.h.
-#define SB_HAS_LIMITS_H 1
-
-// Whether the current platform provides the standard header float.h.
-#define SB_HAS_FLOAT_H 1
+// Whether the current platform provides ssize_t.
+#define SB_HAS_SSIZE_T 1
 
 // Type detection for wchar_t.
 #if defined(__WCHAR_MAX__) && \
@@ -71,12 +45,10 @@
 #define SB_IS_WCHAR_T_UTF16 1
 #endif
 
-// Chrome only defines these two if ARMEL or MIPSEL are defined.
+// Chrome only defines this for ARMEL.
 #if defined(__ARMEL__)
 // Chrome has an exclusion for iOS here, we should too when we support iOS.
 #define SB_IS_WCHAR_T_UNSIGNED 1
-#elif defined(__MIPSEL__)
-#define SB_IS_WCHAR_T_SIGNED 1
 #endif
 
 // --- Attribute Configuration -----------------------------------------------
@@ -134,9 +106,6 @@
 // The location to include hash_set on this platform.
 #define SB_HASH_SET_INCLUDE <ext/hash_set>
 
-// Define this to how this platform copies varargs blocks.
-#define SB_VA_COPY(dest, source) va_copy(dest, source)
-
 // --- Graphics Configuration ------------------------------------------------
 
 // Specifies whether this platform supports a performant accelerated blitter
diff --git a/src/starboard/raspi/shared/gyp_configuration.gypi b/src/starboard/raspi/shared/gyp_configuration.gypi
index a404e2b..ea69e9f 100644
--- a/src/starboard/raspi/shared/gyp_configuration.gypi
+++ b/src/starboard/raspi/shared/gyp_configuration.gypi
@@ -29,9 +29,6 @@
       '-O2',
     ],
     'compiler_flags': [
-      # We'll pretend not to be Linux, but Starboard instead.
-      '-U__linux__',
-
       # Force char to be signed.
       '-fsigned-char',
 
diff --git a/src/starboard/raspi/shared/system_get_property.cc b/src/starboard/raspi/shared/system_get_property.cc
index ceae991..30c8fb0 100644
--- a/src/starboard/raspi/shared/system_get_property.cc
+++ b/src/starboard/raspi/shared/system_get_property.cc
@@ -20,9 +20,7 @@
 #include <memory>
 #include <string>
 
-#if SB_API_VERSION >= 11
-#include "starboard/format_string.h"
-#endif  // SB_API_VERSION >= 11
+#include "starboard/common/format_string.h"
 #include "starboard/common/log.h"
 #include "starboard/common/string.h"
 
@@ -143,7 +141,9 @@
     case kSbSystemPropertyChipsetModelNumber:
     case kSbSystemPropertyFirmwareVersion:
     case kSbSystemPropertyModelYear:
-#if SB_API_VERSION >= 11
+#if SB_API_VERSION >= 12
+    case kSbSystemPropertySystemIntegratorName:
+#elif SB_API_VERSION == 11
     case kSbSystemPropertyOriginalDesignManufacturerName:
 #else
     case kSbSystemPropertyNetworkOperatorName:
diff --git a/src/starboard/shared/ffmpeg/ffmpeg_audio_decoder_impl.cc b/src/starboard/shared/ffmpeg/ffmpeg_audio_decoder_impl.cc
index 3d8f090..f4b931d 100644
--- a/src/starboard/shared/ffmpeg/ffmpeg_audio_decoder_impl.cc
+++ b/src/starboard/shared/ffmpeg/ffmpeg_audio_decoder_impl.cc
@@ -18,9 +18,7 @@
 #include "starboard/shared/ffmpeg/ffmpeg_audio_decoder_impl.h"
 
 #include "starboard/audio_sink.h"
-#if SB_API_VERSION >= 11
-#include "starboard/format_string.h"
-#endif  // SB_API_VERSION >= 11
+#include "starboard/common/format_string.h"
 #include "starboard/common/log.h"
 #include "starboard/common/string.h"
 #include "starboard/memory.h"
diff --git a/src/starboard/shared/ffmpeg/ffmpeg_video_decoder_impl.cc b/src/starboard/shared/ffmpeg/ffmpeg_video_decoder_impl.cc
index 0509caa..9c1f321 100644
--- a/src/starboard/shared/ffmpeg/ffmpeg_video_decoder_impl.cc
+++ b/src/starboard/shared/ffmpeg/ffmpeg_video_decoder_impl.cc
@@ -17,9 +17,7 @@
 
 #include "starboard/shared/ffmpeg/ffmpeg_video_decoder_impl.h"
 
-#if SB_API_VERSION >= 11
-#include "starboard/format_string.h"
-#endif  // SB_API_VERSION >= 11
+#include "starboard/common/format_string.h"
 #include "starboard/common/string.h"
 #include "starboard/linux/shared/decode_target_internal.h"
 #include "starboard/memory.h"
diff --git a/src/starboard/shared/libaom/aom_video_decoder.cc b/src/starboard/shared/libaom/aom_video_decoder.cc
index 711ea24..23a63e6 100644
--- a/src/starboard/shared/libaom/aom_video_decoder.cc
+++ b/src/starboard/shared/libaom/aom_video_decoder.cc
@@ -14,9 +14,7 @@
 
 #include "starboard/shared/libaom/aom_video_decoder.h"
 
-#if SB_API_VERSION >= 11
-#include "starboard/format_string.h"
-#endif  // SB_API_VERSION >= 11
+#include "starboard/common/format_string.h"
 #include "starboard/common/log.h"
 #include "starboard/common/string.h"
 #include "starboard/linux/shared/decode_target_internal.h"
diff --git a/src/starboard/shared/libdav1d/dav1d_video_decoder.cc b/src/starboard/shared/libdav1d/dav1d_video_decoder.cc
index d063310..6aee08e 100644
--- a/src/starboard/shared/libdav1d/dav1d_video_decoder.cc
+++ b/src/starboard/shared/libdav1d/dav1d_video_decoder.cc
@@ -16,9 +16,7 @@
 
 #include <string>
 
-#if SB_API_VERSION >= 11
-#include "starboard/format_string.h"
-#endif  // SB_API_VERSION >= 11
+#include "starboard/common/format_string.h"
 #include "starboard/common/log.h"
 #include "starboard/common/string.h"
 #include "starboard/memory.h"
diff --git a/src/starboard/shared/libde265/de265_video_decoder.cc b/src/starboard/shared/libde265/de265_video_decoder.cc
index 931e5ab..87fefcb 100644
--- a/src/starboard/shared/libde265/de265_video_decoder.cc
+++ b/src/starboard/shared/libde265/de265_video_decoder.cc
@@ -14,9 +14,7 @@
 
 #include "starboard/shared/libde265/de265_video_decoder.h"
 
-#if SB_API_VERSION >= 11
-#include "starboard/format_string.h"
-#endif  // SB_API_VERSION >= 11
+#include "starboard/common/format_string.h"
 #include "starboard/linux/shared/decode_target_internal.h"
 #include "starboard/shared/libde265/de265_library_loader.h"
 #include "starboard/string.h"
diff --git a/src/starboard/shared/libvpx/vpx_video_decoder.cc b/src/starboard/shared/libvpx/vpx_video_decoder.cc
index 6bd1488..be2a918 100644
--- a/src/starboard/shared/libvpx/vpx_video_decoder.cc
+++ b/src/starboard/shared/libvpx/vpx_video_decoder.cc
@@ -14,9 +14,7 @@
 
 #include "starboard/shared/libvpx/vpx_video_decoder.h"
 
-#if SB_API_VERSION >= 11
-#include "starboard/format_string.h"
-#endif  // SB_API_VERSION >= 11
+#include "starboard/common/format_string.h"
 #include "starboard/common/string.h"
 #include "starboard/linux/shared/decode_target_internal.h"
 #include "starboard/shared/libvpx/vpx_library_loader.h"
diff --git a/src/starboard/shared/linux/cpu_features_get.cc b/src/starboard/shared/linux/cpu_features_get.cc
index 8659a64..fe460e2 100644
--- a/src/starboard/shared/linux/cpu_features_get.cc
+++ b/src/starboard/shared/linux/cpu_features_get.cc
@@ -24,8 +24,6 @@
 // On X86/X86_64, we read CPU version strings from /proc/cpuinfo. We get other
 // CPU version information and feature flags by CPUID instruction, which gives
 // more precise and complete information than reading from /proc/cpuinfo.
-//
-// TODO: Mips/Mips64 and Ppc/Ppc64
 
 #include "starboard/cpu_features.h"
 
diff --git a/src/starboard/shared/opus/opus_audio_decoder.cc b/src/starboard/shared/opus/opus_audio_decoder.cc
index 8555023..cf7b132 100644
--- a/src/starboard/shared/opus/opus_audio_decoder.cc
+++ b/src/starboard/shared/opus/opus_audio_decoder.cc
@@ -14,9 +14,7 @@
 
 #include "starboard/shared/opus/opus_audio_decoder.h"
 
-#if SB_API_VERSION >= 11
-#include "starboard/format_string.h"
-#endif  // SB_API_VERSION >= 11
+#include "starboard/common/format_string.h"
 #include "starboard/common/log.h"
 #include "starboard/common/string.h"
 #include "starboard/memory.h"
diff --git a/src/starboard/shared/pthread/thread_context_internal.cc b/src/starboard/shared/pthread/thread_context_internal.cc
index e17c5b5..2d40ca0 100644
--- a/src/starboard/shared/pthread/thread_context_internal.cc
+++ b/src/starboard/shared/pthread/thread_context_internal.cc
@@ -16,7 +16,7 @@
 
 #if SB_API_VERSION >= 11
 
-#if !defined(__gnu_linux__)  // Note: __linux__ is undef'd for Starboard builds.
+#if !defined(__linux__)
 #error "SbThreadContext is only implemented for Linux"
 #endif
 
diff --git a/src/starboard/shared/starboard/audio_sink/audio_sink_create.cc b/src/starboard/shared/starboard/audio_sink/audio_sink_create.cc
index dd9d555..e0f30f5 100644
--- a/src/starboard/shared/starboard/audio_sink/audio_sink_create.cc
+++ b/src/starboard/shared/starboard/audio_sink/audio_sink_create.cc
@@ -27,85 +27,12 @@
     SbAudioSinkUpdateSourceStatusFunc update_source_status_func,
     SbAudioSinkConsumeFramesFunc consume_frames_func,
     void* context) {
-  if (channels <= 0 || channels > SbAudioSinkGetMaxChannels()) {
-    SB_LOG(WARNING) << "Invalid audio channels " << channels;
-    return kSbAudioSinkInvalid;
-  }
-
-  if (sampling_frequency_hz <= 0) {
-    SB_LOG(WARNING) << "Invalid audio sampling frequency "
-                    << sampling_frequency_hz;
-    return kSbAudioSinkInvalid;
-  }
-
-  if (!SbAudioSinkIsAudioSampleTypeSupported(audio_sample_type)) {
-    SB_LOG(WARNING) << "Invalid audio sample type " << audio_sample_type;
-    return kSbAudioSinkInvalid;
-  }
-
-  if (!SbAudioSinkIsAudioFrameStorageTypeSupported(audio_frame_storage_type)) {
-    SB_LOG(WARNING) << "Invalid audio frame storage type "
-                    << audio_frame_storage_type;
-    return kSbAudioSinkInvalid;
-  }
-
-  if (frame_buffers == NULL) {
-    SB_LOG(WARNING) << "Pointer to frame buffers cannot be NULL";
-    return kSbAudioSinkInvalid;
-  }
-
-  if (frame_buffers_size_in_frames <= 0) {
-    SB_LOG(WARNING) << "Invalid frame buffer size "
-                    << frame_buffers_size_in_frames;
-    return kSbAudioSinkInvalid;
-  }
-
-  if (update_source_status_func == NULL) {
-    SB_LOG(WARNING) << "update_source_status_func cannot be NULL";
-    return kSbAudioSinkInvalid;
-  }
-
-  if (consume_frames_func == NULL) {
-    SB_LOG(WARNING) << "consume_frames_func cannot be NULL";
-    return kSbAudioSinkInvalid;
-  }
-
-  auto audio_sink_type = SbAudioSinkPrivate::GetPreferredType();
-  if (!audio_sink_type) {
-    SB_LOG(WARNING) << "Preferred Sink Type is invalid.";
-    return kSbAudioSinkInvalid;
-  }
-
-  SbAudioSink audio_sink = audio_sink_type->Create(
+  return SbAudioSinkPrivate::Create(
       channels, sampling_frequency_hz, audio_sample_type,
       audio_frame_storage_type, frame_buffers, frame_buffers_size_in_frames,
-      update_source_status_func,
-      SbAudioSinkPrivate::GetConsumeFramesFunc(consume_frames_func),
+      update_source_status_func, consume_frames_func,
 #if SB_API_VERSION >= 12
       NULL /*error_func*/,
 #endif  // SB_API_VERSION >= 12
       context);
-  if (audio_sink_type->IsValid(audio_sink)) {
-    return audio_sink;
-  }
-  audio_sink_type->Destroy(audio_sink);
-  auto fallback_audio_sink_type = SbAudioSinkPrivate::GetFallbackType();
-  if (!fallback_audio_sink_type) {
-    SB_LOG(WARNING) << "Fallback Sink Type is invalid.";
-    return kSbAudioSinkInvalid;
-  }
-  audio_sink = fallback_audio_sink_type->Create(
-      channels, sampling_frequency_hz, audio_sample_type,
-      audio_frame_storage_type, frame_buffers, frame_buffers_size_in_frames,
-      update_source_status_func,
-      SbAudioSinkPrivate::GetConsumeFramesFunc(consume_frames_func),
-#if SB_API_VERSION >= 12
-      NULL /*error_func*/,
-#endif  // SB_API_VERSION >= 12
-      context);
-  if (fallback_audio_sink_type->IsValid(audio_sink)) {
-    return audio_sink;
-  }
-  fallback_audio_sink_type->Destroy(audio_sink);
-  return kSbAudioSinkInvalid;
 }
diff --git a/src/starboard/shared/starboard/audio_sink/audio_sink_internal.cc b/src/starboard/shared/starboard/audio_sink/audio_sink_internal.cc
index a3f4f08..0d4ae83 100644
--- a/src/starboard/shared/starboard/audio_sink/audio_sink_internal.cc
+++ b/src/starboard/shared/starboard/audio_sink/audio_sink_internal.cc
@@ -16,6 +16,7 @@
 
 #include <functional>
 
+#include "starboard/common/log.h"
 #include "starboard/shared/starboard/application.h"
 #include "starboard/shared/starboard/audio_sink/stub_audio_sink_type.h"
 #include "starboard/shared/starboard/command_line.h"
@@ -107,9 +108,124 @@
   return audio_sink_type;
 }
 
+SbAudioSink SbAudioSinkPrivate::Create(
+    int channels,
+    int sampling_frequency_hz,
+    SbMediaAudioSampleType audio_sample_type,
+    SbMediaAudioFrameStorageType audio_frame_storage_type,
+    SbAudioSinkFrameBuffers frame_buffers,
+    int frame_buffers_size_in_frames,
+    SbAudioSinkUpdateSourceStatusFunc update_source_status_func,
+    ConsumeFramesFunc consume_frames_func,
+#if SB_API_VERSION >= 12
+    ErrorFunc error_func,
+#endif  // SB_API_VERSION >= 12
+    void* context) {
+  if (channels <= 0 || channels > SbAudioSinkGetMaxChannels()) {
+    SB_LOG(WARNING) << "Invalid audio channels " << channels;
+    return kSbAudioSinkInvalid;
+  }
+
+  if (sampling_frequency_hz <= 0) {
+    SB_LOG(WARNING) << "Invalid audio sampling frequency "
+                    << sampling_frequency_hz;
+    return kSbAudioSinkInvalid;
+  }
+
+  if (!SbAudioSinkIsAudioSampleTypeSupported(audio_sample_type)) {
+    SB_LOG(WARNING) << "Invalid audio sample type " << audio_sample_type;
+    return kSbAudioSinkInvalid;
+  }
+
+  if (!SbAudioSinkIsAudioFrameStorageTypeSupported(audio_frame_storage_type)) {
+    SB_LOG(WARNING) << "Invalid audio frame storage type "
+                    << audio_frame_storage_type;
+    return kSbAudioSinkInvalid;
+  }
+
+  if (frame_buffers == NULL) {
+    SB_LOG(WARNING) << "Pointer to frame buffers cannot be NULL";
+    return kSbAudioSinkInvalid;
+  }
+
+  if (frame_buffers_size_in_frames <= 0) {
+    SB_LOG(WARNING) << "Invalid frame buffer size "
+                    << frame_buffers_size_in_frames;
+    return kSbAudioSinkInvalid;
+  }
+
+  if (update_source_status_func == NULL) {
+    SB_LOG(WARNING) << "update_source_status_func cannot be NULL";
+    return kSbAudioSinkInvalid;
+  }
+
+  if (!consume_frames_func) {
+    SB_LOG(WARNING) << "consume_frames_func cannot be NULL";
+    return kSbAudioSinkInvalid;
+  }
+
+  if (auto audio_sink_type = GetPreferredType()) {
+    auto audio_sink = audio_sink_type->Create(
+        channels, sampling_frequency_hz, audio_sample_type,
+        audio_frame_storage_type, frame_buffers, frame_buffers_size_in_frames,
+        update_source_status_func, consume_frames_func,
+#if SB_API_VERSION >= 12
+        error_func,
+#endif  // SB_API_VERSION >= 12
+        context);
+    if (audio_sink_type->IsValid(audio_sink)) {
+      return audio_sink;
+    }
+    SB_LOG(ERROR) << "Failed to create SbAudioSink from preferred type.";
+    audio_sink_type->Destroy(audio_sink);
+  } else {
+    SB_LOG(WARNING) << "Preferred Sink Type is invalid.";
+  }
+
+  SB_LOG(WARNING) << "Try to create AudioSink using fallback type.";
+  if (auto fallback_type = SbAudioSinkPrivate::GetFallbackType()) {
+    auto audio_sink = fallback_type->Create(
+        channels, sampling_frequency_hz, audio_sample_type,
+        audio_frame_storage_type, frame_buffers, frame_buffers_size_in_frames,
+        update_source_status_func, consume_frames_func,
+#if SB_API_VERSION >= 12
+        error_func,
+#endif  // SB_API_VERSION >= 12
+        context);
+    if (fallback_type->IsValid(audio_sink)) {
+      return audio_sink;
+    }
+    SB_LOG(ERROR) << "Failed to create SbAudioSink from Fallback type.";
+    fallback_type->Destroy(audio_sink);
+  } else {
+    SB_LOG(WARNING) << "Fallback Sink Type is invalid.";
+  }
+  return kSbAudioSinkInvalid;
+}
+
 // static
-SbAudioSinkPrivate::ConsumeFramesFunc SbAudioSinkPrivate::GetConsumeFramesFunc(
-    SbAudioSinkConsumeFramesFunc sb_consume_frames_func) {
-  return std::bind(&::WrapConsumeFramesFunc, sb_consume_frames_func, _1, _2,
-                   _3);
+SbAudioSink SbAudioSinkPrivate::Create(
+    int channels,
+    int sampling_frequency_hz,
+    SbMediaAudioSampleType audio_sample_type,
+    SbMediaAudioFrameStorageType audio_frame_storage_type,
+    SbAudioSinkFrameBuffers frame_buffers,
+    int frame_buffers_size_in_frames,
+    SbAudioSinkUpdateSourceStatusFunc update_source_status_func,
+    SbAudioSinkConsumeFramesFunc sb_consume_frames_func,
+#if SB_API_VERSION >= 12
+    ErrorFunc error_func,
+#endif  // SB_API_VERSION >= 12
+    void* context) {
+  return Create(channels, sampling_frequency_hz, audio_sample_type,
+                audio_frame_storage_type, frame_buffers,
+                frame_buffers_size_in_frames, update_source_status_func,
+                sb_consume_frames_func
+                    ? std::bind(&::WrapConsumeFramesFunc,
+                                sb_consume_frames_func, _1, _2, _3)
+                    : ConsumeFramesFunc(),
+#if SB_API_VERSION >= 12
+                error_func,
+#endif  // SB_API_VERSION >= 12
+                context);
 }
diff --git a/src/starboard/shared/starboard/audio_sink/audio_sink_internal.h b/src/starboard/shared/starboard/audio_sink/audio_sink_internal.h
index 322ea45..bffc40a 100644
--- a/src/starboard/shared/starboard/audio_sink/audio_sink_internal.h
+++ b/src/starboard/shared/starboard/audio_sink/audio_sink_internal.h
@@ -83,13 +83,38 @@
   // Fallback. If Fallback is not enabled, then returns NULL.
   static Type* GetPreferredType();
 
+  static SbAudioSink Create(
+      int channels,
+      int sampling_frequency_hz,
+      SbMediaAudioSampleType audio_sample_type,
+      SbMediaAudioFrameStorageType audio_frame_storage_type,
+      SbAudioSinkFrameBuffers frame_buffers,
+      int frame_buffers_size_in_frames,
+      SbAudioSinkUpdateSourceStatusFunc update_source_status_func,
+      ConsumeFramesFunc consume_frames_func,
+#if SB_API_VERSION >= 12
+      ErrorFunc error_func,
+#endif  // SB_API_VERSION >= 12
+      void* context);
+
+  static SbAudioSink Create(
+      int channels,
+      int sampling_frequency_hz,
+      SbMediaAudioSampleType audio_sample_type,
+      SbMediaAudioFrameStorageType audio_frame_storage_type,
+      SbAudioSinkFrameBuffers frame_buffers,
+      int frame_buffers_size_in_frames,
+      SbAudioSinkUpdateSourceStatusFunc update_source_status_func,
+      SbAudioSinkConsumeFramesFunc sb_consume_frames_func,
+#if SB_API_VERSION >= 12
+      ErrorFunc error_func,
+#endif  // SB_API_VERSION >= 12
+      void* context);
+
   // Individual implementation has to provide implementation of the following
   // functions, which will be called inside Initialize() and TearDown().
   static void PlatformInitialize();
   static void PlatformTearDown();
-
-  static ConsumeFramesFunc GetConsumeFramesFunc(
-      SbAudioSinkConsumeFramesFunc sb_consume_frames_func);
 };
 
 #endif  // STARBOARD_SHARED_STARBOARD_AUDIO_SINK_AUDIO_SINK_INTERNAL_H_
diff --git a/src/starboard/shared/starboard/media/video_capabilities.cc b/src/starboard/shared/starboard/media/video_capabilities.cc
index 78d8fd8..1b6ba44 100644
--- a/src/starboard/shared/starboard/media/video_capabilities.cc
+++ b/src/starboard/shared/starboard/media/video_capabilities.cc
@@ -14,8 +14,8 @@
 
 #include "starboard/shared/starboard/media/video_capabilities.h"
 
+#include "starboard/common/format_string.h"
 #include "starboard/common/log.h"
-#include "starboard/format_string.h"
 #include "starboard/shared/starboard/media/media_util.h"
 
 namespace starboard {
diff --git a/src/starboard/shared/starboard/player/filter/audio_renderer_internal_impl.cc b/src/starboard/shared/starboard/player/filter/audio_renderer_internal_impl.cc
index 7615d4d..90b7748 100644
--- a/src/starboard/shared/starboard/player/filter/audio_renderer_internal_impl.cc
+++ b/src/starboard/shared/starboard/player/filter/audio_renderer_internal_impl.cc
@@ -521,7 +521,7 @@
 
   // TODO: Support planar only audio sink.
   audio_renderer_sink_->Start(
-      channels_, destination_sample_rate, sink_sample_type_,
+      seeking_to_time_, channels_, destination_sample_rate, sink_sample_type_,
       kSbMediaAudioFrameStorageTypeInterleaved,
       reinterpret_cast<SbAudioSinkFrameBuffers>(frame_buffers_),
       max_cached_frames_, this);
diff --git a/src/starboard/shared/starboard/player/filter/audio_renderer_sink.h b/src/starboard/shared/starboard/player/filter/audio_renderer_sink.h
index 2d98c3e..7142d0a 100644
--- a/src/starboard/shared/starboard/player/filter/audio_renderer_sink.h
+++ b/src/starboard/shared/starboard/player/filter/audio_renderer_sink.h
@@ -56,7 +56,8 @@
       int sampling_frequency_hz) const = 0;
 
   virtual bool HasStarted() const = 0;
-  virtual void Start(int channels,
+  virtual void Start(SbTime media_start_time,
+                     int channels,
                      int sampling_frequency_hz,
                      SbMediaAudioSampleType audio_sample_type,
                      SbMediaAudioFrameStorageType audio_frame_storage_type,
diff --git a/src/starboard/shared/starboard/player/filter/audio_renderer_sink_impl.cc b/src/starboard/shared/starboard/player/filter/audio_renderer_sink_impl.cc
index 270f8a5..61a48db 100644
--- a/src/starboard/shared/starboard/player/filter/audio_renderer_sink_impl.cc
+++ b/src/starboard/shared/starboard/player/filter/audio_renderer_sink_impl.cc
@@ -14,7 +14,6 @@
 
 #include "starboard/shared/starboard/player/filter/audio_renderer_sink_impl.h"
 
-#include "starboard/audio_sink.h"
 #include "starboard/common/log.h"
 #include "starboard/configuration_constants.h"
 #include "starboard/shared/starboard/thread_checker.h"
@@ -26,10 +25,37 @@
 namespace filter {
 
 AudioRendererSinkImpl::AudioRendererSinkImpl()
-    : audio_sink_(kSbAudioSinkInvalid),
-      render_callback_(NULL),
-      playback_rate_(1.0),
-      volume_(1.0) {}
+    : create_audio_sink_func_(
+          [](SbTime start_media_time,
+             int channels,
+             int sampling_frequency_hz,
+             SbMediaAudioSampleType audio_sample_type,
+             SbMediaAudioFrameStorageType audio_frame_storage_type,
+             SbAudioSinkFrameBuffers frame_buffers,
+             int frame_buffers_size_in_frames,
+             SbAudioSinkUpdateSourceStatusFunc update_source_status_func,
+             SbAudioSinkPrivate::ConsumeFramesFunc consume_frames_func,
+#if SB_API_VERSION >= 12
+             SbAudioSinkPrivate::ErrorFunc error_func,
+#endif  // SB_API_VERSION >= 12
+             void* context) {
+            return SbAudioSinkPrivate::Create(
+                channels, sampling_frequency_hz, audio_sample_type,
+                audio_frame_storage_type, frame_buffers,
+                frame_buffers_size_in_frames, update_source_status_func,
+                consume_frames_func,
+#if SB_API_VERSION >= 12
+                error_func,
+#endif  // SB_API_VERSION >= 12
+                context);
+          }) {
+}
+
+AudioRendererSinkImpl::AudioRendererSinkImpl(
+    CreateAudioSinkFunc create_audio_sink_func)
+    : create_audio_sink_func_(create_audio_sink_func) {
+  SB_DCHECK(create_audio_sink_func_);
+}
 
 AudioRendererSinkImpl::~AudioRendererSinkImpl() {
   SB_DCHECK(thread_checker_.CalledOnValidThread());
@@ -57,6 +83,7 @@
 }
 
 void AudioRendererSinkImpl::Start(
+    SbTime media_start_time,
     int channels,
     int sampling_frequency_hz,
     SbMediaAudioSampleType audio_sample_type,
@@ -76,44 +103,15 @@
 
   Stop();
   render_callback_ = render_callback;
-  audio_sink_ = kSbAudioSinkInvalid;
-  SbAudioSinkPrivate::Type* audio_sink_type =
-      SbAudioSinkPrivate::GetPreferredType();
-  if (audio_sink_type) {
-    audio_sink_ = audio_sink_type->Create(
-        channels, sampling_frequency_hz, audio_sample_type,
-        audio_frame_storage_type, frame_buffers, frames_per_channel,
-        &AudioRendererSinkImpl::UpdateSourceStatusFunc,
-        &AudioRendererSinkImpl::ConsumeFramesFunc,
+  audio_sink_ = create_audio_sink_func_(
+      media_start_time, channels, sampling_frequency_hz, audio_sample_type,
+      audio_frame_storage_type, frame_buffers, frames_per_channel,
+      &AudioRendererSinkImpl::UpdateSourceStatusFunc,
+      &AudioRendererSinkImpl::ConsumeFramesFunc,
 #if SB_API_VERSION >= 12
-        &AudioRendererSinkImpl::ErrorFunc,
+      &AudioRendererSinkImpl::ErrorFunc,
 #endif  // SB_API_VERSION >= 12
-        this);
-    if (!audio_sink_type->IsValid(audio_sink_)) {
-      SB_LOG(WARNING) << "Created invalid SbAudioSink from "
-                         "SbAudioSinkPrivate::Type. Destroying and "
-                         "resetting.";
-      audio_sink_type->Destroy(audio_sink_);
-      audio_sink_ = kSbAudioSinkInvalid;
-      auto fallback_type = SbAudioSinkPrivate::GetFallbackType();
-      if (fallback_type) {
-        audio_sink_ = fallback_type->Create(
-            channels, sampling_frequency_hz, audio_sample_type,
-            audio_frame_storage_type, frame_buffers, frames_per_channel,
-            &AudioRendererSinkImpl::UpdateSourceStatusFunc,
-            &AudioRendererSinkImpl::ConsumeFramesFunc,
-#if SB_API_VERSION >= 12
-            &AudioRendererSinkImpl::ErrorFunc,
-#endif  // SB_API_VERSION >= 12
-            this);
-        if (!fallback_type->IsValid(audio_sink_)) {
-          SB_LOG(ERROR) << "Failed to create SbAudioSink from Fallback type.";
-          fallback_type->Destroy(audio_sink_);
-          audio_sink_ = kSbAudioSinkInvalid;
-        }
-      }
-    }
-  }
+      this);
   if (!SbAudioSinkIsValid(audio_sink_)) {
     return;
   }
diff --git a/src/starboard/shared/starboard/player/filter/audio_renderer_sink_impl.h b/src/starboard/shared/starboard/player/filter/audio_renderer_sink_impl.h
index 12fa6a6..239180f 100644
--- a/src/starboard/shared/starboard/player/filter/audio_renderer_sink_impl.h
+++ b/src/starboard/shared/starboard/player/filter/audio_renderer_sink_impl.h
@@ -15,6 +15,9 @@
 #ifndef STARBOARD_SHARED_STARBOARD_PLAYER_FILTER_AUDIO_RENDERER_SINK_IMPL_H_
 #define STARBOARD_SHARED_STARBOARD_PLAYER_FILTER_AUDIO_RENDERER_SINK_IMPL_H_
 
+#include <functional>
+
+#include "starboard/audio_sink.h"
 #include "starboard/shared/internal_only.h"
 #include "starboard/shared/starboard/audio_sink/audio_sink_internal.h"
 #include "starboard/shared/starboard/player/filter/audio_renderer_sink.h"
@@ -28,7 +31,24 @@
 
 class AudioRendererSinkImpl : public AudioRendererSink {
  public:
+  typedef std::function<SbAudioSink(
+      SbTime media_start_time,
+      int channels,
+      int sampling_frequency_hz,
+      SbMediaAudioSampleType audio_sample_type,
+      SbMediaAudioFrameStorageType audio_frame_storage_type,
+      SbAudioSinkFrameBuffers frame_buffers,
+      int frame_buffers_size_in_frames,
+      SbAudioSinkUpdateSourceStatusFunc update_source_status_func,
+      SbAudioSinkPrivate::ConsumeFramesFunc consume_frames_func,
+#if SB_API_VERSION >= 12
+      SbAudioSinkPrivate::ErrorFunc error_func,
+#endif  // SB_API_VERSION >= 12
+      void* context)>
+      CreateAudioSinkFunc;
+
   AudioRendererSinkImpl();
+  explicit AudioRendererSinkImpl(CreateAudioSinkFunc create_audio_sink_func);
   ~AudioRendererSinkImpl() override;
 
  private:
@@ -41,7 +61,8 @@
       override;
 
   bool HasStarted() const override;
-  void Start(int channels,
+  void Start(SbTime media_start_time,
+             int channels,
              int sampling_frequency_hz,
              SbMediaAudioSampleType audio_sample_type,
              SbMediaAudioFrameStorageType audio_frame_storage_type,
@@ -65,10 +86,12 @@
   static void ErrorFunc(bool capability_changed, void* context);
 
   ThreadChecker thread_checker_;
-  SbAudioSinkPrivate* audio_sink_;
-  RenderCallback* render_callback_;
-  double playback_rate_;
-  double volume_;
+  const CreateAudioSinkFunc create_audio_sink_func_;
+
+  SbAudioSinkPrivate* audio_sink_ = kSbAudioSinkInvalid;
+  RenderCallback* render_callback_ = NULL;
+  double playback_rate_ = 1.0;
+  double volume_ = 1.0;
 };
 
 }  // namespace filter
diff --git a/src/starboard/shared/starboard/player/filter/filter_based_player_worker_handler.cc b/src/starboard/shared/starboard/player/filter/filter_based_player_worker_handler.cc
index c8efd9b..196d422 100644
--- a/src/starboard/shared/starboard/player/filter/filter_based_player_worker_handler.cc
+++ b/src/starboard/shared/starboard/player/filter/filter_based_player_worker_handler.cc
@@ -15,9 +15,9 @@
 #include "starboard/shared/starboard/player/filter/filter_based_player_worker_handler.h"
 
 #include "starboard/audio_sink.h"
+#include "starboard/common/format_string.h"
 #include "starboard/common/log.h"
 #include "starboard/common/murmurhash2.h"
-#include "starboard/format_string.h"
 #include "starboard/memory.h"
 #include "starboard/shared/starboard/application.h"
 #include "starboard/shared/starboard/drm/drm_system_internal.h"
diff --git a/src/starboard/shared/starboard/player/filter/mock_audio_renderer_sink.h b/src/starboard/shared/starboard/player/filter/mock_audio_renderer_sink.h
index 9835a65..f56e21f 100644
--- a/src/starboard/shared/starboard/player/filter/mock_audio_renderer_sink.h
+++ b/src/starboard/shared/starboard/player/filter/mock_audio_renderer_sink.h
@@ -37,8 +37,9 @@
   MOCK_CONST_METHOD1(GetNearestSupportedSampleFrequency,
                      int(int sampling_frequency_hz));
   MOCK_CONST_METHOD0(HasStarted, bool());
-  MOCK_METHOD7(Start,
-               void(int channels,
+  MOCK_METHOD8(Start,
+               void(SbTime media_start_time,
+                    int channels,
                     int sampling_frequency_hz,
                     SbMediaAudioSampleType audio_sample_type,
                     SbMediaAudioFrameStorageType audio_frame_storage_type,
diff --git a/src/starboard/shared/starboard/player/filter/testing/audio_renderer_internal_test.cc b/src/starboard/shared/starboard/player/filter/testing/audio_renderer_internal_test.cc
index d5e9f2e..7fbff6c 100644
--- a/src/starboard/shared/starboard/player/filter/testing/audio_renderer_internal_test.cc
+++ b/src/starboard/shared/starboard/player/filter/testing/audio_renderer_internal_test.cc
@@ -77,11 +77,11 @@
         .WillByDefault(
             DoAll(SetArgPointee<0>(kDefaultSamplesPerSecond),
                   Return(scoped_refptr<DecodedAudio>(new DecodedAudio()))));
-    ON_CALL(*audio_renderer_sink_, Start(_, _, _, _, _, _, _))
+    ON_CALL(*audio_renderer_sink_, Start(_, _, _, _, _, _, _, _))
         .WillByDefault(DoAll(InvokeWithoutArgs([this]() {
                                audio_renderer_sink_->SetHasStarted(true);
                              }),
-                             SaveArg<6>(&renderer_callback_)));
+                             SaveArg<7>(&renderer_callback_)));
     ON_CALL(*audio_renderer_sink_, Stop())
         .WillByDefault(InvokeWithoutArgs([this]() {
           audio_renderer_sink_->SetHasStarted(false);
@@ -324,7 +324,7 @@
     EXPECT_CALL(*audio_renderer_sink_, Stop()).Times(AnyNumber());
     EXPECT_CALL(
         *audio_renderer_sink_,
-        Start(kDefaultNumberOfChannels, kDefaultSamplesPerSecond,
+        Start(0, kDefaultNumberOfChannels, kDefaultSamplesPerSecond,
               kDefaultAudioSampleType, kDefaultAudioFrameStorageType, _, _, _));
   }
 
@@ -406,7 +406,7 @@
     EXPECT_CALL(*audio_renderer_sink_, Stop()).Times(AnyNumber());
     EXPECT_CALL(
         *audio_renderer_sink_,
-        Start(kDefaultNumberOfChannels, kDefaultSamplesPerSecond,
+        Start(0, kDefaultNumberOfChannels, kDefaultSamplesPerSecond,
               kDefaultAudioSampleType, kDefaultAudioFrameStorageType, _, _, _));
   }
 
@@ -481,7 +481,7 @@
     EXPECT_CALL(*audio_renderer_sink_, Stop()).Times(AnyNumber());
     EXPECT_CALL(
         *audio_renderer_sink_,
-        Start(kDefaultNumberOfChannels, kDefaultSamplesPerSecond,
+        Start(0, kDefaultNumberOfChannels, kDefaultSamplesPerSecond,
               kDefaultAudioSampleType, kDefaultAudioFrameStorageType, _, _, _));
   }
 
@@ -546,7 +546,7 @@
     EXPECT_CALL(*audio_renderer_sink_, Stop()).Times(AnyNumber());
     EXPECT_CALL(
         *audio_renderer_sink_,
-        Start(kDefaultNumberOfChannels, kDefaultSamplesPerSecond,
+        Start(0, kDefaultNumberOfChannels, kDefaultSamplesPerSecond,
               kDefaultAudioSampleType, kDefaultAudioFrameStorageType, _, _, _));
   }
 
@@ -588,7 +588,7 @@
     EXPECT_CALL(*audio_renderer_sink_, Stop()).Times(AnyNumber());
     EXPECT_CALL(
         *audio_renderer_sink_,
-        Start(kDefaultNumberOfChannels, kDefaultSamplesPerSecond,
+        Start(0, kDefaultNumberOfChannels, kDefaultSamplesPerSecond,
               kDefaultAudioSampleType, kDefaultAudioFrameStorageType, _, _, _));
   }
 
@@ -636,7 +636,7 @@
     EXPECT_CALL(*audio_renderer_sink_, Stop()).Times(AnyNumber());
     EXPECT_CALL(
         *audio_renderer_sink_,
-        Start(kDefaultNumberOfChannels, kDefaultSamplesPerSecond,
+        Start(0, kDefaultNumberOfChannels, kDefaultSamplesPerSecond,
               kDefaultAudioSampleType, kDefaultAudioFrameStorageType, _, _, _));
   }
 
@@ -727,9 +727,9 @@
         .WillRepeatedly(Return(false));
     EXPECT_CALL(
         *audio_renderer_sink_,
-        Start(kDefaultNumberOfChannels, kDefaultSamplesPerSecond,
+        Start(0, kDefaultNumberOfChannels, kDefaultSamplesPerSecond,
               kDefaultAudioSampleType, kDefaultAudioFrameStorageType, _, _, _))
-        .WillOnce(SaveArg<6>(&renderer_callback_));
+        .WillOnce(SaveArg<7>(&renderer_callback_));
     EXPECT_CALL(*audio_renderer_sink_, HasStarted())
         .WillRepeatedly(Return(true));
   }
@@ -809,18 +809,20 @@
     return;
   }
 
+  const double kSeekTime = 0.5 * kSbTimeSecond;
+
   {
     ::testing::InSequence seq;
     EXPECT_CALL(*audio_renderer_sink_, Stop()).Times(AnyNumber());
     EXPECT_CALL(
         *audio_renderer_sink_,
-        Start(kDefaultNumberOfChannels, kDefaultSamplesPerSecond,
+        Start(0, kDefaultNumberOfChannels, kDefaultSamplesPerSecond,
               kDefaultAudioSampleType, kDefaultAudioFrameStorageType, _, _, _));
     EXPECT_CALL(*audio_renderer_sink_, Stop());
     EXPECT_CALL(*audio_decoder_, Reset());
     EXPECT_CALL(
         *audio_renderer_sink_,
-        Start(kDefaultNumberOfChannels, kDefaultSamplesPerSecond,
+        Start(kSeekTime, kDefaultNumberOfChannels, kDefaultSamplesPerSecond,
               kDefaultAudioSampleType, kDefaultAudioFrameStorageType, _, _, _));
   }
 
@@ -855,7 +857,6 @@
 
   // Consume frames in multiple batches, so we can test if
   // |GetCurrentMediaTime()| is incrementing in an expected manner.
-  const double seek_time = 0.5 * kSbTimeSecond;
   const int frames_to_consume = std::min(frames_written, frames_in_buffer) / 10;
   SbTime new_media_time;
 
@@ -865,13 +866,13 @@
   new_media_time = audio_renderer_->GetCurrentMediaTime(
       &is_playing, &is_eos_played, &is_underflow);
   EXPECT_GE(new_media_time, media_time);
-  Seek(seek_time);
+  Seek(kSeekTime);
 
-  frames_written += FillRendererWithDecodedAudioAndWriteEOS(seek_time);
+  frames_written += FillRendererWithDecodedAudioAndWriteEOS(kSeekTime);
 
   EXPECT_GE(audio_renderer_->GetCurrentMediaTime(&is_playing, &is_eos_played,
                                                  &is_underflow),
-            seek_time);
+            kSeekTime);
   EXPECT_TRUE(prerolled_);
 
   audio_renderer_->Play();
@@ -886,7 +887,7 @@
   renderer_callback_->ConsumeFrames(frames_in_buffer, SbTimeGetMonotonicNow());
   new_media_time = audio_renderer_->GetCurrentMediaTime(
       &is_playing, &is_eos_played, &is_underflow);
-  EXPECT_GE(new_media_time, seek_time);
+  EXPECT_GE(new_media_time, kSeekTime);
 
   EXPECT_TRUE(audio_renderer_->IsEndOfStreamPlayed());
 }
diff --git a/src/starboard/shared/starboard/player/filter/video_render_algorithm.h b/src/starboard/shared/starboard/player/filter/video_render_algorithm.h
index 5fd0c0e..94cac79 100644
--- a/src/starboard/shared/starboard/player/filter/video_render_algorithm.h
+++ b/src/starboard/shared/starboard/player/filter/video_render_algorithm.h
@@ -50,7 +50,8 @@
                       std::list<scoped_refptr<VideoFrame>>* frames,
                       VideoRendererSink::DrawFrameCB draw_frame_cb) = 0;
   // Called during seek to reset the internal states of VideoRenderAlgorithm.
-  virtual void Reset() = 0;
+  // |seek_to_time| will be set to the seek target.
+  virtual void Seek(SbTime seek_to_time) = 0;
   virtual int GetDroppedFrames() = 0;
 };
 
diff --git a/src/starboard/shared/starboard/player/filter/video_render_algorithm_impl.cc b/src/starboard/shared/starboard/player/filter/video_render_algorithm_impl.cc
index 78b6486..fb62882 100644
--- a/src/starboard/shared/starboard/player/filter/video_render_algorithm_impl.cc
+++ b/src/starboard/shared/starboard/player/filter/video_render_algorithm_impl.cc
@@ -134,7 +134,7 @@
 #endif  // SB_PLAYER_FILTER_ENABLE_STATE_CHECK
 }
 
-void VideoRenderAlgorithmImpl::Reset() {
+void VideoRenderAlgorithmImpl::Seek(SbTime seek_to_time) {
   if (get_refresh_rate_fn_) {
     last_frame_timestamp_ = -1;
     current_frame_rendered_times_ = -1;
diff --git a/src/starboard/shared/starboard/player/filter/video_render_algorithm_impl.h b/src/starboard/shared/starboard/player/filter/video_render_algorithm_impl.h
index 97e9980..ff8d474 100644
--- a/src/starboard/shared/starboard/player/filter/video_render_algorithm_impl.h
+++ b/src/starboard/shared/starboard/player/filter/video_render_algorithm_impl.h
@@ -46,7 +46,7 @@
   void Render(MediaTimeProvider* media_time_provider,
               std::list<scoped_refptr<VideoFrame>>* frames,
               VideoRendererSink::DrawFrameCB draw_frame_cb) override;
-  void Reset() override;
+  void Seek(SbTime seek_to_time) override;
   int GetDroppedFrames() override { return dropped_frames_; }
 
  private:
diff --git a/src/starboard/shared/starboard/player/filter/video_renderer_internal_impl.cc b/src/starboard/shared/starboard/player/filter/video_renderer_internal_impl.cc
index 6573840..c8a2a3a 100644
--- a/src/starboard/shared/starboard/player/filter/video_renderer_internal_impl.cc
+++ b/src/starboard/shared/starboard/player/filter/video_renderer_internal_impl.cc
@@ -182,7 +182,8 @@
   buffering_state_ = kWaitForBuffer;
 #endif  // SB_PLAYER_FILTER_ENABLE_STATE_CHECK
 
-  algorithm_->Reset();  // This is also guarded by sink_frames_mutex_.
+  // This is also guarded by |sink_frames_mutex_|.
+  algorithm_->Seek(seek_to_time);
 }
 
 bool VideoRendererImpl::CanAcceptMoreData() const {
diff --git a/src/starboard/starboard_headers_only.gyp b/src/starboard/starboard_headers_only.gyp
index db954f5..aecb2c2 100644
--- a/src/starboard/starboard_headers_only.gyp
+++ b/src/starboard/starboard_headers_only.gyp
@@ -43,7 +43,6 @@
         'event.h',
         'export.h',
         'file.h',
-        'format_string.h',
         'gles.h',
         'input.h',
         'key.h',
diff --git a/src/starboard/string.h b/src/starboard/string.h
index fa6c202..47ad30e 100644
--- a/src/starboard/string.h
+++ b/src/starboard/string.h
@@ -223,7 +223,7 @@
                                              ...) {
   va_list arguments;
   va_start(arguments, format);
-  int result = SbStringFormat(out_buffer, UINT_MAX, format, arguments);
+  int result = SbStringFormat(out_buffer, SSIZE_MAX, format, arguments);
   va_end(arguments);
   return result;
 }
diff --git a/src/starboard/stub/BUILD.gn b/src/starboard/stub/BUILD.gn
index 3e17161..78554f6 100644
--- a/src/starboard/stub/BUILD.gn
+++ b/src/starboard/stub/BUILD.gn
@@ -21,8 +21,6 @@
 
 config("compiler_defaults") {
   cflags = [
-    # We'll pretend not to be Linux, but Starboard instead.
-    "-U__linux__",
     "-Werror",
     "-fcolor-diagnostics",
     # Default visibility to hidden, to enable dead stripping.
diff --git a/src/starboard/stub/configuration_public.h b/src/starboard/stub/configuration_public.h
index d01541c..17fc98c 100644
--- a/src/starboard/stub/configuration_public.h
+++ b/src/starboard/stub/configuration_public.h
@@ -30,16 +30,6 @@
 
 // --- Architecture Configuration --------------------------------------------
 
-// Configuration parameters that allow the application to make some general
-// compile-time decisions with respect to the the number of cores likely to be
-// available on this platform. For a definitive measure, the application should
-// still call SbSystemGetNumberOfProcessors at runtime.
-
-// Whether the current platform's thread scheduler will automatically balance
-// threads between cores, as opposed to systems where threads will only ever run
-// on the specifically pinned core.
-#define SB_HAS_CROSS_CORE_SCHEDULER 1
-
 // Some platforms will not align variables on the stack with an alignment
 // greater than 16 bytes. Platforms where this is the case should define the
 // following quirk.
@@ -49,38 +39,14 @@
 // the case should define the following quirk.
 #undef SB_HAS_QUIRK_THREAD_AFFINITY_UNSUPPORTED
 
-// Some platforms the mapped GL buffer memory is slow to read from.  Platforms
-// where this is the case should define the following quirk.
-#undef SB_HAS_QUIRK_GL_MAP_BUFFER_MEMORY_IS_SLOW_TO_READ
 // --- System Header Configuration -------------------------------------------
 
 // Any system headers listed here that are not provided by the platform will be
 // emulated in starboard/types.h.
 
-// Whether the current platform provides the standard header stdarg.h.
-#define SB_HAS_STDARG_H 1
-
-// Whether the current platform provides the standard header stdbool.h.
-#define SB_HAS_STDBOOL_H 1
-
-// Whether the current platform provides the standard header stddef.h.
-#define SB_HAS_STDDEF_H 1
-
-// Whether the current platform provides the standard header stdint.h.
-#define SB_HAS_STDINT_H 1
-
-// Whether the current platform provides the standard header inttypes.h.
-#define SB_HAS_INTTYPES_H 1
-
 // Whether the current platform provides the standard header sys/types.h.
 #define SB_HAS_SYS_TYPES_H 0
 
-// Whether the current platform provides the standard header limits.h.
-#define SB_HAS_LIMITS_H 1
-
-// Whether the current platform provides the standard header float.h.
-#define SB_HAS_FLOAT_H 1
-
 // Whether the current platform provides ssize_t.
 #define SB_HAS_SSIZE_T 1
 
@@ -93,18 +59,12 @@
 #define SB_IS_WCHAR_T_UTF16 1
 #endif
 
-// Chrome only defines these two if ARMEL or MIPSEL are defined.
+// Chrome only defines this for ARMEL.
 #if defined(__ARMEL__)
 // Chrome has an exclusion for iOS here, we should too when we support iOS.
 #define SB_IS_WCHAR_T_UNSIGNED 1
-#elif defined(__MIPSEL__)
-#define SB_IS_WCHAR_T_SIGNED 1
 #endif
 
-// Some platforms have memset predefined in system headers. Platforms where this
-// is the case should define the following quirk.
-#undef SB_HAS_QUIRK_MEMSET_IN_SYSTEM_HEADERS
-
 // This quirk is used to switch the headers included in
 // starboard/shared/linux/socket_get_interface_address.cc for darwin system
 // headers. It may be removed at some point in favor of a different solution.
@@ -135,15 +95,6 @@
 // the current linking unit.
 #define SB_IMPORT_PLATFORM
 
-// On some platforms the __GNUC__ is defined even though parts of the
-// functionality are missing. Setting this to non-zero allows disabling missing
-// functionality encountered.
-#undef SB_HAS_QUIRK_COMPILER_SAYS_GNUC_BUT_ISNT
-
-// On some compilers, the frontend has a quirk such that #ifdef cannot
-// correctly detect __has_feature is defined, and an example error you get is:
-#undef SB_HAS_QUIRK_HASFEATURE_NOT_DEFINED_BUT_IT_IS
-
 // --- Extensions Configuration ----------------------------------------------
 
 // Do not use <unordered_map> and <unordered_set> for the hash table types.
@@ -178,9 +129,6 @@
 // The location to include hash_set on this platform.
 #define SB_HASH_SET_INCLUDE <ext/hash_set>
 
-// Define this to how this platform copies varargs blocks.
-#define SB_VA_COPY(dest, source) va_copy(dest, source)
-
 // --- Filesystem Configuration ----------------------------------------------
 
 // Some operating systems constantly return zero values for creation, access
diff --git a/src/starboard/stub/gyp_configuration.gypi b/src/starboard/stub/gyp_configuration.gypi
index 88ea471..a5b73d9 100644
--- a/src/starboard/stub/gyp_configuration.gypi
+++ b/src/starboard/stub/gyp_configuration.gypi
@@ -28,10 +28,6 @@
       # Do not warn about unused function params.
       '-Wno-unused-parameter',
      ],
-    'compiler_flags': [
-      # We'll pretend not to be Linux, but Starboard instead.
-      '-U__linux__',
-    ],
     'linker_flags': [
       '-static-libstdc++'
     ],
diff --git a/src/starboard/system.h b/src/starboard/system.h
index b0c19db..d07011e 100644
--- a/src/starboard/system.h
+++ b/src/starboard/system.h
@@ -109,7 +109,11 @@
   // The year the device was launched, e.g. "2016".
   kSbSystemPropertyModelYear,
 
-#if SB_API_VERSION >= 11
+#if SB_API_VERSION >= 12
+  // The corporate entity responsible for submitting the device to YouTube
+  // certification and for the device maintenance/updates.
+  kSbSystemPropertySystemIntegratorName,
+#elif SB_API_VERSION == 11
   // The corporate entity responsible for the manufacturing/assembly of the
   // device on behalf of the business entity owning the brand.  This is often
   // abbreviated as ODM.
diff --git a/src/starboard/tools/toolchain/msvc.py b/src/starboard/tools/toolchain/msvc.py
index a5be257..401ba5b 100644
--- a/src/starboard/tools/toolchain/msvc.py
+++ b/src/starboard/tools/toolchain/msvc.py
@@ -63,7 +63,6 @@
             '/Fd$pdbname'.format(path=path))
 
   def GetFlags(self, defines, include_dirs, cflags):
-    del cflags  # Not used.
     defines = defines + self._gyp_defines
     quoted_defines = QuoteArguments(defines)
     define_flags = [
@@ -74,7 +73,9 @@
     include_dir_flags = [
         '/I{0}'.format(include_dir) for include_dir in quoted_include_dirs
     ]
-    return define_flags + include_dir_flags + self._gyp_cflags
+    if self._gyp_cflags:
+      cflags = self._gyp_cflags
+    return define_flags + include_dir_flags + cflags
 
 
 class CCompiler(CompilerBase, abstract.CCompiler):
@@ -224,7 +225,8 @@
     return self._max_concurrent_processes
 
   def GetFlags(self, ldflags):
-    return ldflags + self._gyp_ldflags
+    del ldflags  # Not used.
+    return self._gyp_ldflags
 
 
 class ExecutableLinker(DynamicLinkerBase, abstract.ExecutableLinker):
diff --git a/src/starboard/types.h b/src/starboard/types.h
index 2e7a448..68c5a5e 100644
--- a/src/starboard/types.h
+++ b/src/starboard/types.h
@@ -26,6 +26,7 @@
 #include "starboard/configuration.h"
 
 // The C library used must provide these headers to be standard conforming.
+
 #include <float.h>
 #include <inttypes.h>
 #include <limits.h>
@@ -47,18 +48,20 @@
 #if !SB_HAS(SSIZE_T)
 #if SB_IS(32_BIT)
 typedef int32_t ssize_t;
+#define SSIZE_MAX INT_MAX
 #elif SB_IS(64_BIT)
 typedef int64_t ssize_t;
+#define SSIZE_MAX LONG_MAX
 #endif
 #endif  // !SB_HAS(SSIZE_T)
 
-// Simulate needed portions of limits.h for platforms that don't provide it.
-
 #if defined(_MSC_VER)
 #pragma warning(push)
 #pragma warning(disable : 4310)  // Cast truncates constant value.
 #endif
 
+// Simulate needed portions of limits.h for platforms that don't provide it.
+
 static const int8_t kSbInt8Min = ((int8_t)0x80);
 static const int8_t kSbInt8Max = ((int8_t)0x7F);
 static const uint8_t kSbUInt8Max = ((uint8_t)0xFF);
diff --git a/src/third_party/ci20/LICENSE b/src/third_party/ci20/LICENSE
deleted file mode 100644
index 1941a11..0000000
--- a/src/third_party/ci20/LICENSE
+++ /dev/null
@@ -1,28 +0,0 @@
-Copyright 2008, Google Inc.
-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.
diff --git a/src/third_party/ci20/mipsel-toolchain-sysroot-creator.sh b/src/third_party/ci20/mipsel-toolchain-sysroot-creator.sh
deleted file mode 100755
index 900bb34..0000000
--- a/src/third_party/ci20/mipsel-toolchain-sysroot-creator.sh
+++ /dev/null
@@ -1,634 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2012 The Native Client Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This script is intended to build a mipsel-linux-gnu cross compilation
-# toolchain that runs on x86 linux and generates code for a little-endian,
-# hard-float, mips32 target.
-
-######################################################################
-# Config
-######################################################################
-
-set -o nounset
-set -o errexit
-
-readonly SCRIPT_DIR=$(dirname $0)
-
-readonly MAKE_OPTS="-j8"
-readonly ARCH="mips32"
-
-readonly GMP_URL="http://ftp.gnu.org/gnu/gmp/gmp-6.1.1.tar.bz2"
-readonly GMP_SHA1SUM="757d672e66d8e0afe60ca04735ab11c00d9346e4"
-
-readonly MPFR_URL="http://ftp.gnu.org/gnu/mpfr/mpfr-3.1.4.tar.bz2"
-readonly MPFR_SHA1SUM="e3b0af77f18505184410d621fe0aae179e229dba"
-
-readonly MPC_URL="http://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz"
-readonly MPC_SHA1SUM="b8be66396c726fdc36ebb0f692ed8a8cca3bcc66"
-
-readonly GCC_URL="http://ftp.gnu.org/gnu/gcc/gcc-4.9.0/gcc-4.9.0.tar.bz2"
-readonly GCC_SHA1SUM="fbde8eb49f2b9e6961a870887cf7337d31cd4917"
-
-readonly BINUTILS_URL="http://ftp.gnu.org/gnu/binutils/binutils-2.26.tar.bz2"
-readonly BINUTILS_SHA1SUM="a637508cffeb2323b14bc8dd65378819768ad4ff"
-
-readonly KERNEL_URL="http://www.linux-mips.org/pub/linux/mips/kernel/v3.x/linux-3.18.3.tar.gz"
-readonly KERNEL_SHA1SUM="66c390838cc3401135be534135fe72813e92378b"
-
-readonly GLIBC_URL="http://ftp.gnu.org/gnu/glibc/glibc-2.19.tar.bz2"
-readonly GLIBC_SHA1SUM="382f4438a7321dc29ea1a3da8e7852d2c2b3208c"
-
-readonly INSTALL_ROOT=$(pwd)/toolchain/linux_x86/mips_trusted
-
-readonly TMP=$(pwd)/toolchain/tmp/crosstool-trusted
-
-readonly BUILD_DIR=${TMP}/build
-
-readonly JAIL_MIPS32=${INSTALL_ROOT}/sysroot
-
-readonly MTI_PREBUILT_URL="https://codescape.mips.com/components/toolchain/2017.10-07/Codescape.GNU.Tools.Package.2017.10-07.for.MIPS.MTI.Linux.CentOS-5.x86_64.tar.gz"
-readonly MTI_PREBUILT_SHA1SUM="c3e21b47b9d7e9c1f617c1a5e1a8255fdb97efb6"
-
-######################################################################
-# Helper
-######################################################################
-
-Banner() {
-  echo "######################################################################"
-  echo $*
-  echo "######################################################################"
-}
-
-SubBanner() {
-  echo "......................................................................"
-  echo $*
-  echo "......................................................................"
-}
-
-Usage() {
-  echo
-  echo "$0 <clang|gcc_4-9|gcc_mti_6-3>"
-  echo
-  echo "clang - Creates sysroot based on Debian Jessie with addition of GCC 4.9 libs"
-  echo "gcc_4-9 - Builds GCC 4.9 toolchain and creates sysroot based on Debian Jessie"
-  echo "gcc_mti_6-3 - Downloads prebuilt MTI GCC 6.3 toolchain and creates sysroot based on Debian Stretch"
-  echo
-}
-
-DownloadOrCopy() {
-  local url=$1
-  local filename="${TMP}/${url##*/}"
-  local filetype="${url%%:*}"
-
-  if [ "${filename}" == "" ]; then
-    echo "Unknown error occured. Aborting."
-    exit 1
-  fi
-
-  if [[ "${filetype}" ==  "http" || ${filetype} ==  "https" ]] ; then
-    if [ ! -f "${filename}" ]; then
-      SubBanner "downloading from ${url} -> ${filename}"
-      wget ${url} -O ${filename}
-    fi
-  else
-    SubBanner "copying from ${url}"
-    cp ${url} ${filename}
-  fi
-}
-
-DownloadOrCopyAndVerify() {
-  local url=$1
-  local checksum=$2
-  local filename="${TMP}/${url##*/}"
-  local filetype="${url%%:*}"
-
-  if [ "${filename}" == "" ]; then
-    echo "Unknown error occured. Aborting."
-    exit 1
-  fi
-
-  if [[ "${filetype}" ==  "http" || ${filetype} ==  "https" ]] ; then
-    if [ ! -f "${filename}" ]; then
-      SubBanner "downloading from ${url} -> ${filename}"
-      wget ${url} -O ${filename}
-    fi
-    if [ "${checksum}" != "nochecksum" ]; then
-      if [ "$(sha1sum ${filename} | cut -d ' ' -f 1)" != "${checksum}" ]; then
-        echo "${filename} sha1sum failed. Deleting file and aborting."
-        rm -f ${filename}
-        exit 1
-      fi
-    fi
-  else
-    SubBanner "copying from ${url}"
-    cp ${url} ${filename}
-  fi
-}
-
-######################################################################
-#
-######################################################################
-
-# Some sanity checks to make sure this script is run from the right place
-# with the right tools.
-SanityCheck() {
-  Banner "Sanity Checks"
-
-  if ! mkdir -p "${INSTALL_ROOT}" ; then
-     echo "ERROR: ${INSTALL_ROOT} can't be created."
-    exit -1
-  fi
-
-  for tool in wget ; do
-    if ! which ${tool} ; then
-      echo "Required binary $tool not found."
-      echo "Exiting."
-      exit 1
-    fi
-  done
-}
-
-ClearInstallDir() {
-  Banner "Clearing dirs in ${INSTALL_ROOT}"
-  rm -rf ${INSTALL_ROOT}/*
-  mkdir -p ${JAIL_MIPS32}
-}
-
-ClearBuildDir() {
-  Banner "Clearing dirs in ${BUILD_DIR}"
-  rm -rf ${BUILD_DIR}/*
-}
-
-CreateTarBall() {
-  local tarball=$1
-  Banner "Creating tar ball ${tarball}"
-  tar cfz ${tarball}.tgz -C ${INSTALL_ROOT} .
-}
-
-CreateMTITarBall() {
-  local tarball=$1
-  Banner "Creating tar ball ${tarball}"
-  cp -r ${INSTALL_ROOT}"/sysroot/." $(pwd)"/toolchain/codescape/sysroot/mipsel-r2-hard/"
-  tar cfz ${tarball}.tgz -C $(pwd)"/toolchain/codescape/" .
-}
-
-# Download the toolchain source tarballs or use a local copy when available.
-DownloadOrCopyAndInstallToolchain() {
-  Banner "Installing toolchain"
-
-  tarball="${TMP}/${GCC_URL##*/}"
-  DownloadOrCopyAndVerify ${GCC_URL} ${GCC_SHA1SUM}
-  SubBanner "extracting from ${tarball}"
-  tar jxf ${tarball} -C ${TMP}
-
-  pushd ${TMP}/gcc-*
-
-  local tarball="${TMP}/${GMP_URL##*/}"
-  DownloadOrCopyAndVerify ${GMP_URL} ${GMP_SHA1SUM}
-  SubBanner "extracting from ${tarball}"
-  tar jxf ${tarball}
-  local filename=`ls | grep gmp\-`
-  rm -f gmp
-  ln -s ${filename} gmp
-  # Fix gmp configure problem with flex.
-  sed -i "s/m4-not-needed/m4/" gmp/configure
-
-  local tarball="${TMP}/${MPFR_URL##*/}"
-  DownloadOrCopyAndVerify ${MPFR_URL} ${MPFR_SHA1SUM}
-  SubBanner "extracting from ${tarball}"
-  tar jxf ${tarball}
-  local filename=`ls | grep mpfr\-`
-  rm -f mpfr
-  ln -s ${filename} mpfr
-
-  local tarball="${TMP}/${MPC_URL##*/}"
-  DownloadOrCopyAndVerify ${MPC_URL} ${MPC_SHA1SUM}
-  SubBanner "extracting from ${tarball}"
-  tar zxf ${tarball}
-  local filename=`ls | grep mpc\-`
-  rm -f mpc
-  ln -s ${filename} mpc
-
-  popd
-
-  local tarball="${TMP}/${BINUTILS_URL##*/}"
-  DownloadOrCopyAndVerify ${BINUTILS_URL} ${BINUTILS_SHA1SUM}
-  SubBanner "extracting from ${tarball}"
-  tar jxf ${tarball} -C ${TMP}
-
-  tarball="${TMP}/${KERNEL_URL##*/}"
-  DownloadOrCopyAndVerify ${KERNEL_URL} ${KERNEL_SHA1SUM}
-  SubBanner "extracting from ${tarball}"
-  tar zxf ${tarball} -C ${TMP}
-
-  tarball="${TMP}/${GLIBC_URL##*/}"
-  DownloadOrCopyAndVerify ${GLIBC_URL} ${GLIBC_SHA1SUM}
-  SubBanner "extracting from ${tarball}"
-  tar jxf ${tarball} -C ${TMP}
-
-  Banner "Preparing the code"
-
-  # Fix a minor syntax issue in tc-mips.c.
-  local OLD_TEXT="as_warn_where (fragp->fr_file, fragp->fr_line, msg);"
-  local NEW_TEXT="as_warn_where (fragp->fr_file, fragp->fr_line, \"%s\", msg);"
-  local FILE_NAME="${TMP}/binutils-2.26/gas/config/tc-mips.c"
-  sed -i "s/${OLD_TEXT}/${NEW_TEXT}/g" "${FILE_NAME}"
-
-  export PATH=${INSTALL_ROOT}/bin:$PATH
-
-  Banner "Building binutils"
-
-  rm -rf ${BUILD_DIR}/binutils/
-  mkdir -p ${BUILD_DIR}/binutils/
-  pushd ${BUILD_DIR}/binutils/
-
-  SubBanner "Configuring"
-  ${TMP}/binutils-2.26/configure \
-    --prefix=${INSTALL_ROOT}     \
-    --target=mipsel-linux-gnu    \
-    --with-sysroot=${JAIL_MIPS32}
-
-  SubBanner "Make"
-  make ${MAKE_OPTS} all-binutils all-gas all-ld
-
-  SubBanner "Install"
-  make ${MAKE_OPTS} install-binutils install-gas install-ld
-
-  popd
-
-  Banner "Building GCC (initial)"
-
-  rm -rf ${BUILD_DIR}/gcc/initial
-  mkdir -p ${BUILD_DIR}/gcc/initial
-  pushd ${BUILD_DIR}/gcc/initial
-
-  SubBanner "Configuring"
-  ${TMP}/gcc-4.9.0/configure \
-    --prefix=${INSTALL_ROOT} \
-    --disable-libssp         \
-    --disable-libgomp        \
-    --disable-libmudflap     \
-    --disable-fixed-point    \
-    --disable-decimal-float  \
-    --with-mips-plt          \
-    --with-endian=little     \
-    --with-arch=${ARCH}      \
-    --enable-languages=c     \
-    --with-newlib            \
-    --without-headers        \
-    --disable-shared         \
-    --disable-threads        \
-    --disable-libquadmath    \
-    --disable-libatomic      \
-    --target=mipsel-linux-gnu
-
-  SubBanner "Make"
-  make ${MAKE_OPTS} all
-
-  SubBanner "Install"
-  make ${MAKE_OPTS} install
-
-  popd
-
-  Banner "Installing Linux kernel headers"
-  pushd ${TMP}/linux-3.18.3
-  make headers_install ARCH=mips INSTALL_HDR_PATH=${JAIL_MIPS32}/usr
-  popd
-
-  Banner "Building GLIBC"
-
-  rm -rf ${BUILD_DIR}/glibc/final
-  mkdir -p ${BUILD_DIR}/glibc/final
-  pushd ${BUILD_DIR}/glibc/final
-
-  BUILD_CC=gcc                      \
-  AR=mipsel-linux-gnu-ar            \
-  RANLIB=mipsel-linux-gnu-ranlibi   \
-  CC=mipsel-linux-gnu-gcc           \
-  CXX=mipsel-linux-gnu-g++          \
-  ${TMP}/glibc-2.19/configure       \
-    --prefix=/usr                   \
-    --enable-add-ons                \
-    --host=mipsel-linux-gnu         \
-    --disable-profile               \
-    --without-gd                    \
-    --without-cvs                   \
-    --build=i686-pc-linux-gnu       \
-    --with-headers=${JAIL_MIPS32}/usr/include
-
-  SubBanner "Make"
-  make ${MAKE_OPTS} all
-
-  SubBanner "Install"
-  make ${MAKE_OPTS} install install_root=${JAIL_MIPS32}
-
-  popd
-
-  Banner "Building GCC (final)"
-
-  rm -rf ${BUILD_DIR}/gcc/final
-  mkdir -p ${BUILD_DIR}/gcc/final
-  pushd ${BUILD_DIR}/gcc/final
-
-  ${TMP}/gcc-4.9.0/configure  \
-    --prefix=${INSTALL_ROOT}  \
-    --disable-libssp          \
-    --disable-libgomp         \
-    --disable-libmudflap      \
-    --disable-fixed-point     \
-    --disable-decimal-float   \
-    --with-mips-plt           \
-    --with-endian=little      \
-    --with-arch=${ARCH}       \
-    --target=mipsel-linux-gnu \
-    --enable-__cxa_atexit     \
-    --enable-languages=c,c++  \
-    --with-sysroot=${JAIL_MIPS32}
-
-  SubBanner "Make"
-  make ${MAKE_OPTS} all
-
-  SubBanner "Install"
-  make ${MAKE_OPTS} install
-
-  popd
-}
-
-DownloadMTI() {
-  Banner "Downloading MTI toolchain"
-  mkdir -p ${TMP}"/codescape"
-  tarball="${TMP}/${MTI_PREBUILT_URL##*/}"
-  DownloadOrCopyAndVerify ${MTI_PREBUILT_URL} ${MTI_PREBUILT_SHA1SUM}
-
-  SubBanner "Extracting from ${tarball}"
-  tar xvf ${tarball} -C ${TMP}"/codescape"
-
-  mkdir -p $(pwd)"/toolchain/codescape/mti"
-  mkdir -p $(pwd)"/toolchain/codescape/sysroot/mipsel-r2-hard"
-
-  SubBanner "Removing uneeded libs"
-
-  mti=${TMP}"/codescape/mips-mti-linux-gnu/2017.10-07"
-
-  rm -rf ${mti}"/sysroot"
-  rm -rf ${mti}"/lib/gcc/mips-mti-linux-gnu/6.3.0/micromipsel-r2-hard-nan2008"
-  rm -rf ${mti}"/lib/gcc/mips-mti-linux-gnu/6.3.0/micromipsel-r2-soft"
-  rm -rf ${mti}"/lib/gcc/mips-mti-linux-gnu/6.3.0/mipsel-r1-hard"
-  rm -rf ${mti}"/lib/gcc/mips-mti-linux-gnu/6.3.0/mipsel-r2-hard-nan2008"
-  rm -rf ${mti}"/lib/gcc/mips-mti-linux-gnu/6.3.0/mipsel-r2-hard-nan2008-uclibc"
-  rm -rf ${mti}"/lib/gcc/mips-mti-linux-gnu/6.3.0/mipsel-r2-hard-uclibc"
-  rm -rf ${mti}"/lib/gcc/mips-mti-linux-gnu/6.3.0/mipsel-r2-soft"
-  rm -rf ${mti}"/lib/gcc/mips-mti-linux-gnu/6.3.0/mips-r2-hard"
-  rm -rf ${mti}"/lib/gcc/mips-mti-linux-gnu/6.3.0/mips-r2-hard-nan2008"
-  rm -rf ${mti}"/lib/gcc/mips-mti-linux-gnu/6.3.0/mips-r2-hard-nan2008-uclibc"
-  rm -rf ${mti}"/lib/gcc/mips-mti-linux-gnu/6.3.0/mips-r2-hard-uclibc"
-  rm -rf ${mti}"/lib/gcc/mips-mti-linux-gnu/6.3.0/mips-r2-soft"
-  rm -rf ${mti}"/lib64"
-  rm -rf ${mti}"/mips-mti-linux-gnu/lib/micromipsel-r2-hard-nan2008"
-  rm -rf ${mti}"/mips-mti-linux-gnu/lib/micromipsel-r2-soft"
-  rm -rf ${mti}"/mips-mti-linux-gnu/lib/mipsel-r1-hard"
-  rm -rf ${mti}"/mips-mti-linux-gnu/lib/mipsel-r2-hard-nan2008"
-  rm -rf ${mti}"/mips-mti-linux-gnu/lib/mipsel-r2-hard-nan2008-uclibc"
-  rm -rf ${mti}"/mips-mti-linux-gnu/lib/mipsel-r2-hard-uclibc"
-  rm -rf ${mti}"/mips-mti-linux-gnu/lib/mipsel-r2-soft"
-  rm -rf ${mti}"/mips-mti-linux-gnu/lib/mips-r2-hard"
-  rm -rf ${mti}"/mips-mti-linux-gnu/lib/mips-r2-hard-nan2008"
-  rm -rf ${mti}"/mips-mti-linux-gnu/lib/mips-r2-hard-nan2008-uclibc"
-  rm -rf ${mti}"/mips-mti-linux-gnu/lib/mips-r2-hard-uclibc"
-  rm -rf ${mti}"/mips-mti-linux-gnu/lib/mips-r2-soft"
-
-  SubBanner "Copying toolchain"
-  cp -r ${TMP}"/codescape/mips-mti-linux-gnu/2017.10-07/." $(pwd)"/toolchain/codescape/mti/"
-}
-
-# ----------------------------------------------------------------------
-# mips32 deb files to complete our code sourcery jail
-# ----------------------------------------------------------------------
-GeneratePackageLists() {
-  local packages=
-  local TMP_PACKAGELIST=
-  Banner "Generating Cobalt package lists for mips32"
-  rm -f ${TMP}/Packages.bz2
-  DownloadOrCopy ${MIPS32_PACKAGES}
-  xzcat ${TMP}/Packages.xz\
-    | egrep '^(Package:|Filename:)' > ${TMP}/Packages_mipsel
-
-  echo -n > ${TMP_EXTRA_PKG_MIPS32}
-  TMP_PACKAGELIST=${TMP_EXTRA_PKG_MIPS32}
-  packages=$(cat ${EXTRA_PACKAGELIST_MIPS32})
-
-  for pkg in ${packages} ; do
-    echo ${pkg}
-    grep  -A 1 "${pkg}\$" ${TMP}/Packages_mipsel\
-      | egrep -o "pool/.*" >> ${TMP_PACKAGELIST}
-  done
-}
-
-InstallMissingLibraries() {
-  local DEP_FILES_NEEDED_MIPS32=
-
-  DEP_FILES_NEEDED_MIPS32=$(cat ${TMP_EXTRA_PKG_MIPS32})
-
-  for file in ${DEP_FILES_NEEDED_MIPS32} ; do
-    local package="${TMP}/${file##*/}"
-    Banner "installing ${file}"
-    DownloadOrCopy ${REPO_DEBIAN}/${file}
-    SubBanner "extracting to ${JAIL_MIPS32}"
-    dpkg --fsys-tarfile ${package}\
-      | tar -xvf - -C ${JAIL_MIPS32}
-  done
-}
-
-# Workaround for missing headers since pkg-config is not working correctly.
-FixIncludes() {
-  Banner "Fixing includes"
-  pushd ${JAIL_MIPS32}/usr/include/glib-2.0
-    ln -s ../../lib/glib-2.0/include/glibconfig.h .
-  popd
-
-  pushd ${JAIL_MIPS32}/usr/include/gtk-2.0
-    ln -s ../../lib/gtk-2.0/include/gdkconfig.h .
-  popd
-
-  pushd ${JAIL_MIPS32}/usr/include/dbus-1.0/dbus
-    ln -s ../../../lib/dbus-1.0/include/dbus/dbus-arch-deps.h .
-  popd
-
-  pushd ${JAIL_MIPS32}/usr/include
-    cp ./mipsel-linux-gnu/sys/* ./sys/
-    mkdir -p bits
-    cp ./mipsel-linux-gnu/bits/* ./bits/
-    mkdir -p gnu
-    cp ./mipsel-linux-gnu/gnu/* ./gnu/
-    mkdir -p asm
-    cp ./mipsel-linux-gnu/asm/* ./asm/
-    cp ./mipsel-linux-gnu/openssl/* ./openssl/
-  popd
-}
-
-FixLinks() {
-  Banner "Fixing links"
-  pushd ${JAIL_MIPS32}/lib/
-    mv mipsel-linux-gnu/* .
-    rm -rf mipsel-linux-gnu
-    ln -s . mipsel-linux-gnu
-  popd
-
-  pushd ${JAIL_MIPS32}/usr/lib/
-    mkdir -p pkgconfig
-    mv mipsel-linux-gnu/pkgconfig/* pkgconfig/
-    rm -rf mipsel-linux-gnu/pkgconfig
-    cp -r mipsel-linux-gnu/* .
-    rm -rf mipsel-linux-gnu
-    ln -s . mipsel-linux-gnu
-  popd
-
-  mkdir -p ${JAIL_MIPS32}/usr/share
-
-  pushd ${JAIL_MIPS32}/usr/share/
-    mkdir -p pkgconfig
-  popd
-
-  pushd ${JAIL_MIPS32}/usr/lib/
-    rm -f libgcc_s.so*
-    ln -s ../../../mipsel-linux-gnu/lib/libgcc_s.so.1 .
-    ln -s libgcc_s.so.1 libgcc_s.so
-  popd
-}
-
-FixLibs() {
-  Banner "Fixing libraries"
-
-  readonly liblist="libanl.co       \
-                    libBrokenLocale.so \
-                    libbz2.so       \
-                    libcap.so       \
-                    libcidn.so      \
-                    libcom_err.so   \
-                    libcrypt.so     \
-                    libdbus-1.so    \
-                    libdl.so        \
-                    libexpat.so     \
-                    libglib-2.0.so  \
-                    libgpg-error.so \
-                    libkeyutils.so  \
-                    libnsl.so       \
-                    libnss_compat.so\
-                    libnss_dns.so   \
-                    libnss_files.so \
-                    libnss_hesiod.so\
-                    libnss_nisplus.so\
-                    libnss_nis.so   \
-                    libpamc.so      \
-                    libpam_misc.so  \
-                    libpam.so       \
-                    libpci.so       \
-                    libpcre.so      \
-                    libpng12.so     \
-                    libresolv.so    \
-                    librt.so        \
-                    libthread_db.so \
-                    libutil.so      \
-                    libudev.so      \
-                    libz.so"
-  readonly liblist2="libpng12.so.0"
-
-  pushd ${JAIL_MIPS32}/usr/lib/
-    for library in ${liblist}; do
-      rm -f ${library}
-      ln -s ../../lib/${library}.[0123] ${library}
-    done
-    for library2 in ${liblist2}; do
-      rm -f ${library2}
-      ln -s ../../lib/${library2} ${library2}
-    done
-    rm -f libpython2.7.a
-    ln -s ./python2.7/config-mipsel-linux-gnu/libpython2.7.a libpython2.7.a
-    rm -f libm.so
-    ln -s ../../lib/libm.so.6 libm.so
-  popd
-}
-
-GCCCleanup() {
-  Banner "Removing uneeded GCC tools for clang build"
-
-  rm -rf ${INSTALL_ROOT}"/bin"
-  rm -rf ${INSTALL_ROOT}"/include"
-  rm -rf ${INSTALL_ROOT}"/libexec"
-  rm -rf ${INSTALL_ROOT}"/share"
-}
-
-CleanUp() {
-  Banner "Removing temporary files"
-  rm -rf $(pwd)/toolchain/*
-}
-
-######################################################################
-# Main
-######################################################################
-
-if [[ $# -eq 0 ]] ; then
-  echo "You must specify a mode on the commandline:"
-  echo
-  Usage
-  exit -1
-
-elif [[ $1 == "clang" || $1 == "gcc_4-9" ]] ; then
-
-  readonly REPO_DEBIAN=http://ftp.debian.org/debian
-  readonly MIPS32_PACKAGES=${REPO_DEBIAN}/dists/jessie/main/binary-mipsel/Packages.xz
-
-  readonly BASE_PACKAGELIST_MIPS32=${SCRIPT_DIR}/packagelist.jessie.mipsel.base
-  readonly EXTRA_PACKAGELIST_MIPS32=${SCRIPT_DIR}/packagelist.jessie.mipsel.extra
-  readonly TMP_BASE_PKG_MIPS32=${TMP}/packagelist.generated.jessie.mipsel.base
-  readonly TMP_EXTRA_PKG_MIPS32=${TMP}/packagelist.generated.jessie.mipsel.extra
-
-  mkdir -p ${TMP}
-  SanityCheck
-  ClearInstallDir
-  ClearBuildDir
-  DownloadOrCopyAndInstallToolchain
-  GeneratePackageLists
-  InstallMissingLibraries
-  FixLinks
-  FixLibs
-  FixIncludes
-
-  if [[ $1 == "clang" ]] ; then
-    GCCCleanup
-    CreateTarBall "mipsel_clang_jessie_sysroot"
-  elif [[ $1 == "gcc_4-9" ]] ; then
-    CreateTarBall "mipsel_gcc_4-9_jessie_sysroot"
-  fi
-
-  CleanUp
-
-elif [[ $1 == "gcc_mti_6-3" ]] ; then
-
-  readonly REPO_DEBIAN=http://ftp.debian.org/debian
-  readonly MIPS32_PACKAGES=${REPO_DEBIAN}/dists/stretch/main/binary-mipsel/Packages.xz
-
-  readonly BASE_PACKAGELIST_MIPS32=${SCRIPT_DIR}/packagelist.stretch.mipsel.base
-  readonly EXTRA_PACKAGELIST_MIPS32=${SCRIPT_DIR}/packagelist.stretch.mipsel.extra
-  readonly TMP_BASE_PKG_MIPS32=${TMP}/packagelist.generated.stretch.mipsel.base
-  readonly TMP_EXTRA_PKG_MIPS32=${TMP}/packagelist.generated.stretch.mipsel.extra
-
-  mkdir -p ${TMP}
-  SanityCheck
-  ClearInstallDir
-  DownloadMTI
-  GeneratePackageLists
-  InstallMissingLibraries
-  FixLinks
-  FixLibs
-  FixIncludes
-  CreateMTITarBall "mipsel_gcc_mti_6-3_stretch_sysroot"
-  CleanUp
-
-else
-  Usage
-  exit -1
-
-fi
diff --git a/src/third_party/ci20/packagelist.jessie.mipsel.base b/src/third_party/ci20/packagelist.jessie.mipsel.base
deleted file mode 100644
index 8a3d300..0000000
--- a/src/third_party/ci20/packagelist.jessie.mipsel.base
+++ /dev/null
@@ -1,4 +0,0 @@
-libssl1.0.0
-libssl-dev
-zlib1g
-zlib1g-dev
diff --git a/src/third_party/ci20/packagelist.jessie.mipsel.extra b/src/third_party/ci20/packagelist.jessie.mipsel.extra
deleted file mode 100644
index eb806a9..0000000
--- a/src/third_party/ci20/packagelist.jessie.mipsel.extra
+++ /dev/null
@@ -1,275 +0,0 @@
-comerr-dev
-krb5-multidev
-libaa1
-libaa1-dev
-libasound2
-libasound2-dev
-libasyncns0
-libatk1.0-0
-libatk1.0-dev
-libattr1
-libx264-142
-libx264-dev
-libxau6
-libxau-dev
-libxml2
-libxml2-dev
-libxvidcore4
-libavahi-client3
-libavahi-client-dev
-libavahi-common3
-libavahi-common-dev
-libavcodec56
-libavcodec-dev
-libavformat56
-libavformat-dev
-libavutil54
-libavutil-dev
-libavresample2
-libavresample-dev
-libbz2-1.0
-libbz2-dev
-libc6
-libc6-dev
-libcairo2
-libcairo2-dev
-libcairo-gobject2
-libcairo-script-interpreter2
-libcap2
-libcap-dev
-libcups2
-libcups2-dev
-libdbus-1-3
-libdbus-1-dev
-libdbus-glib-1-2
-libdbus-glib-1-dev
-libdirectfb-1.2-9
-libdirectfb-dev
-libdrm2
-libdrm-nouveau2
-libdrm-radeon1
-libdrm-dev
-libcomerr2
-libegl1-mesa
-libegl1-mesa-dev
-libexif12
-libexif-dev
-libexpat1
-libexpat1-dev
-libffi6
-libffi-dev
-libflac8
-libfontconfig1
-libfontconfig1-dev
-libfreetype6
-libfreetype6-dev
-libgbm1
-libgbm-dev
-libgcc-4.8-dev
-libgconf-2-4
-libgconf2-dev
-libgcrypt11-dev
-libgcrypt20
-libgcr-3-dev
-libgcr-base-3-1
-libgcr-ui-3-1
-libgdk-pixbuf2.0-0
-libgdk-pixbuf2.0-dev
-libgdk-pixbuf2.0-common
-libgl1-mesa-glx
-libgl1-mesa-dev
-libglapi-mesa
-libgles2-mesa
-libgles2-mesa-dev
-libgmp10
-libgnutls-deb0-28
-libgnutls-openssl27
-libgnutls28-dev
-libgnutlsxx28
-libgpg-error0
-libgpg-error-dev
-libgssapi-krb5-2
-libgtk2.0-0
-libgtk2.0-dev
-libglib2.0-0
-libglib2.0-dev
-libgnome-keyring0
-libgnome-keyring-dev
-libgsm1
-libgssrpc4
-libhogweed2
-libice6
-libicu-dev
-libicu52
-libjpeg62-turbo
-libjpeg62-turbo-dev
-libjson-c2
-libkadm5clnt-mit9
-libkadm5srv-mit9
-libkdb5-7
-libk5crypto3
-libkeyutils1
-libkeyutils-dev
-libkrb5-3
-libkrb5-dev
-libkrb5support0
-liblzma5
-libmp3lame0
-libnettle4
-libnspr4
-libnspr4-0d
-libnspr4-dev
-libnss3
-libnss3-1d
-libnss3-dev
-libogg0
-libopenjpeg5
-libopus0
-liborbit2
-liborbit-2-0
-liborbit2-dev
-liborc-0.4-0
-libp11-kit0
-libp11-kit-dev
-libpam0g
-libpam0g-dev
-libpango-1.0-0
-libpango1.0-0
-libpango1.0-dev
-libpangocairo-1.0-0
-libpangoft2-1.0-0
-libpangoxft-1.0-0
-libpci3
-libpci-dev
-libpcre3
-libpcre3-dev
-libpcrecpp0
-libpixman-1-0
-libpixman-1-dev
-libpng12-0
-libpng12-dev
-libpulse0
-libpulse-dev
-libpulse-mainloop-glib0
-libpthread-stubs0-dev
-libpython2.7
-librtmp1
-libschroedinger-1.0-0
-libselinux1
-libsm6
-libsnappy1
-libsnappy-dev
-libsndfile1
-libspeex1
-libsoup-gnome2.4-1
-libsoup-gnome2.4-dev
-libspeechd2
-libspeechd-dev
-libsrtp0
-libsrtp0-dev
-libssl1.0.0
-libssl-dev
-libstdc++6
-libstdc++-4.8-dev
-libsystemd0
-libsqlite3-0
-libsqlite3-dev
-libtasn1-6
-libtasn1-6-dev
-libtheora0
-libudev1
-libudev-dev
-libuuid1
-libva1
-libvorbis0a
-libvorbisenc2
-libvpx1
-libwayland-client0
-libwayland-egl1-mesa
-libwayland-server0
-libwebkitgtk-1.0-0
-libwrap0
-libx11-6
-libx11-dev
-libx11-xcb1
-libx11-xcb-dev
-libxext6
-libxext-dev
-libxau6
-libxau-dev
-libxcb-dri2-0
-libxcb-dri2-0-dev
-libxcb-glx0
-libxcb-glx0-dev
-libxcb-image0
-libxcb-image0-dev
-libxcb1
-libxcb1-dev
-libxcb-icccm4
-libxcb-icccm4-dev
-libxcb-randr0
-libxcb-randr0-dev
-libxcb-render0
-libxcb-render0-dev
-libxcb-render-util0
-libxcb-render-util0-dev
-libxcb-keysyms1
-libxcb-keysyms1-dev
-libxcb-sync1
-libxcb-sync-dev
-libxcb-shape0
-libxcb-shape0-dev
-libxcb-shm0
-libxcb-shm0-dev
-libxcb-util0
-libxcb-util0-dev
-libxcb-xinerama0
-libxcb-xinerama0-dev
-libxcb-xfixes0
-libxcb-xfixes0-dev
-libxcb-xkb1
-libxcb-xkb-dev
-libxcomposite1
-libxcomposite-dev
-libxcursor1
-libxcursor-dev
-libxdamage1
-libxdamage-dev
-libxdmcp6
-libxdmcp-dev
-libxfixes3
-libxfixes-dev
-libxi6
-libxi-dev
-libxinerama1
-libxinerama-dev
-libxkbcommon0
-libxkbcommon-dev
-libxrandr2
-libxrandr-dev
-libxrender1
-libxrender-dev
-libxss1
-libxss-dev
-libxt6
-libxt-dev
-libxtst6
-libxtst-dev
-linux-libc-dev
-mesa-common-dev
-python2.7
-python2.7-dev
-x11proto-core-dev
-x11proto-composite-dev
-x11proto-damage-dev
-x11proto-fixes-dev
-x11proto-input-dev
-x11proto-kb-dev
-x11proto-randr-dev
-x11proto-record-dev
-x11proto-render-dev
-x11proto-scrnsaver-dev
-x11proto-xext-dev
-x11proto-xinerama-dev
-zlib1g
-zlib1g-dev
diff --git a/src/third_party/ci20/packagelist.stretch.mipsel.base b/src/third_party/ci20/packagelist.stretch.mipsel.base
deleted file mode 100644
index 8a3d300..0000000
--- a/src/third_party/ci20/packagelist.stretch.mipsel.base
+++ /dev/null
@@ -1,4 +0,0 @@
-libssl1.0.0
-libssl-dev
-zlib1g
-zlib1g-dev
diff --git a/src/third_party/ci20/packagelist.stretch.mipsel.extra b/src/third_party/ci20/packagelist.stretch.mipsel.extra
deleted file mode 100644
index ade59da..0000000
--- a/src/third_party/ci20/packagelist.stretch.mipsel.extra
+++ /dev/null
@@ -1,298 +0,0 @@
-comerr-dev
-krb5-multidev
-libaa1
-libaa1-dev
-libasound2
-libasound2-dev
-libasyncns0
-libatk1.0-0
-libatk1.0-dev
-libattr1
-libx264-148
-libx265-95
-libx264-dev
-libxau6
-libxau-dev
-libxml2
-libxml2-dev
-libxvidcore4
-libavahi-client3
-libavahi-client-dev
-libavahi-common3
-libavahi-common-dev
-libavcodec57
-libavcodec-dev
-libavformat57
-libavformat-dev
-libavutil55
-libavutil-dev
-libavresample3
-libavresample-dev
-libbz2-1.0
-libbz2-dev
-libbluray1
-libbsd0
-libc6
-libc6-dev
-libcairo2
-libcairo2-dev
-libcairo-gobject2
-libcairo-script-interpreter2
-libcap2
-libcap-dev
-libchromaprint1
-libcups2
-libcups2-dev
-libdbus-1-3
-libdbus-1-dev
-libdbus-glib-1-2
-libdbus-glib-1-dev
-libdirectfb-1.2-9
-libdirectfb-dev
-libdrm2
-libdrm-nouveau2
-libdrm-radeon1
-libdrm-dev
-libcomerr2
-libegl1-mesa
-libegl1-mesa-dev
-libexif12
-libexif-dev
-libexpat1
-libexpat1-dev
-libffi6
-libffi-dev
-libflac8
-libfontconfig1
-libfontconfig1-dev
-libfreetype6
-libfreetype6-dev
-libgbm1
-libgbm-dev
-libgnutls30
-libgcc-6-dev
-libgconf-2-4
-libgconf2-dev
-libgcrypt11-dev
-libgcrypt20
-libgcr-3-dev
-libgcr-base-3-1
-libgcr-ui-3-1
-libgdk-pixbuf2.0-0
-libgdk-pixbuf2.0-dev
-libgdk-pixbuf2.0-common
-libgl1-mesa-glx
-libgl1-mesa-dev
-libglapi-mesa
-libgles2-mesa
-libgles2-mesa-dev
-libgme0
-libgmp10
-libgnutls-openssl27
-libgnutls28-dev
-libgnutlsxx28
-libgomp1
-libgpg-error0
-libgpg-error-dev
-libgssapi-krb5-2
-libgtk2.0-0
-libgtk2.0-dev
-libglib2.0-0
-libglib2.0-dev
-libgnome-keyring0
-libgnome-keyring-dev
-libgsm1
-libgssrpc4
-libhogweed4
-libice6
-libicu-dev
-libicu57
-libidn11
-libjpeg62-turbo
-libjpeg62-turbo-dev
-libjson-c3
-libkadm5clnt-mit11
-libkadm5srv-mit11
-libkdb5-8
-libk5crypto3
-libkeyutils1
-libkeyutils-dev
-libkrb5-3
-libkrb5-dev
-libkrb5support0
-liblzma5
-libmp3lame0
-libmpg123-0
-libnettle6
-libnspr4
-libnspr4-dev
-libnss3
-libnss3-dev
-libnuma1
-libogg0
-libopenjp2-7
-libopenmpt0
-libopus0
-liborbit2
-liborbit-2-0
-liborbit2-dev
-liborc-0.4-0
-libp11-kit0
-libp11-kit-dev
-libpam0g
-libpam0g-dev
-libpango-1.0-0
-libpango1.0-0
-libpango1.0-dev
-libpangocairo-1.0-0
-libpangoft2-1.0-0
-libpangoxft-1.0-0
-libpci3
-libpci-dev
-libpcre3
-libpcre3-dev
-libpcrecpp0v5
-libpixman-1-0
-libpixman-1-dev
-libpng16-16
-libpng-dev
-libpulse0
-libpulse-dev
-libpulse-mainloop-glib0
-libpthread-stubs0-dev
-libpython2.7
-librtmp1
-libselinux1
-libshine3
-libsm6
-libsnappy1v5
-libsnappy-dev
-libsndfile1
-libspeex1
-libsoup-gnome2.4-1
-libsoup-gnome2.4-dev
-libsoxr0
-libspeechd2
-libspeechd-dev
-libsrtp0
-libsrtp0-dev
-libssh-gcrypt-4
-libssl1.1
-libssl-dev
-libstdc++6
-libstdc++-6-dev
-libswresample2
-libsystemd0
-libsqlite3-0
-libsqlite3-dev
-libtasn1-6
-libtasn1-6-dev
-libtheora0
-libtwolame0
-libudev1
-libudev-dev
-libuuid1
-libva1
-libva-drm1
-libva-x11-1
-libvdpau1
-libvorbis0a
-libvorbisenc2
-libvorbisfile3
-libvpx4
-libwavpack1
-libwayland-client0
-libwayland-egl1-mesa
-libwayland-server0
-libwebkitgtk-1.0-0
-libwebp6
-libwebpmux2
-libwrap0
-libx11-6
-libx11-dev
-libx11-xcb1
-libx11-xcb-dev
-libxext6
-libxext-dev
-libxau6
-libxau-dev
-libxcb-dri2-0
-libxcb-dri3-0
-libxcb-dri3-dev
-libxcb-glx0
-libxcb-glx0-dev
-libxcb-image0
-libxcb-image0-dev
-libxcb1
-libxcb1-dev
-libxcb-icccm4
-libxcb-icccm4-dev
-libxcb-present0
-libxcb-randr0
-libxcb-randr0-dev
-libxcb-render0
-libxcb-render0-dev
-libxcb-render-util0
-libxcb-render-util0-dev
-libxcb-keysyms1
-libxcb-keysyms1-dev
-libxcb-sync1
-libxcb-sync-dev
-libxcb-shape0
-libxcb-shape0-dev
-libxcb-shm0
-libxcb-shm0-dev
-libxcb-util0
-libxcb-util0-dev
-libxcb-xinerama0
-libxcb-xinerama0-dev
-libxcb-xfixes0
-libxcb-xfixes0-dev
-libxcb-xkb1
-libxcb-xkb-dev
-libxshmfence1
-libxcomposite1
-libxcomposite-dev
-libxcursor1
-libxcursor-dev
-libxdamage1
-libxdamage-dev
-libxdmcp6
-libxdmcp-dev
-libxfixes3
-libxfixes-dev
-libxi6
-libxi-dev
-libxinerama1
-libxinerama-dev
-libxkbcommon0
-libxkbcommon-dev
-libxrandr2
-libxrandr-dev
-libxrender1
-libxrender-dev
-libxss1
-libxss-dev
-libxt6
-libxt-dev
-libxtst6
-libxtst-dev
-libzvbi0
-linux-libc-dev
-mesa-common-dev
-python2.7
-python2.7-dev
-x11proto-core-dev
-x11proto-composite-dev
-x11proto-damage-dev
-x11proto-fixes-dev
-x11proto-input-dev
-x11proto-kb-dev
-x11proto-randr-dev
-x11proto-record-dev
-x11proto-render-dev
-x11proto-scrnsaver-dev
-x11proto-xext-dev
-x11proto-xinerama-dev
-zlib1g
-zlib1g-dev
diff --git a/src/third_party/icu/source/common/unicode/platform.h b/src/third_party/icu/source/common/unicode/platform.h
index 3301e20..a390138 100644
--- a/src/third_party/icu/source/common/unicode/platform.h
+++ b/src/third_party/icu/source/common/unicode/platform.h
@@ -456,11 +456,9 @@
 #    define __has_attribute(x) 0
 #endif
 
-#if SB_HAS_QUIRK(HASFEATURE_NOT_DEFINED_BUT_IT_IS)
 #ifndef __has_feature
 #    undef __has_feature
 #endif
-#endif
 
 #ifndef __has_builtin
 #    define __has_builtin(x) 0
diff --git a/src/third_party/libdav1d/include/common/mem.h b/src/third_party/libdav1d/include/common/mem.h
index 5a4e348..7b82e6b 100644
--- a/src/third_party/libdav1d/include/common/mem.h
+++ b/src/third_party/libdav1d/include/common/mem.h
@@ -43,14 +43,14 @@
   return SbMemoryAllocateAligned(align, sz);
 #else  // defined(STARBOARD)
 #ifdef HAVE_POSIX_MEMALIGN
-    void *ptr;
-    assert(!(align & (align - 1)));
-    if (posix_memalign(&ptr, align, sz)) return NULL;
-    return ptr;
+  void *ptr;
+  assert(!(align & (align - 1)));
+  if (posix_memalign(&ptr, align, sz)) return NULL;
+  return ptr;
 #elif defined(HAVE_ALIGNED_MALLOC)
-    return _aligned_malloc(sz, align);
+  return _aligned_malloc(sz, align);
 #elif defined(HAVE_MEMALIGN)
-    return memalign(align, sz);
+  return memalign(align, sz);
 #else
 #error Missing aligned alloc implementation
 #endif
@@ -62,11 +62,11 @@
   SbMemoryDeallocateAligned(ptr);
 #else  // defined(STARBOARD)
 #ifdef HAVE_POSIX_MEMALIGN
-    free(ptr);
+  free(ptr);
 #elif defined(HAVE_ALIGNED_MALLOC)
-    _aligned_free(ptr);
+  _aligned_free(ptr);
 #elif defined(HAVE_MEMALIGN)
-    free(ptr);
+  free(ptr);
 #endif
 #endif  // defined(STARBOARD)
 }
@@ -82,8 +82,12 @@
 static inline void freep(void *ptr) {
     void **mem = (void **) ptr;
     if (*mem) {
-        free(*mem);
-        *mem = NULL;
+#if defined(STARBOARD)
+      SbMemoryDeallocate(*mem);
+#else   // defined(STARBOARD)
+      free(*mem);
+#endif  // defined(STARBOARD)
+      *mem = NULL;
     }
 }
 
diff --git a/src/third_party/libevent/epoll.c b/src/third_party/libevent/epoll.c
index 3e04c2b..f4d9765 100644
--- a/src/third_party/libevent/epoll.c
+++ b/src/third_party/libevent/epoll.c
@@ -29,8 +29,12 @@
 #endif
 
 #ifdef STARBOARD
+#if defined LIBEVENT_PLATFORM_HEADER
+#include LIBEVENT_PLATFORM_HEADER
+#else  //  defined LIBEVENT_PLATFORM_HEADER
 #include "epoll-internal.h"
 #include "libevent-starboard.h"
+#endif  //  defined LIBEVENT_PLATFORM_HEADER
 
 // Use libevent's local compatibility  versions of these.
 #include "third_party/libevent/compat/sys/queue.h"
diff --git a/src/third_party/libevent/event.c b/src/third_party/libevent/event.c
index 195d20d..c8b1088 100644
--- a/src/third_party/libevent/event.c
+++ b/src/third_party/libevent/event.c
@@ -29,7 +29,11 @@
 #endif
 
 #ifdef STARBOARD
+#if defined LIBEVENT_PLATFORM_HEADER
+#include LIBEVENT_PLATFORM_HEADER
+#else  //  defined LIBEVENT_PLATFORM_HEADER
 #include "libevent-starboard.h"
+#endif  //  defined LIBEVENT_PLATFORM_HEADER
 
 #include "compat/sys/queue.h"
 
diff --git a/src/third_party/libevent/evutil.c b/src/third_party/libevent/evutil.c
index 1e4edab..de33b87 100644
--- a/src/third_party/libevent/evutil.c
+++ b/src/third_party/libevent/evutil.c
@@ -29,7 +29,11 @@
 #endif
 
 #ifdef STARBOARD
+#if defined LIBEVENT_PLATFORM_HEADER
+#include LIBEVENT_PLATFORM_HEADER
+#else  //  defined LIBEVENT_PLATFORM_HEADER
 #include "libevent-starboard.h"
+#endif  //  defined LIBEVENT_PLATFORM_HEADER
 
 #include "compat/sys/queue.h"
 
diff --git a/src/third_party/libevent/log.c b/src/third_party/libevent/log.c
index c0962ea..435599d 100644
--- a/src/third_party/libevent/log.c
+++ b/src/third_party/libevent/log.c
@@ -42,7 +42,12 @@
 #endif
 
 #ifdef STARBOARD
+#if defined LIBEVENT_PLATFORM_HEADER
+#include LIBEVENT_PLATFORM_HEADER
+#else  //  defined LIBEVENT_PLATFORM_HEADER
 #include "libevent-starboard.h"
+#endif  //  defined LIBEVENT_PLATFORM_HEADER
+
 #include "starboard/common/log.h"
 #include "starboard/system.h"
 #include "starboard/types.h"
diff --git a/src/third_party/libevent/poll.c b/src/third_party/libevent/poll.c
index 6d11a19..6fc6d44 100644
--- a/src/third_party/libevent/poll.c
+++ b/src/third_party/libevent/poll.c
@@ -31,7 +31,11 @@
 #endif
 
 #ifdef STARBOARD
+#if defined LIBEVENT_STARBOARD_HEADER
+#include LIBEVENT_STARBOARD_HEADER
+#else  //  defined LIBEVENT_STARBOARD_HEADER
 #include "libevent-starboard.h"
+#endif  //  defined LIBEVENT_STARBOARD_HEADER
 
 #include <poll.h>
 #include <stdlib.h>
diff --git a/src/third_party/libjpeg-turbo/simd/arm/jsimd.c b/src/third_party/libjpeg-turbo/simd/arm/jsimd.c
index ade6c63..3d31cb4 100644
--- a/src/third_party/libjpeg-turbo/simd/arm/jsimd.c
+++ b/src/third_party/libjpeg-turbo/simd/arm/jsimd.c
@@ -37,6 +37,7 @@
 static unsigned int simd_huffman = 1;
 
 #if defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)
+#if !defined(STARBOARD)
 
 #define SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT  (1024 * 1024)
 
@@ -99,6 +100,7 @@
 }
 
 #endif
+#endif
 
 /*
  * Check what SIMD accelerations are supported.
@@ -112,8 +114,10 @@
   char *env = NULL;
 #endif
 #if !defined(__ARM_NEON__) && defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)
+#if !defined(STARBOARD)
   int bufsize = 1024; /* an initial guess for the line buffer size limit */
 #endif
+#endif
 
   if (simd_support != ~0U)
     return;
@@ -123,6 +127,7 @@
 #if defined(__ARM_NEON__)
   simd_support |= JSIMD_NEON;
 #elif defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)
+#if !defined(STARBOARD)
   /* We still have a chance to use NEON regardless of globally used
    * -mcpu/-mfpu options passed to gcc by performing runtime detection via
    * /proc/cpuinfo parsing on linux/android */
@@ -132,6 +137,7 @@
       break;
   }
 #endif
+#endif
 
 #ifndef NO_GETENV
   /* Force different settings through environment variables */
diff --git a/src/third_party/libpng/libpng.gyp b/src/third_party/libpng/libpng.gyp
index 8cc5624..79153b2 100644
--- a/src/third_party/libpng/libpng.gyp
+++ b/src/third_party/libpng/libpng.gyp
@@ -26,6 +26,7 @@
           'defines': [
             'CHROME_PNG_WRITE_SUPPORT',
             'PNG_USER_CONFIG',
+            'PNG_SKIP_SETJMP_CHECK',
           ],
           'sources': [
             'png.c',
@@ -56,6 +57,7 @@
             'defines': [
               'CHROME_PNG_WRITE_SUPPORT',
               'PNG_USER_CONFIG',
+              'PNG_SKIP_SETJMP_CHECK',
             ],
           },
           'export_dependent_settings': [
diff --git a/src/third_party/llvm-project/libcxx/include/__config b/src/third_party/llvm-project/libcxx/include/__config
index 738d891..cb31a35 100644
--- a/src/third_party/llvm-project/libcxx/include/__config
+++ b/src/third_party/llvm-project/libcxx/include/__config
@@ -977,12 +977,15 @@
 #define _LIBCPP_LOCALE__L_EXTENSIONS 1
 #endif
 
+#include "starboard/configuration.h"
+#if !SB_IS(EVERGREEN)
 #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
 // Most unix variants have catopen.  These are the specific ones that don't.
 #  if !defined(__BIONIC__) && !defined(_NEWLIB_VERSION)
 #    define _LIBCPP_HAS_CATOPEN 1
 #  endif
 #endif
+#endif  // !SB_IS(EVERGREEN)
 
 #ifdef __FreeBSD__
 #define _DECLARE_C99_LDBL_MATH 1
diff --git a/src/third_party/llvm-project/libcxx/src/thread.cpp b/src/third_party/llvm-project/libcxx/src/thread.cpp
index 550da8e..19f9a5f 100644
--- a/src/third_party/llvm-project/libcxx/src/thread.cpp
+++ b/src/third_party/llvm-project/libcxx/src/thread.cpp
@@ -24,9 +24,11 @@
 # endif // defined(BSD)
 #endif // defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
 
+#if !SB_IS(EVERGREEN)
 #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__CloudABI__) || defined(__Fuchsia__)
 # include <unistd.h>
 #endif // defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__CloudABI__) || defined(__Fuchsia__)
+#endif  // !SB_IS(EVERGREEN)
 
 #if defined(__NetBSD__)
 #pragma weak pthread_create // Do not create libpthread dependency
diff --git a/src/third_party/llvm-project/libunwind/src/UnwindCursor.hpp b/src/third_party/llvm-project/libunwind/src/UnwindCursor.hpp
index 0be4cd9..0958012 100644
--- a/src/third_party/llvm-project/libunwind/src/UnwindCursor.hpp
+++ b/src/third_party/llvm-project/libunwind/src/UnwindCursor.hpp
@@ -763,7 +763,7 @@
   _Self operator+(size_t a) { _Self out = *this; out._i += a; return out; }
   _Self operator-(size_t a) { assert(_i >= a); _Self out = *this; out._i -= a; return out; }
 
-  size_t operator-(const _Self& other) { return _i - other._i; }
+  size_t operator-(const _Self& other) const { return _i - other._i; }
 
   bool operator==(const _Self& other) const {
     assert(_addressSpace == other._addressSpace);
@@ -771,6 +771,12 @@
     return _i == other._i;
   }
 
+  bool operator!=(const _Self& other) const {
+    assert(_addressSpace == other._addressSpace);
+    assert(_sects == other._sects);
+    return _i != other._i;
+  }
+
   typename A::pint_t operator*() const { return functionAddress(); }
 
   typename A::pint_t functionAddress() const {
diff --git a/src/third_party/mozjs-45/js/src/jsprf.cpp b/src/third_party/mozjs-45/js/src/jsprf.cpp
index ed8c35e..f1a3326 100644
--- a/src/third_party/mozjs-45/js/src/jsprf.cpp
+++ b/src/third_party/mozjs-45/js/src/jsprf.cpp
@@ -32,7 +32,7 @@
  * and requires array notation.
  */
 #ifdef HAVE_VA_COPY
-#define VARARGS_ASSIGN(foo, bar)        VA_COPY(foo, bar)
+#define VARARGS_ASSIGN(foo, bar)        va_copy(foo, bar)
 #elif defined(HAVE_VA_LIST_AS_ARRAY)
 #define VARARGS_ASSIGN(foo, bar)        foo[0] = bar[0]
 #else
diff --git a/src/third_party/mozjs-45/js/src/jsutil.cpp b/src/third_party/mozjs-45/js/src/jsutil.cpp
index 303063f..e23140f 100644
--- a/src/third_party/mozjs-45/js/src/jsutil.cpp
+++ b/src/third_party/mozjs-45/js/src/jsutil.cpp
@@ -67,9 +67,15 @@
 
 #ifdef __linux__
 
-#include <malloc.h>
 #include <stdlib.h>
 
+#ifdef STARBOARD
+#include "starboard/client_porting/poem/stdio_poem.h"
+#include "starboard/client_porting/poem/string_poem.h"
+#else
+#include <malloc.h>
+#endif
+
 namespace js {
 
 // This function calls all the vanilla heap allocation functions.  It is never
diff --git a/src/third_party/protobuf/src/google/protobuf/stubs/starboard_poem.h b/src/third_party/protobuf/src/google/protobuf/stubs/starboard_poem.h
index 73b5913..4122238 100644
--- a/src/third_party/protobuf/src/google/protobuf/stubs/starboard_poem.h
+++ b/src/third_party/protobuf/src/google/protobuf/stubs/starboard_poem.h
@@ -13,20 +13,7 @@
 // limitations under the License.
 
 #include "starboard/memory.h"
-#include "starboard/types.h"
 
-// This workaround is for protoc auto-generated files which use memset.
-#if SB_HAS_QUIRK(MEMSET_IN_SYSTEM_HEADERS)
-  namespace std {
-    inline namespace _LIBCPP_NAMESPACE {
-      inline void *SbMemorySet(void* destination, int byte_value,
-                               size_t count) {
-        return ::SbMemorySet(destination, byte_value, count);
-      }
-    }
-  }
-#else
 #ifndef memset
 #define memset SbMemorySet
 #endif  // memset
-#endif  // SB_HAS_QUIRK(MEMSET_IN_SYSTEM_HEADERS)
diff --git a/src/third_party/skia/gyp/effects_imagefilters.gypi b/src/third_party/skia/gyp/effects_imagefilters.gypi
index ef5e630..d281283 100644
--- a/src/third_party/skia/gyp/effects_imagefilters.gypi
+++ b/src/third_party/skia/gyp/effects_imagefilters.gypi
@@ -37,7 +37,6 @@
     'skia_effects_imagefilter_sources' : [
       "<(skia_src_path)/effects/imagefilters/SkAlphaThresholdFilter.cpp",
       "<(skia_src_path)/effects/imagefilters/SkArithmeticImageFilter.cpp",
-      "<(skia_src_path)/effects/imagefilters/SkBlurImageFilter.cpp",
       "<(skia_src_path)/effects/imagefilters/SkColorFilterImageFilter.cpp",
       "<(skia_src_path)/effects/imagefilters/SkComposeImageFilter.cpp",
       "<(skia_src_path)/effects/imagefilters/SkDisplacementMapEffect.cpp",
@@ -55,5 +54,9 @@
       "<(skia_src_path)/effects/imagefilters/SkTileImageFilter.cpp",
       "<(skia_src_path)/effects/imagefilters/SkXfermodeImageFilter.cpp",
     ],
+
+    'skia_effects_imagefilter_sources_no_asan' : [
+      "<(skia_src_path)/effects/imagefilters/SkBlurImageFilter.cpp",
+    ],
   },
 }
diff --git a/src/tools/gyp/pylib/gyp/generator/ninja.py b/src/tools/gyp/pylib/gyp/generator/ninja.py
index 82c5682..81dc81a 100755
--- a/src/tools/gyp/pylib/gyp/generator/ninja.py
+++ b/src/tools/gyp/pylib/gyp/generator/ninja.py
@@ -2090,10 +2090,14 @@
 
     # Copy the gyp-win-tool to the toplevel_build.
     # Also write python to the master_ninja.
-    if flavor in microsoft_flavors:
+    if is_windows:
       gyp.common.CopyTool(flavor, toplevel_build)
-      GetToolchainOrNone(flavor).GenerateEnvironmentFiles(
-          toplevel_build, generator_flags, OpenOutput)
+      if GetToolchainOrNone(flavor):
+        GetToolchainOrNone(flavor).GenerateEnvironmentFiles(
+            toplevel_build, generator_flags, OpenOutput)
+      else:
+        gyp.msvs_emulation.GenerateEnvironmentFiles(toplevel_build,
+            generator_flags, OpenOutput)
       master_ninja.variable('python', sys.executable)
       master_ninja.newline()
 
diff --git a/src/v8/METADATA b/src/v8/METADATA
deleted file mode 100644
index 135a234..0000000
--- a/src/v8/METADATA
+++ /dev/null
@@ -1,20 +0,0 @@
-name: "v8"
-description:
-  "Subtree at v8."
-
-third_party {
-  url {
-    type: LOCAL_SOURCE
-    value: "/v8_mirror"
-  }
-  url {
-    type: GIT
-    value: "https://chromium.googlesource.com/v8/v8"
-  }
-  version: "1e6ebba9def991e536159fa658bf5564c054733f"
-  last_upgrade_date {
-    year: 2019
-    month: 8
-    day: 26
-  }
-}
diff --git a/src/v8/Makefile b/src/v8/Makefile
deleted file mode 100644
index 167ebf8..0000000
--- a/src/v8/Makefile
+++ /dev/null
@@ -1,493 +0,0 @@
-# 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.
-
-
-# Variable default definitions. Override them by exporting them in your shell.
-OUTDIR ?= out
-TESTJOBS ?=
-GYPFLAGS ?=
-TESTFLAGS ?=
-ANDROID_NDK_HOST_ARCH ?=
-ANDROID_V8 ?= /data/local/tmp/v8
-
-# Special build flags. Use them like this: "make library=shared"
-
-# library=shared || component=shared_library
-ifeq ($(library), shared)
-  GYPFLAGS += -Dcomponent=shared_library
-endif
-ifdef component
-  GYPFLAGS += -Dcomponent=$(component)
-endif
-# disassembler=on
-ifeq ($(disassembler), on)
-  GYPFLAGS += -Dv8_enable_disassembler=1
-endif
-# objectprint=on
-ifeq ($(objectprint), on)
-  GYPFLAGS += -Dv8_object_print=1
-endif
-# verifycsa=on
-ifeq ($(verifycsa), on)
-  GYPFLAGS += -Dv8_enable_verify_csa=1
-endif
-# verifyheap=on
-ifeq ($(verifyheap), on)
-  GYPFLAGS += -Dv8_enable_verify_heap=1
-endif
-# tracemaps=on
-ifeq ($(tracemaps), on)
-  GYPFLAGS += -Dv8_trace_maps=1
-endif
-# concurrentmarking=on
-ifeq ($(concurrentmarking), on)
-  GYPFLAGS += -Dv8_enable_concurrent_marking=1
-endif
-# backtrace=off
-ifeq ($(backtrace), off)
-  GYPFLAGS += -Dv8_enable_backtrace=0
-else
-  GYPFLAGS += -Dv8_enable_backtrace=1
-endif
-# verifypredictable=on
-ifeq ($(verifypredictable), on)
-  GYPFLAGS += -Dv8_enable_verify_predictable=1
-endif
-# snapshot=off
-ifeq ($(snapshot), off)
-  GYPFLAGS += -Dv8_use_snapshot='false'
-endif
-ifeq ($(snapshot), external)
-  GYPFLAGS += -Dv8_use_external_startup_data=1
-endif
-# extrachecks=on/off
-ifeq ($(extrachecks), on)
-  GYPFLAGS += -Ddcheck_always_on=1 -Dv8_enable_handle_zapping=1
-endif
-ifeq ($(extrachecks), off)
-  GYPFLAGS += -Ddcheck_always_on=0 -Dv8_enable_handle_zapping=0
-endif
-# slowdchecks=on/off
-ifeq ($(slowdchecks), on)
-  GYPFLAGS += -Dv8_enable_slow_dchecks=1
-endif
-ifeq ($(slowdchecks), off)
-  GYPFLAGS += -Dv8_enable_slow_dchecks=0
-endif
-# debugsymbols=on
-ifeq ($(debugsymbols), on)
-  GYPFLAGS += -Drelease_extra_cflags=-ggdb3
-endif
-# gdbjit=on/off
-ifeq ($(gdbjit), on)
-  GYPFLAGS += -Dv8_enable_gdbjit=1
-endif
-ifeq ($(gdbjit), off)
-  GYPFLAGS += -Dv8_enable_gdbjit=0
-endif
-# vtunejit=on
-ifeq ($(vtunejit), on)
-  GYPFLAGS += -Dv8_enable_vtunejit=1
-endif
-# unalignedaccess=on
-ifeq ($(unalignedaccess), on)
-  GYPFLAGS += -Dv8_can_use_unaligned_accesses=true
-endif
-# randomseed=12345, disable random seed via randomseed=0
-ifdef randomseed
-  GYPFLAGS += -Dv8_random_seed=$(randomseed)
-endif
-# soname_version=1.2.3
-ifdef soname_version
-  GYPFLAGS += -Dsoname_version=$(soname_version)
-endif
-# werror=no
-ifeq ($(werror), no)
-  GYPFLAGS += -Dwerror=''
-endif
-# strictaliasing=off (workaround for GCC-4.5)
-ifeq ($(strictaliasing), off)
-  GYPFLAGS += -Dv8_no_strict_aliasing=1
-endif
-# regexp=interpreted
-ifeq ($(regexp), interpreted)
-  GYPFLAGS += -Dv8_interpreted_regexp=1
-endif
-# i18nsupport=off
-ifeq ($(i18nsupport), off)
-  GYPFLAGS += -Dv8_enable_i18n_support=0
-  TESTFLAGS += --noi18n
-endif
-# deprecationwarnings=on
-ifeq ($(deprecationwarnings), on)
-  GYPFLAGS += -Dv8_deprecation_warnings=1
-endif
-# vectorstores=on
-ifeq ($(vectorstores), on)
-  GYPFLAGS += -Dv8_vector_stores=1
-endif
-# imminentdeprecationwarnings=on
-ifeq ($(imminentdeprecationwarnings), on)
-  GYPFLAGS += -Dv8_imminent_deprecation_warnings=1
-endif
-# asan=on
-ifeq ($(asan), on)
-  GYPFLAGS += -Dasan=1 -Dclang=1
-  TESTFLAGS += --asan
-  ifeq ($(lsan), on)
-    GYPFLAGS += -Dlsan=1
-  endif
-endif
-ifdef embedscript
-  GYPFLAGS += -Dembed_script=$(embedscript)
-endif
-ifdef warmupscript
-  GYPFLAGS += -Dwarmup_script=$(warmupscript)
-endif
-ifeq ($(goma), on)
-  GYPFLAGS += -Duse_goma=1
-endif
-# v8_os_page_size=0, when 0 or not specified use build OS page size
-ifdef v8_os_page_size
-  ifneq ($(v8_os_page_size), 0)
-    ifneq ($(snapshot), off)
-      GYPFLAGS += -Dv8_os_page_size=$(v8_os_page_size)
-    endif
-  endif
-endif
-# arm specific flags.
-# arm_version=<number | "default">
-ifneq ($(strip $(arm_version)),)
-  GYPFLAGS += -Darm_version=$(arm_version)
-else
-# Deprecated (use arm_version instead): armv7=false/true
-ifeq ($(armv7), false)
-  GYPFLAGS += -Darm_version=6
-else
-ifeq ($(armv7), true)
-  GYPFLAGS += -Darm_version=7
-endif
-endif
-endif
-# hardfp=on/off. Deprecated, use armfloatabi
-ifeq ($(hardfp),on)
-  GYPFLAGS += -Darm_float_abi=hard
-else
-ifeq ($(hardfp),off)
-  GYPFLAGS += -Darm_float_abi=softfp
-endif
-endif
-# fpu: armfpu=xxx
-# xxx: vfp, vfpv3-d16, vfpv3, neon.
-ifeq ($(armfpu),)
-  GYPFLAGS += -Darm_fpu=default
-else
-  GYPFLAGS += -Darm_fpu=$(armfpu)
-endif
-# float abi: armfloatabi=softfp/hard
-ifeq ($(armfloatabi),)
-ifeq ($(hardfp),)
-  GYPFLAGS += -Darm_float_abi=default
-endif
-else
-  GYPFLAGS += -Darm_float_abi=$(armfloatabi)
-endif
-# armthumb=on/off
-ifeq ($(armthumb), off)
-  GYPFLAGS += -Darm_thumb=0
-else
-ifeq ($(armthumb), on)
-  GYPFLAGS += -Darm_thumb=1
-endif
-endif
-# arm_test_noprobe=on
-# With this flag set, by default v8 will only use features implied
-# by the compiler (no probe). This is done by modifying the default
-# values of enable_armv7, enable_vfp3, enable_32dregs and enable_neon.
-# Modifying these flags when launching v8 will enable the probing for
-# the specified values.
-ifeq ($(arm_test_noprobe), on)
-  GYPFLAGS += -Darm_test_noprobe=on
-endif
-# Do not omit the frame pointer, needed for profiling with perf
-ifeq ($(no_omit_framepointer), on)
-  GYPFLAGS += -Drelease_extra_cflags=-fno-omit-frame-pointer
-endif
-
-ifdef android_ndk_root
-  GYPFLAGS += -Dandroid_ndk_root=$(android_ndk_root)
-  export ANDROID_NDK_ROOT = $(android_ndk_root)
-endif
-
-# ----------------- available targets: --------------------
-# - any arch listed in ARCHES (see below)
-# - any mode listed in MODES
-# - every combination <arch>.<mode>, e.g. "ia32.release"
-# - "native": current host's architecture, release mode
-# - any of the above with .check appended, e.g. "ia32.release.check"
-# - "android": cross-compile for Android/ARM
-# - default (no target specified): build all DEFAULT_ARCHES and MODES
-# - "check": build all targets and run all tests
-# - "<arch>.clean" for any <arch> in ARCHES
-# - "clean": clean all ARCHES
-
-# ----------------- internal stuff ------------------------
-
-# Architectures and modes to be compiled. Consider these to be internal
-# variables, don't override them (use the targets instead).
-ARCHES = ia32 x64 arm arm64 mips mipsel mips64 mips64el ppc ppc64 s390 s390x
-ARCHES32 = ia32 arm mips mipsel ppc s390
-DEFAULT_ARCHES = ia32 x64 arm
-MODES = release debug optdebug
-DEFAULT_MODES = release debug
-ANDROID_ARCHES = android_ia32 android_x64 android_arm android_arm64 \
-		 android_mipsel
-
-# List of files that trigger Makefile regeneration:
-GYPFILES = third_party/icu/icu.gypi third_party/icu/icu.gyp \
-	   gypfiles/shim_headers.gypi gypfiles/features.gypi \
-           gypfiles/standalone.gypi \
-	   gypfiles/toolchain.gypi gypfiles/all.gyp gypfiles/mac/asan.gyp \
-	   test/cctest/cctest.gyp test/fuzzer/fuzzer.gyp \
-	   test/unittests/unittests.gyp src/v8.gyp \
-	   tools/parser-shell.gyp testing/gmock.gyp testing/gtest.gyp \
-	   samples/samples.gyp src/third_party/vtune/v8vtune.gyp src/d8.gyp
-
-# If vtunejit=on, the v8vtune.gyp will be appended.
-ifeq ($(vtunejit), on)
-  GYPFILES += src/third_party/vtune/v8vtune.gyp
-endif
-# Generates all combinations of ARCHES and MODES, e.g. "ia32.release".
-BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES)))
-ANDROID_BUILDS = $(foreach mode,$(MODES), \
-                   $(addsuffix .$(mode),$(ANDROID_ARCHES)))
-# Generates corresponding test targets, e.g. "ia32.release.check".
-CHECKS = $(addsuffix .check,$(BUILDS))
-QUICKCHECKS = $(addsuffix .quickcheck,$(BUILDS))
-ANDROID_CHECKS = $(addsuffix .check,$(ANDROID_BUILDS))
-# File where previously used GYPFLAGS are stored.
-ENVFILE = $(OUTDIR)/environment
-
-.PHONY: all check clean builddeps dependencies $(ENVFILE).new native \
-        qc quickcheck $(QUICKCHECKS) turbocheck \
-        $(addsuffix .quickcheck,$(MODES)) $(addsuffix .quickcheck,$(ARCHES)) \
-        $(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \
-        $(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES)) \
-        $(ANDROID_ARCHES) $(ANDROID_BUILDS) $(ANDROID_CHECKS)
-
-# Target definitions. "all" is the default.
-all: $(DEFAULT_MODES)
-
-# Special target for the buildbots to use. Depends on $(OUTDIR)/Makefile
-# having been created before.
-buildbot:
-	$(MAKE) -C "$(OUTDIR)" BUILDTYPE=$(BUILDTYPE) \
-	        builddir="$(abspath $(OUTDIR))/$(BUILDTYPE)"
-
-# Compile targets. MODES and ARCHES are convenience targets.
-.SECONDEXPANSION:
-$(MODES): $(addsuffix .$$@,$(DEFAULT_ARCHES))
-
-$(ARCHES): $(addprefix $$@.,$(DEFAULT_MODES))
-
-# Defines how to build a particular target (e.g. ia32.release).
-$(BUILDS): $(OUTDIR)/Makefile.$$@
-	@$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \
-	         BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \
-	                     python -c "print \
-	                     raw_input().replace('opt', '').capitalize()") \
-	         builddir="$(shell pwd)/$(OUTDIR)/$@"
-
-native: $(OUTDIR)/Makefile.native
-	@$(MAKE) -C "$(OUTDIR)" -f Makefile.native \
-	         BUILDTYPE=Release \
-	         builddir="$(shell pwd)/$(OUTDIR)/$@"
-
-$(ANDROID_ARCHES): $(addprefix $$@.,$(MODES))
-
-$(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) Makefile.android
-	@$(MAKE) -f Makefile.android $@ \
-	        ARCH="$(basename $@)" \
-	        MODE="$(subst .,,$(suffix $@))" \
-	        OUTDIR="$(OUTDIR)" \
-	        GYPFLAGS="$(GYPFLAGS)"
-
-# Test targets.
-check: all
-	@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
-	    --arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \
-	    $(TESTFLAGS)
-
-$(addsuffix .check,$(MODES)): $$(basename $$@)
-	@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
-	    --mode=$(basename $@) $(TESTFLAGS)
-
-$(addsuffix .check,$(ARCHES)): $$(basename $$@)
-	@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
-	    --arch=$(basename $@) $(TESTFLAGS)
-
-$(CHECKS): $$(basename $$@)
-	@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
-	    --arch-and-mode=$(basename $@) $(TESTFLAGS)
-
-$(addsuffix .quickcheck,$(MODES)): $$(basename $$@)
-	@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
-	    --mode=$(basename $@) $(TESTFLAGS) --quickcheck
-
-$(addsuffix .quickcheck,$(ARCHES)): $$(basename $$@)
-	@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
-	    --arch=$(basename $@) $(TESTFLAGS) --quickcheck
-
-$(QUICKCHECKS): $$(basename $$@)
-	@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
-	    --arch-and-mode=$(basename $@) $(TESTFLAGS) --quickcheck
-
-$(addsuffix .sync, $(ANDROID_BUILDS)): $$(basename $$@)
-	@tools/android-sync.sh $(basename $@) $(OUTDIR) \
-	                       $(shell pwd) $(ANDROID_V8)
-
-$(addsuffix .check, $(ANDROID_BUILDS)): $$(basename $$@).sync
-	@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
-	     --arch-and-mode=$(basename $@) \
-	     --timeout=600 \
-	     --command-prefix="tools/android-run.py" $(TESTFLAGS)
-
-$(addsuffix .check, $(ANDROID_ARCHES)): \
-                $(addprefix $$(basename $$@).,$(MODES)).check
-
-native.check: native
-	@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR)/native \
-	    --arch-and-mode=. $(TESTFLAGS)
-
-SUPERFASTTESTMODES = ia32.release
-FASTTESTMODES = $(SUPERFASTTESTMODES),x64.release,ia32.optdebug,x64.optdebug,arm.optdebug,arm64.release
-FASTCOMPILEMODES = $(FASTTESTMODES),arm64.optdebug
-
-COMMA = ,
-EMPTY =
-SPACE = $(EMPTY) $(EMPTY)
-quickcheck: $(subst $(COMMA),$(SPACE),$(FASTCOMPILEMODES))
-	gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
-	    --arch-and-mode=$(SUPERFASTTESTMODES) $(TESTFLAGS) --quickcheck \
-	    --download-data mozilla webkit
-	gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
-	    --arch-and-mode=$(FASTTESTMODES) $(TESTFLAGS) --quickcheck
-qc: quickcheck
-
-turbocheck: $(subst $(COMMA),$(SPACE),$(FASTCOMPILEMODES))
-	gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
-	    --arch-and-mode=$(SUPERFASTTESTMODES) $(TESTFLAGS) \
-	    --quickcheck --variants=turbofan --download-data mozilla webkit
-	gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
-	    --arch-and-mode=$(FASTTESTMODES) $(TESTFLAGS) \
-	    --quickcheck --variants=turbofan
-tc: turbocheck
-
-# Clean targets. You can clean each architecture individually, or everything.
-$(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES)):
-	rm -f $(OUTDIR)/Makefile.$(basename $@)*
-	rm -rf $(OUTDIR)/$(basename $@).release
-	rm -rf $(OUTDIR)/$(basename $@).debug
-	rm -rf $(OUTDIR)/$(basename $@).optdebug
-	find $(OUTDIR) -regex '.*\(host\|target\)\.$(basename $@).*\.mk' -delete
-
-native.clean:
-	rm -f $(OUTDIR)/Makefile.native
-	rm -rf $(OUTDIR)/native
-	find $(OUTDIR) -regex '.*\(host\|target\)\.native\.mk' -delete
-
-clean: $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES)) native.clean gtags.clean tags.clean
-
-# GYP file generation targets.
-OUT_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(BUILDS))
-$(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE)
-	$(eval CXX_TARGET_ARCH:=$(shell $(CXX) -v 2>&1 | grep ^Target: | \
-	        cut -f 2 -d " " | cut -f 1 -d "-" ))
-	$(eval CXX_TARGET_ARCH:=$(subst aarch64,arm64,$(CXX_TARGET_ARCH)))
-	$(eval CXX_TARGET_ARCH:=$(subst x86_64,x64,$(CXX_TARGET_ARCH)))
-	$(eval CXX_TARGET_ARCH:=$(subst s390x,s390,$(CXX_TARGET_ARCH)))
-	$(eval CXX_TARGET_ARCH:=$(subst powerpc,ppc,$(CXX_TARGET_ARCH)))
-	$(eval CXX_TARGET_ARCH:=$(subst ppc64,ppc,$(CXX_TARGET_ARCH)))
-	$(eval CXX_TARGET_ARCH:=$(subst ppcle,ppc,$(CXX_TARGET_ARCH)))
-	$(eval V8_TARGET_ARCH:=$(subst .,,$(suffix $(basename $@))))
-	PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/gypfiles:$(PYTHONPATH):$(shell pwd)/tools/gyp/pylib:$(PYTHONPATH)" \
-	GYP_GENERATORS=make \
-	tools/gyp/gyp --generator-output="$(OUTDIR)" gypfiles/all.gyp \
-	              -Igypfiles/standalone.gypi --depth=. \
-	              -Dv8_target_arch=$(V8_TARGET_ARCH) \
-	              $(if $(findstring $(CXX_TARGET_ARCH),$(V8_TARGET_ARCH)), \
-	              -Dtarget_arch=$(V8_TARGET_ARCH), \
-	                  $(if $(shell echo $(ARCHES32) | grep $(V8_TARGET_ARCH)), \
-	                  -Dtarget_arch=ia32,)) \
-	              $(if $(findstring optdebug,$@),-Dv8_optimized_debug=1,) \
-	              -S$(suffix $(basename $@))$(suffix $@) $(GYPFLAGS)
-
-$(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE)
-	PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/gypfiles:$(PYTHONPATH):$(shell pwd)/tools/gyp/pylib:$(PYTHONPATH)" \
-	GYP_GENERATORS=make \
-	tools/gyp/gyp --generator-output="$(OUTDIR)" gypfiles/all.gyp \
-	              -Igypfiles/standalone.gypi --depth=. -S.native $(GYPFLAGS)
-
-# Replaces the old with the new environment file if they're different, which
-# will trigger GYP to regenerate Makefiles.
-$(ENVFILE): $(ENVFILE).new
-	@if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) > /dev/null; \
-	    then rm $(ENVFILE).new; \
-	    else mv $(ENVFILE).new $(ENVFILE); fi
-
-# Stores current GYPFLAGS in a file.
-$(ENVFILE).new:
-	$(eval CXX_TARGET_ARCH:=$(shell $(CXX) -v 2>&1 | grep ^Target: | \
-	        cut -f 2 -d " " | cut -f 1 -d "-" ))
-	$(eval CXX_TARGET_ARCH:=$(subst aarch64,arm64,$(CXX_TARGET_ARCH)))
-	$(eval CXX_TARGET_ARCH:=$(subst x86_64,x64,$(CXX_TARGET_ARCH)))
-	@mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS) -Dtarget_arch=$(CXX_TARGET_ARCH)" > $(ENVFILE).new;
-
-# Support for the GNU GLOBAL Source Code Tag System.
-gtags.files: $(GYPFILES) $(ENVFILE)
-	@find include src test -name '*.h' -o -name '*.cc' -o -name '*.c' > $@
-
-# We need to manually set the stack limit here, to work around bugs in
-# gmake-3.81 and global-5.7.1 on recent 64-bit Linux systems.
-# Using $(wildcard ...) gracefully ignores non-existing files, so that stale
-# gtags.files after switching branches don't cause recipe failures.
-GPATH GRTAGS GSYMS GTAGS: gtags.files $(wildcard $(shell cat gtags.files 2> /dev/null))
-	@bash -c 'ulimit -s 10240 && GTAGSFORCECPP=yes gtags -i -q -f $<'
-
-gtags.clean:
-	rm -f gtags.files GPATH GRTAGS GSYMS GTAGS
-
-tags: gtags.files $(wildcard $(shell cat gtags.files 2> /dev/null))
-	@(ctags --version | grep 'Exuberant Ctags' >/dev/null) || \
-		(echo "Please install Exuberant Ctags (check 'ctags --version')" >&2; false)
-	ctags --fields=+l -L $<
-
-tags.clean:
-	rm -r tags
-
-dependencies builddeps:
-	$(error Use 'gclient sync' instead)
diff --git a/src/v8/Makefile.android b/src/v8/Makefile.android
deleted file mode 100644
index 4171521..0000000
--- a/src/v8/Makefile.android
+++ /dev/null
@@ -1,72 +0,0 @@
-# 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.
-
-# Those definitions should be consistent with the main Makefile
-ANDROID_ARCHES = android_ia32 android_x64 android_arm android_arm64 \
-		 android_mipsel android_x87
-MODES = release debug
-
-# Generates all combinations of ANDROID ARCHES and MODES,
-# e.g. "android_ia32.release" or "android_arm.release"
-ANDROID_BUILDS = $(foreach mode,$(MODES), \
-                   $(addsuffix .$(mode),$(ANDROID_ARCHES)))
-
-ifeq ($(ARCH), android_arm)
-  DEFINES  = target_arch=arm v8_target_arch=arm
-else ifeq ($(ARCH), android_arm64)
-  DEFINES  = target_arch=arm64 v8_target_arch=arm64
-else ifeq ($(ARCH), android_mipsel)
-  DEFINES  = target_arch=mipsel v8_target_arch=mipsel
-else ifeq ($(ARCH), android_ia32)
-  DEFINES = target_arch=ia32 v8_target_arch=ia32
-else ifeq ($(ARCH), android_x64)
-  DEFINES = target_arch=x64 v8_target_arch=x64
-else ifeq ($(ARCH), android_x87)
-  DEFINES = target_arch=ia32 v8_target_arch=x87
-else
-  $(error Target architecture "${ARCH}" is not supported)
-endif
-
-# Common flags.
-DEFINES += OS=android
-
-.SECONDEXPANSION:
-$(ANDROID_BUILDS): $(OUTDIR)/Makefile.$$@
-	@$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \
-	          BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \
-	                      python -c "print raw_input().capitalize()") \
-	          builddir="$(shell pwd)/$(OUTDIR)/$@"
-
-# Android GYP file generation targets.
-ANDROID_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ANDROID_BUILDS))
-$(ANDROID_MAKEFILES):
-	GYP_GENERATORS=make-android \
-	GYP_DEFINES="${DEFINES}" \
-	PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/gypfiles:$(PYTHONPATH)" \
-	tools/gyp/gyp --generator-output="${OUTDIR}" gypfiles/all.gyp \
-	              -Igypfiles/standalone.gypi --depth=. \
-	              -S$(suffix $(basename $@))$(suffix $@) ${GYPFLAGS}
diff --git a/src/v8/gni/isolate.gni b/src/v8/gni/isolate.gni
deleted file mode 100644
index 6ad25c2..0000000
--- a/src/v8/gni/isolate.gni
+++ /dev/null
@@ -1,196 +0,0 @@
-# Copyright 2016 the V8 project 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/sanitizers/sanitizers.gni")
-import("//third_party/icu/config.gni")
-import("v8.gni")
-
-declare_args() {
-  # Sets the test isolation mode (noop|prepare|check).
-  v8_test_isolation_mode = "noop"
-}
-
-template("v8_isolate_run") {
-  forward_variables_from(invoker,
-                         "*",
-                         [
-                           "deps",
-                           "isolate",
-                         ])
-
-  # Remember target name as within the action scope the target name will be
-  # different.
-  name = target_name
-
-  assert(defined(invoker.deps))
-  assert(defined(invoker.isolate))
-
-  if (name != "" && v8_test_isolation_mode != "noop") {
-    action(name + "_run") {
-      testonly = true
-
-      deps = invoker.deps
-
-      script = "//tools/isolate_driver.py"
-
-      sources = [
-        invoker.isolate,
-      ]
-
-      inputs = [
-        # Files that are known to be involved in this step.
-        "//tools/swarming_client/isolate.py",
-        "//tools/swarming_client/run_isolated.py",
-      ]
-
-      if (v8_test_isolation_mode == "prepare") {
-        outputs = [
-          "$root_out_dir/$name.isolated.gen.json",
-        ]
-      } else if (v8_test_isolation_mode == "check") {
-        outputs = [
-          "$root_out_dir/$name.isolated",
-          "$root_out_dir/$name.isolated.state",
-        ]
-      }
-
-      # Translate gn to gyp variables.
-      if (v8_code_coverage) {
-        coverage = "1"
-      } else {
-        coverage = "0"
-      }
-      if (is_asan) {
-        asan = "1"
-      } else {
-        asan = "0"
-      }
-      if (is_msan) {
-        msan = "1"
-      } else {
-        msan = "0"
-      }
-      if (is_tsan) {
-        tsan = "1"
-      } else {
-        tsan = "0"
-      }
-      if (is_cfi) {
-        cfi_vptr = "1"
-      } else {
-        cfi_vptr = "0"
-      }
-      if (target_cpu == "x86") {
-        target_arch = "ia32"
-      } else {
-        target_arch = target_cpu
-      }
-      if (is_debug) {
-        configuration_name = "Debug"
-      } else {
-        configuration_name = "Release"
-      }
-      if (is_component_build) {
-        component = "shared_library"
-      } else {
-        component = "static_library"
-      }
-      if (icu_use_data_file) {
-        icu_use_data_file_flag = "1"
-      } else {
-        icu_use_data_file_flag = "0"
-      }
-      if (v8_use_external_startup_data) {
-        use_external_startup_data = "1"
-      } else {
-        use_external_startup_data = "0"
-      }
-      if (is_ubsan_vptr) {
-        ubsan_vptr = "1"
-      } else {
-        ubsan_vptr = "0"
-      }
-      if (v8_use_snapshot) {
-        use_snapshot = "true"
-      } else {
-        use_snapshot = "false"
-      }
-      if (v8_has_valgrind) {
-        has_valgrind = "1"
-      } else {
-        has_valgrind = "0"
-      }
-      if (v8_gcmole) {
-        gcmole = "1"
-      } else {
-        gcmole = "0"
-      }
-
-      # Note, all paths will be rebased in isolate_driver.py to be relative to
-      # the isolate file.
-      args = [
-        v8_test_isolation_mode,
-        "--isolated",
-        rebase_path("$root_out_dir/$name.isolated", root_build_dir),
-        "--isolate",
-        rebase_path(invoker.isolate, root_build_dir),
-
-        # Path variables are used to replace file paths when loading a .isolate
-        # file
-        "--path-variable",
-        "DEPTH",
-        rebase_path("//", root_build_dir),
-        "--path-variable",
-        "PRODUCT_DIR",
-        rebase_path(root_out_dir, root_build_dir),
-
-        # TODO(machenbach): Set variables for remaining features.
-        "--config-variable",
-        "CONFIGURATION_NAME=$configuration_name",
-        "--config-variable",
-        "OS=$target_os",
-        "--config-variable",
-        "asan=$asan",
-        "--config-variable",
-        "cfi_vptr=$cfi_vptr",
-        "--config-variable",
-        "gcmole=$gcmole",
-        "--config-variable",
-        "has_valgrind=$has_valgrind",
-        "--config-variable",
-        "icu_use_data_file_flag=$icu_use_data_file_flag",
-        "--config-variable",
-        "msan=$msan",
-        "--config-variable",
-        "tsan=$tsan",
-        "--config-variable",
-        "coverage=$coverage",
-        "--config-variable",
-        "sanitizer_coverage=$sanitizer_coverage_flags",
-        "--config-variable",
-        "component=$component",
-        "--config-variable",
-        "target_arch=$target_arch",
-        "--config-variable",
-        "ubsan_vptr=$ubsan_vptr",
-        "--config-variable",
-        "v8_use_external_startup_data=$use_external_startup_data",
-        "--config-variable",
-        "v8_use_snapshot=$use_snapshot",
-      ]
-
-      if (is_win) {
-        args += [
-          "--config-variable",
-          "msvs_version=2017",
-        ]
-      } else {
-        args += [
-          "--config-variable",
-          "msvs_version=0",
-        ]
-      }
-    }
-  }
-}
diff --git a/src/v8/gypfiles/standalone.gypi b/src/v8/gypfiles/standalone.gypi
index ec47f1c..8f893ce 100644
--- a/src/v8/gypfiles/standalone.gypi
+++ b/src/v8/gypfiles/standalone.gypi
@@ -1229,7 +1229,6 @@
                 # The mips toolchain currently has problems with stack-protector.
                 'cflags!': [
                   '-fstack-protector',
-                  '-U__linux__'
                 ],
                 'cflags': [
                   '-fno-stack-protector',
diff --git a/src/v8/include/v8-debug.h b/src/v8/include/v8-debug.h
deleted file mode 100644
index 54c0f21..0000000
--- a/src/v8/include/v8-debug.h
+++ /dev/null
@@ -1,255 +0,0 @@
-// Copyright 2008 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_V8_DEBUG_H_
-#define V8_V8_DEBUG_H_
-
-#include "v8.h"  // NOLINT(build/include)
-
-/**
- * ATTENTION: The debugger API exposed by this file is deprecated and will be
- *            removed by the end of 2017. Please use the V8 inspector declared
- *            in include/v8-inspector.h instead.
- */
-namespace v8 {
-
-// Debug events which can occur in the V8 JavaScript engine.
-enum DebugEvent {
-  Break = 1,
-  Exception = 2,
-  AfterCompile = 3,
-  CompileError = 4,
-  AsyncTaskEvent = 5,
-};
-
-class V8_EXPORT Debug {
- public:
-  /**
-   * A client object passed to the v8 debugger whose ownership will be taken by
-   * it. v8 is always responsible for deleting the object.
-   */
-  class ClientData {
-   public:
-    virtual ~ClientData() {}
-  };
-
-
-  /**
-   * A message object passed to the debug message handler.
-   */
-  class Message {
-   public:
-    /**
-     * Check type of message.
-     */
-    virtual bool IsEvent() const = 0;
-    virtual bool IsResponse() const = 0;
-    virtual DebugEvent GetEvent() const = 0;
-
-    /**
-     * Indicate whether this is a response to a continue command which will
-     * start the VM running after this is processed.
-     */
-    virtual bool WillStartRunning() const = 0;
-
-    /**
-     * Access to execution state and event data. Don't store these cross
-     * callbacks as their content becomes invalid. These objects are from the
-     * debugger event that started the debug message loop.
-     */
-    virtual Local<Object> GetExecutionState() const = 0;
-    virtual Local<Object> GetEventData() const = 0;
-
-    /**
-     * Get the debugger protocol JSON.
-     */
-    virtual Local<String> GetJSON() const = 0;
-
-    /**
-     * Get the context active when the debug event happened. Note this is not
-     * the current active context as the JavaScript part of the debugger is
-     * running in its own context which is entered at this point.
-     */
-    virtual Local<Context> GetEventContext() const = 0;
-
-    /**
-     * Client data passed with the corresponding request if any. This is the
-     * client_data data value passed into Debug::SendCommand along with the
-     * request that led to the message or NULL if the message is an event. The
-     * debugger takes ownership of the data and will delete it even if there is
-     * no message handler.
-     */
-    virtual ClientData* GetClientData() const = 0;
-
-    virtual Isolate* GetIsolate() const = 0;
-
-    virtual ~Message() {}
-  };
-
-  /**
-   * An event details object passed to the debug event listener.
-   */
-  class EventDetails {
-   public:
-    /**
-     * Event type.
-     */
-    virtual DebugEvent GetEvent() const = 0;
-
-    /**
-     * Access to execution state and event data of the debug event. Don't store
-     * these cross callbacks as their content becomes invalid.
-     */
-    virtual Local<Object> GetExecutionState() const = 0;
-    virtual Local<Object> GetEventData() const = 0;
-
-    /**
-     * Get the context active when the debug event happened. Note this is not
-     * the current active context as the JavaScript part of the debugger is
-     * running in its own context which is entered at this point.
-     */
-    virtual Local<Context> GetEventContext() const = 0;
-
-    /**
-     * Client data passed with the corresponding callback when it was
-     * registered.
-     */
-    virtual Local<Value> GetCallbackData() const = 0;
-
-    /**
-     * This is now a dummy that returns nullptr.
-     */
-    virtual ClientData* GetClientData() const = 0;
-
-    virtual Isolate* GetIsolate() const = 0;
-
-    virtual ~EventDetails() {}
-  };
-
-  /**
-   * Debug event callback function.
-   *
-   * \param event_details object providing information about the debug event
-   *
-   * A EventCallback does not take possession of the event data,
-   * and must not rely on the data persisting after the handler returns.
-   */
-  typedef void (*EventCallback)(const EventDetails& event_details);
-
-  /**
-   * This is now a no-op.
-   */
-  typedef void (*MessageHandler)(const Message& message);
-
-  V8_DEPRECATED("No longer supported", static bool SetDebugEventListener(
-                                           Isolate* isolate, EventCallback that,
-                                           Local<Value> data = Local<Value>()));
-
-  // Schedule a debugger break to happen when JavaScript code is run
-  // in the given isolate.
-  V8_DEPRECATED("No longer supported",
-                static void DebugBreak(Isolate* isolate));
-
-  // Remove scheduled debugger break in given isolate if it has not
-  // happened yet.
-  V8_DEPRECATED("No longer supported",
-                static void CancelDebugBreak(Isolate* isolate));
-
-  // Check if a debugger break is scheduled in the given isolate.
-  V8_DEPRECATED("No longer supported",
-                static bool CheckDebugBreak(Isolate* isolate));
-
-  // This is now a no-op.
-  V8_DEPRECATED("No longer supported",
-                static void SetMessageHandler(Isolate* isolate,
-                                              MessageHandler handler));
-
-  // This is now a no-op.
-  V8_DEPRECATED("No longer supported",
-                static void SendCommand(Isolate* isolate,
-                                        const uint16_t* command, int length,
-                                        ClientData* client_data = NULL));
-
-  /**
-   * Run a JavaScript function in the debugger.
-   * \param fun the function to call
-   * \param data passed as second argument to the function
-   * With this call the debugger is entered and the function specified is called
-   * with the execution state as the first argument. This makes it possible to
-   * get access to information otherwise not available during normal JavaScript
-   * execution e.g. details on stack frames. Receiver of the function call will
-   * be the debugger context global object, however this is a subject to change.
-   * The following example shows a JavaScript function which when passed to
-   * v8::Debug::Call will return the current line of JavaScript execution.
-   *
-   * \code
-   *   function frame_source_line(exec_state) {
-   *     return exec_state.frame(0).sourceLine();
-   *   }
-   * \endcode
-   */
-  V8_DEPRECATED("No longer supported",
-                static MaybeLocal<Value> Call(
-                    Local<Context> context, v8::Local<v8::Function> fun,
-                    Local<Value> data = Local<Value>()));
-
-  // This is now a no-op.
-  V8_DEPRECATED("No longer supported",
-                static void ProcessDebugMessages(Isolate* isolate));
-
-  /**
-   * Debugger is running in its own context which is entered while debugger
-   * messages are being dispatched. This is an explicit getter for this
-   * debugger context. Note that the content of the debugger context is subject
-   * to change. The Context exists only when the debugger is active, i.e. at
-   * least one DebugEventListener or MessageHandler is set.
-   */
-  V8_DEPRECATED("Use v8-inspector",
-                static Local<Context> GetDebugContext(Isolate* isolate));
-
-  /**
-   * While in the debug context, this method returns the top-most non-debug
-   * context, if it exists.
-   */
-  V8_DEPRECATED(
-      "No longer supported",
-      static MaybeLocal<Context> GetDebuggedContext(Isolate* isolate));
-
-  /**
-   * Enable/disable LiveEdit functionality for the given Isolate
-   * (default Isolate if not provided). V8 will abort if LiveEdit is
-   * unexpectedly used. LiveEdit is enabled by default.
-   */
-  V8_DEPRECATED("No longer supported",
-                static void SetLiveEditEnabled(Isolate* isolate, bool enable));
-
-  /**
-   * Returns array of internal properties specific to the value type. Result has
-   * the following format: [<name>, <value>,...,<name>, <value>]. Result array
-   * will be allocated in the current context.
-   */
-  V8_DEPRECATED("No longer supported",
-                static MaybeLocal<Array> GetInternalProperties(
-                    Isolate* isolate, Local<Value> value));
-
-  /**
-   * Defines if the ES2015 tail call elimination feature is enabled or not.
-   * The change of this flag triggers deoptimization of all functions that
-   * contain calls at tail position.
-   */
-  V8_DEPRECATED("No longer supported",
-                static bool IsTailCallEliminationEnabled(Isolate* isolate));
-  V8_DEPRECATED("No longer supported",
-                static void SetTailCallEliminationEnabled(Isolate* isolate,
-                                                          bool enabled));
-};
-
-
-}  // namespace v8
-
-
-#undef EXPORT
-
-
-#endif  // V8_V8_DEBUG_H_
diff --git a/src/v8/infra/config/cq.cfg b/src/v8/infra/config/cq.cfg
deleted file mode 100644
index d57b117..0000000
--- a/src/v8/infra/config/cq.cfg
+++ /dev/null
@@ -1,124 +0,0 @@
-# See http://luci-config.appspot.com/schemas/projects/refs:cq.cfg for the
-# documentation of this file format.
-
-version: 1
-cq_name: "v8"
-cq_status_url: "https://chromium-cq-status.appspot.com"
-git_repo_url: "https://chromium.googlesource.com/v8/v8"
-commit_burst_delay: 60
-max_commit_burst: 1
-
-gerrit {}
-
-verifiers {
-  gerrit_cq_ability {
-    committer_list: "project-v8-committers"
-    dry_run_access_list: "project-v8-tryjob-access"
-  }
-
-  tree_status {
-    tree_status_url: "https://v8-status.appspot.com"
-  }
-
-  try_job {
-    buckets {
-      name: "luci.v8.try"
-      builders { name: "v8_android_arm_compile_rel" }
-      builders { name: "v8_fuchsia_rel_ng" }
-      builders { name: "v8_linux64_asan_rel_ng" }
-      builders {
-        name: "v8_linux64_asan_rel_ng_triggered"
-        triggered_by: "v8_linux64_asan_rel_ng"
-      }
-      builders { name: "v8_linux64_gcc_compile_dbg" }
-      builders { name: "v8_linux64_gyp_rel_ng" }
-      builders {
-        name: "v8_linux64_gyp_rel_ng_triggered"
-        triggered_by: "v8_linux64_gyp_rel_ng"
-      }
-      builders { name: "v8_linux64_rel_ng" }
-      builders {
-        name: "v8_linux64_rel_ng_triggered"
-        triggered_by: "v8_linux64_rel_ng"
-      }
-      builders {
-        name: "v8_linux64_sanitizer_coverage_rel"
-        experiment_percentage: 100
-      }
-      builders { name: "v8_linux64_verify_csa_rel_ng" }
-      builders {
-        name: "v8_linux64_verify_csa_rel_ng_triggered"
-        triggered_by: "v8_linux64_verify_csa_rel_ng"
-      }
-      builders { name: "v8_linux_arm64_rel_ng" }
-      builders {
-        name: "v8_linux_arm64_rel_ng_triggered"
-        triggered_by: "v8_linux_arm64_rel_ng"
-      }
-      builders { name: "v8_linux_arm_rel_ng" }
-      builders {
-        name: "v8_linux_arm_rel_ng_triggered"
-        triggered_by: "v8_linux_arm_rel_ng"
-      }
-      builders {
-        name: "v8_linux_blink_rel"
-        experiment_percentage: 100
-      }
-      builders { name: "v8_linux_chromium_gn_rel" }
-      builders { name: "v8_linux_dbg_ng" }
-      builders {
-        name: "v8_linux_dbg_ng_triggered"
-        triggered_by: "v8_linux_dbg_ng"
-      }
-      builders { name: "v8_linux_gcc_compile_rel" }
-      builders { name: "v8_linux_mips64el_compile_rel" }
-      builders { name: "v8_linux_mipsel_compile_rel" }
-      builders { name: "v8_linux_nodcheck_rel_ng" }
-      builders {
-        name: "v8_linux_nodcheck_rel_ng_triggered"
-        triggered_by: "v8_linux_nodcheck_rel_ng"
-      }
-      builders { name: "v8_linux_rel_ng" }
-      builders {
-        name: "v8_linux_rel_ng_triggered"
-        triggered_by: "v8_linux_rel_ng"
-      }
-      builders { name: "v8_linux_shared_compile_rel" }
-      builders { name: "v8_linux_verify_csa_rel_ng" }
-      builders {
-        name: "v8_linux_verify_csa_rel_ng_triggered"
-        triggered_by: "v8_linux_verify_csa_rel_ng"
-      }
-      builders { name: "v8_mac_rel_ng" }
-      builders {
-        name: "v8_mac_rel_ng_triggered"
-        triggered_by: "v8_mac_rel_ng"
-      }
-      builders { name: "v8_node_linux64_rel" }
-      builders { name: "v8_presubmit" }
-      builders {
-        name: "v8_win64_msvc_compile_rel"
-        experiment_percentage: 20
-      }
-      builders { name: "v8_win64_rel_ng" }
-      builders {
-        name: "v8_win64_rel_ng_triggered"
-        triggered_by: "v8_win64_rel_ng"
-      }
-      builders { name: "v8_win_compile_dbg" }
-      builders { name: "v8_win_nosnap_shared_rel_ng" }
-      builders {
-        name: "v8_win_nosnap_shared_rel_ng_triggered"
-        triggered_by: "v8_win_nosnap_shared_rel_ng"
-      }
-      builders { name: "v8_win_rel_ng" }
-      builders {
-        name: "v8_win_rel_ng_triggered"
-        triggered_by: "v8_win_rel_ng"
-      }
-    }
-  }
-
-  sign_cla {}
-}
-
diff --git a/src/v8/infra/testing/client.v8.pyl b/src/v8/infra/testing/client.v8.pyl
deleted file mode 100644
index ab1744f..0000000
--- a/src/v8/infra/testing/client.v8.pyl
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright 2017 The V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  ### Example configuration for CI bots (please keep as reference).
-  # 'V8 Linux64': [
-  #   {'name': 'benchmarks', 'variant': 'default', 'shards': 1},
-  # ],
-  # 'V8 Linux64 - debug': [
-  #   {'name': 'benchmarks', 'variant': 'default', 'shards': 1},
-  # ],
-
-  'V8 Linux - debug': [
-    {'name': 'd8testing', 'variant': 'code_serializer', 'shards': 1},
-    {'name': 'mozilla', 'variant': 'code_serializer', 'shards': 1},
-    {'name': 'test262_variants', 'variant': 'code_serializer', 'shards': 1},
-    {'name': 'benchmarks', 'variant': 'code_serializer', 'shards': 1},
-  ],
-  'V8 Linux - gc stress': [
-    {'name': 'mjsunit', 'variant': 'slow_path', 'shards': 2},
-  ],
-  'V8 Linux64': [
-    {'name': 'v8testing', 'variant': 'minor_mc', 'shards': 1},
-  ],
-  'V8 Linux64 - debug': [
-    {'name': 'v8testing', 'variant': 'minor_mc', 'shards': 1},
-    {'name': 'v8testing', 'variant': 'slow_path', 'shards': 1},
-  ],
-  'V8 Linux64 ASAN': [
-    {'name': 'v8testing', 'variant': 'slow_path', 'shards': 1},
-  ],
-  'V8 Linux64 TSAN': [
-    {'name': 'v8testing', 'variant': 'slow_path', 'shards': 1},
-  ],
-  'V8 Linux64 - fyi': [
-    {'name': 'v8testing', 'variant': 'infra_staging', 'shards': 1},
-    {'name': 'test262_variants', 'variant': 'infra_staging', 'shards': 2},
-    {'name': 'mjsunit', 'variant': 'stress_sampling', 'shards': 1},
-    {'name': 'webkit', 'variant': 'stress_sampling', 'shards': 1},
-  ],
-  'V8 Linux64 - debug - fyi': [
-    {'name': 'v8testing', 'variant': 'infra_staging', 'shards': 2},
-    {'name': 'test262_variants', 'variant': 'infra_staging', 'shards': 3},
-    {'name': 'mjsunit', 'variant': 'stress_sampling', 'shards': 1},
-    {'name': 'webkit', 'variant': 'stress_sampling', 'shards': 1},
-  ],
-}
diff --git a/src/v8/infra/testing/tryserver.v8.pyl b/src/v8/infra/testing/tryserver.v8.pyl
deleted file mode 100644
index ee6abae..0000000
--- a/src/v8/infra/testing/tryserver.v8.pyl
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2017 The V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  ### Example configuration for trybots (please keep as reference).
-  # 'v8_linux64_rel_ng_triggered': [
-  #   {'name': 'benchmarks', 'variant': 'default', 'shards': 1},
-  # ],
-
-  'v8_linux64_fyi_rel_ng_triggered': [
-    {'name': 'v8testing', 'variant': 'infra_staging', 'shards': 2},
-    {'name': 'test262_variants', 'variant': 'infra_staging', 'shards': 2},
-    {'name': 'mjsunit', 'variant': 'stress_sampling', 'shards': 1},
-    {'name': 'webkit', 'variant': 'stress_sampling', 'shards': 1},
-  ],
-  'v8_linux64_rel_ng_triggered': [
-    {'name': 'v8testing', 'variant': 'minor_mc', 'shards': 1},
-    {'name': 'v8testing', 'variant': 'slow_path', 'shards': 1},
-  ],
-  'v8_linux_gc_stress_dbg': [
-    {'name': 'mjsunit', 'variant': 'slow_path', 'shards': 2},
-  ],
-  'v8_linux64_asan_rel_ng_triggered': [
-    {'name': 'v8testing', 'variant': 'slow_path', 'shards': 1},
-  ],
-  'v8_linux64_tsan_rel': [
-    {'name': 'v8testing', 'variant': 'slow_path', 'shards': 1},
-  ],
-}
diff --git a/src/v8/samples/samples.gyp b/src/v8/samples/samples.gyp
deleted file mode 100644
index e7c26cf..0000000
--- a/src/v8/samples/samples.gyp
+++ /dev/null
@@ -1,84 +0,0 @@
-# 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_code': 1,
-    'v8_enable_i18n_support%': 1,
-    'v8_toolset_for_shell%': 'target',
-  },
-  'includes': ['../gypfiles/toolchain.gypi', '../gypfiles/features.gypi'],
-  'target_defaults': {
-    'type': 'executable',
-    'dependencies': [
-      '../src/v8.gyp:v8',
-      '../src/v8.gyp:v8_libbase',
-      '../src/v8.gyp:v8_libplatform',
-    ],
-    'include_dirs': [
-      '..',
-    ],
-    'conditions': [
-      ['v8_enable_i18n_support==1', {
-        'dependencies': [
-          '<(icu_gyp_path):icui18n',
-          '<(icu_gyp_path):icuuc',
-        ],
-      }],
-      ['OS=="win" and v8_enable_i18n_support==1', {
-        'dependencies': [
-          '<(icu_gyp_path):icudata',
-        ],
-      }],
-    ],
-  },
-  'targets': [
-    {
-      'target_name': 'v8_shell',
-      'sources': [
-        'shell.cc',
-      ],
-      'conditions': [
-        [ 'want_separate_host_toolset==1', {
-          'toolsets': [ '<(v8_toolset_for_shell)', ],
-        }],
-      ],
-    },
-    {
-      'target_name': 'hello-world',
-      'sources': [
-        'hello-world.cc',
-      ],
-    },
-    {
-      'target_name': 'process',
-      'sources': [
-        'process.cc',
-      ],
-    },
-  ],
-}
diff --git a/src/v8/snapshot_toolchain.gni b/src/v8/snapshot_toolchain.gni
deleted file mode 100644
index 756413e..0000000
--- a/src/v8/snapshot_toolchain.gni
+++ /dev/null
@@ -1,103 +0,0 @@
-# Copyright 2015 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.
-
-import("//build/config/v8_target_cpu.gni")
-
-declare_args() {
-  # The v8 snapshot needs to be built by code that is compiled with a
-  # toolchain that matches the bit-width of the target CPU, but runs on
-  # the host.
-  v8_snapshot_toolchain = ""
-}
-
-# Try to infer the appropriate snapshot toolchain for the v8_current_cpu
-# where possible.
-#
-# Assume that v8_target_cpu (and hence v8_current_cpu) has been validated
-# as supported on the current host CPU and OS in v8_target_cpu.gni. The
-# logic below is complicated enough without also needing to do input
-# validation.
-#
-# There are test cases for this code posted as an attachment to
-# https://crbug.com/625353.
-#
-# TODO(GYP): Currently only regular (non-cross) compiles, and cross-compiles
-# from x64 hosts to Intel, ARM, or MIPS targets, are implemented. Add support
-# for the other supported configurations.
-
-if (v8_snapshot_toolchain == "") {
-  if (current_os == host_os && current_cpu == host_cpu) {
-    # This is not a cross-compile, so build the snapshot with the current
-    # toolchain.
-    v8_snapshot_toolchain = current_toolchain
-  } else if (current_os == host_os && current_cpu == "x86" &&
-             host_cpu == "x64") {
-    # This is an x64 -> x86 cross-compile, but x64 hosts can usually run x86
-    # binaries built for the same OS, so build the snapshot with the current
-    # toolchain here, too.
-    v8_snapshot_toolchain = current_toolchain
-  } else if (current_os == "win" && host_os == "mac" && is_clang) {
-    # This is a mac -> win cross-compile, which is only supported w/ clang.
-    v8_snapshot_toolchain = "//build/toolchain/mac:clang_${v8_current_cpu}"
-  } else if (host_cpu == "x64" &&
-             (v8_current_cpu == "mips" || v8_current_cpu == "mips64")) {
-    # We don't support snapshot generation for big-endian targets,
-    # therefore snapshots will need to be built using native mksnapshot
-    # in combination with qemu
-    v8_snapshot_toolchain = current_toolchain
-  } else if (host_cpu == "x64") {
-    # This is a cross-compile from an x64 host to either a non-Intel target
-    # cpu or a different target OS. Clang will always be used by default on the
-    # host, unless this is a ChromeOS build, in which case the same toolchain
-    # (Clang or GCC) will be used for target and host by default.
-    if (is_chromeos && !is_clang) {
-      _clang = ""
-    } else {
-      _clang = "clang_"
-    }
-
-    if (v8_current_cpu == "x64" || v8_current_cpu == "x86") {
-      _cpus = v8_current_cpu
-    } else if (v8_current_cpu == "arm64" || v8_current_cpu == "mips64el") {
-      _cpus = "x64_v8_${v8_current_cpu}"
-    } else if (v8_current_cpu == "arm" || v8_current_cpu == "mipsel") {
-      _cpus = "x86_v8_${v8_current_cpu}"
-    } else {
-      # This branch should not be reached; leave _cpus blank so the assert
-      # below will fail.
-      _cpus = ""
-    }
-
-    if (_cpus != "") {
-      v8_snapshot_toolchain = "//build/toolchain/${host_os}:${_clang}${_cpus}"
-    }
-  }
-}
-
-assert(v8_snapshot_toolchain != "",
-       "Do not know how to build a snapshot for $current_toolchain " +
-           "on $host_os $host_cpu")
diff --git a/src/v8/src/arm/assembler-arm-inl.h b/src/v8/src/arm/assembler-arm-inl.h
deleted file mode 100644
index f420f2e..0000000
--- a/src/v8/src/arm/assembler-arm-inl.h
+++ /dev/null
@@ -1,390 +0,0 @@
-// Copyright (c) 1994-2006 Sun Microsystems Inc.
-// 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.
-//
-// - Redistribution 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 Sun Microsystems or the names of 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.
-
-// The original source code covered by the above license above has been modified
-// significantly by Google Inc.
-// Copyright 2012 the V8 project authors. All rights reserved.
-
-#ifndef V8_ARM_ASSEMBLER_ARM_INL_H_
-#define V8_ARM_ASSEMBLER_ARM_INL_H_
-
-#include "src/arm/assembler-arm.h"
-
-#include "src/assembler.h"
-#include "src/debug/debug.h"
-#include "src/objects-inl.h"
-
-namespace v8 {
-namespace internal {
-
-bool CpuFeatures::SupportsCrankshaft() { return true; }
-
-bool CpuFeatures::SupportsWasmSimd128() { return IsSupported(NEON); }
-
-int DoubleRegister::NumRegisters() {
-  return CpuFeatures::IsSupported(VFP32DREGS) ? 32 : 16;
-}
-
-
-void RelocInfo::apply(intptr_t delta) {
-  if (RelocInfo::IsInternalReference(rmode_)) {
-    // absolute code pointer inside code object moves with the code object.
-    int32_t* p = reinterpret_cast<int32_t*>(pc_);
-    *p += delta;  // relocate entry
-  }
-  // We do not use pc relative addressing on ARM, so there is
-  // nothing else to do.
-}
-
-
-Address RelocInfo::target_address() {
-  DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) || IsWasmCall(rmode_));
-  return Assembler::target_address_at(pc_, constant_pool_);
-}
-
-Address RelocInfo::target_address_address() {
-  DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) || IsWasmCall(rmode_) ||
-         rmode_ == EMBEDDED_OBJECT || rmode_ == EXTERNAL_REFERENCE);
-  if (Assembler::IsMovW(Memory::int32_at(pc_))) {
-    return reinterpret_cast<Address>(pc_);
-  } else {
-    DCHECK(Assembler::IsLdrPcImmediateOffset(Memory::int32_at(pc_)));
-    return constant_pool_entry_address();
-  }
-}
-
-
-Address RelocInfo::constant_pool_entry_address() {
-  DCHECK(IsInConstantPool());
-  return Assembler::constant_pool_entry_address(pc_, constant_pool_);
-}
-
-
-int RelocInfo::target_address_size() {
-  return kPointerSize;
-}
-
-HeapObject* RelocInfo::target_object() {
-  DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
-  return HeapObject::cast(reinterpret_cast<Object*>(
-      Assembler::target_address_at(pc_, constant_pool_)));
-}
-
-Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
-  DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
-  return Handle<HeapObject>(reinterpret_cast<HeapObject**>(
-      Assembler::target_address_at(pc_, constant_pool_)));
-}
-
-void RelocInfo::set_target_object(HeapObject* target,
-                                  WriteBarrierMode write_barrier_mode,
-                                  ICacheFlushMode icache_flush_mode) {
-  DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
-  Assembler::set_target_address_at(target->GetIsolate(), pc_, constant_pool_,
-                                   reinterpret_cast<Address>(target),
-                                   icache_flush_mode);
-  if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != nullptr) {
-    host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(host(), this,
-                                                                  target);
-    host()->GetHeap()->RecordWriteIntoCode(host(), this, target);
-  }
-}
-
-
-Address RelocInfo::target_external_reference() {
-  DCHECK(rmode_ == EXTERNAL_REFERENCE);
-  return Assembler::target_address_at(pc_, constant_pool_);
-}
-
-
-Address RelocInfo::target_internal_reference() {
-  DCHECK(rmode_ == INTERNAL_REFERENCE);
-  return Memory::Address_at(pc_);
-}
-
-
-Address RelocInfo::target_internal_reference_address() {
-  DCHECK(rmode_ == INTERNAL_REFERENCE);
-  return reinterpret_cast<Address>(pc_);
-}
-
-
-Address RelocInfo::target_runtime_entry(Assembler* origin) {
-  DCHECK(IsRuntimeEntry(rmode_));
-  return target_address();
-}
-
-void RelocInfo::set_target_runtime_entry(Isolate* isolate, Address target,
-                                         WriteBarrierMode write_barrier_mode,
-                                         ICacheFlushMode icache_flush_mode) {
-  DCHECK(IsRuntimeEntry(rmode_));
-  if (target_address() != target)
-    set_target_address(isolate, target, write_barrier_mode, icache_flush_mode);
-}
-
-void RelocInfo::WipeOut(Isolate* isolate) {
-  DCHECK(IsEmbeddedObject(rmode_) || IsCodeTarget(rmode_) ||
-         IsRuntimeEntry(rmode_) || IsExternalReference(rmode_) ||
-         IsInternalReference(rmode_));
-  if (IsInternalReference(rmode_)) {
-    Memory::Address_at(pc_) = nullptr;
-  } else {
-    Assembler::set_target_address_at(isolate, pc_, constant_pool_, nullptr);
-  }
-}
-
-template <typename ObjectVisitor>
-void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) {
-  RelocInfo::Mode mode = rmode();
-  if (mode == RelocInfo::EMBEDDED_OBJECT) {
-    visitor->VisitEmbeddedPointer(host(), this);
-  } else if (RelocInfo::IsCodeTarget(mode)) {
-    visitor->VisitCodeTarget(host(), this);
-  } else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
-    visitor->VisitExternalReference(host(), this);
-  } else if (mode == RelocInfo::INTERNAL_REFERENCE) {
-    visitor->VisitInternalReference(host(), this);
-  } else if (RelocInfo::IsRuntimeEntry(mode)) {
-    visitor->VisitRuntimeEntry(host(), this);
-  }
-}
-
-Operand::Operand(int32_t immediate, RelocInfo::Mode rmode) : rmode_(rmode) {
-  value_.immediate = immediate;
-}
-
-Operand Operand::Zero() { return Operand(static_cast<int32_t>(0)); }
-
-Operand::Operand(const ExternalReference& f)
-    : rmode_(RelocInfo::EXTERNAL_REFERENCE) {
-  value_.immediate = reinterpret_cast<int32_t>(f.address());
-}
-
-Operand::Operand(Smi* value) : rmode_(RelocInfo::NONE32) {
-  value_.immediate = reinterpret_cast<intptr_t>(value);
-}
-
-Operand::Operand(Register rm) : rm_(rm), shift_op_(LSL), shift_imm_(0) {}
-
-void Assembler::CheckBuffer() {
-  if (buffer_space() <= kGap) {
-    GrowBuffer();
-  }
-  MaybeCheckConstPool();
-}
-
-
-void Assembler::emit(Instr x) {
-  CheckBuffer();
-  *reinterpret_cast<Instr*>(pc_) = x;
-  pc_ += kInstrSize;
-}
-
-
-Address Assembler::target_address_from_return_address(Address pc) {
-  // Returns the address of the call target from the return address that will
-  // be returned to after a call.
-  // Call sequence on V7 or later is:
-  //  movw  ip, #... @ call address low 16
-  //  movt  ip, #... @ call address high 16
-  //  blx   ip
-  //                      @ return address
-  // For V6 when the constant pool is unavailable, it is:
-  //  mov  ip, #...     @ call address low 8
-  //  orr  ip, ip, #... @ call address 2nd 8
-  //  orr  ip, ip, #... @ call address 3rd 8
-  //  orr  ip, ip, #... @ call address high 8
-  //  blx   ip
-  //                      @ return address
-  // In cases that need frequent patching, the address is in the
-  // constant pool.  It could be a small constant pool load:
-  //  ldr   ip, [pc, #...] @ call address
-  //  blx   ip
-  //                      @ return address
-  Address candidate = pc - 2 * Assembler::kInstrSize;
-  Instr candidate_instr(Memory::int32_at(candidate));
-  if (IsLdrPcImmediateOffset(candidate_instr)) {
-    return candidate;
-  } else {
-    if (CpuFeatures::IsSupported(ARMv7)) {
-      candidate -= 1 * Assembler::kInstrSize;
-      DCHECK(IsMovW(Memory::int32_at(candidate)) &&
-             IsMovT(Memory::int32_at(candidate + Assembler::kInstrSize)));
-    } else {
-      candidate -= 3 * Assembler::kInstrSize;
-      DCHECK(
-          IsMovImmed(Memory::int32_at(candidate)) &&
-          IsOrrImmed(Memory::int32_at(candidate + Assembler::kInstrSize)) &&
-          IsOrrImmed(Memory::int32_at(candidate + 2 * Assembler::kInstrSize)) &&
-          IsOrrImmed(Memory::int32_at(candidate + 3 * Assembler::kInstrSize)));
-    }
-    return candidate;
-  }
-}
-
-
-Address Assembler::return_address_from_call_start(Address pc) {
-  if (IsLdrPcImmediateOffset(Memory::int32_at(pc))) {
-    // Load from constant pool, small section.
-    return pc + kInstrSize * 2;
-  } else {
-    if (CpuFeatures::IsSupported(ARMv7)) {
-      DCHECK(IsMovW(Memory::int32_at(pc)));
-      DCHECK(IsMovT(Memory::int32_at(pc + kInstrSize)));
-      // A movw / movt load immediate.
-      return pc + kInstrSize * 3;
-    } else {
-      DCHECK(IsMovImmed(Memory::int32_at(pc)));
-      DCHECK(IsOrrImmed(Memory::int32_at(pc + kInstrSize)));
-      DCHECK(IsOrrImmed(Memory::int32_at(pc + 2 * kInstrSize)));
-      DCHECK(IsOrrImmed(Memory::int32_at(pc + 3 * kInstrSize)));
-      // A mov / orr load immediate.
-      return pc + kInstrSize * 5;
-    }
-  }
-}
-
-
-void Assembler::deserialization_set_special_target_at(
-    Isolate* isolate, Address constant_pool_entry, Code* code, Address target) {
-  Memory::Address_at(constant_pool_entry) = target;
-}
-
-
-void Assembler::deserialization_set_target_internal_reference_at(
-    Isolate* isolate, Address pc, Address target, RelocInfo::Mode mode) {
-  Memory::Address_at(pc) = target;
-}
-
-
-bool Assembler::is_constant_pool_load(Address pc) {
-  return IsLdrPcImmediateOffset(Memory::int32_at(pc));
-}
-
-
-Address Assembler::constant_pool_entry_address(Address pc,
-                                               Address constant_pool) {
-  DCHECK(Assembler::IsLdrPcImmediateOffset(Memory::int32_at(pc)));
-  Instr instr = Memory::int32_at(pc);
-  return pc + GetLdrRegisterImmediateOffset(instr) + kPcLoadDelta;
-}
-
-
-Address Assembler::target_address_at(Address pc, Address constant_pool) {
-  if (is_constant_pool_load(pc)) {
-    // This is a constant pool lookup. Return the value in the constant pool.
-    return Memory::Address_at(constant_pool_entry_address(pc, constant_pool));
-  } else if (CpuFeatures::IsSupported(ARMv7)) {
-    // This is an movw / movt immediate load. Return the immediate.
-    DCHECK(IsMovW(Memory::int32_at(pc)) &&
-           IsMovT(Memory::int32_at(pc + kInstrSize)));
-    Instruction* movw_instr = Instruction::At(pc);
-    Instruction* movt_instr = Instruction::At(pc + kInstrSize);
-    return reinterpret_cast<Address>(
-        (movt_instr->ImmedMovwMovtValue() << 16) |
-         movw_instr->ImmedMovwMovtValue());
-  } else {
-    // This is an mov / orr immediate load. Return the immediate.
-    DCHECK(IsMovImmed(Memory::int32_at(pc)) &&
-           IsOrrImmed(Memory::int32_at(pc + kInstrSize)) &&
-           IsOrrImmed(Memory::int32_at(pc + 2 * kInstrSize)) &&
-           IsOrrImmed(Memory::int32_at(pc + 3 * kInstrSize)));
-    Instr mov_instr = instr_at(pc);
-    Instr orr_instr_1 = instr_at(pc + kInstrSize);
-    Instr orr_instr_2 = instr_at(pc + 2 * kInstrSize);
-    Instr orr_instr_3 = instr_at(pc + 3 * kInstrSize);
-    Address ret = reinterpret_cast<Address>(
-        DecodeShiftImm(mov_instr) | DecodeShiftImm(orr_instr_1) |
-        DecodeShiftImm(orr_instr_2) | DecodeShiftImm(orr_instr_3));
-    return ret;
-  }
-}
-
-
-void Assembler::set_target_address_at(Isolate* isolate, Address pc,
-                                      Address constant_pool, Address target,
-                                      ICacheFlushMode icache_flush_mode) {
-  DCHECK_IMPLIES(isolate == nullptr, icache_flush_mode == SKIP_ICACHE_FLUSH);
-  if (is_constant_pool_load(pc)) {
-    // This is a constant pool lookup. Update the entry in the constant pool.
-    Memory::Address_at(constant_pool_entry_address(pc, constant_pool)) = target;
-    // Intuitively, we would think it is necessary to always flush the
-    // instruction cache after patching a target address in the code as follows:
-    //   Assembler::FlushICache(isolate, pc, sizeof(target));
-    // However, on ARM, no instruction is actually patched in the case
-    // of embedded constants of the form:
-    // ldr   ip, [pp, #...]
-    // since the instruction accessing this address in the constant pool remains
-    // unchanged.
-  } else if (CpuFeatures::IsSupported(ARMv7)) {
-    // This is an movw / movt immediate load. Patch the immediate embedded in
-    // the instructions.
-    DCHECK(IsMovW(Memory::int32_at(pc)));
-    DCHECK(IsMovT(Memory::int32_at(pc + kInstrSize)));
-    uint32_t* instr_ptr = reinterpret_cast<uint32_t*>(pc);
-    uint32_t immediate = reinterpret_cast<uint32_t>(target);
-    instr_ptr[0] = PatchMovwImmediate(instr_ptr[0], immediate & 0xFFFF);
-    instr_ptr[1] = PatchMovwImmediate(instr_ptr[1], immediate >> 16);
-    DCHECK(IsMovW(Memory::int32_at(pc)));
-    DCHECK(IsMovT(Memory::int32_at(pc + kInstrSize)));
-    if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
-      Assembler::FlushICache(isolate, pc, 2 * kInstrSize);
-    }
-  } else {
-    // This is an mov / orr immediate load. Patch the immediate embedded in
-    // the instructions.
-    DCHECK(IsMovImmed(Memory::int32_at(pc)) &&
-           IsOrrImmed(Memory::int32_at(pc + kInstrSize)) &&
-           IsOrrImmed(Memory::int32_at(pc + 2 * kInstrSize)) &&
-           IsOrrImmed(Memory::int32_at(pc + 3 * kInstrSize)));
-    uint32_t* instr_ptr = reinterpret_cast<uint32_t*>(pc);
-    uint32_t immediate = reinterpret_cast<uint32_t>(target);
-    instr_ptr[0] = PatchShiftImm(instr_ptr[0], immediate & kImm8Mask);
-    instr_ptr[1] = PatchShiftImm(instr_ptr[1], immediate & (kImm8Mask << 8));
-    instr_ptr[2] = PatchShiftImm(instr_ptr[2], immediate & (kImm8Mask << 16));
-    instr_ptr[3] = PatchShiftImm(instr_ptr[3], immediate & (kImm8Mask << 24));
-    DCHECK(IsMovImmed(Memory::int32_at(pc)) &&
-           IsOrrImmed(Memory::int32_at(pc + kInstrSize)) &&
-           IsOrrImmed(Memory::int32_at(pc + 2 * kInstrSize)) &&
-           IsOrrImmed(Memory::int32_at(pc + 3 * kInstrSize)));
-    if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
-      Assembler::FlushICache(isolate, pc, 4 * kInstrSize);
-    }
-  }
-}
-
-EnsureSpace::EnsureSpace(Assembler* assembler) { assembler->CheckBuffer(); }
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_ARM_ASSEMBLER_ARM_INL_H_
diff --git a/src/v8/src/arm/assembler-arm.cc b/src/v8/src/arm/assembler-arm.cc
deleted file mode 100644
index a615d67..0000000
--- a/src/v8/src/arm/assembler-arm.cc
+++ /dev/null
@@ -1,5500 +0,0 @@
-// Copyright (c) 1994-2006 Sun Microsystems Inc.
-// 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.
-//
-// - Redistribution 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 Sun Microsystems or the names of 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.
-
-// The original source code covered by the above license above has been
-// modified significantly by Google Inc.
-// Copyright 2012 the V8 project authors. All rights reserved.
-
-#include "src/arm/assembler-arm.h"
-
-#if V8_TARGET_ARCH_ARM
-
-#include "src/arm/assembler-arm-inl.h"
-#include "src/assembler-inl.h"
-#include "src/base/bits.h"
-#include "src/base/cpu.h"
-#include "src/code-stubs.h"
-#include "src/macro-assembler.h"
-#include "src/objects-inl.h"
-
-namespace v8 {
-namespace internal {
-
-static const unsigned kArmv6 = 0u;
-static const unsigned kArmv7 = kArmv6 | (1u << ARMv7);
-static const unsigned kArmv7WithSudiv = kArmv7 | (1u << ARMv7_SUDIV);
-static const unsigned kArmv8 = kArmv7WithSudiv | (1u << ARMv8);
-
-static unsigned CpuFeaturesFromCommandLine() {
-  unsigned result;
-  if (strcmp(FLAG_arm_arch, "armv8") == 0) {
-    result = kArmv8;
-  } else if (strcmp(FLAG_arm_arch, "armv7+sudiv") == 0) {
-    result = kArmv7WithSudiv;
-  } else if (strcmp(FLAG_arm_arch, "armv7") == 0) {
-    result = kArmv7;
-  } else if (strcmp(FLAG_arm_arch, "armv6") == 0) {
-    result = kArmv6;
-  } else {
-    fprintf(stderr, "Error: unrecognised value for --arm-arch ('%s').\n",
-            FLAG_arm_arch);
-    fprintf(stderr,
-            "Supported values are:  armv8\n"
-            "                       armv7+sudiv\n"
-            "                       armv7\n"
-            "                       armv6\n");
-    FATAL("arm-arch");
-  }
-
-  // If any of the old (deprecated) flags are specified, print a warning, but
-  // otherwise try to respect them for now.
-  // TODO(jbramley): When all the old bots have been updated, remove this.
-  if (FLAG_enable_armv7.has_value || FLAG_enable_vfp3.has_value ||
-      FLAG_enable_32dregs.has_value || FLAG_enable_neon.has_value ||
-      FLAG_enable_sudiv.has_value || FLAG_enable_armv8.has_value) {
-    // As an approximation of the old behaviour, set the default values from the
-    // arm_arch setting, then apply the flags over the top.
-    bool enable_armv7 = (result & (1u << ARMv7)) != 0;
-    bool enable_vfp3 = (result & (1u << ARMv7)) != 0;
-    bool enable_32dregs = (result & (1u << ARMv7)) != 0;
-    bool enable_neon = (result & (1u << ARMv7)) != 0;
-    bool enable_sudiv = (result & (1u << ARMv7_SUDIV)) != 0;
-    bool enable_armv8 = (result & (1u << ARMv8)) != 0;
-    if (FLAG_enable_armv7.has_value) {
-      fprintf(stderr,
-              "Warning: --enable_armv7 is deprecated. "
-              "Use --arm_arch instead.\n");
-      enable_armv7 = FLAG_enable_armv7.value;
-    }
-    if (FLAG_enable_vfp3.has_value) {
-      fprintf(stderr,
-              "Warning: --enable_vfp3 is deprecated. "
-              "Use --arm_arch instead.\n");
-      enable_vfp3 = FLAG_enable_vfp3.value;
-    }
-    if (FLAG_enable_32dregs.has_value) {
-      fprintf(stderr,
-              "Warning: --enable_32dregs is deprecated. "
-              "Use --arm_arch instead.\n");
-      enable_32dregs = FLAG_enable_32dregs.value;
-    }
-    if (FLAG_enable_neon.has_value) {
-      fprintf(stderr,
-              "Warning: --enable_neon is deprecated. "
-              "Use --arm_arch instead.\n");
-      enable_neon = FLAG_enable_neon.value;
-    }
-    if (FLAG_enable_sudiv.has_value) {
-      fprintf(stderr,
-              "Warning: --enable_sudiv is deprecated. "
-              "Use --arm_arch instead.\n");
-      enable_sudiv = FLAG_enable_sudiv.value;
-    }
-    if (FLAG_enable_armv8.has_value) {
-      fprintf(stderr,
-              "Warning: --enable_armv8 is deprecated. "
-              "Use --arm_arch instead.\n");
-      enable_armv8 = FLAG_enable_armv8.value;
-    }
-    // Emulate the old implications.
-    if (enable_armv8) {
-      enable_vfp3 = true;
-      enable_neon = true;
-      enable_32dregs = true;
-      enable_sudiv = true;
-    }
-    // Select the best available configuration.
-    if (enable_armv7 && enable_vfp3 && enable_32dregs && enable_neon) {
-      if (enable_sudiv) {
-        if (enable_armv8) {
-          result = kArmv8;
-        } else {
-          result = kArmv7WithSudiv;
-        }
-      } else {
-        result = kArmv7;
-      }
-    } else {
-      result = kArmv6;
-    }
-  }
-  return result;
-}
-
-// Get the CPU features enabled by the build.
-// For cross compilation the preprocessor symbols such as
-// CAN_USE_ARMV7_INSTRUCTIONS and CAN_USE_VFP3_INSTRUCTIONS can be used to
-// enable ARMv7 and VFPv3 instructions when building the snapshot. However,
-// these flags should be consistent with a supported ARM configuration:
-//  "armv6":       ARMv6 + VFPv2
-//  "armv7":       ARMv7 + VFPv3-D32 + NEON
-//  "armv7+sudiv": ARMv7 + VFPv4-D32 + NEON + SUDIV
-//  "armv8":       ARMv8 (+ all of the above)
-static constexpr unsigned CpuFeaturesFromCompiler() {
-// TODO(jbramley): Once the build flags are simplified, these tests should
-// also be simplified.
-
-// Check *architectural* implications.
-#if defined(CAN_USE_ARMV8_INSTRUCTIONS) && !defined(CAN_USE_ARMV7_INSTRUCTIONS)
-#error "CAN_USE_ARMV8_INSTRUCTIONS should imply CAN_USE_ARMV7_INSTRUCTIONS"
-#endif
-#if defined(CAN_USE_ARMV8_INSTRUCTIONS) && !defined(CAN_USE_SUDIV)
-#error "CAN_USE_ARMV8_INSTRUCTIONS should imply CAN_USE_SUDIV"
-#endif
-#if defined(CAN_USE_ARMV7_INSTRUCTIONS) != defined(CAN_USE_VFP3_INSTRUCTIONS)
-// V8 requires VFP, and all ARMv7 devices with VFP have VFPv3. Similarly,
-// VFPv3 isn't available before ARMv7.
-#error "CAN_USE_ARMV7_INSTRUCTIONS should match CAN_USE_VFP3_INSTRUCTIONS"
-#endif
-#if defined(CAN_USE_NEON) && !defined(CAN_USE_ARMV7_INSTRUCTIONS)
-#error "CAN_USE_NEON should imply CAN_USE_ARMV7_INSTRUCTIONS"
-#endif
-
-// Find compiler-implied features.
-#if defined(CAN_USE_ARMV8_INSTRUCTIONS) &&                           \
-    defined(CAN_USE_ARMV7_INSTRUCTIONS) && defined(CAN_USE_SUDIV) && \
-    defined(CAN_USE_NEON) && defined(CAN_USE_VFP3_INSTRUCTIONS)
-  return kArmv8;
-#elif defined(CAN_USE_ARMV7_INSTRUCTIONS) && defined(CAN_USE_SUDIV) && \
-    defined(CAN_USE_NEON) && defined(CAN_USE_VFP3_INSTRUCTIONS)
-  return kArmv7WithSudiv;
-#elif defined(CAN_USE_ARMV7_INSTRUCTIONS) && defined(CAN_USE_NEON) && \
-    defined(CAN_USE_VFP3_INSTRUCTIONS)
-  return kArmv7;
-#else
-  return kArmv6;
-#endif
-}
-
-
-void CpuFeatures::ProbeImpl(bool cross_compile) {
-  dcache_line_size_ = 64;
-
-  unsigned command_line = CpuFeaturesFromCommandLine();
-  // Only use statically determined features for cross compile (snapshot).
-  if (cross_compile) {
-    supported_ |= command_line & CpuFeaturesFromCompiler();
-    return;
-  }
-
-#ifndef __arm__
-  // For the simulator build, use whatever the flags specify.
-  supported_ |= command_line;
-
-#else  // __arm__
-  // Probe for additional features at runtime.
-  base::CPU cpu;
-  // Runtime detection is slightly fuzzy, and some inferences are necessary.
-  unsigned runtime = kArmv6;
-  // NEON and VFPv3 imply at least ARMv7-A.
-  if (cpu.has_neon() && cpu.has_vfp3_d32()) {
-    DCHECK(cpu.has_vfp3());
-    runtime |= kArmv7;
-    if (cpu.has_idiva()) {
-      runtime |= kArmv7WithSudiv;
-      if (cpu.architecture() >= 8) {
-        runtime |= kArmv8;
-      }
-    }
-  }
-
-  // Use the best of the features found by CPU detection and those inferred from
-  // the build system. In both cases, restrict available features using the
-  // command-line. Note that the command-line flags are very permissive (kArmv8)
-  // by default.
-  supported_ |= command_line & CpuFeaturesFromCompiler();
-  supported_ |= command_line & runtime;
-
-  // Additional tuning options.
-
-  // ARM Cortex-A9 and Cortex-A5 have 32 byte cachelines.
-  if (cpu.implementer() == base::CPU::ARM &&
-      (cpu.part() == base::CPU::ARM_CORTEX_A5 ||
-       cpu.part() == base::CPU::ARM_CORTEX_A9)) {
-    dcache_line_size_ = 32;
-  }
-#endif
-
-  DCHECK_IMPLIES(IsSupported(ARMv7_SUDIV), IsSupported(ARMv7));
-  DCHECK_IMPLIES(IsSupported(ARMv8), IsSupported(ARMv7_SUDIV));
-}
-
-
-void CpuFeatures::PrintTarget() {
-  const char* arm_arch = nullptr;
-  const char* arm_target_type = "";
-  const char* arm_no_probe = "";
-  const char* arm_fpu = "";
-  const char* arm_thumb = "";
-  const char* arm_float_abi = nullptr;
-
-#if !defined __arm__
-  arm_target_type = " simulator";
-#endif
-
-#if defined ARM_TEST_NO_FEATURE_PROBE
-  arm_no_probe = " noprobe";
-#endif
-
-#if defined CAN_USE_ARMV8_INSTRUCTIONS
-  arm_arch = "arm v8";
-#elif defined CAN_USE_ARMV7_INSTRUCTIONS
-  arm_arch = "arm v7";
-#else
-  arm_arch = "arm v6";
-#endif
-
-#if defined CAN_USE_NEON
-  arm_fpu = " neon";
-#elif defined CAN_USE_VFP3_INSTRUCTIONS
-#  if defined CAN_USE_VFP32DREGS
-  arm_fpu = " vfp3";
-#  else
-  arm_fpu = " vfp3-d16";
-#  endif
-#else
-  arm_fpu = " vfp2";
-#endif
-
-#ifdef __arm__
-  arm_float_abi = base::OS::ArmUsingHardFloat() ? "hard" : "softfp";
-#elif USE_EABI_HARDFLOAT
-  arm_float_abi = "hard";
-#else
-  arm_float_abi = "softfp";
-#endif
-
-#if defined __arm__ && (defined __thumb__) || (defined __thumb2__)
-  arm_thumb = " thumb";
-#endif
-
-  printf("target%s%s %s%s%s %s\n",
-         arm_target_type, arm_no_probe, arm_arch, arm_fpu, arm_thumb,
-         arm_float_abi);
-}
-
-
-void CpuFeatures::PrintFeatures() {
-  printf("ARMv8=%d ARMv7=%d VFPv3=%d VFP32DREGS=%d NEON=%d SUDIV=%d",
-         CpuFeatures::IsSupported(ARMv8), CpuFeatures::IsSupported(ARMv7),
-         CpuFeatures::IsSupported(VFPv3), CpuFeatures::IsSupported(VFP32DREGS),
-         CpuFeatures::IsSupported(NEON), CpuFeatures::IsSupported(SUDIV));
-#ifdef __arm__
-  bool eabi_hardfloat = base::OS::ArmUsingHardFloat();
-#elif USE_EABI_HARDFLOAT
-  bool eabi_hardfloat = true;
-#else
-  bool eabi_hardfloat = false;
-#endif
-  printf(" USE_EABI_HARDFLOAT=%d\n", eabi_hardfloat);
-}
-
-
-// -----------------------------------------------------------------------------
-// Implementation of RelocInfo
-
-// static
-const int RelocInfo::kApplyMask = 0;
-
-
-bool RelocInfo::IsCodedSpecially() {
-  // The deserializer needs to know whether a pointer is specially coded.  Being
-  // specially coded on ARM means that it is a movw/movt instruction. We don't
-  // generate those for relocatable pointers.
-  return false;
-}
-
-
-bool RelocInfo::IsInConstantPool() {
-  return Assembler::is_constant_pool_load(pc_);
-}
-
-Address RelocInfo::embedded_address() const {
-  return Assembler::target_address_at(pc_, constant_pool_);
-}
-
-uint32_t RelocInfo::embedded_size() const {
-  return reinterpret_cast<uint32_t>(
-      Assembler::target_address_at(pc_, constant_pool_));
-}
-
-void RelocInfo::set_embedded_address(Isolate* isolate, Address address,
-                                     ICacheFlushMode flush_mode) {
-  Assembler::set_target_address_at(isolate, pc_, constant_pool_, address,
-                                   flush_mode);
-}
-
-void RelocInfo::set_embedded_size(Isolate* isolate, uint32_t size,
-                                  ICacheFlushMode flush_mode) {
-  Assembler::set_target_address_at(isolate, pc_, constant_pool_,
-                                   reinterpret_cast<Address>(size), flush_mode);
-}
-
-void RelocInfo::set_js_to_wasm_address(Isolate* isolate, Address address,
-                                       ICacheFlushMode icache_flush_mode) {
-  DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
-  set_embedded_address(isolate, address, icache_flush_mode);
-}
-
-Address RelocInfo::js_to_wasm_address() const {
-  DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
-  return embedded_address();
-}
-
-// -----------------------------------------------------------------------------
-// Implementation of Operand and MemOperand
-// See assembler-arm-inl.h for inlined constructors
-
-Operand::Operand(Handle<HeapObject> handle) {
-  rm_ = no_reg;
-  value_.immediate = reinterpret_cast<intptr_t>(handle.address());
-  rmode_ = RelocInfo::EMBEDDED_OBJECT;
-}
-
-
-Operand::Operand(Register rm, ShiftOp shift_op, int shift_imm) {
-  DCHECK(is_uint5(shift_imm));
-
-  rm_ = rm;
-  rs_ = no_reg;
-  shift_op_ = shift_op;
-  shift_imm_ = shift_imm & 31;
-
-  if ((shift_op == ROR) && (shift_imm == 0)) {
-    // ROR #0 is functionally equivalent to LSL #0 and this allow us to encode
-    // RRX as ROR #0 (See below).
-    shift_op = LSL;
-  } else if (shift_op == RRX) {
-    // encoded as ROR with shift_imm == 0
-    DCHECK_EQ(shift_imm, 0);
-    shift_op_ = ROR;
-    shift_imm_ = 0;
-  }
-}
-
-
-Operand::Operand(Register rm, ShiftOp shift_op, Register rs) {
-  DCHECK(shift_op != RRX);
-  rm_ = rm;
-  rs_ = no_reg;
-  shift_op_ = shift_op;
-  rs_ = rs;
-}
-
-Operand Operand::EmbeddedNumber(double value) {
-  int32_t smi;
-  if (DoubleToSmiInteger(value, &smi)) return Operand(Smi::FromInt(smi));
-  Operand result(0, RelocInfo::EMBEDDED_OBJECT);
-  result.is_heap_object_request_ = true;
-  result.value_.heap_object_request = HeapObjectRequest(value);
-  return result;
-}
-
-Operand Operand::EmbeddedCode(CodeStub* stub) {
-  Operand result(0, RelocInfo::CODE_TARGET);
-  result.is_heap_object_request_ = true;
-  result.value_.heap_object_request = HeapObjectRequest(stub);
-  return result;
-}
-
-MemOperand::MemOperand(Register rn, int32_t offset, AddrMode am)
-    : rn_(rn), rm_(no_reg), offset_(offset), am_(am) {
-  // Accesses below the stack pointer are not safe, and are prohibited by the
-  // ABI. We can check obvious violations here.
-  if (rn == sp) {
-    if (am == Offset) DCHECK_LE(0, offset);
-    if (am == NegOffset) DCHECK_GE(0, offset);
-  }
-}
-
-MemOperand::MemOperand(Register rn, Register rm, AddrMode am)
-    : rn_(rn), rm_(rm), shift_op_(LSL), shift_imm_(0), am_(am) {}
-
-MemOperand::MemOperand(Register rn, Register rm, ShiftOp shift_op,
-                       int shift_imm, AddrMode am)
-    : rn_(rn),
-      rm_(rm),
-      shift_op_(shift_op),
-      shift_imm_(shift_imm & 31),
-      am_(am) {
-  DCHECK(is_uint5(shift_imm));
-}
-
-NeonMemOperand::NeonMemOperand(Register rn, AddrMode am, int align)
-    : rn_(rn), rm_(am == Offset ? pc : sp) {
-  DCHECK((am == Offset) || (am == PostIndex));
-  SetAlignment(align);
-}
-
-NeonMemOperand::NeonMemOperand(Register rn, Register rm, int align)
-    : rn_(rn), rm_(rm) {
-  SetAlignment(align);
-}
-
-void NeonMemOperand::SetAlignment(int align) {
-  switch (align) {
-    case 0:
-      align_ = 0;
-      break;
-    case 64:
-      align_ = 1;
-      break;
-    case 128:
-      align_ = 2;
-      break;
-    case 256:
-      align_ = 3;
-      break;
-    default:
-      UNREACHABLE();
-      break;
-  }
-}
-
-void Assembler::AllocateAndInstallRequestedHeapObjects(Isolate* isolate) {
-  for (auto& request : heap_object_requests_) {
-    Handle<HeapObject> object;
-    switch (request.kind()) {
-      case HeapObjectRequest::kHeapNumber:
-        object = isolate->factory()->NewHeapNumber(request.heap_number(),
-                                                   IMMUTABLE, TENURED);
-        break;
-      case HeapObjectRequest::kCodeStub:
-        request.code_stub()->set_isolate(isolate);
-        object = request.code_stub()->GetCode();
-        break;
-    }
-    Address pc = buffer_ + request.offset();
-    Memory::Address_at(constant_pool_entry_address(pc, 0 /* unused */)) =
-        object.address();
-  }
-}
-
-// -----------------------------------------------------------------------------
-// Specific instructions, constants, and masks.
-
-// str(r, MemOperand(sp, 4, NegPreIndex), al) instruction (aka push(r))
-// register r is not encoded.
-const Instr kPushRegPattern = al | B26 | 4 | NegPreIndex | sp.code() * B16;
-// ldr(r, MemOperand(sp, 4, PostIndex), al) instruction (aka pop(r))
-// register r is not encoded.
-const Instr kPopRegPattern = al | B26 | L | 4 | PostIndex | sp.code() * B16;
-// ldr rd, [pc, #offset]
-const Instr kLdrPCImmedMask = 15 * B24 | 7 * B20 | 15 * B16;
-const Instr kLdrPCImmedPattern = 5 * B24 | L | pc.code() * B16;
-// vldr dd, [pc, #offset]
-const Instr kVldrDPCMask = 15 * B24 | 3 * B20 | 15 * B16 | 15 * B8;
-const Instr kVldrDPCPattern = 13 * B24 | L | pc.code() * B16 | 11 * B8;
-// blxcc rm
-const Instr kBlxRegMask =
-    15 * B24 | 15 * B20 | 15 * B16 | 15 * B12 | 15 * B8 | 15 * B4;
-const Instr kBlxRegPattern =
-    B24 | B21 | 15 * B16 | 15 * B12 | 15 * B8 | BLX;
-const Instr kBlxIp = al | kBlxRegPattern | ip.code();
-const Instr kMovMvnMask = 0x6D * B21 | 0xF * B16;
-const Instr kMovMvnPattern = 0xD * B21;
-const Instr kMovMvnFlip = B22;
-const Instr kMovLeaveCCMask = 0xDFF * B16;
-const Instr kMovLeaveCCPattern = 0x1A0 * B16;
-const Instr kMovwPattern = 0x30 * B20;
-const Instr kMovtPattern = 0x34 * B20;
-const Instr kMovwLeaveCCFlip = 0x5 * B21;
-const Instr kMovImmedMask = 0x7F * B21;
-const Instr kMovImmedPattern = 0x1D * B21;
-const Instr kOrrImmedMask = 0x7F * B21;
-const Instr kOrrImmedPattern = 0x1C * B21;
-const Instr kCmpCmnMask = 0xDD * B20 | 0xF * B12;
-const Instr kCmpCmnPattern = 0x15 * B20;
-const Instr kCmpCmnFlip = B21;
-const Instr kAddSubFlip = 0x6 * B21;
-const Instr kAndBicFlip = 0xE * B21;
-
-// A mask for the Rd register for push, pop, ldr, str instructions.
-const Instr kLdrRegFpOffsetPattern = al | B26 | L | Offset | fp.code() * B16;
-const Instr kStrRegFpOffsetPattern = al | B26 | Offset | fp.code() * B16;
-const Instr kLdrRegFpNegOffsetPattern =
-    al | B26 | L | NegOffset | fp.code() * B16;
-const Instr kStrRegFpNegOffsetPattern = al | B26 | NegOffset | fp.code() * B16;
-const Instr kLdrStrInstrTypeMask = 0xFFFF0000;
-
-Assembler::Assembler(IsolateData isolate_data, void* buffer, int buffer_size)
-    : AssemblerBase(isolate_data, buffer, buffer_size),
-      pending_32_bit_constants_(),
-      pending_64_bit_constants_(),
-      scratch_register_list_(ip.bit()) {
-  pending_32_bit_constants_.reserve(kMinNumPendingConstants);
-  pending_64_bit_constants_.reserve(kMinNumPendingConstants);
-  reloc_info_writer.Reposition(buffer_ + buffer_size_, pc_);
-  next_buffer_check_ = 0;
-  code_target_sharing_blocked_nesting_ = 0;
-  const_pool_blocked_nesting_ = 0;
-  no_const_pool_before_ = 0;
-  first_const_pool_32_use_ = -1;
-  first_const_pool_64_use_ = -1;
-  last_bound_pos_ = 0;
-  if (CpuFeatures::IsSupported(VFP32DREGS)) {
-    // Register objects tend to be abstracted and survive between scopes, so
-    // it's awkward to use CpuFeatures::VFP32DREGS with CpuFeatureScope. To make
-    // its use consistent with other features, we always enable it if we can.
-    EnableCpuFeature(VFP32DREGS);
-  }
-}
-
-
-Assembler::~Assembler() {
-  DCHECK_EQ(const_pool_blocked_nesting_, 0);
-  DCHECK_EQ(code_target_sharing_blocked_nesting_, 0);
-}
-
-void Assembler::GetCode(Isolate* isolate, CodeDesc* desc) {
-  // Emit constant pool if necessary.
-  int constant_pool_offset = 0;
-  CheckConstPool(true, false);
-  DCHECK(pending_32_bit_constants_.empty());
-  DCHECK(pending_64_bit_constants_.empty());
-
-  AllocateAndInstallRequestedHeapObjects(isolate);
-
-  // Set up code descriptor.
-  desc->buffer = buffer_;
-  desc->buffer_size = buffer_size_;
-  desc->instr_size = pc_offset();
-  desc->reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos();
-  desc->constant_pool_size =
-      (constant_pool_offset ? desc->instr_size - constant_pool_offset : 0);
-  desc->origin = this;
-  desc->unwinding_info_size = 0;
-  desc->unwinding_info = nullptr;
-}
-
-
-void Assembler::Align(int m) {
-  DCHECK(m >= 4 && base::bits::IsPowerOfTwo(m));
-  DCHECK_EQ(pc_offset() & (kInstrSize - 1), 0);
-  while ((pc_offset() & (m - 1)) != 0) {
-    nop();
-  }
-}
-
-
-void Assembler::CodeTargetAlign() {
-  // Preferred alignment of jump targets on some ARM chips.
-  Align(8);
-}
-
-
-Condition Assembler::GetCondition(Instr instr) {
-  return Instruction::ConditionField(instr);
-}
-
-
-bool Assembler::IsBranch(Instr instr) {
-  return (instr & (B27 | B25)) == (B27 | B25);
-}
-
-
-int Assembler::GetBranchOffset(Instr instr) {
-  DCHECK(IsBranch(instr));
-  // Take the jump offset in the lower 24 bits, sign extend it and multiply it
-  // with 4 to get the offset in bytes.
-  return ((instr & kImm24Mask) << 8) >> 6;
-}
-
-
-bool Assembler::IsLdrRegisterImmediate(Instr instr) {
-  return (instr & (B27 | B26 | B25 | B22 | B20)) == (B26 | B20);
-}
-
-
-bool Assembler::IsVldrDRegisterImmediate(Instr instr) {
-  return (instr & (15 * B24 | 3 * B20 | 15 * B8)) == (13 * B24 | B20 | 11 * B8);
-}
-
-
-int Assembler::GetLdrRegisterImmediateOffset(Instr instr) {
-  DCHECK(IsLdrRegisterImmediate(instr));
-  bool positive = (instr & B23) == B23;
-  int offset = instr & kOff12Mask;  // Zero extended offset.
-  return positive ? offset : -offset;
-}
-
-
-int Assembler::GetVldrDRegisterImmediateOffset(Instr instr) {
-  DCHECK(IsVldrDRegisterImmediate(instr));
-  bool positive = (instr & B23) == B23;
-  int offset = instr & kOff8Mask;  // Zero extended offset.
-  offset <<= 2;
-  return positive ? offset : -offset;
-}
-
-
-Instr Assembler::SetLdrRegisterImmediateOffset(Instr instr, int offset) {
-  DCHECK(IsLdrRegisterImmediate(instr));
-  bool positive = offset >= 0;
-  if (!positive) offset = -offset;
-  DCHECK(is_uint12(offset));
-  // Set bit indicating whether the offset should be added.
-  instr = (instr & ~B23) | (positive ? B23 : 0);
-  // Set the actual offset.
-  return (instr & ~kOff12Mask) | offset;
-}
-
-
-Instr Assembler::SetVldrDRegisterImmediateOffset(Instr instr, int offset) {
-  DCHECK(IsVldrDRegisterImmediate(instr));
-  DCHECK((offset & ~3) == offset);  // Must be 64-bit aligned.
-  bool positive = offset >= 0;
-  if (!positive) offset = -offset;
-  DCHECK(is_uint10(offset));
-  // Set bit indicating whether the offset should be added.
-  instr = (instr & ~B23) | (positive ? B23 : 0);
-  // Set the actual offset. Its bottom 2 bits are zero.
-  return (instr & ~kOff8Mask) | (offset >> 2);
-}
-
-
-bool Assembler::IsStrRegisterImmediate(Instr instr) {
-  return (instr & (B27 | B26 | B25 | B22 | B20)) == B26;
-}
-
-
-Instr Assembler::SetStrRegisterImmediateOffset(Instr instr, int offset) {
-  DCHECK(IsStrRegisterImmediate(instr));
-  bool positive = offset >= 0;
-  if (!positive) offset = -offset;
-  DCHECK(is_uint12(offset));
-  // Set bit indicating whether the offset should be added.
-  instr = (instr & ~B23) | (positive ? B23 : 0);
-  // Set the actual offset.
-  return (instr & ~kOff12Mask) | offset;
-}
-
-
-bool Assembler::IsAddRegisterImmediate(Instr instr) {
-  return (instr & (B27 | B26 | B25 | B24 | B23 | B22 | B21)) == (B25 | B23);
-}
-
-
-Instr Assembler::SetAddRegisterImmediateOffset(Instr instr, int offset) {
-  DCHECK(IsAddRegisterImmediate(instr));
-  DCHECK_GE(offset, 0);
-  DCHECK(is_uint12(offset));
-  // Set the offset.
-  return (instr & ~kOff12Mask) | offset;
-}
-
-
-Register Assembler::GetRd(Instr instr) {
-  return Register::from_code(Instruction::RdValue(instr));
-}
-
-
-Register Assembler::GetRn(Instr instr) {
-  return Register::from_code(Instruction::RnValue(instr));
-}
-
-
-Register Assembler::GetRm(Instr instr) {
-  return Register::from_code(Instruction::RmValue(instr));
-}
-
-
-bool Assembler::IsPush(Instr instr) {
-  return ((instr & ~kRdMask) == kPushRegPattern);
-}
-
-
-bool Assembler::IsPop(Instr instr) {
-  return ((instr & ~kRdMask) == kPopRegPattern);
-}
-
-
-bool Assembler::IsStrRegFpOffset(Instr instr) {
-  return ((instr & kLdrStrInstrTypeMask) == kStrRegFpOffsetPattern);
-}
-
-
-bool Assembler::IsLdrRegFpOffset(Instr instr) {
-  return ((instr & kLdrStrInstrTypeMask) == kLdrRegFpOffsetPattern);
-}
-
-
-bool Assembler::IsStrRegFpNegOffset(Instr instr) {
-  return ((instr & kLdrStrInstrTypeMask) == kStrRegFpNegOffsetPattern);
-}
-
-
-bool Assembler::IsLdrRegFpNegOffset(Instr instr) {
-  return ((instr & kLdrStrInstrTypeMask) == kLdrRegFpNegOffsetPattern);
-}
-
-
-bool Assembler::IsLdrPcImmediateOffset(Instr instr) {
-  // Check the instruction is indeed a
-  // ldr<cond> <Rd>, [pc +/- offset_12].
-  return (instr & kLdrPCImmedMask) == kLdrPCImmedPattern;
-}
-
-
-bool Assembler::IsVldrDPcImmediateOffset(Instr instr) {
-  // Check the instruction is indeed a
-  // vldr<cond> <Dd>, [pc +/- offset_10].
-  return (instr & kVldrDPCMask) == kVldrDPCPattern;
-}
-
-
-bool Assembler::IsBlxReg(Instr instr) {
-  // Check the instruction is indeed a
-  // blxcc <Rm>
-  return (instr & kBlxRegMask) == kBlxRegPattern;
-}
-
-
-bool Assembler::IsBlxIp(Instr instr) {
-  // Check the instruction is indeed a
-  // blx ip
-  return instr == kBlxIp;
-}
-
-
-bool Assembler::IsTstImmediate(Instr instr) {
-  return (instr & (B27 | B26 | I | kOpCodeMask | S | kRdMask)) ==
-      (I | TST | S);
-}
-
-
-bool Assembler::IsCmpRegister(Instr instr) {
-  return (instr & (B27 | B26 | I | kOpCodeMask | S | kRdMask | B4)) ==
-      (CMP | S);
-}
-
-
-bool Assembler::IsCmpImmediate(Instr instr) {
-  return (instr & (B27 | B26 | I | kOpCodeMask | S | kRdMask)) ==
-      (I | CMP | S);
-}
-
-
-Register Assembler::GetCmpImmediateRegister(Instr instr) {
-  DCHECK(IsCmpImmediate(instr));
-  return GetRn(instr);
-}
-
-
-int Assembler::GetCmpImmediateRawImmediate(Instr instr) {
-  DCHECK(IsCmpImmediate(instr));
-  return instr & kOff12Mask;
-}
-
-
-// Labels refer to positions in the (to be) generated code.
-// There are bound, linked, and unused labels.
-//
-// Bound labels refer to known positions in the already
-// generated code. pos() is the position the label refers to.
-//
-// Linked labels refer to unknown positions in the code
-// to be generated; pos() is the position of the last
-// instruction using the label.
-//
-// The linked labels form a link chain by making the branch offset
-// in the instruction steam to point to the previous branch
-// instruction using the same label.
-//
-// The link chain is terminated by a branch offset pointing to the
-// same position.
-
-
-int Assembler::target_at(int pos) {
-  Instr instr = instr_at(pos);
-  if (is_uint24(instr)) {
-    // Emitted link to a label, not part of a branch.
-    return instr;
-  }
-  DCHECK_EQ(5 * B25, instr & 7 * B25);  // b, bl, or blx imm24
-  int imm26 = ((instr & kImm24Mask) << 8) >> 6;
-  if ((Instruction::ConditionField(instr) == kSpecialCondition) &&
-      ((instr & B24) != 0)) {
-    // blx uses bit 24 to encode bit 2 of imm26
-    imm26 += 2;
-  }
-  return pos + kPcLoadDelta + imm26;
-}
-
-
-void Assembler::target_at_put(int pos, int target_pos) {
-  Instr instr = instr_at(pos);
-  if (is_uint24(instr)) {
-    DCHECK(target_pos == pos || target_pos >= 0);
-    // Emitted link to a label, not part of a branch.
-    // Load the position of the label relative to the generated code object
-    // pointer in a register.
-
-    // The existing code must be a single 24-bit label chain link, followed by
-    // nops encoding the destination register. See mov_label_offset.
-
-    // Extract the destination register from the first nop instructions.
-    Register dst =
-        Register::from_code(Instruction::RmValue(instr_at(pos + kInstrSize)));
-    // In addition to the 24-bit label chain link, we expect to find one nop for
-    // ARMv7 and above, or two nops for ARMv6. See mov_label_offset.
-    DCHECK(IsNop(instr_at(pos + kInstrSize), dst.code()));
-    if (!CpuFeatures::IsSupported(ARMv7)) {
-      DCHECK(IsNop(instr_at(pos + 2 * kInstrSize), dst.code()));
-    }
-
-    // Here are the instructions we need to emit:
-    //   For ARMv7: target24 => target16_1:target16_0
-    //      movw dst, #target16_0
-    //      movt dst, #target16_1
-    //   For ARMv6: target24 => target8_2:target8_1:target8_0
-    //      mov dst, #target8_0
-    //      orr dst, dst, #target8_1 << 8
-    //      orr dst, dst, #target8_2 << 16
-
-    uint32_t target24 = target_pos + (Code::kHeaderSize - kHeapObjectTag);
-    DCHECK(is_uint24(target24));
-    if (is_uint8(target24)) {
-      // If the target fits in a byte then only patch with a mov
-      // instruction.
-      PatchingAssembler patcher(isolate_data(),
-                                reinterpret_cast<byte*>(buffer_ + pos), 1);
-      patcher.mov(dst, Operand(target24));
-    } else {
-      uint16_t target16_0 = target24 & kImm16Mask;
-      uint16_t target16_1 = target24 >> 16;
-      if (CpuFeatures::IsSupported(ARMv7)) {
-        // Patch with movw/movt.
-        if (target16_1 == 0) {
-          PatchingAssembler patcher(isolate_data(),
-                                    reinterpret_cast<byte*>(buffer_ + pos), 1);
-          CpuFeatureScope scope(&patcher, ARMv7);
-          patcher.movw(dst, target16_0);
-        } else {
-          PatchingAssembler patcher(isolate_data(),
-                                    reinterpret_cast<byte*>(buffer_ + pos), 2);
-          CpuFeatureScope scope(&patcher, ARMv7);
-          patcher.movw(dst, target16_0);
-          patcher.movt(dst, target16_1);
-        }
-      } else {
-        // Patch with a sequence of mov/orr/orr instructions.
-        uint8_t target8_0 = target16_0 & kImm8Mask;
-        uint8_t target8_1 = target16_0 >> 8;
-        uint8_t target8_2 = target16_1 & kImm8Mask;
-        if (target8_2 == 0) {
-          PatchingAssembler patcher(isolate_data(),
-                                    reinterpret_cast<byte*>(buffer_ + pos), 2);
-          patcher.mov(dst, Operand(target8_0));
-          patcher.orr(dst, dst, Operand(target8_1 << 8));
-        } else {
-          PatchingAssembler patcher(isolate_data(),
-                                    reinterpret_cast<byte*>(buffer_ + pos), 3);
-          patcher.mov(dst, Operand(target8_0));
-          patcher.orr(dst, dst, Operand(target8_1 << 8));
-          patcher.orr(dst, dst, Operand(target8_2 << 16));
-        }
-      }
-    }
-    return;
-  }
-  int imm26 = target_pos - (pos + kPcLoadDelta);
-  DCHECK_EQ(5 * B25, instr & 7 * B25);  // b, bl, or blx imm24
-  if (Instruction::ConditionField(instr) == kSpecialCondition) {
-    // blx uses bit 24 to encode bit 2 of imm26
-    DCHECK_EQ(0, imm26 & 1);
-    instr = (instr & ~(B24 | kImm24Mask)) | ((imm26 & 2) >> 1) * B24;
-  } else {
-    DCHECK_EQ(0, imm26 & 3);
-    instr &= ~kImm24Mask;
-  }
-  int imm24 = imm26 >> 2;
-  DCHECK(is_int24(imm24));
-  instr_at_put(pos, instr | (imm24 & kImm24Mask));
-}
-
-void Assembler::print(const Label* L) {
-  if (L->is_unused()) {
-    PrintF("unused label\n");
-  } else if (L->is_bound()) {
-    PrintF("bound label to %d\n", L->pos());
-  } else if (L->is_linked()) {
-    Label l;
-    l.link_to(L->pos());
-    PrintF("unbound label");
-    while (l.is_linked()) {
-      PrintF("@ %d ", l.pos());
-      Instr instr = instr_at(l.pos());
-      if ((instr & ~kImm24Mask) == 0) {
-        PrintF("value\n");
-      } else {
-        DCHECK_EQ(instr & 7 * B25, 5 * B25);  // b, bl, or blx
-        Condition cond = Instruction::ConditionField(instr);
-        const char* b;
-        const char* c;
-        if (cond == kSpecialCondition) {
-          b = "blx";
-          c = "";
-        } else {
-          if ((instr & B24) != 0)
-            b = "bl";
-          else
-            b = "b";
-
-          switch (cond) {
-            case eq: c = "eq"; break;
-            case ne: c = "ne"; break;
-            case hs: c = "hs"; break;
-            case lo: c = "lo"; break;
-            case mi: c = "mi"; break;
-            case pl: c = "pl"; break;
-            case vs: c = "vs"; break;
-            case vc: c = "vc"; break;
-            case hi: c = "hi"; break;
-            case ls: c = "ls"; break;
-            case ge: c = "ge"; break;
-            case lt: c = "lt"; break;
-            case gt: c = "gt"; break;
-            case le: c = "le"; break;
-            case al: c = ""; break;
-            default:
-              c = "";
-              UNREACHABLE();
-          }
-        }
-        PrintF("%s%s\n", b, c);
-      }
-      next(&l);
-    }
-  } else {
-    PrintF("label in inconsistent state (pos = %d)\n", L->pos_);
-  }
-}
-
-
-void Assembler::bind_to(Label* L, int pos) {
-  DCHECK(0 <= pos && pos <= pc_offset());  // must have a valid binding position
-  while (L->is_linked()) {
-    int fixup_pos = L->pos();
-    next(L);  // call next before overwriting link with target at fixup_pos
-    target_at_put(fixup_pos, pos);
-  }
-  L->bind_to(pos);
-
-  // Keep track of the last bound label so we don't eliminate any instructions
-  // before a bound label.
-  if (pos > last_bound_pos_)
-    last_bound_pos_ = pos;
-}
-
-
-void Assembler::bind(Label* L) {
-  DCHECK(!L->is_bound());  // label can only be bound once
-  bind_to(L, pc_offset());
-}
-
-
-void Assembler::next(Label* L) {
-  DCHECK(L->is_linked());
-  int link = target_at(L->pos());
-  if (link == L->pos()) {
-    // Branch target points to the same instruction. This is the end of the link
-    // chain.
-    L->Unuse();
-  } else {
-    DCHECK_GE(link, 0);
-    L->link_to(link);
-  }
-}
-
-namespace {
-
-// Low-level code emission routines depending on the addressing mode.
-// If this returns true then you have to use the rotate_imm and immed_8
-// that it returns, because it may have already changed the instruction
-// to match them!
-bool FitsShifter(uint32_t imm32, uint32_t* rotate_imm, uint32_t* immed_8,
-                 Instr* instr) {
-  // imm32 must be unsigned.
-  for (int rot = 0; rot < 16; rot++) {
-    uint32_t imm8 = base::bits::RotateLeft32(imm32, 2 * rot);
-    if ((imm8 <= 0xFF)) {
-      *rotate_imm = rot;
-      *immed_8 = imm8;
-      return true;
-    }
-  }
-  // If the opcode is one with a complementary version and the complementary
-  // immediate fits, change the opcode.
-  if (instr != nullptr) {
-    if ((*instr & kMovMvnMask) == kMovMvnPattern) {
-      if (FitsShifter(~imm32, rotate_imm, immed_8, nullptr)) {
-        *instr ^= kMovMvnFlip;
-        return true;
-      } else if ((*instr & kMovLeaveCCMask) == kMovLeaveCCPattern) {
-        if (CpuFeatures::IsSupported(ARMv7)) {
-          if (imm32 < 0x10000) {
-            *instr ^= kMovwLeaveCCFlip;
-            *instr |= Assembler::EncodeMovwImmediate(imm32);
-            *rotate_imm = *immed_8 = 0;  // Not used for movw.
-            return true;
-          }
-        }
-      }
-    } else if ((*instr & kCmpCmnMask) == kCmpCmnPattern) {
-      if (FitsShifter(-static_cast<int>(imm32), rotate_imm, immed_8, nullptr)) {
-        *instr ^= kCmpCmnFlip;
-        return true;
-      }
-    } else {
-      Instr alu_insn = (*instr & kALUMask);
-      if (alu_insn == ADD ||
-          alu_insn == SUB) {
-        if (FitsShifter(-static_cast<int>(imm32), rotate_imm, immed_8,
-                        nullptr)) {
-          *instr ^= kAddSubFlip;
-          return true;
-        }
-      } else if (alu_insn == AND ||
-                 alu_insn == BIC) {
-        if (FitsShifter(~imm32, rotate_imm, immed_8, nullptr)) {
-          *instr ^= kAndBicFlip;
-          return true;
-        }
-      }
-    }
-  }
-  return false;
-}
-
-// We have to use the temporary register for things that can be relocated even
-// if they can be encoded in the ARM's 12 bits of immediate-offset instruction
-// space.  There is no guarantee that the relocated location can be similarly
-// encoded.
-bool MustOutputRelocInfo(RelocInfo::Mode rmode, const Assembler* assembler) {
-  if (rmode == RelocInfo::EXTERNAL_REFERENCE) {
-    if (assembler != nullptr && assembler->predictable_code_size()) return true;
-    return assembler->serializer_enabled();
-  } else if (RelocInfo::IsNone(rmode)) {
-    return false;
-  }
-  return true;
-}
-
-bool UseMovImmediateLoad(const Operand& x, const Assembler* assembler) {
-  DCHECK_NOT_NULL(assembler);
-  if (x.MustOutputRelocInfo(assembler)) {
-    // Prefer constant pool if data is likely to be patched.
-    return false;
-  } else {
-    // Otherwise, use immediate load if movw / movt is available.
-    return CpuFeatures::IsSupported(ARMv7);
-  }
-}
-
-}  // namespace
-
-bool Operand::MustOutputRelocInfo(const Assembler* assembler) const {
-  return v8::internal::MustOutputRelocInfo(rmode_, assembler);
-}
-
-int Operand::InstructionsRequired(const Assembler* assembler,
-                                  Instr instr) const {
-  DCHECK_NOT_NULL(assembler);
-  if (rm_.is_valid()) return 1;
-  uint32_t dummy1, dummy2;
-  if (MustOutputRelocInfo(assembler) ||
-      !FitsShifter(immediate(), &dummy1, &dummy2, &instr)) {
-    // The immediate operand cannot be encoded as a shifter operand, or use of
-    // constant pool is required.  First account for the instructions required
-    // for the constant pool or immediate load
-    int instructions;
-    if (UseMovImmediateLoad(*this, assembler)) {
-      DCHECK(CpuFeatures::IsSupported(ARMv7));
-      // A movw / movt immediate load.
-      instructions = 2;
-    } else {
-      // A small constant pool load.
-      instructions = 1;
-    }
-    if ((instr & ~kCondMask) != 13 * B21) {  // mov, S not set
-      // For a mov or mvn instruction which doesn't set the condition
-      // code, the constant pool or immediate load is enough, otherwise we need
-      // to account for the actual instruction being requested.
-      instructions += 1;
-    }
-    return instructions;
-  } else {
-    // No use of constant pool and the immediate operand can be encoded as a
-    // shifter operand.
-    return 1;
-  }
-}
-
-void Assembler::Move32BitImmediate(Register rd, const Operand& x,
-                                   Condition cond) {
-  if (UseMovImmediateLoad(x, this)) {
-    // UseMovImmediateLoad should return false when we need to output
-    // relocation info, since we prefer the constant pool for values that
-    // can be patched.
-    DCHECK(!x.MustOutputRelocInfo(this));
-    UseScratchRegisterScope temps(this);
-    // Re-use the destination register as a scratch if possible.
-    Register target = rd != pc ? rd : temps.Acquire();
-    if (CpuFeatures::IsSupported(ARMv7)) {
-      uint32_t imm32 = static_cast<uint32_t>(x.immediate());
-      CpuFeatureScope scope(this, ARMv7);
-      movw(target, imm32 & 0xFFFF, cond);
-      movt(target, imm32 >> 16, cond);
-    }
-    if (target.code() != rd.code()) {
-      mov(rd, target, LeaveCC, cond);
-    }
-  } else {
-    int32_t immediate;
-    if (x.IsHeapObjectRequest()) {
-      RequestHeapObject(x.heap_object_request());
-      immediate = 0;
-    } else {
-      immediate = x.immediate();
-    }
-    ConstantPoolAddEntry(pc_offset(), x.rmode_, immediate);
-    ldr_pcrel(rd, 0, cond);
-  }
-}
-
-void Assembler::AddrMode1(Instr instr, Register rd, Register rn,
-                          const Operand& x) {
-  CheckBuffer();
-  uint32_t opcode = instr & kOpCodeMask;
-  bool set_flags = (instr & S) != 0;
-  DCHECK((opcode == ADC) || (opcode == ADD) || (opcode == AND) ||
-         (opcode == BIC) || (opcode == EOR) || (opcode == ORR) ||
-         (opcode == RSB) || (opcode == RSC) || (opcode == SBC) ||
-         (opcode == SUB) || (opcode == CMN) || (opcode == CMP) ||
-         (opcode == TEQ) || (opcode == TST) || (opcode == MOV) ||
-         (opcode == MVN));
-  // For comparison instructions, rd is not defined.
-  DCHECK(rd.is_valid() || (opcode == CMN) || (opcode == CMP) ||
-         (opcode == TEQ) || (opcode == TST));
-  // For move instructions, rn is not defined.
-  DCHECK(rn.is_valid() || (opcode == MOV) || (opcode == MVN));
-  DCHECK(rd.is_valid() || rn.is_valid());
-  DCHECK_EQ(instr & ~(kCondMask | kOpCodeMask | S), 0);
-  if (!AddrMode1TryEncodeOperand(&instr, x)) {
-    DCHECK(x.IsImmediate());
-    // Upon failure to encode, the opcode should not have changed.
-    DCHECK(opcode == (instr & kOpCodeMask));
-    Condition cond = Instruction::ConditionField(instr);
-    if ((opcode == MOV) && !set_flags) {
-      // Generate a sequence of mov instructions or a load from the constant
-      // pool only for a MOV instruction which does not set the flags.
-      DCHECK(!rn.is_valid());
-      Move32BitImmediate(rd, x, cond);
-    } else if ((opcode == ADD) && !set_flags && (rd == rn) &&
-               (scratch_register_list_ == 0)) {
-      // Split the operation into a sequence of additions if we cannot use a
-      // scratch register. In this case, we cannot re-use rn and the assembler
-      // does not have any scratch registers to spare.
-      uint32_t imm = x.immediate();
-      do {
-        // The immediate encoding format is composed of 8 bits of data and 4
-        // bits encoding a rotation. Each of the 16 possible rotations accounts
-        // for a rotation by an even number.
-        //   4 bits -> 16 rotations possible
-        //          -> 16 rotations of 2 bits each fits in a 32-bit value.
-        // This means that finding the even number of trailing zeroes of the
-        // immediate allows us to more efficiently split it:
-        int trailing_zeroes = base::bits::CountTrailingZeros(imm) & ~1u;
-        uint32_t mask = (0xFF << trailing_zeroes);
-        add(rd, rd, Operand(imm & mask), LeaveCC, cond);
-        imm = imm & ~mask;
-      } while (!ImmediateFitsAddrMode1Instruction(imm));
-      add(rd, rd, Operand(imm), LeaveCC, cond);
-    } else {
-      // The immediate operand cannot be encoded as a shifter operand, so load
-      // it first to a scratch register and change the original instruction to
-      // use it.
-      UseScratchRegisterScope temps(this);
-      // Re-use the destination register if possible.
-      Register scratch =
-          (rd.is_valid() && rd != rn && rd != pc) ? rd : temps.Acquire();
-      mov(scratch, x, LeaveCC, cond);
-      AddrMode1(instr, rd, rn, Operand(scratch));
-    }
-    return;
-  }
-  if (!rd.is_valid()) {
-    // Emit a comparison instruction.
-    emit(instr | rn.code() * B16);
-  } else if (!rn.is_valid()) {
-    // Emit a move instruction. If the operand is a register-shifted register,
-    // then prevent the destination from being PC as this is unpredictable.
-    DCHECK(!x.IsRegisterShiftedRegister() || rd != pc);
-    emit(instr | rd.code() * B12);
-  } else {
-    emit(instr | rn.code() * B16 | rd.code() * B12);
-  }
-  if (rn == pc || x.rm_ == pc) {
-    // Block constant pool emission for one instruction after reading pc.
-    BlockConstPoolFor(1);
-  }
-}
-
-bool Assembler::AddrMode1TryEncodeOperand(Instr* instr, const Operand& x) {
-  if (x.IsImmediate()) {
-    // Immediate.
-    uint32_t rotate_imm;
-    uint32_t immed_8;
-    if (x.MustOutputRelocInfo(this) ||
-        !FitsShifter(x.immediate(), &rotate_imm, &immed_8, instr)) {
-      // Let the caller handle generating multiple instructions.
-      return false;
-    }
-    *instr |= I | rotate_imm * B8 | immed_8;
-  } else if (x.IsImmediateShiftedRegister()) {
-    *instr |= x.shift_imm_ * B7 | x.shift_op_ | x.rm_.code();
-  } else {
-    DCHECK(x.IsRegisterShiftedRegister());
-    // It is unpredictable to use the PC in this case.
-    DCHECK(x.rm_ != pc && x.rs_ != pc);
-    *instr |= x.rs_.code() * B8 | x.shift_op_ | B4 | x.rm_.code();
-  }
-
-  return true;
-}
-
-void Assembler::AddrMode2(Instr instr, Register rd, const MemOperand& x) {
-  DCHECK((instr & ~(kCondMask | B | L)) == B26);
-  // This method does not handle pc-relative addresses. ldr_pcrel() should be
-  // used instead.
-  DCHECK(x.rn_ != pc);
-  int am = x.am_;
-  if (!x.rm_.is_valid()) {
-    // Immediate offset.
-    int offset_12 = x.offset_;
-    if (offset_12 < 0) {
-      offset_12 = -offset_12;
-      am ^= U;
-    }
-    if (!is_uint12(offset_12)) {
-      // Immediate offset cannot be encoded, load it first to a scratch
-      // register.
-      UseScratchRegisterScope temps(this);
-      // Allow re-using rd for load instructions if possible.
-      bool is_load = (instr & L) == L;
-      Register scratch =
-          (is_load && rd != x.rn_ && rd != pc) ? rd : temps.Acquire();
-      mov(scratch, Operand(x.offset_), LeaveCC,
-          Instruction::ConditionField(instr));
-      AddrMode2(instr, rd, MemOperand(x.rn_, scratch, x.am_));
-      return;
-    }
-    DCHECK_GE(offset_12, 0);  // no masking needed
-    instr |= offset_12;
-  } else {
-    // Register offset (shift_imm_ and shift_op_ are 0) or scaled
-    // register offset the constructors make sure than both shift_imm_
-    // and shift_op_ are initialized.
-    DCHECK(x.rm_ != pc);
-    instr |= B25 | x.shift_imm_*B7 | x.shift_op_ | x.rm_.code();
-  }
-  DCHECK((am & (P | W)) == P || x.rn_ != pc);  // no pc base with writeback
-  emit(instr | am | x.rn_.code()*B16 | rd.code()*B12);
-}
-
-void Assembler::AddrMode3(Instr instr, Register rd, const MemOperand& x) {
-  DCHECK((instr & ~(kCondMask | L | S6 | H)) == (B4 | B7));
-  DCHECK(x.rn_.is_valid());
-  // This method does not handle pc-relative addresses. ldr_pcrel() should be
-  // used instead.
-  DCHECK(x.rn_ != pc);
-  int am = x.am_;
-  bool is_load = (instr & L) == L;
-  if (!x.rm_.is_valid()) {
-    // Immediate offset.
-    int offset_8 = x.offset_;
-    if (offset_8 < 0) {
-      offset_8 = -offset_8;
-      am ^= U;
-    }
-    if (!is_uint8(offset_8)) {
-      // Immediate offset cannot be encoded, load it first to a scratch
-      // register.
-      UseScratchRegisterScope temps(this);
-      // Allow re-using rd for load instructions if possible.
-      Register scratch =
-          (is_load && rd != x.rn_ && rd != pc) ? rd : temps.Acquire();
-      mov(scratch, Operand(x.offset_), LeaveCC,
-          Instruction::ConditionField(instr));
-      AddrMode3(instr, rd, MemOperand(x.rn_, scratch, x.am_));
-      return;
-    }
-    DCHECK_GE(offset_8, 0);  // no masking needed
-    instr |= B | (offset_8 >> 4) * B8 | (offset_8 & 0xF);
-  } else if (x.shift_imm_ != 0) {
-    // Scaled register offsets are not supported, compute the offset separately
-    // to a scratch register.
-    UseScratchRegisterScope temps(this);
-    // Allow re-using rd for load instructions if possible.
-    Register scratch =
-        (is_load && rd != x.rn_ && rd != pc) ? rd : temps.Acquire();
-    mov(scratch, Operand(x.rm_, x.shift_op_, x.shift_imm_), LeaveCC,
-        Instruction::ConditionField(instr));
-    AddrMode3(instr, rd, MemOperand(x.rn_, scratch, x.am_));
-    return;
-  } else {
-    // Register offset.
-    DCHECK((am & (P | W)) == P || x.rm_ != pc);  // no pc index with writeback
-    instr |= x.rm_.code();
-  }
-  DCHECK((am & (P | W)) == P || x.rn_ != pc);  // no pc base with writeback
-  emit(instr | am | x.rn_.code()*B16 | rd.code()*B12);
-}
-
-void Assembler::AddrMode4(Instr instr, Register rn, RegList rl) {
-  DCHECK((instr & ~(kCondMask | P | U | W | L)) == B27);
-  DCHECK_NE(rl, 0);
-  DCHECK(rn != pc);
-  emit(instr | rn.code()*B16 | rl);
-}
-
-void Assembler::AddrMode5(Instr instr, CRegister crd, const MemOperand& x) {
-  // Unindexed addressing is not encoded by this function.
-  DCHECK_EQ((B27 | B26),
-            (instr & ~(kCondMask | kCoprocessorMask | P | U | N | W | L)));
-  DCHECK(x.rn_.is_valid() && !x.rm_.is_valid());
-  int am = x.am_;
-  int offset_8 = x.offset_;
-  DCHECK_EQ(offset_8 & 3, 0);  // offset must be an aligned word offset
-  offset_8 >>= 2;
-  if (offset_8 < 0) {
-    offset_8 = -offset_8;
-    am ^= U;
-  }
-  DCHECK(is_uint8(offset_8));  // unsigned word offset must fit in a byte
-  DCHECK((am & (P | W)) == P || x.rn_ != pc);  // no pc base with writeback
-
-  // Post-indexed addressing requires W == 1; different than in AddrMode2/3.
-  if ((am & P) == 0)
-    am |= W;
-
-  DCHECK_GE(offset_8, 0);  // no masking needed
-  emit(instr | am | x.rn_.code()*B16 | crd.code()*B12 | offset_8);
-}
-
-
-int Assembler::branch_offset(Label* L) {
-  int target_pos;
-  if (L->is_bound()) {
-    target_pos = L->pos();
-  } else {
-    if (L->is_linked()) {
-      // Point to previous instruction that uses the link.
-      target_pos = L->pos();
-    } else {
-      // First entry of the link chain points to itself.
-      target_pos = pc_offset();
-    }
-    L->link_to(pc_offset());
-  }
-
-  // Block the emission of the constant pool, since the branch instruction must
-  // be emitted at the pc offset recorded by the label.
-  if (!is_const_pool_blocked()) BlockConstPoolFor(1);
-
-  return target_pos - (pc_offset() + kPcLoadDelta);
-}
-
-
-// Branch instructions.
-void Assembler::b(int branch_offset, Condition cond) {
-  DCHECK_EQ(branch_offset & 3, 0);
-  int imm24 = branch_offset >> 2;
-  CHECK(is_int24(imm24));
-  emit(cond | B27 | B25 | (imm24 & kImm24Mask));
-
-  if (cond == al) {
-    // Dead code is a good location to emit the constant pool.
-    CheckConstPool(false, false);
-  }
-}
-
-
-void Assembler::bl(int branch_offset, Condition cond) {
-  DCHECK_EQ(branch_offset & 3, 0);
-  int imm24 = branch_offset >> 2;
-  CHECK(is_int24(imm24));
-  emit(cond | B27 | B25 | B24 | (imm24 & kImm24Mask));
-}
-
-void Assembler::blx(int branch_offset) {
-  DCHECK_EQ(branch_offset & 1, 0);
-  int h = ((branch_offset & 2) >> 1)*B24;
-  int imm24 = branch_offset >> 2;
-  CHECK(is_int24(imm24));
-  emit(kSpecialCondition | B27 | B25 | h | (imm24 & kImm24Mask));
-}
-
-void Assembler::blx(Register target, Condition cond) {
-  DCHECK(target != pc);
-  emit(cond | B24 | B21 | 15*B16 | 15*B12 | 15*B8 | BLX | target.code());
-}
-
-void Assembler::bx(Register target, Condition cond) {
-  DCHECK(target != pc);  // use of pc is actually allowed, but discouraged
-  emit(cond | B24 | B21 | 15*B16 | 15*B12 | 15*B8 | BX | target.code());
-}
-
-
-void Assembler::b(Label* L, Condition cond) {
-  CheckBuffer();
-  b(branch_offset(L), cond);
-}
-
-
-void Assembler::bl(Label* L, Condition cond) {
-  CheckBuffer();
-  bl(branch_offset(L), cond);
-}
-
-
-void Assembler::blx(Label* L) {
-  CheckBuffer();
-  blx(branch_offset(L));
-}
-
-
-// Data-processing instructions.
-
-void Assembler::and_(Register dst, Register src1, const Operand& src2,
-                     SBit s, Condition cond) {
-  AddrMode1(cond | AND | s, dst, src1, src2);
-}
-
-
-void Assembler::eor(Register dst, Register src1, const Operand& src2,
-                    SBit s, Condition cond) {
-  AddrMode1(cond | EOR | s, dst, src1, src2);
-}
-
-
-void Assembler::sub(Register dst, Register src1, const Operand& src2,
-                    SBit s, Condition cond) {
-  AddrMode1(cond | SUB | s, dst, src1, src2);
-}
-
-void Assembler::sub(Register dst, Register src1, Register src2, SBit s,
-                    Condition cond) {
-  sub(dst, src1, Operand(src2), s, cond);
-}
-
-void Assembler::rsb(Register dst, Register src1, const Operand& src2,
-                    SBit s, Condition cond) {
-  AddrMode1(cond | RSB | s, dst, src1, src2);
-}
-
-
-void Assembler::add(Register dst, Register src1, const Operand& src2,
-                    SBit s, Condition cond) {
-  AddrMode1(cond | ADD | s, dst, src1, src2);
-}
-
-void Assembler::add(Register dst, Register src1, Register src2, SBit s,
-                    Condition cond) {
-  add(dst, src1, Operand(src2), s, cond);
-}
-
-void Assembler::adc(Register dst, Register src1, const Operand& src2,
-                    SBit s, Condition cond) {
-  AddrMode1(cond | ADC | s, dst, src1, src2);
-}
-
-
-void Assembler::sbc(Register dst, Register src1, const Operand& src2,
-                    SBit s, Condition cond) {
-  AddrMode1(cond | SBC | s, dst, src1, src2);
-}
-
-
-void Assembler::rsc(Register dst, Register src1, const Operand& src2,
-                    SBit s, Condition cond) {
-  AddrMode1(cond | RSC | s, dst, src1, src2);
-}
-
-
-void Assembler::tst(Register src1, const Operand& src2, Condition cond) {
-  AddrMode1(cond | TST | S, no_reg, src1, src2);
-}
-
-void Assembler::tst(Register src1, Register src2, Condition cond) {
-  tst(src1, Operand(src2), cond);
-}
-
-void Assembler::teq(Register src1, const Operand& src2, Condition cond) {
-  AddrMode1(cond | TEQ | S, no_reg, src1, src2);
-}
-
-
-void Assembler::cmp(Register src1, const Operand& src2, Condition cond) {
-  AddrMode1(cond | CMP | S, no_reg, src1, src2);
-}
-
-void Assembler::cmp(Register src1, Register src2, Condition cond) {
-  cmp(src1, Operand(src2), cond);
-}
-
-void Assembler::cmp_raw_immediate(
-    Register src, int raw_immediate, Condition cond) {
-  DCHECK(is_uint12(raw_immediate));
-  emit(cond | I | CMP | S | src.code() << 16 | raw_immediate);
-}
-
-
-void Assembler::cmn(Register src1, const Operand& src2, Condition cond) {
-  AddrMode1(cond | CMN | S, no_reg, src1, src2);
-}
-
-
-void Assembler::orr(Register dst, Register src1, const Operand& src2,
-                    SBit s, Condition cond) {
-  AddrMode1(cond | ORR | s, dst, src1, src2);
-}
-
-void Assembler::orr(Register dst, Register src1, Register src2, SBit s,
-                    Condition cond) {
-  orr(dst, src1, Operand(src2), s, cond);
-}
-
-void Assembler::mov(Register dst, const Operand& src, SBit s, Condition cond) {
-  // Don't allow nop instructions in the form mov rn, rn to be generated using
-  // the mov instruction. They must be generated using nop(int/NopMarkerTypes).
-  DCHECK(!(src.IsRegister() && src.rm() == dst && s == LeaveCC && cond == al));
-  AddrMode1(cond | MOV | s, dst, no_reg, src);
-}
-
-void Assembler::mov(Register dst, Register src, SBit s, Condition cond) {
-  mov(dst, Operand(src), s, cond);
-}
-
-void Assembler::mov_label_offset(Register dst, Label* label) {
-  if (label->is_bound()) {
-    mov(dst, Operand(label->pos() + (Code::kHeaderSize - kHeapObjectTag)));
-  } else {
-    // Emit the link to the label in the code stream followed by extra nop
-    // instructions.
-    // If the label is not linked, then start a new link chain by linking it to
-    // itself, emitting pc_offset().
-    int link = label->is_linked() ? label->pos() : pc_offset();
-    label->link_to(pc_offset());
-
-    // When the label is bound, these instructions will be patched with a
-    // sequence of movw/movt or mov/orr/orr instructions. They will load the
-    // destination register with the position of the label from the beginning
-    // of the code.
-    //
-    // The link will be extracted from the first instruction and the destination
-    // register from the second.
-    //   For ARMv7:
-    //      link
-    //      mov dst, dst
-    //   For ARMv6:
-    //      link
-    //      mov dst, dst
-    //      mov dst, dst
-    //
-    // When the label gets bound: target_at extracts the link and target_at_put
-    // patches the instructions.
-    CHECK(is_uint24(link));
-    BlockConstPoolScope block_const_pool(this);
-    emit(link);
-    nop(dst.code());
-    if (!CpuFeatures::IsSupported(ARMv7)) {
-      nop(dst.code());
-    }
-  }
-}
-
-
-void Assembler::movw(Register reg, uint32_t immediate, Condition cond) {
-  DCHECK(IsEnabled(ARMv7));
-  emit(cond | 0x30*B20 | reg.code()*B12 | EncodeMovwImmediate(immediate));
-}
-
-
-void Assembler::movt(Register reg, uint32_t immediate, Condition cond) {
-  DCHECK(IsEnabled(ARMv7));
-  emit(cond | 0x34*B20 | reg.code()*B12 | EncodeMovwImmediate(immediate));
-}
-
-
-void Assembler::bic(Register dst, Register src1, const Operand& src2,
-                    SBit s, Condition cond) {
-  AddrMode1(cond | BIC | s, dst, src1, src2);
-}
-
-
-void Assembler::mvn(Register dst, const Operand& src, SBit s, Condition cond) {
-  AddrMode1(cond | MVN | s, dst, no_reg, src);
-}
-
-void Assembler::asr(Register dst, Register src1, const Operand& src2, SBit s,
-                    Condition cond) {
-  if (src2.IsRegister()) {
-    mov(dst, Operand(src1, ASR, src2.rm()), s, cond);
-  } else {
-    mov(dst, Operand(src1, ASR, src2.immediate()), s, cond);
-  }
-}
-
-void Assembler::lsl(Register dst, Register src1, const Operand& src2, SBit s,
-                    Condition cond) {
-  if (src2.IsRegister()) {
-    mov(dst, Operand(src1, LSL, src2.rm()), s, cond);
-  } else {
-    mov(dst, Operand(src1, LSL, src2.immediate()), s, cond);
-  }
-}
-
-void Assembler::lsr(Register dst, Register src1, const Operand& src2, SBit s,
-                    Condition cond) {
-  if (src2.IsRegister()) {
-    mov(dst, Operand(src1, LSR, src2.rm()), s, cond);
-  } else {
-    mov(dst, Operand(src1, LSR, src2.immediate()), s, cond);
-  }
-}
-
-// Multiply instructions.
-void Assembler::mla(Register dst, Register src1, Register src2, Register srcA,
-                    SBit s, Condition cond) {
-  DCHECK(dst != pc && src1 != pc && src2 != pc && srcA != pc);
-  emit(cond | A | s | dst.code()*B16 | srcA.code()*B12 |
-       src2.code()*B8 | B7 | B4 | src1.code());
-}
-
-
-void Assembler::mls(Register dst, Register src1, Register src2, Register srcA,
-                    Condition cond) {
-  DCHECK(dst != pc && src1 != pc && src2 != pc && srcA != pc);
-  DCHECK(IsEnabled(ARMv7));
-  emit(cond | B22 | B21 | dst.code()*B16 | srcA.code()*B12 |
-       src2.code()*B8 | B7 | B4 | src1.code());
-}
-
-
-void Assembler::sdiv(Register dst, Register src1, Register src2,
-                     Condition cond) {
-  DCHECK(dst != pc && src1 != pc && src2 != pc);
-  DCHECK(IsEnabled(SUDIV));
-  emit(cond | B26 | B25 | B24 | B20 | dst.code() * B16 | 0xF * B12 |
-       src2.code() * B8 | B4 | src1.code());
-}
-
-
-void Assembler::udiv(Register dst, Register src1, Register src2,
-                     Condition cond) {
-  DCHECK(dst != pc && src1 != pc && src2 != pc);
-  DCHECK(IsEnabled(SUDIV));
-  emit(cond | B26 | B25 | B24 | B21 | B20 | dst.code() * B16 | 0xF * B12 |
-       src2.code() * B8 | B4 | src1.code());
-}
-
-
-void Assembler::mul(Register dst, Register src1, Register src2, SBit s,
-                    Condition cond) {
-  DCHECK(dst != pc && src1 != pc && src2 != pc);
-  // dst goes in bits 16-19 for this instruction!
-  emit(cond | s | dst.code() * B16 | src2.code() * B8 | B7 | B4 | src1.code());
-}
-
-
-void Assembler::smmla(Register dst, Register src1, Register src2, Register srcA,
-                      Condition cond) {
-  DCHECK(dst != pc && src1 != pc && src2 != pc && srcA != pc);
-  emit(cond | B26 | B25 | B24 | B22 | B20 | dst.code() * B16 |
-       srcA.code() * B12 | src2.code() * B8 | B4 | src1.code());
-}
-
-
-void Assembler::smmul(Register dst, Register src1, Register src2,
-                      Condition cond) {
-  DCHECK(dst != pc && src1 != pc && src2 != pc);
-  emit(cond | B26 | B25 | B24 | B22 | B20 | dst.code() * B16 | 0xF * B12 |
-       src2.code() * B8 | B4 | src1.code());
-}
-
-
-void Assembler::smlal(Register dstL,
-                      Register dstH,
-                      Register src1,
-                      Register src2,
-                      SBit s,
-                      Condition cond) {
-  DCHECK(dstL != pc && dstH != pc && src1 != pc && src2 != pc);
-  DCHECK(dstL != dstH);
-  emit(cond | B23 | B22 | A | s | dstH.code()*B16 | dstL.code()*B12 |
-       src2.code()*B8 | B7 | B4 | src1.code());
-}
-
-
-void Assembler::smull(Register dstL,
-                      Register dstH,
-                      Register src1,
-                      Register src2,
-                      SBit s,
-                      Condition cond) {
-  DCHECK(dstL != pc && dstH != pc && src1 != pc && src2 != pc);
-  DCHECK(dstL != dstH);
-  emit(cond | B23 | B22 | s | dstH.code()*B16 | dstL.code()*B12 |
-       src2.code()*B8 | B7 | B4 | src1.code());
-}
-
-
-void Assembler::umlal(Register dstL,
-                      Register dstH,
-                      Register src1,
-                      Register src2,
-                      SBit s,
-                      Condition cond) {
-  DCHECK(dstL != pc && dstH != pc && src1 != pc && src2 != pc);
-  DCHECK(dstL != dstH);
-  emit(cond | B23 | A | s | dstH.code()*B16 | dstL.code()*B12 |
-       src2.code()*B8 | B7 | B4 | src1.code());
-}
-
-
-void Assembler::umull(Register dstL,
-                      Register dstH,
-                      Register src1,
-                      Register src2,
-                      SBit s,
-                      Condition cond) {
-  DCHECK(dstL != pc && dstH != pc && src1 != pc && src2 != pc);
-  DCHECK(dstL != dstH);
-  emit(cond | B23 | s | dstH.code()*B16 | dstL.code()*B12 |
-       src2.code()*B8 | B7 | B4 | src1.code());
-}
-
-
-// Miscellaneous arithmetic instructions.
-void Assembler::clz(Register dst, Register src, Condition cond) {
-  DCHECK(dst != pc && src != pc);
-  emit(cond | B24 | B22 | B21 | 15*B16 | dst.code()*B12 |
-       15*B8 | CLZ | src.code());
-}
-
-
-// Saturating instructions.
-
-// Unsigned saturate.
-void Assembler::usat(Register dst,
-                     int satpos,
-                     const Operand& src,
-                     Condition cond) {
-  DCHECK(dst != pc && src.rm_ != pc);
-  DCHECK((satpos >= 0) && (satpos <= 31));
-  DCHECK(src.IsImmediateShiftedRegister());
-  DCHECK((src.shift_op_ == ASR) || (src.shift_op_ == LSL));
-
-  int sh = 0;
-  if (src.shift_op_ == ASR) {
-      sh = 1;
-  }
-
-  emit(cond | 0x6 * B24 | 0xE * B20 | satpos * B16 | dst.code() * B12 |
-       src.shift_imm_ * B7 | sh * B6 | 0x1 * B4 | src.rm_.code());
-}
-
-
-// Bitfield manipulation instructions.
-
-// Unsigned bit field extract.
-// Extracts #width adjacent bits from position #lsb in a register, and
-// writes them to the low bits of a destination register.
-//   ubfx dst, src, #lsb, #width
-void Assembler::ubfx(Register dst,
-                     Register src,
-                     int lsb,
-                     int width,
-                     Condition cond) {
-  DCHECK(IsEnabled(ARMv7));
-  DCHECK(dst != pc && src != pc);
-  DCHECK((lsb >= 0) && (lsb <= 31));
-  DCHECK((width >= 1) && (width <= (32 - lsb)));
-  emit(cond | 0xF * B23 | B22 | B21 | (width - 1) * B16 | dst.code() * B12 |
-       lsb * B7 | B6 | B4 | src.code());
-}
-
-
-// Signed bit field extract.
-// Extracts #width adjacent bits from position #lsb in a register, and
-// writes them to the low bits of a destination register. The extracted
-// value is sign extended to fill the destination register.
-//   sbfx dst, src, #lsb, #width
-void Assembler::sbfx(Register dst,
-                     Register src,
-                     int lsb,
-                     int width,
-                     Condition cond) {
-  DCHECK(IsEnabled(ARMv7));
-  DCHECK(dst != pc && src != pc);
-  DCHECK((lsb >= 0) && (lsb <= 31));
-  DCHECK((width >= 1) && (width <= (32 - lsb)));
-  emit(cond | 0xF * B23 | B21 | (width - 1) * B16 | dst.code() * B12 |
-       lsb * B7 | B6 | B4 | src.code());
-}
-
-
-// Bit field clear.
-// Sets #width adjacent bits at position #lsb in the destination register
-// to zero, preserving the value of the other bits.
-//   bfc dst, #lsb, #width
-void Assembler::bfc(Register dst, int lsb, int width, Condition cond) {
-  DCHECK(IsEnabled(ARMv7));
-  DCHECK(dst != pc);
-  DCHECK((lsb >= 0) && (lsb <= 31));
-  DCHECK((width >= 1) && (width <= (32 - lsb)));
-  int msb = lsb + width - 1;
-  emit(cond | 0x1F * B22 | msb * B16 | dst.code() * B12 | lsb * B7 | B4 | 0xF);
-}
-
-
-// Bit field insert.
-// Inserts #width adjacent bits from the low bits of the source register
-// into position #lsb of the destination register.
-//   bfi dst, src, #lsb, #width
-void Assembler::bfi(Register dst,
-                    Register src,
-                    int lsb,
-                    int width,
-                    Condition cond) {
-  DCHECK(IsEnabled(ARMv7));
-  DCHECK(dst != pc && src != pc);
-  DCHECK((lsb >= 0) && (lsb <= 31));
-  DCHECK((width >= 1) && (width <= (32 - lsb)));
-  int msb = lsb + width - 1;
-  emit(cond | 0x1F * B22 | msb * B16 | dst.code() * B12 | lsb * B7 | B4 |
-       src.code());
-}
-
-
-void Assembler::pkhbt(Register dst,
-                      Register src1,
-                      const Operand& src2,
-                      Condition cond ) {
-  // Instruction details available in ARM DDI 0406C.b, A8.8.125.
-  // cond(31-28) | 01101000(27-20) | Rn(19-16) |
-  // Rd(15-12) | imm5(11-7) | 0(6) | 01(5-4) | Rm(3-0)
-  DCHECK(dst != pc);
-  DCHECK(src1 != pc);
-  DCHECK(src2.IsImmediateShiftedRegister());
-  DCHECK(src2.rm() != pc);
-  DCHECK((src2.shift_imm_ >= 0) && (src2.shift_imm_ <= 31));
-  DCHECK(src2.shift_op() == LSL);
-  emit(cond | 0x68*B20 | src1.code()*B16 | dst.code()*B12 |
-       src2.shift_imm_*B7 | B4 | src2.rm().code());
-}
-
-
-void Assembler::pkhtb(Register dst,
-                      Register src1,
-                      const Operand& src2,
-                      Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8.8.125.
-  // cond(31-28) | 01101000(27-20) | Rn(19-16) |
-  // Rd(15-12) | imm5(11-7) | 1(6) | 01(5-4) | Rm(3-0)
-  DCHECK(dst != pc);
-  DCHECK(src1 != pc);
-  DCHECK(src2.IsImmediateShiftedRegister());
-  DCHECK(src2.rm() != pc);
-  DCHECK((src2.shift_imm_ >= 1) && (src2.shift_imm_ <= 32));
-  DCHECK(src2.shift_op() == ASR);
-  int asr = (src2.shift_imm_ == 32) ? 0 : src2.shift_imm_;
-  emit(cond | 0x68*B20 | src1.code()*B16 | dst.code()*B12 |
-       asr*B7 | B6 | B4 | src2.rm().code());
-}
-
-
-void Assembler::sxtb(Register dst, Register src, int rotate, Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8.8.233.
-  // cond(31-28) | 01101010(27-20) | 1111(19-16) |
-  // Rd(15-12) | rotate(11-10) | 00(9-8)| 0111(7-4) | Rm(3-0)
-  DCHECK(dst != pc);
-  DCHECK(src != pc);
-  DCHECK(rotate == 0 || rotate == 8 || rotate == 16 || rotate == 24);
-  emit(cond | 0x6A * B20 | 0xF * B16 | dst.code() * B12 |
-       ((rotate >> 1) & 0xC) * B8 | 7 * B4 | src.code());
-}
-
-
-void Assembler::sxtab(Register dst, Register src1, Register src2, int rotate,
-                      Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8.8.233.
-  // cond(31-28) | 01101010(27-20) | Rn(19-16) |
-  // Rd(15-12) | rotate(11-10) | 00(9-8)| 0111(7-4) | Rm(3-0)
-  DCHECK(dst != pc);
-  DCHECK(src1 != pc);
-  DCHECK(src2 != pc);
-  DCHECK(rotate == 0 || rotate == 8 || rotate == 16 || rotate == 24);
-  emit(cond | 0x6A * B20 | src1.code() * B16 | dst.code() * B12 |
-       ((rotate >> 1) & 0xC) * B8 | 7 * B4 | src2.code());
-}
-
-
-void Assembler::sxth(Register dst, Register src, int rotate, Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8.8.235.
-  // cond(31-28) | 01101011(27-20) | 1111(19-16) |
-  // Rd(15-12) | rotate(11-10) | 00(9-8)| 0111(7-4) | Rm(3-0)
-  DCHECK(dst != pc);
-  DCHECK(src != pc);
-  DCHECK(rotate == 0 || rotate == 8 || rotate == 16 || rotate == 24);
-  emit(cond | 0x6B * B20 | 0xF * B16 | dst.code() * B12 |
-       ((rotate >> 1) & 0xC) * B8 | 7 * B4 | src.code());
-}
-
-
-void Assembler::sxtah(Register dst, Register src1, Register src2, int rotate,
-                      Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8.8.235.
-  // cond(31-28) | 01101011(27-20) | Rn(19-16) |
-  // Rd(15-12) | rotate(11-10) | 00(9-8)| 0111(7-4) | Rm(3-0)
-  DCHECK(dst != pc);
-  DCHECK(src1 != pc);
-  DCHECK(src2 != pc);
-  DCHECK(rotate == 0 || rotate == 8 || rotate == 16 || rotate == 24);
-  emit(cond | 0x6B * B20 | src1.code() * B16 | dst.code() * B12 |
-       ((rotate >> 1) & 0xC) * B8 | 7 * B4 | src2.code());
-}
-
-
-void Assembler::uxtb(Register dst, Register src, int rotate, Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8.8.274.
-  // cond(31-28) | 01101110(27-20) | 1111(19-16) |
-  // Rd(15-12) | rotate(11-10) | 00(9-8)| 0111(7-4) | Rm(3-0)
-  DCHECK(dst != pc);
-  DCHECK(src != pc);
-  DCHECK(rotate == 0 || rotate == 8 || rotate == 16 || rotate == 24);
-  emit(cond | 0x6E * B20 | 0xF * B16 | dst.code() * B12 |
-       ((rotate >> 1) & 0xC) * B8 | 7 * B4 | src.code());
-}
-
-
-void Assembler::uxtab(Register dst, Register src1, Register src2, int rotate,
-                      Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8.8.271.
-  // cond(31-28) | 01101110(27-20) | Rn(19-16) |
-  // Rd(15-12) | rotate(11-10) | 00(9-8)| 0111(7-4) | Rm(3-0)
-  DCHECK(dst != pc);
-  DCHECK(src1 != pc);
-  DCHECK(src2 != pc);
-  DCHECK(rotate == 0 || rotate == 8 || rotate == 16 || rotate == 24);
-  emit(cond | 0x6E * B20 | src1.code() * B16 | dst.code() * B12 |
-       ((rotate >> 1) & 0xC) * B8 | 7 * B4 | src2.code());
-}
-
-
-void Assembler::uxtb16(Register dst, Register src, int rotate, Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8.8.275.
-  // cond(31-28) | 01101100(27-20) | 1111(19-16) |
-  // Rd(15-12) | rotate(11-10) | 00(9-8)| 0111(7-4) | Rm(3-0)
-  DCHECK(dst != pc);
-  DCHECK(src != pc);
-  DCHECK(rotate == 0 || rotate == 8 || rotate == 16 || rotate == 24);
-  emit(cond | 0x6C * B20 | 0xF * B16 | dst.code() * B12 |
-       ((rotate >> 1) & 0xC) * B8 | 7 * B4 | src.code());
-}
-
-
-void Assembler::uxth(Register dst, Register src, int rotate, Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8.8.276.
-  // cond(31-28) | 01101111(27-20) | 1111(19-16) |
-  // Rd(15-12) | rotate(11-10) | 00(9-8)| 0111(7-4) | Rm(3-0)
-  DCHECK(dst != pc);
-  DCHECK(src != pc);
-  DCHECK(rotate == 0 || rotate == 8 || rotate == 16 || rotate == 24);
-  emit(cond | 0x6F * B20 | 0xF * B16 | dst.code() * B12 |
-       ((rotate >> 1) & 0xC) * B8 | 7 * B4 | src.code());
-}
-
-
-void Assembler::uxtah(Register dst, Register src1, Register src2, int rotate,
-                      Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8.8.273.
-  // cond(31-28) | 01101111(27-20) | Rn(19-16) |
-  // Rd(15-12) | rotate(11-10) | 00(9-8)| 0111(7-4) | Rm(3-0)
-  DCHECK(dst != pc);
-  DCHECK(src1 != pc);
-  DCHECK(src2 != pc);
-  DCHECK(rotate == 0 || rotate == 8 || rotate == 16 || rotate == 24);
-  emit(cond | 0x6F * B20 | src1.code() * B16 | dst.code() * B12 |
-       ((rotate >> 1) & 0xC) * B8 | 7 * B4 | src2.code());
-}
-
-
-void Assembler::rbit(Register dst, Register src, Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8.8.144.
-  // cond(31-28) | 011011111111(27-16) | Rd(15-12) | 11110011(11-4) | Rm(3-0)
-  DCHECK(IsEnabled(ARMv7));
-  DCHECK(dst != pc);
-  DCHECK(src != pc);
-  emit(cond | 0x6FF * B16 | dst.code() * B12 | 0xF3 * B4 | src.code());
-}
-
-
-// Status register access instructions.
-void Assembler::mrs(Register dst, SRegister s, Condition cond) {
-  DCHECK(dst != pc);
-  emit(cond | B24 | s | 15*B16 | dst.code()*B12);
-}
-
-
-void Assembler::msr(SRegisterFieldMask fields, const Operand& src,
-                    Condition cond) {
-  DCHECK_NE(fields & 0x000F0000, 0);  // At least one field must be set.
-  DCHECK(((fields & 0xFFF0FFFF) == CPSR) || ((fields & 0xFFF0FFFF) == SPSR));
-  Instr instr;
-  if (src.IsImmediate()) {
-    // Immediate.
-    uint32_t rotate_imm;
-    uint32_t immed_8;
-    if (src.MustOutputRelocInfo(this) ||
-        !FitsShifter(src.immediate(), &rotate_imm, &immed_8, nullptr)) {
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      // Immediate operand cannot be encoded, load it first to a scratch
-      // register.
-      Move32BitImmediate(scratch, src);
-      msr(fields, Operand(scratch), cond);
-      return;
-    }
-    instr = I | rotate_imm*B8 | immed_8;
-  } else {
-    DCHECK(src.IsRegister());  // Only rm is allowed.
-    instr = src.rm_.code();
-  }
-  emit(cond | instr | B24 | B21 | fields | 15*B12);
-}
-
-
-// Load/Store instructions.
-void Assembler::ldr(Register dst, const MemOperand& src, Condition cond) {
-  AddrMode2(cond | B26 | L, dst, src);
-}
-
-
-void Assembler::str(Register src, const MemOperand& dst, Condition cond) {
-  AddrMode2(cond | B26, src, dst);
-}
-
-
-void Assembler::ldrb(Register dst, const MemOperand& src, Condition cond) {
-  AddrMode2(cond | B26 | B | L, dst, src);
-}
-
-
-void Assembler::strb(Register src, const MemOperand& dst, Condition cond) {
-  AddrMode2(cond | B26 | B, src, dst);
-}
-
-
-void Assembler::ldrh(Register dst, const MemOperand& src, Condition cond) {
-  AddrMode3(cond | L | B7 | H | B4, dst, src);
-}
-
-
-void Assembler::strh(Register src, const MemOperand& dst, Condition cond) {
-  AddrMode3(cond | B7 | H | B4, src, dst);
-}
-
-
-void Assembler::ldrsb(Register dst, const MemOperand& src, Condition cond) {
-  AddrMode3(cond | L | B7 | S6 | B4, dst, src);
-}
-
-
-void Assembler::ldrsh(Register dst, const MemOperand& src, Condition cond) {
-  AddrMode3(cond | L | B7 | S6 | H | B4, dst, src);
-}
-
-
-void Assembler::ldrd(Register dst1, Register dst2,
-                     const MemOperand& src, Condition cond) {
-  DCHECK(src.rm() == no_reg);
-  DCHECK(dst1 != lr);  // r14.
-  DCHECK_EQ(0, dst1.code() % 2);
-  DCHECK_EQ(dst1.code() + 1, dst2.code());
-  AddrMode3(cond | B7 | B6 | B4, dst1, src);
-}
-
-
-void Assembler::strd(Register src1, Register src2,
-                     const MemOperand& dst, Condition cond) {
-  DCHECK(dst.rm() == no_reg);
-  DCHECK(src1 != lr);  // r14.
-  DCHECK_EQ(0, src1.code() % 2);
-  DCHECK_EQ(src1.code() + 1, src2.code());
-  AddrMode3(cond | B7 | B6 | B5 | B4, src1, dst);
-}
-
-void Assembler::ldr_pcrel(Register dst, int imm12, Condition cond) {
-  AddrMode am = Offset;
-  if (imm12 < 0) {
-    imm12 = -imm12;
-    am = NegOffset;
-  }
-  DCHECK(is_uint12(imm12));
-  emit(cond | B26 | am | L | pc.code() * B16 | dst.code() * B12 | imm12);
-}
-
-// Load/Store exclusive instructions.
-void Assembler::ldrex(Register dst, Register src, Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8.8.75.
-  // cond(31-28) | 00011001(27-20) | Rn(19-16) | Rt(15-12) | 111110011111(11-0)
-  DCHECK(dst != pc);
-  DCHECK(src != pc);
-  emit(cond | B24 | B23 | B20 | src.code() * B16 | dst.code() * B12 | 0xF9F);
-}
-
-void Assembler::strex(Register src1, Register src2, Register dst,
-                      Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8.8.212.
-  // cond(31-28) | 00011000(27-20) | Rn(19-16) | Rd(15-12) | 11111001(11-4) |
-  // Rt(3-0)
-  DCHECK(dst != pc);
-  DCHECK(src1 != pc);
-  DCHECK(src2 != pc);
-  DCHECK(src1 != dst);
-  DCHECK(src1 != src2);
-  emit(cond | B24 | B23 | dst.code() * B16 | src1.code() * B12 | 0xF9 * B4 |
-       src2.code());
-}
-
-void Assembler::ldrexb(Register dst, Register src, Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8.8.76.
-  // cond(31-28) | 00011101(27-20) | Rn(19-16) | Rt(15-12) | 111110011111(11-0)
-  DCHECK(dst != pc);
-  DCHECK(src != pc);
-  emit(cond | B24 | B23 | B22 | B20 | src.code() * B16 | dst.code() * B12 |
-       0xF9F);
-}
-
-void Assembler::strexb(Register src1, Register src2, Register dst,
-                       Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8.8.213.
-  // cond(31-28) | 00011100(27-20) | Rn(19-16) | Rd(15-12) | 11111001(11-4) |
-  // Rt(3-0)
-  DCHECK(dst != pc);
-  DCHECK(src1 != pc);
-  DCHECK(src2 != pc);
-  DCHECK(src1 != dst);
-  DCHECK(src1 != src2);
-  emit(cond | B24 | B23 | B22 | dst.code() * B16 | src1.code() * B12 |
-       0xF9 * B4 | src2.code());
-}
-
-void Assembler::ldrexh(Register dst, Register src, Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8.8.78.
-  // cond(31-28) | 00011111(27-20) | Rn(19-16) | Rt(15-12) | 111110011111(11-0)
-  DCHECK(dst != pc);
-  DCHECK(src != pc);
-  emit(cond | B24 | B23 | B22 | B21 | B20 | src.code() * B16 |
-       dst.code() * B12 | 0xF9F);
-}
-
-void Assembler::strexh(Register src1, Register src2, Register dst,
-                       Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8.8.215.
-  // cond(31-28) | 00011110(27-20) | Rn(19-16) | Rd(15-12) | 11111001(11-4) |
-  // Rt(3-0)
-  DCHECK(dst != pc);
-  DCHECK(src1 != pc);
-  DCHECK(src2 != pc);
-  DCHECK(src1 != dst);
-  DCHECK(src1 != src2);
-  emit(cond | B24 | B23 | B22 | B21 | dst.code() * B16 | src1.code() * B12 |
-       0xF9 * B4 | src2.code());
-}
-
-// Preload instructions.
-void Assembler::pld(const MemOperand& address) {
-  // Instruction details available in ARM DDI 0406C.b, A8.8.128.
-  // 1111(31-28) | 0111(27-24) | U(23) | R(22) | 01(21-20) | Rn(19-16) |
-  // 1111(15-12) | imm5(11-07) | type(6-5) | 0(4)| Rm(3-0) |
-  DCHECK(address.rm() == no_reg);
-  DCHECK(address.am() == Offset);
-  int U = B23;
-  int offset = address.offset();
-  if (offset < 0) {
-    offset = -offset;
-    U = 0;
-  }
-  DCHECK_LT(offset, 4096);
-  emit(kSpecialCondition | B26 | B24 | U | B22 | B20 |
-       address.rn().code() * B16 | 0xF * B12 | offset);
-}
-
-
-// Load/Store multiple instructions.
-void Assembler::ldm(BlockAddrMode am,
-                    Register base,
-                    RegList dst,
-                    Condition cond) {
-  // ABI stack constraint: ldmxx base, {..sp..}  base != sp  is not restartable.
-  DCHECK(base == sp || (dst & sp.bit()) == 0);
-
-  AddrMode4(cond | B27 | am | L, base, dst);
-
-  // Emit the constant pool after a function return implemented by ldm ..{..pc}.
-  if (cond == al && (dst & pc.bit()) != 0) {
-    // There is a slight chance that the ldm instruction was actually a call,
-    // in which case it would be wrong to return into the constant pool; we
-    // recognize this case by checking if the emission of the pool was blocked
-    // at the pc of the ldm instruction by a mov lr, pc instruction; if this is
-    // the case, we emit a jump over the pool.
-    CheckConstPool(true, no_const_pool_before_ == pc_offset() - kInstrSize);
-  }
-}
-
-
-void Assembler::stm(BlockAddrMode am,
-                    Register base,
-                    RegList src,
-                    Condition cond) {
-  AddrMode4(cond | B27 | am, base, src);
-}
-
-
-// Exception-generating instructions and debugging support.
-// Stops with a non-negative code less than kNumOfWatchedStops support
-// enabling/disabling and a counter feature. See simulator-arm.h .
-void Assembler::stop(const char* msg, Condition cond, int32_t code) {
-#ifndef __arm__
-  DCHECK_GE(code, kDefaultStopCode);
-  {
-    BlockConstPoolScope block_const_pool(this);
-    if (code >= 0) {
-      svc(kStopCode + code, cond);
-    } else {
-      svc(kStopCode + kMaxStopCode, cond);
-    }
-  }
-#else  // def __arm__
-  if (cond != al) {
-    Label skip;
-    b(&skip, NegateCondition(cond));
-    bkpt(0);
-    bind(&skip);
-  } else {
-    bkpt(0);
-  }
-#endif  // def __arm__
-}
-
-void Assembler::bkpt(uint32_t imm16) {
-  DCHECK(is_uint16(imm16));
-  emit(al | B24 | B21 | (imm16 >> 4) * B8 | BKPT | (imm16 & 0xF));
-}
-
-
-void Assembler::svc(uint32_t imm24, Condition cond) {
-  DCHECK(is_uint24(imm24));
-  emit(cond | 15*B24 | imm24);
-}
-
-
-void Assembler::dmb(BarrierOption option) {
-  if (CpuFeatures::IsSupported(ARMv7)) {
-    // Details available in ARM DDI 0406C.b, A8-378.
-    emit(kSpecialCondition | 0x57FF * B12 | 5 * B4 | option);
-  } else {
-    // Details available in ARM DDI 0406C.b, B3-1750.
-    // CP15DMB: CRn=c7, opc1=0, CRm=c10, opc2=5, Rt is ignored.
-    mcr(p15, 0, r0, cr7, cr10, 5);
-  }
-}
-
-
-void Assembler::dsb(BarrierOption option) {
-  if (CpuFeatures::IsSupported(ARMv7)) {
-    // Details available in ARM DDI 0406C.b, A8-380.
-    emit(kSpecialCondition | 0x57FF * B12 | 4 * B4 | option);
-  } else {
-    // Details available in ARM DDI 0406C.b, B3-1750.
-    // CP15DSB: CRn=c7, opc1=0, CRm=c10, opc2=4, Rt is ignored.
-    mcr(p15, 0, r0, cr7, cr10, 4);
-  }
-}
-
-
-void Assembler::isb(BarrierOption option) {
-  if (CpuFeatures::IsSupported(ARMv7)) {
-    // Details available in ARM DDI 0406C.b, A8-389.
-    emit(kSpecialCondition | 0x57FF * B12 | 6 * B4 | option);
-  } else {
-    // Details available in ARM DDI 0406C.b, B3-1750.
-    // CP15ISB: CRn=c7, opc1=0, CRm=c5, opc2=4, Rt is ignored.
-    mcr(p15, 0, r0, cr7, cr5, 4);
-  }
-}
-
-
-// Coprocessor instructions.
-void Assembler::cdp(Coprocessor coproc,
-                    int opcode_1,
-                    CRegister crd,
-                    CRegister crn,
-                    CRegister crm,
-                    int opcode_2,
-                    Condition cond) {
-  DCHECK(is_uint4(opcode_1) && is_uint3(opcode_2));
-  emit(cond | B27 | B26 | B25 | (opcode_1 & 15)*B20 | crn.code()*B16 |
-       crd.code()*B12 | coproc*B8 | (opcode_2 & 7)*B5 | crm.code());
-}
-
-void Assembler::cdp2(Coprocessor coproc, int opcode_1, CRegister crd,
-                     CRegister crn, CRegister crm, int opcode_2) {
-  cdp(coproc, opcode_1, crd, crn, crm, opcode_2, kSpecialCondition);
-}
-
-
-void Assembler::mcr(Coprocessor coproc,
-                    int opcode_1,
-                    Register rd,
-                    CRegister crn,
-                    CRegister crm,
-                    int opcode_2,
-                    Condition cond) {
-  DCHECK(is_uint3(opcode_1) && is_uint3(opcode_2));
-  emit(cond | B27 | B26 | B25 | (opcode_1 & 7)*B21 | crn.code()*B16 |
-       rd.code()*B12 | coproc*B8 | (opcode_2 & 7)*B5 | B4 | crm.code());
-}
-
-void Assembler::mcr2(Coprocessor coproc, int opcode_1, Register rd,
-                     CRegister crn, CRegister crm, int opcode_2) {
-  mcr(coproc, opcode_1, rd, crn, crm, opcode_2, kSpecialCondition);
-}
-
-
-void Assembler::mrc(Coprocessor coproc,
-                    int opcode_1,
-                    Register rd,
-                    CRegister crn,
-                    CRegister crm,
-                    int opcode_2,
-                    Condition cond) {
-  DCHECK(is_uint3(opcode_1) && is_uint3(opcode_2));
-  emit(cond | B27 | B26 | B25 | (opcode_1 & 7)*B21 | L | crn.code()*B16 |
-       rd.code()*B12 | coproc*B8 | (opcode_2 & 7)*B5 | B4 | crm.code());
-}
-
-void Assembler::mrc2(Coprocessor coproc, int opcode_1, Register rd,
-                     CRegister crn, CRegister crm, int opcode_2) {
-  mrc(coproc, opcode_1, rd, crn, crm, opcode_2, kSpecialCondition);
-}
-
-
-void Assembler::ldc(Coprocessor coproc,
-                    CRegister crd,
-                    const MemOperand& src,
-                    LFlag l,
-                    Condition cond) {
-  AddrMode5(cond | B27 | B26 | l | L | coproc * B8, crd, src);
-}
-
-
-void Assembler::ldc(Coprocessor coproc,
-                    CRegister crd,
-                    Register rn,
-                    int option,
-                    LFlag l,
-                    Condition cond) {
-  // Unindexed addressing.
-  DCHECK(is_uint8(option));
-  emit(cond | B27 | B26 | U | l | L | rn.code()*B16 | crd.code()*B12 |
-       coproc*B8 | (option & 255));
-}
-
-void Assembler::ldc2(Coprocessor coproc, CRegister crd, const MemOperand& src,
-                     LFlag l) {
-  ldc(coproc, crd, src, l, kSpecialCondition);
-}
-
-void Assembler::ldc2(Coprocessor coproc, CRegister crd, Register rn, int option,
-                     LFlag l) {
-  ldc(coproc, crd, rn, option, l, kSpecialCondition);
-}
-
-
-// Support for VFP.
-
-void Assembler::vldr(const DwVfpRegister dst,
-                     const Register base,
-                     int offset,
-                     const Condition cond) {
-  // Ddst = MEM(Rbase + offset).
-  // Instruction details available in ARM DDI 0406C.b, A8-924.
-  // cond(31-28) | 1101(27-24)| U(23) | D(22) | 01(21-20) | Rbase(19-16) |
-  // Vd(15-12) | 1011(11-8) | offset
-  DCHECK(VfpRegisterIsAvailable(dst));
-  int u = 1;
-  if (offset < 0) {
-    CHECK_NE(offset, kMinInt);
-    offset = -offset;
-    u = 0;
-  }
-  int vd, d;
-  dst.split_code(&vd, &d);
-
-  DCHECK_GE(offset, 0);
-  if ((offset % 4) == 0 && (offset / 4) < 256) {
-    emit(cond | 0xD*B24 | u*B23 | d*B22 | B20 | base.code()*B16 | vd*B12 |
-         0xB*B8 | ((offset / 4) & 255));
-  } else {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    // Larger offsets must be handled by computing the correct address in a
-    // scratch register.
-    DCHECK(base != scratch);
-    if (u == 1) {
-      add(scratch, base, Operand(offset));
-    } else {
-      sub(scratch, base, Operand(offset));
-    }
-    emit(cond | 0xD * B24 | d * B22 | B20 | scratch.code() * B16 | vd * B12 |
-         0xB * B8);
-  }
-}
-
-
-void Assembler::vldr(const DwVfpRegister dst,
-                     const MemOperand& operand,
-                     const Condition cond) {
-  DCHECK(VfpRegisterIsAvailable(dst));
-  DCHECK(operand.am_ == Offset);
-  if (operand.rm().is_valid()) {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    add(scratch, operand.rn(),
-        Operand(operand.rm(), operand.shift_op_, operand.shift_imm_));
-    vldr(dst, scratch, 0, cond);
-  } else {
-    vldr(dst, operand.rn(), operand.offset(), cond);
-  }
-}
-
-
-void Assembler::vldr(const SwVfpRegister dst,
-                     const Register base,
-                     int offset,
-                     const Condition cond) {
-  // Sdst = MEM(Rbase + offset).
-  // Instruction details available in ARM DDI 0406A, A8-628.
-  // cond(31-28) | 1101(27-24)| U001(23-20) | Rbase(19-16) |
-  // Vdst(15-12) | 1010(11-8) | offset
-  int u = 1;
-  if (offset < 0) {
-    offset = -offset;
-    u = 0;
-  }
-  int sd, d;
-  dst.split_code(&sd, &d);
-  DCHECK_GE(offset, 0);
-
-  if ((offset % 4) == 0 && (offset / 4) < 256) {
-  emit(cond | u*B23 | d*B22 | 0xD1*B20 | base.code()*B16 | sd*B12 |
-       0xA*B8 | ((offset / 4) & 255));
-  } else {
-    // Larger offsets must be handled by computing the correct address in a
-    // scratch register.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(base != scratch);
-    if (u == 1) {
-      add(scratch, base, Operand(offset));
-    } else {
-      sub(scratch, base, Operand(offset));
-    }
-    emit(cond | d * B22 | 0xD1 * B20 | scratch.code() * B16 | sd * B12 |
-         0xA * B8);
-  }
-}
-
-
-void Assembler::vldr(const SwVfpRegister dst,
-                     const MemOperand& operand,
-                     const Condition cond) {
-  DCHECK(operand.am_ == Offset);
-  if (operand.rm().is_valid()) {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    add(scratch, operand.rn(),
-        Operand(operand.rm(), operand.shift_op_, operand.shift_imm_));
-    vldr(dst, scratch, 0, cond);
-  } else {
-    vldr(dst, operand.rn(), operand.offset(), cond);
-  }
-}
-
-
-void Assembler::vstr(const DwVfpRegister src,
-                     const Register base,
-                     int offset,
-                     const Condition cond) {
-  // MEM(Rbase + offset) = Dsrc.
-  // Instruction details available in ARM DDI 0406C.b, A8-1082.
-  // cond(31-28) | 1101(27-24)| U(23) | D(22) | 00(21-20) | Rbase(19-16) |
-  // Vd(15-12) | 1011(11-8) | (offset/4)
-  DCHECK(VfpRegisterIsAvailable(src));
-  int u = 1;
-  if (offset < 0) {
-    CHECK_NE(offset, kMinInt);
-    offset = -offset;
-    u = 0;
-  }
-  DCHECK_GE(offset, 0);
-  int vd, d;
-  src.split_code(&vd, &d);
-
-  if ((offset % 4) == 0 && (offset / 4) < 256) {
-    emit(cond | 0xD*B24 | u*B23 | d*B22 | base.code()*B16 | vd*B12 | 0xB*B8 |
-         ((offset / 4) & 255));
-  } else {
-    // Larger offsets must be handled by computing the correct address in the a
-    // scratch register.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(base != scratch);
-    if (u == 1) {
-      add(scratch, base, Operand(offset));
-    } else {
-      sub(scratch, base, Operand(offset));
-    }
-    emit(cond | 0xD * B24 | d * B22 | scratch.code() * B16 | vd * B12 |
-         0xB * B8);
-  }
-}
-
-
-void Assembler::vstr(const DwVfpRegister src,
-                     const MemOperand& operand,
-                     const Condition cond) {
-  DCHECK(VfpRegisterIsAvailable(src));
-  DCHECK(operand.am_ == Offset);
-  if (operand.rm().is_valid()) {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    add(scratch, operand.rn(),
-        Operand(operand.rm(), operand.shift_op_, operand.shift_imm_));
-    vstr(src, scratch, 0, cond);
-  } else {
-    vstr(src, operand.rn(), operand.offset(), cond);
-  }
-}
-
-
-void Assembler::vstr(const SwVfpRegister src,
-                     const Register base,
-                     int offset,
-                     const Condition cond) {
-  // MEM(Rbase + offset) = SSrc.
-  // Instruction details available in ARM DDI 0406A, A8-786.
-  // cond(31-28) | 1101(27-24)| U000(23-20) | Rbase(19-16) |
-  // Vdst(15-12) | 1010(11-8) | (offset/4)
-  int u = 1;
-  if (offset < 0) {
-    CHECK_NE(offset, kMinInt);
-    offset = -offset;
-    u = 0;
-  }
-  int sd, d;
-  src.split_code(&sd, &d);
-  DCHECK_GE(offset, 0);
-  if ((offset % 4) == 0 && (offset / 4) < 256) {
-    emit(cond | u*B23 | d*B22 | 0xD0*B20 | base.code()*B16 | sd*B12 |
-         0xA*B8 | ((offset / 4) & 255));
-  } else {
-    // Larger offsets must be handled by computing the correct address in a
-    // scratch register.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(base != scratch);
-    if (u == 1) {
-      add(scratch, base, Operand(offset));
-    } else {
-      sub(scratch, base, Operand(offset));
-    }
-    emit(cond | d * B22 | 0xD0 * B20 | scratch.code() * B16 | sd * B12 |
-         0xA * B8);
-  }
-}
-
-
-void Assembler::vstr(const SwVfpRegister src,
-                     const MemOperand& operand,
-                     const Condition cond) {
-  DCHECK(operand.am_ == Offset);
-  if (operand.rm().is_valid()) {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    add(scratch, operand.rn(),
-        Operand(operand.rm(), operand.shift_op_, operand.shift_imm_));
-    vstr(src, scratch, 0, cond);
-  } else {
-    vstr(src, operand.rn(), operand.offset(), cond);
-  }
-}
-
-void Assembler::vldm(BlockAddrMode am, Register base, DwVfpRegister first,
-                     DwVfpRegister last, Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8-922.
-  // cond(31-28) | 110(27-25)| PUDW1(24-20) | Rbase(19-16) |
-  // first(15-12) | 1011(11-8) | (count * 2)
-  DCHECK_LE(first.code(), last.code());
-  DCHECK(VfpRegisterIsAvailable(last));
-  DCHECK(am == ia || am == ia_w || am == db_w);
-  DCHECK(base != pc);
-
-  int sd, d;
-  first.split_code(&sd, &d);
-  int count = last.code() - first.code() + 1;
-  DCHECK_LE(count, 16);
-  emit(cond | B27 | B26 | am | d*B22 | B20 | base.code()*B16 | sd*B12 |
-       0xB*B8 | count*2);
-}
-
-void Assembler::vstm(BlockAddrMode am, Register base, DwVfpRegister first,
-                     DwVfpRegister last, Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8-1080.
-  // cond(31-28) | 110(27-25)| PUDW0(24-20) | Rbase(19-16) |
-  // first(15-12) | 1011(11-8) | (count * 2)
-  DCHECK_LE(first.code(), last.code());
-  DCHECK(VfpRegisterIsAvailable(last));
-  DCHECK(am == ia || am == ia_w || am == db_w);
-  DCHECK(base != pc);
-
-  int sd, d;
-  first.split_code(&sd, &d);
-  int count = last.code() - first.code() + 1;
-  DCHECK_LE(count, 16);
-  emit(cond | B27 | B26 | am | d*B22 | base.code()*B16 | sd*B12 |
-       0xB*B8 | count*2);
-}
-
-void Assembler::vldm(BlockAddrMode am, Register base, SwVfpRegister first,
-                     SwVfpRegister last, Condition cond) {
-  // Instruction details available in ARM DDI 0406A, A8-626.
-  // cond(31-28) | 110(27-25)| PUDW1(24-20) | Rbase(19-16) |
-  // first(15-12) | 1010(11-8) | (count/2)
-  DCHECK_LE(first.code(), last.code());
-  DCHECK(am == ia || am == ia_w || am == db_w);
-  DCHECK(base != pc);
-
-  int sd, d;
-  first.split_code(&sd, &d);
-  int count = last.code() - first.code() + 1;
-  emit(cond | B27 | B26 | am | d*B22 | B20 | base.code()*B16 | sd*B12 |
-       0xA*B8 | count);
-}
-
-void Assembler::vstm(BlockAddrMode am, Register base, SwVfpRegister first,
-                     SwVfpRegister last, Condition cond) {
-  // Instruction details available in ARM DDI 0406A, A8-784.
-  // cond(31-28) | 110(27-25)| PUDW0(24-20) | Rbase(19-16) |
-  // first(15-12) | 1011(11-8) | (count/2)
-  DCHECK_LE(first.code(), last.code());
-  DCHECK(am == ia || am == ia_w || am == db_w);
-  DCHECK(base != pc);
-
-  int sd, d;
-  first.split_code(&sd, &d);
-  int count = last.code() - first.code() + 1;
-  emit(cond | B27 | B26 | am | d*B22 | base.code()*B16 | sd*B12 |
-       0xA*B8 | count);
-}
-
-static void DoubleAsTwoUInt32(Double d, uint32_t* lo, uint32_t* hi) {
-  uint64_t i = d.AsUint64();
-
-  *lo = i & 0xFFFFFFFF;
-  *hi = i >> 32;
-}
-
-// Only works for little endian floating point formats.
-// We don't support VFP on the mixed endian floating point platform.
-static bool FitsVmovFPImmediate(Double d, uint32_t* encoding) {
-  // VMOV can accept an immediate of the form:
-  //
-  //  +/- m * 2^(-n) where 16 <= m <= 31 and 0 <= n <= 7
-  //
-  // The immediate is encoded using an 8-bit quantity, comprised of two
-  // 4-bit fields. For an 8-bit immediate of the form:
-  //
-  //  [abcdefgh]
-  //
-  // where a is the MSB and h is the LSB, an immediate 64-bit double can be
-  // created of the form:
-  //
-  //  [aBbbbbbb,bbcdefgh,00000000,00000000,
-  //      00000000,00000000,00000000,00000000]
-  //
-  // where B = ~b.
-  //
-
-  uint32_t lo, hi;
-  DoubleAsTwoUInt32(d, &lo, &hi);
-
-  // The most obvious constraint is the long block of zeroes.
-  if ((lo != 0) || ((hi & 0xFFFF) != 0)) {
-    return false;
-  }
-
-  // Bits 61:54 must be all clear or all set.
-  if (((hi & 0x3FC00000) != 0) && ((hi & 0x3FC00000) != 0x3FC00000)) {
-    return false;
-  }
-
-  // Bit 62 must be NOT bit 61.
-  if (((hi ^ (hi << 1)) & (0x40000000)) == 0) {
-    return false;
-  }
-
-  // Create the encoded immediate in the form:
-  //  [00000000,0000abcd,00000000,0000efgh]
-  *encoding = (hi >> 16) & 0xF;       // Low nybble.
-  *encoding |= (hi >> 4) & 0x70000;   // Low three bits of the high nybble.
-  *encoding |= (hi >> 12) & 0x80000;  // Top bit of the high nybble.
-
-  return true;
-}
-
-void Assembler::vmov(const SwVfpRegister dst, Float32 imm) {
-  uint32_t enc;
-  if (CpuFeatures::IsSupported(VFPv3) &&
-      FitsVmovFPImmediate(Double(imm.get_scalar()), &enc)) {
-    CpuFeatureScope scope(this, VFPv3);
-    // The float can be encoded in the instruction.
-    //
-    // Sd = immediate
-    // Instruction details available in ARM DDI 0406C.b, A8-936.
-    // cond(31-28) | 11101(27-23) | D(22) | 11(21-20) | imm4H(19-16) |
-    // Vd(15-12) | 101(11-9) | sz=0(8) | imm4L(3-0)
-    int vd, d;
-    dst.split_code(&vd, &d);
-    emit(al | 0x1D * B23 | d * B22 | 0x3 * B20 | vd * B12 | 0x5 * B9 | enc);
-  } else {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    mov(scratch, Operand(imm.get_bits()));
-    vmov(dst, scratch);
-  }
-}
-
-void Assembler::vmov(const DwVfpRegister dst, Double imm,
-                     const Register extra_scratch) {
-  DCHECK(VfpRegisterIsAvailable(dst));
-  uint32_t enc;
-  if (CpuFeatures::IsSupported(VFPv3) && FitsVmovFPImmediate(imm, &enc)) {
-    CpuFeatureScope scope(this, VFPv3);
-    // The double can be encoded in the instruction.
-    //
-    // Dd = immediate
-    // Instruction details available in ARM DDI 0406C.b, A8-936.
-    // cond(31-28) | 11101(27-23) | D(22) | 11(21-20) | imm4H(19-16) |
-    // Vd(15-12) | 101(11-9) | sz=1(8) | imm4L(3-0)
-    int vd, d;
-    dst.split_code(&vd, &d);
-    emit(al | 0x1D*B23 | d*B22 | 0x3*B20 | vd*B12 | 0x5*B9 | B8 | enc);
-  } else if (CpuFeatures::IsSupported(ARMv7) && FLAG_enable_vldr_imm) {
-    CpuFeatureScope scope(this, ARMv7);
-    // TODO(jfb) Temporarily turned off until we have constant blinding or
-    //           some equivalent mitigation: an attacker can otherwise control
-    //           generated data which also happens to be executable, a Very Bad
-    //           Thing indeed.
-    //           Blinding gets tricky because we don't have xor, we probably
-    //           need to add/subtract without losing precision, which requires a
-    //           cookie value that Lithium is probably better positioned to
-    //           choose.
-    //           We could also add a few peepholes here like detecting 0.0 and
-    //           -0.0 and doing a vmov from the sequestered d14, forcing denorms
-    //           to zero (we set flush-to-zero), and normalizing NaN values.
-    //           We could also detect redundant values.
-    //           The code could also randomize the order of values, though
-    //           that's tricky because vldr has a limited reach. Furthermore
-    //           it breaks load locality.
-    ConstantPoolAddEntry(pc_offset(), imm);
-    vldr(dst, MemOperand(pc, 0));
-  } else {
-    // Synthesise the double from ARM immediates.
-    uint32_t lo, hi;
-    DoubleAsTwoUInt32(imm, &lo, &hi);
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-
-    if (lo == hi) {
-      // Move the low and high parts of the double to a D register in one
-      // instruction.
-      mov(scratch, Operand(lo));
-      vmov(dst, scratch, scratch);
-    } else if (extra_scratch == no_reg) {
-      // We only have one spare scratch register.
-      mov(scratch, Operand(lo));
-      vmov(dst, VmovIndexLo, scratch);
-      if (((lo & 0xFFFF) == (hi & 0xFFFF)) && CpuFeatures::IsSupported(ARMv7)) {
-        CpuFeatureScope scope(this, ARMv7);
-        movt(scratch, hi >> 16);
-      } else {
-        mov(scratch, Operand(hi));
-      }
-      vmov(dst, VmovIndexHi, scratch);
-    } else {
-      // Move the low and high parts of the double to a D register in one
-      // instruction.
-      mov(scratch, Operand(lo));
-      mov(extra_scratch, Operand(hi));
-      vmov(dst, scratch, extra_scratch);
-    }
-  }
-}
-
-void Assembler::vmov(const SwVfpRegister dst,
-                     const SwVfpRegister src,
-                     const Condition cond) {
-  // Sd = Sm
-  // Instruction details available in ARM DDI 0406B, A8-642.
-  int sd, d, sm, m;
-  dst.split_code(&sd, &d);
-  src.split_code(&sm, &m);
-  emit(cond | 0xE*B24 | d*B22 | 0xB*B20 | sd*B12 | 0xA*B8 | B6 | m*B5 | sm);
-}
-
-
-void Assembler::vmov(const DwVfpRegister dst,
-                     const DwVfpRegister src,
-                     const Condition cond) {
-  // Dd = Dm
-  // Instruction details available in ARM DDI 0406C.b, A8-938.
-  // cond(31-28) | 11101(27-23) | D(22) | 11(21-20) | 0000(19-16) | Vd(15-12) |
-  // 101(11-9) | sz=1(8) | 0(7) | 1(6) | M(5) | 0(4) | Vm(3-0)
-  DCHECK(VfpRegisterIsAvailable(dst));
-  DCHECK(VfpRegisterIsAvailable(src));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vm, m;
-  src.split_code(&vm, &m);
-  emit(cond | 0x1D*B23 | d*B22 | 0x3*B20 | vd*B12 | 0x5*B9 | B8 | B6 | m*B5 |
-       vm);
-}
-
-void Assembler::vmov(const DwVfpRegister dst,
-                     const VmovIndex index,
-                     const Register src,
-                     const Condition cond) {
-  // Dd[index] = Rt
-  // Instruction details available in ARM DDI 0406C.b, A8-940.
-  // cond(31-28) | 1110(27-24) | 0(23) | opc1=0index(22-21) | 0(20) |
-  // Vd(19-16) | Rt(15-12) | 1011(11-8) | D(7) | opc2=00(6-5) | 1(4) | 0000(3-0)
-  DCHECK(VfpRegisterIsAvailable(dst));
-  DCHECK(index.index == 0 || index.index == 1);
-  int vd, d;
-  dst.split_code(&vd, &d);
-  emit(cond | 0xE*B24 | index.index*B21 | vd*B16 | src.code()*B12 | 0xB*B8 |
-       d*B7 | B4);
-}
-
-
-void Assembler::vmov(const Register dst,
-                     const VmovIndex index,
-                     const DwVfpRegister src,
-                     const Condition cond) {
-  // Dd[index] = Rt
-  // Instruction details available in ARM DDI 0406C.b, A8.8.342.
-  // cond(31-28) | 1110(27-24) | U=0(23) | opc1=0index(22-21) | 1(20) |
-  // Vn(19-16) | Rt(15-12) | 1011(11-8) | N(7) | opc2=00(6-5) | 1(4) | 0000(3-0)
-  DCHECK(VfpRegisterIsAvailable(src));
-  DCHECK(index.index == 0 || index.index == 1);
-  int vn, n;
-  src.split_code(&vn, &n);
-  emit(cond | 0xE*B24 | index.index*B21 | B20 | vn*B16 | dst.code()*B12 |
-       0xB*B8 | n*B7 | B4);
-}
-
-
-void Assembler::vmov(const DwVfpRegister dst,
-                     const Register src1,
-                     const Register src2,
-                     const Condition cond) {
-  // Dm = <Rt,Rt2>.
-  // Instruction details available in ARM DDI 0406C.b, A8-948.
-  // cond(31-28) | 1100(27-24)| 010(23-21) | op=0(20) | Rt2(19-16) |
-  // Rt(15-12) | 1011(11-8) | 00(7-6) | M(5) | 1(4) | Vm
-  DCHECK(VfpRegisterIsAvailable(dst));
-  DCHECK(src1 != pc && src2 != pc);
-  int vm, m;
-  dst.split_code(&vm, &m);
-  emit(cond | 0xC*B24 | B22 | src2.code()*B16 |
-       src1.code()*B12 | 0xB*B8 | m*B5 | B4 | vm);
-}
-
-
-void Assembler::vmov(const Register dst1,
-                     const Register dst2,
-                     const DwVfpRegister src,
-                     const Condition cond) {
-  // <Rt,Rt2> = Dm.
-  // Instruction details available in ARM DDI 0406C.b, A8-948.
-  // cond(31-28) | 1100(27-24)| 010(23-21) | op=1(20) | Rt2(19-16) |
-  // Rt(15-12) | 1011(11-8) | 00(7-6) | M(5) | 1(4) | Vm
-  DCHECK(VfpRegisterIsAvailable(src));
-  DCHECK(dst1 != pc && dst2 != pc);
-  int vm, m;
-  src.split_code(&vm, &m);
-  emit(cond | 0xC*B24 | B22 | B20 | dst2.code()*B16 |
-       dst1.code()*B12 | 0xB*B8 | m*B5 | B4 | vm);
-}
-
-
-void Assembler::vmov(const SwVfpRegister dst,
-                     const Register src,
-                     const Condition cond) {
-  // Sn = Rt.
-  // Instruction details available in ARM DDI 0406A, A8-642.
-  // cond(31-28) | 1110(27-24)| 000(23-21) | op=0(20) | Vn(19-16) |
-  // Rt(15-12) | 1010(11-8) | N(7)=0 | 00(6-5) | 1(4) | 0000(3-0)
-  DCHECK(src != pc);
-  int sn, n;
-  dst.split_code(&sn, &n);
-  emit(cond | 0xE*B24 | sn*B16 | src.code()*B12 | 0xA*B8 | n*B7 | B4);
-}
-
-
-void Assembler::vmov(const Register dst,
-                     const SwVfpRegister src,
-                     const Condition cond) {
-  // Rt = Sn.
-  // Instruction details available in ARM DDI 0406A, A8-642.
-  // cond(31-28) | 1110(27-24)| 000(23-21) | op=1(20) | Vn(19-16) |
-  // Rt(15-12) | 1010(11-8) | N(7)=0 | 00(6-5) | 1(4) | 0000(3-0)
-  DCHECK(dst != pc);
-  int sn, n;
-  src.split_code(&sn, &n);
-  emit(cond | 0xE*B24 | B20 | sn*B16 | dst.code()*B12 | 0xA*B8 | n*B7 | B4);
-}
-
-// Type of data to read from or write to VFP register.
-// Used as specifier in generic vcvt instruction.
-enum VFPType { S32, U32, F32, F64 };
-
-
-static bool IsSignedVFPType(VFPType type) {
-  switch (type) {
-    case S32:
-      return true;
-    case U32:
-      return false;
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-static bool IsIntegerVFPType(VFPType type) {
-  switch (type) {
-    case S32:
-    case U32:
-      return true;
-    case F32:
-    case F64:
-      return false;
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-static bool IsDoubleVFPType(VFPType type) {
-  switch (type) {
-    case F32:
-      return false;
-    case F64:
-      return true;
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-// Split five bit reg_code based on size of reg_type.
-//  32-bit register codes are Vm:M
-//  64-bit register codes are M:Vm
-// where Vm is four bits, and M is a single bit.
-static void SplitRegCode(VFPType reg_type,
-                         int reg_code,
-                         int* vm,
-                         int* m) {
-  DCHECK((reg_code >= 0) && (reg_code <= 31));
-  if (IsIntegerVFPType(reg_type) || !IsDoubleVFPType(reg_type)) {
-    SwVfpRegister::split_code(reg_code, vm, m);
-  } else {
-    DwVfpRegister::split_code(reg_code, vm, m);
-  }
-}
-
-
-// Encode vcvt.src_type.dst_type instruction.
-static Instr EncodeVCVT(const VFPType dst_type,
-                        const int dst_code,
-                        const VFPType src_type,
-                        const int src_code,
-                        VFPConversionMode mode,
-                        const Condition cond) {
-  DCHECK(src_type != dst_type);
-  int D, Vd, M, Vm;
-  SplitRegCode(src_type, src_code, &Vm, &M);
-  SplitRegCode(dst_type, dst_code, &Vd, &D);
-
-  if (IsIntegerVFPType(dst_type) || IsIntegerVFPType(src_type)) {
-    // Conversion between IEEE floating point and 32-bit integer.
-    // Instruction details available in ARM DDI 0406B, A8.6.295.
-    // cond(31-28) | 11101(27-23)| D(22) | 11(21-20) | 1(19) | opc2(18-16) |
-    // Vd(15-12) | 101(11-9) | sz(8) | op(7) | 1(6) | M(5) | 0(4) | Vm(3-0)
-    DCHECK(!IsIntegerVFPType(dst_type) || !IsIntegerVFPType(src_type));
-
-    int sz, opc2, op;
-
-    if (IsIntegerVFPType(dst_type)) {
-      opc2 = IsSignedVFPType(dst_type) ? 0x5 : 0x4;
-      sz = IsDoubleVFPType(src_type) ? 0x1 : 0x0;
-      op = mode;
-    } else {
-      DCHECK(IsIntegerVFPType(src_type));
-      opc2 = 0x0;
-      sz = IsDoubleVFPType(dst_type) ? 0x1 : 0x0;
-      op = IsSignedVFPType(src_type) ? 0x1 : 0x0;
-    }
-
-    return (cond | 0xE*B24 | B23 | D*B22 | 0x3*B20 | B19 | opc2*B16 |
-            Vd*B12 | 0x5*B9 | sz*B8 | op*B7 | B6 | M*B5 | Vm);
-  } else {
-    // Conversion between IEEE double and single precision.
-    // Instruction details available in ARM DDI 0406B, A8.6.298.
-    // cond(31-28) | 11101(27-23)| D(22) | 11(21-20) | 0111(19-16) |
-    // Vd(15-12) | 101(11-9) | sz(8) | 1(7) | 1(6) | M(5) | 0(4) | Vm(3-0)
-    int sz = IsDoubleVFPType(src_type) ? 0x1 : 0x0;
-    return (cond | 0xE*B24 | B23 | D*B22 | 0x3*B20 | 0x7*B16 |
-            Vd*B12 | 0x5*B9 | sz*B8 | B7 | B6 | M*B5 | Vm);
-  }
-}
-
-
-void Assembler::vcvt_f64_s32(const DwVfpRegister dst,
-                             const SwVfpRegister src,
-                             VFPConversionMode mode,
-                             const Condition cond) {
-  DCHECK(VfpRegisterIsAvailable(dst));
-  emit(EncodeVCVT(F64, dst.code(), S32, src.code(), mode, cond));
-}
-
-
-void Assembler::vcvt_f32_s32(const SwVfpRegister dst,
-                             const SwVfpRegister src,
-                             VFPConversionMode mode,
-                             const Condition cond) {
-  emit(EncodeVCVT(F32, dst.code(), S32, src.code(), mode, cond));
-}
-
-
-void Assembler::vcvt_f64_u32(const DwVfpRegister dst,
-                             const SwVfpRegister src,
-                             VFPConversionMode mode,
-                             const Condition cond) {
-  DCHECK(VfpRegisterIsAvailable(dst));
-  emit(EncodeVCVT(F64, dst.code(), U32, src.code(), mode, cond));
-}
-
-
-void Assembler::vcvt_f32_u32(const SwVfpRegister dst, const SwVfpRegister src,
-                             VFPConversionMode mode, const Condition cond) {
-  emit(EncodeVCVT(F32, dst.code(), U32, src.code(), mode, cond));
-}
-
-
-void Assembler::vcvt_s32_f32(const SwVfpRegister dst, const SwVfpRegister src,
-                             VFPConversionMode mode, const Condition cond) {
-  emit(EncodeVCVT(S32, dst.code(), F32, src.code(), mode, cond));
-}
-
-
-void Assembler::vcvt_u32_f32(const SwVfpRegister dst, const SwVfpRegister src,
-                             VFPConversionMode mode, const Condition cond) {
-  emit(EncodeVCVT(U32, dst.code(), F32, src.code(), mode, cond));
-}
-
-
-void Assembler::vcvt_s32_f64(const SwVfpRegister dst,
-                             const DwVfpRegister src,
-                             VFPConversionMode mode,
-                             const Condition cond) {
-  DCHECK(VfpRegisterIsAvailable(src));
-  emit(EncodeVCVT(S32, dst.code(), F64, src.code(), mode, cond));
-}
-
-
-void Assembler::vcvt_u32_f64(const SwVfpRegister dst,
-                             const DwVfpRegister src,
-                             VFPConversionMode mode,
-                             const Condition cond) {
-  DCHECK(VfpRegisterIsAvailable(src));
-  emit(EncodeVCVT(U32, dst.code(), F64, src.code(), mode, cond));
-}
-
-
-void Assembler::vcvt_f64_f32(const DwVfpRegister dst,
-                             const SwVfpRegister src,
-                             VFPConversionMode mode,
-                             const Condition cond) {
-  DCHECK(VfpRegisterIsAvailable(dst));
-  emit(EncodeVCVT(F64, dst.code(), F32, src.code(), mode, cond));
-}
-
-
-void Assembler::vcvt_f32_f64(const SwVfpRegister dst,
-                             const DwVfpRegister src,
-                             VFPConversionMode mode,
-                             const Condition cond) {
-  DCHECK(VfpRegisterIsAvailable(src));
-  emit(EncodeVCVT(F32, dst.code(), F64, src.code(), mode, cond));
-}
-
-
-void Assembler::vcvt_f64_s32(const DwVfpRegister dst,
-                             int fraction_bits,
-                             const Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8-874.
-  // cond(31-28) | 11101(27-23) | D(22) | 11(21-20) | 1010(19-16) | Vd(15-12) |
-  // 101(11-9) | sf=1(8) | sx=1(7) | 1(6) | i(5) | 0(4) | imm4(3-0)
-  DCHECK(IsEnabled(VFPv3));
-  DCHECK(VfpRegisterIsAvailable(dst));
-  DCHECK(fraction_bits > 0 && fraction_bits <= 32);
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int imm5 = 32 - fraction_bits;
-  int i = imm5 & 1;
-  int imm4 = (imm5 >> 1) & 0xF;
-  emit(cond | 0xE*B24 | B23 | d*B22 | 0x3*B20 | B19 | 0x2*B16 |
-       vd*B12 | 0x5*B9 | B8 | B7 | B6 | i*B5 | imm4);
-}
-
-
-void Assembler::vneg(const DwVfpRegister dst,
-                     const DwVfpRegister src,
-                     const Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8-968.
-  // cond(31-28) | 11101(27-23) | D(22) | 11(21-20) | 0001(19-16) | Vd(15-12) |
-  // 101(11-9) | sz=1(8) | 0(7) | 1(6) | M(5) | 0(4) | Vm(3-0)
-  DCHECK(VfpRegisterIsAvailable(dst));
-  DCHECK(VfpRegisterIsAvailable(src));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vm, m;
-  src.split_code(&vm, &m);
-
-  emit(cond | 0x1D*B23 | d*B22 | 0x3*B20 | B16 | vd*B12 | 0x5*B9 | B8 | B6 |
-       m*B5 | vm);
-}
-
-
-void Assembler::vneg(const SwVfpRegister dst, const SwVfpRegister src,
-                     const Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8-968.
-  // cond(31-28) | 11101(27-23) | D(22) | 11(21-20) | 0001(19-16) | Vd(15-12) |
-  // 101(11-9) | sz=0(8) | 0(7) | 1(6) | M(5) | 0(4) | Vm(3-0)
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vm, m;
-  src.split_code(&vm, &m);
-
-  emit(cond | 0x1D * B23 | d * B22 | 0x3 * B20 | B16 | vd * B12 | 0x5 * B9 |
-       B6 | m * B5 | vm);
-}
-
-
-void Assembler::vabs(const DwVfpRegister dst,
-                     const DwVfpRegister src,
-                     const Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8-524.
-  // cond(31-28) | 11101(27-23) | D(22) | 11(21-20) | 0000(19-16) | Vd(15-12) |
-  // 101(11-9) | sz=1(8) | 1(7) | 1(6) | M(5) | 0(4) | Vm(3-0)
-  DCHECK(VfpRegisterIsAvailable(dst));
-  DCHECK(VfpRegisterIsAvailable(src));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vm, m;
-  src.split_code(&vm, &m);
-  emit(cond | 0x1D*B23 | d*B22 | 0x3*B20 | vd*B12 | 0x5*B9 | B8 | B7 | B6 |
-       m*B5 | vm);
-}
-
-
-void Assembler::vabs(const SwVfpRegister dst, const SwVfpRegister src,
-                     const Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8-524.
-  // cond(31-28) | 11101(27-23) | D(22) | 11(21-20) | 0000(19-16) | Vd(15-12) |
-  // 101(11-9) | sz=0(8) | 1(7) | 1(6) | M(5) | 0(4) | Vm(3-0)
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vm, m;
-  src.split_code(&vm, &m);
-  emit(cond | 0x1D * B23 | d * B22 | 0x3 * B20 | vd * B12 | 0x5 * B9 | B7 | B6 |
-       m * B5 | vm);
-}
-
-
-void Assembler::vadd(const DwVfpRegister dst,
-                     const DwVfpRegister src1,
-                     const DwVfpRegister src2,
-                     const Condition cond) {
-  // Dd = vadd(Dn, Dm) double precision floating point addition.
-  // Dd = D:Vd; Dm=M:Vm; Dn=N:Vm.
-  // Instruction details available in ARM DDI 0406C.b, A8-830.
-  // cond(31-28) | 11100(27-23)| D(22) | 11(21-20) | Vn(19-16) |
-  // Vd(15-12) | 101(11-9) | sz=1(8) | N(7) | 0(6) | M(5) | 0(4) | Vm(3-0)
-  DCHECK(VfpRegisterIsAvailable(dst));
-  DCHECK(VfpRegisterIsAvailable(src1));
-  DCHECK(VfpRegisterIsAvailable(src2));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vn, n;
-  src1.split_code(&vn, &n);
-  int vm, m;
-  src2.split_code(&vm, &m);
-  emit(cond | 0x1C*B23 | d*B22 | 0x3*B20 | vn*B16 | vd*B12 | 0x5*B9 | B8 |
-       n*B7 | m*B5 | vm);
-}
-
-
-void Assembler::vadd(const SwVfpRegister dst, const SwVfpRegister src1,
-                     const SwVfpRegister src2, const Condition cond) {
-  // Sd = vadd(Sn, Sm) single precision floating point addition.
-  // Sd = D:Vd; Sm=M:Vm; Sn=N:Vm.
-  // Instruction details available in ARM DDI 0406C.b, A8-830.
-  // cond(31-28) | 11100(27-23)| D(22) | 11(21-20) | Vn(19-16) |
-  // Vd(15-12) | 101(11-9) | sz=0(8) | N(7) | 0(6) | M(5) | 0(4) | Vm(3-0)
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vn, n;
-  src1.split_code(&vn, &n);
-  int vm, m;
-  src2.split_code(&vm, &m);
-  emit(cond | 0x1C * B23 | d * B22 | 0x3 * B20 | vn * B16 | vd * B12 |
-       0x5 * B9 | n * B7 | m * B5 | vm);
-}
-
-
-void Assembler::vsub(const DwVfpRegister dst,
-                     const DwVfpRegister src1,
-                     const DwVfpRegister src2,
-                     const Condition cond) {
-  // Dd = vsub(Dn, Dm) double precision floating point subtraction.
-  // Dd = D:Vd; Dm=M:Vm; Dn=N:Vm.
-  // Instruction details available in ARM DDI 0406C.b, A8-1086.
-  // cond(31-28) | 11100(27-23)| D(22) | 11(21-20) | Vn(19-16) |
-  // Vd(15-12) | 101(11-9) | sz=1(8) | N(7) | 1(6) | M(5) | 0(4) | Vm(3-0)
-  DCHECK(VfpRegisterIsAvailable(dst));
-  DCHECK(VfpRegisterIsAvailable(src1));
-  DCHECK(VfpRegisterIsAvailable(src2));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vn, n;
-  src1.split_code(&vn, &n);
-  int vm, m;
-  src2.split_code(&vm, &m);
-  emit(cond | 0x1C*B23 | d*B22 | 0x3*B20 | vn*B16 | vd*B12 | 0x5*B9 | B8 |
-       n*B7 | B6 | m*B5 | vm);
-}
-
-
-void Assembler::vsub(const SwVfpRegister dst, const SwVfpRegister src1,
-                     const SwVfpRegister src2, const Condition cond) {
-  // Sd = vsub(Sn, Sm) single precision floating point subtraction.
-  // Sd = D:Vd; Sm=M:Vm; Sn=N:Vm.
-  // Instruction details available in ARM DDI 0406C.b, A8-1086.
-  // cond(31-28) | 11100(27-23)| D(22) | 11(21-20) | Vn(19-16) |
-  // Vd(15-12) | 101(11-9) | sz=0(8) | N(7) | 1(6) | M(5) | 0(4) | Vm(3-0)
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vn, n;
-  src1.split_code(&vn, &n);
-  int vm, m;
-  src2.split_code(&vm, &m);
-  emit(cond | 0x1C * B23 | d * B22 | 0x3 * B20 | vn * B16 | vd * B12 |
-       0x5 * B9 | n * B7 | B6 | m * B5 | vm);
-}
-
-
-void Assembler::vmul(const DwVfpRegister dst,
-                     const DwVfpRegister src1,
-                     const DwVfpRegister src2,
-                     const Condition cond) {
-  // Dd = vmul(Dn, Dm) double precision floating point multiplication.
-  // Dd = D:Vd; Dm=M:Vm; Dn=N:Vm.
-  // Instruction details available in ARM DDI 0406C.b, A8-960.
-  // cond(31-28) | 11100(27-23)| D(22) | 10(21-20) | Vn(19-16) |
-  // Vd(15-12) | 101(11-9) | sz=1(8) | N(7) | 0(6) | M(5) | 0(4) | Vm(3-0)
-  DCHECK(VfpRegisterIsAvailable(dst));
-  DCHECK(VfpRegisterIsAvailable(src1));
-  DCHECK(VfpRegisterIsAvailable(src2));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vn, n;
-  src1.split_code(&vn, &n);
-  int vm, m;
-  src2.split_code(&vm, &m);
-  emit(cond | 0x1C*B23 | d*B22 | 0x2*B20 | vn*B16 | vd*B12 | 0x5*B9 | B8 |
-       n*B7 | m*B5 | vm);
-}
-
-
-void Assembler::vmul(const SwVfpRegister dst, const SwVfpRegister src1,
-                     const SwVfpRegister src2, const Condition cond) {
-  // Sd = vmul(Sn, Sm) single precision floating point multiplication.
-  // Sd = D:Vd; Sm=M:Vm; Sn=N:Vm.
-  // Instruction details available in ARM DDI 0406C.b, A8-960.
-  // cond(31-28) | 11100(27-23)| D(22) | 10(21-20) | Vn(19-16) |
-  // Vd(15-12) | 101(11-9) | sz=0(8) | N(7) | 0(6) | M(5) | 0(4) | Vm(3-0)
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vn, n;
-  src1.split_code(&vn, &n);
-  int vm, m;
-  src2.split_code(&vm, &m);
-  emit(cond | 0x1C * B23 | d * B22 | 0x2 * B20 | vn * B16 | vd * B12 |
-       0x5 * B9 | n * B7 | m * B5 | vm);
-}
-
-
-void Assembler::vmla(const DwVfpRegister dst,
-                     const DwVfpRegister src1,
-                     const DwVfpRegister src2,
-                     const Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8-932.
-  // cond(31-28) | 11100(27-23) | D(22) | 00(21-20) | Vn(19-16) |
-  // Vd(15-12) | 101(11-9) | sz=1(8) | N(7) | op=0(6) | M(5) | 0(4) | Vm(3-0)
-  DCHECK(VfpRegisterIsAvailable(dst));
-  DCHECK(VfpRegisterIsAvailable(src1));
-  DCHECK(VfpRegisterIsAvailable(src2));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vn, n;
-  src1.split_code(&vn, &n);
-  int vm, m;
-  src2.split_code(&vm, &m);
-  emit(cond | 0x1C*B23 | d*B22 | vn*B16 | vd*B12 | 0x5*B9 | B8 | n*B7 | m*B5 |
-       vm);
-}
-
-
-void Assembler::vmla(const SwVfpRegister dst, const SwVfpRegister src1,
-                     const SwVfpRegister src2, const Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8-932.
-  // cond(31-28) | 11100(27-23) | D(22) | 00(21-20) | Vn(19-16) |
-  // Vd(15-12) | 101(11-9) | sz=0(8) | N(7) | op=0(6) | M(5) | 0(4) | Vm(3-0)
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vn, n;
-  src1.split_code(&vn, &n);
-  int vm, m;
-  src2.split_code(&vm, &m);
-  emit(cond | 0x1C * B23 | d * B22 | vn * B16 | vd * B12 | 0x5 * B9 | n * B7 |
-       m * B5 | vm);
-}
-
-
-void Assembler::vmls(const DwVfpRegister dst,
-                     const DwVfpRegister src1,
-                     const DwVfpRegister src2,
-                     const Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8-932.
-  // cond(31-28) | 11100(27-23) | D(22) | 00(21-20) | Vn(19-16) |
-  // Vd(15-12) | 101(11-9) | sz=1(8) | N(7) | op=1(6) | M(5) | 0(4) | Vm(3-0)
-  DCHECK(VfpRegisterIsAvailable(dst));
-  DCHECK(VfpRegisterIsAvailable(src1));
-  DCHECK(VfpRegisterIsAvailable(src2));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vn, n;
-  src1.split_code(&vn, &n);
-  int vm, m;
-  src2.split_code(&vm, &m);
-  emit(cond | 0x1C*B23 | d*B22 | vn*B16 | vd*B12 | 0x5*B9 | B8 | n*B7 | B6 |
-       m*B5 | vm);
-}
-
-
-void Assembler::vmls(const SwVfpRegister dst, const SwVfpRegister src1,
-                     const SwVfpRegister src2, const Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8-932.
-  // cond(31-28) | 11100(27-23) | D(22) | 00(21-20) | Vn(19-16) |
-  // Vd(15-12) | 101(11-9) | sz=0(8) | N(7) | op=1(6) | M(5) | 0(4) | Vm(3-0)
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vn, n;
-  src1.split_code(&vn, &n);
-  int vm, m;
-  src2.split_code(&vm, &m);
-  emit(cond | 0x1C * B23 | d * B22 | vn * B16 | vd * B12 | 0x5 * B9 | n * B7 |
-       B6 | m * B5 | vm);
-}
-
-
-void Assembler::vdiv(const DwVfpRegister dst,
-                     const DwVfpRegister src1,
-                     const DwVfpRegister src2,
-                     const Condition cond) {
-  // Dd = vdiv(Dn, Dm) double precision floating point division.
-  // Dd = D:Vd; Dm=M:Vm; Dn=N:Vm.
-  // Instruction details available in ARM DDI 0406C.b, A8-882.
-  // cond(31-28) | 11101(27-23)| D(22) | 00(21-20) | Vn(19-16) |
-  // Vd(15-12) | 101(11-9) | sz=1(8) | N(7) | 0(6) | M(5) | 0(4) | Vm(3-0)
-  DCHECK(VfpRegisterIsAvailable(dst));
-  DCHECK(VfpRegisterIsAvailable(src1));
-  DCHECK(VfpRegisterIsAvailable(src2));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vn, n;
-  src1.split_code(&vn, &n);
-  int vm, m;
-  src2.split_code(&vm, &m);
-  emit(cond | 0x1D*B23 | d*B22 | vn*B16 | vd*B12 | 0x5*B9 | B8 | n*B7 | m*B5 |
-       vm);
-}
-
-
-void Assembler::vdiv(const SwVfpRegister dst, const SwVfpRegister src1,
-                     const SwVfpRegister src2, const Condition cond) {
-  // Sd = vdiv(Sn, Sm) single precision floating point division.
-  // Sd = D:Vd; Sm=M:Vm; Sn=N:Vm.
-  // Instruction details available in ARM DDI 0406C.b, A8-882.
-  // cond(31-28) | 11101(27-23)| D(22) | 00(21-20) | Vn(19-16) |
-  // Vd(15-12) | 101(11-9) | sz=0(8) | N(7) | 0(6) | M(5) | 0(4) | Vm(3-0)
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vn, n;
-  src1.split_code(&vn, &n);
-  int vm, m;
-  src2.split_code(&vm, &m);
-  emit(cond | 0x1D * B23 | d * B22 | vn * B16 | vd * B12 | 0x5 * B9 | n * B7 |
-       m * B5 | vm);
-}
-
-
-void Assembler::vcmp(const DwVfpRegister src1,
-                     const DwVfpRegister src2,
-                     const Condition cond) {
-  // vcmp(Dd, Dm) double precision floating point comparison.
-  // Instruction details available in ARM DDI 0406C.b, A8-864.
-  // cond(31-28) | 11101(27-23)| D(22) | 11(21-20) | 0100(19-16) |
-  // Vd(15-12) | 101(11-9) | sz=1(8) | E=0(7) | 1(6) | M(5) | 0(4) | Vm(3-0)
-  DCHECK(VfpRegisterIsAvailable(src1));
-  DCHECK(VfpRegisterIsAvailable(src2));
-  int vd, d;
-  src1.split_code(&vd, &d);
-  int vm, m;
-  src2.split_code(&vm, &m);
-  emit(cond | 0x1D*B23 | d*B22 | 0x3*B20 | 0x4*B16 | vd*B12 | 0x5*B9 | B8 | B6 |
-       m*B5 | vm);
-}
-
-
-void Assembler::vcmp(const SwVfpRegister src1, const SwVfpRegister src2,
-                     const Condition cond) {
-  // vcmp(Sd, Sm) single precision floating point comparison.
-  // Instruction details available in ARM DDI 0406C.b, A8-864.
-  // cond(31-28) | 11101(27-23)| D(22) | 11(21-20) | 0100(19-16) |
-  // Vd(15-12) | 101(11-9) | sz=0(8) | E=0(7) | 1(6) | M(5) | 0(4) | Vm(3-0)
-  int vd, d;
-  src1.split_code(&vd, &d);
-  int vm, m;
-  src2.split_code(&vm, &m);
-  emit(cond | 0x1D * B23 | d * B22 | 0x3 * B20 | 0x4 * B16 | vd * B12 |
-       0x5 * B9 | B6 | m * B5 | vm);
-}
-
-
-void Assembler::vcmp(const DwVfpRegister src1,
-                     const double src2,
-                     const Condition cond) {
-  // vcmp(Dd, #0.0) double precision floating point comparison.
-  // Instruction details available in ARM DDI 0406C.b, A8-864.
-  // cond(31-28) | 11101(27-23)| D(22) | 11(21-20) | 0101(19-16) |
-  // Vd(15-12) | 101(11-9) | sz=1(8) | E=0(7) | 1(6) | 0(5) | 0(4) | 0000(3-0)
-  DCHECK(VfpRegisterIsAvailable(src1));
-  DCHECK_EQ(src2, 0.0);
-  int vd, d;
-  src1.split_code(&vd, &d);
-  emit(cond | 0x1D*B23 | d*B22 | 0x3*B20 | 0x5*B16 | vd*B12 | 0x5*B9 | B8 | B6);
-}
-
-
-void Assembler::vcmp(const SwVfpRegister src1, const float src2,
-                     const Condition cond) {
-  // vcmp(Sd, #0.0) single precision floating point comparison.
-  // Instruction details available in ARM DDI 0406C.b, A8-864.
-  // cond(31-28) | 11101(27-23)| D(22) | 11(21-20) | 0101(19-16) |
-  // Vd(15-12) | 101(11-9) | sz=0(8) | E=0(7) | 1(6) | 0(5) | 0(4) | 0000(3-0)
-  DCHECK_EQ(src2, 0.0);
-  int vd, d;
-  src1.split_code(&vd, &d);
-  emit(cond | 0x1D * B23 | d * B22 | 0x3 * B20 | 0x5 * B16 | vd * B12 |
-       0x5 * B9 | B6);
-}
-
-void Assembler::vmaxnm(const DwVfpRegister dst, const DwVfpRegister src1,
-                       const DwVfpRegister src2) {
-  // kSpecialCondition(31-28) | 11101(27-23) | D(22) | 00(21-20) | Vn(19-16) |
-  // Vd(15-12) | 101(11-9) | sz=1(8) | N(7) | 0(6) | M(5) | 0(4) | Vm(3-0)
-  DCHECK(IsEnabled(ARMv8));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vn, n;
-  src1.split_code(&vn, &n);
-  int vm, m;
-  src2.split_code(&vm, &m);
-
-  emit(kSpecialCondition | 0x1D * B23 | d * B22 | vn * B16 | vd * B12 |
-       0x5 * B9 | B8 | n * B7 | m * B5 | vm);
-}
-
-void Assembler::vmaxnm(const SwVfpRegister dst, const SwVfpRegister src1,
-                       const SwVfpRegister src2) {
-  // kSpecialCondition(31-28) | 11101(27-23) | D(22) | 00(21-20) | Vn(19-16) |
-  // Vd(15-12) | 101(11-9) | sz=0(8) | N(7) | 0(6) | M(5) | 0(4) | Vm(3-0)
-  DCHECK(IsEnabled(ARMv8));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vn, n;
-  src1.split_code(&vn, &n);
-  int vm, m;
-  src2.split_code(&vm, &m);
-
-  emit(kSpecialCondition | 0x1D * B23 | d * B22 | vn * B16 | vd * B12 |
-       0x5 * B9 | n * B7 | m * B5 | vm);
-}
-
-void Assembler::vminnm(const DwVfpRegister dst, const DwVfpRegister src1,
-                       const DwVfpRegister src2) {
-  // kSpecialCondition(31-28) | 11101(27-23) | D(22) | 00(21-20) | Vn(19-16) |
-  // Vd(15-12) | 101(11-9) | sz=1(8) | N(7) | 1(6) | M(5) | 0(4) | Vm(3-0)
-  DCHECK(IsEnabled(ARMv8));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vn, n;
-  src1.split_code(&vn, &n);
-  int vm, m;
-  src2.split_code(&vm, &m);
-
-  emit(kSpecialCondition | 0x1D * B23 | d * B22 | vn * B16 | vd * B12 |
-       0x5 * B9 | B8 | n * B7 | B6 | m * B5 | vm);
-}
-
-void Assembler::vminnm(const SwVfpRegister dst, const SwVfpRegister src1,
-                       const SwVfpRegister src2) {
-  // kSpecialCondition(31-28) | 11101(27-23) | D(22) | 00(21-20) | Vn(19-16) |
-  // Vd(15-12) | 101(11-9) | sz=0(8) | N(7) | 1(6) | M(5) | 0(4) | Vm(3-0)
-  DCHECK(IsEnabled(ARMv8));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vn, n;
-  src1.split_code(&vn, &n);
-  int vm, m;
-  src2.split_code(&vm, &m);
-
-  emit(kSpecialCondition | 0x1D * B23 | d * B22 | vn * B16 | vd * B12 |
-       0x5 * B9 | n * B7 | B6 | m * B5 | vm);
-}
-
-void Assembler::vsel(Condition cond, const DwVfpRegister dst,
-                     const DwVfpRegister src1, const DwVfpRegister src2) {
-  // cond=kSpecialCondition(31-28) | 11100(27-23) | D(22) |
-  // vsel_cond=XX(21-20) | Vn(19-16) | Vd(15-12) | 101(11-9) | sz=1(8) | N(7) |
-  // 0(6) | M(5) | 0(4) | Vm(3-0)
-  DCHECK(IsEnabled(ARMv8));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vn, n;
-  src1.split_code(&vn, &n);
-  int vm, m;
-  src2.split_code(&vm, &m);
-  int sz = 1;
-
-  // VSEL has a special (restricted) condition encoding.
-  //   eq(0b0000)... -> 0b00
-  //   ge(0b1010)... -> 0b10
-  //   gt(0b1100)... -> 0b11
-  //   vs(0b0110)... -> 0b01
-  // No other conditions are supported.
-  int vsel_cond = (cond >> 30) & 0x3;
-  if ((cond != eq) && (cond != ge) && (cond != gt) && (cond != vs)) {
-    // We can implement some other conditions by swapping the inputs.
-    DCHECK((cond == ne) | (cond == lt) | (cond == le) | (cond == vc));
-    std::swap(vn, vm);
-    std::swap(n, m);
-  }
-
-  emit(kSpecialCondition | 0x1C * B23 | d * B22 | vsel_cond * B20 | vn * B16 |
-       vd * B12 | 0x5 * B9 | sz * B8 | n * B7 | m * B5 | vm);
-}
-
-void Assembler::vsel(Condition cond, const SwVfpRegister dst,
-                     const SwVfpRegister src1, const SwVfpRegister src2) {
-  // cond=kSpecialCondition(31-28) | 11100(27-23) | D(22) |
-  // vsel_cond=XX(21-20) | Vn(19-16) | Vd(15-12) | 101(11-9) | sz=0(8) | N(7) |
-  // 0(6) | M(5) | 0(4) | Vm(3-0)
-  DCHECK(IsEnabled(ARMv8));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vn, n;
-  src1.split_code(&vn, &n);
-  int vm, m;
-  src2.split_code(&vm, &m);
-  int sz = 0;
-
-  // VSEL has a special (restricted) condition encoding.
-  //   eq(0b0000)... -> 0b00
-  //   ge(0b1010)... -> 0b10
-  //   gt(0b1100)... -> 0b11
-  //   vs(0b0110)... -> 0b01
-  // No other conditions are supported.
-  int vsel_cond = (cond >> 30) & 0x3;
-  if ((cond != eq) && (cond != ge) && (cond != gt) && (cond != vs)) {
-    // We can implement some other conditions by swapping the inputs.
-    DCHECK((cond == ne) | (cond == lt) | (cond == le) | (cond == vc));
-    std::swap(vn, vm);
-    std::swap(n, m);
-  }
-
-  emit(kSpecialCondition | 0x1C * B23 | d * B22 | vsel_cond * B20 | vn * B16 |
-       vd * B12 | 0x5 * B9 | sz * B8 | n * B7 | m * B5 | vm);
-}
-
-void Assembler::vsqrt(const DwVfpRegister dst,
-                      const DwVfpRegister src,
-                      const Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8-1058.
-  // cond(31-28) | 11101(27-23)| D(22) | 11(21-20) | 0001(19-16) |
-  // Vd(15-12) | 101(11-9) | sz=1(8) | 11(7-6) | M(5) | 0(4) | Vm(3-0)
-  DCHECK(VfpRegisterIsAvailable(dst));
-  DCHECK(VfpRegisterIsAvailable(src));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vm, m;
-  src.split_code(&vm, &m);
-  emit(cond | 0x1D*B23 | d*B22 | 0x3*B20 | B16 | vd*B12 | 0x5*B9 | B8 | 0x3*B6 |
-       m*B5 | vm);
-}
-
-
-void Assembler::vsqrt(const SwVfpRegister dst, const SwVfpRegister src,
-                      const Condition cond) {
-  // Instruction details available in ARM DDI 0406C.b, A8-1058.
-  // cond(31-28) | 11101(27-23)| D(22) | 11(21-20) | 0001(19-16) |
-  // Vd(15-12) | 101(11-9) | sz=0(8) | 11(7-6) | M(5) | 0(4) | Vm(3-0)
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vm, m;
-  src.split_code(&vm, &m);
-  emit(cond | 0x1D * B23 | d * B22 | 0x3 * B20 | B16 | vd * B12 | 0x5 * B9 |
-       0x3 * B6 | m * B5 | vm);
-}
-
-
-void Assembler::vmsr(Register dst, Condition cond) {
-  // Instruction details available in ARM DDI 0406A, A8-652.
-  // cond(31-28) | 1110 (27-24) | 1110(23-20)| 0001 (19-16) |
-  // Rt(15-12) | 1010 (11-8) | 0(7) | 00 (6-5) | 1(4) | 0000(3-0)
-  emit(cond | 0xE * B24 | 0xE * B20 | B16 | dst.code() * B12 | 0xA * B8 | B4);
-}
-
-
-void Assembler::vmrs(Register dst, Condition cond) {
-  // Instruction details available in ARM DDI 0406A, A8-652.
-  // cond(31-28) | 1110 (27-24) | 1111(23-20)| 0001 (19-16) |
-  // Rt(15-12) | 1010 (11-8) | 0(7) | 00 (6-5) | 1(4) | 0000(3-0)
-  emit(cond | 0xE * B24 | 0xF * B20 | B16 | dst.code() * B12 | 0xA * B8 | B4);
-}
-
-
-void Assembler::vrinta(const SwVfpRegister dst, const SwVfpRegister src) {
-  // cond=kSpecialCondition(31-28) | 11101(27-23)| D(22) | 11(21-20) |
-  // 10(19-18) | RM=00(17-16) |  Vd(15-12) | 101(11-9) | sz=0(8) | 01(7-6) |
-  // M(5) | 0(4) | Vm(3-0)
-  DCHECK(IsEnabled(ARMv8));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vm, m;
-  src.split_code(&vm, &m);
-  emit(kSpecialCondition | 0x1D * B23 | d * B22 | 0x3 * B20 | B19 | vd * B12 |
-       0x5 * B9 | B6 | m * B5 | vm);
-}
-
-
-void Assembler::vrinta(const DwVfpRegister dst, const DwVfpRegister src) {
-  // cond=kSpecialCondition(31-28) | 11101(27-23)| D(22) | 11(21-20) |
-  // 10(19-18) | RM=00(17-16) |  Vd(15-12) | 101(11-9) | sz=1(8) | 01(7-6) |
-  // M(5) | 0(4) | Vm(3-0)
-  DCHECK(IsEnabled(ARMv8));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vm, m;
-  src.split_code(&vm, &m);
-  emit(kSpecialCondition | 0x1D * B23 | d * B22 | 0x3 * B20 | B19 | vd * B12 |
-       0x5 * B9 | B8 | B6 | m * B5 | vm);
-}
-
-
-void Assembler::vrintn(const SwVfpRegister dst, const SwVfpRegister src) {
-  // cond=kSpecialCondition(31-28) | 11101(27-23)| D(22) | 11(21-20) |
-  // 10(19-18) | RM=01(17-16) |  Vd(15-12) | 101(11-9) | sz=0(8) | 01(7-6) |
-  // M(5) | 0(4) | Vm(3-0)
-  DCHECK(IsEnabled(ARMv8));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vm, m;
-  src.split_code(&vm, &m);
-  emit(kSpecialCondition | 0x1D * B23 | d * B22 | 0x3 * B20 | B19 | 0x1 * B16 |
-       vd * B12 | 0x5 * B9 | B6 | m * B5 | vm);
-}
-
-
-void Assembler::vrintn(const DwVfpRegister dst, const DwVfpRegister src) {
-  // cond=kSpecialCondition(31-28) | 11101(27-23)| D(22) | 11(21-20) |
-  // 10(19-18) | RM=01(17-16) |  Vd(15-12) | 101(11-9) | sz=1(8) | 01(7-6) |
-  // M(5) | 0(4) | Vm(3-0)
-  DCHECK(IsEnabled(ARMv8));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vm, m;
-  src.split_code(&vm, &m);
-  emit(kSpecialCondition | 0x1D * B23 | d * B22 | 0x3 * B20 | B19 | 0x1 * B16 |
-       vd * B12 | 0x5 * B9 | B8 | B6 | m * B5 | vm);
-}
-
-
-void Assembler::vrintp(const SwVfpRegister dst, const SwVfpRegister src) {
-  // cond=kSpecialCondition(31-28) | 11101(27-23)| D(22) | 11(21-20) |
-  // 10(19-18) | RM=10(17-16) |  Vd(15-12) | 101(11-9) | sz=0(8) | 01(7-6) |
-  // M(5) | 0(4) | Vm(3-0)
-  DCHECK(IsEnabled(ARMv8));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vm, m;
-  src.split_code(&vm, &m);
-  emit(kSpecialCondition | 0x1D * B23 | d * B22 | 0x3 * B20 | B19 | 0x2 * B16 |
-       vd * B12 | 0x5 * B9 | B6 | m * B5 | vm);
-}
-
-
-void Assembler::vrintp(const DwVfpRegister dst, const DwVfpRegister src) {
-  // cond=kSpecialCondition(31-28) | 11101(27-23)| D(22) | 11(21-20) |
-  // 10(19-18) | RM=10(17-16) |  Vd(15-12) | 101(11-9) | sz=1(8) | 01(7-6) |
-  // M(5) | 0(4) | Vm(3-0)
-  DCHECK(IsEnabled(ARMv8));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vm, m;
-  src.split_code(&vm, &m);
-  emit(kSpecialCondition | 0x1D * B23 | d * B22 | 0x3 * B20 | B19 | 0x2 * B16 |
-       vd * B12 | 0x5 * B9 | B8 | B6 | m * B5 | vm);
-}
-
-
-void Assembler::vrintm(const SwVfpRegister dst, const SwVfpRegister src) {
-  // cond=kSpecialCondition(31-28) | 11101(27-23)| D(22) | 11(21-20) |
-  // 10(19-18) | RM=11(17-16) |  Vd(15-12) | 101(11-9) | sz=0(8) | 01(7-6) |
-  // M(5) | 0(4) | Vm(3-0)
-  DCHECK(IsEnabled(ARMv8));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vm, m;
-  src.split_code(&vm, &m);
-  emit(kSpecialCondition | 0x1D * B23 | d * B22 | 0x3 * B20 | B19 | 0x3 * B16 |
-       vd * B12 | 0x5 * B9 | B6 | m * B5 | vm);
-}
-
-
-void Assembler::vrintm(const DwVfpRegister dst, const DwVfpRegister src) {
-  // cond=kSpecialCondition(31-28) | 11101(27-23)| D(22) | 11(21-20) |
-  // 10(19-18) | RM=11(17-16) |  Vd(15-12) | 101(11-9) | sz=1(8) | 01(7-6) |
-  // M(5) | 0(4) | Vm(3-0)
-  DCHECK(IsEnabled(ARMv8));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vm, m;
-  src.split_code(&vm, &m);
-  emit(kSpecialCondition | 0x1D * B23 | d * B22 | 0x3 * B20 | B19 | 0x3 * B16 |
-       vd * B12 | 0x5 * B9 | B8 | B6 | m * B5 | vm);
-}
-
-
-void Assembler::vrintz(const SwVfpRegister dst, const SwVfpRegister src,
-                       const Condition cond) {
-  // cond(31-28) | 11101(27-23)| D(22) | 11(21-20) | 011(19-17) | 0(16) |
-  // Vd(15-12) | 101(11-9) | sz=0(8) | op=1(7) | 1(6) | M(5) | 0(4) | Vm(3-0)
-  DCHECK(IsEnabled(ARMv8));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vm, m;
-  src.split_code(&vm, &m);
-  emit(cond | 0x1D * B23 | d * B22 | 0x3 * B20 | 0x3 * B17 | vd * B12 |
-       0x5 * B9 | B7 | B6 | m * B5 | vm);
-}
-
-
-void Assembler::vrintz(const DwVfpRegister dst, const DwVfpRegister src,
-                       const Condition cond) {
-  // cond(31-28) | 11101(27-23)| D(22) | 11(21-20) | 011(19-17) | 0(16) |
-  // Vd(15-12) | 101(11-9) | sz=1(8) | op=1(7) | 1(6) | M(5) | 0(4) | Vm(3-0)
-  DCHECK(IsEnabled(ARMv8));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vm, m;
-  src.split_code(&vm, &m);
-  emit(cond | 0x1D * B23 | d * B22 | 0x3 * B20 | 0x3 * B17 | vd * B12 |
-       0x5 * B9 | B8 | B7 | B6 | m * B5 | vm);
-}
-
-
-// Support for NEON.
-
-void Assembler::vld1(NeonSize size,
-                     const NeonListOperand& dst,
-                     const NeonMemOperand& src) {
-  // Instruction details available in ARM DDI 0406C.b, A8.8.320.
-  // 1111(31-28) | 01000(27-23) | D(22) | 10(21-20) | Rn(19-16) |
-  // Vd(15-12) | type(11-8) | size(7-6) | align(5-4) | Rm(3-0)
-  DCHECK(IsEnabled(NEON));
-  int vd, d;
-  dst.base().split_code(&vd, &d);
-  emit(0xFU*B28 | 4*B24 | d*B22 | 2*B20 | src.rn().code()*B16 | vd*B12 |
-       dst.type()*B8 | size*B6 | src.align()*B4 | src.rm().code());
-}
-
-void Assembler::vst1(NeonSize size, const NeonListOperand& src,
-                     const NeonMemOperand& dst) {
-  // Instruction details available in ARM DDI 0406C.b, A8.8.404.
-  // 1111(31-28) | 01000(27-23) | D(22) | 00(21-20) | Rn(19-16) |
-  // Vd(15-12) | type(11-8) | size(7-6) | align(5-4) | Rm(3-0)
-  DCHECK(IsEnabled(NEON));
-  int vd, d;
-  src.base().split_code(&vd, &d);
-  emit(0xFU*B28 | 4*B24 | d*B22 | dst.rn().code()*B16 | vd*B12 | src.type()*B8 |
-       size*B6 | dst.align()*B4 | dst.rm().code());
-}
-
-
-void Assembler::vmovl(NeonDataType dt, QwNeonRegister dst, DwVfpRegister src) {
-  // Instruction details available in ARM DDI 0406C.b, A8.8.346.
-  // 1111(31-28) | 001(27-25) | U(24) | 1(23) | D(22) | imm3(21-19) |
-  // 000(18-16) | Vd(15-12) | 101000(11-6) | M(5) | 1(4) | Vm(3-0)
-  DCHECK(IsEnabled(NEON));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vm, m;
-  src.split_code(&vm, &m);
-  int U = NeonU(dt);
-  int imm3 = 1 << NeonSz(dt);
-  emit(0xFU * B28 | B25 | U * B24 | B23 | d * B22 | imm3 * B19 | vd * B12 |
-       0xA * B8 | m * B5 | B4 | vm);
-}
-
-void Assembler::vqmovn(NeonDataType dt, DwVfpRegister dst, QwNeonRegister src) {
-  // Instruction details available in ARM DDI 0406C.b, A8.8.1004.
-  // vqmovn.<type><size> Dd, Qm. ARM vector narrowing move with saturation.
-  DCHECK(IsEnabled(NEON));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vm, m;
-  src.split_code(&vm, &m);
-  int size = NeonSz(dt);
-  int u = NeonU(dt);
-  int op = u != 0 ? 3 : 2;
-  emit(0x1E7U * B23 | d * B22 | 0x3 * B20 | size * B18 | 0x2 * B16 | vd * B12 |
-       0x2 * B8 | op * B6 | m * B5 | vm);
-}
-
-static int EncodeScalar(NeonDataType dt, int index) {
-  int opc1_opc2 = 0;
-  DCHECK_LE(0, index);
-  switch (dt) {
-    case NeonS8:
-    case NeonU8:
-      DCHECK_GT(8, index);
-      opc1_opc2 = 0x8 | index;
-      break;
-    case NeonS16:
-    case NeonU16:
-      DCHECK_GT(4, index);
-      opc1_opc2 = 0x1 | (index << 1);
-      break;
-    case NeonS32:
-    case NeonU32:
-      DCHECK_GT(2, index);
-      opc1_opc2 = index << 2;
-      break;
-    default:
-      UNREACHABLE();
-      break;
-  }
-  return (opc1_opc2 >> 2) * B21 | (opc1_opc2 & 0x3) * B5;
-}
-
-void Assembler::vmov(NeonDataType dt, DwVfpRegister dst, int index,
-                     Register src) {
-  // Instruction details available in ARM DDI 0406C.b, A8.8.940.
-  // vmov ARM core register to scalar.
-  DCHECK(dt == NeonS32 || dt == NeonU32 || IsEnabled(NEON));
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int opc1_opc2 = EncodeScalar(dt, index);
-  emit(0xEEu * B24 | vd * B16 | src.code() * B12 | 0xB * B8 | d * B7 | B4 |
-       opc1_opc2);
-}
-
-void Assembler::vmov(NeonDataType dt, Register dst, DwVfpRegister src,
-                     int index) {
-  // Instruction details available in ARM DDI 0406C.b, A8.8.942.
-  // vmov Arm scalar to core register.
-  DCHECK(dt == NeonS32 || dt == NeonU32 || IsEnabled(NEON));
-  int vn, n;
-  src.split_code(&vn, &n);
-  int opc1_opc2 = EncodeScalar(dt, index);
-  int u = NeonU(dt);
-  emit(0xEEu * B24 | u * B23 | B20 | vn * B16 | dst.code() * B12 | 0xB * B8 |
-       n * B7 | B4 | opc1_opc2);
-}
-
-void Assembler::vmov(QwNeonRegister dst, QwNeonRegister src) {
-  // Instruction details available in ARM DDI 0406C.b, A8-938.
-  // vmov is encoded as vorr.
-  vorr(dst, src, src);
-}
-
-void Assembler::vdup(NeonSize size, QwNeonRegister dst, Register src) {
-  DCHECK(IsEnabled(NEON));
-  // Instruction details available in ARM DDI 0406C.b, A8-886.
-  int B = 0, E = 0;
-  switch (size) {
-    case Neon8:
-      B = 1;
-      break;
-    case Neon16:
-      E = 1;
-      break;
-    case Neon32:
-      break;
-    default:
-      UNREACHABLE();
-      break;
-  }
-  int vd, d;
-  dst.split_code(&vd, &d);
-
-  emit(al | 0x1D * B23 | B * B22 | B21 | vd * B16 | src.code() * B12 |
-       0xB * B8 | d * B7 | E * B5 | B4);
-}
-
-enum NeonRegType { NEON_D, NEON_Q };
-
-void NeonSplitCode(NeonRegType type, int code, int* vm, int* m, int* encoding) {
-  if (type == NEON_D) {
-    DwVfpRegister::split_code(code, vm, m);
-  } else {
-    DCHECK_EQ(type, NEON_Q);
-    QwNeonRegister::split_code(code, vm, m);
-    *encoding |= B6;
-  }
-}
-
-static Instr EncodeNeonDupOp(NeonSize size, NeonRegType reg_type, int dst_code,
-                             DwVfpRegister src, int index) {
-  DCHECK_NE(Neon64, size);
-  int sz = static_cast<int>(size);
-  DCHECK_LE(0, index);
-  DCHECK_GT(kSimd128Size / (1 << sz), index);
-  int imm4 = (1 << sz) | ((index << (sz + 1)) & 0xF);
-  int qbit = 0;
-  int vd, d;
-  NeonSplitCode(reg_type, dst_code, &vd, &d, &qbit);
-  int vm, m;
-  src.split_code(&vm, &m);
-
-  return 0x1E7U * B23 | d * B22 | 0x3 * B20 | imm4 * B16 | vd * B12 |
-         0x18 * B7 | qbit | m * B5 | vm;
-}
-
-void Assembler::vdup(NeonSize size, DwVfpRegister dst, DwVfpRegister src,
-                     int index) {
-  DCHECK(IsEnabled(NEON));
-  // Instruction details available in ARM DDI 0406C.b, A8-884.
-  emit(EncodeNeonDupOp(size, NEON_D, dst.code(), src, index));
-}
-
-void Assembler::vdup(NeonSize size, QwNeonRegister dst, DwVfpRegister src,
-                     int index) {
-  // Instruction details available in ARM DDI 0406C.b, A8-884.
-  DCHECK(IsEnabled(NEON));
-  emit(EncodeNeonDupOp(size, NEON_Q, dst.code(), src, index));
-}
-
-// Encode NEON vcvt.src_type.dst_type instruction.
-static Instr EncodeNeonVCVT(VFPType dst_type, QwNeonRegister dst,
-                            VFPType src_type, QwNeonRegister src) {
-  DCHECK(src_type != dst_type);
-  DCHECK(src_type == F32 || dst_type == F32);
-  // Instruction details available in ARM DDI 0406C.b, A8.8.868.
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vm, m;
-  src.split_code(&vm, &m);
-
-  int op = 0;
-  if (src_type == F32) {
-    DCHECK(dst_type == S32 || dst_type == U32);
-    op = dst_type == U32 ? 3 : 2;
-  } else {
-    DCHECK(src_type == S32 || src_type == U32);
-    op = src_type == U32 ? 1 : 0;
-  }
-
-  return 0x1E7U * B23 | d * B22 | 0x3B * B16 | vd * B12 | 0x3 * B9 | op * B7 |
-         B6 | m * B5 | vm;
-}
-
-void Assembler::vcvt_f32_s32(QwNeonRegister dst, QwNeonRegister src) {
-  DCHECK(IsEnabled(NEON));
-  DCHECK(VfpRegisterIsAvailable(dst));
-  DCHECK(VfpRegisterIsAvailable(src));
-  emit(EncodeNeonVCVT(F32, dst, S32, src));
-}
-
-void Assembler::vcvt_f32_u32(QwNeonRegister dst, QwNeonRegister src) {
-  DCHECK(IsEnabled(NEON));
-  DCHECK(VfpRegisterIsAvailable(dst));
-  DCHECK(VfpRegisterIsAvailable(src));
-  emit(EncodeNeonVCVT(F32, dst, U32, src));
-}
-
-void Assembler::vcvt_s32_f32(QwNeonRegister dst, QwNeonRegister src) {
-  DCHECK(IsEnabled(NEON));
-  DCHECK(VfpRegisterIsAvailable(dst));
-  DCHECK(VfpRegisterIsAvailable(src));
-  emit(EncodeNeonVCVT(S32, dst, F32, src));
-}
-
-void Assembler::vcvt_u32_f32(QwNeonRegister dst, QwNeonRegister src) {
-  DCHECK(IsEnabled(NEON));
-  DCHECK(VfpRegisterIsAvailable(dst));
-  DCHECK(VfpRegisterIsAvailable(src));
-  emit(EncodeNeonVCVT(U32, dst, F32, src));
-}
-
-enum UnaryOp { VMVN, VSWP, VABS, VABSF, VNEG, VNEGF };
-
-static Instr EncodeNeonUnaryOp(UnaryOp op, NeonRegType reg_type, NeonSize size,
-                               int dst_code, int src_code) {
-  int op_encoding = 0;
-  switch (op) {
-    case VMVN:
-      DCHECK_EQ(Neon8, size);  // size == 0 for vmvn
-      op_encoding = B10 | 0x3 * B7;
-      break;
-    case VSWP:
-      DCHECK_EQ(Neon8, size);  // size == 0 for vswp
-      op_encoding = B17;
-      break;
-    case VABS:
-      op_encoding = B16 | 0x6 * B7;
-      break;
-    case VABSF:
-      DCHECK_EQ(Neon32, size);
-      op_encoding = B16 | B10 | 0x6 * B7;
-      break;
-    case VNEG:
-      op_encoding = B16 | 0x7 * B7;
-      break;
-    case VNEGF:
-      DCHECK_EQ(Neon32, size);
-      op_encoding = B16 | B10 | 0x7 * B7;
-      break;
-    default:
-      UNREACHABLE();
-      break;
-  }
-  int vd, d;
-  NeonSplitCode(reg_type, dst_code, &vd, &d, &op_encoding);
-  int vm, m;
-  NeonSplitCode(reg_type, src_code, &vm, &m, &op_encoding);
-
-  return 0x1E7U * B23 | d * B22 | 0x3 * B20 | size * B18 | vd * B12 | m * B5 |
-         vm | op_encoding;
-}
-
-void Assembler::vmvn(QwNeonRegister dst, QwNeonRegister src) {
-  // Qd = vmvn(Qn, Qm) SIMD bitwise negate.
-  // Instruction details available in ARM DDI 0406C.b, A8-966.
-  DCHECK(IsEnabled(NEON));
-  emit(EncodeNeonUnaryOp(VMVN, NEON_Q, Neon8, dst.code(), src.code()));
-}
-
-void Assembler::vswp(DwVfpRegister dst, DwVfpRegister src) {
-  DCHECK(IsEnabled(NEON));
-  // Dd = vswp(Dn, Dm) SIMD d-register swap.
-  // Instruction details available in ARM DDI 0406C.b, A8.8.418.
-  DCHECK(IsEnabled(NEON));
-  emit(EncodeNeonUnaryOp(VSWP, NEON_D, Neon8, dst.code(), src.code()));
-}
-
-void Assembler::vswp(QwNeonRegister dst, QwNeonRegister src) {
-  // Qd = vswp(Qn, Qm) SIMD q-register swap.
-  // Instruction details available in ARM DDI 0406C.b, A8.8.418.
-  DCHECK(IsEnabled(NEON));
-  emit(EncodeNeonUnaryOp(VSWP, NEON_Q, Neon8, dst.code(), src.code()));
-}
-
-void Assembler::vabs(QwNeonRegister dst, QwNeonRegister src) {
-  // Qd = vabs.f<size>(Qn, Qm) SIMD floating point absolute value.
-  // Instruction details available in ARM DDI 0406C.b, A8.8.824.
-  DCHECK(IsEnabled(NEON));
-  emit(EncodeNeonUnaryOp(VABSF, NEON_Q, Neon32, dst.code(), src.code()));
-}
-
-void Assembler::vabs(NeonSize size, QwNeonRegister dst, QwNeonRegister src) {
-  // Qd = vabs.s<size>(Qn, Qm) SIMD integer absolute value.
-  // Instruction details available in ARM DDI 0406C.b, A8.8.824.
-  DCHECK(IsEnabled(NEON));
-  emit(EncodeNeonUnaryOp(VABS, NEON_Q, size, dst.code(), src.code()));
-}
-
-void Assembler::vneg(QwNeonRegister dst, QwNeonRegister src) {
-  // Qd = vabs.f<size>(Qn, Qm) SIMD floating point negate.
-  // Instruction details available in ARM DDI 0406C.b, A8.8.968.
-  DCHECK(IsEnabled(NEON));
-  emit(EncodeNeonUnaryOp(VNEGF, NEON_Q, Neon32, dst.code(), src.code()));
-}
-
-void Assembler::vneg(NeonSize size, QwNeonRegister dst, QwNeonRegister src) {
-  // Qd = vabs.s<size>(Qn, Qm) SIMD integer negate.
-  // Instruction details available in ARM DDI 0406C.b, A8.8.968.
-  DCHECK(IsEnabled(NEON));
-  emit(EncodeNeonUnaryOp(VNEG, NEON_Q, size, dst.code(), src.code()));
-}
-
-enum BinaryBitwiseOp { VAND, VBIC, VBIF, VBIT, VBSL, VEOR, VORR, VORN };
-
-static Instr EncodeNeonBinaryBitwiseOp(BinaryBitwiseOp op, NeonRegType reg_type,
-                                       int dst_code, int src_code1,
-                                       int src_code2) {
-  int op_encoding = 0;
-  switch (op) {
-    case VBIC:
-      op_encoding = 0x1 * B20;
-      break;
-    case VBIF:
-      op_encoding = B24 | 0x3 * B20;
-      break;
-    case VBIT:
-      op_encoding = B24 | 0x2 * B20;
-      break;
-    case VBSL:
-      op_encoding = B24 | 0x1 * B20;
-      break;
-    case VEOR:
-      op_encoding = B24;
-      break;
-    case VORR:
-      op_encoding = 0x2 * B20;
-      break;
-    case VORN:
-      op_encoding = 0x3 * B20;
-      break;
-    case VAND:
-      // op_encoding is 0.
-      break;
-    default:
-      UNREACHABLE();
-      break;
-  }
-  int vd, d;
-  NeonSplitCode(reg_type, dst_code, &vd, &d, &op_encoding);
-  int vn, n;
-  NeonSplitCode(reg_type, src_code1, &vn, &n, &op_encoding);
-  int vm, m;
-  NeonSplitCode(reg_type, src_code2, &vm, &m, &op_encoding);
-
-  return 0x1E4U * B23 | op_encoding | d * B22 | vn * B16 | vd * B12 | B8 |
-         n * B7 | m * B5 | B4 | vm;
-}
-
-void Assembler::vand(QwNeonRegister dst, QwNeonRegister src1,
-                     QwNeonRegister src2) {
-  // Qd = vand(Qn, Qm) SIMD AND.
-  // Instruction details available in ARM DDI 0406C.b, A8.8.836.
-  DCHECK(IsEnabled(NEON));
-  emit(EncodeNeonBinaryBitwiseOp(VAND, NEON_Q, dst.code(), src1.code(),
-                                 src2.code()));
-}
-
-void Assembler::vbsl(QwNeonRegister dst, QwNeonRegister src1,
-                     QwNeonRegister src2) {
-  // Qd = vbsl(Qn, Qm) SIMD bitwise select.
-  // Instruction details available in ARM DDI 0406C.b, A8-844.
-  DCHECK(IsEnabled(NEON));
-  emit(EncodeNeonBinaryBitwiseOp(VBSL, NEON_Q, dst.code(), src1.code(),
-                                 src2.code()));
-}
-
-void Assembler::veor(DwVfpRegister dst, DwVfpRegister src1,
-                     DwVfpRegister src2) {
-  // Dd = veor(Dn, Dm) SIMD exclusive OR.
-  // Instruction details available in ARM DDI 0406C.b, A8.8.888.
-  DCHECK(IsEnabled(NEON));
-  emit(EncodeNeonBinaryBitwiseOp(VEOR, NEON_D, dst.code(), src1.code(),
-                                 src2.code()));
-}
-
-void Assembler::veor(QwNeonRegister dst, QwNeonRegister src1,
-                     QwNeonRegister src2) {
-  // Qd = veor(Qn, Qm) SIMD exclusive OR.
-  // Instruction details available in ARM DDI 0406C.b, A8.8.888.
-  DCHECK(IsEnabled(NEON));
-  emit(EncodeNeonBinaryBitwiseOp(VEOR, NEON_Q, dst.code(), src1.code(),
-                                 src2.code()));
-}
-
-void Assembler::vorr(QwNeonRegister dst, QwNeonRegister src1,
-                     QwNeonRegister src2) {
-  // Qd = vorr(Qn, Qm) SIMD OR.
-  // Instruction details available in ARM DDI 0406C.b, A8.8.976.
-  DCHECK(IsEnabled(NEON));
-  emit(EncodeNeonBinaryBitwiseOp(VORR, NEON_Q, dst.code(), src1.code(),
-                                 src2.code()));
-}
-
-enum FPBinOp {
-  VADDF,
-  VSUBF,
-  VMULF,
-  VMINF,
-  VMAXF,
-  VRECPS,
-  VRSQRTS,
-  VCEQF,
-  VCGEF,
-  VCGTF
-};
-
-static Instr EncodeNeonBinOp(FPBinOp op, QwNeonRegister dst,
-                             QwNeonRegister src1, QwNeonRegister src2) {
-  int op_encoding = 0;
-  switch (op) {
-    case VADDF:
-      op_encoding = 0xD * B8;
-      break;
-    case VSUBF:
-      op_encoding = B21 | 0xD * B8;
-      break;
-    case VMULF:
-      op_encoding = B24 | 0xD * B8 | B4;
-      break;
-    case VMINF:
-      op_encoding = B21 | 0xF * B8;
-      break;
-    case VMAXF:
-      op_encoding = 0xF * B8;
-      break;
-    case VRECPS:
-      op_encoding = 0xF * B8 | B4;
-      break;
-    case VRSQRTS:
-      op_encoding = B21 | 0xF * B8 | B4;
-      break;
-    case VCEQF:
-      op_encoding = 0xE * B8;
-      break;
-    case VCGEF:
-      op_encoding = B24 | 0xE * B8;
-      break;
-    case VCGTF:
-      op_encoding = B24 | B21 | 0xE * B8;
-      break;
-    default:
-      UNREACHABLE();
-      break;
-  }
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vn, n;
-  src1.split_code(&vn, &n);
-  int vm, m;
-  src2.split_code(&vm, &m);
-  return 0x1E4U * B23 | d * B22 | vn * B16 | vd * B12 | n * B7 | B6 | m * B5 |
-         vm | op_encoding;
-}
-
-enum IntegerBinOp {
-  VADD,
-  VQADD,
-  VSUB,
-  VQSUB,
-  VMUL,
-  VMIN,
-  VMAX,
-  VTST,
-  VCEQ,
-  VCGE,
-  VCGT
-};
-
-static Instr EncodeNeonBinOp(IntegerBinOp op, NeonDataType dt,
-                             QwNeonRegister dst, QwNeonRegister src1,
-                             QwNeonRegister src2) {
-  int op_encoding = 0;
-  switch (op) {
-    case VADD:
-      op_encoding = 0x8 * B8;
-      break;
-    case VQADD:
-      op_encoding = B4;
-      break;
-    case VSUB:
-      op_encoding = B24 | 0x8 * B8;
-      break;
-    case VQSUB:
-      op_encoding = 0x2 * B8 | B4;
-      break;
-    case VMUL:
-      op_encoding = 0x9 * B8 | B4;
-      break;
-    case VMIN:
-      op_encoding = 0x6 * B8 | B4;
-      break;
-    case VMAX:
-      op_encoding = 0x6 * B8;
-      break;
-    case VTST:
-      op_encoding = 0x8 * B8 | B4;
-      break;
-    case VCEQ:
-      op_encoding = B24 | 0x8 * B8 | B4;
-      break;
-    case VCGE:
-      op_encoding = 0x3 * B8 | B4;
-      break;
-    case VCGT:
-      op_encoding = 0x3 * B8;
-      break;
-    default:
-      UNREACHABLE();
-      break;
-  }
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vn, n;
-  src1.split_code(&vn, &n);
-  int vm, m;
-  src2.split_code(&vm, &m);
-  int size = NeonSz(dt);
-  int u = NeonU(dt);
-  return 0x1E4U * B23 | u * B24 | d * B22 | size * B20 | vn * B16 | vd * B12 |
-         n * B7 | B6 | m * B5 | vm | op_encoding;
-}
-
-static Instr EncodeNeonBinOp(IntegerBinOp op, NeonSize size, QwNeonRegister dst,
-                             QwNeonRegister src1, QwNeonRegister src2) {
-  // Map NeonSize values to the signed values in NeonDataType, so the U bit
-  // will be 0.
-  return EncodeNeonBinOp(op, static_cast<NeonDataType>(size), dst, src1, src2);
-}
-
-void Assembler::vadd(QwNeonRegister dst, QwNeonRegister src1,
-                     QwNeonRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vadd(Qn, Qm) SIMD floating point addition.
-  // Instruction details available in ARM DDI 0406C.b, A8-830.
-  emit(EncodeNeonBinOp(VADDF, dst, src1, src2));
-}
-
-void Assembler::vadd(NeonSize size, QwNeonRegister dst, QwNeonRegister src1,
-                     QwNeonRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vadd(Qn, Qm) SIMD integer addition.
-  // Instruction details available in ARM DDI 0406C.b, A8-828.
-  emit(EncodeNeonBinOp(VADD, size, dst, src1, src2));
-}
-
-void Assembler::vqadd(NeonDataType dt, QwNeonRegister dst, QwNeonRegister src1,
-                      QwNeonRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vqadd(Qn, Qm) SIMD integer saturating addition.
-  // Instruction details available in ARM DDI 0406C.b, A8-996.
-  emit(EncodeNeonBinOp(VQADD, dt, dst, src1, src2));
-}
-
-void Assembler::vsub(QwNeonRegister dst, QwNeonRegister src1,
-                     QwNeonRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vsub(Qn, Qm) SIMD floating point subtraction.
-  // Instruction details available in ARM DDI 0406C.b, A8-1086.
-  emit(EncodeNeonBinOp(VSUBF, dst, src1, src2));
-}
-
-void Assembler::vsub(NeonSize size, QwNeonRegister dst, QwNeonRegister src1,
-                     QwNeonRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vsub(Qn, Qm) SIMD integer subtraction.
-  // Instruction details available in ARM DDI 0406C.b, A8-1084.
-  emit(EncodeNeonBinOp(VSUB, size, dst, src1, src2));
-}
-
-void Assembler::vqsub(NeonDataType dt, QwNeonRegister dst, QwNeonRegister src1,
-                      QwNeonRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vqsub(Qn, Qm) SIMD integer saturating subtraction.
-  // Instruction details available in ARM DDI 0406C.b, A8-1020.
-  emit(EncodeNeonBinOp(VQSUB, dt, dst, src1, src2));
-}
-
-void Assembler::vmul(QwNeonRegister dst, QwNeonRegister src1,
-                     QwNeonRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vadd(Qn, Qm) SIMD floating point multiply.
-  // Instruction details available in ARM DDI 0406C.b, A8-958.
-  emit(EncodeNeonBinOp(VMULF, dst, src1, src2));
-}
-
-void Assembler::vmul(NeonSize size, QwNeonRegister dst, QwNeonRegister src1,
-                     QwNeonRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vadd(Qn, Qm) SIMD integer multiply.
-  // Instruction details available in ARM DDI 0406C.b, A8-960.
-  emit(EncodeNeonBinOp(VMUL, size, dst, src1, src2));
-}
-
-void Assembler::vmin(QwNeonRegister dst, QwNeonRegister src1,
-                     QwNeonRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vmin(Qn, Qm) SIMD floating point MIN.
-  // Instruction details available in ARM DDI 0406C.b, A8-928.
-  emit(EncodeNeonBinOp(VMINF, dst, src1, src2));
-}
-
-void Assembler::vmin(NeonDataType dt, QwNeonRegister dst, QwNeonRegister src1,
-                     QwNeonRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vmin(Qn, Qm) SIMD integer MIN.
-  // Instruction details available in ARM DDI 0406C.b, A8-926.
-  emit(EncodeNeonBinOp(VMIN, dt, dst, src1, src2));
-}
-
-void Assembler::vmax(QwNeonRegister dst, QwNeonRegister src1,
-                     QwNeonRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vmax(Qn, Qm) SIMD floating point MAX.
-  // Instruction details available in ARM DDI 0406C.b, A8-928.
-  emit(EncodeNeonBinOp(VMAXF, dst, src1, src2));
-}
-
-void Assembler::vmax(NeonDataType dt, QwNeonRegister dst, QwNeonRegister src1,
-                     QwNeonRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vmax(Qn, Qm) SIMD integer MAX.
-  // Instruction details available in ARM DDI 0406C.b, A8-926.
-  emit(EncodeNeonBinOp(VMAX, dt, dst, src1, src2));
-}
-
-enum NeonShiftOp { VSHL, VSHR, VSLI, VSRI };
-
-static Instr EncodeNeonShiftOp(NeonShiftOp op, NeonSize size, bool is_unsigned,
-                               NeonRegType reg_type, int dst_code, int src_code,
-                               int shift) {
-  int imm6 = 0;
-  int size_in_bits = kBitsPerByte << static_cast<int>(size);
-  int op_encoding = 0;
-  switch (op) {
-    case VSHL: {
-      DCHECK(shift >= 0 && size_in_bits > shift);
-      imm6 = size_in_bits + shift;
-      op_encoding = 0x5 * B8;
-      break;
-    }
-    case VSHR: {
-      DCHECK(shift > 0 && size_in_bits >= shift);
-      imm6 = 2 * size_in_bits - shift;
-      if (is_unsigned) op_encoding |= B24;
-      break;
-    }
-    case VSLI: {
-      DCHECK(shift >= 0 && size_in_bits > shift);
-      imm6 = size_in_bits + shift;
-      int L = imm6 >> 6;
-      imm6 &= 0x3F;
-      op_encoding = B24 | 0x5 * B8 | L * B7;
-      break;
-    }
-    case VSRI: {
-      DCHECK(shift > 0 && size_in_bits >= shift);
-      imm6 = 2 * size_in_bits - shift;
-      int L = imm6 >> 6;
-      imm6 &= 0x3F;
-      op_encoding = B24 | 0x4 * B8 | L * B7;
-      break;
-    }
-    default:
-      UNREACHABLE();
-      break;
-  }
-
-  int vd, d;
-  NeonSplitCode(reg_type, dst_code, &vd, &d, &op_encoding);
-  int vm, m;
-  NeonSplitCode(reg_type, src_code, &vm, &m, &op_encoding);
-
-  return 0x1E5U * B23 | d * B22 | imm6 * B16 | vd * B12 | m * B5 | B4 | vm |
-         op_encoding;
-}
-
-void Assembler::vshl(NeonDataType dt, QwNeonRegister dst, QwNeonRegister src,
-                     int shift) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vshl(Qm, bits) SIMD shift left immediate.
-  // Instruction details available in ARM DDI 0406C.b, A8-1046.
-  emit(EncodeNeonShiftOp(VSHL, NeonDataTypeToSize(dt), false, NEON_Q,
-                         dst.code(), src.code(), shift));
-}
-
-void Assembler::vshr(NeonDataType dt, QwNeonRegister dst, QwNeonRegister src,
-                     int shift) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vshl(Qm, bits) SIMD shift right immediate.
-  // Instruction details available in ARM DDI 0406C.b, A8-1052.
-  emit(EncodeNeonShiftOp(VSHR, NeonDataTypeToSize(dt), NeonU(dt), NEON_Q,
-                         dst.code(), src.code(), shift));
-}
-
-void Assembler::vsli(NeonSize size, DwVfpRegister dst, DwVfpRegister src,
-                     int shift) {
-  DCHECK(IsEnabled(NEON));
-  // Dd = vsli(Dm, bits) SIMD shift left and insert.
-  // Instruction details available in ARM DDI 0406C.b, A8-1056.
-  emit(EncodeNeonShiftOp(VSLI, size, false, NEON_D, dst.code(), src.code(),
-                         shift));
-}
-
-void Assembler::vsri(NeonSize size, DwVfpRegister dst, DwVfpRegister src,
-                     int shift) {
-  DCHECK(IsEnabled(NEON));
-  // Dd = vsri(Dm, bits) SIMD shift right and insert.
-  // Instruction details available in ARM DDI 0406C.b, A8-1062.
-  emit(EncodeNeonShiftOp(VSRI, size, false, NEON_D, dst.code(), src.code(),
-                         shift));
-}
-
-static Instr EncodeNeonEstimateOp(bool is_rsqrt, QwNeonRegister dst,
-                                  QwNeonRegister src) {
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vm, m;
-  src.split_code(&vm, &m);
-  int rsqrt = is_rsqrt ? 1 : 0;
-  return 0x1E7U * B23 | d * B22 | 0x3B * B16 | vd * B12 | 0x5 * B8 |
-         rsqrt * B7 | B6 | m * B5 | vm;
-}
-
-void Assembler::vrecpe(QwNeonRegister dst, QwNeonRegister src) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vrecpe(Qm) SIMD reciprocal estimate.
-  // Instruction details available in ARM DDI 0406C.b, A8-1024.
-  emit(EncodeNeonEstimateOp(false, dst, src));
-}
-
-void Assembler::vrsqrte(QwNeonRegister dst, QwNeonRegister src) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vrsqrte(Qm) SIMD reciprocal square root estimate.
-  // Instruction details available in ARM DDI 0406C.b, A8-1038.
-  emit(EncodeNeonEstimateOp(true, dst, src));
-}
-
-void Assembler::vrecps(QwNeonRegister dst, QwNeonRegister src1,
-                       QwNeonRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vrecps(Qn, Qm) SIMD reciprocal refinement step.
-  // Instruction details available in ARM DDI 0406C.b, A8-1026.
-  emit(EncodeNeonBinOp(VRECPS, dst, src1, src2));
-}
-
-void Assembler::vrsqrts(QwNeonRegister dst, QwNeonRegister src1,
-                        QwNeonRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vrsqrts(Qn, Qm) SIMD reciprocal square root refinement step.
-  // Instruction details available in ARM DDI 0406C.b, A8-1040.
-  emit(EncodeNeonBinOp(VRSQRTS, dst, src1, src2));
-}
-
-enum NeonPairwiseOp { VPADD, VPMIN, VPMAX };
-
-static Instr EncodeNeonPairwiseOp(NeonPairwiseOp op, NeonDataType dt,
-                                  DwVfpRegister dst, DwVfpRegister src1,
-                                  DwVfpRegister src2) {
-  int op_encoding = 0;
-  switch (op) {
-    case VPADD:
-      op_encoding = 0xB * B8 | B4;
-      break;
-    case VPMIN:
-      op_encoding = 0xA * B8 | B4;
-      break;
-    case VPMAX:
-      op_encoding = 0xA * B8;
-      break;
-    default:
-      UNREACHABLE();
-      break;
-  }
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vn, n;
-  src1.split_code(&vn, &n);
-  int vm, m;
-  src2.split_code(&vm, &m);
-  int size = NeonSz(dt);
-  int u = NeonU(dt);
-  return 0x1E4U * B23 | u * B24 | d * B22 | size * B20 | vn * B16 | vd * B12 |
-         n * B7 | m * B5 | vm | op_encoding;
-}
-
-void Assembler::vpadd(DwVfpRegister dst, DwVfpRegister src1,
-                      DwVfpRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // Dd = vpadd(Dn, Dm) SIMD integer pairwise ADD.
-  // Instruction details available in ARM DDI 0406C.b, A8-982.
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vn, n;
-  src1.split_code(&vn, &n);
-  int vm, m;
-  src2.split_code(&vm, &m);
-
-  emit(0x1E6U * B23 | d * B22 | vn * B16 | vd * B12 | 0xD * B8 | n * B7 |
-       m * B5 | vm);
-}
-
-void Assembler::vpadd(NeonSize size, DwVfpRegister dst, DwVfpRegister src1,
-                      DwVfpRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // Dd = vpadd(Dn, Dm) SIMD integer pairwise ADD.
-  // Instruction details available in ARM DDI 0406C.b, A8-980.
-  emit(EncodeNeonPairwiseOp(VPADD, NeonSizeToDataType(size), dst, src1, src2));
-}
-
-void Assembler::vpmin(NeonDataType dt, DwVfpRegister dst, DwVfpRegister src1,
-                      DwVfpRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // Dd = vpmin(Dn, Dm) SIMD integer pairwise MIN.
-  // Instruction details available in ARM DDI 0406C.b, A8-986.
-  emit(EncodeNeonPairwiseOp(VPMIN, dt, dst, src1, src2));
-}
-
-void Assembler::vpmax(NeonDataType dt, DwVfpRegister dst, DwVfpRegister src1,
-                      DwVfpRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // Dd = vpmax(Dn, Dm) SIMD integer pairwise MAX.
-  // Instruction details available in ARM DDI 0406C.b, A8-986.
-  emit(EncodeNeonPairwiseOp(VPMAX, dt, dst, src1, src2));
-}
-
-void Assembler::vtst(NeonSize size, QwNeonRegister dst, QwNeonRegister src1,
-                     QwNeonRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vtst(Qn, Qm) SIMD test integer operands.
-  // Instruction details available in ARM DDI 0406C.b, A8-1098.
-  emit(EncodeNeonBinOp(VTST, size, dst, src1, src2));
-}
-
-void Assembler::vceq(QwNeonRegister dst, QwNeonRegister src1,
-                     QwNeonRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vceq(Qn, Qm) SIMD floating point compare equal.
-  // Instruction details available in ARM DDI 0406C.b, A8-844.
-  emit(EncodeNeonBinOp(VCEQF, dst, src1, src2));
-}
-
-void Assembler::vceq(NeonSize size, QwNeonRegister dst, QwNeonRegister src1,
-                     QwNeonRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vceq(Qn, Qm) SIMD integer compare equal.
-  // Instruction details available in ARM DDI 0406C.b, A8-844.
-  emit(EncodeNeonBinOp(VCEQ, size, dst, src1, src2));
-}
-
-void Assembler::vcge(QwNeonRegister dst, QwNeonRegister src1,
-                     QwNeonRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vcge(Qn, Qm) SIMD floating point compare greater or equal.
-  // Instruction details available in ARM DDI 0406C.b, A8-848.
-  emit(EncodeNeonBinOp(VCGEF, dst, src1, src2));
-}
-
-void Assembler::vcge(NeonDataType dt, QwNeonRegister dst, QwNeonRegister src1,
-                     QwNeonRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vcge(Qn, Qm) SIMD integer compare greater or equal.
-  // Instruction details available in ARM DDI 0406C.b, A8-848.
-  emit(EncodeNeonBinOp(VCGE, dt, dst, src1, src2));
-}
-
-void Assembler::vcgt(QwNeonRegister dst, QwNeonRegister src1,
-                     QwNeonRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vcgt(Qn, Qm) SIMD floating point compare greater than.
-  // Instruction details available in ARM DDI 0406C.b, A8-852.
-  emit(EncodeNeonBinOp(VCGTF, dst, src1, src2));
-}
-
-void Assembler::vcgt(NeonDataType dt, QwNeonRegister dst, QwNeonRegister src1,
-                     QwNeonRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vcgt(Qn, Qm) SIMD integer compare greater than.
-  // Instruction details available in ARM DDI 0406C.b, A8-852.
-  emit(EncodeNeonBinOp(VCGT, dt, dst, src1, src2));
-}
-
-void Assembler::vext(QwNeonRegister dst, QwNeonRegister src1,
-                     QwNeonRegister src2, int bytes) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vext(Qn, Qm) SIMD byte extract.
-  // Instruction details available in ARM DDI 0406C.b, A8-890.
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vn, n;
-  src1.split_code(&vn, &n);
-  int vm, m;
-  src2.split_code(&vm, &m);
-  DCHECK_GT(16, bytes);
-  emit(0x1E5U * B23 | d * B22 | 0x3 * B20 | vn * B16 | vd * B12 | bytes * B8 |
-       n * B7 | B6 | m * B5 | vm);
-}
-
-enum NeonSizedOp { VZIP, VUZP, VREV16, VREV32, VREV64, VTRN };
-
-static Instr EncodeNeonSizedOp(NeonSizedOp op, NeonRegType reg_type,
-                               NeonSize size, int dst_code, int src_code) {
-  int op_encoding = 0;
-  switch (op) {
-    case VZIP:
-      op_encoding = 0x2 * B16 | 0x3 * B7;
-      break;
-    case VUZP:
-      op_encoding = 0x2 * B16 | 0x2 * B7;
-      break;
-    case VREV16:
-      op_encoding = 0x2 * B7;
-      break;
-    case VREV32:
-      op_encoding = 0x1 * B7;
-      break;
-    case VREV64:
-      // op_encoding is 0;
-      break;
-    case VTRN:
-      op_encoding = 0x2 * B16 | B7;
-      break;
-    default:
-      UNREACHABLE();
-      break;
-  }
-  int vd, d;
-  NeonSplitCode(reg_type, dst_code, &vd, &d, &op_encoding);
-  int vm, m;
-  NeonSplitCode(reg_type, src_code, &vm, &m, &op_encoding);
-
-  int sz = static_cast<int>(size);
-  return 0x1E7U * B23 | d * B22 | 0x3 * B20 | sz * B18 | vd * B12 | m * B5 |
-         vm | op_encoding;
-}
-
-void Assembler::vzip(NeonSize size, DwVfpRegister src1, DwVfpRegister src2) {
-  if (size == Neon32) {  // vzip.32 Dd, Dm is a pseudo-op for vtrn.32 Dd, Dm.
-    vtrn(size, src1, src2);
-  } else {
-    DCHECK(IsEnabled(NEON));
-    // vzip.<size>(Dn, Dm) SIMD zip (interleave).
-    // Instruction details available in ARM DDI 0406C.b, A8-1102.
-    emit(EncodeNeonSizedOp(VZIP, NEON_D, size, src1.code(), src2.code()));
-  }
-}
-
-void Assembler::vzip(NeonSize size, QwNeonRegister src1, QwNeonRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // vzip.<size>(Qn, Qm) SIMD zip (interleave).
-  // Instruction details available in ARM DDI 0406C.b, A8-1102.
-  emit(EncodeNeonSizedOp(VZIP, NEON_Q, size, src1.code(), src2.code()));
-}
-
-void Assembler::vuzp(NeonSize size, DwVfpRegister src1, DwVfpRegister src2) {
-  if (size == Neon32) {  // vuzp.32 Dd, Dm is a pseudo-op for vtrn.32 Dd, Dm.
-    vtrn(size, src1, src2);
-  } else {
-    DCHECK(IsEnabled(NEON));
-    // vuzp.<size>(Dn, Dm) SIMD un-zip (de-interleave).
-    // Instruction details available in ARM DDI 0406C.b, A8-1100.
-    emit(EncodeNeonSizedOp(VUZP, NEON_D, size, src1.code(), src2.code()));
-  }
-}
-
-void Assembler::vuzp(NeonSize size, QwNeonRegister src1, QwNeonRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // vuzp.<size>(Qn, Qm) SIMD un-zip (de-interleave).
-  // Instruction details available in ARM DDI 0406C.b, A8-1100.
-  emit(EncodeNeonSizedOp(VUZP, NEON_Q, size, src1.code(), src2.code()));
-}
-
-void Assembler::vrev16(NeonSize size, QwNeonRegister dst, QwNeonRegister src) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vrev16.<size>(Qm) SIMD element reverse.
-  // Instruction details available in ARM DDI 0406C.b, A8-1028.
-  emit(EncodeNeonSizedOp(VREV16, NEON_Q, size, dst.code(), src.code()));
-}
-
-void Assembler::vrev32(NeonSize size, QwNeonRegister dst, QwNeonRegister src) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vrev32.<size>(Qm) SIMD element reverse.
-  // Instruction details available in ARM DDI 0406C.b, A8-1028.
-  emit(EncodeNeonSizedOp(VREV32, NEON_Q, size, dst.code(), src.code()));
-}
-
-void Assembler::vrev64(NeonSize size, QwNeonRegister dst, QwNeonRegister src) {
-  DCHECK(IsEnabled(NEON));
-  // Qd = vrev64.<size>(Qm) SIMD element reverse.
-  // Instruction details available in ARM DDI 0406C.b, A8-1028.
-  emit(EncodeNeonSizedOp(VREV64, NEON_Q, size, dst.code(), src.code()));
-}
-
-void Assembler::vtrn(NeonSize size, DwVfpRegister src1, DwVfpRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // vtrn.<size>(Dn, Dm) SIMD element transpose.
-  // Instruction details available in ARM DDI 0406C.b, A8-1096.
-  emit(EncodeNeonSizedOp(VTRN, NEON_D, size, src1.code(), src2.code()));
-}
-
-void Assembler::vtrn(NeonSize size, QwNeonRegister src1, QwNeonRegister src2) {
-  DCHECK(IsEnabled(NEON));
-  // vtrn.<size>(Qn, Qm) SIMD element transpose.
-  // Instruction details available in ARM DDI 0406C.b, A8-1096.
-  emit(EncodeNeonSizedOp(VTRN, NEON_Q, size, src1.code(), src2.code()));
-}
-
-// Encode NEON vtbl / vtbx instruction.
-static Instr EncodeNeonVTB(DwVfpRegister dst, const NeonListOperand& list,
-                           DwVfpRegister index, bool vtbx) {
-  // Dd = vtbl(table, Dm) SIMD vector permute, zero at out of range indices.
-  // Instruction details available in ARM DDI 0406C.b, A8-1094.
-  // Dd = vtbx(table, Dm) SIMD vector permute, skip out of range indices.
-  // Instruction details available in ARM DDI 0406C.b, A8-1094.
-  int vd, d;
-  dst.split_code(&vd, &d);
-  int vn, n;
-  list.base().split_code(&vn, &n);
-  int vm, m;
-  index.split_code(&vm, &m);
-  int op = vtbx ? 1 : 0;  // vtbl = 0, vtbx = 1.
-  return 0x1E7U * B23 | d * B22 | 0x3 * B20 | vn * B16 | vd * B12 | 0x2 * B10 |
-         list.length() * B8 | n * B7 | op * B6 | m * B5 | vm;
-}
-
-void Assembler::vtbl(DwVfpRegister dst, const NeonListOperand& list,
-                     DwVfpRegister index) {
-  DCHECK(IsEnabled(NEON));
-  emit(EncodeNeonVTB(dst, list, index, false));
-}
-
-void Assembler::vtbx(DwVfpRegister dst, const NeonListOperand& list,
-                     DwVfpRegister index) {
-  DCHECK(IsEnabled(NEON));
-  emit(EncodeNeonVTB(dst, list, index, true));
-}
-
-// Pseudo instructions.
-void Assembler::nop(int type) {
-  // ARMv6{K/T2} and v7 have an actual NOP instruction but it serializes
-  // some of the CPU's pipeline and has to issue. Older ARM chips simply used
-  // MOV Rx, Rx as NOP and it performs better even in newer CPUs.
-  // We therefore use MOV Rx, Rx, even on newer CPUs, and use Rx to encode
-  // a type.
-  DCHECK(0 <= type && type <= 14);  // mov pc, pc isn't a nop.
-  emit(al | 13*B21 | type*B12 | type);
-}
-
-void Assembler::pop() { add(sp, sp, Operand(kPointerSize)); }
-
-bool Assembler::IsMovT(Instr instr) {
-  instr &= ~(((kNumberOfConditions - 1) << 28) |  // Mask off conditions
-             ((kNumRegisters-1)*B12) |            // mask out register
-             EncodeMovwImmediate(0xFFFF));        // mask out immediate value
-  return instr == kMovtPattern;
-}
-
-
-bool Assembler::IsMovW(Instr instr) {
-  instr &= ~(((kNumberOfConditions - 1) << 28) |  // Mask off conditions
-             ((kNumRegisters-1)*B12) |            // mask out destination
-             EncodeMovwImmediate(0xFFFF));        // mask out immediate value
-  return instr == kMovwPattern;
-}
-
-
-Instr Assembler::GetMovTPattern() { return kMovtPattern; }
-
-
-Instr Assembler::GetMovWPattern() { return kMovwPattern; }
-
-
-Instr Assembler::EncodeMovwImmediate(uint32_t immediate) {
-  DCHECK_LT(immediate, 0x10000);
-  return ((immediate & 0xF000) << 4) | (immediate & 0xFFF);
-}
-
-
-Instr Assembler::PatchMovwImmediate(Instr instruction, uint32_t immediate) {
-  instruction &= ~EncodeMovwImmediate(0xFFFF);
-  return instruction | EncodeMovwImmediate(immediate);
-}
-
-
-int Assembler::DecodeShiftImm(Instr instr) {
-  int rotate = Instruction::RotateValue(instr) * 2;
-  int immed8 = Instruction::Immed8Value(instr);
-  return base::bits::RotateRight32(immed8, rotate);
-}
-
-
-Instr Assembler::PatchShiftImm(Instr instr, int immed) {
-  uint32_t rotate_imm = 0;
-  uint32_t immed_8 = 0;
-  bool immed_fits = FitsShifter(immed, &rotate_imm, &immed_8, nullptr);
-  DCHECK(immed_fits);
-  USE(immed_fits);
-  return (instr & ~kOff12Mask) | (rotate_imm << 8) | immed_8;
-}
-
-
-bool Assembler::IsNop(Instr instr, int type) {
-  DCHECK(0 <= type && type <= 14);  // mov pc, pc isn't a nop.
-  // Check for mov rx, rx where x = type.
-  return instr == (al | 13*B21 | type*B12 | type);
-}
-
-
-bool Assembler::IsMovImmed(Instr instr) {
-  return (instr & kMovImmedMask) == kMovImmedPattern;
-}
-
-
-bool Assembler::IsOrrImmed(Instr instr) {
-  return (instr & kOrrImmedMask) == kOrrImmedPattern;
-}
-
-
-// static
-bool Assembler::ImmediateFitsAddrMode1Instruction(int32_t imm32) {
-  uint32_t dummy1;
-  uint32_t dummy2;
-  return FitsShifter(imm32, &dummy1, &dummy2, nullptr);
-}
-
-
-bool Assembler::ImmediateFitsAddrMode2Instruction(int32_t imm32) {
-  return is_uint12(abs(imm32));
-}
-
-
-// Debugging.
-void Assembler::RecordConstPool(int size) {
-  // We only need this for debugger support, to correctly compute offsets in the
-  // code.
-  RecordRelocInfo(RelocInfo::CONST_POOL, static_cast<intptr_t>(size));
-}
-
-
-void Assembler::GrowBuffer() {
-  if (!own_buffer_) FATAL("external code buffer is too small");
-
-  // Compute new buffer size.
-  CodeDesc desc;  // the new buffer
-  if (buffer_size_ < 1 * MB) {
-    desc.buffer_size = 2*buffer_size_;
-  } else {
-    desc.buffer_size = buffer_size_ + 1*MB;
-  }
-
-  // Some internal data structures overflow for very large buffers,
-  // they must ensure that kMaximalBufferSize is not too large.
-  if (desc.buffer_size > kMaximalBufferSize) {
-    V8::FatalProcessOutOfMemory("Assembler::GrowBuffer");
-  }
-
-  // Set up new buffer.
-  desc.buffer = NewArray<byte>(desc.buffer_size);
-
-  desc.instr_size = pc_offset();
-  desc.reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos();
-  desc.origin = this;
-
-  // Copy the data.
-  int pc_delta = desc.buffer - buffer_;
-  int rc_delta = (desc.buffer + desc.buffer_size) - (buffer_ + buffer_size_);
-  MemMove(desc.buffer, buffer_, desc.instr_size);
-  MemMove(reloc_info_writer.pos() + rc_delta, reloc_info_writer.pos(),
-          desc.reloc_size);
-
-  // Switch buffers.
-  DeleteArray(buffer_);
-  buffer_ = desc.buffer;
-  buffer_size_ = desc.buffer_size;
-  pc_ += pc_delta;
-  reloc_info_writer.Reposition(reloc_info_writer.pos() + rc_delta,
-                               reloc_info_writer.last_pc() + pc_delta);
-
-  // None of our relocation types are pc relative pointing outside the code
-  // buffer nor pc absolute pointing inside the code buffer, so there is no need
-  // to relocate any emitted relocation entries.
-}
-
-
-void Assembler::db(uint8_t data) {
-  // db is used to write raw data. The constant pool should be emitted or
-  // blocked before using db.
-  DCHECK(is_const_pool_blocked() || pending_32_bit_constants_.empty());
-  DCHECK(is_const_pool_blocked() || pending_64_bit_constants_.empty());
-  CheckBuffer();
-  *reinterpret_cast<uint8_t*>(pc_) = data;
-  pc_ += sizeof(uint8_t);
-}
-
-
-void Assembler::dd(uint32_t data) {
-  // dd is used to write raw data. The constant pool should be emitted or
-  // blocked before using dd.
-  DCHECK(is_const_pool_blocked() || pending_32_bit_constants_.empty());
-  DCHECK(is_const_pool_blocked() || pending_64_bit_constants_.empty());
-  CheckBuffer();
-  *reinterpret_cast<uint32_t*>(pc_) = data;
-  pc_ += sizeof(uint32_t);
-}
-
-
-void Assembler::dq(uint64_t value) {
-  // dq is used to write raw data. The constant pool should be emitted or
-  // blocked before using dq.
-  DCHECK(is_const_pool_blocked() || pending_32_bit_constants_.empty());
-  DCHECK(is_const_pool_blocked() || pending_64_bit_constants_.empty());
-  CheckBuffer();
-  *reinterpret_cast<uint64_t*>(pc_) = value;
-  pc_ += sizeof(uint64_t);
-}
-
-
-void Assembler::emit_code_stub_address(Code* stub) {
-  CheckBuffer();
-  *reinterpret_cast<uint32_t*>(pc_) =
-      reinterpret_cast<uint32_t>(stub->instruction_start());
-  pc_ += sizeof(uint32_t);
-}
-
-void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
-  if (RelocInfo::IsNone(rmode) ||
-      // Don't record external references unless the heap will be serialized.
-      (rmode == RelocInfo::EXTERNAL_REFERENCE && !serializer_enabled() &&
-       !emit_debug_code())) {
-    return;
-  }
-  DCHECK_GE(buffer_space(), kMaxRelocSize);  // too late to grow buffer here
-  RelocInfo rinfo(pc_, rmode, data, nullptr);
-  reloc_info_writer.Write(&rinfo);
-}
-
-void Assembler::ConstantPoolAddEntry(int position, RelocInfo::Mode rmode,
-                                     intptr_t value) {
-  DCHECK(rmode != RelocInfo::COMMENT && rmode != RelocInfo::CONST_POOL &&
-         rmode != RelocInfo::NONE64);
-  bool sharing_ok = RelocInfo::IsNone(rmode) ||
-                    (rmode >= RelocInfo::FIRST_SHAREABLE_RELOC_MODE);
-  DCHECK_LT(pending_32_bit_constants_.size(), kMaxNumPending32Constants);
-  if (pending_32_bit_constants_.empty()) {
-    first_const_pool_32_use_ = position;
-  }
-  ConstantPoolEntry entry(position, value,
-                          sharing_ok || (rmode == RelocInfo::CODE_TARGET &&
-                                         IsCodeTargetSharingAllowed()));
-
-  bool shared = false;
-  if (sharing_ok) {
-    // Merge the constant, if possible.
-    for (size_t i = 0; i < pending_32_bit_constants_.size(); i++) {
-      ConstantPoolEntry& current_entry = pending_32_bit_constants_[i];
-      if (!current_entry.sharing_ok()) continue;
-      if (entry.value() == current_entry.value()) {
-        entry.set_merged_index(i);
-        shared = true;
-        break;
-      }
-    }
-  }
-
-  // Share entries if allowed and possible.
-  // Null-values are placeholders and must be ignored.
-  if (rmode == RelocInfo::CODE_TARGET && IsCodeTargetSharingAllowed() &&
-      value != 0) {
-    // Sharing entries here relies on canonicalized handles - without them, we
-    // will miss the optimisation opportunity.
-    Address handle_address = reinterpret_cast<Address>(value);
-    auto existing = handle_to_index_map_.find(handle_address);
-    if (existing != handle_to_index_map_.end()) {
-      int index = existing->second;
-      entry.set_merged_index(index);
-      shared = true;
-    } else {
-      // Keep track of this code handle.
-      handle_to_index_map_[handle_address] =
-          static_cast<int>(pending_32_bit_constants_.size());
-    }
-  }
-
-  pending_32_bit_constants_.push_back(entry);
-
-  // Make sure the constant pool is not emitted in place of the next
-  // instruction for which we just recorded relocation info.
-  BlockConstPoolFor(1);
-
-  // Emit relocation info.
-  if (MustOutputRelocInfo(rmode, this) && !shared) {
-    RecordRelocInfo(rmode);
-  }
-}
-
-void Assembler::ConstantPoolAddEntry(int position, Double value) {
-  DCHECK_LT(pending_64_bit_constants_.size(), kMaxNumPending64Constants);
-  if (pending_64_bit_constants_.empty()) {
-    first_const_pool_64_use_ = position;
-  }
-  ConstantPoolEntry entry(position, value);
-
-  // Merge the constant, if possible.
-  for (size_t i = 0; i < pending_64_bit_constants_.size(); i++) {
-    ConstantPoolEntry& current_entry = pending_64_bit_constants_[i];
-    DCHECK(current_entry.sharing_ok());
-    if (entry.value() == current_entry.value()) {
-      entry.set_merged_index(i);
-      break;
-    }
-  }
-  pending_64_bit_constants_.push_back(entry);
-
-  // Make sure the constant pool is not emitted in place of the next
-  // instruction for which we just recorded relocation info.
-  BlockConstPoolFor(1);
-}
-
-
-void Assembler::BlockConstPoolFor(int instructions) {
-  int pc_limit = pc_offset() + instructions * kInstrSize;
-  if (no_const_pool_before_ < pc_limit) {
-    // Max pool start (if we need a jump and an alignment).
-#ifdef DEBUG
-    int start = pc_limit + kInstrSize + 2 * kPointerSize;
-    DCHECK(pending_32_bit_constants_.empty() ||
-           (start - first_const_pool_32_use_ +
-                pending_64_bit_constants_.size() * kDoubleSize <
-            kMaxDistToIntPool));
-    DCHECK(pending_64_bit_constants_.empty() ||
-           (start - first_const_pool_64_use_ < kMaxDistToFPPool));
-#endif
-    no_const_pool_before_ = pc_limit;
-  }
-
-  if (next_buffer_check_ < no_const_pool_before_) {
-    next_buffer_check_ = no_const_pool_before_;
-  }
-}
-
-
-void Assembler::CheckConstPool(bool force_emit, bool require_jump) {
-  // Some short sequence of instruction mustn't be broken up by constant pool
-  // emission, such sequences are protected by calls to BlockConstPoolFor and
-  // BlockConstPoolScope.
-  if (is_const_pool_blocked()) {
-    // Something is wrong if emission is forced and blocked at the same time.
-    DCHECK(!force_emit);
-    return;
-  }
-
-  // There is nothing to do if there are no pending constant pool entries.
-  if (pending_32_bit_constants_.empty() && pending_64_bit_constants_.empty()) {
-    // Calculate the offset of the next check.
-    next_buffer_check_ = pc_offset() + kCheckPoolInterval;
-    return;
-  }
-
-  // Check that the code buffer is large enough before emitting the constant
-  // pool (include the jump over the pool and the constant pool marker and
-  // the gap to the relocation information).
-  int jump_instr = require_jump ? kInstrSize : 0;
-  int size_up_to_marker = jump_instr + kInstrSize;
-  int estimated_size_after_marker =
-      pending_32_bit_constants_.size() * kPointerSize;
-  bool has_int_values = !pending_32_bit_constants_.empty();
-  bool has_fp_values = !pending_64_bit_constants_.empty();
-  bool require_64_bit_align = false;
-  if (has_fp_values) {
-    require_64_bit_align =
-        !IsAligned(reinterpret_cast<intptr_t>(pc_ + size_up_to_marker),
-                   kDoubleAlignment);
-    if (require_64_bit_align) {
-      estimated_size_after_marker += kInstrSize;
-    }
-    estimated_size_after_marker +=
-        pending_64_bit_constants_.size() * kDoubleSize;
-  }
-  int estimated_size = size_up_to_marker + estimated_size_after_marker;
-
-  // We emit a constant pool when:
-  //  * requested to do so by parameter force_emit (e.g. after each function).
-  //  * the distance from the first instruction accessing the constant pool to
-  //    any of the constant pool entries will exceed its limit the next
-  //    time the pool is checked. This is overly restrictive, but we don't emit
-  //    constant pool entries in-order so it's conservatively correct.
-  //  * the instruction doesn't require a jump after itself to jump over the
-  //    constant pool, and we're getting close to running out of range.
-  if (!force_emit) {
-    DCHECK(has_fp_values || has_int_values);
-    bool need_emit = false;
-    if (has_fp_values) {
-      // The 64-bit constants are always emitted before the 32-bit constants, so
-      // we can ignore the effect of the 32-bit constants on estimated_size.
-      int dist64 = pc_offset() + estimated_size -
-                   pending_32_bit_constants_.size() * kPointerSize -
-                   first_const_pool_64_use_;
-      if ((dist64 >= kMaxDistToFPPool - kCheckPoolInterval) ||
-          (!require_jump && (dist64 >= kMaxDistToFPPool / 2))) {
-        need_emit = true;
-      }
-    }
-    if (has_int_values) {
-      int dist32 = pc_offset() + estimated_size - first_const_pool_32_use_;
-      if ((dist32 >= kMaxDistToIntPool - kCheckPoolInterval) ||
-          (!require_jump && (dist32 >= kMaxDistToIntPool / 2))) {
-        need_emit = true;
-      }
-    }
-    if (!need_emit) return;
-  }
-
-  // Deduplicate constants.
-  int size_after_marker = estimated_size_after_marker;
-  for (size_t i = 0; i < pending_64_bit_constants_.size(); i++) {
-    ConstantPoolEntry& entry = pending_64_bit_constants_[i];
-    if (entry.is_merged()) size_after_marker -= kDoubleSize;
-  }
-
-  for (size_t i = 0; i < pending_32_bit_constants_.size(); i++) {
-    ConstantPoolEntry& entry = pending_32_bit_constants_[i];
-    if (entry.is_merged()) size_after_marker -= kPointerSize;
-  }
-
-  int size = size_up_to_marker + size_after_marker;
-
-  int needed_space = size + kGap;
-  while (buffer_space() <= needed_space) GrowBuffer();
-
-  {
-    // Block recursive calls to CheckConstPool.
-    BlockConstPoolScope block_const_pool(this);
-    RecordComment("[ Constant Pool");
-    RecordConstPool(size);
-
-    Label size_check;
-    bind(&size_check);
-
-    // Emit jump over constant pool if necessary.
-    Label after_pool;
-    if (require_jump) {
-      b(&after_pool);
-    }
-
-    // Put down constant pool marker "Undefined instruction".
-    // The data size helps disassembly know what to print.
-    emit(kConstantPoolMarker |
-         EncodeConstantPoolLength(size_after_marker / kPointerSize));
-
-    if (require_64_bit_align) {
-      emit(kConstantPoolMarker);
-    }
-
-    // Emit 64-bit constant pool entries first: their range is smaller than
-    // 32-bit entries.
-    for (size_t i = 0; i < pending_64_bit_constants_.size(); i++) {
-      ConstantPoolEntry& entry = pending_64_bit_constants_[i];
-
-      Instr instr = instr_at(entry.position());
-      // Instruction to patch must be 'vldr rd, [pc, #offset]' with offset == 0.
-      DCHECK((IsVldrDPcImmediateOffset(instr) &&
-              GetVldrDRegisterImmediateOffset(instr) == 0));
-
-      int delta = pc_offset() - entry.position() - kPcLoadDelta;
-      DCHECK(is_uint10(delta));
-
-      if (entry.is_merged()) {
-        ConstantPoolEntry& merged =
-            pending_64_bit_constants_[entry.merged_index()];
-        DCHECK(entry.value64() == merged.value64());
-        Instr merged_instr = instr_at(merged.position());
-        DCHECK(IsVldrDPcImmediateOffset(merged_instr));
-        delta = GetVldrDRegisterImmediateOffset(merged_instr);
-        delta += merged.position() - entry.position();
-      }
-      instr_at_put(entry.position(),
-                   SetVldrDRegisterImmediateOffset(instr, delta));
-      if (!entry.is_merged()) {
-        DCHECK(IsAligned(reinterpret_cast<intptr_t>(pc_), kDoubleAlignment));
-        dq(entry.value64());
-      }
-    }
-
-    // Emit 32-bit constant pool entries.
-    for (size_t i = 0; i < pending_32_bit_constants_.size(); i++) {
-      ConstantPoolEntry& entry = pending_32_bit_constants_[i];
-      Instr instr = instr_at(entry.position());
-
-      // 64-bit loads shouldn't get here.
-      DCHECK(!IsVldrDPcImmediateOffset(instr));
-      DCHECK(!IsMovW(instr));
-      DCHECK(IsLdrPcImmediateOffset(instr) &&
-             GetLdrRegisterImmediateOffset(instr) == 0);
-
-      int delta = pc_offset() - entry.position() - kPcLoadDelta;
-      DCHECK(is_uint12(delta));
-      // 0 is the smallest delta:
-      //   ldr rd, [pc, #0]
-      //   constant pool marker
-      //   data
-
-      if (entry.is_merged()) {
-        DCHECK(entry.sharing_ok());
-        ConstantPoolEntry& merged =
-            pending_32_bit_constants_[entry.merged_index()];
-        DCHECK(entry.value() == merged.value());
-        Instr merged_instr = instr_at(merged.position());
-        DCHECK(IsLdrPcImmediateOffset(merged_instr));
-        delta = GetLdrRegisterImmediateOffset(merged_instr);
-        delta += merged.position() - entry.position();
-      }
-      instr_at_put(entry.position(),
-                   SetLdrRegisterImmediateOffset(instr, delta));
-      if (!entry.is_merged()) {
-        emit(entry.value());
-      }
-    }
-
-    pending_32_bit_constants_.clear();
-    pending_64_bit_constants_.clear();
-    handle_to_index_map_.clear();
-
-    first_const_pool_32_use_ = -1;
-    first_const_pool_64_use_ = -1;
-
-    RecordComment("]");
-
-    DCHECK_EQ(size, SizeOfCodeGeneratedSince(&size_check));
-
-    if (after_pool.is_linked()) {
-      bind(&after_pool);
-    }
-  }
-
-  // Since a constant pool was just emitted, move the check offset forward by
-  // the standard interval.
-  next_buffer_check_ = pc_offset() + kCheckPoolInterval;
-}
-
-PatchingAssembler::PatchingAssembler(IsolateData isolate_data, byte* address,
-                                     int instructions)
-    : Assembler(isolate_data, address, instructions * kInstrSize + kGap) {
-  DCHECK_EQ(reloc_info_writer.pos(), buffer_ + buffer_size_);
-}
-
-PatchingAssembler::~PatchingAssembler() {
-  // Check that we don't have any pending constant pools.
-  DCHECK(pending_32_bit_constants_.empty());
-  DCHECK(pending_64_bit_constants_.empty());
-
-  // Check that the code was patched as expected.
-  DCHECK_EQ(pc_, buffer_ + buffer_size_ - kGap);
-  DCHECK_EQ(reloc_info_writer.pos(), buffer_ + buffer_size_);
-}
-
-void PatchingAssembler::Emit(Address addr) {
-  emit(reinterpret_cast<Instr>(addr));
-}
-
-void PatchingAssembler::FlushICache(Isolate* isolate) {
-  Assembler::FlushICache(isolate, buffer_, buffer_size_ - kGap);
-}
-
-UseScratchRegisterScope::UseScratchRegisterScope(Assembler* assembler)
-    : available_(assembler->GetScratchRegisterList()),
-      old_available_(*available_) {}
-
-UseScratchRegisterScope::~UseScratchRegisterScope() {
-  *available_ = old_available_;
-}
-
-Register UseScratchRegisterScope::Acquire() {
-  DCHECK_NOT_NULL(available_);
-  DCHECK_NE(*available_, 0);
-  int index = static_cast<int>(base::bits::CountTrailingZeros32(*available_));
-  *available_ &= ~(1UL << index);
-  return Register::from_code(index);
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_ARM
diff --git a/src/v8/src/arm/assembler-arm.h b/src/v8/src/arm/assembler-arm.h
deleted file mode 100644
index 8b95aad..0000000
--- a/src/v8/src/arm/assembler-arm.h
+++ /dev/null
@@ -1,1793 +0,0 @@
-// Copyright (c) 1994-2006 Sun Microsystems Inc.
-// 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.
-//
-// - Redistribution 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 Sun Microsystems or the names of 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.
-
-// The original source code covered by the above license above has been
-// modified significantly by Google Inc.
-// Copyright 2012 the V8 project authors. All rights reserved.
-
-// A light-weight ARM Assembler
-// Generates user mode instructions for the ARM architecture up to version 5
-
-#ifndef V8_ARM_ASSEMBLER_ARM_H_
-#define V8_ARM_ASSEMBLER_ARM_H_
-
-#include <stdio.h>
-#include <vector>
-
-#include "src/arm/constants-arm.h"
-#include "src/assembler.h"
-#include "src/boxed-float.h"
-#include "src/double.h"
-
-namespace v8 {
-namespace internal {
-
-// clang-format off
-#define GENERAL_REGISTERS(V)                              \
-  V(r0)  V(r1)  V(r2)  V(r3)  V(r4)  V(r5)  V(r6)  V(r7)  \
-  V(r8)  V(r9)  V(r10) V(fp)  V(ip)  V(sp)  V(lr)  V(pc)
-
-#define ALLOCATABLE_GENERAL_REGISTERS(V) \
-  V(r0)  V(r1)  V(r2)  V(r3)  V(r4)  V(r5)  V(r6)  V(r7)  V(r8)
-
-#define FLOAT_REGISTERS(V)                                \
-  V(s0)  V(s1)  V(s2)  V(s3)  V(s4)  V(s5)  V(s6)  V(s7)  \
-  V(s8)  V(s9)  V(s10) V(s11) V(s12) V(s13) V(s14) V(s15) \
-  V(s16) V(s17) V(s18) V(s19) V(s20) V(s21) V(s22) V(s23) \
-  V(s24) V(s25) V(s26) V(s27) V(s28) V(s29) V(s30) V(s31)
-
-#define LOW_DOUBLE_REGISTERS(V)                           \
-  V(d0)  V(d1)  V(d2)  V(d3)  V(d4)  V(d5)  V(d6)  V(d7)  \
-  V(d8)  V(d9)  V(d10) V(d11) V(d12) V(d13) V(d14) V(d15)
-
-#define NON_LOW_DOUBLE_REGISTERS(V)                       \
-  V(d16) V(d17) V(d18) V(d19) V(d20) V(d21) V(d22) V(d23) \
-  V(d24) V(d25) V(d26) V(d27) V(d28) V(d29) V(d30) V(d31)
-
-#define DOUBLE_REGISTERS(V) \
-  LOW_DOUBLE_REGISTERS(V) NON_LOW_DOUBLE_REGISTERS(V)
-
-#define SIMD128_REGISTERS(V)                              \
-  V(q0)  V(q1)  V(q2)  V(q3)  V(q4)  V(q5)  V(q6)  V(q7)  \
-  V(q8)  V(q9)  V(q10) V(q11) V(q12) V(q13) V(q14) V(q15)
-
-#define ALLOCATABLE_DOUBLE_REGISTERS(V)                   \
-  V(d0)  V(d1)  V(d2)  V(d3)  V(d4)  V(d5)  V(d6)  V(d7)  \
-  V(d8)  V(d9)  V(d10) V(d11) V(d12)                      \
-  V(d16) V(d17) V(d18) V(d19) V(d20) V(d21) V(d22) V(d23) \
-  V(d24) V(d25) V(d26) V(d27) V(d28) V(d29) V(d30) V(d31)
-
-#define ALLOCATABLE_NO_VFP32_DOUBLE_REGISTERS(V)          \
-  V(d0)  V(d1)  V(d2)  V(d3)  V(d4)  V(d5)  V(d6)  V(d7)  \
-  V(d8)  V(d9)  V(d10) V(d11) V(d12) V(d15)
-
-#define C_REGISTERS(V)                                            \
-  V(cr0)  V(cr1)  V(cr2)  V(cr3)  V(cr4)  V(cr5)  V(cr6)  V(cr7)  \
-  V(cr8)  V(cr9)  V(cr10) V(cr11) V(cr12) V(cr15)
-// clang-format on
-
-// The ARM ABI does not specify the usage of register r9, which may be reserved
-// as the static base or thread register on some platforms, in which case we
-// leave it alone. Adjust the value of kR9Available accordingly:
-const int kR9Available = 1;  // 1 if available to us, 0 if reserved
-
-// Register list in load/store instructions
-// Note that the bit values must match those used in actual instruction encoding
-const int kNumRegs = 16;
-
-// Caller-saved/arguments registers
-const RegList kJSCallerSaved =
-  1 << 0 |  // r0 a1
-  1 << 1 |  // r1 a2
-  1 << 2 |  // r2 a3
-  1 << 3;   // r3 a4
-
-const int kNumJSCallerSaved = 4;
-
-// Callee-saved registers preserved when switching from C to JavaScript
-const RegList kCalleeSaved =
-  1 <<  4 |  //  r4 v1
-  1 <<  5 |  //  r5 v2
-  1 <<  6 |  //  r6 v3
-  1 <<  7 |  //  r7 v4 (cp in JavaScript code)
-  1 <<  8 |  //  r8 v5 (pp in JavaScript code)
-  kR9Available <<  9 |  //  r9 v6
-  1 << 10 |  // r10 v7
-  1 << 11;   // r11 v8 (fp in JavaScript code)
-
-// When calling into C++ (only for C++ calls that can't cause a GC).
-// The call code will take care of lr, fp, etc.
-const RegList kCallerSaved =
-  1 <<  0 |  // r0
-  1 <<  1 |  // r1
-  1 <<  2 |  // r2
-  1 <<  3 |  // r3
-  1 <<  9;   // r9
-
-const int kNumCalleeSaved = 7 + kR9Available;
-
-// Double registers d8 to d15 are callee-saved.
-const int kNumDoubleCalleeSaved = 8;
-
-// Number of registers for which space is reserved in safepoints. Must be a
-// multiple of 8.
-// TODO(regis): Only 8 registers may actually be sufficient. Revisit.
-const int kNumSafepointRegisters = 16;
-
-// Define the list of registers actually saved at safepoints.
-// Note that the number of saved registers may be smaller than the reserved
-// space, i.e. kNumSafepointSavedRegisters <= kNumSafepointRegisters.
-const RegList kSafepointSavedRegisters = kJSCallerSaved | kCalleeSaved;
-const int kNumSafepointSavedRegisters = kNumJSCallerSaved + kNumCalleeSaved;
-
-enum RegisterCode {
-#define REGISTER_CODE(R) kRegCode_##R,
-  GENERAL_REGISTERS(REGISTER_CODE)
-#undef REGISTER_CODE
-      kRegAfterLast
-};
-
-class Register : public RegisterBase<Register, kRegAfterLast> {
-  friend class RegisterBase;
-  explicit constexpr Register(int code) : RegisterBase(code) {}
-};
-
-static_assert(IS_TRIVIALLY_COPYABLE(Register) &&
-                  sizeof(Register) == sizeof(int),
-              "Register can efficiently be passed by value");
-
-// r7: context register
-// r9: lithium scratch
-#define DECLARE_REGISTER(R) \
-  constexpr Register R = Register::from_code<kRegCode_##R>();
-GENERAL_REGISTERS(DECLARE_REGISTER)
-#undef DECLARE_REGISTER
-constexpr Register no_reg = Register::no_reg();
-
-constexpr bool kPadArguments = false;
-constexpr bool kSimpleFPAliasing = false;
-constexpr bool kSimdMaskRegisters = false;
-
-enum SwVfpRegisterCode {
-#define REGISTER_CODE(R) kSwVfpCode_##R,
-  FLOAT_REGISTERS(REGISTER_CODE)
-#undef REGISTER_CODE
-      kSwVfpAfterLast
-};
-
-// Single word VFP register.
-class SwVfpRegister : public RegisterBase<SwVfpRegister, kSwVfpAfterLast> {
- public:
-  static constexpr int kSizeInBytes = 4;
-
-  static void split_code(int reg_code, int* vm, int* m) {
-    DCHECK(from_code(reg_code).is_valid());
-    *m = reg_code & 0x1;
-    *vm = reg_code >> 1;
-  }
-  void split_code(int* vm, int* m) const { split_code(code(), vm, m); }
-
- private:
-  friend class RegisterBase;
-  explicit constexpr SwVfpRegister(int code) : RegisterBase(code) {}
-};
-
-static_assert(IS_TRIVIALLY_COPYABLE(SwVfpRegister) &&
-                  sizeof(SwVfpRegister) == sizeof(int),
-              "SwVfpRegister can efficiently be passed by value");
-
-typedef SwVfpRegister FloatRegister;
-
-enum DoubleRegisterCode {
-#define REGISTER_CODE(R) kDoubleCode_##R,
-  DOUBLE_REGISTERS(REGISTER_CODE)
-#undef REGISTER_CODE
-      kDoubleAfterLast
-};
-
-// Double word VFP register.
-class DwVfpRegister : public RegisterBase<DwVfpRegister, kDoubleAfterLast> {
- public:
-  // A few double registers are reserved: one as a scratch register and one to
-  // hold 0.0, that does not fit in the immediate field of vmov instructions.
-  //  d14: 0.0
-  //  d15: scratch register.
-  static constexpr int kSizeInBytes = 8;
-
-  inline static int NumRegisters();
-
-  static void split_code(int reg_code, int* vm, int* m) {
-    DCHECK(from_code(reg_code).is_valid());
-    *m = (reg_code & 0x10) >> 4;
-    *vm = reg_code & 0x0F;
-  }
-  void split_code(int* vm, int* m) const { split_code(code(), vm, m); }
-
- private:
-  friend class RegisterBase;
-  friend class LowDwVfpRegister;
-  explicit constexpr DwVfpRegister(int code) : RegisterBase(code) {}
-};
-
-static_assert(IS_TRIVIALLY_COPYABLE(DwVfpRegister) &&
-                  sizeof(DwVfpRegister) == sizeof(int),
-              "DwVfpRegister can efficiently be passed by value");
-
-typedef DwVfpRegister DoubleRegister;
-
-
-// Double word VFP register d0-15.
-class LowDwVfpRegister
-    : public RegisterBase<LowDwVfpRegister, kDoubleCode_d16> {
- public:
-  constexpr operator DwVfpRegister() const { return DwVfpRegister(reg_code_); }
-
-  SwVfpRegister low() const { return SwVfpRegister::from_code(code() * 2); }
-  SwVfpRegister high() const {
-    return SwVfpRegister::from_code(code() * 2 + 1);
-  }
-
- private:
-  friend class RegisterBase;
-  explicit constexpr LowDwVfpRegister(int code) : RegisterBase(code) {}
-};
-
-enum Simd128RegisterCode {
-#define REGISTER_CODE(R) kSimd128Code_##R,
-  SIMD128_REGISTERS(REGISTER_CODE)
-#undef REGISTER_CODE
-      kSimd128AfterLast
-};
-
-// Quad word NEON register.
-class QwNeonRegister : public RegisterBase<QwNeonRegister, kSimd128AfterLast> {
- public:
-  static void split_code(int reg_code, int* vm, int* m) {
-    DCHECK(from_code(reg_code).is_valid());
-    int encoded_code = reg_code << 1;
-    *m = (encoded_code & 0x10) >> 4;
-    *vm = encoded_code & 0x0F;
-  }
-  void split_code(int* vm, int* m) const { split_code(code(), vm, m); }
-  DwVfpRegister low() const { return DwVfpRegister::from_code(code() * 2); }
-  DwVfpRegister high() const {
-    return DwVfpRegister::from_code(code() * 2 + 1);
-  }
-
- private:
-  friend class RegisterBase;
-  explicit constexpr QwNeonRegister(int code) : RegisterBase(code) {}
-};
-
-
-typedef QwNeonRegister QuadRegister;
-
-typedef QwNeonRegister Simd128Register;
-
-enum CRegisterCode {
-#define REGISTER_CODE(R) kCCode_##R,
-  C_REGISTERS(REGISTER_CODE)
-#undef REGISTER_CODE
-      kCAfterLast
-};
-
-// Coprocessor register
-class CRegister : public RegisterBase<CRegister, kCAfterLast> {
-  friend class RegisterBase;
-  explicit constexpr CRegister(int code) : RegisterBase(code) {}
-};
-
-// Support for the VFP registers s0 to s31 (d0 to d15).
-// Note that "s(N):s(N+1)" is the same as "d(N/2)".
-#define DECLARE_FLOAT_REGISTER(R) \
-  constexpr SwVfpRegister R = SwVfpRegister::from_code<kSwVfpCode_##R>();
-FLOAT_REGISTERS(DECLARE_FLOAT_REGISTER)
-#undef DECLARE_FLOAT_REGISTER
-
-#define DECLARE_LOW_DOUBLE_REGISTER(R) \
-  constexpr LowDwVfpRegister R = LowDwVfpRegister::from_code<kDoubleCode_##R>();
-LOW_DOUBLE_REGISTERS(DECLARE_LOW_DOUBLE_REGISTER)
-#undef DECLARE_LOW_DOUBLE_REGISTER
-
-#define DECLARE_DOUBLE_REGISTER(R) \
-  constexpr DwVfpRegister R = DwVfpRegister::from_code<kDoubleCode_##R>();
-NON_LOW_DOUBLE_REGISTERS(DECLARE_DOUBLE_REGISTER)
-#undef DECLARE_DOUBLE_REGISTER
-
-constexpr DwVfpRegister no_dreg = DwVfpRegister::no_reg();
-
-#define DECLARE_SIMD128_REGISTER(R) \
-  constexpr Simd128Register R = Simd128Register::from_code<kSimd128Code_##R>();
-SIMD128_REGISTERS(DECLARE_SIMD128_REGISTER)
-#undef DECLARE_SIMD128_REGISTER
-
-// Aliases for double registers.
-constexpr LowDwVfpRegister kFirstCalleeSavedDoubleReg = d8;
-constexpr LowDwVfpRegister kLastCalleeSavedDoubleReg = d15;
-constexpr LowDwVfpRegister kDoubleRegZero  = d13;
-constexpr LowDwVfpRegister kScratchDoubleReg = d14;
-// This scratch q-register aliases d14 (kScratchDoubleReg) and d15, but is only
-// used if NEON is supported, which implies VFP32DREGS. When there are only 16
-// d-registers, d15 is still allocatable.
-constexpr QwNeonRegister kScratchQuadReg = q7;
-constexpr LowDwVfpRegister kScratchDoubleReg2 = d15;
-
-constexpr CRegister no_creg = CRegister::no_reg();
-
-#define DECLARE_C_REGISTER(R) \
-  constexpr CRegister R = CRegister::from_code<kCCode_##R>();
-C_REGISTERS(DECLARE_C_REGISTER)
-#undef DECLARE_C_REGISTER
-
-// Coprocessor number
-enum Coprocessor {
-  p0  = 0,
-  p1  = 1,
-  p2  = 2,
-  p3  = 3,
-  p4  = 4,
-  p5  = 5,
-  p6  = 6,
-  p7  = 7,
-  p8  = 8,
-  p9  = 9,
-  p10 = 10,
-  p11 = 11,
-  p12 = 12,
-  p13 = 13,
-  p14 = 14,
-  p15 = 15
-};
-
-// -----------------------------------------------------------------------------
-// Machine instruction Operands
-
-// Class Operand represents a shifter operand in data processing instructions
-class Operand BASE_EMBEDDED {
- public:
-  // immediate
-  INLINE(explicit Operand(int32_t immediate,
-         RelocInfo::Mode rmode = RelocInfo::NONE32));
-  INLINE(static Operand Zero());
-  INLINE(explicit Operand(const ExternalReference& f));
-  explicit Operand(Handle<HeapObject> handle);
-  INLINE(explicit Operand(Smi* value));
-
-  // rm
-  INLINE(explicit Operand(Register rm));
-
-  // rm <shift_op> shift_imm
-  explicit Operand(Register rm, ShiftOp shift_op, int shift_imm);
-  INLINE(static Operand SmiUntag(Register rm)) {
-    return Operand(rm, ASR, kSmiTagSize);
-  }
-  INLINE(static Operand PointerOffsetFromSmiKey(Register key)) {
-    STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2);
-    return Operand(key, LSL, kPointerSizeLog2 - kSmiTagSize);
-  }
-  INLINE(static Operand DoubleOffsetFromSmiKey(Register key)) {
-    STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize < kDoubleSizeLog2);
-    return Operand(key, LSL, kDoubleSizeLog2 - kSmiTagSize);
-  }
-
-  // rm <shift_op> rs
-  explicit Operand(Register rm, ShiftOp shift_op, Register rs);
-
-  static Operand EmbeddedNumber(double number);  // Smi or HeapNumber.
-  static Operand EmbeddedCode(CodeStub* stub);
-
-  // Return true if this is a register operand.
-  bool IsRegister() const {
-    return rm_.is_valid() && rs_ == no_reg && shift_op_ == LSL &&
-           shift_imm_ == 0;
-  }
-  // Return true if this is a register operand shifted with an immediate.
-  bool IsImmediateShiftedRegister() const {
-    return rm_.is_valid() && !rs_.is_valid();
-  }
-  // Return true if this is a register operand shifted with a register.
-  bool IsRegisterShiftedRegister() const {
-    return rm_.is_valid() && rs_.is_valid();
-  }
-
-  // Return the number of actual instructions required to implement the given
-  // instruction for this particular operand. This can be a single instruction,
-  // if no load into a scratch register is necessary, or anything between 2 and
-  // 4 instructions when we need to load from the constant pool (depending upon
-  // whether the constant pool entry is in the small or extended section). If
-  // the instruction this operand is used for is a MOV or MVN instruction the
-  // actual instruction to use is required for this calculation. For other
-  // instructions instr is ignored.
-  //
-  // The value returned is only valid as long as no entries are added to the
-  // constant pool between this call and the actual instruction being emitted.
-  int InstructionsRequired(const Assembler* assembler, Instr instr = 0) const;
-  bool MustOutputRelocInfo(const Assembler* assembler) const;
-
-  inline int32_t immediate() const {
-    DCHECK(IsImmediate());
-    DCHECK(!IsHeapObjectRequest());
-    return value_.immediate;
-  }
-  bool IsImmediate() const {
-    return !rm_.is_valid();
-  }
-
-  HeapObjectRequest heap_object_request() const {
-    DCHECK(IsHeapObjectRequest());
-    return value_.heap_object_request;
-  }
-  bool IsHeapObjectRequest() const {
-    DCHECK_IMPLIES(is_heap_object_request_, IsImmediate());
-    DCHECK_IMPLIES(is_heap_object_request_,
-        rmode_ == RelocInfo::EMBEDDED_OBJECT ||
-        rmode_ == RelocInfo::CODE_TARGET);
-    return is_heap_object_request_;
-  }
-
-  Register rm() const { return rm_; }
-  Register rs() const { return rs_; }
-  ShiftOp shift_op() const { return shift_op_; }
-
-
- private:
-  Register rm_ = no_reg;
-  Register rs_ = no_reg;
-  ShiftOp shift_op_;
-  int shift_imm_;                // valid if rm_ != no_reg && rs_ == no_reg
-  union Value {
-    Value() {}
-    HeapObjectRequest heap_object_request;  // if is_heap_object_request_
-    int32_t immediate;                      // otherwise
-  } value_;                                 // valid if rm_ == no_reg
-  bool is_heap_object_request_ = false;
-  RelocInfo::Mode rmode_;
-
-  friend class Assembler;
-};
-
-
-// Class MemOperand represents a memory operand in load and store instructions
-class MemOperand BASE_EMBEDDED {
- public:
-  // [rn +/- offset]      Offset/NegOffset
-  // [rn +/- offset]!     PreIndex/NegPreIndex
-  // [rn], +/- offset     PostIndex/NegPostIndex
-  // offset is any signed 32-bit value; offset is first loaded to a scratch
-  // register if it does not fit the addressing mode (12-bit unsigned and sign
-  // bit)
-  explicit MemOperand(Register rn, int32_t offset = 0, AddrMode am = Offset);
-
-  // [rn +/- rm]          Offset/NegOffset
-  // [rn +/- rm]!         PreIndex/NegPreIndex
-  // [rn], +/- rm         PostIndex/NegPostIndex
-  explicit MemOperand(Register rn, Register rm, AddrMode am = Offset);
-
-  // [rn +/- rm <shift_op> shift_imm]      Offset/NegOffset
-  // [rn +/- rm <shift_op> shift_imm]!     PreIndex/NegPreIndex
-  // [rn], +/- rm <shift_op> shift_imm     PostIndex/NegPostIndex
-  explicit MemOperand(Register rn, Register rm,
-                      ShiftOp shift_op, int shift_imm, AddrMode am = Offset);
-  INLINE(static MemOperand PointerAddressFromSmiKey(Register array,
-                                                    Register key,
-                                                    AddrMode am = Offset)) {
-    STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2);
-    return MemOperand(array, key, LSL, kPointerSizeLog2 - kSmiTagSize, am);
-  }
-
-  void set_offset(int32_t offset) {
-    DCHECK(rm_ == no_reg);
-    offset_ = offset;
-  }
-
-  uint32_t offset() const {
-    DCHECK(rm_ == no_reg);
-    return offset_;
-  }
-
-  Register rn() const { return rn_; }
-  Register rm() const { return rm_; }
-  AddrMode am() const { return am_; }
-
-  bool OffsetIsUint12Encodable() const {
-    return offset_ >= 0 ? is_uint12(offset_) : is_uint12(-offset_);
-  }
-
- private:
-  Register rn_;  // base
-  Register rm_;  // register offset
-  int32_t offset_;  // valid if rm_ == no_reg
-  ShiftOp shift_op_;
-  int shift_imm_;  // valid if rm_ != no_reg && rs_ == no_reg
-  AddrMode am_;  // bits P, U, and W
-
-  friend class Assembler;
-};
-
-
-// Class NeonMemOperand represents a memory operand in load and
-// store NEON instructions
-class NeonMemOperand BASE_EMBEDDED {
- public:
-  // [rn {:align}]       Offset
-  // [rn {:align}]!      PostIndex
-  explicit NeonMemOperand(Register rn, AddrMode am = Offset, int align = 0);
-
-  // [rn {:align}], rm   PostIndex
-  explicit NeonMemOperand(Register rn, Register rm, int align = 0);
-
-  Register rn() const { return rn_; }
-  Register rm() const { return rm_; }
-  int align() const { return align_; }
-
- private:
-  void SetAlignment(int align);
-
-  Register rn_;  // base
-  Register rm_;  // register increment
-  int align_;
-};
-
-
-// Class NeonListOperand represents a list of NEON registers
-class NeonListOperand BASE_EMBEDDED {
- public:
-  explicit NeonListOperand(DoubleRegister base, int register_count = 1)
-    : base_(base), register_count_(register_count) {}
-  explicit NeonListOperand(QwNeonRegister q_reg)
-    : base_(q_reg.low()), register_count_(2) {}
-  DoubleRegister base() const { return base_; }
-  int register_count() { return register_count_; }
-  int length() const { return register_count_ - 1; }
-  NeonListType type() const {
-    switch (register_count_) {
-      default: UNREACHABLE();
-      // Fall through.
-      case 1: return nlt_1;
-      case 2: return nlt_2;
-      case 3: return nlt_3;
-      case 4: return nlt_4;
-    }
-  }
- private:
-  DoubleRegister base_;
-  int register_count_;
-};
-
-
-struct VmovIndex {
-  unsigned char index;
-};
-constexpr VmovIndex VmovIndexLo = { 0 };
-constexpr VmovIndex VmovIndexHi = { 1 };
-
-class Assembler : public AssemblerBase {
- public:
-  // Create an assembler. Instructions and relocation information are emitted
-  // into a buffer, with the instructions starting from the beginning and the
-  // relocation information starting from the end of the buffer. See CodeDesc
-  // for a detailed comment on the layout (globals.h).
-  //
-  // If the provided buffer is nullptr, the assembler allocates and grows its
-  // own buffer, and buffer_size determines the initial buffer size. The buffer
-  // is owned by the assembler and deallocated upon destruction of the
-  // assembler.
-  //
-  // If the provided buffer is not nullptr, the assembler uses the provided
-  // buffer for code generation and assumes its size to be buffer_size. If the
-  // buffer is too small, a fatal error occurs. No deallocation of the buffer is
-  // done upon destruction of the assembler.
-  Assembler(Isolate* isolate, void* buffer, int buffer_size)
-      : Assembler(IsolateData(isolate), buffer, buffer_size) {}
-  Assembler(IsolateData isolate_data, void* buffer, int buffer_size);
-  virtual ~Assembler();
-
-  // GetCode emits any pending (non-emitted) code and fills the descriptor
-  // desc. GetCode() is idempotent; it returns the same result if no other
-  // Assembler functions are invoked in between GetCode() calls.
-  void GetCode(Isolate* isolate, CodeDesc* desc);
-
-  // Label operations & relative jumps (PPUM Appendix D)
-  //
-  // Takes a branch opcode (cc) and a label (L) and generates
-  // either a backward branch or a forward branch and links it
-  // to the label fixup chain. Usage:
-  //
-  // Label L;    // unbound label
-  // j(cc, &L);  // forward branch to unbound label
-  // bind(&L);   // bind label to the current pc
-  // j(cc, &L);  // backward branch to bound label
-  // bind(&L);   // illegal: a label may be bound only once
-  //
-  // Note: The same Label can be used for forward and backward branches
-  // but it may be bound only once.
-
-  void bind(Label* L);  // binds an unbound label L to the current code position
-
-  // Returns the branch offset to the given label from the current code position
-  // Links the label to the current position if it is still unbound
-  // Manages the jump elimination optimization if the second parameter is true.
-  int branch_offset(Label* L);
-
-  // Returns true if the given pc address is the start of a constant pool load
-  // instruction sequence.
-  INLINE(static bool is_constant_pool_load(Address pc));
-
-  // Return the address in the constant pool of the code target address used by
-  // the branch/call instruction at pc, or the object in a mov.
-  INLINE(static Address constant_pool_entry_address(Address pc,
-                                                    Address constant_pool));
-
-  // Read/Modify the code target address in the branch/call instruction at pc.
-  // The isolate argument is unused (and may be nullptr) when skipping flushing.
-  INLINE(static Address target_address_at(Address pc, Address constant_pool));
-  INLINE(static void set_target_address_at(
-      Isolate* isolate, Address pc, Address constant_pool, Address target,
-      ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED));
-
-  // Return the code target address at a call site from the return address
-  // of that call in the instruction stream.
-  INLINE(static Address target_address_from_return_address(Address pc));
-
-  // Given the address of the beginning of a call, return the address
-  // in the instruction stream that the call will return from.
-  INLINE(static Address return_address_from_call_start(Address pc));
-
-  // This sets the branch destination (which is in the constant pool on ARM).
-  // This is for calls and branches within generated code.
-  inline static void deserialization_set_special_target_at(
-      Isolate* isolate, Address constant_pool_entry, Code* code,
-      Address target);
-
-  // This sets the internal reference at the pc.
-  inline static void deserialization_set_target_internal_reference_at(
-      Isolate* isolate, Address pc, Address target,
-      RelocInfo::Mode mode = RelocInfo::INTERNAL_REFERENCE);
-
-  // Here we are patching the address in the constant pool, not the actual call
-  // instruction.  The address in the constant pool is the same size as a
-  // pointer.
-  static constexpr int kSpecialTargetSize = kPointerSize;
-
-  // Size of an instruction.
-  static constexpr int kInstrSize = sizeof(Instr);
-
-  // Difference between address of current opcode and value read from pc
-  // register.
-  static constexpr int kPcLoadDelta = 8;
-  RegList* GetScratchRegisterList() { return &scratch_register_list_; }
-
-  // ---------------------------------------------------------------------------
-  // Code generation
-
-  // Insert the smallest number of nop instructions
-  // possible to align the pc offset to a multiple
-  // of m. m must be a power of 2 (>= 4).
-  void Align(int m);
-  // Insert the smallest number of zero bytes possible to align the pc offset
-  // to a mulitple of m. m must be a power of 2 (>= 2).
-  void DataAlign(int m);
-  // Aligns code to something that's optimal for a jump target for the platform.
-  void CodeTargetAlign();
-
-  // Branch instructions
-  void b(int branch_offset, Condition cond = al);
-  void bl(int branch_offset, Condition cond = al);
-  void blx(int branch_offset);  // v5 and above
-  void blx(Register target, Condition cond = al);  // v5 and above
-  void bx(Register target, Condition cond = al);  // v5 and above, plus v4t
-
-  // Convenience branch instructions using labels
-  void b(Label* L, Condition cond = al);
-  void b(Condition cond, Label* L) { b(L, cond); }
-  void bl(Label* L, Condition cond = al);
-  void bl(Condition cond, Label* L) { bl(L, cond); }
-  void blx(Label* L);  // v5 and above
-
-  // Data-processing instructions
-
-  void and_(Register dst, Register src1, const Operand& src2,
-            SBit s = LeaveCC, Condition cond = al);
-
-  void eor(Register dst, Register src1, const Operand& src2,
-           SBit s = LeaveCC, Condition cond = al);
-
-  void sub(Register dst, Register src1, const Operand& src2,
-           SBit s = LeaveCC, Condition cond = al);
-  void sub(Register dst, Register src1, Register src2,
-           SBit s = LeaveCC, Condition cond = al);
-
-  void rsb(Register dst, Register src1, const Operand& src2,
-           SBit s = LeaveCC, Condition cond = al);
-
-  void add(Register dst, Register src1, const Operand& src2,
-           SBit s = LeaveCC, Condition cond = al);
-  void add(Register dst, Register src1, Register src2,
-           SBit s = LeaveCC, Condition cond = al);
-
-  void adc(Register dst, Register src1, const Operand& src2,
-           SBit s = LeaveCC, Condition cond = al);
-
-  void sbc(Register dst, Register src1, const Operand& src2,
-           SBit s = LeaveCC, Condition cond = al);
-
-  void rsc(Register dst, Register src1, const Operand& src2,
-           SBit s = LeaveCC, Condition cond = al);
-
-  void tst(Register src1, const Operand& src2, Condition cond = al);
-  void tst(Register src1, Register src2, Condition cond = al);
-
-  void teq(Register src1, const Operand& src2, Condition cond = al);
-
-  void cmp(Register src1, const Operand& src2, Condition cond = al);
-  void cmp(Register src1, Register src2, Condition cond = al);
-
-  void cmp_raw_immediate(Register src1, int raw_immediate, Condition cond = al);
-
-  void cmn(Register src1, const Operand& src2, Condition cond = al);
-
-  void orr(Register dst, Register src1, const Operand& src2,
-           SBit s = LeaveCC, Condition cond = al);
-  void orr(Register dst, Register src1, Register src2,
-           SBit s = LeaveCC, Condition cond = al);
-
-  void mov(Register dst, const Operand& src,
-           SBit s = LeaveCC, Condition cond = al);
-  void mov(Register dst, Register src, SBit s = LeaveCC, Condition cond = al);
-
-  // Load the position of the label relative to the generated code object
-  // pointer in a register.
-  void mov_label_offset(Register dst, Label* label);
-
-  // ARMv7 instructions for loading a 32 bit immediate in two instructions.
-  // The constant for movw and movt should be in the range 0-0xffff.
-  void movw(Register reg, uint32_t immediate, Condition cond = al);
-  void movt(Register reg, uint32_t immediate, Condition cond = al);
-
-  void bic(Register dst, Register src1, const Operand& src2,
-           SBit s = LeaveCC, Condition cond = al);
-
-  void mvn(Register dst, const Operand& src,
-           SBit s = LeaveCC, Condition cond = al);
-
-  // Shift instructions
-
-  void asr(Register dst, Register src1, const Operand& src2, SBit s = LeaveCC,
-           Condition cond = al);
-
-  void lsl(Register dst, Register src1, const Operand& src2, SBit s = LeaveCC,
-           Condition cond = al);
-
-  void lsr(Register dst, Register src1, const Operand& src2, SBit s = LeaveCC,
-           Condition cond = al);
-
-  // Multiply instructions
-
-  void mla(Register dst, Register src1, Register src2, Register srcA,
-           SBit s = LeaveCC, Condition cond = al);
-
-  void mls(Register dst, Register src1, Register src2, Register srcA,
-           Condition cond = al);
-
-  void sdiv(Register dst, Register src1, Register src2,
-            Condition cond = al);
-
-  void udiv(Register dst, Register src1, Register src2, Condition cond = al);
-
-  void mul(Register dst, Register src1, Register src2,
-           SBit s = LeaveCC, Condition cond = al);
-
-  void smmla(Register dst, Register src1, Register src2, Register srcA,
-             Condition cond = al);
-
-  void smmul(Register dst, Register src1, Register src2, Condition cond = al);
-
-  void smlal(Register dstL, Register dstH, Register src1, Register src2,
-             SBit s = LeaveCC, Condition cond = al);
-
-  void smull(Register dstL, Register dstH, Register src1, Register src2,
-             SBit s = LeaveCC, Condition cond = al);
-
-  void umlal(Register dstL, Register dstH, Register src1, Register src2,
-             SBit s = LeaveCC, Condition cond = al);
-
-  void umull(Register dstL, Register dstH, Register src1, Register src2,
-             SBit s = LeaveCC, Condition cond = al);
-
-  // Miscellaneous arithmetic instructions
-
-  void clz(Register dst, Register src, Condition cond = al);  // v5 and above
-
-  // Saturating instructions. v6 and above.
-
-  // Unsigned saturate.
-  //
-  // Saturate an optionally shifted signed value to an unsigned range.
-  //
-  //   usat dst, #satpos, src
-  //   usat dst, #satpos, src, lsl #sh
-  //   usat dst, #satpos, src, asr #sh
-  //
-  // Register dst will contain:
-  //
-  //   0,                 if s < 0
-  //   (1 << satpos) - 1, if s > ((1 << satpos) - 1)
-  //   s,                 otherwise
-  //
-  // where s is the contents of src after shifting (if used.)
-  void usat(Register dst, int satpos, const Operand& src, Condition cond = al);
-
-  // Bitfield manipulation instructions. v7 and above.
-
-  void ubfx(Register dst, Register src, int lsb, int width,
-            Condition cond = al);
-
-  void sbfx(Register dst, Register src, int lsb, int width,
-            Condition cond = al);
-
-  void bfc(Register dst, int lsb, int width, Condition cond = al);
-
-  void bfi(Register dst, Register src, int lsb, int width,
-           Condition cond = al);
-
-  void pkhbt(Register dst, Register src1, const Operand& src2,
-             Condition cond = al);
-
-  void pkhtb(Register dst, Register src1, const Operand& src2,
-             Condition cond = al);
-
-  void sxtb(Register dst, Register src, int rotate = 0, Condition cond = al);
-  void sxtab(Register dst, Register src1, Register src2, int rotate = 0,
-             Condition cond = al);
-  void sxth(Register dst, Register src, int rotate = 0, Condition cond = al);
-  void sxtah(Register dst, Register src1, Register src2, int rotate = 0,
-             Condition cond = al);
-
-  void uxtb(Register dst, Register src, int rotate = 0, Condition cond = al);
-  void uxtab(Register dst, Register src1, Register src2, int rotate = 0,
-             Condition cond = al);
-  void uxtb16(Register dst, Register src, int rotate = 0, Condition cond = al);
-  void uxth(Register dst, Register src, int rotate = 0, Condition cond = al);
-  void uxtah(Register dst, Register src1, Register src2, int rotate = 0,
-             Condition cond = al);
-
-  // Reverse the bits in a register.
-  void rbit(Register dst, Register src, Condition cond = al);
-
-  // Status register access instructions
-
-  void mrs(Register dst, SRegister s, Condition cond = al);
-  void msr(SRegisterFieldMask fields, const Operand& src, Condition cond = al);
-
-  // Load/Store instructions
-  void ldr(Register dst, const MemOperand& src, Condition cond = al);
-  void str(Register src, const MemOperand& dst, Condition cond = al);
-  void ldrb(Register dst, const MemOperand& src, Condition cond = al);
-  void strb(Register src, const MemOperand& dst, Condition cond = al);
-  void ldrh(Register dst, const MemOperand& src, Condition cond = al);
-  void strh(Register src, const MemOperand& dst, Condition cond = al);
-  void ldrsb(Register dst, const MemOperand& src, Condition cond = al);
-  void ldrsh(Register dst, const MemOperand& src, Condition cond = al);
-  void ldrd(Register dst1,
-            Register dst2,
-            const MemOperand& src, Condition cond = al);
-  void strd(Register src1,
-            Register src2,
-            const MemOperand& dst, Condition cond = al);
-
-  // Load literal from a pc relative address.
-  void ldr_pcrel(Register dst, int imm12, Condition cond = al);
-
-  // Load/Store exclusive instructions
-  void ldrex(Register dst, Register src, Condition cond = al);
-  void strex(Register src1, Register src2, Register dst, Condition cond = al);
-  void ldrexb(Register dst, Register src, Condition cond = al);
-  void strexb(Register src1, Register src2, Register dst, Condition cond = al);
-  void ldrexh(Register dst, Register src, Condition cond = al);
-  void strexh(Register src1, Register src2, Register dst, Condition cond = al);
-
-  // Preload instructions
-  void pld(const MemOperand& address);
-
-  // Load/Store multiple instructions
-  void ldm(BlockAddrMode am, Register base, RegList dst, Condition cond = al);
-  void stm(BlockAddrMode am, Register base, RegList src, Condition cond = al);
-
-  // Exception-generating instructions and debugging support
-  void stop(const char* msg,
-            Condition cond = al,
-            int32_t code = kDefaultStopCode);
-
-  void bkpt(uint32_t imm16);  // v5 and above
-  void svc(uint32_t imm24, Condition cond = al);
-
-  // Synchronization instructions.
-  // On ARMv6, an equivalent CP15 operation will be used.
-  void dmb(BarrierOption option);
-  void dsb(BarrierOption option);
-  void isb(BarrierOption option);
-
-  // Coprocessor instructions
-
-  void cdp(Coprocessor coproc, int opcode_1,
-           CRegister crd, CRegister crn, CRegister crm,
-           int opcode_2, Condition cond = al);
-
-  void cdp2(Coprocessor coproc, int opcode_1,
-            CRegister crd, CRegister crn, CRegister crm,
-            int opcode_2);  // v5 and above
-
-  void mcr(Coprocessor coproc, int opcode_1,
-           Register rd, CRegister crn, CRegister crm,
-           int opcode_2 = 0, Condition cond = al);
-
-  void mcr2(Coprocessor coproc, int opcode_1,
-            Register rd, CRegister crn, CRegister crm,
-            int opcode_2 = 0);  // v5 and above
-
-  void mrc(Coprocessor coproc, int opcode_1,
-           Register rd, CRegister crn, CRegister crm,
-           int opcode_2 = 0, Condition cond = al);
-
-  void mrc2(Coprocessor coproc, int opcode_1,
-            Register rd, CRegister crn, CRegister crm,
-            int opcode_2 = 0);  // v5 and above
-
-  void ldc(Coprocessor coproc, CRegister crd, const MemOperand& src,
-           LFlag l = Short, Condition cond = al);
-  void ldc(Coprocessor coproc, CRegister crd, Register base, int option,
-           LFlag l = Short, Condition cond = al);
-
-  void ldc2(Coprocessor coproc, CRegister crd, const MemOperand& src,
-            LFlag l = Short);  // v5 and above
-  void ldc2(Coprocessor coproc, CRegister crd, Register base, int option,
-            LFlag l = Short);  // v5 and above
-
-  // Support for VFP.
-  // All these APIs support S0 to S31 and D0 to D31.
-
-  void vldr(const DwVfpRegister dst,
-            const Register base,
-            int offset,
-            const Condition cond = al);
-  void vldr(const DwVfpRegister dst,
-            const MemOperand& src,
-            const Condition cond = al);
-
-  void vldr(const SwVfpRegister dst,
-            const Register base,
-            int offset,
-            const Condition cond = al);
-  void vldr(const SwVfpRegister dst,
-            const MemOperand& src,
-            const Condition cond = al);
-
-  void vstr(const DwVfpRegister src,
-            const Register base,
-            int offset,
-            const Condition cond = al);
-  void vstr(const DwVfpRegister src,
-            const MemOperand& dst,
-            const Condition cond = al);
-
-  void vstr(const SwVfpRegister src,
-            const Register base,
-            int offset,
-            const Condition cond = al);
-  void vstr(const SwVfpRegister src,
-            const MemOperand& dst,
-            const Condition cond = al);
-
-  void vldm(BlockAddrMode am,
-            Register base,
-            DwVfpRegister first,
-            DwVfpRegister last,
-            Condition cond = al);
-
-  void vstm(BlockAddrMode am,
-            Register base,
-            DwVfpRegister first,
-            DwVfpRegister last,
-            Condition cond = al);
-
-  void vldm(BlockAddrMode am,
-            Register base,
-            SwVfpRegister first,
-            SwVfpRegister last,
-            Condition cond = al);
-
-  void vstm(BlockAddrMode am,
-            Register base,
-            SwVfpRegister first,
-            SwVfpRegister last,
-            Condition cond = al);
-
-  void vmov(const SwVfpRegister dst, Float32 imm);
-  void vmov(const DwVfpRegister dst,
-            Double imm,
-            const Register extra_scratch = no_reg);
-  void vmov(const SwVfpRegister dst,
-            const SwVfpRegister src,
-            const Condition cond = al);
-  void vmov(const DwVfpRegister dst,
-            const DwVfpRegister src,
-            const Condition cond = al);
-  // TODO(bbudge) Replace uses of these with the more general core register to
-  // scalar register vmov's.
-  void vmov(const DwVfpRegister dst,
-            const VmovIndex index,
-            const Register src,
-            const Condition cond = al);
-  void vmov(const Register dst,
-            const VmovIndex index,
-            const DwVfpRegister src,
-            const Condition cond = al);
-  void vmov(const DwVfpRegister dst,
-            const Register src1,
-            const Register src2,
-            const Condition cond = al);
-  void vmov(const Register dst1,
-            const Register dst2,
-            const DwVfpRegister src,
-            const Condition cond = al);
-  void vmov(const SwVfpRegister dst,
-            const Register src,
-            const Condition cond = al);
-  void vmov(const Register dst,
-            const SwVfpRegister src,
-            const Condition cond = al);
-  void vcvt_f64_s32(const DwVfpRegister dst,
-                    const SwVfpRegister src,
-                    VFPConversionMode mode = kDefaultRoundToZero,
-                    const Condition cond = al);
-  void vcvt_f32_s32(const SwVfpRegister dst,
-                    const SwVfpRegister src,
-                    VFPConversionMode mode = kDefaultRoundToZero,
-                    const Condition cond = al);
-  void vcvt_f64_u32(const DwVfpRegister dst,
-                    const SwVfpRegister src,
-                    VFPConversionMode mode = kDefaultRoundToZero,
-                    const Condition cond = al);
-  void vcvt_f32_u32(const SwVfpRegister dst,
-                    const SwVfpRegister src,
-                    VFPConversionMode mode = kDefaultRoundToZero,
-                    const Condition cond = al);
-  void vcvt_s32_f32(const SwVfpRegister dst,
-                    const SwVfpRegister src,
-                    VFPConversionMode mode = kDefaultRoundToZero,
-                    const Condition cond = al);
-  void vcvt_u32_f32(const SwVfpRegister dst,
-                    const SwVfpRegister src,
-                    VFPConversionMode mode = kDefaultRoundToZero,
-                    const Condition cond = al);
-  void vcvt_s32_f64(const SwVfpRegister dst,
-                    const DwVfpRegister src,
-                    VFPConversionMode mode = kDefaultRoundToZero,
-                    const Condition cond = al);
-  void vcvt_u32_f64(const SwVfpRegister dst,
-                    const DwVfpRegister src,
-                    VFPConversionMode mode = kDefaultRoundToZero,
-                    const Condition cond = al);
-  void vcvt_f64_f32(const DwVfpRegister dst,
-                    const SwVfpRegister src,
-                    VFPConversionMode mode = kDefaultRoundToZero,
-                    const Condition cond = al);
-  void vcvt_f32_f64(const SwVfpRegister dst,
-                    const DwVfpRegister src,
-                    VFPConversionMode mode = kDefaultRoundToZero,
-                    const Condition cond = al);
-  void vcvt_f64_s32(const DwVfpRegister dst,
-                    int fraction_bits,
-                    const Condition cond = al);
-
-  void vmrs(const Register dst, const Condition cond = al);
-  void vmsr(const Register dst, const Condition cond = al);
-
-  void vneg(const DwVfpRegister dst,
-            const DwVfpRegister src,
-            const Condition cond = al);
-  void vneg(const SwVfpRegister dst, const SwVfpRegister src,
-            const Condition cond = al);
-  void vabs(const DwVfpRegister dst,
-            const DwVfpRegister src,
-            const Condition cond = al);
-  void vabs(const SwVfpRegister dst, const SwVfpRegister src,
-            const Condition cond = al);
-  void vadd(const DwVfpRegister dst,
-            const DwVfpRegister src1,
-            const DwVfpRegister src2,
-            const Condition cond = al);
-  void vadd(const SwVfpRegister dst, const SwVfpRegister src1,
-            const SwVfpRegister src2, const Condition cond = al);
-  void vsub(const DwVfpRegister dst,
-            const DwVfpRegister src1,
-            const DwVfpRegister src2,
-            const Condition cond = al);
-  void vsub(const SwVfpRegister dst, const SwVfpRegister src1,
-            const SwVfpRegister src2, const Condition cond = al);
-  void vmul(const DwVfpRegister dst,
-            const DwVfpRegister src1,
-            const DwVfpRegister src2,
-            const Condition cond = al);
-  void vmul(const SwVfpRegister dst, const SwVfpRegister src1,
-            const SwVfpRegister src2, const Condition cond = al);
-  void vmla(const DwVfpRegister dst,
-            const DwVfpRegister src1,
-            const DwVfpRegister src2,
-            const Condition cond = al);
-  void vmla(const SwVfpRegister dst, const SwVfpRegister src1,
-            const SwVfpRegister src2, const Condition cond = al);
-  void vmls(const DwVfpRegister dst,
-            const DwVfpRegister src1,
-            const DwVfpRegister src2,
-            const Condition cond = al);
-  void vmls(const SwVfpRegister dst, const SwVfpRegister src1,
-            const SwVfpRegister src2, const Condition cond = al);
-  void vdiv(const DwVfpRegister dst,
-            const DwVfpRegister src1,
-            const DwVfpRegister src2,
-            const Condition cond = al);
-  void vdiv(const SwVfpRegister dst, const SwVfpRegister src1,
-            const SwVfpRegister src2, const Condition cond = al);
-  void vcmp(const DwVfpRegister src1,
-            const DwVfpRegister src2,
-            const Condition cond = al);
-  void vcmp(const SwVfpRegister src1, const SwVfpRegister src2,
-            const Condition cond = al);
-  void vcmp(const DwVfpRegister src1,
-            const double src2,
-            const Condition cond = al);
-  void vcmp(const SwVfpRegister src1, const float src2,
-            const Condition cond = al);
-
-  void vmaxnm(const DwVfpRegister dst,
-              const DwVfpRegister src1,
-              const DwVfpRegister src2);
-  void vmaxnm(const SwVfpRegister dst,
-              const SwVfpRegister src1,
-              const SwVfpRegister src2);
-  void vminnm(const DwVfpRegister dst,
-              const DwVfpRegister src1,
-              const DwVfpRegister src2);
-  void vminnm(const SwVfpRegister dst,
-              const SwVfpRegister src1,
-              const SwVfpRegister src2);
-
-  // VSEL supports cond in {eq, ne, ge, lt, gt, le, vs, vc}.
-  void vsel(const Condition cond,
-            const DwVfpRegister dst,
-            const DwVfpRegister src1,
-            const DwVfpRegister src2);
-  void vsel(const Condition cond,
-            const SwVfpRegister dst,
-            const SwVfpRegister src1,
-            const SwVfpRegister src2);
-
-  void vsqrt(const DwVfpRegister dst,
-             const DwVfpRegister src,
-             const Condition cond = al);
-  void vsqrt(const SwVfpRegister dst, const SwVfpRegister src,
-             const Condition cond = al);
-
-  // ARMv8 rounding instructions.
-  void vrinta(const SwVfpRegister dst, const SwVfpRegister src);
-  void vrinta(const DwVfpRegister dst, const DwVfpRegister src);
-  void vrintn(const SwVfpRegister dst, const SwVfpRegister src);
-  void vrintn(const DwVfpRegister dst, const DwVfpRegister src);
-  void vrintm(const SwVfpRegister dst, const SwVfpRegister src);
-  void vrintm(const DwVfpRegister dst, const DwVfpRegister src);
-  void vrintp(const SwVfpRegister dst, const SwVfpRegister src);
-  void vrintp(const DwVfpRegister dst, const DwVfpRegister src);
-  void vrintz(const SwVfpRegister dst, const SwVfpRegister src,
-              const Condition cond = al);
-  void vrintz(const DwVfpRegister dst, const DwVfpRegister src,
-              const Condition cond = al);
-
-  // Support for NEON.
-
-  // All these APIs support D0 to D31 and Q0 to Q15.
-  void vld1(NeonSize size,
-            const NeonListOperand& dst,
-            const NeonMemOperand& src);
-  void vst1(NeonSize size,
-            const NeonListOperand& src,
-            const NeonMemOperand& dst);
-  // dt represents the narrower type
-  void vmovl(NeonDataType dt, QwNeonRegister dst, DwVfpRegister src);
-  // dt represents the narrower type.
-  void vqmovn(NeonDataType dt, DwVfpRegister dst, QwNeonRegister src);
-
-  // Only unconditional core <-> scalar moves are currently supported.
-  void vmov(NeonDataType dt, DwVfpRegister dst, int index, Register src);
-  void vmov(NeonDataType dt, Register dst, DwVfpRegister src, int index);
-
-  void vmov(QwNeonRegister dst, QwNeonRegister src);
-  void vdup(NeonSize size, QwNeonRegister dst, Register src);
-  void vdup(NeonSize size, QwNeonRegister dst, DwVfpRegister src, int index);
-  void vdup(NeonSize size, DwVfpRegister dst, DwVfpRegister src, int index);
-
-  void vcvt_f32_s32(QwNeonRegister dst, QwNeonRegister src);
-  void vcvt_f32_u32(QwNeonRegister dst, QwNeonRegister src);
-  void vcvt_s32_f32(QwNeonRegister dst, QwNeonRegister src);
-  void vcvt_u32_f32(QwNeonRegister dst, QwNeonRegister src);
-
-  void vmvn(QwNeonRegister dst, QwNeonRegister src);
-  void vswp(DwVfpRegister dst, DwVfpRegister src);
-  void vswp(QwNeonRegister dst, QwNeonRegister src);
-  void vabs(QwNeonRegister dst, QwNeonRegister src);
-  void vabs(NeonSize size, QwNeonRegister dst, QwNeonRegister src);
-  void vneg(QwNeonRegister dst, QwNeonRegister src);
-  void vneg(NeonSize size, QwNeonRegister dst, QwNeonRegister src);
-
-  void vand(QwNeonRegister dst, QwNeonRegister src1, QwNeonRegister src2);
-  void veor(DwVfpRegister dst, DwVfpRegister src1, DwVfpRegister src2);
-  void veor(QwNeonRegister dst, QwNeonRegister src1, QwNeonRegister src2);
-  void vbsl(QwNeonRegister dst, QwNeonRegister src1, QwNeonRegister src2);
-  void vorr(QwNeonRegister dst, QwNeonRegister src1, QwNeonRegister src2);
-  void vadd(QwNeonRegister dst, QwNeonRegister src1, QwNeonRegister src2);
-  void vadd(NeonSize size, QwNeonRegister dst, QwNeonRegister src1,
-            QwNeonRegister src2);
-  void vqadd(NeonDataType dt, QwNeonRegister dst, QwNeonRegister src1,
-             QwNeonRegister src2);
-  void vsub(QwNeonRegister dst, QwNeonRegister src1, QwNeonRegister src2);
-  void vsub(NeonSize size, QwNeonRegister dst, QwNeonRegister src1,
-            QwNeonRegister src2);
-  void vqsub(NeonDataType dt, QwNeonRegister dst, QwNeonRegister src1,
-             QwNeonRegister src2);
-  void vmul(QwNeonRegister dst, QwNeonRegister src1,
-            QwNeonRegister src2);
-  void vmul(NeonSize size, QwNeonRegister dst, QwNeonRegister src1,
-            QwNeonRegister src2);
-  void vmin(QwNeonRegister dst, QwNeonRegister src1, QwNeonRegister src2);
-  void vmin(NeonDataType dt, QwNeonRegister dst,
-            QwNeonRegister src1, QwNeonRegister src2);
-  void vmax(QwNeonRegister dst, QwNeonRegister src1, QwNeonRegister src2);
-  void vmax(NeonDataType dt, QwNeonRegister dst,
-            QwNeonRegister src1, QwNeonRegister src2);
-  void vpadd(DwVfpRegister dst, DwVfpRegister src1, DwVfpRegister src2);
-  void vpadd(NeonSize size, DwVfpRegister dst, DwVfpRegister src1,
-             DwVfpRegister src2);
-  void vpmin(NeonDataType dt, DwVfpRegister dst, DwVfpRegister src1,
-             DwVfpRegister src2);
-  void vpmax(NeonDataType dt, DwVfpRegister dst, DwVfpRegister src1,
-             DwVfpRegister src2);
-  void vshl(NeonDataType dt, QwNeonRegister dst, QwNeonRegister src, int shift);
-  void vshr(NeonDataType dt, QwNeonRegister dst, QwNeonRegister src, int shift);
-  void vsli(NeonSize size, DwVfpRegister dst, DwVfpRegister src, int shift);
-  void vsri(NeonSize size, DwVfpRegister dst, DwVfpRegister src, int shift);
-  // vrecpe and vrsqrte only support floating point lanes.
-  void vrecpe(QwNeonRegister dst, QwNeonRegister src);
-  void vrsqrte(QwNeonRegister dst, QwNeonRegister src);
-  void vrecps(QwNeonRegister dst, QwNeonRegister src1, QwNeonRegister src2);
-  void vrsqrts(QwNeonRegister dst, QwNeonRegister src1, QwNeonRegister src2);
-  void vtst(NeonSize size, QwNeonRegister dst, QwNeonRegister src1,
-            QwNeonRegister src2);
-  void vceq(QwNeonRegister dst, QwNeonRegister src1, QwNeonRegister src2);
-  void vceq(NeonSize size, QwNeonRegister dst, QwNeonRegister src1,
-            QwNeonRegister src2);
-  void vcge(QwNeonRegister dst, QwNeonRegister src1, QwNeonRegister src2);
-  void vcge(NeonDataType dt, QwNeonRegister dst, QwNeonRegister src1,
-            QwNeonRegister src2);
-  void vcgt(QwNeonRegister dst, QwNeonRegister src1, QwNeonRegister src2);
-  void vcgt(NeonDataType dt, QwNeonRegister dst, QwNeonRegister src1,
-            QwNeonRegister src2);
-  void vext(QwNeonRegister dst, QwNeonRegister src1, QwNeonRegister src2,
-            int bytes);
-  void vzip(NeonSize size, DwVfpRegister src1, DwVfpRegister src2);
-  void vzip(NeonSize size, QwNeonRegister src1, QwNeonRegister src2);
-  void vuzp(NeonSize size, DwVfpRegister src1, DwVfpRegister src2);
-  void vuzp(NeonSize size, QwNeonRegister src1, QwNeonRegister src2);
-  void vrev16(NeonSize size, QwNeonRegister dst, QwNeonRegister src);
-  void vrev32(NeonSize size, QwNeonRegister dst, QwNeonRegister src);
-  void vrev64(NeonSize size, QwNeonRegister dst, QwNeonRegister src);
-  void vtrn(NeonSize size, DwVfpRegister src1, DwVfpRegister src2);
-  void vtrn(NeonSize size, QwNeonRegister src1, QwNeonRegister src2);
-  void vtbl(DwVfpRegister dst, const NeonListOperand& list,
-            DwVfpRegister index);
-  void vtbx(DwVfpRegister dst, const NeonListOperand& list,
-            DwVfpRegister index);
-
-  // Pseudo instructions
-
-  // Different nop operations are used by the code generator to detect certain
-  // states of the generated code.
-  enum NopMarkerTypes {
-    NON_MARKING_NOP = 0,
-    DEBUG_BREAK_NOP,
-    // IC markers.
-    PROPERTY_ACCESS_INLINED,
-    PROPERTY_ACCESS_INLINED_CONTEXT,
-    PROPERTY_ACCESS_INLINED_CONTEXT_DONT_DELETE,
-    // Helper values.
-    LAST_CODE_MARKER,
-    FIRST_IC_MARKER = PROPERTY_ACCESS_INLINED
-  };
-
-  void nop(int type = 0);   // 0 is the default non-marking type.
-
-  void push(Register src, Condition cond = al) {
-    str(src, MemOperand(sp, 4, NegPreIndex), cond);
-  }
-
-  void pop(Register dst, Condition cond = al) {
-    ldr(dst, MemOperand(sp, 4, PostIndex), cond);
-  }
-
-  void pop();
-
-  void vpush(QwNeonRegister src, Condition cond = al) {
-    vstm(db_w, sp, src.low(), src.high(), cond);
-  }
-
-  void vpush(DwVfpRegister src, Condition cond = al) {
-    vstm(db_w, sp, src, src, cond);
-  }
-
-  void vpush(SwVfpRegister src, Condition cond = al) {
-    vstm(db_w, sp, src, src, cond);
-  }
-
-  void vpop(DwVfpRegister dst, Condition cond = al) {
-    vldm(ia_w, sp, dst, dst, cond);
-  }
-
-  // Jump unconditionally to given label.
-  void jmp(Label* L) { b(L, al); }
-
-  // Check the code size generated from label to here.
-  int SizeOfCodeGeneratedSince(Label* label) {
-    return pc_offset() - label->pos();
-  }
-
-  // Check the number of instructions generated from label to here.
-  int InstructionsGeneratedSince(Label* label) {
-    return SizeOfCodeGeneratedSince(label) / kInstrSize;
-  }
-
-  // Check whether an immediate fits an addressing mode 1 instruction.
-  static bool ImmediateFitsAddrMode1Instruction(int32_t imm32);
-
-  // Check whether an immediate fits an addressing mode 2 instruction.
-  bool ImmediateFitsAddrMode2Instruction(int32_t imm32);
-
-  // Class for scoping postponing the constant pool generation.
-  class BlockConstPoolScope {
-   public:
-    explicit BlockConstPoolScope(Assembler* assem) : assem_(assem) {
-      assem_->StartBlockConstPool();
-    }
-    ~BlockConstPoolScope() {
-      assem_->EndBlockConstPool();
-    }
-
-   private:
-    Assembler* assem_;
-
-    DISALLOW_IMPLICIT_CONSTRUCTORS(BlockConstPoolScope);
-  };
-
-  // Class for blocking sharing of code targets in constant pool.
-  class BlockCodeTargetSharingScope {
-   public:
-    explicit BlockCodeTargetSharingScope(Assembler* assem) : assem_(nullptr) {
-      Open(assem);
-    }
-    // This constructor does not initialize the scope. The user needs to
-    // explicitly call Open() before using it.
-    BlockCodeTargetSharingScope() : assem_(nullptr) {}
-    ~BlockCodeTargetSharingScope() {
-      Close();
-    }
-    void Open(Assembler* assem) {
-      DCHECK_NULL(assem_);
-      DCHECK_NOT_NULL(assem);
-      assem_ = assem;
-      assem_->StartBlockCodeTargetSharing();
-    }
-
-   private:
-    void Close() {
-      if (assem_ != nullptr) {
-        assem_->EndBlockCodeTargetSharing();
-      }
-    }
-    Assembler* assem_;
-
-    DISALLOW_COPY_AND_ASSIGN(BlockCodeTargetSharingScope);
-  };
-
-  // Record a comment relocation entry that can be used by a disassembler.
-  // Use --code-comments to enable.
-  void RecordComment(const char* msg);
-
-  // Record a deoptimization reason that can be used by a log or cpu profiler.
-  // Use --trace-deopt to enable.
-  void RecordDeoptReason(DeoptimizeReason reason, SourcePosition position,
-                         int id);
-
-  // Record the emission of a constant pool.
-  //
-  // The emission of constant pool depends on the size of the code generated and
-  // the number of RelocInfo recorded.
-  // The Debug mechanism needs to map code offsets between two versions of a
-  // function, compiled with and without debugger support (see for example
-  // Debug::PrepareForBreakPoints()).
-  // Compiling functions with debugger support generates additional code
-  // (DebugCodegen::GenerateSlot()). This may affect the emission of the
-  // constant pools and cause the version of the code with debugger support to
-  // have constant pools generated in different places.
-  // Recording the position and size of emitted constant pools allows to
-  // correctly compute the offset mappings between the different versions of a
-  // function in all situations.
-  //
-  // The parameter indicates the size of the constant pool (in bytes), including
-  // the marker and branch over the data.
-  void RecordConstPool(int size);
-
-  // Writes a single byte or word of data in the code stream.  Used
-  // for inline tables, e.g., jump-tables. CheckConstantPool() should be
-  // called before any use of db/dd/dq/dp to ensure that constant pools
-  // are not emitted as part of the tables generated.
-  void db(uint8_t data);
-  void dd(uint32_t data);
-  void dq(uint64_t data);
-  void dp(uintptr_t data) { dd(data); }
-
-  // Emits the address of the code stub's first instruction.
-  void emit_code_stub_address(Code* stub);
-
-  // Read/patch instructions
-  Instr instr_at(int pos) { return *reinterpret_cast<Instr*>(buffer_ + pos); }
-  void instr_at_put(int pos, Instr instr) {
-    *reinterpret_cast<Instr*>(buffer_ + pos) = instr;
-  }
-  static Instr instr_at(byte* pc) { return *reinterpret_cast<Instr*>(pc); }
-  static void instr_at_put(byte* pc, Instr instr) {
-    *reinterpret_cast<Instr*>(pc) = instr;
-  }
-  static Condition GetCondition(Instr instr);
-  static bool IsBranch(Instr instr);
-  static int GetBranchOffset(Instr instr);
-  static bool IsLdrRegisterImmediate(Instr instr);
-  static bool IsVldrDRegisterImmediate(Instr instr);
-  static int GetLdrRegisterImmediateOffset(Instr instr);
-  static int GetVldrDRegisterImmediateOffset(Instr instr);
-  static Instr SetLdrRegisterImmediateOffset(Instr instr, int offset);
-  static Instr SetVldrDRegisterImmediateOffset(Instr instr, int offset);
-  static bool IsStrRegisterImmediate(Instr instr);
-  static Instr SetStrRegisterImmediateOffset(Instr instr, int offset);
-  static bool IsAddRegisterImmediate(Instr instr);
-  static Instr SetAddRegisterImmediateOffset(Instr instr, int offset);
-  static Register GetRd(Instr instr);
-  static Register GetRn(Instr instr);
-  static Register GetRm(Instr instr);
-  static bool IsPush(Instr instr);
-  static bool IsPop(Instr instr);
-  static bool IsStrRegFpOffset(Instr instr);
-  static bool IsLdrRegFpOffset(Instr instr);
-  static bool IsStrRegFpNegOffset(Instr instr);
-  static bool IsLdrRegFpNegOffset(Instr instr);
-  static bool IsLdrPcImmediateOffset(Instr instr);
-  static bool IsVldrDPcImmediateOffset(Instr instr);
-  static bool IsBlxReg(Instr instr);
-  static bool IsBlxIp(Instr instr);
-  static bool IsTstImmediate(Instr instr);
-  static bool IsCmpRegister(Instr instr);
-  static bool IsCmpImmediate(Instr instr);
-  static Register GetCmpImmediateRegister(Instr instr);
-  static int GetCmpImmediateRawImmediate(Instr instr);
-  static bool IsNop(Instr instr, int type = NON_MARKING_NOP);
-  static bool IsMovImmed(Instr instr);
-  static bool IsOrrImmed(Instr instr);
-  static bool IsMovT(Instr instr);
-  static Instr GetMovTPattern();
-  static bool IsMovW(Instr instr);
-  static Instr GetMovWPattern();
-  static Instr EncodeMovwImmediate(uint32_t immediate);
-  static Instr PatchMovwImmediate(Instr instruction, uint32_t immediate);
-  static int DecodeShiftImm(Instr instr);
-  static Instr PatchShiftImm(Instr instr, int immed);
-
-  // Constants in pools are accessed via pc relative addressing, which can
-  // reach +/-4KB for integer PC-relative loads and +/-1KB for floating-point
-  // PC-relative loads, thereby defining a maximum distance between the
-  // instruction and the accessed constant.
-  static constexpr int kMaxDistToIntPool = 4 * KB;
-  static constexpr int kMaxDistToFPPool = 1 * KB;
-  // All relocations could be integer, it therefore acts as the limit.
-  static constexpr int kMinNumPendingConstants = 4;
-  static constexpr int kMaxNumPending32Constants =
-      kMaxDistToIntPool / kInstrSize;
-  static constexpr int kMaxNumPending64Constants =
-      kMaxDistToFPPool / kInstrSize;
-
-  // Postpone the generation of the constant pool for the specified number of
-  // instructions.
-  void BlockConstPoolFor(int instructions);
-
-  // Check if is time to emit a constant pool.
-  void CheckConstPool(bool force_emit, bool require_jump);
-
-  void MaybeCheckConstPool() {
-    if (pc_offset() >= next_buffer_check_) {
-      CheckConstPool(false, true);
-    }
-  }
-
-  void PatchConstantPoolAccessInstruction(int pc_offset, int offset,
-                                          ConstantPoolEntry::Access access,
-                                          ConstantPoolEntry::Type type) {
-    // No embedded constant pool support.
-    UNREACHABLE();
-  }
-
- protected:
-  int buffer_space() const { return reloc_info_writer.pos() - pc_; }
-
-  // Decode branch instruction at pos and return branch target pos
-  int target_at(int pos);
-
-  // Patch branch instruction at pos to branch to given branch target pos
-  void target_at_put(int pos, int target_pos);
-
-  // Prevent sharing of code target constant pool entries until
-  // EndBlockCodeTargetSharing is called. Calls to this function can be nested
-  // but must be followed by an equal number of call to
-  // EndBlockCodeTargetSharing.
-  void StartBlockCodeTargetSharing() {
-    ++code_target_sharing_blocked_nesting_;
-  }
-
-  // Resume sharing of constant pool code target entries. Needs to be called
-  // as many times as StartBlockCodeTargetSharing to have an effect.
-  void EndBlockCodeTargetSharing() {
-    --code_target_sharing_blocked_nesting_;
-  }
-
-  // Prevent contant pool emission until EndBlockConstPool is called.
-  // Calls to this function can be nested but must be followed by an equal
-  // number of call to EndBlockConstpool.
-  void StartBlockConstPool() {
-    if (const_pool_blocked_nesting_++ == 0) {
-      // Prevent constant pool checks happening by setting the next check to
-      // the biggest possible offset.
-      next_buffer_check_ = kMaxInt;
-    }
-  }
-
-  // Resume constant pool emission. Needs to be called as many times as
-  // StartBlockConstPool to have an effect.
-  void EndBlockConstPool() {
-    if (--const_pool_blocked_nesting_ == 0) {
-#ifdef DEBUG
-      // Max pool start (if we need a jump and an alignment).
-      int start = pc_offset() + kInstrSize + 2 * kPointerSize;
-      // Check the constant pool hasn't been blocked for too long.
-      DCHECK(pending_32_bit_constants_.empty() ||
-             (start + pending_64_bit_constants_.size() * kDoubleSize <
-              static_cast<size_t>(first_const_pool_32_use_ +
-                                  kMaxDistToIntPool)));
-      DCHECK(pending_64_bit_constants_.empty() ||
-             (start < (first_const_pool_64_use_ + kMaxDistToFPPool)));
-#endif
-      // Two cases:
-      //  * no_const_pool_before_ >= next_buffer_check_ and the emission is
-      //    still blocked
-      //  * no_const_pool_before_ < next_buffer_check_ and the next emit will
-      //    trigger a check.
-      next_buffer_check_ = no_const_pool_before_;
-    }
-  }
-
-  bool is_const_pool_blocked() const {
-    return (const_pool_blocked_nesting_ > 0) ||
-           (pc_offset() < no_const_pool_before_);
-  }
-
-  bool VfpRegisterIsAvailable(DwVfpRegister reg) {
-    DCHECK(reg.is_valid());
-    return IsEnabled(VFP32DREGS) ||
-           (reg.code() < LowDwVfpRegister::kNumRegisters);
-  }
-
-  bool VfpRegisterIsAvailable(QwNeonRegister reg) {
-    DCHECK(reg.is_valid());
-    return IsEnabled(VFP32DREGS) ||
-           (reg.code() < LowDwVfpRegister::kNumRegisters / 2);
-  }
-
-  inline void emit(Instr x);
-
-  // Code generation
-  // The relocation writer's position is at least kGap bytes below the end of
-  // the generated instructions. This is so that multi-instruction sequences do
-  // not have to check for overflow. The same is true for writes of large
-  // relocation info entries.
-  static constexpr int kGap = 32;
-
-  // Relocation info generation
-  // Each relocation is encoded as a variable size value
-  static constexpr int kMaxRelocSize = RelocInfoWriter::kMaxSize;
-  RelocInfoWriter reloc_info_writer;
-
-  // ConstantPoolEntry records are used during code generation as temporary
-  // containers for constants and code target addresses until they are emitted
-  // to the constant pool. These records are temporarily stored in a separate
-  // buffer until a constant pool is emitted.
-  // If every instruction in a long sequence is accessing the pool, we need one
-  // pending relocation entry per instruction.
-
-  // The buffers of pending constant pool entries.
-  std::vector<ConstantPoolEntry> pending_32_bit_constants_;
-  std::vector<ConstantPoolEntry> pending_64_bit_constants_;
-
-  // Map of address of handle to index in pending_32_bit_constants_.
-  std::map<Address, int> handle_to_index_map_;
-
-  // Scratch registers available for use by the Assembler.
-  RegList scratch_register_list_;
-
- private:
-  // Avoid overflows for displacements etc.
-  static const int kMaximalBufferSize = 512 * MB;
-
-  int next_buffer_check_;  // pc offset of next buffer check
-
-  // Constant pool generation
-  // Pools are emitted in the instruction stream, preferably after unconditional
-  // jumps or after returns from functions (in dead code locations).
-  // If a long code sequence does not contain unconditional jumps, it is
-  // necessary to emit the constant pool before the pool gets too far from the
-  // location it is accessed from. In this case, we emit a jump over the emitted
-  // constant pool.
-  // Constants in the pool may be addresses of functions that gets relocated;
-  // if so, a relocation info entry is associated to the constant pool entry.
-
-  // Repeated checking whether the constant pool should be emitted is rather
-  // expensive. By default we only check again once a number of instructions
-  // has been generated. That also means that the sizing of the buffers is not
-  // an exact science, and that we rely on some slop to not overrun buffers.
-  static constexpr int kCheckPoolIntervalInst = 32;
-  static constexpr int kCheckPoolInterval = kCheckPoolIntervalInst * kInstrSize;
-
-  // Sharing of code target entries may be blocked in some code sequences.
-  int code_target_sharing_blocked_nesting_;
-  bool IsCodeTargetSharingAllowed() const {
-    return code_target_sharing_blocked_nesting_ == 0;
-  }
-
-  // Emission of the constant pool may be blocked in some code sequences.
-  int const_pool_blocked_nesting_;  // Block emission if this is not zero.
-  int no_const_pool_before_;  // Block emission before this pc offset.
-
-  // Keep track of the first instruction requiring a constant pool entry
-  // since the previous constant pool was emitted.
-  int first_const_pool_32_use_;
-  int first_const_pool_64_use_;
-
-  // The bound position, before this we cannot do instruction elimination.
-  int last_bound_pos_;
-
-  inline void CheckBuffer();
-  void GrowBuffer();
-
-  // 32-bit immediate values
-  void Move32BitImmediate(Register rd, const Operand& x, Condition cond = al);
-
-  // Instruction generation
-  void AddrMode1(Instr instr, Register rd, Register rn, const Operand& x);
-  // Attempt to encode operand |x| for instruction |instr| and return true on
-  // success. The result will be encoded in |instr| directly. This method may
-  // change the opcode if deemed beneficial, for instance, MOV may be turned
-  // into MVN, ADD into SUB, AND into BIC, ...etc.  The only reason this method
-  // may fail is that the operand is an immediate that cannot be encoded.
-  bool AddrMode1TryEncodeOperand(Instr* instr, const Operand& x);
-
-  void AddrMode2(Instr instr, Register rd, const MemOperand& x);
-  void AddrMode3(Instr instr, Register rd, const MemOperand& x);
-  void AddrMode4(Instr instr, Register rn, RegList rl);
-  void AddrMode5(Instr instr, CRegister crd, const MemOperand& x);
-
-  // Labels
-  void print(const Label* L);
-  void bind_to(Label* L, int pos);
-  void next(Label* L);
-
-  // Record reloc info for current pc_
-  void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0);
-  void ConstantPoolAddEntry(int position, RelocInfo::Mode rmode,
-                            intptr_t value);
-  void ConstantPoolAddEntry(int position, Double value);
-
-  friend class RelocInfo;
-  friend class BlockConstPoolScope;
-  friend class BlockCodeTargetSharingScope;
-  friend class EnsureSpace;
-
-  // The following functions help with avoiding allocations of embedded heap
-  // objects during the code assembly phase. {RequestHeapObject} records the
-  // need for a future heap number allocation or code stub generation. After
-  // code assembly, {AllocateAndInstallRequestedHeapObjects} will allocate these
-  // objects and place them where they are expected (determined by the pc offset
-  // associated with each request). That is, for each request, it will patch the
-  // dummy heap object handle that we emitted during code assembly with the
-  // actual heap object handle.
-  void RequestHeapObject(HeapObjectRequest request);
-  void AllocateAndInstallRequestedHeapObjects(Isolate* isolate);
-
-  std::forward_list<HeapObjectRequest> heap_object_requests_;
-};
-
-constexpr int kNoCodeAgeSequenceLength = 3 * Assembler::kInstrSize;
-
-class EnsureSpace BASE_EMBEDDED {
- public:
-  INLINE(explicit EnsureSpace(Assembler* assembler));
-};
-
-class PatchingAssembler : public Assembler {
- public:
-  PatchingAssembler(IsolateData isolate_data, byte* address, int instructions);
-  ~PatchingAssembler();
-
-  void Emit(Address addr);
-  void FlushICache(Isolate* isolate);
-};
-
-// This scope utility allows scratch registers to be managed safely. The
-// Assembler's GetScratchRegisterList() is used as a pool of scratch
-// registers. These registers can be allocated on demand, and will be returned
-// at the end of the scope.
-//
-// When the scope ends, the Assembler's list will be restored to its original
-// state, even if the list is modified by some other means. Note that this scope
-// can be nested but the destructors need to run in the opposite order as the
-// constructors. We do not have assertions for this.
-class UseScratchRegisterScope {
- public:
-  explicit UseScratchRegisterScope(Assembler* assembler);
-  ~UseScratchRegisterScope();
-
-  // Take a register from the list and return it.
-  Register Acquire();
-
- private:
-  // Currently available scratch registers.
-  RegList* available_;
-  // Available scratch registers at the start of this scope.
-  RegList old_available_;
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_ARM_ASSEMBLER_ARM_H_
diff --git a/src/v8/src/arm/code-stubs-arm.cc b/src/v8/src/arm/code-stubs-arm.cc
deleted file mode 100644
index ee706c7..0000000
--- a/src/v8/src/arm/code-stubs-arm.cc
+++ /dev/null
@@ -1,1221 +0,0 @@
-// Copyright 2012 the V8 project 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 V8_TARGET_ARCH_ARM
-
-#include "src/api-arguments.h"
-#include "src/assembler-inl.h"
-#include "src/base/bits.h"
-#include "src/bootstrapper.h"
-#include "src/code-stubs.h"
-#include "src/counters.h"
-#include "src/double.h"
-#include "src/frame-constants.h"
-#include "src/frames.h"
-#include "src/heap/heap-inl.h"
-#include "src/ic/ic.h"
-#include "src/ic/stub-cache.h"
-#include "src/isolate.h"
-#include "src/objects/regexp-match-info.h"
-#include "src/regexp/jsregexp.h"
-#include "src/regexp/regexp-macro-assembler.h"
-#include "src/runtime/runtime.h"
-
-#include "src/arm/code-stubs-arm.h"  // Cannot be the first include.
-
-namespace v8 {
-namespace internal {
-
-#define __ ACCESS_MASM(masm)
-
-void ArrayNArgumentsConstructorStub::Generate(MacroAssembler* masm) {
-  __ lsl(r5, r0, Operand(kPointerSizeLog2));
-  __ str(r1, MemOperand(sp, r5));
-  __ Push(r1);
-  __ Push(r2);
-  __ add(r0, r0, Operand(3));
-  __ TailCallRuntime(Runtime::kNewArray);
-}
-
-
-void DoubleToIStub::Generate(MacroAssembler* masm) {
-  Label negate, done;
-  Register result_reg = destination();
-
-  UseScratchRegisterScope temps(masm);
-  Register double_low = GetRegisterThatIsNotOneOf(result_reg);
-  Register double_high = GetRegisterThatIsNotOneOf(result_reg, double_low);
-  LowDwVfpRegister double_scratch = kScratchDoubleReg;
-
-  // Save the old values from these temporary registers on the stack.
-  __ Push(double_high, double_low);
-
-  // Account for saved regs.
-  const int kArgumentOffset = 2 * kPointerSize;
-
-  // Load double input.
-  __ vldr(double_scratch, MemOperand(sp, kArgumentOffset));
-  __ vmov(double_low, double_high, double_scratch);
-  // Try to convert with a FPU convert instruction. This handles all
-  // non-saturating cases.
-  __ TryInlineTruncateDoubleToI(result_reg, double_scratch, &done);
-
-  Register scratch = temps.Acquire();
-  __ Ubfx(scratch, double_high, HeapNumber::kExponentShift,
-          HeapNumber::kExponentBits);
-  // Load scratch with exponent - 1. This is faster than loading
-  // with exponent because Bias + 1 = 1024 which is an *ARM* immediate value.
-  STATIC_ASSERT(HeapNumber::kExponentBias + 1 == 1024);
-  __ sub(scratch, scratch, Operand(HeapNumber::kExponentBias + 1));
-  // If exponent is greater than or equal to 84, the 32 less significant
-  // bits are 0s (2^84 = 1, 52 significant bits, 32 uncoded bits),
-  // the result is 0.
-  // Compare exponent with 84 (compare exponent - 1 with 83). If the exponent is
-  // greater than this, the conversion is out of range, so return zero.
-  __ cmp(scratch, Operand(83));
-  __ mov(result_reg, Operand::Zero(), LeaveCC, ge);
-  __ b(ge, &done);
-
-  // If we reach this code, 30 <= exponent <= 83.
-  // `TryInlineTruncateDoubleToI` above will have truncated any double with an
-  // exponent lower than 30.
-  if (masm->emit_debug_code()) {
-    // Scratch is exponent - 1.
-    __ cmp(scratch, Operand(30 - 1));
-    __ Check(ge, AbortReason::kUnexpectedValue);
-  }
-
-  // We don't have to handle cases where 0 <= exponent <= 20 for which we would
-  // need to shift right the high part of the mantissa.
-  // Scratch contains exponent - 1.
-  // Load scratch with 52 - exponent (load with 51 - (exponent - 1)).
-  __ rsb(scratch, scratch, Operand(51), SetCC);
-
-  // 52 <= exponent <= 83, shift only double_low.
-  // On entry, scratch contains: 52 - exponent.
-  __ rsb(scratch, scratch, Operand::Zero(), LeaveCC, ls);
-  __ mov(result_reg, Operand(double_low, LSL, scratch), LeaveCC, ls);
-  __ b(ls, &negate);
-
-  // 21 <= exponent <= 51, shift double_low and double_high
-  // to generate the result.
-  __ mov(double_low, Operand(double_low, LSR, scratch));
-  // Scratch contains: 52 - exponent.
-  // We needs: exponent - 20.
-  // So we use: 32 - scratch = 32 - 52 + exponent = exponent - 20.
-  __ rsb(scratch, scratch, Operand(32));
-  __ Ubfx(result_reg, double_high, 0, HeapNumber::kMantissaBitsInTopWord);
-  // Set the implicit 1 before the mantissa part in double_high.
-  __ orr(result_reg, result_reg,
-         Operand(1 << HeapNumber::kMantissaBitsInTopWord));
-  __ orr(result_reg, double_low, Operand(result_reg, LSL, scratch));
-
-  __ bind(&negate);
-  // If input was positive, double_high ASR 31 equals 0 and
-  // double_high LSR 31 equals zero.
-  // New result = (result eor 0) + 0 = result.
-  // If the input was negative, we have to negate the result.
-  // Input_high ASR 31 equals 0xFFFFFFFF and double_high LSR 31 equals 1.
-  // New result = (result eor 0xFFFFFFFF) + 1 = 0 - result.
-  __ eor(result_reg, result_reg, Operand(double_high, ASR, 31));
-  __ add(result_reg, result_reg, Operand(double_high, LSR, 31));
-
-  __ bind(&done);
-
-  // Restore registers corrupted in this routine and return.
-  __ Pop(double_high, double_low);
-  __ Ret();
-}
-
-
-void MathPowStub::Generate(MacroAssembler* masm) {
-  const Register exponent = MathPowTaggedDescriptor::exponent();
-  DCHECK(exponent == r2);
-  const LowDwVfpRegister double_base = d0;
-  const LowDwVfpRegister double_exponent = d1;
-  const LowDwVfpRegister double_result = d2;
-  const LowDwVfpRegister double_scratch = d3;
-  const SwVfpRegister single_scratch = s6;
-  const Register scratch = r9;
-  const Register scratch2 = r4;
-
-  Label call_runtime, done, int_exponent;
-  if (exponent_type() == TAGGED) {
-    // Base is already in double_base.
-    __ UntagAndJumpIfSmi(scratch, exponent, &int_exponent);
-
-    __ vldr(double_exponent,
-            FieldMemOperand(exponent, HeapNumber::kValueOffset));
-  }
-
-  if (exponent_type() != INTEGER) {
-    // Detect integer exponents stored as double.
-    __ TryDoubleToInt32Exact(scratch, double_exponent, double_scratch);
-    __ b(eq, &int_exponent);
-
-    __ push(lr);
-    {
-      AllowExternalCallThatCantCauseGC scope(masm);
-      __ PrepareCallCFunction(0, 2);
-      __ MovToFloatParameters(double_base, double_exponent);
-      __ CallCFunction(
-          ExternalReference::power_double_double_function(isolate()), 0, 2);
-    }
-    __ pop(lr);
-    __ MovFromFloatResult(double_result);
-    __ b(&done);
-  }
-
-  // Calculate power with integer exponent.
-  __ bind(&int_exponent);
-
-  // Get two copies of exponent in the registers scratch and exponent.
-  if (exponent_type() == INTEGER) {
-    __ mov(scratch, exponent);
-  } else {
-    // Exponent has previously been stored into scratch as untagged integer.
-    __ mov(exponent, scratch);
-  }
-  __ vmov(double_scratch, double_base);  // Back up base.
-  __ vmov(double_result, Double(1.0), scratch2);
-
-  // Get absolute value of exponent.
-  __ cmp(scratch, Operand::Zero());
-  __ rsb(scratch, scratch, Operand::Zero(), LeaveCC, mi);
-
-  Label while_true;
-  __ bind(&while_true);
-  __ mov(scratch, Operand(scratch, LSR, 1), SetCC);
-  __ vmul(double_result, double_result, double_scratch, cs);
-  __ vmul(double_scratch, double_scratch, double_scratch, ne);
-  __ b(ne, &while_true);
-
-  __ cmp(exponent, Operand::Zero());
-  __ b(ge, &done);
-  __ vmov(double_scratch, Double(1.0), scratch);
-  __ vdiv(double_result, double_scratch, double_result);
-  // Test whether result is zero.  Bail out to check for subnormal result.
-  // Due to subnormals, x^-y == (1/x)^y does not hold in all cases.
-  __ VFPCompareAndSetFlags(double_result, 0.0);
-  __ b(ne, &done);
-  // double_exponent may not containe the exponent value if the input was a
-  // smi.  We set it with exponent value before bailing out.
-  __ vmov(single_scratch, exponent);
-  __ vcvt_f64_s32(double_exponent, single_scratch);
-
-  // Returning or bailing out.
-  __ push(lr);
-  {
-    AllowExternalCallThatCantCauseGC scope(masm);
-    __ PrepareCallCFunction(0, 2);
-    __ MovToFloatParameters(double_base, double_exponent);
-    __ CallCFunction(ExternalReference::power_double_double_function(isolate()),
-                     0, 2);
-  }
-  __ pop(lr);
-  __ MovFromFloatResult(double_result);
-
-  __ bind(&done);
-  __ Ret();
-}
-
-Movability CEntryStub::NeedsImmovableCode() { return kImmovable; }
-
-void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) {
-  CEntryStub::GenerateAheadOfTime(isolate);
-  CommonArrayConstructorStub::GenerateStubsAheadOfTime(isolate);
-  StoreFastElementStub::GenerateAheadOfTime(isolate);
-}
-
-
-void CodeStub::GenerateFPStubs(Isolate* isolate) {
-  // Generate if not already in cache.
-  SaveFPRegsMode mode = kSaveFPRegs;
-  CEntryStub(isolate, 1, mode).GetCode();
-}
-
-
-void CEntryStub::GenerateAheadOfTime(Isolate* isolate) {
-  CEntryStub stub(isolate, 1, kDontSaveFPRegs);
-  stub.GetCode();
-}
-
-
-void CEntryStub::Generate(MacroAssembler* masm) {
-  // Called from JavaScript; parameters are on stack as if calling JS function.
-  // r0: number of arguments including receiver
-  // r1: pointer to builtin function
-  // fp: frame pointer  (restored after C call)
-  // sp: stack pointer  (restored as callee's sp after C call)
-  // cp: current context  (C callee-saved)
-  //
-  // If argv_in_register():
-  // r2: pointer to the first argument
-  ProfileEntryHookStub::MaybeCallEntryHook(masm);
-
-  __ mov(r5, Operand(r1));
-
-  if (argv_in_register()) {
-    // Move argv into the correct register.
-    __ mov(r1, Operand(r2));
-  } else {
-    // Compute the argv pointer in a callee-saved register.
-    __ add(r1, sp, Operand(r0, LSL, kPointerSizeLog2));
-    __ sub(r1, r1, Operand(kPointerSize));
-  }
-
-  // Enter the exit frame that transitions from JavaScript to C++.
-  FrameScope scope(masm, StackFrame::MANUAL);
-  __ EnterExitFrame(save_doubles(), 0, is_builtin_exit()
-                                           ? StackFrame::BUILTIN_EXIT
-                                           : StackFrame::EXIT);
-
-  // Store a copy of argc in callee-saved registers for later.
-  __ mov(r4, Operand(r0));
-
-  // r0, r4: number of arguments including receiver  (C callee-saved)
-  // r1: pointer to the first argument (C callee-saved)
-  // r5: pointer to builtin function  (C callee-saved)
-
-#if V8_HOST_ARCH_ARM
-  int frame_alignment = MacroAssembler::ActivationFrameAlignment();
-  int frame_alignment_mask = frame_alignment - 1;
-  if (FLAG_debug_code) {
-    if (frame_alignment > kPointerSize) {
-      Label alignment_as_expected;
-      DCHECK(base::bits::IsPowerOfTwo(frame_alignment));
-      __ tst(sp, Operand(frame_alignment_mask));
-      __ b(eq, &alignment_as_expected);
-      // Don't use Check here, as it will call Runtime_Abort re-entering here.
-      __ stop("Unexpected alignment");
-      __ bind(&alignment_as_expected);
-    }
-  }
-#endif
-
-  // Call C built-in.
-  // r0 = argc, r1 = argv, r2 = isolate
-  __ mov(r2, Operand(ExternalReference::isolate_address(isolate())));
-
-  // To let the GC traverse the return address of the exit frames, we need to
-  // know where the return address is. The CEntryStub is unmovable, so
-  // we can store the address on the stack to be able to find it again and
-  // we never have to restore it, because it will not change.
-  // Compute the return address in lr to return to after the jump below. Pc is
-  // already at '+ 8' from the current instruction but return is after three
-  // instructions so add another 4 to pc to get the return address.
-  {
-    // Prevent literal pool emission before return address.
-    Assembler::BlockConstPoolScope block_const_pool(masm);
-    __ add(lr, pc, Operand(4));
-    __ str(lr, MemOperand(sp));
-    __ Call(r5);
-  }
-
-  // Result returned in r0 or r1:r0 - do not destroy these registers!
-
-  // Check result for exception sentinel.
-  Label exception_returned;
-  __ CompareRoot(r0, Heap::kExceptionRootIndex);
-  __ b(eq, &exception_returned);
-
-  // Check that there is no pending exception, otherwise we
-  // should have returned the exception sentinel.
-  if (FLAG_debug_code) {
-    Label okay;
-    ExternalReference pending_exception_address(
-        IsolateAddressId::kPendingExceptionAddress, isolate());
-    __ mov(r3, Operand(pending_exception_address));
-    __ ldr(r3, MemOperand(r3));
-    __ CompareRoot(r3, Heap::kTheHoleValueRootIndex);
-    // Cannot use check here as it attempts to generate call into runtime.
-    __ b(eq, &okay);
-    __ stop("Unexpected pending exception");
-    __ bind(&okay);
-  }
-
-  // Exit C frame and return.
-  // r0:r1: result
-  // sp: stack pointer
-  // fp: frame pointer
-  Register argc = argv_in_register()
-                      // We don't want to pop arguments so set argc to no_reg.
-                      ? no_reg
-                      // Callee-saved register r4 still holds argc.
-                      : r4;
-  __ LeaveExitFrame(save_doubles(), argc);
-  __ mov(pc, lr);
-
-  // Handling of exception.
-  __ bind(&exception_returned);
-
-  ExternalReference pending_handler_context_address(
-      IsolateAddressId::kPendingHandlerContextAddress, isolate());
-  ExternalReference pending_handler_entrypoint_address(
-      IsolateAddressId::kPendingHandlerEntrypointAddress, isolate());
-  ExternalReference pending_handler_fp_address(
-      IsolateAddressId::kPendingHandlerFPAddress, isolate());
-  ExternalReference pending_handler_sp_address(
-      IsolateAddressId::kPendingHandlerSPAddress, isolate());
-
-  // Ask the runtime for help to determine the handler. This will set r0 to
-  // contain the current pending exception, don't clobber it.
-  ExternalReference find_handler(Runtime::kUnwindAndFindExceptionHandler,
-                                 isolate());
-  {
-    FrameScope scope(masm, StackFrame::MANUAL);
-    __ PrepareCallCFunction(3, 0);
-    __ mov(r0, Operand(0));
-    __ mov(r1, Operand(0));
-    __ mov(r2, Operand(ExternalReference::isolate_address(isolate())));
-    __ CallCFunction(find_handler, 3);
-  }
-
-  // Retrieve the handler context, SP and FP.
-  __ mov(cp, Operand(pending_handler_context_address));
-  __ ldr(cp, MemOperand(cp));
-  __ mov(sp, Operand(pending_handler_sp_address));
-  __ ldr(sp, MemOperand(sp));
-  __ mov(fp, Operand(pending_handler_fp_address));
-  __ ldr(fp, MemOperand(fp));
-
-  // If the handler is a JS frame, restore the context to the frame. Note that
-  // the context will be set to (cp == 0) for non-JS frames.
-  __ cmp(cp, Operand(0));
-  __ str(cp, MemOperand(fp, StandardFrameConstants::kContextOffset), ne);
-
-  // Compute the handler entry address and jump to it.
-  ConstantPoolUnavailableScope constant_pool_unavailable(masm);
-  __ mov(r1, Operand(pending_handler_entrypoint_address));
-  __ ldr(r1, MemOperand(r1));
-  __ Jump(r1);
-}
-
-
-void JSEntryStub::Generate(MacroAssembler* masm) {
-  // r0: code entry
-  // r1: function
-  // r2: receiver
-  // r3: argc
-  // [sp+0]: argv
-
-  Label invoke, handler_entry, exit;
-
-  ProfileEntryHookStub::MaybeCallEntryHook(masm);
-
-  // Called from C, so do not pop argc and args on exit (preserve sp)
-  // No need to save register-passed args
-  // Save callee-saved registers (incl. cp and fp), sp, and lr
-  __ stm(db_w, sp, kCalleeSaved | lr.bit());
-
-  // Save callee-saved vfp registers.
-  __ vstm(db_w, sp, kFirstCalleeSavedDoubleReg, kLastCalleeSavedDoubleReg);
-  // Set up the reserved register for 0.0.
-  __ vmov(kDoubleRegZero, Double(0.0));
-
-  __ InitializeRootRegister();
-
-  // Get address of argv, see stm above.
-  // r0: code entry
-  // r1: function
-  // r2: receiver
-  // r3: argc
-
-  // Set up argv in r4.
-  int offset_to_argv = (kNumCalleeSaved + 1) * kPointerSize;
-  offset_to_argv += kNumDoubleCalleeSaved * kDoubleSize;
-  __ ldr(r4, MemOperand(sp, offset_to_argv));
-
-  // Push a frame with special values setup to mark it as an entry frame.
-  // r0: code entry
-  // r1: function
-  // r2: receiver
-  // r3: argc
-  // r4: argv
-  StackFrame::Type marker = type();
-  __ mov(r7, Operand(StackFrame::TypeToMarker(marker)));
-  __ mov(r6, Operand(StackFrame::TypeToMarker(marker)));
-  __ mov(r5, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress,
-                                       isolate())));
-  __ ldr(r5, MemOperand(r5));
-  {
-    UseScratchRegisterScope temps(masm);
-    Register scratch = temps.Acquire();
-
-    // Push a bad frame pointer to fail if it is used.
-    __ mov(scratch, Operand(-1));
-    __ stm(db_w, sp, r5.bit() | r6.bit() | r7.bit() | scratch.bit());
-  }
-
-  Register scratch = r6;
-
-  // Set up frame pointer for the frame to be pushed.
-  __ add(fp, sp, Operand(-EntryFrameConstants::kCallerFPOffset));
-
-  // If this is the outermost JS call, set js_entry_sp value.
-  Label non_outermost_js;
-  ExternalReference js_entry_sp(IsolateAddressId::kJSEntrySPAddress, isolate());
-  __ mov(r5, Operand(ExternalReference(js_entry_sp)));
-  __ ldr(scratch, MemOperand(r5));
-  __ cmp(scratch, Operand::Zero());
-  __ b(ne, &non_outermost_js);
-  __ str(fp, MemOperand(r5));
-  __ mov(scratch, Operand(StackFrame::OUTERMOST_JSENTRY_FRAME));
-  Label cont;
-  __ b(&cont);
-  __ bind(&non_outermost_js);
-  __ mov(scratch, Operand(StackFrame::INNER_JSENTRY_FRAME));
-  __ bind(&cont);
-  __ push(scratch);
-
-  // Jump to a faked try block that does the invoke, with a faked catch
-  // block that sets the pending exception.
-  __ jmp(&invoke);
-
-  // Block literal pool emission whilst taking the position of the handler
-  // entry. This avoids making the assumption that literal pools are always
-  // emitted after an instruction is emitted, rather than before.
-  {
-    Assembler::BlockConstPoolScope block_const_pool(masm);
-    __ bind(&handler_entry);
-    handler_offset_ = handler_entry.pos();
-    // Caught exception: Store result (exception) in the pending exception
-    // field in the JSEnv and return a failure sentinel.  Coming in here the
-    // fp will be invalid because the PushStackHandler below sets it to 0 to
-    // signal the existence of the JSEntry frame.
-    __ mov(scratch,
-           Operand(ExternalReference(IsolateAddressId::kPendingExceptionAddress,
-                                     isolate())));
-  }
-  __ str(r0, MemOperand(scratch));
-  __ LoadRoot(r0, Heap::kExceptionRootIndex);
-  __ b(&exit);
-
-  // Invoke: Link this frame into the handler chain.
-  __ bind(&invoke);
-  // Must preserve r0-r4, r5-r6 are available.
-  __ PushStackHandler();
-  // If an exception not caught by another handler occurs, this handler
-  // returns control to the code after the bl(&invoke) above, which
-  // restores all kCalleeSaved registers (including cp and fp) to their
-  // saved values before returning a failure to C.
-
-  // Invoke the function by calling through JS entry trampoline builtin.
-  // Notice that we cannot store a reference to the trampoline code directly in
-  // this stub, because runtime stubs are not traversed when doing GC.
-
-  // Expected registers by Builtins::JSEntryTrampoline
-  // r0: code entry
-  // r1: function
-  // r2: receiver
-  // r3: argc
-  // r4: argv
-  __ Call(EntryTrampoline(), RelocInfo::CODE_TARGET);
-
-  // Unlink this frame from the handler chain.
-  __ PopStackHandler();
-
-  __ bind(&exit);  // r0 holds result
-  // Check if the current stack frame is marked as the outermost JS frame.
-  Label non_outermost_js_2;
-  __ pop(r5);
-  __ cmp(r5, Operand(StackFrame::OUTERMOST_JSENTRY_FRAME));
-  __ b(ne, &non_outermost_js_2);
-  __ mov(r6, Operand::Zero());
-  __ mov(r5, Operand(ExternalReference(js_entry_sp)));
-  __ str(r6, MemOperand(r5));
-  __ bind(&non_outermost_js_2);
-
-  // Restore the top frame descriptors from the stack.
-  __ pop(r3);
-  __ mov(scratch, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress,
-                                            isolate())));
-  __ str(r3, MemOperand(scratch));
-
-  // Reset the stack to the callee saved registers.
-  __ add(sp, sp, Operand(-EntryFrameConstants::kCallerFPOffset));
-
-  // Restore callee-saved registers and return.
-#ifdef DEBUG
-  if (FLAG_debug_code) {
-    __ mov(lr, Operand(pc));
-  }
-#endif
-
-  // Restore callee-saved vfp registers.
-  __ vldm(ia_w, sp, kFirstCalleeSavedDoubleReg, kLastCalleeSavedDoubleReg);
-
-  __ ldm(ia_w, sp, kCalleeSaved | pc.bit());
-}
-
-void DirectCEntryStub::Generate(MacroAssembler* masm) {
-  // Place the return address on the stack, making the call
-  // GC safe. The RegExp backend also relies on this.
-  __ str(lr, MemOperand(sp, 0));
-  __ blx(ip);  // Call the C++ function.
-  __ ldr(pc, MemOperand(sp, 0));
-}
-
-
-void DirectCEntryStub::GenerateCall(MacroAssembler* masm,
-                                    Register target) {
-  intptr_t code =
-      reinterpret_cast<intptr_t>(GetCode().location());
-  __ Move(ip, target);
-  __ mov(lr, Operand(code, RelocInfo::CODE_TARGET));
-  __ blx(lr);  // Call the stub.
-}
-
-
-void ProfileEntryHookStub::MaybeCallEntryHookDelayed(TurboAssembler* tasm,
-                                                     Zone* zone) {
-  if (tasm->isolate()->function_entry_hook() != nullptr) {
-    tasm->MaybeCheckConstPool();
-    PredictableCodeSizeScope predictable(tasm);
-    predictable.ExpectSize(tasm->CallStubSize() + 2 * Assembler::kInstrSize);
-    tasm->push(lr);
-    tasm->CallStubDelayed(new (zone) ProfileEntryHookStub(nullptr));
-    tasm->pop(lr);
-  }
-}
-
-void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
-  if (masm->isolate()->function_entry_hook() != nullptr) {
-    ProfileEntryHookStub stub(masm->isolate());
-    masm->MaybeCheckConstPool();
-    PredictableCodeSizeScope predictable(masm);
-    predictable.ExpectSize(masm->CallStubSize() + 2 * Assembler::kInstrSize);
-    __ push(lr);
-    __ CallStub(&stub);
-    __ pop(lr);
-  }
-}
-
-
-void ProfileEntryHookStub::Generate(MacroAssembler* masm) {
-  // The entry hook is a "push lr" instruction, followed by a call.
-  const int32_t kReturnAddressDistanceFromFunctionStart =
-      3 * Assembler::kInstrSize;
-
-  // This should contain all kCallerSaved registers.
-  const RegList kSavedRegs =
-      1 <<  0 |  // r0
-      1 <<  1 |  // r1
-      1 <<  2 |  // r2
-      1 <<  3 |  // r3
-      1 <<  5 |  // r5
-      1 <<  9;   // r9
-  // We also save lr, so the count here is one higher than the mask indicates.
-  const int32_t kNumSavedRegs = 7;
-
-  DCHECK_EQ(kCallerSaved & kSavedRegs, kCallerSaved);
-
-  // Save all caller-save registers as this may be called from anywhere.
-  __ stm(db_w, sp, kSavedRegs | lr.bit());
-
-  // Compute the function's address for the first argument.
-  __ sub(r0, lr, Operand(kReturnAddressDistanceFromFunctionStart));
-
-  // The caller's return address is above the saved temporaries.
-  // Grab that for the second argument to the hook.
-  __ add(r1, sp, Operand(kNumSavedRegs * kPointerSize));
-
-  // Align the stack if necessary.
-  int frame_alignment = masm->ActivationFrameAlignment();
-  if (frame_alignment > kPointerSize) {
-    __ mov(r5, sp);
-    DCHECK(base::bits::IsPowerOfTwo(frame_alignment));
-    __ and_(sp, sp, Operand(-frame_alignment));
-  }
-
-  {
-    UseScratchRegisterScope temps(masm);
-    Register scratch = temps.Acquire();
-
-#if V8_HOST_ARCH_ARM
-    int32_t entry_hook =
-        reinterpret_cast<int32_t>(isolate()->function_entry_hook());
-    __ mov(scratch, Operand(entry_hook));
-#else
-    // Under the simulator we need to indirect the entry hook through a
-    // trampoline function at a known address.
-    // It additionally takes an isolate as a third parameter
-    __ mov(r2, Operand(ExternalReference::isolate_address(isolate())));
-
-    ApiFunction dispatcher(FUNCTION_ADDR(EntryHookTrampoline));
-    __ mov(scratch,
-           Operand(ExternalReference(
-               &dispatcher, ExternalReference::BUILTIN_CALL, isolate())));
-#endif
-    __ Call(scratch);
-  }
-
-  // Restore the stack pointer if needed.
-  if (frame_alignment > kPointerSize) {
-    __ mov(sp, r5);
-  }
-
-  // Also pop pc to get Ret(0).
-  __ ldm(ia_w, sp, kSavedRegs | pc.bit());
-}
-
-
-template<class T>
-static void CreateArrayDispatch(MacroAssembler* masm,
-                                AllocationSiteOverrideMode mode) {
-  if (mode == DISABLE_ALLOCATION_SITES) {
-    T stub(masm->isolate(), GetInitialFastElementsKind(), mode);
-    __ TailCallStub(&stub);
-  } else if (mode == DONT_OVERRIDE) {
-    int last_index =
-        GetSequenceIndexFromFastElementsKind(TERMINAL_FAST_ELEMENTS_KIND);
-    for (int i = 0; i <= last_index; ++i) {
-      ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
-      __ cmp(r3, Operand(kind));
-      T stub(masm->isolate(), kind);
-      __ TailCallStub(&stub, eq);
-    }
-
-    // If we reached this point there is a problem.
-    __ Abort(AbortReason::kUnexpectedElementsKindInArrayConstructor);
-  } else {
-    UNREACHABLE();
-  }
-}
-
-
-static void CreateArrayDispatchOneArgument(MacroAssembler* masm,
-                                           AllocationSiteOverrideMode mode) {
-  // r2 - allocation site (if mode != DISABLE_ALLOCATION_SITES)
-  // r3 - kind (if mode != DISABLE_ALLOCATION_SITES)
-  // r0 - number of arguments
-  // r1 - constructor?
-  // sp[0] - last argument
-  STATIC_ASSERT(PACKED_SMI_ELEMENTS == 0);
-  STATIC_ASSERT(HOLEY_SMI_ELEMENTS == 1);
-  STATIC_ASSERT(PACKED_ELEMENTS == 2);
-  STATIC_ASSERT(HOLEY_ELEMENTS == 3);
-  STATIC_ASSERT(PACKED_DOUBLE_ELEMENTS == 4);
-  STATIC_ASSERT(HOLEY_DOUBLE_ELEMENTS == 5);
-
-  if (mode == DISABLE_ALLOCATION_SITES) {
-    ElementsKind initial = GetInitialFastElementsKind();
-    ElementsKind holey_initial = GetHoleyElementsKind(initial);
-
-    ArraySingleArgumentConstructorStub stub_holey(masm->isolate(),
-                                                  holey_initial,
-                                                  DISABLE_ALLOCATION_SITES);
-    __ TailCallStub(&stub_holey);
-  } else if (mode == DONT_OVERRIDE) {
-    // is the low bit set? If so, we are holey and that is good.
-    Label normal_sequence;
-    __ tst(r3, Operand(1));
-    __ b(ne, &normal_sequence);
-
-    // We are going to create a holey array, but our kind is non-holey.
-    // Fix kind and retry (only if we have an allocation site in the slot).
-    __ add(r3, r3, Operand(1));
-
-    if (FLAG_debug_code) {
-      __ ldr(r5, FieldMemOperand(r2, 0));
-      __ CompareRoot(r5, Heap::kAllocationSiteMapRootIndex);
-      __ Assert(eq, AbortReason::kExpectedAllocationSite);
-    }
-
-    // Save the resulting elements kind in type info. We can't just store r3
-    // in the AllocationSite::transition_info field because elements kind is
-    // restricted to a portion of the field...upper bits need to be left alone.
-    STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
-    __ ldr(r4, FieldMemOperand(
-                   r2, AllocationSite::kTransitionInfoOrBoilerplateOffset));
-    __ add(r4, r4, Operand(Smi::FromInt(kFastElementsKindPackedToHoley)));
-    __ str(r4, FieldMemOperand(
-                   r2, AllocationSite::kTransitionInfoOrBoilerplateOffset));
-
-    __ bind(&normal_sequence);
-    int last_index =
-        GetSequenceIndexFromFastElementsKind(TERMINAL_FAST_ELEMENTS_KIND);
-    for (int i = 0; i <= last_index; ++i) {
-      ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
-      __ cmp(r3, Operand(kind));
-      ArraySingleArgumentConstructorStub stub(masm->isolate(), kind);
-      __ TailCallStub(&stub, eq);
-    }
-
-    // If we reached this point there is a problem.
-    __ Abort(AbortReason::kUnexpectedElementsKindInArrayConstructor);
-  } else {
-    UNREACHABLE();
-  }
-}
-
-
-template<class T>
-static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) {
-  int to_index =
-      GetSequenceIndexFromFastElementsKind(TERMINAL_FAST_ELEMENTS_KIND);
-  for (int i = 0; i <= to_index; ++i) {
-    ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
-    T stub(isolate, kind);
-    stub.GetCode();
-    if (AllocationSite::ShouldTrack(kind)) {
-      T stub1(isolate, kind, DISABLE_ALLOCATION_SITES);
-      stub1.GetCode();
-    }
-  }
-}
-
-void CommonArrayConstructorStub::GenerateStubsAheadOfTime(Isolate* isolate) {
-  ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>(
-      isolate);
-  ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>(
-      isolate);
-  ArrayNArgumentsConstructorStub stub(isolate);
-  stub.GetCode();
-  ElementsKind kinds[2] = {PACKED_ELEMENTS, HOLEY_ELEMENTS};
-  for (int i = 0; i < 2; i++) {
-    // For internal arrays we only need a few things
-    InternalArrayNoArgumentConstructorStub stubh1(isolate, kinds[i]);
-    stubh1.GetCode();
-    InternalArraySingleArgumentConstructorStub stubh2(isolate, kinds[i]);
-    stubh2.GetCode();
-  }
-}
-
-
-void ArrayConstructorStub::GenerateDispatchToArrayStub(
-    MacroAssembler* masm,
-    AllocationSiteOverrideMode mode) {
-  Label not_zero_case, not_one_case;
-  __ tst(r0, r0);
-  __ b(ne, &not_zero_case);
-  CreateArrayDispatch<ArrayNoArgumentConstructorStub>(masm, mode);
-
-  __ bind(&not_zero_case);
-  __ cmp(r0, Operand(1));
-  __ b(gt, &not_one_case);
-  CreateArrayDispatchOneArgument(masm, mode);
-
-  __ bind(&not_one_case);
-  ArrayNArgumentsConstructorStub stub(masm->isolate());
-  __ TailCallStub(&stub);
-}
-
-
-void ArrayConstructorStub::Generate(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- r0 : argc (only if argument_count() == ANY)
-  //  -- r1 : constructor
-  //  -- r2 : AllocationSite or undefined
-  //  -- r3 : new target
-  //  -- sp[0] : return address
-  //  -- sp[4] : last argument
-  // -----------------------------------
-
-  if (FLAG_debug_code) {
-    // The array construct code is only set for the global and natives
-    // builtin Array functions which always have maps.
-
-    // Initial map for the builtin Array function should be a map.
-    __ ldr(r4, FieldMemOperand(r1, JSFunction::kPrototypeOrInitialMapOffset));
-    // Will both indicate a nullptr and a Smi.
-    __ tst(r4, Operand(kSmiTagMask));
-    __ Assert(ne, AbortReason::kUnexpectedInitialMapForArrayFunction);
-    __ CompareObjectType(r4, r4, r5, MAP_TYPE);
-    __ Assert(eq, AbortReason::kUnexpectedInitialMapForArrayFunction);
-
-    // We should either have undefined in r2 or a valid AllocationSite
-    __ AssertUndefinedOrAllocationSite(r2, r4);
-  }
-
-  // Enter the context of the Array function.
-  __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
-
-  Label subclassing;
-  __ cmp(r3, r1);
-  __ b(ne, &subclassing);
-
-  Label no_info;
-  // Get the elements kind and case on that.
-  __ CompareRoot(r2, Heap::kUndefinedValueRootIndex);
-  __ b(eq, &no_info);
-
-  __ ldr(r3, FieldMemOperand(
-                 r2, AllocationSite::kTransitionInfoOrBoilerplateOffset));
-  __ SmiUntag(r3);
-  STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
-  __ and_(r3, r3, Operand(AllocationSite::ElementsKindBits::kMask));
-  GenerateDispatchToArrayStub(masm, DONT_OVERRIDE);
-
-  __ bind(&no_info);
-  GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES);
-
-  __ bind(&subclassing);
-  __ str(r1, MemOperand(sp, r0, LSL, kPointerSizeLog2));
-  __ add(r0, r0, Operand(3));
-  __ Push(r3, r2);
-  __ JumpToExternalReference(ExternalReference(Runtime::kNewArray, isolate()));
-}
-
-
-void InternalArrayConstructorStub::GenerateCase(
-    MacroAssembler* masm, ElementsKind kind) {
-  __ cmp(r0, Operand(1));
-
-  InternalArrayNoArgumentConstructorStub stub0(isolate(), kind);
-  __ TailCallStub(&stub0, lo);
-
-  ArrayNArgumentsConstructorStub stubN(isolate());
-  __ TailCallStub(&stubN, hi);
-
-  if (IsFastPackedElementsKind(kind)) {
-    // We might need to create a holey array
-    // look at the first argument
-    __ ldr(r3, MemOperand(sp, 0));
-    __ cmp(r3, Operand::Zero());
-
-    InternalArraySingleArgumentConstructorStub
-        stub1_holey(isolate(), GetHoleyElementsKind(kind));
-    __ TailCallStub(&stub1_holey, ne);
-  }
-
-  InternalArraySingleArgumentConstructorStub stub1(isolate(), kind);
-  __ TailCallStub(&stub1);
-}
-
-
-void InternalArrayConstructorStub::Generate(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- r0 : argc
-  //  -- r1 : constructor
-  //  -- sp[0] : return address
-  //  -- sp[4] : last argument
-  // -----------------------------------
-
-  if (FLAG_debug_code) {
-    // The array construct code is only set for the global and natives
-    // builtin Array functions which always have maps.
-
-    // Initial map for the builtin Array function should be a map.
-    __ ldr(r3, FieldMemOperand(r1, JSFunction::kPrototypeOrInitialMapOffset));
-    // Will both indicate a nullptr and a Smi.
-    __ tst(r3, Operand(kSmiTagMask));
-    __ Assert(ne, AbortReason::kUnexpectedInitialMapForArrayFunction);
-    __ CompareObjectType(r3, r3, r4, MAP_TYPE);
-    __ Assert(eq, AbortReason::kUnexpectedInitialMapForArrayFunction);
-  }
-
-  // Figure out the right elements kind
-  __ ldr(r3, FieldMemOperand(r1, JSFunction::kPrototypeOrInitialMapOffset));
-  // Load the map's "bit field 2" into |result|. We only need the first byte,
-  // but the following bit field extraction takes care of that anyway.
-  __ ldr(r3, FieldMemOperand(r3, Map::kBitField2Offset));
-  // Retrieve elements_kind from bit field 2.
-  __ DecodeField<Map::ElementsKindBits>(r3);
-
-  if (FLAG_debug_code) {
-    Label done;
-    __ cmp(r3, Operand(PACKED_ELEMENTS));
-    __ b(eq, &done);
-    __ cmp(r3, Operand(HOLEY_ELEMENTS));
-    __ Assert(
-        eq,
-        AbortReason::kInvalidElementsKindForInternalArrayOrInternalPackedArray);
-    __ bind(&done);
-  }
-
-  Label fast_elements_case;
-  __ cmp(r3, Operand(PACKED_ELEMENTS));
-  __ b(eq, &fast_elements_case);
-  GenerateCase(masm, HOLEY_ELEMENTS);
-
-  __ bind(&fast_elements_case);
-  GenerateCase(masm, PACKED_ELEMENTS);
-}
-
-static int AddressOffset(ExternalReference ref0, ExternalReference ref1) {
-  return ref0.address() - ref1.address();
-}
-
-
-// Calls an API function.  Allocates HandleScope, extracts returned value
-// from handle and propagates exceptions.  Restores context.  stack_space
-// - space to be unwound on exit (includes the call JS arguments space and
-// the additional space allocated for the fast call).
-static void CallApiFunctionAndReturn(MacroAssembler* masm,
-                                     Register function_address,
-                                     ExternalReference thunk_ref,
-                                     int stack_space,
-                                     MemOperand* stack_space_operand,
-                                     MemOperand return_value_operand) {
-  Isolate* isolate = masm->isolate();
-  ExternalReference next_address =
-      ExternalReference::handle_scope_next_address(isolate);
-  const int kNextOffset = 0;
-  const int kLimitOffset = AddressOffset(
-      ExternalReference::handle_scope_limit_address(isolate), next_address);
-  const int kLevelOffset = AddressOffset(
-      ExternalReference::handle_scope_level_address(isolate), next_address);
-
-  DCHECK(function_address == r1 || function_address == r2);
-
-  Label profiler_disabled;
-  Label end_profiler_check;
-  __ mov(r9, Operand(ExternalReference::is_profiling_address(isolate)));
-  __ ldrb(r9, MemOperand(r9, 0));
-  __ cmp(r9, Operand(0));
-  __ b(eq, &profiler_disabled);
-
-  // Additional parameter is the address of the actual callback.
-  __ mov(r3, Operand(thunk_ref));
-  __ jmp(&end_profiler_check);
-
-  __ bind(&profiler_disabled);
-  __ Move(r3, function_address);
-  __ bind(&end_profiler_check);
-
-  // Allocate HandleScope in callee-save registers.
-  __ mov(r9, Operand(next_address));
-  __ ldr(r4, MemOperand(r9, kNextOffset));
-  __ ldr(r5, MemOperand(r9, kLimitOffset));
-  __ ldr(r6, MemOperand(r9, kLevelOffset));
-  __ add(r6, r6, Operand(1));
-  __ str(r6, MemOperand(r9, kLevelOffset));
-
-  if (FLAG_log_timer_events) {
-    FrameScope frame(masm, StackFrame::MANUAL);
-    __ PushSafepointRegisters();
-    __ PrepareCallCFunction(1);
-    __ mov(r0, Operand(ExternalReference::isolate_address(isolate)));
-    __ CallCFunction(ExternalReference::log_enter_external_function(isolate),
-                     1);
-    __ PopSafepointRegisters();
-  }
-
-  // Native call returns to the DirectCEntry stub which redirects to the
-  // return address pushed on stack (could have moved after GC).
-  // DirectCEntry stub itself is generated early and never moves.
-  DirectCEntryStub stub(isolate);
-  stub.GenerateCall(masm, r3);
-
-  if (FLAG_log_timer_events) {
-    FrameScope frame(masm, StackFrame::MANUAL);
-    __ PushSafepointRegisters();
-    __ PrepareCallCFunction(1);
-    __ mov(r0, Operand(ExternalReference::isolate_address(isolate)));
-    __ CallCFunction(ExternalReference::log_leave_external_function(isolate),
-                     1);
-    __ PopSafepointRegisters();
-  }
-
-  Label promote_scheduled_exception;
-  Label delete_allocated_handles;
-  Label leave_exit_frame;
-  Label return_value_loaded;
-
-  // load value from ReturnValue
-  __ ldr(r0, return_value_operand);
-  __ bind(&return_value_loaded);
-  // No more valid handles (the result handle was the last one). Restore
-  // previous handle scope.
-  __ str(r4, MemOperand(r9, kNextOffset));
-  if (__ emit_debug_code()) {
-    __ ldr(r1, MemOperand(r9, kLevelOffset));
-    __ cmp(r1, r6);
-    __ Check(eq, AbortReason::kUnexpectedLevelAfterReturnFromApiCall);
-  }
-  __ sub(r6, r6, Operand(1));
-  __ str(r6, MemOperand(r9, kLevelOffset));
-  __ ldr(r6, MemOperand(r9, kLimitOffset));
-  __ cmp(r5, r6);
-  __ b(ne, &delete_allocated_handles);
-
-  // Leave the API exit frame.
-  __ bind(&leave_exit_frame);
-  // LeaveExitFrame expects unwind space to be in a register.
-  if (stack_space_operand != nullptr) {
-    __ ldr(r4, *stack_space_operand);
-  } else {
-    __ mov(r4, Operand(stack_space));
-  }
-  __ LeaveExitFrame(false, r4, stack_space_operand != nullptr);
-
-  // Check if the function scheduled an exception.
-  __ LoadRoot(r4, Heap::kTheHoleValueRootIndex);
-  __ mov(r6, Operand(ExternalReference::scheduled_exception_address(isolate)));
-  __ ldr(r5, MemOperand(r6));
-  __ cmp(r4, r5);
-  __ b(ne, &promote_scheduled_exception);
-
-  __ mov(pc, lr);
-
-  // Re-throw by promoting a scheduled exception.
-  __ bind(&promote_scheduled_exception);
-  __ TailCallRuntime(Runtime::kPromoteScheduledException);
-
-  // HandleScope limit has changed. Delete allocated extensions.
-  __ bind(&delete_allocated_handles);
-  __ str(r5, MemOperand(r9, kLimitOffset));
-  __ mov(r4, r0);
-  __ PrepareCallCFunction(1);
-  __ mov(r0, Operand(ExternalReference::isolate_address(isolate)));
-  __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate),
-                   1);
-  __ mov(r0, r4);
-  __ jmp(&leave_exit_frame);
-}
-
-void CallApiCallbackStub::Generate(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- r4                  : call_data
-  //  -- r2                  : holder
-  //  -- r1                  : api_function_address
-  //  -- cp                  : context
-  //  --
-  //  -- sp[0]               : last argument
-  //  -- ...
-  //  -- sp[(argc - 1) * 4]  : first argument
-  //  -- sp[argc * 4]        : receiver
-  // -----------------------------------
-
-  Register call_data = r4;
-  Register holder = r2;
-  Register api_function_address = r1;
-
-  typedef FunctionCallbackArguments FCA;
-
-  STATIC_ASSERT(FCA::kArgsLength == 6);
-  STATIC_ASSERT(FCA::kNewTargetIndex == 5);
-  STATIC_ASSERT(FCA::kDataIndex == 4);
-  STATIC_ASSERT(FCA::kReturnValueOffset == 3);
-  STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2);
-  STATIC_ASSERT(FCA::kIsolateIndex == 1);
-  STATIC_ASSERT(FCA::kHolderIndex == 0);
-
-  // new target
-  __ PushRoot(Heap::kUndefinedValueRootIndex);
-
-  // call data
-  __ push(call_data);
-
-  Register scratch0 = call_data;
-  Register scratch1 = r5;
-  __ LoadRoot(scratch0, Heap::kUndefinedValueRootIndex);
-  // return value
-  __ push(scratch0);
-  // return value default
-  __ push(scratch0);
-  // isolate
-  __ mov(scratch1,
-         Operand(ExternalReference::isolate_address(masm->isolate())));
-  __ push(scratch1);
-  // holder
-  __ push(holder);
-
-  // Prepare arguments.
-  __ mov(scratch0, sp);
-
-  // Allocate the v8::Arguments structure in the arguments' space since
-  // it's not controlled by GC.
-  const int kApiStackSpace = 3;
-
-  FrameScope frame_scope(masm, StackFrame::MANUAL);
-  __ EnterExitFrame(false, kApiStackSpace);
-
-  DCHECK(api_function_address != r0 && scratch0 != r0);
-  // r0 = FunctionCallbackInfo&
-  // Arguments is after the return address.
-  __ add(r0, sp, Operand(1 * kPointerSize));
-  // FunctionCallbackInfo::implicit_args_
-  __ str(scratch0, MemOperand(r0, 0 * kPointerSize));
-  // FunctionCallbackInfo::values_
-  __ add(scratch1, scratch0,
-         Operand((FCA::kArgsLength - 1 + argc()) * kPointerSize));
-  __ str(scratch1, MemOperand(r0, 1 * kPointerSize));
-  // FunctionCallbackInfo::length_ = argc
-  __ mov(scratch0, Operand(argc()));
-  __ str(scratch0, MemOperand(r0, 2 * kPointerSize));
-
-  ExternalReference thunk_ref =
-      ExternalReference::invoke_function_callback(masm->isolate());
-
-  AllowExternalCallThatCantCauseGC scope(masm);
-  // Stores return the first js argument
-  int return_value_offset = 2 + FCA::kReturnValueOffset;
-  MemOperand return_value_operand(fp, return_value_offset * kPointerSize);
-  const int stack_space = argc() + FCA::kArgsLength + 1;
-  MemOperand* stack_space_operand = nullptr;
-
-  CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space,
-                           stack_space_operand, return_value_operand);
-}
-
-
-void CallApiGetterStub::Generate(MacroAssembler* masm) {
-  // Build v8::PropertyCallbackInfo::args_ array on the stack and push property
-  // name below the exit frame to make GC aware of them.
-  STATIC_ASSERT(PropertyCallbackArguments::kShouldThrowOnErrorIndex == 0);
-  STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 1);
-  STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 2);
-  STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 3);
-  STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 4);
-  STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 5);
-  STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 6);
-  STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 7);
-
-  Register receiver = ApiGetterDescriptor::ReceiverRegister();
-  Register holder = ApiGetterDescriptor::HolderRegister();
-  Register callback = ApiGetterDescriptor::CallbackRegister();
-  Register scratch = r4;
-  DCHECK(!AreAliased(receiver, holder, callback, scratch));
-
-  Register api_function_address = r2;
-
-  __ push(receiver);
-  // Push data from AccessorInfo.
-  __ ldr(scratch, FieldMemOperand(callback, AccessorInfo::kDataOffset));
-  __ push(scratch);
-  __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex);
-  __ Push(scratch, scratch);
-  __ mov(scratch, Operand(ExternalReference::isolate_address(isolate())));
-  __ Push(scratch, holder);
-  __ Push(Smi::kZero);  // should_throw_on_error -> false
-  __ ldr(scratch, FieldMemOperand(callback, AccessorInfo::kNameOffset));
-  __ push(scratch);
-  // v8::PropertyCallbackInfo::args_ array and name handle.
-  const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1;
-
-  // Load address of v8::PropertyAccessorInfo::args_ array and name handle.
-  __ mov(r0, sp);                             // r0 = Handle<Name>
-  __ add(r1, r0, Operand(1 * kPointerSize));  // r1 = v8::PCI::args_
-
-  const int kApiStackSpace = 1;
-  FrameScope frame_scope(masm, StackFrame::MANUAL);
-  __ EnterExitFrame(false, kApiStackSpace);
-
-  // Create v8::PropertyCallbackInfo object on the stack and initialize
-  // it's args_ field.
-  __ str(r1, MemOperand(sp, 1 * kPointerSize));
-  __ add(r1, sp, Operand(1 * kPointerSize));  // r1 = v8::PropertyCallbackInfo&
-
-  ExternalReference thunk_ref =
-      ExternalReference::invoke_accessor_getter_callback(isolate());
-
-  __ ldr(scratch, FieldMemOperand(callback, AccessorInfo::kJsGetterOffset));
-  __ ldr(api_function_address,
-         FieldMemOperand(scratch, Foreign::kForeignAddressOffset));
-
-  // +3 is to skip prolog, return address and name handle.
-  MemOperand return_value_operand(
-      fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize);
-  CallApiFunctionAndReturn(masm, api_function_address, thunk_ref,
-                           kStackUnwindSpace, nullptr, return_value_operand);
-}
-
-#undef __
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_ARM
diff --git a/src/v8/src/arm/code-stubs-arm.h b/src/v8/src/arm/code-stubs-arm.h
deleted file mode 100644
index a9b8221..0000000
--- a/src/v8/src/arm/code-stubs-arm.h
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_ARM_CODE_STUBS_ARM_H_
-#define V8_ARM_CODE_STUBS_ARM_H_
-
-namespace v8 {
-namespace internal {
-
-// Trampoline stub to call into native code. To call safely into native code
-// in the presence of compacting GC (which can move code objects) we need to
-// keep the code which called into native pinned in the memory. Currently the
-// simplest approach is to generate such stub early enough so it can never be
-// moved by GC
-class DirectCEntryStub: public PlatformCodeStub {
- public:
-  explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {}
-  void GenerateCall(MacroAssembler* masm, Register target);
-
- private:
-  Movability NeedsImmovableCode() override { return kImmovable; }
-
-  DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR();
-  DEFINE_PLATFORM_CODE_STUB(DirectCEntry, PlatformCodeStub);
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_ARM_CODE_STUBS_ARM_H_
diff --git a/src/v8/src/arm/codegen-arm.cc b/src/v8/src/arm/codegen-arm.cc
deleted file mode 100644
index 9fb2eb4..0000000
--- a/src/v8/src/arm/codegen-arm.cc
+++ /dev/null
@@ -1,298 +0,0 @@
-// Copyright 2012 the V8 project 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 V8_TARGET_ARCH_ARM
-
-#include <memory>
-
-#include "src/arm/assembler-arm-inl.h"
-#include "src/arm/simulator-arm.h"
-#include "src/codegen.h"
-#include "src/macro-assembler.h"
-
-namespace v8 {
-namespace internal {
-
-#define __ masm.
-
-#if defined(V8_HOST_ARCH_ARM)
-
-MemCopyUint8Function CreateMemCopyUint8Function(Isolate* isolate,
-                                                MemCopyUint8Function stub) {
-#if defined(USE_SIMULATOR)
-  return stub;
-#else
-  size_t allocated = 0;
-  byte* buffer = AllocatePage(isolate->heap()->GetRandomMmapAddr(), &allocated);
-  if (buffer == nullptr) return stub;
-
-  MacroAssembler masm(isolate, buffer, static_cast<int>(allocated),
-                      CodeObjectRequired::kNo);
-
-  Register dest = r0;
-  Register src = r1;
-  Register chars = r2;
-  Register temp1 = r3;
-  Label less_4;
-
-  if (CpuFeatures::IsSupported(NEON)) {
-    CpuFeatureScope scope(&masm, NEON);
-    Label loop, less_256, less_128, less_64, less_32, _16_or_less, _8_or_less;
-    Label size_less_than_8;
-    __ pld(MemOperand(src, 0));
-
-    __ cmp(chars, Operand(8));
-    __ b(lt, &size_less_than_8);
-    __ cmp(chars, Operand(32));
-    __ b(lt, &less_32);
-    if (CpuFeatures::dcache_line_size() == 32) {
-      __ pld(MemOperand(src, 32));
-    }
-    __ cmp(chars, Operand(64));
-    __ b(lt, &less_64);
-    __ pld(MemOperand(src, 64));
-    if (CpuFeatures::dcache_line_size() == 32) {
-      __ pld(MemOperand(src, 96));
-    }
-    __ cmp(chars, Operand(128));
-    __ b(lt, &less_128);
-    __ pld(MemOperand(src, 128));
-    if (CpuFeatures::dcache_line_size() == 32) {
-      __ pld(MemOperand(src, 160));
-    }
-    __ pld(MemOperand(src, 192));
-    if (CpuFeatures::dcache_line_size() == 32) {
-      __ pld(MemOperand(src, 224));
-    }
-    __ cmp(chars, Operand(256));
-    __ b(lt, &less_256);
-    __ sub(chars, chars, Operand(256));
-
-    __ bind(&loop);
-    __ pld(MemOperand(src, 256));
-    __ vld1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(src, PostIndex));
-    if (CpuFeatures::dcache_line_size() == 32) {
-      __ pld(MemOperand(src, 256));
-    }
-    __ vld1(Neon8, NeonListOperand(d4, 4), NeonMemOperand(src, PostIndex));
-    __ sub(chars, chars, Operand(64), SetCC);
-    __ vst1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(dest, PostIndex));
-    __ vst1(Neon8, NeonListOperand(d4, 4), NeonMemOperand(dest, PostIndex));
-    __ b(ge, &loop);
-    __ add(chars, chars, Operand(256));
-
-    __ bind(&less_256);
-    __ vld1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(src, PostIndex));
-    __ vld1(Neon8, NeonListOperand(d4, 4), NeonMemOperand(src, PostIndex));
-    __ sub(chars, chars, Operand(128));
-    __ vst1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(dest, PostIndex));
-    __ vst1(Neon8, NeonListOperand(d4, 4), NeonMemOperand(dest, PostIndex));
-    __ vld1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(src, PostIndex));
-    __ vld1(Neon8, NeonListOperand(d4, 4), NeonMemOperand(src, PostIndex));
-    __ vst1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(dest, PostIndex));
-    __ vst1(Neon8, NeonListOperand(d4, 4), NeonMemOperand(dest, PostIndex));
-    __ cmp(chars, Operand(64));
-    __ b(lt, &less_64);
-
-    __ bind(&less_128);
-    __ vld1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(src, PostIndex));
-    __ vld1(Neon8, NeonListOperand(d4, 4), NeonMemOperand(src, PostIndex));
-    __ sub(chars, chars, Operand(64));
-    __ vst1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(dest, PostIndex));
-    __ vst1(Neon8, NeonListOperand(d4, 4), NeonMemOperand(dest, PostIndex));
-
-    __ bind(&less_64);
-    __ cmp(chars, Operand(32));
-    __ b(lt, &less_32);
-    __ vld1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(src, PostIndex));
-    __ vst1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(dest, PostIndex));
-    __ sub(chars, chars, Operand(32));
-
-    __ bind(&less_32);
-    __ cmp(chars, Operand(16));
-    __ b(le, &_16_or_less);
-    __ vld1(Neon8, NeonListOperand(d0, 2), NeonMemOperand(src, PostIndex));
-    __ vst1(Neon8, NeonListOperand(d0, 2), NeonMemOperand(dest, PostIndex));
-    __ sub(chars, chars, Operand(16));
-
-    __ bind(&_16_or_less);
-    __ cmp(chars, Operand(8));
-    __ b(le, &_8_or_less);
-    __ vld1(Neon8, NeonListOperand(d0), NeonMemOperand(src, PostIndex));
-    __ vst1(Neon8, NeonListOperand(d0), NeonMemOperand(dest, PostIndex));
-    __ sub(chars, chars, Operand(8));
-
-    // Do a last copy which may overlap with the previous copy (up to 8 bytes).
-    __ bind(&_8_or_less);
-    __ rsb(chars, chars, Operand(8));
-    __ sub(src, src, Operand(chars));
-    __ sub(dest, dest, Operand(chars));
-    __ vld1(Neon8, NeonListOperand(d0), NeonMemOperand(src));
-    __ vst1(Neon8, NeonListOperand(d0), NeonMemOperand(dest));
-
-    __ Ret();
-
-    __ bind(&size_less_than_8);
-
-    __ bic(temp1, chars, Operand(0x3), SetCC);
-    __ b(&less_4, eq);
-    __ ldr(temp1, MemOperand(src, 4, PostIndex));
-    __ str(temp1, MemOperand(dest, 4, PostIndex));
-  } else {
-    UseScratchRegisterScope temps(&masm);
-    Register temp2 = temps.Acquire();
-    Label loop;
-
-    __ bic(temp2, chars, Operand(0x3), SetCC);
-    __ b(&less_4, eq);
-    __ add(temp2, dest, temp2);
-
-    __ bind(&loop);
-    __ ldr(temp1, MemOperand(src, 4, PostIndex));
-    __ str(temp1, MemOperand(dest, 4, PostIndex));
-    __ cmp(dest, temp2);
-    __ b(&loop, ne);
-  }
-
-  __ bind(&less_4);
-  __ mov(chars, Operand(chars, LSL, 31), SetCC);
-  // bit0 => Z (ne), bit1 => C (cs)
-  __ ldrh(temp1, MemOperand(src, 2, PostIndex), cs);
-  __ strh(temp1, MemOperand(dest, 2, PostIndex), cs);
-  __ ldrb(temp1, MemOperand(src), ne);
-  __ strb(temp1, MemOperand(dest), ne);
-  __ Ret();
-
-  CodeDesc desc;
-  masm.GetCode(isolate, &desc);
-  DCHECK(!RelocInfo::RequiresRelocation(isolate, desc));
-
-  Assembler::FlushICache(isolate, buffer, allocated);
-  CHECK(SetPermissions(buffer, allocated, PageAllocator::kReadExecute));
-  return FUNCTION_CAST<MemCopyUint8Function>(buffer);
-#endif
-}
-
-
-// Convert 8 to 16. The number of character to copy must be at least 8.
-MemCopyUint16Uint8Function CreateMemCopyUint16Uint8Function(
-    Isolate* isolate, MemCopyUint16Uint8Function stub) {
-#if defined(USE_SIMULATOR)
-  return stub;
-#else
-  size_t allocated = 0;
-  byte* buffer = AllocatePage(isolate->heap()->GetRandomMmapAddr(), &allocated);
-  if (buffer == nullptr) return stub;
-
-  MacroAssembler masm(isolate, buffer, static_cast<int>(allocated),
-                      CodeObjectRequired::kNo);
-
-  Register dest = r0;
-  Register src = r1;
-  Register chars = r2;
-  if (CpuFeatures::IsSupported(NEON)) {
-    CpuFeatureScope scope(&masm, NEON);
-    Register temp = r3;
-    Label loop;
-
-    __ bic(temp, chars, Operand(0x7));
-    __ sub(chars, chars, Operand(temp));
-    __ add(temp, dest, Operand(temp, LSL, 1));
-
-    __ bind(&loop);
-    __ vld1(Neon8, NeonListOperand(d0), NeonMemOperand(src, PostIndex));
-    __ vmovl(NeonU8, q0, d0);
-    __ vst1(Neon16, NeonListOperand(d0, 2), NeonMemOperand(dest, PostIndex));
-    __ cmp(dest, temp);
-    __ b(&loop, ne);
-
-    // Do a last copy which will overlap with the previous copy (1 to 8 bytes).
-    __ rsb(chars, chars, Operand(8));
-    __ sub(src, src, Operand(chars));
-    __ sub(dest, dest, Operand(chars, LSL, 1));
-    __ vld1(Neon8, NeonListOperand(d0), NeonMemOperand(src));
-    __ vmovl(NeonU8, q0, d0);
-    __ vst1(Neon16, NeonListOperand(d0, 2), NeonMemOperand(dest));
-    __ Ret();
-  } else {
-    UseScratchRegisterScope temps(&masm);
-
-    Register temp1 = r3;
-    Register temp2 = temps.Acquire();
-    Register temp3 = lr;
-    Register temp4 = r4;
-    Label loop;
-    Label not_two;
-
-    __ Push(lr, r4);
-    __ bic(temp2, chars, Operand(0x3));
-    __ add(temp2, dest, Operand(temp2, LSL, 1));
-
-    __ bind(&loop);
-    __ ldr(temp1, MemOperand(src, 4, PostIndex));
-    __ uxtb16(temp3, temp1);
-    __ uxtb16(temp4, temp1, 8);
-    __ pkhbt(temp1, temp3, Operand(temp4, LSL, 16));
-    __ str(temp1, MemOperand(dest));
-    __ pkhtb(temp1, temp4, Operand(temp3, ASR, 16));
-    __ str(temp1, MemOperand(dest, 4));
-    __ add(dest, dest, Operand(8));
-    __ cmp(dest, temp2);
-    __ b(&loop, ne);
-
-    __ mov(chars, Operand(chars, LSL, 31), SetCC);  // bit0 => ne, bit1 => cs
-    __ b(&not_two, cc);
-    __ ldrh(temp1, MemOperand(src, 2, PostIndex));
-    __ uxtb(temp3, temp1, 8);
-    __ mov(temp3, Operand(temp3, LSL, 16));
-    __ uxtab(temp3, temp3, temp1);
-    __ str(temp3, MemOperand(dest, 4, PostIndex));
-    __ bind(&not_two);
-    __ ldrb(temp1, MemOperand(src), ne);
-    __ strh(temp1, MemOperand(dest), ne);
-    __ Pop(pc, r4);
-  }
-
-  CodeDesc desc;
-  masm.GetCode(isolate, &desc);
-
-  Assembler::FlushICache(isolate, buffer, allocated);
-  CHECK(SetPermissions(buffer, allocated, PageAllocator::kReadExecute));
-  return FUNCTION_CAST<MemCopyUint16Uint8Function>(buffer);
-#endif
-}
-#endif
-
-UnaryMathFunctionWithIsolate CreateSqrtFunction(Isolate* isolate) {
-#if defined(USE_SIMULATOR)
-  return nullptr;
-#else
-  size_t allocated = 0;
-  byte* buffer = AllocatePage(isolate->heap()->GetRandomMmapAddr(), &allocated);
-  if (buffer == nullptr) return nullptr;
-
-  MacroAssembler masm(isolate, buffer, static_cast<int>(allocated),
-                      CodeObjectRequired::kNo);
-
-  __ MovFromFloatParameter(d0);
-  __ vsqrt(d0, d0);
-  __ MovToFloatResult(d0);
-  __ Ret();
-
-  CodeDesc desc;
-  masm.GetCode(isolate, &desc);
-  DCHECK(!RelocInfo::RequiresRelocation(isolate, desc));
-
-  Assembler::FlushICache(isolate, buffer, allocated);
-  CHECK(SetPermissions(buffer, allocated, PageAllocator::kReadExecute));
-  return FUNCTION_CAST<UnaryMathFunctionWithIsolate>(buffer);
-#endif
-}
-
-#undef __
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_ARM
diff --git a/src/v8/src/arm/constants-arm.cc b/src/v8/src/arm/constants-arm.cc
deleted file mode 100644
index b50948f..0000000
--- a/src/v8/src/arm/constants-arm.cc
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright 2009 the V8 project 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 V8_TARGET_ARCH_ARM
-
-#include "src/arm/constants-arm.h"
-
-
-namespace v8 {
-namespace internal {
-
-Float64 Instruction::DoubleImmedVmov() const {
-  // Reconstruct a double from the immediate encoded in the vmov instruction.
-  //
-  //   instruction: [xxxxxxxx,xxxxabcd,xxxxxxxx,xxxxefgh]
-  //   double: [aBbbbbbb,bbcdefgh,00000000,00000000,
-  //            00000000,00000000,00000000,00000000]
-  //
-  // where B = ~b. Only the high 16 bits are affected.
-  uint64_t high16;
-  high16  = (Bits(17, 16) << 4) | Bits(3, 0);   // xxxxxxxx,xxcdefgh.
-  high16 |= (0xFF * Bit(18)) << 6;              // xxbbbbbb,bbxxxxxx.
-  high16 |= (Bit(18) ^ 1) << 14;                // xBxxxxxx,xxxxxxxx.
-  high16 |= Bit(19) << 15;                      // axxxxxxx,xxxxxxxx.
-
-  uint64_t imm = high16 << 48;
-  return Float64::FromBits(imm);
-}
-
-
-// These register names are defined in a way to match the native disassembler
-// formatting. See for example the command "objdump -d <binary file>".
-const char* Registers::names_[kNumRegisters] = {
-  "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
-  "r8", "r9", "r10", "fp", "ip", "sp", "lr", "pc",
-};
-
-
-// List of alias names which can be used when referring to ARM registers.
-const Registers::RegisterAlias Registers::aliases_[] = {
-    {10, "sl"},  {11, "r11"}, {12, "r12"},           {13, "r13"},
-    {14, "r14"}, {15, "r15"}, {kNoRegister, nullptr}};
-
-// Support for VFP registers s0 to s31 (d0 to d15) and d16-d31.
-// Note that "sN:sM" is the same as "dN/2" up to d15.
-// These register names are defined in a way to match the native disassembler
-// formatting. See for example the command "objdump -d <binary file>".
-const char* VFPRegisters::names_[kNumVFPRegisters] = {
-    "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
-    "s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15",
-    "s16", "s17", "s18", "s19", "s20", "s21", "s22", "s23",
-    "s24", "s25", "s26", "s27", "s28", "s29", "s30", "s31",
-    "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7",
-    "d8", "d9", "d10", "d11", "d12", "d13", "d14", "d15",
-    "d16", "d17", "d18", "d19", "d20", "d21", "d22", "d23",
-    "d24", "d25", "d26", "d27", "d28", "d29", "d30", "d31"
-};
-
-
-const char* VFPRegisters::Name(int reg, bool is_double) {
-  DCHECK((0 <= reg) && (reg < kNumVFPRegisters));
-  return names_[reg + (is_double ? kNumVFPSingleRegisters : 0)];
-}
-
-
-int VFPRegisters::Number(const char* name, bool* is_double) {
-  for (int i = 0; i < kNumVFPRegisters; i++) {
-    if (strcmp(names_[i], name) == 0) {
-      if (i < kNumVFPSingleRegisters) {
-        *is_double = false;
-        return i;
-      } else {
-        *is_double = true;
-        return i - kNumVFPSingleRegisters;
-      }
-    }
-  }
-
-  // No register with the requested name found.
-  return kNoRegister;
-}
-
-
-int Registers::Number(const char* name) {
-  // Look through the canonical names.
-  for (int i = 0; i < kNumRegisters; i++) {
-    if (strcmp(names_[i], name) == 0) {
-      return i;
-    }
-  }
-
-  // Look through the alias names.
-  int i = 0;
-  while (aliases_[i].reg != kNoRegister) {
-    if (strcmp(aliases_[i].name, name) == 0) {
-      return aliases_[i].reg;
-    }
-    i++;
-  }
-
-  // No register with the requested name found.
-  return kNoRegister;
-}
-
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_ARM
diff --git a/src/v8/src/arm/constants-arm.h b/src/v8/src/arm/constants-arm.h
deleted file mode 100644
index 1c865af..0000000
--- a/src/v8/src/arm/constants-arm.h
+++ /dev/null
@@ -1,736 +0,0 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_ARM_CONSTANTS_ARM_H_
-#define V8_ARM_CONSTANTS_ARM_H_
-
-#include <stdint.h>
-
-#include "src/base/logging.h"
-#include "src/base/macros.h"
-#include "src/boxed-float.h"
-#include "src/globals.h"
-
-// ARM EABI is required.
-#if defined(__arm__) && !defined(__ARM_EABI__)
-#error ARM EABI support is required.
-#endif
-
-namespace v8 {
-namespace internal {
-
-// Constant pool marker.
-// Use UDF, the permanently undefined instruction.
-const int kConstantPoolMarkerMask = 0xfff000f0;
-const int kConstantPoolMarker = 0xe7f000f0;
-const int kConstantPoolLengthMaxMask = 0xffff;
-inline int EncodeConstantPoolLength(int length) {
-  DCHECK((length & kConstantPoolLengthMaxMask) == length);
-  return ((length & 0xfff0) << 4) | (length & 0xf);
-}
-inline int DecodeConstantPoolLength(int instr) {
-  DCHECK_EQ(instr & kConstantPoolMarkerMask, kConstantPoolMarker);
-  return ((instr >> 4) & 0xfff0) | (instr & 0xf);
-}
-
-// Number of registers in normal ARM mode.
-const int kNumRegisters = 16;
-
-// VFP support.
-const int kNumVFPSingleRegisters = 32;
-const int kNumVFPDoubleRegisters = 32;
-const int kNumVFPRegisters = kNumVFPSingleRegisters + kNumVFPDoubleRegisters;
-
-// PC is register 15.
-const int kPCRegister = 15;
-const int kNoRegister = -1;
-
-// Used in embedded constant pool builder - max reach in bits for
-// various load instructions (unsigned)
-const int kLdrMaxReachBits = 12;
-const int kVldrMaxReachBits = 10;
-
-// -----------------------------------------------------------------------------
-// Conditions.
-
-// Defines constants and accessor classes to assemble, disassemble and
-// simulate ARM instructions.
-//
-// Section references in the code refer to the "ARM Architecture Reference
-// Manual" from July 2005 (available at http://www.arm.com/miscPDFs/14128.pdf)
-//
-// Constants for specific fields are defined in their respective named enums.
-// General constants are in an anonymous enum in class Instr.
-
-// Values for the condition field as defined in section A3.2
-enum Condition {
-  kNoCondition = -1,
-
-  eq =  0 << 28,                 // Z set            Equal.
-  ne =  1 << 28,                 // Z clear          Not equal.
-  cs =  2 << 28,                 // C set            Unsigned higher or same.
-  cc =  3 << 28,                 // C clear          Unsigned lower.
-  mi =  4 << 28,                 // N set            Negative.
-  pl =  5 << 28,                 // N clear          Positive or zero.
-  vs =  6 << 28,                 // V set            Overflow.
-  vc =  7 << 28,                 // V clear          No overflow.
-  hi =  8 << 28,                 // C set, Z clear   Unsigned higher.
-  ls =  9 << 28,                 // C clear or Z set Unsigned lower or same.
-  ge = 10 << 28,                 // N == V           Greater or equal.
-  lt = 11 << 28,                 // N != V           Less than.
-  gt = 12 << 28,                 // Z clear, N == V  Greater than.
-  le = 13 << 28,                 // Z set or N != V  Less then or equal
-  al = 14 << 28,                 //                  Always.
-
-  kSpecialCondition = 15 << 28,  // Special condition (refer to section A3.2.1).
-  kNumberOfConditions = 16,
-
-  // Aliases.
-  hs = cs,                       // C set            Unsigned higher or same.
-  lo = cc                        // C clear          Unsigned lower.
-};
-
-
-inline Condition NegateCondition(Condition cond) {
-  DCHECK(cond != al);
-  return static_cast<Condition>(cond ^ ne);
-}
-
-
-// Commute a condition such that {a cond b == b cond' a}.
-inline Condition CommuteCondition(Condition cond) {
-  switch (cond) {
-    case lo:
-      return hi;
-    case hi:
-      return lo;
-    case hs:
-      return ls;
-    case ls:
-      return hs;
-    case lt:
-      return gt;
-    case gt:
-      return lt;
-    case ge:
-      return le;
-    case le:
-      return ge;
-    default:
-      return cond;
-  }
-}
-
-
-// -----------------------------------------------------------------------------
-// Instructions encoding.
-
-// Instr is merely used by the Assembler to distinguish 32bit integers
-// representing instructions from usual 32 bit values.
-// Instruction objects are pointers to 32bit values, and provide methods to
-// access the various ISA fields.
-typedef int32_t Instr;
-
-
-// Opcodes for Data-processing instructions (instructions with a type 0 and 1)
-// as defined in section A3.4
-enum Opcode {
-  AND =  0 << 21,  // Logical AND.
-  EOR =  1 << 21,  // Logical Exclusive OR.
-  SUB =  2 << 21,  // Subtract.
-  RSB =  3 << 21,  // Reverse Subtract.
-  ADD =  4 << 21,  // Add.
-  ADC =  5 << 21,  // Add with Carry.
-  SBC =  6 << 21,  // Subtract with Carry.
-  RSC =  7 << 21,  // Reverse Subtract with Carry.
-  TST =  8 << 21,  // Test.
-  TEQ =  9 << 21,  // Test Equivalence.
-  CMP = 10 << 21,  // Compare.
-  CMN = 11 << 21,  // Compare Negated.
-  ORR = 12 << 21,  // Logical (inclusive) OR.
-  MOV = 13 << 21,  // Move.
-  BIC = 14 << 21,  // Bit Clear.
-  MVN = 15 << 21   // Move Not.
-};
-
-
-// The bits for bit 7-4 for some type 0 miscellaneous instructions.
-enum MiscInstructionsBits74 {
-  // With bits 22-21 01.
-  BX   =  1 << 4,
-  BXJ  =  2 << 4,
-  BLX  =  3 << 4,
-  BKPT =  7 << 4,
-
-  // With bits 22-21 11.
-  CLZ  =  1 << 4
-};
-
-
-// Instruction encoding bits and masks.
-enum {
-  H = 1 << 5,   // Halfword (or byte).
-  S6 = 1 << 6,  // Signed (or unsigned).
-  L = 1 << 20,  // Load (or store).
-  S = 1 << 20,  // Set condition code (or leave unchanged).
-  W = 1 << 21,  // Writeback base register (or leave unchanged).
-  A = 1 << 21,  // Accumulate in multiply instruction (or not).
-  B = 1 << 22,  // Unsigned byte (or word).
-  N = 1 << 22,  // Long (or short).
-  U = 1 << 23,  // Positive (or negative) offset/index.
-  P = 1 << 24,  // Offset/pre-indexed addressing (or post-indexed addressing).
-  I = 1 << 25,  // Immediate shifter operand (or not).
-  B0 = 1 << 0,
-  B4 = 1 << 4,
-  B5 = 1 << 5,
-  B6 = 1 << 6,
-  B7 = 1 << 7,
-  B8 = 1 << 8,
-  B9 = 1 << 9,
-  B10 = 1 << 10,
-  B12 = 1 << 12,
-  B16 = 1 << 16,
-  B17 = 1 << 17,
-  B18 = 1 << 18,
-  B19 = 1 << 19,
-  B20 = 1 << 20,
-  B21 = 1 << 21,
-  B22 = 1 << 22,
-  B23 = 1 << 23,
-  B24 = 1 << 24,
-  B25 = 1 << 25,
-  B26 = 1 << 26,
-  B27 = 1 << 27,
-  B28 = 1 << 28,
-
-  // Instruction bit masks.
-  kCondMask = 15 << 28,
-  kALUMask = 0x6f << 21,
-  kRdMask = 15 << 12,  // In str instruction.
-  kCoprocessorMask = 15 << 8,
-  kOpCodeMask = 15 << 21,  // In data-processing instructions.
-  kImm24Mask = (1 << 24) - 1,
-  kImm16Mask = (1 << 16) - 1,
-  kImm8Mask = (1 << 8) - 1,
-  kOff12Mask = (1 << 12) - 1,
-  kOff8Mask = (1 << 8) - 1
-};
-
-enum BarrierOption {
-  OSHLD = 0x1,
-  OSHST = 0x2,
-  OSH = 0x3,
-  NSHLD = 0x5,
-  NSHST = 0x6,
-  NSH = 0x7,
-  ISHLD = 0x9,
-  ISHST = 0xa,
-  ISH = 0xb,
-  LD = 0xd,
-  ST = 0xe,
-  SY = 0xf,
-};
-
-
-// -----------------------------------------------------------------------------
-// Addressing modes and instruction variants.
-
-// Condition code updating mode.
-enum SBit {
-  SetCC   = 1 << 20,  // Set condition code.
-  LeaveCC = 0 << 20   // Leave condition code unchanged.
-};
-
-
-// Status register selection.
-enum SRegister {
-  CPSR = 0 << 22,
-  SPSR = 1 << 22
-};
-
-
-// Shifter types for Data-processing operands as defined in section A5.1.2.
-enum ShiftOp {
-  LSL = 0 << 5,   // Logical shift left.
-  LSR = 1 << 5,   // Logical shift right.
-  ASR = 2 << 5,   // Arithmetic shift right.
-  ROR = 3 << 5,   // Rotate right.
-
-  // RRX is encoded as ROR with shift_imm == 0.
-  // Use a special code to make the distinction. The RRX ShiftOp is only used
-  // as an argument, and will never actually be encoded. The Assembler will
-  // detect it and emit the correct ROR shift operand with shift_imm == 0.
-  RRX = -1,
-  kNumberOfShifts = 4
-};
-
-
-// Status register fields.
-enum SRegisterField {
-  CPSR_c = CPSR | 1 << 16,
-  CPSR_x = CPSR | 1 << 17,
-  CPSR_s = CPSR | 1 << 18,
-  CPSR_f = CPSR | 1 << 19,
-  SPSR_c = SPSR | 1 << 16,
-  SPSR_x = SPSR | 1 << 17,
-  SPSR_s = SPSR | 1 << 18,
-  SPSR_f = SPSR | 1 << 19
-};
-
-// Status register field mask (or'ed SRegisterField enum values).
-typedef uint32_t SRegisterFieldMask;
-
-
-// Memory operand addressing mode.
-enum AddrMode {
-  // Bit encoding P U W.
-  Offset       = (8|4|0) << 21,  // Offset (without writeback to base).
-  PreIndex     = (8|4|1) << 21,  // Pre-indexed addressing with writeback.
-  PostIndex    = (0|4|0) << 21,  // Post-indexed addressing with writeback.
-  NegOffset    = (8|0|0) << 21,  // Negative offset (without writeback to base).
-  NegPreIndex  = (8|0|1) << 21,  // Negative pre-indexed with writeback.
-  NegPostIndex = (0|0|0) << 21   // Negative post-indexed with writeback.
-};
-
-
-// Load/store multiple addressing mode.
-enum BlockAddrMode {
-  // Bit encoding P U W .
-  da           = (0|0|0) << 21,  // Decrement after.
-  ia           = (0|4|0) << 21,  // Increment after.
-  db           = (8|0|0) << 21,  // Decrement before.
-  ib           = (8|4|0) << 21,  // Increment before.
-  da_w         = (0|0|1) << 21,  // Decrement after with writeback to base.
-  ia_w         = (0|4|1) << 21,  // Increment after with writeback to base.
-  db_w         = (8|0|1) << 21,  // Decrement before with writeback to base.
-  ib_w         = (8|4|1) << 21,  // Increment before with writeback to base.
-
-  // Alias modes for comparison when writeback does not matter.
-  da_x         = (0|0|0) << 21,  // Decrement after.
-  ia_x         = (0|4|0) << 21,  // Increment after.
-  db_x         = (8|0|0) << 21,  // Decrement before.
-  ib_x         = (8|4|0) << 21,  // Increment before.
-
-  kBlockAddrModeMask = (8|4|1) << 21
-};
-
-
-// Coprocessor load/store operand size.
-enum LFlag {
-  Long  = 1 << 22,  // Long load/store coprocessor.
-  Short = 0 << 22   // Short load/store coprocessor.
-};
-
-// Neon sizes.
-enum NeonSize { Neon8 = 0x0, Neon16 = 0x1, Neon32 = 0x2, Neon64 = 0x3 };
-
-// NEON data type
-enum NeonDataType {
-  NeonS8 = 0,
-  NeonS16 = 1,
-  NeonS32 = 2,
-  // Gap to make it easier to extract U and size.
-  NeonU8 = 4,
-  NeonU16 = 5,
-  NeonU32 = 6
-};
-
-inline int NeonU(NeonDataType dt) { return static_cast<int>(dt) >> 2; }
-inline int NeonSz(NeonDataType dt) { return static_cast<int>(dt) & 0x3; }
-
-// Convert sizes to data types (U bit is clear).
-inline NeonDataType NeonSizeToDataType(NeonSize size) {
-  DCHECK_NE(Neon64, size);
-  return static_cast<NeonDataType>(size);
-}
-
-inline NeonSize NeonDataTypeToSize(NeonDataType dt) {
-  return static_cast<NeonSize>(NeonSz(dt));
-}
-
-enum NeonListType {
-  nlt_1 = 0x7,
-  nlt_2 = 0xA,
-  nlt_3 = 0x6,
-  nlt_4 = 0x2
-};
-
-// -----------------------------------------------------------------------------
-// Supervisor Call (svc) specific support.
-
-// Special Software Interrupt codes when used in the presence of the ARM
-// simulator.
-// svc (formerly swi) provides a 24bit immediate value. Use bits 22:0 for
-// standard SoftwareInterrupCode. Bit 23 is reserved for the stop feature.
-enum SoftwareInterruptCodes {
-  // transition to C code
-  kCallRtRedirected = 0x10,
-  // break point
-  kBreakpoint = 0x20,
-  // stop
-  kStopCode = 1 << 23
-};
-const uint32_t kStopCodeMask = kStopCode - 1;
-const uint32_t kMaxStopCode = kStopCode - 1;
-const int32_t  kDefaultStopCode = -1;
-
-
-// Type of VFP register. Determines register encoding.
-enum VFPRegPrecision {
-  kSinglePrecision = 0,
-  kDoublePrecision = 1,
-  kSimd128Precision = 2
-};
-
-// VFP FPSCR constants.
-enum VFPConversionMode {
-  kFPSCRRounding = 0,
-  kDefaultRoundToZero = 1
-};
-
-// This mask does not include the "inexact" or "input denormal" cumulative
-// exceptions flags, because we usually don't want to check for it.
-const uint32_t kVFPExceptionMask = 0xf;
-const uint32_t kVFPInvalidOpExceptionBit = 1 << 0;
-const uint32_t kVFPOverflowExceptionBit = 1 << 2;
-const uint32_t kVFPUnderflowExceptionBit = 1 << 3;
-const uint32_t kVFPInexactExceptionBit = 1 << 4;
-const uint32_t kVFPFlushToZeroMask = 1 << 24;
-const uint32_t kVFPDefaultNaNModeControlBit = 1 << 25;
-
-const uint32_t kVFPNConditionFlagBit = 1 << 31;
-const uint32_t kVFPZConditionFlagBit = 1 << 30;
-const uint32_t kVFPCConditionFlagBit = 1 << 29;
-const uint32_t kVFPVConditionFlagBit = 1 << 28;
-
-
-// VFP rounding modes. See ARM DDI 0406B Page A2-29.
-enum VFPRoundingMode {
-  RN = 0 << 22,   // Round to Nearest.
-  RP = 1 << 22,   // Round towards Plus Infinity.
-  RM = 2 << 22,   // Round towards Minus Infinity.
-  RZ = 3 << 22,   // Round towards zero.
-
-  // Aliases.
-  kRoundToNearest = RN,
-  kRoundToPlusInf = RP,
-  kRoundToMinusInf = RM,
-  kRoundToZero = RZ
-};
-
-const uint32_t kVFPRoundingModeMask = 3 << 22;
-
-enum CheckForInexactConversion {
-  kCheckForInexactConversion,
-  kDontCheckForInexactConversion
-};
-
-// -----------------------------------------------------------------------------
-// Hints.
-
-// Branch hints are not used on the ARM.  They are defined so that they can
-// appear in shared function signatures, but will be ignored in ARM
-// implementations.
-enum Hint { no_hint };
-
-// Hints are not used on the arm.  Negating is trivial.
-inline Hint NegateHint(Hint ignored) { return no_hint; }
-
-
-// -----------------------------------------------------------------------------
-// Instruction abstraction.
-
-// The class Instruction enables access to individual fields defined in the ARM
-// architecture instruction set encoding as described in figure A3-1.
-// Note that the Assembler uses typedef int32_t Instr.
-//
-// Example: Test whether the instruction at ptr does set the condition code
-// bits.
-//
-// bool InstructionSetsConditionCodes(byte* ptr) {
-//   Instruction* instr = Instruction::At(ptr);
-//   int type = instr->TypeValue();
-//   return ((type == 0) || (type == 1)) && instr->HasS();
-// }
-//
-class Instruction {
- public:
-  enum {
-    kInstrSize = 4,
-    kInstrSizeLog2 = 2,
-    kPCReadOffset = 8
-  };
-
-  // Helper macro to define static accessors.
-  // We use the cast to char* trick to bypass the strict anti-aliasing rules.
-  #define DECLARE_STATIC_TYPED_ACCESSOR(return_type, Name)                     \
-    static inline return_type Name(Instr instr) {                              \
-      char* temp = reinterpret_cast<char*>(&instr);                            \
-      return reinterpret_cast<Instruction*>(temp)->Name();                     \
-    }
-
-  #define DECLARE_STATIC_ACCESSOR(Name) DECLARE_STATIC_TYPED_ACCESSOR(int, Name)
-
-  // Get the raw instruction bits.
-  inline Instr InstructionBits() const {
-    return *reinterpret_cast<const Instr*>(this);
-  }
-
-  // Set the raw instruction bits to value.
-  inline void SetInstructionBits(Instr value) {
-    *reinterpret_cast<Instr*>(this) = value;
-  }
-
-  // Extract a single bit from the instruction bits and return it as bit 0 in
-  // the result.
-  inline int Bit(int nr) const {
-    return (InstructionBits() >> nr) & 1;
-  }
-
-  // Extract a bit field <hi:lo> from the instruction bits and return it in the
-  // least-significant bits of the result.
-  inline int Bits(int hi, int lo) const {
-    return (InstructionBits() >> lo) & ((2 << (hi - lo)) - 1);
-  }
-
-  // Read a bit field <hi:lo>, leaving its position unchanged in the result.
-  inline int BitField(int hi, int lo) const {
-    return InstructionBits() & (((2 << (hi - lo)) - 1) << lo);
-  }
-
-  // Static support.
-
-  // Extract a single bit from the instruction bits and return it as bit 0 in
-  // the result.
-  static inline int Bit(Instr instr, int nr) {
-    return (instr >> nr) & 1;
-  }
-
-  // Extract a bit field <hi:lo> from the instruction bits and return it in the
-  // least-significant bits of the result.
-  static inline int Bits(Instr instr, int hi, int lo) {
-    return (instr >> lo) & ((2 << (hi - lo)) - 1);
-  }
-
-  // Read a bit field <hi:lo>, leaving its position unchanged in the result.
-  static inline int BitField(Instr instr, int hi, int lo) {
-    return instr & (((2 << (hi - lo)) - 1) << lo);
-  }
-
-  // Accessors for the different named fields used in the ARM encoding.
-  // The naming of these accessor corresponds to figure A3-1.
-  //
-  // Two kind of accessors are declared:
-  // - <Name>Field() will return the raw field, i.e. the field's bits at their
-  //   original place in the instruction encoding.
-  //   e.g. if instr is the 'addgt r0, r1, r2' instruction, encoded as
-  //   0xC0810002 ConditionField(instr) will return 0xC0000000.
-  // - <Name>Value() will return the field value, shifted back to bit 0.
-  //   e.g. if instr is the 'addgt r0, r1, r2' instruction, encoded as
-  //   0xC0810002 ConditionField(instr) will return 0xC.
-
-
-  // Generally applicable fields
-  inline int ConditionValue() const { return Bits(31, 28); }
-  inline Condition ConditionField() const {
-    return static_cast<Condition>(BitField(31, 28));
-  }
-  DECLARE_STATIC_TYPED_ACCESSOR(int, ConditionValue);
-  DECLARE_STATIC_TYPED_ACCESSOR(Condition, ConditionField);
-
-  inline int TypeValue() const { return Bits(27, 25); }
-  inline int SpecialValue() const { return Bits(27, 23); }
-
-  inline int RnValue() const { return Bits(19, 16); }
-  DECLARE_STATIC_ACCESSOR(RnValue);
-  inline int RdValue() const { return Bits(15, 12); }
-  DECLARE_STATIC_ACCESSOR(RdValue);
-
-  inline int CoprocessorValue() const { return Bits(11, 8); }
-  // Support for VFP.
-  // Vn(19-16) | Vd(15-12) |  Vm(3-0)
-  inline int VnValue() const { return Bits(19, 16); }
-  inline int VmValue() const { return Bits(3, 0); }
-  inline int VdValue() const { return Bits(15, 12); }
-  inline int NValue() const { return Bit(7); }
-  inline int MValue() const { return Bit(5); }
-  inline int DValue() const { return Bit(22); }
-  inline int RtValue() const { return Bits(15, 12); }
-  inline int PValue() const { return Bit(24); }
-  inline int UValue() const { return Bit(23); }
-  inline int Opc1Value() const { return (Bit(23) << 2) | Bits(21, 20); }
-  inline int Opc2Value() const { return Bits(19, 16); }
-  inline int Opc3Value() const { return Bits(7, 6); }
-  inline int SzValue() const { return Bit(8); }
-  inline int VLValue() const { return Bit(20); }
-  inline int VCValue() const { return Bit(8); }
-  inline int VAValue() const { return Bits(23, 21); }
-  inline int VBValue() const { return Bits(6, 5); }
-  inline int VFPNRegValue(VFPRegPrecision pre) {
-    return VFPGlueRegValue(pre, 16, 7);
-  }
-  inline int VFPMRegValue(VFPRegPrecision pre) {
-    return VFPGlueRegValue(pre, 0, 5);
-  }
-  inline int VFPDRegValue(VFPRegPrecision pre) {
-    return VFPGlueRegValue(pre, 12, 22);
-  }
-
-  // Fields used in Data processing instructions
-  inline int OpcodeValue() const {
-    return static_cast<Opcode>(Bits(24, 21));
-  }
-  inline Opcode OpcodeField() const {
-    return static_cast<Opcode>(BitField(24, 21));
-  }
-  inline int SValue() const { return Bit(20); }
-    // with register
-  inline int RmValue() const { return Bits(3, 0); }
-  DECLARE_STATIC_ACCESSOR(RmValue);
-  inline int ShiftValue() const { return static_cast<ShiftOp>(Bits(6, 5)); }
-  inline ShiftOp ShiftField() const {
-    return static_cast<ShiftOp>(BitField(6, 5));
-  }
-  inline int RegShiftValue() const { return Bit(4); }
-  inline int RsValue() const { return Bits(11, 8); }
-  inline int ShiftAmountValue() const { return Bits(11, 7); }
-    // with immediate
-  inline int RotateValue() const { return Bits(11, 8); }
-  DECLARE_STATIC_ACCESSOR(RotateValue);
-  inline int Immed8Value() const { return Bits(7, 0); }
-  DECLARE_STATIC_ACCESSOR(Immed8Value);
-  inline int Immed4Value() const { return Bits(19, 16); }
-  inline int ImmedMovwMovtValue() const {
-      return Immed4Value() << 12 | Offset12Value(); }
-  DECLARE_STATIC_ACCESSOR(ImmedMovwMovtValue);
-
-  // Fields used in Load/Store instructions
-  inline int PUValue() const { return Bits(24, 23); }
-  inline int PUField() const { return BitField(24, 23); }
-  inline int  BValue() const { return Bit(22); }
-  inline int  WValue() const { return Bit(21); }
-  inline int  LValue() const { return Bit(20); }
-    // with register uses same fields as Data processing instructions above
-    // with immediate
-  inline int Offset12Value() const { return Bits(11, 0); }
-    // multiple
-  inline int RlistValue() const { return Bits(15, 0); }
-    // extra loads and stores
-  inline int SignValue() const { return Bit(6); }
-  inline int HValue() const { return Bit(5); }
-  inline int ImmedHValue() const { return Bits(11, 8); }
-  inline int ImmedLValue() const { return Bits(3, 0); }
-
-  // Fields used in Branch instructions
-  inline int LinkValue() const { return Bit(24); }
-  inline int SImmed24Value() const { return ((InstructionBits() << 8) >> 8); }
-
-  // Fields used in Software interrupt instructions
-  inline SoftwareInterruptCodes SvcValue() const {
-    return static_cast<SoftwareInterruptCodes>(Bits(23, 0));
-  }
-
-  // Test for special encodings of type 0 instructions (extra loads and stores,
-  // as well as multiplications).
-  inline bool IsSpecialType0() const { return (Bit(7) == 1) && (Bit(4) == 1); }
-
-  // Test for miscellaneous instructions encodings of type 0 instructions.
-  inline bool IsMiscType0() const { return (Bit(24) == 1)
-                                           && (Bit(23) == 0)
-                                           && (Bit(20) == 0)
-                                           && ((Bit(7) == 0)); }
-
-  // Test for a nop instruction, which falls under type 1.
-  inline bool IsNopType1() const { return Bits(24, 0) == 0x0120F000; }
-
-  // Test for a stop instruction.
-  inline bool IsStop() const {
-    return (TypeValue() == 7) && (Bit(24) == 1) && (SvcValue() >= kStopCode);
-  }
-
-  // Special accessors that test for existence of a value.
-  inline bool HasS()    const { return SValue() == 1; }
-  inline bool HasB()    const { return BValue() == 1; }
-  inline bool HasW()    const { return WValue() == 1; }
-  inline bool HasL()    const { return LValue() == 1; }
-  inline bool HasU()    const { return UValue() == 1; }
-  inline bool HasSign() const { return SignValue() == 1; }
-  inline bool HasH()    const { return HValue() == 1; }
-  inline bool HasLink() const { return LinkValue() == 1; }
-
-  // Decode the double immediate from a vmov instruction.
-  Float64 DoubleImmedVmov() const;
-
-  // Instructions are read of out a code stream. The only way to get a
-  // reference to an instruction is to convert a pointer. There is no way
-  // to allocate or create instances of class Instruction.
-  // Use the At(pc) function to create references to Instruction.
-  static Instruction* At(byte* pc) {
-    return reinterpret_cast<Instruction*>(pc);
-  }
-
-
- private:
-  // Join split register codes, depending on register precision.
-  // four_bit is the position of the least-significant bit of the four
-  // bit specifier. one_bit is the position of the additional single bit
-  // specifier.
-  inline int VFPGlueRegValue(VFPRegPrecision pre, int four_bit, int one_bit) {
-    if (pre == kSinglePrecision) {
-      return (Bits(four_bit + 3, four_bit) << 1) | Bit(one_bit);
-    } else {
-      int reg_num = (Bit(one_bit) << 4) | Bits(four_bit + 3, four_bit);
-      if (pre == kDoublePrecision) {
-        return reg_num;
-      }
-      DCHECK_EQ(kSimd128Precision, pre);
-      DCHECK_EQ(reg_num & 1, 0);
-      return reg_num / 2;
-    }
-  }
-
-  // We need to prevent the creation of instances of class Instruction.
-  DISALLOW_IMPLICIT_CONSTRUCTORS(Instruction);
-};
-
-
-// Helper functions for converting between register numbers and names.
-class Registers {
- public:
-  // Return the name of the register.
-  static const char* Name(int reg);
-
-  // Lookup the register number for the name provided.
-  static int Number(const char* name);
-
-  struct RegisterAlias {
-    int reg;
-    const char* name;
-  };
-
- private:
-  static const char* names_[kNumRegisters];
-  static const RegisterAlias aliases_[];
-};
-
-// Helper functions for converting between VFP register numbers and names.
-class VFPRegisters {
- public:
-  // Return the name of the register.
-  static const char* Name(int reg, bool is_double);
-
-  // Lookup the register number for the name provided.
-  // Set flag pointed by is_double to true if register
-  // is double-precision.
-  static int Number(const char* name, bool* is_double);
-
- private:
-  static const char* names_[kNumVFPRegisters];
-};
-
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_ARM_CONSTANTS_ARM_H_
diff --git a/src/v8/src/arm/cpu-arm.cc b/src/v8/src/arm/cpu-arm.cc
deleted file mode 100644
index ecece7d..0000000
--- a/src/v8/src/arm/cpu-arm.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2006-2009 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// CPU specific code for arm independent of OS goes here.
-#ifdef __arm__
-#ifdef __QNXNTO__
-#include <sys/mman.h>  // for cache flushing.
-#undef MAP_TYPE
-#else
-#define __ARM_NR_cacheflush 0x0f0002  // for cache flushing.
-#endif
-#endif
-
-#if V8_TARGET_ARCH_ARM
-
-#include "src/assembler.h"
-#include "src/macro-assembler.h"
-
-namespace v8 {
-namespace internal {
-
-void CpuFeatures::FlushICache(void* start, size_t size) {
-#if !defined(USE_SIMULATOR)
-#if V8_OS_QNX
-  msync(start, size, MS_SYNC | MS_INVALIDATE_ICACHE);
-#else
-  register uint32_t beg asm("r0") = reinterpret_cast<uint32_t>(start);
-  register uint32_t end asm("r1") = beg + size;
-  register uint32_t flg asm("r2") = 0;
-
-#ifdef __clang__
-  // This variant of the asm avoids a constant pool entry, which can be
-  // problematic when LTO'ing. It is also slightly shorter.
-  register uint32_t scno asm("r7") = __ARM_NR_cacheflush;
-
-  asm volatile("svc 0\n"
-               :
-               : "r"(beg), "r"(end), "r"(flg), "r"(scno)
-               : "memory");
-#else
-  // Use a different variant of the asm with GCC because some versions doesn't
-  // support r7 as an asm input.
-  asm volatile(
-    // This assembly works for both ARM and Thumb targets.
-
-    // Preserve r7; it is callee-saved, and GCC uses it as a frame pointer for
-    // Thumb targets.
-    "  push {r7}\n"
-                                  // r0 = beg
-                                  // r1 = end
-                                  // r2 = flags (0)
-    "  ldr r7, =%c[scno]\n"       // r7 = syscall number
-    "  svc 0\n"
-
-    "  pop {r7}\n"
-    :
-    : "r" (beg), "r" (end), "r" (flg), [scno] "i" (__ARM_NR_cacheflush)
-    : "memory");
-#endif
-#endif
-#endif  // !USE_SIMULATOR
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_ARM
diff --git a/src/v8/src/arm/deoptimizer-arm.cc b/src/v8/src/arm/deoptimizer-arm.cc
deleted file mode 100644
index 9a21ef8..0000000
--- a/src/v8/src/arm/deoptimizer-arm.cc
+++ /dev/null
@@ -1,316 +0,0 @@
-// Copyright 2012 the V8 project 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 "src/assembler-inl.h"
-#include "src/deoptimizer.h"
-#include "src/objects-inl.h"
-#include "src/register-configuration.h"
-#include "src/safepoint-table.h"
-
-namespace v8 {
-namespace internal {
-
-const int Deoptimizer::table_entry_size_ = 8;
-
-#define __ masm()->
-
-// This code tries to be close to ia32 code so that any changes can be
-// easily ported.
-void Deoptimizer::TableEntryGenerator::Generate() {
-  GeneratePrologue();
-
-  // Save all general purpose registers before messing with them.
-  const int kNumberOfRegisters = Register::kNumRegisters;
-
-  // Everything but pc, lr and ip which will be saved but not restored.
-  RegList restored_regs = kJSCallerSaved | kCalleeSaved | ip.bit();
-
-  const int kDoubleRegsSize = kDoubleSize * DwVfpRegister::kNumRegisters;
-  const int kFloatRegsSize = kFloatSize * SwVfpRegister::kNumRegisters;
-
-  // Save all allocatable VFP registers before messing with them.
-  DCHECK_EQ(kDoubleRegZero.code(), 13);
-  DCHECK_EQ(kScratchDoubleReg.code(), 14);
-
-  {
-    // We use a run-time check for VFP32DREGS.
-    CpuFeatureScope scope(masm(), VFP32DREGS,
-                          CpuFeatureScope::kDontCheckSupported);
-    UseScratchRegisterScope temps(masm());
-    Register scratch = temps.Acquire();
-
-    // Check CPU flags for number of registers, setting the Z condition flag.
-    __ CheckFor32DRegs(scratch);
-
-    // Push registers d0-d15, and possibly d16-d31, on the stack.
-    // If d16-d31 are not pushed, decrease the stack pointer instead.
-    __ vstm(db_w, sp, d16, d31, ne);
-    __ sub(sp, sp, Operand(16 * kDoubleSize), LeaveCC, eq);
-    __ vstm(db_w, sp, d0, d15);
-
-    // Push registers s0-s31 on the stack.
-    __ vstm(db_w, sp, s0, s31);
-  }
-
-  // Push all 16 registers (needed to populate FrameDescription::registers_).
-  // TODO(1588) Note that using pc with stm is deprecated, so we should perhaps
-  // handle this a bit differently.
-  __ stm(db_w, sp, restored_regs  | sp.bit() | lr.bit() | pc.bit());
-
-  {
-    UseScratchRegisterScope temps(masm());
-    Register scratch = temps.Acquire();
-    __ mov(scratch, Operand(ExternalReference(
-                        IsolateAddressId::kCEntryFPAddress, isolate())));
-    __ str(fp, MemOperand(scratch));
-  }
-
-  const int kSavedRegistersAreaSize =
-      (kNumberOfRegisters * kPointerSize) + kDoubleRegsSize + kFloatRegsSize;
-
-  // Get the bailout id from the stack.
-  __ ldr(r2, MemOperand(sp, kSavedRegistersAreaSize));
-
-  // Get the address of the location in the code object (r3) (return
-  // address for lazy deoptimization) and compute the fp-to-sp delta in
-  // register r4.
-  __ mov(r3, lr);
-  // Correct one word for bailout id.
-  __ add(r4, sp, Operand(kSavedRegistersAreaSize + (1 * kPointerSize)));
-  __ sub(r4, fp, r4);
-
-  // Allocate a new deoptimizer object.
-  // Pass four arguments in r0 to r3 and fifth argument on stack.
-  __ PrepareCallCFunction(6);
-  __ mov(r0, Operand(0));
-  Label context_check;
-  __ ldr(r1, MemOperand(fp, CommonFrameConstants::kContextOrFrameTypeOffset));
-  __ JumpIfSmi(r1, &context_check);
-  __ ldr(r0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
-  __ bind(&context_check);
-  __ mov(r1, Operand(type()));  // bailout type,
-  // r2: bailout id already loaded.
-  // r3: code address or 0 already loaded.
-  __ str(r4, MemOperand(sp, 0 * kPointerSize));  // Fp-to-sp delta.
-  __ mov(r5, Operand(ExternalReference::isolate_address(isolate())));
-  __ str(r5, MemOperand(sp, 1 * kPointerSize));  // Isolate.
-  // Call Deoptimizer::New().
-  {
-    AllowExternalCallThatCantCauseGC scope(masm());
-    __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate()), 6);
-  }
-
-  // Preserve "deoptimizer" object in register r0 and get the input
-  // frame descriptor pointer to r1 (deoptimizer->input_);
-  __ ldr(r1, MemOperand(r0, Deoptimizer::input_offset()));
-
-  // Copy core registers into FrameDescription::registers_[kNumRegisters].
-  DCHECK_EQ(Register::kNumRegisters, kNumberOfRegisters);
-  for (int i = 0; i < kNumberOfRegisters; i++) {
-    int offset = (i * kPointerSize) + FrameDescription::registers_offset();
-    __ ldr(r2, MemOperand(sp, i * kPointerSize));
-    __ str(r2, MemOperand(r1, offset));
-  }
-
-  // Copy VFP registers to
-  // double_registers_[DoubleRegister::kNumAllocatableRegisters]
-  int double_regs_offset = FrameDescription::double_registers_offset();
-  const RegisterConfiguration* config = RegisterConfiguration::Default();
-  for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
-    int code = config->GetAllocatableDoubleCode(i);
-    int dst_offset = code * kDoubleSize + double_regs_offset;
-    int src_offset =
-        code * kDoubleSize + kNumberOfRegisters * kPointerSize + kFloatRegsSize;
-    __ vldr(d0, sp, src_offset);
-    __ vstr(d0, r1, dst_offset);
-  }
-
-  // Copy VFP registers to
-  // float_registers_[FloatRegister::kNumAllocatableRegisters]
-  int float_regs_offset = FrameDescription::float_registers_offset();
-  for (int i = 0; i < config->num_allocatable_float_registers(); ++i) {
-    int code = config->GetAllocatableFloatCode(i);
-    int dst_offset = code * kFloatSize + float_regs_offset;
-    int src_offset = code * kFloatSize + kNumberOfRegisters * kPointerSize;
-    __ ldr(r2, MemOperand(sp, src_offset));
-    __ str(r2, MemOperand(r1, dst_offset));
-  }
-
-  // Remove the bailout id and the saved registers from the stack.
-  __ add(sp, sp, Operand(kSavedRegistersAreaSize + (1 * kPointerSize)));
-
-  // Compute a pointer to the unwinding limit in register r2; that is
-  // the first stack slot not part of the input frame.
-  __ ldr(r2, MemOperand(r1, FrameDescription::frame_size_offset()));
-  __ add(r2, r2, sp);
-
-  // Unwind the stack down to - but not including - the unwinding
-  // limit and copy the contents of the activation frame to the input
-  // frame description.
-  __ add(r3,  r1, Operand(FrameDescription::frame_content_offset()));
-  Label pop_loop;
-  Label pop_loop_header;
-  __ b(&pop_loop_header);
-  __ bind(&pop_loop);
-  __ pop(r4);
-  __ str(r4, MemOperand(r3, 0));
-  __ add(r3, r3, Operand(sizeof(uint32_t)));
-  __ bind(&pop_loop_header);
-  __ cmp(r2, sp);
-  __ b(ne, &pop_loop);
-
-  // Compute the output frame in the deoptimizer.
-  __ push(r0);  // Preserve deoptimizer object across call.
-  // r0: deoptimizer object; r1: scratch.
-  __ PrepareCallCFunction(1);
-  // Call Deoptimizer::ComputeOutputFrames().
-  {
-    AllowExternalCallThatCantCauseGC scope(masm());
-    __ CallCFunction(
-        ExternalReference::compute_output_frames_function(isolate()), 1);
-  }
-  __ pop(r0);  // Restore deoptimizer object (class Deoptimizer).
-
-  __ ldr(sp, MemOperand(r0, Deoptimizer::caller_frame_top_offset()));
-
-  // Replace the current (input) frame with the output frames.
-  Label outer_push_loop, inner_push_loop,
-      outer_loop_header, inner_loop_header;
-  // Outer loop state: r4 = current "FrameDescription** output_",
-  // r1 = one past the last FrameDescription**.
-  __ ldr(r1, MemOperand(r0, Deoptimizer::output_count_offset()));
-  __ ldr(r4, MemOperand(r0, Deoptimizer::output_offset()));  // r4 is output_.
-  __ add(r1, r4, Operand(r1, LSL, 2));
-  __ jmp(&outer_loop_header);
-  __ bind(&outer_push_loop);
-  // Inner loop state: r2 = current FrameDescription*, r3 = loop index.
-  __ ldr(r2, MemOperand(r4, 0));  // output_[ix]
-  __ ldr(r3, MemOperand(r2, FrameDescription::frame_size_offset()));
-  __ jmp(&inner_loop_header);
-  __ bind(&inner_push_loop);
-  __ sub(r3, r3, Operand(sizeof(uint32_t)));
-  __ add(r6, r2, Operand(r3));
-  __ ldr(r6, MemOperand(r6, FrameDescription::frame_content_offset()));
-  __ push(r6);
-  __ bind(&inner_loop_header);
-  __ cmp(r3, Operand::Zero());
-  __ b(ne, &inner_push_loop);  // test for gt?
-  __ add(r4, r4, Operand(kPointerSize));
-  __ bind(&outer_loop_header);
-  __ cmp(r4, r1);
-  __ b(lt, &outer_push_loop);
-
-  __ ldr(r1, MemOperand(r0, Deoptimizer::input_offset()));
-  for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
-    int code = config->GetAllocatableDoubleCode(i);
-    DwVfpRegister reg = DwVfpRegister::from_code(code);
-    int src_offset = code * kDoubleSize + double_regs_offset;
-    __ vldr(reg, r1, src_offset);
-  }
-
-  // Push pc and continuation from the last output frame.
-  __ ldr(r6, MemOperand(r2, FrameDescription::pc_offset()));
-  __ push(r6);
-  __ ldr(r6, MemOperand(r2, FrameDescription::continuation_offset()));
-  __ push(r6);
-
-  // Push the registers from the last output frame.
-  for (int i = kNumberOfRegisters - 1; i >= 0; i--) {
-    int offset = (i * kPointerSize) + FrameDescription::registers_offset();
-    __ ldr(r6, MemOperand(r2, offset));
-    __ push(r6);
-  }
-
-  // Restore the registers from the stack.
-  __ ldm(ia_w, sp, restored_regs);  // all but pc registers.
-
-  __ InitializeRootRegister();
-
-  // Remove sp, lr and pc.
-  __ Drop(3);
-  {
-    UseScratchRegisterScope temps(masm());
-    Register scratch = temps.Acquire();
-    __ pop(scratch);  // get continuation, leave pc on stack
-    __ pop(lr);
-    __ Jump(scratch);
-  }
-  __ stop("Unreachable.");
-}
-
-
-void Deoptimizer::TableEntryGenerator::GeneratePrologue() {
-  // Create a sequence of deoptimization entries.
-  // Note that registers are still live when jumping to an entry.
-
-  // We need to be able to generate immediates up to kMaxNumberOfEntries. On
-  // ARMv7, we can use movw (with a maximum immediate of 0xFFFF). On ARMv6, we
-  // need two instructions.
-  STATIC_ASSERT((kMaxNumberOfEntries - 1) <= 0xFFFF);
-  UseScratchRegisterScope temps(masm());
-  Register scratch = temps.Acquire();
-  if (CpuFeatures::IsSupported(ARMv7)) {
-    CpuFeatureScope scope(masm(), ARMv7);
-    Label done;
-    for (int i = 0; i < count(); i++) {
-      int start = masm()->pc_offset();
-      USE(start);
-      __ movw(scratch, i);
-      __ b(&done);
-      DCHECK_EQ(table_entry_size_, masm()->pc_offset() - start);
-    }
-    __ bind(&done);
-  } else {
-    // We want to keep table_entry_size_ == 8 (since this is the common case),
-    // but we need two instructions to load most immediates over 0xFF. To handle
-    // this, we set the low byte in the main table, and then set the high byte
-    // in a separate table if necessary.
-    Label high_fixes[256];
-    int high_fix_max = (count() - 1) >> 8;
-    DCHECK_GT(arraysize(high_fixes), static_cast<size_t>(high_fix_max));
-    for (int i = 0; i < count(); i++) {
-      int start = masm()->pc_offset();
-      USE(start);
-      __ mov(scratch, Operand(i & 0xFF));  // Set the low byte.
-      __ b(&high_fixes[i >> 8]);      // Jump to the secondary table.
-      DCHECK_EQ(table_entry_size_, masm()->pc_offset() - start);
-    }
-    // Generate the secondary table, to set the high byte.
-    for (int high = 1; high <= high_fix_max; high++) {
-      __ bind(&high_fixes[high]);
-      __ orr(scratch, scratch, Operand(high << 8));
-      // If this isn't the last entry, emit a branch to the end of the table.
-      // The last entry can just fall through.
-      if (high < high_fix_max) __ b(&high_fixes[0]);
-    }
-    // Bind high_fixes[0] last, for indices like 0x00**. This case requires no
-    // fix-up, so for (common) small tables we can jump here, then just fall
-    // through with no additional branch.
-    __ bind(&high_fixes[0]);
-  }
-  __ push(scratch);
-}
-
-bool Deoptimizer::PadTopOfStackRegister() { return false; }
-
-void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) {
-  SetFrameSlot(offset, value);
-}
-
-
-void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) {
-  SetFrameSlot(offset, value);
-}
-
-
-void FrameDescription::SetCallerConstantPool(unsigned offset, intptr_t value) {
-  // No embedded constant pool support.
-  UNREACHABLE();
-}
-
-
-#undef __
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/arm/disasm-arm.cc b/src/v8/src/arm/disasm-arm.cc
deleted file mode 100644
index 9951136..0000000
--- a/src/v8/src/arm/disasm-arm.cc
+++ /dev/null
@@ -1,2725 +0,0 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// A Disassembler object is used to disassemble a block of code instruction by
-// instruction. The default implementation of the NameConverter object can be
-// overriden to modify register names or to do symbol lookup on addresses.
-//
-// The example below will disassemble a block of code and print it to stdout.
-//
-//   NameConverter converter;
-//   Disassembler d(converter);
-//   for (byte* pc = begin; pc < end;) {
-//     v8::internal::EmbeddedVector<char, 256> buffer;
-//     byte* prev_pc = pc;
-//     pc += d.InstructionDecode(buffer, pc);
-//     printf("%p    %08x      %s\n",
-//            prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer);
-//   }
-//
-// The Disassembler class also has a convenience method to disassemble a block
-// of code into a FILE*, meaning that the above functionality could also be
-// achieved by just calling Disassembler::Disassemble(stdout, begin, end);
-
-
-#include <assert.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <string.h>
-
-#if V8_TARGET_ARCH_ARM
-
-#include "src/arm/constants-arm.h"
-#include "src/base/bits.h"
-#include "src/base/platform/platform.h"
-#include "src/disasm.h"
-#include "src/macro-assembler.h"
-
-
-namespace v8 {
-namespace internal {
-
-const auto GetRegConfig = RegisterConfiguration::Default;
-
-//------------------------------------------------------------------------------
-
-// Decoder decodes and disassembles instructions into an output buffer.
-// It uses the converter to convert register names and call destinations into
-// more informative description.
-class Decoder {
- public:
-  Decoder(const disasm::NameConverter& converter,
-          Vector<char> out_buffer)
-    : converter_(converter),
-      out_buffer_(out_buffer),
-      out_buffer_pos_(0) {
-    out_buffer_[out_buffer_pos_] = '\0';
-  }
-
-  ~Decoder() {}
-
-  // Writes one disassembled instruction into 'buffer' (0-terminated).
-  // Returns the length of the disassembled machine instruction in bytes.
-  int InstructionDecode(byte* instruction);
-
-  static bool IsConstantPoolAt(byte* instr_ptr);
-  static int ConstantPoolSizeAt(byte* instr_ptr);
-
- private:
-  // Bottleneck functions to print into the out_buffer.
-  void PrintChar(const char ch);
-  void Print(const char* str);
-
-  // Printing of common values.
-  void PrintRegister(int reg);
-  void PrintSRegister(int reg);
-  void PrintDRegister(int reg);
-  int FormatVFPRegister(Instruction* instr, const char* format);
-  void PrintMovwMovt(Instruction* instr);
-  int FormatVFPinstruction(Instruction* instr, const char* format);
-  void PrintCondition(Instruction* instr);
-  void PrintShiftRm(Instruction* instr);
-  void PrintShiftImm(Instruction* instr);
-  void PrintShiftSat(Instruction* instr);
-  void PrintPU(Instruction* instr);
-  void PrintSoftwareInterrupt(SoftwareInterruptCodes svc);
-
-  // Handle formatting of instructions and their options.
-  int FormatRegister(Instruction* instr, const char* option);
-  void FormatNeonList(int Vd, int type);
-  void FormatNeonMemory(int Rn, int align, int Rm);
-  int FormatOption(Instruction* instr, const char* option);
-  void Format(Instruction* instr, const char* format);
-  void Unknown(Instruction* instr);
-
-  // Each of these functions decodes one particular instruction type, a 3-bit
-  // field in the instruction encoding.
-  // Types 0 and 1 are combined as they are largely the same except for the way
-  // they interpret the shifter operand.
-  void DecodeType01(Instruction* instr);
-  void DecodeType2(Instruction* instr);
-  void DecodeType3(Instruction* instr);
-  void DecodeType4(Instruction* instr);
-  void DecodeType5(Instruction* instr);
-  void DecodeType6(Instruction* instr);
-  // Type 7 includes special Debugger instructions.
-  int DecodeType7(Instruction* instr);
-  // CP15 coprocessor instructions.
-  void DecodeTypeCP15(Instruction* instr);
-  // For VFP support.
-  void DecodeTypeVFP(Instruction* instr);
-  void DecodeType6CoprocessorIns(Instruction* instr);
-
-  void DecodeSpecialCondition(Instruction* instr);
-
-  void DecodeVMOVBetweenCoreAndSinglePrecisionRegisters(Instruction* instr);
-  void DecodeVCMP(Instruction* instr);
-  void DecodeVCVTBetweenDoubleAndSingle(Instruction* instr);
-  void DecodeVCVTBetweenFloatingPointAndInteger(Instruction* instr);
-
-  const disasm::NameConverter& converter_;
-  Vector<char> out_buffer_;
-  int out_buffer_pos_;
-
-  DISALLOW_COPY_AND_ASSIGN(Decoder);
-};
-
-
-// Support for assertions in the Decoder formatting functions.
-#define STRING_STARTS_WITH(string, compare_string) \
-  (strncmp(string, compare_string, strlen(compare_string)) == 0)
-
-
-// Append the ch to the output buffer.
-void Decoder::PrintChar(const char ch) {
-  out_buffer_[out_buffer_pos_++] = ch;
-}
-
-
-// Append the str to the output buffer.
-void Decoder::Print(const char* str) {
-  char cur = *str++;
-  while (cur != '\0' && (out_buffer_pos_ < (out_buffer_.length() - 1))) {
-    PrintChar(cur);
-    cur = *str++;
-  }
-  out_buffer_[out_buffer_pos_] = 0;
-}
-
-
-// These condition names are defined in a way to match the native disassembler
-// formatting. See for example the command "objdump -d <binary file>".
-static const char* const cond_names[kNumberOfConditions] = {
-  "eq", "ne", "cs" , "cc" , "mi" , "pl" , "vs" , "vc" ,
-  "hi", "ls", "ge", "lt", "gt", "le", "", "invalid",
-};
-
-
-// Print the condition guarding the instruction.
-void Decoder::PrintCondition(Instruction* instr) {
-  Print(cond_names[instr->ConditionValue()]);
-}
-
-
-// Print the register name according to the active name converter.
-void Decoder::PrintRegister(int reg) {
-  Print(converter_.NameOfCPURegister(reg));
-}
-
-
-// Print the VFP S register name according to the active name converter.
-void Decoder::PrintSRegister(int reg) {
-  Print(VFPRegisters::Name(reg, false));
-}
-
-
-// Print the VFP D register name according to the active name converter.
-void Decoder::PrintDRegister(int reg) {
-  Print(VFPRegisters::Name(reg, true));
-}
-
-
-// These shift names are defined in a way to match the native disassembler
-// formatting. See for example the command "objdump -d <binary file>".
-static const char* const shift_names[kNumberOfShifts] = {
-  "lsl", "lsr", "asr", "ror"
-};
-
-
-// Print the register shift operands for the instruction. Generally used for
-// data processing instructions.
-void Decoder::PrintShiftRm(Instruction* instr) {
-  ShiftOp shift = instr->ShiftField();
-  int shift_index = instr->ShiftValue();
-  int shift_amount = instr->ShiftAmountValue();
-  int rm = instr->RmValue();
-
-  PrintRegister(rm);
-
-  if ((instr->RegShiftValue() == 0) && (shift == LSL) && (shift_amount == 0)) {
-    // Special case for using rm only.
-    return;
-  }
-  if (instr->RegShiftValue() == 0) {
-    // by immediate
-    if ((shift == ROR) && (shift_amount == 0)) {
-      Print(", RRX");
-      return;
-    } else if (((shift == LSR) || (shift == ASR)) && (shift_amount == 0)) {
-      shift_amount = 32;
-    }
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                ", %s #%d",
-                                shift_names[shift_index],
-                                shift_amount);
-  } else {
-    // by register
-    int rs = instr->RsValue();
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                ", %s ", shift_names[shift_index]);
-    PrintRegister(rs);
-  }
-}
-
-
-// Print the immediate operand for the instruction. Generally used for data
-// processing instructions.
-void Decoder::PrintShiftImm(Instruction* instr) {
-  int rotate = instr->RotateValue() * 2;
-  int immed8 = instr->Immed8Value();
-  int imm = base::bits::RotateRight32(immed8, rotate);
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "#%d", imm);
-}
-
-
-// Print the optional shift and immediate used by saturating instructions.
-void Decoder::PrintShiftSat(Instruction* instr) {
-  int shift = instr->Bits(11, 7);
-  if (shift > 0) {
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                ", %s #%d",
-                                shift_names[instr->Bit(6) * 2],
-                                instr->Bits(11, 7));
-  }
-}
-
-
-// Print PU formatting to reduce complexity of FormatOption.
-void Decoder::PrintPU(Instruction* instr) {
-  switch (instr->PUField()) {
-    case da_x: {
-      Print("da");
-      break;
-    }
-    case ia_x: {
-      Print("ia");
-      break;
-    }
-    case db_x: {
-      Print("db");
-      break;
-    }
-    case ib_x: {
-      Print("ib");
-      break;
-    }
-    default: {
-      UNREACHABLE();
-      break;
-    }
-  }
-}
-
-
-// Print SoftwareInterrupt codes. Factoring this out reduces the complexity of
-// the FormatOption method.
-void Decoder::PrintSoftwareInterrupt(SoftwareInterruptCodes svc) {
-  switch (svc) {
-    case kCallRtRedirected:
-      Print("call rt redirected");
-      return;
-    case kBreakpoint:
-      Print("breakpoint");
-      return;
-    default:
-      if (svc >= kStopCode) {
-        out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                    "%d - 0x%x",
-                                    svc & kStopCodeMask,
-                                    svc & kStopCodeMask);
-      } else {
-        out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                    "%d",
-                                    svc);
-      }
-      return;
-  }
-}
-
-
-// Handle all register based formatting in this function to reduce the
-// complexity of FormatOption.
-int Decoder::FormatRegister(Instruction* instr, const char* format) {
-  DCHECK_EQ(format[0], 'r');
-  if (format[1] == 'n') {  // 'rn: Rn register
-    int reg = instr->RnValue();
-    PrintRegister(reg);
-    return 2;
-  } else if (format[1] == 'd') {  // 'rd: Rd register
-    int reg = instr->RdValue();
-    PrintRegister(reg);
-    return 2;
-  } else if (format[1] == 's') {  // 'rs: Rs register
-    int reg = instr->RsValue();
-    PrintRegister(reg);
-    return 2;
-  } else if (format[1] == 'm') {  // 'rm: Rm register
-    int reg = instr->RmValue();
-    PrintRegister(reg);
-    return 2;
-  } else if (format[1] == 't') {  // 'rt: Rt register
-    int reg = instr->RtValue();
-    PrintRegister(reg);
-    return 2;
-  } else if (format[1] == 'l') {
-    // 'rlist: register list for load and store multiple instructions
-    DCHECK(STRING_STARTS_WITH(format, "rlist"));
-    int rlist = instr->RlistValue();
-    int reg = 0;
-    Print("{");
-    // Print register list in ascending order, by scanning the bit mask.
-    while (rlist != 0) {
-      if ((rlist & 1) != 0) {
-        PrintRegister(reg);
-        if ((rlist >> 1) != 0) {
-          Print(", ");
-        }
-      }
-      reg++;
-      rlist >>= 1;
-    }
-    Print("}");
-    return 5;
-  }
-  UNREACHABLE();
-}
-
-
-// Handle all VFP register based formatting in this function to reduce the
-// complexity of FormatOption.
-int Decoder::FormatVFPRegister(Instruction* instr, const char* format) {
-  DCHECK((format[0] == 'S') || (format[0] == 'D'));
-
-  VFPRegPrecision precision =
-      format[0] == 'D' ? kDoublePrecision : kSinglePrecision;
-
-  int retval = 2;
-  int reg = -1;
-  if (format[1] == 'n') {
-    reg = instr->VFPNRegValue(precision);
-  } else if (format[1] == 'm') {
-    reg = instr->VFPMRegValue(precision);
-  } else if (format[1] == 'd') {
-    if ((instr->TypeValue() == 7) &&
-        (instr->Bit(24) == 0x0) &&
-        (instr->Bits(11, 9) == 0x5) &&
-        (instr->Bit(4) == 0x1)) {
-      // vmov.32 has Vd in a different place.
-      reg = instr->Bits(19, 16) | (instr->Bit(7) << 4);
-    } else {
-      reg = instr->VFPDRegValue(precision);
-    }
-
-    if (format[2] == '+') {
-      int immed8 = instr->Immed8Value();
-      if (format[0] == 'S') reg += immed8 - 1;
-      if (format[0] == 'D') reg += (immed8 / 2 - 1);
-    }
-    if (format[2] == '+') retval = 3;
-  } else {
-    UNREACHABLE();
-  }
-
-  if (precision == kSinglePrecision) {
-    PrintSRegister(reg);
-  } else {
-    PrintDRegister(reg);
-  }
-
-  return retval;
-}
-
-
-int Decoder::FormatVFPinstruction(Instruction* instr, const char* format) {
-    Print(format);
-    return 0;
-}
-
-
-void Decoder::FormatNeonList(int Vd, int type) {
-  if (type == nlt_1) {
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                "{d%d}", Vd);
-  } else if (type == nlt_2) {
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                "{d%d, d%d}", Vd, Vd + 1);
-  } else if (type == nlt_3) {
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                "{d%d, d%d, d%d}", Vd, Vd + 1, Vd + 2);
-  } else if (type == nlt_4) {
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                        "{d%d, d%d, d%d, d%d}", Vd, Vd + 1, Vd + 2, Vd + 3);
-  }
-}
-
-
-void Decoder::FormatNeonMemory(int Rn, int align, int Rm) {
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "[%s",
-                              converter_.NameOfCPURegister(Rn));
-  if (align != 0) {
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                ":%d", (1 << align) << 6);
-  }
-  if (Rm == 15) {
-    Print("]");
-  } else if (Rm == 13) {
-    Print("]!");
-  } else {
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "], %s",
-                                converter_.NameOfCPURegister(Rm));
-  }
-}
-
-
-// Print the movw or movt instruction.
-void Decoder::PrintMovwMovt(Instruction* instr) {
-  int imm = instr->ImmedMovwMovtValue();
-  int rd = instr->RdValue();
-  PrintRegister(rd);
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, ", #%d", imm);
-}
-
-
-// FormatOption takes a formatting string and interprets it based on
-// the current instructions. The format string points to the first
-// character of the option string (the option escape has already been
-// consumed by the caller.)  FormatOption returns the number of
-// characters that were consumed from the formatting string.
-int Decoder::FormatOption(Instruction* instr, const char* format) {
-  switch (format[0]) {
-    case 'a': {  // 'a: accumulate multiplies
-      if (instr->Bit(21) == 0) {
-        Print("ul");
-      } else {
-        Print("la");
-      }
-      return 1;
-    }
-    case 'b': {  // 'b: byte loads or stores
-      if (instr->HasB()) {
-        Print("b");
-      }
-      return 1;
-    }
-    case 'c': {  // 'cond: conditional execution
-      DCHECK(STRING_STARTS_WITH(format, "cond"));
-      PrintCondition(instr);
-      return 4;
-    }
-    case 'd': {  // 'd: vmov double immediate.
-      double d = instr->DoubleImmedVmov().get_scalar();
-      out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "#%g", d);
-      return 1;
-    }
-    case 'f': {  // 'f: bitfield instructions - v7 and above.
-      uint32_t lsbit = instr->Bits(11, 7);
-      uint32_t width = instr->Bits(20, 16) + 1;
-      if (instr->Bit(21) == 0) {
-        // BFC/BFI:
-        // Bits 20-16 represent most-significant bit. Covert to width.
-        width -= lsbit;
-        DCHECK_GT(width, 0);
-      }
-      DCHECK_LE(width + lsbit, 32);
-      out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                  "#%d, #%d", lsbit, width);
-      return 1;
-    }
-    case 'h': {  // 'h: halfword operation for extra loads and stores
-      if (instr->HasH()) {
-        Print("h");
-      } else {
-        Print("b");
-      }
-      return 1;
-    }
-    case 'i': {  // 'i: immediate value from adjacent bits.
-      // Expects tokens in the form imm%02d@%02d, i.e. imm05@07, imm10@16
-      int width = (format[3] - '0') * 10 + (format[4] - '0');
-      int lsb   = (format[6] - '0') * 10 + (format[7] - '0');
-
-      DCHECK((width >= 1) && (width <= 32));
-      DCHECK((lsb >= 0) && (lsb <= 31));
-      DCHECK_LE(width + lsb, 32);
-
-      out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                  "%d",
-                                  instr->Bits(width + lsb - 1, lsb));
-      return 8;
-    }
-    case 'l': {  // 'l: branch and link
-      if (instr->HasLink()) {
-        Print("l");
-      }
-      return 1;
-    }
-    case 'm': {
-      if (format[1] == 'w') {
-        // 'mw: movt/movw instructions.
-        PrintMovwMovt(instr);
-        return 2;
-      }
-      if (format[1] == 'e') {  // 'memop: load/store instructions.
-        DCHECK(STRING_STARTS_WITH(format, "memop"));
-        if (instr->HasL()) {
-          Print("ldr");
-        } else {
-          if ((instr->Bits(27, 25) == 0) && (instr->Bit(20) == 0) &&
-              (instr->Bits(7, 6) == 3) && (instr->Bit(4) == 1)) {
-            if (instr->Bit(5) == 1) {
-              Print("strd");
-            } else {
-              Print("ldrd");
-            }
-            return 5;
-          }
-          Print("str");
-        }
-        return 5;
-      }
-      // 'msg: for simulator break instructions
-      DCHECK(STRING_STARTS_WITH(format, "msg"));
-      byte* str =
-          reinterpret_cast<byte*>(instr->InstructionBits() & 0x0FFFFFFF);
-      out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                  "%s", converter_.NameInCode(str));
-      return 3;
-    }
-    case 'o': {
-      if ((format[3] == '1') && (format[4] == '2')) {
-        // 'off12: 12-bit offset for load and store instructions
-        DCHECK(STRING_STARTS_WITH(format, "off12"));
-        out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                    "%d", instr->Offset12Value());
-        return 5;
-      } else if (format[3] == '0') {
-        // 'off0to3and8to19 16-bit immediate encoded in bits 19-8 and 3-0.
-        DCHECK(STRING_STARTS_WITH(format, "off0to3and8to19"));
-        out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                    "%d",
-                                    (instr->Bits(19, 8) << 4) +
-                                    instr->Bits(3, 0));
-        return 15;
-      }
-      // 'off8: 8-bit offset for extra load and store instructions
-      DCHECK(STRING_STARTS_WITH(format, "off8"));
-      int offs8 = (instr->ImmedHValue() << 4) | instr->ImmedLValue();
-      out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", offs8);
-      return 4;
-    }
-    case 'p': {  // 'pu: P and U bits for load and store instructions
-      DCHECK(STRING_STARTS_WITH(format, "pu"));
-      PrintPU(instr);
-      return 2;
-    }
-    case 'r': {
-      return FormatRegister(instr, format);
-    }
-    case 's': {
-      if (format[1] == 'h') {  // 'shift_op or 'shift_rm or 'shift_sat.
-        if (format[6] == 'o') {  // 'shift_op
-          DCHECK(STRING_STARTS_WITH(format, "shift_op"));
-          if (instr->TypeValue() == 0) {
-            PrintShiftRm(instr);
-          } else {
-            DCHECK_EQ(instr->TypeValue(), 1);
-            PrintShiftImm(instr);
-          }
-          return 8;
-        } else if (format[6] == 's') {  // 'shift_sat.
-          DCHECK(STRING_STARTS_WITH(format, "shift_sat"));
-          PrintShiftSat(instr);
-          return 9;
-        } else {  // 'shift_rm
-          DCHECK(STRING_STARTS_WITH(format, "shift_rm"));
-          PrintShiftRm(instr);
-          return 8;
-        }
-      } else if (format[1] == 'v') {  // 'svc
-        DCHECK(STRING_STARTS_WITH(format, "svc"));
-        PrintSoftwareInterrupt(instr->SvcValue());
-        return 3;
-      } else if (format[1] == 'i') {  // 'sign: signed extra loads and stores
-        DCHECK(STRING_STARTS_WITH(format, "sign"));
-        if (instr->HasSign()) {
-          Print("s");
-        }
-        return 4;
-      } else if (format[1] == 'p') {
-        if (format[8] == '_') {  // 'spec_reg_fields
-          DCHECK(STRING_STARTS_WITH(format, "spec_reg_fields"));
-          Print("_");
-          int mask = instr->Bits(19, 16);
-          if (mask == 0) Print("(none)");
-          if ((mask & 0x8) != 0) Print("f");
-          if ((mask & 0x4) != 0) Print("s");
-          if ((mask & 0x2) != 0) Print("x");
-          if ((mask & 0x1) != 0) Print("c");
-          return 15;
-        } else {  // 'spec_reg
-          DCHECK(STRING_STARTS_WITH(format, "spec_reg"));
-          if (instr->Bit(22) == 0) {
-            Print("CPSR");
-          } else {
-            Print("SPSR");
-          }
-          return 8;
-        }
-      }
-      // 's: S field of data processing instructions
-      if (instr->HasS()) {
-        Print("s");
-      }
-      return 1;
-    }
-    case 't': {  // 'target: target of branch instructions
-      DCHECK(STRING_STARTS_WITH(format, "target"));
-      int off = (instr->SImmed24Value() << 2) + 8;
-      out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                  "%+d -> %s",
-                                  off,
-                                  converter_.NameOfAddress(
-                                    reinterpret_cast<byte*>(instr) + off));
-      return 6;
-    }
-    case 'u': {  // 'u: signed or unsigned multiplies
-      // The manual gets the meaning of bit 22 backwards in the multiply
-      // instruction overview on page A3.16.2.  The instructions that
-      // exist in u and s variants are the following:
-      // smull A4.1.87
-      // umull A4.1.129
-      // umlal A4.1.128
-      // smlal A4.1.76
-      // For these 0 means u and 1 means s.  As can be seen on their individual
-      // pages.  The other 18 mul instructions have the bit set or unset in
-      // arbitrary ways that are unrelated to the signedness of the instruction.
-      // None of these 18 instructions exist in both a 'u' and an 's' variant.
-
-      if (instr->Bit(22) == 0) {
-        Print("u");
-      } else {
-        Print("s");
-      }
-      return 1;
-    }
-    case 'v': {
-      return FormatVFPinstruction(instr, format);
-    }
-    case 'A': {
-      // Print pc-relative address.
-      int offset = instr->Offset12Value();
-      byte* pc = reinterpret_cast<byte*>(instr) + Instruction::kPCReadOffset;
-      byte* addr;
-      switch (instr->PUField()) {
-        case db_x: {
-          addr = pc - offset;
-          break;
-        }
-        case ib_x: {
-          addr = pc + offset;
-          break;
-        }
-        default: {
-          UNREACHABLE();
-          return -1;
-        }
-      }
-      out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%p",
-                                  static_cast<void*>(addr));
-      return 1;
-    }
-    case 'S':
-    case 'D': {
-      return FormatVFPRegister(instr, format);
-    }
-    case 'w': {  // 'w: W field of load and store instructions
-      if (instr->HasW()) {
-        Print("!");
-      }
-      return 1;
-    }
-    default: {
-      UNREACHABLE();
-      break;
-    }
-  }
-  UNREACHABLE();
-}
-
-
-// Format takes a formatting string for a whole instruction and prints it into
-// the output buffer. All escaped options are handed to FormatOption to be
-// parsed further.
-void Decoder::Format(Instruction* instr, const char* format) {
-  char cur = *format++;
-  while ((cur != 0) && (out_buffer_pos_ < (out_buffer_.length() - 1))) {
-    if (cur == '\'') {  // Single quote is used as the formatting escape.
-      format += FormatOption(instr, format);
-    } else {
-      out_buffer_[out_buffer_pos_++] = cur;
-    }
-    cur = *format++;
-  }
-  out_buffer_[out_buffer_pos_]  = '\0';
-}
-
-
-// The disassembler may end up decoding data inlined in the code. We do not want
-// it to crash if the data does not resemble any known instruction.
-#define VERIFY(condition) \
-if(!(condition)) {        \
-  Unknown(instr);         \
-  return;                 \
-}
-
-
-// For currently unimplemented decodings the disassembler calls Unknown(instr)
-// which will just print "unknown" of the instruction bits.
-void Decoder::Unknown(Instruction* instr) {
-  Format(instr, "unknown");
-}
-
-
-void Decoder::DecodeType01(Instruction* instr) {
-  int type = instr->TypeValue();
-  if ((type == 0) && instr->IsSpecialType0()) {
-    // multiply instruction or extra loads and stores
-    if (instr->Bits(7, 4) == 9) {
-      if (instr->Bit(24) == 0) {
-        // multiply instructions
-        if (instr->Bit(23) == 0) {
-          if (instr->Bit(21) == 0) {
-            // The MUL instruction description (A 4.1.33) refers to Rd as being
-            // the destination for the operation, but it confusingly uses the
-            // Rn field to encode it.
-            Format(instr, "mul'cond's 'rn, 'rm, 'rs");
-          } else {
-            if (instr->Bit(22) == 0) {
-              // The MLA instruction description (A 4.1.28) refers to the order
-              // of registers as "Rd, Rm, Rs, Rn". But confusingly it uses the
-              // Rn field to encode the Rd register and the Rd field to encode
-              // the Rn register.
-              Format(instr, "mla'cond's 'rn, 'rm, 'rs, 'rd");
-            } else {
-              // The MLS instruction description (A 4.1.29) refers to the order
-              // of registers as "Rd, Rm, Rs, Rn". But confusingly it uses the
-              // Rn field to encode the Rd register and the Rd field to encode
-              // the Rn register.
-              Format(instr, "mls'cond's 'rn, 'rm, 'rs, 'rd");
-            }
-          }
-        } else {
-          // The signed/long multiply instructions use the terms RdHi and RdLo
-          // when referring to the target registers. They are mapped to the Rn
-          // and Rd fields as follows:
-          // RdLo == Rd field
-          // RdHi == Rn field
-          // The order of registers is: <RdLo>, <RdHi>, <Rm>, <Rs>
-          Format(instr, "'um'al'cond's 'rd, 'rn, 'rm, 'rs");
-        }
-      } else {
-        if (instr->Bits(24, 23) == 3) {
-          if (instr->Bit(20) == 1) {
-            // ldrex
-            switch (instr->Bits(22, 21)) {
-              case 0:
-                Format(instr, "ldrex'cond 'rt, ['rn]");
-                break;
-              case 2:
-                Format(instr, "ldrexb'cond 'rt, ['rn]");
-                break;
-              case 3:
-                Format(instr, "ldrexh'cond 'rt, ['rn]");
-                break;
-              default:
-                UNREACHABLE();
-                break;
-            }
-          } else {
-            // strex
-            // The instruction is documented as strex rd, rt, [rn], but the
-            // "rt" register is using the rm bits.
-            switch (instr->Bits(22, 21)) {
-              case 0:
-                Format(instr, "strex'cond 'rd, 'rm, ['rn]");
-                break;
-              case 2:
-                Format(instr, "strexb'cond 'rd, 'rm, ['rn]");
-                break;
-              case 3:
-                Format(instr, "strexh'cond 'rd, 'rm, ['rn]");
-                break;
-              default:
-                UNREACHABLE();
-                break;
-            }
-          }
-        } else {
-          Unknown(instr);  // not used by V8
-        }
-      }
-    } else if ((instr->Bit(20) == 0) && ((instr->Bits(7, 4) & 0xD) == 0xD)) {
-      // ldrd, strd
-      switch (instr->PUField()) {
-        case da_x: {
-          if (instr->Bit(22) == 0) {
-            Format(instr, "'memop'cond's 'rd, ['rn], -'rm");
-          } else {
-            Format(instr, "'memop'cond's 'rd, ['rn], #-'off8");
-          }
-          break;
-        }
-        case ia_x: {
-          if (instr->Bit(22) == 0) {
-            Format(instr, "'memop'cond's 'rd, ['rn], +'rm");
-          } else {
-            Format(instr, "'memop'cond's 'rd, ['rn], #+'off8");
-          }
-          break;
-        }
-        case db_x: {
-          if (instr->Bit(22) == 0) {
-            Format(instr, "'memop'cond's 'rd, ['rn, -'rm]'w");
-          } else {
-            Format(instr, "'memop'cond's 'rd, ['rn, #-'off8]'w");
-          }
-          break;
-        }
-        case ib_x: {
-          if (instr->Bit(22) == 0) {
-            Format(instr, "'memop'cond's 'rd, ['rn, +'rm]'w");
-          } else {
-            Format(instr, "'memop'cond's 'rd, ['rn, #+'off8]'w");
-          }
-          break;
-        }
-        default: {
-          // The PU field is a 2-bit field.
-          UNREACHABLE();
-          break;
-        }
-      }
-    } else {
-      // extra load/store instructions
-      switch (instr->PUField()) {
-        case da_x: {
-          if (instr->Bit(22) == 0) {
-            Format(instr, "'memop'cond'sign'h 'rd, ['rn], -'rm");
-          } else {
-            Format(instr, "'memop'cond'sign'h 'rd, ['rn], #-'off8");
-          }
-          break;
-        }
-        case ia_x: {
-          if (instr->Bit(22) == 0) {
-            Format(instr, "'memop'cond'sign'h 'rd, ['rn], +'rm");
-          } else {
-            Format(instr, "'memop'cond'sign'h 'rd, ['rn], #+'off8");
-          }
-          break;
-        }
-        case db_x: {
-          if (instr->Bit(22) == 0) {
-            Format(instr, "'memop'cond'sign'h 'rd, ['rn, -'rm]'w");
-          } else {
-            Format(instr, "'memop'cond'sign'h 'rd, ['rn, #-'off8]'w");
-          }
-          break;
-        }
-        case ib_x: {
-          if (instr->Bit(22) == 0) {
-            Format(instr, "'memop'cond'sign'h 'rd, ['rn, +'rm]'w");
-          } else {
-            Format(instr, "'memop'cond'sign'h 'rd, ['rn, #+'off8]'w");
-          }
-          break;
-        }
-        default: {
-          // The PU field is a 2-bit field.
-          UNREACHABLE();
-          break;
-        }
-      }
-      return;
-    }
-  } else if ((type == 0) && instr->IsMiscType0()) {
-    if ((instr->Bits(27, 23) == 2) && (instr->Bits(21, 20) == 2) &&
-        (instr->Bits(15, 4) == 0xF00)) {
-      Format(instr, "msr'cond 'spec_reg'spec_reg_fields, 'rm");
-    } else if ((instr->Bits(27, 23) == 2) && (instr->Bits(21, 20) == 0) &&
-               (instr->Bits(11, 0) == 0)) {
-      Format(instr, "mrs'cond 'rd, 'spec_reg");
-    } else if (instr->Bits(22, 21) == 1) {
-      switch (instr->BitField(7, 4)) {
-        case BX:
-          Format(instr, "bx'cond 'rm");
-          break;
-        case BLX:
-          Format(instr, "blx'cond 'rm");
-          break;
-        case BKPT:
-          Format(instr, "bkpt 'off0to3and8to19");
-          break;
-        default:
-          Unknown(instr);  // not used by V8
-          break;
-      }
-    } else if (instr->Bits(22, 21) == 3) {
-      switch (instr->BitField(7, 4)) {
-        case CLZ:
-          Format(instr, "clz'cond 'rd, 'rm");
-          break;
-        default:
-          Unknown(instr);  // not used by V8
-          break;
-      }
-    } else {
-      Unknown(instr);  // not used by V8
-    }
-  } else if ((type == 1) && instr->IsNopType1()) {
-    Format(instr, "nop'cond");
-  } else {
-    switch (instr->OpcodeField()) {
-      case AND: {
-        Format(instr, "and'cond's 'rd, 'rn, 'shift_op");
-        break;
-      }
-      case EOR: {
-        Format(instr, "eor'cond's 'rd, 'rn, 'shift_op");
-        break;
-      }
-      case SUB: {
-        Format(instr, "sub'cond's 'rd, 'rn, 'shift_op");
-        break;
-      }
-      case RSB: {
-        Format(instr, "rsb'cond's 'rd, 'rn, 'shift_op");
-        break;
-      }
-      case ADD: {
-        Format(instr, "add'cond's 'rd, 'rn, 'shift_op");
-        break;
-      }
-      case ADC: {
-        Format(instr, "adc'cond's 'rd, 'rn, 'shift_op");
-        break;
-      }
-      case SBC: {
-        Format(instr, "sbc'cond's 'rd, 'rn, 'shift_op");
-        break;
-      }
-      case RSC: {
-        Format(instr, "rsc'cond's 'rd, 'rn, 'shift_op");
-        break;
-      }
-      case TST: {
-        if (instr->HasS()) {
-          Format(instr, "tst'cond 'rn, 'shift_op");
-        } else {
-          Format(instr, "movw'cond 'mw");
-        }
-        break;
-      }
-      case TEQ: {
-        if (instr->HasS()) {
-          Format(instr, "teq'cond 'rn, 'shift_op");
-        } else {
-          // Other instructions matching this pattern are handled in the
-          // miscellaneous instructions part above.
-          UNREACHABLE();
-        }
-        break;
-      }
-      case CMP: {
-        if (instr->HasS()) {
-          Format(instr, "cmp'cond 'rn, 'shift_op");
-        } else {
-          Format(instr, "movt'cond 'mw");
-        }
-        break;
-      }
-      case CMN: {
-        if (instr->HasS()) {
-          Format(instr, "cmn'cond 'rn, 'shift_op");
-        } else {
-          // Other instructions matching this pattern are handled in the
-          // miscellaneous instructions part above.
-          UNREACHABLE();
-        }
-        break;
-      }
-      case ORR: {
-        Format(instr, "orr'cond's 'rd, 'rn, 'shift_op");
-        break;
-      }
-      case MOV: {
-        Format(instr, "mov'cond's 'rd, 'shift_op");
-        break;
-      }
-      case BIC: {
-        Format(instr, "bic'cond's 'rd, 'rn, 'shift_op");
-        break;
-      }
-      case MVN: {
-        Format(instr, "mvn'cond's 'rd, 'shift_op");
-        break;
-      }
-      default: {
-        // The Opcode field is a 4-bit field.
-        UNREACHABLE();
-        break;
-      }
-    }
-  }
-}
-
-
-void Decoder::DecodeType2(Instruction* instr) {
-  switch (instr->PUField()) {
-    case da_x: {
-      if (instr->HasW()) {
-        Unknown(instr);  // not used in V8
-        return;
-      }
-      Format(instr, "'memop'cond'b 'rd, ['rn], #-'off12");
-      break;
-    }
-    case ia_x: {
-      if (instr->HasW()) {
-        Unknown(instr);  // not used in V8
-        return;
-      }
-      Format(instr, "'memop'cond'b 'rd, ['rn], #+'off12");
-      break;
-    }
-    case db_x: {
-      if (instr->HasL() && (instr->RnValue() == kPCRegister)) {
-        Format(instr, "'memop'cond'b 'rd, [pc, #-'off12]'w (addr 'A)");
-      } else {
-        Format(instr, "'memop'cond'b 'rd, ['rn, #-'off12]'w");
-      }
-      break;
-    }
-    case ib_x: {
-      if (instr->HasL() && (instr->RnValue() == kPCRegister)) {
-        Format(instr, "'memop'cond'b 'rd, [pc, #+'off12]'w (addr 'A)");
-      } else {
-        Format(instr, "'memop'cond'b 'rd, ['rn, #+'off12]'w");
-      }
-      break;
-    }
-    default: {
-      // The PU field is a 2-bit field.
-      UNREACHABLE();
-      break;
-    }
-  }
-}
-
-
-void Decoder::DecodeType3(Instruction* instr) {
-  switch (instr->PUField()) {
-    case da_x: {
-      VERIFY(!instr->HasW());
-      Format(instr, "'memop'cond'b 'rd, ['rn], -'shift_rm");
-      break;
-    }
-    case ia_x: {
-      if (instr->Bit(4) == 0) {
-        Format(instr, "'memop'cond'b 'rd, ['rn], +'shift_rm");
-      } else {
-        if (instr->Bit(5) == 0) {
-          switch (instr->Bits(22, 21)) {
-            case 0:
-              if (instr->Bit(20) == 0) {
-                if (instr->Bit(6) == 0) {
-                  Format(instr, "pkhbt'cond 'rd, 'rn, 'rm, lsl #'imm05@07");
-                } else {
-                  if (instr->Bits(11, 7) == 0) {
-                    Format(instr, "pkhtb'cond 'rd, 'rn, 'rm, asr #32");
-                  } else {
-                    Format(instr, "pkhtb'cond 'rd, 'rn, 'rm, asr #'imm05@07");
-                  }
-                }
-              } else {
-                UNREACHABLE();
-              }
-              break;
-            case 1:
-              UNREACHABLE();
-              break;
-            case 2:
-              UNREACHABLE();
-              break;
-            case 3:
-              Format(instr, "usat 'rd, #'imm05@16, 'rm'shift_sat");
-              break;
-          }
-        } else {
-          switch (instr->Bits(22, 21)) {
-            case 0:
-              UNREACHABLE();
-              break;
-            case 1:
-              if (instr->Bits(9, 6) == 1) {
-                if (instr->Bit(20) == 0) {
-                  if (instr->Bits(19, 16) == 0xF) {
-                    switch (instr->Bits(11, 10)) {
-                      case 0:
-                        Format(instr, "sxtb'cond 'rd, 'rm");
-                        break;
-                      case 1:
-                        Format(instr, "sxtb'cond 'rd, 'rm, ror #8");
-                        break;
-                      case 2:
-                        Format(instr, "sxtb'cond 'rd, 'rm, ror #16");
-                        break;
-                      case 3:
-                        Format(instr, "sxtb'cond 'rd, 'rm, ror #24");
-                        break;
-                    }
-                  } else {
-                    switch (instr->Bits(11, 10)) {
-                      case 0:
-                        Format(instr, "sxtab'cond 'rd, 'rn, 'rm");
-                        break;
-                      case 1:
-                        Format(instr, "sxtab'cond 'rd, 'rn, 'rm, ror #8");
-                        break;
-                      case 2:
-                        Format(instr, "sxtab'cond 'rd, 'rn, 'rm, ror #16");
-                        break;
-                      case 3:
-                        Format(instr, "sxtab'cond 'rd, 'rn, 'rm, ror #24");
-                        break;
-                    }
-                  }
-                } else {
-                  if (instr->Bits(19, 16) == 0xF) {
-                    switch (instr->Bits(11, 10)) {
-                      case 0:
-                        Format(instr, "sxth'cond 'rd, 'rm");
-                        break;
-                      case 1:
-                        Format(instr, "sxth'cond 'rd, 'rm, ror #8");
-                        break;
-                      case 2:
-                        Format(instr, "sxth'cond 'rd, 'rm, ror #16");
-                        break;
-                      case 3:
-                        Format(instr, "sxth'cond 'rd, 'rm, ror #24");
-                        break;
-                    }
-                  } else {
-                    switch (instr->Bits(11, 10)) {
-                      case 0:
-                        Format(instr, "sxtah'cond 'rd, 'rn, 'rm");
-                        break;
-                      case 1:
-                        Format(instr, "sxtah'cond 'rd, 'rn, 'rm, ror #8");
-                        break;
-                      case 2:
-                        Format(instr, "sxtah'cond 'rd, 'rn, 'rm, ror #16");
-                        break;
-                      case 3:
-                        Format(instr, "sxtah'cond 'rd, 'rn, 'rm, ror #24");
-                        break;
-                    }
-                  }
-                }
-              } else {
-                UNREACHABLE();
-              }
-              break;
-            case 2:
-              if ((instr->Bit(20) == 0) && (instr->Bits(9, 6) == 1)) {
-                if (instr->Bits(19, 16) == 0xF) {
-                  switch (instr->Bits(11, 10)) {
-                    case 0:
-                      Format(instr, "uxtb16'cond 'rd, 'rm");
-                      break;
-                    case 1:
-                      Format(instr, "uxtb16'cond 'rd, 'rm, ror #8");
-                      break;
-                    case 2:
-                      Format(instr, "uxtb16'cond 'rd, 'rm, ror #16");
-                      break;
-                    case 3:
-                      Format(instr, "uxtb16'cond 'rd, 'rm, ror #24");
-                      break;
-                  }
-                } else {
-                  UNREACHABLE();
-                }
-              } else {
-                UNREACHABLE();
-              }
-              break;
-            case 3:
-              if ((instr->Bits(9, 6) == 1)) {
-                if ((instr->Bit(20) == 0)) {
-                  if (instr->Bits(19, 16) == 0xF) {
-                    switch (instr->Bits(11, 10)) {
-                      case 0:
-                        Format(instr, "uxtb'cond 'rd, 'rm");
-                        break;
-                      case 1:
-                        Format(instr, "uxtb'cond 'rd, 'rm, ror #8");
-                        break;
-                      case 2:
-                        Format(instr, "uxtb'cond 'rd, 'rm, ror #16");
-                        break;
-                      case 3:
-                        Format(instr, "uxtb'cond 'rd, 'rm, ror #24");
-                        break;
-                    }
-                  } else {
-                    switch (instr->Bits(11, 10)) {
-                      case 0:
-                        Format(instr, "uxtab'cond 'rd, 'rn, 'rm");
-                        break;
-                      case 1:
-                        Format(instr, "uxtab'cond 'rd, 'rn, 'rm, ror #8");
-                        break;
-                      case 2:
-                        Format(instr, "uxtab'cond 'rd, 'rn, 'rm, ror #16");
-                        break;
-                      case 3:
-                        Format(instr, "uxtab'cond 'rd, 'rn, 'rm, ror #24");
-                        break;
-                    }
-                  }
-                } else {
-                  if (instr->Bits(19, 16) == 0xF) {
-                    switch (instr->Bits(11, 10)) {
-                      case 0:
-                        Format(instr, "uxth'cond 'rd, 'rm");
-                        break;
-                      case 1:
-                        Format(instr, "uxth'cond 'rd, 'rm, ror #8");
-                        break;
-                      case 2:
-                        Format(instr, "uxth'cond 'rd, 'rm, ror #16");
-                        break;
-                      case 3:
-                        Format(instr, "uxth'cond 'rd, 'rm, ror #24");
-                        break;
-                    }
-                  } else {
-                    switch (instr->Bits(11, 10)) {
-                      case 0:
-                        Format(instr, "uxtah'cond 'rd, 'rn, 'rm");
-                        break;
-                      case 1:
-                        Format(instr, "uxtah'cond 'rd, 'rn, 'rm, ror #8");
-                        break;
-                      case 2:
-                        Format(instr, "uxtah'cond 'rd, 'rn, 'rm, ror #16");
-                        break;
-                      case 3:
-                        Format(instr, "uxtah'cond 'rd, 'rn, 'rm, ror #24");
-                        break;
-                    }
-                  }
-                }
-              } else {
-                // PU == 0b01, BW == 0b11, Bits(9, 6) != 0b0001
-                if ((instr->Bits(20, 16) == 0x1F) &&
-                    (instr->Bits(11, 4) == 0xF3)) {
-                  Format(instr, "rbit'cond 'rd, 'rm");
-                } else {
-                  UNREACHABLE();
-                }
-              }
-              break;
-          }
-        }
-      }
-      break;
-    }
-    case db_x: {
-      if (instr->Bits(22, 20) == 0x5) {
-        if (instr->Bits(7, 4) == 0x1) {
-          if (instr->Bits(15, 12) == 0xF) {
-            Format(instr, "smmul'cond 'rn, 'rm, 'rs");
-          } else {
-            // SMMLA (in V8 notation matching ARM ISA format)
-            Format(instr, "smmla'cond 'rn, 'rm, 'rs, 'rd");
-          }
-          break;
-        }
-      }
-      if (instr->Bits(5, 4) == 0x1) {
-        if ((instr->Bit(22) == 0x0) && (instr->Bit(20) == 0x1)) {
-          if (instr->Bit(21) == 0x1) {
-            // UDIV (in V8 notation matching ARM ISA format) rn = rm/rs
-            Format(instr, "udiv'cond'b 'rn, 'rm, 'rs");
-          } else {
-            // SDIV (in V8 notation matching ARM ISA format) rn = rm/rs
-            Format(instr, "sdiv'cond'b 'rn, 'rm, 'rs");
-          }
-          break;
-        }
-      }
-      Format(instr, "'memop'cond'b 'rd, ['rn, -'shift_rm]'w");
-      break;
-    }
-    case ib_x: {
-      if (instr->HasW() && (instr->Bits(6, 4) == 0x5)) {
-        uint32_t widthminus1 = static_cast<uint32_t>(instr->Bits(20, 16));
-        uint32_t lsbit = static_cast<uint32_t>(instr->Bits(11, 7));
-        uint32_t msbit = widthminus1 + lsbit;
-        if (msbit <= 31) {
-          if (instr->Bit(22)) {
-            Format(instr, "ubfx'cond 'rd, 'rm, 'f");
-          } else {
-            Format(instr, "sbfx'cond 'rd, 'rm, 'f");
-          }
-        } else {
-          UNREACHABLE();
-        }
-      } else if (!instr->HasW() && (instr->Bits(6, 4) == 0x1)) {
-        uint32_t lsbit = static_cast<uint32_t>(instr->Bits(11, 7));
-        uint32_t msbit = static_cast<uint32_t>(instr->Bits(20, 16));
-        if (msbit >= lsbit) {
-          if (instr->RmValue() == 15) {
-            Format(instr, "bfc'cond 'rd, 'f");
-          } else {
-            Format(instr, "bfi'cond 'rd, 'rm, 'f");
-          }
-        } else {
-          UNREACHABLE();
-        }
-      } else {
-        Format(instr, "'memop'cond'b 'rd, ['rn, +'shift_rm]'w");
-      }
-      break;
-    }
-    default: {
-      // The PU field is a 2-bit field.
-      UNREACHABLE();
-      break;
-    }
-  }
-}
-
-
-void Decoder::DecodeType4(Instruction* instr) {
-  if (instr->Bit(22) != 0) {
-    // Privileged mode currently not supported.
-    Unknown(instr);
-  } else {
-    if (instr->HasL()) {
-      Format(instr, "ldm'cond'pu 'rn'w, 'rlist");
-    } else {
-      Format(instr, "stm'cond'pu 'rn'w, 'rlist");
-    }
-  }
-}
-
-
-void Decoder::DecodeType5(Instruction* instr) {
-  Format(instr, "b'l'cond 'target");
-}
-
-
-void Decoder::DecodeType6(Instruction* instr) {
-  DecodeType6CoprocessorIns(instr);
-}
-
-
-int Decoder::DecodeType7(Instruction* instr) {
-  if (instr->Bit(24) == 1) {
-    if (instr->SvcValue() >= kStopCode) {
-      Format(instr, "stop'cond 'svc");
-    } else {
-      Format(instr, "svc'cond 'svc");
-    }
-  } else {
-    switch (instr->CoprocessorValue()) {
-      case 10:  // Fall through.
-      case 11:
-        DecodeTypeVFP(instr);
-        break;
-      case 15:
-        DecodeTypeCP15(instr);
-        break;
-      default:
-        Unknown(instr);
-        break;
-    }
-  }
-  return Instruction::kInstrSize;
-}
-
-
-// void Decoder::DecodeTypeVFP(Instruction* instr)
-// vmov: Sn = Rt
-// vmov: Rt = Sn
-// vcvt: Dd = Sm
-// vcvt: Sd = Dm
-// vcvt.f64.s32 Dd, Dd, #<fbits>
-// Dd = vabs(Dm)
-// Sd = vabs(Sm)
-// Dd = vneg(Dm)
-// Sd = vneg(Sm)
-// Dd = vadd(Dn, Dm)
-// Sd = vadd(Sn, Sm)
-// Dd = vsub(Dn, Dm)
-// Sd = vsub(Sn, Sm)
-// Dd = vmul(Dn, Dm)
-// Sd = vmul(Sn, Sm)
-// Dd = vmla(Dn, Dm)
-// Sd = vmla(Sn, Sm)
-// Dd = vmls(Dn, Dm)
-// Sd = vmls(Sn, Sm)
-// Dd = vdiv(Dn, Dm)
-// Sd = vdiv(Sn, Sm)
-// vcmp(Dd, Dm)
-// vcmp(Sd, Sm)
-// Dd = vsqrt(Dm)
-// Sd = vsqrt(Sm)
-// vmrs
-// vmsr
-// Qd = vdup.size(Qd, Rt)
-// vmov.size: Dd[i] = Rt
-// vmov.sign.size: Rt = Dn[i]
-void Decoder::DecodeTypeVFP(Instruction* instr) {
-  VERIFY((instr->TypeValue() == 7) && (instr->Bit(24) == 0x0) );
-  VERIFY(instr->Bits(11, 9) == 0x5);
-
-  if (instr->Bit(4) == 0) {
-    if (instr->Opc1Value() == 0x7) {
-      // Other data processing instructions
-      if ((instr->Opc2Value() == 0x0) && (instr->Opc3Value() == 0x1)) {
-        // vmov register to register.
-        if (instr->SzValue() == 0x1) {
-          Format(instr, "vmov'cond.f64 'Dd, 'Dm");
-        } else {
-          Format(instr, "vmov'cond.f32 'Sd, 'Sm");
-        }
-      } else if ((instr->Opc2Value() == 0x0) && (instr->Opc3Value() == 0x3)) {
-        // vabs
-        if (instr->SzValue() == 0x1) {
-          Format(instr, "vabs'cond.f64 'Dd, 'Dm");
-        } else {
-          Format(instr, "vabs'cond.f32 'Sd, 'Sm");
-        }
-      } else if ((instr->Opc2Value() == 0x1) && (instr->Opc3Value() == 0x1)) {
-        // vneg
-        if (instr->SzValue() == 0x1) {
-          Format(instr, "vneg'cond.f64 'Dd, 'Dm");
-        } else {
-          Format(instr, "vneg'cond.f32 'Sd, 'Sm");
-        }
-      } else if ((instr->Opc2Value() == 0x7) && (instr->Opc3Value() == 0x3)) {
-        DecodeVCVTBetweenDoubleAndSingle(instr);
-      } else if ((instr->Opc2Value() == 0x8) && (instr->Opc3Value() & 0x1)) {
-        DecodeVCVTBetweenFloatingPointAndInteger(instr);
-      } else if ((instr->Opc2Value() == 0xA) && (instr->Opc3Value() == 0x3) &&
-                 (instr->Bit(8) == 1)) {
-        // vcvt.f64.s32 Dd, Dd, #<fbits>
-        int fraction_bits = 32 - ((instr->Bits(3, 0) << 1) | instr->Bit(5));
-        Format(instr, "vcvt'cond.f64.s32 'Dd, 'Dd");
-        out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                    ", #%d", fraction_bits);
-      } else if (((instr->Opc2Value() >> 1) == 0x6) &&
-                 (instr->Opc3Value() & 0x1)) {
-        DecodeVCVTBetweenFloatingPointAndInteger(instr);
-      } else if (((instr->Opc2Value() == 0x4) || (instr->Opc2Value() == 0x5)) &&
-                 (instr->Opc3Value() & 0x1)) {
-        DecodeVCMP(instr);
-      } else if (((instr->Opc2Value() == 0x1)) && (instr->Opc3Value() == 0x3)) {
-        if (instr->SzValue() == 0x1) {
-          Format(instr, "vsqrt'cond.f64 'Dd, 'Dm");
-        } else {
-          Format(instr, "vsqrt'cond.f32 'Sd, 'Sm");
-        }
-      } else if (instr->Opc3Value() == 0x0) {
-        if (instr->SzValue() == 0x1) {
-          Format(instr, "vmov'cond.f64 'Dd, 'd");
-        } else {
-          Format(instr, "vmov'cond.f32 'Sd, 'd");
-        }
-      } else if (((instr->Opc2Value() == 0x6)) && instr->Opc3Value() == 0x3) {
-        // vrintz - round towards zero (truncate)
-        if (instr->SzValue() == 0x1) {
-          Format(instr, "vrintz'cond.f64.f64 'Dd, 'Dm");
-        } else {
-          Format(instr, "vrintz'cond.f32.f32 'Sd, 'Sm");
-        }
-      } else {
-        Unknown(instr);  // Not used by V8.
-      }
-    } else if (instr->Opc1Value() == 0x3) {
-      if (instr->SzValue() == 0x1) {
-        if (instr->Opc3Value() & 0x1) {
-          Format(instr, "vsub'cond.f64 'Dd, 'Dn, 'Dm");
-        } else {
-          Format(instr, "vadd'cond.f64 'Dd, 'Dn, 'Dm");
-        }
-      } else {
-        if (instr->Opc3Value() & 0x1) {
-          Format(instr, "vsub'cond.f32 'Sd, 'Sn, 'Sm");
-        } else {
-          Format(instr, "vadd'cond.f32 'Sd, 'Sn, 'Sm");
-        }
-      }
-    } else if ((instr->Opc1Value() == 0x2) && !(instr->Opc3Value() & 0x1)) {
-      if (instr->SzValue() == 0x1) {
-        Format(instr, "vmul'cond.f64 'Dd, 'Dn, 'Dm");
-      } else {
-        Format(instr, "vmul'cond.f32 'Sd, 'Sn, 'Sm");
-      }
-    } else if ((instr->Opc1Value() == 0x0) && !(instr->Opc3Value() & 0x1)) {
-      if (instr->SzValue() == 0x1) {
-        Format(instr, "vmla'cond.f64 'Dd, 'Dn, 'Dm");
-      } else {
-        Format(instr, "vmla'cond.f32 'Sd, 'Sn, 'Sm");
-      }
-    } else if ((instr->Opc1Value() == 0x0) && (instr->Opc3Value() & 0x1)) {
-      if (instr->SzValue() == 0x1) {
-        Format(instr, "vmls'cond.f64 'Dd, 'Dn, 'Dm");
-      } else {
-        Format(instr, "vmls'cond.f32 'Sd, 'Sn, 'Sm");
-      }
-    } else if ((instr->Opc1Value() == 0x4) && !(instr->Opc3Value() & 0x1)) {
-      if (instr->SzValue() == 0x1) {
-        Format(instr, "vdiv'cond.f64 'Dd, 'Dn, 'Dm");
-      } else {
-        Format(instr, "vdiv'cond.f32 'Sd, 'Sn, 'Sm");
-      }
-    } else {
-      Unknown(instr);  // Not used by V8.
-    }
-  } else {
-    if ((instr->VCValue() == 0x0) &&
-        (instr->VAValue() == 0x0)) {
-      DecodeVMOVBetweenCoreAndSinglePrecisionRegisters(instr);
-    } else if ((instr->VLValue() == 0x0) && (instr->VCValue() == 0x1)) {
-      const char* rt_name = converter_.NameOfCPURegister(instr->RtValue());
-      if (instr->Bit(23) == 0) {
-        int opc1_opc2 = (instr->Bits(22, 21) << 2) | instr->Bits(6, 5);
-        if ((opc1_opc2 & 0xB) == 0) {
-          // NeonS32/NeonU32
-          if (instr->Bit(21) == 0x0) {
-            Format(instr, "vmov'cond.32 'Dd[0], 'rt");
-          } else {
-            Format(instr, "vmov'cond.32 'Dd[1], 'rt");
-          }
-        } else {
-          int vd = instr->VFPNRegValue(kDoublePrecision);
-          if ((opc1_opc2 & 0x8) != 0) {
-            // NeonS8 / NeonU8
-            int i = opc1_opc2 & 0x7;
-            out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                        "vmov.8 d%d[%d], %s", vd, i, rt_name);
-          } else if ((opc1_opc2 & 0x1) != 0) {
-            // NeonS16 / NeonU16
-            int i = (opc1_opc2 >> 1) & 0x3;
-            out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                        "vmov.16 d%d[%d], %s", vd, i, rt_name);
-          } else {
-            Unknown(instr);
-          }
-        }
-      } else {
-        int size = 32;
-        if (instr->Bit(5) != 0) {
-          size = 16;
-        } else if (instr->Bit(22) != 0) {
-          size = 8;
-        }
-        int Vd = instr->VFPNRegValue(kSimd128Precision);
-        out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                    "vdup.%i q%d, %s", size, Vd, rt_name);
-      }
-    } else if ((instr->VLValue() == 0x1) && (instr->VCValue() == 0x1)) {
-      int opc1_opc2 = (instr->Bits(22, 21) << 2) | instr->Bits(6, 5);
-      if ((opc1_opc2 & 0xB) == 0) {
-        // NeonS32 / NeonU32
-        if (instr->Bit(21) == 0x0) {
-          Format(instr, "vmov'cond.32 'rt, 'Dd[0]");
-        } else {
-          Format(instr, "vmov'cond.32 'rt, 'Dd[1]");
-        }
-      } else {
-        char sign = instr->Bit(23) != 0 ? 'u' : 's';
-        const char* rt_name = converter_.NameOfCPURegister(instr->RtValue());
-        int vn = instr->VFPNRegValue(kDoublePrecision);
-        if ((opc1_opc2 & 0x8) != 0) {
-          // NeonS8 / NeonU8
-          int i = opc1_opc2 & 0x7;
-          out_buffer_pos_ +=
-              SNPrintF(out_buffer_ + out_buffer_pos_, "vmov.%c8 %s, d%d[%d]",
-                       sign, rt_name, vn, i);
-        } else if ((opc1_opc2 & 0x1) != 0) {
-          // NeonS16 / NeonU16
-          int i = (opc1_opc2 >> 1) & 0x3;
-          out_buffer_pos_ +=
-              SNPrintF(out_buffer_ + out_buffer_pos_, "vmov.%c16 %s, d%d[%d]",
-                       sign, rt_name, vn, i);
-        } else {
-          Unknown(instr);
-        }
-      }
-    } else if ((instr->VCValue() == 0x0) &&
-               (instr->VAValue() == 0x7) &&
-               (instr->Bits(19, 16) == 0x1)) {
-      if (instr->VLValue() == 0) {
-        if (instr->Bits(15, 12) == 0xF) {
-          Format(instr, "vmsr'cond FPSCR, APSR");
-        } else {
-          Format(instr, "vmsr'cond FPSCR, 'rt");
-        }
-      } else {
-        if (instr->Bits(15, 12) == 0xF) {
-          Format(instr, "vmrs'cond APSR, FPSCR");
-        } else {
-          Format(instr, "vmrs'cond 'rt, FPSCR");
-        }
-      }
-    } else {
-      Unknown(instr);  // Not used by V8.
-    }
-  }
-}
-
-void Decoder::DecodeTypeCP15(Instruction* instr) {
-  VERIFY((instr->TypeValue() == 7) && (instr->Bit(24) == 0x0));
-  VERIFY(instr->CoprocessorValue() == 15);
-
-  if (instr->Bit(4) == 1) {
-    int crn = instr->Bits(19, 16);
-    int crm = instr->Bits(3, 0);
-    int opc1 = instr->Bits(23, 21);
-    int opc2 = instr->Bits(7, 5);
-    if ((opc1 == 0) && (crn == 7)) {
-      // ARMv6 memory barrier operations.
-      // Details available in ARM DDI 0406C.b, B3-1750.
-      if ((crm == 10) && (opc2 == 5)) {
-        Format(instr, "mcr'cond (CP15DMB)");
-      } else if ((crm == 10) && (opc2 == 4)) {
-        Format(instr, "mcr'cond (CP15DSB)");
-      } else if ((crm == 5) && (opc2 == 4)) {
-        Format(instr, "mcr'cond (CP15ISB)");
-      } else {
-        Unknown(instr);
-      }
-    } else {
-      Unknown(instr);
-    }
-  } else {
-    Unknown(instr);
-  }
-}
-
-void Decoder::DecodeVMOVBetweenCoreAndSinglePrecisionRegisters(
-    Instruction* instr) {
-  VERIFY((instr->Bit(4) == 1) && (instr->VCValue() == 0x0) &&
-         (instr->VAValue() == 0x0));
-
-  bool to_arm_register = (instr->VLValue() == 0x1);
-
-  if (to_arm_register) {
-    Format(instr, "vmov'cond 'rt, 'Sn");
-  } else {
-    Format(instr, "vmov'cond 'Sn, 'rt");
-  }
-}
-
-
-void Decoder::DecodeVCMP(Instruction* instr) {
-  VERIFY((instr->Bit(4) == 0) && (instr->Opc1Value() == 0x7));
-  VERIFY(((instr->Opc2Value() == 0x4) || (instr->Opc2Value() == 0x5)) &&
-         (instr->Opc3Value() & 0x1));
-
-  // Comparison.
-  bool dp_operation = (instr->SzValue() == 1);
-  bool raise_exception_for_qnan = (instr->Bit(7) == 0x1);
-
-  if (dp_operation && !raise_exception_for_qnan) {
-    if (instr->Opc2Value() == 0x4) {
-      Format(instr, "vcmp'cond.f64 'Dd, 'Dm");
-    } else if (instr->Opc2Value() == 0x5) {
-      Format(instr, "vcmp'cond.f64 'Dd, #0.0");
-    } else {
-      Unknown(instr);  // invalid
-    }
-  } else if (!raise_exception_for_qnan) {
-    if (instr->Opc2Value() == 0x4) {
-      Format(instr, "vcmp'cond.f32 'Sd, 'Sm");
-    } else if (instr->Opc2Value() == 0x5) {
-      Format(instr, "vcmp'cond.f32 'Sd, #0.0");
-    } else {
-      Unknown(instr);  // invalid
-    }
-  } else {
-    Unknown(instr);  // Not used by V8.
-  }
-}
-
-
-void Decoder::DecodeVCVTBetweenDoubleAndSingle(Instruction* instr) {
-  VERIFY((instr->Bit(4) == 0) && (instr->Opc1Value() == 0x7));
-  VERIFY((instr->Opc2Value() == 0x7) && (instr->Opc3Value() == 0x3));
-
-  bool double_to_single = (instr->SzValue() == 1);
-
-  if (double_to_single) {
-    Format(instr, "vcvt'cond.f32.f64 'Sd, 'Dm");
-  } else {
-    Format(instr, "vcvt'cond.f64.f32 'Dd, 'Sm");
-  }
-}
-
-
-void Decoder::DecodeVCVTBetweenFloatingPointAndInteger(Instruction* instr) {
-  VERIFY((instr->Bit(4) == 0) && (instr->Opc1Value() == 0x7));
-  VERIFY(((instr->Opc2Value() == 0x8) && (instr->Opc3Value() & 0x1)) ||
-         (((instr->Opc2Value() >> 1) == 0x6) && (instr->Opc3Value() & 0x1)));
-
-  bool to_integer = (instr->Bit(18) == 1);
-  bool dp_operation = (instr->SzValue() == 1);
-  if (to_integer) {
-    bool unsigned_integer = (instr->Bit(16) == 0);
-
-    if (dp_operation) {
-      if (unsigned_integer) {
-        Format(instr, "vcvt'cond.u32.f64 'Sd, 'Dm");
-      } else {
-        Format(instr, "vcvt'cond.s32.f64 'Sd, 'Dm");
-      }
-    } else {
-      if (unsigned_integer) {
-        Format(instr, "vcvt'cond.u32.f32 'Sd, 'Sm");
-      } else {
-        Format(instr, "vcvt'cond.s32.f32 'Sd, 'Sm");
-      }
-    }
-  } else {
-    bool unsigned_integer = (instr->Bit(7) == 0);
-
-    if (dp_operation) {
-      if (unsigned_integer) {
-        Format(instr, "vcvt'cond.f64.u32 'Dd, 'Sm");
-      } else {
-        Format(instr, "vcvt'cond.f64.s32 'Dd, 'Sm");
-      }
-    } else {
-      if (unsigned_integer) {
-        Format(instr, "vcvt'cond.f32.u32 'Sd, 'Sm");
-      } else {
-        Format(instr, "vcvt'cond.f32.s32 'Sd, 'Sm");
-      }
-    }
-  }
-}
-
-
-// Decode Type 6 coprocessor instructions.
-// Dm = vmov(Rt, Rt2)
-// <Rt, Rt2> = vmov(Dm)
-// Ddst = MEM(Rbase + 4*offset).
-// MEM(Rbase + 4*offset) = Dsrc.
-void Decoder::DecodeType6CoprocessorIns(Instruction* instr) {
-  VERIFY(instr->TypeValue() == 6);
-
-  if (instr->CoprocessorValue() == 0xA) {
-    switch (instr->OpcodeValue()) {
-      case 0x8:
-      case 0xA:
-        if (instr->HasL()) {
-          Format(instr, "vldr'cond 'Sd, ['rn - 4*'imm08@00]");
-        } else {
-          Format(instr, "vstr'cond 'Sd, ['rn - 4*'imm08@00]");
-        }
-        break;
-      case 0xC:
-      case 0xE:
-        if (instr->HasL()) {
-          Format(instr, "vldr'cond 'Sd, ['rn + 4*'imm08@00]");
-        } else {
-          Format(instr, "vstr'cond 'Sd, ['rn + 4*'imm08@00]");
-        }
-        break;
-      case 0x4:
-      case 0x5:
-      case 0x6:
-      case 0x7:
-      case 0x9:
-      case 0xB: {
-        bool to_vfp_register = (instr->VLValue() == 0x1);
-        if (to_vfp_register) {
-          Format(instr, "vldm'cond'pu 'rn'w, {'Sd-'Sd+}");
-        } else {
-          Format(instr, "vstm'cond'pu 'rn'w, {'Sd-'Sd+}");
-        }
-        break;
-      }
-      default:
-        Unknown(instr);  // Not used by V8.
-    }
-  } else if (instr->CoprocessorValue() == 0xB) {
-    switch (instr->OpcodeValue()) {
-      case 0x2:
-        // Load and store double to two GP registers
-        if (instr->Bits(7, 6) != 0 || instr->Bit(4) != 1) {
-          Unknown(instr);  // Not used by V8.
-        } else if (instr->HasL()) {
-          Format(instr, "vmov'cond 'rt, 'rn, 'Dm");
-        } else {
-          Format(instr, "vmov'cond 'Dm, 'rt, 'rn");
-        }
-        break;
-      case 0x8:
-      case 0xA:
-        if (instr->HasL()) {
-          Format(instr, "vldr'cond 'Dd, ['rn - 4*'imm08@00]");
-        } else {
-          Format(instr, "vstr'cond 'Dd, ['rn - 4*'imm08@00]");
-        }
-        break;
-      case 0xC:
-      case 0xE:
-        if (instr->HasL()) {
-          Format(instr, "vldr'cond 'Dd, ['rn + 4*'imm08@00]");
-        } else {
-          Format(instr, "vstr'cond 'Dd, ['rn + 4*'imm08@00]");
-        }
-        break;
-      case 0x4:
-      case 0x5:
-      case 0x6:
-      case 0x7:
-      case 0x9:
-      case 0xB: {
-        bool to_vfp_register = (instr->VLValue() == 0x1);
-        if (to_vfp_register) {
-          Format(instr, "vldm'cond'pu 'rn'w, {'Dd-'Dd+}");
-        } else {
-          Format(instr, "vstm'cond'pu 'rn'w, {'Dd-'Dd+}");
-        }
-        break;
-      }
-      default:
-        Unknown(instr);  // Not used by V8.
-    }
-  } else {
-    Unknown(instr);  // Not used by V8.
-  }
-}
-
-
-static const char* const barrier_option_names[] = {
-    "invalid", "oshld", "oshst", "osh", "invalid", "nshld", "nshst", "nsh",
-    "invalid", "ishld", "ishst", "ish", "invalid", "ld",    "st",    "sy",
-};
-
-
-void Decoder::DecodeSpecialCondition(Instruction* instr) {
-  switch (instr->SpecialValue()) {
-    case 4: {
-      int Vd, Vm, Vn;
-      if (instr->Bit(6) == 0) {
-        Vd = instr->VFPDRegValue(kDoublePrecision);
-        Vm = instr->VFPMRegValue(kDoublePrecision);
-        Vn = instr->VFPNRegValue(kDoublePrecision);
-      } else {
-        Vd = instr->VFPDRegValue(kSimd128Precision);
-        Vm = instr->VFPMRegValue(kSimd128Precision);
-        Vn = instr->VFPNRegValue(kSimd128Precision);
-      }
-      int size = kBitsPerByte * (1 << instr->Bits(21, 20));
-      switch (instr->Bits(11, 8)) {
-        case 0x0: {
-          if (instr->Bit(4) == 1) {
-            // vqadd.s<size> Qd, Qm, Qn.
-            out_buffer_pos_ +=
-                SNPrintF(out_buffer_ + out_buffer_pos_,
-                         "vqadd.s%d q%d, q%d, q%d", size, Vd, Vn, Vm);
-          } else {
-            Unknown(instr);
-          }
-          break;
-        }
-        case 0x1: {
-          if (instr->Bits(21, 20) == 2 && instr->Bit(6) == 1 &&
-              instr->Bit(4) == 1) {
-            if (Vm == Vn) {
-              // vmov Qd, Qm
-              out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                          "vmov q%d, q%d", Vd, Vm);
-            } else {
-              // vorr Qd, Qm, Qn.
-              out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                          "vorr q%d, q%d, q%d", Vd, Vn, Vm);
-            }
-          } else if (instr->Bits(21, 20) == 0 && instr->Bit(6) == 1 &&
-                     instr->Bit(4) == 1) {
-            // vand Qd, Qm, Qn.
-            out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                        "vand q%d, q%d, q%d", Vd, Vn, Vm);
-          } else {
-            Unknown(instr);
-          }
-          break;
-        }
-        case 0x2: {
-          if (instr->Bit(4) == 1) {
-            // vqsub.s<size> Qd, Qm, Qn.
-            out_buffer_pos_ +=
-                SNPrintF(out_buffer_ + out_buffer_pos_,
-                         "vqsub.s%d q%d, q%d, q%d", size, Vd, Vn, Vm);
-          } else {
-            Unknown(instr);
-          }
-          break;
-        }
-        case 0x3: {
-          const char* op = (instr->Bit(4) == 1) ? "vcge" : "vcgt";
-          // vcge/vcgt.s<size> Qd, Qm, Qn.
-          out_buffer_pos_ +=
-              SNPrintF(out_buffer_ + out_buffer_pos_, "%s.s%d q%d, q%d, q%d",
-                       op, size, Vd, Vn, Vm);
-          break;
-        }
-        case 0x6: {
-          // vmin/vmax.s<size> Qd, Qm, Qn.
-          const char* op = instr->Bit(4) == 1 ? "vmin" : "vmax";
-          out_buffer_pos_ +=
-              SNPrintF(out_buffer_ + out_buffer_pos_, "%s.s%d q%d, q%d, q%d",
-                       op, size, Vd, Vn, Vm);
-          break;
-        }
-        case 0x8: {
-          const char* op = (instr->Bit(4) == 0) ? "vadd" : "vtst";
-          // vadd/vtst.i<size> Qd, Qm, Qn.
-          out_buffer_pos_ +=
-              SNPrintF(out_buffer_ + out_buffer_pos_, "%s.i%d q%d, q%d, q%d",
-                       op, size, Vd, Vn, Vm);
-          break;
-        }
-        case 0x9: {
-          if (instr->Bit(6) == 1 && instr->Bit(4) == 1) {
-            // vmul.i<size> Qd, Qm, Qn.
-            out_buffer_pos_ +=
-                SNPrintF(out_buffer_ + out_buffer_pos_,
-                         "vmul.i%d q%d, q%d, q%d", size, Vd, Vn, Vm);
-          } else {
-            Unknown(instr);
-          }
-          break;
-        }
-        case 0xA: {
-          // vpmin/vpmax.s<size> Dd, Dm, Dn.
-          const char* op = instr->Bit(4) == 1 ? "vpmin" : "vpmax";
-          out_buffer_pos_ +=
-              SNPrintF(out_buffer_ + out_buffer_pos_, "%s.s%d d%d, d%d, d%d",
-                       op, size, Vd, Vn, Vm);
-          break;
-        }
-        case 0xB: {
-          // vpadd.i<size> Dd, Dm, Dn.
-          out_buffer_pos_ +=
-              SNPrintF(out_buffer_ + out_buffer_pos_, "vpadd.i%d d%d, d%d, d%d",
-                       size, Vd, Vn, Vm);
-          break;
-        }
-        case 0xD: {
-          if (instr->Bit(4) == 0) {
-            const char* op = (instr->Bits(21, 20) == 0) ? "vadd" : "vsub";
-            // vadd/vsub.f32 Qd, Qm, Qn.
-            out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                        "%s.f32 q%d, q%d, q%d", op, Vd, Vn, Vm);
-          } else {
-            Unknown(instr);
-          }
-          break;
-        }
-        case 0xE: {
-          if (instr->Bits(21, 20) == 0 && instr->Bit(4) == 0) {
-            // vceq.f32 Qd, Qm, Qn.
-            out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                        "vceq.f32 q%d, q%d, q%d", Vd, Vn, Vm);
-          } else {
-            Unknown(instr);
-          }
-          break;
-        }
-        case 0xF: {
-          if (instr->Bit(20) == 0 && instr->Bit(6) == 1) {
-            if (instr->Bit(4) == 1) {
-              // vrecps/vrsqrts.f32 Qd, Qm, Qn.
-              const char* op = instr->Bit(21) == 0 ? "vrecps" : "vrsqrts";
-              out_buffer_pos_ +=
-                  SNPrintF(out_buffer_ + out_buffer_pos_,
-                           "%s.f32 q%d, q%d, q%d", op, Vd, Vn, Vm);
-            } else {
-              // vmin/max.f32 Qd, Qm, Qn.
-              const char* op = instr->Bit(21) == 1 ? "vmin" : "vmax";
-              out_buffer_pos_ +=
-                  SNPrintF(out_buffer_ + out_buffer_pos_,
-                           "%s.f32 q%d, q%d, q%d", op, Vd, Vn, Vm);
-            }
-          } else {
-            Unknown(instr);
-          }
-          break;
-        }
-        default:
-          Unknown(instr);
-          break;
-      }
-      break;
-    }
-    case 5:
-      if ((instr->Bits(18, 16) == 0) && (instr->Bits(11, 6) == 0x28) &&
-          (instr->Bit(4) == 1)) {
-        // vmovl signed
-        if ((instr->VdValue() & 1) != 0) Unknown(instr);
-        int Vd = (instr->Bit(22) << 3) | (instr->VdValue() >> 1);
-        int Vm = (instr->Bit(5) << 4) | instr->VmValue();
-        int imm3 = instr->Bits(21, 19);
-        out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                    "vmovl.s%d q%d, d%d", imm3 * 8, Vd, Vm);
-      } else if (instr->Bits(21, 20) == 3 && instr->Bit(4) == 0) {
-        // vext.8 Qd, Qm, Qn, imm4
-        int imm4 = instr->Bits(11, 8);
-        int Vd = instr->VFPDRegValue(kSimd128Precision);
-        int Vm = instr->VFPMRegValue(kSimd128Precision);
-        int Vn = instr->VFPNRegValue(kSimd128Precision);
-        out_buffer_pos_ +=
-            SNPrintF(out_buffer_ + out_buffer_pos_, "vext.8 q%d, q%d, q%d, #%d",
-                     Vd, Vn, Vm, imm4);
-      } else if (instr->Bits(11, 7) == 0xA && instr->Bit(4) == 1) {
-        // vshl.i<size> Qd, Qm, shift
-        int size = base::bits::RoundDownToPowerOfTwo32(instr->Bits(21, 16));
-        int shift = instr->Bits(21, 16) - size;
-        int Vd = instr->VFPDRegValue(kSimd128Precision);
-        int Vm = instr->VFPMRegValue(kSimd128Precision);
-        out_buffer_pos_ +=
-            SNPrintF(out_buffer_ + out_buffer_pos_, "vshl.i%d q%d, q%d, #%d",
-                     size, Vd, Vm, shift);
-      } else if (instr->Bits(11, 7) == 0 && instr->Bit(4) == 1) {
-        // vshr.s<size> Qd, Qm, shift
-        int size = base::bits::RoundDownToPowerOfTwo32(instr->Bits(21, 16));
-        int shift = 2 * size - instr->Bits(21, 16);
-        int Vd = instr->VFPDRegValue(kSimd128Precision);
-        int Vm = instr->VFPMRegValue(kSimd128Precision);
-        out_buffer_pos_ +=
-            SNPrintF(out_buffer_ + out_buffer_pos_, "vshr.s%d q%d, q%d, #%d",
-                     size, Vd, Vm, shift);
-      } else {
-        Unknown(instr);
-      }
-      break;
-    case 6: {
-      int Vd, Vm, Vn;
-      if (instr->Bit(6) == 0) {
-        Vd = instr->VFPDRegValue(kDoublePrecision);
-        Vm = instr->VFPMRegValue(kDoublePrecision);
-        Vn = instr->VFPNRegValue(kDoublePrecision);
-      } else {
-        Vd = instr->VFPDRegValue(kSimd128Precision);
-        Vm = instr->VFPMRegValue(kSimd128Precision);
-        Vn = instr->VFPNRegValue(kSimd128Precision);
-      }
-      int size = kBitsPerByte * (1 << instr->Bits(21, 20));
-      switch (instr->Bits(11, 8)) {
-        case 0x0: {
-          if (instr->Bit(4) == 1) {
-            // vqadd.u<size> Qd, Qm, Qn.
-            out_buffer_pos_ +=
-                SNPrintF(out_buffer_ + out_buffer_pos_,
-                         "vqadd.u%d q%d, q%d, q%d", size, Vd, Vn, Vm);
-          } else {
-            Unknown(instr);
-          }
-          break;
-        }
-        case 0x1: {
-          if (instr->Bits(21, 20) == 1 && instr->Bit(4) == 1) {
-            out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                        "vbsl q%d, q%d, q%d", Vd, Vn, Vm);
-          } else if (instr->Bits(21, 20) == 0 && instr->Bit(4) == 1) {
-            if (instr->Bit(6) == 0) {
-              // veor Dd, Dn, Dm
-              out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                          "veor d%d, d%d, d%d", Vd, Vn, Vm);
-
-            } else {
-              // veor Qd, Qn, Qm
-              out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                          "veor q%d, q%d, q%d", Vd, Vn, Vm);
-            }
-          } else {
-            Unknown(instr);
-          }
-          break;
-        }
-        case 0x2: {
-          if (instr->Bit(4) == 1) {
-            // vqsub.u<size> Qd, Qm, Qn.
-            out_buffer_pos_ +=
-                SNPrintF(out_buffer_ + out_buffer_pos_,
-                         "vqsub.u%d q%d, q%d, q%d", size, Vd, Vn, Vm);
-          } else {
-            Unknown(instr);
-          }
-          break;
-        }
-        case 0x3: {
-          const char* op = (instr->Bit(4) == 1) ? "vcge" : "vcgt";
-          // vcge/vcgt.u<size> Qd, Qm, Qn.
-          out_buffer_pos_ +=
-              SNPrintF(out_buffer_ + out_buffer_pos_, "%s.u%d q%d, q%d, q%d",
-                       op, size, Vd, Vn, Vm);
-          break;
-        }
-        case 0x6: {
-          // vmin/vmax.u<size> Qd, Qm, Qn.
-          const char* op = instr->Bit(4) == 1 ? "vmin" : "vmax";
-          out_buffer_pos_ +=
-              SNPrintF(out_buffer_ + out_buffer_pos_, "%s.u%d q%d, q%d, q%d",
-                       op, size, Vd, Vn, Vm);
-          break;
-        }
-        case 0x8: {
-          if (instr->Bit(4) == 0) {
-            out_buffer_pos_ +=
-                SNPrintF(out_buffer_ + out_buffer_pos_,
-                         "vsub.i%d q%d, q%d, q%d", size, Vd, Vn, Vm);
-          } else {
-            out_buffer_pos_ +=
-                SNPrintF(out_buffer_ + out_buffer_pos_,
-                         "vceq.i%d q%d, q%d, q%d", size, Vd, Vn, Vm);
-          }
-          break;
-        }
-        case 0xA: {
-          // vpmin/vpmax.u<size> Dd, Dm, Dn.
-          const char* op = instr->Bit(4) == 1 ? "vpmin" : "vpmax";
-          out_buffer_pos_ +=
-              SNPrintF(out_buffer_ + out_buffer_pos_, "%s.u%d d%d, d%d, d%d",
-                       op, size, Vd, Vn, Vm);
-          break;
-        }
-        case 0xD: {
-          if (instr->Bits(21, 20) == 0 && instr->Bit(6) == 1 &&
-              instr->Bit(4) == 1) {
-            // vmul.f32 Qd, Qm, Qn
-            out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                        "vmul.f32 q%d, q%d, q%d", Vd, Vn, Vm);
-          } else if (instr->Bits(21, 20) == 0 && instr->Bit(6) == 0 &&
-                     instr->Bit(4) == 0) {
-            // vpadd.f32 Dd, Dm, Dn.
-            out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                        "vpadd.f32 d%d, d%d, d%d", Vd, Vn, Vm);
-          } else {
-            Unknown(instr);
-          }
-          break;
-        }
-        case 0xE: {
-          if (instr->Bit(20) == 0 && instr->Bit(4) == 0) {
-            const char* op = (instr->Bit(21) == 0) ? "vcge" : "vcgt";
-            // vcge/vcgt.f32 Qd, Qm, Qn.
-            out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                        "%s.f32 q%d, q%d, q%d", op, Vd, Vn, Vm);
-          } else {
-            Unknown(instr);
-          }
-          break;
-        }
-        default:
-          Unknown(instr);
-          break;
-      }
-      break;
-    }
-    case 7:
-      if ((instr->Bits(18, 16) == 0) && (instr->Bits(11, 6) == 0x28) &&
-          (instr->Bit(4) == 1)) {
-        // vmovl unsigned
-        if ((instr->VdValue() & 1) != 0) Unknown(instr);
-        int Vd = (instr->Bit(22) << 3) | (instr->VdValue() >> 1);
-        int Vm = (instr->Bit(5) << 4) | instr->VmValue();
-        int imm3 = instr->Bits(21, 19);
-        out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                    "vmovl.u%d q%d, d%d", imm3 * 8, Vd, Vm);
-      } else if (instr->Opc1Value() == 7 && instr->Bit(4) == 0) {
-        if (instr->Bits(11, 7) == 0x18) {
-          int Vm = instr->VFPMRegValue(kDoublePrecision);
-          int imm4 = instr->Bits(19, 16);
-          int size = 0, index = 0;
-          if ((imm4 & 0x1) != 0) {
-            size = 8;
-            index = imm4 >> 1;
-          } else if ((imm4 & 0x2) != 0) {
-            size = 16;
-            index = imm4 >> 2;
-          } else {
-            size = 32;
-            index = imm4 >> 3;
-          }
-          if (instr->Bit(6) == 0) {
-            int Vd = instr->VFPDRegValue(kDoublePrecision);
-            out_buffer_pos_ +=
-                SNPrintF(out_buffer_ + out_buffer_pos_, "vdup.%i d%d, d%d[%d]",
-                         size, Vd, Vm, index);
-          } else {
-            int Vd = instr->VFPDRegValue(kSimd128Precision);
-            out_buffer_pos_ +=
-                SNPrintF(out_buffer_ + out_buffer_pos_, "vdup.%i q%d, d%d[%d]",
-                         size, Vd, Vm, index);
-          }
-        } else if (instr->Bits(11, 10) == 0x2) {
-          int Vd = instr->VFPDRegValue(kDoublePrecision);
-          int Vn = instr->VFPNRegValue(kDoublePrecision);
-          int Vm = instr->VFPMRegValue(kDoublePrecision);
-          int len = instr->Bits(9, 8);
-          NeonListOperand list(DwVfpRegister::from_code(Vn), len + 1);
-          out_buffer_pos_ +=
-              SNPrintF(out_buffer_ + out_buffer_pos_, "%s d%d, ",
-                       instr->Bit(6) == 0 ? "vtbl.8" : "vtbx.8", Vd);
-          FormatNeonList(Vn, list.type());
-          Print(", ");
-          PrintDRegister(Vm);
-        } else if (instr->Bits(17, 16) == 0x2 && instr->Bits(11, 8) == 0x2 &&
-                   instr->Bits(7, 6) != 0) {
-          // vqmovn.<type><size> Dd, Qm.
-          int Vd = instr->VFPDRegValue(kDoublePrecision);
-          int Vm = instr->VFPMRegValue(kSimd128Precision);
-          char type = instr->Bit(6) != 0 ? 'u' : 's';
-          int size = 2 * kBitsPerByte * (1 << instr->Bits(19, 18));
-          out_buffer_pos_ +=
-              SNPrintF(out_buffer_ + out_buffer_pos_, "vqmovn.%c%i d%d, q%d",
-                       type, size, Vd, Vm);
-        } else {
-          int Vd, Vm;
-          if (instr->Bit(6) == 0) {
-            Vd = instr->VFPDRegValue(kDoublePrecision);
-            Vm = instr->VFPMRegValue(kDoublePrecision);
-          } else {
-            Vd = instr->VFPDRegValue(kSimd128Precision);
-            Vm = instr->VFPMRegValue(kSimd128Precision);
-          }
-          if (instr->Bits(17, 16) == 0x2 && instr->Bits(11, 7) == 0) {
-            if (instr->Bit(6) == 0) {
-              out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                          "vswp d%d, d%d", Vd, Vm);
-            } else {
-              out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                          "vswp q%d, q%d", Vd, Vm);
-            }
-          } else if (instr->Bits(19, 16) == 0 && instr->Bits(11, 6) == 0x17) {
-            out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                        "vmvn q%d, q%d", Vd, Vm);
-          } else if (instr->Bits(19, 16) == 0xB && instr->Bits(11, 9) == 0x3 &&
-                     instr->Bit(6) == 1) {
-            const char* suffix = nullptr;
-            int op = instr->Bits(8, 7);
-            switch (op) {
-              case 0:
-                suffix = "f32.s32";
-                break;
-              case 1:
-                suffix = "f32.u32";
-                break;
-              case 2:
-                suffix = "s32.f32";
-                break;
-              case 3:
-                suffix = "u32.f32";
-                break;
-            }
-            out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                        "vcvt.%s q%d, q%d", suffix, Vd, Vm);
-          } else if (instr->Bits(17, 16) == 0x2 && instr->Bits(11, 8) == 0x1) {
-            int size = kBitsPerByte * (1 << instr->Bits(19, 18));
-            const char* op = instr->Bit(7) != 0 ? "vzip" : "vuzp";
-            if (instr->Bit(6) == 0) {
-              // vzip/vuzp.<size> Dd, Dm.
-              out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                          "%s.%d d%d, d%d", op, size, Vd, Vm);
-            } else {
-              // vzip/vuzp.<size> Qd, Qm.
-              out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                          "%s.%d q%d, q%d", op, size, Vd, Vm);
-            }
-          } else if (instr->Bits(17, 16) == 0 && instr->Bits(11, 9) == 0 &&
-                     instr->Bit(6) == 1) {
-            int size = kBitsPerByte * (1 << instr->Bits(19, 18));
-            int op = kBitsPerByte
-                     << (static_cast<int>(Neon64) - instr->Bits(8, 7));
-            // vrev<op>.<size> Qd, Qm.
-            out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                        "vrev%d.%d q%d, q%d", op, size, Vd, Vm);
-          } else if (instr->Bits(17, 16) == 0x2 && instr->Bits(11, 7) == 0x1) {
-            int size = kBitsPerByte * (1 << instr->Bits(19, 18));
-            if (instr->Bit(6) == 0) {
-              // vtrn.<size> Dd, Dm.
-              out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                          "vtrn.%d d%d, d%d", size, Vd, Vm);
-            } else {
-              // vtrn.<size> Qd, Qm.
-              out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                          "vtrn.%d q%d, q%d", size, Vd, Vm);
-            }
-          } else if (instr->Bits(17, 16) == 0x1 && instr->Bit(11) == 0 &&
-                     instr->Bit(6) == 1) {
-            int size = kBitsPerByte * (1 << instr->Bits(19, 18));
-            char type = instr->Bit(10) != 0 ? 'f' : 's';
-            if (instr->Bits(9, 6) == 0xD) {
-              // vabs<type>.<size> Qd, Qm.
-              out_buffer_pos_ +=
-                  SNPrintF(out_buffer_ + out_buffer_pos_, "vabs.%c%d q%d, q%d",
-                           type, size, Vd, Vm);
-            } else if (instr->Bits(9, 6) == 0xF) {
-              // vneg<type>.<size> Qd, Qm.
-              out_buffer_pos_ +=
-                  SNPrintF(out_buffer_ + out_buffer_pos_, "vneg.%c%d q%d, q%d",
-                           type, size, Vd, Vm);
-            } else {
-              Unknown(instr);
-            }
-          } else if (instr->Bits(19, 18) == 0x2 && instr->Bits(11, 8) == 0x5 &&
-                     instr->Bit(6) == 1) {
-            // vrecpe/vrsqrte.f32 Qd, Qm.
-            const char* op = instr->Bit(7) == 0 ? "vrecpe" : "vrsqrte";
-            out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                        "%s.f32 q%d, q%d", op, Vd, Vm);
-          } else {
-            Unknown(instr);
-          }
-        }
-      } else if (instr->Bits(11, 7) == 0 && instr->Bit(4) == 1 &&
-                 instr->Bit(6) == 1) {
-        // vshr.u<size> Qd, Qm, shift
-        int size = base::bits::RoundDownToPowerOfTwo32(instr->Bits(21, 16));
-        int shift = 2 * size - instr->Bits(21, 16);
-        int Vd = instr->VFPDRegValue(kSimd128Precision);
-        int Vm = instr->VFPMRegValue(kSimd128Precision);
-        out_buffer_pos_ +=
-            SNPrintF(out_buffer_ + out_buffer_pos_, "vshr.u%d q%d, q%d, #%d",
-                     size, Vd, Vm, shift);
-      } else if (instr->Bit(10) == 1 && instr->Bit(6) == 0 &&
-                 instr->Bit(4) == 1) {
-        // vsli.<size> Dd, Dm, shift
-        // vsri.<size> Dd, Dm, shift
-        int imm7 = instr->Bits(21, 16);
-        if (instr->Bit(7) != 0) imm7 += 64;
-        int size = base::bits::RoundDownToPowerOfTwo32(imm7);
-        int shift;
-        char direction;
-        if (instr->Bit(8) == 1) {
-          shift = imm7 - size;
-          direction = 'l';  // vsli
-        } else {
-          shift = 2 * size - imm7;
-          direction = 'r';  // vsri
-        }
-        int Vd = instr->VFPDRegValue(kDoublePrecision);
-        int Vm = instr->VFPMRegValue(kDoublePrecision);
-        out_buffer_pos_ +=
-            SNPrintF(out_buffer_ + out_buffer_pos_, "vs%ci.%d d%d, d%d, #%d",
-                     direction, size, Vd, Vm, shift);
-      } else {
-        Unknown(instr);
-      }
-      break;
-    case 8:
-      if (instr->Bits(21, 20) == 0) {
-        // vst1
-        int Vd = (instr->Bit(22) << 4) | instr->VdValue();
-        int Rn = instr->VnValue();
-        int type = instr->Bits(11, 8);
-        int size = instr->Bits(7, 6);
-        int align = instr->Bits(5, 4);
-        int Rm = instr->VmValue();
-        out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "vst1.%d ",
-                                    (1 << size) << 3);
-        FormatNeonList(Vd, type);
-        Print(", ");
-        FormatNeonMemory(Rn, align, Rm);
-      } else if (instr->Bits(21, 20) == 2) {
-        // vld1
-        int Vd = (instr->Bit(22) << 4) | instr->VdValue();
-        int Rn = instr->VnValue();
-        int type = instr->Bits(11, 8);
-        int size = instr->Bits(7, 6);
-        int align = instr->Bits(5, 4);
-        int Rm = instr->VmValue();
-        out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "vld1.%d ",
-                                    (1 << size) << 3);
-        FormatNeonList(Vd, type);
-        Print(", ");
-        FormatNeonMemory(Rn, align, Rm);
-      } else {
-        Unknown(instr);
-      }
-      break;
-    case 0xA:
-    case 0xB:
-      if ((instr->Bits(22, 20) == 5) && (instr->Bits(15, 12) == 0xF)) {
-        const char* rn_name = converter_.NameOfCPURegister(instr->Bits(19, 16));
-        int offset = instr->Bits(11, 0);
-        if (offset == 0) {
-          out_buffer_pos_ +=
-              SNPrintF(out_buffer_ + out_buffer_pos_, "pld [%s]", rn_name);
-        } else if (instr->Bit(23) == 0) {
-          out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                      "pld [%s, #-%d]", rn_name, offset);
-        } else {
-          out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                      "pld [%s, #+%d]", rn_name, offset);
-        }
-      } else if (instr->SpecialValue() == 0xA && instr->Bits(22, 20) == 7) {
-        int option = instr->Bits(3, 0);
-        switch (instr->Bits(7, 4)) {
-          case 4:
-            out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "dsb %s",
-                                        barrier_option_names[option]);
-            break;
-          case 5:
-            out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "dmb %s",
-                                        barrier_option_names[option]);
-            break;
-          case 6:
-            out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "isb %s",
-                                        barrier_option_names[option]);
-            break;
-          default:
-            Unknown(instr);
-        }
-      } else {
-        Unknown(instr);
-      }
-      break;
-    case 0x1D:
-      if (instr->Opc1Value() == 0x7 && instr->Bits(19, 18) == 0x2 &&
-          instr->Bits(11, 9) == 0x5 && instr->Bits(7, 6) == 0x1 &&
-          instr->Bit(4) == 0x0) {
-        // VRINTA, VRINTN, VRINTP, VRINTM (floating-point)
-        bool dp_operation = (instr->SzValue() == 1);
-        int rounding_mode = instr->Bits(17, 16);
-        switch (rounding_mode) {
-          case 0x0:
-            if (dp_operation) {
-              Format(instr, "vrinta.f64.f64 'Dd, 'Dm");
-            } else {
-              Format(instr, "vrinta.f32.f32 'Sd, 'Sm");
-            }
-            break;
-          case 0x1:
-            if (dp_operation) {
-              Format(instr, "vrintn.f64.f64 'Dd, 'Dm");
-            } else {
-              Format(instr, "vrintn.f32.f32 'Sd, 'Sm");
-            }
-            break;
-          case 0x2:
-            if (dp_operation) {
-              Format(instr, "vrintp.f64.f64 'Dd, 'Dm");
-            } else {
-              Format(instr, "vrintp.f32.f32 'Sd, 'Sm");
-            }
-            break;
-          case 0x3:
-            if (dp_operation) {
-              Format(instr, "vrintm.f64.f64 'Dd, 'Dm");
-            } else {
-              Format(instr, "vrintm.f32.f32 'Sd, 'Sm");
-            }
-            break;
-          default:
-            UNREACHABLE();  // Case analysis is exhaustive.
-            break;
-        }
-      } else if ((instr->Opc1Value() == 0x4) && (instr->Bits(11, 9) == 0x5) &&
-                 (instr->Bit(4) == 0x0)) {
-        // VMAXNM, VMINNM (floating-point)
-        if (instr->SzValue() == 0x1) {
-          if (instr->Bit(6) == 0x1) {
-            Format(instr, "vminnm.f64 'Dd, 'Dn, 'Dm");
-          } else {
-            Format(instr, "vmaxnm.f64 'Dd, 'Dn, 'Dm");
-          }
-        } else {
-          if (instr->Bit(6) == 0x1) {
-            Format(instr, "vminnm.f32 'Sd, 'Sn, 'Sm");
-          } else {
-            Format(instr, "vmaxnm.f32 'Sd, 'Sn, 'Sm");
-          }
-        }
-      } else {
-        Unknown(instr);
-      }
-      break;
-    case 0x1C:
-      if ((instr->Bits(11, 9) == 0x5) && (instr->Bit(6) == 0) &&
-          (instr->Bit(4) == 0)) {
-        // VSEL* (floating-point)
-        bool dp_operation = (instr->SzValue() == 1);
-        switch (instr->Bits(21, 20)) {
-          case 0x0:
-            if (dp_operation) {
-              Format(instr, "vseleq.f64 'Dd, 'Dn, 'Dm");
-            } else {
-              Format(instr, "vseleq.f32 'Sd, 'Sn, 'Sm");
-            }
-            break;
-          case 0x1:
-            if (dp_operation) {
-              Format(instr, "vselvs.f64 'Dd, 'Dn, 'Dm");
-            } else {
-              Format(instr, "vselvs.f32 'Sd, 'Sn, 'Sm");
-            }
-            break;
-          case 0x2:
-            if (dp_operation) {
-              Format(instr, "vselge.f64 'Dd, 'Dn, 'Dm");
-            } else {
-              Format(instr, "vselge.f32 'Sd, 'Sn, 'Sm");
-            }
-            break;
-          case 0x3:
-            if (dp_operation) {
-              Format(instr, "vselgt.f64 'Dd, 'Dn, 'Dm");
-            } else {
-              Format(instr, "vselgt.f32 'Sd, 'Sn, 'Sm");
-            }
-            break;
-          default:
-            UNREACHABLE();  // Case analysis is exhaustive.
-            break;
-        }
-      } else {
-        Unknown(instr);
-      }
-      break;
-    default:
-      Unknown(instr);
-      break;
-  }
-}
-
-#undef VERIFIY
-
-bool Decoder::IsConstantPoolAt(byte* instr_ptr) {
-  int instruction_bits = *(reinterpret_cast<int*>(instr_ptr));
-  return (instruction_bits & kConstantPoolMarkerMask) == kConstantPoolMarker;
-}
-
-
-int Decoder::ConstantPoolSizeAt(byte* instr_ptr) {
-  if (IsConstantPoolAt(instr_ptr)) {
-    int instruction_bits = *(reinterpret_cast<int*>(instr_ptr));
-    return DecodeConstantPoolLength(instruction_bits);
-  } else {
-    return -1;
-  }
-}
-
-
-// Disassemble the instruction at *instr_ptr into the output buffer.
-int Decoder::InstructionDecode(byte* instr_ptr) {
-  Instruction* instr = Instruction::At(instr_ptr);
-  // Print raw instruction bytes.
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                              "%08x       ",
-                              instr->InstructionBits());
-  if (instr->ConditionField() == kSpecialCondition) {
-    DecodeSpecialCondition(instr);
-    return Instruction::kInstrSize;
-  }
-  int instruction_bits = *(reinterpret_cast<int*>(instr_ptr));
-  if ((instruction_bits & kConstantPoolMarkerMask) == kConstantPoolMarker) {
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                "constant pool begin (length %d)",
-                                DecodeConstantPoolLength(instruction_bits));
-    return Instruction::kInstrSize;
-  }
-  switch (instr->TypeValue()) {
-    case 0:
-    case 1: {
-      DecodeType01(instr);
-      break;
-    }
-    case 2: {
-      DecodeType2(instr);
-      break;
-    }
-    case 3: {
-      DecodeType3(instr);
-      break;
-    }
-    case 4: {
-      DecodeType4(instr);
-      break;
-    }
-    case 5: {
-      DecodeType5(instr);
-      break;
-    }
-    case 6: {
-      DecodeType6(instr);
-      break;
-    }
-    case 7: {
-      return DecodeType7(instr);
-    }
-    default: {
-      // The type field is 3-bits in the ARM encoding.
-      UNREACHABLE();
-      break;
-    }
-  }
-  return Instruction::kInstrSize;
-}
-
-
-}  // namespace internal
-}  // namespace v8
-
-
-//------------------------------------------------------------------------------
-
-namespace disasm {
-
-
-const char* NameConverter::NameOfAddress(byte* addr) const {
-  v8::internal::SNPrintF(tmp_buffer_, "%p", static_cast<void*>(addr));
-  return tmp_buffer_.start();
-}
-
-
-const char* NameConverter::NameOfConstant(byte* addr) const {
-  return NameOfAddress(addr);
-}
-
-
-const char* NameConverter::NameOfCPURegister(int reg) const {
-  return v8::internal::GetRegConfig()->GetGeneralRegisterName(reg);
-}
-
-
-const char* NameConverter::NameOfByteCPURegister(int reg) const {
-  UNREACHABLE();  // ARM does not have the concept of a byte register
-  return "nobytereg";
-}
-
-
-const char* NameConverter::NameOfXMMRegister(int reg) const {
-  UNREACHABLE();  // ARM does not have any XMM registers
-  return "noxmmreg";
-}
-
-
-const char* NameConverter::NameInCode(byte* addr) const {
-  // The default name converter is called for unknown code. So we will not try
-  // to access any memory.
-  return "";
-}
-
-
-//------------------------------------------------------------------------------
-
-Disassembler::Disassembler(const NameConverter& converter)
-    : converter_(converter) {}
-
-
-Disassembler::~Disassembler() {}
-
-
-int Disassembler::InstructionDecode(v8::internal::Vector<char> buffer,
-                                    byte* instruction) {
-  v8::internal::Decoder d(converter_, buffer);
-  return d.InstructionDecode(instruction);
-}
-
-
-int Disassembler::ConstantPoolSizeAt(byte* instruction) {
-  return v8::internal::Decoder::ConstantPoolSizeAt(instruction);
-}
-
-
-void Disassembler::Disassemble(FILE* f, byte* begin, byte* end) {
-  NameConverter converter;
-  Disassembler d(converter);
-  for (byte* pc = begin; pc < end;) {
-    v8::internal::EmbeddedVector<char, 128> buffer;
-    buffer[0] = '\0';
-    byte* prev_pc = pc;
-    pc += d.InstructionDecode(buffer, pc);
-    v8::internal::PrintF(f, "%p    %08x      %s\n", static_cast<void*>(prev_pc),
-                         *reinterpret_cast<int32_t*>(prev_pc), buffer.start());
-  }
-}
-
-
-}  // namespace disasm
-
-#endif  // V8_TARGET_ARCH_ARM
diff --git a/src/v8/src/arm/eh-frame-arm.cc b/src/v8/src/arm/eh-frame-arm.cc
deleted file mode 100644
index f090269..0000000
--- a/src/v8/src/arm/eh-frame-arm.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/eh-frame.h"
-
-namespace v8 {
-namespace internal {
-
-static const int kR0DwarfCode = 0;
-static const int kFpDwarfCode = 11;
-static const int kSpDwarfCode = 13;
-static const int kLrDwarfCode = 14;
-
-const int EhFrameConstants::kCodeAlignmentFactor = 4;
-const int EhFrameConstants::kDataAlignmentFactor = -4;
-
-void EhFrameWriter::WriteReturnAddressRegisterCode() {
-  WriteULeb128(kLrDwarfCode);
-}
-
-void EhFrameWriter::WriteInitialStateInCie() {
-  SetBaseAddressRegisterAndOffset(fp, 0);
-  RecordRegisterNotModified(lr);
-}
-
-// static
-int EhFrameWriter::RegisterToDwarfCode(Register name) {
-  switch (name.code()) {
-    case kRegCode_fp:
-      return kFpDwarfCode;
-    case kRegCode_sp:
-      return kSpDwarfCode;
-    case kRegCode_lr:
-      return kLrDwarfCode;
-    case kRegCode_r0:
-      return kR0DwarfCode;
-    default:
-      UNIMPLEMENTED();
-      return -1;
-  }
-}
-
-#ifdef ENABLE_DISASSEMBLER
-
-// static
-const char* EhFrameDisassembler::DwarfRegisterCodeToString(int code) {
-  switch (code) {
-    case kFpDwarfCode:
-      return "fp";
-    case kSpDwarfCode:
-      return "sp";
-    case kLrDwarfCode:
-      return "lr";
-    default:
-      UNIMPLEMENTED();
-      return nullptr;
-  }
-}
-
-#endif
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/arm/frame-constants-arm.cc b/src/v8/src/arm/frame-constants-arm.cc
deleted file mode 100644
index bb4cb5d..0000000
--- a/src/v8/src/arm/frame-constants-arm.cc
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2011 the V8 project 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 V8_TARGET_ARCH_ARM
-
-#include "src/assembler.h"
-#include "src/frame-constants.h"
-#include "src/macro-assembler.h"
-
-#include "src/arm/assembler-arm-inl.h"
-#include "src/arm/assembler-arm.h"
-#include "src/arm/frame-constants-arm.h"
-#include "src/arm/macro-assembler-arm.h"
-
-namespace v8 {
-namespace internal {
-
-Register JavaScriptFrame::fp_register() { return v8::internal::fp; }
-Register JavaScriptFrame::context_register() { return cp; }
-Register JavaScriptFrame::constant_pool_pointer_register() { UNREACHABLE(); }
-
-int InterpreterFrameConstants::RegisterStackSlotCount(int register_count) {
-  return register_count;
-}
-
-int BuiltinContinuationFrameConstants::PaddingSlotCount(int register_count) {
-  USE(register_count);
-  return 0;
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_ARM
diff --git a/src/v8/src/arm/frame-constants-arm.h b/src/v8/src/arm/frame-constants-arm.h
deleted file mode 100644
index 9307cc2..0000000
--- a/src/v8/src/arm/frame-constants-arm.h
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_ARM_FRAMES_ARM_H_
-#define V8_ARM_FRAMES_ARM_H_
-
-namespace v8 {
-namespace internal {
-
-class EntryFrameConstants : public AllStatic {
- public:
-  static const int kCallerFPOffset =
-      -(StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize);
-};
-
-class ExitFrameConstants : public TypedFrameConstants {
- public:
-  static const int kSPOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(0);
-  static const int kCodeOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(1);
-  DEFINE_TYPED_FRAME_SIZES(2);
-
-  // The caller fields are below the frame pointer on the stack.
-  static const int kCallerFPOffset = 0 * kPointerSize;
-  // The calling JS function is below FP.
-  static const int kCallerPCOffset = 1 * kPointerSize;
-
-  // FP-relative displacement of the caller's SP.  It points just
-  // below the saved PC.
-  static const int kCallerSPDisplacement = 2 * kPointerSize;
-};
-
-class JavaScriptFrameConstants : public AllStatic {
- public:
-  // FP-relative.
-  static const int kLocal0Offset = StandardFrameConstants::kExpressionsOffset;
-  static const int kLastParameterOffset = +2 * kPointerSize;
-  static const int kFunctionOffset = StandardFrameConstants::kFunctionOffset;
-
-  // Caller SP-relative.
-  static const int kParam0Offset = -2 * kPointerSize;
-  static const int kReceiverOffset = -1 * kPointerSize;
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_ARM_FRAMES_ARM_H_
diff --git a/src/v8/src/arm/interface-descriptors-arm.cc b/src/v8/src/arm/interface-descriptors-arm.cc
deleted file mode 100644
index 6b7498f..0000000
--- a/src/v8/src/arm/interface-descriptors-arm.cc
+++ /dev/null
@@ -1,359 +0,0 @@
-// Copyright 2012 the V8 project 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 "src/arm/interface-descriptors-arm.h"
-
-#if V8_TARGET_ARCH_ARM
-
-#include "src/interface-descriptors.h"
-
-namespace v8 {
-namespace internal {
-
-const Register CallInterfaceDescriptor::ContextRegister() { return cp; }
-
-void CallInterfaceDescriptor::DefaultInitializePlatformSpecific(
-    CallInterfaceDescriptorData* data, int register_parameter_count) {
-  const Register default_stub_registers[] = {r0, r1, r2, r3, r4};
-  CHECK_LE(static_cast<size_t>(register_parameter_count),
-           arraysize(default_stub_registers));
-  data->InitializePlatformSpecific(register_parameter_count,
-                                   default_stub_registers);
-}
-
-void RecordWriteDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  const Register default_stub_registers[] = {r0, r1, r2, r3, r4};
-
-  data->RestrictAllocatableRegisters(default_stub_registers,
-                                     arraysize(default_stub_registers));
-
-  CHECK_LE(static_cast<size_t>(kParameterCount),
-           arraysize(default_stub_registers));
-  data->InitializePlatformSpecific(kParameterCount, default_stub_registers);
-}
-
-const Register FastNewFunctionContextDescriptor::FunctionRegister() {
-  return r1;
-}
-const Register FastNewFunctionContextDescriptor::SlotsRegister() { return r0; }
-
-const Register LoadDescriptor::ReceiverRegister() { return r1; }
-const Register LoadDescriptor::NameRegister() { return r2; }
-const Register LoadDescriptor::SlotRegister() { return r0; }
-
-const Register LoadWithVectorDescriptor::VectorRegister() { return r3; }
-
-const Register StoreDescriptor::ReceiverRegister() { return r1; }
-const Register StoreDescriptor::NameRegister() { return r2; }
-const Register StoreDescriptor::ValueRegister() { return r0; }
-const Register StoreDescriptor::SlotRegister() { return r4; }
-
-const Register StoreWithVectorDescriptor::VectorRegister() { return r3; }
-
-const Register StoreTransitionDescriptor::SlotRegister() { return r4; }
-const Register StoreTransitionDescriptor::VectorRegister() { return r3; }
-const Register StoreTransitionDescriptor::MapRegister() { return r5; }
-
-const Register ApiGetterDescriptor::HolderRegister() { return r0; }
-const Register ApiGetterDescriptor::CallbackRegister() { return r3; }
-
-const Register MathPowTaggedDescriptor::exponent() { return r2; }
-
-const Register MathPowIntegerDescriptor::exponent() {
-  return MathPowTaggedDescriptor::exponent();
-}
-
-
-const Register GrowArrayElementsDescriptor::ObjectRegister() { return r0; }
-const Register GrowArrayElementsDescriptor::KeyRegister() { return r3; }
-
-
-void FastNewClosureDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {r1, r2, r3};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-// static
-const Register TypeConversionDescriptor::ArgumentRegister() { return r0; }
-
-void TypeofDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {r3};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallFunctionDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {r1};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallTrampolineDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r0 : number of arguments
-  // r1 : the target to call
-  Register registers[] = {r1, r0};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r0 : number of arguments (on the stack, not including receiver)
-  // r1 : the target to call
-  // r2 : arguments list (FixedArray)
-  // r4 : arguments list length (untagged)
-  Register registers[] = {r1, r0, r2, r4};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallForwardVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r0 : number of arguments
-  // r2 : start index (to support rest parameters)
-  // r1 : the target to call
-  Register registers[] = {r1, r0, r2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallWithSpreadDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r0 : number of arguments (on the stack, not including receiver)
-  // r1 : the target to call
-  // r2 : the object to spread
-  Register registers[] = {r1, r0, r2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallWithArrayLikeDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r1 : the target to call
-  // r2 : the arguments list
-  Register registers[] = {r1, r2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r0 : number of arguments (on the stack, not including receiver)
-  // r1 : the target to call
-  // r3 : the new target
-  // r2 : arguments list (FixedArray)
-  // r4 : arguments list length (untagged)
-  Register registers[] = {r1, r3, r0, r2, r4};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructForwardVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r0 : number of arguments
-  // r3 : the new target
-  // r2 : start index (to support rest parameters)
-  // r1 : the target to call
-  Register registers[] = {r1, r3, r0, r2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructWithSpreadDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r0 : number of arguments (on the stack, not including receiver)
-  // r1 : the target to call
-  // r3 : the new target
-  // r2 : the object to spread
-  Register registers[] = {r1, r3, r0, r2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructWithArrayLikeDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r1 : the target to call
-  // r3 : the new target
-  // r2 : the arguments list
-  Register registers[] = {r1, r3, r2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructStubDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r0 : number of arguments
-  // r1 : the target to call
-  // r3 : the new target
-  // r2 : allocation site or undefined
-  Register registers[] = {r1, r3, r0, r2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-
-void ConstructTrampolineDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r0 : number of arguments
-  // r1 : the target to call
-  // r3 : the new target
-  Register registers[] = {r1, r3, r0};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-
-void TransitionElementsKindDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {r0, r1};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void AbortJSDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {r1};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void AllocateHeapNumberDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  data->InitializePlatformSpecific(0, nullptr, nullptr);
-}
-
-void ArrayConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // kTarget, kNewTarget, kActualArgumentsCount, kAllocationSite
-  Register registers[] = {r1, r3, r0, r2};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void ArrayNoArgumentConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // register state
-  // r0 -- number of arguments
-  // r1 -- function
-  // r2 -- allocation site with elements kind
-  Register registers[] = {r1, r2, r0};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void ArraySingleArgumentConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // register state
-  // r0 -- number of arguments
-  // r1 -- function
-  // r2 -- allocation site with elements kind
-  Register registers[] = {r1, r2, r0};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void ArrayNArgumentsConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // stack param count needs (constructor pointer, and single argument)
-  Register registers[] = {r1, r2, r0};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CompareDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {r1, r0};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-
-void BinaryOpDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {r1, r0};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void StringAddDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {r1, r0};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ArgumentAdaptorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  static PlatformInterfaceDescriptor default_descriptor =
-      PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS);
-
-  Register registers[] = {
-      r1,  // JSFunction
-      r3,  // the new target
-      r0,  // actual number of arguments
-      r2,  // expected number of arguments
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers,
-                                   &default_descriptor);
-}
-
-void ApiCallbackDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  static PlatformInterfaceDescriptor default_descriptor =
-      PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS);
-
-  Register registers[] = {
-      JavaScriptFrame::context_register(),  // callee context
-      r4,                                   // call_data
-      r2,                                   // holder
-      r1,                                   // api_function_address
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers,
-                                   &default_descriptor);
-}
-
-void InterpreterDispatchDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      kInterpreterAccumulatorRegister, kInterpreterBytecodeOffsetRegister,
-      kInterpreterBytecodeArrayRegister, kInterpreterDispatchTableRegister};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterPushArgsThenCallDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      r0,  // argument count (not including receiver)
-      r2,  // address of first argument
-      r1   // the target callable to be call
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterPushArgsThenConstructDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      r0,  // argument count (not including receiver)
-      r3,  // new target
-      r1,  // constructor to call
-      r2,  // allocation site feedback if available, undefined otherwise
-      r4   // address of the first argument
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterCEntryDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      r0,  // argument count (argc)
-      r2,  // address of first argument (argv)
-      r1   // the runtime function to call
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ResumeGeneratorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      r0,  // the value to pass to the generator
-      r1   // the JSGeneratorObject to resume
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void FrameDropperTrampolineDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      r1,  // loaded new FP
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_ARM
diff --git a/src/v8/src/arm/interface-descriptors-arm.h b/src/v8/src/arm/interface-descriptors-arm.h
deleted file mode 100644
index a649279..0000000
--- a/src/v8/src/arm/interface-descriptors-arm.h
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_ARM_INTERFACE_DESCRIPTORS_ARM_H_
-#define V8_ARM_INTERFACE_DESCRIPTORS_ARM_H_
-
-#include "src/interface-descriptors.h"
-
-namespace v8 {
-namespace internal {
-
-class PlatformInterfaceDescriptor {
- public:
-  explicit PlatformInterfaceDescriptor(TargetAddressStorageMode storage_mode)
-      : storage_mode_(storage_mode) {}
-
-  TargetAddressStorageMode storage_mode() { return storage_mode_; }
-
- private:
-  TargetAddressStorageMode storage_mode_;
-};
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_ARM_INTERFACE_DESCRIPTORS_ARM_H_
diff --git a/src/v8/src/arm/macro-assembler-arm.cc b/src/v8/src/arm/macro-assembler-arm.cc
deleted file mode 100644
index 30190d3..0000000
--- a/src/v8/src/arm/macro-assembler-arm.cc
+++ /dev/null
@@ -1,2281 +0,0 @@
-// Copyright 2012 the V8 project 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 <limits.h>  // For LONG_MIN, LONG_MAX.
-
-#if V8_TARGET_ARCH_ARM
-
-#include "src/assembler-inl.h"
-#include "src/base/bits.h"
-#include "src/base/division-by-constant.h"
-#include "src/base/utils/random-number-generator.h"
-#include "src/bootstrapper.h"
-#include "src/callable.h"
-#include "src/code-stubs.h"
-#include "src/counters.h"
-#include "src/debug/debug.h"
-#include "src/double.h"
-#include "src/external-reference-table.h"
-#include "src/frames-inl.h"
-#include "src/objects-inl.h"
-#include "src/register-configuration.h"
-#include "src/runtime/runtime.h"
-
-#include "src/arm/macro-assembler-arm.h"
-
-namespace v8 {
-namespace internal {
-
-MacroAssembler::MacroAssembler(Isolate* isolate, void* buffer, int size,
-                               CodeObjectRequired create_code_object)
-    : TurboAssembler(isolate, buffer, size, create_code_object) {}
-
-TurboAssembler::TurboAssembler(Isolate* isolate, void* buffer, int buffer_size,
-                               CodeObjectRequired create_code_object)
-    : Assembler(isolate, buffer, buffer_size), isolate_(isolate) {
-  if (create_code_object == CodeObjectRequired::kYes) {
-    code_object_ =
-        Handle<HeapObject>::New(isolate->heap()->undefined_value(), isolate);
-  }
-}
-
-int TurboAssembler::RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode,
-                                                    Register exclusion1,
-                                                    Register exclusion2,
-                                                    Register exclusion3) const {
-  int bytes = 0;
-  RegList exclusions = 0;
-  if (exclusion1 != no_reg) {
-    exclusions |= exclusion1.bit();
-    if (exclusion2 != no_reg) {
-      exclusions |= exclusion2.bit();
-      if (exclusion3 != no_reg) {
-        exclusions |= exclusion3.bit();
-      }
-    }
-  }
-
-  RegList list = (kCallerSaved | lr.bit()) & ~exclusions;
-
-  bytes += NumRegs(list) * kPointerSize;
-
-  if (fp_mode == kSaveFPRegs) {
-    bytes += DwVfpRegister::NumRegisters() * DwVfpRegister::kSizeInBytes;
-  }
-
-  return bytes;
-}
-
-int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
-                                    Register exclusion2, Register exclusion3) {
-  int bytes = 0;
-  RegList exclusions = 0;
-  if (exclusion1 != no_reg) {
-    exclusions |= exclusion1.bit();
-    if (exclusion2 != no_reg) {
-      exclusions |= exclusion2.bit();
-      if (exclusion3 != no_reg) {
-        exclusions |= exclusion3.bit();
-      }
-    }
-  }
-
-  RegList list = (kCallerSaved | lr.bit()) & ~exclusions;
-  stm(db_w, sp, list);
-
-  bytes += NumRegs(list) * kPointerSize;
-
-  if (fp_mode == kSaveFPRegs) {
-    SaveFPRegs(sp, lr);
-    bytes += DwVfpRegister::NumRegisters() * DwVfpRegister::kSizeInBytes;
-  }
-
-  return bytes;
-}
-
-int TurboAssembler::PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
-                                   Register exclusion2, Register exclusion3) {
-  int bytes = 0;
-  if (fp_mode == kSaveFPRegs) {
-    RestoreFPRegs(sp, lr);
-    bytes += DwVfpRegister::NumRegisters() * DwVfpRegister::kSizeInBytes;
-  }
-
-  RegList exclusions = 0;
-  if (exclusion1 != no_reg) {
-    exclusions |= exclusion1.bit();
-    if (exclusion2 != no_reg) {
-      exclusions |= exclusion2.bit();
-      if (exclusion3 != no_reg) {
-        exclusions |= exclusion3.bit();
-      }
-    }
-  }
-
-  RegList list = (kCallerSaved | lr.bit()) & ~exclusions;
-  ldm(ia_w, sp, list);
-
-  bytes += NumRegs(list) * kPointerSize;
-
-  return bytes;
-}
-
-void TurboAssembler::Jump(Register target, Condition cond) { bx(target, cond); }
-
-void TurboAssembler::Jump(intptr_t target, RelocInfo::Mode rmode,
-                          Condition cond) {
-  DCHECK(RelocInfo::IsCodeTarget(rmode));
-  mov(pc, Operand(target, rmode), LeaveCC, cond);
-}
-
-void TurboAssembler::Jump(Address target, RelocInfo::Mode rmode,
-                          Condition cond) {
-  DCHECK(!RelocInfo::IsCodeTarget(rmode));
-  Jump(reinterpret_cast<intptr_t>(target), rmode, cond);
-}
-
-void TurboAssembler::Jump(Handle<Code> code, RelocInfo::Mode rmode,
-                          Condition cond) {
-  DCHECK(RelocInfo::IsCodeTarget(rmode));
-  // 'code' is always generated ARM code, never THUMB code
-  Jump(reinterpret_cast<intptr_t>(code.address()), rmode, cond);
-}
-
-int TurboAssembler::CallSize(Register target, Condition cond) {
-  return kInstrSize;
-}
-
-void TurboAssembler::Call(Register target, Condition cond) {
-  // Block constant pool for the call instruction sequence.
-  BlockConstPoolScope block_const_pool(this);
-  Label start;
-  bind(&start);
-  blx(target, cond);
-  DCHECK_EQ(CallSize(target, cond), SizeOfCodeGeneratedSince(&start));
-}
-
-int TurboAssembler::CallSize(Address target, RelocInfo::Mode rmode,
-                             Condition cond) {
-  Instr mov_instr = cond | MOV | LeaveCC;
-  Operand mov_operand = Operand(reinterpret_cast<intptr_t>(target), rmode);
-  return kInstrSize +
-         mov_operand.InstructionsRequired(this, mov_instr) * kInstrSize;
-}
-
-int TurboAssembler::CallStubSize() {
-  return CallSize(Handle<Code>(), RelocInfo::CODE_TARGET, al);
-}
-
-void TurboAssembler::Call(Address target, RelocInfo::Mode rmode, Condition cond,
-                          TargetAddressStorageMode mode,
-                          bool check_constant_pool) {
-  // Check if we have to emit the constant pool before we block it.
-  if (check_constant_pool) MaybeCheckConstPool();
-  // Block constant pool for the call instruction sequence.
-  BlockConstPoolScope block_const_pool(this);
-  Label start;
-  bind(&start);
-
-  bool old_predictable_code_size = predictable_code_size();
-  if (mode == NEVER_INLINE_TARGET_ADDRESS) {
-    set_predictable_code_size(true);
-  }
-
-#ifdef DEBUG
-  // Check the expected size before generating code to ensure we assume the same
-  // constant pool availability (e.g., whether constant pool is full or not).
-  int expected_size = CallSize(target, rmode, cond);
-#endif
-
-  // Use ip directly instead of using UseScratchRegisterScope, as we do not
-  // preserve scratch registers across calls.
-
-  // Call sequence on V7 or later may be :
-  //  movw  ip, #... @ call address low 16
-  //  movt  ip, #... @ call address high 16
-  //  blx   ip
-  //                      @ return address
-  // Or for pre-V7 or values that may be back-patched
-  // to avoid ICache flushes:
-  //  ldr   ip, [pc, #...] @ call address
-  //  blx   ip
-  //                      @ return address
-
-  mov(ip, Operand(reinterpret_cast<int32_t>(target), rmode));
-  blx(ip, cond);
-
-  DCHECK_EQ(expected_size, SizeOfCodeGeneratedSince(&start));
-  if (mode == NEVER_INLINE_TARGET_ADDRESS) {
-    set_predictable_code_size(old_predictable_code_size);
-  }
-}
-
-int TurboAssembler::CallSize(Handle<Code> code, RelocInfo::Mode rmode,
-                             Condition cond) {
-  return CallSize(code.address(), rmode, cond);
-}
-
-void TurboAssembler::Call(Handle<Code> code, RelocInfo::Mode rmode,
-                          Condition cond, TargetAddressStorageMode mode,
-                          bool check_constant_pool) {
-  DCHECK(RelocInfo::IsCodeTarget(rmode));
-  // 'code' is always generated ARM code, never THUMB code
-  Call(code.address(), rmode, cond, mode);
-}
-
-void TurboAssembler::Ret(Condition cond) { bx(lr, cond); }
-
-void TurboAssembler::Drop(int count, Condition cond) {
-  if (count > 0) {
-    add(sp, sp, Operand(count * kPointerSize), LeaveCC, cond);
-  }
-}
-
-void TurboAssembler::Drop(Register count, Condition cond) {
-  add(sp, sp, Operand(count, LSL, kPointerSizeLog2), LeaveCC, cond);
-}
-
-void TurboAssembler::Ret(int drop, Condition cond) {
-  Drop(drop, cond);
-  Ret(cond);
-}
-
-
-void MacroAssembler::Swap(Register reg1,
-                          Register reg2,
-                          Register scratch,
-                          Condition cond) {
-  if (scratch == no_reg) {
-    eor(reg1, reg1, Operand(reg2), LeaveCC, cond);
-    eor(reg2, reg2, Operand(reg1), LeaveCC, cond);
-    eor(reg1, reg1, Operand(reg2), LeaveCC, cond);
-  } else {
-    mov(scratch, reg1, LeaveCC, cond);
-    mov(reg1, reg2, LeaveCC, cond);
-    mov(reg2, scratch, LeaveCC, cond);
-  }
-}
-
-void TurboAssembler::Call(Label* target) { bl(target); }
-
-void TurboAssembler::Push(Handle<HeapObject> handle) {
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  mov(scratch, Operand(handle));
-  push(scratch);
-}
-
-void TurboAssembler::Push(Smi* smi) {
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  mov(scratch, Operand(smi));
-  push(scratch);
-}
-
-void TurboAssembler::Move(Register dst, Smi* smi) { mov(dst, Operand(smi)); }
-
-void TurboAssembler::Move(Register dst, Handle<HeapObject> value) {
-  mov(dst, Operand(value));
-}
-
-void TurboAssembler::Move(Register dst, Register src, Condition cond) {
-  if (dst != src) {
-    mov(dst, src, LeaveCC, cond);
-  }
-}
-
-void TurboAssembler::Move(SwVfpRegister dst, SwVfpRegister src,
-                          Condition cond) {
-  if (dst != src) {
-    vmov(dst, src, cond);
-  }
-}
-
-void TurboAssembler::Move(DwVfpRegister dst, DwVfpRegister src,
-                          Condition cond) {
-  if (dst != src) {
-    vmov(dst, src, cond);
-  }
-}
-
-void TurboAssembler::Move(QwNeonRegister dst, QwNeonRegister src) {
-  if (dst != src) {
-    vmov(dst, src);
-  }
-}
-
-void TurboAssembler::Swap(DwVfpRegister srcdst0, DwVfpRegister srcdst1) {
-  if (srcdst0 == srcdst1) return;  // Swapping aliased registers emits nothing.
-
-  DCHECK(VfpRegisterIsAvailable(srcdst0));
-  DCHECK(VfpRegisterIsAvailable(srcdst1));
-
-  if (CpuFeatures::IsSupported(NEON)) {
-    vswp(srcdst0, srcdst1);
-  } else {
-    DCHECK_NE(srcdst0, kScratchDoubleReg);
-    DCHECK_NE(srcdst1, kScratchDoubleReg);
-    vmov(kScratchDoubleReg, srcdst0);
-    vmov(srcdst0, srcdst1);
-    vmov(srcdst1, kScratchDoubleReg);
-  }
-}
-
-void TurboAssembler::Swap(QwNeonRegister srcdst0, QwNeonRegister srcdst1) {
-  if (srcdst0 != srcdst1) {
-    vswp(srcdst0, srcdst1);
-  }
-}
-
-void MacroAssembler::Mls(Register dst, Register src1, Register src2,
-                         Register srcA, Condition cond) {
-  if (CpuFeatures::IsSupported(ARMv7)) {
-    CpuFeatureScope scope(this, ARMv7);
-    mls(dst, src1, src2, srcA, cond);
-  } else {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(srcA != scratch);
-    mul(scratch, src1, src2, LeaveCC, cond);
-    sub(dst, srcA, scratch, LeaveCC, cond);
-  }
-}
-
-
-void MacroAssembler::And(Register dst, Register src1, const Operand& src2,
-                         Condition cond) {
-  if (!src2.IsRegister() && !src2.MustOutputRelocInfo(this) &&
-      src2.immediate() == 0) {
-    mov(dst, Operand::Zero(), LeaveCC, cond);
-  } else if (!(src2.InstructionsRequired(this) == 1) &&
-             !src2.MustOutputRelocInfo(this) &&
-             CpuFeatures::IsSupported(ARMv7) &&
-             base::bits::IsPowerOfTwo(src2.immediate() + 1)) {
-    CpuFeatureScope scope(this, ARMv7);
-    ubfx(dst, src1, 0,
-        WhichPowerOf2(static_cast<uint32_t>(src2.immediate()) + 1), cond);
-  } else {
-    and_(dst, src1, src2, LeaveCC, cond);
-  }
-}
-
-
-void MacroAssembler::Ubfx(Register dst, Register src1, int lsb, int width,
-                          Condition cond) {
-  DCHECK_LT(lsb, 32);
-  if (!CpuFeatures::IsSupported(ARMv7) || predictable_code_size()) {
-    int mask = (1 << (width + lsb)) - 1 - ((1 << lsb) - 1);
-    and_(dst, src1, Operand(mask), LeaveCC, cond);
-    if (lsb != 0) {
-      mov(dst, Operand(dst, LSR, lsb), LeaveCC, cond);
-    }
-  } else {
-    CpuFeatureScope scope(this, ARMv7);
-    ubfx(dst, src1, lsb, width, cond);
-  }
-}
-
-
-void MacroAssembler::Sbfx(Register dst, Register src1, int lsb, int width,
-                          Condition cond) {
-  DCHECK_LT(lsb, 32);
-  if (!CpuFeatures::IsSupported(ARMv7) || predictable_code_size()) {
-    int mask = (1 << (width + lsb)) - 1 - ((1 << lsb) - 1);
-    and_(dst, src1, Operand(mask), LeaveCC, cond);
-    int shift_up = 32 - lsb - width;
-    int shift_down = lsb + shift_up;
-    if (shift_up != 0) {
-      mov(dst, Operand(dst, LSL, shift_up), LeaveCC, cond);
-    }
-    if (shift_down != 0) {
-      mov(dst, Operand(dst, ASR, shift_down), LeaveCC, cond);
-    }
-  } else {
-    CpuFeatureScope scope(this, ARMv7);
-    sbfx(dst, src1, lsb, width, cond);
-  }
-}
-
-
-void TurboAssembler::Bfc(Register dst, Register src, int lsb, int width,
-                         Condition cond) {
-  DCHECK_LT(lsb, 32);
-  if (!CpuFeatures::IsSupported(ARMv7) || predictable_code_size()) {
-    int mask = (1 << (width + lsb)) - 1 - ((1 << lsb) - 1);
-    bic(dst, src, Operand(mask));
-  } else {
-    CpuFeatureScope scope(this, ARMv7);
-    Move(dst, src, cond);
-    bfc(dst, lsb, width, cond);
-  }
-}
-
-void MacroAssembler::Load(Register dst,
-                          const MemOperand& src,
-                          Representation r) {
-  DCHECK(!r.IsDouble());
-  if (r.IsInteger8()) {
-    ldrsb(dst, src);
-  } else if (r.IsUInteger8()) {
-    ldrb(dst, src);
-  } else if (r.IsInteger16()) {
-    ldrsh(dst, src);
-  } else if (r.IsUInteger16()) {
-    ldrh(dst, src);
-  } else {
-    ldr(dst, src);
-  }
-}
-
-void MacroAssembler::Store(Register src,
-                           const MemOperand& dst,
-                           Representation r) {
-  DCHECK(!r.IsDouble());
-  if (r.IsInteger8() || r.IsUInteger8()) {
-    strb(src, dst);
-  } else if (r.IsInteger16() || r.IsUInteger16()) {
-    strh(src, dst);
-  } else {
-    if (r.IsHeapObject()) {
-      AssertNotSmi(src);
-    } else if (r.IsSmi()) {
-      AssertSmi(src);
-    }
-    str(src, dst);
-  }
-}
-
-void TurboAssembler::LoadRoot(Register destination, Heap::RootListIndex index,
-                              Condition cond) {
-  ldr(destination, MemOperand(kRootRegister, index << kPointerSizeLog2), cond);
-}
-
-
-void MacroAssembler::RecordWriteField(Register object, int offset,
-                                      Register value, Register dst,
-                                      LinkRegisterStatus lr_status,
-                                      SaveFPRegsMode save_fp,
-                                      RememberedSetAction remembered_set_action,
-                                      SmiCheck smi_check) {
-  // First, check if a write barrier is even needed. The tests below
-  // catch stores of Smis.
-  Label done;
-
-  // Skip barrier if writing a smi.
-  if (smi_check == INLINE_SMI_CHECK) {
-    JumpIfSmi(value, &done);
-  }
-
-  // Although the object register is tagged, the offset is relative to the start
-  // of the object, so so offset must be a multiple of kPointerSize.
-  DCHECK(IsAligned(offset, kPointerSize));
-
-  add(dst, object, Operand(offset - kHeapObjectTag));
-  if (emit_debug_code()) {
-    Label ok;
-    tst(dst, Operand(kPointerSize - 1));
-    b(eq, &ok);
-    stop("Unaligned cell in write barrier");
-    bind(&ok);
-  }
-
-  RecordWrite(object, dst, value, lr_status, save_fp, remembered_set_action,
-              OMIT_SMI_CHECK);
-
-  bind(&done);
-
-  // Clobber clobbered input registers when running with the debug-code flag
-  // turned on to provoke errors.
-  if (emit_debug_code()) {
-    mov(value, Operand(bit_cast<int32_t>(kZapValue + 4)));
-    mov(dst, Operand(bit_cast<int32_t>(kZapValue + 8)));
-  }
-}
-
-void TurboAssembler::SaveRegisters(RegList registers) {
-  DCHECK_GT(NumRegs(registers), 0);
-  RegList regs = 0;
-  for (int i = 0; i < Register::kNumRegisters; ++i) {
-    if ((registers >> i) & 1u) {
-      regs |= Register::from_code(i).bit();
-    }
-  }
-
-  stm(db_w, sp, regs);
-}
-
-void TurboAssembler::RestoreRegisters(RegList registers) {
-  DCHECK_GT(NumRegs(registers), 0);
-  RegList regs = 0;
-  for (int i = 0; i < Register::kNumRegisters; ++i) {
-    if ((registers >> i) & 1u) {
-      regs |= Register::from_code(i).bit();
-    }
-  }
-  ldm(ia_w, sp, regs);
-}
-
-void TurboAssembler::CallRecordWriteStub(
-    Register object, Register address,
-    RememberedSetAction remembered_set_action, SaveFPRegsMode fp_mode) {
-  // TODO(albertnetymk): For now we ignore remembered_set_action and fp_mode,
-  // i.e. always emit remember set and save FP registers in RecordWriteStub. If
-  // large performance regression is observed, we should use these values to
-  // avoid unnecessary work.
-
-  Callable const callable =
-      Builtins::CallableFor(isolate(), Builtins::kRecordWrite);
-  RegList registers = callable.descriptor().allocatable_registers();
-
-  SaveRegisters(registers);
-
-  Register object_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kObject));
-  Register slot_parameter(
-      callable.descriptor().GetRegisterParameter(RecordWriteDescriptor::kSlot));
-  Register isolate_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kIsolate));
-  Register remembered_set_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kRememberedSet));
-  Register fp_mode_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kFPMode));
-
-  Push(object);
-  Push(address);
-
-  Pop(slot_parameter);
-  Pop(object_parameter);
-
-  Move(isolate_parameter,
-       Operand(ExternalReference::isolate_address(isolate())));
-  Move(remembered_set_parameter, Smi::FromEnum(remembered_set_action));
-  Move(fp_mode_parameter, Smi::FromEnum(fp_mode));
-  Call(callable.code(), RelocInfo::CODE_TARGET);
-
-  RestoreRegisters(registers);
-}
-
-// Will clobber 3 registers: object, address, and value. The register 'object'
-// contains a heap object pointer. The heap object tag is shifted away.
-// A scratch register also needs to be available.
-void MacroAssembler::RecordWrite(Register object, Register address,
-                                 Register value, LinkRegisterStatus lr_status,
-                                 SaveFPRegsMode fp_mode,
-                                 RememberedSetAction remembered_set_action,
-                                 SmiCheck smi_check) {
-  DCHECK(object != value);
-  if (emit_debug_code()) {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    ldr(scratch, MemOperand(address));
-    cmp(scratch, value);
-    Check(eq, AbortReason::kWrongAddressOrValuePassedToRecordWrite);
-  }
-
-  if (remembered_set_action == OMIT_REMEMBERED_SET &&
-      !FLAG_incremental_marking) {
-    return;
-  }
-
-  // First, check if a write barrier is even needed. The tests below
-  // catch stores of smis and stores into the young generation.
-  Label done;
-
-  if (smi_check == INLINE_SMI_CHECK) {
-    JumpIfSmi(value, &done);
-  }
-
-  CheckPageFlag(value,
-                value,  // Used as scratch.
-                MemoryChunk::kPointersToHereAreInterestingMask, eq, &done);
-  CheckPageFlag(object,
-                value,  // Used as scratch.
-                MemoryChunk::kPointersFromHereAreInterestingMask,
-                eq,
-                &done);
-
-  // Record the actual write.
-  if (lr_status == kLRHasNotBeenSaved) {
-    push(lr);
-  }
-  CallRecordWriteStub(object, address, remembered_set_action, fp_mode);
-  if (lr_status == kLRHasNotBeenSaved) {
-    pop(lr);
-  }
-
-  bind(&done);
-
-  // Count number of write barriers in generated code.
-  isolate()->counters()->write_barriers_static()->Increment();
-  {
-    UseScratchRegisterScope temps(this);
-    IncrementCounter(isolate()->counters()->write_barriers_dynamic(), 1,
-                     temps.Acquire(), value);
-  }
-
-  // Clobber clobbered registers when running with the debug-code flag
-  // turned on to provoke errors.
-  if (emit_debug_code()) {
-    mov(address, Operand(bit_cast<int32_t>(kZapValue + 12)));
-    mov(value, Operand(bit_cast<int32_t>(kZapValue + 16)));
-  }
-}
-
-void TurboAssembler::PushCommonFrame(Register marker_reg) {
-  if (marker_reg.is_valid()) {
-    if (marker_reg.code() > fp.code()) {
-      stm(db_w, sp, fp.bit() | lr.bit());
-      mov(fp, Operand(sp));
-      Push(marker_reg);
-    } else {
-      stm(db_w, sp, marker_reg.bit() | fp.bit() | lr.bit());
-      add(fp, sp, Operand(kPointerSize));
-    }
-  } else {
-    stm(db_w, sp, fp.bit() | lr.bit());
-    mov(fp, sp);
-  }
-}
-
-void TurboAssembler::PushStandardFrame(Register function_reg) {
-  DCHECK(!function_reg.is_valid() || function_reg.code() < cp.code());
-  stm(db_w, sp, (function_reg.is_valid() ? function_reg.bit() : 0) | cp.bit() |
-                    fp.bit() | lr.bit());
-  int offset = -StandardFrameConstants::kContextOffset;
-  offset += function_reg.is_valid() ? kPointerSize : 0;
-  add(fp, sp, Operand(offset));
-}
-
-
-// Push and pop all registers that can hold pointers.
-void MacroAssembler::PushSafepointRegisters() {
-  // Safepoints expect a block of contiguous register values starting with r0.
-  DCHECK_EQ(kSafepointSavedRegisters, (1 << kNumSafepointSavedRegisters) - 1);
-  // Safepoints expect a block of kNumSafepointRegisters values on the
-  // stack, so adjust the stack for unsaved registers.
-  const int num_unsaved = kNumSafepointRegisters - kNumSafepointSavedRegisters;
-  DCHECK_GE(num_unsaved, 0);
-  sub(sp, sp, Operand(num_unsaved * kPointerSize));
-  stm(db_w, sp, kSafepointSavedRegisters);
-}
-
-void MacroAssembler::PopSafepointRegisters() {
-  const int num_unsaved = kNumSafepointRegisters - kNumSafepointSavedRegisters;
-  ldm(ia_w, sp, kSafepointSavedRegisters);
-  add(sp, sp, Operand(num_unsaved * kPointerSize));
-}
-
-int MacroAssembler::SafepointRegisterStackIndex(int reg_code) {
-  // The registers are pushed starting with the highest encoding,
-  // which means that lowest encodings are closest to the stack pointer.
-  DCHECK(reg_code >= 0 && reg_code < kNumSafepointRegisters);
-  return reg_code;
-}
-
-void TurboAssembler::VFPCanonicalizeNaN(const DwVfpRegister dst,
-                                        const DwVfpRegister src,
-                                        const Condition cond) {
-  // Subtracting 0.0 preserves all inputs except for signalling NaNs, which
-  // become quiet NaNs. We use vsub rather than vadd because vsub preserves -0.0
-  // inputs: -0.0 + 0.0 = 0.0, but -0.0 - 0.0 = -0.0.
-  vsub(dst, src, kDoubleRegZero, cond);
-}
-
-void TurboAssembler::VFPCompareAndSetFlags(const SwVfpRegister src1,
-                                           const SwVfpRegister src2,
-                                           const Condition cond) {
-  // Compare and move FPSCR flags to the normal condition flags.
-  VFPCompareAndLoadFlags(src1, src2, pc, cond);
-}
-
-void TurboAssembler::VFPCompareAndSetFlags(const SwVfpRegister src1,
-                                           const float src2,
-                                           const Condition cond) {
-  // Compare and move FPSCR flags to the normal condition flags.
-  VFPCompareAndLoadFlags(src1, src2, pc, cond);
-}
-
-void TurboAssembler::VFPCompareAndSetFlags(const DwVfpRegister src1,
-                                           const DwVfpRegister src2,
-                                           const Condition cond) {
-  // Compare and move FPSCR flags to the normal condition flags.
-  VFPCompareAndLoadFlags(src1, src2, pc, cond);
-}
-
-void TurboAssembler::VFPCompareAndSetFlags(const DwVfpRegister src1,
-                                           const double src2,
-                                           const Condition cond) {
-  // Compare and move FPSCR flags to the normal condition flags.
-  VFPCompareAndLoadFlags(src1, src2, pc, cond);
-}
-
-void TurboAssembler::VFPCompareAndLoadFlags(const SwVfpRegister src1,
-                                            const SwVfpRegister src2,
-                                            const Register fpscr_flags,
-                                            const Condition cond) {
-  // Compare and load FPSCR.
-  vcmp(src1, src2, cond);
-  vmrs(fpscr_flags, cond);
-}
-
-void TurboAssembler::VFPCompareAndLoadFlags(const SwVfpRegister src1,
-                                            const float src2,
-                                            const Register fpscr_flags,
-                                            const Condition cond) {
-  // Compare and load FPSCR.
-  vcmp(src1, src2, cond);
-  vmrs(fpscr_flags, cond);
-}
-
-void TurboAssembler::VFPCompareAndLoadFlags(const DwVfpRegister src1,
-                                            const DwVfpRegister src2,
-                                            const Register fpscr_flags,
-                                            const Condition cond) {
-  // Compare and load FPSCR.
-  vcmp(src1, src2, cond);
-  vmrs(fpscr_flags, cond);
-}
-
-void TurboAssembler::VFPCompareAndLoadFlags(const DwVfpRegister src1,
-                                            const double src2,
-                                            const Register fpscr_flags,
-                                            const Condition cond) {
-  // Compare and load FPSCR.
-  vcmp(src1, src2, cond);
-  vmrs(fpscr_flags, cond);
-}
-
-void TurboAssembler::VmovHigh(Register dst, DwVfpRegister src) {
-  if (src.code() < 16) {
-    const LowDwVfpRegister loc = LowDwVfpRegister::from_code(src.code());
-    vmov(dst, loc.high());
-  } else {
-    vmov(dst, VmovIndexHi, src);
-  }
-}
-
-void TurboAssembler::VmovHigh(DwVfpRegister dst, Register src) {
-  if (dst.code() < 16) {
-    const LowDwVfpRegister loc = LowDwVfpRegister::from_code(dst.code());
-    vmov(loc.high(), src);
-  } else {
-    vmov(dst, VmovIndexHi, src);
-  }
-}
-
-void TurboAssembler::VmovLow(Register dst, DwVfpRegister src) {
-  if (src.code() < 16) {
-    const LowDwVfpRegister loc = LowDwVfpRegister::from_code(src.code());
-    vmov(dst, loc.low());
-  } else {
-    vmov(dst, VmovIndexLo, src);
-  }
-}
-
-void TurboAssembler::VmovLow(DwVfpRegister dst, Register src) {
-  if (dst.code() < 16) {
-    const LowDwVfpRegister loc = LowDwVfpRegister::from_code(dst.code());
-    vmov(loc.low(), src);
-  } else {
-    vmov(dst, VmovIndexLo, src);
-  }
-}
-
-void TurboAssembler::VmovExtended(Register dst, int src_code) {
-  DCHECK_LE(SwVfpRegister::kNumRegisters, src_code);
-  DCHECK_GT(SwVfpRegister::kNumRegisters * 2, src_code);
-  if (src_code & 0x1) {
-    VmovHigh(dst, DwVfpRegister::from_code(src_code / 2));
-  } else {
-    VmovLow(dst, DwVfpRegister::from_code(src_code / 2));
-  }
-}
-
-void TurboAssembler::VmovExtended(int dst_code, Register src) {
-  DCHECK_LE(SwVfpRegister::kNumRegisters, dst_code);
-  DCHECK_GT(SwVfpRegister::kNumRegisters * 2, dst_code);
-  if (dst_code & 0x1) {
-    VmovHigh(DwVfpRegister::from_code(dst_code / 2), src);
-  } else {
-    VmovLow(DwVfpRegister::from_code(dst_code / 2), src);
-  }
-}
-
-void TurboAssembler::VmovExtended(int dst_code, int src_code) {
-  if (src_code == dst_code) return;
-
-  if (src_code < SwVfpRegister::kNumRegisters &&
-      dst_code < SwVfpRegister::kNumRegisters) {
-    // src and dst are both s-registers.
-    vmov(SwVfpRegister::from_code(dst_code),
-         SwVfpRegister::from_code(src_code));
-    return;
-  }
-  DwVfpRegister dst_d_reg = DwVfpRegister::from_code(dst_code / 2);
-  DwVfpRegister src_d_reg = DwVfpRegister::from_code(src_code / 2);
-  int dst_offset = dst_code & 1;
-  int src_offset = src_code & 1;
-  if (CpuFeatures::IsSupported(NEON)) {
-    // On Neon we can shift and insert from d-registers.
-    if (src_offset == dst_offset) {
-      // Offsets are the same, use vdup to copy the source to the opposite lane.
-      vdup(Neon32, kScratchDoubleReg, src_d_reg, src_offset);
-      src_d_reg = kScratchDoubleReg;
-      src_offset = dst_offset ^ 1;
-    }
-    if (dst_offset) {
-      if (dst_d_reg == src_d_reg) {
-        vdup(Neon32, dst_d_reg, src_d_reg, 0);
-      } else {
-        vsli(Neon64, dst_d_reg, src_d_reg, 32);
-      }
-    } else {
-      if (dst_d_reg == src_d_reg) {
-        vdup(Neon32, dst_d_reg, src_d_reg, 1);
-      } else {
-        vsri(Neon64, dst_d_reg, src_d_reg, 32);
-      }
-    }
-    return;
-  }
-
-  // Without Neon, use the scratch registers to move src and/or dst into
-  // s-registers.
-  int scratchSCode = kScratchDoubleReg.low().code();
-  int scratchSCode2 = kScratchDoubleReg2.low().code();
-  if (src_code < SwVfpRegister::kNumRegisters) {
-    // src is an s-register, dst is not.
-    vmov(kScratchDoubleReg, dst_d_reg);
-    vmov(SwVfpRegister::from_code(scratchSCode + dst_offset),
-         SwVfpRegister::from_code(src_code));
-    vmov(dst_d_reg, kScratchDoubleReg);
-  } else if (dst_code < SwVfpRegister::kNumRegisters) {
-    // dst is an s-register, src is not.
-    vmov(kScratchDoubleReg, src_d_reg);
-    vmov(SwVfpRegister::from_code(dst_code),
-         SwVfpRegister::from_code(scratchSCode + src_offset));
-  } else {
-    // Neither src or dst are s-registers. Both scratch double registers are
-    // available when there are 32 VFP registers.
-    vmov(kScratchDoubleReg, src_d_reg);
-    vmov(kScratchDoubleReg2, dst_d_reg);
-    vmov(SwVfpRegister::from_code(scratchSCode + dst_offset),
-         SwVfpRegister::from_code(scratchSCode2 + src_offset));
-    vmov(dst_d_reg, kScratchQuadReg.high());
-  }
-}
-
-void TurboAssembler::VmovExtended(int dst_code, const MemOperand& src) {
-  if (dst_code < SwVfpRegister::kNumRegisters) {
-    vldr(SwVfpRegister::from_code(dst_code), src);
-  } else {
-    // TODO(bbudge) If Neon supported, use load single lane form of vld1.
-    int dst_s_code = kScratchDoubleReg.low().code() + (dst_code & 1);
-    vmov(kScratchDoubleReg, DwVfpRegister::from_code(dst_code / 2));
-    vldr(SwVfpRegister::from_code(dst_s_code), src);
-    vmov(DwVfpRegister::from_code(dst_code / 2), kScratchDoubleReg);
-  }
-}
-
-void TurboAssembler::VmovExtended(const MemOperand& dst, int src_code) {
-  if (src_code < SwVfpRegister::kNumRegisters) {
-    vstr(SwVfpRegister::from_code(src_code), dst);
-  } else {
-    // TODO(bbudge) If Neon supported, use store single lane form of vst1.
-    int src_s_code = kScratchDoubleReg.low().code() + (src_code & 1);
-    vmov(kScratchDoubleReg, DwVfpRegister::from_code(src_code / 2));
-    vstr(SwVfpRegister::from_code(src_s_code), dst);
-  }
-}
-
-void TurboAssembler::ExtractLane(Register dst, QwNeonRegister src,
-                                 NeonDataType dt, int lane) {
-  int size = NeonSz(dt);  // 0, 1, 2
-  int byte = lane << size;
-  int double_word = byte >> kDoubleSizeLog2;
-  int double_byte = byte & (kDoubleSize - 1);
-  int double_lane = double_byte >> size;
-  DwVfpRegister double_source =
-      DwVfpRegister::from_code(src.code() * 2 + double_word);
-  vmov(dt, dst, double_source, double_lane);
-}
-
-void TurboAssembler::ExtractLane(Register dst, DwVfpRegister src,
-                                 NeonDataType dt, int lane) {
-  int size = NeonSz(dt);  // 0, 1, 2
-  int byte = lane << size;
-  int double_byte = byte & (kDoubleSize - 1);
-  int double_lane = double_byte >> size;
-  vmov(dt, dst, src, double_lane);
-}
-
-void TurboAssembler::ExtractLane(SwVfpRegister dst, QwNeonRegister src,
-                                 int lane) {
-  int s_code = src.code() * 4 + lane;
-  VmovExtended(dst.code(), s_code);
-}
-
-void TurboAssembler::ReplaceLane(QwNeonRegister dst, QwNeonRegister src,
-                                 Register src_lane, NeonDataType dt, int lane) {
-  Move(dst, src);
-  int size = NeonSz(dt);  // 0, 1, 2
-  int byte = lane << size;
-  int double_word = byte >> kDoubleSizeLog2;
-  int double_byte = byte & (kDoubleSize - 1);
-  int double_lane = double_byte >> size;
-  DwVfpRegister double_dst =
-      DwVfpRegister::from_code(dst.code() * 2 + double_word);
-  vmov(dt, double_dst, double_lane, src_lane);
-}
-
-void TurboAssembler::ReplaceLane(QwNeonRegister dst, QwNeonRegister src,
-                                 SwVfpRegister src_lane, int lane) {
-  Move(dst, src);
-  int s_code = dst.code() * 4 + lane;
-  VmovExtended(s_code, src_lane.code());
-}
-
-void TurboAssembler::LslPair(Register dst_low, Register dst_high,
-                             Register src_low, Register src_high,
-                             Register scratch, Register shift) {
-  DCHECK(!AreAliased(dst_high, src_low));
-  DCHECK(!AreAliased(dst_high, shift));
-
-  Label less_than_32;
-  Label done;
-  rsb(scratch, shift, Operand(32), SetCC);
-  b(gt, &less_than_32);
-  // If shift >= 32
-  and_(scratch, shift, Operand(0x1F));
-  lsl(dst_high, src_low, Operand(scratch));
-  mov(dst_low, Operand(0));
-  jmp(&done);
-  bind(&less_than_32);
-  // If shift < 32
-  lsl(dst_high, src_high, Operand(shift));
-  orr(dst_high, dst_high, Operand(src_low, LSR, scratch));
-  lsl(dst_low, src_low, Operand(shift));
-  bind(&done);
-}
-
-void TurboAssembler::LslPair(Register dst_low, Register dst_high,
-                             Register src_low, Register src_high,
-                             uint32_t shift) {
-  DCHECK(!AreAliased(dst_high, src_low));
-  Label less_than_32;
-  Label done;
-  if (shift == 0) {
-    Move(dst_high, src_high);
-    Move(dst_low, src_low);
-  } else if (shift == 32) {
-    Move(dst_high, src_low);
-    Move(dst_low, Operand(0));
-  } else if (shift >= 32) {
-    shift &= 0x1F;
-    lsl(dst_high, src_low, Operand(shift));
-    mov(dst_low, Operand(0));
-  } else {
-    lsl(dst_high, src_high, Operand(shift));
-    orr(dst_high, dst_high, Operand(src_low, LSR, 32 - shift));
-    lsl(dst_low, src_low, Operand(shift));
-  }
-}
-
-void TurboAssembler::LsrPair(Register dst_low, Register dst_high,
-                             Register src_low, Register src_high,
-                             Register scratch, Register shift) {
-  DCHECK(!AreAliased(dst_low, src_high));
-  DCHECK(!AreAliased(dst_low, shift));
-
-  Label less_than_32;
-  Label done;
-  rsb(scratch, shift, Operand(32), SetCC);
-  b(gt, &less_than_32);
-  // If shift >= 32
-  and_(scratch, shift, Operand(0x1F));
-  lsr(dst_low, src_high, Operand(scratch));
-  mov(dst_high, Operand(0));
-  jmp(&done);
-  bind(&less_than_32);
-  // If shift < 32
-
-  lsr(dst_low, src_low, Operand(shift));
-  orr(dst_low, dst_low, Operand(src_high, LSL, scratch));
-  lsr(dst_high, src_high, Operand(shift));
-  bind(&done);
-}
-
-void TurboAssembler::LsrPair(Register dst_low, Register dst_high,
-                             Register src_low, Register src_high,
-                             uint32_t shift) {
-  DCHECK(!AreAliased(dst_low, src_high));
-  Label less_than_32;
-  Label done;
-  if (shift == 32) {
-    mov(dst_low, src_high);
-    mov(dst_high, Operand(0));
-  } else if (shift > 32) {
-    shift &= 0x1F;
-    lsr(dst_low, src_high, Operand(shift));
-    mov(dst_high, Operand(0));
-  } else if (shift == 0) {
-    Move(dst_low, src_low);
-    Move(dst_high, src_high);
-  } else {
-    lsr(dst_low, src_low, Operand(shift));
-    orr(dst_low, dst_low, Operand(src_high, LSL, 32 - shift));
-    lsr(dst_high, src_high, Operand(shift));
-  }
-}
-
-void TurboAssembler::AsrPair(Register dst_low, Register dst_high,
-                             Register src_low, Register src_high,
-                             Register scratch, Register shift) {
-  DCHECK(!AreAliased(dst_low, src_high));
-  DCHECK(!AreAliased(dst_low, shift));
-
-  Label less_than_32;
-  Label done;
-  rsb(scratch, shift, Operand(32), SetCC);
-  b(gt, &less_than_32);
-  // If shift >= 32
-  and_(scratch, shift, Operand(0x1F));
-  asr(dst_low, src_high, Operand(scratch));
-  asr(dst_high, src_high, Operand(31));
-  jmp(&done);
-  bind(&less_than_32);
-  // If shift < 32
-  lsr(dst_low, src_low, Operand(shift));
-  orr(dst_low, dst_low, Operand(src_high, LSL, scratch));
-  asr(dst_high, src_high, Operand(shift));
-  bind(&done);
-}
-
-void TurboAssembler::AsrPair(Register dst_low, Register dst_high,
-                             Register src_low, Register src_high,
-                             uint32_t shift) {
-  DCHECK(!AreAliased(dst_low, src_high));
-  Label less_than_32;
-  Label done;
-  if (shift == 32) {
-    mov(dst_low, src_high);
-    asr(dst_high, src_high, Operand(31));
-  } else if (shift > 32) {
-    shift &= 0x1F;
-    asr(dst_low, src_high, Operand(shift));
-    asr(dst_high, src_high, Operand(31));
-  } else if (shift == 0) {
-    Move(dst_low, src_low);
-    Move(dst_high, src_high);
-  } else {
-    lsr(dst_low, src_low, Operand(shift));
-    orr(dst_low, dst_low, Operand(src_high, LSL, 32 - shift));
-    asr(dst_high, src_high, Operand(shift));
-  }
-}
-
-void TurboAssembler::StubPrologue(StackFrame::Type type) {
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  mov(scratch, Operand(StackFrame::TypeToMarker(type)));
-  PushCommonFrame(scratch);
-}
-
-void TurboAssembler::Prologue() { PushStandardFrame(r1); }
-
-void TurboAssembler::EnterFrame(StackFrame::Type type,
-                                bool load_constant_pool_pointer_reg) {
-  // r0-r3: preserved
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  mov(scratch, Operand(StackFrame::TypeToMarker(type)));
-  PushCommonFrame(scratch);
-  if (type == StackFrame::INTERNAL) {
-    mov(scratch, Operand(CodeObject()));
-    push(scratch);
-  }
-}
-
-int TurboAssembler::LeaveFrame(StackFrame::Type type) {
-  // r0: preserved
-  // r1: preserved
-  // r2: preserved
-
-  // Drop the execution stack down to the frame pointer and restore
-  // the caller frame pointer and return address.
-  mov(sp, fp);
-  int frame_ends = pc_offset();
-  ldm(ia_w, sp, fp.bit() | lr.bit());
-  return frame_ends;
-}
-
-void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space,
-                                    StackFrame::Type frame_type) {
-  DCHECK(frame_type == StackFrame::EXIT ||
-         frame_type == StackFrame::BUILTIN_EXIT);
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-
-  // Set up the frame structure on the stack.
-  DCHECK_EQ(2 * kPointerSize, ExitFrameConstants::kCallerSPDisplacement);
-  DCHECK_EQ(1 * kPointerSize, ExitFrameConstants::kCallerPCOffset);
-  DCHECK_EQ(0 * kPointerSize, ExitFrameConstants::kCallerFPOffset);
-  mov(scratch, Operand(StackFrame::TypeToMarker(frame_type)));
-  PushCommonFrame(scratch);
-  // Reserve room for saved entry sp and code object.
-  sub(sp, fp, Operand(ExitFrameConstants::kFixedFrameSizeFromFp));
-  if (emit_debug_code()) {
-    mov(scratch, Operand::Zero());
-    str(scratch, MemOperand(fp, ExitFrameConstants::kSPOffset));
-  }
-  mov(scratch, Operand(CodeObject()));
-  str(scratch, MemOperand(fp, ExitFrameConstants::kCodeOffset));
-
-  // Save the frame pointer and the context in top.
-  mov(scratch, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress,
-                                         isolate())));
-  str(fp, MemOperand(scratch));
-  mov(scratch,
-      Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate())));
-  str(cp, MemOperand(scratch));
-
-  // Optionally save all double registers.
-  if (save_doubles) {
-    SaveFPRegs(sp, scratch);
-    // Note that d0 will be accessible at
-    //   fp - ExitFrameConstants::kFrameSize -
-    //   DwVfpRegister::kNumRegisters * kDoubleSize,
-    // since the sp slot and code slot were pushed after the fp.
-  }
-
-  // Reserve place for the return address and stack space and align the frame
-  // preparing for calling the runtime function.
-  const int frame_alignment = MacroAssembler::ActivationFrameAlignment();
-  sub(sp, sp, Operand((stack_space + 1) * kPointerSize));
-  if (frame_alignment > 0) {
-    DCHECK(base::bits::IsPowerOfTwo(frame_alignment));
-    and_(sp, sp, Operand(-frame_alignment));
-  }
-
-  // Set the exit frame sp value to point just before the return address
-  // location.
-  add(scratch, sp, Operand(kPointerSize));
-  str(scratch, MemOperand(fp, ExitFrameConstants::kSPOffset));
-}
-
-int TurboAssembler::ActivationFrameAlignment() {
-#if V8_HOST_ARCH_ARM
-  // Running on the real platform. Use the alignment as mandated by the local
-  // environment.
-  // Note: This will break if we ever start generating snapshots on one ARM
-  // platform for another ARM platform with a different alignment.
-  return base::OS::ActivationFrameAlignment();
-#else  // V8_HOST_ARCH_ARM
-  // If we are using the simulator then we should always align to the expected
-  // alignment. As the simulator is used to generate snapshots we do not know
-  // if the target platform will need alignment, so this is controlled from a
-  // flag.
-  return FLAG_sim_stack_alignment;
-#endif  // V8_HOST_ARCH_ARM
-}
-
-void MacroAssembler::LeaveExitFrame(bool save_doubles, Register argument_count,
-                                    bool argument_count_is_length) {
-  ConstantPoolUnavailableScope constant_pool_unavailable(this);
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-
-  // Optionally restore all double registers.
-  if (save_doubles) {
-    // Calculate the stack location of the saved doubles and restore them.
-    const int offset = ExitFrameConstants::kFixedFrameSizeFromFp;
-    sub(r3, fp, Operand(offset + DwVfpRegister::kNumRegisters * kDoubleSize));
-    RestoreFPRegs(r3, scratch);
-  }
-
-  // Clear top frame.
-  mov(r3, Operand::Zero());
-  mov(scratch, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress,
-                                         isolate())));
-  str(r3, MemOperand(scratch));
-
-  // Restore current context from top and clear it in debug mode.
-  mov(scratch,
-      Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate())));
-  ldr(cp, MemOperand(scratch));
-#ifdef DEBUG
-  mov(r3, Operand(Context::kInvalidContext));
-  mov(scratch,
-      Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate())));
-  str(r3, MemOperand(scratch));
-#endif
-
-  // Tear down the exit frame, pop the arguments, and return.
-  mov(sp, Operand(fp));
-  ldm(ia_w, sp, fp.bit() | lr.bit());
-  if (argument_count.is_valid()) {
-    if (argument_count_is_length) {
-      add(sp, sp, argument_count);
-    } else {
-      add(sp, sp, Operand(argument_count, LSL, kPointerSizeLog2));
-    }
-  }
-}
-
-void TurboAssembler::MovFromFloatResult(const DwVfpRegister dst) {
-  if (use_eabi_hardfloat()) {
-    Move(dst, d0);
-  } else {
-    vmov(dst, r0, r1);
-  }
-}
-
-
-// On ARM this is just a synonym to make the purpose clear.
-void TurboAssembler::MovFromFloatParameter(DwVfpRegister dst) {
-  MovFromFloatResult(dst);
-}
-
-void TurboAssembler::PrepareForTailCall(const ParameterCount& callee_args_count,
-                                        Register caller_args_count_reg,
-                                        Register scratch0, Register scratch1) {
-#if DEBUG
-  if (callee_args_count.is_reg()) {
-    DCHECK(!AreAliased(callee_args_count.reg(), caller_args_count_reg, scratch0,
-                       scratch1));
-  } else {
-    DCHECK(!AreAliased(caller_args_count_reg, scratch0, scratch1));
-  }
-#endif
-
-  // Calculate the end of destination area where we will put the arguments
-  // after we drop current frame. We add kPointerSize to count the receiver
-  // argument which is not included into formal parameters count.
-  Register dst_reg = scratch0;
-  add(dst_reg, fp, Operand(caller_args_count_reg, LSL, kPointerSizeLog2));
-  add(dst_reg, dst_reg,
-      Operand(StandardFrameConstants::kCallerSPOffset + kPointerSize));
-
-  Register src_reg = caller_args_count_reg;
-  // Calculate the end of source area. +kPointerSize is for the receiver.
-  if (callee_args_count.is_reg()) {
-    add(src_reg, sp, Operand(callee_args_count.reg(), LSL, kPointerSizeLog2));
-    add(src_reg, src_reg, Operand(kPointerSize));
-  } else {
-    add(src_reg, sp,
-        Operand((callee_args_count.immediate() + 1) * kPointerSize));
-  }
-
-  if (FLAG_debug_code) {
-    cmp(src_reg, dst_reg);
-    Check(lo, AbortReason::kStackAccessBelowStackPointer);
-  }
-
-  // Restore caller's frame pointer and return address now as they will be
-  // overwritten by the copying loop.
-  ldr(lr, MemOperand(fp, StandardFrameConstants::kCallerPCOffset));
-  ldr(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
-
-  // Now copy callee arguments to the caller frame going backwards to avoid
-  // callee arguments corruption (source and destination areas could overlap).
-
-  // Both src_reg and dst_reg are pointing to the word after the one to copy,
-  // so they must be pre-decremented in the loop.
-  Register tmp_reg = scratch1;
-  Label loop, entry;
-  b(&entry);
-  bind(&loop);
-  ldr(tmp_reg, MemOperand(src_reg, -kPointerSize, PreIndex));
-  str(tmp_reg, MemOperand(dst_reg, -kPointerSize, PreIndex));
-  bind(&entry);
-  cmp(sp, src_reg);
-  b(ne, &loop);
-
-  // Leave current frame.
-  mov(sp, dst_reg);
-}
-
-void MacroAssembler::InvokePrologue(const ParameterCount& expected,
-                                    const ParameterCount& actual, Label* done,
-                                    bool* definitely_mismatches,
-                                    InvokeFlag flag) {
-  bool definitely_matches = false;
-  *definitely_mismatches = false;
-  Label regular_invoke;
-
-  // Check whether the expected and actual arguments count match. If not,
-  // setup registers according to contract with ArgumentsAdaptorTrampoline:
-  //  r0: actual arguments count
-  //  r1: function (passed through to callee)
-  //  r2: expected arguments count
-
-  // The code below is made a lot easier because the calling code already sets
-  // up actual and expected registers according to the contract if values are
-  // passed in registers.
-  DCHECK(actual.is_immediate() || actual.reg() == r0);
-  DCHECK(expected.is_immediate() || expected.reg() == r2);
-
-  if (expected.is_immediate()) {
-    DCHECK(actual.is_immediate());
-    mov(r0, Operand(actual.immediate()));
-    if (expected.immediate() == actual.immediate()) {
-      definitely_matches = true;
-    } else {
-      const int sentinel = SharedFunctionInfo::kDontAdaptArgumentsSentinel;
-      if (expected.immediate() == sentinel) {
-        // Don't worry about adapting arguments for builtins that
-        // don't want that done. Skip adaption code by making it look
-        // like we have a match between expected and actual number of
-        // arguments.
-        definitely_matches = true;
-      } else {
-        *definitely_mismatches = true;
-        mov(r2, Operand(expected.immediate()));
-      }
-    }
-  } else {
-    if (actual.is_immediate()) {
-      mov(r0, Operand(actual.immediate()));
-      cmp(expected.reg(), Operand(actual.immediate()));
-      b(eq, &regular_invoke);
-    } else {
-      cmp(expected.reg(), Operand(actual.reg()));
-      b(eq, &regular_invoke);
-    }
-  }
-
-  if (!definitely_matches) {
-    Handle<Code> adaptor = BUILTIN_CODE(isolate(), ArgumentsAdaptorTrampoline);
-    if (flag == CALL_FUNCTION) {
-      Call(adaptor);
-      if (!*definitely_mismatches) {
-        b(done);
-      }
-    } else {
-      Jump(adaptor, RelocInfo::CODE_TARGET);
-    }
-    bind(&regular_invoke);
-  }
-}
-
-void MacroAssembler::CheckDebugHook(Register fun, Register new_target,
-                                    const ParameterCount& expected,
-                                    const ParameterCount& actual) {
-  Label skip_hook;
-  ExternalReference debug_hook_avtive =
-      ExternalReference::debug_hook_on_function_call_address(isolate());
-  mov(r4, Operand(debug_hook_avtive));
-  ldrsb(r4, MemOperand(r4));
-  cmp(r4, Operand(0));
-  b(eq, &skip_hook);
-  {
-    FrameScope frame(this,
-                     has_frame() ? StackFrame::NONE : StackFrame::INTERNAL);
-    if (expected.is_reg()) {
-      SmiTag(expected.reg());
-      Push(expected.reg());
-    }
-    if (actual.is_reg()) {
-      SmiTag(actual.reg());
-      Push(actual.reg());
-    }
-    if (new_target.is_valid()) {
-      Push(new_target);
-    }
-    Push(fun);
-    Push(fun);
-    CallRuntime(Runtime::kDebugOnFunctionCall);
-    Pop(fun);
-    if (new_target.is_valid()) {
-      Pop(new_target);
-    }
-    if (actual.is_reg()) {
-      Pop(actual.reg());
-      SmiUntag(actual.reg());
-    }
-    if (expected.is_reg()) {
-      Pop(expected.reg());
-      SmiUntag(expected.reg());
-    }
-  }
-  bind(&skip_hook);
-}
-
-void MacroAssembler::InvokeFunctionCode(Register function, Register new_target,
-                                        const ParameterCount& expected,
-                                        const ParameterCount& actual,
-                                        InvokeFlag flag) {
-  // You can't call a function without a valid frame.
-  DCHECK(flag == JUMP_FUNCTION || has_frame());
-  DCHECK(function == r1);
-  DCHECK_IMPLIES(new_target.is_valid(), new_target == r3);
-
-  // On function call, call into the debugger if necessary.
-  CheckDebugHook(function, new_target, expected, actual);
-
-  // Clear the new.target register if not given.
-  if (!new_target.is_valid()) {
-    LoadRoot(r3, Heap::kUndefinedValueRootIndex);
-  }
-
-  Label done;
-  bool definitely_mismatches = false;
-  InvokePrologue(expected, actual, &done, &definitely_mismatches, flag);
-  if (!definitely_mismatches) {
-    // We call indirectly through the code field in the function to
-    // allow recompilation to take effect without changing any of the
-    // call sites.
-    Register code = r4;
-    ldr(code, FieldMemOperand(function, JSFunction::kCodeOffset));
-    add(code, code, Operand(Code::kHeaderSize - kHeapObjectTag));
-    if (flag == CALL_FUNCTION) {
-      Call(code);
-    } else {
-      DCHECK(flag == JUMP_FUNCTION);
-      Jump(code);
-    }
-
-    // Continue here if InvokePrologue does handle the invocation due to
-    // mismatched parameter counts.
-    bind(&done);
-  }
-}
-
-void MacroAssembler::InvokeFunction(Register fun, Register new_target,
-                                    const ParameterCount& actual,
-                                    InvokeFlag flag) {
-  // You can't call a function without a valid frame.
-  DCHECK(flag == JUMP_FUNCTION || has_frame());
-
-  // Contract with called JS functions requires that function is passed in r1.
-  DCHECK(fun == r1);
-
-  Register expected_reg = r2;
-  Register temp_reg = r4;
-
-  ldr(temp_reg, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset));
-  ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
-  ldr(expected_reg,
-      FieldMemOperand(temp_reg,
-                      SharedFunctionInfo::kFormalParameterCountOffset));
-
-  ParameterCount expected(expected_reg);
-  InvokeFunctionCode(fun, new_target, expected, actual, flag);
-}
-
-void MacroAssembler::InvokeFunction(Register function,
-                                    const ParameterCount& expected,
-                                    const ParameterCount& actual,
-                                    InvokeFlag flag) {
-  // You can't call a function without a valid frame.
-  DCHECK(flag == JUMP_FUNCTION || has_frame());
-
-  // Contract with called JS functions requires that function is passed in r1.
-  DCHECK(function == r1);
-
-  // Get the function and setup the context.
-  ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
-
-  InvokeFunctionCode(r1, no_reg, expected, actual, flag);
-}
-
-void MacroAssembler::InvokeFunction(Handle<JSFunction> function,
-                                    const ParameterCount& expected,
-                                    const ParameterCount& actual,
-                                    InvokeFlag flag) {
-  Move(r1, function);
-  InvokeFunction(r1, expected, actual, flag);
-}
-
-void MacroAssembler::MaybeDropFrames() {
-  // Check whether we need to drop frames to restart a function on the stack.
-  ExternalReference restart_fp =
-      ExternalReference::debug_restart_fp_address(isolate());
-  mov(r1, Operand(restart_fp));
-  ldr(r1, MemOperand(r1));
-  tst(r1, r1);
-  Jump(BUILTIN_CODE(isolate(), FrameDropperTrampoline), RelocInfo::CODE_TARGET,
-       ne);
-}
-
-void MacroAssembler::PushStackHandler() {
-  // Adjust this code if not the case.
-  STATIC_ASSERT(StackHandlerConstants::kSize == 2 * kPointerSize);
-  STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize);
-
-  Push(Smi::kZero);  // Padding.
-  // Link the current handler as the next handler.
-  mov(r6,
-      Operand(ExternalReference(IsolateAddressId::kHandlerAddress, isolate())));
-  ldr(r5, MemOperand(r6));
-  push(r5);
-  // Set this new handler as the current one.
-  str(sp, MemOperand(r6));
-}
-
-
-void MacroAssembler::PopStackHandler() {
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
-  pop(r1);
-  mov(scratch,
-      Operand(ExternalReference(IsolateAddressId::kHandlerAddress, isolate())));
-  str(r1, MemOperand(scratch));
-  add(sp, sp, Operand(StackHandlerConstants::kSize - kPointerSize));
-}
-
-
-void MacroAssembler::CompareObjectType(Register object,
-                                       Register map,
-                                       Register type_reg,
-                                       InstanceType type) {
-  UseScratchRegisterScope temps(this);
-  const Register temp = type_reg == no_reg ? temps.Acquire() : type_reg;
-
-  ldr(map, FieldMemOperand(object, HeapObject::kMapOffset));
-  CompareInstanceType(map, temp, type);
-}
-
-
-void MacroAssembler::CompareInstanceType(Register map,
-                                         Register type_reg,
-                                         InstanceType type) {
-  ldrh(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset));
-  cmp(type_reg, Operand(type));
-}
-
-
-void MacroAssembler::CompareRoot(Register obj,
-                                 Heap::RootListIndex index) {
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  DCHECK(obj != scratch);
-  LoadRoot(scratch, index);
-  cmp(obj, scratch);
-}
-
-void MacroAssembler::CallStub(CodeStub* stub,
-                              Condition cond) {
-  DCHECK(AllowThisStubCall(stub));  // Stub calls are not allowed in some stubs.
-  Call(stub->GetCode(), RelocInfo::CODE_TARGET, cond, CAN_INLINE_TARGET_ADDRESS,
-       false);
-}
-
-void TurboAssembler::CallStubDelayed(CodeStub* stub) {
-  DCHECK(AllowThisStubCall(stub));  // Stub calls are not allowed in some stubs.
-
-  // Block constant pool for the call instruction sequence.
-  BlockConstPoolScope block_const_pool(this);
-  Label start;
-  bind(&start);
-
-#ifdef DEBUG
-  // Check the expected size before generating code to ensure we assume the same
-  // constant pool availability (e.g., whether constant pool is full or not).
-  int expected_size = CallStubSize();
-#endif
-
-  // Call sequence on V7 or later may be :
-  //  movw  ip, #... @ call address low 16
-  //  movt  ip, #... @ call address high 16
-  //  blx   ip
-  //                      @ return address
-  // Or for pre-V7 or values that may be back-patched
-  // to avoid ICache flushes:
-  //  ldr   ip, [pc, #...] @ call address
-  //  blx   ip
-  //                      @ return address
-
-  mov(ip, Operand::EmbeddedCode(stub));
-  blx(ip, al);
-
-  DCHECK_EQ(expected_size, SizeOfCodeGeneratedSince(&start));
-}
-
-void MacroAssembler::TailCallStub(CodeStub* stub, Condition cond) {
-  Jump(stub->GetCode(), RelocInfo::CODE_TARGET, cond);
-}
-
-bool TurboAssembler::AllowThisStubCall(CodeStub* stub) {
-  return has_frame() || !stub->SometimesSetsUpAFrame();
-}
-
-void MacroAssembler::TryDoubleToInt32Exact(Register result,
-                                           DwVfpRegister double_input,
-                                           LowDwVfpRegister double_scratch) {
-  DCHECK(double_input != double_scratch);
-  vcvt_s32_f64(double_scratch.low(), double_input);
-  vmov(result, double_scratch.low());
-  vcvt_f64_s32(double_scratch, double_scratch.low());
-  VFPCompareAndSetFlags(double_input, double_scratch);
-}
-
-void TurboAssembler::TryInlineTruncateDoubleToI(Register result,
-                                                DwVfpRegister double_input,
-                                                Label* done) {
-  LowDwVfpRegister double_scratch = kScratchDoubleReg;
-  vcvt_s32_f64(double_scratch.low(), double_input);
-  vmov(result, double_scratch.low());
-
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-
-  // If result is not saturated (0x7FFFFFFF or 0x80000000), we are done.
-  sub(scratch, result, Operand(1));
-  cmp(scratch, Operand(0x7FFFFFFE));
-  b(lt, done);
-}
-
-void TurboAssembler::TruncateDoubleToIDelayed(Zone* zone, Register result,
-                                              DwVfpRegister double_input) {
-  Label done;
-
-  TryInlineTruncateDoubleToI(result, double_input, &done);
-
-  // If we fell through then inline version didn't succeed - call stub instead.
-  push(lr);
-  sub(sp, sp, Operand(kDoubleSize));  // Put input on stack.
-  vstr(double_input, MemOperand(sp, 0));
-
-  CallStubDelayed(new (zone) DoubleToIStub(nullptr, result));
-
-  add(sp, sp, Operand(kDoubleSize));
-  pop(lr);
-
-  bind(&done);
-}
-
-void TurboAssembler::CallRuntimeDelayed(Zone* zone, Runtime::FunctionId fid,
-                                        SaveFPRegsMode save_doubles) {
-  const Runtime::Function* f = Runtime::FunctionForId(fid);
-  // TODO(1236192): Most runtime routines don't need the number of
-  // arguments passed in because it is constant. At some point we
-  // should remove this need and make the runtime routine entry code
-  // smarter.
-  mov(r0, Operand(f->nargs));
-  mov(r1, Operand(ExternalReference(f, isolate())));
-  CallStubDelayed(new (zone) CEntryStub(nullptr, 1, save_doubles));
-}
-
-void MacroAssembler::CallRuntime(const Runtime::Function* f,
-                                 int num_arguments,
-                                 SaveFPRegsMode save_doubles) {
-  // All parameters are on the stack.  r0 has the return value after call.
-
-  // If the expected number of arguments of the runtime function is
-  // constant, we check that the actual number of arguments match the
-  // expectation.
-  CHECK(f->nargs < 0 || f->nargs == num_arguments);
-
-  // TODO(1236192): Most runtime routines don't need the number of
-  // arguments passed in because it is constant. At some point we
-  // should remove this need and make the runtime routine entry code
-  // smarter.
-  mov(r0, Operand(num_arguments));
-  mov(r1, Operand(ExternalReference(f, isolate())));
-  CEntryStub stub(isolate(), 1, save_doubles);
-  CallStub(&stub);
-}
-
-void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid) {
-  const Runtime::Function* function = Runtime::FunctionForId(fid);
-  DCHECK_EQ(1, function->result_size);
-  if (function->nargs >= 0) {
-    // TODO(1236192): Most runtime routines don't need the number of
-    // arguments passed in because it is constant. At some point we
-    // should remove this need and make the runtime routine entry code
-    // smarter.
-    mov(r0, Operand(function->nargs));
-  }
-  JumpToExternalReference(ExternalReference(fid, isolate()));
-}
-
-void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin,
-                                             bool builtin_exit_frame) {
-#if defined(__thumb__)
-  // Thumb mode builtin.
-  DCHECK_EQ(reinterpret_cast<intptr_t>(builtin.address()) & 1, 1);
-#endif
-  mov(r1, Operand(builtin));
-  CEntryStub stub(isolate(), 1, kDontSaveFPRegs, kArgvOnStack,
-                  builtin_exit_frame);
-  Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
-}
-
-void MacroAssembler::IncrementCounter(StatsCounter* counter, int value,
-                                      Register scratch1, Register scratch2) {
-  DCHECK_GT(value, 0);
-  if (FLAG_native_code_counters && counter->Enabled()) {
-    mov(scratch2, Operand(ExternalReference(counter)));
-    ldr(scratch1, MemOperand(scratch2));
-    add(scratch1, scratch1, Operand(value));
-    str(scratch1, MemOperand(scratch2));
-  }
-}
-
-
-void MacroAssembler::DecrementCounter(StatsCounter* counter, int value,
-                                      Register scratch1, Register scratch2) {
-  DCHECK_GT(value, 0);
-  if (FLAG_native_code_counters && counter->Enabled()) {
-    mov(scratch2, Operand(ExternalReference(counter)));
-    ldr(scratch1, MemOperand(scratch2));
-    sub(scratch1, scratch1, Operand(value));
-    str(scratch1, MemOperand(scratch2));
-  }
-}
-
-void TurboAssembler::Assert(Condition cond, AbortReason reason) {
-  if (emit_debug_code())
-    Check(cond, reason);
-}
-
-void TurboAssembler::Check(Condition cond, AbortReason reason) {
-  Label L;
-  b(cond, &L);
-  Abort(reason);
-  // will not return here
-  bind(&L);
-}
-
-void TurboAssembler::Abort(AbortReason reason) {
-  Label abort_start;
-  bind(&abort_start);
-#ifdef DEBUG
-  const char* msg = GetAbortReason(reason);
-  if (msg != nullptr) {
-    RecordComment("Abort message: ");
-    RecordComment(msg);
-  }
-
-  if (FLAG_trap_on_abort) {
-    stop(msg);
-    return;
-  }
-#endif
-
-  Move(r1, Smi::FromInt(static_cast<int>(reason)));
-
-  // Disable stub call restrictions to always allow calls to abort.
-  if (!has_frame()) {
-    // We don't actually want to generate a pile of code for this, so just
-    // claim there is a stack frame, without generating one.
-    FrameScope scope(this, StackFrame::NONE);
-    Call(BUILTIN_CODE(isolate(), Abort), RelocInfo::CODE_TARGET);
-  } else {
-    Call(BUILTIN_CODE(isolate(), Abort), RelocInfo::CODE_TARGET);
-  }
-  // will not return here
-  if (is_const_pool_blocked()) {
-    // If the calling code cares about the exact number of
-    // instructions generated, we insert padding here to keep the size
-    // of the Abort macro constant.
-    static const int kExpectedAbortInstructions = 7;
-    int abort_instructions = InstructionsGeneratedSince(&abort_start);
-    DCHECK_LE(abort_instructions, kExpectedAbortInstructions);
-    while (abort_instructions++ < kExpectedAbortInstructions) {
-      nop();
-    }
-  }
-}
-
-void MacroAssembler::LoadNativeContextSlot(int index, Register dst) {
-  ldr(dst, NativeContextMemOperand());
-  ldr(dst, ContextMemOperand(dst, index));
-}
-
-
-void TurboAssembler::InitializeRootRegister() {
-  ExternalReference roots_array_start =
-      ExternalReference::roots_array_start(isolate());
-  mov(kRootRegister, Operand(roots_array_start));
-}
-
-void MacroAssembler::SmiTag(Register reg, SBit s) {
-  add(reg, reg, Operand(reg), s);
-}
-
-void MacroAssembler::SmiTag(Register dst, Register src, SBit s) {
-  add(dst, src, Operand(src), s);
-}
-
-void MacroAssembler::UntagAndJumpIfSmi(
-    Register dst, Register src, Label* smi_case) {
-  STATIC_ASSERT(kSmiTag == 0);
-  SmiUntag(dst, src, SetCC);
-  b(cc, smi_case);  // Shifter carry is not set for a smi.
-}
-
-void MacroAssembler::SmiTst(Register value) {
-  tst(value, Operand(kSmiTagMask));
-}
-
-void TurboAssembler::JumpIfSmi(Register value, Label* smi_label) {
-  tst(value, Operand(kSmiTagMask));
-  b(eq, smi_label);
-}
-
-void MacroAssembler::JumpIfNotSmi(Register value, Label* not_smi_label) {
-  tst(value, Operand(kSmiTagMask));
-  b(ne, not_smi_label);
-}
-
-void MacroAssembler::JumpIfEitherSmi(Register reg1,
-                                     Register reg2,
-                                     Label* on_either_smi) {
-  STATIC_ASSERT(kSmiTag == 0);
-  tst(reg1, Operand(kSmiTagMask));
-  tst(reg2, Operand(kSmiTagMask), ne);
-  b(eq, on_either_smi);
-}
-
-void MacroAssembler::AssertNotSmi(Register object) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    tst(object, Operand(kSmiTagMask));
-    Check(ne, AbortReason::kOperandIsASmi);
-  }
-}
-
-
-void MacroAssembler::AssertSmi(Register object) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    tst(object, Operand(kSmiTagMask));
-    Check(eq, AbortReason::kOperandIsNotASmi);
-  }
-}
-
-void MacroAssembler::AssertFixedArray(Register object) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    tst(object, Operand(kSmiTagMask));
-    Check(ne, AbortReason::kOperandIsASmiAndNotAFixedArray);
-    push(object);
-    CompareObjectType(object, object, object, FIXED_ARRAY_TYPE);
-    pop(object);
-    Check(eq, AbortReason::kOperandIsNotAFixedArray);
-  }
-}
-
-void MacroAssembler::AssertFunction(Register object) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    tst(object, Operand(kSmiTagMask));
-    Check(ne, AbortReason::kOperandIsASmiAndNotAFunction);
-    push(object);
-    CompareObjectType(object, object, object, JS_FUNCTION_TYPE);
-    pop(object);
-    Check(eq, AbortReason::kOperandIsNotAFunction);
-  }
-}
-
-
-void MacroAssembler::AssertBoundFunction(Register object) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    tst(object, Operand(kSmiTagMask));
-    Check(ne, AbortReason::kOperandIsASmiAndNotABoundFunction);
-    push(object);
-    CompareObjectType(object, object, object, JS_BOUND_FUNCTION_TYPE);
-    pop(object);
-    Check(eq, AbortReason::kOperandIsNotABoundFunction);
-  }
-}
-
-void MacroAssembler::AssertGeneratorObject(Register object) {
-  if (!emit_debug_code()) return;
-  tst(object, Operand(kSmiTagMask));
-  Check(ne, AbortReason::kOperandIsASmiAndNotAGeneratorObject);
-
-  // Load map
-  Register map = object;
-  push(object);
-  ldr(map, FieldMemOperand(object, HeapObject::kMapOffset));
-
-  // Check if JSGeneratorObject
-  Label do_check;
-  Register instance_type = object;
-  CompareInstanceType(map, instance_type, JS_GENERATOR_OBJECT_TYPE);
-  b(eq, &do_check);
-
-  // Check if JSAsyncGeneratorObject (See MacroAssembler::CompareInstanceType)
-  cmp(instance_type, Operand(JS_ASYNC_GENERATOR_OBJECT_TYPE));
-
-  bind(&do_check);
-  // Restore generator object to register and perform assertion
-  pop(object);
-  Check(eq, AbortReason::kOperandIsNotAGeneratorObject);
-}
-
-void MacroAssembler::AssertUndefinedOrAllocationSite(Register object,
-                                                     Register scratch) {
-  if (emit_debug_code()) {
-    Label done_checking;
-    AssertNotSmi(object);
-    CompareRoot(object, Heap::kUndefinedValueRootIndex);
-    b(eq, &done_checking);
-    ldr(scratch, FieldMemOperand(object, HeapObject::kMapOffset));
-    CompareRoot(scratch, Heap::kAllocationSiteMapRootIndex);
-    Assert(eq, AbortReason::kExpectedUndefinedOrCell);
-    bind(&done_checking);
-  }
-}
-
-
-void TurboAssembler::CheckFor32DRegs(Register scratch) {
-  mov(scratch, Operand(ExternalReference::cpu_features()));
-  ldr(scratch, MemOperand(scratch));
-  tst(scratch, Operand(1u << VFP32DREGS));
-}
-
-void TurboAssembler::SaveFPRegs(Register location, Register scratch) {
-  CpuFeatureScope scope(this, VFP32DREGS, CpuFeatureScope::kDontCheckSupported);
-  CheckFor32DRegs(scratch);
-  vstm(db_w, location, d16, d31, ne);
-  sub(location, location, Operand(16 * kDoubleSize), LeaveCC, eq);
-  vstm(db_w, location, d0, d15);
-}
-
-void TurboAssembler::RestoreFPRegs(Register location, Register scratch) {
-  CpuFeatureScope scope(this, VFP32DREGS, CpuFeatureScope::kDontCheckSupported);
-  CheckFor32DRegs(scratch);
-  vldm(ia_w, location, d0, d15);
-  vldm(ia_w, location, d16, d31, ne);
-  add(location, location, Operand(16 * kDoubleSize), LeaveCC, eq);
-}
-
-template <typename T>
-void TurboAssembler::FloatMaxHelper(T result, T left, T right,
-                                    Label* out_of_line) {
-  // This trivial case is caught sooner, so that the out-of-line code can be
-  // completely avoided.
-  DCHECK(left != right);
-
-  if (CpuFeatures::IsSupported(ARMv8)) {
-    CpuFeatureScope scope(this, ARMv8);
-    VFPCompareAndSetFlags(left, right);
-    b(vs, out_of_line);
-    vmaxnm(result, left, right);
-  } else {
-    Label done;
-    VFPCompareAndSetFlags(left, right);
-    b(vs, out_of_line);
-    // Avoid a conditional instruction if the result register is unique.
-    bool aliased_result_reg = result == left || result == right;
-    Move(result, right, aliased_result_reg ? mi : al);
-    Move(result, left, gt);
-    b(ne, &done);
-    // Left and right are equal, but check for +/-0.
-    VFPCompareAndSetFlags(left, 0.0);
-    b(eq, out_of_line);
-    // The arguments are equal and not zero, so it doesn't matter which input we
-    // pick. We have already moved one input into the result (if it didn't
-    // already alias) so there's nothing more to do.
-    bind(&done);
-  }
-}
-
-template <typename T>
-void TurboAssembler::FloatMaxOutOfLineHelper(T result, T left, T right) {
-  DCHECK(left != right);
-
-  // ARMv8: At least one of left and right is a NaN.
-  // Anything else: At least one of left and right is a NaN, or both left and
-  // right are zeroes with unknown sign.
-
-  // If left and right are +/-0, select the one with the most positive sign.
-  // If left or right are NaN, vadd propagates the appropriate one.
-  vadd(result, left, right);
-}
-
-template <typename T>
-void TurboAssembler::FloatMinHelper(T result, T left, T right,
-                                    Label* out_of_line) {
-  // This trivial case is caught sooner, so that the out-of-line code can be
-  // completely avoided.
-  DCHECK(left != right);
-
-  if (CpuFeatures::IsSupported(ARMv8)) {
-    CpuFeatureScope scope(this, ARMv8);
-    VFPCompareAndSetFlags(left, right);
-    b(vs, out_of_line);
-    vminnm(result, left, right);
-  } else {
-    Label done;
-    VFPCompareAndSetFlags(left, right);
-    b(vs, out_of_line);
-    // Avoid a conditional instruction if the result register is unique.
-    bool aliased_result_reg = result == left || result == right;
-    Move(result, left, aliased_result_reg ? mi : al);
-    Move(result, right, gt);
-    b(ne, &done);
-    // Left and right are equal, but check for +/-0.
-    VFPCompareAndSetFlags(left, 0.0);
-    // If the arguments are equal and not zero, it doesn't matter which input we
-    // pick. We have already moved one input into the result (if it didn't
-    // already alias) so there's nothing more to do.
-    b(ne, &done);
-    // At this point, both left and right are either 0 or -0.
-    // We could use a single 'vorr' instruction here if we had NEON support.
-    // The algorithm used is -((-L) + (-R)), which is most efficiently expressed
-    // as -((-L) - R).
-    if (left == result) {
-      DCHECK(right != result);
-      vneg(result, left);
-      vsub(result, result, right);
-      vneg(result, result);
-    } else {
-      DCHECK(left != result);
-      vneg(result, right);
-      vsub(result, result, left);
-      vneg(result, result);
-    }
-    bind(&done);
-  }
-}
-
-template <typename T>
-void TurboAssembler::FloatMinOutOfLineHelper(T result, T left, T right) {
-  DCHECK(left != right);
-
-  // At least one of left and right is a NaN. Use vadd to propagate the NaN
-  // appropriately. +/-0 is handled inline.
-  vadd(result, left, right);
-}
-
-void TurboAssembler::FloatMax(SwVfpRegister result, SwVfpRegister left,
-                              SwVfpRegister right, Label* out_of_line) {
-  FloatMaxHelper(result, left, right, out_of_line);
-}
-
-void TurboAssembler::FloatMin(SwVfpRegister result, SwVfpRegister left,
-                              SwVfpRegister right, Label* out_of_line) {
-  FloatMinHelper(result, left, right, out_of_line);
-}
-
-void TurboAssembler::FloatMax(DwVfpRegister result, DwVfpRegister left,
-                              DwVfpRegister right, Label* out_of_line) {
-  FloatMaxHelper(result, left, right, out_of_line);
-}
-
-void TurboAssembler::FloatMin(DwVfpRegister result, DwVfpRegister left,
-                              DwVfpRegister right, Label* out_of_line) {
-  FloatMinHelper(result, left, right, out_of_line);
-}
-
-void TurboAssembler::FloatMaxOutOfLine(SwVfpRegister result, SwVfpRegister left,
-                                       SwVfpRegister right) {
-  FloatMaxOutOfLineHelper(result, left, right);
-}
-
-void TurboAssembler::FloatMinOutOfLine(SwVfpRegister result, SwVfpRegister left,
-                                       SwVfpRegister right) {
-  FloatMinOutOfLineHelper(result, left, right);
-}
-
-void TurboAssembler::FloatMaxOutOfLine(DwVfpRegister result, DwVfpRegister left,
-                                       DwVfpRegister right) {
-  FloatMaxOutOfLineHelper(result, left, right);
-}
-
-void TurboAssembler::FloatMinOutOfLine(DwVfpRegister result, DwVfpRegister left,
-                                       DwVfpRegister right) {
-  FloatMinOutOfLineHelper(result, left, right);
-}
-
-static const int kRegisterPassedArguments = 4;
-
-int TurboAssembler::CalculateStackPassedWords(int num_reg_arguments,
-                                              int num_double_arguments) {
-  int stack_passed_words = 0;
-  if (use_eabi_hardfloat()) {
-    // In the hard floating point calling convention, we can use
-    // all double registers to pass doubles.
-    if (num_double_arguments > DoubleRegister::NumRegisters()) {
-      stack_passed_words +=
-          2 * (num_double_arguments - DoubleRegister::NumRegisters());
-    }
-  } else {
-    // In the soft floating point calling convention, every double
-    // argument is passed using two registers.
-    num_reg_arguments += 2 * num_double_arguments;
-  }
-  // Up to four simple arguments are passed in registers r0..r3.
-  if (num_reg_arguments > kRegisterPassedArguments) {
-    stack_passed_words += num_reg_arguments - kRegisterPassedArguments;
-  }
-  return stack_passed_words;
-}
-
-void TurboAssembler::PrepareCallCFunction(int num_reg_arguments,
-                                          int num_double_arguments) {
-  int frame_alignment = ActivationFrameAlignment();
-  int stack_passed_arguments = CalculateStackPassedWords(
-      num_reg_arguments, num_double_arguments);
-  if (frame_alignment > kPointerSize) {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    // Make stack end at alignment and make room for num_arguments - 4 words
-    // and the original value of sp.
-    mov(scratch, sp);
-    sub(sp, sp, Operand((stack_passed_arguments + 1) * kPointerSize));
-    DCHECK(base::bits::IsPowerOfTwo(frame_alignment));
-    and_(sp, sp, Operand(-frame_alignment));
-    str(scratch, MemOperand(sp, stack_passed_arguments * kPointerSize));
-  } else {
-    sub(sp, sp, Operand(stack_passed_arguments * kPointerSize));
-  }
-}
-
-void TurboAssembler::MovToFloatParameter(DwVfpRegister src) {
-  DCHECK(src == d0);
-  if (!use_eabi_hardfloat()) {
-    vmov(r0, r1, src);
-  }
-}
-
-
-// On ARM this is just a synonym to make the purpose clear.
-void TurboAssembler::MovToFloatResult(DwVfpRegister src) {
-  MovToFloatParameter(src);
-}
-
-void TurboAssembler::MovToFloatParameters(DwVfpRegister src1,
-                                          DwVfpRegister src2) {
-  DCHECK(src1 == d0);
-  DCHECK(src2 == d1);
-  if (!use_eabi_hardfloat()) {
-    vmov(r0, r1, src1);
-    vmov(r2, r3, src2);
-  }
-}
-
-void TurboAssembler::CallCFunction(ExternalReference function,
-                                   int num_reg_arguments,
-                                   int num_double_arguments) {
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  mov(scratch, Operand(function));
-  CallCFunctionHelper(scratch, num_reg_arguments, num_double_arguments);
-}
-
-void TurboAssembler::CallCFunction(Register function, int num_reg_arguments,
-                                   int num_double_arguments) {
-  CallCFunctionHelper(function, num_reg_arguments, num_double_arguments);
-}
-
-void TurboAssembler::CallCFunction(ExternalReference function,
-                                   int num_arguments) {
-  CallCFunction(function, num_arguments, 0);
-}
-
-void TurboAssembler::CallCFunction(Register function, int num_arguments) {
-  CallCFunction(function, num_arguments, 0);
-}
-
-void TurboAssembler::CallCFunctionHelper(Register function,
-                                         int num_reg_arguments,
-                                         int num_double_arguments) {
-  DCHECK_LE(num_reg_arguments + num_double_arguments, kMaxCParameters);
-  DCHECK(has_frame());
-  // Make sure that the stack is aligned before calling a C function unless
-  // running in the simulator. The simulator has its own alignment check which
-  // provides more information.
-#if V8_HOST_ARCH_ARM
-  if (emit_debug_code()) {
-    int frame_alignment = base::OS::ActivationFrameAlignment();
-    int frame_alignment_mask = frame_alignment - 1;
-    if (frame_alignment > kPointerSize) {
-      DCHECK(base::bits::IsPowerOfTwo(frame_alignment));
-      Label alignment_as_expected;
-      tst(sp, Operand(frame_alignment_mask));
-      b(eq, &alignment_as_expected);
-      // Don't use Check here, as it will call Runtime_Abort possibly
-      // re-entering here.
-      stop("Unexpected alignment");
-      bind(&alignment_as_expected);
-    }
-  }
-#endif
-
-  // Just call directly. The function called cannot cause a GC, or
-  // allow preemption, so the return address in the link register
-  // stays correct.
-  Call(function);
-  int stack_passed_arguments = CalculateStackPassedWords(
-      num_reg_arguments, num_double_arguments);
-  if (ActivationFrameAlignment() > kPointerSize) {
-    ldr(sp, MemOperand(sp, stack_passed_arguments * kPointerSize));
-  } else {
-    add(sp, sp, Operand(stack_passed_arguments * kPointerSize));
-  }
-}
-
-void TurboAssembler::CheckPageFlag(Register object, Register scratch, int mask,
-                                   Condition cc, Label* condition_met) {
-  DCHECK(cc == eq || cc == ne);
-  Bfc(scratch, object, 0, kPageSizeBits);
-  ldr(scratch, MemOperand(scratch, MemoryChunk::kFlagsOffset));
-  tst(scratch, Operand(mask));
-  b(cc, condition_met);
-}
-
-Register GetRegisterThatIsNotOneOf(Register reg1,
-                                   Register reg2,
-                                   Register reg3,
-                                   Register reg4,
-                                   Register reg5,
-                                   Register reg6) {
-  RegList regs = 0;
-  if (reg1.is_valid()) regs |= reg1.bit();
-  if (reg2.is_valid()) regs |= reg2.bit();
-  if (reg3.is_valid()) regs |= reg3.bit();
-  if (reg4.is_valid()) regs |= reg4.bit();
-  if (reg5.is_valid()) regs |= reg5.bit();
-  if (reg6.is_valid()) regs |= reg6.bit();
-
-  const RegisterConfiguration* config = RegisterConfiguration::Default();
-  for (int i = 0; i < config->num_allocatable_general_registers(); ++i) {
-    int code = config->GetAllocatableGeneralCode(i);
-    Register candidate = Register::from_code(code);
-    if (regs & candidate.bit()) continue;
-    return candidate;
-  }
-  UNREACHABLE();
-}
-
-#ifdef DEBUG
-bool AreAliased(Register reg1,
-                Register reg2,
-                Register reg3,
-                Register reg4,
-                Register reg5,
-                Register reg6,
-                Register reg7,
-                Register reg8) {
-  int n_of_valid_regs = reg1.is_valid() + reg2.is_valid() +
-      reg3.is_valid() + reg4.is_valid() + reg5.is_valid() + reg6.is_valid() +
-      reg7.is_valid() + reg8.is_valid();
-
-  RegList regs = 0;
-  if (reg1.is_valid()) regs |= reg1.bit();
-  if (reg2.is_valid()) regs |= reg2.bit();
-  if (reg3.is_valid()) regs |= reg3.bit();
-  if (reg4.is_valid()) regs |= reg4.bit();
-  if (reg5.is_valid()) regs |= reg5.bit();
-  if (reg6.is_valid()) regs |= reg6.bit();
-  if (reg7.is_valid()) regs |= reg7.bit();
-  if (reg8.is_valid()) regs |= reg8.bit();
-  int n_of_non_aliasing_regs = NumRegs(regs);
-
-  return n_of_valid_regs != n_of_non_aliasing_regs;
-}
-#endif
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_ARM
diff --git a/src/v8/src/arm/macro-assembler-arm.h b/src/v8/src/arm/macro-assembler-arm.h
deleted file mode 100644
index cf731cb..0000000
--- a/src/v8/src/arm/macro-assembler-arm.h
+++ /dev/null
@@ -1,894 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_ARM_MACRO_ASSEMBLER_ARM_H_
-#define V8_ARM_MACRO_ASSEMBLER_ARM_H_
-
-#include "src/arm/assembler-arm.h"
-#include "src/assembler.h"
-#include "src/bailout-reason.h"
-#include "src/globals.h"
-
-namespace v8 {
-namespace internal {
-
-// Give alias names to registers for calling conventions.
-constexpr Register kReturnRegister0 = r0;
-constexpr Register kReturnRegister1 = r1;
-constexpr Register kReturnRegister2 = r2;
-constexpr Register kJSFunctionRegister = r1;
-constexpr Register kContextRegister = r7;
-constexpr Register kAllocateSizeRegister = r1;
-constexpr Register kInterpreterAccumulatorRegister = r0;
-constexpr Register kInterpreterBytecodeOffsetRegister = r5;
-constexpr Register kInterpreterBytecodeArrayRegister = r6;
-constexpr Register kInterpreterDispatchTableRegister = r8;
-constexpr Register kJavaScriptCallArgCountRegister = r0;
-constexpr Register kJavaScriptCallNewTargetRegister = r3;
-constexpr Register kRuntimeCallFunctionRegister = r1;
-constexpr Register kRuntimeCallArgCountRegister = r0;
-
-// ----------------------------------------------------------------------------
-// Static helper functions
-
-// Generate a MemOperand for loading a field from an object.
-inline MemOperand FieldMemOperand(Register object, int offset) {
-  return MemOperand(object, offset - kHeapObjectTag);
-}
-
-
-// Give alias names to registers
-constexpr Register cp = r7;              // JavaScript context pointer.
-constexpr Register kRootRegister = r10;  // Roots array pointer.
-
-// Flags used for AllocateHeapNumber
-enum TaggingMode {
-  // Tag the result.
-  TAG_RESULT,
-  // Don't tag
-  DONT_TAG_RESULT
-};
-
-
-enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET };
-enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK };
-enum LinkRegisterStatus { kLRHasNotBeenSaved, kLRHasBeenSaved };
-
-
-Register GetRegisterThatIsNotOneOf(Register reg1,
-                                   Register reg2 = no_reg,
-                                   Register reg3 = no_reg,
-                                   Register reg4 = no_reg,
-                                   Register reg5 = no_reg,
-                                   Register reg6 = no_reg);
-
-
-#ifdef DEBUG
-bool AreAliased(Register reg1,
-                Register reg2,
-                Register reg3 = no_reg,
-                Register reg4 = no_reg,
-                Register reg5 = no_reg,
-                Register reg6 = no_reg,
-                Register reg7 = no_reg,
-                Register reg8 = no_reg);
-#endif
-
-
-enum TargetAddressStorageMode {
-  CAN_INLINE_TARGET_ADDRESS,
-  NEVER_INLINE_TARGET_ADDRESS
-};
-
-class TurboAssembler : public Assembler {
- public:
-  TurboAssembler(Isolate* isolate, void* buffer, int buffer_size,
-                 CodeObjectRequired create_code_object);
-
-  void set_has_frame(bool value) { has_frame_ = value; }
-  bool has_frame() const { return has_frame_; }
-
-  Isolate* isolate() const { return isolate_; }
-
-  Handle<HeapObject> CodeObject() {
-    DCHECK(!code_object_.is_null());
-    return code_object_;
-  }
-
-  // Activation support.
-  void EnterFrame(StackFrame::Type type,
-                  bool load_constant_pool_pointer_reg = false);
-  // Returns the pc offset at which the frame ends.
-  int LeaveFrame(StackFrame::Type type);
-
-  // Push a fixed frame, consisting of lr, fp
-  void PushCommonFrame(Register marker_reg = no_reg);
-
-  // Generates function and stub prologue code.
-  void StubPrologue(StackFrame::Type type);
-  void Prologue();
-
-  // Push a standard frame, consisting of lr, fp, context and JS function
-  void PushStandardFrame(Register function_reg);
-
-  void InitializeRootRegister();
-
-  void Push(Register src) { push(src); }
-
-  void Push(Handle<HeapObject> handle);
-  void Push(Smi* smi);
-
-  // Push two registers.  Pushes leftmost register first (to highest address).
-  void Push(Register src1, Register src2, Condition cond = al) {
-    if (src1.code() > src2.code()) {
-      stm(db_w, sp, src1.bit() | src2.bit(), cond);
-    } else {
-      str(src1, MemOperand(sp, 4, NegPreIndex), cond);
-      str(src2, MemOperand(sp, 4, NegPreIndex), cond);
-    }
-  }
-
-  // Push three registers.  Pushes leftmost register first (to highest address).
-  void Push(Register src1, Register src2, Register src3, Condition cond = al) {
-    if (src1.code() > src2.code()) {
-      if (src2.code() > src3.code()) {
-        stm(db_w, sp, src1.bit() | src2.bit() | src3.bit(), cond);
-      } else {
-        stm(db_w, sp, src1.bit() | src2.bit(), cond);
-        str(src3, MemOperand(sp, 4, NegPreIndex), cond);
-      }
-    } else {
-      str(src1, MemOperand(sp, 4, NegPreIndex), cond);
-      Push(src2, src3, cond);
-    }
-  }
-
-  // Push four registers.  Pushes leftmost register first (to highest address).
-  void Push(Register src1, Register src2, Register src3, Register src4,
-            Condition cond = al) {
-    if (src1.code() > src2.code()) {
-      if (src2.code() > src3.code()) {
-        if (src3.code() > src4.code()) {
-          stm(db_w, sp, src1.bit() | src2.bit() | src3.bit() | src4.bit(),
-              cond);
-        } else {
-          stm(db_w, sp, src1.bit() | src2.bit() | src3.bit(), cond);
-          str(src4, MemOperand(sp, 4, NegPreIndex), cond);
-        }
-      } else {
-        stm(db_w, sp, src1.bit() | src2.bit(), cond);
-        Push(src3, src4, cond);
-      }
-    } else {
-      str(src1, MemOperand(sp, 4, NegPreIndex), cond);
-      Push(src2, src3, src4, cond);
-    }
-  }
-
-  // Push five registers.  Pushes leftmost register first (to highest address).
-  void Push(Register src1, Register src2, Register src3, Register src4,
-            Register src5, Condition cond = al) {
-    if (src1.code() > src2.code()) {
-      if (src2.code() > src3.code()) {
-        if (src3.code() > src4.code()) {
-          if (src4.code() > src5.code()) {
-            stm(db_w, sp,
-                src1.bit() | src2.bit() | src3.bit() | src4.bit() | src5.bit(),
-                cond);
-          } else {
-            stm(db_w, sp, src1.bit() | src2.bit() | src3.bit() | src4.bit(),
-                cond);
-            str(src5, MemOperand(sp, 4, NegPreIndex), cond);
-          }
-        } else {
-          stm(db_w, sp, src1.bit() | src2.bit() | src3.bit(), cond);
-          Push(src4, src5, cond);
-        }
-      } else {
-        stm(db_w, sp, src1.bit() | src2.bit(), cond);
-        Push(src3, src4, src5, cond);
-      }
-    } else {
-      str(src1, MemOperand(sp, 4, NegPreIndex), cond);
-      Push(src2, src3, src4, src5, cond);
-    }
-  }
-
-  void Pop(Register dst) { pop(dst); }
-
-  // Pop two registers. Pops rightmost register first (from lower address).
-  void Pop(Register src1, Register src2, Condition cond = al) {
-    DCHECK(src1 != src2);
-    if (src1.code() > src2.code()) {
-      ldm(ia_w, sp, src1.bit() | src2.bit(), cond);
-    } else {
-      ldr(src2, MemOperand(sp, 4, PostIndex), cond);
-      ldr(src1, MemOperand(sp, 4, PostIndex), cond);
-    }
-  }
-
-  // Pop three registers.  Pops rightmost register first (from lower address).
-  void Pop(Register src1, Register src2, Register src3, Condition cond = al) {
-    DCHECK(!AreAliased(src1, src2, src3));
-    if (src1.code() > src2.code()) {
-      if (src2.code() > src3.code()) {
-        ldm(ia_w, sp, src1.bit() | src2.bit() | src3.bit(), cond);
-      } else {
-        ldr(src3, MemOperand(sp, 4, PostIndex), cond);
-        ldm(ia_w, sp, src1.bit() | src2.bit(), cond);
-      }
-    } else {
-      Pop(src2, src3, cond);
-      ldr(src1, MemOperand(sp, 4, PostIndex), cond);
-    }
-  }
-
-  // Pop four registers.  Pops rightmost register first (from lower address).
-  void Pop(Register src1, Register src2, Register src3, Register src4,
-           Condition cond = al) {
-    DCHECK(!AreAliased(src1, src2, src3, src4));
-    if (src1.code() > src2.code()) {
-      if (src2.code() > src3.code()) {
-        if (src3.code() > src4.code()) {
-          ldm(ia_w, sp, src1.bit() | src2.bit() | src3.bit() | src4.bit(),
-              cond);
-        } else {
-          ldr(src4, MemOperand(sp, 4, PostIndex), cond);
-          ldm(ia_w, sp, src1.bit() | src2.bit() | src3.bit(), cond);
-        }
-      } else {
-        Pop(src3, src4, cond);
-        ldm(ia_w, sp, src1.bit() | src2.bit(), cond);
-      }
-    } else {
-      Pop(src2, src3, src4, cond);
-      ldr(src1, MemOperand(sp, 4, PostIndex), cond);
-    }
-  }
-
-  // Before calling a C-function from generated code, align arguments on stack.
-  // After aligning the frame, non-register arguments must be stored in
-  // sp[0], sp[4], etc., not pushed. The argument count assumes all arguments
-  // are word sized. If double arguments are used, this function assumes that
-  // all double arguments are stored before core registers; otherwise the
-  // correct alignment of the double values is not guaranteed.
-  // Some compilers/platforms require the stack to be aligned when calling
-  // C++ code.
-  // Needs a scratch register to do some arithmetic. This register will be
-  // trashed.
-  void PrepareCallCFunction(int num_reg_arguments,
-                            int num_double_registers = 0);
-
-  // Removes current frame and its arguments from the stack preserving
-  // the arguments and a return address pushed to the stack for the next call.
-  // Both |callee_args_count| and |caller_args_count_reg| do not include
-  // receiver. |callee_args_count| is not modified, |caller_args_count_reg|
-  // is trashed.
-  void PrepareForTailCall(const ParameterCount& callee_args_count,
-                          Register caller_args_count_reg, Register scratch0,
-                          Register scratch1);
-
-  // There are two ways of passing double arguments on ARM, depending on
-  // whether soft or hard floating point ABI is used. These functions
-  // abstract parameter passing for the three different ways we call
-  // C functions from generated code.
-  void MovToFloatParameter(DwVfpRegister src);
-  void MovToFloatParameters(DwVfpRegister src1, DwVfpRegister src2);
-  void MovToFloatResult(DwVfpRegister src);
-
-  // Calls a C function and cleans up the space for arguments allocated
-  // by PrepareCallCFunction. The called function is not allowed to trigger a
-  // garbage collection, since that might move the code and invalidate the
-  // return address (unless this is somehow accounted for by the called
-  // function).
-  void CallCFunction(ExternalReference function, int num_arguments);
-  void CallCFunction(Register function, int num_arguments);
-  void CallCFunction(ExternalReference function, int num_reg_arguments,
-                     int num_double_arguments);
-  void CallCFunction(Register function, int num_reg_arguments,
-                     int num_double_arguments);
-
-  void MovFromFloatParameter(DwVfpRegister dst);
-  void MovFromFloatResult(DwVfpRegister dst);
-
-  // Calls Abort(msg) if the condition cond is not satisfied.
-  // Use --debug_code to enable.
-  void Assert(Condition cond, AbortReason reason);
-
-  // Like Assert(), but always enabled.
-  void Check(Condition cond, AbortReason reason);
-
-  // Print a message to stdout and abort execution.
-  void Abort(AbortReason msg);
-
-  inline bool AllowThisStubCall(CodeStub* stub);
-
-  void LslPair(Register dst_low, Register dst_high, Register src_low,
-               Register src_high, Register scratch, Register shift);
-  void LslPair(Register dst_low, Register dst_high, Register src_low,
-               Register src_high, uint32_t shift);
-  void LsrPair(Register dst_low, Register dst_high, Register src_low,
-               Register src_high, Register scratch, Register shift);
-  void LsrPair(Register dst_low, Register dst_high, Register src_low,
-               Register src_high, uint32_t shift);
-  void AsrPair(Register dst_low, Register dst_high, Register src_low,
-               Register src_high, Register scratch, Register shift);
-  void AsrPair(Register dst_low, Register dst_high, Register src_low,
-               Register src_high, uint32_t shift);
-
-  // Returns the size of a call in instructions. Note, the value returned is
-  // only valid as long as no entries are added to the constant pool between
-  // checking the call size and emitting the actual call.
-  static int CallSize(Register target, Condition cond = al);
-  int CallSize(Address target, RelocInfo::Mode rmode, Condition cond = al);
-  int CallSize(Handle<Code> code,
-               RelocInfo::Mode rmode = RelocInfo::CODE_TARGET,
-               Condition cond = al);
-  int CallStubSize();
-
-  void CallStubDelayed(CodeStub* stub);
-  void CallRuntimeDelayed(Zone* zone, Runtime::FunctionId fid,
-                          SaveFPRegsMode save_doubles = kDontSaveFPRegs);
-
-  // Jump, Call, and Ret pseudo instructions implementing inter-working.
-  void Call(Register target, Condition cond = al);
-  void Call(Address target, RelocInfo::Mode rmode, Condition cond = al,
-            TargetAddressStorageMode mode = CAN_INLINE_TARGET_ADDRESS,
-            bool check_constant_pool = true);
-  void Call(Handle<Code> code, RelocInfo::Mode rmode = RelocInfo::CODE_TARGET,
-            Condition cond = al,
-            TargetAddressStorageMode mode = CAN_INLINE_TARGET_ADDRESS,
-            bool check_constant_pool = true);
-  void Call(Label* target);
-
-  // This should only be used when assembling a deoptimizer call because of
-  // the CheckConstPool invocation, which is only needed for deoptimization.
-  void CallForDeoptimization(Address target, RelocInfo::Mode rmode) {
-    Call(target, rmode);
-    CheckConstPool(false, false);
-  }
-
-  // Emit code to discard a non-negative number of pointer-sized elements
-  // from the stack, clobbering only the sp register.
-  void Drop(int count, Condition cond = al);
-  void Drop(Register count, Condition cond = al);
-
-  void Ret(Condition cond = al);
-  void Ret(int drop, Condition cond = al);
-
-  // Compare single values and move the result to the normal condition flags.
-  void VFPCompareAndSetFlags(const SwVfpRegister src1, const SwVfpRegister src2,
-                             const Condition cond = al);
-  void VFPCompareAndSetFlags(const SwVfpRegister src1, const float src2,
-                             const Condition cond = al);
-
-  // Compare double values and move the result to the normal condition flags.
-  void VFPCompareAndSetFlags(const DwVfpRegister src1, const DwVfpRegister src2,
-                             const Condition cond = al);
-  void VFPCompareAndSetFlags(const DwVfpRegister src1, const double src2,
-                             const Condition cond = al);
-
-  // If the value is a NaN, canonicalize the value else, do nothing.
-  void VFPCanonicalizeNaN(const DwVfpRegister dst, const DwVfpRegister src,
-                          const Condition cond = al);
-  void VFPCanonicalizeNaN(const DwVfpRegister value,
-                          const Condition cond = al) {
-    VFPCanonicalizeNaN(value, value, cond);
-  }
-
-  void VmovHigh(Register dst, DwVfpRegister src);
-  void VmovHigh(DwVfpRegister dst, Register src);
-  void VmovLow(Register dst, DwVfpRegister src);
-  void VmovLow(DwVfpRegister dst, Register src);
-
-  void CheckPageFlag(Register object, Register scratch, int mask, Condition cc,
-                     Label* condition_met);
-
-  // Check whether d16-d31 are available on the CPU. The result is given by the
-  // Z condition flag: Z==0 if d16-d31 available, Z==1 otherwise.
-  void CheckFor32DRegs(Register scratch);
-
-  void SaveRegisters(RegList registers);
-  void RestoreRegisters(RegList registers);
-
-  void CallRecordWriteStub(Register object, Register address,
-                           RememberedSetAction remembered_set_action,
-                           SaveFPRegsMode fp_mode);
-
-  // Does a runtime check for 16/32 FP registers. Either way, pushes 32 double
-  // values to location, saving [d0..(d15|d31)].
-  void SaveFPRegs(Register location, Register scratch);
-
-  // Does a runtime check for 16/32 FP registers. Either way, pops 32 double
-  // values to location, restoring [d0..(d15|d31)].
-  void RestoreFPRegs(Register location, Register scratch);
-
-  // Calculate how much stack space (in bytes) are required to store caller
-  // registers excluding those specified in the arguments.
-  int RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode,
-                                      Register exclusion1 = no_reg,
-                                      Register exclusion2 = no_reg,
-                                      Register exclusion3 = no_reg) const;
-
-  // Push caller saved registers on the stack, and return the number of bytes
-  // stack pointer is adjusted.
-  int PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1 = no_reg,
-                      Register exclusion2 = no_reg,
-                      Register exclusion3 = no_reg);
-  // Restore caller saved registers from the stack, and return the number of
-  // bytes stack pointer is adjusted.
-  int PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1 = no_reg,
-                     Register exclusion2 = no_reg,
-                     Register exclusion3 = no_reg);
-  void Jump(Register target, Condition cond = al);
-  void Jump(Address target, RelocInfo::Mode rmode, Condition cond = al);
-  void Jump(Handle<Code> code, RelocInfo::Mode rmode, Condition cond = al);
-
-  // Perform a floating-point min or max operation with the
-  // (IEEE-754-compatible) semantics of ARM64's fmin/fmax. Some cases, typically
-  // NaNs or +/-0.0, are expected to be rare and are handled in out-of-line
-  // code. The specific behaviour depends on supported instructions.
-  //
-  // These functions assume (and assert) that left!=right. It is permitted
-  // for the result to alias either input register.
-  void FloatMax(SwVfpRegister result, SwVfpRegister left, SwVfpRegister right,
-                Label* out_of_line);
-  void FloatMin(SwVfpRegister result, SwVfpRegister left, SwVfpRegister right,
-                Label* out_of_line);
-  void FloatMax(DwVfpRegister result, DwVfpRegister left, DwVfpRegister right,
-                Label* out_of_line);
-  void FloatMin(DwVfpRegister result, DwVfpRegister left, DwVfpRegister right,
-                Label* out_of_line);
-
-  // Generate out-of-line cases for the macros above.
-  void FloatMaxOutOfLine(SwVfpRegister result, SwVfpRegister left,
-                         SwVfpRegister right);
-  void FloatMinOutOfLine(SwVfpRegister result, SwVfpRegister left,
-                         SwVfpRegister right);
-  void FloatMaxOutOfLine(DwVfpRegister result, DwVfpRegister left,
-                         DwVfpRegister right);
-  void FloatMinOutOfLine(DwVfpRegister result, DwVfpRegister left,
-                         DwVfpRegister right);
-
-  void ExtractLane(Register dst, QwNeonRegister src, NeonDataType dt, int lane);
-  void ExtractLane(Register dst, DwVfpRegister src, NeonDataType dt, int lane);
-  void ExtractLane(SwVfpRegister dst, QwNeonRegister src, int lane);
-  void ReplaceLane(QwNeonRegister dst, QwNeonRegister src, Register src_lane,
-                   NeonDataType dt, int lane);
-  void ReplaceLane(QwNeonRegister dst, QwNeonRegister src,
-                   SwVfpRegister src_lane, int lane);
-
-  // Register move. May do nothing if the registers are identical.
-  void Move(Register dst, Smi* smi);
-  void Move(Register dst, Handle<HeapObject> value);
-  void Move(Register dst, Register src, Condition cond = al);
-  void Move(Register dst, const Operand& src, SBit sbit = LeaveCC,
-            Condition cond = al) {
-    if (!src.IsRegister() || src.rm() != dst || sbit != LeaveCC) {
-      mov(dst, src, sbit, cond);
-    }
-  }
-  void Move(SwVfpRegister dst, SwVfpRegister src, Condition cond = al);
-  void Move(DwVfpRegister dst, DwVfpRegister src, Condition cond = al);
-  void Move(QwNeonRegister dst, QwNeonRegister src);
-
-  // Simulate s-register moves for imaginary s32 - s63 registers.
-  void VmovExtended(Register dst, int src_code);
-  void VmovExtended(int dst_code, Register src);
-  // Move between s-registers and imaginary s-registers.
-  void VmovExtended(int dst_code, int src_code);
-  void VmovExtended(int dst_code, const MemOperand& src);
-  void VmovExtended(const MemOperand& dst, int src_code);
-
-  // Register swap.
-  void Swap(DwVfpRegister srcdst0, DwVfpRegister srcdst1);
-  void Swap(QwNeonRegister srcdst0, QwNeonRegister srcdst1);
-
-  // Get the actual activation frame alignment for target environment.
-  static int ActivationFrameAlignment();
-
-  void Bfc(Register dst, Register src, int lsb, int width, Condition cond = al);
-
-  void SmiUntag(Register reg, SBit s = LeaveCC) {
-    mov(reg, Operand::SmiUntag(reg), s);
-  }
-  void SmiUntag(Register dst, Register src, SBit s = LeaveCC) {
-    mov(dst, Operand::SmiUntag(src), s);
-  }
-
-  // Load an object from the root table.
-  void LoadRoot(Register destination, Heap::RootListIndex index,
-                Condition cond = al);
-
-  // Jump if the register contains a smi.
-  void JumpIfSmi(Register value, Label* smi_label);
-
-  // Performs a truncating conversion of a floating point number as used by
-  // the JS bitwise operations. See ECMA-262 9.5: ToInt32. Goes to 'done' if it
-  // succeeds, otherwise falls through if result is saturated. On return
-  // 'result' either holds answer, or is clobbered on fall through.
-  //
-  // Only public for the test code in test-code-stubs-arm.cc.
-  void TryInlineTruncateDoubleToI(Register result, DwVfpRegister input,
-                                  Label* done);
-
-  // Performs a truncating conversion of a floating point number as used by
-  // the JS bitwise operations. See ECMA-262 9.5: ToInt32.
-  // Exits with 'result' holding the answer.
-  void TruncateDoubleToIDelayed(Zone* zone, Register result,
-                                DwVfpRegister double_input);
-
-  // EABI variant for double arguments in use.
-  bool use_eabi_hardfloat() {
-#ifdef __arm__
-    return base::OS::ArmUsingHardFloat();
-#elif USE_EABI_HARDFLOAT
-    return true;
-#else
-    return false;
-#endif
-  }
-
- private:
-  bool has_frame_ = false;
-  Isolate* const isolate_;
-  // This handle will be patched with the code object on installation.
-  Handle<HeapObject> code_object_;
-
-  // Compare single values and then load the fpscr flags to a register.
-  void VFPCompareAndLoadFlags(const SwVfpRegister src1,
-                              const SwVfpRegister src2,
-                              const Register fpscr_flags,
-                              const Condition cond = al);
-  void VFPCompareAndLoadFlags(const SwVfpRegister src1, const float src2,
-                              const Register fpscr_flags,
-                              const Condition cond = al);
-
-  // Compare double values and then load the fpscr flags to a register.
-  void VFPCompareAndLoadFlags(const DwVfpRegister src1,
-                              const DwVfpRegister src2,
-                              const Register fpscr_flags,
-                              const Condition cond = al);
-  void VFPCompareAndLoadFlags(const DwVfpRegister src1, const double src2,
-                              const Register fpscr_flags,
-                              const Condition cond = al);
-
-  void Jump(intptr_t target, RelocInfo::Mode rmode, Condition cond = al);
-
-  // Implementation helpers for FloatMin and FloatMax.
-  template <typename T>
-  void FloatMaxHelper(T result, T left, T right, Label* out_of_line);
-  template <typename T>
-  void FloatMinHelper(T result, T left, T right, Label* out_of_line);
-  template <typename T>
-  void FloatMaxOutOfLineHelper(T result, T left, T right);
-  template <typename T>
-  void FloatMinOutOfLineHelper(T result, T left, T right);
-
-  int CalculateStackPassedWords(int num_reg_arguments,
-                                int num_double_arguments);
-
-  void CallCFunctionHelper(Register function, int num_reg_arguments,
-                           int num_double_arguments);
-};
-
-// MacroAssembler implements a collection of frequently used macros.
-class MacroAssembler : public TurboAssembler {
- public:
-  MacroAssembler(Isolate* isolate, void* buffer, int size,
-                 CodeObjectRequired create_code_object);
-
-  // Swap two registers.  If the scratch register is omitted then a slightly
-  // less efficient form using xor instead of mov is emitted.
-  void Swap(Register reg1, Register reg2, Register scratch = no_reg,
-            Condition cond = al);
-
-  void Mls(Register dst, Register src1, Register src2, Register srcA,
-           Condition cond = al);
-  void And(Register dst, Register src1, const Operand& src2,
-           Condition cond = al);
-  void Ubfx(Register dst, Register src, int lsb, int width,
-            Condition cond = al);
-  void Sbfx(Register dst, Register src, int lsb, int width,
-            Condition cond = al);
-
-  void Load(Register dst, const MemOperand& src, Representation r);
-  void Store(Register src, const MemOperand& dst, Representation r);
-
-  // ---------------------------------------------------------------------------
-  // GC Support
-
-  // Record in the remembered set the fact that we have a pointer to new space
-  // at the address pointed to by the addr register.  Only works if addr is not
-  // in new space.
-  void RememberedSetHelper(Register object,  // Used for debug code.
-                           Register addr, Register scratch,
-                           SaveFPRegsMode save_fp);
-
-  // Check if object is in new space.  Jumps if the object is not in new space.
-  // The register scratch can be object itself, but scratch will be clobbered.
-  void JumpIfNotInNewSpace(Register object, Register scratch, Label* branch) {
-    InNewSpace(object, scratch, eq, branch);
-  }
-
-  // Check if object is in new space.  Jumps if the object is in new space.
-  // The register scratch can be object itself, but it will be clobbered.
-  void JumpIfInNewSpace(Register object, Register scratch, Label* branch) {
-    InNewSpace(object, scratch, ne, branch);
-  }
-
-  // Check if an object has a given incremental marking color.
-  void HasColor(Register object, Register scratch0, Register scratch1,
-                Label* has_color, int first_bit, int second_bit);
-
-  void JumpIfBlack(Register object, Register scratch0, Register scratch1,
-                   Label* on_black);
-
-  // Checks the color of an object.  If the object is white we jump to the
-  // incremental marker.
-  void JumpIfWhite(Register value, Register scratch1, Register scratch2,
-                   Register scratch3, Label* value_is_white);
-
-  // Notify the garbage collector that we wrote a pointer into an object.
-  // |object| is the object being stored into, |value| is the object being
-  // stored.  value and scratch registers are clobbered by the operation.
-  // The offset is the offset from the start of the object, not the offset from
-  // the tagged HeapObject pointer.  For use with FieldMemOperand(reg, off).
-  void RecordWriteField(
-      Register object, int offset, Register value, Register scratch,
-      LinkRegisterStatus lr_status, SaveFPRegsMode save_fp,
-      RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
-      SmiCheck smi_check = INLINE_SMI_CHECK);
-
-  // For a given |object| notify the garbage collector that the slot |address|
-  // has been written.  |value| is the object being stored. The value and
-  // address registers are clobbered by the operation.
-  void RecordWrite(
-      Register object, Register address, Register value,
-      LinkRegisterStatus lr_status, SaveFPRegsMode save_fp,
-      RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
-      SmiCheck smi_check = INLINE_SMI_CHECK);
-
-  // Push and pop the registers that can hold pointers, as defined by the
-  // RegList constant kSafepointSavedRegisters.
-  void PushSafepointRegisters();
-  void PopSafepointRegisters();
-
-  // Enter exit frame.
-  // stack_space - extra stack space, used for alignment before call to C.
-  void EnterExitFrame(bool save_doubles, int stack_space = 0,
-                      StackFrame::Type frame_type = StackFrame::EXIT);
-
-  // Leave the current exit frame. Expects the return value in r0.
-  // Expect the number of values, pushed prior to the exit frame, to
-  // remove in a register (or no_reg, if there is nothing to remove).
-  void LeaveExitFrame(bool save_doubles, Register argument_count,
-                      bool argument_count_is_length = false);
-
-  // Load the global proxy from the current context.
-  void LoadGlobalProxy(Register dst) {
-    LoadNativeContextSlot(Context::GLOBAL_PROXY_INDEX, dst);
-  }
-
-  void LoadNativeContextSlot(int index, Register dst);
-
-  // ---------------------------------------------------------------------------
-  // JavaScript invokes
-
-  // Invoke the JavaScript function code by either calling or jumping.
-  void InvokeFunctionCode(Register function, Register new_target,
-                          const ParameterCount& expected,
-                          const ParameterCount& actual, InvokeFlag flag);
-
-  // On function call, call into the debugger if necessary.
-  void CheckDebugHook(Register fun, Register new_target,
-                      const ParameterCount& expected,
-                      const ParameterCount& actual);
-
-  // Invoke the JavaScript function in the given register. Changes the
-  // current context to the context in the function before invoking.
-  void InvokeFunction(Register function, Register new_target,
-                      const ParameterCount& actual, InvokeFlag flag);
-
-  void InvokeFunction(Register function, const ParameterCount& expected,
-                      const ParameterCount& actual, InvokeFlag flag);
-
-  void InvokeFunction(Handle<JSFunction> function,
-                      const ParameterCount& expected,
-                      const ParameterCount& actual, InvokeFlag flag);
-
-  // Frame restart support
-  void MaybeDropFrames();
-
-  // Exception handling
-
-  // Push a new stack handler and link into stack handler chain.
-  void PushStackHandler();
-
-  // Unlink the stack handler on top of the stack from the stack handler chain.
-  // Must preserve the result register.
-  void PopStackHandler();
-
-  // ---------------------------------------------------------------------------
-  // Support functions.
-
-  // Compare object type for heap object.  heap_object contains a non-Smi
-  // whose object type should be compared with the given type.  This both
-  // sets the flags and leaves the object type in the type_reg register.
-  // It leaves the map in the map register (unless the type_reg and map register
-  // are the same register).  It leaves the heap object in the heap_object
-  // register unless the heap_object register is the same register as one of the
-  // other registers.
-  // Type_reg can be no_reg. In that case a scratch register is used.
-  void CompareObjectType(Register heap_object,
-                         Register map,
-                         Register type_reg,
-                         InstanceType type);
-
-  // Compare instance type in a map.  map contains a valid map object whose
-  // object type should be compared with the given type.  This both
-  // sets the flags and leaves the object type in the type_reg register.
-  void CompareInstanceType(Register map,
-                           Register type_reg,
-                           InstanceType type);
-
-  // Compare the object in a register to a value from the root list.
-  // Acquires a scratch register.
-  void CompareRoot(Register obj, Heap::RootListIndex index);
-  void PushRoot(Heap::RootListIndex index) {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    LoadRoot(scratch, index);
-    Push(scratch);
-  }
-
-  // Compare the object in a register to a value and jump if they are equal.
-  void JumpIfRoot(Register with, Heap::RootListIndex index, Label* if_equal) {
-    CompareRoot(with, index);
-    b(eq, if_equal);
-  }
-
-  // Compare the object in a register to a value and jump if they are not equal.
-  void JumpIfNotRoot(Register with, Heap::RootListIndex index,
-                     Label* if_not_equal) {
-    CompareRoot(with, index);
-    b(ne, if_not_equal);
-  }
-
-  // Try to convert a double to a signed 32-bit integer.
-  // Z flag set to one and result assigned if the conversion is exact.
-  void TryDoubleToInt32Exact(Register result,
-                             DwVfpRegister double_input,
-                             LowDwVfpRegister double_scratch);
-
-  // ---------------------------------------------------------------------------
-  // Runtime calls
-
-  // Call a code stub.
-  void CallStub(CodeStub* stub,
-                Condition cond = al);
-
-  // Call a code stub.
-  void TailCallStub(CodeStub* stub, Condition cond = al);
-
-  // Call a runtime routine.
-  void CallRuntime(const Runtime::Function* f,
-                   int num_arguments,
-                   SaveFPRegsMode save_doubles = kDontSaveFPRegs);
-
-  // Convenience function: Same as above, but takes the fid instead.
-  void CallRuntime(Runtime::FunctionId fid,
-                   SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
-    const Runtime::Function* function = Runtime::FunctionForId(fid);
-    CallRuntime(function, function->nargs, save_doubles);
-  }
-
-  // Convenience function: Same as above, but takes the fid instead.
-  void CallRuntime(Runtime::FunctionId fid, int num_arguments,
-                   SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
-    CallRuntime(Runtime::FunctionForId(fid), num_arguments, save_doubles);
-  }
-
-  // Convenience function: tail call a runtime routine (jump).
-  void TailCallRuntime(Runtime::FunctionId fid);
-
-  // Jump to a runtime routine.
-  void JumpToExternalReference(const ExternalReference& builtin,
-                               bool builtin_exit_frame = false);
-
-  // ---------------------------------------------------------------------------
-  // StatsCounter support
-
-  void IncrementCounter(StatsCounter* counter, int value,
-                        Register scratch1, Register scratch2);
-  void DecrementCounter(StatsCounter* counter, int value,
-                        Register scratch1, Register scratch2);
-
-  // ---------------------------------------------------------------------------
-  // Smi utilities
-
-  void SmiTag(Register reg, SBit s = LeaveCC);
-  void SmiTag(Register dst, Register src, SBit s = LeaveCC);
-
-  // Untag the source value into destination and jump if source is a smi.
-  // Souce and destination can be the same register.
-  void UntagAndJumpIfSmi(Register dst, Register src, Label* smi_case);
-
-  // Test if the register contains a smi (Z == 0 (eq) if true).
-  void SmiTst(Register value);
-  // Jump if either of the registers contain a non-smi.
-  void JumpIfNotSmi(Register value, Label* not_smi_label);
-  // Jump if either of the registers contain a smi.
-  void JumpIfEitherSmi(Register reg1, Register reg2, Label* on_either_smi);
-
-  // Abort execution if argument is a smi, enabled via --debug-code.
-  void AssertNotSmi(Register object);
-  void AssertSmi(Register object);
-
-  // Abort execution if argument is not a FixedArray, enabled via --debug-code.
-  void AssertFixedArray(Register object);
-
-  // Abort execution if argument is not a JSFunction, enabled via --debug-code.
-  void AssertFunction(Register object);
-
-  // Abort execution if argument is not a JSBoundFunction,
-  // enabled via --debug-code.
-  void AssertBoundFunction(Register object);
-
-  // Abort execution if argument is not a JSGeneratorObject (or subclass),
-  // enabled via --debug-code.
-  void AssertGeneratorObject(Register object);
-
-  // Abort execution if argument is not undefined or an AllocationSite, enabled
-  // via --debug-code.
-  void AssertUndefinedOrAllocationSite(Register object, Register scratch);
-
-  template<typename Field>
-  void DecodeField(Register dst, Register src) {
-    Ubfx(dst, src, Field::kShift, Field::kSize);
-  }
-
-  template<typename Field>
-  void DecodeField(Register reg) {
-    DecodeField<Field>(reg, reg);
-  }
-
- private:
-  // Helper functions for generating invokes.
-  void InvokePrologue(const ParameterCount& expected,
-                      const ParameterCount& actual, Label* done,
-                      bool* definitely_mismatches, InvokeFlag flag);
-
-  // Helper for implementing JumpIfNotInNewSpace and JumpIfInNewSpace.
-  void InNewSpace(Register object,
-                  Register scratch,
-                  Condition cond,  // eq for new space, ne otherwise.
-                  Label* branch);
-
-  // Compute memory operands for safepoint stack slots.
-  static int SafepointRegisterStackIndex(int reg_code);
-
-  // Needs access to SafepointRegisterStackIndex for compiled frame
-  // traversal.
-  friend class StandardFrame;
-};
-
-// -----------------------------------------------------------------------------
-// Static helper functions.
-
-inline MemOperand ContextMemOperand(Register context, int index = 0) {
-  return MemOperand(context, Context::SlotOffset(index));
-}
-
-
-inline MemOperand NativeContextMemOperand() {
-  return ContextMemOperand(cp, Context::NATIVE_CONTEXT_INDEX);
-}
-
-#define ACCESS_MASM(masm) masm->
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_ARM_MACRO_ASSEMBLER_ARM_H_
diff --git a/src/v8/src/arm/simulator-arm.cc b/src/v8/src/arm/simulator-arm.cc
deleted file mode 100644
index 52fe902..0000000
--- a/src/v8/src/arm/simulator-arm.cc
+++ /dev/null
@@ -1,6061 +0,0 @@
-// Copyright 2012 the V8 project 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 <stdarg.h>
-#include <stdlib.h>
-#include <cmath>
-
-#if V8_TARGET_ARCH_ARM
-
-#include "src/arm/constants-arm.h"
-#include "src/arm/simulator-arm.h"
-#include "src/assembler-inl.h"
-#include "src/base/bits.h"
-#include "src/codegen.h"
-#include "src/disasm.h"
-#include "src/macro-assembler.h"
-#include "src/objects-inl.h"
-#include "src/runtime/runtime-utils.h"
-
-#if defined(USE_SIMULATOR)
-
-// Only build the simulator if not compiling for real ARM hardware.
-namespace v8 {
-namespace internal {
-
-// static
-base::LazyInstance<Simulator::GlobalMonitor>::type Simulator::global_monitor_ =
-    LAZY_INSTANCE_INITIALIZER;
-
-// This macro provides a platform independent use of sscanf. The reason for
-// SScanF not being implemented in a platform independent way through
-// ::v8::internal::OS in the same way as SNPrintF is that the
-// Windows C Run-Time Library does not provide vsscanf.
-#define SScanF sscanf  // NOLINT
-
-// The ArmDebugger class is used by the simulator while debugging simulated ARM
-// code.
-class ArmDebugger {
- public:
-  explicit ArmDebugger(Simulator* sim) : sim_(sim) { }
-
-  void Stop(Instruction* instr);
-  void Debug();
-
- private:
-  static const Instr kBreakpointInstr =
-      (al | (7*B25) | (1*B24) | kBreakpoint);
-  static const Instr kNopInstr = (al | (13*B21));
-
-  Simulator* sim_;
-
-  int32_t GetRegisterValue(int regnum);
-  double GetRegisterPairDoubleValue(int regnum);
-  double GetVFPDoubleRegisterValue(int regnum);
-  bool GetValue(const char* desc, int32_t* value);
-  bool GetVFPSingleValue(const char* desc, float* value);
-  bool GetVFPDoubleValue(const char* desc, double* value);
-
-  // Set or delete a breakpoint. Returns true if successful.
-  bool SetBreakpoint(Instruction* breakpc);
-  bool DeleteBreakpoint(Instruction* breakpc);
-
-  // Undo and redo all breakpoints. This is needed to bracket disassembly and
-  // execution to skip past breakpoints when run from the debugger.
-  void UndoBreakpoints();
-  void RedoBreakpoints();
-};
-
-void ArmDebugger::Stop(Instruction* instr) {
-  // Get the stop code.
-  uint32_t code = instr->SvcValue() & kStopCodeMask;
-  // Print the stop message and code if it is not the default code.
-  if (code != kMaxStopCode) {
-    PrintF("Simulator hit stop %u\n", code);
-  } else {
-    PrintF("Simulator hit\n");
-  }
-  Debug();
-}
-
-int32_t ArmDebugger::GetRegisterValue(int regnum) {
-  if (regnum == kPCRegister) {
-    return sim_->get_pc();
-  } else {
-    return sim_->get_register(regnum);
-  }
-}
-
-double ArmDebugger::GetRegisterPairDoubleValue(int regnum) {
-  return sim_->get_double_from_register_pair(regnum);
-}
-
-
-double ArmDebugger::GetVFPDoubleRegisterValue(int regnum) {
-  return sim_->get_double_from_d_register(regnum).get_scalar();
-}
-
-
-bool ArmDebugger::GetValue(const char* desc, int32_t* value) {
-  int regnum = Registers::Number(desc);
-  if (regnum != kNoRegister) {
-    *value = GetRegisterValue(regnum);
-    return true;
-  } else {
-    if (strncmp(desc, "0x", 2) == 0) {
-      return SScanF(desc + 2, "%x", reinterpret_cast<uint32_t*>(value)) == 1;
-    } else {
-      return SScanF(desc, "%u", reinterpret_cast<uint32_t*>(value)) == 1;
-    }
-  }
-  return false;
-}
-
-
-bool ArmDebugger::GetVFPSingleValue(const char* desc, float* value) {
-  bool is_double;
-  int regnum = VFPRegisters::Number(desc, &is_double);
-  if (regnum != kNoRegister && !is_double) {
-    *value = sim_->get_float_from_s_register(regnum).get_scalar();
-    return true;
-  }
-  return false;
-}
-
-
-bool ArmDebugger::GetVFPDoubleValue(const char* desc, double* value) {
-  bool is_double;
-  int regnum = VFPRegisters::Number(desc, &is_double);
-  if (regnum != kNoRegister && is_double) {
-    *value = sim_->get_double_from_d_register(regnum).get_scalar();
-    return true;
-  }
-  return false;
-}
-
-
-bool ArmDebugger::SetBreakpoint(Instruction* breakpc) {
-  // Check if a breakpoint can be set. If not return without any side-effects.
-  if (sim_->break_pc_ != nullptr) {
-    return false;
-  }
-
-  // Set the breakpoint.
-  sim_->break_pc_ = breakpc;
-  sim_->break_instr_ = breakpc->InstructionBits();
-  // Not setting the breakpoint instruction in the code itself. It will be set
-  // when the debugger shell continues.
-  return true;
-}
-
-
-bool ArmDebugger::DeleteBreakpoint(Instruction* breakpc) {
-  if (sim_->break_pc_ != nullptr) {
-    sim_->break_pc_->SetInstructionBits(sim_->break_instr_);
-  }
-
-  sim_->break_pc_ = nullptr;
-  sim_->break_instr_ = 0;
-  return true;
-}
-
-
-void ArmDebugger::UndoBreakpoints() {
-  if (sim_->break_pc_ != nullptr) {
-    sim_->break_pc_->SetInstructionBits(sim_->break_instr_);
-  }
-}
-
-
-void ArmDebugger::RedoBreakpoints() {
-  if (sim_->break_pc_ != nullptr) {
-    sim_->break_pc_->SetInstructionBits(kBreakpointInstr);
-  }
-}
-
-
-void ArmDebugger::Debug() {
-  intptr_t last_pc = -1;
-  bool done = false;
-
-#define COMMAND_SIZE 63
-#define ARG_SIZE 255
-
-#define STR(a) #a
-#define XSTR(a) STR(a)
-
-  char cmd[COMMAND_SIZE + 1];
-  char arg1[ARG_SIZE + 1];
-  char arg2[ARG_SIZE + 1];
-  char* argv[3] = { cmd, arg1, arg2 };
-
-  // make sure to have a proper terminating character if reaching the limit
-  cmd[COMMAND_SIZE] = 0;
-  arg1[ARG_SIZE] = 0;
-  arg2[ARG_SIZE] = 0;
-
-  // Undo all set breakpoints while running in the debugger shell. This will
-  // make them invisible to all commands.
-  UndoBreakpoints();
-
-  while (!done && !sim_->has_bad_pc()) {
-    if (last_pc != sim_->get_pc()) {
-      disasm::NameConverter converter;
-      disasm::Disassembler dasm(converter);
-      // use a reasonably large buffer
-      v8::internal::EmbeddedVector<char, 256> buffer;
-      dasm.InstructionDecode(buffer,
-                             reinterpret_cast<byte*>(sim_->get_pc()));
-      PrintF("  0x%08x  %s\n", sim_->get_pc(), buffer.start());
-      last_pc = sim_->get_pc();
-    }
-    char* line = ReadLine("sim> ");
-    if (line == nullptr) {
-      break;
-    } else {
-      char* last_input = sim_->last_debugger_input();
-      if (strcmp(line, "\n") == 0 && last_input != nullptr) {
-        line = last_input;
-      } else {
-        // Ownership is transferred to sim_;
-        sim_->set_last_debugger_input(line);
-      }
-      // Use sscanf to parse the individual parts of the command line. At the
-      // moment no command expects more than two parameters.
-      int argc = SScanF(line,
-                        "%" XSTR(COMMAND_SIZE) "s "
-                        "%" XSTR(ARG_SIZE) "s "
-                        "%" XSTR(ARG_SIZE) "s",
-                        cmd, arg1, arg2);
-      if ((strcmp(cmd, "si") == 0) || (strcmp(cmd, "stepi") == 0)) {
-        sim_->InstructionDecode(reinterpret_cast<Instruction*>(sim_->get_pc()));
-      } else if ((strcmp(cmd, "c") == 0) || (strcmp(cmd, "cont") == 0)) {
-        // Execute the one instruction we broke at with breakpoints disabled.
-        sim_->InstructionDecode(reinterpret_cast<Instruction*>(sim_->get_pc()));
-        // Leave the debugger shell.
-        done = true;
-      } else if ((strcmp(cmd, "p") == 0) || (strcmp(cmd, "print") == 0)) {
-        if (argc == 2 || (argc == 3 && strcmp(arg2, "fp") == 0)) {
-          int32_t value;
-          float svalue;
-          double dvalue;
-          if (strcmp(arg1, "all") == 0) {
-            for (int i = 0; i < kNumRegisters; i++) {
-              value = GetRegisterValue(i);
-              PrintF(
-                  "%3s: 0x%08x %10d",
-                  RegisterConfiguration::Default()->GetGeneralRegisterName(i),
-                  value, value);
-              if ((argc == 3 && strcmp(arg2, "fp") == 0) &&
-                  i < 8 &&
-                  (i % 2) == 0) {
-                dvalue = GetRegisterPairDoubleValue(i);
-                PrintF(" (%f)\n", dvalue);
-              } else {
-                PrintF("\n");
-              }
-            }
-            for (int i = 0; i < DwVfpRegister::NumRegisters(); i++) {
-              dvalue = GetVFPDoubleRegisterValue(i);
-              uint64_t as_words = bit_cast<uint64_t>(dvalue);
-              PrintF("%3s: %f 0x%08x %08x\n", VFPRegisters::Name(i, true),
-                     dvalue, static_cast<uint32_t>(as_words >> 32),
-                     static_cast<uint32_t>(as_words & 0xFFFFFFFF));
-            }
-          } else {
-            if (GetValue(arg1, &value)) {
-              PrintF("%s: 0x%08x %d \n", arg1, value, value);
-            } else if (GetVFPSingleValue(arg1, &svalue)) {
-              uint32_t as_word = bit_cast<uint32_t>(svalue);
-              PrintF("%s: %f 0x%08x\n", arg1, svalue, as_word);
-            } else if (GetVFPDoubleValue(arg1, &dvalue)) {
-              uint64_t as_words = bit_cast<uint64_t>(dvalue);
-              PrintF("%s: %f 0x%08x %08x\n", arg1, dvalue,
-                     static_cast<uint32_t>(as_words >> 32),
-                     static_cast<uint32_t>(as_words & 0xFFFFFFFF));
-            } else {
-              PrintF("%s unrecognized\n", arg1);
-            }
-          }
-        } else {
-          PrintF("print <register>\n");
-        }
-      } else if ((strcmp(cmd, "po") == 0)
-                 || (strcmp(cmd, "printobject") == 0)) {
-        if (argc == 2) {
-          int32_t value;
-          OFStream os(stdout);
-          if (GetValue(arg1, &value)) {
-            Object* obj = reinterpret_cast<Object*>(value);
-            os << arg1 << ": \n";
-#ifdef DEBUG
-            obj->Print(os);
-            os << "\n";
-#else
-            os << Brief(obj) << "\n";
-#endif
-          } else {
-            os << arg1 << " unrecognized\n";
-          }
-        } else {
-          PrintF("printobject <value>\n");
-        }
-      } else if (strcmp(cmd, "stack") == 0 || strcmp(cmd, "mem") == 0) {
-        int32_t* cur = nullptr;
-        int32_t* end = nullptr;
-        int next_arg = 1;
-
-        if (strcmp(cmd, "stack") == 0) {
-          cur = reinterpret_cast<int32_t*>(sim_->get_register(Simulator::sp));
-        } else {  // "mem"
-          int32_t value;
-          if (!GetValue(arg1, &value)) {
-            PrintF("%s unrecognized\n", arg1);
-            continue;
-          }
-          cur = reinterpret_cast<int32_t*>(value);
-          next_arg++;
-        }
-
-        int32_t words;
-        if (argc == next_arg) {
-          words = 10;
-        } else {
-          if (!GetValue(argv[next_arg], &words)) {
-            words = 10;
-          }
-        }
-        end = cur + words;
-
-        while (cur < end) {
-          PrintF("  0x%08" V8PRIxPTR ":  0x%08x %10d",
-                 reinterpret_cast<intptr_t>(cur), *cur, *cur);
-          HeapObject* obj = reinterpret_cast<HeapObject*>(*cur);
-          int value = *cur;
-          Heap* current_heap = sim_->isolate_->heap();
-          if (((value & 1) == 0) ||
-              current_heap->ContainsSlow(obj->address())) {
-            PrintF(" (");
-            if ((value & 1) == 0) {
-              PrintF("smi %d", value / 2);
-            } else {
-              obj->ShortPrint();
-            }
-            PrintF(")");
-          }
-          PrintF("\n");
-          cur++;
-        }
-      } else if (strcmp(cmd, "disasm") == 0 || strcmp(cmd, "di") == 0) {
-        disasm::NameConverter converter;
-        disasm::Disassembler dasm(converter);
-        // use a reasonably large buffer
-        v8::internal::EmbeddedVector<char, 256> buffer;
-
-        byte* prev = nullptr;
-        byte* cur = nullptr;
-        byte* end = nullptr;
-
-        if (argc == 1) {
-          cur = reinterpret_cast<byte*>(sim_->get_pc());
-          end = cur + (10 * Instruction::kInstrSize);
-        } else if (argc == 2) {
-          int regnum = Registers::Number(arg1);
-          if (regnum != kNoRegister || strncmp(arg1, "0x", 2) == 0) {
-            // The argument is an address or a register name.
-            int32_t value;
-            if (GetValue(arg1, &value)) {
-              cur = reinterpret_cast<byte*>(value);
-              // Disassemble 10 instructions at <arg1>.
-              end = cur + (10 * Instruction::kInstrSize);
-            }
-          } else {
-            // The argument is the number of instructions.
-            int32_t value;
-            if (GetValue(arg1, &value)) {
-              cur = reinterpret_cast<byte*>(sim_->get_pc());
-              // Disassemble <arg1> instructions.
-              end = cur + (value * Instruction::kInstrSize);
-            }
-          }
-        } else {
-          int32_t value1;
-          int32_t value2;
-          if (GetValue(arg1, &value1) && GetValue(arg2, &value2)) {
-            cur = reinterpret_cast<byte*>(value1);
-            end = cur + (value2 * Instruction::kInstrSize);
-          }
-        }
-
-        while (cur < end) {
-          prev = cur;
-          cur += dasm.InstructionDecode(buffer, cur);
-          PrintF("  0x%08" V8PRIxPTR "  %s\n", reinterpret_cast<intptr_t>(prev),
-                 buffer.start());
-        }
-      } else if (strcmp(cmd, "gdb") == 0) {
-        PrintF("relinquishing control to gdb\n");
-        v8::base::OS::DebugBreak();
-        PrintF("regaining control from gdb\n");
-      } else if (strcmp(cmd, "break") == 0) {
-        if (argc == 2) {
-          int32_t value;
-          if (GetValue(arg1, &value)) {
-            if (!SetBreakpoint(reinterpret_cast<Instruction*>(value))) {
-              PrintF("setting breakpoint failed\n");
-            }
-          } else {
-            PrintF("%s unrecognized\n", arg1);
-          }
-        } else {
-          PrintF("break <address>\n");
-        }
-      } else if (strcmp(cmd, "del") == 0) {
-        if (!DeleteBreakpoint(nullptr)) {
-          PrintF("deleting breakpoint failed\n");
-        }
-      } else if (strcmp(cmd, "flags") == 0) {
-        PrintF("N flag: %d; ", sim_->n_flag_);
-        PrintF("Z flag: %d; ", sim_->z_flag_);
-        PrintF("C flag: %d; ", sim_->c_flag_);
-        PrintF("V flag: %d\n", sim_->v_flag_);
-        PrintF("INVALID OP flag: %d; ", sim_->inv_op_vfp_flag_);
-        PrintF("DIV BY ZERO flag: %d; ", sim_->div_zero_vfp_flag_);
-        PrintF("OVERFLOW flag: %d; ", sim_->overflow_vfp_flag_);
-        PrintF("UNDERFLOW flag: %d; ", sim_->underflow_vfp_flag_);
-        PrintF("INEXACT flag: %d;\n", sim_->inexact_vfp_flag_);
-      } else if (strcmp(cmd, "stop") == 0) {
-        int32_t value;
-        intptr_t stop_pc = sim_->get_pc() - Instruction::kInstrSize;
-        Instruction* stop_instr = reinterpret_cast<Instruction*>(stop_pc);
-        if ((argc == 2) && (strcmp(arg1, "unstop") == 0)) {
-          // Remove the current stop.
-          if (sim_->isStopInstruction(stop_instr)) {
-            stop_instr->SetInstructionBits(kNopInstr);
-          } else {
-            PrintF("Not at debugger stop.\n");
-          }
-        } else if (argc == 3) {
-          // Print information about all/the specified breakpoint(s).
-          if (strcmp(arg1, "info") == 0) {
-            if (strcmp(arg2, "all") == 0) {
-              PrintF("Stop information:\n");
-              for (uint32_t i = 0; i < sim_->kNumOfWatchedStops; i++) {
-                sim_->PrintStopInfo(i);
-              }
-            } else if (GetValue(arg2, &value)) {
-              sim_->PrintStopInfo(value);
-            } else {
-              PrintF("Unrecognized argument.\n");
-            }
-          } else if (strcmp(arg1, "enable") == 0) {
-            // Enable all/the specified breakpoint(s).
-            if (strcmp(arg2, "all") == 0) {
-              for (uint32_t i = 0; i < sim_->kNumOfWatchedStops; i++) {
-                sim_->EnableStop(i);
-              }
-            } else if (GetValue(arg2, &value)) {
-              sim_->EnableStop(value);
-            } else {
-              PrintF("Unrecognized argument.\n");
-            }
-          } else if (strcmp(arg1, "disable") == 0) {
-            // Disable all/the specified breakpoint(s).
-            if (strcmp(arg2, "all") == 0) {
-              for (uint32_t i = 0; i < sim_->kNumOfWatchedStops; i++) {
-                sim_->DisableStop(i);
-              }
-            } else if (GetValue(arg2, &value)) {
-              sim_->DisableStop(value);
-            } else {
-              PrintF("Unrecognized argument.\n");
-            }
-          }
-        } else {
-          PrintF("Wrong usage. Use help command for more information.\n");
-        }
-      } else if ((strcmp(cmd, "t") == 0) || strcmp(cmd, "trace") == 0) {
-        ::v8::internal::FLAG_trace_sim = !::v8::internal::FLAG_trace_sim;
-        PrintF("Trace of executed instructions is %s\n",
-               ::v8::internal::FLAG_trace_sim ? "on" : "off");
-      } else if ((strcmp(cmd, "h") == 0) || (strcmp(cmd, "help") == 0)) {
-        PrintF("cont\n");
-        PrintF("  continue execution (alias 'c')\n");
-        PrintF("stepi\n");
-        PrintF("  step one instruction (alias 'si')\n");
-        PrintF("print <register>\n");
-        PrintF("  print register content (alias 'p')\n");
-        PrintF("  use register name 'all' to print all registers\n");
-        PrintF("  add argument 'fp' to print register pair double values\n");
-        PrintF("printobject <register>\n");
-        PrintF("  print an object from a register (alias 'po')\n");
-        PrintF("flags\n");
-        PrintF("  print flags\n");
-        PrintF("stack [<words>]\n");
-        PrintF("  dump stack content, default dump 10 words)\n");
-        PrintF("mem <address> [<words>]\n");
-        PrintF("  dump memory content, default dump 10 words)\n");
-        PrintF("disasm [<instructions>]\n");
-        PrintF("disasm [<address/register>]\n");
-        PrintF("disasm [[<address/register>] <instructions>]\n");
-        PrintF("  disassemble code, default is 10 instructions\n");
-        PrintF("  from pc (alias 'di')\n");
-        PrintF("gdb\n");
-        PrintF("  enter gdb\n");
-        PrintF("break <address>\n");
-        PrintF("  set a break point on the address\n");
-        PrintF("del\n");
-        PrintF("  delete the breakpoint\n");
-        PrintF("trace (alias 't')\n");
-        PrintF("  toogle the tracing of all executed statements\n");
-        PrintF("stop feature:\n");
-        PrintF("  Description:\n");
-        PrintF("    Stops are debug instructions inserted by\n");
-        PrintF("    the Assembler::stop() function.\n");
-        PrintF("    When hitting a stop, the Simulator will\n");
-        PrintF("    stop and and give control to the ArmDebugger.\n");
-        PrintF("    The first %d stop codes are watched:\n",
-               Simulator::kNumOfWatchedStops);
-        PrintF("    - They can be enabled / disabled: the Simulator\n");
-        PrintF("      will / won't stop when hitting them.\n");
-        PrintF("    - The Simulator keeps track of how many times they \n");
-        PrintF("      are met. (See the info command.) Going over a\n");
-        PrintF("      disabled stop still increases its counter. \n");
-        PrintF("  Commands:\n");
-        PrintF("    stop info all/<code> : print infos about number <code>\n");
-        PrintF("      or all stop(s).\n");
-        PrintF("    stop enable/disable all/<code> : enables / disables\n");
-        PrintF("      all or number <code> stop(s)\n");
-        PrintF("    stop unstop\n");
-        PrintF("      ignore the stop instruction at the current location\n");
-        PrintF("      from now on\n");
-      } else {
-        PrintF("Unknown command: %s\n", cmd);
-      }
-    }
-  }
-
-  // Add all the breakpoints back to stop execution and enter the debugger
-  // shell when hit.
-  RedoBreakpoints();
-
-#undef COMMAND_SIZE
-#undef ARG_SIZE
-
-#undef STR
-#undef XSTR
-}
-
-
-static bool ICacheMatch(void* one, void* two) {
-  DCHECK_EQ(reinterpret_cast<intptr_t>(one) & CachePage::kPageMask, 0);
-  DCHECK_EQ(reinterpret_cast<intptr_t>(two) & CachePage::kPageMask, 0);
-  return one == two;
-}
-
-
-static uint32_t ICacheHash(void* key) {
-  return static_cast<uint32_t>(reinterpret_cast<uintptr_t>(key)) >> 2;
-}
-
-
-static bool AllOnOnePage(uintptr_t start, int size) {
-  intptr_t start_page = (start & ~CachePage::kPageMask);
-  intptr_t end_page = ((start + size) & ~CachePage::kPageMask);
-  return start_page == end_page;
-}
-
-void Simulator::set_last_debugger_input(char* input) {
-  DeleteArray(last_debugger_input_);
-  last_debugger_input_ = input;
-}
-
-void Simulator::SetRedirectInstruction(Instruction* instruction) {
-  instruction->SetInstructionBits(al | (0xF * B24) | kCallRtRedirected);
-}
-
-void Simulator::FlushICache(base::CustomMatcherHashMap* i_cache,
-                            void* start_addr, size_t size) {
-  intptr_t start = reinterpret_cast<intptr_t>(start_addr);
-  int intra_line = (start & CachePage::kLineMask);
-  start -= intra_line;
-  size += intra_line;
-  size = ((size - 1) | CachePage::kLineMask) + 1;
-  int offset = (start & CachePage::kPageMask);
-  while (!AllOnOnePage(start, size - 1)) {
-    int bytes_to_flush = CachePage::kPageSize - offset;
-    FlushOnePage(i_cache, start, bytes_to_flush);
-    start += bytes_to_flush;
-    size -= bytes_to_flush;
-    DCHECK_EQ(0, start & CachePage::kPageMask);
-    offset = 0;
-  }
-  if (size != 0) {
-    FlushOnePage(i_cache, start, size);
-  }
-}
-
-CachePage* Simulator::GetCachePage(base::CustomMatcherHashMap* i_cache,
-                                   void* page) {
-  base::HashMap::Entry* entry = i_cache->LookupOrInsert(page, ICacheHash(page));
-  if (entry->value == nullptr) {
-    CachePage* new_page = new CachePage();
-    entry->value = new_page;
-  }
-  return reinterpret_cast<CachePage*>(entry->value);
-}
-
-
-// Flush from start up to and not including start + size.
-void Simulator::FlushOnePage(base::CustomMatcherHashMap* i_cache,
-                             intptr_t start, int size) {
-  DCHECK_LE(size, CachePage::kPageSize);
-  DCHECK(AllOnOnePage(start, size - 1));
-  DCHECK_EQ(start & CachePage::kLineMask, 0);
-  DCHECK_EQ(size & CachePage::kLineMask, 0);
-  void* page = reinterpret_cast<void*>(start & (~CachePage::kPageMask));
-  int offset = (start & CachePage::kPageMask);
-  CachePage* cache_page = GetCachePage(i_cache, page);
-  char* valid_bytemap = cache_page->ValidityByte(offset);
-  memset(valid_bytemap, CachePage::LINE_INVALID, size >> CachePage::kLineShift);
-}
-
-void Simulator::CheckICache(base::CustomMatcherHashMap* i_cache,
-                            Instruction* instr) {
-  intptr_t address = reinterpret_cast<intptr_t>(instr);
-  void* page = reinterpret_cast<void*>(address & (~CachePage::kPageMask));
-  void* line = reinterpret_cast<void*>(address & (~CachePage::kLineMask));
-  int offset = (address & CachePage::kPageMask);
-  CachePage* cache_page = GetCachePage(i_cache, page);
-  char* cache_valid_byte = cache_page->ValidityByte(offset);
-  bool cache_hit = (*cache_valid_byte == CachePage::LINE_VALID);
-  char* cached_line = cache_page->CachedData(offset & ~CachePage::kLineMask);
-  if (cache_hit) {
-    // Check that the data in memory matches the contents of the I-cache.
-    CHECK_EQ(0,
-             memcmp(reinterpret_cast<void*>(instr),
-                    cache_page->CachedData(offset), Instruction::kInstrSize));
-  } else {
-    // Cache miss.  Load memory into the cache.
-    memcpy(cached_line, line, CachePage::kLineLength);
-    *cache_valid_byte = CachePage::LINE_VALID;
-  }
-}
-
-
-Simulator::Simulator(Isolate* isolate) : isolate_(isolate) {
-  i_cache_ = isolate_->simulator_i_cache();
-  if (i_cache_ == nullptr) {
-    i_cache_ = new base::CustomMatcherHashMap(&ICacheMatch);
-    isolate_->set_simulator_i_cache(i_cache_);
-  }
-  // Set up simulator support first. Some of this information is needed to
-  // setup the architecture state.
-  size_t stack_size = 1 * 1024*1024;  // allocate 1MB for stack
-  stack_ = reinterpret_cast<char*>(malloc(stack_size));
-  pc_modified_ = false;
-  icount_ = 0;
-  break_pc_ = nullptr;
-  break_instr_ = 0;
-
-  // Set up architecture state.
-  // All registers are initialized to zero to start with.
-  for (int i = 0; i < num_registers; i++) {
-    registers_[i] = 0;
-  }
-  n_flag_ = false;
-  z_flag_ = false;
-  c_flag_ = false;
-  v_flag_ = false;
-
-  // Initializing VFP registers.
-  // All registers are initialized to zero to start with
-  // even though s_registers_ & d_registers_ share the same
-  // physical registers in the target.
-  for (int i = 0; i < num_d_registers * 2; i++) {
-    vfp_registers_[i] = 0;
-  }
-  n_flag_FPSCR_ = false;
-  z_flag_FPSCR_ = false;
-  c_flag_FPSCR_ = false;
-  v_flag_FPSCR_ = false;
-  FPSCR_rounding_mode_ = RN;
-  FPSCR_default_NaN_mode_ = false;
-
-  inv_op_vfp_flag_ = false;
-  div_zero_vfp_flag_ = false;
-  overflow_vfp_flag_ = false;
-  underflow_vfp_flag_ = false;
-  inexact_vfp_flag_ = false;
-
-  // The sp is initialized to point to the bottom (high address) of the
-  // allocated stack area. To be safe in potential stack underflows we leave
-  // some buffer below.
-  registers_[sp] = reinterpret_cast<int32_t>(stack_) + stack_size - 64;
-  // The lr and pc are initialized to a known bad value that will cause an
-  // access violation if the simulator ever tries to execute it.
-  registers_[pc] = bad_lr;
-  registers_[lr] = bad_lr;
-
-  last_debugger_input_ = nullptr;
-}
-
-Simulator::~Simulator() {
-  global_monitor_.Pointer()->RemoveProcessor(&global_monitor_processor_);
-  free(stack_);
-}
-
-
-// Get the active Simulator for the current thread.
-Simulator* Simulator::current(Isolate* isolate) {
-  v8::internal::Isolate::PerIsolateThreadData* isolate_data =
-      isolate->FindOrAllocatePerThreadDataForThisThread();
-  DCHECK_NOT_NULL(isolate_data);
-
-  Simulator* sim = isolate_data->simulator();
-  if (sim == nullptr) {
-    // TODO(146): delete the simulator object when a thread/isolate goes away.
-    sim = new Simulator(isolate);
-    isolate_data->set_simulator(sim);
-  }
-  return sim;
-}
-
-
-// Sets the register in the architecture state. It will also deal with updating
-// Simulator internal state for special registers such as PC.
-void Simulator::set_register(int reg, int32_t value) {
-  DCHECK((reg >= 0) && (reg < num_registers));
-  if (reg == pc) {
-    pc_modified_ = true;
-  }
-  registers_[reg] = value;
-}
-
-
-// Get the register from the architecture state. This function does handle
-// the special case of accessing the PC register.
-int32_t Simulator::get_register(int reg) const {
-  DCHECK((reg >= 0) && (reg < num_registers));
-  // Stupid code added to avoid bug in GCC.
-  // See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43949
-  if (reg >= num_registers) return 0;
-  // End stupid code.
-  return registers_[reg] + ((reg == pc) ? Instruction::kPCReadOffset : 0);
-}
-
-
-double Simulator::get_double_from_register_pair(int reg) {
-  DCHECK((reg >= 0) && (reg < num_registers) && ((reg % 2) == 0));
-
-  double dm_val = 0.0;
-  // Read the bits from the unsigned integer register_[] array
-  // into the double precision floating point value and return it.
-  char buffer[2 * sizeof(vfp_registers_[0])];
-  memcpy(buffer, &registers_[reg], 2 * sizeof(registers_[0]));
-  memcpy(&dm_val, buffer, 2 * sizeof(registers_[0]));
-  return(dm_val);
-}
-
-
-void Simulator::set_register_pair_from_double(int reg, double* value) {
-  DCHECK((reg >= 0) && (reg < num_registers) && ((reg % 2) == 0));
-  memcpy(registers_ + reg, value, sizeof(*value));
-}
-
-
-void Simulator::set_dw_register(int dreg, const int* dbl) {
-  DCHECK((dreg >= 0) && (dreg < num_d_registers));
-  registers_[dreg] = dbl[0];
-  registers_[dreg + 1] = dbl[1];
-}
-
-
-void Simulator::get_d_register(int dreg, uint64_t* value) {
-  DCHECK((dreg >= 0) && (dreg < DwVfpRegister::NumRegisters()));
-  memcpy(value, vfp_registers_ + dreg * 2, sizeof(*value));
-}
-
-
-void Simulator::set_d_register(int dreg, const uint64_t* value) {
-  DCHECK((dreg >= 0) && (dreg < DwVfpRegister::NumRegisters()));
-  memcpy(vfp_registers_ + dreg * 2, value, sizeof(*value));
-}
-
-
-void Simulator::get_d_register(int dreg, uint32_t* value) {
-  DCHECK((dreg >= 0) && (dreg < DwVfpRegister::NumRegisters()));
-  memcpy(value, vfp_registers_ + dreg * 2, sizeof(*value) * 2);
-}
-
-
-void Simulator::set_d_register(int dreg, const uint32_t* value) {
-  DCHECK((dreg >= 0) && (dreg < DwVfpRegister::NumRegisters()));
-  memcpy(vfp_registers_ + dreg * 2, value, sizeof(*value) * 2);
-}
-
-template <typename T, int SIZE>
-void Simulator::get_neon_register(int reg, T (&value)[SIZE / sizeof(T)]) {
-  DCHECK(SIZE == kSimd128Size || SIZE == kDoubleSize);
-  DCHECK_LE(0, reg);
-  DCHECK_GT(SIZE == kSimd128Size ? num_q_registers : num_d_registers, reg);
-  memcpy(value, vfp_registers_ + reg * (SIZE / 4), SIZE);
-}
-
-template <typename T, int SIZE>
-void Simulator::set_neon_register(int reg, const T (&value)[SIZE / sizeof(T)]) {
-  DCHECK(SIZE == kSimd128Size || SIZE == kDoubleSize);
-  DCHECK_LE(0, reg);
-  DCHECK_GT(SIZE == kSimd128Size ? num_q_registers : num_d_registers, reg);
-  memcpy(vfp_registers_ + reg * (SIZE / 4), value, SIZE);
-}
-
-// Raw access to the PC register.
-void Simulator::set_pc(int32_t value) {
-  pc_modified_ = true;
-  registers_[pc] = value;
-}
-
-
-bool Simulator::has_bad_pc() const {
-  return ((registers_[pc] == bad_lr) || (registers_[pc] == end_sim_pc));
-}
-
-
-// Raw access to the PC register without the special adjustment when reading.
-int32_t Simulator::get_pc() const {
-  return registers_[pc];
-}
-
-
-// Getting from and setting into VFP registers.
-void Simulator::set_s_register(int sreg, unsigned int value) {
-  DCHECK((sreg >= 0) && (sreg < num_s_registers));
-  vfp_registers_[sreg] = value;
-}
-
-
-unsigned int Simulator::get_s_register(int sreg) const {
-  DCHECK((sreg >= 0) && (sreg < num_s_registers));
-  return vfp_registers_[sreg];
-}
-
-
-template<class InputType, int register_size>
-void Simulator::SetVFPRegister(int reg_index, const InputType& value) {
-  unsigned bytes = register_size * sizeof(vfp_registers_[0]);
-  DCHECK_EQ(sizeof(InputType), bytes);
-  DCHECK_GE(reg_index, 0);
-  if (register_size == 1) DCHECK(reg_index < num_s_registers);
-  if (register_size == 2) DCHECK(reg_index < DwVfpRegister::NumRegisters());
-
-  memcpy(&vfp_registers_[reg_index * register_size], &value, bytes);
-}
-
-
-template<class ReturnType, int register_size>
-ReturnType Simulator::GetFromVFPRegister(int reg_index) {
-  unsigned bytes = register_size * sizeof(vfp_registers_[0]);
-  DCHECK_EQ(sizeof(ReturnType), bytes);
-  DCHECK_GE(reg_index, 0);
-  if (register_size == 1) DCHECK(reg_index < num_s_registers);
-  if (register_size == 2) DCHECK(reg_index < DwVfpRegister::NumRegisters());
-
-  ReturnType value;
-  memcpy(&value, &vfp_registers_[register_size * reg_index], bytes);
-  return value;
-}
-
-void Simulator::SetSpecialRegister(SRegisterFieldMask reg_and_mask,
-                                   uint32_t value) {
-  // Only CPSR_f is implemented. Of that, only N, Z, C and V are implemented.
-  if ((reg_and_mask == CPSR_f) && ((value & ~kSpecialCondition) == 0)) {
-    n_flag_ = ((value & (1 << 31)) != 0);
-    z_flag_ = ((value & (1 << 30)) != 0);
-    c_flag_ = ((value & (1 << 29)) != 0);
-    v_flag_ = ((value & (1 << 28)) != 0);
-  } else {
-    UNIMPLEMENTED();
-  }
-}
-
-uint32_t Simulator::GetFromSpecialRegister(SRegister reg) {
-  uint32_t result = 0;
-  // Only CPSR_f is implemented.
-  if (reg == CPSR) {
-    if (n_flag_) result |= (1 << 31);
-    if (z_flag_) result |= (1 << 30);
-    if (c_flag_) result |= (1 << 29);
-    if (v_flag_) result |= (1 << 28);
-  } else {
-    UNIMPLEMENTED();
-  }
-  return result;
-}
-
-// Runtime FP routines take:
-// - two double arguments
-// - one double argument and zero or one integer arguments.
-// All are consructed here from r0-r3 or d0, d1 and r0.
-void Simulator::GetFpArgs(double* x, double* y, int32_t* z) {
-  if (use_eabi_hardfloat()) {
-    *x = get_double_from_d_register(0).get_scalar();
-    *y = get_double_from_d_register(1).get_scalar();
-    *z = get_register(0);
-  } else {
-    // Registers 0 and 1 -> x.
-    *x = get_double_from_register_pair(0);
-    // Register 2 and 3 -> y.
-    *y = get_double_from_register_pair(2);
-    // Register 2 -> z
-    *z = get_register(2);
-  }
-}
-
-
-// The return value is either in r0/r1 or d0.
-void Simulator::SetFpResult(const double& result) {
-  if (use_eabi_hardfloat()) {
-    char buffer[2 * sizeof(vfp_registers_[0])];
-    memcpy(buffer, &result, sizeof(buffer));
-    // Copy result to d0.
-    memcpy(vfp_registers_, buffer, sizeof(buffer));
-  } else {
-    char buffer[2 * sizeof(registers_[0])];
-    memcpy(buffer, &result, sizeof(buffer));
-    // Copy result to r0 and r1.
-    memcpy(registers_, buffer, sizeof(buffer));
-  }
-}
-
-
-void Simulator::TrashCallerSaveRegisters() {
-  // We don't trash the registers with the return value.
-  registers_[2] = 0x50BAD4U;
-  registers_[3] = 0x50BAD4U;
-  registers_[12] = 0x50BAD4U;
-}
-
-
-int Simulator::ReadW(int32_t addr, Instruction* instr) {
-  // All supported ARM targets allow unaligned accesses, so we don't need to
-  // check the alignment here.
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyLoad(addr);
-  intptr_t* ptr = reinterpret_cast<intptr_t*>(addr);
-  return *ptr;
-}
-
-int Simulator::ReadExW(int32_t addr, Instruction* instr) {
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyLoadExcl(addr, TransactionSize::Word);
-  global_monitor_.Pointer()->NotifyLoadExcl_Locked(addr,
-                                                   &global_monitor_processor_);
-  intptr_t* ptr = reinterpret_cast<intptr_t*>(addr);
-  return *ptr;
-}
-
-void Simulator::WriteW(int32_t addr, int value, Instruction* instr) {
-  // All supported ARM targets allow unaligned accesses, so we don't need to
-  // check the alignment here.
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyStore(addr);
-  global_monitor_.Pointer()->NotifyStore_Locked(addr,
-                                                &global_monitor_processor_);
-  intptr_t* ptr = reinterpret_cast<intptr_t*>(addr);
-  *ptr = value;
-}
-
-int Simulator::WriteExW(int32_t addr, int value, Instruction* instr) {
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  if (local_monitor_.NotifyStoreExcl(addr, TransactionSize::Word) &&
-      global_monitor_.Pointer()->NotifyStoreExcl_Locked(
-          addr, &global_monitor_processor_)) {
-    intptr_t* ptr = reinterpret_cast<intptr_t*>(addr);
-    *ptr = value;
-    return 0;
-  } else {
-    return 1;
-  }
-}
-
-uint16_t Simulator::ReadHU(int32_t addr, Instruction* instr) {
-  // All supported ARM targets allow unaligned accesses, so we don't need to
-  // check the alignment here.
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyLoad(addr);
-  uint16_t* ptr = reinterpret_cast<uint16_t*>(addr);
-  return *ptr;
-}
-
-int16_t Simulator::ReadH(int32_t addr, Instruction* instr) {
-  // All supported ARM targets allow unaligned accesses, so we don't need to
-  // check the alignment here.
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyLoad(addr);
-  int16_t* ptr = reinterpret_cast<int16_t*>(addr);
-  return *ptr;
-}
-
-uint16_t Simulator::ReadExHU(int32_t addr, Instruction* instr) {
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyLoadExcl(addr, TransactionSize::HalfWord);
-  global_monitor_.Pointer()->NotifyLoadExcl_Locked(addr,
-                                                   &global_monitor_processor_);
-  uint16_t* ptr = reinterpret_cast<uint16_t*>(addr);
-  return *ptr;
-}
-
-void Simulator::WriteH(int32_t addr, uint16_t value, Instruction* instr) {
-  // All supported ARM targets allow unaligned accesses, so we don't need to
-  // check the alignment here.
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyStore(addr);
-  global_monitor_.Pointer()->NotifyStore_Locked(addr,
-                                                &global_monitor_processor_);
-  uint16_t* ptr = reinterpret_cast<uint16_t*>(addr);
-  *ptr = value;
-}
-
-void Simulator::WriteH(int32_t addr, int16_t value, Instruction* instr) {
-  // All supported ARM targets allow unaligned accesses, so we don't need to
-  // check the alignment here.
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyStore(addr);
-  global_monitor_.Pointer()->NotifyStore_Locked(addr,
-                                                &global_monitor_processor_);
-  int16_t* ptr = reinterpret_cast<int16_t*>(addr);
-  *ptr = value;
-}
-
-int Simulator::WriteExH(int32_t addr, uint16_t value, Instruction* instr) {
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  if (local_monitor_.NotifyStoreExcl(addr, TransactionSize::HalfWord) &&
-      global_monitor_.Pointer()->NotifyStoreExcl_Locked(
-          addr, &global_monitor_processor_)) {
-    uint16_t* ptr = reinterpret_cast<uint16_t*>(addr);
-    *ptr = value;
-    return 0;
-  } else {
-    return 1;
-  }
-}
-
-uint8_t Simulator::ReadBU(int32_t addr) {
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyLoad(addr);
-  uint8_t* ptr = reinterpret_cast<uint8_t*>(addr);
-  return *ptr;
-}
-
-int8_t Simulator::ReadB(int32_t addr) {
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyLoad(addr);
-  int8_t* ptr = reinterpret_cast<int8_t*>(addr);
-  return *ptr;
-}
-
-uint8_t Simulator::ReadExBU(int32_t addr) {
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyLoadExcl(addr, TransactionSize::Byte);
-  global_monitor_.Pointer()->NotifyLoadExcl_Locked(addr,
-                                                   &global_monitor_processor_);
-  uint8_t* ptr = reinterpret_cast<uint8_t*>(addr);
-  return *ptr;
-}
-
-void Simulator::WriteB(int32_t addr, uint8_t value) {
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyStore(addr);
-  global_monitor_.Pointer()->NotifyStore_Locked(addr,
-                                                &global_monitor_processor_);
-  uint8_t* ptr = reinterpret_cast<uint8_t*>(addr);
-  *ptr = value;
-}
-
-void Simulator::WriteB(int32_t addr, int8_t value) {
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyStore(addr);
-  global_monitor_.Pointer()->NotifyStore_Locked(addr,
-                                                &global_monitor_processor_);
-  int8_t* ptr = reinterpret_cast<int8_t*>(addr);
-  *ptr = value;
-}
-
-int Simulator::WriteExB(int32_t addr, uint8_t value) {
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  if (local_monitor_.NotifyStoreExcl(addr, TransactionSize::Byte) &&
-      global_monitor_.Pointer()->NotifyStoreExcl_Locked(
-          addr, &global_monitor_processor_)) {
-    uint8_t* ptr = reinterpret_cast<uint8_t*>(addr);
-    *ptr = value;
-    return 0;
-  } else {
-    return 1;
-  }
-}
-
-int32_t* Simulator::ReadDW(int32_t addr) {
-  // All supported ARM targets allow unaligned accesses, so we don't need to
-  // check the alignment here.
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyLoad(addr);
-  int32_t* ptr = reinterpret_cast<int32_t*>(addr);
-  return ptr;
-}
-
-
-void Simulator::WriteDW(int32_t addr, int32_t value1, int32_t value2) {
-  // All supported ARM targets allow unaligned accesses, so we don't need to
-  // check the alignment here.
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyStore(addr);
-  global_monitor_.Pointer()->NotifyStore_Locked(addr,
-                                                &global_monitor_processor_);
-  int32_t* ptr = reinterpret_cast<int32_t*>(addr);
-  *ptr++ = value1;
-  *ptr = value2;
-}
-
-
-// Returns the limit of the stack area to enable checking for stack overflows.
-uintptr_t Simulator::StackLimit(uintptr_t c_limit) const {
-  // The simulator uses a separate JS stack. If we have exhausted the C stack,
-  // we also drop down the JS limit to reflect the exhaustion on the JS stack.
-  if (GetCurrentStackPosition() < c_limit) {
-    return reinterpret_cast<uintptr_t>(get_sp());
-  }
-
-  // Otherwise the limit is the JS stack. Leave a safety margin of 1024 bytes
-  // to prevent overrunning the stack when pushing values.
-  return reinterpret_cast<uintptr_t>(stack_) + 1024;
-}
-
-
-// Unsupported instructions use Format to print an error and stop execution.
-void Simulator::Format(Instruction* instr, const char* format) {
-  PrintF("Simulator found unsupported instruction:\n 0x%08" V8PRIxPTR ": %s\n",
-         reinterpret_cast<intptr_t>(instr), format);
-  UNIMPLEMENTED();
-}
-
-
-// Checks if the current instruction should be executed based on its
-// condition bits.
-bool Simulator::ConditionallyExecute(Instruction* instr) {
-  switch (instr->ConditionField()) {
-    case eq: return z_flag_;
-    case ne: return !z_flag_;
-    case cs: return c_flag_;
-    case cc: return !c_flag_;
-    case mi: return n_flag_;
-    case pl: return !n_flag_;
-    case vs: return v_flag_;
-    case vc: return !v_flag_;
-    case hi: return c_flag_ && !z_flag_;
-    case ls: return !c_flag_ || z_flag_;
-    case ge: return n_flag_ == v_flag_;
-    case lt: return n_flag_ != v_flag_;
-    case gt: return !z_flag_ && (n_flag_ == v_flag_);
-    case le: return z_flag_ || (n_flag_ != v_flag_);
-    case al: return true;
-    default: UNREACHABLE();
-  }
-  return false;
-}
-
-
-// Calculate and set the Negative and Zero flags.
-void Simulator::SetNZFlags(int32_t val) {
-  n_flag_ = (val < 0);
-  z_flag_ = (val == 0);
-}
-
-
-// Set the Carry flag.
-void Simulator::SetCFlag(bool val) {
-  c_flag_ = val;
-}
-
-
-// Set the oVerflow flag.
-void Simulator::SetVFlag(bool val) {
-  v_flag_ = val;
-}
-
-
-// Calculate C flag value for additions.
-bool Simulator::CarryFrom(int32_t left, int32_t right, int32_t carry) {
-  uint32_t uleft = static_cast<uint32_t>(left);
-  uint32_t uright = static_cast<uint32_t>(right);
-  uint32_t urest = 0xFFFFFFFFU - uleft;
-
-  return (uright > urest) ||
-         (carry && (((uright + 1) > urest) || (uright > (urest - 1))));
-}
-
-
-// Calculate C flag value for subtractions.
-bool Simulator::BorrowFrom(int32_t left, int32_t right, int32_t carry) {
-  uint32_t uleft = static_cast<uint32_t>(left);
-  uint32_t uright = static_cast<uint32_t>(right);
-
-  return (uright > uleft) ||
-         (!carry && (((uright + 1) > uleft) || (uright > (uleft - 1))));
-}
-
-
-// Calculate V flag value for additions and subtractions.
-bool Simulator::OverflowFrom(int32_t alu_out,
-                             int32_t left, int32_t right, bool addition) {
-  bool overflow;
-  if (addition) {
-               // operands have the same sign
-    overflow = ((left >= 0 && right >= 0) || (left < 0 && right < 0))
-               // and operands and result have different sign
-               && ((left < 0 && alu_out >= 0) || (left >= 0 && alu_out < 0));
-  } else {
-               // operands have different signs
-    overflow = ((left < 0 && right >= 0) || (left >= 0 && right < 0))
-               // and first operand and result have different signs
-               && ((left < 0 && alu_out >= 0) || (left >= 0 && alu_out < 0));
-  }
-  return overflow;
-}
-
-
-// Support for VFP comparisons.
-void Simulator::Compute_FPSCR_Flags(float val1, float val2) {
-  if (std::isnan(val1) || std::isnan(val2)) {
-    n_flag_FPSCR_ = false;
-    z_flag_FPSCR_ = false;
-    c_flag_FPSCR_ = true;
-    v_flag_FPSCR_ = true;
-    // All non-NaN cases.
-  } else if (val1 == val2) {
-    n_flag_FPSCR_ = false;
-    z_flag_FPSCR_ = true;
-    c_flag_FPSCR_ = true;
-    v_flag_FPSCR_ = false;
-  } else if (val1 < val2) {
-    n_flag_FPSCR_ = true;
-    z_flag_FPSCR_ = false;
-    c_flag_FPSCR_ = false;
-    v_flag_FPSCR_ = false;
-  } else {
-    // Case when (val1 > val2).
-    n_flag_FPSCR_ = false;
-    z_flag_FPSCR_ = false;
-    c_flag_FPSCR_ = true;
-    v_flag_FPSCR_ = false;
-  }
-}
-
-
-void Simulator::Compute_FPSCR_Flags(double val1, double val2) {
-  if (std::isnan(val1) || std::isnan(val2)) {
-    n_flag_FPSCR_ = false;
-    z_flag_FPSCR_ = false;
-    c_flag_FPSCR_ = true;
-    v_flag_FPSCR_ = true;
-  // All non-NaN cases.
-  } else if (val1 == val2) {
-    n_flag_FPSCR_ = false;
-    z_flag_FPSCR_ = true;
-    c_flag_FPSCR_ = true;
-    v_flag_FPSCR_ = false;
-  } else if (val1 < val2) {
-    n_flag_FPSCR_ = true;
-    z_flag_FPSCR_ = false;
-    c_flag_FPSCR_ = false;
-    v_flag_FPSCR_ = false;
-  } else {
-    // Case when (val1 > val2).
-    n_flag_FPSCR_ = false;
-    z_flag_FPSCR_ = false;
-    c_flag_FPSCR_ = true;
-    v_flag_FPSCR_ = false;
-  }
-}
-
-
-void Simulator::Copy_FPSCR_to_APSR() {
-  n_flag_ = n_flag_FPSCR_;
-  z_flag_ = z_flag_FPSCR_;
-  c_flag_ = c_flag_FPSCR_;
-  v_flag_ = v_flag_FPSCR_;
-}
-
-
-// Addressing Mode 1 - Data-processing operands:
-// Get the value based on the shifter_operand with register.
-int32_t Simulator::GetShiftRm(Instruction* instr, bool* carry_out) {
-  ShiftOp shift = instr->ShiftField();
-  int shift_amount = instr->ShiftAmountValue();
-  int32_t result = get_register(instr->RmValue());
-  if (instr->Bit(4) == 0) {
-    // by immediate
-    if ((shift == ROR) && (shift_amount == 0)) {
-      UNIMPLEMENTED();
-      return result;
-    } else if (((shift == LSR) || (shift == ASR)) && (shift_amount == 0)) {
-      shift_amount = 32;
-    }
-    switch (shift) {
-      case ASR: {
-        if (shift_amount == 0) {
-          if (result < 0) {
-            result = 0xFFFFFFFF;
-            *carry_out = true;
-          } else {
-            result = 0;
-            *carry_out = false;
-          }
-        } else {
-          result >>= (shift_amount - 1);
-          *carry_out = (result & 1) == 1;
-          result >>= 1;
-        }
-        break;
-      }
-
-      case LSL: {
-        if (shift_amount == 0) {
-          *carry_out = c_flag_;
-        } else {
-          result <<= (shift_amount - 1);
-          *carry_out = (result < 0);
-          result <<= 1;
-        }
-        break;
-      }
-
-      case LSR: {
-        if (shift_amount == 0) {
-          result = 0;
-          *carry_out = c_flag_;
-        } else {
-          uint32_t uresult = static_cast<uint32_t>(result);
-          uresult >>= (shift_amount - 1);
-          *carry_out = (uresult & 1) == 1;
-          uresult >>= 1;
-          result = static_cast<int32_t>(uresult);
-        }
-        break;
-      }
-
-      case ROR: {
-        if (shift_amount == 0) {
-          *carry_out = c_flag_;
-        } else {
-          uint32_t left = static_cast<uint32_t>(result) >> shift_amount;
-          uint32_t right = static_cast<uint32_t>(result) << (32 - shift_amount);
-          result = right | left;
-          *carry_out = (static_cast<uint32_t>(result) >> 31) != 0;
-        }
-        break;
-      }
-
-      default: {
-        UNREACHABLE();
-        break;
-      }
-    }
-  } else {
-    // by register
-    int rs = instr->RsValue();
-    shift_amount = get_register(rs) & 0xFF;
-    switch (shift) {
-      case ASR: {
-        if (shift_amount == 0) {
-          *carry_out = c_flag_;
-        } else if (shift_amount < 32) {
-          result >>= (shift_amount - 1);
-          *carry_out = (result & 1) == 1;
-          result >>= 1;
-        } else {
-          DCHECK_GE(shift_amount, 32);
-          if (result < 0) {
-            *carry_out = true;
-            result = 0xFFFFFFFF;
-          } else {
-            *carry_out = false;
-            result = 0;
-          }
-        }
-        break;
-      }
-
-      case LSL: {
-        if (shift_amount == 0) {
-          *carry_out = c_flag_;
-        } else if (shift_amount < 32) {
-          result <<= (shift_amount - 1);
-          *carry_out = (result < 0);
-          result <<= 1;
-        } else if (shift_amount == 32) {
-          *carry_out = (result & 1) == 1;
-          result = 0;
-        } else {
-          DCHECK_GT(shift_amount, 32);
-          *carry_out = false;
-          result = 0;
-        }
-        break;
-      }
-
-      case LSR: {
-        if (shift_amount == 0) {
-          *carry_out = c_flag_;
-        } else if (shift_amount < 32) {
-          uint32_t uresult = static_cast<uint32_t>(result);
-          uresult >>= (shift_amount - 1);
-          *carry_out = (uresult & 1) == 1;
-          uresult >>= 1;
-          result = static_cast<int32_t>(uresult);
-        } else if (shift_amount == 32) {
-          *carry_out = (result < 0);
-          result = 0;
-        } else {
-          *carry_out = false;
-          result = 0;
-        }
-        break;
-      }
-
-      case ROR: {
-        if (shift_amount == 0) {
-          *carry_out = c_flag_;
-        } else {
-          uint32_t left = static_cast<uint32_t>(result) >> shift_amount;
-          uint32_t right = static_cast<uint32_t>(result) << (32 - shift_amount);
-          result = right | left;
-          *carry_out = (static_cast<uint32_t>(result) >> 31) != 0;
-        }
-        break;
-      }
-
-      default: {
-        UNREACHABLE();
-        break;
-      }
-    }
-  }
-  return result;
-}
-
-
-// Addressing Mode 1 - Data-processing operands:
-// Get the value based on the shifter_operand with immediate.
-int32_t Simulator::GetImm(Instruction* instr, bool* carry_out) {
-  int rotate = instr->RotateValue() * 2;
-  int immed8 = instr->Immed8Value();
-  int imm = base::bits::RotateRight32(immed8, rotate);
-  *carry_out = (rotate == 0) ? c_flag_ : (imm < 0);
-  return imm;
-}
-
-
-static int count_bits(int bit_vector) {
-  int count = 0;
-  while (bit_vector != 0) {
-    if ((bit_vector & 1) != 0) {
-      count++;
-    }
-    bit_vector >>= 1;
-  }
-  return count;
-}
-
-
-int32_t Simulator::ProcessPU(Instruction* instr,
-                             int num_regs,
-                             int reg_size,
-                             intptr_t* start_address,
-                             intptr_t* end_address) {
-  int rn = instr->RnValue();
-  int32_t rn_val = get_register(rn);
-  switch (instr->PUField()) {
-    case da_x: {
-      UNIMPLEMENTED();
-      break;
-    }
-    case ia_x: {
-      *start_address = rn_val;
-      *end_address = rn_val + (num_regs * reg_size) - reg_size;
-      rn_val = rn_val + (num_regs * reg_size);
-      break;
-    }
-    case db_x: {
-      *start_address = rn_val - (num_regs * reg_size);
-      *end_address = rn_val - reg_size;
-      rn_val = *start_address;
-      break;
-    }
-    case ib_x: {
-      *start_address = rn_val + reg_size;
-      *end_address = rn_val + (num_regs * reg_size);
-      rn_val = *end_address;
-      break;
-    }
-    default: {
-      UNREACHABLE();
-      break;
-    }
-  }
-  return rn_val;
-}
-
-
-// Addressing Mode 4 - Load and Store Multiple
-void Simulator::HandleRList(Instruction* instr, bool load) {
-  int rlist = instr->RlistValue();
-  int num_regs = count_bits(rlist);
-
-  intptr_t start_address = 0;
-  intptr_t end_address = 0;
-  int32_t rn_val =
-      ProcessPU(instr, num_regs, kPointerSize, &start_address, &end_address);
-
-  intptr_t* address = reinterpret_cast<intptr_t*>(start_address);
-  // Catch null pointers a little earlier.
-  DCHECK(start_address > 8191 || start_address < 0);
-  int reg = 0;
-  while (rlist != 0) {
-    if ((rlist & 1) != 0) {
-      if (load) {
-        set_register(reg, *address);
-      } else {
-        *address = get_register(reg);
-      }
-      address += 1;
-    }
-    reg++;
-    rlist >>= 1;
-  }
-  DCHECK(end_address == ((intptr_t)address) - 4);
-  if (instr->HasW()) {
-    set_register(instr->RnValue(), rn_val);
-  }
-}
-
-
-// Addressing Mode 6 - Load and Store Multiple Coprocessor registers.
-void Simulator::HandleVList(Instruction* instr) {
-  VFPRegPrecision precision =
-      (instr->SzValue() == 0) ? kSinglePrecision : kDoublePrecision;
-  int operand_size = (precision == kSinglePrecision) ? 4 : 8;
-
-  bool load = (instr->VLValue() == 0x1);
-
-  int vd;
-  int num_regs;
-  vd = instr->VFPDRegValue(precision);
-  if (precision == kSinglePrecision) {
-    num_regs = instr->Immed8Value();
-  } else {
-    num_regs = instr->Immed8Value() / 2;
-  }
-
-  intptr_t start_address = 0;
-  intptr_t end_address = 0;
-  int32_t rn_val =
-      ProcessPU(instr, num_regs, operand_size, &start_address, &end_address);
-
-  intptr_t* address = reinterpret_cast<intptr_t*>(start_address);
-  for (int reg = vd; reg < vd + num_regs; reg++) {
-    if (precision == kSinglePrecision) {
-      if (load) {
-        set_s_register_from_sinteger(
-            reg, ReadW(reinterpret_cast<int32_t>(address), instr));
-      } else {
-        WriteW(reinterpret_cast<int32_t>(address),
-               get_sinteger_from_s_register(reg), instr);
-      }
-      address += 1;
-    } else {
-      if (load) {
-        int32_t data[] = {
-          ReadW(reinterpret_cast<int32_t>(address), instr),
-          ReadW(reinterpret_cast<int32_t>(address + 1), instr)
-        };
-        set_d_register(reg, reinterpret_cast<uint32_t*>(data));
-      } else {
-        uint32_t data[2];
-        get_d_register(reg, data);
-        WriteW(reinterpret_cast<int32_t>(address), data[0], instr);
-        WriteW(reinterpret_cast<int32_t>(address + 1), data[1], instr);
-      }
-      address += 2;
-    }
-  }
-  DCHECK(reinterpret_cast<intptr_t>(address) - operand_size == end_address);
-  if (instr->HasW()) {
-    set_register(instr->RnValue(), rn_val);
-  }
-}
-
-
-// Calls into the V8 runtime are based on this very simple interface.
-// Note: To be able to return two values from some calls the code in runtime.cc
-// uses the ObjectPair which is essentially two 32-bit values stuffed into a
-// 64-bit value. With the code below we assume that all runtime calls return
-// 64 bits of result. If they don't, the r1 result register contains a bogus
-// value, which is fine because it is caller-saved.
-typedef int64_t (*SimulatorRuntimeCall)(int32_t arg0, int32_t arg1,
-                                        int32_t arg2, int32_t arg3,
-                                        int32_t arg4, int32_t arg5,
-                                        int32_t arg6, int32_t arg7,
-                                        int32_t arg8);
-
-// These prototypes handle the four types of FP calls.
-typedef int64_t (*SimulatorRuntimeCompareCall)(double darg0, double darg1);
-typedef double (*SimulatorRuntimeFPFPCall)(double darg0, double darg1);
-typedef double (*SimulatorRuntimeFPCall)(double darg0);
-typedef double (*SimulatorRuntimeFPIntCall)(double darg0, int32_t arg0);
-
-// This signature supports direct call in to API function native callback
-// (refer to InvocationCallback in v8.h).
-typedef void (*SimulatorRuntimeDirectApiCall)(int32_t arg0);
-typedef void (*SimulatorRuntimeProfilingApiCall)(int32_t arg0, void* arg1);
-
-// This signature supports direct call to accessor getter callback.
-typedef void (*SimulatorRuntimeDirectGetterCall)(int32_t arg0, int32_t arg1);
-typedef void (*SimulatorRuntimeProfilingGetterCall)(
-    int32_t arg0, int32_t arg1, void* arg2);
-
-// Software interrupt instructions are used by the simulator to call into the
-// C-based V8 runtime.
-void Simulator::SoftwareInterrupt(Instruction* instr) {
-  int svc = instr->SvcValue();
-  switch (svc) {
-    case kCallRtRedirected: {
-      // Check if stack is aligned. Error if not aligned is reported below to
-      // include information on the function called.
-      bool stack_aligned =
-          (get_register(sp)
-           & (::v8::internal::FLAG_sim_stack_alignment - 1)) == 0;
-      Redirection* redirection = Redirection::FromInstruction(instr);
-      int32_t arg0 = get_register(r0);
-      int32_t arg1 = get_register(r1);
-      int32_t arg2 = get_register(r2);
-      int32_t arg3 = get_register(r3);
-      int32_t* stack_pointer = reinterpret_cast<int32_t*>(get_register(sp));
-      int32_t arg4 = stack_pointer[0];
-      int32_t arg5 = stack_pointer[1];
-      int32_t arg6 = stack_pointer[2];
-      int32_t arg7 = stack_pointer[3];
-      int32_t arg8 = stack_pointer[4];
-      STATIC_ASSERT(kMaxCParameters == 9);
-
-      bool fp_call =
-         (redirection->type() == ExternalReference::BUILTIN_FP_FP_CALL) ||
-         (redirection->type() == ExternalReference::BUILTIN_COMPARE_CALL) ||
-         (redirection->type() == ExternalReference::BUILTIN_FP_CALL) ||
-         (redirection->type() == ExternalReference::BUILTIN_FP_INT_CALL);
-      // This is dodgy but it works because the C entry stubs are never moved.
-      // See comment in codegen-arm.cc and bug 1242173.
-      int32_t saved_lr = get_register(lr);
-      intptr_t external =
-          reinterpret_cast<intptr_t>(redirection->external_function());
-      if (fp_call) {
-        double dval0, dval1;  // one or two double parameters
-        int32_t ival;         // zero or one integer parameters
-        int64_t iresult = 0;  // integer return value
-        double dresult = 0;   // double return value
-        GetFpArgs(&dval0, &dval1, &ival);
-        if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
-          SimulatorRuntimeCall generic_target =
-            reinterpret_cast<SimulatorRuntimeCall>(external);
-          switch (redirection->type()) {
-          case ExternalReference::BUILTIN_FP_FP_CALL:
-          case ExternalReference::BUILTIN_COMPARE_CALL:
-            PrintF("Call to host function at %p with args %f, %f",
-                   static_cast<void*>(FUNCTION_ADDR(generic_target)), dval0,
-                   dval1);
-            break;
-          case ExternalReference::BUILTIN_FP_CALL:
-            PrintF("Call to host function at %p with arg %f",
-                   static_cast<void*>(FUNCTION_ADDR(generic_target)), dval0);
-            break;
-          case ExternalReference::BUILTIN_FP_INT_CALL:
-            PrintF("Call to host function at %p with args %f, %d",
-                   static_cast<void*>(FUNCTION_ADDR(generic_target)), dval0,
-                   ival);
-            break;
-          default:
-            UNREACHABLE();
-            break;
-          }
-          if (!stack_aligned) {
-            PrintF(" with unaligned stack %08x\n", get_register(sp));
-          }
-          PrintF("\n");
-        }
-        CHECK(stack_aligned);
-        switch (redirection->type()) {
-        case ExternalReference::BUILTIN_COMPARE_CALL: {
-          SimulatorRuntimeCompareCall target =
-            reinterpret_cast<SimulatorRuntimeCompareCall>(external);
-          iresult = target(dval0, dval1);
-          set_register(r0, static_cast<int32_t>(iresult));
-          set_register(r1, static_cast<int32_t>(iresult >> 32));
-          break;
-        }
-        case ExternalReference::BUILTIN_FP_FP_CALL: {
-          SimulatorRuntimeFPFPCall target =
-            reinterpret_cast<SimulatorRuntimeFPFPCall>(external);
-          dresult = target(dval0, dval1);
-          SetFpResult(dresult);
-          break;
-        }
-        case ExternalReference::BUILTIN_FP_CALL: {
-          SimulatorRuntimeFPCall target =
-            reinterpret_cast<SimulatorRuntimeFPCall>(external);
-          dresult = target(dval0);
-          SetFpResult(dresult);
-          break;
-        }
-        case ExternalReference::BUILTIN_FP_INT_CALL: {
-          SimulatorRuntimeFPIntCall target =
-            reinterpret_cast<SimulatorRuntimeFPIntCall>(external);
-          dresult = target(dval0, ival);
-          SetFpResult(dresult);
-          break;
-        }
-        default:
-          UNREACHABLE();
-          break;
-        }
-        if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
-          switch (redirection->type()) {
-          case ExternalReference::BUILTIN_COMPARE_CALL:
-            PrintF("Returned %08x\n", static_cast<int32_t>(iresult));
-            break;
-          case ExternalReference::BUILTIN_FP_FP_CALL:
-          case ExternalReference::BUILTIN_FP_CALL:
-          case ExternalReference::BUILTIN_FP_INT_CALL:
-            PrintF("Returned %f\n", dresult);
-            break;
-          default:
-            UNREACHABLE();
-            break;
-          }
-        }
-      } else if (redirection->type() == ExternalReference::DIRECT_API_CALL) {
-        if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
-          PrintF("Call to host function at %p args %08x",
-              reinterpret_cast<void*>(external), arg0);
-          if (!stack_aligned) {
-            PrintF(" with unaligned stack %08x\n", get_register(sp));
-          }
-          PrintF("\n");
-        }
-        CHECK(stack_aligned);
-        SimulatorRuntimeDirectApiCall target =
-            reinterpret_cast<SimulatorRuntimeDirectApiCall>(external);
-        target(arg0);
-      } else if (
-          redirection->type() == ExternalReference::PROFILING_API_CALL) {
-        if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
-          PrintF("Call to host function at %p args %08x %08x",
-              reinterpret_cast<void*>(external), arg0, arg1);
-          if (!stack_aligned) {
-            PrintF(" with unaligned stack %08x\n", get_register(sp));
-          }
-          PrintF("\n");
-        }
-        CHECK(stack_aligned);
-        SimulatorRuntimeProfilingApiCall target =
-            reinterpret_cast<SimulatorRuntimeProfilingApiCall>(external);
-        target(arg0, Redirection::ReverseRedirection(arg1));
-      } else if (
-          redirection->type() == ExternalReference::DIRECT_GETTER_CALL) {
-        if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
-          PrintF("Call to host function at %p args %08x %08x",
-              reinterpret_cast<void*>(external), arg0, arg1);
-          if (!stack_aligned) {
-            PrintF(" with unaligned stack %08x\n", get_register(sp));
-          }
-          PrintF("\n");
-        }
-        CHECK(stack_aligned);
-        SimulatorRuntimeDirectGetterCall target =
-            reinterpret_cast<SimulatorRuntimeDirectGetterCall>(external);
-        target(arg0, arg1);
-      } else if (
-          redirection->type() == ExternalReference::PROFILING_GETTER_CALL) {
-        if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
-          PrintF("Call to host function at %p args %08x %08x %08x",
-              reinterpret_cast<void*>(external), arg0, arg1, arg2);
-          if (!stack_aligned) {
-            PrintF(" with unaligned stack %08x\n", get_register(sp));
-          }
-          PrintF("\n");
-        }
-        CHECK(stack_aligned);
-        SimulatorRuntimeProfilingGetterCall target =
-            reinterpret_cast<SimulatorRuntimeProfilingGetterCall>(
-                external);
-        target(arg0, arg1, Redirection::ReverseRedirection(arg2));
-      } else {
-        // builtin call.
-        DCHECK(redirection->type() == ExternalReference::BUILTIN_CALL ||
-               redirection->type() == ExternalReference::BUILTIN_CALL_PAIR);
-        SimulatorRuntimeCall target =
-            reinterpret_cast<SimulatorRuntimeCall>(external);
-        if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
-          PrintF(
-              "Call to host function at %p "
-              "args %08x, %08x, %08x, %08x, %08x, %08x, %08x, %08x, %08x",
-              static_cast<void*>(FUNCTION_ADDR(target)), arg0, arg1, arg2, arg3,
-              arg4, arg5, arg6, arg7, arg8);
-          if (!stack_aligned) {
-            PrintF(" with unaligned stack %08x\n", get_register(sp));
-          }
-          PrintF("\n");
-        }
-        CHECK(stack_aligned);
-        int64_t result =
-            target(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
-        int32_t lo_res = static_cast<int32_t>(result);
-        int32_t hi_res = static_cast<int32_t>(result >> 32);
-        if (::v8::internal::FLAG_trace_sim) {
-          PrintF("Returned %08x\n", lo_res);
-        }
-        set_register(r0, lo_res);
-        set_register(r1, hi_res);
-      }
-      set_register(lr, saved_lr);
-      set_pc(get_register(lr));
-      break;
-    }
-    case kBreakpoint: {
-      ArmDebugger dbg(this);
-      dbg.Debug();
-      break;
-    }
-    // stop uses all codes greater than 1 << 23.
-    default: {
-      if (svc >= (1 << 23)) {
-        uint32_t code = svc & kStopCodeMask;
-        if (isWatchedStop(code)) {
-          IncreaseStopCounter(code);
-        }
-        // Stop if it is enabled, otherwise go on jumping over the stop
-        // and the message address.
-        if (isEnabledStop(code)) {
-          ArmDebugger dbg(this);
-          dbg.Stop(instr);
-        }
-      } else {
-        // This is not a valid svc code.
-        UNREACHABLE();
-        break;
-      }
-    }
-  }
-}
-
-
-float Simulator::canonicalizeNaN(float value) {
-  // Default NaN value, see "NaN handling" in "IEEE 754 standard implementation
-  // choices" of the ARM Reference Manual.
-  constexpr uint32_t kDefaultNaN = 0x7FC00000u;
-  if (FPSCR_default_NaN_mode_ && std::isnan(value)) {
-    value = bit_cast<float>(kDefaultNaN);
-  }
-  return value;
-}
-
-Float32 Simulator::canonicalizeNaN(Float32 value) {
-  // Default NaN value, see "NaN handling" in "IEEE 754 standard implementation
-  // choices" of the ARM Reference Manual.
-  constexpr Float32 kDefaultNaN = Float32::FromBits(0x7FC00000u);
-  return FPSCR_default_NaN_mode_ && value.is_nan() ? kDefaultNaN : value;
-}
-
-double Simulator::canonicalizeNaN(double value) {
-  // Default NaN value, see "NaN handling" in "IEEE 754 standard implementation
-  // choices" of the ARM Reference Manual.
-  constexpr uint64_t kDefaultNaN = uint64_t{0x7FF8000000000000};
-  if (FPSCR_default_NaN_mode_ && std::isnan(value)) {
-    value = bit_cast<double>(kDefaultNaN);
-  }
-  return value;
-}
-
-Float64 Simulator::canonicalizeNaN(Float64 value) {
-  // Default NaN value, see "NaN handling" in "IEEE 754 standard implementation
-  // choices" of the ARM Reference Manual.
-  constexpr Float64 kDefaultNaN =
-      Float64::FromBits(uint64_t{0x7FF8000000000000});
-  return FPSCR_default_NaN_mode_ && value.is_nan() ? kDefaultNaN : value;
-}
-
-// Stop helper functions.
-bool Simulator::isStopInstruction(Instruction* instr) {
-  return (instr->Bits(27, 24) == 0xF) && (instr->SvcValue() >= kStopCode);
-}
-
-
-bool Simulator::isWatchedStop(uint32_t code) {
-  DCHECK_LE(code, kMaxStopCode);
-  return code < kNumOfWatchedStops;
-}
-
-
-bool Simulator::isEnabledStop(uint32_t code) {
-  DCHECK_LE(code, kMaxStopCode);
-  // Unwatched stops are always enabled.
-  return !isWatchedStop(code) ||
-    !(watched_stops_[code].count & kStopDisabledBit);
-}
-
-
-void Simulator::EnableStop(uint32_t code) {
-  DCHECK(isWatchedStop(code));
-  if (!isEnabledStop(code)) {
-    watched_stops_[code].count &= ~kStopDisabledBit;
-  }
-}
-
-
-void Simulator::DisableStop(uint32_t code) {
-  DCHECK(isWatchedStop(code));
-  if (isEnabledStop(code)) {
-    watched_stops_[code].count |= kStopDisabledBit;
-  }
-}
-
-
-void Simulator::IncreaseStopCounter(uint32_t code) {
-  DCHECK_LE(code, kMaxStopCode);
-  DCHECK(isWatchedStop(code));
-  if ((watched_stops_[code].count & ~(1 << 31)) == 0x7FFFFFFF) {
-    PrintF("Stop counter for code %i has overflowed.\n"
-           "Enabling this code and reseting the counter to 0.\n", code);
-    watched_stops_[code].count = 0;
-    EnableStop(code);
-  } else {
-    watched_stops_[code].count++;
-  }
-}
-
-
-// Print a stop status.
-void Simulator::PrintStopInfo(uint32_t code) {
-  DCHECK_LE(code, kMaxStopCode);
-  if (!isWatchedStop(code)) {
-    PrintF("Stop not watched.");
-  } else {
-    const char* state = isEnabledStop(code) ? "Enabled" : "Disabled";
-    int32_t count = watched_stops_[code].count & ~kStopDisabledBit;
-    // Don't print the state of unused breakpoints.
-    if (count != 0) {
-      if (watched_stops_[code].desc) {
-        PrintF("stop %i - 0x%x: \t%s, \tcounter = %i, \t%s\n",
-               code, code, state, count, watched_stops_[code].desc);
-      } else {
-        PrintF("stop %i - 0x%x: \t%s, \tcounter = %i\n",
-               code, code, state, count);
-      }
-    }
-  }
-}
-
-
-// Handle execution based on instruction types.
-
-// Instruction types 0 and 1 are both rolled into one function because they
-// only differ in the handling of the shifter_operand.
-void Simulator::DecodeType01(Instruction* instr) {
-  int type = instr->TypeValue();
-  if ((type == 0) && instr->IsSpecialType0()) {
-    // multiply instruction or extra loads and stores
-    if (instr->Bits(7, 4) == 9) {
-      if (instr->Bit(24) == 0) {
-        // Raw field decoding here. Multiply instructions have their Rd in
-        // funny places.
-        int rn = instr->RnValue();
-        int rm = instr->RmValue();
-        int rs = instr->RsValue();
-        int32_t rs_val = get_register(rs);
-        int32_t rm_val = get_register(rm);
-        if (instr->Bit(23) == 0) {
-          if (instr->Bit(21) == 0) {
-            // The MUL instruction description (A 4.1.33) refers to Rd as being
-            // the destination for the operation, but it confusingly uses the
-            // Rn field to encode it.
-            // Format(instr, "mul'cond's 'rn, 'rm, 'rs");
-            int rd = rn;  // Remap the rn field to the Rd register.
-            int32_t alu_out = rm_val * rs_val;
-            set_register(rd, alu_out);
-            if (instr->HasS()) {
-              SetNZFlags(alu_out);
-            }
-          } else {
-            int rd = instr->RdValue();
-            int32_t acc_value = get_register(rd);
-            if (instr->Bit(22) == 0) {
-              // The MLA instruction description (A 4.1.28) refers to the order
-              // of registers as "Rd, Rm, Rs, Rn". But confusingly it uses the
-              // Rn field to encode the Rd register and the Rd field to encode
-              // the Rn register.
-              // Format(instr, "mla'cond's 'rn, 'rm, 'rs, 'rd");
-              int32_t mul_out = rm_val * rs_val;
-              int32_t result = acc_value + mul_out;
-              set_register(rn, result);
-            } else {
-              // Format(instr, "mls'cond's 'rn, 'rm, 'rs, 'rd");
-              int32_t mul_out = rm_val * rs_val;
-              int32_t result = acc_value - mul_out;
-              set_register(rn, result);
-            }
-          }
-        } else {
-          // The signed/long multiply instructions use the terms RdHi and RdLo
-          // when referring to the target registers. They are mapped to the Rn
-          // and Rd fields as follows:
-          // RdLo == Rd
-          // RdHi == Rn (This is confusingly stored in variable rd here
-          //             because the mul instruction from above uses the
-          //             Rn field to encode the Rd register. Good luck figuring
-          //             this out without reading the ARM instruction manual
-          //             at a very detailed level.)
-          // Format(instr, "'um'al'cond's 'rd, 'rn, 'rs, 'rm");
-          int rd_hi = rn;  // Remap the rn field to the RdHi register.
-          int rd_lo = instr->RdValue();
-          int32_t hi_res = 0;
-          int32_t lo_res = 0;
-          if (instr->Bit(22) == 1) {
-            int64_t left_op  = static_cast<int32_t>(rm_val);
-            int64_t right_op = static_cast<int32_t>(rs_val);
-            uint64_t result = left_op * right_op;
-            hi_res = static_cast<int32_t>(result >> 32);
-            lo_res = static_cast<int32_t>(result & 0xFFFFFFFF);
-          } else {
-            // unsigned multiply
-            uint64_t left_op  = static_cast<uint32_t>(rm_val);
-            uint64_t right_op = static_cast<uint32_t>(rs_val);
-            uint64_t result = left_op * right_op;
-            hi_res = static_cast<int32_t>(result >> 32);
-            lo_res = static_cast<int32_t>(result & 0xFFFFFFFF);
-          }
-          set_register(rd_lo, lo_res);
-          set_register(rd_hi, hi_res);
-          if (instr->HasS()) {
-            UNIMPLEMENTED();
-          }
-        }
-      } else {
-        if (instr->Bits(24, 23) == 3) {
-          if (instr->Bit(20) == 1) {
-            // ldrex
-            int rt = instr->RtValue();
-            int rn = instr->RnValue();
-            int32_t addr = get_register(rn);
-            switch (instr->Bits(22, 21)) {
-              case 0: {
-                // Format(instr, "ldrex'cond 'rt, ['rn]");
-                int value = ReadExW(addr, instr);
-                set_register(rt, value);
-                break;
-              }
-              case 2: {
-                // Format(instr, "ldrexb'cond 'rt, ['rn]");
-                uint8_t value = ReadExBU(addr);
-                set_register(rt, value);
-                break;
-              }
-              case 3: {
-                // Format(instr, "ldrexh'cond 'rt, ['rn]");
-                uint16_t value = ReadExHU(addr, instr);
-                set_register(rt, value);
-                break;
-              }
-              default:
-                UNREACHABLE();
-                break;
-            }
-          } else {
-            // The instruction is documented as strex rd, rt, [rn], but the
-            // "rt" register is using the rm bits.
-            int rd = instr->RdValue();
-            int rt = instr->RmValue();
-            int rn = instr->RnValue();
-            DCHECK_NE(rd, rn);
-            DCHECK_NE(rd, rt);
-            int32_t addr = get_register(rn);
-            switch (instr->Bits(22, 21)) {
-              case 0: {
-                // Format(instr, "strex'cond 'rd, 'rm, ['rn]");
-                int value = get_register(rt);
-                int status = WriteExW(addr, value, instr);
-                set_register(rd, status);
-                break;
-              }
-              case 2: {
-                // Format(instr, "strexb'cond 'rd, 'rm, ['rn]");
-                uint8_t value = get_register(rt);
-                int status = WriteExB(addr, value);
-                set_register(rd, status);
-                break;
-              }
-              case 3: {
-                // Format(instr, "strexh'cond 'rd, 'rm, ['rn]");
-                uint16_t value = get_register(rt);
-                int status = WriteExH(addr, value, instr);
-                set_register(rd, status);
-                break;
-              }
-              default:
-                UNREACHABLE();
-                break;
-            }
-          }
-        } else {
-          UNIMPLEMENTED();  // Not used by V8.
-        }
-      }
-    } else {
-      // extra load/store instructions
-      int rd = instr->RdValue();
-      int rn = instr->RnValue();
-      int32_t rn_val = get_register(rn);
-      int32_t addr = 0;
-      if (instr->Bit(22) == 0) {
-        int rm = instr->RmValue();
-        int32_t rm_val = get_register(rm);
-        switch (instr->PUField()) {
-          case da_x: {
-            // Format(instr, "'memop'cond'sign'h 'rd, ['rn], -'rm");
-            DCHECK(!instr->HasW());
-            addr = rn_val;
-            rn_val -= rm_val;
-            set_register(rn, rn_val);
-            break;
-          }
-          case ia_x: {
-            // Format(instr, "'memop'cond'sign'h 'rd, ['rn], +'rm");
-            DCHECK(!instr->HasW());
-            addr = rn_val;
-            rn_val += rm_val;
-            set_register(rn, rn_val);
-            break;
-          }
-          case db_x: {
-            // Format(instr, "'memop'cond'sign'h 'rd, ['rn, -'rm]'w");
-            rn_val -= rm_val;
-            addr = rn_val;
-            if (instr->HasW()) {
-              set_register(rn, rn_val);
-            }
-            break;
-          }
-          case ib_x: {
-            // Format(instr, "'memop'cond'sign'h 'rd, ['rn, +'rm]'w");
-            rn_val += rm_val;
-            addr = rn_val;
-            if (instr->HasW()) {
-              set_register(rn, rn_val);
-            }
-            break;
-          }
-          default: {
-            // The PU field is a 2-bit field.
-            UNREACHABLE();
-            break;
-          }
-        }
-      } else {
-        int32_t imm_val = (instr->ImmedHValue() << 4) | instr->ImmedLValue();
-        switch (instr->PUField()) {
-          case da_x: {
-            // Format(instr, "'memop'cond'sign'h 'rd, ['rn], #-'off8");
-            DCHECK(!instr->HasW());
-            addr = rn_val;
-            rn_val -= imm_val;
-            set_register(rn, rn_val);
-            break;
-          }
-          case ia_x: {
-            // Format(instr, "'memop'cond'sign'h 'rd, ['rn], #+'off8");
-            DCHECK(!instr->HasW());
-            addr = rn_val;
-            rn_val += imm_val;
-            set_register(rn, rn_val);
-            break;
-          }
-          case db_x: {
-            // Format(instr, "'memop'cond'sign'h 'rd, ['rn, #-'off8]'w");
-            rn_val -= imm_val;
-            addr = rn_val;
-            if (instr->HasW()) {
-              set_register(rn, rn_val);
-            }
-            break;
-          }
-          case ib_x: {
-            // Format(instr, "'memop'cond'sign'h 'rd, ['rn, #+'off8]'w");
-            rn_val += imm_val;
-            addr = rn_val;
-            if (instr->HasW()) {
-              set_register(rn, rn_val);
-            }
-            break;
-          }
-          default: {
-            // The PU field is a 2-bit field.
-            UNREACHABLE();
-            break;
-          }
-        }
-      }
-      if (((instr->Bits(7, 4) & 0xD) == 0xD) && (instr->Bit(20) == 0)) {
-        DCHECK_EQ(rd % 2, 0);
-        if (instr->HasH()) {
-          // The strd instruction.
-          int32_t value1 = get_register(rd);
-          int32_t value2 = get_register(rd+1);
-          WriteDW(addr, value1, value2);
-        } else {
-          // The ldrd instruction.
-          int* rn_data = ReadDW(addr);
-          set_dw_register(rd, rn_data);
-        }
-      } else if (instr->HasH()) {
-        if (instr->HasSign()) {
-          if (instr->HasL()) {
-            int16_t val = ReadH(addr, instr);
-            set_register(rd, val);
-          } else {
-            int16_t val = get_register(rd);
-            WriteH(addr, val, instr);
-          }
-        } else {
-          if (instr->HasL()) {
-            uint16_t val = ReadHU(addr, instr);
-            set_register(rd, val);
-          } else {
-            uint16_t val = get_register(rd);
-            WriteH(addr, val, instr);
-          }
-        }
-      } else {
-        // signed byte loads
-        DCHECK(instr->HasSign());
-        DCHECK(instr->HasL());
-        int8_t val = ReadB(addr);
-        set_register(rd, val);
-      }
-      return;
-    }
-  } else if ((type == 0) && instr->IsMiscType0()) {
-    if ((instr->Bits(27, 23) == 2) && (instr->Bits(21, 20) == 2) &&
-        (instr->Bits(15, 4) == 0xF00)) {
-      // MSR
-      int rm = instr->RmValue();
-      DCHECK_NE(pc, rm);  // UNPREDICTABLE
-      SRegisterFieldMask sreg_and_mask =
-          instr->BitField(22, 22) | instr->BitField(19, 16);
-      SetSpecialRegister(sreg_and_mask, get_register(rm));
-    } else if ((instr->Bits(27, 23) == 2) && (instr->Bits(21, 20) == 0) &&
-               (instr->Bits(11, 0) == 0)) {
-      // MRS
-      int rd = instr->RdValue();
-      DCHECK_NE(pc, rd);  // UNPREDICTABLE
-      SRegister sreg = static_cast<SRegister>(instr->BitField(22, 22));
-      set_register(rd, GetFromSpecialRegister(sreg));
-    } else if (instr->Bits(22, 21) == 1) {
-      int rm = instr->RmValue();
-      switch (instr->BitField(7, 4)) {
-        case BX:
-          set_pc(get_register(rm));
-          break;
-        case BLX: {
-          uint32_t old_pc = get_pc();
-          set_pc(get_register(rm));
-          set_register(lr, old_pc + Instruction::kInstrSize);
-          break;
-        }
-        case BKPT: {
-          ArmDebugger dbg(this);
-          PrintF("Simulator hit BKPT.\n");
-          dbg.Debug();
-          break;
-        }
-        default:
-          UNIMPLEMENTED();
-      }
-    } else if (instr->Bits(22, 21) == 3) {
-      int rm = instr->RmValue();
-      int rd = instr->RdValue();
-      switch (instr->BitField(7, 4)) {
-        case CLZ: {
-          uint32_t bits = get_register(rm);
-          int leading_zeros = 0;
-          if (bits == 0) {
-            leading_zeros = 32;
-          } else {
-            while ((bits & 0x80000000u) == 0) {
-              bits <<= 1;
-              leading_zeros++;
-            }
-          }
-          set_register(rd, leading_zeros);
-          break;
-        }
-        default:
-          UNIMPLEMENTED();
-      }
-    } else {
-      PrintF("%08x\n", instr->InstructionBits());
-      UNIMPLEMENTED();
-    }
-  } else if ((type == 1) && instr->IsNopType1()) {
-    // NOP.
-  } else {
-    int rd = instr->RdValue();
-    int rn = instr->RnValue();
-    int32_t rn_val = get_register(rn);
-    int32_t shifter_operand = 0;
-    bool shifter_carry_out = 0;
-    if (type == 0) {
-      shifter_operand = GetShiftRm(instr, &shifter_carry_out);
-    } else {
-      DCHECK_EQ(instr->TypeValue(), 1);
-      shifter_operand = GetImm(instr, &shifter_carry_out);
-    }
-    int32_t alu_out;
-
-    switch (instr->OpcodeField()) {
-      case AND: {
-        // Format(instr, "and'cond's 'rd, 'rn, 'shift_rm");
-        // Format(instr, "and'cond's 'rd, 'rn, 'imm");
-        alu_out = rn_val & shifter_operand;
-        set_register(rd, alu_out);
-        if (instr->HasS()) {
-          SetNZFlags(alu_out);
-          SetCFlag(shifter_carry_out);
-        }
-        break;
-      }
-
-      case EOR: {
-        // Format(instr, "eor'cond's 'rd, 'rn, 'shift_rm");
-        // Format(instr, "eor'cond's 'rd, 'rn, 'imm");
-        alu_out = rn_val ^ shifter_operand;
-        set_register(rd, alu_out);
-        if (instr->HasS()) {
-          SetNZFlags(alu_out);
-          SetCFlag(shifter_carry_out);
-        }
-        break;
-      }
-
-      case SUB: {
-        // Format(instr, "sub'cond's 'rd, 'rn, 'shift_rm");
-        // Format(instr, "sub'cond's 'rd, 'rn, 'imm");
-        alu_out = rn_val - shifter_operand;
-        set_register(rd, alu_out);
-        if (instr->HasS()) {
-          SetNZFlags(alu_out);
-          SetCFlag(!BorrowFrom(rn_val, shifter_operand));
-          SetVFlag(OverflowFrom(alu_out, rn_val, shifter_operand, false));
-        }
-        break;
-      }
-
-      case RSB: {
-        // Format(instr, "rsb'cond's 'rd, 'rn, 'shift_rm");
-        // Format(instr, "rsb'cond's 'rd, 'rn, 'imm");
-        alu_out = shifter_operand - rn_val;
-        set_register(rd, alu_out);
-        if (instr->HasS()) {
-          SetNZFlags(alu_out);
-          SetCFlag(!BorrowFrom(shifter_operand, rn_val));
-          SetVFlag(OverflowFrom(alu_out, shifter_operand, rn_val, false));
-        }
-        break;
-      }
-
-      case ADD: {
-        // Format(instr, "add'cond's 'rd, 'rn, 'shift_rm");
-        // Format(instr, "add'cond's 'rd, 'rn, 'imm");
-        alu_out = rn_val + shifter_operand;
-        set_register(rd, alu_out);
-        if (instr->HasS()) {
-          SetNZFlags(alu_out);
-          SetCFlag(CarryFrom(rn_val, shifter_operand));
-          SetVFlag(OverflowFrom(alu_out, rn_val, shifter_operand, true));
-        }
-        break;
-      }
-
-      case ADC: {
-        // Format(instr, "adc'cond's 'rd, 'rn, 'shift_rm");
-        // Format(instr, "adc'cond's 'rd, 'rn, 'imm");
-        alu_out = rn_val + shifter_operand + GetCarry();
-        set_register(rd, alu_out);
-        if (instr->HasS()) {
-          SetNZFlags(alu_out);
-          SetCFlag(CarryFrom(rn_val, shifter_operand, GetCarry()));
-          SetVFlag(OverflowFrom(alu_out, rn_val, shifter_operand, true));
-        }
-        break;
-      }
-
-      case SBC: {
-        //        Format(instr, "sbc'cond's 'rd, 'rn, 'shift_rm");
-        //        Format(instr, "sbc'cond's 'rd, 'rn, 'imm");
-        alu_out = (rn_val - shifter_operand) - (GetCarry() ? 0 : 1);
-        set_register(rd, alu_out);
-        if (instr->HasS()) {
-          SetNZFlags(alu_out);
-          SetCFlag(!BorrowFrom(rn_val, shifter_operand, GetCarry()));
-          SetVFlag(OverflowFrom(alu_out, rn_val, shifter_operand, false));
-        }
-        break;
-      }
-
-      case RSC: {
-        Format(instr, "rsc'cond's 'rd, 'rn, 'shift_rm");
-        Format(instr, "rsc'cond's 'rd, 'rn, 'imm");
-        break;
-      }
-
-      case TST: {
-        if (instr->HasS()) {
-          // Format(instr, "tst'cond 'rn, 'shift_rm");
-          // Format(instr, "tst'cond 'rn, 'imm");
-          alu_out = rn_val & shifter_operand;
-          SetNZFlags(alu_out);
-          SetCFlag(shifter_carry_out);
-        } else {
-          // Format(instr, "movw'cond 'rd, 'imm").
-          alu_out = instr->ImmedMovwMovtValue();
-          set_register(rd, alu_out);
-        }
-        break;
-      }
-
-      case TEQ: {
-        if (instr->HasS()) {
-          // Format(instr, "teq'cond 'rn, 'shift_rm");
-          // Format(instr, "teq'cond 'rn, 'imm");
-          alu_out = rn_val ^ shifter_operand;
-          SetNZFlags(alu_out);
-          SetCFlag(shifter_carry_out);
-        } else {
-          // Other instructions matching this pattern are handled in the
-          // miscellaneous instructions part above.
-          UNREACHABLE();
-        }
-        break;
-      }
-
-      case CMP: {
-        if (instr->HasS()) {
-          // Format(instr, "cmp'cond 'rn, 'shift_rm");
-          // Format(instr, "cmp'cond 'rn, 'imm");
-          alu_out = rn_val - shifter_operand;
-          SetNZFlags(alu_out);
-          SetCFlag(!BorrowFrom(rn_val, shifter_operand));
-          SetVFlag(OverflowFrom(alu_out, rn_val, shifter_operand, false));
-        } else {
-          // Format(instr, "movt'cond 'rd, 'imm").
-          alu_out =
-              (get_register(rd) & 0xFFFF) | (instr->ImmedMovwMovtValue() << 16);
-          set_register(rd, alu_out);
-        }
-        break;
-      }
-
-      case CMN: {
-        if (instr->HasS()) {
-          // Format(instr, "cmn'cond 'rn, 'shift_rm");
-          // Format(instr, "cmn'cond 'rn, 'imm");
-          alu_out = rn_val + shifter_operand;
-          SetNZFlags(alu_out);
-          SetCFlag(CarryFrom(rn_val, shifter_operand));
-          SetVFlag(OverflowFrom(alu_out, rn_val, shifter_operand, true));
-        } else {
-          // Other instructions matching this pattern are handled in the
-          // miscellaneous instructions part above.
-          UNREACHABLE();
-        }
-        break;
-      }
-
-      case ORR: {
-        // Format(instr, "orr'cond's 'rd, 'rn, 'shift_rm");
-        // Format(instr, "orr'cond's 'rd, 'rn, 'imm");
-        alu_out = rn_val | shifter_operand;
-        set_register(rd, alu_out);
-        if (instr->HasS()) {
-          SetNZFlags(alu_out);
-          SetCFlag(shifter_carry_out);
-        }
-        break;
-      }
-
-      case MOV: {
-        // Format(instr, "mov'cond's 'rd, 'shift_rm");
-        // Format(instr, "mov'cond's 'rd, 'imm");
-        alu_out = shifter_operand;
-        set_register(rd, alu_out);
-        if (instr->HasS()) {
-          SetNZFlags(alu_out);
-          SetCFlag(shifter_carry_out);
-        }
-        break;
-      }
-
-      case BIC: {
-        // Format(instr, "bic'cond's 'rd, 'rn, 'shift_rm");
-        // Format(instr, "bic'cond's 'rd, 'rn, 'imm");
-        alu_out = rn_val & ~shifter_operand;
-        set_register(rd, alu_out);
-        if (instr->HasS()) {
-          SetNZFlags(alu_out);
-          SetCFlag(shifter_carry_out);
-        }
-        break;
-      }
-
-      case MVN: {
-        // Format(instr, "mvn'cond's 'rd, 'shift_rm");
-        // Format(instr, "mvn'cond's 'rd, 'imm");
-        alu_out = ~shifter_operand;
-        set_register(rd, alu_out);
-        if (instr->HasS()) {
-          SetNZFlags(alu_out);
-          SetCFlag(shifter_carry_out);
-        }
-        break;
-      }
-
-      default: {
-        UNREACHABLE();
-        break;
-      }
-    }
-  }
-}
-
-
-void Simulator::DecodeType2(Instruction* instr) {
-  int rd = instr->RdValue();
-  int rn = instr->RnValue();
-  int32_t rn_val = get_register(rn);
-  int32_t im_val = instr->Offset12Value();
-  int32_t addr = 0;
-  switch (instr->PUField()) {
-    case da_x: {
-      // Format(instr, "'memop'cond'b 'rd, ['rn], #-'off12");
-      DCHECK(!instr->HasW());
-      addr = rn_val;
-      rn_val -= im_val;
-      set_register(rn, rn_val);
-      break;
-    }
-    case ia_x: {
-      // Format(instr, "'memop'cond'b 'rd, ['rn], #+'off12");
-      DCHECK(!instr->HasW());
-      addr = rn_val;
-      rn_val += im_val;
-      set_register(rn, rn_val);
-      break;
-    }
-    case db_x: {
-      // Format(instr, "'memop'cond'b 'rd, ['rn, #-'off12]'w");
-      rn_val -= im_val;
-      addr = rn_val;
-      if (instr->HasW()) {
-        set_register(rn, rn_val);
-      }
-      break;
-    }
-    case ib_x: {
-      // Format(instr, "'memop'cond'b 'rd, ['rn, #+'off12]'w");
-      rn_val += im_val;
-      addr = rn_val;
-      if (instr->HasW()) {
-        set_register(rn, rn_val);
-      }
-      break;
-    }
-    default: {
-      UNREACHABLE();
-      break;
-    }
-  }
-  if (instr->HasB()) {
-    if (instr->HasL()) {
-      byte val = ReadBU(addr);
-      set_register(rd, val);
-    } else {
-      byte val = get_register(rd);
-      WriteB(addr, val);
-    }
-  } else {
-    if (instr->HasL()) {
-      set_register(rd, ReadW(addr, instr));
-    } else {
-      WriteW(addr, get_register(rd), instr);
-    }
-  }
-}
-
-
-void Simulator::DecodeType3(Instruction* instr) {
-  int rd = instr->RdValue();
-  int rn = instr->RnValue();
-  int32_t rn_val = get_register(rn);
-  bool shifter_carry_out = 0;
-  int32_t shifter_operand = GetShiftRm(instr, &shifter_carry_out);
-  int32_t addr = 0;
-  switch (instr->PUField()) {
-    case da_x: {
-      DCHECK(!instr->HasW());
-      Format(instr, "'memop'cond'b 'rd, ['rn], -'shift_rm");
-      UNIMPLEMENTED();
-      break;
-    }
-    case ia_x: {
-      if (instr->Bit(4) == 0) {
-        // Memop.
-      } else {
-        if (instr->Bit(5) == 0) {
-          switch (instr->Bits(22, 21)) {
-            case 0:
-              if (instr->Bit(20) == 0) {
-                if (instr->Bit(6) == 0) {
-                  // Pkhbt.
-                  uint32_t rn_val = get_register(rn);
-                  uint32_t rm_val = get_register(instr->RmValue());
-                  int32_t shift = instr->Bits(11, 7);
-                  rm_val <<= shift;
-                  set_register(rd, (rn_val & 0xFFFF) | (rm_val & 0xFFFF0000U));
-                } else {
-                  // Pkhtb.
-                  uint32_t rn_val = get_register(rn);
-                  int32_t rm_val = get_register(instr->RmValue());
-                  int32_t shift = instr->Bits(11, 7);
-                  if (shift == 0) {
-                    shift = 32;
-                  }
-                  rm_val >>= shift;
-                  set_register(rd, (rn_val & 0xFFFF0000U) | (rm_val & 0xFFFF));
-                }
-              } else {
-                UNIMPLEMENTED();
-              }
-              break;
-            case 1:
-              UNIMPLEMENTED();
-              break;
-            case 2:
-              UNIMPLEMENTED();
-              break;
-            case 3: {
-              // Usat.
-              int32_t sat_pos = instr->Bits(20, 16);
-              int32_t sat_val = (1 << sat_pos) - 1;
-              int32_t shift = instr->Bits(11, 7);
-              int32_t shift_type = instr->Bit(6);
-              int32_t rm_val = get_register(instr->RmValue());
-              if (shift_type == 0) {  // LSL
-                rm_val <<= shift;
-              } else {  // ASR
-                rm_val >>= shift;
-              }
-              // If saturation occurs, the Q flag should be set in the CPSR.
-              // There is no Q flag yet, and no instruction (MRS) to read the
-              // CPSR directly.
-              if (rm_val > sat_val) {
-                rm_val = sat_val;
-              } else if (rm_val < 0) {
-                rm_val = 0;
-              }
-              set_register(rd, rm_val);
-              break;
-            }
-          }
-        } else {
-          switch (instr->Bits(22, 21)) {
-            case 0:
-              UNIMPLEMENTED();
-              break;
-            case 1:
-              if (instr->Bits(9, 6) == 1) {
-                if (instr->Bit(20) == 0) {
-                  if (instr->Bits(19, 16) == 0xF) {
-                    // Sxtb.
-                    int32_t rm_val = get_register(instr->RmValue());
-                    int32_t rotate = instr->Bits(11, 10);
-                    switch (rotate) {
-                      case 0:
-                        break;
-                      case 1:
-                        rm_val = (rm_val >> 8) | (rm_val << 24);
-                        break;
-                      case 2:
-                        rm_val = (rm_val >> 16) | (rm_val << 16);
-                        break;
-                      case 3:
-                        rm_val = (rm_val >> 24) | (rm_val << 8);
-                        break;
-                    }
-                    set_register(rd, static_cast<int8_t>(rm_val));
-                  } else {
-                    // Sxtab.
-                    int32_t rn_val = get_register(rn);
-                    int32_t rm_val = get_register(instr->RmValue());
-                    int32_t rotate = instr->Bits(11, 10);
-                    switch (rotate) {
-                      case 0:
-                        break;
-                      case 1:
-                        rm_val = (rm_val >> 8) | (rm_val << 24);
-                        break;
-                      case 2:
-                        rm_val = (rm_val >> 16) | (rm_val << 16);
-                        break;
-                      case 3:
-                        rm_val = (rm_val >> 24) | (rm_val << 8);
-                        break;
-                    }
-                    set_register(rd, rn_val + static_cast<int8_t>(rm_val));
-                  }
-                } else {
-                  if (instr->Bits(19, 16) == 0xF) {
-                    // Sxth.
-                    int32_t rm_val = get_register(instr->RmValue());
-                    int32_t rotate = instr->Bits(11, 10);
-                    switch (rotate) {
-                      case 0:
-                        break;
-                      case 1:
-                        rm_val = (rm_val >> 8) | (rm_val << 24);
-                        break;
-                      case 2:
-                        rm_val = (rm_val >> 16) | (rm_val << 16);
-                        break;
-                      case 3:
-                        rm_val = (rm_val >> 24) | (rm_val << 8);
-                        break;
-                    }
-                    set_register(rd, static_cast<int16_t>(rm_val));
-                  } else {
-                    // Sxtah.
-                    int32_t rn_val = get_register(rn);
-                    int32_t rm_val = get_register(instr->RmValue());
-                    int32_t rotate = instr->Bits(11, 10);
-                    switch (rotate) {
-                      case 0:
-                        break;
-                      case 1:
-                        rm_val = (rm_val >> 8) | (rm_val << 24);
-                        break;
-                      case 2:
-                        rm_val = (rm_val >> 16) | (rm_val << 16);
-                        break;
-                      case 3:
-                        rm_val = (rm_val >> 24) | (rm_val << 8);
-                        break;
-                    }
-                    set_register(rd, rn_val + static_cast<int16_t>(rm_val));
-                  }
-                }
-              } else {
-                UNREACHABLE();
-              }
-              break;
-            case 2:
-              if ((instr->Bit(20) == 0) && (instr->Bits(9, 6) == 1)) {
-                if (instr->Bits(19, 16) == 0xF) {
-                  // Uxtb16.
-                  uint32_t rm_val = get_register(instr->RmValue());
-                  int32_t rotate = instr->Bits(11, 10);
-                  switch (rotate) {
-                    case 0:
-                      break;
-                    case 1:
-                      rm_val = (rm_val >> 8) | (rm_val << 24);
-                      break;
-                    case 2:
-                      rm_val = (rm_val >> 16) | (rm_val << 16);
-                      break;
-                    case 3:
-                      rm_val = (rm_val >> 24) | (rm_val << 8);
-                      break;
-                  }
-                  set_register(rd, (rm_val & 0xFF) | (rm_val & 0xFF0000));
-                } else {
-                  UNIMPLEMENTED();
-                }
-              } else {
-                UNIMPLEMENTED();
-              }
-              break;
-            case 3:
-              if ((instr->Bits(9, 6) == 1)) {
-                if (instr->Bit(20) == 0) {
-                  if (instr->Bits(19, 16) == 0xF) {
-                    // Uxtb.
-                    uint32_t rm_val = get_register(instr->RmValue());
-                    int32_t rotate = instr->Bits(11, 10);
-                    switch (rotate) {
-                      case 0:
-                        break;
-                      case 1:
-                        rm_val = (rm_val >> 8) | (rm_val << 24);
-                        break;
-                      case 2:
-                        rm_val = (rm_val >> 16) | (rm_val << 16);
-                        break;
-                      case 3:
-                        rm_val = (rm_val >> 24) | (rm_val << 8);
-                        break;
-                    }
-                    set_register(rd, (rm_val & 0xFF));
-                  } else {
-                    // Uxtab.
-                    uint32_t rn_val = get_register(rn);
-                    uint32_t rm_val = get_register(instr->RmValue());
-                    int32_t rotate = instr->Bits(11, 10);
-                    switch (rotate) {
-                      case 0:
-                        break;
-                      case 1:
-                        rm_val = (rm_val >> 8) | (rm_val << 24);
-                        break;
-                      case 2:
-                        rm_val = (rm_val >> 16) | (rm_val << 16);
-                        break;
-                      case 3:
-                        rm_val = (rm_val >> 24) | (rm_val << 8);
-                        break;
-                    }
-                    set_register(rd, rn_val + (rm_val & 0xFF));
-                  }
-                } else {
-                  if (instr->Bits(19, 16) == 0xF) {
-                    // Uxth.
-                    uint32_t rm_val = get_register(instr->RmValue());
-                    int32_t rotate = instr->Bits(11, 10);
-                    switch (rotate) {
-                      case 0:
-                        break;
-                      case 1:
-                        rm_val = (rm_val >> 8) | (rm_val << 24);
-                        break;
-                      case 2:
-                        rm_val = (rm_val >> 16) | (rm_val << 16);
-                        break;
-                      case 3:
-                        rm_val = (rm_val >> 24) | (rm_val << 8);
-                        break;
-                    }
-                    set_register(rd, (rm_val & 0xFFFF));
-                  } else {
-                    // Uxtah.
-                    uint32_t rn_val = get_register(rn);
-                    uint32_t rm_val = get_register(instr->RmValue());
-                    int32_t rotate = instr->Bits(11, 10);
-                    switch (rotate) {
-                      case 0:
-                        break;
-                      case 1:
-                        rm_val = (rm_val >> 8) | (rm_val << 24);
-                        break;
-                      case 2:
-                        rm_val = (rm_val >> 16) | (rm_val << 16);
-                        break;
-                      case 3:
-                        rm_val = (rm_val >> 24) | (rm_val << 8);
-                        break;
-                    }
-                    set_register(rd, rn_val + (rm_val & 0xFFFF));
-                  }
-                }
-              } else {
-                // PU == 0b01, BW == 0b11, Bits(9, 6) != 0b0001
-                if ((instr->Bits(20, 16) == 0x1F) &&
-                    (instr->Bits(11, 4) == 0xF3)) {
-                  // Rbit.
-                  uint32_t rm_val = get_register(instr->RmValue());
-                  set_register(rd, base::bits::ReverseBits(rm_val));
-                } else {
-                  UNIMPLEMENTED();
-                }
-              }
-              break;
-          }
-        }
-        return;
-      }
-      break;
-    }
-    case db_x: {
-      if (instr->Bits(22, 20) == 0x5) {
-        if (instr->Bits(7, 4) == 0x1) {
-          int rm = instr->RmValue();
-          int32_t rm_val = get_register(rm);
-          int rs = instr->RsValue();
-          int32_t rs_val = get_register(rs);
-          if (instr->Bits(15, 12) == 0xF) {
-            // SMMUL (in V8 notation matching ARM ISA format)
-            // Format(instr, "smmul'cond 'rn, 'rm, 'rs");
-            rn_val = base::bits::SignedMulHigh32(rm_val, rs_val);
-          } else {
-            // SMMLA (in V8 notation matching ARM ISA format)
-            // Format(instr, "smmla'cond 'rn, 'rm, 'rs, 'rd");
-            int rd = instr->RdValue();
-            int32_t rd_val = get_register(rd);
-            rn_val = base::bits::SignedMulHighAndAdd32(rm_val, rs_val, rd_val);
-          }
-          set_register(rn, rn_val);
-          return;
-        }
-      }
-      if (instr->Bits(5, 4) == 0x1) {
-        if ((instr->Bit(22) == 0x0) && (instr->Bit(20) == 0x1)) {
-          // (s/u)div (in V8 notation matching ARM ISA format) rn = rm/rs
-          // Format(instr, "'(s/u)div'cond'b 'rn, 'rm, 'rs);
-          int rm = instr->RmValue();
-          int32_t rm_val = get_register(rm);
-          int rs = instr->RsValue();
-          int32_t rs_val = get_register(rs);
-          int32_t ret_val = 0;
-          // udiv
-          if (instr->Bit(21) == 0x1) {
-            ret_val = bit_cast<int32_t>(base::bits::UnsignedDiv32(
-                bit_cast<uint32_t>(rm_val), bit_cast<uint32_t>(rs_val)));
-          } else {
-            ret_val = base::bits::SignedDiv32(rm_val, rs_val);
-          }
-          set_register(rn, ret_val);
-          return;
-        }
-      }
-      // Format(instr, "'memop'cond'b 'rd, ['rn, -'shift_rm]'w");
-      addr = rn_val - shifter_operand;
-      if (instr->HasW()) {
-        set_register(rn, addr);
-      }
-      break;
-    }
-    case ib_x: {
-      if (instr->HasW() && (instr->Bits(6, 4) == 0x5)) {
-        uint32_t widthminus1 = static_cast<uint32_t>(instr->Bits(20, 16));
-        uint32_t lsbit = static_cast<uint32_t>(instr->Bits(11, 7));
-        uint32_t msbit = widthminus1 + lsbit;
-        if (msbit <= 31) {
-          if (instr->Bit(22)) {
-            // ubfx - unsigned bitfield extract.
-            uint32_t rm_val =
-                static_cast<uint32_t>(get_register(instr->RmValue()));
-            uint32_t extr_val = rm_val << (31 - msbit);
-            extr_val = extr_val >> (31 - widthminus1);
-            set_register(instr->RdValue(), extr_val);
-          } else {
-            // sbfx - signed bitfield extract.
-            int32_t rm_val = get_register(instr->RmValue());
-            int32_t extr_val = rm_val << (31 - msbit);
-            extr_val = extr_val >> (31 - widthminus1);
-            set_register(instr->RdValue(), extr_val);
-          }
-        } else {
-          UNREACHABLE();
-        }
-        return;
-      } else if (!instr->HasW() && (instr->Bits(6, 4) == 0x1)) {
-        uint32_t lsbit = static_cast<uint32_t>(instr->Bits(11, 7));
-        uint32_t msbit = static_cast<uint32_t>(instr->Bits(20, 16));
-        if (msbit >= lsbit) {
-          // bfc or bfi - bitfield clear/insert.
-          uint32_t rd_val =
-              static_cast<uint32_t>(get_register(instr->RdValue()));
-          uint32_t bitcount = msbit - lsbit + 1;
-          uint32_t mask = 0xFFFFFFFFu >> (32 - bitcount);
-          rd_val &= ~(mask << lsbit);
-          if (instr->RmValue() != 15) {
-            // bfi - bitfield insert.
-            uint32_t rm_val =
-                static_cast<uint32_t>(get_register(instr->RmValue()));
-            rm_val &= mask;
-            rd_val |= rm_val << lsbit;
-          }
-          set_register(instr->RdValue(), rd_val);
-        } else {
-          UNREACHABLE();
-        }
-        return;
-      } else {
-        // Format(instr, "'memop'cond'b 'rd, ['rn, +'shift_rm]'w");
-        addr = rn_val + shifter_operand;
-        if (instr->HasW()) {
-          set_register(rn, addr);
-        }
-      }
-      break;
-    }
-    default: {
-      UNREACHABLE();
-      break;
-    }
-  }
-  if (instr->HasB()) {
-    if (instr->HasL()) {
-      uint8_t byte = ReadB(addr);
-      set_register(rd, byte);
-    } else {
-      uint8_t byte = get_register(rd);
-      WriteB(addr, byte);
-    }
-  } else {
-    if (instr->HasL()) {
-      set_register(rd, ReadW(addr, instr));
-    } else {
-      WriteW(addr, get_register(rd), instr);
-    }
-  }
-}
-
-
-void Simulator::DecodeType4(Instruction* instr) {
-  DCHECK_EQ(instr->Bit(22), 0);  // only allowed to be set in privileged mode
-  if (instr->HasL()) {
-    // Format(instr, "ldm'cond'pu 'rn'w, 'rlist");
-    HandleRList(instr, true);
-  } else {
-    // Format(instr, "stm'cond'pu 'rn'w, 'rlist");
-    HandleRList(instr, false);
-  }
-}
-
-
-void Simulator::DecodeType5(Instruction* instr) {
-  // Format(instr, "b'l'cond 'target");
-  int off = (instr->SImmed24Value() << 2);
-  intptr_t pc_address = get_pc();
-  if (instr->HasLink()) {
-    set_register(lr, pc_address + Instruction::kInstrSize);
-  }
-  int pc_reg = get_register(pc);
-  set_pc(pc_reg + off);
-}
-
-
-void Simulator::DecodeType6(Instruction* instr) {
-  DecodeType6CoprocessorIns(instr);
-}
-
-
-void Simulator::DecodeType7(Instruction* instr) {
-  if (instr->Bit(24) == 1) {
-    SoftwareInterrupt(instr);
-  } else {
-    switch (instr->CoprocessorValue()) {
-      case 10:  // Fall through.
-      case 11:
-        DecodeTypeVFP(instr);
-        break;
-      case 15:
-        DecodeTypeCP15(instr);
-        break;
-      default:
-        UNIMPLEMENTED();
-    }
-  }
-}
-
-
-// void Simulator::DecodeTypeVFP(Instruction* instr)
-// The Following ARMv7 VFPv instructions are currently supported.
-// vmov :Sn = Rt
-// vmov :Rt = Sn
-// vcvt: Dd = Sm
-// vcvt: Sd = Dm
-// vcvt.f64.s32 Dd, Dd, #<fbits>
-// Dd = vabs(Dm)
-// Sd = vabs(Sm)
-// Dd = vneg(Dm)
-// Sd = vneg(Sm)
-// Dd = vadd(Dn, Dm)
-// Sd = vadd(Sn, Sm)
-// Dd = vsub(Dn, Dm)
-// Sd = vsub(Sn, Sm)
-// Dd = vmul(Dn, Dm)
-// Sd = vmul(Sn, Sm)
-// Dd = vdiv(Dn, Dm)
-// Sd = vdiv(Sn, Sm)
-// vcmp(Dd, Dm)
-// vcmp(Sd, Sm)
-// Dd = vsqrt(Dm)
-// Sd = vsqrt(Sm)
-// vmrs
-// vdup.size Qd, Rt.
-void Simulator::DecodeTypeVFP(Instruction* instr) {
-  DCHECK((instr->TypeValue() == 7) && (instr->Bit(24) == 0x0) );
-  DCHECK_EQ(instr->Bits(11, 9), 0x5);
-  // Obtain single precision register codes.
-  int m = instr->VFPMRegValue(kSinglePrecision);
-  int d = instr->VFPDRegValue(kSinglePrecision);
-  int n = instr->VFPNRegValue(kSinglePrecision);
-  // Obtain double precision register codes.
-  int vm = instr->VFPMRegValue(kDoublePrecision);
-  int vd = instr->VFPDRegValue(kDoublePrecision);
-  int vn = instr->VFPNRegValue(kDoublePrecision);
-
-  if (instr->Bit(4) == 0) {
-    if (instr->Opc1Value() == 0x7) {
-      // Other data processing instructions
-      if ((instr->Opc2Value() == 0x0) && (instr->Opc3Value() == 0x1)) {
-        // vmov register to register.
-        if (instr->SzValue() == 0x1) {
-          uint32_t data[2];
-          get_d_register(vm, data);
-          set_d_register(vd, data);
-        } else {
-          set_s_register(d, get_s_register(m));
-        }
-      } else if ((instr->Opc2Value() == 0x0) && (instr->Opc3Value() == 0x3)) {
-        // vabs
-        if (instr->SzValue() == 0x1) {
-          Float64 dm = get_double_from_d_register(vm);
-          constexpr uint64_t kSignBit64 = uint64_t{1} << 63;
-          Float64 dd = Float64::FromBits(dm.get_bits() & ~kSignBit64);
-          dd = canonicalizeNaN(dd);
-          set_d_register_from_double(vd, dd);
-        } else {
-          Float32 sm = get_float_from_s_register(m);
-          constexpr uint32_t kSignBit32 = uint32_t{1} << 31;
-          Float32 sd = Float32::FromBits(sm.get_bits() & ~kSignBit32);
-          sd = canonicalizeNaN(sd);
-          set_s_register_from_float(d, sd);
-        }
-      } else if ((instr->Opc2Value() == 0x1) && (instr->Opc3Value() == 0x1)) {
-        // vneg
-        if (instr->SzValue() == 0x1) {
-          Float64 dm = get_double_from_d_register(vm);
-          constexpr uint64_t kSignBit64 = uint64_t{1} << 63;
-          Float64 dd = Float64::FromBits(dm.get_bits() ^ kSignBit64);
-          dd = canonicalizeNaN(dd);
-          set_d_register_from_double(vd, dd);
-        } else {
-          Float32 sm = get_float_from_s_register(m);
-          constexpr uint32_t kSignBit32 = uint32_t{1} << 31;
-          Float32 sd = Float32::FromBits(sm.get_bits() ^ kSignBit32);
-          sd = canonicalizeNaN(sd);
-          set_s_register_from_float(d, sd);
-        }
-      } else if ((instr->Opc2Value() == 0x7) && (instr->Opc3Value() == 0x3)) {
-        DecodeVCVTBetweenDoubleAndSingle(instr);
-      } else if ((instr->Opc2Value() == 0x8) && (instr->Opc3Value() & 0x1)) {
-        DecodeVCVTBetweenFloatingPointAndInteger(instr);
-      } else if ((instr->Opc2Value() == 0xA) && (instr->Opc3Value() == 0x3) &&
-                 (instr->Bit(8) == 1)) {
-        // vcvt.f64.s32 Dd, Dd, #<fbits>
-        int fraction_bits = 32 - ((instr->Bits(3, 0) << 1) | instr->Bit(5));
-        int fixed_value = get_sinteger_from_s_register(vd * 2);
-        double divide = 1 << fraction_bits;
-        set_d_register_from_double(vd, fixed_value / divide);
-      } else if (((instr->Opc2Value() >> 1) == 0x6) &&
-                 (instr->Opc3Value() & 0x1)) {
-        DecodeVCVTBetweenFloatingPointAndInteger(instr);
-      } else if (((instr->Opc2Value() == 0x4) || (instr->Opc2Value() == 0x5)) &&
-                 (instr->Opc3Value() & 0x1)) {
-        DecodeVCMP(instr);
-      } else if (((instr->Opc2Value() == 0x1)) && (instr->Opc3Value() == 0x3)) {
-        // vsqrt
-        lazily_initialize_fast_sqrt(isolate_);
-        if (instr->SzValue() == 0x1) {
-          double dm_value = get_double_from_d_register(vm).get_scalar();
-          double dd_value = fast_sqrt(dm_value, isolate_);
-          dd_value = canonicalizeNaN(dd_value);
-          set_d_register_from_double(vd, dd_value);
-        } else {
-          float sm_value = get_float_from_s_register(m).get_scalar();
-          float sd_value = fast_sqrt(sm_value, isolate_);
-          sd_value = canonicalizeNaN(sd_value);
-          set_s_register_from_float(d, sd_value);
-        }
-      } else if (instr->Opc3Value() == 0x0) {
-        // vmov immediate.
-        if (instr->SzValue() == 0x1) {
-          set_d_register_from_double(vd, instr->DoubleImmedVmov());
-        } else {
-          // Cast double to float.
-          float value = instr->DoubleImmedVmov().get_scalar();
-          set_s_register_from_float(d, value);
-        }
-      } else if (((instr->Opc2Value() == 0x6)) && (instr->Opc3Value() == 0x3)) {
-        // vrintz - truncate
-        if (instr->SzValue() == 0x1) {
-          double dm_value = get_double_from_d_register(vm).get_scalar();
-          double dd_value = trunc(dm_value);
-          dd_value = canonicalizeNaN(dd_value);
-          set_d_register_from_double(vd, dd_value);
-        } else {
-          float sm_value = get_float_from_s_register(m).get_scalar();
-          float sd_value = truncf(sm_value);
-          sd_value = canonicalizeNaN(sd_value);
-          set_s_register_from_float(d, sd_value);
-        }
-      } else {
-        UNREACHABLE();  // Not used by V8.
-      }
-    } else if (instr->Opc1Value() == 0x3) {
-      if (instr->Opc3Value() & 0x1) {
-        // vsub
-        if (instr->SzValue() == 0x1) {
-          double dn_value = get_double_from_d_register(vn).get_scalar();
-          double dm_value = get_double_from_d_register(vm).get_scalar();
-          double dd_value = dn_value - dm_value;
-          dd_value = canonicalizeNaN(dd_value);
-          set_d_register_from_double(vd, dd_value);
-        } else {
-          float sn_value = get_float_from_s_register(n).get_scalar();
-          float sm_value = get_float_from_s_register(m).get_scalar();
-          float sd_value = sn_value - sm_value;
-          sd_value = canonicalizeNaN(sd_value);
-          set_s_register_from_float(d, sd_value);
-        }
-      } else {
-        // vadd
-        if (instr->SzValue() == 0x1) {
-          double dn_value = get_double_from_d_register(vn).get_scalar();
-          double dm_value = get_double_from_d_register(vm).get_scalar();
-          double dd_value = dn_value + dm_value;
-          dd_value = canonicalizeNaN(dd_value);
-          set_d_register_from_double(vd, dd_value);
-        } else {
-          float sn_value = get_float_from_s_register(n).get_scalar();
-          float sm_value = get_float_from_s_register(m).get_scalar();
-          float sd_value = sn_value + sm_value;
-          sd_value = canonicalizeNaN(sd_value);
-          set_s_register_from_float(d, sd_value);
-        }
-      }
-    } else if ((instr->Opc1Value() == 0x2) && !(instr->Opc3Value() & 0x1)) {
-      // vmul
-      if (instr->SzValue() == 0x1) {
-        double dn_value = get_double_from_d_register(vn).get_scalar();
-        double dm_value = get_double_from_d_register(vm).get_scalar();
-        double dd_value = dn_value * dm_value;
-        dd_value = canonicalizeNaN(dd_value);
-        set_d_register_from_double(vd, dd_value);
-      } else {
-        float sn_value = get_float_from_s_register(n).get_scalar();
-        float sm_value = get_float_from_s_register(m).get_scalar();
-        float sd_value = sn_value * sm_value;
-        sd_value = canonicalizeNaN(sd_value);
-        set_s_register_from_float(d, sd_value);
-      }
-    } else if ((instr->Opc1Value() == 0x0)) {
-      // vmla, vmls
-      const bool is_vmls = (instr->Opc3Value() & 0x1);
-      if (instr->SzValue() == 0x1) {
-        const double dd_val = get_double_from_d_register(vd).get_scalar();
-        const double dn_val = get_double_from_d_register(vn).get_scalar();
-        const double dm_val = get_double_from_d_register(vm).get_scalar();
-
-        // Note: we do the mul and add/sub in separate steps to avoid getting a
-        // result with too high precision.
-        const double res = dn_val * dm_val;
-        set_d_register_from_double(vd, res);
-        if (is_vmls) {
-          set_d_register_from_double(vd, canonicalizeNaN(dd_val - res));
-        } else {
-          set_d_register_from_double(vd, canonicalizeNaN(dd_val + res));
-        }
-      } else {
-        const float sd_val = get_float_from_s_register(d).get_scalar();
-        const float sn_val = get_float_from_s_register(n).get_scalar();
-        const float sm_val = get_float_from_s_register(m).get_scalar();
-
-        // Note: we do the mul and add/sub in separate steps to avoid getting a
-        // result with too high precision.
-        const float res = sn_val * sm_val;
-        set_s_register_from_float(d, res);
-        if (is_vmls) {
-          set_s_register_from_float(d, canonicalizeNaN(sd_val - res));
-        } else {
-          set_s_register_from_float(d, canonicalizeNaN(sd_val + res));
-        }
-      }
-    } else if ((instr->Opc1Value() == 0x4) && !(instr->Opc3Value() & 0x1)) {
-      // vdiv
-      if (instr->SzValue() == 0x1) {
-        double dn_value = get_double_from_d_register(vn).get_scalar();
-        double dm_value = get_double_from_d_register(vm).get_scalar();
-        double dd_value = dn_value / dm_value;
-        div_zero_vfp_flag_ = (dm_value == 0);
-        dd_value = canonicalizeNaN(dd_value);
-        set_d_register_from_double(vd, dd_value);
-      } else {
-        float sn_value = get_float_from_s_register(n).get_scalar();
-        float sm_value = get_float_from_s_register(m).get_scalar();
-        float sd_value = sn_value / sm_value;
-        div_zero_vfp_flag_ = (sm_value == 0);
-        sd_value = canonicalizeNaN(sd_value);
-        set_s_register_from_float(d, sd_value);
-      }
-    } else {
-      UNIMPLEMENTED();  // Not used by V8.
-    }
-  } else {
-    if ((instr->VCValue() == 0x0) &&
-        (instr->VAValue() == 0x0)) {
-      DecodeVMOVBetweenCoreAndSinglePrecisionRegisters(instr);
-    } else if ((instr->VLValue() == 0x0) && (instr->VCValue() == 0x1)) {
-      if (instr->Bit(23) == 0) {
-        // vmov (ARM core register to scalar)
-        int vd = instr->VFPNRegValue(kDoublePrecision);
-        int rt = instr->RtValue();
-        int opc1_opc2 = (instr->Bits(22, 21) << 2) | instr->Bits(6, 5);
-        if ((opc1_opc2 & 0xB) == 0) {
-          // NeonS32/NeonU32
-          uint32_t data[2];
-          get_d_register(vd, data);
-          data[instr->Bit(21)] = get_register(rt);
-          set_d_register(vd, data);
-        } else {
-          uint64_t data;
-          get_d_register(vd, &data);
-          uint64_t rt_value = get_register(rt);
-          if ((opc1_opc2 & 0x8) != 0) {
-            // NeonS8 / NeonU8
-            int i = opc1_opc2 & 0x7;
-            int shift = i * kBitsPerByte;
-            const uint64_t mask = 0xFF;
-            data &= ~(mask << shift);
-            data |= (rt_value & mask) << shift;
-            set_d_register(vd, &data);
-          } else if ((opc1_opc2 & 0x1) != 0) {
-            // NeonS16 / NeonU16
-            int i = (opc1_opc2 >> 1) & 0x3;
-            int shift = i * kBitsPerByte * kShortSize;
-            const uint64_t mask = 0xFFFF;
-            data &= ~(mask << shift);
-            data |= (rt_value & mask) << shift;
-            set_d_register(vd, &data);
-          } else {
-            UNREACHABLE();  // Not used by V8.
-          }
-        }
-      } else {
-        // vdup.size Qd, Rt.
-        NeonSize size = Neon32;
-        if (instr->Bit(5) != 0)
-          size = Neon16;
-        else if (instr->Bit(22) != 0)
-          size = Neon8;
-        int vd = instr->VFPNRegValue(kSimd128Precision);
-        int rt = instr->RtValue();
-        uint32_t rt_value = get_register(rt);
-        uint32_t q_data[4];
-        switch (size) {
-          case Neon8: {
-            rt_value &= 0xFF;
-            uint8_t* dst = reinterpret_cast<uint8_t*>(q_data);
-            for (int i = 0; i < 16; i++) {
-              dst[i] = rt_value;
-            }
-            break;
-          }
-          case Neon16: {
-            // Perform pairwise op.
-            rt_value &= 0xFFFFu;
-            uint32_t rt_rt = (rt_value << 16) | (rt_value & 0xFFFFu);
-            for (int i = 0; i < 4; i++) {
-              q_data[i] = rt_rt;
-            }
-            break;
-          }
-          case Neon32: {
-            for (int i = 0; i < 4; i++) {
-              q_data[i] = rt_value;
-            }
-            break;
-          }
-          default:
-            UNREACHABLE();
-            break;
-        }
-        set_neon_register(vd, q_data);
-      }
-    } else if ((instr->VLValue() == 0x1) && (instr->VCValue() == 0x1)) {
-      // vmov (scalar to ARM core register)
-      int vn = instr->VFPNRegValue(kDoublePrecision);
-      int rt = instr->RtValue();
-      int opc1_opc2 = (instr->Bits(22, 21) << 2) | instr->Bits(6, 5);
-      uint64_t data;
-      get_d_register(vn, &data);
-      if ((opc1_opc2 & 0xB) == 0) {
-        // NeonS32 / NeonU32
-        int32_t int_data[2];
-        memcpy(int_data, &data, sizeof(int_data));
-        set_register(rt, int_data[instr->Bit(21)]);
-      } else {
-        uint64_t data;
-        get_d_register(vn, &data);
-        bool u = instr->Bit(23) != 0;
-        if ((opc1_opc2 & 0x8) != 0) {
-          // NeonS8 / NeonU8
-          int i = opc1_opc2 & 0x7;
-          int shift = i * kBitsPerByte;
-          uint32_t scalar = (data >> shift) & 0xFFu;
-          if (!u && (scalar & 0x80) != 0) scalar |= 0xFFFFFF00;
-          set_register(rt, scalar);
-        } else if ((opc1_opc2 & 0x1) != 0) {
-          // NeonS16 / NeonU16
-          int i = (opc1_opc2 >> 1) & 0x3;
-          int shift = i * kBitsPerByte * kShortSize;
-          uint32_t scalar = (data >> shift) & 0xFFFFu;
-          if (!u && (scalar & 0x8000) != 0) scalar |= 0xFFFF0000;
-          set_register(rt, scalar);
-        } else {
-          UNREACHABLE();  // Not used by V8.
-        }
-      }
-    } else if ((instr->VLValue() == 0x1) &&
-               (instr->VCValue() == 0x0) &&
-               (instr->VAValue() == 0x7) &&
-               (instr->Bits(19, 16) == 0x1)) {
-      // vmrs
-      uint32_t rt = instr->RtValue();
-      if (rt == 0xF) {
-        Copy_FPSCR_to_APSR();
-      } else {
-        // Emulate FPSCR from the Simulator flags.
-        uint32_t fpscr = (n_flag_FPSCR_ << 31) |
-                         (z_flag_FPSCR_ << 30) |
-                         (c_flag_FPSCR_ << 29) |
-                         (v_flag_FPSCR_ << 28) |
-                         (FPSCR_default_NaN_mode_ << 25) |
-                         (inexact_vfp_flag_ << 4) |
-                         (underflow_vfp_flag_ << 3) |
-                         (overflow_vfp_flag_ << 2) |
-                         (div_zero_vfp_flag_ << 1) |
-                         (inv_op_vfp_flag_ << 0) |
-                         (FPSCR_rounding_mode_);
-        set_register(rt, fpscr);
-      }
-    } else if ((instr->VLValue() == 0x0) &&
-               (instr->VCValue() == 0x0) &&
-               (instr->VAValue() == 0x7) &&
-               (instr->Bits(19, 16) == 0x1)) {
-      // vmsr
-      uint32_t rt = instr->RtValue();
-      if (rt == pc) {
-        UNREACHABLE();
-      } else {
-        uint32_t rt_value = get_register(rt);
-        n_flag_FPSCR_ = (rt_value >> 31) & 1;
-        z_flag_FPSCR_ = (rt_value >> 30) & 1;
-        c_flag_FPSCR_ = (rt_value >> 29) & 1;
-        v_flag_FPSCR_ = (rt_value >> 28) & 1;
-        FPSCR_default_NaN_mode_ = (rt_value >> 25) & 1;
-        inexact_vfp_flag_ = (rt_value >> 4) & 1;
-        underflow_vfp_flag_ = (rt_value >> 3) & 1;
-        overflow_vfp_flag_ = (rt_value >> 2) & 1;
-        div_zero_vfp_flag_ = (rt_value >> 1) & 1;
-        inv_op_vfp_flag_ = (rt_value >> 0) & 1;
-        FPSCR_rounding_mode_ =
-            static_cast<VFPRoundingMode>((rt_value) & kVFPRoundingModeMask);
-      }
-    } else {
-      UNIMPLEMENTED();  // Not used by V8.
-    }
-  }
-}
-
-void Simulator::DecodeTypeCP15(Instruction* instr) {
-  DCHECK((instr->TypeValue() == 7) && (instr->Bit(24) == 0x0));
-  DCHECK_EQ(instr->CoprocessorValue(), 15);
-
-  if (instr->Bit(4) == 1) {
-    // mcr
-    int crn = instr->Bits(19, 16);
-    int crm = instr->Bits(3, 0);
-    int opc1 = instr->Bits(23, 21);
-    int opc2 = instr->Bits(7, 5);
-    if ((opc1 == 0) && (crn == 7)) {
-      // ARMv6 memory barrier operations.
-      // Details available in ARM DDI 0406C.b, B3-1750.
-      if (((crm == 10) && (opc2 == 5)) ||  // CP15DMB
-          ((crm == 10) && (opc2 == 4)) ||  // CP15DSB
-          ((crm == 5) && (opc2 == 4))) {   // CP15ISB
-        // These are ignored by the simulator for now.
-      } else {
-        UNIMPLEMENTED();
-      }
-    }
-  } else {
-    UNIMPLEMENTED();
-  }
-}
-
-void Simulator::DecodeVMOVBetweenCoreAndSinglePrecisionRegisters(
-    Instruction* instr) {
-  DCHECK((instr->Bit(4) == 1) && (instr->VCValue() == 0x0) &&
-         (instr->VAValue() == 0x0));
-
-  int t = instr->RtValue();
-  int n = instr->VFPNRegValue(kSinglePrecision);
-  bool to_arm_register = (instr->VLValue() == 0x1);
-
-  if (to_arm_register) {
-    int32_t int_value = get_sinteger_from_s_register(n);
-    set_register(t, int_value);
-  } else {
-    int32_t rs_val = get_register(t);
-    set_s_register_from_sinteger(n, rs_val);
-  }
-}
-
-
-void Simulator::DecodeVCMP(Instruction* instr) {
-  DCHECK((instr->Bit(4) == 0) && (instr->Opc1Value() == 0x7));
-  DCHECK(((instr->Opc2Value() == 0x4) || (instr->Opc2Value() == 0x5)) &&
-         (instr->Opc3Value() & 0x1));
-  // Comparison.
-
-  VFPRegPrecision precision = kSinglePrecision;
-  if (instr->SzValue() == 0x1) {
-    precision = kDoublePrecision;
-  }
-
-  int d = instr->VFPDRegValue(precision);
-  int m = 0;
-  if (instr->Opc2Value() == 0x4) {
-    m = instr->VFPMRegValue(precision);
-  }
-
-  if (precision == kDoublePrecision) {
-    double dd_value = get_double_from_d_register(d).get_scalar();
-    double dm_value = 0.0;
-    if (instr->Opc2Value() == 0x4) {
-      dm_value = get_double_from_d_register(m).get_scalar();
-    }
-
-    // Raise exceptions for quiet NaNs if necessary.
-    if (instr->Bit(7) == 1) {
-      if (std::isnan(dd_value)) {
-        inv_op_vfp_flag_ = true;
-      }
-    }
-
-    Compute_FPSCR_Flags(dd_value, dm_value);
-  } else {
-    float sd_value = get_float_from_s_register(d).get_scalar();
-    float sm_value = 0.0;
-    if (instr->Opc2Value() == 0x4) {
-      sm_value = get_float_from_s_register(m).get_scalar();
-    }
-
-    // Raise exceptions for quiet NaNs if necessary.
-    if (instr->Bit(7) == 1) {
-      if (std::isnan(sd_value)) {
-        inv_op_vfp_flag_ = true;
-      }
-    }
-
-    Compute_FPSCR_Flags(sd_value, sm_value);
-  }
-}
-
-
-void Simulator::DecodeVCVTBetweenDoubleAndSingle(Instruction* instr) {
-  DCHECK((instr->Bit(4) == 0) && (instr->Opc1Value() == 0x7));
-  DCHECK((instr->Opc2Value() == 0x7) && (instr->Opc3Value() == 0x3));
-
-  VFPRegPrecision dst_precision = kDoublePrecision;
-  VFPRegPrecision src_precision = kSinglePrecision;
-  if (instr->SzValue() == 1) {
-    dst_precision = kSinglePrecision;
-    src_precision = kDoublePrecision;
-  }
-
-  int dst = instr->VFPDRegValue(dst_precision);
-  int src = instr->VFPMRegValue(src_precision);
-
-  if (dst_precision == kSinglePrecision) {
-    double val = get_double_from_d_register(src).get_scalar();
-    set_s_register_from_float(dst, static_cast<float>(val));
-  } else {
-    float val = get_float_from_s_register(src).get_scalar();
-    set_d_register_from_double(dst, static_cast<double>(val));
-  }
-}
-
-bool get_inv_op_vfp_flag(VFPRoundingMode mode,
-                         double val,
-                         bool unsigned_) {
-  DCHECK((mode == RN) || (mode == RM) || (mode == RZ));
-  double max_uint = static_cast<double>(0xFFFFFFFFu);
-  double max_int = static_cast<double>(kMaxInt);
-  double min_int = static_cast<double>(kMinInt);
-
-  // Check for NaN.
-  if (val != val) {
-    return true;
-  }
-
-  // Check for overflow. This code works because 32bit integers can be
-  // exactly represented by ieee-754 64bit floating-point values.
-  switch (mode) {
-    case RN:
-      return  unsigned_ ? (val >= (max_uint + 0.5)) ||
-                          (val < -0.5)
-                        : (val >= (max_int + 0.5)) ||
-                          (val < (min_int - 0.5));
-
-    case RM:
-      return  unsigned_ ? (val >= (max_uint + 1.0)) ||
-                          (val < 0)
-                        : (val >= (max_int + 1.0)) ||
-                          (val < min_int);
-
-    case RZ:
-      return  unsigned_ ? (val >= (max_uint + 1.0)) ||
-                          (val <= -1)
-                        : (val >= (max_int + 1.0)) ||
-                          (val <= (min_int - 1.0));
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-// We call this function only if we had a vfp invalid exception.
-// It returns the correct saturated value.
-int VFPConversionSaturate(double val, bool unsigned_res) {
-  if (val != val) {
-    return 0;
-  } else {
-    if (unsigned_res) {
-      return (val < 0) ? 0 : 0xFFFFFFFFu;
-    } else {
-      return (val < 0) ? kMinInt : kMaxInt;
-    }
-  }
-}
-
-int32_t Simulator::ConvertDoubleToInt(double val, bool unsigned_integer,
-                                      VFPRoundingMode mode) {
-  int32_t result =
-      unsigned_integer ? static_cast<uint32_t>(val) : static_cast<int32_t>(val);
-
-  inv_op_vfp_flag_ = get_inv_op_vfp_flag(mode, val, unsigned_integer);
-
-  double abs_diff = unsigned_integer
-                        ? std::fabs(val - static_cast<uint32_t>(result))
-                        : std::fabs(val - result);
-
-  inexact_vfp_flag_ = (abs_diff != 0);
-
-  if (inv_op_vfp_flag_) {
-    result = VFPConversionSaturate(val, unsigned_integer);
-  } else {
-    switch (mode) {
-      case RN: {
-        int val_sign = (val > 0) ? 1 : -1;
-        if (abs_diff > 0.5) {
-          result += val_sign;
-        } else if (abs_diff == 0.5) {
-          // Round to even if exactly halfway.
-          result = ((result % 2) == 0) ? result : result + val_sign;
-        }
-        break;
-      }
-
-      case RM:
-        result = result > val ? result - 1 : result;
-        break;
-
-      case RZ:
-        // Nothing to do.
-        break;
-
-      default:
-        UNREACHABLE();
-    }
-  }
-  return result;
-}
-
-void Simulator::DecodeVCVTBetweenFloatingPointAndInteger(Instruction* instr) {
-  DCHECK((instr->Bit(4) == 0) && (instr->Opc1Value() == 0x7) &&
-         (instr->Bits(27, 23) == 0x1D));
-  DCHECK(((instr->Opc2Value() == 0x8) && (instr->Opc3Value() & 0x1)) ||
-         (((instr->Opc2Value() >> 1) == 0x6) && (instr->Opc3Value() & 0x1)));
-
-  // Conversion between floating-point and integer.
-  bool to_integer = (instr->Bit(18) == 1);
-
-  VFPRegPrecision src_precision = (instr->SzValue() == 1) ? kDoublePrecision
-                                                          : kSinglePrecision;
-
-  if (to_integer) {
-    // We are playing with code close to the C++ standard's limits below,
-    // hence the very simple code and heavy checks.
-    //
-    // Note:
-    // C++ defines default type casting from floating point to integer as
-    // (close to) rounding toward zero ("fractional part discarded").
-
-    int dst = instr->VFPDRegValue(kSinglePrecision);
-    int src = instr->VFPMRegValue(src_precision);
-
-    // Bit 7 in vcvt instructions indicates if we should use the FPSCR rounding
-    // mode or the default Round to Zero mode.
-    VFPRoundingMode mode = (instr->Bit(7) != 1) ? FPSCR_rounding_mode_
-                                                : RZ;
-    DCHECK((mode == RM) || (mode == RZ) || (mode == RN));
-
-    bool unsigned_integer = (instr->Bit(16) == 0);
-    bool double_precision = (src_precision == kDoublePrecision);
-
-    double val = double_precision ? get_double_from_d_register(src).get_scalar()
-                                  : get_float_from_s_register(src).get_scalar();
-
-    int32_t temp = ConvertDoubleToInt(val, unsigned_integer, mode);
-
-    // Update the destination register.
-    set_s_register_from_sinteger(dst, temp);
-
-  } else {
-    bool unsigned_integer = (instr->Bit(7) == 0);
-
-    int dst = instr->VFPDRegValue(src_precision);
-    int src = instr->VFPMRegValue(kSinglePrecision);
-
-    int val = get_sinteger_from_s_register(src);
-
-    if (src_precision == kDoublePrecision) {
-      if (unsigned_integer) {
-        set_d_register_from_double(
-            dst, static_cast<double>(static_cast<uint32_t>(val)));
-      } else {
-        set_d_register_from_double(dst, static_cast<double>(val));
-      }
-    } else {
-      if (unsigned_integer) {
-        set_s_register_from_float(
-            dst, static_cast<float>(static_cast<uint32_t>(val)));
-      } else {
-        set_s_register_from_float(dst, static_cast<float>(val));
-      }
-    }
-  }
-}
-
-
-// void Simulator::DecodeType6CoprocessorIns(Instruction* instr)
-// Decode Type 6 coprocessor instructions.
-// Dm = vmov(Rt, Rt2)
-// <Rt, Rt2> = vmov(Dm)
-// Ddst = MEM(Rbase + 4*offset).
-// MEM(Rbase + 4*offset) = Dsrc.
-void Simulator::DecodeType6CoprocessorIns(Instruction* instr) {
-  DCHECK_EQ(instr->TypeValue(), 6);
-
-  if (instr->CoprocessorValue() == 0xA) {
-    switch (instr->OpcodeValue()) {
-      case 0x8:
-      case 0xA:
-      case 0xC:
-      case 0xE: {  // Load and store single precision float to memory.
-        int rn = instr->RnValue();
-        int vd = instr->VFPDRegValue(kSinglePrecision);
-        int offset = instr->Immed8Value();
-        if (!instr->HasU()) {
-          offset = -offset;
-        }
-
-        int32_t address = get_register(rn) + 4 * offset;
-        // Load and store address for singles must be at least four-byte
-        // aligned.
-        DCHECK_EQ(address % 4, 0);
-        if (instr->HasL()) {
-          // Load single from memory: vldr.
-          set_s_register_from_sinteger(vd, ReadW(address, instr));
-        } else {
-          // Store single to memory: vstr.
-          WriteW(address, get_sinteger_from_s_register(vd), instr);
-        }
-        break;
-      }
-      case 0x4:
-      case 0x5:
-      case 0x6:
-      case 0x7:
-      case 0x9:
-      case 0xB:
-        // Load/store multiple single from memory: vldm/vstm.
-        HandleVList(instr);
-        break;
-      default:
-        UNIMPLEMENTED();  // Not used by V8.
-    }
-  } else if (instr->CoprocessorValue() == 0xB) {
-    switch (instr->OpcodeValue()) {
-      case 0x2:
-        // Load and store double to two GP registers
-        if (instr->Bits(7, 6) != 0 || instr->Bit(4) != 1) {
-          UNIMPLEMENTED();  // Not used by V8.
-        } else {
-          int rt = instr->RtValue();
-          int rn = instr->RnValue();
-          int vm = instr->VFPMRegValue(kDoublePrecision);
-          if (instr->HasL()) {
-            uint32_t data[2];
-            get_d_register(vm, data);
-            set_register(rt, data[0]);
-            set_register(rn, data[1]);
-          } else {
-            int32_t data[] = { get_register(rt), get_register(rn) };
-            set_d_register(vm, reinterpret_cast<uint32_t*>(data));
-          }
-        }
-        break;
-      case 0x8:
-      case 0xA:
-      case 0xC:
-      case 0xE: {  // Load and store double to memory.
-        int rn = instr->RnValue();
-        int vd = instr->VFPDRegValue(kDoublePrecision);
-        int offset = instr->Immed8Value();
-        if (!instr->HasU()) {
-          offset = -offset;
-        }
-        int32_t address = get_register(rn) + 4 * offset;
-        // Load and store address for doubles must be at least four-byte
-        // aligned.
-        DCHECK_EQ(address % 4, 0);
-        if (instr->HasL()) {
-          // Load double from memory: vldr.
-          int32_t data[] = {
-            ReadW(address, instr),
-            ReadW(address + 4, instr)
-          };
-          set_d_register(vd, reinterpret_cast<uint32_t*>(data));
-        } else {
-          // Store double to memory: vstr.
-          uint32_t data[2];
-          get_d_register(vd, data);
-          WriteW(address, data[0], instr);
-          WriteW(address + 4, data[1], instr);
-        }
-        break;
-      }
-      case 0x4:
-      case 0x5:
-      case 0x6:
-      case 0x7:
-      case 0x9:
-      case 0xB:
-        // Load/store multiple double from memory: vldm/vstm.
-        HandleVList(instr);
-        break;
-      default:
-        UNIMPLEMENTED();  // Not used by V8.
-    }
-  } else {
-    UNIMPLEMENTED();  // Not used by V8.
-  }
-}
-
-// Templated operations for NEON instructions.
-template <typename T, typename U>
-U Widen(T value) {
-  static_assert(sizeof(int64_t) > sizeof(T), "T must be int32_t or smaller");
-  static_assert(sizeof(U) > sizeof(T), "T must smaller than U");
-  return static_cast<U>(value);
-}
-
-template <typename T, typename U>
-U Narrow(T value) {
-  static_assert(sizeof(int8_t) < sizeof(T), "T must be int16_t or larger");
-  static_assert(sizeof(U) < sizeof(T), "T must larger than U");
-  static_assert(std::is_unsigned<T>() == std::is_unsigned<U>(),
-                "Signed-ness of T and U must match");
-  // Make sure value can be expressed in the smaller type; otherwise, the
-  // casted result is implementation defined.
-  DCHECK_LE(std::numeric_limits<T>::min(), value);
-  DCHECK_GE(std::numeric_limits<T>::max(), value);
-  return static_cast<U>(value);
-}
-
-template <typename T>
-T Clamp(int64_t value) {
-  static_assert(sizeof(int64_t) > sizeof(T), "T must be int32_t or smaller");
-  int64_t min = static_cast<int64_t>(std::numeric_limits<T>::min());
-  int64_t max = static_cast<int64_t>(std::numeric_limits<T>::max());
-  int64_t clamped = std::max(min, std::min(max, value));
-  return static_cast<T>(clamped);
-}
-
-template <typename T, typename U>
-void Widen(Simulator* simulator, int Vd, int Vm) {
-  static const int kLanes = 8 / sizeof(T);
-  T src[kLanes];
-  U dst[kLanes];
-  simulator->get_neon_register<T, kDoubleSize>(Vm, src);
-  for (int i = 0; i < kLanes; i++) {
-    dst[i] = Widen<T, U>(src[i]);
-  }
-  simulator->set_neon_register(Vd, dst);
-}
-
-template <typename T, int SIZE>
-void Abs(Simulator* simulator, int Vd, int Vm) {
-  static const int kElems = SIZE / sizeof(T);
-  T src[kElems];
-  simulator->get_neon_register<T, SIZE>(Vm, src);
-  for (int i = 0; i < kElems; i++) {
-    src[i] = std::abs(src[i]);
-  }
-  simulator->set_neon_register<T, SIZE>(Vd, src);
-}
-
-template <typename T, int SIZE>
-void Neg(Simulator* simulator, int Vd, int Vm) {
-  static const int kElems = SIZE / sizeof(T);
-  T src[kElems];
-  simulator->get_neon_register<T, SIZE>(Vm, src);
-  for (int i = 0; i < kElems; i++) {
-    src[i] = -src[i];
-  }
-  simulator->set_neon_register<T, SIZE>(Vd, src);
-}
-
-template <typename T, typename U>
-void SaturatingNarrow(Simulator* simulator, int Vd, int Vm) {
-  static const int kLanes = 16 / sizeof(T);
-  T src[kLanes];
-  U dst[kLanes];
-  simulator->get_neon_register(Vm, src);
-  for (int i = 0; i < kLanes; i++) {
-    dst[i] = Narrow<T, U>(Clamp<U>(src[i]));
-  }
-  simulator->set_neon_register<U, kDoubleSize>(Vd, dst);
-}
-
-template <typename T>
-void AddSaturate(Simulator* simulator, int Vd, int Vm, int Vn) {
-  static const int kLanes = 16 / sizeof(T);
-  T src1[kLanes], src2[kLanes];
-  simulator->get_neon_register(Vn, src1);
-  simulator->get_neon_register(Vm, src2);
-  for (int i = 0; i < kLanes; i++) {
-    src1[i] = Clamp<T>(Widen<T, int64_t>(src1[i]) + Widen<T, int64_t>(src2[i]));
-  }
-  simulator->set_neon_register(Vd, src1);
-}
-
-template <typename T>
-void SubSaturate(Simulator* simulator, int Vd, int Vm, int Vn) {
-  static const int kLanes = 16 / sizeof(T);
-  T src1[kLanes], src2[kLanes];
-  simulator->get_neon_register(Vn, src1);
-  simulator->get_neon_register(Vm, src2);
-  for (int i = 0; i < kLanes; i++) {
-    src1[i] = Clamp<T>(Widen<T, int64_t>(src1[i]) - Widen<T, int64_t>(src2[i]));
-  }
-  simulator->set_neon_register(Vd, src1);
-}
-
-template <typename T, int SIZE>
-void Zip(Simulator* simulator, int Vd, int Vm) {
-  static const int kElems = SIZE / sizeof(T);
-  static const int kPairs = kElems / 2;
-  T src1[kElems], src2[kElems], dst1[kElems], dst2[kElems];
-  simulator->get_neon_register<T, SIZE>(Vd, src1);
-  simulator->get_neon_register<T, SIZE>(Vm, src2);
-  for (int i = 0; i < kPairs; i++) {
-    dst1[i * 2] = src1[i];
-    dst1[i * 2 + 1] = src2[i];
-    dst2[i * 2] = src1[i + kPairs];
-    dst2[i * 2 + 1] = src2[i + kPairs];
-  }
-  simulator->set_neon_register<T, SIZE>(Vd, dst1);
-  simulator->set_neon_register<T, SIZE>(Vm, dst2);
-}
-
-template <typename T, int SIZE>
-void Unzip(Simulator* simulator, int Vd, int Vm) {
-  static const int kElems = SIZE / sizeof(T);
-  static const int kPairs = kElems / 2;
-  T src1[kElems], src2[kElems], dst1[kElems], dst2[kElems];
-  simulator->get_neon_register<T, SIZE>(Vd, src1);
-  simulator->get_neon_register<T, SIZE>(Vm, src2);
-  for (int i = 0; i < kPairs; i++) {
-    dst1[i] = src1[i * 2];
-    dst1[i + kPairs] = src2[i * 2];
-    dst2[i] = src1[i * 2 + 1];
-    dst2[i + kPairs] = src2[i * 2 + 1];
-  }
-  simulator->set_neon_register<T, SIZE>(Vd, dst1);
-  simulator->set_neon_register<T, SIZE>(Vm, dst2);
-}
-
-template <typename T, int SIZE>
-void Transpose(Simulator* simulator, int Vd, int Vm) {
-  static const int kElems = SIZE / sizeof(T);
-  static const int kPairs = kElems / 2;
-  T src1[kElems], src2[kElems];
-  simulator->get_neon_register<T, SIZE>(Vd, src1);
-  simulator->get_neon_register<T, SIZE>(Vm, src2);
-  for (int i = 0; i < kPairs; i++) {
-    std::swap(src1[2 * i + 1], src2[2 * i]);
-  }
-  simulator->set_neon_register<T, SIZE>(Vd, src1);
-  simulator->set_neon_register<T, SIZE>(Vm, src2);
-}
-
-template <typename T, int SIZE>
-void Test(Simulator* simulator, int Vd, int Vm, int Vn) {
-  static const int kElems = SIZE / sizeof(T);
-  T src1[kElems], src2[kElems];
-  simulator->get_neon_register<T, SIZE>(Vn, src1);
-  simulator->get_neon_register<T, SIZE>(Vm, src2);
-  for (int i = 0; i < kElems; i++) {
-    src1[i] = (src1[i] & src2[i]) != 0 ? -1 : 0;
-  }
-  simulator->set_neon_register<T, SIZE>(Vd, src1);
-}
-
-template <typename T, int SIZE>
-void Add(Simulator* simulator, int Vd, int Vm, int Vn) {
-  static const int kElems = SIZE / sizeof(T);
-  T src1[kElems], src2[kElems];
-  simulator->get_neon_register<T, SIZE>(Vn, src1);
-  simulator->get_neon_register<T, SIZE>(Vm, src2);
-  for (int i = 0; i < kElems; i++) {
-    src1[i] += src2[i];
-  }
-  simulator->set_neon_register<T, SIZE>(Vd, src1);
-}
-
-template <typename T, int SIZE>
-void Sub(Simulator* simulator, int Vd, int Vm, int Vn) {
-  static const int kElems = SIZE / sizeof(T);
-  T src1[kElems], src2[kElems];
-  simulator->get_neon_register<T, SIZE>(Vn, src1);
-  simulator->get_neon_register<T, SIZE>(Vm, src2);
-  for (int i = 0; i < kElems; i++) {
-    src1[i] -= src2[i];
-  }
-  simulator->set_neon_register<T, SIZE>(Vd, src1);
-}
-
-template <typename T, int SIZE>
-void Mul(Simulator* simulator, int Vd, int Vm, int Vn) {
-  static const int kElems = SIZE / sizeof(T);
-  T src1[kElems], src2[kElems];
-  simulator->get_neon_register<T, SIZE>(Vn, src1);
-  simulator->get_neon_register<T, SIZE>(Vm, src2);
-  for (int i = 0; i < kElems; i++) {
-    src1[i] *= src2[i];
-  }
-  simulator->set_neon_register<T, SIZE>(Vd, src1);
-}
-
-template <typename T, int SIZE>
-void ShiftLeft(Simulator* simulator, int Vd, int Vm, int shift) {
-  static const int kElems = SIZE / sizeof(T);
-  T src[kElems];
-  simulator->get_neon_register<T, SIZE>(Vm, src);
-  for (int i = 0; i < kElems; i++) {
-    src[i] <<= shift;
-  }
-  simulator->set_neon_register<T, SIZE>(Vd, src);
-}
-
-template <typename T, int SIZE>
-void ShiftRight(Simulator* simulator, int Vd, int Vm, int shift) {
-  static const int kElems = SIZE / sizeof(T);
-  T src[kElems];
-  simulator->get_neon_register<T, SIZE>(Vm, src);
-  for (int i = 0; i < kElems; i++) {
-    src[i] >>= shift;
-  }
-  simulator->set_neon_register<T, SIZE>(Vd, src);
-}
-
-template <typename T, int SIZE>
-void ArithmeticShiftRight(Simulator* simulator, int Vd, int Vm, int shift) {
-  static const int kElems = SIZE / sizeof(T);
-  T src[kElems];
-  simulator->get_neon_register<T, SIZE>(Vm, src);
-  for (int i = 0; i < kElems; i++) {
-    src[i] = ArithmeticShiftRight(src[i], shift);
-  }
-  simulator->set_neon_register<T, SIZE>(Vd, src);
-}
-
-template <typename T, int SIZE>
-void ShiftLeftAndInsert(Simulator* simulator, int Vd, int Vm, int shift) {
-  static const int kElems = SIZE / sizeof(T);
-  T src[kElems];
-  T dst[kElems];
-  simulator->get_neon_register<T, SIZE>(Vm, src);
-  simulator->get_neon_register<T, SIZE>(Vd, dst);
-  uint64_t mask = (1llu << shift) - 1llu;
-  for (int i = 0; i < kElems; i++) {
-    dst[i] = (src[i] << shift) | (dst[i] & mask);
-  }
-  simulator->set_neon_register<T, SIZE>(Vd, dst);
-}
-
-template <typename T, int SIZE>
-void ShiftRightAndInsert(Simulator* simulator, int Vd, int Vm, int shift) {
-  static const int kElems = SIZE / sizeof(T);
-  T src[kElems];
-  T dst[kElems];
-  simulator->get_neon_register<T, SIZE>(Vm, src);
-  simulator->get_neon_register<T, SIZE>(Vd, dst);
-  uint64_t mask = ~((1llu << (kBitsPerByte * SIZE - shift)) - 1llu);
-  for (int i = 0; i < kElems; i++) {
-    dst[i] = (src[i] >> shift) | (dst[i] & mask);
-  }
-  simulator->set_neon_register<T, SIZE>(Vd, dst);
-}
-
-template <typename T, int SIZE>
-void CompareEqual(Simulator* simulator, int Vd, int Vm, int Vn) {
-  static const int kElems = SIZE / sizeof(T);
-  T src1[kElems], src2[kElems];
-  simulator->get_neon_register<T, SIZE>(Vn, src1);
-  simulator->get_neon_register<T, SIZE>(Vm, src2);
-  for (int i = 0; i < kElems; i++) {
-    src1[i] = src1[i] == src2[i] ? -1 : 0;
-  }
-  simulator->set_neon_register<T, SIZE>(Vd, src1);
-}
-
-template <typename T, int SIZE>
-void CompareGreater(Simulator* simulator, int Vd, int Vm, int Vn, bool ge) {
-  static const int kElems = SIZE / sizeof(T);
-  T src1[kElems], src2[kElems];
-  simulator->get_neon_register<T, SIZE>(Vn, src1);
-  simulator->get_neon_register<T, SIZE>(Vm, src2);
-  for (int i = 0; i < kElems; i++) {
-    if (ge)
-      src1[i] = src1[i] >= src2[i] ? -1 : 0;
-    else
-      src1[i] = src1[i] > src2[i] ? -1 : 0;
-  }
-  simulator->set_neon_register<T, SIZE>(Vd, src1);
-}
-
-template <typename T>
-T MinMax(T a, T b, bool is_min) {
-  return is_min ? std::min(a, b) : std::max(a, b);
-}
-
-template <typename T, int SIZE>
-void MinMax(Simulator* simulator, int Vd, int Vm, int Vn, bool min) {
-  static const int kElems = SIZE / sizeof(T);
-  T src1[kElems], src2[kElems];
-  simulator->get_neon_register<T, SIZE>(Vn, src1);
-  simulator->get_neon_register<T, SIZE>(Vm, src2);
-  for (int i = 0; i < kElems; i++) {
-    src1[i] = MinMax(src1[i], src2[i], min);
-  }
-  simulator->set_neon_register<T, SIZE>(Vd, src1);
-}
-
-template <typename T>
-void PairwiseMinMax(Simulator* simulator, int Vd, int Vm, int Vn, bool min) {
-  static const int kElems = kDoubleSize / sizeof(T);
-  static const int kPairs = kElems / 2;
-  T dst[kElems], src1[kElems], src2[kElems];
-  simulator->get_neon_register<T, kDoubleSize>(Vn, src1);
-  simulator->get_neon_register<T, kDoubleSize>(Vm, src2);
-  for (int i = 0; i < kPairs; i++) {
-    dst[i] = MinMax(src1[i * 2], src1[i * 2 + 1], min);
-    dst[i + kPairs] = MinMax(src2[i * 2], src2[i * 2 + 1], min);
-  }
-  simulator->set_neon_register<T, kDoubleSize>(Vd, dst);
-}
-
-template <typename T>
-void PairwiseAdd(Simulator* simulator, int Vd, int Vm, int Vn) {
-  static const int kElems = kDoubleSize / sizeof(T);
-  static const int kPairs = kElems / 2;
-  T dst[kElems], src1[kElems], src2[kElems];
-  simulator->get_neon_register<T, kDoubleSize>(Vn, src1);
-  simulator->get_neon_register<T, kDoubleSize>(Vm, src2);
-  for (int i = 0; i < kPairs; i++) {
-    dst[i] = src1[i * 2] + src1[i * 2 + 1];
-    dst[i + kPairs] = src2[i * 2] + src2[i * 2 + 1];
-  }
-  simulator->set_neon_register<T, kDoubleSize>(Vd, dst);
-}
-
-void Simulator::DecodeSpecialCondition(Instruction* instr) {
-  switch (instr->SpecialValue()) {
-    case 4: {
-      int Vd, Vm, Vn;
-      if (instr->Bit(6) == 0) {
-        Vd = instr->VFPDRegValue(kDoublePrecision);
-        Vm = instr->VFPMRegValue(kDoublePrecision);
-        Vn = instr->VFPNRegValue(kDoublePrecision);
-      } else {
-        Vd = instr->VFPDRegValue(kSimd128Precision);
-        Vm = instr->VFPMRegValue(kSimd128Precision);
-        Vn = instr->VFPNRegValue(kSimd128Precision);
-      }
-      switch (instr->Bits(11, 8)) {
-        case 0x0: {
-          if (instr->Bit(4) == 1) {
-            // vqadd.s<size> Qd, Qm, Qn.
-            NeonSize size = static_cast<NeonSize>(instr->Bits(21, 20));
-            switch (size) {
-              case Neon8:
-                AddSaturate<int8_t>(this, Vd, Vm, Vn);
-                break;
-              case Neon16:
-                AddSaturate<int16_t>(this, Vd, Vm, Vn);
-                break;
-              case Neon32:
-                AddSaturate<int32_t>(this, Vd, Vm, Vn);
-                break;
-              default:
-                UNREACHABLE();
-                break;
-            }
-          } else {
-            UNIMPLEMENTED();
-          }
-          break;
-        }
-        case 0x1: {
-          if (instr->Bits(21, 20) == 2 && instr->Bit(6) == 1 &&
-              instr->Bit(4) == 1) {
-            // vmov Qd, Qm.
-            // vorr, Qd, Qm, Qn.
-            uint32_t src1[4];
-            get_neon_register(Vm, src1);
-            if (Vm != Vn) {
-              uint32_t src2[4];
-              get_neon_register(Vn, src2);
-              for (int i = 0; i < 4; i++) {
-                src1[i] = src1[i] | src2[i];
-              }
-            }
-            set_neon_register(Vd, src1);
-          } else if (instr->Bits(21, 20) == 0 && instr->Bit(6) == 1 &&
-                     instr->Bit(4) == 1) {
-            // vand Qd, Qm, Qn.
-            uint32_t src1[4], src2[4];
-            get_neon_register(Vn, src1);
-            get_neon_register(Vm, src2);
-            for (int i = 0; i < 4; i++) {
-              src1[i] = src1[i] & src2[i];
-            }
-            set_neon_register(Vd, src1);
-          } else {
-            UNIMPLEMENTED();
-          }
-          break;
-        }
-        case 0x2: {
-          if (instr->Bit(4) == 1) {
-            // vqsub.s<size> Qd, Qm, Qn.
-            NeonSize size = static_cast<NeonSize>(instr->Bits(21, 20));
-            switch (size) {
-              case Neon8:
-                SubSaturate<int8_t>(this, Vd, Vm, Vn);
-                break;
-              case Neon16:
-                SubSaturate<int16_t>(this, Vd, Vm, Vn);
-                break;
-              case Neon32:
-                SubSaturate<int32_t>(this, Vd, Vm, Vn);
-                break;
-              default:
-                UNREACHABLE();
-                break;
-            }
-          } else {
-            UNIMPLEMENTED();
-          }
-          break;
-        }
-        case 0x3: {
-          // vcge/vcgt.s<size> Qd, Qm, Qn.
-          bool ge = instr->Bit(4) == 1;
-          NeonSize size = static_cast<NeonSize>(instr->Bits(21, 20));
-          switch (size) {
-            case Neon8:
-              CompareGreater<int8_t, kSimd128Size>(this, Vd, Vm, Vn, ge);
-              break;
-            case Neon16:
-              CompareGreater<int16_t, kSimd128Size>(this, Vd, Vm, Vn, ge);
-              break;
-            case Neon32:
-              CompareGreater<int32_t, kSimd128Size>(this, Vd, Vm, Vn, ge);
-              break;
-            default:
-              UNREACHABLE();
-              break;
-          }
-          break;
-        }
-        case 0x6: {
-          // vmin/vmax.s<size> Qd, Qm, Qn.
-          NeonSize size = static_cast<NeonSize>(instr->Bits(21, 20));
-          bool min = instr->Bit(4) != 0;
-          switch (size) {
-            case Neon8:
-              MinMax<int8_t, kSimd128Size>(this, Vd, Vm, Vn, min);
-              break;
-            case Neon16:
-              MinMax<int16_t, kSimd128Size>(this, Vd, Vm, Vn, min);
-              break;
-            case Neon32:
-              MinMax<int32_t, kSimd128Size>(this, Vd, Vm, Vn, min);
-              break;
-            default:
-              UNREACHABLE();
-              break;
-          }
-          break;
-        }
-        case 0x8: {
-          // vadd/vtst
-          NeonSize size = static_cast<NeonSize>(instr->Bits(21, 20));
-          if (instr->Bit(4) == 0) {
-            // vadd.i<size> Qd, Qm, Qn.
-            switch (size) {
-              case Neon8:
-                Add<uint8_t, kSimd128Size>(this, Vd, Vm, Vn);
-                break;
-              case Neon16:
-                Add<uint16_t, kSimd128Size>(this, Vd, Vm, Vn);
-                break;
-              case Neon32:
-                Add<uint32_t, kSimd128Size>(this, Vd, Vm, Vn);
-                break;
-              default:
-                UNREACHABLE();
-                break;
-            }
-          } else {
-            // vtst.i<size> Qd, Qm, Qn.
-            switch (size) {
-              case Neon8:
-                Test<uint8_t, kSimd128Size>(this, Vd, Vm, Vn);
-                break;
-              case Neon16:
-                Test<uint16_t, kSimd128Size>(this, Vd, Vm, Vn);
-                break;
-              case Neon32:
-                Test<uint32_t, kSimd128Size>(this, Vd, Vm, Vn);
-                break;
-              default:
-                UNREACHABLE();
-                break;
-            }
-          }
-          break;
-        }
-        case 0x9: {
-          if (instr->Bit(6) == 1 && instr->Bit(4) == 1) {
-            // vmul.i<size> Qd, Qm, Qn.
-            NeonSize size = static_cast<NeonSize>(instr->Bits(21, 20));
-            switch (size) {
-              case Neon8:
-                Mul<uint8_t, kSimd128Size>(this, Vd, Vm, Vn);
-                break;
-              case Neon16:
-                Mul<uint16_t, kSimd128Size>(this, Vd, Vm, Vn);
-                break;
-              case Neon32:
-                Mul<uint32_t, kSimd128Size>(this, Vd, Vm, Vn);
-                break;
-              default:
-                UNREACHABLE();
-                break;
-            }
-          } else {
-            UNIMPLEMENTED();
-          }
-          break;
-        }
-        case 0xA: {
-          // vpmin/vpmax.s<size> Dd, Dm, Dn.
-          NeonSize size = static_cast<NeonSize>(instr->Bits(21, 20));
-          bool min = instr->Bit(4) != 0;
-          switch (size) {
-            case Neon8:
-              PairwiseMinMax<int8_t>(this, Vd, Vm, Vn, min);
-              break;
-            case Neon16:
-              PairwiseMinMax<int16_t>(this, Vd, Vm, Vn, min);
-              break;
-            case Neon32:
-              PairwiseMinMax<int32_t>(this, Vd, Vm, Vn, min);
-              break;
-            default:
-              UNREACHABLE();
-              break;
-          }
-          break;
-        }
-        case 0xB: {
-          // vpadd.i<size> Dd, Dm, Dn.
-          NeonSize size = static_cast<NeonSize>(instr->Bits(21, 20));
-          switch (size) {
-            case Neon8:
-              PairwiseAdd<int8_t>(this, Vd, Vm, Vn);
-              break;
-            case Neon16:
-              PairwiseAdd<int16_t>(this, Vd, Vm, Vn);
-              break;
-            case Neon32:
-              PairwiseAdd<int32_t>(this, Vd, Vm, Vn);
-              break;
-            default:
-              UNREACHABLE();
-              break;
-          }
-          break;
-        }
-        case 0xD: {
-          if (instr->Bit(4) == 0) {
-            float src1[4], src2[4];
-            get_neon_register(Vn, src1);
-            get_neon_register(Vm, src2);
-            for (int i = 0; i < 4; i++) {
-              if (instr->Bit(21) == 0) {
-                // vadd.f32 Qd, Qm, Qn.
-                src1[i] = src1[i] + src2[i];
-              } else {
-                // vsub.f32 Qd, Qm, Qn.
-                src1[i] = src1[i] - src2[i];
-              }
-            }
-            set_neon_register(Vd, src1);
-          } else {
-            UNIMPLEMENTED();
-          }
-          break;
-        }
-        case 0xE: {
-          if (instr->Bits(21, 20) == 0 && instr->Bit(4) == 0) {
-            // vceq.f32.
-            float src1[4], src2[4];
-            get_neon_register(Vn, src1);
-            get_neon_register(Vm, src2);
-            uint32_t dst[4];
-            for (int i = 0; i < 4; i++) {
-              dst[i] = (src1[i] == src2[i]) ? 0xFFFFFFFF : 0;
-            }
-            set_neon_register(Vd, dst);
-          } else {
-            UNIMPLEMENTED();
-          }
-          break;
-        }
-        case 0xF: {
-          if (instr->Bit(20) == 0 && instr->Bit(6) == 1) {
-            float src1[4], src2[4];
-            get_neon_register(Vn, src1);
-            get_neon_register(Vm, src2);
-            if (instr->Bit(4) == 1) {
-              if (instr->Bit(21) == 0) {
-                // vrecps.f32 Qd, Qm, Qn.
-                for (int i = 0; i < 4; i++) {
-                  src1[i] = 2.0f - src1[i] * src2[i];
-                }
-              } else {
-                // vrsqrts.f32 Qd, Qm, Qn.
-                for (int i = 0; i < 4; i++) {
-                  src1[i] = (3.0f - src1[i] * src2[i]) * 0.5f;
-                }
-              }
-            } else {
-              // vmin/vmax.f32 Qd, Qm, Qn.
-              bool min = instr->Bit(21) == 1;
-              for (int i = 0; i < 4; i++) {
-                src1[i] = MinMax(src1[i], src2[i], min);
-              }
-            }
-            set_neon_register(Vd, src1);
-          } else {
-            UNIMPLEMENTED();
-          }
-          break;
-        }
-        default:
-          UNIMPLEMENTED();
-          break;
-      }
-      break;
-    }
-    case 5:
-      if ((instr->Bits(18, 16) == 0) && (instr->Bits(11, 6) == 0x28) &&
-          (instr->Bit(4) == 1)) {
-        // vmovl signed
-        if ((instr->VdValue() & 1) != 0) UNIMPLEMENTED();
-        int Vd = instr->VFPDRegValue(kSimd128Precision);
-        int Vm = instr->VFPMRegValue(kDoublePrecision);
-        int imm3 = instr->Bits(21, 19);
-        switch (imm3) {
-          case 1:
-            Widen<int8_t, int16_t>(this, Vd, Vm);
-            break;
-          case 2:
-            Widen<int16_t, int32_t>(this, Vd, Vm);
-            break;
-          case 4:
-            Widen<int32_t, int64_t>(this, Vd, Vm);
-            break;
-          default:
-            UNIMPLEMENTED();
-            break;
-        }
-      } else if (instr->Bits(21, 20) == 3 && instr->Bit(4) == 0) {
-        // vext.
-        int imm4 = instr->Bits(11, 8);
-        int Vd = instr->VFPDRegValue(kSimd128Precision);
-        int Vm = instr->VFPMRegValue(kSimd128Precision);
-        int Vn = instr->VFPNRegValue(kSimd128Precision);
-        uint8_t src1[16], src2[16], dst[16];
-        get_neon_register(Vn, src1);
-        get_neon_register(Vm, src2);
-        int boundary = kSimd128Size - imm4;
-        int i = 0;
-        for (; i < boundary; i++) {
-          dst[i] = src1[i + imm4];
-        }
-        for (; i < 16; i++) {
-          dst[i] = src2[i - boundary];
-        }
-        set_neon_register(Vd, dst);
-      } else if (instr->Bits(11, 7) == 0xA && instr->Bit(4) == 1) {
-        // vshl.i<size> Qd, Qm, shift
-        int size = base::bits::RoundDownToPowerOfTwo32(instr->Bits(21, 16));
-        int shift = instr->Bits(21, 16) - size;
-        int Vd = instr->VFPDRegValue(kSimd128Precision);
-        int Vm = instr->VFPMRegValue(kSimd128Precision);
-        NeonSize ns = static_cast<NeonSize>(size / 16);
-        switch (ns) {
-          case Neon8:
-            ShiftLeft<uint8_t, kSimd128Size>(this, Vd, Vm, shift);
-            break;
-          case Neon16:
-            ShiftLeft<uint16_t, kSimd128Size>(this, Vd, Vm, shift);
-            break;
-          case Neon32:
-            ShiftLeft<uint32_t, kSimd128Size>(this, Vd, Vm, shift);
-            break;
-          default:
-            UNREACHABLE();
-            break;
-        }
-      } else if (instr->Bits(11, 7) == 0 && instr->Bit(4) == 1) {
-        // vshr.s<size> Qd, Qm, shift
-        int size = base::bits::RoundDownToPowerOfTwo32(instr->Bits(21, 16));
-        int shift = 2 * size - instr->Bits(21, 16);
-        int Vd = instr->VFPDRegValue(kSimd128Precision);
-        int Vm = instr->VFPMRegValue(kSimd128Precision);
-        NeonSize ns = static_cast<NeonSize>(size / 16);
-        switch (ns) {
-          case Neon8:
-            ArithmeticShiftRight<int8_t, kSimd128Size>(this, Vd, Vm, shift);
-            break;
-          case Neon16:
-            ArithmeticShiftRight<int16_t, kSimd128Size>(this, Vd, Vm, shift);
-            break;
-          case Neon32:
-            ArithmeticShiftRight<int32_t, kSimd128Size>(this, Vd, Vm, shift);
-            break;
-          default:
-            UNREACHABLE();
-            break;
-        }
-      } else {
-        UNIMPLEMENTED();
-      }
-      break;
-    case 6: {
-      int Vd, Vm, Vn;
-      if (instr->Bit(6) == 0) {
-        Vd = instr->VFPDRegValue(kDoublePrecision);
-        Vm = instr->VFPMRegValue(kDoublePrecision);
-        Vn = instr->VFPNRegValue(kDoublePrecision);
-      } else {
-        Vd = instr->VFPDRegValue(kSimd128Precision);
-        Vm = instr->VFPMRegValue(kSimd128Precision);
-        Vn = instr->VFPNRegValue(kSimd128Precision);
-      }
-      switch (instr->Bits(11, 8)) {
-        case 0x0: {
-          if (instr->Bit(4) == 1) {
-            // vqadd.u<size> Qd, Qm, Qn.
-            NeonSize size = static_cast<NeonSize>(instr->Bits(21, 20));
-            switch (size) {
-              case Neon8:
-                AddSaturate<uint8_t>(this, Vd, Vm, Vn);
-                break;
-              case Neon16:
-                AddSaturate<uint16_t>(this, Vd, Vm, Vn);
-                break;
-              case Neon32:
-                AddSaturate<uint32_t>(this, Vd, Vm, Vn);
-                break;
-              default:
-                UNREACHABLE();
-                break;
-            }
-          } else {
-            UNIMPLEMENTED();
-          }
-          break;
-        }
-        case 0x1: {
-          if (instr->Bits(21, 20) == 1 && instr->Bit(4) == 1) {
-            // vbsl.size Qd, Qm, Qn.
-            uint32_t dst[4], src1[4], src2[4];
-            get_neon_register(Vd, dst);
-            get_neon_register(Vn, src1);
-            get_neon_register(Vm, src2);
-            for (int i = 0; i < 4; i++) {
-              dst[i] = (dst[i] & src1[i]) | (~dst[i] & src2[i]);
-            }
-            set_neon_register(Vd, dst);
-          } else if (instr->Bits(21, 20) == 0 && instr->Bit(4) == 1) {
-            if (instr->Bit(6) == 0) {
-              // veor Dd, Dn, Dm
-              uint64_t src1, src2;
-              get_d_register(Vn, &src1);
-              get_d_register(Vm, &src2);
-              src1 ^= src2;
-              set_d_register(Vd, &src1);
-
-            } else {
-              // veor Qd, Qn, Qm
-              uint32_t src1[4], src2[4];
-              get_neon_register(Vn, src1);
-              get_neon_register(Vm, src2);
-              for (int i = 0; i < 4; i++) src1[i] ^= src2[i];
-              set_neon_register(Vd, src1);
-            }
-          } else {
-            UNIMPLEMENTED();
-          }
-          break;
-        }
-        case 0x2: {
-          if (instr->Bit(4) == 1) {
-            // vqsub.u<size> Qd, Qm, Qn.
-            NeonSize size = static_cast<NeonSize>(instr->Bits(21, 20));
-            switch (size) {
-              case Neon8:
-                SubSaturate<uint8_t>(this, Vd, Vm, Vn);
-                break;
-              case Neon16:
-                SubSaturate<uint16_t>(this, Vd, Vm, Vn);
-                break;
-              case Neon32:
-                SubSaturate<uint32_t>(this, Vd, Vm, Vn);
-                break;
-              default:
-                UNREACHABLE();
-                break;
-            }
-          } else {
-            UNIMPLEMENTED();
-          }
-          break;
-        }
-        case 0x3: {
-          // vcge/vcgt.u<size> Qd, Qm, Qn.
-          bool ge = instr->Bit(4) == 1;
-          NeonSize size = static_cast<NeonSize>(instr->Bits(21, 20));
-          switch (size) {
-            case Neon8:
-              CompareGreater<uint8_t, kSimd128Size>(this, Vd, Vm, Vn, ge);
-              break;
-            case Neon16:
-              CompareGreater<uint16_t, kSimd128Size>(this, Vd, Vm, Vn, ge);
-              break;
-            case Neon32:
-              CompareGreater<uint32_t, kSimd128Size>(this, Vd, Vm, Vn, ge);
-              break;
-            default:
-              UNREACHABLE();
-              break;
-          }
-          break;
-        }
-        case 0x6: {
-          // vmin/vmax.u<size> Qd, Qm, Qn.
-          NeonSize size = static_cast<NeonSize>(instr->Bits(21, 20));
-          bool min = instr->Bit(4) != 0;
-          switch (size) {
-            case Neon8:
-              MinMax<uint8_t, kSimd128Size>(this, Vd, Vm, Vn, min);
-              break;
-            case Neon16:
-              MinMax<uint16_t, kSimd128Size>(this, Vd, Vm, Vn, min);
-              break;
-            case Neon32:
-              MinMax<uint32_t, kSimd128Size>(this, Vd, Vm, Vn, min);
-              break;
-            default:
-              UNREACHABLE();
-              break;
-          }
-          break;
-        }
-        case 0x8: {
-          if (instr->Bit(4) == 0) {
-            // vsub.size Qd, Qm, Qn.
-            NeonSize size = static_cast<NeonSize>(instr->Bits(21, 20));
-            switch (size) {
-              case Neon8:
-                Sub<uint8_t, kSimd128Size>(this, Vd, Vm, Vn);
-                break;
-              case Neon16:
-                Sub<uint16_t, kSimd128Size>(this, Vd, Vm, Vn);
-                break;
-              case Neon32:
-                Sub<uint32_t, kSimd128Size>(this, Vd, Vm, Vn);
-                break;
-              default:
-                UNREACHABLE();
-                break;
-            }
-          } else {
-            // vceq.size Qd, Qm, Qn.
-            NeonSize size = static_cast<NeonSize>(instr->Bits(21, 20));
-            switch (size) {
-              case Neon8:
-                CompareEqual<uint8_t, kSimd128Size>(this, Vd, Vm, Vn);
-                break;
-              case Neon16:
-                CompareEqual<uint16_t, kSimd128Size>(this, Vd, Vm, Vn);
-                break;
-              case Neon32:
-                CompareEqual<uint32_t, kSimd128Size>(this, Vd, Vm, Vn);
-                break;
-              default:
-                UNREACHABLE();
-                break;
-            }
-          }
-          break;
-        }
-        case 0xA: {
-          // vpmin/vpmax.u<size> Dd, Dm, Dn.
-          NeonSize size = static_cast<NeonSize>(instr->Bits(21, 20));
-          bool min = instr->Bit(4) != 0;
-          switch (size) {
-            case Neon8:
-              PairwiseMinMax<uint8_t>(this, Vd, Vm, Vn, min);
-              break;
-            case Neon16:
-              PairwiseMinMax<uint16_t>(this, Vd, Vm, Vn, min);
-              break;
-            case Neon32:
-              PairwiseMinMax<uint32_t>(this, Vd, Vm, Vn, min);
-              break;
-            default:
-              UNREACHABLE();
-              break;
-          }
-          break;
-        }
-        case 0xD: {
-          if (instr->Bits(21, 20) == 0 && instr->Bit(6) == 1 &&
-              instr->Bit(4) == 1) {
-            // vmul.f32 Qd, Qn, Qm
-            float src1[4], src2[4];
-            get_neon_register(Vn, src1);
-            get_neon_register(Vm, src2);
-            for (int i = 0; i < 4; i++) {
-              src1[i] = src1[i] * src2[i];
-            }
-            set_neon_register(Vd, src1);
-          } else if (instr->Bits(21, 20) == 0 && instr->Bit(6) == 0 &&
-                     instr->Bit(4) == 0) {
-            // vpadd.f32 Dd, Dn, Dm
-            PairwiseAdd<float>(this, Vd, Vm, Vn);
-          } else {
-            UNIMPLEMENTED();
-          }
-          break;
-        }
-        case 0xE: {
-          if (instr->Bit(20) == 0 && instr->Bit(4) == 0) {
-            // vcge/vcgt.f32 Qd, Qm, Qn
-            bool ge = instr->Bit(21) == 0;
-            float src1[4], src2[4];
-            get_neon_register(Vn, src1);
-            get_neon_register(Vm, src2);
-            uint32_t dst[4];
-            for (int i = 0; i < 4; i++) {
-              if (ge) {
-                dst[i] = src1[i] >= src2[i] ? 0xFFFFFFFFu : 0;
-              } else {
-                dst[i] = src1[i] > src2[i] ? 0xFFFFFFFFu : 0;
-              }
-            }
-            set_neon_register(Vd, dst);
-          } else {
-            UNIMPLEMENTED();
-          }
-          break;
-        }
-        default:
-          UNREACHABLE();
-          break;
-      }
-      break;
-    }
-    case 7:
-      if ((instr->Bits(18, 16) == 0) && (instr->Bits(11, 6) == 0x28) &&
-          (instr->Bit(4) == 1)) {
-        // vmovl unsigned
-        if ((instr->VdValue() & 1) != 0) UNIMPLEMENTED();
-        int Vd = instr->VFPDRegValue(kSimd128Precision);
-        int Vm = instr->VFPMRegValue(kDoublePrecision);
-        int imm3 = instr->Bits(21, 19);
-        switch (imm3) {
-          case 1:
-            Widen<uint8_t, uint16_t>(this, Vd, Vm);
-            break;
-          case 2:
-            Widen<uint16_t, uint32_t>(this, Vd, Vm);
-            break;
-          case 4:
-            Widen<uint32_t, uint64_t>(this, Vd, Vm);
-            break;
-          default:
-            UNIMPLEMENTED();
-            break;
-        }
-      } else if (instr->Opc1Value() == 7 && instr->Bit(4) == 0) {
-        if (instr->Bits(19, 16) == 0xB && instr->Bits(11, 9) == 0x3 &&
-            instr->Bit(6) == 1) {
-          // vcvt.<Td>.<Tm> Qd, Qm.
-          int Vd = instr->VFPDRegValue(kSimd128Precision);
-          int Vm = instr->VFPMRegValue(kSimd128Precision);
-          uint32_t q_data[4];
-          get_neon_register(Vm, q_data);
-          int op = instr->Bits(8, 7);
-          for (int i = 0; i < 4; i++) {
-            switch (op) {
-              case 0:
-                // f32 <- s32, round towards nearest.
-                q_data[i] = bit_cast<uint32_t>(std::round(
-                    static_cast<float>(bit_cast<int32_t>(q_data[i]))));
-                break;
-              case 1:
-                // f32 <- u32, round towards nearest.
-                q_data[i] = bit_cast<uint32_t>(
-                    std::round(static_cast<float>(q_data[i])));
-                break;
-              case 2:
-                // s32 <- f32, round to zero.
-                q_data[i] = static_cast<uint32_t>(
-                    ConvertDoubleToInt(bit_cast<float>(q_data[i]), false, RZ));
-                break;
-              case 3:
-                // u32 <- f32, round to zero.
-                q_data[i] = static_cast<uint32_t>(
-                    ConvertDoubleToInt(bit_cast<float>(q_data[i]), true, RZ));
-                break;
-            }
-          }
-          set_neon_register(Vd, q_data);
-        } else if (instr->Bits(17, 16) == 0x2 && instr->Bits(11, 7) == 0) {
-          if (instr->Bit(6) == 0) {
-            // vswp Dd, Dm.
-            uint64_t dval, mval;
-            int vd = instr->VFPDRegValue(kDoublePrecision);
-            int vm = instr->VFPMRegValue(kDoublePrecision);
-            get_d_register(vd, &dval);
-            get_d_register(vm, &mval);
-            set_d_register(vm, &dval);
-            set_d_register(vd, &mval);
-          } else {
-            // vswp Qd, Qm.
-            uint32_t dval[4], mval[4];
-            int vd = instr->VFPDRegValue(kSimd128Precision);
-            int vm = instr->VFPMRegValue(kSimd128Precision);
-            get_neon_register(vd, dval);
-            get_neon_register(vm, mval);
-            set_neon_register(vm, dval);
-            set_neon_register(vd, mval);
-          }
-        } else if (instr->Bits(11, 7) == 0x18) {
-          // vdup.<size> Dd, Dm[index].
-          // vdup.<size> Qd, Dm[index].
-          int vm = instr->VFPMRegValue(kDoublePrecision);
-          int imm4 = instr->Bits(19, 16);
-          int size = 0, index = 0, mask = 0;
-          if ((imm4 & 0x1) != 0) {
-            size = 8;
-            index = imm4 >> 1;
-            mask = 0xFFu;
-          } else if ((imm4 & 0x2) != 0) {
-            size = 16;
-            index = imm4 >> 2;
-            mask = 0xFFFFu;
-          } else {
-            size = 32;
-            index = imm4 >> 3;
-            mask = 0xFFFFFFFFu;
-          }
-          uint64_t d_data;
-          get_d_register(vm, &d_data);
-          uint32_t scalar = (d_data >> (size * index)) & mask;
-          uint32_t duped = scalar;
-          for (int i = 1; i < 32 / size; i++) {
-            scalar <<= size;
-            duped |= scalar;
-          }
-          uint32_t result[4] = {duped, duped, duped, duped};
-          if (instr->Bit(6) == 0) {
-            int vd = instr->VFPDRegValue(kDoublePrecision);
-            set_d_register(vd, result);
-          } else {
-            int vd = instr->VFPDRegValue(kSimd128Precision);
-            set_neon_register(vd, result);
-          }
-        } else if (instr->Bits(19, 16) == 0 && instr->Bits(11, 6) == 0x17) {
-          // vmvn Qd, Qm.
-          int vd = instr->VFPDRegValue(kSimd128Precision);
-          int vm = instr->VFPMRegValue(kSimd128Precision);
-          uint32_t q_data[4];
-          get_neon_register(vm, q_data);
-          for (int i = 0; i < 4; i++) q_data[i] = ~q_data[i];
-          set_neon_register(vd, q_data);
-        } else if (instr->Bits(11, 10) == 0x2) {
-          // vtb[l,x] Dd, <list>, Dm.
-          int vd = instr->VFPDRegValue(kDoublePrecision);
-          int vn = instr->VFPNRegValue(kDoublePrecision);
-          int vm = instr->VFPMRegValue(kDoublePrecision);
-          int table_len = (instr->Bits(9, 8) + 1) * kDoubleSize;
-          bool vtbx = instr->Bit(6) != 0;  // vtbl / vtbx
-          uint64_t destination = 0, indices = 0, result = 0;
-          get_d_register(vd, &destination);
-          get_d_register(vm, &indices);
-          for (int i = 0; i < kDoubleSize; i++) {
-            int shift = i * kBitsPerByte;
-            int index = (indices >> shift) & 0xFF;
-            if (index < table_len) {
-              uint64_t table;
-              get_d_register(vn + index / kDoubleSize, &table);
-              result |=
-                  ((table >> ((index % kDoubleSize) * kBitsPerByte)) & 0xFF)
-                  << shift;
-            } else if (vtbx) {
-              result |= destination & (0xFFull << shift);
-            }
-          }
-          set_d_register(vd, &result);
-        } else if (instr->Bits(17, 16) == 0x2 && instr->Bits(11, 8) == 0x1) {
-          NeonSize size = static_cast<NeonSize>(instr->Bits(19, 18));
-          if (instr->Bit(6) == 0) {
-            int Vd = instr->VFPDRegValue(kDoublePrecision);
-            int Vm = instr->VFPMRegValue(kDoublePrecision);
-            if (instr->Bit(7) == 1) {
-              // vzip.<size> Dd, Dm.
-              switch (size) {
-                case Neon8:
-                  Zip<uint8_t, kDoubleSize>(this, Vd, Vm);
-                  break;
-                case Neon16:
-                  Zip<uint16_t, kDoubleSize>(this, Vd, Vm);
-                  break;
-                case Neon32:
-                  UNIMPLEMENTED();
-                  break;
-                default:
-                  UNREACHABLE();
-                  break;
-              }
-            } else {
-              // vuzp.<size> Dd, Dm.
-              switch (size) {
-                case Neon8:
-                  Unzip<uint8_t, kDoubleSize>(this, Vd, Vm);
-                  break;
-                case Neon16:
-                  Unzip<uint16_t, kDoubleSize>(this, Vd, Vm);
-                  break;
-                case Neon32:
-                  UNIMPLEMENTED();
-                  break;
-                default:
-                  UNREACHABLE();
-                  break;
-              }
-            }
-          } else {
-            int Vd = instr->VFPDRegValue(kSimd128Precision);
-            int Vm = instr->VFPMRegValue(kSimd128Precision);
-            if (instr->Bit(7) == 1) {
-              // vzip.<size> Qd, Qm.
-              switch (size) {
-                case Neon8:
-                  Zip<uint8_t, kSimd128Size>(this, Vd, Vm);
-                  break;
-                case Neon16:
-                  Zip<uint16_t, kSimd128Size>(this, Vd, Vm);
-                  break;
-                case Neon32:
-                  Zip<uint32_t, kSimd128Size>(this, Vd, Vm);
-                  break;
-                default:
-                  UNREACHABLE();
-                  break;
-              }
-            } else {
-              // vuzp.<size> Qd, Qm.
-              switch (size) {
-                case Neon8:
-                  Unzip<uint8_t, kSimd128Size>(this, Vd, Vm);
-                  break;
-                case Neon16:
-                  Unzip<uint16_t, kSimd128Size>(this, Vd, Vm);
-                  break;
-                case Neon32:
-                  Unzip<uint32_t, kSimd128Size>(this, Vd, Vm);
-                  break;
-                default:
-                  UNREACHABLE();
-                  break;
-              }
-            }
-          }
-        } else if (instr->Bits(17, 16) == 0 && instr->Bits(11, 9) == 0) {
-          // vrev<op>.size Qd, Qm
-          int Vd = instr->VFPDRegValue(kSimd128Precision);
-          int Vm = instr->VFPMRegValue(kSimd128Precision);
-          NeonSize size = static_cast<NeonSize>(instr->Bits(19, 18));
-          NeonSize op = static_cast<NeonSize>(static_cast<int>(Neon64) -
-                                              instr->Bits(8, 7));
-          switch (op) {
-            case Neon16: {
-              DCHECK_EQ(Neon8, size);
-              uint8_t src[16];
-              get_neon_register(Vm, src);
-              for (int i = 0; i < 16; i += 2) {
-                std::swap(src[i], src[i + 1]);
-              }
-              set_neon_register(Vd, src);
-              break;
-            }
-            case Neon32: {
-              switch (size) {
-                case Neon16: {
-                  uint16_t src[8];
-                  get_neon_register(Vm, src);
-                  for (int i = 0; i < 8; i += 2) {
-                    std::swap(src[i], src[i + 1]);
-                  }
-                  set_neon_register(Vd, src);
-                  break;
-                }
-                case Neon8: {
-                  uint8_t src[16];
-                  get_neon_register(Vm, src);
-                  for (int i = 0; i < 4; i++) {
-                    std::swap(src[i * 4], src[i * 4 + 3]);
-                    std::swap(src[i * 4 + 1], src[i * 4 + 2]);
-                  }
-                  set_neon_register(Vd, src);
-                  break;
-                }
-                default:
-                  UNREACHABLE();
-                  break;
-              }
-              break;
-            }
-            case Neon64: {
-              switch (size) {
-                case Neon32: {
-                  uint32_t src[4];
-                  get_neon_register(Vm, src);
-                  std::swap(src[0], src[1]);
-                  std::swap(src[2], src[3]);
-                  set_neon_register(Vd, src);
-                  break;
-                }
-                case Neon16: {
-                  uint16_t src[8];
-                  get_neon_register(Vm, src);
-                  for (int i = 0; i < 2; i++) {
-                    std::swap(src[i * 4], src[i * 4 + 3]);
-                    std::swap(src[i * 4 + 1], src[i * 4 + 2]);
-                  }
-                  set_neon_register(Vd, src);
-                  break;
-                }
-                case Neon8: {
-                  uint8_t src[16];
-                  get_neon_register(Vm, src);
-                  for (int i = 0; i < 4; i++) {
-                    std::swap(src[i], src[7 - i]);
-                    std::swap(src[i + 8], src[15 - i]);
-                  }
-                  set_neon_register(Vd, src);
-                  break;
-                }
-                default:
-                  UNREACHABLE();
-                  break;
-              }
-              break;
-            }
-            default:
-              UNREACHABLE();
-              break;
-          }
-        } else if (instr->Bits(17, 16) == 0x2 && instr->Bits(11, 7) == 0x1) {
-          NeonSize size = static_cast<NeonSize>(instr->Bits(19, 18));
-          if (instr->Bit(6) == 0) {
-            int Vd = instr->VFPDRegValue(kDoublePrecision);
-            int Vm = instr->VFPMRegValue(kDoublePrecision);
-            // vtrn.<size> Dd, Dm.
-            switch (size) {
-              case Neon8:
-                Transpose<uint8_t, kDoubleSize>(this, Vd, Vm);
-                break;
-              case Neon16:
-                Transpose<uint16_t, kDoubleSize>(this, Vd, Vm);
-                break;
-              case Neon32:
-                Transpose<uint32_t, kDoubleSize>(this, Vd, Vm);
-                break;
-              default:
-                UNREACHABLE();
-                break;
-            }
-          } else {
-            int Vd = instr->VFPDRegValue(kSimd128Precision);
-            int Vm = instr->VFPMRegValue(kSimd128Precision);
-            // vtrn.<size> Qd, Qm.
-            switch (size) {
-              case Neon8:
-                Transpose<uint8_t, kSimd128Size>(this, Vd, Vm);
-                break;
-              case Neon16:
-                Transpose<uint16_t, kSimd128Size>(this, Vd, Vm);
-                break;
-              case Neon32:
-                Transpose<uint32_t, kSimd128Size>(this, Vd, Vm);
-                break;
-              default:
-                UNREACHABLE();
-                break;
-            }
-          }
-        } else if (instr->Bits(17, 16) == 0x1 && instr->Bit(11) == 0) {
-          int Vd = instr->VFPDRegValue(kSimd128Precision);
-          int Vm = instr->VFPMRegValue(kSimd128Precision);
-          NeonSize size = static_cast<NeonSize>(instr->Bits(19, 18));
-          if (instr->Bits(9, 6) == 0xD) {
-            // vabs<type>.<size> Qd, Qm
-            if (instr->Bit(10) != 0) {
-              // floating point (clear sign bits)
-              uint32_t src[4];
-              get_neon_register(Vm, src);
-              for (int i = 0; i < 4; i++) {
-                src[i] &= ~0x80000000;
-              }
-              set_neon_register(Vd, src);
-            } else {
-              // signed integer
-              switch (size) {
-                case Neon8:
-                  Abs<int8_t, kSimd128Size>(this, Vd, Vm);
-                  break;
-                case Neon16:
-                  Abs<int16_t, kSimd128Size>(this, Vd, Vm);
-                  break;
-                case Neon32:
-                  Abs<int32_t, kSimd128Size>(this, Vd, Vm);
-                  break;
-                default:
-                  UNIMPLEMENTED();
-                  break;
-              }
-            }
-          } else if (instr->Bits(9, 6) == 0xF) {
-            // vneg<type>.<size> Qd, Qm (signed integer)
-            if (instr->Bit(10) != 0) {
-              // floating point (toggle sign bits)
-              uint32_t src[4];
-              get_neon_register(Vm, src);
-              for (int i = 0; i < 4; i++) {
-                src[i] ^= 0x80000000;
-              }
-              set_neon_register(Vd, src);
-            } else {
-              // signed integer
-              switch (size) {
-                case Neon8:
-                  Neg<int8_t, kSimd128Size>(this, Vd, Vm);
-                  break;
-                case Neon16:
-                  Neg<int16_t, kSimd128Size>(this, Vd, Vm);
-                  break;
-                case Neon32:
-                  Neg<int32_t, kSimd128Size>(this, Vd, Vm);
-                  break;
-                default:
-                  UNIMPLEMENTED();
-                  break;
-              }
-            }
-          } else {
-            UNIMPLEMENTED();
-          }
-        } else if (instr->Bits(19, 18) == 0x2 && instr->Bits(11, 8) == 0x5) {
-          // vrecpe/vrsqrte.f32 Qd, Qm.
-          int Vd = instr->VFPDRegValue(kSimd128Precision);
-          int Vm = instr->VFPMRegValue(kSimd128Precision);
-          uint32_t src[4];
-          get_neon_register(Vm, src);
-          if (instr->Bit(7) == 0) {
-            for (int i = 0; i < 4; i++) {
-              float denom = bit_cast<float>(src[i]);
-              div_zero_vfp_flag_ = (denom == 0);
-              float result = 1.0f / denom;
-              result = canonicalizeNaN(result);
-              src[i] = bit_cast<uint32_t>(result);
-            }
-          } else {
-            lazily_initialize_fast_sqrt(isolate_);
-            for (int i = 0; i < 4; i++) {
-              float radicand = bit_cast<float>(src[i]);
-              float result = 1.0f / fast_sqrt(radicand, isolate_);
-              result = canonicalizeNaN(result);
-              src[i] = bit_cast<uint32_t>(result);
-            }
-          }
-          set_neon_register(Vd, src);
-        } else if (instr->Bits(17, 16) == 0x2 && instr->Bits(11, 8) == 0x2 &&
-                   instr->Bits(7, 6) != 0) {
-          // vqmovn.<type><size> Dd, Qm.
-          int Vd = instr->VFPDRegValue(kDoublePrecision);
-          int Vm = instr->VFPMRegValue(kSimd128Precision);
-          NeonSize size = static_cast<NeonSize>(instr->Bits(19, 18));
-          bool is_unsigned = instr->Bit(6) != 0;
-          switch (size) {
-            case Neon8: {
-              if (is_unsigned) {
-                SaturatingNarrow<uint16_t, uint8_t>(this, Vd, Vm);
-              } else {
-                SaturatingNarrow<int16_t, int8_t>(this, Vd, Vm);
-              }
-              break;
-            }
-            case Neon16: {
-              if (is_unsigned) {
-                SaturatingNarrow<uint32_t, uint16_t>(this, Vd, Vm);
-              } else {
-                SaturatingNarrow<int32_t, int16_t>(this, Vd, Vm);
-              }
-              break;
-            }
-            case Neon32: {
-              if (is_unsigned) {
-                SaturatingNarrow<uint64_t, uint32_t>(this, Vd, Vm);
-              } else {
-                SaturatingNarrow<int64_t, int32_t>(this, Vd, Vm);
-              }
-              break;
-            }
-            default:
-              UNIMPLEMENTED();
-              break;
-          }
-        } else {
-          UNIMPLEMENTED();
-        }
-      } else if (instr->Bits(11, 7) == 0 && instr->Bit(4) == 1) {
-        // vshr.u<size> Qd, Qm, shift
-        int size = base::bits::RoundDownToPowerOfTwo32(instr->Bits(21, 16));
-        int shift = 2 * size - instr->Bits(21, 16);
-        int Vd = instr->VFPDRegValue(kSimd128Precision);
-        int Vm = instr->VFPMRegValue(kSimd128Precision);
-        NeonSize ns = static_cast<NeonSize>(size / 16);
-        switch (ns) {
-          case Neon8:
-            ShiftRight<uint8_t, kSimd128Size>(this, Vd, Vm, shift);
-            break;
-          case Neon16:
-            ShiftRight<uint16_t, kSimd128Size>(this, Vd, Vm, shift);
-            break;
-          case Neon32:
-            ShiftRight<uint32_t, kSimd128Size>(this, Vd, Vm, shift);
-            break;
-          default:
-            UNREACHABLE();
-            break;
-        }
-      } else if (instr->Bits(11, 8) == 0x5 && instr->Bit(6) == 0 &&
-                 instr->Bit(4) == 1) {
-        // vsli.<size> Dd, Dm, shift
-        int imm7 = instr->Bits(21, 16);
-        if (instr->Bit(7) != 0) imm7 += 64;
-        int size = base::bits::RoundDownToPowerOfTwo32(imm7);
-        int shift = imm7 - size;
-        int Vd = instr->VFPDRegValue(kDoublePrecision);
-        int Vm = instr->VFPMRegValue(kDoublePrecision);
-        switch (size) {
-          case 8:
-            ShiftLeftAndInsert<uint8_t, kDoubleSize>(this, Vd, Vm, shift);
-            break;
-          case 16:
-            ShiftLeftAndInsert<uint16_t, kDoubleSize>(this, Vd, Vm, shift);
-            break;
-          case 32:
-            ShiftLeftAndInsert<uint32_t, kDoubleSize>(this, Vd, Vm, shift);
-            break;
-          case 64:
-            ShiftLeftAndInsert<uint64_t, kDoubleSize>(this, Vd, Vm, shift);
-            break;
-          default:
-            UNREACHABLE();
-            break;
-        }
-      } else if (instr->Bits(11, 8) == 0x4 && instr->Bit(6) == 0 &&
-                 instr->Bit(4) == 1) {
-        // vsri.<size> Dd, Dm, shift
-        int imm7 = instr->Bits(21, 16);
-        if (instr->Bit(7) != 0) imm7 += 64;
-        int size = base::bits::RoundDownToPowerOfTwo32(imm7);
-        int shift = 2 * size - imm7;
-        int Vd = instr->VFPDRegValue(kDoublePrecision);
-        int Vm = instr->VFPMRegValue(kDoublePrecision);
-        switch (size) {
-          case 8:
-            ShiftRightAndInsert<uint8_t, kDoubleSize>(this, Vd, Vm, shift);
-            break;
-          case 16:
-            ShiftRightAndInsert<uint16_t, kDoubleSize>(this, Vd, Vm, shift);
-            break;
-          case 32:
-            ShiftRightAndInsert<uint32_t, kDoubleSize>(this, Vd, Vm, shift);
-            break;
-          case 64:
-            ShiftRightAndInsert<uint64_t, kDoubleSize>(this, Vd, Vm, shift);
-            break;
-          default:
-            UNREACHABLE();
-            break;
-        }
-      } else {
-        UNIMPLEMENTED();
-      }
-      break;
-    case 8:
-      if (instr->Bits(21, 20) == 0) {
-        // vst1
-        int Vd = (instr->Bit(22) << 4) | instr->VdValue();
-        int Rn = instr->VnValue();
-        int type = instr->Bits(11, 8);
-        int Rm = instr->VmValue();
-        int32_t address = get_register(Rn);
-        int regs = 0;
-        switch (type) {
-          case nlt_1:
-            regs = 1;
-            break;
-          case nlt_2:
-            regs = 2;
-            break;
-          case nlt_3:
-            regs = 3;
-            break;
-          case nlt_4:
-            regs = 4;
-            break;
-          default:
-            UNIMPLEMENTED();
-            break;
-        }
-        int r = 0;
-        while (r < regs) {
-          uint32_t data[2];
-          get_d_register(Vd + r, data);
-          WriteW(address, data[0], instr);
-          WriteW(address + 4, data[1], instr);
-          address += 8;
-          r++;
-        }
-        if (Rm != 15) {
-          if (Rm == 13) {
-            set_register(Rn, address);
-          } else {
-            set_register(Rn, get_register(Rn) + get_register(Rm));
-          }
-        }
-      } else if (instr->Bits(21, 20) == 2) {
-        // vld1
-        int Vd = (instr->Bit(22) << 4) | instr->VdValue();
-        int Rn = instr->VnValue();
-        int type = instr->Bits(11, 8);
-        int Rm = instr->VmValue();
-        int32_t address = get_register(Rn);
-        int regs = 0;
-        switch (type) {
-          case nlt_1:
-            regs = 1;
-            break;
-          case nlt_2:
-            regs = 2;
-            break;
-          case nlt_3:
-            regs = 3;
-            break;
-          case nlt_4:
-            regs = 4;
-            break;
-          default:
-            UNIMPLEMENTED();
-            break;
-        }
-        int r = 0;
-        while (r < regs) {
-          uint32_t data[2];
-          data[0] = ReadW(address, instr);
-          data[1] = ReadW(address + 4, instr);
-          set_d_register(Vd + r, data);
-          address += 8;
-          r++;
-        }
-        if (Rm != 15) {
-          if (Rm == 13) {
-            set_register(Rn, address);
-          } else {
-            set_register(Rn, get_register(Rn) + get_register(Rm));
-          }
-        }
-      } else {
-        UNIMPLEMENTED();
-      }
-      break;
-    case 0xA:
-    case 0xB:
-      if ((instr->Bits(22, 20) == 5) && (instr->Bits(15, 12) == 0xF)) {
-        // pld: ignore instruction.
-      } else if (instr->SpecialValue() == 0xA && instr->Bits(22, 20) == 7) {
-        // dsb, dmb, isb: ignore instruction for now.
-        // TODO(binji): implement
-        // Also refer to the ARMv6 CP15 equivalents in DecodeTypeCP15.
-      } else {
-        UNIMPLEMENTED();
-      }
-      break;
-    case 0x1D:
-      if (instr->Opc1Value() == 0x7 && instr->Opc3Value() == 0x1 &&
-          instr->Bits(11, 9) == 0x5 && instr->Bits(19, 18) == 0x2) {
-        if (instr->SzValue() == 0x1) {
-          int vm = instr->VFPMRegValue(kDoublePrecision);
-          int vd = instr->VFPDRegValue(kDoublePrecision);
-          double dm_value = get_double_from_d_register(vm).get_scalar();
-          double dd_value = 0.0;
-          int rounding_mode = instr->Bits(17, 16);
-          switch (rounding_mode) {
-            case 0x0:  // vrinta - round with ties to away from zero
-              dd_value = round(dm_value);
-              break;
-            case 0x1: {  // vrintn - round with ties to even
-              dd_value = nearbyint(dm_value);
-              break;
-            }
-            case 0x2:  // vrintp - ceil
-              dd_value = ceil(dm_value);
-              break;
-            case 0x3:  // vrintm - floor
-              dd_value = floor(dm_value);
-              break;
-            default:
-              UNREACHABLE();  // Case analysis is exhaustive.
-              break;
-          }
-          dd_value = canonicalizeNaN(dd_value);
-          set_d_register_from_double(vd, dd_value);
-        } else {
-          int m = instr->VFPMRegValue(kSinglePrecision);
-          int d = instr->VFPDRegValue(kSinglePrecision);
-          float sm_value = get_float_from_s_register(m).get_scalar();
-          float sd_value = 0.0;
-          int rounding_mode = instr->Bits(17, 16);
-          switch (rounding_mode) {
-            case 0x0:  // vrinta - round with ties to away from zero
-              sd_value = roundf(sm_value);
-              break;
-            case 0x1: {  // vrintn - round with ties to even
-              sd_value = nearbyintf(sm_value);
-              break;
-            }
-            case 0x2:  // vrintp - ceil
-              sd_value = ceilf(sm_value);
-              break;
-            case 0x3:  // vrintm - floor
-              sd_value = floorf(sm_value);
-              break;
-            default:
-              UNREACHABLE();  // Case analysis is exhaustive.
-              break;
-          }
-          sd_value = canonicalizeNaN(sd_value);
-          set_s_register_from_float(d, sd_value);
-        }
-      } else if ((instr->Opc1Value() == 0x4) && (instr->Bits(11, 9) == 0x5) &&
-                 (instr->Bit(4) == 0x0)) {
-        if (instr->SzValue() == 0x1) {
-          int m = instr->VFPMRegValue(kDoublePrecision);
-          int n = instr->VFPNRegValue(kDoublePrecision);
-          int d = instr->VFPDRegValue(kDoublePrecision);
-          double dn_value = get_double_from_d_register(n).get_scalar();
-          double dm_value = get_double_from_d_register(m).get_scalar();
-          double dd_value;
-          if (instr->Bit(6) == 0x1) {  // vminnm
-            if ((dn_value < dm_value) || std::isnan(dm_value)) {
-              dd_value = dn_value;
-            } else if ((dm_value < dn_value) || std::isnan(dn_value)) {
-              dd_value = dm_value;
-            } else {
-              DCHECK_EQ(dn_value, dm_value);
-              // Make sure that we pick the most negative sign for +/-0.
-              dd_value = std::signbit(dn_value) ? dn_value : dm_value;
-            }
-          } else {  // vmaxnm
-            if ((dn_value > dm_value) || std::isnan(dm_value)) {
-              dd_value = dn_value;
-            } else if ((dm_value > dn_value) || std::isnan(dn_value)) {
-              dd_value = dm_value;
-            } else {
-              DCHECK_EQ(dn_value, dm_value);
-              // Make sure that we pick the most positive sign for +/-0.
-              dd_value = std::signbit(dn_value) ? dm_value : dn_value;
-            }
-          }
-          dd_value = canonicalizeNaN(dd_value);
-          set_d_register_from_double(d, dd_value);
-        } else {
-          int m = instr->VFPMRegValue(kSinglePrecision);
-          int n = instr->VFPNRegValue(kSinglePrecision);
-          int d = instr->VFPDRegValue(kSinglePrecision);
-          float sn_value = get_float_from_s_register(n).get_scalar();
-          float sm_value = get_float_from_s_register(m).get_scalar();
-          float sd_value;
-          if (instr->Bit(6) == 0x1) {  // vminnm
-            if ((sn_value < sm_value) || std::isnan(sm_value)) {
-              sd_value = sn_value;
-            } else if ((sm_value < sn_value) || std::isnan(sn_value)) {
-              sd_value = sm_value;
-            } else {
-              DCHECK_EQ(sn_value, sm_value);
-              // Make sure that we pick the most negative sign for +/-0.
-              sd_value = std::signbit(sn_value) ? sn_value : sm_value;
-            }
-          } else {  // vmaxnm
-            if ((sn_value > sm_value) || std::isnan(sm_value)) {
-              sd_value = sn_value;
-            } else if ((sm_value > sn_value) || std::isnan(sn_value)) {
-              sd_value = sm_value;
-            } else {
-              DCHECK_EQ(sn_value, sm_value);
-              // Make sure that we pick the most positive sign for +/-0.
-              sd_value = std::signbit(sn_value) ? sm_value : sn_value;
-            }
-          }
-          sd_value = canonicalizeNaN(sd_value);
-          set_s_register_from_float(d, sd_value);
-        }
-      } else {
-        UNIMPLEMENTED();
-      }
-      break;
-    case 0x1C:
-      if ((instr->Bits(11, 9) == 0x5) && (instr->Bit(6) == 0) &&
-          (instr->Bit(4) == 0)) {
-        // VSEL* (floating-point)
-        bool condition_holds;
-        switch (instr->Bits(21, 20)) {
-          case 0x0:  // VSELEQ
-            condition_holds = (z_flag_ == 1);
-            break;
-          case 0x1:  // VSELVS
-            condition_holds = (v_flag_ == 1);
-            break;
-          case 0x2:  // VSELGE
-            condition_holds = (n_flag_ == v_flag_);
-            break;
-          case 0x3:  // VSELGT
-            condition_holds = ((z_flag_ == 0) && (n_flag_ == v_flag_));
-            break;
-          default:
-            UNREACHABLE();  // Case analysis is exhaustive.
-            break;
-        }
-        if (instr->SzValue() == 0x1) {
-          int n = instr->VFPNRegValue(kDoublePrecision);
-          int m = instr->VFPMRegValue(kDoublePrecision);
-          int d = instr->VFPDRegValue(kDoublePrecision);
-          Float64 result = get_double_from_d_register(condition_holds ? n : m);
-          set_d_register_from_double(d, result);
-        } else {
-          int n = instr->VFPNRegValue(kSinglePrecision);
-          int m = instr->VFPMRegValue(kSinglePrecision);
-          int d = instr->VFPDRegValue(kSinglePrecision);
-          Float32 result = get_float_from_s_register(condition_holds ? n : m);
-          set_s_register_from_float(d, result);
-        }
-      } else {
-        UNIMPLEMENTED();
-      }
-      break;
-    default:
-      UNIMPLEMENTED();
-      break;
-  }
-}
-
-
-// Executes the current instruction.
-void Simulator::InstructionDecode(Instruction* instr) {
-  if (v8::internal::FLAG_check_icache) {
-    CheckICache(isolate_->simulator_i_cache(), instr);
-  }
-  pc_modified_ = false;
-  if (::v8::internal::FLAG_trace_sim) {
-    disasm::NameConverter converter;
-    disasm::Disassembler dasm(converter);
-    // use a reasonably large buffer
-    v8::internal::EmbeddedVector<char, 256> buffer;
-    dasm.InstructionDecode(buffer,
-                           reinterpret_cast<byte*>(instr));
-    PrintF("  0x%08" V8PRIxPTR "  %s\n", reinterpret_cast<intptr_t>(instr),
-           buffer.start());
-  }
-  if (instr->ConditionField() == kSpecialCondition) {
-    DecodeSpecialCondition(instr);
-  } else if (ConditionallyExecute(instr)) {
-    switch (instr->TypeValue()) {
-      case 0:
-      case 1: {
-        DecodeType01(instr);
-        break;
-      }
-      case 2: {
-        DecodeType2(instr);
-        break;
-      }
-      case 3: {
-        DecodeType3(instr);
-        break;
-      }
-      case 4: {
-        DecodeType4(instr);
-        break;
-      }
-      case 5: {
-        DecodeType5(instr);
-        break;
-      }
-      case 6: {
-        DecodeType6(instr);
-        break;
-      }
-      case 7: {
-        DecodeType7(instr);
-        break;
-      }
-      default: {
-        UNIMPLEMENTED();
-        break;
-      }
-    }
-  }
-  if (!pc_modified_) {
-    set_register(pc, reinterpret_cast<int32_t>(instr)
-                         + Instruction::kInstrSize);
-  }
-}
-
-
-void Simulator::Execute() {
-  // Get the PC to simulate. Cannot use the accessor here as we need the
-  // raw PC value and not the one used as input to arithmetic instructions.
-  int program_counter = get_pc();
-
-  if (::v8::internal::FLAG_stop_sim_at == 0) {
-    // Fast version of the dispatch loop without checking whether the simulator
-    // should be stopping at a particular executed instruction.
-    while (program_counter != end_sim_pc) {
-      Instruction* instr = reinterpret_cast<Instruction*>(program_counter);
-      icount_++;
-      InstructionDecode(instr);
-      program_counter = get_pc();
-    }
-  } else {
-    // FLAG_stop_sim_at is at the non-default value. Stop in the debugger when
-    // we reach the particular instruction count.
-    while (program_counter != end_sim_pc) {
-      Instruction* instr = reinterpret_cast<Instruction*>(program_counter);
-      icount_++;
-      if (icount_ == ::v8::internal::FLAG_stop_sim_at) {
-        ArmDebugger dbg(this);
-        dbg.Debug();
-      } else {
-        InstructionDecode(instr);
-      }
-      program_counter = get_pc();
-    }
-  }
-}
-
-
-void Simulator::CallInternal(byte* entry) {
-  // Adjust JS-based stack limit to C-based stack limit.
-  isolate_->stack_guard()->AdjustStackLimitForSimulator();
-
-  // Prepare to execute the code at entry
-  set_register(pc, reinterpret_cast<int32_t>(entry));
-  // Put down marker for end of simulation. The simulator will stop simulation
-  // when the PC reaches this value. By saving the "end simulation" value into
-  // the LR the simulation stops when returning to this call point.
-  set_register(lr, end_sim_pc);
-
-  // Remember the values of callee-saved registers.
-  // The code below assumes that r9 is not used as sb (static base) in
-  // simulator code and therefore is regarded as a callee-saved register.
-  int32_t r4_val = get_register(r4);
-  int32_t r5_val = get_register(r5);
-  int32_t r6_val = get_register(r6);
-  int32_t r7_val = get_register(r7);
-  int32_t r8_val = get_register(r8);
-  int32_t r9_val = get_register(r9);
-  int32_t r10_val = get_register(r10);
-  int32_t r11_val = get_register(r11);
-
-  // Set up the callee-saved registers with a known value. To be able to check
-  // that they are preserved properly across JS execution.
-  int32_t callee_saved_value = icount_;
-  set_register(r4, callee_saved_value);
-  set_register(r5, callee_saved_value);
-  set_register(r6, callee_saved_value);
-  set_register(r7, callee_saved_value);
-  set_register(r8, callee_saved_value);
-  set_register(r9, callee_saved_value);
-  set_register(r10, callee_saved_value);
-  set_register(r11, callee_saved_value);
-
-  // Start the simulation
-  Execute();
-
-  // Check that the callee-saved registers have been preserved.
-  CHECK_EQ(callee_saved_value, get_register(r4));
-  CHECK_EQ(callee_saved_value, get_register(r5));
-  CHECK_EQ(callee_saved_value, get_register(r6));
-  CHECK_EQ(callee_saved_value, get_register(r7));
-  CHECK_EQ(callee_saved_value, get_register(r8));
-  CHECK_EQ(callee_saved_value, get_register(r9));
-  CHECK_EQ(callee_saved_value, get_register(r10));
-  CHECK_EQ(callee_saved_value, get_register(r11));
-
-  // Restore callee-saved registers with the original value.
-  set_register(r4, r4_val);
-  set_register(r5, r5_val);
-  set_register(r6, r6_val);
-  set_register(r7, r7_val);
-  set_register(r8, r8_val);
-  set_register(r9, r9_val);
-  set_register(r10, r10_val);
-  set_register(r11, r11_val);
-}
-
-intptr_t Simulator::CallImpl(byte* entry, int argument_count,
-                             const intptr_t* arguments) {
-  // Set up arguments
-
-  // First four arguments passed in registers.
-  int reg_arg_count = std::min(4, argument_count);
-  if (reg_arg_count > 0) set_register(r0, arguments[0]);
-  if (reg_arg_count > 1) set_register(r1, arguments[1]);
-  if (reg_arg_count > 2) set_register(r2, arguments[2]);
-  if (reg_arg_count > 3) set_register(r3, arguments[3]);
-
-  // Remaining arguments passed on stack.
-  int original_stack = get_register(sp);
-  // Compute position of stack on entry to generated code.
-  int entry_stack = (original_stack - (argument_count - 4) * sizeof(int32_t));
-  if (base::OS::ActivationFrameAlignment() != 0) {
-    entry_stack &= -base::OS::ActivationFrameAlignment();
-  }
-  // Store remaining arguments on stack, from low to high memory.
-  memcpy(reinterpret_cast<intptr_t*>(entry_stack), arguments + reg_arg_count,
-         (argument_count - reg_arg_count) * sizeof(*arguments));
-  set_register(sp, entry_stack);
-
-  CallInternal(entry);
-
-  // Pop stack passed arguments.
-  CHECK_EQ(entry_stack, get_register(sp));
-  set_register(sp, original_stack);
-
-  return get_register(r0);
-}
-
-int32_t Simulator::CallFPImpl(byte* entry, double d0, double d1) {
-  if (use_eabi_hardfloat()) {
-    set_d_register_from_double(0, d0);
-    set_d_register_from_double(1, d1);
-  } else {
-    set_register_pair_from_double(0, &d0);
-    set_register_pair_from_double(2, &d1);
-  }
-  CallInternal(entry);
-  return get_register(r0);
-}
-
-
-uintptr_t Simulator::PushAddress(uintptr_t address) {
-  int new_sp = get_register(sp) - sizeof(uintptr_t);
-  uintptr_t* stack_slot = reinterpret_cast<uintptr_t*>(new_sp);
-  *stack_slot = address;
-  set_register(sp, new_sp);
-  return new_sp;
-}
-
-
-uintptr_t Simulator::PopAddress() {
-  int current_sp = get_register(sp);
-  uintptr_t* stack_slot = reinterpret_cast<uintptr_t*>(current_sp);
-  uintptr_t address = *stack_slot;
-  set_register(sp, current_sp + sizeof(uintptr_t));
-  return address;
-}
-
-Simulator::LocalMonitor::LocalMonitor()
-    : access_state_(MonitorAccess::Open),
-      tagged_addr_(0),
-      size_(TransactionSize::None) {}
-
-void Simulator::LocalMonitor::Clear() {
-  access_state_ = MonitorAccess::Open;
-  tagged_addr_ = 0;
-  size_ = TransactionSize::None;
-}
-
-void Simulator::LocalMonitor::NotifyLoad(int32_t addr) {
-  if (access_state_ == MonitorAccess::Exclusive) {
-    // A load could cause a cache eviction which will affect the monitor. As a
-    // result, it's most strict to unconditionally clear the local monitor on
-    // load.
-    Clear();
-  }
-}
-
-void Simulator::LocalMonitor::NotifyLoadExcl(int32_t addr,
-                                             TransactionSize size) {
-  access_state_ = MonitorAccess::Exclusive;
-  tagged_addr_ = addr;
-  size_ = size;
-}
-
-void Simulator::LocalMonitor::NotifyStore(int32_t addr) {
-  if (access_state_ == MonitorAccess::Exclusive) {
-    // It is implementation-defined whether a non-exclusive store to an address
-    // covered by the local monitor during exclusive access transitions to open
-    // or exclusive access. See ARM DDI 0406C.b, A3.4.1.
-    //
-    // However, a store could cause a cache eviction which will affect the
-    // monitor. As a result, it's most strict to unconditionally clear the
-    // local monitor on store.
-    Clear();
-  }
-}
-
-bool Simulator::LocalMonitor::NotifyStoreExcl(int32_t addr,
-                                              TransactionSize size) {
-  if (access_state_ == MonitorAccess::Exclusive) {
-    // It is allowed for a processor to require that the address matches
-    // exactly (A3.4.5), so this comparison does not mask addr.
-    if (addr == tagged_addr_ && size_ == size) {
-      Clear();
-      return true;
-    } else {
-      // It is implementation-defined whether an exclusive store to a
-      // non-tagged address will update memory. Behavior is unpredictable if
-      // the transaction size of the exclusive store differs from that of the
-      // exclusive load. See ARM DDI 0406C.b, A3.4.5.
-      Clear();
-      return false;
-    }
-  } else {
-    DCHECK(access_state_ == MonitorAccess::Open);
-    return false;
-  }
-}
-
-Simulator::GlobalMonitor::Processor::Processor()
-    : access_state_(MonitorAccess::Open),
-      tagged_addr_(0),
-      next_(nullptr),
-      prev_(nullptr),
-      failure_counter_(0) {}
-
-void Simulator::GlobalMonitor::Processor::Clear_Locked() {
-  access_state_ = MonitorAccess::Open;
-  tagged_addr_ = 0;
-}
-
-void Simulator::GlobalMonitor::Processor::NotifyLoadExcl_Locked(int32_t addr) {
-  access_state_ = MonitorAccess::Exclusive;
-  tagged_addr_ = addr;
-}
-
-void Simulator::GlobalMonitor::Processor::NotifyStore_Locked(
-    int32_t addr, bool is_requesting_processor) {
-  if (access_state_ == MonitorAccess::Exclusive) {
-    // It is implementation-defined whether a non-exclusive store by the
-    // requesting processor to an address covered by the global monitor
-    // during exclusive access transitions to open or exclusive access.
-    //
-    // For any other processor, the access state always transitions to open
-    // access.
-    //
-    // See ARM DDI 0406C.b, A3.4.2.
-    //
-    // However, similar to the local monitor, it is possible that a store
-    // caused a cache eviction, which can affect the montior, so
-    // conservatively, we always clear the monitor.
-    Clear_Locked();
-  }
-}
-
-bool Simulator::GlobalMonitor::Processor::NotifyStoreExcl_Locked(
-    int32_t addr, bool is_requesting_processor) {
-  if (access_state_ == MonitorAccess::Exclusive) {
-    if (is_requesting_processor) {
-      // It is allowed for a processor to require that the address matches
-      // exactly (A3.4.5), so this comparison does not mask addr.
-      if (addr == tagged_addr_) {
-        // The access state for the requesting processor after a successful
-        // exclusive store is implementation-defined, but according to the ARM
-        // DDI, this has no effect on the subsequent operation of the global
-        // monitor.
-        Clear_Locked();
-        // Introduce occasional strex failures. This is to simulate the
-        // behavior of hardware, which can randomly fail due to background
-        // cache evictions.
-        if (failure_counter_++ >= kMaxFailureCounter) {
-          failure_counter_ = 0;
-          return false;
-        } else {
-          return true;
-        }
-      }
-    } else if ((addr & kExclusiveTaggedAddrMask) ==
-               (tagged_addr_ & kExclusiveTaggedAddrMask)) {
-      // Check the masked addresses when responding to a successful lock by
-      // another processor so the implementation is more conservative (i.e. the
-      // granularity of locking is as large as possible.)
-      Clear_Locked();
-      return false;
-    }
-  }
-  return false;
-}
-
-Simulator::GlobalMonitor::GlobalMonitor() : head_(nullptr) {}
-
-void Simulator::GlobalMonitor::NotifyLoadExcl_Locked(int32_t addr,
-                                                     Processor* processor) {
-  processor->NotifyLoadExcl_Locked(addr);
-  PrependProcessor_Locked(processor);
-}
-
-void Simulator::GlobalMonitor::NotifyStore_Locked(int32_t addr,
-                                                  Processor* processor) {
-  // Notify each processor of the store operation.
-  for (Processor* iter = head_; iter; iter = iter->next_) {
-    bool is_requesting_processor = iter == processor;
-    iter->NotifyStore_Locked(addr, is_requesting_processor);
-  }
-}
-
-bool Simulator::GlobalMonitor::NotifyStoreExcl_Locked(int32_t addr,
-                                                      Processor* processor) {
-  DCHECK(IsProcessorInLinkedList_Locked(processor));
-  if (processor->NotifyStoreExcl_Locked(addr, true)) {
-    // Notify the other processors that this StoreExcl succeeded.
-    for (Processor* iter = head_; iter; iter = iter->next_) {
-      if (iter != processor) {
-        iter->NotifyStoreExcl_Locked(addr, false);
-      }
-    }
-    return true;
-  } else {
-    return false;
-  }
-}
-
-bool Simulator::GlobalMonitor::IsProcessorInLinkedList_Locked(
-    Processor* processor) const {
-  return head_ == processor || processor->next_ || processor->prev_;
-}
-
-void Simulator::GlobalMonitor::PrependProcessor_Locked(Processor* processor) {
-  if (IsProcessorInLinkedList_Locked(processor)) {
-    return;
-  }
-
-  if (head_) {
-    head_->prev_ = processor;
-  }
-  processor->prev_ = nullptr;
-  processor->next_ = head_;
-  head_ = processor;
-}
-
-void Simulator::GlobalMonitor::RemoveProcessor(Processor* processor) {
-  base::LockGuard<base::Mutex> lock_guard(&mutex);
-  if (!IsProcessorInLinkedList_Locked(processor)) {
-    return;
-  }
-
-  if (processor->prev_) {
-    processor->prev_->next_ = processor->next_;
-  } else {
-    head_ = processor->next_;
-  }
-  if (processor->next_) {
-    processor->next_->prev_ = processor->prev_;
-  }
-  processor->prev_ = nullptr;
-  processor->next_ = nullptr;
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // USE_SIMULATOR
-
-#endif  // V8_TARGET_ARCH_ARM
diff --git a/src/v8/src/arm/simulator-arm.h b/src/v8/src/arm/simulator-arm.h
deleted file mode 100644
index 1cb11ff..0000000
--- a/src/v8/src/arm/simulator-arm.h
+++ /dev/null
@@ -1,503 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Declares a Simulator for ARM instructions if we are not generating a native
-// ARM binary. This Simulator allows us to run and debug ARM code generation on
-// regular desktop machines.
-// V8 calls into generated code by using the GeneratedCode class,
-// which will start execution in the Simulator or forwards to the real entry
-// on a ARM HW platform.
-
-#ifndef V8_ARM_SIMULATOR_ARM_H_
-#define V8_ARM_SIMULATOR_ARM_H_
-
-#include "src/allocation.h"
-#include "src/base/lazy-instance.h"
-#include "src/base/platform/mutex.h"
-#include "src/boxed-float.h"
-
-#if defined(USE_SIMULATOR)
-// Running with a simulator.
-
-#include "src/arm/constants-arm.h"
-#include "src/assembler.h"
-#include "src/base/hashmap.h"
-#include "src/simulator-base.h"
-
-namespace v8 {
-namespace internal {
-
-class CachePage {
- public:
-  static const int LINE_VALID = 0;
-  static const int LINE_INVALID = 1;
-
-  static const int kPageShift = 12;
-  static const int kPageSize = 1 << kPageShift;
-  static const int kPageMask = kPageSize - 1;
-  static const int kLineShift = 2;  // The cache line is only 4 bytes right now.
-  static const int kLineLength = 1 << kLineShift;
-  static const int kLineMask = kLineLength - 1;
-
-  CachePage() {
-    memset(&validity_map_, LINE_INVALID, sizeof(validity_map_));
-  }
-
-  char* ValidityByte(int offset) {
-    return &validity_map_[offset >> kLineShift];
-  }
-
-  char* CachedData(int offset) {
-    return &data_[offset];
-  }
-
- private:
-  char data_[kPageSize];   // The cached data.
-  static const int kValidityMapSize = kPageSize >> kLineShift;
-  char validity_map_[kValidityMapSize];  // One byte per line.
-};
-
-class Simulator : public SimulatorBase {
- public:
-  friend class ArmDebugger;
-  enum Register {
-    no_reg = -1,
-    r0 = 0, r1, r2, r3, r4, r5, r6, r7,
-    r8, r9, r10, r11, r12, r13, r14, r15,
-    num_registers,
-    sp = 13,
-    lr = 14,
-    pc = 15,
-    s0 = 0, s1, s2, s3, s4, s5, s6, s7,
-    s8, s9, s10, s11, s12, s13, s14, s15,
-    s16, s17, s18, s19, s20, s21, s22, s23,
-    s24, s25, s26, s27, s28, s29, s30, s31,
-    num_s_registers = 32,
-    d0 = 0, d1, d2, d3, d4, d5, d6, d7,
-    d8, d9, d10, d11, d12, d13, d14, d15,
-    d16, d17, d18, d19, d20, d21, d22, d23,
-    d24, d25, d26, d27, d28, d29, d30, d31,
-    num_d_registers = 32,
-    q0 = 0, q1, q2, q3, q4, q5, q6, q7,
-    q8, q9, q10, q11, q12, q13, q14, q15,
-    num_q_registers = 16
-  };
-
-  explicit Simulator(Isolate* isolate);
-  ~Simulator();
-
-  // The currently executing Simulator instance. Potentially there can be one
-  // for each native thread.
-  V8_EXPORT_PRIVATE static Simulator* current(v8::internal::Isolate* isolate);
-
-  // Accessors for register state. Reading the pc value adheres to the ARM
-  // architecture specification and is off by a 8 from the currently executing
-  // instruction.
-  void set_register(int reg, int32_t value);
-  int32_t get_register(int reg) const;
-  double get_double_from_register_pair(int reg);
-  void set_register_pair_from_double(int reg, double* value);
-  void set_dw_register(int dreg, const int* dbl);
-
-  // Support for VFP.
-  void get_d_register(int dreg, uint64_t* value);
-  void set_d_register(int dreg, const uint64_t* value);
-  void get_d_register(int dreg, uint32_t* value);
-  void set_d_register(int dreg, const uint32_t* value);
-  // Support for NEON.
-  template <typename T, int SIZE = kSimd128Size>
-  void get_neon_register(int reg, T (&value)[SIZE / sizeof(T)]);
-  template <typename T, int SIZE = kSimd128Size>
-  void set_neon_register(int reg, const T (&value)[SIZE / sizeof(T)]);
-
-  void set_s_register(int reg, unsigned int value);
-  unsigned int get_s_register(int reg) const;
-
-  void set_d_register_from_double(int dreg, const Float64 dbl) {
-    SetVFPRegister<Float64, 2>(dreg, dbl);
-  }
-  void set_d_register_from_double(int dreg, const double dbl) {
-    SetVFPRegister<double, 2>(dreg, dbl);
-  }
-
-  Float64 get_double_from_d_register(int dreg) {
-    return GetFromVFPRegister<Float64, 2>(dreg);
-  }
-
-  void set_s_register_from_float(int sreg, const Float32 flt) {
-    SetVFPRegister<Float32, 1>(sreg, flt);
-  }
-  void set_s_register_from_float(int sreg, const float flt) {
-    SetVFPRegister<float, 1>(sreg, flt);
-  }
-
-  Float32 get_float_from_s_register(int sreg) {
-    return GetFromVFPRegister<Float32, 1>(sreg);
-  }
-
-  void set_s_register_from_sinteger(int sreg, const int sint) {
-    SetVFPRegister<int, 1>(sreg, sint);
-  }
-
-  int get_sinteger_from_s_register(int sreg) {
-    return GetFromVFPRegister<int, 1>(sreg);
-  }
-
-  // Special case of set_register and get_register to access the raw PC value.
-  void set_pc(int32_t value);
-  int32_t get_pc() const;
-
-  Address get_sp() const {
-    return reinterpret_cast<Address>(static_cast<intptr_t>(get_register(sp)));
-  }
-
-  // Accessor to the internal simulator stack area.
-  uintptr_t StackLimit(uintptr_t c_limit) const;
-
-  // Executes ARM instructions until the PC reaches end_sim_pc.
-  void Execute();
-
-  template <typename Return, typename... Args>
-  Return Call(byte* entry, Args... args) {
-    return VariadicCall<Return>(this, &Simulator::CallImpl, entry, args...);
-  }
-
-  // Alternative: call a 2-argument double function.
-  template <typename Return>
-  Return CallFP(byte* entry, double d0, double d1) {
-    return ConvertReturn<Return>(CallFPImpl(entry, d0, d1));
-  }
-
-  // Push an address onto the JS stack.
-  uintptr_t PushAddress(uintptr_t address);
-
-  // Pop an address from the JS stack.
-  uintptr_t PopAddress();
-
-  // Debugger input.
-  void set_last_debugger_input(char* input);
-  char* last_debugger_input() { return last_debugger_input_; }
-
-  // Redirection support.
-  static void SetRedirectInstruction(Instruction* instruction);
-
-  // ICache checking.
-  static void FlushICache(base::CustomMatcherHashMap* i_cache, void* start,
-                          size_t size);
-
-  // Returns true if pc register contains one of the 'special_values' defined
-  // below (bad_lr, end_sim_pc).
-  bool has_bad_pc() const;
-
-  // EABI variant for double arguments in use.
-  bool use_eabi_hardfloat() {
-#if USE_EABI_HARDFLOAT
-    return true;
-#else
-    return false;
-#endif
-  }
-
- private:
-  enum special_values {
-    // Known bad pc value to ensure that the simulator does not execute
-    // without being properly setup.
-    bad_lr = -1,
-    // A pc value used to signal the simulator to stop execution.  Generally
-    // the lr is set to this value on transition from native C code to
-    // simulated execution, so that the simulator can "return" to the native
-    // C code.
-    end_sim_pc = -2
-  };
-
-  V8_EXPORT_PRIVATE intptr_t CallImpl(byte* entry, int argument_count,
-                                      const intptr_t* arguments);
-  intptr_t CallFPImpl(byte* entry, double d0, double d1);
-
-  // Unsupported instructions use Format to print an error and stop execution.
-  void Format(Instruction* instr, const char* format);
-
-  // Checks if the current instruction should be executed based on its
-  // condition bits.
-  inline bool ConditionallyExecute(Instruction* instr);
-
-  // Helper functions to set the conditional flags in the architecture state.
-  void SetNZFlags(int32_t val);
-  void SetCFlag(bool val);
-  void SetVFlag(bool val);
-  bool CarryFrom(int32_t left, int32_t right, int32_t carry = 0);
-  bool BorrowFrom(int32_t left, int32_t right, int32_t carry = 1);
-  bool OverflowFrom(int32_t alu_out,
-                    int32_t left,
-                    int32_t right,
-                    bool addition);
-
-  inline int GetCarry() {
-    return c_flag_ ? 1 : 0;
-  }
-
-  // Support for VFP.
-  void Compute_FPSCR_Flags(float val1, float val2);
-  void Compute_FPSCR_Flags(double val1, double val2);
-  void Copy_FPSCR_to_APSR();
-  inline float canonicalizeNaN(float value);
-  inline double canonicalizeNaN(double value);
-  inline Float32 canonicalizeNaN(Float32 value);
-  inline Float64 canonicalizeNaN(Float64 value);
-
-  // Helper functions to decode common "addressing" modes
-  int32_t GetShiftRm(Instruction* instr, bool* carry_out);
-  int32_t GetImm(Instruction* instr, bool* carry_out);
-  int32_t ProcessPU(Instruction* instr,
-                    int num_regs,
-                    int operand_size,
-                    intptr_t* start_address,
-                    intptr_t* end_address);
-  void HandleRList(Instruction* instr, bool load);
-  void HandleVList(Instruction* inst);
-  void SoftwareInterrupt(Instruction* instr);
-
-  // Stop helper functions.
-  inline bool isStopInstruction(Instruction* instr);
-  inline bool isWatchedStop(uint32_t bkpt_code);
-  inline bool isEnabledStop(uint32_t bkpt_code);
-  inline void EnableStop(uint32_t bkpt_code);
-  inline void DisableStop(uint32_t bkpt_code);
-  inline void IncreaseStopCounter(uint32_t bkpt_code);
-  void PrintStopInfo(uint32_t code);
-
-  // Read and write memory.
-  // The *Ex functions are exclusive access. The writes return the strex status:
-  // 0 if the write succeeds, and 1 if the write fails.
-  inline uint8_t ReadBU(int32_t addr);
-  inline int8_t ReadB(int32_t addr);
-  uint8_t ReadExBU(int32_t addr);
-  inline void WriteB(int32_t addr, uint8_t value);
-  inline void WriteB(int32_t addr, int8_t value);
-  int WriteExB(int32_t addr, uint8_t value);
-
-  inline uint16_t ReadHU(int32_t addr, Instruction* instr);
-  inline int16_t ReadH(int32_t addr, Instruction* instr);
-  uint16_t ReadExHU(int32_t addr, Instruction* instr);
-  // Note: Overloaded on the sign of the value.
-  inline void WriteH(int32_t addr, uint16_t value, Instruction* instr);
-  inline void WriteH(int32_t addr, int16_t value, Instruction* instr);
-  int WriteExH(int32_t addr, uint16_t value, Instruction* instr);
-
-  inline int ReadW(int32_t addr, Instruction* instr);
-  int ReadExW(int32_t addr, Instruction* instr);
-  inline void WriteW(int32_t addr, int value, Instruction* instr);
-  int WriteExW(int32_t addr, int value, Instruction* instr);
-
-  int32_t* ReadDW(int32_t addr);
-  void WriteDW(int32_t addr, int32_t value1, int32_t value2);
-
-  // Executing is handled based on the instruction type.
-  // Both type 0 and type 1 rolled into one.
-  void DecodeType01(Instruction* instr);
-  void DecodeType2(Instruction* instr);
-  void DecodeType3(Instruction* instr);
-  void DecodeType4(Instruction* instr);
-  void DecodeType5(Instruction* instr);
-  void DecodeType6(Instruction* instr);
-  void DecodeType7(Instruction* instr);
-
-  // CP15 coprocessor instructions.
-  void DecodeTypeCP15(Instruction* instr);
-
-  // Support for VFP.
-  void DecodeTypeVFP(Instruction* instr);
-  void DecodeType6CoprocessorIns(Instruction* instr);
-  void DecodeSpecialCondition(Instruction* instr);
-
-  void DecodeVMOVBetweenCoreAndSinglePrecisionRegisters(Instruction* instr);
-  void DecodeVCMP(Instruction* instr);
-  void DecodeVCVTBetweenDoubleAndSingle(Instruction* instr);
-  int32_t ConvertDoubleToInt(double val, bool unsigned_integer,
-                             VFPRoundingMode mode);
-  void DecodeVCVTBetweenFloatingPointAndInteger(Instruction* instr);
-
-  // Executes one instruction.
-  void InstructionDecode(Instruction* instr);
-
-  // ICache.
-  static void CheckICache(base::CustomMatcherHashMap* i_cache,
-                          Instruction* instr);
-  static void FlushOnePage(base::CustomMatcherHashMap* i_cache, intptr_t start,
-                           int size);
-  static CachePage* GetCachePage(base::CustomMatcherHashMap* i_cache,
-                                 void* page);
-
-  // Handle arguments and return value for runtime FP functions.
-  void GetFpArgs(double* x, double* y, int32_t* z);
-  void SetFpResult(const double& result);
-  void TrashCallerSaveRegisters();
-
-  template<class ReturnType, int register_size>
-      ReturnType GetFromVFPRegister(int reg_index);
-
-  template<class InputType, int register_size>
-      void SetVFPRegister(int reg_index, const InputType& value);
-
-  void SetSpecialRegister(SRegisterFieldMask reg_and_mask, uint32_t value);
-  uint32_t GetFromSpecialRegister(SRegister reg);
-
-  void CallInternal(byte* entry);
-
-  // Architecture state.
-  // Saturating instructions require a Q flag to indicate saturation.
-  // There is currently no way to read the CPSR directly, and thus read the Q
-  // flag, so this is left unimplemented.
-  int32_t registers_[16];
-  bool n_flag_;
-  bool z_flag_;
-  bool c_flag_;
-  bool v_flag_;
-
-  // VFP architecture state.
-  unsigned int vfp_registers_[num_d_registers * 2];
-  bool n_flag_FPSCR_;
-  bool z_flag_FPSCR_;
-  bool c_flag_FPSCR_;
-  bool v_flag_FPSCR_;
-
-  // VFP rounding mode. See ARM DDI 0406B Page A2-29.
-  VFPRoundingMode FPSCR_rounding_mode_;
-  bool FPSCR_default_NaN_mode_;
-
-  // VFP FP exception flags architecture state.
-  bool inv_op_vfp_flag_;
-  bool div_zero_vfp_flag_;
-  bool overflow_vfp_flag_;
-  bool underflow_vfp_flag_;
-  bool inexact_vfp_flag_;
-
-  // Simulator support.
-  char* stack_;
-  bool pc_modified_;
-  int icount_;
-
-  // Debugger input.
-  char* last_debugger_input_;
-
-  // Icache simulation
-  base::CustomMatcherHashMap* i_cache_;
-
-  // Registered breakpoints.
-  Instruction* break_pc_;
-  Instr break_instr_;
-
-  v8::internal::Isolate* isolate_;
-
-  // A stop is watched if its code is less than kNumOfWatchedStops.
-  // Only watched stops support enabling/disabling and the counter feature.
-  static const uint32_t kNumOfWatchedStops = 256;
-
-  // Breakpoint is disabled if bit 31 is set.
-  static const uint32_t kStopDisabledBit = 1 << 31;
-
-  // A stop is enabled, meaning the simulator will stop when meeting the
-  // instruction, if bit 31 of watched_stops_[code].count is unset.
-  // The value watched_stops_[code].count & ~(1 << 31) indicates how many times
-  // the breakpoint was hit or gone through.
-  struct StopCountAndDesc {
-    uint32_t count;
-    char* desc;
-  };
-  StopCountAndDesc watched_stops_[kNumOfWatchedStops];
-
-  // Synchronization primitives. See ARM DDI 0406C.b, A2.9.
-  enum class MonitorAccess {
-    Open,
-    Exclusive,
-  };
-
-  enum class TransactionSize {
-    None = 0,
-    Byte = 1,
-    HalfWord = 2,
-    Word = 4,
-  };
-
-  // The least-significant bits of the address are ignored. The number of bits
-  // is implementation-defined, between 3 and 11. See ARM DDI 0406C.b, A3.4.3.
-  static const int32_t kExclusiveTaggedAddrMask = ~((1 << 11) - 1);
-
-  class LocalMonitor {
-   public:
-    LocalMonitor();
-
-    // These functions manage the state machine for the local monitor, but do
-    // not actually perform loads and stores. NotifyStoreExcl only returns
-    // true if the exclusive store is allowed; the global monitor will still
-    // have to be checked to see whether the memory should be updated.
-    void NotifyLoad(int32_t addr);
-    void NotifyLoadExcl(int32_t addr, TransactionSize size);
-    void NotifyStore(int32_t addr);
-    bool NotifyStoreExcl(int32_t addr, TransactionSize size);
-
-   private:
-    void Clear();
-
-    MonitorAccess access_state_;
-    int32_t tagged_addr_;
-    TransactionSize size_;
-  };
-
-  class GlobalMonitor {
-   public:
-    GlobalMonitor();
-
-    class Processor {
-     public:
-      Processor();
-
-     private:
-      friend class GlobalMonitor;
-      // These functions manage the state machine for the global monitor, but do
-      // not actually perform loads and stores.
-      void Clear_Locked();
-      void NotifyLoadExcl_Locked(int32_t addr);
-      void NotifyStore_Locked(int32_t addr, bool is_requesting_processor);
-      bool NotifyStoreExcl_Locked(int32_t addr, bool is_requesting_processor);
-
-      MonitorAccess access_state_;
-      int32_t tagged_addr_;
-      Processor* next_;
-      Processor* prev_;
-      // A strex can fail due to background cache evictions. Rather than
-      // simulating this, we'll just occasionally introduce cases where an
-      // exclusive store fails. This will happen once after every
-      // kMaxFailureCounter exclusive stores.
-      static const int kMaxFailureCounter = 5;
-      int failure_counter_;
-    };
-
-    // Exposed so it can be accessed by Simulator::{Read,Write}Ex*.
-    base::Mutex mutex;
-
-    void NotifyLoadExcl_Locked(int32_t addr, Processor* processor);
-    void NotifyStore_Locked(int32_t addr, Processor* processor);
-    bool NotifyStoreExcl_Locked(int32_t addr, Processor* processor);
-
-    // Called when the simulator is destroyed.
-    void RemoveProcessor(Processor* processor);
-
-   private:
-    bool IsProcessorInLinkedList_Locked(Processor* processor) const;
-    void PrependProcessor_Locked(Processor* processor);
-
-    Processor* head_;
-  };
-
-  LocalMonitor local_monitor_;
-  GlobalMonitor::Processor global_monitor_processor_;
-  static base::LazyInstance<GlobalMonitor>::type global_monitor_;
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // defined(USE_SIMULATOR)
-#endif  // V8_ARM_SIMULATOR_ARM_H_
diff --git a/src/v8/src/arm64/assembler-arm64-inl.h b/src/v8/src/arm64/assembler-arm64-inl.h
deleted file mode 100644
index 11c4bbf..0000000
--- a/src/v8/src/arm64/assembler-arm64-inl.h
+++ /dev/null
@@ -1,1082 +0,0 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_ARM64_ASSEMBLER_ARM64_INL_H_
-#define V8_ARM64_ASSEMBLER_ARM64_INL_H_
-
-#include "src/arm64/assembler-arm64.h"
-#include "src/assembler.h"
-#include "src/debug/debug.h"
-#include "src/objects-inl.h"
-
-namespace v8 {
-namespace internal {
-
-
-bool CpuFeatures::SupportsCrankshaft() { return true; }
-
-bool CpuFeatures::SupportsWasmSimd128() { return true; }
-
-void RelocInfo::apply(intptr_t delta) {
-  // On arm64 only internal references need extra work.
-  DCHECK(RelocInfo::IsInternalReference(rmode_));
-
-  // Absolute code pointer inside code object moves with the code object.
-  intptr_t* p = reinterpret_cast<intptr_t*>(pc_);
-  *p += delta;  // Relocate entry.
-}
-
-
-inline bool CPURegister::IsSameSizeAndType(const CPURegister& other) const {
-  return (reg_size_ == other.reg_size_) && (reg_type_ == other.reg_type_);
-}
-
-
-inline bool CPURegister::IsZero() const {
-  DCHECK(IsValid());
-  return IsRegister() && (reg_code_ == kZeroRegCode);
-}
-
-
-inline bool CPURegister::IsSP() const {
-  DCHECK(IsValid());
-  return IsRegister() && (reg_code_ == kSPRegInternalCode);
-}
-
-
-inline void CPURegList::Combine(const CPURegList& other) {
-  DCHECK(IsValid());
-  DCHECK(other.type() == type_);
-  DCHECK(other.RegisterSizeInBits() == size_);
-  list_ |= other.list();
-}
-
-
-inline void CPURegList::Remove(const CPURegList& other) {
-  DCHECK(IsValid());
-  if (other.type() == type_) {
-    list_ &= ~other.list();
-  }
-}
-
-
-inline void CPURegList::Combine(const CPURegister& other) {
-  DCHECK(other.type() == type_);
-  DCHECK(other.SizeInBits() == size_);
-  Combine(other.code());
-}
-
-
-inline void CPURegList::Remove(const CPURegister& other1,
-                               const CPURegister& other2,
-                               const CPURegister& other3,
-                               const CPURegister& other4) {
-  if (!other1.IsNone() && (other1.type() == type_)) Remove(other1.code());
-  if (!other2.IsNone() && (other2.type() == type_)) Remove(other2.code());
-  if (!other3.IsNone() && (other3.type() == type_)) Remove(other3.code());
-  if (!other4.IsNone() && (other4.type() == type_)) Remove(other4.code());
-}
-
-
-inline void CPURegList::Combine(int code) {
-  DCHECK(IsValid());
-  DCHECK(CPURegister::Create(code, size_, type_).IsValid());
-  list_ |= (1UL << code);
-}
-
-
-inline void CPURegList::Remove(int code) {
-  DCHECK(IsValid());
-  DCHECK(CPURegister::Create(code, size_, type_).IsValid());
-  list_ &= ~(1UL << code);
-}
-
-
-inline Register Register::XRegFromCode(unsigned code) {
-  if (code == kSPRegInternalCode) {
-    return csp;
-  } else {
-    DCHECK_LT(code, static_cast<unsigned>(kNumberOfRegisters));
-    return Register::Create(code, kXRegSizeInBits);
-  }
-}
-
-
-inline Register Register::WRegFromCode(unsigned code) {
-  if (code == kSPRegInternalCode) {
-    return wcsp;
-  } else {
-    DCHECK_LT(code, static_cast<unsigned>(kNumberOfRegisters));
-    return Register::Create(code, kWRegSizeInBits);
-  }
-}
-
-inline VRegister VRegister::BRegFromCode(unsigned code) {
-  DCHECK_LT(code, static_cast<unsigned>(kNumberOfVRegisters));
-  return VRegister::Create(code, kBRegSizeInBits);
-}
-
-inline VRegister VRegister::HRegFromCode(unsigned code) {
-  DCHECK_LT(code, static_cast<unsigned>(kNumberOfVRegisters));
-  return VRegister::Create(code, kHRegSizeInBits);
-}
-
-inline VRegister VRegister::SRegFromCode(unsigned code) {
-  DCHECK_LT(code, static_cast<unsigned>(kNumberOfVRegisters));
-  return VRegister::Create(code, kSRegSizeInBits);
-}
-
-inline VRegister VRegister::DRegFromCode(unsigned code) {
-  DCHECK_LT(code, static_cast<unsigned>(kNumberOfVRegisters));
-  return VRegister::Create(code, kDRegSizeInBits);
-}
-
-inline VRegister VRegister::QRegFromCode(unsigned code) {
-  DCHECK_LT(code, static_cast<unsigned>(kNumberOfVRegisters));
-  return VRegister::Create(code, kQRegSizeInBits);
-}
-
-inline VRegister VRegister::VRegFromCode(unsigned code) {
-  DCHECK_LT(code, static_cast<unsigned>(kNumberOfVRegisters));
-  return VRegister::Create(code, kVRegSizeInBits);
-}
-
-inline Register CPURegister::W() const {
-  DCHECK(IsRegister());
-  return Register::WRegFromCode(reg_code_);
-}
-
-inline Register CPURegister::Reg() const {
-  DCHECK(IsRegister());
-  return Register::Create(reg_code_, reg_size_);
-}
-
-inline VRegister CPURegister::VReg() const {
-  DCHECK(IsVRegister());
-  return VRegister::Create(reg_code_, reg_size_);
-}
-
-inline Register CPURegister::X() const {
-  DCHECK(IsRegister());
-  return Register::XRegFromCode(reg_code_);
-}
-
-inline VRegister CPURegister::V() const {
-  DCHECK(IsVRegister());
-  return VRegister::VRegFromCode(reg_code_);
-}
-
-inline VRegister CPURegister::B() const {
-  DCHECK(IsVRegister());
-  return VRegister::BRegFromCode(reg_code_);
-}
-
-inline VRegister CPURegister::H() const {
-  DCHECK(IsVRegister());
-  return VRegister::HRegFromCode(reg_code_);
-}
-
-inline VRegister CPURegister::S() const {
-  DCHECK(IsVRegister());
-  return VRegister::SRegFromCode(reg_code_);
-}
-
-inline VRegister CPURegister::D() const {
-  DCHECK(IsVRegister());
-  return VRegister::DRegFromCode(reg_code_);
-}
-
-inline VRegister CPURegister::Q() const {
-  DCHECK(IsVRegister());
-  return VRegister::QRegFromCode(reg_code_);
-}
-
-
-// Immediate.
-// Default initializer is for int types
-template<typename T>
-struct ImmediateInitializer {
-  static const bool kIsIntType = true;
-  static inline RelocInfo::Mode rmode_for(T) {
-    return sizeof(T) == 8 ? RelocInfo::NONE64 : RelocInfo::NONE32;
-  }
-  static inline int64_t immediate_for(T t) {
-    STATIC_ASSERT(sizeof(T) <= 8);
-    return t;
-  }
-};
-
-
-template<>
-struct ImmediateInitializer<Smi*> {
-  static const bool kIsIntType = false;
-  static inline RelocInfo::Mode rmode_for(Smi* t) {
-    return RelocInfo::NONE64;
-  }
-  static inline int64_t immediate_for(Smi* t) {;
-    return reinterpret_cast<int64_t>(t);
-  }
-};
-
-
-template<>
-struct ImmediateInitializer<ExternalReference> {
-  static const bool kIsIntType = false;
-  static inline RelocInfo::Mode rmode_for(ExternalReference t) {
-    return RelocInfo::EXTERNAL_REFERENCE;
-  }
-  static inline int64_t immediate_for(ExternalReference t) {;
-    return reinterpret_cast<int64_t>(t.address());
-  }
-};
-
-
-template<typename T>
-Immediate::Immediate(Handle<T> value) {
-  InitializeHandle(value);
-}
-
-
-template<typename T>
-Immediate::Immediate(T t)
-    : value_(ImmediateInitializer<T>::immediate_for(t)),
-      rmode_(ImmediateInitializer<T>::rmode_for(t)) {}
-
-
-template<typename T>
-Immediate::Immediate(T t, RelocInfo::Mode rmode)
-    : value_(ImmediateInitializer<T>::immediate_for(t)),
-      rmode_(rmode) {
-  STATIC_ASSERT(ImmediateInitializer<T>::kIsIntType);
-}
-
-// Operand.
-template<typename T>
-Operand::Operand(Handle<T> value) : immediate_(value), reg_(NoReg) {}
-
-
-template<typename T>
-Operand::Operand(T t) : immediate_(t), reg_(NoReg) {}
-
-
-template<typename T>
-Operand::Operand(T t, RelocInfo::Mode rmode)
-    : immediate_(t, rmode),
-      reg_(NoReg) {}
-
-Operand::Operand(Register reg, Shift shift, unsigned shift_amount)
-    : immediate_(0),
-      reg_(reg),
-      shift_(shift),
-      extend_(NO_EXTEND),
-      shift_amount_(shift_amount) {
-  DCHECK(reg.Is64Bits() || (shift_amount < kWRegSizeInBits));
-  DCHECK(reg.Is32Bits() || (shift_amount < kXRegSizeInBits));
-  DCHECK(!reg.IsSP());
-}
-
-
-Operand::Operand(Register reg, Extend extend, unsigned shift_amount)
-    : immediate_(0),
-      reg_(reg),
-      shift_(NO_SHIFT),
-      extend_(extend),
-      shift_amount_(shift_amount) {
-  DCHECK(reg.IsValid());
-  DCHECK_LE(shift_amount, 4);
-  DCHECK(!reg.IsSP());
-
-  // Extend modes SXTX and UXTX require a 64-bit register.
-  DCHECK(reg.Is64Bits() || ((extend != SXTX) && (extend != UXTX)));
-}
-
-bool Operand::IsHeapObjectRequest() const {
-  DCHECK_IMPLIES(heap_object_request_.has_value(), reg_.Is(NoReg));
-  DCHECK_IMPLIES(heap_object_request_.has_value(),
-                 immediate_.rmode() == RelocInfo::EMBEDDED_OBJECT ||
-                     immediate_.rmode() == RelocInfo::CODE_TARGET);
-  return heap_object_request_.has_value();
-}
-
-HeapObjectRequest Operand::heap_object_request() const {
-  DCHECK(IsHeapObjectRequest());
-  return *heap_object_request_;
-}
-
-bool Operand::IsImmediate() const {
-  return reg_.Is(NoReg) && !IsHeapObjectRequest();
-}
-
-
-bool Operand::IsShiftedRegister() const {
-  return reg_.IsValid() && (shift_ != NO_SHIFT);
-}
-
-
-bool Operand::IsExtendedRegister() const {
-  return reg_.IsValid() && (extend_ != NO_EXTEND);
-}
-
-
-bool Operand::IsZero() const {
-  if (IsImmediate()) {
-    return ImmediateValue() == 0;
-  } else {
-    return reg().IsZero();
-  }
-}
-
-
-Operand Operand::ToExtendedRegister() const {
-  DCHECK(IsShiftedRegister());
-  DCHECK((shift_ == LSL) && (shift_amount_ <= 4));
-  return Operand(reg_, reg_.Is64Bits() ? UXTX : UXTW, shift_amount_);
-}
-
-Immediate Operand::immediate_for_heap_object_request() const {
-  DCHECK((heap_object_request().kind() == HeapObjectRequest::kHeapNumber &&
-          immediate_.rmode() == RelocInfo::EMBEDDED_OBJECT) ||
-         (heap_object_request().kind() == HeapObjectRequest::kCodeStub &&
-          immediate_.rmode() == RelocInfo::CODE_TARGET));
-  return immediate_;
-}
-
-Immediate Operand::immediate() const {
-  DCHECK(IsImmediate());
-  return immediate_;
-}
-
-
-int64_t Operand::ImmediateValue() const {
-  DCHECK(IsImmediate());
-  return immediate_.value();
-}
-
-
-Register Operand::reg() const {
-  DCHECK(IsShiftedRegister() || IsExtendedRegister());
-  return reg_;
-}
-
-
-Shift Operand::shift() const {
-  DCHECK(IsShiftedRegister());
-  return shift_;
-}
-
-
-Extend Operand::extend() const {
-  DCHECK(IsExtendedRegister());
-  return extend_;
-}
-
-
-unsigned Operand::shift_amount() const {
-  DCHECK(IsShiftedRegister() || IsExtendedRegister());
-  return shift_amount_;
-}
-
-
-Operand Operand::UntagSmi(Register smi) {
-  STATIC_ASSERT(kXRegSizeInBits == static_cast<unsigned>(kSmiShift +
-                                                         kSmiValueSize));
-  DCHECK(smi.Is64Bits());
-  return Operand(smi, ASR, kSmiShift);
-}
-
-
-Operand Operand::UntagSmiAndScale(Register smi, int scale) {
-  STATIC_ASSERT(kXRegSizeInBits == static_cast<unsigned>(kSmiShift +
-                                                         kSmiValueSize));
-  DCHECK(smi.Is64Bits());
-  DCHECK((scale >= 0) && (scale <= (64 - kSmiValueSize)));
-  if (scale > kSmiShift) {
-    return Operand(smi, LSL, scale - kSmiShift);
-  } else if (scale < kSmiShift) {
-    return Operand(smi, ASR, kSmiShift - scale);
-  }
-  return Operand(smi);
-}
-
-
-MemOperand::MemOperand()
-  : base_(NoReg), regoffset_(NoReg), offset_(0), addrmode_(Offset),
-    shift_(NO_SHIFT), extend_(NO_EXTEND), shift_amount_(0) {
-}
-
-
-MemOperand::MemOperand(Register base, int64_t offset, AddrMode addrmode)
-  : base_(base), regoffset_(NoReg), offset_(offset), addrmode_(addrmode),
-    shift_(NO_SHIFT), extend_(NO_EXTEND), shift_amount_(0) {
-  DCHECK(base.Is64Bits() && !base.IsZero());
-}
-
-
-MemOperand::MemOperand(Register base,
-                       Register regoffset,
-                       Extend extend,
-                       unsigned shift_amount)
-  : base_(base), regoffset_(regoffset), offset_(0), addrmode_(Offset),
-    shift_(NO_SHIFT), extend_(extend), shift_amount_(shift_amount) {
-  DCHECK(base.Is64Bits() && !base.IsZero());
-  DCHECK(!regoffset.IsSP());
-  DCHECK((extend == UXTW) || (extend == SXTW) || (extend == SXTX));
-
-  // SXTX extend mode requires a 64-bit offset register.
-  DCHECK(regoffset.Is64Bits() || (extend != SXTX));
-}
-
-
-MemOperand::MemOperand(Register base,
-                       Register regoffset,
-                       Shift shift,
-                       unsigned shift_amount)
-  : base_(base), regoffset_(regoffset), offset_(0), addrmode_(Offset),
-    shift_(shift), extend_(NO_EXTEND), shift_amount_(shift_amount) {
-  DCHECK(base.Is64Bits() && !base.IsZero());
-  DCHECK(regoffset.Is64Bits() && !regoffset.IsSP());
-  DCHECK(shift == LSL);
-}
-
-MemOperand::MemOperand(Register base, const Operand& offset, AddrMode addrmode)
-    : base_(base), regoffset_(NoReg), addrmode_(addrmode) {
-  DCHECK(base.Is64Bits() && !base.IsZero());
-
-  if (offset.IsImmediate()) {
-    offset_ = offset.ImmediateValue();
-  } else if (offset.IsShiftedRegister()) {
-    DCHECK((addrmode == Offset) || (addrmode == PostIndex));
-
-    regoffset_ = offset.reg();
-    shift_ = offset.shift();
-    shift_amount_ = offset.shift_amount();
-
-    extend_ = NO_EXTEND;
-    offset_ = 0;
-
-    // These assertions match those in the shifted-register constructor.
-    DCHECK(regoffset_.Is64Bits() && !regoffset_.IsSP());
-    DCHECK(shift_ == LSL);
-  } else {
-    DCHECK(offset.IsExtendedRegister());
-    DCHECK(addrmode == Offset);
-
-    regoffset_ = offset.reg();
-    extend_ = offset.extend();
-    shift_amount_ = offset.shift_amount();
-
-    shift_ = NO_SHIFT;
-    offset_ = 0;
-
-    // These assertions match those in the extended-register constructor.
-    DCHECK(!regoffset_.IsSP());
-    DCHECK((extend_ == UXTW) || (extend_ == SXTW) || (extend_ == SXTX));
-    DCHECK((regoffset_.Is64Bits() || (extend_ != SXTX)));
-  }
-}
-
-bool MemOperand::IsImmediateOffset() const {
-  return (addrmode_ == Offset) && regoffset_.Is(NoReg);
-}
-
-
-bool MemOperand::IsRegisterOffset() const {
-  return (addrmode_ == Offset) && !regoffset_.Is(NoReg);
-}
-
-
-bool MemOperand::IsPreIndex() const {
-  return addrmode_ == PreIndex;
-}
-
-
-bool MemOperand::IsPostIndex() const {
-  return addrmode_ == PostIndex;
-}
-
-Operand MemOperand::OffsetAsOperand() const {
-  if (IsImmediateOffset()) {
-    return offset();
-  } else {
-    DCHECK(IsRegisterOffset());
-    if (extend() == NO_EXTEND) {
-      return Operand(regoffset(), shift(), shift_amount());
-    } else {
-      return Operand(regoffset(), extend(), shift_amount());
-    }
-  }
-}
-
-
-void Assembler::Unreachable() {
-#ifdef USE_SIMULATOR
-  debug("UNREACHABLE", __LINE__, BREAK);
-#else
-  // Crash by branching to 0. lr now points near the fault.
-  Emit(BLR | Rn(xzr));
-#endif
-}
-
-
-Address Assembler::target_pointer_address_at(Address pc) {
-  Instruction* instr = reinterpret_cast<Instruction*>(pc);
-  DCHECK(instr->IsLdrLiteralX());
-  return reinterpret_cast<Address>(instr->ImmPCOffsetTarget());
-}
-
-
-// Read/Modify the code target address in the branch/call instruction at pc.
-Address Assembler::target_address_at(Address pc, Address constant_pool) {
-  return Memory::Address_at(target_pointer_address_at(pc));
-}
-
-
-Address Assembler::target_address_from_return_address(Address pc) {
-  // Returns the address of the call target from the return address that will
-  // be returned to after a call.
-  // Call sequence on ARM64 is:
-  //  ldr ip0, #... @ load from literal pool
-  //  blr ip0
-  Address candidate = pc - 2 * kInstructionSize;
-  Instruction* instr = reinterpret_cast<Instruction*>(candidate);
-  USE(instr);
-  DCHECK(instr->IsLdrLiteralX());
-  return candidate;
-}
-
-
-Address Assembler::return_address_from_call_start(Address pc) {
-  // The call, generated by MacroAssembler::Call, is one of two possible
-  // sequences:
-  //
-  // Without relocation:
-  //  movz  temp, #(target & 0x000000000000ffff)
-  //  movk  temp, #(target & 0x00000000ffff0000)
-  //  movk  temp, #(target & 0x0000ffff00000000)
-  //  blr   temp
-  //
-  // With relocation:
-  //  ldr   temp, =target
-  //  blr   temp
-  //
-  // The return address is immediately after the blr instruction in both cases,
-  // so it can be found by adding the call size to the address at the start of
-  // the call sequence.
-  STATIC_ASSERT(Assembler::kCallSizeWithoutRelocation == 4 * kInstructionSize);
-  STATIC_ASSERT(Assembler::kCallSizeWithRelocation == 2 * kInstructionSize);
-
-  Instruction* instr = reinterpret_cast<Instruction*>(pc);
-  if (instr->IsMovz()) {
-    // Verify the instruction sequence.
-    DCHECK(instr->following(1)->IsMovk());
-    DCHECK(instr->following(2)->IsMovk());
-    DCHECK(instr->following(3)->IsBranchAndLinkToRegister());
-    return pc + Assembler::kCallSizeWithoutRelocation;
-  } else {
-    // Verify the instruction sequence.
-    DCHECK(instr->IsLdrLiteralX());
-    DCHECK(instr->following(1)->IsBranchAndLinkToRegister());
-    return pc + Assembler::kCallSizeWithRelocation;
-  }
-}
-
-
-void Assembler::deserialization_set_special_target_at(
-    Isolate* isolate, Address constant_pool_entry, Code* code, Address target) {
-  Memory::Address_at(constant_pool_entry) = target;
-}
-
-
-void Assembler::deserialization_set_target_internal_reference_at(
-    Isolate* isolate, Address pc, Address target, RelocInfo::Mode mode) {
-  Memory::Address_at(pc) = target;
-}
-
-
-void Assembler::set_target_address_at(Isolate* isolate, Address pc,
-                                      Address constant_pool, Address target,
-                                      ICacheFlushMode icache_flush_mode) {
-  Memory::Address_at(target_pointer_address_at(pc)) = target;
-  // Intuitively, we would think it is necessary to always flush the
-  // instruction cache after patching a target address in the code as follows:
-  //   Assembler::FlushICache(isolate(), pc, sizeof(target));
-  // However, on ARM, an instruction is actually patched in the case of
-  // embedded constants of the form:
-  // ldr   ip, [pc, #...]
-  // since the instruction accessing this address in the constant pool remains
-  // unchanged, a flush is not required.
-}
-
-
-int RelocInfo::target_address_size() {
-  return kPointerSize;
-}
-
-
-Address RelocInfo::target_address() {
-  DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) || IsWasmCall(rmode_));
-  return Assembler::target_address_at(pc_, constant_pool_);
-}
-
-Address RelocInfo::target_address_address() {
-  DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) || IsWasmCall(rmode_) ||
-         rmode_ == EMBEDDED_OBJECT || rmode_ == EXTERNAL_REFERENCE);
-  return Assembler::target_pointer_address_at(pc_);
-}
-
-
-Address RelocInfo::constant_pool_entry_address() {
-  DCHECK(IsInConstantPool());
-  return Assembler::target_pointer_address_at(pc_);
-}
-
-HeapObject* RelocInfo::target_object() {
-  DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
-  return HeapObject::cast(reinterpret_cast<Object*>(
-      Assembler::target_address_at(pc_, constant_pool_)));
-}
-
-Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
-  DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
-  return Handle<HeapObject>(reinterpret_cast<HeapObject**>(
-      Assembler::target_address_at(pc_, constant_pool_)));
-}
-
-void RelocInfo::set_target_object(HeapObject* target,
-                                  WriteBarrierMode write_barrier_mode,
-                                  ICacheFlushMode icache_flush_mode) {
-  DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
-  Assembler::set_target_address_at(target->GetIsolate(), pc_, constant_pool_,
-                                   reinterpret_cast<Address>(target),
-                                   icache_flush_mode);
-  if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != nullptr) {
-    host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(host(), this,
-                                                                  target);
-    host()->GetHeap()->RecordWriteIntoCode(host(), this, target);
-  }
-}
-
-
-Address RelocInfo::target_external_reference() {
-  DCHECK(rmode_ == EXTERNAL_REFERENCE);
-  return Assembler::target_address_at(pc_, constant_pool_);
-}
-
-
-Address RelocInfo::target_internal_reference() {
-  DCHECK(rmode_ == INTERNAL_REFERENCE);
-  return Memory::Address_at(pc_);
-}
-
-
-Address RelocInfo::target_internal_reference_address() {
-  DCHECK(rmode_ == INTERNAL_REFERENCE);
-  return reinterpret_cast<Address>(pc_);
-}
-
-
-Address RelocInfo::target_runtime_entry(Assembler* origin) {
-  DCHECK(IsRuntimeEntry(rmode_));
-  return target_address();
-}
-
-void RelocInfo::set_target_runtime_entry(Isolate* isolate, Address target,
-                                         WriteBarrierMode write_barrier_mode,
-                                         ICacheFlushMode icache_flush_mode) {
-  DCHECK(IsRuntimeEntry(rmode_));
-  if (target_address() != target) {
-    set_target_address(isolate, target, write_barrier_mode, icache_flush_mode);
-  }
-}
-
-void RelocInfo::WipeOut(Isolate* isolate) {
-  DCHECK(IsEmbeddedObject(rmode_) || IsCodeTarget(rmode_) ||
-         IsRuntimeEntry(rmode_) || IsExternalReference(rmode_) ||
-         IsInternalReference(rmode_));
-  if (IsInternalReference(rmode_)) {
-    Memory::Address_at(pc_) = nullptr;
-  } else {
-    Assembler::set_target_address_at(isolate, pc_, constant_pool_, nullptr);
-  }
-}
-
-template <typename ObjectVisitor>
-void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) {
-  RelocInfo::Mode mode = rmode();
-  if (mode == RelocInfo::EMBEDDED_OBJECT) {
-    visitor->VisitEmbeddedPointer(host(), this);
-  } else if (RelocInfo::IsCodeTarget(mode)) {
-    visitor->VisitCodeTarget(host(), this);
-  } else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
-    visitor->VisitExternalReference(host(), this);
-  } else if (mode == RelocInfo::INTERNAL_REFERENCE) {
-    visitor->VisitInternalReference(host(), this);
-  } else if (RelocInfo::IsRuntimeEntry(mode)) {
-    visitor->VisitRuntimeEntry(host(), this);
-  }
-}
-
-LoadStoreOp Assembler::LoadOpFor(const CPURegister& rt) {
-  DCHECK(rt.IsValid());
-  if (rt.IsRegister()) {
-    return rt.Is64Bits() ? LDR_x : LDR_w;
-  } else {
-    DCHECK(rt.IsVRegister());
-    switch (rt.SizeInBits()) {
-      case kBRegSizeInBits:
-        return LDR_b;
-      case kHRegSizeInBits:
-        return LDR_h;
-      case kSRegSizeInBits:
-        return LDR_s;
-      case kDRegSizeInBits:
-        return LDR_d;
-      default:
-        DCHECK(rt.IsQ());
-        return LDR_q;
-    }
-  }
-}
-
-
-LoadStoreOp Assembler::StoreOpFor(const CPURegister& rt) {
-  DCHECK(rt.IsValid());
-  if (rt.IsRegister()) {
-    return rt.Is64Bits() ? STR_x : STR_w;
-  } else {
-    DCHECK(rt.IsVRegister());
-    switch (rt.SizeInBits()) {
-      case kBRegSizeInBits:
-        return STR_b;
-      case kHRegSizeInBits:
-        return STR_h;
-      case kSRegSizeInBits:
-        return STR_s;
-      case kDRegSizeInBits:
-        return STR_d;
-      default:
-        DCHECK(rt.IsQ());
-        return STR_q;
-    }
-  }
-}
-
-LoadStorePairOp Assembler::LoadPairOpFor(const CPURegister& rt,
-                                         const CPURegister& rt2) {
-  DCHECK_EQ(STP_w | LoadStorePairLBit, LDP_w);
-  return static_cast<LoadStorePairOp>(StorePairOpFor(rt, rt2) |
-                                      LoadStorePairLBit);
-}
-
-LoadStorePairOp Assembler::StorePairOpFor(const CPURegister& rt,
-                                          const CPURegister& rt2) {
-  DCHECK(AreSameSizeAndType(rt, rt2));
-  USE(rt2);
-  if (rt.IsRegister()) {
-    return rt.Is64Bits() ? STP_x : STP_w;
-  } else {
-    DCHECK(rt.IsVRegister());
-    switch (rt.SizeInBits()) {
-      case kSRegSizeInBits:
-        return STP_s;
-      case kDRegSizeInBits:
-        return STP_d;
-      default:
-        DCHECK(rt.IsQ());
-        return STP_q;
-    }
-  }
-}
-
-
-LoadLiteralOp Assembler::LoadLiteralOpFor(const CPURegister& rt) {
-  if (rt.IsRegister()) {
-    return rt.Is64Bits() ? LDR_x_lit : LDR_w_lit;
-  } else {
-    DCHECK(rt.IsVRegister());
-    return rt.Is64Bits() ? LDR_d_lit : LDR_s_lit;
-  }
-}
-
-
-int Assembler::LinkAndGetInstructionOffsetTo(Label* label) {
-  DCHECK_EQ(kStartOfLabelLinkChain, 0);
-  int offset = LinkAndGetByteOffsetTo(label);
-  DCHECK(IsAligned(offset, kInstructionSize));
-  return offset >> kInstructionSizeLog2;
-}
-
-
-Instr Assembler::Flags(FlagsUpdate S) {
-  if (S == SetFlags) {
-    return 1 << FlagsUpdate_offset;
-  } else if (S == LeaveFlags) {
-    return 0 << FlagsUpdate_offset;
-  }
-  UNREACHABLE();
-}
-
-
-Instr Assembler::Cond(Condition cond) {
-  return cond << Condition_offset;
-}
-
-
-Instr Assembler::ImmPCRelAddress(int imm21) {
-  CHECK(is_int21(imm21));
-  Instr imm = static_cast<Instr>(truncate_to_int21(imm21));
-  Instr immhi = (imm >> ImmPCRelLo_width) << ImmPCRelHi_offset;
-  Instr immlo = imm << ImmPCRelLo_offset;
-  return (immhi & ImmPCRelHi_mask) | (immlo & ImmPCRelLo_mask);
-}
-
-
-Instr Assembler::ImmUncondBranch(int imm26) {
-  CHECK(is_int26(imm26));
-  return truncate_to_int26(imm26) << ImmUncondBranch_offset;
-}
-
-
-Instr Assembler::ImmCondBranch(int imm19) {
-  CHECK(is_int19(imm19));
-  return truncate_to_int19(imm19) << ImmCondBranch_offset;
-}
-
-
-Instr Assembler::ImmCmpBranch(int imm19) {
-  CHECK(is_int19(imm19));
-  return truncate_to_int19(imm19) << ImmCmpBranch_offset;
-}
-
-
-Instr Assembler::ImmTestBranch(int imm14) {
-  CHECK(is_int14(imm14));
-  return truncate_to_int14(imm14) << ImmTestBranch_offset;
-}
-
-
-Instr Assembler::ImmTestBranchBit(unsigned bit_pos) {
-  DCHECK(is_uint6(bit_pos));
-  // Subtract five from the shift offset, as we need bit 5 from bit_pos.
-  unsigned b5 = bit_pos << (ImmTestBranchBit5_offset - 5);
-  unsigned b40 = bit_pos << ImmTestBranchBit40_offset;
-  b5 &= ImmTestBranchBit5_mask;
-  b40 &= ImmTestBranchBit40_mask;
-  return b5 | b40;
-}
-
-
-Instr Assembler::SF(Register rd) {
-    return rd.Is64Bits() ? SixtyFourBits : ThirtyTwoBits;
-}
-
-
-Instr Assembler::ImmAddSub(int imm) {
-  DCHECK(IsImmAddSub(imm));
-  if (is_uint12(imm)) {  // No shift required.
-    imm <<= ImmAddSub_offset;
-  } else {
-    imm = ((imm >> 12) << ImmAddSub_offset) | (1 << ShiftAddSub_offset);
-  }
-  return imm;
-}
-
-
-Instr Assembler::ImmS(unsigned imms, unsigned reg_size) {
-  DCHECK(((reg_size == kXRegSizeInBits) && is_uint6(imms)) ||
-         ((reg_size == kWRegSizeInBits) && is_uint5(imms)));
-  USE(reg_size);
-  return imms << ImmS_offset;
-}
-
-
-Instr Assembler::ImmR(unsigned immr, unsigned reg_size) {
-  DCHECK(((reg_size == kXRegSizeInBits) && is_uint6(immr)) ||
-         ((reg_size == kWRegSizeInBits) && is_uint5(immr)));
-  USE(reg_size);
-  DCHECK(is_uint6(immr));
-  return immr << ImmR_offset;
-}
-
-
-Instr Assembler::ImmSetBits(unsigned imms, unsigned reg_size) {
-  DCHECK((reg_size == kWRegSizeInBits) || (reg_size == kXRegSizeInBits));
-  DCHECK(is_uint6(imms));
-  DCHECK((reg_size == kXRegSizeInBits) || is_uint6(imms + 3));
-  USE(reg_size);
-  return imms << ImmSetBits_offset;
-}
-
-
-Instr Assembler::ImmRotate(unsigned immr, unsigned reg_size) {
-  DCHECK((reg_size == kWRegSizeInBits) || (reg_size == kXRegSizeInBits));
-  DCHECK(((reg_size == kXRegSizeInBits) && is_uint6(immr)) ||
-         ((reg_size == kWRegSizeInBits) && is_uint5(immr)));
-  USE(reg_size);
-  return immr << ImmRotate_offset;
-}
-
-
-Instr Assembler::ImmLLiteral(int imm19) {
-  CHECK(is_int19(imm19));
-  return truncate_to_int19(imm19) << ImmLLiteral_offset;
-}
-
-
-Instr Assembler::BitN(unsigned bitn, unsigned reg_size) {
-  DCHECK((reg_size == kWRegSizeInBits) || (reg_size == kXRegSizeInBits));
-  DCHECK((reg_size == kXRegSizeInBits) || (bitn == 0));
-  USE(reg_size);
-  return bitn << BitN_offset;
-}
-
-
-Instr Assembler::ShiftDP(Shift shift) {
-  DCHECK(shift == LSL || shift == LSR || shift == ASR || shift == ROR);
-  return shift << ShiftDP_offset;
-}
-
-
-Instr Assembler::ImmDPShift(unsigned amount) {
-  DCHECK(is_uint6(amount));
-  return amount << ImmDPShift_offset;
-}
-
-
-Instr Assembler::ExtendMode(Extend extend) {
-  return extend << ExtendMode_offset;
-}
-
-
-Instr Assembler::ImmExtendShift(unsigned left_shift) {
-  DCHECK_LE(left_shift, 4);
-  return left_shift << ImmExtendShift_offset;
-}
-
-
-Instr Assembler::ImmCondCmp(unsigned imm) {
-  DCHECK(is_uint5(imm));
-  return imm << ImmCondCmp_offset;
-}
-
-
-Instr Assembler::Nzcv(StatusFlags nzcv) {
-  return ((nzcv >> Flags_offset) & 0xf) << Nzcv_offset;
-}
-
-
-Instr Assembler::ImmLSUnsigned(int imm12) {
-  DCHECK(is_uint12(imm12));
-  return imm12 << ImmLSUnsigned_offset;
-}
-
-
-Instr Assembler::ImmLS(int imm9) {
-  DCHECK(is_int9(imm9));
-  return truncate_to_int9(imm9) << ImmLS_offset;
-}
-
-Instr Assembler::ImmLSPair(int imm7, unsigned size) {
-  DCHECK_EQ((imm7 >> size) << size, imm7);
-  int scaled_imm7 = imm7 >> size;
-  DCHECK(is_int7(scaled_imm7));
-  return truncate_to_int7(scaled_imm7) << ImmLSPair_offset;
-}
-
-
-Instr Assembler::ImmShiftLS(unsigned shift_amount) {
-  DCHECK(is_uint1(shift_amount));
-  return shift_amount << ImmShiftLS_offset;
-}
-
-
-Instr Assembler::ImmException(int imm16) {
-  DCHECK(is_uint16(imm16));
-  return imm16 << ImmException_offset;
-}
-
-
-Instr Assembler::ImmSystemRegister(int imm15) {
-  DCHECK(is_uint15(imm15));
-  return imm15 << ImmSystemRegister_offset;
-}
-
-
-Instr Assembler::ImmHint(int imm7) {
-  DCHECK(is_uint7(imm7));
-  return imm7 << ImmHint_offset;
-}
-
-
-Instr Assembler::ImmBarrierDomain(int imm2) {
-  DCHECK(is_uint2(imm2));
-  return imm2 << ImmBarrierDomain_offset;
-}
-
-
-Instr Assembler::ImmBarrierType(int imm2) {
-  DCHECK(is_uint2(imm2));
-  return imm2 << ImmBarrierType_offset;
-}
-
-unsigned Assembler::CalcLSDataSize(LoadStoreOp op) {
-  DCHECK((LSSize_offset + LSSize_width) == (kInstructionSize * 8));
-  unsigned size = static_cast<Instr>(op >> LSSize_offset);
-  if ((op & LSVector_mask) != 0) {
-    // Vector register memory operations encode the access size in the "size"
-    // and "opc" fields.
-    if ((size == 0) && ((op & LSOpc_mask) >> LSOpc_offset) >= 2) {
-      size = kQRegSizeLog2;
-    }
-  }
-  return size;
-}
-
-
-Instr Assembler::ImmMoveWide(int imm) {
-  DCHECK(is_uint16(imm));
-  return imm << ImmMoveWide_offset;
-}
-
-
-Instr Assembler::ShiftMoveWide(int shift) {
-  DCHECK(is_uint2(shift));
-  return shift << ShiftMoveWide_offset;
-}
-
-Instr Assembler::FPType(VRegister fd) { return fd.Is64Bits() ? FP64 : FP32; }
-
-Instr Assembler::FPScale(unsigned scale) {
-  DCHECK(is_uint6(scale));
-  return scale << FPScale_offset;
-}
-
-
-const Register& Assembler::AppropriateZeroRegFor(const CPURegister& reg) const {
-  return reg.Is64Bits() ? xzr : wzr;
-}
-
-
-inline void Assembler::CheckBufferSpace() {
-  DCHECK(pc_ < (buffer_ + buffer_size_));
-  if (buffer_space() < kGap) {
-    GrowBuffer();
-  }
-}
-
-
-inline void Assembler::CheckBuffer() {
-  CheckBufferSpace();
-  if (pc_offset() >= next_veneer_pool_check_) {
-    CheckVeneerPool(false, true);
-  }
-  if (pc_offset() >= next_constant_pool_check_) {
-    CheckConstPool(false, true);
-  }
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_ARM64_ASSEMBLER_ARM64_INL_H_
diff --git a/src/v8/src/arm64/assembler-arm64.cc b/src/v8/src/arm64/assembler-arm64.cc
deleted file mode 100644
index a031884..0000000
--- a/src/v8/src/arm64/assembler-arm64.cc
+++ /dev/null
@@ -1,5017 +0,0 @@
-// Copyright 2013 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.
-
-#if V8_TARGET_ARCH_ARM64
-
-#include "src/arm64/assembler-arm64.h"
-
-#include "src/arm64/assembler-arm64-inl.h"
-#include "src/base/bits.h"
-#include "src/base/cpu.h"
-#include "src/code-stubs.h"
-#include "src/frame-constants.h"
-#include "src/register-configuration.h"
-
-namespace v8 {
-namespace internal {
-
-// -----------------------------------------------------------------------------
-// CpuFeatures implementation.
-
-void CpuFeatures::ProbeImpl(bool cross_compile) {
-  // AArch64 has no configuration options, no further probing is required.
-  supported_ = 0;
-
-  // Only use statically determined features for cross compile (snapshot).
-  if (cross_compile) return;
-
-  // We used to probe for coherent cache support, but on older CPUs it
-  // causes crashes (crbug.com/524337), and newer CPUs don't even have
-  // the feature any more.
-}
-
-void CpuFeatures::PrintTarget() { }
-void CpuFeatures::PrintFeatures() {}
-
-// -----------------------------------------------------------------------------
-// CPURegList utilities.
-
-CPURegister CPURegList::PopLowestIndex() {
-  DCHECK(IsValid());
-  if (IsEmpty()) {
-    return NoCPUReg;
-  }
-  int index = CountTrailingZeros(list_, kRegListSizeInBits);
-  DCHECK((1 << index) & list_);
-  Remove(index);
-  return CPURegister::Create(index, size_, type_);
-}
-
-
-CPURegister CPURegList::PopHighestIndex() {
-  DCHECK(IsValid());
-  if (IsEmpty()) {
-    return NoCPUReg;
-  }
-  int index = CountLeadingZeros(list_, kRegListSizeInBits);
-  index = kRegListSizeInBits - 1 - index;
-  DCHECK((1 << index) & list_);
-  Remove(index);
-  return CPURegister::Create(index, size_, type_);
-}
-
-
-void CPURegList::RemoveCalleeSaved() {
-  if (type() == CPURegister::kRegister) {
-    Remove(GetCalleeSaved(RegisterSizeInBits()));
-  } else if (type() == CPURegister::kVRegister) {
-    Remove(GetCalleeSavedV(RegisterSizeInBits()));
-  } else {
-    DCHECK_EQ(type(), CPURegister::kNoRegister);
-    DCHECK(IsEmpty());
-    // The list must already be empty, so do nothing.
-  }
-}
-
-
-CPURegList CPURegList::GetCalleeSaved(int size) {
-  return CPURegList(CPURegister::kRegister, size, 19, 29);
-}
-
-CPURegList CPURegList::GetCalleeSavedV(int size) {
-  return CPURegList(CPURegister::kVRegister, size, 8, 15);
-}
-
-
-CPURegList CPURegList::GetCallerSaved(int size) {
-  // Registers x0-x18 and lr (x30) are caller-saved.
-  CPURegList list = CPURegList(CPURegister::kRegister, size, 0, 18);
-  list.Combine(lr);
-  return list;
-}
-
-CPURegList CPURegList::GetCallerSavedV(int size) {
-  // Registers d0-d7 and d16-d31 are caller-saved.
-  CPURegList list = CPURegList(CPURegister::kVRegister, size, 0, 7);
-  list.Combine(CPURegList(CPURegister::kVRegister, size, 16, 31));
-  return list;
-}
-
-
-// This function defines the list of registers which are associated with a
-// safepoint slot. Safepoint register slots are saved contiguously on the stack.
-// MacroAssembler::SafepointRegisterStackIndex handles mapping from register
-// code to index in the safepoint register slots. Any change here can affect
-// this mapping.
-CPURegList CPURegList::GetSafepointSavedRegisters() {
-  CPURegList list = CPURegList::GetCalleeSaved();
-  list.Combine(
-      CPURegList(CPURegister::kRegister, kXRegSizeInBits, kJSCallerSaved));
-
-  // Note that unfortunately we can't use symbolic names for registers and have
-  // to directly use register codes. This is because this function is used to
-  // initialize some static variables and we can't rely on register variables
-  // to be initialized due to static initialization order issues in C++.
-
-  // Drop ip0 and ip1 (i.e. x16 and x17), as they should not be expected to be
-  // preserved outside of the macro assembler.
-  list.Remove(16);
-  list.Remove(17);
-
-  // Add x18 to the safepoint list, as although it's not in kJSCallerSaved, it
-  // is a caller-saved register according to the procedure call standard.
-  list.Combine(18);
-
-  // Add the link register (x30) to the safepoint list.
-  list.Combine(30);
-
-  return list;
-}
-
-
-// -----------------------------------------------------------------------------
-// Implementation of RelocInfo
-
-const int RelocInfo::kApplyMask = 1 << RelocInfo::INTERNAL_REFERENCE;
-
-
-bool RelocInfo::IsCodedSpecially() {
-  // The deserializer needs to know whether a pointer is specially coded. Being
-  // specially coded on ARM64 means that it is a movz/movk sequence. We don't
-  // generate those for relocatable pointers.
-  return false;
-}
-
-
-bool RelocInfo::IsInConstantPool() {
-  Instruction* instr = reinterpret_cast<Instruction*>(pc_);
-  return instr->IsLdrLiteralX();
-}
-
-Address RelocInfo::embedded_address() const {
-  return Memory::Address_at(Assembler::target_pointer_address_at(pc_));
-}
-
-uint32_t RelocInfo::embedded_size() const {
-  return Memory::uint32_at(Assembler::target_pointer_address_at(pc_));
-}
-
-void RelocInfo::set_embedded_address(Isolate* isolate, Address address,
-                                     ICacheFlushMode flush_mode) {
-  Assembler::set_target_address_at(isolate, pc_, constant_pool_, address,
-                                   flush_mode);
-}
-
-void RelocInfo::set_embedded_size(Isolate* isolate, uint32_t size,
-                                  ICacheFlushMode flush_mode) {
-  Memory::uint32_at(Assembler::target_pointer_address_at(pc_)) = size;
-  // No icache flushing needed, see comment in set_target_address_at.
-}
-
-void RelocInfo::set_js_to_wasm_address(Isolate* isolate, Address address,
-                                       ICacheFlushMode icache_flush_mode) {
-  DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
-  set_embedded_address(isolate, address, icache_flush_mode);
-}
-
-Address RelocInfo::js_to_wasm_address() const {
-  DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
-  return embedded_address();
-}
-
-bool AreAliased(const CPURegister& reg1, const CPURegister& reg2,
-                const CPURegister& reg3, const CPURegister& reg4,
-                const CPURegister& reg5, const CPURegister& reg6,
-                const CPURegister& reg7, const CPURegister& reg8) {
-  int number_of_valid_regs = 0;
-  int number_of_valid_fpregs = 0;
-
-  RegList unique_regs = 0;
-  RegList unique_fpregs = 0;
-
-  const CPURegister regs[] = {reg1, reg2, reg3, reg4, reg5, reg6, reg7, reg8};
-
-  for (unsigned i = 0; i < arraysize(regs); i++) {
-    if (regs[i].IsRegister()) {
-      number_of_valid_regs++;
-      unique_regs |= regs[i].bit();
-    } else if (regs[i].IsVRegister()) {
-      number_of_valid_fpregs++;
-      unique_fpregs |= regs[i].bit();
-    } else {
-      DCHECK(!regs[i].IsValid());
-    }
-  }
-
-  int number_of_unique_regs =
-    CountSetBits(unique_regs, sizeof(unique_regs) * kBitsPerByte);
-  int number_of_unique_fpregs =
-    CountSetBits(unique_fpregs, sizeof(unique_fpregs) * kBitsPerByte);
-
-  DCHECK(number_of_valid_regs >= number_of_unique_regs);
-  DCHECK(number_of_valid_fpregs >= number_of_unique_fpregs);
-
-  return (number_of_valid_regs != number_of_unique_regs) ||
-         (number_of_valid_fpregs != number_of_unique_fpregs);
-}
-
-
-bool AreSameSizeAndType(const CPURegister& reg1, const CPURegister& reg2,
-                        const CPURegister& reg3, const CPURegister& reg4,
-                        const CPURegister& reg5, const CPURegister& reg6,
-                        const CPURegister& reg7, const CPURegister& reg8) {
-  DCHECK(reg1.IsValid());
-  bool match = true;
-  match &= !reg2.IsValid() || reg2.IsSameSizeAndType(reg1);
-  match &= !reg3.IsValid() || reg3.IsSameSizeAndType(reg1);
-  match &= !reg4.IsValid() || reg4.IsSameSizeAndType(reg1);
-  match &= !reg5.IsValid() || reg5.IsSameSizeAndType(reg1);
-  match &= !reg6.IsValid() || reg6.IsSameSizeAndType(reg1);
-  match &= !reg7.IsValid() || reg7.IsSameSizeAndType(reg1);
-  match &= !reg8.IsValid() || reg8.IsSameSizeAndType(reg1);
-  return match;
-}
-
-bool AreSameFormat(const VRegister& reg1, const VRegister& reg2,
-                   const VRegister& reg3, const VRegister& reg4) {
-  DCHECK(reg1.IsValid());
-  return (!reg2.IsValid() || reg2.IsSameFormat(reg1)) &&
-         (!reg3.IsValid() || reg3.IsSameFormat(reg1)) &&
-         (!reg4.IsValid() || reg4.IsSameFormat(reg1));
-}
-
-bool AreConsecutive(const VRegister& reg1, const VRegister& reg2,
-                    const VRegister& reg3, const VRegister& reg4) {
-  DCHECK(reg1.IsValid());
-  if (!reg2.IsValid()) {
-    DCHECK(!reg3.IsValid() && !reg4.IsValid());
-    return true;
-  } else if (reg2.code() != ((reg1.code() + 1) % kNumberOfVRegisters)) {
-    return false;
-  }
-
-  if (!reg3.IsValid()) {
-    DCHECK(!reg4.IsValid());
-    return true;
-  } else if (reg3.code() != ((reg2.code() + 1) % kNumberOfVRegisters)) {
-    return false;
-  }
-
-  if (!reg4.IsValid()) {
-    return true;
-  } else if (reg4.code() != ((reg3.code() + 1) % kNumberOfVRegisters)) {
-    return false;
-  }
-
-  return true;
-}
-
-void Immediate::InitializeHandle(Handle<HeapObject> handle) {
-  value_ = reinterpret_cast<intptr_t>(handle.address());
-  rmode_ = RelocInfo::EMBEDDED_OBJECT;
-}
-
-
-bool Operand::NeedsRelocation(const Assembler* assembler) const {
-  RelocInfo::Mode rmode = immediate_.rmode();
-
-  if (rmode == RelocInfo::EXTERNAL_REFERENCE) {
-    return assembler->serializer_enabled();
-  }
-
-  return !RelocInfo::IsNone(rmode);
-}
-
-bool ConstPool::AddSharedEntry(SharedEntryMap& entry_map, uint64_t data,
-                               int offset) {
-  auto existing = entry_map.find(data);
-  if (existing == entry_map.end()) {
-    entry_map[data] = static_cast<int>(entries_.size());
-    entries_.push_back(std::make_pair(data, std::vector<int>(1, offset)));
-    return true;
-  }
-  int index = existing->second;
-  entries_[index].second.push_back(offset);
-  return false;
-}
-
-// Constant Pool.
-bool ConstPool::RecordEntry(intptr_t data, RelocInfo::Mode mode) {
-  DCHECK(mode != RelocInfo::COMMENT && mode != RelocInfo::CONST_POOL &&
-         mode != RelocInfo::VENEER_POOL &&
-         mode != RelocInfo::DEOPT_SCRIPT_OFFSET &&
-         mode != RelocInfo::DEOPT_INLINING_ID &&
-         mode != RelocInfo::DEOPT_REASON && mode != RelocInfo::DEOPT_ID);
-
-  bool write_reloc_info = true;
-
-  uint64_t raw_data = static_cast<uint64_t>(data);
-  int offset = assm_->pc_offset();
-  if (IsEmpty()) {
-    first_use_ = offset;
-  }
-
-  if (CanBeShared(mode)) {
-    write_reloc_info = AddSharedEntry(shared_entries_, raw_data, offset);
-  } else if (mode == RelocInfo::CODE_TARGET &&
-             assm_->IsCodeTargetSharingAllowed() && raw_data != 0) {
-    // A zero data value is a placeholder and must not be shared.
-    write_reloc_info = AddSharedEntry(handle_to_index_map_, raw_data, offset);
-  } else {
-    entries_.push_back(std::make_pair(raw_data, std::vector<int>(1, offset)));
-  }
-
-  if (EntryCount() > Assembler::kApproxMaxPoolEntryCount) {
-    // Request constant pool emission after the next instruction.
-    assm_->SetNextConstPoolCheckIn(1);
-  }
-
-  return write_reloc_info;
-}
-
-
-int ConstPool::DistanceToFirstUse() {
-  DCHECK_GE(first_use_, 0);
-  return assm_->pc_offset() - first_use_;
-}
-
-
-int ConstPool::MaxPcOffset() {
-  // There are no pending entries in the pool so we can never get out of
-  // range.
-  if (IsEmpty()) return kMaxInt;
-
-  // Entries are not necessarily emitted in the order they are added so in the
-  // worst case the first constant pool use will be accessing the last entry.
-  return first_use_ + kMaxLoadLiteralRange - WorstCaseSize();
-}
-
-
-int ConstPool::WorstCaseSize() {
-  if (IsEmpty()) return 0;
-
-  // Max size prologue:
-  //   b   over
-  //   ldr xzr, #pool_size
-  //   blr xzr
-  //   nop
-  // All entries are 64-bit for now.
-  return 4 * kInstructionSize + EntryCount() * kPointerSize;
-}
-
-
-int ConstPool::SizeIfEmittedAtCurrentPc(bool require_jump) {
-  if (IsEmpty()) return 0;
-
-  // Prologue is:
-  //   b   over  ;; if require_jump
-  //   ldr xzr, #pool_size
-  //   blr xzr
-  //   nop       ;; if not 64-bit aligned
-  int prologue_size = require_jump ? kInstructionSize : 0;
-  prologue_size += 2 * kInstructionSize;
-  prologue_size += IsAligned(assm_->pc_offset() + prologue_size, 8) ?
-                   0 : kInstructionSize;
-
-  // All entries are 64-bit for now.
-  return prologue_size + EntryCount() * kPointerSize;
-}
-
-
-void ConstPool::Emit(bool require_jump) {
-  DCHECK(!assm_->is_const_pool_blocked());
-  // Prevent recursive pool emission and protect from veneer pools.
-  Assembler::BlockPoolsScope block_pools(assm_);
-
-  int size = SizeIfEmittedAtCurrentPc(require_jump);
-  Label size_check;
-  assm_->bind(&size_check);
-
-  assm_->RecordConstPool(size);
-  // Emit the constant pool. It is preceded by an optional branch if
-  // require_jump and a header which will:
-  //  1) Encode the size of the constant pool, for use by the disassembler.
-  //  2) Terminate the program, to try to prevent execution from accidentally
-  //     flowing into the constant pool.
-  //  3) align the pool entries to 64-bit.
-  // The header is therefore made of up to three arm64 instructions:
-  //   ldr xzr, #<size of the constant pool in 32-bit words>
-  //   blr xzr
-  //   nop
-  //
-  // If executed, the header will likely segfault and lr will point to the
-  // instruction following the offending blr.
-  // TODO(all): Make the alignment part less fragile. Currently code is
-  // allocated as a byte array so there are no guarantees the alignment will
-  // be preserved on compaction. Currently it works as allocation seems to be
-  // 64-bit aligned.
-
-  // Emit branch if required
-  Label after_pool;
-  if (require_jump) {
-    assm_->b(&after_pool);
-  }
-
-  // Emit the header.
-  assm_->RecordComment("[ Constant Pool");
-  EmitMarker();
-  EmitGuard();
-  assm_->Align(8);
-
-  // Emit constant pool entries.
-  // TODO(all): currently each relocated constant is 64 bits, consider adding
-  // support for 32-bit entries.
-  EmitEntries();
-  assm_->RecordComment("]");
-
-  if (after_pool.is_linked()) {
-    assm_->bind(&after_pool);
-  }
-
-  DCHECK(assm_->SizeOfCodeGeneratedSince(&size_check) ==
-         static_cast<unsigned>(size));
-}
-
-
-void ConstPool::Clear() {
-  shared_entries_.clear();
-  handle_to_index_map_.clear();
-  entries_.clear();
-  first_use_ = -1;
-}
-
-
-bool ConstPool::CanBeShared(RelocInfo::Mode mode) {
-  // Constant pool currently does not support 32-bit entries.
-  DCHECK(mode != RelocInfo::NONE32);
-
-  return RelocInfo::IsNone(mode) ||
-         (mode >= RelocInfo::FIRST_SHAREABLE_RELOC_MODE);
-}
-
-
-void ConstPool::EmitMarker() {
-  // A constant pool size is expressed in number of 32-bits words.
-  // Currently all entries are 64-bit.
-  // + 1 is for the crash guard.
-  // + 0/1 for alignment.
-  int word_count = EntryCount() * 2 + 1 +
-                   (IsAligned(assm_->pc_offset(), 8) ? 0 : 1);
-  assm_->Emit(LDR_x_lit                          |
-              Assembler::ImmLLiteral(word_count) |
-              Assembler::Rt(xzr));
-}
-
-
-MemOperand::PairResult MemOperand::AreConsistentForPair(
-    const MemOperand& operandA,
-    const MemOperand& operandB,
-    int access_size_log2) {
-  DCHECK_GE(access_size_log2, 0);
-  DCHECK_LE(access_size_log2, 3);
-  // Step one: check that they share the same base, that the mode is Offset
-  // and that the offset is a multiple of access size.
-  if (!operandA.base().Is(operandB.base()) ||
-      (operandA.addrmode() != Offset) ||
-      (operandB.addrmode() != Offset) ||
-      ((operandA.offset() & ((1 << access_size_log2) - 1)) != 0)) {
-    return kNotPair;
-  }
-  // Step two: check that the offsets are contiguous and that the range
-  // is OK for ldp/stp.
-  if ((operandB.offset() == operandA.offset() + (1 << access_size_log2)) &&
-      is_int7(operandA.offset() >> access_size_log2)) {
-    return kPairAB;
-  }
-  if ((operandA.offset() == operandB.offset() + (1 << access_size_log2)) &&
-      is_int7(operandB.offset() >> access_size_log2)) {
-    return kPairBA;
-  }
-  return kNotPair;
-}
-
-
-void ConstPool::EmitGuard() {
-#ifdef DEBUG
-  Instruction* instr = reinterpret_cast<Instruction*>(assm_->pc());
-  DCHECK(instr->preceding()->IsLdrLiteralX() &&
-         instr->preceding()->Rt() == xzr.code());
-#endif
-  assm_->EmitPoolGuard();
-}
-
-
-void ConstPool::EmitEntries() {
-  DCHECK(IsAligned(assm_->pc_offset(), 8));
-
-  // Emit entries.
-  for (const auto& entry : entries_) {
-    for (const auto& pc : entry.second) {
-      Instruction* instr = assm_->InstructionAt(pc);
-
-      // Instruction to patch must be 'ldr rd, [pc, #offset]' with offset == 0.
-      DCHECK(instr->IsLdrLiteral() && instr->ImmLLiteral() == 0);
-      instr->SetImmPCOffsetTarget(assm_->isolate_data(), assm_->pc());
-    }
-
-    assm_->dc64(entry.first);
-  }
-  Clear();
-}
-
-
-// Assembler
-Assembler::Assembler(IsolateData isolate_data, void* buffer, int buffer_size)
-    : AssemblerBase(isolate_data, buffer, buffer_size),
-      constpool_(this),
-      unresolved_branches_() {
-  const_pool_blocked_nesting_ = 0;
-  veneer_pool_blocked_nesting_ = 0;
-  code_target_sharing_blocked_nesting_ = 0;
-  Reset();
-}
-
-
-Assembler::~Assembler() {
-  DCHECK(constpool_.IsEmpty());
-  DCHECK_EQ(const_pool_blocked_nesting_, 0);
-  DCHECK_EQ(veneer_pool_blocked_nesting_, 0);
-  DCHECK_EQ(code_target_sharing_blocked_nesting_, 0);
-}
-
-
-void Assembler::Reset() {
-#ifdef DEBUG
-  DCHECK((pc_ >= buffer_) && (pc_ < buffer_ + buffer_size_));
-  DCHECK_EQ(const_pool_blocked_nesting_, 0);
-  DCHECK_EQ(veneer_pool_blocked_nesting_, 0);
-  DCHECK_EQ(code_target_sharing_blocked_nesting_, 0);
-  DCHECK(unresolved_branches_.empty());
-  memset(buffer_, 0, pc_ - buffer_);
-#endif
-  pc_ = buffer_;
-  reloc_info_writer.Reposition(reinterpret_cast<byte*>(buffer_ + buffer_size_),
-                               reinterpret_cast<byte*>(pc_));
-  constpool_.Clear();
-  next_constant_pool_check_ = 0;
-  next_veneer_pool_check_ = kMaxInt;
-  no_const_pool_before_ = 0;
-}
-
-void Assembler::AllocateAndInstallRequestedHeapObjects(Isolate* isolate) {
-  for (auto& request : heap_object_requests_) {
-    Handle<HeapObject> object;
-    switch (request.kind()) {
-      case HeapObjectRequest::kHeapNumber:
-        object = isolate->factory()->NewHeapNumber(request.heap_number(),
-                                                   IMMUTABLE, TENURED);
-        break;
-      case HeapObjectRequest::kCodeStub:
-        request.code_stub()->set_isolate(isolate);
-        object = request.code_stub()->GetCode();
-        break;
-    }
-    Address pc = buffer_ + request.offset();
-    Memory::Address_at(target_pointer_address_at(pc)) = object.address();
-  }
-}
-
-void Assembler::GetCode(Isolate* isolate, CodeDesc* desc) {
-  // Emit constant pool if necessary.
-  CheckConstPool(true, false);
-  DCHECK(constpool_.IsEmpty());
-
-  AllocateAndInstallRequestedHeapObjects(isolate);
-
-  // Set up code descriptor.
-  if (desc) {
-    desc->buffer = reinterpret_cast<byte*>(buffer_);
-    desc->buffer_size = buffer_size_;
-    desc->instr_size = pc_offset();
-    desc->reloc_size =
-        static_cast<int>((reinterpret_cast<byte*>(buffer_) + buffer_size_) -
-                         reloc_info_writer.pos());
-    desc->origin = this;
-    desc->constant_pool_size = 0;
-    desc->unwinding_info_size = 0;
-    desc->unwinding_info = nullptr;
-  }
-}
-
-
-void Assembler::Align(int m) {
-  DCHECK(m >= 4 && base::bits::IsPowerOfTwo(m));
-  while ((pc_offset() & (m - 1)) != 0) {
-    nop();
-  }
-}
-
-
-void Assembler::CheckLabelLinkChain(Label const * label) {
-#ifdef DEBUG
-  if (label->is_linked()) {
-    static const int kMaxLinksToCheck = 64;  // Avoid O(n2) behaviour.
-    int links_checked = 0;
-    int64_t linkoffset = label->pos();
-    bool end_of_chain = false;
-    while (!end_of_chain) {
-      if (++links_checked > kMaxLinksToCheck) break;
-      Instruction * link = InstructionAt(linkoffset);
-      int64_t linkpcoffset = link->ImmPCOffset();
-      int64_t prevlinkoffset = linkoffset + linkpcoffset;
-
-      end_of_chain = (linkoffset == prevlinkoffset);
-      linkoffset = linkoffset + linkpcoffset;
-    }
-  }
-#endif
-}
-
-
-void Assembler::RemoveBranchFromLabelLinkChain(Instruction* branch,
-                                               Label* label,
-                                               Instruction* label_veneer) {
-  DCHECK(label->is_linked());
-
-  CheckLabelLinkChain(label);
-
-  Instruction* link = InstructionAt(label->pos());
-  Instruction* prev_link = link;
-  Instruction* next_link;
-  bool end_of_chain = false;
-
-  while (link != branch && !end_of_chain) {
-    next_link = link->ImmPCOffsetTarget();
-    end_of_chain = (link == next_link);
-    prev_link = link;
-    link = next_link;
-  }
-
-  DCHECK(branch == link);
-  next_link = branch->ImmPCOffsetTarget();
-
-  if (branch == prev_link) {
-    // The branch is the first instruction in the chain.
-    if (branch == next_link) {
-      // It is also the last instruction in the chain, so it is the only branch
-      // currently referring to this label.
-      label->Unuse();
-    } else {
-      label->link_to(
-          static_cast<int>(reinterpret_cast<byte*>(next_link) - buffer_));
-    }
-
-  } else if (branch == next_link) {
-    // The branch is the last (but not also the first) instruction in the chain.
-    prev_link->SetImmPCOffsetTarget(isolate_data(), prev_link);
-
-  } else {
-    // The branch is in the middle of the chain.
-    if (prev_link->IsTargetInImmPCOffsetRange(next_link)) {
-      prev_link->SetImmPCOffsetTarget(isolate_data(), next_link);
-    } else if (label_veneer != nullptr) {
-      // Use the veneer for all previous links in the chain.
-      prev_link->SetImmPCOffsetTarget(isolate_data(), prev_link);
-
-      end_of_chain = false;
-      link = next_link;
-      while (!end_of_chain) {
-        next_link = link->ImmPCOffsetTarget();
-        end_of_chain = (link == next_link);
-        link->SetImmPCOffsetTarget(isolate_data(), label_veneer);
-        link = next_link;
-      }
-    } else {
-      // The assert below will fire.
-      // Some other work could be attempted to fix up the chain, but it would be
-      // rather complicated. If we crash here, we may want to consider using an
-      // other mechanism than a chain of branches.
-      //
-      // Note that this situation currently should not happen, as we always call
-      // this function with a veneer to the target label.
-      // However this could happen with a MacroAssembler in the following state:
-      //    [previous code]
-      //    B(label);
-      //    [20KB code]
-      //    Tbz(label);   // First tbz. Pointing to unconditional branch.
-      //    [20KB code]
-      //    Tbz(label);   // Second tbz. Pointing to the first tbz.
-      //    [more code]
-      // and this function is called to remove the first tbz from the label link
-      // chain. Since tbz has a range of +-32KB, the second tbz cannot point to
-      // the unconditional branch.
-      CHECK(prev_link->IsTargetInImmPCOffsetRange(next_link));
-      UNREACHABLE();
-    }
-  }
-
-  CheckLabelLinkChain(label);
-}
-
-
-void Assembler::bind(Label* label) {
-  // Bind label to the address at pc_. All instructions (most likely branches)
-  // that are linked to this label will be updated to point to the newly-bound
-  // label.
-
-  DCHECK(!label->is_near_linked());
-  DCHECK(!label->is_bound());
-
-  DeleteUnresolvedBranchInfoForLabel(label);
-
-  // If the label is linked, the link chain looks something like this:
-  //
-  // |--I----I-------I-------L
-  // |---------------------->| pc_offset
-  // |-------------->|         linkoffset = label->pos()
-  //         |<------|         link->ImmPCOffset()
-  // |------>|                 prevlinkoffset = linkoffset + link->ImmPCOffset()
-  //
-  // On each iteration, the last link is updated and then removed from the
-  // chain until only one remains. At that point, the label is bound.
-  //
-  // If the label is not linked, no preparation is required before binding.
-  while (label->is_linked()) {
-    int linkoffset = label->pos();
-    Instruction* link = InstructionAt(linkoffset);
-    int prevlinkoffset = linkoffset + static_cast<int>(link->ImmPCOffset());
-
-    CheckLabelLinkChain(label);
-
-    DCHECK_GE(linkoffset, 0);
-    DCHECK(linkoffset < pc_offset());
-    DCHECK((linkoffset > prevlinkoffset) ||
-           (linkoffset - prevlinkoffset == kStartOfLabelLinkChain));
-    DCHECK_GE(prevlinkoffset, 0);
-
-    // Update the link to point to the label.
-    if (link->IsUnresolvedInternalReference()) {
-      // Internal references do not get patched to an instruction but directly
-      // to an address.
-      internal_reference_positions_.push_back(linkoffset);
-      PatchingAssembler patcher(isolate_data(), reinterpret_cast<byte*>(link),
-                                2);
-      patcher.dc64(reinterpret_cast<uintptr_t>(pc_));
-    } else {
-      link->SetImmPCOffsetTarget(isolate_data(),
-                                 reinterpret_cast<Instruction*>(pc_));
-    }
-
-    // Link the label to the previous link in the chain.
-    if (linkoffset - prevlinkoffset == kStartOfLabelLinkChain) {
-      // We hit kStartOfLabelLinkChain, so the chain is fully processed.
-      label->Unuse();
-    } else {
-      // Update the label for the next iteration.
-      label->link_to(prevlinkoffset);
-    }
-  }
-  label->bind_to(pc_offset());
-
-  DCHECK(label->is_bound());
-  DCHECK(!label->is_linked());
-}
-
-
-int Assembler::LinkAndGetByteOffsetTo(Label* label) {
-  DCHECK_EQ(sizeof(*pc_), 1);
-  CheckLabelLinkChain(label);
-
-  int offset;
-  if (label->is_bound()) {
-    // The label is bound, so it does not need to be updated. Referring
-    // instructions must link directly to the label as they will not be
-    // updated.
-    //
-    // In this case, label->pos() returns the offset of the label from the
-    // start of the buffer.
-    //
-    // Note that offset can be zero for self-referential instructions. (This
-    // could be useful for ADR, for example.)
-    offset = label->pos() - pc_offset();
-    DCHECK_LE(offset, 0);
-  } else {
-    if (label->is_linked()) {
-      // The label is linked, so the referring instruction should be added onto
-      // the end of the label's link chain.
-      //
-      // In this case, label->pos() returns the offset of the last linked
-      // instruction from the start of the buffer.
-      offset = label->pos() - pc_offset();
-      DCHECK_NE(offset, kStartOfLabelLinkChain);
-      // Note that the offset here needs to be PC-relative only so that the
-      // first instruction in a buffer can link to an unbound label. Otherwise,
-      // the offset would be 0 for this case, and 0 is reserved for
-      // kStartOfLabelLinkChain.
-    } else {
-      // The label is unused, so it now becomes linked and the referring
-      // instruction is at the start of the new link chain.
-      offset = kStartOfLabelLinkChain;
-    }
-    // The instruction at pc is now the last link in the label's chain.
-    label->link_to(pc_offset());
-  }
-
-  return offset;
-}
-
-
-void Assembler::DeleteUnresolvedBranchInfoForLabelTraverse(Label* label) {
-  DCHECK(label->is_linked());
-  CheckLabelLinkChain(label);
-
-  int link_offset = label->pos();
-  int link_pcoffset;
-  bool end_of_chain = false;
-
-  while (!end_of_chain) {
-    Instruction * link = InstructionAt(link_offset);
-    link_pcoffset = static_cast<int>(link->ImmPCOffset());
-
-    // ADR instructions are not handled by veneers.
-    if (link->IsImmBranch()) {
-      int max_reachable_pc =
-          static_cast<int>(InstructionOffset(link) +
-                           Instruction::ImmBranchRange(link->BranchType()));
-      typedef std::multimap<int, FarBranchInfo>::iterator unresolved_info_it;
-      std::pair<unresolved_info_it, unresolved_info_it> range;
-      range = unresolved_branches_.equal_range(max_reachable_pc);
-      unresolved_info_it it;
-      for (it = range.first; it != range.second; ++it) {
-        if (it->second.pc_offset_ == link_offset) {
-          unresolved_branches_.erase(it);
-          break;
-        }
-      }
-    }
-
-    end_of_chain = (link_pcoffset == 0);
-    link_offset = link_offset + link_pcoffset;
-  }
-}
-
-
-void Assembler::DeleteUnresolvedBranchInfoForLabel(Label* label) {
-  if (unresolved_branches_.empty()) {
-    DCHECK_EQ(next_veneer_pool_check_, kMaxInt);
-    return;
-  }
-
-  if (label->is_linked()) {
-    // Branches to this label will be resolved when the label is bound, normally
-    // just after all the associated info has been deleted.
-    DeleteUnresolvedBranchInfoForLabelTraverse(label);
-  }
-  if (unresolved_branches_.empty()) {
-    next_veneer_pool_check_ = kMaxInt;
-  } else {
-    next_veneer_pool_check_ =
-      unresolved_branches_first_limit() - kVeneerDistanceCheckMargin;
-  }
-}
-
-
-void Assembler::StartBlockConstPool() {
-  if (const_pool_blocked_nesting_++ == 0) {
-    // Prevent constant pool checks happening by setting the next check to
-    // the biggest possible offset.
-    next_constant_pool_check_ = kMaxInt;
-  }
-}
-
-
-void Assembler::EndBlockConstPool() {
-  if (--const_pool_blocked_nesting_ == 0) {
-    // Check the constant pool hasn't been blocked for too long.
-    DCHECK(pc_offset() < constpool_.MaxPcOffset());
-    // Two cases:
-    //  * no_const_pool_before_ >= next_constant_pool_check_ and the emission is
-    //    still blocked
-    //  * no_const_pool_before_ < next_constant_pool_check_ and the next emit
-    //    will trigger a check.
-    next_constant_pool_check_ = no_const_pool_before_;
-  }
-}
-
-
-bool Assembler::is_const_pool_blocked() const {
-  return (const_pool_blocked_nesting_ > 0) ||
-         (pc_offset() < no_const_pool_before_);
-}
-
-
-bool Assembler::IsConstantPoolAt(Instruction* instr) {
-  // The constant pool marker is made of two instructions. These instructions
-  // will never be emitted by the JIT, so checking for the first one is enough:
-  // 0: ldr xzr, #<size of pool>
-  bool result = instr->IsLdrLiteralX() && (instr->Rt() == kZeroRegCode);
-
-  // It is still worth asserting the marker is complete.
-  // 4: blr xzr
-  DCHECK(!result || (instr->following()->IsBranchAndLinkToRegister() &&
-                     instr->following()->Rn() == kZeroRegCode));
-
-  return result;
-}
-
-
-int Assembler::ConstantPoolSizeAt(Instruction* instr) {
-#ifdef USE_SIMULATOR
-  // Assembler::debug() embeds constants directly into the instruction stream.
-  // Although this is not a genuine constant pool, treat it like one to avoid
-  // disassembling the constants.
-  if ((instr->Mask(ExceptionMask) == HLT) &&
-      (instr->ImmException() == kImmExceptionIsDebug)) {
-    const char* message =
-        reinterpret_cast<const char*>(
-            instr->InstructionAtOffset(kDebugMessageOffset));
-    int size = static_cast<int>(kDebugMessageOffset + strlen(message) + 1);
-    return RoundUp(size, kInstructionSize) / kInstructionSize;
-  }
-  // Same for printf support, see MacroAssembler::CallPrintf().
-  if ((instr->Mask(ExceptionMask) == HLT) &&
-      (instr->ImmException() == kImmExceptionIsPrintf)) {
-    return kPrintfLength / kInstructionSize;
-  }
-#endif
-  if (IsConstantPoolAt(instr)) {
-    return instr->ImmLLiteral();
-  } else {
-    return -1;
-  }
-}
-
-
-void Assembler::EmitPoolGuard() {
-  // We must generate only one instruction as this is used in scopes that
-  // control the size of the code generated.
-  Emit(BLR | Rn(xzr));
-}
-
-
-void Assembler::StartBlockVeneerPool() {
-  ++veneer_pool_blocked_nesting_;
-}
-
-
-void Assembler::EndBlockVeneerPool() {
-  if (--veneer_pool_blocked_nesting_ == 0) {
-    // Check the veneer pool hasn't been blocked for too long.
-    DCHECK(unresolved_branches_.empty() ||
-           (pc_offset() < unresolved_branches_first_limit()));
-  }
-}
-
-
-void Assembler::br(const Register& xn) {
-  DCHECK(xn.Is64Bits());
-  Emit(BR | Rn(xn));
-}
-
-
-void Assembler::blr(const Register& xn) {
-  DCHECK(xn.Is64Bits());
-  // The pattern 'blr xzr' is used as a guard to detect when execution falls
-  // through the constant pool. It should not be emitted.
-  DCHECK(!xn.Is(xzr));
-  Emit(BLR | Rn(xn));
-}
-
-
-void Assembler::ret(const Register& xn) {
-  DCHECK(xn.Is64Bits());
-  Emit(RET | Rn(xn));
-}
-
-
-void Assembler::b(int imm26) {
-  Emit(B | ImmUncondBranch(imm26));
-}
-
-
-void Assembler::b(Label* label) {
-  b(LinkAndGetInstructionOffsetTo(label));
-}
-
-
-void Assembler::b(int imm19, Condition cond) {
-  Emit(B_cond | ImmCondBranch(imm19) | cond);
-}
-
-
-void Assembler::b(Label* label, Condition cond) {
-  b(LinkAndGetInstructionOffsetTo(label), cond);
-}
-
-
-void Assembler::bl(int imm26) {
-  Emit(BL | ImmUncondBranch(imm26));
-}
-
-
-void Assembler::bl(Label* label) {
-  bl(LinkAndGetInstructionOffsetTo(label));
-}
-
-
-void Assembler::cbz(const Register& rt,
-                    int imm19) {
-  Emit(SF(rt) | CBZ | ImmCmpBranch(imm19) | Rt(rt));
-}
-
-
-void Assembler::cbz(const Register& rt,
-                    Label* label) {
-  cbz(rt, LinkAndGetInstructionOffsetTo(label));
-}
-
-
-void Assembler::cbnz(const Register& rt,
-                     int imm19) {
-  Emit(SF(rt) | CBNZ | ImmCmpBranch(imm19) | Rt(rt));
-}
-
-
-void Assembler::cbnz(const Register& rt,
-                     Label* label) {
-  cbnz(rt, LinkAndGetInstructionOffsetTo(label));
-}
-
-
-void Assembler::tbz(const Register& rt,
-                    unsigned bit_pos,
-                    int imm14) {
-  DCHECK(rt.Is64Bits() || (rt.Is32Bits() && (bit_pos < kWRegSizeInBits)));
-  Emit(TBZ | ImmTestBranchBit(bit_pos) | ImmTestBranch(imm14) | Rt(rt));
-}
-
-
-void Assembler::tbz(const Register& rt,
-                    unsigned bit_pos,
-                    Label* label) {
-  tbz(rt, bit_pos, LinkAndGetInstructionOffsetTo(label));
-}
-
-
-void Assembler::tbnz(const Register& rt,
-                     unsigned bit_pos,
-                     int imm14) {
-  DCHECK(rt.Is64Bits() || (rt.Is32Bits() && (bit_pos < kWRegSizeInBits)));
-  Emit(TBNZ | ImmTestBranchBit(bit_pos) | ImmTestBranch(imm14) | Rt(rt));
-}
-
-
-void Assembler::tbnz(const Register& rt,
-                     unsigned bit_pos,
-                     Label* label) {
-  tbnz(rt, bit_pos, LinkAndGetInstructionOffsetTo(label));
-}
-
-
-void Assembler::adr(const Register& rd, int imm21) {
-  DCHECK(rd.Is64Bits());
-  Emit(ADR | ImmPCRelAddress(imm21) | Rd(rd));
-}
-
-
-void Assembler::adr(const Register& rd, Label* label) {
-  adr(rd, LinkAndGetByteOffsetTo(label));
-}
-
-
-void Assembler::add(const Register& rd,
-                    const Register& rn,
-                    const Operand& operand) {
-  AddSub(rd, rn, operand, LeaveFlags, ADD);
-}
-
-
-void Assembler::adds(const Register& rd,
-                     const Register& rn,
-                     const Operand& operand) {
-  AddSub(rd, rn, operand, SetFlags, ADD);
-}
-
-
-void Assembler::cmn(const Register& rn,
-                    const Operand& operand) {
-  Register zr = AppropriateZeroRegFor(rn);
-  adds(zr, rn, operand);
-}
-
-
-void Assembler::sub(const Register& rd,
-                    const Register& rn,
-                    const Operand& operand) {
-  AddSub(rd, rn, operand, LeaveFlags, SUB);
-}
-
-
-void Assembler::subs(const Register& rd,
-                     const Register& rn,
-                     const Operand& operand) {
-  AddSub(rd, rn, operand, SetFlags, SUB);
-}
-
-
-void Assembler::cmp(const Register& rn, const Operand& operand) {
-  Register zr = AppropriateZeroRegFor(rn);
-  subs(zr, rn, operand);
-}
-
-
-void Assembler::neg(const Register& rd, const Operand& operand) {
-  Register zr = AppropriateZeroRegFor(rd);
-  sub(rd, zr, operand);
-}
-
-
-void Assembler::negs(const Register& rd, const Operand& operand) {
-  Register zr = AppropriateZeroRegFor(rd);
-  subs(rd, zr, operand);
-}
-
-
-void Assembler::adc(const Register& rd,
-                    const Register& rn,
-                    const Operand& operand) {
-  AddSubWithCarry(rd, rn, operand, LeaveFlags, ADC);
-}
-
-
-void Assembler::adcs(const Register& rd,
-                     const Register& rn,
-                     const Operand& operand) {
-  AddSubWithCarry(rd, rn, operand, SetFlags, ADC);
-}
-
-
-void Assembler::sbc(const Register& rd,
-                    const Register& rn,
-                    const Operand& operand) {
-  AddSubWithCarry(rd, rn, operand, LeaveFlags, SBC);
-}
-
-
-void Assembler::sbcs(const Register& rd,
-                     const Register& rn,
-                     const Operand& operand) {
-  AddSubWithCarry(rd, rn, operand, SetFlags, SBC);
-}
-
-
-void Assembler::ngc(const Register& rd, const Operand& operand) {
-  Register zr = AppropriateZeroRegFor(rd);
-  sbc(rd, zr, operand);
-}
-
-
-void Assembler::ngcs(const Register& rd, const Operand& operand) {
-  Register zr = AppropriateZeroRegFor(rd);
-  sbcs(rd, zr, operand);
-}
-
-
-// Logical instructions.
-void Assembler::and_(const Register& rd,
-                     const Register& rn,
-                     const Operand& operand) {
-  Logical(rd, rn, operand, AND);
-}
-
-
-void Assembler::ands(const Register& rd,
-                     const Register& rn,
-                     const Operand& operand) {
-  Logical(rd, rn, operand, ANDS);
-}
-
-
-void Assembler::tst(const Register& rn,
-                    const Operand& operand) {
-  ands(AppropriateZeroRegFor(rn), rn, operand);
-}
-
-
-void Assembler::bic(const Register& rd,
-                    const Register& rn,
-                    const Operand& operand) {
-  Logical(rd, rn, operand, BIC);
-}
-
-
-void Assembler::bics(const Register& rd,
-                     const Register& rn,
-                     const Operand& operand) {
-  Logical(rd, rn, operand, BICS);
-}
-
-
-void Assembler::orr(const Register& rd,
-                    const Register& rn,
-                    const Operand& operand) {
-  Logical(rd, rn, operand, ORR);
-}
-
-
-void Assembler::orn(const Register& rd,
-                    const Register& rn,
-                    const Operand& operand) {
-  Logical(rd, rn, operand, ORN);
-}
-
-
-void Assembler::eor(const Register& rd,
-                    const Register& rn,
-                    const Operand& operand) {
-  Logical(rd, rn, operand, EOR);
-}
-
-
-void Assembler::eon(const Register& rd,
-                    const Register& rn,
-                    const Operand& operand) {
-  Logical(rd, rn, operand, EON);
-}
-
-
-void Assembler::lslv(const Register& rd,
-                     const Register& rn,
-                     const Register& rm) {
-  DCHECK(rd.SizeInBits() == rn.SizeInBits());
-  DCHECK(rd.SizeInBits() == rm.SizeInBits());
-  Emit(SF(rd) | LSLV | Rm(rm) | Rn(rn) | Rd(rd));
-}
-
-
-void Assembler::lsrv(const Register& rd,
-                     const Register& rn,
-                     const Register& rm) {
-  DCHECK(rd.SizeInBits() == rn.SizeInBits());
-  DCHECK(rd.SizeInBits() == rm.SizeInBits());
-  Emit(SF(rd) | LSRV | Rm(rm) | Rn(rn) | Rd(rd));
-}
-
-
-void Assembler::asrv(const Register& rd,
-                     const Register& rn,
-                     const Register& rm) {
-  DCHECK(rd.SizeInBits() == rn.SizeInBits());
-  DCHECK(rd.SizeInBits() == rm.SizeInBits());
-  Emit(SF(rd) | ASRV | Rm(rm) | Rn(rn) | Rd(rd));
-}
-
-
-void Assembler::rorv(const Register& rd,
-                     const Register& rn,
-                     const Register& rm) {
-  DCHECK(rd.SizeInBits() == rn.SizeInBits());
-  DCHECK(rd.SizeInBits() == rm.SizeInBits());
-  Emit(SF(rd) | RORV | Rm(rm) | Rn(rn) | Rd(rd));
-}
-
-
-// Bitfield operations.
-void Assembler::bfm(const Register& rd, const Register& rn, int immr,
-                    int imms) {
-  DCHECK(rd.SizeInBits() == rn.SizeInBits());
-  Instr N = SF(rd) >> (kSFOffset - kBitfieldNOffset);
-  Emit(SF(rd) | BFM | N |
-       ImmR(immr, rd.SizeInBits()) |
-       ImmS(imms, rn.SizeInBits()) |
-       Rn(rn) | Rd(rd));
-}
-
-
-void Assembler::sbfm(const Register& rd, const Register& rn, int immr,
-                     int imms) {
-  DCHECK(rd.Is64Bits() || rn.Is32Bits());
-  Instr N = SF(rd) >> (kSFOffset - kBitfieldNOffset);
-  Emit(SF(rd) | SBFM | N |
-       ImmR(immr, rd.SizeInBits()) |
-       ImmS(imms, rn.SizeInBits()) |
-       Rn(rn) | Rd(rd));
-}
-
-
-void Assembler::ubfm(const Register& rd, const Register& rn, int immr,
-                     int imms) {
-  DCHECK(rd.SizeInBits() == rn.SizeInBits());
-  Instr N = SF(rd) >> (kSFOffset - kBitfieldNOffset);
-  Emit(SF(rd) | UBFM | N |
-       ImmR(immr, rd.SizeInBits()) |
-       ImmS(imms, rn.SizeInBits()) |
-       Rn(rn) | Rd(rd));
-}
-
-
-void Assembler::extr(const Register& rd, const Register& rn, const Register& rm,
-                     int lsb) {
-  DCHECK(rd.SizeInBits() == rn.SizeInBits());
-  DCHECK(rd.SizeInBits() == rm.SizeInBits());
-  Instr N = SF(rd) >> (kSFOffset - kBitfieldNOffset);
-  Emit(SF(rd) | EXTR | N | Rm(rm) |
-       ImmS(lsb, rn.SizeInBits()) | Rn(rn) | Rd(rd));
-}
-
-
-void Assembler::csel(const Register& rd,
-                     const Register& rn,
-                     const Register& rm,
-                     Condition cond) {
-  ConditionalSelect(rd, rn, rm, cond, CSEL);
-}
-
-
-void Assembler::csinc(const Register& rd,
-                      const Register& rn,
-                      const Register& rm,
-                      Condition cond) {
-  ConditionalSelect(rd, rn, rm, cond, CSINC);
-}
-
-
-void Assembler::csinv(const Register& rd,
-                      const Register& rn,
-                      const Register& rm,
-                      Condition cond) {
-  ConditionalSelect(rd, rn, rm, cond, CSINV);
-}
-
-
-void Assembler::csneg(const Register& rd,
-                      const Register& rn,
-                      const Register& rm,
-                      Condition cond) {
-  ConditionalSelect(rd, rn, rm, cond, CSNEG);
-}
-
-
-void Assembler::cset(const Register &rd, Condition cond) {
-  DCHECK((cond != al) && (cond != nv));
-  Register zr = AppropriateZeroRegFor(rd);
-  csinc(rd, zr, zr, NegateCondition(cond));
-}
-
-
-void Assembler::csetm(const Register &rd, Condition cond) {
-  DCHECK((cond != al) && (cond != nv));
-  Register zr = AppropriateZeroRegFor(rd);
-  csinv(rd, zr, zr, NegateCondition(cond));
-}
-
-
-void Assembler::cinc(const Register &rd, const Register &rn, Condition cond) {
-  DCHECK((cond != al) && (cond != nv));
-  csinc(rd, rn, rn, NegateCondition(cond));
-}
-
-
-void Assembler::cinv(const Register &rd, const Register &rn, Condition cond) {
-  DCHECK((cond != al) && (cond != nv));
-  csinv(rd, rn, rn, NegateCondition(cond));
-}
-
-
-void Assembler::cneg(const Register &rd, const Register &rn, Condition cond) {
-  DCHECK((cond != al) && (cond != nv));
-  csneg(rd, rn, rn, NegateCondition(cond));
-}
-
-
-void Assembler::ConditionalSelect(const Register& rd,
-                                  const Register& rn,
-                                  const Register& rm,
-                                  Condition cond,
-                                  ConditionalSelectOp op) {
-  DCHECK(rd.SizeInBits() == rn.SizeInBits());
-  DCHECK(rd.SizeInBits() == rm.SizeInBits());
-  Emit(SF(rd) | op | Rm(rm) | Cond(cond) | Rn(rn) | Rd(rd));
-}
-
-
-void Assembler::ccmn(const Register& rn,
-                     const Operand& operand,
-                     StatusFlags nzcv,
-                     Condition cond) {
-  ConditionalCompare(rn, operand, nzcv, cond, CCMN);
-}
-
-
-void Assembler::ccmp(const Register& rn,
-                     const Operand& operand,
-                     StatusFlags nzcv,
-                     Condition cond) {
-  ConditionalCompare(rn, operand, nzcv, cond, CCMP);
-}
-
-
-void Assembler::DataProcessing3Source(const Register& rd,
-                                      const Register& rn,
-                                      const Register& rm,
-                                      const Register& ra,
-                                      DataProcessing3SourceOp op) {
-  Emit(SF(rd) | op | Rm(rm) | Ra(ra) | Rn(rn) | Rd(rd));
-}
-
-
-void Assembler::mul(const Register& rd,
-                    const Register& rn,
-                    const Register& rm) {
-  DCHECK(AreSameSizeAndType(rd, rn, rm));
-  Register zr = AppropriateZeroRegFor(rn);
-  DataProcessing3Source(rd, rn, rm, zr, MADD);
-}
-
-
-void Assembler::madd(const Register& rd,
-                     const Register& rn,
-                     const Register& rm,
-                     const Register& ra) {
-  DCHECK(AreSameSizeAndType(rd, rn, rm, ra));
-  DataProcessing3Source(rd, rn, rm, ra, MADD);
-}
-
-
-void Assembler::mneg(const Register& rd,
-                     const Register& rn,
-                     const Register& rm) {
-  DCHECK(AreSameSizeAndType(rd, rn, rm));
-  Register zr = AppropriateZeroRegFor(rn);
-  DataProcessing3Source(rd, rn, rm, zr, MSUB);
-}
-
-
-void Assembler::msub(const Register& rd,
-                     const Register& rn,
-                     const Register& rm,
-                     const Register& ra) {
-  DCHECK(AreSameSizeAndType(rd, rn, rm, ra));
-  DataProcessing3Source(rd, rn, rm, ra, MSUB);
-}
-
-
-void Assembler::smaddl(const Register& rd,
-                       const Register& rn,
-                       const Register& rm,
-                       const Register& ra) {
-  DCHECK(rd.Is64Bits() && ra.Is64Bits());
-  DCHECK(rn.Is32Bits() && rm.Is32Bits());
-  DataProcessing3Source(rd, rn, rm, ra, SMADDL_x);
-}
-
-
-void Assembler::smsubl(const Register& rd,
-                       const Register& rn,
-                       const Register& rm,
-                       const Register& ra) {
-  DCHECK(rd.Is64Bits() && ra.Is64Bits());
-  DCHECK(rn.Is32Bits() && rm.Is32Bits());
-  DataProcessing3Source(rd, rn, rm, ra, SMSUBL_x);
-}
-
-
-void Assembler::umaddl(const Register& rd,
-                       const Register& rn,
-                       const Register& rm,
-                       const Register& ra) {
-  DCHECK(rd.Is64Bits() && ra.Is64Bits());
-  DCHECK(rn.Is32Bits() && rm.Is32Bits());
-  DataProcessing3Source(rd, rn, rm, ra, UMADDL_x);
-}
-
-
-void Assembler::umsubl(const Register& rd,
-                       const Register& rn,
-                       const Register& rm,
-                       const Register& ra) {
-  DCHECK(rd.Is64Bits() && ra.Is64Bits());
-  DCHECK(rn.Is32Bits() && rm.Is32Bits());
-  DataProcessing3Source(rd, rn, rm, ra, UMSUBL_x);
-}
-
-
-void Assembler::smull(const Register& rd,
-                      const Register& rn,
-                      const Register& rm) {
-  DCHECK(rd.Is64Bits());
-  DCHECK(rn.Is32Bits() && rm.Is32Bits());
-  DataProcessing3Source(rd, rn, rm, xzr, SMADDL_x);
-}
-
-
-void Assembler::smulh(const Register& rd,
-                      const Register& rn,
-                      const Register& rm) {
-  DCHECK(AreSameSizeAndType(rd, rn, rm));
-  DataProcessing3Source(rd, rn, rm, xzr, SMULH_x);
-}
-
-
-void Assembler::sdiv(const Register& rd,
-                     const Register& rn,
-                     const Register& rm) {
-  DCHECK(rd.SizeInBits() == rn.SizeInBits());
-  DCHECK(rd.SizeInBits() == rm.SizeInBits());
-  Emit(SF(rd) | SDIV | Rm(rm) | Rn(rn) | Rd(rd));
-}
-
-
-void Assembler::udiv(const Register& rd,
-                     const Register& rn,
-                     const Register& rm) {
-  DCHECK(rd.SizeInBits() == rn.SizeInBits());
-  DCHECK(rd.SizeInBits() == rm.SizeInBits());
-  Emit(SF(rd) | UDIV | Rm(rm) | Rn(rn) | Rd(rd));
-}
-
-
-void Assembler::rbit(const Register& rd,
-                     const Register& rn) {
-  DataProcessing1Source(rd, rn, RBIT);
-}
-
-
-void Assembler::rev16(const Register& rd,
-                      const Register& rn) {
-  DataProcessing1Source(rd, rn, REV16);
-}
-
-
-void Assembler::rev32(const Register& rd,
-                      const Register& rn) {
-  DCHECK(rd.Is64Bits());
-  DataProcessing1Source(rd, rn, REV);
-}
-
-
-void Assembler::rev(const Register& rd,
-                    const Register& rn) {
-  DataProcessing1Source(rd, rn, rd.Is64Bits() ? REV_x : REV_w);
-}
-
-
-void Assembler::clz(const Register& rd,
-                    const Register& rn) {
-  DataProcessing1Source(rd, rn, CLZ);
-}
-
-
-void Assembler::cls(const Register& rd,
-                    const Register& rn) {
-  DataProcessing1Source(rd, rn, CLS);
-}
-
-
-void Assembler::ldp(const CPURegister& rt,
-                    const CPURegister& rt2,
-                    const MemOperand& src) {
-  LoadStorePair(rt, rt2, src, LoadPairOpFor(rt, rt2));
-}
-
-
-void Assembler::stp(const CPURegister& rt,
-                    const CPURegister& rt2,
-                    const MemOperand& dst) {
-  LoadStorePair(rt, rt2, dst, StorePairOpFor(rt, rt2));
-}
-
-
-void Assembler::ldpsw(const Register& rt,
-                      const Register& rt2,
-                      const MemOperand& src) {
-  DCHECK(rt.Is64Bits());
-  LoadStorePair(rt, rt2, src, LDPSW_x);
-}
-
-
-void Assembler::LoadStorePair(const CPURegister& rt,
-                              const CPURegister& rt2,
-                              const MemOperand& addr,
-                              LoadStorePairOp op) {
-  // 'rt' and 'rt2' can only be aliased for stores.
-  DCHECK(((op & LoadStorePairLBit) == 0) || !rt.Is(rt2));
-  DCHECK(AreSameSizeAndType(rt, rt2));
-  DCHECK(IsImmLSPair(addr.offset(), CalcLSPairDataSize(op)));
-  int offset = static_cast<int>(addr.offset());
-
-  Instr memop = op | Rt(rt) | Rt2(rt2) | RnSP(addr.base()) |
-                ImmLSPair(offset, CalcLSPairDataSize(op));
-
-  Instr addrmodeop;
-  if (addr.IsImmediateOffset()) {
-    addrmodeop = LoadStorePairOffsetFixed;
-  } else {
-    // Pre-index and post-index modes.
-    DCHECK(!rt.Is(addr.base()));
-    DCHECK(!rt2.Is(addr.base()));
-    DCHECK_NE(addr.offset(), 0);
-    if (addr.IsPreIndex()) {
-      addrmodeop = LoadStorePairPreIndexFixed;
-    } else {
-      DCHECK(addr.IsPostIndex());
-      addrmodeop = LoadStorePairPostIndexFixed;
-    }
-  }
-  Emit(addrmodeop | memop);
-}
-
-
-// Memory instructions.
-void Assembler::ldrb(const Register& rt, const MemOperand& src) {
-  LoadStore(rt, src, LDRB_w);
-}
-
-
-void Assembler::strb(const Register& rt, const MemOperand& dst) {
-  LoadStore(rt, dst, STRB_w);
-}
-
-
-void Assembler::ldrsb(const Register& rt, const MemOperand& src) {
-  LoadStore(rt, src, rt.Is64Bits() ? LDRSB_x : LDRSB_w);
-}
-
-
-void Assembler::ldrh(const Register& rt, const MemOperand& src) {
-  LoadStore(rt, src, LDRH_w);
-}
-
-
-void Assembler::strh(const Register& rt, const MemOperand& dst) {
-  LoadStore(rt, dst, STRH_w);
-}
-
-
-void Assembler::ldrsh(const Register& rt, const MemOperand& src) {
-  LoadStore(rt, src, rt.Is64Bits() ? LDRSH_x : LDRSH_w);
-}
-
-
-void Assembler::ldr(const CPURegister& rt, const MemOperand& src) {
-  LoadStore(rt, src, LoadOpFor(rt));
-}
-
-
-void Assembler::str(const CPURegister& rt, const MemOperand& src) {
-  LoadStore(rt, src, StoreOpFor(rt));
-}
-
-
-void Assembler::ldrsw(const Register& rt, const MemOperand& src) {
-  DCHECK(rt.Is64Bits());
-  LoadStore(rt, src, LDRSW_x);
-}
-
-
-void Assembler::ldr_pcrel(const CPURegister& rt, int imm19) {
-  // The pattern 'ldr xzr, #offset' is used to indicate the beginning of a
-  // constant pool. It should not be emitted.
-  DCHECK(!rt.IsZero());
-  Emit(LoadLiteralOpFor(rt) | ImmLLiteral(imm19) | Rt(rt));
-}
-
-Operand Operand::EmbeddedNumber(double number) {
-  int32_t smi;
-  if (DoubleToSmiInteger(number, &smi)) {
-    return Operand(Immediate(Smi::FromInt(smi)));
-  }
-  Operand result(0, RelocInfo::EMBEDDED_OBJECT);
-  result.heap_object_request_.emplace(number);
-  DCHECK(result.IsHeapObjectRequest());
-  return result;
-}
-
-Operand Operand::EmbeddedCode(CodeStub* stub) {
-  Operand result(0, RelocInfo::CODE_TARGET);
-  result.heap_object_request_.emplace(stub);
-  DCHECK(result.IsHeapObjectRequest());
-  return result;
-}
-
-void Assembler::ldr(const CPURegister& rt, const Operand& operand) {
-  if (operand.IsHeapObjectRequest()) {
-    RequestHeapObject(operand.heap_object_request());
-    ldr(rt, operand.immediate_for_heap_object_request());
-  } else {
-    ldr(rt, operand.immediate());
-  }
-}
-
-void Assembler::ldr(const CPURegister& rt, const Immediate& imm) {
-  // Currently we only support 64-bit literals.
-  DCHECK(rt.Is64Bits());
-
-  RecordRelocInfo(imm.rmode(), imm.value());
-  BlockConstPoolFor(1);
-  // The load will be patched when the constpool is emitted, patching code
-  // expect a load literal with offset 0.
-  ldr_pcrel(rt, 0);
-}
-
-void Assembler::ldar(const Register& rt, const Register& rn) {
-  DCHECK(rn.Is64Bits());
-  LoadStoreAcquireReleaseOp op = rt.Is32Bits() ? LDAR_w : LDAR_x;
-  Emit(op | Rs(x31) | Rt2(x31) | RnSP(rn) | Rt(rt));
-}
-
-void Assembler::ldaxr(const Register& rt, const Register& rn) {
-  DCHECK(rn.Is64Bits());
-  LoadStoreAcquireReleaseOp op = rt.Is32Bits() ? LDAXR_w : LDAXR_x;
-  Emit(op | Rs(x31) | Rt2(x31) | RnSP(rn) | Rt(rt));
-}
-
-void Assembler::stlr(const Register& rt, const Register& rn) {
-  DCHECK(rn.Is64Bits());
-  LoadStoreAcquireReleaseOp op = rt.Is32Bits() ? STLR_w : STLR_x;
-  Emit(op | Rs(x31) | Rt2(x31) | RnSP(rn) | Rt(rt));
-}
-
-void Assembler::stlxr(const Register& rs, const Register& rt,
-                      const Register& rn) {
-  DCHECK(rs.Is32Bits());
-  DCHECK(rn.Is64Bits());
-  DCHECK(!rs.Is(rt) && !rs.Is(rn));
-  LoadStoreAcquireReleaseOp op = rt.Is32Bits() ? STLXR_w : STLXR_x;
-  Emit(op | Rs(rs) | Rt2(x31) | RnSP(rn) | Rt(rt));
-}
-
-void Assembler::ldarb(const Register& rt, const Register& rn) {
-  DCHECK(rt.Is32Bits());
-  DCHECK(rn.Is64Bits());
-  Emit(LDAR_b | Rs(x31) | Rt2(x31) | RnSP(rn) | Rt(rt));
-}
-
-void Assembler::ldaxrb(const Register& rt, const Register& rn) {
-  DCHECK(rt.Is32Bits());
-  DCHECK(rn.Is64Bits());
-  Emit(LDAXR_b | Rs(x31) | Rt2(x31) | RnSP(rn) | Rt(rt));
-}
-
-void Assembler::stlrb(const Register& rt, const Register& rn) {
-  DCHECK(rt.Is32Bits());
-  DCHECK(rn.Is64Bits());
-  Emit(STLR_b | Rs(x31) | Rt2(x31) | RnSP(rn) | Rt(rt));
-}
-
-void Assembler::stlxrb(const Register& rs, const Register& rt,
-                       const Register& rn) {
-  DCHECK(rs.Is32Bits());
-  DCHECK(rt.Is32Bits());
-  DCHECK(rn.Is64Bits());
-  DCHECK(!rs.Is(rt) && !rs.Is(rn));
-  Emit(STLXR_b | Rs(rs) | Rt2(x31) | RnSP(rn) | Rt(rt));
-}
-
-void Assembler::ldarh(const Register& rt, const Register& rn) {
-  DCHECK(rt.Is32Bits());
-  DCHECK(rn.Is64Bits());
-  Emit(LDAR_h | Rs(x31) | Rt2(x31) | RnSP(rn) | Rt(rt));
-}
-
-void Assembler::ldaxrh(const Register& rt, const Register& rn) {
-  DCHECK(rt.Is32Bits());
-  DCHECK(rn.Is64Bits());
-  Emit(LDAXR_h | Rs(x31) | Rt2(x31) | RnSP(rn) | Rt(rt));
-}
-
-void Assembler::stlrh(const Register& rt, const Register& rn) {
-  DCHECK(rt.Is32Bits());
-  DCHECK(rn.Is64Bits());
-  Emit(STLR_h | Rs(x31) | Rt2(x31) | RnSP(rn) | Rt(rt));
-}
-
-void Assembler::stlxrh(const Register& rs, const Register& rt,
-                       const Register& rn) {
-  DCHECK(rs.Is32Bits());
-  DCHECK(rt.Is32Bits());
-  DCHECK(rn.Is64Bits());
-  DCHECK(!rs.Is(rt) && !rs.Is(rn));
-  Emit(STLXR_h | Rs(rs) | Rt2(x31) | RnSP(rn) | Rt(rt));
-}
-
-void Assembler::NEON3DifferentL(const VRegister& vd, const VRegister& vn,
-                                const VRegister& vm, NEON3DifferentOp vop) {
-  DCHECK(AreSameFormat(vn, vm));
-  DCHECK((vn.Is1H() && vd.Is1S()) || (vn.Is1S() && vd.Is1D()) ||
-         (vn.Is8B() && vd.Is8H()) || (vn.Is4H() && vd.Is4S()) ||
-         (vn.Is2S() && vd.Is2D()) || (vn.Is16B() && vd.Is8H()) ||
-         (vn.Is8H() && vd.Is4S()) || (vn.Is4S() && vd.Is2D()));
-  Instr format, op = vop;
-  if (vd.IsScalar()) {
-    op |= NEON_Q | NEONScalar;
-    format = SFormat(vn);
-  } else {
-    format = VFormat(vn);
-  }
-  Emit(format | op | Rm(vm) | Rn(vn) | Rd(vd));
-}
-
-void Assembler::NEON3DifferentW(const VRegister& vd, const VRegister& vn,
-                                const VRegister& vm, NEON3DifferentOp vop) {
-  DCHECK(AreSameFormat(vd, vn));
-  DCHECK((vm.Is8B() && vd.Is8H()) || (vm.Is4H() && vd.Is4S()) ||
-         (vm.Is2S() && vd.Is2D()) || (vm.Is16B() && vd.Is8H()) ||
-         (vm.Is8H() && vd.Is4S()) || (vm.Is4S() && vd.Is2D()));
-  Emit(VFormat(vm) | vop | Rm(vm) | Rn(vn) | Rd(vd));
-}
-
-void Assembler::NEON3DifferentHN(const VRegister& vd, const VRegister& vn,
-                                 const VRegister& vm, NEON3DifferentOp vop) {
-  DCHECK(AreSameFormat(vm, vn));
-  DCHECK((vd.Is8B() && vn.Is8H()) || (vd.Is4H() && vn.Is4S()) ||
-         (vd.Is2S() && vn.Is2D()) || (vd.Is16B() && vn.Is8H()) ||
-         (vd.Is8H() && vn.Is4S()) || (vd.Is4S() && vn.Is2D()));
-  Emit(VFormat(vd) | vop | Rm(vm) | Rn(vn) | Rd(vd));
-}
-
-#define NEON_3DIFF_LONG_LIST(V)                                                \
-  V(pmull, NEON_PMULL, vn.IsVector() && vn.Is8B())                             \
-  V(pmull2, NEON_PMULL2, vn.IsVector() && vn.Is16B())                          \
-  V(saddl, NEON_SADDL, vn.IsVector() && vn.IsD())                              \
-  V(saddl2, NEON_SADDL2, vn.IsVector() && vn.IsQ())                            \
-  V(sabal, NEON_SABAL, vn.IsVector() && vn.IsD())                              \
-  V(sabal2, NEON_SABAL2, vn.IsVector() && vn.IsQ())                            \
-  V(uabal, NEON_UABAL, vn.IsVector() && vn.IsD())                              \
-  V(uabal2, NEON_UABAL2, vn.IsVector() && vn.IsQ())                            \
-  V(sabdl, NEON_SABDL, vn.IsVector() && vn.IsD())                              \
-  V(sabdl2, NEON_SABDL2, vn.IsVector() && vn.IsQ())                            \
-  V(uabdl, NEON_UABDL, vn.IsVector() && vn.IsD())                              \
-  V(uabdl2, NEON_UABDL2, vn.IsVector() && vn.IsQ())                            \
-  V(smlal, NEON_SMLAL, vn.IsVector() && vn.IsD())                              \
-  V(smlal2, NEON_SMLAL2, vn.IsVector() && vn.IsQ())                            \
-  V(umlal, NEON_UMLAL, vn.IsVector() && vn.IsD())                              \
-  V(umlal2, NEON_UMLAL2, vn.IsVector() && vn.IsQ())                            \
-  V(smlsl, NEON_SMLSL, vn.IsVector() && vn.IsD())                              \
-  V(smlsl2, NEON_SMLSL2, vn.IsVector() && vn.IsQ())                            \
-  V(umlsl, NEON_UMLSL, vn.IsVector() && vn.IsD())                              \
-  V(umlsl2, NEON_UMLSL2, vn.IsVector() && vn.IsQ())                            \
-  V(smull, NEON_SMULL, vn.IsVector() && vn.IsD())                              \
-  V(smull2, NEON_SMULL2, vn.IsVector() && vn.IsQ())                            \
-  V(umull, NEON_UMULL, vn.IsVector() && vn.IsD())                              \
-  V(umull2, NEON_UMULL2, vn.IsVector() && vn.IsQ())                            \
-  V(ssubl, NEON_SSUBL, vn.IsVector() && vn.IsD())                              \
-  V(ssubl2, NEON_SSUBL2, vn.IsVector() && vn.IsQ())                            \
-  V(uaddl, NEON_UADDL, vn.IsVector() && vn.IsD())                              \
-  V(uaddl2, NEON_UADDL2, vn.IsVector() && vn.IsQ())                            \
-  V(usubl, NEON_USUBL, vn.IsVector() && vn.IsD())                              \
-  V(usubl2, NEON_USUBL2, vn.IsVector() && vn.IsQ())                            \
-  V(sqdmlal, NEON_SQDMLAL, vn.Is1H() || vn.Is1S() || vn.Is4H() || vn.Is2S())   \
-  V(sqdmlal2, NEON_SQDMLAL2, vn.Is1H() || vn.Is1S() || vn.Is8H() || vn.Is4S()) \
-  V(sqdmlsl, NEON_SQDMLSL, vn.Is1H() || vn.Is1S() || vn.Is4H() || vn.Is2S())   \
-  V(sqdmlsl2, NEON_SQDMLSL2, vn.Is1H() || vn.Is1S() || vn.Is8H() || vn.Is4S()) \
-  V(sqdmull, NEON_SQDMULL, vn.Is1H() || vn.Is1S() || vn.Is4H() || vn.Is2S())   \
-  V(sqdmull2, NEON_SQDMULL2, vn.Is1H() || vn.Is1S() || vn.Is8H() || vn.Is4S())
-
-#define DEFINE_ASM_FUNC(FN, OP, AS)                            \
-  void Assembler::FN(const VRegister& vd, const VRegister& vn, \
-                     const VRegister& vm) {                    \
-    DCHECK(AS);                                                \
-    NEON3DifferentL(vd, vn, vm, OP);                           \
-  }
-NEON_3DIFF_LONG_LIST(DEFINE_ASM_FUNC)
-#undef DEFINE_ASM_FUNC
-
-#define NEON_3DIFF_HN_LIST(V)        \
-  V(addhn, NEON_ADDHN, vd.IsD())     \
-  V(addhn2, NEON_ADDHN2, vd.IsQ())   \
-  V(raddhn, NEON_RADDHN, vd.IsD())   \
-  V(raddhn2, NEON_RADDHN2, vd.IsQ()) \
-  V(subhn, NEON_SUBHN, vd.IsD())     \
-  V(subhn2, NEON_SUBHN2, vd.IsQ())   \
-  V(rsubhn, NEON_RSUBHN, vd.IsD())   \
-  V(rsubhn2, NEON_RSUBHN2, vd.IsQ())
-
-#define DEFINE_ASM_FUNC(FN, OP, AS)                            \
-  void Assembler::FN(const VRegister& vd, const VRegister& vn, \
-                     const VRegister& vm) {                    \
-    DCHECK(AS);                                                \
-    NEON3DifferentHN(vd, vn, vm, OP);                          \
-  }
-NEON_3DIFF_HN_LIST(DEFINE_ASM_FUNC)
-#undef DEFINE_ASM_FUNC
-
-void Assembler::NEONPerm(const VRegister& vd, const VRegister& vn,
-                         const VRegister& vm, NEONPermOp op) {
-  DCHECK(AreSameFormat(vd, vn, vm));
-  DCHECK(!vd.Is1D());
-  Emit(VFormat(vd) | op | Rm(vm) | Rn(vn) | Rd(vd));
-}
-
-void Assembler::trn1(const VRegister& vd, const VRegister& vn,
-                     const VRegister& vm) {
-  NEONPerm(vd, vn, vm, NEON_TRN1);
-}
-
-void Assembler::trn2(const VRegister& vd, const VRegister& vn,
-                     const VRegister& vm) {
-  NEONPerm(vd, vn, vm, NEON_TRN2);
-}
-
-void Assembler::uzp1(const VRegister& vd, const VRegister& vn,
-                     const VRegister& vm) {
-  NEONPerm(vd, vn, vm, NEON_UZP1);
-}
-
-void Assembler::uzp2(const VRegister& vd, const VRegister& vn,
-                     const VRegister& vm) {
-  NEONPerm(vd, vn, vm, NEON_UZP2);
-}
-
-void Assembler::zip1(const VRegister& vd, const VRegister& vn,
-                     const VRegister& vm) {
-  NEONPerm(vd, vn, vm, NEON_ZIP1);
-}
-
-void Assembler::zip2(const VRegister& vd, const VRegister& vn,
-                     const VRegister& vm) {
-  NEONPerm(vd, vn, vm, NEON_ZIP2);
-}
-
-void Assembler::NEONShiftImmediate(const VRegister& vd, const VRegister& vn,
-                                   NEONShiftImmediateOp op, int immh_immb) {
-  DCHECK(AreSameFormat(vd, vn));
-  Instr q, scalar;
-  if (vn.IsScalar()) {
-    q = NEON_Q;
-    scalar = NEONScalar;
-  } else {
-    q = vd.IsD() ? 0 : NEON_Q;
-    scalar = 0;
-  }
-  Emit(q | op | scalar | immh_immb | Rn(vn) | Rd(vd));
-}
-
-void Assembler::NEONShiftLeftImmediate(const VRegister& vd, const VRegister& vn,
-                                       int shift, NEONShiftImmediateOp op) {
-  int laneSizeInBits = vn.LaneSizeInBits();
-  DCHECK((shift >= 0) && (shift < laneSizeInBits));
-  NEONShiftImmediate(vd, vn, op, (laneSizeInBits + shift) << 16);
-}
-
-void Assembler::NEONShiftRightImmediate(const VRegister& vd,
-                                        const VRegister& vn, int shift,
-                                        NEONShiftImmediateOp op) {
-  int laneSizeInBits = vn.LaneSizeInBits();
-  DCHECK((shift >= 1) && (shift <= laneSizeInBits));
-  NEONShiftImmediate(vd, vn, op, ((2 * laneSizeInBits) - shift) << 16);
-}
-
-void Assembler::NEONShiftImmediateL(const VRegister& vd, const VRegister& vn,
-                                    int shift, NEONShiftImmediateOp op) {
-  int laneSizeInBits = vn.LaneSizeInBits();
-  DCHECK((shift >= 0) && (shift < laneSizeInBits));
-  int immh_immb = (laneSizeInBits + shift) << 16;
-
-  DCHECK((vn.Is8B() && vd.Is8H()) || (vn.Is4H() && vd.Is4S()) ||
-         (vn.Is2S() && vd.Is2D()) || (vn.Is16B() && vd.Is8H()) ||
-         (vn.Is8H() && vd.Is4S()) || (vn.Is4S() && vd.Is2D()));
-  Instr q;
-  q = vn.IsD() ? 0 : NEON_Q;
-  Emit(q | op | immh_immb | Rn(vn) | Rd(vd));
-}
-
-void Assembler::NEONShiftImmediateN(const VRegister& vd, const VRegister& vn,
-                                    int shift, NEONShiftImmediateOp op) {
-  Instr q, scalar;
-  int laneSizeInBits = vd.LaneSizeInBits();
-  DCHECK((shift >= 1) && (shift <= laneSizeInBits));
-  int immh_immb = (2 * laneSizeInBits - shift) << 16;
-
-  if (vn.IsScalar()) {
-    DCHECK((vd.Is1B() && vn.Is1H()) || (vd.Is1H() && vn.Is1S()) ||
-           (vd.Is1S() && vn.Is1D()));
-    q = NEON_Q;
-    scalar = NEONScalar;
-  } else {
-    DCHECK((vd.Is8B() && vn.Is8H()) || (vd.Is4H() && vn.Is4S()) ||
-           (vd.Is2S() && vn.Is2D()) || (vd.Is16B() && vn.Is8H()) ||
-           (vd.Is8H() && vn.Is4S()) || (vd.Is4S() && vn.Is2D()));
-    scalar = 0;
-    q = vd.IsD() ? 0 : NEON_Q;
-  }
-  Emit(q | op | scalar | immh_immb | Rn(vn) | Rd(vd));
-}
-
-void Assembler::shl(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vd.IsVector() || vd.Is1D());
-  NEONShiftLeftImmediate(vd, vn, shift, NEON_SHL);
-}
-
-void Assembler::sli(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vd.IsVector() || vd.Is1D());
-  NEONShiftLeftImmediate(vd, vn, shift, NEON_SLI);
-}
-
-void Assembler::sqshl(const VRegister& vd, const VRegister& vn, int shift) {
-  NEONShiftLeftImmediate(vd, vn, shift, NEON_SQSHL_imm);
-}
-
-void Assembler::sqshlu(const VRegister& vd, const VRegister& vn, int shift) {
-  NEONShiftLeftImmediate(vd, vn, shift, NEON_SQSHLU);
-}
-
-void Assembler::uqshl(const VRegister& vd, const VRegister& vn, int shift) {
-  NEONShiftLeftImmediate(vd, vn, shift, NEON_UQSHL_imm);
-}
-
-void Assembler::sshll(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vn.IsD());
-  NEONShiftImmediateL(vd, vn, shift, NEON_SSHLL);
-}
-
-void Assembler::sshll2(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vn.IsQ());
-  NEONShiftImmediateL(vd, vn, shift, NEON_SSHLL);
-}
-
-void Assembler::sxtl(const VRegister& vd, const VRegister& vn) {
-  sshll(vd, vn, 0);
-}
-
-void Assembler::sxtl2(const VRegister& vd, const VRegister& vn) {
-  sshll2(vd, vn, 0);
-}
-
-void Assembler::ushll(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vn.IsD());
-  NEONShiftImmediateL(vd, vn, shift, NEON_USHLL);
-}
-
-void Assembler::ushll2(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vn.IsQ());
-  NEONShiftImmediateL(vd, vn, shift, NEON_USHLL);
-}
-
-void Assembler::uxtl(const VRegister& vd, const VRegister& vn) {
-  ushll(vd, vn, 0);
-}
-
-void Assembler::uxtl2(const VRegister& vd, const VRegister& vn) {
-  ushll2(vd, vn, 0);
-}
-
-void Assembler::sri(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vd.IsVector() || vd.Is1D());
-  NEONShiftRightImmediate(vd, vn, shift, NEON_SRI);
-}
-
-void Assembler::sshr(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vd.IsVector() || vd.Is1D());
-  NEONShiftRightImmediate(vd, vn, shift, NEON_SSHR);
-}
-
-void Assembler::ushr(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vd.IsVector() || vd.Is1D());
-  NEONShiftRightImmediate(vd, vn, shift, NEON_USHR);
-}
-
-void Assembler::srshr(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vd.IsVector() || vd.Is1D());
-  NEONShiftRightImmediate(vd, vn, shift, NEON_SRSHR);
-}
-
-void Assembler::urshr(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vd.IsVector() || vd.Is1D());
-  NEONShiftRightImmediate(vd, vn, shift, NEON_URSHR);
-}
-
-void Assembler::ssra(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vd.IsVector() || vd.Is1D());
-  NEONShiftRightImmediate(vd, vn, shift, NEON_SSRA);
-}
-
-void Assembler::usra(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vd.IsVector() || vd.Is1D());
-  NEONShiftRightImmediate(vd, vn, shift, NEON_USRA);
-}
-
-void Assembler::srsra(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vd.IsVector() || vd.Is1D());
-  NEONShiftRightImmediate(vd, vn, shift, NEON_SRSRA);
-}
-
-void Assembler::ursra(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vd.IsVector() || vd.Is1D());
-  NEONShiftRightImmediate(vd, vn, shift, NEON_URSRA);
-}
-
-void Assembler::shrn(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vn.IsVector() && vd.IsD());
-  NEONShiftImmediateN(vd, vn, shift, NEON_SHRN);
-}
-
-void Assembler::shrn2(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vn.IsVector() && vd.IsQ());
-  NEONShiftImmediateN(vd, vn, shift, NEON_SHRN);
-}
-
-void Assembler::rshrn(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vn.IsVector() && vd.IsD());
-  NEONShiftImmediateN(vd, vn, shift, NEON_RSHRN);
-}
-
-void Assembler::rshrn2(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vn.IsVector() && vd.IsQ());
-  NEONShiftImmediateN(vd, vn, shift, NEON_RSHRN);
-}
-
-void Assembler::sqshrn(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vd.IsD() || (vn.IsScalar() && vd.IsScalar()));
-  NEONShiftImmediateN(vd, vn, shift, NEON_SQSHRN);
-}
-
-void Assembler::sqshrn2(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vn.IsVector() && vd.IsQ());
-  NEONShiftImmediateN(vd, vn, shift, NEON_SQSHRN);
-}
-
-void Assembler::sqrshrn(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vd.IsD() || (vn.IsScalar() && vd.IsScalar()));
-  NEONShiftImmediateN(vd, vn, shift, NEON_SQRSHRN);
-}
-
-void Assembler::sqrshrn2(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vn.IsVector() && vd.IsQ());
-  NEONShiftImmediateN(vd, vn, shift, NEON_SQRSHRN);
-}
-
-void Assembler::sqshrun(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vd.IsD() || (vn.IsScalar() && vd.IsScalar()));
-  NEONShiftImmediateN(vd, vn, shift, NEON_SQSHRUN);
-}
-
-void Assembler::sqshrun2(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vn.IsVector() && vd.IsQ());
-  NEONShiftImmediateN(vd, vn, shift, NEON_SQSHRUN);
-}
-
-void Assembler::sqrshrun(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vd.IsD() || (vn.IsScalar() && vd.IsScalar()));
-  NEONShiftImmediateN(vd, vn, shift, NEON_SQRSHRUN);
-}
-
-void Assembler::sqrshrun2(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vn.IsVector() && vd.IsQ());
-  NEONShiftImmediateN(vd, vn, shift, NEON_SQRSHRUN);
-}
-
-void Assembler::uqshrn(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vd.IsD() || (vn.IsScalar() && vd.IsScalar()));
-  NEONShiftImmediateN(vd, vn, shift, NEON_UQSHRN);
-}
-
-void Assembler::uqshrn2(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vn.IsVector() && vd.IsQ());
-  NEONShiftImmediateN(vd, vn, shift, NEON_UQSHRN);
-}
-
-void Assembler::uqrshrn(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vd.IsD() || (vn.IsScalar() && vd.IsScalar()));
-  NEONShiftImmediateN(vd, vn, shift, NEON_UQRSHRN);
-}
-
-void Assembler::uqrshrn2(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK(vn.IsVector() && vd.IsQ());
-  NEONShiftImmediateN(vd, vn, shift, NEON_UQRSHRN);
-}
-
-void Assembler::uaddw(const VRegister& vd, const VRegister& vn,
-                      const VRegister& vm) {
-  DCHECK(vm.IsD());
-  NEON3DifferentW(vd, vn, vm, NEON_UADDW);
-}
-
-void Assembler::uaddw2(const VRegister& vd, const VRegister& vn,
-                       const VRegister& vm) {
-  DCHECK(vm.IsQ());
-  NEON3DifferentW(vd, vn, vm, NEON_UADDW2);
-}
-
-void Assembler::saddw(const VRegister& vd, const VRegister& vn,
-                      const VRegister& vm) {
-  DCHECK(vm.IsD());
-  NEON3DifferentW(vd, vn, vm, NEON_SADDW);
-}
-
-void Assembler::saddw2(const VRegister& vd, const VRegister& vn,
-                       const VRegister& vm) {
-  DCHECK(vm.IsQ());
-  NEON3DifferentW(vd, vn, vm, NEON_SADDW2);
-}
-
-void Assembler::usubw(const VRegister& vd, const VRegister& vn,
-                      const VRegister& vm) {
-  DCHECK(vm.IsD());
-  NEON3DifferentW(vd, vn, vm, NEON_USUBW);
-}
-
-void Assembler::usubw2(const VRegister& vd, const VRegister& vn,
-                       const VRegister& vm) {
-  DCHECK(vm.IsQ());
-  NEON3DifferentW(vd, vn, vm, NEON_USUBW2);
-}
-
-void Assembler::ssubw(const VRegister& vd, const VRegister& vn,
-                      const VRegister& vm) {
-  DCHECK(vm.IsD());
-  NEON3DifferentW(vd, vn, vm, NEON_SSUBW);
-}
-
-void Assembler::ssubw2(const VRegister& vd, const VRegister& vn,
-                       const VRegister& vm) {
-  DCHECK(vm.IsQ());
-  NEON3DifferentW(vd, vn, vm, NEON_SSUBW2);
-}
-
-void Assembler::mov(const Register& rd, const Register& rm) {
-  // Moves involving the stack pointer are encoded as add immediate with
-  // second operand of zero. Otherwise, orr with first operand zr is
-  // used.
-  if (rd.IsSP() || rm.IsSP()) {
-    add(rd, rm, 0);
-  } else {
-    orr(rd, AppropriateZeroRegFor(rd), rm);
-  }
-}
-
-void Assembler::ins(const VRegister& vd, int vd_index, const Register& rn) {
-  // We support vd arguments of the form vd.VxT() or vd.T(), where x is the
-  // number of lanes, and T is b, h, s or d.
-  int lane_size = vd.LaneSizeInBytes();
-  NEONFormatField format;
-  switch (lane_size) {
-    case 1:
-      format = NEON_16B;
-      DCHECK(rn.IsW());
-      break;
-    case 2:
-      format = NEON_8H;
-      DCHECK(rn.IsW());
-      break;
-    case 4:
-      format = NEON_4S;
-      DCHECK(rn.IsW());
-      break;
-    default:
-      DCHECK_EQ(lane_size, 8);
-      DCHECK(rn.IsX());
-      format = NEON_2D;
-      break;
-  }
-
-  DCHECK((0 <= vd_index) &&
-         (vd_index < LaneCountFromFormat(static_cast<VectorFormat>(format))));
-  Emit(NEON_INS_GENERAL | ImmNEON5(format, vd_index) | Rn(rn) | Rd(vd));
-}
-
-void Assembler::mov(const Register& rd, const VRegister& vn, int vn_index) {
-  DCHECK_GE(vn.SizeInBytes(), 4);
-  umov(rd, vn, vn_index);
-}
-
-void Assembler::smov(const Register& rd, const VRegister& vn, int vn_index) {
-  // We support vn arguments of the form vn.VxT() or vn.T(), where x is the
-  // number of lanes, and T is b, h, s.
-  int lane_size = vn.LaneSizeInBytes();
-  NEONFormatField format;
-  Instr q = 0;
-  switch (lane_size) {
-    case 1:
-      format = NEON_16B;
-      break;
-    case 2:
-      format = NEON_8H;
-      break;
-    default:
-      DCHECK_EQ(lane_size, 4);
-      DCHECK(rd.IsX());
-      format = NEON_4S;
-      break;
-  }
-  q = rd.IsW() ? 0 : NEON_Q;
-  DCHECK((0 <= vn_index) &&
-         (vn_index < LaneCountFromFormat(static_cast<VectorFormat>(format))));
-  Emit(q | NEON_SMOV | ImmNEON5(format, vn_index) | Rn(vn) | Rd(rd));
-}
-
-void Assembler::cls(const VRegister& vd, const VRegister& vn) {
-  DCHECK(AreSameFormat(vd, vn));
-  DCHECK(!vd.Is1D() && !vd.Is2D());
-  Emit(VFormat(vn) | NEON_CLS | Rn(vn) | Rd(vd));
-}
-
-void Assembler::clz(const VRegister& vd, const VRegister& vn) {
-  DCHECK(AreSameFormat(vd, vn));
-  DCHECK(!vd.Is1D() && !vd.Is2D());
-  Emit(VFormat(vn) | NEON_CLZ | Rn(vn) | Rd(vd));
-}
-
-void Assembler::cnt(const VRegister& vd, const VRegister& vn) {
-  DCHECK(AreSameFormat(vd, vn));
-  DCHECK(vd.Is8B() || vd.Is16B());
-  Emit(VFormat(vn) | NEON_CNT | Rn(vn) | Rd(vd));
-}
-
-void Assembler::rev16(const VRegister& vd, const VRegister& vn) {
-  DCHECK(AreSameFormat(vd, vn));
-  DCHECK(vd.Is8B() || vd.Is16B());
-  Emit(VFormat(vn) | NEON_REV16 | Rn(vn) | Rd(vd));
-}
-
-void Assembler::rev32(const VRegister& vd, const VRegister& vn) {
-  DCHECK(AreSameFormat(vd, vn));
-  DCHECK(vd.Is8B() || vd.Is16B() || vd.Is4H() || vd.Is8H());
-  Emit(VFormat(vn) | NEON_REV32 | Rn(vn) | Rd(vd));
-}
-
-void Assembler::rev64(const VRegister& vd, const VRegister& vn) {
-  DCHECK(AreSameFormat(vd, vn));
-  DCHECK(!vd.Is1D() && !vd.Is2D());
-  Emit(VFormat(vn) | NEON_REV64 | Rn(vn) | Rd(vd));
-}
-
-void Assembler::ursqrte(const VRegister& vd, const VRegister& vn) {
-  DCHECK(AreSameFormat(vd, vn));
-  DCHECK(vd.Is2S() || vd.Is4S());
-  Emit(VFormat(vn) | NEON_URSQRTE | Rn(vn) | Rd(vd));
-}
-
-void Assembler::urecpe(const VRegister& vd, const VRegister& vn) {
-  DCHECK(AreSameFormat(vd, vn));
-  DCHECK(vd.Is2S() || vd.Is4S());
-  Emit(VFormat(vn) | NEON_URECPE | Rn(vn) | Rd(vd));
-}
-
-void Assembler::NEONAddlp(const VRegister& vd, const VRegister& vn,
-                          NEON2RegMiscOp op) {
-  DCHECK((op == NEON_SADDLP) || (op == NEON_UADDLP) || (op == NEON_SADALP) ||
-         (op == NEON_UADALP));
-
-  DCHECK((vn.Is8B() && vd.Is4H()) || (vn.Is4H() && vd.Is2S()) ||
-         (vn.Is2S() && vd.Is1D()) || (vn.Is16B() && vd.Is8H()) ||
-         (vn.Is8H() && vd.Is4S()) || (vn.Is4S() && vd.Is2D()));
-  Emit(VFormat(vn) | op | Rn(vn) | Rd(vd));
-}
-
-void Assembler::saddlp(const VRegister& vd, const VRegister& vn) {
-  NEONAddlp(vd, vn, NEON_SADDLP);
-}
-
-void Assembler::uaddlp(const VRegister& vd, const VRegister& vn) {
-  NEONAddlp(vd, vn, NEON_UADDLP);
-}
-
-void Assembler::sadalp(const VRegister& vd, const VRegister& vn) {
-  NEONAddlp(vd, vn, NEON_SADALP);
-}
-
-void Assembler::uadalp(const VRegister& vd, const VRegister& vn) {
-  NEONAddlp(vd, vn, NEON_UADALP);
-}
-
-void Assembler::NEONAcrossLanesL(const VRegister& vd, const VRegister& vn,
-                                 NEONAcrossLanesOp op) {
-  DCHECK((vn.Is8B() && vd.Is1H()) || (vn.Is16B() && vd.Is1H()) ||
-         (vn.Is4H() && vd.Is1S()) || (vn.Is8H() && vd.Is1S()) ||
-         (vn.Is4S() && vd.Is1D()));
-  Emit(VFormat(vn) | op | Rn(vn) | Rd(vd));
-}
-
-void Assembler::saddlv(const VRegister& vd, const VRegister& vn) {
-  NEONAcrossLanesL(vd, vn, NEON_SADDLV);
-}
-
-void Assembler::uaddlv(const VRegister& vd, const VRegister& vn) {
-  NEONAcrossLanesL(vd, vn, NEON_UADDLV);
-}
-
-void Assembler::NEONAcrossLanes(const VRegister& vd, const VRegister& vn,
-                                NEONAcrossLanesOp op) {
-  DCHECK((vn.Is8B() && vd.Is1B()) || (vn.Is16B() && vd.Is1B()) ||
-         (vn.Is4H() && vd.Is1H()) || (vn.Is8H() && vd.Is1H()) ||
-         (vn.Is4S() && vd.Is1S()));
-  if ((op & NEONAcrossLanesFPFMask) == NEONAcrossLanesFPFixed) {
-    Emit(FPFormat(vn) | op | Rn(vn) | Rd(vd));
-  } else {
-    Emit(VFormat(vn) | op | Rn(vn) | Rd(vd));
-  }
-}
-
-#define NEON_ACROSSLANES_LIST(V)      \
-  V(fmaxv, NEON_FMAXV, vd.Is1S())     \
-  V(fminv, NEON_FMINV, vd.Is1S())     \
-  V(fmaxnmv, NEON_FMAXNMV, vd.Is1S()) \
-  V(fminnmv, NEON_FMINNMV, vd.Is1S()) \
-  V(addv, NEON_ADDV, true)            \
-  V(smaxv, NEON_SMAXV, true)          \
-  V(sminv, NEON_SMINV, true)          \
-  V(umaxv, NEON_UMAXV, true)          \
-  V(uminv, NEON_UMINV, true)
-
-#define DEFINE_ASM_FUNC(FN, OP, AS)                              \
-  void Assembler::FN(const VRegister& vd, const VRegister& vn) { \
-    DCHECK(AS);                                                  \
-    NEONAcrossLanes(vd, vn, OP);                                 \
-  }
-NEON_ACROSSLANES_LIST(DEFINE_ASM_FUNC)
-#undef DEFINE_ASM_FUNC
-
-void Assembler::mov(const VRegister& vd, int vd_index, const Register& rn) {
-  ins(vd, vd_index, rn);
-}
-
-void Assembler::umov(const Register& rd, const VRegister& vn, int vn_index) {
-  // We support vn arguments of the form vn.VxT() or vn.T(), where x is the
-  // number of lanes, and T is b, h, s or d.
-  int lane_size = vn.LaneSizeInBytes();
-  NEONFormatField format;
-  Instr q = 0;
-  switch (lane_size) {
-    case 1:
-      format = NEON_16B;
-      DCHECK(rd.IsW());
-      break;
-    case 2:
-      format = NEON_8H;
-      DCHECK(rd.IsW());
-      break;
-    case 4:
-      format = NEON_4S;
-      DCHECK(rd.IsW());
-      break;
-    default:
-      DCHECK_EQ(lane_size, 8);
-      DCHECK(rd.IsX());
-      format = NEON_2D;
-      q = NEON_Q;
-      break;
-  }
-
-  DCHECK((0 <= vn_index) &&
-         (vn_index < LaneCountFromFormat(static_cast<VectorFormat>(format))));
-  Emit(q | NEON_UMOV | ImmNEON5(format, vn_index) | Rn(vn) | Rd(rd));
-}
-
-void Assembler::mov(const VRegister& vd, const VRegister& vn, int vn_index) {
-  DCHECK(vd.IsScalar());
-  dup(vd, vn, vn_index);
-}
-
-void Assembler::dup(const VRegister& vd, const Register& rn) {
-  DCHECK(!vd.Is1D());
-  DCHECK_EQ(vd.Is2D(), rn.IsX());
-  Instr q = vd.IsD() ? 0 : NEON_Q;
-  Emit(q | NEON_DUP_GENERAL | ImmNEON5(VFormat(vd), 0) | Rn(rn) | Rd(vd));
-}
-
-void Assembler::ins(const VRegister& vd, int vd_index, const VRegister& vn,
-                    int vn_index) {
-  DCHECK(AreSameFormat(vd, vn));
-  // We support vd arguments of the form vd.VxT() or vd.T(), where x is the
-  // number of lanes, and T is b, h, s or d.
-  int lane_size = vd.LaneSizeInBytes();
-  NEONFormatField format;
-  switch (lane_size) {
-    case 1:
-      format = NEON_16B;
-      break;
-    case 2:
-      format = NEON_8H;
-      break;
-    case 4:
-      format = NEON_4S;
-      break;
-    default:
-      DCHECK_EQ(lane_size, 8);
-      format = NEON_2D;
-      break;
-  }
-
-  DCHECK((0 <= vd_index) &&
-         (vd_index < LaneCountFromFormat(static_cast<VectorFormat>(format))));
-  DCHECK((0 <= vn_index) &&
-         (vn_index < LaneCountFromFormat(static_cast<VectorFormat>(format))));
-  Emit(NEON_INS_ELEMENT | ImmNEON5(format, vd_index) |
-       ImmNEON4(format, vn_index) | Rn(vn) | Rd(vd));
-}
-
-void Assembler::NEONTable(const VRegister& vd, const VRegister& vn,
-                          const VRegister& vm, NEONTableOp op) {
-  DCHECK(vd.Is16B() || vd.Is8B());
-  DCHECK(vn.Is16B());
-  DCHECK(AreSameFormat(vd, vm));
-  Emit(op | (vd.IsQ() ? NEON_Q : 0) | Rm(vm) | Rn(vn) | Rd(vd));
-}
-
-void Assembler::tbl(const VRegister& vd, const VRegister& vn,
-                    const VRegister& vm) {
-  NEONTable(vd, vn, vm, NEON_TBL_1v);
-}
-
-void Assembler::tbl(const VRegister& vd, const VRegister& vn,
-                    const VRegister& vn2, const VRegister& vm) {
-  USE(vn2);
-  DCHECK(AreSameFormat(vn, vn2));
-  DCHECK(AreConsecutive(vn, vn2));
-  NEONTable(vd, vn, vm, NEON_TBL_2v);
-}
-
-void Assembler::tbl(const VRegister& vd, const VRegister& vn,
-                    const VRegister& vn2, const VRegister& vn3,
-                    const VRegister& vm) {
-  USE(vn2);
-  USE(vn3);
-  DCHECK(AreSameFormat(vn, vn2, vn3));
-  DCHECK(AreConsecutive(vn, vn2, vn3));
-  NEONTable(vd, vn, vm, NEON_TBL_3v);
-}
-
-void Assembler::tbl(const VRegister& vd, const VRegister& vn,
-                    const VRegister& vn2, const VRegister& vn3,
-                    const VRegister& vn4, const VRegister& vm) {
-  USE(vn2);
-  USE(vn3);
-  USE(vn4);
-  DCHECK(AreSameFormat(vn, vn2, vn3, vn4));
-  DCHECK(AreConsecutive(vn, vn2, vn3, vn4));
-  NEONTable(vd, vn, vm, NEON_TBL_4v);
-}
-
-void Assembler::tbx(const VRegister& vd, const VRegister& vn,
-                    const VRegister& vm) {
-  NEONTable(vd, vn, vm, NEON_TBX_1v);
-}
-
-void Assembler::tbx(const VRegister& vd, const VRegister& vn,
-                    const VRegister& vn2, const VRegister& vm) {
-  USE(vn2);
-  DCHECK(AreSameFormat(vn, vn2));
-  DCHECK(AreConsecutive(vn, vn2));
-  NEONTable(vd, vn, vm, NEON_TBX_2v);
-}
-
-void Assembler::tbx(const VRegister& vd, const VRegister& vn,
-                    const VRegister& vn2, const VRegister& vn3,
-                    const VRegister& vm) {
-  USE(vn2);
-  USE(vn3);
-  DCHECK(AreSameFormat(vn, vn2, vn3));
-  DCHECK(AreConsecutive(vn, vn2, vn3));
-  NEONTable(vd, vn, vm, NEON_TBX_3v);
-}
-
-void Assembler::tbx(const VRegister& vd, const VRegister& vn,
-                    const VRegister& vn2, const VRegister& vn3,
-                    const VRegister& vn4, const VRegister& vm) {
-  USE(vn2);
-  USE(vn3);
-  USE(vn4);
-  DCHECK(AreSameFormat(vn, vn2, vn3, vn4));
-  DCHECK(AreConsecutive(vn, vn2, vn3, vn4));
-  NEONTable(vd, vn, vm, NEON_TBX_4v);
-}
-
-void Assembler::mov(const VRegister& vd, int vd_index, const VRegister& vn,
-                    int vn_index) {
-  ins(vd, vd_index, vn, vn_index);
-}
-
-void Assembler::mvn(const Register& rd, const Operand& operand) {
-  orn(rd, AppropriateZeroRegFor(rd), operand);
-}
-
-void Assembler::mrs(const Register& rt, SystemRegister sysreg) {
-  DCHECK(rt.Is64Bits());
-  Emit(MRS | ImmSystemRegister(sysreg) | Rt(rt));
-}
-
-void Assembler::msr(SystemRegister sysreg, const Register& rt) {
-  DCHECK(rt.Is64Bits());
-  Emit(MSR | Rt(rt) | ImmSystemRegister(sysreg));
-}
-
-void Assembler::hint(SystemHint code) { Emit(HINT | ImmHint(code) | Rt(xzr)); }
-
-// NEON structure loads and stores.
-Instr Assembler::LoadStoreStructAddrModeField(const MemOperand& addr) {
-  Instr addr_field = RnSP(addr.base());
-
-  if (addr.IsPostIndex()) {
-    static_assert(NEONLoadStoreMultiStructPostIndex ==
-                      static_cast<NEONLoadStoreMultiStructPostIndexOp>(
-                          NEONLoadStoreSingleStructPostIndex),
-                  "Opcodes must match for NEON post index memop.");
-
-    addr_field |= NEONLoadStoreMultiStructPostIndex;
-    if (addr.offset() == 0) {
-      addr_field |= RmNot31(addr.regoffset());
-    } else {
-      // The immediate post index addressing mode is indicated by rm = 31.
-      // The immediate is implied by the number of vector registers used.
-      addr_field |= (0x1F << Rm_offset);
-    }
-  } else {
-    DCHECK(addr.IsImmediateOffset() && (addr.offset() == 0));
-  }
-  return addr_field;
-}
-
-void Assembler::LoadStoreStructVerify(const VRegister& vt,
-                                      const MemOperand& addr, Instr op) {
-#ifdef DEBUG
-  // Assert that addressing mode is either offset (with immediate 0), post
-  // index by immediate of the size of the register list, or post index by a
-  // value in a core register.
-  if (addr.IsImmediateOffset()) {
-    DCHECK_EQ(addr.offset(), 0);
-  } else {
-    int offset = vt.SizeInBytes();
-    switch (op) {
-      case NEON_LD1_1v:
-      case NEON_ST1_1v:
-        offset *= 1;
-        break;
-      case NEONLoadStoreSingleStructLoad1:
-      case NEONLoadStoreSingleStructStore1:
-      case NEON_LD1R:
-        offset = (offset / vt.LaneCount()) * 1;
-        break;
-
-      case NEON_LD1_2v:
-      case NEON_ST1_2v:
-      case NEON_LD2:
-      case NEON_ST2:
-        offset *= 2;
-        break;
-      case NEONLoadStoreSingleStructLoad2:
-      case NEONLoadStoreSingleStructStore2:
-      case NEON_LD2R:
-        offset = (offset / vt.LaneCount()) * 2;
-        break;
-
-      case NEON_LD1_3v:
-      case NEON_ST1_3v:
-      case NEON_LD3:
-      case NEON_ST3:
-        offset *= 3;
-        break;
-      case NEONLoadStoreSingleStructLoad3:
-      case NEONLoadStoreSingleStructStore3:
-      case NEON_LD3R:
-        offset = (offset / vt.LaneCount()) * 3;
-        break;
-
-      case NEON_LD1_4v:
-      case NEON_ST1_4v:
-      case NEON_LD4:
-      case NEON_ST4:
-        offset *= 4;
-        break;
-      case NEONLoadStoreSingleStructLoad4:
-      case NEONLoadStoreSingleStructStore4:
-      case NEON_LD4R:
-        offset = (offset / vt.LaneCount()) * 4;
-        break;
-      default:
-        UNREACHABLE();
-    }
-    DCHECK(!addr.regoffset().Is(NoReg) || addr.offset() == offset);
-  }
-#else
-  USE(vt);
-  USE(addr);
-  USE(op);
-#endif
-}
-
-void Assembler::LoadStoreStruct(const VRegister& vt, const MemOperand& addr,
-                                NEONLoadStoreMultiStructOp op) {
-  LoadStoreStructVerify(vt, addr, op);
-  DCHECK(vt.IsVector() || vt.Is1D());
-  Emit(op | LoadStoreStructAddrModeField(addr) | LSVFormat(vt) | Rt(vt));
-}
-
-void Assembler::LoadStoreStructSingleAllLanes(const VRegister& vt,
-                                              const MemOperand& addr,
-                                              NEONLoadStoreSingleStructOp op) {
-  LoadStoreStructVerify(vt, addr, op);
-  Emit(op | LoadStoreStructAddrModeField(addr) | LSVFormat(vt) | Rt(vt));
-}
-
-void Assembler::ld1(const VRegister& vt, const MemOperand& src) {
-  LoadStoreStruct(vt, src, NEON_LD1_1v);
-}
-
-void Assembler::ld1(const VRegister& vt, const VRegister& vt2,
-                    const MemOperand& src) {
-  USE(vt2);
-  DCHECK(AreSameFormat(vt, vt2));
-  DCHECK(AreConsecutive(vt, vt2));
-  LoadStoreStruct(vt, src, NEON_LD1_2v);
-}
-
-void Assembler::ld1(const VRegister& vt, const VRegister& vt2,
-                    const VRegister& vt3, const MemOperand& src) {
-  USE(vt2);
-  USE(vt3);
-  DCHECK(AreSameFormat(vt, vt2, vt3));
-  DCHECK(AreConsecutive(vt, vt2, vt3));
-  LoadStoreStruct(vt, src, NEON_LD1_3v);
-}
-
-void Assembler::ld1(const VRegister& vt, const VRegister& vt2,
-                    const VRegister& vt3, const VRegister& vt4,
-                    const MemOperand& src) {
-  USE(vt2);
-  USE(vt3);
-  USE(vt4);
-  DCHECK(AreSameFormat(vt, vt2, vt3, vt4));
-  DCHECK(AreConsecutive(vt, vt2, vt3, vt4));
-  LoadStoreStruct(vt, src, NEON_LD1_4v);
-}
-
-void Assembler::ld2(const VRegister& vt, const VRegister& vt2,
-                    const MemOperand& src) {
-  USE(vt2);
-  DCHECK(AreSameFormat(vt, vt2));
-  DCHECK(AreConsecutive(vt, vt2));
-  LoadStoreStruct(vt, src, NEON_LD2);
-}
-
-void Assembler::ld2(const VRegister& vt, const VRegister& vt2, int lane,
-                    const MemOperand& src) {
-  USE(vt2);
-  DCHECK(AreSameFormat(vt, vt2));
-  DCHECK(AreConsecutive(vt, vt2));
-  LoadStoreStructSingle(vt, lane, src, NEONLoadStoreSingleStructLoad2);
-}
-
-void Assembler::ld2r(const VRegister& vt, const VRegister& vt2,
-                     const MemOperand& src) {
-  USE(vt2);
-  DCHECK(AreSameFormat(vt, vt2));
-  DCHECK(AreConsecutive(vt, vt2));
-  LoadStoreStructSingleAllLanes(vt, src, NEON_LD2R);
-}
-
-void Assembler::ld3(const VRegister& vt, const VRegister& vt2,
-                    const VRegister& vt3, const MemOperand& src) {
-  USE(vt2);
-  USE(vt3);
-  DCHECK(AreSameFormat(vt, vt2, vt3));
-  DCHECK(AreConsecutive(vt, vt2, vt3));
-  LoadStoreStruct(vt, src, NEON_LD3);
-}
-
-void Assembler::ld3(const VRegister& vt, const VRegister& vt2,
-                    const VRegister& vt3, int lane, const MemOperand& src) {
-  USE(vt2);
-  USE(vt3);
-  DCHECK(AreSameFormat(vt, vt2, vt3));
-  DCHECK(AreConsecutive(vt, vt2, vt3));
-  LoadStoreStructSingle(vt, lane, src, NEONLoadStoreSingleStructLoad3);
-}
-
-void Assembler::ld3r(const VRegister& vt, const VRegister& vt2,
-                     const VRegister& vt3, const MemOperand& src) {
-  USE(vt2);
-  USE(vt3);
-  DCHECK(AreSameFormat(vt, vt2, vt3));
-  DCHECK(AreConsecutive(vt, vt2, vt3));
-  LoadStoreStructSingleAllLanes(vt, src, NEON_LD3R);
-}
-
-void Assembler::ld4(const VRegister& vt, const VRegister& vt2,
-                    const VRegister& vt3, const VRegister& vt4,
-                    const MemOperand& src) {
-  USE(vt2);
-  USE(vt3);
-  USE(vt4);
-  DCHECK(AreSameFormat(vt, vt2, vt3, vt4));
-  DCHECK(AreConsecutive(vt, vt2, vt3, vt4));
-  LoadStoreStruct(vt, src, NEON_LD4);
-}
-
-void Assembler::ld4(const VRegister& vt, const VRegister& vt2,
-                    const VRegister& vt3, const VRegister& vt4, int lane,
-                    const MemOperand& src) {
-  USE(vt2);
-  USE(vt3);
-  USE(vt4);
-  DCHECK(AreSameFormat(vt, vt2, vt3, vt4));
-  DCHECK(AreConsecutive(vt, vt2, vt3, vt4));
-  LoadStoreStructSingle(vt, lane, src, NEONLoadStoreSingleStructLoad4);
-}
-
-void Assembler::ld4r(const VRegister& vt, const VRegister& vt2,
-                     const VRegister& vt3, const VRegister& vt4,
-                     const MemOperand& src) {
-  USE(vt2);
-  USE(vt3);
-  USE(vt4);
-  DCHECK(AreSameFormat(vt, vt2, vt3, vt4));
-  DCHECK(AreConsecutive(vt, vt2, vt3, vt4));
-  LoadStoreStructSingleAllLanes(vt, src, NEON_LD4R);
-}
-
-void Assembler::st1(const VRegister& vt, const MemOperand& src) {
-  LoadStoreStruct(vt, src, NEON_ST1_1v);
-}
-
-void Assembler::st1(const VRegister& vt, const VRegister& vt2,
-                    const MemOperand& src) {
-  USE(vt2);
-  DCHECK(AreSameFormat(vt, vt2));
-  DCHECK(AreConsecutive(vt, vt2));
-  LoadStoreStruct(vt, src, NEON_ST1_2v);
-}
-
-void Assembler::st1(const VRegister& vt, const VRegister& vt2,
-                    const VRegister& vt3, const MemOperand& src) {
-  USE(vt2);
-  USE(vt3);
-  DCHECK(AreSameFormat(vt, vt2, vt3));
-  DCHECK(AreConsecutive(vt, vt2, vt3));
-  LoadStoreStruct(vt, src, NEON_ST1_3v);
-}
-
-void Assembler::st1(const VRegister& vt, const VRegister& vt2,
-                    const VRegister& vt3, const VRegister& vt4,
-                    const MemOperand& src) {
-  USE(vt2);
-  USE(vt3);
-  USE(vt4);
-  DCHECK(AreSameFormat(vt, vt2, vt3, vt4));
-  DCHECK(AreConsecutive(vt, vt2, vt3, vt4));
-  LoadStoreStruct(vt, src, NEON_ST1_4v);
-}
-
-void Assembler::st2(const VRegister& vt, const VRegister& vt2,
-                    const MemOperand& dst) {
-  USE(vt2);
-  DCHECK(AreSameFormat(vt, vt2));
-  DCHECK(AreConsecutive(vt, vt2));
-  LoadStoreStruct(vt, dst, NEON_ST2);
-}
-
-void Assembler::st2(const VRegister& vt, const VRegister& vt2, int lane,
-                    const MemOperand& dst) {
-  USE(vt2);
-  DCHECK(AreSameFormat(vt, vt2));
-  DCHECK(AreConsecutive(vt, vt2));
-  LoadStoreStructSingle(vt, lane, dst, NEONLoadStoreSingleStructStore2);
-}
-
-void Assembler::st3(const VRegister& vt, const VRegister& vt2,
-                    const VRegister& vt3, const MemOperand& dst) {
-  USE(vt2);
-  USE(vt3);
-  DCHECK(AreSameFormat(vt, vt2, vt3));
-  DCHECK(AreConsecutive(vt, vt2, vt3));
-  LoadStoreStruct(vt, dst, NEON_ST3);
-}
-
-void Assembler::st3(const VRegister& vt, const VRegister& vt2,
-                    const VRegister& vt3, int lane, const MemOperand& dst) {
-  USE(vt2);
-  USE(vt3);
-  DCHECK(AreSameFormat(vt, vt2, vt3));
-  DCHECK(AreConsecutive(vt, vt2, vt3));
-  LoadStoreStructSingle(vt, lane, dst, NEONLoadStoreSingleStructStore3);
-}
-
-void Assembler::st4(const VRegister& vt, const VRegister& vt2,
-                    const VRegister& vt3, const VRegister& vt4,
-                    const MemOperand& dst) {
-  USE(vt2);
-  USE(vt3);
-  USE(vt4);
-  DCHECK(AreSameFormat(vt, vt2, vt3, vt4));
-  DCHECK(AreConsecutive(vt, vt2, vt3, vt4));
-  LoadStoreStruct(vt, dst, NEON_ST4);
-}
-
-void Assembler::st4(const VRegister& vt, const VRegister& vt2,
-                    const VRegister& vt3, const VRegister& vt4, int lane,
-                    const MemOperand& dst) {
-  USE(vt2);
-  USE(vt3);
-  USE(vt4);
-  DCHECK(AreSameFormat(vt, vt2, vt3, vt4));
-  DCHECK(AreConsecutive(vt, vt2, vt3, vt4));
-  LoadStoreStructSingle(vt, lane, dst, NEONLoadStoreSingleStructStore4);
-}
-
-void Assembler::LoadStoreStructSingle(const VRegister& vt, uint32_t lane,
-                                      const MemOperand& addr,
-                                      NEONLoadStoreSingleStructOp op) {
-  LoadStoreStructVerify(vt, addr, op);
-
-  // We support vt arguments of the form vt.VxT() or vt.T(), where x is the
-  // number of lanes, and T is b, h, s or d.
-  unsigned lane_size = vt.LaneSizeInBytes();
-  DCHECK_LT(lane, kQRegSize / lane_size);
-
-  // Lane size is encoded in the opcode field. Lane index is encoded in the Q,
-  // S and size fields.
-  lane *= lane_size;
-
-  // Encodings for S[0]/D[0] and S[2]/D[1] are distinguished using the least-
-  // significant bit of the size field, so we increment lane here to account for
-  // that.
-  if (lane_size == 8) lane++;
-
-  Instr size = (lane << NEONLSSize_offset) & NEONLSSize_mask;
-  Instr s = (lane << (NEONS_offset - 2)) & NEONS_mask;
-  Instr q = (lane << (NEONQ_offset - 3)) & NEONQ_mask;
-
-  Instr instr = op;
-  switch (lane_size) {
-    case 1:
-      instr |= NEONLoadStoreSingle_b;
-      break;
-    case 2:
-      instr |= NEONLoadStoreSingle_h;
-      break;
-    case 4:
-      instr |= NEONLoadStoreSingle_s;
-      break;
-    default:
-      DCHECK_EQ(lane_size, 8U);
-      instr |= NEONLoadStoreSingle_d;
-  }
-
-  Emit(instr | LoadStoreStructAddrModeField(addr) | q | size | s | Rt(vt));
-}
-
-void Assembler::ld1(const VRegister& vt, int lane, const MemOperand& src) {
-  LoadStoreStructSingle(vt, lane, src, NEONLoadStoreSingleStructLoad1);
-}
-
-void Assembler::ld1r(const VRegister& vt, const MemOperand& src) {
-  LoadStoreStructSingleAllLanes(vt, src, NEON_LD1R);
-}
-
-void Assembler::st1(const VRegister& vt, int lane, const MemOperand& dst) {
-  LoadStoreStructSingle(vt, lane, dst, NEONLoadStoreSingleStructStore1);
-}
-
-void Assembler::dmb(BarrierDomain domain, BarrierType type) {
-  Emit(DMB | ImmBarrierDomain(domain) | ImmBarrierType(type));
-}
-
-void Assembler::dsb(BarrierDomain domain, BarrierType type) {
-  Emit(DSB | ImmBarrierDomain(domain) | ImmBarrierType(type));
-}
-
-void Assembler::isb() {
-  Emit(ISB | ImmBarrierDomain(FullSystem) | ImmBarrierType(BarrierAll));
-}
-
-void Assembler::fmov(const VRegister& vd, double imm) {
-  if (vd.IsScalar()) {
-    DCHECK(vd.Is1D());
-    Emit(FMOV_d_imm | Rd(vd) | ImmFP(imm));
-  } else {
-    DCHECK(vd.Is2D());
-    Instr op = NEONModifiedImmediate_MOVI | NEONModifiedImmediateOpBit;
-    Emit(NEON_Q | op | ImmNEONFP(imm) | NEONCmode(0xF) | Rd(vd));
-  }
-}
-
-void Assembler::fmov(const VRegister& vd, float imm) {
-  if (vd.IsScalar()) {
-    DCHECK(vd.Is1S());
-    Emit(FMOV_s_imm | Rd(vd) | ImmFP(imm));
-  } else {
-    DCHECK(vd.Is2S() | vd.Is4S());
-    Instr op = NEONModifiedImmediate_MOVI;
-    Instr q = vd.Is4S() ? NEON_Q : 0;
-    Emit(q | op | ImmNEONFP(imm) | NEONCmode(0xF) | Rd(vd));
-  }
-}
-
-void Assembler::fmov(const Register& rd, const VRegister& fn) {
-  DCHECK_EQ(rd.SizeInBits(), fn.SizeInBits());
-  FPIntegerConvertOp op = rd.Is32Bits() ? FMOV_ws : FMOV_xd;
-  Emit(op | Rd(rd) | Rn(fn));
-}
-
-void Assembler::fmov(const VRegister& vd, const Register& rn) {
-  DCHECK_EQ(vd.SizeInBits(), rn.SizeInBits());
-  FPIntegerConvertOp op = vd.Is32Bits() ? FMOV_sw : FMOV_dx;
-  Emit(op | Rd(vd) | Rn(rn));
-}
-
-void Assembler::fmov(const VRegister& vd, const VRegister& vn) {
-  DCHECK_EQ(vd.SizeInBits(), vn.SizeInBits());
-  Emit(FPType(vd) | FMOV | Rd(vd) | Rn(vn));
-}
-
-void Assembler::fmov(const VRegister& vd, int index, const Register& rn) {
-  DCHECK((index == 1) && vd.Is1D() && rn.IsX());
-  USE(index);
-  Emit(FMOV_d1_x | Rd(vd) | Rn(rn));
-}
-
-void Assembler::fmov(const Register& rd, const VRegister& vn, int index) {
-  DCHECK((index == 1) && vn.Is1D() && rd.IsX());
-  USE(index);
-  Emit(FMOV_x_d1 | Rd(rd) | Rn(vn));
-}
-
-void Assembler::fmadd(const VRegister& fd, const VRegister& fn,
-                      const VRegister& fm, const VRegister& fa) {
-  FPDataProcessing3Source(fd, fn, fm, fa, fd.Is32Bits() ? FMADD_s : FMADD_d);
-}
-
-void Assembler::fmsub(const VRegister& fd, const VRegister& fn,
-                      const VRegister& fm, const VRegister& fa) {
-  FPDataProcessing3Source(fd, fn, fm, fa, fd.Is32Bits() ? FMSUB_s : FMSUB_d);
-}
-
-void Assembler::fnmadd(const VRegister& fd, const VRegister& fn,
-                       const VRegister& fm, const VRegister& fa) {
-  FPDataProcessing3Source(fd, fn, fm, fa, fd.Is32Bits() ? FNMADD_s : FNMADD_d);
-}
-
-void Assembler::fnmsub(const VRegister& fd, const VRegister& fn,
-                       const VRegister& fm, const VRegister& fa) {
-  FPDataProcessing3Source(fd, fn, fm, fa, fd.Is32Bits() ? FNMSUB_s : FNMSUB_d);
-}
-
-void Assembler::fnmul(const VRegister& vd, const VRegister& vn,
-                      const VRegister& vm) {
-  DCHECK(AreSameSizeAndType(vd, vn, vm));
-  Instr op = vd.Is1S() ? FNMUL_s : FNMUL_d;
-  Emit(FPType(vd) | op | Rm(vm) | Rn(vn) | Rd(vd));
-}
-
-void Assembler::fcmp(const VRegister& fn, const VRegister& fm) {
-  DCHECK_EQ(fn.SizeInBits(), fm.SizeInBits());
-  Emit(FPType(fn) | FCMP | Rm(fm) | Rn(fn));
-}
-
-void Assembler::fcmp(const VRegister& fn, double value) {
-  USE(value);
-  // Although the fcmp instruction can strictly only take an immediate value of
-  // +0.0, we don't need to check for -0.0 because the sign of 0.0 doesn't
-  // affect the result of the comparison.
-  DCHECK_EQ(value, 0.0);
-  Emit(FPType(fn) | FCMP_zero | Rn(fn));
-}
-
-void Assembler::fccmp(const VRegister& fn, const VRegister& fm,
-                      StatusFlags nzcv, Condition cond) {
-  DCHECK_EQ(fn.SizeInBits(), fm.SizeInBits());
-  Emit(FPType(fn) | FCCMP | Rm(fm) | Cond(cond) | Rn(fn) | Nzcv(nzcv));
-}
-
-void Assembler::fcsel(const VRegister& fd, const VRegister& fn,
-                      const VRegister& fm, Condition cond) {
-  DCHECK_EQ(fd.SizeInBits(), fn.SizeInBits());
-  DCHECK_EQ(fd.SizeInBits(), fm.SizeInBits());
-  Emit(FPType(fd) | FCSEL | Rm(fm) | Cond(cond) | Rn(fn) | Rd(fd));
-}
-
-void Assembler::NEONFPConvertToInt(const Register& rd, const VRegister& vn,
-                                   Instr op) {
-  Emit(SF(rd) | FPType(vn) | op | Rn(vn) | Rd(rd));
-}
-
-void Assembler::NEONFPConvertToInt(const VRegister& vd, const VRegister& vn,
-                                   Instr op) {
-  if (vn.IsScalar()) {
-    DCHECK((vd.Is1S() && vn.Is1S()) || (vd.Is1D() && vn.Is1D()));
-    op |= NEON_Q | NEONScalar;
-  }
-  Emit(FPFormat(vn) | op | Rn(vn) | Rd(vd));
-}
-
-void Assembler::fcvt(const VRegister& vd, const VRegister& vn) {
-  FPDataProcessing1SourceOp op;
-  if (vd.Is1D()) {
-    DCHECK(vn.Is1S() || vn.Is1H());
-    op = vn.Is1S() ? FCVT_ds : FCVT_dh;
-  } else if (vd.Is1S()) {
-    DCHECK(vn.Is1D() || vn.Is1H());
-    op = vn.Is1D() ? FCVT_sd : FCVT_sh;
-  } else {
-    DCHECK(vd.Is1H());
-    DCHECK(vn.Is1D() || vn.Is1S());
-    op = vn.Is1D() ? FCVT_hd : FCVT_hs;
-  }
-  FPDataProcessing1Source(vd, vn, op);
-}
-
-void Assembler::fcvtl(const VRegister& vd, const VRegister& vn) {
-  DCHECK((vd.Is4S() && vn.Is4H()) || (vd.Is2D() && vn.Is2S()));
-  Instr format = vd.Is2D() ? (1 << NEONSize_offset) : 0;
-  Emit(format | NEON_FCVTL | Rn(vn) | Rd(vd));
-}
-
-void Assembler::fcvtl2(const VRegister& vd, const VRegister& vn) {
-  DCHECK((vd.Is4S() && vn.Is8H()) || (vd.Is2D() && vn.Is4S()));
-  Instr format = vd.Is2D() ? (1 << NEONSize_offset) : 0;
-  Emit(NEON_Q | format | NEON_FCVTL | Rn(vn) | Rd(vd));
-}
-
-void Assembler::fcvtn(const VRegister& vd, const VRegister& vn) {
-  DCHECK((vn.Is4S() && vd.Is4H()) || (vn.Is2D() && vd.Is2S()));
-  Instr format = vn.Is2D() ? (1 << NEONSize_offset) : 0;
-  Emit(format | NEON_FCVTN | Rn(vn) | Rd(vd));
-}
-
-void Assembler::fcvtn2(const VRegister& vd, const VRegister& vn) {
-  DCHECK((vn.Is4S() && vd.Is8H()) || (vn.Is2D() && vd.Is4S()));
-  Instr format = vn.Is2D() ? (1 << NEONSize_offset) : 0;
-  Emit(NEON_Q | format | NEON_FCVTN | Rn(vn) | Rd(vd));
-}
-
-void Assembler::fcvtxn(const VRegister& vd, const VRegister& vn) {
-  Instr format = 1 << NEONSize_offset;
-  if (vd.IsScalar()) {
-    DCHECK(vd.Is1S() && vn.Is1D());
-    Emit(format | NEON_FCVTXN_scalar | Rn(vn) | Rd(vd));
-  } else {
-    DCHECK(vd.Is2S() && vn.Is2D());
-    Emit(format | NEON_FCVTXN | Rn(vn) | Rd(vd));
-  }
-}
-
-void Assembler::fcvtxn2(const VRegister& vd, const VRegister& vn) {
-  DCHECK(vd.Is4S() && vn.Is2D());
-  Instr format = 1 << NEONSize_offset;
-  Emit(NEON_Q | format | NEON_FCVTXN | Rn(vn) | Rd(vd));
-}
-
-#define NEON_FP2REGMISC_FCVT_LIST(V) \
-  V(fcvtnu, NEON_FCVTNU, FCVTNU)     \
-  V(fcvtns, NEON_FCVTNS, FCVTNS)     \
-  V(fcvtpu, NEON_FCVTPU, FCVTPU)     \
-  V(fcvtps, NEON_FCVTPS, FCVTPS)     \
-  V(fcvtmu, NEON_FCVTMU, FCVTMU)     \
-  V(fcvtms, NEON_FCVTMS, FCVTMS)     \
-  V(fcvtau, NEON_FCVTAU, FCVTAU)     \
-  V(fcvtas, NEON_FCVTAS, FCVTAS)
-
-#define DEFINE_ASM_FUNCS(FN, VEC_OP, SCA_OP)                     \
-  void Assembler::FN(const Register& rd, const VRegister& vn) {  \
-    NEONFPConvertToInt(rd, vn, SCA_OP);                          \
-  }                                                              \
-  void Assembler::FN(const VRegister& vd, const VRegister& vn) { \
-    NEONFPConvertToInt(vd, vn, VEC_OP);                          \
-  }
-NEON_FP2REGMISC_FCVT_LIST(DEFINE_ASM_FUNCS)
-#undef DEFINE_ASM_FUNCS
-
-void Assembler::scvtf(const VRegister& vd, const VRegister& vn, int fbits) {
-  DCHECK_GE(fbits, 0);
-  if (fbits == 0) {
-    NEONFP2RegMisc(vd, vn, NEON_SCVTF);
-  } else {
-    DCHECK(vd.Is1D() || vd.Is1S() || vd.Is2D() || vd.Is2S() || vd.Is4S());
-    NEONShiftRightImmediate(vd, vn, fbits, NEON_SCVTF_imm);
-  }
-}
-
-void Assembler::ucvtf(const VRegister& vd, const VRegister& vn, int fbits) {
-  DCHECK_GE(fbits, 0);
-  if (fbits == 0) {
-    NEONFP2RegMisc(vd, vn, NEON_UCVTF);
-  } else {
-    DCHECK(vd.Is1D() || vd.Is1S() || vd.Is2D() || vd.Is2S() || vd.Is4S());
-    NEONShiftRightImmediate(vd, vn, fbits, NEON_UCVTF_imm);
-  }
-}
-
-void Assembler::scvtf(const VRegister& vd, const Register& rn, int fbits) {
-  DCHECK_GE(fbits, 0);
-  if (fbits == 0) {
-    Emit(SF(rn) | FPType(vd) | SCVTF | Rn(rn) | Rd(vd));
-  } else {
-    Emit(SF(rn) | FPType(vd) | SCVTF_fixed | FPScale(64 - fbits) | Rn(rn) |
-         Rd(vd));
-  }
-}
-
-void Assembler::ucvtf(const VRegister& fd, const Register& rn, int fbits) {
-  DCHECK_GE(fbits, 0);
-  if (fbits == 0) {
-    Emit(SF(rn) | FPType(fd) | UCVTF | Rn(rn) | Rd(fd));
-  } else {
-    Emit(SF(rn) | FPType(fd) | UCVTF_fixed | FPScale(64 - fbits) | Rn(rn) |
-         Rd(fd));
-  }
-}
-
-void Assembler::NEON3Same(const VRegister& vd, const VRegister& vn,
-                          const VRegister& vm, NEON3SameOp vop) {
-  DCHECK(AreSameFormat(vd, vn, vm));
-  DCHECK(vd.IsVector() || !vd.IsQ());
-
-  Instr format, op = vop;
-  if (vd.IsScalar()) {
-    op |= NEON_Q | NEONScalar;
-    format = SFormat(vd);
-  } else {
-    format = VFormat(vd);
-  }
-
-  Emit(format | op | Rm(vm) | Rn(vn) | Rd(vd));
-}
-
-void Assembler::NEONFP3Same(const VRegister& vd, const VRegister& vn,
-                            const VRegister& vm, Instr op) {
-  DCHECK(AreSameFormat(vd, vn, vm));
-  Emit(FPFormat(vd) | op | Rm(vm) | Rn(vn) | Rd(vd));
-}
-
-#define NEON_FP2REGMISC_LIST(V)                 \
-  V(fabs, NEON_FABS, FABS)                      \
-  V(fneg, NEON_FNEG, FNEG)                      \
-  V(fsqrt, NEON_FSQRT, FSQRT)                   \
-  V(frintn, NEON_FRINTN, FRINTN)                \
-  V(frinta, NEON_FRINTA, FRINTA)                \
-  V(frintp, NEON_FRINTP, FRINTP)                \
-  V(frintm, NEON_FRINTM, FRINTM)                \
-  V(frintx, NEON_FRINTX, FRINTX)                \
-  V(frintz, NEON_FRINTZ, FRINTZ)                \
-  V(frinti, NEON_FRINTI, FRINTI)                \
-  V(frsqrte, NEON_FRSQRTE, NEON_FRSQRTE_scalar) \
-  V(frecpe, NEON_FRECPE, NEON_FRECPE_scalar)
-
-#define DEFINE_ASM_FUNC(FN, VEC_OP, SCA_OP)                      \
-  void Assembler::FN(const VRegister& vd, const VRegister& vn) { \
-    Instr op;                                                    \
-    if (vd.IsScalar()) {                                         \
-      DCHECK(vd.Is1S() || vd.Is1D());                            \
-      op = SCA_OP;                                               \
-    } else {                                                     \
-      DCHECK(vd.Is2S() || vd.Is2D() || vd.Is4S());               \
-      op = VEC_OP;                                               \
-    }                                                            \
-    NEONFP2RegMisc(vd, vn, op);                                  \
-  }
-NEON_FP2REGMISC_LIST(DEFINE_ASM_FUNC)
-#undef DEFINE_ASM_FUNC
-
-void Assembler::shll(const VRegister& vd, const VRegister& vn, int shift) {
-  DCHECK((vd.Is8H() && vn.Is8B() && shift == 8) ||
-         (vd.Is4S() && vn.Is4H() && shift == 16) ||
-         (vd.Is2D() && vn.Is2S() && shift == 32));
-  USE(shift);
-  Emit(VFormat(vn) | NEON_SHLL | Rn(vn) | Rd(vd));
-}
-
-void Assembler::shll2(const VRegister& vd, const VRegister& vn, int shift) {
-  USE(shift);
-  DCHECK((vd.Is8H() && vn.Is16B() && shift == 8) ||
-         (vd.Is4S() && vn.Is8H() && shift == 16) ||
-         (vd.Is2D() && vn.Is4S() && shift == 32));
-  Emit(VFormat(vn) | NEON_SHLL | Rn(vn) | Rd(vd));
-}
-
-void Assembler::NEONFP2RegMisc(const VRegister& vd, const VRegister& vn,
-                               NEON2RegMiscOp vop, double value) {
-  DCHECK(AreSameFormat(vd, vn));
-  DCHECK_EQ(value, 0.0);
-  USE(value);
-
-  Instr op = vop;
-  if (vd.IsScalar()) {
-    DCHECK(vd.Is1S() || vd.Is1D());
-    op |= NEON_Q | NEONScalar;
-  } else {
-    DCHECK(vd.Is2S() || vd.Is2D() || vd.Is4S());
-  }
-
-  Emit(FPFormat(vd) | op | Rn(vn) | Rd(vd));
-}
-
-void Assembler::fcmeq(const VRegister& vd, const VRegister& vn, double value) {
-  NEONFP2RegMisc(vd, vn, NEON_FCMEQ_zero, value);
-}
-
-void Assembler::fcmge(const VRegister& vd, const VRegister& vn, double value) {
-  NEONFP2RegMisc(vd, vn, NEON_FCMGE_zero, value);
-}
-
-void Assembler::fcmgt(const VRegister& vd, const VRegister& vn, double value) {
-  NEONFP2RegMisc(vd, vn, NEON_FCMGT_zero, value);
-}
-
-void Assembler::fcmle(const VRegister& vd, const VRegister& vn, double value) {
-  NEONFP2RegMisc(vd, vn, NEON_FCMLE_zero, value);
-}
-
-void Assembler::fcmlt(const VRegister& vd, const VRegister& vn, double value) {
-  NEONFP2RegMisc(vd, vn, NEON_FCMLT_zero, value);
-}
-
-void Assembler::frecpx(const VRegister& vd, const VRegister& vn) {
-  DCHECK(vd.IsScalar());
-  DCHECK(AreSameFormat(vd, vn));
-  DCHECK(vd.Is1S() || vd.Is1D());
-  Emit(FPFormat(vd) | NEON_FRECPX_scalar | Rn(vn) | Rd(vd));
-}
-
-void Assembler::fcvtzs(const Register& rd, const VRegister& vn, int fbits) {
-  DCHECK(vn.Is1S() || vn.Is1D());
-  DCHECK((fbits >= 0) && (fbits <= rd.SizeInBits()));
-  if (fbits == 0) {
-    Emit(SF(rd) | FPType(vn) | FCVTZS | Rn(vn) | Rd(rd));
-  } else {
-    Emit(SF(rd) | FPType(vn) | FCVTZS_fixed | FPScale(64 - fbits) | Rn(vn) |
-         Rd(rd));
-  }
-}
-
-void Assembler::fcvtzs(const VRegister& vd, const VRegister& vn, int fbits) {
-  DCHECK_GE(fbits, 0);
-  if (fbits == 0) {
-    NEONFP2RegMisc(vd, vn, NEON_FCVTZS);
-  } else {
-    DCHECK(vd.Is1D() || vd.Is1S() || vd.Is2D() || vd.Is2S() || vd.Is4S());
-    NEONShiftRightImmediate(vd, vn, fbits, NEON_FCVTZS_imm);
-  }
-}
-
-void Assembler::fcvtzu(const Register& rd, const VRegister& vn, int fbits) {
-  DCHECK(vn.Is1S() || vn.Is1D());
-  DCHECK((fbits >= 0) && (fbits <= rd.SizeInBits()));
-  if (fbits == 0) {
-    Emit(SF(rd) | FPType(vn) | FCVTZU | Rn(vn) | Rd(rd));
-  } else {
-    Emit(SF(rd) | FPType(vn) | FCVTZU_fixed | FPScale(64 - fbits) | Rn(vn) |
-         Rd(rd));
-  }
-}
-
-void Assembler::fcvtzu(const VRegister& vd, const VRegister& vn, int fbits) {
-  DCHECK_GE(fbits, 0);
-  if (fbits == 0) {
-    NEONFP2RegMisc(vd, vn, NEON_FCVTZU);
-  } else {
-    DCHECK(vd.Is1D() || vd.Is1S() || vd.Is2D() || vd.Is2S() || vd.Is4S());
-    NEONShiftRightImmediate(vd, vn, fbits, NEON_FCVTZU_imm);
-  }
-}
-
-void Assembler::NEONFP2RegMisc(const VRegister& vd, const VRegister& vn,
-                               Instr op) {
-  DCHECK(AreSameFormat(vd, vn));
-  Emit(FPFormat(vd) | op | Rn(vn) | Rd(vd));
-}
-
-void Assembler::NEON2RegMisc(const VRegister& vd, const VRegister& vn,
-                             NEON2RegMiscOp vop, int value) {
-  DCHECK(AreSameFormat(vd, vn));
-  DCHECK_EQ(value, 0);
-  USE(value);
-
-  Instr format, op = vop;
-  if (vd.IsScalar()) {
-    op |= NEON_Q | NEONScalar;
-    format = SFormat(vd);
-  } else {
-    format = VFormat(vd);
-  }
-
-  Emit(format | op | Rn(vn) | Rd(vd));
-}
-
-void Assembler::cmeq(const VRegister& vd, const VRegister& vn, int value) {
-  DCHECK(vd.IsVector() || vd.Is1D());
-  NEON2RegMisc(vd, vn, NEON_CMEQ_zero, value);
-}
-
-void Assembler::cmge(const VRegister& vd, const VRegister& vn, int value) {
-  DCHECK(vd.IsVector() || vd.Is1D());
-  NEON2RegMisc(vd, vn, NEON_CMGE_zero, value);
-}
-
-void Assembler::cmgt(const VRegister& vd, const VRegister& vn, int value) {
-  DCHECK(vd.IsVector() || vd.Is1D());
-  NEON2RegMisc(vd, vn, NEON_CMGT_zero, value);
-}
-
-void Assembler::cmle(const VRegister& vd, const VRegister& vn, int value) {
-  DCHECK(vd.IsVector() || vd.Is1D());
-  NEON2RegMisc(vd, vn, NEON_CMLE_zero, value);
-}
-
-void Assembler::cmlt(const VRegister& vd, const VRegister& vn, int value) {
-  DCHECK(vd.IsVector() || vd.Is1D());
-  NEON2RegMisc(vd, vn, NEON_CMLT_zero, value);
-}
-
-#define NEON_3SAME_LIST(V)                                         \
-  V(add, NEON_ADD, vd.IsVector() || vd.Is1D())                     \
-  V(addp, NEON_ADDP, vd.IsVector() || vd.Is1D())                   \
-  V(sub, NEON_SUB, vd.IsVector() || vd.Is1D())                     \
-  V(cmeq, NEON_CMEQ, vd.IsVector() || vd.Is1D())                   \
-  V(cmge, NEON_CMGE, vd.IsVector() || vd.Is1D())                   \
-  V(cmgt, NEON_CMGT, vd.IsVector() || vd.Is1D())                   \
-  V(cmhi, NEON_CMHI, vd.IsVector() || vd.Is1D())                   \
-  V(cmhs, NEON_CMHS, vd.IsVector() || vd.Is1D())                   \
-  V(cmtst, NEON_CMTST, vd.IsVector() || vd.Is1D())                 \
-  V(sshl, NEON_SSHL, vd.IsVector() || vd.Is1D())                   \
-  V(ushl, NEON_USHL, vd.IsVector() || vd.Is1D())                   \
-  V(srshl, NEON_SRSHL, vd.IsVector() || vd.Is1D())                 \
-  V(urshl, NEON_URSHL, vd.IsVector() || vd.Is1D())                 \
-  V(sqdmulh, NEON_SQDMULH, vd.IsLaneSizeH() || vd.IsLaneSizeS())   \
-  V(sqrdmulh, NEON_SQRDMULH, vd.IsLaneSizeH() || vd.IsLaneSizeS()) \
-  V(shadd, NEON_SHADD, vd.IsVector() && !vd.IsLaneSizeD())         \
-  V(uhadd, NEON_UHADD, vd.IsVector() && !vd.IsLaneSizeD())         \
-  V(srhadd, NEON_SRHADD, vd.IsVector() && !vd.IsLaneSizeD())       \
-  V(urhadd, NEON_URHADD, vd.IsVector() && !vd.IsLaneSizeD())       \
-  V(shsub, NEON_SHSUB, vd.IsVector() && !vd.IsLaneSizeD())         \
-  V(uhsub, NEON_UHSUB, vd.IsVector() && !vd.IsLaneSizeD())         \
-  V(smax, NEON_SMAX, vd.IsVector() && !vd.IsLaneSizeD())           \
-  V(smaxp, NEON_SMAXP, vd.IsVector() && !vd.IsLaneSizeD())         \
-  V(smin, NEON_SMIN, vd.IsVector() && !vd.IsLaneSizeD())           \
-  V(sminp, NEON_SMINP, vd.IsVector() && !vd.IsLaneSizeD())         \
-  V(umax, NEON_UMAX, vd.IsVector() && !vd.IsLaneSizeD())           \
-  V(umaxp, NEON_UMAXP, vd.IsVector() && !vd.IsLaneSizeD())         \
-  V(umin, NEON_UMIN, vd.IsVector() && !vd.IsLaneSizeD())           \
-  V(uminp, NEON_UMINP, vd.IsVector() && !vd.IsLaneSizeD())         \
-  V(saba, NEON_SABA, vd.IsVector() && !vd.IsLaneSizeD())           \
-  V(sabd, NEON_SABD, vd.IsVector() && !vd.IsLaneSizeD())           \
-  V(uaba, NEON_UABA, vd.IsVector() && !vd.IsLaneSizeD())           \
-  V(uabd, NEON_UABD, vd.IsVector() && !vd.IsLaneSizeD())           \
-  V(mla, NEON_MLA, vd.IsVector() && !vd.IsLaneSizeD())             \
-  V(mls, NEON_MLS, vd.IsVector() && !vd.IsLaneSizeD())             \
-  V(mul, NEON_MUL, vd.IsVector() && !vd.IsLaneSizeD())             \
-  V(and_, NEON_AND, vd.Is8B() || vd.Is16B())                       \
-  V(orr, NEON_ORR, vd.Is8B() || vd.Is16B())                        \
-  V(orn, NEON_ORN, vd.Is8B() || vd.Is16B())                        \
-  V(eor, NEON_EOR, vd.Is8B() || vd.Is16B())                        \
-  V(bic, NEON_BIC, vd.Is8B() || vd.Is16B())                        \
-  V(bit, NEON_BIT, vd.Is8B() || vd.Is16B())                        \
-  V(bif, NEON_BIF, vd.Is8B() || vd.Is16B())                        \
-  V(bsl, NEON_BSL, vd.Is8B() || vd.Is16B())                        \
-  V(pmul, NEON_PMUL, vd.Is8B() || vd.Is16B())                      \
-  V(uqadd, NEON_UQADD, true)                                       \
-  V(sqadd, NEON_SQADD, true)                                       \
-  V(uqsub, NEON_UQSUB, true)                                       \
-  V(sqsub, NEON_SQSUB, true)                                       \
-  V(sqshl, NEON_SQSHL, true)                                       \
-  V(uqshl, NEON_UQSHL, true)                                       \
-  V(sqrshl, NEON_SQRSHL, true)                                     \
-  V(uqrshl, NEON_UQRSHL, true)
-
-#define DEFINE_ASM_FUNC(FN, OP, AS)                            \
-  void Assembler::FN(const VRegister& vd, const VRegister& vn, \
-                     const VRegister& vm) {                    \
-    DCHECK(AS);                                                \
-    NEON3Same(vd, vn, vm, OP);                                 \
-  }
-NEON_3SAME_LIST(DEFINE_ASM_FUNC)
-#undef DEFINE_ASM_FUNC
-
-#define NEON_FP3SAME_LIST_V2(V)                 \
-  V(fadd, NEON_FADD, FADD)                      \
-  V(fsub, NEON_FSUB, FSUB)                      \
-  V(fmul, NEON_FMUL, FMUL)                      \
-  V(fdiv, NEON_FDIV, FDIV)                      \
-  V(fmax, NEON_FMAX, FMAX)                      \
-  V(fmaxnm, NEON_FMAXNM, FMAXNM)                \
-  V(fmin, NEON_FMIN, FMIN)                      \
-  V(fminnm, NEON_FMINNM, FMINNM)                \
-  V(fmulx, NEON_FMULX, NEON_FMULX_scalar)       \
-  V(frecps, NEON_FRECPS, NEON_FRECPS_scalar)    \
-  V(frsqrts, NEON_FRSQRTS, NEON_FRSQRTS_scalar) \
-  V(fabd, NEON_FABD, NEON_FABD_scalar)          \
-  V(fmla, NEON_FMLA, 0)                         \
-  V(fmls, NEON_FMLS, 0)                         \
-  V(facge, NEON_FACGE, NEON_FACGE_scalar)       \
-  V(facgt, NEON_FACGT, NEON_FACGT_scalar)       \
-  V(fcmeq, NEON_FCMEQ, NEON_FCMEQ_scalar)       \
-  V(fcmge, NEON_FCMGE, NEON_FCMGE_scalar)       \
-  V(fcmgt, NEON_FCMGT, NEON_FCMGT_scalar)       \
-  V(faddp, NEON_FADDP, 0)                       \
-  V(fmaxp, NEON_FMAXP, 0)                       \
-  V(fminp, NEON_FMINP, 0)                       \
-  V(fmaxnmp, NEON_FMAXNMP, 0)                   \
-  V(fminnmp, NEON_FMINNMP, 0)
-
-#define DEFINE_ASM_FUNC(FN, VEC_OP, SCA_OP)                    \
-  void Assembler::FN(const VRegister& vd, const VRegister& vn, \
-                     const VRegister& vm) {                    \
-    Instr op;                                                  \
-    if ((SCA_OP != 0) && vd.IsScalar()) {                      \
-      DCHECK(vd.Is1S() || vd.Is1D());                          \
-      op = SCA_OP;                                             \
-    } else {                                                   \
-      DCHECK(vd.IsVector());                                   \
-      DCHECK(vd.Is2S() || vd.Is2D() || vd.Is4S());             \
-      op = VEC_OP;                                             \
-    }                                                          \
-    NEONFP3Same(vd, vn, vm, op);                               \
-  }
-NEON_FP3SAME_LIST_V2(DEFINE_ASM_FUNC)
-#undef DEFINE_ASM_FUNC
-
-void Assembler::addp(const VRegister& vd, const VRegister& vn) {
-  DCHECK((vd.Is1D() && vn.Is2D()));
-  Emit(SFormat(vd) | NEON_ADDP_scalar | Rn(vn) | Rd(vd));
-}
-
-void Assembler::faddp(const VRegister& vd, const VRegister& vn) {
-  DCHECK((vd.Is1S() && vn.Is2S()) || (vd.Is1D() && vn.Is2D()));
-  Emit(FPFormat(vd) | NEON_FADDP_scalar | Rn(vn) | Rd(vd));
-}
-
-void Assembler::fmaxp(const VRegister& vd, const VRegister& vn) {
-  DCHECK((vd.Is1S() && vn.Is2S()) || (vd.Is1D() && vn.Is2D()));
-  Emit(FPFormat(vd) | NEON_FMAXP_scalar | Rn(vn) | Rd(vd));
-}
-
-void Assembler::fminp(const VRegister& vd, const VRegister& vn) {
-  DCHECK((vd.Is1S() && vn.Is2S()) || (vd.Is1D() && vn.Is2D()));
-  Emit(FPFormat(vd) | NEON_FMINP_scalar | Rn(vn) | Rd(vd));
-}
-
-void Assembler::fmaxnmp(const VRegister& vd, const VRegister& vn) {
-  DCHECK((vd.Is1S() && vn.Is2S()) || (vd.Is1D() && vn.Is2D()));
-  Emit(FPFormat(vd) | NEON_FMAXNMP_scalar | Rn(vn) | Rd(vd));
-}
-
-void Assembler::fminnmp(const VRegister& vd, const VRegister& vn) {
-  DCHECK((vd.Is1S() && vn.Is2S()) || (vd.Is1D() && vn.Is2D()));
-  Emit(FPFormat(vd) | NEON_FMINNMP_scalar | Rn(vn) | Rd(vd));
-}
-
-void Assembler::orr(const VRegister& vd, const int imm8, const int left_shift) {
-  NEONModifiedImmShiftLsl(vd, imm8, left_shift, NEONModifiedImmediate_ORR);
-}
-
-void Assembler::mov(const VRegister& vd, const VRegister& vn) {
-  DCHECK(AreSameFormat(vd, vn));
-  if (vd.IsD()) {
-    orr(vd.V8B(), vn.V8B(), vn.V8B());
-  } else {
-    DCHECK(vd.IsQ());
-    orr(vd.V16B(), vn.V16B(), vn.V16B());
-  }
-}
-
-void Assembler::bic(const VRegister& vd, const int imm8, const int left_shift) {
-  NEONModifiedImmShiftLsl(vd, imm8, left_shift, NEONModifiedImmediate_BIC);
-}
-
-void Assembler::movi(const VRegister& vd, const uint64_t imm, Shift shift,
-                     const int shift_amount) {
-  DCHECK((shift == LSL) || (shift == MSL));
-  if (vd.Is2D() || vd.Is1D()) {
-    DCHECK_EQ(shift_amount, 0);
-    int imm8 = 0;
-    for (int i = 0; i < 8; ++i) {
-      int byte = (imm >> (i * 8)) & 0xFF;
-      DCHECK((byte == 0) || (byte == 0xFF));
-      if (byte == 0xFF) {
-        imm8 |= (1 << i);
-      }
-    }
-    Instr q = vd.Is2D() ? NEON_Q : 0;
-    Emit(q | NEONModImmOp(1) | NEONModifiedImmediate_MOVI |
-         ImmNEONabcdefgh(imm8) | NEONCmode(0xE) | Rd(vd));
-  } else if (shift == LSL) {
-    NEONModifiedImmShiftLsl(vd, static_cast<int>(imm), shift_amount,
-                            NEONModifiedImmediate_MOVI);
-  } else {
-    NEONModifiedImmShiftMsl(vd, static_cast<int>(imm), shift_amount,
-                            NEONModifiedImmediate_MOVI);
-  }
-}
-
-void Assembler::mvn(const VRegister& vd, const VRegister& vn) {
-  DCHECK(AreSameFormat(vd, vn));
-  if (vd.IsD()) {
-    not_(vd.V8B(), vn.V8B());
-  } else {
-    DCHECK(vd.IsQ());
-    not_(vd.V16B(), vn.V16B());
-  }
-}
-
-void Assembler::mvni(const VRegister& vd, const int imm8, Shift shift,
-                     const int shift_amount) {
-  DCHECK((shift == LSL) || (shift == MSL));
-  if (shift == LSL) {
-    NEONModifiedImmShiftLsl(vd, imm8, shift_amount, NEONModifiedImmediate_MVNI);
-  } else {
-    NEONModifiedImmShiftMsl(vd, imm8, shift_amount, NEONModifiedImmediate_MVNI);
-  }
-}
-
-void Assembler::NEONFPByElement(const VRegister& vd, const VRegister& vn,
-                                const VRegister& vm, int vm_index,
-                                NEONByIndexedElementOp vop) {
-  DCHECK(AreSameFormat(vd, vn));
-  DCHECK((vd.Is2S() && vm.Is1S()) || (vd.Is4S() && vm.Is1S()) ||
-         (vd.Is1S() && vm.Is1S()) || (vd.Is2D() && vm.Is1D()) ||
-         (vd.Is1D() && vm.Is1D()));
-  DCHECK((vm.Is1S() && (vm_index < 4)) || (vm.Is1D() && (vm_index < 2)));
-
-  Instr op = vop;
-  int index_num_bits = vm.Is1S() ? 2 : 1;
-  if (vd.IsScalar()) {
-    op |= NEON_Q | NEONScalar;
-  }
-
-  Emit(FPFormat(vd) | op | ImmNEONHLM(vm_index, index_num_bits) | Rm(vm) |
-       Rn(vn) | Rd(vd));
-}
-
-void Assembler::NEONByElement(const VRegister& vd, const VRegister& vn,
-                              const VRegister& vm, int vm_index,
-                              NEONByIndexedElementOp vop) {
-  DCHECK(AreSameFormat(vd, vn));
-  DCHECK((vd.Is4H() && vm.Is1H()) || (vd.Is8H() && vm.Is1H()) ||
-         (vd.Is1H() && vm.Is1H()) || (vd.Is2S() && vm.Is1S()) ||
-         (vd.Is4S() && vm.Is1S()) || (vd.Is1S() && vm.Is1S()));
-  DCHECK((vm.Is1H() && (vm.code() < 16) && (vm_index < 8)) ||
-         (vm.Is1S() && (vm_index < 4)));
-
-  Instr format, op = vop;
-  int index_num_bits = vm.Is1H() ? 3 : 2;
-  if (vd.IsScalar()) {
-    op |= NEONScalar | NEON_Q;
-    format = SFormat(vn);
-  } else {
-    format = VFormat(vn);
-  }
-  Emit(format | op | ImmNEONHLM(vm_index, index_num_bits) | Rm(vm) | Rn(vn) |
-       Rd(vd));
-}
-
-void Assembler::NEONByElementL(const VRegister& vd, const VRegister& vn,
-                               const VRegister& vm, int vm_index,
-                               NEONByIndexedElementOp vop) {
-  DCHECK((vd.Is4S() && vn.Is4H() && vm.Is1H()) ||
-         (vd.Is4S() && vn.Is8H() && vm.Is1H()) ||
-         (vd.Is1S() && vn.Is1H() && vm.Is1H()) ||
-         (vd.Is2D() && vn.Is2S() && vm.Is1S()) ||
-         (vd.Is2D() && vn.Is4S() && vm.Is1S()) ||
-         (vd.Is1D() && vn.Is1S() && vm.Is1S()));
-
-  DCHECK((vm.Is1H() && (vm.code() < 16) && (vm_index < 8)) ||
-         (vm.Is1S() && (vm_index < 4)));
-
-  Instr format, op = vop;
-  int index_num_bits = vm.Is1H() ? 3 : 2;
-  if (vd.IsScalar()) {
-    op |= NEONScalar | NEON_Q;
-    format = SFormat(vn);
-  } else {
-    format = VFormat(vn);
-  }
-  Emit(format | op | ImmNEONHLM(vm_index, index_num_bits) | Rm(vm) | Rn(vn) |
-       Rd(vd));
-}
-
-#define NEON_BYELEMENT_LIST(V)              \
-  V(mul, NEON_MUL_byelement, vn.IsVector()) \
-  V(mla, NEON_MLA_byelement, vn.IsVector()) \
-  V(mls, NEON_MLS_byelement, vn.IsVector()) \
-  V(sqdmulh, NEON_SQDMULH_byelement, true)  \
-  V(sqrdmulh, NEON_SQRDMULH_byelement, true)
-
-#define DEFINE_ASM_FUNC(FN, OP, AS)                            \
-  void Assembler::FN(const VRegister& vd, const VRegister& vn, \
-                     const VRegister& vm, int vm_index) {      \
-    DCHECK(AS);                                                \
-    NEONByElement(vd, vn, vm, vm_index, OP);                   \
-  }
-NEON_BYELEMENT_LIST(DEFINE_ASM_FUNC)
-#undef DEFINE_ASM_FUNC
-
-#define NEON_FPBYELEMENT_LIST(V) \
-  V(fmul, NEON_FMUL_byelement)   \
-  V(fmla, NEON_FMLA_byelement)   \
-  V(fmls, NEON_FMLS_byelement)   \
-  V(fmulx, NEON_FMULX_byelement)
-
-#define DEFINE_ASM_FUNC(FN, OP)                                \
-  void Assembler::FN(const VRegister& vd, const VRegister& vn, \
-                     const VRegister& vm, int vm_index) {      \
-    NEONFPByElement(vd, vn, vm, vm_index, OP);                 \
-  }
-NEON_FPBYELEMENT_LIST(DEFINE_ASM_FUNC)
-#undef DEFINE_ASM_FUNC
-
-#define NEON_BYELEMENT_LONG_LIST(V)                              \
-  V(sqdmull, NEON_SQDMULL_byelement, vn.IsScalar() || vn.IsD())  \
-  V(sqdmull2, NEON_SQDMULL_byelement, vn.IsVector() && vn.IsQ()) \
-  V(sqdmlal, NEON_SQDMLAL_byelement, vn.IsScalar() || vn.IsD())  \
-  V(sqdmlal2, NEON_SQDMLAL_byelement, vn.IsVector() && vn.IsQ()) \
-  V(sqdmlsl, NEON_SQDMLSL_byelement, vn.IsScalar() || vn.IsD())  \
-  V(sqdmlsl2, NEON_SQDMLSL_byelement, vn.IsVector() && vn.IsQ()) \
-  V(smull, NEON_SMULL_byelement, vn.IsVector() && vn.IsD())      \
-  V(smull2, NEON_SMULL_byelement, vn.IsVector() && vn.IsQ())     \
-  V(umull, NEON_UMULL_byelement, vn.IsVector() && vn.IsD())      \
-  V(umull2, NEON_UMULL_byelement, vn.IsVector() && vn.IsQ())     \
-  V(smlal, NEON_SMLAL_byelement, vn.IsVector() && vn.IsD())      \
-  V(smlal2, NEON_SMLAL_byelement, vn.IsVector() && vn.IsQ())     \
-  V(umlal, NEON_UMLAL_byelement, vn.IsVector() && vn.IsD())      \
-  V(umlal2, NEON_UMLAL_byelement, vn.IsVector() && vn.IsQ())     \
-  V(smlsl, NEON_SMLSL_byelement, vn.IsVector() && vn.IsD())      \
-  V(smlsl2, NEON_SMLSL_byelement, vn.IsVector() && vn.IsQ())     \
-  V(umlsl, NEON_UMLSL_byelement, vn.IsVector() && vn.IsD())      \
-  V(umlsl2, NEON_UMLSL_byelement, vn.IsVector() && vn.IsQ())
-
-#define DEFINE_ASM_FUNC(FN, OP, AS)                            \
-  void Assembler::FN(const VRegister& vd, const VRegister& vn, \
-                     const VRegister& vm, int vm_index) {      \
-    DCHECK(AS);                                                \
-    NEONByElementL(vd, vn, vm, vm_index, OP);                  \
-  }
-NEON_BYELEMENT_LONG_LIST(DEFINE_ASM_FUNC)
-#undef DEFINE_ASM_FUNC
-
-void Assembler::suqadd(const VRegister& vd, const VRegister& vn) {
-  NEON2RegMisc(vd, vn, NEON_SUQADD);
-}
-
-void Assembler::usqadd(const VRegister& vd, const VRegister& vn) {
-  NEON2RegMisc(vd, vn, NEON_USQADD);
-}
-
-void Assembler::abs(const VRegister& vd, const VRegister& vn) {
-  DCHECK(vd.IsVector() || vd.Is1D());
-  NEON2RegMisc(vd, vn, NEON_ABS);
-}
-
-void Assembler::sqabs(const VRegister& vd, const VRegister& vn) {
-  NEON2RegMisc(vd, vn, NEON_SQABS);
-}
-
-void Assembler::neg(const VRegister& vd, const VRegister& vn) {
-  DCHECK(vd.IsVector() || vd.Is1D());
-  NEON2RegMisc(vd, vn, NEON_NEG);
-}
-
-void Assembler::sqneg(const VRegister& vd, const VRegister& vn) {
-  NEON2RegMisc(vd, vn, NEON_SQNEG);
-}
-
-void Assembler::NEONXtn(const VRegister& vd, const VRegister& vn,
-                        NEON2RegMiscOp vop) {
-  Instr format, op = vop;
-  if (vd.IsScalar()) {
-    DCHECK((vd.Is1B() && vn.Is1H()) || (vd.Is1H() && vn.Is1S()) ||
-           (vd.Is1S() && vn.Is1D()));
-    op |= NEON_Q | NEONScalar;
-    format = SFormat(vd);
-  } else {
-    DCHECK((vd.Is8B() && vn.Is8H()) || (vd.Is4H() && vn.Is4S()) ||
-           (vd.Is2S() && vn.Is2D()) || (vd.Is16B() && vn.Is8H()) ||
-           (vd.Is8H() && vn.Is4S()) || (vd.Is4S() && vn.Is2D()));
-    format = VFormat(vd);
-  }
-  Emit(format | op | Rn(vn) | Rd(vd));
-}
-
-void Assembler::xtn(const VRegister& vd, const VRegister& vn) {
-  DCHECK(vd.IsVector() && vd.IsD());
-  NEONXtn(vd, vn, NEON_XTN);
-}
-
-void Assembler::xtn2(const VRegister& vd, const VRegister& vn) {
-  DCHECK(vd.IsVector() && vd.IsQ());
-  NEONXtn(vd, vn, NEON_XTN);
-}
-
-void Assembler::sqxtn(const VRegister& vd, const VRegister& vn) {
-  DCHECK(vd.IsScalar() || vd.IsD());
-  NEONXtn(vd, vn, NEON_SQXTN);
-}
-
-void Assembler::sqxtn2(const VRegister& vd, const VRegister& vn) {
-  DCHECK(vd.IsVector() && vd.IsQ());
-  NEONXtn(vd, vn, NEON_SQXTN);
-}
-
-void Assembler::sqxtun(const VRegister& vd, const VRegister& vn) {
-  DCHECK(vd.IsScalar() || vd.IsD());
-  NEONXtn(vd, vn, NEON_SQXTUN);
-}
-
-void Assembler::sqxtun2(const VRegister& vd, const VRegister& vn) {
-  DCHECK(vd.IsVector() && vd.IsQ());
-  NEONXtn(vd, vn, NEON_SQXTUN);
-}
-
-void Assembler::uqxtn(const VRegister& vd, const VRegister& vn) {
-  DCHECK(vd.IsScalar() || vd.IsD());
-  NEONXtn(vd, vn, NEON_UQXTN);
-}
-
-void Assembler::uqxtn2(const VRegister& vd, const VRegister& vn) {
-  DCHECK(vd.IsVector() && vd.IsQ());
-  NEONXtn(vd, vn, NEON_UQXTN);
-}
-
-// NEON NOT and RBIT are distinguised by bit 22, the bottom bit of "size".
-void Assembler::not_(const VRegister& vd, const VRegister& vn) {
-  DCHECK(AreSameFormat(vd, vn));
-  DCHECK(vd.Is8B() || vd.Is16B());
-  Emit(VFormat(vd) | NEON_RBIT_NOT | Rn(vn) | Rd(vd));
-}
-
-void Assembler::rbit(const VRegister& vd, const VRegister& vn) {
-  DCHECK(AreSameFormat(vd, vn));
-  DCHECK(vd.Is8B() || vd.Is16B());
-  Emit(VFormat(vn) | (1 << NEONSize_offset) | NEON_RBIT_NOT | Rn(vn) | Rd(vd));
-}
-
-void Assembler::ext(const VRegister& vd, const VRegister& vn,
-                    const VRegister& vm, int index) {
-  DCHECK(AreSameFormat(vd, vn, vm));
-  DCHECK(vd.Is8B() || vd.Is16B());
-  DCHECK((0 <= index) && (index < vd.LaneCount()));
-  Emit(VFormat(vd) | NEON_EXT | Rm(vm) | ImmNEONExt(index) | Rn(vn) | Rd(vd));
-}
-
-void Assembler::dup(const VRegister& vd, const VRegister& vn, int vn_index) {
-  Instr q, scalar;
-
-  // We support vn arguments of the form vn.VxT() or vn.T(), where x is the
-  // number of lanes, and T is b, h, s or d.
-  int lane_size = vn.LaneSizeInBytes();
-  NEONFormatField format;
-  switch (lane_size) {
-    case 1:
-      format = NEON_16B;
-      break;
-    case 2:
-      format = NEON_8H;
-      break;
-    case 4:
-      format = NEON_4S;
-      break;
-    default:
-      DCHECK_EQ(lane_size, 8);
-      format = NEON_2D;
-      break;
-  }
-
-  if (vd.IsScalar()) {
-    q = NEON_Q;
-    scalar = NEONScalar;
-  } else {
-    DCHECK(!vd.Is1D());
-    q = vd.IsD() ? 0 : NEON_Q;
-    scalar = 0;
-  }
-  Emit(q | scalar | NEON_DUP_ELEMENT | ImmNEON5(format, vn_index) | Rn(vn) |
-       Rd(vd));
-}
-
-void Assembler::dcptr(Label* label) {
-  RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE);
-  if (label->is_bound()) {
-    // The label is bound, so it does not need to be updated and the internal
-    // reference should be emitted.
-    //
-    // In this case, label->pos() returns the offset of the label from the
-    // start of the buffer.
-    internal_reference_positions_.push_back(pc_offset());
-    dc64(reinterpret_cast<uintptr_t>(buffer_ + label->pos()));
-  } else {
-    int32_t offset;
-    if (label->is_linked()) {
-      // The label is linked, so the internal reference should be added
-      // onto the end of the label's link chain.
-      //
-      // In this case, label->pos() returns the offset of the last linked
-      // instruction from the start of the buffer.
-      offset = label->pos() - pc_offset();
-      DCHECK_NE(offset, kStartOfLabelLinkChain);
-    } else {
-      // The label is unused, so it now becomes linked and the internal
-      // reference is at the start of the new link chain.
-      offset = kStartOfLabelLinkChain;
-    }
-    // The instruction at pc is now the last link in the label's chain.
-    label->link_to(pc_offset());
-
-    // Traditionally the offset to the previous instruction in the chain is
-    // encoded in the instruction payload (e.g. branch range) but internal
-    // references are not instructions so while unbound they are encoded as
-    // two consecutive brk instructions. The two 16-bit immediates are used
-    // to encode the offset.
-    offset >>= kInstructionSizeLog2;
-    DCHECK(is_int32(offset));
-    uint32_t high16 = unsigned_bitextract_32(31, 16, offset);
-    uint32_t low16 = unsigned_bitextract_32(15, 0, offset);
-
-    brk(high16);
-    brk(low16);
-  }
-}
-
-// Below, a difference in case for the same letter indicates a
-// negated bit. If b is 1, then B is 0.
-uint32_t Assembler::FPToImm8(double imm) {
-  DCHECK(IsImmFP64(imm));
-  // bits: aBbb.bbbb.bbcd.efgh.0000.0000.0000.0000
-  //       0000.0000.0000.0000.0000.0000.0000.0000
-  uint64_t bits = bit_cast<uint64_t>(imm);
-  // bit7: a000.0000
-  uint64_t bit7 = ((bits >> 63) & 0x1) << 7;
-  // bit6: 0b00.0000
-  uint64_t bit6 = ((bits >> 61) & 0x1) << 6;
-  // bit5_to_0: 00cd.efgh
-  uint64_t bit5_to_0 = (bits >> 48) & 0x3F;
-
-  return static_cast<uint32_t>(bit7 | bit6 | bit5_to_0);
-}
-
-Instr Assembler::ImmFP(double imm) { return FPToImm8(imm) << ImmFP_offset; }
-Instr Assembler::ImmNEONFP(double imm) {
-  return ImmNEONabcdefgh(FPToImm8(imm));
-}
-
-// Code generation helpers.
-void Assembler::MoveWide(const Register& rd, uint64_t imm, int shift,
-                         MoveWideImmediateOp mov_op) {
-  // Ignore the top 32 bits of an immediate if we're moving to a W register.
-  if (rd.Is32Bits()) {
-    // Check that the top 32 bits are zero (a positive 32-bit number) or top
-    // 33 bits are one (a negative 32-bit number, sign extended to 64 bits).
-    DCHECK(((imm >> kWRegSizeInBits) == 0) ||
-           ((imm >> (kWRegSizeInBits - 1)) == 0x1FFFFFFFF));
-    imm &= kWRegMask;
-  }
-
-  if (shift >= 0) {
-    // Explicit shift specified.
-    DCHECK((shift == 0) || (shift == 16) || (shift == 32) || (shift == 48));
-    DCHECK(rd.Is64Bits() || (shift == 0) || (shift == 16));
-    shift /= 16;
-  } else {
-    // Calculate a new immediate and shift combination to encode the immediate
-    // argument.
-    shift = 0;
-    if ((imm & ~0xFFFFUL) == 0) {
-      // Nothing to do.
-    } else if ((imm & ~(0xFFFFUL << 16)) == 0) {
-      imm >>= 16;
-      shift = 1;
-    } else if ((imm & ~(0xFFFFUL << 32)) == 0) {
-      DCHECK(rd.Is64Bits());
-      imm >>= 32;
-      shift = 2;
-    } else if ((imm & ~(0xFFFFUL << 48)) == 0) {
-      DCHECK(rd.Is64Bits());
-      imm >>= 48;
-      shift = 3;
-    }
-  }
-
-  DCHECK(is_uint16(imm));
-
-  Emit(SF(rd) | MoveWideImmediateFixed | mov_op | Rd(rd) |
-       ImmMoveWide(static_cast<int>(imm)) | ShiftMoveWide(shift));
-}
-
-void Assembler::AddSub(const Register& rd, const Register& rn,
-                       const Operand& operand, FlagsUpdate S, AddSubOp op) {
-  DCHECK_EQ(rd.SizeInBits(), rn.SizeInBits());
-  DCHECK(!operand.NeedsRelocation(this));
-  if (operand.IsImmediate()) {
-    int64_t immediate = operand.ImmediateValue();
-    DCHECK(IsImmAddSub(immediate));
-    Instr dest_reg = (S == SetFlags) ? Rd(rd) : RdSP(rd);
-    Emit(SF(rd) | AddSubImmediateFixed | op | Flags(S) |
-         ImmAddSub(static_cast<int>(immediate)) | dest_reg | RnSP(rn));
-  } else if (operand.IsShiftedRegister()) {
-    DCHECK_EQ(operand.reg().SizeInBits(), rd.SizeInBits());
-    DCHECK_NE(operand.shift(), ROR);
-
-    // For instructions of the form:
-    //   add/sub   wsp, <Wn>, <Wm> [, LSL #0-3 ]
-    //   add/sub   <Wd>, wsp, <Wm> [, LSL #0-3 ]
-    //   add/sub   wsp, wsp, <Wm> [, LSL #0-3 ]
-    //   adds/subs <Wd>, wsp, <Wm> [, LSL #0-3 ]
-    // or their 64-bit register equivalents, convert the operand from shifted to
-    // extended register mode, and emit an add/sub extended instruction.
-    if (rn.IsSP() || rd.IsSP()) {
-      DCHECK(!(rd.IsSP() && (S == SetFlags)));
-      DataProcExtendedRegister(rd, rn, operand.ToExtendedRegister(), S,
-                               AddSubExtendedFixed | op);
-    } else {
-      DataProcShiftedRegister(rd, rn, operand, S, AddSubShiftedFixed | op);
-    }
-  } else {
-    DCHECK(operand.IsExtendedRegister());
-    DataProcExtendedRegister(rd, rn, operand, S, AddSubExtendedFixed | op);
-  }
-}
-
-void Assembler::AddSubWithCarry(const Register& rd, const Register& rn,
-                                const Operand& operand, FlagsUpdate S,
-                                AddSubWithCarryOp op) {
-  DCHECK_EQ(rd.SizeInBits(), rn.SizeInBits());
-  DCHECK_EQ(rd.SizeInBits(), operand.reg().SizeInBits());
-  DCHECK(operand.IsShiftedRegister() && (operand.shift_amount() == 0));
-  DCHECK(!operand.NeedsRelocation(this));
-  Emit(SF(rd) | op | Flags(S) | Rm(operand.reg()) | Rn(rn) | Rd(rd));
-}
-
-void Assembler::hlt(int code) {
-  DCHECK(is_uint16(code));
-  Emit(HLT | ImmException(code));
-}
-
-void Assembler::brk(int code) {
-  DCHECK(is_uint16(code));
-  Emit(BRK | ImmException(code));
-}
-
-void Assembler::EmitStringData(const char* string) {
-  size_t len = strlen(string) + 1;
-  DCHECK_LE(RoundUp(len, kInstructionSize), static_cast<size_t>(kGap));
-  EmitData(string, static_cast<int>(len));
-  // Pad with nullptr characters until pc_ is aligned.
-  const char pad[] = {'\0', '\0', '\0', '\0'};
-  static_assert(sizeof(pad) == kInstructionSize,
-                "Size of padding must match instruction size.");
-  EmitData(pad, RoundUp(pc_offset(), kInstructionSize) - pc_offset());
-}
-
-
-void Assembler::debug(const char* message, uint32_t code, Instr params) {
-#ifdef USE_SIMULATOR
-  // Don't generate simulator specific code if we are building a snapshot, which
-  // might be run on real hardware.
-  if (!serializer_enabled()) {
-    // The arguments to the debug marker need to be contiguous in memory, so
-    // make sure we don't try to emit pools.
-    BlockPoolsScope scope(this);
-
-    Label start;
-    bind(&start);
-
-    // Refer to instructions-arm64.h for a description of the marker and its
-    // arguments.
-    hlt(kImmExceptionIsDebug);
-    DCHECK_EQ(SizeOfCodeGeneratedSince(&start), kDebugCodeOffset);
-    dc32(code);
-    DCHECK_EQ(SizeOfCodeGeneratedSince(&start), kDebugParamsOffset);
-    dc32(params);
-    DCHECK_EQ(SizeOfCodeGeneratedSince(&start), kDebugMessageOffset);
-    EmitStringData(message);
-    hlt(kImmExceptionIsUnreachable);
-
-    return;
-  }
-  // Fall through if Serializer is enabled.
-#endif
-
-  if (params & BREAK) {
-    brk(0);
-  }
-}
-
-
-void Assembler::Logical(const Register& rd,
-                        const Register& rn,
-                        const Operand& operand,
-                        LogicalOp op) {
-  DCHECK(rd.SizeInBits() == rn.SizeInBits());
-  DCHECK(!operand.NeedsRelocation(this));
-  if (operand.IsImmediate()) {
-    int64_t immediate = operand.ImmediateValue();
-    unsigned reg_size = rd.SizeInBits();
-
-    DCHECK_NE(immediate, 0);
-    DCHECK_NE(immediate, -1);
-    DCHECK(rd.Is64Bits() || is_uint32(immediate));
-
-    // If the operation is NOT, invert the operation and immediate.
-    if ((op & NOT) == NOT) {
-      op = static_cast<LogicalOp>(op & ~NOT);
-      immediate = rd.Is64Bits() ? ~immediate : (~immediate & kWRegMask);
-    }
-
-    unsigned n, imm_s, imm_r;
-    if (IsImmLogical(immediate, reg_size, &n, &imm_s, &imm_r)) {
-      // Immediate can be encoded in the instruction.
-      LogicalImmediate(rd, rn, n, imm_s, imm_r, op);
-    } else {
-      // This case is handled in the macro assembler.
-      UNREACHABLE();
-    }
-  } else {
-    DCHECK(operand.IsShiftedRegister());
-    DCHECK(operand.reg().SizeInBits() == rd.SizeInBits());
-    Instr dp_op = static_cast<Instr>(op | LogicalShiftedFixed);
-    DataProcShiftedRegister(rd, rn, operand, LeaveFlags, dp_op);
-  }
-}
-
-
-void Assembler::LogicalImmediate(const Register& rd,
-                                 const Register& rn,
-                                 unsigned n,
-                                 unsigned imm_s,
-                                 unsigned imm_r,
-                                 LogicalOp op) {
-  unsigned reg_size = rd.SizeInBits();
-  Instr dest_reg = (op == ANDS) ? Rd(rd) : RdSP(rd);
-  Emit(SF(rd) | LogicalImmediateFixed | op | BitN(n, reg_size) |
-       ImmSetBits(imm_s, reg_size) | ImmRotate(imm_r, reg_size) | dest_reg |
-       Rn(rn));
-}
-
-
-void Assembler::ConditionalCompare(const Register& rn,
-                                   const Operand& operand,
-                                   StatusFlags nzcv,
-                                   Condition cond,
-                                   ConditionalCompareOp op) {
-  Instr ccmpop;
-  DCHECK(!operand.NeedsRelocation(this));
-  if (operand.IsImmediate()) {
-    int64_t immediate = operand.ImmediateValue();
-    DCHECK(IsImmConditionalCompare(immediate));
-    ccmpop = ConditionalCompareImmediateFixed | op |
-             ImmCondCmp(static_cast<unsigned>(immediate));
-  } else {
-    DCHECK(operand.IsShiftedRegister() && (operand.shift_amount() == 0));
-    ccmpop = ConditionalCompareRegisterFixed | op | Rm(operand.reg());
-  }
-  Emit(SF(rn) | ccmpop | Cond(cond) | Rn(rn) | Nzcv(nzcv));
-}
-
-
-void Assembler::DataProcessing1Source(const Register& rd,
-                                      const Register& rn,
-                                      DataProcessing1SourceOp op) {
-  DCHECK(rd.SizeInBits() == rn.SizeInBits());
-  Emit(SF(rn) | op | Rn(rn) | Rd(rd));
-}
-
-void Assembler::FPDataProcessing1Source(const VRegister& vd,
-                                        const VRegister& vn,
-                                        FPDataProcessing1SourceOp op) {
-  Emit(FPType(vn) | op | Rn(vn) | Rd(vd));
-}
-
-void Assembler::FPDataProcessing2Source(const VRegister& fd,
-                                        const VRegister& fn,
-                                        const VRegister& fm,
-                                        FPDataProcessing2SourceOp op) {
-  DCHECK(fd.SizeInBits() == fn.SizeInBits());
-  DCHECK(fd.SizeInBits() == fm.SizeInBits());
-  Emit(FPType(fd) | op | Rm(fm) | Rn(fn) | Rd(fd));
-}
-
-void Assembler::FPDataProcessing3Source(const VRegister& fd,
-                                        const VRegister& fn,
-                                        const VRegister& fm,
-                                        const VRegister& fa,
-                                        FPDataProcessing3SourceOp op) {
-  DCHECK(AreSameSizeAndType(fd, fn, fm, fa));
-  Emit(FPType(fd) | op | Rm(fm) | Rn(fn) | Rd(fd) | Ra(fa));
-}
-
-void Assembler::NEONModifiedImmShiftLsl(const VRegister& vd, const int imm8,
-                                        const int left_shift,
-                                        NEONModifiedImmediateOp op) {
-  DCHECK(vd.Is8B() || vd.Is16B() || vd.Is4H() || vd.Is8H() || vd.Is2S() ||
-         vd.Is4S());
-  DCHECK((left_shift == 0) || (left_shift == 8) || (left_shift == 16) ||
-         (left_shift == 24));
-  DCHECK(is_uint8(imm8));
-
-  int cmode_1, cmode_2, cmode_3;
-  if (vd.Is8B() || vd.Is16B()) {
-    DCHECK_EQ(op, NEONModifiedImmediate_MOVI);
-    cmode_1 = 1;
-    cmode_2 = 1;
-    cmode_3 = 1;
-  } else {
-    cmode_1 = (left_shift >> 3) & 1;
-    cmode_2 = left_shift >> 4;
-    cmode_3 = 0;
-    if (vd.Is4H() || vd.Is8H()) {
-      DCHECK((left_shift == 0) || (left_shift == 8));
-      cmode_3 = 1;
-    }
-  }
-  int cmode = (cmode_3 << 3) | (cmode_2 << 2) | (cmode_1 << 1);
-
-  Instr q = vd.IsQ() ? NEON_Q : 0;
-
-  Emit(q | op | ImmNEONabcdefgh(imm8) | NEONCmode(cmode) | Rd(vd));
-}
-
-void Assembler::NEONModifiedImmShiftMsl(const VRegister& vd, const int imm8,
-                                        const int shift_amount,
-                                        NEONModifiedImmediateOp op) {
-  DCHECK(vd.Is2S() || vd.Is4S());
-  DCHECK((shift_amount == 8) || (shift_amount == 16));
-  DCHECK(is_uint8(imm8));
-
-  int cmode_0 = (shift_amount >> 4) & 1;
-  int cmode = 0xC | cmode_0;
-
-  Instr q = vd.IsQ() ? NEON_Q : 0;
-
-  Emit(q | op | ImmNEONabcdefgh(imm8) | NEONCmode(cmode) | Rd(vd));
-}
-
-void Assembler::EmitShift(const Register& rd,
-                          const Register& rn,
-                          Shift shift,
-                          unsigned shift_amount) {
-  switch (shift) {
-    case LSL:
-      lsl(rd, rn, shift_amount);
-      break;
-    case LSR:
-      lsr(rd, rn, shift_amount);
-      break;
-    case ASR:
-      asr(rd, rn, shift_amount);
-      break;
-    case ROR:
-      ror(rd, rn, shift_amount);
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-void Assembler::EmitExtendShift(const Register& rd,
-                                const Register& rn,
-                                Extend extend,
-                                unsigned left_shift) {
-  DCHECK(rd.SizeInBits() >= rn.SizeInBits());
-  unsigned reg_size = rd.SizeInBits();
-  // Use the correct size of register.
-  Register rn_ = Register::Create(rn.code(), rd.SizeInBits());
-  // Bits extracted are high_bit:0.
-  unsigned high_bit = (8 << (extend & 0x3)) - 1;
-  // Number of bits left in the result that are not introduced by the shift.
-  unsigned non_shift_bits = (reg_size - left_shift) & (reg_size - 1);
-
-  if ((non_shift_bits > high_bit) || (non_shift_bits == 0)) {
-    switch (extend) {
-      case UXTB:
-      case UXTH:
-      case UXTW: ubfm(rd, rn_, non_shift_bits, high_bit); break;
-      case SXTB:
-      case SXTH:
-      case SXTW: sbfm(rd, rn_, non_shift_bits, high_bit); break;
-      case UXTX:
-      case SXTX: {
-        DCHECK_EQ(rn.SizeInBits(), kXRegSizeInBits);
-        // Nothing to extend. Just shift.
-        lsl(rd, rn_, left_shift);
-        break;
-      }
-      default: UNREACHABLE();
-    }
-  } else {
-    // No need to extend as the extended bits would be shifted away.
-    lsl(rd, rn_, left_shift);
-  }
-}
-
-
-void Assembler::DataProcShiftedRegister(const Register& rd,
-                                        const Register& rn,
-                                        const Operand& operand,
-                                        FlagsUpdate S,
-                                        Instr op) {
-  DCHECK(operand.IsShiftedRegister());
-  DCHECK(rn.Is64Bits() || (rn.Is32Bits() && is_uint5(operand.shift_amount())));
-  DCHECK(!operand.NeedsRelocation(this));
-  Emit(SF(rd) | op | Flags(S) |
-       ShiftDP(operand.shift()) | ImmDPShift(operand.shift_amount()) |
-       Rm(operand.reg()) | Rn(rn) | Rd(rd));
-}
-
-
-void Assembler::DataProcExtendedRegister(const Register& rd,
-                                         const Register& rn,
-                                         const Operand& operand,
-                                         FlagsUpdate S,
-                                         Instr op) {
-  DCHECK(!operand.NeedsRelocation(this));
-  Instr dest_reg = (S == SetFlags) ? Rd(rd) : RdSP(rd);
-  Emit(SF(rd) | op | Flags(S) | Rm(operand.reg()) |
-       ExtendMode(operand.extend()) | ImmExtendShift(operand.shift_amount()) |
-       dest_reg | RnSP(rn));
-}
-
-
-bool Assembler::IsImmAddSub(int64_t immediate) {
-  return is_uint12(immediate) ||
-         (is_uint12(immediate >> 12) && ((immediate & 0xFFF) == 0));
-}
-
-void Assembler::LoadStore(const CPURegister& rt,
-                          const MemOperand& addr,
-                          LoadStoreOp op) {
-  Instr memop = op | Rt(rt) | RnSP(addr.base());
-
-  if (addr.IsImmediateOffset()) {
-    unsigned size = CalcLSDataSize(op);
-    if (IsImmLSScaled(addr.offset(), size)) {
-      int offset = static_cast<int>(addr.offset());
-      // Use the scaled addressing mode.
-      Emit(LoadStoreUnsignedOffsetFixed | memop |
-           ImmLSUnsigned(offset >> size));
-    } else if (IsImmLSUnscaled(addr.offset())) {
-      int offset = static_cast<int>(addr.offset());
-      // Use the unscaled addressing mode.
-      Emit(LoadStoreUnscaledOffsetFixed | memop | ImmLS(offset));
-    } else {
-      // This case is handled in the macro assembler.
-      UNREACHABLE();
-    }
-  } else if (addr.IsRegisterOffset()) {
-    Extend ext = addr.extend();
-    Shift shift = addr.shift();
-    unsigned shift_amount = addr.shift_amount();
-
-    // LSL is encoded in the option field as UXTX.
-    if (shift == LSL) {
-      ext = UXTX;
-    }
-
-    // Shifts are encoded in one bit, indicating a left shift by the memory
-    // access size.
-    DCHECK((shift_amount == 0) ||
-           (shift_amount == static_cast<unsigned>(CalcLSDataSize(op))));
-    Emit(LoadStoreRegisterOffsetFixed | memop | Rm(addr.regoffset()) |
-         ExtendMode(ext) | ImmShiftLS((shift_amount > 0) ? 1 : 0));
-  } else {
-    // Pre-index and post-index modes.
-    DCHECK(!rt.Is(addr.base()));
-    if (IsImmLSUnscaled(addr.offset())) {
-      int offset = static_cast<int>(addr.offset());
-      if (addr.IsPreIndex()) {
-        Emit(LoadStorePreIndexFixed | memop | ImmLS(offset));
-      } else {
-        DCHECK(addr.IsPostIndex());
-        Emit(LoadStorePostIndexFixed | memop | ImmLS(offset));
-      }
-    } else {
-      // This case is handled in the macro assembler.
-      UNREACHABLE();
-    }
-  }
-}
-
-
-bool Assembler::IsImmLSUnscaled(int64_t offset) {
-  return is_int9(offset);
-}
-
-bool Assembler::IsImmLSScaled(int64_t offset, unsigned size) {
-  bool offset_is_size_multiple = (((offset >> size) << size) == offset);
-  return offset_is_size_multiple && is_uint12(offset >> size);
-}
-
-bool Assembler::IsImmLSPair(int64_t offset, unsigned size) {
-  bool offset_is_size_multiple = (((offset >> size) << size) == offset);
-  return offset_is_size_multiple && is_int7(offset >> size);
-}
-
-
-bool Assembler::IsImmLLiteral(int64_t offset) {
-  int inst_size = static_cast<int>(kInstructionSizeLog2);
-  bool offset_is_inst_multiple =
-      (((offset >> inst_size) << inst_size) == offset);
-  DCHECK_GT(offset, 0);
-  offset >>= kLoadLiteralScaleLog2;
-  return offset_is_inst_multiple && is_intn(offset, ImmLLiteral_width);
-}
-
-
-// Test if a given value can be encoded in the immediate field of a logical
-// instruction.
-// If it can be encoded, the function returns true, and values pointed to by n,
-// imm_s and imm_r are updated with immediates encoded in the format required
-// by the corresponding fields in the logical instruction.
-// If it can not be encoded, the function returns false, and the values pointed
-// to by n, imm_s and imm_r are undefined.
-bool Assembler::IsImmLogical(uint64_t value,
-                             unsigned width,
-                             unsigned* n,
-                             unsigned* imm_s,
-                             unsigned* imm_r) {
-  DCHECK((n != nullptr) && (imm_s != nullptr) && (imm_r != nullptr));
-  DCHECK((width == kWRegSizeInBits) || (width == kXRegSizeInBits));
-
-  bool negate = false;
-
-  // Logical immediates are encoded using parameters n, imm_s and imm_r using
-  // the following table:
-  //
-  //    N   imms    immr    size        S             R
-  //    1  ssssss  rrrrrr    64    UInt(ssssss)  UInt(rrrrrr)
-  //    0  0sssss  xrrrrr    32    UInt(sssss)   UInt(rrrrr)
-  //    0  10ssss  xxrrrr    16    UInt(ssss)    UInt(rrrr)
-  //    0  110sss  xxxrrr     8    UInt(sss)     UInt(rrr)
-  //    0  1110ss  xxxxrr     4    UInt(ss)      UInt(rr)
-  //    0  11110s  xxxxxr     2    UInt(s)       UInt(r)
-  // (s bits must not be all set)
-  //
-  // A pattern is constructed of size bits, where the least significant S+1 bits
-  // are set. The pattern is rotated right by R, and repeated across a 32 or
-  // 64-bit value, depending on destination register width.
-  //
-  // Put another way: the basic format of a logical immediate is a single
-  // contiguous stretch of 1 bits, repeated across the whole word at intervals
-  // given by a power of 2. To identify them quickly, we first locate the
-  // lowest stretch of 1 bits, then the next 1 bit above that; that combination
-  // is different for every logical immediate, so it gives us all the
-  // information we need to identify the only logical immediate that our input
-  // could be, and then we simply check if that's the value we actually have.
-  //
-  // (The rotation parameter does give the possibility of the stretch of 1 bits
-  // going 'round the end' of the word. To deal with that, we observe that in
-  // any situation where that happens the bitwise NOT of the value is also a
-  // valid logical immediate. So we simply invert the input whenever its low bit
-  // is set, and then we know that the rotated case can't arise.)
-
-  if (value & 1) {
-    // If the low bit is 1, negate the value, and set a flag to remember that we
-    // did (so that we can adjust the return values appropriately).
-    negate = true;
-    value = ~value;
-  }
-
-  if (width == kWRegSizeInBits) {
-    // To handle 32-bit logical immediates, the very easiest thing is to repeat
-    // the input value twice to make a 64-bit word. The correct encoding of that
-    // as a logical immediate will also be the correct encoding of the 32-bit
-    // value.
-
-    // The most-significant 32 bits may not be zero (ie. negate is true) so
-    // shift the value left before duplicating it.
-    value <<= kWRegSizeInBits;
-    value |= value >> kWRegSizeInBits;
-  }
-
-  // The basic analysis idea: imagine our input word looks like this.
-  //
-  //    0011111000111110001111100011111000111110001111100011111000111110
-  //                                                          c  b    a
-  //                                                          |<--d-->|
-  //
-  // We find the lowest set bit (as an actual power-of-2 value, not its index)
-  // and call it a. Then we add a to our original number, which wipes out the
-  // bottommost stretch of set bits and replaces it with a 1 carried into the
-  // next zero bit. Then we look for the new lowest set bit, which is in
-  // position b, and subtract it, so now our number is just like the original
-  // but with the lowest stretch of set bits completely gone. Now we find the
-  // lowest set bit again, which is position c in the diagram above. Then we'll
-  // measure the distance d between bit positions a and c (using CLZ), and that
-  // tells us that the only valid logical immediate that could possibly be equal
-  // to this number is the one in which a stretch of bits running from a to just
-  // below b is replicated every d bits.
-  uint64_t a = LargestPowerOf2Divisor(value);
-  uint64_t value_plus_a = value + a;
-  uint64_t b = LargestPowerOf2Divisor(value_plus_a);
-  uint64_t value_plus_a_minus_b = value_plus_a - b;
-  uint64_t c = LargestPowerOf2Divisor(value_plus_a_minus_b);
-
-  int d, clz_a, out_n;
-  uint64_t mask;
-
-  if (c != 0) {
-    // The general case, in which there is more than one stretch of set bits.
-    // Compute the repeat distance d, and set up a bitmask covering the basic
-    // unit of repetition (i.e. a word with the bottom d bits set). Also, in all
-    // of these cases the N bit of the output will be zero.
-    clz_a = CountLeadingZeros(a, kXRegSizeInBits);
-    int clz_c = CountLeadingZeros(c, kXRegSizeInBits);
-    d = clz_a - clz_c;
-    mask = ((uint64_t{1} << d) - 1);
-    out_n = 0;
-  } else {
-    // Handle degenerate cases.
-    //
-    // If any of those 'find lowest set bit' operations didn't find a set bit at
-    // all, then the word will have been zero thereafter, so in particular the
-    // last lowest_set_bit operation will have returned zero. So we can test for
-    // all the special case conditions in one go by seeing if c is zero.
-    if (a == 0) {
-      // The input was zero (or all 1 bits, which will come to here too after we
-      // inverted it at the start of the function), for which we just return
-      // false.
-      return false;
-    } else {
-      // Otherwise, if c was zero but a was not, then there's just one stretch
-      // of set bits in our word, meaning that we have the trivial case of
-      // d == 64 and only one 'repetition'. Set up all the same variables as in
-      // the general case above, and set the N bit in the output.
-      clz_a = CountLeadingZeros(a, kXRegSizeInBits);
-      d = 64;
-      mask = ~uint64_t{0};
-      out_n = 1;
-    }
-  }
-
-  // If the repeat period d is not a power of two, it can't be encoded.
-  if (!base::bits::IsPowerOfTwo(d)) {
-    return false;
-  }
-
-  if (((b - a) & ~mask) != 0) {
-    // If the bit stretch (b - a) does not fit within the mask derived from the
-    // repeat period, then fail.
-    return false;
-  }
-
-  // The only possible option is b - a repeated every d bits. Now we're going to
-  // actually construct the valid logical immediate derived from that
-  // specification, and see if it equals our original input.
-  //
-  // To repeat a value every d bits, we multiply it by a number of the form
-  // (1 + 2^d + 2^(2d) + ...), i.e. 0x0001000100010001 or similar. These can
-  // be derived using a table lookup on CLZ(d).
-  static const uint64_t multipliers[] = {
-    0x0000000000000001UL,
-    0x0000000100000001UL,
-    0x0001000100010001UL,
-    0x0101010101010101UL,
-    0x1111111111111111UL,
-    0x5555555555555555UL,
-  };
-  int multiplier_idx = CountLeadingZeros(d, kXRegSizeInBits) - 57;
-  // Ensure that the index to the multipliers array is within bounds.
-  DCHECK((multiplier_idx >= 0) &&
-         (static_cast<size_t>(multiplier_idx) < arraysize(multipliers)));
-  uint64_t multiplier = multipliers[multiplier_idx];
-  uint64_t candidate = (b - a) * multiplier;
-
-  if (value != candidate) {
-    // The candidate pattern doesn't match our input value, so fail.
-    return false;
-  }
-
-  // We have a match! This is a valid logical immediate, so now we have to
-  // construct the bits and pieces of the instruction encoding that generates
-  // it.
-
-  // Count the set bits in our basic stretch. The special case of clz(0) == -1
-  // makes the answer come out right for stretches that reach the very top of
-  // the word (e.g. numbers like 0xFFFFC00000000000).
-  int clz_b = (b == 0) ? -1 : CountLeadingZeros(b, kXRegSizeInBits);
-  int s = clz_a - clz_b;
-
-  // Decide how many bits to rotate right by, to put the low bit of that basic
-  // stretch in position a.
-  int r;
-  if (negate) {
-    // If we inverted the input right at the start of this function, here's
-    // where we compensate: the number of set bits becomes the number of clear
-    // bits, and the rotation count is based on position b rather than position
-    // a (since b is the location of the 'lowest' 1 bit after inversion).
-    s = d - s;
-    r = (clz_b + 1) & (d - 1);
-  } else {
-    r = (clz_a + 1) & (d - 1);
-  }
-
-  // Now we're done, except for having to encode the S output in such a way that
-  // it gives both the number of set bits and the length of the repeated
-  // segment. The s field is encoded like this:
-  //
-  //     imms    size        S
-  //    ssssss    64    UInt(ssssss)
-  //    0sssss    32    UInt(sssss)
-  //    10ssss    16    UInt(ssss)
-  //    110sss     8    UInt(sss)
-  //    1110ss     4    UInt(ss)
-  //    11110s     2    UInt(s)
-  //
-  // So we 'or' (-d << 1) with our computed s to form imms.
-  *n = out_n;
-  *imm_s = ((-d << 1) | (s - 1)) & 0x3F;
-  *imm_r = r;
-
-  return true;
-}
-
-
-bool Assembler::IsImmConditionalCompare(int64_t immediate) {
-  return is_uint5(immediate);
-}
-
-
-bool Assembler::IsImmFP32(float imm) {
-  // Valid values will have the form:
-  // aBbb.bbbc.defg.h000.0000.0000.0000.0000
-  uint32_t bits = bit_cast<uint32_t>(imm);
-  // bits[19..0] are cleared.
-  if ((bits & 0x7FFFF) != 0) {
-    return false;
-  }
-
-  // bits[29..25] are all set or all cleared.
-  uint32_t b_pattern = (bits >> 16) & 0x3E00;
-  if (b_pattern != 0 && b_pattern != 0x3E00) {
-    return false;
-  }
-
-  // bit[30] and bit[29] are opposite.
-  if (((bits ^ (bits << 1)) & 0x40000000) == 0) {
-    return false;
-  }
-
-  return true;
-}
-
-
-bool Assembler::IsImmFP64(double imm) {
-  // Valid values will have the form:
-  // aBbb.bbbb.bbcd.efgh.0000.0000.0000.0000
-  // 0000.0000.0000.0000.0000.0000.0000.0000
-  uint64_t bits = bit_cast<uint64_t>(imm);
-  // bits[47..0] are cleared.
-  if ((bits & 0xFFFFFFFFFFFFL) != 0) {
-    return false;
-  }
-
-  // bits[61..54] are all set or all cleared.
-  uint32_t b_pattern = (bits >> 48) & 0x3FC0;
-  if (b_pattern != 0 && b_pattern != 0x3FC0) {
-    return false;
-  }
-
-  // bit[62] and bit[61] are opposite.
-  if (((bits ^ (bits << 1)) & 0x4000000000000000L) == 0) {
-    return false;
-  }
-
-  return true;
-}
-
-
-void Assembler::GrowBuffer() {
-  if (!own_buffer_) FATAL("external code buffer is too small");
-
-  // Compute new buffer size.
-  CodeDesc desc;  // the new buffer
-  if (buffer_size_ < 1 * MB) {
-    desc.buffer_size = 2 * buffer_size_;
-  } else {
-    desc.buffer_size = buffer_size_ + 1 * MB;
-  }
-
-  // Some internal data structures overflow for very large buffers,
-  // they must ensure that kMaximalBufferSize is not too large.
-  if (desc.buffer_size > kMaximalBufferSize) {
-    V8::FatalProcessOutOfMemory("Assembler::GrowBuffer");
-  }
-
-  byte* buffer = reinterpret_cast<byte*>(buffer_);
-
-  // Set up new buffer.
-  desc.buffer = NewArray<byte>(desc.buffer_size);
-  desc.origin = this;
-
-  desc.instr_size = pc_offset();
-  desc.reloc_size =
-      static_cast<int>((buffer + buffer_size_) - reloc_info_writer.pos());
-
-  // Copy the data.
-  intptr_t pc_delta = desc.buffer - buffer;
-  intptr_t rc_delta = (desc.buffer + desc.buffer_size) -
-                      (buffer + buffer_size_);
-  memmove(desc.buffer, buffer, desc.instr_size);
-  memmove(reloc_info_writer.pos() + rc_delta,
-          reloc_info_writer.pos(), desc.reloc_size);
-
-  // Switch buffers.
-  DeleteArray(buffer_);
-  buffer_ = desc.buffer;
-  buffer_size_ = desc.buffer_size;
-  pc_ = reinterpret_cast<byte*>(pc_) + pc_delta;
-  reloc_info_writer.Reposition(reloc_info_writer.pos() + rc_delta,
-                               reloc_info_writer.last_pc() + pc_delta);
-
-  // None of our relocation types are pc relative pointing outside the code
-  // buffer nor pc absolute pointing inside the code buffer, so there is no need
-  // to relocate any emitted relocation entries.
-
-  // Relocate internal references.
-  for (auto pos : internal_reference_positions_) {
-    intptr_t* p = reinterpret_cast<intptr_t*>(buffer_ + pos);
-    *p += pc_delta;
-  }
-
-  // Pending relocation entries are also relative, no need to relocate.
-}
-
-
-void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
-  // We do not try to reuse pool constants.
-  RelocInfo rinfo(reinterpret_cast<byte*>(pc_), rmode, data, nullptr);
-  bool write_reloc_info = true;
-
-  if ((rmode == RelocInfo::COMMENT) ||
-      (rmode == RelocInfo::INTERNAL_REFERENCE) ||
-      (rmode == RelocInfo::CONST_POOL) || (rmode == RelocInfo::VENEER_POOL) ||
-      (rmode == RelocInfo::DEOPT_SCRIPT_OFFSET) ||
-      (rmode == RelocInfo::DEOPT_INLINING_ID) ||
-      (rmode == RelocInfo::DEOPT_REASON) || (rmode == RelocInfo::DEOPT_ID)) {
-    // Adjust code for new modes.
-    DCHECK(RelocInfo::IsComment(rmode) || RelocInfo::IsDeoptReason(rmode) ||
-           RelocInfo::IsDeoptId(rmode) || RelocInfo::IsDeoptPosition(rmode) ||
-           RelocInfo::IsInternalReference(rmode) ||
-           RelocInfo::IsConstPool(rmode) || RelocInfo::IsVeneerPool(rmode));
-    // These modes do not need an entry in the constant pool.
-  } else {
-    write_reloc_info = constpool_.RecordEntry(data, rmode);
-    // Make sure the constant pool is not emitted in place of the next
-    // instruction for which we just recorded relocation info.
-    BlockConstPoolFor(1);
-  }
-
-  if (!RelocInfo::IsNone(rmode) && write_reloc_info) {
-    // Don't record external references unless the heap will be serialized.
-    if (rmode == RelocInfo::EXTERNAL_REFERENCE &&
-        !serializer_enabled() && !emit_debug_code()) {
-      return;
-    }
-    DCHECK_GE(buffer_space(), kMaxRelocSize);  // too late to grow buffer here
-    reloc_info_writer.Write(&rinfo);
-  }
-}
-
-
-void Assembler::BlockConstPoolFor(int instructions) {
-  int pc_limit = pc_offset() + instructions * kInstructionSize;
-  if (no_const_pool_before_ < pc_limit) {
-    no_const_pool_before_ = pc_limit;
-    // Make sure the pool won't be blocked for too long.
-    DCHECK(pc_limit < constpool_.MaxPcOffset());
-  }
-
-  if (next_constant_pool_check_ < no_const_pool_before_) {
-    next_constant_pool_check_ = no_const_pool_before_;
-  }
-}
-
-
-void Assembler::CheckConstPool(bool force_emit, bool require_jump) {
-  // Some short sequence of instruction mustn't be broken up by constant pool
-  // emission, such sequences are protected by calls to BlockConstPoolFor and
-  // BlockConstPoolScope.
-  if (is_const_pool_blocked()) {
-    // Something is wrong if emission is forced and blocked at the same time.
-    DCHECK(!force_emit);
-    return;
-  }
-
-  // There is nothing to do if there are no pending constant pool entries.
-  if (constpool_.IsEmpty())  {
-    // Calculate the offset of the next check.
-    SetNextConstPoolCheckIn(kCheckConstPoolInterval);
-    return;
-  }
-
-  // We emit a constant pool when:
-  //  * requested to do so by parameter force_emit (e.g. after each function).
-  //  * the distance to the first instruction accessing the constant pool is
-  //    kApproxMaxDistToConstPool or more.
-  //  * the number of entries in the pool is kApproxMaxPoolEntryCount or more.
-  int dist = constpool_.DistanceToFirstUse();
-  int count = constpool_.EntryCount();
-  if (!force_emit &&
-      (dist < kApproxMaxDistToConstPool) &&
-      (count < kApproxMaxPoolEntryCount)) {
-    return;
-  }
-
-
-  // Emit veneers for branches that would go out of range during emission of the
-  // constant pool.
-  int worst_case_size = constpool_.WorstCaseSize();
-  CheckVeneerPool(false, require_jump,
-                  kVeneerDistanceMargin + worst_case_size);
-
-  // Check that the code buffer is large enough before emitting the constant
-  // pool (this includes the gap to the relocation information).
-  int needed_space = worst_case_size + kGap + 1 * kInstructionSize;
-  while (buffer_space() <= needed_space) {
-    GrowBuffer();
-  }
-
-  Label size_check;
-  bind(&size_check);
-  constpool_.Emit(require_jump);
-  DCHECK(SizeOfCodeGeneratedSince(&size_check) <=
-         static_cast<unsigned>(worst_case_size));
-
-  // Since a constant pool was just emitted, move the check offset forward by
-  // the standard interval.
-  SetNextConstPoolCheckIn(kCheckConstPoolInterval);
-}
-
-
-bool Assembler::ShouldEmitVeneer(int max_reachable_pc, int margin) {
-  // Account for the branch around the veneers and the guard.
-  int protection_offset = 2 * kInstructionSize;
-  return pc_offset() > max_reachable_pc - margin - protection_offset -
-    static_cast<int>(unresolved_branches_.size() * kMaxVeneerCodeSize);
-}
-
-
-void Assembler::RecordVeneerPool(int location_offset, int size) {
-  RelocInfo rinfo(buffer_ + location_offset, RelocInfo::VENEER_POOL,
-                  static_cast<intptr_t>(size), nullptr);
-  reloc_info_writer.Write(&rinfo);
-}
-
-
-void Assembler::EmitVeneers(bool force_emit, bool need_protection, int margin) {
-  BlockPoolsScope scope(this);
-  RecordComment("[ Veneers");
-
-  // The exact size of the veneer pool must be recorded (see the comment at the
-  // declaration site of RecordConstPool()), but computing the number of
-  // veneers that will be generated is not obvious. So instead we remember the
-  // current position and will record the size after the pool has been
-  // generated.
-  Label size_check;
-  bind(&size_check);
-  int veneer_pool_relocinfo_loc = pc_offset();
-
-  Label end;
-  if (need_protection) {
-    b(&end);
-  }
-
-  EmitVeneersGuard();
-
-  Label veneer_size_check;
-
-  std::multimap<int, FarBranchInfo>::iterator it, it_to_delete;
-
-  it = unresolved_branches_.begin();
-  while (it != unresolved_branches_.end()) {
-    if (force_emit || ShouldEmitVeneer(it->first, margin)) {
-      Instruction* branch = InstructionAt(it->second.pc_offset_);
-      Label* label = it->second.label_;
-
-#ifdef DEBUG
-      bind(&veneer_size_check);
-#endif
-      // Patch the branch to point to the current position, and emit a branch
-      // to the label.
-      Instruction* veneer = reinterpret_cast<Instruction*>(pc_);
-      RemoveBranchFromLabelLinkChain(branch, label, veneer);
-      branch->SetImmPCOffsetTarget(isolate_data(), veneer);
-      b(label);
-#ifdef DEBUG
-      DCHECK(SizeOfCodeGeneratedSince(&veneer_size_check) <=
-             static_cast<uint64_t>(kMaxVeneerCodeSize));
-      veneer_size_check.Unuse();
-#endif
-
-      it_to_delete = it++;
-      unresolved_branches_.erase(it_to_delete);
-    } else {
-      ++it;
-    }
-  }
-
-  // Record the veneer pool size.
-  int pool_size = static_cast<int>(SizeOfCodeGeneratedSince(&size_check));
-  RecordVeneerPool(veneer_pool_relocinfo_loc, pool_size);
-
-  if (unresolved_branches_.empty()) {
-    next_veneer_pool_check_ = kMaxInt;
-  } else {
-    next_veneer_pool_check_ =
-      unresolved_branches_first_limit() - kVeneerDistanceCheckMargin;
-  }
-
-  bind(&end);
-
-  RecordComment("]");
-}
-
-
-void Assembler::CheckVeneerPool(bool force_emit, bool require_jump,
-                                int margin) {
-  // There is nothing to do if there are no pending veneer pool entries.
-  if (unresolved_branches_.empty())  {
-    DCHECK_EQ(next_veneer_pool_check_, kMaxInt);
-    return;
-  }
-
-  DCHECK(pc_offset() < unresolved_branches_first_limit());
-
-  // Some short sequence of instruction mustn't be broken up by veneer pool
-  // emission, such sequences are protected by calls to BlockVeneerPoolFor and
-  // BlockVeneerPoolScope.
-  if (is_veneer_pool_blocked()) {
-    DCHECK(!force_emit);
-    return;
-  }
-
-  if (!require_jump) {
-    // Prefer emitting veneers protected by an existing instruction.
-    margin *= kVeneerNoProtectionFactor;
-  }
-  if (force_emit || ShouldEmitVeneers(margin)) {
-    EmitVeneers(force_emit, require_jump, margin);
-  } else {
-    next_veneer_pool_check_ =
-      unresolved_branches_first_limit() - kVeneerDistanceCheckMargin;
-  }
-}
-
-
-int Assembler::buffer_space() const {
-  return static_cast<int>(reloc_info_writer.pos() -
-                          reinterpret_cast<byte*>(pc_));
-}
-
-
-void Assembler::RecordConstPool(int size) {
-  // We only need this for debugger support, to correctly compute offsets in the
-  // code.
-  RecordRelocInfo(RelocInfo::CONST_POOL, static_cast<intptr_t>(size));
-}
-
-
-void PatchingAssembler::PatchAdrFar(int64_t target_offset) {
-  // The code at the current instruction should be:
-  //   adr  rd, 0
-  //   nop  (adr_far)
-  //   nop  (adr_far)
-  //   movz scratch, 0
-
-  // Verify the expected code.
-  Instruction* expected_adr = InstructionAt(0);
-  CHECK(expected_adr->IsAdr() && (expected_adr->ImmPCRel() == 0));
-  int rd_code = expected_adr->Rd();
-  for (int i = 0; i < kAdrFarPatchableNNops; ++i) {
-    CHECK(InstructionAt((i + 1) * kInstructionSize)->IsNop(ADR_FAR_NOP));
-  }
-  Instruction* expected_movz =
-      InstructionAt((kAdrFarPatchableNInstrs - 1) * kInstructionSize);
-  CHECK(expected_movz->IsMovz() &&
-        (expected_movz->ImmMoveWide() == 0) &&
-        (expected_movz->ShiftMoveWide() == 0));
-  int scratch_code = expected_movz->Rd();
-
-  // Patch to load the correct address.
-  Register rd = Register::XRegFromCode(rd_code);
-  Register scratch = Register::XRegFromCode(scratch_code);
-  // Addresses are only 48 bits.
-  adr(rd, target_offset & 0xFFFF);
-  movz(scratch, (target_offset >> 16) & 0xFFFF, 16);
-  movk(scratch, (target_offset >> 32) & 0xFFFF, 32);
-  DCHECK_EQ(target_offset >> 48, 0);
-  add(rd, rd, scratch);
-}
-
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_ARM64
diff --git a/src/v8/src/arm64/assembler-arm64.h b/src/v8/src/arm64/assembler-arm64.h
deleted file mode 100644
index 2deae8a..0000000
--- a/src/v8/src/arm64/assembler-arm64.h
+++ /dev/null
@@ -1,3729 +0,0 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_ARM64_ASSEMBLER_ARM64_H_
-#define V8_ARM64_ASSEMBLER_ARM64_H_
-
-#include <deque>
-#include <list>
-#include <map>
-#include <vector>
-
-#include "src/arm64/constants-arm64.h"
-#include "src/arm64/instructions-arm64.h"
-#include "src/assembler.h"
-#include "src/base/optional.h"
-#include "src/globals.h"
-#include "src/utils.h"
-
-
-namespace v8 {
-namespace internal {
-
-// -----------------------------------------------------------------------------
-// Registers.
-// clang-format off
-#define GENERAL_REGISTER_CODE_LIST(R)                     \
-  R(0)  R(1)  R(2)  R(3)  R(4)  R(5)  R(6)  R(7)          \
-  R(8)  R(9)  R(10) R(11) R(12) R(13) R(14) R(15)         \
-  R(16) R(17) R(18) R(19) R(20) R(21) R(22) R(23)         \
-  R(24) R(25) R(26) R(27) R(28) R(29) R(30) R(31)
-
-#define GENERAL_REGISTERS(R)                              \
-  R(x0)  R(x1)  R(x2)  R(x3)  R(x4)  R(x5)  R(x6)  R(x7)  \
-  R(x8)  R(x9)  R(x10) R(x11) R(x12) R(x13) R(x14) R(x15) \
-  R(x16) R(x17) R(x18) R(x19) R(x20) R(x21) R(x22) R(x23) \
-  R(x24) R(x25) R(x26) R(x27) R(x28) R(x29) R(x30) R(x31)
-
-#define ALLOCATABLE_GENERAL_REGISTERS(R)                  \
-  R(x0)  R(x1)  R(x2)  R(x3)  R(x4)  R(x5)  R(x6)  R(x7)  \
-  R(x8)  R(x9)  R(x10) R(x11) R(x12) R(x13) R(x14) R(x15) \
-  R(x18) R(x19) R(x20) R(x21) R(x22) R(x23) R(x24) R(x27) \
-  R(x28)
-
-#define FLOAT_REGISTERS(V)                                \
-  V(s0)  V(s1)  V(s2)  V(s3)  V(s4)  V(s5)  V(s6)  V(s7)  \
-  V(s8)  V(s9)  V(s10) V(s11) V(s12) V(s13) V(s14) V(s15) \
-  V(s16) V(s17) V(s18) V(s19) V(s20) V(s21) V(s22) V(s23) \
-  V(s24) V(s25) V(s26) V(s27) V(s28) V(s29) V(s30) V(s31)
-
-#define DOUBLE_REGISTERS(R)                               \
-  R(d0)  R(d1)  R(d2)  R(d3)  R(d4)  R(d5)  R(d6)  R(d7)  \
-  R(d8)  R(d9)  R(d10) R(d11) R(d12) R(d13) R(d14) R(d15) \
-  R(d16) R(d17) R(d18) R(d19) R(d20) R(d21) R(d22) R(d23) \
-  R(d24) R(d25) R(d26) R(d27) R(d28) R(d29) R(d30) R(d31)
-
-#define SIMD128_REGISTERS(V)                              \
-  V(q0)  V(q1)  V(q2)  V(q3)  V(q4)  V(q5)  V(q6)  V(q7)  \
-  V(q8)  V(q9)  V(q10) V(q11) V(q12) V(q13) V(q14) V(q15) \
-  V(q16) V(q17) V(q18) V(q19) V(q20) V(q21) V(q22) V(q23) \
-  V(q24) V(q25) V(q26) V(q27) V(q28) V(q29) V(q30) V(q31)
-
-#define ALLOCATABLE_DOUBLE_REGISTERS(R)                   \
-  R(d0)  R(d1)  R(d2)  R(d3)  R(d4)  R(d5)  R(d6)  R(d7)  \
-  R(d8)  R(d9)  R(d10) R(d11) R(d12) R(d13) R(d14) R(d16) \
-  R(d17) R(d18) R(d19) R(d20) R(d21) R(d22) R(d23) R(d24) \
-  R(d25) R(d26) R(d27) R(d28)
-// clang-format on
-
-constexpr int kRegListSizeInBits = sizeof(RegList) * kBitsPerByte;
-static const int kNoCodeAgeSequenceLength = 5 * kInstructionSize;
-
-const int kNumRegs = kNumberOfRegisters;
-// Registers x0-x17 are caller-saved.
-const int kNumJSCallerSaved = 18;
-const RegList kJSCallerSaved = 0x3ffff;
-
-// Number of registers for which space is reserved in safepoints. Must be a
-// multiple of eight.
-// TODO(all): Refine this number.
-const int kNumSafepointRegisters = 32;
-
-// Define the list of registers actually saved at safepoints.
-// Note that the number of saved registers may be smaller than the reserved
-// space, i.e. kNumSafepointSavedRegisters <= kNumSafepointRegisters.
-#define kSafepointSavedRegisters CPURegList::GetSafepointSavedRegisters().list()
-#define kNumSafepointSavedRegisters \
-  CPURegList::GetSafepointSavedRegisters().Count()
-
-// Some CPURegister methods can return Register and VRegister types, so we
-// need to declare them in advance.
-class Register;
-class VRegister;
-
-enum RegisterCode {
-#define REGISTER_CODE(R) kRegCode_##R,
-  GENERAL_REGISTERS(REGISTER_CODE)
-#undef REGISTER_CODE
-      kRegAfterLast
-};
-
-class CPURegister : public RegisterBase<CPURegister, kRegAfterLast> {
- public:
-  enum RegisterType {
-    kRegister,
-    kVRegister,
-    kNoRegister
-  };
-
-  static constexpr CPURegister no_reg() {
-    return CPURegister{0, 0, kNoRegister};
-  }
-
-  template <int code, int size, RegisterType type>
-  static constexpr CPURegister Create() {
-    static_assert(IsValid(code, size, type), "Cannot create invalid registers");
-    return CPURegister{code, size, type};
-  }
-
-  static CPURegister Create(int code, int size, RegisterType type) {
-    DCHECK(IsValid(code, size, type));
-    return CPURegister{code, size, type};
-  }
-
-  RegisterType type() const { return reg_type_; }
-  RegList bit() const {
-    DCHECK(static_cast<size_t>(reg_code_) < (sizeof(RegList) * kBitsPerByte));
-    return IsValid() ? 1UL << reg_code_ : 0;
-  }
-  int SizeInBits() const {
-    DCHECK(IsValid());
-    return reg_size_;
-  }
-  int SizeInBytes() const {
-    DCHECK(IsValid());
-    DCHECK_EQ(SizeInBits() % 8, 0);
-    return reg_size_ / 8;
-  }
-  bool Is8Bits() const {
-    DCHECK(IsValid());
-    return reg_size_ == 8;
-  }
-  bool Is16Bits() const {
-    DCHECK(IsValid());
-    return reg_size_ == 16;
-  }
-  bool Is32Bits() const {
-    DCHECK(IsValid());
-    return reg_size_ == 32;
-  }
-  bool Is64Bits() const {
-    DCHECK(IsValid());
-    return reg_size_ == 64;
-  }
-  bool Is128Bits() const {
-    DCHECK(IsValid());
-    return reg_size_ == 128;
-  }
-  bool IsValid() const { return reg_type_ != kNoRegister; }
-  bool IsNone() const { return reg_type_ == kNoRegister; }
-  bool Is(const CPURegister& other) const {
-    return Aliases(other) && (reg_size_ == other.reg_size_);
-  }
-  bool Aliases(const CPURegister& other) const {
-    return (reg_code_ == other.reg_code_) && (reg_type_ == other.reg_type_);
-  }
-
-  bool IsZero() const;
-  bool IsSP() const;
-
-  bool IsRegister() const { return reg_type_ == kRegister; }
-  bool IsVRegister() const { return reg_type_ == kVRegister; }
-
-  bool IsFPRegister() const { return IsS() || IsD(); }
-
-  bool IsW() const { return IsRegister() && Is32Bits(); }
-  bool IsX() const { return IsRegister() && Is64Bits(); }
-
-  // These assertions ensure that the size and type of the register are as
-  // described. They do not consider the number of lanes that make up a vector.
-  // So, for example, Is8B() implies IsD(), and Is1D() implies IsD, but IsD()
-  // does not imply Is1D() or Is8B().
-  // Check the number of lanes, ie. the format of the vector, using methods such
-  // as Is8B(), Is1D(), etc. in the VRegister class.
-  bool IsV() const { return IsVRegister(); }
-  bool IsB() const { return IsV() && Is8Bits(); }
-  bool IsH() const { return IsV() && Is16Bits(); }
-  bool IsS() const { return IsV() && Is32Bits(); }
-  bool IsD() const { return IsV() && Is64Bits(); }
-  bool IsQ() const { return IsV() && Is128Bits(); }
-
-  Register Reg() const;
-  VRegister VReg() const;
-
-  Register X() const;
-  Register W() const;
-  VRegister V() const;
-  VRegister B() const;
-  VRegister H() const;
-  VRegister D() const;
-  VRegister S() const;
-  VRegister Q() const;
-
-  bool IsSameSizeAndType(const CPURegister& other) const;
-
-  // V8 compatibility.
-  bool is(const CPURegister& other) const { return Is(other); }
-  bool is_valid() const { return IsValid(); }
-
- protected:
-  int reg_size_;
-  RegisterType reg_type_;
-
-  friend class RegisterBase;
-
-  constexpr CPURegister(int code, int size, RegisterType type)
-      : RegisterBase(code), reg_size_(size), reg_type_(type) {}
-
-  static constexpr bool IsValidRegister(int code, int size) {
-    return (size == kWRegSizeInBits || size == kXRegSizeInBits) &&
-           (code < kNumberOfRegisters || code == kSPRegInternalCode);
-  }
-
-  static constexpr bool IsValidVRegister(int code, int size) {
-    return (size == kBRegSizeInBits || size == kHRegSizeInBits ||
-            size == kSRegSizeInBits || size == kDRegSizeInBits ||
-            size == kQRegSizeInBits) &&
-           code < kNumberOfVRegisters;
-  }
-
-  static constexpr bool IsValid(int code, int size, RegisterType type) {
-    return (type == kRegister && IsValidRegister(code, size)) ||
-           (type == kVRegister && IsValidVRegister(code, size));
-  }
-
-  static constexpr bool IsNone(int code, int size, RegisterType type) {
-    return type == kNoRegister && code == 0 && size == 0;
-  }
-};
-
-static_assert(IS_TRIVIALLY_COPYABLE(CPURegister),
-              "CPURegister can efficiently be passed by value");
-
-class Register : public CPURegister {
- public:
-  static constexpr Register no_reg() { return Register(CPURegister::no_reg()); }
-
-  template <int code, int size>
-  static constexpr Register Create() {
-    return Register(CPURegister::Create<code, size, CPURegister::kRegister>());
-  }
-
-  static Register Create(int code, int size) {
-    return Register(CPURegister::Create(code, size, CPURegister::kRegister));
-  }
-
-  static Register XRegFromCode(unsigned code);
-  static Register WRegFromCode(unsigned code);
-
-  // Start of V8 compatibility section ---------------------
-  // These memebers are necessary for compilation.
-  // A few of them may be unused for now.
-
-  // We allow crankshaft to use the following registers:
-  //   - x0 to x15
-  //   - x18 to x24
-  //   - x27 (also context)
-  //
-  // TODO(all): Register x25 is currently free and could be available for
-  // crankshaft, but we don't use it as we might use it as a per function
-  // literal pool pointer in the future.
-  //
-  // TODO(all): Consider storing cp in x25 to have only two ranges.
-  // We split allocatable registers in three ranges called
-  //   - "low range"
-  //   - "high range"
-  //   - "context"
-
-  static Register from_code(int code) {
-    // Always return an X register.
-    return Register::Create(code, kXRegSizeInBits);
-  }
-
-  template <int code>
-  static Register from_code() {
-    // Always return an X register.
-    return Register::Create<code, kXRegSizeInBits>();
-  }
-
-  // End of V8 compatibility section -----------------------
-  //
- private:
-  constexpr explicit Register(const CPURegister& r) : CPURegister(r) {}
-};
-
-static_assert(IS_TRIVIALLY_COPYABLE(Register),
-              "Register can efficiently be passed by value");
-
-constexpr bool kPadArguments = true;
-constexpr bool kSimpleFPAliasing = true;
-constexpr bool kSimdMaskRegisters = false;
-
-enum DoubleRegisterCode {
-#define REGISTER_CODE(R) kDoubleCode_##R,
-  DOUBLE_REGISTERS(REGISTER_CODE)
-#undef REGISTER_CODE
-      kDoubleAfterLast
-};
-
-class VRegister : public CPURegister {
- public:
-  static constexpr VRegister no_reg() {
-    return VRegister(CPURegister::no_reg(), 0);
-  }
-
-  template <int code, int size, int lane_count = 1>
-  static constexpr VRegister Create() {
-    static_assert(IsValidLaneCount(lane_count), "Invalid lane count");
-    return VRegister(CPURegister::Create<code, size, kVRegister>(), lane_count);
-  }
-
-  static VRegister Create(int code, int size, int lane_count = 1) {
-    DCHECK(IsValidLaneCount(lane_count));
-    return VRegister(CPURegister::Create(code, size, CPURegister::kVRegister),
-                     lane_count);
-  }
-
-  static VRegister Create(int reg_code, VectorFormat format) {
-    int reg_size = RegisterSizeInBitsFromFormat(format);
-    int reg_count = IsVectorFormat(format) ? LaneCountFromFormat(format) : 1;
-    return VRegister::Create(reg_code, reg_size, reg_count);
-  }
-
-  static VRegister BRegFromCode(unsigned code);
-  static VRegister HRegFromCode(unsigned code);
-  static VRegister SRegFromCode(unsigned code);
-  static VRegister DRegFromCode(unsigned code);
-  static VRegister QRegFromCode(unsigned code);
-  static VRegister VRegFromCode(unsigned code);
-
-  VRegister V8B() const {
-    return VRegister::Create(code(), kDRegSizeInBits, 8);
-  }
-  VRegister V16B() const {
-    return VRegister::Create(code(), kQRegSizeInBits, 16);
-  }
-  VRegister V4H() const {
-    return VRegister::Create(code(), kDRegSizeInBits, 4);
-  }
-  VRegister V8H() const {
-    return VRegister::Create(code(), kQRegSizeInBits, 8);
-  }
-  VRegister V2S() const {
-    return VRegister::Create(code(), kDRegSizeInBits, 2);
-  }
-  VRegister V4S() const {
-    return VRegister::Create(code(), kQRegSizeInBits, 4);
-  }
-  VRegister V2D() const {
-    return VRegister::Create(code(), kQRegSizeInBits, 2);
-  }
-  VRegister V1D() const {
-    return VRegister::Create(code(), kDRegSizeInBits, 1);
-  }
-
-  bool Is8B() const { return (Is64Bits() && (lane_count_ == 8)); }
-  bool Is16B() const { return (Is128Bits() && (lane_count_ == 16)); }
-  bool Is4H() const { return (Is64Bits() && (lane_count_ == 4)); }
-  bool Is8H() const { return (Is128Bits() && (lane_count_ == 8)); }
-  bool Is2S() const { return (Is64Bits() && (lane_count_ == 2)); }
-  bool Is4S() const { return (Is128Bits() && (lane_count_ == 4)); }
-  bool Is1D() const { return (Is64Bits() && (lane_count_ == 1)); }
-  bool Is2D() const { return (Is128Bits() && (lane_count_ == 2)); }
-
-  // For consistency, we assert the number of lanes of these scalar registers,
-  // even though there are no vectors of equivalent total size with which they
-  // could alias.
-  bool Is1B() const {
-    DCHECK(!(Is8Bits() && IsVector()));
-    return Is8Bits();
-  }
-  bool Is1H() const {
-    DCHECK(!(Is16Bits() && IsVector()));
-    return Is16Bits();
-  }
-  bool Is1S() const {
-    DCHECK(!(Is32Bits() && IsVector()));
-    return Is32Bits();
-  }
-
-  bool IsLaneSizeB() const { return LaneSizeInBits() == kBRegSizeInBits; }
-  bool IsLaneSizeH() const { return LaneSizeInBits() == kHRegSizeInBits; }
-  bool IsLaneSizeS() const { return LaneSizeInBits() == kSRegSizeInBits; }
-  bool IsLaneSizeD() const { return LaneSizeInBits() == kDRegSizeInBits; }
-
-  bool IsScalar() const { return lane_count_ == 1; }
-  bool IsVector() const { return lane_count_ > 1; }
-
-  bool IsSameFormat(const VRegister& other) const {
-    return (reg_size_ == other.reg_size_) && (lane_count_ == other.lane_count_);
-  }
-
-  int LaneCount() const { return lane_count_; }
-
-  unsigned LaneSizeInBytes() const { return SizeInBytes() / lane_count_; }
-
-  unsigned LaneSizeInBits() const { return LaneSizeInBytes() * 8; }
-
-  // Start of V8 compatibility section ---------------------
-  static constexpr int kMaxNumRegisters = kNumberOfVRegisters;
-  STATIC_ASSERT(kMaxNumRegisters == kDoubleAfterLast);
-
-  // Crankshaft can use all the V registers except:
-  //   - d15 which is used to keep the 0 double value
-  //   - d30 which is used in crankshaft as a double scratch register
-  //   - d31 which is used in the MacroAssembler as a double scratch register
-  static VRegister from_code(int code) {
-    // Always return a D register.
-    return VRegister::Create(code, kDRegSizeInBits);
-  }
-  // End of V8 compatibility section -----------------------
-
- private:
-  int lane_count_;
-
-  constexpr explicit VRegister(const CPURegister& r, int lane_count)
-      : CPURegister(r), lane_count_(lane_count) {}
-
-  static constexpr bool IsValidLaneCount(int lane_count) {
-    return base::bits::IsPowerOfTwo(lane_count) && lane_count <= 16;
-  }
-};
-
-static_assert(IS_TRIVIALLY_COPYABLE(VRegister),
-              "VRegister can efficiently be passed by value");
-
-// No*Reg is used to indicate an unused argument, or an error case. Note that
-// these all compare equal (using the Is() method). The Register and VRegister
-// variants are provided for convenience.
-constexpr Register NoReg = Register::no_reg();
-constexpr VRegister NoVReg = VRegister::no_reg();
-constexpr CPURegister NoCPUReg = CPURegister::no_reg();
-
-// v8 compatibility.
-constexpr Register no_reg = NoReg;
-
-#define DEFINE_REGISTER(register_class, name, ...) \
-  constexpr register_class name = register_class::Create<__VA_ARGS__>()
-#define ALIAS_REGISTER(register_class, alias, name) \
-  constexpr register_class alias = name
-
-#define DEFINE_REGISTERS(N)                            \
-  DEFINE_REGISTER(Register, w##N, N, kWRegSizeInBits); \
-  DEFINE_REGISTER(Register, x##N, N, kXRegSizeInBits);
-GENERAL_REGISTER_CODE_LIST(DEFINE_REGISTERS)
-#undef DEFINE_REGISTERS
-
-DEFINE_REGISTER(Register, wcsp, kSPRegInternalCode, kWRegSizeInBits);
-DEFINE_REGISTER(Register, csp, kSPRegInternalCode, kXRegSizeInBits);
-
-#define DEFINE_VREGISTERS(N)                            \
-  DEFINE_REGISTER(VRegister, b##N, N, kBRegSizeInBits); \
-  DEFINE_REGISTER(VRegister, h##N, N, kHRegSizeInBits); \
-  DEFINE_REGISTER(VRegister, s##N, N, kSRegSizeInBits); \
-  DEFINE_REGISTER(VRegister, d##N, N, kDRegSizeInBits); \
-  DEFINE_REGISTER(VRegister, q##N, N, kQRegSizeInBits); \
-  DEFINE_REGISTER(VRegister, v##N, N, kQRegSizeInBits);
-GENERAL_REGISTER_CODE_LIST(DEFINE_VREGISTERS)
-#undef DEFINE_VREGISTERS
-
-#undef DEFINE_REGISTER
-
-// Registers aliases.
-ALIAS_REGISTER(VRegister, v8_, v8);  // Avoid conflicts with namespace v8.
-ALIAS_REGISTER(Register, ip0, x16);
-ALIAS_REGISTER(Register, ip1, x17);
-ALIAS_REGISTER(Register, wip0, w16);
-ALIAS_REGISTER(Register, wip1, w17);
-// Root register.
-ALIAS_REGISTER(Register, root, x26);
-ALIAS_REGISTER(Register, rr, x26);
-// Context pointer register.
-ALIAS_REGISTER(Register, cp, x27);
-ALIAS_REGISTER(Register, fp, x29);
-ALIAS_REGISTER(Register, lr, x30);
-ALIAS_REGISTER(Register, xzr, x31);
-ALIAS_REGISTER(Register, wzr, w31);
-
-// Register used for padding stack slots.
-ALIAS_REGISTER(Register, padreg, x31);
-
-// Keeps the 0 double value.
-ALIAS_REGISTER(VRegister, fp_zero, d15);
-// MacroAssembler fixed V Registers.
-ALIAS_REGISTER(VRegister, fp_fixed1, d27);
-ALIAS_REGISTER(VRegister, fp_fixed2, d28);
-ALIAS_REGISTER(VRegister, fp_fixed3, d29);  // same as Crankshaft scratch.
-// Crankshaft double scratch register.
-ALIAS_REGISTER(VRegister, crankshaft_fp_scratch, d29);
-// MacroAssembler scratch V registers.
-ALIAS_REGISTER(VRegister, fp_scratch, d30);
-ALIAS_REGISTER(VRegister, fp_scratch1, d30);
-ALIAS_REGISTER(VRegister, fp_scratch2, d31);
-
-#undef ALIAS_REGISTER
-
-// AreAliased returns true if any of the named registers overlap. Arguments set
-// to NoReg are ignored. The system stack pointer may be specified.
-bool AreAliased(const CPURegister& reg1,
-                const CPURegister& reg2,
-                const CPURegister& reg3 = NoReg,
-                const CPURegister& reg4 = NoReg,
-                const CPURegister& reg5 = NoReg,
-                const CPURegister& reg6 = NoReg,
-                const CPURegister& reg7 = NoReg,
-                const CPURegister& reg8 = NoReg);
-
-// AreSameSizeAndType returns true if all of the specified registers have the
-// same size, and are of the same type. The system stack pointer may be
-// specified. Arguments set to NoReg are ignored, as are any subsequent
-// arguments. At least one argument (reg1) must be valid (not NoCPUReg).
-bool AreSameSizeAndType(const CPURegister& reg1,
-                        const CPURegister& reg2,
-                        const CPURegister& reg3 = NoCPUReg,
-                        const CPURegister& reg4 = NoCPUReg,
-                        const CPURegister& reg5 = NoCPUReg,
-                        const CPURegister& reg6 = NoCPUReg,
-                        const CPURegister& reg7 = NoCPUReg,
-                        const CPURegister& reg8 = NoCPUReg);
-
-// AreSameFormat returns true if all of the specified VRegisters have the same
-// vector format. Arguments set to NoVReg are ignored, as are any subsequent
-// arguments. At least one argument (reg1) must be valid (not NoVReg).
-bool AreSameFormat(const VRegister& reg1, const VRegister& reg2,
-                   const VRegister& reg3 = NoVReg,
-                   const VRegister& reg4 = NoVReg);
-
-// AreConsecutive returns true if all of the specified VRegisters are
-// consecutive in the register file. Arguments may be set to NoVReg, and if so,
-// subsequent arguments must also be NoVReg. At least one argument (reg1) must
-// be valid (not NoVReg).
-bool AreConsecutive(const VRegister& reg1, const VRegister& reg2,
-                    const VRegister& reg3 = NoVReg,
-                    const VRegister& reg4 = NoVReg);
-
-typedef VRegister FloatRegister;
-typedef VRegister DoubleRegister;
-typedef VRegister Simd128Register;
-
-// -----------------------------------------------------------------------------
-// Lists of registers.
-class CPURegList {
- public:
-  explicit CPURegList(CPURegister reg1, CPURegister reg2 = NoCPUReg,
-                      CPURegister reg3 = NoCPUReg, CPURegister reg4 = NoCPUReg)
-      : list_(reg1.bit() | reg2.bit() | reg3.bit() | reg4.bit()),
-        size_(reg1.SizeInBits()),
-        type_(reg1.type()) {
-    DCHECK(AreSameSizeAndType(reg1, reg2, reg3, reg4));
-    DCHECK(IsValid());
-  }
-
-  CPURegList(CPURegister::RegisterType type, int size, RegList list)
-      : list_(list), size_(size), type_(type) {
-    DCHECK(IsValid());
-  }
-
-  CPURegList(CPURegister::RegisterType type, int size, int first_reg,
-             int last_reg)
-      : size_(size), type_(type) {
-    DCHECK(
-        ((type == CPURegister::kRegister) && (last_reg < kNumberOfRegisters)) ||
-        ((type == CPURegister::kVRegister) &&
-         (last_reg < kNumberOfVRegisters)));
-    DCHECK(last_reg >= first_reg);
-    list_ = (1UL << (last_reg + 1)) - 1;
-    list_ &= ~((1UL << first_reg) - 1);
-    DCHECK(IsValid());
-  }
-
-  CPURegister::RegisterType type() const {
-    DCHECK(IsValid());
-    return type_;
-  }
-
-  RegList list() const {
-    DCHECK(IsValid());
-    return list_;
-  }
-
-  inline void set_list(RegList new_list) {
-    DCHECK(IsValid());
-    list_ = new_list;
-  }
-
-  // Combine another CPURegList into this one. Registers that already exist in
-  // this list are left unchanged. The type and size of the registers in the
-  // 'other' list must match those in this list.
-  void Combine(const CPURegList& other);
-
-  // Remove every register in the other CPURegList from this one. Registers that
-  // do not exist in this list are ignored. The type of the registers in the
-  // 'other' list must match those in this list.
-  void Remove(const CPURegList& other);
-
-  // Variants of Combine and Remove which take CPURegisters.
-  void Combine(const CPURegister& other);
-  void Remove(const CPURegister& other1,
-              const CPURegister& other2 = NoCPUReg,
-              const CPURegister& other3 = NoCPUReg,
-              const CPURegister& other4 = NoCPUReg);
-
-  // Variants of Combine and Remove which take a single register by its code;
-  // the type and size of the register is inferred from this list.
-  void Combine(int code);
-  void Remove(int code);
-
-  // Remove all callee-saved registers from the list. This can be useful when
-  // preparing registers for an AAPCS64 function call, for example.
-  void RemoveCalleeSaved();
-
-  CPURegister PopLowestIndex();
-  CPURegister PopHighestIndex();
-
-  // AAPCS64 callee-saved registers.
-  static CPURegList GetCalleeSaved(int size = kXRegSizeInBits);
-  static CPURegList GetCalleeSavedV(int size = kDRegSizeInBits);
-
-  // AAPCS64 caller-saved registers. Note that this includes lr.
-  // TODO(all): Determine how we handle d8-d15 being callee-saved, but the top
-  // 64-bits being caller-saved.
-  static CPURegList GetCallerSaved(int size = kXRegSizeInBits);
-  static CPURegList GetCallerSavedV(int size = kDRegSizeInBits);
-
-  // Registers saved as safepoints.
-  static CPURegList GetSafepointSavedRegisters();
-
-  bool IsEmpty() const {
-    DCHECK(IsValid());
-    return list_ == 0;
-  }
-
-  bool IncludesAliasOf(const CPURegister& other1,
-                       const CPURegister& other2 = NoCPUReg,
-                       const CPURegister& other3 = NoCPUReg,
-                       const CPURegister& other4 = NoCPUReg) const {
-    DCHECK(IsValid());
-    RegList list = 0;
-    if (!other1.IsNone() && (other1.type() == type_)) list |= other1.bit();
-    if (!other2.IsNone() && (other2.type() == type_)) list |= other2.bit();
-    if (!other3.IsNone() && (other3.type() == type_)) list |= other3.bit();
-    if (!other4.IsNone() && (other4.type() == type_)) list |= other4.bit();
-    return (list_ & list) != 0;
-  }
-
-  int Count() const {
-    DCHECK(IsValid());
-    return CountSetBits(list_, kRegListSizeInBits);
-  }
-
-  int RegisterSizeInBits() const {
-    DCHECK(IsValid());
-    return size_;
-  }
-
-  int RegisterSizeInBytes() const {
-    int size_in_bits = RegisterSizeInBits();
-    DCHECK_EQ(size_in_bits % kBitsPerByte, 0);
-    return size_in_bits / kBitsPerByte;
-  }
-
-  int TotalSizeInBytes() const {
-    DCHECK(IsValid());
-    return RegisterSizeInBytes() * Count();
-  }
-
- private:
-  RegList list_;
-  int size_;
-  CPURegister::RegisterType type_;
-
-  bool IsValid() const {
-    const RegList kValidRegisters = 0x8000000ffffffff;
-    const RegList kValidVRegisters = 0x0000000ffffffff;
-    switch (type_) {
-      case CPURegister::kRegister:
-        return (list_ & kValidRegisters) == list_;
-      case CPURegister::kVRegister:
-        return (list_ & kValidVRegisters) == list_;
-      case CPURegister::kNoRegister:
-        return list_ == 0;
-      default:
-        UNREACHABLE();
-    }
-  }
-};
-
-
-// AAPCS64 callee-saved registers.
-#define kCalleeSaved CPURegList::GetCalleeSaved()
-#define kCalleeSavedV CPURegList::GetCalleeSavedV()
-
-// AAPCS64 caller-saved registers. Note that this includes lr.
-#define kCallerSaved CPURegList::GetCallerSaved()
-#define kCallerSavedV CPURegList::GetCallerSavedV()
-
-// -----------------------------------------------------------------------------
-// Immediates.
-class Immediate {
- public:
-  template<typename T>
-  inline explicit Immediate(Handle<T> handle);
-
-  // This is allowed to be an implicit constructor because Immediate is
-  // a wrapper class that doesn't normally perform any type conversion.
-  template<typename T>
-  inline Immediate(T value);  // NOLINT(runtime/explicit)
-
-  template<typename T>
-  inline Immediate(T value, RelocInfo::Mode rmode);
-
-  int64_t value() const { return value_; }
-  RelocInfo::Mode rmode() const { return rmode_; }
-
- private:
-  void InitializeHandle(Handle<HeapObject> value);
-
-  int64_t value_;
-  RelocInfo::Mode rmode_;
-};
-
-
-// -----------------------------------------------------------------------------
-// Operands.
-constexpr int kSmiShift = kSmiTagSize + kSmiShiftSize;
-constexpr uint64_t kSmiShiftMask = (1UL << kSmiShift) - 1;
-
-// Represents an operand in a machine instruction.
-class Operand {
-  // TODO(all): If necessary, study more in details which methods
-  // TODO(all): should be inlined or not.
- public:
-  // rm, {<shift> {#<shift_amount>}}
-  // where <shift> is one of {LSL, LSR, ASR, ROR}.
-  //       <shift_amount> is uint6_t.
-  // This is allowed to be an implicit constructor because Operand is
-  // a wrapper class that doesn't normally perform any type conversion.
-  inline Operand(Register reg,
-                 Shift shift = LSL,
-                 unsigned shift_amount = 0);  // NOLINT(runtime/explicit)
-
-  // rm, <extend> {#<shift_amount>}
-  // where <extend> is one of {UXTB, UXTH, UXTW, UXTX, SXTB, SXTH, SXTW, SXTX}.
-  //       <shift_amount> is uint2_t.
-  inline Operand(Register reg,
-                 Extend extend,
-                 unsigned shift_amount = 0);
-
-  static Operand EmbeddedNumber(double number);  // Smi or HeapNumber.
-  static Operand EmbeddedCode(CodeStub* stub);
-
-  inline bool IsHeapObjectRequest() const;
-  inline HeapObjectRequest heap_object_request() const;
-  inline Immediate immediate_for_heap_object_request() const;
-
-  template<typename T>
-  inline explicit Operand(Handle<T> handle);
-
-  // Implicit constructor for all int types, ExternalReference, and Smi.
-  template<typename T>
-  inline Operand(T t);  // NOLINT(runtime/explicit)
-
-  // Implicit constructor for int types.
-  template<typename T>
-  inline Operand(T t, RelocInfo::Mode rmode);
-
-  inline bool IsImmediate() const;
-  inline bool IsShiftedRegister() const;
-  inline bool IsExtendedRegister() const;
-  inline bool IsZero() const;
-
-  // This returns an LSL shift (<= 4) operand as an equivalent extend operand,
-  // which helps in the encoding of instructions that use the stack pointer.
-  inline Operand ToExtendedRegister() const;
-
-  inline Immediate immediate() const;
-  inline int64_t ImmediateValue() const;
-  inline Register reg() const;
-  inline Shift shift() const;
-  inline Extend extend() const;
-  inline unsigned shift_amount() const;
-
-  // Relocation information.
-  bool NeedsRelocation(const Assembler* assembler) const;
-
-  // Helpers
-  inline static Operand UntagSmi(Register smi);
-  inline static Operand UntagSmiAndScale(Register smi, int scale);
-
- private:
-  base::Optional<HeapObjectRequest> heap_object_request_;
-  Immediate immediate_;
-  Register reg_;
-  Shift shift_;
-  Extend extend_;
-  unsigned shift_amount_;
-};
-
-
-// MemOperand represents a memory operand in a load or store instruction.
-class MemOperand {
- public:
-  inline MemOperand();
-  inline explicit MemOperand(Register base,
-                             int64_t offset = 0,
-                             AddrMode addrmode = Offset);
-  inline explicit MemOperand(Register base,
-                             Register regoffset,
-                             Shift shift = LSL,
-                             unsigned shift_amount = 0);
-  inline explicit MemOperand(Register base,
-                             Register regoffset,
-                             Extend extend,
-                             unsigned shift_amount = 0);
-  inline explicit MemOperand(Register base,
-                             const Operand& offset,
-                             AddrMode addrmode = Offset);
-
-  const Register& base() const { return base_; }
-  const Register& regoffset() const { return regoffset_; }
-  int64_t offset() const { return offset_; }
-  AddrMode addrmode() const { return addrmode_; }
-  Shift shift() const { return shift_; }
-  Extend extend() const { return extend_; }
-  unsigned shift_amount() const { return shift_amount_; }
-  inline bool IsImmediateOffset() const;
-  inline bool IsRegisterOffset() const;
-  inline bool IsPreIndex() const;
-  inline bool IsPostIndex() const;
-
-  // For offset modes, return the offset as an Operand. This helper cannot
-  // handle indexed modes.
-  inline Operand OffsetAsOperand() const;
-
-  enum PairResult {
-    kNotPair,   // Can't use a pair instruction.
-    kPairAB,    // Can use a pair instruction (operandA has lower address).
-    kPairBA     // Can use a pair instruction (operandB has lower address).
-  };
-  // Check if two MemOperand are consistent for stp/ldp use.
-  static PairResult AreConsistentForPair(const MemOperand& operandA,
-                                         const MemOperand& operandB,
-                                         int access_size_log2 = kXRegSizeLog2);
-
- private:
-  Register base_;
-  Register regoffset_;
-  int64_t offset_;
-  AddrMode addrmode_;
-  Shift shift_;
-  Extend extend_;
-  unsigned shift_amount_;
-};
-
-
-class ConstPool {
- public:
-  explicit ConstPool(Assembler* assm) : assm_(assm), first_use_(-1) {}
-  // Returns true when we need to write RelocInfo and false when we do not.
-  bool RecordEntry(intptr_t data, RelocInfo::Mode mode);
-  int EntryCount() const { return static_cast<int>(entries_.size()); }
-  bool IsEmpty() const { return entries_.empty(); }
-  // Distance in bytes between the current pc and the first instruction
-  // using the pool. If there are no pending entries return kMaxInt.
-  int DistanceToFirstUse();
-  // Offset after which instructions using the pool will be out of range.
-  int MaxPcOffset();
-  // Maximum size the constant pool can be with current entries. It always
-  // includes alignment padding and branch over.
-  int WorstCaseSize();
-  // Size in bytes of the literal pool *if* it is emitted at the current
-  // pc. The size will include the branch over the pool if it was requested.
-  int SizeIfEmittedAtCurrentPc(bool require_jump);
-  // Emit the literal pool at the current pc with a branch over the pool if
-  // requested.
-  void Emit(bool require_jump);
-  // Discard any pending pool entries.
-  void Clear();
-
- private:
-  bool CanBeShared(RelocInfo::Mode mode);
-  void EmitMarker();
-  void EmitGuard();
-  void EmitEntries();
-
-  typedef std::map<uint64_t, int> SharedEntryMap;
-  // Adds a shared entry to entries_, using 'entry_map' to determine whether we
-  // already track this entry. Returns true if this is the first time we add
-  // this entry, false otherwise.
-  bool AddSharedEntry(SharedEntryMap& entry_map, uint64_t data, int offset);
-
-  Assembler* assm_;
-  // Keep track of the first instruction requiring a constant pool entry
-  // since the previous constant pool was emitted.
-  int first_use_;
-
-  // Map of data to index in entries_ for shared entries.
-  SharedEntryMap shared_entries_;
-
-  // Map of address of handle to index in entries_. We need to keep track of
-  // code targets separately from other shared entries, as they can be
-  // relocated.
-  SharedEntryMap handle_to_index_map_;
-
-  // Values, pc offset(s) of entries. Use a vector to preserve the order of
-  // insertion, as the serializer expects code target RelocInfo to point to
-  // constant pool addresses in an ascending order.
-  std::vector<std::pair<uint64_t, std::vector<int> > > entries_;
-};
-
-
-// -----------------------------------------------------------------------------
-// Assembler.
-
-class Assembler : public AssemblerBase {
- public:
-  // Create an assembler. Instructions and relocation information are emitted
-  // into a buffer, with the instructions starting from the beginning and the
-  // relocation information starting from the end of the buffer. See CodeDesc
-  // for a detailed comment on the layout (globals.h).
-  //
-  // If the provided buffer is nullptr, the assembler allocates and grows its
-  // own buffer, and buffer_size determines the initial buffer size. The buffer
-  // is owned by the assembler and deallocated upon destruction of the
-  // assembler.
-  //
-  // If the provided buffer is not nullptr, the assembler uses the provided
-  // buffer for code generation and assumes its size to be buffer_size. If the
-  // buffer is too small, a fatal error occurs. No deallocation of the buffer is
-  // done upon destruction of the assembler.
-  Assembler(Isolate* isolate, void* buffer, int buffer_size)
-      : Assembler(IsolateData(isolate), buffer, buffer_size) {}
-  Assembler(IsolateData isolate_data, void* buffer, int buffer_size);
-
-  virtual ~Assembler();
-
-  virtual void AbortedCodeGeneration() {
-    constpool_.Clear();
-  }
-
-  // System functions ---------------------------------------------------------
-  // Start generating code from the beginning of the buffer, discarding any code
-  // and data that has already been emitted into the buffer.
-  //
-  // In order to avoid any accidental transfer of state, Reset DCHECKs that the
-  // constant pool is not blocked.
-  void Reset();
-
-  // GetCode emits any pending (non-emitted) code and fills the descriptor
-  // desc. GetCode() is idempotent; it returns the same result if no other
-  // Assembler functions are invoked in between GetCode() calls.
-  //
-  // The descriptor (desc) can be nullptr. In that case, the code is finalized
-  // as usual, but the descriptor is not populated.
-  void GetCode(Isolate* isolate, CodeDesc* desc);
-
-  // Insert the smallest number of nop instructions
-  // possible to align the pc offset to a multiple
-  // of m. m must be a power of 2 (>= 4).
-  void Align(int m);
-  // Insert the smallest number of zero bytes possible to align the pc offset
-  // to a mulitple of m. m must be a power of 2 (>= 2).
-  void DataAlign(int m);
-
-  inline void Unreachable();
-
-  // Label --------------------------------------------------------------------
-  // Bind a label to the current pc. Note that labels can only be bound once,
-  // and if labels are linked to other instructions, they _must_ be bound
-  // before they go out of scope.
-  void bind(Label* label);
-
-
-  // RelocInfo and pools ------------------------------------------------------
-
-  // Record relocation information for current pc_.
-  void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0);
-
-  // Return the address in the constant pool of the code target address used by
-  // the branch/call instruction at pc.
-  inline static Address target_pointer_address_at(Address pc);
-
-  // Read/Modify the code target address in the branch/call instruction at pc.
-  // The isolate argument is unused (and may be nullptr) when skipping flushing.
-  inline static Address target_address_at(Address pc, Address constant_pool);
-  inline static void set_target_address_at(
-      Isolate* isolate, Address pc, Address constant_pool, Address target,
-      ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED);
-
-  // Return the code target address at a call site from the return address of
-  // that call in the instruction stream.
-  inline static Address target_address_from_return_address(Address pc);
-
-  // Given the address of the beginning of a call, return the address in the
-  // instruction stream that call will return from.
-  inline static Address return_address_from_call_start(Address pc);
-
-  // This sets the branch destination (which is in the constant pool on ARM).
-  // This is for calls and branches within generated code.
-  inline static void deserialization_set_special_target_at(
-      Isolate* isolate, Address constant_pool_entry, Code* code,
-      Address target);
-
-  // This sets the internal reference at the pc.
-  inline static void deserialization_set_target_internal_reference_at(
-      Isolate* isolate, Address pc, Address target,
-      RelocInfo::Mode mode = RelocInfo::INTERNAL_REFERENCE);
-
-  // All addresses in the constant pool are the same size as pointers.
-  static constexpr int kSpecialTargetSize = kPointerSize;
-
-  // The sizes of the call sequences emitted by MacroAssembler::Call.
-  // Wherever possible, use MacroAssembler::CallSize instead of these constants,
-  // as it will choose the correct value for a given relocation mode.
-  //
-  // Without relocation:
-  //  movz  temp, #(target & 0x000000000000ffff)
-  //  movk  temp, #(target & 0x00000000ffff0000)
-  //  movk  temp, #(target & 0x0000ffff00000000)
-  //  blr   temp
-  //
-  // With relocation:
-  //  ldr   temp, =target
-  //  blr   temp
-  static constexpr int kCallSizeWithoutRelocation = 4 * kInstructionSize;
-  static constexpr int kCallSizeWithRelocation = 2 * kInstructionSize;
-
-  // Size of the generated code in bytes
-  uint64_t SizeOfGeneratedCode() const {
-    DCHECK((pc_ >= buffer_) && (pc_ < (buffer_ + buffer_size_)));
-    return pc_ - buffer_;
-  }
-
-  // Return the code size generated from label to the current position.
-  uint64_t SizeOfCodeGeneratedSince(const Label* label) {
-    DCHECK(label->is_bound());
-    DCHECK(pc_offset() >= label->pos());
-    DCHECK(pc_offset() < buffer_size_);
-    return pc_offset() - label->pos();
-  }
-
-  // Check the size of the code generated since the given label. This function
-  // is used primarily to work around comparisons between signed and unsigned
-  // quantities, since V8 uses both.
-  // TODO(jbramley): Work out what sign to use for these things and if possible,
-  // change things to be consistent.
-  void AssertSizeOfCodeGeneratedSince(const Label* label, ptrdiff_t size) {
-    DCHECK_GE(size, 0);
-    DCHECK(static_cast<uint64_t>(size) == SizeOfCodeGeneratedSince(label));
-  }
-
-  // Return the number of instructions generated from label to the
-  // current position.
-  uint64_t InstructionsGeneratedSince(const Label* label) {
-    return SizeOfCodeGeneratedSince(label) / kInstructionSize;
-  }
-
-  // Prevent contant pool emission until EndBlockConstPool is called.
-  // Call to this function can be nested but must be followed by an equal
-  // number of calls to EndBlockConstpool.
-  void StartBlockConstPool();
-
-  // Resume constant pool emission. Need to be called as many time as
-  // StartBlockConstPool to have an effect.
-  void EndBlockConstPool();
-
-  bool is_const_pool_blocked() const;
-  static bool IsConstantPoolAt(Instruction* instr);
-  static int ConstantPoolSizeAt(Instruction* instr);
-  // See Assembler::CheckConstPool for more info.
-  void EmitPoolGuard();
-
-  // Prevent veneer pool emission until EndBlockVeneerPool is called.
-  // Call to this function can be nested but must be followed by an equal
-  // number of calls to EndBlockConstpool.
-  void StartBlockVeneerPool();
-
-  // Resume constant pool emission. Need to be called as many time as
-  // StartBlockVeneerPool to have an effect.
-  void EndBlockVeneerPool();
-
-  bool is_veneer_pool_blocked() const {
-    return veneer_pool_blocked_nesting_ > 0;
-  }
-
-  // Block/resume emission of constant pools and veneer pools.
-  void StartBlockPools() {
-    StartBlockConstPool();
-    StartBlockVeneerPool();
-  }
-  void EndBlockPools() {
-    EndBlockConstPool();
-    EndBlockVeneerPool();
-  }
-
-  // Debugging ----------------------------------------------------------------
-  void RecordComment(const char* msg);
-
-  // Record a deoptimization reason that can be used by a log or cpu profiler.
-  // Use --trace-deopt to enable.
-  void RecordDeoptReason(DeoptimizeReason reason, SourcePosition position,
-                         int id);
-
-  int buffer_space() const;
-
-  // Record the emission of a constant pool.
-  //
-  // The emission of constant and veneer pools depends on the size of the code
-  // generated and the number of RelocInfo recorded.
-  // The Debug mechanism needs to map code offsets between two versions of a
-  // function, compiled with and without debugger support (see for example
-  // Debug::PrepareForBreakPoints()).
-  // Compiling functions with debugger support generates additional code
-  // (DebugCodegen::GenerateSlot()). This may affect the emission of the pools
-  // and cause the version of the code with debugger support to have pools
-  // generated in different places.
-  // Recording the position and size of emitted pools allows to correctly
-  // compute the offset mappings between the different versions of a function in
-  // all situations.
-  //
-  // The parameter indicates the size of the pool (in bytes), including
-  // the marker and branch over the data.
-  void RecordConstPool(int size);
-
-  // Instruction set functions ------------------------------------------------
-
-  // Branch / Jump instructions.
-  // For branches offsets are scaled, i.e. they in instrcutions not in bytes.
-  // Branch to register.
-  void br(const Register& xn);
-
-  // Branch-link to register.
-  void blr(const Register& xn);
-
-  // Branch to register with return hint.
-  void ret(const Register& xn = lr);
-
-  // Unconditional branch to label.
-  void b(Label* label);
-
-  // Conditional branch to label.
-  void b(Label* label, Condition cond);
-
-  // Unconditional branch to PC offset.
-  void b(int imm26);
-
-  // Conditional branch to PC offset.
-  void b(int imm19, Condition cond);
-
-  // Branch-link to label / pc offset.
-  void bl(Label* label);
-  void bl(int imm26);
-
-  // Compare and branch to label / pc offset if zero.
-  void cbz(const Register& rt, Label* label);
-  void cbz(const Register& rt, int imm19);
-
-  // Compare and branch to label / pc offset if not zero.
-  void cbnz(const Register& rt, Label* label);
-  void cbnz(const Register& rt, int imm19);
-
-  // Test bit and branch to label / pc offset if zero.
-  void tbz(const Register& rt, unsigned bit_pos, Label* label);
-  void tbz(const Register& rt, unsigned bit_pos, int imm14);
-
-  // Test bit and branch to label / pc offset if not zero.
-  void tbnz(const Register& rt, unsigned bit_pos, Label* label);
-  void tbnz(const Register& rt, unsigned bit_pos, int imm14);
-
-  // Address calculation instructions.
-  // Calculate a PC-relative address. Unlike for branches the offset in adr is
-  // unscaled (i.e. the result can be unaligned).
-  void adr(const Register& rd, Label* label);
-  void adr(const Register& rd, int imm21);
-
-  // Data Processing instructions.
-  // Add.
-  void add(const Register& rd,
-           const Register& rn,
-           const Operand& operand);
-
-  // Add and update status flags.
-  void adds(const Register& rd,
-            const Register& rn,
-            const Operand& operand);
-
-  // Compare negative.
-  void cmn(const Register& rn, const Operand& operand);
-
-  // Subtract.
-  void sub(const Register& rd,
-           const Register& rn,
-           const Operand& operand);
-
-  // Subtract and update status flags.
-  void subs(const Register& rd,
-            const Register& rn,
-            const Operand& operand);
-
-  // Compare.
-  void cmp(const Register& rn, const Operand& operand);
-
-  // Negate.
-  void neg(const Register& rd,
-           const Operand& operand);
-
-  // Negate and update status flags.
-  void negs(const Register& rd,
-            const Operand& operand);
-
-  // Add with carry bit.
-  void adc(const Register& rd,
-           const Register& rn,
-           const Operand& operand);
-
-  // Add with carry bit and update status flags.
-  void adcs(const Register& rd,
-            const Register& rn,
-            const Operand& operand);
-
-  // Subtract with carry bit.
-  void sbc(const Register& rd,
-           const Register& rn,
-           const Operand& operand);
-
-  // Subtract with carry bit and update status flags.
-  void sbcs(const Register& rd,
-            const Register& rn,
-            const Operand& operand);
-
-  // Negate with carry bit.
-  void ngc(const Register& rd,
-           const Operand& operand);
-
-  // Negate with carry bit and update status flags.
-  void ngcs(const Register& rd,
-            const Operand& operand);
-
-  // Logical instructions.
-  // Bitwise and (A & B).
-  void and_(const Register& rd,
-            const Register& rn,
-            const Operand& operand);
-
-  // Bitwise and (A & B) and update status flags.
-  void ands(const Register& rd,
-            const Register& rn,
-            const Operand& operand);
-
-  // Bit test, and set flags.
-  void tst(const Register& rn, const Operand& operand);
-
-  // Bit clear (A & ~B).
-  void bic(const Register& rd,
-           const Register& rn,
-           const Operand& operand);
-
-  // Bit clear (A & ~B) and update status flags.
-  void bics(const Register& rd,
-            const Register& rn,
-            const Operand& operand);
-
-  // Bitwise and.
-  void and_(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Bit clear immediate.
-  void bic(const VRegister& vd, const int imm8, const int left_shift = 0);
-
-  // Bit clear.
-  void bic(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Bitwise insert if false.
-  void bif(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Bitwise insert if true.
-  void bit(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Bitwise select.
-  void bsl(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Polynomial multiply.
-  void pmul(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Vector move immediate.
-  void movi(const VRegister& vd, const uint64_t imm, Shift shift = LSL,
-            const int shift_amount = 0);
-
-  // Bitwise not.
-  void mvn(const VRegister& vd, const VRegister& vn);
-
-  // Vector move inverted immediate.
-  void mvni(const VRegister& vd, const int imm8, Shift shift = LSL,
-            const int shift_amount = 0);
-
-  // Signed saturating accumulate of unsigned value.
-  void suqadd(const VRegister& vd, const VRegister& vn);
-
-  // Unsigned saturating accumulate of signed value.
-  void usqadd(const VRegister& vd, const VRegister& vn);
-
-  // Absolute value.
-  void abs(const VRegister& vd, const VRegister& vn);
-
-  // Signed saturating absolute value.
-  void sqabs(const VRegister& vd, const VRegister& vn);
-
-  // Negate.
-  void neg(const VRegister& vd, const VRegister& vn);
-
-  // Signed saturating negate.
-  void sqneg(const VRegister& vd, const VRegister& vn);
-
-  // Bitwise not.
-  void not_(const VRegister& vd, const VRegister& vn);
-
-  // Extract narrow.
-  void xtn(const VRegister& vd, const VRegister& vn);
-
-  // Extract narrow (second part).
-  void xtn2(const VRegister& vd, const VRegister& vn);
-
-  // Signed saturating extract narrow.
-  void sqxtn(const VRegister& vd, const VRegister& vn);
-
-  // Signed saturating extract narrow (second part).
-  void sqxtn2(const VRegister& vd, const VRegister& vn);
-
-  // Unsigned saturating extract narrow.
-  void uqxtn(const VRegister& vd, const VRegister& vn);
-
-  // Unsigned saturating extract narrow (second part).
-  void uqxtn2(const VRegister& vd, const VRegister& vn);
-
-  // Signed saturating extract unsigned narrow.
-  void sqxtun(const VRegister& vd, const VRegister& vn);
-
-  // Signed saturating extract unsigned narrow (second part).
-  void sqxtun2(const VRegister& vd, const VRegister& vn);
-
-  // Move register to register.
-  void mov(const VRegister& vd, const VRegister& vn);
-
-  // Bitwise not or.
-  void orn(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Bitwise exclusive or.
-  void eor(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Bitwise or (A | B).
-  void orr(const Register& rd, const Register& rn, const Operand& operand);
-
-  // Bitwise or.
-  void orr(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Bitwise or immediate.
-  void orr(const VRegister& vd, const int imm8, const int left_shift = 0);
-
-  // Bitwise nor (A | ~B).
-  void orn(const Register& rd, const Register& rn, const Operand& operand);
-
-  // Bitwise eor/xor (A ^ B).
-  void eor(const Register& rd, const Register& rn, const Operand& operand);
-
-  // Bitwise enor/xnor (A ^ ~B).
-  void eon(const Register& rd, const Register& rn, const Operand& operand);
-
-  // Logical shift left variable.
-  void lslv(const Register& rd, const Register& rn, const Register& rm);
-
-  // Logical shift right variable.
-  void lsrv(const Register& rd, const Register& rn, const Register& rm);
-
-  // Arithmetic shift right variable.
-  void asrv(const Register& rd, const Register& rn, const Register& rm);
-
-  // Rotate right variable.
-  void rorv(const Register& rd, const Register& rn, const Register& rm);
-
-  // Bitfield instructions.
-  // Bitfield move.
-  void bfm(const Register& rd, const Register& rn, int immr, int imms);
-
-  // Signed bitfield move.
-  void sbfm(const Register& rd, const Register& rn, int immr, int imms);
-
-  // Unsigned bitfield move.
-  void ubfm(const Register& rd, const Register& rn, int immr, int imms);
-
-  // Bfm aliases.
-  // Bitfield insert.
-  void bfi(const Register& rd, const Register& rn, int lsb, int width) {
-    DCHECK_GE(width, 1);
-    DCHECK(lsb + width <= rn.SizeInBits());
-    bfm(rd, rn, (rd.SizeInBits() - lsb) & (rd.SizeInBits() - 1), width - 1);
-  }
-
-  // Bitfield extract and insert low.
-  void bfxil(const Register& rd, const Register& rn, int lsb, int width) {
-    DCHECK_GE(width, 1);
-    DCHECK(lsb + width <= rn.SizeInBits());
-    bfm(rd, rn, lsb, lsb + width - 1);
-  }
-
-  // Sbfm aliases.
-  // Arithmetic shift right.
-  void asr(const Register& rd, const Register& rn, int shift) {
-    DCHECK(shift < rd.SizeInBits());
-    sbfm(rd, rn, shift, rd.SizeInBits() - 1);
-  }
-
-  // Signed bitfield insert in zero.
-  void sbfiz(const Register& rd, const Register& rn, int lsb, int width) {
-    DCHECK_GE(width, 1);
-    DCHECK(lsb + width <= rn.SizeInBits());
-    sbfm(rd, rn, (rd.SizeInBits() - lsb) & (rd.SizeInBits() - 1), width - 1);
-  }
-
-  // Signed bitfield extract.
-  void sbfx(const Register& rd, const Register& rn, int lsb, int width) {
-    DCHECK_GE(width, 1);
-    DCHECK(lsb + width <= rn.SizeInBits());
-    sbfm(rd, rn, lsb, lsb + width - 1);
-  }
-
-  // Signed extend byte.
-  void sxtb(const Register& rd, const Register& rn) {
-    sbfm(rd, rn, 0, 7);
-  }
-
-  // Signed extend halfword.
-  void sxth(const Register& rd, const Register& rn) {
-    sbfm(rd, rn, 0, 15);
-  }
-
-  // Signed extend word.
-  void sxtw(const Register& rd, const Register& rn) {
-    sbfm(rd, rn, 0, 31);
-  }
-
-  // Ubfm aliases.
-  // Logical shift left.
-  void lsl(const Register& rd, const Register& rn, int shift) {
-    int reg_size = rd.SizeInBits();
-    DCHECK(shift < reg_size);
-    ubfm(rd, rn, (reg_size - shift) % reg_size, reg_size - shift - 1);
-  }
-
-  // Logical shift right.
-  void lsr(const Register& rd, const Register& rn, int shift) {
-    DCHECK(shift < rd.SizeInBits());
-    ubfm(rd, rn, shift, rd.SizeInBits() - 1);
-  }
-
-  // Unsigned bitfield insert in zero.
-  void ubfiz(const Register& rd, const Register& rn, int lsb, int width) {
-    DCHECK_GE(width, 1);
-    DCHECK(lsb + width <= rn.SizeInBits());
-    ubfm(rd, rn, (rd.SizeInBits() - lsb) & (rd.SizeInBits() - 1), width - 1);
-  }
-
-  // Unsigned bitfield extract.
-  void ubfx(const Register& rd, const Register& rn, int lsb, int width) {
-    DCHECK_GE(width, 1);
-    DCHECK(lsb + width <= rn.SizeInBits());
-    ubfm(rd, rn, lsb, lsb + width - 1);
-  }
-
-  // Unsigned extend byte.
-  void uxtb(const Register& rd, const Register& rn) {
-    ubfm(rd, rn, 0, 7);
-  }
-
-  // Unsigned extend halfword.
-  void uxth(const Register& rd, const Register& rn) {
-    ubfm(rd, rn, 0, 15);
-  }
-
-  // Unsigned extend word.
-  void uxtw(const Register& rd, const Register& rn) {
-    ubfm(rd, rn, 0, 31);
-  }
-
-  // Extract.
-  void extr(const Register& rd, const Register& rn, const Register& rm,
-            int lsb);
-
-  // Conditional select: rd = cond ? rn : rm.
-  void csel(const Register& rd,
-            const Register& rn,
-            const Register& rm,
-            Condition cond);
-
-  // Conditional select increment: rd = cond ? rn : rm + 1.
-  void csinc(const Register& rd,
-             const Register& rn,
-             const Register& rm,
-             Condition cond);
-
-  // Conditional select inversion: rd = cond ? rn : ~rm.
-  void csinv(const Register& rd,
-             const Register& rn,
-             const Register& rm,
-             Condition cond);
-
-  // Conditional select negation: rd = cond ? rn : -rm.
-  void csneg(const Register& rd,
-             const Register& rn,
-             const Register& rm,
-             Condition cond);
-
-  // Conditional set: rd = cond ? 1 : 0.
-  void cset(const Register& rd, Condition cond);
-
-  // Conditional set minus: rd = cond ? -1 : 0.
-  void csetm(const Register& rd, Condition cond);
-
-  // Conditional increment: rd = cond ? rn + 1 : rn.
-  void cinc(const Register& rd, const Register& rn, Condition cond);
-
-  // Conditional invert: rd = cond ? ~rn : rn.
-  void cinv(const Register& rd, const Register& rn, Condition cond);
-
-  // Conditional negate: rd = cond ? -rn : rn.
-  void cneg(const Register& rd, const Register& rn, Condition cond);
-
-  // Extr aliases.
-  void ror(const Register& rd, const Register& rs, unsigned shift) {
-    extr(rd, rs, rs, shift);
-  }
-
-  // Conditional comparison.
-  // Conditional compare negative.
-  void ccmn(const Register& rn,
-            const Operand& operand,
-            StatusFlags nzcv,
-            Condition cond);
-
-  // Conditional compare.
-  void ccmp(const Register& rn,
-            const Operand& operand,
-            StatusFlags nzcv,
-            Condition cond);
-
-  // Multiplication.
-  // 32 x 32 -> 32-bit and 64 x 64 -> 64-bit multiply.
-  void mul(const Register& rd, const Register& rn, const Register& rm);
-
-  // 32 + 32 x 32 -> 32-bit and 64 + 64 x 64 -> 64-bit multiply accumulate.
-  void madd(const Register& rd,
-            const Register& rn,
-            const Register& rm,
-            const Register& ra);
-
-  // -(32 x 32) -> 32-bit and -(64 x 64) -> 64-bit multiply.
-  void mneg(const Register& rd, const Register& rn, const Register& rm);
-
-  // 32 - 32 x 32 -> 32-bit and 64 - 64 x 64 -> 64-bit multiply subtract.
-  void msub(const Register& rd,
-            const Register& rn,
-            const Register& rm,
-            const Register& ra);
-
-  // 32 x 32 -> 64-bit multiply.
-  void smull(const Register& rd, const Register& rn, const Register& rm);
-
-  // Xd = bits<127:64> of Xn * Xm.
-  void smulh(const Register& rd, const Register& rn, const Register& rm);
-
-  // Signed 32 x 32 -> 64-bit multiply and accumulate.
-  void smaddl(const Register& rd,
-              const Register& rn,
-              const Register& rm,
-              const Register& ra);
-
-  // Unsigned 32 x 32 -> 64-bit multiply and accumulate.
-  void umaddl(const Register& rd,
-              const Register& rn,
-              const Register& rm,
-              const Register& ra);
-
-  // Signed 32 x 32 -> 64-bit multiply and subtract.
-  void smsubl(const Register& rd,
-              const Register& rn,
-              const Register& rm,
-              const Register& ra);
-
-  // Unsigned 32 x 32 -> 64-bit multiply and subtract.
-  void umsubl(const Register& rd,
-              const Register& rn,
-              const Register& rm,
-              const Register& ra);
-
-  // Signed integer divide.
-  void sdiv(const Register& rd, const Register& rn, const Register& rm);
-
-  // Unsigned integer divide.
-  void udiv(const Register& rd, const Register& rn, const Register& rm);
-
-  // Bit count, bit reverse and endian reverse.
-  void rbit(const Register& rd, const Register& rn);
-  void rev16(const Register& rd, const Register& rn);
-  void rev32(const Register& rd, const Register& rn);
-  void rev(const Register& rd, const Register& rn);
-  void clz(const Register& rd, const Register& rn);
-  void cls(const Register& rd, const Register& rn);
-
-  // Memory instructions.
-
-  // Load integer or FP register.
-  void ldr(const CPURegister& rt, const MemOperand& src);
-
-  // Store integer or FP register.
-  void str(const CPURegister& rt, const MemOperand& dst);
-
-  // Load word with sign extension.
-  void ldrsw(const Register& rt, const MemOperand& src);
-
-  // Load byte.
-  void ldrb(const Register& rt, const MemOperand& src);
-
-  // Store byte.
-  void strb(const Register& rt, const MemOperand& dst);
-
-  // Load byte with sign extension.
-  void ldrsb(const Register& rt, const MemOperand& src);
-
-  // Load half-word.
-  void ldrh(const Register& rt, const MemOperand& src);
-
-  // Store half-word.
-  void strh(const Register& rt, const MemOperand& dst);
-
-  // Load half-word with sign extension.
-  void ldrsh(const Register& rt, const MemOperand& src);
-
-  // Load integer or FP register pair.
-  void ldp(const CPURegister& rt, const CPURegister& rt2,
-           const MemOperand& src);
-
-  // Store integer or FP register pair.
-  void stp(const CPURegister& rt, const CPURegister& rt2,
-           const MemOperand& dst);
-
-  // Load word pair with sign extension.
-  void ldpsw(const Register& rt, const Register& rt2, const MemOperand& src);
-
-  // Load literal to register from a pc relative address.
-  void ldr_pcrel(const CPURegister& rt, int imm19);
-
-  // Load literal to register.
-  void ldr(const CPURegister& rt, const Immediate& imm);
-  void ldr(const CPURegister& rt, const Operand& operand);
-
-  // Load-acquire word.
-  void ldar(const Register& rt, const Register& rn);
-
-  // Load-acquire exclusive word.
-  void ldaxr(const Register& rt, const Register& rn);
-
-  // Store-release word.
-  void stlr(const Register& rt, const Register& rn);
-
-  // Store-release exclusive word.
-  void stlxr(const Register& rs, const Register& rt, const Register& rn);
-
-  // Load-acquire byte.
-  void ldarb(const Register& rt, const Register& rn);
-
-  // Load-acquire exclusive byte.
-  void ldaxrb(const Register& rt, const Register& rn);
-
-  // Store-release byte.
-  void stlrb(const Register& rt, const Register& rn);
-
-  // Store-release exclusive byte.
-  void stlxrb(const Register& rs, const Register& rt, const Register& rn);
-
-  // Load-acquire half-word.
-  void ldarh(const Register& rt, const Register& rn);
-
-  // Load-acquire exclusive half-word.
-  void ldaxrh(const Register& rt, const Register& rn);
-
-  // Store-release half-word.
-  void stlrh(const Register& rt, const Register& rn);
-
-  // Store-release exclusive half-word.
-  void stlxrh(const Register& rs, const Register& rt, const Register& rn);
-
-  // Move instructions. The default shift of -1 indicates that the move
-  // instruction will calculate an appropriate 16-bit immediate and left shift
-  // that is equal to the 64-bit immediate argument. If an explicit left shift
-  // is specified (0, 16, 32 or 48), the immediate must be a 16-bit value.
-  //
-  // For movk, an explicit shift can be used to indicate which half word should
-  // be overwritten, eg. movk(x0, 0, 0) will overwrite the least-significant
-  // half word with zero, whereas movk(x0, 0, 48) will overwrite the
-  // most-significant.
-
-  // Move and keep.
-  void movk(const Register& rd, uint64_t imm, int shift = -1) {
-    MoveWide(rd, imm, shift, MOVK);
-  }
-
-  // Move with non-zero.
-  void movn(const Register& rd, uint64_t imm, int shift = -1) {
-    MoveWide(rd, imm, shift, MOVN);
-  }
-
-  // Move with zero.
-  void movz(const Register& rd, uint64_t imm, int shift = -1) {
-    MoveWide(rd, imm, shift, MOVZ);
-  }
-
-  // Misc instructions.
-  // Monitor debug-mode breakpoint.
-  void brk(int code);
-
-  // Halting debug-mode breakpoint.
-  void hlt(int code);
-
-  // Move register to register.
-  void mov(const Register& rd, const Register& rn);
-
-  // Move NOT(operand) to register.
-  void mvn(const Register& rd, const Operand& operand);
-
-  // System instructions.
-  // Move to register from system register.
-  void mrs(const Register& rt, SystemRegister sysreg);
-
-  // Move from register to system register.
-  void msr(SystemRegister sysreg, const Register& rt);
-
-  // System hint.
-  void hint(SystemHint code);
-
-  // Data memory barrier
-  void dmb(BarrierDomain domain, BarrierType type);
-
-  // Data synchronization barrier
-  void dsb(BarrierDomain domain, BarrierType type);
-
-  // Instruction synchronization barrier
-  void isb();
-
-  // Alias for system instructions.
-  void nop() { hint(NOP); }
-
-  // Different nop operations are used by the code generator to detect certain
-  // states of the generated code.
-  enum NopMarkerTypes {
-    DEBUG_BREAK_NOP,
-    INTERRUPT_CODE_NOP,
-    ADR_FAR_NOP,
-    FIRST_NOP_MARKER = DEBUG_BREAK_NOP,
-    LAST_NOP_MARKER = ADR_FAR_NOP
-  };
-
-  void nop(NopMarkerTypes n) {
-    DCHECK((FIRST_NOP_MARKER <= n) && (n <= LAST_NOP_MARKER));
-    mov(Register::XRegFromCode(n), Register::XRegFromCode(n));
-  }
-
-  // Add.
-  void add(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned halving add.
-  void uhadd(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Subtract.
-  void sub(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed halving add.
-  void shadd(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Multiply by scalar element.
-  void mul(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-           int vm_index);
-
-  // Multiply-add by scalar element.
-  void mla(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-           int vm_index);
-
-  // Multiply-subtract by scalar element.
-  void mls(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-           int vm_index);
-
-  // Signed long multiply-add by scalar element.
-  void smlal(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-             int vm_index);
-
-  // Signed long multiply-add by scalar element (second part).
-  void smlal2(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-              int vm_index);
-
-  // Unsigned long multiply-add by scalar element.
-  void umlal(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-             int vm_index);
-
-  // Unsigned long multiply-add by scalar element (second part).
-  void umlal2(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-              int vm_index);
-
-  // Signed long multiply-sub by scalar element.
-  void smlsl(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-             int vm_index);
-
-  // Signed long multiply-sub by scalar element (second part).
-  void smlsl2(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-              int vm_index);
-
-  // Unsigned long multiply-sub by scalar element.
-  void umlsl(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-             int vm_index);
-
-  // Unsigned long multiply-sub by scalar element (second part).
-  void umlsl2(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-              int vm_index);
-
-  // Signed long multiply by scalar element.
-  void smull(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-             int vm_index);
-
-  // Signed long multiply by scalar element (second part).
-  void smull2(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-              int vm_index);
-
-  // Unsigned long multiply by scalar element.
-  void umull(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-             int vm_index);
-
-  // Unsigned long multiply by scalar element (second part).
-  void umull2(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-              int vm_index);
-
-  // Add narrow returning high half.
-  void addhn(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Add narrow returning high half (second part).
-  void addhn2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed saturating double long multiply by element.
-  void sqdmull(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-               int vm_index);
-
-  // Signed saturating double long multiply by element (second part).
-  void sqdmull2(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-                int vm_index);
-
-  // Signed saturating doubling long multiply-add by element.
-  void sqdmlal(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-               int vm_index);
-
-  // Signed saturating doubling long multiply-add by element (second part).
-  void sqdmlal2(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-                int vm_index);
-
-  // Signed saturating doubling long multiply-sub by element.
-  void sqdmlsl(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-               int vm_index);
-
-  // Signed saturating doubling long multiply-sub by element (second part).
-  void sqdmlsl2(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-                int vm_index);
-
-  // Compare bitwise to zero.
-  void cmeq(const VRegister& vd, const VRegister& vn, int value);
-
-  // Compare signed greater than or equal to zero.
-  void cmge(const VRegister& vd, const VRegister& vn, int value);
-
-  // Compare signed greater than zero.
-  void cmgt(const VRegister& vd, const VRegister& vn, int value);
-
-  // Compare signed less than or equal to zero.
-  void cmle(const VRegister& vd, const VRegister& vn, int value);
-
-  // Compare signed less than zero.
-  void cmlt(const VRegister& vd, const VRegister& vn, int value);
-
-  // Unsigned rounding halving add.
-  void urhadd(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Compare equal.
-  void cmeq(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Compare signed greater than or equal.
-  void cmge(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Compare signed greater than.
-  void cmgt(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Compare unsigned higher.
-  void cmhi(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Compare unsigned higher or same.
-  void cmhs(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Compare bitwise test bits nonzero.
-  void cmtst(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed shift left by register.
-  void sshl(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned shift left by register.
-  void ushl(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed saturating doubling long multiply-subtract.
-  void sqdmlsl(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed saturating doubling long multiply-subtract (second part).
-  void sqdmlsl2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed saturating doubling long multiply.
-  void sqdmull(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed saturating doubling long multiply (second part).
-  void sqdmull2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed saturating doubling multiply returning high half.
-  void sqdmulh(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed saturating rounding doubling multiply returning high half.
-  void sqrdmulh(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed saturating doubling multiply element returning high half.
-  void sqdmulh(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-               int vm_index);
-
-  // Signed saturating rounding doubling multiply element returning high half.
-  void sqrdmulh(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-                int vm_index);
-
-  // Unsigned long multiply long.
-  void umull(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned long multiply (second part).
-  void umull2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Rounding add narrow returning high half.
-  void raddhn(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Subtract narrow returning high half.
-  void subhn(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Subtract narrow returning high half (second part).
-  void subhn2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Rounding add narrow returning high half (second part).
-  void raddhn2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Rounding subtract narrow returning high half.
-  void rsubhn(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Rounding subtract narrow returning high half (second part).
-  void rsubhn2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed saturating shift left by register.
-  void sqshl(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned saturating shift left by register.
-  void uqshl(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed rounding shift left by register.
-  void srshl(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned rounding shift left by register.
-  void urshl(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed saturating rounding shift left by register.
-  void sqrshl(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned saturating rounding shift left by register.
-  void uqrshl(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed absolute difference.
-  void sabd(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned absolute difference and accumulate.
-  void uaba(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Shift left by immediate and insert.
-  void sli(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Shift right by immediate and insert.
-  void sri(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Signed maximum.
-  void smax(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed pairwise maximum.
-  void smaxp(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Add across vector.
-  void addv(const VRegister& vd, const VRegister& vn);
-
-  // Signed add long across vector.
-  void saddlv(const VRegister& vd, const VRegister& vn);
-
-  // Unsigned add long across vector.
-  void uaddlv(const VRegister& vd, const VRegister& vn);
-
-  // FP maximum number across vector.
-  void fmaxnmv(const VRegister& vd, const VRegister& vn);
-
-  // FP maximum across vector.
-  void fmaxv(const VRegister& vd, const VRegister& vn);
-
-  // FP minimum number across vector.
-  void fminnmv(const VRegister& vd, const VRegister& vn);
-
-  // FP minimum across vector.
-  void fminv(const VRegister& vd, const VRegister& vn);
-
-  // Signed maximum across vector.
-  void smaxv(const VRegister& vd, const VRegister& vn);
-
-  // Signed minimum.
-  void smin(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed minimum pairwise.
-  void sminp(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed minimum across vector.
-  void sminv(const VRegister& vd, const VRegister& vn);
-
-  // One-element structure store from one register.
-  void st1(const VRegister& vt, const MemOperand& src);
-
-  // One-element structure store from two registers.
-  void st1(const VRegister& vt, const VRegister& vt2, const MemOperand& src);
-
-  // One-element structure store from three registers.
-  void st1(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-           const MemOperand& src);
-
-  // One-element structure store from four registers.
-  void st1(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-           const VRegister& vt4, const MemOperand& src);
-
-  // One-element single structure store from one lane.
-  void st1(const VRegister& vt, int lane, const MemOperand& src);
-
-  // Two-element structure store from two registers.
-  void st2(const VRegister& vt, const VRegister& vt2, const MemOperand& src);
-
-  // Two-element single structure store from two lanes.
-  void st2(const VRegister& vt, const VRegister& vt2, int lane,
-           const MemOperand& src);
-
-  // Three-element structure store from three registers.
-  void st3(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-           const MemOperand& src);
-
-  // Three-element single structure store from three lanes.
-  void st3(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-           int lane, const MemOperand& src);
-
-  // Four-element structure store from four registers.
-  void st4(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-           const VRegister& vt4, const MemOperand& src);
-
-  // Four-element single structure store from four lanes.
-  void st4(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-           const VRegister& vt4, int lane, const MemOperand& src);
-
-  // Unsigned add long.
-  void uaddl(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned add long (second part).
-  void uaddl2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned add wide.
-  void uaddw(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned add wide (second part).
-  void uaddw2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed add long.
-  void saddl(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed add long (second part).
-  void saddl2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed add wide.
-  void saddw(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed add wide (second part).
-  void saddw2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned subtract long.
-  void usubl(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned subtract long (second part).
-  void usubl2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned subtract wide.
-  void usubw(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed subtract long.
-  void ssubl(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed subtract long (second part).
-  void ssubl2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed integer subtract wide.
-  void ssubw(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed integer subtract wide (second part).
-  void ssubw2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned subtract wide (second part).
-  void usubw2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned maximum.
-  void umax(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned pairwise maximum.
-  void umaxp(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned maximum across vector.
-  void umaxv(const VRegister& vd, const VRegister& vn);
-
-  // Unsigned minimum.
-  void umin(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned pairwise minimum.
-  void uminp(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned minimum across vector.
-  void uminv(const VRegister& vd, const VRegister& vn);
-
-  // Transpose vectors (primary).
-  void trn1(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Transpose vectors (secondary).
-  void trn2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unzip vectors (primary).
-  void uzp1(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unzip vectors (secondary).
-  void uzp2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Zip vectors (primary).
-  void zip1(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Zip vectors (secondary).
-  void zip2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed shift right by immediate.
-  void sshr(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Unsigned shift right by immediate.
-  void ushr(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Signed rounding shift right by immediate.
-  void srshr(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Unsigned rounding shift right by immediate.
-  void urshr(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Signed shift right by immediate and accumulate.
-  void ssra(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Unsigned shift right by immediate and accumulate.
-  void usra(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Signed rounding shift right by immediate and accumulate.
-  void srsra(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Unsigned rounding shift right by immediate and accumulate.
-  void ursra(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Shift right narrow by immediate.
-  void shrn(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Shift right narrow by immediate (second part).
-  void shrn2(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Rounding shift right narrow by immediate.
-  void rshrn(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Rounding shift right narrow by immediate (second part).
-  void rshrn2(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Unsigned saturating shift right narrow by immediate.
-  void uqshrn(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Unsigned saturating shift right narrow by immediate (second part).
-  void uqshrn2(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Unsigned saturating rounding shift right narrow by immediate.
-  void uqrshrn(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Unsigned saturating rounding shift right narrow by immediate (second part).
-  void uqrshrn2(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Signed saturating shift right narrow by immediate.
-  void sqshrn(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Signed saturating shift right narrow by immediate (second part).
-  void sqshrn2(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Signed saturating rounded shift right narrow by immediate.
-  void sqrshrn(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Signed saturating rounded shift right narrow by immediate (second part).
-  void sqrshrn2(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Signed saturating shift right unsigned narrow by immediate.
-  void sqshrun(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Signed saturating shift right unsigned narrow by immediate (second part).
-  void sqshrun2(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Signed sat rounded shift right unsigned narrow by immediate.
-  void sqrshrun(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Signed sat rounded shift right unsigned narrow by immediate (second part).
-  void sqrshrun2(const VRegister& vd, const VRegister& vn, int shift);
-
-  // FP reciprocal step.
-  void frecps(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // FP reciprocal estimate.
-  void frecpe(const VRegister& vd, const VRegister& vn);
-
-  // FP reciprocal square root estimate.
-  void frsqrte(const VRegister& vd, const VRegister& vn);
-
-  // FP reciprocal square root step.
-  void frsqrts(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed absolute difference and accumulate long.
-  void sabal(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed absolute difference and accumulate long (second part).
-  void sabal2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned absolute difference and accumulate long.
-  void uabal(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned absolute difference and accumulate long (second part).
-  void uabal2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed absolute difference long.
-  void sabdl(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed absolute difference long (second part).
-  void sabdl2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned absolute difference long.
-  void uabdl(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned absolute difference long (second part).
-  void uabdl2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Polynomial multiply long.
-  void pmull(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Polynomial multiply long (second part).
-  void pmull2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed long multiply-add.
-  void smlal(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed long multiply-add (second part).
-  void smlal2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned long multiply-add.
-  void umlal(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned long multiply-add (second part).
-  void umlal2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed long multiply-sub.
-  void smlsl(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed long multiply-sub (second part).
-  void smlsl2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned long multiply-sub.
-  void umlsl(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned long multiply-sub (second part).
-  void umlsl2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed long multiply.
-  void smull(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed long multiply (second part).
-  void smull2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed saturating doubling long multiply-add.
-  void sqdmlal(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed saturating doubling long multiply-add (second part).
-  void sqdmlal2(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned absolute difference.
-  void uabd(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed absolute difference and accumulate.
-  void saba(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // FP instructions.
-  // Move immediate to FP register.
-  void fmov(const VRegister& fd, double imm);
-  void fmov(const VRegister& fd, float imm);
-
-  // Move FP register to register.
-  void fmov(const Register& rd, const VRegister& fn);
-
-  // Move register to FP register.
-  void fmov(const VRegister& fd, const Register& rn);
-
-  // Move FP register to FP register.
-  void fmov(const VRegister& fd, const VRegister& fn);
-
-  // Move 64-bit register to top half of 128-bit FP register.
-  void fmov(const VRegister& vd, int index, const Register& rn);
-
-  // Move top half of 128-bit FP register to 64-bit register.
-  void fmov(const Register& rd, const VRegister& vn, int index);
-
-  // FP add.
-  void fadd(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // FP subtract.
-  void fsub(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // FP multiply.
-  void fmul(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // FP compare equal to zero.
-  void fcmeq(const VRegister& vd, const VRegister& vn, double imm);
-
-  // FP greater than zero.
-  void fcmgt(const VRegister& vd, const VRegister& vn, double imm);
-
-  // FP greater than or equal to zero.
-  void fcmge(const VRegister& vd, const VRegister& vn, double imm);
-
-  // FP less than or equal to zero.
-  void fcmle(const VRegister& vd, const VRegister& vn, double imm);
-
-  // FP less than to zero.
-  void fcmlt(const VRegister& vd, const VRegister& vn, double imm);
-
-  // FP absolute difference.
-  void fabd(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // FP pairwise add vector.
-  void faddp(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // FP pairwise add scalar.
-  void faddp(const VRegister& vd, const VRegister& vn);
-
-  // FP pairwise maximum scalar.
-  void fmaxp(const VRegister& vd, const VRegister& vn);
-
-  // FP pairwise maximum number scalar.
-  void fmaxnmp(const VRegister& vd, const VRegister& vn);
-
-  // FP pairwise minimum number scalar.
-  void fminnmp(const VRegister& vd, const VRegister& vn);
-
-  // FP vector multiply accumulate.
-  void fmla(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // FP vector multiply subtract.
-  void fmls(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // FP vector multiply extended.
-  void fmulx(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // FP absolute greater than or equal.
-  void facge(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // FP absolute greater than.
-  void facgt(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // FP multiply by element.
-  void fmul(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-            int vm_index);
-
-  // FP fused multiply-add to accumulator by element.
-  void fmla(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-            int vm_index);
-
-  // FP fused multiply-sub from accumulator by element.
-  void fmls(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-            int vm_index);
-
-  // FP multiply extended by element.
-  void fmulx(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-             int vm_index);
-
-  // FP compare equal.
-  void fcmeq(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // FP greater than.
-  void fcmgt(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // FP greater than or equal.
-  void fcmge(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // FP pairwise maximum vector.
-  void fmaxp(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // FP pairwise minimum vector.
-  void fminp(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // FP pairwise minimum scalar.
-  void fminp(const VRegister& vd, const VRegister& vn);
-
-  // FP pairwise maximum number vector.
-  void fmaxnmp(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // FP pairwise minimum number vector.
-  void fminnmp(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // FP fused multiply-add.
-  void fmadd(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-             const VRegister& va);
-
-  // FP fused multiply-subtract.
-  void fmsub(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-             const VRegister& va);
-
-  // FP fused multiply-add and negate.
-  void fnmadd(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-              const VRegister& va);
-
-  // FP fused multiply-subtract and negate.
-  void fnmsub(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-              const VRegister& va);
-
-  // FP multiply-negate scalar.
-  void fnmul(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // FP reciprocal exponent scalar.
-  void frecpx(const VRegister& vd, const VRegister& vn);
-
-  // FP divide.
-  void fdiv(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // FP maximum.
-  void fmax(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // FP minimum.
-  void fmin(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // FP maximum.
-  void fmaxnm(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // FP minimum.
-  void fminnm(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // FP absolute.
-  void fabs(const VRegister& vd, const VRegister& vn);
-
-  // FP negate.
-  void fneg(const VRegister& vd, const VRegister& vn);
-
-  // FP square root.
-  void fsqrt(const VRegister& vd, const VRegister& vn);
-
-  // FP round to integer nearest with ties to away.
-  void frinta(const VRegister& vd, const VRegister& vn);
-
-  // FP round to integer, implicit rounding.
-  void frinti(const VRegister& vd, const VRegister& vn);
-
-  // FP round to integer toward minus infinity.
-  void frintm(const VRegister& vd, const VRegister& vn);
-
-  // FP round to integer nearest with ties to even.
-  void frintn(const VRegister& vd, const VRegister& vn);
-
-  // FP round to integer towards plus infinity.
-  void frintp(const VRegister& vd, const VRegister& vn);
-
-  // FP round to integer, exact, implicit rounding.
-  void frintx(const VRegister& vd, const VRegister& vn);
-
-  // FP round to integer towards zero.
-  void frintz(const VRegister& vd, const VRegister& vn);
-
-  // FP compare registers.
-  void fcmp(const VRegister& vn, const VRegister& vm);
-
-  // FP compare immediate.
-  void fcmp(const VRegister& vn, double value);
-
-  // FP conditional compare.
-  void fccmp(const VRegister& vn, const VRegister& vm, StatusFlags nzcv,
-             Condition cond);
-
-  // FP conditional select.
-  void fcsel(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-             Condition cond);
-
-  // Common FP Convert functions.
-  void NEONFPConvertToInt(const Register& rd, const VRegister& vn, Instr op);
-  void NEONFPConvertToInt(const VRegister& vd, const VRegister& vn, Instr op);
-
-  // FP convert between precisions.
-  void fcvt(const VRegister& vd, const VRegister& vn);
-
-  // FP convert to higher precision.
-  void fcvtl(const VRegister& vd, const VRegister& vn);
-
-  // FP convert to higher precision (second part).
-  void fcvtl2(const VRegister& vd, const VRegister& vn);
-
-  // FP convert to lower precision.
-  void fcvtn(const VRegister& vd, const VRegister& vn);
-
-  // FP convert to lower prevision (second part).
-  void fcvtn2(const VRegister& vd, const VRegister& vn);
-
-  // FP convert to lower precision, rounding to odd.
-  void fcvtxn(const VRegister& vd, const VRegister& vn);
-
-  // FP convert to lower precision, rounding to odd (second part).
-  void fcvtxn2(const VRegister& vd, const VRegister& vn);
-
-  // FP convert to signed integer, nearest with ties to away.
-  void fcvtas(const Register& rd, const VRegister& vn);
-
-  // FP convert to unsigned integer, nearest with ties to away.
-  void fcvtau(const Register& rd, const VRegister& vn);
-
-  // FP convert to signed integer, nearest with ties to away.
-  void fcvtas(const VRegister& vd, const VRegister& vn);
-
-  // FP convert to unsigned integer, nearest with ties to away.
-  void fcvtau(const VRegister& vd, const VRegister& vn);
-
-  // FP convert to signed integer, round towards -infinity.
-  void fcvtms(const Register& rd, const VRegister& vn);
-
-  // FP convert to unsigned integer, round towards -infinity.
-  void fcvtmu(const Register& rd, const VRegister& vn);
-
-  // FP convert to signed integer, round towards -infinity.
-  void fcvtms(const VRegister& vd, const VRegister& vn);
-
-  // FP convert to unsigned integer, round towards -infinity.
-  void fcvtmu(const VRegister& vd, const VRegister& vn);
-
-  // FP convert to signed integer, nearest with ties to even.
-  void fcvtns(const Register& rd, const VRegister& vn);
-
-  // FP convert to unsigned integer, nearest with ties to even.
-  void fcvtnu(const Register& rd, const VRegister& vn);
-
-  // FP convert to signed integer, nearest with ties to even.
-  void fcvtns(const VRegister& rd, const VRegister& vn);
-
-  // FP convert to unsigned integer, nearest with ties to even.
-  void fcvtnu(const VRegister& rd, const VRegister& vn);
-
-  // FP convert to signed integer or fixed-point, round towards zero.
-  void fcvtzs(const Register& rd, const VRegister& vn, int fbits = 0);
-
-  // FP convert to unsigned integer or fixed-point, round towards zero.
-  void fcvtzu(const Register& rd, const VRegister& vn, int fbits = 0);
-
-  // FP convert to signed integer or fixed-point, round towards zero.
-  void fcvtzs(const VRegister& vd, const VRegister& vn, int fbits = 0);
-
-  // FP convert to unsigned integer or fixed-point, round towards zero.
-  void fcvtzu(const VRegister& vd, const VRegister& vn, int fbits = 0);
-
-  // FP convert to signed integer, round towards +infinity.
-  void fcvtps(const Register& rd, const VRegister& vn);
-
-  // FP convert to unsigned integer, round towards +infinity.
-  void fcvtpu(const Register& rd, const VRegister& vn);
-
-  // FP convert to signed integer, round towards +infinity.
-  void fcvtps(const VRegister& vd, const VRegister& vn);
-
-  // FP convert to unsigned integer, round towards +infinity.
-  void fcvtpu(const VRegister& vd, const VRegister& vn);
-
-  // Convert signed integer or fixed point to FP.
-  void scvtf(const VRegister& fd, const Register& rn, int fbits = 0);
-
-  // Convert unsigned integer or fixed point to FP.
-  void ucvtf(const VRegister& fd, const Register& rn, int fbits = 0);
-
-  // Convert signed integer or fixed-point to FP.
-  void scvtf(const VRegister& fd, const VRegister& vn, int fbits = 0);
-
-  // Convert unsigned integer or fixed-point to FP.
-  void ucvtf(const VRegister& fd, const VRegister& vn, int fbits = 0);
-
-  // Extract vector from pair of vectors.
-  void ext(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-           int index);
-
-  // Duplicate vector element to vector or scalar.
-  void dup(const VRegister& vd, const VRegister& vn, int vn_index);
-
-  // Duplicate general-purpose register to vector.
-  void dup(const VRegister& vd, const Register& rn);
-
-  // Insert vector element from general-purpose register.
-  void ins(const VRegister& vd, int vd_index, const Register& rn);
-
-  // Move general-purpose register to a vector element.
-  void mov(const VRegister& vd, int vd_index, const Register& rn);
-
-  // Unsigned move vector element to general-purpose register.
-  void umov(const Register& rd, const VRegister& vn, int vn_index);
-
-  // Move vector element to general-purpose register.
-  void mov(const Register& rd, const VRegister& vn, int vn_index);
-
-  // Move vector element to scalar.
-  void mov(const VRegister& vd, const VRegister& vn, int vn_index);
-
-  // Insert vector element from another vector element.
-  void ins(const VRegister& vd, int vd_index, const VRegister& vn,
-           int vn_index);
-
-  // Move vector element to another vector element.
-  void mov(const VRegister& vd, int vd_index, const VRegister& vn,
-           int vn_index);
-
-  // Signed move vector element to general-purpose register.
-  void smov(const Register& rd, const VRegister& vn, int vn_index);
-
-  // One-element structure load to one register.
-  void ld1(const VRegister& vt, const MemOperand& src);
-
-  // One-element structure load to two registers.
-  void ld1(const VRegister& vt, const VRegister& vt2, const MemOperand& src);
-
-  // One-element structure load to three registers.
-  void ld1(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-           const MemOperand& src);
-
-  // One-element structure load to four registers.
-  void ld1(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-           const VRegister& vt4, const MemOperand& src);
-
-  // One-element single structure load to one lane.
-  void ld1(const VRegister& vt, int lane, const MemOperand& src);
-
-  // One-element single structure load to all lanes.
-  void ld1r(const VRegister& vt, const MemOperand& src);
-
-  // Two-element structure load.
-  void ld2(const VRegister& vt, const VRegister& vt2, const MemOperand& src);
-
-  // Two-element single structure load to one lane.
-  void ld2(const VRegister& vt, const VRegister& vt2, int lane,
-           const MemOperand& src);
-
-  // Two-element single structure load to all lanes.
-  void ld2r(const VRegister& vt, const VRegister& vt2, const MemOperand& src);
-
-  // Three-element structure load.
-  void ld3(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-           const MemOperand& src);
-
-  // Three-element single structure load to one lane.
-  void ld3(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-           int lane, const MemOperand& src);
-
-  // Three-element single structure load to all lanes.
-  void ld3r(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-            const MemOperand& src);
-
-  // Four-element structure load.
-  void ld4(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-           const VRegister& vt4, const MemOperand& src);
-
-  // Four-element single structure load to one lane.
-  void ld4(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-           const VRegister& vt4, int lane, const MemOperand& src);
-
-  // Four-element single structure load to all lanes.
-  void ld4r(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-            const VRegister& vt4, const MemOperand& src);
-
-  // Count leading sign bits.
-  void cls(const VRegister& vd, const VRegister& vn);
-
-  // Count leading zero bits (vector).
-  void clz(const VRegister& vd, const VRegister& vn);
-
-  // Population count per byte.
-  void cnt(const VRegister& vd, const VRegister& vn);
-
-  // Reverse bit order.
-  void rbit(const VRegister& vd, const VRegister& vn);
-
-  // Reverse elements in 16-bit halfwords.
-  void rev16(const VRegister& vd, const VRegister& vn);
-
-  // Reverse elements in 32-bit words.
-  void rev32(const VRegister& vd, const VRegister& vn);
-
-  // Reverse elements in 64-bit doublewords.
-  void rev64(const VRegister& vd, const VRegister& vn);
-
-  // Unsigned reciprocal square root estimate.
-  void ursqrte(const VRegister& vd, const VRegister& vn);
-
-  // Unsigned reciprocal estimate.
-  void urecpe(const VRegister& vd, const VRegister& vn);
-
-  // Signed pairwise long add and accumulate.
-  void sadalp(const VRegister& vd, const VRegister& vn);
-
-  // Signed pairwise long add.
-  void saddlp(const VRegister& vd, const VRegister& vn);
-
-  // Unsigned pairwise long add.
-  void uaddlp(const VRegister& vd, const VRegister& vn);
-
-  // Unsigned pairwise long add and accumulate.
-  void uadalp(const VRegister& vd, const VRegister& vn);
-
-  // Shift left by immediate.
-  void shl(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Signed saturating shift left by immediate.
-  void sqshl(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Signed saturating shift left unsigned by immediate.
-  void sqshlu(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Unsigned saturating shift left by immediate.
-  void uqshl(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Signed shift left long by immediate.
-  void sshll(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Signed shift left long by immediate (second part).
-  void sshll2(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Signed extend long.
-  void sxtl(const VRegister& vd, const VRegister& vn);
-
-  // Signed extend long (second part).
-  void sxtl2(const VRegister& vd, const VRegister& vn);
-
-  // Unsigned shift left long by immediate.
-  void ushll(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Unsigned shift left long by immediate (second part).
-  void ushll2(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Shift left long by element size.
-  void shll(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Shift left long by element size (second part).
-  void shll2(const VRegister& vd, const VRegister& vn, int shift);
-
-  // Unsigned extend long.
-  void uxtl(const VRegister& vd, const VRegister& vn);
-
-  // Unsigned extend long (second part).
-  void uxtl2(const VRegister& vd, const VRegister& vn);
-
-  // Signed rounding halving add.
-  void srhadd(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned halving sub.
-  void uhsub(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed halving sub.
-  void shsub(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned saturating add.
-  void uqadd(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed saturating add.
-  void sqadd(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Unsigned saturating subtract.
-  void uqsub(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Signed saturating subtract.
-  void sqsub(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Add pairwise.
-  void addp(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Add pair of elements scalar.
-  void addp(const VRegister& vd, const VRegister& vn);
-
-  // Multiply-add to accumulator.
-  void mla(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Multiply-subtract to accumulator.
-  void mls(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Multiply.
-  void mul(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Table lookup from one register.
-  void tbl(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Table lookup from two registers.
-  void tbl(const VRegister& vd, const VRegister& vn, const VRegister& vn2,
-           const VRegister& vm);
-
-  // Table lookup from three registers.
-  void tbl(const VRegister& vd, const VRegister& vn, const VRegister& vn2,
-           const VRegister& vn3, const VRegister& vm);
-
-  // Table lookup from four registers.
-  void tbl(const VRegister& vd, const VRegister& vn, const VRegister& vn2,
-           const VRegister& vn3, const VRegister& vn4, const VRegister& vm);
-
-  // Table lookup extension from one register.
-  void tbx(const VRegister& vd, const VRegister& vn, const VRegister& vm);
-
-  // Table lookup extension from two registers.
-  void tbx(const VRegister& vd, const VRegister& vn, const VRegister& vn2,
-           const VRegister& vm);
-
-  // Table lookup extension from three registers.
-  void tbx(const VRegister& vd, const VRegister& vn, const VRegister& vn2,
-           const VRegister& vn3, const VRegister& vm);
-
-  // Table lookup extension from four registers.
-  void tbx(const VRegister& vd, const VRegister& vn, const VRegister& vn2,
-           const VRegister& vn3, const VRegister& vn4, const VRegister& vm);
-
-  // Instruction functions used only for test, debug, and patching.
-  // Emit raw instructions in the instruction stream.
-  void dci(Instr raw_inst) { Emit(raw_inst); }
-
-  // Emit 8 bits of data in the instruction stream.
-  void dc8(uint8_t data) { EmitData(&data, sizeof(data)); }
-
-  // Emit 32 bits of data in the instruction stream.
-  void dc32(uint32_t data) { EmitData(&data, sizeof(data)); }
-
-  // Emit 64 bits of data in the instruction stream.
-  void dc64(uint64_t data) { EmitData(&data, sizeof(data)); }
-
-  // Emit an address in the instruction stream.
-  void dcptr(Label* label);
-
-  // Copy a string into the instruction stream, including the terminating
-  // nullptr character. The instruction pointer (pc_) is then aligned correctly
-  // for subsequent instructions.
-  void EmitStringData(const char* string);
-
-  // Pseudo-instructions ------------------------------------------------------
-
-  // Parameters are described in arm64/instructions-arm64.h.
-  void debug(const char* message, uint32_t code, Instr params = BREAK);
-
-  // Required by V8.
-  void dd(uint32_t data) { dc32(data); }
-  void db(uint8_t data) { dc8(data); }
-  void dq(uint64_t data) { dc64(data); }
-  void dp(uintptr_t data) { dc64(data); }
-
-  // Code generation helpers --------------------------------------------------
-
-  bool IsConstPoolEmpty() const { return constpool_.IsEmpty(); }
-
-  Instruction* pc() const { return Instruction::Cast(pc_); }
-
-  Instruction* InstructionAt(ptrdiff_t offset) const {
-    return reinterpret_cast<Instruction*>(buffer_ + offset);
-  }
-
-  ptrdiff_t InstructionOffset(Instruction* instr) const {
-    return reinterpret_cast<byte*>(instr) - buffer_;
-  }
-
-  // Register encoding.
-  static Instr Rd(CPURegister rd) {
-    DCHECK_NE(rd.code(), kSPRegInternalCode);
-    return rd.code() << Rd_offset;
-  }
-
-  static Instr Rn(CPURegister rn) {
-    DCHECK_NE(rn.code(), kSPRegInternalCode);
-    return rn.code() << Rn_offset;
-  }
-
-  static Instr Rm(CPURegister rm) {
-    DCHECK_NE(rm.code(), kSPRegInternalCode);
-    return rm.code() << Rm_offset;
-  }
-
-  static Instr RmNot31(CPURegister rm) {
-    DCHECK_NE(rm.code(), kSPRegInternalCode);
-    DCHECK(!rm.IsZero());
-    return Rm(rm);
-  }
-
-  static Instr Ra(CPURegister ra) {
-    DCHECK_NE(ra.code(), kSPRegInternalCode);
-    return ra.code() << Ra_offset;
-  }
-
-  static Instr Rt(CPURegister rt) {
-    DCHECK_NE(rt.code(), kSPRegInternalCode);
-    return rt.code() << Rt_offset;
-  }
-
-  static Instr Rt2(CPURegister rt2) {
-    DCHECK_NE(rt2.code(), kSPRegInternalCode);
-    return rt2.code() << Rt2_offset;
-  }
-
-  static Instr Rs(CPURegister rs) {
-    DCHECK_NE(rs.code(), kSPRegInternalCode);
-    return rs.code() << Rs_offset;
-  }
-
-  // These encoding functions allow the stack pointer to be encoded, and
-  // disallow the zero register.
-  static Instr RdSP(Register rd) {
-    DCHECK(!rd.IsZero());
-    return (rd.code() & kRegCodeMask) << Rd_offset;
-  }
-
-  static Instr RnSP(Register rn) {
-    DCHECK(!rn.IsZero());
-    return (rn.code() & kRegCodeMask) << Rn_offset;
-  }
-
-  // Flags encoding.
-  inline static Instr Flags(FlagsUpdate S);
-  inline static Instr Cond(Condition cond);
-
-  // PC-relative address encoding.
-  inline static Instr ImmPCRelAddress(int imm21);
-
-  // Branch encoding.
-  inline static Instr ImmUncondBranch(int imm26);
-  inline static Instr ImmCondBranch(int imm19);
-  inline static Instr ImmCmpBranch(int imm19);
-  inline static Instr ImmTestBranch(int imm14);
-  inline static Instr ImmTestBranchBit(unsigned bit_pos);
-
-  // Data Processing encoding.
-  inline static Instr SF(Register rd);
-  inline static Instr ImmAddSub(int imm);
-  inline static Instr ImmS(unsigned imms, unsigned reg_size);
-  inline static Instr ImmR(unsigned immr, unsigned reg_size);
-  inline static Instr ImmSetBits(unsigned imms, unsigned reg_size);
-  inline static Instr ImmRotate(unsigned immr, unsigned reg_size);
-  inline static Instr ImmLLiteral(int imm19);
-  inline static Instr BitN(unsigned bitn, unsigned reg_size);
-  inline static Instr ShiftDP(Shift shift);
-  inline static Instr ImmDPShift(unsigned amount);
-  inline static Instr ExtendMode(Extend extend);
-  inline static Instr ImmExtendShift(unsigned left_shift);
-  inline static Instr ImmCondCmp(unsigned imm);
-  inline static Instr Nzcv(StatusFlags nzcv);
-
-  static bool IsImmAddSub(int64_t immediate);
-  static bool IsImmLogical(uint64_t value,
-                           unsigned width,
-                           unsigned* n,
-                           unsigned* imm_s,
-                           unsigned* imm_r);
-
-  // MemOperand offset encoding.
-  inline static Instr ImmLSUnsigned(int imm12);
-  inline static Instr ImmLS(int imm9);
-  inline static Instr ImmLSPair(int imm7, unsigned size);
-  inline static Instr ImmShiftLS(unsigned shift_amount);
-  inline static Instr ImmException(int imm16);
-  inline static Instr ImmSystemRegister(int imm15);
-  inline static Instr ImmHint(int imm7);
-  inline static Instr ImmBarrierDomain(int imm2);
-  inline static Instr ImmBarrierType(int imm2);
-  inline static unsigned CalcLSDataSize(LoadStoreOp op);
-
-  // Instruction bits for vector format in data processing operations.
-  static Instr VFormat(VRegister vd) {
-    if (vd.Is64Bits()) {
-      switch (vd.LaneCount()) {
-        case 2:
-          return NEON_2S;
-        case 4:
-          return NEON_4H;
-        case 8:
-          return NEON_8B;
-        default:
-          UNREACHABLE();
-      }
-    } else {
-      DCHECK(vd.Is128Bits());
-      switch (vd.LaneCount()) {
-        case 2:
-          return NEON_2D;
-        case 4:
-          return NEON_4S;
-        case 8:
-          return NEON_8H;
-        case 16:
-          return NEON_16B;
-        default:
-          UNREACHABLE();
-      }
-    }
-  }
-
-  // Instruction bits for vector format in floating point data processing
-  // operations.
-  static Instr FPFormat(VRegister vd) {
-    if (vd.LaneCount() == 1) {
-      // Floating point scalar formats.
-      DCHECK(vd.Is32Bits() || vd.Is64Bits());
-      return vd.Is64Bits() ? FP64 : FP32;
-    }
-
-    // Two lane floating point vector formats.
-    if (vd.LaneCount() == 2) {
-      DCHECK(vd.Is64Bits() || vd.Is128Bits());
-      return vd.Is128Bits() ? NEON_FP_2D : NEON_FP_2S;
-    }
-
-    // Four lane floating point vector format.
-    DCHECK((vd.LaneCount() == 4) && vd.Is128Bits());
-    return NEON_FP_4S;
-  }
-
-  // Instruction bits for vector format in load and store operations.
-  static Instr LSVFormat(VRegister vd) {
-    if (vd.Is64Bits()) {
-      switch (vd.LaneCount()) {
-        case 1:
-          return LS_NEON_1D;
-        case 2:
-          return LS_NEON_2S;
-        case 4:
-          return LS_NEON_4H;
-        case 8:
-          return LS_NEON_8B;
-        default:
-          UNREACHABLE();
-      }
-    } else {
-      DCHECK(vd.Is128Bits());
-      switch (vd.LaneCount()) {
-        case 2:
-          return LS_NEON_2D;
-        case 4:
-          return LS_NEON_4S;
-        case 8:
-          return LS_NEON_8H;
-        case 16:
-          return LS_NEON_16B;
-        default:
-          UNREACHABLE();
-      }
-    }
-  }
-
-  // Instruction bits for scalar format in data processing operations.
-  static Instr SFormat(VRegister vd) {
-    DCHECK(vd.IsScalar());
-    switch (vd.SizeInBytes()) {
-      case 1:
-        return NEON_B;
-      case 2:
-        return NEON_H;
-      case 4:
-        return NEON_S;
-      case 8:
-        return NEON_D;
-      default:
-        UNREACHABLE();
-    }
-  }
-
-  static Instr ImmNEONHLM(int index, int num_bits) {
-    int h, l, m;
-    if (num_bits == 3) {
-      DCHECK(is_uint3(index));
-      h = (index >> 2) & 1;
-      l = (index >> 1) & 1;
-      m = (index >> 0) & 1;
-    } else if (num_bits == 2) {
-      DCHECK(is_uint2(index));
-      h = (index >> 1) & 1;
-      l = (index >> 0) & 1;
-      m = 0;
-    } else {
-      DCHECK(is_uint1(index) && (num_bits == 1));
-      h = (index >> 0) & 1;
-      l = 0;
-      m = 0;
-    }
-    return (h << NEONH_offset) | (l << NEONL_offset) | (m << NEONM_offset);
-  }
-
-  static Instr ImmNEONExt(int imm4) {
-    DCHECK(is_uint4(imm4));
-    return imm4 << ImmNEONExt_offset;
-  }
-
-  static Instr ImmNEON5(Instr format, int index) {
-    DCHECK(is_uint4(index));
-    int s = LaneSizeInBytesLog2FromFormat(static_cast<VectorFormat>(format));
-    int imm5 = (index << (s + 1)) | (1 << s);
-    return imm5 << ImmNEON5_offset;
-  }
-
-  static Instr ImmNEON4(Instr format, int index) {
-    DCHECK(is_uint4(index));
-    int s = LaneSizeInBytesLog2FromFormat(static_cast<VectorFormat>(format));
-    int imm4 = index << s;
-    return imm4 << ImmNEON4_offset;
-  }
-
-  static Instr ImmNEONabcdefgh(int imm8) {
-    DCHECK(is_uint8(imm8));
-    Instr instr;
-    instr = ((imm8 >> 5) & 7) << ImmNEONabc_offset;
-    instr |= (imm8 & 0x1f) << ImmNEONdefgh_offset;
-    return instr;
-  }
-
-  static Instr NEONCmode(int cmode) {
-    DCHECK(is_uint4(cmode));
-    return cmode << NEONCmode_offset;
-  }
-
-  static Instr NEONModImmOp(int op) {
-    DCHECK(is_uint1(op));
-    return op << NEONModImmOp_offset;
-  }
-
-  static bool IsImmLSUnscaled(int64_t offset);
-  static bool IsImmLSScaled(int64_t offset, unsigned size);
-  static bool IsImmLLiteral(int64_t offset);
-
-  // Move immediates encoding.
-  inline static Instr ImmMoveWide(int imm);
-  inline static Instr ShiftMoveWide(int shift);
-
-  // FP Immediates.
-  static Instr ImmFP(double imm);
-  static Instr ImmNEONFP(double imm);
-  inline static Instr FPScale(unsigned scale);
-
-  // FP register type.
-  inline static Instr FPType(VRegister fd);
-
-  // Class for scoping postponing the constant pool generation.
-  class BlockConstPoolScope {
-   public:
-    explicit BlockConstPoolScope(Assembler* assem) : assem_(assem) {
-      assem_->StartBlockConstPool();
-    }
-    ~BlockConstPoolScope() {
-      assem_->EndBlockConstPool();
-    }
-
-   private:
-    Assembler* assem_;
-
-    DISALLOW_IMPLICIT_CONSTRUCTORS(BlockConstPoolScope);
-  };
-
-  // Check if is time to emit a constant pool.
-  void CheckConstPool(bool force_emit, bool require_jump);
-
-  void PatchConstantPoolAccessInstruction(int pc_offset, int offset,
-                                          ConstantPoolEntry::Access access,
-                                          ConstantPoolEntry::Type type) {
-    // No embedded constant pool support.
-    UNREACHABLE();
-  }
-
-  // Returns true if we should emit a veneer as soon as possible for a branch
-  // which can at most reach to specified pc.
-  bool ShouldEmitVeneer(int max_reachable_pc,
-                        int margin = kVeneerDistanceMargin);
-  bool ShouldEmitVeneers(int margin = kVeneerDistanceMargin) {
-    return ShouldEmitVeneer(unresolved_branches_first_limit(), margin);
-  }
-
-  // The maximum code size generated for a veneer. Currently one branch
-  // instruction. This is for code size checking purposes, and can be extended
-  // in the future for example if we decide to add nops between the veneers.
-  static constexpr int kMaxVeneerCodeSize = 1 * kInstructionSize;
-
-  void RecordVeneerPool(int location_offset, int size);
-  // Emits veneers for branches that are approaching their maximum range.
-  // If need_protection is true, the veneers are protected by a branch jumping
-  // over the code.
-  void EmitVeneers(bool force_emit, bool need_protection,
-                   int margin = kVeneerDistanceMargin);
-  void EmitVeneersGuard() { EmitPoolGuard(); }
-  // Checks whether veneers need to be emitted at this point.
-  // If force_emit is set, a veneer is generated for *all* unresolved branches.
-  void CheckVeneerPool(bool force_emit, bool require_jump,
-                       int margin = kVeneerDistanceMargin);
-
-  class BlockPoolsScope {
-   public:
-    explicit BlockPoolsScope(Assembler* assem) : assem_(assem) {
-      assem_->StartBlockPools();
-    }
-    ~BlockPoolsScope() {
-      assem_->EndBlockPools();
-    }
-
-   private:
-    Assembler* assem_;
-
-    DISALLOW_IMPLICIT_CONSTRUCTORS(BlockPoolsScope);
-  };
-
-  // Class for blocking sharing of code targets in constant pool.
-  class BlockCodeTargetSharingScope {
-   public:
-    explicit BlockCodeTargetSharingScope(Assembler* assem) : assem_(nullptr) {
-      Open(assem);
-    }
-    // This constructor does not initialize the scope. The user needs to
-    // explicitly call Open() before using it.
-    BlockCodeTargetSharingScope() : assem_(nullptr) {}
-    ~BlockCodeTargetSharingScope() { Close(); }
-    void Open(Assembler* assem) {
-      DCHECK_NULL(assem_);
-      DCHECK_NOT_NULL(assem);
-      assem_ = assem;
-      assem_->StartBlockCodeTargetSharing();
-    }
-
-   private:
-    void Close() {
-      if (assem_ != nullptr) {
-        assem_->EndBlockCodeTargetSharing();
-      }
-    }
-    Assembler* assem_;
-
-    DISALLOW_COPY_AND_ASSIGN(BlockCodeTargetSharingScope);
-  };
-
- protected:
-  inline const Register& AppropriateZeroRegFor(const CPURegister& reg) const;
-
-  void LoadStore(const CPURegister& rt,
-                 const MemOperand& addr,
-                 LoadStoreOp op);
-  void LoadStorePair(const CPURegister& rt, const CPURegister& rt2,
-                     const MemOperand& addr, LoadStorePairOp op);
-  void LoadStoreStruct(const VRegister& vt, const MemOperand& addr,
-                       NEONLoadStoreMultiStructOp op);
-  void LoadStoreStruct1(const VRegister& vt, int reg_count,
-                        const MemOperand& addr);
-  void LoadStoreStructSingle(const VRegister& vt, uint32_t lane,
-                             const MemOperand& addr,
-                             NEONLoadStoreSingleStructOp op);
-  void LoadStoreStructSingleAllLanes(const VRegister& vt,
-                                     const MemOperand& addr,
-                                     NEONLoadStoreSingleStructOp op);
-  void LoadStoreStructVerify(const VRegister& vt, const MemOperand& addr,
-                             Instr op);
-
-  static bool IsImmLSPair(int64_t offset, unsigned size);
-
-  void Logical(const Register& rd,
-               const Register& rn,
-               const Operand& operand,
-               LogicalOp op);
-  void LogicalImmediate(const Register& rd,
-                        const Register& rn,
-                        unsigned n,
-                        unsigned imm_s,
-                        unsigned imm_r,
-                        LogicalOp op);
-
-  void ConditionalCompare(const Register& rn,
-                          const Operand& operand,
-                          StatusFlags nzcv,
-                          Condition cond,
-                          ConditionalCompareOp op);
-  static bool IsImmConditionalCompare(int64_t immediate);
-
-  void AddSubWithCarry(const Register& rd,
-                       const Register& rn,
-                       const Operand& operand,
-                       FlagsUpdate S,
-                       AddSubWithCarryOp op);
-
-  // Functions for emulating operands not directly supported by the instruction
-  // set.
-  void EmitShift(const Register& rd,
-                 const Register& rn,
-                 Shift shift,
-                 unsigned amount);
-  void EmitExtendShift(const Register& rd,
-                       const Register& rn,
-                       Extend extend,
-                       unsigned left_shift);
-
-  void AddSub(const Register& rd,
-              const Register& rn,
-              const Operand& operand,
-              FlagsUpdate S,
-              AddSubOp op);
-
-  static bool IsImmFP32(float imm);
-  static bool IsImmFP64(double imm);
-
-  // Find an appropriate LoadStoreOp or LoadStorePairOp for the specified
-  // registers. Only simple loads are supported; sign- and zero-extension (such
-  // as in LDPSW_x or LDRB_w) are not supported.
-  static inline LoadStoreOp LoadOpFor(const CPURegister& rt);
-  static inline LoadStorePairOp LoadPairOpFor(const CPURegister& rt,
-                                              const CPURegister& rt2);
-  static inline LoadStoreOp StoreOpFor(const CPURegister& rt);
-  static inline LoadStorePairOp StorePairOpFor(const CPURegister& rt,
-                                               const CPURegister& rt2);
-  static inline LoadLiteralOp LoadLiteralOpFor(const CPURegister& rt);
-
-  // Remove the specified branch from the unbound label link chain.
-  // If available, a veneer for this label can be used for other branches in the
-  // chain if the link chain cannot be fixed up without this branch.
-  void RemoveBranchFromLabelLinkChain(Instruction* branch, Label* label,
-                                      Instruction* label_veneer = nullptr);
-
-  // Prevent sharing of code target constant pool entries until
-  // EndBlockCodeTargetSharing is called. Calls to this function can be nested
-  // but must be followed by an equal number of call to
-  // EndBlockCodeTargetSharing.
-  void StartBlockCodeTargetSharing() { ++code_target_sharing_blocked_nesting_; }
-
-  // Resume sharing of constant pool code target entries. Needs to be called
-  // as many times as StartBlockCodeTargetSharing to have an effect.
-  void EndBlockCodeTargetSharing() { --code_target_sharing_blocked_nesting_; }
-
- private:
-  static uint32_t FPToImm8(double imm);
-
-  // Instruction helpers.
-  void MoveWide(const Register& rd,
-                uint64_t imm,
-                int shift,
-                MoveWideImmediateOp mov_op);
-  void DataProcShiftedRegister(const Register& rd,
-                               const Register& rn,
-                               const Operand& operand,
-                               FlagsUpdate S,
-                               Instr op);
-  void DataProcExtendedRegister(const Register& rd,
-                                const Register& rn,
-                                const Operand& operand,
-                                FlagsUpdate S,
-                                Instr op);
-  void ConditionalSelect(const Register& rd,
-                         const Register& rn,
-                         const Register& rm,
-                         Condition cond,
-                         ConditionalSelectOp op);
-  void DataProcessing1Source(const Register& rd,
-                             const Register& rn,
-                             DataProcessing1SourceOp op);
-  void DataProcessing3Source(const Register& rd,
-                             const Register& rn,
-                             const Register& rm,
-                             const Register& ra,
-                             DataProcessing3SourceOp op);
-  void FPDataProcessing1Source(const VRegister& fd, const VRegister& fn,
-                               FPDataProcessing1SourceOp op);
-  void FPDataProcessing2Source(const VRegister& fd, const VRegister& fn,
-                               const VRegister& fm,
-                               FPDataProcessing2SourceOp op);
-  void FPDataProcessing3Source(const VRegister& fd, const VRegister& fn,
-                               const VRegister& fm, const VRegister& fa,
-                               FPDataProcessing3SourceOp op);
-  void NEONAcrossLanesL(const VRegister& vd, const VRegister& vn,
-                        NEONAcrossLanesOp op);
-  void NEONAcrossLanes(const VRegister& vd, const VRegister& vn,
-                       NEONAcrossLanesOp op);
-  void NEONModifiedImmShiftLsl(const VRegister& vd, const int imm8,
-                               const int left_shift,
-                               NEONModifiedImmediateOp op);
-  void NEONModifiedImmShiftMsl(const VRegister& vd, const int imm8,
-                               const int shift_amount,
-                               NEONModifiedImmediateOp op);
-  void NEON3Same(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-                 NEON3SameOp vop);
-  void NEONFP3Same(const VRegister& vd, const VRegister& vn,
-                   const VRegister& vm, Instr op);
-  void NEON3DifferentL(const VRegister& vd, const VRegister& vn,
-                       const VRegister& vm, NEON3DifferentOp vop);
-  void NEON3DifferentW(const VRegister& vd, const VRegister& vn,
-                       const VRegister& vm, NEON3DifferentOp vop);
-  void NEON3DifferentHN(const VRegister& vd, const VRegister& vn,
-                        const VRegister& vm, NEON3DifferentOp vop);
-  void NEONFP2RegMisc(const VRegister& vd, const VRegister& vn,
-                      NEON2RegMiscOp vop, double value = 0.0);
-  void NEON2RegMisc(const VRegister& vd, const VRegister& vn,
-                    NEON2RegMiscOp vop, int value = 0);
-  void NEONFP2RegMisc(const VRegister& vd, const VRegister& vn, Instr op);
-  void NEONAddlp(const VRegister& vd, const VRegister& vn, NEON2RegMiscOp op);
-  void NEONPerm(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-                NEONPermOp op);
-  void NEONFPByElement(const VRegister& vd, const VRegister& vn,
-                       const VRegister& vm, int vm_index,
-                       NEONByIndexedElementOp op);
-  void NEONByElement(const VRegister& vd, const VRegister& vn,
-                     const VRegister& vm, int vm_index,
-                     NEONByIndexedElementOp op);
-  void NEONByElementL(const VRegister& vd, const VRegister& vn,
-                      const VRegister& vm, int vm_index,
-                      NEONByIndexedElementOp op);
-  void NEONShiftImmediate(const VRegister& vd, const VRegister& vn,
-                          NEONShiftImmediateOp op, int immh_immb);
-  void NEONShiftLeftImmediate(const VRegister& vd, const VRegister& vn,
-                              int shift, NEONShiftImmediateOp op);
-  void NEONShiftRightImmediate(const VRegister& vd, const VRegister& vn,
-                               int shift, NEONShiftImmediateOp op);
-  void NEONShiftImmediateL(const VRegister& vd, const VRegister& vn, int shift,
-                           NEONShiftImmediateOp op);
-  void NEONShiftImmediateN(const VRegister& vd, const VRegister& vn, int shift,
-                           NEONShiftImmediateOp op);
-  void NEONXtn(const VRegister& vd, const VRegister& vn, NEON2RegMiscOp vop);
-  void NEONTable(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-                 NEONTableOp op);
-
-  Instr LoadStoreStructAddrModeField(const MemOperand& addr);
-
-  // Label helpers.
-
-  // Return an offset for a label-referencing instruction, typically a branch.
-  int LinkAndGetByteOffsetTo(Label* label);
-
-  // This is the same as LinkAndGetByteOffsetTo, but return an offset
-  // suitable for fields that take instruction offsets.
-  inline int LinkAndGetInstructionOffsetTo(Label* label);
-
-  static constexpr int kStartOfLabelLinkChain = 0;
-
-  // Verify that a label's link chain is intact.
-  void CheckLabelLinkChain(Label const * label);
-
-  void RecordLiteral(int64_t imm, unsigned size);
-
-  // Postpone the generation of the constant pool for the specified number of
-  // instructions.
-  void BlockConstPoolFor(int instructions);
-
-  // Set how far from current pc the next constant pool check will be.
-  void SetNextConstPoolCheckIn(int instructions) {
-    next_constant_pool_check_ = pc_offset() + instructions * kInstructionSize;
-  }
-
-  // Emit the instruction at pc_.
-  void Emit(Instr instruction) {
-    STATIC_ASSERT(sizeof(*pc_) == 1);
-    STATIC_ASSERT(sizeof(instruction) == kInstructionSize);
-    DCHECK((pc_ + sizeof(instruction)) <= (buffer_ + buffer_size_));
-
-    memcpy(pc_, &instruction, sizeof(instruction));
-    pc_ += sizeof(instruction);
-    CheckBuffer();
-  }
-
-  // Emit data inline in the instruction stream.
-  void EmitData(void const * data, unsigned size) {
-    DCHECK_EQ(sizeof(*pc_), 1);
-    DCHECK((pc_ + size) <= (buffer_ + buffer_size_));
-
-    // TODO(all): Somehow register we have some data here. Then we can
-    // disassemble it correctly.
-    memcpy(pc_, data, size);
-    pc_ += size;
-    CheckBuffer();
-  }
-
-  void GrowBuffer();
-  void CheckBufferSpace();
-  void CheckBuffer();
-
-  // Pc offset of the next constant pool check.
-  int next_constant_pool_check_;
-
-  // Constant pool generation
-  // Pools are emitted in the instruction stream. They are emitted when:
-  //  * the distance to the first use is above a pre-defined distance or
-  //  * the numbers of entries in the pool is above a pre-defined size or
-  //  * code generation is finished
-  // If a pool needs to be emitted before code generation is finished a branch
-  // over the emitted pool will be inserted.
-
-  // Constants in the pool may be addresses of functions that gets relocated;
-  // if so, a relocation info entry is associated to the constant pool entry.
-
-  // Repeated checking whether the constant pool should be emitted is rather
-  // expensive. By default we only check again once a number of instructions
-  // has been generated. That also means that the sizing of the buffers is not
-  // an exact science, and that we rely on some slop to not overrun buffers.
-  static constexpr int kCheckConstPoolInterval = 128;
-
-  // Distance to first use after a which a pool will be emitted. Pool entries
-  // are accessed with pc relative load therefore this cannot be more than
-  // 1 * MB. Since constant pool emission checks are interval based this value
-  // is an approximation.
-  static constexpr int kApproxMaxDistToConstPool = 64 * KB;
-
-  // Number of pool entries after which a pool will be emitted. Since constant
-  // pool emission checks are interval based this value is an approximation.
-  static constexpr int kApproxMaxPoolEntryCount = 512;
-
-  // Emission of the constant pool may be blocked in some code sequences.
-  int const_pool_blocked_nesting_;  // Block emission if this is not zero.
-  int no_const_pool_before_;  // Block emission before this pc offset.
-
-  // Emission of the veneer pools may be blocked in some code sequences.
-  int veneer_pool_blocked_nesting_;  // Block emission if this is not zero.
-
-  // Sharing of code target entries may be blocked in some code sequences.
-  int code_target_sharing_blocked_nesting_;
-  bool IsCodeTargetSharingAllowed() const {
-    return code_target_sharing_blocked_nesting_ == 0;
-  }
-
-  // Relocation info generation
-  // Each relocation is encoded as a variable size value
-  static constexpr int kMaxRelocSize = RelocInfoWriter::kMaxSize;
-  RelocInfoWriter reloc_info_writer;
-
-  // Internal reference positions, required for (potential) patching in
-  // GrowBuffer(); contains only those internal references whose labels
-  // are already bound.
-  std::deque<int> internal_reference_positions_;
-
-  // Relocation info records are also used during code generation as temporary
-  // containers for constants and code target addresses until they are emitted
-  // to the constant pool. These pending relocation info records are temporarily
-  // stored in a separate buffer until a constant pool is emitted.
-  // If every instruction in a long sequence is accessing the pool, we need one
-  // pending relocation entry per instruction.
-
-  // The pending constant pool.
-  ConstPool constpool_;
-
- protected:
-  // Code generation
-  // The relocation writer's position is at least kGap bytes below the end of
-  // the generated instructions. This is so that multi-instruction sequences do
-  // not have to check for overflow. The same is true for writes of large
-  // relocation info entries, and debug strings encoded in the instruction
-  // stream.
-  static constexpr int kGap = 128;
-
- public:
-#ifdef DEBUG
-  // Functions used for testing.
-  int GetConstantPoolEntriesSizeForTesting() const {
-    // Do not include branch over the pool.
-    return constpool_.EntryCount() * kPointerSize;
-  }
-
-  static constexpr int GetCheckConstPoolIntervalForTesting() {
-    return kCheckConstPoolInterval;
-  }
-
-  static constexpr int GetApproxMaxDistToConstPoolForTesting() {
-    return kApproxMaxDistToConstPool;
-  }
-#endif
-
-  class FarBranchInfo {
-   public:
-    FarBranchInfo(int offset, Label* label)
-        : pc_offset_(offset), label_(label) {}
-    // Offset of the branch in the code generation buffer.
-    int pc_offset_;
-    // The label branched to.
-    Label* label_;
-  };
-
- protected:
-  // Information about unresolved (forward) branches.
-  // The Assembler is only allowed to delete out-of-date information from here
-  // after a label is bound. The MacroAssembler uses this information to
-  // generate veneers.
-  //
-  // The second member gives information about the unresolved branch. The first
-  // member of the pair is the maximum offset that the branch can reach in the
-  // buffer. The map is sorted according to this reachable offset, allowing to
-  // easily check when veneers need to be emitted.
-  // Note that the maximum reachable offset (first member of the pairs) should
-  // always be positive but has the same type as the return value for
-  // pc_offset() for convenience.
-  std::multimap<int, FarBranchInfo> unresolved_branches_;
-
-  // We generate a veneer for a branch if we reach within this distance of the
-  // limit of the range.
-  static constexpr int kVeneerDistanceMargin = 1 * KB;
-  // The factor of 2 is a finger in the air guess. With a default margin of
-  // 1KB, that leaves us an addional 256 instructions to avoid generating a
-  // protective branch.
-  static constexpr int kVeneerNoProtectionFactor = 2;
-  static constexpr int kVeneerDistanceCheckMargin =
-      kVeneerNoProtectionFactor * kVeneerDistanceMargin;
-  int unresolved_branches_first_limit() const {
-    DCHECK(!unresolved_branches_.empty());
-    return unresolved_branches_.begin()->first;
-  }
-  // This is similar to next_constant_pool_check_ and helps reduce the overhead
-  // of checking for veneer pools.
-  // It is maintained to the closest unresolved branch limit minus the maximum
-  // veneer margin (or kMaxInt if there are no unresolved branches).
-  int next_veneer_pool_check_;
-
- private:
-  // Avoid overflows for displacements etc.
-  static const int kMaximalBufferSize = 512 * MB;
-
-  // If a veneer is emitted for a branch instruction, that instruction must be
-  // removed from the associated label's link chain so that the assembler does
-  // not later attempt (likely unsuccessfully) to patch it to branch directly to
-  // the label.
-  void DeleteUnresolvedBranchInfoForLabel(Label* label);
-  // This function deletes the information related to the label by traversing
-  // the label chain, and for each PC-relative instruction in the chain checking
-  // if pending unresolved information exists. Its complexity is proportional to
-  // the length of the label chain.
-  void DeleteUnresolvedBranchInfoForLabelTraverse(Label* label);
-
-  // The following functions help with avoiding allocations of embedded heap
-  // objects during the code assembly phase. {RequestHeapObject} records the
-  // need for a future heap number allocation or code stub generation. After
-  // code assembly, {AllocateAndInstallRequestedHeapObjects} will allocate these
-  // objects and place them where they are expected (determined by the pc offset
-  // associated with each request). That is, for each request, it will patch the
-  // dummy heap object handle that we emitted during code assembly with the
-  // actual heap object handle.
-  void RequestHeapObject(HeapObjectRequest request);
-  void AllocateAndInstallRequestedHeapObjects(Isolate* isolate);
-
-  std::forward_list<HeapObjectRequest> heap_object_requests_;
-
- private:
-  friend class EnsureSpace;
-  friend class ConstPool;
-};
-
-class PatchingAssembler : public Assembler {
- public:
-  // Create an Assembler with a buffer starting at 'start'.
-  // The buffer size is
-  //   size of instructions to patch + kGap
-  // Where kGap is the distance from which the Assembler tries to grow the
-  // buffer.
-  // If more or fewer instructions than expected are generated or if some
-  // relocation information takes space in the buffer, the PatchingAssembler
-  // will crash trying to grow the buffer.
-
-  // This version will flush at destruction.
-  PatchingAssembler(Isolate* isolate, byte* start, unsigned count)
-      : PatchingAssembler(IsolateData(isolate), start, count) {
-    CHECK_NOT_NULL(isolate);
-    isolate_ = isolate;
-  }
-
-  // This version will not flush.
-  PatchingAssembler(IsolateData isolate_data, byte* start, unsigned count)
-      : Assembler(isolate_data, start, count * kInstructionSize + kGap),
-        isolate_(nullptr) {
-    // Block constant pool emission.
-    StartBlockPools();
-  }
-
-  ~PatchingAssembler() {
-    // Const pool should still be blocked.
-    DCHECK(is_const_pool_blocked());
-    EndBlockPools();
-    // Verify we have generated the number of instruction we expected.
-    DCHECK((pc_offset() + kGap) == buffer_size_);
-    // Verify no relocation information has been emitted.
-    DCHECK(IsConstPoolEmpty());
-    // Flush the Instruction cache.
-    size_t length = buffer_size_ - kGap;
-    if (isolate_ != nullptr) Assembler::FlushICache(isolate_, buffer_, length);
-  }
-
-  // See definition of PatchAdrFar() for details.
-  static constexpr int kAdrFarPatchableNNops = 2;
-  static constexpr int kAdrFarPatchableNInstrs = kAdrFarPatchableNNops + 2;
-  void PatchAdrFar(int64_t target_offset);
-
- private:
-  Isolate* isolate_;
-};
-
-
-class EnsureSpace BASE_EMBEDDED {
- public:
-  explicit EnsureSpace(Assembler* assembler) {
-    assembler->CheckBufferSpace();
-  }
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_ARM64_ASSEMBLER_ARM64_H_
diff --git a/src/v8/src/arm64/code-stubs-arm64.cc b/src/v8/src/arm64/code-stubs-arm64.cc
deleted file mode 100644
index 52f92b6..0000000
--- a/src/v8/src/arm64/code-stubs-arm64.cc
+++ /dev/null
@@ -1,1388 +0,0 @@
-// Copyright 2013 the V8 project 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 V8_TARGET_ARCH_ARM64
-
-#include "src/api-arguments.h"
-#include "src/arm64/assembler-arm64-inl.h"
-#include "src/arm64/macro-assembler-arm64-inl.h"
-#include "src/bootstrapper.h"
-#include "src/code-stubs.h"
-#include "src/counters.h"
-#include "src/frame-constants.h"
-#include "src/frames.h"
-#include "src/heap/heap-inl.h"
-#include "src/ic/ic.h"
-#include "src/ic/stub-cache.h"
-#include "src/isolate.h"
-#include "src/objects/regexp-match-info.h"
-#include "src/regexp/jsregexp.h"
-#include "src/regexp/regexp-macro-assembler.h"
-#include "src/runtime/runtime.h"
-
-#include "src/arm64/code-stubs-arm64.h"  // Cannot be the first include.
-
-namespace v8 {
-namespace internal {
-
-#define __ ACCESS_MASM(masm)
-
-void ArrayNArgumentsConstructorStub::Generate(MacroAssembler* masm) {
-  __ Mov(x5, Operand(x0, LSL, kPointerSizeLog2));
-  __ Str(x1, MemOperand(__ StackPointer(), x5));
-  __ Push(x1, x2);
-  __ Add(x0, x0, Operand(3));
-  __ TailCallRuntime(Runtime::kNewArray);
-}
-
-
-void DoubleToIStub::Generate(MacroAssembler* masm) {
-  Label done;
-  Register result = destination();
-
-  DCHECK(result.Is64Bits());
-
-  UseScratchRegisterScope temps(masm);
-  Register scratch1 = temps.AcquireX();
-  Register scratch2 = temps.AcquireX();
-  DoubleRegister double_scratch = temps.AcquireD();
-
-  __ Peek(double_scratch, 0);
-  // Try to convert with a FPU convert instruction.  This handles all
-  // non-saturating cases.
-  __ TryConvertDoubleToInt64(result, double_scratch, &done);
-  __ Fmov(result, double_scratch);
-
-  // If we reach here we need to manually convert the input to an int32.
-
-  // Extract the exponent.
-  Register exponent = scratch1;
-  __ Ubfx(exponent, result, HeapNumber::kMantissaBits,
-          HeapNumber::kExponentBits);
-
-  // It the exponent is >= 84 (kMantissaBits + 32), the result is always 0 since
-  // the mantissa gets shifted completely out of the int32_t result.
-  __ Cmp(exponent, HeapNumber::kExponentBias + HeapNumber::kMantissaBits + 32);
-  __ CzeroX(result, ge);
-  __ B(ge, &done);
-
-  // The Fcvtzs sequence handles all cases except where the conversion causes
-  // signed overflow in the int64_t target. Since we've already handled
-  // exponents >= 84, we can guarantee that 63 <= exponent < 84.
-
-  if (masm->emit_debug_code()) {
-    __ Cmp(exponent, HeapNumber::kExponentBias + 63);
-    // Exponents less than this should have been handled by the Fcvt case.
-    __ Check(ge, AbortReason::kUnexpectedValue);
-  }
-
-  // Isolate the mantissa bits, and set the implicit '1'.
-  Register mantissa = scratch2;
-  __ Ubfx(mantissa, result, 0, HeapNumber::kMantissaBits);
-  __ Orr(mantissa, mantissa, 1UL << HeapNumber::kMantissaBits);
-
-  // Negate the mantissa if necessary.
-  __ Tst(result, kXSignMask);
-  __ Cneg(mantissa, mantissa, ne);
-
-  // Shift the mantissa bits in the correct place. We know that we have to shift
-  // it left here, because exponent >= 63 >= kMantissaBits.
-  __ Sub(exponent, exponent,
-         HeapNumber::kExponentBias + HeapNumber::kMantissaBits);
-  __ Lsl(result, mantissa, exponent);
-
-  __ Bind(&done);
-  __ Ret();
-}
-
-
-void MathPowStub::Generate(MacroAssembler* masm) {
-  // Stack on entry:
-  // sp[0]: Exponent (as a tagged value).
-  // sp[1]: Base (as a tagged value).
-  //
-  // The (tagged) result will be returned in x0, as a heap number.
-
-  Register exponent_tagged = MathPowTaggedDescriptor::exponent();
-  DCHECK(exponent_tagged.is(x11));
-  Register exponent_integer = MathPowIntegerDescriptor::exponent();
-  DCHECK(exponent_integer.is(x12));
-  Register saved_lr = x19;
-  VRegister result_double = d0;
-  VRegister base_double = d0;
-  VRegister exponent_double = d1;
-  VRegister base_double_copy = d2;
-  VRegister scratch1_double = d6;
-  VRegister scratch0_double = d7;
-
-  // A fast-path for integer exponents.
-  Label exponent_is_smi, exponent_is_integer;
-  // Allocate a heap number for the result, and return it.
-  Label done;
-
-  // Unpack the inputs.
-  if (exponent_type() == TAGGED) {
-    __ JumpIfSmi(exponent_tagged, &exponent_is_smi);
-    __ Ldr(exponent_double,
-           FieldMemOperand(exponent_tagged, HeapNumber::kValueOffset));
-  }
-
-  // Handle double (heap number) exponents.
-  if (exponent_type() != INTEGER) {
-    // Detect integer exponents stored as doubles and handle those in the
-    // integer fast-path.
-    __ TryRepresentDoubleAsInt64(exponent_integer, exponent_double,
-                                 scratch0_double, &exponent_is_integer);
-
-    {
-      AllowExternalCallThatCantCauseGC scope(masm);
-      __ Mov(saved_lr, lr);
-      __ CallCFunction(
-          ExternalReference::power_double_double_function(isolate()), 0, 2);
-      __ Mov(lr, saved_lr);
-      __ B(&done);
-    }
-
-    // Handle SMI exponents.
-    __ Bind(&exponent_is_smi);
-    //  x10   base_tagged       The tagged base (input).
-    //  x11   exponent_tagged   The tagged exponent (input).
-    //  d1    base_double       The base as a double.
-    __ SmiUntag(exponent_integer, exponent_tagged);
-  }
-
-  __ Bind(&exponent_is_integer);
-  //  x10   base_tagged       The tagged base (input).
-  //  x11   exponent_tagged   The tagged exponent (input).
-  //  x12   exponent_integer  The exponent as an integer.
-  //  d1    base_double       The base as a double.
-
-  // Find abs(exponent). For negative exponents, we can find the inverse later.
-  Register exponent_abs = x13;
-  __ Cmp(exponent_integer, 0);
-  __ Cneg(exponent_abs, exponent_integer, mi);
-  //  x13   exponent_abs      The value of abs(exponent_integer).
-
-  // Repeatedly multiply to calculate the power.
-  //  result = 1.0;
-  //  For each bit n (exponent_integer{n}) {
-  //    if (exponent_integer{n}) {
-  //      result *= base;
-  //    }
-  //    base *= base;
-  //    if (remaining bits in exponent_integer are all zero) {
-  //      break;
-  //    }
-  //  }
-  Label power_loop, power_loop_entry, power_loop_exit;
-  __ Fmov(scratch1_double, base_double);
-  __ Fmov(base_double_copy, base_double);
-  __ Fmov(result_double, 1.0);
-  __ B(&power_loop_entry);
-
-  __ Bind(&power_loop);
-  __ Fmul(scratch1_double, scratch1_double, scratch1_double);
-  __ Lsr(exponent_abs, exponent_abs, 1);
-  __ Cbz(exponent_abs, &power_loop_exit);
-
-  __ Bind(&power_loop_entry);
-  __ Tbz(exponent_abs, 0, &power_loop);
-  __ Fmul(result_double, result_double, scratch1_double);
-  __ B(&power_loop);
-
-  __ Bind(&power_loop_exit);
-
-  // If the exponent was positive, result_double holds the result.
-  __ Tbz(exponent_integer, kXSignBit, &done);
-
-  // The exponent was negative, so find the inverse.
-  __ Fmov(scratch0_double, 1.0);
-  __ Fdiv(result_double, scratch0_double, result_double);
-  // ECMA-262 only requires Math.pow to return an 'implementation-dependent
-  // approximation' of base^exponent. However, mjsunit/math-pow uses Math.pow
-  // to calculate the subnormal value 2^-1074. This method of calculating
-  // negative powers doesn't work because 2^1074 overflows to infinity. To
-  // catch this corner-case, we bail out if the result was 0. (This can only
-  // occur if the divisor is infinity or the base is zero.)
-  __ Fcmp(result_double, 0.0);
-  __ B(&done, ne);
-
-  AllowExternalCallThatCantCauseGC scope(masm);
-  __ Mov(saved_lr, lr);
-  __ Fmov(base_double, base_double_copy);
-  __ Scvtf(exponent_double, exponent_integer);
-  __ CallCFunction(ExternalReference::power_double_double_function(isolate()),
-                   0, 2);
-  __ Mov(lr, saved_lr);
-  __ Bind(&done);
-  __ Ret();
-}
-
-void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) {
-  // It is important that the following stubs are generated in this order
-  // because pregenerated stubs can only call other pregenerated stubs.
-  CEntryStub::GenerateAheadOfTime(isolate);
-  CommonArrayConstructorStub::GenerateStubsAheadOfTime(isolate);
-  StoreFastElementStub::GenerateAheadOfTime(isolate);
-}
-
-
-void CodeStub::GenerateFPStubs(Isolate* isolate) {
-  // Floating-point code doesn't get special handling in ARM64, so there's
-  // nothing to do here.
-  USE(isolate);
-}
-
-Movability CEntryStub::NeedsImmovableCode() {
-  // CEntryStub stores the return address on the stack before calling into
-  // C++ code. In some cases, the VM accesses this address, but it is not used
-  // when the C++ code returns to the stub because LR holds the return address
-  // in AAPCS64. If the stub is moved (perhaps during a GC), we could end up
-  // returning to dead code.
-  // TODO(jbramley): Whilst this is the only analysis that makes sense, I can't
-  // find any comment to confirm this, and I don't hit any crashes whatever
-  // this function returns. The anaylsis should be properly confirmed.
-  return kImmovable;
-}
-
-
-void CEntryStub::GenerateAheadOfTime(Isolate* isolate) {
-  CEntryStub stub(isolate, 1, kDontSaveFPRegs);
-  stub.GetCode();
-  CEntryStub stub_fp(isolate, 1, kSaveFPRegs);
-  stub_fp.GetCode();
-}
-
-
-void CEntryStub::Generate(MacroAssembler* masm) {
-  // The Abort mechanism relies on CallRuntime, which in turn relies on
-  // CEntryStub, so until this stub has been generated, we have to use a
-  // fall-back Abort mechanism.
-  //
-  // Note that this stub must be generated before any use of Abort.
-  MacroAssembler::NoUseRealAbortsScope no_use_real_aborts(masm);
-
-  ASM_LOCATION("CEntryStub::Generate entry");
-  ProfileEntryHookStub::MaybeCallEntryHook(masm);
-
-  // Register parameters:
-  //    x0: argc (including receiver, untagged)
-  //    x1: target
-  // If argv_in_register():
-  //    x11: argv (pointer to first argument)
-  //
-  // The stack on entry holds the arguments and the receiver, with the receiver
-  // at the highest address:
-  //
-  //    sp]argc-1]: receiver
-  //    sp[argc-2]: arg[argc-2]
-  //    ...           ...
-  //    sp[1]:      arg[1]
-  //    sp[0]:      arg[0]
-  //
-  // The arguments are in reverse order, so that arg[argc-2] is actually the
-  // first argument to the target function and arg[0] is the last.
-  const Register& argc_input = x0;
-  const Register& target_input = x1;
-
-  // Calculate argv, argc and the target address, and store them in
-  // callee-saved registers so we can retry the call without having to reload
-  // these arguments.
-  // TODO(jbramley): If the first call attempt succeeds in the common case (as
-  // it should), then we might be better off putting these parameters directly
-  // into their argument registers, rather than using callee-saved registers and
-  // preserving them on the stack.
-  const Register& argv = x21;
-  const Register& argc = x22;
-  const Register& target = x23;
-
-  // Derive argv from the stack pointer so that it points to the first argument
-  // (arg[argc-2]), or just below the receiver in case there are no arguments.
-  //  - Adjust for the arg[] array.
-  Register temp_argv = x11;
-  if (!argv_in_register()) {
-    __ SlotAddress(temp_argv, x0);
-    //  - Adjust for the receiver.
-    __ Sub(temp_argv, temp_argv, 1 * kPointerSize);
-  }
-
-  // Reserve three slots to preserve x21-x23 callee-saved registers.
-  int extra_stack_space = 3;
-  // Enter the exit frame.
-  FrameScope scope(masm, StackFrame::MANUAL);
-  __ EnterExitFrame(
-      save_doubles(), x10, extra_stack_space,
-      is_builtin_exit() ? StackFrame::BUILTIN_EXIT : StackFrame::EXIT);
-  DCHECK(csp.Is(__ StackPointer()));
-
-  // Poke callee-saved registers into reserved space.
-  __ Poke(argv, 1 * kPointerSize);
-  __ Poke(argc, 2 * kPointerSize);
-  __ Poke(target, 3 * kPointerSize);
-
-  // We normally only keep tagged values in callee-saved registers, as they
-  // could be pushed onto the stack by called stubs and functions, and on the
-  // stack they can confuse the GC. However, we're only calling C functions
-  // which can push arbitrary data onto the stack anyway, and so the GC won't
-  // examine that part of the stack.
-  __ Mov(argc, argc_input);
-  __ Mov(target, target_input);
-  __ Mov(argv, temp_argv);
-
-  // x21 : argv
-  // x22 : argc
-  // x23 : call target
-  //
-  // The stack (on entry) holds the arguments and the receiver, with the
-  // receiver at the highest address:
-  //
-  //         argv[8]:     receiver
-  // argv -> argv[0]:     arg[argc-2]
-  //         ...          ...
-  //         argv[...]:   arg[1]
-  //         argv[...]:   arg[0]
-  //
-  // Immediately below (after) this is the exit frame, as constructed by
-  // EnterExitFrame:
-  //         fp[8]:    CallerPC (lr)
-  //   fp -> fp[0]:    CallerFP (old fp)
-  //         fp[-8]:   Space reserved for SPOffset.
-  //         fp[-16]:  CodeObject()
-  //         csp[...]: Saved doubles, if saved_doubles is true.
-  //         csp[32]:  Alignment padding, if necessary.
-  //         csp[24]:  Preserved x23 (used for target).
-  //         csp[16]:  Preserved x22 (used for argc).
-  //         csp[8]:   Preserved x21 (used for argv).
-  //  csp -> csp[0]:   Space reserved for the return address.
-  //
-  // After a successful call, the exit frame, preserved registers (x21-x23) and
-  // the arguments (including the receiver) are dropped or popped as
-  // appropriate. The stub then returns.
-  //
-  // After an unsuccessful call, the exit frame and suchlike are left
-  // untouched, and the stub either throws an exception by jumping to one of
-  // the exception_returned label.
-
-  DCHECK(csp.Is(__ StackPointer()));
-
-  // Prepare AAPCS64 arguments to pass to the builtin.
-  __ Mov(x0, argc);
-  __ Mov(x1, argv);
-  __ Mov(x2, ExternalReference::isolate_address(isolate()));
-
-  Label return_location;
-  __ Adr(x12, &return_location);
-  __ Poke(x12, 0);
-
-  if (__ emit_debug_code()) {
-    // Verify that the slot below fp[kSPOffset]-8 points to the return location
-    // (currently in x12).
-    UseScratchRegisterScope temps(masm);
-    Register temp = temps.AcquireX();
-    __ Ldr(temp, MemOperand(fp, ExitFrameConstants::kSPOffset));
-    __ Ldr(temp, MemOperand(temp, -static_cast<int64_t>(kXRegSize)));
-    __ Cmp(temp, x12);
-    __ Check(eq, AbortReason::kReturnAddressNotFoundInFrame);
-  }
-
-  // Call the builtin.
-  __ Blr(target);
-  __ Bind(&return_location);
-
-  // Result returned in x0 or x1:x0 - do not destroy these registers!
-
-  //  x0    result0      The return code from the call.
-  //  x1    result1      For calls which return ObjectPair.
-  //  x21   argv
-  //  x22   argc
-  //  x23   target
-  const Register& result = x0;
-
-  // Check result for exception sentinel.
-  Label exception_returned;
-  __ CompareRoot(result, Heap::kExceptionRootIndex);
-  __ B(eq, &exception_returned);
-
-  // The call succeeded, so unwind the stack and return.
-
-  // Restore callee-saved registers x21-x23.
-  __ Mov(x11, argc);
-
-  __ Peek(argv, 1 * kPointerSize);
-  __ Peek(argc, 2 * kPointerSize);
-  __ Peek(target, 3 * kPointerSize);
-
-  __ LeaveExitFrame(save_doubles(), x10, x9);
-  if (!argv_in_register()) {
-    // Drop the remaining stack slots and return from the stub.
-    __ DropArguments(x11);
-  }
-  __ AssertFPCRState();
-  __ Ret();
-
-  // Handling of exception.
-  __ Bind(&exception_returned);
-
-  ExternalReference pending_handler_context_address(
-      IsolateAddressId::kPendingHandlerContextAddress, isolate());
-  ExternalReference pending_handler_entrypoint_address(
-      IsolateAddressId::kPendingHandlerEntrypointAddress, isolate());
-  ExternalReference pending_handler_fp_address(
-      IsolateAddressId::kPendingHandlerFPAddress, isolate());
-  ExternalReference pending_handler_sp_address(
-      IsolateAddressId::kPendingHandlerSPAddress, isolate());
-
-  // Ask the runtime for help to determine the handler. This will set x0 to
-  // contain the current pending exception, don't clobber it.
-  ExternalReference find_handler(Runtime::kUnwindAndFindExceptionHandler,
-                                 isolate());
-  DCHECK(csp.Is(masm->StackPointer()));
-  {
-    FrameScope scope(masm, StackFrame::MANUAL);
-    __ Mov(x0, 0);  // argc.
-    __ Mov(x1, 0);  // argv.
-    __ Mov(x2, ExternalReference::isolate_address(isolate()));
-    __ CallCFunction(find_handler, 3);
-  }
-
-  // Retrieve the handler context, SP and FP.
-  __ Mov(cp, Operand(pending_handler_context_address));
-  __ Ldr(cp, MemOperand(cp));
-  {
-    UseScratchRegisterScope temps(masm);
-    Register scratch = temps.AcquireX();
-    __ Mov(scratch, Operand(pending_handler_sp_address));
-    __ Ldr(scratch, MemOperand(scratch));
-    __ Mov(csp, scratch);
-  }
-  __ Mov(fp, Operand(pending_handler_fp_address));
-  __ Ldr(fp, MemOperand(fp));
-
-  // If the handler is a JS frame, restore the context to the frame. Note that
-  // the context will be set to (cp == 0) for non-JS frames.
-  Label not_js_frame;
-  __ Cbz(cp, &not_js_frame);
-  __ Str(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
-  __ Bind(&not_js_frame);
-
-  // Compute the handler entry address and jump to it.
-  __ Mov(x10, Operand(pending_handler_entrypoint_address));
-  __ Ldr(x10, MemOperand(x10));
-  __ Br(x10);
-}
-
-// This is the entry point from C++. 5 arguments are provided in x0-x4.
-// See use of the JSEntryFunction for example in src/execution.cc.
-// Input:
-//   x0: code entry.
-//   x1: function.
-//   x2: receiver.
-//   x3: argc.
-//   x4: argv.
-// Output:
-//   x0: result.
-void JSEntryStub::Generate(MacroAssembler* masm) {
-  Register code_entry = x0;
-
-  // Enable instruction instrumentation. This only works on the simulator, and
-  // will have no effect on the model or real hardware.
-  __ EnableInstrumentation();
-
-  Label invoke, handler_entry, exit;
-
-  __ PushCalleeSavedRegisters();
-
-  ProfileEntryHookStub::MaybeCallEntryHook(masm);
-
-  // Set up the reserved register for 0.0.
-  __ Fmov(fp_zero, 0.0);
-
-  // Initialize the root array register
-  __ InitializeRootRegister();
-
-  // Build an entry frame (see layout below).
-  StackFrame::Type marker = type();
-  int64_t bad_frame_pointer = -1L;  // Bad frame pointer to fail if it is used.
-  __ Mov(x13, bad_frame_pointer);
-  __ Mov(x12, StackFrame::TypeToMarker(marker));
-  __ Mov(x11, ExternalReference(IsolateAddressId::kCEntryFPAddress, isolate()));
-  __ Ldr(x10, MemOperand(x11));
-
-  __ Push(x13, x12, xzr, x10);
-  // Set up fp.
-  __ Sub(fp, __ StackPointer(), EntryFrameConstants::kCallerFPOffset);
-
-  // Push the JS entry frame marker. Also set js_entry_sp if this is the
-  // outermost JS call.
-  Label non_outermost_js, done;
-  ExternalReference js_entry_sp(IsolateAddressId::kJSEntrySPAddress, isolate());
-  __ Mov(x10, ExternalReference(js_entry_sp));
-  __ Ldr(x11, MemOperand(x10));
-
-  // Select between the inner and outermost frame marker, based on the JS entry
-  // sp. We assert that the inner marker is zero, so we can use xzr to save a
-  // move instruction.
-  DCHECK_EQ(StackFrame::INNER_JSENTRY_FRAME, 0);
-  __ Cmp(x11, 0);  // If x11 is zero, this is the outermost frame.
-  __ Csel(x12, xzr, StackFrame::OUTERMOST_JSENTRY_FRAME, ne);
-  __ B(ne, &done);
-  __ Str(fp, MemOperand(x10));
-
-  __ Bind(&done);
-  __ Push(x12, padreg);
-
-  // The frame set up looks like this:
-  // sp[0] : padding.
-  // sp[1] : JS entry frame marker.
-  // sp[2] : C entry FP.
-  // sp[3] : stack frame marker.
-  // sp[4] : stack frame marker.
-  // sp[5] : bad frame pointer 0xFFF...FF   <- fp points here.
-
-  // Jump to a faked try block that does the invoke, with a faked catch
-  // block that sets the pending exception.
-  __ B(&invoke);
-
-  // Prevent the constant pool from being emitted between the record of the
-  // handler_entry position and the first instruction of the sequence here.
-  // There is no risk because Assembler::Emit() emits the instruction before
-  // checking for constant pool emission, but we do not want to depend on
-  // that.
-  {
-    Assembler::BlockPoolsScope block_pools(masm);
-    __ bind(&handler_entry);
-    handler_offset_ = handler_entry.pos();
-    // Caught exception: Store result (exception) in the pending exception
-    // field in the JSEnv and return a failure sentinel. Coming in here the
-    // fp will be invalid because the PushTryHandler below sets it to 0 to
-    // signal the existence of the JSEntry frame.
-    __ Mov(x10, Operand(ExternalReference(
-                    IsolateAddressId::kPendingExceptionAddress, isolate())));
-  }
-  __ Str(code_entry, MemOperand(x10));
-  __ LoadRoot(x0, Heap::kExceptionRootIndex);
-  __ B(&exit);
-
-  // Invoke: Link this frame into the handler chain.
-  __ Bind(&invoke);
-
-  // Push new stack handler.
-  static_assert(StackHandlerConstants::kSize == 2 * kPointerSize,
-                "Unexpected offset for StackHandlerConstants::kSize");
-  static_assert(StackHandlerConstants::kNextOffset == 0 * kPointerSize,
-                "Unexpected offset for StackHandlerConstants::kNextOffset");
-
-  // Link the current handler as the next handler.
-  __ Mov(x11, ExternalReference(IsolateAddressId::kHandlerAddress, isolate()));
-  __ Ldr(x10, MemOperand(x11));
-  __ Push(padreg, x10);
-
-  // Set this new handler as the current one.
-  {
-    UseScratchRegisterScope temps(masm);
-    Register scratch = temps.AcquireX();
-    __ Mov(scratch, __ StackPointer());
-    __ Str(scratch, MemOperand(x11));
-  }
-
-  // If an exception not caught by another handler occurs, this handler
-  // returns control to the code after the B(&invoke) above, which
-  // restores all callee-saved registers (including cp and fp) to their
-  // saved values before returning a failure to C.
-
-  // Invoke the function by calling through the JS entry trampoline builtin.
-  // Notice that we cannot store a reference to the trampoline code directly in
-  // this stub, because runtime stubs are not traversed when doing GC.
-
-  // Expected registers by Builtins::JSEntryTrampoline
-  // x0: code entry.
-  // x1: function.
-  // x2: receiver.
-  // x3: argc.
-  // x4: argv.
-  __ Call(EntryTrampoline(), RelocInfo::CODE_TARGET);
-
-  // Pop the stack handler and unlink this frame from the handler chain.
-  static_assert(StackHandlerConstants::kNextOffset == 0 * kPointerSize,
-                "Unexpected offset for StackHandlerConstants::kNextOffset");
-  __ Pop(x10, padreg);
-  __ Mov(x11, ExternalReference(IsolateAddressId::kHandlerAddress, isolate()));
-  __ Drop(StackHandlerConstants::kSlotCount - 2);
-  __ Str(x10, MemOperand(x11));
-
-  __ Bind(&exit);
-  // x0 holds the result.
-  // The stack pointer points to the top of the entry frame pushed on entry from
-  // C++ (at the beginning of this stub):
-  // sp[0] : padding.
-  // sp[1] : JS entry frame marker.
-  // sp[2] : C entry FP.
-  // sp[3] : stack frame marker.
-  // sp[4] : stack frame marker.
-  // sp[5] : bad frame pointer 0xFFF...FF   <- fp points here.
-
-  // Check if the current stack frame is marked as the outermost JS frame.
-  Label non_outermost_js_2;
-  {
-    Register c_entry_fp = x11;
-    __ PeekPair(x10, c_entry_fp, 1 * kPointerSize);
-    __ Cmp(x10, StackFrame::OUTERMOST_JSENTRY_FRAME);
-    __ B(ne, &non_outermost_js_2);
-    __ Mov(x12, ExternalReference(js_entry_sp));
-    __ Str(xzr, MemOperand(x12));
-    __ Bind(&non_outermost_js_2);
-
-    // Restore the top frame descriptors from the stack.
-    __ Mov(x12,
-           ExternalReference(IsolateAddressId::kCEntryFPAddress, isolate()));
-    __ Str(c_entry_fp, MemOperand(x12));
-  }
-
-  // Reset the stack to the callee saved registers.
-  static_assert(EntryFrameConstants::kFixedFrameSize % (2 * kPointerSize) == 0,
-                "Size of entry frame is not a multiple of 16 bytes");
-  __ Drop(EntryFrameConstants::kFixedFrameSize / kPointerSize);
-  // Restore the callee-saved registers and return.
-  __ PopCalleeSavedRegisters();
-  __ Ret();
-}
-
-// The entry hook is a Push (stp) instruction, followed by a call.
-static const unsigned int kProfileEntryHookCallSize =
-    (1 * kInstructionSize) + Assembler::kCallSizeWithRelocation;
-
-void ProfileEntryHookStub::MaybeCallEntryHookDelayed(TurboAssembler* tasm,
-                                                     Zone* zone) {
-  if (tasm->isolate()->function_entry_hook() != nullptr) {
-    Assembler::BlockConstPoolScope no_const_pools(tasm);
-    DontEmitDebugCodeScope no_debug_code(tasm);
-    Label entry_hook_call_start;
-    tasm->Bind(&entry_hook_call_start);
-    tasm->Push(padreg, lr);
-    tasm->CallStubDelayed(new (zone) ProfileEntryHookStub(nullptr));
-    DCHECK_EQ(tasm->SizeOfCodeGeneratedSince(&entry_hook_call_start),
-              kProfileEntryHookCallSize);
-    tasm->Pop(lr, padreg);
-  }
-}
-
-void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
-  if (masm->isolate()->function_entry_hook() != nullptr) {
-    ProfileEntryHookStub stub(masm->isolate());
-    Assembler::BlockConstPoolScope no_const_pools(masm);
-    DontEmitDebugCodeScope no_debug_code(masm);
-    Label entry_hook_call_start;
-    __ Bind(&entry_hook_call_start);
-    __ Push(padreg, lr);
-    __ CallStub(&stub);
-    DCHECK_EQ(masm->SizeOfCodeGeneratedSince(&entry_hook_call_start),
-              kProfileEntryHookCallSize);
-    __ Pop(lr, padreg);
-  }
-}
-
-
-void ProfileEntryHookStub::Generate(MacroAssembler* masm) {
-  MacroAssembler::NoUseRealAbortsScope no_use_real_aborts(masm);
-
-  // Save all kCallerSaved registers (including lr), since this can be called
-  // from anywhere.
-  // TODO(jbramley): What about FP registers?
-  __ PushCPURegList(kCallerSaved);
-  DCHECK(kCallerSaved.IncludesAliasOf(lr));
-  const int kNumSavedRegs = kCallerSaved.Count();
-  DCHECK_EQ(kNumSavedRegs % 2, 0);
-
-  // Compute the function's address as the first argument.
-  __ Sub(x0, lr, kProfileEntryHookCallSize);
-
-#if V8_HOST_ARCH_ARM64
-  uintptr_t entry_hook =
-      reinterpret_cast<uintptr_t>(isolate()->function_entry_hook());
-  __ Mov(x10, entry_hook);
-#else
-  // Under the simulator we need to indirect the entry hook through a trampoline
-  // function at a known address.
-  ApiFunction dispatcher(FUNCTION_ADDR(EntryHookTrampoline));
-  __ Mov(x10, Operand(ExternalReference(&dispatcher,
-                                        ExternalReference::BUILTIN_CALL,
-                                        isolate())));
-  // It additionally takes an isolate as a third parameter
-  __ Mov(x2, ExternalReference::isolate_address(isolate()));
-#endif
-
-  // The caller's return address is above the saved temporaries.
-  // Grab its location for the second argument to the hook.
-  __ SlotAddress(x1, kNumSavedRegs);
-
-  {
-    // Create a dummy frame, as CallCFunction requires this.
-    FrameScope frame(masm, StackFrame::MANUAL);
-    __ CallCFunction(x10, 2, 0);
-  }
-
-  __ PopCPURegList(kCallerSaved);
-  __ Ret();
-}
-
-
-void DirectCEntryStub::Generate(MacroAssembler* masm) {
-  // Put return address on the stack (accessible to GC through exit frame pc).
-  __ Poke(lr, 0);
-  // Call the C++ function.
-  __ Blr(x10);
-  // Return to calling code.
-  __ Peek(lr, 0);
-  __ AssertFPCRState();
-  __ Ret();
-}
-
-void DirectCEntryStub::GenerateCall(MacroAssembler* masm,
-                                    Register target) {
-  // Make sure the caller configured the stack pointer (see comment in
-  // DirectCEntryStub::Generate).
-  DCHECK(csp.Is(__ StackPointer()));
-
-  intptr_t code =
-      reinterpret_cast<intptr_t>(GetCode().location());
-  __ Mov(lr, Operand(code, RelocInfo::CODE_TARGET));
-  __ Mov(x10, target);
-  // Branch to the stub.
-  __ Blr(lr);
-}
-
-template<class T>
-static void CreateArrayDispatch(MacroAssembler* masm,
-                                AllocationSiteOverrideMode mode) {
-  ASM_LOCATION("CreateArrayDispatch");
-  if (mode == DISABLE_ALLOCATION_SITES) {
-    T stub(masm->isolate(), GetInitialFastElementsKind(), mode);
-     __ TailCallStub(&stub);
-
-  } else if (mode == DONT_OVERRIDE) {
-    Register kind = x3;
-    int last_index =
-        GetSequenceIndexFromFastElementsKind(TERMINAL_FAST_ELEMENTS_KIND);
-    for (int i = 0; i <= last_index; ++i) {
-      Label next;
-      ElementsKind candidate_kind = GetFastElementsKindFromSequenceIndex(i);
-      // TODO(jbramley): Is this the best way to handle this? Can we make the
-      // tail calls conditional, rather than hopping over each one?
-      __ CompareAndBranch(kind, candidate_kind, ne, &next);
-      T stub(masm->isolate(), candidate_kind);
-      __ TailCallStub(&stub);
-      __ Bind(&next);
-    }
-
-    // If we reached this point there is a problem.
-    __ Abort(AbortReason::kUnexpectedElementsKindInArrayConstructor);
-
-  } else {
-    UNREACHABLE();
-  }
-}
-
-
-// TODO(jbramley): If this needs to be a special case, make it a proper template
-// specialization, and not a separate function.
-static void CreateArrayDispatchOneArgument(MacroAssembler* masm,
-                                           AllocationSiteOverrideMode mode) {
-  ASM_LOCATION("CreateArrayDispatchOneArgument");
-  // x0 - argc
-  // x1 - constructor?
-  // x2 - allocation site (if mode != DISABLE_ALLOCATION_SITES)
-  // x3 - kind (if mode != DISABLE_ALLOCATION_SITES)
-  // sp[0] - last argument
-
-  Register allocation_site = x2;
-  Register kind = x3;
-
-  STATIC_ASSERT(PACKED_SMI_ELEMENTS == 0);
-  STATIC_ASSERT(HOLEY_SMI_ELEMENTS == 1);
-  STATIC_ASSERT(PACKED_ELEMENTS == 2);
-  STATIC_ASSERT(HOLEY_ELEMENTS == 3);
-  STATIC_ASSERT(PACKED_DOUBLE_ELEMENTS == 4);
-  STATIC_ASSERT(HOLEY_DOUBLE_ELEMENTS == 5);
-
-  if (mode == DISABLE_ALLOCATION_SITES) {
-    ElementsKind initial = GetInitialFastElementsKind();
-    ElementsKind holey_initial = GetHoleyElementsKind(initial);
-
-    ArraySingleArgumentConstructorStub stub_holey(masm->isolate(),
-                                                  holey_initial,
-                                                  DISABLE_ALLOCATION_SITES);
-    __ TailCallStub(&stub_holey);
-  } else if (mode == DONT_OVERRIDE) {
-    // Is the low bit set? If so, the array is holey.
-    Label normal_sequence;
-    __ Tbnz(kind, 0, &normal_sequence);
-
-    // We are going to create a holey array, but our kind is non-holey.
-    // Fix kind and retry (only if we have an allocation site in the slot).
-    __ Orr(kind, kind, 1);
-
-    if (FLAG_debug_code) {
-      __ Ldr(x10, FieldMemOperand(allocation_site, 0));
-      __ JumpIfNotRoot(x10, Heap::kAllocationSiteMapRootIndex,
-                       &normal_sequence);
-      __ Assert(eq, AbortReason::kExpectedAllocationSite);
-    }
-
-    // Save the resulting elements kind in type info. We can't just store 'kind'
-    // in the AllocationSite::transition_info field because elements kind is
-    // restricted to a portion of the field; upper bits need to be left alone.
-    STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
-    __ Ldr(x11,
-           FieldMemOperand(allocation_site,
-                           AllocationSite::kTransitionInfoOrBoilerplateOffset));
-    __ Add(x11, x11, Smi::FromInt(kFastElementsKindPackedToHoley));
-    __ Str(x11,
-           FieldMemOperand(allocation_site,
-                           AllocationSite::kTransitionInfoOrBoilerplateOffset));
-
-    __ Bind(&normal_sequence);
-    int last_index =
-        GetSequenceIndexFromFastElementsKind(TERMINAL_FAST_ELEMENTS_KIND);
-    for (int i = 0; i <= last_index; ++i) {
-      Label next;
-      ElementsKind candidate_kind = GetFastElementsKindFromSequenceIndex(i);
-      __ CompareAndBranch(kind, candidate_kind, ne, &next);
-      ArraySingleArgumentConstructorStub stub(masm->isolate(), candidate_kind);
-      __ TailCallStub(&stub);
-      __ Bind(&next);
-    }
-
-    // If we reached this point there is a problem.
-    __ Abort(AbortReason::kUnexpectedElementsKindInArrayConstructor);
-  } else {
-    UNREACHABLE();
-  }
-}
-
-
-template<class T>
-static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) {
-  int to_index =
-      GetSequenceIndexFromFastElementsKind(TERMINAL_FAST_ELEMENTS_KIND);
-  for (int i = 0; i <= to_index; ++i) {
-    ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
-    T stub(isolate, kind);
-    stub.GetCode();
-    if (AllocationSite::ShouldTrack(kind)) {
-      T stub1(isolate, kind, DISABLE_ALLOCATION_SITES);
-      stub1.GetCode();
-    }
-  }
-}
-
-void CommonArrayConstructorStub::GenerateStubsAheadOfTime(Isolate* isolate) {
-  ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>(
-      isolate);
-  ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>(
-      isolate);
-  ArrayNArgumentsConstructorStub stub(isolate);
-  stub.GetCode();
-  ElementsKind kinds[2] = {PACKED_ELEMENTS, HOLEY_ELEMENTS};
-  for (int i = 0; i < 2; i++) {
-    // For internal arrays we only need a few things
-    InternalArrayNoArgumentConstructorStub stubh1(isolate, kinds[i]);
-    stubh1.GetCode();
-    InternalArraySingleArgumentConstructorStub stubh2(isolate, kinds[i]);
-    stubh2.GetCode();
-  }
-}
-
-
-void ArrayConstructorStub::GenerateDispatchToArrayStub(
-    MacroAssembler* masm,
-    AllocationSiteOverrideMode mode) {
-  Register argc = x0;
-  Label zero_case, n_case;
-  __ Cbz(argc, &zero_case);
-  __ Cmp(argc, 1);
-  __ B(ne, &n_case);
-
-  // One argument.
-  CreateArrayDispatchOneArgument(masm, mode);
-
-  __ Bind(&zero_case);
-  // No arguments.
-  CreateArrayDispatch<ArrayNoArgumentConstructorStub>(masm, mode);
-
-  __ Bind(&n_case);
-  // N arguments.
-  ArrayNArgumentsConstructorStub stub(masm->isolate());
-  __ TailCallStub(&stub);
-}
-
-
-void ArrayConstructorStub::Generate(MacroAssembler* masm) {
-  ASM_LOCATION("ArrayConstructorStub::Generate");
-  // ----------- S t a t e -------------
-  //  -- x0 : argc (only if argument_count() is ANY or MORE_THAN_ONE)
-  //  -- x1 : constructor
-  //  -- x2 : AllocationSite or undefined
-  //  -- x3 : new target
-  //  -- sp[0] : last argument
-  // -----------------------------------
-  Register constructor = x1;
-  Register allocation_site = x2;
-  Register new_target = x3;
-
-  if (FLAG_debug_code) {
-    // The array construct code is only set for the global and natives
-    // builtin Array functions which always have maps.
-
-    Label unexpected_map, map_ok;
-    // Initial map for the builtin Array function should be a map.
-    __ Ldr(x10, FieldMemOperand(constructor,
-                                JSFunction::kPrototypeOrInitialMapOffset));
-    // Will both indicate a nullptr and a Smi.
-    __ JumpIfSmi(x10, &unexpected_map);
-    __ JumpIfObjectType(x10, x10, x11, MAP_TYPE, &map_ok);
-    __ Bind(&unexpected_map);
-    __ Abort(AbortReason::kUnexpectedInitialMapForArrayFunction);
-    __ Bind(&map_ok);
-
-    // We should either have undefined in the allocation_site register or a
-    // valid AllocationSite.
-    __ AssertUndefinedOrAllocationSite(allocation_site);
-  }
-
-  // Enter the context of the Array function.
-  __ Ldr(cp, FieldMemOperand(x1, JSFunction::kContextOffset));
-
-  Label subclassing;
-  __ Cmp(new_target, constructor);
-  __ B(ne, &subclassing);
-
-  Register kind = x3;
-  Label no_info;
-  // Get the elements kind and case on that.
-  __ JumpIfRoot(allocation_site, Heap::kUndefinedValueRootIndex, &no_info);
-
-  __ Ldrsw(kind, UntagSmiFieldMemOperand(
-                     allocation_site,
-                     AllocationSite::kTransitionInfoOrBoilerplateOffset));
-  __ And(kind, kind, AllocationSite::ElementsKindBits::kMask);
-  GenerateDispatchToArrayStub(masm, DONT_OVERRIDE);
-
-  __ Bind(&no_info);
-  GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES);
-
-  // Subclassing support.
-  __ Bind(&subclassing);
-  __ Poke(constructor, Operand(x0, LSL, kPointerSizeLog2));
-  __ Add(x0, x0, Operand(3));
-  __ Push(new_target, allocation_site);
-  __ JumpToExternalReference(ExternalReference(Runtime::kNewArray, isolate()));
-}
-
-
-void InternalArrayConstructorStub::GenerateCase(
-    MacroAssembler* masm, ElementsKind kind) {
-  Label zero_case, n_case;
-  Register argc = x0;
-
-  __ Cbz(argc, &zero_case);
-  __ CompareAndBranch(argc, 1, ne, &n_case);
-
-  // One argument.
-  if (IsFastPackedElementsKind(kind)) {
-    Label packed_case;
-
-    // We might need to create a holey array; look at the first argument.
-    __ Peek(x10, 0);
-    __ Cbz(x10, &packed_case);
-
-    InternalArraySingleArgumentConstructorStub
-        stub1_holey(isolate(), GetHoleyElementsKind(kind));
-    __ TailCallStub(&stub1_holey);
-
-    __ Bind(&packed_case);
-  }
-  InternalArraySingleArgumentConstructorStub stub1(isolate(), kind);
-  __ TailCallStub(&stub1);
-
-  __ Bind(&zero_case);
-  // No arguments.
-  InternalArrayNoArgumentConstructorStub stub0(isolate(), kind);
-  __ TailCallStub(&stub0);
-
-  __ Bind(&n_case);
-  // N arguments.
-  ArrayNArgumentsConstructorStub stubN(isolate());
-  __ TailCallStub(&stubN);
-}
-
-
-void InternalArrayConstructorStub::Generate(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- x0 : argc
-  //  -- x1 : constructor
-  //  -- sp[0] : return address
-  //  -- sp[4] : last argument
-  // -----------------------------------
-
-  Register constructor = x1;
-
-  if (FLAG_debug_code) {
-    // The array construct code is only set for the global and natives
-    // builtin Array functions which always have maps.
-
-    Label unexpected_map, map_ok;
-    // Initial map for the builtin Array function should be a map.
-    __ Ldr(x10, FieldMemOperand(constructor,
-                                JSFunction::kPrototypeOrInitialMapOffset));
-    // Will both indicate a nullptr and a Smi.
-    __ JumpIfSmi(x10, &unexpected_map);
-    __ JumpIfObjectType(x10, x10, x11, MAP_TYPE, &map_ok);
-    __ Bind(&unexpected_map);
-    __ Abort(AbortReason::kUnexpectedInitialMapForArrayFunction);
-    __ Bind(&map_ok);
-  }
-
-  Register kind = w3;
-  // Figure out the right elements kind
-  __ Ldr(x10, FieldMemOperand(constructor,
-                              JSFunction::kPrototypeOrInitialMapOffset));
-
-  // Retrieve elements_kind from map.
-  __ LoadElementsKindFromMap(kind, x10);
-
-  if (FLAG_debug_code) {
-    Label done;
-    __ Cmp(x3, PACKED_ELEMENTS);
-    __ Ccmp(x3, HOLEY_ELEMENTS, ZFlag, ne);
-    __ Assert(
-        eq,
-        AbortReason::kInvalidElementsKindForInternalArrayOrInternalPackedArray);
-  }
-
-  Label fast_elements_case;
-  __ CompareAndBranch(kind, PACKED_ELEMENTS, eq, &fast_elements_case);
-  GenerateCase(masm, HOLEY_ELEMENTS);
-
-  __ Bind(&fast_elements_case);
-  GenerateCase(masm, PACKED_ELEMENTS);
-}
-
-// The number of register that CallApiFunctionAndReturn will need to save on
-// the stack. The space for these registers need to be allocated in the
-// ExitFrame before calling CallApiFunctionAndReturn.
-static const int kCallApiFunctionSpillSpace = 4;
-
-
-static int AddressOffset(ExternalReference ref0, ExternalReference ref1) {
-  return static_cast<int>(ref0.address() - ref1.address());
-}
-
-// Calls an API function. Allocates HandleScope, extracts returned value
-// from handle and propagates exceptions.
-// 'stack_space' is the space to be unwound on exit (includes the call JS
-// arguments space and the additional space allocated for the fast call).
-// 'spill_offset' is the offset from the stack pointer where
-// CallApiFunctionAndReturn can spill registers.
-static void CallApiFunctionAndReturn(MacroAssembler* masm,
-                                     Register function_address,
-                                     ExternalReference thunk_ref,
-                                     int stack_space, int spill_offset,
-                                     MemOperand return_value_operand) {
-  ASM_LOCATION("CallApiFunctionAndReturn");
-  Isolate* isolate = masm->isolate();
-  ExternalReference next_address =
-      ExternalReference::handle_scope_next_address(isolate);
-  const int kNextOffset = 0;
-  const int kLimitOffset = AddressOffset(
-      ExternalReference::handle_scope_limit_address(isolate), next_address);
-  const int kLevelOffset = AddressOffset(
-      ExternalReference::handle_scope_level_address(isolate), next_address);
-
-  DCHECK(function_address.is(x1) || function_address.is(x2));
-
-  Label profiler_disabled;
-  Label end_profiler_check;
-  __ Mov(x10, ExternalReference::is_profiling_address(isolate));
-  __ Ldrb(w10, MemOperand(x10));
-  __ Cbz(w10, &profiler_disabled);
-  __ Mov(x3, thunk_ref);
-  __ B(&end_profiler_check);
-
-  __ Bind(&profiler_disabled);
-  __ Mov(x3, function_address);
-  __ Bind(&end_profiler_check);
-
-  // Save the callee-save registers we are going to use.
-  // TODO(all): Is this necessary? ARM doesn't do it.
-  STATIC_ASSERT(kCallApiFunctionSpillSpace == 4);
-  __ Poke(x19, (spill_offset + 0) * kXRegSize);
-  __ Poke(x20, (spill_offset + 1) * kXRegSize);
-  __ Poke(x21, (spill_offset + 2) * kXRegSize);
-  __ Poke(x22, (spill_offset + 3) * kXRegSize);
-
-  // Allocate HandleScope in callee-save registers.
-  // We will need to restore the HandleScope after the call to the API function,
-  // by allocating it in callee-save registers they will be preserved by C code.
-  Register handle_scope_base = x22;
-  Register next_address_reg = x19;
-  Register limit_reg = x20;
-  Register level_reg = w21;
-
-  __ Mov(handle_scope_base, next_address);
-  __ Ldr(next_address_reg, MemOperand(handle_scope_base, kNextOffset));
-  __ Ldr(limit_reg, MemOperand(handle_scope_base, kLimitOffset));
-  __ Ldr(level_reg, MemOperand(handle_scope_base, kLevelOffset));
-  __ Add(level_reg, level_reg, 1);
-  __ Str(level_reg, MemOperand(handle_scope_base, kLevelOffset));
-
-  if (FLAG_log_timer_events) {
-    FrameScope frame(masm, StackFrame::MANUAL);
-    __ PushSafepointRegisters();
-    __ Mov(x0, ExternalReference::isolate_address(isolate));
-    __ CallCFunction(ExternalReference::log_enter_external_function(isolate),
-                     1);
-    __ PopSafepointRegisters();
-  }
-
-  // Native call returns to the DirectCEntry stub which redirects to the
-  // return address pushed on stack (could have moved after GC).
-  // DirectCEntry stub itself is generated early and never moves.
-  DirectCEntryStub stub(isolate);
-  stub.GenerateCall(masm, x3);
-
-  if (FLAG_log_timer_events) {
-    FrameScope frame(masm, StackFrame::MANUAL);
-    __ PushSafepointRegisters();
-    __ Mov(x0, ExternalReference::isolate_address(isolate));
-    __ CallCFunction(ExternalReference::log_leave_external_function(isolate),
-                     1);
-    __ PopSafepointRegisters();
-  }
-
-  Label promote_scheduled_exception;
-  Label delete_allocated_handles;
-  Label leave_exit_frame;
-  Label return_value_loaded;
-
-  // Load value from ReturnValue.
-  __ Ldr(x0, return_value_operand);
-  __ Bind(&return_value_loaded);
-  // No more valid handles (the result handle was the last one). Restore
-  // previous handle scope.
-  __ Str(next_address_reg, MemOperand(handle_scope_base, kNextOffset));
-  if (__ emit_debug_code()) {
-    __ Ldr(w1, MemOperand(handle_scope_base, kLevelOffset));
-    __ Cmp(w1, level_reg);
-    __ Check(eq, AbortReason::kUnexpectedLevelAfterReturnFromApiCall);
-  }
-  __ Sub(level_reg, level_reg, 1);
-  __ Str(level_reg, MemOperand(handle_scope_base, kLevelOffset));
-  __ Ldr(x1, MemOperand(handle_scope_base, kLimitOffset));
-  __ Cmp(limit_reg, x1);
-  __ B(ne, &delete_allocated_handles);
-
-  // Leave the API exit frame.
-  __ Bind(&leave_exit_frame);
-  // Restore callee-saved registers.
-  __ Peek(x19, (spill_offset + 0) * kXRegSize);
-  __ Peek(x20, (spill_offset + 1) * kXRegSize);
-  __ Peek(x21, (spill_offset + 2) * kXRegSize);
-  __ Peek(x22, (spill_offset + 3) * kXRegSize);
-
-  __ LeaveExitFrame(false, x1, x5);
-
-  // Check if the function scheduled an exception.
-  __ Mov(x5, ExternalReference::scheduled_exception_address(isolate));
-  __ Ldr(x5, MemOperand(x5));
-  __ JumpIfNotRoot(x5, Heap::kTheHoleValueRootIndex,
-                   &promote_scheduled_exception);
-
-  __ DropSlots(stack_space);
-  __ Ret();
-
-  // Re-throw by promoting a scheduled exception.
-  __ Bind(&promote_scheduled_exception);
-  __ TailCallRuntime(Runtime::kPromoteScheduledException);
-
-  // HandleScope limit has changed. Delete allocated extensions.
-  __ Bind(&delete_allocated_handles);
-  __ Str(limit_reg, MemOperand(handle_scope_base, kLimitOffset));
-  // Save the return value in a callee-save register.
-  Register saved_result = x19;
-  __ Mov(saved_result, x0);
-  __ Mov(x0, ExternalReference::isolate_address(isolate));
-  __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate),
-                   1);
-  __ Mov(x0, saved_result);
-  __ B(&leave_exit_frame);
-}
-
-void CallApiCallbackStub::Generate(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- x4                  : call_data
-  //  -- x2                  : holder
-  //  -- x1                  : api_function_address
-  //  -- cp                  : context
-  //  --
-  //  -- sp[0]               : last argument
-  //  -- ...
-  //  -- sp[(argc - 1) * 8]  : first argument
-  //  -- sp[argc * 8]        : receiver
-  // -----------------------------------
-
-  Register call_data = x4;
-  Register holder = x2;
-  Register api_function_address = x1;
-
-  typedef FunctionCallbackArguments FCA;
-
-  STATIC_ASSERT(FCA::kArgsLength == 6);
-  STATIC_ASSERT(FCA::kNewTargetIndex == 5);
-  STATIC_ASSERT(FCA::kDataIndex == 4);
-  STATIC_ASSERT(FCA::kReturnValueOffset == 3);
-  STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2);
-  STATIC_ASSERT(FCA::kIsolateIndex == 1);
-  STATIC_ASSERT(FCA::kHolderIndex == 0);
-
-  Register undef = x7;
-  __ LoadRoot(undef, Heap::kUndefinedValueRootIndex);
-
-  // Push new target, call data.
-  __ Push(undef, call_data);
-
-  Register isolate_reg = x5;
-  __ Mov(isolate_reg, ExternalReference::isolate_address(masm->isolate()));
-
-  // FunctionCallbackArguments:
-  //    return value, return value default, isolate, holder.
-  __ Push(undef, undef, isolate_reg, holder);
-
-  // Prepare arguments.
-  Register args = x6;
-  __ Mov(args, masm->StackPointer());
-
-  // Allocate the v8::Arguments structure in the arguments' space, since it's
-  // not controlled by GC.
-  const int kApiStackSpace = 3;
-
-  // Allocate space so that CallApiFunctionAndReturn can store some scratch
-  // registers on the stack.
-  const int kCallApiFunctionSpillSpace = 4;
-
-  FrameScope frame_scope(masm, StackFrame::MANUAL);
-  __ EnterExitFrame(false, x10, kApiStackSpace + kCallApiFunctionSpillSpace);
-
-  DCHECK(!AreAliased(x0, api_function_address));
-  // x0 = FunctionCallbackInfo&
-  // Arguments is after the return address.
-  __ SlotAddress(x0, 1);
-  // FunctionCallbackInfo::implicit_args_ and FunctionCallbackInfo::values_
-  __ Add(x10, args, Operand((FCA::kArgsLength - 1 + argc()) * kPointerSize));
-  __ Stp(args, x10, MemOperand(x0, 0 * kPointerSize));
-  // FunctionCallbackInfo::length_ = argc
-  __ Mov(x10, argc());
-  __ Str(x10, MemOperand(x0, 2 * kPointerSize));
-
-  ExternalReference thunk_ref =
-      ExternalReference::invoke_function_callback(masm->isolate());
-
-  AllowExternalCallThatCantCauseGC scope(masm);
-  // Stores return the first js argument
-  int return_value_offset = 2 + FCA::kReturnValueOffset;
-  MemOperand return_value_operand(fp, return_value_offset * kPointerSize);
-  // The number of arguments might be odd, but will be padded when calling the
-  // stub. We do not round up stack_space to account for odd argc here, this
-  // will be done in CallApiFunctionAndReturn.
-  const int stack_space = (argc() + 1) + FCA::kArgsLength;
-
-  // The current frame needs to be aligned.
-  DCHECK_EQ((stack_space - (argc() + 1)) % 2, 0);
-  const int spill_offset = 1 + kApiStackSpace;
-  CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space,
-                           spill_offset, return_value_operand);
-}
-
-
-void CallApiGetterStub::Generate(MacroAssembler* masm) {
-  STATIC_ASSERT(PropertyCallbackArguments::kShouldThrowOnErrorIndex == 0);
-  STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 1);
-  STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 2);
-  STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 3);
-  STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 4);
-  STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 5);
-  STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 6);
-  STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 7);
-
-  Register receiver = ApiGetterDescriptor::ReceiverRegister();
-  Register holder = ApiGetterDescriptor::HolderRegister();
-  Register callback = ApiGetterDescriptor::CallbackRegister();
-  Register data = x4;
-  Register undef = x5;
-  Register isolate_address = x6;
-  Register name = x7;
-  DCHECK(!AreAliased(receiver, holder, callback, data, undef, isolate_address,
-                     name));
-
-  __ Ldr(data, FieldMemOperand(callback, AccessorInfo::kDataOffset));
-  __ LoadRoot(undef, Heap::kUndefinedValueRootIndex);
-  __ Mov(isolate_address,
-         Operand(ExternalReference::isolate_address(isolate())));
-  __ Ldr(name, FieldMemOperand(callback, AccessorInfo::kNameOffset));
-
-  // PropertyCallbackArguments:
-  //   receiver, data, return value, return value default, isolate, holder,
-  //   should_throw_on_error
-  // These are followed by the property name, which is also pushed below the
-  // exit frame to make the GC aware of it.
-  __ Push(receiver, data, undef, undef, isolate_address, holder, xzr, name);
-
-  // v8::PropertyCallbackInfo::args_ array and name handle.
-  static const int kStackUnwindSpace =
-      PropertyCallbackArguments::kArgsLength + 1;
-  static_assert(kStackUnwindSpace % 2 == 0,
-                "slots must be a multiple of 2 for stack pointer alignment");
-
-  // Load address of v8::PropertyAccessorInfo::args_ array and name handle.
-  __ Mov(x0, masm->StackPointer());  // x0 = Handle<Name>
-  __ Add(x1, x0, 1 * kPointerSize);  // x1 = v8::PCI::args_
-
-  const int kApiStackSpace = 1;
-
-  // Allocate space so that CallApiFunctionAndReturn can store some scratch
-  // registers on the stack.
-  const int kCallApiFunctionSpillSpace = 4;
-
-  FrameScope frame_scope(masm, StackFrame::MANUAL);
-  __ EnterExitFrame(false, x10, kApiStackSpace + kCallApiFunctionSpillSpace);
-
-  // Create v8::PropertyCallbackInfo object on the stack and initialize
-  // it's args_ field.
-  __ Poke(x1, 1 * kPointerSize);
-  __ SlotAddress(x1, 1);
-  // x1 = v8::PropertyCallbackInfo&
-
-  ExternalReference thunk_ref =
-      ExternalReference::invoke_accessor_getter_callback(isolate());
-
-  Register api_function_address = x2;
-  Register js_getter = x4;
-  __ Ldr(js_getter, FieldMemOperand(callback, AccessorInfo::kJsGetterOffset));
-  __ Ldr(api_function_address,
-         FieldMemOperand(js_getter, Foreign::kForeignAddressOffset));
-
-  const int spill_offset = 1 + kApiStackSpace;
-  // +3 is to skip prolog, return address and name handle.
-  MemOperand return_value_operand(
-      fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize);
-  CallApiFunctionAndReturn(masm, api_function_address, thunk_ref,
-                           kStackUnwindSpace, spill_offset,
-                           return_value_operand);
-}
-
-#undef __
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_ARM64
diff --git a/src/v8/src/arm64/code-stubs-arm64.h b/src/v8/src/arm64/code-stubs-arm64.h
deleted file mode 100644
index 14c4a98..0000000
--- a/src/v8/src/arm64/code-stubs-arm64.h
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_ARM64_CODE_STUBS_ARM64_H_
-#define V8_ARM64_CODE_STUBS_ARM64_H_
-
-namespace v8 {
-namespace internal {
-
-// Helper to call C++ functions from generated code. The caller must prepare
-// the exit frame before doing the call with GenerateCall.
-class DirectCEntryStub: public PlatformCodeStub {
- public:
-  explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {}
-  void GenerateCall(MacroAssembler* masm, Register target);
-
- private:
-  Movability NeedsImmovableCode() override { return kImmovable; }
-
-  DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR();
-  DEFINE_PLATFORM_CODE_STUB(DirectCEntry, PlatformCodeStub);
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_ARM64_CODE_STUBS_ARM64_H_
diff --git a/src/v8/src/arm64/codegen-arm64.cc b/src/v8/src/arm64/codegen-arm64.cc
deleted file mode 100644
index 1016e37..0000000
--- a/src/v8/src/arm64/codegen-arm64.cc
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2013 the V8 project 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 V8_TARGET_ARCH_ARM64
-
-#include "src/arm64/assembler-arm64-inl.h"
-#include "src/arm64/macro-assembler-arm64-inl.h"
-#include "src/arm64/simulator-arm64.h"
-#include "src/codegen.h"
-#include "src/macro-assembler.h"
-
-namespace v8 {
-namespace internal {
-
-#define __ ACCESS_MASM(masm)
-
-UnaryMathFunctionWithIsolate CreateSqrtFunction(Isolate* isolate) {
-  return nullptr;
-}
-
-#undef __
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_ARM64
diff --git a/src/v8/src/arm64/constants-arm64.h b/src/v8/src/arm64/constants-arm64.h
deleted file mode 100644
index b02dd5d..0000000
--- a/src/v8/src/arm64/constants-arm64.h
+++ /dev/null
@@ -1,2125 +0,0 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_ARM64_CONSTANTS_ARM64_H_
-#define V8_ARM64_CONSTANTS_ARM64_H_
-
-#include "src/base/macros.h"
-#include "src/globals.h"
-
-// Assert that this is an LP64 system.
-STATIC_ASSERT(sizeof(int) == sizeof(int32_t));
-STATIC_ASSERT(sizeof(long) == sizeof(int64_t));    // NOLINT(runtime/int)
-STATIC_ASSERT(sizeof(void *) == sizeof(int64_t));
-STATIC_ASSERT(sizeof(1) == sizeof(int32_t));
-STATIC_ASSERT(sizeof(1L) == sizeof(int64_t));
-
-
-// Get the standard printf format macros for C99 stdint types.
-#ifndef __STDC_FORMAT_MACROS
-#define __STDC_FORMAT_MACROS
-#endif
-#include <inttypes.h>
-
-
-namespace v8 {
-namespace internal {
-
-
-const unsigned kInstructionSize = 4;
-const unsigned kInstructionSizeLog2 = 2;
-const unsigned kLoadLiteralScaleLog2 = 2;
-const unsigned kMaxLoadLiteralRange = 1 * MB;
-
-const int kNumberOfRegisters = 32;
-const int kNumberOfVRegisters = 32;
-// Callee saved registers are x19-x30(lr).
-const int kNumberOfCalleeSavedRegisters = 11;
-const int kFirstCalleeSavedRegisterIndex = 19;
-// Callee saved FP registers are d8-d15.
-const int kNumberOfCalleeSavedVRegisters = 8;
-const int kFirstCalleeSavedVRegisterIndex = 8;
-// Callee saved registers with no specific purpose in JS are x19-x25.
-const unsigned kJSCalleeSavedRegList = 0x03f80000;
-const int kWRegSizeInBits = 32;
-const int kWRegSizeInBitsLog2 = 5;
-const int kWRegSize = kWRegSizeInBits >> 3;
-const int kWRegSizeLog2 = kWRegSizeInBitsLog2 - 3;
-const int kXRegSizeInBits = 64;
-const int kXRegSizeInBitsLog2 = 6;
-const int kXRegSize = kXRegSizeInBits >> 3;
-const int kXRegSizeLog2 = kXRegSizeInBitsLog2 - 3;
-const int kSRegSizeInBits = 32;
-const int kSRegSizeInBitsLog2 = 5;
-const int kSRegSize = kSRegSizeInBits >> 3;
-const int kSRegSizeLog2 = kSRegSizeInBitsLog2 - 3;
-const int kDRegSizeInBits = 64;
-const int kDRegSizeInBitsLog2 = 6;
-const int kDRegSize = kDRegSizeInBits >> 3;
-const int kDRegSizeLog2 = kDRegSizeInBitsLog2 - 3;
-const int kDRegSizeInBytesLog2 = kDRegSizeInBitsLog2 - 3;
-const int kBRegSizeInBits = 8;
-const int kBRegSize = kBRegSizeInBits >> 3;
-const int kHRegSizeInBits = 16;
-const int kHRegSize = kHRegSizeInBits >> 3;
-const int kQRegSizeInBits = 128;
-const int kQRegSizeInBitsLog2 = 7;
-const int kQRegSize = kQRegSizeInBits >> 3;
-const int kQRegSizeLog2 = kQRegSizeInBitsLog2 - 3;
-const int kVRegSizeInBits = kQRegSizeInBits;
-const int kVRegSize = kVRegSizeInBits >> 3;
-const int64_t kWRegMask = 0x00000000ffffffffL;
-const int64_t kXRegMask = 0xffffffffffffffffL;
-const int64_t kSRegMask = 0x00000000ffffffffL;
-const int64_t kDRegMask = 0xffffffffffffffffL;
-// TODO(all) check if the expression below works on all compilers or if it
-// triggers an overflow error.
-const int64_t kDSignBit = 63;
-const int64_t kDSignMask = 0x1L << kDSignBit;
-const int64_t kSSignBit = 31;
-const int64_t kSSignMask = 0x1L << kSSignBit;
-const int64_t kXSignBit = 63;
-const int64_t kXSignMask = 0x1L << kXSignBit;
-const int64_t kWSignBit = 31;
-const int64_t kWSignMask = 0x1L << kWSignBit;
-const int64_t kDQuietNanBit = 51;
-const int64_t kDQuietNanMask = 0x1L << kDQuietNanBit;
-const int64_t kSQuietNanBit = 22;
-const int64_t kSQuietNanMask = 0x1L << kSQuietNanBit;
-const int64_t kByteMask = 0xffL;
-const int64_t kHalfWordMask = 0xffffL;
-const int64_t kWordMask = 0xffffffffL;
-const uint64_t kXMaxUInt = 0xffffffffffffffffUL;
-const uint64_t kWMaxUInt = 0xffffffffUL;
-const int64_t kXMaxInt = 0x7fffffffffffffffL;
-const int64_t kXMinInt = 0x8000000000000000L;
-const int32_t kWMaxInt = 0x7fffffff;
-const int32_t kWMinInt = 0x80000000;
-const int kIp0Code = 16;
-const int kIp1Code = 17;
-const int kFramePointerRegCode = 29;
-const int kLinkRegCode = 30;
-const int kZeroRegCode = 31;
-const int kSPRegInternalCode = 63;
-const unsigned kRegCodeMask = 0x1f;
-const unsigned kShiftAmountWRegMask = 0x1f;
-const unsigned kShiftAmountXRegMask = 0x3f;
-// Standard machine types defined by AAPCS64.
-const unsigned kByteSize = 8;
-const unsigned kByteSizeInBytes = kByteSize >> 3;
-const unsigned kHalfWordSize = 16;
-const unsigned kHalfWordSizeLog2 = 4;
-const unsigned kHalfWordSizeInBytes = kHalfWordSize >> 3;
-const unsigned kHalfWordSizeInBytesLog2 = kHalfWordSizeLog2 - 3;
-const unsigned kWordSize = 32;
-const unsigned kWordSizeLog2 = 5;
-const unsigned kWordSizeInBytes = kWordSize >> 3;
-const unsigned kWordSizeInBytesLog2 = kWordSizeLog2 - 3;
-const unsigned kDoubleWordSize = 64;
-const unsigned kDoubleWordSizeInBytes = kDoubleWordSize >> 3;
-const unsigned kQuadWordSize = 128;
-const unsigned kQuadWordSizeInBytes = kQuadWordSize >> 3;
-const int kMaxLanesPerVector = 16;
-
-const unsigned kAddressTagOffset = 56;
-const unsigned kAddressTagWidth = 8;
-const uint64_t kAddressTagMask = ((UINT64_C(1) << kAddressTagWidth) - 1)
-                                 << kAddressTagOffset;
-static_assert(kAddressTagMask == UINT64_C(0xff00000000000000),
-              "AddressTagMask must represent most-significant eight bits.");
-
-// AArch64 floating-point specifics. These match IEEE-754.
-const unsigned kDoubleMantissaBits = 52;
-const unsigned kDoubleExponentBits = 11;
-const unsigned kDoubleExponentBias = 1023;
-const unsigned kFloatMantissaBits = 23;
-const unsigned kFloatExponentBits = 8;
-const unsigned kFloatExponentBias = 127;
-const unsigned kFloat16MantissaBits = 10;
-const unsigned kFloat16ExponentBits = 5;
-const unsigned kFloat16ExponentBias = 15;
-
-typedef uint16_t float16;
-
-#define INSTRUCTION_FIELDS_LIST(V_)                     \
-  /* Register fields */                                 \
-  V_(Rd, 4, 0, Bits)    /* Destination register.     */ \
-  V_(Rn, 9, 5, Bits)    /* First source register.    */ \
-  V_(Rm, 20, 16, Bits)  /* Second source register.   */ \
-  V_(Ra, 14, 10, Bits)  /* Third source register.    */ \
-  V_(Rt, 4, 0, Bits)    /* Load dest / store source. */ \
-  V_(Rt2, 14, 10, Bits) /* Load second dest /        */ \
-                        /* store second source.      */ \
-  V_(Rs, 20, 16, Bits)  /* Store-exclusive status    */ \
-  V_(PrefetchMode, 4, 0, Bits)                          \
-                                                        \
-  /* Common bits */                                     \
-  V_(SixtyFourBits, 31, 31, Bits)                       \
-  V_(FlagsUpdate, 29, 29, Bits)                         \
-                                                        \
-  /* PC relative addressing */                          \
-  V_(ImmPCRelHi, 23, 5, SignedBits)                     \
-  V_(ImmPCRelLo, 30, 29, Bits)                          \
-                                                        \
-  /* Add/subtract/logical shift register */             \
-  V_(ShiftDP, 23, 22, Bits)                             \
-  V_(ImmDPShift, 15, 10, Bits)                          \
-                                                        \
-  /* Add/subtract immediate */                          \
-  V_(ImmAddSub, 21, 10, Bits)                           \
-  V_(ShiftAddSub, 23, 22, Bits)                         \
-                                                        \
-  /* Add/subtract extend */                             \
-  V_(ImmExtendShift, 12, 10, Bits)                      \
-  V_(ExtendMode, 15, 13, Bits)                          \
-                                                        \
-  /* Move wide */                                       \
-  V_(ImmMoveWide, 20, 5, Bits)                          \
-  V_(ShiftMoveWide, 22, 21, Bits)                       \
-                                                        \
-  /* Logical immediate, bitfield and extract */         \
-  V_(BitN, 22, 22, Bits)                                \
-  V_(ImmRotate, 21, 16, Bits)                           \
-  V_(ImmSetBits, 15, 10, Bits)                          \
-  V_(ImmR, 21, 16, Bits)                                \
-  V_(ImmS, 15, 10, Bits)                                \
-                                                        \
-  /* Test and branch immediate */                       \
-  V_(ImmTestBranch, 18, 5, SignedBits)                  \
-  V_(ImmTestBranchBit40, 23, 19, Bits)                  \
-  V_(ImmTestBranchBit5, 31, 31, Bits)                   \
-                                                        \
-  /* Conditionals */                                    \
-  V_(Condition, 15, 12, Bits)                           \
-  V_(ConditionBranch, 3, 0, Bits)                       \
-  V_(Nzcv, 3, 0, Bits)                                  \
-  V_(ImmCondCmp, 20, 16, Bits)                          \
-  V_(ImmCondBranch, 23, 5, SignedBits)                  \
-                                                        \
-  /* Floating point */                                  \
-  V_(FPType, 23, 22, Bits)                              \
-  V_(ImmFP, 20, 13, Bits)                               \
-  V_(FPScale, 15, 10, Bits)                             \
-                                                        \
-  /* Load Store */                                      \
-  V_(ImmLS, 20, 12, SignedBits)                         \
-  V_(ImmLSUnsigned, 21, 10, Bits)                       \
-  V_(ImmLSPair, 21, 15, SignedBits)                     \
-  V_(ImmShiftLS, 12, 12, Bits)                          \
-  V_(LSOpc, 23, 22, Bits)                               \
-  V_(LSVector, 26, 26, Bits)                            \
-  V_(LSSize, 31, 30, Bits)                              \
-                                                        \
-  /* NEON generic fields */                             \
-  V_(NEONQ, 30, 30, Bits)                               \
-  V_(NEONSize, 23, 22, Bits)                            \
-  V_(NEONLSSize, 11, 10, Bits)                          \
-  V_(NEONS, 12, 12, Bits)                               \
-  V_(NEONL, 21, 21, Bits)                               \
-  V_(NEONM, 20, 20, Bits)                               \
-  V_(NEONH, 11, 11, Bits)                               \
-  V_(ImmNEONExt, 14, 11, Bits)                          \
-  V_(ImmNEON5, 20, 16, Bits)                            \
-  V_(ImmNEON4, 14, 11, Bits)                            \
-                                                        \
-  /* Other immediates */                                \
-  V_(ImmUncondBranch, 25, 0, SignedBits)                \
-  V_(ImmCmpBranch, 23, 5, SignedBits)                   \
-  V_(ImmLLiteral, 23, 5, SignedBits)                    \
-  V_(ImmException, 20, 5, Bits)                         \
-  V_(ImmHint, 11, 5, Bits)                              \
-  V_(ImmBarrierDomain, 11, 10, Bits)                    \
-  V_(ImmBarrierType, 9, 8, Bits)                        \
-                                                        \
-  /* System (MRS, MSR) */                               \
-  V_(ImmSystemRegister, 19, 5, Bits)                    \
-  V_(SysO0, 19, 19, Bits)                               \
-  V_(SysOp1, 18, 16, Bits)                              \
-  V_(SysOp2, 7, 5, Bits)                                \
-  V_(CRn, 15, 12, Bits)                                 \
-  V_(CRm, 11, 8, Bits)                                  \
-                                                        \
-  /* Load-/store-exclusive */                           \
-  V_(LoadStoreXLoad, 22, 22, Bits)                      \
-  V_(LoadStoreXNotExclusive, 23, 23, Bits)              \
-  V_(LoadStoreXAcquireRelease, 15, 15, Bits)            \
-  V_(LoadStoreXSizeLog2, 31, 30, Bits)                  \
-  V_(LoadStoreXPair, 21, 21, Bits)                      \
-                                                        \
-  /* NEON load/store */                                 \
-  V_(NEONLoad, 22, 22, Bits)                            \
-                                                        \
-  /* NEON Modified Immediate fields */                  \
-  V_(ImmNEONabc, 18, 16, Bits)                          \
-  V_(ImmNEONdefgh, 9, 5, Bits)                          \
-  V_(NEONModImmOp, 29, 29, Bits)                        \
-  V_(NEONCmode, 15, 12, Bits)                           \
-                                                        \
-  /* NEON Shift Immediate fields */                     \
-  V_(ImmNEONImmhImmb, 22, 16, Bits)                     \
-  V_(ImmNEONImmh, 22, 19, Bits)                         \
-  V_(ImmNEONImmb, 18, 16, Bits)
-
-#define SYSTEM_REGISTER_FIELDS_LIST(V_, M_)                                    \
-/* NZCV */                                                                     \
-V_(Flags, 31, 28, Bits, uint32_t)                                              \
-V_(N,     31, 31, Bits, bool)                                                  \
-V_(Z,     30, 30, Bits, bool)                                                  \
-V_(C,     29, 29, Bits, bool)                                                  \
-V_(V,     28, 28, Bits, uint32_t)                                              \
-M_(NZCV, Flags_mask)                                                           \
-                                                                               \
-/* FPCR */                                                                     \
-V_(AHP,   26, 26, Bits, bool)                                                  \
-V_(DN,    25, 25, Bits, bool)                                                  \
-V_(FZ,    24, 24, Bits, bool)                                                  \
-V_(RMode, 23, 22, Bits, FPRounding)                                            \
-M_(FPCR, AHP_mask | DN_mask | FZ_mask | RMode_mask)
-
-
-// Fields offsets.
-#define DECLARE_FIELDS_OFFSETS(Name, HighBit, LowBit, unused_1, unused_2)      \
-  const int Name##_offset = LowBit;                                            \
-  const int Name##_width = HighBit - LowBit + 1;                               \
-  const uint32_t Name##_mask = ((1 << Name##_width) - 1) << LowBit;
-#define DECLARE_INSTRUCTION_FIELDS_OFFSETS(Name, HighBit, LowBit, unused_1)    \
-  DECLARE_FIELDS_OFFSETS(Name, HighBit, LowBit, unused_1, unused_2)
-#define NOTHING(A, B)
-INSTRUCTION_FIELDS_LIST(DECLARE_INSTRUCTION_FIELDS_OFFSETS)
-SYSTEM_REGISTER_FIELDS_LIST(DECLARE_FIELDS_OFFSETS, NOTHING)
-#undef NOTHING
-#undef DECLARE_FIELDS_OFFSETS
-#undef DECLARE_INSTRUCTION_FIELDS_OFFSETS
-
-// ImmPCRel is a compound field (not present in INSTRUCTION_FIELDS_LIST), formed
-// from ImmPCRelLo and ImmPCRelHi.
-const int ImmPCRel_mask = ImmPCRelLo_mask | ImmPCRelHi_mask;
-
-// Condition codes.
-enum Condition {
-  eq = 0,
-  ne = 1,
-  hs = 2, cs = hs,
-  lo = 3, cc = lo,
-  mi = 4,
-  pl = 5,
-  vs = 6,
-  vc = 7,
-  hi = 8,
-  ls = 9,
-  ge = 10,
-  lt = 11,
-  gt = 12,
-  le = 13,
-  al = 14,
-  nv = 15  // Behaves as always/al.
-};
-
-inline Condition NegateCondition(Condition cond) {
-  // Conditions al and nv behave identically, as "always true". They can't be
-  // inverted, because there is no never condition.
-  DCHECK((cond != al) && (cond != nv));
-  return static_cast<Condition>(cond ^ 1);
-}
-
-// Commute a condition such that {a cond b == b cond' a}.
-inline Condition CommuteCondition(Condition cond) {
-  switch (cond) {
-    case lo:
-      return hi;
-    case hi:
-      return lo;
-    case hs:
-      return ls;
-    case ls:
-      return hs;
-    case lt:
-      return gt;
-    case gt:
-      return lt;
-    case ge:
-      return le;
-    case le:
-      return ge;
-    case eq:
-      return eq;
-    default:
-      // In practice this function is only used with a condition coming from
-      // TokenToCondition in lithium-codegen-arm64.cc. Any other condition is
-      // invalid as it doesn't necessary make sense to reverse it (consider
-      // 'mi' for instance).
-      UNREACHABLE();
-  }
-}
-
-enum FlagsUpdate {
-  SetFlags   = 1,
-  LeaveFlags = 0
-};
-
-enum StatusFlags {
-  NoFlag    = 0,
-
-  // Derive the flag combinations from the system register bit descriptions.
-  NFlag     = N_mask,
-  ZFlag     = Z_mask,
-  CFlag     = C_mask,
-  VFlag     = V_mask,
-  NZFlag    = NFlag | ZFlag,
-  NCFlag    = NFlag | CFlag,
-  NVFlag    = NFlag | VFlag,
-  ZCFlag    = ZFlag | CFlag,
-  ZVFlag    = ZFlag | VFlag,
-  CVFlag    = CFlag | VFlag,
-  NZCFlag   = NFlag | ZFlag | CFlag,
-  NZVFlag   = NFlag | ZFlag | VFlag,
-  NCVFlag   = NFlag | CFlag | VFlag,
-  ZCVFlag   = ZFlag | CFlag | VFlag,
-  NZCVFlag  = NFlag | ZFlag | CFlag | VFlag,
-
-  // Floating-point comparison results.
-  FPEqualFlag       = ZCFlag,
-  FPLessThanFlag    = NFlag,
-  FPGreaterThanFlag = CFlag,
-  FPUnorderedFlag   = CVFlag
-};
-
-enum Shift {
-  NO_SHIFT = -1,
-  LSL = 0x0,
-  LSR = 0x1,
-  ASR = 0x2,
-  ROR = 0x3,
-  MSL = 0x4
-};
-
-enum Extend {
-  NO_EXTEND = -1,
-  UXTB      = 0,
-  UXTH      = 1,
-  UXTW      = 2,
-  UXTX      = 3,
-  SXTB      = 4,
-  SXTH      = 5,
-  SXTW      = 6,
-  SXTX      = 7
-};
-
-enum SystemHint {
-  NOP   = 0,
-  YIELD = 1,
-  WFE   = 2,
-  WFI   = 3,
-  SEV   = 4,
-  SEVL  = 5
-};
-
-enum BarrierDomain {
-  OuterShareable = 0,
-  NonShareable   = 1,
-  InnerShareable = 2,
-  FullSystem     = 3
-};
-
-enum BarrierType {
-  BarrierOther  = 0,
-  BarrierReads  = 1,
-  BarrierWrites = 2,
-  BarrierAll    = 3
-};
-
-// System/special register names.
-// This information is not encoded as one field but as the concatenation of
-// multiple fields (Op0<0>, Op1, Crn, Crm, Op2).
-enum SystemRegister {
-  NZCV = ((0x1 << SysO0_offset) |
-          (0x3 << SysOp1_offset) |
-          (0x4 << CRn_offset) |
-          (0x2 << CRm_offset) |
-          (0x0 << SysOp2_offset)) >> ImmSystemRegister_offset,
-  FPCR = ((0x1 << SysO0_offset) |
-          (0x3 << SysOp1_offset) |
-          (0x4 << CRn_offset) |
-          (0x4 << CRm_offset) |
-          (0x0 << SysOp2_offset)) >> ImmSystemRegister_offset
-};
-
-// Instruction enumerations.
-//
-// These are the masks that define a class of instructions, and the list of
-// instructions within each class. Each enumeration has a Fixed, FMask and
-// Mask value.
-//
-// Fixed: The fixed bits in this instruction class.
-// FMask: The mask used to extract the fixed bits in the class.
-// Mask:  The mask used to identify the instructions within a class.
-//
-// The enumerations can be used like this:
-//
-// DCHECK(instr->Mask(PCRelAddressingFMask) == PCRelAddressingFixed);
-// switch(instr->Mask(PCRelAddressingMask)) {
-//   case ADR:  Format("adr 'Xd, 'AddrPCRelByte"); break;
-//   case ADRP: Format("adrp 'Xd, 'AddrPCRelPage"); break;
-//   default:   printf("Unknown instruction\n");
-// }
-
-// Used to corrupt encodings by setting all bits when orred. Although currently
-// unallocated in AArch64, this encoding is not guaranteed to be undefined
-// indefinitely.
-const uint32_t kUnallocatedInstruction = 0xffffffff;
-
-// Generic fields.
-enum GenericInstrField {
-  SixtyFourBits        = 0x80000000,
-  ThirtyTwoBits        = 0x00000000,
-  FP32                 = 0x00000000,
-  FP64                 = 0x00400000
-};
-
-enum NEONFormatField {
-  NEONFormatFieldMask = 0x40C00000,
-  NEON_Q = 0x40000000,
-  NEON_8B = 0x00000000,
-  NEON_16B = NEON_8B | NEON_Q,
-  NEON_4H = 0x00400000,
-  NEON_8H = NEON_4H | NEON_Q,
-  NEON_2S = 0x00800000,
-  NEON_4S = NEON_2S | NEON_Q,
-  NEON_1D = 0x00C00000,
-  NEON_2D = 0x00C00000 | NEON_Q
-};
-
-enum NEONFPFormatField {
-  NEONFPFormatFieldMask = 0x40400000,
-  NEON_FP_2S = FP32,
-  NEON_FP_4S = FP32 | NEON_Q,
-  NEON_FP_2D = FP64 | NEON_Q
-};
-
-enum NEONLSFormatField {
-  NEONLSFormatFieldMask = 0x40000C00,
-  LS_NEON_8B = 0x00000000,
-  LS_NEON_16B = LS_NEON_8B | NEON_Q,
-  LS_NEON_4H = 0x00000400,
-  LS_NEON_8H = LS_NEON_4H | NEON_Q,
-  LS_NEON_2S = 0x00000800,
-  LS_NEON_4S = LS_NEON_2S | NEON_Q,
-  LS_NEON_1D = 0x00000C00,
-  LS_NEON_2D = LS_NEON_1D | NEON_Q
-};
-
-enum NEONScalarFormatField {
-  NEONScalarFormatFieldMask = 0x00C00000,
-  NEONScalar = 0x10000000,
-  NEON_B = 0x00000000,
-  NEON_H = 0x00400000,
-  NEON_S = 0x00800000,
-  NEON_D = 0x00C00000
-};
-
-// PC relative addressing.
-enum PCRelAddressingOp {
-  PCRelAddressingFixed = 0x10000000,
-  PCRelAddressingFMask = 0x1F000000,
-  PCRelAddressingMask  = 0x9F000000,
-  ADR                  = PCRelAddressingFixed | 0x00000000,
-  ADRP                 = PCRelAddressingFixed | 0x80000000
-};
-
-// Add/sub (immediate, shifted and extended.)
-const int kSFOffset = 31;
-enum AddSubOp {
-  AddSubOpMask      = 0x60000000,
-  AddSubSetFlagsBit = 0x20000000,
-  ADD               = 0x00000000,
-  ADDS              = ADD | AddSubSetFlagsBit,
-  SUB               = 0x40000000,
-  SUBS              = SUB | AddSubSetFlagsBit
-};
-
-#define ADD_SUB_OP_LIST(V)  \
-  V(ADD),                   \
-  V(ADDS),                  \
-  V(SUB),                   \
-  V(SUBS)
-
-enum AddSubImmediateOp {
-  AddSubImmediateFixed = 0x11000000,
-  AddSubImmediateFMask = 0x1F000000,
-  AddSubImmediateMask  = 0xFF000000,
-  #define ADD_SUB_IMMEDIATE(A)           \
-  A##_w_imm = AddSubImmediateFixed | A,  \
-  A##_x_imm = AddSubImmediateFixed | A | SixtyFourBits
-  ADD_SUB_OP_LIST(ADD_SUB_IMMEDIATE)
-  #undef ADD_SUB_IMMEDIATE
-};
-
-enum AddSubShiftedOp {
-  AddSubShiftedFixed   = 0x0B000000,
-  AddSubShiftedFMask   = 0x1F200000,
-  AddSubShiftedMask    = 0xFF200000,
-  #define ADD_SUB_SHIFTED(A)             \
-  A##_w_shift = AddSubShiftedFixed | A,  \
-  A##_x_shift = AddSubShiftedFixed | A | SixtyFourBits
-  ADD_SUB_OP_LIST(ADD_SUB_SHIFTED)
-  #undef ADD_SUB_SHIFTED
-};
-
-enum AddSubExtendedOp {
-  AddSubExtendedFixed  = 0x0B200000,
-  AddSubExtendedFMask  = 0x1F200000,
-  AddSubExtendedMask   = 0xFFE00000,
-  #define ADD_SUB_EXTENDED(A)           \
-  A##_w_ext = AddSubExtendedFixed | A,  \
-  A##_x_ext = AddSubExtendedFixed | A | SixtyFourBits
-  ADD_SUB_OP_LIST(ADD_SUB_EXTENDED)
-  #undef ADD_SUB_EXTENDED
-};
-
-// Add/sub with carry.
-enum AddSubWithCarryOp {
-  AddSubWithCarryFixed = 0x1A000000,
-  AddSubWithCarryFMask = 0x1FE00000,
-  AddSubWithCarryMask  = 0xFFE0FC00,
-  ADC_w                = AddSubWithCarryFixed | ADD,
-  ADC_x                = AddSubWithCarryFixed | ADD | SixtyFourBits,
-  ADC                  = ADC_w,
-  ADCS_w               = AddSubWithCarryFixed | ADDS,
-  ADCS_x               = AddSubWithCarryFixed | ADDS | SixtyFourBits,
-  SBC_w                = AddSubWithCarryFixed | SUB,
-  SBC_x                = AddSubWithCarryFixed | SUB | SixtyFourBits,
-  SBC                  = SBC_w,
-  SBCS_w               = AddSubWithCarryFixed | SUBS,
-  SBCS_x               = AddSubWithCarryFixed | SUBS | SixtyFourBits
-};
-
-
-// Logical (immediate and shifted register).
-enum LogicalOp {
-  LogicalOpMask = 0x60200000,
-  NOT   = 0x00200000,
-  AND   = 0x00000000,
-  BIC   = AND | NOT,
-  ORR   = 0x20000000,
-  ORN   = ORR | NOT,
-  EOR   = 0x40000000,
-  EON   = EOR | NOT,
-  ANDS  = 0x60000000,
-  BICS  = ANDS | NOT
-};
-
-// Logical immediate.
-enum LogicalImmediateOp {
-  LogicalImmediateFixed = 0x12000000,
-  LogicalImmediateFMask = 0x1F800000,
-  LogicalImmediateMask  = 0xFF800000,
-  AND_w_imm   = LogicalImmediateFixed | AND,
-  AND_x_imm   = LogicalImmediateFixed | AND | SixtyFourBits,
-  ORR_w_imm   = LogicalImmediateFixed | ORR,
-  ORR_x_imm   = LogicalImmediateFixed | ORR | SixtyFourBits,
-  EOR_w_imm   = LogicalImmediateFixed | EOR,
-  EOR_x_imm   = LogicalImmediateFixed | EOR | SixtyFourBits,
-  ANDS_w_imm  = LogicalImmediateFixed | ANDS,
-  ANDS_x_imm  = LogicalImmediateFixed | ANDS | SixtyFourBits
-};
-
-// Logical shifted register.
-enum LogicalShiftedOp {
-  LogicalShiftedFixed = 0x0A000000,
-  LogicalShiftedFMask = 0x1F000000,
-  LogicalShiftedMask  = 0xFF200000,
-  AND_w               = LogicalShiftedFixed | AND,
-  AND_x               = LogicalShiftedFixed | AND | SixtyFourBits,
-  AND_shift           = AND_w,
-  BIC_w               = LogicalShiftedFixed | BIC,
-  BIC_x               = LogicalShiftedFixed | BIC | SixtyFourBits,
-  BIC_shift           = BIC_w,
-  ORR_w               = LogicalShiftedFixed | ORR,
-  ORR_x               = LogicalShiftedFixed | ORR | SixtyFourBits,
-  ORR_shift           = ORR_w,
-  ORN_w               = LogicalShiftedFixed | ORN,
-  ORN_x               = LogicalShiftedFixed | ORN | SixtyFourBits,
-  ORN_shift           = ORN_w,
-  EOR_w               = LogicalShiftedFixed | EOR,
-  EOR_x               = LogicalShiftedFixed | EOR | SixtyFourBits,
-  EOR_shift           = EOR_w,
-  EON_w               = LogicalShiftedFixed | EON,
-  EON_x               = LogicalShiftedFixed | EON | SixtyFourBits,
-  EON_shift           = EON_w,
-  ANDS_w              = LogicalShiftedFixed | ANDS,
-  ANDS_x              = LogicalShiftedFixed | ANDS | SixtyFourBits,
-  ANDS_shift          = ANDS_w,
-  BICS_w              = LogicalShiftedFixed | BICS,
-  BICS_x              = LogicalShiftedFixed | BICS | SixtyFourBits,
-  BICS_shift          = BICS_w
-};
-
-// Move wide immediate.
-enum MoveWideImmediateOp {
-  MoveWideImmediateFixed = 0x12800000,
-  MoveWideImmediateFMask = 0x1F800000,
-  MoveWideImmediateMask  = 0xFF800000,
-  MOVN                   = 0x00000000,
-  MOVZ                   = 0x40000000,
-  MOVK                   = 0x60000000,
-  MOVN_w                 = MoveWideImmediateFixed | MOVN,
-  MOVN_x                 = MoveWideImmediateFixed | MOVN | SixtyFourBits,
-  MOVZ_w                 = MoveWideImmediateFixed | MOVZ,
-  MOVZ_x                 = MoveWideImmediateFixed | MOVZ | SixtyFourBits,
-  MOVK_w                 = MoveWideImmediateFixed | MOVK,
-  MOVK_x                 = MoveWideImmediateFixed | MOVK | SixtyFourBits
-};
-
-// Bitfield.
-const int kBitfieldNOffset = 22;
-enum BitfieldOp {
-  BitfieldFixed = 0x13000000,
-  BitfieldFMask = 0x1F800000,
-  BitfieldMask  = 0xFF800000,
-  SBFM_w        = BitfieldFixed | 0x00000000,
-  SBFM_x        = BitfieldFixed | 0x80000000,
-  SBFM          = SBFM_w,
-  BFM_w         = BitfieldFixed | 0x20000000,
-  BFM_x         = BitfieldFixed | 0xA0000000,
-  BFM           = BFM_w,
-  UBFM_w        = BitfieldFixed | 0x40000000,
-  UBFM_x        = BitfieldFixed | 0xC0000000,
-  UBFM          = UBFM_w
-  // Bitfield N field.
-};
-
-// Extract.
-enum ExtractOp {
-  ExtractFixed = 0x13800000,
-  ExtractFMask = 0x1F800000,
-  ExtractMask  = 0xFFA00000,
-  EXTR_w       = ExtractFixed | 0x00000000,
-  EXTR_x       = ExtractFixed | 0x80000000,
-  EXTR         = EXTR_w
-};
-
-// Unconditional branch.
-enum UnconditionalBranchOp {
-  UnconditionalBranchFixed = 0x14000000,
-  UnconditionalBranchFMask = 0x7C000000,
-  UnconditionalBranchMask  = 0xFC000000,
-  B                        = UnconditionalBranchFixed | 0x00000000,
-  BL                       = UnconditionalBranchFixed | 0x80000000
-};
-
-// Unconditional branch to register.
-enum UnconditionalBranchToRegisterOp {
-  UnconditionalBranchToRegisterFixed = 0xD6000000,
-  UnconditionalBranchToRegisterFMask = 0xFE000000,
-  UnconditionalBranchToRegisterMask  = 0xFFFFFC1F,
-  BR      = UnconditionalBranchToRegisterFixed | 0x001F0000,
-  BLR     = UnconditionalBranchToRegisterFixed | 0x003F0000,
-  RET     = UnconditionalBranchToRegisterFixed | 0x005F0000
-};
-
-// Compare and branch.
-enum CompareBranchOp {
-  CompareBranchFixed = 0x34000000,
-  CompareBranchFMask = 0x7E000000,
-  CompareBranchMask  = 0xFF000000,
-  CBZ_w              = CompareBranchFixed | 0x00000000,
-  CBZ_x              = CompareBranchFixed | 0x80000000,
-  CBZ                = CBZ_w,
-  CBNZ_w             = CompareBranchFixed | 0x01000000,
-  CBNZ_x             = CompareBranchFixed | 0x81000000,
-  CBNZ               = CBNZ_w
-};
-
-// Test and branch.
-enum TestBranchOp {
-  TestBranchFixed = 0x36000000,
-  TestBranchFMask = 0x7E000000,
-  TestBranchMask  = 0x7F000000,
-  TBZ             = TestBranchFixed | 0x00000000,
-  TBNZ            = TestBranchFixed | 0x01000000
-};
-
-// Conditional branch.
-enum ConditionalBranchOp {
-  ConditionalBranchFixed = 0x54000000,
-  ConditionalBranchFMask = 0xFE000000,
-  ConditionalBranchMask  = 0xFF000010,
-  B_cond                 = ConditionalBranchFixed | 0x00000000
-};
-
-// System.
-// System instruction encoding is complicated because some instructions use op
-// and CR fields to encode parameters. To handle this cleanly, the system
-// instructions are split into more than one enum.
-
-enum SystemOp {
-  SystemFixed = 0xD5000000,
-  SystemFMask = 0xFFC00000
-};
-
-enum SystemSysRegOp {
-  SystemSysRegFixed = 0xD5100000,
-  SystemSysRegFMask = 0xFFD00000,
-  SystemSysRegMask  = 0xFFF00000,
-  MRS               = SystemSysRegFixed | 0x00200000,
-  MSR               = SystemSysRegFixed | 0x00000000
-};
-
-enum SystemHintOp {
-  SystemHintFixed = 0xD503201F,
-  SystemHintFMask = 0xFFFFF01F,
-  SystemHintMask  = 0xFFFFF01F,
-  HINT            = SystemHintFixed | 0x00000000
-};
-
-// Exception.
-enum ExceptionOp {
-  ExceptionFixed = 0xD4000000,
-  ExceptionFMask = 0xFF000000,
-  ExceptionMask  = 0xFFE0001F,
-  HLT            = ExceptionFixed | 0x00400000,
-  BRK            = ExceptionFixed | 0x00200000,
-  SVC            = ExceptionFixed | 0x00000001,
-  HVC            = ExceptionFixed | 0x00000002,
-  SMC            = ExceptionFixed | 0x00000003,
-  DCPS1          = ExceptionFixed | 0x00A00001,
-  DCPS2          = ExceptionFixed | 0x00A00002,
-  DCPS3          = ExceptionFixed | 0x00A00003
-};
-// Code used to spot hlt instructions that should not be hit.
-const int kHltBadCode = 0xbad;
-
-enum MemBarrierOp {
-  MemBarrierFixed = 0xD503309F,
-  MemBarrierFMask = 0xFFFFF09F,
-  MemBarrierMask  = 0xFFFFF0FF,
-  DSB             = MemBarrierFixed | 0x00000000,
-  DMB             = MemBarrierFixed | 0x00000020,
-  ISB             = MemBarrierFixed | 0x00000040
-};
-
-// Any load or store (including pair).
-enum LoadStoreAnyOp {
-  LoadStoreAnyFMask = 0x0a000000,
-  LoadStoreAnyFixed = 0x08000000
-};
-
-// Any load pair or store pair.
-enum LoadStorePairAnyOp {
-  LoadStorePairAnyFMask = 0x3a000000,
-  LoadStorePairAnyFixed = 0x28000000
-};
-
-#define LOAD_STORE_PAIR_OP_LIST(V)                                         \
-  V(STP, w, 0x00000000)                                                    \
-  , V(LDP, w, 0x00400000), V(LDPSW, x, 0x40400000), V(STP, x, 0x80000000), \
-      V(LDP, x, 0x80400000), V(STP, s, 0x04000000), V(LDP, s, 0x04400000), \
-      V(STP, d, 0x44000000), V(LDP, d, 0x44400000), V(STP, q, 0x84000000), \
-      V(LDP, q, 0x84400000)
-
-// Load/store pair (post, pre and offset.)
-enum LoadStorePairOp {
-  LoadStorePairMask = 0xC4400000,
-  LoadStorePairLBit = 1 << 22,
-  #define LOAD_STORE_PAIR(A, B, C) \
-  A##_##B = C
-  LOAD_STORE_PAIR_OP_LIST(LOAD_STORE_PAIR)
-  #undef LOAD_STORE_PAIR
-};
-
-enum LoadStorePairPostIndexOp {
-  LoadStorePairPostIndexFixed = 0x28800000,
-  LoadStorePairPostIndexFMask = 0x3B800000,
-  LoadStorePairPostIndexMask  = 0xFFC00000,
-  #define LOAD_STORE_PAIR_POST_INDEX(A, B, C)  \
-  A##_##B##_post = LoadStorePairPostIndexFixed | A##_##B
-  LOAD_STORE_PAIR_OP_LIST(LOAD_STORE_PAIR_POST_INDEX)
-  #undef LOAD_STORE_PAIR_POST_INDEX
-};
-
-enum LoadStorePairPreIndexOp {
-  LoadStorePairPreIndexFixed = 0x29800000,
-  LoadStorePairPreIndexFMask = 0x3B800000,
-  LoadStorePairPreIndexMask  = 0xFFC00000,
-  #define LOAD_STORE_PAIR_PRE_INDEX(A, B, C)  \
-  A##_##B##_pre = LoadStorePairPreIndexFixed | A##_##B
-  LOAD_STORE_PAIR_OP_LIST(LOAD_STORE_PAIR_PRE_INDEX)
-  #undef LOAD_STORE_PAIR_PRE_INDEX
-};
-
-enum LoadStorePairOffsetOp {
-  LoadStorePairOffsetFixed = 0x29000000,
-  LoadStorePairOffsetFMask = 0x3B800000,
-  LoadStorePairOffsetMask  = 0xFFC00000,
-  #define LOAD_STORE_PAIR_OFFSET(A, B, C)  \
-  A##_##B##_off = LoadStorePairOffsetFixed | A##_##B
-  LOAD_STORE_PAIR_OP_LIST(LOAD_STORE_PAIR_OFFSET)
-  #undef LOAD_STORE_PAIR_OFFSET
-};
-
-// Load literal.
-enum LoadLiteralOp {
-  LoadLiteralFixed = 0x18000000,
-  LoadLiteralFMask = 0x3B000000,
-  LoadLiteralMask  = 0xFF000000,
-  LDR_w_lit        = LoadLiteralFixed | 0x00000000,
-  LDR_x_lit        = LoadLiteralFixed | 0x40000000,
-  LDRSW_x_lit      = LoadLiteralFixed | 0x80000000,
-  PRFM_lit         = LoadLiteralFixed | 0xC0000000,
-  LDR_s_lit        = LoadLiteralFixed | 0x04000000,
-  LDR_d_lit        = LoadLiteralFixed | 0x44000000
-};
-
-// clang-format off
-
-#define LOAD_STORE_OP_LIST(V)  \
-  V(ST, RB, w,  0x00000000),   \
-  V(ST, RH, w,  0x40000000),   \
-  V(ST, R, w,   0x80000000),   \
-  V(ST, R, x,   0xC0000000),   \
-  V(LD, RB, w,  0x00400000),   \
-  V(LD, RH, w,  0x40400000),   \
-  V(LD, R, w,   0x80400000),   \
-  V(LD, R, x,   0xC0400000),   \
-  V(LD, RSB, x, 0x00800000),   \
-  V(LD, RSH, x, 0x40800000),   \
-  V(LD, RSW, x, 0x80800000),   \
-  V(LD, RSB, w, 0x00C00000),   \
-  V(LD, RSH, w, 0x40C00000),   \
-  V(ST, R, b,   0x04000000),   \
-  V(ST, R, h,   0x44000000),   \
-  V(ST, R, s,   0x84000000),   \
-  V(ST, R, d,   0xC4000000),   \
-  V(ST, R, q,   0x04800000),   \
-  V(LD, R, b,   0x04400000),   \
-  V(LD, R, h,   0x44400000),   \
-  V(LD, R, s,   0x84400000),   \
-  V(LD, R, d,   0xC4400000),   \
-  V(LD, R, q,   0x04C00000)
-
-// clang-format on
-
-// Load/store unscaled offset.
-enum LoadStoreUnscaledOffsetOp {
-  LoadStoreUnscaledOffsetFixed = 0x38000000,
-  LoadStoreUnscaledOffsetFMask = 0x3B200C00,
-  LoadStoreUnscaledOffsetMask  = 0xFFE00C00,
-  #define LOAD_STORE_UNSCALED(A, B, C, D)  \
-  A##U##B##_##C = LoadStoreUnscaledOffsetFixed | D
-  LOAD_STORE_OP_LIST(LOAD_STORE_UNSCALED)
-  #undef LOAD_STORE_UNSCALED
-};
-
-// Load/store (post, pre, offset and unsigned.)
-enum LoadStoreOp {
-  LoadStoreMask = 0xC4C00000,
-#define LOAD_STORE(A, B, C, D) A##B##_##C = D
-  LOAD_STORE_OP_LIST(LOAD_STORE),
-#undef LOAD_STORE
-  PRFM = 0xC0800000
-};
-
-// Load/store post index.
-enum LoadStorePostIndex {
-  LoadStorePostIndexFixed = 0x38000400,
-  LoadStorePostIndexFMask = 0x3B200C00,
-  LoadStorePostIndexMask  = 0xFFE00C00,
-  #define LOAD_STORE_POST_INDEX(A, B, C, D)  \
-  A##B##_##C##_post = LoadStorePostIndexFixed | D
-  LOAD_STORE_OP_LIST(LOAD_STORE_POST_INDEX)
-  #undef LOAD_STORE_POST_INDEX
-};
-
-// Load/store pre index.
-enum LoadStorePreIndex {
-  LoadStorePreIndexFixed = 0x38000C00,
-  LoadStorePreIndexFMask = 0x3B200C00,
-  LoadStorePreIndexMask  = 0xFFE00C00,
-  #define LOAD_STORE_PRE_INDEX(A, B, C, D)  \
-  A##B##_##C##_pre = LoadStorePreIndexFixed | D
-  LOAD_STORE_OP_LIST(LOAD_STORE_PRE_INDEX)
-  #undef LOAD_STORE_PRE_INDEX
-};
-
-// Load/store unsigned offset.
-enum LoadStoreUnsignedOffset {
-  LoadStoreUnsignedOffsetFixed = 0x39000000,
-  LoadStoreUnsignedOffsetFMask = 0x3B000000,
-  LoadStoreUnsignedOffsetMask  = 0xFFC00000,
-  PRFM_unsigned                = LoadStoreUnsignedOffsetFixed | PRFM,
-  #define LOAD_STORE_UNSIGNED_OFFSET(A, B, C, D) \
-  A##B##_##C##_unsigned = LoadStoreUnsignedOffsetFixed | D
-  LOAD_STORE_OP_LIST(LOAD_STORE_UNSIGNED_OFFSET)
-  #undef LOAD_STORE_UNSIGNED_OFFSET
-};
-
-// Load/store register offset.
-enum LoadStoreRegisterOffset {
-  LoadStoreRegisterOffsetFixed = 0x38200800,
-  LoadStoreRegisterOffsetFMask = 0x3B200C00,
-  LoadStoreRegisterOffsetMask  = 0xFFE00C00,
-  PRFM_reg                     = LoadStoreRegisterOffsetFixed | PRFM,
-  #define LOAD_STORE_REGISTER_OFFSET(A, B, C, D) \
-  A##B##_##C##_reg = LoadStoreRegisterOffsetFixed | D
-  LOAD_STORE_OP_LIST(LOAD_STORE_REGISTER_OFFSET)
-  #undef LOAD_STORE_REGISTER_OFFSET
-};
-
-// Load/store acquire/release.
-enum LoadStoreAcquireReleaseOp {
-  LoadStoreAcquireReleaseFixed = 0x08000000,
-  LoadStoreAcquireReleaseFMask = 0x3F000000,
-  LoadStoreAcquireReleaseMask = 0xCFC08000,
-  STLXR_b = LoadStoreAcquireReleaseFixed | 0x00008000,
-  LDAXR_b = LoadStoreAcquireReleaseFixed | 0x00408000,
-  STLR_b  = LoadStoreAcquireReleaseFixed | 0x00808000,
-  LDAR_b  = LoadStoreAcquireReleaseFixed | 0x00C08000,
-  STLXR_h = LoadStoreAcquireReleaseFixed | 0x40008000,
-  LDAXR_h = LoadStoreAcquireReleaseFixed | 0x40408000,
-  STLR_h  = LoadStoreAcquireReleaseFixed | 0x40808000,
-  LDAR_h  = LoadStoreAcquireReleaseFixed | 0x40C08000,
-  STLXR_w = LoadStoreAcquireReleaseFixed | 0x80008000,
-  LDAXR_w = LoadStoreAcquireReleaseFixed | 0x80408000,
-  STLR_w  = LoadStoreAcquireReleaseFixed | 0x80808000,
-  LDAR_w  = LoadStoreAcquireReleaseFixed | 0x80C08000,
-  STLXR_x = LoadStoreAcquireReleaseFixed | 0xC0008000,
-  LDAXR_x = LoadStoreAcquireReleaseFixed | 0xC0408000,
-  STLR_x  = LoadStoreAcquireReleaseFixed | 0xC0808000,
-  LDAR_x  = LoadStoreAcquireReleaseFixed | 0xC0C08000,
-};
-
-// Conditional compare.
-enum ConditionalCompareOp {
-  ConditionalCompareMask = 0x60000000,
-  CCMN                   = 0x20000000,
-  CCMP                   = 0x60000000
-};
-
-// Conditional compare register.
-enum ConditionalCompareRegisterOp {
-  ConditionalCompareRegisterFixed = 0x1A400000,
-  ConditionalCompareRegisterFMask = 0x1FE00800,
-  ConditionalCompareRegisterMask  = 0xFFE00C10,
-  CCMN_w = ConditionalCompareRegisterFixed | CCMN,
-  CCMN_x = ConditionalCompareRegisterFixed | SixtyFourBits | CCMN,
-  CCMP_w = ConditionalCompareRegisterFixed | CCMP,
-  CCMP_x = ConditionalCompareRegisterFixed | SixtyFourBits | CCMP
-};
-
-// Conditional compare immediate.
-enum ConditionalCompareImmediateOp {
-  ConditionalCompareImmediateFixed = 0x1A400800,
-  ConditionalCompareImmediateFMask = 0x1FE00800,
-  ConditionalCompareImmediateMask  = 0xFFE00C10,
-  CCMN_w_imm = ConditionalCompareImmediateFixed | CCMN,
-  CCMN_x_imm = ConditionalCompareImmediateFixed | SixtyFourBits | CCMN,
-  CCMP_w_imm = ConditionalCompareImmediateFixed | CCMP,
-  CCMP_x_imm = ConditionalCompareImmediateFixed | SixtyFourBits | CCMP
-};
-
-// Conditional select.
-enum ConditionalSelectOp {
-  ConditionalSelectFixed = 0x1A800000,
-  ConditionalSelectFMask = 0x1FE00000,
-  ConditionalSelectMask  = 0xFFE00C00,
-  CSEL_w                 = ConditionalSelectFixed | 0x00000000,
-  CSEL_x                 = ConditionalSelectFixed | 0x80000000,
-  CSEL                   = CSEL_w,
-  CSINC_w                = ConditionalSelectFixed | 0x00000400,
-  CSINC_x                = ConditionalSelectFixed | 0x80000400,
-  CSINC                  = CSINC_w,
-  CSINV_w                = ConditionalSelectFixed | 0x40000000,
-  CSINV_x                = ConditionalSelectFixed | 0xC0000000,
-  CSINV                  = CSINV_w,
-  CSNEG_w                = ConditionalSelectFixed | 0x40000400,
-  CSNEG_x                = ConditionalSelectFixed | 0xC0000400,
-  CSNEG                  = CSNEG_w
-};
-
-// Data processing 1 source.
-enum DataProcessing1SourceOp {
-  DataProcessing1SourceFixed = 0x5AC00000,
-  DataProcessing1SourceFMask = 0x5FE00000,
-  DataProcessing1SourceMask  = 0xFFFFFC00,
-  RBIT    = DataProcessing1SourceFixed | 0x00000000,
-  RBIT_w  = RBIT,
-  RBIT_x  = RBIT | SixtyFourBits,
-  REV16   = DataProcessing1SourceFixed | 0x00000400,
-  REV16_w = REV16,
-  REV16_x = REV16 | SixtyFourBits,
-  REV     = DataProcessing1SourceFixed | 0x00000800,
-  REV_w   = REV,
-  REV32_x = REV | SixtyFourBits,
-  REV_x   = DataProcessing1SourceFixed | SixtyFourBits | 0x00000C00,
-  CLZ     = DataProcessing1SourceFixed | 0x00001000,
-  CLZ_w   = CLZ,
-  CLZ_x   = CLZ | SixtyFourBits,
-  CLS     = DataProcessing1SourceFixed | 0x00001400,
-  CLS_w   = CLS,
-  CLS_x   = CLS | SixtyFourBits
-};
-
-// Data processing 2 source.
-enum DataProcessing2SourceOp {
-  DataProcessing2SourceFixed = 0x1AC00000,
-  DataProcessing2SourceFMask = 0x5FE00000,
-  DataProcessing2SourceMask  = 0xFFE0FC00,
-  UDIV_w  = DataProcessing2SourceFixed | 0x00000800,
-  UDIV_x  = DataProcessing2SourceFixed | 0x80000800,
-  UDIV    = UDIV_w,
-  SDIV_w  = DataProcessing2SourceFixed | 0x00000C00,
-  SDIV_x  = DataProcessing2SourceFixed | 0x80000C00,
-  SDIV    = SDIV_w,
-  LSLV_w  = DataProcessing2SourceFixed | 0x00002000,
-  LSLV_x  = DataProcessing2SourceFixed | 0x80002000,
-  LSLV    = LSLV_w,
-  LSRV_w  = DataProcessing2SourceFixed | 0x00002400,
-  LSRV_x  = DataProcessing2SourceFixed | 0x80002400,
-  LSRV    = LSRV_w,
-  ASRV_w  = DataProcessing2SourceFixed | 0x00002800,
-  ASRV_x  = DataProcessing2SourceFixed | 0x80002800,
-  ASRV    = ASRV_w,
-  RORV_w  = DataProcessing2SourceFixed | 0x00002C00,
-  RORV_x  = DataProcessing2SourceFixed | 0x80002C00,
-  RORV    = RORV_w,
-  CRC32B  = DataProcessing2SourceFixed | 0x00004000,
-  CRC32H  = DataProcessing2SourceFixed | 0x00004400,
-  CRC32W  = DataProcessing2SourceFixed | 0x00004800,
-  CRC32X  = DataProcessing2SourceFixed | SixtyFourBits | 0x00004C00,
-  CRC32CB = DataProcessing2SourceFixed | 0x00005000,
-  CRC32CH = DataProcessing2SourceFixed | 0x00005400,
-  CRC32CW = DataProcessing2SourceFixed | 0x00005800,
-  CRC32CX = DataProcessing2SourceFixed | SixtyFourBits | 0x00005C00
-};
-
-// Data processing 3 source.
-enum DataProcessing3SourceOp {
-  DataProcessing3SourceFixed = 0x1B000000,
-  DataProcessing3SourceFMask = 0x1F000000,
-  DataProcessing3SourceMask  = 0xFFE08000,
-  MADD_w                     = DataProcessing3SourceFixed | 0x00000000,
-  MADD_x                     = DataProcessing3SourceFixed | 0x80000000,
-  MADD                       = MADD_w,
-  MSUB_w                     = DataProcessing3SourceFixed | 0x00008000,
-  MSUB_x                     = DataProcessing3SourceFixed | 0x80008000,
-  MSUB                       = MSUB_w,
-  SMADDL_x                   = DataProcessing3SourceFixed | 0x80200000,
-  SMSUBL_x                   = DataProcessing3SourceFixed | 0x80208000,
-  SMULH_x                    = DataProcessing3SourceFixed | 0x80400000,
-  UMADDL_x                   = DataProcessing3SourceFixed | 0x80A00000,
-  UMSUBL_x                   = DataProcessing3SourceFixed | 0x80A08000,
-  UMULH_x                    = DataProcessing3SourceFixed | 0x80C00000
-};
-
-// Floating point compare.
-enum FPCompareOp {
-  FPCompareFixed = 0x1E202000,
-  FPCompareFMask = 0x5F203C00,
-  FPCompareMask  = 0xFFE0FC1F,
-  FCMP_s         = FPCompareFixed | 0x00000000,
-  FCMP_d         = FPCompareFixed | FP64 | 0x00000000,
-  FCMP           = FCMP_s,
-  FCMP_s_zero    = FPCompareFixed | 0x00000008,
-  FCMP_d_zero    = FPCompareFixed | FP64 | 0x00000008,
-  FCMP_zero      = FCMP_s_zero,
-  FCMPE_s        = FPCompareFixed | 0x00000010,
-  FCMPE_d        = FPCompareFixed | FP64 | 0x00000010,
-  FCMPE_s_zero   = FPCompareFixed | 0x00000018,
-  FCMPE_d_zero   = FPCompareFixed | FP64 | 0x00000018
-};
-
-// Floating point conditional compare.
-enum FPConditionalCompareOp {
-  FPConditionalCompareFixed = 0x1E200400,
-  FPConditionalCompareFMask = 0x5F200C00,
-  FPConditionalCompareMask  = 0xFFE00C10,
-  FCCMP_s                   = FPConditionalCompareFixed | 0x00000000,
-  FCCMP_d                   = FPConditionalCompareFixed | FP64 | 0x00000000,
-  FCCMP                     = FCCMP_s,
-  FCCMPE_s                  = FPConditionalCompareFixed | 0x00000010,
-  FCCMPE_d                  = FPConditionalCompareFixed | FP64 | 0x00000010,
-  FCCMPE                    = FCCMPE_s
-};
-
-// Floating point conditional select.
-enum FPConditionalSelectOp {
-  FPConditionalSelectFixed = 0x1E200C00,
-  FPConditionalSelectFMask = 0x5F200C00,
-  FPConditionalSelectMask  = 0xFFE00C00,
-  FCSEL_s                  = FPConditionalSelectFixed | 0x00000000,
-  FCSEL_d                  = FPConditionalSelectFixed | FP64 | 0x00000000,
-  FCSEL                    = FCSEL_s
-};
-
-// Floating point immediate.
-enum FPImmediateOp {
-  FPImmediateFixed = 0x1E201000,
-  FPImmediateFMask = 0x5F201C00,
-  FPImmediateMask  = 0xFFE01C00,
-  FMOV_s_imm       = FPImmediateFixed | 0x00000000,
-  FMOV_d_imm       = FPImmediateFixed | FP64 | 0x00000000
-};
-
-// Floating point data processing 1 source.
-enum FPDataProcessing1SourceOp {
-  FPDataProcessing1SourceFixed = 0x1E204000,
-  FPDataProcessing1SourceFMask = 0x5F207C00,
-  FPDataProcessing1SourceMask = 0xFFFFFC00,
-  FMOV_s = FPDataProcessing1SourceFixed | 0x00000000,
-  FMOV_d = FPDataProcessing1SourceFixed | FP64 | 0x00000000,
-  FMOV = FMOV_s,
-  FABS_s = FPDataProcessing1SourceFixed | 0x00008000,
-  FABS_d = FPDataProcessing1SourceFixed | FP64 | 0x00008000,
-  FABS = FABS_s,
-  FNEG_s = FPDataProcessing1SourceFixed | 0x00010000,
-  FNEG_d = FPDataProcessing1SourceFixed | FP64 | 0x00010000,
-  FNEG = FNEG_s,
-  FSQRT_s = FPDataProcessing1SourceFixed | 0x00018000,
-  FSQRT_d = FPDataProcessing1SourceFixed | FP64 | 0x00018000,
-  FSQRT = FSQRT_s,
-  FCVT_ds = FPDataProcessing1SourceFixed | 0x00028000,
-  FCVT_sd = FPDataProcessing1SourceFixed | FP64 | 0x00020000,
-  FCVT_hs = FPDataProcessing1SourceFixed | 0x00038000,
-  FCVT_hd = FPDataProcessing1SourceFixed | FP64 | 0x00038000,
-  FCVT_sh = FPDataProcessing1SourceFixed | 0x00C20000,
-  FCVT_dh = FPDataProcessing1SourceFixed | 0x00C28000,
-  FRINTN_s = FPDataProcessing1SourceFixed | 0x00040000,
-  FRINTN_d = FPDataProcessing1SourceFixed | FP64 | 0x00040000,
-  FRINTN = FRINTN_s,
-  FRINTP_s = FPDataProcessing1SourceFixed | 0x00048000,
-  FRINTP_d = FPDataProcessing1SourceFixed | FP64 | 0x00048000,
-  FRINTP = FRINTP_s,
-  FRINTM_s = FPDataProcessing1SourceFixed | 0x00050000,
-  FRINTM_d = FPDataProcessing1SourceFixed | FP64 | 0x00050000,
-  FRINTM = FRINTM_s,
-  FRINTZ_s = FPDataProcessing1SourceFixed | 0x00058000,
-  FRINTZ_d = FPDataProcessing1SourceFixed | FP64 | 0x00058000,
-  FRINTZ = FRINTZ_s,
-  FRINTA_s = FPDataProcessing1SourceFixed | 0x00060000,
-  FRINTA_d = FPDataProcessing1SourceFixed | FP64 | 0x00060000,
-  FRINTA = FRINTA_s,
-  FRINTX_s = FPDataProcessing1SourceFixed | 0x00070000,
-  FRINTX_d = FPDataProcessing1SourceFixed | FP64 | 0x00070000,
-  FRINTX = FRINTX_s,
-  FRINTI_s = FPDataProcessing1SourceFixed | 0x00078000,
-  FRINTI_d = FPDataProcessing1SourceFixed | FP64 | 0x00078000,
-  FRINTI = FRINTI_s
-};
-
-// Floating point data processing 2 source.
-enum FPDataProcessing2SourceOp {
-  FPDataProcessing2SourceFixed = 0x1E200800,
-  FPDataProcessing2SourceFMask = 0x5F200C00,
-  FPDataProcessing2SourceMask  = 0xFFE0FC00,
-  FMUL     = FPDataProcessing2SourceFixed | 0x00000000,
-  FMUL_s   = FMUL,
-  FMUL_d   = FMUL | FP64,
-  FDIV     = FPDataProcessing2SourceFixed | 0x00001000,
-  FDIV_s   = FDIV,
-  FDIV_d   = FDIV | FP64,
-  FADD     = FPDataProcessing2SourceFixed | 0x00002000,
-  FADD_s   = FADD,
-  FADD_d   = FADD | FP64,
-  FSUB     = FPDataProcessing2SourceFixed | 0x00003000,
-  FSUB_s   = FSUB,
-  FSUB_d   = FSUB | FP64,
-  FMAX     = FPDataProcessing2SourceFixed | 0x00004000,
-  FMAX_s   = FMAX,
-  FMAX_d   = FMAX | FP64,
-  FMIN     = FPDataProcessing2SourceFixed | 0x00005000,
-  FMIN_s   = FMIN,
-  FMIN_d   = FMIN | FP64,
-  FMAXNM   = FPDataProcessing2SourceFixed | 0x00006000,
-  FMAXNM_s = FMAXNM,
-  FMAXNM_d = FMAXNM | FP64,
-  FMINNM   = FPDataProcessing2SourceFixed | 0x00007000,
-  FMINNM_s = FMINNM,
-  FMINNM_d = FMINNM | FP64,
-  FNMUL    = FPDataProcessing2SourceFixed | 0x00008000,
-  FNMUL_s  = FNMUL,
-  FNMUL_d  = FNMUL | FP64
-};
-
-// Floating point data processing 3 source.
-enum FPDataProcessing3SourceOp {
-  FPDataProcessing3SourceFixed = 0x1F000000,
-  FPDataProcessing3SourceFMask = 0x5F000000,
-  FPDataProcessing3SourceMask  = 0xFFE08000,
-  FMADD_s                      = FPDataProcessing3SourceFixed | 0x00000000,
-  FMSUB_s                      = FPDataProcessing3SourceFixed | 0x00008000,
-  FNMADD_s                     = FPDataProcessing3SourceFixed | 0x00200000,
-  FNMSUB_s                     = FPDataProcessing3SourceFixed | 0x00208000,
-  FMADD_d                      = FPDataProcessing3SourceFixed | 0x00400000,
-  FMSUB_d                      = FPDataProcessing3SourceFixed | 0x00408000,
-  FNMADD_d                     = FPDataProcessing3SourceFixed | 0x00600000,
-  FNMSUB_d                     = FPDataProcessing3SourceFixed | 0x00608000
-};
-
-// Conversion between floating point and integer.
-enum FPIntegerConvertOp {
-  FPIntegerConvertFixed = 0x1E200000,
-  FPIntegerConvertFMask = 0x5F20FC00,
-  FPIntegerConvertMask = 0xFFFFFC00,
-  FCVTNS = FPIntegerConvertFixed | 0x00000000,
-  FCVTNS_ws = FCVTNS,
-  FCVTNS_xs = FCVTNS | SixtyFourBits,
-  FCVTNS_wd = FCVTNS | FP64,
-  FCVTNS_xd = FCVTNS | SixtyFourBits | FP64,
-  FCVTNU = FPIntegerConvertFixed | 0x00010000,
-  FCVTNU_ws = FCVTNU,
-  FCVTNU_xs = FCVTNU | SixtyFourBits,
-  FCVTNU_wd = FCVTNU | FP64,
-  FCVTNU_xd = FCVTNU | SixtyFourBits | FP64,
-  FCVTPS = FPIntegerConvertFixed | 0x00080000,
-  FCVTPS_ws = FCVTPS,
-  FCVTPS_xs = FCVTPS | SixtyFourBits,
-  FCVTPS_wd = FCVTPS | FP64,
-  FCVTPS_xd = FCVTPS | SixtyFourBits | FP64,
-  FCVTPU = FPIntegerConvertFixed | 0x00090000,
-  FCVTPU_ws = FCVTPU,
-  FCVTPU_xs = FCVTPU | SixtyFourBits,
-  FCVTPU_wd = FCVTPU | FP64,
-  FCVTPU_xd = FCVTPU | SixtyFourBits | FP64,
-  FCVTMS = FPIntegerConvertFixed | 0x00100000,
-  FCVTMS_ws = FCVTMS,
-  FCVTMS_xs = FCVTMS | SixtyFourBits,
-  FCVTMS_wd = FCVTMS | FP64,
-  FCVTMS_xd = FCVTMS | SixtyFourBits | FP64,
-  FCVTMU = FPIntegerConvertFixed | 0x00110000,
-  FCVTMU_ws = FCVTMU,
-  FCVTMU_xs = FCVTMU | SixtyFourBits,
-  FCVTMU_wd = FCVTMU | FP64,
-  FCVTMU_xd = FCVTMU | SixtyFourBits | FP64,
-  FCVTZS = FPIntegerConvertFixed | 0x00180000,
-  FCVTZS_ws = FCVTZS,
-  FCVTZS_xs = FCVTZS | SixtyFourBits,
-  FCVTZS_wd = FCVTZS | FP64,
-  FCVTZS_xd = FCVTZS | SixtyFourBits | FP64,
-  FCVTZU = FPIntegerConvertFixed | 0x00190000,
-  FCVTZU_ws = FCVTZU,
-  FCVTZU_xs = FCVTZU | SixtyFourBits,
-  FCVTZU_wd = FCVTZU | FP64,
-  FCVTZU_xd = FCVTZU | SixtyFourBits | FP64,
-  SCVTF = FPIntegerConvertFixed | 0x00020000,
-  SCVTF_sw = SCVTF,
-  SCVTF_sx = SCVTF | SixtyFourBits,
-  SCVTF_dw = SCVTF | FP64,
-  SCVTF_dx = SCVTF | SixtyFourBits | FP64,
-  UCVTF = FPIntegerConvertFixed | 0x00030000,
-  UCVTF_sw = UCVTF,
-  UCVTF_sx = UCVTF | SixtyFourBits,
-  UCVTF_dw = UCVTF | FP64,
-  UCVTF_dx = UCVTF | SixtyFourBits | FP64,
-  FCVTAS = FPIntegerConvertFixed | 0x00040000,
-  FCVTAS_ws = FCVTAS,
-  FCVTAS_xs = FCVTAS | SixtyFourBits,
-  FCVTAS_wd = FCVTAS | FP64,
-  FCVTAS_xd = FCVTAS | SixtyFourBits | FP64,
-  FCVTAU = FPIntegerConvertFixed | 0x00050000,
-  FCVTAU_ws = FCVTAU,
-  FCVTAU_xs = FCVTAU | SixtyFourBits,
-  FCVTAU_wd = FCVTAU | FP64,
-  FCVTAU_xd = FCVTAU | SixtyFourBits | FP64,
-  FMOV_ws = FPIntegerConvertFixed | 0x00060000,
-  FMOV_sw = FPIntegerConvertFixed | 0x00070000,
-  FMOV_xd = FMOV_ws | SixtyFourBits | FP64,
-  FMOV_dx = FMOV_sw | SixtyFourBits | FP64,
-  FMOV_d1_x = FPIntegerConvertFixed | SixtyFourBits | 0x008F0000,
-  FMOV_x_d1 = FPIntegerConvertFixed | SixtyFourBits | 0x008E0000
-};
-
-// Conversion between fixed point and floating point.
-enum FPFixedPointConvertOp {
-  FPFixedPointConvertFixed = 0x1E000000,
-  FPFixedPointConvertFMask = 0x5F200000,
-  FPFixedPointConvertMask  = 0xFFFF0000,
-  FCVTZS_fixed    = FPFixedPointConvertFixed | 0x00180000,
-  FCVTZS_ws_fixed = FCVTZS_fixed,
-  FCVTZS_xs_fixed = FCVTZS_fixed | SixtyFourBits,
-  FCVTZS_wd_fixed = FCVTZS_fixed | FP64,
-  FCVTZS_xd_fixed = FCVTZS_fixed | SixtyFourBits | FP64,
-  FCVTZU_fixed    = FPFixedPointConvertFixed | 0x00190000,
-  FCVTZU_ws_fixed = FCVTZU_fixed,
-  FCVTZU_xs_fixed = FCVTZU_fixed | SixtyFourBits,
-  FCVTZU_wd_fixed = FCVTZU_fixed | FP64,
-  FCVTZU_xd_fixed = FCVTZU_fixed | SixtyFourBits | FP64,
-  SCVTF_fixed     = FPFixedPointConvertFixed | 0x00020000,
-  SCVTF_sw_fixed  = SCVTF_fixed,
-  SCVTF_sx_fixed  = SCVTF_fixed | SixtyFourBits,
-  SCVTF_dw_fixed  = SCVTF_fixed | FP64,
-  SCVTF_dx_fixed  = SCVTF_fixed | SixtyFourBits | FP64,
-  UCVTF_fixed     = FPFixedPointConvertFixed | 0x00030000,
-  UCVTF_sw_fixed  = UCVTF_fixed,
-  UCVTF_sx_fixed  = UCVTF_fixed | SixtyFourBits,
-  UCVTF_dw_fixed  = UCVTF_fixed | FP64,
-  UCVTF_dx_fixed  = UCVTF_fixed | SixtyFourBits | FP64
-};
-
-// NEON instructions with two register operands.
-enum NEON2RegMiscOp {
-  NEON2RegMiscFixed = 0x0E200800,
-  NEON2RegMiscFMask = 0x9F3E0C00,
-  NEON2RegMiscMask = 0xBF3FFC00,
-  NEON2RegMiscUBit = 0x20000000,
-  NEON_REV64 = NEON2RegMiscFixed | 0x00000000,
-  NEON_REV32 = NEON2RegMiscFixed | 0x20000000,
-  NEON_REV16 = NEON2RegMiscFixed | 0x00001000,
-  NEON_SADDLP = NEON2RegMiscFixed | 0x00002000,
-  NEON_UADDLP = NEON_SADDLP | NEON2RegMiscUBit,
-  NEON_SUQADD = NEON2RegMiscFixed | 0x00003000,
-  NEON_USQADD = NEON_SUQADD | NEON2RegMiscUBit,
-  NEON_CLS = NEON2RegMiscFixed | 0x00004000,
-  NEON_CLZ = NEON2RegMiscFixed | 0x20004000,
-  NEON_CNT = NEON2RegMiscFixed | 0x00005000,
-  NEON_RBIT_NOT = NEON2RegMiscFixed | 0x20005000,
-  NEON_SADALP = NEON2RegMiscFixed | 0x00006000,
-  NEON_UADALP = NEON_SADALP | NEON2RegMiscUBit,
-  NEON_SQABS = NEON2RegMiscFixed | 0x00007000,
-  NEON_SQNEG = NEON2RegMiscFixed | 0x20007000,
-  NEON_CMGT_zero = NEON2RegMiscFixed | 0x00008000,
-  NEON_CMGE_zero = NEON2RegMiscFixed | 0x20008000,
-  NEON_CMEQ_zero = NEON2RegMiscFixed | 0x00009000,
-  NEON_CMLE_zero = NEON2RegMiscFixed | 0x20009000,
-  NEON_CMLT_zero = NEON2RegMiscFixed | 0x0000A000,
-  NEON_ABS = NEON2RegMiscFixed | 0x0000B000,
-  NEON_NEG = NEON2RegMiscFixed | 0x2000B000,
-  NEON_XTN = NEON2RegMiscFixed | 0x00012000,
-  NEON_SQXTUN = NEON2RegMiscFixed | 0x20012000,
-  NEON_SHLL = NEON2RegMiscFixed | 0x20013000,
-  NEON_SQXTN = NEON2RegMiscFixed | 0x00014000,
-  NEON_UQXTN = NEON_SQXTN | NEON2RegMiscUBit,
-
-  NEON2RegMiscOpcode = 0x0001F000,
-  NEON_RBIT_NOT_opcode = NEON_RBIT_NOT & NEON2RegMiscOpcode,
-  NEON_NEG_opcode = NEON_NEG & NEON2RegMiscOpcode,
-  NEON_XTN_opcode = NEON_XTN & NEON2RegMiscOpcode,
-  NEON_UQXTN_opcode = NEON_UQXTN & NEON2RegMiscOpcode,
-
-  // These instructions use only one bit of the size field. The other bit is
-  // used to distinguish between instructions.
-  NEON2RegMiscFPMask = NEON2RegMiscMask | 0x00800000,
-  NEON_FABS = NEON2RegMiscFixed | 0x0080F000,
-  NEON_FNEG = NEON2RegMiscFixed | 0x2080F000,
-  NEON_FCVTN = NEON2RegMiscFixed | 0x00016000,
-  NEON_FCVTXN = NEON2RegMiscFixed | 0x20016000,
-  NEON_FCVTL = NEON2RegMiscFixed | 0x00017000,
-  NEON_FRINTN = NEON2RegMiscFixed | 0x00018000,
-  NEON_FRINTA = NEON2RegMiscFixed | 0x20018000,
-  NEON_FRINTP = NEON2RegMiscFixed | 0x00818000,
-  NEON_FRINTM = NEON2RegMiscFixed | 0x00019000,
-  NEON_FRINTX = NEON2RegMiscFixed | 0x20019000,
-  NEON_FRINTZ = NEON2RegMiscFixed | 0x00819000,
-  NEON_FRINTI = NEON2RegMiscFixed | 0x20819000,
-  NEON_FCVTNS = NEON2RegMiscFixed | 0x0001A000,
-  NEON_FCVTNU = NEON_FCVTNS | NEON2RegMiscUBit,
-  NEON_FCVTPS = NEON2RegMiscFixed | 0x0081A000,
-  NEON_FCVTPU = NEON_FCVTPS | NEON2RegMiscUBit,
-  NEON_FCVTMS = NEON2RegMiscFixed | 0x0001B000,
-  NEON_FCVTMU = NEON_FCVTMS | NEON2RegMiscUBit,
-  NEON_FCVTZS = NEON2RegMiscFixed | 0x0081B000,
-  NEON_FCVTZU = NEON_FCVTZS | NEON2RegMiscUBit,
-  NEON_FCVTAS = NEON2RegMiscFixed | 0x0001C000,
-  NEON_FCVTAU = NEON_FCVTAS | NEON2RegMiscUBit,
-  NEON_FSQRT = NEON2RegMiscFixed | 0x2081F000,
-  NEON_SCVTF = NEON2RegMiscFixed | 0x0001D000,
-  NEON_UCVTF = NEON_SCVTF | NEON2RegMiscUBit,
-  NEON_URSQRTE = NEON2RegMiscFixed | 0x2081C000,
-  NEON_URECPE = NEON2RegMiscFixed | 0x0081C000,
-  NEON_FRSQRTE = NEON2RegMiscFixed | 0x2081D000,
-  NEON_FRECPE = NEON2RegMiscFixed | 0x0081D000,
-  NEON_FCMGT_zero = NEON2RegMiscFixed | 0x0080C000,
-  NEON_FCMGE_zero = NEON2RegMiscFixed | 0x2080C000,
-  NEON_FCMEQ_zero = NEON2RegMiscFixed | 0x0080D000,
-  NEON_FCMLE_zero = NEON2RegMiscFixed | 0x2080D000,
-  NEON_FCMLT_zero = NEON2RegMiscFixed | 0x0080E000,
-
-  NEON_FCVTL_opcode = NEON_FCVTL & NEON2RegMiscOpcode,
-  NEON_FCVTN_opcode = NEON_FCVTN & NEON2RegMiscOpcode
-};
-
-// NEON instructions with three same-type operands.
-enum NEON3SameOp {
-  NEON3SameFixed = 0x0E200400,
-  NEON3SameFMask = 0x9F200400,
-  NEON3SameMask = 0xBF20FC00,
-  NEON3SameUBit = 0x20000000,
-  NEON_ADD = NEON3SameFixed | 0x00008000,
-  NEON_ADDP = NEON3SameFixed | 0x0000B800,
-  NEON_SHADD = NEON3SameFixed | 0x00000000,
-  NEON_SHSUB = NEON3SameFixed | 0x00002000,
-  NEON_SRHADD = NEON3SameFixed | 0x00001000,
-  NEON_CMEQ = NEON3SameFixed | NEON3SameUBit | 0x00008800,
-  NEON_CMGE = NEON3SameFixed | 0x00003800,
-  NEON_CMGT = NEON3SameFixed | 0x00003000,
-  NEON_CMHI = NEON3SameFixed | NEON3SameUBit | NEON_CMGT,
-  NEON_CMHS = NEON3SameFixed | NEON3SameUBit | NEON_CMGE,
-  NEON_CMTST = NEON3SameFixed | 0x00008800,
-  NEON_MLA = NEON3SameFixed | 0x00009000,
-  NEON_MLS = NEON3SameFixed | 0x20009000,
-  NEON_MUL = NEON3SameFixed | 0x00009800,
-  NEON_PMUL = NEON3SameFixed | 0x20009800,
-  NEON_SRSHL = NEON3SameFixed | 0x00005000,
-  NEON_SQSHL = NEON3SameFixed | 0x00004800,
-  NEON_SQRSHL = NEON3SameFixed | 0x00005800,
-  NEON_SSHL = NEON3SameFixed | 0x00004000,
-  NEON_SMAX = NEON3SameFixed | 0x00006000,
-  NEON_SMAXP = NEON3SameFixed | 0x0000A000,
-  NEON_SMIN = NEON3SameFixed | 0x00006800,
-  NEON_SMINP = NEON3SameFixed | 0x0000A800,
-  NEON_SABD = NEON3SameFixed | 0x00007000,
-  NEON_SABA = NEON3SameFixed | 0x00007800,
-  NEON_UABD = NEON3SameFixed | NEON3SameUBit | NEON_SABD,
-  NEON_UABA = NEON3SameFixed | NEON3SameUBit | NEON_SABA,
-  NEON_SQADD = NEON3SameFixed | 0x00000800,
-  NEON_SQSUB = NEON3SameFixed | 0x00002800,
-  NEON_SUB = NEON3SameFixed | NEON3SameUBit | 0x00008000,
-  NEON_UHADD = NEON3SameFixed | NEON3SameUBit | NEON_SHADD,
-  NEON_UHSUB = NEON3SameFixed | NEON3SameUBit | NEON_SHSUB,
-  NEON_URHADD = NEON3SameFixed | NEON3SameUBit | NEON_SRHADD,
-  NEON_UMAX = NEON3SameFixed | NEON3SameUBit | NEON_SMAX,
-  NEON_UMAXP = NEON3SameFixed | NEON3SameUBit | NEON_SMAXP,
-  NEON_UMIN = NEON3SameFixed | NEON3SameUBit | NEON_SMIN,
-  NEON_UMINP = NEON3SameFixed | NEON3SameUBit | NEON_SMINP,
-  NEON_URSHL = NEON3SameFixed | NEON3SameUBit | NEON_SRSHL,
-  NEON_UQADD = NEON3SameFixed | NEON3SameUBit | NEON_SQADD,
-  NEON_UQRSHL = NEON3SameFixed | NEON3SameUBit | NEON_SQRSHL,
-  NEON_UQSHL = NEON3SameFixed | NEON3SameUBit | NEON_SQSHL,
-  NEON_UQSUB = NEON3SameFixed | NEON3SameUBit | NEON_SQSUB,
-  NEON_USHL = NEON3SameFixed | NEON3SameUBit | NEON_SSHL,
-  NEON_SQDMULH = NEON3SameFixed | 0x0000B000,
-  NEON_SQRDMULH = NEON3SameFixed | 0x2000B000,
-
-  // NEON floating point instructions with three same-type operands.
-  NEON3SameFPFixed = NEON3SameFixed | 0x0000C000,
-  NEON3SameFPFMask = NEON3SameFMask | 0x0000C000,
-  NEON3SameFPMask = NEON3SameMask | 0x00800000,
-  NEON_FADD = NEON3SameFixed | 0x0000D000,
-  NEON_FSUB = NEON3SameFixed | 0x0080D000,
-  NEON_FMUL = NEON3SameFixed | 0x2000D800,
-  NEON_FDIV = NEON3SameFixed | 0x2000F800,
-  NEON_FMAX = NEON3SameFixed | 0x0000F000,
-  NEON_FMAXNM = NEON3SameFixed | 0x0000C000,
-  NEON_FMAXP = NEON3SameFixed | 0x2000F000,
-  NEON_FMAXNMP = NEON3SameFixed | 0x2000C000,
-  NEON_FMIN = NEON3SameFixed | 0x0080F000,
-  NEON_FMINNM = NEON3SameFixed | 0x0080C000,
-  NEON_FMINP = NEON3SameFixed | 0x2080F000,
-  NEON_FMINNMP = NEON3SameFixed | 0x2080C000,
-  NEON_FMLA = NEON3SameFixed | 0x0000C800,
-  NEON_FMLS = NEON3SameFixed | 0x0080C800,
-  NEON_FMULX = NEON3SameFixed | 0x0000D800,
-  NEON_FRECPS = NEON3SameFixed | 0x0000F800,
-  NEON_FRSQRTS = NEON3SameFixed | 0x0080F800,
-  NEON_FABD = NEON3SameFixed | 0x2080D000,
-  NEON_FADDP = NEON3SameFixed | 0x2000D000,
-  NEON_FCMEQ = NEON3SameFixed | 0x0000E000,
-  NEON_FCMGE = NEON3SameFixed | 0x2000E000,
-  NEON_FCMGT = NEON3SameFixed | 0x2080E000,
-  NEON_FACGE = NEON3SameFixed | 0x2000E800,
-  NEON_FACGT = NEON3SameFixed | 0x2080E800,
-
-  // NEON logical instructions with three same-type operands.
-  NEON3SameLogicalFixed = NEON3SameFixed | 0x00001800,
-  NEON3SameLogicalFMask = NEON3SameFMask | 0x0000F800,
-  NEON3SameLogicalMask = 0xBFE0FC00,
-  NEON3SameLogicalFormatMask = NEON_Q,
-  NEON_AND = NEON3SameLogicalFixed | 0x00000000,
-  NEON_ORR = NEON3SameLogicalFixed | 0x00A00000,
-  NEON_ORN = NEON3SameLogicalFixed | 0x00C00000,
-  NEON_EOR = NEON3SameLogicalFixed | 0x20000000,
-  NEON_BIC = NEON3SameLogicalFixed | 0x00400000,
-  NEON_BIF = NEON3SameLogicalFixed | 0x20C00000,
-  NEON_BIT = NEON3SameLogicalFixed | 0x20800000,
-  NEON_BSL = NEON3SameLogicalFixed | 0x20400000
-};
-
-// NEON instructions with three different-type operands.
-enum NEON3DifferentOp {
-  NEON3DifferentFixed = 0x0E200000,
-  NEON3DifferentFMask = 0x9F200C00,
-  NEON3DifferentMask = 0xFF20FC00,
-  NEON_ADDHN = NEON3DifferentFixed | 0x00004000,
-  NEON_ADDHN2 = NEON_ADDHN | NEON_Q,
-  NEON_PMULL = NEON3DifferentFixed | 0x0000E000,
-  NEON_PMULL2 = NEON_PMULL | NEON_Q,
-  NEON_RADDHN = NEON3DifferentFixed | 0x20004000,
-  NEON_RADDHN2 = NEON_RADDHN | NEON_Q,
-  NEON_RSUBHN = NEON3DifferentFixed | 0x20006000,
-  NEON_RSUBHN2 = NEON_RSUBHN | NEON_Q,
-  NEON_SABAL = NEON3DifferentFixed | 0x00005000,
-  NEON_SABAL2 = NEON_SABAL | NEON_Q,
-  NEON_SABDL = NEON3DifferentFixed | 0x00007000,
-  NEON_SABDL2 = NEON_SABDL | NEON_Q,
-  NEON_SADDL = NEON3DifferentFixed | 0x00000000,
-  NEON_SADDL2 = NEON_SADDL | NEON_Q,
-  NEON_SADDW = NEON3DifferentFixed | 0x00001000,
-  NEON_SADDW2 = NEON_SADDW | NEON_Q,
-  NEON_SMLAL = NEON3DifferentFixed | 0x00008000,
-  NEON_SMLAL2 = NEON_SMLAL | NEON_Q,
-  NEON_SMLSL = NEON3DifferentFixed | 0x0000A000,
-  NEON_SMLSL2 = NEON_SMLSL | NEON_Q,
-  NEON_SMULL = NEON3DifferentFixed | 0x0000C000,
-  NEON_SMULL2 = NEON_SMULL | NEON_Q,
-  NEON_SSUBL = NEON3DifferentFixed | 0x00002000,
-  NEON_SSUBL2 = NEON_SSUBL | NEON_Q,
-  NEON_SSUBW = NEON3DifferentFixed | 0x00003000,
-  NEON_SSUBW2 = NEON_SSUBW | NEON_Q,
-  NEON_SQDMLAL = NEON3DifferentFixed | 0x00009000,
-  NEON_SQDMLAL2 = NEON_SQDMLAL | NEON_Q,
-  NEON_SQDMLSL = NEON3DifferentFixed | 0x0000B000,
-  NEON_SQDMLSL2 = NEON_SQDMLSL | NEON_Q,
-  NEON_SQDMULL = NEON3DifferentFixed | 0x0000D000,
-  NEON_SQDMULL2 = NEON_SQDMULL | NEON_Q,
-  NEON_SUBHN = NEON3DifferentFixed | 0x00006000,
-  NEON_SUBHN2 = NEON_SUBHN | NEON_Q,
-  NEON_UABAL = NEON_SABAL | NEON3SameUBit,
-  NEON_UABAL2 = NEON_UABAL | NEON_Q,
-  NEON_UABDL = NEON_SABDL | NEON3SameUBit,
-  NEON_UABDL2 = NEON_UABDL | NEON_Q,
-  NEON_UADDL = NEON_SADDL | NEON3SameUBit,
-  NEON_UADDL2 = NEON_UADDL | NEON_Q,
-  NEON_UADDW = NEON_SADDW | NEON3SameUBit,
-  NEON_UADDW2 = NEON_UADDW | NEON_Q,
-  NEON_UMLAL = NEON_SMLAL | NEON3SameUBit,
-  NEON_UMLAL2 = NEON_UMLAL | NEON_Q,
-  NEON_UMLSL = NEON_SMLSL | NEON3SameUBit,
-  NEON_UMLSL2 = NEON_UMLSL | NEON_Q,
-  NEON_UMULL = NEON_SMULL | NEON3SameUBit,
-  NEON_UMULL2 = NEON_UMULL | NEON_Q,
-  NEON_USUBL = NEON_SSUBL | NEON3SameUBit,
-  NEON_USUBL2 = NEON_USUBL | NEON_Q,
-  NEON_USUBW = NEON_SSUBW | NEON3SameUBit,
-  NEON_USUBW2 = NEON_USUBW | NEON_Q
-};
-
-// NEON instructions operating across vectors.
-enum NEONAcrossLanesOp {
-  NEONAcrossLanesFixed = 0x0E300800,
-  NEONAcrossLanesFMask = 0x9F3E0C00,
-  NEONAcrossLanesMask = 0xBF3FFC00,
-  NEON_ADDV = NEONAcrossLanesFixed | 0x0001B000,
-  NEON_SADDLV = NEONAcrossLanesFixed | 0x00003000,
-  NEON_UADDLV = NEONAcrossLanesFixed | 0x20003000,
-  NEON_SMAXV = NEONAcrossLanesFixed | 0x0000A000,
-  NEON_SMINV = NEONAcrossLanesFixed | 0x0001A000,
-  NEON_UMAXV = NEONAcrossLanesFixed | 0x2000A000,
-  NEON_UMINV = NEONAcrossLanesFixed | 0x2001A000,
-
-  // NEON floating point across instructions.
-  NEONAcrossLanesFPFixed = NEONAcrossLanesFixed | 0x0000C000,
-  NEONAcrossLanesFPFMask = NEONAcrossLanesFMask | 0x0000C000,
-  NEONAcrossLanesFPMask = NEONAcrossLanesMask | 0x00800000,
-
-  NEON_FMAXV = NEONAcrossLanesFPFixed | 0x2000F000,
-  NEON_FMINV = NEONAcrossLanesFPFixed | 0x2080F000,
-  NEON_FMAXNMV = NEONAcrossLanesFPFixed | 0x2000C000,
-  NEON_FMINNMV = NEONAcrossLanesFPFixed | 0x2080C000
-};
-
-// NEON instructions with indexed element operand.
-enum NEONByIndexedElementOp {
-  NEONByIndexedElementFixed = 0x0F000000,
-  NEONByIndexedElementFMask = 0x9F000400,
-  NEONByIndexedElementMask = 0xBF00F400,
-  NEON_MUL_byelement = NEONByIndexedElementFixed | 0x00008000,
-  NEON_MLA_byelement = NEONByIndexedElementFixed | 0x20000000,
-  NEON_MLS_byelement = NEONByIndexedElementFixed | 0x20004000,
-  NEON_SMULL_byelement = NEONByIndexedElementFixed | 0x0000A000,
-  NEON_SMLAL_byelement = NEONByIndexedElementFixed | 0x00002000,
-  NEON_SMLSL_byelement = NEONByIndexedElementFixed | 0x00006000,
-  NEON_UMULL_byelement = NEONByIndexedElementFixed | 0x2000A000,
-  NEON_UMLAL_byelement = NEONByIndexedElementFixed | 0x20002000,
-  NEON_UMLSL_byelement = NEONByIndexedElementFixed | 0x20006000,
-  NEON_SQDMULL_byelement = NEONByIndexedElementFixed | 0x0000B000,
-  NEON_SQDMLAL_byelement = NEONByIndexedElementFixed | 0x00003000,
-  NEON_SQDMLSL_byelement = NEONByIndexedElementFixed | 0x00007000,
-  NEON_SQDMULH_byelement = NEONByIndexedElementFixed | 0x0000C000,
-  NEON_SQRDMULH_byelement = NEONByIndexedElementFixed | 0x0000D000,
-
-  // Floating point instructions.
-  NEONByIndexedElementFPFixed = NEONByIndexedElementFixed | 0x00800000,
-  NEONByIndexedElementFPMask = NEONByIndexedElementMask | 0x00800000,
-  NEON_FMLA_byelement = NEONByIndexedElementFPFixed | 0x00001000,
-  NEON_FMLS_byelement = NEONByIndexedElementFPFixed | 0x00005000,
-  NEON_FMUL_byelement = NEONByIndexedElementFPFixed | 0x00009000,
-  NEON_FMULX_byelement = NEONByIndexedElementFPFixed | 0x20009000
-};
-
-// NEON modified immediate.
-enum NEONModifiedImmediateOp {
-  NEONModifiedImmediateFixed = 0x0F000400,
-  NEONModifiedImmediateFMask = 0x9FF80400,
-  NEONModifiedImmediateOpBit = 0x20000000,
-  NEONModifiedImmediate_MOVI = NEONModifiedImmediateFixed | 0x00000000,
-  NEONModifiedImmediate_MVNI = NEONModifiedImmediateFixed | 0x20000000,
-  NEONModifiedImmediate_ORR = NEONModifiedImmediateFixed | 0x00001000,
-  NEONModifiedImmediate_BIC = NEONModifiedImmediateFixed | 0x20001000
-};
-
-// NEON extract.
-enum NEONExtractOp {
-  NEONExtractFixed = 0x2E000000,
-  NEONExtractFMask = 0xBF208400,
-  NEONExtractMask = 0xBFE08400,
-  NEON_EXT = NEONExtractFixed | 0x00000000
-};
-
-enum NEONLoadStoreMultiOp {
-  NEONLoadStoreMultiL = 0x00400000,
-  NEONLoadStoreMulti1_1v = 0x00007000,
-  NEONLoadStoreMulti1_2v = 0x0000A000,
-  NEONLoadStoreMulti1_3v = 0x00006000,
-  NEONLoadStoreMulti1_4v = 0x00002000,
-  NEONLoadStoreMulti2 = 0x00008000,
-  NEONLoadStoreMulti3 = 0x00004000,
-  NEONLoadStoreMulti4 = 0x00000000
-};
-
-// NEON load/store multiple structures.
-enum NEONLoadStoreMultiStructOp {
-  NEONLoadStoreMultiStructFixed = 0x0C000000,
-  NEONLoadStoreMultiStructFMask = 0xBFBF0000,
-  NEONLoadStoreMultiStructMask = 0xBFFFF000,
-  NEONLoadStoreMultiStructStore = NEONLoadStoreMultiStructFixed,
-  NEONLoadStoreMultiStructLoad =
-      NEONLoadStoreMultiStructFixed | NEONLoadStoreMultiL,
-  NEON_LD1_1v = NEONLoadStoreMultiStructLoad | NEONLoadStoreMulti1_1v,
-  NEON_LD1_2v = NEONLoadStoreMultiStructLoad | NEONLoadStoreMulti1_2v,
-  NEON_LD1_3v = NEONLoadStoreMultiStructLoad | NEONLoadStoreMulti1_3v,
-  NEON_LD1_4v = NEONLoadStoreMultiStructLoad | NEONLoadStoreMulti1_4v,
-  NEON_LD2 = NEONLoadStoreMultiStructLoad | NEONLoadStoreMulti2,
-  NEON_LD3 = NEONLoadStoreMultiStructLoad | NEONLoadStoreMulti3,
-  NEON_LD4 = NEONLoadStoreMultiStructLoad | NEONLoadStoreMulti4,
-  NEON_ST1_1v = NEONLoadStoreMultiStructStore | NEONLoadStoreMulti1_1v,
-  NEON_ST1_2v = NEONLoadStoreMultiStructStore | NEONLoadStoreMulti1_2v,
-  NEON_ST1_3v = NEONLoadStoreMultiStructStore | NEONLoadStoreMulti1_3v,
-  NEON_ST1_4v = NEONLoadStoreMultiStructStore | NEONLoadStoreMulti1_4v,
-  NEON_ST2 = NEONLoadStoreMultiStructStore | NEONLoadStoreMulti2,
-  NEON_ST3 = NEONLoadStoreMultiStructStore | NEONLoadStoreMulti3,
-  NEON_ST4 = NEONLoadStoreMultiStructStore | NEONLoadStoreMulti4
-};
-
-// NEON load/store multiple structures with post-index addressing.
-enum NEONLoadStoreMultiStructPostIndexOp {
-  NEONLoadStoreMultiStructPostIndexFixed = 0x0C800000,
-  NEONLoadStoreMultiStructPostIndexFMask = 0xBFA00000,
-  NEONLoadStoreMultiStructPostIndexMask = 0xBFE0F000,
-  NEONLoadStoreMultiStructPostIndex = 0x00800000,
-  NEON_LD1_1v_post = NEON_LD1_1v | NEONLoadStoreMultiStructPostIndex,
-  NEON_LD1_2v_post = NEON_LD1_2v | NEONLoadStoreMultiStructPostIndex,
-  NEON_LD1_3v_post = NEON_LD1_3v | NEONLoadStoreMultiStructPostIndex,
-  NEON_LD1_4v_post = NEON_LD1_4v | NEONLoadStoreMultiStructPostIndex,
-  NEON_LD2_post = NEON_LD2 | NEONLoadStoreMultiStructPostIndex,
-  NEON_LD3_post = NEON_LD3 | NEONLoadStoreMultiStructPostIndex,
-  NEON_LD4_post = NEON_LD4 | NEONLoadStoreMultiStructPostIndex,
-  NEON_ST1_1v_post = NEON_ST1_1v | NEONLoadStoreMultiStructPostIndex,
-  NEON_ST1_2v_post = NEON_ST1_2v | NEONLoadStoreMultiStructPostIndex,
-  NEON_ST1_3v_post = NEON_ST1_3v | NEONLoadStoreMultiStructPostIndex,
-  NEON_ST1_4v_post = NEON_ST1_4v | NEONLoadStoreMultiStructPostIndex,
-  NEON_ST2_post = NEON_ST2 | NEONLoadStoreMultiStructPostIndex,
-  NEON_ST3_post = NEON_ST3 | NEONLoadStoreMultiStructPostIndex,
-  NEON_ST4_post = NEON_ST4 | NEONLoadStoreMultiStructPostIndex
-};
-
-enum NEONLoadStoreSingleOp {
-  NEONLoadStoreSingle1 = 0x00000000,
-  NEONLoadStoreSingle2 = 0x00200000,
-  NEONLoadStoreSingle3 = 0x00002000,
-  NEONLoadStoreSingle4 = 0x00202000,
-  NEONLoadStoreSingleL = 0x00400000,
-  NEONLoadStoreSingle_b = 0x00000000,
-  NEONLoadStoreSingle_h = 0x00004000,
-  NEONLoadStoreSingle_s = 0x00008000,
-  NEONLoadStoreSingle_d = 0x00008400,
-  NEONLoadStoreSingleAllLanes = 0x0000C000,
-  NEONLoadStoreSingleLenMask = 0x00202000
-};
-
-// NEON load/store single structure.
-enum NEONLoadStoreSingleStructOp {
-  NEONLoadStoreSingleStructFixed = 0x0D000000,
-  NEONLoadStoreSingleStructFMask = 0xBF9F0000,
-  NEONLoadStoreSingleStructMask = 0xBFFFE000,
-  NEONLoadStoreSingleStructStore = NEONLoadStoreSingleStructFixed,
-  NEONLoadStoreSingleStructLoad =
-      NEONLoadStoreSingleStructFixed | NEONLoadStoreSingleL,
-  NEONLoadStoreSingleStructLoad1 =
-      NEONLoadStoreSingle1 | NEONLoadStoreSingleStructLoad,
-  NEONLoadStoreSingleStructLoad2 =
-      NEONLoadStoreSingle2 | NEONLoadStoreSingleStructLoad,
-  NEONLoadStoreSingleStructLoad3 =
-      NEONLoadStoreSingle3 | NEONLoadStoreSingleStructLoad,
-  NEONLoadStoreSingleStructLoad4 =
-      NEONLoadStoreSingle4 | NEONLoadStoreSingleStructLoad,
-  NEONLoadStoreSingleStructStore1 =
-      NEONLoadStoreSingle1 | NEONLoadStoreSingleStructFixed,
-  NEONLoadStoreSingleStructStore2 =
-      NEONLoadStoreSingle2 | NEONLoadStoreSingleStructFixed,
-  NEONLoadStoreSingleStructStore3 =
-      NEONLoadStoreSingle3 | NEONLoadStoreSingleStructFixed,
-  NEONLoadStoreSingleStructStore4 =
-      NEONLoadStoreSingle4 | NEONLoadStoreSingleStructFixed,
-  NEON_LD1_b = NEONLoadStoreSingleStructLoad1 | NEONLoadStoreSingle_b,
-  NEON_LD1_h = NEONLoadStoreSingleStructLoad1 | NEONLoadStoreSingle_h,
-  NEON_LD1_s = NEONLoadStoreSingleStructLoad1 | NEONLoadStoreSingle_s,
-  NEON_LD1_d = NEONLoadStoreSingleStructLoad1 | NEONLoadStoreSingle_d,
-  NEON_LD1R = NEONLoadStoreSingleStructLoad1 | NEONLoadStoreSingleAllLanes,
-  NEON_ST1_b = NEONLoadStoreSingleStructStore1 | NEONLoadStoreSingle_b,
-  NEON_ST1_h = NEONLoadStoreSingleStructStore1 | NEONLoadStoreSingle_h,
-  NEON_ST1_s = NEONLoadStoreSingleStructStore1 | NEONLoadStoreSingle_s,
-  NEON_ST1_d = NEONLoadStoreSingleStructStore1 | NEONLoadStoreSingle_d,
-
-  NEON_LD2_b = NEONLoadStoreSingleStructLoad2 | NEONLoadStoreSingle_b,
-  NEON_LD2_h = NEONLoadStoreSingleStructLoad2 | NEONLoadStoreSingle_h,
-  NEON_LD2_s = NEONLoadStoreSingleStructLoad2 | NEONLoadStoreSingle_s,
-  NEON_LD2_d = NEONLoadStoreSingleStructLoad2 | NEONLoadStoreSingle_d,
-  NEON_LD2R = NEONLoadStoreSingleStructLoad2 | NEONLoadStoreSingleAllLanes,
-  NEON_ST2_b = NEONLoadStoreSingleStructStore2 | NEONLoadStoreSingle_b,
-  NEON_ST2_h = NEONLoadStoreSingleStructStore2 | NEONLoadStoreSingle_h,
-  NEON_ST2_s = NEONLoadStoreSingleStructStore2 | NEONLoadStoreSingle_s,
-  NEON_ST2_d = NEONLoadStoreSingleStructStore2 | NEONLoadStoreSingle_d,
-
-  NEON_LD3_b = NEONLoadStoreSingleStructLoad3 | NEONLoadStoreSingle_b,
-  NEON_LD3_h = NEONLoadStoreSingleStructLoad3 | NEONLoadStoreSingle_h,
-  NEON_LD3_s = NEONLoadStoreSingleStructLoad3 | NEONLoadStoreSingle_s,
-  NEON_LD3_d = NEONLoadStoreSingleStructLoad3 | NEONLoadStoreSingle_d,
-  NEON_LD3R = NEONLoadStoreSingleStructLoad3 | NEONLoadStoreSingleAllLanes,
-  NEON_ST3_b = NEONLoadStoreSingleStructStore3 | NEONLoadStoreSingle_b,
-  NEON_ST3_h = NEONLoadStoreSingleStructStore3 | NEONLoadStoreSingle_h,
-  NEON_ST3_s = NEONLoadStoreSingleStructStore3 | NEONLoadStoreSingle_s,
-  NEON_ST3_d = NEONLoadStoreSingleStructStore3 | NEONLoadStoreSingle_d,
-
-  NEON_LD4_b = NEONLoadStoreSingleStructLoad4 | NEONLoadStoreSingle_b,
-  NEON_LD4_h = NEONLoadStoreSingleStructLoad4 | NEONLoadStoreSingle_h,
-  NEON_LD4_s = NEONLoadStoreSingleStructLoad4 | NEONLoadStoreSingle_s,
-  NEON_LD4_d = NEONLoadStoreSingleStructLoad4 | NEONLoadStoreSingle_d,
-  NEON_LD4R = NEONLoadStoreSingleStructLoad4 | NEONLoadStoreSingleAllLanes,
-  NEON_ST4_b = NEONLoadStoreSingleStructStore4 | NEONLoadStoreSingle_b,
-  NEON_ST4_h = NEONLoadStoreSingleStructStore4 | NEONLoadStoreSingle_h,
-  NEON_ST4_s = NEONLoadStoreSingleStructStore4 | NEONLoadStoreSingle_s,
-  NEON_ST4_d = NEONLoadStoreSingleStructStore4 | NEONLoadStoreSingle_d
-};
-
-// NEON load/store single structure with post-index addressing.
-enum NEONLoadStoreSingleStructPostIndexOp {
-  NEONLoadStoreSingleStructPostIndexFixed = 0x0D800000,
-  NEONLoadStoreSingleStructPostIndexFMask = 0xBF800000,
-  NEONLoadStoreSingleStructPostIndexMask = 0xBFE0E000,
-  NEONLoadStoreSingleStructPostIndex = 0x00800000,
-  NEON_LD1_b_post = NEON_LD1_b | NEONLoadStoreSingleStructPostIndex,
-  NEON_LD1_h_post = NEON_LD1_h | NEONLoadStoreSingleStructPostIndex,
-  NEON_LD1_s_post = NEON_LD1_s | NEONLoadStoreSingleStructPostIndex,
-  NEON_LD1_d_post = NEON_LD1_d | NEONLoadStoreSingleStructPostIndex,
-  NEON_LD1R_post = NEON_LD1R | NEONLoadStoreSingleStructPostIndex,
-  NEON_ST1_b_post = NEON_ST1_b | NEONLoadStoreSingleStructPostIndex,
-  NEON_ST1_h_post = NEON_ST1_h | NEONLoadStoreSingleStructPostIndex,
-  NEON_ST1_s_post = NEON_ST1_s | NEONLoadStoreSingleStructPostIndex,
-  NEON_ST1_d_post = NEON_ST1_d | NEONLoadStoreSingleStructPostIndex,
-
-  NEON_LD2_b_post = NEON_LD2_b | NEONLoadStoreSingleStructPostIndex,
-  NEON_LD2_h_post = NEON_LD2_h | NEONLoadStoreSingleStructPostIndex,
-  NEON_LD2_s_post = NEON_LD2_s | NEONLoadStoreSingleStructPostIndex,
-  NEON_LD2_d_post = NEON_LD2_d | NEONLoadStoreSingleStructPostIndex,
-  NEON_LD2R_post = NEON_LD2R | NEONLoadStoreSingleStructPostIndex,
-  NEON_ST2_b_post = NEON_ST2_b | NEONLoadStoreSingleStructPostIndex,
-  NEON_ST2_h_post = NEON_ST2_h | NEONLoadStoreSingleStructPostIndex,
-  NEON_ST2_s_post = NEON_ST2_s | NEONLoadStoreSingleStructPostIndex,
-  NEON_ST2_d_post = NEON_ST2_d | NEONLoadStoreSingleStructPostIndex,
-
-  NEON_LD3_b_post = NEON_LD3_b | NEONLoadStoreSingleStructPostIndex,
-  NEON_LD3_h_post = NEON_LD3_h | NEONLoadStoreSingleStructPostIndex,
-  NEON_LD3_s_post = NEON_LD3_s | NEONLoadStoreSingleStructPostIndex,
-  NEON_LD3_d_post = NEON_LD3_d | NEONLoadStoreSingleStructPostIndex,
-  NEON_LD3R_post = NEON_LD3R | NEONLoadStoreSingleStructPostIndex,
-  NEON_ST3_b_post = NEON_ST3_b | NEONLoadStoreSingleStructPostIndex,
-  NEON_ST3_h_post = NEON_ST3_h | NEONLoadStoreSingleStructPostIndex,
-  NEON_ST3_s_post = NEON_ST3_s | NEONLoadStoreSingleStructPostIndex,
-  NEON_ST3_d_post = NEON_ST3_d | NEONLoadStoreSingleStructPostIndex,
-
-  NEON_LD4_b_post = NEON_LD4_b | NEONLoadStoreSingleStructPostIndex,
-  NEON_LD4_h_post = NEON_LD4_h | NEONLoadStoreSingleStructPostIndex,
-  NEON_LD4_s_post = NEON_LD4_s | NEONLoadStoreSingleStructPostIndex,
-  NEON_LD4_d_post = NEON_LD4_d | NEONLoadStoreSingleStructPostIndex,
-  NEON_LD4R_post = NEON_LD4R | NEONLoadStoreSingleStructPostIndex,
-  NEON_ST4_b_post = NEON_ST4_b | NEONLoadStoreSingleStructPostIndex,
-  NEON_ST4_h_post = NEON_ST4_h | NEONLoadStoreSingleStructPostIndex,
-  NEON_ST4_s_post = NEON_ST4_s | NEONLoadStoreSingleStructPostIndex,
-  NEON_ST4_d_post = NEON_ST4_d | NEONLoadStoreSingleStructPostIndex
-};
-
-// NEON register copy.
-enum NEONCopyOp {
-  NEONCopyFixed = 0x0E000400,
-  NEONCopyFMask = 0x9FE08400,
-  NEONCopyMask = 0x3FE08400,
-  NEONCopyInsElementMask = NEONCopyMask | 0x40000000,
-  NEONCopyInsGeneralMask = NEONCopyMask | 0x40007800,
-  NEONCopyDupElementMask = NEONCopyMask | 0x20007800,
-  NEONCopyDupGeneralMask = NEONCopyDupElementMask,
-  NEONCopyUmovMask = NEONCopyMask | 0x20007800,
-  NEONCopySmovMask = NEONCopyMask | 0x20007800,
-  NEON_INS_ELEMENT = NEONCopyFixed | 0x60000000,
-  NEON_INS_GENERAL = NEONCopyFixed | 0x40001800,
-  NEON_DUP_ELEMENT = NEONCopyFixed | 0x00000000,
-  NEON_DUP_GENERAL = NEONCopyFixed | 0x00000800,
-  NEON_SMOV = NEONCopyFixed | 0x00002800,
-  NEON_UMOV = NEONCopyFixed | 0x00003800
-};
-
-// NEON scalar instructions with indexed element operand.
-enum NEONScalarByIndexedElementOp {
-  NEONScalarByIndexedElementFixed = 0x5F000000,
-  NEONScalarByIndexedElementFMask = 0xDF000400,
-  NEONScalarByIndexedElementMask = 0xFF00F400,
-  NEON_SQDMLAL_byelement_scalar = NEON_Q | NEONScalar | NEON_SQDMLAL_byelement,
-  NEON_SQDMLSL_byelement_scalar = NEON_Q | NEONScalar | NEON_SQDMLSL_byelement,
-  NEON_SQDMULL_byelement_scalar = NEON_Q | NEONScalar | NEON_SQDMULL_byelement,
-  NEON_SQDMULH_byelement_scalar = NEON_Q | NEONScalar | NEON_SQDMULH_byelement,
-  NEON_SQRDMULH_byelement_scalar =
-      NEON_Q | NEONScalar | NEON_SQRDMULH_byelement,
-
-  // Floating point instructions.
-  NEONScalarByIndexedElementFPFixed =
-      NEONScalarByIndexedElementFixed | 0x00800000,
-  NEONScalarByIndexedElementFPMask =
-      NEONScalarByIndexedElementMask | 0x00800000,
-  NEON_FMLA_byelement_scalar = NEON_Q | NEONScalar | NEON_FMLA_byelement,
-  NEON_FMLS_byelement_scalar = NEON_Q | NEONScalar | NEON_FMLS_byelement,
-  NEON_FMUL_byelement_scalar = NEON_Q | NEONScalar | NEON_FMUL_byelement,
-  NEON_FMULX_byelement_scalar = NEON_Q | NEONScalar | NEON_FMULX_byelement
-};
-
-// NEON shift immediate.
-enum NEONShiftImmediateOp {
-  NEONShiftImmediateFixed = 0x0F000400,
-  NEONShiftImmediateFMask = 0x9F800400,
-  NEONShiftImmediateMask = 0xBF80FC00,
-  NEONShiftImmediateUBit = 0x20000000,
-  NEON_SHL = NEONShiftImmediateFixed | 0x00005000,
-  NEON_SSHLL = NEONShiftImmediateFixed | 0x0000A000,
-  NEON_USHLL = NEONShiftImmediateFixed | 0x2000A000,
-  NEON_SLI = NEONShiftImmediateFixed | 0x20005000,
-  NEON_SRI = NEONShiftImmediateFixed | 0x20004000,
-  NEON_SHRN = NEONShiftImmediateFixed | 0x00008000,
-  NEON_RSHRN = NEONShiftImmediateFixed | 0x00008800,
-  NEON_UQSHRN = NEONShiftImmediateFixed | 0x20009000,
-  NEON_UQRSHRN = NEONShiftImmediateFixed | 0x20009800,
-  NEON_SQSHRN = NEONShiftImmediateFixed | 0x00009000,
-  NEON_SQRSHRN = NEONShiftImmediateFixed | 0x00009800,
-  NEON_SQSHRUN = NEONShiftImmediateFixed | 0x20008000,
-  NEON_SQRSHRUN = NEONShiftImmediateFixed | 0x20008800,
-  NEON_SSHR = NEONShiftImmediateFixed | 0x00000000,
-  NEON_SRSHR = NEONShiftImmediateFixed | 0x00002000,
-  NEON_USHR = NEONShiftImmediateFixed | 0x20000000,
-  NEON_URSHR = NEONShiftImmediateFixed | 0x20002000,
-  NEON_SSRA = NEONShiftImmediateFixed | 0x00001000,
-  NEON_SRSRA = NEONShiftImmediateFixed | 0x00003000,
-  NEON_USRA = NEONShiftImmediateFixed | 0x20001000,
-  NEON_URSRA = NEONShiftImmediateFixed | 0x20003000,
-  NEON_SQSHLU = NEONShiftImmediateFixed | 0x20006000,
-  NEON_SCVTF_imm = NEONShiftImmediateFixed | 0x0000E000,
-  NEON_UCVTF_imm = NEONShiftImmediateFixed | 0x2000E000,
-  NEON_FCVTZS_imm = NEONShiftImmediateFixed | 0x0000F800,
-  NEON_FCVTZU_imm = NEONShiftImmediateFixed | 0x2000F800,
-  NEON_SQSHL_imm = NEONShiftImmediateFixed | 0x00007000,
-  NEON_UQSHL_imm = NEONShiftImmediateFixed | 0x20007000
-};
-
-// NEON scalar register copy.
-enum NEONScalarCopyOp {
-  NEONScalarCopyFixed = 0x5E000400,
-  NEONScalarCopyFMask = 0xDFE08400,
-  NEONScalarCopyMask = 0xFFE0FC00,
-  NEON_DUP_ELEMENT_scalar = NEON_Q | NEONScalar | NEON_DUP_ELEMENT
-};
-
-// NEON scalar pairwise instructions.
-enum NEONScalarPairwiseOp {
-  NEONScalarPairwiseFixed = 0x5E300800,
-  NEONScalarPairwiseFMask = 0xDF3E0C00,
-  NEONScalarPairwiseMask = 0xFFB1F800,
-  NEON_ADDP_scalar = NEONScalarPairwiseFixed | 0x0081B000,
-  NEON_FMAXNMP_scalar = NEONScalarPairwiseFixed | 0x2000C000,
-  NEON_FMINNMP_scalar = NEONScalarPairwiseFixed | 0x2080C000,
-  NEON_FADDP_scalar = NEONScalarPairwiseFixed | 0x2000D000,
-  NEON_FMAXP_scalar = NEONScalarPairwiseFixed | 0x2000F000,
-  NEON_FMINP_scalar = NEONScalarPairwiseFixed | 0x2080F000
-};
-
-// NEON scalar shift immediate.
-enum NEONScalarShiftImmediateOp {
-  NEONScalarShiftImmediateFixed = 0x5F000400,
-  NEONScalarShiftImmediateFMask = 0xDF800400,
-  NEONScalarShiftImmediateMask = 0xFF80FC00,
-  NEON_SHL_scalar = NEON_Q | NEONScalar | NEON_SHL,
-  NEON_SLI_scalar = NEON_Q | NEONScalar | NEON_SLI,
-  NEON_SRI_scalar = NEON_Q | NEONScalar | NEON_SRI,
-  NEON_SSHR_scalar = NEON_Q | NEONScalar | NEON_SSHR,
-  NEON_USHR_scalar = NEON_Q | NEONScalar | NEON_USHR,
-  NEON_SRSHR_scalar = NEON_Q | NEONScalar | NEON_SRSHR,
-  NEON_URSHR_scalar = NEON_Q | NEONScalar | NEON_URSHR,
-  NEON_SSRA_scalar = NEON_Q | NEONScalar | NEON_SSRA,
-  NEON_USRA_scalar = NEON_Q | NEONScalar | NEON_USRA,
-  NEON_SRSRA_scalar = NEON_Q | NEONScalar | NEON_SRSRA,
-  NEON_URSRA_scalar = NEON_Q | NEONScalar | NEON_URSRA,
-  NEON_UQSHRN_scalar = NEON_Q | NEONScalar | NEON_UQSHRN,
-  NEON_UQRSHRN_scalar = NEON_Q | NEONScalar | NEON_UQRSHRN,
-  NEON_SQSHRN_scalar = NEON_Q | NEONScalar | NEON_SQSHRN,
-  NEON_SQRSHRN_scalar = NEON_Q | NEONScalar | NEON_SQRSHRN,
-  NEON_SQSHRUN_scalar = NEON_Q | NEONScalar | NEON_SQSHRUN,
-  NEON_SQRSHRUN_scalar = NEON_Q | NEONScalar | NEON_SQRSHRUN,
-  NEON_SQSHLU_scalar = NEON_Q | NEONScalar | NEON_SQSHLU,
-  NEON_SQSHL_imm_scalar = NEON_Q | NEONScalar | NEON_SQSHL_imm,
-  NEON_UQSHL_imm_scalar = NEON_Q | NEONScalar | NEON_UQSHL_imm,
-  NEON_SCVTF_imm_scalar = NEON_Q | NEONScalar | NEON_SCVTF_imm,
-  NEON_UCVTF_imm_scalar = NEON_Q | NEONScalar | NEON_UCVTF_imm,
-  NEON_FCVTZS_imm_scalar = NEON_Q | NEONScalar | NEON_FCVTZS_imm,
-  NEON_FCVTZU_imm_scalar = NEON_Q | NEONScalar | NEON_FCVTZU_imm
-};
-
-// NEON table.
-enum NEONTableOp {
-  NEONTableFixed = 0x0E000000,
-  NEONTableFMask = 0xBF208C00,
-  NEONTableExt = 0x00001000,
-  NEONTableMask = 0xBF20FC00,
-  NEON_TBL_1v = NEONTableFixed | 0x00000000,
-  NEON_TBL_2v = NEONTableFixed | 0x00002000,
-  NEON_TBL_3v = NEONTableFixed | 0x00004000,
-  NEON_TBL_4v = NEONTableFixed | 0x00006000,
-  NEON_TBX_1v = NEON_TBL_1v | NEONTableExt,
-  NEON_TBX_2v = NEON_TBL_2v | NEONTableExt,
-  NEON_TBX_3v = NEON_TBL_3v | NEONTableExt,
-  NEON_TBX_4v = NEON_TBL_4v | NEONTableExt
-};
-
-// NEON perm.
-enum NEONPermOp {
-  NEONPermFixed = 0x0E000800,
-  NEONPermFMask = 0xBF208C00,
-  NEONPermMask = 0x3F20FC00,
-  NEON_UZP1 = NEONPermFixed | 0x00001000,
-  NEON_TRN1 = NEONPermFixed | 0x00002000,
-  NEON_ZIP1 = NEONPermFixed | 0x00003000,
-  NEON_UZP2 = NEONPermFixed | 0x00005000,
-  NEON_TRN2 = NEONPermFixed | 0x00006000,
-  NEON_ZIP2 = NEONPermFixed | 0x00007000
-};
-
-// NEON scalar instructions with two register operands.
-enum NEONScalar2RegMiscOp {
-  NEONScalar2RegMiscFixed = 0x5E200800,
-  NEONScalar2RegMiscFMask = 0xDF3E0C00,
-  NEONScalar2RegMiscMask = NEON_Q | NEONScalar | NEON2RegMiscMask,
-  NEON_CMGT_zero_scalar = NEON_Q | NEONScalar | NEON_CMGT_zero,
-  NEON_CMEQ_zero_scalar = NEON_Q | NEONScalar | NEON_CMEQ_zero,
-  NEON_CMLT_zero_scalar = NEON_Q | NEONScalar | NEON_CMLT_zero,
-  NEON_CMGE_zero_scalar = NEON_Q | NEONScalar | NEON_CMGE_zero,
-  NEON_CMLE_zero_scalar = NEON_Q | NEONScalar | NEON_CMLE_zero,
-  NEON_ABS_scalar = NEON_Q | NEONScalar | NEON_ABS,
-  NEON_SQABS_scalar = NEON_Q | NEONScalar | NEON_SQABS,
-  NEON_NEG_scalar = NEON_Q | NEONScalar | NEON_NEG,
-  NEON_SQNEG_scalar = NEON_Q | NEONScalar | NEON_SQNEG,
-  NEON_SQXTN_scalar = NEON_Q | NEONScalar | NEON_SQXTN,
-  NEON_UQXTN_scalar = NEON_Q | NEONScalar | NEON_UQXTN,
-  NEON_SQXTUN_scalar = NEON_Q | NEONScalar | NEON_SQXTUN,
-  NEON_SUQADD_scalar = NEON_Q | NEONScalar | NEON_SUQADD,
-  NEON_USQADD_scalar = NEON_Q | NEONScalar | NEON_USQADD,
-
-  NEONScalar2RegMiscOpcode = NEON2RegMiscOpcode,
-  NEON_NEG_scalar_opcode = NEON_NEG_scalar & NEONScalar2RegMiscOpcode,
-
-  NEONScalar2RegMiscFPMask = NEONScalar2RegMiscMask | 0x00800000,
-  NEON_FRSQRTE_scalar = NEON_Q | NEONScalar | NEON_FRSQRTE,
-  NEON_FRECPE_scalar = NEON_Q | NEONScalar | NEON_FRECPE,
-  NEON_SCVTF_scalar = NEON_Q | NEONScalar | NEON_SCVTF,
-  NEON_UCVTF_scalar = NEON_Q | NEONScalar | NEON_UCVTF,
-  NEON_FCMGT_zero_scalar = NEON_Q | NEONScalar | NEON_FCMGT_zero,
-  NEON_FCMEQ_zero_scalar = NEON_Q | NEONScalar | NEON_FCMEQ_zero,
-  NEON_FCMLT_zero_scalar = NEON_Q | NEONScalar | NEON_FCMLT_zero,
-  NEON_FCMGE_zero_scalar = NEON_Q | NEONScalar | NEON_FCMGE_zero,
-  NEON_FCMLE_zero_scalar = NEON_Q | NEONScalar | NEON_FCMLE_zero,
-  NEON_FRECPX_scalar = NEONScalar2RegMiscFixed | 0x0081F000,
-  NEON_FCVTNS_scalar = NEON_Q | NEONScalar | NEON_FCVTNS,
-  NEON_FCVTNU_scalar = NEON_Q | NEONScalar | NEON_FCVTNU,
-  NEON_FCVTPS_scalar = NEON_Q | NEONScalar | NEON_FCVTPS,
-  NEON_FCVTPU_scalar = NEON_Q | NEONScalar | NEON_FCVTPU,
-  NEON_FCVTMS_scalar = NEON_Q | NEONScalar | NEON_FCVTMS,
-  NEON_FCVTMU_scalar = NEON_Q | NEONScalar | NEON_FCVTMU,
-  NEON_FCVTZS_scalar = NEON_Q | NEONScalar | NEON_FCVTZS,
-  NEON_FCVTZU_scalar = NEON_Q | NEONScalar | NEON_FCVTZU,
-  NEON_FCVTAS_scalar = NEON_Q | NEONScalar | NEON_FCVTAS,
-  NEON_FCVTAU_scalar = NEON_Q | NEONScalar | NEON_FCVTAU,
-  NEON_FCVTXN_scalar = NEON_Q | NEONScalar | NEON_FCVTXN
-};
-
-// NEON scalar instructions with three same-type operands.
-enum NEONScalar3SameOp {
-  NEONScalar3SameFixed = 0x5E200400,
-  NEONScalar3SameFMask = 0xDF200400,
-  NEONScalar3SameMask = 0xFF20FC00,
-  NEON_ADD_scalar = NEON_Q | NEONScalar | NEON_ADD,
-  NEON_CMEQ_scalar = NEON_Q | NEONScalar | NEON_CMEQ,
-  NEON_CMGE_scalar = NEON_Q | NEONScalar | NEON_CMGE,
-  NEON_CMGT_scalar = NEON_Q | NEONScalar | NEON_CMGT,
-  NEON_CMHI_scalar = NEON_Q | NEONScalar | NEON_CMHI,
-  NEON_CMHS_scalar = NEON_Q | NEONScalar | NEON_CMHS,
-  NEON_CMTST_scalar = NEON_Q | NEONScalar | NEON_CMTST,
-  NEON_SUB_scalar = NEON_Q | NEONScalar | NEON_SUB,
-  NEON_UQADD_scalar = NEON_Q | NEONScalar | NEON_UQADD,
-  NEON_SQADD_scalar = NEON_Q | NEONScalar | NEON_SQADD,
-  NEON_UQSUB_scalar = NEON_Q | NEONScalar | NEON_UQSUB,
-  NEON_SQSUB_scalar = NEON_Q | NEONScalar | NEON_SQSUB,
-  NEON_USHL_scalar = NEON_Q | NEONScalar | NEON_USHL,
-  NEON_SSHL_scalar = NEON_Q | NEONScalar | NEON_SSHL,
-  NEON_UQSHL_scalar = NEON_Q | NEONScalar | NEON_UQSHL,
-  NEON_SQSHL_scalar = NEON_Q | NEONScalar | NEON_SQSHL,
-  NEON_URSHL_scalar = NEON_Q | NEONScalar | NEON_URSHL,
-  NEON_SRSHL_scalar = NEON_Q | NEONScalar | NEON_SRSHL,
-  NEON_UQRSHL_scalar = NEON_Q | NEONScalar | NEON_UQRSHL,
-  NEON_SQRSHL_scalar = NEON_Q | NEONScalar | NEON_SQRSHL,
-  NEON_SQDMULH_scalar = NEON_Q | NEONScalar | NEON_SQDMULH,
-  NEON_SQRDMULH_scalar = NEON_Q | NEONScalar | NEON_SQRDMULH,
-
-  // NEON floating point scalar instructions with three same-type operands.
-  NEONScalar3SameFPFixed = NEONScalar3SameFixed | 0x0000C000,
-  NEONScalar3SameFPFMask = NEONScalar3SameFMask | 0x0000C000,
-  NEONScalar3SameFPMask = NEONScalar3SameMask | 0x00800000,
-  NEON_FACGE_scalar = NEON_Q | NEONScalar | NEON_FACGE,
-  NEON_FACGT_scalar = NEON_Q | NEONScalar | NEON_FACGT,
-  NEON_FCMEQ_scalar = NEON_Q | NEONScalar | NEON_FCMEQ,
-  NEON_FCMGE_scalar = NEON_Q | NEONScalar | NEON_FCMGE,
-  NEON_FCMGT_scalar = NEON_Q | NEONScalar | NEON_FCMGT,
-  NEON_FMULX_scalar = NEON_Q | NEONScalar | NEON_FMULX,
-  NEON_FRECPS_scalar = NEON_Q | NEONScalar | NEON_FRECPS,
-  NEON_FRSQRTS_scalar = NEON_Q | NEONScalar | NEON_FRSQRTS,
-  NEON_FABD_scalar = NEON_Q | NEONScalar | NEON_FABD
-};
-
-// NEON scalar instructions with three different-type operands.
-enum NEONScalar3DiffOp {
-  NEONScalar3DiffFixed = 0x5E200000,
-  NEONScalar3DiffFMask = 0xDF200C00,
-  NEONScalar3DiffMask = NEON_Q | NEONScalar | NEON3DifferentMask,
-  NEON_SQDMLAL_scalar = NEON_Q | NEONScalar | NEON_SQDMLAL,
-  NEON_SQDMLSL_scalar = NEON_Q | NEONScalar | NEON_SQDMLSL,
-  NEON_SQDMULL_scalar = NEON_Q | NEONScalar | NEON_SQDMULL
-};
-
-// Unimplemented and unallocated instructions. These are defined to make fixed
-// bit assertion easier.
-enum UnimplementedOp {
-  UnimplementedFixed = 0x00000000,
-  UnimplementedFMask = 0x00000000
-};
-
-enum UnallocatedOp {
-  UnallocatedFixed = 0x00000000,
-  UnallocatedFMask = 0x00000000
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_ARM64_CONSTANTS_ARM64_H_
diff --git a/src/v8/src/arm64/cpu-arm64.cc b/src/v8/src/arm64/cpu-arm64.cc
deleted file mode 100644
index 26ec06e..0000000
--- a/src/v8/src/arm64/cpu-arm64.cc
+++ /dev/null
@@ -1,116 +0,0 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// CPU specific code for arm independent of OS goes here.
-
-#if V8_TARGET_ARCH_ARM64
-
-#include "src/arm64/utils-arm64.h"
-#include "src/assembler.h"
-
-namespace v8 {
-namespace internal {
-
-class CacheLineSizes {
- public:
-  CacheLineSizes() {
-#ifdef USE_SIMULATOR
-    cache_type_register_ = 0;
-#else
-    // Copy the content of the cache type register to a core register.
-    __asm__ __volatile__("mrs %x[ctr], ctr_el0"  // NOLINT
-                         : [ctr] "=r"(cache_type_register_));
-#endif
-  }
-
-  uint32_t icache_line_size() const { return ExtractCacheLineSize(0); }
-  uint32_t dcache_line_size() const { return ExtractCacheLineSize(16); }
-
- private:
-  uint32_t ExtractCacheLineSize(int cache_line_size_shift) const {
-    // The cache type register holds the size of cache lines in words as a
-    // power of two.
-    return 4 << ((cache_type_register_ >> cache_line_size_shift) & 0xF);
-  }
-
-  uint32_t cache_type_register_;
-};
-
-void CpuFeatures::FlushICache(void* address, size_t length) {
-#ifdef V8_HOST_ARCH_ARM64
-  // The code below assumes user space cache operations are allowed. The goal
-  // of this routine is to make sure the code generated is visible to the I
-  // side of the CPU.
-
-  uintptr_t start = reinterpret_cast<uintptr_t>(address);
-  // Sizes will be used to generate a mask big enough to cover a pointer.
-  CacheLineSizes sizes;
-  uintptr_t dsize = sizes.dcache_line_size();
-  uintptr_t isize = sizes.icache_line_size();
-  // Cache line sizes are always a power of 2.
-  DCHECK_EQ(CountSetBits(dsize, 64), 1);
-  DCHECK_EQ(CountSetBits(isize, 64), 1);
-  uintptr_t dstart = start & ~(dsize - 1);
-  uintptr_t istart = start & ~(isize - 1);
-  uintptr_t end = start + length;
-
-  __asm__ __volatile__ (  // NOLINT
-    // Clean every line of the D cache containing the target data.
-    "0:                                \n\t"
-    // dc       : Data Cache maintenance
-    //    c     : Clean
-    //     i    : Invalidate
-    //      va  : by (Virtual) Address
-    //        c : to the point of Coherency
-    // See ARM DDI 0406B page B2-12 for more information.
-    // We would prefer to use "cvau" (clean to the point of unification) here
-    // but we use "civac" to work around Cortex-A53 errata 819472, 826319,
-    // 827319 and 824069.
-    "dc   civac, %[dline]               \n\t"
-    "add  %[dline], %[dline], %[dsize]  \n\t"
-    "cmp  %[dline], %[end]              \n\t"
-    "b.lt 0b                            \n\t"
-    // Barrier to make sure the effect of the code above is visible to the rest
-    // of the world.
-    // dsb    : Data Synchronisation Barrier
-    //    ish : Inner SHareable domain
-    // The point of unification for an Inner Shareable shareability domain is
-    // the point by which the instruction and data caches of all the processors
-    // in that Inner Shareable shareability domain are guaranteed to see the
-    // same copy of a memory location.  See ARM DDI 0406B page B2-12 for more
-    // information.
-    "dsb  ish                           \n\t"
-    // Invalidate every line of the I cache containing the target data.
-    "1:                                 \n\t"
-    // ic      : instruction cache maintenance
-    //    i    : invalidate
-    //     va  : by address
-    //       u : to the point of unification
-    "ic   ivau, %[iline]                \n\t"
-    "add  %[iline], %[iline], %[isize]  \n\t"
-    "cmp  %[iline], %[end]              \n\t"
-    "b.lt 1b                            \n\t"
-    // Barrier to make sure the effect of the code above is visible to the rest
-    // of the world.
-    "dsb  ish                           \n\t"
-    // Barrier to ensure any prefetching which happened before this code is
-    // discarded.
-    // isb : Instruction Synchronisation Barrier
-    "isb                                \n\t"
-    : [dline] "+r" (dstart),
-      [iline] "+r" (istart)
-    : [dsize] "r"  (dsize),
-      [isize] "r"  (isize),
-      [end]   "r"  (end)
-    // This code does not write to memory but without the dependency gcc might
-    // move this code before the code is generated.
-    : "cc", "memory"
-  );  // NOLINT
-#endif  // V8_HOST_ARCH_ARM64
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_ARM64
diff --git a/src/v8/src/arm64/decoder-arm64-inl.h b/src/v8/src/arm64/decoder-arm64-inl.h
deleted file mode 100644
index 55a09dc..0000000
--- a/src/v8/src/arm64/decoder-arm64-inl.h
+++ /dev/null
@@ -1,823 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_ARM64_DECODER_ARM64_INL_H_
-#define V8_ARM64_DECODER_ARM64_INL_H_
-
-#include "src/arm64/decoder-arm64.h"
-#include "src/globals.h"
-#include "src/utils.h"
-
-
-namespace v8 {
-namespace internal {
-
-
-// Top-level instruction decode function.
-template<typename V>
-void Decoder<V>::Decode(Instruction *instr) {
-  if (instr->Bits(28, 27) == 0) {
-    V::VisitUnallocated(instr);
-  } else {
-    switch (instr->Bits(27, 24)) {
-      // 0:   PC relative addressing.
-      case 0x0: DecodePCRelAddressing(instr); break;
-
-      // 1:   Add/sub immediate.
-      case 0x1: DecodeAddSubImmediate(instr); break;
-
-      // A:   Logical shifted register.
-      //      Add/sub with carry.
-      //      Conditional compare register.
-      //      Conditional compare immediate.
-      //      Conditional select.
-      //      Data processing 1 source.
-      //      Data processing 2 source.
-      // B:   Add/sub shifted register.
-      //      Add/sub extended register.
-      //      Data processing 3 source.
-      case 0xA:
-      case 0xB: DecodeDataProcessing(instr); break;
-
-      // 2:   Logical immediate.
-      //      Move wide immediate.
-      case 0x2: DecodeLogical(instr); break;
-
-      // 3:   Bitfield.
-      //      Extract.
-      case 0x3: DecodeBitfieldExtract(instr); break;
-
-      // 4:   Unconditional branch immediate.
-      //      Exception generation.
-      //      Compare and branch immediate.
-      // 5:   Compare and branch immediate.
-      //      Conditional branch.
-      //      System.
-      // 6,7: Unconditional branch.
-      //      Test and branch immediate.
-      case 0x4:
-      case 0x5:
-      case 0x6:
-      case 0x7: DecodeBranchSystemException(instr); break;
-
-      // 8,9: Load/store register pair post-index.
-      //      Load register literal.
-      //      Load/store register unscaled immediate.
-      //      Load/store register immediate post-index.
-      //      Load/store register immediate pre-index.
-      //      Load/store register offset.
-      // C,D: Load/store register pair offset.
-      //      Load/store register pair pre-index.
-      //      Load/store register unsigned immediate.
-      //      Advanced SIMD.
-      case 0x8:
-      case 0x9:
-      case 0xC:
-      case 0xD: DecodeLoadStore(instr); break;
-
-      // E:   FP fixed point conversion.
-      //      FP integer conversion.
-      //      FP data processing 1 source.
-      //      FP compare.
-      //      FP immediate.
-      //      FP data processing 2 source.
-      //      FP conditional compare.
-      //      FP conditional select.
-      //      Advanced SIMD.
-      // F:   FP data processing 3 source.
-      //      Advanced SIMD.
-      case 0xE:
-      case 0xF: DecodeFP(instr); break;
-    }
-  }
-}
-
-
-template<typename V>
-void Decoder<V>::DecodePCRelAddressing(Instruction* instr) {
-  DCHECK_EQ(0x0, instr->Bits(27, 24));
-  // We know bit 28 is set, as <b28:b27> = 0 is filtered out at the top level
-  // decode.
-  DCHECK_EQ(0x1, instr->Bit(28));
-  V::VisitPCRelAddressing(instr);
-}
-
-
-template<typename V>
-void Decoder<V>::DecodeBranchSystemException(Instruction* instr) {
-  DCHECK((instr->Bits(27, 24) == 0x4) ||
-         (instr->Bits(27, 24) == 0x5) ||
-         (instr->Bits(27, 24) == 0x6) ||
-         (instr->Bits(27, 24) == 0x7) );
-
-  switch (instr->Bits(31, 29)) {
-    case 0:
-    case 4: {
-      V::VisitUnconditionalBranch(instr);
-      break;
-    }
-    case 1:
-    case 5: {
-      if (instr->Bit(25) == 0) {
-        V::VisitCompareBranch(instr);
-      } else {
-        V::VisitTestBranch(instr);
-      }
-      break;
-    }
-    case 2: {
-      if (instr->Bit(25) == 0) {
-        if ((instr->Bit(24) == 0x1) ||
-            (instr->Mask(0x01000010) == 0x00000010)) {
-          V::VisitUnallocated(instr);
-        } else {
-          V::VisitConditionalBranch(instr);
-        }
-      } else {
-        V::VisitUnallocated(instr);
-      }
-      break;
-    }
-    case 6: {
-      if (instr->Bit(25) == 0) {
-        if (instr->Bit(24) == 0) {
-          if ((instr->Bits(4, 2) != 0) ||
-              (instr->Mask(0x00E0001D) == 0x00200001) ||
-              (instr->Mask(0x00E0001D) == 0x00400001) ||
-              (instr->Mask(0x00E0001E) == 0x00200002) ||
-              (instr->Mask(0x00E0001E) == 0x00400002) ||
-              (instr->Mask(0x00E0001C) == 0x00600000) ||
-              (instr->Mask(0x00E0001C) == 0x00800000) ||
-              (instr->Mask(0x00E0001F) == 0x00A00000) ||
-              (instr->Mask(0x00C0001C) == 0x00C00000)) {
-            V::VisitUnallocated(instr);
-          } else {
-            V::VisitException(instr);
-          }
-        } else {
-          if (instr->Bits(23, 22) == 0) {
-            const Instr masked_003FF0E0 = instr->Mask(0x003FF0E0);
-            if ((instr->Bits(21, 19) == 0x4) ||
-                (masked_003FF0E0 == 0x00033000) ||
-                (masked_003FF0E0 == 0x003FF020) ||
-                (masked_003FF0E0 == 0x003FF060) ||
-                (masked_003FF0E0 == 0x003FF0E0) ||
-                (instr->Mask(0x00388000) == 0x00008000) ||
-                (instr->Mask(0x0038E000) == 0x00000000) ||
-                (instr->Mask(0x0039E000) == 0x00002000) ||
-                (instr->Mask(0x003AE000) == 0x00002000) ||
-                (instr->Mask(0x003CE000) == 0x00042000) ||
-                (instr->Mask(0x003FFFC0) == 0x000320C0) ||
-                (instr->Mask(0x003FF100) == 0x00032100) ||
-                (instr->Mask(0x003FF200) == 0x00032200) ||
-                (instr->Mask(0x003FF400) == 0x00032400) ||
-                (instr->Mask(0x003FF800) == 0x00032800) ||
-                (instr->Mask(0x0038F000) == 0x00005000) ||
-                (instr->Mask(0x0038E000) == 0x00006000)) {
-              V::VisitUnallocated(instr);
-            } else {
-              V::VisitSystem(instr);
-            }
-          } else {
-            V::VisitUnallocated(instr);
-          }
-        }
-      } else {
-        if ((instr->Bit(24) == 0x1) ||
-            (instr->Bits(20, 16) != 0x1F) ||
-            (instr->Bits(15, 10) != 0) ||
-            (instr->Bits(4, 0) != 0) ||
-            (instr->Bits(24, 21) == 0x3) ||
-            (instr->Bits(24, 22) == 0x3)) {
-          V::VisitUnallocated(instr);
-        } else {
-          V::VisitUnconditionalBranchToRegister(instr);
-        }
-      }
-      break;
-    }
-    case 3:
-    case 7: {
-      V::VisitUnallocated(instr);
-      break;
-    }
-  }
-}
-
-
-template<typename V>
-void Decoder<V>::DecodeLoadStore(Instruction* instr) {
-  DCHECK((instr->Bits(27, 24) == 0x8) ||
-         (instr->Bits(27, 24) == 0x9) ||
-         (instr->Bits(27, 24) == 0xC) ||
-         (instr->Bits(27, 24) == 0xD) );
-
-  if ((instr->Bit(28) == 0) && (instr->Bit(29) == 0) && (instr->Bit(26) == 1)) {
-    DecodeNEONLoadStore(instr);
-    return;
-  }
-
-  if (instr->Bit(24) == 0) {
-    if (instr->Bit(28) == 0) {
-      if (instr->Bit(29) == 0) {
-        if (instr->Bit(26) == 0) {
-          if (instr->Mask(0xA08000) == 0x800000 ||
-              instr->Mask(0xA00000) == 0xA00000) {
-            V::VisitUnallocated(instr);
-          } else if (instr->Mask(0x808000) == 0) {
-            // Load/Store exclusive without acquire/release are unimplemented.
-            V::VisitUnimplemented(instr);
-          } else {
-            V::VisitLoadStoreAcquireRelease(instr);
-          }
-        }
-      } else {
-        if ((instr->Bits(31, 30) == 0x3) ||
-            (instr->Mask(0xC4400000) == 0x40000000)) {
-          V::VisitUnallocated(instr);
-        } else {
-          if (instr->Bit(23) == 0) {
-            if (instr->Mask(0xC4400000) == 0xC0400000) {
-              V::VisitUnallocated(instr);
-            } else {
-              // Nontemporals are unimplemented.
-              V::VisitUnimplemented(instr);
-            }
-          } else {
-            V::VisitLoadStorePairPostIndex(instr);
-          }
-        }
-      }
-    } else {
-      if (instr->Bit(29) == 0) {
-        if (instr->Mask(0xC4000000) == 0xC4000000) {
-          V::VisitUnallocated(instr);
-        } else {
-          V::VisitLoadLiteral(instr);
-        }
-      } else {
-        if ((instr->Mask(0x84C00000) == 0x80C00000) ||
-            (instr->Mask(0x44800000) == 0x44800000) ||
-            (instr->Mask(0x84800000) == 0x84800000)) {
-          V::VisitUnallocated(instr);
-        } else {
-          if (instr->Bit(21) == 0) {
-            switch (instr->Bits(11, 10)) {
-              case 0: {
-                V::VisitLoadStoreUnscaledOffset(instr);
-                break;
-              }
-              case 1: {
-                if (instr->Mask(0xC4C00000) == 0xC0800000) {
-                  V::VisitUnallocated(instr);
-                } else {
-                  V::VisitLoadStorePostIndex(instr);
-                }
-                break;
-              }
-              case 2: {
-                // TODO(all): VisitLoadStoreRegisterOffsetUnpriv.
-                V::VisitUnimplemented(instr);
-                break;
-              }
-              case 3: {
-                if (instr->Mask(0xC4C00000) == 0xC0800000) {
-                  V::VisitUnallocated(instr);
-                } else {
-                  V::VisitLoadStorePreIndex(instr);
-                }
-                break;
-              }
-            }
-          } else {
-            if (instr->Bits(11, 10) == 0x2) {
-              if (instr->Bit(14) == 0) {
-                V::VisitUnallocated(instr);
-              } else {
-                V::VisitLoadStoreRegisterOffset(instr);
-              }
-            } else {
-              V::VisitUnallocated(instr);
-            }
-          }
-        }
-      }
-    }
-  } else {
-    if (instr->Bit(28) == 0) {
-      if (instr->Bit(29) == 0) {
-        V::VisitUnallocated(instr);
-      } else {
-        if ((instr->Bits(31, 30) == 0x3) ||
-            (instr->Mask(0xC4400000) == 0x40000000)) {
-          V::VisitUnallocated(instr);
-        } else {
-          if (instr->Bit(23) == 0) {
-            V::VisitLoadStorePairOffset(instr);
-          } else {
-            V::VisitLoadStorePairPreIndex(instr);
-          }
-        }
-      }
-    } else {
-      if (instr->Bit(29) == 0) {
-        V::VisitUnallocated(instr);
-      } else {
-        if ((instr->Mask(0x84C00000) == 0x80C00000) ||
-            (instr->Mask(0x44800000) == 0x44800000) ||
-            (instr->Mask(0x84800000) == 0x84800000)) {
-          V::VisitUnallocated(instr);
-        } else {
-          V::VisitLoadStoreUnsignedOffset(instr);
-        }
-      }
-    }
-  }
-}
-
-
-template<typename V>
-void Decoder<V>::DecodeLogical(Instruction* instr) {
-  DCHECK_EQ(0x2, instr->Bits(27, 24));
-
-  if (instr->Mask(0x80400000) == 0x00400000) {
-    V::VisitUnallocated(instr);
-  } else {
-    if (instr->Bit(23) == 0) {
-      V::VisitLogicalImmediate(instr);
-    } else {
-      if (instr->Bits(30, 29) == 0x1) {
-        V::VisitUnallocated(instr);
-      } else {
-        V::VisitMoveWideImmediate(instr);
-      }
-    }
-  }
-}
-
-
-template<typename V>
-void Decoder<V>::DecodeBitfieldExtract(Instruction* instr) {
-  DCHECK_EQ(0x3, instr->Bits(27, 24));
-
-  if ((instr->Mask(0x80400000) == 0x80000000) ||
-      (instr->Mask(0x80400000) == 0x00400000) ||
-      (instr->Mask(0x80008000) == 0x00008000)) {
-    V::VisitUnallocated(instr);
-  } else if (instr->Bit(23) == 0) {
-    if ((instr->Mask(0x80200000) == 0x00200000) ||
-        (instr->Mask(0x60000000) == 0x60000000)) {
-      V::VisitUnallocated(instr);
-    } else {
-      V::VisitBitfield(instr);
-    }
-  } else {
-    if ((instr->Mask(0x60200000) == 0x00200000) ||
-        (instr->Mask(0x60000000) != 0x00000000)) {
-      V::VisitUnallocated(instr);
-    } else {
-      V::VisitExtract(instr);
-    }
-  }
-}
-
-
-template<typename V>
-void Decoder<V>::DecodeAddSubImmediate(Instruction* instr) {
-  DCHECK_EQ(0x1, instr->Bits(27, 24));
-  if (instr->Bit(23) == 1) {
-    V::VisitUnallocated(instr);
-  } else {
-    V::VisitAddSubImmediate(instr);
-  }
-}
-
-
-template<typename V>
-void Decoder<V>::DecodeDataProcessing(Instruction* instr) {
-  DCHECK((instr->Bits(27, 24) == 0xA) ||
-         (instr->Bits(27, 24) == 0xB) );
-
-  if (instr->Bit(24) == 0) {
-    if (instr->Bit(28) == 0) {
-      if (instr->Mask(0x80008000) == 0x00008000) {
-        V::VisitUnallocated(instr);
-      } else {
-        V::VisitLogicalShifted(instr);
-      }
-    } else {
-      switch (instr->Bits(23, 21)) {
-        case 0: {
-          if (instr->Mask(0x0000FC00) != 0) {
-            V::VisitUnallocated(instr);
-          } else {
-            V::VisitAddSubWithCarry(instr);
-          }
-          break;
-        }
-        case 2: {
-          if ((instr->Bit(29) == 0) ||
-              (instr->Mask(0x00000410) != 0)) {
-            V::VisitUnallocated(instr);
-          } else {
-            if (instr->Bit(11) == 0) {
-              V::VisitConditionalCompareRegister(instr);
-            } else {
-              V::VisitConditionalCompareImmediate(instr);
-            }
-          }
-          break;
-        }
-        case 4: {
-          if (instr->Mask(0x20000800) != 0x00000000) {
-            V::VisitUnallocated(instr);
-          } else {
-            V::VisitConditionalSelect(instr);
-          }
-          break;
-        }
-        case 6: {
-          if (instr->Bit(29) == 0x1) {
-            V::VisitUnallocated(instr);
-          } else {
-            if (instr->Bit(30) == 0) {
-              if ((instr->Bit(15) == 0x1) ||
-                  (instr->Bits(15, 11) == 0) ||
-                  (instr->Bits(15, 12) == 0x1) ||
-                  (instr->Bits(15, 12) == 0x3) ||
-                  (instr->Bits(15, 13) == 0x3) ||
-                  (instr->Mask(0x8000EC00) == 0x00004C00) ||
-                  (instr->Mask(0x8000E800) == 0x80004000) ||
-                  (instr->Mask(0x8000E400) == 0x80004000)) {
-                V::VisitUnallocated(instr);
-              } else {
-                V::VisitDataProcessing2Source(instr);
-              }
-            } else {
-              if ((instr->Bit(13) == 1) ||
-                  (instr->Bits(20, 16) != 0) ||
-                  (instr->Bits(15, 14) != 0) ||
-                  (instr->Mask(0xA01FFC00) == 0x00000C00) ||
-                  (instr->Mask(0x201FF800) == 0x00001800)) {
-                V::VisitUnallocated(instr);
-              } else {
-                V::VisitDataProcessing1Source(instr);
-              }
-            }
-            break;
-          }
-        }
-        case 1:
-        case 3:
-        case 5:
-        case 7: V::VisitUnallocated(instr); break;
-      }
-    }
-  } else {
-    if (instr->Bit(28) == 0) {
-     if (instr->Bit(21) == 0) {
-        if ((instr->Bits(23, 22) == 0x3) ||
-            (instr->Mask(0x80008000) == 0x00008000)) {
-          V::VisitUnallocated(instr);
-        } else {
-          V::VisitAddSubShifted(instr);
-        }
-      } else {
-        if ((instr->Mask(0x00C00000) != 0x00000000) ||
-            (instr->Mask(0x00001400) == 0x00001400) ||
-            (instr->Mask(0x00001800) == 0x00001800)) {
-          V::VisitUnallocated(instr);
-        } else {
-          V::VisitAddSubExtended(instr);
-        }
-      }
-    } else {
-      if ((instr->Bit(30) == 0x1) ||
-          (instr->Bits(30, 29) == 0x1) ||
-          (instr->Mask(0xE0600000) == 0x00200000) ||
-          (instr->Mask(0xE0608000) == 0x00400000) ||
-          (instr->Mask(0x60608000) == 0x00408000) ||
-          (instr->Mask(0x60E00000) == 0x00E00000) ||
-          (instr->Mask(0x60E00000) == 0x00800000) ||
-          (instr->Mask(0x60E00000) == 0x00600000)) {
-        V::VisitUnallocated(instr);
-      } else {
-        V::VisitDataProcessing3Source(instr);
-      }
-    }
-  }
-}
-
-
-template<typename V>
-void Decoder<V>::DecodeFP(Instruction* instr) {
-  DCHECK((instr->Bits(27, 24) == 0xE) ||
-         (instr->Bits(27, 24) == 0xF) );
-
-  if (instr->Bit(28) == 0) {
-    DecodeNEONVectorDataProcessing(instr);
-  } else {
-    if (instr->Bits(31, 30) == 0x3) {
-      V::VisitUnallocated(instr);
-    } else if (instr->Bits(31, 30) == 0x1) {
-      DecodeNEONScalarDataProcessing(instr);
-    } else {
-      if (instr->Bit(29) == 0) {
-        if (instr->Bit(24) == 0) {
-          if (instr->Bit(21) == 0) {
-            if ((instr->Bit(23) == 1) ||
-                (instr->Bit(18) == 1) ||
-                (instr->Mask(0x80008000) == 0x00000000) ||
-                (instr->Mask(0x000E0000) == 0x00000000) ||
-                (instr->Mask(0x000E0000) == 0x000A0000) ||
-                (instr->Mask(0x00160000) == 0x00000000) ||
-                (instr->Mask(0x00160000) == 0x00120000)) {
-              V::VisitUnallocated(instr);
-            } else {
-              V::VisitFPFixedPointConvert(instr);
-            }
-          } else {
-            if (instr->Bits(15, 10) == 32) {
-              V::VisitUnallocated(instr);
-            } else if (instr->Bits(15, 10) == 0) {
-              if ((instr->Bits(23, 22) == 0x3) ||
-                  (instr->Mask(0x000E0000) == 0x000A0000) ||
-                  (instr->Mask(0x000E0000) == 0x000C0000) ||
-                  (instr->Mask(0x00160000) == 0x00120000) ||
-                  (instr->Mask(0x00160000) == 0x00140000) ||
-                  (instr->Mask(0x20C40000) == 0x00800000) ||
-                  (instr->Mask(0x20C60000) == 0x00840000) ||
-                  (instr->Mask(0xA0C60000) == 0x80060000) ||
-                  (instr->Mask(0xA0C60000) == 0x00860000) ||
-                  (instr->Mask(0xA0C60000) == 0x00460000) ||
-                  (instr->Mask(0xA0CE0000) == 0x80860000) ||
-                  (instr->Mask(0xA0CE0000) == 0x804E0000) ||
-                  (instr->Mask(0xA0CE0000) == 0x000E0000) ||
-                  (instr->Mask(0xA0D60000) == 0x00160000) ||
-                  (instr->Mask(0xA0D60000) == 0x80560000) ||
-                  (instr->Mask(0xA0D60000) == 0x80960000)) {
-                V::VisitUnallocated(instr);
-              } else {
-                V::VisitFPIntegerConvert(instr);
-              }
-            } else if (instr->Bits(14, 10) == 16) {
-              const Instr masked_A0DF8000 = instr->Mask(0xA0DF8000);
-              if ((instr->Mask(0x80180000) != 0) ||
-                  (masked_A0DF8000 == 0x00020000) ||
-                  (masked_A0DF8000 == 0x00030000) ||
-                  (masked_A0DF8000 == 0x00068000) ||
-                  (masked_A0DF8000 == 0x00428000) ||
-                  (masked_A0DF8000 == 0x00430000) ||
-                  (masked_A0DF8000 == 0x00468000) ||
-                  (instr->Mask(0xA0D80000) == 0x00800000) ||
-                  (instr->Mask(0xA0DE0000) == 0x00C00000) ||
-                  (instr->Mask(0xA0DF0000) == 0x00C30000) ||
-                  (instr->Mask(0xA0DC0000) == 0x00C40000)) {
-                V::VisitUnallocated(instr);
-              } else {
-                V::VisitFPDataProcessing1Source(instr);
-              }
-            } else if (instr->Bits(13, 10) == 8) {
-              if ((instr->Bits(15, 14) != 0) ||
-                  (instr->Bits(2, 0) != 0) ||
-                  (instr->Mask(0x80800000) != 0x00000000)) {
-                V::VisitUnallocated(instr);
-              } else {
-                V::VisitFPCompare(instr);
-              }
-            } else if (instr->Bits(12, 10) == 4) {
-              if ((instr->Bits(9, 5) != 0) ||
-                  (instr->Mask(0x80800000) != 0x00000000)) {
-                V::VisitUnallocated(instr);
-              } else {
-                V::VisitFPImmediate(instr);
-              }
-            } else {
-              if (instr->Mask(0x80800000) != 0x00000000) {
-                V::VisitUnallocated(instr);
-              } else {
-                switch (instr->Bits(11, 10)) {
-                  case 1: {
-                    V::VisitFPConditionalCompare(instr);
-                    break;
-                  }
-                  case 2: {
-                    if ((instr->Bits(15, 14) == 0x3) ||
-                        (instr->Mask(0x00009000) == 0x00009000) ||
-                        (instr->Mask(0x0000A000) == 0x0000A000)) {
-                      V::VisitUnallocated(instr);
-                    } else {
-                      V::VisitFPDataProcessing2Source(instr);
-                    }
-                    break;
-                  }
-                  case 3: {
-                    V::VisitFPConditionalSelect(instr);
-                    break;
-                  }
-                  default: UNREACHABLE();
-                }
-              }
-            }
-          }
-        } else {
-          // Bit 30 == 1 has been handled earlier.
-          DCHECK_EQ(0, instr->Bit(30));
-          if (instr->Mask(0xA0800000) != 0) {
-            V::VisitUnallocated(instr);
-          } else {
-            V::VisitFPDataProcessing3Source(instr);
-          }
-        }
-      } else {
-        V::VisitUnallocated(instr);
-      }
-    }
-  }
-}
-
-template <typename V>
-void Decoder<V>::DecodeNEONLoadStore(Instruction* instr) {
-  DCHECK_EQ(0x6, instr->Bits(29, 25));
-  if (instr->Bit(31) == 0) {
-    if ((instr->Bit(24) == 0) && (instr->Bit(21) == 1)) {
-      V::VisitUnallocated(instr);
-      return;
-    }
-
-    if (instr->Bit(23) == 0) {
-      if (instr->Bits(20, 16) == 0) {
-        if (instr->Bit(24) == 0) {
-          V::VisitNEONLoadStoreMultiStruct(instr);
-        } else {
-          V::VisitNEONLoadStoreSingleStruct(instr);
-        }
-      } else {
-        V::VisitUnallocated(instr);
-      }
-    } else {
-      if (instr->Bit(24) == 0) {
-        V::VisitNEONLoadStoreMultiStructPostIndex(instr);
-      } else {
-        V::VisitNEONLoadStoreSingleStructPostIndex(instr);
-      }
-    }
-  } else {
-    V::VisitUnallocated(instr);
-  }
-}
-
-template <typename V>
-void Decoder<V>::DecodeNEONVectorDataProcessing(Instruction* instr) {
-  DCHECK_EQ(0x7, instr->Bits(28, 25));
-  if (instr->Bit(31) == 0) {
-    if (instr->Bit(24) == 0) {
-      if (instr->Bit(21) == 0) {
-        if (instr->Bit(15) == 0) {
-          if (instr->Bit(10) == 0) {
-            if (instr->Bit(29) == 0) {
-              if (instr->Bit(11) == 0) {
-                V::VisitNEONTable(instr);
-              } else {
-                V::VisitNEONPerm(instr);
-              }
-            } else {
-              V::VisitNEONExtract(instr);
-            }
-          } else {
-            if (instr->Bits(23, 22) == 0) {
-              V::VisitNEONCopy(instr);
-            } else {
-              V::VisitUnallocated(instr);
-            }
-          }
-        } else {
-          V::VisitUnallocated(instr);
-        }
-      } else {
-        if (instr->Bit(10) == 0) {
-          if (instr->Bit(11) == 0) {
-            V::VisitNEON3Different(instr);
-          } else {
-            if (instr->Bits(18, 17) == 0) {
-              if (instr->Bit(20) == 0) {
-                if (instr->Bit(19) == 0) {
-                  V::VisitNEON2RegMisc(instr);
-                } else {
-                  if (instr->Bits(30, 29) == 0x2) {
-                    V::VisitUnallocated(instr);
-                  } else {
-                    V::VisitUnallocated(instr);
-                  }
-                }
-              } else {
-                if (instr->Bit(19) == 0) {
-                  V::VisitNEONAcrossLanes(instr);
-                } else {
-                  V::VisitUnallocated(instr);
-                }
-              }
-            } else {
-              V::VisitUnallocated(instr);
-            }
-          }
-        } else {
-          V::VisitNEON3Same(instr);
-        }
-      }
-    } else {
-      if (instr->Bit(10) == 0) {
-        V::VisitNEONByIndexedElement(instr);
-      } else {
-        if (instr->Bit(23) == 0) {
-          if (instr->Bits(22, 19) == 0) {
-            V::VisitNEONModifiedImmediate(instr);
-          } else {
-            V::VisitNEONShiftImmediate(instr);
-          }
-        } else {
-          V::VisitUnallocated(instr);
-        }
-      }
-    }
-  } else {
-    V::VisitUnallocated(instr);
-  }
-}
-
-template <typename V>
-void Decoder<V>::DecodeNEONScalarDataProcessing(Instruction* instr) {
-  DCHECK_EQ(0xF, instr->Bits(28, 25));
-  if (instr->Bit(24) == 0) {
-    if (instr->Bit(21) == 0) {
-      if (instr->Bit(15) == 0) {
-        if (instr->Bit(10) == 0) {
-          if (instr->Bit(29) == 0) {
-            if (instr->Bit(11) == 0) {
-              V::VisitUnallocated(instr);
-            } else {
-              V::VisitUnallocated(instr);
-            }
-          } else {
-            V::VisitUnallocated(instr);
-          }
-        } else {
-          if (instr->Bits(23, 22) == 0) {
-            V::VisitNEONScalarCopy(instr);
-          } else {
-            V::VisitUnallocated(instr);
-          }
-        }
-      } else {
-        V::VisitUnallocated(instr);
-      }
-    } else {
-      if (instr->Bit(10) == 0) {
-        if (instr->Bit(11) == 0) {
-          V::VisitNEONScalar3Diff(instr);
-        } else {
-          if (instr->Bits(18, 17) == 0) {
-            if (instr->Bit(20) == 0) {
-              if (instr->Bit(19) == 0) {
-                V::VisitNEONScalar2RegMisc(instr);
-              } else {
-                if (instr->Bit(29) == 0) {
-                  V::VisitUnallocated(instr);
-                } else {
-                  V::VisitUnallocated(instr);
-                }
-              }
-            } else {
-              if (instr->Bit(19) == 0) {
-                V::VisitNEONScalarPairwise(instr);
-              } else {
-                V::VisitUnallocated(instr);
-              }
-            }
-          } else {
-            V::VisitUnallocated(instr);
-          }
-        }
-      } else {
-        V::VisitNEONScalar3Same(instr);
-      }
-    }
-  } else {
-    if (instr->Bit(10) == 0) {
-      V::VisitNEONScalarByIndexedElement(instr);
-    } else {
-      if (instr->Bit(23) == 0) {
-        V::VisitNEONScalarShiftImmediate(instr);
-      } else {
-        V::VisitUnallocated(instr);
-      }
-    }
-  }
-}
-
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_ARM64_DECODER_ARM64_INL_H_
diff --git a/src/v8/src/arm64/decoder-arm64.cc b/src/v8/src/arm64/decoder-arm64.cc
deleted file mode 100644
index 56b3e02..0000000
--- a/src/v8/src/arm64/decoder-arm64.cc
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright 2013 the V8 project 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 V8_TARGET_ARCH_ARM64
-
-#include "src/arm64/decoder-arm64.h"
-#include "src/globals.h"
-#include "src/utils.h"
-
-
-namespace v8 {
-namespace internal {
-
-
-void DispatchingDecoderVisitor::AppendVisitor(DecoderVisitor* new_visitor) {
-  visitors_.remove(new_visitor);
-  visitors_.push_back(new_visitor);
-}
-
-
-void DispatchingDecoderVisitor::PrependVisitor(DecoderVisitor* new_visitor) {
-  visitors_.remove(new_visitor);
-  visitors_.push_front(new_visitor);
-}
-
-
-void DispatchingDecoderVisitor::InsertVisitorBefore(
-    DecoderVisitor* new_visitor, DecoderVisitor* registered_visitor) {
-  visitors_.remove(new_visitor);
-  std::list<DecoderVisitor*>::iterator it;
-  for (it = visitors_.begin(); it != visitors_.end(); it++) {
-    if (*it == registered_visitor) {
-      visitors_.insert(it, new_visitor);
-      return;
-    }
-  }
-  // We reached the end of the list. The last element must be
-  // registered_visitor.
-  DCHECK(*it == registered_visitor);
-  visitors_.insert(it, new_visitor);
-}
-
-
-void DispatchingDecoderVisitor::InsertVisitorAfter(
-    DecoderVisitor* new_visitor, DecoderVisitor* registered_visitor) {
-  visitors_.remove(new_visitor);
-  std::list<DecoderVisitor*>::iterator it;
-  for (it = visitors_.begin(); it != visitors_.end(); it++) {
-    if (*it == registered_visitor) {
-      it++;
-      visitors_.insert(it, new_visitor);
-      return;
-    }
-  }
-  // We reached the end of the list. The last element must be
-  // registered_visitor.
-  DCHECK(*it == registered_visitor);
-  visitors_.push_back(new_visitor);
-}
-
-
-void DispatchingDecoderVisitor::RemoveVisitor(DecoderVisitor* visitor) {
-  visitors_.remove(visitor);
-}
-
-
-#define DEFINE_VISITOR_CALLERS(A)                                \
-  void DispatchingDecoderVisitor::Visit##A(Instruction* instr) { \
-    if (!(instr->Mask(A##FMask) == A##Fixed)) {                  \
-      DCHECK(instr->Mask(A##FMask) == A##Fixed);                 \
-    }                                                            \
-    std::list<DecoderVisitor*>::iterator it;                     \
-    for (it = visitors_.begin(); it != visitors_.end(); it++) {  \
-      (*it)->Visit##A(instr);                                    \
-    }                                                            \
-  }
-VISITOR_LIST(DEFINE_VISITOR_CALLERS)
-#undef DEFINE_VISITOR_CALLERS
-
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_ARM64
diff --git a/src/v8/src/arm64/decoder-arm64.h b/src/v8/src/arm64/decoder-arm64.h
deleted file mode 100644
index a89bf38..0000000
--- a/src/v8/src/arm64/decoder-arm64.h
+++ /dev/null
@@ -1,217 +0,0 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_ARM64_DECODER_ARM64_H_
-#define V8_ARM64_DECODER_ARM64_H_
-
-#include <list>
-
-#include "src/arm64/instructions-arm64.h"
-#include "src/globals.h"
-
-namespace v8 {
-namespace internal {
-
-
-// List macro containing all visitors needed by the decoder class.
-
-#define VISITOR_LIST(V)                 \
-  V(PCRelAddressing)                    \
-  V(AddSubImmediate)                    \
-  V(LogicalImmediate)                   \
-  V(MoveWideImmediate)                  \
-  V(Bitfield)                           \
-  V(Extract)                            \
-  V(UnconditionalBranch)                \
-  V(UnconditionalBranchToRegister)      \
-  V(CompareBranch)                      \
-  V(TestBranch)                         \
-  V(ConditionalBranch)                  \
-  V(System)                             \
-  V(Exception)                          \
-  V(LoadStorePairPostIndex)             \
-  V(LoadStorePairOffset)                \
-  V(LoadStorePairPreIndex)              \
-  V(LoadLiteral)                        \
-  V(LoadStoreUnscaledOffset)            \
-  V(LoadStorePostIndex)                 \
-  V(LoadStorePreIndex)                  \
-  V(LoadStoreRegisterOffset)            \
-  V(LoadStoreUnsignedOffset)            \
-  V(LoadStoreAcquireRelease)            \
-  V(LogicalShifted)                     \
-  V(AddSubShifted)                      \
-  V(AddSubExtended)                     \
-  V(AddSubWithCarry)                    \
-  V(ConditionalCompareRegister)         \
-  V(ConditionalCompareImmediate)        \
-  V(ConditionalSelect)                  \
-  V(DataProcessing1Source)              \
-  V(DataProcessing2Source)              \
-  V(DataProcessing3Source)              \
-  V(FPCompare)                          \
-  V(FPConditionalCompare)               \
-  V(FPConditionalSelect)                \
-  V(FPImmediate)                        \
-  V(FPDataProcessing1Source)            \
-  V(FPDataProcessing2Source)            \
-  V(FPDataProcessing3Source)            \
-  V(FPIntegerConvert)                   \
-  V(FPFixedPointConvert)                \
-  V(NEON2RegMisc)                       \
-  V(NEON3Different)                     \
-  V(NEON3Same)                          \
-  V(NEONAcrossLanes)                    \
-  V(NEONByIndexedElement)               \
-  V(NEONCopy)                           \
-  V(NEONExtract)                        \
-  V(NEONLoadStoreMultiStruct)           \
-  V(NEONLoadStoreMultiStructPostIndex)  \
-  V(NEONLoadStoreSingleStruct)          \
-  V(NEONLoadStoreSingleStructPostIndex) \
-  V(NEONModifiedImmediate)              \
-  V(NEONScalar2RegMisc)                 \
-  V(NEONScalar3Diff)                    \
-  V(NEONScalar3Same)                    \
-  V(NEONScalarByIndexedElement)         \
-  V(NEONScalarCopy)                     \
-  V(NEONScalarPairwise)                 \
-  V(NEONScalarShiftImmediate)           \
-  V(NEONShiftImmediate)                 \
-  V(NEONTable)                          \
-  V(NEONPerm)                           \
-  V(Unallocated)                        \
-  V(Unimplemented)
-
-// The Visitor interface. Disassembler and simulator (and other tools)
-// must provide implementations for all of these functions.
-class DecoderVisitor {
- public:
-  virtual ~DecoderVisitor() {}
-
-  #define DECLARE(A) virtual void Visit##A(Instruction* instr) = 0;
-  VISITOR_LIST(DECLARE)
-  #undef DECLARE
-};
-
-
-// A visitor that dispatches to a list of visitors.
-class DispatchingDecoderVisitor : public DecoderVisitor {
- public:
-  DispatchingDecoderVisitor() {}
-  virtual ~DispatchingDecoderVisitor() {}
-
-  // Register a new visitor class with the decoder.
-  // Decode() will call the corresponding visitor method from all registered
-  // visitor classes when decoding reaches the leaf node of the instruction
-  // decode tree.
-  // Visitors are called in the order.
-  // A visitor can only be registered once.
-  // Registering an already registered visitor will update its position.
-  //
-  //   d.AppendVisitor(V1);
-  //   d.AppendVisitor(V2);
-  //   d.PrependVisitor(V2);            // Move V2 at the start of the list.
-  //   d.InsertVisitorBefore(V3, V2);
-  //   d.AppendVisitor(V4);
-  //   d.AppendVisitor(V4);             // No effect.
-  //
-  //   d.Decode(i);
-  //
-  // will call in order visitor methods in V3, V2, V1, V4.
-  void AppendVisitor(DecoderVisitor* visitor);
-  void PrependVisitor(DecoderVisitor* visitor);
-  void InsertVisitorBefore(DecoderVisitor* new_visitor,
-                           DecoderVisitor* registered_visitor);
-  void InsertVisitorAfter(DecoderVisitor* new_visitor,
-                          DecoderVisitor* registered_visitor);
-
-  // Remove a previously registered visitor class from the list of visitors
-  // stored by the decoder.
-  void RemoveVisitor(DecoderVisitor* visitor);
-
-  void VisitNEONShiftImmediate(const Instruction* instr);
-
-  #define DECLARE(A) void Visit##A(Instruction* instr);
-  VISITOR_LIST(DECLARE)
-  #undef DECLARE
-
- private:
-  // Visitors are registered in a list.
-  std::list<DecoderVisitor*> visitors_;
-};
-
-
-template<typename V>
-class Decoder : public V {
- public:
-  Decoder() {}
-  virtual ~Decoder() {}
-
-  // Top-level instruction decoder function. Decodes an instruction and calls
-  // the visitor functions registered with the Decoder class.
-  virtual void Decode(Instruction *instr);
-
- private:
-  // Decode the PC relative addressing instruction, and call the corresponding
-  // visitors.
-  // On entry, instruction bits 27:24 = 0x0.
-  void DecodePCRelAddressing(Instruction* instr);
-
-  // Decode the add/subtract immediate instruction, and call the corresponding
-  // visitors.
-  // On entry, instruction bits 27:24 = 0x1.
-  void DecodeAddSubImmediate(Instruction* instr);
-
-  // Decode the branch, system command, and exception generation parts of
-  // the instruction tree, and call the corresponding visitors.
-  // On entry, instruction bits 27:24 = {0x4, 0x5, 0x6, 0x7}.
-  void DecodeBranchSystemException(Instruction* instr);
-
-  // Decode the load and store parts of the instruction tree, and call
-  // the corresponding visitors.
-  // On entry, instruction bits 27:24 = {0x8, 0x9, 0xC, 0xD}.
-  void DecodeLoadStore(Instruction* instr);
-
-  // Decode the logical immediate and move wide immediate parts of the
-  // instruction tree, and call the corresponding visitors.
-  // On entry, instruction bits 27:24 = 0x2.
-  void DecodeLogical(Instruction* instr);
-
-  // Decode the bitfield and extraction parts of the instruction tree,
-  // and call the corresponding visitors.
-  // On entry, instruction bits 27:24 = 0x3.
-  void DecodeBitfieldExtract(Instruction* instr);
-
-  // Decode the data processing parts of the instruction tree, and call the
-  // corresponding visitors.
-  // On entry, instruction bits 27:24 = {0x1, 0xA, 0xB}.
-  void DecodeDataProcessing(Instruction* instr);
-
-  // Decode the floating point parts of the instruction tree, and call the
-  // corresponding visitors.
-  // On entry, instruction bits 27:24 = {0xE, 0xF}.
-  void DecodeFP(Instruction* instr);
-
-  // Decode the Advanced SIMD (NEON) load/store part of the instruction tree,
-  // and call the corresponding visitors.
-  // On entry, instruction bits 29:25 = 0x6.
-  void DecodeNEONLoadStore(Instruction* instr);
-
-  // Decode the Advanced SIMD (NEON) data processing part of the instruction
-  // tree, and call the corresponding visitors.
-  // On entry, instruction bits 27:25 = 0x7.
-  void DecodeNEONVectorDataProcessing(Instruction* instr);
-
-  // Decode the Advanced SIMD (NEON) scalar data processing part of the
-  // instruction tree, and call the corresponding visitors.
-  // On entry, instruction bits 28:25 = 0xF.
-  void DecodeNEONScalarDataProcessing(Instruction* instr);
-};
-
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_ARM64_DECODER_ARM64_H_
diff --git a/src/v8/src/arm64/deoptimizer-arm64.cc b/src/v8/src/arm64/deoptimizer-arm64.cc
deleted file mode 100644
index 8269e8e..0000000
--- a/src/v8/src/arm64/deoptimizer-arm64.cc
+++ /dev/null
@@ -1,354 +0,0 @@
-// Copyright 2013 the V8 project 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 "src/api.h"
-#include "src/arm64/assembler-arm64-inl.h"
-#include "src/arm64/macro-assembler-arm64-inl.h"
-#include "src/deoptimizer.h"
-#include "src/frame-constants.h"
-#include "src/register-configuration.h"
-#include "src/safepoint-table.h"
-
-
-namespace v8 {
-namespace internal {
-
-#define __ masm()->
-
-namespace {
-
-void CopyRegListToFrame(MacroAssembler* masm, const Register& dst,
-                        int dst_offset, const CPURegList& reg_list,
-                        const Register& temp0, const Register& temp1,
-                        int src_offset = 0) {
-  DCHECK_EQ(reg_list.Count() % 2, 0);
-  UseScratchRegisterScope temps(masm);
-  CPURegList copy_to_input = reg_list;
-  int reg_size = reg_list.RegisterSizeInBytes();
-  DCHECK_EQ(temp0.SizeInBytes(), reg_size);
-  DCHECK_EQ(temp1.SizeInBytes(), reg_size);
-
-  // Compute some temporary addresses to avoid having the macro assembler set
-  // up a temp with an offset for accesses out of the range of the addressing
-  // mode.
-  Register src = temps.AcquireX();
-  masm->Add(src, masm->StackPointer(), src_offset);
-  masm->Add(dst, dst, dst_offset);
-
-  // Write reg_list into the frame pointed to by dst.
-  for (int i = 0; i < reg_list.Count(); i += 2) {
-    masm->Ldp(temp0, temp1, MemOperand(src, i * reg_size));
-
-    CPURegister reg0 = copy_to_input.PopLowestIndex();
-    CPURegister reg1 = copy_to_input.PopLowestIndex();
-    int offset0 = reg0.code() * reg_size;
-    int offset1 = reg1.code() * reg_size;
-
-    // Pair up adjacent stores, otherwise write them separately.
-    if (offset1 == offset0 + reg_size) {
-      masm->Stp(temp0, temp1, MemOperand(dst, offset0));
-    } else {
-      masm->Str(temp0, MemOperand(dst, offset0));
-      masm->Str(temp1, MemOperand(dst, offset1));
-    }
-  }
-  masm->Sub(dst, dst, dst_offset);
-}
-
-void RestoreRegList(MacroAssembler* masm, const CPURegList& reg_list,
-                    const Register& src_base, int src_offset) {
-  DCHECK_EQ(reg_list.Count() % 2, 0);
-  UseScratchRegisterScope temps(masm);
-  CPURegList restore_list = reg_list;
-  int reg_size = restore_list.RegisterSizeInBytes();
-
-  // Compute a temporary addresses to avoid having the macro assembler set
-  // up a temp with an offset for accesses out of the range of the addressing
-  // mode.
-  Register src = temps.AcquireX();
-  masm->Add(src, src_base, src_offset);
-
-  // Restore every register in restore_list from src.
-  while (!restore_list.IsEmpty()) {
-    CPURegister reg0 = restore_list.PopLowestIndex();
-    CPURegister reg1 = restore_list.PopLowestIndex();
-    int offset0 = reg0.code() * reg_size;
-    int offset1 = reg1.code() * reg_size;
-
-    // Pair up adjacent loads, otherwise read them separately.
-    if (offset1 == offset0 + reg_size) {
-      masm->Ldp(reg0, reg1, MemOperand(src, offset0));
-    } else {
-      masm->Ldr(reg0, MemOperand(src, offset0));
-      masm->Ldr(reg1, MemOperand(src, offset1));
-    }
-  }
-}
-}  // namespace
-
-void Deoptimizer::TableEntryGenerator::Generate() {
-  GeneratePrologue();
-
-  // TODO(all): This code needs to be revisited. We probably only need to save
-  // caller-saved registers here. Callee-saved registers can be stored directly
-  // in the input frame.
-
-  // Save all allocatable double registers.
-  CPURegList saved_double_registers(
-      CPURegister::kVRegister, kDRegSizeInBits,
-      RegisterConfiguration::Default()->allocatable_double_codes_mask());
-  DCHECK_EQ(saved_double_registers.Count() % 2, 0);
-  __ PushCPURegList(saved_double_registers);
-
-  CPURegList saved_float_registers(
-      CPURegister::kVRegister, kSRegSizeInBits,
-      RegisterConfiguration::Default()->allocatable_float_codes_mask());
-  DCHECK_EQ(saved_float_registers.Count() % 4, 0);
-  __ PushCPURegList(saved_float_registers);
-
-  // We save all the registers except sp, lr and the masm scratches.
-  CPURegList saved_registers(CPURegister::kRegister, kXRegSizeInBits, 0, 28);
-  saved_registers.Remove(ip0);
-  saved_registers.Remove(ip1);
-  saved_registers.Combine(fp);
-  DCHECK_EQ(saved_registers.Count() % 2, 0);
-  __ PushCPURegList(saved_registers);
-
-  __ Mov(x3, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress,
-                                       isolate())));
-  __ Str(fp, MemOperand(x3));
-
-  const int kSavedRegistersAreaSize =
-      (saved_registers.Count() * kXRegSize) +
-      (saved_double_registers.Count() * kDRegSize) +
-      (saved_float_registers.Count() * kSRegSize);
-
-  // Floating point registers are saved on the stack above core registers.
-  const int kFloatRegistersOffset = saved_registers.Count() * kXRegSize;
-  const int kDoubleRegistersOffset =
-      kFloatRegistersOffset + saved_float_registers.Count() * kSRegSize;
-
-  // Get the bailout id from the stack.
-  Register bailout_id = x2;
-  __ Peek(bailout_id, kSavedRegistersAreaSize);
-
-  Register code_object = x3;
-  Register fp_to_sp = x4;
-  // Get the address of the location in the code object. This is the return
-  // address for lazy deoptimization.
-  __ Mov(code_object, lr);
-  // Compute the fp-to-sp delta, adding two words for alignment padding and
-  // bailout id.
-  __ Add(fp_to_sp, __ StackPointer(),
-         kSavedRegistersAreaSize + (2 * kPointerSize));
-  __ Sub(fp_to_sp, fp, fp_to_sp);
-
-  // Allocate a new deoptimizer object.
-  __ Ldr(x1, MemOperand(fp, CommonFrameConstants::kContextOrFrameTypeOffset));
-
-  // Ensure we can safely load from below fp.
-  DCHECK_GT(kSavedRegistersAreaSize,
-            -JavaScriptFrameConstants::kFunctionOffset);
-  __ Ldr(x0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
-
-  // If x1 is a smi, zero x0.
-  __ Tst(x1, kSmiTagMask);
-  __ CzeroX(x0, eq);
-
-  __ Mov(x1, type());
-  // Following arguments are already loaded:
-  //  - x2: bailout id
-  //  - x3: code object address
-  //  - x4: fp-to-sp delta
-  __ Mov(x5, ExternalReference::isolate_address(isolate()));
-
-  {
-    // Call Deoptimizer::New().
-    AllowExternalCallThatCantCauseGC scope(masm());
-    __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate()), 6);
-  }
-
-  // Preserve "deoptimizer" object in register x0.
-  Register deoptimizer = x0;
-
-  // Get the input frame descriptor pointer.
-  __ Ldr(x1, MemOperand(deoptimizer, Deoptimizer::input_offset()));
-
-  // Copy core registers into the input frame.
-  CopyRegListToFrame(masm(), x1, FrameDescription::registers_offset(),
-                     saved_registers, x2, x3);
-
-  // Copy double registers to the input frame.
-  CopyRegListToFrame(masm(), x1, FrameDescription::double_registers_offset(),
-                     saved_double_registers, x2, x3, kDoubleRegistersOffset);
-
-  // Copy float registers to the input frame.
-  // TODO(arm): these are the lower 32-bits of the double registers stored
-  // above, so we shouldn't need to store them again.
-  CopyRegListToFrame(masm(), x1, FrameDescription::float_registers_offset(),
-                     saved_float_registers, w2, w3, kFloatRegistersOffset);
-
-  // Remove the padding, bailout id and the saved registers from the stack.
-  DCHECK_EQ(kSavedRegistersAreaSize % kXRegSize, 0);
-  __ Drop(2 + (kSavedRegistersAreaSize / kXRegSize));
-
-  // Compute a pointer to the unwinding limit in register x2; that is
-  // the first stack slot not part of the input frame.
-  Register unwind_limit = x2;
-  __ Ldr(unwind_limit, MemOperand(x1, FrameDescription::frame_size_offset()));
-
-  // Unwind the stack down to - but not including - the unwinding
-  // limit and copy the contents of the activation frame to the input
-  // frame description.
-  __ Add(x3, x1, FrameDescription::frame_content_offset());
-  __ SlotAddress(x1, 0);
-  __ Lsr(unwind_limit, unwind_limit, kPointerSizeLog2);
-  __ Mov(x5, unwind_limit);
-  __ CopyDoubleWords(x3, x1, x5);
-  __ Drop(unwind_limit);
-
-  // Compute the output frame in the deoptimizer.
-  __ Push(padreg, x0);  // Preserve deoptimizer object across call.
-  {
-    // Call Deoptimizer::ComputeOutputFrames().
-    AllowExternalCallThatCantCauseGC scope(masm());
-    __ CallCFunction(
-        ExternalReference::compute_output_frames_function(isolate()), 1);
-  }
-  __ Pop(x4, padreg);  // Restore deoptimizer object (class Deoptimizer).
-
-  {
-    UseScratchRegisterScope temps(masm());
-    Register scratch = temps.AcquireX();
-    __ Ldr(scratch, MemOperand(x4, Deoptimizer::caller_frame_top_offset()));
-    __ Mov(__ StackPointer(), scratch);
-  }
-
-  // Replace the current (input) frame with the output frames.
-  Label outer_push_loop, inner_push_loop,
-      outer_loop_header, inner_loop_header;
-  __ Ldrsw(x1, MemOperand(x4, Deoptimizer::output_count_offset()));
-  __ Ldr(x0, MemOperand(x4, Deoptimizer::output_offset()));
-  __ Add(x1, x0, Operand(x1, LSL, kPointerSizeLog2));
-  __ B(&outer_loop_header);
-
-  __ Bind(&outer_push_loop);
-  Register current_frame = x2;
-  Register frame_size = x3;
-  __ Ldr(current_frame, MemOperand(x0, kPointerSize, PostIndex));
-  __ Ldr(x3, MemOperand(current_frame, FrameDescription::frame_size_offset()));
-  __ Lsr(frame_size, x3, kPointerSizeLog2);
-  __ Claim(frame_size);
-
-  __ Add(x7, current_frame, FrameDescription::frame_content_offset());
-  __ SlotAddress(x6, 0);
-  __ CopyDoubleWords(x6, x7, frame_size);
-
-  __ Bind(&outer_loop_header);
-  __ Cmp(x0, x1);
-  __ B(lt, &outer_push_loop);
-
-  __ Ldr(x1, MemOperand(x4, Deoptimizer::input_offset()));
-  RestoreRegList(masm(), saved_double_registers, x1,
-                 FrameDescription::double_registers_offset());
-
-  // TODO(all): ARM copies a lot (if not all) of the last output frame onto the
-  // stack, then pops it all into registers. Here, we try to load it directly
-  // into the relevant registers. Is this correct? If so, we should improve the
-  // ARM code.
-
-  // Restore registers from the last output frame.
-  // Note that lr is not in the list of saved_registers and will be restored
-  // later. We can use it to hold the address of last output frame while
-  // reloading the other registers.
-  DCHECK(!saved_registers.IncludesAliasOf(lr));
-  Register last_output_frame = lr;
-  __ Mov(last_output_frame, current_frame);
-
-  RestoreRegList(masm(), saved_registers, last_output_frame,
-                 FrameDescription::registers_offset());
-
-  Register continuation = x7;
-  __ Ldr(continuation, MemOperand(last_output_frame,
-                                  FrameDescription::continuation_offset()));
-  __ Ldr(lr, MemOperand(last_output_frame, FrameDescription::pc_offset()));
-  __ InitializeRootRegister();
-  __ Br(continuation);
-}
-
-// Size of an entry of the second level deopt table.
-// This is the code size generated by GeneratePrologue for one entry.
-const int Deoptimizer::table_entry_size_ = kInstructionSize;
-
-void Deoptimizer::TableEntryGenerator::GeneratePrologue() {
-  UseScratchRegisterScope temps(masm());
-  // The address at which the deopt table is entered should be in x16, the first
-  // temp register allocated. We can't assert that the address is in there, but
-  // we can check that it's the first allocated temp. Later, we'll also check
-  // the computed entry_id is in the expected range.
-  Register entry_addr = temps.AcquireX();
-  Register entry_id = temps.AcquireX();
-  DCHECK(entry_addr.Is(x16));
-  DCHECK(entry_id.Is(x17));
-
-  // Create a sequence of deoptimization entries.
-  // Note that registers are still live when jumping to an entry.
-  {
-    InstructionAccurateScope scope(masm());
-
-    Label start_of_table, end_of_table;
-    __ bind(&start_of_table);
-    for (int i = 0; i < count(); i++) {
-      int start = masm()->pc_offset();
-      USE(start);
-      __ b(&end_of_table);
-      DCHECK(masm()->pc_offset() - start == table_entry_size_);
-    }
-    __ bind(&end_of_table);
-
-    // Get the address of the start of the table.
-    DCHECK(is_int21(table_entry_size_ * count()));
-    __ adr(entry_id, &start_of_table);
-
-    // Compute the gap in bytes between the entry address, which should have
-    // been left in entry_addr (x16) by CallForDeoptimization, and the start of
-    // the table.
-    __ sub(entry_id, entry_addr, entry_id);
-
-    // Shift down to obtain the entry_id.
-    DCHECK_EQ(table_entry_size_, kInstructionSize);
-    __ lsr(entry_id, entry_id, kInstructionSizeLog2);
-  }
-
-  __ Push(padreg, entry_id);
-
-  if (__ emit_debug_code()) {
-    // Ensure the entry_id looks sensible, ie. 0 <= entry_id < count().
-    __ Cmp(entry_id, count());
-    __ Check(lo, AbortReason::kOffsetOutOfRange);
-  }
-}
-
-bool Deoptimizer::PadTopOfStackRegister() { return true; }
-
-void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) {
-  SetFrameSlot(offset, value);
-}
-
-
-void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) {
-  SetFrameSlot(offset, value);
-}
-
-
-void FrameDescription::SetCallerConstantPool(unsigned offset, intptr_t value) {
-  // No embedded constant pool support.
-  UNREACHABLE();
-}
-
-
-#undef __
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/arm64/disasm-arm64.cc b/src/v8/src/arm64/disasm-arm64.cc
deleted file mode 100644
index 41c654b..0000000
--- a/src/v8/src/arm64/disasm-arm64.cc
+++ /dev/null
@@ -1,4137 +0,0 @@
-// Copyright 2013 the V8 project 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 <assert.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <string.h>
-
-#if V8_TARGET_ARCH_ARM64
-
-#include "src/arm64/decoder-arm64-inl.h"
-#include "src/arm64/disasm-arm64.h"
-#include "src/arm64/utils-arm64.h"
-#include "src/base/platform/platform.h"
-#include "src/disasm.h"
-#include "src/macro-assembler.h"
-
-namespace v8 {
-namespace internal {
-
-
-DisassemblingDecoder::DisassemblingDecoder() {
-  buffer_size_ = 256;
-  buffer_ = reinterpret_cast<char*>(malloc(buffer_size_));
-  buffer_pos_ = 0;
-  own_buffer_ = true;
-}
-
-
-DisassemblingDecoder::DisassemblingDecoder(char* text_buffer, int buffer_size) {
-  buffer_size_ = buffer_size;
-  buffer_ = text_buffer;
-  buffer_pos_ = 0;
-  own_buffer_ = false;
-}
-
-
-DisassemblingDecoder::~DisassemblingDecoder() {
-  if (own_buffer_) {
-    free(buffer_);
-  }
-}
-
-
-char* DisassemblingDecoder::GetOutput() { return buffer_; }
-
-
-void DisassemblingDecoder::VisitAddSubImmediate(Instruction* instr) {
-  bool rd_is_zr = RdIsZROrSP(instr);
-  bool stack_op = (rd_is_zr || RnIsZROrSP(instr)) &&
-                  (instr->ImmAddSub() == 0) ? true : false;
-  const char *mnemonic = "";
-  const char *form = "'Rds, 'Rns, 'IAddSub";
-  const char *form_cmp = "'Rns, 'IAddSub";
-  const char *form_mov = "'Rds, 'Rns";
-
-  switch (instr->Mask(AddSubImmediateMask)) {
-    case ADD_w_imm:
-    case ADD_x_imm: {
-      mnemonic = "add";
-      if (stack_op) {
-        mnemonic = "mov";
-        form = form_mov;
-      }
-      break;
-    }
-    case ADDS_w_imm:
-    case ADDS_x_imm: {
-      mnemonic = "adds";
-      if (rd_is_zr) {
-        mnemonic = "cmn";
-        form = form_cmp;
-      }
-      break;
-    }
-    case SUB_w_imm:
-    case SUB_x_imm: mnemonic = "sub"; break;
-    case SUBS_w_imm:
-    case SUBS_x_imm: {
-      mnemonic = "subs";
-      if (rd_is_zr) {
-        mnemonic = "cmp";
-        form = form_cmp;
-      }
-      break;
-    }
-    default: UNREACHABLE();
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitAddSubShifted(Instruction* instr) {
-  bool rd_is_zr = RdIsZROrSP(instr);
-  bool rn_is_zr = RnIsZROrSP(instr);
-  const char *mnemonic = "";
-  const char* form = "'Rd, 'Rn, 'Rm'NDP";
-  const char* form_cmp = "'Rn, 'Rm'NDP";
-  const char* form_neg = "'Rd, 'Rm'NDP";
-
-  switch (instr->Mask(AddSubShiftedMask)) {
-    case ADD_w_shift:
-    case ADD_x_shift: mnemonic = "add"; break;
-    case ADDS_w_shift:
-    case ADDS_x_shift: {
-      mnemonic = "adds";
-      if (rd_is_zr) {
-        mnemonic = "cmn";
-        form = form_cmp;
-      }
-      break;
-    }
-    case SUB_w_shift:
-    case SUB_x_shift: {
-      mnemonic = "sub";
-      if (rn_is_zr) {
-        mnemonic = "neg";
-        form = form_neg;
-      }
-      break;
-    }
-    case SUBS_w_shift:
-    case SUBS_x_shift: {
-      mnemonic = "subs";
-      if (rd_is_zr) {
-        mnemonic = "cmp";
-        form = form_cmp;
-      } else if (rn_is_zr) {
-        mnemonic = "negs";
-        form = form_neg;
-      }
-      break;
-    }
-    default: UNREACHABLE();
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitAddSubExtended(Instruction* instr) {
-  bool rd_is_zr = RdIsZROrSP(instr);
-  const char *mnemonic = "";
-  Extend mode = static_cast<Extend>(instr->ExtendMode());
-  const char *form = ((mode == UXTX) || (mode == SXTX)) ?
-                     "'Rds, 'Rns, 'Xm'Ext" : "'Rds, 'Rns, 'Wm'Ext";
-  const char *form_cmp = ((mode == UXTX) || (mode == SXTX)) ?
-                         "'Rns, 'Xm'Ext" : "'Rns, 'Wm'Ext";
-
-  switch (instr->Mask(AddSubExtendedMask)) {
-    case ADD_w_ext:
-    case ADD_x_ext: mnemonic = "add"; break;
-    case ADDS_w_ext:
-    case ADDS_x_ext: {
-      mnemonic = "adds";
-      if (rd_is_zr) {
-        mnemonic = "cmn";
-        form = form_cmp;
-      }
-      break;
-    }
-    case SUB_w_ext:
-    case SUB_x_ext: mnemonic = "sub"; break;
-    case SUBS_w_ext:
-    case SUBS_x_ext: {
-      mnemonic = "subs";
-      if (rd_is_zr) {
-        mnemonic = "cmp";
-        form = form_cmp;
-      }
-      break;
-    }
-    default: UNREACHABLE();
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitAddSubWithCarry(Instruction* instr) {
-  bool rn_is_zr = RnIsZROrSP(instr);
-  const char *mnemonic = "";
-  const char *form = "'Rd, 'Rn, 'Rm";
-  const char *form_neg = "'Rd, 'Rm";
-
-  switch (instr->Mask(AddSubWithCarryMask)) {
-    case ADC_w:
-    case ADC_x: mnemonic = "adc"; break;
-    case ADCS_w:
-    case ADCS_x: mnemonic = "adcs"; break;
-    case SBC_w:
-    case SBC_x: {
-      mnemonic = "sbc";
-      if (rn_is_zr) {
-        mnemonic = "ngc";
-        form = form_neg;
-      }
-      break;
-    }
-    case SBCS_w:
-    case SBCS_x: {
-      mnemonic = "sbcs";
-      if (rn_is_zr) {
-        mnemonic = "ngcs";
-        form = form_neg;
-      }
-      break;
-    }
-    default: UNREACHABLE();
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitLogicalImmediate(Instruction* instr) {
-  bool rd_is_zr = RdIsZROrSP(instr);
-  bool rn_is_zr = RnIsZROrSP(instr);
-  const char *mnemonic = "";
-  const char *form = "'Rds, 'Rn, 'ITri";
-
-  if (instr->ImmLogical() == 0) {
-    // The immediate encoded in the instruction is not in the expected format.
-    Format(instr, "unallocated", "(LogicalImmediate)");
-    return;
-  }
-
-  switch (instr->Mask(LogicalImmediateMask)) {
-    case AND_w_imm:
-    case AND_x_imm: mnemonic = "and"; break;
-    case ORR_w_imm:
-    case ORR_x_imm: {
-      mnemonic = "orr";
-      unsigned reg_size = (instr->SixtyFourBits() == 1) ? kXRegSizeInBits
-                                                        : kWRegSizeInBits;
-      if (rn_is_zr && !IsMovzMovnImm(reg_size, instr->ImmLogical())) {
-        mnemonic = "mov";
-        form = "'Rds, 'ITri";
-      }
-      break;
-    }
-    case EOR_w_imm:
-    case EOR_x_imm: mnemonic = "eor"; break;
-    case ANDS_w_imm:
-    case ANDS_x_imm: {
-      mnemonic = "ands";
-      if (rd_is_zr) {
-        mnemonic = "tst";
-        form = "'Rn, 'ITri";
-      }
-      break;
-    }
-    default: UNREACHABLE();
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-bool DisassemblingDecoder::IsMovzMovnImm(unsigned reg_size, uint64_t value) {
-  DCHECK((reg_size == kXRegSizeInBits) ||
-         ((reg_size == kWRegSizeInBits) && (value <= 0xFFFFFFFF)));
-
-  // Test for movz: 16-bits set at positions 0, 16, 32 or 48.
-  if (((value & 0xFFFFFFFFFFFF0000UL) == 0UL) ||
-      ((value & 0xFFFFFFFF0000FFFFUL) == 0UL) ||
-      ((value & 0xFFFF0000FFFFFFFFUL) == 0UL) ||
-      ((value & 0x0000FFFFFFFFFFFFUL) == 0UL)) {
-    return true;
-  }
-
-  // Test for movn: NOT(16-bits set at positions 0, 16, 32 or 48).
-  if ((reg_size == kXRegSizeInBits) &&
-      (((value & 0xFFFFFFFFFFFF0000UL) == 0xFFFFFFFFFFFF0000UL) ||
-       ((value & 0xFFFFFFFF0000FFFFUL) == 0xFFFFFFFF0000FFFFUL) ||
-       ((value & 0xFFFF0000FFFFFFFFUL) == 0xFFFF0000FFFFFFFFUL) ||
-       ((value & 0x0000FFFFFFFFFFFFUL) == 0x0000FFFFFFFFFFFFUL))) {
-    return true;
-  }
-  if ((reg_size == kWRegSizeInBits) && (((value & 0xFFFF0000) == 0xFFFF0000) ||
-                                        ((value & 0x0000FFFF) == 0x0000FFFF))) {
-    return true;
-  }
-  return false;
-}
-
-
-void DisassemblingDecoder::VisitLogicalShifted(Instruction* instr) {
-  bool rd_is_zr = RdIsZROrSP(instr);
-  bool rn_is_zr = RnIsZROrSP(instr);
-  const char *mnemonic = "";
-  const char* form = "'Rd, 'Rn, 'Rm'NLo";
-
-  switch (instr->Mask(LogicalShiftedMask)) {
-    case AND_w:
-    case AND_x: mnemonic = "and"; break;
-    case BIC_w:
-    case BIC_x: mnemonic = "bic"; break;
-    case EOR_w:
-    case EOR_x: mnemonic = "eor"; break;
-    case EON_w:
-    case EON_x: mnemonic = "eon"; break;
-    case BICS_w:
-    case BICS_x: mnemonic = "bics"; break;
-    case ANDS_w:
-    case ANDS_x: {
-      mnemonic = "ands";
-      if (rd_is_zr) {
-        mnemonic = "tst";
-        form = "'Rn, 'Rm'NLo";
-      }
-      break;
-    }
-    case ORR_w:
-    case ORR_x: {
-      mnemonic = "orr";
-      if (rn_is_zr && (instr->ImmDPShift() == 0) && (instr->ShiftDP() == LSL)) {
-        mnemonic = "mov";
-        form = "'Rd, 'Rm";
-      }
-      break;
-    }
-    case ORN_w:
-    case ORN_x: {
-      mnemonic = "orn";
-      if (rn_is_zr) {
-        mnemonic = "mvn";
-        form = "'Rd, 'Rm'NLo";
-      }
-      break;
-    }
-    default: UNREACHABLE();
-  }
-
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitConditionalCompareRegister(Instruction* instr) {
-  const char *mnemonic = "";
-  const char *form = "'Rn, 'Rm, 'INzcv, 'Cond";
-
-  switch (instr->Mask(ConditionalCompareRegisterMask)) {
-    case CCMN_w:
-    case CCMN_x: mnemonic = "ccmn"; break;
-    case CCMP_w:
-    case CCMP_x: mnemonic = "ccmp"; break;
-    default: UNREACHABLE();
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitConditionalCompareImmediate(
-    Instruction* instr) {
-  const char *mnemonic = "";
-  const char *form = "'Rn, 'IP, 'INzcv, 'Cond";
-
-  switch (instr->Mask(ConditionalCompareImmediateMask)) {
-    case CCMN_w_imm:
-    case CCMN_x_imm: mnemonic = "ccmn"; break;
-    case CCMP_w_imm:
-    case CCMP_x_imm: mnemonic = "ccmp"; break;
-    default: UNREACHABLE();
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitConditionalSelect(Instruction* instr) {
-  bool rnm_is_zr = (RnIsZROrSP(instr) && RmIsZROrSP(instr));
-  bool rn_is_rm = (instr->Rn() == instr->Rm());
-  const char *mnemonic = "";
-  const char *form = "'Rd, 'Rn, 'Rm, 'Cond";
-  const char *form_test = "'Rd, 'CInv";
-  const char *form_update = "'Rd, 'Rn, 'CInv";
-
-  Condition cond = static_cast<Condition>(instr->Condition());
-  bool invertible_cond = (cond != al) && (cond != nv);
-
-  switch (instr->Mask(ConditionalSelectMask)) {
-    case CSEL_w:
-    case CSEL_x: mnemonic = "csel"; break;
-    case CSINC_w:
-    case CSINC_x: {
-      mnemonic = "csinc";
-      if (rnm_is_zr && invertible_cond) {
-        mnemonic = "cset";
-        form = form_test;
-      } else if (rn_is_rm && invertible_cond) {
-        mnemonic = "cinc";
-        form = form_update;
-      }
-      break;
-    }
-    case CSINV_w:
-    case CSINV_x: {
-      mnemonic = "csinv";
-      if (rnm_is_zr && invertible_cond) {
-        mnemonic = "csetm";
-        form = form_test;
-      } else if (rn_is_rm && invertible_cond) {
-        mnemonic = "cinv";
-        form = form_update;
-      }
-      break;
-    }
-    case CSNEG_w:
-    case CSNEG_x: {
-      mnemonic = "csneg";
-      if (rn_is_rm && invertible_cond) {
-        mnemonic = "cneg";
-        form = form_update;
-      }
-      break;
-    }
-    default: UNREACHABLE();
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitBitfield(Instruction* instr) {
-  unsigned s = instr->ImmS();
-  unsigned r = instr->ImmR();
-  unsigned rd_size_minus_1 =
-    ((instr->SixtyFourBits() == 1) ? kXRegSizeInBits : kWRegSizeInBits) - 1;
-  const char *mnemonic = "";
-  const char *form = "";
-  const char *form_shift_right = "'Rd, 'Rn, 'IBr";
-  const char *form_extend = "'Rd, 'Wn";
-  const char *form_bfiz = "'Rd, 'Rn, 'IBZ-r, 'IBs+1";
-  const char *form_bfx = "'Rd, 'Rn, 'IBr, 'IBs-r+1";
-  const char *form_lsl = "'Rd, 'Rn, 'IBZ-r";
-
-  switch (instr->Mask(BitfieldMask)) {
-    case SBFM_w:
-    case SBFM_x: {
-      mnemonic = "sbfx";
-      form = form_bfx;
-      if (r == 0) {
-        form = form_extend;
-        if (s == 7) {
-          mnemonic = "sxtb";
-        } else if (s == 15) {
-          mnemonic = "sxth";
-        } else if ((s == 31) && (instr->SixtyFourBits() == 1)) {
-          mnemonic = "sxtw";
-        } else {
-          form = form_bfx;
-        }
-      } else if (s == rd_size_minus_1) {
-        mnemonic = "asr";
-        form = form_shift_right;
-      } else if (s < r) {
-        mnemonic = "sbfiz";
-        form = form_bfiz;
-      }
-      break;
-    }
-    case UBFM_w:
-    case UBFM_x: {
-      mnemonic = "ubfx";
-      form = form_bfx;
-      if (r == 0) {
-        form = form_extend;
-        if (s == 7) {
-          mnemonic = "uxtb";
-        } else if (s == 15) {
-          mnemonic = "uxth";
-        } else {
-          form = form_bfx;
-        }
-      }
-      if (s == rd_size_minus_1) {
-        mnemonic = "lsr";
-        form = form_shift_right;
-      } else if (r == s + 1) {
-        mnemonic = "lsl";
-        form = form_lsl;
-      } else if (s < r) {
-        mnemonic = "ubfiz";
-        form = form_bfiz;
-      }
-      break;
-    }
-    case BFM_w:
-    case BFM_x: {
-      mnemonic = "bfxil";
-      form = form_bfx;
-      if (s < r) {
-        mnemonic = "bfi";
-        form = form_bfiz;
-      }
-    }
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitExtract(Instruction* instr) {
-  const char *mnemonic = "";
-  const char *form = "'Rd, 'Rn, 'Rm, 'IExtract";
-
-  switch (instr->Mask(ExtractMask)) {
-    case EXTR_w:
-    case EXTR_x: {
-      if (instr->Rn() == instr->Rm()) {
-        mnemonic = "ror";
-        form = "'Rd, 'Rn, 'IExtract";
-      } else {
-        mnemonic = "extr";
-      }
-      break;
-    }
-    default: UNREACHABLE();
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitPCRelAddressing(Instruction* instr) {
-  switch (instr->Mask(PCRelAddressingMask)) {
-    case ADR: Format(instr, "adr", "'Xd, 'AddrPCRelByte"); break;
-    // ADRP is not implemented.
-    default: Format(instr, "unimplemented", "(PCRelAddressing)");
-  }
-}
-
-
-void DisassemblingDecoder::VisitConditionalBranch(Instruction* instr) {
-  switch (instr->Mask(ConditionalBranchMask)) {
-    case B_cond:
-      Format(instr, "b.'CBrn", "'TImmCond");
-      break;
-    default: UNREACHABLE();
-  }
-}
-
-
-void DisassemblingDecoder::VisitUnconditionalBranchToRegister(
-    Instruction* instr) {
-  const char *mnemonic = "unimplemented";
-  const char *form = "'Xn";
-
-  switch (instr->Mask(UnconditionalBranchToRegisterMask)) {
-    case BR: mnemonic = "br"; break;
-    case BLR: mnemonic = "blr"; break;
-    case RET: {
-      mnemonic = "ret";
-      if (instr->Rn() == kLinkRegCode) {
-        form = nullptr;
-      }
-      break;
-    }
-    default: form = "(UnconditionalBranchToRegister)";
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitUnconditionalBranch(Instruction* instr) {
-  const char *mnemonic = "";
-  const char* form = "'TImmUncn";
-
-  switch (instr->Mask(UnconditionalBranchMask)) {
-    case B: mnemonic = "b"; break;
-    case BL: mnemonic = "bl"; break;
-    default: UNREACHABLE();
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitDataProcessing1Source(Instruction* instr) {
-  const char *mnemonic = "";
-  const char *form = "'Rd, 'Rn";
-
-  switch (instr->Mask(DataProcessing1SourceMask)) {
-    #define FORMAT(A, B)  \
-    case A##_w:           \
-    case A##_x: mnemonic = B; break;
-    FORMAT(RBIT, "rbit");
-    FORMAT(REV16, "rev16");
-    FORMAT(REV, "rev");
-    FORMAT(CLZ, "clz");
-    FORMAT(CLS, "cls");
-    #undef FORMAT
-    case REV32_x: mnemonic = "rev32"; break;
-    default: UNREACHABLE();
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitDataProcessing2Source(Instruction* instr) {
-  const char *mnemonic = "unimplemented";
-  const char *form = "'Rd, 'Rn, 'Rm";
-
-  switch (instr->Mask(DataProcessing2SourceMask)) {
-    #define FORMAT(A, B)  \
-    case A##_w:           \
-    case A##_x: mnemonic = B; break;
-    FORMAT(UDIV, "udiv");
-    FORMAT(SDIV, "sdiv");
-    FORMAT(LSLV, "lsl");
-    FORMAT(LSRV, "lsr");
-    FORMAT(ASRV, "asr");
-    FORMAT(RORV, "ror");
-    #undef FORMAT
-    default: form = "(DataProcessing2Source)";
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitDataProcessing3Source(Instruction* instr) {
-  bool ra_is_zr = RaIsZROrSP(instr);
-  const char *mnemonic = "";
-  const char *form = "'Xd, 'Wn, 'Wm, 'Xa";
-  const char *form_rrr = "'Rd, 'Rn, 'Rm";
-  const char *form_rrrr = "'Rd, 'Rn, 'Rm, 'Ra";
-  const char *form_xww = "'Xd, 'Wn, 'Wm";
-  const char *form_xxx = "'Xd, 'Xn, 'Xm";
-
-  switch (instr->Mask(DataProcessing3SourceMask)) {
-    case MADD_w:
-    case MADD_x: {
-      mnemonic = "madd";
-      form = form_rrrr;
-      if (ra_is_zr) {
-        mnemonic = "mul";
-        form = form_rrr;
-      }
-      break;
-    }
-    case MSUB_w:
-    case MSUB_x: {
-      mnemonic = "msub";
-      form = form_rrrr;
-      if (ra_is_zr) {
-        mnemonic = "mneg";
-        form = form_rrr;
-      }
-      break;
-    }
-    case SMADDL_x: {
-      mnemonic = "smaddl";
-      if (ra_is_zr) {
-        mnemonic = "smull";
-        form = form_xww;
-      }
-      break;
-    }
-    case SMSUBL_x: {
-      mnemonic = "smsubl";
-      if (ra_is_zr) {
-        mnemonic = "smnegl";
-        form = form_xww;
-      }
-      break;
-    }
-    case UMADDL_x: {
-      mnemonic = "umaddl";
-      if (ra_is_zr) {
-        mnemonic = "umull";
-        form = form_xww;
-      }
-      break;
-    }
-    case UMSUBL_x: {
-      mnemonic = "umsubl";
-      if (ra_is_zr) {
-        mnemonic = "umnegl";
-        form = form_xww;
-      }
-      break;
-    }
-    case SMULH_x: {
-      mnemonic = "smulh";
-      form = form_xxx;
-      break;
-    }
-    case UMULH_x: {
-      mnemonic = "umulh";
-      form = form_xxx;
-      break;
-    }
-    default: UNREACHABLE();
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitCompareBranch(Instruction* instr) {
-  const char *mnemonic = "";
-  const char* form = "'Rt, 'TImmCmpa";
-
-  switch (instr->Mask(CompareBranchMask)) {
-    case CBZ_w:
-    case CBZ_x: mnemonic = "cbz"; break;
-    case CBNZ_w:
-    case CBNZ_x: mnemonic = "cbnz"; break;
-    default: UNREACHABLE();
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitTestBranch(Instruction* instr) {
-  const char *mnemonic = "";
-  // If the top bit of the immediate is clear, the tested register is
-  // disassembled as Wt, otherwise Xt. As the top bit of the immediate is
-  // encoded in bit 31 of the instruction, we can reuse the Rt form, which
-  // uses bit 31 (normally "sf") to choose the register size.
-  const char* form = "'Rt, 'IS, 'TImmTest";
-
-  switch (instr->Mask(TestBranchMask)) {
-    case TBZ: mnemonic = "tbz"; break;
-    case TBNZ: mnemonic = "tbnz"; break;
-    default: UNREACHABLE();
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitMoveWideImmediate(Instruction* instr) {
-  const char *mnemonic = "";
-  const char *form = "'Rd, 'IMoveImm";
-
-  // Print the shift separately for movk, to make it clear which half word will
-  // be overwritten. Movn and movz print the computed immediate, which includes
-  // shift calculation.
-  switch (instr->Mask(MoveWideImmediateMask)) {
-    case MOVN_w:
-    case MOVN_x: mnemonic = "movn"; break;
-    case MOVZ_w:
-    case MOVZ_x: mnemonic = "movz"; break;
-    case MOVK_w:
-    case MOVK_x: mnemonic = "movk"; form = "'Rd, 'IMoveLSL"; break;
-    default: UNREACHABLE();
-  }
-  Format(instr, mnemonic, form);
-}
-
-#define LOAD_STORE_LIST(V)   \
-  V(STRB_w, "strb", "'Wt")   \
-  V(STRH_w, "strh", "'Wt")   \
-  V(STR_w, "str", "'Wt")     \
-  V(STR_x, "str", "'Xt")     \
-  V(LDRB_w, "ldrb", "'Wt")   \
-  V(LDRH_w, "ldrh", "'Wt")   \
-  V(LDR_w, "ldr", "'Wt")     \
-  V(LDR_x, "ldr", "'Xt")     \
-  V(LDRSB_x, "ldrsb", "'Xt") \
-  V(LDRSH_x, "ldrsh", "'Xt") \
-  V(LDRSW_x, "ldrsw", "'Xt") \
-  V(LDRSB_w, "ldrsb", "'Wt") \
-  V(LDRSH_w, "ldrsh", "'Wt") \
-  V(STR_b, "str", "'Bt")     \
-  V(STR_h, "str", "'Ht")     \
-  V(STR_s, "str", "'St")     \
-  V(STR_d, "str", "'Dt")     \
-  V(LDR_b, "ldr", "'Bt")     \
-  V(LDR_h, "ldr", "'Ht")     \
-  V(LDR_s, "ldr", "'St")     \
-  V(LDR_d, "ldr", "'Dt")     \
-  V(STR_q, "str", "'Qt")     \
-  V(LDR_q, "ldr", "'Qt")
-
-void DisassemblingDecoder::VisitLoadStorePreIndex(Instruction* instr) {
-  const char *mnemonic = "unimplemented";
-  const char *form = "(LoadStorePreIndex)";
-
-  switch (instr->Mask(LoadStorePreIndexMask)) {
-    #define LS_PREINDEX(A, B, C) \
-    case A##_pre: mnemonic = B; form = C ", ['Xns'ILS]!"; break;
-    LOAD_STORE_LIST(LS_PREINDEX)
-    #undef LS_PREINDEX
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitLoadStorePostIndex(Instruction* instr) {
-  const char *mnemonic = "unimplemented";
-  const char *form = "(LoadStorePostIndex)";
-
-  switch (instr->Mask(LoadStorePostIndexMask)) {
-    #define LS_POSTINDEX(A, B, C) \
-    case A##_post: mnemonic = B; form = C ", ['Xns]'ILS"; break;
-    LOAD_STORE_LIST(LS_POSTINDEX)
-    #undef LS_POSTINDEX
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitLoadStoreUnsignedOffset(Instruction* instr) {
-  const char *mnemonic = "unimplemented";
-  const char *form = "(LoadStoreUnsignedOffset)";
-
-  switch (instr->Mask(LoadStoreUnsignedOffsetMask)) {
-    #define LS_UNSIGNEDOFFSET(A, B, C) \
-    case A##_unsigned: mnemonic = B; form = C ", ['Xns'ILU]"; break;
-    LOAD_STORE_LIST(LS_UNSIGNEDOFFSET)
-    #undef LS_UNSIGNEDOFFSET
-    case PRFM_unsigned: mnemonic = "prfm"; form = "'PrefOp, ['Xn'ILU]";
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitLoadStoreRegisterOffset(Instruction* instr) {
-  const char *mnemonic = "unimplemented";
-  const char *form = "(LoadStoreRegisterOffset)";
-
-  switch (instr->Mask(LoadStoreRegisterOffsetMask)) {
-    #define LS_REGISTEROFFSET(A, B, C) \
-    case A##_reg: mnemonic = B; form = C ", ['Xns, 'Offsetreg]"; break;
-    LOAD_STORE_LIST(LS_REGISTEROFFSET)
-    #undef LS_REGISTEROFFSET
-    case PRFM_reg: mnemonic = "prfm"; form = "'PrefOp, ['Xns, 'Offsetreg]";
-  }
-  Format(instr, mnemonic, form);
-}
-
-#define LOAD_STORE_UNSCALED_LIST(V) \
-  V(STURB_w, "sturb", "'Wt")        \
-  V(STURH_w, "sturh", "'Wt")        \
-  V(STUR_w, "stur", "'Wt")          \
-  V(STUR_x, "stur", "'Xt")          \
-  V(LDURB_w, "ldurb", "'Wt")        \
-  V(LDURH_w, "ldurh", "'Wt")        \
-  V(LDUR_w, "ldur", "'Wt")          \
-  V(LDUR_x, "ldur", "'Xt")          \
-  V(LDURSB_x, "ldursb", "'Xt")      \
-  V(LDURSH_x, "ldursh", "'Xt")      \
-  V(LDURSW_x, "ldursw", "'Xt")      \
-  V(LDURSB_w, "ldursb", "'Wt")      \
-  V(LDURSH_w, "ldursh", "'Wt")      \
-  V(STUR_b, "stur", "'Bt")          \
-  V(STUR_h, "stur", "'Ht")          \
-  V(STUR_s, "stur", "'St")          \
-  V(STUR_d, "stur", "'Dt")          \
-  V(LDUR_b, "ldur", "'Bt")          \
-  V(LDUR_h, "ldur", "'Ht")          \
-  V(LDUR_s, "ldur", "'St")          \
-  V(LDUR_d, "ldur", "'Dt")          \
-  V(STUR_q, "stur", "'Qt")          \
-  V(LDUR_q, "ldur", "'Qt")
-
-void DisassemblingDecoder::VisitLoadStoreUnscaledOffset(Instruction* instr) {
-  const char* mnemonic = "unimplemented";
-  const char* form = "(LoadStoreUnscaledOffset)";
-
-  switch (instr->Mask(LoadStoreUnscaledOffsetMask)) {
-#define LS_UNSCALEDOFFSET(A, B, C) \
-  case A:                          \
-    mnemonic = B;                  \
-    form = C ", ['Xns'ILS]";       \
-    break;
-    LOAD_STORE_UNSCALED_LIST(LS_UNSCALEDOFFSET)
-#undef LS_UNSCALEDOFFSET
-  }
-  Format(instr, mnemonic, form);
-}
-
-void DisassemblingDecoder::VisitLoadLiteral(Instruction* instr) {
-  const char *mnemonic = "ldr";
-  const char *form = "(LoadLiteral)";
-
-  switch (instr->Mask(LoadLiteralMask)) {
-    case LDR_w_lit: form = "'Wt, 'ILLiteral 'LValue"; break;
-    case LDR_x_lit: form = "'Xt, 'ILLiteral 'LValue"; break;
-    case LDR_s_lit: form = "'St, 'ILLiteral 'LValue"; break;
-    case LDR_d_lit: form = "'Dt, 'ILLiteral 'LValue"; break;
-    default: mnemonic = "unimplemented";
-  }
-  Format(instr, mnemonic, form);
-}
-
-#define LOAD_STORE_PAIR_LIST(V)         \
-  V(STP_w, "stp", "'Wt, 'Wt2", "2")     \
-  V(LDP_w, "ldp", "'Wt, 'Wt2", "2")     \
-  V(LDPSW_x, "ldpsw", "'Xt, 'Xt2", "2") \
-  V(STP_x, "stp", "'Xt, 'Xt2", "3")     \
-  V(LDP_x, "ldp", "'Xt, 'Xt2", "3")     \
-  V(STP_s, "stp", "'St, 'St2", "2")     \
-  V(LDP_s, "ldp", "'St, 'St2", "2")     \
-  V(STP_d, "stp", "'Dt, 'Dt2", "3")     \
-  V(LDP_d, "ldp", "'Dt, 'Dt2", "3")     \
-  V(LDP_q, "ldp", "'Qt, 'Qt2", "4")     \
-  V(STP_q, "stp", "'Qt, 'Qt2", "4")
-
-void DisassemblingDecoder::VisitLoadStorePairPostIndex(Instruction* instr) {
-  const char *mnemonic = "unimplemented";
-  const char *form = "(LoadStorePairPostIndex)";
-
-  switch (instr->Mask(LoadStorePairPostIndexMask)) {
-    #define LSP_POSTINDEX(A, B, C, D) \
-    case A##_post: mnemonic = B; form = C ", ['Xns]'ILP" D; break;
-    LOAD_STORE_PAIR_LIST(LSP_POSTINDEX)
-    #undef LSP_POSTINDEX
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitLoadStorePairPreIndex(Instruction* instr) {
-  const char *mnemonic = "unimplemented";
-  const char *form = "(LoadStorePairPreIndex)";
-
-  switch (instr->Mask(LoadStorePairPreIndexMask)) {
-    #define LSP_PREINDEX(A, B, C, D) \
-    case A##_pre: mnemonic = B; form = C ", ['Xns'ILP" D "]!"; break;
-    LOAD_STORE_PAIR_LIST(LSP_PREINDEX)
-    #undef LSP_PREINDEX
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitLoadStorePairOffset(Instruction* instr) {
-  const char *mnemonic = "unimplemented";
-  const char *form = "(LoadStorePairOffset)";
-
-  switch (instr->Mask(LoadStorePairOffsetMask)) {
-    #define LSP_OFFSET(A, B, C, D) \
-    case A##_off: mnemonic = B; form = C ", ['Xns'ILP" D "]"; break;
-    LOAD_STORE_PAIR_LIST(LSP_OFFSET)
-    #undef LSP_OFFSET
-  }
-  Format(instr, mnemonic, form);
-}
-
-void DisassemblingDecoder::VisitLoadStoreAcquireRelease(Instruction *instr) {
-  const char *mnemonic = "unimplemented";
-  const char* form = "'Wt, ['Xns]";
-  const char* form_x = "'Xt, ['Xns]";
-  const char* form_stlx = "'Ws, 'Wt, ['Xns]";
-  const char* form_stlx_x = "'Ws, 'Xt, ['Xns]";
-
-  switch (instr->Mask(LoadStoreAcquireReleaseMask)) {
-    case LDAXR_b: mnemonic = "ldaxrb"; break;
-    case STLR_b:  mnemonic = "stlrb"; break;
-    case LDAR_b:  mnemonic = "ldarb"; break;
-    case LDAXR_h: mnemonic = "ldaxrh"; break;
-    case STLR_h:  mnemonic = "stlrh"; break;
-    case LDAR_h:  mnemonic = "ldarh"; break;
-    case LDAXR_w: mnemonic = "ldaxr"; break;
-    case STLR_w:  mnemonic = "stlr"; break;
-    case LDAR_w:  mnemonic = "ldar"; break;
-    case LDAXR_x: mnemonic = "ldaxr"; form = form_x; break;
-    case STLR_x:  mnemonic = "stlr"; form = form_x; break;
-    case LDAR_x:  mnemonic = "ldar"; form = form_x; break;
-    case STLXR_h: mnemonic = "stlxrh"; form = form_stlx; break;
-    case STLXR_b: mnemonic = "stlxrb"; form = form_stlx; break;
-    case STLXR_w: mnemonic = "stlxr"; form = form_stlx; break;
-    case STLXR_x: mnemonic = "stlxr"; form = form_stlx_x; break;
-    default:
-      form = "(LoadStoreAcquireRelease)";
-  }
-  Format(instr, mnemonic, form);
-}
-
-void DisassemblingDecoder::VisitFPCompare(Instruction* instr) {
-  const char *mnemonic = "unimplemented";
-  const char *form = "'Fn, 'Fm";
-  const char *form_zero = "'Fn, #0.0";
-
-  switch (instr->Mask(FPCompareMask)) {
-    case FCMP_s_zero:
-    case FCMP_d_zero: form = form_zero;  // Fall through.
-    case FCMP_s:
-    case FCMP_d: mnemonic = "fcmp"; break;
-    default: form = "(FPCompare)";
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitFPConditionalCompare(Instruction* instr) {
-  const char *mnemonic = "unimplemented";
-  const char *form = "'Fn, 'Fm, 'INzcv, 'Cond";
-
-  switch (instr->Mask(FPConditionalCompareMask)) {
-    case FCCMP_s:
-    case FCCMP_d: mnemonic = "fccmp"; break;
-    case FCCMPE_s:
-    case FCCMPE_d: mnemonic = "fccmpe"; break;
-    default: form = "(FPConditionalCompare)";
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitFPConditionalSelect(Instruction* instr) {
-  const char *mnemonic = "";
-  const char *form = "'Fd, 'Fn, 'Fm, 'Cond";
-
-  switch (instr->Mask(FPConditionalSelectMask)) {
-    case FCSEL_s:
-    case FCSEL_d: mnemonic = "fcsel"; break;
-    default: UNREACHABLE();
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitFPDataProcessing1Source(Instruction* instr) {
-  const char *mnemonic = "unimplemented";
-  const char *form = "'Fd, 'Fn";
-
-  switch (instr->Mask(FPDataProcessing1SourceMask)) {
-    #define FORMAT(A, B)  \
-    case A##_s:           \
-    case A##_d: mnemonic = B; break;
-    FORMAT(FMOV, "fmov");
-    FORMAT(FABS, "fabs");
-    FORMAT(FNEG, "fneg");
-    FORMAT(FSQRT, "fsqrt");
-    FORMAT(FRINTN, "frintn");
-    FORMAT(FRINTP, "frintp");
-    FORMAT(FRINTM, "frintm");
-    FORMAT(FRINTZ, "frintz");
-    FORMAT(FRINTA, "frinta");
-    FORMAT(FRINTX, "frintx");
-    FORMAT(FRINTI, "frinti");
-    #undef FORMAT
-    case FCVT_ds: mnemonic = "fcvt"; form = "'Dd, 'Sn"; break;
-    case FCVT_sd: mnemonic = "fcvt"; form = "'Sd, 'Dn"; break;
-    case FCVT_hs:
-      mnemonic = "fcvt";
-      form = "'Hd, 'Sn";
-      break;
-    case FCVT_sh:
-      mnemonic = "fcvt";
-      form = "'Sd, 'Hn";
-      break;
-    case FCVT_dh:
-      mnemonic = "fcvt";
-      form = "'Dd, 'Hn";
-      break;
-    case FCVT_hd:
-      mnemonic = "fcvt";
-      form = "'Hd, 'Dn";
-      break;
-    default: form = "(FPDataProcessing1Source)";
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitFPDataProcessing2Source(Instruction* instr) {
-  const char *mnemonic = "";
-  const char *form = "'Fd, 'Fn, 'Fm";
-
-  switch (instr->Mask(FPDataProcessing2SourceMask)) {
-    #define FORMAT(A, B)  \
-    case A##_s:           \
-    case A##_d: mnemonic = B; break;
-    FORMAT(FMUL, "fmul");
-    FORMAT(FDIV, "fdiv");
-    FORMAT(FADD, "fadd");
-    FORMAT(FSUB, "fsub");
-    FORMAT(FMAX, "fmax");
-    FORMAT(FMIN, "fmin");
-    FORMAT(FMAXNM, "fmaxnm");
-    FORMAT(FMINNM, "fminnm");
-    FORMAT(FNMUL, "fnmul");
-    #undef FORMAT
-    default: UNREACHABLE();
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitFPDataProcessing3Source(Instruction* instr) {
-  const char *mnemonic = "";
-  const char *form = "'Fd, 'Fn, 'Fm, 'Fa";
-
-  switch (instr->Mask(FPDataProcessing3SourceMask)) {
-    #define FORMAT(A, B)  \
-    case A##_s:           \
-    case A##_d: mnemonic = B; break;
-    FORMAT(FMADD, "fmadd");
-    FORMAT(FMSUB, "fmsub");
-    FORMAT(FNMADD, "fnmadd");
-    FORMAT(FNMSUB, "fnmsub");
-    #undef FORMAT
-    default: UNREACHABLE();
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitFPImmediate(Instruction* instr) {
-  const char *mnemonic = "";
-  const char *form = "(FPImmediate)";
-
-  switch (instr->Mask(FPImmediateMask)) {
-    case FMOV_s_imm: mnemonic = "fmov"; form = "'Sd, 'IFPSingle"; break;
-    case FMOV_d_imm: mnemonic = "fmov"; form = "'Dd, 'IFPDouble"; break;
-    default: UNREACHABLE();
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitFPIntegerConvert(Instruction* instr) {
-  const char *mnemonic = "unimplemented";
-  const char *form = "(FPIntegerConvert)";
-  const char *form_rf = "'Rd, 'Fn";
-  const char *form_fr = "'Fd, 'Rn";
-
-  switch (instr->Mask(FPIntegerConvertMask)) {
-    case FMOV_ws:
-    case FMOV_xd: mnemonic = "fmov"; form = form_rf; break;
-    case FMOV_sw:
-    case FMOV_dx: mnemonic = "fmov"; form = form_fr; break;
-    case FMOV_d1_x:
-      mnemonic = "fmov";
-      form = "'Vd.D[1], 'Rn";
-      break;
-    case FMOV_x_d1:
-      mnemonic = "fmov";
-      form = "'Rd, 'Vn.D[1]";
-      break;
-    case FCVTAS_ws:
-    case FCVTAS_xs:
-    case FCVTAS_wd:
-    case FCVTAS_xd: mnemonic = "fcvtas"; form = form_rf; break;
-    case FCVTAU_ws:
-    case FCVTAU_xs:
-    case FCVTAU_wd:
-    case FCVTAU_xd: mnemonic = "fcvtau"; form = form_rf; break;
-    case FCVTMS_ws:
-    case FCVTMS_xs:
-    case FCVTMS_wd:
-    case FCVTMS_xd: mnemonic = "fcvtms"; form = form_rf; break;
-    case FCVTMU_ws:
-    case FCVTMU_xs:
-    case FCVTMU_wd:
-    case FCVTMU_xd: mnemonic = "fcvtmu"; form = form_rf; break;
-    case FCVTNS_ws:
-    case FCVTNS_xs:
-    case FCVTNS_wd:
-    case FCVTNS_xd: mnemonic = "fcvtns"; form = form_rf; break;
-    case FCVTNU_ws:
-    case FCVTNU_xs:
-    case FCVTNU_wd:
-    case FCVTNU_xd: mnemonic = "fcvtnu"; form = form_rf; break;
-    case FCVTZU_xd:
-    case FCVTZU_ws:
-    case FCVTZU_wd:
-    case FCVTZU_xs: mnemonic = "fcvtzu"; form = form_rf; break;
-    case FCVTZS_xd:
-    case FCVTZS_wd:
-    case FCVTZS_xs:
-    case FCVTZS_ws: mnemonic = "fcvtzs"; form = form_rf; break;
-    case FCVTPU_xd:
-    case FCVTPU_ws:
-    case FCVTPU_wd:
-    case FCVTPU_xs:
-      mnemonic = "fcvtpu";
-      form = form_rf;
-      break;
-    case FCVTPS_xd:
-    case FCVTPS_wd:
-    case FCVTPS_xs:
-    case FCVTPS_ws:
-      mnemonic = "fcvtps";
-      form = form_rf;
-      break;
-    case SCVTF_sw:
-    case SCVTF_sx:
-    case SCVTF_dw:
-    case SCVTF_dx: mnemonic = "scvtf"; form = form_fr; break;
-    case UCVTF_sw:
-    case UCVTF_sx:
-    case UCVTF_dw:
-    case UCVTF_dx: mnemonic = "ucvtf"; form = form_fr; break;
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitFPFixedPointConvert(Instruction* instr) {
-  const char *mnemonic = "";
-  const char *form = "'Rd, 'Fn, 'IFPFBits";
-  const char *form_fr = "'Fd, 'Rn, 'IFPFBits";
-
-  switch (instr->Mask(FPFixedPointConvertMask)) {
-    case FCVTZS_ws_fixed:
-    case FCVTZS_xs_fixed:
-    case FCVTZS_wd_fixed:
-    case FCVTZS_xd_fixed: mnemonic = "fcvtzs"; break;
-    case FCVTZU_ws_fixed:
-    case FCVTZU_xs_fixed:
-    case FCVTZU_wd_fixed:
-    case FCVTZU_xd_fixed: mnemonic = "fcvtzu"; break;
-    case SCVTF_sw_fixed:
-    case SCVTF_sx_fixed:
-    case SCVTF_dw_fixed:
-    case SCVTF_dx_fixed: mnemonic = "scvtf"; form = form_fr; break;
-    case UCVTF_sw_fixed:
-    case UCVTF_sx_fixed:
-    case UCVTF_dw_fixed:
-    case UCVTF_dx_fixed: mnemonic = "ucvtf"; form = form_fr; break;
-  }
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitSystem(Instruction* instr) {
-  // Some system instructions hijack their Op and Cp fields to represent a
-  // range of immediates instead of indicating a different instruction. This
-  // makes the decoding tricky.
-  const char *mnemonic = "unimplemented";
-  const char *form = "(System)";
-
-  if (instr->Mask(SystemSysRegFMask) == SystemSysRegFixed) {
-    switch (instr->Mask(SystemSysRegMask)) {
-      case MRS: {
-        mnemonic = "mrs";
-        switch (instr->ImmSystemRegister()) {
-          case NZCV: form = "'Xt, nzcv"; break;
-          case FPCR: form = "'Xt, fpcr"; break;
-          default: form = "'Xt, (unknown)"; break;
-        }
-        break;
-      }
-      case MSR: {
-        mnemonic = "msr";
-        switch (instr->ImmSystemRegister()) {
-          case NZCV: form = "nzcv, 'Xt"; break;
-          case FPCR: form = "fpcr, 'Xt"; break;
-          default: form = "(unknown), 'Xt"; break;
-        }
-        break;
-      }
-    }
-  } else if (instr->Mask(SystemHintFMask) == SystemHintFixed) {
-    DCHECK(instr->Mask(SystemHintMask) == HINT);
-    switch (instr->ImmHint()) {
-      case NOP: {
-        mnemonic = "nop";
-        form = nullptr;
-        break;
-      }
-    }
-  } else if (instr->Mask(MemBarrierFMask) == MemBarrierFixed) {
-    switch (instr->Mask(MemBarrierMask)) {
-      case DMB: {
-        mnemonic = "dmb";
-        form = "'M";
-        break;
-      }
-      case DSB: {
-        mnemonic = "dsb";
-        form = "'M";
-        break;
-      }
-      case ISB: {
-        mnemonic = "isb";
-        form = nullptr;
-        break;
-      }
-    }
-  }
-
-  Format(instr, mnemonic, form);
-}
-
-
-void DisassemblingDecoder::VisitException(Instruction* instr) {
-  const char *mnemonic = "unimplemented";
-  const char *form = "'IDebug";
-
-  switch (instr->Mask(ExceptionMask)) {
-    case HLT: mnemonic = "hlt"; break;
-    case BRK: mnemonic = "brk"; break;
-    case SVC: mnemonic = "svc"; break;
-    case HVC: mnemonic = "hvc"; break;
-    case SMC: mnemonic = "smc"; break;
-    case DCPS1: mnemonic = "dcps1"; form = "{'IDebug}"; break;
-    case DCPS2: mnemonic = "dcps2"; form = "{'IDebug}"; break;
-    case DCPS3: mnemonic = "dcps3"; form = "{'IDebug}"; break;
-    default: form = "(Exception)";
-  }
-  Format(instr, mnemonic, form);
-}
-
-void DisassemblingDecoder::VisitNEON3Same(Instruction* instr) {
-  const char* mnemonic = "unimplemented";
-  const char* form = "'Vd.%s, 'Vn.%s, 'Vm.%s";
-  NEONFormatDecoder nfd(instr);
-
-  if (instr->Mask(NEON3SameLogicalFMask) == NEON3SameLogicalFixed) {
-    switch (instr->Mask(NEON3SameLogicalMask)) {
-      case NEON_AND:
-        mnemonic = "and";
-        break;
-      case NEON_ORR:
-        mnemonic = "orr";
-        if (instr->Rm() == instr->Rn()) {
-          mnemonic = "mov";
-          form = "'Vd.%s, 'Vn.%s";
-        }
-        break;
-      case NEON_ORN:
-        mnemonic = "orn";
-        break;
-      case NEON_EOR:
-        mnemonic = "eor";
-        break;
-      case NEON_BIC:
-        mnemonic = "bic";
-        break;
-      case NEON_BIF:
-        mnemonic = "bif";
-        break;
-      case NEON_BIT:
-        mnemonic = "bit";
-        break;
-      case NEON_BSL:
-        mnemonic = "bsl";
-        break;
-      default:
-        form = "(NEON3Same)";
-    }
-    nfd.SetFormatMaps(nfd.LogicalFormatMap());
-  } else {
-    static const char* mnemonics[] = {
-        "shadd",       "uhadd",       "shadd",       "uhadd",
-        "sqadd",       "uqadd",       "sqadd",       "uqadd",
-        "srhadd",      "urhadd",      "srhadd",      "urhadd",
-        nullptr,       nullptr,       nullptr,
-        nullptr,  // Handled by logical cases above.
-        "shsub",       "uhsub",       "shsub",       "uhsub",
-        "sqsub",       "uqsub",       "sqsub",       "uqsub",
-        "cmgt",        "cmhi",        "cmgt",        "cmhi",
-        "cmge",        "cmhs",        "cmge",        "cmhs",
-        "sshl",        "ushl",        "sshl",        "ushl",
-        "sqshl",       "uqshl",       "sqshl",       "uqshl",
-        "srshl",       "urshl",       "srshl",       "urshl",
-        "sqrshl",      "uqrshl",      "sqrshl",      "uqrshl",
-        "smax",        "umax",        "smax",        "umax",
-        "smin",        "umin",        "smin",        "umin",
-        "sabd",        "uabd",        "sabd",        "uabd",
-        "saba",        "uaba",        "saba",        "uaba",
-        "add",         "sub",         "add",         "sub",
-        "cmtst",       "cmeq",        "cmtst",       "cmeq",
-        "mla",         "mls",         "mla",         "mls",
-        "mul",         "pmul",        "mul",         "pmul",
-        "smaxp",       "umaxp",       "smaxp",       "umaxp",
-        "sminp",       "uminp",       "sminp",       "uminp",
-        "sqdmulh",     "sqrdmulh",    "sqdmulh",     "sqrdmulh",
-        "addp",        "unallocated", "addp",        "unallocated",
-        "fmaxnm",      "fmaxnmp",     "fminnm",      "fminnmp",
-        "fmla",        "unallocated", "fmls",        "unallocated",
-        "fadd",        "faddp",       "fsub",        "fabd",
-        "fmulx",       "fmul",        "unallocated", "unallocated",
-        "fcmeq",       "fcmge",       "unallocated", "fcmgt",
-        "unallocated", "facge",       "unallocated", "facgt",
-        "fmax",        "fmaxp",       "fmin",        "fminp",
-        "frecps",      "fdiv",        "frsqrts",     "unallocated"};
-
-    // Operation is determined by the opcode bits (15-11), the top bit of
-    // size (23) and the U bit (29).
-    unsigned index =
-        (instr->Bits(15, 11) << 2) | (instr->Bit(23) << 1) | instr->Bit(29);
-    DCHECK_LT(index, arraysize(mnemonics));
-    mnemonic = mnemonics[index];
-    // Assert that index is not one of the previously handled logical
-    // instructions.
-    DCHECK_NOT_NULL(mnemonic);
-
-    if (instr->Mask(NEON3SameFPFMask) == NEON3SameFPFixed) {
-      nfd.SetFormatMaps(nfd.FPFormatMap());
-    }
-  }
-  Format(instr, mnemonic, nfd.Substitute(form));
-}
-
-void DisassemblingDecoder::VisitNEON2RegMisc(Instruction* instr) {
-  const char* mnemonic = "unimplemented";
-  const char* form = "'Vd.%s, 'Vn.%s";
-  const char* form_cmp_zero = "'Vd.%s, 'Vn.%s, #0";
-  const char* form_fcmp_zero = "'Vd.%s, 'Vn.%s, #0.0";
-  NEONFormatDecoder nfd(instr);
-
-  static const NEONFormatMap map_lp_ta = {
-      {23, 22, 30}, {NF_4H, NF_8H, NF_2S, NF_4S, NF_1D, NF_2D}};
-
-  static const NEONFormatMap map_cvt_ta = {{22}, {NF_4S, NF_2D}};
-
-  static const NEONFormatMap map_cvt_tb = {{22, 30},
-                                           {NF_4H, NF_8H, NF_2S, NF_4S}};
-
-  if (instr->Mask(NEON2RegMiscOpcode) <= NEON_NEG_opcode) {
-    // These instructions all use a two bit size field, except NOT and RBIT,
-    // which use the field to encode the operation.
-    switch (instr->Mask(NEON2RegMiscMask)) {
-      case NEON_REV64:
-        mnemonic = "rev64";
-        break;
-      case NEON_REV32:
-        mnemonic = "rev32";
-        break;
-      case NEON_REV16:
-        mnemonic = "rev16";
-        break;
-      case NEON_SADDLP:
-        mnemonic = "saddlp";
-        nfd.SetFormatMap(0, &map_lp_ta);
-        break;
-      case NEON_UADDLP:
-        mnemonic = "uaddlp";
-        nfd.SetFormatMap(0, &map_lp_ta);
-        break;
-      case NEON_SUQADD:
-        mnemonic = "suqadd";
-        break;
-      case NEON_USQADD:
-        mnemonic = "usqadd";
-        break;
-      case NEON_CLS:
-        mnemonic = "cls";
-        break;
-      case NEON_CLZ:
-        mnemonic = "clz";
-        break;
-      case NEON_CNT:
-        mnemonic = "cnt";
-        break;
-      case NEON_SADALP:
-        mnemonic = "sadalp";
-        nfd.SetFormatMap(0, &map_lp_ta);
-        break;
-      case NEON_UADALP:
-        mnemonic = "uadalp";
-        nfd.SetFormatMap(0, &map_lp_ta);
-        break;
-      case NEON_SQABS:
-        mnemonic = "sqabs";
-        break;
-      case NEON_SQNEG:
-        mnemonic = "sqneg";
-        break;
-      case NEON_CMGT_zero:
-        mnemonic = "cmgt";
-        form = form_cmp_zero;
-        break;
-      case NEON_CMGE_zero:
-        mnemonic = "cmge";
-        form = form_cmp_zero;
-        break;
-      case NEON_CMEQ_zero:
-        mnemonic = "cmeq";
-        form = form_cmp_zero;
-        break;
-      case NEON_CMLE_zero:
-        mnemonic = "cmle";
-        form = form_cmp_zero;
-        break;
-      case NEON_CMLT_zero:
-        mnemonic = "cmlt";
-        form = form_cmp_zero;
-        break;
-      case NEON_ABS:
-        mnemonic = "abs";
-        break;
-      case NEON_NEG:
-        mnemonic = "neg";
-        break;
-      case NEON_RBIT_NOT:
-        switch (instr->FPType()) {
-          case 0:
-            mnemonic = "mvn";
-            break;
-          case 1:
-            mnemonic = "rbit";
-            break;
-          default:
-            form = "(NEON2RegMisc)";
-        }
-        nfd.SetFormatMaps(nfd.LogicalFormatMap());
-        break;
-    }
-  } else {
-    // These instructions all use a one bit size field, except XTN, SQXTUN,
-    // SHLL, SQXTN and UQXTN, which use a two bit size field.
-    nfd.SetFormatMaps(nfd.FPFormatMap());
-    switch (instr->Mask(NEON2RegMiscFPMask)) {
-      case NEON_FABS:
-        mnemonic = "fabs";
-        break;
-      case NEON_FNEG:
-        mnemonic = "fneg";
-        break;
-      case NEON_FCVTN:
-        mnemonic = instr->Mask(NEON_Q) ? "fcvtn2" : "fcvtn";
-        nfd.SetFormatMap(0, &map_cvt_tb);
-        nfd.SetFormatMap(1, &map_cvt_ta);
-        break;
-      case NEON_FCVTXN:
-        mnemonic = instr->Mask(NEON_Q) ? "fcvtxn2" : "fcvtxn";
-        nfd.SetFormatMap(0, &map_cvt_tb);
-        nfd.SetFormatMap(1, &map_cvt_ta);
-        break;
-      case NEON_FCVTL:
-        mnemonic = instr->Mask(NEON_Q) ? "fcvtl2" : "fcvtl";
-        nfd.SetFormatMap(0, &map_cvt_ta);
-        nfd.SetFormatMap(1, &map_cvt_tb);
-        break;
-      case NEON_FRINTN:
-        mnemonic = "frintn";
-        break;
-      case NEON_FRINTA:
-        mnemonic = "frinta";
-        break;
-      case NEON_FRINTP:
-        mnemonic = "frintp";
-        break;
-      case NEON_FRINTM:
-        mnemonic = "frintm";
-        break;
-      case NEON_FRINTX:
-        mnemonic = "frintx";
-        break;
-      case NEON_FRINTZ:
-        mnemonic = "frintz";
-        break;
-      case NEON_FRINTI:
-        mnemonic = "frinti";
-        break;
-      case NEON_FCVTNS:
-        mnemonic = "fcvtns";
-        break;
-      case NEON_FCVTNU:
-        mnemonic = "fcvtnu";
-        break;
-      case NEON_FCVTPS:
-        mnemonic = "fcvtps";
-        break;
-      case NEON_FCVTPU:
-        mnemonic = "fcvtpu";
-        break;
-      case NEON_FCVTMS:
-        mnemonic = "fcvtms";
-        break;
-      case NEON_FCVTMU:
-        mnemonic = "fcvtmu";
-        break;
-      case NEON_FCVTZS:
-        mnemonic = "fcvtzs";
-        break;
-      case NEON_FCVTZU:
-        mnemonic = "fcvtzu";
-        break;
-      case NEON_FCVTAS:
-        mnemonic = "fcvtas";
-        break;
-      case NEON_FCVTAU:
-        mnemonic = "fcvtau";
-        break;
-      case NEON_FSQRT:
-        mnemonic = "fsqrt";
-        break;
-      case NEON_SCVTF:
-        mnemonic = "scvtf";
-        break;
-      case NEON_UCVTF:
-        mnemonic = "ucvtf";
-        break;
-      case NEON_URSQRTE:
-        mnemonic = "ursqrte";
-        break;
-      case NEON_URECPE:
-        mnemonic = "urecpe";
-        break;
-      case NEON_FRSQRTE:
-        mnemonic = "frsqrte";
-        break;
-      case NEON_FRECPE:
-        mnemonic = "frecpe";
-        break;
-      case NEON_FCMGT_zero:
-        mnemonic = "fcmgt";
-        form = form_fcmp_zero;
-        break;
-      case NEON_FCMGE_zero:
-        mnemonic = "fcmge";
-        form = form_fcmp_zero;
-        break;
-      case NEON_FCMEQ_zero:
-        mnemonic = "fcmeq";
-        form = form_fcmp_zero;
-        break;
-      case NEON_FCMLE_zero:
-        mnemonic = "fcmle";
-        form = form_fcmp_zero;
-        break;
-      case NEON_FCMLT_zero:
-        mnemonic = "fcmlt";
-        form = form_fcmp_zero;
-        break;
-      default:
-        if ((NEON_XTN_opcode <= instr->Mask(NEON2RegMiscOpcode)) &&
-            (instr->Mask(NEON2RegMiscOpcode) <= NEON_UQXTN_opcode)) {
-          nfd.SetFormatMap(0, nfd.IntegerFormatMap());
-          nfd.SetFormatMap(1, nfd.LongIntegerFormatMap());
-
-          switch (instr->Mask(NEON2RegMiscMask)) {
-            case NEON_XTN:
-              mnemonic = "xtn";
-              break;
-            case NEON_SQXTN:
-              mnemonic = "sqxtn";
-              break;
-            case NEON_UQXTN:
-              mnemonic = "uqxtn";
-              break;
-            case NEON_SQXTUN:
-              mnemonic = "sqxtun";
-              break;
-            case NEON_SHLL:
-              mnemonic = "shll";
-              nfd.SetFormatMap(0, nfd.LongIntegerFormatMap());
-              nfd.SetFormatMap(1, nfd.IntegerFormatMap());
-              switch (instr->NEONSize()) {
-                case 0:
-                  form = "'Vd.%s, 'Vn.%s, #8";
-                  break;
-                case 1:
-                  form = "'Vd.%s, 'Vn.%s, #16";
-                  break;
-                case 2:
-                  form = "'Vd.%s, 'Vn.%s, #32";
-                  break;
-                default:
-                  Format(instr, "unallocated", "(NEON2RegMisc)");
-                  return;
-              }
-          }
-          Format(instr, nfd.Mnemonic(mnemonic), nfd.Substitute(form));
-          return;
-        } else {
-          form = "(NEON2RegMisc)";
-        }
-    }
-  }
-  Format(instr, mnemonic, nfd.Substitute(form));
-}
-
-void DisassemblingDecoder::VisitNEON3Different(Instruction* instr) {
-  const char* mnemonic = "unimplemented";
-  const char* form = "'Vd.%s, 'Vn.%s, 'Vm.%s";
-
-  NEONFormatDecoder nfd(instr);
-  nfd.SetFormatMap(0, nfd.LongIntegerFormatMap());
-
-  // Ignore the Q bit. Appending a "2" suffix is handled later.
-  switch (instr->Mask(NEON3DifferentMask) & ~NEON_Q) {
-    case NEON_PMULL:
-      mnemonic = "pmull";
-      break;
-    case NEON_SABAL:
-      mnemonic = "sabal";
-      break;
-    case NEON_SABDL:
-      mnemonic = "sabdl";
-      break;
-    case NEON_SADDL:
-      mnemonic = "saddl";
-      break;
-    case NEON_SMLAL:
-      mnemonic = "smlal";
-      break;
-    case NEON_SMLSL:
-      mnemonic = "smlsl";
-      break;
-    case NEON_SMULL:
-      mnemonic = "smull";
-      break;
-    case NEON_SSUBL:
-      mnemonic = "ssubl";
-      break;
-    case NEON_SQDMLAL:
-      mnemonic = "sqdmlal";
-      break;
-    case NEON_SQDMLSL:
-      mnemonic = "sqdmlsl";
-      break;
-    case NEON_SQDMULL:
-      mnemonic = "sqdmull";
-      break;
-    case NEON_UABAL:
-      mnemonic = "uabal";
-      break;
-    case NEON_UABDL:
-      mnemonic = "uabdl";
-      break;
-    case NEON_UADDL:
-      mnemonic = "uaddl";
-      break;
-    case NEON_UMLAL:
-      mnemonic = "umlal";
-      break;
-    case NEON_UMLSL:
-      mnemonic = "umlsl";
-      break;
-    case NEON_UMULL:
-      mnemonic = "umull";
-      break;
-    case NEON_USUBL:
-      mnemonic = "usubl";
-      break;
-    case NEON_SADDW:
-      mnemonic = "saddw";
-      nfd.SetFormatMap(1, nfd.LongIntegerFormatMap());
-      break;
-    case NEON_SSUBW:
-      mnemonic = "ssubw";
-      nfd.SetFormatMap(1, nfd.LongIntegerFormatMap());
-      break;
-    case NEON_UADDW:
-      mnemonic = "uaddw";
-      nfd.SetFormatMap(1, nfd.LongIntegerFormatMap());
-      break;
-    case NEON_USUBW:
-      mnemonic = "usubw";
-      nfd.SetFormatMap(1, nfd.LongIntegerFormatMap());
-      break;
-    case NEON_ADDHN:
-      mnemonic = "addhn";
-      nfd.SetFormatMaps(nfd.LongIntegerFormatMap());
-      nfd.SetFormatMap(0, nfd.IntegerFormatMap());
-      break;
-    case NEON_RADDHN:
-      mnemonic = "raddhn";
-      nfd.SetFormatMaps(nfd.LongIntegerFormatMap());
-      nfd.SetFormatMap(0, nfd.IntegerFormatMap());
-      break;
-    case NEON_RSUBHN:
-      mnemonic = "rsubhn";
-      nfd.SetFormatMaps(nfd.LongIntegerFormatMap());
-      nfd.SetFormatMap(0, nfd.IntegerFormatMap());
-      break;
-    case NEON_SUBHN:
-      mnemonic = "subhn";
-      nfd.SetFormatMaps(nfd.LongIntegerFormatMap());
-      nfd.SetFormatMap(0, nfd.IntegerFormatMap());
-      break;
-    default:
-      form = "(NEON3Different)";
-  }
-  Format(instr, nfd.Mnemonic(mnemonic), nfd.Substitute(form));
-}
-
-void DisassemblingDecoder::VisitNEONAcrossLanes(Instruction* instr) {
-  const char* mnemonic = "unimplemented";
-  const char* form = "%sd, 'Vn.%s";
-
-  NEONFormatDecoder nfd(instr, NEONFormatDecoder::ScalarFormatMap(),
-                        NEONFormatDecoder::IntegerFormatMap());
-
-  if (instr->Mask(NEONAcrossLanesFPFMask) == NEONAcrossLanesFPFixed) {
-    nfd.SetFormatMap(0, nfd.FPScalarFormatMap());
-    nfd.SetFormatMap(1, nfd.FPFormatMap());
-    switch (instr->Mask(NEONAcrossLanesFPMask)) {
-      case NEON_FMAXV:
-        mnemonic = "fmaxv";
-        break;
-      case NEON_FMINV:
-        mnemonic = "fminv";
-        break;
-      case NEON_FMAXNMV:
-        mnemonic = "fmaxnmv";
-        break;
-      case NEON_FMINNMV:
-        mnemonic = "fminnmv";
-        break;
-      default:
-        form = "(NEONAcrossLanes)";
-        break;
-    }
-  } else if (instr->Mask(NEONAcrossLanesFMask) == NEONAcrossLanesFixed) {
-    switch (instr->Mask(NEONAcrossLanesMask)) {
-      case NEON_ADDV:
-        mnemonic = "addv";
-        break;
-      case NEON_SMAXV:
-        mnemonic = "smaxv";
-        break;
-      case NEON_SMINV:
-        mnemonic = "sminv";
-        break;
-      case NEON_UMAXV:
-        mnemonic = "umaxv";
-        break;
-      case NEON_UMINV:
-        mnemonic = "uminv";
-        break;
-      case NEON_SADDLV:
-        mnemonic = "saddlv";
-        nfd.SetFormatMap(0, nfd.LongScalarFormatMap());
-        break;
-      case NEON_UADDLV:
-        mnemonic = "uaddlv";
-        nfd.SetFormatMap(0, nfd.LongScalarFormatMap());
-        break;
-      default:
-        form = "(NEONAcrossLanes)";
-        break;
-    }
-  }
-  Format(instr, mnemonic,
-         nfd.Substitute(form, NEONFormatDecoder::kPlaceholder,
-                        NEONFormatDecoder::kFormat));
-}
-
-void DisassemblingDecoder::VisitNEONByIndexedElement(Instruction* instr) {
-  const char* mnemonic = "unimplemented";
-  bool l_instr = false;
-  bool fp_instr = false;
-
-  const char* form = "'Vd.%s, 'Vn.%s, 'Ve.%s['IVByElemIndex]";
-
-  static const NEONFormatMap map_ta = {{23, 22}, {NF_UNDEF, NF_4S, NF_2D}};
-  NEONFormatDecoder nfd(instr, &map_ta, NEONFormatDecoder::IntegerFormatMap(),
-                        NEONFormatDecoder::ScalarFormatMap());
-
-  switch (instr->Mask(NEONByIndexedElementMask)) {
-    case NEON_SMULL_byelement:
-      mnemonic = "smull";
-      l_instr = true;
-      break;
-    case NEON_UMULL_byelement:
-      mnemonic = "umull";
-      l_instr = true;
-      break;
-    case NEON_SMLAL_byelement:
-      mnemonic = "smlal";
-      l_instr = true;
-      break;
-    case NEON_UMLAL_byelement:
-      mnemonic = "umlal";
-      l_instr = true;
-      break;
-    case NEON_SMLSL_byelement:
-      mnemonic = "smlsl";
-      l_instr = true;
-      break;
-    case NEON_UMLSL_byelement:
-      mnemonic = "umlsl";
-      l_instr = true;
-      break;
-    case NEON_SQDMULL_byelement:
-      mnemonic = "sqdmull";
-      l_instr = true;
-      break;
-    case NEON_SQDMLAL_byelement:
-      mnemonic = "sqdmlal";
-      l_instr = true;
-      break;
-    case NEON_SQDMLSL_byelement:
-      mnemonic = "sqdmlsl";
-      l_instr = true;
-      break;
-    case NEON_MUL_byelement:
-      mnemonic = "mul";
-      break;
-    case NEON_MLA_byelement:
-      mnemonic = "mla";
-      break;
-    case NEON_MLS_byelement:
-      mnemonic = "mls";
-      break;
-    case NEON_SQDMULH_byelement:
-      mnemonic = "sqdmulh";
-      break;
-    case NEON_SQRDMULH_byelement:
-      mnemonic = "sqrdmulh";
-      break;
-    default:
-      switch (instr->Mask(NEONByIndexedElementFPMask)) {
-        case NEON_FMUL_byelement:
-          mnemonic = "fmul";
-          fp_instr = true;
-          break;
-        case NEON_FMLA_byelement:
-          mnemonic = "fmla";
-          fp_instr = true;
-          break;
-        case NEON_FMLS_byelement:
-          mnemonic = "fmls";
-          fp_instr = true;
-          break;
-        case NEON_FMULX_byelement:
-          mnemonic = "fmulx";
-          fp_instr = true;
-          break;
-      }
-  }
-
-  if (l_instr) {
-    Format(instr, nfd.Mnemonic(mnemonic), nfd.Substitute(form));
-  } else if (fp_instr) {
-    nfd.SetFormatMap(0, nfd.FPFormatMap());
-    Format(instr, mnemonic, nfd.Substitute(form));
-  } else {
-    nfd.SetFormatMap(0, nfd.IntegerFormatMap());
-    Format(instr, mnemonic, nfd.Substitute(form));
-  }
-}
-
-void DisassemblingDecoder::VisitNEONCopy(Instruction* instr) {
-  const char* mnemonic = "unimplemented";
-  const char* form = "(NEONCopy)";
-
-  NEONFormatDecoder nfd(instr, NEONFormatDecoder::TriangularFormatMap(),
-                        NEONFormatDecoder::TriangularScalarFormatMap());
-
-  if (instr->Mask(NEONCopyInsElementMask) == NEON_INS_ELEMENT) {
-    mnemonic = "mov";
-    nfd.SetFormatMap(0, nfd.TriangularScalarFormatMap());
-    form = "'Vd.%s['IVInsIndex1], 'Vn.%s['IVInsIndex2]";
-  } else if (instr->Mask(NEONCopyInsGeneralMask) == NEON_INS_GENERAL) {
-    mnemonic = "mov";
-    nfd.SetFormatMap(0, nfd.TriangularScalarFormatMap());
-    if (nfd.GetVectorFormat() == kFormatD) {
-      form = "'Vd.%s['IVInsIndex1], 'Xn";
-    } else {
-      form = "'Vd.%s['IVInsIndex1], 'Wn";
-    }
-  } else if (instr->Mask(NEONCopyUmovMask) == NEON_UMOV) {
-    if (instr->Mask(NEON_Q) || ((instr->ImmNEON5() & 7) == 4)) {
-      mnemonic = "mov";
-    } else {
-      mnemonic = "umov";
-    }
-    nfd.SetFormatMap(0, nfd.TriangularScalarFormatMap());
-    if (nfd.GetVectorFormat() == kFormatD) {
-      form = "'Xd, 'Vn.%s['IVInsIndex1]";
-    } else {
-      form = "'Wd, 'Vn.%s['IVInsIndex1]";
-    }
-  } else if (instr->Mask(NEONCopySmovMask) == NEON_SMOV) {
-    mnemonic = "smov";
-    nfd.SetFormatMap(0, nfd.TriangularScalarFormatMap());
-    form = "'Rdq, 'Vn.%s['IVInsIndex1]";
-  } else if (instr->Mask(NEONCopyDupElementMask) == NEON_DUP_ELEMENT) {
-    mnemonic = "dup";
-    form = "'Vd.%s, 'Vn.%s['IVInsIndex1]";
-  } else if (instr->Mask(NEONCopyDupGeneralMask) == NEON_DUP_GENERAL) {
-    mnemonic = "dup";
-    if (nfd.GetVectorFormat() == kFormat2D) {
-      form = "'Vd.%s, 'Xn";
-    } else {
-      form = "'Vd.%s, 'Wn";
-    }
-  }
-  Format(instr, mnemonic, nfd.Substitute(form));
-}
-
-void DisassemblingDecoder::VisitNEONExtract(Instruction* instr) {
-  const char* mnemonic = "unimplemented";
-  const char* form = "(NEONExtract)";
-  NEONFormatDecoder nfd(instr, NEONFormatDecoder::LogicalFormatMap());
-  if (instr->Mask(NEONExtractMask) == NEON_EXT) {
-    mnemonic = "ext";
-    form = "'Vd.%s, 'Vn.%s, 'Vm.%s, 'IVExtract";
-  }
-  Format(instr, mnemonic, nfd.Substitute(form));
-}
-
-void DisassemblingDecoder::VisitNEONLoadStoreMultiStruct(Instruction* instr) {
-  const char* mnemonic = nullptr;
-  const char* form = nullptr;
-  const char* form_1v = "{'Vt.%1$s}, ['Xns]";
-  const char* form_2v = "{'Vt.%1$s, 'Vt2.%1$s}, ['Xns]";
-  const char* form_3v = "{'Vt.%1$s, 'Vt2.%1$s, 'Vt3.%1$s}, ['Xns]";
-  const char* form_4v = "{'Vt.%1$s, 'Vt2.%1$s, 'Vt3.%1$s, 'Vt4.%1$s}, ['Xns]";
-  NEONFormatDecoder nfd(instr, NEONFormatDecoder::LoadStoreFormatMap());
-
-  switch (instr->Mask(NEONLoadStoreMultiStructMask)) {
-    case NEON_LD1_1v:
-      mnemonic = "ld1";
-      form = form_1v;
-      break;
-    case NEON_LD1_2v:
-      mnemonic = "ld1";
-      form = form_2v;
-      break;
-    case NEON_LD1_3v:
-      mnemonic = "ld1";
-      form = form_3v;
-      break;
-    case NEON_LD1_4v:
-      mnemonic = "ld1";
-      form = form_4v;
-      break;
-    case NEON_LD2:
-      mnemonic = "ld2";
-      form = form_2v;
-      break;
-    case NEON_LD3:
-      mnemonic = "ld3";
-      form = form_3v;
-      break;
-    case NEON_LD4:
-      mnemonic = "ld4";
-      form = form_4v;
-      break;
-    case NEON_ST1_1v:
-      mnemonic = "st1";
-      form = form_1v;
-      break;
-    case NEON_ST1_2v:
-      mnemonic = "st1";
-      form = form_2v;
-      break;
-    case NEON_ST1_3v:
-      mnemonic = "st1";
-      form = form_3v;
-      break;
-    case NEON_ST1_4v:
-      mnemonic = "st1";
-      form = form_4v;
-      break;
-    case NEON_ST2:
-      mnemonic = "st2";
-      form = form_2v;
-      break;
-    case NEON_ST3:
-      mnemonic = "st3";
-      form = form_3v;
-      break;
-    case NEON_ST4:
-      mnemonic = "st4";
-      form = form_4v;
-      break;
-    default:
-      break;
-  }
-
-  // Work out unallocated encodings.
-  bool allocated = (mnemonic != nullptr);
-  switch (instr->Mask(NEONLoadStoreMultiStructMask)) {
-    case NEON_LD2:
-    case NEON_LD3:
-    case NEON_LD4:
-    case NEON_ST2:
-    case NEON_ST3:
-    case NEON_ST4:
-      // LD[2-4] and ST[2-4] cannot use .1d format.
-      allocated = (instr->NEONQ() != 0) || (instr->NEONLSSize() != 3);
-      break;
-    default:
-      break;
-  }
-  if (allocated) {
-    DCHECK_NOT_NULL(mnemonic);
-    DCHECK_NOT_NULL(form);
-  } else {
-    mnemonic = "unallocated";
-    form = "(NEONLoadStoreMultiStruct)";
-  }
-
-  Format(instr, mnemonic, nfd.Substitute(form));
-}
-
-void DisassemblingDecoder::VisitNEONLoadStoreMultiStructPostIndex(
-    Instruction* instr) {
-  const char* mnemonic = nullptr;
-  const char* form = nullptr;
-  const char* form_1v = "{'Vt.%1$s}, ['Xns], 'Xmr1";
-  const char* form_2v = "{'Vt.%1$s, 'Vt2.%1$s}, ['Xns], 'Xmr2";
-  const char* form_3v = "{'Vt.%1$s, 'Vt2.%1$s, 'Vt3.%1$s}, ['Xns], 'Xmr3";
-  const char* form_4v =
-      "{'Vt.%1$s, 'Vt2.%1$s, 'Vt3.%1$s, 'Vt4.%1$s}, ['Xns], 'Xmr4";
-  NEONFormatDecoder nfd(instr, NEONFormatDecoder::LoadStoreFormatMap());
-
-  switch (instr->Mask(NEONLoadStoreMultiStructPostIndexMask)) {
-    case NEON_LD1_1v_post:
-      mnemonic = "ld1";
-      form = form_1v;
-      break;
-    case NEON_LD1_2v_post:
-      mnemonic = "ld1";
-      form = form_2v;
-      break;
-    case NEON_LD1_3v_post:
-      mnemonic = "ld1";
-      form = form_3v;
-      break;
-    case NEON_LD1_4v_post:
-      mnemonic = "ld1";
-      form = form_4v;
-      break;
-    case NEON_LD2_post:
-      mnemonic = "ld2";
-      form = form_2v;
-      break;
-    case NEON_LD3_post:
-      mnemonic = "ld3";
-      form = form_3v;
-      break;
-    case NEON_LD4_post:
-      mnemonic = "ld4";
-      form = form_4v;
-      break;
-    case NEON_ST1_1v_post:
-      mnemonic = "st1";
-      form = form_1v;
-      break;
-    case NEON_ST1_2v_post:
-      mnemonic = "st1";
-      form = form_2v;
-      break;
-    case NEON_ST1_3v_post:
-      mnemonic = "st1";
-      form = form_3v;
-      break;
-    case NEON_ST1_4v_post:
-      mnemonic = "st1";
-      form = form_4v;
-      break;
-    case NEON_ST2_post:
-      mnemonic = "st2";
-      form = form_2v;
-      break;
-    case NEON_ST3_post:
-      mnemonic = "st3";
-      form = form_3v;
-      break;
-    case NEON_ST4_post:
-      mnemonic = "st4";
-      form = form_4v;
-      break;
-    default:
-      break;
-  }
-
-  // Work out unallocated encodings.
-  bool allocated = (mnemonic != nullptr);
-  switch (instr->Mask(NEONLoadStoreMultiStructPostIndexMask)) {
-    case NEON_LD2_post:
-    case NEON_LD3_post:
-    case NEON_LD4_post:
-    case NEON_ST2_post:
-    case NEON_ST3_post:
-    case NEON_ST4_post:
-      // LD[2-4] and ST[2-4] cannot use .1d format.
-      allocated = (instr->NEONQ() != 0) || (instr->NEONLSSize() != 3);
-      break;
-    default:
-      break;
-  }
-  if (allocated) {
-    DCHECK_NOT_NULL(mnemonic);
-    DCHECK_NOT_NULL(form);
-  } else {
-    mnemonic = "unallocated";
-    form = "(NEONLoadStoreMultiStructPostIndex)";
-  }
-
-  Format(instr, mnemonic, nfd.Substitute(form));
-}
-
-void DisassemblingDecoder::VisitNEONLoadStoreSingleStruct(Instruction* instr) {
-  const char* mnemonic = nullptr;
-  const char* form = nullptr;
-
-  const char* form_1b = "{'Vt.b}['IVLSLane0], ['Xns]";
-  const char* form_1h = "{'Vt.h}['IVLSLane1], ['Xns]";
-  const char* form_1s = "{'Vt.s}['IVLSLane2], ['Xns]";
-  const char* form_1d = "{'Vt.d}['IVLSLane3], ['Xns]";
-  NEONFormatDecoder nfd(instr, NEONFormatDecoder::LoadStoreFormatMap());
-
-  switch (instr->Mask(NEONLoadStoreSingleStructMask)) {
-    case NEON_LD1_b:
-      mnemonic = "ld1";
-      form = form_1b;
-      break;
-    case NEON_LD1_h:
-      mnemonic = "ld1";
-      form = form_1h;
-      break;
-    case NEON_LD1_s:
-      mnemonic = "ld1";
-      static_assert((NEON_LD1_s | (1 << NEONLSSize_offset)) == NEON_LD1_d,
-                    "LSB of size distinguishes S and D registers.");
-      form = ((instr->NEONLSSize() & 1) == 0) ? form_1s : form_1d;
-      break;
-    case NEON_ST1_b:
-      mnemonic = "st1";
-      form = form_1b;
-      break;
-    case NEON_ST1_h:
-      mnemonic = "st1";
-      form = form_1h;
-      break;
-    case NEON_ST1_s:
-      mnemonic = "st1";
-      static_assert((NEON_ST1_s | (1 << NEONLSSize_offset)) == NEON_ST1_d,
-                    "LSB of size distinguishes S and D registers.");
-      form = ((instr->NEONLSSize() & 1) == 0) ? form_1s : form_1d;
-      break;
-    case NEON_LD1R:
-      mnemonic = "ld1r";
-      form = "{'Vt.%s}, ['Xns]";
-      break;
-    case NEON_LD2_b:
-    case NEON_ST2_b:
-      mnemonic = (instr->NEONLoad() == 1) ? "ld2" : "st2";
-      form = "{'Vt.b, 'Vt2.b}['IVLSLane0], ['Xns]";
-      break;
-    case NEON_LD2_h:
-    case NEON_ST2_h:
-      mnemonic = (instr->NEONLoad() == 1) ? "ld2" : "st2";
-      form = "{'Vt.h, 'Vt2.h}['IVLSLane1], ['Xns]";
-      break;
-    case NEON_LD2_s:
-    case NEON_ST2_s:
-      static_assert((NEON_ST2_s | (1 << NEONLSSize_offset)) == NEON_ST2_d,
-                    "LSB of size distinguishes S and D registers.");
-      static_assert((NEON_LD2_s | (1 << NEONLSSize_offset)) == NEON_LD2_d,
-                    "LSB of size distinguishes S and D registers.");
-      mnemonic = (instr->NEONLoad() == 1) ? "ld2" : "st2";
-      if ((instr->NEONLSSize() & 1) == 0) {
-        form = "{'Vt.s, 'Vt2.s}['IVLSLane2], ['Xns]";
-      } else {
-        form = "{'Vt.d, 'Vt2.d}['IVLSLane3], ['Xns]";
-      }
-      break;
-    case NEON_LD2R:
-      mnemonic = "ld2r";
-      form = "{'Vt.%s, 'Vt2.%s}, ['Xns]";
-      break;
-    case NEON_LD3_b:
-    case NEON_ST3_b:
-      mnemonic = (instr->NEONLoad() == 1) ? "ld3" : "st3";
-      form = "{'Vt.b, 'Vt2.b, 'Vt3.b}['IVLSLane0], ['Xns]";
-      break;
-    case NEON_LD3_h:
-    case NEON_ST3_h:
-      mnemonic = (instr->NEONLoad() == 1) ? "ld3" : "st3";
-      form = "{'Vt.h, 'Vt2.h, 'Vt3.h}['IVLSLane1], ['Xns]";
-      break;
-    case NEON_LD3_s:
-    case NEON_ST3_s:
-      mnemonic = (instr->NEONLoad() == 1) ? "ld3" : "st3";
-      if ((instr->NEONLSSize() & 1) == 0) {
-        form = "{'Vt.s, 'Vt2.s, 'Vt3.s}['IVLSLane2], ['Xns]";
-      } else {
-        form = "{'Vt.d, 'Vt2.d, 'Vt3.d}['IVLSLane3], ['Xns]";
-      }
-      break;
-    case NEON_LD3R:
-      mnemonic = "ld3r";
-      form = "{'Vt.%s, 'Vt2.%s, 'Vt3.%s}, ['Xns]";
-      break;
-    case NEON_LD4_b:
-    case NEON_ST4_b:
-      mnemonic = (instr->NEONLoad() == 1) ? "ld4" : "st4";
-      form = "{'Vt.b, 'Vt2.b, 'Vt3.b, 'Vt4.b}['IVLSLane0], ['Xns]";
-      break;
-    case NEON_LD4_h:
-    case NEON_ST4_h:
-      mnemonic = (instr->NEONLoad() == 1) ? "ld4" : "st4";
-      form = "{'Vt.h, 'Vt2.h, 'Vt3.h, 'Vt4.h}['IVLSLane1], ['Xns]";
-      break;
-    case NEON_LD4_s:
-    case NEON_ST4_s:
-      static_assert((NEON_LD4_s | (1 << NEONLSSize_offset)) == NEON_LD4_d,
-                    "LSB of size distinguishes S and D registers.");
-      static_assert((NEON_ST4_s | (1 << NEONLSSize_offset)) == NEON_ST4_d,
-                    "LSB of size distinguishes S and D registers.");
-      mnemonic = (instr->NEONLoad() == 1) ? "ld4" : "st4";
-      if ((instr->NEONLSSize() & 1) == 0) {
-        form = "{'Vt.s, 'Vt2.s, 'Vt3.s, 'Vt4.s}['IVLSLane2], ['Xns]";
-      } else {
-        form = "{'Vt.d, 'Vt2.d, 'Vt3.d, 'Vt4.d}['IVLSLane3], ['Xns]";
-      }
-      break;
-    case NEON_LD4R:
-      mnemonic = "ld4r";
-      form = "{'Vt.%1$s, 'Vt2.%1$s, 'Vt3.%1$s, 'Vt4.%1$s}, ['Xns]";
-      break;
-    default:
-      break;
-  }
-
-  // Work out unallocated encodings.
-  bool allocated = (mnemonic != nullptr);
-  switch (instr->Mask(NEONLoadStoreSingleStructMask)) {
-    case NEON_LD1_h:
-    case NEON_LD2_h:
-    case NEON_LD3_h:
-    case NEON_LD4_h:
-    case NEON_ST1_h:
-    case NEON_ST2_h:
-    case NEON_ST3_h:
-    case NEON_ST4_h:
-      DCHECK(allocated);
-      allocated = ((instr->NEONLSSize() & 1) == 0);
-      break;
-    case NEON_LD1_s:
-    case NEON_LD2_s:
-    case NEON_LD3_s:
-    case NEON_LD4_s:
-    case NEON_ST1_s:
-    case NEON_ST2_s:
-    case NEON_ST3_s:
-    case NEON_ST4_s:
-      DCHECK(allocated);
-      allocated = (instr->NEONLSSize() <= 1) &&
-                  ((instr->NEONLSSize() == 0) || (instr->NEONS() == 0));
-      break;
-    case NEON_LD1R:
-    case NEON_LD2R:
-    case NEON_LD3R:
-    case NEON_LD4R:
-      DCHECK(allocated);
-      allocated = (instr->NEONS() == 0);
-      break;
-    default:
-      break;
-  }
-  if (allocated) {
-    DCHECK_NOT_NULL(mnemonic);
-    DCHECK_NOT_NULL(form);
-  } else {
-    mnemonic = "unallocated";
-    form = "(NEONLoadStoreSingleStruct)";
-  }
-
-  Format(instr, mnemonic, nfd.Substitute(form));
-}
-
-void DisassemblingDecoder::VisitNEONLoadStoreSingleStructPostIndex(
-    Instruction* instr) {
-  const char* mnemonic = nullptr;
-  const char* form = nullptr;
-
-  const char* form_1b = "{'Vt.b}['IVLSLane0], ['Xns], 'Xmb1";
-  const char* form_1h = "{'Vt.h}['IVLSLane1], ['Xns], 'Xmb2";
-  const char* form_1s = "{'Vt.s}['IVLSLane2], ['Xns], 'Xmb4";
-  const char* form_1d = "{'Vt.d}['IVLSLane3], ['Xns], 'Xmb8";
-  NEONFormatDecoder nfd(instr, NEONFormatDecoder::LoadStoreFormatMap());
-
-  switch (instr->Mask(NEONLoadStoreSingleStructPostIndexMask)) {
-    case NEON_LD1_b_post:
-      mnemonic = "ld1";
-      form = form_1b;
-      break;
-    case NEON_LD1_h_post:
-      mnemonic = "ld1";
-      form = form_1h;
-      break;
-    case NEON_LD1_s_post:
-      mnemonic = "ld1";
-      static_assert((NEON_LD1_s | (1 << NEONLSSize_offset)) == NEON_LD1_d,
-                    "LSB of size distinguishes S and D registers.");
-      form = ((instr->NEONLSSize() & 1) == 0) ? form_1s : form_1d;
-      break;
-    case NEON_ST1_b_post:
-      mnemonic = "st1";
-      form = form_1b;
-      break;
-    case NEON_ST1_h_post:
-      mnemonic = "st1";
-      form = form_1h;
-      break;
-    case NEON_ST1_s_post:
-      mnemonic = "st1";
-      static_assert((NEON_ST1_s | (1 << NEONLSSize_offset)) == NEON_ST1_d,
-                    "LSB of size distinguishes S and D registers.");
-      form = ((instr->NEONLSSize() & 1) == 0) ? form_1s : form_1d;
-      break;
-    case NEON_LD1R_post:
-      mnemonic = "ld1r";
-      form = "{'Vt.%s}, ['Xns], 'Xmz1";
-      break;
-    case NEON_LD2_b_post:
-    case NEON_ST2_b_post:
-      mnemonic = (instr->NEONLoad() == 1) ? "ld2" : "st2";
-      form = "{'Vt.b, 'Vt2.b}['IVLSLane0], ['Xns], 'Xmb2";
-      break;
-    case NEON_ST2_h_post:
-    case NEON_LD2_h_post:
-      mnemonic = (instr->NEONLoad() == 1) ? "ld2" : "st2";
-      form = "{'Vt.h, 'Vt2.h}['IVLSLane1], ['Xns], 'Xmb4";
-      break;
-    case NEON_LD2_s_post:
-    case NEON_ST2_s_post:
-      mnemonic = (instr->NEONLoad() == 1) ? "ld2" : "st2";
-      if ((instr->NEONLSSize() & 1) == 0)
-        form = "{'Vt.s, 'Vt2.s}['IVLSLane2], ['Xns], 'Xmb8";
-      else
-        form = "{'Vt.d, 'Vt2.d}['IVLSLane3], ['Xns], 'Xmb16";
-      break;
-    case NEON_LD2R_post:
-      mnemonic = "ld2r";
-      form = "{'Vt.%s, 'Vt2.%s}, ['Xns], 'Xmz2";
-      break;
-    case NEON_LD3_b_post:
-    case NEON_ST3_b_post:
-      mnemonic = (instr->NEONLoad() == 1) ? "ld3" : "st3";
-      form = "{'Vt.b, 'Vt2.b, 'Vt3.b}['IVLSLane0], ['Xns], 'Xmb3";
-      break;
-    case NEON_LD3_h_post:
-    case NEON_ST3_h_post:
-      mnemonic = (instr->NEONLoad() == 1) ? "ld3" : "st3";
-      form = "{'Vt.h, 'Vt2.h, 'Vt3.h}['IVLSLane1], ['Xns], 'Xmb6";
-      break;
-    case NEON_LD3_s_post:
-    case NEON_ST3_s_post:
-      mnemonic = (instr->NEONLoad() == 1) ? "ld3" : "st3";
-      if ((instr->NEONLSSize() & 1) == 0)
-        form = "{'Vt.s, 'Vt2.s, 'Vt3.s}['IVLSLane2], ['Xns], 'Xmb12";
-      else
-        form = "{'Vt.d, 'Vt2.d, 'Vt3.d}['IVLSLane3], ['Xns], 'Xmb24";
-      break;
-    case NEON_LD3R_post:
-      mnemonic = "ld3r";
-      form = "{'Vt.%s, 'Vt2.%s, 'Vt3.%s}, ['Xns], 'Xmz3";
-      break;
-    case NEON_LD4_b_post:
-    case NEON_ST4_b_post:
-      mnemonic = (instr->NEONLoad() == 1) ? "ld4" : "st4";
-      form = "{'Vt.b, 'Vt2.b, 'Vt3.b, 'Vt4.b}['IVLSLane0], ['Xns], 'Xmb4";
-      break;
-    case NEON_LD4_h_post:
-    case NEON_ST4_h_post:
-      mnemonic = (instr->NEONLoad()) == 1 ? "ld4" : "st4";
-      form = "{'Vt.h, 'Vt2.h, 'Vt3.h, 'Vt4.h}['IVLSLane1], ['Xns], 'Xmb8";
-      break;
-    case NEON_LD4_s_post:
-    case NEON_ST4_s_post:
-      mnemonic = (instr->NEONLoad() == 1) ? "ld4" : "st4";
-      if ((instr->NEONLSSize() & 1) == 0)
-        form = "{'Vt.s, 'Vt2.s, 'Vt3.s, 'Vt4.s}['IVLSLane2], ['Xns], 'Xmb16";
-      else
-        form = "{'Vt.d, 'Vt2.d, 'Vt3.d, 'Vt4.d}['IVLSLane3], ['Xns], 'Xmb32";
-      break;
-    case NEON_LD4R_post:
-      mnemonic = "ld4r";
-      form = "{'Vt.%1$s, 'Vt2.%1$s, 'Vt3.%1$s, 'Vt4.%1$s}, ['Xns], 'Xmz4";
-      break;
-    default:
-      break;
-  }
-
-  // Work out unallocated encodings.
-  bool allocated = (mnemonic != nullptr);
-  switch (instr->Mask(NEONLoadStoreSingleStructPostIndexMask)) {
-    case NEON_LD1_h_post:
-    case NEON_LD2_h_post:
-    case NEON_LD3_h_post:
-    case NEON_LD4_h_post:
-    case NEON_ST1_h_post:
-    case NEON_ST2_h_post:
-    case NEON_ST3_h_post:
-    case NEON_ST4_h_post:
-      DCHECK(allocated);
-      allocated = ((instr->NEONLSSize() & 1) == 0);
-      break;
-    case NEON_LD1_s_post:
-    case NEON_LD2_s_post:
-    case NEON_LD3_s_post:
-    case NEON_LD4_s_post:
-    case NEON_ST1_s_post:
-    case NEON_ST2_s_post:
-    case NEON_ST3_s_post:
-    case NEON_ST4_s_post:
-      DCHECK(allocated);
-      allocated = (instr->NEONLSSize() <= 1) &&
-                  ((instr->NEONLSSize() == 0) || (instr->NEONS() == 0));
-      break;
-    case NEON_LD1R_post:
-    case NEON_LD2R_post:
-    case NEON_LD3R_post:
-    case NEON_LD4R_post:
-      DCHECK(allocated);
-      allocated = (instr->NEONS() == 0);
-      break;
-    default:
-      break;
-  }
-  if (allocated) {
-    DCHECK_NOT_NULL(mnemonic);
-    DCHECK_NOT_NULL(form);
-  } else {
-    mnemonic = "unallocated";
-    form = "(NEONLoadStoreSingleStructPostIndex)";
-  }
-
-  Format(instr, mnemonic, nfd.Substitute(form));
-}
-
-void DisassemblingDecoder::VisitNEONModifiedImmediate(Instruction* instr) {
-  const char* mnemonic = "unimplemented";
-  const char* form = "'Vt.%s, 'IVMIImm8, lsl 'IVMIShiftAmt1";
-
-  int cmode = instr->NEONCmode();
-  int cmode_3 = (cmode >> 3) & 1;
-  int cmode_2 = (cmode >> 2) & 1;
-  int cmode_1 = (cmode >> 1) & 1;
-  int cmode_0 = cmode & 1;
-  int q = instr->NEONQ();
-  int op = instr->NEONModImmOp();
-
-  static const NEONFormatMap map_b = {{30}, {NF_8B, NF_16B}};
-  static const NEONFormatMap map_h = {{30}, {NF_4H, NF_8H}};
-  static const NEONFormatMap map_s = {{30}, {NF_2S, NF_4S}};
-  NEONFormatDecoder nfd(instr, &map_b);
-
-  if (cmode_3 == 0) {
-    if (cmode_0 == 0) {
-      mnemonic = (op == 1) ? "mvni" : "movi";
-    } else {  // cmode<0> == '1'.
-      mnemonic = (op == 1) ? "bic" : "orr";
-    }
-    nfd.SetFormatMap(0, &map_s);
-  } else {  // cmode<3> == '1'.
-    if (cmode_2 == 0) {
-      if (cmode_0 == 0) {
-        mnemonic = (op == 1) ? "mvni" : "movi";
-      } else {  // cmode<0> == '1'.
-        mnemonic = (op == 1) ? "bic" : "orr";
-      }
-      nfd.SetFormatMap(0, &map_h);
-    } else {  // cmode<2> == '1'.
-      if (cmode_1 == 0) {
-        mnemonic = (op == 1) ? "mvni" : "movi";
-        form = "'Vt.%s, 'IVMIImm8, msl 'IVMIShiftAmt2";
-        nfd.SetFormatMap(0, &map_s);
-      } else {  // cmode<1> == '1'.
-        if (cmode_0 == 0) {
-          mnemonic = "movi";
-          if (op == 0) {
-            form = "'Vt.%s, 'IVMIImm8";
-          } else {
-            form = (q == 0) ? "'Dd, 'IVMIImm" : "'Vt.2d, 'IVMIImm";
-          }
-        } else {  // cmode<0> == '1'
-          mnemonic = "fmov";
-          if (op == 0) {
-            form = "'Vt.%s, 'IVMIImmFPSingle";
-            nfd.SetFormatMap(0, &map_s);
-          } else {
-            if (q == 1) {
-              form = "'Vt.2d, 'IVMIImmFPDouble";
-            } else {
-              mnemonic = "unallocated";
-              form = "(NEONModifiedImmediate)";
-            }
-          }
-        }
-      }
-    }
-  }
-  Format(instr, mnemonic, nfd.Substitute(form));
-}
-
-void DisassemblingDecoder::VisitNEONPerm(Instruction* instr) {
-  const char* mnemonic = "unimplemented";
-  const char* form = "'Vd.%s, 'Vn.%s, 'Vm.%s";
-  NEONFormatDecoder nfd(instr);
-
-  switch (instr->Mask(NEONPermMask)) {
-    case NEON_TRN1:
-      mnemonic = "trn1";
-      break;
-    case NEON_TRN2:
-      mnemonic = "trn2";
-      break;
-    case NEON_UZP1:
-      mnemonic = "uzp1";
-      break;
-    case NEON_UZP2:
-      mnemonic = "uzp2";
-      break;
-    case NEON_ZIP1:
-      mnemonic = "zip1";
-      break;
-    case NEON_ZIP2:
-      mnemonic = "zip2";
-      break;
-    default:
-      form = "(NEONPerm)";
-  }
-  Format(instr, mnemonic, nfd.Substitute(form));
-}
-
-void DisassemblingDecoder::VisitNEONScalar2RegMisc(Instruction* instr) {
-  const char* mnemonic = "unimplemented";
-  const char* form = "%sd, %sn";
-  const char* form_0 = "%sd, %sn, #0";
-  const char* form_fp0 = "%sd, %sn, #0.0";
-
-  NEONFormatDecoder nfd(instr, NEONFormatDecoder::ScalarFormatMap());
-
-  if (instr->Mask(NEON2RegMiscOpcode) <= NEON_NEG_scalar_opcode) {
-    // These instructions all use a two bit size field, except NOT and RBIT,
-    // which use the field to encode the operation.
-    switch (instr->Mask(NEONScalar2RegMiscMask)) {
-      case NEON_CMGT_zero_scalar:
-        mnemonic = "cmgt";
-        form = form_0;
-        break;
-      case NEON_CMGE_zero_scalar:
-        mnemonic = "cmge";
-        form = form_0;
-        break;
-      case NEON_CMLE_zero_scalar:
-        mnemonic = "cmle";
-        form = form_0;
-        break;
-      case NEON_CMLT_zero_scalar:
-        mnemonic = "cmlt";
-        form = form_0;
-        break;
-      case NEON_CMEQ_zero_scalar:
-        mnemonic = "cmeq";
-        form = form_0;
-        break;
-      case NEON_NEG_scalar:
-        mnemonic = "neg";
-        break;
-      case NEON_SQNEG_scalar:
-        mnemonic = "sqneg";
-        break;
-      case NEON_ABS_scalar:
-        mnemonic = "abs";
-        break;
-      case NEON_SQABS_scalar:
-        mnemonic = "sqabs";
-        break;
-      case NEON_SUQADD_scalar:
-        mnemonic = "suqadd";
-        break;
-      case NEON_USQADD_scalar:
-        mnemonic = "usqadd";
-        break;
-      default:
-        form = "(NEONScalar2RegMisc)";
-    }
-  } else {
-    // These instructions all use a one bit size field, except SQXTUN, SQXTN
-    // and UQXTN, which use a two bit size field.
-    nfd.SetFormatMaps(nfd.FPScalarFormatMap());
-    switch (instr->Mask(NEONScalar2RegMiscFPMask)) {
-      case NEON_FRSQRTE_scalar:
-        mnemonic = "frsqrte";
-        break;
-      case NEON_FRECPE_scalar:
-        mnemonic = "frecpe";
-        break;
-      case NEON_SCVTF_scalar:
-        mnemonic = "scvtf";
-        break;
-      case NEON_UCVTF_scalar:
-        mnemonic = "ucvtf";
-        break;
-      case NEON_FCMGT_zero_scalar:
-        mnemonic = "fcmgt";
-        form = form_fp0;
-        break;
-      case NEON_FCMGE_zero_scalar:
-        mnemonic = "fcmge";
-        form = form_fp0;
-        break;
-      case NEON_FCMLE_zero_scalar:
-        mnemonic = "fcmle";
-        form = form_fp0;
-        break;
-      case NEON_FCMLT_zero_scalar:
-        mnemonic = "fcmlt";
-        form = form_fp0;
-        break;
-      case NEON_FCMEQ_zero_scalar:
-        mnemonic = "fcmeq";
-        form = form_fp0;
-        break;
-      case NEON_FRECPX_scalar:
-        mnemonic = "frecpx";
-        break;
-      case NEON_FCVTNS_scalar:
-        mnemonic = "fcvtns";
-        break;
-      case NEON_FCVTNU_scalar:
-        mnemonic = "fcvtnu";
-        break;
-      case NEON_FCVTPS_scalar:
-        mnemonic = "fcvtps";
-        break;
-      case NEON_FCVTPU_scalar:
-        mnemonic = "fcvtpu";
-        break;
-      case NEON_FCVTMS_scalar:
-        mnemonic = "fcvtms";
-        break;
-      case NEON_FCVTMU_scalar:
-        mnemonic = "fcvtmu";
-        break;
-      case NEON_FCVTZS_scalar:
-        mnemonic = "fcvtzs";
-        break;
-      case NEON_FCVTZU_scalar:
-        mnemonic = "fcvtzu";
-        break;
-      case NEON_FCVTAS_scalar:
-        mnemonic = "fcvtas";
-        break;
-      case NEON_FCVTAU_scalar:
-        mnemonic = "fcvtau";
-        break;
-      case NEON_FCVTXN_scalar:
-        nfd.SetFormatMap(0, nfd.LongScalarFormatMap());
-        mnemonic = "fcvtxn";
-        break;
-      default:
-        nfd.SetFormatMap(0, nfd.ScalarFormatMap());
-        nfd.SetFormatMap(1, nfd.LongScalarFormatMap());
-        switch (instr->Mask(NEONScalar2RegMiscMask)) {
-          case NEON_SQXTN_scalar:
-            mnemonic = "sqxtn";
-            break;
-          case NEON_UQXTN_scalar:
-            mnemonic = "uqxtn";
-            break;
-          case NEON_SQXTUN_scalar:
-            mnemonic = "sqxtun";
-            break;
-          default:
-            form = "(NEONScalar2RegMisc)";
-        }
-    }
-  }
-  Format(instr, mnemonic, nfd.SubstitutePlaceholders(form));
-}
-
-void DisassemblingDecoder::VisitNEONScalar3Diff(Instruction* instr) {
-  const char* mnemonic = "unimplemented";
-  const char* form = "%sd, %sn, %sm";
-  NEONFormatDecoder nfd(instr, NEONFormatDecoder::LongScalarFormatMap(),
-                        NEONFormatDecoder::ScalarFormatMap());
-
-  switch (instr->Mask(NEONScalar3DiffMask)) {
-    case NEON_SQDMLAL_scalar:
-      mnemonic = "sqdmlal";
-      break;
-    case NEON_SQDMLSL_scalar:
-      mnemonic = "sqdmlsl";
-      break;
-    case NEON_SQDMULL_scalar:
-      mnemonic = "sqdmull";
-      break;
-    default:
-      form = "(NEONScalar3Diff)";
-  }
-  Format(instr, mnemonic, nfd.SubstitutePlaceholders(form));
-}
-
-void DisassemblingDecoder::VisitNEONScalar3Same(Instruction* instr) {
-  const char* mnemonic = "unimplemented";
-  const char* form = "%sd, %sn, %sm";
-  NEONFormatDecoder nfd(instr, NEONFormatDecoder::ScalarFormatMap());
-
-  if (instr->Mask(NEONScalar3SameFPFMask) == NEONScalar3SameFPFixed) {
-    nfd.SetFormatMaps(nfd.FPScalarFormatMap());
-    switch (instr->Mask(NEONScalar3SameFPMask)) {
-      case NEON_FACGE_scalar:
-        mnemonic = "facge";
-        break;
-      case NEON_FACGT_scalar:
-        mnemonic = "facgt";
-        break;
-      case NEON_FCMEQ_scalar:
-        mnemonic = "fcmeq";
-        break;
-      case NEON_FCMGE_scalar:
-        mnemonic = "fcmge";
-        break;
-      case NEON_FCMGT_scalar:
-        mnemonic = "fcmgt";
-        break;
-      case NEON_FMULX_scalar:
-        mnemonic = "fmulx";
-        break;
-      case NEON_FRECPS_scalar:
-        mnemonic = "frecps";
-        break;
-      case NEON_FRSQRTS_scalar:
-        mnemonic = "frsqrts";
-        break;
-      case NEON_FABD_scalar:
-        mnemonic = "fabd";
-        break;
-      default:
-        form = "(NEONScalar3Same)";
-    }
-  } else {
-    switch (instr->Mask(NEONScalar3SameMask)) {
-      case NEON_ADD_scalar:
-        mnemonic = "add";
-        break;
-      case NEON_SUB_scalar:
-        mnemonic = "sub";
-        break;
-      case NEON_CMEQ_scalar:
-        mnemonic = "cmeq";
-        break;
-      case NEON_CMGE_scalar:
-        mnemonic = "cmge";
-        break;
-      case NEON_CMGT_scalar:
-        mnemonic = "cmgt";
-        break;
-      case NEON_CMHI_scalar:
-        mnemonic = "cmhi";
-        break;
-      case NEON_CMHS_scalar:
-        mnemonic = "cmhs";
-        break;
-      case NEON_CMTST_scalar:
-        mnemonic = "cmtst";
-        break;
-      case NEON_UQADD_scalar:
-        mnemonic = "uqadd";
-        break;
-      case NEON_SQADD_scalar:
-        mnemonic = "sqadd";
-        break;
-      case NEON_UQSUB_scalar:
-        mnemonic = "uqsub";
-        break;
-      case NEON_SQSUB_scalar:
-        mnemonic = "sqsub";
-        break;
-      case NEON_USHL_scalar:
-        mnemonic = "ushl";
-        break;
-      case NEON_SSHL_scalar:
-        mnemonic = "sshl";
-        break;
-      case NEON_UQSHL_scalar:
-        mnemonic = "uqshl";
-        break;
-      case NEON_SQSHL_scalar:
-        mnemonic = "sqshl";
-        break;
-      case NEON_URSHL_scalar:
-        mnemonic = "urshl";
-        break;
-      case NEON_SRSHL_scalar:
-        mnemonic = "srshl";
-        break;
-      case NEON_UQRSHL_scalar:
-        mnemonic = "uqrshl";
-        break;
-      case NEON_SQRSHL_scalar:
-        mnemonic = "sqrshl";
-        break;
-      case NEON_SQDMULH_scalar:
-        mnemonic = "sqdmulh";
-        break;
-      case NEON_SQRDMULH_scalar:
-        mnemonic = "sqrdmulh";
-        break;
-      default:
-        form = "(NEONScalar3Same)";
-    }
-  }
-  Format(instr, mnemonic, nfd.SubstitutePlaceholders(form));
-}
-
-void DisassemblingDecoder::VisitNEONScalarByIndexedElement(Instruction* instr) {
-  const char* mnemonic = "unimplemented";
-  const char* form = "%sd, %sn, 'Ve.%s['IVByElemIndex]";
-  NEONFormatDecoder nfd(instr, NEONFormatDecoder::ScalarFormatMap());
-  bool long_instr = false;
-
-  switch (instr->Mask(NEONScalarByIndexedElementMask)) {
-    case NEON_SQDMULL_byelement_scalar:
-      mnemonic = "sqdmull";
-      long_instr = true;
-      break;
-    case NEON_SQDMLAL_byelement_scalar:
-      mnemonic = "sqdmlal";
-      long_instr = true;
-      break;
-    case NEON_SQDMLSL_byelement_scalar:
-      mnemonic = "sqdmlsl";
-      long_instr = true;
-      break;
-    case NEON_SQDMULH_byelement_scalar:
-      mnemonic = "sqdmulh";
-      break;
-    case NEON_SQRDMULH_byelement_scalar:
-      mnemonic = "sqrdmulh";
-      break;
-    default:
-      nfd.SetFormatMap(0, nfd.FPScalarFormatMap());
-      switch (instr->Mask(NEONScalarByIndexedElementFPMask)) {
-        case NEON_FMUL_byelement_scalar:
-          mnemonic = "fmul";
-          break;
-        case NEON_FMLA_byelement_scalar:
-          mnemonic = "fmla";
-          break;
-        case NEON_FMLS_byelement_scalar:
-          mnemonic = "fmls";
-          break;
-        case NEON_FMULX_byelement_scalar:
-          mnemonic = "fmulx";
-          break;
-        default:
-          form = "(NEONScalarByIndexedElement)";
-      }
-  }
-
-  if (long_instr) {
-    nfd.SetFormatMap(0, nfd.LongScalarFormatMap());
-  }
-
-  Format(instr, mnemonic,
-         nfd.Substitute(form, nfd.kPlaceholder, nfd.kPlaceholder, nfd.kFormat));
-}
-
-void DisassemblingDecoder::VisitNEONScalarCopy(Instruction* instr) {
-  const char* mnemonic = "unimplemented";
-  const char* form = "(NEONScalarCopy)";
-
-  NEONFormatDecoder nfd(instr, NEONFormatDecoder::TriangularScalarFormatMap());
-
-  if (instr->Mask(NEONScalarCopyMask) == NEON_DUP_ELEMENT_scalar) {
-    mnemonic = "mov";
-    form = "%sd, 'Vn.%s['IVInsIndex1]";
-  }
-
-  Format(instr, mnemonic, nfd.Substitute(form, nfd.kPlaceholder, nfd.kFormat));
-}
-
-void DisassemblingDecoder::VisitNEONScalarPairwise(Instruction* instr) {
-  const char* mnemonic = "unimplemented";
-  const char* form = "%sd, 'Vn.%s";
-  NEONFormatMap map = {{22}, {NF_2S, NF_2D}};
-  NEONFormatDecoder nfd(instr, NEONFormatDecoder::FPScalarFormatMap(), &map);
-
-  switch (instr->Mask(NEONScalarPairwiseMask)) {
-    case NEON_ADDP_scalar:
-      mnemonic = "addp";
-      break;
-    case NEON_FADDP_scalar:
-      mnemonic = "faddp";
-      break;
-    case NEON_FMAXP_scalar:
-      mnemonic = "fmaxp";
-      break;
-    case NEON_FMAXNMP_scalar:
-      mnemonic = "fmaxnmp";
-      break;
-    case NEON_FMINP_scalar:
-      mnemonic = "fminp";
-      break;
-    case NEON_FMINNMP_scalar:
-      mnemonic = "fminnmp";
-      break;
-    default:
-      form = "(NEONScalarPairwise)";
-  }
-  Format(instr, mnemonic,
-         nfd.Substitute(form, NEONFormatDecoder::kPlaceholder,
-                        NEONFormatDecoder::kFormat));
-}
-
-void DisassemblingDecoder::VisitNEONScalarShiftImmediate(Instruction* instr) {
-  const char* mnemonic = "unimplemented";
-  const char* form = "%sd, %sn, 'Is1";
-  const char* form_2 = "%sd, %sn, 'Is2";
-
-  static const NEONFormatMap map_shift = {
-      {22, 21, 20, 19},
-      {NF_UNDEF, NF_B, NF_H, NF_H, NF_S, NF_S, NF_S, NF_S, NF_D, NF_D, NF_D,
-       NF_D, NF_D, NF_D, NF_D, NF_D}};
-  static const NEONFormatMap map_shift_narrow = {
-      {21, 20, 19}, {NF_UNDEF, NF_H, NF_S, NF_S, NF_D, NF_D, NF_D, NF_D}};
-  NEONFormatDecoder nfd(instr, &map_shift);
-
-  if (instr->ImmNEONImmh()) {  // immh has to be non-zero.
-    switch (instr->Mask(NEONScalarShiftImmediateMask)) {
-      case NEON_FCVTZU_imm_scalar:
-        mnemonic = "fcvtzu";
-        break;
-      case NEON_FCVTZS_imm_scalar:
-        mnemonic = "fcvtzs";
-        break;
-      case NEON_SCVTF_imm_scalar:
-        mnemonic = "scvtf";
-        break;
-      case NEON_UCVTF_imm_scalar:
-        mnemonic = "ucvtf";
-        break;
-      case NEON_SRI_scalar:
-        mnemonic = "sri";
-        break;
-      case NEON_SSHR_scalar:
-        mnemonic = "sshr";
-        break;
-      case NEON_USHR_scalar:
-        mnemonic = "ushr";
-        break;
-      case NEON_SRSHR_scalar:
-        mnemonic = "srshr";
-        break;
-      case NEON_URSHR_scalar:
-        mnemonic = "urshr";
-        break;
-      case NEON_SSRA_scalar:
-        mnemonic = "ssra";
-        break;
-      case NEON_USRA_scalar:
-        mnemonic = "usra";
-        break;
-      case NEON_SRSRA_scalar:
-        mnemonic = "srsra";
-        break;
-      case NEON_URSRA_scalar:
-        mnemonic = "ursra";
-        break;
-      case NEON_SHL_scalar:
-        mnemonic = "shl";
-        form = form_2;
-        break;
-      case NEON_SLI_scalar:
-        mnemonic = "sli";
-        form = form_2;
-        break;
-      case NEON_SQSHLU_scalar:
-        mnemonic = "sqshlu";
-        form = form_2;
-        break;
-      case NEON_SQSHL_imm_scalar:
-        mnemonic = "sqshl";
-        form = form_2;
-        break;
-      case NEON_UQSHL_imm_scalar:
-        mnemonic = "uqshl";
-        form = form_2;
-        break;
-      case NEON_UQSHRN_scalar:
-        mnemonic = "uqshrn";
-        nfd.SetFormatMap(1, &map_shift_narrow);
-        break;
-      case NEON_UQRSHRN_scalar:
-        mnemonic = "uqrshrn";
-        nfd.SetFormatMap(1, &map_shift_narrow);
-        break;
-      case NEON_SQSHRN_scalar:
-        mnemonic = "sqshrn";
-        nfd.SetFormatMap(1, &map_shift_narrow);
-        break;
-      case NEON_SQRSHRN_scalar:
-        mnemonic = "sqrshrn";
-        nfd.SetFormatMap(1, &map_shift_narrow);
-        break;
-      case NEON_SQSHRUN_scalar:
-        mnemonic = "sqshrun";
-        nfd.SetFormatMap(1, &map_shift_narrow);
-        break;
-      case NEON_SQRSHRUN_scalar:
-        mnemonic = "sqrshrun";
-        nfd.SetFormatMap(1, &map_shift_narrow);
-        break;
-      default:
-        form = "(NEONScalarShiftImmediate)";
-    }
-  } else {
-    form = "(NEONScalarShiftImmediate)";
-  }
-  Format(instr, mnemonic, nfd.SubstitutePlaceholders(form));
-}
-
-void DisassemblingDecoder::VisitNEONShiftImmediate(Instruction* instr) {
-  const char* mnemonic = "unimplemented";
-  const char* form = "'Vd.%s, 'Vn.%s, 'Is1";
-  const char* form_shift_2 = "'Vd.%s, 'Vn.%s, 'Is2";
-  const char* form_xtl = "'Vd.%s, 'Vn.%s";
-
-  // 0001->8H, 001x->4S, 01xx->2D, all others undefined.
-  static const NEONFormatMap map_shift_ta = {
-      {22, 21, 20, 19},
-      {NF_UNDEF, NF_8H, NF_4S, NF_4S, NF_2D, NF_2D, NF_2D, NF_2D}};
-
-  // 00010->8B, 00011->16B, 001x0->4H, 001x1->8H,
-  // 01xx0->2S, 01xx1->4S, 1xxx1->2D, all others undefined.
-  static const NEONFormatMap map_shift_tb = {
-      {22, 21, 20, 19, 30},
-      {NF_UNDEF, NF_UNDEF, NF_8B,    NF_16B, NF_4H,    NF_8H, NF_4H,    NF_8H,
-       NF_2S,    NF_4S,    NF_2S,    NF_4S,  NF_2S,    NF_4S, NF_2S,    NF_4S,
-       NF_UNDEF, NF_2D,    NF_UNDEF, NF_2D,  NF_UNDEF, NF_2D, NF_UNDEF, NF_2D,
-       NF_UNDEF, NF_2D,    NF_UNDEF, NF_2D,  NF_UNDEF, NF_2D, NF_UNDEF, NF_2D}};
-
-  NEONFormatDecoder nfd(instr, &map_shift_tb);
-
-  if (instr->ImmNEONImmh()) {  // immh has to be non-zero.
-    switch (instr->Mask(NEONShiftImmediateMask)) {
-      case NEON_SQSHLU:
-        mnemonic = "sqshlu";
-        form = form_shift_2;
-        break;
-      case NEON_SQSHL_imm:
-        mnemonic = "sqshl";
-        form = form_shift_2;
-        break;
-      case NEON_UQSHL_imm:
-        mnemonic = "uqshl";
-        form = form_shift_2;
-        break;
-      case NEON_SHL:
-        mnemonic = "shl";
-        form = form_shift_2;
-        break;
-      case NEON_SLI:
-        mnemonic = "sli";
-        form = form_shift_2;
-        break;
-      case NEON_SCVTF_imm:
-        mnemonic = "scvtf";
-        break;
-      case NEON_UCVTF_imm:
-        mnemonic = "ucvtf";
-        break;
-      case NEON_FCVTZU_imm:
-        mnemonic = "fcvtzu";
-        break;
-      case NEON_FCVTZS_imm:
-        mnemonic = "fcvtzs";
-        break;
-      case NEON_SRI:
-        mnemonic = "sri";
-        break;
-      case NEON_SSHR:
-        mnemonic = "sshr";
-        break;
-      case NEON_USHR:
-        mnemonic = "ushr";
-        break;
-      case NEON_SRSHR:
-        mnemonic = "srshr";
-        break;
-      case NEON_URSHR:
-        mnemonic = "urshr";
-        break;
-      case NEON_SSRA:
-        mnemonic = "ssra";
-        break;
-      case NEON_USRA:
-        mnemonic = "usra";
-        break;
-      case NEON_SRSRA:
-        mnemonic = "srsra";
-        break;
-      case NEON_URSRA:
-        mnemonic = "ursra";
-        break;
-      case NEON_SHRN:
-        mnemonic = instr->Mask(NEON_Q) ? "shrn2" : "shrn";
-        nfd.SetFormatMap(1, &map_shift_ta);
-        break;
-      case NEON_RSHRN:
-        mnemonic = instr->Mask(NEON_Q) ? "rshrn2" : "rshrn";
-        nfd.SetFormatMap(1, &map_shift_ta);
-        break;
-      case NEON_UQSHRN:
-        mnemonic = instr->Mask(NEON_Q) ? "uqshrn2" : "uqshrn";
-        nfd.SetFormatMap(1, &map_shift_ta);
-        break;
-      case NEON_UQRSHRN:
-        mnemonic = instr->Mask(NEON_Q) ? "uqrshrn2" : "uqrshrn";
-        nfd.SetFormatMap(1, &map_shift_ta);
-        break;
-      case NEON_SQSHRN:
-        mnemonic = instr->Mask(NEON_Q) ? "sqshrn2" : "sqshrn";
-        nfd.SetFormatMap(1, &map_shift_ta);
-        break;
-      case NEON_SQRSHRN:
-        mnemonic = instr->Mask(NEON_Q) ? "sqrshrn2" : "sqrshrn";
-        nfd.SetFormatMap(1, &map_shift_ta);
-        break;
-      case NEON_SQSHRUN:
-        mnemonic = instr->Mask(NEON_Q) ? "sqshrun2" : "sqshrun";
-        nfd.SetFormatMap(1, &map_shift_ta);
-        break;
-      case NEON_SQRSHRUN:
-        mnemonic = instr->Mask(NEON_Q) ? "sqrshrun2" : "sqrshrun";
-        nfd.SetFormatMap(1, &map_shift_ta);
-        break;
-      case NEON_SSHLL:
-        nfd.SetFormatMap(0, &map_shift_ta);
-        if (instr->ImmNEONImmb() == 0 &&
-            CountSetBits(instr->ImmNEONImmh(), 32) == 1) {  // sxtl variant.
-          form = form_xtl;
-          mnemonic = instr->Mask(NEON_Q) ? "sxtl2" : "sxtl";
-        } else {  // sshll variant.
-          form = form_shift_2;
-          mnemonic = instr->Mask(NEON_Q) ? "sshll2" : "sshll";
-        }
-        break;
-      case NEON_USHLL:
-        nfd.SetFormatMap(0, &map_shift_ta);
-        if (instr->ImmNEONImmb() == 0 &&
-            CountSetBits(instr->ImmNEONImmh(), 32) == 1) {  // uxtl variant.
-          form = form_xtl;
-          mnemonic = instr->Mask(NEON_Q) ? "uxtl2" : "uxtl";
-        } else {  // ushll variant.
-          form = form_shift_2;
-          mnemonic = instr->Mask(NEON_Q) ? "ushll2" : "ushll";
-        }
-        break;
-      default:
-        form = "(NEONShiftImmediate)";
-    }
-  } else {
-    form = "(NEONShiftImmediate)";
-  }
-  Format(instr, mnemonic, nfd.Substitute(form));
-}
-
-void DisassemblingDecoder::VisitNEONTable(Instruction* instr) {
-  const char* mnemonic = "unimplemented";
-  const char* form = "(NEONTable)";
-  const char form_1v[] = "'Vd.%%s, {'Vn.16b}, 'Vm.%%s";
-  const char form_2v[] = "'Vd.%%s, {'Vn.16b, v%d.16b}, 'Vm.%%s";
-  const char form_3v[] = "'Vd.%%s, {'Vn.16b, v%d.16b, v%d.16b}, 'Vm.%%s";
-  const char form_4v[] =
-      "'Vd.%%s, {'Vn.16b, v%d.16b, v%d.16b, v%d.16b}, 'Vm.%%s";
-  static const NEONFormatMap map_b = {{30}, {NF_8B, NF_16B}};
-  NEONFormatDecoder nfd(instr, &map_b);
-
-  switch (instr->Mask(NEONTableMask)) {
-    case NEON_TBL_1v:
-      mnemonic = "tbl";
-      form = form_1v;
-      break;
-    case NEON_TBL_2v:
-      mnemonic = "tbl";
-      form = form_2v;
-      break;
-    case NEON_TBL_3v:
-      mnemonic = "tbl";
-      form = form_3v;
-      break;
-    case NEON_TBL_4v:
-      mnemonic = "tbl";
-      form = form_4v;
-      break;
-    case NEON_TBX_1v:
-      mnemonic = "tbx";
-      form = form_1v;
-      break;
-    case NEON_TBX_2v:
-      mnemonic = "tbx";
-      form = form_2v;
-      break;
-    case NEON_TBX_3v:
-      mnemonic = "tbx";
-      form = form_3v;
-      break;
-    case NEON_TBX_4v:
-      mnemonic = "tbx";
-      form = form_4v;
-      break;
-    default:
-      break;
-  }
-
-  char re_form[sizeof(form_4v)];
-  int reg_num = instr->Rn();
-  snprintf(re_form, sizeof(re_form), form, (reg_num + 1) % kNumberOfVRegisters,
-           (reg_num + 2) % kNumberOfVRegisters,
-           (reg_num + 3) % kNumberOfVRegisters);
-
-  Format(instr, mnemonic, nfd.Substitute(re_form));
-}
-
-void DisassemblingDecoder::VisitUnimplemented(Instruction* instr) {
-  Format(instr, "unimplemented", "(Unimplemented)");
-}
-
-void DisassemblingDecoder::VisitUnallocated(Instruction* instr) {
-  Format(instr, "unallocated", "(Unallocated)");
-}
-
-void DisassemblingDecoder::ProcessOutput(Instruction* /*instr*/) {
-  // The base disasm does nothing more than disassembling into a buffer.
-}
-
-void DisassemblingDecoder::AppendRegisterNameToOutput(const CPURegister& reg) {
-  DCHECK(reg.IsValid());
-  char reg_char;
-
-  if (reg.IsRegister()) {
-    reg_char = reg.Is64Bits() ? 'x' : 'w';
-  } else {
-    DCHECK(reg.IsVRegister());
-    switch (reg.SizeInBits()) {
-      case kBRegSizeInBits:
-        reg_char = 'b';
-        break;
-      case kHRegSizeInBits:
-        reg_char = 'h';
-        break;
-      case kSRegSizeInBits:
-        reg_char = 's';
-        break;
-      case kDRegSizeInBits:
-        reg_char = 'd';
-        break;
-      default:
-        DCHECK(reg.Is128Bits());
-        reg_char = 'q';
-    }
-  }
-
-  if (reg.IsVRegister() || !(reg.Aliases(csp) || reg.Aliases(xzr))) {
-    // Filter special registers
-    if (reg.IsX() && (reg.code() == 27)) {
-      AppendToOutput("cp");
-    } else if (reg.IsX() && (reg.code() == 29)) {
-      AppendToOutput("fp");
-    } else if (reg.IsX() && (reg.code() == 30)) {
-      AppendToOutput("lr");
-    } else {
-      // A core or scalar/vector register: [wx]0 - 30, [bhsdq]0 - 31.
-      AppendToOutput("%c%d", reg_char, reg.code());
-    }
-  } else if (reg.Aliases(csp)) {
-    // Disassemble w31/x31 as stack pointer wcsp/csp.
-    AppendToOutput("%s", reg.Is64Bits() ? "csp" : "wcsp");
-  } else {
-    // Disassemble w31/x31 as zero register wzr/xzr.
-    AppendToOutput("%czr", reg_char);
-  }
-}
-
-void DisassemblingDecoder::Format(Instruction* instr, const char* mnemonic,
-                                  const char* format) {
-  // TODO(mcapewel) don't think I can use the instr address here - there needs
-  //                to be a base address too
-  DCHECK_NOT_NULL(mnemonic);
-  ResetOutput();
-  Substitute(instr, mnemonic);
-  if (format != nullptr) {
-    buffer_[buffer_pos_++] = ' ';
-    Substitute(instr, format);
-  }
-  buffer_[buffer_pos_] = 0;
-  ProcessOutput(instr);
-}
-
-void DisassemblingDecoder::Substitute(Instruction* instr, const char* string) {
-  char chr = *string++;
-  while (chr != '\0') {
-    if (chr == '\'') {
-      string += SubstituteField(instr, string);
-    } else {
-      buffer_[buffer_pos_++] = chr;
-    }
-    chr = *string++;
-  }
-}
-
-int DisassemblingDecoder::SubstituteField(Instruction* instr,
-                                          const char* format) {
-  switch (format[0]) {
-    // NB. The remaining substitution prefix characters are: GJKUZ.
-    case 'R':  // Register. X or W, selected by sf bit.
-    case 'F':  // FP register. S or D, selected by type field.
-    case 'V':  // Vector register, V, vector format.
-    case 'W':
-    case 'X':
-    case 'B':
-    case 'H':
-    case 'S':
-    case 'D':
-    case 'Q':
-      return SubstituteRegisterField(instr, format);
-    case 'I':
-      return SubstituteImmediateField(instr, format);
-    case 'L':
-      return SubstituteLiteralField(instr, format);
-    case 'N':
-      return SubstituteShiftField(instr, format);
-    case 'P':
-      return SubstitutePrefetchField(instr, format);
-    case 'C':
-      return SubstituteConditionField(instr, format);
-    case 'E':
-      return SubstituteExtendField(instr, format);
-    case 'A':
-      return SubstitutePCRelAddressField(instr, format);
-    case 'T':
-      return SubstituteBranchTargetField(instr, format);
-    case 'O':
-      return SubstituteLSRegOffsetField(instr, format);
-    case 'M':
-      return SubstituteBarrierField(instr, format);
-    default:
-      UNREACHABLE();
-  }
-}
-
-int DisassemblingDecoder::SubstituteRegisterField(Instruction* instr,
-                                                  const char* format) {
-  char reg_prefix = format[0];
-  unsigned reg_num = 0;
-  unsigned field_len = 2;
-
-  switch (format[1]) {
-    case 'd':
-      reg_num = instr->Rd();
-      if (format[2] == 'q') {
-        reg_prefix = instr->NEONQ() ? 'X' : 'W';
-        field_len = 3;
-      }
-      break;
-    case 'n':
-      reg_num = instr->Rn();
-      break;
-    case 'm':
-      reg_num = instr->Rm();
-      switch (format[2]) {
-        // Handle registers tagged with b (bytes), z (instruction), or
-        // r (registers), used for address updates in
-        // NEON load/store instructions.
-        case 'r':
-        case 'b':
-        case 'z': {
-          field_len = 3;
-          char* eimm;
-          int imm = static_cast<int>(strtol(&format[3], &eimm, 10));
-          field_len += eimm - &format[3];
-          if (reg_num == 31) {
-            switch (format[2]) {
-              case 'z':
-                imm *= (1 << instr->NEONLSSize());
-                break;
-              case 'r':
-                imm *= (instr->NEONQ() == 0) ? kDRegSize : kQRegSize;
-                break;
-              case 'b':
-                break;
-            }
-            AppendToOutput("#%d", imm);
-            return field_len;
-          }
-          break;
-        }
-      }
-      break;
-    case 'e':
-      // This is register Rm, but using a 4-bit specifier. Used in NEON
-      // by-element instructions.
-      reg_num = (instr->Rm() & 0xF);
-      break;
-    case 'a':
-      reg_num = instr->Ra();
-      break;
-    case 't':
-      reg_num = instr->Rt();
-      if (format[0] == 'V') {
-        if ((format[2] >= '2') && (format[2] <= '4')) {
-          // Handle consecutive vector register specifiers Vt2, Vt3 and Vt4.
-          reg_num = (reg_num + format[2] - '1') % 32;
-          field_len = 3;
-        }
-      } else {
-        if (format[2] == '2') {
-          // Handle register specifier Rt2.
-          reg_num = instr->Rt2();
-          field_len = 3;
-        }
-      }
-      break;
-    case 's':
-      reg_num = instr->Rs();
-      break;
-    default:
-      UNREACHABLE();
-  }
-
-  // Increase field length for registers tagged as stack.
-  if (format[2] == 's') {
-    field_len = 3;
-  }
-
-  CPURegister::RegisterType reg_type;
-  unsigned reg_size;
-
-  if (reg_prefix == 'R') {
-    reg_prefix = instr->SixtyFourBits() ? 'X' : 'W';
-  } else if (reg_prefix == 'F') {
-    reg_prefix = ((instr->FPType() & 1) == 0) ? 'S' : 'D';
-  }
-
-  switch (reg_prefix) {
-    case 'W':
-      reg_type = CPURegister::kRegister;
-      reg_size = kWRegSizeInBits;
-      break;
-    case 'X':
-      reg_type = CPURegister::kRegister;
-      reg_size = kXRegSizeInBits;
-      break;
-    case 'B':
-      reg_type = CPURegister::kVRegister;
-      reg_size = kBRegSizeInBits;
-      break;
-    case 'H':
-      reg_type = CPURegister::kVRegister;
-      reg_size = kHRegSizeInBits;
-      break;
-    case 'S':
-      reg_type = CPURegister::kVRegister;
-      reg_size = kSRegSizeInBits;
-      break;
-    case 'D':
-      reg_type = CPURegister::kVRegister;
-      reg_size = kDRegSizeInBits;
-      break;
-    case 'Q':
-      reg_type = CPURegister::kVRegister;
-      reg_size = kQRegSizeInBits;
-      break;
-    case 'V':
-      AppendToOutput("v%d", reg_num);
-      return field_len;
-    default:
-      UNREACHABLE();
-  }
-
-  if ((reg_type == CPURegister::kRegister) && (reg_num == kZeroRegCode) &&
-      (format[2] == 's')) {
-    reg_num = kSPRegInternalCode;
-  }
-
-  AppendRegisterNameToOutput(CPURegister::Create(reg_num, reg_size, reg_type));
-
-  return field_len;
-}
-
-int DisassemblingDecoder::SubstituteImmediateField(Instruction* instr,
-                                                   const char* format) {
-  DCHECK_EQ(format[0], 'I');
-
-  switch (format[1]) {
-    case 'M': {  // IMoveImm or IMoveLSL.
-      if (format[5] == 'I' || format[5] == 'N') {
-        uint64_t imm = static_cast<uint64_t>(instr->ImmMoveWide())
-                       << (16 * instr->ShiftMoveWide());
-        if (format[5] == 'N') imm = ~imm;
-        if (!instr->SixtyFourBits()) imm &= UINT64_C(0xFFFFFFFF);
-        AppendToOutput("#0x%" PRIx64, imm);
-      } else {
-        DCHECK_EQ(format[5], 'L');
-        AppendToOutput("#0x%" PRIx64, instr->ImmMoveWide());
-        if (instr->ShiftMoveWide() > 0) {
-          AppendToOutput(", lsl #%d", 16 * instr->ShiftMoveWide());
-        }
-      }
-      return 8;
-    }
-    case 'L': {
-      switch (format[2]) {
-        case 'L': {  // ILLiteral - Immediate Load Literal.
-          AppendToOutput("pc%+" PRId32, instr->ImmLLiteral()
-                                            << kLoadLiteralScaleLog2);
-          return 9;
-        }
-        case 'S': {  // ILS - Immediate Load/Store.
-          if (instr->ImmLS() != 0) {
-            AppendToOutput(", #%" PRId32, instr->ImmLS());
-          }
-          return 3;
-        }
-        case 'P': {  // ILPx - Immediate Load/Store Pair, x = access size.
-          if (instr->ImmLSPair() != 0) {
-            // format[3] is the scale value. Convert to a number.
-            int scale = 1 << (format[3] - '0');
-            AppendToOutput(", #%" PRId32, instr->ImmLSPair() * scale);
-          }
-          return 4;
-        }
-        case 'U': {  // ILU - Immediate Load/Store Unsigned.
-          if (instr->ImmLSUnsigned() != 0) {
-            int shift = instr->SizeLS();
-            AppendToOutput(", #%" PRId32, instr->ImmLSUnsigned() << shift);
-          }
-          return 3;
-        }
-      }
-    }
-    case 'C': {  // ICondB - Immediate Conditional Branch.
-      int64_t offset = instr->ImmCondBranch() << 2;
-      char sign = (offset >= 0) ? '+' : '-';
-      AppendToOutput("#%c0x%" PRIx64, sign, offset);
-      return 6;
-    }
-    case 'A': {  // IAddSub.
-      DCHECK_LE(instr->ShiftAddSub(), 1);
-      int64_t imm = instr->ImmAddSub() << (12 * instr->ShiftAddSub());
-      AppendToOutput("#0x%" PRIx64 " (%" PRId64 ")", imm, imm);
-      return 7;
-    }
-    case 'F': {  // IFPSingle, IFPDouble or IFPFBits.
-      if (format[3] == 'F') {  // IFPFBits.
-        AppendToOutput("#%d", 64 - instr->FPScale());
-        return 8;
-      } else {
-        AppendToOutput("#0x%" PRIx32 " (%.4f)", instr->ImmFP(),
-                       format[3] == 'S' ? instr->ImmFP32() : instr->ImmFP64());
-        return 9;
-      }
-    }
-    case 'T': {  // ITri - Immediate Triangular Encoded.
-      AppendToOutput("#0x%" PRIx64, instr->ImmLogical());
-      return 4;
-    }
-    case 'N': {  // INzcv.
-      int nzcv = (instr->Nzcv() << Flags_offset);
-      AppendToOutput("#%c%c%c%c", ((nzcv & NFlag) == 0) ? 'n' : 'N',
-                                  ((nzcv & ZFlag) == 0) ? 'z' : 'Z',
-                                  ((nzcv & CFlag) == 0) ? 'c' : 'C',
-                                  ((nzcv & VFlag) == 0) ? 'v' : 'V');
-      return 5;
-    }
-    case 'P': {  // IP - Conditional compare.
-      AppendToOutput("#%d", instr->ImmCondCmp());
-      return 2;
-    }
-    case 'B': {  // Bitfields.
-      return SubstituteBitfieldImmediateField(instr, format);
-    }
-    case 'E': {  // IExtract.
-      AppendToOutput("#%d", instr->ImmS());
-      return 8;
-    }
-    case 'S': {  // IS - Test and branch bit.
-      AppendToOutput("#%d", (instr->ImmTestBranchBit5() << 5) |
-                            instr->ImmTestBranchBit40());
-      return 2;
-    }
-    case 's': {  // Is - Shift (immediate).
-      switch (format[2]) {
-        case '1': {  // Is1 - SSHR.
-          int shift = 16 << HighestSetBitPosition(instr->ImmNEONImmh());
-          shift -= instr->ImmNEONImmhImmb();
-          AppendToOutput("#%d", shift);
-          return 3;
-        }
-        case '2': {  // Is2 - SLI.
-          int shift = instr->ImmNEONImmhImmb();
-          shift -= 8 << HighestSetBitPosition(instr->ImmNEONImmh());
-          AppendToOutput("#%d", shift);
-          return 3;
-        }
-        default: {
-          UNIMPLEMENTED();
-          return 0;
-        }
-      }
-    }
-    case 'D': {  // IDebug - HLT and BRK instructions.
-      AppendToOutput("#0x%x", instr->ImmException());
-      return 6;
-    }
-    case 'V': {  // Immediate Vector.
-      switch (format[2]) {
-        case 'E': {  // IVExtract.
-          AppendToOutput("#%" PRId64, instr->ImmNEONExt());
-          return 9;
-        }
-        case 'B': {  // IVByElemIndex.
-          int vm_index = (instr->NEONH() << 1) | instr->NEONL();
-          if (instr->NEONSize() == 1) {
-            vm_index = (vm_index << 1) | instr->NEONM();
-          }
-          AppendToOutput("%d", vm_index);
-          return static_cast<int>(strlen("IVByElemIndex"));
-        }
-        case 'I': {  // INS element.
-          if (strncmp(format, "IVInsIndex", strlen("IVInsIndex")) == 0) {
-            unsigned rd_index, rn_index;
-            unsigned imm5 = instr->ImmNEON5();
-            unsigned imm4 = instr->ImmNEON4();
-            int tz = CountTrailingZeros(imm5, 32);
-            if (tz <= 3) {  // Defined for 0 <= tz <= 3 only.
-              rd_index = imm5 >> (tz + 1);
-              rn_index = imm4 >> tz;
-              if (strncmp(format, "IVInsIndex1", strlen("IVInsIndex1")) == 0) {
-                AppendToOutput("%d", rd_index);
-                return static_cast<int>(strlen("IVInsIndex1"));
-              } else if (strncmp(format, "IVInsIndex2",
-                                 strlen("IVInsIndex2")) == 0) {
-                AppendToOutput("%d", rn_index);
-                return static_cast<int>(strlen("IVInsIndex2"));
-              }
-            }
-            return 0;
-          }
-        }
-        case 'L': {  // IVLSLane[0123] - suffix indicates access size shift.
-          AppendToOutput("%d", instr->NEONLSIndex(format[8] - '0'));
-          return 9;
-        }
-        case 'M': {  // Modified Immediate cases.
-          if (strncmp(format, "IVMIImmFPSingle", strlen("IVMIImmFPSingle")) ==
-              0) {
-            AppendToOutput("#0x%" PRIx32 " (%.4f)", instr->ImmNEONabcdefgh(),
-                           instr->ImmNEONFP32());
-            return static_cast<int>(strlen("IVMIImmFPSingle"));
-          } else if (strncmp(format, "IVMIImmFPDouble",
-                             strlen("IVMIImmFPDouble")) == 0) {
-            AppendToOutput("#0x%" PRIx32 " (%.4f)", instr->ImmNEONabcdefgh(),
-                           instr->ImmNEONFP64());
-            return static_cast<int>(strlen("IVMIImmFPDouble"));
-          } else if (strncmp(format, "IVMIImm8", strlen("IVMIImm8")) == 0) {
-            uint64_t imm8 = instr->ImmNEONabcdefgh();
-            AppendToOutput("#0x%" PRIx64, imm8);
-            return static_cast<int>(strlen("IVMIImm8"));
-          } else if (strncmp(format, "IVMIImm", strlen("IVMIImm")) == 0) {
-            uint64_t imm8 = instr->ImmNEONabcdefgh();
-            uint64_t imm = 0;
-            for (int i = 0; i < 8; ++i) {
-              if (imm8 & (1 << i)) {
-                imm |= (UINT64_C(0xFF) << (8 * i));
-              }
-            }
-            AppendToOutput("#0x%" PRIx64, imm);
-            return static_cast<int>(strlen("IVMIImm"));
-          } else if (strncmp(format, "IVMIShiftAmt1",
-                             strlen("IVMIShiftAmt1")) == 0) {
-            int cmode = instr->NEONCmode();
-            int shift_amount = 8 * ((cmode >> 1) & 3);
-            AppendToOutput("#%d", shift_amount);
-            return static_cast<int>(strlen("IVMIShiftAmt1"));
-          } else if (strncmp(format, "IVMIShiftAmt2",
-                             strlen("IVMIShiftAmt2")) == 0) {
-            int cmode = instr->NEONCmode();
-            int shift_amount = 8 << (cmode & 1);
-            AppendToOutput("#%d", shift_amount);
-            return static_cast<int>(strlen("IVMIShiftAmt2"));
-          } else {
-            UNIMPLEMENTED();
-            return 0;
-          }
-        }
-        default: {
-          UNIMPLEMENTED();
-          return 0;
-        }
-      }
-    }
-    default: {
-      printf("%s", format);
-      UNREACHABLE();
-    }
-  }
-}
-
-
-int DisassemblingDecoder::SubstituteBitfieldImmediateField(Instruction* instr,
-                                                           const char* format) {
-  DCHECK((format[0] == 'I') && (format[1] == 'B'));
-  unsigned r = instr->ImmR();
-  unsigned s = instr->ImmS();
-
-  switch (format[2]) {
-    case 'r': {  // IBr.
-      AppendToOutput("#%d", r);
-      return 3;
-    }
-    case 's': {  // IBs+1 or IBs-r+1.
-      if (format[3] == '+') {
-        AppendToOutput("#%d", s + 1);
-        return 5;
-      } else {
-        DCHECK_EQ(format[3], '-');
-        AppendToOutput("#%d", s - r + 1);
-        return 7;
-      }
-    }
-    case 'Z': {  // IBZ-r.
-      DCHECK((format[3] == '-') && (format[4] == 'r'));
-      unsigned reg_size = (instr->SixtyFourBits() == 1) ? kXRegSizeInBits
-                                                        : kWRegSizeInBits;
-      AppendToOutput("#%d", reg_size - r);
-      return 5;
-    }
-    default: {
-      UNREACHABLE();
-    }
-  }
-}
-
-
-int DisassemblingDecoder::SubstituteLiteralField(Instruction* instr,
-                                                 const char* format) {
-  DCHECK_EQ(strncmp(format, "LValue", 6), 0);
-  USE(format);
-
-  switch (instr->Mask(LoadLiteralMask)) {
-    case LDR_w_lit:
-    case LDR_x_lit:
-    case LDR_s_lit:
-    case LDR_d_lit:
-      AppendToOutput("(addr 0x%016" PRIxPTR ")", instr->LiteralAddress());
-      break;
-    default: UNREACHABLE();
-  }
-
-  return 6;
-}
-
-
-int DisassemblingDecoder::SubstituteShiftField(Instruction* instr,
-                                               const char* format) {
-  DCHECK_EQ(format[0], 'N');
-  DCHECK_LE(instr->ShiftDP(), 0x3);
-
-  switch (format[1]) {
-    case 'D': {  // NDP.
-      DCHECK(instr->ShiftDP() != ROR);
-    }  // Fall through.
-    case 'L': {  // NLo.
-      if (instr->ImmDPShift() != 0) {
-        const char* shift_type[] = {"lsl", "lsr", "asr", "ror"};
-        AppendToOutput(", %s #%" PRId32, shift_type[instr->ShiftDP()],
-                       instr->ImmDPShift());
-      }
-      return 3;
-    }
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-int DisassemblingDecoder::SubstituteConditionField(Instruction* instr,
-                                                   const char* format) {
-  DCHECK_EQ(format[0], 'C');
-  const char* condition_code[] = { "eq", "ne", "hs", "lo",
-                                   "mi", "pl", "vs", "vc",
-                                   "hi", "ls", "ge", "lt",
-                                   "gt", "le", "al", "nv" };
-  int cond;
-  switch (format[1]) {
-    case 'B': cond = instr->ConditionBranch(); break;
-    case 'I': {
-      cond = NegateCondition(static_cast<Condition>(instr->Condition()));
-      break;
-    }
-    default: cond = instr->Condition();
-  }
-  AppendToOutput("%s", condition_code[cond]);
-  return 4;
-}
-
-
-int DisassemblingDecoder::SubstitutePCRelAddressField(Instruction* instr,
-                                                      const char* format) {
-  USE(format);
-  DCHECK_EQ(strncmp(format, "AddrPCRel", 9), 0);
-
-  int offset = instr->ImmPCRel();
-
-  // Only ADR (AddrPCRelByte) is supported.
-  DCHECK_EQ(strcmp(format, "AddrPCRelByte"), 0);
-
-  char sign = '+';
-  if (offset < 0) {
-    offset = -offset;
-    sign = '-';
-  }
-  AppendToOutput("#%c0x%x (addr %p)", sign, offset,
-                 instr->InstructionAtOffset(offset, Instruction::NO_CHECK));
-  return 13;
-}
-
-
-int DisassemblingDecoder::SubstituteBranchTargetField(Instruction* instr,
-                                                      const char* format) {
-  DCHECK_EQ(strncmp(format, "TImm", 4), 0);
-
-  int64_t offset = 0;
-  switch (format[5]) {
-    // TImmUncn - unconditional branch immediate.
-    case 'n': offset = instr->ImmUncondBranch(); break;
-    // TImmCond - conditional branch immediate.
-    case 'o': offset = instr->ImmCondBranch(); break;
-    // TImmCmpa - compare and branch immediate.
-    case 'm': offset = instr->ImmCmpBranch(); break;
-    // TImmTest - test and branch immediate.
-    case 'e': offset = instr->ImmTestBranch(); break;
-    default: UNREACHABLE();
-  }
-  offset <<= kInstructionSizeLog2;
-  char sign = '+';
-  if (offset < 0) {
-    sign = '-';
-  }
-  AppendToOutput("#%c0x%" PRIx64 " (addr %p)", sign, Abs(offset),
-                 instr->InstructionAtOffset(offset), Instruction::NO_CHECK);
-  return 8;
-}
-
-
-int DisassemblingDecoder::SubstituteExtendField(Instruction* instr,
-                                                const char* format) {
-  DCHECK_EQ(strncmp(format, "Ext", 3), 0);
-  DCHECK_LE(instr->ExtendMode(), 7);
-  USE(format);
-
-  const char* extend_mode[] = { "uxtb", "uxth", "uxtw", "uxtx",
-                                "sxtb", "sxth", "sxtw", "sxtx" };
-
-  // If rd or rn is SP, uxtw on 32-bit registers and uxtx on 64-bit
-  // registers becomes lsl.
-  if (((instr->Rd() == kZeroRegCode) || (instr->Rn() == kZeroRegCode)) &&
-      (((instr->ExtendMode() == UXTW) && (instr->SixtyFourBits() == 0)) ||
-       (instr->ExtendMode() == UXTX))) {
-    if (instr->ImmExtendShift() > 0) {
-      AppendToOutput(", lsl #%d", instr->ImmExtendShift());
-    }
-  } else {
-    AppendToOutput(", %s", extend_mode[instr->ExtendMode()]);
-    if (instr->ImmExtendShift() > 0) {
-      AppendToOutput(" #%d", instr->ImmExtendShift());
-    }
-  }
-  return 3;
-}
-
-
-int DisassemblingDecoder::SubstituteLSRegOffsetField(Instruction* instr,
-                                                     const char* format) {
-  DCHECK_EQ(strncmp(format, "Offsetreg", 9), 0);
-  const char* extend_mode[] = { "undefined", "undefined", "uxtw", "lsl",
-                                "undefined", "undefined", "sxtw", "sxtx" };
-  USE(format);
-
-  unsigned shift = instr->ImmShiftLS();
-  Extend ext = static_cast<Extend>(instr->ExtendMode());
-  char reg_type = ((ext == UXTW) || (ext == SXTW)) ? 'w' : 'x';
-
-  unsigned rm = instr->Rm();
-  if (rm == kZeroRegCode) {
-    AppendToOutput("%czr", reg_type);
-  } else {
-    AppendToOutput("%c%d", reg_type, rm);
-  }
-
-  // Extend mode UXTX is an alias for shift mode LSL here.
-  if (!((ext == UXTX) && (shift == 0))) {
-    AppendToOutput(", %s", extend_mode[ext]);
-    if (shift != 0) {
-      AppendToOutput(" #%d", instr->SizeLS());
-    }
-  }
-  return 9;
-}
-
-
-int DisassemblingDecoder::SubstitutePrefetchField(Instruction* instr,
-                                                  const char* format) {
-  DCHECK_EQ(format[0], 'P');
-  USE(format);
-
-  int prefetch_mode = instr->PrefetchMode();
-
-  const char* ls = (prefetch_mode & 0x10) ? "st" : "ld";
-  int level = (prefetch_mode >> 1) + 1;
-  const char* ks = (prefetch_mode & 1) ? "strm" : "keep";
-
-  AppendToOutput("p%sl%d%s", ls, level, ks);
-  return 6;
-}
-
-int DisassemblingDecoder::SubstituteBarrierField(Instruction* instr,
-                                                 const char* format) {
-  DCHECK_EQ(format[0], 'M');
-  USE(format);
-
-  static const char* const options[4][4] = {
-    { "sy (0b0000)", "oshld", "oshst", "osh" },
-    { "sy (0b0100)", "nshld", "nshst", "nsh" },
-    { "sy (0b1000)", "ishld", "ishst", "ish" },
-    { "sy (0b1100)", "ld", "st", "sy" }
-  };
-  int domain = instr->ImmBarrierDomain();
-  int type = instr->ImmBarrierType();
-
-  AppendToOutput("%s", options[domain][type]);
-  return 1;
-}
-
-
-void DisassemblingDecoder::ResetOutput() {
-  buffer_pos_ = 0;
-  buffer_[buffer_pos_] = 0;
-}
-
-
-void DisassemblingDecoder::AppendToOutput(const char* format, ...) {
-  va_list args;
-  va_start(args, format);
-  buffer_pos_ += vsnprintf(&buffer_[buffer_pos_], buffer_size_, format, args);
-  va_end(args);
-}
-
-
-void PrintDisassembler::ProcessOutput(Instruction* instr) {
-  fprintf(stream_, "0x%016" PRIx64 "  %08" PRIx32 "\t\t%s\n",
-          reinterpret_cast<uint64_t>(instr), instr->InstructionBits(),
-          GetOutput());
-}
-
-}  // namespace internal
-}  // namespace v8
-
-
-namespace disasm {
-
-
-const char* NameConverter::NameOfAddress(byte* addr) const {
-  v8::internal::SNPrintF(tmp_buffer_, "%p", static_cast<void *>(addr));
-  return tmp_buffer_.start();
-}
-
-
-const char* NameConverter::NameOfConstant(byte* addr) const {
-  return NameOfAddress(addr);
-}
-
-
-const char* NameConverter::NameOfCPURegister(int reg) const {
-  unsigned ureg = reg;  // Avoid warnings about signed/unsigned comparisons.
-  if (ureg >= v8::internal::kNumberOfRegisters) {
-    return "noreg";
-  }
-  if (ureg == v8::internal::kZeroRegCode) {
-    return "xzr";
-  }
-  v8::internal::SNPrintF(tmp_buffer_, "x%u", ureg);
-  return tmp_buffer_.start();
-}
-
-
-const char* NameConverter::NameOfByteCPURegister(int reg) const {
-  UNREACHABLE();  // ARM64 does not have the concept of a byte register
-  return "nobytereg";
-}
-
-
-const char* NameConverter::NameOfXMMRegister(int reg) const {
-  UNREACHABLE();  // ARM64 does not have any XMM registers
-  return "noxmmreg";
-}
-
-
-const char* NameConverter::NameInCode(byte* addr) const {
-  // The default name converter is called for unknown code, so we will not try
-  // to access any memory.
-  return "";
-}
-
-
-//------------------------------------------------------------------------------
-
-class BufferDisassembler : public v8::internal::DisassemblingDecoder {
- public:
-  explicit BufferDisassembler(v8::internal::Vector<char> out_buffer)
-      : out_buffer_(out_buffer) { }
-
-  ~BufferDisassembler() { }
-
-  virtual void ProcessOutput(v8::internal::Instruction* instr) {
-    v8::internal::SNPrintF(out_buffer_, "%08" PRIx32 "       %s",
-                           instr->InstructionBits(), GetOutput());
-  }
-
- private:
-  v8::internal::Vector<char> out_buffer_;
-};
-
-Disassembler::Disassembler(const NameConverter& converter)
-    : converter_(converter) {}
-
-
-Disassembler::~Disassembler() { USE(converter_); }
-
-
-int Disassembler::InstructionDecode(v8::internal::Vector<char> buffer,
-                                    byte* instr) {
-  v8::internal::Decoder<v8::internal::DispatchingDecoderVisitor> decoder;
-  BufferDisassembler disasm(buffer);
-  decoder.AppendVisitor(&disasm);
-
-  decoder.Decode(reinterpret_cast<v8::internal::Instruction*>(instr));
-  return v8::internal::kInstructionSize;
-}
-
-
-int Disassembler::ConstantPoolSizeAt(byte* instr) {
-  return v8::internal::Assembler::ConstantPoolSizeAt(
-      reinterpret_cast<v8::internal::Instruction*>(instr));
-}
-
-
-void Disassembler::Disassemble(FILE* file, byte* start, byte* end) {
-  v8::internal::Decoder<v8::internal::DispatchingDecoderVisitor> decoder;
-  v8::internal::PrintDisassembler disasm(file);
-  decoder.AppendVisitor(&disasm);
-
-  for (byte* pc = start; pc < end; pc += v8::internal::kInstructionSize) {
-    decoder.Decode(reinterpret_cast<v8::internal::Instruction*>(pc));
-  }
-}
-
-}  // namespace disasm
-
-#endif  // V8_TARGET_ARCH_ARM64
diff --git a/src/v8/src/arm64/disasm-arm64.h b/src/v8/src/arm64/disasm-arm64.h
deleted file mode 100644
index c12d53b..0000000
--- a/src/v8/src/arm64/disasm-arm64.h
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_ARM64_DISASM_ARM64_H
-#define V8_ARM64_DISASM_ARM64_H
-
-#include "src/arm64/assembler-arm64.h"
-#include "src/arm64/decoder-arm64.h"
-#include "src/arm64/instructions-arm64.h"
-#include "src/globals.h"
-#include "src/utils.h"
-
-namespace v8 {
-namespace internal {
-
-
-class DisassemblingDecoder : public DecoderVisitor {
- public:
-  DisassemblingDecoder();
-  DisassemblingDecoder(char* text_buffer, int buffer_size);
-  virtual ~DisassemblingDecoder();
-  char* GetOutput();
-
-  // Declare all Visitor functions.
-  #define DECLARE(A)  void Visit##A(Instruction* instr);
-  VISITOR_LIST(DECLARE)
-  #undef DECLARE
-
- protected:
-  virtual void ProcessOutput(Instruction* instr);
-
-  // Default output functions.  The functions below implement a default way of
-  // printing elements in the disassembly. A sub-class can override these to
-  // customize the disassembly output.
-
-  // Prints the name of a register.
-  virtual void AppendRegisterNameToOutput(const CPURegister& reg);
-
-  void Format(Instruction* instr, const char* mnemonic, const char* format);
-  void Substitute(Instruction* instr, const char* string);
-  int SubstituteField(Instruction* instr, const char* format);
-  int SubstituteRegisterField(Instruction* instr, const char* format);
-  int SubstituteImmediateField(Instruction* instr, const char* format);
-  int SubstituteLiteralField(Instruction* instr, const char* format);
-  int SubstituteBitfieldImmediateField(Instruction* instr, const char* format);
-  int SubstituteShiftField(Instruction* instr, const char* format);
-  int SubstituteExtendField(Instruction* instr, const char* format);
-  int SubstituteConditionField(Instruction* instr, const char* format);
-  int SubstitutePCRelAddressField(Instruction* instr, const char* format);
-  int SubstituteBranchTargetField(Instruction* instr, const char* format);
-  int SubstituteLSRegOffsetField(Instruction* instr, const char* format);
-  int SubstitutePrefetchField(Instruction* instr, const char* format);
-  int SubstituteBarrierField(Instruction* instr, const char* format);
-
-  bool RdIsZROrSP(Instruction* instr) const {
-    return (instr->Rd() == kZeroRegCode);
-  }
-
-  bool RnIsZROrSP(Instruction* instr) const {
-    return (instr->Rn() == kZeroRegCode);
-  }
-
-  bool RmIsZROrSP(Instruction* instr) const {
-    return (instr->Rm() == kZeroRegCode);
-  }
-
-  bool RaIsZROrSP(Instruction* instr) const {
-    return (instr->Ra() == kZeroRegCode);
-  }
-
-  bool IsMovzMovnImm(unsigned reg_size, uint64_t value);
-
-  void ResetOutput();
-  void AppendToOutput(const char* string, ...);
-
-  char* buffer_;
-  uint32_t buffer_pos_;
-  uint32_t buffer_size_;
-  bool own_buffer_;
-};
-
-
-class PrintDisassembler : public DisassemblingDecoder {
- public:
-  explicit PrintDisassembler(FILE* stream) : stream_(stream) { }
-  ~PrintDisassembler() { }
-
-  virtual void ProcessOutput(Instruction* instr);
-
- private:
-  FILE *stream_;
-};
-
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_ARM64_DISASM_ARM64_H
diff --git a/src/v8/src/arm64/eh-frame-arm64.cc b/src/v8/src/arm64/eh-frame-arm64.cc
deleted file mode 100644
index 48909d5..0000000
--- a/src/v8/src/arm64/eh-frame-arm64.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/arm64/assembler-arm64-inl.h"
-#include "src/eh-frame.h"
-
-namespace v8 {
-namespace internal {
-
-static const int kX0DwarfCode = 0;
-static const int kFpDwarfCode = 29;
-static const int kLrDwarfCode = 30;
-static const int kCSpDwarfCode = 31;
-
-const int EhFrameConstants::kCodeAlignmentFactor = 4;
-const int EhFrameConstants::kDataAlignmentFactor = -8;
-
-void EhFrameWriter::WriteReturnAddressRegisterCode() {
-  WriteULeb128(kLrDwarfCode);
-}
-
-void EhFrameWriter::WriteInitialStateInCie() {
-  SetBaseAddressRegisterAndOffset(x29, 0);
-  RecordRegisterNotModified(x30);
-}
-
-// static
-int EhFrameWriter::RegisterToDwarfCode(Register name) {
-  switch (name.code()) {
-    case kRegCode_x29:
-      return kFpDwarfCode;
-    case kRegCode_x30:
-      return kLrDwarfCode;
-    case kSPRegInternalCode:
-      return kCSpDwarfCode;
-    case kRegCode_x0:
-      return kX0DwarfCode;
-    default:
-      UNIMPLEMENTED();
-      return -1;
-  }
-}
-
-#ifdef ENABLE_DISASSEMBLER
-
-// static
-const char* EhFrameDisassembler::DwarfRegisterCodeToString(int code) {
-  switch (code) {
-    case kFpDwarfCode:
-      return "fp";
-    case kLrDwarfCode:
-      return "lr";
-    case kCSpDwarfCode:
-      return "csp";  // This could be zr as well
-    default:
-      UNIMPLEMENTED();
-      return nullptr;
-  }
-}
-
-#endif
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/arm64/frame-constants-arm64.cc b/src/v8/src/arm64/frame-constants-arm64.cc
deleted file mode 100644
index a37b665..0000000
--- a/src/v8/src/arm64/frame-constants-arm64.cc
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2013 the V8 project 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 "src/frame-constants.h"
-
-#if V8_TARGET_ARCH_ARM64
-
-#include "src/arm64/assembler-arm64-inl.h"
-#include "src/arm64/assembler-arm64.h"
-#include "src/assembler.h"
-
-#include "src/arm64/frame-constants-arm64.h"
-
-namespace v8 {
-namespace internal {
-
-Register JavaScriptFrame::fp_register() { return v8::internal::fp; }
-Register JavaScriptFrame::context_register() { return cp; }
-Register JavaScriptFrame::constant_pool_pointer_register() { UNREACHABLE(); }
-
-int InterpreterFrameConstants::RegisterStackSlotCount(int register_count) {
-  // Round up to a multiple of two, to make the frame a multiple of 16 bytes.
-  return RoundUp(register_count, 2);
-}
-
-int BuiltinContinuationFrameConstants::PaddingSlotCount(int register_count) {
-  // Round the total slot count up to a multiple of two, to make the frame a
-  // multiple of 16 bytes.
-  int slot_count = kFixedSlotCount + register_count;
-  int rounded_slot_count = RoundUp(slot_count, 2);
-  return rounded_slot_count - slot_count;
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_ARM64
diff --git a/src/v8/src/arm64/frame-constants-arm64.h b/src/v8/src/arm64/frame-constants-arm64.h
deleted file mode 100644
index a337079..0000000
--- a/src/v8/src/arm64/frame-constants-arm64.h
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_ARM64_FRAMES_ARM64_H_
-#define V8_ARM64_FRAMES_ARM64_H_
-
-namespace v8 {
-namespace internal {
-
-// The layout of an EntryFrame is as follows:
-//
-//  slot      Entry frame
-//       +---------------------+-----------------------
-//   0   |  bad frame pointer  |  <-- frame ptr
-//       |   (0xFFF.. FF)      |
-//       |- - - - - - - - - - -|
-//   1   | stack frame marker  |
-//       |      (ENTRY)        |
-//       |- - - - - - - - - - -|
-//   2   | stack frame marker  |
-//       |        (0)          |
-//       |- - - - - - - - - - -|
-//   3   |     C entry FP      |
-//       |- - - - - - - - - - -|
-//   4   |   JS entry frame    |
-//       |       marker        |
-//       |- - - - - - - - - - -|
-//   5   |      padding        |  <-- stack ptr
-//  -----+---------------------+-----------------------
-//
-class EntryFrameConstants : public AllStatic {
- public:
-  static const int kCallerFPOffset = -3 * kPointerSize;
-  static const int kFixedFrameSize = 6 * kPointerSize;
-};
-
-class ExitFrameConstants : public TypedFrameConstants {
- public:
-  static const int kSPOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(0);
-  static const int kCodeOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(1);
-  static const int kPaddingOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(2);
-  DEFINE_TYPED_FRAME_SIZES(3);
-  static const int kLastExitFrameField = kPaddingOffset;
-
-  static const int kConstantPoolOffset = 0;  // Not used
-};
-
-class JavaScriptFrameConstants : public AllStatic {
- public:
-  // FP-relative.
-  static const int kLocal0Offset = StandardFrameConstants::kExpressionsOffset;
-
-  // There are two words on the stack (saved fp and saved lr) between fp and
-  // the arguments.
-  static const int kLastParameterOffset = 2 * kPointerSize;
-
-  static const int kFunctionOffset = StandardFrameConstants::kFunctionOffset;
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_ARM64_FRAMES_ARM64_H_
diff --git a/src/v8/src/arm64/instructions-arm64-constants.cc b/src/v8/src/arm64/instructions-arm64-constants.cc
deleted file mode 100644
index 0a15287..0000000
--- a/src/v8/src/arm64/instructions-arm64-constants.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2017 the V8 project 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 <cstdint>
-
-namespace v8 {
-namespace internal {
-
-// ISA constants. --------------------------------------------------------------
-
-// The following code initializes float/double variables with bit patterns
-// without using static initializers (which is surprisingly difficult in
-// C++).  These variables are used by client code as extern float16,
-// extern float and extern double types, which works because (I think) the
-// linker ignores the types.  This is kept in a separate source file to
-// avoid breaking jumbo builds.
-//
-// TODO(mostynb): replace these with std::numeric_limits constexpr's where
-// possible, and figure out how to replace *DefaultNaN with something clean,
-// then move this code back into instructions-arm64.cc with the same types
-// that client code uses.
-
-extern const uint16_t kFP16PositiveInfinity = 0x7C00;
-extern const uint16_t kFP16NegativeInfinity = 0xFC00;
-extern const uint32_t kFP32PositiveInfinity = 0x7F800000;
-extern const uint32_t kFP32NegativeInfinity = 0xFF800000;
-extern const uint64_t kFP64PositiveInfinity = 0x7FF0000000000000UL;
-extern const uint64_t kFP64NegativeInfinity = 0xFFF0000000000000UL;
-
-// This value is a signalling NaN as both a double and as a float (taking the
-// least-significant word).
-extern const uint64_t kFP64SignallingNaN = 0x7FF000007F800001;
-extern const uint32_t kFP32SignallingNaN = 0x7F800001;
-
-// A similar value, but as a quiet NaN.
-extern const uint64_t kFP64QuietNaN = 0x7FF800007FC00001;
-extern const uint32_t kFP32QuietNaN = 0x7FC00001;
-
-// The default NaN values (for FPCR.DN=1).
-extern const uint64_t kFP64DefaultNaN = 0x7FF8000000000000UL;
-extern const uint32_t kFP32DefaultNaN = 0x7FC00000;
-extern const uint16_t kFP16DefaultNaN = 0x7E00;
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/arm64/instructions-arm64.cc b/src/v8/src/arm64/instructions-arm64.cc
deleted file mode 100644
index 272948a..0000000
--- a/src/v8/src/arm64/instructions-arm64.cc
+++ /dev/null
@@ -1,748 +0,0 @@
-// Copyright 2013 the V8 project 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 V8_TARGET_ARCH_ARM64
-
-#include "src/arm64/assembler-arm64-inl.h"
-#include "src/arm64/instructions-arm64.h"
-
-namespace v8 {
-namespace internal {
-
-bool Instruction::IsLoad() const {
-  if (Mask(LoadStoreAnyFMask) != LoadStoreAnyFixed) {
-    return false;
-  }
-
-  if (Mask(LoadStorePairAnyFMask) == LoadStorePairAnyFixed) {
-    return Mask(LoadStorePairLBit) != 0;
-  } else {
-    LoadStoreOp op = static_cast<LoadStoreOp>(Mask(LoadStoreMask));
-    switch (op) {
-      case LDRB_w:
-      case LDRH_w:
-      case LDR_w:
-      case LDR_x:
-      case LDRSB_w:
-      case LDRSB_x:
-      case LDRSH_w:
-      case LDRSH_x:
-      case LDRSW_x:
-      case LDR_b:
-      case LDR_h:
-      case LDR_s:
-      case LDR_d:
-      case LDR_q:
-        return true;
-      default: return false;
-    }
-  }
-}
-
-
-bool Instruction::IsStore() const {
-  if (Mask(LoadStoreAnyFMask) != LoadStoreAnyFixed) {
-    return false;
-  }
-
-  if (Mask(LoadStorePairAnyFMask) == LoadStorePairAnyFixed) {
-    return Mask(LoadStorePairLBit) == 0;
-  } else {
-    LoadStoreOp op = static_cast<LoadStoreOp>(Mask(LoadStoreMask));
-    switch (op) {
-      case STRB_w:
-      case STRH_w:
-      case STR_w:
-      case STR_x:
-      case STR_b:
-      case STR_h:
-      case STR_s:
-      case STR_d:
-      case STR_q:
-        return true;
-      default: return false;
-    }
-  }
-}
-
-
-static uint64_t RotateRight(uint64_t value,
-                            unsigned int rotate,
-                            unsigned int width) {
-  DCHECK_LE(width, 64);
-  rotate &= 63;
-  return ((value & ((1UL << rotate) - 1UL)) << (width - rotate)) |
-         (value >> rotate);
-}
-
-
-static uint64_t RepeatBitsAcrossReg(unsigned reg_size,
-                                    uint64_t value,
-                                    unsigned width) {
-  DCHECK((width == 2) || (width == 4) || (width == 8) || (width == 16) ||
-         (width == 32));
-  DCHECK((reg_size == kWRegSizeInBits) || (reg_size == kXRegSizeInBits));
-  uint64_t result = value & ((1UL << width) - 1UL);
-  for (unsigned i = width; i < reg_size; i *= 2) {
-    result |= (result << i);
-  }
-  return result;
-}
-
-
-// Logical immediates can't encode zero, so a return value of zero is used to
-// indicate a failure case. Specifically, where the constraints on imm_s are not
-// met.
-uint64_t Instruction::ImmLogical() {
-  unsigned reg_size = SixtyFourBits() ? kXRegSizeInBits : kWRegSizeInBits;
-  int32_t n = BitN();
-  int32_t imm_s = ImmSetBits();
-  int32_t imm_r = ImmRotate();
-
-  // An integer is constructed from the n, imm_s and imm_r bits according to
-  // the following table:
-  //
-  //  N   imms    immr    size        S             R
-  //  1  ssssss  rrrrrr    64    UInt(ssssss)  UInt(rrrrrr)
-  //  0  0sssss  xrrrrr    32    UInt(sssss)   UInt(rrrrr)
-  //  0  10ssss  xxrrrr    16    UInt(ssss)    UInt(rrrr)
-  //  0  110sss  xxxrrr     8    UInt(sss)     UInt(rrr)
-  //  0  1110ss  xxxxrr     4    UInt(ss)      UInt(rr)
-  //  0  11110s  xxxxxr     2    UInt(s)       UInt(r)
-  // (s bits must not be all set)
-  //
-  // A pattern is constructed of size bits, where the least significant S+1
-  // bits are set. The pattern is rotated right by R, and repeated across a
-  // 32 or 64-bit value, depending on destination register width.
-  //
-
-  if (n == 1) {
-    if (imm_s == 0x3F) {
-      return 0;
-    }
-    uint64_t bits = (1UL << (imm_s + 1)) - 1;
-    return RotateRight(bits, imm_r, 64);
-  } else {
-    if ((imm_s >> 1) == 0x1F) {
-      return 0;
-    }
-    for (int width = 0x20; width >= 0x2; width >>= 1) {
-      if ((imm_s & width) == 0) {
-        int mask = width - 1;
-        if ((imm_s & mask) == mask) {
-          return 0;
-        }
-        uint64_t bits = (1UL << ((imm_s & mask) + 1)) - 1;
-        return RepeatBitsAcrossReg(reg_size,
-                                   RotateRight(bits, imm_r & mask, width),
-                                   width);
-      }
-    }
-  }
-  UNREACHABLE();
-}
-
-uint32_t Instruction::ImmNEONabcdefgh() const {
-  return ImmNEONabc() << 5 | ImmNEONdefgh();
-}
-
-float Instruction::ImmFP32() { return Imm8ToFP32(ImmFP()); }
-
-double Instruction::ImmFP64() { return Imm8ToFP64(ImmFP()); }
-
-float Instruction::ImmNEONFP32() const { return Imm8ToFP32(ImmNEONabcdefgh()); }
-
-double Instruction::ImmNEONFP64() const {
-  return Imm8ToFP64(ImmNEONabcdefgh());
-}
-
-unsigned CalcLSDataSize(LoadStoreOp op) {
-  DCHECK_EQ(static_cast<unsigned>(LSSize_offset + LSSize_width),
-            kInstructionSize * 8);
-  unsigned size = static_cast<Instr>(op) >> LSSize_offset;
-  if ((op & LSVector_mask) != 0) {
-    // Vector register memory operations encode the access size in the "size"
-    // and "opc" fields.
-    if ((size == 0) && ((op & LSOpc_mask) >> LSOpc_offset) >= 2) {
-      size = kQRegSizeLog2;
-    }
-  }
-  return size;
-}
-
-unsigned CalcLSPairDataSize(LoadStorePairOp op) {
-  static_assert(kXRegSize == kDRegSize, "X and D registers must be same size.");
-  static_assert(kWRegSize == kSRegSize, "W and S registers must be same size.");
-  switch (op) {
-    case STP_q:
-    case LDP_q:
-      return kQRegSizeLog2;
-    case STP_x:
-    case LDP_x:
-    case STP_d:
-    case LDP_d:
-      return kXRegSizeLog2;
-    default:
-      return kWRegSizeLog2;
-  }
-}
-
-
-int64_t Instruction::ImmPCOffset() {
-  int64_t offset;
-  if (IsPCRelAddressing()) {
-    // PC-relative addressing. Only ADR is supported.
-    offset = ImmPCRel();
-  } else if (BranchType() != UnknownBranchType) {
-    // All PC-relative branches.
-    // Relative branch offsets are instruction-size-aligned.
-    offset = ImmBranch() << kInstructionSizeLog2;
-  } else if (IsUnresolvedInternalReference()) {
-    // Internal references are always word-aligned.
-    offset = ImmUnresolvedInternalReference() << kInstructionSizeLog2;
-  } else {
-    // Load literal (offset from PC).
-    DCHECK(IsLdrLiteral());
-    // The offset is always shifted by 2 bits, even for loads to 64-bits
-    // registers.
-    offset = ImmLLiteral() << kInstructionSizeLog2;
-  }
-  return offset;
-}
-
-
-Instruction* Instruction::ImmPCOffsetTarget() {
-  return InstructionAtOffset(ImmPCOffset());
-}
-
-
-bool Instruction::IsValidImmPCOffset(ImmBranchType branch_type,
-                                     ptrdiff_t offset) {
-  return is_intn(offset, ImmBranchRangeBitwidth(branch_type));
-}
-
-
-bool Instruction::IsTargetInImmPCOffsetRange(Instruction* target) {
-  return IsValidImmPCOffset(BranchType(), DistanceTo(target));
-}
-
-void Instruction::SetImmPCOffsetTarget(Assembler::IsolateData isolate_data,
-                                       Instruction* target) {
-  if (IsPCRelAddressing()) {
-    SetPCRelImmTarget(isolate_data, target);
-  } else if (BranchType() != UnknownBranchType) {
-    SetBranchImmTarget(target);
-  } else if (IsUnresolvedInternalReference()) {
-    SetUnresolvedInternalReferenceImmTarget(isolate_data, target);
-  } else {
-    // Load literal (offset from PC).
-    SetImmLLiteral(target);
-  }
-}
-
-void Instruction::SetPCRelImmTarget(Assembler::IsolateData isolate_data,
-                                    Instruction* target) {
-  // ADRP is not supported, so 'this' must point to an ADR instruction.
-  DCHECK(IsAdr());
-
-  ptrdiff_t target_offset = DistanceTo(target);
-  Instr imm;
-  if (Instruction::IsValidPCRelOffset(target_offset)) {
-    imm = Assembler::ImmPCRelAddress(static_cast<int>(target_offset));
-    SetInstructionBits(Mask(~ImmPCRel_mask) | imm);
-  } else {
-    PatchingAssembler patcher(isolate_data, reinterpret_cast<byte*>(this),
-                              PatchingAssembler::kAdrFarPatchableNInstrs);
-    patcher.PatchAdrFar(target_offset);
-  }
-}
-
-
-void Instruction::SetBranchImmTarget(Instruction* target) {
-  DCHECK(IsAligned(DistanceTo(target), kInstructionSize));
-  DCHECK(IsValidImmPCOffset(BranchType(),
-                            DistanceTo(target) >> kInstructionSizeLog2));
-  int offset = static_cast<int>(DistanceTo(target) >> kInstructionSizeLog2);
-  Instr branch_imm = 0;
-  uint32_t imm_mask = 0;
-  switch (BranchType()) {
-    case CondBranchType: {
-      branch_imm = Assembler::ImmCondBranch(offset);
-      imm_mask = ImmCondBranch_mask;
-      break;
-    }
-    case UncondBranchType: {
-      branch_imm = Assembler::ImmUncondBranch(offset);
-      imm_mask = ImmUncondBranch_mask;
-      break;
-    }
-    case CompareBranchType: {
-      branch_imm = Assembler::ImmCmpBranch(offset);
-      imm_mask = ImmCmpBranch_mask;
-      break;
-    }
-    case TestBranchType: {
-      branch_imm = Assembler::ImmTestBranch(offset);
-      imm_mask = ImmTestBranch_mask;
-      break;
-    }
-    default: UNREACHABLE();
-  }
-  SetInstructionBits(Mask(~imm_mask) | branch_imm);
-}
-
-void Instruction::SetUnresolvedInternalReferenceImmTarget(
-    Assembler::IsolateData isolate_data, Instruction* target) {
-  DCHECK(IsUnresolvedInternalReference());
-  DCHECK(IsAligned(DistanceTo(target), kInstructionSize));
-  DCHECK(is_int32(DistanceTo(target) >> kInstructionSizeLog2));
-  int32_t target_offset =
-      static_cast<int32_t>(DistanceTo(target) >> kInstructionSizeLog2);
-  uint32_t high16 = unsigned_bitextract_32(31, 16, target_offset);
-  uint32_t low16 = unsigned_bitextract_32(15, 0, target_offset);
-
-  PatchingAssembler patcher(isolate_data, reinterpret_cast<byte*>(this), 2);
-  patcher.brk(high16);
-  patcher.brk(low16);
-}
-
-
-void Instruction::SetImmLLiteral(Instruction* source) {
-  DCHECK(IsLdrLiteral());
-  DCHECK(IsAligned(DistanceTo(source), kInstructionSize));
-  DCHECK(Assembler::IsImmLLiteral(DistanceTo(source)));
-  Instr imm = Assembler::ImmLLiteral(
-      static_cast<int>(DistanceTo(source) >> kLoadLiteralScaleLog2));
-  Instr mask = ImmLLiteral_mask;
-
-  SetInstructionBits(Mask(~mask) | imm);
-}
-
-
-// TODO(jbramley): We can't put this inline in the class because things like
-// xzr and Register are not defined in that header. Consider adding
-// instructions-arm64-inl.h to work around this.
-bool InstructionSequence::IsInlineData() const {
-  // Inline data is encoded as a single movz instruction which writes to xzr
-  // (x31).
-  return IsMovz() && SixtyFourBits() && (Rd() == kZeroRegCode);
-  // TODO(all): If we extend ::InlineData() to support bigger data, we need
-  // to update this method too.
-}
-
-
-// TODO(jbramley): We can't put this inline in the class because things like
-// xzr and Register are not defined in that header. Consider adding
-// instructions-arm64-inl.h to work around this.
-uint64_t InstructionSequence::InlineData() const {
-  DCHECK(IsInlineData());
-  uint64_t payload = ImmMoveWide();
-  // TODO(all): If we extend ::InlineData() to support bigger data, we need
-  // to update this method too.
-  return payload;
-}
-
-VectorFormat VectorFormatHalfWidth(VectorFormat vform) {
-  DCHECK(vform == kFormat8H || vform == kFormat4S || vform == kFormat2D ||
-         vform == kFormatH || vform == kFormatS || vform == kFormatD);
-  switch (vform) {
-    case kFormat8H:
-      return kFormat8B;
-    case kFormat4S:
-      return kFormat4H;
-    case kFormat2D:
-      return kFormat2S;
-    case kFormatH:
-      return kFormatB;
-    case kFormatS:
-      return kFormatH;
-    case kFormatD:
-      return kFormatS;
-    default:
-      UNREACHABLE();
-  }
-}
-
-VectorFormat VectorFormatDoubleWidth(VectorFormat vform) {
-  DCHECK(vform == kFormat8B || vform == kFormat4H || vform == kFormat2S ||
-         vform == kFormatB || vform == kFormatH || vform == kFormatS);
-  switch (vform) {
-    case kFormat8B:
-      return kFormat8H;
-    case kFormat4H:
-      return kFormat4S;
-    case kFormat2S:
-      return kFormat2D;
-    case kFormatB:
-      return kFormatH;
-    case kFormatH:
-      return kFormatS;
-    case kFormatS:
-      return kFormatD;
-    default:
-      UNREACHABLE();
-  }
-}
-
-VectorFormat VectorFormatFillQ(VectorFormat vform) {
-  switch (vform) {
-    case kFormatB:
-    case kFormat8B:
-    case kFormat16B:
-      return kFormat16B;
-    case kFormatH:
-    case kFormat4H:
-    case kFormat8H:
-      return kFormat8H;
-    case kFormatS:
-    case kFormat2S:
-    case kFormat4S:
-      return kFormat4S;
-    case kFormatD:
-    case kFormat1D:
-    case kFormat2D:
-      return kFormat2D;
-    default:
-      UNREACHABLE();
-  }
-}
-
-VectorFormat VectorFormatHalfWidthDoubleLanes(VectorFormat vform) {
-  switch (vform) {
-    case kFormat4H:
-      return kFormat8B;
-    case kFormat8H:
-      return kFormat16B;
-    case kFormat2S:
-      return kFormat4H;
-    case kFormat4S:
-      return kFormat8H;
-    case kFormat1D:
-      return kFormat2S;
-    case kFormat2D:
-      return kFormat4S;
-    default:
-      UNREACHABLE();
-  }
-}
-
-VectorFormat VectorFormatDoubleLanes(VectorFormat vform) {
-  DCHECK(vform == kFormat8B || vform == kFormat4H || vform == kFormat2S);
-  switch (vform) {
-    case kFormat8B:
-      return kFormat16B;
-    case kFormat4H:
-      return kFormat8H;
-    case kFormat2S:
-      return kFormat4S;
-    default:
-      UNREACHABLE();
-  }
-}
-
-VectorFormat VectorFormatHalfLanes(VectorFormat vform) {
-  DCHECK(vform == kFormat16B || vform == kFormat8H || vform == kFormat4S);
-  switch (vform) {
-    case kFormat16B:
-      return kFormat8B;
-    case kFormat8H:
-      return kFormat4H;
-    case kFormat4S:
-      return kFormat2S;
-    default:
-      UNREACHABLE();
-  }
-}
-
-VectorFormat ScalarFormatFromLaneSize(int laneSize) {
-  switch (laneSize) {
-    case 8:
-      return kFormatB;
-    case 16:
-      return kFormatH;
-    case 32:
-      return kFormatS;
-    case 64:
-      return kFormatD;
-    default:
-      UNREACHABLE();
-  }
-}
-
-VectorFormat ScalarFormatFromFormat(VectorFormat vform) {
-  return ScalarFormatFromLaneSize(LaneSizeInBitsFromFormat(vform));
-}
-
-unsigned RegisterSizeInBytesFromFormat(VectorFormat vform) {
-  return RegisterSizeInBitsFromFormat(vform) / 8;
-}
-
-unsigned RegisterSizeInBitsFromFormat(VectorFormat vform) {
-  DCHECK_NE(vform, kFormatUndefined);
-  switch (vform) {
-    case kFormatB:
-      return kBRegSizeInBits;
-    case kFormatH:
-      return kHRegSizeInBits;
-    case kFormatS:
-      return kSRegSizeInBits;
-    case kFormatD:
-      return kDRegSizeInBits;
-    case kFormat8B:
-    case kFormat4H:
-    case kFormat2S:
-    case kFormat1D:
-      return kDRegSizeInBits;
-    default:
-      return kQRegSizeInBits;
-  }
-}
-
-unsigned LaneSizeInBitsFromFormat(VectorFormat vform) {
-  DCHECK_NE(vform, kFormatUndefined);
-  switch (vform) {
-    case kFormatB:
-    case kFormat8B:
-    case kFormat16B:
-      return 8;
-    case kFormatH:
-    case kFormat4H:
-    case kFormat8H:
-      return 16;
-    case kFormatS:
-    case kFormat2S:
-    case kFormat4S:
-      return 32;
-    case kFormatD:
-    case kFormat1D:
-    case kFormat2D:
-      return 64;
-    default:
-      UNREACHABLE();
-  }
-}
-
-int LaneSizeInBytesFromFormat(VectorFormat vform) {
-  return LaneSizeInBitsFromFormat(vform) / 8;
-}
-
-int LaneSizeInBytesLog2FromFormat(VectorFormat vform) {
-  DCHECK_NE(vform, kFormatUndefined);
-  switch (vform) {
-    case kFormatB:
-    case kFormat8B:
-    case kFormat16B:
-      return 0;
-    case kFormatH:
-    case kFormat4H:
-    case kFormat8H:
-      return 1;
-    case kFormatS:
-    case kFormat2S:
-    case kFormat4S:
-      return 2;
-    case kFormatD:
-    case kFormat1D:
-    case kFormat2D:
-      return 3;
-    default:
-      UNREACHABLE();
-  }
-}
-
-int LaneCountFromFormat(VectorFormat vform) {
-  DCHECK_NE(vform, kFormatUndefined);
-  switch (vform) {
-    case kFormat16B:
-      return 16;
-    case kFormat8B:
-    case kFormat8H:
-      return 8;
-    case kFormat4H:
-    case kFormat4S:
-      return 4;
-    case kFormat2S:
-    case kFormat2D:
-      return 2;
-    case kFormat1D:
-    case kFormatB:
-    case kFormatH:
-    case kFormatS:
-    case kFormatD:
-      return 1;
-    default:
-      UNREACHABLE();
-  }
-}
-
-int MaxLaneCountFromFormat(VectorFormat vform) {
-  DCHECK_NE(vform, kFormatUndefined);
-  switch (vform) {
-    case kFormatB:
-    case kFormat8B:
-    case kFormat16B:
-      return 16;
-    case kFormatH:
-    case kFormat4H:
-    case kFormat8H:
-      return 8;
-    case kFormatS:
-    case kFormat2S:
-    case kFormat4S:
-      return 4;
-    case kFormatD:
-    case kFormat1D:
-    case kFormat2D:
-      return 2;
-    default:
-      UNREACHABLE();
-  }
-}
-
-// Does 'vform' indicate a vector format or a scalar format?
-bool IsVectorFormat(VectorFormat vform) {
-  DCHECK_NE(vform, kFormatUndefined);
-  switch (vform) {
-    case kFormatB:
-    case kFormatH:
-    case kFormatS:
-    case kFormatD:
-      return false;
-    default:
-      return true;
-  }
-}
-
-int64_t MaxIntFromFormat(VectorFormat vform) {
-  return INT64_MAX >> (64 - LaneSizeInBitsFromFormat(vform));
-}
-
-int64_t MinIntFromFormat(VectorFormat vform) {
-  return INT64_MIN >> (64 - LaneSizeInBitsFromFormat(vform));
-}
-
-uint64_t MaxUintFromFormat(VectorFormat vform) {
-  return UINT64_MAX >> (64 - LaneSizeInBitsFromFormat(vform));
-}
-
-NEONFormatDecoder::NEONFormatDecoder(const Instruction* instr) {
-  instrbits_ = instr->InstructionBits();
-  SetFormatMaps(IntegerFormatMap());
-}
-
-NEONFormatDecoder::NEONFormatDecoder(const Instruction* instr,
-                                     const NEONFormatMap* format) {
-  instrbits_ = instr->InstructionBits();
-  SetFormatMaps(format);
-}
-
-NEONFormatDecoder::NEONFormatDecoder(const Instruction* instr,
-                                     const NEONFormatMap* format0,
-                                     const NEONFormatMap* format1) {
-  instrbits_ = instr->InstructionBits();
-  SetFormatMaps(format0, format1);
-}
-
-NEONFormatDecoder::NEONFormatDecoder(const Instruction* instr,
-                                     const NEONFormatMap* format0,
-                                     const NEONFormatMap* format1,
-                                     const NEONFormatMap* format2) {
-  instrbits_ = instr->InstructionBits();
-  SetFormatMaps(format0, format1, format2);
-}
-
-void NEONFormatDecoder::SetFormatMaps(const NEONFormatMap* format0,
-                                      const NEONFormatMap* format1,
-                                      const NEONFormatMap* format2) {
-  DCHECK_NOT_NULL(format0);
-  formats_[0] = format0;
-  formats_[1] = (format1 == nullptr) ? formats_[0] : format1;
-  formats_[2] = (format2 == nullptr) ? formats_[1] : format2;
-}
-
-void NEONFormatDecoder::SetFormatMap(unsigned index,
-                                     const NEONFormatMap* format) {
-  DCHECK_LT(index, arraysize(formats_));
-  DCHECK_NOT_NULL(format);
-  formats_[index] = format;
-}
-
-const char* NEONFormatDecoder::SubstitutePlaceholders(const char* string) {
-  return Substitute(string, kPlaceholder, kPlaceholder, kPlaceholder);
-}
-
-const char* NEONFormatDecoder::Substitute(const char* string,
-                                          SubstitutionMode mode0,
-                                          SubstitutionMode mode1,
-                                          SubstitutionMode mode2) {
-  snprintf(form_buffer_, sizeof(form_buffer_), string, GetSubstitute(0, mode0),
-           GetSubstitute(1, mode1), GetSubstitute(2, mode2));
-  return form_buffer_;
-}
-
-const char* NEONFormatDecoder::Mnemonic(const char* mnemonic) {
-  if ((instrbits_ & NEON_Q) != 0) {
-    snprintf(mne_buffer_, sizeof(mne_buffer_), "%s2", mnemonic);
-    return mne_buffer_;
-  }
-  return mnemonic;
-}
-
-VectorFormat NEONFormatDecoder::GetVectorFormat(int format_index) {
-  return GetVectorFormat(formats_[format_index]);
-}
-
-VectorFormat NEONFormatDecoder::GetVectorFormat(
-    const NEONFormatMap* format_map) {
-  static const VectorFormat vform[] = {
-      kFormatUndefined, kFormat8B, kFormat16B, kFormat4H, kFormat8H,
-      kFormat2S,        kFormat4S, kFormat1D,  kFormat2D, kFormatB,
-      kFormatH,         kFormatS,  kFormatD};
-  DCHECK_LT(GetNEONFormat(format_map), arraysize(vform));
-  return vform[GetNEONFormat(format_map)];
-}
-
-const char* NEONFormatDecoder::GetSubstitute(int index, SubstitutionMode mode) {
-  if (mode == kFormat) {
-    return NEONFormatAsString(GetNEONFormat(formats_[index]));
-  }
-  DCHECK_EQ(mode, kPlaceholder);
-  return NEONFormatAsPlaceholder(GetNEONFormat(formats_[index]));
-}
-
-NEONFormat NEONFormatDecoder::GetNEONFormat(const NEONFormatMap* format_map) {
-  return format_map->map[PickBits(format_map->bits)];
-}
-
-const char* NEONFormatDecoder::NEONFormatAsString(NEONFormat format) {
-  static const char* formats[] = {"undefined", "8b", "16b", "4h", "8h",
-                                  "2s",        "4s", "1d",  "2d", "b",
-                                  "h",         "s",  "d"};
-  DCHECK_LT(format, arraysize(formats));
-  return formats[format];
-}
-
-const char* NEONFormatDecoder::NEONFormatAsPlaceholder(NEONFormat format) {
-  DCHECK((format == NF_B) || (format == NF_H) || (format == NF_S) ||
-         (format == NF_D) || (format == NF_UNDEF));
-  static const char* formats[] = {
-      "undefined", "undefined", "undefined", "undefined", "undefined",
-      "undefined", "undefined", "undefined", "undefined", "'B",
-      "'H",        "'S",        "'D"};
-  return formats[format];
-}
-
-uint8_t NEONFormatDecoder::PickBits(const uint8_t bits[]) {
-  uint8_t result = 0;
-  for (unsigned b = 0; b < kNEONFormatMaxBits; b++) {
-    if (bits[b] == 0) break;
-    result <<= 1;
-    result |= ((instrbits_ & (1 << bits[b])) == 0) ? 0 : 1;
-  }
-  return result;
-}
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_ARM64
diff --git a/src/v8/src/arm64/instructions-arm64.h b/src/v8/src/arm64/instructions-arm64.h
deleted file mode 100644
index 0cc3e80..0000000
--- a/src/v8/src/arm64/instructions-arm64.h
+++ /dev/null
@@ -1,784 +0,0 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_ARM64_INSTRUCTIONS_ARM64_H_
-#define V8_ARM64_INSTRUCTIONS_ARM64_H_
-
-#include "src/arm64/constants-arm64.h"
-#include "src/arm64/utils-arm64.h"
-#include "src/assembler.h"
-#include "src/globals.h"
-#include "src/utils.h"
-
-namespace v8 {
-namespace internal {
-
-// ISA constants. --------------------------------------------------------------
-
-typedef uint32_t Instr;
-
-extern const float16 kFP16PositiveInfinity;
-extern const float16 kFP16NegativeInfinity;
-extern const float kFP32PositiveInfinity;
-extern const float kFP32NegativeInfinity;
-extern const double kFP64PositiveInfinity;
-extern const double kFP64NegativeInfinity;
-
-// This value is a signalling NaN as both a double and as a float (taking the
-// least-significant word).
-extern const double kFP64SignallingNaN;
-extern const float kFP32SignallingNaN;
-
-// A similar value, but as a quiet NaN.
-extern const double kFP64QuietNaN;
-extern const float kFP32QuietNaN;
-
-// The default NaN values (for FPCR.DN=1).
-extern const double kFP64DefaultNaN;
-extern const float kFP32DefaultNaN;
-extern const float16 kFP16DefaultNaN;
-
-unsigned CalcLSDataSize(LoadStoreOp op);
-unsigned CalcLSPairDataSize(LoadStorePairOp op);
-
-enum ImmBranchType {
-  UnknownBranchType = 0,
-  CondBranchType    = 1,
-  UncondBranchType  = 2,
-  CompareBranchType = 3,
-  TestBranchType    = 4
-};
-
-enum AddrMode {
-  Offset,
-  PreIndex,
-  PostIndex
-};
-
-enum FPRounding {
-  // The first four values are encodable directly by FPCR<RMode>.
-  FPTieEven = 0x0,
-  FPPositiveInfinity = 0x1,
-  FPNegativeInfinity = 0x2,
-  FPZero = 0x3,
-
-  // The final rounding modes are only available when explicitly specified by
-  // the instruction (such as with fcvta). They cannot be set in FPCR.
-  FPTieAway,
-  FPRoundOdd
-};
-
-enum Reg31Mode {
-  Reg31IsStackPointer,
-  Reg31IsZeroRegister
-};
-
-// Instructions. ---------------------------------------------------------------
-
-class Instruction {
- public:
-  V8_INLINE Instr InstructionBits() const {
-    return *reinterpret_cast<const Instr*>(this);
-  }
-
-  V8_INLINE void SetInstructionBits(Instr new_instr) {
-    *reinterpret_cast<Instr*>(this) = new_instr;
-  }
-
-  int Bit(int pos) const {
-    return (InstructionBits() >> pos) & 1;
-  }
-
-  uint32_t Bits(int msb, int lsb) const {
-    return unsigned_bitextract_32(msb, lsb, InstructionBits());
-  }
-
-  int32_t SignedBits(int msb, int lsb) const {
-    int32_t bits = *(reinterpret_cast<const int32_t*>(this));
-    return signed_bitextract_32(msb, lsb, bits);
-  }
-
-  Instr Mask(uint32_t mask) const {
-    return InstructionBits() & mask;
-  }
-
-  V8_INLINE const Instruction* following(int count = 1) const {
-    return InstructionAtOffset(count * static_cast<int>(kInstructionSize));
-  }
-
-  V8_INLINE Instruction* following(int count = 1) {
-    return InstructionAtOffset(count * static_cast<int>(kInstructionSize));
-  }
-
-  V8_INLINE const Instruction* preceding(int count = 1) const {
-    return following(-count);
-  }
-
-  V8_INLINE Instruction* preceding(int count = 1) {
-    return following(-count);
-  }
-
-#define DEFINE_GETTER(Name, HighBit, LowBit, Func) \
-  int32_t Name() const { return Func(HighBit, LowBit); }
-  INSTRUCTION_FIELDS_LIST(DEFINE_GETTER)
-  #undef DEFINE_GETTER
-
-  // ImmPCRel is a compound field (not present in INSTRUCTION_FIELDS_LIST),
-  // formed from ImmPCRelLo and ImmPCRelHi.
-  int ImmPCRel() const {
-    DCHECK(IsPCRelAddressing());
-    int offset = ((ImmPCRelHi() << ImmPCRelLo_width) | ImmPCRelLo());
-    int width = ImmPCRelLo_width + ImmPCRelHi_width;
-    return signed_bitextract_32(width - 1, 0, offset);
-  }
-
-  uint64_t ImmLogical();
-  unsigned ImmNEONabcdefgh() const;
-  float ImmFP32();
-  double ImmFP64();
-  float ImmNEONFP32() const;
-  double ImmNEONFP64() const;
-
-  unsigned SizeLS() const {
-    return CalcLSDataSize(static_cast<LoadStoreOp>(Mask(LoadStoreMask)));
-  }
-
-  unsigned SizeLSPair() const {
-    return CalcLSPairDataSize(
-        static_cast<LoadStorePairOp>(Mask(LoadStorePairMask)));
-  }
-
-  int NEONLSIndex(int access_size_shift) const {
-    int q = NEONQ();
-    int s = NEONS();
-    int size = NEONLSSize();
-    int index = (q << 3) | (s << 2) | size;
-    return index >> access_size_shift;
-  }
-
-  // Helpers.
-  bool IsCondBranchImm() const {
-    return Mask(ConditionalBranchFMask) == ConditionalBranchFixed;
-  }
-
-  bool IsUncondBranchImm() const {
-    return Mask(UnconditionalBranchFMask) == UnconditionalBranchFixed;
-  }
-
-  bool IsCompareBranch() const {
-    return Mask(CompareBranchFMask) == CompareBranchFixed;
-  }
-
-  bool IsTestBranch() const {
-    return Mask(TestBranchFMask) == TestBranchFixed;
-  }
-
-  bool IsImmBranch() const {
-    return BranchType() != UnknownBranchType;
-  }
-
-  static float Imm8ToFP32(uint32_t imm8) {
-    //   Imm8: abcdefgh (8 bits)
-    // Single: aBbb.bbbc.defg.h000.0000.0000.0000.0000 (32 bits)
-    // where B is b ^ 1
-    uint32_t bits = imm8;
-    uint32_t bit7 = (bits >> 7) & 0x1;
-    uint32_t bit6 = (bits >> 6) & 0x1;
-    uint32_t bit5_to_0 = bits & 0x3f;
-    uint32_t result = (bit7 << 31) | ((32 - bit6) << 25) | (bit5_to_0 << 19);
-
-    return bit_cast<float>(result);
-  }
-
-  static double Imm8ToFP64(uint32_t imm8) {
-    //   Imm8: abcdefgh (8 bits)
-    // Double: aBbb.bbbb.bbcd.efgh.0000.0000.0000.0000
-    //         0000.0000.0000.0000.0000.0000.0000.0000 (64 bits)
-    // where B is b ^ 1
-    uint32_t bits = imm8;
-    uint64_t bit7 = (bits >> 7) & 0x1;
-    uint64_t bit6 = (bits >> 6) & 0x1;
-    uint64_t bit5_to_0 = bits & 0x3f;
-    uint64_t result = (bit7 << 63) | ((256 - bit6) << 54) | (bit5_to_0 << 48);
-
-    return bit_cast<double>(result);
-  }
-
-  bool IsLdrLiteral() const {
-    return Mask(LoadLiteralFMask) == LoadLiteralFixed;
-  }
-
-  bool IsLdrLiteralX() const {
-    return Mask(LoadLiteralMask) == LDR_x_lit;
-  }
-
-  bool IsPCRelAddressing() const {
-    return Mask(PCRelAddressingFMask) == PCRelAddressingFixed;
-  }
-
-  bool IsAdr() const {
-    return Mask(PCRelAddressingMask) == ADR;
-  }
-
-  bool IsBrk() const { return Mask(ExceptionMask) == BRK; }
-
-  bool IsUnresolvedInternalReference() const {
-    // Unresolved internal references are encoded as two consecutive brk
-    // instructions.
-    return IsBrk() && following()->IsBrk();
-  }
-
-  bool IsLogicalImmediate() const {
-    return Mask(LogicalImmediateFMask) == LogicalImmediateFixed;
-  }
-
-  bool IsAddSubImmediate() const {
-    return Mask(AddSubImmediateFMask) == AddSubImmediateFixed;
-  }
-
-  bool IsAddSubShifted() const {
-    return Mask(AddSubShiftedFMask) == AddSubShiftedFixed;
-  }
-
-  bool IsAddSubExtended() const {
-    return Mask(AddSubExtendedFMask) == AddSubExtendedFixed;
-  }
-
-  // Match any loads or stores, including pairs.
-  bool IsLoadOrStore() const {
-    return Mask(LoadStoreAnyFMask) == LoadStoreAnyFixed;
-  }
-
-  // Match any loads, including pairs.
-  bool IsLoad() const;
-  // Match any stores, including pairs.
-  bool IsStore() const;
-
-  // Indicate whether Rd can be the stack pointer or the zero register. This
-  // does not check that the instruction actually has an Rd field.
-  Reg31Mode RdMode() const {
-    // The following instructions use csp or wsp as Rd:
-    //  Add/sub (immediate) when not setting the flags.
-    //  Add/sub (extended) when not setting the flags.
-    //  Logical (immediate) when not setting the flags.
-    // Otherwise, r31 is the zero register.
-    if (IsAddSubImmediate() || IsAddSubExtended()) {
-      if (Mask(AddSubSetFlagsBit)) {
-        return Reg31IsZeroRegister;
-      } else {
-        return Reg31IsStackPointer;
-      }
-    }
-    if (IsLogicalImmediate()) {
-      // Of the logical (immediate) instructions, only ANDS (and its aliases)
-      // can set the flags. The others can all write into csp.
-      // Note that some logical operations are not available to
-      // immediate-operand instructions, so we have to combine two masks here.
-      if (Mask(LogicalImmediateMask & LogicalOpMask) == ANDS) {
-        return Reg31IsZeroRegister;
-      } else {
-        return Reg31IsStackPointer;
-      }
-    }
-    return Reg31IsZeroRegister;
-  }
-
-  // Indicate whether Rn can be the stack pointer or the zero register. This
-  // does not check that the instruction actually has an Rn field.
-  Reg31Mode RnMode() const {
-    // The following instructions use csp or wsp as Rn:
-    //  All loads and stores.
-    //  Add/sub (immediate).
-    //  Add/sub (extended).
-    // Otherwise, r31 is the zero register.
-    if (IsLoadOrStore() || IsAddSubImmediate() || IsAddSubExtended()) {
-      return Reg31IsStackPointer;
-    }
-    return Reg31IsZeroRegister;
-  }
-
-  ImmBranchType BranchType() const {
-    if (IsCondBranchImm()) {
-      return CondBranchType;
-    } else if (IsUncondBranchImm()) {
-      return UncondBranchType;
-    } else if (IsCompareBranch()) {
-      return CompareBranchType;
-    } else if (IsTestBranch()) {
-      return TestBranchType;
-    } else {
-      return UnknownBranchType;
-    }
-  }
-
-  static int ImmBranchRangeBitwidth(ImmBranchType branch_type) {
-    switch (branch_type) {
-      case UncondBranchType:
-        return ImmUncondBranch_width;
-      case CondBranchType:
-        return ImmCondBranch_width;
-      case CompareBranchType:
-        return ImmCmpBranch_width;
-      case TestBranchType:
-        return ImmTestBranch_width;
-      default:
-        UNREACHABLE();
-    }
-  }
-
-  // The range of the branch instruction, expressed as 'instr +- range'.
-  static int32_t ImmBranchRange(ImmBranchType branch_type) {
-    return
-      (1 << (ImmBranchRangeBitwidth(branch_type) + kInstructionSizeLog2)) / 2 -
-      kInstructionSize;
-  }
-
-  int ImmBranch() const {
-    switch (BranchType()) {
-      case CondBranchType: return ImmCondBranch();
-      case UncondBranchType: return ImmUncondBranch();
-      case CompareBranchType: return ImmCmpBranch();
-      case TestBranchType: return ImmTestBranch();
-      default: UNREACHABLE();
-    }
-    return 0;
-  }
-
-  int ImmUnresolvedInternalReference() const {
-    DCHECK(IsUnresolvedInternalReference());
-    // Unresolved references are encoded as two consecutive brk instructions.
-    // The associated immediate is made of the two 16-bit payloads.
-    int32_t high16 = ImmException();
-    int32_t low16 = following()->ImmException();
-    return (high16 << 16) | low16;
-  }
-
-  bool IsBranchAndLinkToRegister() const {
-    return Mask(UnconditionalBranchToRegisterMask) == BLR;
-  }
-
-  bool IsMovz() const {
-    return (Mask(MoveWideImmediateMask) == MOVZ_x) ||
-           (Mask(MoveWideImmediateMask) == MOVZ_w);
-  }
-
-  bool IsMovk() const {
-    return (Mask(MoveWideImmediateMask) == MOVK_x) ||
-           (Mask(MoveWideImmediateMask) == MOVK_w);
-  }
-
-  bool IsMovn() const {
-    return (Mask(MoveWideImmediateMask) == MOVN_x) ||
-           (Mask(MoveWideImmediateMask) == MOVN_w);
-  }
-
-  bool IsNop(int n) {
-    // A marking nop is an instruction
-    //   mov r<n>,  r<n>
-    // which is encoded as
-    //   orr r<n>, xzr, r<n>
-    return (Mask(LogicalShiftedMask) == ORR_x) &&
-           (Rd() == Rm()) &&
-           (Rd() == n);
-  }
-
-  // Find the PC offset encoded in this instruction. 'this' may be a branch or
-  // a PC-relative addressing instruction.
-  // The offset returned is unscaled.
-  int64_t ImmPCOffset();
-
-  // Find the target of this instruction. 'this' may be a branch or a
-  // PC-relative addressing instruction.
-  Instruction* ImmPCOffsetTarget();
-
-  static bool IsValidImmPCOffset(ImmBranchType branch_type, ptrdiff_t offset);
-  bool IsTargetInImmPCOffsetRange(Instruction* target);
-  // Patch a PC-relative offset to refer to 'target'. 'this' may be a branch or
-  // a PC-relative addressing instruction.
-  void SetImmPCOffsetTarget(AssemblerBase::IsolateData isolate_data,
-                            Instruction* target);
-  void SetUnresolvedInternalReferenceImmTarget(AssemblerBase::IsolateData,
-                                               Instruction* target);
-  // Patch a literal load instruction to load from 'source'.
-  void SetImmLLiteral(Instruction* source);
-
-  uintptr_t LiteralAddress() {
-    int offset = ImmLLiteral() << kLoadLiteralScaleLog2;
-    return reinterpret_cast<uintptr_t>(this) + offset;
-  }
-
-  enum CheckAlignment { NO_CHECK, CHECK_ALIGNMENT };
-
-  V8_INLINE const Instruction* InstructionAtOffset(
-      int64_t offset, CheckAlignment check = CHECK_ALIGNMENT) const {
-    // The FUZZ_disasm test relies on no check being done.
-    DCHECK(check == NO_CHECK || IsAligned(offset, kInstructionSize));
-    return this + offset;
-  }
-
-  V8_INLINE Instruction* InstructionAtOffset(
-      int64_t offset, CheckAlignment check = CHECK_ALIGNMENT) {
-    // The FUZZ_disasm test relies on no check being done.
-    DCHECK(check == NO_CHECK || IsAligned(offset, kInstructionSize));
-    return this + offset;
-  }
-
-  template<typename T> V8_INLINE static Instruction* Cast(T src) {
-    return reinterpret_cast<Instruction*>(src);
-  }
-
-  V8_INLINE ptrdiff_t DistanceTo(Instruction* target) {
-    return reinterpret_cast<Address>(target) - reinterpret_cast<Address>(this);
-  }
-
-
-  static const int ImmPCRelRangeBitwidth = 21;
-  static bool IsValidPCRelOffset(ptrdiff_t offset) { return is_int21(offset); }
-  void SetPCRelImmTarget(AssemblerBase::IsolateData isolate_data,
-                         Instruction* target);
-  void SetBranchImmTarget(Instruction* target);
-};
-
-// Functions for handling NEON vector format information.
-enum VectorFormat {
-  kFormatUndefined = 0xffffffff,
-  kFormat8B = NEON_8B,
-  kFormat16B = NEON_16B,
-  kFormat4H = NEON_4H,
-  kFormat8H = NEON_8H,
-  kFormat2S = NEON_2S,
-  kFormat4S = NEON_4S,
-  kFormat1D = NEON_1D,
-  kFormat2D = NEON_2D,
-
-  // Scalar formats. We add the scalar bit to distinguish between scalar and
-  // vector enumerations; the bit is always set in the encoding of scalar ops
-  // and always clear for vector ops. Although kFormatD and kFormat1D appear
-  // to be the same, their meaning is subtly different. The first is a scalar
-  // operation, the second a vector operation that only affects one lane.
-  kFormatB = NEON_B | NEONScalar,
-  kFormatH = NEON_H | NEONScalar,
-  kFormatS = NEON_S | NEONScalar,
-  kFormatD = NEON_D | NEONScalar
-};
-
-VectorFormat VectorFormatHalfWidth(VectorFormat vform);
-VectorFormat VectorFormatDoubleWidth(VectorFormat vform);
-VectorFormat VectorFormatDoubleLanes(VectorFormat vform);
-VectorFormat VectorFormatHalfLanes(VectorFormat vform);
-VectorFormat ScalarFormatFromLaneSize(int lanesize);
-VectorFormat VectorFormatHalfWidthDoubleLanes(VectorFormat vform);
-VectorFormat VectorFormatFillQ(VectorFormat vform);
-VectorFormat ScalarFormatFromFormat(VectorFormat vform);
-unsigned RegisterSizeInBitsFromFormat(VectorFormat vform);
-unsigned RegisterSizeInBytesFromFormat(VectorFormat vform);
-int LaneSizeInBytesFromFormat(VectorFormat vform);
-unsigned LaneSizeInBitsFromFormat(VectorFormat vform);
-int LaneSizeInBytesLog2FromFormat(VectorFormat vform);
-int LaneCountFromFormat(VectorFormat vform);
-int MaxLaneCountFromFormat(VectorFormat vform);
-bool IsVectorFormat(VectorFormat vform);
-int64_t MaxIntFromFormat(VectorFormat vform);
-int64_t MinIntFromFormat(VectorFormat vform);
-uint64_t MaxUintFromFormat(VectorFormat vform);
-
-// Where Instruction looks at instructions generated by the Assembler,
-// InstructionSequence looks at instructions sequences generated by the
-// MacroAssembler.
-class InstructionSequence : public Instruction {
- public:
-  static InstructionSequence* At(Address address) {
-    return reinterpret_cast<InstructionSequence*>(address);
-  }
-
-  // Sequences generated by MacroAssembler::InlineData().
-  bool IsInlineData() const;
-  uint64_t InlineData() const;
-};
-
-
-// Simulator/Debugger debug instructions ---------------------------------------
-// Each debug marker is represented by a HLT instruction. The immediate comment
-// field in the instruction is used to identify the type of debug marker. Each
-// marker encodes arguments in a different way, as described below.
-
-// Indicate to the Debugger that the instruction is a redirected call.
-const Instr kImmExceptionIsRedirectedCall = 0xca11;
-
-// Represent unreachable code. This is used as a guard in parts of the code that
-// should not be reachable, such as in data encoded inline in the instructions.
-const Instr kImmExceptionIsUnreachable = 0xdebf;
-
-// A pseudo 'printf' instruction. The arguments will be passed to the platform
-// printf method.
-const Instr kImmExceptionIsPrintf = 0xdeb1;
-// Most parameters are stored in ARM64 registers as if the printf
-// pseudo-instruction was a call to the real printf method:
-//      x0: The format string.
-//   x1-x7: Optional arguments.
-//   d0-d7: Optional arguments.
-//
-// Also, the argument layout is described inline in the instructions:
-//  - arg_count: The number of arguments.
-//  - arg_pattern: A set of PrintfArgPattern values, packed into two-bit fields.
-//
-// Floating-point and integer arguments are passed in separate sets of registers
-// in AAPCS64 (even for varargs functions), so it is not possible to determine
-// the type of each argument without some information about the values that were
-// passed in. This information could be retrieved from the printf format string,
-// but the format string is not trivial to parse so we encode the relevant
-// information with the HLT instruction.
-const unsigned kPrintfArgCountOffset = 1 * kInstructionSize;
-const unsigned kPrintfArgPatternListOffset = 2 * kInstructionSize;
-const unsigned kPrintfLength = 3 * kInstructionSize;
-
-const unsigned kPrintfMaxArgCount = 4;
-
-// The argument pattern is a set of two-bit-fields, each with one of the
-// following values:
-enum PrintfArgPattern {
-  kPrintfArgW = 1,
-  kPrintfArgX = 2,
-  // There is no kPrintfArgS because floats are always converted to doubles in C
-  // varargs calls.
-  kPrintfArgD = 3
-};
-static const unsigned kPrintfArgPatternBits = 2;
-
-// A pseudo 'debug' instruction.
-const Instr kImmExceptionIsDebug = 0xdeb0;
-// Parameters are inlined in the code after a debug pseudo-instruction:
-// - Debug code.
-// - Debug parameters.
-// - Debug message string. This is a nullptr-terminated ASCII string, padded to
-//   kInstructionSize so that subsequent instructions are correctly aligned.
-// - A kImmExceptionIsUnreachable marker, to catch accidental execution of the
-//   string data.
-const unsigned kDebugCodeOffset = 1 * kInstructionSize;
-const unsigned kDebugParamsOffset = 2 * kInstructionSize;
-const unsigned kDebugMessageOffset = 3 * kInstructionSize;
-
-// Debug parameters.
-// Used without a TRACE_ option, the Debugger will print the arguments only
-// once. Otherwise TRACE_ENABLE and TRACE_DISABLE will enable or disable tracing
-// before every instruction for the specified LOG_ parameters.
-//
-// TRACE_OVERRIDE enables the specified LOG_ parameters, and disabled any
-// others that were not specified.
-//
-// For example:
-//
-// __ debug("print registers and fp registers", 0, LOG_REGS | LOG_VREGS);
-// will print the registers and fp registers only once.
-//
-// __ debug("trace disasm", 1, TRACE_ENABLE | LOG_DISASM);
-// starts disassembling the code.
-//
-// __ debug("trace rets", 2, TRACE_ENABLE | LOG_REGS);
-// adds the general purpose registers to the trace.
-//
-// __ debug("stop regs", 3, TRACE_DISABLE | LOG_REGS);
-// stops tracing the registers.
-const unsigned kDebuggerTracingDirectivesMask = 3 << 6;
-enum DebugParameters {
-  NO_PARAM = 0,
-  BREAK = 1 << 0,
-  LOG_DISASM = 1 << 1,    // Use only with TRACE. Disassemble the code.
-  LOG_REGS = 1 << 2,      // Log general purpose registers.
-  LOG_VREGS = 1 << 3,     // Log NEON and floating-point registers.
-  LOG_SYS_REGS = 1 << 4,  // Log the status flags.
-  LOG_WRITE = 1 << 5,     // Log any memory write.
-
-  LOG_NONE = 0,
-  LOG_STATE = LOG_REGS | LOG_VREGS | LOG_SYS_REGS,
-  LOG_ALL = LOG_DISASM | LOG_STATE | LOG_WRITE,
-
-  // Trace control.
-  TRACE_ENABLE = 1 << 6,
-  TRACE_DISABLE = 2 << 6,
-  TRACE_OVERRIDE = 3 << 6
-};
-
-enum NEONFormat {
-  NF_UNDEF = 0,
-  NF_8B = 1,
-  NF_16B = 2,
-  NF_4H = 3,
-  NF_8H = 4,
-  NF_2S = 5,
-  NF_4S = 6,
-  NF_1D = 7,
-  NF_2D = 8,
-  NF_B = 9,
-  NF_H = 10,
-  NF_S = 11,
-  NF_D = 12
-};
-
-static const unsigned kNEONFormatMaxBits = 6;
-
-struct NEONFormatMap {
-  // The bit positions in the instruction to consider.
-  uint8_t bits[kNEONFormatMaxBits];
-
-  // Mapping from concatenated bits to format.
-  NEONFormat map[1 << kNEONFormatMaxBits];
-};
-
-class NEONFormatDecoder {
- public:
-  enum SubstitutionMode { kPlaceholder, kFormat };
-
-  // Construct a format decoder with increasingly specific format maps for each
-  // substitution. If no format map is specified, the default is the integer
-  // format map.
-  explicit NEONFormatDecoder(const Instruction* instr);
-  NEONFormatDecoder(const Instruction* instr, const NEONFormatMap* format);
-  NEONFormatDecoder(const Instruction* instr, const NEONFormatMap* format0,
-                    const NEONFormatMap* format1);
-  NEONFormatDecoder(const Instruction* instr, const NEONFormatMap* format0,
-                    const NEONFormatMap* format1, const NEONFormatMap* format2);
-
-  // Set the format mapping for all or individual substitutions.
-  void SetFormatMaps(const NEONFormatMap* format0,
-                     const NEONFormatMap* format1 = nullptr,
-                     const NEONFormatMap* format2 = nullptr);
-  void SetFormatMap(unsigned index, const NEONFormatMap* format);
-
-  // Substitute %s in the input string with the placeholder string for each
-  // register, ie. "'B", "'H", etc.
-  const char* SubstitutePlaceholders(const char* string);
-
-  // Substitute %s in the input string with a new string based on the
-  // substitution mode.
-  const char* Substitute(const char* string, SubstitutionMode mode0 = kFormat,
-                         SubstitutionMode mode1 = kFormat,
-                         SubstitutionMode mode2 = kFormat);
-
-  // Append a "2" to a mnemonic string based of the state of the Q bit.
-  const char* Mnemonic(const char* mnemonic);
-
-  VectorFormat GetVectorFormat(int format_index = 0);
-  VectorFormat GetVectorFormat(const NEONFormatMap* format_map);
-
-  // Built in mappings for common cases.
-
-  // The integer format map uses three bits (Q, size<1:0>) to encode the
-  // "standard" set of NEON integer vector formats.
-  static const NEONFormatMap* IntegerFormatMap() {
-    static const NEONFormatMap map = {
-        {23, 22, 30},
-        {NF_8B, NF_16B, NF_4H, NF_8H, NF_2S, NF_4S, NF_UNDEF, NF_2D}};
-    return &map;
-  }
-
-  // The long integer format map uses two bits (size<1:0>) to encode the
-  // long set of NEON integer vector formats. These are used in narrow, wide
-  // and long operations.
-  static const NEONFormatMap* LongIntegerFormatMap() {
-    static const NEONFormatMap map = {{23, 22}, {NF_8H, NF_4S, NF_2D}};
-    return &map;
-  }
-
-  // The FP format map uses two bits (Q, size<0>) to encode the NEON FP vector
-  // formats: NF_2S, NF_4S, NF_2D.
-  static const NEONFormatMap* FPFormatMap() {
-    // The FP format map assumes two bits (Q, size<0>) are used to encode the
-    // NEON FP vector formats: NF_2S, NF_4S, NF_2D.
-    static const NEONFormatMap map = {{22, 30},
-                                      {NF_2S, NF_4S, NF_UNDEF, NF_2D}};
-    return &map;
-  }
-
-  // The load/store format map uses three bits (Q, 11, 10) to encode the
-  // set of NEON vector formats.
-  static const NEONFormatMap* LoadStoreFormatMap() {
-    static const NEONFormatMap map = {
-        {11, 10, 30},
-        {NF_8B, NF_16B, NF_4H, NF_8H, NF_2S, NF_4S, NF_1D, NF_2D}};
-    return &map;
-  }
-
-  // The logical format map uses one bit (Q) to encode the NEON vector format:
-  // NF_8B, NF_16B.
-  static const NEONFormatMap* LogicalFormatMap() {
-    static const NEONFormatMap map = {{30}, {NF_8B, NF_16B}};
-    return &map;
-  }
-
-  // The triangular format map uses between two and five bits to encode the NEON
-  // vector format:
-  // xxx10->8B, xxx11->16B, xx100->4H, xx101->8H
-  // x1000->2S, x1001->4S,  10001->2D, all others undefined.
-  static const NEONFormatMap* TriangularFormatMap() {
-    static const NEONFormatMap map = {
-        {19, 18, 17, 16, 30},
-        {NF_UNDEF, NF_UNDEF, NF_8B, NF_16B, NF_4H, NF_8H, NF_8B, NF_16B,
-         NF_2S,    NF_4S,    NF_8B, NF_16B, NF_4H, NF_8H, NF_8B, NF_16B,
-         NF_UNDEF, NF_2D,    NF_8B, NF_16B, NF_4H, NF_8H, NF_8B, NF_16B,
-         NF_2S,    NF_4S,    NF_8B, NF_16B, NF_4H, NF_8H, NF_8B, NF_16B}};
-    return &map;
-  }
-
-  // The scalar format map uses two bits (size<1:0>) to encode the NEON scalar
-  // formats: NF_B, NF_H, NF_S, NF_D.
-  static const NEONFormatMap* ScalarFormatMap() {
-    static const NEONFormatMap map = {{23, 22}, {NF_B, NF_H, NF_S, NF_D}};
-    return &map;
-  }
-
-  // The long scalar format map uses two bits (size<1:0>) to encode the longer
-  // NEON scalar formats: NF_H, NF_S, NF_D.
-  static const NEONFormatMap* LongScalarFormatMap() {
-    static const NEONFormatMap map = {{23, 22}, {NF_H, NF_S, NF_D}};
-    return &map;
-  }
-
-  // The FP scalar format map assumes one bit (size<0>) is used to encode the
-  // NEON FP scalar formats: NF_S, NF_D.
-  static const NEONFormatMap* FPScalarFormatMap() {
-    static const NEONFormatMap map = {{22}, {NF_S, NF_D}};
-    return &map;
-  }
-
-  // The triangular scalar format map uses between one and four bits to encode
-  // the NEON FP scalar formats:
-  // xxx1->B, xx10->H, x100->S, 1000->D, all others undefined.
-  static const NEONFormatMap* TriangularScalarFormatMap() {
-    static const NEONFormatMap map = {
-        {19, 18, 17, 16},
-        {NF_UNDEF, NF_B, NF_H, NF_B, NF_S, NF_B, NF_H, NF_B, NF_D, NF_B, NF_H,
-         NF_B, NF_S, NF_B, NF_H, NF_B}};
-    return &map;
-  }
-
- private:
-  // Get a pointer to a string that represents the format or placeholder for
-  // the specified substitution index, based on the format map and instruction.
-  const char* GetSubstitute(int index, SubstitutionMode mode);
-
-  // Get the NEONFormat enumerated value for bits obtained from the
-  // instruction based on the specified format mapping.
-  NEONFormat GetNEONFormat(const NEONFormatMap* format_map);
-
-  // Convert a NEONFormat into a string.
-  static const char* NEONFormatAsString(NEONFormat format);
-
-  // Convert a NEONFormat into a register placeholder string.
-  static const char* NEONFormatAsPlaceholder(NEONFormat format);
-
-  // Select bits from instrbits_ defined by the bits array, concatenate them,
-  // and return the value.
-  uint8_t PickBits(const uint8_t bits[]);
-
-  Instr instrbits_;
-  const NEONFormatMap* formats_[3];
-  char form_buffer_[64];
-  char mne_buffer_[16];
-};
-}  // namespace internal
-}  // namespace v8
-
-
-#endif  // V8_ARM64_INSTRUCTIONS_ARM64_H_
diff --git a/src/v8/src/arm64/instrument-arm64.cc b/src/v8/src/arm64/instrument-arm64.cc
deleted file mode 100644
index 8e9cce7..0000000
--- a/src/v8/src/arm64/instrument-arm64.cc
+++ /dev/null
@@ -1,766 +0,0 @@
-// Copyright 2013 the V8 project 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 "src/arm64/instrument-arm64.h"
-
-namespace v8 {
-namespace internal {
-
-Counter::Counter(const char* name, CounterType type)
-    : count_(0), enabled_(false), type_(type) {
-  DCHECK_NOT_NULL(name);
-  strncpy(name_, name, kCounterNameMaxLength);
-}
-
-
-void Counter::Enable() {
-  enabled_ = true;
-}
-
-
-void Counter::Disable() {
-  enabled_ = false;
-}
-
-
-bool Counter::IsEnabled() {
-  return enabled_;
-}
-
-
-void Counter::Increment() {
-  if (enabled_) {
-    count_++;
-  }
-}
-
-
-uint64_t Counter::count() {
-  uint64_t result = count_;
-  if (type_ == Gauge) {
-    // If the counter is a Gauge, reset the count after reading.
-    count_ = 0;
-  }
-  return result;
-}
-
-
-const char* Counter::name() {
-  return name_;
-}
-
-
-CounterType Counter::type() {
-  return type_;
-}
-
-
-typedef struct {
-  const char* name;
-  CounterType type;
-} CounterDescriptor;
-
-static const CounterDescriptor kCounterList[] = {
-    {"Instruction", Cumulative},
-
-    {"Move Immediate", Gauge},
-    {"Add/Sub DP", Gauge},
-    {"Logical DP", Gauge},
-    {"Other Int DP", Gauge},
-    {"FP DP", Gauge},
-
-    {"Conditional Select", Gauge},
-    {"Conditional Compare", Gauge},
-
-    {"Unconditional Branch", Gauge},
-    {"Compare and Branch", Gauge},
-    {"Test and Branch", Gauge},
-    {"Conditional Branch", Gauge},
-
-    {"Load Integer", Gauge},
-    {"Load FP", Gauge},
-    {"Load Pair", Gauge},
-    {"Load Literal", Gauge},
-    {"Load Acquire", Gauge},
-
-    {"Store Integer", Gauge},
-    {"Store FP", Gauge},
-    {"Store Pair", Gauge},
-    {"Store Release", Gauge},
-
-    {"PC Addressing", Gauge},
-    {"Other", Gauge},
-    {"SP Adjust", Gauge},
-};
-
-Instrument::Instrument(const char* datafile, uint64_t sample_period)
-    : output_stream_(stderr), sample_period_(sample_period) {
-  // Set up the output stream. If datafile is non-nullptr, use that file. If it
-  // can't be opened, or datafile is nullptr, use stderr.
-  if (datafile != nullptr) {
-    output_stream_ = fopen(datafile, "w");
-    if (output_stream_ == nullptr) {
-      fprintf(stderr, "Can't open output file %s. Using stderr.\n", datafile);
-      output_stream_ = stderr;
-    }
-  }
-
-  static const int num_counters = arraysize(kCounterList);
-
-  // Dump an instrumentation description comment at the top of the file.
-  fprintf(output_stream_, "# counters=%d\n", num_counters);
-  fprintf(output_stream_, "# sample_period=%" PRIu64 "\n", sample_period_);
-
-  // Construct Counter objects from counter description array.
-  for (int i = 0; i < num_counters; i++) {
-    Counter* counter = new Counter(kCounterList[i].name, kCounterList[i].type);
-    counters_.push_back(counter);
-  }
-
-  DumpCounterNames();
-}
-
-
-Instrument::~Instrument() {
-  // Dump any remaining instruction data to the output file.
-  DumpCounters();
-
-  // Free all the counter objects.
-  std::list<Counter*>::iterator it;
-  for (it = counters_.begin(); it != counters_.end(); it++) {
-    delete *it;
-  }
-
-  if (output_stream_ != stderr) {
-    fclose(output_stream_);
-  }
-}
-
-
-void Instrument::Update() {
-  // Increment the instruction counter, and dump all counters if a sample period
-  // has elapsed.
-  static Counter* counter = GetCounter("Instruction");
-  DCHECK(counter->type() == Cumulative);
-  counter->Increment();
-
-  if (counter->IsEnabled() && (counter->count() % sample_period_) == 0) {
-    DumpCounters();
-  }
-}
-
-
-void Instrument::DumpCounters() {
-  // Iterate through the counter objects, dumping their values to the output
-  // stream.
-  std::list<Counter*>::const_iterator it;
-  for (it = counters_.begin(); it != counters_.end(); it++) {
-    fprintf(output_stream_, "%" PRIu64 ",", (*it)->count());
-  }
-  fprintf(output_stream_, "\n");
-  fflush(output_stream_);
-}
-
-
-void Instrument::DumpCounterNames() {
-  // Iterate through the counter objects, dumping the counter names to the
-  // output stream.
-  std::list<Counter*>::const_iterator it;
-  for (it = counters_.begin(); it != counters_.end(); it++) {
-    fprintf(output_stream_, "%s,", (*it)->name());
-  }
-  fprintf(output_stream_, "\n");
-  fflush(output_stream_);
-}
-
-
-void Instrument::HandleInstrumentationEvent(unsigned event) {
-  switch (event) {
-    case InstrumentStateEnable: Enable(); break;
-    case InstrumentStateDisable: Disable(); break;
-    default: DumpEventMarker(event);
-  }
-}
-
-
-void Instrument::DumpEventMarker(unsigned marker) {
-  // Dumpan event marker to the output stream as a specially formatted comment
-  // line.
-  static Counter* counter = GetCounter("Instruction");
-
-  fprintf(output_stream_, "# %c%c @ %" PRId64 "\n", marker & 0xFF,
-          (marker >> 8) & 0xFF, counter->count());
-}
-
-
-Counter* Instrument::GetCounter(const char* name) {
-  // Get a Counter object by name from the counter list.
-  std::list<Counter*>::const_iterator it;
-  for (it = counters_.begin(); it != counters_.end(); it++) {
-    if (strcmp((*it)->name(), name) == 0) {
-      return *it;
-    }
-  }
-
-  // A Counter by that name does not exist: print an error message to stderr
-  // and the output file, and exit.
-  static const char* error_message =
-    "# Error: Unknown counter \"%s\". Exiting.\n";
-  fprintf(stderr, error_message, name);
-  fprintf(output_stream_, error_message, name);
-  exit(1);
-}
-
-
-void Instrument::Enable() {
-  std::list<Counter*>::iterator it;
-  for (it = counters_.begin(); it != counters_.end(); it++) {
-    (*it)->Enable();
-  }
-}
-
-
-void Instrument::Disable() {
-  std::list<Counter*>::iterator it;
-  for (it = counters_.begin(); it != counters_.end(); it++) {
-    (*it)->Disable();
-  }
-}
-
-
-void Instrument::VisitPCRelAddressing(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("PC Addressing");
-  counter->Increment();
-}
-
-
-void Instrument::VisitAddSubImmediate(Instruction* instr) {
-  Update();
-  static Counter* sp_counter = GetCounter("SP Adjust");
-  static Counter* add_sub_counter = GetCounter("Add/Sub DP");
-  if (((instr->Mask(AddSubOpMask) == SUB) ||
-       (instr->Mask(AddSubOpMask) == ADD)) &&
-      (instr->Rd() == 31) && (instr->Rn() == 31)) {
-    // Count adjustments to the C stack pointer caused by V8 needing two SPs.
-    sp_counter->Increment();
-  } else {
-    add_sub_counter->Increment();
-  }
-}
-
-
-void Instrument::VisitLogicalImmediate(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("Logical DP");
-  counter->Increment();
-}
-
-
-void Instrument::VisitMoveWideImmediate(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("Move Immediate");
-
-  if (instr->IsMovn() && (instr->Rd() == kZeroRegCode)) {
-    unsigned imm = instr->ImmMoveWide();
-    HandleInstrumentationEvent(imm);
-  } else {
-    counter->Increment();
-  }
-}
-
-
-void Instrument::VisitBitfield(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("Other Int DP");
-  counter->Increment();
-}
-
-
-void Instrument::VisitExtract(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("Other Int DP");
-  counter->Increment();
-}
-
-
-void Instrument::VisitUnconditionalBranch(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("Unconditional Branch");
-  counter->Increment();
-}
-
-
-void Instrument::VisitUnconditionalBranchToRegister(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("Unconditional Branch");
-  counter->Increment();
-}
-
-
-void Instrument::VisitCompareBranch(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("Compare and Branch");
-  counter->Increment();
-}
-
-
-void Instrument::VisitTestBranch(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("Test and Branch");
-  counter->Increment();
-}
-
-
-void Instrument::VisitConditionalBranch(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("Conditional Branch");
-  counter->Increment();
-}
-
-
-void Instrument::VisitSystem(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("Other");
-  counter->Increment();
-}
-
-
-void Instrument::VisitException(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("Other");
-  counter->Increment();
-}
-
-
-void Instrument::InstrumentLoadStorePair(Instruction* instr) {
-  static Counter* load_pair_counter = GetCounter("Load Pair");
-  static Counter* store_pair_counter = GetCounter("Store Pair");
-  if (instr->Mask(LoadStorePairLBit) != 0) {
-    load_pair_counter->Increment();
-  } else {
-    store_pair_counter->Increment();
-  }
-}
-
-
-void Instrument::VisitLoadStorePairPostIndex(Instruction* instr) {
-  Update();
-  InstrumentLoadStorePair(instr);
-}
-
-
-void Instrument::VisitLoadStorePairOffset(Instruction* instr) {
-  Update();
-  InstrumentLoadStorePair(instr);
-}
-
-
-void Instrument::VisitLoadStorePairPreIndex(Instruction* instr) {
-  Update();
-  InstrumentLoadStorePair(instr);
-}
-
-
-void Instrument::VisitLoadLiteral(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("Load Literal");
-  counter->Increment();
-}
-
-
-void Instrument::InstrumentLoadStore(Instruction* instr) {
-  static Counter* load_int_counter = GetCounter("Load Integer");
-  static Counter* store_int_counter = GetCounter("Store Integer");
-  static Counter* load_fp_counter = GetCounter("Load FP");
-  static Counter* store_fp_counter = GetCounter("Store FP");
-
-  switch (instr->Mask(LoadStoreMask)) {
-    case STRB_w:    // Fall through.
-    case STRH_w:    // Fall through.
-    case STR_w:     // Fall through.
-    case STR_x:     store_int_counter->Increment(); break;
-    case STR_s:     // Fall through.
-    case STR_d:     store_fp_counter->Increment(); break;
-    case LDRB_w:    // Fall through.
-    case LDRH_w:    // Fall through.
-    case LDR_w:     // Fall through.
-    case LDR_x:     // Fall through.
-    case LDRSB_x:   // Fall through.
-    case LDRSH_x:   // Fall through.
-    case LDRSW_x:   // Fall through.
-    case LDRSB_w:   // Fall through.
-    case LDRSH_w:   load_int_counter->Increment(); break;
-    case LDR_s:     // Fall through.
-    case LDR_d:     load_fp_counter->Increment(); break;
-    default: UNREACHABLE();
-  }
-}
-
-
-void Instrument::VisitLoadStoreUnscaledOffset(Instruction* instr) {
-  Update();
-  InstrumentLoadStore(instr);
-}
-
-
-void Instrument::VisitLoadStorePostIndex(Instruction* instr) {
-  Update();
-  InstrumentLoadStore(instr);
-}
-
-
-void Instrument::VisitLoadStorePreIndex(Instruction* instr) {
-  Update();
-  InstrumentLoadStore(instr);
-}
-
-
-void Instrument::VisitLoadStoreRegisterOffset(Instruction* instr) {
-  Update();
-  InstrumentLoadStore(instr);
-}
-
-
-void Instrument::VisitLoadStoreUnsignedOffset(Instruction* instr) {
-  Update();
-  InstrumentLoadStore(instr);
-}
-
-void Instrument::VisitLoadStoreAcquireRelease(Instruction* instr) {
-  Update();
-  static Counter* load_counter = GetCounter("Load Acquire");
-  static Counter* store_counter = GetCounter("Store Release");
-
-  switch (instr->Mask(LoadStoreAcquireReleaseMask)) {
-    case LDAR_b:   // Fall-through.
-    case LDAR_h:   // Fall-through.
-    case LDAR_w:   // Fall-through.
-    case LDAR_x:   // Fall-through.
-    case LDAXR_b:  // Fall-through.
-    case LDAXR_h:  // Fall-through.
-    case LDAXR_w:  // Fall-through.
-    case LDAXR_x: load_counter->Increment(); break;
-    case STLR_b:   // Fall-through.
-    case STLR_h:   // Fall-through.
-    case STLR_w:   // Fall-through.
-    case STLR_x:   // Fall-through.
-    case STLXR_b:  // Fall-through.
-    case STLXR_h:  // Fall-through.
-    case STLXR_w:  // Fall-through.
-    case STLXR_x: store_counter->Increment(); break;
-    default: UNREACHABLE();
-  }
-}
-
-void Instrument::VisitLogicalShifted(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("Logical DP");
-  counter->Increment();
-}
-
-
-void Instrument::VisitAddSubShifted(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("Add/Sub DP");
-  counter->Increment();
-}
-
-
-void Instrument::VisitAddSubExtended(Instruction* instr) {
-  Update();
-  static Counter* sp_counter = GetCounter("SP Adjust");
-  static Counter* add_sub_counter = GetCounter("Add/Sub DP");
-  if (((instr->Mask(AddSubOpMask) == SUB) ||
-       (instr->Mask(AddSubOpMask) == ADD)) &&
-      (instr->Rd() == 31) && (instr->Rn() == 31)) {
-    // Count adjustments to the C stack pointer caused by V8 needing two SPs.
-    sp_counter->Increment();
-  } else {
-    add_sub_counter->Increment();
-  }
-}
-
-
-void Instrument::VisitAddSubWithCarry(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("Add/Sub DP");
-  counter->Increment();
-}
-
-
-void Instrument::VisitConditionalCompareRegister(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("Conditional Compare");
-  counter->Increment();
-}
-
-
-void Instrument::VisitConditionalCompareImmediate(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("Conditional Compare");
-  counter->Increment();
-}
-
-
-void Instrument::VisitConditionalSelect(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("Conditional Select");
-  counter->Increment();
-}
-
-
-void Instrument::VisitDataProcessing1Source(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("Other Int DP");
-  counter->Increment();
-}
-
-
-void Instrument::VisitDataProcessing2Source(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("Other Int DP");
-  counter->Increment();
-}
-
-
-void Instrument::VisitDataProcessing3Source(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("Other Int DP");
-  counter->Increment();
-}
-
-
-void Instrument::VisitFPCompare(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("FP DP");
-  counter->Increment();
-}
-
-
-void Instrument::VisitFPConditionalCompare(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("Conditional Compare");
-  counter->Increment();
-}
-
-
-void Instrument::VisitFPConditionalSelect(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("Conditional Select");
-  counter->Increment();
-}
-
-
-void Instrument::VisitFPImmediate(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("FP DP");
-  counter->Increment();
-}
-
-
-void Instrument::VisitFPDataProcessing1Source(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("FP DP");
-  counter->Increment();
-}
-
-
-void Instrument::VisitFPDataProcessing2Source(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("FP DP");
-  counter->Increment();
-}
-
-
-void Instrument::VisitFPDataProcessing3Source(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("FP DP");
-  counter->Increment();
-}
-
-
-void Instrument::VisitFPIntegerConvert(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("FP DP");
-  counter->Increment();
-}
-
-
-void Instrument::VisitFPFixedPointConvert(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("FP DP");
-  counter->Increment();
-}
-
-void Instrument::VisitNEON2RegMisc(Instruction* instr) {
-  USE(instr);
-  Update();
-  static Counter* counter = GetCounter("NEON");
-  counter->Increment();
-}
-
-void Instrument::VisitNEON3Different(Instruction* instr) {
-  USE(instr);
-  Update();
-  static Counter* counter = GetCounter("NEON");
-  counter->Increment();
-}
-
-void Instrument::VisitNEON3Same(Instruction* instr) {
-  USE(instr);
-  Update();
-  static Counter* counter = GetCounter("NEON");
-  counter->Increment();
-}
-
-void Instrument::VisitNEONAcrossLanes(Instruction* instr) {
-  USE(instr);
-  Update();
-  static Counter* counter = GetCounter("NEON");
-  counter->Increment();
-}
-
-void Instrument::VisitNEONByIndexedElement(Instruction* instr) {
-  USE(instr);
-  Update();
-  static Counter* counter = GetCounter("NEON");
-  counter->Increment();
-}
-
-void Instrument::VisitNEONCopy(Instruction* instr) {
-  USE(instr);
-  Update();
-  static Counter* counter = GetCounter("NEON");
-  counter->Increment();
-}
-
-void Instrument::VisitNEONExtract(Instruction* instr) {
-  USE(instr);
-  Update();
-  static Counter* counter = GetCounter("NEON");
-  counter->Increment();
-}
-
-void Instrument::VisitNEONLoadStoreMultiStruct(Instruction* instr) {
-  USE(instr);
-  Update();
-  static Counter* counter = GetCounter("NEON");
-  counter->Increment();
-}
-
-void Instrument::VisitNEONLoadStoreMultiStructPostIndex(Instruction* instr) {
-  USE(instr);
-  Update();
-  static Counter* counter = GetCounter("NEON");
-  counter->Increment();
-}
-
-void Instrument::VisitNEONLoadStoreSingleStruct(Instruction* instr) {
-  USE(instr);
-  Update();
-  static Counter* counter = GetCounter("NEON");
-  counter->Increment();
-}
-
-void Instrument::VisitNEONLoadStoreSingleStructPostIndex(Instruction* instr) {
-  USE(instr);
-  Update();
-  static Counter* counter = GetCounter("NEON");
-  counter->Increment();
-}
-
-void Instrument::VisitNEONModifiedImmediate(Instruction* instr) {
-  USE(instr);
-  Update();
-  static Counter* counter = GetCounter("NEON");
-  counter->Increment();
-}
-
-void Instrument::VisitNEONPerm(Instruction* instr) {
-  USE(instr);
-  Update();
-  static Counter* counter = GetCounter("NEON");
-  counter->Increment();
-}
-
-void Instrument::VisitNEONScalar2RegMisc(Instruction* instr) {
-  USE(instr);
-  Update();
-  static Counter* counter = GetCounter("NEON");
-  counter->Increment();
-}
-
-void Instrument::VisitNEONScalar3Diff(Instruction* instr) {
-  USE(instr);
-  Update();
-  static Counter* counter = GetCounter("NEON");
-  counter->Increment();
-}
-
-void Instrument::VisitNEONScalar3Same(Instruction* instr) {
-  USE(instr);
-  Update();
-  static Counter* counter = GetCounter("NEON");
-  counter->Increment();
-}
-
-void Instrument::VisitNEONScalarByIndexedElement(Instruction* instr) {
-  USE(instr);
-  Update();
-  static Counter* counter = GetCounter("NEON");
-  counter->Increment();
-}
-
-void Instrument::VisitNEONScalarCopy(Instruction* instr) {
-  USE(instr);
-  Update();
-  static Counter* counter = GetCounter("NEON");
-  counter->Increment();
-}
-
-void Instrument::VisitNEONScalarPairwise(Instruction* instr) {
-  USE(instr);
-  Update();
-  static Counter* counter = GetCounter("NEON");
-  counter->Increment();
-}
-
-void Instrument::VisitNEONScalarShiftImmediate(Instruction* instr) {
-  USE(instr);
-  Update();
-  static Counter* counter = GetCounter("NEON");
-  counter->Increment();
-}
-
-void Instrument::VisitNEONShiftImmediate(Instruction* instr) {
-  USE(instr);
-  Update();
-  static Counter* counter = GetCounter("NEON");
-  counter->Increment();
-}
-
-void Instrument::VisitNEONTable(Instruction* instr) {
-  USE(instr);
-  Update();
-  static Counter* counter = GetCounter("NEON");
-  counter->Increment();
-}
-
-void Instrument::VisitUnallocated(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("Other");
-  counter->Increment();
-}
-
-
-void Instrument::VisitUnimplemented(Instruction* instr) {
-  Update();
-  static Counter* counter = GetCounter("Other");
-  counter->Increment();
-}
-
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/arm64/instrument-arm64.h b/src/v8/src/arm64/instrument-arm64.h
deleted file mode 100644
index 8b3d7e6..0000000
--- a/src/v8/src/arm64/instrument-arm64.h
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_ARM64_INSTRUMENT_ARM64_H_
-#define V8_ARM64_INSTRUMENT_ARM64_H_
-
-#include "src/globals.h"
-#include "src/utils.h"
-
-#include "src/arm64/constants-arm64.h"
-#include "src/arm64/decoder-arm64.h"
-
-namespace v8 {
-namespace internal {
-
-const int kCounterNameMaxLength = 256;
-const uint64_t kDefaultInstrumentationSamplingPeriod = 1 << 22;
-
-
-enum InstrumentState {
-  InstrumentStateDisable = 0,
-  InstrumentStateEnable = 1
-};
-
-
-enum CounterType {
-  Gauge = 0,      // Gauge counters reset themselves after reading.
-  Cumulative = 1  // Cumulative counters keep their value after reading.
-};
-
-
-class Counter {
- public:
-  explicit Counter(const char* name, CounterType type = Gauge);
-
-  void Increment();
-  void Enable();
-  void Disable();
-  bool IsEnabled();
-  uint64_t count();
-  const char* name();
-  CounterType type();
-
- private:
-  char name_[kCounterNameMaxLength];
-  uint64_t count_;
-  bool enabled_;
-  CounterType type_;
-};
-
-
-class Instrument: public DecoderVisitor {
- public:
-  explicit Instrument(
-      const char* datafile = nullptr,
-      uint64_t sample_period = kDefaultInstrumentationSamplingPeriod);
-  ~Instrument();
-
-  // Declare all Visitor functions.
-  #define DECLARE(A) void Visit##A(Instruction* instr);
-  VISITOR_LIST(DECLARE)
-  #undef DECLARE
-
- private:
-  void Update();
-  void Enable();
-  void Disable();
-  void DumpCounters();
-  void DumpCounterNames();
-  void DumpEventMarker(unsigned marker);
-  void HandleInstrumentationEvent(unsigned event);
-  Counter* GetCounter(const char* name);
-
-  void InstrumentLoadStore(Instruction* instr);
-  void InstrumentLoadStorePair(Instruction* instr);
-
-  std::list<Counter*> counters_;
-
-  FILE *output_stream_;
-  uint64_t sample_period_;
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_ARM64_INSTRUMENT_ARM64_H_
diff --git a/src/v8/src/arm64/interface-descriptors-arm64.cc b/src/v8/src/arm64/interface-descriptors-arm64.cc
deleted file mode 100644
index 17b058b..0000000
--- a/src/v8/src/arm64/interface-descriptors-arm64.cc
+++ /dev/null
@@ -1,370 +0,0 @@
-// Copyright 2012 the V8 project 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 "src/arm64/interface-descriptors-arm64.h"
-
-#if V8_TARGET_ARCH_ARM64
-
-#include "src/interface-descriptors.h"
-
-namespace v8 {
-namespace internal {
-
-const Register CallInterfaceDescriptor::ContextRegister() { return cp; }
-
-void CallInterfaceDescriptor::DefaultInitializePlatformSpecific(
-    CallInterfaceDescriptorData* data, int register_parameter_count) {
-  const Register default_stub_registers[] = {x0, x1, x2, x3, x4};
-  CHECK_LE(static_cast<size_t>(register_parameter_count),
-           arraysize(default_stub_registers));
-  data->InitializePlatformSpecific(register_parameter_count,
-                                   default_stub_registers);
-}
-
-void RecordWriteDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  const Register default_stub_registers[] = {x0, x1, x2, x3, x4};
-
-  data->RestrictAllocatableRegisters(default_stub_registers,
-                                     arraysize(default_stub_registers));
-
-  CHECK_LE(static_cast<size_t>(kParameterCount),
-           arraysize(default_stub_registers));
-  data->InitializePlatformSpecific(kParameterCount, default_stub_registers);
-}
-
-const Register FastNewFunctionContextDescriptor::FunctionRegister() {
-  return x1;
-}
-const Register FastNewFunctionContextDescriptor::SlotsRegister() { return x0; }
-
-const Register LoadDescriptor::ReceiverRegister() { return x1; }
-const Register LoadDescriptor::NameRegister() { return x2; }
-const Register LoadDescriptor::SlotRegister() { return x0; }
-
-const Register LoadWithVectorDescriptor::VectorRegister() { return x3; }
-
-const Register StoreDescriptor::ReceiverRegister() { return x1; }
-const Register StoreDescriptor::NameRegister() { return x2; }
-const Register StoreDescriptor::ValueRegister() { return x0; }
-const Register StoreDescriptor::SlotRegister() { return x4; }
-
-const Register StoreWithVectorDescriptor::VectorRegister() { return x3; }
-
-const Register StoreTransitionDescriptor::SlotRegister() { return x4; }
-const Register StoreTransitionDescriptor::VectorRegister() { return x3; }
-const Register StoreTransitionDescriptor::MapRegister() { return x5; }
-
-const Register ApiGetterDescriptor::HolderRegister() { return x0; }
-const Register ApiGetterDescriptor::CallbackRegister() { return x3; }
-
-const Register MathPowTaggedDescriptor::exponent() { return x11; }
-
-
-const Register MathPowIntegerDescriptor::exponent() { return x12; }
-
-
-const Register GrowArrayElementsDescriptor::ObjectRegister() { return x0; }
-const Register GrowArrayElementsDescriptor::KeyRegister() { return x3; }
-
-
-void FastNewClosureDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // x1: function info
-  // x2: feedback vector
-  // x3: slot
-  Register registers[] = {x1, x2, x3};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-// static
-const Register TypeConversionDescriptor::ArgumentRegister() { return x0; }
-
-void TypeofDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {x3};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallFunctionDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // x1  function    the function to call
-  Register registers[] = {x1};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallTrampolineDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // x1: target
-  // x0: number of arguments
-  Register registers[] = {x1, x0};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // x0 : number of arguments (on the stack, not including receiver)
-  // x1 : the target to call
-  // x2 : arguments list (FixedArray)
-  // x4 : arguments list length (untagged)
-  Register registers[] = {x1, x0, x2, x4};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallForwardVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // x1: target
-  // x0: number of arguments
-  // x2: start index (to supported rest parameters)
-  Register registers[] = {x1, x0, x2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallWithSpreadDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // x0 : number of arguments (on the stack, not including receiver)
-  // x1 : the target to call
-  // x2 : the object to spread
-  Register registers[] = {x1, x0, x2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallWithArrayLikeDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // x1 : the target to call
-  // x2 : the arguments list
-  Register registers[] = {x1, x2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // x0 : number of arguments (on the stack, not including receiver)
-  // x1 : the target to call
-  // x3 : the new target
-  // x2 : arguments list (FixedArray)
-  // x4 : arguments list length (untagged)
-  Register registers[] = {x1, x3, x0, x2, x4};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructForwardVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // x3: new target
-  // x1: target
-  // x0: number of arguments
-  // x2: start index (to supported rest parameters)
-  Register registers[] = {x1, x3, x0, x2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructWithSpreadDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // x0 : number of arguments (on the stack, not including receiver)
-  // x1 : the target to call
-  // x3 : the new target
-  // x2 : the object to spread
-  Register registers[] = {x1, x3, x0, x2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructWithArrayLikeDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // x1 : the target to call
-  // x3 : the new target
-  // x2 : the arguments list
-  Register registers[] = {x1, x3, x2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructStubDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // x3: new target
-  // x1: target
-  // x0: number of arguments
-  // x2: allocation site or undefined
-  Register registers[] = {x1, x3, x0, x2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-
-void ConstructTrampolineDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // x3: new target
-  // x1: target
-  // x0: number of arguments
-  Register registers[] = {x1, x3, x0};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-
-void TransitionElementsKindDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // x0: value (js_array)
-  // x1: to_map
-  Register registers[] = {x0, x1};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void AbortJSDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {x1};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void AllocateHeapNumberDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  data->InitializePlatformSpecific(0, nullptr, nullptr);
-}
-
-void ArrayConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // kTarget, kNewTarget, kActualArgumentsCount, kAllocationSite
-  Register registers[] = {x1, x3, x0, x2};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void ArrayNoArgumentConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // register state
-  // x1: function
-  // x2: allocation site with elements kind
-  // x0: number of arguments to the constructor function
-  Register registers[] = {x1, x2, x0};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void ArraySingleArgumentConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // register state
-  // x0: number of arguments
-  // x1: function
-  // x2: allocation site with elements kind
-  Register registers[] = {x1, x2, x0};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void ArrayNArgumentsConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // stack param count needs (constructor pointer, and single argument)
-  Register registers[] = {x1, x2, x0};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CompareDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // x1: left operand
-  // x0: right operand
-  Register registers[] = {x1, x0};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-
-void BinaryOpDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // x1: left operand
-  // x0: right operand
-  Register registers[] = {x1, x0};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void StringAddDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // x1: left operand
-  // x0: right operand
-  Register registers[] = {x1, x0};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ArgumentAdaptorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  static PlatformInterfaceDescriptor default_descriptor =
-      PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS);
-
-  Register registers[] = {
-      x1,  // JSFunction
-      x3,  // the new target
-      x0,  // actual number of arguments
-      x2,  // expected number of arguments
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers,
-                                   &default_descriptor);
-}
-
-void ApiCallbackDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  static PlatformInterfaceDescriptor default_descriptor =
-      PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS);
-
-  Register registers[] = {
-      JavaScriptFrame::context_register(),  // callee context
-      x4,                                   // call_data
-      x2,                                   // holder
-      x1,                                   // api_function_address
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers,
-                                   &default_descriptor);
-}
-
-void InterpreterDispatchDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      kInterpreterAccumulatorRegister, kInterpreterBytecodeOffsetRegister,
-      kInterpreterBytecodeArrayRegister, kInterpreterDispatchTableRegister};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterPushArgsThenCallDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      x0,  // argument count (not including receiver)
-      x2,  // address of first argument
-      x1   // the target callable to be call
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterPushArgsThenConstructDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      x0,  // argument count (not including receiver)
-      x3,  // new target
-      x1,  // constructor to call
-      x2,  // allocation site feedback if available, undefined otherwise
-      x4   // address of the first argument
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterCEntryDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      x0,   // argument count (argc)
-      x11,  // address of first argument (argv)
-      x1    // the runtime function to call
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ResumeGeneratorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      x0,  // the value to pass to the generator
-      x1   // the JSGeneratorObject to resume
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void FrameDropperTrampolineDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      x1,  // loaded new FP
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_ARM64
diff --git a/src/v8/src/arm64/interface-descriptors-arm64.h b/src/v8/src/arm64/interface-descriptors-arm64.h
deleted file mode 100644
index 20ab8cb..0000000
--- a/src/v8/src/arm64/interface-descriptors-arm64.h
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_ARM64_INTERFACE_DESCRIPTORS_ARM64_H_
-#define V8_ARM64_INTERFACE_DESCRIPTORS_ARM64_H_
-
-#include "src/interface-descriptors.h"
-
-namespace v8 {
-namespace internal {
-
-class PlatformInterfaceDescriptor {
- public:
-  explicit PlatformInterfaceDescriptor(TargetAddressStorageMode storage_mode)
-      : storage_mode_(storage_mode) {}
-
-  TargetAddressStorageMode storage_mode() { return storage_mode_; }
-
- private:
-  TargetAddressStorageMode storage_mode_;
-};
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_ARM64_INTERFACE_DESCRIPTORS_ARM64_H_
diff --git a/src/v8/src/arm64/macro-assembler-arm64-inl.h b/src/v8/src/arm64/macro-assembler-arm64-inl.h
deleted file mode 100644
index 0861551..0000000
--- a/src/v8/src/arm64/macro-assembler-arm64-inl.h
+++ /dev/null
@@ -1,1469 +0,0 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_ARM64_MACRO_ASSEMBLER_ARM64_INL_H_
-#define V8_ARM64_MACRO_ASSEMBLER_ARM64_INL_H_
-
-#include <ctype.h>
-
-#include "src/globals.h"
-
-#include "src/arm64/assembler-arm64-inl.h"
-#include "src/arm64/assembler-arm64.h"
-#include "src/arm64/instrument-arm64.h"
-#include "src/base/bits.h"
-#include "src/macro-assembler.h"
-
-namespace v8 {
-namespace internal {
-
-
-MemOperand FieldMemOperand(Register object, int offset) {
-  return MemOperand(object, offset - kHeapObjectTag);
-}
-
-
-MemOperand UntagSmiFieldMemOperand(Register object, int offset) {
-  return UntagSmiMemOperand(object, offset - kHeapObjectTag);
-}
-
-
-MemOperand UntagSmiMemOperand(Register object, int offset) {
-  // Assumes that Smis are shifted by 32 bits and little endianness.
-  STATIC_ASSERT(kSmiShift == 32);
-  return MemOperand(object, offset + (kSmiShift / kBitsPerByte));
-}
-
-void TurboAssembler::And(const Register& rd, const Register& rn,
-                         const Operand& operand) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  LogicalMacro(rd, rn, operand, AND);
-}
-
-void TurboAssembler::Ands(const Register& rd, const Register& rn,
-                          const Operand& operand) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  LogicalMacro(rd, rn, operand, ANDS);
-}
-
-void TurboAssembler::Tst(const Register& rn, const Operand& operand) {
-  DCHECK(allow_macro_instructions());
-  LogicalMacro(AppropriateZeroRegFor(rn), rn, operand, ANDS);
-}
-
-void TurboAssembler::Bic(const Register& rd, const Register& rn,
-                         const Operand& operand) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  LogicalMacro(rd, rn, operand, BIC);
-}
-
-
-void MacroAssembler::Bics(const Register& rd,
-                          const Register& rn,
-                          const Operand& operand) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  LogicalMacro(rd, rn, operand, BICS);
-}
-
-void TurboAssembler::Orr(const Register& rd, const Register& rn,
-                         const Operand& operand) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  LogicalMacro(rd, rn, operand, ORR);
-}
-
-void TurboAssembler::Orn(const Register& rd, const Register& rn,
-                         const Operand& operand) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  LogicalMacro(rd, rn, operand, ORN);
-}
-
-void TurboAssembler::Eor(const Register& rd, const Register& rn,
-                         const Operand& operand) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  LogicalMacro(rd, rn, operand, EOR);
-}
-
-void TurboAssembler::Eon(const Register& rd, const Register& rn,
-                         const Operand& operand) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  LogicalMacro(rd, rn, operand, EON);
-}
-
-void TurboAssembler::Ccmp(const Register& rn, const Operand& operand,
-                          StatusFlags nzcv, Condition cond) {
-  DCHECK(allow_macro_instructions());
-  if (operand.IsImmediate() && (operand.ImmediateValue() < 0)) {
-    ConditionalCompareMacro(rn, -operand.ImmediateValue(), nzcv, cond, CCMN);
-  } else {
-    ConditionalCompareMacro(rn, operand, nzcv, cond, CCMP);
-  }
-}
-
-
-void MacroAssembler::Ccmn(const Register& rn,
-                          const Operand& operand,
-                          StatusFlags nzcv,
-                          Condition cond) {
-  DCHECK(allow_macro_instructions());
-  if (operand.IsImmediate() && (operand.ImmediateValue() < 0)) {
-    ConditionalCompareMacro(rn, -operand.ImmediateValue(), nzcv, cond, CCMP);
-  } else {
-    ConditionalCompareMacro(rn, operand, nzcv, cond, CCMN);
-  }
-}
-
-void TurboAssembler::Add(const Register& rd, const Register& rn,
-                         const Operand& operand) {
-  DCHECK(allow_macro_instructions());
-  if (operand.IsImmediate() && (operand.ImmediateValue() < 0) &&
-      IsImmAddSub(-operand.ImmediateValue())) {
-    AddSubMacro(rd, rn, -operand.ImmediateValue(), LeaveFlags, SUB);
-  } else {
-    AddSubMacro(rd, rn, operand, LeaveFlags, ADD);
-  }
-}
-
-void TurboAssembler::Adds(const Register& rd, const Register& rn,
-                          const Operand& operand) {
-  DCHECK(allow_macro_instructions());
-  if (operand.IsImmediate() && (operand.ImmediateValue() < 0) &&
-      IsImmAddSub(-operand.ImmediateValue())) {
-    AddSubMacro(rd, rn, -operand.ImmediateValue(), SetFlags, SUB);
-  } else {
-    AddSubMacro(rd, rn, operand, SetFlags, ADD);
-  }
-}
-
-void TurboAssembler::Sub(const Register& rd, const Register& rn,
-                         const Operand& operand) {
-  DCHECK(allow_macro_instructions());
-  if (operand.IsImmediate() && (operand.ImmediateValue() < 0) &&
-      IsImmAddSub(-operand.ImmediateValue())) {
-    AddSubMacro(rd, rn, -operand.ImmediateValue(), LeaveFlags, ADD);
-  } else {
-    AddSubMacro(rd, rn, operand, LeaveFlags, SUB);
-  }
-}
-
-void TurboAssembler::Subs(const Register& rd, const Register& rn,
-                          const Operand& operand) {
-  DCHECK(allow_macro_instructions());
-  if (operand.IsImmediate() && (operand.ImmediateValue() < 0) &&
-      IsImmAddSub(-operand.ImmediateValue())) {
-    AddSubMacro(rd, rn, -operand.ImmediateValue(), SetFlags, ADD);
-  } else {
-    AddSubMacro(rd, rn, operand, SetFlags, SUB);
-  }
-}
-
-void TurboAssembler::Cmn(const Register& rn, const Operand& operand) {
-  DCHECK(allow_macro_instructions());
-  Adds(AppropriateZeroRegFor(rn), rn, operand);
-}
-
-void TurboAssembler::Cmp(const Register& rn, const Operand& operand) {
-  DCHECK(allow_macro_instructions());
-  Subs(AppropriateZeroRegFor(rn), rn, operand);
-}
-
-void TurboAssembler::Neg(const Register& rd, const Operand& operand) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  if (operand.IsImmediate()) {
-    Mov(rd, -operand.ImmediateValue());
-  } else {
-    Sub(rd, AppropriateZeroRegFor(rd), operand);
-  }
-}
-
-void TurboAssembler::Negs(const Register& rd, const Operand& operand) {
-  DCHECK(allow_macro_instructions());
-  Subs(rd, AppropriateZeroRegFor(rd), operand);
-}
-
-void TurboAssembler::Adc(const Register& rd, const Register& rn,
-                         const Operand& operand) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  AddSubWithCarryMacro(rd, rn, operand, LeaveFlags, ADC);
-}
-
-
-void MacroAssembler::Adcs(const Register& rd,
-                          const Register& rn,
-                          const Operand& operand) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  AddSubWithCarryMacro(rd, rn, operand, SetFlags, ADC);
-}
-
-
-void MacroAssembler::Sbc(const Register& rd,
-                         const Register& rn,
-                         const Operand& operand) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  AddSubWithCarryMacro(rd, rn, operand, LeaveFlags, SBC);
-}
-
-
-void MacroAssembler::Sbcs(const Register& rd,
-                          const Register& rn,
-                          const Operand& operand) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  AddSubWithCarryMacro(rd, rn, operand, SetFlags, SBC);
-}
-
-
-void MacroAssembler::Ngc(const Register& rd,
-                         const Operand& operand) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  Register zr = AppropriateZeroRegFor(rd);
-  Sbc(rd, zr, operand);
-}
-
-
-void MacroAssembler::Ngcs(const Register& rd,
-                          const Operand& operand) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  Register zr = AppropriateZeroRegFor(rd);
-  Sbcs(rd, zr, operand);
-}
-
-void TurboAssembler::Mvn(const Register& rd, uint64_t imm) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  Mov(rd, ~imm);
-}
-
-#define DEFINE_FUNCTION(FN, REGTYPE, REG, OP)                          \
-  void TurboAssembler::FN(const REGTYPE REG, const MemOperand& addr) { \
-    DCHECK(allow_macro_instructions());                                \
-    LoadStoreMacro(REG, addr, OP);                                     \
-  }
-LS_MACRO_LIST(DEFINE_FUNCTION)
-#undef DEFINE_FUNCTION
-
-#define DEFINE_FUNCTION(FN, REGTYPE, REG, REG2, OP)              \
-  void TurboAssembler::FN(const REGTYPE REG, const REGTYPE REG2, \
-                          const MemOperand& addr) {              \
-    DCHECK(allow_macro_instructions());                          \
-    LoadStorePairMacro(REG, REG2, addr, OP);                     \
-  }
-LSPAIR_MACRO_LIST(DEFINE_FUNCTION)
-#undef DEFINE_FUNCTION
-
-#define DECLARE_FUNCTION(FN, OP)                                    \
-  void TurboAssembler::FN(const Register& rt, const Register& rn) { \
-    DCHECK(allow_macro_instructions());                             \
-    OP(rt, rn);                                                     \
-  }
-LDA_STL_MACRO_LIST(DECLARE_FUNCTION)
-#undef DECLARE_FUNCTION
-
-#define DECLARE_FUNCTION(FN, OP)                                  \
-  void MacroAssembler::FN(const Register& rs, const Register& rt, \
-                          const Register& rn) {                   \
-    DCHECK(allow_macro_instructions());                           \
-    OP(rs, rt, rn);                                               \
-  }
-STLX_MACRO_LIST(DECLARE_FUNCTION)
-#undef DECLARE_FUNCTION
-
-void TurboAssembler::Asr(const Register& rd, const Register& rn,
-                         unsigned shift) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  asr(rd, rn, shift);
-}
-
-void TurboAssembler::Asr(const Register& rd, const Register& rn,
-                         const Register& rm) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  asrv(rd, rn, rm);
-}
-
-void TurboAssembler::B(Label* label) {
-  b(label);
-  CheckVeneerPool(false, false);
-}
-
-void TurboAssembler::B(Condition cond, Label* label) {
-  DCHECK(allow_macro_instructions());
-  B(label, cond);
-}
-
-void TurboAssembler::Bfi(const Register& rd, const Register& rn, unsigned lsb,
-                         unsigned width) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  bfi(rd, rn, lsb, width);
-}
-
-
-void MacroAssembler::Bfxil(const Register& rd,
-                           const Register& rn,
-                           unsigned lsb,
-                           unsigned width) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  bfxil(rd, rn, lsb, width);
-}
-
-void TurboAssembler::Bind(Label* label) {
-  DCHECK(allow_macro_instructions());
-  bind(label);
-}
-
-void TurboAssembler::Bl(Label* label) {
-  DCHECK(allow_macro_instructions());
-  bl(label);
-}
-
-void TurboAssembler::Blr(const Register& xn) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!xn.IsZero());
-  blr(xn);
-}
-
-void TurboAssembler::Br(const Register& xn) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!xn.IsZero());
-  br(xn);
-}
-
-void TurboAssembler::Brk(int code) {
-  DCHECK(allow_macro_instructions());
-  brk(code);
-}
-
-
-void MacroAssembler::Cinc(const Register& rd,
-                          const Register& rn,
-                          Condition cond) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  DCHECK((cond != al) && (cond != nv));
-  cinc(rd, rn, cond);
-}
-
-
-void MacroAssembler::Cinv(const Register& rd,
-                          const Register& rn,
-                          Condition cond) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  DCHECK((cond != al) && (cond != nv));
-  cinv(rd, rn, cond);
-}
-
-void TurboAssembler::Cls(const Register& rd, const Register& rn) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  cls(rd, rn);
-}
-
-void TurboAssembler::Clz(const Register& rd, const Register& rn) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  clz(rd, rn);
-}
-
-void TurboAssembler::Cneg(const Register& rd, const Register& rn,
-                          Condition cond) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  DCHECK((cond != al) && (cond != nv));
-  cneg(rd, rn, cond);
-}
-
-
-// Conditionally zero the destination register. Only X registers are supported
-// due to the truncation side-effect when used on W registers.
-void MacroAssembler::CzeroX(const Register& rd,
-                            Condition cond) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsSP() && rd.Is64Bits());
-  DCHECK((cond != al) && (cond != nv));
-  csel(rd, xzr, rd, cond);
-}
-
-
-// Conditionally move a value into the destination register. Only X registers
-// are supported due to the truncation side-effect when used on W registers.
-void MacroAssembler::CmovX(const Register& rd,
-                           const Register& rn,
-                           Condition cond) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsSP());
-  DCHECK(rd.Is64Bits() && rn.Is64Bits());
-  DCHECK((cond != al) && (cond != nv));
-  if (!rd.is(rn)) {
-    csel(rd, rn, rd, cond);
-  }
-}
-
-void TurboAssembler::Cset(const Register& rd, Condition cond) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  DCHECK((cond != al) && (cond != nv));
-  cset(rd, cond);
-}
-
-
-void MacroAssembler::Csetm(const Register& rd, Condition cond) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  DCHECK((cond != al) && (cond != nv));
-  csetm(rd, cond);
-}
-
-void TurboAssembler::Csinc(const Register& rd, const Register& rn,
-                           const Register& rm, Condition cond) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  DCHECK((cond != al) && (cond != nv));
-  csinc(rd, rn, rm, cond);
-}
-
-
-void MacroAssembler::Csinv(const Register& rd,
-                           const Register& rn,
-                           const Register& rm,
-                           Condition cond) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  DCHECK((cond != al) && (cond != nv));
-  csinv(rd, rn, rm, cond);
-}
-
-
-void MacroAssembler::Csneg(const Register& rd,
-                           const Register& rn,
-                           const Register& rm,
-                           Condition cond) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  DCHECK((cond != al) && (cond != nv));
-  csneg(rd, rn, rm, cond);
-}
-
-
-void MacroAssembler::Dmb(BarrierDomain domain, BarrierType type) {
-  DCHECK(allow_macro_instructions());
-  dmb(domain, type);
-}
-
-
-void MacroAssembler::Dsb(BarrierDomain domain, BarrierType type) {
-  DCHECK(allow_macro_instructions());
-  dsb(domain, type);
-}
-
-void TurboAssembler::Debug(const char* message, uint32_t code, Instr params) {
-  DCHECK(allow_macro_instructions());
-  debug(message, code, params);
-}
-
-
-void MacroAssembler::Extr(const Register& rd,
-                          const Register& rn,
-                          const Register& rm,
-                          unsigned lsb) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  extr(rd, rn, rm, lsb);
-}
-
-void TurboAssembler::Fabs(const VRegister& fd, const VRegister& fn) {
-  DCHECK(allow_macro_instructions());
-  fabs(fd, fn);
-}
-
-void TurboAssembler::Fadd(const VRegister& fd, const VRegister& fn,
-                          const VRegister& fm) {
-  DCHECK(allow_macro_instructions());
-  fadd(fd, fn, fm);
-}
-
-void TurboAssembler::Fccmp(const VRegister& fn, const VRegister& fm,
-                           StatusFlags nzcv, Condition cond) {
-  DCHECK(allow_macro_instructions());
-  DCHECK((cond != al) && (cond != nv));
-  fccmp(fn, fm, nzcv, cond);
-}
-
-void TurboAssembler::Fcmp(const VRegister& fn, const VRegister& fm) {
-  DCHECK(allow_macro_instructions());
-  fcmp(fn, fm);
-}
-
-void TurboAssembler::Fcmp(const VRegister& fn, double value) {
-  DCHECK(allow_macro_instructions());
-  if (value != 0.0) {
-    UseScratchRegisterScope temps(this);
-    VRegister tmp = temps.AcquireSameSizeAs(fn);
-    Fmov(tmp, value);
-    fcmp(fn, tmp);
-  } else {
-    fcmp(fn, value);
-  }
-}
-
-void MacroAssembler::Fcsel(const VRegister& fd, const VRegister& fn,
-                           const VRegister& fm, Condition cond) {
-  DCHECK(allow_macro_instructions());
-  DCHECK((cond != al) && (cond != nv));
-  fcsel(fd, fn, fm, cond);
-}
-
-void TurboAssembler::Fcvt(const VRegister& fd, const VRegister& fn) {
-  DCHECK(allow_macro_instructions());
-  fcvt(fd, fn);
-}
-
-void TurboAssembler::Fcvtas(const Register& rd, const VRegister& fn) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  fcvtas(rd, fn);
-}
-
-void TurboAssembler::Fcvtau(const Register& rd, const VRegister& fn) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  fcvtau(rd, fn);
-}
-
-void TurboAssembler::Fcvtms(const Register& rd, const VRegister& fn) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  fcvtms(rd, fn);
-}
-
-void TurboAssembler::Fcvtmu(const Register& rd, const VRegister& fn) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  fcvtmu(rd, fn);
-}
-
-void TurboAssembler::Fcvtns(const Register& rd, const VRegister& fn) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  fcvtns(rd, fn);
-}
-
-void TurboAssembler::Fcvtnu(const Register& rd, const VRegister& fn) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  fcvtnu(rd, fn);
-}
-
-void TurboAssembler::Fcvtzs(const Register& rd, const VRegister& fn) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  fcvtzs(rd, fn);
-}
-void TurboAssembler::Fcvtzu(const Register& rd, const VRegister& fn) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  fcvtzu(rd, fn);
-}
-
-void TurboAssembler::Fdiv(const VRegister& fd, const VRegister& fn,
-                          const VRegister& fm) {
-  DCHECK(allow_macro_instructions());
-  fdiv(fd, fn, fm);
-}
-
-void MacroAssembler::Fmadd(const VRegister& fd, const VRegister& fn,
-                           const VRegister& fm, const VRegister& fa) {
-  DCHECK(allow_macro_instructions());
-  fmadd(fd, fn, fm, fa);
-}
-
-void TurboAssembler::Fmax(const VRegister& fd, const VRegister& fn,
-                          const VRegister& fm) {
-  DCHECK(allow_macro_instructions());
-  fmax(fd, fn, fm);
-}
-
-void MacroAssembler::Fmaxnm(const VRegister& fd, const VRegister& fn,
-                            const VRegister& fm) {
-  DCHECK(allow_macro_instructions());
-  fmaxnm(fd, fn, fm);
-}
-
-void TurboAssembler::Fmin(const VRegister& fd, const VRegister& fn,
-                          const VRegister& fm) {
-  DCHECK(allow_macro_instructions());
-  fmin(fd, fn, fm);
-}
-
-void MacroAssembler::Fminnm(const VRegister& fd, const VRegister& fn,
-                            const VRegister& fm) {
-  DCHECK(allow_macro_instructions());
-  fminnm(fd, fn, fm);
-}
-
-void TurboAssembler::Fmov(VRegister fd, VRegister fn) {
-  DCHECK(allow_macro_instructions());
-  // Only emit an instruction if fd and fn are different, and they are both D
-  // registers. fmov(s0, s0) is not a no-op because it clears the top word of
-  // d0. Technically, fmov(d0, d0) is not a no-op either because it clears the
-  // top of q0, but VRegister does not currently support Q registers.
-  if (!fd.Is(fn) || !fd.Is64Bits()) {
-    fmov(fd, fn);
-  }
-}
-
-void TurboAssembler::Fmov(VRegister fd, Register rn) {
-  DCHECK(allow_macro_instructions());
-  fmov(fd, rn);
-}
-
-void TurboAssembler::Fmov(VRegister vd, double imm) {
-  DCHECK(allow_macro_instructions());
-
-  if (vd.Is1S() || vd.Is2S() || vd.Is4S()) {
-    Fmov(vd, static_cast<float>(imm));
-    return;
-  }
-
-  DCHECK(vd.Is1D() || vd.Is2D());
-  if (IsImmFP64(imm)) {
-    fmov(vd, imm);
-  } else {
-    uint64_t bits = bit_cast<uint64_t>(imm);
-    if (vd.IsScalar()) {
-      if (bits == 0) {
-        fmov(vd, xzr);
-      } else {
-        Ldr(vd, imm);
-      }
-    } else {
-      // TODO(all): consider NEON support for load literal.
-      Movi(vd, bits);
-    }
-  }
-}
-
-void TurboAssembler::Fmov(VRegister vd, float imm) {
-  DCHECK(allow_macro_instructions());
-  if (vd.Is1D() || vd.Is2D()) {
-    Fmov(vd, static_cast<double>(imm));
-    return;
-  }
-
-  DCHECK(vd.Is1S() || vd.Is2S() || vd.Is4S());
-  if (IsImmFP32(imm)) {
-    fmov(vd, imm);
-  } else {
-    uint32_t bits = bit_cast<uint32_t>(imm);
-    if (vd.IsScalar()) {
-      if (bits == 0) {
-        fmov(vd, wzr);
-      } else {
-        UseScratchRegisterScope temps(this);
-        Register tmp = temps.AcquireW();
-        // TODO(all): Use Assembler::ldr(const VRegister& ft, float imm).
-        Mov(tmp, bit_cast<uint32_t>(imm));
-        Fmov(vd, tmp);
-      }
-    } else {
-      // TODO(all): consider NEON support for load literal.
-      Movi(vd, bits);
-    }
-  }
-}
-
-void TurboAssembler::Fmov(Register rd, VRegister fn) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  fmov(rd, fn);
-}
-
-void MacroAssembler::Fmsub(const VRegister& fd, const VRegister& fn,
-                           const VRegister& fm, const VRegister& fa) {
-  DCHECK(allow_macro_instructions());
-  fmsub(fd, fn, fm, fa);
-}
-
-void TurboAssembler::Fmul(const VRegister& fd, const VRegister& fn,
-                          const VRegister& fm) {
-  DCHECK(allow_macro_instructions());
-  fmul(fd, fn, fm);
-}
-
-void MacroAssembler::Fnmadd(const VRegister& fd, const VRegister& fn,
-                            const VRegister& fm, const VRegister& fa) {
-  DCHECK(allow_macro_instructions());
-  fnmadd(fd, fn, fm, fa);
-}
-
-void MacroAssembler::Fnmsub(const VRegister& fd, const VRegister& fn,
-                            const VRegister& fm, const VRegister& fa) {
-  DCHECK(allow_macro_instructions());
-  fnmsub(fd, fn, fm, fa);
-}
-
-void TurboAssembler::Fsub(const VRegister& fd, const VRegister& fn,
-                          const VRegister& fm) {
-  DCHECK(allow_macro_instructions());
-  fsub(fd, fn, fm);
-}
-
-
-void MacroAssembler::Hint(SystemHint code) {
-  DCHECK(allow_macro_instructions());
-  hint(code);
-}
-
-
-void MacroAssembler::Hlt(int code) {
-  DCHECK(allow_macro_instructions());
-  hlt(code);
-}
-
-
-void MacroAssembler::Isb() {
-  DCHECK(allow_macro_instructions());
-  isb();
-}
-
-void TurboAssembler::Ldr(const CPURegister& rt, const Operand& operand) {
-  DCHECK(allow_macro_instructions());
-  ldr(rt, operand);
-}
-
-void TurboAssembler::Ldr(const CPURegister& rt, double imm) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(rt.Is64Bits());
-  ldr(rt, Immediate(bit_cast<uint64_t>(imm)));
-}
-
-void TurboAssembler::Lsl(const Register& rd, const Register& rn,
-                         unsigned shift) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  lsl(rd, rn, shift);
-}
-
-void TurboAssembler::Lsl(const Register& rd, const Register& rn,
-                         const Register& rm) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  lslv(rd, rn, rm);
-}
-
-void TurboAssembler::Lsr(const Register& rd, const Register& rn,
-                         unsigned shift) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  lsr(rd, rn, shift);
-}
-
-void TurboAssembler::Lsr(const Register& rd, const Register& rn,
-                         const Register& rm) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  lsrv(rd, rn, rm);
-}
-
-void TurboAssembler::Madd(const Register& rd, const Register& rn,
-                          const Register& rm, const Register& ra) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  madd(rd, rn, rm, ra);
-}
-
-void TurboAssembler::Mneg(const Register& rd, const Register& rn,
-                          const Register& rm) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  mneg(rd, rn, rm);
-}
-
-void TurboAssembler::Mov(const Register& rd, const Register& rn) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  // Emit a register move only if the registers are distinct, or if they are
-  // not X registers. Note that mov(w0, w0) is not a no-op because it clears
-  // the top word of x0.
-  if (!rd.Is(rn) || !rd.Is64Bits()) {
-    Assembler::mov(rd, rn);
-  }
-}
-
-
-void MacroAssembler::Movk(const Register& rd, uint64_t imm, int shift) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  movk(rd, imm, shift);
-}
-
-void TurboAssembler::Mrs(const Register& rt, SystemRegister sysreg) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rt.IsZero());
-  mrs(rt, sysreg);
-}
-
-
-void MacroAssembler::Msr(SystemRegister sysreg, const Register& rt) {
-  DCHECK(allow_macro_instructions());
-  msr(sysreg, rt);
-}
-
-void TurboAssembler::Msub(const Register& rd, const Register& rn,
-                          const Register& rm, const Register& ra) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  msub(rd, rn, rm, ra);
-}
-
-void TurboAssembler::Mul(const Register& rd, const Register& rn,
-                         const Register& rm) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  mul(rd, rn, rm);
-}
-
-void TurboAssembler::Rbit(const Register& rd, const Register& rn) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  rbit(rd, rn);
-}
-
-void TurboAssembler::Ret(const Register& xn) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!xn.IsZero());
-  ret(xn);
-  CheckVeneerPool(false, false);
-}
-
-
-void MacroAssembler::Rev(const Register& rd, const Register& rn) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  rev(rd, rn);
-}
-
-void TurboAssembler::Rev16(const Register& rd, const Register& rn) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  rev16(rd, rn);
-}
-
-void TurboAssembler::Rev32(const Register& rd, const Register& rn) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  rev32(rd, rn);
-}
-
-void TurboAssembler::Ror(const Register& rd, const Register& rs,
-                         unsigned shift) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  ror(rd, rs, shift);
-}
-
-void TurboAssembler::Ror(const Register& rd, const Register& rn,
-                         const Register& rm) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  rorv(rd, rn, rm);
-}
-
-
-void MacroAssembler::Sbfiz(const Register& rd,
-                           const Register& rn,
-                           unsigned lsb,
-                           unsigned width) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  sbfiz(rd, rn, lsb, width);
-}
-
-void TurboAssembler::Sbfx(const Register& rd, const Register& rn, unsigned lsb,
-                          unsigned width) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  sbfx(rd, rn, lsb, width);
-}
-
-void TurboAssembler::Scvtf(const VRegister& fd, const Register& rn,
-                           unsigned fbits) {
-  DCHECK(allow_macro_instructions());
-  scvtf(fd, rn, fbits);
-}
-
-void TurboAssembler::Sdiv(const Register& rd, const Register& rn,
-                          const Register& rm) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  sdiv(rd, rn, rm);
-}
-
-
-void MacroAssembler::Smaddl(const Register& rd,
-                            const Register& rn,
-                            const Register& rm,
-                            const Register& ra) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  smaddl(rd, rn, rm, ra);
-}
-
-
-void MacroAssembler::Smsubl(const Register& rd,
-                            const Register& rn,
-                            const Register& rm,
-                            const Register& ra) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  smsubl(rd, rn, rm, ra);
-}
-
-void TurboAssembler::Smull(const Register& rd, const Register& rn,
-                           const Register& rm) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  smull(rd, rn, rm);
-}
-
-
-void MacroAssembler::Smulh(const Register& rd,
-                           const Register& rn,
-                           const Register& rm) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  smulh(rd, rn, rm);
-}
-
-void TurboAssembler::Umull(const Register& rd, const Register& rn,
-                           const Register& rm) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  umaddl(rd, rn, rm, xzr);
-}
-
-void TurboAssembler::Sxtb(const Register& rd, const Register& rn) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  sxtb(rd, rn);
-}
-
-void TurboAssembler::Sxth(const Register& rd, const Register& rn) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  sxth(rd, rn);
-}
-
-void TurboAssembler::Sxtw(const Register& rd, const Register& rn) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  sxtw(rd, rn);
-}
-
-void TurboAssembler::Ubfiz(const Register& rd, const Register& rn, unsigned lsb,
-                           unsigned width) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  ubfiz(rd, rn, lsb, width);
-}
-
-void TurboAssembler::Ubfx(const Register& rd, const Register& rn, unsigned lsb,
-                          unsigned width) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  ubfx(rd, rn, lsb, width);
-}
-
-void TurboAssembler::Ucvtf(const VRegister& fd, const Register& rn,
-                           unsigned fbits) {
-  DCHECK(allow_macro_instructions());
-  ucvtf(fd, rn, fbits);
-}
-
-void TurboAssembler::Udiv(const Register& rd, const Register& rn,
-                          const Register& rm) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  udiv(rd, rn, rm);
-}
-
-
-void MacroAssembler::Umaddl(const Register& rd,
-                            const Register& rn,
-                            const Register& rm,
-                            const Register& ra) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  umaddl(rd, rn, rm, ra);
-}
-
-
-void MacroAssembler::Umsubl(const Register& rd,
-                            const Register& rn,
-                            const Register& rm,
-                            const Register& ra) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  umsubl(rd, rn, rm, ra);
-}
-
-void TurboAssembler::Uxtb(const Register& rd, const Register& rn) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  uxtb(rd, rn);
-}
-
-void TurboAssembler::Uxth(const Register& rd, const Register& rn) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  uxth(rd, rn);
-}
-
-void TurboAssembler::Uxtw(const Register& rd, const Register& rn) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  uxtw(rd, rn);
-}
-
-void MacroAssembler::AlignAndSetCSPForFrame() {
-  int sp_alignment = ActivationFrameAlignment();
-  // AAPCS64 mandates at least 16-byte alignment.
-  DCHECK_GE(sp_alignment, 16);
-  DCHECK(base::bits::IsPowerOfTwo(sp_alignment));
-  Bic(csp, StackPointer(), sp_alignment - 1);
-}
-
-void TurboAssembler::BumpSystemStackPointer(const Operand& space) {
-  DCHECK(!csp.Is(StackPointer()));
-  if (!TmpList()->IsEmpty()) {
-    Sub(csp, StackPointer(), space);
-  } else {
-    // TODO(jbramley): Several callers rely on this not using scratch
-    // registers, so we use the assembler directly here. However, this means
-    // that large immediate values of 'space' cannot be handled cleanly. (Only
-    // 24-bits immediates or values of 'space' that can be encoded in one
-    // instruction are accepted.) Once we implement our flexible scratch
-    // register idea, we could greatly simplify this function.
-    InstructionAccurateScope scope(this);
-    DCHECK(space.IsImmediate());
-    // Align to 16 bytes.
-    uint64_t imm = RoundUp(space.ImmediateValue(), 0x10);
-    DCHECK(is_uint24(imm));
-
-    Register source = StackPointer();
-    if (CpuFeatures::IsSupported(ALWAYS_ALIGN_CSP)) {
-      bic(csp, source, 0xf);
-      source = csp;
-    }
-    if (!is_uint12(imm)) {
-      int64_t imm_top_12_bits = imm >> 12;
-      sub(csp, source, imm_top_12_bits << 12);
-      source = csp;
-      imm -= imm_top_12_bits << 12;
-    }
-    if (imm > 0) {
-      sub(csp, source, imm);
-    }
-  }
-  AssertStackConsistency();
-}
-
-void TurboAssembler::SyncSystemStackPointer() {
-  DCHECK(emit_debug_code());
-  DCHECK(!csp.Is(StackPointer()));
-  { InstructionAccurateScope scope(this);
-    mov(csp, StackPointer());
-  }
-  AssertStackConsistency();
-}
-
-void TurboAssembler::InitializeRootRegister() {
-  ExternalReference roots_array_start =
-      ExternalReference::roots_array_start(isolate());
-  Mov(root, Operand(roots_array_start));
-}
-
-
-void MacroAssembler::SmiTag(Register dst, Register src) {
-  STATIC_ASSERT(kXRegSizeInBits ==
-                static_cast<unsigned>(kSmiShift + kSmiValueSize));
-  DCHECK(dst.Is64Bits() && src.Is64Bits());
-  Lsl(dst, src, kSmiShift);
-}
-
-
-void MacroAssembler::SmiTag(Register smi) { SmiTag(smi, smi); }
-
-void TurboAssembler::SmiUntag(Register dst, Register src) {
-  STATIC_ASSERT(kXRegSizeInBits ==
-                static_cast<unsigned>(kSmiShift + kSmiValueSize));
-  DCHECK(dst.Is64Bits() && src.Is64Bits());
-  if (FLAG_enable_slow_asserts) {
-    AssertSmi(src);
-  }
-  Asr(dst, src, kSmiShift);
-}
-
-void TurboAssembler::SmiUntag(Register smi) { SmiUntag(smi, smi); }
-
-void MacroAssembler::SmiUntagToDouble(VRegister dst, Register src) {
-  DCHECK(dst.Is64Bits() && src.Is64Bits());
-  if (FLAG_enable_slow_asserts) {
-    AssertSmi(src);
-  }
-  Scvtf(dst, src, kSmiShift);
-}
-
-void MacroAssembler::SmiUntagToFloat(VRegister dst, Register src) {
-  DCHECK(dst.Is32Bits() && src.Is64Bits());
-  if (FLAG_enable_slow_asserts) {
-    AssertSmi(src);
-  }
-  Scvtf(dst, src, kSmiShift);
-}
-
-void TurboAssembler::JumpIfSmi(Register value, Label* smi_label,
-                               Label* not_smi_label) {
-  STATIC_ASSERT((kSmiTagSize == 1) && (kSmiTag == 0));
-  // Check if the tag bit is set.
-  if (smi_label) {
-    Tbz(value, 0, smi_label);
-    if (not_smi_label) {
-      B(not_smi_label);
-    }
-  } else {
-    DCHECK(not_smi_label);
-    Tbnz(value, 0, not_smi_label);
-  }
-}
-
-
-void MacroAssembler::JumpIfNotSmi(Register value, Label* not_smi_label) {
-  JumpIfSmi(value, nullptr, not_smi_label);
-}
-
-
-void MacroAssembler::JumpIfBothSmi(Register value1,
-                                   Register value2,
-                                   Label* both_smi_label,
-                                   Label* not_smi_label) {
-  STATIC_ASSERT((kSmiTagSize == 1) && (kSmiTag == 0));
-  UseScratchRegisterScope temps(this);
-  Register tmp = temps.AcquireX();
-  // Check if both tag bits are clear.
-  Orr(tmp, value1, value2);
-  JumpIfSmi(tmp, both_smi_label, not_smi_label);
-}
-
-
-void MacroAssembler::JumpIfEitherSmi(Register value1,
-                                     Register value2,
-                                     Label* either_smi_label,
-                                     Label* not_smi_label) {
-  STATIC_ASSERT((kSmiTagSize == 1) && (kSmiTag == 0));
-  UseScratchRegisterScope temps(this);
-  Register tmp = temps.AcquireX();
-  // Check if either tag bit is clear.
-  And(tmp, value1, value2);
-  JumpIfSmi(tmp, either_smi_label, not_smi_label);
-}
-
-
-void MacroAssembler::JumpIfEitherNotSmi(Register value1,
-                                        Register value2,
-                                        Label* not_smi_label) {
-  JumpIfBothSmi(value1, value2, nullptr, not_smi_label);
-}
-
-
-void MacroAssembler::JumpIfBothNotSmi(Register value1,
-                                      Register value2,
-                                      Label* not_smi_label) {
-  JumpIfEitherSmi(value1, value2, nullptr, not_smi_label);
-}
-
-
-void MacroAssembler::ObjectTag(Register tagged_obj, Register obj) {
-  STATIC_ASSERT(kHeapObjectTag == 1);
-  if (emit_debug_code()) {
-    Label ok;
-    Tbz(obj, 0, &ok);
-    Abort(AbortReason::kObjectTagged);
-    Bind(&ok);
-  }
-  Orr(tagged_obj, obj, kHeapObjectTag);
-}
-
-
-void MacroAssembler::ObjectUntag(Register untagged_obj, Register obj) {
-  STATIC_ASSERT(kHeapObjectTag == 1);
-  if (emit_debug_code()) {
-    Label ok;
-    Tbnz(obj, 0, &ok);
-    Abort(AbortReason::kObjectNotTagged);
-    Bind(&ok);
-  }
-  Bic(untagged_obj, obj, kHeapObjectTag);
-}
-
-void TurboAssembler::jmp(Label* L) { B(L); }
-
-void TurboAssembler::Push(Handle<HeapObject> handle) {
-  UseScratchRegisterScope temps(this);
-  Register tmp = temps.AcquireX();
-  Mov(tmp, Operand(handle));
-  // This is only used in test-heap.cc, for generating code that is not
-  // executed. Push a padding slot together with the handle here, to
-  // satisfy the alignment requirement.
-  Push(padreg, tmp);
-}
-
-void TurboAssembler::Push(Smi* smi) {
-  UseScratchRegisterScope temps(this);
-  Register tmp = temps.AcquireX();
-  Mov(tmp, Operand(smi));
-  Push(tmp);
-}
-
-void TurboAssembler::Claim(int64_t count, uint64_t unit_size) {
-  DCHECK_GE(count, 0);
-  uint64_t size = count * unit_size;
-
-  if (size == 0) {
-    return;
-  }
-
-  if (csp.Is(StackPointer())) {
-    DCHECK_EQ(size % 16, 0);
-  } else {
-    BumpSystemStackPointer(size);
-  }
-
-  Sub(StackPointer(), StackPointer(), size);
-}
-
-void TurboAssembler::Claim(const Register& count, uint64_t unit_size) {
-  if (unit_size == 0) return;
-  DCHECK(base::bits::IsPowerOfTwo(unit_size));
-
-  const int shift = CountTrailingZeros(unit_size, kXRegSizeInBits);
-  const Operand size(count, LSL, shift);
-
-  if (size.IsZero()) {
-    return;
-  }
-
-  AssertPositiveOrZero(count);
-  if (!csp.Is(StackPointer())) {
-    BumpSystemStackPointer(size);
-  }
-
-  Sub(StackPointer(), StackPointer(), size);
-}
-
-
-void MacroAssembler::ClaimBySMI(const Register& count_smi, uint64_t unit_size) {
-  DCHECK(unit_size == 0 || base::bits::IsPowerOfTwo(unit_size));
-  const int shift = CountTrailingZeros(unit_size, kXRegSizeInBits) - kSmiShift;
-  const Operand size(count_smi,
-                     (shift >= 0) ? (LSL) : (LSR),
-                     (shift >= 0) ? (shift) : (-shift));
-
-  if (size.IsZero()) {
-    return;
-  }
-
-  if (!csp.Is(StackPointer())) {
-    BumpSystemStackPointer(size);
-  }
-
-  Sub(StackPointer(), StackPointer(), size);
-}
-
-void TurboAssembler::Drop(int64_t count, uint64_t unit_size) {
-  DCHECK_GE(count, 0);
-  uint64_t size = count * unit_size;
-
-  if (size == 0) {
-    return;
-  }
-
-  Add(StackPointer(), StackPointer(), size);
-
-  if (csp.Is(StackPointer())) {
-    DCHECK_EQ(size % 16, 0);
-  } else if (emit_debug_code()) {
-    // It is safe to leave csp where it is when unwinding the JavaScript stack,
-    // but if we keep it matching StackPointer, the simulator can detect memory
-    // accesses in the now-free part of the stack.
-    SyncSystemStackPointer();
-  }
-}
-
-void TurboAssembler::Drop(const Register& count, uint64_t unit_size) {
-  if (unit_size == 0) return;
-  DCHECK(base::bits::IsPowerOfTwo(unit_size));
-
-  const int shift = CountTrailingZeros(unit_size, kXRegSizeInBits);
-  const Operand size(count, LSL, shift);
-
-  if (size.IsZero()) {
-    return;
-  }
-
-  AssertPositiveOrZero(count);
-  Add(StackPointer(), StackPointer(), size);
-
-  if (!csp.Is(StackPointer()) && emit_debug_code()) {
-    // It is safe to leave csp where it is when unwinding the JavaScript stack,
-    // but if we keep it matching StackPointer, the simulator can detect memory
-    // accesses in the now-free part of the stack.
-    SyncSystemStackPointer();
-  }
-}
-
-void TurboAssembler::DropArguments(const Register& count,
-                                   ArgumentsCountMode mode) {
-  int extra_slots = 1;  // Padding slot.
-  if (mode == kCountExcludesReceiver) {
-    // Add a slot for the receiver.
-    ++extra_slots;
-  }
-  UseScratchRegisterScope temps(this);
-  Register tmp = temps.AcquireX();
-  Add(tmp, count, extra_slots);
-  Bic(tmp, tmp, 1);
-  Drop(tmp, kXRegSize);
-}
-
-void TurboAssembler::DropArguments(int64_t count, ArgumentsCountMode mode) {
-  if (mode == kCountExcludesReceiver) {
-    // Add a slot for the receiver.
-    ++count;
-  }
-  Drop(RoundUp(count, 2), kXRegSize);
-}
-
-void TurboAssembler::DropSlots(int64_t count) {
-  Drop(RoundUp(count, 2), kXRegSize);
-}
-
-void TurboAssembler::PushArgument(const Register& arg) { Push(padreg, arg); }
-
-void MacroAssembler::DropBySMI(const Register& count_smi, uint64_t unit_size) {
-  DCHECK(unit_size == 0 || base::bits::IsPowerOfTwo(unit_size));
-  const int shift = CountTrailingZeros(unit_size, kXRegSizeInBits) - kSmiShift;
-  const Operand size(count_smi,
-                     (shift >= 0) ? (LSL) : (LSR),
-                     (shift >= 0) ? (shift) : (-shift));
-
-  if (size.IsZero()) {
-    return;
-  }
-
-  Add(StackPointer(), StackPointer(), size);
-
-  if (!csp.Is(StackPointer()) && emit_debug_code()) {
-    // It is safe to leave csp where it is when unwinding the JavaScript stack,
-    // but if we keep it matching StackPointer, the simulator can detect memory
-    // accesses in the now-free part of the stack.
-    SyncSystemStackPointer();
-  }
-}
-
-
-void MacroAssembler::CompareAndBranch(const Register& lhs,
-                                      const Operand& rhs,
-                                      Condition cond,
-                                      Label* label) {
-  if (rhs.IsImmediate() && (rhs.ImmediateValue() == 0) &&
-      ((cond == eq) || (cond == ne))) {
-    if (cond == eq) {
-      Cbz(lhs, label);
-    } else {
-      Cbnz(lhs, label);
-    }
-  } else {
-    Cmp(lhs, rhs);
-    B(cond, label);
-  }
-}
-
-void TurboAssembler::TestAndBranchIfAnySet(const Register& reg,
-                                           const uint64_t bit_pattern,
-                                           Label* label) {
-  int bits = reg.SizeInBits();
-  DCHECK_GT(CountSetBits(bit_pattern, bits), 0);
-  if (CountSetBits(bit_pattern, bits) == 1) {
-    Tbnz(reg, MaskToBit(bit_pattern), label);
-  } else {
-    Tst(reg, bit_pattern);
-    B(ne, label);
-  }
-}
-
-void TurboAssembler::TestAndBranchIfAllClear(const Register& reg,
-                                             const uint64_t bit_pattern,
-                                             Label* label) {
-  int bits = reg.SizeInBits();
-  DCHECK_GT(CountSetBits(bit_pattern, bits), 0);
-  if (CountSetBits(bit_pattern, bits) == 1) {
-    Tbz(reg, MaskToBit(bit_pattern), label);
-  } else {
-    Tst(reg, bit_pattern);
-    B(eq, label);
-  }
-}
-
-
-void MacroAssembler::InlineData(uint64_t data) {
-  DCHECK(is_uint16(data));
-  InstructionAccurateScope scope(this, 1);
-  movz(xzr, data);
-}
-
-
-void MacroAssembler::EnableInstrumentation() {
-  InstructionAccurateScope scope(this, 1);
-  movn(xzr, InstrumentStateEnable);
-}
-
-
-void MacroAssembler::DisableInstrumentation() {
-  InstructionAccurateScope scope(this, 1);
-  movn(xzr, InstrumentStateDisable);
-}
-
-
-void MacroAssembler::AnnotateInstrumentation(const char* marker_name) {
-  DCHECK_EQ(strlen(marker_name), 2);
-
-  // We allow only printable characters in the marker names. Unprintable
-  // characters are reserved for controlling features of the instrumentation.
-  DCHECK(isprint(marker_name[0]) && isprint(marker_name[1]));
-
-  InstructionAccurateScope scope(this, 1);
-  movn(xzr, (marker_name[1] << 8) | marker_name[0]);
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_ARM64_MACRO_ASSEMBLER_ARM64_INL_H_
diff --git a/src/v8/src/arm64/macro-assembler-arm64.cc b/src/v8/src/arm64/macro-assembler-arm64.cc
deleted file mode 100644
index 03d0cef..0000000
--- a/src/v8/src/arm64/macro-assembler-arm64.cc
+++ /dev/null
@@ -1,3374 +0,0 @@
-// Copyright 2013 the V8 project 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 V8_TARGET_ARCH_ARM64
-
-#include "src/assembler.h"
-#include "src/base/bits.h"
-#include "src/base/division-by-constant.h"
-#include "src/bootstrapper.h"
-#include "src/callable.h"
-#include "src/code-stubs.h"
-#include "src/debug/debug.h"
-#include "src/external-reference-table.h"
-#include "src/frame-constants.h"
-#include "src/frames-inl.h"
-#include "src/heap/heap-inl.h"
-#include "src/register-configuration.h"
-#include "src/runtime/runtime.h"
-
-#include "src/arm64/macro-assembler-arm64-inl.h"
-#include "src/arm64/macro-assembler-arm64.h"  // Cannot be the first include
-
-namespace v8 {
-namespace internal {
-
-MacroAssembler::MacroAssembler(Isolate* isolate, byte* buffer,
-                               unsigned buffer_size,
-                               CodeObjectRequired create_code_object)
-    : TurboAssembler(isolate, buffer, buffer_size, create_code_object) {}
-
-CPURegList TurboAssembler::DefaultTmpList() { return CPURegList(ip0, ip1); }
-
-CPURegList TurboAssembler::DefaultFPTmpList() {
-  return CPURegList(fp_scratch1, fp_scratch2);
-}
-
-TurboAssembler::TurboAssembler(Isolate* isolate, void* buffer, int buffer_size,
-                               CodeObjectRequired create_code_object)
-    : Assembler(isolate, buffer, buffer_size),
-      isolate_(isolate),
-#if DEBUG
-      allow_macro_instructions_(true),
-#endif
-      tmp_list_(DefaultTmpList()),
-      fptmp_list_(DefaultFPTmpList()),
-      use_real_aborts_(true) {
-  if (create_code_object == CodeObjectRequired::kYes) {
-    code_object_ =
-        Handle<HeapObject>::New(isolate->heap()->undefined_value(), isolate);
-  }
-}
-
-int TurboAssembler::RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode,
-                                                    Register exclusion) const {
-  int bytes = 0;
-  auto list = kCallerSaved;
-  DCHECK_EQ(list.Count() % 2, 0);
-  // We only allow one exclusion register, so if the list is of even length
-  // before exclusions, it must still be afterwards, to maintain alignment.
-  // Therefore, we can ignore the exclusion register in the computation.
-  // However, we leave it in the argument list to mirror the prototype for
-  // Push/PopCallerSaved().
-  USE(exclusion);
-  bytes += list.Count() * kXRegSizeInBits / 8;
-
-  if (fp_mode == kSaveFPRegs) {
-    DCHECK_EQ(kCallerSavedV.Count() % 2, 0);
-    bytes += kCallerSavedV.Count() * kDRegSizeInBits / 8;
-  }
-  return bytes;
-}
-
-int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode,
-                                    Register exclusion) {
-  int bytes = 0;
-  auto list = kCallerSaved;
-  DCHECK_EQ(list.Count() % 2, 0);
-  if (!exclusion.Is(no_reg)) {
-    // Replace the excluded register with padding to maintain alignment.
-    list.Remove(exclusion);
-    list.Combine(padreg);
-  }
-  PushCPURegList(list);
-  bytes += list.Count() * kXRegSizeInBits / 8;
-
-  if (fp_mode == kSaveFPRegs) {
-    DCHECK_EQ(kCallerSavedV.Count() % 2, 0);
-    PushCPURegList(kCallerSavedV);
-    bytes += kCallerSavedV.Count() * kDRegSizeInBits / 8;
-  }
-  return bytes;
-}
-
-int TurboAssembler::PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion) {
-  int bytes = 0;
-  if (fp_mode == kSaveFPRegs) {
-    DCHECK_EQ(kCallerSavedV.Count() % 2, 0);
-    PopCPURegList(kCallerSavedV);
-    bytes += kCallerSavedV.Count() * kDRegSizeInBits / 8;
-  }
-
-  auto list = kCallerSaved;
-  DCHECK_EQ(list.Count() % 2, 0);
-  if (!exclusion.Is(no_reg)) {
-    // Replace the excluded register with padding to maintain alignment.
-    list.Remove(exclusion);
-    list.Combine(padreg);
-  }
-  PopCPURegList(list);
-  bytes += list.Count() * kXRegSizeInBits / 8;
-
-  return bytes;
-}
-
-void TurboAssembler::LogicalMacro(const Register& rd, const Register& rn,
-                                  const Operand& operand, LogicalOp op) {
-  UseScratchRegisterScope temps(this);
-
-  if (operand.NeedsRelocation(this)) {
-    Register temp = temps.AcquireX();
-    Ldr(temp, operand.immediate());
-    Logical(rd, rn, temp, op);
-
-  } else if (operand.IsImmediate()) {
-    int64_t immediate = operand.ImmediateValue();
-    unsigned reg_size = rd.SizeInBits();
-
-    // If the operation is NOT, invert the operation and immediate.
-    if ((op & NOT) == NOT) {
-      op = static_cast<LogicalOp>(op & ~NOT);
-      immediate = ~immediate;
-    }
-
-    // Ignore the top 32 bits of an immediate if we're moving to a W register.
-    if (rd.Is32Bits()) {
-      // Check that the top 32 bits are consistent.
-      DCHECK(((immediate >> kWRegSizeInBits) == 0) ||
-             ((immediate >> kWRegSizeInBits) == -1));
-      immediate &= kWRegMask;
-    }
-
-    DCHECK(rd.Is64Bits() || is_uint32(immediate));
-
-    // Special cases for all set or all clear immediates.
-    if (immediate == 0) {
-      switch (op) {
-        case AND:
-          Mov(rd, 0);
-          return;
-        case ORR:  // Fall through.
-        case EOR:
-          Mov(rd, rn);
-          return;
-        case ANDS:  // Fall through.
-        case BICS:
-          break;
-        default:
-          UNREACHABLE();
-      }
-    } else if ((rd.Is64Bits() && (immediate == -1L)) ||
-               (rd.Is32Bits() && (immediate == 0xFFFFFFFFL))) {
-      switch (op) {
-        case AND:
-          Mov(rd, rn);
-          return;
-        case ORR:
-          Mov(rd, immediate);
-          return;
-        case EOR:
-          Mvn(rd, rn);
-          return;
-        case ANDS:  // Fall through.
-        case BICS:
-          break;
-        default:
-          UNREACHABLE();
-      }
-    }
-
-    unsigned n, imm_s, imm_r;
-    if (IsImmLogical(immediate, reg_size, &n, &imm_s, &imm_r)) {
-      // Immediate can be encoded in the instruction.
-      LogicalImmediate(rd, rn, n, imm_s, imm_r, op);
-    } else {
-      // Immediate can't be encoded: synthesize using move immediate.
-      Register temp = temps.AcquireSameSizeAs(rn);
-
-      // If the left-hand input is the stack pointer, we can't pre-shift the
-      // immediate, as the encoding won't allow the subsequent post shift.
-      PreShiftImmMode mode = rn.Is(csp) ? kNoShift : kAnyShift;
-      Operand imm_operand = MoveImmediateForShiftedOp(temp, immediate, mode);
-
-      if (rd.Is(csp)) {
-        // If rd is the stack pointer we cannot use it as the destination
-        // register so we use the temp register as an intermediate again.
-        Logical(temp, rn, imm_operand, op);
-        Mov(csp, temp);
-        AssertStackConsistency();
-      } else {
-        Logical(rd, rn, imm_operand, op);
-      }
-    }
-
-  } else if (operand.IsExtendedRegister()) {
-    DCHECK(operand.reg().SizeInBits() <= rd.SizeInBits());
-    // Add/sub extended supports shift <= 4. We want to support exactly the
-    // same modes here.
-    DCHECK_LE(operand.shift_amount(), 4);
-    DCHECK(operand.reg().Is64Bits() ||
-           ((operand.extend() != UXTX) && (operand.extend() != SXTX)));
-    Register temp = temps.AcquireSameSizeAs(rn);
-    EmitExtendShift(temp, operand.reg(), operand.extend(),
-                    operand.shift_amount());
-    Logical(rd, rn, temp, op);
-
-  } else {
-    // The operand can be encoded in the instruction.
-    DCHECK(operand.IsShiftedRegister());
-    Logical(rd, rn, operand, op);
-  }
-}
-
-void TurboAssembler::Mov(const Register& rd, uint64_t imm) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(is_uint32(imm) || is_int32(imm) || rd.Is64Bits());
-  DCHECK(!rd.IsZero());
-
-  // TODO(all) extend to support more immediates.
-  //
-  // Immediates on Aarch64 can be produced using an initial value, and zero to
-  // three move keep operations.
-  //
-  // Initial values can be generated with:
-  //  1. 64-bit move zero (movz).
-  //  2. 32-bit move inverted (movn).
-  //  3. 64-bit move inverted.
-  //  4. 32-bit orr immediate.
-  //  5. 64-bit orr immediate.
-  // Move-keep may then be used to modify each of the 16-bit half-words.
-  //
-  // The code below supports all five initial value generators, and
-  // applying move-keep operations to move-zero and move-inverted initial
-  // values.
-
-  // Try to move the immediate in one instruction, and if that fails, switch to
-  // using multiple instructions.
-  if (!TryOneInstrMoveImmediate(rd, imm)) {
-    unsigned reg_size = rd.SizeInBits();
-
-    // Generic immediate case. Imm will be represented by
-    //   [imm3, imm2, imm1, imm0], where each imm is 16 bits.
-    // A move-zero or move-inverted is generated for the first non-zero or
-    // non-0xFFFF immX, and a move-keep for subsequent non-zero immX.
-
-    uint64_t ignored_halfword = 0;
-    bool invert_move = false;
-    // If the number of 0xFFFF halfwords is greater than the number of 0x0000
-    // halfwords, it's more efficient to use move-inverted.
-    if (CountClearHalfWords(~imm, reg_size) >
-        CountClearHalfWords(imm, reg_size)) {
-      ignored_halfword = 0xFFFFL;
-      invert_move = true;
-    }
-
-    // Mov instructions can't move immediate values into the stack pointer, so
-    // set up a temporary register, if needed.
-    UseScratchRegisterScope temps(this);
-    Register temp = rd.IsSP() ? temps.AcquireSameSizeAs(rd) : rd;
-
-    // Iterate through the halfwords. Use movn/movz for the first non-ignored
-    // halfword, and movk for subsequent halfwords.
-    DCHECK_EQ(reg_size % 16, 0);
-    bool first_mov_done = false;
-    for (int i = 0; i < (rd.SizeInBits() / 16); i++) {
-      uint64_t imm16 = (imm >> (16 * i)) & 0xFFFFL;
-      if (imm16 != ignored_halfword) {
-        if (!first_mov_done) {
-          if (invert_move) {
-            movn(temp, (~imm16) & 0xFFFFL, 16 * i);
-          } else {
-            movz(temp, imm16, 16 * i);
-          }
-          first_mov_done = true;
-        } else {
-          // Construct a wider constant.
-          movk(temp, imm16, 16 * i);
-        }
-      }
-    }
-    DCHECK(first_mov_done);
-
-    // Move the temporary if the original destination register was the stack
-    // pointer.
-    if (rd.IsSP()) {
-      mov(rd, temp);
-      AssertStackConsistency();
-    }
-  }
-}
-
-void TurboAssembler::Mov(const Register& rd, const Operand& operand,
-                         DiscardMoveMode discard_mode) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-
-  // Provide a swap register for instructions that need to write into the
-  // system stack pointer (and can't do this inherently).
-  UseScratchRegisterScope temps(this);
-  Register dst = (rd.IsSP()) ? temps.AcquireSameSizeAs(rd) : rd;
-
-  if (operand.NeedsRelocation(this)) {
-    Ldr(dst, operand);
-
-  } else if (operand.IsImmediate()) {
-    // Call the macro assembler for generic immediates.
-    Mov(dst, operand.ImmediateValue());
-
-  } else if (operand.IsShiftedRegister() && (operand.shift_amount() != 0)) {
-    // Emit a shift instruction if moving a shifted register. This operation
-    // could also be achieved using an orr instruction (like orn used by Mvn),
-    // but using a shift instruction makes the disassembly clearer.
-    EmitShift(dst, operand.reg(), operand.shift(), operand.shift_amount());
-
-  } else if (operand.IsExtendedRegister()) {
-    // Emit an extend instruction if moving an extended register. This handles
-    // extend with post-shift operations, too.
-    EmitExtendShift(dst, operand.reg(), operand.extend(),
-                    operand.shift_amount());
-
-  } else {
-    // Otherwise, emit a register move only if the registers are distinct, or
-    // if they are not X registers.
-    //
-    // Note that mov(w0, w0) is not a no-op because it clears the top word of
-    // x0. A flag is provided (kDiscardForSameWReg) if a move between the same W
-    // registers is not required to clear the top word of the X register. In
-    // this case, the instruction is discarded.
-    //
-    // If csp is an operand, add #0 is emitted, otherwise, orr #0.
-    if (!rd.Is(operand.reg()) || (rd.Is32Bits() &&
-                                  (discard_mode == kDontDiscardForSameWReg))) {
-      Assembler::mov(rd, operand.reg());
-    }
-    // This case can handle writes into the system stack pointer directly.
-    dst = rd;
-  }
-
-  // Copy the result to the system stack pointer.
-  if (!dst.Is(rd)) {
-    DCHECK(rd.IsSP());
-    Assembler::mov(rd, dst);
-  }
-}
-
-void TurboAssembler::Movi16bitHelper(const VRegister& vd, uint64_t imm) {
-  DCHECK(is_uint16(imm));
-  int byte1 = (imm & 0xFF);
-  int byte2 = ((imm >> 8) & 0xFF);
-  if (byte1 == byte2) {
-    movi(vd.Is64Bits() ? vd.V8B() : vd.V16B(), byte1);
-  } else if (byte1 == 0) {
-    movi(vd, byte2, LSL, 8);
-  } else if (byte2 == 0) {
-    movi(vd, byte1);
-  } else if (byte1 == 0xFF) {
-    mvni(vd, ~byte2 & 0xFF, LSL, 8);
-  } else if (byte2 == 0xFF) {
-    mvni(vd, ~byte1 & 0xFF);
-  } else {
-    UseScratchRegisterScope temps(this);
-    Register temp = temps.AcquireW();
-    movz(temp, imm);
-    dup(vd, temp);
-  }
-}
-
-void TurboAssembler::Movi32bitHelper(const VRegister& vd, uint64_t imm) {
-  DCHECK(is_uint32(imm));
-
-  uint8_t bytes[sizeof(imm)];
-  memcpy(bytes, &imm, sizeof(imm));
-
-  // All bytes are either 0x00 or 0xFF.
-  {
-    bool all0orff = true;
-    for (int i = 0; i < 4; ++i) {
-      if ((bytes[i] != 0) && (bytes[i] != 0xFF)) {
-        all0orff = false;
-        break;
-      }
-    }
-
-    if (all0orff == true) {
-      movi(vd.Is64Bits() ? vd.V1D() : vd.V2D(), ((imm << 32) | imm));
-      return;
-    }
-  }
-
-  // Of the 4 bytes, only one byte is non-zero.
-  for (int i = 0; i < 4; i++) {
-    if ((imm & (0xFF << (i * 8))) == imm) {
-      movi(vd, bytes[i], LSL, i * 8);
-      return;
-    }
-  }
-
-  // Of the 4 bytes, only one byte is not 0xFF.
-  for (int i = 0; i < 4; i++) {
-    uint32_t mask = ~(0xFF << (i * 8));
-    if ((imm & mask) == mask) {
-      mvni(vd, ~bytes[i] & 0xFF, LSL, i * 8);
-      return;
-    }
-  }
-
-  // Immediate is of the form 0x00MMFFFF.
-  if ((imm & 0xFF00FFFF) == 0x0000FFFF) {
-    movi(vd, bytes[2], MSL, 16);
-    return;
-  }
-
-  // Immediate is of the form 0x0000MMFF.
-  if ((imm & 0xFFFF00FF) == 0x000000FF) {
-    movi(vd, bytes[1], MSL, 8);
-    return;
-  }
-
-  // Immediate is of the form 0xFFMM0000.
-  if ((imm & 0xFF00FFFF) == 0xFF000000) {
-    mvni(vd, ~bytes[2] & 0xFF, MSL, 16);
-    return;
-  }
-  // Immediate is of the form 0xFFFFMM00.
-  if ((imm & 0xFFFF00FF) == 0xFFFF0000) {
-    mvni(vd, ~bytes[1] & 0xFF, MSL, 8);
-    return;
-  }
-
-  // Top and bottom 16-bits are equal.
-  if (((imm >> 16) & 0xFFFF) == (imm & 0xFFFF)) {
-    Movi16bitHelper(vd.Is64Bits() ? vd.V4H() : vd.V8H(), imm & 0xFFFF);
-    return;
-  }
-
-  // Default case.
-  {
-    UseScratchRegisterScope temps(this);
-    Register temp = temps.AcquireW();
-    Mov(temp, imm);
-    dup(vd, temp);
-  }
-}
-
-void TurboAssembler::Movi64bitHelper(const VRegister& vd, uint64_t imm) {
-  // All bytes are either 0x00 or 0xFF.
-  {
-    bool all0orff = true;
-    for (int i = 0; i < 8; ++i) {
-      int byteval = (imm >> (i * 8)) & 0xFF;
-      if (byteval != 0 && byteval != 0xFF) {
-        all0orff = false;
-        break;
-      }
-    }
-    if (all0orff == true) {
-      movi(vd, imm);
-      return;
-    }
-  }
-
-  // Top and bottom 32-bits are equal.
-  if (((imm >> 32) & 0xFFFFFFFF) == (imm & 0xFFFFFFFF)) {
-    Movi32bitHelper(vd.Is64Bits() ? vd.V2S() : vd.V4S(), imm & 0xFFFFFFFF);
-    return;
-  }
-
-  // Default case.
-  {
-    UseScratchRegisterScope temps(this);
-    Register temp = temps.AcquireX();
-    Mov(temp, imm);
-    if (vd.Is1D()) {
-      mov(vd.D(), 0, temp);
-    } else {
-      dup(vd.V2D(), temp);
-    }
-  }
-}
-
-void TurboAssembler::Movi(const VRegister& vd, uint64_t imm, Shift shift,
-                          int shift_amount) {
-  DCHECK(allow_macro_instructions());
-  if (shift_amount != 0 || shift != LSL) {
-    movi(vd, imm, shift, shift_amount);
-  } else if (vd.Is8B() || vd.Is16B()) {
-    // 8-bit immediate.
-    DCHECK(is_uint8(imm));
-    movi(vd, imm);
-  } else if (vd.Is4H() || vd.Is8H()) {
-    // 16-bit immediate.
-    Movi16bitHelper(vd, imm);
-  } else if (vd.Is2S() || vd.Is4S()) {
-    // 32-bit immediate.
-    Movi32bitHelper(vd, imm);
-  } else {
-    // 64-bit immediate.
-    Movi64bitHelper(vd, imm);
-  }
-}
-
-void TurboAssembler::Movi(const VRegister& vd, uint64_t hi, uint64_t lo) {
-  // TODO(all): Move 128-bit values in a more efficient way.
-  DCHECK(vd.Is128Bits());
-  UseScratchRegisterScope temps(this);
-  Movi(vd.V2D(), lo);
-  Register temp = temps.AcquireX();
-  Mov(temp, hi);
-  Ins(vd.V2D(), 1, temp);
-}
-
-void TurboAssembler::Mvn(const Register& rd, const Operand& operand) {
-  DCHECK(allow_macro_instructions());
-
-  if (operand.NeedsRelocation(this)) {
-    Ldr(rd, operand.immediate());
-    mvn(rd, rd);
-
-  } else if (operand.IsImmediate()) {
-    // Call the macro assembler for generic immediates.
-    Mov(rd, ~operand.ImmediateValue());
-
-  } else if (operand.IsExtendedRegister()) {
-    // Emit two instructions for the extend case. This differs from Mov, as
-    // the extend and invert can't be achieved in one instruction.
-    EmitExtendShift(rd, operand.reg(), operand.extend(),
-                    operand.shift_amount());
-    mvn(rd, rd);
-
-  } else {
-    mvn(rd, operand);
-  }
-}
-
-unsigned TurboAssembler::CountClearHalfWords(uint64_t imm, unsigned reg_size) {
-  DCHECK_EQ(reg_size % 8, 0);
-  int count = 0;
-  for (unsigned i = 0; i < (reg_size / 16); i++) {
-    if ((imm & 0xFFFF) == 0) {
-      count++;
-    }
-    imm >>= 16;
-  }
-  return count;
-}
-
-
-// The movz instruction can generate immediates containing an arbitrary 16-bit
-// half-word, with remaining bits clear, eg. 0x00001234, 0x0000123400000000.
-bool TurboAssembler::IsImmMovz(uint64_t imm, unsigned reg_size) {
-  DCHECK((reg_size == kXRegSizeInBits) || (reg_size == kWRegSizeInBits));
-  return CountClearHalfWords(imm, reg_size) >= ((reg_size / 16) - 1);
-}
-
-// The movn instruction can generate immediates containing an arbitrary 16-bit
-// half-word, with remaining bits set, eg. 0xFFFF1234, 0xFFFF1234FFFFFFFF.
-bool TurboAssembler::IsImmMovn(uint64_t imm, unsigned reg_size) {
-  return IsImmMovz(~imm, reg_size);
-}
-
-void TurboAssembler::ConditionalCompareMacro(const Register& rn,
-                                             const Operand& operand,
-                                             StatusFlags nzcv, Condition cond,
-                                             ConditionalCompareOp op) {
-  DCHECK((cond != al) && (cond != nv));
-  if (operand.NeedsRelocation(this)) {
-    UseScratchRegisterScope temps(this);
-    Register temp = temps.AcquireX();
-    Ldr(temp, operand.immediate());
-    ConditionalCompareMacro(rn, temp, nzcv, cond, op);
-
-  } else if ((operand.IsShiftedRegister() && (operand.shift_amount() == 0)) ||
-             (operand.IsImmediate() &&
-              IsImmConditionalCompare(operand.ImmediateValue()))) {
-    // The immediate can be encoded in the instruction, or the operand is an
-    // unshifted register: call the assembler.
-    ConditionalCompare(rn, operand, nzcv, cond, op);
-
-  } else {
-    // The operand isn't directly supported by the instruction: perform the
-    // operation on a temporary register.
-    UseScratchRegisterScope temps(this);
-    Register temp = temps.AcquireSameSizeAs(rn);
-    Mov(temp, operand);
-    ConditionalCompare(rn, temp, nzcv, cond, op);
-  }
-}
-
-
-void MacroAssembler::Csel(const Register& rd,
-                          const Register& rn,
-                          const Operand& operand,
-                          Condition cond) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-  DCHECK((cond != al) && (cond != nv));
-  if (operand.IsImmediate()) {
-    // Immediate argument. Handle special cases of 0, 1 and -1 using zero
-    // register.
-    int64_t imm = operand.ImmediateValue();
-    Register zr = AppropriateZeroRegFor(rn);
-    if (imm == 0) {
-      csel(rd, rn, zr, cond);
-    } else if (imm == 1) {
-      csinc(rd, rn, zr, cond);
-    } else if (imm == -1) {
-      csinv(rd, rn, zr, cond);
-    } else {
-      UseScratchRegisterScope temps(this);
-      Register temp = temps.AcquireSameSizeAs(rn);
-      Mov(temp, imm);
-      csel(rd, rn, temp, cond);
-    }
-  } else if (operand.IsShiftedRegister() && (operand.shift_amount() == 0)) {
-    // Unshifted register argument.
-    csel(rd, rn, operand.reg(), cond);
-  } else {
-    // All other arguments.
-    UseScratchRegisterScope temps(this);
-    Register temp = temps.AcquireSameSizeAs(rn);
-    Mov(temp, operand);
-    csel(rd, rn, temp, cond);
-  }
-}
-
-bool TurboAssembler::TryOneInstrMoveImmediate(const Register& dst,
-                                              int64_t imm) {
-  unsigned n, imm_s, imm_r;
-  int reg_size = dst.SizeInBits();
-  if (IsImmMovz(imm, reg_size) && !dst.IsSP()) {
-    // Immediate can be represented in a move zero instruction. Movz can't write
-    // to the stack pointer.
-    movz(dst, imm);
-    return true;
-  } else if (IsImmMovn(imm, reg_size) && !dst.IsSP()) {
-    // Immediate can be represented in a move not instruction. Movn can't write
-    // to the stack pointer.
-    movn(dst, dst.Is64Bits() ? ~imm : (~imm & kWRegMask));
-    return true;
-  } else if (IsImmLogical(imm, reg_size, &n, &imm_s, &imm_r)) {
-    // Immediate can be represented in a logical orr instruction.
-    LogicalImmediate(dst, AppropriateZeroRegFor(dst), n, imm_s, imm_r, ORR);
-    return true;
-  }
-  return false;
-}
-
-Operand TurboAssembler::MoveImmediateForShiftedOp(const Register& dst,
-                                                  int64_t imm,
-                                                  PreShiftImmMode mode) {
-  int reg_size = dst.SizeInBits();
-  // Encode the immediate in a single move instruction, if possible.
-  if (TryOneInstrMoveImmediate(dst, imm)) {
-    // The move was successful; nothing to do here.
-  } else {
-    // Pre-shift the immediate to the least-significant bits of the register.
-    int shift_low = CountTrailingZeros(imm, reg_size);
-    if (mode == kLimitShiftForSP) {
-      // When applied to the stack pointer, the subsequent arithmetic operation
-      // can use the extend form to shift left by a maximum of four bits. Right
-      // shifts are not allowed, so we filter them out later before the new
-      // immediate is tested.
-      shift_low = std::min(shift_low, 4);
-    }
-    int64_t imm_low = imm >> shift_low;
-
-    // Pre-shift the immediate to the most-significant bits of the register. We
-    // insert set bits in the least-significant bits, as this creates a
-    // different immediate that may be encodable using movn or orr-immediate.
-    // If this new immediate is encodable, the set bits will be eliminated by
-    // the post shift on the following instruction.
-    int shift_high = CountLeadingZeros(imm, reg_size);
-    int64_t imm_high = (imm << shift_high) | ((INT64_C(1) << shift_high) - 1);
-
-    if ((mode != kNoShift) && TryOneInstrMoveImmediate(dst, imm_low)) {
-      // The new immediate has been moved into the destination's low bits:
-      // return a new leftward-shifting operand.
-      return Operand(dst, LSL, shift_low);
-    } else if ((mode == kAnyShift) && TryOneInstrMoveImmediate(dst, imm_high)) {
-      // The new immediate has been moved into the destination's high bits:
-      // return a new rightward-shifting operand.
-      return Operand(dst, LSR, shift_high);
-    } else {
-      // Use the generic move operation to set up the immediate.
-      Mov(dst, imm);
-    }
-  }
-  return Operand(dst);
-}
-
-void TurboAssembler::AddSubMacro(const Register& rd, const Register& rn,
-                                 const Operand& operand, FlagsUpdate S,
-                                 AddSubOp op) {
-  if (operand.IsZero() && rd.Is(rn) && rd.Is64Bits() && rn.Is64Bits() &&
-      !operand.NeedsRelocation(this) && (S == LeaveFlags)) {
-    // The instruction would be a nop. Avoid generating useless code.
-    return;
-  }
-
-  if (operand.NeedsRelocation(this)) {
-    UseScratchRegisterScope temps(this);
-    Register temp = temps.AcquireX();
-    Ldr(temp, operand.immediate());
-    AddSubMacro(rd, rn, temp, S, op);
-  } else if ((operand.IsImmediate() &&
-              !IsImmAddSub(operand.ImmediateValue()))      ||
-             (rn.IsZero() && !operand.IsShiftedRegister()) ||
-             (operand.IsShiftedRegister() && (operand.shift() == ROR))) {
-    UseScratchRegisterScope temps(this);
-    Register temp = temps.AcquireSameSizeAs(rn);
-    if (operand.IsImmediate()) {
-      PreShiftImmMode mode = kAnyShift;
-
-      // If the destination or source register is the stack pointer, we can
-      // only pre-shift the immediate right by values supported in the add/sub
-      // extend encoding.
-      if (rd.Is(csp)) {
-        // If the destination is SP and flags will be set, we can't pre-shift
-        // the immediate at all.
-        mode = (S == SetFlags) ? kNoShift : kLimitShiftForSP;
-      } else if (rn.Is(csp)) {
-        mode = kLimitShiftForSP;
-      }
-
-      Operand imm_operand =
-          MoveImmediateForShiftedOp(temp, operand.ImmediateValue(), mode);
-      AddSub(rd, rn, imm_operand, S, op);
-    } else {
-      Mov(temp, operand);
-      AddSub(rd, rn, temp, S, op);
-    }
-  } else {
-    AddSub(rd, rn, operand, S, op);
-  }
-}
-
-void TurboAssembler::AddSubWithCarryMacro(const Register& rd,
-                                          const Register& rn,
-                                          const Operand& operand, FlagsUpdate S,
-                                          AddSubWithCarryOp op) {
-  DCHECK(rd.SizeInBits() == rn.SizeInBits());
-  UseScratchRegisterScope temps(this);
-
-  if (operand.NeedsRelocation(this)) {
-    Register temp = temps.AcquireX();
-    Ldr(temp, operand.immediate());
-    AddSubWithCarryMacro(rd, rn, temp, S, op);
-
-  } else if (operand.IsImmediate() ||
-             (operand.IsShiftedRegister() && (operand.shift() == ROR))) {
-    // Add/sub with carry (immediate or ROR shifted register.)
-    Register temp = temps.AcquireSameSizeAs(rn);
-    Mov(temp, operand);
-    AddSubWithCarry(rd, rn, temp, S, op);
-
-  } else if (operand.IsShiftedRegister() && (operand.shift_amount() != 0)) {
-    // Add/sub with carry (shifted register).
-    DCHECK(operand.reg().SizeInBits() == rd.SizeInBits());
-    DCHECK(operand.shift() != ROR);
-    DCHECK(is_uintn(operand.shift_amount(),
-          rd.SizeInBits() == kXRegSizeInBits ? kXRegSizeInBitsLog2
-                                             : kWRegSizeInBitsLog2));
-    Register temp = temps.AcquireSameSizeAs(rn);
-    EmitShift(temp, operand.reg(), operand.shift(), operand.shift_amount());
-    AddSubWithCarry(rd, rn, temp, S, op);
-
-  } else if (operand.IsExtendedRegister()) {
-    // Add/sub with carry (extended register).
-    DCHECK(operand.reg().SizeInBits() <= rd.SizeInBits());
-    // Add/sub extended supports a shift <= 4. We want to support exactly the
-    // same modes.
-    DCHECK_LE(operand.shift_amount(), 4);
-    DCHECK(operand.reg().Is64Bits() ||
-           ((operand.extend() != UXTX) && (operand.extend() != SXTX)));
-    Register temp = temps.AcquireSameSizeAs(rn);
-    EmitExtendShift(temp, operand.reg(), operand.extend(),
-                    operand.shift_amount());
-    AddSubWithCarry(rd, rn, temp, S, op);
-
-  } else {
-    // The addressing mode is directly supported by the instruction.
-    AddSubWithCarry(rd, rn, operand, S, op);
-  }
-}
-
-void TurboAssembler::LoadStoreMacro(const CPURegister& rt,
-                                    const MemOperand& addr, LoadStoreOp op) {
-  int64_t offset = addr.offset();
-  unsigned size = CalcLSDataSize(op);
-
-  // Check if an immediate offset fits in the immediate field of the
-  // appropriate instruction. If not, emit two instructions to perform
-  // the operation.
-  if (addr.IsImmediateOffset() && !IsImmLSScaled(offset, size) &&
-      !IsImmLSUnscaled(offset)) {
-    // Immediate offset that can't be encoded using unsigned or unscaled
-    // addressing modes.
-    UseScratchRegisterScope temps(this);
-    Register temp = temps.AcquireSameSizeAs(addr.base());
-    Mov(temp, addr.offset());
-    LoadStore(rt, MemOperand(addr.base(), temp), op);
-  } else if (addr.IsPostIndex() && !IsImmLSUnscaled(offset)) {
-    // Post-index beyond unscaled addressing range.
-    LoadStore(rt, MemOperand(addr.base()), op);
-    add(addr.base(), addr.base(), offset);
-  } else if (addr.IsPreIndex() && !IsImmLSUnscaled(offset)) {
-    // Pre-index beyond unscaled addressing range.
-    add(addr.base(), addr.base(), offset);
-    LoadStore(rt, MemOperand(addr.base()), op);
-  } else {
-    // Encodable in one load/store instruction.
-    LoadStore(rt, addr, op);
-  }
-}
-
-void TurboAssembler::LoadStorePairMacro(const CPURegister& rt,
-                                        const CPURegister& rt2,
-                                        const MemOperand& addr,
-                                        LoadStorePairOp op) {
-  // TODO(all): Should we support register offset for load-store-pair?
-  DCHECK(!addr.IsRegisterOffset());
-
-  int64_t offset = addr.offset();
-  unsigned size = CalcLSPairDataSize(op);
-
-  // Check if the offset fits in the immediate field of the appropriate
-  // instruction. If not, emit two instructions to perform the operation.
-  if (IsImmLSPair(offset, size)) {
-    // Encodable in one load/store pair instruction.
-    LoadStorePair(rt, rt2, addr, op);
-  } else {
-    Register base = addr.base();
-    if (addr.IsImmediateOffset()) {
-      UseScratchRegisterScope temps(this);
-      Register temp = temps.AcquireSameSizeAs(base);
-      Add(temp, base, offset);
-      LoadStorePair(rt, rt2, MemOperand(temp), op);
-    } else if (addr.IsPostIndex()) {
-      LoadStorePair(rt, rt2, MemOperand(base), op);
-      Add(base, base, offset);
-    } else {
-      DCHECK(addr.IsPreIndex());
-      Add(base, base, offset);
-      LoadStorePair(rt, rt2, MemOperand(base), op);
-    }
-  }
-}
-
-bool TurboAssembler::NeedExtraInstructionsOrRegisterBranch(
-    Label* label, ImmBranchType b_type) {
-  bool need_longer_range = false;
-  // There are two situations in which we care about the offset being out of
-  // range:
-  //  - The label is bound but too far away.
-  //  - The label is not bound but linked, and the previous branch
-  //    instruction in the chain is too far away.
-  if (label->is_bound() || label->is_linked()) {
-    need_longer_range =
-      !Instruction::IsValidImmPCOffset(b_type, label->pos() - pc_offset());
-  }
-  if (!need_longer_range && !label->is_bound()) {
-    int max_reachable_pc = pc_offset() + Instruction::ImmBranchRange(b_type);
-    unresolved_branches_.insert(
-        std::pair<int, FarBranchInfo>(max_reachable_pc,
-                                      FarBranchInfo(pc_offset(), label)));
-    // Also maintain the next pool check.
-    next_veneer_pool_check_ =
-      Min(next_veneer_pool_check_,
-          max_reachable_pc - kVeneerDistanceCheckMargin);
-  }
-  return need_longer_range;
-}
-
-void TurboAssembler::Adr(const Register& rd, Label* label, AdrHint hint) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(!rd.IsZero());
-
-  if (hint == kAdrNear) {
-    adr(rd, label);
-    return;
-  }
-
-  DCHECK_EQ(hint, kAdrFar);
-  if (label->is_bound()) {
-    int label_offset = label->pos() - pc_offset();
-    if (Instruction::IsValidPCRelOffset(label_offset)) {
-      adr(rd, label);
-    } else {
-      DCHECK_LE(label_offset, 0);
-      int min_adr_offset = -(1 << (Instruction::ImmPCRelRangeBitwidth - 1));
-      adr(rd, min_adr_offset);
-      Add(rd, rd, label_offset - min_adr_offset);
-    }
-  } else {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.AcquireX();
-
-    InstructionAccurateScope scope(
-        this, PatchingAssembler::kAdrFarPatchableNInstrs);
-    adr(rd, label);
-    for (int i = 0; i < PatchingAssembler::kAdrFarPatchableNNops; ++i) {
-      nop(ADR_FAR_NOP);
-    }
-    movz(scratch, 0);
-  }
-}
-
-void TurboAssembler::B(Label* label, BranchType type, Register reg, int bit) {
-  DCHECK((reg.Is(NoReg) || type >= kBranchTypeFirstUsingReg) &&
-         (bit == -1 || type >= kBranchTypeFirstUsingBit));
-  if (kBranchTypeFirstCondition <= type && type <= kBranchTypeLastCondition) {
-    B(static_cast<Condition>(type), label);
-  } else {
-    switch (type) {
-      case always:        B(label);              break;
-      case never:         break;
-      case reg_zero:      Cbz(reg, label);       break;
-      case reg_not_zero:  Cbnz(reg, label);      break;
-      case reg_bit_clear: Tbz(reg, bit, label);  break;
-      case reg_bit_set:   Tbnz(reg, bit, label); break;
-      default:
-        UNREACHABLE();
-    }
-  }
-}
-
-void TurboAssembler::B(Label* label, Condition cond) {
-  DCHECK(allow_macro_instructions());
-  DCHECK((cond != al) && (cond != nv));
-
-  Label done;
-  bool need_extra_instructions =
-    NeedExtraInstructionsOrRegisterBranch(label, CondBranchType);
-
-  if (need_extra_instructions) {
-    b(&done, NegateCondition(cond));
-    B(label);
-  } else {
-    b(label, cond);
-  }
-  bind(&done);
-}
-
-void TurboAssembler::Tbnz(const Register& rt, unsigned bit_pos, Label* label) {
-  DCHECK(allow_macro_instructions());
-
-  Label done;
-  bool need_extra_instructions =
-    NeedExtraInstructionsOrRegisterBranch(label, TestBranchType);
-
-  if (need_extra_instructions) {
-    tbz(rt, bit_pos, &done);
-    B(label);
-  } else {
-    tbnz(rt, bit_pos, label);
-  }
-  bind(&done);
-}
-
-void TurboAssembler::Tbz(const Register& rt, unsigned bit_pos, Label* label) {
-  DCHECK(allow_macro_instructions());
-
-  Label done;
-  bool need_extra_instructions =
-    NeedExtraInstructionsOrRegisterBranch(label, TestBranchType);
-
-  if (need_extra_instructions) {
-    tbnz(rt, bit_pos, &done);
-    B(label);
-  } else {
-    tbz(rt, bit_pos, label);
-  }
-  bind(&done);
-}
-
-void TurboAssembler::Cbnz(const Register& rt, Label* label) {
-  DCHECK(allow_macro_instructions());
-
-  Label done;
-  bool need_extra_instructions =
-    NeedExtraInstructionsOrRegisterBranch(label, CompareBranchType);
-
-  if (need_extra_instructions) {
-    cbz(rt, &done);
-    B(label);
-  } else {
-    cbnz(rt, label);
-  }
-  bind(&done);
-}
-
-void TurboAssembler::Cbz(const Register& rt, Label* label) {
-  DCHECK(allow_macro_instructions());
-
-  Label done;
-  bool need_extra_instructions =
-    NeedExtraInstructionsOrRegisterBranch(label, CompareBranchType);
-
-  if (need_extra_instructions) {
-    cbnz(rt, &done);
-    B(label);
-  } else {
-    cbz(rt, label);
-  }
-  bind(&done);
-}
-
-
-// Pseudo-instructions.
-
-void TurboAssembler::Abs(const Register& rd, const Register& rm,
-                         Label* is_not_representable, Label* is_representable) {
-  DCHECK(allow_macro_instructions());
-  DCHECK(AreSameSizeAndType(rd, rm));
-
-  Cmp(rm, 1);
-  Cneg(rd, rm, lt);
-
-  // If the comparison sets the v flag, the input was the smallest value
-  // representable by rm, and the mathematical result of abs(rm) is not
-  // representable using two's complement.
-  if ((is_not_representable != nullptr) && (is_representable != nullptr)) {
-    B(is_not_representable, vs);
-    B(is_representable);
-  } else if (is_not_representable != nullptr) {
-    B(is_not_representable, vs);
-  } else if (is_representable != nullptr) {
-    B(is_representable, vc);
-  }
-}
-
-
-// Abstracted stack operations.
-
-void TurboAssembler::Push(const CPURegister& src0, const CPURegister& src1,
-                          const CPURegister& src2, const CPURegister& src3) {
-  DCHECK(AreSameSizeAndType(src0, src1, src2, src3));
-
-  int count = 1 + src1.IsValid() + src2.IsValid() + src3.IsValid();
-  int size = src0.SizeInBytes();
-
-  PushPreamble(count, size);
-  PushHelper(count, size, src0, src1, src2, src3);
-}
-
-void TurboAssembler::Push(const CPURegister& src0, const CPURegister& src1,
-                          const CPURegister& src2, const CPURegister& src3,
-                          const CPURegister& src4, const CPURegister& src5,
-                          const CPURegister& src6, const CPURegister& src7) {
-  DCHECK(AreSameSizeAndType(src0, src1, src2, src3, src4, src5, src6, src7));
-
-  int count = 5 + src5.IsValid() + src6.IsValid() + src6.IsValid();
-  int size = src0.SizeInBytes();
-
-  PushPreamble(count, size);
-  PushHelper(4, size, src0, src1, src2, src3);
-  PushHelper(count - 4, size, src4, src5, src6, src7);
-}
-
-void TurboAssembler::Pop(const CPURegister& dst0, const CPURegister& dst1,
-                         const CPURegister& dst2, const CPURegister& dst3) {
-  // It is not valid to pop into the same register more than once in one
-  // instruction, not even into the zero register.
-  DCHECK(!AreAliased(dst0, dst1, dst2, dst3));
-  DCHECK(AreSameSizeAndType(dst0, dst1, dst2, dst3));
-  DCHECK(dst0.IsValid());
-
-  int count = 1 + dst1.IsValid() + dst2.IsValid() + dst3.IsValid();
-  int size = dst0.SizeInBytes();
-
-  PopHelper(count, size, dst0, dst1, dst2, dst3);
-  PopPostamble(count, size);
-}
-
-void TurboAssembler::Pop(const CPURegister& dst0, const CPURegister& dst1,
-                         const CPURegister& dst2, const CPURegister& dst3,
-                         const CPURegister& dst4, const CPURegister& dst5,
-                         const CPURegister& dst6, const CPURegister& dst7) {
-  // It is not valid to pop into the same register more than once in one
-  // instruction, not even into the zero register.
-  DCHECK(!AreAliased(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7));
-  DCHECK(AreSameSizeAndType(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7));
-  DCHECK(dst0.IsValid());
-
-  int count = 5 + dst5.IsValid() + dst6.IsValid() + dst7.IsValid();
-  int size = dst0.SizeInBytes();
-
-  PopHelper(4, size, dst0, dst1, dst2, dst3);
-  PopHelper(count - 4, size, dst4, dst5, dst6, dst7);
-  PopPostamble(count, size);
-}
-
-void TurboAssembler::Push(const Register& src0, const VRegister& src1) {
-  int size = src0.SizeInBytes() + src1.SizeInBytes();
-
-  PushPreamble(size);
-  // Reserve room for src0 and push src1.
-  str(src1, MemOperand(StackPointer(), -size, PreIndex));
-  // Fill the gap with src0.
-  str(src0, MemOperand(StackPointer(), src1.SizeInBytes()));
-}
-
-
-void MacroAssembler::PushPopQueue::PushQueued(
-    PreambleDirective preamble_directive) {
-  if (queued_.empty()) return;
-
-  if (preamble_directive == WITH_PREAMBLE) {
-    masm_->PushPreamble(size_);
-  }
-
-  size_t count = queued_.size();
-  size_t index = 0;
-  while (index < count) {
-    // PushHelper can only handle registers with the same size and type, and it
-    // can handle only four at a time. Batch them up accordingly.
-    CPURegister batch[4] = {NoReg, NoReg, NoReg, NoReg};
-    int batch_index = 0;
-    do {
-      batch[batch_index++] = queued_[index++];
-    } while ((batch_index < 4) && (index < count) &&
-             batch[0].IsSameSizeAndType(queued_[index]));
-
-    masm_->PushHelper(batch_index, batch[0].SizeInBytes(),
-                      batch[0], batch[1], batch[2], batch[3]);
-  }
-
-  queued_.clear();
-}
-
-
-void MacroAssembler::PushPopQueue::PopQueued() {
-  if (queued_.empty()) return;
-
-  size_t count = queued_.size();
-  size_t index = 0;
-  while (index < count) {
-    // PopHelper can only handle registers with the same size and type, and it
-    // can handle only four at a time. Batch them up accordingly.
-    CPURegister batch[4] = {NoReg, NoReg, NoReg, NoReg};
-    int batch_index = 0;
-    do {
-      batch[batch_index++] = queued_[index++];
-    } while ((batch_index < 4) && (index < count) &&
-             batch[0].IsSameSizeAndType(queued_[index]));
-
-    masm_->PopHelper(batch_index, batch[0].SizeInBytes(),
-                     batch[0], batch[1], batch[2], batch[3]);
-  }
-
-  masm_->PopPostamble(size_);
-  queued_.clear();
-}
-
-void TurboAssembler::PushCPURegList(CPURegList registers) {
-  int size = registers.RegisterSizeInBytes();
-
-  PushPreamble(registers.Count(), size);
-  // Push up to four registers at a time because if the current stack pointer is
-  // csp and reg_size is 32, registers must be pushed in blocks of four in order
-  // to maintain the 16-byte alignment for csp.
-  while (!registers.IsEmpty()) {
-    int count_before = registers.Count();
-    const CPURegister& src0 = registers.PopHighestIndex();
-    const CPURegister& src1 = registers.PopHighestIndex();
-    const CPURegister& src2 = registers.PopHighestIndex();
-    const CPURegister& src3 = registers.PopHighestIndex();
-    int count = count_before - registers.Count();
-    PushHelper(count, size, src0, src1, src2, src3);
-  }
-}
-
-void TurboAssembler::PopCPURegList(CPURegList registers) {
-  int size = registers.RegisterSizeInBytes();
-
-  // Pop up to four registers at a time because if the current stack pointer is
-  // csp and reg_size is 32, registers must be pushed in blocks of four in
-  // order to maintain the 16-byte alignment for csp.
-  while (!registers.IsEmpty()) {
-    int count_before = registers.Count();
-    const CPURegister& dst0 = registers.PopLowestIndex();
-    const CPURegister& dst1 = registers.PopLowestIndex();
-    const CPURegister& dst2 = registers.PopLowestIndex();
-    const CPURegister& dst3 = registers.PopLowestIndex();
-    int count = count_before - registers.Count();
-    PopHelper(count, size, dst0, dst1, dst2, dst3);
-  }
-  PopPostamble(registers.Count(), size);
-}
-
-void MacroAssembler::PushMultipleTimes(CPURegister src, Register count) {
-  PushPreamble(Operand(count, UXTW, WhichPowerOf2(src.SizeInBytes())));
-
-  UseScratchRegisterScope temps(this);
-  Register temp = temps.AcquireSameSizeAs(count);
-
-#if V8_OS_STARBOARD
-  // TODO: Investigate and fix the crash when using the following code.
-  if (false) {
-#else
-  if (FLAG_optimize_for_size) {
-#endif // V8_OS_STARBOARD
-    Label loop, done;
-
-    Subs(temp, count, 1);
-    B(mi, &done);
-
-    // Push all registers individually, to save code size.
-    Bind(&loop);
-    Subs(temp, temp, 1);
-    PushHelper(1, src.SizeInBytes(), src, NoReg, NoReg, NoReg);
-    B(pl, &loop);
-
-    Bind(&done);
-  } else {
-    Label loop, leftover2, leftover1, done;
-
-    Subs(temp, count, 4);
-    B(mi, &leftover2);
-
-    // Push groups of four first.
-    Bind(&loop);
-    Subs(temp, temp, 4);
-    PushHelper(4, src.SizeInBytes(), src, src, src, src);
-    B(pl, &loop);
-
-    // Push groups of two.
-    Bind(&leftover2);
-    Tbz(count, 1, &leftover1);
-    PushHelper(2, src.SizeInBytes(), src, src, NoReg, NoReg);
-
-    // Push the last one (if required).
-    Bind(&leftover1);
-    Tbz(count, 0, &done);
-    PushHelper(1, src.SizeInBytes(), src, NoReg, NoReg, NoReg);
-
-    Bind(&done);
-  }
-}
-
-void TurboAssembler::PushHelper(int count, int size, const CPURegister& src0,
-                                const CPURegister& src1,
-                                const CPURegister& src2,
-                                const CPURegister& src3) {
-  // Ensure that we don't unintentially modify scratch or debug registers.
-  InstructionAccurateScope scope(this);
-
-  DCHECK(AreSameSizeAndType(src0, src1, src2, src3));
-  DCHECK(size == src0.SizeInBytes());
-
-  // When pushing multiple registers, the store order is chosen such that
-  // Push(a, b) is equivalent to Push(a) followed by Push(b).
-  switch (count) {
-    case 1:
-      DCHECK(src1.IsNone() && src2.IsNone() && src3.IsNone());
-      str(src0, MemOperand(StackPointer(), -1 * size, PreIndex));
-      break;
-    case 2:
-      DCHECK(src2.IsNone() && src3.IsNone());
-      stp(src1, src0, MemOperand(StackPointer(), -2 * size, PreIndex));
-      break;
-    case 3:
-      DCHECK(src3.IsNone());
-      stp(src2, src1, MemOperand(StackPointer(), -3 * size, PreIndex));
-      str(src0, MemOperand(StackPointer(), 2 * size));
-      break;
-    case 4:
-      // Skip over 4 * size, then fill in the gap. This allows four W registers
-      // to be pushed using csp, whilst maintaining 16-byte alignment for csp
-      // at all times.
-      stp(src3, src2, MemOperand(StackPointer(), -4 * size, PreIndex));
-      stp(src1, src0, MemOperand(StackPointer(), 2 * size));
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void TurboAssembler::PopHelper(int count, int size, const CPURegister& dst0,
-                               const CPURegister& dst1, const CPURegister& dst2,
-                               const CPURegister& dst3) {
-  // Ensure that we don't unintentially modify scratch or debug registers.
-  InstructionAccurateScope scope(this);
-
-  DCHECK(AreSameSizeAndType(dst0, dst1, dst2, dst3));
-  DCHECK(size == dst0.SizeInBytes());
-
-  // When popping multiple registers, the load order is chosen such that
-  // Pop(a, b) is equivalent to Pop(a) followed by Pop(b).
-  switch (count) {
-    case 1:
-      DCHECK(dst1.IsNone() && dst2.IsNone() && dst3.IsNone());
-      ldr(dst0, MemOperand(StackPointer(), 1 * size, PostIndex));
-      break;
-    case 2:
-      DCHECK(dst2.IsNone() && dst3.IsNone());
-      ldp(dst0, dst1, MemOperand(StackPointer(), 2 * size, PostIndex));
-      break;
-    case 3:
-      DCHECK(dst3.IsNone());
-      ldr(dst2, MemOperand(StackPointer(), 2 * size));
-      ldp(dst0, dst1, MemOperand(StackPointer(), 3 * size, PostIndex));
-      break;
-    case 4:
-      // Load the higher addresses first, then load the lower addresses and
-      // skip the whole block in the second instruction. This allows four W
-      // registers to be popped using csp, whilst maintaining 16-byte alignment
-      // for csp at all times.
-      ldp(dst2, dst3, MemOperand(StackPointer(), 2 * size));
-      ldp(dst0, dst1, MemOperand(StackPointer(), 4 * size, PostIndex));
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void TurboAssembler::PushPreamble(Operand total_size) {
-  if (total_size.IsZero()) return;
-
-  if (csp.Is(StackPointer())) {
-    // If the current stack pointer is csp, then it must be aligned to 16 bytes
-    // on entry and the total size of the specified registers must also be a
-    // multiple of 16 bytes.
-    if (total_size.IsImmediate()) {
-      DCHECK_EQ(total_size.ImmediateValue() % 16, 0);
-    }
-
-    // Don't check access size for non-immediate sizes. It's difficult to do
-    // well, and it will be caught by hardware (or the simulator) anyway.
-  } else {
-    // Even if the current stack pointer is not the system stack pointer (csp),
-    // the system stack pointer will still be modified in order to comply with
-    // ABI rules about accessing memory below the system stack pointer.
-    BumpSystemStackPointer(total_size);
-  }
-}
-
-void TurboAssembler::PopPostamble(Operand total_size) {
-  if (total_size.IsZero()) return;
-
-  if (csp.Is(StackPointer())) {
-    // If the current stack pointer is csp, then it must be aligned to 16 bytes
-    // on entry and the total size of the specified registers must also be a
-    // multiple of 16 bytes.
-    if (total_size.IsImmediate()) {
-      DCHECK_EQ(total_size.ImmediateValue() % 16, 0);
-    }
-
-    // Don't check access size for non-immediate sizes. It's difficult to do
-    // well, and it will be caught by hardware (or the simulator) anyway.
-  } else if (emit_debug_code()) {
-    // It is safe to leave csp where it is when unwinding the JavaScript stack,
-    // but if we keep it matching StackPointer, the simulator can detect memory
-    // accesses in the now-free part of the stack.
-    SyncSystemStackPointer();
-  }
-}
-
-void TurboAssembler::PushPreamble(int count, int size) {
-  PushPreamble(count * size);
-}
-void TurboAssembler::PopPostamble(int count, int size) {
-  PopPostamble(count * size);
-}
-
-void TurboAssembler::Poke(const CPURegister& src, const Operand& offset) {
-  if (offset.IsImmediate()) {
-    DCHECK_GE(offset.ImmediateValue(), 0);
-  } else if (emit_debug_code()) {
-    Cmp(xzr, offset);
-    Check(le, AbortReason::kStackAccessBelowStackPointer);
-  }
-
-  Str(src, MemOperand(StackPointer(), offset));
-}
-
-
-void MacroAssembler::Peek(const CPURegister& dst, const Operand& offset) {
-  if (offset.IsImmediate()) {
-    DCHECK_GE(offset.ImmediateValue(), 0);
-  } else if (emit_debug_code()) {
-    Cmp(xzr, offset);
-    Check(le, AbortReason::kStackAccessBelowStackPointer);
-  }
-
-  Ldr(dst, MemOperand(StackPointer(), offset));
-}
-
-void TurboAssembler::PokePair(const CPURegister& src1, const CPURegister& src2,
-                              int offset) {
-  DCHECK(AreSameSizeAndType(src1, src2));
-  DCHECK((offset >= 0) && ((offset % src1.SizeInBytes()) == 0));
-  Stp(src1, src2, MemOperand(StackPointer(), offset));
-}
-
-
-void MacroAssembler::PeekPair(const CPURegister& dst1,
-                              const CPURegister& dst2,
-                              int offset) {
-  DCHECK(AreSameSizeAndType(dst1, dst2));
-  DCHECK((offset >= 0) && ((offset % dst1.SizeInBytes()) == 0));
-  Ldp(dst1, dst2, MemOperand(StackPointer(), offset));
-}
-
-
-void MacroAssembler::PushCalleeSavedRegisters() {
-  // Ensure that the macro-assembler doesn't use any scratch registers.
-  InstructionAccurateScope scope(this);
-
-  // This method must not be called unless the current stack pointer is the
-  // system stack pointer (csp).
-  DCHECK(csp.Is(StackPointer()));
-
-  MemOperand tos(csp, -2 * static_cast<int>(kXRegSize), PreIndex);
-
-  stp(d14, d15, tos);
-  stp(d12, d13, tos);
-  stp(d10, d11, tos);
-  stp(d8, d9, tos);
-
-  stp(x29, x30, tos);
-  stp(x27, x28, tos);
-  stp(x25, x26, tos);
-  stp(x23, x24, tos);
-  stp(x21, x22, tos);
-  stp(x19, x20, tos);
-}
-
-
-void MacroAssembler::PopCalleeSavedRegisters() {
-  // Ensure that the macro-assembler doesn't use any scratch registers.
-  InstructionAccurateScope scope(this);
-
-  // This method must not be called unless the current stack pointer is the
-  // system stack pointer (csp).
-  DCHECK(csp.Is(StackPointer()));
-
-  MemOperand tos(csp, 2 * kXRegSize, PostIndex);
-
-  ldp(x19, x20, tos);
-  ldp(x21, x22, tos);
-  ldp(x23, x24, tos);
-  ldp(x25, x26, tos);
-  ldp(x27, x28, tos);
-  ldp(x29, x30, tos);
-
-  ldp(d8, d9, tos);
-  ldp(d10, d11, tos);
-  ldp(d12, d13, tos);
-  ldp(d14, d15, tos);
-}
-
-void TurboAssembler::AssertStackConsistency() {
-  // Avoid emitting code when !use_real_abort() since non-real aborts cause too
-  // much code to be generated.
-  if (emit_debug_code() && use_real_aborts()) {
-    if (csp.Is(StackPointer())) {
-      // Always check the alignment of csp if ALWAYS_ALIGN_CSP is true.  We
-      // can't check the alignment of csp without using a scratch register (or
-      // clobbering the flags), but the processor (or simulator) will abort if
-      // it is not properly aligned during a load.
-      ldr(xzr, MemOperand(csp, 0));
-    }
-    if (FLAG_enable_slow_asserts && !csp.Is(StackPointer())) {
-      Label ok;
-      // Check that csp <= StackPointer(), preserving all registers and NZCV.
-      sub(StackPointer(), csp, StackPointer());
-      cbz(StackPointer(), &ok);                 // Ok if csp == StackPointer().
-      tbnz(StackPointer(), kXSignBit, &ok);     // Ok if csp < StackPointer().
-
-      // Avoid generating AssertStackConsistency checks for the Push in Abort.
-      { DontEmitDebugCodeScope dont_emit_debug_code_scope(this);
-        // Restore StackPointer().
-        sub(StackPointer(), csp, StackPointer());
-        Abort(AbortReason::kTheCurrentStackPointerIsBelowCsp);
-      }
-
-      bind(&ok);
-      // Restore StackPointer().
-      sub(StackPointer(), csp, StackPointer());
-    }
-  }
-}
-
-void TurboAssembler::AssertCspAligned() {
-  if (emit_debug_code() && use_real_aborts()) {
-    // TODO(titzer): use a real assert for alignment check?
-    UseScratchRegisterScope scope(this);
-    Register temp = scope.AcquireX();
-    ldr(temp, MemOperand(csp));
-  }
-}
-
-void TurboAssembler::CopySlots(int dst, Register src, Register slot_count) {
-  DCHECK(!src.IsZero());
-  UseScratchRegisterScope scope(this);
-  Register dst_reg = scope.AcquireX();
-  SlotAddress(dst_reg, dst);
-  SlotAddress(src, src);
-  CopyDoubleWords(dst_reg, src, slot_count);
-}
-
-void TurboAssembler::CopySlots(Register dst, Register src,
-                               Register slot_count) {
-  DCHECK(!dst.IsZero() && !src.IsZero());
-  SlotAddress(dst, dst);
-  SlotAddress(src, src);
-  CopyDoubleWords(dst, src, slot_count);
-}
-
-void TurboAssembler::CopyDoubleWords(Register dst, Register src, Register count,
-                                     CopyDoubleWordsMode mode) {
-  DCHECK(!AreAliased(dst, src, count));
-
-  if (emit_debug_code()) {
-    Register pointer1 = dst;
-    Register pointer2 = src;
-    if (mode == kSrcLessThanDst) {
-      pointer1 = src;
-      pointer2 = dst;
-    }
-    // Copy requires pointer1 < pointer2 || (pointer1 - pointer2) >= count.
-    Label pointer1_below_pointer2;
-    Subs(pointer1, pointer1, pointer2);
-    B(lt, &pointer1_below_pointer2);
-    Cmp(pointer1, count);
-    Check(ge, AbortReason::kOffsetOutOfRange);
-    Bind(&pointer1_below_pointer2);
-    Add(pointer1, pointer1, pointer2);
-  }
-  static_assert(kPointerSize == kDRegSize,
-                "pointers must be the same size as doubles");
-
-  int direction = (mode == kDstLessThanSrc) ? 1 : -1;
-  UseScratchRegisterScope scope(this);
-  VRegister temp0 = scope.AcquireD();
-  VRegister temp1 = scope.AcquireD();
-
-  Label pairs, loop, done;
-
-  Tbz(count, 0, &pairs);
-  Ldr(temp0, MemOperand(src, direction * kPointerSize, PostIndex));
-  Sub(count, count, 1);
-  Str(temp0, MemOperand(dst, direction * kPointerSize, PostIndex));
-
-  Bind(&pairs);
-  if (mode == kSrcLessThanDst) {
-    // Adjust pointers for post-index ldp/stp with negative offset:
-    Sub(dst, dst, kPointerSize);
-    Sub(src, src, kPointerSize);
-  }
-  Bind(&loop);
-  Cbz(count, &done);
-  Ldp(temp0, temp1, MemOperand(src, 2 * direction * kPointerSize, PostIndex));
-  Sub(count, count, 2);
-  Stp(temp0, temp1, MemOperand(dst, 2 * direction * kPointerSize, PostIndex));
-  B(&loop);
-
-  // TODO(all): large copies may benefit from using temporary Q registers
-  // to copy four double words per iteration.
-
-  Bind(&done);
-}
-
-void TurboAssembler::SlotAddress(Register dst, int slot_offset) {
-  Add(dst, StackPointer(), slot_offset << kPointerSizeLog2);
-}
-
-void TurboAssembler::SlotAddress(Register dst, Register slot_offset) {
-  Add(dst, StackPointer(), Operand(slot_offset, LSL, kPointerSizeLog2));
-}
-
-void TurboAssembler::AssertFPCRState(Register fpcr) {
-  if (emit_debug_code()) {
-    Label unexpected_mode, done;
-    UseScratchRegisterScope temps(this);
-    if (fpcr.IsNone()) {
-      fpcr = temps.AcquireX();
-      Mrs(fpcr, FPCR);
-    }
-
-    // Settings left to their default values:
-    //   - Assert that flush-to-zero is not set.
-    Tbnz(fpcr, FZ_offset, &unexpected_mode);
-    //   - Assert that the rounding mode is nearest-with-ties-to-even.
-    STATIC_ASSERT(FPTieEven == 0);
-    Tst(fpcr, RMode_mask);
-    B(eq, &done);
-
-    Bind(&unexpected_mode);
-    Abort(AbortReason::kUnexpectedFPCRMode);
-
-    Bind(&done);
-  }
-}
-
-void TurboAssembler::CanonicalizeNaN(const VRegister& dst,
-                                     const VRegister& src) {
-  AssertFPCRState();
-
-  // Subtracting 0.0 preserves all inputs except for signalling NaNs, which
-  // become quiet NaNs. We use fsub rather than fadd because fsub preserves -0.0
-  // inputs: -0.0 + 0.0 = 0.0, but -0.0 - 0.0 = -0.0.
-  Fsub(dst, src, fp_zero);
-}
-
-void TurboAssembler::LoadRoot(CPURegister destination,
-                              Heap::RootListIndex index) {
-  // TODO(jbramley): Most root values are constants, and can be synthesized
-  // without a load. Refer to the ARM back end for details.
-  Ldr(destination, MemOperand(root, index << kPointerSizeLog2));
-}
-
-
-void MacroAssembler::LoadObject(Register result, Handle<Object> object) {
-  AllowDeferredHandleDereference heap_object_check;
-  if (object->IsHeapObject()) {
-    Move(result, Handle<HeapObject>::cast(object));
-  } else {
-    Mov(result, Operand(Smi::cast(*object)));
-  }
-}
-
-void TurboAssembler::Move(Register dst, Register src) { Mov(dst, src); }
-void TurboAssembler::Move(Register dst, Handle<HeapObject> x) { Mov(dst, x); }
-void TurboAssembler::Move(Register dst, Smi* src) { Mov(dst, src); }
-
-void TurboAssembler::AssertSmi(Register object, AbortReason reason) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    Tst(object, kSmiTagMask);
-    Check(eq, reason);
-  }
-}
-
-void MacroAssembler::AssertNotSmi(Register object, AbortReason reason) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    Tst(object, kSmiTagMask);
-    Check(ne, reason);
-  }
-}
-
-void MacroAssembler::AssertFixedArray(Register object) {
-  if (emit_debug_code()) {
-    AssertNotSmi(object, AbortReason::kOperandIsASmiAndNotAFixedArray);
-
-    UseScratchRegisterScope temps(this);
-    Register temp = temps.AcquireX();
-
-    CompareObjectType(object, temp, temp, FIXED_ARRAY_TYPE);
-    Check(eq, AbortReason::kOperandIsNotAFixedArray);
-  }
-}
-
-void MacroAssembler::AssertFunction(Register object) {
-  if (emit_debug_code()) {
-    AssertNotSmi(object, AbortReason::kOperandIsASmiAndNotAFunction);
-
-    UseScratchRegisterScope temps(this);
-    Register temp = temps.AcquireX();
-
-    CompareObjectType(object, temp, temp, JS_FUNCTION_TYPE);
-    Check(eq, AbortReason::kOperandIsNotAFunction);
-  }
-}
-
-
-void MacroAssembler::AssertBoundFunction(Register object) {
-  if (emit_debug_code()) {
-    AssertNotSmi(object, AbortReason::kOperandIsASmiAndNotABoundFunction);
-
-    UseScratchRegisterScope temps(this);
-    Register temp = temps.AcquireX();
-
-    CompareObjectType(object, temp, temp, JS_BOUND_FUNCTION_TYPE);
-    Check(eq, AbortReason::kOperandIsNotABoundFunction);
-  }
-}
-
-void MacroAssembler::AssertGeneratorObject(Register object) {
-  if (!emit_debug_code()) return;
-  AssertNotSmi(object, AbortReason::kOperandIsASmiAndNotAGeneratorObject);
-
-  // Load map
-  UseScratchRegisterScope temps(this);
-  Register temp = temps.AcquireX();
-  Ldr(temp, FieldMemOperand(object, HeapObject::kMapOffset));
-
-  Label do_check;
-  // Load instance type and check if JSGeneratorObject
-  CompareInstanceType(temp, temp, JS_GENERATOR_OBJECT_TYPE);
-  B(eq, &do_check);
-
-  // Check if JSAsyncGeneratorObject
-  Cmp(temp, JS_ASYNC_GENERATOR_OBJECT_TYPE);
-
-  bind(&do_check);
-  // Restore generator object to register and perform assertion
-  Check(eq, AbortReason::kOperandIsNotAGeneratorObject);
-}
-
-void MacroAssembler::AssertUndefinedOrAllocationSite(Register object) {
-  if (emit_debug_code()) {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.AcquireX();
-    Label done_checking;
-    AssertNotSmi(object);
-    JumpIfRoot(object, Heap::kUndefinedValueRootIndex, &done_checking);
-    Ldr(scratch, FieldMemOperand(object, HeapObject::kMapOffset));
-    CompareRoot(scratch, Heap::kAllocationSiteMapRootIndex);
-    Assert(eq, AbortReason::kExpectedUndefinedOrCell);
-    Bind(&done_checking);
-  }
-}
-
-void TurboAssembler::AssertPositiveOrZero(Register value) {
-  if (emit_debug_code()) {
-    Label done;
-    int sign_bit = value.Is64Bits() ? kXSignBit : kWSignBit;
-    Tbz(value, sign_bit, &done);
-    Abort(AbortReason::kUnexpectedNegativeValue);
-    Bind(&done);
-  }
-}
-
-void TurboAssembler::CallStubDelayed(CodeStub* stub) {
-  DCHECK(AllowThisStubCall(stub));  // Stub calls are not allowed in some stubs.
-  BlockPoolsScope scope(this);
-#ifdef DEBUG
-  Label start_call;
-  Bind(&start_call);
-#endif
-  UseScratchRegisterScope temps(this);
-  Register temp = temps.AcquireX();
-  Ldr(temp, Operand::EmbeddedCode(stub));
-  Blr(temp);
-#ifdef DEBUG
-  AssertSizeOfCodeGeneratedSince(&start_call, kCallSizeWithRelocation);
-#endif
-}
-
-void MacroAssembler::CallStub(CodeStub* stub) {
-  DCHECK(AllowThisStubCall(stub));  // Stub calls are not allowed in some stubs.
-  Call(stub->GetCode(), RelocInfo::CODE_TARGET);
-}
-
-void MacroAssembler::TailCallStub(CodeStub* stub) {
-  Jump(stub->GetCode(), RelocInfo::CODE_TARGET);
-}
-
-void TurboAssembler::CallRuntimeDelayed(Zone* zone, Runtime::FunctionId fid,
-                                        SaveFPRegsMode save_doubles) {
-  const Runtime::Function* f = Runtime::FunctionForId(fid);
-  // TODO(1236192): Most runtime routines don't need the number of
-  // arguments passed in because it is constant. At some point we
-  // should remove this need and make the runtime routine entry code
-  // smarter.
-  Mov(x0, f->nargs);
-  Mov(x1, ExternalReference(f, isolate()));
-  CallStubDelayed(new (zone) CEntryStub(nullptr, 1, save_doubles));
-}
-
-void MacroAssembler::CallRuntime(const Runtime::Function* f,
-                                 int num_arguments,
-                                 SaveFPRegsMode save_doubles) {
-  // All arguments must be on the stack before this function is called.
-  // x0 holds the return value after the call.
-
-  // Check that the number of arguments matches what the function expects.
-  // If f->nargs is -1, the function can accept a variable number of arguments.
-  CHECK(f->nargs < 0 || f->nargs == num_arguments);
-
-  // Place the necessary arguments.
-  Mov(x0, num_arguments);
-  Mov(x1, ExternalReference(f, isolate()));
-
-  CEntryStub stub(isolate(), 1, save_doubles);
-  CallStub(&stub);
-}
-
-void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin,
-                                             bool builtin_exit_frame) {
-  Mov(x1, builtin);
-  CEntryStub stub(isolate(), 1, kDontSaveFPRegs, kArgvOnStack,
-                  builtin_exit_frame);
-  Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
-}
-
-void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid) {
-  const Runtime::Function* function = Runtime::FunctionForId(fid);
-  DCHECK_EQ(1, function->result_size);
-  if (function->nargs >= 0) {
-    // TODO(1236192): Most runtime routines don't need the number of
-    // arguments passed in because it is constant. At some point we
-    // should remove this need and make the runtime routine entry code
-    // smarter.
-    Mov(x0, function->nargs);
-  }
-  JumpToExternalReference(ExternalReference(fid, isolate()));
-}
-
-int TurboAssembler::ActivationFrameAlignment() {
-#if V8_HOST_ARCH_ARM64
-  // Running on the real platform. Use the alignment as mandated by the local
-  // environment.
-  // Note: This will break if we ever start generating snapshots on one ARM
-  // platform for another ARM platform with a different alignment.
-  return base::OS::ActivationFrameAlignment();
-#else  // V8_HOST_ARCH_ARM64
-  // If we are using the simulator then we should always align to the expected
-  // alignment. As the simulator is used to generate snapshots we do not know
-  // if the target platform will need alignment, so this is controlled from a
-  // flag.
-  return FLAG_sim_stack_alignment;
-#endif  // V8_HOST_ARCH_ARM64
-}
-
-void TurboAssembler::CallCFunction(ExternalReference function,
-                                   int num_of_reg_args) {
-  CallCFunction(function, num_of_reg_args, 0);
-}
-
-void TurboAssembler::CallCFunction(ExternalReference function,
-                                   int num_of_reg_args,
-                                   int num_of_double_args) {
-  UseScratchRegisterScope temps(this);
-  Register temp = temps.AcquireX();
-  Mov(temp, function);
-  CallCFunction(temp, num_of_reg_args, num_of_double_args);
-}
-
-static const int kRegisterPassedArguments = 8;
-
-void TurboAssembler::CallCFunction(Register function, int num_of_reg_args,
-                                   int num_of_double_args) {
-  DCHECK_LE(num_of_reg_args + num_of_double_args, kMaxCParameters);
-  DCHECK(has_frame());
-
-  // If we're passing doubles, we're limited to the following prototypes
-  // (defined by ExternalReference::Type):
-  //  BUILTIN_COMPARE_CALL:  int f(double, double)
-  //  BUILTIN_FP_FP_CALL:    double f(double, double)
-  //  BUILTIN_FP_CALL:       double f(double)
-  //  BUILTIN_FP_INT_CALL:   double f(double, int)
-  if (num_of_double_args > 0) {
-    DCHECK_LE(num_of_reg_args, 1);
-    DCHECK_LE(num_of_double_args + num_of_reg_args, 2);
-  }
-
-  // Call directly. The function called cannot cause a GC, or allow preemption,
-  // so the return address in the link register stays correct.
-  Call(function);
-
-  if (num_of_reg_args > kRegisterPassedArguments) {
-    // Drop the register passed arguments.
-    int claim_slots = RoundUp(num_of_reg_args - kRegisterPassedArguments, 2);
-    Drop(claim_slots);
-  }
-}
-
-void TurboAssembler::Jump(Register target) { Br(target); }
-
-void TurboAssembler::Jump(intptr_t target, RelocInfo::Mode rmode,
-                          Condition cond) {
-  if (cond == nv) return;
-  UseScratchRegisterScope temps(this);
-  Register temp = temps.AcquireX();
-  Label done;
-  if (cond != al) B(NegateCondition(cond), &done);
-  Mov(temp, Operand(target, rmode));
-  Br(temp);
-  Bind(&done);
-}
-
-void TurboAssembler::Jump(Address target, RelocInfo::Mode rmode,
-                          Condition cond) {
-  DCHECK(!RelocInfo::IsCodeTarget(rmode));
-  Jump(reinterpret_cast<intptr_t>(target), rmode, cond);
-}
-
-void TurboAssembler::Jump(Handle<Code> code, RelocInfo::Mode rmode,
-                          Condition cond) {
-  DCHECK(RelocInfo::IsCodeTarget(rmode));
-  Jump(reinterpret_cast<intptr_t>(code.address()), rmode, cond);
-}
-
-void TurboAssembler::Call(Register target) {
-  BlockPoolsScope scope(this);
-#ifdef DEBUG
-  Label start_call;
-  Bind(&start_call);
-#endif
-
-  Blr(target);
-
-#ifdef DEBUG
-  AssertSizeOfCodeGeneratedSince(&start_call, CallSize(target));
-#endif
-}
-
-void TurboAssembler::Call(Label* target) {
-  BlockPoolsScope scope(this);
-#ifdef DEBUG
-  Label start_call;
-  Bind(&start_call);
-#endif
-
-  Bl(target);
-
-#ifdef DEBUG
-  AssertSizeOfCodeGeneratedSince(&start_call, CallSize(target));
-#endif
-}
-
-// TurboAssembler::CallSize is sensitive to changes in this function, as it
-// requires to know how many instructions are used to branch to the target.
-void TurboAssembler::Call(Address target, RelocInfo::Mode rmode) {
-  BlockPoolsScope scope(this);
-#ifdef DEBUG
-  Label start_call;
-  Bind(&start_call);
-#endif
-
-  // Addresses always have 64 bits, so we shouldn't encounter NONE32.
-  DCHECK(rmode != RelocInfo::NONE32);
-
-  UseScratchRegisterScope temps(this);
-  Register temp = temps.AcquireX();
-
-  if (rmode == RelocInfo::NONE64) {
-    // Addresses are 48 bits so we never need to load the upper 16 bits.
-    uint64_t imm = reinterpret_cast<uint64_t>(target);
-    // If we don't use ARM tagged addresses, the 16 higher bits must be 0.
-    DCHECK_EQ((imm >> 48) & 0xFFFF, 0);
-    movz(temp, (imm >> 0) & 0xFFFF, 0);
-    movk(temp, (imm >> 16) & 0xFFFF, 16);
-    movk(temp, (imm >> 32) & 0xFFFF, 32);
-  } else {
-    Ldr(temp, Immediate(reinterpret_cast<intptr_t>(target), rmode));
-  }
-  Blr(temp);
-#ifdef DEBUG
-  AssertSizeOfCodeGeneratedSince(&start_call, CallSize(target, rmode));
-#endif
-}
-
-void TurboAssembler::Call(Handle<Code> code, RelocInfo::Mode rmode) {
-#ifdef DEBUG
-  Label start_call;
-  Bind(&start_call);
-#endif
-
-  Call(code.address(), rmode);
-
-#ifdef DEBUG
-  // Check the size of the code generated.
-  AssertSizeOfCodeGeneratedSince(&start_call, CallSize(code, rmode));
-#endif
-}
-
-void TurboAssembler::Call(ExternalReference target) {
-  UseScratchRegisterScope temps(this);
-  Register temp = temps.AcquireX();
-  // Immediate is in charge of setting the relocation mode to
-  // EXTERNAL_REFERENCE.
-  Ldr(temp, Immediate(target));
-  Call(temp);
-}
-
-void TurboAssembler::CallForDeoptimization(Address target,
-                                           RelocInfo::Mode rmode) {
-  DCHECK_EQ(rmode, RelocInfo::RUNTIME_ENTRY);
-
-  BlockPoolsScope scope(this);
-#ifdef DEBUG
-  Label start_call;
-  Bind(&start_call);
-#endif
-  UseScratchRegisterScope temps(this);
-  Register temp = temps.AcquireX();
-
-  // Deoptimisation table entries require the call address to be in x16, in
-  // order to compute the entry id.
-  DCHECK(temp.Is(x16));
-  Ldr(temp, Immediate(reinterpret_cast<intptr_t>(target), rmode));
-  Blr(temp);
-
-#ifdef DEBUG
-  AssertSizeOfCodeGeneratedSince(&start_call, CallSize(target, rmode));
-#endif
-}
-
-int TurboAssembler::CallSize(Register target) {
-  USE(target);
-  return kInstructionSize;
-}
-
-int TurboAssembler::CallSize(Label* target) {
-  USE(target);
-  return kInstructionSize;
-}
-
-int TurboAssembler::CallSize(Address target, RelocInfo::Mode rmode) {
-  USE(target);
-
-  // Addresses always have 64 bits, so we shouldn't encounter NONE32.
-  DCHECK(rmode != RelocInfo::NONE32);
-
-  if (rmode == RelocInfo::NONE64) {
-    return kCallSizeWithoutRelocation;
-  } else {
-    return kCallSizeWithRelocation;
-  }
-}
-
-int TurboAssembler::CallSize(Handle<Code> code, RelocInfo::Mode rmode) {
-  USE(code);
-
-  // Addresses always have 64 bits, so we shouldn't encounter NONE32.
-  DCHECK(rmode != RelocInfo::NONE32);
-
-  if (rmode == RelocInfo::NONE64) {
-    return kCallSizeWithoutRelocation;
-  } else {
-    return kCallSizeWithRelocation;
-  }
-}
-
-
-void MacroAssembler::JumpIfHeapNumber(Register object, Label* on_heap_number,
-                                      SmiCheckType smi_check_type) {
-  Label on_not_heap_number;
-
-  if (smi_check_type == DO_SMI_CHECK) {
-    JumpIfSmi(object, &on_not_heap_number);
-  }
-
-  AssertNotSmi(object);
-
-  UseScratchRegisterScope temps(this);
-  Register temp = temps.AcquireX();
-  Ldr(temp, FieldMemOperand(object, HeapObject::kMapOffset));
-  JumpIfRoot(temp, Heap::kHeapNumberMapRootIndex, on_heap_number);
-
-  Bind(&on_not_heap_number);
-}
-
-
-void MacroAssembler::JumpIfNotHeapNumber(Register object,
-                                         Label* on_not_heap_number,
-                                         SmiCheckType smi_check_type) {
-  if (smi_check_type == DO_SMI_CHECK) {
-    JumpIfSmi(object, on_not_heap_number);
-  }
-
-  AssertNotSmi(object);
-
-  UseScratchRegisterScope temps(this);
-  Register temp = temps.AcquireX();
-  Ldr(temp, FieldMemOperand(object, HeapObject::kMapOffset));
-  JumpIfNotRoot(temp, Heap::kHeapNumberMapRootIndex, on_not_heap_number);
-}
-
-void MacroAssembler::TryRepresentDoubleAsInt(Register as_int, VRegister value,
-                                             VRegister scratch_d,
-                                             Label* on_successful_conversion,
-                                             Label* on_failed_conversion) {
-  // Convert to an int and back again, then compare with the original value.
-  Fcvtzs(as_int, value);
-  Scvtf(scratch_d, as_int);
-  Fcmp(value, scratch_d);
-
-  if (on_successful_conversion) {
-    B(on_successful_conversion, eq);
-  }
-  if (on_failed_conversion) {
-    B(on_failed_conversion, ne);
-  }
-}
-
-void TurboAssembler::PrepareForTailCall(const ParameterCount& callee_args_count,
-                                        Register caller_args_count_reg,
-                                        Register scratch0, Register scratch1) {
-#if DEBUG
-  if (callee_args_count.is_reg()) {
-    DCHECK(!AreAliased(callee_args_count.reg(), caller_args_count_reg, scratch0,
-                       scratch1));
-  } else {
-    DCHECK(!AreAliased(caller_args_count_reg, scratch0, scratch1));
-  }
-#endif
-
-  // Calculate the end of destination area where we will put the arguments
-  // after we drop current frame. We add kPointerSize to count the receiver
-  // argument which is not included into formal parameters count.
-  Register dst_reg = scratch0;
-  Add(dst_reg, fp, Operand(caller_args_count_reg, LSL, kPointerSizeLog2));
-  Add(dst_reg, dst_reg, StandardFrameConstants::kCallerSPOffset + kPointerSize);
-  // Round dst_reg up to a multiple of 16 bytes, so that we overwrite any
-  // potential padding.
-  Add(dst_reg, dst_reg, 15);
-  Bic(dst_reg, dst_reg, 15);
-
-  Register src_reg = caller_args_count_reg;
-  // Calculate the end of source area. +kPointerSize is for the receiver.
-  if (callee_args_count.is_reg()) {
-    Add(src_reg, StackPointer(),
-        Operand(callee_args_count.reg(), LSL, kPointerSizeLog2));
-    Add(src_reg, src_reg, kPointerSize);
-  } else {
-    Add(src_reg, StackPointer(),
-        (callee_args_count.immediate() + 1) * kPointerSize);
-  }
-
-  // Round src_reg up to a multiple of 16 bytes, so we include any potential
-  // padding in the copy.
-  Add(src_reg, src_reg, 15);
-  Bic(src_reg, src_reg, 15);
-
-  if (FLAG_debug_code) {
-    Cmp(src_reg, dst_reg);
-    Check(lo, AbortReason::kStackAccessBelowStackPointer);
-  }
-
-  // Restore caller's frame pointer and return address now as they will be
-  // overwritten by the copying loop.
-  Ldr(lr, MemOperand(fp, StandardFrameConstants::kCallerPCOffset));
-  Ldr(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
-
-  // Now copy callee arguments to the caller frame going backwards to avoid
-  // callee arguments corruption (source and destination areas could overlap).
-
-  // Both src_reg and dst_reg are pointing to the word after the one to copy,
-  // so they must be pre-decremented in the loop.
-  Register tmp_reg = scratch1;
-  Label loop, entry;
-  B(&entry);
-  bind(&loop);
-  Ldr(tmp_reg, MemOperand(src_reg, -kPointerSize, PreIndex));
-  Str(tmp_reg, MemOperand(dst_reg, -kPointerSize, PreIndex));
-  bind(&entry);
-  Cmp(StackPointer(), src_reg);
-  B(ne, &loop);
-
-  // Leave current frame.
-  Mov(StackPointer(), dst_reg);
-  AssertStackConsistency();
-}
-
-void MacroAssembler::InvokePrologue(const ParameterCount& expected,
-                                    const ParameterCount& actual, Label* done,
-                                    InvokeFlag flag,
-                                    bool* definitely_mismatches) {
-  bool definitely_matches = false;
-  *definitely_mismatches = false;
-  Label regular_invoke;
-
-  // Check whether the expected and actual arguments count match. If not,
-  // setup registers according to contract with ArgumentsAdaptorTrampoline:
-  //  x0: actual arguments count.
-  //  x1: function (passed through to callee).
-  //  x2: expected arguments count.
-
-  // The code below is made a lot easier because the calling code already sets
-  // up actual and expected registers according to the contract if values are
-  // passed in registers.
-  DCHECK(actual.is_immediate() || actual.reg().is(x0));
-  DCHECK(expected.is_immediate() || expected.reg().is(x2));
-
-  if (expected.is_immediate()) {
-    DCHECK(actual.is_immediate());
-    Mov(x0, actual.immediate());
-    if (expected.immediate() == actual.immediate()) {
-      definitely_matches = true;
-
-    } else {
-      if (expected.immediate() ==
-          SharedFunctionInfo::kDontAdaptArgumentsSentinel) {
-        // Don't worry about adapting arguments for builtins that
-        // don't want that done. Skip adaption code by making it look
-        // like we have a match between expected and actual number of
-        // arguments.
-        definitely_matches = true;
-      } else {
-        *definitely_mismatches = true;
-        // Set up x2 for the argument adaptor.
-        Mov(x2, expected.immediate());
-      }
-    }
-
-  } else {  // expected is a register.
-    Operand actual_op = actual.is_immediate() ? Operand(actual.immediate())
-                                              : Operand(actual.reg());
-    Mov(x0, actual_op);
-    // If actual == expected perform a regular invocation.
-    Cmp(expected.reg(), actual_op);
-    B(eq, &regular_invoke);
-  }
-
-  // If the argument counts may mismatch, generate a call to the argument
-  // adaptor.
-  if (!definitely_matches) {
-    Handle<Code> adaptor = BUILTIN_CODE(isolate(), ArgumentsAdaptorTrampoline);
-    if (flag == CALL_FUNCTION) {
-      Call(adaptor);
-      if (!*definitely_mismatches) {
-        // If the arg counts don't match, no extra code is emitted by
-        // MAsm::InvokeFunctionCode and we can just fall through.
-        B(done);
-      }
-    } else {
-      Jump(adaptor, RelocInfo::CODE_TARGET);
-    }
-  }
-  Bind(&regular_invoke);
-}
-
-void MacroAssembler::CheckDebugHook(Register fun, Register new_target,
-                                    const ParameterCount& expected,
-                                    const ParameterCount& actual) {
-  Label skip_hook;
-  ExternalReference debug_hook_active =
-      ExternalReference::debug_hook_on_function_call_address(isolate());
-  Mov(x4, Operand(debug_hook_active));
-  Ldrsb(x4, MemOperand(x4));
-  Cbz(x4, &skip_hook);
-  {
-    FrameScope frame(this,
-                     has_frame() ? StackFrame::NONE : StackFrame::INTERNAL);
-
-    Register expected_reg = padreg;
-    Register actual_reg = padreg;
-    if (expected.is_reg()) expected_reg = expected.reg();
-    if (actual.is_reg()) actual_reg = actual.reg();
-    if (!new_target.is_valid()) new_target = padreg;
-
-    // Save values on stack.
-    SmiTag(expected_reg);
-    SmiTag(actual_reg);
-    Push(expected_reg, actual_reg, new_target, fun);
-
-    PushArgument(fun);
-    CallRuntime(Runtime::kDebugOnFunctionCall);
-
-    // Restore values from stack.
-    Pop(fun, new_target, actual_reg, expected_reg);
-    SmiUntag(actual_reg);
-    SmiUntag(expected_reg);
-  }
-  Bind(&skip_hook);
-}
-
-void MacroAssembler::InvokeFunctionCode(Register function, Register new_target,
-                                        const ParameterCount& expected,
-                                        const ParameterCount& actual,
-                                        InvokeFlag flag) {
-  // You can't call a function without a valid frame.
-  DCHECK(flag == JUMP_FUNCTION || has_frame());
-  DCHECK(function.is(x1));
-  DCHECK_IMPLIES(new_target.is_valid(), new_target.is(x3));
-
-  // On function call, call into the debugger if necessary.
-  CheckDebugHook(function, new_target, expected, actual);
-
-  // Clear the new.target register if not given.
-  if (!new_target.is_valid()) {
-    LoadRoot(x3, Heap::kUndefinedValueRootIndex);
-  }
-
-  Label done;
-  bool definitely_mismatches = false;
-  InvokePrologue(expected, actual, &done, flag, &definitely_mismatches);
-
-  // If we are certain that actual != expected, then we know InvokePrologue will
-  // have handled the call through the argument adaptor mechanism.
-  // The called function expects the call kind in x5.
-  if (!definitely_mismatches) {
-    // We call indirectly through the code field in the function to
-    // allow recompilation to take effect without changing any of the
-    // call sites.
-    Register code = x4;
-    Ldr(code, FieldMemOperand(function, JSFunction::kCodeOffset));
-    Add(code, code, Operand(Code::kHeaderSize - kHeapObjectTag));
-    if (flag == CALL_FUNCTION) {
-      Call(code);
-    } else {
-      DCHECK(flag == JUMP_FUNCTION);
-      Jump(code);
-    }
-  }
-
-  // Continue here if InvokePrologue does handle the invocation due to
-  // mismatched parameter counts.
-  Bind(&done);
-}
-
-void MacroAssembler::InvokeFunction(Register function, Register new_target,
-                                    const ParameterCount& actual,
-                                    InvokeFlag flag) {
-  // You can't call a function without a valid frame.
-  DCHECK(flag == JUMP_FUNCTION || has_frame());
-
-  // Contract with called JS functions requires that function is passed in x1.
-  // (See FullCodeGenerator::Generate().)
-  DCHECK(function.is(x1));
-
-  Register expected_reg = x2;
-
-  Ldr(cp, FieldMemOperand(function, JSFunction::kContextOffset));
-  // The number of arguments is stored as an int32_t, and -1 is a marker
-  // (SharedFunctionInfo::kDontAdaptArgumentsSentinel), so we need sign
-  // extension to correctly handle it.
-  Ldr(expected_reg, FieldMemOperand(function,
-                                    JSFunction::kSharedFunctionInfoOffset));
-  Ldrsw(expected_reg,
-        FieldMemOperand(expected_reg,
-                        SharedFunctionInfo::kFormalParameterCountOffset));
-
-  ParameterCount expected(expected_reg);
-  InvokeFunctionCode(function, new_target, expected, actual, flag);
-}
-
-void MacroAssembler::InvokeFunction(Register function,
-                                    const ParameterCount& expected,
-                                    const ParameterCount& actual,
-                                    InvokeFlag flag) {
-  // You can't call a function without a valid frame.
-  DCHECK(flag == JUMP_FUNCTION || has_frame());
-
-  // Contract with called JS functions requires that function is passed in x1.
-  // (See FullCodeGenerator::Generate().)
-  DCHECK(function.Is(x1));
-
-  // Set up the context.
-  Ldr(cp, FieldMemOperand(function, JSFunction::kContextOffset));
-
-  InvokeFunctionCode(function, no_reg, expected, actual, flag);
-}
-
-void MacroAssembler::InvokeFunction(Handle<JSFunction> function,
-                                    const ParameterCount& expected,
-                                    const ParameterCount& actual,
-                                    InvokeFlag flag) {
-  // Contract with called JS functions requires that function is passed in x1.
-  // (See FullCodeGenerator::Generate().)
-  LoadObject(x1, function);
-  InvokeFunction(x1, expected, actual, flag);
-}
-
-void TurboAssembler::TryConvertDoubleToInt64(Register result,
-                                             DoubleRegister double_input,
-                                             Label* done) {
-  // Try to convert with an FPU convert instruction. It's trivial to compute
-  // the modulo operation on an integer register so we convert to a 64-bit
-  // integer.
-  //
-  // Fcvtzs will saturate to INT64_MIN (0x800...00) or INT64_MAX (0x7FF...FF)
-  // when the double is out of range. NaNs and infinities will be converted to 0
-  // (as ECMA-262 requires).
-  Fcvtzs(result.X(), double_input);
-
-  // The values INT64_MIN (0x800...00) or INT64_MAX (0x7FF...FF) are not
-  // representable using a double, so if the result is one of those then we know
-  // that saturation occurred, and we need to manually handle the conversion.
-  //
-  // It is easy to detect INT64_MIN and INT64_MAX because adding or subtracting
-  // 1 will cause signed overflow.
-  Cmp(result.X(), 1);
-  Ccmp(result.X(), -1, VFlag, vc);
-
-  B(vc, done);
-}
-
-void TurboAssembler::TruncateDoubleToIDelayed(Zone* zone, Register result,
-                                              DoubleRegister double_input) {
-  Label done;
-
-  // Try to convert the double to an int64. If successful, the bottom 32 bits
-  // contain our truncated int32 result.
-  TryConvertDoubleToInt64(result, double_input, &done);
-
-  // If we fell through then inline version didn't succeed - call stub instead.
-  Push(lr, double_input);
-
-  auto stub = new (zone) DoubleToIStub(nullptr, result);
-  // DoubleToIStub preserves any registers it needs to clobber.
-  CallStubDelayed(stub);
-
-  DCHECK_EQ(xzr.SizeInBytes(), double_input.SizeInBytes());
-  Pop(xzr, lr);  // xzr to drop the double input on the stack.
-
-  Bind(&done);
-  // Keep our invariant that the upper 32 bits are zero.
-  Uxtw(result.W(), result.W());
-}
-
-void TurboAssembler::Prologue() {
-  Push(lr, fp, cp, x1);
-  Add(fp, StackPointer(), StandardFrameConstants::kFixedFrameSizeFromFp);
-}
-
-void TurboAssembler::EnterFrame(StackFrame::Type type) {
-  UseScratchRegisterScope temps(this);
-  Register type_reg = temps.AcquireX();
-  Register code_reg = temps.AcquireX();
-
-  if (type == StackFrame::INTERNAL) {
-    Mov(type_reg, StackFrame::TypeToMarker(type));
-    Mov(code_reg, Operand(CodeObject()));
-    Push(lr, fp, type_reg, code_reg);
-    Add(fp, StackPointer(), InternalFrameConstants::kFixedFrameSizeFromFp);
-    // sp[4] : lr
-    // sp[3] : fp
-    // sp[1] : type
-    // sp[0] : [code object]
-  } else if (type == StackFrame::WASM_COMPILED) {
-    DCHECK(csp.Is(StackPointer()));
-    Mov(type_reg, StackFrame::TypeToMarker(type));
-    Push(lr, fp);
-    Mov(fp, csp);
-    Push(type_reg, padreg);
-    // csp[3] : lr
-    // csp[2] : fp
-    // csp[1] : type
-    // csp[0] : for alignment
-  } else {
-    DCHECK_EQ(type, StackFrame::CONSTRUCT);
-    Mov(type_reg, StackFrame::TypeToMarker(type));
-
-    // Users of this frame type push a context pointer after the type field,
-    // so do it here to keep the stack pointer aligned.
-    Push(lr, fp, type_reg, cp);
-
-    // The context pointer isn't part of the fixed frame, so add an extra slot
-    // to account for it.
-    Add(fp, StackPointer(),
-        TypedFrameConstants::kFixedFrameSizeFromFp + kPointerSize);
-    // sp[3] : lr
-    // sp[2] : fp
-    // sp[1] : type
-    // sp[0] : cp
-  }
-}
-
-void TurboAssembler::LeaveFrame(StackFrame::Type type) {
-  if (type == StackFrame::WASM_COMPILED) {
-    DCHECK(csp.Is(StackPointer()));
-    Mov(csp, fp);
-    AssertStackConsistency();
-    Pop(fp, lr);
-  } else {
-    // Drop the execution stack down to the frame pointer and restore
-    // the caller frame pointer and return address.
-    Mov(StackPointer(), fp);
-    AssertStackConsistency();
-    Pop(fp, lr);
-  }
-}
-
-
-void MacroAssembler::ExitFramePreserveFPRegs() {
-  DCHECK_EQ(kCallerSavedV.Count() % 2, 0);
-  PushCPURegList(kCallerSavedV);
-}
-
-
-void MacroAssembler::ExitFrameRestoreFPRegs() {
-  // Read the registers from the stack without popping them. The stack pointer
-  // will be reset as part of the unwinding process.
-  CPURegList saved_fp_regs = kCallerSavedV;
-  DCHECK_EQ(saved_fp_regs.Count() % 2, 0);
-
-  int offset = ExitFrameConstants::kLastExitFrameField;
-  while (!saved_fp_regs.IsEmpty()) {
-    const CPURegister& dst0 = saved_fp_regs.PopHighestIndex();
-    const CPURegister& dst1 = saved_fp_regs.PopHighestIndex();
-    offset -= 2 * kDRegSize;
-    Ldp(dst1, dst0, MemOperand(fp, offset));
-  }
-}
-
-void MacroAssembler::EnterExitFrame(bool save_doubles, const Register& scratch,
-                                    int extra_space,
-                                    StackFrame::Type frame_type) {
-  DCHECK(frame_type == StackFrame::EXIT ||
-         frame_type == StackFrame::BUILTIN_EXIT);
-
-  // Set up the new stack frame.
-  Push(lr, fp);
-  Mov(fp, StackPointer());
-  Mov(scratch, StackFrame::TypeToMarker(frame_type));
-  Push(scratch, xzr);
-  Mov(scratch, Operand(CodeObject()));
-  Push(scratch, padreg);
-  //          fp[8]: CallerPC (lr)
-  //    fp -> fp[0]: CallerFP (old fp)
-  //          fp[-8]: STUB marker
-  //          fp[-16]: Space reserved for SPOffset.
-  //          fp[-24]: CodeObject()
-  //    sp -> fp[-32]: padding
-  STATIC_ASSERT((2 * kPointerSize) == ExitFrameConstants::kCallerSPOffset);
-  STATIC_ASSERT((1 * kPointerSize) == ExitFrameConstants::kCallerPCOffset);
-  STATIC_ASSERT((0 * kPointerSize) == ExitFrameConstants::kCallerFPOffset);
-  STATIC_ASSERT((-2 * kPointerSize) == ExitFrameConstants::kSPOffset);
-  STATIC_ASSERT((-3 * kPointerSize) == ExitFrameConstants::kCodeOffset);
-  STATIC_ASSERT((-4 * kPointerSize) == ExitFrameConstants::kPaddingOffset);
-
-  // Save the frame pointer and context pointer in the top frame.
-  Mov(scratch, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress,
-                                         isolate())));
-  Str(fp, MemOperand(scratch));
-  Mov(scratch,
-      Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate())));
-  Str(cp, MemOperand(scratch));
-
-  STATIC_ASSERT((-4 * kPointerSize) == ExitFrameConstants::kLastExitFrameField);
-  if (save_doubles) {
-    ExitFramePreserveFPRegs();
-  }
-
-  // Round the number of space we need to claim to a multiple of two.
-  int slots_to_claim = RoundUp(extra_space + 1, 2);
-
-  // Reserve space for the return address and for user requested memory.
-  // We do this before aligning to make sure that we end up correctly
-  // aligned with the minimum of wasted space.
-  Claim(slots_to_claim, kXRegSize);
-  //         fp[8]: CallerPC (lr)
-  //   fp -> fp[0]: CallerFP (old fp)
-  //         fp[-8]: STUB marker
-  //         fp[-16]: Space reserved for SPOffset.
-  //         fp[-24]: CodeObject()
-  //         fp[-24 - fp_size]: Saved doubles (if save_doubles is true).
-  //         sp[8]: Extra space reserved for caller (if extra_space != 0).
-  //   sp -> sp[0]: Space reserved for the return address.
-
-  DCHECK(csp.Is(StackPointer()));
-
-  // ExitFrame::GetStateForFramePointer expects to find the return address at
-  // the memory address immediately below the pointer stored in SPOffset.
-  // It is not safe to derive much else from SPOffset, because the size of the
-  // padding can vary.
-  Add(scratch, csp, kXRegSize);
-  Str(scratch, MemOperand(fp, ExitFrameConstants::kSPOffset));
-}
-
-
-// Leave the current exit frame.
-void MacroAssembler::LeaveExitFrame(bool restore_doubles,
-                                    const Register& scratch,
-                                    const Register& scratch2) {
-  DCHECK(csp.Is(StackPointer()));
-
-  if (restore_doubles) {
-    ExitFrameRestoreFPRegs();
-  }
-
-  // Restore the context pointer from the top frame.
-  Mov(scratch,
-      Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate())));
-  Ldr(cp, MemOperand(scratch));
-
-  if (emit_debug_code()) {
-    // Also emit debug code to clear the cp in the top frame.
-    Mov(scratch2, Operand(Context::kInvalidContext));
-    Mov(scratch, Operand(ExternalReference(IsolateAddressId::kContextAddress,
-                                           isolate())));
-    Str(scratch2, MemOperand(scratch));
-  }
-  // Clear the frame pointer from the top frame.
-  Mov(scratch, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress,
-                                         isolate())));
-  Str(xzr, MemOperand(scratch));
-
-  // Pop the exit frame.
-  //         fp[8]: CallerPC (lr)
-  //   fp -> fp[0]: CallerFP (old fp)
-  //         fp[...]: The rest of the frame.
-  Mov(csp, fp);
-  AssertStackConsistency();
-  Pop(fp, lr);
-}
-
-
-void MacroAssembler::IncrementCounter(StatsCounter* counter, int value,
-                                      Register scratch1, Register scratch2) {
-  DCHECK_NE(value, 0);
-  if (FLAG_native_code_counters && counter->Enabled()) {
-    Mov(scratch2, ExternalReference(counter));
-    Ldr(scratch1.W(), MemOperand(scratch2));
-    Add(scratch1.W(), scratch1.W(), value);
-    Str(scratch1.W(), MemOperand(scratch2));
-  }
-}
-
-
-void MacroAssembler::DecrementCounter(StatsCounter* counter, int value,
-                                      Register scratch1, Register scratch2) {
-  IncrementCounter(counter, -value, scratch1, scratch2);
-}
-
-void MacroAssembler::MaybeDropFrames() {
-  // Check whether we need to drop frames to restart a function on the stack.
-  ExternalReference restart_fp =
-      ExternalReference::debug_restart_fp_address(isolate());
-  Mov(x1, Operand(restart_fp));
-  Ldr(x1, MemOperand(x1));
-  Tst(x1, x1);
-  Jump(BUILTIN_CODE(isolate(), FrameDropperTrampoline), RelocInfo::CODE_TARGET,
-       ne);
-}
-
-void MacroAssembler::JumpIfObjectType(Register object,
-                                      Register map,
-                                      Register type_reg,
-                                      InstanceType type,
-                                      Label* if_cond_pass,
-                                      Condition cond) {
-  CompareObjectType(object, map, type_reg, type);
-  B(cond, if_cond_pass);
-}
-
-
-// Sets condition flags based on comparison, and returns type in type_reg.
-void MacroAssembler::CompareObjectType(Register object,
-                                       Register map,
-                                       Register type_reg,
-                                       InstanceType type) {
-  Ldr(map, FieldMemOperand(object, HeapObject::kMapOffset));
-  CompareInstanceType(map, type_reg, type);
-}
-
-
-// Sets condition flags based on comparison, and returns type in type_reg.
-void MacroAssembler::CompareInstanceType(Register map,
-                                         Register type_reg,
-                                         InstanceType type) {
-  Ldrh(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset));
-  Cmp(type_reg, type);
-}
-
-
-void MacroAssembler::LoadElementsKindFromMap(Register result, Register map) {
-  // Load the map's "bit field 2".
-  Ldrb(result, FieldMemOperand(map, Map::kBitField2Offset));
-  // Retrieve elements_kind from bit field 2.
-  DecodeField<Map::ElementsKindBits>(result);
-}
-
-void MacroAssembler::CompareRoot(const Register& obj,
-                                 Heap::RootListIndex index) {
-  UseScratchRegisterScope temps(this);
-  Register temp = temps.AcquireX();
-  DCHECK(!AreAliased(obj, temp));
-  LoadRoot(temp, index);
-  Cmp(obj, temp);
-}
-
-
-void MacroAssembler::JumpIfRoot(const Register& obj,
-                                Heap::RootListIndex index,
-                                Label* if_equal) {
-  CompareRoot(obj, index);
-  B(eq, if_equal);
-}
-
-
-void MacroAssembler::JumpIfNotRoot(const Register& obj,
-                                   Heap::RootListIndex index,
-                                   Label* if_not_equal) {
-  CompareRoot(obj, index);
-  B(ne, if_not_equal);
-}
-
-
-void MacroAssembler::CompareAndSplit(const Register& lhs,
-                                     const Operand& rhs,
-                                     Condition cond,
-                                     Label* if_true,
-                                     Label* if_false,
-                                     Label* fall_through) {
-  if ((if_true == if_false) && (if_false == fall_through)) {
-    // Fall through.
-  } else if (if_true == if_false) {
-    B(if_true);
-  } else if (if_false == fall_through) {
-    CompareAndBranch(lhs, rhs, cond, if_true);
-  } else if (if_true == fall_through) {
-    CompareAndBranch(lhs, rhs, NegateCondition(cond), if_false);
-  } else {
-    CompareAndBranch(lhs, rhs, cond, if_true);
-    B(if_false);
-  }
-}
-
-
-void MacroAssembler::TestAndSplit(const Register& reg,
-                                  uint64_t bit_pattern,
-                                  Label* if_all_clear,
-                                  Label* if_any_set,
-                                  Label* fall_through) {
-  if ((if_all_clear == if_any_set) && (if_any_set == fall_through)) {
-    // Fall through.
-  } else if (if_all_clear == if_any_set) {
-    B(if_all_clear);
-  } else if (if_all_clear == fall_through) {
-    TestAndBranchIfAnySet(reg, bit_pattern, if_any_set);
-  } else if (if_any_set == fall_through) {
-    TestAndBranchIfAllClear(reg, bit_pattern, if_all_clear);
-  } else {
-    TestAndBranchIfAnySet(reg, bit_pattern, if_any_set);
-    B(if_all_clear);
-  }
-}
-
-bool TurboAssembler::AllowThisStubCall(CodeStub* stub) {
-  return has_frame() || !stub->SometimesSetsUpAFrame();
-}
-
-void MacroAssembler::PopSafepointRegisters() {
-  const int num_unsaved = kNumSafepointRegisters - kNumSafepointSavedRegisters;
-  DCHECK_GE(num_unsaved, 0);
-  DCHECK_EQ(num_unsaved % 2, 0);
-  DCHECK_EQ(kSafepointSavedRegisters % 2, 0);
-  PopXRegList(kSafepointSavedRegisters);
-  Drop(num_unsaved);
-}
-
-
-void MacroAssembler::PushSafepointRegisters() {
-  // Safepoints expect a block of kNumSafepointRegisters values on the stack, so
-  // adjust the stack for unsaved registers.
-  const int num_unsaved = kNumSafepointRegisters - kNumSafepointSavedRegisters;
-  DCHECK_GE(num_unsaved, 0);
-  DCHECK_EQ(num_unsaved % 2, 0);
-  DCHECK_EQ(kSafepointSavedRegisters % 2, 0);
-  Claim(num_unsaved);
-  PushXRegList(kSafepointSavedRegisters);
-}
-
-int MacroAssembler::SafepointRegisterStackIndex(int reg_code) {
-  // Make sure the safepoint registers list is what we expect.
-  DCHECK_EQ(CPURegList::GetSafepointSavedRegisters().list(), 0x6FFCFFFF);
-
-  // Safepoint registers are stored contiguously on the stack, but not all the
-  // registers are saved. The following registers are excluded:
-  //  - x16 and x17 (ip0 and ip1) because they shouldn't be preserved outside of
-  //    the macro assembler.
-  //  - x31 (csp) because the system stack pointer doesn't need to be included
-  //    in safepoint registers.
-  //
-  // This function implements the mapping of register code to index into the
-  // safepoint register slots.
-  if ((reg_code >= 0) && (reg_code <= 15)) {
-    return reg_code;
-  } else if ((reg_code >= 18) && (reg_code <= 30)) {
-    // Skip ip0 and ip1.
-    return reg_code - 2;
-  } else {
-    // This register has no safepoint register slot.
-    UNREACHABLE();
-  }
-}
-
-void MacroAssembler::CheckPageFlag(const Register& object,
-                                   const Register& scratch, int mask,
-                                   Condition cc, Label* condition_met) {
-  And(scratch, object, ~Page::kPageAlignmentMask);
-  Ldr(scratch, MemOperand(scratch, MemoryChunk::kFlagsOffset));
-  if (cc == eq) {
-    TestAndBranchIfAnySet(scratch, mask, condition_met);
-  } else {
-    TestAndBranchIfAllClear(scratch, mask, condition_met);
-  }
-}
-
-void TurboAssembler::CheckPageFlagSet(const Register& object,
-                                      const Register& scratch, int mask,
-                                      Label* if_any_set) {
-  And(scratch, object, ~Page::kPageAlignmentMask);
-  Ldr(scratch, MemOperand(scratch, MemoryChunk::kFlagsOffset));
-  TestAndBranchIfAnySet(scratch, mask, if_any_set);
-}
-
-void TurboAssembler::CheckPageFlagClear(const Register& object,
-                                        const Register& scratch, int mask,
-                                        Label* if_all_clear) {
-  And(scratch, object, ~Page::kPageAlignmentMask);
-  Ldr(scratch, MemOperand(scratch, MemoryChunk::kFlagsOffset));
-  TestAndBranchIfAllClear(scratch, mask, if_all_clear);
-}
-
-void MacroAssembler::RecordWriteField(Register object, int offset,
-                                      Register value, Register scratch,
-                                      LinkRegisterStatus lr_status,
-                                      SaveFPRegsMode save_fp,
-                                      RememberedSetAction remembered_set_action,
-                                      SmiCheck smi_check) {
-  // First, check if a write barrier is even needed. The tests below
-  // catch stores of Smis.
-  Label done;
-
-  // Skip the barrier if writing a smi.
-  if (smi_check == INLINE_SMI_CHECK) {
-    JumpIfSmi(value, &done);
-  }
-
-  // Although the object register is tagged, the offset is relative to the start
-  // of the object, so offset must be a multiple of kPointerSize.
-  DCHECK(IsAligned(offset, kPointerSize));
-
-  Add(scratch, object, offset - kHeapObjectTag);
-  if (emit_debug_code()) {
-    Label ok;
-    Tst(scratch, kPointerSize - 1);
-    B(eq, &ok);
-    Abort(AbortReason::kUnalignedCellInWriteBarrier);
-    Bind(&ok);
-  }
-
-  RecordWrite(object, scratch, value, lr_status, save_fp, remembered_set_action,
-              OMIT_SMI_CHECK);
-
-  Bind(&done);
-
-  // Clobber clobbered input registers when running with the debug-code flag
-  // turned on to provoke errors.
-  if (emit_debug_code()) {
-    Mov(value, Operand(bit_cast<int64_t>(kZapValue + 4)));
-    Mov(scratch, Operand(bit_cast<int64_t>(kZapValue + 8)));
-  }
-}
-
-void TurboAssembler::SaveRegisters(RegList registers) {
-  DCHECK_GT(NumRegs(registers), 0);
-  CPURegList regs(lr);
-  for (int i = 0; i < Register::kNumRegisters; ++i) {
-    if ((registers >> i) & 1u) {
-      regs.Combine(Register::XRegFromCode(i));
-    }
-  }
-
-  PushCPURegList(regs);
-}
-
-void TurboAssembler::RestoreRegisters(RegList registers) {
-  DCHECK_GT(NumRegs(registers), 0);
-  CPURegList regs(lr);
-  for (int i = 0; i < Register::kNumRegisters; ++i) {
-    if ((registers >> i) & 1u) {
-      regs.Combine(Register::XRegFromCode(i));
-    }
-  }
-
-  PopCPURegList(regs);
-}
-
-void TurboAssembler::CallRecordWriteStub(
-    Register object, Register address,
-    RememberedSetAction remembered_set_action, SaveFPRegsMode fp_mode) {
-  // TODO(albertnetymk): For now we ignore remembered_set_action and fp_mode,
-  // i.e. always emit remember set and save FP registers in RecordWriteStub. If
-  // large performance regression is observed, we should use these values to
-  // avoid unnecessary work.
-
-  Callable const callable =
-      Builtins::CallableFor(isolate(), Builtins::kRecordWrite);
-  RegList registers = callable.descriptor().allocatable_registers();
-
-  SaveRegisters(registers);
-
-  Register object_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kObject));
-  Register slot_parameter(
-      callable.descriptor().GetRegisterParameter(RecordWriteDescriptor::kSlot));
-  Register isolate_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kIsolate));
-  Register remembered_set_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kRememberedSet));
-  Register fp_mode_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kFPMode));
-
-  Push(object, address);
-
-  Pop(slot_parameter, object_parameter);
-
-  Mov(isolate_parameter, ExternalReference::isolate_address(isolate()));
-  Move(remembered_set_parameter, Smi::FromEnum(remembered_set_action));
-  Move(fp_mode_parameter, Smi::FromEnum(fp_mode));
-  Call(callable.code(), RelocInfo::CODE_TARGET);
-
-  RestoreRegisters(registers);
-}
-
-// Will clobber: object, address, value.
-// If lr_status is kLRHasBeenSaved, lr will also be clobbered.
-//
-// The register 'object' contains a heap object pointer. The heap object tag is
-// shifted away.
-void MacroAssembler::RecordWrite(Register object, Register address,
-                                 Register value, LinkRegisterStatus lr_status,
-                                 SaveFPRegsMode fp_mode,
-                                 RememberedSetAction remembered_set_action,
-                                 SmiCheck smi_check) {
-  ASM_LOCATION_IN_ASSEMBLER("MacroAssembler::RecordWrite");
-  DCHECK(!AreAliased(object, value));
-
-  if (emit_debug_code()) {
-    UseScratchRegisterScope temps(this);
-    Register temp = temps.AcquireX();
-
-    Ldr(temp, MemOperand(address));
-    Cmp(temp, value);
-    Check(eq, AbortReason::kWrongAddressOrValuePassedToRecordWrite);
-  }
-
-  // First, check if a write barrier is even needed. The tests below
-  // catch stores of smis and stores into the young generation.
-  Label done;
-
-  if (smi_check == INLINE_SMI_CHECK) {
-    DCHECK_EQ(0, kSmiTag);
-    JumpIfSmi(value, &done);
-  }
-
-  CheckPageFlagClear(value,
-                     value,  // Used as scratch.
-                     MemoryChunk::kPointersToHereAreInterestingMask, &done);
-  CheckPageFlagClear(object,
-                     value,  // Used as scratch.
-                     MemoryChunk::kPointersFromHereAreInterestingMask,
-                     &done);
-
-  // Record the actual write.
-  if (lr_status == kLRHasNotBeenSaved) {
-    Push(padreg, lr);
-  }
-  CallRecordWriteStub(object, address, remembered_set_action, fp_mode);
-  if (lr_status == kLRHasNotBeenSaved) {
-    Pop(lr, padreg);
-  }
-
-  Bind(&done);
-
-  // Count number of write barriers in generated code.
-  isolate()->counters()->write_barriers_static()->Increment();
-  IncrementCounter(isolate()->counters()->write_barriers_dynamic(), 1, address,
-                   value);
-
-  // Clobber clobbered registers when running with the debug-code flag
-  // turned on to provoke errors.
-  if (emit_debug_code()) {
-    Mov(address, Operand(bit_cast<int64_t>(kZapValue + 12)));
-    Mov(value, Operand(bit_cast<int64_t>(kZapValue + 16)));
-  }
-}
-
-void TurboAssembler::Assert(Condition cond, AbortReason reason) {
-  if (emit_debug_code()) {
-    Check(cond, reason);
-  }
-}
-
-void MacroAssembler::AssertRegisterIsRoot(Register reg,
-                                          Heap::RootListIndex index,
-                                          AbortReason reason) {
-  if (emit_debug_code()) {
-    CompareRoot(reg, index);
-    Check(eq, reason);
-  }
-}
-
-void TurboAssembler::Check(Condition cond, AbortReason reason) {
-  Label ok;
-  B(cond, &ok);
-  Abort(reason);
-  // Will not return here.
-  Bind(&ok);
-}
-
-void TurboAssembler::Abort(AbortReason reason) {
-#ifdef DEBUG
-  RecordComment("Abort message: ");
-  RecordComment(GetAbortReason(reason));
-
-  if (FLAG_trap_on_abort) {
-    Brk(0);
-    return;
-  }
-#endif
-
-  // We need some scratch registers for the MacroAssembler, so make sure we have
-  // some. This is safe here because Abort never returns.
-  RegList old_tmp_list = TmpList()->list();
-  TmpList()->Combine(MacroAssembler::DefaultTmpList());
-
-  if (use_real_aborts()) {
-    // Avoid infinite recursion; Push contains some assertions that use Abort.
-    NoUseRealAbortsScope no_real_aborts(this);
-
-    Move(x1, Smi::FromInt(static_cast<int>(reason)));
-
-    if (!has_frame_) {
-      // We don't actually want to generate a pile of code for this, so just
-      // claim there is a stack frame, without generating one.
-      FrameScope scope(this, StackFrame::NONE);
-      Call(BUILTIN_CODE(isolate(), Abort), RelocInfo::CODE_TARGET);
-    } else {
-      Call(BUILTIN_CODE(isolate(), Abort), RelocInfo::CODE_TARGET);
-    }
-  } else {
-    // Load the string to pass to Printf.
-    Label msg_address;
-    Adr(x0, &msg_address);
-
-    // Call Printf directly to report the error.
-    CallPrintf();
-
-    // We need a way to stop execution on both the simulator and real hardware,
-    // and Unreachable() is the best option.
-    Unreachable();
-
-    // Emit the message string directly in the instruction stream.
-    {
-      BlockPoolsScope scope(this);
-      Bind(&msg_address);
-      EmitStringData(GetAbortReason(reason));
-    }
-  }
-
-  TmpList()->set_list(old_tmp_list);
-}
-
-void MacroAssembler::LoadNativeContextSlot(int index, Register dst) {
-  Ldr(dst, NativeContextMemOperand());
-  Ldr(dst, ContextMemOperand(dst, index));
-}
-
-
-// This is the main Printf implementation. All other Printf variants call
-// PrintfNoPreserve after setting up one or more PreserveRegisterScopes.
-void MacroAssembler::PrintfNoPreserve(const char * format,
-                                      const CPURegister& arg0,
-                                      const CPURegister& arg1,
-                                      const CPURegister& arg2,
-                                      const CPURegister& arg3) {
-  // We cannot handle a caller-saved stack pointer. It doesn't make much sense
-  // in most cases anyway, so this restriction shouldn't be too serious.
-  DCHECK(!kCallerSaved.IncludesAliasOf(StackPointer()));
-
-  // The provided arguments, and their proper procedure-call standard registers.
-  CPURegister args[kPrintfMaxArgCount] = {arg0, arg1, arg2, arg3};
-  CPURegister pcs[kPrintfMaxArgCount] = {NoReg, NoReg, NoReg, NoReg};
-
-  int arg_count = kPrintfMaxArgCount;
-
-  // The PCS varargs registers for printf. Note that x0 is used for the printf
-  // format string.
-  static const CPURegList kPCSVarargs =
-      CPURegList(CPURegister::kRegister, kXRegSizeInBits, 1, arg_count);
-  static const CPURegList kPCSVarargsFP =
-      CPURegList(CPURegister::kVRegister, kDRegSizeInBits, 0, arg_count - 1);
-
-  // We can use caller-saved registers as scratch values, except for the
-  // arguments and the PCS registers where they might need to go.
-  CPURegList tmp_list = kCallerSaved;
-  tmp_list.Remove(x0);      // Used to pass the format string.
-  tmp_list.Remove(kPCSVarargs);
-  tmp_list.Remove(arg0, arg1, arg2, arg3);
-
-  CPURegList fp_tmp_list = kCallerSavedV;
-  fp_tmp_list.Remove(kPCSVarargsFP);
-  fp_tmp_list.Remove(arg0, arg1, arg2, arg3);
-
-  // Override the MacroAssembler's scratch register list. The lists will be
-  // reset automatically at the end of the UseScratchRegisterScope.
-  UseScratchRegisterScope temps(this);
-  TmpList()->set_list(tmp_list.list());
-  FPTmpList()->set_list(fp_tmp_list.list());
-
-  // Copies of the printf vararg registers that we can pop from.
-  CPURegList pcs_varargs = kPCSVarargs;
-  CPURegList pcs_varargs_fp = kPCSVarargsFP;
-
-  // Place the arguments. There are lots of clever tricks and optimizations we
-  // could use here, but Printf is a debug tool so instead we just try to keep
-  // it simple: Move each input that isn't already in the right place to a
-  // scratch register, then move everything back.
-  for (unsigned i = 0; i < kPrintfMaxArgCount; i++) {
-    // Work out the proper PCS register for this argument.
-    if (args[i].IsRegister()) {
-      pcs[i] = pcs_varargs.PopLowestIndex().X();
-      // We might only need a W register here. We need to know the size of the
-      // argument so we can properly encode it for the simulator call.
-      if (args[i].Is32Bits()) pcs[i] = pcs[i].W();
-    } else if (args[i].IsVRegister()) {
-      // In C, floats are always cast to doubles for varargs calls.
-      pcs[i] = pcs_varargs_fp.PopLowestIndex().D();
-    } else {
-      DCHECK(args[i].IsNone());
-      arg_count = i;
-      break;
-    }
-
-    // If the argument is already in the right place, leave it where it is.
-    if (args[i].Aliases(pcs[i])) continue;
-
-    // Otherwise, if the argument is in a PCS argument register, allocate an
-    // appropriate scratch register and then move it out of the way.
-    if (kPCSVarargs.IncludesAliasOf(args[i]) ||
-        kPCSVarargsFP.IncludesAliasOf(args[i])) {
-      if (args[i].IsRegister()) {
-        Register old_arg = args[i].Reg();
-        Register new_arg = temps.AcquireSameSizeAs(old_arg);
-        Mov(new_arg, old_arg);
-        args[i] = new_arg;
-      } else {
-        VRegister old_arg = args[i].VReg();
-        VRegister new_arg = temps.AcquireSameSizeAs(old_arg);
-        Fmov(new_arg, old_arg);
-        args[i] = new_arg;
-      }
-    }
-  }
-
-  // Do a second pass to move values into their final positions and perform any
-  // conversions that may be required.
-  for (int i = 0; i < arg_count; i++) {
-    DCHECK(pcs[i].type() == args[i].type());
-    if (pcs[i].IsRegister()) {
-      Mov(pcs[i].Reg(), args[i].Reg(), kDiscardForSameWReg);
-    } else {
-      DCHECK(pcs[i].IsVRegister());
-      if (pcs[i].SizeInBytes() == args[i].SizeInBytes()) {
-        Fmov(pcs[i].VReg(), args[i].VReg());
-      } else {
-        Fcvt(pcs[i].VReg(), args[i].VReg());
-      }
-    }
-  }
-
-  // Load the format string into x0, as per the procedure-call standard.
-  //
-  // To make the code as portable as possible, the format string is encoded
-  // directly in the instruction stream. It might be cleaner to encode it in a
-  // literal pool, but since Printf is usually used for debugging, it is
-  // beneficial for it to be minimally dependent on other features.
-  Label format_address;
-  Adr(x0, &format_address);
-
-  // Emit the format string directly in the instruction stream.
-  { BlockPoolsScope scope(this);
-    Label after_data;
-    B(&after_data);
-    Bind(&format_address);
-    EmitStringData(format);
-    Unreachable();
-    Bind(&after_data);
-  }
-
-  // We don't pass any arguments on the stack, but we still need to align the C
-  // stack pointer to a 16-byte boundary for PCS compliance.
-  if (!csp.Is(StackPointer())) {
-    Bic(csp, StackPointer(), 0xF);
-  }
-
-  CallPrintf(arg_count, pcs);
-}
-
-void TurboAssembler::CallPrintf(int arg_count, const CPURegister* args) {
-// A call to printf needs special handling for the simulator, since the system
-// printf function will use a different instruction set and the procedure-call
-// standard will not be compatible.
-#ifdef USE_SIMULATOR
-  { InstructionAccurateScope scope(this, kPrintfLength / kInstructionSize);
-    hlt(kImmExceptionIsPrintf);
-    dc32(arg_count);          // kPrintfArgCountOffset
-
-    // Determine the argument pattern.
-    uint32_t arg_pattern_list = 0;
-    for (int i = 0; i < arg_count; i++) {
-      uint32_t arg_pattern;
-      if (args[i].IsRegister()) {
-        arg_pattern = args[i].Is32Bits() ? kPrintfArgW : kPrintfArgX;
-      } else {
-        DCHECK(args[i].Is64Bits());
-        arg_pattern = kPrintfArgD;
-      }
-      DCHECK(arg_pattern < (1 << kPrintfArgPatternBits));
-      arg_pattern_list |= (arg_pattern << (kPrintfArgPatternBits * i));
-    }
-    dc32(arg_pattern_list);   // kPrintfArgPatternListOffset
-  }
-#else
-  Call(ExternalReference::printf_function(isolate()));
-#endif
-}
-
-
-void MacroAssembler::Printf(const char * format,
-                            CPURegister arg0,
-                            CPURegister arg1,
-                            CPURegister arg2,
-                            CPURegister arg3) {
-  // We can only print sp if it is the current stack pointer.
-  if (!csp.Is(StackPointer())) {
-    DCHECK(!csp.Aliases(arg0));
-    DCHECK(!csp.Aliases(arg1));
-    DCHECK(!csp.Aliases(arg2));
-    DCHECK(!csp.Aliases(arg3));
-  }
-
-  // Printf is expected to preserve all registers, so make sure that none are
-  // available as scratch registers until we've preserved them.
-  RegList old_tmp_list = TmpList()->list();
-  RegList old_fp_tmp_list = FPTmpList()->list();
-  TmpList()->set_list(0);
-  FPTmpList()->set_list(0);
-
-  // Preserve all caller-saved registers as well as NZCV.
-  // If csp is the stack pointer, PushCPURegList asserts that the size of each
-  // list is a multiple of 16 bytes.
-  PushCPURegList(kCallerSaved);
-  PushCPURegList(kCallerSavedV);
-
-  // We can use caller-saved registers as scratch values (except for argN).
-  CPURegList tmp_list = kCallerSaved;
-  CPURegList fp_tmp_list = kCallerSavedV;
-  tmp_list.Remove(arg0, arg1, arg2, arg3);
-  fp_tmp_list.Remove(arg0, arg1, arg2, arg3);
-  TmpList()->set_list(tmp_list.list());
-  FPTmpList()->set_list(fp_tmp_list.list());
-
-  { UseScratchRegisterScope temps(this);
-    // If any of the arguments are the current stack pointer, allocate a new
-    // register for them, and adjust the value to compensate for pushing the
-    // caller-saved registers.
-    bool arg0_sp = StackPointer().Aliases(arg0);
-    bool arg1_sp = StackPointer().Aliases(arg1);
-    bool arg2_sp = StackPointer().Aliases(arg2);
-    bool arg3_sp = StackPointer().Aliases(arg3);
-    if (arg0_sp || arg1_sp || arg2_sp || arg3_sp) {
-      // Allocate a register to hold the original stack pointer value, to pass
-      // to PrintfNoPreserve as an argument.
-      Register arg_sp = temps.AcquireX();
-      Add(arg_sp, StackPointer(),
-          kCallerSaved.TotalSizeInBytes() + kCallerSavedV.TotalSizeInBytes());
-      if (arg0_sp) arg0 = Register::Create(arg_sp.code(), arg0.SizeInBits());
-      if (arg1_sp) arg1 = Register::Create(arg_sp.code(), arg1.SizeInBits());
-      if (arg2_sp) arg2 = Register::Create(arg_sp.code(), arg2.SizeInBits());
-      if (arg3_sp) arg3 = Register::Create(arg_sp.code(), arg3.SizeInBits());
-    }
-
-    // Preserve NZCV.
-    { UseScratchRegisterScope temps(this);
-      Register tmp = temps.AcquireX();
-      Mrs(tmp, NZCV);
-      Push(tmp, xzr);
-    }
-
-    PrintfNoPreserve(format, arg0, arg1, arg2, arg3);
-
-    // Restore NZCV.
-    { UseScratchRegisterScope temps(this);
-      Register tmp = temps.AcquireX();
-      Pop(xzr, tmp);
-      Msr(NZCV, tmp);
-    }
-  }
-
-  PopCPURegList(kCallerSavedV);
-  PopCPURegList(kCallerSaved);
-
-  TmpList()->set_list(old_tmp_list);
-  FPTmpList()->set_list(old_fp_tmp_list);
-}
-
-UseScratchRegisterScope::~UseScratchRegisterScope() {
-  available_->set_list(old_available_);
-  availablefp_->set_list(old_availablefp_);
-}
-
-
-Register UseScratchRegisterScope::AcquireSameSizeAs(const Register& reg) {
-  int code = AcquireNextAvailable(available_).code();
-  return Register::Create(code, reg.SizeInBits());
-}
-
-VRegister UseScratchRegisterScope::AcquireSameSizeAs(const VRegister& reg) {
-  int code = AcquireNextAvailable(availablefp_).code();
-  return VRegister::Create(code, reg.SizeInBits());
-}
-
-
-CPURegister UseScratchRegisterScope::AcquireNextAvailable(
-    CPURegList* available) {
-  CHECK(!available->IsEmpty());
-  CPURegister result = available->PopLowestIndex();
-  DCHECK(!AreAliased(result, xzr, csp));
-  return result;
-}
-
-
-MemOperand ContextMemOperand(Register context, int index) {
-  return MemOperand(context, Context::SlotOffset(index));
-}
-
-MemOperand NativeContextMemOperand() {
-  return ContextMemOperand(cp, Context::NATIVE_CONTEXT_INDEX);
-}
-
-#define __ masm->
-
-void InlineSmiCheckInfo::Emit(MacroAssembler* masm, const Register& reg,
-                              const Label* smi_check) {
-  Assembler::BlockPoolsScope scope(masm);
-  if (reg.IsValid()) {
-    DCHECK(smi_check->is_bound());
-    DCHECK(reg.Is64Bits());
-
-    // Encode the register (x0-x30) in the lowest 5 bits, then the offset to
-    // 'check' in the other bits. The possible offset is limited in that we
-    // use BitField to pack the data, and the underlying data type is a
-    // uint32_t.
-    uint32_t delta =
-        static_cast<uint32_t>(__ InstructionsGeneratedSince(smi_check));
-    __ InlineData(RegisterBits::encode(reg.code()) | DeltaBits::encode(delta));
-  } else {
-    DCHECK(!smi_check->is_bound());
-
-    // An offset of 0 indicates that there is no patch site.
-    __ InlineData(0);
-  }
-}
-
-InlineSmiCheckInfo::InlineSmiCheckInfo(Address info)
-    : reg_(NoReg), smi_check_delta_(0), smi_check_(nullptr) {
-  InstructionSequence* inline_data = InstructionSequence::At(info);
-  DCHECK(inline_data->IsInlineData());
-  if (inline_data->IsInlineData()) {
-    uint64_t payload = inline_data->InlineData();
-    // We use BitField to decode the payload, and BitField can only handle
-    // 32-bit values.
-    DCHECK(is_uint32(payload));
-    if (payload != 0) {
-      uint32_t payload32 = static_cast<uint32_t>(payload);
-      int reg_code = RegisterBits::decode(payload32);
-      reg_ = Register::XRegFromCode(reg_code);
-      smi_check_delta_ = DeltaBits::decode(payload32);
-      DCHECK_NE(0, smi_check_delta_);
-      smi_check_ = inline_data->preceding(smi_check_delta_);
-    }
-  }
-}
-
-
-#undef __
-
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_ARM64
diff --git a/src/v8/src/arm64/macro-assembler-arm64.h b/src/v8/src/arm64/macro-assembler-arm64.h
deleted file mode 100644
index 47c08f2..0000000
--- a/src/v8/src/arm64/macro-assembler-arm64.h
+++ /dev/null
@@ -1,2248 +0,0 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_ARM64_MACRO_ASSEMBLER_ARM64_H_
-#define V8_ARM64_MACRO_ASSEMBLER_ARM64_H_
-
-#include <vector>
-
-#include "src/arm64/assembler-arm64.h"
-#include "src/bailout-reason.h"
-#include "src/base/bits.h"
-#include "src/globals.h"
-
-// Simulator specific helpers.
-#if USE_SIMULATOR
-  // TODO(all): If possible automatically prepend an indicator like
-  // UNIMPLEMENTED or LOCATION.
-  #define ASM_UNIMPLEMENTED(message)                                         \
-  __ Debug(message, __LINE__, NO_PARAM)
-  #define ASM_UNIMPLEMENTED_BREAK(message)                                   \
-  __ Debug(message, __LINE__,                                                \
-           FLAG_ignore_asm_unimplemented_break ? NO_PARAM : BREAK)
-#if DEBUG
-#define ASM_LOCATION(message) __ Debug("LOCATION: " message, __LINE__, NO_PARAM)
-#define ASM_LOCATION_IN_ASSEMBLER(message) \
-  Debug("LOCATION: " message, __LINE__, NO_PARAM)
-#else
-#define ASM_LOCATION(message)
-#define ASM_LOCATION_IN_ASSEMBLER(message)
-#endif
-#else
-#define ASM_UNIMPLEMENTED(message)
-#define ASM_UNIMPLEMENTED_BREAK(message)
-#define ASM_LOCATION(message)
-#define ASM_LOCATION_IN_ASSEMBLER(message)
-#endif
-
-
-namespace v8 {
-namespace internal {
-
-// Give alias names to registers for calling conventions.
-#define kReturnRegister0 x0
-#define kReturnRegister1 x1
-#define kReturnRegister2 x2
-#define kJSFunctionRegister x1
-#define kContextRegister cp
-#define kAllocateSizeRegister x1
-#define kInterpreterAccumulatorRegister x0
-#define kInterpreterBytecodeOffsetRegister x19
-#define kInterpreterBytecodeArrayRegister x20
-#define kInterpreterDispatchTableRegister x21
-#define kJavaScriptCallArgCountRegister x0
-#define kJavaScriptCallNewTargetRegister x3
-#define kRuntimeCallFunctionRegister x1
-#define kRuntimeCallArgCountRegister x0
-
-#define LS_MACRO_LIST(V)                                     \
-  V(Ldrb, Register&, rt, LDRB_w)                             \
-  V(Strb, Register&, rt, STRB_w)                             \
-  V(Ldrsb, Register&, rt, rt.Is64Bits() ? LDRSB_x : LDRSB_w) \
-  V(Ldrh, Register&, rt, LDRH_w)                             \
-  V(Strh, Register&, rt, STRH_w)                             \
-  V(Ldrsh, Register&, rt, rt.Is64Bits() ? LDRSH_x : LDRSH_w) \
-  V(Ldr, CPURegister&, rt, LoadOpFor(rt))                    \
-  V(Str, CPURegister&, rt, StoreOpFor(rt))                   \
-  V(Ldrsw, Register&, rt, LDRSW_x)
-
-#define LSPAIR_MACRO_LIST(V)                             \
-  V(Ldp, CPURegister&, rt, rt2, LoadPairOpFor(rt, rt2))  \
-  V(Stp, CPURegister&, rt, rt2, StorePairOpFor(rt, rt2)) \
-  V(Ldpsw, CPURegister&, rt, rt2, LDPSW_x)
-
-#define LDA_STL_MACRO_LIST(V) \
-  V(Ldarb, ldarb)             \
-  V(Ldarh, ldarh)             \
-  V(Ldar, ldar)               \
-  V(Ldaxrb, ldaxrb)           \
-  V(Ldaxrh, ldaxrh)           \
-  V(Ldaxr, ldaxr)             \
-  V(Stlrb, stlrb)             \
-  V(Stlrh, stlrh)             \
-  V(Stlr, stlr)
-
-#define STLX_MACRO_LIST(V) \
-  V(Stlxrb, stlxrb)        \
-  V(Stlxrh, stlxrh)        \
-  V(Stlxr, stlxr)
-
-// ----------------------------------------------------------------------------
-// Static helper functions
-
-// Generate a MemOperand for loading a field from an object.
-inline MemOperand FieldMemOperand(Register object, int offset);
-inline MemOperand UntagSmiFieldMemOperand(Register object, int offset);
-
-// Generate a MemOperand for loading a SMI from memory.
-inline MemOperand UntagSmiMemOperand(Register object, int offset);
-
-
-// ----------------------------------------------------------------------------
-// MacroAssembler
-
-enum BranchType {
-  // Copies of architectural conditions.
-  // The associated conditions can be used in place of those, the code will
-  // take care of reinterpreting them with the correct type.
-  integer_eq = eq,
-  integer_ne = ne,
-  integer_hs = hs,
-  integer_lo = lo,
-  integer_mi = mi,
-  integer_pl = pl,
-  integer_vs = vs,
-  integer_vc = vc,
-  integer_hi = hi,
-  integer_ls = ls,
-  integer_ge = ge,
-  integer_lt = lt,
-  integer_gt = gt,
-  integer_le = le,
-  integer_al = al,
-  integer_nv = nv,
-
-  // These two are *different* from the architectural codes al and nv.
-  // 'always' is used to generate unconditional branches.
-  // 'never' is used to not generate a branch (generally as the inverse
-  // branch type of 'always).
-  always, never,
-  // cbz and cbnz
-  reg_zero, reg_not_zero,
-  // tbz and tbnz
-  reg_bit_clear, reg_bit_set,
-
-  // Aliases.
-  kBranchTypeFirstCondition = eq,
-  kBranchTypeLastCondition = nv,
-  kBranchTypeFirstUsingReg = reg_zero,
-  kBranchTypeFirstUsingBit = reg_bit_clear
-};
-
-inline BranchType InvertBranchType(BranchType type) {
-  if (kBranchTypeFirstCondition <= type && type <= kBranchTypeLastCondition) {
-    return static_cast<BranchType>(
-        NegateCondition(static_cast<Condition>(type)));
-  } else {
-    return static_cast<BranchType>(type ^ 1);
-  }
-}
-
-enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET };
-enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK };
-enum LinkRegisterStatus { kLRHasNotBeenSaved, kLRHasBeenSaved };
-enum TargetAddressStorageMode {
-  CAN_INLINE_TARGET_ADDRESS,
-  NEVER_INLINE_TARGET_ADDRESS
-};
-enum DiscardMoveMode { kDontDiscardForSameWReg, kDiscardForSameWReg };
-
-// The macro assembler supports moving automatically pre-shifted immediates for
-// arithmetic and logical instructions, and then applying a post shift in the
-// instruction to undo the modification, in order to reduce the code emitted for
-// an operation. For example:
-//
-//  Add(x0, x0, 0x1f7de) => movz x16, 0xfbef; add x0, x0, x16, lsl #1.
-//
-// This optimisation can be only partially applied when the stack pointer is an
-// operand or destination, so this enumeration is used to control the shift.
-enum PreShiftImmMode {
-  kNoShift,          // Don't pre-shift.
-  kLimitShiftForSP,  // Limit pre-shift for add/sub extend use.
-  kAnyShift          // Allow any pre-shift.
-};
-
-class TurboAssembler : public Assembler {
- public:
-  TurboAssembler(Isolate* isolate, void* buffer, int buffer_size,
-                 CodeObjectRequired create_code_object);
-
-  // The Abort method should call a V8 runtime function, but the CallRuntime
-  // mechanism depends on CEntryStub. If use_real_aborts is false, Abort will
-  // use a simpler abort mechanism that doesn't depend on CEntryStub.
-  //
-  // The purpose of this is to allow Aborts to be compiled whilst CEntryStub is
-  // being generated.
-  bool use_real_aborts() const { return use_real_aborts_; }
-
-  class NoUseRealAbortsScope {
-   public:
-    explicit NoUseRealAbortsScope(TurboAssembler* tasm)
-        : saved_(tasm->use_real_aborts_), tasm_(tasm) {
-      tasm_->use_real_aborts_ = false;
-    }
-    ~NoUseRealAbortsScope() { tasm_->use_real_aborts_ = saved_; }
-
-   private:
-    bool saved_;
-    TurboAssembler* tasm_;
-  };
-
-  void set_has_frame(bool value) { has_frame_ = value; }
-  bool has_frame() const { return has_frame_; }
-
-  Isolate* isolate() const { return isolate_; }
-
-  Handle<HeapObject> CodeObject() {
-    DCHECK(!code_object_.is_null());
-    return code_object_;
-  }
-
-#if DEBUG
-  void set_allow_macro_instructions(bool value) {
-    allow_macro_instructions_ = value;
-  }
-  bool allow_macro_instructions() const { return allow_macro_instructions_; }
-#endif
-
-  // Activation support.
-  void EnterFrame(StackFrame::Type type);
-  void EnterFrame(StackFrame::Type type, bool load_constant_pool_pointer_reg) {
-    // Out-of-line constant pool not implemented on arm64.
-    UNREACHABLE();
-  }
-  void LeaveFrame(StackFrame::Type type);
-
-  inline void InitializeRootRegister();
-
-  void Mov(const Register& rd, const Operand& operand,
-           DiscardMoveMode discard_mode = kDontDiscardForSameWReg);
-  void Mov(const Register& rd, uint64_t imm);
-  inline void Mov(const Register& rd, const Register& rm);
-  void Mov(const VRegister& vd, int vd_index, const VRegister& vn,
-           int vn_index) {
-    DCHECK(allow_macro_instructions());
-    mov(vd, vd_index, vn, vn_index);
-  }
-  void Mov(const VRegister& vd, const VRegister& vn, int index) {
-    DCHECK(allow_macro_instructions());
-    mov(vd, vn, index);
-  }
-  void Mov(const VRegister& vd, int vd_index, const Register& rn) {
-    DCHECK(allow_macro_instructions());
-    mov(vd, vd_index, rn);
-  }
-  void Mov(const Register& rd, const VRegister& vn, int vn_index) {
-    DCHECK(allow_macro_instructions());
-    mov(rd, vn, vn_index);
-  }
-
-  // This is required for compatibility with architecture independent code.
-  // Remove if not needed.
-  void Move(Register dst, Register src);
-  void Move(Register dst, Handle<HeapObject> x);
-  void Move(Register dst, Smi* src);
-
-// NEON by element instructions.
-#define NEON_BYELEMENT_MACRO_LIST(V) \
-  V(fmla, Fmla)                      \
-  V(fmls, Fmls)                      \
-  V(fmul, Fmul)                      \
-  V(fmulx, Fmulx)                    \
-  V(mul, Mul)                        \
-  V(mla, Mla)                        \
-  V(mls, Mls)                        \
-  V(sqdmulh, Sqdmulh)                \
-  V(sqrdmulh, Sqrdmulh)              \
-  V(sqdmull, Sqdmull)                \
-  V(sqdmull2, Sqdmull2)              \
-  V(sqdmlal, Sqdmlal)                \
-  V(sqdmlal2, Sqdmlal2)              \
-  V(sqdmlsl, Sqdmlsl)                \
-  V(sqdmlsl2, Sqdmlsl2)              \
-  V(smull, Smull)                    \
-  V(smull2, Smull2)                  \
-  V(smlal, Smlal)                    \
-  V(smlal2, Smlal2)                  \
-  V(smlsl, Smlsl)                    \
-  V(smlsl2, Smlsl2)                  \
-  V(umull, Umull)                    \
-  V(umull2, Umull2)                  \
-  V(umlal, Umlal)                    \
-  V(umlal2, Umlal2)                  \
-  V(umlsl, Umlsl)                    \
-  V(umlsl2, Umlsl2)
-
-#define DEFINE_MACRO_ASM_FUNC(ASM, MASM)                                   \
-  void MASM(const VRegister& vd, const VRegister& vn, const VRegister& vm, \
-            int vm_index) {                                                \
-    DCHECK(allow_macro_instructions());                                    \
-    ASM(vd, vn, vm, vm_index);                                             \
-  }
-  NEON_BYELEMENT_MACRO_LIST(DEFINE_MACRO_ASM_FUNC)
-#undef DEFINE_MACRO_ASM_FUNC
-
-// NEON 2 vector register instructions.
-#define NEON_2VREG_MACRO_LIST(V) \
-  V(abs, Abs)                    \
-  V(addp, Addp)                  \
-  V(addv, Addv)                  \
-  V(cls, Cls)                    \
-  V(clz, Clz)                    \
-  V(cnt, Cnt)                    \
-  V(faddp, Faddp)                \
-  V(fcvtas, Fcvtas)              \
-  V(fcvtau, Fcvtau)              \
-  V(fcvtms, Fcvtms)              \
-  V(fcvtmu, Fcvtmu)              \
-  V(fcvtns, Fcvtns)              \
-  V(fcvtnu, Fcvtnu)              \
-  V(fcvtps, Fcvtps)              \
-  V(fcvtpu, Fcvtpu)              \
-  V(fmaxnmp, Fmaxnmp)            \
-  V(fmaxnmv, Fmaxnmv)            \
-  V(fmaxp, Fmaxp)                \
-  V(fmaxv, Fmaxv)                \
-  V(fminnmp, Fminnmp)            \
-  V(fminnmv, Fminnmv)            \
-  V(fminp, Fminp)                \
-  V(fminv, Fminv)                \
-  V(fneg, Fneg)                  \
-  V(frecpe, Frecpe)              \
-  V(frecpx, Frecpx)              \
-  V(frinta, Frinta)              \
-  V(frinti, Frinti)              \
-  V(frintm, Frintm)              \
-  V(frintn, Frintn)              \
-  V(frintp, Frintp)              \
-  V(frintx, Frintx)              \
-  V(frintz, Frintz)              \
-  V(frsqrte, Frsqrte)            \
-  V(fsqrt, Fsqrt)                \
-  V(mov, Mov)                    \
-  V(mvn, Mvn)                    \
-  V(neg, Neg)                    \
-  V(not_, Not)                   \
-  V(rbit, Rbit)                  \
-  V(rev16, Rev16)                \
-  V(rev32, Rev32)                \
-  V(rev64, Rev64)                \
-  V(sadalp, Sadalp)              \
-  V(saddlp, Saddlp)              \
-  V(saddlv, Saddlv)              \
-  V(smaxv, Smaxv)                \
-  V(sminv, Sminv)                \
-  V(sqabs, Sqabs)                \
-  V(sqneg, Sqneg)                \
-  V(sqxtn2, Sqxtn2)              \
-  V(sqxtn, Sqxtn)                \
-  V(sqxtun2, Sqxtun2)            \
-  V(sqxtun, Sqxtun)              \
-  V(suqadd, Suqadd)              \
-  V(sxtl2, Sxtl2)                \
-  V(sxtl, Sxtl)                  \
-  V(uadalp, Uadalp)              \
-  V(uaddlp, Uaddlp)              \
-  V(uaddlv, Uaddlv)              \
-  V(umaxv, Umaxv)                \
-  V(uminv, Uminv)                \
-  V(uqxtn2, Uqxtn2)              \
-  V(uqxtn, Uqxtn)                \
-  V(urecpe, Urecpe)              \
-  V(ursqrte, Ursqrte)            \
-  V(usqadd, Usqadd)              \
-  V(uxtl2, Uxtl2)                \
-  V(uxtl, Uxtl)                  \
-  V(xtn2, Xtn2)                  \
-  V(xtn, Xtn)
-
-#define DEFINE_MACRO_ASM_FUNC(ASM, MASM)                \
-  void MASM(const VRegister& vd, const VRegister& vn) { \
-    DCHECK(allow_macro_instructions());                 \
-    ASM(vd, vn);                                        \
-  }
-  NEON_2VREG_MACRO_LIST(DEFINE_MACRO_ASM_FUNC)
-#undef DEFINE_MACRO_ASM_FUNC
-#undef NEON_2VREG_MACRO_LIST
-
-// NEON 2 vector register with immediate instructions.
-#define NEON_2VREG_FPIMM_MACRO_LIST(V) \
-  V(fcmeq, Fcmeq)                      \
-  V(fcmge, Fcmge)                      \
-  V(fcmgt, Fcmgt)                      \
-  V(fcmle, Fcmle)                      \
-  V(fcmlt, Fcmlt)
-
-#define DEFINE_MACRO_ASM_FUNC(ASM, MASM)                            \
-  void MASM(const VRegister& vd, const VRegister& vn, double imm) { \
-    DCHECK(allow_macro_instructions());                             \
-    ASM(vd, vn, imm);                                               \
-  }
-  NEON_2VREG_FPIMM_MACRO_LIST(DEFINE_MACRO_ASM_FUNC)
-#undef DEFINE_MACRO_ASM_FUNC
-
-// NEON 3 vector register instructions.
-#define NEON_3VREG_MACRO_LIST(V) \
-  V(add, Add)                    \
-  V(addhn2, Addhn2)              \
-  V(addhn, Addhn)                \
-  V(addp, Addp)                  \
-  V(and_, And)                   \
-  V(bic, Bic)                    \
-  V(bif, Bif)                    \
-  V(bit, Bit)                    \
-  V(bsl, Bsl)                    \
-  V(cmeq, Cmeq)                  \
-  V(cmge, Cmge)                  \
-  V(cmgt, Cmgt)                  \
-  V(cmhi, Cmhi)                  \
-  V(cmhs, Cmhs)                  \
-  V(cmtst, Cmtst)                \
-  V(eor, Eor)                    \
-  V(fabd, Fabd)                  \
-  V(facge, Facge)                \
-  V(facgt, Facgt)                \
-  V(faddp, Faddp)                \
-  V(fcmeq, Fcmeq)                \
-  V(fcmge, Fcmge)                \
-  V(fcmgt, Fcmgt)                \
-  V(fmaxnmp, Fmaxnmp)            \
-  V(fmaxp, Fmaxp)                \
-  V(fminnmp, Fminnmp)            \
-  V(fminp, Fminp)                \
-  V(fmla, Fmla)                  \
-  V(fmls, Fmls)                  \
-  V(fmulx, Fmulx)                \
-  V(frecps, Frecps)              \
-  V(frsqrts, Frsqrts)            \
-  V(mla, Mla)                    \
-  V(mls, Mls)                    \
-  V(mul, Mul)                    \
-  V(orn, Orn)                    \
-  V(orr, Orr)                    \
-  V(pmull2, Pmull2)              \
-  V(pmull, Pmull)                \
-  V(pmul, Pmul)                  \
-  V(raddhn2, Raddhn2)            \
-  V(raddhn, Raddhn)              \
-  V(rsubhn2, Rsubhn2)            \
-  V(rsubhn, Rsubhn)              \
-  V(sabal2, Sabal2)              \
-  V(sabal, Sabal)                \
-  V(saba, Saba)                  \
-  V(sabdl2, Sabdl2)              \
-  V(sabdl, Sabdl)                \
-  V(sabd, Sabd)                  \
-  V(saddl2, Saddl2)              \
-  V(saddl, Saddl)                \
-  V(saddw2, Saddw2)              \
-  V(saddw, Saddw)                \
-  V(shadd, Shadd)                \
-  V(shsub, Shsub)                \
-  V(smaxp, Smaxp)                \
-  V(smax, Smax)                  \
-  V(sminp, Sminp)                \
-  V(smin, Smin)                  \
-  V(smlal2, Smlal2)              \
-  V(smlal, Smlal)                \
-  V(smlsl2, Smlsl2)              \
-  V(smlsl, Smlsl)                \
-  V(smull2, Smull2)              \
-  V(smull, Smull)                \
-  V(sqadd, Sqadd)                \
-  V(sqdmlal2, Sqdmlal2)          \
-  V(sqdmlal, Sqdmlal)            \
-  V(sqdmlsl2, Sqdmlsl2)          \
-  V(sqdmlsl, Sqdmlsl)            \
-  V(sqdmulh, Sqdmulh)            \
-  V(sqdmull2, Sqdmull2)          \
-  V(sqdmull, Sqdmull)            \
-  V(sqrdmulh, Sqrdmulh)          \
-  V(sqrshl, Sqrshl)              \
-  V(sqshl, Sqshl)                \
-  V(sqsub, Sqsub)                \
-  V(srhadd, Srhadd)              \
-  V(srshl, Srshl)                \
-  V(sshl, Sshl)                  \
-  V(ssubl2, Ssubl2)              \
-  V(ssubl, Ssubl)                \
-  V(ssubw2, Ssubw2)              \
-  V(ssubw, Ssubw)                \
-  V(subhn2, Subhn2)              \
-  V(subhn, Subhn)                \
-  V(sub, Sub)                    \
-  V(trn1, Trn1)                  \
-  V(trn2, Trn2)                  \
-  V(uabal2, Uabal2)              \
-  V(uabal, Uabal)                \
-  V(uaba, Uaba)                  \
-  V(uabdl2, Uabdl2)              \
-  V(uabdl, Uabdl)                \
-  V(uabd, Uabd)                  \
-  V(uaddl2, Uaddl2)              \
-  V(uaddl, Uaddl)                \
-  V(uaddw2, Uaddw2)              \
-  V(uaddw, Uaddw)                \
-  V(uhadd, Uhadd)                \
-  V(uhsub, Uhsub)                \
-  V(umaxp, Umaxp)                \
-  V(umax, Umax)                  \
-  V(uminp, Uminp)                \
-  V(umin, Umin)                  \
-  V(umlal2, Umlal2)              \
-  V(umlal, Umlal)                \
-  V(umlsl2, Umlsl2)              \
-  V(umlsl, Umlsl)                \
-  V(umull2, Umull2)              \
-  V(umull, Umull)                \
-  V(uqadd, Uqadd)                \
-  V(uqrshl, Uqrshl)              \
-  V(uqshl, Uqshl)                \
-  V(uqsub, Uqsub)                \
-  V(urhadd, Urhadd)              \
-  V(urshl, Urshl)                \
-  V(ushl, Ushl)                  \
-  V(usubl2, Usubl2)              \
-  V(usubl, Usubl)                \
-  V(usubw2, Usubw2)              \
-  V(usubw, Usubw)                \
-  V(uzp1, Uzp1)                  \
-  V(uzp2, Uzp2)                  \
-  V(zip1, Zip1)                  \
-  V(zip2, Zip2)
-
-#define DEFINE_MACRO_ASM_FUNC(ASM, MASM)                                     \
-  void MASM(const VRegister& vd, const VRegister& vn, const VRegister& vm) { \
-    DCHECK(allow_macro_instructions());                                      \
-    ASM(vd, vn, vm);                                                         \
-  }
-  NEON_3VREG_MACRO_LIST(DEFINE_MACRO_ASM_FUNC)
-#undef DEFINE_MACRO_ASM_FUNC
-
-  void Bic(const VRegister& vd, const int imm8, const int left_shift = 0) {
-    DCHECK(allow_macro_instructions());
-    bic(vd, imm8, left_shift);
-  }
-
-  // This is required for compatibility in architecture independent code.
-  inline void jmp(Label* L);
-
-  void B(Label* label, BranchType type, Register reg = NoReg, int bit = -1);
-  inline void B(Label* label);
-  inline void B(Condition cond, Label* label);
-  void B(Label* label, Condition cond);
-
-  void Tbnz(const Register& rt, unsigned bit_pos, Label* label);
-  void Tbz(const Register& rt, unsigned bit_pos, Label* label);
-
-  void Cbnz(const Register& rt, Label* label);
-  void Cbz(const Register& rt, Label* label);
-
-  bool AllowThisStubCall(CodeStub* stub);
-  void CallStubDelayed(CodeStub* stub);
-  void CallRuntimeDelayed(Zone* zone, Runtime::FunctionId fid,
-                          SaveFPRegsMode save_doubles = kDontSaveFPRegs);
-
-  // Removes current frame and its arguments from the stack preserving
-  // the arguments and a return address pushed to the stack for the next call.
-  // Both |callee_args_count| and |caller_args_count_reg| do not include
-  // receiver. |callee_args_count| is not modified, |caller_args_count_reg|
-  // is trashed.
-  void PrepareForTailCall(const ParameterCount& callee_args_count,
-                          Register caller_args_count_reg, Register scratch0,
-                          Register scratch1);
-
-  inline void SmiUntag(Register dst, Register src);
-  inline void SmiUntag(Register smi);
-
-  // Calls Abort(msg) if the condition cond is not satisfied.
-  // Use --debug_code to enable.
-  void Assert(Condition cond, AbortReason reason);
-
-  void AssertSmi(Register object,
-                 AbortReason reason = AbortReason::kOperandIsNotASmi);
-
-  // Like Assert(), but always enabled.
-  void Check(Condition cond, AbortReason reason);
-
-  inline void Debug(const char* message, uint32_t code, Instr params = BREAK);
-
-  // Print a message to stderr and abort execution.
-  void Abort(AbortReason reason);
-
-  // If emit_debug_code() is true, emit a run-time check to ensure that
-  // StackPointer() does not point below the system stack pointer.
-  //
-  // Whilst it is architecturally legal for StackPointer() to point below csp,
-  // it can be evidence of a potential bug because the ABI forbids accesses
-  // below csp.
-  //
-  // If StackPointer() is the system stack pointer (csp), then csp will be
-  // dereferenced to cause the processor (or simulator) to abort if it is not
-  // properly aligned.
-  //
-  // If emit_debug_code() is false, this emits no code.
-  void AssertStackConsistency();
-
-  // Remaining instructions are simple pass-through calls to the assembler.
-  inline void Asr(const Register& rd, const Register& rn, unsigned shift);
-  inline void Asr(const Register& rd, const Register& rn, const Register& rm);
-
-  // Try to move an immediate into the destination register in a single
-  // instruction. Returns true for success, and updates the contents of dst.
-  // Returns false, otherwise.
-  bool TryOneInstrMoveImmediate(const Register& dst, int64_t imm);
-
-  inline void Bind(Label* label);
-
-  static unsigned CountClearHalfWords(uint64_t imm, unsigned reg_size);
-
-  CPURegList* TmpList() { return &tmp_list_; }
-  CPURegList* FPTmpList() { return &fptmp_list_; }
-
-  static CPURegList DefaultTmpList();
-  static CPURegList DefaultFPTmpList();
-
-  // Return the stack pointer.
-  inline const Register& StackPointer() const { return csp; }
-
-  // Move macros.
-  inline void Mvn(const Register& rd, uint64_t imm);
-  void Mvn(const Register& rd, const Operand& operand);
-  static bool IsImmMovn(uint64_t imm, unsigned reg_size);
-  static bool IsImmMovz(uint64_t imm, unsigned reg_size);
-
-  void LogicalMacro(const Register& rd, const Register& rn,
-                    const Operand& operand, LogicalOp op);
-  void AddSubMacro(const Register& rd, const Register& rn,
-                   const Operand& operand, FlagsUpdate S, AddSubOp op);
-  inline void Orr(const Register& rd, const Register& rn,
-                  const Operand& operand);
-  void Orr(const VRegister& vd, const int imm8, const int left_shift = 0) {
-    DCHECK(allow_macro_instructions());
-    orr(vd, imm8, left_shift);
-  }
-  inline void Orn(const Register& rd, const Register& rn,
-                  const Operand& operand);
-  inline void Eor(const Register& rd, const Register& rn,
-                  const Operand& operand);
-  inline void Eon(const Register& rd, const Register& rn,
-                  const Operand& operand);
-  inline void And(const Register& rd, const Register& rn,
-                  const Operand& operand);
-  inline void Ands(const Register& rd, const Register& rn,
-                   const Operand& operand);
-  inline void Tst(const Register& rn, const Operand& operand);
-  inline void Bic(const Register& rd, const Register& rn,
-                  const Operand& operand);
-  inline void Blr(const Register& xn);
-  inline void Cmp(const Register& rn, const Operand& operand);
-  inline void Subs(const Register& rd, const Register& rn,
-                   const Operand& operand);
-
-  // Emits a runtime assert that the CSP is aligned.
-  void AssertCspAligned();
-
-  // Copy slot_count stack slots from the stack offset specified by src to
-  // the stack offset specified by dst. The offsets and count are expressed in
-  // slot-sized units. Offset dst must be less than src, or the gap between
-  // them must be greater than or equal to slot_count, otherwise the result is
-  // unpredictable. The function may corrupt its register arguments. The
-  // registers must not alias each other.
-  void CopySlots(int dst, Register src, Register slot_count);
-  void CopySlots(Register dst, Register src, Register slot_count);
-
-  // Copy count double words from the address in register src to the address
-  // in register dst. There are two modes for this function:
-  // 1) Address dst must be less than src, or the gap between them must be
-  //    greater than or equal to count double words, otherwise the result is
-  //    unpredictable. This is the default mode.
-  // 2) Address src must be less than dst, or the gap between them must be
-  //    greater than or equal to count double words, otherwise the result is
-  //    undpredictable. In this mode, src and dst specify the last (highest)
-  //    address of the regions to copy from and to.
-  // The case where src == dst is not supported.
-  // The function may corrupt its register arguments. The registers must not
-  // alias each other.
-  enum CopyDoubleWordsMode { kDstLessThanSrc, kSrcLessThanDst };
-  void CopyDoubleWords(Register dst, Register src, Register count,
-                       CopyDoubleWordsMode mode = kDstLessThanSrc);
-
-  // Calculate the address of a double word-sized slot at slot_offset from the
-  // stack pointer, and write it to dst. Positive slot_offsets are at addresses
-  // greater than sp, with slot zero at sp.
-  void SlotAddress(Register dst, int slot_offset);
-  void SlotAddress(Register dst, Register slot_offset);
-
-  // Load a literal from the inline constant pool.
-  inline void Ldr(const CPURegister& rt, const Operand& imm);
-  // Helper function for double immediate.
-  inline void Ldr(const CPURegister& rt, double imm);
-
-  // Claim or drop stack space without actually accessing memory.
-  //
-  // In debug mode, both of these will write invalid data into the claimed or
-  // dropped space.
-  //
-  // If the current stack pointer (according to StackPointer()) is csp, then it
-  // must be aligned to 16 bytes and the size claimed or dropped must be a
-  // multiple of 16 bytes.
-  //
-  // Note that unit_size must be specified in bytes. For variants which take a
-  // Register count, the unit size must be a power of two.
-  inline void Claim(int64_t count, uint64_t unit_size = kXRegSize);
-  inline void Claim(const Register& count, uint64_t unit_size = kXRegSize);
-  inline void Drop(int64_t count, uint64_t unit_size = kXRegSize);
-  inline void Drop(const Register& count, uint64_t unit_size = kXRegSize);
-
-  // Drop 'count' arguments from the stack, rounded up to a multiple of two,
-  // without actually accessing memory.
-  // We assume the size of the arguments is the pointer size.
-  // An optional mode argument is passed, which can indicate we need to
-  // explicitly add the receiver to the count.
-  enum ArgumentsCountMode { kCountIncludesReceiver, kCountExcludesReceiver };
-  inline void DropArguments(const Register& count,
-                            ArgumentsCountMode mode = kCountIncludesReceiver);
-  inline void DropArguments(int64_t count,
-                            ArgumentsCountMode mode = kCountIncludesReceiver);
-
-  // Drop 'count' slots from stack, rounded up to a multiple of two, without
-  // actually accessing memory.
-  inline void DropSlots(int64_t count);
-
-  // Push a single argument, with padding, to the stack.
-  inline void PushArgument(const Register& arg);
-
-  // Re-synchronizes the system stack pointer (csp) with the current stack
-  // pointer (according to StackPointer()).
-  //
-  // This method asserts that StackPointer() is not csp, since the call does
-  // not make sense in that context.
-  inline void SyncSystemStackPointer();
-
-  // Push the system stack pointer (csp) down to allow the same to be done to
-  // the current stack pointer (according to StackPointer()). This must be
-  // called _before_ accessing the memory.
-  //
-  // This is necessary when pushing or otherwise adding things to the stack, to
-  // satisfy the AAPCS64 constraint that the memory below the system stack
-  // pointer is not accessed.  The amount pushed will be increased as necessary
-  // to ensure csp remains aligned to 16 bytes.
-  //
-  // This method asserts that StackPointer() is not csp, since the call does
-  // not make sense in that context.
-  inline void BumpSystemStackPointer(const Operand& space);
-
-  // Add and sub macros.
-  inline void Add(const Register& rd, const Register& rn,
-                  const Operand& operand);
-  inline void Adds(const Register& rd, const Register& rn,
-                   const Operand& operand);
-  inline void Sub(const Register& rd, const Register& rn,
-                  const Operand& operand);
-
-  // Abort execution if argument is not a positive or zero integer, enabled via
-  // --debug-code.
-  void AssertPositiveOrZero(Register value);
-
-#define DECLARE_FUNCTION(FN, REGTYPE, REG, OP) \
-  inline void FN(const REGTYPE REG, const MemOperand& addr);
-  LS_MACRO_LIST(DECLARE_FUNCTION)
-#undef DECLARE_FUNCTION
-
-  // Push or pop up to 4 registers of the same width to or from the stack.
-  //
-  // If an argument register is 'NoReg', all further arguments are also assumed
-  // to be 'NoReg', and are thus not pushed or popped.
-  //
-  // Arguments are ordered such that "Push(a, b);" is functionally equivalent
-  // to "Push(a); Push(b);".
-  //
-  // It is valid to push the same register more than once, and there is no
-  // restriction on the order in which registers are specified.
-  //
-  // It is not valid to pop into the same register more than once in one
-  // operation, not even into the zero register.
-  //
-  // The stack pointer must be aligned to 16 bytes on entry and the total size
-  // of the specified registers must also be a multiple of 16 bytes.
-  //
-  // Even if the current stack pointer is not the system stack pointer (csp),
-  // Push (and derived methods) will still modify the system stack pointer in
-  // order to comply with ABI rules about accessing memory below the system
-  // stack pointer.
-  //
-  // Other than the registers passed into Pop, the stack pointer and (possibly)
-  // the system stack pointer, these methods do not modify any other registers.
-  void Push(const CPURegister& src0, const CPURegister& src1 = NoReg,
-            const CPURegister& src2 = NoReg, const CPURegister& src3 = NoReg);
-  void Push(const CPURegister& src0, const CPURegister& src1,
-            const CPURegister& src2, const CPURegister& src3,
-            const CPURegister& src4, const CPURegister& src5 = NoReg,
-            const CPURegister& src6 = NoReg, const CPURegister& src7 = NoReg);
-  void Pop(const CPURegister& dst0, const CPURegister& dst1 = NoReg,
-           const CPURegister& dst2 = NoReg, const CPURegister& dst3 = NoReg);
-  void Pop(const CPURegister& dst0, const CPURegister& dst1,
-           const CPURegister& dst2, const CPURegister& dst3,
-           const CPURegister& dst4, const CPURegister& dst5 = NoReg,
-           const CPURegister& dst6 = NoReg, const CPURegister& dst7 = NoReg);
-  void Push(const Register& src0, const VRegister& src1);
-
-  // This is a convenience method for pushing a single Handle<Object>.
-  inline void Push(Handle<HeapObject> object);
-  inline void Push(Smi* smi);
-
-  // Aliases of Push and Pop, required for V8 compatibility.
-  inline void push(Register src) { Push(src); }
-  inline void pop(Register dst) { Pop(dst); }
-
-  void SaveRegisters(RegList registers);
-  void RestoreRegisters(RegList registers);
-
-  void CallRecordWriteStub(Register object, Register address,
-                           RememberedSetAction remembered_set_action,
-                           SaveFPRegsMode fp_mode);
-
-  // Alternative forms of Push and Pop, taking a RegList or CPURegList that
-  // specifies the registers that are to be pushed or popped. Higher-numbered
-  // registers are associated with higher memory addresses (as in the A32 push
-  // and pop instructions).
-  //
-  // (Push|Pop)SizeRegList allow you to specify the register size as a
-  // parameter. Only kXRegSizeInBits, kWRegSizeInBits, kDRegSizeInBits and
-  // kSRegSizeInBits are supported.
-  //
-  // Otherwise, (Push|Pop)(CPU|X|W|D|S)RegList is preferred.
-  void PushCPURegList(CPURegList registers);
-  void PopCPURegList(CPURegList registers);
-
-  // Calculate how much stack space (in bytes) are required to store caller
-  // registers excluding those specified in the arguments.
-  int RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode,
-                                      Register exclusion) const;
-
-  // Push caller saved registers on the stack, and return the number of bytes
-  // stack pointer is adjusted.
-  int PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion = no_reg);
-
-  // Restore caller saved registers from the stack, and return the number of
-  // bytes stack pointer is adjusted.
-  int PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion = no_reg);
-
-  // Move an immediate into register dst, and return an Operand object for use
-  // with a subsequent instruction that accepts a shift. The value moved into
-  // dst is not necessarily equal to imm; it may have had a shifting operation
-  // applied to it that will be subsequently undone by the shift applied in the
-  // Operand.
-  Operand MoveImmediateForShiftedOp(const Register& dst, int64_t imm,
-                                    PreShiftImmMode mode);
-
-  void CheckPageFlagSet(const Register& object, const Register& scratch,
-                        int mask, Label* if_any_set);
-
-  void CheckPageFlagClear(const Register& object, const Register& scratch,
-                          int mask, Label* if_all_clear);
-
-  // Perform necessary maintenance operations before a push or after a pop.
-  //
-  // Note that size is specified in bytes.
-  void PushPreamble(Operand total_size);
-  void PopPostamble(Operand total_size);
-
-  void PushPreamble(int count, int size);
-  void PopPostamble(int count, int size);
-
-  // Test the bits of register defined by bit_pattern, and branch if ANY of
-  // those bits are set. May corrupt the status flags.
-  inline void TestAndBranchIfAnySet(const Register& reg,
-                                    const uint64_t bit_pattern, Label* label);
-
-  // Test the bits of register defined by bit_pattern, and branch if ALL of
-  // those bits are clear (ie. not set.) May corrupt the status flags.
-  inline void TestAndBranchIfAllClear(const Register& reg,
-                                      const uint64_t bit_pattern, Label* label);
-
-  inline void Brk(int code);
-
-  inline void JumpIfSmi(Register value, Label* smi_label,
-                        Label* not_smi_label = nullptr);
-
-  inline void Fmov(VRegister fd, VRegister fn);
-  inline void Fmov(VRegister fd, Register rn);
-  // Provide explicit double and float interfaces for FP immediate moves, rather
-  // than relying on implicit C++ casts. This allows signalling NaNs to be
-  // preserved when the immediate matches the format of fd. Most systems convert
-  // signalling NaNs to quiet NaNs when converting between float and double.
-  inline void Fmov(VRegister fd, double imm);
-  inline void Fmov(VRegister fd, float imm);
-  // Provide a template to allow other types to be converted automatically.
-  template <typename T>
-  void Fmov(VRegister fd, T imm) {
-    DCHECK(allow_macro_instructions());
-    Fmov(fd, static_cast<double>(imm));
-  }
-  inline void Fmov(Register rd, VRegister fn);
-
-  void Movi(const VRegister& vd, uint64_t imm, Shift shift = LSL,
-            int shift_amount = 0);
-  void Movi(const VRegister& vd, uint64_t hi, uint64_t lo);
-
-  void Jump(Register target);
-  void Jump(Address target, RelocInfo::Mode rmode, Condition cond = al);
-  void Jump(Handle<Code> code, RelocInfo::Mode rmode, Condition cond = al);
-  void Jump(intptr_t target, RelocInfo::Mode rmode, Condition cond = al);
-
-  void Call(Register target);
-  void Call(Label* target);
-  void Call(Address target, RelocInfo::Mode rmode);
-  void Call(Handle<Code> code, RelocInfo::Mode rmode = RelocInfo::CODE_TARGET);
-  void Call(ExternalReference target);
-
-  void CallForDeoptimization(Address target, RelocInfo::Mode rmode);
-
-  // For every Call variant, there is a matching CallSize function that returns
-  // the size (in bytes) of the call sequence.
-  static int CallSize(Register target);
-  static int CallSize(Label* target);
-  static int CallSize(Address target, RelocInfo::Mode rmode);
-  static int CallSize(Handle<Code> code,
-                      RelocInfo::Mode rmode = RelocInfo::CODE_TARGET);
-
-  // Calls a C function.
-  // The called function is not allowed to trigger a
-  // garbage collection, since that might move the code and invalidate the
-  // return address (unless this is somehow accounted for by the called
-  // function).
-  void CallCFunction(ExternalReference function, int num_reg_arguments);
-  void CallCFunction(ExternalReference function, int num_reg_arguments,
-                     int num_double_arguments);
-  void CallCFunction(Register function, int num_reg_arguments,
-                     int num_double_arguments);
-
-  // Performs a truncating conversion of a floating point number as used by
-  // the JS bitwise operations. See ECMA-262 9.5: ToInt32.
-  // Exits with 'result' holding the answer.
-  void TruncateDoubleToIDelayed(Zone* zone, Register result,
-                                DoubleRegister double_input);
-
-  inline void Mul(const Register& rd, const Register& rn, const Register& rm);
-
-  inline void Fcvtzs(const Register& rd, const VRegister& fn);
-  void Fcvtzs(const VRegister& vd, const VRegister& vn, int fbits = 0) {
-    DCHECK(allow_macro_instructions());
-    fcvtzs(vd, vn, fbits);
-  }
-
-  inline void Fcvtzu(const Register& rd, const VRegister& fn);
-  void Fcvtzu(const VRegister& vd, const VRegister& vn, int fbits = 0) {
-    DCHECK(allow_macro_instructions());
-    fcvtzu(vd, vn, fbits);
-  }
-
-  inline void Madd(const Register& rd, const Register& rn, const Register& rm,
-                   const Register& ra);
-  inline void Mneg(const Register& rd, const Register& rn, const Register& rm);
-  inline void Sdiv(const Register& rd, const Register& rn, const Register& rm);
-  inline void Udiv(const Register& rd, const Register& rn, const Register& rm);
-  inline void Msub(const Register& rd, const Register& rn, const Register& rm,
-                   const Register& ra);
-
-  inline void Lsl(const Register& rd, const Register& rn, unsigned shift);
-  inline void Lsl(const Register& rd, const Register& rn, const Register& rm);
-  inline void Umull(const Register& rd, const Register& rn, const Register& rm);
-  inline void Smull(const Register& rd, const Register& rn, const Register& rm);
-
-  inline void Sxtb(const Register& rd, const Register& rn);
-  inline void Sxth(const Register& rd, const Register& rn);
-  inline void Sxtw(const Register& rd, const Register& rn);
-  inline void Ubfiz(const Register& rd, const Register& rn, unsigned lsb,
-                    unsigned width);
-  inline void Ubfx(const Register& rd, const Register& rn, unsigned lsb,
-                   unsigned width);
-  inline void Lsr(const Register& rd, const Register& rn, unsigned shift);
-  inline void Lsr(const Register& rd, const Register& rn, const Register& rm);
-  inline void Ror(const Register& rd, const Register& rs, unsigned shift);
-  inline void Ror(const Register& rd, const Register& rn, const Register& rm);
-  inline void Cmn(const Register& rn, const Operand& operand);
-  inline void Fadd(const VRegister& fd, const VRegister& fn,
-                   const VRegister& fm);
-  inline void Fcmp(const VRegister& fn, const VRegister& fm);
-  inline void Fcmp(const VRegister& fn, double value);
-  inline void Fabs(const VRegister& fd, const VRegister& fn);
-  inline void Fmul(const VRegister& fd, const VRegister& fn,
-                   const VRegister& fm);
-  inline void Fsub(const VRegister& fd, const VRegister& fn,
-                   const VRegister& fm);
-  inline void Fdiv(const VRegister& fd, const VRegister& fn,
-                   const VRegister& fm);
-  inline void Fmax(const VRegister& fd, const VRegister& fn,
-                   const VRegister& fm);
-  inline void Fmin(const VRegister& fd, const VRegister& fn,
-                   const VRegister& fm);
-  inline void Rbit(const Register& rd, const Register& rn);
-
-  enum AdrHint {
-    // The target must be within the immediate range of adr.
-    kAdrNear,
-    // The target may be outside of the immediate range of adr. Additional
-    // instructions may be emitted.
-    kAdrFar
-  };
-  void Adr(const Register& rd, Label* label, AdrHint = kAdrNear);
-
-  // Add/sub with carry macros.
-  inline void Adc(const Register& rd, const Register& rn,
-                  const Operand& operand);
-
-  // Conditional macros.
-  inline void Ccmp(const Register& rn, const Operand& operand, StatusFlags nzcv,
-                   Condition cond);
-
-  inline void Clz(const Register& rd, const Register& rn);
-
-  // Poke 'src' onto the stack. The offset is in bytes.
-  //
-  // If the current stack pointer (according to StackPointer()) is csp, then
-  // csp must be aligned to 16 bytes.
-  void Poke(const CPURegister& src, const Operand& offset);
-
-  // Poke 'src1' and 'src2' onto the stack. The values written will be adjacent
-  // with 'src2' at a higher address than 'src1'. The offset is in bytes.
-  //
-  // If the current stack pointer (according to StackPointer()) is csp, then
-  // csp must be aligned to 16 bytes.
-  void PokePair(const CPURegister& src1, const CPURegister& src2, int offset);
-
-  inline void Sbfx(const Register& rd, const Register& rn, unsigned lsb,
-                   unsigned width);
-
-  inline void Bfi(const Register& rd, const Register& rn, unsigned lsb,
-                  unsigned width);
-
-  inline void Scvtf(const VRegister& fd, const Register& rn,
-                    unsigned fbits = 0);
-  void Scvtf(const VRegister& vd, const VRegister& vn, int fbits = 0) {
-    DCHECK(allow_macro_instructions());
-    scvtf(vd, vn, fbits);
-  }
-  inline void Ucvtf(const VRegister& fd, const Register& rn,
-                    unsigned fbits = 0);
-  void Ucvtf(const VRegister& vd, const VRegister& vn, int fbits = 0) {
-    DCHECK(allow_macro_instructions());
-    ucvtf(vd, vn, fbits);
-  }
-
-  void AssertFPCRState(Register fpcr = NoReg);
-  void CanonicalizeNaN(const VRegister& dst, const VRegister& src);
-  void CanonicalizeNaN(const VRegister& reg) { CanonicalizeNaN(reg, reg); }
-
-  inline void Cset(const Register& rd, Condition cond);
-  inline void Fccmp(const VRegister& fn, const VRegister& fm, StatusFlags nzcv,
-                    Condition cond);
-  inline void Csinc(const Register& rd, const Register& rn, const Register& rm,
-                    Condition cond);
-
-  inline void Fcvt(const VRegister& fd, const VRegister& fn);
-
-  int ActivationFrameAlignment();
-
-  void Ins(const VRegister& vd, int vd_index, const VRegister& vn,
-           int vn_index) {
-    DCHECK(allow_macro_instructions());
-    ins(vd, vd_index, vn, vn_index);
-  }
-  void Ins(const VRegister& vd, int vd_index, const Register& rn) {
-    DCHECK(allow_macro_instructions());
-    ins(vd, vd_index, rn);
-  }
-
-  inline void Bl(Label* label);
-  inline void Br(const Register& xn);
-
-  inline void Uxtb(const Register& rd, const Register& rn);
-  inline void Uxth(const Register& rd, const Register& rn);
-  inline void Uxtw(const Register& rd, const Register& rn);
-
-  void Dup(const VRegister& vd, const VRegister& vn, int index) {
-    DCHECK(allow_macro_instructions());
-    dup(vd, vn, index);
-  }
-  void Dup(const VRegister& vd, const Register& rn) {
-    DCHECK(allow_macro_instructions());
-    dup(vd, rn);
-  }
-
-#define DECLARE_FUNCTION(FN, REGTYPE, REG, REG2, OP) \
-  inline void FN(const REGTYPE REG, const REGTYPE REG2, const MemOperand& addr);
-  LSPAIR_MACRO_LIST(DECLARE_FUNCTION)
-#undef DECLARE_FUNCTION
-
-#define NEON_2VREG_SHIFT_MACRO_LIST(V) \
-  V(rshrn, Rshrn)                      \
-  V(rshrn2, Rshrn2)                    \
-  V(shl, Shl)                          \
-  V(shll, Shll)                        \
-  V(shll2, Shll2)                      \
-  V(shrn, Shrn)                        \
-  V(shrn2, Shrn2)                      \
-  V(sli, Sli)                          \
-  V(sqrshrn, Sqrshrn)                  \
-  V(sqrshrn2, Sqrshrn2)                \
-  V(sqrshrun, Sqrshrun)                \
-  V(sqrshrun2, Sqrshrun2)              \
-  V(sqshl, Sqshl)                      \
-  V(sqshlu, Sqshlu)                    \
-  V(sqshrn, Sqshrn)                    \
-  V(sqshrn2, Sqshrn2)                  \
-  V(sqshrun, Sqshrun)                  \
-  V(sqshrun2, Sqshrun2)                \
-  V(sri, Sri)                          \
-  V(srshr, Srshr)                      \
-  V(srsra, Srsra)                      \
-  V(sshll, Sshll)                      \
-  V(sshll2, Sshll2)                    \
-  V(sshr, Sshr)                        \
-  V(ssra, Ssra)                        \
-  V(uqrshrn, Uqrshrn)                  \
-  V(uqrshrn2, Uqrshrn2)                \
-  V(uqshl, Uqshl)                      \
-  V(uqshrn, Uqshrn)                    \
-  V(uqshrn2, Uqshrn2)                  \
-  V(urshr, Urshr)                      \
-  V(ursra, Ursra)                      \
-  V(ushll, Ushll)                      \
-  V(ushll2, Ushll2)                    \
-  V(ushr, Ushr)                        \
-  V(usra, Usra)
-
-#define DEFINE_MACRO_ASM_FUNC(ASM, MASM)                           \
-  void MASM(const VRegister& vd, const VRegister& vn, int shift) { \
-    DCHECK(allow_macro_instructions());                            \
-    ASM(vd, vn, shift);                                            \
-  }
-  NEON_2VREG_SHIFT_MACRO_LIST(DEFINE_MACRO_ASM_FUNC)
-#undef DEFINE_MACRO_ASM_FUNC
-
-  void Umov(const Register& rd, const VRegister& vn, int vn_index) {
-    DCHECK(allow_macro_instructions());
-    umov(rd, vn, vn_index);
-  }
-  void Tbl(const VRegister& vd, const VRegister& vn, const VRegister& vm) {
-    DCHECK(allow_macro_instructions());
-    tbl(vd, vn, vm);
-  }
-  void Tbl(const VRegister& vd, const VRegister& vn, const VRegister& vn2,
-           const VRegister& vm) {
-    DCHECK(allow_macro_instructions());
-    tbl(vd, vn, vn2, vm);
-  }
-  void Tbl(const VRegister& vd, const VRegister& vn, const VRegister& vn2,
-           const VRegister& vn3, const VRegister& vm) {
-    DCHECK(allow_macro_instructions());
-    tbl(vd, vn, vn2, vn3, vm);
-  }
-  void Tbl(const VRegister& vd, const VRegister& vn, const VRegister& vn2,
-           const VRegister& vn3, const VRegister& vn4, const VRegister& vm) {
-    DCHECK(allow_macro_instructions());
-    tbl(vd, vn, vn2, vn3, vn4, vm);
-  }
-  void Ext(const VRegister& vd, const VRegister& vn, const VRegister& vm,
-           int index) {
-    DCHECK(allow_macro_instructions());
-    ext(vd, vn, vm, index);
-  }
-
-  void Smov(const Register& rd, const VRegister& vn, int vn_index) {
-    DCHECK(allow_macro_instructions());
-    smov(rd, vn, vn_index);
-  }
-
-// Load-acquire/store-release macros.
-#define DECLARE_FUNCTION(FN, OP) \
-  inline void FN(const Register& rt, const Register& rn);
-  LDA_STL_MACRO_LIST(DECLARE_FUNCTION)
-#undef DECLARE_FUNCTION
-
-  // Load an object from the root table.
-  void LoadRoot(CPURegister destination, Heap::RootListIndex index);
-
-  inline void Ret(const Register& xn = lr);
-
-  // Perform a conversion from a double to a signed int64. If the input fits in
-  // range of the 64-bit result, execution branches to done. Otherwise,
-  // execution falls through, and the sign of the result can be used to
-  // determine if overflow was towards positive or negative infinity.
-  //
-  // On successful conversion, the least significant 32 bits of the result are
-  // equivalent to the ECMA-262 operation "ToInt32".
-  //
-  // Only public for the test code in test-code-stubs-arm64.cc.
-  void TryConvertDoubleToInt64(Register result, DoubleRegister input,
-                               Label* done);
-
-  inline void Mrs(const Register& rt, SystemRegister sysreg);
-
-  // Generates function prologue code.
-  void Prologue();
-
-  void Cmgt(const VRegister& vd, const VRegister& vn, int imm) {
-    DCHECK(allow_macro_instructions());
-    cmgt(vd, vn, imm);
-  }
-  void Cmge(const VRegister& vd, const VRegister& vn, int imm) {
-    DCHECK(allow_macro_instructions());
-    cmge(vd, vn, imm);
-  }
-  void Cmeq(const VRegister& vd, const VRegister& vn, int imm) {
-    DCHECK(allow_macro_instructions());
-    cmeq(vd, vn, imm);
-  }
-
-  inline void Neg(const Register& rd, const Operand& operand);
-  inline void Negs(const Register& rd, const Operand& operand);
-
-  // Compute rd = abs(rm).
-  // This function clobbers the condition flags. On output the overflow flag is
-  // set iff the negation overflowed.
-  //
-  // If rm is the minimum representable value, the result is not representable.
-  // Handlers for each case can be specified using the relevant labels.
-  void Abs(const Register& rd, const Register& rm,
-           Label* is_not_representable = nullptr,
-           Label* is_representable = nullptr);
-
-  inline void Cls(const Register& rd, const Register& rn);
-  inline void Cneg(const Register& rd, const Register& rn, Condition cond);
-  inline void Rev16(const Register& rd, const Register& rn);
-  inline void Rev32(const Register& rd, const Register& rn);
-  inline void Fcvtns(const Register& rd, const VRegister& fn);
-  inline void Fcvtnu(const Register& rd, const VRegister& fn);
-  inline void Fcvtms(const Register& rd, const VRegister& fn);
-  inline void Fcvtmu(const Register& rd, const VRegister& fn);
-  inline void Fcvtas(const Register& rd, const VRegister& fn);
-  inline void Fcvtau(const Register& rd, const VRegister& fn);
-
- protected:
-  // The actual Push and Pop implementations. These don't generate any code
-  // other than that required for the push or pop. This allows
-  // (Push|Pop)CPURegList to bundle together run-time assertions for a large
-  // block of registers.
-  //
-  // Note that size is per register, and is specified in bytes.
-  void PushHelper(int count, int size, const CPURegister& src0,
-                  const CPURegister& src1, const CPURegister& src2,
-                  const CPURegister& src3);
-  void PopHelper(int count, int size, const CPURegister& dst0,
-                 const CPURegister& dst1, const CPURegister& dst2,
-                 const CPURegister& dst3);
-
-  void ConditionalCompareMacro(const Register& rn, const Operand& operand,
-                               StatusFlags nzcv, Condition cond,
-                               ConditionalCompareOp op);
-
-  void AddSubWithCarryMacro(const Register& rd, const Register& rn,
-                            const Operand& operand, FlagsUpdate S,
-                            AddSubWithCarryOp op);
-
-  // Call Printf. On a native build, a simple call will be generated, but if the
-  // simulator is being used then a suitable pseudo-instruction is used. The
-  // arguments and stack (csp) must be prepared by the caller as for a normal
-  // AAPCS64 call to 'printf'.
-  //
-  // The 'args' argument should point to an array of variable arguments in their
-  // proper PCS registers (and in calling order). The argument registers can
-  // have mixed types. The format string (x0) should not be included.
-  void CallPrintf(int arg_count = 0, const CPURegister* args = nullptr);
-
- private:
-  bool has_frame_ = false;
-  Isolate* const isolate_;
-#if DEBUG
-  // Tell whether any of the macro instruction can be used. When false the
-  // MacroAssembler will assert if a method which can emit a variable number
-  // of instructions is called.
-  bool allow_macro_instructions_;
-#endif
-  // This handle will be patched with the code object on installation.
-  Handle<HeapObject> code_object_;
-
-  // Scratch registers available for use by the MacroAssembler.
-  CPURegList tmp_list_;
-  CPURegList fptmp_list_;
-
-  bool use_real_aborts_;
-
-  // Helps resolve branching to labels potentially out of range.
-  // If the label is not bound, it registers the information necessary to later
-  // be able to emit a veneer for this branch if necessary.
-  // If the label is bound, it returns true if the label (or the previous link
-  // in the label chain) is out of range. In that case the caller is responsible
-  // for generating appropriate code.
-  // Otherwise it returns false.
-  // This function also checks wether veneers need to be emitted.
-  bool NeedExtraInstructionsOrRegisterBranch(Label* label,
-                                             ImmBranchType branch_type);
-
-  void Movi16bitHelper(const VRegister& vd, uint64_t imm);
-  void Movi32bitHelper(const VRegister& vd, uint64_t imm);
-  void Movi64bitHelper(const VRegister& vd, uint64_t imm);
-
-  void LoadStoreMacro(const CPURegister& rt, const MemOperand& addr,
-                      LoadStoreOp op);
-
-  void LoadStorePairMacro(const CPURegister& rt, const CPURegister& rt2,
-                          const MemOperand& addr, LoadStorePairOp op);
-};
-
-class MacroAssembler : public TurboAssembler {
- public:
-  MacroAssembler(Isolate* isolate, byte* buffer, unsigned buffer_size,
-                 CodeObjectRequired create_code_object);
-
-  // Instruction set functions ------------------------------------------------
-  // Logical macros.
-  inline void Bics(const Register& rd, const Register& rn,
-                   const Operand& operand);
-
-  inline void Adcs(const Register& rd, const Register& rn,
-                   const Operand& operand);
-  inline void Sbc(const Register& rd, const Register& rn,
-                  const Operand& operand);
-  inline void Sbcs(const Register& rd, const Register& rn,
-                   const Operand& operand);
-  inline void Ngc(const Register& rd, const Operand& operand);
-  inline void Ngcs(const Register& rd, const Operand& operand);
-
-  inline void Ccmn(const Register& rn, const Operand& operand, StatusFlags nzcv,
-                   Condition cond);
-  void Csel(const Register& rd, const Register& rn, const Operand& operand,
-            Condition cond);
-
-#define DECLARE_FUNCTION(FN, OP) \
-  inline void FN(const Register& rs, const Register& rt, const Register& rn);
-  STLX_MACRO_LIST(DECLARE_FUNCTION)
-#undef DECLARE_FUNCTION
-
-  // Branch type inversion relies on these relations.
-  STATIC_ASSERT((reg_zero == (reg_not_zero ^ 1)) &&
-                (reg_bit_clear == (reg_bit_set ^ 1)) &&
-                (always == (never ^ 1)));
-
-  inline void Bfxil(const Register& rd, const Register& rn, unsigned lsb,
-                    unsigned width);
-  inline void Cinc(const Register& rd, const Register& rn, Condition cond);
-  inline void Cinv(const Register& rd, const Register& rn, Condition cond);
-  inline void CzeroX(const Register& rd, Condition cond);
-  inline void CmovX(const Register& rd, const Register& rn, Condition cond);
-  inline void Csetm(const Register& rd, Condition cond);
-  inline void Csinv(const Register& rd, const Register& rn, const Register& rm,
-                    Condition cond);
-  inline void Csneg(const Register& rd, const Register& rn, const Register& rm,
-                    Condition cond);
-  inline void Dmb(BarrierDomain domain, BarrierType type);
-  inline void Dsb(BarrierDomain domain, BarrierType type);
-  inline void Extr(const Register& rd, const Register& rn, const Register& rm,
-                   unsigned lsb);
-  inline void Fcsel(const VRegister& fd, const VRegister& fn,
-                    const VRegister& fm, Condition cond);
-  void Fcvtl(const VRegister& vd, const VRegister& vn) {
-    DCHECK(allow_macro_instructions());
-    fcvtl(vd, vn);
-  }
-  void Fcvtl2(const VRegister& vd, const VRegister& vn) {
-    DCHECK(allow_macro_instructions());
-    fcvtl2(vd, vn);
-  }
-  void Fcvtn(const VRegister& vd, const VRegister& vn) {
-    DCHECK(allow_macro_instructions());
-    fcvtn(vd, vn);
-  }
-  void Fcvtn2(const VRegister& vd, const VRegister& vn) {
-    DCHECK(allow_macro_instructions());
-    fcvtn2(vd, vn);
-  }
-  void Fcvtxn(const VRegister& vd, const VRegister& vn) {
-    DCHECK(allow_macro_instructions());
-    fcvtxn(vd, vn);
-  }
-  void Fcvtxn2(const VRegister& vd, const VRegister& vn) {
-    DCHECK(allow_macro_instructions());
-    fcvtxn2(vd, vn);
-  }
-  inline void Fmadd(const VRegister& fd, const VRegister& fn,
-                    const VRegister& fm, const VRegister& fa);
-  inline void Fmaxnm(const VRegister& fd, const VRegister& fn,
-                     const VRegister& fm);
-  inline void Fminnm(const VRegister& fd, const VRegister& fn,
-                     const VRegister& fm);
-  inline void Fmsub(const VRegister& fd, const VRegister& fn,
-                    const VRegister& fm, const VRegister& fa);
-  inline void Fnmadd(const VRegister& fd, const VRegister& fn,
-                     const VRegister& fm, const VRegister& fa);
-  inline void Fnmsub(const VRegister& fd, const VRegister& fn,
-                     const VRegister& fm, const VRegister& fa);
-  inline void Hint(SystemHint code);
-  inline void Hlt(int code);
-  inline void Isb();
-  inline void Ldnp(const CPURegister& rt, const CPURegister& rt2,
-                   const MemOperand& src);
-  inline void Movk(const Register& rd, uint64_t imm, int shift = -1);
-  inline void Msr(SystemRegister sysreg, const Register& rt);
-  inline void Nop() { nop(); }
-  void Mvni(const VRegister& vd, const int imm8, Shift shift = LSL,
-            const int shift_amount = 0) {
-    DCHECK(allow_macro_instructions());
-    mvni(vd, imm8, shift, shift_amount);
-  }
-  inline void Rev(const Register& rd, const Register& rn);
-  inline void Sbfiz(const Register& rd, const Register& rn, unsigned lsb,
-                    unsigned width);
-  inline void Smaddl(const Register& rd, const Register& rn, const Register& rm,
-                     const Register& ra);
-  inline void Smsubl(const Register& rd, const Register& rn, const Register& rm,
-                     const Register& ra);
-  inline void Smulh(const Register& rd, const Register& rn, const Register& rm);
-  inline void Stnp(const CPURegister& rt, const CPURegister& rt2,
-                   const MemOperand& dst);
-  inline void Umaddl(const Register& rd, const Register& rn, const Register& rm,
-                     const Register& ra);
-  inline void Umsubl(const Register& rd, const Register& rn, const Register& rm,
-                     const Register& ra);
-
-  void Cmle(const VRegister& vd, const VRegister& vn, int imm) {
-    DCHECK(allow_macro_instructions());
-    cmle(vd, vn, imm);
-  }
-  void Cmlt(const VRegister& vd, const VRegister& vn, int imm) {
-    DCHECK(allow_macro_instructions());
-    cmlt(vd, vn, imm);
-  }
-
-  void Ld1(const VRegister& vt, const MemOperand& src) {
-    DCHECK(allow_macro_instructions());
-    ld1(vt, src);
-  }
-  void Ld1(const VRegister& vt, const VRegister& vt2, const MemOperand& src) {
-    DCHECK(allow_macro_instructions());
-    ld1(vt, vt2, src);
-  }
-  void Ld1(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-           const MemOperand& src) {
-    DCHECK(allow_macro_instructions());
-    ld1(vt, vt2, vt3, src);
-  }
-  void Ld1(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-           const VRegister& vt4, const MemOperand& src) {
-    DCHECK(allow_macro_instructions());
-    ld1(vt, vt2, vt3, vt4, src);
-  }
-  void Ld1(const VRegister& vt, int lane, const MemOperand& src) {
-    DCHECK(allow_macro_instructions());
-    ld1(vt, lane, src);
-  }
-  void Ld1r(const VRegister& vt, const MemOperand& src) {
-    DCHECK(allow_macro_instructions());
-    ld1r(vt, src);
-  }
-  void Ld2(const VRegister& vt, const VRegister& vt2, const MemOperand& src) {
-    DCHECK(allow_macro_instructions());
-    ld2(vt, vt2, src);
-  }
-  void Ld2(const VRegister& vt, const VRegister& vt2, int lane,
-           const MemOperand& src) {
-    DCHECK(allow_macro_instructions());
-    ld2(vt, vt2, lane, src);
-  }
-  void Ld2r(const VRegister& vt, const VRegister& vt2, const MemOperand& src) {
-    DCHECK(allow_macro_instructions());
-    ld2r(vt, vt2, src);
-  }
-  void Ld3(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-           const MemOperand& src) {
-    DCHECK(allow_macro_instructions());
-    ld3(vt, vt2, vt3, src);
-  }
-  void Ld3(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-           int lane, const MemOperand& src) {
-    DCHECK(allow_macro_instructions());
-    ld3(vt, vt2, vt3, lane, src);
-  }
-  void Ld3r(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-            const MemOperand& src) {
-    DCHECK(allow_macro_instructions());
-    ld3r(vt, vt2, vt3, src);
-  }
-  void Ld4(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-           const VRegister& vt4, const MemOperand& src) {
-    DCHECK(allow_macro_instructions());
-    ld4(vt, vt2, vt3, vt4, src);
-  }
-  void Ld4(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-           const VRegister& vt4, int lane, const MemOperand& src) {
-    DCHECK(allow_macro_instructions());
-    ld4(vt, vt2, vt3, vt4, lane, src);
-  }
-  void Ld4r(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-            const VRegister& vt4, const MemOperand& src) {
-    DCHECK(allow_macro_instructions());
-    ld4r(vt, vt2, vt3, vt4, src);
-  }
-  void St1(const VRegister& vt, const MemOperand& dst) {
-    DCHECK(allow_macro_instructions());
-    st1(vt, dst);
-  }
-  void St1(const VRegister& vt, const VRegister& vt2, const MemOperand& dst) {
-    DCHECK(allow_macro_instructions());
-    st1(vt, vt2, dst);
-  }
-  void St1(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-           const MemOperand& dst) {
-    DCHECK(allow_macro_instructions());
-    st1(vt, vt2, vt3, dst);
-  }
-  void St1(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-           const VRegister& vt4, const MemOperand& dst) {
-    DCHECK(allow_macro_instructions());
-    st1(vt, vt2, vt3, vt4, dst);
-  }
-  void St1(const VRegister& vt, int lane, const MemOperand& dst) {
-    DCHECK(allow_macro_instructions());
-    st1(vt, lane, dst);
-  }
-  void St2(const VRegister& vt, const VRegister& vt2, const MemOperand& dst) {
-    DCHECK(allow_macro_instructions());
-    st2(vt, vt2, dst);
-  }
-  void St3(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-           const MemOperand& dst) {
-    DCHECK(allow_macro_instructions());
-    st3(vt, vt2, vt3, dst);
-  }
-  void St4(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-           const VRegister& vt4, const MemOperand& dst) {
-    DCHECK(allow_macro_instructions());
-    st4(vt, vt2, vt3, vt4, dst);
-  }
-  void St2(const VRegister& vt, const VRegister& vt2, int lane,
-           const MemOperand& dst) {
-    DCHECK(allow_macro_instructions());
-    st2(vt, vt2, lane, dst);
-  }
-  void St3(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-           int lane, const MemOperand& dst) {
-    DCHECK(allow_macro_instructions());
-    st3(vt, vt2, vt3, lane, dst);
-  }
-  void St4(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
-           const VRegister& vt4, int lane, const MemOperand& dst) {
-    DCHECK(allow_macro_instructions());
-    st4(vt, vt2, vt3, vt4, lane, dst);
-  }
-  void Tbx(const VRegister& vd, const VRegister& vn, const VRegister& vm) {
-    DCHECK(allow_macro_instructions());
-    tbx(vd, vn, vm);
-  }
-  void Tbx(const VRegister& vd, const VRegister& vn, const VRegister& vn2,
-           const VRegister& vm) {
-    DCHECK(allow_macro_instructions());
-    tbx(vd, vn, vn2, vm);
-  }
-  void Tbx(const VRegister& vd, const VRegister& vn, const VRegister& vn2,
-           const VRegister& vn3, const VRegister& vm) {
-    DCHECK(allow_macro_instructions());
-    tbx(vd, vn, vn2, vn3, vm);
-  }
-  void Tbx(const VRegister& vd, const VRegister& vn, const VRegister& vn2,
-           const VRegister& vn3, const VRegister& vn4, const VRegister& vm) {
-    DCHECK(allow_macro_instructions());
-    tbx(vd, vn, vn2, vn3, vn4, vm);
-  }
-
-  void LoadObject(Register result, Handle<Object> object);
-
-  inline void PushSizeRegList(RegList registers, unsigned reg_size,
-      CPURegister::RegisterType type = CPURegister::kRegister) {
-    PushCPURegList(CPURegList(type, reg_size, registers));
-  }
-  inline void PopSizeRegList(RegList registers, unsigned reg_size,
-      CPURegister::RegisterType type = CPURegister::kRegister) {
-    PopCPURegList(CPURegList(type, reg_size, registers));
-  }
-  inline void PushXRegList(RegList regs) {
-    PushSizeRegList(regs, kXRegSizeInBits);
-  }
-  inline void PopXRegList(RegList regs) {
-    PopSizeRegList(regs, kXRegSizeInBits);
-  }
-  inline void PushWRegList(RegList regs) {
-    PushSizeRegList(regs, kWRegSizeInBits);
-  }
-  inline void PopWRegList(RegList regs) {
-    PopSizeRegList(regs, kWRegSizeInBits);
-  }
-  inline void PushDRegList(RegList regs) {
-    PushSizeRegList(regs, kDRegSizeInBits, CPURegister::kVRegister);
-  }
-  inline void PopDRegList(RegList regs) {
-    PopSizeRegList(regs, kDRegSizeInBits, CPURegister::kVRegister);
-  }
-  inline void PushSRegList(RegList regs) {
-    PushSizeRegList(regs, kSRegSizeInBits, CPURegister::kVRegister);
-  }
-  inline void PopSRegList(RegList regs) {
-    PopSizeRegList(regs, kSRegSizeInBits, CPURegister::kVRegister);
-  }
-
-  // Push the specified register 'count' times.
-  void PushMultipleTimes(CPURegister src, Register count);
-
-  // Sometimes callers need to push or pop multiple registers in a way that is
-  // difficult to structure efficiently for fixed Push or Pop calls. This scope
-  // allows push requests to be queued up, then flushed at once. The
-  // MacroAssembler will try to generate the most efficient sequence required.
-  //
-  // Unlike the other Push and Pop macros, PushPopQueue can handle mixed sets of
-  // register sizes and types.
-  class PushPopQueue {
-   public:
-    explicit PushPopQueue(MacroAssembler* masm) : masm_(masm), size_(0) { }
-
-    ~PushPopQueue() {
-      DCHECK(queued_.empty());
-    }
-
-    void Queue(const CPURegister& rt) {
-      size_ += rt.SizeInBytes();
-      queued_.push_back(rt);
-    }
-
-    enum PreambleDirective {
-      WITH_PREAMBLE,
-      SKIP_PREAMBLE
-    };
-    void PushQueued(PreambleDirective preamble_directive = WITH_PREAMBLE);
-    void PopQueued();
-
-   private:
-    MacroAssembler* masm_;
-    int size_;
-    std::vector<CPURegister> queued_;
-  };
-
-  // Peek at a value on the stack, and put it in 'dst'. The offset is in bytes.
-  //
-  // If the current stack pointer (according to StackPointer()) is csp, then
-  // csp must be aligned to 16 bytes.
-  void Peek(const CPURegister& dst, const Operand& offset);
-
-  // Peek at two values on the stack, and put them in 'dst1' and 'dst2'. The
-  // values peeked will be adjacent, with the value in 'dst2' being from a
-  // higher address than 'dst1'. The offset is in bytes.
-  //
-  // If the current stack pointer (according to StackPointer()) is csp, then
-  // csp must be aligned to 16 bytes.
-  void PeekPair(const CPURegister& dst1, const CPURegister& dst2, int offset);
-
-  // Variants of Claim and Drop, where the 'count' parameter is a SMI held in a
-  // register.
-  inline void ClaimBySMI(const Register& count_smi,
-                         uint64_t unit_size = kXRegSize);
-  inline void DropBySMI(const Register& count_smi,
-                        uint64_t unit_size = kXRegSize);
-
-  // Compare a register with an operand, and branch to label depending on the
-  // condition. May corrupt the status flags.
-  inline void CompareAndBranch(const Register& lhs,
-                               const Operand& rhs,
-                               Condition cond,
-                               Label* label);
-
-  // Insert one or more instructions into the instruction stream that encode
-  // some caller-defined data. The instructions used will be executable with no
-  // side effects.
-  inline void InlineData(uint64_t data);
-
-  // Insert an instrumentation enable marker into the instruction stream.
-  inline void EnableInstrumentation();
-
-  // Insert an instrumentation disable marker into the instruction stream.
-  inline void DisableInstrumentation();
-
-  // Insert an instrumentation event marker into the instruction stream. These
-  // will be picked up by the instrumentation system to annotate an instruction
-  // profile. The argument marker_name must be a printable two character string;
-  // it will be encoded in the event marker.
-  inline void AnnotateInstrumentation(const char* marker_name);
-
-  // Preserve the callee-saved registers (as defined by AAPCS64).
-  //
-  // Higher-numbered registers are pushed before lower-numbered registers, and
-  // thus get higher addresses.
-  // Floating-point registers are pushed before general-purpose registers, and
-  // thus get higher addresses.
-  //
-  // Note that registers are not checked for invalid values. Use this method
-  // only if you know that the GC won't try to examine the values on the stack.
-  void PushCalleeSavedRegisters();
-
-  // Restore the callee-saved registers (as defined by AAPCS64).
-  //
-  // Higher-numbered registers are popped after lower-numbered registers, and
-  // thus come from higher addresses.
-  // Floating-point registers are popped after general-purpose registers, and
-  // thus come from higher addresses.
-  void PopCalleeSavedRegisters();
-
-  // Align csp for a frame, as per ActivationFrameAlignment, and make it the
-  // current stack pointer.
-  inline void AlignAndSetCSPForFrame();
-
-  // Helpers ------------------------------------------------------------------
-
-  static int SafepointRegisterStackIndex(int reg_code);
-
-  template<typename Field>
-  void DecodeField(Register dst, Register src) {
-    static const int shift = Field::kShift;
-    static const int setbits = CountSetBits(Field::kMask, 32);
-    Ubfx(dst, src, shift, setbits);
-  }
-
-  template<typename Field>
-  void DecodeField(Register reg) {
-    DecodeField<Field>(reg, reg);
-  }
-
-  // ---- SMI and Number Utilities ----
-
-  inline void SmiTag(Register dst, Register src);
-  inline void SmiTag(Register smi);
-  inline void SmiUntagToDouble(VRegister dst, Register src);
-  inline void SmiUntagToFloat(VRegister dst, Register src);
-
-  inline void JumpIfNotSmi(Register value, Label* not_smi_label);
-  inline void JumpIfBothSmi(Register value1, Register value2,
-                            Label* both_smi_label,
-                            Label* not_smi_label = nullptr);
-  inline void JumpIfEitherSmi(Register value1, Register value2,
-                              Label* either_smi_label,
-                              Label* not_smi_label = nullptr);
-  inline void JumpIfEitherNotSmi(Register value1,
-                                 Register value2,
-                                 Label* not_smi_label);
-  inline void JumpIfBothNotSmi(Register value1,
-                               Register value2,
-                               Label* not_smi_label);
-
-  // Abort execution if argument is a smi, enabled via --debug-code.
-  void AssertNotSmi(Register object,
-                    AbortReason reason = AbortReason::kOperandIsASmi);
-
-  inline void ObjectTag(Register tagged_obj, Register obj);
-  inline void ObjectUntag(Register untagged_obj, Register obj);
-
-  // Abort execution if argument is not a FixedArray, enabled via --debug-code.
-  void AssertFixedArray(Register object);
-
-  // Abort execution if argument is not a JSFunction, enabled via --debug-code.
-  void AssertFunction(Register object);
-
-  // Abort execution if argument is not a JSGeneratorObject (or subclass),
-  // enabled via --debug-code.
-  void AssertGeneratorObject(Register object);
-
-  // Abort execution if argument is not a JSBoundFunction,
-  // enabled via --debug-code.
-  void AssertBoundFunction(Register object);
-
-  // Abort execution if argument is not undefined or an AllocationSite, enabled
-  // via --debug-code.
-  void AssertUndefinedOrAllocationSite(Register object);
-
-  void JumpIfHeapNumber(Register object, Label* on_heap_number,
-                        SmiCheckType smi_check_type = DONT_DO_SMI_CHECK);
-  void JumpIfNotHeapNumber(Register object, Label* on_not_heap_number,
-                           SmiCheckType smi_check_type = DONT_DO_SMI_CHECK);
-
-  // Try to represent a double as a signed 64-bit int.
-  // This succeeds if the result compares equal to the input, so inputs of -0.0
-  // are represented as 0 and handled as a success.
-  //
-  // On output the Z flag is set if the operation was successful.
-  void TryRepresentDoubleAsInt64(Register as_int, VRegister value,
-                                 VRegister scratch_d,
-                                 Label* on_successful_conversion = nullptr,
-                                 Label* on_failed_conversion = nullptr) {
-    DCHECK(as_int.Is64Bits());
-    TryRepresentDoubleAsInt(as_int, value, scratch_d, on_successful_conversion,
-                            on_failed_conversion);
-  }
-
-  // ---- Calling / Jumping helpers ----
-
-  void CallStub(CodeStub* stub);
-  void TailCallStub(CodeStub* stub);
-
-  void CallRuntime(const Runtime::Function* f,
-                   int num_arguments,
-                   SaveFPRegsMode save_doubles = kDontSaveFPRegs);
-
-  // Convenience function: Same as above, but takes the fid instead.
-  void CallRuntime(Runtime::FunctionId fid, int num_arguments,
-                   SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
-    CallRuntime(Runtime::FunctionForId(fid), num_arguments, save_doubles);
-  }
-
-  // Convenience function: Same as above, but takes the fid instead.
-  void CallRuntime(Runtime::FunctionId fid,
-                   SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
-    const Runtime::Function* function = Runtime::FunctionForId(fid);
-    CallRuntime(function, function->nargs, save_doubles);
-  }
-
-  void TailCallRuntime(Runtime::FunctionId fid);
-
-  // Jump to a runtime routine.
-  void JumpToExternalReference(const ExternalReference& builtin,
-                               bool builtin_exit_frame = false);
-
-  // Registers used through the invocation chain are hard-coded.
-  // We force passing the parameters to ensure the contracts are correctly
-  // honoured by the caller.
-  // 'function' must be x1.
-  // 'actual' must use an immediate or x0.
-  // 'expected' must use an immediate or x2.
-  // 'call_kind' must be x5.
-  void InvokePrologue(const ParameterCount& expected,
-                      const ParameterCount& actual, Label* done,
-                      InvokeFlag flag, bool* definitely_mismatches);
-
-  // On function call, call into the debugger if necessary.
-  void CheckDebugHook(Register fun, Register new_target,
-                      const ParameterCount& expected,
-                      const ParameterCount& actual);
-  void InvokeFunctionCode(Register function, Register new_target,
-                          const ParameterCount& expected,
-                          const ParameterCount& actual, InvokeFlag flag);
-  // Invoke the JavaScript function in the given register.
-  // Changes the current context to the context in the function before invoking.
-  void InvokeFunction(Register function, Register new_target,
-                      const ParameterCount& actual, InvokeFlag flag);
-  void InvokeFunction(Register function, const ParameterCount& expected,
-                      const ParameterCount& actual, InvokeFlag flag);
-  void InvokeFunction(Handle<JSFunction> function,
-                      const ParameterCount& expected,
-                      const ParameterCount& actual, InvokeFlag flag);
-
-  // ---- Code generation helpers ----
-
-  // Frame restart support
-  void MaybeDropFrames();
-
-  // ---------------------------------------------------------------------------
-  // Support functions.
-
-  // Compare object type for heap object.  heap_object contains a non-Smi
-  // whose object type should be compared with the given type.  This both
-  // sets the flags and leaves the object type in the type_reg register.
-  // It leaves the map in the map register (unless the type_reg and map register
-  // are the same register).  It leaves the heap object in the heap_object
-  // register unless the heap_object register is the same register as one of the
-  // other registers.
-  void CompareObjectType(Register heap_object,
-                         Register map,
-                         Register type_reg,
-                         InstanceType type);
-
-
-  // Compare object type for heap object, and branch if equal (or not.)
-  // heap_object contains a non-Smi whose object type should be compared with
-  // the given type.  This both sets the flags and leaves the object type in
-  // the type_reg register. It leaves the map in the map register (unless the
-  // type_reg and map register are the same register).  It leaves the heap
-  // object in the heap_object register unless the heap_object register is the
-  // same register as one of the other registers.
-  void JumpIfObjectType(Register object,
-                        Register map,
-                        Register type_reg,
-                        InstanceType type,
-                        Label* if_cond_pass,
-                        Condition cond = eq);
-
-  // Compare instance type in a map.  map contains a valid map object whose
-  // object type should be compared with the given type.  This both
-  // sets the flags and leaves the object type in the type_reg register.
-  void CompareInstanceType(Register map,
-                           Register type_reg,
-                           InstanceType type);
-
-  // Load the elements kind field from a map, and return it in the result
-  // register.
-  void LoadElementsKindFromMap(Register result, Register map);
-
-  // Compare the object in a register to a value from the root list.
-  void CompareRoot(const Register& obj, Heap::RootListIndex index);
-
-  // Compare the object in a register to a value and jump if they are equal.
-  void JumpIfRoot(const Register& obj,
-                  Heap::RootListIndex index,
-                  Label* if_equal);
-
-  // Compare the object in a register to a value and jump if they are not equal.
-  void JumpIfNotRoot(const Register& obj,
-                     Heap::RootListIndex index,
-                     Label* if_not_equal);
-
-  // Compare the contents of a register with an operand, and branch to true,
-  // false or fall through, depending on condition.
-  void CompareAndSplit(const Register& lhs,
-                       const Operand& rhs,
-                       Condition cond,
-                       Label* if_true,
-                       Label* if_false,
-                       Label* fall_through);
-
-  // Test the bits of register defined by bit_pattern, and branch to
-  // if_any_set, if_all_clear or fall_through accordingly.
-  void TestAndSplit(const Register& reg,
-                    uint64_t bit_pattern,
-                    Label* if_all_clear,
-                    Label* if_any_set,
-                    Label* fall_through);
-
-  // ---------------------------------------------------------------------------
-  // Frames.
-
-  void ExitFramePreserveFPRegs();
-  void ExitFrameRestoreFPRegs();
-
-  // Enter exit frame. Exit frames are used when calling C code from generated
-  // (JavaScript) code.
-  //
-  // The only registers modified by this function are the provided scratch
-  // register, the frame pointer and the stack pointer.
-  //
-  // The 'extra_space' argument can be used to allocate some space in the exit
-  // frame that will be ignored by the GC. This space will be reserved in the
-  // bottom of the frame immediately above the return address slot.
-  //
-  // Set up a stack frame and registers as follows:
-  //         fp[8]: CallerPC (lr)
-  //   fp -> fp[0]: CallerFP (old fp)
-  //         fp[-8]: SPOffset (new csp)
-  //         fp[-16]: CodeObject()
-  //         fp[-16 - fp-size]: Saved doubles, if saved_doubles is true.
-  //         csp[8]: Memory reserved for the caller if extra_space != 0.
-  //                 Alignment padding, if necessary.
-  //  csp -> csp[0]: Space reserved for the return address.
-  //
-  // This function also stores the new frame information in the top frame, so
-  // that the new frame becomes the current frame.
-  void EnterExitFrame(bool save_doubles, const Register& scratch,
-                      int extra_space = 0,
-                      StackFrame::Type frame_type = StackFrame::EXIT);
-
-  // Leave the current exit frame, after a C function has returned to generated
-  // (JavaScript) code.
-  //
-  // This effectively unwinds the operation of EnterExitFrame:
-  //  * Preserved doubles are restored (if restore_doubles is true).
-  //  * The frame information is removed from the top frame.
-  //  * The exit frame is dropped.
-  //
-  // The stack pointer must be csp on entry.
-  void LeaveExitFrame(bool save_doubles, const Register& scratch,
-                      const Register& scratch2);
-
-  // Load the global proxy from the current context.
-  void LoadGlobalProxy(Register dst) {
-    LoadNativeContextSlot(Context::GLOBAL_PROXY_INDEX, dst);
-  }
-
-  // ---------------------------------------------------------------------------
-  // StatsCounter support
-
-  void IncrementCounter(StatsCounter* counter, int value, Register scratch1,
-                        Register scratch2);
-  void DecrementCounter(StatsCounter* counter, int value, Register scratch1,
-                        Register scratch2);
-
-  // ---------------------------------------------------------------------------
-  // Garbage collector support (GC).
-
-  // Push and pop the registers that can hold pointers, as defined by the
-  // RegList constant kSafepointSavedRegisters.
-  void PushSafepointRegisters();
-  void PopSafepointRegisters();
-
-  void CheckPageFlag(const Register& object, const Register& scratch, int mask,
-                     Condition cc, Label* condition_met);
-
-  // Notify the garbage collector that we wrote a pointer into an object.
-  // |object| is the object being stored into, |value| is the object being
-  // stored.  value and scratch registers are clobbered by the operation.
-  // The offset is the offset from the start of the object, not the offset from
-  // the tagged HeapObject pointer.  For use with FieldMemOperand(reg, off).
-  void RecordWriteField(
-      Register object, int offset, Register value, Register scratch,
-      LinkRegisterStatus lr_status, SaveFPRegsMode save_fp,
-      RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
-      SmiCheck smi_check = INLINE_SMI_CHECK);
-
-  // For a given |object| notify the garbage collector that the slot |address|
-  // has been written.  |value| is the object being stored. The value and
-  // address registers are clobbered by the operation.
-  void RecordWrite(
-      Register object, Register address, Register value,
-      LinkRegisterStatus lr_status, SaveFPRegsMode save_fp,
-      RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
-      SmiCheck smi_check = INLINE_SMI_CHECK);
-
-  // ---------------------------------------------------------------------------
-  // Debugging.
-
-  void AssertRegisterIsRoot(
-      Register reg, Heap::RootListIndex index,
-      AbortReason reason = AbortReason::kRegisterDidNotMatchExpectedRoot);
-
-  // Abort if the specified register contains the invalid color bit pattern.
-  // The pattern must be in bits [1:0] of 'reg' register.
-  //
-  // If emit_debug_code() is false, this emits no code.
-  void AssertHasValidColor(const Register& reg);
-
-  void LoadNativeContextSlot(int index, Register dst);
-
-  // Like printf, but print at run-time from generated code.
-  //
-  // The caller must ensure that arguments for floating-point placeholders
-  // (such as %e, %f or %g) are VRegisters, and that arguments for integer
-  // placeholders are Registers.
-  //
-  // At the moment it is only possible to print the value of csp if it is the
-  // current stack pointer. Otherwise, the MacroAssembler will automatically
-  // update csp on every push (using BumpSystemStackPointer), so determining its
-  // value is difficult.
-  //
-  // Format placeholders that refer to more than one argument, or to a specific
-  // argument, are not supported. This includes formats like "%1$d" or "%.*d".
-  //
-  // This function automatically preserves caller-saved registers so that
-  // calling code can use Printf at any point without having to worry about
-  // corruption. The preservation mechanism generates a lot of code. If this is
-  // a problem, preserve the important registers manually and then call
-  // PrintfNoPreserve. Callee-saved registers are not used by Printf, and are
-  // implicitly preserved.
-  void Printf(const char * format,
-              CPURegister arg0 = NoCPUReg,
-              CPURegister arg1 = NoCPUReg,
-              CPURegister arg2 = NoCPUReg,
-              CPURegister arg3 = NoCPUReg);
-
-  // Like Printf, but don't preserve any caller-saved registers, not even 'lr'.
-  //
-  // The return code from the system printf call will be returned in x0.
-  void PrintfNoPreserve(const char * format,
-                        const CPURegister& arg0 = NoCPUReg,
-                        const CPURegister& arg1 = NoCPUReg,
-                        const CPURegister& arg2 = NoCPUReg,
-                        const CPURegister& arg3 = NoCPUReg);
-
- private:
-  // Helper for implementing JumpIfNotInNewSpace and JumpIfInNewSpace.
-  void InNewSpace(Register object,
-                  Condition cond,  // eq for new space, ne otherwise.
-                  Label* branch);
-
-  // Try to represent a double as an int so that integer fast-paths may be
-  // used. Not every valid integer value is guaranteed to be caught.
-  // It supports both 32-bit and 64-bit integers depending whether 'as_int'
-  // is a W or X register.
-  //
-  // This does not distinguish between +0 and -0, so if this distinction is
-  // important it must be checked separately.
-  //
-  // On output the Z flag is set if the operation was successful.
-  void TryRepresentDoubleAsInt(Register as_int, VRegister value,
-                               VRegister scratch_d,
-                               Label* on_successful_conversion = nullptr,
-                               Label* on_failed_conversion = nullptr);
-
- public:
-  // Far branches resolving.
-  //
-  // The various classes of branch instructions with immediate offsets have
-  // different ranges. While the Assembler will fail to assemble a branch
-  // exceeding its range, the MacroAssembler offers a mechanism to resolve
-  // branches to too distant targets, either by tweaking the generated code to
-  // use branch instructions with wider ranges or generating veneers.
-  //
-  // Currently branches to distant targets are resolved using unconditional
-  // branch isntructions with a range of +-128MB. If that becomes too little
-  // (!), the mechanism can be extended to generate special veneers for really
-  // far targets.
-};
-
-
-// Use this scope when you need a one-to-one mapping between methods and
-// instructions. This scope prevents the MacroAssembler from being called and
-// literal pools from being emitted. It also asserts the number of instructions
-// emitted is what you specified when creating the scope.
-class InstructionAccurateScope BASE_EMBEDDED {
- public:
-  explicit InstructionAccurateScope(TurboAssembler* tasm, size_t count = 0)
-      : tasm_(tasm)
-#ifdef DEBUG
-        ,
-        size_(count * kInstructionSize)
-#endif
-  {
-    // Before blocking the const pool, see if it needs to be emitted.
-    tasm_->CheckConstPool(false, true);
-    tasm_->CheckVeneerPool(false, true);
-
-    tasm_->StartBlockPools();
-#ifdef DEBUG
-    if (count != 0) {
-      tasm_->bind(&start_);
-    }
-    previous_allow_macro_instructions_ = tasm_->allow_macro_instructions();
-    tasm_->set_allow_macro_instructions(false);
-#endif
-  }
-
-  ~InstructionAccurateScope() {
-    tasm_->EndBlockPools();
-#ifdef DEBUG
-    if (start_.is_bound()) {
-      DCHECK(tasm_->SizeOfCodeGeneratedSince(&start_) == size_);
-    }
-    tasm_->set_allow_macro_instructions(previous_allow_macro_instructions_);
-#endif
-  }
-
- private:
-  TurboAssembler* tasm_;
-#ifdef DEBUG
-  size_t size_;
-  Label start_;
-  bool previous_allow_macro_instructions_;
-#endif
-};
-
-// This scope utility allows scratch registers to be managed safely. The
-// TurboAssembler's TmpList() (and FPTmpList()) is used as a pool of scratch
-// registers. These registers can be allocated on demand, and will be returned
-// at the end of the scope.
-//
-// When the scope ends, the MacroAssembler's lists will be restored to their
-// original state, even if the lists were modified by some other means. Note
-// that this scope can be nested but the destructors need to run in the opposite
-// order as the constructors. We do not have assertions for this.
-class UseScratchRegisterScope {
- public:
-  explicit UseScratchRegisterScope(TurboAssembler* tasm)
-      : available_(tasm->TmpList()),
-        availablefp_(tasm->FPTmpList()),
-        old_available_(available_->list()),
-        old_availablefp_(availablefp_->list()) {
-    DCHECK_EQ(available_->type(), CPURegister::kRegister);
-    DCHECK_EQ(availablefp_->type(), CPURegister::kVRegister);
-  }
-
-  ~UseScratchRegisterScope();
-
-  // Take a register from the appropriate temps list. It will be returned
-  // automatically when the scope ends.
-  Register AcquireW() { return AcquireNextAvailable(available_).W(); }
-  Register AcquireX() { return AcquireNextAvailable(available_).X(); }
-  VRegister AcquireS() { return AcquireNextAvailable(availablefp_).S(); }
-  VRegister AcquireD() { return AcquireNextAvailable(availablefp_).D(); }
-  VRegister AcquireV(VectorFormat format) {
-    return VRegister::Create(AcquireNextAvailable(availablefp_).code(), format);
-  }
-
-  Register AcquireSameSizeAs(const Register& reg);
-  VRegister AcquireSameSizeAs(const VRegister& reg);
-
- private:
-  static CPURegister AcquireNextAvailable(CPURegList* available);
-
-  // Available scratch registers.
-  CPURegList* available_;     // kRegister
-  CPURegList* availablefp_;   // kVRegister
-
-  // The state of the available lists at the start of this scope.
-  RegList old_available_;     // kRegister
-  RegList old_availablefp_;   // kVRegister
-};
-
-MemOperand ContextMemOperand(Register context, int index = 0);
-MemOperand NativeContextMemOperand();
-
-// Encode and decode information about patchable inline SMI checks.
-class InlineSmiCheckInfo {
- public:
-  explicit InlineSmiCheckInfo(Address info);
-
-  bool HasSmiCheck() const { return smi_check_ != nullptr; }
-
-  const Register& SmiRegister() const {
-    return reg_;
-  }
-
-  Instruction* SmiCheck() const {
-    return smi_check_;
-  }
-
-  int SmiCheckDelta() const { return smi_check_delta_; }
-
-  // Use MacroAssembler::InlineData to emit information about patchable inline
-  // SMI checks. The caller may specify 'reg' as NoReg and an unbound 'site' to
-  // indicate that there is no inline SMI check. Note that 'reg' cannot be csp.
-  //
-  // The generated patch information can be read using the InlineSMICheckInfo
-  // class.
-  static void Emit(MacroAssembler* masm, const Register& reg,
-                   const Label* smi_check);
-
-  // Emit information to indicate that there is no inline SMI check.
-  static void EmitNotInlined(MacroAssembler* masm) {
-    Label unbound;
-    Emit(masm, NoReg, &unbound);
-  }
-
- private:
-  Register reg_;
-  int smi_check_delta_;
-  Instruction* smi_check_;
-
-  // Fields in the data encoded by InlineData.
-
-  // A width of 5 (Rd_width) for the SMI register preclues the use of csp,
-  // since kSPRegInternalCode is 63. However, csp should never hold a SMI or be
-  // used in a patchable check. The Emit() method checks this.
-  //
-  // Note that the total size of the fields is restricted by the underlying
-  // storage size handled by the BitField class, which is a uint32_t.
-  class RegisterBits : public BitField<unsigned, 0, 5> {};
-  class DeltaBits : public BitField<uint32_t, 5, 32-5> {};
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#define ACCESS_MASM(masm) masm->
-
-#endif  // V8_ARM64_MACRO_ASSEMBLER_ARM64_H_
diff --git a/src/v8/src/arm64/simulator-arm64.cc b/src/v8/src/arm64/simulator-arm64.cc
deleted file mode 100644
index d0c464d..0000000
--- a/src/v8/src/arm64/simulator-arm64.cc
+++ /dev/null
@@ -1,5866 +0,0 @@
-// Copyright 2013 the V8 project 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 <stdlib.h>
-#include <cmath>
-#include <cstdarg>
-#include <type_traits>
-
-#if V8_TARGET_ARCH_ARM64
-
-#include "src/arm64/decoder-arm64-inl.h"
-#include "src/arm64/simulator-arm64.h"
-#include "src/assembler-inl.h"
-#include "src/codegen.h"
-#include "src/disasm.h"
-#include "src/macro-assembler.h"
-#include "src/objects-inl.h"
-#include "src/ostreams.h"
-#include "src/runtime/runtime-utils.h"
-
-namespace v8 {
-namespace internal {
-
-#if defined(USE_SIMULATOR)
-
-
-// This macro provides a platform independent use of sscanf. The reason for
-// SScanF not being implemented in a platform independent way through
-// ::v8::internal::OS in the same way as SNPrintF is that the
-// Windows C Run-Time Library does not provide vsscanf.
-#define SScanF sscanf  // NOLINT
-
-
-// Helpers for colors.
-#define COLOUR(colour_code)       "\033[0;" colour_code "m"
-#define COLOUR_BOLD(colour_code)  "\033[1;" colour_code "m"
-#define NORMAL  ""
-#define GREY    "30"
-#define RED     "31"
-#define GREEN   "32"
-#define YELLOW  "33"
-#define BLUE    "34"
-#define MAGENTA "35"
-#define CYAN    "36"
-#define WHITE   "37"
-
-typedef char const * const TEXT_COLOUR;
-TEXT_COLOUR clr_normal         = FLAG_log_colour ? COLOUR(NORMAL)       : "";
-TEXT_COLOUR clr_flag_name      = FLAG_log_colour ? COLOUR_BOLD(WHITE)   : "";
-TEXT_COLOUR clr_flag_value     = FLAG_log_colour ? COLOUR(NORMAL)       : "";
-TEXT_COLOUR clr_reg_name       = FLAG_log_colour ? COLOUR_BOLD(CYAN)    : "";
-TEXT_COLOUR clr_reg_value      = FLAG_log_colour ? COLOUR(CYAN)         : "";
-TEXT_COLOUR clr_vreg_name = FLAG_log_colour ? COLOUR_BOLD(MAGENTA) : "";
-TEXT_COLOUR clr_vreg_value = FLAG_log_colour ? COLOUR(MAGENTA) : "";
-TEXT_COLOUR clr_memory_address = FLAG_log_colour ? COLOUR_BOLD(BLUE)    : "";
-TEXT_COLOUR clr_debug_number   = FLAG_log_colour ? COLOUR_BOLD(YELLOW)  : "";
-TEXT_COLOUR clr_debug_message  = FLAG_log_colour ? COLOUR(YELLOW)       : "";
-TEXT_COLOUR clr_printf         = FLAG_log_colour ? COLOUR(GREEN)        : "";
-
-// static
-base::LazyInstance<Simulator::GlobalMonitor>::type Simulator::global_monitor_ =
-    LAZY_INSTANCE_INITIALIZER;
-
-// This is basically the same as PrintF, with a guard for FLAG_trace_sim.
-void Simulator::TraceSim(const char* format, ...) {
-  if (FLAG_trace_sim) {
-    va_list arguments;
-    va_start(arguments, format);
-    base::OS::VFPrint(stream_, format, arguments);
-    va_end(arguments);
-  }
-}
-
-const Instruction* Simulator::kEndOfSimAddress = nullptr;
-
-void SimSystemRegister::SetBits(int msb, int lsb, uint32_t bits) {
-  int width = msb - lsb + 1;
-  DCHECK(is_uintn(bits, width) || is_intn(bits, width));
-
-  bits <<= lsb;
-  uint32_t mask = ((1 << width) - 1) << lsb;
-  DCHECK_EQ(mask & write_ignore_mask_, 0);
-
-  value_ = (value_ & ~mask) | (bits & mask);
-}
-
-
-SimSystemRegister SimSystemRegister::DefaultValueFor(SystemRegister id) {
-  switch (id) {
-    case NZCV:
-      return SimSystemRegister(0x00000000, NZCVWriteIgnoreMask);
-    case FPCR:
-      return SimSystemRegister(0x00000000, FPCRWriteIgnoreMask);
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-// Get the active Simulator for the current thread.
-Simulator* Simulator::current(Isolate* isolate) {
-  Isolate::PerIsolateThreadData* isolate_data =
-      isolate->FindOrAllocatePerThreadDataForThisThread();
-  DCHECK_NOT_NULL(isolate_data);
-
-  Simulator* sim = isolate_data->simulator();
-  if (sim == nullptr) {
-    if (FLAG_trace_sim || FLAG_log_instruction_stats || FLAG_debug_sim) {
-      sim = new Simulator(new Decoder<DispatchingDecoderVisitor>(), isolate);
-    } else {
-      sim = new Decoder<Simulator>();
-      sim->isolate_ = isolate;
-    }
-    isolate_data->set_simulator(sim);
-  }
-  return sim;
-}
-
-void Simulator::CallImpl(byte* entry, CallArgument* args) {
-  int index_x = 0;
-  int index_d = 0;
-
-  std::vector<int64_t> stack_args(0);
-  for (int i = 0; !args[i].IsEnd(); i++) {
-    CallArgument arg = args[i];
-    if (arg.IsX() && (index_x < 8)) {
-      set_xreg(index_x++, arg.bits());
-    } else if (arg.IsD() && (index_d < 8)) {
-      set_dreg_bits(index_d++, arg.bits());
-    } else {
-      DCHECK(arg.IsD() || arg.IsX());
-      stack_args.push_back(arg.bits());
-    }
-  }
-
-  // Process stack arguments, and make sure the stack is suitably aligned.
-  uintptr_t original_stack = sp();
-  uintptr_t entry_stack = original_stack -
-                          stack_args.size() * sizeof(stack_args[0]);
-  if (base::OS::ActivationFrameAlignment() != 0) {
-    entry_stack &= -base::OS::ActivationFrameAlignment();
-  }
-  char * stack = reinterpret_cast<char*>(entry_stack);
-  std::vector<int64_t>::const_iterator it;
-  for (it = stack_args.begin(); it != stack_args.end(); it++) {
-    memcpy(stack, &(*it), sizeof(*it));
-    stack += sizeof(*it);
-  }
-
-  DCHECK(reinterpret_cast<uintptr_t>(stack) <= original_stack);
-  set_sp(entry_stack);
-
-  // Call the generated code.
-  set_pc(entry);
-  set_lr(kEndOfSimAddress);
-  CheckPCSComplianceAndRun();
-
-  set_sp(original_stack);
-}
-
-void Simulator::CheckPCSComplianceAndRun() {
-  // Adjust JS-based stack limit to C-based stack limit.
-  isolate_->stack_guard()->AdjustStackLimitForSimulator();
-
-#ifdef DEBUG
-  DCHECK_EQ(kNumberOfCalleeSavedRegisters, kCalleeSaved.Count());
-  DCHECK_EQ(kNumberOfCalleeSavedVRegisters, kCalleeSavedV.Count());
-
-  int64_t saved_registers[kNumberOfCalleeSavedRegisters];
-  uint64_t saved_fpregisters[kNumberOfCalleeSavedVRegisters];
-
-  CPURegList register_list = kCalleeSaved;
-  CPURegList fpregister_list = kCalleeSavedV;
-
-  for (int i = 0; i < kNumberOfCalleeSavedRegisters; i++) {
-    // x31 is not a caller saved register, so no need to specify if we want
-    // the stack or zero.
-    saved_registers[i] = xreg(register_list.PopLowestIndex().code());
-  }
-  for (int i = 0; i < kNumberOfCalleeSavedVRegisters; i++) {
-    saved_fpregisters[i] =
-        dreg_bits(fpregister_list.PopLowestIndex().code());
-  }
-  int64_t original_stack = sp();
-#endif
-  // Start the simulation!
-  Run();
-#ifdef DEBUG
-  DCHECK_EQ(original_stack, sp());
-  // Check that callee-saved registers have been preserved.
-  register_list = kCalleeSaved;
-  fpregister_list = kCalleeSavedV;
-  for (int i = 0; i < kNumberOfCalleeSavedRegisters; i++) {
-    DCHECK_EQ(saved_registers[i], xreg(register_list.PopLowestIndex().code()));
-  }
-  for (int i = 0; i < kNumberOfCalleeSavedVRegisters; i++) {
-    DCHECK(saved_fpregisters[i] ==
-           dreg_bits(fpregister_list.PopLowestIndex().code()));
-  }
-
-  // Corrupt caller saved register minus the return regiters.
-
-  // In theory x0 to x7 can be used for return values, but V8 only uses x0, x1
-  // for now .
-  register_list = kCallerSaved;
-  register_list.Remove(x0);
-  register_list.Remove(x1);
-
-  // In theory d0 to d7 can be used for return values, but V8 only uses d0
-  // for now .
-  fpregister_list = kCallerSavedV;
-  fpregister_list.Remove(d0);
-
-  CorruptRegisters(&register_list, kCallerSavedRegisterCorruptionValue);
-  CorruptRegisters(&fpregister_list, kCallerSavedVRegisterCorruptionValue);
-#endif
-}
-
-
-#ifdef DEBUG
-// The least significant byte of the curruption value holds the corresponding
-// register's code.
-void Simulator::CorruptRegisters(CPURegList* list, uint64_t value) {
-  if (list->type() == CPURegister::kRegister) {
-    while (!list->IsEmpty()) {
-      unsigned code = list->PopLowestIndex().code();
-      set_xreg(code, value | code);
-    }
-  } else {
-    DCHECK_EQ(list->type(), CPURegister::kVRegister);
-    while (!list->IsEmpty()) {
-      unsigned code = list->PopLowestIndex().code();
-      set_dreg_bits(code, value | code);
-    }
-  }
-}
-
-
-void Simulator::CorruptAllCallerSavedCPURegisters() {
-  // Corrupt alters its parameter so copy them first.
-  CPURegList register_list = kCallerSaved;
-  CPURegList fpregister_list = kCallerSavedV;
-
-  CorruptRegisters(&register_list, kCallerSavedRegisterCorruptionValue);
-  CorruptRegisters(&fpregister_list, kCallerSavedVRegisterCorruptionValue);
-}
-#endif
-
-
-// Extending the stack by 2 * 64 bits is required for stack alignment purposes.
-uintptr_t Simulator::PushAddress(uintptr_t address) {
-  DCHECK(sizeof(uintptr_t) < 2 * kXRegSize);
-  intptr_t new_sp = sp() - 2 * kXRegSize;
-  uintptr_t* alignment_slot =
-    reinterpret_cast<uintptr_t*>(new_sp + kXRegSize);
-  memcpy(alignment_slot, &kSlotsZapValue, kPointerSize);
-  uintptr_t* stack_slot = reinterpret_cast<uintptr_t*>(new_sp);
-  memcpy(stack_slot, &address, kPointerSize);
-  set_sp(new_sp);
-  return new_sp;
-}
-
-
-uintptr_t Simulator::PopAddress() {
-  intptr_t current_sp = sp();
-  uintptr_t* stack_slot = reinterpret_cast<uintptr_t*>(current_sp);
-  uintptr_t address = *stack_slot;
-  DCHECK_LT(sizeof(uintptr_t), 2 * kXRegSize);
-  set_sp(current_sp + 2 * kXRegSize);
-  return address;
-}
-
-
-// Returns the limit of the stack area to enable checking for stack overflows.
-uintptr_t Simulator::StackLimit(uintptr_t c_limit) const {
-  // The simulator uses a separate JS stack. If we have exhausted the C stack,
-  // we also drop down the JS limit to reflect the exhaustion on the JS stack.
-  if (GetCurrentStackPosition() < c_limit) {
-    return reinterpret_cast<uintptr_t>(get_sp());
-  }
-
-  // Otherwise the limit is the JS stack. Leave a safety margin of 1024 bytes
-  // to prevent overrunning the stack when pushing values.
-  return stack_limit_ + 1024;
-}
-
-void Simulator::SetRedirectInstruction(Instruction* instruction) {
-  instruction->SetInstructionBits(
-      HLT | Assembler::ImmException(kImmExceptionIsRedirectedCall));
-}
-
-Simulator::Simulator(Decoder<DispatchingDecoderVisitor>* decoder,
-                     Isolate* isolate, FILE* stream)
-    : decoder_(decoder),
-      last_debugger_input_(nullptr),
-      log_parameters_(NO_PARAM),
-      isolate_(isolate) {
-  // Setup the decoder.
-  decoder_->AppendVisitor(this);
-
-  Init(stream);
-
-  if (FLAG_trace_sim) {
-    decoder_->InsertVisitorBefore(print_disasm_, this);
-    log_parameters_ = LOG_ALL;
-  }
-
-  if (FLAG_log_instruction_stats) {
-    instrument_ = new Instrument(FLAG_log_instruction_file,
-                                 FLAG_log_instruction_period);
-    decoder_->AppendVisitor(instrument_);
-  }
-}
-
-Simulator::Simulator()
-    : decoder_(nullptr),
-      last_debugger_input_(nullptr),
-      log_parameters_(NO_PARAM),
-      isolate_(nullptr) {
-  Init(stdout);
-  CHECK(!FLAG_trace_sim && !FLAG_log_instruction_stats);
-}
-
-
-void Simulator::Init(FILE* stream) {
-  ResetState();
-
-  // Allocate and setup the simulator stack.
-  stack_size_ = (FLAG_sim_stack_size * KB) + (2 * stack_protection_size_);
-  stack_ = reinterpret_cast<uintptr_t>(new byte[stack_size_]);
-  stack_limit_ = stack_ + stack_protection_size_;
-  uintptr_t tos = stack_ + stack_size_ - stack_protection_size_;
-  // The stack pointer must be 16-byte aligned.
-  set_sp(tos & ~0xFUL);
-
-  stream_ = stream;
-  print_disasm_ = new PrintDisassembler(stream_);
-
-  // The debugger needs to disassemble code without the simulator executing an
-  // instruction, so we create a dedicated decoder.
-  disassembler_decoder_ = new Decoder<DispatchingDecoderVisitor>();
-  disassembler_decoder_->AppendVisitor(print_disasm_);
-}
-
-
-void Simulator::ResetState() {
-  // Reset the system registers.
-  nzcv_ = SimSystemRegister::DefaultValueFor(NZCV);
-  fpcr_ = SimSystemRegister::DefaultValueFor(FPCR);
-
-  // Reset registers to 0.
-  pc_ = nullptr;
-  for (unsigned i = 0; i < kNumberOfRegisters; i++) {
-    set_xreg(i, 0xBADBEEF);
-  }
-  for (unsigned i = 0; i < kNumberOfVRegisters; i++) {
-    // Set FP registers to a value that is NaN in both 32-bit and 64-bit FP.
-    set_dreg_bits(i, 0x7FF000007F800001UL);
-  }
-  // Returning to address 0 exits the Simulator.
-  set_lr(kEndOfSimAddress);
-
-  // Reset debug helpers.
-  breakpoints_.empty();
-  break_on_next_ = false;
-}
-
-
-Simulator::~Simulator() {
-  global_monitor_.Pointer()->RemoveProcessor(&global_monitor_processor_);
-  delete[] reinterpret_cast<byte*>(stack_);
-  if (FLAG_log_instruction_stats) {
-    delete instrument_;
-  }
-  delete disassembler_decoder_;
-  delete print_disasm_;
-  DeleteArray(last_debugger_input_);
-  delete decoder_;
-}
-
-
-void Simulator::Run() {
-  // Flush any written registers before executing anything, so that
-  // manually-set registers are logged _before_ the first instruction.
-  LogAllWrittenRegisters();
-
-  pc_modified_ = false;
-  while (pc_ != kEndOfSimAddress) {
-    ExecuteInstruction();
-  }
-}
-
-
-void Simulator::RunFrom(Instruction* start) {
-  set_pc(start);
-  Run();
-}
-
-
-// Calls into the V8 runtime are based on this very simple interface.
-// Note: To be able to return two values from some calls the code in runtime.cc
-// uses the ObjectPair structure.
-// The simulator assumes all runtime calls return two 64-bits values. If they
-// don't, register x1 is clobbered. This is fine because x1 is caller-saved.
-typedef ObjectPair (*SimulatorRuntimeCall)(int64_t arg0, int64_t arg1,
-                                           int64_t arg2, int64_t arg3,
-                                           int64_t arg4, int64_t arg5,
-                                           int64_t arg6, int64_t arg7,
-                                           int64_t arg8);
-
-typedef int64_t (*SimulatorRuntimeCompareCall)(double arg1, double arg2);
-typedef double (*SimulatorRuntimeFPFPCall)(double arg1, double arg2);
-typedef double (*SimulatorRuntimeFPCall)(double arg1);
-typedef double (*SimulatorRuntimeFPIntCall)(double arg1, int32_t arg2);
-
-// This signature supports direct call in to API function native callback
-// (refer to InvocationCallback in v8.h).
-typedef void (*SimulatorRuntimeDirectApiCall)(int64_t arg0);
-typedef void (*SimulatorRuntimeProfilingApiCall)(int64_t arg0, void* arg1);
-
-// This signature supports direct call to accessor getter callback.
-typedef void (*SimulatorRuntimeDirectGetterCall)(int64_t arg0, int64_t arg1);
-typedef void (*SimulatorRuntimeProfilingGetterCall)(int64_t arg0, int64_t arg1,
-                                                    void* arg2);
-
-void Simulator::DoRuntimeCall(Instruction* instr) {
-  Redirection* redirection = Redirection::FromInstruction(instr);
-
-  // The called C code might itself call simulated code, so any
-  // caller-saved registers (including lr) could still be clobbered by a
-  // redirected call.
-  Instruction* return_address = lr();
-
-  int64_t external =
-      reinterpret_cast<int64_t>(redirection->external_function());
-
-  TraceSim("Call to host function at %p\n", redirection->external_function());
-
-  // SP must be 16-byte-aligned at the call interface.
-  bool stack_alignment_exception = ((sp() & 0xF) != 0);
-  if (stack_alignment_exception) {
-    TraceSim("  with unaligned stack 0x%016" PRIx64 ".\n", sp());
-    FATAL("ALIGNMENT EXCEPTION");
-  }
-
-  int64_t* stack_pointer = reinterpret_cast<int64_t*>(sp());
-
-  const int64_t arg0 = xreg(0);
-  const int64_t arg1 = xreg(1);
-  const int64_t arg2 = xreg(2);
-  const int64_t arg3 = xreg(3);
-  const int64_t arg4 = xreg(4);
-  const int64_t arg5 = xreg(5);
-  const int64_t arg6 = xreg(6);
-  const int64_t arg7 = xreg(7);
-  const int64_t arg8 = stack_pointer[0];
-  STATIC_ASSERT(kMaxCParameters == 9);
-
-  switch (redirection->type()) {
-    default:
-      TraceSim("Type: Unknown.\n");
-      UNREACHABLE();
-      break;
-
-    case ExternalReference::BUILTIN_CALL:
-    case ExternalReference::BUILTIN_CALL_PAIR: {
-      // Object* f(v8::internal::Arguments) or
-      // ObjectPair f(v8::internal::Arguments).
-      TraceSim("Type: BUILTIN_CALL\n");
-      SimulatorRuntimeCall target =
-        reinterpret_cast<SimulatorRuntimeCall>(external);
-
-      // We don't know how many arguments are being passed, but we can
-      // pass 8 without touching the stack. They will be ignored by the
-      // host function if they aren't used.
-      TraceSim(
-          "Arguments: "
-          "0x%016" PRIx64 ", 0x%016" PRIx64
-          ", "
-          "0x%016" PRIx64 ", 0x%016" PRIx64
-          ", "
-          "0x%016" PRIx64 ", 0x%016" PRIx64
-          ", "
-          "0x%016" PRIx64 ", 0x%016" PRIx64
-          ", "
-          "0x%016" PRIx64,
-          arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
-      ObjectPair result =
-          target(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
-      TraceSim("Returned: {%p, %p}\n", static_cast<void*>(result.x),
-               static_cast<void*>(result.y));
-#ifdef DEBUG
-      CorruptAllCallerSavedCPURegisters();
-#endif
-      set_xreg(0, reinterpret_cast<int64_t>(result.x));
-      set_xreg(1, reinterpret_cast<int64_t>(result.y));
-      break;
-    }
-
-    case ExternalReference::DIRECT_API_CALL: {
-      // void f(v8::FunctionCallbackInfo&)
-      TraceSim("Type: DIRECT_API_CALL\n");
-      SimulatorRuntimeDirectApiCall target =
-        reinterpret_cast<SimulatorRuntimeDirectApiCall>(external);
-      TraceSim("Arguments: 0x%016" PRIx64 "\n", xreg(0));
-      target(xreg(0));
-      TraceSim("No return value.");
-#ifdef DEBUG
-      CorruptAllCallerSavedCPURegisters();
-#endif
-      break;
-    }
-
-    case ExternalReference::BUILTIN_COMPARE_CALL: {
-      // int f(double, double)
-      TraceSim("Type: BUILTIN_COMPARE_CALL\n");
-      SimulatorRuntimeCompareCall target =
-        reinterpret_cast<SimulatorRuntimeCompareCall>(external);
-      TraceSim("Arguments: %f, %f\n", dreg(0), dreg(1));
-      int64_t result = target(dreg(0), dreg(1));
-      TraceSim("Returned: %" PRId64 "\n", result);
-#ifdef DEBUG
-      CorruptAllCallerSavedCPURegisters();
-#endif
-      set_xreg(0, result);
-      break;
-    }
-
-    case ExternalReference::BUILTIN_FP_CALL: {
-      // double f(double)
-      TraceSim("Type: BUILTIN_FP_CALL\n");
-      SimulatorRuntimeFPCall target =
-        reinterpret_cast<SimulatorRuntimeFPCall>(external);
-      TraceSim("Argument: %f\n", dreg(0));
-      double result = target(dreg(0));
-      TraceSim("Returned: %f\n", result);
-#ifdef DEBUG
-      CorruptAllCallerSavedCPURegisters();
-#endif
-      set_dreg(0, result);
-      break;
-    }
-
-    case ExternalReference::BUILTIN_FP_FP_CALL: {
-      // double f(double, double)
-      TraceSim("Type: BUILTIN_FP_FP_CALL\n");
-      SimulatorRuntimeFPFPCall target =
-        reinterpret_cast<SimulatorRuntimeFPFPCall>(external);
-      TraceSim("Arguments: %f, %f\n", dreg(0), dreg(1));
-      double result = target(dreg(0), dreg(1));
-      TraceSim("Returned: %f\n", result);
-#ifdef DEBUG
-      CorruptAllCallerSavedCPURegisters();
-#endif
-      set_dreg(0, result);
-      break;
-    }
-
-    case ExternalReference::BUILTIN_FP_INT_CALL: {
-      // double f(double, int)
-      TraceSim("Type: BUILTIN_FP_INT_CALL\n");
-      SimulatorRuntimeFPIntCall target =
-        reinterpret_cast<SimulatorRuntimeFPIntCall>(external);
-      TraceSim("Arguments: %f, %d\n", dreg(0), wreg(0));
-      double result = target(dreg(0), wreg(0));
-      TraceSim("Returned: %f\n", result);
-#ifdef DEBUG
-      CorruptAllCallerSavedCPURegisters();
-#endif
-      set_dreg(0, result);
-      break;
-    }
-
-    case ExternalReference::DIRECT_GETTER_CALL: {
-      // void f(Local<String> property, PropertyCallbackInfo& info)
-      TraceSim("Type: DIRECT_GETTER_CALL\n");
-      SimulatorRuntimeDirectGetterCall target =
-        reinterpret_cast<SimulatorRuntimeDirectGetterCall>(external);
-      TraceSim("Arguments: 0x%016" PRIx64 ", 0x%016" PRIx64 "\n",
-               xreg(0), xreg(1));
-      target(xreg(0), xreg(1));
-      TraceSim("No return value.");
-#ifdef DEBUG
-      CorruptAllCallerSavedCPURegisters();
-#endif
-      break;
-    }
-
-    case ExternalReference::PROFILING_API_CALL: {
-      // void f(v8::FunctionCallbackInfo&, v8::FunctionCallback)
-      TraceSim("Type: PROFILING_API_CALL\n");
-      SimulatorRuntimeProfilingApiCall target =
-        reinterpret_cast<SimulatorRuntimeProfilingApiCall>(external);
-      void* arg1 = Redirection::ReverseRedirection(xreg(1));
-      TraceSim("Arguments: 0x%016" PRIx64 ", %p\n", xreg(0), arg1);
-      target(xreg(0), arg1);
-      TraceSim("No return value.");
-#ifdef DEBUG
-      CorruptAllCallerSavedCPURegisters();
-#endif
-      break;
-    }
-
-    case ExternalReference::PROFILING_GETTER_CALL: {
-      // void f(Local<String> property, PropertyCallbackInfo& info,
-      //        AccessorNameGetterCallback callback)
-      TraceSim("Type: PROFILING_GETTER_CALL\n");
-      SimulatorRuntimeProfilingGetterCall target =
-        reinterpret_cast<SimulatorRuntimeProfilingGetterCall>(
-            external);
-      void* arg2 = Redirection::ReverseRedirection(xreg(2));
-      TraceSim("Arguments: 0x%016" PRIx64 ", 0x%016" PRIx64 ", %p\n",
-               xreg(0), xreg(1), arg2);
-      target(xreg(0), xreg(1), arg2);
-      TraceSim("No return value.");
-#ifdef DEBUG
-      CorruptAllCallerSavedCPURegisters();
-#endif
-      break;
-    }
-  }
-
-  set_lr(return_address);
-  set_pc(return_address);
-}
-
-const char* Simulator::xreg_names[] = {
-    "x0",  "x1",  "x2",  "x3",  "x4",  "x5",  "x6",  "x7",  "x8",
-    "x9",  "x10", "x11", "x12", "x13", "x14", "x15", "ip0", "ip1",
-    "x18", "x19", "x20", "x21", "x22", "x23", "x24", "x25", "x26",
-    "cp",  "x28", "fp",  "lr",  "xzr", "csp"};
-
-const char* Simulator::wreg_names[] = {
-    "w0",  "w1",  "w2",  "w3",  "w4",  "w5",  "w6",  "w7",  "w8",
-    "w9",  "w10", "w11", "w12", "w13", "w14", "w15", "w16", "w17",
-    "w18", "w19", "w20", "w21", "w22", "w23", "w24", "w25", "w26",
-    "wcp", "w28", "wfp", "wlr", "wzr", "wcsp"};
-
-const char* Simulator::sreg_names[] = {
-"s0",  "s1",  "s2",  "s3",  "s4",  "s5",  "s6",  "s7",
-"s8",  "s9",  "s10", "s11", "s12", "s13", "s14", "s15",
-"s16", "s17", "s18", "s19", "s20", "s21", "s22", "s23",
-"s24", "s25", "s26", "s27", "s28", "s29", "s30", "s31"};
-
-const char* Simulator::dreg_names[] = {
-"d0",  "d1",  "d2",  "d3",  "d4",  "d5",  "d6",  "d7",
-"d8",  "d9",  "d10", "d11", "d12", "d13", "d14", "d15",
-"d16", "d17", "d18", "d19", "d20", "d21", "d22", "d23",
-"d24", "d25", "d26", "d27", "d28", "d29", "d30", "d31"};
-
-const char* Simulator::vreg_names[] = {
-"v0",  "v1",  "v2",  "v3",  "v4",  "v5",  "v6",  "v7",
-"v8",  "v9",  "v10", "v11", "v12", "v13", "v14", "v15",
-"v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23",
-"v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31"};
-
-
-const char* Simulator::WRegNameForCode(unsigned code, Reg31Mode mode) {
-  static_assert(arraysize(Simulator::wreg_names) == (kNumberOfRegisters + 1),
-                "Array must be large enough to hold all register names.");
-  DCHECK_LT(code, static_cast<unsigned>(kNumberOfRegisters));
-  // The modulo operator has no effect here, but it silences a broken GCC
-  // warning about out-of-bounds array accesses.
-  code %= kNumberOfRegisters;
-
-  // If the code represents the stack pointer, index the name after zr.
-  if ((code == kZeroRegCode) && (mode == Reg31IsStackPointer)) {
-    code = kZeroRegCode + 1;
-  }
-  return wreg_names[code];
-}
-
-
-const char* Simulator::XRegNameForCode(unsigned code, Reg31Mode mode) {
-  static_assert(arraysize(Simulator::xreg_names) == (kNumberOfRegisters + 1),
-                "Array must be large enough to hold all register names.");
-  DCHECK_LT(code, static_cast<unsigned>(kNumberOfRegisters));
-  code %= kNumberOfRegisters;
-
-  // If the code represents the stack pointer, index the name after zr.
-  if ((code == kZeroRegCode) && (mode == Reg31IsStackPointer)) {
-    code = kZeroRegCode + 1;
-  }
-  return xreg_names[code];
-}
-
-
-const char* Simulator::SRegNameForCode(unsigned code) {
-  static_assert(arraysize(Simulator::sreg_names) == kNumberOfVRegisters,
-                "Array must be large enough to hold all register names.");
-  DCHECK_LT(code, static_cast<unsigned>(kNumberOfVRegisters));
-  return sreg_names[code % kNumberOfVRegisters];
-}
-
-
-const char* Simulator::DRegNameForCode(unsigned code) {
-  static_assert(arraysize(Simulator::dreg_names) == kNumberOfVRegisters,
-                "Array must be large enough to hold all register names.");
-  DCHECK_LT(code, static_cast<unsigned>(kNumberOfVRegisters));
-  return dreg_names[code % kNumberOfVRegisters];
-}
-
-
-const char* Simulator::VRegNameForCode(unsigned code) {
-  static_assert(arraysize(Simulator::vreg_names) == kNumberOfVRegisters,
-                "Array must be large enough to hold all register names.");
-  DCHECK_LT(code, static_cast<unsigned>(kNumberOfVRegisters));
-  return vreg_names[code % kNumberOfVRegisters];
-}
-
-void LogicVRegister::ReadUintFromMem(VectorFormat vform, int index,
-                                     uint64_t addr) const {
-  switch (LaneSizeInBitsFromFormat(vform)) {
-    case 8:
-      register_.Insert(index, SimMemory::Read<uint8_t>(addr));
-      break;
-    case 16:
-      register_.Insert(index, SimMemory::Read<uint16_t>(addr));
-      break;
-    case 32:
-      register_.Insert(index, SimMemory::Read<uint32_t>(addr));
-      break;
-    case 64:
-      register_.Insert(index, SimMemory::Read<uint64_t>(addr));
-      break;
-    default:
-      UNREACHABLE();
-      return;
-  }
-}
-
-void LogicVRegister::WriteUintToMem(VectorFormat vform, int index,
-                                    uint64_t addr) const {
-  switch (LaneSizeInBitsFromFormat(vform)) {
-    case 8:
-      SimMemory::Write<uint8_t>(addr, static_cast<uint8_t>(Uint(vform, index)));
-      break;
-    case 16:
-      SimMemory::Write<uint16_t>(addr,
-                                 static_cast<uint16_t>(Uint(vform, index)));
-      break;
-    case 32:
-      SimMemory::Write<uint32_t>(addr,
-                                 static_cast<uint32_t>(Uint(vform, index)));
-      break;
-    case 64:
-      SimMemory::Write<uint64_t>(addr, Uint(vform, index));
-      break;
-    default:
-      UNREACHABLE();
-      return;
-  }
-}
-
-
-int Simulator::CodeFromName(const char* name) {
-  for (unsigned i = 0; i < kNumberOfRegisters; i++) {
-    if ((strcmp(xreg_names[i], name) == 0) ||
-        (strcmp(wreg_names[i], name) == 0)) {
-      return i;
-    }
-  }
-  for (unsigned i = 0; i < kNumberOfVRegisters; i++) {
-    if ((strcmp(vreg_names[i], name) == 0) ||
-        (strcmp(dreg_names[i], name) == 0) ||
-        (strcmp(sreg_names[i], name) == 0)) {
-      return i;
-    }
-  }
-  if ((strcmp("csp", name) == 0) || (strcmp("wcsp", name) == 0)) {
-    return kSPRegInternalCode;
-  }
-  return -1;
-}
-
-
-// Helpers ---------------------------------------------------------------------
-template <typename T>
-T Simulator::AddWithCarry(bool set_flags, T left, T right, int carry_in) {
-  // Use unsigned types to avoid implementation-defined overflow behaviour.
-  static_assert(std::is_unsigned<T>::value, "operands must be unsigned");
-  static_assert((sizeof(T) == kWRegSize) || (sizeof(T) == kXRegSize),
-                "Only W- or X-sized operands are tested");
-
-  DCHECK((carry_in == 0) || (carry_in == 1));
-  T result = left + right + carry_in;
-
-  if (set_flags) {
-    nzcv().SetN(CalcNFlag(result));
-    nzcv().SetZ(CalcZFlag(result));
-
-    // Compute the C flag by comparing the result to the max unsigned integer.
-    T max_uint_2op = std::numeric_limits<T>::max() - carry_in;
-    nzcv().SetC((left > max_uint_2op) || ((max_uint_2op - left) < right));
-
-    // Overflow iff the sign bit is the same for the two inputs and different
-    // for the result.
-    T sign_mask = T(1) << (sizeof(T) * 8 - 1);
-    T left_sign = left & sign_mask;
-    T right_sign = right & sign_mask;
-    T result_sign = result & sign_mask;
-    nzcv().SetV((left_sign == right_sign) && (left_sign != result_sign));
-
-    LogSystemRegister(NZCV);
-  }
-  return result;
-}
-
-
-template<typename T>
-void Simulator::AddSubWithCarry(Instruction* instr) {
-  // Use unsigned types to avoid implementation-defined overflow behaviour.
-  static_assert(std::is_unsigned<T>::value, "operands must be unsigned");
-
-  T op2 = reg<T>(instr->Rm());
-  T new_val;
-
-  if ((instr->Mask(AddSubOpMask) == SUB) || instr->Mask(AddSubOpMask) == SUBS) {
-    op2 = ~op2;
-  }
-
-  new_val = AddWithCarry<T>(instr->FlagsUpdate(),
-                            reg<T>(instr->Rn()),
-                            op2,
-                            nzcv().C());
-
-  set_reg<T>(instr->Rd(), new_val);
-}
-
-template <typename T>
-T Simulator::ShiftOperand(T value, Shift shift_type, unsigned amount) {
-  typedef typename std::make_unsigned<T>::type unsignedT;
-
-  if (amount == 0) {
-    return value;
-  }
-
-  switch (shift_type) {
-    case LSL:
-      return value << amount;
-    case LSR:
-      return static_cast<unsignedT>(value) >> amount;
-    case ASR:
-      return value >> amount;
-    case ROR: {
-      unsignedT mask = (static_cast<unsignedT>(1) << amount) - 1;
-      return (static_cast<unsignedT>(value) >> amount) |
-             ((value & mask) << (sizeof(mask) * 8 - amount));
-    }
-    default:
-      UNIMPLEMENTED();
-      return 0;
-  }
-}
-
-
-template <typename T>
-T Simulator::ExtendValue(T value, Extend extend_type, unsigned left_shift) {
-  const unsigned kSignExtendBShift = (sizeof(T) - 1) * 8;
-  const unsigned kSignExtendHShift = (sizeof(T) - 2) * 8;
-  const unsigned kSignExtendWShift = (sizeof(T) - 4) * 8;
-
-  switch (extend_type) {
-    case UXTB:
-      value &= kByteMask;
-      break;
-    case UXTH:
-      value &= kHalfWordMask;
-      break;
-    case UXTW:
-      value &= kWordMask;
-      break;
-    case SXTB:
-      value = (value << kSignExtendBShift) >> kSignExtendBShift;
-      break;
-    case SXTH:
-      value = (value << kSignExtendHShift) >> kSignExtendHShift;
-      break;
-    case SXTW:
-      value = (value << kSignExtendWShift) >> kSignExtendWShift;
-      break;
-    case UXTX:
-    case SXTX:
-      break;
-    default:
-      UNREACHABLE();
-  }
-  return value << left_shift;
-}
-
-
-template <typename T>
-void Simulator::Extract(Instruction* instr) {
-  unsigned lsb = instr->ImmS();
-  T op2 = reg<T>(instr->Rm());
-  T result = op2;
-
-  if (lsb) {
-    T op1 = reg<T>(instr->Rn());
-    result = op2 >> lsb | (op1 << ((sizeof(T) * 8) - lsb));
-  }
-  set_reg<T>(instr->Rd(), result);
-}
-
-
-void Simulator::FPCompare(double val0, double val1) {
-  AssertSupportedFPCR();
-
-  // TODO(jbramley): This assumes that the C++ implementation handles
-  // comparisons in the way that we expect (as per AssertSupportedFPCR()).
-  if ((std::isnan(val0) != 0) || (std::isnan(val1) != 0)) {
-    nzcv().SetRawValue(FPUnorderedFlag);
-  } else if (val0 < val1) {
-    nzcv().SetRawValue(FPLessThanFlag);
-  } else if (val0 > val1) {
-    nzcv().SetRawValue(FPGreaterThanFlag);
-  } else if (val0 == val1) {
-    nzcv().SetRawValue(FPEqualFlag);
-  } else {
-    UNREACHABLE();
-  }
-  LogSystemRegister(NZCV);
-}
-
-Simulator::PrintRegisterFormat Simulator::GetPrintRegisterFormatForSize(
-    size_t reg_size, size_t lane_size) {
-  DCHECK_GE(reg_size, lane_size);
-
-  uint32_t format = 0;
-  if (reg_size != lane_size) {
-    switch (reg_size) {
-      default:
-        UNREACHABLE();
-      case kQRegSize:
-        format = kPrintRegAsQVector;
-        break;
-      case kDRegSize:
-        format = kPrintRegAsDVector;
-        break;
-    }
-  }
-
-  switch (lane_size) {
-    default:
-      UNREACHABLE();
-    case kQRegSize:
-      format |= kPrintReg1Q;
-      break;
-    case kDRegSize:
-      format |= kPrintReg1D;
-      break;
-    case kSRegSize:
-      format |= kPrintReg1S;
-      break;
-    case kHRegSize:
-      format |= kPrintReg1H;
-      break;
-    case kBRegSize:
-      format |= kPrintReg1B;
-      break;
-  }
-
-  // These sizes would be duplicate case labels.
-  static_assert(kXRegSize == kDRegSize, "X and D registers must be same size.");
-  static_assert(kWRegSize == kSRegSize, "W and S registers must be same size.");
-  static_assert(kPrintXReg == kPrintReg1D,
-                "X and D register printing code is shared.");
-  static_assert(kPrintWReg == kPrintReg1S,
-                "W and S register printing code is shared.");
-
-  return static_cast<PrintRegisterFormat>(format);
-}
-
-Simulator::PrintRegisterFormat Simulator::GetPrintRegisterFormat(
-    VectorFormat vform) {
-  switch (vform) {
-    default:
-      UNREACHABLE();
-    case kFormat16B:
-      return kPrintReg16B;
-    case kFormat8B:
-      return kPrintReg8B;
-    case kFormat8H:
-      return kPrintReg8H;
-    case kFormat4H:
-      return kPrintReg4H;
-    case kFormat4S:
-      return kPrintReg4S;
-    case kFormat2S:
-      return kPrintReg2S;
-    case kFormat2D:
-      return kPrintReg2D;
-    case kFormat1D:
-      return kPrintReg1D;
-
-    case kFormatB:
-      return kPrintReg1B;
-    case kFormatH:
-      return kPrintReg1H;
-    case kFormatS:
-      return kPrintReg1S;
-    case kFormatD:
-      return kPrintReg1D;
-  }
-}
-
-Simulator::PrintRegisterFormat Simulator::GetPrintRegisterFormatFP(
-    VectorFormat vform) {
-  switch (vform) {
-    default:
-      UNREACHABLE();
-    case kFormat4S:
-      return kPrintReg4SFP;
-    case kFormat2S:
-      return kPrintReg2SFP;
-    case kFormat2D:
-      return kPrintReg2DFP;
-    case kFormat1D:
-      return kPrintReg1DFP;
-
-    case kFormatS:
-      return kPrintReg1SFP;
-    case kFormatD:
-      return kPrintReg1DFP;
-  }
-}
-
-void Simulator::SetBreakpoint(Instruction* location) {
-  for (unsigned i = 0; i < breakpoints_.size(); i++) {
-    if (breakpoints_.at(i).location == location) {
-      PrintF(stream_,
-             "Existing breakpoint at %p was %s\n",
-             reinterpret_cast<void*>(location),
-             breakpoints_.at(i).enabled ? "disabled" : "enabled");
-      breakpoints_.at(i).enabled = !breakpoints_.at(i).enabled;
-      return;
-    }
-  }
-  Breakpoint new_breakpoint = {location, true};
-  breakpoints_.push_back(new_breakpoint);
-  PrintF(stream_,
-         "Set a breakpoint at %p\n", reinterpret_cast<void*>(location));
-}
-
-
-void Simulator::ListBreakpoints() {
-  PrintF(stream_, "Breakpoints:\n");
-  for (unsigned i = 0; i < breakpoints_.size(); i++) {
-    PrintF(stream_, "%p  : %s\n",
-           reinterpret_cast<void*>(breakpoints_.at(i).location),
-           breakpoints_.at(i).enabled ? "enabled" : "disabled");
-  }
-}
-
-
-void Simulator::CheckBreakpoints() {
-  bool hit_a_breakpoint = false;
-  for (unsigned i = 0; i < breakpoints_.size(); i++) {
-    if ((breakpoints_.at(i).location == pc_) &&
-        breakpoints_.at(i).enabled) {
-      hit_a_breakpoint = true;
-      // Disable this breakpoint.
-      breakpoints_.at(i).enabled = false;
-    }
-  }
-  if (hit_a_breakpoint) {
-    PrintF(stream_, "Hit and disabled a breakpoint at %p.\n",
-           reinterpret_cast<void*>(pc_));
-    Debug();
-  }
-}
-
-
-void Simulator::CheckBreakNext() {
-  // If the current instruction is a BL, insert a breakpoint just after it.
-  if (break_on_next_ && pc_->IsBranchAndLinkToRegister()) {
-    SetBreakpoint(pc_->following());
-    break_on_next_ = false;
-  }
-}
-
-
-void Simulator::PrintInstructionsAt(Instruction* start, uint64_t count) {
-  Instruction* end = start->InstructionAtOffset(count * kInstructionSize);
-  for (Instruction* pc = start; pc < end; pc = pc->following()) {
-    disassembler_decoder_->Decode(pc);
-  }
-}
-
-void Simulator::PrintWrittenRegisters() {
-  for (unsigned i = 0; i < kNumberOfRegisters; i++) {
-    if (registers_[i].WrittenSinceLastLog()) PrintRegister(i);
-  }
-}
-
-void Simulator::PrintWrittenVRegisters() {
-  for (unsigned i = 0; i < kNumberOfVRegisters; i++) {
-    // At this point there is no type information, so print as a raw 1Q.
-    if (vregisters_[i].WrittenSinceLastLog()) PrintVRegister(i, kPrintReg1Q);
-  }
-}
-
-void Simulator::PrintSystemRegisters() {
-  PrintSystemRegister(NZCV);
-  PrintSystemRegister(FPCR);
-}
-
-
-void Simulator::PrintRegisters() {
-  for (unsigned i = 0; i < kNumberOfRegisters; i++) {
-    PrintRegister(i);
-  }
-}
-
-void Simulator::PrintVRegisters() {
-  for (unsigned i = 0; i < kNumberOfVRegisters; i++) {
-    // At this point there is no type information, so print as a raw 1Q.
-    PrintVRegister(i, kPrintReg1Q);
-  }
-}
-
-
-void Simulator::PrintRegister(unsigned code, Reg31Mode r31mode) {
-  registers_[code].NotifyRegisterLogged();
-
-  // Don't print writes into xzr.
-  if ((code == kZeroRegCode) && (r31mode == Reg31IsZeroRegister)) {
-    return;
-  }
-
-  // The template for all x and w registers:
-  //   "# x{code}: 0x{value}"
-  //   "# w{code}: 0x{value}"
-
-  PrintRegisterRawHelper(code, r31mode);
-  fprintf(stream_, "\n");
-}
-
-// Print a register's name and raw value.
-//
-// The `bytes` and `lsb` arguments can be used to limit the bytes that are
-// printed. These arguments are intended for use in cases where register hasn't
-// actually been updated (such as in PrintVWrite).
-//
-// No newline is printed. This allows the caller to print more details (such as
-// a floating-point interpretation or a memory access annotation).
-void Simulator::PrintVRegisterRawHelper(unsigned code, int bytes, int lsb) {
-  // The template for vector types:
-  //   "# v{code}: 0xFFEEDDCCBBAA99887766554433221100".
-  // An example with bytes=4 and lsb=8:
-  //   "# v{code}:         0xBBAA9988                ".
-  fprintf(stream_, "# %s%5s: %s", clr_vreg_name, VRegNameForCode(code),
-          clr_vreg_value);
-
-  int msb = lsb + bytes - 1;
-  int byte = kQRegSize - 1;
-
-  // Print leading padding spaces. (Two spaces per byte.)
-  while (byte > msb) {
-    fprintf(stream_, "  ");
-    byte--;
-  }
-
-  // Print the specified part of the value, byte by byte.
-  qreg_t rawbits = qreg(code);
-  fprintf(stream_, "0x");
-  while (byte >= lsb) {
-    fprintf(stream_, "%02x", rawbits.val[byte]);
-    byte--;
-  }
-
-  // Print trailing padding spaces.
-  while (byte >= 0) {
-    fprintf(stream_, "  ");
-    byte--;
-  }
-  fprintf(stream_, "%s", clr_normal);
-}
-
-// Print each of the specified lanes of a register as a float or double value.
-//
-// The `lane_count` and `lslane` arguments can be used to limit the lanes that
-// are printed. These arguments are intended for use in cases where register
-// hasn't actually been updated (such as in PrintVWrite).
-//
-// No newline is printed. This allows the caller to print more details (such as
-// a memory access annotation).
-void Simulator::PrintVRegisterFPHelper(unsigned code,
-                                       unsigned lane_size_in_bytes,
-                                       int lane_count, int rightmost_lane) {
-  DCHECK((lane_size_in_bytes == kSRegSize) ||
-         (lane_size_in_bytes == kDRegSize));
-
-  unsigned msb = (lane_count + rightmost_lane) * lane_size_in_bytes;
-  DCHECK_LE(msb, static_cast<unsigned>(kQRegSize));
-
-  // For scalar types ((lane_count == 1) && (rightmost_lane == 0)), a register
-  // name is used:
-  //   " (s{code}: {value})"
-  //   " (d{code}: {value})"
-  // For vector types, "..." is used to represent one or more omitted lanes.
-  //   " (..., {value}, {value}, ...)"
-  if ((lane_count == 1) && (rightmost_lane == 0)) {
-    const char* name = (lane_size_in_bytes == kSRegSize)
-                           ? SRegNameForCode(code)
-                           : DRegNameForCode(code);
-    fprintf(stream_, " (%s%s: ", clr_vreg_name, name);
-  } else {
-    if (msb < (kQRegSize - 1)) {
-      fprintf(stream_, " (..., ");
-    } else {
-      fprintf(stream_, " (");
-    }
-  }
-
-  // Print the list of values.
-  const char* separator = "";
-  int leftmost_lane = rightmost_lane + lane_count - 1;
-  for (int lane = leftmost_lane; lane >= rightmost_lane; lane--) {
-    double value = (lane_size_in_bytes == kSRegSize)
-                       ? vreg(code).Get<float>(lane)
-                       : vreg(code).Get<double>(lane);
-    fprintf(stream_, "%s%s%#g%s", separator, clr_vreg_value, value, clr_normal);
-    separator = ", ";
-  }
-
-  if (rightmost_lane > 0) {
-    fprintf(stream_, ", ...");
-  }
-  fprintf(stream_, ")");
-}
-
-// Print a register's name and raw value.
-//
-// Only the least-significant `size_in_bytes` bytes of the register are printed,
-// but the value is aligned as if the whole register had been printed.
-//
-// For typical register updates, size_in_bytes should be set to kXRegSize
-// -- the default -- so that the whole register is printed. Other values of
-// size_in_bytes are intended for use when the register hasn't actually been
-// updated (such as in PrintWrite).
-//
-// No newline is printed. This allows the caller to print more details (such as
-// a memory access annotation).
-void Simulator::PrintRegisterRawHelper(unsigned code, Reg31Mode r31mode,
-                                       int size_in_bytes) {
-  // The template for all supported sizes.
-  //   "# x{code}: 0xFFEEDDCCBBAA9988"
-  //   "# w{code}:         0xBBAA9988"
-  //   "# w{code}<15:0>:       0x9988"
-  //   "# w{code}<7:0>:          0x88"
-  unsigned padding_chars = (kXRegSize - size_in_bytes) * 2;
-
-  const char* name = "";
-  const char* suffix = "";
-  switch (size_in_bytes) {
-    case kXRegSize:
-      name = XRegNameForCode(code, r31mode);
-      break;
-    case kWRegSize:
-      name = WRegNameForCode(code, r31mode);
-      break;
-    case 2:
-      name = WRegNameForCode(code, r31mode);
-      suffix = "<15:0>";
-      padding_chars -= strlen(suffix);
-      break;
-    case 1:
-      name = WRegNameForCode(code, r31mode);
-      suffix = "<7:0>";
-      padding_chars -= strlen(suffix);
-      break;
-    default:
-      UNREACHABLE();
-  }
-  fprintf(stream_, "# %s%5s%s: ", clr_reg_name, name, suffix);
-
-  // Print leading padding spaces.
-  DCHECK_LT(padding_chars, kXRegSize * 2U);
-  for (unsigned i = 0; i < padding_chars; i++) {
-    putc(' ', stream_);
-  }
-
-  // Print the specified bits in hexadecimal format.
-  uint64_t bits = reg<uint64_t>(code, r31mode);
-  bits &= kXRegMask >> ((kXRegSize - size_in_bytes) * 8);
-  static_assert(sizeof(bits) == kXRegSize,
-                "X registers and uint64_t must be the same size.");
-
-  int chars = size_in_bytes * 2;
-  fprintf(stream_, "%s0x%0*" PRIx64 "%s", clr_reg_value, chars, bits,
-          clr_normal);
-}
-
-void Simulator::PrintVRegister(unsigned code, PrintRegisterFormat format) {
-  vregisters_[code].NotifyRegisterLogged();
-
-  int lane_size_log2 = format & kPrintRegLaneSizeMask;
-
-  int reg_size_log2;
-  if (format & kPrintRegAsQVector) {
-    reg_size_log2 = kQRegSizeLog2;
-  } else if (format & kPrintRegAsDVector) {
-    reg_size_log2 = kDRegSizeLog2;
-  } else {
-    // Scalar types.
-    reg_size_log2 = lane_size_log2;
-  }
-
-  int lane_count = 1 << (reg_size_log2 - lane_size_log2);
-  int lane_size = 1 << lane_size_log2;
-
-  // The template for vector types:
-  //   "# v{code}: 0x{rawbits} (..., {value}, ...)".
-  // The template for scalar types:
-  //   "# v{code}: 0x{rawbits} ({reg}:{value})".
-  // The values in parentheses after the bit representations are floating-point
-  // interpretations. They are displayed only if the kPrintVRegAsFP bit is set.
-
-  PrintVRegisterRawHelper(code);
-  if (format & kPrintRegAsFP) {
-    PrintVRegisterFPHelper(code, lane_size, lane_count);
-  }
-
-  fprintf(stream_, "\n");
-}
-
-
-void Simulator::PrintSystemRegister(SystemRegister id) {
-  switch (id) {
-    case NZCV:
-      fprintf(stream_, "# %sNZCV: %sN:%d Z:%d C:%d V:%d%s\n",
-              clr_flag_name, clr_flag_value,
-              nzcv().N(), nzcv().Z(), nzcv().C(), nzcv().V(),
-              clr_normal);
-      break;
-    case FPCR: {
-      static const char * rmode[] = {
-        "0b00 (Round to Nearest)",
-        "0b01 (Round towards Plus Infinity)",
-        "0b10 (Round towards Minus Infinity)",
-        "0b11 (Round towards Zero)"
-      };
-      DCHECK(fpcr().RMode() < arraysize(rmode));
-      fprintf(stream_,
-              "# %sFPCR: %sAHP:%d DN:%d FZ:%d RMode:%s%s\n",
-              clr_flag_name, clr_flag_value,
-              fpcr().AHP(), fpcr().DN(), fpcr().FZ(), rmode[fpcr().RMode()],
-              clr_normal);
-      break;
-    }
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Simulator::PrintRead(uintptr_t address, unsigned reg_code,
-                          PrintRegisterFormat format) {
-  registers_[reg_code].NotifyRegisterLogged();
-
-  USE(format);
-
-  // The template is "# {reg}: 0x{value} <- {address}".
-  PrintRegisterRawHelper(reg_code, Reg31IsZeroRegister);
-  fprintf(stream_, " <- %s0x%016" PRIxPTR "%s\n",
-          clr_memory_address, address, clr_normal);
-}
-
-void Simulator::PrintVRead(uintptr_t address, unsigned reg_code,
-                           PrintRegisterFormat format, unsigned lane) {
-  vregisters_[reg_code].NotifyRegisterLogged();
-
-  // The template is "# v{code}: 0x{rawbits} <- address".
-  PrintVRegisterRawHelper(reg_code);
-  if (format & kPrintRegAsFP) {
-    PrintVRegisterFPHelper(reg_code, GetPrintRegLaneSizeInBytes(format),
-                           GetPrintRegLaneCount(format), lane);
-  }
-  fprintf(stream_, " <- %s0x%016" PRIxPTR "%s\n",
-          clr_memory_address, address, clr_normal);
-}
-
-void Simulator::PrintWrite(uintptr_t address, unsigned reg_code,
-                           PrintRegisterFormat format) {
-  DCHECK_EQ(GetPrintRegLaneCount(format), 1U);
-
-  // The template is "# v{code}: 0x{value} -> {address}". To keep the trace tidy
-  // and readable, the value is aligned with the values in the register trace.
-  PrintRegisterRawHelper(reg_code, Reg31IsZeroRegister,
-                         GetPrintRegSizeInBytes(format));
-  fprintf(stream_, " -> %s0x%016" PRIxPTR "%s\n",
-          clr_memory_address, address, clr_normal);
-}
-
-void Simulator::PrintVWrite(uintptr_t address, unsigned reg_code,
-                            PrintRegisterFormat format, unsigned lane) {
-  // The templates:
-  //   "# v{code}: 0x{rawbits} -> {address}"
-  //   "# v{code}: 0x{rawbits} (..., {value}, ...) -> {address}".
-  //   "# v{code}: 0x{rawbits} ({reg}:{value}) -> {address}"
-  // Because this trace doesn't represent a change to the source register's
-  // value, only the relevant part of the value is printed. To keep the trace
-  // tidy and readable, the raw value is aligned with the other values in the
-  // register trace.
-  int lane_count = GetPrintRegLaneCount(format);
-  int lane_size = GetPrintRegLaneSizeInBytes(format);
-  int reg_size = GetPrintRegSizeInBytes(format);
-  PrintVRegisterRawHelper(reg_code, reg_size, lane_size * lane);
-  if (format & kPrintRegAsFP) {
-    PrintVRegisterFPHelper(reg_code, lane_size, lane_count, lane);
-  }
-  fprintf(stream_, " -> %s0x%016" PRIxPTR "%s\n",
-          clr_memory_address, address, clr_normal);
-}
-
-
-// Visitors---------------------------------------------------------------------
-
-void Simulator::VisitUnimplemented(Instruction* instr) {
-  fprintf(stream_, "Unimplemented instruction at %p: 0x%08" PRIx32 "\n",
-          reinterpret_cast<void*>(instr), instr->InstructionBits());
-  UNIMPLEMENTED();
-}
-
-
-void Simulator::VisitUnallocated(Instruction* instr) {
-  fprintf(stream_, "Unallocated instruction at %p: 0x%08" PRIx32 "\n",
-          reinterpret_cast<void*>(instr), instr->InstructionBits());
-  UNIMPLEMENTED();
-}
-
-
-void Simulator::VisitPCRelAddressing(Instruction* instr) {
-  switch (instr->Mask(PCRelAddressingMask)) {
-    case ADR:
-      set_reg(instr->Rd(), instr->ImmPCOffsetTarget());
-      break;
-    case ADRP:  // Not implemented in the assembler.
-      UNIMPLEMENTED();
-      break;
-    default:
-      UNREACHABLE();
-      break;
-  }
-}
-
-
-void Simulator::VisitUnconditionalBranch(Instruction* instr) {
-  switch (instr->Mask(UnconditionalBranchMask)) {
-    case BL:
-      set_lr(instr->following());
-      // Fall through.
-    case B:
-      set_pc(instr->ImmPCOffsetTarget());
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-void Simulator::VisitConditionalBranch(Instruction* instr) {
-  DCHECK(instr->Mask(ConditionalBranchMask) == B_cond);
-  if (ConditionPassed(static_cast<Condition>(instr->ConditionBranch()))) {
-    set_pc(instr->ImmPCOffsetTarget());
-  }
-}
-
-
-void Simulator::VisitUnconditionalBranchToRegister(Instruction* instr) {
-  Instruction* target = reg<Instruction*>(instr->Rn());
-  switch (instr->Mask(UnconditionalBranchToRegisterMask)) {
-    case BLR: {
-      set_lr(instr->following());
-      if (instr->Rn() == 31) {
-        // BLR XZR is used as a guard for the constant pool. We should never hit
-        // this, but if we do trap to allow debugging.
-        Debug();
-      }
-      // Fall through.
-    }
-    case BR:
-    case RET: set_pc(target); break;
-    default: UNIMPLEMENTED();
-  }
-}
-
-
-void Simulator::VisitTestBranch(Instruction* instr) {
-  unsigned bit_pos = (instr->ImmTestBranchBit5() << 5) |
-                     instr->ImmTestBranchBit40();
-  bool take_branch = ((xreg(instr->Rt()) & (1UL << bit_pos)) == 0);
-  switch (instr->Mask(TestBranchMask)) {
-    case TBZ: break;
-    case TBNZ: take_branch = !take_branch; break;
-    default: UNIMPLEMENTED();
-  }
-  if (take_branch) {
-    set_pc(instr->ImmPCOffsetTarget());
-  }
-}
-
-
-void Simulator::VisitCompareBranch(Instruction* instr) {
-  unsigned rt = instr->Rt();
-  bool take_branch = false;
-  switch (instr->Mask(CompareBranchMask)) {
-    case CBZ_w: take_branch = (wreg(rt) == 0); break;
-    case CBZ_x: take_branch = (xreg(rt) == 0); break;
-    case CBNZ_w: take_branch = (wreg(rt) != 0); break;
-    case CBNZ_x: take_branch = (xreg(rt) != 0); break;
-    default: UNIMPLEMENTED();
-  }
-  if (take_branch) {
-    set_pc(instr->ImmPCOffsetTarget());
-  }
-}
-
-
-template<typename T>
-void Simulator::AddSubHelper(Instruction* instr, T op2) {
-  // Use unsigned types to avoid implementation-defined overflow behaviour.
-  static_assert(std::is_unsigned<T>::value, "operands must be unsigned");
-
-  bool set_flags = instr->FlagsUpdate();
-  T new_val = 0;
-  Instr operation = instr->Mask(AddSubOpMask);
-
-  switch (operation) {
-    case ADD:
-    case ADDS: {
-      new_val = AddWithCarry<T>(set_flags,
-                                reg<T>(instr->Rn(), instr->RnMode()),
-                                op2);
-      break;
-    }
-    case SUB:
-    case SUBS: {
-      new_val = AddWithCarry<T>(set_flags,
-                                reg<T>(instr->Rn(), instr->RnMode()),
-                                ~op2,
-                                1);
-      break;
-    }
-    default: UNREACHABLE();
-  }
-
-  set_reg<T>(instr->Rd(), new_val, instr->RdMode());
-}
-
-
-void Simulator::VisitAddSubShifted(Instruction* instr) {
-  Shift shift_type = static_cast<Shift>(instr->ShiftDP());
-  unsigned shift_amount = instr->ImmDPShift();
-
-  if (instr->SixtyFourBits()) {
-    uint64_t op2 = ShiftOperand(xreg(instr->Rm()), shift_type, shift_amount);
-    AddSubHelper(instr, op2);
-  } else {
-    uint32_t op2 = ShiftOperand(wreg(instr->Rm()), shift_type, shift_amount);
-    AddSubHelper(instr, op2);
-  }
-}
-
-
-void Simulator::VisitAddSubImmediate(Instruction* instr) {
-  int64_t op2 = instr->ImmAddSub() << ((instr->ShiftAddSub() == 1) ? 12 : 0);
-  if (instr->SixtyFourBits()) {
-    AddSubHelper(instr, static_cast<uint64_t>(op2));
-  } else {
-    AddSubHelper(instr, static_cast<uint32_t>(op2));
-  }
-}
-
-
-void Simulator::VisitAddSubExtended(Instruction* instr) {
-  Extend ext = static_cast<Extend>(instr->ExtendMode());
-  unsigned left_shift = instr->ImmExtendShift();
-  if (instr->SixtyFourBits()) {
-    uint64_t op2 = ExtendValue(xreg(instr->Rm()), ext, left_shift);
-    AddSubHelper(instr, op2);
-  } else {
-    uint32_t op2 = ExtendValue(wreg(instr->Rm()), ext, left_shift);
-    AddSubHelper(instr, op2);
-  }
-}
-
-
-void Simulator::VisitAddSubWithCarry(Instruction* instr) {
-  if (instr->SixtyFourBits()) {
-    AddSubWithCarry<uint64_t>(instr);
-  } else {
-    AddSubWithCarry<uint32_t>(instr);
-  }
-}
-
-
-void Simulator::VisitLogicalShifted(Instruction* instr) {
-  Shift shift_type = static_cast<Shift>(instr->ShiftDP());
-  unsigned shift_amount = instr->ImmDPShift();
-
-  if (instr->SixtyFourBits()) {
-    uint64_t op2 = ShiftOperand(xreg(instr->Rm()), shift_type, shift_amount);
-    op2 = (instr->Mask(NOT) == NOT) ? ~op2 : op2;
-    LogicalHelper(instr, op2);
-  } else {
-    uint32_t op2 = ShiftOperand(wreg(instr->Rm()), shift_type, shift_amount);
-    op2 = (instr->Mask(NOT) == NOT) ? ~op2 : op2;
-    LogicalHelper(instr, op2);
-  }
-}
-
-
-void Simulator::VisitLogicalImmediate(Instruction* instr) {
-  if (instr->SixtyFourBits()) {
-    LogicalHelper(instr, static_cast<uint64_t>(instr->ImmLogical()));
-  } else {
-    LogicalHelper(instr, static_cast<uint32_t>(instr->ImmLogical()));
-  }
-}
-
-
-template<typename T>
-void Simulator::LogicalHelper(Instruction* instr, T op2) {
-  T op1 = reg<T>(instr->Rn());
-  T result = 0;
-  bool update_flags = false;
-
-  // Switch on the logical operation, stripping out the NOT bit, as it has a
-  // different meaning for logical immediate instructions.
-  switch (instr->Mask(LogicalOpMask & ~NOT)) {
-    case ANDS: update_flags = true;  // Fall through.
-    case AND: result = op1 & op2; break;
-    case ORR: result = op1 | op2; break;
-    case EOR: result = op1 ^ op2; break;
-    default:
-      UNIMPLEMENTED();
-  }
-
-  if (update_flags) {
-    nzcv().SetN(CalcNFlag(result));
-    nzcv().SetZ(CalcZFlag(result));
-    nzcv().SetC(0);
-    nzcv().SetV(0);
-    LogSystemRegister(NZCV);
-  }
-
-  set_reg<T>(instr->Rd(), result, instr->RdMode());
-}
-
-
-void Simulator::VisitConditionalCompareRegister(Instruction* instr) {
-  if (instr->SixtyFourBits()) {
-    ConditionalCompareHelper(instr, static_cast<uint64_t>(xreg(instr->Rm())));
-  } else {
-    ConditionalCompareHelper(instr, static_cast<uint32_t>(wreg(instr->Rm())));
-  }
-}
-
-
-void Simulator::VisitConditionalCompareImmediate(Instruction* instr) {
-  if (instr->SixtyFourBits()) {
-    ConditionalCompareHelper(instr, static_cast<uint64_t>(instr->ImmCondCmp()));
-  } else {
-    ConditionalCompareHelper(instr, static_cast<uint32_t>(instr->ImmCondCmp()));
-  }
-}
-
-
-template<typename T>
-void Simulator::ConditionalCompareHelper(Instruction* instr, T op2) {
-  // Use unsigned types to avoid implementation-defined overflow behaviour.
-  static_assert(std::is_unsigned<T>::value, "operands must be unsigned");
-
-  T op1 = reg<T>(instr->Rn());
-
-  if (ConditionPassed(static_cast<Condition>(instr->Condition()))) {
-    // If the condition passes, set the status flags to the result of comparing
-    // the operands.
-    if (instr->Mask(ConditionalCompareMask) == CCMP) {
-      AddWithCarry<T>(true, op1, ~op2, 1);
-    } else {
-      DCHECK(instr->Mask(ConditionalCompareMask) == CCMN);
-      AddWithCarry<T>(true, op1, op2, 0);
-    }
-  } else {
-    // If the condition fails, set the status flags to the nzcv immediate.
-    nzcv().SetFlags(instr->Nzcv());
-    LogSystemRegister(NZCV);
-  }
-}
-
-
-void Simulator::VisitLoadStoreUnsignedOffset(Instruction* instr) {
-  int offset = instr->ImmLSUnsigned() << instr->SizeLS();
-  LoadStoreHelper(instr, offset, Offset);
-}
-
-
-void Simulator::VisitLoadStoreUnscaledOffset(Instruction* instr) {
-  LoadStoreHelper(instr, instr->ImmLS(), Offset);
-}
-
-
-void Simulator::VisitLoadStorePreIndex(Instruction* instr) {
-  LoadStoreHelper(instr, instr->ImmLS(), PreIndex);
-}
-
-
-void Simulator::VisitLoadStorePostIndex(Instruction* instr) {
-  LoadStoreHelper(instr, instr->ImmLS(), PostIndex);
-}
-
-
-void Simulator::VisitLoadStoreRegisterOffset(Instruction* instr) {
-  Extend ext = static_cast<Extend>(instr->ExtendMode());
-  DCHECK((ext == UXTW) || (ext == UXTX) || (ext == SXTW) || (ext == SXTX));
-  unsigned shift_amount = instr->ImmShiftLS() * instr->SizeLS();
-
-  int64_t offset = ExtendValue(xreg(instr->Rm()), ext, shift_amount);
-  LoadStoreHelper(instr, offset, Offset);
-}
-
-
-void Simulator::LoadStoreHelper(Instruction* instr,
-                                int64_t offset,
-                                AddrMode addrmode) {
-  unsigned srcdst = instr->Rt();
-  unsigned addr_reg = instr->Rn();
-  uintptr_t address = LoadStoreAddress(addr_reg, offset, addrmode);
-  uintptr_t stack = 0;
-
-  {
-    base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-    if (instr->IsLoad()) {
-      local_monitor_.NotifyLoad();
-    } else {
-      local_monitor_.NotifyStore();
-      global_monitor_.Pointer()->NotifyStore_Locked(&global_monitor_processor_);
-    }
-  }
-
-  // Handle the writeback for stores before the store. On a CPU the writeback
-  // and the store are atomic, but when running on the simulator it is possible
-  // to be interrupted in between. The simulator is not thread safe and V8 does
-  // not require it to be to run JavaScript therefore the profiler may sample
-  // the "simulated" CPU in the middle of load/store with writeback. The code
-  // below ensures that push operations are safe even when interrupted: the
-  // stack pointer will be decremented before adding an element to the stack.
-  if (instr->IsStore()) {
-    LoadStoreWriteBack(addr_reg, offset, addrmode);
-
-    // For store the address post writeback is used to check access below the
-    // stack.
-    stack = sp();
-  }
-
-  LoadStoreOp op = static_cast<LoadStoreOp>(instr->Mask(LoadStoreMask));
-  switch (op) {
-    // Use _no_log variants to suppress the register trace (LOG_REGS,
-    // LOG_VREGS). We will print a more detailed log.
-    case LDRB_w:  set_wreg_no_log(srcdst, MemoryRead<uint8_t>(address)); break;
-    case LDRH_w:  set_wreg_no_log(srcdst, MemoryRead<uint16_t>(address)); break;
-    case LDR_w:   set_wreg_no_log(srcdst, MemoryRead<uint32_t>(address)); break;
-    case LDR_x:   set_xreg_no_log(srcdst, MemoryRead<uint64_t>(address)); break;
-    case LDRSB_w: set_wreg_no_log(srcdst, MemoryRead<int8_t>(address)); break;
-    case LDRSH_w: set_wreg_no_log(srcdst, MemoryRead<int16_t>(address)); break;
-    case LDRSB_x: set_xreg_no_log(srcdst, MemoryRead<int8_t>(address)); break;
-    case LDRSH_x: set_xreg_no_log(srcdst, MemoryRead<int16_t>(address)); break;
-    case LDRSW_x: set_xreg_no_log(srcdst, MemoryRead<int32_t>(address)); break;
-    case LDR_b:
-      set_breg_no_log(srcdst, MemoryRead<uint8_t>(address));
-      break;
-    case LDR_h:
-      set_hreg_no_log(srcdst, MemoryRead<uint16_t>(address));
-      break;
-    case LDR_s:   set_sreg_no_log(srcdst, MemoryRead<float>(address)); break;
-    case LDR_d:   set_dreg_no_log(srcdst, MemoryRead<double>(address)); break;
-    case LDR_q:
-      set_qreg_no_log(srcdst, MemoryRead<qreg_t>(address));
-      break;
-
-    case STRB_w:  MemoryWrite<uint8_t>(address, wreg(srcdst)); break;
-    case STRH_w:  MemoryWrite<uint16_t>(address, wreg(srcdst)); break;
-    case STR_w:   MemoryWrite<uint32_t>(address, wreg(srcdst)); break;
-    case STR_x:   MemoryWrite<uint64_t>(address, xreg(srcdst)); break;
-    case STR_b:
-      MemoryWrite<uint8_t>(address, breg(srcdst));
-      break;
-    case STR_h:
-      MemoryWrite<uint16_t>(address, hreg(srcdst));
-      break;
-    case STR_s:   MemoryWrite<float>(address, sreg(srcdst)); break;
-    case STR_d:   MemoryWrite<double>(address, dreg(srcdst)); break;
-    case STR_q:
-      MemoryWrite<qreg_t>(address, qreg(srcdst));
-      break;
-
-    default: UNIMPLEMENTED();
-  }
-
-  // Print a detailed trace (including the memory address) instead of the basic
-  // register:value trace generated by set_*reg().
-  unsigned access_size = 1 << instr->SizeLS();
-  if (instr->IsLoad()) {
-    if ((op == LDR_s) || (op == LDR_d)) {
-      LogVRead(address, srcdst, GetPrintRegisterFormatForSizeFP(access_size));
-    } else if ((op == LDR_b) || (op == LDR_h) || (op == LDR_q)) {
-      LogVRead(address, srcdst, GetPrintRegisterFormatForSize(access_size));
-    } else {
-      LogRead(address, srcdst, GetPrintRegisterFormatForSize(access_size));
-    }
-  } else {
-    if ((op == STR_s) || (op == STR_d)) {
-      LogVWrite(address, srcdst, GetPrintRegisterFormatForSizeFP(access_size));
-    } else if ((op == STR_b) || (op == STR_h) || (op == STR_q)) {
-      LogVWrite(address, srcdst, GetPrintRegisterFormatForSize(access_size));
-    } else {
-      LogWrite(address, srcdst, GetPrintRegisterFormatForSize(access_size));
-    }
-  }
-
-  // Handle the writeback for loads after the load to ensure safe pop
-  // operation even when interrupted in the middle of it. The stack pointer
-  // is only updated after the load so pop(fp) will never break the invariant
-  // sp <= fp expected while walking the stack in the sampler.
-  if (instr->IsLoad()) {
-    // For loads the address pre writeback is used to check access below the
-    // stack.
-    stack = sp();
-
-    LoadStoreWriteBack(addr_reg, offset, addrmode);
-  }
-
-  // Accesses below the stack pointer (but above the platform stack limit) are
-  // not allowed in the ABI.
-  CheckMemoryAccess(address, stack);
-}
-
-
-void Simulator::VisitLoadStorePairOffset(Instruction* instr) {
-  LoadStorePairHelper(instr, Offset);
-}
-
-
-void Simulator::VisitLoadStorePairPreIndex(Instruction* instr) {
-  LoadStorePairHelper(instr, PreIndex);
-}
-
-
-void Simulator::VisitLoadStorePairPostIndex(Instruction* instr) {
-  LoadStorePairHelper(instr, PostIndex);
-}
-
-
-void Simulator::LoadStorePairHelper(Instruction* instr,
-                                    AddrMode addrmode) {
-  unsigned rt = instr->Rt();
-  unsigned rt2 = instr->Rt2();
-  unsigned addr_reg = instr->Rn();
-  size_t access_size = 1 << instr->SizeLSPair();
-  int64_t offset = instr->ImmLSPair() * access_size;
-  uintptr_t address = LoadStoreAddress(addr_reg, offset, addrmode);
-  uintptr_t address2 = address + access_size;
-  uintptr_t stack = 0;
-
-  {
-    base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-    if (instr->IsLoad()) {
-      local_monitor_.NotifyLoad();
-    } else {
-      local_monitor_.NotifyStore();
-      global_monitor_.Pointer()->NotifyStore_Locked(&global_monitor_processor_);
-    }
-  }
-
-  // Handle the writeback for stores before the store. On a CPU the writeback
-  // and the store are atomic, but when running on the simulator it is possible
-  // to be interrupted in between. The simulator is not thread safe and V8 does
-  // not require it to be to run JavaScript therefore the profiler may sample
-  // the "simulated" CPU in the middle of load/store with writeback. The code
-  // below ensures that push operations are safe even when interrupted: the
-  // stack pointer will be decremented before adding an element to the stack.
-  if (instr->IsStore()) {
-    LoadStoreWriteBack(addr_reg, offset, addrmode);
-
-    // For store the address post writeback is used to check access below the
-    // stack.
-    stack = sp();
-  }
-
-  LoadStorePairOp op =
-    static_cast<LoadStorePairOp>(instr->Mask(LoadStorePairMask));
-
-  // 'rt' and 'rt2' can only be aliased for stores.
-  DCHECK(((op & LoadStorePairLBit) == 0) || (rt != rt2));
-
-  switch (op) {
-    // Use _no_log variants to suppress the register trace (LOG_REGS,
-    // LOG_VREGS). We will print a more detailed log.
-    case LDP_w: {
-      DCHECK_EQ(access_size, static_cast<unsigned>(kWRegSize));
-      set_wreg_no_log(rt, MemoryRead<uint32_t>(address));
-      set_wreg_no_log(rt2, MemoryRead<uint32_t>(address2));
-      break;
-    }
-    case LDP_s: {
-      DCHECK_EQ(access_size, static_cast<unsigned>(kSRegSize));
-      set_sreg_no_log(rt, MemoryRead<float>(address));
-      set_sreg_no_log(rt2, MemoryRead<float>(address2));
-      break;
-    }
-    case LDP_x: {
-      DCHECK_EQ(access_size, static_cast<unsigned>(kXRegSize));
-      set_xreg_no_log(rt, MemoryRead<uint64_t>(address));
-      set_xreg_no_log(rt2, MemoryRead<uint64_t>(address2));
-      break;
-    }
-    case LDP_d: {
-      DCHECK_EQ(access_size, static_cast<unsigned>(kDRegSize));
-      set_dreg_no_log(rt, MemoryRead<double>(address));
-      set_dreg_no_log(rt2, MemoryRead<double>(address2));
-      break;
-    }
-    case LDP_q: {
-      DCHECK_EQ(access_size, static_cast<unsigned>(kQRegSize));
-      set_qreg(rt, MemoryRead<qreg_t>(address), NoRegLog);
-      set_qreg(rt2, MemoryRead<qreg_t>(address2), NoRegLog);
-      break;
-    }
-    case LDPSW_x: {
-      DCHECK_EQ(access_size, static_cast<unsigned>(kWRegSize));
-      set_xreg_no_log(rt, MemoryRead<int32_t>(address));
-      set_xreg_no_log(rt2, MemoryRead<int32_t>(address2));
-      break;
-    }
-    case STP_w: {
-      DCHECK_EQ(access_size, static_cast<unsigned>(kWRegSize));
-      MemoryWrite<uint32_t>(address, wreg(rt));
-      MemoryWrite<uint32_t>(address2, wreg(rt2));
-      break;
-    }
-    case STP_s: {
-      DCHECK_EQ(access_size, static_cast<unsigned>(kSRegSize));
-      MemoryWrite<float>(address, sreg(rt));
-      MemoryWrite<float>(address2, sreg(rt2));
-      break;
-    }
-    case STP_x: {
-      DCHECK_EQ(access_size, static_cast<unsigned>(kXRegSize));
-      MemoryWrite<uint64_t>(address, xreg(rt));
-      MemoryWrite<uint64_t>(address2, xreg(rt2));
-      break;
-    }
-    case STP_d: {
-      DCHECK_EQ(access_size, static_cast<unsigned>(kDRegSize));
-      MemoryWrite<double>(address, dreg(rt));
-      MemoryWrite<double>(address2, dreg(rt2));
-      break;
-    }
-    case STP_q: {
-      DCHECK_EQ(access_size, static_cast<unsigned>(kQRegSize));
-      MemoryWrite<qreg_t>(address, qreg(rt));
-      MemoryWrite<qreg_t>(address2, qreg(rt2));
-      break;
-    }
-    default: UNREACHABLE();
-  }
-
-  // Print a detailed trace (including the memory address) instead of the basic
-  // register:value trace generated by set_*reg().
-  if (instr->IsLoad()) {
-    if ((op == LDP_s) || (op == LDP_d)) {
-      LogVRead(address, rt, GetPrintRegisterFormatForSizeFP(access_size));
-      LogVRead(address2, rt2, GetPrintRegisterFormatForSizeFP(access_size));
-    } else if (op == LDP_q) {
-      LogVRead(address, rt, GetPrintRegisterFormatForSize(access_size));
-      LogVRead(address2, rt2, GetPrintRegisterFormatForSize(access_size));
-    } else {
-      LogRead(address, rt, GetPrintRegisterFormatForSize(access_size));
-      LogRead(address2, rt2, GetPrintRegisterFormatForSize(access_size));
-    }
-  } else {
-    if ((op == STP_s) || (op == STP_d)) {
-      LogVWrite(address, rt, GetPrintRegisterFormatForSizeFP(access_size));
-      LogVWrite(address2, rt2, GetPrintRegisterFormatForSizeFP(access_size));
-    } else if (op == STP_q) {
-      LogVWrite(address, rt, GetPrintRegisterFormatForSize(access_size));
-      LogVWrite(address2, rt2, GetPrintRegisterFormatForSize(access_size));
-    } else {
-      LogWrite(address, rt, GetPrintRegisterFormatForSize(access_size));
-      LogWrite(address2, rt2, GetPrintRegisterFormatForSize(access_size));
-    }
-  }
-
-  // Handle the writeback for loads after the load to ensure safe pop
-  // operation even when interrupted in the middle of it. The stack pointer
-  // is only updated after the load so pop(fp) will never break the invariant
-  // sp <= fp expected while walking the stack in the sampler.
-  if (instr->IsLoad()) {
-    // For loads the address pre writeback is used to check access below the
-    // stack.
-    stack = sp();
-
-    LoadStoreWriteBack(addr_reg, offset, addrmode);
-  }
-
-  // Accesses below the stack pointer (but above the platform stack limit) are
-  // not allowed in the ABI.
-  CheckMemoryAccess(address, stack);
-}
-
-
-void Simulator::VisitLoadLiteral(Instruction* instr) {
-  uintptr_t address = instr->LiteralAddress();
-  unsigned rt = instr->Rt();
-
-  {
-    base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-    local_monitor_.NotifyLoad();
-  }
-
-  switch (instr->Mask(LoadLiteralMask)) {
-    // Use _no_log variants to suppress the register trace (LOG_REGS,
-    // LOG_VREGS), then print a more detailed log.
-    case LDR_w_lit:
-      set_wreg_no_log(rt, MemoryRead<uint32_t>(address));
-      LogRead(address, rt, kPrintWReg);
-      break;
-    case LDR_x_lit:
-      set_xreg_no_log(rt, MemoryRead<uint64_t>(address));
-      LogRead(address, rt, kPrintXReg);
-      break;
-    case LDR_s_lit:
-      set_sreg_no_log(rt, MemoryRead<float>(address));
-      LogVRead(address, rt, kPrintSReg);
-      break;
-    case LDR_d_lit:
-      set_dreg_no_log(rt, MemoryRead<double>(address));
-      LogVRead(address, rt, kPrintDReg);
-      break;
-    default: UNREACHABLE();
-  }
-}
-
-
-uintptr_t Simulator::LoadStoreAddress(unsigned addr_reg, int64_t offset,
-                                      AddrMode addrmode) {
-  const unsigned kSPRegCode = kSPRegInternalCode & kRegCodeMask;
-  uint64_t address = xreg(addr_reg, Reg31IsStackPointer);
-  if ((addr_reg == kSPRegCode) && ((address % 16) != 0)) {
-    // When the base register is SP the stack pointer is required to be
-    // quadword aligned prior to the address calculation and write-backs.
-    // Misalignment will cause a stack alignment fault.
-    FATAL("ALIGNMENT EXCEPTION");
-  }
-
-  if ((addrmode == Offset) || (addrmode == PreIndex)) {
-    address += offset;
-  }
-
-  return address;
-}
-
-
-void Simulator::LoadStoreWriteBack(unsigned addr_reg,
-                                   int64_t offset,
-                                   AddrMode addrmode) {
-  if ((addrmode == PreIndex) || (addrmode == PostIndex)) {
-    DCHECK_NE(offset, 0);
-    uint64_t address = xreg(addr_reg, Reg31IsStackPointer);
-    set_reg(addr_reg, address + offset, Reg31IsStackPointer);
-  }
-}
-
-Simulator::TransactionSize Simulator::get_transaction_size(unsigned size) {
-  switch (size) {
-    case 0:
-      return TransactionSize::None;
-    case 1:
-      return TransactionSize::Byte;
-    case 2:
-      return TransactionSize::HalfWord;
-    case 4:
-      return TransactionSize::Word;
-    default:
-      UNREACHABLE();
-  }
-  return TransactionSize::None;
-}
-
-void Simulator::VisitLoadStoreAcquireRelease(Instruction* instr) {
-  unsigned rt = instr->Rt();
-  unsigned rn = instr->Rn();
-  LoadStoreAcquireReleaseOp op = static_cast<LoadStoreAcquireReleaseOp>(
-      instr->Mask(LoadStoreAcquireReleaseMask));
-  int32_t is_acquire_release = instr->LoadStoreXAcquireRelease();
-  int32_t is_exclusive = (instr->LoadStoreXNotExclusive() == 0);
-  int32_t is_load = instr->LoadStoreXLoad();
-  int32_t is_pair = instr->LoadStoreXPair();
-  USE(is_acquire_release);
-  USE(is_pair);
-  DCHECK_NE(is_acquire_release, 0);  // Non-acquire/release unimplemented.
-  DCHECK_EQ(is_pair, 0);             // Pair unimplemented.
-  unsigned access_size = 1 << instr->LoadStoreXSizeLog2();
-  uintptr_t address = LoadStoreAddress(rn, 0, AddrMode::Offset);
-  DCHECK_EQ(address % access_size, 0);
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  if (is_load != 0) {
-    if (is_exclusive) {
-      local_monitor_.NotifyLoadExcl(address, get_transaction_size(access_size));
-      global_monitor_.Pointer()->NotifyLoadExcl_Locked(
-          address, &global_monitor_processor_);
-    } else {
-      local_monitor_.NotifyLoad();
-    }
-    switch (op) {
-      case LDAR_b:
-      case LDAXR_b:
-        set_wreg_no_log(rt, MemoryRead<uint8_t>(address));
-        break;
-      case LDAR_h:
-      case LDAXR_h:
-        set_wreg_no_log(rt, MemoryRead<uint16_t>(address));
-        break;
-      case LDAR_w:
-      case LDAXR_w:
-        set_wreg_no_log(rt, MemoryRead<uint32_t>(address));
-        break;
-      default:
-        UNIMPLEMENTED();
-    }
-    LogRead(address, rt, GetPrintRegisterFormatForSize(access_size));
-  } else {
-    if (is_exclusive) {
-      unsigned rs = instr->Rs();
-      DCHECK_NE(rs, rt);
-      DCHECK_NE(rs, rn);
-      if (local_monitor_.NotifyStoreExcl(address,
-                                         get_transaction_size(access_size)) &&
-          global_monitor_.Pointer()->NotifyStoreExcl_Locked(
-              address, &global_monitor_processor_)) {
-        switch (op) {
-          case STLXR_b:
-            MemoryWrite<uint8_t>(address, wreg(rt));
-            break;
-          case STLXR_h:
-            MemoryWrite<uint16_t>(address, wreg(rt));
-            break;
-          case STLXR_w:
-            MemoryWrite<uint32_t>(address, wreg(rt));
-            break;
-          default:
-            UNIMPLEMENTED();
-        }
-        LogWrite(address, rt, GetPrintRegisterFormatForSize(access_size));
-        set_wreg(rs, 0);
-      } else {
-        set_wreg(rs, 1);
-      }
-    } else {
-      local_monitor_.NotifyStore();
-      global_monitor_.Pointer()->NotifyStore_Locked(&global_monitor_processor_);
-      switch (op) {
-        case STLR_b:
-          MemoryWrite<uint8_t>(address, wreg(rt));
-          break;
-        case STLR_h:
-          MemoryWrite<uint16_t>(address, wreg(rt));
-          break;
-        case STLR_w:
-          MemoryWrite<uint32_t>(address, wreg(rt));
-          break;
-        default:
-          UNIMPLEMENTED();
-      }
-    }
-  }
-}
-
-void Simulator::CheckMemoryAccess(uintptr_t address, uintptr_t stack) {
-  if ((address >= stack_limit_) && (address < stack)) {
-    fprintf(stream_, "ACCESS BELOW STACK POINTER:\n");
-    fprintf(stream_, "  sp is here:          0x%016" PRIx64 "\n",
-            static_cast<uint64_t>(stack));
-    fprintf(stream_, "  access was here:     0x%016" PRIx64 "\n",
-            static_cast<uint64_t>(address));
-    fprintf(stream_, "  stack limit is here: 0x%016" PRIx64 "\n",
-            static_cast<uint64_t>(stack_limit_));
-    fprintf(stream_, "\n");
-    FATAL("ACCESS BELOW STACK POINTER");
-  }
-}
-
-
-void Simulator::VisitMoveWideImmediate(Instruction* instr) {
-  MoveWideImmediateOp mov_op =
-    static_cast<MoveWideImmediateOp>(instr->Mask(MoveWideImmediateMask));
-  int64_t new_xn_val = 0;
-
-  bool is_64_bits = instr->SixtyFourBits() == 1;
-  // Shift is limited for W operations.
-  DCHECK(is_64_bits || (instr->ShiftMoveWide() < 2));
-
-  // Get the shifted immediate.
-  int64_t shift = instr->ShiftMoveWide() * 16;
-  int64_t shifted_imm16 = static_cast<int64_t>(instr->ImmMoveWide()) << shift;
-
-  // Compute the new value.
-  switch (mov_op) {
-    case MOVN_w:
-    case MOVN_x: {
-        new_xn_val = ~shifted_imm16;
-        if (!is_64_bits) new_xn_val &= kWRegMask;
-      break;
-    }
-    case MOVK_w:
-    case MOVK_x: {
-        unsigned reg_code = instr->Rd();
-        int64_t prev_xn_val = is_64_bits ? xreg(reg_code)
-                                         : wreg(reg_code);
-        new_xn_val = (prev_xn_val & ~(0xFFFFL << shift)) | shifted_imm16;
-        break;
-    }
-    case MOVZ_w:
-    case MOVZ_x: {
-        new_xn_val = shifted_imm16;
-      break;
-    }
-    default:
-      UNREACHABLE();
-  }
-
-  // Update the destination register.
-  set_xreg(instr->Rd(), new_xn_val);
-}
-
-
-void Simulator::VisitConditionalSelect(Instruction* instr) {
-  uint64_t new_val = xreg(instr->Rn());
-  if (ConditionFailed(static_cast<Condition>(instr->Condition()))) {
-    new_val = xreg(instr->Rm());
-    switch (instr->Mask(ConditionalSelectMask)) {
-      case CSEL_w:
-      case CSEL_x:
-        break;
-      case CSINC_w:
-      case CSINC_x:
-        new_val++;
-        break;
-      case CSINV_w:
-      case CSINV_x:
-        new_val = ~new_val;
-        break;
-      case CSNEG_w:
-      case CSNEG_x:
-        new_val = -new_val;
-        break;
-      default: UNIMPLEMENTED();
-    }
-  }
-  if (instr->SixtyFourBits()) {
-    set_xreg(instr->Rd(), new_val);
-  } else {
-    set_wreg(instr->Rd(), static_cast<uint32_t>(new_val));
-  }
-}
-
-
-void Simulator::VisitDataProcessing1Source(Instruction* instr) {
-  unsigned dst = instr->Rd();
-  unsigned src = instr->Rn();
-
-  switch (instr->Mask(DataProcessing1SourceMask)) {
-    case RBIT_w:
-      set_wreg(dst, base::bits::ReverseBits(wreg(src)));
-      break;
-    case RBIT_x:
-      set_xreg(dst, base::bits::ReverseBits(xreg(src)));
-      break;
-    case REV16_w:
-      set_wreg(dst, ReverseBytes(wreg(src), 1));
-      break;
-    case REV16_x:
-      set_xreg(dst, ReverseBytes(xreg(src), 1));
-      break;
-    case REV_w:
-      set_wreg(dst, ReverseBytes(wreg(src), 2));
-      break;
-    case REV32_x:
-      set_xreg(dst, ReverseBytes(xreg(src), 2));
-      break;
-    case REV_x:
-      set_xreg(dst, ReverseBytes(xreg(src), 3));
-      break;
-    case CLZ_w: set_wreg(dst, CountLeadingZeros(wreg(src), kWRegSizeInBits));
-                break;
-    case CLZ_x: set_xreg(dst, CountLeadingZeros(xreg(src), kXRegSizeInBits));
-                break;
-    case CLS_w: {
-      set_wreg(dst, CountLeadingSignBits(wreg(src), kWRegSizeInBits));
-      break;
-    }
-    case CLS_x: {
-      set_xreg(dst, CountLeadingSignBits(xreg(src), kXRegSizeInBits));
-      break;
-    }
-    default: UNIMPLEMENTED();
-  }
-}
-
-
-template <typename T>
-void Simulator::DataProcessing2Source(Instruction* instr) {
-  Shift shift_op = NO_SHIFT;
-  T result = 0;
-  switch (instr->Mask(DataProcessing2SourceMask)) {
-    case SDIV_w:
-    case SDIV_x: {
-      T rn = reg<T>(instr->Rn());
-      T rm = reg<T>(instr->Rm());
-      if ((rn == std::numeric_limits<T>::min()) && (rm == -1)) {
-        result = std::numeric_limits<T>::min();
-      } else if (rm == 0) {
-        // Division by zero can be trapped, but not on A-class processors.
-        result = 0;
-      } else {
-        result = rn / rm;
-      }
-      break;
-    }
-    case UDIV_w:
-    case UDIV_x: {
-      typedef typename std::make_unsigned<T>::type unsignedT;
-      unsignedT rn = static_cast<unsignedT>(reg<T>(instr->Rn()));
-      unsignedT rm = static_cast<unsignedT>(reg<T>(instr->Rm()));
-      if (rm == 0) {
-        // Division by zero can be trapped, but not on A-class processors.
-        result = 0;
-      } else {
-        result = rn / rm;
-      }
-      break;
-    }
-    case LSLV_w:
-    case LSLV_x: shift_op = LSL; break;
-    case LSRV_w:
-    case LSRV_x: shift_op = LSR; break;
-    case ASRV_w:
-    case ASRV_x: shift_op = ASR; break;
-    case RORV_w:
-    case RORV_x: shift_op = ROR; break;
-    default: UNIMPLEMENTED();
-  }
-
-  if (shift_op != NO_SHIFT) {
-    // Shift distance encoded in the least-significant five/six bits of the
-    // register.
-    unsigned shift = wreg(instr->Rm());
-    if (sizeof(T) == kWRegSize) {
-      shift &= kShiftAmountWRegMask;
-    } else {
-      shift &= kShiftAmountXRegMask;
-    }
-    result = ShiftOperand(reg<T>(instr->Rn()), shift_op, shift);
-  }
-  set_reg<T>(instr->Rd(), result);
-}
-
-
-void Simulator::VisitDataProcessing2Source(Instruction* instr) {
-  if (instr->SixtyFourBits()) {
-    DataProcessing2Source<int64_t>(instr);
-  } else {
-    DataProcessing2Source<int32_t>(instr);
-  }
-}
-
-
-// The algorithm used is described in section 8.2 of
-//   Hacker's Delight, by Henry S. Warren, Jr.
-// It assumes that a right shift on a signed integer is an arithmetic shift.
-static int64_t MultiplyHighSigned(int64_t u, int64_t v) {
-  uint64_t u0, v0, w0;
-  int64_t u1, v1, w1, w2, t;
-
-  u0 = u & 0xFFFFFFFFL;
-  u1 = u >> 32;
-  v0 = v & 0xFFFFFFFFL;
-  v1 = v >> 32;
-
-  w0 = u0 * v0;
-  t = u1 * v0 + (w0 >> 32);
-  w1 = t & 0xFFFFFFFFL;
-  w2 = t >> 32;
-  w1 = u0 * v1 + w1;
-
-  return u1 * v1 + w2 + (w1 >> 32);
-}
-
-
-void Simulator::VisitDataProcessing3Source(Instruction* instr) {
-  int64_t result = 0;
-  // Extract and sign- or zero-extend 32-bit arguments for widening operations.
-  uint64_t rn_u32 = reg<uint32_t>(instr->Rn());
-  uint64_t rm_u32 = reg<uint32_t>(instr->Rm());
-  int64_t rn_s32 = reg<int32_t>(instr->Rn());
-  int64_t rm_s32 = reg<int32_t>(instr->Rm());
-  switch (instr->Mask(DataProcessing3SourceMask)) {
-    case MADD_w:
-    case MADD_x:
-      result = xreg(instr->Ra()) + (xreg(instr->Rn()) * xreg(instr->Rm()));
-      break;
-    case MSUB_w:
-    case MSUB_x:
-      result = xreg(instr->Ra()) - (xreg(instr->Rn()) * xreg(instr->Rm()));
-      break;
-    case SMADDL_x: result = xreg(instr->Ra()) + (rn_s32 * rm_s32); break;
-    case SMSUBL_x: result = xreg(instr->Ra()) - (rn_s32 * rm_s32); break;
-    case UMADDL_x: result = xreg(instr->Ra()) + (rn_u32 * rm_u32); break;
-    case UMSUBL_x: result = xreg(instr->Ra()) - (rn_u32 * rm_u32); break;
-    case SMULH_x:
-      DCHECK_EQ(instr->Ra(), kZeroRegCode);
-      result = MultiplyHighSigned(xreg(instr->Rn()), xreg(instr->Rm()));
-      break;
-    default: UNIMPLEMENTED();
-  }
-
-  if (instr->SixtyFourBits()) {
-    set_xreg(instr->Rd(), result);
-  } else {
-    set_wreg(instr->Rd(), static_cast<int32_t>(result));
-  }
-}
-
-
-template <typename T>
-void Simulator::BitfieldHelper(Instruction* instr) {
-  typedef typename std::make_unsigned<T>::type unsignedT;
-  T reg_size = sizeof(T) * 8;
-  T R = instr->ImmR();
-  T S = instr->ImmS();
-  T diff = S - R;
-  T mask;
-  if (diff >= 0) {
-    mask = diff < reg_size - 1 ? (static_cast<T>(1) << (diff + 1)) - 1
-                               : static_cast<T>(-1);
-  } else {
-    uint64_t umask = ((1L << (S + 1)) - 1);
-    umask = (umask >> R) | (umask << (reg_size - R));
-    mask = static_cast<T>(umask);
-    diff += reg_size;
-  }
-
-  // inzero indicates if the extracted bitfield is inserted into the
-  // destination register value or in zero.
-  // If extend is true, extend the sign of the extracted bitfield.
-  bool inzero = false;
-  bool extend = false;
-  switch (instr->Mask(BitfieldMask)) {
-    case BFM_x:
-    case BFM_w:
-      break;
-    case SBFM_x:
-    case SBFM_w:
-      inzero = true;
-      extend = true;
-      break;
-    case UBFM_x:
-    case UBFM_w:
-      inzero = true;
-      break;
-    default:
-      UNIMPLEMENTED();
-  }
-
-  T dst = inzero ? 0 : reg<T>(instr->Rd());
-  T src = reg<T>(instr->Rn());
-  // Rotate source bitfield into place.
-  T result = (static_cast<unsignedT>(src) >> R) | (src << (reg_size - R));
-  // Determine the sign extension.
-  T topbits_preshift = (static_cast<T>(1) << (reg_size - diff - 1)) - 1;
-  T signbits = (extend && ((src >> S) & 1) ? topbits_preshift : 0)
-               << (diff + 1);
-
-  // Merge sign extension, dest/zero and bitfield.
-  result = signbits | (result & mask) | (dst & ~mask);
-
-  set_reg<T>(instr->Rd(), result);
-}
-
-
-void Simulator::VisitBitfield(Instruction* instr) {
-  if (instr->SixtyFourBits()) {
-    BitfieldHelper<int64_t>(instr);
-  } else {
-    BitfieldHelper<int32_t>(instr);
-  }
-}
-
-
-void Simulator::VisitExtract(Instruction* instr) {
-  if (instr->SixtyFourBits()) {
-    Extract<uint64_t>(instr);
-  } else {
-    Extract<uint32_t>(instr);
-  }
-}
-
-
-void Simulator::VisitFPImmediate(Instruction* instr) {
-  AssertSupportedFPCR();
-
-  unsigned dest = instr->Rd();
-  switch (instr->Mask(FPImmediateMask)) {
-    case FMOV_s_imm: set_sreg(dest, instr->ImmFP32()); break;
-    case FMOV_d_imm: set_dreg(dest, instr->ImmFP64()); break;
-    default: UNREACHABLE();
-  }
-}
-
-
-void Simulator::VisitFPIntegerConvert(Instruction* instr) {
-  AssertSupportedFPCR();
-
-  unsigned dst = instr->Rd();
-  unsigned src = instr->Rn();
-
-  FPRounding round = fpcr().RMode();
-
-  switch (instr->Mask(FPIntegerConvertMask)) {
-    case FCVTAS_ws: set_wreg(dst, FPToInt32(sreg(src), FPTieAway)); break;
-    case FCVTAS_xs: set_xreg(dst, FPToInt64(sreg(src), FPTieAway)); break;
-    case FCVTAS_wd: set_wreg(dst, FPToInt32(dreg(src), FPTieAway)); break;
-    case FCVTAS_xd: set_xreg(dst, FPToInt64(dreg(src), FPTieAway)); break;
-    case FCVTAU_ws: set_wreg(dst, FPToUInt32(sreg(src), FPTieAway)); break;
-    case FCVTAU_xs: set_xreg(dst, FPToUInt64(sreg(src), FPTieAway)); break;
-    case FCVTAU_wd: set_wreg(dst, FPToUInt32(dreg(src), FPTieAway)); break;
-    case FCVTAU_xd: set_xreg(dst, FPToUInt64(dreg(src), FPTieAway)); break;
-    case FCVTMS_ws:
-      set_wreg(dst, FPToInt32(sreg(src), FPNegativeInfinity));
-      break;
-    case FCVTMS_xs:
-      set_xreg(dst, FPToInt64(sreg(src), FPNegativeInfinity));
-      break;
-    case FCVTMS_wd:
-      set_wreg(dst, FPToInt32(dreg(src), FPNegativeInfinity));
-      break;
-    case FCVTMS_xd:
-      set_xreg(dst, FPToInt64(dreg(src), FPNegativeInfinity));
-      break;
-    case FCVTMU_ws:
-      set_wreg(dst, FPToUInt32(sreg(src), FPNegativeInfinity));
-      break;
-    case FCVTMU_xs:
-      set_xreg(dst, FPToUInt64(sreg(src), FPNegativeInfinity));
-      break;
-    case FCVTMU_wd:
-      set_wreg(dst, FPToUInt32(dreg(src), FPNegativeInfinity));
-      break;
-    case FCVTMU_xd:
-      set_xreg(dst, FPToUInt64(dreg(src), FPNegativeInfinity));
-      break;
-    case FCVTNS_ws: set_wreg(dst, FPToInt32(sreg(src), FPTieEven)); break;
-    case FCVTNS_xs: set_xreg(dst, FPToInt64(sreg(src), FPTieEven)); break;
-    case FCVTNS_wd: set_wreg(dst, FPToInt32(dreg(src), FPTieEven)); break;
-    case FCVTNS_xd: set_xreg(dst, FPToInt64(dreg(src), FPTieEven)); break;
-    case FCVTNU_ws: set_wreg(dst, FPToUInt32(sreg(src), FPTieEven)); break;
-    case FCVTNU_xs: set_xreg(dst, FPToUInt64(sreg(src), FPTieEven)); break;
-    case FCVTNU_wd: set_wreg(dst, FPToUInt32(dreg(src), FPTieEven)); break;
-    case FCVTNU_xd: set_xreg(dst, FPToUInt64(dreg(src), FPTieEven)); break;
-    case FCVTZS_ws: set_wreg(dst, FPToInt32(sreg(src), FPZero)); break;
-    case FCVTZS_xs: set_xreg(dst, FPToInt64(sreg(src), FPZero)); break;
-    case FCVTZS_wd: set_wreg(dst, FPToInt32(dreg(src), FPZero)); break;
-    case FCVTZS_xd: set_xreg(dst, FPToInt64(dreg(src), FPZero)); break;
-    case FCVTZU_ws: set_wreg(dst, FPToUInt32(sreg(src), FPZero)); break;
-    case FCVTZU_xs: set_xreg(dst, FPToUInt64(sreg(src), FPZero)); break;
-    case FCVTZU_wd: set_wreg(dst, FPToUInt32(dreg(src), FPZero)); break;
-    case FCVTZU_xd: set_xreg(dst, FPToUInt64(dreg(src), FPZero)); break;
-    case FMOV_ws: set_wreg(dst, sreg_bits(src)); break;
-    case FMOV_xd: set_xreg(dst, dreg_bits(src)); break;
-    case FMOV_sw: set_sreg_bits(dst, wreg(src)); break;
-    case FMOV_dx: set_dreg_bits(dst, xreg(src)); break;
-
-    // A 32-bit input can be handled in the same way as a 64-bit input, since
-    // the sign- or zero-extension will not affect the conversion.
-    case SCVTF_dx: set_dreg(dst, FixedToDouble(xreg(src), 0, round)); break;
-    case SCVTF_dw: set_dreg(dst, FixedToDouble(wreg(src), 0, round)); break;
-    case UCVTF_dx: set_dreg(dst, UFixedToDouble(xreg(src), 0, round)); break;
-    case UCVTF_dw: {
-      set_dreg(dst, UFixedToDouble(reg<uint32_t>(src), 0, round));
-      break;
-    }
-    case SCVTF_sx: set_sreg(dst, FixedToFloat(xreg(src), 0, round)); break;
-    case SCVTF_sw: set_sreg(dst, FixedToFloat(wreg(src), 0, round)); break;
-    case UCVTF_sx: set_sreg(dst, UFixedToFloat(xreg(src), 0, round)); break;
-    case UCVTF_sw: {
-      set_sreg(dst, UFixedToFloat(reg<uint32_t>(src), 0, round));
-      break;
-    }
-
-    default: UNREACHABLE();
-  }
-}
-
-
-void Simulator::VisitFPFixedPointConvert(Instruction* instr) {
-  AssertSupportedFPCR();
-
-  unsigned dst = instr->Rd();
-  unsigned src = instr->Rn();
-  int fbits = 64 - instr->FPScale();
-
-  FPRounding round = fpcr().RMode();
-
-  switch (instr->Mask(FPFixedPointConvertMask)) {
-    // A 32-bit input can be handled in the same way as a 64-bit input, since
-    // the sign- or zero-extension will not affect the conversion.
-    case SCVTF_dx_fixed:
-      set_dreg(dst, FixedToDouble(xreg(src), fbits, round));
-      break;
-    case SCVTF_dw_fixed:
-      set_dreg(dst, FixedToDouble(wreg(src), fbits, round));
-      break;
-    case UCVTF_dx_fixed:
-      set_dreg(dst, UFixedToDouble(xreg(src), fbits, round));
-      break;
-    case UCVTF_dw_fixed: {
-      set_dreg(dst,
-               UFixedToDouble(reg<uint32_t>(src), fbits, round));
-      break;
-    }
-    case SCVTF_sx_fixed:
-      set_sreg(dst, FixedToFloat(xreg(src), fbits, round));
-      break;
-    case SCVTF_sw_fixed:
-      set_sreg(dst, FixedToFloat(wreg(src), fbits, round));
-      break;
-    case UCVTF_sx_fixed:
-      set_sreg(dst, UFixedToFloat(xreg(src), fbits, round));
-      break;
-    case UCVTF_sw_fixed: {
-      set_sreg(dst,
-               UFixedToFloat(reg<uint32_t>(src), fbits, round));
-      break;
-    }
-    default: UNREACHABLE();
-  }
-}
-
-
-void Simulator::VisitFPCompare(Instruction* instr) {
-  AssertSupportedFPCR();
-
-  switch (instr->Mask(FPCompareMask)) {
-    case FCMP_s:
-      FPCompare(sreg(instr->Rn()), sreg(instr->Rm()));
-      break;
-    case FCMP_d:
-      FPCompare(dreg(instr->Rn()), dreg(instr->Rm()));
-      break;
-    case FCMP_s_zero:
-      FPCompare(sreg(instr->Rn()), 0.0f);
-      break;
-    case FCMP_d_zero:
-      FPCompare(dreg(instr->Rn()), 0.0);
-      break;
-    default: UNIMPLEMENTED();
-  }
-}
-
-
-void Simulator::VisitFPConditionalCompare(Instruction* instr) {
-  AssertSupportedFPCR();
-
-  switch (instr->Mask(FPConditionalCompareMask)) {
-    case FCCMP_s:
-      if (ConditionPassed(static_cast<Condition>(instr->Condition()))) {
-        FPCompare(sreg(instr->Rn()), sreg(instr->Rm()));
-      } else {
-        nzcv().SetFlags(instr->Nzcv());
-        LogSystemRegister(NZCV);
-      }
-      break;
-    case FCCMP_d: {
-      if (ConditionPassed(static_cast<Condition>(instr->Condition()))) {
-        FPCompare(dreg(instr->Rn()), dreg(instr->Rm()));
-      } else {
-        // If the condition fails, set the status flags to the nzcv immediate.
-        nzcv().SetFlags(instr->Nzcv());
-        LogSystemRegister(NZCV);
-      }
-      break;
-    }
-    default: UNIMPLEMENTED();
-  }
-}
-
-
-void Simulator::VisitFPConditionalSelect(Instruction* instr) {
-  AssertSupportedFPCR();
-
-  Instr selected;
-  if (ConditionPassed(static_cast<Condition>(instr->Condition()))) {
-    selected = instr->Rn();
-  } else {
-    selected = instr->Rm();
-  }
-
-  switch (instr->Mask(FPConditionalSelectMask)) {
-    case FCSEL_s: set_sreg(instr->Rd(), sreg(selected)); break;
-    case FCSEL_d: set_dreg(instr->Rd(), dreg(selected)); break;
-    default: UNIMPLEMENTED();
-  }
-}
-
-
-void Simulator::VisitFPDataProcessing1Source(Instruction* instr) {
-  AssertSupportedFPCR();
-
-  FPRounding fpcr_rounding = static_cast<FPRounding>(fpcr().RMode());
-  VectorFormat vform = (instr->Mask(FP64) == FP64) ? kFormatD : kFormatS;
-  SimVRegister& rd = vreg(instr->Rd());
-  SimVRegister& rn = vreg(instr->Rn());
-  bool inexact_exception = false;
-
-  unsigned fd = instr->Rd();
-  unsigned fn = instr->Rn();
-
-  switch (instr->Mask(FPDataProcessing1SourceMask)) {
-    case FMOV_s:
-      set_sreg(fd, sreg(fn));
-      return;
-    case FMOV_d:
-      set_dreg(fd, dreg(fn));
-      return;
-    case FABS_s:
-    case FABS_d:
-      fabs_(vform, vreg(fd), vreg(fn));
-      // Explicitly log the register update whilst we have type information.
-      LogVRegister(fd, GetPrintRegisterFormatFP(vform));
-      return;
-    case FNEG_s:
-    case FNEG_d:
-      fneg(vform, vreg(fd), vreg(fn));
-      // Explicitly log the register update whilst we have type information.
-      LogVRegister(fd, GetPrintRegisterFormatFP(vform));
-      return;
-    case FCVT_ds:
-      set_dreg(fd, FPToDouble(sreg(fn)));
-      return;
-    case FCVT_sd:
-      set_sreg(fd, FPToFloat(dreg(fn), FPTieEven));
-      return;
-    case FCVT_hs:
-      set_hreg(fd, FPToFloat16(sreg(fn), FPTieEven));
-      return;
-    case FCVT_sh:
-      set_sreg(fd, FPToFloat(hreg(fn)));
-      return;
-    case FCVT_dh:
-      set_dreg(fd, FPToDouble(FPToFloat(hreg(fn))));
-      return;
-    case FCVT_hd:
-      set_hreg(fd, FPToFloat16(dreg(fn), FPTieEven));
-      return;
-    case FSQRT_s:
-    case FSQRT_d:
-      fsqrt(vform, rd, rn);
-      // Explicitly log the register update whilst we have type information.
-      LogVRegister(fd, GetPrintRegisterFormatFP(vform));
-      return;
-    case FRINTI_s:
-    case FRINTI_d:
-      break;  // Use FPCR rounding mode.
-    case FRINTX_s:
-    case FRINTX_d:
-      inexact_exception = true;
-      break;
-    case FRINTA_s:
-    case FRINTA_d:
-      fpcr_rounding = FPTieAway;
-      break;
-    case FRINTM_s:
-    case FRINTM_d:
-      fpcr_rounding = FPNegativeInfinity;
-      break;
-    case FRINTN_s:
-    case FRINTN_d:
-      fpcr_rounding = FPTieEven;
-      break;
-    case FRINTP_s:
-    case FRINTP_d:
-      fpcr_rounding = FPPositiveInfinity;
-      break;
-    case FRINTZ_s:
-    case FRINTZ_d:
-      fpcr_rounding = FPZero;
-      break;
-    default:
-      UNIMPLEMENTED();
-  }
-
-  // Only FRINT* instructions fall through the switch above.
-  frint(vform, rd, rn, fpcr_rounding, inexact_exception);
-  // Explicitly log the register update whilst we have type information
-  LogVRegister(fd, GetPrintRegisterFormatFP(vform));
-}
-
-void Simulator::VisitFPDataProcessing2Source(Instruction* instr) {
-  AssertSupportedFPCR();
-
-  VectorFormat vform = (instr->Mask(FP64) == FP64) ? kFormatD : kFormatS;
-  SimVRegister& rd = vreg(instr->Rd());
-  SimVRegister& rn = vreg(instr->Rn());
-  SimVRegister& rm = vreg(instr->Rm());
-
-  switch (instr->Mask(FPDataProcessing2SourceMask)) {
-    case FADD_s:
-    case FADD_d:
-      fadd(vform, rd, rn, rm);
-      break;
-    case FSUB_s:
-    case FSUB_d:
-      fsub(vform, rd, rn, rm);
-      break;
-    case FMUL_s:
-    case FMUL_d:
-      fmul(vform, rd, rn, rm);
-      break;
-    case FNMUL_s:
-    case FNMUL_d:
-      fnmul(vform, rd, rn, rm);
-      break;
-    case FDIV_s:
-    case FDIV_d:
-      fdiv(vform, rd, rn, rm);
-      break;
-    case FMAX_s:
-    case FMAX_d:
-      fmax(vform, rd, rn, rm);
-      break;
-    case FMIN_s:
-    case FMIN_d:
-      fmin(vform, rd, rn, rm);
-      break;
-    case FMAXNM_s:
-    case FMAXNM_d:
-      fmaxnm(vform, rd, rn, rm);
-      break;
-    case FMINNM_s:
-    case FMINNM_d:
-      fminnm(vform, rd, rn, rm);
-      break;
-    default:
-      UNREACHABLE();
-  }
-  // Explicitly log the register update whilst we have type information.
-  LogVRegister(instr->Rd(), GetPrintRegisterFormatFP(vform));
-}
-
-void Simulator::VisitFPDataProcessing3Source(Instruction* instr) {
-  AssertSupportedFPCR();
-
-  unsigned fd = instr->Rd();
-  unsigned fn = instr->Rn();
-  unsigned fm = instr->Rm();
-  unsigned fa = instr->Ra();
-
-  switch (instr->Mask(FPDataProcessing3SourceMask)) {
-    // fd = fa +/- (fn * fm)
-    case FMADD_s:
-      set_sreg(fd, FPMulAdd(sreg(fa), sreg(fn), sreg(fm)));
-      break;
-    case FMSUB_s:
-      set_sreg(fd, FPMulAdd(sreg(fa), -sreg(fn), sreg(fm)));
-      break;
-    case FMADD_d:
-      set_dreg(fd, FPMulAdd(dreg(fa), dreg(fn), dreg(fm)));
-      break;
-    case FMSUB_d:
-      set_dreg(fd, FPMulAdd(dreg(fa), -dreg(fn), dreg(fm)));
-      break;
-    // Negated variants of the above.
-    case FNMADD_s:
-      set_sreg(fd, FPMulAdd(-sreg(fa), -sreg(fn), sreg(fm)));
-      break;
-    case FNMSUB_s:
-      set_sreg(fd, FPMulAdd(-sreg(fa), sreg(fn), sreg(fm)));
-      break;
-    case FNMADD_d:
-      set_dreg(fd, FPMulAdd(-dreg(fa), -dreg(fn), dreg(fm)));
-      break;
-    case FNMSUB_d:
-      set_dreg(fd, FPMulAdd(-dreg(fa), dreg(fn), dreg(fm)));
-      break;
-    default:
-      UNIMPLEMENTED();
-  }
-}
-
-bool Simulator::FPProcessNaNs(Instruction* instr) {
-  unsigned fd = instr->Rd();
-  unsigned fn = instr->Rn();
-  unsigned fm = instr->Rm();
-  bool done = false;
-
-  if (instr->Mask(FP64) == FP64) {
-    double result = FPProcessNaNs(dreg(fn), dreg(fm));
-    if (std::isnan(result)) {
-      set_dreg(fd, result);
-      done = true;
-    }
-  } else {
-    float result = FPProcessNaNs(sreg(fn), sreg(fm));
-    if (std::isnan(result)) {
-      set_sreg(fd, result);
-      done = true;
-    }
-  }
-
-  return done;
-}
-
-
-void Simulator::VisitSystem(Instruction* instr) {
-  // Some system instructions hijack their Op and Cp fields to represent a
-  // range of immediates instead of indicating a different instruction. This
-  // makes the decoding tricky.
-  if (instr->Mask(SystemSysRegFMask) == SystemSysRegFixed) {
-    switch (instr->Mask(SystemSysRegMask)) {
-      case MRS: {
-        switch (instr->ImmSystemRegister()) {
-          case NZCV: set_xreg(instr->Rt(), nzcv().RawValue()); break;
-          case FPCR: set_xreg(instr->Rt(), fpcr().RawValue()); break;
-          default: UNIMPLEMENTED();
-        }
-        break;
-      }
-      case MSR: {
-        switch (instr->ImmSystemRegister()) {
-          case NZCV:
-            nzcv().SetRawValue(wreg(instr->Rt()));
-            LogSystemRegister(NZCV);
-            break;
-          case FPCR:
-            fpcr().SetRawValue(wreg(instr->Rt()));
-            LogSystemRegister(FPCR);
-            break;
-          default: UNIMPLEMENTED();
-        }
-        break;
-      }
-    }
-  } else if (instr->Mask(SystemHintFMask) == SystemHintFixed) {
-    DCHECK(instr->Mask(SystemHintMask) == HINT);
-    switch (instr->ImmHint()) {
-      case NOP: break;
-      default: UNIMPLEMENTED();
-    }
-  } else if (instr->Mask(MemBarrierFMask) == MemBarrierFixed) {
-    __sync_synchronize();
-  } else {
-    UNIMPLEMENTED();
-  }
-}
-
-
-bool Simulator::GetValue(const char* desc, int64_t* value) {
-  int regnum = CodeFromName(desc);
-  if (regnum >= 0) {
-    unsigned code = regnum;
-    if (code == kZeroRegCode) {
-      // Catch the zero register and return 0.
-      *value = 0;
-      return true;
-    } else if (code == kSPRegInternalCode) {
-      // Translate the stack pointer code to 31, for Reg31IsStackPointer.
-      code = 31;
-    }
-    if (desc[0] == 'w') {
-      *value = wreg(code, Reg31IsStackPointer);
-    } else {
-      *value = xreg(code, Reg31IsStackPointer);
-    }
-    return true;
-  } else if (strncmp(desc, "0x", 2) == 0) {
-    return SScanF(desc + 2, "%" SCNx64,
-                  reinterpret_cast<uint64_t*>(value)) == 1;
-  } else {
-    return SScanF(desc, "%" SCNu64,
-                  reinterpret_cast<uint64_t*>(value)) == 1;
-  }
-}
-
-
-bool Simulator::PrintValue(const char* desc) {
-  if (strcmp(desc, "csp") == 0) {
-    DCHECK(CodeFromName(desc) == static_cast<int>(kSPRegInternalCode));
-    PrintF(stream_, "%s csp:%s 0x%016" PRIx64 "%s\n",
-        clr_reg_name, clr_reg_value, xreg(31, Reg31IsStackPointer), clr_normal);
-    return true;
-  } else if (strcmp(desc, "wcsp") == 0) {
-    DCHECK(CodeFromName(desc) == static_cast<int>(kSPRegInternalCode));
-    PrintF(stream_, "%s wcsp:%s 0x%08" PRIx32 "%s\n",
-        clr_reg_name, clr_reg_value, wreg(31, Reg31IsStackPointer), clr_normal);
-    return true;
-  }
-
-  int i = CodeFromName(desc);
-  static_assert(kNumberOfRegisters == kNumberOfVRegisters,
-                "Must be same number of Registers as VRegisters.");
-  if (i < 0 || static_cast<unsigned>(i) >= kNumberOfVRegisters) return false;
-
-  if (desc[0] == 'v') {
-    PrintF(stream_, "%s %s:%s 0x%016" PRIx64 "%s (%s%s:%s %g%s %s:%s %g%s)\n",
-           clr_vreg_name, VRegNameForCode(i), clr_vreg_value,
-           bit_cast<uint64_t>(dreg(i)), clr_normal, clr_vreg_name,
-           DRegNameForCode(i), clr_vreg_value, dreg(i), clr_vreg_name,
-           SRegNameForCode(i), clr_vreg_value, sreg(i), clr_normal);
-    return true;
-  } else if (desc[0] == 'd') {
-    PrintF(stream_, "%s %s:%s %g%s\n", clr_vreg_name, DRegNameForCode(i),
-           clr_vreg_value, dreg(i), clr_normal);
-    return true;
-  } else if (desc[0] == 's') {
-    PrintF(stream_, "%s %s:%s %g%s\n", clr_vreg_name, SRegNameForCode(i),
-           clr_vreg_value, sreg(i), clr_normal);
-    return true;
-  } else if (desc[0] == 'w') {
-    PrintF(stream_, "%s %s:%s 0x%08" PRIx32 "%s\n",
-        clr_reg_name, WRegNameForCode(i), clr_reg_value, wreg(i), clr_normal);
-    return true;
-  } else {
-    // X register names have a wide variety of starting characters, but anything
-    // else will be an X register.
-    PrintF(stream_, "%s %s:%s 0x%016" PRIx64 "%s\n",
-        clr_reg_name, XRegNameForCode(i), clr_reg_value, xreg(i), clr_normal);
-    return true;
-  }
-}
-
-
-void Simulator::Debug() {
-#define COMMAND_SIZE 63
-#define ARG_SIZE 255
-
-#define STR(a) #a
-#define XSTR(a) STR(a)
-
-  char cmd[COMMAND_SIZE + 1];
-  char arg1[ARG_SIZE + 1];
-  char arg2[ARG_SIZE + 1];
-  char* argv[3] = { cmd, arg1, arg2 };
-
-  // Make sure to have a proper terminating character if reaching the limit.
-  cmd[COMMAND_SIZE] = 0;
-  arg1[ARG_SIZE] = 0;
-  arg2[ARG_SIZE] = 0;
-
-  bool done = false;
-  bool cleared_log_disasm_bit = false;
-
-  while (!done) {
-    // Disassemble the next instruction to execute before doing anything else.
-    PrintInstructionsAt(pc_, 1);
-    // Read the command line.
-    char* line = ReadLine("sim> ");
-    if (line == nullptr) {
-      break;
-    } else {
-      // Repeat last command by default.
-      char* last_input = last_debugger_input();
-      if (strcmp(line, "\n") == 0 && (last_input != nullptr)) {
-        DeleteArray(line);
-        line = last_input;
-      } else {
-        // Update the latest command ran
-        set_last_debugger_input(line);
-      }
-
-      // Use sscanf to parse the individual parts of the command line. At the
-      // moment no command expects more than two parameters.
-      int argc = SScanF(line,
-                        "%" XSTR(COMMAND_SIZE) "s "
-                        "%" XSTR(ARG_SIZE) "s "
-                        "%" XSTR(ARG_SIZE) "s",
-                        cmd, arg1, arg2);
-
-      // stepi / si ------------------------------------------------------------
-      if ((strcmp(cmd, "si") == 0) || (strcmp(cmd, "stepi") == 0)) {
-        // We are about to execute instructions, after which by default we
-        // should increment the pc_. If it was set when reaching this debug
-        // instruction, it has not been cleared because this instruction has not
-        // completed yet. So clear it manually.
-        pc_modified_ = false;
-
-        if (argc == 1) {
-          ExecuteInstruction();
-        } else {
-          int64_t number_of_instructions_to_execute = 1;
-          GetValue(arg1, &number_of_instructions_to_execute);
-
-          set_log_parameters(log_parameters() | LOG_DISASM);
-          while (number_of_instructions_to_execute-- > 0) {
-            ExecuteInstruction();
-          }
-          set_log_parameters(log_parameters() & ~LOG_DISASM);
-          PrintF("\n");
-        }
-
-        // If it was necessary, the pc has already been updated or incremented
-        // when executing the instruction. So we do not want it to be updated
-        // again. It will be cleared when exiting.
-        pc_modified_ = true;
-
-      // next / n --------------------------------------------------------------
-      } else if ((strcmp(cmd, "next") == 0) || (strcmp(cmd, "n") == 0)) {
-        // Tell the simulator to break after the next executed BL.
-        break_on_next_ = true;
-        // Continue.
-        done = true;
-
-      // continue / cont / c ---------------------------------------------------
-      } else if ((strcmp(cmd, "continue") == 0) ||
-                 (strcmp(cmd, "cont") == 0) ||
-                 (strcmp(cmd, "c") == 0)) {
-        // Leave the debugger shell.
-        done = true;
-
-      // disassemble / disasm / di ---------------------------------------------
-      } else if (strcmp(cmd, "disassemble") == 0 ||
-                 strcmp(cmd, "disasm") == 0 ||
-                 strcmp(cmd, "di") == 0) {
-        int64_t n_of_instrs_to_disasm = 10;  // default value.
-        int64_t address = reinterpret_cast<int64_t>(pc_);  // default value.
-        if (argc >= 2) {  // disasm <n of instrs>
-          GetValue(arg1, &n_of_instrs_to_disasm);
-        }
-        if (argc >= 3) {  // disasm <n of instrs> <address>
-          GetValue(arg2, &address);
-        }
-
-        // Disassemble.
-        PrintInstructionsAt(reinterpret_cast<Instruction*>(address),
-                            n_of_instrs_to_disasm);
-        PrintF("\n");
-
-      // print / p -------------------------------------------------------------
-      } else if ((strcmp(cmd, "print") == 0) || (strcmp(cmd, "p") == 0)) {
-        if (argc == 2) {
-          if (strcmp(arg1, "all") == 0) {
-            PrintRegisters();
-            PrintVRegisters();
-          } else {
-            if (!PrintValue(arg1)) {
-              PrintF("%s unrecognized\n", arg1);
-            }
-          }
-        } else {
-          PrintF(
-            "print <register>\n"
-            "    Print the content of a register. (alias 'p')\n"
-            "    'print all' will print all registers.\n"
-            "    Use 'printobject' to get more details about the value.\n");
-        }
-
-      // printobject / po ------------------------------------------------------
-      } else if ((strcmp(cmd, "printobject") == 0) ||
-                 (strcmp(cmd, "po") == 0)) {
-        if (argc == 2) {
-          int64_t value;
-          OFStream os(stdout);
-          if (GetValue(arg1, &value)) {
-            Object* obj = reinterpret_cast<Object*>(value);
-            os << arg1 << ": \n";
-#ifdef DEBUG
-            obj->Print(os);
-            os << "\n";
-#else
-            os << Brief(obj) << "\n";
-#endif
-          } else {
-            os << arg1 << " unrecognized\n";
-          }
-        } else {
-          PrintF("printobject <value>\n"
-                 "printobject <register>\n"
-                 "    Print details about the value. (alias 'po')\n");
-        }
-
-      // stack / mem ----------------------------------------------------------
-      } else if (strcmp(cmd, "stack") == 0 || strcmp(cmd, "mem") == 0) {
-        int64_t* cur = nullptr;
-        int64_t* end = nullptr;
-        int next_arg = 1;
-
-        if (strcmp(cmd, "stack") == 0) {
-          cur = reinterpret_cast<int64_t*>(sp());
-
-        } else {  // "mem"
-          int64_t value;
-          if (!GetValue(arg1, &value)) {
-            PrintF("%s unrecognized\n", arg1);
-            continue;
-          }
-          cur = reinterpret_cast<int64_t*>(value);
-          next_arg++;
-        }
-
-        int64_t words = 0;
-        if (argc == next_arg) {
-          words = 10;
-        } else if (argc == next_arg + 1) {
-          if (!GetValue(argv[next_arg], &words)) {
-            PrintF("%s unrecognized\n", argv[next_arg]);
-            PrintF("Printing 10 double words by default");
-            words = 10;
-          }
-        } else {
-          UNREACHABLE();
-        }
-        end = cur + words;
-
-        while (cur < end) {
-          PrintF("  0x%016" PRIx64 ":  0x%016" PRIx64 " %10" PRId64,
-                 reinterpret_cast<uint64_t>(cur), *cur, *cur);
-          HeapObject* obj = reinterpret_cast<HeapObject*>(*cur);
-          int64_t value = *cur;
-          Heap* current_heap = isolate_->heap();
-          if (((value & 1) == 0) ||
-              current_heap->ContainsSlow(obj->address())) {
-            PrintF(" (");
-            if ((value & kSmiTagMask) == 0) {
-              STATIC_ASSERT(kSmiValueSize == 32);
-              int32_t untagged = (value >> kSmiShift) & 0xFFFFFFFF;
-              PrintF("smi %" PRId32, untagged);
-            } else {
-              obj->ShortPrint();
-            }
-            PrintF(")");
-          }
-          PrintF("\n");
-          cur++;
-        }
-
-      // trace / t -------------------------------------------------------------
-      } else if (strcmp(cmd, "trace") == 0 || strcmp(cmd, "t") == 0) {
-        if ((log_parameters() & (LOG_DISASM | LOG_REGS)) !=
-            (LOG_DISASM | LOG_REGS)) {
-          PrintF("Enabling disassembly and registers tracing\n");
-          set_log_parameters(log_parameters() | LOG_DISASM | LOG_REGS);
-        } else {
-          PrintF("Disabling disassembly and registers tracing\n");
-          set_log_parameters(log_parameters() & ~(LOG_DISASM | LOG_REGS));
-        }
-
-      // break / b -------------------------------------------------------------
-      } else if (strcmp(cmd, "break") == 0 || strcmp(cmd, "b") == 0) {
-        if (argc == 2) {
-          int64_t value;
-          if (GetValue(arg1, &value)) {
-            SetBreakpoint(reinterpret_cast<Instruction*>(value));
-          } else {
-            PrintF("%s unrecognized\n", arg1);
-          }
-        } else {
-          ListBreakpoints();
-          PrintF("Use `break <address>` to set or disable a breakpoint\n");
-        }
-
-      // gdb -------------------------------------------------------------------
-      } else if (strcmp(cmd, "gdb") == 0) {
-        PrintF("Relinquishing control to gdb.\n");
-        base::OS::DebugBreak();
-        PrintF("Regaining control from gdb.\n");
-
-      // sysregs ---------------------------------------------------------------
-      } else if (strcmp(cmd, "sysregs") == 0) {
-        PrintSystemRegisters();
-
-      // help / h --------------------------------------------------------------
-      } else if (strcmp(cmd, "help") == 0 || strcmp(cmd, "h") == 0) {
-        PrintF(
-          "stepi / si\n"
-          "    stepi <n>\n"
-          "    Step <n> instructions.\n"
-          "next / n\n"
-          "    Continue execution until a BL instruction is reached.\n"
-          "    At this point a breakpoint is set just after this BL.\n"
-          "    Then execution is resumed. It will probably later hit the\n"
-          "    breakpoint just set.\n"
-          "continue / cont / c\n"
-          "    Continue execution from here.\n"
-          "disassemble / disasm / di\n"
-          "    disassemble <n> <address>\n"
-          "    Disassemble <n> instructions from current <address>.\n"
-          "    By default <n> is 20 and <address> is the current pc.\n"
-          "print / p\n"
-          "    print <register>\n"
-          "    Print the content of a register.\n"
-          "    'print all' will print all registers.\n"
-          "    Use 'printobject' to get more details about the value.\n"
-          "printobject / po\n"
-          "    printobject <value>\n"
-          "    printobject <register>\n"
-          "    Print details about the value.\n"
-          "stack\n"
-          "    stack [<words>]\n"
-          "    Dump stack content, default dump 10 words\n"
-          "mem\n"
-          "    mem <address> [<words>]\n"
-          "    Dump memory content, default dump 10 words\n"
-          "trace / t\n"
-          "    Toggle disassembly and register tracing\n"
-          "break / b\n"
-          "    break : list all breakpoints\n"
-          "    break <address> : set / enable / disable a breakpoint.\n"
-          "gdb\n"
-          "    Enter gdb.\n"
-          "sysregs\n"
-          "    Print all system registers (including NZCV).\n");
-      } else {
-        PrintF("Unknown command: %s\n", cmd);
-        PrintF("Use 'help' for more information.\n");
-      }
-    }
-    if (cleared_log_disasm_bit == true) {
-      set_log_parameters(log_parameters_ | LOG_DISASM);
-    }
-  }
-}
-
-
-void Simulator::VisitException(Instruction* instr) {
-  switch (instr->Mask(ExceptionMask)) {
-    case HLT: {
-      if (instr->ImmException() == kImmExceptionIsDebug) {
-        // Read the arguments encoded inline in the instruction stream.
-        uint32_t code;
-        uint32_t parameters;
-
-        memcpy(&code,
-               pc_->InstructionAtOffset(kDebugCodeOffset),
-               sizeof(code));
-        memcpy(&parameters,
-               pc_->InstructionAtOffset(kDebugParamsOffset),
-               sizeof(parameters));
-        char const *message =
-            reinterpret_cast<char const*>(
-                pc_->InstructionAtOffset(kDebugMessageOffset));
-
-        // Always print something when we hit a debug point that breaks.
-        // We are going to break, so printing something is not an issue in
-        // terms of speed.
-        if (FLAG_trace_sim_messages || FLAG_trace_sim || (parameters & BREAK)) {
-          if (message != nullptr) {
-            PrintF(stream_,
-                   "# %sDebugger hit %d: %s%s%s\n",
-                   clr_debug_number,
-                   code,
-                   clr_debug_message,
-                   message,
-                   clr_normal);
-          } else {
-            PrintF(stream_,
-                   "# %sDebugger hit %d.%s\n",
-                   clr_debug_number,
-                   code,
-                   clr_normal);
-          }
-        }
-
-        // Other options.
-        switch (parameters & kDebuggerTracingDirectivesMask) {
-          case TRACE_ENABLE:
-            set_log_parameters(log_parameters() | parameters);
-            if (parameters & LOG_SYS_REGS) { PrintSystemRegisters(); }
-            if (parameters & LOG_REGS) { PrintRegisters(); }
-            if (parameters & LOG_VREGS) {
-              PrintVRegisters();
-            }
-            break;
-          case TRACE_DISABLE:
-            set_log_parameters(log_parameters() & ~parameters);
-            break;
-          case TRACE_OVERRIDE:
-            set_log_parameters(parameters);
-            break;
-          default:
-            // We don't support a one-shot LOG_DISASM.
-            DCHECK_EQ(parameters & LOG_DISASM, 0);
-            // Don't print information that is already being traced.
-            parameters &= ~log_parameters();
-            // Print the requested information.
-            if (parameters & LOG_SYS_REGS) PrintSystemRegisters();
-            if (parameters & LOG_REGS) PrintRegisters();
-            if (parameters & LOG_VREGS) PrintVRegisters();
-        }
-
-        // The stop parameters are inlined in the code. Skip them:
-        //  - Skip to the end of the message string.
-        size_t size = kDebugMessageOffset + strlen(message) + 1;
-        pc_ = pc_->InstructionAtOffset(RoundUp(size, kInstructionSize));
-        //  - Verify that the unreachable marker is present.
-        DCHECK(pc_->Mask(ExceptionMask) == HLT);
-        DCHECK_EQ(pc_->ImmException(), kImmExceptionIsUnreachable);
-        //  - Skip past the unreachable marker.
-        set_pc(pc_->following());
-
-        // Check if the debugger should break.
-        if (parameters & BREAK) Debug();
-
-      } else if (instr->ImmException() == kImmExceptionIsRedirectedCall) {
-        DoRuntimeCall(instr);
-      } else if (instr->ImmException() == kImmExceptionIsPrintf) {
-        DoPrintf(instr);
-
-      } else if (instr->ImmException() == kImmExceptionIsUnreachable) {
-        fprintf(stream_, "Hit UNREACHABLE marker at PC=%p.\n",
-                reinterpret_cast<void*>(pc_));
-        abort();
-
-      } else {
-        base::OS::DebugBreak();
-      }
-      break;
-    }
-    case BRK:
-      base::OS::DebugBreak();
-      break;
-    default:
-      UNIMPLEMENTED();
-  }
-}
-
-void Simulator::VisitNEON2RegMisc(Instruction* instr) {
-  NEONFormatDecoder nfd(instr);
-  VectorFormat vf = nfd.GetVectorFormat();
-
-  // Format mapping for "long pair" instructions, [su]addlp, [su]adalp.
-  static const NEONFormatMap map_lp = {
-      {23, 22, 30}, {NF_4H, NF_8H, NF_2S, NF_4S, NF_1D, NF_2D}};
-  VectorFormat vf_lp = nfd.GetVectorFormat(&map_lp);
-
-  static const NEONFormatMap map_fcvtl = {{22}, {NF_4S, NF_2D}};
-  VectorFormat vf_fcvtl = nfd.GetVectorFormat(&map_fcvtl);
-
-  static const NEONFormatMap map_fcvtn = {{22, 30},
-                                          {NF_4H, NF_8H, NF_2S, NF_4S}};
-  VectorFormat vf_fcvtn = nfd.GetVectorFormat(&map_fcvtn);
-
-  SimVRegister& rd = vreg(instr->Rd());
-  SimVRegister& rn = vreg(instr->Rn());
-
-  if (instr->Mask(NEON2RegMiscOpcode) <= NEON_NEG_opcode) {
-    // These instructions all use a two bit size field, except NOT and RBIT,
-    // which use the field to encode the operation.
-    switch (instr->Mask(NEON2RegMiscMask)) {
-      case NEON_REV64:
-        rev64(vf, rd, rn);
-        break;
-      case NEON_REV32:
-        rev32(vf, rd, rn);
-        break;
-      case NEON_REV16:
-        rev16(vf, rd, rn);
-        break;
-      case NEON_SUQADD:
-        suqadd(vf, rd, rn);
-        break;
-      case NEON_USQADD:
-        usqadd(vf, rd, rn);
-        break;
-      case NEON_CLS:
-        cls(vf, rd, rn);
-        break;
-      case NEON_CLZ:
-        clz(vf, rd, rn);
-        break;
-      case NEON_CNT:
-        cnt(vf, rd, rn);
-        break;
-      case NEON_SQABS:
-        abs(vf, rd, rn).SignedSaturate(vf);
-        break;
-      case NEON_SQNEG:
-        neg(vf, rd, rn).SignedSaturate(vf);
-        break;
-      case NEON_CMGT_zero:
-        cmp(vf, rd, rn, 0, gt);
-        break;
-      case NEON_CMGE_zero:
-        cmp(vf, rd, rn, 0, ge);
-        break;
-      case NEON_CMEQ_zero:
-        cmp(vf, rd, rn, 0, eq);
-        break;
-      case NEON_CMLE_zero:
-        cmp(vf, rd, rn, 0, le);
-        break;
-      case NEON_CMLT_zero:
-        cmp(vf, rd, rn, 0, lt);
-        break;
-      case NEON_ABS:
-        abs(vf, rd, rn);
-        break;
-      case NEON_NEG:
-        neg(vf, rd, rn);
-        break;
-      case NEON_SADDLP:
-        saddlp(vf_lp, rd, rn);
-        break;
-      case NEON_UADDLP:
-        uaddlp(vf_lp, rd, rn);
-        break;
-      case NEON_SADALP:
-        sadalp(vf_lp, rd, rn);
-        break;
-      case NEON_UADALP:
-        uadalp(vf_lp, rd, rn);
-        break;
-      case NEON_RBIT_NOT:
-        vf = nfd.GetVectorFormat(nfd.LogicalFormatMap());
-        switch (instr->FPType()) {
-          case 0:
-            not_(vf, rd, rn);
-            break;
-          case 1:
-            rbit(vf, rd, rn);
-            break;
-          default:
-            UNIMPLEMENTED();
-        }
-        break;
-    }
-  } else {
-    VectorFormat fpf = nfd.GetVectorFormat(nfd.FPFormatMap());
-    FPRounding fpcr_rounding = static_cast<FPRounding>(fpcr().RMode());
-    bool inexact_exception = false;
-
-    // These instructions all use a one bit size field, except XTN, SQXTUN,
-    // SHLL, SQXTN and UQXTN, which use a two bit size field.
-    switch (instr->Mask(NEON2RegMiscFPMask)) {
-      case NEON_FABS:
-        fabs_(fpf, rd, rn);
-        return;
-      case NEON_FNEG:
-        fneg(fpf, rd, rn);
-        return;
-      case NEON_FSQRT:
-        fsqrt(fpf, rd, rn);
-        return;
-      case NEON_FCVTL:
-        if (instr->Mask(NEON_Q)) {
-          fcvtl2(vf_fcvtl, rd, rn);
-        } else {
-          fcvtl(vf_fcvtl, rd, rn);
-        }
-        return;
-      case NEON_FCVTN:
-        if (instr->Mask(NEON_Q)) {
-          fcvtn2(vf_fcvtn, rd, rn);
-        } else {
-          fcvtn(vf_fcvtn, rd, rn);
-        }
-        return;
-      case NEON_FCVTXN:
-        if (instr->Mask(NEON_Q)) {
-          fcvtxn2(vf_fcvtn, rd, rn);
-        } else {
-          fcvtxn(vf_fcvtn, rd, rn);
-        }
-        return;
-
-      // The following instructions break from the switch statement, rather
-      // than return.
-      case NEON_FRINTI:
-        break;  // Use FPCR rounding mode.
-      case NEON_FRINTX:
-        inexact_exception = true;
-        break;
-      case NEON_FRINTA:
-        fpcr_rounding = FPTieAway;
-        break;
-      case NEON_FRINTM:
-        fpcr_rounding = FPNegativeInfinity;
-        break;
-      case NEON_FRINTN:
-        fpcr_rounding = FPTieEven;
-        break;
-      case NEON_FRINTP:
-        fpcr_rounding = FPPositiveInfinity;
-        break;
-      case NEON_FRINTZ:
-        fpcr_rounding = FPZero;
-        break;
-
-      // The remaining cases return to the caller.
-      case NEON_FCVTNS:
-        fcvts(fpf, rd, rn, FPTieEven);
-        return;
-      case NEON_FCVTNU:
-        fcvtu(fpf, rd, rn, FPTieEven);
-        return;
-      case NEON_FCVTPS:
-        fcvts(fpf, rd, rn, FPPositiveInfinity);
-        return;
-      case NEON_FCVTPU:
-        fcvtu(fpf, rd, rn, FPPositiveInfinity);
-        return;
-      case NEON_FCVTMS:
-        fcvts(fpf, rd, rn, FPNegativeInfinity);
-        return;
-      case NEON_FCVTMU:
-        fcvtu(fpf, rd, rn, FPNegativeInfinity);
-        return;
-      case NEON_FCVTZS:
-        fcvts(fpf, rd, rn, FPZero);
-        return;
-      case NEON_FCVTZU:
-        fcvtu(fpf, rd, rn, FPZero);
-        return;
-      case NEON_FCVTAS:
-        fcvts(fpf, rd, rn, FPTieAway);
-        return;
-      case NEON_FCVTAU:
-        fcvtu(fpf, rd, rn, FPTieAway);
-        return;
-      case NEON_SCVTF:
-        scvtf(fpf, rd, rn, 0, fpcr_rounding);
-        return;
-      case NEON_UCVTF:
-        ucvtf(fpf, rd, rn, 0, fpcr_rounding);
-        return;
-      case NEON_URSQRTE:
-        ursqrte(fpf, rd, rn);
-        return;
-      case NEON_URECPE:
-        urecpe(fpf, rd, rn);
-        return;
-      case NEON_FRSQRTE:
-        frsqrte(fpf, rd, rn);
-        return;
-      case NEON_FRECPE:
-        frecpe(fpf, rd, rn, fpcr_rounding);
-        return;
-      case NEON_FCMGT_zero:
-        fcmp_zero(fpf, rd, rn, gt);
-        return;
-      case NEON_FCMGE_zero:
-        fcmp_zero(fpf, rd, rn, ge);
-        return;
-      case NEON_FCMEQ_zero:
-        fcmp_zero(fpf, rd, rn, eq);
-        return;
-      case NEON_FCMLE_zero:
-        fcmp_zero(fpf, rd, rn, le);
-        return;
-      case NEON_FCMLT_zero:
-        fcmp_zero(fpf, rd, rn, lt);
-        return;
-      default:
-        if ((NEON_XTN_opcode <= instr->Mask(NEON2RegMiscOpcode)) &&
-            (instr->Mask(NEON2RegMiscOpcode) <= NEON_UQXTN_opcode)) {
-          switch (instr->Mask(NEON2RegMiscMask)) {
-            case NEON_XTN:
-              xtn(vf, rd, rn);
-              return;
-            case NEON_SQXTN:
-              sqxtn(vf, rd, rn);
-              return;
-            case NEON_UQXTN:
-              uqxtn(vf, rd, rn);
-              return;
-            case NEON_SQXTUN:
-              sqxtun(vf, rd, rn);
-              return;
-            case NEON_SHLL:
-              vf = nfd.GetVectorFormat(nfd.LongIntegerFormatMap());
-              if (instr->Mask(NEON_Q)) {
-                shll2(vf, rd, rn);
-              } else {
-                shll(vf, rd, rn);
-              }
-              return;
-            default:
-              UNIMPLEMENTED();
-          }
-        } else {
-          UNIMPLEMENTED();
-        }
-    }
-
-    // Only FRINT* instructions fall through the switch above.
-    frint(fpf, rd, rn, fpcr_rounding, inexact_exception);
-  }
-}
-
-void Simulator::VisitNEON3Same(Instruction* instr) {
-  NEONFormatDecoder nfd(instr);
-  SimVRegister& rd = vreg(instr->Rd());
-  SimVRegister& rn = vreg(instr->Rn());
-  SimVRegister& rm = vreg(instr->Rm());
-
-  if (instr->Mask(NEON3SameLogicalFMask) == NEON3SameLogicalFixed) {
-    VectorFormat vf = nfd.GetVectorFormat(nfd.LogicalFormatMap());
-    switch (instr->Mask(NEON3SameLogicalMask)) {
-      case NEON_AND:
-        and_(vf, rd, rn, rm);
-        break;
-      case NEON_ORR:
-        orr(vf, rd, rn, rm);
-        break;
-      case NEON_ORN:
-        orn(vf, rd, rn, rm);
-        break;
-      case NEON_EOR:
-        eor(vf, rd, rn, rm);
-        break;
-      case NEON_BIC:
-        bic(vf, rd, rn, rm);
-        break;
-      case NEON_BIF:
-        bif(vf, rd, rn, rm);
-        break;
-      case NEON_BIT:
-        bit(vf, rd, rn, rm);
-        break;
-      case NEON_BSL:
-        bsl(vf, rd, rn, rm);
-        break;
-      default:
-        UNIMPLEMENTED();
-    }
-  } else if (instr->Mask(NEON3SameFPFMask) == NEON3SameFPFixed) {
-    VectorFormat vf = nfd.GetVectorFormat(nfd.FPFormatMap());
-    switch (instr->Mask(NEON3SameFPMask)) {
-      case NEON_FADD:
-        fadd(vf, rd, rn, rm);
-        break;
-      case NEON_FSUB:
-        fsub(vf, rd, rn, rm);
-        break;
-      case NEON_FMUL:
-        fmul(vf, rd, rn, rm);
-        break;
-      case NEON_FDIV:
-        fdiv(vf, rd, rn, rm);
-        break;
-      case NEON_FMAX:
-        fmax(vf, rd, rn, rm);
-        break;
-      case NEON_FMIN:
-        fmin(vf, rd, rn, rm);
-        break;
-      case NEON_FMAXNM:
-        fmaxnm(vf, rd, rn, rm);
-        break;
-      case NEON_FMINNM:
-        fminnm(vf, rd, rn, rm);
-        break;
-      case NEON_FMLA:
-        fmla(vf, rd, rn, rm);
-        break;
-      case NEON_FMLS:
-        fmls(vf, rd, rn, rm);
-        break;
-      case NEON_FMULX:
-        fmulx(vf, rd, rn, rm);
-        break;
-      case NEON_FACGE:
-        fabscmp(vf, rd, rn, rm, ge);
-        break;
-      case NEON_FACGT:
-        fabscmp(vf, rd, rn, rm, gt);
-        break;
-      case NEON_FCMEQ:
-        fcmp(vf, rd, rn, rm, eq);
-        break;
-      case NEON_FCMGE:
-        fcmp(vf, rd, rn, rm, ge);
-        break;
-      case NEON_FCMGT:
-        fcmp(vf, rd, rn, rm, gt);
-        break;
-      case NEON_FRECPS:
-        frecps(vf, rd, rn, rm);
-        break;
-      case NEON_FRSQRTS:
-        frsqrts(vf, rd, rn, rm);
-        break;
-      case NEON_FABD:
-        fabd(vf, rd, rn, rm);
-        break;
-      case NEON_FADDP:
-        faddp(vf, rd, rn, rm);
-        break;
-      case NEON_FMAXP:
-        fmaxp(vf, rd, rn, rm);
-        break;
-      case NEON_FMAXNMP:
-        fmaxnmp(vf, rd, rn, rm);
-        break;
-      case NEON_FMINP:
-        fminp(vf, rd, rn, rm);
-        break;
-      case NEON_FMINNMP:
-        fminnmp(vf, rd, rn, rm);
-        break;
-      default:
-        UNIMPLEMENTED();
-    }
-  } else {
-    VectorFormat vf = nfd.GetVectorFormat();
-    switch (instr->Mask(NEON3SameMask)) {
-      case NEON_ADD:
-        add(vf, rd, rn, rm);
-        break;
-      case NEON_ADDP:
-        addp(vf, rd, rn, rm);
-        break;
-      case NEON_CMEQ:
-        cmp(vf, rd, rn, rm, eq);
-        break;
-      case NEON_CMGE:
-        cmp(vf, rd, rn, rm, ge);
-        break;
-      case NEON_CMGT:
-        cmp(vf, rd, rn, rm, gt);
-        break;
-      case NEON_CMHI:
-        cmp(vf, rd, rn, rm, hi);
-        break;
-      case NEON_CMHS:
-        cmp(vf, rd, rn, rm, hs);
-        break;
-      case NEON_CMTST:
-        cmptst(vf, rd, rn, rm);
-        break;
-      case NEON_MLS:
-        mls(vf, rd, rn, rm);
-        break;
-      case NEON_MLA:
-        mla(vf, rd, rn, rm);
-        break;
-      case NEON_MUL:
-        mul(vf, rd, rn, rm);
-        break;
-      case NEON_PMUL:
-        pmul(vf, rd, rn, rm);
-        break;
-      case NEON_SMAX:
-        smax(vf, rd, rn, rm);
-        break;
-      case NEON_SMAXP:
-        smaxp(vf, rd, rn, rm);
-        break;
-      case NEON_SMIN:
-        smin(vf, rd, rn, rm);
-        break;
-      case NEON_SMINP:
-        sminp(vf, rd, rn, rm);
-        break;
-      case NEON_SUB:
-        sub(vf, rd, rn, rm);
-        break;
-      case NEON_UMAX:
-        umax(vf, rd, rn, rm);
-        break;
-      case NEON_UMAXP:
-        umaxp(vf, rd, rn, rm);
-        break;
-      case NEON_UMIN:
-        umin(vf, rd, rn, rm);
-        break;
-      case NEON_UMINP:
-        uminp(vf, rd, rn, rm);
-        break;
-      case NEON_SSHL:
-        sshl(vf, rd, rn, rm);
-        break;
-      case NEON_USHL:
-        ushl(vf, rd, rn, rm);
-        break;
-      case NEON_SABD:
-        AbsDiff(vf, rd, rn, rm, true);
-        break;
-      case NEON_UABD:
-        AbsDiff(vf, rd, rn, rm, false);
-        break;
-      case NEON_SABA:
-        saba(vf, rd, rn, rm);
-        break;
-      case NEON_UABA:
-        uaba(vf, rd, rn, rm);
-        break;
-      case NEON_UQADD:
-        add(vf, rd, rn, rm).UnsignedSaturate(vf);
-        break;
-      case NEON_SQADD:
-        add(vf, rd, rn, rm).SignedSaturate(vf);
-        break;
-      case NEON_UQSUB:
-        sub(vf, rd, rn, rm).UnsignedSaturate(vf);
-        break;
-      case NEON_SQSUB:
-        sub(vf, rd, rn, rm).SignedSaturate(vf);
-        break;
-      case NEON_SQDMULH:
-        sqdmulh(vf, rd, rn, rm);
-        break;
-      case NEON_SQRDMULH:
-        sqrdmulh(vf, rd, rn, rm);
-        break;
-      case NEON_UQSHL:
-        ushl(vf, rd, rn, rm).UnsignedSaturate(vf);
-        break;
-      case NEON_SQSHL:
-        sshl(vf, rd, rn, rm).SignedSaturate(vf);
-        break;
-      case NEON_URSHL:
-        ushl(vf, rd, rn, rm).Round(vf);
-        break;
-      case NEON_SRSHL:
-        sshl(vf, rd, rn, rm).Round(vf);
-        break;
-      case NEON_UQRSHL:
-        ushl(vf, rd, rn, rm).Round(vf).UnsignedSaturate(vf);
-        break;
-      case NEON_SQRSHL:
-        sshl(vf, rd, rn, rm).Round(vf).SignedSaturate(vf);
-        break;
-      case NEON_UHADD:
-        add(vf, rd, rn, rm).Uhalve(vf);
-        break;
-      case NEON_URHADD:
-        add(vf, rd, rn, rm).Uhalve(vf).Round(vf);
-        break;
-      case NEON_SHADD:
-        add(vf, rd, rn, rm).Halve(vf);
-        break;
-      case NEON_SRHADD:
-        add(vf, rd, rn, rm).Halve(vf).Round(vf);
-        break;
-      case NEON_UHSUB:
-        sub(vf, rd, rn, rm).Uhalve(vf);
-        break;
-      case NEON_SHSUB:
-        sub(vf, rd, rn, rm).Halve(vf);
-        break;
-      default:
-        UNIMPLEMENTED();
-    }
-  }
-}
-
-void Simulator::VisitNEON3Different(Instruction* instr) {
-  NEONFormatDecoder nfd(instr);
-  VectorFormat vf = nfd.GetVectorFormat();
-  VectorFormat vf_l = nfd.GetVectorFormat(nfd.LongIntegerFormatMap());
-
-  SimVRegister& rd = vreg(instr->Rd());
-  SimVRegister& rn = vreg(instr->Rn());
-  SimVRegister& rm = vreg(instr->Rm());
-
-  switch (instr->Mask(NEON3DifferentMask)) {
-    case NEON_PMULL:
-      pmull(vf_l, rd, rn, rm);
-      break;
-    case NEON_PMULL2:
-      pmull2(vf_l, rd, rn, rm);
-      break;
-    case NEON_UADDL:
-      uaddl(vf_l, rd, rn, rm);
-      break;
-    case NEON_UADDL2:
-      uaddl2(vf_l, rd, rn, rm);
-      break;
-    case NEON_SADDL:
-      saddl(vf_l, rd, rn, rm);
-      break;
-    case NEON_SADDL2:
-      saddl2(vf_l, rd, rn, rm);
-      break;
-    case NEON_USUBL:
-      usubl(vf_l, rd, rn, rm);
-      break;
-    case NEON_USUBL2:
-      usubl2(vf_l, rd, rn, rm);
-      break;
-    case NEON_SSUBL:
-      ssubl(vf_l, rd, rn, rm);
-      break;
-    case NEON_SSUBL2:
-      ssubl2(vf_l, rd, rn, rm);
-      break;
-    case NEON_SABAL:
-      sabal(vf_l, rd, rn, rm);
-      break;
-    case NEON_SABAL2:
-      sabal2(vf_l, rd, rn, rm);
-      break;
-    case NEON_UABAL:
-      uabal(vf_l, rd, rn, rm);
-      break;
-    case NEON_UABAL2:
-      uabal2(vf_l, rd, rn, rm);
-      break;
-    case NEON_SABDL:
-      sabdl(vf_l, rd, rn, rm);
-      break;
-    case NEON_SABDL2:
-      sabdl2(vf_l, rd, rn, rm);
-      break;
-    case NEON_UABDL:
-      uabdl(vf_l, rd, rn, rm);
-      break;
-    case NEON_UABDL2:
-      uabdl2(vf_l, rd, rn, rm);
-      break;
-    case NEON_SMLAL:
-      smlal(vf_l, rd, rn, rm);
-      break;
-    case NEON_SMLAL2:
-      smlal2(vf_l, rd, rn, rm);
-      break;
-    case NEON_UMLAL:
-      umlal(vf_l, rd, rn, rm);
-      break;
-    case NEON_UMLAL2:
-      umlal2(vf_l, rd, rn, rm);
-      break;
-    case NEON_SMLSL:
-      smlsl(vf_l, rd, rn, rm);
-      break;
-    case NEON_SMLSL2:
-      smlsl2(vf_l, rd, rn, rm);
-      break;
-    case NEON_UMLSL:
-      umlsl(vf_l, rd, rn, rm);
-      break;
-    case NEON_UMLSL2:
-      umlsl2(vf_l, rd, rn, rm);
-      break;
-    case NEON_SMULL:
-      smull(vf_l, rd, rn, rm);
-      break;
-    case NEON_SMULL2:
-      smull2(vf_l, rd, rn, rm);
-      break;
-    case NEON_UMULL:
-      umull(vf_l, rd, rn, rm);
-      break;
-    case NEON_UMULL2:
-      umull2(vf_l, rd, rn, rm);
-      break;
-    case NEON_SQDMLAL:
-      sqdmlal(vf_l, rd, rn, rm);
-      break;
-    case NEON_SQDMLAL2:
-      sqdmlal2(vf_l, rd, rn, rm);
-      break;
-    case NEON_SQDMLSL:
-      sqdmlsl(vf_l, rd, rn, rm);
-      break;
-    case NEON_SQDMLSL2:
-      sqdmlsl2(vf_l, rd, rn, rm);
-      break;
-    case NEON_SQDMULL:
-      sqdmull(vf_l, rd, rn, rm);
-      break;
-    case NEON_SQDMULL2:
-      sqdmull2(vf_l, rd, rn, rm);
-      break;
-    case NEON_UADDW:
-      uaddw(vf_l, rd, rn, rm);
-      break;
-    case NEON_UADDW2:
-      uaddw2(vf_l, rd, rn, rm);
-      break;
-    case NEON_SADDW:
-      saddw(vf_l, rd, rn, rm);
-      break;
-    case NEON_SADDW2:
-      saddw2(vf_l, rd, rn, rm);
-      break;
-    case NEON_USUBW:
-      usubw(vf_l, rd, rn, rm);
-      break;
-    case NEON_USUBW2:
-      usubw2(vf_l, rd, rn, rm);
-      break;
-    case NEON_SSUBW:
-      ssubw(vf_l, rd, rn, rm);
-      break;
-    case NEON_SSUBW2:
-      ssubw2(vf_l, rd, rn, rm);
-      break;
-    case NEON_ADDHN:
-      addhn(vf, rd, rn, rm);
-      break;
-    case NEON_ADDHN2:
-      addhn2(vf, rd, rn, rm);
-      break;
-    case NEON_RADDHN:
-      raddhn(vf, rd, rn, rm);
-      break;
-    case NEON_RADDHN2:
-      raddhn2(vf, rd, rn, rm);
-      break;
-    case NEON_SUBHN:
-      subhn(vf, rd, rn, rm);
-      break;
-    case NEON_SUBHN2:
-      subhn2(vf, rd, rn, rm);
-      break;
-    case NEON_RSUBHN:
-      rsubhn(vf, rd, rn, rm);
-      break;
-    case NEON_RSUBHN2:
-      rsubhn2(vf, rd, rn, rm);
-      break;
-    default:
-      UNIMPLEMENTED();
-  }
-}
-
-void Simulator::VisitNEONAcrossLanes(Instruction* instr) {
-  NEONFormatDecoder nfd(instr);
-
-  SimVRegister& rd = vreg(instr->Rd());
-  SimVRegister& rn = vreg(instr->Rn());
-
-  // The input operand's VectorFormat is passed for these instructions.
-  if (instr->Mask(NEONAcrossLanesFPFMask) == NEONAcrossLanesFPFixed) {
-    VectorFormat vf = nfd.GetVectorFormat(nfd.FPFormatMap());
-
-    switch (instr->Mask(NEONAcrossLanesFPMask)) {
-      case NEON_FMAXV:
-        fmaxv(vf, rd, rn);
-        break;
-      case NEON_FMINV:
-        fminv(vf, rd, rn);
-        break;
-      case NEON_FMAXNMV:
-        fmaxnmv(vf, rd, rn);
-        break;
-      case NEON_FMINNMV:
-        fminnmv(vf, rd, rn);
-        break;
-      default:
-        UNIMPLEMENTED();
-    }
-  } else {
-    VectorFormat vf = nfd.GetVectorFormat();
-
-    switch (instr->Mask(NEONAcrossLanesMask)) {
-      case NEON_ADDV:
-        addv(vf, rd, rn);
-        break;
-      case NEON_SMAXV:
-        smaxv(vf, rd, rn);
-        break;
-      case NEON_SMINV:
-        sminv(vf, rd, rn);
-        break;
-      case NEON_UMAXV:
-        umaxv(vf, rd, rn);
-        break;
-      case NEON_UMINV:
-        uminv(vf, rd, rn);
-        break;
-      case NEON_SADDLV:
-        saddlv(vf, rd, rn);
-        break;
-      case NEON_UADDLV:
-        uaddlv(vf, rd, rn);
-        break;
-      default:
-        UNIMPLEMENTED();
-    }
-  }
-}
-
-void Simulator::VisitNEONByIndexedElement(Instruction* instr) {
-  NEONFormatDecoder nfd(instr);
-  VectorFormat vf_r = nfd.GetVectorFormat();
-  VectorFormat vf = nfd.GetVectorFormat(nfd.LongIntegerFormatMap());
-
-  SimVRegister& rd = vreg(instr->Rd());
-  SimVRegister& rn = vreg(instr->Rn());
-
-  ByElementOp Op = nullptr;
-
-  int rm_reg = instr->Rm();
-  int index = (instr->NEONH() << 1) | instr->NEONL();
-  if (instr->NEONSize() == 1) {
-    rm_reg &= 0xF;
-    index = (index << 1) | instr->NEONM();
-  }
-
-  switch (instr->Mask(NEONByIndexedElementMask)) {
-    case NEON_MUL_byelement:
-      Op = &Simulator::mul;
-      vf = vf_r;
-      break;
-    case NEON_MLA_byelement:
-      Op = &Simulator::mla;
-      vf = vf_r;
-      break;
-    case NEON_MLS_byelement:
-      Op = &Simulator::mls;
-      vf = vf_r;
-      break;
-    case NEON_SQDMULH_byelement:
-      Op = &Simulator::sqdmulh;
-      vf = vf_r;
-      break;
-    case NEON_SQRDMULH_byelement:
-      Op = &Simulator::sqrdmulh;
-      vf = vf_r;
-      break;
-    case NEON_SMULL_byelement:
-      if (instr->Mask(NEON_Q)) {
-        Op = &Simulator::smull2;
-      } else {
-        Op = &Simulator::smull;
-      }
-      break;
-    case NEON_UMULL_byelement:
-      if (instr->Mask(NEON_Q)) {
-        Op = &Simulator::umull2;
-      } else {
-        Op = &Simulator::umull;
-      }
-      break;
-    case NEON_SMLAL_byelement:
-      if (instr->Mask(NEON_Q)) {
-        Op = &Simulator::smlal2;
-      } else {
-        Op = &Simulator::smlal;
-      }
-      break;
-    case NEON_UMLAL_byelement:
-      if (instr->Mask(NEON_Q)) {
-        Op = &Simulator::umlal2;
-      } else {
-        Op = &Simulator::umlal;
-      }
-      break;
-    case NEON_SMLSL_byelement:
-      if (instr->Mask(NEON_Q)) {
-        Op = &Simulator::smlsl2;
-      } else {
-        Op = &Simulator::smlsl;
-      }
-      break;
-    case NEON_UMLSL_byelement:
-      if (instr->Mask(NEON_Q)) {
-        Op = &Simulator::umlsl2;
-      } else {
-        Op = &Simulator::umlsl;
-      }
-      break;
-    case NEON_SQDMULL_byelement:
-      if (instr->Mask(NEON_Q)) {
-        Op = &Simulator::sqdmull2;
-      } else {
-        Op = &Simulator::sqdmull;
-      }
-      break;
-    case NEON_SQDMLAL_byelement:
-      if (instr->Mask(NEON_Q)) {
-        Op = &Simulator::sqdmlal2;
-      } else {
-        Op = &Simulator::sqdmlal;
-      }
-      break;
-    case NEON_SQDMLSL_byelement:
-      if (instr->Mask(NEON_Q)) {
-        Op = &Simulator::sqdmlsl2;
-      } else {
-        Op = &Simulator::sqdmlsl;
-      }
-      break;
-    default:
-      index = instr->NEONH();
-      if ((instr->FPType() & 1) == 0) {
-        index = (index << 1) | instr->NEONL();
-      }
-
-      vf = nfd.GetVectorFormat(nfd.FPFormatMap());
-
-      switch (instr->Mask(NEONByIndexedElementFPMask)) {
-        case NEON_FMUL_byelement:
-          Op = &Simulator::fmul;
-          break;
-        case NEON_FMLA_byelement:
-          Op = &Simulator::fmla;
-          break;
-        case NEON_FMLS_byelement:
-          Op = &Simulator::fmls;
-          break;
-        case NEON_FMULX_byelement:
-          Op = &Simulator::fmulx;
-          break;
-        default:
-          UNIMPLEMENTED();
-      }
-  }
-
-  (this->*Op)(vf, rd, rn, vreg(rm_reg), index);
-}
-
-void Simulator::VisitNEONCopy(Instruction* instr) {
-  NEONFormatDecoder nfd(instr, NEONFormatDecoder::TriangularFormatMap());
-  VectorFormat vf = nfd.GetVectorFormat();
-
-  SimVRegister& rd = vreg(instr->Rd());
-  SimVRegister& rn = vreg(instr->Rn());
-  int imm5 = instr->ImmNEON5();
-  int lsb = LowestSetBitPosition(imm5);
-  int reg_index = imm5 >> lsb;
-
-  if (instr->Mask(NEONCopyInsElementMask) == NEON_INS_ELEMENT) {
-    int imm4 = instr->ImmNEON4();
-    DCHECK_GE(lsb, 1);
-    int rn_index = imm4 >> (lsb - 1);
-    ins_element(vf, rd, reg_index, rn, rn_index);
-  } else if (instr->Mask(NEONCopyInsGeneralMask) == NEON_INS_GENERAL) {
-    ins_immediate(vf, rd, reg_index, xreg(instr->Rn()));
-  } else if (instr->Mask(NEONCopyUmovMask) == NEON_UMOV) {
-    uint64_t value = LogicVRegister(rn).Uint(vf, reg_index);
-    value &= MaxUintFromFormat(vf);
-    set_xreg(instr->Rd(), value);
-  } else if (instr->Mask(NEONCopyUmovMask) == NEON_SMOV) {
-    int64_t value = LogicVRegister(rn).Int(vf, reg_index);
-    if (instr->NEONQ()) {
-      set_xreg(instr->Rd(), value);
-    } else {
-      DCHECK(is_int32(value));
-      set_wreg(instr->Rd(), static_cast<int32_t>(value));
-    }
-  } else if (instr->Mask(NEONCopyDupElementMask) == NEON_DUP_ELEMENT) {
-    dup_element(vf, rd, rn, reg_index);
-  } else if (instr->Mask(NEONCopyDupGeneralMask) == NEON_DUP_GENERAL) {
-    dup_immediate(vf, rd, xreg(instr->Rn()));
-  } else {
-    UNIMPLEMENTED();
-  }
-}
-
-void Simulator::VisitNEONExtract(Instruction* instr) {
-  NEONFormatDecoder nfd(instr, NEONFormatDecoder::LogicalFormatMap());
-  VectorFormat vf = nfd.GetVectorFormat();
-  SimVRegister& rd = vreg(instr->Rd());
-  SimVRegister& rn = vreg(instr->Rn());
-  SimVRegister& rm = vreg(instr->Rm());
-  if (instr->Mask(NEONExtractMask) == NEON_EXT) {
-    int index = instr->ImmNEONExt();
-    ext(vf, rd, rn, rm, index);
-  } else {
-    UNIMPLEMENTED();
-  }
-}
-
-void Simulator::NEONLoadStoreMultiStructHelper(const Instruction* instr,
-                                               AddrMode addr_mode) {
-  NEONFormatDecoder nfd(instr, NEONFormatDecoder::LoadStoreFormatMap());
-  VectorFormat vf = nfd.GetVectorFormat();
-
-  uint64_t addr_base = xreg(instr->Rn(), Reg31IsStackPointer);
-  int reg_size = RegisterSizeInBytesFromFormat(vf);
-
-  int reg[4];
-  uint64_t addr[4];
-  for (int i = 0; i < 4; i++) {
-    reg[i] = (instr->Rt() + i) % kNumberOfVRegisters;
-    addr[i] = addr_base + (i * reg_size);
-  }
-  int count = 1;
-  bool log_read = true;
-
-  // Bit 23 determines whether this is an offset or post-index addressing mode.
-  // In offset mode, bits 20 to 16 should be zero; these bits encode the
-  // register of immediate in post-index mode.
-  if ((instr->Bit(23) == 0) && (instr->Bits(20, 16) != 0)) {
-    UNREACHABLE();
-  }
-
-  // We use the PostIndex mask here, as it works in this case for both Offset
-  // and PostIndex addressing.
-  switch (instr->Mask(NEONLoadStoreMultiStructPostIndexMask)) {
-    case NEON_LD1_4v:
-    case NEON_LD1_4v_post:
-      ld1(vf, vreg(reg[3]), addr[3]);
-      count++;  // Fall through.
-    case NEON_LD1_3v:
-    case NEON_LD1_3v_post:
-      ld1(vf, vreg(reg[2]), addr[2]);
-      count++;  // Fall through.
-    case NEON_LD1_2v:
-    case NEON_LD1_2v_post:
-      ld1(vf, vreg(reg[1]), addr[1]);
-      count++;  // Fall through.
-    case NEON_LD1_1v:
-    case NEON_LD1_1v_post:
-      ld1(vf, vreg(reg[0]), addr[0]);
-      break;
-    case NEON_ST1_4v:
-    case NEON_ST1_4v_post:
-      st1(vf, vreg(reg[3]), addr[3]);
-      count++;  // Fall through.
-    case NEON_ST1_3v:
-    case NEON_ST1_3v_post:
-      st1(vf, vreg(reg[2]), addr[2]);
-      count++;  // Fall through.
-    case NEON_ST1_2v:
-    case NEON_ST1_2v_post:
-      st1(vf, vreg(reg[1]), addr[1]);
-      count++;  // Fall through.
-    case NEON_ST1_1v:
-    case NEON_ST1_1v_post:
-      st1(vf, vreg(reg[0]), addr[0]);
-      log_read = false;
-      break;
-    case NEON_LD2_post:
-    case NEON_LD2:
-      ld2(vf, vreg(reg[0]), vreg(reg[1]), addr[0]);
-      count = 2;
-      break;
-    case NEON_ST2:
-    case NEON_ST2_post:
-      st2(vf, vreg(reg[0]), vreg(reg[1]), addr[0]);
-      count = 2;
-      log_read = false;
-      break;
-    case NEON_LD3_post:
-    case NEON_LD3:
-      ld3(vf, vreg(reg[0]), vreg(reg[1]), vreg(reg[2]), addr[0]);
-      count = 3;
-      break;
-    case NEON_ST3:
-    case NEON_ST3_post:
-      st3(vf, vreg(reg[0]), vreg(reg[1]), vreg(reg[2]), addr[0]);
-      count = 3;
-      log_read = false;
-      break;
-    case NEON_LD4_post:
-    case NEON_LD4:
-      ld4(vf, vreg(reg[0]), vreg(reg[1]), vreg(reg[2]), vreg(reg[3]), addr[0]);
-      count = 4;
-      break;
-    case NEON_ST4:
-    case NEON_ST4_post:
-      st4(vf, vreg(reg[0]), vreg(reg[1]), vreg(reg[2]), vreg(reg[3]), addr[0]);
-      count = 4;
-      log_read = false;
-      break;
-    default:
-      UNIMPLEMENTED();
-  }
-
-  {
-    base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-    if (log_read) {
-      local_monitor_.NotifyLoad();
-    } else {
-      local_monitor_.NotifyStore();
-      global_monitor_.Pointer()->NotifyStore_Locked(&global_monitor_processor_);
-    }
-  }
-
-  // Explicitly log the register update whilst we have type information.
-  for (int i = 0; i < count; i++) {
-    // For de-interleaving loads, only print the base address.
-    int lane_size = LaneSizeInBytesFromFormat(vf);
-    PrintRegisterFormat format = GetPrintRegisterFormatTryFP(
-        GetPrintRegisterFormatForSize(reg_size, lane_size));
-    if (log_read) {
-      LogVRead(addr_base, reg[i], format);
-    } else {
-      LogVWrite(addr_base, reg[i], format);
-    }
-  }
-
-  if (addr_mode == PostIndex) {
-    int rm = instr->Rm();
-    // The immediate post index addressing mode is indicated by rm = 31.
-    // The immediate is implied by the number of vector registers used.
-    addr_base +=
-        (rm == 31) ? RegisterSizeInBytesFromFormat(vf) * count : xreg(rm);
-    set_xreg(instr->Rn(), addr_base);
-  } else {
-    DCHECK_EQ(addr_mode, Offset);
-  }
-}
-
-void Simulator::VisitNEONLoadStoreMultiStruct(Instruction* instr) {
-  NEONLoadStoreMultiStructHelper(instr, Offset);
-}
-
-void Simulator::VisitNEONLoadStoreMultiStructPostIndex(Instruction* instr) {
-  NEONLoadStoreMultiStructHelper(instr, PostIndex);
-}
-
-void Simulator::NEONLoadStoreSingleStructHelper(const Instruction* instr,
-                                                AddrMode addr_mode) {
-  uint64_t addr = xreg(instr->Rn(), Reg31IsStackPointer);
-  int rt = instr->Rt();
-
-  // Bit 23 determines whether this is an offset or post-index addressing mode.
-  // In offset mode, bits 20 to 16 should be zero; these bits encode the
-  // register of immediate in post-index mode.
-  DCHECK_IMPLIES(instr->Bit(23) == 0, instr->Bits(20, 16) == 0);
-
-  bool do_load = false;
-
-  NEONFormatDecoder nfd(instr, NEONFormatDecoder::LoadStoreFormatMap());
-  VectorFormat vf_t = nfd.GetVectorFormat();
-
-  VectorFormat vf = kFormat16B;
-  // We use the PostIndex mask here, as it works in this case for both Offset
-  // and PostIndex addressing.
-  switch (instr->Mask(NEONLoadStoreSingleStructPostIndexMask)) {
-    case NEON_LD1_b:
-    case NEON_LD1_b_post:
-    case NEON_LD2_b:
-    case NEON_LD2_b_post:
-    case NEON_LD3_b:
-    case NEON_LD3_b_post:
-    case NEON_LD4_b:
-    case NEON_LD4_b_post:
-      do_load = true;  // Fall through.
-    case NEON_ST1_b:
-    case NEON_ST1_b_post:
-    case NEON_ST2_b:
-    case NEON_ST2_b_post:
-    case NEON_ST3_b:
-    case NEON_ST3_b_post:
-    case NEON_ST4_b:
-    case NEON_ST4_b_post:
-      break;
-
-    case NEON_LD1_h:
-    case NEON_LD1_h_post:
-    case NEON_LD2_h:
-    case NEON_LD2_h_post:
-    case NEON_LD3_h:
-    case NEON_LD3_h_post:
-    case NEON_LD4_h:
-    case NEON_LD4_h_post:
-      do_load = true;  // Fall through.
-    case NEON_ST1_h:
-    case NEON_ST1_h_post:
-    case NEON_ST2_h:
-    case NEON_ST2_h_post:
-    case NEON_ST3_h:
-    case NEON_ST3_h_post:
-    case NEON_ST4_h:
-    case NEON_ST4_h_post:
-      vf = kFormat8H;
-      break;
-
-    case NEON_LD1_s:
-    case NEON_LD1_s_post:
-    case NEON_LD2_s:
-    case NEON_LD2_s_post:
-    case NEON_LD3_s:
-    case NEON_LD3_s_post:
-    case NEON_LD4_s:
-    case NEON_LD4_s_post:
-      do_load = true;  // Fall through.
-    case NEON_ST1_s:
-    case NEON_ST1_s_post:
-    case NEON_ST2_s:
-    case NEON_ST2_s_post:
-    case NEON_ST3_s:
-    case NEON_ST3_s_post:
-    case NEON_ST4_s:
-    case NEON_ST4_s_post: {
-      static_assert((NEON_LD1_s | (1 << NEONLSSize_offset)) == NEON_LD1_d,
-                    "LSB of size distinguishes S and D registers.");
-      static_assert(
-          (NEON_LD1_s_post | (1 << NEONLSSize_offset)) == NEON_LD1_d_post,
-          "LSB of size distinguishes S and D registers.");
-      static_assert((NEON_ST1_s | (1 << NEONLSSize_offset)) == NEON_ST1_d,
-                    "LSB of size distinguishes S and D registers.");
-      static_assert(
-          (NEON_ST1_s_post | (1 << NEONLSSize_offset)) == NEON_ST1_d_post,
-          "LSB of size distinguishes S and D registers.");
-      vf = ((instr->NEONLSSize() & 1) == 0) ? kFormat4S : kFormat2D;
-      break;
-    }
-
-    case NEON_LD1R:
-    case NEON_LD1R_post: {
-      vf = vf_t;
-      ld1r(vf, vreg(rt), addr);
-      do_load = true;
-      break;
-    }
-
-    case NEON_LD2R:
-    case NEON_LD2R_post: {
-      vf = vf_t;
-      int rt2 = (rt + 1) % kNumberOfVRegisters;
-      ld2r(vf, vreg(rt), vreg(rt2), addr);
-      do_load = true;
-      break;
-    }
-
-    case NEON_LD3R:
-    case NEON_LD3R_post: {
-      vf = vf_t;
-      int rt2 = (rt + 1) % kNumberOfVRegisters;
-      int rt3 = (rt2 + 1) % kNumberOfVRegisters;
-      ld3r(vf, vreg(rt), vreg(rt2), vreg(rt3), addr);
-      do_load = true;
-      break;
-    }
-
-    case NEON_LD4R:
-    case NEON_LD4R_post: {
-      vf = vf_t;
-      int rt2 = (rt + 1) % kNumberOfVRegisters;
-      int rt3 = (rt2 + 1) % kNumberOfVRegisters;
-      int rt4 = (rt3 + 1) % kNumberOfVRegisters;
-      ld4r(vf, vreg(rt), vreg(rt2), vreg(rt3), vreg(rt4), addr);
-      do_load = true;
-      break;
-    }
-    default:
-      UNIMPLEMENTED();
-  }
-
-  PrintRegisterFormat print_format =
-      GetPrintRegisterFormatTryFP(GetPrintRegisterFormat(vf));
-  // Make sure that the print_format only includes a single lane.
-  print_format =
-      static_cast<PrintRegisterFormat>(print_format & ~kPrintRegAsVectorMask);
-
-  int esize = LaneSizeInBytesFromFormat(vf);
-  int index_shift = LaneSizeInBytesLog2FromFormat(vf);
-  int lane = instr->NEONLSIndex(index_shift);
-  int scale = 0;
-  int rt2 = (rt + 1) % kNumberOfVRegisters;
-  int rt3 = (rt2 + 1) % kNumberOfVRegisters;
-  int rt4 = (rt3 + 1) % kNumberOfVRegisters;
-  switch (instr->Mask(NEONLoadStoreSingleLenMask)) {
-    case NEONLoadStoreSingle1:
-      scale = 1;
-      if (do_load) {
-        ld1(vf, vreg(rt), lane, addr);
-        LogVRead(addr, rt, print_format, lane);
-      } else {
-        st1(vf, vreg(rt), lane, addr);
-        LogVWrite(addr, rt, print_format, lane);
-      }
-      break;
-    case NEONLoadStoreSingle2:
-      scale = 2;
-      if (do_load) {
-        ld2(vf, vreg(rt), vreg(rt2), lane, addr);
-        LogVRead(addr, rt, print_format, lane);
-        LogVRead(addr + esize, rt2, print_format, lane);
-      } else {
-        st2(vf, vreg(rt), vreg(rt2), lane, addr);
-        LogVWrite(addr, rt, print_format, lane);
-        LogVWrite(addr + esize, rt2, print_format, lane);
-      }
-      break;
-    case NEONLoadStoreSingle3:
-      scale = 3;
-      if (do_load) {
-        ld3(vf, vreg(rt), vreg(rt2), vreg(rt3), lane, addr);
-        LogVRead(addr, rt, print_format, lane);
-        LogVRead(addr + esize, rt2, print_format, lane);
-        LogVRead(addr + (2 * esize), rt3, print_format, lane);
-      } else {
-        st3(vf, vreg(rt), vreg(rt2), vreg(rt3), lane, addr);
-        LogVWrite(addr, rt, print_format, lane);
-        LogVWrite(addr + esize, rt2, print_format, lane);
-        LogVWrite(addr + (2 * esize), rt3, print_format, lane);
-      }
-      break;
-    case NEONLoadStoreSingle4:
-      scale = 4;
-      if (do_load) {
-        ld4(vf, vreg(rt), vreg(rt2), vreg(rt3), vreg(rt4), lane, addr);
-        LogVRead(addr, rt, print_format, lane);
-        LogVRead(addr + esize, rt2, print_format, lane);
-        LogVRead(addr + (2 * esize), rt3, print_format, lane);
-        LogVRead(addr + (3 * esize), rt4, print_format, lane);
-      } else {
-        st4(vf, vreg(rt), vreg(rt2), vreg(rt3), vreg(rt4), lane, addr);
-        LogVWrite(addr, rt, print_format, lane);
-        LogVWrite(addr + esize, rt2, print_format, lane);
-        LogVWrite(addr + (2 * esize), rt3, print_format, lane);
-        LogVWrite(addr + (3 * esize), rt4, print_format, lane);
-      }
-      break;
-    default:
-      UNIMPLEMENTED();
-  }
-
-  {
-    base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-    if (do_load) {
-      local_monitor_.NotifyLoad();
-    } else {
-      local_monitor_.NotifyStore();
-      global_monitor_.Pointer()->NotifyStore_Locked(&global_monitor_processor_);
-    }
-  }
-
-  if (addr_mode == PostIndex) {
-    int rm = instr->Rm();
-    int lane_size = LaneSizeInBytesFromFormat(vf);
-    set_xreg(instr->Rn(), addr + ((rm == 31) ? (scale * lane_size) : xreg(rm)));
-  }
-}
-
-void Simulator::VisitNEONLoadStoreSingleStruct(Instruction* instr) {
-  NEONLoadStoreSingleStructHelper(instr, Offset);
-}
-
-void Simulator::VisitNEONLoadStoreSingleStructPostIndex(Instruction* instr) {
-  NEONLoadStoreSingleStructHelper(instr, PostIndex);
-}
-
-void Simulator::VisitNEONModifiedImmediate(Instruction* instr) {
-  SimVRegister& rd = vreg(instr->Rd());
-  int cmode = instr->NEONCmode();
-  int cmode_3_1 = (cmode >> 1) & 7;
-  int cmode_3 = (cmode >> 3) & 1;
-  int cmode_2 = (cmode >> 2) & 1;
-  int cmode_1 = (cmode >> 1) & 1;
-  int cmode_0 = cmode & 1;
-  int q = instr->NEONQ();
-  int op_bit = instr->NEONModImmOp();
-  uint64_t imm8 = instr->ImmNEONabcdefgh();
-
-  // Find the format and immediate value
-  uint64_t imm = 0;
-  VectorFormat vform = kFormatUndefined;
-  switch (cmode_3_1) {
-    case 0x0:
-    case 0x1:
-    case 0x2:
-    case 0x3:
-      vform = (q == 1) ? kFormat4S : kFormat2S;
-      imm = imm8 << (8 * cmode_3_1);
-      break;
-    case 0x4:
-    case 0x5:
-      vform = (q == 1) ? kFormat8H : kFormat4H;
-      imm = imm8 << (8 * cmode_1);
-      break;
-    case 0x6:
-      vform = (q == 1) ? kFormat4S : kFormat2S;
-      if (cmode_0 == 0) {
-        imm = imm8 << 8 | 0x000000FF;
-      } else {
-        imm = imm8 << 16 | 0x0000FFFF;
-      }
-      break;
-    case 0x7:
-      if (cmode_0 == 0 && op_bit == 0) {
-        vform = q ? kFormat16B : kFormat8B;
-        imm = imm8;
-      } else if (cmode_0 == 0 && op_bit == 1) {
-        vform = q ? kFormat2D : kFormat1D;
-        imm = 0;
-        for (int i = 0; i < 8; ++i) {
-          if (imm8 & (1 << i)) {
-            imm |= (UINT64_C(0xFF) << (8 * i));
-          }
-        }
-      } else {  // cmode_0 == 1, cmode == 0xF.
-        if (op_bit == 0) {
-          vform = q ? kFormat4S : kFormat2S;
-          imm = bit_cast<uint32_t>(instr->ImmNEONFP32());
-        } else if (q == 1) {
-          vform = kFormat2D;
-          imm = bit_cast<uint64_t>(instr->ImmNEONFP64());
-        } else {
-          DCHECK((q == 0) && (op_bit == 1) && (cmode == 0xF));
-          VisitUnallocated(instr);
-        }
-      }
-      break;
-    default:
-      UNREACHABLE();
-  }
-
-  // Find the operation.
-  NEONModifiedImmediateOp op;
-  if (cmode_3 == 0) {
-    if (cmode_0 == 0) {
-      op = op_bit ? NEONModifiedImmediate_MVNI : NEONModifiedImmediate_MOVI;
-    } else {  // cmode<0> == '1'
-      op = op_bit ? NEONModifiedImmediate_BIC : NEONModifiedImmediate_ORR;
-    }
-  } else {  // cmode<3> == '1'
-    if (cmode_2 == 0) {
-      if (cmode_0 == 0) {
-        op = op_bit ? NEONModifiedImmediate_MVNI : NEONModifiedImmediate_MOVI;
-      } else {  // cmode<0> == '1'
-        op = op_bit ? NEONModifiedImmediate_BIC : NEONModifiedImmediate_ORR;
-      }
-    } else {  // cmode<2> == '1'
-      if (cmode_1 == 0) {
-        op = op_bit ? NEONModifiedImmediate_MVNI : NEONModifiedImmediate_MOVI;
-      } else {  // cmode<1> == '1'
-        if (cmode_0 == 0) {
-          op = NEONModifiedImmediate_MOVI;
-        } else {  // cmode<0> == '1'
-          op = NEONModifiedImmediate_MOVI;
-        }
-      }
-    }
-  }
-
-  // Call the logic function.
-  switch (op) {
-    case NEONModifiedImmediate_ORR:
-      orr(vform, rd, rd, imm);
-      break;
-    case NEONModifiedImmediate_BIC:
-      bic(vform, rd, rd, imm);
-      break;
-    case NEONModifiedImmediate_MOVI:
-      movi(vform, rd, imm);
-      break;
-    case NEONModifiedImmediate_MVNI:
-      mvni(vform, rd, imm);
-      break;
-    default:
-      VisitUnimplemented(instr);
-  }
-}
-
-void Simulator::VisitNEONScalar2RegMisc(Instruction* instr) {
-  NEONFormatDecoder nfd(instr, NEONFormatDecoder::ScalarFormatMap());
-  VectorFormat vf = nfd.GetVectorFormat();
-
-  SimVRegister& rd = vreg(instr->Rd());
-  SimVRegister& rn = vreg(instr->Rn());
-
-  if (instr->Mask(NEON2RegMiscOpcode) <= NEON_NEG_scalar_opcode) {
-    // These instructions all use a two bit size field, except NOT and RBIT,
-    // which use the field to encode the operation.
-    switch (instr->Mask(NEONScalar2RegMiscMask)) {
-      case NEON_CMEQ_zero_scalar:
-        cmp(vf, rd, rn, 0, eq);
-        break;
-      case NEON_CMGE_zero_scalar:
-        cmp(vf, rd, rn, 0, ge);
-        break;
-      case NEON_CMGT_zero_scalar:
-        cmp(vf, rd, rn, 0, gt);
-        break;
-      case NEON_CMLT_zero_scalar:
-        cmp(vf, rd, rn, 0, lt);
-        break;
-      case NEON_CMLE_zero_scalar:
-        cmp(vf, rd, rn, 0, le);
-        break;
-      case NEON_ABS_scalar:
-        abs(vf, rd, rn);
-        break;
-      case NEON_SQABS_scalar:
-        abs(vf, rd, rn).SignedSaturate(vf);
-        break;
-      case NEON_NEG_scalar:
-        neg(vf, rd, rn);
-        break;
-      case NEON_SQNEG_scalar:
-        neg(vf, rd, rn).SignedSaturate(vf);
-        break;
-      case NEON_SUQADD_scalar:
-        suqadd(vf, rd, rn);
-        break;
-      case NEON_USQADD_scalar:
-        usqadd(vf, rd, rn);
-        break;
-      default:
-        UNIMPLEMENTED();
-        break;
-    }
-  } else {
-    VectorFormat fpf = nfd.GetVectorFormat(nfd.FPScalarFormatMap());
-    FPRounding fpcr_rounding = static_cast<FPRounding>(fpcr().RMode());
-
-    // These instructions all use a one bit size field, except SQXTUN, SQXTN
-    // and UQXTN, which use a two bit size field.
-    switch (instr->Mask(NEONScalar2RegMiscFPMask)) {
-      case NEON_FRECPE_scalar:
-        frecpe(fpf, rd, rn, fpcr_rounding);
-        break;
-      case NEON_FRECPX_scalar:
-        frecpx(fpf, rd, rn);
-        break;
-      case NEON_FRSQRTE_scalar:
-        frsqrte(fpf, rd, rn);
-        break;
-      case NEON_FCMGT_zero_scalar:
-        fcmp_zero(fpf, rd, rn, gt);
-        break;
-      case NEON_FCMGE_zero_scalar:
-        fcmp_zero(fpf, rd, rn, ge);
-        break;
-      case NEON_FCMEQ_zero_scalar:
-        fcmp_zero(fpf, rd, rn, eq);
-        break;
-      case NEON_FCMLE_zero_scalar:
-        fcmp_zero(fpf, rd, rn, le);
-        break;
-      case NEON_FCMLT_zero_scalar:
-        fcmp_zero(fpf, rd, rn, lt);
-        break;
-      case NEON_SCVTF_scalar:
-        scvtf(fpf, rd, rn, 0, fpcr_rounding);
-        break;
-      case NEON_UCVTF_scalar:
-        ucvtf(fpf, rd, rn, 0, fpcr_rounding);
-        break;
-      case NEON_FCVTNS_scalar:
-        fcvts(fpf, rd, rn, FPTieEven);
-        break;
-      case NEON_FCVTNU_scalar:
-        fcvtu(fpf, rd, rn, FPTieEven);
-        break;
-      case NEON_FCVTPS_scalar:
-        fcvts(fpf, rd, rn, FPPositiveInfinity);
-        break;
-      case NEON_FCVTPU_scalar:
-        fcvtu(fpf, rd, rn, FPPositiveInfinity);
-        break;
-      case NEON_FCVTMS_scalar:
-        fcvts(fpf, rd, rn, FPNegativeInfinity);
-        break;
-      case NEON_FCVTMU_scalar:
-        fcvtu(fpf, rd, rn, FPNegativeInfinity);
-        break;
-      case NEON_FCVTZS_scalar:
-        fcvts(fpf, rd, rn, FPZero);
-        break;
-      case NEON_FCVTZU_scalar:
-        fcvtu(fpf, rd, rn, FPZero);
-        break;
-      case NEON_FCVTAS_scalar:
-        fcvts(fpf, rd, rn, FPTieAway);
-        break;
-      case NEON_FCVTAU_scalar:
-        fcvtu(fpf, rd, rn, FPTieAway);
-        break;
-      case NEON_FCVTXN_scalar:
-        // Unlike all of the other FP instructions above, fcvtxn encodes dest
-        // size S as size<0>=1. There's only one case, so we ignore the form.
-        DCHECK_EQ(instr->Bit(22), 1);
-        fcvtxn(kFormatS, rd, rn);
-        break;
-      default:
-        switch (instr->Mask(NEONScalar2RegMiscMask)) {
-          case NEON_SQXTN_scalar:
-            sqxtn(vf, rd, rn);
-            break;
-          case NEON_UQXTN_scalar:
-            uqxtn(vf, rd, rn);
-            break;
-          case NEON_SQXTUN_scalar:
-            sqxtun(vf, rd, rn);
-            break;
-          default:
-            UNIMPLEMENTED();
-        }
-    }
-  }
-}
-
-void Simulator::VisitNEONScalar3Diff(Instruction* instr) {
-  NEONFormatDecoder nfd(instr, NEONFormatDecoder::LongScalarFormatMap());
-  VectorFormat vf = nfd.GetVectorFormat();
-
-  SimVRegister& rd = vreg(instr->Rd());
-  SimVRegister& rn = vreg(instr->Rn());
-  SimVRegister& rm = vreg(instr->Rm());
-  switch (instr->Mask(NEONScalar3DiffMask)) {
-    case NEON_SQDMLAL_scalar:
-      sqdmlal(vf, rd, rn, rm);
-      break;
-    case NEON_SQDMLSL_scalar:
-      sqdmlsl(vf, rd, rn, rm);
-      break;
-    case NEON_SQDMULL_scalar:
-      sqdmull(vf, rd, rn, rm);
-      break;
-    default:
-      UNIMPLEMENTED();
-  }
-}
-
-void Simulator::VisitNEONScalar3Same(Instruction* instr) {
-  NEONFormatDecoder nfd(instr, NEONFormatDecoder::ScalarFormatMap());
-  VectorFormat vf = nfd.GetVectorFormat();
-
-  SimVRegister& rd = vreg(instr->Rd());
-  SimVRegister& rn = vreg(instr->Rn());
-  SimVRegister& rm = vreg(instr->Rm());
-
-  if (instr->Mask(NEONScalar3SameFPFMask) == NEONScalar3SameFPFixed) {
-    vf = nfd.GetVectorFormat(nfd.FPScalarFormatMap());
-    switch (instr->Mask(NEONScalar3SameFPMask)) {
-      case NEON_FMULX_scalar:
-        fmulx(vf, rd, rn, rm);
-        break;
-      case NEON_FACGE_scalar:
-        fabscmp(vf, rd, rn, rm, ge);
-        break;
-      case NEON_FACGT_scalar:
-        fabscmp(vf, rd, rn, rm, gt);
-        break;
-      case NEON_FCMEQ_scalar:
-        fcmp(vf, rd, rn, rm, eq);
-        break;
-      case NEON_FCMGE_scalar:
-        fcmp(vf, rd, rn, rm, ge);
-        break;
-      case NEON_FCMGT_scalar:
-        fcmp(vf, rd, rn, rm, gt);
-        break;
-      case NEON_FRECPS_scalar:
-        frecps(vf, rd, rn, rm);
-        break;
-      case NEON_FRSQRTS_scalar:
-        frsqrts(vf, rd, rn, rm);
-        break;
-      case NEON_FABD_scalar:
-        fabd(vf, rd, rn, rm);
-        break;
-      default:
-        UNIMPLEMENTED();
-    }
-  } else {
-    switch (instr->Mask(NEONScalar3SameMask)) {
-      case NEON_ADD_scalar:
-        add(vf, rd, rn, rm);
-        break;
-      case NEON_SUB_scalar:
-        sub(vf, rd, rn, rm);
-        break;
-      case NEON_CMEQ_scalar:
-        cmp(vf, rd, rn, rm, eq);
-        break;
-      case NEON_CMGE_scalar:
-        cmp(vf, rd, rn, rm, ge);
-        break;
-      case NEON_CMGT_scalar:
-        cmp(vf, rd, rn, rm, gt);
-        break;
-      case NEON_CMHI_scalar:
-        cmp(vf, rd, rn, rm, hi);
-        break;
-      case NEON_CMHS_scalar:
-        cmp(vf, rd, rn, rm, hs);
-        break;
-      case NEON_CMTST_scalar:
-        cmptst(vf, rd, rn, rm);
-        break;
-      case NEON_USHL_scalar:
-        ushl(vf, rd, rn, rm);
-        break;
-      case NEON_SSHL_scalar:
-        sshl(vf, rd, rn, rm);
-        break;
-      case NEON_SQDMULH_scalar:
-        sqdmulh(vf, rd, rn, rm);
-        break;
-      case NEON_SQRDMULH_scalar:
-        sqrdmulh(vf, rd, rn, rm);
-        break;
-      case NEON_UQADD_scalar:
-        add(vf, rd, rn, rm).UnsignedSaturate(vf);
-        break;
-      case NEON_SQADD_scalar:
-        add(vf, rd, rn, rm).SignedSaturate(vf);
-        break;
-      case NEON_UQSUB_scalar:
-        sub(vf, rd, rn, rm).UnsignedSaturate(vf);
-        break;
-      case NEON_SQSUB_scalar:
-        sub(vf, rd, rn, rm).SignedSaturate(vf);
-        break;
-      case NEON_UQSHL_scalar:
-        ushl(vf, rd, rn, rm).UnsignedSaturate(vf);
-        break;
-      case NEON_SQSHL_scalar:
-        sshl(vf, rd, rn, rm).SignedSaturate(vf);
-        break;
-      case NEON_URSHL_scalar:
-        ushl(vf, rd, rn, rm).Round(vf);
-        break;
-      case NEON_SRSHL_scalar:
-        sshl(vf, rd, rn, rm).Round(vf);
-        break;
-      case NEON_UQRSHL_scalar:
-        ushl(vf, rd, rn, rm).Round(vf).UnsignedSaturate(vf);
-        break;
-      case NEON_SQRSHL_scalar:
-        sshl(vf, rd, rn, rm).Round(vf).SignedSaturate(vf);
-        break;
-      default:
-        UNIMPLEMENTED();
-    }
-  }
-}
-
-void Simulator::VisitNEONScalarByIndexedElement(Instruction* instr) {
-  NEONFormatDecoder nfd(instr, NEONFormatDecoder::LongScalarFormatMap());
-  VectorFormat vf = nfd.GetVectorFormat();
-  VectorFormat vf_r = nfd.GetVectorFormat(nfd.ScalarFormatMap());
-
-  SimVRegister& rd = vreg(instr->Rd());
-  SimVRegister& rn = vreg(instr->Rn());
-  ByElementOp Op = nullptr;
-
-  int rm_reg = instr->Rm();
-  int index = (instr->NEONH() << 1) | instr->NEONL();
-  if (instr->NEONSize() == 1) {
-    rm_reg &= 0xF;
-    index = (index << 1) | instr->NEONM();
-  }
-
-  switch (instr->Mask(NEONScalarByIndexedElementMask)) {
-    case NEON_SQDMULL_byelement_scalar:
-      Op = &Simulator::sqdmull;
-      break;
-    case NEON_SQDMLAL_byelement_scalar:
-      Op = &Simulator::sqdmlal;
-      break;
-    case NEON_SQDMLSL_byelement_scalar:
-      Op = &Simulator::sqdmlsl;
-      break;
-    case NEON_SQDMULH_byelement_scalar:
-      Op = &Simulator::sqdmulh;
-      vf = vf_r;
-      break;
-    case NEON_SQRDMULH_byelement_scalar:
-      Op = &Simulator::sqrdmulh;
-      vf = vf_r;
-      break;
-    default:
-      vf = nfd.GetVectorFormat(nfd.FPScalarFormatMap());
-      index = instr->NEONH();
-      if ((instr->FPType() & 1) == 0) {
-        index = (index << 1) | instr->NEONL();
-      }
-      switch (instr->Mask(NEONScalarByIndexedElementFPMask)) {
-        case NEON_FMUL_byelement_scalar:
-          Op = &Simulator::fmul;
-          break;
-        case NEON_FMLA_byelement_scalar:
-          Op = &Simulator::fmla;
-          break;
-        case NEON_FMLS_byelement_scalar:
-          Op = &Simulator::fmls;
-          break;
-        case NEON_FMULX_byelement_scalar:
-          Op = &Simulator::fmulx;
-          break;
-        default:
-          UNIMPLEMENTED();
-      }
-  }
-
-  (this->*Op)(vf, rd, rn, vreg(rm_reg), index);
-}
-
-void Simulator::VisitNEONScalarCopy(Instruction* instr) {
-  NEONFormatDecoder nfd(instr, NEONFormatDecoder::TriangularScalarFormatMap());
-  VectorFormat vf = nfd.GetVectorFormat();
-
-  SimVRegister& rd = vreg(instr->Rd());
-  SimVRegister& rn = vreg(instr->Rn());
-
-  if (instr->Mask(NEONScalarCopyMask) == NEON_DUP_ELEMENT_scalar) {
-    int imm5 = instr->ImmNEON5();
-    int lsb = LowestSetBitPosition(imm5);
-    int rn_index = imm5 >> lsb;
-    dup_element(vf, rd, rn, rn_index);
-  } else {
-    UNIMPLEMENTED();
-  }
-}
-
-void Simulator::VisitNEONScalarPairwise(Instruction* instr) {
-  NEONFormatDecoder nfd(instr, NEONFormatDecoder::FPScalarFormatMap());
-  VectorFormat vf = nfd.GetVectorFormat();
-
-  SimVRegister& rd = vreg(instr->Rd());
-  SimVRegister& rn = vreg(instr->Rn());
-  switch (instr->Mask(NEONScalarPairwiseMask)) {
-    case NEON_ADDP_scalar:
-      addp(vf, rd, rn);
-      break;
-    case NEON_FADDP_scalar:
-      faddp(vf, rd, rn);
-      break;
-    case NEON_FMAXP_scalar:
-      fmaxp(vf, rd, rn);
-      break;
-    case NEON_FMAXNMP_scalar:
-      fmaxnmp(vf, rd, rn);
-      break;
-    case NEON_FMINP_scalar:
-      fminp(vf, rd, rn);
-      break;
-    case NEON_FMINNMP_scalar:
-      fminnmp(vf, rd, rn);
-      break;
-    default:
-      UNIMPLEMENTED();
-  }
-}
-
-void Simulator::VisitNEONScalarShiftImmediate(Instruction* instr) {
-  SimVRegister& rd = vreg(instr->Rd());
-  SimVRegister& rn = vreg(instr->Rn());
-  FPRounding fpcr_rounding = static_cast<FPRounding>(fpcr().RMode());
-
-  static const NEONFormatMap map = {
-      {22, 21, 20, 19},
-      {NF_UNDEF, NF_B, NF_H, NF_H, NF_S, NF_S, NF_S, NF_S, NF_D, NF_D, NF_D,
-       NF_D, NF_D, NF_D, NF_D, NF_D}};
-  NEONFormatDecoder nfd(instr, &map);
-  VectorFormat vf = nfd.GetVectorFormat();
-
-  int highestSetBit = HighestSetBitPosition(instr->ImmNEONImmh());
-  int immhimmb = instr->ImmNEONImmhImmb();
-  int right_shift = (16 << highestSetBit) - immhimmb;
-  int left_shift = immhimmb - (8 << highestSetBit);
-  switch (instr->Mask(NEONScalarShiftImmediateMask)) {
-    case NEON_SHL_scalar:
-      shl(vf, rd, rn, left_shift);
-      break;
-    case NEON_SLI_scalar:
-      sli(vf, rd, rn, left_shift);
-      break;
-    case NEON_SQSHL_imm_scalar:
-      sqshl(vf, rd, rn, left_shift);
-      break;
-    case NEON_UQSHL_imm_scalar:
-      uqshl(vf, rd, rn, left_shift);
-      break;
-    case NEON_SQSHLU_scalar:
-      sqshlu(vf, rd, rn, left_shift);
-      break;
-    case NEON_SRI_scalar:
-      sri(vf, rd, rn, right_shift);
-      break;
-    case NEON_SSHR_scalar:
-      sshr(vf, rd, rn, right_shift);
-      break;
-    case NEON_USHR_scalar:
-      ushr(vf, rd, rn, right_shift);
-      break;
-    case NEON_SRSHR_scalar:
-      sshr(vf, rd, rn, right_shift).Round(vf);
-      break;
-    case NEON_URSHR_scalar:
-      ushr(vf, rd, rn, right_shift).Round(vf);
-      break;
-    case NEON_SSRA_scalar:
-      ssra(vf, rd, rn, right_shift);
-      break;
-    case NEON_USRA_scalar:
-      usra(vf, rd, rn, right_shift);
-      break;
-    case NEON_SRSRA_scalar:
-      srsra(vf, rd, rn, right_shift);
-      break;
-    case NEON_URSRA_scalar:
-      ursra(vf, rd, rn, right_shift);
-      break;
-    case NEON_UQSHRN_scalar:
-      uqshrn(vf, rd, rn, right_shift);
-      break;
-    case NEON_UQRSHRN_scalar:
-      uqrshrn(vf, rd, rn, right_shift);
-      break;
-    case NEON_SQSHRN_scalar:
-      sqshrn(vf, rd, rn, right_shift);
-      break;
-    case NEON_SQRSHRN_scalar:
-      sqrshrn(vf, rd, rn, right_shift);
-      break;
-    case NEON_SQSHRUN_scalar:
-      sqshrun(vf, rd, rn, right_shift);
-      break;
-    case NEON_SQRSHRUN_scalar:
-      sqrshrun(vf, rd, rn, right_shift);
-      break;
-    case NEON_FCVTZS_imm_scalar:
-      fcvts(vf, rd, rn, FPZero, right_shift);
-      break;
-    case NEON_FCVTZU_imm_scalar:
-      fcvtu(vf, rd, rn, FPZero, right_shift);
-      break;
-    case NEON_SCVTF_imm_scalar:
-      scvtf(vf, rd, rn, right_shift, fpcr_rounding);
-      break;
-    case NEON_UCVTF_imm_scalar:
-      ucvtf(vf, rd, rn, right_shift, fpcr_rounding);
-      break;
-    default:
-      UNIMPLEMENTED();
-  }
-}
-
-void Simulator::VisitNEONShiftImmediate(Instruction* instr) {
-  SimVRegister& rd = vreg(instr->Rd());
-  SimVRegister& rn = vreg(instr->Rn());
-  FPRounding fpcr_rounding = static_cast<FPRounding>(fpcr().RMode());
-
-  // 00010->8B, 00011->16B, 001x0->4H, 001x1->8H,
-  // 01xx0->2S, 01xx1->4S, 1xxx1->2D, all others undefined.
-  static const NEONFormatMap map = {
-      {22, 21, 20, 19, 30},
-      {NF_UNDEF, NF_UNDEF, NF_8B,    NF_16B, NF_4H,    NF_8H, NF_4H,    NF_8H,
-       NF_2S,    NF_4S,    NF_2S,    NF_4S,  NF_2S,    NF_4S, NF_2S,    NF_4S,
-       NF_UNDEF, NF_2D,    NF_UNDEF, NF_2D,  NF_UNDEF, NF_2D, NF_UNDEF, NF_2D,
-       NF_UNDEF, NF_2D,    NF_UNDEF, NF_2D,  NF_UNDEF, NF_2D, NF_UNDEF, NF_2D}};
-  NEONFormatDecoder nfd(instr, &map);
-  VectorFormat vf = nfd.GetVectorFormat();
-
-  // 0001->8H, 001x->4S, 01xx->2D, all others undefined.
-  static const NEONFormatMap map_l = {
-      {22, 21, 20, 19},
-      {NF_UNDEF, NF_8H, NF_4S, NF_4S, NF_2D, NF_2D, NF_2D, NF_2D}};
-  VectorFormat vf_l = nfd.GetVectorFormat(&map_l);
-
-  int highestSetBit = HighestSetBitPosition(instr->ImmNEONImmh());
-  int immhimmb = instr->ImmNEONImmhImmb();
-  int right_shift = (16 << highestSetBit) - immhimmb;
-  int left_shift = immhimmb - (8 << highestSetBit);
-
-  switch (instr->Mask(NEONShiftImmediateMask)) {
-    case NEON_SHL:
-      shl(vf, rd, rn, left_shift);
-      break;
-    case NEON_SLI:
-      sli(vf, rd, rn, left_shift);
-      break;
-    case NEON_SQSHLU:
-      sqshlu(vf, rd, rn, left_shift);
-      break;
-    case NEON_SRI:
-      sri(vf, rd, rn, right_shift);
-      break;
-    case NEON_SSHR:
-      sshr(vf, rd, rn, right_shift);
-      break;
-    case NEON_USHR:
-      ushr(vf, rd, rn, right_shift);
-      break;
-    case NEON_SRSHR:
-      sshr(vf, rd, rn, right_shift).Round(vf);
-      break;
-    case NEON_URSHR:
-      ushr(vf, rd, rn, right_shift).Round(vf);
-      break;
-    case NEON_SSRA:
-      ssra(vf, rd, rn, right_shift);
-      break;
-    case NEON_USRA:
-      usra(vf, rd, rn, right_shift);
-      break;
-    case NEON_SRSRA:
-      srsra(vf, rd, rn, right_shift);
-      break;
-    case NEON_URSRA:
-      ursra(vf, rd, rn, right_shift);
-      break;
-    case NEON_SQSHL_imm:
-      sqshl(vf, rd, rn, left_shift);
-      break;
-    case NEON_UQSHL_imm:
-      uqshl(vf, rd, rn, left_shift);
-      break;
-    case NEON_SCVTF_imm:
-      scvtf(vf, rd, rn, right_shift, fpcr_rounding);
-      break;
-    case NEON_UCVTF_imm:
-      ucvtf(vf, rd, rn, right_shift, fpcr_rounding);
-      break;
-    case NEON_FCVTZS_imm:
-      fcvts(vf, rd, rn, FPZero, right_shift);
-      break;
-    case NEON_FCVTZU_imm:
-      fcvtu(vf, rd, rn, FPZero, right_shift);
-      break;
-    case NEON_SSHLL:
-      vf = vf_l;
-      if (instr->Mask(NEON_Q)) {
-        sshll2(vf, rd, rn, left_shift);
-      } else {
-        sshll(vf, rd, rn, left_shift);
-      }
-      break;
-    case NEON_USHLL:
-      vf = vf_l;
-      if (instr->Mask(NEON_Q)) {
-        ushll2(vf, rd, rn, left_shift);
-      } else {
-        ushll(vf, rd, rn, left_shift);
-      }
-      break;
-    case NEON_SHRN:
-      if (instr->Mask(NEON_Q)) {
-        shrn2(vf, rd, rn, right_shift);
-      } else {
-        shrn(vf, rd, rn, right_shift);
-      }
-      break;
-    case NEON_RSHRN:
-      if (instr->Mask(NEON_Q)) {
-        rshrn2(vf, rd, rn, right_shift);
-      } else {
-        rshrn(vf, rd, rn, right_shift);
-      }
-      break;
-    case NEON_UQSHRN:
-      if (instr->Mask(NEON_Q)) {
-        uqshrn2(vf, rd, rn, right_shift);
-      } else {
-        uqshrn(vf, rd, rn, right_shift);
-      }
-      break;
-    case NEON_UQRSHRN:
-      if (instr->Mask(NEON_Q)) {
-        uqrshrn2(vf, rd, rn, right_shift);
-      } else {
-        uqrshrn(vf, rd, rn, right_shift);
-      }
-      break;
-    case NEON_SQSHRN:
-      if (instr->Mask(NEON_Q)) {
-        sqshrn2(vf, rd, rn, right_shift);
-      } else {
-        sqshrn(vf, rd, rn, right_shift);
-      }
-      break;
-    case NEON_SQRSHRN:
-      if (instr->Mask(NEON_Q)) {
-        sqrshrn2(vf, rd, rn, right_shift);
-      } else {
-        sqrshrn(vf, rd, rn, right_shift);
-      }
-      break;
-    case NEON_SQSHRUN:
-      if (instr->Mask(NEON_Q)) {
-        sqshrun2(vf, rd, rn, right_shift);
-      } else {
-        sqshrun(vf, rd, rn, right_shift);
-      }
-      break;
-    case NEON_SQRSHRUN:
-      if (instr->Mask(NEON_Q)) {
-        sqrshrun2(vf, rd, rn, right_shift);
-      } else {
-        sqrshrun(vf, rd, rn, right_shift);
-      }
-      break;
-    default:
-      UNIMPLEMENTED();
-  }
-}
-
-void Simulator::VisitNEONTable(Instruction* instr) {
-  NEONFormatDecoder nfd(instr, NEONFormatDecoder::LogicalFormatMap());
-  VectorFormat vf = nfd.GetVectorFormat();
-
-  SimVRegister& rd = vreg(instr->Rd());
-  SimVRegister& rn = vreg(instr->Rn());
-  SimVRegister& rn2 = vreg((instr->Rn() + 1) % kNumberOfVRegisters);
-  SimVRegister& rn3 = vreg((instr->Rn() + 2) % kNumberOfVRegisters);
-  SimVRegister& rn4 = vreg((instr->Rn() + 3) % kNumberOfVRegisters);
-  SimVRegister& rm = vreg(instr->Rm());
-
-  switch (instr->Mask(NEONTableMask)) {
-    case NEON_TBL_1v:
-      tbl(vf, rd, rn, rm);
-      break;
-    case NEON_TBL_2v:
-      tbl(vf, rd, rn, rn2, rm);
-      break;
-    case NEON_TBL_3v:
-      tbl(vf, rd, rn, rn2, rn3, rm);
-      break;
-    case NEON_TBL_4v:
-      tbl(vf, rd, rn, rn2, rn3, rn4, rm);
-      break;
-    case NEON_TBX_1v:
-      tbx(vf, rd, rn, rm);
-      break;
-    case NEON_TBX_2v:
-      tbx(vf, rd, rn, rn2, rm);
-      break;
-    case NEON_TBX_3v:
-      tbx(vf, rd, rn, rn2, rn3, rm);
-      break;
-    case NEON_TBX_4v:
-      tbx(vf, rd, rn, rn2, rn3, rn4, rm);
-      break;
-    default:
-      UNIMPLEMENTED();
-  }
-}
-
-void Simulator::VisitNEONPerm(Instruction* instr) {
-  NEONFormatDecoder nfd(instr);
-  VectorFormat vf = nfd.GetVectorFormat();
-
-  SimVRegister& rd = vreg(instr->Rd());
-  SimVRegister& rn = vreg(instr->Rn());
-  SimVRegister& rm = vreg(instr->Rm());
-
-  switch (instr->Mask(NEONPermMask)) {
-    case NEON_TRN1:
-      trn1(vf, rd, rn, rm);
-      break;
-    case NEON_TRN2:
-      trn2(vf, rd, rn, rm);
-      break;
-    case NEON_UZP1:
-      uzp1(vf, rd, rn, rm);
-      break;
-    case NEON_UZP2:
-      uzp2(vf, rd, rn, rm);
-      break;
-    case NEON_ZIP1:
-      zip1(vf, rd, rn, rm);
-      break;
-    case NEON_ZIP2:
-      zip2(vf, rd, rn, rm);
-      break;
-    default:
-      UNIMPLEMENTED();
-  }
-}
-
-void Simulator::DoPrintf(Instruction* instr) {
-  DCHECK((instr->Mask(ExceptionMask) == HLT) &&
-              (instr->ImmException() == kImmExceptionIsPrintf));
-
-  // Read the arguments encoded inline in the instruction stream.
-  uint32_t arg_count;
-  uint32_t arg_pattern_list;
-  STATIC_ASSERT(sizeof(*instr) == 1);
-  memcpy(&arg_count,
-         instr + kPrintfArgCountOffset,
-         sizeof(arg_count));
-  memcpy(&arg_pattern_list,
-         instr + kPrintfArgPatternListOffset,
-         sizeof(arg_pattern_list));
-
-  DCHECK_LE(arg_count, kPrintfMaxArgCount);
-  DCHECK_EQ(arg_pattern_list >> (kPrintfArgPatternBits * arg_count), 0);
-
-  // We need to call the host printf function with a set of arguments defined by
-  // arg_pattern_list. Because we don't know the types and sizes of the
-  // arguments, this is very difficult to do in a robust and portable way. To
-  // work around the problem, we pick apart the format string, and print one
-  // format placeholder at a time.
-
-  // Allocate space for the format string. We take a copy, so we can modify it.
-  // Leave enough space for one extra character per expected argument (plus the
-  // '\0' termination).
-  const char * format_base = reg<const char *>(0);
-  DCHECK_NOT_NULL(format_base);
-  size_t length = strlen(format_base) + 1;
-  char * const format = new char[length + arg_count];
-
-  // A list of chunks, each with exactly one format placeholder.
-  const char * chunks[kPrintfMaxArgCount];
-
-  // Copy the format string and search for format placeholders.
-  uint32_t placeholder_count = 0;
-  char * format_scratch = format;
-  for (size_t i = 0; i < length; i++) {
-    if (format_base[i] != '%') {
-      *format_scratch++ = format_base[i];
-    } else {
-      if (format_base[i + 1] == '%') {
-        // Ignore explicit "%%" sequences.
-        *format_scratch++ = format_base[i];
-
-        if (placeholder_count == 0) {
-          // The first chunk is passed to printf using "%s", so we need to
-          // unescape "%%" sequences in this chunk. (Just skip the next '%'.)
-          i++;
-        } else {
-          // Otherwise, pass through "%%" unchanged.
-          *format_scratch++ = format_base[++i];
-        }
-      } else {
-        CHECK(placeholder_count < arg_count);
-        // Insert '\0' before placeholders, and store their locations.
-        *format_scratch++ = '\0';
-        chunks[placeholder_count++] = format_scratch;
-        *format_scratch++ = format_base[i];
-      }
-    }
-  }
-  DCHECK(format_scratch <= (format + length + arg_count));
-  CHECK(placeholder_count == arg_count);
-
-  // Finally, call printf with each chunk, passing the appropriate register
-  // argument. Normally, printf returns the number of bytes transmitted, so we
-  // can emulate a single printf call by adding the result from each chunk. If
-  // any call returns a negative (error) value, though, just return that value.
-
-  fprintf(stream_, "%s", clr_printf);
-
-  // Because '\0' is inserted before each placeholder, the first string in
-  // 'format' contains no format placeholders and should be printed literally.
-  int result = fprintf(stream_, "%s", format);
-  int pcs_r = 1;      // Start at x1. x0 holds the format string.
-  int pcs_f = 0;      // Start at d0.
-  if (result >= 0) {
-    for (uint32_t i = 0; i < placeholder_count; i++) {
-      int part_result = -1;
-
-      uint32_t arg_pattern = arg_pattern_list >> (i * kPrintfArgPatternBits);
-      arg_pattern &= (1 << kPrintfArgPatternBits) - 1;
-      switch (arg_pattern) {
-        case kPrintfArgW:
-          part_result = fprintf(stream_, chunks[i], wreg(pcs_r++));
-          break;
-        case kPrintfArgX:
-          part_result = fprintf(stream_, chunks[i], xreg(pcs_r++));
-          break;
-        case kPrintfArgD:
-          part_result = fprintf(stream_, chunks[i], dreg(pcs_f++));
-          break;
-        default: UNREACHABLE();
-      }
-
-      if (part_result < 0) {
-        // Handle error values.
-        result = part_result;
-        break;
-      }
-
-      result += part_result;
-    }
-  }
-
-  fprintf(stream_, "%s", clr_normal);
-
-#ifdef DEBUG
-  CorruptAllCallerSavedCPURegisters();
-#endif
-
-  // Printf returns its result in x0 (just like the C library's printf).
-  set_xreg(0, result);
-
-  // The printf parameters are inlined in the code, so skip them.
-  set_pc(instr->InstructionAtOffset(kPrintfLength));
-
-  // Set LR as if we'd just called a native printf function.
-  set_lr(pc());
-
-  delete[] format;
-}
-
-Simulator::LocalMonitor::LocalMonitor()
-    : access_state_(MonitorAccess::Open),
-      tagged_addr_(0),
-      size_(TransactionSize::None) {}
-
-void Simulator::LocalMonitor::Clear() {
-  access_state_ = MonitorAccess::Open;
-  tagged_addr_ = 0;
-  size_ = TransactionSize::None;
-}
-
-void Simulator::LocalMonitor::NotifyLoad() {
-  if (access_state_ == MonitorAccess::Exclusive) {
-    // A non exclusive load could clear the local monitor. As a result, it's
-    // most strict to unconditionally clear the local monitor on load.
-    Clear();
-  }
-}
-
-void Simulator::LocalMonitor::NotifyLoadExcl(uintptr_t addr,
-                                             TransactionSize size) {
-  access_state_ = MonitorAccess::Exclusive;
-  tagged_addr_ = addr;
-  size_ = size;
-}
-
-void Simulator::LocalMonitor::NotifyStore() {
-  if (access_state_ == MonitorAccess::Exclusive) {
-    // A non exclusive store could clear the local monitor. As a result, it's
-    // most strict to unconditionally clear the local monitor on store.
-    Clear();
-  }
-}
-
-bool Simulator::LocalMonitor::NotifyStoreExcl(uintptr_t addr,
-                                              TransactionSize size) {
-  if (access_state_ == MonitorAccess::Exclusive) {
-    // It is allowed for a processor to require that the address matches
-    // exactly (B2.10.1), so this comparison does not mask addr.
-    if (addr == tagged_addr_ && size_ == size) {
-      Clear();
-      return true;
-    } else {
-      // It is implementation-defined whether an exclusive store to a
-      // non-tagged address will update memory. As a result, it's most strict
-      // to unconditionally clear the local monitor.
-      Clear();
-      return false;
-    }
-  } else {
-    DCHECK(access_state_ == MonitorAccess::Open);
-    return false;
-  }
-}
-
-Simulator::GlobalMonitor::Processor::Processor()
-    : access_state_(MonitorAccess::Open),
-      tagged_addr_(0),
-      next_(nullptr),
-      prev_(nullptr),
-      failure_counter_(0) {}
-
-void Simulator::GlobalMonitor::Processor::Clear_Locked() {
-  access_state_ = MonitorAccess::Open;
-  tagged_addr_ = 0;
-}
-
-void Simulator::GlobalMonitor::Processor::NotifyLoadExcl_Locked(
-    uintptr_t addr) {
-  access_state_ = MonitorAccess::Exclusive;
-  tagged_addr_ = addr;
-}
-
-void Simulator::GlobalMonitor::Processor::NotifyStore_Locked(
-    bool is_requesting_processor) {
-  if (access_state_ == MonitorAccess::Exclusive) {
-    // A non exclusive store could clear the global monitor. As a result, it's
-    // most strict to unconditionally clear global monitors on store.
-    Clear_Locked();
-  }
-}
-
-bool Simulator::GlobalMonitor::Processor::NotifyStoreExcl_Locked(
-    uintptr_t addr, bool is_requesting_processor) {
-  if (access_state_ == MonitorAccess::Exclusive) {
-    if (is_requesting_processor) {
-      // It is allowed for a processor to require that the address matches
-      // exactly (B2.10.2), so this comparison does not mask addr.
-      if (addr == tagged_addr_) {
-        Clear_Locked();
-        // Introduce occasional stxr failures. This is to simulate the
-        // behavior of hardware, which can randomly fail due to background
-        // cache evictions.
-        if (failure_counter_++ >= kMaxFailureCounter) {
-          failure_counter_ = 0;
-          return false;
-        } else {
-          return true;
-        }
-      }
-    } else if ((addr & kExclusiveTaggedAddrMask) ==
-               (tagged_addr_ & kExclusiveTaggedAddrMask)) {
-      // Check the masked addresses when responding to a successful lock by
-      // another processor so the implementation is more conservative (i.e. the
-      // granularity of locking is as large as possible.)
-      Clear_Locked();
-      return false;
-    }
-  }
-  return false;
-}
-
-Simulator::GlobalMonitor::GlobalMonitor() : head_(nullptr) {}
-
-void Simulator::GlobalMonitor::NotifyLoadExcl_Locked(uintptr_t addr,
-                                                     Processor* processor) {
-  processor->NotifyLoadExcl_Locked(addr);
-  PrependProcessor_Locked(processor);
-}
-
-void Simulator::GlobalMonitor::NotifyStore_Locked(Processor* processor) {
-  // Notify each processor of the store operation.
-  for (Processor* iter = head_; iter; iter = iter->next_) {
-    bool is_requesting_processor = iter == processor;
-    iter->NotifyStore_Locked(is_requesting_processor);
-  }
-}
-
-bool Simulator::GlobalMonitor::NotifyStoreExcl_Locked(uintptr_t addr,
-                                                      Processor* processor) {
-  DCHECK(IsProcessorInLinkedList_Locked(processor));
-  if (processor->NotifyStoreExcl_Locked(addr, true)) {
-    // Notify the other processors that this StoreExcl succeeded.
-    for (Processor* iter = head_; iter; iter = iter->next_) {
-      if (iter != processor) {
-        iter->NotifyStoreExcl_Locked(addr, false);
-      }
-    }
-    return true;
-  } else {
-    return false;
-  }
-}
-
-bool Simulator::GlobalMonitor::IsProcessorInLinkedList_Locked(
-    Processor* processor) const {
-  return head_ == processor || processor->next_ || processor->prev_;
-}
-
-void Simulator::GlobalMonitor::PrependProcessor_Locked(Processor* processor) {
-  if (IsProcessorInLinkedList_Locked(processor)) {
-    return;
-  }
-
-  if (head_) {
-    head_->prev_ = processor;
-  }
-  processor->prev_ = nullptr;
-  processor->next_ = head_;
-  head_ = processor;
-}
-
-void Simulator::GlobalMonitor::RemoveProcessor(Processor* processor) {
-  base::LockGuard<base::Mutex> lock_guard(&mutex);
-  if (!IsProcessorInLinkedList_Locked(processor)) {
-    return;
-  }
-
-  if (processor->prev_) {
-    processor->prev_->next_ = processor->next_;
-  } else {
-    head_ = processor->next_;
-  }
-  if (processor->next_) {
-    processor->next_->prev_ = processor->prev_;
-  }
-  processor->prev_ = nullptr;
-  processor->next_ = nullptr;
-}
-
-#endif  // USE_SIMULATOR
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_ARM64
diff --git a/src/v8/src/arm64/simulator-arm64.h b/src/v8/src/arm64/simulator-arm64.h
deleted file mode 100644
index a8f229d..0000000
--- a/src/v8/src/arm64/simulator-arm64.h
+++ /dev/null
@@ -1,2362 +0,0 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_ARM64_SIMULATOR_ARM64_H_
-#define V8_ARM64_SIMULATOR_ARM64_H_
-
-#include <stdarg.h>
-#include <vector>
-
-#include "src/allocation.h"
-#include "src/arm64/assembler-arm64.h"
-#include "src/arm64/decoder-arm64.h"
-#include "src/arm64/disasm-arm64.h"
-#include "src/arm64/instrument-arm64.h"
-#include "src/assembler.h"
-#include "src/base/compiler-specific.h"
-#include "src/globals.h"
-#include "src/simulator-base.h"
-#include "src/utils.h"
-
-namespace v8 {
-namespace internal {
-
-#if defined(USE_SIMULATOR)
-
-// Assemble the specified IEEE-754 components into the target type and apply
-// appropriate rounding.
-//  sign:     0 = positive, 1 = negative
-//  exponent: Unbiased IEEE-754 exponent.
-//  mantissa: The mantissa of the input. The top bit (which is not encoded for
-//            normal IEEE-754 values) must not be omitted. This bit has the
-//            value 'pow(2, exponent)'.
-//
-// The input value is assumed to be a normalized value. That is, the input may
-// not be infinity or NaN. If the source value is subnormal, it must be
-// normalized before calling this function such that the highest set bit in the
-// mantissa has the value 'pow(2, exponent)'.
-//
-// Callers should use FPRoundToFloat or FPRoundToDouble directly, rather than
-// calling a templated FPRound.
-template <class T, int ebits, int mbits>
-T FPRound(int64_t sign, int64_t exponent, uint64_t mantissa,
-          FPRounding round_mode) {
-  static_assert((sizeof(T) * 8) >= (1 + ebits + mbits),
-                "destination type T not large enough");
-  static_assert(sizeof(T) <= sizeof(uint64_t),
-                "maximum size of destination type T is 64 bits");
-  static_assert(std::is_unsigned<T>::value,
-                "destination type T must be unsigned");
-
-  DCHECK((sign == 0) || (sign == 1));
-
-  // Only FPTieEven and FPRoundOdd rounding modes are implemented.
-  DCHECK((round_mode == FPTieEven) || (round_mode == FPRoundOdd));
-
-  // Rounding can promote subnormals to normals, and normals to infinities. For
-  // example, a double with exponent 127 (FLT_MAX_EXP) would appear to be
-  // encodable as a float, but rounding based on the low-order mantissa bits
-  // could make it overflow. With ties-to-even rounding, this value would become
-  // an infinity.
-
-  // ---- Rounding Method ----
-  //
-  // The exponent is irrelevant in the rounding operation, so we treat the
-  // lowest-order bit that will fit into the result ('onebit') as having
-  // the value '1'. Similarly, the highest-order bit that won't fit into
-  // the result ('halfbit') has the value '0.5'. The 'point' sits between
-  // 'onebit' and 'halfbit':
-  //
-  //            These bits fit into the result.
-  //               |---------------------|
-  //  mantissa = 0bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-  //                                     ||
-  //                                    / |
-  //                                   /  halfbit
-  //                               onebit
-  //
-  // For subnormal outputs, the range of representable bits is smaller and
-  // the position of onebit and halfbit depends on the exponent of the
-  // input, but the method is otherwise similar.
-  //
-  //   onebit(frac)
-  //     |
-  //     | halfbit(frac)          halfbit(adjusted)
-  //     | /                      /
-  //     | |                      |
-  //  0b00.0 (exact)      -> 0b00.0 (exact)                    -> 0b00
-  //  0b00.0...           -> 0b00.0...                         -> 0b00
-  //  0b00.1 (exact)      -> 0b00.0111..111                    -> 0b00
-  //  0b00.1...           -> 0b00.1...                         -> 0b01
-  //  0b01.0 (exact)      -> 0b01.0 (exact)                    -> 0b01
-  //  0b01.0...           -> 0b01.0...                         -> 0b01
-  //  0b01.1 (exact)      -> 0b01.1 (exact)                    -> 0b10
-  //  0b01.1...           -> 0b01.1...                         -> 0b10
-  //  0b10.0 (exact)      -> 0b10.0 (exact)                    -> 0b10
-  //  0b10.0...           -> 0b10.0...                         -> 0b10
-  //  0b10.1 (exact)      -> 0b10.0111..111                    -> 0b10
-  //  0b10.1...           -> 0b10.1...                         -> 0b11
-  //  0b11.0 (exact)      -> 0b11.0 (exact)                    -> 0b11
-  //  ...                   /             |                      /   |
-  //                       /              |                     /    |
-  //                                                           /     |
-  // adjusted = frac - (halfbit(mantissa) & ~onebit(frac));   /      |
-  //
-  //                   mantissa = (mantissa >> shift) + halfbit(adjusted);
-
-  const int mantissa_offset = 0;
-  const int exponent_offset = mantissa_offset + mbits;
-  const int sign_offset = exponent_offset + ebits;
-  DCHECK_EQ(sign_offset, static_cast<int>(sizeof(T) * 8 - 1));
-
-  // Bail out early for zero inputs.
-  if (mantissa == 0) {
-    return static_cast<T>(sign << sign_offset);
-  }
-
-  // If all bits in the exponent are set, the value is infinite or NaN.
-  // This is true for all binary IEEE-754 formats.
-  const int infinite_exponent = (1 << ebits) - 1;
-  const int max_normal_exponent = infinite_exponent - 1;
-
-  // Apply the exponent bias to encode it for the result. Doing this early makes
-  // it easy to detect values that will be infinite or subnormal.
-  exponent += max_normal_exponent >> 1;
-
-  if (exponent > max_normal_exponent) {
-    // Overflow: the input is too large for the result type to represent.
-    if (round_mode == FPTieEven) {
-      // FPTieEven rounding mode handles overflows using infinities.
-      exponent = infinite_exponent;
-      mantissa = 0;
-    } else {
-      DCHECK_EQ(round_mode, FPRoundOdd);
-      // FPRoundOdd rounding mode handles overflows using the largest magnitude
-      // normal number.
-      exponent = max_normal_exponent;
-      mantissa = (UINT64_C(1) << exponent_offset) - 1;
-    }
-    return static_cast<T>((sign << sign_offset) |
-                          (exponent << exponent_offset) |
-                          (mantissa << mantissa_offset));
-  }
-
-  // Calculate the shift required to move the top mantissa bit to the proper
-  // place in the destination type.
-  const int highest_significant_bit = 63 - CountLeadingZeros(mantissa, 64);
-  int shift = highest_significant_bit - mbits;
-
-  if (exponent <= 0) {
-    // The output will be subnormal (before rounding).
-    // For subnormal outputs, the shift must be adjusted by the exponent. The +1
-    // is necessary because the exponent of a subnormal value (encoded as 0) is
-    // the same as the exponent of the smallest normal value (encoded as 1).
-    shift += -exponent + 1;
-
-    // Handle inputs that would produce a zero output.
-    //
-    // Shifts higher than highest_significant_bit+1 will always produce a zero
-    // result. A shift of exactly highest_significant_bit+1 might produce a
-    // non-zero result after rounding.
-    if (shift > (highest_significant_bit + 1)) {
-      if (round_mode == FPTieEven) {
-        // The result will always be +/-0.0.
-        return static_cast<T>(sign << sign_offset);
-      } else {
-        DCHECK_EQ(round_mode, FPRoundOdd);
-        DCHECK_NE(mantissa, 0U);
-        // For FPRoundOdd, if the mantissa is too small to represent and
-        // non-zero return the next "odd" value.
-        return static_cast<T>((sign << sign_offset) | 1);
-      }
-    }
-
-    // Properly encode the exponent for a subnormal output.
-    exponent = 0;
-  } else {
-    // Clear the topmost mantissa bit, since this is not encoded in IEEE-754
-    // normal values.
-    mantissa &= ~(UINT64_C(1) << highest_significant_bit);
-  }
-
-  if (shift > 0) {
-    if (round_mode == FPTieEven) {
-      // We have to shift the mantissa to the right. Some precision is lost, so
-      // we need to apply rounding.
-      uint64_t onebit_mantissa = (mantissa >> (shift)) & 1;
-      uint64_t halfbit_mantissa = (mantissa >> (shift - 1)) & 1;
-      uint64_t adjustment = (halfbit_mantissa & ~onebit_mantissa);
-      uint64_t adjusted = mantissa - adjustment;
-      T halfbit_adjusted = (adjusted >> (shift - 1)) & 1;
-
-      T result =
-          static_cast<T>((sign << sign_offset) | (exponent << exponent_offset) |
-                         ((mantissa >> shift) << mantissa_offset));
-
-      // A very large mantissa can overflow during rounding. If this happens,
-      // the exponent should be incremented and the mantissa set to 1.0
-      // (encoded as 0). Applying halfbit_adjusted after assembling the float
-      // has the nice side-effect that this case is handled for free.
-      //
-      // This also handles cases where a very large finite value overflows to
-      // infinity, or where a very large subnormal value overflows to become
-      // normal.
-      return result + halfbit_adjusted;
-    } else {
-      DCHECK_EQ(round_mode, FPRoundOdd);
-      // If any bits at position halfbit or below are set, onebit (ie. the
-      // bottom bit of the resulting mantissa) must be set.
-      uint64_t fractional_bits = mantissa & ((UINT64_C(1) << shift) - 1);
-      if (fractional_bits != 0) {
-        mantissa |= UINT64_C(1) << shift;
-      }
-
-      return static_cast<T>((sign << sign_offset) |
-                            (exponent << exponent_offset) |
-                            ((mantissa >> shift) << mantissa_offset));
-    }
-  } else {
-    // We have to shift the mantissa to the left (or not at all). The input
-    // mantissa is exactly representable in the output mantissa, so apply no
-    // rounding correction.
-    return static_cast<T>((sign << sign_offset) |
-                          (exponent << exponent_offset) |
-                          ((mantissa << -shift) << mantissa_offset));
-  }
-}
-
-class CachePage {
-  // TODO(all): Simulate instruction cache.
-};
-
-// Representation of memory, with typed getters and setters for access.
-class SimMemory {
- public:
-  template <typename T>
-  static T AddressUntag(T address) {
-    // Cast the address using a C-style cast. A reinterpret_cast would be
-    // appropriate, but it can't cast one integral type to another.
-    uint64_t bits = (uint64_t)address;
-    return (T)(bits & ~kAddressTagMask);
-  }
-
-  template <typename T, typename A>
-  static T Read(A address) {
-    T value;
-    address = AddressUntag(address);
-    DCHECK((sizeof(value) == 1) || (sizeof(value) == 2) ||
-           (sizeof(value) == 4) || (sizeof(value) == 8) ||
-           (sizeof(value) == 16));
-    memcpy(&value, reinterpret_cast<const char*>(address), sizeof(value));
-    return value;
-  }
-
-  template <typename T, typename A>
-  static void Write(A address, T value) {
-    address = AddressUntag(address);
-    DCHECK((sizeof(value) == 1) || (sizeof(value) == 2) ||
-           (sizeof(value) == 4) || (sizeof(value) == 8) ||
-           (sizeof(value) == 16));
-    memcpy(reinterpret_cast<char*>(address), &value, sizeof(value));
-  }
-};
-
-// The proper way to initialize a simulated system register (such as NZCV) is as
-// follows:
-//  SimSystemRegister nzcv = SimSystemRegister::DefaultValueFor(NZCV);
-class SimSystemRegister {
- public:
-  // The default constructor represents a register which has no writable bits.
-  // It is not possible to set its value to anything other than 0.
-  SimSystemRegister() : value_(0), write_ignore_mask_(0xffffffff) { }
-
-  uint32_t RawValue() const {
-    return value_;
-  }
-
-  void SetRawValue(uint32_t new_value) {
-    value_ = (value_ & write_ignore_mask_) | (new_value & ~write_ignore_mask_);
-  }
-
-  uint32_t Bits(int msb, int lsb) const {
-    return unsigned_bitextract_32(msb, lsb, value_);
-  }
-
-  int32_t SignedBits(int msb, int lsb) const {
-    return signed_bitextract_32(msb, lsb, value_);
-  }
-
-  void SetBits(int msb, int lsb, uint32_t bits);
-
-  // Default system register values.
-  static SimSystemRegister DefaultValueFor(SystemRegister id);
-
-#define DEFINE_GETTER(Name, HighBit, LowBit, Func, Type)                       \
-  Type Name() const { return static_cast<Type>(Func(HighBit, LowBit)); }       \
-  void Set##Name(Type bits) {                                                  \
-    SetBits(HighBit, LowBit, static_cast<Type>(bits));                         \
-  }
-#define DEFINE_WRITE_IGNORE_MASK(Name, Mask)                                   \
-  static const uint32_t Name##WriteIgnoreMask = ~static_cast<uint32_t>(Mask);
-  SYSTEM_REGISTER_FIELDS_LIST(DEFINE_GETTER, DEFINE_WRITE_IGNORE_MASK)
-#undef DEFINE_ZERO_BITS
-#undef DEFINE_GETTER
-
- protected:
-  // Most system registers only implement a few of the bits in the word. Other
-  // bits are "read-as-zero, write-ignored". The write_ignore_mask argument
-  // describes the bits which are not modifiable.
-  SimSystemRegister(uint32_t value, uint32_t write_ignore_mask)
-      : value_(value), write_ignore_mask_(write_ignore_mask) { }
-
-  uint32_t value_;
-  uint32_t write_ignore_mask_;
-};
-
-
-// Represent a register (r0-r31, v0-v31).
-template <int kSizeInBytes>
-class SimRegisterBase {
- public:
-  template<typename T>
-  void Set(T new_value) {
-    static_assert(sizeof(new_value) <= kSizeInBytes,
-                  "Size of new_value must be <= size of template type.");
-    if (sizeof(new_value) < kSizeInBytes) {
-      // All AArch64 registers are zero-extending.
-      memset(value_ + sizeof(new_value), 0, kSizeInBytes - sizeof(new_value));
-    }
-    memcpy(&value_, &new_value, sizeof(T));
-    NotifyRegisterWrite();
-  }
-
-  // Insert a typed value into a register, leaving the rest of the register
-  // unchanged. The lane parameter indicates where in the register the value
-  // should be inserted, in the range [ 0, sizeof(value_) / sizeof(T) ), where
-  // 0 represents the least significant bits.
-  template <typename T>
-  void Insert(int lane, T new_value) {
-    DCHECK_GE(lane, 0);
-    DCHECK_LE(sizeof(new_value) + (lane * sizeof(new_value)),
-              static_cast<unsigned>(kSizeInBytes));
-    memcpy(&value_[lane * sizeof(new_value)], &new_value, sizeof(new_value));
-    NotifyRegisterWrite();
-  }
-
-  template <typename T>
-  T Get(int lane = 0) const {
-    T result;
-    DCHECK_GE(lane, 0);
-    DCHECK_LE(sizeof(result) + (lane * sizeof(result)),
-              static_cast<unsigned>(kSizeInBytes));
-    memcpy(&result, &value_[lane * sizeof(result)], sizeof(result));
-    return result;
-  }
-
-  // TODO(all): Make this return a map of updated bytes, so that we can
-  // highlight updated lanes for load-and-insert. (That never happens for scalar
-  // code, but NEON has some instructions that can update individual lanes.)
-  bool WrittenSinceLastLog() const { return written_since_last_log_; }
-
-  void NotifyRegisterLogged() { written_since_last_log_ = false; }
-
- protected:
-  uint8_t value_[kSizeInBytes];
-
-  // Helpers to aid with register tracing.
-  bool written_since_last_log_;
-
-  void NotifyRegisterWrite() { written_since_last_log_ = true; }
-};
-
-typedef SimRegisterBase<kXRegSize> SimRegister;   // r0-r31
-typedef SimRegisterBase<kQRegSize> SimVRegister;  // v0-v31
-
-// Representation of a vector register, with typed getters and setters for lanes
-// and additional information to represent lane state.
-class LogicVRegister {
- public:
-  inline LogicVRegister(SimVRegister& other)  // NOLINT
-      : register_(other) {
-    for (unsigned i = 0; i < arraysize(saturated_); i++) {
-      saturated_[i] = kNotSaturated;
-    }
-    for (unsigned i = 0; i < arraysize(round_); i++) {
-      round_[i] = false;
-    }
-  }
-
-  int64_t Int(VectorFormat vform, int index) const {
-    int64_t element;
-    switch (LaneSizeInBitsFromFormat(vform)) {
-      case 8:
-        element = register_.Get<int8_t>(index);
-        break;
-      case 16:
-        element = register_.Get<int16_t>(index);
-        break;
-      case 32:
-        element = register_.Get<int32_t>(index);
-        break;
-      case 64:
-        element = register_.Get<int64_t>(index);
-        break;
-      default:
-        UNREACHABLE();
-        return 0;
-    }
-    return element;
-  }
-
-  uint64_t Uint(VectorFormat vform, int index) const {
-    uint64_t element;
-    switch (LaneSizeInBitsFromFormat(vform)) {
-      case 8:
-        element = register_.Get<uint8_t>(index);
-        break;
-      case 16:
-        element = register_.Get<uint16_t>(index);
-        break;
-      case 32:
-        element = register_.Get<uint32_t>(index);
-        break;
-      case 64:
-        element = register_.Get<uint64_t>(index);
-        break;
-      default:
-        UNREACHABLE();
-        return 0;
-    }
-    return element;
-  }
-
-  uint64_t UintLeftJustified(VectorFormat vform, int index) const {
-    return Uint(vform, index) << (64 - LaneSizeInBitsFromFormat(vform));
-  }
-
-  int64_t IntLeftJustified(VectorFormat vform, int index) const {
-    uint64_t value = UintLeftJustified(vform, index);
-    int64_t result;
-    memcpy(&result, &value, sizeof(result));
-    return result;
-  }
-
-  void SetInt(VectorFormat vform, int index, int64_t value) const {
-    switch (LaneSizeInBitsFromFormat(vform)) {
-      case 8:
-        register_.Insert(index, static_cast<int8_t>(value));
-        break;
-      case 16:
-        register_.Insert(index, static_cast<int16_t>(value));
-        break;
-      case 32:
-        register_.Insert(index, static_cast<int32_t>(value));
-        break;
-      case 64:
-        register_.Insert(index, static_cast<int64_t>(value));
-        break;
-      default:
-        UNREACHABLE();
-        return;
-    }
-  }
-
-  void SetIntArray(VectorFormat vform, const int64_t* src) const {
-    ClearForWrite(vform);
-    for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-      SetInt(vform, i, src[i]);
-    }
-  }
-
-  void SetUint(VectorFormat vform, int index, uint64_t value) const {
-    switch (LaneSizeInBitsFromFormat(vform)) {
-      case 8:
-        register_.Insert(index, static_cast<uint8_t>(value));
-        break;
-      case 16:
-        register_.Insert(index, static_cast<uint16_t>(value));
-        break;
-      case 32:
-        register_.Insert(index, static_cast<uint32_t>(value));
-        break;
-      case 64:
-        register_.Insert(index, static_cast<uint64_t>(value));
-        break;
-      default:
-        UNREACHABLE();
-        return;
-    }
-  }
-
-  void SetUintArray(VectorFormat vform, const uint64_t* src) const {
-    ClearForWrite(vform);
-    for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-      SetUint(vform, i, src[i]);
-    }
-  }
-
-  void ReadUintFromMem(VectorFormat vform, int index, uint64_t addr) const;
-
-  void WriteUintToMem(VectorFormat vform, int index, uint64_t addr) const;
-
-  template <typename T>
-  T Float(int index) const {
-    return register_.Get<T>(index);
-  }
-
-  template <typename T>
-  void SetFloat(int index, T value) const {
-    register_.Insert(index, value);
-  }
-
-  // When setting a result in a register of size less than Q, the top bits of
-  // the Q register must be cleared.
-  void ClearForWrite(VectorFormat vform) const {
-    unsigned size = RegisterSizeInBytesFromFormat(vform);
-    for (unsigned i = size; i < kQRegSize; i++) {
-      SetUint(kFormat16B, i, 0);
-    }
-  }
-
-  // Saturation state for each lane of a vector.
-  enum Saturation {
-    kNotSaturated = 0,
-    kSignedSatPositive = 1 << 0,
-    kSignedSatNegative = 1 << 1,
-    kSignedSatMask = kSignedSatPositive | kSignedSatNegative,
-    kSignedSatUndefined = kSignedSatMask,
-    kUnsignedSatPositive = 1 << 2,
-    kUnsignedSatNegative = 1 << 3,
-    kUnsignedSatMask = kUnsignedSatPositive | kUnsignedSatNegative,
-    kUnsignedSatUndefined = kUnsignedSatMask
-  };
-
-  // Getters for saturation state.
-  Saturation GetSignedSaturation(int index) {
-    return static_cast<Saturation>(saturated_[index] & kSignedSatMask);
-  }
-
-  Saturation GetUnsignedSaturation(int index) {
-    return static_cast<Saturation>(saturated_[index] & kUnsignedSatMask);
-  }
-
-  // Setters for saturation state.
-  void ClearSat(int index) { saturated_[index] = kNotSaturated; }
-
-  void SetSignedSat(int index, bool positive) {
-    SetSatFlag(index, positive ? kSignedSatPositive : kSignedSatNegative);
-  }
-
-  void SetUnsignedSat(int index, bool positive) {
-    SetSatFlag(index, positive ? kUnsignedSatPositive : kUnsignedSatNegative);
-  }
-
-  void SetSatFlag(int index, Saturation sat) {
-    saturated_[index] = static_cast<Saturation>(saturated_[index] | sat);
-    DCHECK_NE(sat & kUnsignedSatMask, kUnsignedSatUndefined);
-    DCHECK_NE(sat & kSignedSatMask, kSignedSatUndefined);
-  }
-
-  // Saturate lanes of a vector based on saturation state.
-  LogicVRegister& SignedSaturate(VectorFormat vform) {
-    for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-      Saturation sat = GetSignedSaturation(i);
-      if (sat == kSignedSatPositive) {
-        SetInt(vform, i, MaxIntFromFormat(vform));
-      } else if (sat == kSignedSatNegative) {
-        SetInt(vform, i, MinIntFromFormat(vform));
-      }
-    }
-    return *this;
-  }
-
-  LogicVRegister& UnsignedSaturate(VectorFormat vform) {
-    for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-      Saturation sat = GetUnsignedSaturation(i);
-      if (sat == kUnsignedSatPositive) {
-        SetUint(vform, i, MaxUintFromFormat(vform));
-      } else if (sat == kUnsignedSatNegative) {
-        SetUint(vform, i, 0);
-      }
-    }
-    return *this;
-  }
-
-  // Getter for rounding state.
-  bool GetRounding(int index) { return round_[index]; }
-
-  // Setter for rounding state.
-  void SetRounding(int index, bool round) { round_[index] = round; }
-
-  // Round lanes of a vector based on rounding state.
-  LogicVRegister& Round(VectorFormat vform) {
-    for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-      SetUint(vform, i, Uint(vform, i) + (GetRounding(i) ? 1 : 0));
-    }
-    return *this;
-  }
-
-  // Unsigned halve lanes of a vector, and use the saturation state to set the
-  // top bit.
-  LogicVRegister& Uhalve(VectorFormat vform) {
-    for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-      uint64_t val = Uint(vform, i);
-      SetRounding(i, (val & 1) == 1);
-      val >>= 1;
-      if (GetUnsignedSaturation(i) != kNotSaturated) {
-        // If the operation causes unsigned saturation, the bit shifted into the
-        // most significant bit must be set.
-        val |= (MaxUintFromFormat(vform) >> 1) + 1;
-      }
-      SetInt(vform, i, val);
-    }
-    return *this;
-  }
-
-  // Signed halve lanes of a vector, and use the carry state to set the top bit.
-  LogicVRegister& Halve(VectorFormat vform) {
-    for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-      int64_t val = Int(vform, i);
-      SetRounding(i, (val & 1) == 1);
-      val >>= 1;
-      if (GetSignedSaturation(i) != kNotSaturated) {
-        // If the operation causes signed saturation, the sign bit must be
-        // inverted.
-        val ^= (MaxUintFromFormat(vform) >> 1) + 1;
-      }
-      SetInt(vform, i, val);
-    }
-    return *this;
-  }
-
- private:
-  SimVRegister& register_;
-
-  // Allocate one saturation state entry per lane; largest register is type Q,
-  // and lanes can be a minimum of one byte wide.
-  Saturation saturated_[kQRegSize];
-
-  // Allocate one rounding state entry per lane.
-  bool round_[kQRegSize];
-};
-
-// Using multiple inheritance here is permitted because {DecoderVisitor} is a
-// pure interface class with only pure virtual methods.
-class Simulator : public DecoderVisitor, public SimulatorBase {
- public:
-  static void SetRedirectInstruction(Instruction* instruction);
-  static void FlushICache(base::CustomMatcherHashMap* i_cache, void* start,
-                          size_t size) {
-    USE(i_cache);
-    USE(start);
-    USE(size);
-  }
-
-  explicit Simulator(Decoder<DispatchingDecoderVisitor>* decoder,
-                     Isolate* isolate = nullptr, FILE* stream = stderr);
-  Simulator();
-  ~Simulator();
-
-  // System functions.
-
-  V8_EXPORT_PRIVATE static Simulator* current(v8::internal::Isolate* isolate);
-
-  // A wrapper class that stores an argument for one of the above Call
-  // functions.
-  //
-  // Only arguments up to 64 bits in size are supported.
-  class CallArgument {
-   public:
-    template<typename T>
-    explicit CallArgument(T argument) {
-      bits_ = 0;
-      DCHECK(sizeof(argument) <= sizeof(bits_));
-      memcpy(&bits_, &argument, sizeof(argument));
-      type_ = X_ARG;
-    }
-
-    explicit CallArgument(double argument) {
-      DCHECK(sizeof(argument) == sizeof(bits_));
-      memcpy(&bits_, &argument, sizeof(argument));
-      type_ = D_ARG;
-    }
-
-    explicit CallArgument(float argument) {
-      // TODO(all): CallArgument(float) is untested, remove this check once
-      //            tested.
-      UNIMPLEMENTED();
-      // Make the D register a NaN to try to trap errors if the callee expects a
-      // double. If it expects a float, the callee should ignore the top word.
-      DCHECK(sizeof(kFP64SignallingNaN) == sizeof(bits_));
-      memcpy(&bits_, &kFP64SignallingNaN, sizeof(kFP64SignallingNaN));
-      // Write the float payload to the S register.
-      DCHECK(sizeof(argument) <= sizeof(bits_));
-      memcpy(&bits_, &argument, sizeof(argument));
-      type_ = D_ARG;
-    }
-
-    // This indicates the end of the arguments list, so that CallArgument
-    // objects can be passed into varargs functions.
-    static CallArgument End() { return CallArgument(); }
-
-    int64_t bits() const { return bits_; }
-    bool IsEnd() const { return type_ == NO_ARG; }
-    bool IsX() const { return type_ == X_ARG; }
-    bool IsD() const { return type_ == D_ARG; }
-
-   private:
-    enum CallArgumentType { X_ARG, D_ARG, NO_ARG };
-
-    // All arguments are aligned to at least 64 bits and we don't support
-    // passing bigger arguments, so the payload size can be fixed at 64 bits.
-    int64_t bits_;
-    CallArgumentType type_;
-
-    CallArgument() { type_ = NO_ARG; }
-  };
-
-  // Call an arbitrary function taking an arbitrary number of arguments.
-  template <typename Return, typename... Args>
-  Return Call(byte* entry, Args... args) {
-    // Convert all arguments to CallArgument.
-    CallArgument call_args[] = {CallArgument(args)..., CallArgument::End()};
-    CallImpl(entry, call_args);
-    return ReadReturn<Return>();
-  }
-
-  // Start the debugging command line.
-  void Debug();
-
-  bool GetValue(const char* desc, int64_t* value);
-
-  bool PrintValue(const char* desc);
-
-  // Push an address onto the JS stack.
-  uintptr_t PushAddress(uintptr_t address);
-
-  // Pop an address from the JS stack.
-  uintptr_t PopAddress();
-
-  // Accessor to the internal simulator stack area.
-  uintptr_t StackLimit(uintptr_t c_limit) const;
-
-  void ResetState();
-
-  void DoRuntimeCall(Instruction* instr);
-
-  // Run the simulator.
-  static const Instruction* kEndOfSimAddress;
-  void DecodeInstruction();
-  void Run();
-  void RunFrom(Instruction* start);
-
-  // Simulation helpers.
-  template <typename T>
-  void set_pc(T new_pc) {
-    DCHECK(sizeof(T) == sizeof(pc_));
-    memcpy(&pc_, &new_pc, sizeof(T));
-    pc_modified_ = true;
-  }
-  Instruction* pc() { return pc_; }
-
-  void increment_pc() {
-    if (!pc_modified_) {
-      pc_ = pc_->following();
-    }
-
-    pc_modified_ = false;
-  }
-
-  virtual void Decode(Instruction* instr) {
-    decoder_->Decode(instr);
-  }
-
-  void ExecuteInstruction() {
-    DCHECK(IsAligned(reinterpret_cast<uintptr_t>(pc_), kInstructionSize));
-    CheckBreakNext();
-    Decode(pc_);
-    increment_pc();
-    LogAllWrittenRegisters();
-    CheckBreakpoints();
-  }
-
-  // Declare all Visitor functions.
-  #define DECLARE(A)  void Visit##A(Instruction* instr);
-  VISITOR_LIST(DECLARE)
-  #undef DECLARE
-
-  bool IsZeroRegister(unsigned code, Reg31Mode r31mode) const {
-    return ((code == 31) && (r31mode == Reg31IsZeroRegister));
-  }
-
-  // Register accessors.
-  // Return 'size' bits of the value of an integer register, as the specified
-  // type. The value is zero-extended to fill the result.
-  //
-  template<typename T>
-  T reg(unsigned code, Reg31Mode r31mode = Reg31IsZeroRegister) const {
-    DCHECK_LT(code, static_cast<unsigned>(kNumberOfRegisters));
-    if (IsZeroRegister(code, r31mode)) {
-      return 0;
-    }
-    return registers_[code].Get<T>();
-  }
-
-  // Common specialized accessors for the reg() template.
-  int32_t wreg(unsigned code, Reg31Mode r31mode = Reg31IsZeroRegister) const {
-    return reg<int32_t>(code, r31mode);
-  }
-
-  int64_t xreg(unsigned code, Reg31Mode r31mode = Reg31IsZeroRegister) const {
-    return reg<int64_t>(code, r31mode);
-  }
-
-  enum RegLogMode { LogRegWrites, NoRegLog };
-
-  // Write 'value' into an integer register. The value is zero-extended. This
-  // behaviour matches AArch64 register writes.
-  template<typename T>
-  void set_reg(unsigned code, T value,
-               Reg31Mode r31mode = Reg31IsZeroRegister) {
-    set_reg_no_log(code, value, r31mode);
-    LogRegister(code, r31mode);
-  }
-
-  // Common specialized accessors for the set_reg() template.
-  void set_wreg(unsigned code, int32_t value,
-                Reg31Mode r31mode = Reg31IsZeroRegister) {
-    set_reg(code, value, r31mode);
-  }
-
-  void set_xreg(unsigned code, int64_t value,
-                Reg31Mode r31mode = Reg31IsZeroRegister) {
-    set_reg(code, value, r31mode);
-  }
-
-  // As above, but don't automatically log the register update.
-  template <typename T>
-  void set_reg_no_log(unsigned code, T value,
-                      Reg31Mode r31mode = Reg31IsZeroRegister) {
-    DCHECK_LT(code, static_cast<unsigned>(kNumberOfRegisters));
-    if (!IsZeroRegister(code, r31mode)) {
-      registers_[code].Set(value);
-    }
-  }
-
-  void set_wreg_no_log(unsigned code, int32_t value,
-                       Reg31Mode r31mode = Reg31IsZeroRegister) {
-    set_reg_no_log(code, value, r31mode);
-  }
-
-  void set_xreg_no_log(unsigned code, int64_t value,
-                       Reg31Mode r31mode = Reg31IsZeroRegister) {
-    set_reg_no_log(code, value, r31mode);
-  }
-
-  // Commonly-used special cases.
-  template<typename T>
-  void set_lr(T value) {
-    DCHECK_EQ(sizeof(T), static_cast<unsigned>(kPointerSize));
-    set_reg(kLinkRegCode, value);
-  }
-
-  template<typename T>
-  void set_sp(T value) {
-    DCHECK_EQ(sizeof(T), static_cast<unsigned>(kPointerSize));
-    set_reg(31, value, Reg31IsStackPointer);
-  }
-
-  // Vector register accessors.
-  // These are equivalent to the integer register accessors, but for vector
-  // registers.
-
-  // A structure for representing a 128-bit Q register.
-  struct qreg_t {
-    uint8_t val[kQRegSize];
-  };
-
-  // Basic accessor: read the register as the specified type.
-  template <typename T>
-  T vreg(unsigned code) const {
-    static_assert((sizeof(T) == kBRegSize) || (sizeof(T) == kHRegSize) ||
-                      (sizeof(T) == kSRegSize) || (sizeof(T) == kDRegSize) ||
-                      (sizeof(T) == kQRegSize),
-                  "Template type must match size of register.");
-    DCHECK_LT(code, static_cast<unsigned>(kNumberOfVRegisters));
-
-    return vregisters_[code].Get<T>();
-  }
-
-  inline SimVRegister& vreg(unsigned code) { return vregisters_[code]; }
-
-  int64_t sp() { return xreg(31, Reg31IsStackPointer); }
-  int64_t fp() {
-      return xreg(kFramePointerRegCode, Reg31IsStackPointer);
-  }
-  Instruction* lr() { return reg<Instruction*>(kLinkRegCode); }
-
-  Address get_sp() const { return reg<Address>(31, Reg31IsStackPointer); }
-
-  // Common specialized accessors for the vreg() template.
-  uint8_t breg(unsigned code) const { return vreg<uint8_t>(code); }
-
-  float hreg(unsigned code) const { return vreg<uint16_t>(code); }
-
-  float sreg(unsigned code) const { return vreg<float>(code); }
-
-  uint32_t sreg_bits(unsigned code) const { return vreg<uint32_t>(code); }
-
-  double dreg(unsigned code) const { return vreg<double>(code); }
-
-  uint64_t dreg_bits(unsigned code) const { return vreg<uint64_t>(code); }
-
-  qreg_t qreg(unsigned code) const { return vreg<qreg_t>(code); }
-
-  // As above, with parameterized size and return type. The value is
-  // either zero-extended or truncated to fit, as required.
-  template <typename T>
-  T vreg(unsigned size, unsigned code) const {
-    uint64_t raw = 0;
-    T result;
-
-    switch (size) {
-      case kSRegSize:
-        raw = vreg<uint32_t>(code);
-        break;
-      case kDRegSize:
-        raw = vreg<uint64_t>(code);
-        break;
-      default:
-        UNREACHABLE();
-    }
-
-    static_assert(sizeof(result) <= sizeof(raw),
-                  "Template type must be <= 64 bits.");
-    // Copy the result and truncate to fit. This assumes a little-endian host.
-    memcpy(&result, &raw, sizeof(result));
-    return result;
-  }
-
-  // Write 'value' into a floating-point register. The value is zero-extended.
-  // This behaviour matches AArch64 register writes.
-  template <typename T>
-  void set_vreg(unsigned code, T value, RegLogMode log_mode = LogRegWrites) {
-    static_assert(
-        (sizeof(value) == kBRegSize) || (sizeof(value) == kHRegSize) ||
-            (sizeof(value) == kSRegSize) || (sizeof(value) == kDRegSize) ||
-            (sizeof(value) == kQRegSize),
-        "Template type must match size of register.");
-    DCHECK_LT(code, static_cast<unsigned>(kNumberOfVRegisters));
-    vregisters_[code].Set(value);
-
-    if (log_mode == LogRegWrites) {
-      LogVRegister(code, GetPrintRegisterFormat(value));
-    }
-  }
-
-  // Common specialized accessors for the set_vreg() template.
-  void set_breg(unsigned code, int8_t value,
-                RegLogMode log_mode = LogRegWrites) {
-    set_vreg(code, value, log_mode);
-  }
-
-  void set_hreg(unsigned code, int16_t value,
-                RegLogMode log_mode = LogRegWrites) {
-    set_vreg(code, value, log_mode);
-  }
-
-  void set_sreg(unsigned code, float value,
-                RegLogMode log_mode = LogRegWrites) {
-    set_vreg(code, value, log_mode);
-  }
-
-  void set_sreg_bits(unsigned code, uint32_t value,
-                     RegLogMode log_mode = LogRegWrites) {
-    set_vreg(code, value, log_mode);
-  }
-
-  void set_dreg(unsigned code, double value,
-                RegLogMode log_mode = LogRegWrites) {
-    set_vreg(code, value, log_mode);
-  }
-
-  void set_dreg_bits(unsigned code, uint64_t value,
-                     RegLogMode log_mode = LogRegWrites) {
-    set_vreg(code, value, log_mode);
-  }
-
-  void set_qreg(unsigned code, qreg_t value,
-                RegLogMode log_mode = LogRegWrites) {
-    set_vreg(code, value, log_mode);
-  }
-
-  // As above, but don't automatically log the register update.
-  template <typename T>
-  void set_vreg_no_log(unsigned code, T value) {
-    STATIC_ASSERT((sizeof(value) == kBRegSize) ||
-                  (sizeof(value) == kHRegSize) ||
-                  (sizeof(value) == kSRegSize) ||
-                  (sizeof(value) == kDRegSize) || (sizeof(value) == kQRegSize));
-    DCHECK_LT(code, static_cast<unsigned>(kNumberOfVRegisters));
-    vregisters_[code].Set(value);
-  }
-
-  void set_breg_no_log(unsigned code, uint8_t value) {
-    set_vreg_no_log(code, value);
-  }
-
-  void set_hreg_no_log(unsigned code, uint16_t value) {
-    set_vreg_no_log(code, value);
-  }
-
-  void set_sreg_no_log(unsigned code, float value) {
-    set_vreg_no_log(code, value);
-  }
-
-  void set_dreg_no_log(unsigned code, double value) {
-    set_vreg_no_log(code, value);
-  }
-
-  void set_qreg_no_log(unsigned code, qreg_t value) {
-    set_vreg_no_log(code, value);
-  }
-
-  SimSystemRegister& nzcv() { return nzcv_; }
-  SimSystemRegister& fpcr() { return fpcr_; }
-  FPRounding RMode() { return static_cast<FPRounding>(fpcr_.RMode()); }
-  bool DN() { return fpcr_.DN() != 0; }
-
-  // Debug helpers
-
-  // Simulator breakpoints.
-  struct Breakpoint {
-    Instruction* location;
-    bool enabled;
-  };
-  std::vector<Breakpoint> breakpoints_;
-  void SetBreakpoint(Instruction* breakpoint);
-  void ListBreakpoints();
-  void CheckBreakpoints();
-
-  // Helpers for the 'next' command.
-  // When this is set, the Simulator will insert a breakpoint after the next BL
-  // instruction it meets.
-  bool break_on_next_;
-  // Check if the Simulator should insert a break after the current instruction
-  // for the 'next' command.
-  void CheckBreakNext();
-
-  // Disassemble instruction at the given address.
-  void PrintInstructionsAt(Instruction* pc, uint64_t count);
-
-  // Print all registers of the specified types.
-  void PrintRegisters();
-  void PrintVRegisters();
-  void PrintSystemRegisters();
-
-  // As above, but only print the registers that have been updated.
-  void PrintWrittenRegisters();
-  void PrintWrittenVRegisters();
-
-  // As above, but respect LOG_REG and LOG_VREG.
-  void LogWrittenRegisters() {
-    if (log_parameters() & LOG_REGS) PrintWrittenRegisters();
-  }
-  void LogWrittenVRegisters() {
-    if (log_parameters() & LOG_VREGS) PrintWrittenVRegisters();
-  }
-  void LogAllWrittenRegisters() {
-    LogWrittenRegisters();
-    LogWrittenVRegisters();
-  }
-
-  // Specify relevant register formats for Print(V)Register and related helpers.
-  enum PrintRegisterFormat {
-    // The lane size.
-    kPrintRegLaneSizeB = 0 << 0,
-    kPrintRegLaneSizeH = 1 << 0,
-    kPrintRegLaneSizeS = 2 << 0,
-    kPrintRegLaneSizeW = kPrintRegLaneSizeS,
-    kPrintRegLaneSizeD = 3 << 0,
-    kPrintRegLaneSizeX = kPrintRegLaneSizeD,
-    kPrintRegLaneSizeQ = 4 << 0,
-
-    kPrintRegLaneSizeOffset = 0,
-    kPrintRegLaneSizeMask = 7 << 0,
-
-    // The lane count.
-    kPrintRegAsScalar = 0,
-    kPrintRegAsDVector = 1 << 3,
-    kPrintRegAsQVector = 2 << 3,
-
-    kPrintRegAsVectorMask = 3 << 3,
-
-    // Indicate floating-point format lanes. (This flag is only supported for S-
-    // and D-sized lanes.)
-    kPrintRegAsFP = 1 << 5,
-
-    // Supported combinations.
-
-    kPrintXReg = kPrintRegLaneSizeX | kPrintRegAsScalar,
-    kPrintWReg = kPrintRegLaneSizeW | kPrintRegAsScalar,
-    kPrintSReg = kPrintRegLaneSizeS | kPrintRegAsScalar | kPrintRegAsFP,
-    kPrintDReg = kPrintRegLaneSizeD | kPrintRegAsScalar | kPrintRegAsFP,
-
-    kPrintReg1B = kPrintRegLaneSizeB | kPrintRegAsScalar,
-    kPrintReg8B = kPrintRegLaneSizeB | kPrintRegAsDVector,
-    kPrintReg16B = kPrintRegLaneSizeB | kPrintRegAsQVector,
-    kPrintReg1H = kPrintRegLaneSizeH | kPrintRegAsScalar,
-    kPrintReg4H = kPrintRegLaneSizeH | kPrintRegAsDVector,
-    kPrintReg8H = kPrintRegLaneSizeH | kPrintRegAsQVector,
-    kPrintReg1S = kPrintRegLaneSizeS | kPrintRegAsScalar,
-    kPrintReg2S = kPrintRegLaneSizeS | kPrintRegAsDVector,
-    kPrintReg4S = kPrintRegLaneSizeS | kPrintRegAsQVector,
-    kPrintReg1SFP = kPrintRegLaneSizeS | kPrintRegAsScalar | kPrintRegAsFP,
-    kPrintReg2SFP = kPrintRegLaneSizeS | kPrintRegAsDVector | kPrintRegAsFP,
-    kPrintReg4SFP = kPrintRegLaneSizeS | kPrintRegAsQVector | kPrintRegAsFP,
-    kPrintReg1D = kPrintRegLaneSizeD | kPrintRegAsScalar,
-    kPrintReg2D = kPrintRegLaneSizeD | kPrintRegAsQVector,
-    kPrintReg1DFP = kPrintRegLaneSizeD | kPrintRegAsScalar | kPrintRegAsFP,
-    kPrintReg2DFP = kPrintRegLaneSizeD | kPrintRegAsQVector | kPrintRegAsFP,
-    kPrintReg1Q = kPrintRegLaneSizeQ | kPrintRegAsScalar
-  };
-
-  unsigned GetPrintRegLaneSizeInBytesLog2(PrintRegisterFormat format) {
-    return (format & kPrintRegLaneSizeMask) >> kPrintRegLaneSizeOffset;
-  }
-
-  unsigned GetPrintRegLaneSizeInBytes(PrintRegisterFormat format) {
-    return 1 << GetPrintRegLaneSizeInBytesLog2(format);
-  }
-
-  unsigned GetPrintRegSizeInBytesLog2(PrintRegisterFormat format) {
-    if (format & kPrintRegAsDVector) return kDRegSizeLog2;
-    if (format & kPrintRegAsQVector) return kQRegSizeLog2;
-
-    // Scalar types.
-    return GetPrintRegLaneSizeInBytesLog2(format);
-  }
-
-  unsigned GetPrintRegSizeInBytes(PrintRegisterFormat format) {
-    return 1 << GetPrintRegSizeInBytesLog2(format);
-  }
-
-  unsigned GetPrintRegLaneCount(PrintRegisterFormat format) {
-    unsigned reg_size_log2 = GetPrintRegSizeInBytesLog2(format);
-    unsigned lane_size_log2 = GetPrintRegLaneSizeInBytesLog2(format);
-    DCHECK_GE(reg_size_log2, lane_size_log2);
-    return 1 << (reg_size_log2 - lane_size_log2);
-  }
-
-  template <typename T>
-  PrintRegisterFormat GetPrintRegisterFormat(T value) {
-    return GetPrintRegisterFormatForSize(sizeof(value));
-  }
-
-  PrintRegisterFormat GetPrintRegisterFormat(double value) {
-    static_assert(sizeof(value) == kDRegSize,
-                  "D register must be size of double.");
-    return GetPrintRegisterFormatForSizeFP(sizeof(value));
-  }
-
-  PrintRegisterFormat GetPrintRegisterFormat(float value) {
-    static_assert(sizeof(value) == kSRegSize,
-                  "S register must be size of float.");
-    return GetPrintRegisterFormatForSizeFP(sizeof(value));
-  }
-
-  PrintRegisterFormat GetPrintRegisterFormat(VectorFormat vform);
-  PrintRegisterFormat GetPrintRegisterFormatFP(VectorFormat vform);
-
-  PrintRegisterFormat GetPrintRegisterFormatForSize(size_t reg_size,
-                                                    size_t lane_size);
-
-  PrintRegisterFormat GetPrintRegisterFormatForSize(size_t size) {
-    return GetPrintRegisterFormatForSize(size, size);
-  }
-
-  PrintRegisterFormat GetPrintRegisterFormatForSizeFP(size_t size) {
-    switch (size) {
-      default:
-        UNREACHABLE();
-      case kDRegSize:
-        return kPrintDReg;
-      case kSRegSize:
-        return kPrintSReg;
-    }
-  }
-
-  PrintRegisterFormat GetPrintRegisterFormatTryFP(PrintRegisterFormat format) {
-    if ((GetPrintRegLaneSizeInBytes(format) == kSRegSize) ||
-        (GetPrintRegLaneSizeInBytes(format) == kDRegSize)) {
-      return static_cast<PrintRegisterFormat>(format | kPrintRegAsFP);
-    }
-    return format;
-  }
-
-  // Print individual register values (after update).
-  void PrintRegister(unsigned code, Reg31Mode r31mode = Reg31IsStackPointer);
-  void PrintVRegister(unsigned code, PrintRegisterFormat sizes);
-  void PrintSystemRegister(SystemRegister id);
-
-  // Like Print* (above), but respect log_parameters().
-  void LogRegister(unsigned code, Reg31Mode r31mode = Reg31IsStackPointer) {
-    if (log_parameters() & LOG_REGS) PrintRegister(code, r31mode);
-  }
-  void LogVRegister(unsigned code, PrintRegisterFormat format) {
-    if (log_parameters() & LOG_VREGS) PrintVRegister(code, format);
-  }
-  void LogSystemRegister(SystemRegister id) {
-    if (log_parameters() & LOG_SYS_REGS) PrintSystemRegister(id);
-  }
-
-  // Print memory accesses.
-  void PrintRead(uintptr_t address, unsigned reg_code,
-                 PrintRegisterFormat format);
-  void PrintWrite(uintptr_t address, unsigned reg_code,
-                  PrintRegisterFormat format);
-  void PrintVRead(uintptr_t address, unsigned reg_code,
-                  PrintRegisterFormat format, unsigned lane);
-  void PrintVWrite(uintptr_t address, unsigned reg_code,
-                   PrintRegisterFormat format, unsigned lane);
-
-  // Like Print* (above), but respect log_parameters().
-  void LogRead(uintptr_t address, unsigned reg_code,
-               PrintRegisterFormat format) {
-    if (log_parameters() & LOG_REGS) PrintRead(address, reg_code, format);
-  }
-  void LogWrite(uintptr_t address, unsigned reg_code,
-                PrintRegisterFormat format) {
-    if (log_parameters() & LOG_WRITE) PrintWrite(address, reg_code, format);
-  }
-  void LogVRead(uintptr_t address, unsigned reg_code,
-                PrintRegisterFormat format, unsigned lane = 0) {
-    if (log_parameters() & LOG_VREGS) {
-      PrintVRead(address, reg_code, format, lane);
-    }
-  }
-  void LogVWrite(uintptr_t address, unsigned reg_code,
-                 PrintRegisterFormat format, unsigned lane = 0) {
-    if (log_parameters() & LOG_WRITE) {
-      PrintVWrite(address, reg_code, format, lane);
-    }
-  }
-
-  int log_parameters() { return log_parameters_; }
-  void set_log_parameters(int new_parameters) {
-    log_parameters_ = new_parameters;
-    if (!decoder_) {
-      if (new_parameters & LOG_DISASM) {
-        PrintF("Run --debug-sim to dynamically turn on disassembler\n");
-      }
-      return;
-    }
-    if (new_parameters & LOG_DISASM) {
-      decoder_->InsertVisitorBefore(print_disasm_, this);
-    } else {
-      decoder_->RemoveVisitor(print_disasm_);
-    }
-  }
-
-  // Helper functions for register tracing.
-  void PrintRegisterRawHelper(unsigned code, Reg31Mode r31mode,
-                              int size_in_bytes = kXRegSize);
-  void PrintVRegisterRawHelper(unsigned code, int bytes = kQRegSize,
-                               int lsb = 0);
-  void PrintVRegisterFPHelper(unsigned code, unsigned lane_size_in_bytes,
-                              int lane_count = 1, int rightmost_lane = 0);
-
-  static inline const char* WRegNameForCode(unsigned code,
-      Reg31Mode mode = Reg31IsZeroRegister);
-  static inline const char* XRegNameForCode(unsigned code,
-      Reg31Mode mode = Reg31IsZeroRegister);
-  static inline const char* SRegNameForCode(unsigned code);
-  static inline const char* DRegNameForCode(unsigned code);
-  static inline const char* VRegNameForCode(unsigned code);
-  static inline int CodeFromName(const char* name);
-
- protected:
-  // Simulation helpers ------------------------------------
-  bool ConditionPassed(Condition cond) {
-    SimSystemRegister& flags = nzcv();
-    switch (cond) {
-      case eq:
-        return flags.Z();
-      case ne:
-        return !flags.Z();
-      case hs:
-        return flags.C();
-      case lo:
-        return !flags.C();
-      case mi:
-        return flags.N();
-      case pl:
-        return !flags.N();
-      case vs:
-        return flags.V();
-      case vc:
-        return !flags.V();
-      case hi:
-        return flags.C() && !flags.Z();
-      case ls:
-        return !(flags.C() && !flags.Z());
-      case ge:
-        return flags.N() == flags.V();
-      case lt:
-        return flags.N() != flags.V();
-      case gt:
-        return !flags.Z() && (flags.N() == flags.V());
-      case le:
-        return !(!flags.Z() && (flags.N() == flags.V()));
-      case nv:  // Fall through.
-      case al:
-        return true;
-      default:
-        UNREACHABLE();
-    }
-  }
-
-  bool ConditionFailed(Condition cond) {
-    return !ConditionPassed(cond);
-  }
-
-  template<typename T>
-  void AddSubHelper(Instruction* instr, T op2);
-  template <typename T>
-  T AddWithCarry(bool set_flags, T left, T right, int carry_in = 0);
-  template<typename T>
-  void AddSubWithCarry(Instruction* instr);
-  template<typename T>
-  void LogicalHelper(Instruction* instr, T op2);
-  template<typename T>
-  void ConditionalCompareHelper(Instruction* instr, T op2);
-  void LoadStoreHelper(Instruction* instr,
-                       int64_t offset,
-                       AddrMode addrmode);
-  void LoadStorePairHelper(Instruction* instr, AddrMode addrmode);
-  uintptr_t LoadStoreAddress(unsigned addr_reg, int64_t offset,
-                             AddrMode addrmode);
-  void LoadStoreWriteBack(unsigned addr_reg,
-                          int64_t offset,
-                          AddrMode addrmode);
-  void NEONLoadStoreMultiStructHelper(const Instruction* instr,
-                                      AddrMode addr_mode);
-  void NEONLoadStoreSingleStructHelper(const Instruction* instr,
-                                       AddrMode addr_mode);
-  void CheckMemoryAccess(uintptr_t address, uintptr_t stack);
-
-  // Memory read helpers.
-  template <typename T, typename A>
-  T MemoryRead(A address) {
-    T value;
-    STATIC_ASSERT((sizeof(value) == 1) || (sizeof(value) == 2) ||
-                  (sizeof(value) == 4) || (sizeof(value) == 8) ||
-                  (sizeof(value) == 16));
-    memcpy(&value, reinterpret_cast<const void*>(address), sizeof(value));
-    return value;
-  }
-
-  // Memory write helpers.
-  template <typename T, typename A>
-  void MemoryWrite(A address, T value) {
-    STATIC_ASSERT((sizeof(value) == 1) || (sizeof(value) == 2) ||
-                  (sizeof(value) == 4) || (sizeof(value) == 8) ||
-                  (sizeof(value) == 16));
-    memcpy(reinterpret_cast<void*>(address), &value, sizeof(value));
-  }
-
-  template <typename T>
-  T ShiftOperand(T value,
-                 Shift shift_type,
-                 unsigned amount);
-  template <typename T>
-  T ExtendValue(T value,
-                Extend extend_type,
-                unsigned left_shift = 0);
-  template <typename T>
-  void Extract(Instruction* instr);
-  template <typename T>
-  void DataProcessing2Source(Instruction* instr);
-  template <typename T>
-  void BitfieldHelper(Instruction* instr);
-  uint16_t PolynomialMult(uint8_t op1, uint8_t op2);
-
-  void ld1(VectorFormat vform, LogicVRegister dst, uint64_t addr);
-  void ld1(VectorFormat vform, LogicVRegister dst, int index, uint64_t addr);
-  void ld1r(VectorFormat vform, LogicVRegister dst, uint64_t addr);
-  void ld2(VectorFormat vform, LogicVRegister dst1, LogicVRegister dst2,
-           uint64_t addr);
-  void ld2(VectorFormat vform, LogicVRegister dst1, LogicVRegister dst2,
-           int index, uint64_t addr);
-  void ld2r(VectorFormat vform, LogicVRegister dst1, LogicVRegister dst2,
-            uint64_t addr);
-  void ld3(VectorFormat vform, LogicVRegister dst1, LogicVRegister dst2,
-           LogicVRegister dst3, uint64_t addr);
-  void ld3(VectorFormat vform, LogicVRegister dst1, LogicVRegister dst2,
-           LogicVRegister dst3, int index, uint64_t addr);
-  void ld3r(VectorFormat vform, LogicVRegister dst1, LogicVRegister dst2,
-            LogicVRegister dst3, uint64_t addr);
-  void ld4(VectorFormat vform, LogicVRegister dst1, LogicVRegister dst2,
-           LogicVRegister dst3, LogicVRegister dst4, uint64_t addr);
-  void ld4(VectorFormat vform, LogicVRegister dst1, LogicVRegister dst2,
-           LogicVRegister dst3, LogicVRegister dst4, int index, uint64_t addr);
-  void ld4r(VectorFormat vform, LogicVRegister dst1, LogicVRegister dst2,
-            LogicVRegister dst3, LogicVRegister dst4, uint64_t addr);
-  void st1(VectorFormat vform, LogicVRegister src, uint64_t addr);
-  void st1(VectorFormat vform, LogicVRegister src, int index, uint64_t addr);
-  void st2(VectorFormat vform, LogicVRegister src, LogicVRegister src2,
-           uint64_t addr);
-  void st2(VectorFormat vform, LogicVRegister src, LogicVRegister src2,
-           int index, uint64_t addr);
-  void st3(VectorFormat vform, LogicVRegister src, LogicVRegister src2,
-           LogicVRegister src3, uint64_t addr);
-  void st3(VectorFormat vform, LogicVRegister src, LogicVRegister src2,
-           LogicVRegister src3, int index, uint64_t addr);
-  void st4(VectorFormat vform, LogicVRegister src, LogicVRegister src2,
-           LogicVRegister src3, LogicVRegister src4, uint64_t addr);
-  void st4(VectorFormat vform, LogicVRegister src, LogicVRegister src2,
-           LogicVRegister src3, LogicVRegister src4, int index, uint64_t addr);
-  LogicVRegister cmp(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src1, const LogicVRegister& src2,
-                     Condition cond);
-  LogicVRegister cmp(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src1, int imm, Condition cond);
-  LogicVRegister cmptst(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister add(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister addp(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister mla(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister mls(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister mul(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister mul(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src1, const LogicVRegister& src2,
-                     int index);
-  LogicVRegister mla(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src1, const LogicVRegister& src2,
-                     int index);
-  LogicVRegister mls(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src1, const LogicVRegister& src2,
-                     int index);
-  LogicVRegister pmul(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2);
-
-  typedef LogicVRegister (Simulator::*ByElementOp)(VectorFormat vform,
-                                                   LogicVRegister dst,
-                                                   const LogicVRegister& src1,
-                                                   const LogicVRegister& src2,
-                                                   int index);
-  LogicVRegister fmul(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2,
-                      int index);
-  LogicVRegister fmla(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2,
-                      int index);
-  LogicVRegister fmls(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2,
-                      int index);
-  LogicVRegister fmulx(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src1, const LogicVRegister& src2,
-                       int index);
-  LogicVRegister smull(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src1, const LogicVRegister& src2,
-                       int index);
-  LogicVRegister smull2(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src1, const LogicVRegister& src2,
-                        int index);
-  LogicVRegister umull(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src1, const LogicVRegister& src2,
-                       int index);
-  LogicVRegister umull2(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src1, const LogicVRegister& src2,
-                        int index);
-  LogicVRegister smlal(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src1, const LogicVRegister& src2,
-                       int index);
-  LogicVRegister smlal2(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src1, const LogicVRegister& src2,
-                        int index);
-  LogicVRegister umlal(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src1, const LogicVRegister& src2,
-                       int index);
-  LogicVRegister umlal2(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src1, const LogicVRegister& src2,
-                        int index);
-  LogicVRegister smlsl(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src1, const LogicVRegister& src2,
-                       int index);
-  LogicVRegister smlsl2(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src1, const LogicVRegister& src2,
-                        int index);
-  LogicVRegister umlsl(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src1, const LogicVRegister& src2,
-                       int index);
-  LogicVRegister umlsl2(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src1, const LogicVRegister& src2,
-                        int index);
-  LogicVRegister sqdmull(VectorFormat vform, LogicVRegister dst,
-                         const LogicVRegister& src1, const LogicVRegister& src2,
-                         int index);
-  LogicVRegister sqdmull2(VectorFormat vform, LogicVRegister dst,
-                          const LogicVRegister& src1,
-                          const LogicVRegister& src2, int index);
-  LogicVRegister sqdmlal(VectorFormat vform, LogicVRegister dst,
-                         const LogicVRegister& src1, const LogicVRegister& src2,
-                         int index);
-  LogicVRegister sqdmlal2(VectorFormat vform, LogicVRegister dst,
-                          const LogicVRegister& src1,
-                          const LogicVRegister& src2, int index);
-  LogicVRegister sqdmlsl(VectorFormat vform, LogicVRegister dst,
-                         const LogicVRegister& src1, const LogicVRegister& src2,
-                         int index);
-  LogicVRegister sqdmlsl2(VectorFormat vform, LogicVRegister dst,
-                          const LogicVRegister& src1,
-                          const LogicVRegister& src2, int index);
-  LogicVRegister sqdmulh(VectorFormat vform, LogicVRegister dst,
-                         const LogicVRegister& src1, const LogicVRegister& src2,
-                         int index);
-  LogicVRegister sqrdmulh(VectorFormat vform, LogicVRegister dst,
-                          const LogicVRegister& src1,
-                          const LogicVRegister& src2, int index);
-  LogicVRegister sub(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister and_(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister orr(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister orn(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister eor(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister bic(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister bic(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src, uint64_t imm);
-  LogicVRegister bif(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister bit(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister bsl(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister cls(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src);
-  LogicVRegister clz(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src);
-  LogicVRegister cnt(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src);
-  LogicVRegister not_(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src);
-  LogicVRegister rbit(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src);
-  LogicVRegister rev(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src, int revSize);
-  LogicVRegister rev16(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src);
-  LogicVRegister rev32(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src);
-  LogicVRegister rev64(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src);
-  LogicVRegister addlp(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src, bool is_signed,
-                       bool do_accumulate);
-  LogicVRegister saddlp(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src);
-  LogicVRegister uaddlp(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src);
-  LogicVRegister sadalp(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src);
-  LogicVRegister uadalp(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src);
-  LogicVRegister ext(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src1, const LogicVRegister& src2,
-                     int index);
-  LogicVRegister ins_element(VectorFormat vform, LogicVRegister dst,
-                             int dst_index, const LogicVRegister& src,
-                             int src_index);
-  LogicVRegister ins_immediate(VectorFormat vform, LogicVRegister dst,
-                               int dst_index, uint64_t imm);
-  LogicVRegister dup_element(VectorFormat vform, LogicVRegister dst,
-                             const LogicVRegister& src, int src_index);
-  LogicVRegister dup_immediate(VectorFormat vform, LogicVRegister dst,
-                               uint64_t imm);
-  LogicVRegister movi(VectorFormat vform, LogicVRegister dst, uint64_t imm);
-  LogicVRegister mvni(VectorFormat vform, LogicVRegister dst, uint64_t imm);
-  LogicVRegister orr(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src, uint64_t imm);
-  LogicVRegister sshl(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister ushl(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister SMinMax(VectorFormat vform, LogicVRegister dst,
-                         const LogicVRegister& src1, const LogicVRegister& src2,
-                         bool max);
-  LogicVRegister smax(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister smin(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister SMinMaxP(VectorFormat vform, LogicVRegister dst,
-                          const LogicVRegister& src1,
-                          const LogicVRegister& src2, bool max);
-  LogicVRegister smaxp(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister sminp(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister addp(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src);
-  LogicVRegister addv(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src);
-  LogicVRegister uaddlv(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src);
-  LogicVRegister saddlv(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src);
-  LogicVRegister SMinMaxV(VectorFormat vform, LogicVRegister dst,
-                          const LogicVRegister& src, bool max);
-  LogicVRegister smaxv(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src);
-  LogicVRegister sminv(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src);
-  LogicVRegister uxtl(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src);
-  LogicVRegister uxtl2(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src);
-  LogicVRegister sxtl(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src);
-  LogicVRegister sxtl2(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src);
-  LogicVRegister Table(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& ind, bool zero_out_of_bounds,
-                       const LogicVRegister* tab1,
-                       const LogicVRegister* tab2 = nullptr,
-                       const LogicVRegister* tab3 = nullptr,
-                       const LogicVRegister* tab4 = nullptr);
-  LogicVRegister tbl(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& tab, const LogicVRegister& ind);
-  LogicVRegister tbl(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& tab, const LogicVRegister& tab2,
-                     const LogicVRegister& ind);
-  LogicVRegister tbl(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& tab, const LogicVRegister& tab2,
-                     const LogicVRegister& tab3, const LogicVRegister& ind);
-  LogicVRegister tbl(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& tab, const LogicVRegister& tab2,
-                     const LogicVRegister& tab3, const LogicVRegister& tab4,
-                     const LogicVRegister& ind);
-  LogicVRegister tbx(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& tab, const LogicVRegister& ind);
-  LogicVRegister tbx(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& tab, const LogicVRegister& tab2,
-                     const LogicVRegister& ind);
-  LogicVRegister tbx(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& tab, const LogicVRegister& tab2,
-                     const LogicVRegister& tab3, const LogicVRegister& ind);
-  LogicVRegister tbx(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& tab, const LogicVRegister& tab2,
-                     const LogicVRegister& tab3, const LogicVRegister& tab4,
-                     const LogicVRegister& ind);
-  LogicVRegister uaddl(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister uaddl2(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister uaddw(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister uaddw2(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister saddl(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister saddl2(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister saddw(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister saddw2(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister usubl(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister usubl2(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister usubw(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister usubw2(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister ssubl(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister ssubl2(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister ssubw(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister ssubw2(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister UMinMax(VectorFormat vform, LogicVRegister dst,
-                         const LogicVRegister& src1, const LogicVRegister& src2,
-                         bool max);
-  LogicVRegister umax(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister umin(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister UMinMaxP(VectorFormat vform, LogicVRegister dst,
-                          const LogicVRegister& src1,
-                          const LogicVRegister& src2, bool max);
-  LogicVRegister umaxp(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister uminp(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister UMinMaxV(VectorFormat vform, LogicVRegister dst,
-                          const LogicVRegister& src, bool max);
-  LogicVRegister umaxv(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src);
-  LogicVRegister uminv(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src);
-  LogicVRegister trn1(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister trn2(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister zip1(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister zip2(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister uzp1(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister uzp2(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister shl(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src, int shift);
-  LogicVRegister scvtf(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src, int fbits,
-                       FPRounding rounding_mode);
-  LogicVRegister ucvtf(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src, int fbits,
-                       FPRounding rounding_mode);
-  LogicVRegister sshll(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src, int shift);
-  LogicVRegister sshll2(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src, int shift);
-  LogicVRegister shll(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src);
-  LogicVRegister shll2(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src);
-  LogicVRegister ushll(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src, int shift);
-  LogicVRegister ushll2(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src, int shift);
-  LogicVRegister sli(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src, int shift);
-  LogicVRegister sri(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src, int shift);
-  LogicVRegister sshr(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src, int shift);
-  LogicVRegister ushr(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src, int shift);
-  LogicVRegister ssra(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src, int shift);
-  LogicVRegister usra(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src, int shift);
-  LogicVRegister srsra(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src, int shift);
-  LogicVRegister ursra(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src, int shift);
-  LogicVRegister suqadd(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src);
-  LogicVRegister usqadd(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src);
-  LogicVRegister sqshl(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src, int shift);
-  LogicVRegister uqshl(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src, int shift);
-  LogicVRegister sqshlu(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src, int shift);
-  LogicVRegister abs(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src);
-  LogicVRegister neg(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src);
-  LogicVRegister ExtractNarrow(VectorFormat vform, LogicVRegister dst,
-                               bool dstIsSigned, const LogicVRegister& src,
-                               bool srcIsSigned);
-  LogicVRegister xtn(VectorFormat vform, LogicVRegister dst,
-                     const LogicVRegister& src);
-  LogicVRegister sqxtn(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src);
-  LogicVRegister uqxtn(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src);
-  LogicVRegister sqxtun(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src);
-  LogicVRegister AbsDiff(VectorFormat vform, LogicVRegister dst,
-                         const LogicVRegister& src1, const LogicVRegister& src2,
-                         bool issigned);
-  LogicVRegister saba(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister uaba(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister shrn(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src, int shift);
-  LogicVRegister shrn2(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src, int shift);
-  LogicVRegister rshrn(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src, int shift);
-  LogicVRegister rshrn2(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src, int shift);
-  LogicVRegister uqshrn(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src, int shift);
-  LogicVRegister uqshrn2(VectorFormat vform, LogicVRegister dst,
-                         const LogicVRegister& src, int shift);
-  LogicVRegister uqrshrn(VectorFormat vform, LogicVRegister dst,
-                         const LogicVRegister& src, int shift);
-  LogicVRegister uqrshrn2(VectorFormat vform, LogicVRegister dst,
-                          const LogicVRegister& src, int shift);
-  LogicVRegister sqshrn(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src, int shift);
-  LogicVRegister sqshrn2(VectorFormat vform, LogicVRegister dst,
-                         const LogicVRegister& src, int shift);
-  LogicVRegister sqrshrn(VectorFormat vform, LogicVRegister dst,
-                         const LogicVRegister& src, int shift);
-  LogicVRegister sqrshrn2(VectorFormat vform, LogicVRegister dst,
-                          const LogicVRegister& src, int shift);
-  LogicVRegister sqshrun(VectorFormat vform, LogicVRegister dst,
-                         const LogicVRegister& src, int shift);
-  LogicVRegister sqshrun2(VectorFormat vform, LogicVRegister dst,
-                          const LogicVRegister& src, int shift);
-  LogicVRegister sqrshrun(VectorFormat vform, LogicVRegister dst,
-                          const LogicVRegister& src, int shift);
-  LogicVRegister sqrshrun2(VectorFormat vform, LogicVRegister dst,
-                           const LogicVRegister& src, int shift);
-  LogicVRegister sqrdmulh(VectorFormat vform, LogicVRegister dst,
-                          const LogicVRegister& src1,
-                          const LogicVRegister& src2, bool round = true);
-  LogicVRegister sqdmulh(VectorFormat vform, LogicVRegister dst,
-                         const LogicVRegister& src1,
-                         const LogicVRegister& src2);
-#define NEON_3VREG_LOGIC_LIST(V) \
-  V(addhn)                       \
-  V(addhn2)                      \
-  V(raddhn)                      \
-  V(raddhn2)                     \
-  V(subhn)                       \
-  V(subhn2)                      \
-  V(rsubhn)                      \
-  V(rsubhn2)                     \
-  V(pmull)                       \
-  V(pmull2)                      \
-  V(sabal)                       \
-  V(sabal2)                      \
-  V(uabal)                       \
-  V(uabal2)                      \
-  V(sabdl)                       \
-  V(sabdl2)                      \
-  V(uabdl)                       \
-  V(uabdl2)                      \
-  V(smull)                       \
-  V(smull2)                      \
-  V(umull)                       \
-  V(umull2)                      \
-  V(smlal)                       \
-  V(smlal2)                      \
-  V(umlal)                       \
-  V(umlal2)                      \
-  V(smlsl)                       \
-  V(smlsl2)                      \
-  V(umlsl)                       \
-  V(umlsl2)                      \
-  V(sqdmlal)                     \
-  V(sqdmlal2)                    \
-  V(sqdmlsl)                     \
-  V(sqdmlsl2)                    \
-  V(sqdmull)                     \
-  V(sqdmull2)
-
-#define DEFINE_LOGIC_FUNC(FXN)                               \
-  LogicVRegister FXN(VectorFormat vform, LogicVRegister dst, \
-                     const LogicVRegister& src1, const LogicVRegister& src2);
-  NEON_3VREG_LOGIC_LIST(DEFINE_LOGIC_FUNC)
-#undef DEFINE_LOGIC_FUNC
-
-#define NEON_FP3SAME_LIST(V) \
-  V(fadd, FPAdd, false)      \
-  V(fsub, FPSub, true)       \
-  V(fmul, FPMul, true)       \
-  V(fmulx, FPMulx, true)     \
-  V(fdiv, FPDiv, true)       \
-  V(fmax, FPMax, false)      \
-  V(fmin, FPMin, false)      \
-  V(fmaxnm, FPMaxNM, false)  \
-  V(fminnm, FPMinNM, false)
-
-#define DECLARE_NEON_FP_VECTOR_OP(FN, OP, PROCNAN)                           \
-  template <typename T>                                                      \
-  LogicVRegister FN(VectorFormat vform, LogicVRegister dst,                  \
-                    const LogicVRegister& src1, const LogicVRegister& src2); \
-  LogicVRegister FN(VectorFormat vform, LogicVRegister dst,                  \
-                    const LogicVRegister& src1, const LogicVRegister& src2);
-  NEON_FP3SAME_LIST(DECLARE_NEON_FP_VECTOR_OP)
-#undef DECLARE_NEON_FP_VECTOR_OP
-
-#define NEON_FPPAIRWISE_LIST(V) \
-  V(faddp, fadd, FPAdd)         \
-  V(fmaxp, fmax, FPMax)         \
-  V(fmaxnmp, fmaxnm, FPMaxNM)   \
-  V(fminp, fmin, FPMin)         \
-  V(fminnmp, fminnm, FPMinNM)
-
-#define DECLARE_NEON_FP_PAIR_OP(FNP, FN, OP)                                  \
-  LogicVRegister FNP(VectorFormat vform, LogicVRegister dst,                  \
-                     const LogicVRegister& src1, const LogicVRegister& src2); \
-  LogicVRegister FNP(VectorFormat vform, LogicVRegister dst,                  \
-                     const LogicVRegister& src);
-  NEON_FPPAIRWISE_LIST(DECLARE_NEON_FP_PAIR_OP)
-#undef DECLARE_NEON_FP_PAIR_OP
-
-  template <typename T>
-  LogicVRegister frecps(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister frecps(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src1, const LogicVRegister& src2);
-  template <typename T>
-  LogicVRegister frsqrts(VectorFormat vform, LogicVRegister dst,
-                         const LogicVRegister& src1,
-                         const LogicVRegister& src2);
-  LogicVRegister frsqrts(VectorFormat vform, LogicVRegister dst,
-                         const LogicVRegister& src1,
-                         const LogicVRegister& src2);
-  template <typename T>
-  LogicVRegister fmla(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister fmla(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2);
-  template <typename T>
-  LogicVRegister fmls(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister fmls(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister fnmul(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src1, const LogicVRegister& src2);
-
-  template <typename T>
-  LogicVRegister fcmp(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2,
-                      Condition cond);
-  LogicVRegister fcmp(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2,
-                      Condition cond);
-  LogicVRegister fabscmp(VectorFormat vform, LogicVRegister dst,
-                         const LogicVRegister& src1, const LogicVRegister& src2,
-                         Condition cond);
-  LogicVRegister fcmp_zero(VectorFormat vform, LogicVRegister dst,
-                           const LogicVRegister& src, Condition cond);
-
-  template <typename T>
-  LogicVRegister fneg(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src);
-  LogicVRegister fneg(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src);
-  template <typename T>
-  LogicVRegister frecpx(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src);
-  LogicVRegister frecpx(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src);
-  template <typename T>
-  LogicVRegister fabs_(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src);
-  LogicVRegister fabs_(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src);
-  LogicVRegister fabd(VectorFormat vform, LogicVRegister dst,
-                      const LogicVRegister& src1, const LogicVRegister& src2);
-  LogicVRegister frint(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src, FPRounding rounding_mode,
-                       bool inexact_exception = false);
-  LogicVRegister fcvts(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src, FPRounding rounding_mode,
-                       int fbits = 0);
-  LogicVRegister fcvtu(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src, FPRounding rounding_mode,
-                       int fbits = 0);
-  LogicVRegister fcvtl(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src);
-  LogicVRegister fcvtl2(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src);
-  LogicVRegister fcvtn(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src);
-  LogicVRegister fcvtn2(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src);
-  LogicVRegister fcvtxn(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src);
-  LogicVRegister fcvtxn2(VectorFormat vform, LogicVRegister dst,
-                         const LogicVRegister& src);
-  LogicVRegister fsqrt(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src);
-  LogicVRegister frsqrte(VectorFormat vform, LogicVRegister dst,
-                         const LogicVRegister& src);
-  LogicVRegister frecpe(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src, FPRounding rounding);
-  LogicVRegister ursqrte(VectorFormat vform, LogicVRegister dst,
-                         const LogicVRegister& src);
-  LogicVRegister urecpe(VectorFormat vform, LogicVRegister dst,
-                        const LogicVRegister& src);
-
-  typedef float (Simulator::*FPMinMaxOp)(float a, float b);
-
-  LogicVRegister FMinMaxV(VectorFormat vform, LogicVRegister dst,
-                          const LogicVRegister& src, FPMinMaxOp Op);
-
-  LogicVRegister fminv(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src);
-  LogicVRegister fmaxv(VectorFormat vform, LogicVRegister dst,
-                       const LogicVRegister& src);
-  LogicVRegister fminnmv(VectorFormat vform, LogicVRegister dst,
-                         const LogicVRegister& src);
-  LogicVRegister fmaxnmv(VectorFormat vform, LogicVRegister dst,
-                         const LogicVRegister& src);
-
-  template <typename T>
-  T FPRecipSqrtEstimate(T op);
-  template <typename T>
-  T FPRecipEstimate(T op, FPRounding rounding);
-  template <typename T, typename R>
-  R FPToFixed(T op, int fbits, bool is_signed, FPRounding rounding);
-
-  void FPCompare(double val0, double val1);
-  double FPRoundInt(double value, FPRounding round_mode);
-  double FPToDouble(float value);
-  float FPToFloat(double value, FPRounding round_mode);
-  float FPToFloat(float16 value);
-  float16 FPToFloat16(float value, FPRounding round_mode);
-  float16 FPToFloat16(double value, FPRounding round_mode);
-  double recip_sqrt_estimate(double a);
-  double recip_estimate(double a);
-  double FPRecipSqrtEstimate(double a);
-  double FPRecipEstimate(double a);
-  double FixedToDouble(int64_t src, int fbits, FPRounding round_mode);
-  double UFixedToDouble(uint64_t src, int fbits, FPRounding round_mode);
-  float FixedToFloat(int64_t src, int fbits, FPRounding round_mode);
-  float UFixedToFloat(uint64_t src, int fbits, FPRounding round_mode);
-  int32_t FPToInt32(double value, FPRounding rmode);
-  int64_t FPToInt64(double value, FPRounding rmode);
-  uint32_t FPToUInt32(double value, FPRounding rmode);
-  uint64_t FPToUInt64(double value, FPRounding rmode);
-
-  template <typename T>
-  T FPAdd(T op1, T op2);
-
-  template <typename T>
-  T FPDiv(T op1, T op2);
-
-  template <typename T>
-  T FPMax(T a, T b);
-
-  template <typename T>
-  T FPMaxNM(T a, T b);
-
-  template <typename T>
-  T FPMin(T a, T b);
-
-  template <typename T>
-  T FPMinNM(T a, T b);
-
-  template <typename T>
-  T FPMul(T op1, T op2);
-
-  template <typename T>
-  T FPMulx(T op1, T op2);
-
-  template <typename T>
-  T FPMulAdd(T a, T op1, T op2);
-
-  template <typename T>
-  T FPSqrt(T op);
-
-  template <typename T>
-  T FPSub(T op1, T op2);
-
-  template <typename T>
-  T FPRecipStepFused(T op1, T op2);
-
-  template <typename T>
-  T FPRSqrtStepFused(T op1, T op2);
-
-  // This doesn't do anything at the moment. We'll need it if we want support
-  // for cumulative exception bits or floating-point exceptions.
-  void FPProcessException() {}
-
-  // Standard NaN processing.
-  bool FPProcessNaNs(Instruction* instr);
-
-  void CheckStackAlignment();
-
-  inline void CheckPCSComplianceAndRun();
-
-#ifdef DEBUG
-  // Corruption values should have their least significant byte cleared to
-  // allow the code of the register being corrupted to be inserted.
-  static const uint64_t kCallerSavedRegisterCorruptionValue =
-      0xca11edc0de000000UL;
-  // This value is a NaN in both 32-bit and 64-bit FP.
-  static const uint64_t kCallerSavedVRegisterCorruptionValue =
-      0x7ff000007f801000UL;
-  // This value is a mix of 32/64-bits NaN and "verbose" immediate.
-  static const uint64_t kDefaultCPURegisterCorruptionValue =
-      0x7ffbad007f8bad00UL;
-
-  void CorruptRegisters(CPURegList* list,
-                        uint64_t value = kDefaultCPURegisterCorruptionValue);
-  void CorruptAllCallerSavedCPURegisters();
-#endif
-
-  // Pseudo Printf instruction
-  void DoPrintf(Instruction* instr);
-
-  // Processor state ---------------------------------------
-
-  // Output stream.
-  FILE* stream_;
-  PrintDisassembler* print_disasm_;
-  void PRINTF_FORMAT(2, 3) TraceSim(const char* format, ...);
-
-  // Instrumentation.
-  Instrument* instrument_;
-
-  // General purpose registers. Register 31 is the stack pointer.
-  SimRegister registers_[kNumberOfRegisters];
-
-  // Floating point registers
-  SimVRegister vregisters_[kNumberOfVRegisters];
-
-  // Processor state
-  // bits[31, 27]: Condition flags N, Z, C, and V.
-  //               (Negative, Zero, Carry, Overflow)
-  SimSystemRegister nzcv_;
-
-  // Floating-Point Control Register
-  SimSystemRegister fpcr_;
-
-  // Only a subset of FPCR features are supported by the simulator. This helper
-  // checks that the FPCR settings are supported.
-  //
-  // This is checked when floating-point instructions are executed, not when
-  // FPCR is set. This allows generated code to modify FPCR for external
-  // functions, or to save and restore it when entering and leaving generated
-  // code.
-  void AssertSupportedFPCR() {
-    DCHECK_EQ(fpcr().FZ(), 0);            // No flush-to-zero support.
-    DCHECK(fpcr().RMode() == FPTieEven);  // Ties-to-even rounding only.
-
-    // The simulator does not support half-precision operations so fpcr().AHP()
-    // is irrelevant, and is not checked here.
-  }
-
-  template <typename T>
-  static int CalcNFlag(T result) {
-    return (result >> (sizeof(T) * 8 - 1)) & 1;
-  }
-
-  static int CalcZFlag(uint64_t result) {
-    return result == 0;
-  }
-
-  static const uint32_t kConditionFlagsMask = 0xf0000000;
-
-  // Stack
-  uintptr_t stack_;
-  static const size_t stack_protection_size_ = KB;
-  size_t stack_size_;
-  uintptr_t stack_limit_;
-
-  Decoder<DispatchingDecoderVisitor>* decoder_;
-  Decoder<DispatchingDecoderVisitor>* disassembler_decoder_;
-
-  // Indicates if the pc has been modified by the instruction and should not be
-  // automatically incremented.
-  bool pc_modified_;
-  Instruction* pc_;
-
-  static const char* xreg_names[];
-  static const char* wreg_names[];
-  static const char* sreg_names[];
-  static const char* dreg_names[];
-  static const char* vreg_names[];
-
-  // Debugger input.
-  void set_last_debugger_input(char* input) {
-    DeleteArray(last_debugger_input_);
-    last_debugger_input_ = input;
-  }
-  char* last_debugger_input() { return last_debugger_input_; }
-  char* last_debugger_input_;
-
-  // Synchronization primitives. See ARM DDI 0487A.a, B2.10. Pair types not
-  // implemented.
-  enum class MonitorAccess {
-    Open,
-    Exclusive,
-  };
-
-  enum class TransactionSize {
-    None = 0,
-    Byte = 1,
-    HalfWord = 2,
-    Word = 4,
-  };
-
-  TransactionSize get_transaction_size(unsigned size);
-
-  // The least-significant bits of the address are ignored. The number of bits
-  // is implementation-defined, between 3 and 11. See ARM DDI 0487A.a, B2.10.3.
-  static const uintptr_t kExclusiveTaggedAddrMask = ~((1 << 11) - 1);
-
-  class LocalMonitor {
-   public:
-    LocalMonitor();
-
-    // These functions manage the state machine for the local monitor, but do
-    // not actually perform loads and stores. NotifyStoreExcl only returns
-    // true if the exclusive store is allowed; the global monitor will still
-    // have to be checked to see whether the memory should be updated.
-    void NotifyLoad();
-    void NotifyLoadExcl(uintptr_t addr, TransactionSize size);
-    void NotifyStore();
-    bool NotifyStoreExcl(uintptr_t addr, TransactionSize size);
-
-   private:
-    void Clear();
-
-    MonitorAccess access_state_;
-    uintptr_t tagged_addr_;
-    TransactionSize size_;
-  };
-
-  class GlobalMonitor {
-   public:
-    GlobalMonitor();
-
-    class Processor {
-     public:
-      Processor();
-
-     private:
-      friend class GlobalMonitor;
-      // These functions manage the state machine for the global monitor, but do
-      // not actually perform loads and stores.
-      void Clear_Locked();
-      void NotifyLoadExcl_Locked(uintptr_t addr);
-      void NotifyStore_Locked(bool is_requesting_processor);
-      bool NotifyStoreExcl_Locked(uintptr_t addr, bool is_requesting_processor);
-
-      MonitorAccess access_state_;
-      uintptr_t tagged_addr_;
-      Processor* next_;
-      Processor* prev_;
-      // A stxr can fail due to background cache evictions. Rather than
-      // simulating this, we'll just occasionally introduce cases where an
-      // exclusive store fails. This will happen once after every
-      // kMaxFailureCounter exclusive stores.
-      static const int kMaxFailureCounter = 5;
-      int failure_counter_;
-    };
-
-    // Exposed so it can be accessed by Simulator::{Read,Write}Ex*.
-    base::Mutex mutex;
-
-    void NotifyLoadExcl_Locked(uintptr_t addr, Processor* processor);
-    void NotifyStore_Locked(Processor* processor);
-    bool NotifyStoreExcl_Locked(uintptr_t addr, Processor* processor);
-
-    // Called when the simulator is destroyed.
-    void RemoveProcessor(Processor* processor);
-
-   private:
-    bool IsProcessorInLinkedList_Locked(Processor* processor) const;
-    void PrependProcessor_Locked(Processor* processor);
-
-    Processor* head_;
-  };
-
-  LocalMonitor local_monitor_;
-  GlobalMonitor::Processor global_monitor_processor_;
-  static base::LazyInstance<GlobalMonitor>::type global_monitor_;
-
- private:
-  void Init(FILE* stream);
-
-  V8_EXPORT_PRIVATE void CallImpl(byte* entry, CallArgument* args);
-
-  // Read floating point return values.
-  template <typename T>
-  typename std::enable_if<std::is_floating_point<T>::value, T>::type
-  ReadReturn() {
-    return static_cast<T>(dreg(0));
-  }
-  // Read non-float return values.
-  template <typename T>
-  typename std::enable_if<!std::is_floating_point<T>::value, T>::type
-  ReadReturn() {
-    return ConvertReturn<T>(xreg(0));
-  }
-
-  template <typename T>
-  static T FPDefaultNaN();
-
-  template <typename T>
-  T FPProcessNaN(T op) {
-    DCHECK(std::isnan(op));
-    return fpcr().DN() ? FPDefaultNaN<T>() : ToQuietNaN(op);
-  }
-
-  template <typename T>
-  T FPProcessNaNs(T op1, T op2) {
-    if (IsSignallingNaN(op1)) {
-      return FPProcessNaN(op1);
-    } else if (IsSignallingNaN(op2)) {
-      return FPProcessNaN(op2);
-    } else if (std::isnan(op1)) {
-      DCHECK(IsQuietNaN(op1));
-      return FPProcessNaN(op1);
-    } else if (std::isnan(op2)) {
-      DCHECK(IsQuietNaN(op2));
-      return FPProcessNaN(op2);
-    } else {
-      return 0.0;
-    }
-  }
-
-  template <typename T>
-  T FPProcessNaNs3(T op1, T op2, T op3) {
-    if (IsSignallingNaN(op1)) {
-      return FPProcessNaN(op1);
-    } else if (IsSignallingNaN(op2)) {
-      return FPProcessNaN(op2);
-    } else if (IsSignallingNaN(op3)) {
-      return FPProcessNaN(op3);
-    } else if (std::isnan(op1)) {
-      DCHECK(IsQuietNaN(op1));
-      return FPProcessNaN(op1);
-    } else if (std::isnan(op2)) {
-      DCHECK(IsQuietNaN(op2));
-      return FPProcessNaN(op2);
-    } else if (std::isnan(op3)) {
-      DCHECK(IsQuietNaN(op3));
-      return FPProcessNaN(op3);
-    } else {
-      return 0.0;
-    }
-  }
-
-  int  log_parameters_;
-  Isolate* isolate_;
-};
-
-template <>
-inline double Simulator::FPDefaultNaN<double>() {
-  return kFP64DefaultNaN;
-}
-
-template <>
-inline float Simulator::FPDefaultNaN<float>() {
-  return kFP32DefaultNaN;
-}
-
-#endif  // defined(USE_SIMULATOR)
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_ARM64_SIMULATOR_ARM64_H_
diff --git a/src/v8/src/arm64/simulator-logic-arm64.cc b/src/v8/src/arm64/simulator-logic-arm64.cc
deleted file mode 100644
index 9ee5ea6..0000000
--- a/src/v8/src/arm64/simulator-logic-arm64.cc
+++ /dev/null
@@ -1,4191 +0,0 @@
-// Copyright 2016 the V8 project 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 V8_TARGET_ARCH_ARM64
-
-#include <cmath>
-#include "src/arm64/simulator-arm64.h"
-
-namespace v8 {
-namespace internal {
-
-#if defined(USE_SIMULATOR)
-
-namespace {
-
-// See FPRound for a description of this function.
-inline double FPRoundToDouble(int64_t sign, int64_t exponent, uint64_t mantissa,
-                              FPRounding round_mode) {
-  uint64_t bits = FPRound<uint64_t, kDoubleExponentBits, kDoubleMantissaBits>(
-      sign, exponent, mantissa, round_mode);
-  return bit_cast<double>(bits);
-}
-
-// See FPRound for a description of this function.
-inline float FPRoundToFloat(int64_t sign, int64_t exponent, uint64_t mantissa,
-                            FPRounding round_mode) {
-  uint32_t bits = FPRound<uint32_t, kFloatExponentBits, kFloatMantissaBits>(
-      sign, exponent, mantissa, round_mode);
-  return bit_cast<float>(bits);
-}
-
-// See FPRound for a description of this function.
-inline float16 FPRoundToFloat16(int64_t sign, int64_t exponent,
-                                uint64_t mantissa, FPRounding round_mode) {
-  return FPRound<float16, kFloat16ExponentBits, kFloat16MantissaBits>(
-      sign, exponent, mantissa, round_mode);
-}
-
-}  // namespace
-
-double Simulator::FixedToDouble(int64_t src, int fbits, FPRounding round) {
-  if (src >= 0) {
-    return UFixedToDouble(src, fbits, round);
-  } else if (src == INT64_MIN) {
-    return -UFixedToDouble(src, fbits, round);
-  } else {
-    return -UFixedToDouble(-src, fbits, round);
-  }
-}
-
-double Simulator::UFixedToDouble(uint64_t src, int fbits, FPRounding round) {
-  // An input of 0 is a special case because the result is effectively
-  // subnormal: The exponent is encoded as 0 and there is no implicit 1 bit.
-  if (src == 0) {
-    return 0.0;
-  }
-
-  // Calculate the exponent. The highest significant bit will have the value
-  // 2^exponent.
-  const int highest_significant_bit = 63 - CountLeadingZeros(src, 64);
-  const int64_t exponent = highest_significant_bit - fbits;
-
-  return FPRoundToDouble(0, exponent, src, round);
-}
-
-float Simulator::FixedToFloat(int64_t src, int fbits, FPRounding round) {
-  if (src >= 0) {
-    return UFixedToFloat(src, fbits, round);
-  } else if (src == INT64_MIN) {
-    return -UFixedToFloat(src, fbits, round);
-  } else {
-    return -UFixedToFloat(-src, fbits, round);
-  }
-}
-
-float Simulator::UFixedToFloat(uint64_t src, int fbits, FPRounding round) {
-  // An input of 0 is a special case because the result is effectively
-  // subnormal: The exponent is encoded as 0 and there is no implicit 1 bit.
-  if (src == 0) {
-    return 0.0f;
-  }
-
-  // Calculate the exponent. The highest significant bit will have the value
-  // 2^exponent.
-  const int highest_significant_bit = 63 - CountLeadingZeros(src, 64);
-  const int32_t exponent = highest_significant_bit - fbits;
-
-  return FPRoundToFloat(0, exponent, src, round);
-}
-
-double Simulator::FPToDouble(float value) {
-  switch (std::fpclassify(value)) {
-    case FP_NAN: {
-      if (IsSignallingNaN(value)) {
-        FPProcessException();
-      }
-      if (DN()) return kFP64DefaultNaN;
-
-      // Convert NaNs as the processor would:
-      //  - The sign is propagated.
-      //  - The mantissa is transferred entirely, except that the top bit is
-      //    forced to '1', making the result a quiet NaN. The unused (low-order)
-      //    mantissa bits are set to 0.
-      uint32_t raw = bit_cast<uint32_t>(value);
-
-      uint64_t sign = raw >> 31;
-      uint64_t exponent = (1 << kDoubleExponentBits) - 1;
-      uint64_t mantissa = unsigned_bitextract_64(21, 0, raw);
-
-      // Unused low-order bits remain zero.
-      mantissa <<= (kDoubleMantissaBits - kFloatMantissaBits);
-
-      // Force a quiet NaN.
-      mantissa |= (UINT64_C(1) << (kDoubleMantissaBits - 1));
-
-      return double_pack(sign, exponent, mantissa);
-    }
-
-    case FP_ZERO:
-    case FP_NORMAL:
-    case FP_SUBNORMAL:
-    case FP_INFINITE: {
-      // All other inputs are preserved in a standard cast, because every value
-      // representable using an IEEE-754 float is also representable using an
-      // IEEE-754 double.
-      return static_cast<double>(value);
-    }
-  }
-
-  UNREACHABLE();
-}
-
-float Simulator::FPToFloat(float16 value) {
-  uint32_t sign = value >> 15;
-  uint32_t exponent =
-      unsigned_bitextract_32(kFloat16MantissaBits + kFloat16ExponentBits - 1,
-                             kFloat16MantissaBits, value);
-  uint32_t mantissa =
-      unsigned_bitextract_32(kFloat16MantissaBits - 1, 0, value);
-
-  switch (float16classify(value)) {
-    case FP_ZERO:
-      return (sign == 0) ? 0.0f : -0.0f;
-
-    case FP_INFINITE:
-      return (sign == 0) ? kFP32PositiveInfinity : kFP32NegativeInfinity;
-
-    case FP_SUBNORMAL: {
-      // Calculate shift required to put mantissa into the most-significant bits
-      // of the destination mantissa.
-      int shift = CountLeadingZeros(mantissa << (32 - 10), 32);
-
-      // Shift mantissa and discard implicit '1'.
-      mantissa <<= (kFloatMantissaBits - kFloat16MantissaBits) + shift + 1;
-      mantissa &= (1 << kFloatMantissaBits) - 1;
-
-      // Adjust the exponent for the shift applied, and rebias.
-      exponent = exponent - shift + (kFloatExponentBias - kFloat16ExponentBias);
-      break;
-    }
-
-    case FP_NAN: {
-      if (IsSignallingNaN(value)) {
-        FPProcessException();
-      }
-      if (DN()) return kFP32DefaultNaN;
-
-      // Convert NaNs as the processor would:
-      //  - The sign is propagated.
-      //  - The mantissa is transferred entirely, except that the top bit is
-      //    forced to '1', making the result a quiet NaN. The unused (low-order)
-      //    mantissa bits are set to 0.
-      exponent = (1 << kFloatExponentBits) - 1;
-
-      // Increase bits in mantissa, making low-order bits 0.
-      mantissa <<= (kFloatMantissaBits - kFloat16MantissaBits);
-      mantissa |= 1 << (kFloatMantissaBits - 1);  // Force a quiet NaN.
-      break;
-    }
-
-    case FP_NORMAL: {
-      // Increase bits in mantissa, making low-order bits 0.
-      mantissa <<= (kFloatMantissaBits - kFloat16MantissaBits);
-
-      // Change exponent bias.
-      exponent += (kFloatExponentBias - kFloat16ExponentBias);
-      break;
-    }
-
-    default:
-      UNREACHABLE();
-  }
-  return float_pack(sign, exponent, mantissa);
-}
-
-float16 Simulator::FPToFloat16(float value, FPRounding round_mode) {
-  // Only the FPTieEven rounding mode is implemented.
-  DCHECK_EQ(round_mode, FPTieEven);
-  USE(round_mode);
-
-  int64_t sign = float_sign(value);
-  int64_t exponent =
-      static_cast<int64_t>(float_exp(value)) - kFloatExponentBias;
-  uint32_t mantissa = float_mantissa(value);
-
-  switch (std::fpclassify(value)) {
-    case FP_NAN: {
-      if (IsSignallingNaN(value)) {
-        FPProcessException();
-      }
-      if (DN()) return kFP16DefaultNaN;
-
-      // Convert NaNs as the processor would:
-      //  - The sign is propagated.
-      //  - The mantissa is transferred as much as possible, except that the top
-      //    bit is forced to '1', making the result a quiet NaN.
-      float16 result =
-          (sign == 0) ? kFP16PositiveInfinity : kFP16NegativeInfinity;
-      result |= mantissa >> (kFloatMantissaBits - kFloat16MantissaBits);
-      result |= (1 << (kFloat16MantissaBits - 1));  // Force a quiet NaN;
-      return result;
-    }
-
-    case FP_ZERO:
-      return (sign == 0) ? 0 : 0x8000;
-
-    case FP_INFINITE:
-      return (sign == 0) ? kFP16PositiveInfinity : kFP16NegativeInfinity;
-
-    case FP_NORMAL:
-    case FP_SUBNORMAL: {
-      // Convert float-to-half as the processor would, assuming that FPCR.FZ
-      // (flush-to-zero) is not set.
-
-      // Add the implicit '1' bit to the mantissa.
-      mantissa += (1 << kFloatMantissaBits);
-      return FPRoundToFloat16(sign, exponent, mantissa, round_mode);
-    }
-  }
-
-  UNREACHABLE();
-}
-
-float16 Simulator::FPToFloat16(double value, FPRounding round_mode) {
-  // Only the FPTieEven rounding mode is implemented.
-  DCHECK_EQ(round_mode, FPTieEven);
-  USE(round_mode);
-
-  int64_t sign = double_sign(value);
-  int64_t exponent =
-      static_cast<int64_t>(double_exp(value)) - kDoubleExponentBias;
-  uint64_t mantissa = double_mantissa(value);
-
-  switch (std::fpclassify(value)) {
-    case FP_NAN: {
-      if (IsSignallingNaN(value)) {
-        FPProcessException();
-      }
-      if (DN()) return kFP16DefaultNaN;
-
-      // Convert NaNs as the processor would:
-      //  - The sign is propagated.
-      //  - The mantissa is transferred as much as possible, except that the top
-      //    bit is forced to '1', making the result a quiet NaN.
-      float16 result =
-          (sign == 0) ? kFP16PositiveInfinity : kFP16NegativeInfinity;
-      result |= mantissa >> (kDoubleMantissaBits - kFloat16MantissaBits);
-      result |= (1 << (kFloat16MantissaBits - 1));  // Force a quiet NaN;
-      return result;
-    }
-
-    case FP_ZERO:
-      return (sign == 0) ? 0 : 0x8000;
-
-    case FP_INFINITE:
-      return (sign == 0) ? kFP16PositiveInfinity : kFP16NegativeInfinity;
-
-    case FP_NORMAL:
-    case FP_SUBNORMAL: {
-      // Convert double-to-half as the processor would, assuming that FPCR.FZ
-      // (flush-to-zero) is not set.
-
-      // Add the implicit '1' bit to the mantissa.
-      mantissa += (UINT64_C(1) << kDoubleMantissaBits);
-      return FPRoundToFloat16(sign, exponent, mantissa, round_mode);
-    }
-  }
-
-  UNREACHABLE();
-}
-
-float Simulator::FPToFloat(double value, FPRounding round_mode) {
-  // Only the FPTieEven rounding mode is implemented.
-  DCHECK((round_mode == FPTieEven) || (round_mode == FPRoundOdd));
-  USE(round_mode);
-
-  switch (std::fpclassify(value)) {
-    case FP_NAN: {
-      if (IsSignallingNaN(value)) {
-        FPProcessException();
-      }
-      if (DN()) return kFP32DefaultNaN;
-
-      // Convert NaNs as the processor would:
-      //  - The sign is propagated.
-      //  - The mantissa is transferred as much as possible, except that the
-      //    top bit is forced to '1', making the result a quiet NaN.
-
-      uint64_t raw = bit_cast<uint64_t>(value);
-
-      uint32_t sign = raw >> 63;
-      uint32_t exponent = (1 << 8) - 1;
-      uint32_t mantissa = static_cast<uint32_t>(unsigned_bitextract_64(
-          50, kDoubleMantissaBits - kFloatMantissaBits, raw));
-      mantissa |= (1 << (kFloatMantissaBits - 1));  // Force a quiet NaN.
-
-      return float_pack(sign, exponent, mantissa);
-    }
-
-    case FP_ZERO:
-    case FP_INFINITE: {
-      // In a C++ cast, any value representable in the target type will be
-      // unchanged. This is always the case for +/-0.0 and infinities.
-      return static_cast<float>(value);
-    }
-
-    case FP_NORMAL:
-    case FP_SUBNORMAL: {
-      // Convert double-to-float as the processor would, assuming that FPCR.FZ
-      // (flush-to-zero) is not set.
-      uint32_t sign = double_sign(value);
-      int64_t exponent =
-          static_cast<int64_t>(double_exp(value)) - kDoubleExponentBias;
-      uint64_t mantissa = double_mantissa(value);
-      if (std::fpclassify(value) == FP_NORMAL) {
-        // For normal FP values, add the hidden bit.
-        mantissa |= (UINT64_C(1) << kDoubleMantissaBits);
-      }
-      return FPRoundToFloat(sign, exponent, mantissa, round_mode);
-    }
-  }
-
-  UNREACHABLE();
-}
-
-void Simulator::ld1(VectorFormat vform, LogicVRegister dst, uint64_t addr) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    dst.ReadUintFromMem(vform, i, addr);
-    addr += LaneSizeInBytesFromFormat(vform);
-  }
-}
-
-void Simulator::ld1(VectorFormat vform, LogicVRegister dst, int index,
-                    uint64_t addr) {
-  dst.ReadUintFromMem(vform, index, addr);
-}
-
-void Simulator::ld1r(VectorFormat vform, LogicVRegister dst, uint64_t addr) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    dst.ReadUintFromMem(vform, i, addr);
-  }
-}
-
-void Simulator::ld2(VectorFormat vform, LogicVRegister dst1,
-                    LogicVRegister dst2, uint64_t addr1) {
-  dst1.ClearForWrite(vform);
-  dst2.ClearForWrite(vform);
-  int esize = LaneSizeInBytesFromFormat(vform);
-  uint64_t addr2 = addr1 + esize;
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    dst1.ReadUintFromMem(vform, i, addr1);
-    dst2.ReadUintFromMem(vform, i, addr2);
-    addr1 += 2 * esize;
-    addr2 += 2 * esize;
-  }
-}
-
-void Simulator::ld2(VectorFormat vform, LogicVRegister dst1,
-                    LogicVRegister dst2, int index, uint64_t addr1) {
-  dst1.ClearForWrite(vform);
-  dst2.ClearForWrite(vform);
-  uint64_t addr2 = addr1 + LaneSizeInBytesFromFormat(vform);
-  dst1.ReadUintFromMem(vform, index, addr1);
-  dst2.ReadUintFromMem(vform, index, addr2);
-}
-
-void Simulator::ld2r(VectorFormat vform, LogicVRegister dst1,
-                     LogicVRegister dst2, uint64_t addr) {
-  dst1.ClearForWrite(vform);
-  dst2.ClearForWrite(vform);
-  uint64_t addr2 = addr + LaneSizeInBytesFromFormat(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    dst1.ReadUintFromMem(vform, i, addr);
-    dst2.ReadUintFromMem(vform, i, addr2);
-  }
-}
-
-void Simulator::ld3(VectorFormat vform, LogicVRegister dst1,
-                    LogicVRegister dst2, LogicVRegister dst3, uint64_t addr1) {
-  dst1.ClearForWrite(vform);
-  dst2.ClearForWrite(vform);
-  dst3.ClearForWrite(vform);
-  int esize = LaneSizeInBytesFromFormat(vform);
-  uint64_t addr2 = addr1 + esize;
-  uint64_t addr3 = addr2 + esize;
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    dst1.ReadUintFromMem(vform, i, addr1);
-    dst2.ReadUintFromMem(vform, i, addr2);
-    dst3.ReadUintFromMem(vform, i, addr3);
-    addr1 += 3 * esize;
-    addr2 += 3 * esize;
-    addr3 += 3 * esize;
-  }
-}
-
-void Simulator::ld3(VectorFormat vform, LogicVRegister dst1,
-                    LogicVRegister dst2, LogicVRegister dst3, int index,
-                    uint64_t addr1) {
-  dst1.ClearForWrite(vform);
-  dst2.ClearForWrite(vform);
-  dst3.ClearForWrite(vform);
-  uint64_t addr2 = addr1 + LaneSizeInBytesFromFormat(vform);
-  uint64_t addr3 = addr2 + LaneSizeInBytesFromFormat(vform);
-  dst1.ReadUintFromMem(vform, index, addr1);
-  dst2.ReadUintFromMem(vform, index, addr2);
-  dst3.ReadUintFromMem(vform, index, addr3);
-}
-
-void Simulator::ld3r(VectorFormat vform, LogicVRegister dst1,
-                     LogicVRegister dst2, LogicVRegister dst3, uint64_t addr) {
-  dst1.ClearForWrite(vform);
-  dst2.ClearForWrite(vform);
-  dst3.ClearForWrite(vform);
-  uint64_t addr2 = addr + LaneSizeInBytesFromFormat(vform);
-  uint64_t addr3 = addr2 + LaneSizeInBytesFromFormat(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    dst1.ReadUintFromMem(vform, i, addr);
-    dst2.ReadUintFromMem(vform, i, addr2);
-    dst3.ReadUintFromMem(vform, i, addr3);
-  }
-}
-
-void Simulator::ld4(VectorFormat vform, LogicVRegister dst1,
-                    LogicVRegister dst2, LogicVRegister dst3,
-                    LogicVRegister dst4, uint64_t addr1) {
-  dst1.ClearForWrite(vform);
-  dst2.ClearForWrite(vform);
-  dst3.ClearForWrite(vform);
-  dst4.ClearForWrite(vform);
-  int esize = LaneSizeInBytesFromFormat(vform);
-  uint64_t addr2 = addr1 + esize;
-  uint64_t addr3 = addr2 + esize;
-  uint64_t addr4 = addr3 + esize;
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    dst1.ReadUintFromMem(vform, i, addr1);
-    dst2.ReadUintFromMem(vform, i, addr2);
-    dst3.ReadUintFromMem(vform, i, addr3);
-    dst4.ReadUintFromMem(vform, i, addr4);
-    addr1 += 4 * esize;
-    addr2 += 4 * esize;
-    addr3 += 4 * esize;
-    addr4 += 4 * esize;
-  }
-}
-
-void Simulator::ld4(VectorFormat vform, LogicVRegister dst1,
-                    LogicVRegister dst2, LogicVRegister dst3,
-                    LogicVRegister dst4, int index, uint64_t addr1) {
-  dst1.ClearForWrite(vform);
-  dst2.ClearForWrite(vform);
-  dst3.ClearForWrite(vform);
-  dst4.ClearForWrite(vform);
-  uint64_t addr2 = addr1 + LaneSizeInBytesFromFormat(vform);
-  uint64_t addr3 = addr2 + LaneSizeInBytesFromFormat(vform);
-  uint64_t addr4 = addr3 + LaneSizeInBytesFromFormat(vform);
-  dst1.ReadUintFromMem(vform, index, addr1);
-  dst2.ReadUintFromMem(vform, index, addr2);
-  dst3.ReadUintFromMem(vform, index, addr3);
-  dst4.ReadUintFromMem(vform, index, addr4);
-}
-
-void Simulator::ld4r(VectorFormat vform, LogicVRegister dst1,
-                     LogicVRegister dst2, LogicVRegister dst3,
-                     LogicVRegister dst4, uint64_t addr) {
-  dst1.ClearForWrite(vform);
-  dst2.ClearForWrite(vform);
-  dst3.ClearForWrite(vform);
-  dst4.ClearForWrite(vform);
-  uint64_t addr2 = addr + LaneSizeInBytesFromFormat(vform);
-  uint64_t addr3 = addr2 + LaneSizeInBytesFromFormat(vform);
-  uint64_t addr4 = addr3 + LaneSizeInBytesFromFormat(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    dst1.ReadUintFromMem(vform, i, addr);
-    dst2.ReadUintFromMem(vform, i, addr2);
-    dst3.ReadUintFromMem(vform, i, addr3);
-    dst4.ReadUintFromMem(vform, i, addr4);
-  }
-}
-
-void Simulator::st1(VectorFormat vform, LogicVRegister src, uint64_t addr) {
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    src.WriteUintToMem(vform, i, addr);
-    addr += LaneSizeInBytesFromFormat(vform);
-  }
-}
-
-void Simulator::st1(VectorFormat vform, LogicVRegister src, int index,
-                    uint64_t addr) {
-  src.WriteUintToMem(vform, index, addr);
-}
-
-void Simulator::st2(VectorFormat vform, LogicVRegister dst, LogicVRegister dst2,
-                    uint64_t addr) {
-  int esize = LaneSizeInBytesFromFormat(vform);
-  uint64_t addr2 = addr + esize;
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    dst.WriteUintToMem(vform, i, addr);
-    dst2.WriteUintToMem(vform, i, addr2);
-    addr += 2 * esize;
-    addr2 += 2 * esize;
-  }
-}
-
-void Simulator::st2(VectorFormat vform, LogicVRegister dst, LogicVRegister dst2,
-                    int index, uint64_t addr) {
-  int esize = LaneSizeInBytesFromFormat(vform);
-  dst.WriteUintToMem(vform, index, addr);
-  dst2.WriteUintToMem(vform, index, addr + 1 * esize);
-}
-
-void Simulator::st3(VectorFormat vform, LogicVRegister dst, LogicVRegister dst2,
-                    LogicVRegister dst3, uint64_t addr) {
-  int esize = LaneSizeInBytesFromFormat(vform);
-  uint64_t addr2 = addr + esize;
-  uint64_t addr3 = addr2 + esize;
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    dst.WriteUintToMem(vform, i, addr);
-    dst2.WriteUintToMem(vform, i, addr2);
-    dst3.WriteUintToMem(vform, i, addr3);
-    addr += 3 * esize;
-    addr2 += 3 * esize;
-    addr3 += 3 * esize;
-  }
-}
-
-void Simulator::st3(VectorFormat vform, LogicVRegister dst, LogicVRegister dst2,
-                    LogicVRegister dst3, int index, uint64_t addr) {
-  int esize = LaneSizeInBytesFromFormat(vform);
-  dst.WriteUintToMem(vform, index, addr);
-  dst2.WriteUintToMem(vform, index, addr + 1 * esize);
-  dst3.WriteUintToMem(vform, index, addr + 2 * esize);
-}
-
-void Simulator::st4(VectorFormat vform, LogicVRegister dst, LogicVRegister dst2,
-                    LogicVRegister dst3, LogicVRegister dst4, uint64_t addr) {
-  int esize = LaneSizeInBytesFromFormat(vform);
-  uint64_t addr2 = addr + esize;
-  uint64_t addr3 = addr2 + esize;
-  uint64_t addr4 = addr3 + esize;
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    dst.WriteUintToMem(vform, i, addr);
-    dst2.WriteUintToMem(vform, i, addr2);
-    dst3.WriteUintToMem(vform, i, addr3);
-    dst4.WriteUintToMem(vform, i, addr4);
-    addr += 4 * esize;
-    addr2 += 4 * esize;
-    addr3 += 4 * esize;
-    addr4 += 4 * esize;
-  }
-}
-
-void Simulator::st4(VectorFormat vform, LogicVRegister dst, LogicVRegister dst2,
-                    LogicVRegister dst3, LogicVRegister dst4, int index,
-                    uint64_t addr) {
-  int esize = LaneSizeInBytesFromFormat(vform);
-  dst.WriteUintToMem(vform, index, addr);
-  dst2.WriteUintToMem(vform, index, addr + 1 * esize);
-  dst3.WriteUintToMem(vform, index, addr + 2 * esize);
-  dst4.WriteUintToMem(vform, index, addr + 3 * esize);
-}
-
-LogicVRegister Simulator::cmp(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src1,
-                              const LogicVRegister& src2, Condition cond) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    int64_t sa = src1.Int(vform, i);
-    int64_t sb = src2.Int(vform, i);
-    uint64_t ua = src1.Uint(vform, i);
-    uint64_t ub = src2.Uint(vform, i);
-    bool result = false;
-    switch (cond) {
-      case eq:
-        result = (ua == ub);
-        break;
-      case ge:
-        result = (sa >= sb);
-        break;
-      case gt:
-        result = (sa > sb);
-        break;
-      case hi:
-        result = (ua > ub);
-        break;
-      case hs:
-        result = (ua >= ub);
-        break;
-      case lt:
-        result = (sa < sb);
-        break;
-      case le:
-        result = (sa <= sb);
-        break;
-      default:
-        UNREACHABLE();
-    }
-    dst.SetUint(vform, i, result ? MaxUintFromFormat(vform) : 0);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::cmp(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src1, int imm,
-                              Condition cond) {
-  SimVRegister temp;
-  LogicVRegister imm_reg = dup_immediate(vform, temp, imm);
-  return cmp(vform, dst, src1, imm_reg, cond);
-}
-
-LogicVRegister Simulator::cmptst(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    uint64_t ua = src1.Uint(vform, i);
-    uint64_t ub = src2.Uint(vform, i);
-    dst.SetUint(vform, i, ((ua & ub) != 0) ? MaxUintFromFormat(vform) : 0);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::add(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src1,
-                              const LogicVRegister& src2) {
-  int lane_size = LaneSizeInBitsFromFormat(vform);
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    // Test for unsigned saturation.
-    uint64_t ua = src1.UintLeftJustified(vform, i);
-    uint64_t ub = src2.UintLeftJustified(vform, i);
-    uint64_t ur = ua + ub;
-    if (ur < ua) {
-      dst.SetUnsignedSat(i, true);
-    }
-
-    // Test for signed saturation.
-    bool pos_a = (ua >> 63) == 0;
-    bool pos_b = (ub >> 63) == 0;
-    bool pos_r = (ur >> 63) == 0;
-    // If the signs of the operands are the same, but different from the result,
-    // there was an overflow.
-    if ((pos_a == pos_b) && (pos_a != pos_r)) {
-      dst.SetSignedSat(i, pos_a);
-    }
-
-    dst.SetInt(vform, i, ur >> (64 - lane_size));
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::addp(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  uzp1(vform, temp1, src1, src2);
-  uzp2(vform, temp2, src1, src2);
-  add(vform, dst, temp1, temp2);
-  return dst;
-}
-
-LogicVRegister Simulator::mla(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src1,
-                              const LogicVRegister& src2) {
-  SimVRegister temp;
-  mul(vform, temp, src1, src2);
-  add(vform, dst, dst, temp);
-  return dst;
-}
-
-LogicVRegister Simulator::mls(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src1,
-                              const LogicVRegister& src2) {
-  SimVRegister temp;
-  mul(vform, temp, src1, src2);
-  sub(vform, dst, dst, temp);
-  return dst;
-}
-
-LogicVRegister Simulator::mul(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src1,
-                              const LogicVRegister& src2) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    dst.SetUint(vform, i, src1.Uint(vform, i) * src2.Uint(vform, i));
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::mul(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src1,
-                              const LogicVRegister& src2, int index) {
-  SimVRegister temp;
-  VectorFormat indexform = VectorFormatFillQ(vform);
-  return mul(vform, dst, src1, dup_element(indexform, temp, src2, index));
-}
-
-LogicVRegister Simulator::mla(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src1,
-                              const LogicVRegister& src2, int index) {
-  SimVRegister temp;
-  VectorFormat indexform = VectorFormatFillQ(vform);
-  return mla(vform, dst, src1, dup_element(indexform, temp, src2, index));
-}
-
-LogicVRegister Simulator::mls(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src1,
-                              const LogicVRegister& src2, int index) {
-  SimVRegister temp;
-  VectorFormat indexform = VectorFormatFillQ(vform);
-  return mls(vform, dst, src1, dup_element(indexform, temp, src2, index));
-}
-
-LogicVRegister Simulator::smull(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2, int index) {
-  SimVRegister temp;
-  VectorFormat indexform =
-      VectorFormatHalfWidthDoubleLanes(VectorFormatFillQ(vform));
-  return smull(vform, dst, src1, dup_element(indexform, temp, src2, index));
-}
-
-LogicVRegister Simulator::smull2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2, int index) {
-  SimVRegister temp;
-  VectorFormat indexform =
-      VectorFormatHalfWidthDoubleLanes(VectorFormatFillQ(vform));
-  return smull2(vform, dst, src1, dup_element(indexform, temp, src2, index));
-}
-
-LogicVRegister Simulator::umull(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2, int index) {
-  SimVRegister temp;
-  VectorFormat indexform =
-      VectorFormatHalfWidthDoubleLanes(VectorFormatFillQ(vform));
-  return umull(vform, dst, src1, dup_element(indexform, temp, src2, index));
-}
-
-LogicVRegister Simulator::umull2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2, int index) {
-  SimVRegister temp;
-  VectorFormat indexform =
-      VectorFormatHalfWidthDoubleLanes(VectorFormatFillQ(vform));
-  return umull2(vform, dst, src1, dup_element(indexform, temp, src2, index));
-}
-
-LogicVRegister Simulator::smlal(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2, int index) {
-  SimVRegister temp;
-  VectorFormat indexform =
-      VectorFormatHalfWidthDoubleLanes(VectorFormatFillQ(vform));
-  return smlal(vform, dst, src1, dup_element(indexform, temp, src2, index));
-}
-
-LogicVRegister Simulator::smlal2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2, int index) {
-  SimVRegister temp;
-  VectorFormat indexform =
-      VectorFormatHalfWidthDoubleLanes(VectorFormatFillQ(vform));
-  return smlal2(vform, dst, src1, dup_element(indexform, temp, src2, index));
-}
-
-LogicVRegister Simulator::umlal(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2, int index) {
-  SimVRegister temp;
-  VectorFormat indexform =
-      VectorFormatHalfWidthDoubleLanes(VectorFormatFillQ(vform));
-  return umlal(vform, dst, src1, dup_element(indexform, temp, src2, index));
-}
-
-LogicVRegister Simulator::umlal2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2, int index) {
-  SimVRegister temp;
-  VectorFormat indexform =
-      VectorFormatHalfWidthDoubleLanes(VectorFormatFillQ(vform));
-  return umlal2(vform, dst, src1, dup_element(indexform, temp, src2, index));
-}
-
-LogicVRegister Simulator::smlsl(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2, int index) {
-  SimVRegister temp;
-  VectorFormat indexform =
-      VectorFormatHalfWidthDoubleLanes(VectorFormatFillQ(vform));
-  return smlsl(vform, dst, src1, dup_element(indexform, temp, src2, index));
-}
-
-LogicVRegister Simulator::smlsl2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2, int index) {
-  SimVRegister temp;
-  VectorFormat indexform =
-      VectorFormatHalfWidthDoubleLanes(VectorFormatFillQ(vform));
-  return smlsl2(vform, dst, src1, dup_element(indexform, temp, src2, index));
-}
-
-LogicVRegister Simulator::umlsl(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2, int index) {
-  SimVRegister temp;
-  VectorFormat indexform =
-      VectorFormatHalfWidthDoubleLanes(VectorFormatFillQ(vform));
-  return umlsl(vform, dst, src1, dup_element(indexform, temp, src2, index));
-}
-
-LogicVRegister Simulator::umlsl2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2, int index) {
-  SimVRegister temp;
-  VectorFormat indexform =
-      VectorFormatHalfWidthDoubleLanes(VectorFormatFillQ(vform));
-  return umlsl2(vform, dst, src1, dup_element(indexform, temp, src2, index));
-}
-
-LogicVRegister Simulator::sqdmull(VectorFormat vform, LogicVRegister dst,
-                                  const LogicVRegister& src1,
-                                  const LogicVRegister& src2, int index) {
-  SimVRegister temp;
-  VectorFormat indexform =
-      VectorFormatHalfWidthDoubleLanes(VectorFormatFillQ(vform));
-  return sqdmull(vform, dst, src1, dup_element(indexform, temp, src2, index));
-}
-
-LogicVRegister Simulator::sqdmull2(VectorFormat vform, LogicVRegister dst,
-                                   const LogicVRegister& src1,
-                                   const LogicVRegister& src2, int index) {
-  SimVRegister temp;
-  VectorFormat indexform =
-      VectorFormatHalfWidthDoubleLanes(VectorFormatFillQ(vform));
-  return sqdmull2(vform, dst, src1, dup_element(indexform, temp, src2, index));
-}
-
-LogicVRegister Simulator::sqdmlal(VectorFormat vform, LogicVRegister dst,
-                                  const LogicVRegister& src1,
-                                  const LogicVRegister& src2, int index) {
-  SimVRegister temp;
-  VectorFormat indexform =
-      VectorFormatHalfWidthDoubleLanes(VectorFormatFillQ(vform));
-  return sqdmlal(vform, dst, src1, dup_element(indexform, temp, src2, index));
-}
-
-LogicVRegister Simulator::sqdmlal2(VectorFormat vform, LogicVRegister dst,
-                                   const LogicVRegister& src1,
-                                   const LogicVRegister& src2, int index) {
-  SimVRegister temp;
-  VectorFormat indexform =
-      VectorFormatHalfWidthDoubleLanes(VectorFormatFillQ(vform));
-  return sqdmlal2(vform, dst, src1, dup_element(indexform, temp, src2, index));
-}
-
-LogicVRegister Simulator::sqdmlsl(VectorFormat vform, LogicVRegister dst,
-                                  const LogicVRegister& src1,
-                                  const LogicVRegister& src2, int index) {
-  SimVRegister temp;
-  VectorFormat indexform =
-      VectorFormatHalfWidthDoubleLanes(VectorFormatFillQ(vform));
-  return sqdmlsl(vform, dst, src1, dup_element(indexform, temp, src2, index));
-}
-
-LogicVRegister Simulator::sqdmlsl2(VectorFormat vform, LogicVRegister dst,
-                                   const LogicVRegister& src1,
-                                   const LogicVRegister& src2, int index) {
-  SimVRegister temp;
-  VectorFormat indexform =
-      VectorFormatHalfWidthDoubleLanes(VectorFormatFillQ(vform));
-  return sqdmlsl2(vform, dst, src1, dup_element(indexform, temp, src2, index));
-}
-
-LogicVRegister Simulator::sqdmulh(VectorFormat vform, LogicVRegister dst,
-                                  const LogicVRegister& src1,
-                                  const LogicVRegister& src2, int index) {
-  SimVRegister temp;
-  VectorFormat indexform = VectorFormatFillQ(vform);
-  return sqdmulh(vform, dst, src1, dup_element(indexform, temp, src2, index));
-}
-
-LogicVRegister Simulator::sqrdmulh(VectorFormat vform, LogicVRegister dst,
-                                   const LogicVRegister& src1,
-                                   const LogicVRegister& src2, int index) {
-  SimVRegister temp;
-  VectorFormat indexform = VectorFormatFillQ(vform);
-  return sqrdmulh(vform, dst, src1, dup_element(indexform, temp, src2, index));
-}
-
-uint16_t Simulator::PolynomialMult(uint8_t op1, uint8_t op2) {
-  uint16_t result = 0;
-  uint16_t extended_op2 = op2;
-  for (int i = 0; i < 8; ++i) {
-    if ((op1 >> i) & 1) {
-      result = result ^ (extended_op2 << i);
-    }
-  }
-  return result;
-}
-
-LogicVRegister Simulator::pmul(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    dst.SetUint(vform, i,
-                PolynomialMult(src1.Uint(vform, i), src2.Uint(vform, i)));
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::pmull(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2) {
-  VectorFormat vform_src = VectorFormatHalfWidth(vform);
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    dst.SetUint(
-        vform, i,
-        PolynomialMult(src1.Uint(vform_src, i), src2.Uint(vform_src, i)));
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::pmull2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2) {
-  VectorFormat vform_src = VectorFormatHalfWidthDoubleLanes(vform);
-  dst.ClearForWrite(vform);
-  int lane_count = LaneCountFromFormat(vform);
-  for (int i = 0; i < lane_count; i++) {
-    dst.SetUint(vform, i,
-                PolynomialMult(src1.Uint(vform_src, lane_count + i),
-                               src2.Uint(vform_src, lane_count + i)));
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::sub(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src1,
-                              const LogicVRegister& src2) {
-  int lane_size = LaneSizeInBitsFromFormat(vform);
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    // Test for unsigned saturation.
-    uint64_t ua = src1.UintLeftJustified(vform, i);
-    uint64_t ub = src2.UintLeftJustified(vform, i);
-    uint64_t ur = ua - ub;
-    if (ub > ua) {
-      dst.SetUnsignedSat(i, false);
-    }
-
-    // Test for signed saturation.
-    bool pos_a = (ua >> 63) == 0;
-    bool pos_b = (ub >> 63) == 0;
-    bool pos_r = (ur >> 63) == 0;
-    // If the signs of the operands are different, and the sign of the first
-    // operand doesn't match the result, there was an overflow.
-    if ((pos_a != pos_b) && (pos_a != pos_r)) {
-      dst.SetSignedSat(i, pos_a);
-    }
-
-    dst.SetInt(vform, i, ur >> (64 - lane_size));
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::and_(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    dst.SetUint(vform, i, src1.Uint(vform, i) & src2.Uint(vform, i));
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::orr(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src1,
-                              const LogicVRegister& src2) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    dst.SetUint(vform, i, src1.Uint(vform, i) | src2.Uint(vform, i));
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::orn(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src1,
-                              const LogicVRegister& src2) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    dst.SetUint(vform, i, src1.Uint(vform, i) | ~src2.Uint(vform, i));
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::eor(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src1,
-                              const LogicVRegister& src2) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    dst.SetUint(vform, i, src1.Uint(vform, i) ^ src2.Uint(vform, i));
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::bic(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src1,
-                              const LogicVRegister& src2) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    dst.SetUint(vform, i, src1.Uint(vform, i) & ~src2.Uint(vform, i));
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::bic(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src, uint64_t imm) {
-  uint64_t result[16];
-  int laneCount = LaneCountFromFormat(vform);
-  for (int i = 0; i < laneCount; ++i) {
-    result[i] = src.Uint(vform, i) & ~imm;
-  }
-  dst.SetUintArray(vform, result);
-  return dst;
-}
-
-LogicVRegister Simulator::bif(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src1,
-                              const LogicVRegister& src2) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    uint64_t operand1 = dst.Uint(vform, i);
-    uint64_t operand2 = ~src2.Uint(vform, i);
-    uint64_t operand3 = src1.Uint(vform, i);
-    uint64_t result = operand1 ^ ((operand1 ^ operand3) & operand2);
-    dst.SetUint(vform, i, result);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::bit(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src1,
-                              const LogicVRegister& src2) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    uint64_t operand1 = dst.Uint(vform, i);
-    uint64_t operand2 = src2.Uint(vform, i);
-    uint64_t operand3 = src1.Uint(vform, i);
-    uint64_t result = operand1 ^ ((operand1 ^ operand3) & operand2);
-    dst.SetUint(vform, i, result);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::bsl(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src1,
-                              const LogicVRegister& src2) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    uint64_t operand1 = src2.Uint(vform, i);
-    uint64_t operand2 = dst.Uint(vform, i);
-    uint64_t operand3 = src1.Uint(vform, i);
-    uint64_t result = operand1 ^ ((operand1 ^ operand3) & operand2);
-    dst.SetUint(vform, i, result);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::SMinMax(VectorFormat vform, LogicVRegister dst,
-                                  const LogicVRegister& src1,
-                                  const LogicVRegister& src2, bool max) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    int64_t src1_val = src1.Int(vform, i);
-    int64_t src2_val = src2.Int(vform, i);
-    int64_t dst_val;
-    if (max) {
-      dst_val = (src1_val > src2_val) ? src1_val : src2_val;
-    } else {
-      dst_val = (src1_val < src2_val) ? src1_val : src2_val;
-    }
-    dst.SetInt(vform, i, dst_val);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::smax(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2) {
-  return SMinMax(vform, dst, src1, src2, true);
-}
-
-LogicVRegister Simulator::smin(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2) {
-  return SMinMax(vform, dst, src1, src2, false);
-}
-
-LogicVRegister Simulator::SMinMaxP(VectorFormat vform, LogicVRegister dst,
-                                   const LogicVRegister& src1,
-                                   const LogicVRegister& src2, bool max) {
-  int lanes = LaneCountFromFormat(vform);
-  int64_t result[kMaxLanesPerVector];
-  const LogicVRegister* src = &src1;
-  for (int j = 0; j < 2; j++) {
-    for (int i = 0; i < lanes; i += 2) {
-      int64_t first_val = src->Int(vform, i);
-      int64_t second_val = src->Int(vform, i + 1);
-      int64_t dst_val;
-      if (max) {
-        dst_val = (first_val > second_val) ? first_val : second_val;
-      } else {
-        dst_val = (first_val < second_val) ? first_val : second_val;
-      }
-      DCHECK_LT((i >> 1) + (j * lanes / 2), kMaxLanesPerVector);
-      result[(i >> 1) + (j * lanes / 2)] = dst_val;
-    }
-    src = &src2;
-  }
-  dst.SetIntArray(vform, result);
-  return dst;
-}
-
-LogicVRegister Simulator::smaxp(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2) {
-  return SMinMaxP(vform, dst, src1, src2, true);
-}
-
-LogicVRegister Simulator::sminp(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2) {
-  return SMinMaxP(vform, dst, src1, src2, false);
-}
-
-LogicVRegister Simulator::addp(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src) {
-  DCHECK_EQ(vform, kFormatD);
-
-  uint64_t dst_val = src.Uint(kFormat2D, 0) + src.Uint(kFormat2D, 1);
-  dst.ClearForWrite(vform);
-  dst.SetUint(vform, 0, dst_val);
-  return dst;
-}
-
-LogicVRegister Simulator::addv(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src) {
-  VectorFormat vform_dst =
-      ScalarFormatFromLaneSize(LaneSizeInBitsFromFormat(vform));
-
-  int64_t dst_val = 0;
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    dst_val += src.Int(vform, i);
-  }
-
-  dst.ClearForWrite(vform_dst);
-  dst.SetInt(vform_dst, 0, dst_val);
-  return dst;
-}
-
-LogicVRegister Simulator::saddlv(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src) {
-  VectorFormat vform_dst =
-      ScalarFormatFromLaneSize(LaneSizeInBitsFromFormat(vform) * 2);
-
-  int64_t dst_val = 0;
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    dst_val += src.Int(vform, i);
-  }
-
-  dst.ClearForWrite(vform_dst);
-  dst.SetInt(vform_dst, 0, dst_val);
-  return dst;
-}
-
-LogicVRegister Simulator::uaddlv(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src) {
-  VectorFormat vform_dst =
-      ScalarFormatFromLaneSize(LaneSizeInBitsFromFormat(vform) * 2);
-
-  uint64_t dst_val = 0;
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    dst_val += src.Uint(vform, i);
-  }
-
-  dst.ClearForWrite(vform_dst);
-  dst.SetUint(vform_dst, 0, dst_val);
-  return dst;
-}
-
-LogicVRegister Simulator::SMinMaxV(VectorFormat vform, LogicVRegister dst,
-                                   const LogicVRegister& src, bool max) {
-  int64_t dst_val = max ? INT64_MIN : INT64_MAX;
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    int64_t src_val = src.Int(vform, i);
-    if (max) {
-      dst_val = (src_val > dst_val) ? src_val : dst_val;
-    } else {
-      dst_val = (src_val < dst_val) ? src_val : dst_val;
-    }
-  }
-  dst.ClearForWrite(ScalarFormatFromFormat(vform));
-  dst.SetInt(vform, 0, dst_val);
-  return dst;
-}
-
-LogicVRegister Simulator::smaxv(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src) {
-  SMinMaxV(vform, dst, src, true);
-  return dst;
-}
-
-LogicVRegister Simulator::sminv(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src) {
-  SMinMaxV(vform, dst, src, false);
-  return dst;
-}
-
-LogicVRegister Simulator::UMinMax(VectorFormat vform, LogicVRegister dst,
-                                  const LogicVRegister& src1,
-                                  const LogicVRegister& src2, bool max) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    uint64_t src1_val = src1.Uint(vform, i);
-    uint64_t src2_val = src2.Uint(vform, i);
-    uint64_t dst_val;
-    if (max) {
-      dst_val = (src1_val > src2_val) ? src1_val : src2_val;
-    } else {
-      dst_val = (src1_val < src2_val) ? src1_val : src2_val;
-    }
-    dst.SetUint(vform, i, dst_val);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::umax(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2) {
-  return UMinMax(vform, dst, src1, src2, true);
-}
-
-LogicVRegister Simulator::umin(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2) {
-  return UMinMax(vform, dst, src1, src2, false);
-}
-
-LogicVRegister Simulator::UMinMaxP(VectorFormat vform, LogicVRegister dst,
-                                   const LogicVRegister& src1,
-                                   const LogicVRegister& src2, bool max) {
-  int lanes = LaneCountFromFormat(vform);
-  uint64_t result[kMaxLanesPerVector];
-  const LogicVRegister* src = &src1;
-  for (int j = 0; j < 2; j++) {
-    for (int i = 0; i < LaneCountFromFormat(vform); i += 2) {
-      uint64_t first_val = src->Uint(vform, i);
-      uint64_t second_val = src->Uint(vform, i + 1);
-      uint64_t dst_val;
-      if (max) {
-        dst_val = (first_val > second_val) ? first_val : second_val;
-      } else {
-        dst_val = (first_val < second_val) ? first_val : second_val;
-      }
-      DCHECK_LT((i >> 1) + (j * lanes / 2), kMaxLanesPerVector);
-      result[(i >> 1) + (j * lanes / 2)] = dst_val;
-    }
-    src = &src2;
-  }
-  dst.SetUintArray(vform, result);
-  return dst;
-}
-
-LogicVRegister Simulator::umaxp(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2) {
-  return UMinMaxP(vform, dst, src1, src2, true);
-}
-
-LogicVRegister Simulator::uminp(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2) {
-  return UMinMaxP(vform, dst, src1, src2, false);
-}
-
-LogicVRegister Simulator::UMinMaxV(VectorFormat vform, LogicVRegister dst,
-                                   const LogicVRegister& src, bool max) {
-  uint64_t dst_val = max ? 0 : UINT64_MAX;
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    uint64_t src_val = src.Uint(vform, i);
-    if (max) {
-      dst_val = (src_val > dst_val) ? src_val : dst_val;
-    } else {
-      dst_val = (src_val < dst_val) ? src_val : dst_val;
-    }
-  }
-  dst.ClearForWrite(ScalarFormatFromFormat(vform));
-  dst.SetUint(vform, 0, dst_val);
-  return dst;
-}
-
-LogicVRegister Simulator::umaxv(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src) {
-  UMinMaxV(vform, dst, src, true);
-  return dst;
-}
-
-LogicVRegister Simulator::uminv(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src) {
-  UMinMaxV(vform, dst, src, false);
-  return dst;
-}
-
-LogicVRegister Simulator::shl(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src, int shift) {
-  DCHECK_GE(shift, 0);
-  SimVRegister temp;
-  LogicVRegister shiftreg = dup_immediate(vform, temp, shift);
-  return ushl(vform, dst, src, shiftreg);
-}
-
-LogicVRegister Simulator::sshll(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src, int shift) {
-  DCHECK_GE(shift, 0);
-  SimVRegister temp1, temp2;
-  LogicVRegister shiftreg = dup_immediate(vform, temp1, shift);
-  LogicVRegister extendedreg = sxtl(vform, temp2, src);
-  return sshl(vform, dst, extendedreg, shiftreg);
-}
-
-LogicVRegister Simulator::sshll2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src, int shift) {
-  DCHECK_GE(shift, 0);
-  SimVRegister temp1, temp2;
-  LogicVRegister shiftreg = dup_immediate(vform, temp1, shift);
-  LogicVRegister extendedreg = sxtl2(vform, temp2, src);
-  return sshl(vform, dst, extendedreg, shiftreg);
-}
-
-LogicVRegister Simulator::shll(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src) {
-  int shift = LaneSizeInBitsFromFormat(vform) / 2;
-  return sshll(vform, dst, src, shift);
-}
-
-LogicVRegister Simulator::shll2(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src) {
-  int shift = LaneSizeInBitsFromFormat(vform) / 2;
-  return sshll2(vform, dst, src, shift);
-}
-
-LogicVRegister Simulator::ushll(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src, int shift) {
-  DCHECK_GE(shift, 0);
-  SimVRegister temp1, temp2;
-  LogicVRegister shiftreg = dup_immediate(vform, temp1, shift);
-  LogicVRegister extendedreg = uxtl(vform, temp2, src);
-  return ushl(vform, dst, extendedreg, shiftreg);
-}
-
-LogicVRegister Simulator::ushll2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src, int shift) {
-  DCHECK_GE(shift, 0);
-  SimVRegister temp1, temp2;
-  LogicVRegister shiftreg = dup_immediate(vform, temp1, shift);
-  LogicVRegister extendedreg = uxtl2(vform, temp2, src);
-  return ushl(vform, dst, extendedreg, shiftreg);
-}
-
-LogicVRegister Simulator::sli(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src, int shift) {
-  dst.ClearForWrite(vform);
-  int laneCount = LaneCountFromFormat(vform);
-  for (int i = 0; i < laneCount; i++) {
-    uint64_t src_lane = src.Uint(vform, i);
-    uint64_t dst_lane = dst.Uint(vform, i);
-    uint64_t shifted = src_lane << shift;
-    uint64_t mask = MaxUintFromFormat(vform) << shift;
-    dst.SetUint(vform, i, (dst_lane & ~mask) | shifted);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::sqshl(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src, int shift) {
-  DCHECK_GE(shift, 0);
-  SimVRegister temp;
-  LogicVRegister shiftreg = dup_immediate(vform, temp, shift);
-  return sshl(vform, dst, src, shiftreg).SignedSaturate(vform);
-}
-
-LogicVRegister Simulator::uqshl(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src, int shift) {
-  DCHECK_GE(shift, 0);
-  SimVRegister temp;
-  LogicVRegister shiftreg = dup_immediate(vform, temp, shift);
-  return ushl(vform, dst, src, shiftreg).UnsignedSaturate(vform);
-}
-
-LogicVRegister Simulator::sqshlu(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src, int shift) {
-  DCHECK_GE(shift, 0);
-  SimVRegister temp;
-  LogicVRegister shiftreg = dup_immediate(vform, temp, shift);
-  return sshl(vform, dst, src, shiftreg).UnsignedSaturate(vform);
-}
-
-LogicVRegister Simulator::sri(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src, int shift) {
-  dst.ClearForWrite(vform);
-  int laneCount = LaneCountFromFormat(vform);
-  DCHECK((shift > 0) &&
-         (shift <= static_cast<int>(LaneSizeInBitsFromFormat(vform))));
-  for (int i = 0; i < laneCount; i++) {
-    uint64_t src_lane = src.Uint(vform, i);
-    uint64_t dst_lane = dst.Uint(vform, i);
-    uint64_t shifted;
-    uint64_t mask;
-    if (shift == 64) {
-      shifted = 0;
-      mask = 0;
-    } else {
-      shifted = src_lane >> shift;
-      mask = MaxUintFromFormat(vform) >> shift;
-    }
-    dst.SetUint(vform, i, (dst_lane & ~mask) | shifted);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::ushr(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src, int shift) {
-  DCHECK_GE(shift, 0);
-  SimVRegister temp;
-  LogicVRegister shiftreg = dup_immediate(vform, temp, -shift);
-  return ushl(vform, dst, src, shiftreg);
-}
-
-LogicVRegister Simulator::sshr(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src, int shift) {
-  DCHECK_GE(shift, 0);
-  SimVRegister temp;
-  LogicVRegister shiftreg = dup_immediate(vform, temp, -shift);
-  return sshl(vform, dst, src, shiftreg);
-}
-
-LogicVRegister Simulator::ssra(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src, int shift) {
-  SimVRegister temp;
-  LogicVRegister shifted_reg = sshr(vform, temp, src, shift);
-  return add(vform, dst, dst, shifted_reg);
-}
-
-LogicVRegister Simulator::usra(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src, int shift) {
-  SimVRegister temp;
-  LogicVRegister shifted_reg = ushr(vform, temp, src, shift);
-  return add(vform, dst, dst, shifted_reg);
-}
-
-LogicVRegister Simulator::srsra(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src, int shift) {
-  SimVRegister temp;
-  LogicVRegister shifted_reg = sshr(vform, temp, src, shift).Round(vform);
-  return add(vform, dst, dst, shifted_reg);
-}
-
-LogicVRegister Simulator::ursra(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src, int shift) {
-  SimVRegister temp;
-  LogicVRegister shifted_reg = ushr(vform, temp, src, shift).Round(vform);
-  return add(vform, dst, dst, shifted_reg);
-}
-
-LogicVRegister Simulator::cls(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src) {
-  uint64_t result[16];
-  int laneSizeInBits = LaneSizeInBitsFromFormat(vform);
-  int laneCount = LaneCountFromFormat(vform);
-  for (int i = 0; i < laneCount; i++) {
-    result[i] = CountLeadingSignBits(src.Int(vform, i), laneSizeInBits);
-  }
-
-  dst.SetUintArray(vform, result);
-  return dst;
-}
-
-LogicVRegister Simulator::clz(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src) {
-  uint64_t result[16];
-  int laneSizeInBits = LaneSizeInBitsFromFormat(vform);
-  int laneCount = LaneCountFromFormat(vform);
-  for (int i = 0; i < laneCount; i++) {
-    result[i] = CountLeadingZeros(src.Uint(vform, i), laneSizeInBits);
-  }
-
-  dst.SetUintArray(vform, result);
-  return dst;
-}
-
-LogicVRegister Simulator::cnt(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src) {
-  uint64_t result[16];
-  int laneSizeInBits = LaneSizeInBitsFromFormat(vform);
-  int laneCount = LaneCountFromFormat(vform);
-  for (int i = 0; i < laneCount; i++) {
-    uint64_t value = src.Uint(vform, i);
-    result[i] = 0;
-    for (int j = 0; j < laneSizeInBits; j++) {
-      result[i] += (value & 1);
-      value >>= 1;
-    }
-  }
-
-  dst.SetUintArray(vform, result);
-  return dst;
-}
-
-LogicVRegister Simulator::sshl(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    int8_t shift_val = src2.Int(vform, i);
-    int64_t lj_src_val = src1.IntLeftJustified(vform, i);
-
-    // Set signed saturation state.
-    if ((shift_val > CountLeadingSignBits(lj_src_val, 64)) &&
-        (lj_src_val != 0)) {
-      dst.SetSignedSat(i, lj_src_val >= 0);
-    }
-
-    // Set unsigned saturation state.
-    if (lj_src_val < 0) {
-      dst.SetUnsignedSat(i, false);
-    } else if ((shift_val > CountLeadingZeros(lj_src_val, 64)) &&
-               (lj_src_val != 0)) {
-      dst.SetUnsignedSat(i, true);
-    }
-
-    int64_t src_val = src1.Int(vform, i);
-    bool src_is_negative = src_val < 0;
-    if (shift_val > 63) {
-      dst.SetInt(vform, i, 0);
-    } else if (shift_val < -63) {
-      dst.SetRounding(i, src_is_negative);
-      dst.SetInt(vform, i, src_is_negative ? -1 : 0);
-    } else {
-      // Use unsigned types for shifts, as behaviour is undefined for signed
-      // lhs.
-      uint64_t usrc_val = static_cast<uint64_t>(src_val);
-
-      if (shift_val < 0) {
-        // Convert to right shift.
-        shift_val = -shift_val;
-
-        // Set rounding state by testing most-significant bit shifted out.
-        // Rounding only needed on right shifts.
-        if (((usrc_val >> (shift_val - 1)) & 1) == 1) {
-          dst.SetRounding(i, true);
-        }
-
-        usrc_val >>= shift_val;
-
-        if (src_is_negative) {
-          // Simulate sign-extension.
-          usrc_val |= (~UINT64_C(0) << (64 - shift_val));
-        }
-      } else {
-        usrc_val <<= shift_val;
-      }
-      dst.SetUint(vform, i, usrc_val);
-    }
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::ushl(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    int8_t shift_val = src2.Int(vform, i);
-    uint64_t lj_src_val = src1.UintLeftJustified(vform, i);
-
-    // Set saturation state.
-    if ((shift_val > CountLeadingZeros(lj_src_val, 64)) && (lj_src_val != 0)) {
-      dst.SetUnsignedSat(i, true);
-    }
-
-    uint64_t src_val = src1.Uint(vform, i);
-    if ((shift_val > 63) || (shift_val < -64)) {
-      dst.SetUint(vform, i, 0);
-    } else {
-      if (shift_val < 0) {
-        // Set rounding state. Rounding only needed on right shifts.
-        if (((src_val >> (-shift_val - 1)) & 1) == 1) {
-          dst.SetRounding(i, true);
-        }
-
-        if (shift_val == -64) {
-          src_val = 0;
-        } else {
-          src_val >>= -shift_val;
-        }
-      } else {
-        src_val <<= shift_val;
-      }
-      dst.SetUint(vform, i, src_val);
-    }
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::neg(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    // Test for signed saturation.
-    int64_t sa = src.Int(vform, i);
-    if (sa == MinIntFromFormat(vform)) {
-      dst.SetSignedSat(i, true);
-    }
-    dst.SetInt(vform, i, (sa == INT64_MIN) ? sa : -sa);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::suqadd(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    int64_t sa = dst.IntLeftJustified(vform, i);
-    uint64_t ub = src.UintLeftJustified(vform, i);
-    uint64_t ur = sa + ub;
-
-    int64_t sr = bit_cast<int64_t>(ur);
-    if (sr < sa) {  // Test for signed positive saturation.
-      dst.SetInt(vform, i, MaxIntFromFormat(vform));
-    } else {
-      dst.SetUint(vform, i, dst.Int(vform, i) + src.Uint(vform, i));
-    }
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::usqadd(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    uint64_t ua = dst.UintLeftJustified(vform, i);
-    int64_t sb = src.IntLeftJustified(vform, i);
-    uint64_t ur = ua + sb;
-
-    if ((sb > 0) && (ur <= ua)) {
-      dst.SetUint(vform, i, MaxUintFromFormat(vform));  // Positive saturation.
-    } else if ((sb < 0) && (ur >= ua)) {
-      dst.SetUint(vform, i, 0);  // Negative saturation.
-    } else {
-      dst.SetUint(vform, i, dst.Uint(vform, i) + src.Int(vform, i));
-    }
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::abs(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    // Test for signed saturation.
-    int64_t sa = src.Int(vform, i);
-    if (sa == MinIntFromFormat(vform)) {
-      dst.SetSignedSat(i, true);
-    }
-    if (sa < 0) {
-      dst.SetInt(vform, i, (sa == INT64_MIN) ? sa : -sa);
-    } else {
-      dst.SetInt(vform, i, sa);
-    }
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::ExtractNarrow(VectorFormat dstform,
-                                        LogicVRegister dst, bool dstIsSigned,
-                                        const LogicVRegister& src,
-                                        bool srcIsSigned) {
-  bool upperhalf = false;
-  VectorFormat srcform = kFormatUndefined;
-  int64_t ssrc[8];
-  uint64_t usrc[8];
-
-  switch (dstform) {
-    case kFormat8B:
-      upperhalf = false;
-      srcform = kFormat8H;
-      break;
-    case kFormat16B:
-      upperhalf = true;
-      srcform = kFormat8H;
-      break;
-    case kFormat4H:
-      upperhalf = false;
-      srcform = kFormat4S;
-      break;
-    case kFormat8H:
-      upperhalf = true;
-      srcform = kFormat4S;
-      break;
-    case kFormat2S:
-      upperhalf = false;
-      srcform = kFormat2D;
-      break;
-    case kFormat4S:
-      upperhalf = true;
-      srcform = kFormat2D;
-      break;
-    case kFormatB:
-      upperhalf = false;
-      srcform = kFormatH;
-      break;
-    case kFormatH:
-      upperhalf = false;
-      srcform = kFormatS;
-      break;
-    case kFormatS:
-      upperhalf = false;
-      srcform = kFormatD;
-      break;
-    default:
-      UNIMPLEMENTED();
-  }
-
-  for (int i = 0; i < LaneCountFromFormat(srcform); i++) {
-    ssrc[i] = src.Int(srcform, i);
-    usrc[i] = src.Uint(srcform, i);
-  }
-
-  int offset;
-  if (upperhalf) {
-    offset = LaneCountFromFormat(dstform) / 2;
-  } else {
-    offset = 0;
-    dst.ClearForWrite(dstform);
-  }
-
-  for (int i = 0; i < LaneCountFromFormat(srcform); i++) {
-    // Test for signed saturation
-    if (ssrc[i] > MaxIntFromFormat(dstform)) {
-      dst.SetSignedSat(offset + i, true);
-    } else if (ssrc[i] < MinIntFromFormat(dstform)) {
-      dst.SetSignedSat(offset + i, false);
-    }
-
-    // Test for unsigned saturation
-    if (srcIsSigned) {
-      if (ssrc[i] > static_cast<int64_t>(MaxUintFromFormat(dstform))) {
-        dst.SetUnsignedSat(offset + i, true);
-      } else if (ssrc[i] < 0) {
-        dst.SetUnsignedSat(offset + i, false);
-      }
-    } else {
-      if (usrc[i] > MaxUintFromFormat(dstform)) {
-        dst.SetUnsignedSat(offset + i, true);
-      }
-    }
-
-    int64_t result;
-    if (srcIsSigned) {
-      result = ssrc[i] & MaxUintFromFormat(dstform);
-    } else {
-      result = usrc[i] & MaxUintFromFormat(dstform);
-    }
-
-    if (dstIsSigned) {
-      dst.SetInt(dstform, offset + i, result);
-    } else {
-      dst.SetUint(dstform, offset + i, result);
-    }
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::xtn(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src) {
-  return ExtractNarrow(vform, dst, true, src, true);
-}
-
-LogicVRegister Simulator::sqxtn(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src) {
-  return ExtractNarrow(vform, dst, true, src, true).SignedSaturate(vform);
-}
-
-LogicVRegister Simulator::sqxtun(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src) {
-  return ExtractNarrow(vform, dst, false, src, true).UnsignedSaturate(vform);
-}
-
-LogicVRegister Simulator::uqxtn(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src) {
-  return ExtractNarrow(vform, dst, false, src, false).UnsignedSaturate(vform);
-}
-
-LogicVRegister Simulator::AbsDiff(VectorFormat vform, LogicVRegister dst,
-                                  const LogicVRegister& src1,
-                                  const LogicVRegister& src2, bool issigned) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    if (issigned) {
-      int64_t sr = src1.Int(vform, i) - src2.Int(vform, i);
-      sr = sr > 0 ? sr : -sr;
-      dst.SetInt(vform, i, sr);
-    } else {
-      int64_t sr = src1.Uint(vform, i) - src2.Uint(vform, i);
-      sr = sr > 0 ? sr : -sr;
-      dst.SetUint(vform, i, sr);
-    }
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::saba(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2) {
-  SimVRegister temp;
-  dst.ClearForWrite(vform);
-  AbsDiff(vform, temp, src1, src2, true);
-  add(vform, dst, dst, temp);
-  return dst;
-}
-
-LogicVRegister Simulator::uaba(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2) {
-  SimVRegister temp;
-  dst.ClearForWrite(vform);
-  AbsDiff(vform, temp, src1, src2, false);
-  add(vform, dst, dst, temp);
-  return dst;
-}
-
-LogicVRegister Simulator::not_(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    dst.SetUint(vform, i, ~src.Uint(vform, i));
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::rbit(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src) {
-  uint64_t result[16];
-  int laneCount = LaneCountFromFormat(vform);
-  int laneSizeInBits = LaneSizeInBitsFromFormat(vform);
-  uint64_t reversed_value;
-  uint64_t value;
-  for (int i = 0; i < laneCount; i++) {
-    value = src.Uint(vform, i);
-    reversed_value = 0;
-    for (int j = 0; j < laneSizeInBits; j++) {
-      reversed_value = (reversed_value << 1) | (value & 1);
-      value >>= 1;
-    }
-    result[i] = reversed_value;
-  }
-
-  dst.SetUintArray(vform, result);
-  return dst;
-}
-
-LogicVRegister Simulator::rev(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src, int revSize) {
-  uint64_t result[16];
-  int laneCount = LaneCountFromFormat(vform);
-  int laneSize = LaneSizeInBytesFromFormat(vform);
-  int lanesPerLoop = revSize / laneSize;
-  for (int i = 0; i < laneCount; i += lanesPerLoop) {
-    for (int j = 0; j < lanesPerLoop; j++) {
-      result[i + lanesPerLoop - 1 - j] = src.Uint(vform, i + j);
-    }
-  }
-  dst.SetUintArray(vform, result);
-  return dst;
-}
-
-LogicVRegister Simulator::rev16(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src) {
-  return rev(vform, dst, src, 2);
-}
-
-LogicVRegister Simulator::rev32(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src) {
-  return rev(vform, dst, src, 4);
-}
-
-LogicVRegister Simulator::rev64(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src) {
-  return rev(vform, dst, src, 8);
-}
-
-LogicVRegister Simulator::addlp(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src, bool is_signed,
-                                bool do_accumulate) {
-  VectorFormat vformsrc = VectorFormatHalfWidthDoubleLanes(vform);
-  DCHECK_LE(LaneSizeInBitsFromFormat(vformsrc), 32U);
-  DCHECK_LE(LaneCountFromFormat(vform), 8);
-
-  uint64_t result[8];
-  int lane_count = LaneCountFromFormat(vform);
-  for (int i = 0; i < lane_count; i++) {
-    if (is_signed) {
-      result[i] = static_cast<uint64_t>(src.Int(vformsrc, 2 * i) +
-                                        src.Int(vformsrc, 2 * i + 1));
-    } else {
-      result[i] = src.Uint(vformsrc, 2 * i) + src.Uint(vformsrc, 2 * i + 1);
-    }
-  }
-
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < lane_count; ++i) {
-    if (do_accumulate) {
-      result[i] += dst.Uint(vform, i);
-    }
-    dst.SetUint(vform, i, result[i]);
-  }
-
-  return dst;
-}
-
-LogicVRegister Simulator::saddlp(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src) {
-  return addlp(vform, dst, src, true, false);
-}
-
-LogicVRegister Simulator::uaddlp(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src) {
-  return addlp(vform, dst, src, false, false);
-}
-
-LogicVRegister Simulator::sadalp(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src) {
-  return addlp(vform, dst, src, true, true);
-}
-
-LogicVRegister Simulator::uadalp(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src) {
-  return addlp(vform, dst, src, false, true);
-}
-
-LogicVRegister Simulator::ext(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src1,
-                              const LogicVRegister& src2, int index) {
-  uint8_t result[16];
-  int laneCount = LaneCountFromFormat(vform);
-  for (int i = 0; i < laneCount - index; ++i) {
-    result[i] = src1.Uint(vform, i + index);
-  }
-  for (int i = 0; i < index; ++i) {
-    result[laneCount - index + i] = src2.Uint(vform, i);
-  }
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < laneCount; ++i) {
-    dst.SetUint(vform, i, result[i]);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::dup_element(VectorFormat vform, LogicVRegister dst,
-                                      const LogicVRegister& src,
-                                      int src_index) {
-  int laneCount = LaneCountFromFormat(vform);
-  uint64_t value = src.Uint(vform, src_index);
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < laneCount; ++i) {
-    dst.SetUint(vform, i, value);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::dup_immediate(VectorFormat vform, LogicVRegister dst,
-                                        uint64_t imm) {
-  int laneCount = LaneCountFromFormat(vform);
-  uint64_t value = imm & MaxUintFromFormat(vform);
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < laneCount; ++i) {
-    dst.SetUint(vform, i, value);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::ins_element(VectorFormat vform, LogicVRegister dst,
-                                      int dst_index, const LogicVRegister& src,
-                                      int src_index) {
-  dst.SetUint(vform, dst_index, src.Uint(vform, src_index));
-  return dst;
-}
-
-LogicVRegister Simulator::ins_immediate(VectorFormat vform, LogicVRegister dst,
-                                        int dst_index, uint64_t imm) {
-  uint64_t value = imm & MaxUintFromFormat(vform);
-  dst.SetUint(vform, dst_index, value);
-  return dst;
-}
-
-LogicVRegister Simulator::movi(VectorFormat vform, LogicVRegister dst,
-                               uint64_t imm) {
-  int laneCount = LaneCountFromFormat(vform);
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < laneCount; ++i) {
-    dst.SetUint(vform, i, imm);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::mvni(VectorFormat vform, LogicVRegister dst,
-                               uint64_t imm) {
-  int laneCount = LaneCountFromFormat(vform);
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < laneCount; ++i) {
-    dst.SetUint(vform, i, ~imm);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::orr(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& src, uint64_t imm) {
-  uint64_t result[16];
-  int laneCount = LaneCountFromFormat(vform);
-  for (int i = 0; i < laneCount; ++i) {
-    result[i] = src.Uint(vform, i) | imm;
-  }
-  dst.SetUintArray(vform, result);
-  return dst;
-}
-
-LogicVRegister Simulator::uxtl(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src) {
-  VectorFormat vform_half = VectorFormatHalfWidth(vform);
-
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    dst.SetUint(vform, i, src.Uint(vform_half, i));
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::sxtl(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src) {
-  VectorFormat vform_half = VectorFormatHalfWidth(vform);
-
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    dst.SetInt(vform, i, src.Int(vform_half, i));
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::uxtl2(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src) {
-  VectorFormat vform_half = VectorFormatHalfWidth(vform);
-  int lane_count = LaneCountFromFormat(vform);
-
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < lane_count; i++) {
-    dst.SetUint(vform, i, src.Uint(vform_half, lane_count + i));
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::sxtl2(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src) {
-  VectorFormat vform_half = VectorFormatHalfWidth(vform);
-  int lane_count = LaneCountFromFormat(vform);
-
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < lane_count; i++) {
-    dst.SetInt(vform, i, src.Int(vform_half, lane_count + i));
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::shrn(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src, int shift) {
-  SimVRegister temp;
-  VectorFormat vform_src = VectorFormatDoubleWidth(vform);
-  VectorFormat vform_dst = vform;
-  LogicVRegister shifted_src = ushr(vform_src, temp, src, shift);
-  return ExtractNarrow(vform_dst, dst, false, shifted_src, false);
-}
-
-LogicVRegister Simulator::shrn2(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src, int shift) {
-  SimVRegister temp;
-  VectorFormat vformsrc = VectorFormatDoubleWidth(VectorFormatHalfLanes(vform));
-  VectorFormat vformdst = vform;
-  LogicVRegister shifted_src = ushr(vformsrc, temp, src, shift);
-  return ExtractNarrow(vformdst, dst, false, shifted_src, false);
-}
-
-LogicVRegister Simulator::rshrn(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src, int shift) {
-  SimVRegister temp;
-  VectorFormat vformsrc = VectorFormatDoubleWidth(vform);
-  VectorFormat vformdst = vform;
-  LogicVRegister shifted_src = ushr(vformsrc, temp, src, shift).Round(vformsrc);
-  return ExtractNarrow(vformdst, dst, false, shifted_src, false);
-}
-
-LogicVRegister Simulator::rshrn2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src, int shift) {
-  SimVRegister temp;
-  VectorFormat vformsrc = VectorFormatDoubleWidth(VectorFormatHalfLanes(vform));
-  VectorFormat vformdst = vform;
-  LogicVRegister shifted_src = ushr(vformsrc, temp, src, shift).Round(vformsrc);
-  return ExtractNarrow(vformdst, dst, false, shifted_src, false);
-}
-
-LogicVRegister Simulator::Table(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& ind,
-                                bool zero_out_of_bounds,
-                                const LogicVRegister* tab1,
-                                const LogicVRegister* tab2,
-                                const LogicVRegister* tab3,
-                                const LogicVRegister* tab4) {
-  DCHECK_NOT_NULL(tab1);
-  const LogicVRegister* tab[4] = {tab1, tab2, tab3, tab4};
-  uint64_t result[kMaxLanesPerVector];
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    result[i] = zero_out_of_bounds ? 0 : dst.Uint(kFormat16B, i);
-  }
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    uint64_t j = ind.Uint(vform, i);
-    int tab_idx = static_cast<int>(j >> 4);
-    int j_idx = static_cast<int>(j & 15);
-    if ((tab_idx < 4) && (tab[tab_idx] != nullptr)) {
-      result[i] = tab[tab_idx]->Uint(kFormat16B, j_idx);
-    }
-  }
-  dst.SetUintArray(vform, result);
-  return dst;
-}
-
-LogicVRegister Simulator::tbl(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& tab,
-                              const LogicVRegister& ind) {
-  return Table(vform, dst, ind, true, &tab);
-}
-
-LogicVRegister Simulator::tbl(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& tab,
-                              const LogicVRegister& tab2,
-                              const LogicVRegister& ind) {
-  return Table(vform, dst, ind, true, &tab, &tab2);
-}
-
-LogicVRegister Simulator::tbl(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& tab,
-                              const LogicVRegister& tab2,
-                              const LogicVRegister& tab3,
-                              const LogicVRegister& ind) {
-  return Table(vform, dst, ind, true, &tab, &tab2, &tab3);
-}
-
-LogicVRegister Simulator::tbl(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& tab,
-                              const LogicVRegister& tab2,
-                              const LogicVRegister& tab3,
-                              const LogicVRegister& tab4,
-                              const LogicVRegister& ind) {
-  return Table(vform, dst, ind, true, &tab, &tab2, &tab3, &tab4);
-}
-
-LogicVRegister Simulator::tbx(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& tab,
-                              const LogicVRegister& ind) {
-  return Table(vform, dst, ind, false, &tab);
-}
-
-LogicVRegister Simulator::tbx(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& tab,
-                              const LogicVRegister& tab2,
-                              const LogicVRegister& ind) {
-  return Table(vform, dst, ind, false, &tab, &tab2);
-}
-
-LogicVRegister Simulator::tbx(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& tab,
-                              const LogicVRegister& tab2,
-                              const LogicVRegister& tab3,
-                              const LogicVRegister& ind) {
-  return Table(vform, dst, ind, false, &tab, &tab2, &tab3);
-}
-
-LogicVRegister Simulator::tbx(VectorFormat vform, LogicVRegister dst,
-                              const LogicVRegister& tab,
-                              const LogicVRegister& tab2,
-                              const LogicVRegister& tab3,
-                              const LogicVRegister& tab4,
-                              const LogicVRegister& ind) {
-  return Table(vform, dst, ind, false, &tab, &tab2, &tab3, &tab4);
-}
-
-LogicVRegister Simulator::uqshrn(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src, int shift) {
-  return shrn(vform, dst, src, shift).UnsignedSaturate(vform);
-}
-
-LogicVRegister Simulator::uqshrn2(VectorFormat vform, LogicVRegister dst,
-                                  const LogicVRegister& src, int shift) {
-  return shrn2(vform, dst, src, shift).UnsignedSaturate(vform);
-}
-
-LogicVRegister Simulator::uqrshrn(VectorFormat vform, LogicVRegister dst,
-                                  const LogicVRegister& src, int shift) {
-  return rshrn(vform, dst, src, shift).UnsignedSaturate(vform);
-}
-
-LogicVRegister Simulator::uqrshrn2(VectorFormat vform, LogicVRegister dst,
-                                   const LogicVRegister& src, int shift) {
-  return rshrn2(vform, dst, src, shift).UnsignedSaturate(vform);
-}
-
-LogicVRegister Simulator::sqshrn(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src, int shift) {
-  SimVRegister temp;
-  VectorFormat vformsrc = VectorFormatDoubleWidth(vform);
-  VectorFormat vformdst = vform;
-  LogicVRegister shifted_src = sshr(vformsrc, temp, src, shift);
-  return sqxtn(vformdst, dst, shifted_src);
-}
-
-LogicVRegister Simulator::sqshrn2(VectorFormat vform, LogicVRegister dst,
-                                  const LogicVRegister& src, int shift) {
-  SimVRegister temp;
-  VectorFormat vformsrc = VectorFormatDoubleWidth(VectorFormatHalfLanes(vform));
-  VectorFormat vformdst = vform;
-  LogicVRegister shifted_src = sshr(vformsrc, temp, src, shift);
-  return sqxtn(vformdst, dst, shifted_src);
-}
-
-LogicVRegister Simulator::sqrshrn(VectorFormat vform, LogicVRegister dst,
-                                  const LogicVRegister& src, int shift) {
-  SimVRegister temp;
-  VectorFormat vformsrc = VectorFormatDoubleWidth(vform);
-  VectorFormat vformdst = vform;
-  LogicVRegister shifted_src = sshr(vformsrc, temp, src, shift).Round(vformsrc);
-  return sqxtn(vformdst, dst, shifted_src);
-}
-
-LogicVRegister Simulator::sqrshrn2(VectorFormat vform, LogicVRegister dst,
-                                   const LogicVRegister& src, int shift) {
-  SimVRegister temp;
-  VectorFormat vformsrc = VectorFormatDoubleWidth(VectorFormatHalfLanes(vform));
-  VectorFormat vformdst = vform;
-  LogicVRegister shifted_src = sshr(vformsrc, temp, src, shift).Round(vformsrc);
-  return sqxtn(vformdst, dst, shifted_src);
-}
-
-LogicVRegister Simulator::sqshrun(VectorFormat vform, LogicVRegister dst,
-                                  const LogicVRegister& src, int shift) {
-  SimVRegister temp;
-  VectorFormat vformsrc = VectorFormatDoubleWidth(vform);
-  VectorFormat vformdst = vform;
-  LogicVRegister shifted_src = sshr(vformsrc, temp, src, shift);
-  return sqxtun(vformdst, dst, shifted_src);
-}
-
-LogicVRegister Simulator::sqshrun2(VectorFormat vform, LogicVRegister dst,
-                                   const LogicVRegister& src, int shift) {
-  SimVRegister temp;
-  VectorFormat vformsrc = VectorFormatDoubleWidth(VectorFormatHalfLanes(vform));
-  VectorFormat vformdst = vform;
-  LogicVRegister shifted_src = sshr(vformsrc, temp, src, shift);
-  return sqxtun(vformdst, dst, shifted_src);
-}
-
-LogicVRegister Simulator::sqrshrun(VectorFormat vform, LogicVRegister dst,
-                                   const LogicVRegister& src, int shift) {
-  SimVRegister temp;
-  VectorFormat vformsrc = VectorFormatDoubleWidth(vform);
-  VectorFormat vformdst = vform;
-  LogicVRegister shifted_src = sshr(vformsrc, temp, src, shift).Round(vformsrc);
-  return sqxtun(vformdst, dst, shifted_src);
-}
-
-LogicVRegister Simulator::sqrshrun2(VectorFormat vform, LogicVRegister dst,
-                                    const LogicVRegister& src, int shift) {
-  SimVRegister temp;
-  VectorFormat vformsrc = VectorFormatDoubleWidth(VectorFormatHalfLanes(vform));
-  VectorFormat vformdst = vform;
-  LogicVRegister shifted_src = sshr(vformsrc, temp, src, shift).Round(vformsrc);
-  return sqxtun(vformdst, dst, shifted_src);
-}
-
-LogicVRegister Simulator::uaddl(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  uxtl(vform, temp1, src1);
-  uxtl(vform, temp2, src2);
-  add(vform, dst, temp1, temp2);
-  return dst;
-}
-
-LogicVRegister Simulator::uaddl2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  uxtl2(vform, temp1, src1);
-  uxtl2(vform, temp2, src2);
-  add(vform, dst, temp1, temp2);
-  return dst;
-}
-
-LogicVRegister Simulator::uaddw(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2) {
-  SimVRegister temp;
-  uxtl(vform, temp, src2);
-  add(vform, dst, src1, temp);
-  return dst;
-}
-
-LogicVRegister Simulator::uaddw2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2) {
-  SimVRegister temp;
-  uxtl2(vform, temp, src2);
-  add(vform, dst, src1, temp);
-  return dst;
-}
-
-LogicVRegister Simulator::saddl(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  sxtl(vform, temp1, src1);
-  sxtl(vform, temp2, src2);
-  add(vform, dst, temp1, temp2);
-  return dst;
-}
-
-LogicVRegister Simulator::saddl2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  sxtl2(vform, temp1, src1);
-  sxtl2(vform, temp2, src2);
-  add(vform, dst, temp1, temp2);
-  return dst;
-}
-
-LogicVRegister Simulator::saddw(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2) {
-  SimVRegister temp;
-  sxtl(vform, temp, src2);
-  add(vform, dst, src1, temp);
-  return dst;
-}
-
-LogicVRegister Simulator::saddw2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2) {
-  SimVRegister temp;
-  sxtl2(vform, temp, src2);
-  add(vform, dst, src1, temp);
-  return dst;
-}
-
-LogicVRegister Simulator::usubl(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  uxtl(vform, temp1, src1);
-  uxtl(vform, temp2, src2);
-  sub(vform, dst, temp1, temp2);
-  return dst;
-}
-
-LogicVRegister Simulator::usubl2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  uxtl2(vform, temp1, src1);
-  uxtl2(vform, temp2, src2);
-  sub(vform, dst, temp1, temp2);
-  return dst;
-}
-
-LogicVRegister Simulator::usubw(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2) {
-  SimVRegister temp;
-  uxtl(vform, temp, src2);
-  sub(vform, dst, src1, temp);
-  return dst;
-}
-
-LogicVRegister Simulator::usubw2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2) {
-  SimVRegister temp;
-  uxtl2(vform, temp, src2);
-  sub(vform, dst, src1, temp);
-  return dst;
-}
-
-LogicVRegister Simulator::ssubl(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  sxtl(vform, temp1, src1);
-  sxtl(vform, temp2, src2);
-  sub(vform, dst, temp1, temp2);
-  return dst;
-}
-
-LogicVRegister Simulator::ssubl2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  sxtl2(vform, temp1, src1);
-  sxtl2(vform, temp2, src2);
-  sub(vform, dst, temp1, temp2);
-  return dst;
-}
-
-LogicVRegister Simulator::ssubw(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2) {
-  SimVRegister temp;
-  sxtl(vform, temp, src2);
-  sub(vform, dst, src1, temp);
-  return dst;
-}
-
-LogicVRegister Simulator::ssubw2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2) {
-  SimVRegister temp;
-  sxtl2(vform, temp, src2);
-  sub(vform, dst, src1, temp);
-  return dst;
-}
-
-LogicVRegister Simulator::uabal(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  uxtl(vform, temp1, src1);
-  uxtl(vform, temp2, src2);
-  uaba(vform, dst, temp1, temp2);
-  return dst;
-}
-
-LogicVRegister Simulator::uabal2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  uxtl2(vform, temp1, src1);
-  uxtl2(vform, temp2, src2);
-  uaba(vform, dst, temp1, temp2);
-  return dst;
-}
-
-LogicVRegister Simulator::sabal(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  sxtl(vform, temp1, src1);
-  sxtl(vform, temp2, src2);
-  saba(vform, dst, temp1, temp2);
-  return dst;
-}
-
-LogicVRegister Simulator::sabal2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  sxtl2(vform, temp1, src1);
-  sxtl2(vform, temp2, src2);
-  saba(vform, dst, temp1, temp2);
-  return dst;
-}
-
-LogicVRegister Simulator::uabdl(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  uxtl(vform, temp1, src1);
-  uxtl(vform, temp2, src2);
-  AbsDiff(vform, dst, temp1, temp2, false);
-  return dst;
-}
-
-LogicVRegister Simulator::uabdl2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  uxtl2(vform, temp1, src1);
-  uxtl2(vform, temp2, src2);
-  AbsDiff(vform, dst, temp1, temp2, false);
-  return dst;
-}
-
-LogicVRegister Simulator::sabdl(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  sxtl(vform, temp1, src1);
-  sxtl(vform, temp2, src2);
-  AbsDiff(vform, dst, temp1, temp2, true);
-  return dst;
-}
-
-LogicVRegister Simulator::sabdl2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  sxtl2(vform, temp1, src1);
-  sxtl2(vform, temp2, src2);
-  AbsDiff(vform, dst, temp1, temp2, true);
-  return dst;
-}
-
-LogicVRegister Simulator::umull(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  uxtl(vform, temp1, src1);
-  uxtl(vform, temp2, src2);
-  mul(vform, dst, temp1, temp2);
-  return dst;
-}
-
-LogicVRegister Simulator::umull2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  uxtl2(vform, temp1, src1);
-  uxtl2(vform, temp2, src2);
-  mul(vform, dst, temp1, temp2);
-  return dst;
-}
-
-LogicVRegister Simulator::smull(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  sxtl(vform, temp1, src1);
-  sxtl(vform, temp2, src2);
-  mul(vform, dst, temp1, temp2);
-  return dst;
-}
-
-LogicVRegister Simulator::smull2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  sxtl2(vform, temp1, src1);
-  sxtl2(vform, temp2, src2);
-  mul(vform, dst, temp1, temp2);
-  return dst;
-}
-
-LogicVRegister Simulator::umlsl(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  uxtl(vform, temp1, src1);
-  uxtl(vform, temp2, src2);
-  mls(vform, dst, temp1, temp2);
-  return dst;
-}
-
-LogicVRegister Simulator::umlsl2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  uxtl2(vform, temp1, src1);
-  uxtl2(vform, temp2, src2);
-  mls(vform, dst, temp1, temp2);
-  return dst;
-}
-
-LogicVRegister Simulator::smlsl(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  sxtl(vform, temp1, src1);
-  sxtl(vform, temp2, src2);
-  mls(vform, dst, temp1, temp2);
-  return dst;
-}
-
-LogicVRegister Simulator::smlsl2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  sxtl2(vform, temp1, src1);
-  sxtl2(vform, temp2, src2);
-  mls(vform, dst, temp1, temp2);
-  return dst;
-}
-
-LogicVRegister Simulator::umlal(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  uxtl(vform, temp1, src1);
-  uxtl(vform, temp2, src2);
-  mla(vform, dst, temp1, temp2);
-  return dst;
-}
-
-LogicVRegister Simulator::umlal2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  uxtl2(vform, temp1, src1);
-  uxtl2(vform, temp2, src2);
-  mla(vform, dst, temp1, temp2);
-  return dst;
-}
-
-LogicVRegister Simulator::smlal(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  sxtl(vform, temp1, src1);
-  sxtl(vform, temp2, src2);
-  mla(vform, dst, temp1, temp2);
-  return dst;
-}
-
-LogicVRegister Simulator::smlal2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2) {
-  SimVRegister temp1, temp2;
-  sxtl2(vform, temp1, src1);
-  sxtl2(vform, temp2, src2);
-  mla(vform, dst, temp1, temp2);
-  return dst;
-}
-
-LogicVRegister Simulator::sqdmlal(VectorFormat vform, LogicVRegister dst,
-                                  const LogicVRegister& src1,
-                                  const LogicVRegister& src2) {
-  SimVRegister temp;
-  LogicVRegister product = sqdmull(vform, temp, src1, src2);
-  return add(vform, dst, dst, product).SignedSaturate(vform);
-}
-
-LogicVRegister Simulator::sqdmlal2(VectorFormat vform, LogicVRegister dst,
-                                   const LogicVRegister& src1,
-                                   const LogicVRegister& src2) {
-  SimVRegister temp;
-  LogicVRegister product = sqdmull2(vform, temp, src1, src2);
-  return add(vform, dst, dst, product).SignedSaturate(vform);
-}
-
-LogicVRegister Simulator::sqdmlsl(VectorFormat vform, LogicVRegister dst,
-                                  const LogicVRegister& src1,
-                                  const LogicVRegister& src2) {
-  SimVRegister temp;
-  LogicVRegister product = sqdmull(vform, temp, src1, src2);
-  return sub(vform, dst, dst, product).SignedSaturate(vform);
-}
-
-LogicVRegister Simulator::sqdmlsl2(VectorFormat vform, LogicVRegister dst,
-                                   const LogicVRegister& src1,
-                                   const LogicVRegister& src2) {
-  SimVRegister temp;
-  LogicVRegister product = sqdmull2(vform, temp, src1, src2);
-  return sub(vform, dst, dst, product).SignedSaturate(vform);
-}
-
-LogicVRegister Simulator::sqdmull(VectorFormat vform, LogicVRegister dst,
-                                  const LogicVRegister& src1,
-                                  const LogicVRegister& src2) {
-  SimVRegister temp;
-  LogicVRegister product = smull(vform, temp, src1, src2);
-  return add(vform, dst, product, product).SignedSaturate(vform);
-}
-
-LogicVRegister Simulator::sqdmull2(VectorFormat vform, LogicVRegister dst,
-                                   const LogicVRegister& src1,
-                                   const LogicVRegister& src2) {
-  SimVRegister temp;
-  LogicVRegister product = smull2(vform, temp, src1, src2);
-  return add(vform, dst, product, product).SignedSaturate(vform);
-}
-
-LogicVRegister Simulator::sqrdmulh(VectorFormat vform, LogicVRegister dst,
-                                   const LogicVRegister& src1,
-                                   const LogicVRegister& src2, bool round) {
-  // 2 * INT_32_MIN * INT_32_MIN causes int64_t to overflow.
-  // To avoid this, we use (src1 * src2 + 1 << (esize - 2)) >> (esize - 1)
-  // which is same as (2 * src1 * src2 + 1 << (esize - 1)) >> esize.
-
-  int esize = LaneSizeInBitsFromFormat(vform);
-  int round_const = round ? (1 << (esize - 2)) : 0;
-  int64_t product;
-
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    product = src1.Int(vform, i) * src2.Int(vform, i);
-    product += round_const;
-    product = product >> (esize - 1);
-
-    if (product > MaxIntFromFormat(vform)) {
-      product = MaxIntFromFormat(vform);
-    } else if (product < MinIntFromFormat(vform)) {
-      product = MinIntFromFormat(vform);
-    }
-    dst.SetInt(vform, i, product);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::sqdmulh(VectorFormat vform, LogicVRegister dst,
-                                  const LogicVRegister& src1,
-                                  const LogicVRegister& src2) {
-  return sqrdmulh(vform, dst, src1, src2, false);
-}
-
-LogicVRegister Simulator::addhn(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2) {
-  SimVRegister temp;
-  add(VectorFormatDoubleWidth(vform), temp, src1, src2);
-  shrn(vform, dst, temp, LaneSizeInBitsFromFormat(vform));
-  return dst;
-}
-
-LogicVRegister Simulator::addhn2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2) {
-  SimVRegister temp;
-  add(VectorFormatDoubleWidth(VectorFormatHalfLanes(vform)), temp, src1, src2);
-  shrn2(vform, dst, temp, LaneSizeInBitsFromFormat(vform));
-  return dst;
-}
-
-LogicVRegister Simulator::raddhn(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2) {
-  SimVRegister temp;
-  add(VectorFormatDoubleWidth(vform), temp, src1, src2);
-  rshrn(vform, dst, temp, LaneSizeInBitsFromFormat(vform));
-  return dst;
-}
-
-LogicVRegister Simulator::raddhn2(VectorFormat vform, LogicVRegister dst,
-                                  const LogicVRegister& src1,
-                                  const LogicVRegister& src2) {
-  SimVRegister temp;
-  add(VectorFormatDoubleWidth(VectorFormatHalfLanes(vform)), temp, src1, src2);
-  rshrn2(vform, dst, temp, LaneSizeInBitsFromFormat(vform));
-  return dst;
-}
-
-LogicVRegister Simulator::subhn(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2) {
-  SimVRegister temp;
-  sub(VectorFormatDoubleWidth(vform), temp, src1, src2);
-  shrn(vform, dst, temp, LaneSizeInBitsFromFormat(vform));
-  return dst;
-}
-
-LogicVRegister Simulator::subhn2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2) {
-  SimVRegister temp;
-  sub(VectorFormatDoubleWidth(VectorFormatHalfLanes(vform)), temp, src1, src2);
-  shrn2(vform, dst, temp, LaneSizeInBitsFromFormat(vform));
-  return dst;
-}
-
-LogicVRegister Simulator::rsubhn(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2) {
-  SimVRegister temp;
-  sub(VectorFormatDoubleWidth(vform), temp, src1, src2);
-  rshrn(vform, dst, temp, LaneSizeInBitsFromFormat(vform));
-  return dst;
-}
-
-LogicVRegister Simulator::rsubhn2(VectorFormat vform, LogicVRegister dst,
-                                  const LogicVRegister& src1,
-                                  const LogicVRegister& src2) {
-  SimVRegister temp;
-  sub(VectorFormatDoubleWidth(VectorFormatHalfLanes(vform)), temp, src1, src2);
-  rshrn2(vform, dst, temp, LaneSizeInBitsFromFormat(vform));
-  return dst;
-}
-
-LogicVRegister Simulator::trn1(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2) {
-  uint64_t result[16];
-  int laneCount = LaneCountFromFormat(vform);
-  int pairs = laneCount / 2;
-  for (int i = 0; i < pairs; ++i) {
-    result[2 * i] = src1.Uint(vform, 2 * i);
-    result[(2 * i) + 1] = src2.Uint(vform, 2 * i);
-  }
-
-  dst.SetUintArray(vform, result);
-  return dst;
-}
-
-LogicVRegister Simulator::trn2(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2) {
-  uint64_t result[16];
-  int laneCount = LaneCountFromFormat(vform);
-  int pairs = laneCount / 2;
-  for (int i = 0; i < pairs; ++i) {
-    result[2 * i] = src1.Uint(vform, (2 * i) + 1);
-    result[(2 * i) + 1] = src2.Uint(vform, (2 * i) + 1);
-  }
-
-  dst.SetUintArray(vform, result);
-  return dst;
-}
-
-LogicVRegister Simulator::zip1(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2) {
-  uint64_t result[16];
-  int laneCount = LaneCountFromFormat(vform);
-  int pairs = laneCount / 2;
-  for (int i = 0; i < pairs; ++i) {
-    result[2 * i] = src1.Uint(vform, i);
-    result[(2 * i) + 1] = src2.Uint(vform, i);
-  }
-
-  dst.SetUintArray(vform, result);
-  return dst;
-}
-
-LogicVRegister Simulator::zip2(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2) {
-  uint64_t result[16];
-  int laneCount = LaneCountFromFormat(vform);
-  int pairs = laneCount / 2;
-  for (int i = 0; i < pairs; ++i) {
-    result[2 * i] = src1.Uint(vform, pairs + i);
-    result[(2 * i) + 1] = src2.Uint(vform, pairs + i);
-  }
-
-  dst.SetUintArray(vform, result);
-  return dst;
-}
-
-LogicVRegister Simulator::uzp1(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2) {
-  uint64_t result[32];
-  int laneCount = LaneCountFromFormat(vform);
-  for (int i = 0; i < laneCount; ++i) {
-    result[i] = src1.Uint(vform, i);
-    result[laneCount + i] = src2.Uint(vform, i);
-  }
-
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < laneCount; ++i) {
-    dst.SetUint(vform, i, result[2 * i]);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::uzp2(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2) {
-  uint64_t result[32];
-  int laneCount = LaneCountFromFormat(vform);
-  for (int i = 0; i < laneCount; ++i) {
-    result[i] = src1.Uint(vform, i);
-    result[laneCount + i] = src2.Uint(vform, i);
-  }
-
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < laneCount; ++i) {
-    dst.SetUint(vform, i, result[(2 * i) + 1]);
-  }
-  return dst;
-}
-
-template <typename T>
-T Simulator::FPAdd(T op1, T op2) {
-  T result = FPProcessNaNs(op1, op2);
-  if (std::isnan(result)) return result;
-
-  if (std::isinf(op1) && std::isinf(op2) && (op1 != op2)) {
-    // inf + -inf returns the default NaN.
-    FPProcessException();
-    return FPDefaultNaN<T>();
-  } else {
-    // Other cases should be handled by standard arithmetic.
-    return op1 + op2;
-  }
-}
-
-template <typename T>
-T Simulator::FPSub(T op1, T op2) {
-  // NaNs should be handled elsewhere.
-  DCHECK(!std::isnan(op1) && !std::isnan(op2));
-
-  if (std::isinf(op1) && std::isinf(op2) && (op1 == op2)) {
-    // inf - inf returns the default NaN.
-    FPProcessException();
-    return FPDefaultNaN<T>();
-  } else {
-    // Other cases should be handled by standard arithmetic.
-    return op1 - op2;
-  }
-}
-
-template <typename T>
-T Simulator::FPMul(T op1, T op2) {
-  // NaNs should be handled elsewhere.
-  DCHECK(!std::isnan(op1) && !std::isnan(op2));
-
-  if ((std::isinf(op1) && (op2 == 0.0)) || (std::isinf(op2) && (op1 == 0.0))) {
-    // inf * 0.0 returns the default NaN.
-    FPProcessException();
-    return FPDefaultNaN<T>();
-  } else {
-    // Other cases should be handled by standard arithmetic.
-    return op1 * op2;
-  }
-}
-
-template <typename T>
-T Simulator::FPMulx(T op1, T op2) {
-  if ((std::isinf(op1) && (op2 == 0.0)) || (std::isinf(op2) && (op1 == 0.0))) {
-    // inf * 0.0 returns +/-2.0.
-    T two = 2.0;
-    return copysign(1.0, op1) * copysign(1.0, op2) * two;
-  }
-  return FPMul(op1, op2);
-}
-
-template <typename T>
-T Simulator::FPMulAdd(T a, T op1, T op2) {
-  T result = FPProcessNaNs3(a, op1, op2);
-
-  T sign_a = copysign(1.0, a);
-  T sign_prod = copysign(1.0, op1) * copysign(1.0, op2);
-  bool isinf_prod = std::isinf(op1) || std::isinf(op2);
-  bool operation_generates_nan =
-      (std::isinf(op1) && (op2 == 0.0)) ||                     // inf * 0.0
-      (std::isinf(op2) && (op1 == 0.0)) ||                     // 0.0 * inf
-      (std::isinf(a) && isinf_prod && (sign_a != sign_prod));  // inf - inf
-
-  if (std::isnan(result)) {
-    // Generated NaNs override quiet NaNs propagated from a.
-    if (operation_generates_nan && IsQuietNaN(a)) {
-      FPProcessException();
-      return FPDefaultNaN<T>();
-    } else {
-      return result;
-    }
-  }
-
-  // If the operation would produce a NaN, return the default NaN.
-  if (operation_generates_nan) {
-    FPProcessException();
-    return FPDefaultNaN<T>();
-  }
-
-  // Work around broken fma implementations for exact zero results: The sign of
-  // exact 0.0 results is positive unless both a and op1 * op2 are negative.
-  if (((op1 == 0.0) || (op2 == 0.0)) && (a == 0.0)) {
-    return ((sign_a < 0) && (sign_prod < 0)) ? -0.0 : 0.0;
-  }
-
-  result = FusedMultiplyAdd(op1, op2, a);
-  DCHECK(!std::isnan(result));
-
-  // Work around broken fma implementations for rounded zero results: If a is
-  // 0.0, the sign of the result is the sign of op1 * op2 before rounding.
-  if ((a == 0.0) && (result == 0.0)) {
-    return copysign(0.0, sign_prod);
-  }
-
-  return result;
-}
-
-template <typename T>
-T Simulator::FPDiv(T op1, T op2) {
-  // NaNs should be handled elsewhere.
-  DCHECK(!std::isnan(op1) && !std::isnan(op2));
-
-  if ((std::isinf(op1) && std::isinf(op2)) || ((op1 == 0.0) && (op2 == 0.0))) {
-    // inf / inf and 0.0 / 0.0 return the default NaN.
-    FPProcessException();
-    return FPDefaultNaN<T>();
-  } else {
-    if (op2 == 0.0) {
-      FPProcessException();
-      if (!std::isnan(op1)) {
-        double op1_sign = copysign(1.0, op1);
-        double op2_sign = copysign(1.0, op2);
-        return static_cast<T>(op1_sign * op2_sign * kFP64PositiveInfinity);
-      }
-    }
-
-    // Other cases should be handled by standard arithmetic.
-    return op1 / op2;
-  }
-}
-
-template <typename T>
-T Simulator::FPSqrt(T op) {
-  if (std::isnan(op)) {
-    return FPProcessNaN(op);
-  } else if (op < 0.0) {
-    FPProcessException();
-    return FPDefaultNaN<T>();
-  } else {
-    return sqrt(op);
-  }
-}
-
-template <typename T>
-T Simulator::FPMax(T a, T b) {
-  T result = FPProcessNaNs(a, b);
-  if (std::isnan(result)) return result;
-
-  if ((a == 0.0) && (b == 0.0) && (copysign(1.0, a) != copysign(1.0, b))) {
-    // a and b are zero, and the sign differs: return +0.0.
-    return 0.0;
-  } else {
-    return (a > b) ? a : b;
-  }
-}
-
-template <typename T>
-T Simulator::FPMaxNM(T a, T b) {
-  if (IsQuietNaN(a) && !IsQuietNaN(b)) {
-    a = kFP64NegativeInfinity;
-  } else if (!IsQuietNaN(a) && IsQuietNaN(b)) {
-    b = kFP64NegativeInfinity;
-  }
-
-  T result = FPProcessNaNs(a, b);
-  return std::isnan(result) ? result : FPMax(a, b);
-}
-
-template <typename T>
-T Simulator::FPMin(T a, T b) {
-  T result = FPProcessNaNs(a, b);
-  if (std::isnan(result)) return result;
-
-  if ((a == 0.0) && (b == 0.0) && (copysign(1.0, a) != copysign(1.0, b))) {
-    // a and b are zero, and the sign differs: return -0.0.
-    return -0.0;
-  } else {
-    return (a < b) ? a : b;
-  }
-}
-
-template <typename T>
-T Simulator::FPMinNM(T a, T b) {
-  if (IsQuietNaN(a) && !IsQuietNaN(b)) {
-    a = kFP64PositiveInfinity;
-  } else if (!IsQuietNaN(a) && IsQuietNaN(b)) {
-    b = kFP64PositiveInfinity;
-  }
-
-  T result = FPProcessNaNs(a, b);
-  return std::isnan(result) ? result : FPMin(a, b);
-}
-
-template <typename T>
-T Simulator::FPRecipStepFused(T op1, T op2) {
-  const T two = 2.0;
-  if ((std::isinf(op1) && (op2 == 0.0)) ||
-      ((op1 == 0.0) && (std::isinf(op2)))) {
-    return two;
-  } else if (std::isinf(op1) || std::isinf(op2)) {
-    // Return +inf if signs match, otherwise -inf.
-    return ((op1 >= 0.0) == (op2 >= 0.0)) ? kFP64PositiveInfinity
-                                          : kFP64NegativeInfinity;
-  } else {
-    return FusedMultiplyAdd(op1, op2, two);
-  }
-}
-
-template <typename T>
-T Simulator::FPRSqrtStepFused(T op1, T op2) {
-  const T one_point_five = 1.5;
-  const T two = 2.0;
-
-  if ((std::isinf(op1) && (op2 == 0.0)) ||
-      ((op1 == 0.0) && (std::isinf(op2)))) {
-    return one_point_five;
-  } else if (std::isinf(op1) || std::isinf(op2)) {
-    // Return +inf if signs match, otherwise -inf.
-    return ((op1 >= 0.0) == (op2 >= 0.0)) ? kFP64PositiveInfinity
-                                          : kFP64NegativeInfinity;
-  } else {
-    // The multiply-add-halve operation must be fully fused, so avoid interim
-    // rounding by checking which operand can be losslessly divided by two
-    // before doing the multiply-add.
-    if (std::isnormal(op1 / two)) {
-      return FusedMultiplyAdd(op1 / two, op2, one_point_five);
-    } else if (std::isnormal(op2 / two)) {
-      return FusedMultiplyAdd(op1, op2 / two, one_point_five);
-    } else {
-      // Neither operand is normal after halving: the result is dominated by
-      // the addition term, so just return that.
-      return one_point_five;
-    }
-  }
-}
-
-double Simulator::FPRoundInt(double value, FPRounding round_mode) {
-  if ((value == 0.0) || (value == kFP64PositiveInfinity) ||
-      (value == kFP64NegativeInfinity)) {
-    return value;
-  } else if (std::isnan(value)) {
-    return FPProcessNaN(value);
-  }
-
-  double int_result = std::floor(value);
-  double error = value - int_result;
-  switch (round_mode) {
-    case FPTieAway: {
-      // Take care of correctly handling the range ]-0.5, -0.0], which must
-      // yield -0.0.
-      if ((-0.5 < value) && (value < 0.0)) {
-        int_result = -0.0;
-
-      } else if ((error > 0.5) || ((error == 0.5) && (int_result >= 0.0))) {
-        // If the error is greater than 0.5, or is equal to 0.5 and the integer
-        // result is positive, round up.
-        int_result++;
-      }
-      break;
-    }
-    case FPTieEven: {
-      // Take care of correctly handling the range [-0.5, -0.0], which must
-      // yield -0.0.
-      if ((-0.5 <= value) && (value < 0.0)) {
-        int_result = -0.0;
-
-        // If the error is greater than 0.5, or is equal to 0.5 and the integer
-        // result is odd, round up.
-      } else if ((error > 0.5) ||
-                 ((error == 0.5) && (std::fmod(int_result, 2) != 0))) {
-        int_result++;
-      }
-      break;
-    }
-    case FPZero: {
-      // If value>0 then we take floor(value)
-      // otherwise, ceil(value).
-      if (value < 0) {
-        int_result = ceil(value);
-      }
-      break;
-    }
-    case FPNegativeInfinity: {
-      // We always use floor(value).
-      break;
-    }
-    case FPPositiveInfinity: {
-      // Take care of correctly handling the range ]-1.0, -0.0], which must
-      // yield -0.0.
-      if ((-1.0 < value) && (value < 0.0)) {
-        int_result = -0.0;
-
-        // If the error is non-zero, round up.
-      } else if (error > 0.0) {
-        int_result++;
-      }
-      break;
-    }
-    default:
-      UNIMPLEMENTED();
-  }
-  return int_result;
-}
-
-int32_t Simulator::FPToInt32(double value, FPRounding rmode) {
-  value = FPRoundInt(value, rmode);
-  if (value >= kWMaxInt) {
-    return kWMaxInt;
-  } else if (value < kWMinInt) {
-    return kWMinInt;
-  }
-  return std::isnan(value) ? 0 : static_cast<int32_t>(value);
-}
-
-int64_t Simulator::FPToInt64(double value, FPRounding rmode) {
-  value = FPRoundInt(value, rmode);
-  if (value >= kXMaxInt) {
-    return kXMaxInt;
-  } else if (value < kXMinInt) {
-    return kXMinInt;
-  }
-  return std::isnan(value) ? 0 : static_cast<int64_t>(value);
-}
-
-uint32_t Simulator::FPToUInt32(double value, FPRounding rmode) {
-  value = FPRoundInt(value, rmode);
-  if (value >= kWMaxUInt) {
-    return kWMaxUInt;
-  } else if (value < 0.0) {
-    return 0;
-  }
-  return std::isnan(value) ? 0 : static_cast<uint32_t>(value);
-}
-
-uint64_t Simulator::FPToUInt64(double value, FPRounding rmode) {
-  value = FPRoundInt(value, rmode);
-  if (value >= kXMaxUInt) {
-    return kXMaxUInt;
-  } else if (value < 0.0) {
-    return 0;
-  }
-  return std::isnan(value) ? 0 : static_cast<uint64_t>(value);
-}
-
-#define DEFINE_NEON_FP_VECTOR_OP(FN, OP, PROCNAN)                      \
-  template <typename T>                                                \
-  LogicVRegister Simulator::FN(VectorFormat vform, LogicVRegister dst, \
-                               const LogicVRegister& src1,             \
-                               const LogicVRegister& src2) {           \
-    dst.ClearForWrite(vform);                                          \
-    for (int i = 0; i < LaneCountFromFormat(vform); i++) {             \
-      T op1 = src1.Float<T>(i);                                        \
-      T op2 = src2.Float<T>(i);                                        \
-      T result;                                                        \
-      if (PROCNAN) {                                                   \
-        result = FPProcessNaNs(op1, op2);                              \
-        if (!std::isnan(result)) {                                     \
-          result = OP(op1, op2);                                       \
-        }                                                              \
-      } else {                                                         \
-        result = OP(op1, op2);                                         \
-      }                                                                \
-      dst.SetFloat(i, result);                                         \
-    }                                                                  \
-    return dst;                                                        \
-  }                                                                    \
-                                                                       \
-  LogicVRegister Simulator::FN(VectorFormat vform, LogicVRegister dst, \
-                               const LogicVRegister& src1,             \
-                               const LogicVRegister& src2) {           \
-    if (LaneSizeInBytesFromFormat(vform) == kSRegSize) {               \
-      FN<float>(vform, dst, src1, src2);                               \
-    } else {                                                           \
-      DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kDRegSize);          \
-      FN<double>(vform, dst, src1, src2);                              \
-    }                                                                  \
-    return dst;                                                        \
-  }
-NEON_FP3SAME_LIST(DEFINE_NEON_FP_VECTOR_OP)
-#undef DEFINE_NEON_FP_VECTOR_OP
-
-LogicVRegister Simulator::fnmul(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2) {
-  SimVRegister temp;
-  LogicVRegister product = fmul(vform, temp, src1, src2);
-  return fneg(vform, dst, product);
-}
-
-template <typename T>
-LogicVRegister Simulator::frecps(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    T op1 = -src1.Float<T>(i);
-    T op2 = src2.Float<T>(i);
-    T result = FPProcessNaNs(op1, op2);
-    dst.SetFloat(i, std::isnan(result) ? result : FPRecipStepFused(op1, op2));
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::frecps(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src1,
-                                 const LogicVRegister& src2) {
-  if (LaneSizeInBytesFromFormat(vform) == kSRegSize) {
-    frecps<float>(vform, dst, src1, src2);
-  } else {
-    DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kDRegSize);
-    frecps<double>(vform, dst, src1, src2);
-  }
-  return dst;
-}
-
-template <typename T>
-LogicVRegister Simulator::frsqrts(VectorFormat vform, LogicVRegister dst,
-                                  const LogicVRegister& src1,
-                                  const LogicVRegister& src2) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    T op1 = -src1.Float<T>(i);
-    T op2 = src2.Float<T>(i);
-    T result = FPProcessNaNs(op1, op2);
-    dst.SetFloat(i, std::isnan(result) ? result : FPRSqrtStepFused(op1, op2));
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::frsqrts(VectorFormat vform, LogicVRegister dst,
-                                  const LogicVRegister& src1,
-                                  const LogicVRegister& src2) {
-  if (LaneSizeInBytesFromFormat(vform) == kSRegSize) {
-    frsqrts<float>(vform, dst, src1, src2);
-  } else {
-    DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kDRegSize);
-    frsqrts<double>(vform, dst, src1, src2);
-  }
-  return dst;
-}
-
-template <typename T>
-LogicVRegister Simulator::fcmp(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2, Condition cond) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    bool result = false;
-    T op1 = src1.Float<T>(i);
-    T op2 = src2.Float<T>(i);
-    T nan_result = FPProcessNaNs(op1, op2);
-    if (!std::isnan(nan_result)) {
-      switch (cond) {
-        case eq:
-          result = (op1 == op2);
-          break;
-        case ge:
-          result = (op1 >= op2);
-          break;
-        case gt:
-          result = (op1 > op2);
-          break;
-        case le:
-          result = (op1 <= op2);
-          break;
-        case lt:
-          result = (op1 < op2);
-          break;
-        default:
-          UNREACHABLE();
-      }
-    }
-    dst.SetUint(vform, i, result ? MaxUintFromFormat(vform) : 0);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::fcmp(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2, Condition cond) {
-  if (LaneSizeInBytesFromFormat(vform) == kSRegSize) {
-    fcmp<float>(vform, dst, src1, src2, cond);
-  } else {
-    DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kDRegSize);
-    fcmp<double>(vform, dst, src1, src2, cond);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::fcmp_zero(VectorFormat vform, LogicVRegister dst,
-                                    const LogicVRegister& src, Condition cond) {
-  SimVRegister temp;
-  if (LaneSizeInBytesFromFormat(vform) == kSRegSize) {
-    LogicVRegister zero_reg =
-        dup_immediate(vform, temp, bit_cast<uint32_t>(0.0f));
-    fcmp<float>(vform, dst, src, zero_reg, cond);
-  } else {
-    DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kDRegSize);
-    LogicVRegister zero_reg =
-        dup_immediate(vform, temp, bit_cast<uint64_t>(0.0));
-    fcmp<double>(vform, dst, src, zero_reg, cond);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::fabscmp(VectorFormat vform, LogicVRegister dst,
-                                  const LogicVRegister& src1,
-                                  const LogicVRegister& src2, Condition cond) {
-  SimVRegister temp1, temp2;
-  if (LaneSizeInBytesFromFormat(vform) == kSRegSize) {
-    LogicVRegister abs_src1 = fabs_<float>(vform, temp1, src1);
-    LogicVRegister abs_src2 = fabs_<float>(vform, temp2, src2);
-    fcmp<float>(vform, dst, abs_src1, abs_src2, cond);
-  } else {
-    DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kDRegSize);
-    LogicVRegister abs_src1 = fabs_<double>(vform, temp1, src1);
-    LogicVRegister abs_src2 = fabs_<double>(vform, temp2, src2);
-    fcmp<double>(vform, dst, abs_src1, abs_src2, cond);
-  }
-  return dst;
-}
-
-template <typename T>
-LogicVRegister Simulator::fmla(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    T op1 = src1.Float<T>(i);
-    T op2 = src2.Float<T>(i);
-    T acc = dst.Float<T>(i);
-    T result = FPMulAdd(acc, op1, op2);
-    dst.SetFloat(i, result);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::fmla(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2) {
-  if (LaneSizeInBytesFromFormat(vform) == kSRegSize) {
-    fmla<float>(vform, dst, src1, src2);
-  } else {
-    DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kDRegSize);
-    fmla<double>(vform, dst, src1, src2);
-  }
-  return dst;
-}
-
-template <typename T>
-LogicVRegister Simulator::fmls(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    T op1 = -src1.Float<T>(i);
-    T op2 = src2.Float<T>(i);
-    T acc = dst.Float<T>(i);
-    T result = FPMulAdd(acc, op1, op2);
-    dst.SetFloat(i, result);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::fmls(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2) {
-  if (LaneSizeInBytesFromFormat(vform) == kSRegSize) {
-    fmls<float>(vform, dst, src1, src2);
-  } else {
-    DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kDRegSize);
-    fmls<double>(vform, dst, src1, src2);
-  }
-  return dst;
-}
-
-template <typename T>
-LogicVRegister Simulator::fneg(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    T op = src.Float<T>(i);
-    op = -op;
-    dst.SetFloat(i, op);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::fneg(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src) {
-  if (LaneSizeInBytesFromFormat(vform) == kSRegSize) {
-    fneg<float>(vform, dst, src);
-  } else {
-    DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kDRegSize);
-    fneg<double>(vform, dst, src);
-  }
-  return dst;
-}
-
-template <typename T>
-LogicVRegister Simulator::fabs_(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    T op = src.Float<T>(i);
-    if (copysign(1.0, op) < 0.0) {
-      op = -op;
-    }
-    dst.SetFloat(i, op);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::fabs_(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src) {
-  if (LaneSizeInBytesFromFormat(vform) == kSRegSize) {
-    fabs_<float>(vform, dst, src);
-  } else {
-    DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kDRegSize);
-    fabs_<double>(vform, dst, src);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::fabd(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2) {
-  SimVRegister temp;
-  fsub(vform, temp, src1, src2);
-  fabs_(vform, dst, temp);
-  return dst;
-}
-
-LogicVRegister Simulator::fsqrt(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src) {
-  dst.ClearForWrite(vform);
-  if (LaneSizeInBytesFromFormat(vform) == kSRegSize) {
-    for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-      float result = FPSqrt(src.Float<float>(i));
-      dst.SetFloat(i, result);
-    }
-  } else {
-    DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kDRegSize);
-    for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-      double result = FPSqrt(src.Float<double>(i));
-      dst.SetFloat(i, result);
-    }
-  }
-  return dst;
-}
-
-#define DEFINE_NEON_FP_PAIR_OP(FNP, FN, OP)                             \
-  LogicVRegister Simulator::FNP(VectorFormat vform, LogicVRegister dst, \
-                                const LogicVRegister& src1,             \
-                                const LogicVRegister& src2) {           \
-    SimVRegister temp1, temp2;                                          \
-    uzp1(vform, temp1, src1, src2);                                     \
-    uzp2(vform, temp2, src1, src2);                                     \
-    FN(vform, dst, temp1, temp2);                                       \
-    return dst;                                                         \
-  }                                                                     \
-                                                                        \
-  LogicVRegister Simulator::FNP(VectorFormat vform, LogicVRegister dst, \
-                                const LogicVRegister& src) {            \
-    if (vform == kFormatS) {                                            \
-      float result = OP(src.Float<float>(0), src.Float<float>(1));      \
-      dst.SetFloat(0, result);                                          \
-    } else {                                                            \
-      DCHECK_EQ(vform, kFormatD);                                       \
-      double result = OP(src.Float<double>(0), src.Float<double>(1));   \
-      dst.SetFloat(0, result);                                          \
-    }                                                                   \
-    dst.ClearForWrite(vform);                                           \
-    return dst;                                                         \
-  }
-NEON_FPPAIRWISE_LIST(DEFINE_NEON_FP_PAIR_OP)
-#undef DEFINE_NEON_FP_PAIR_OP
-
-LogicVRegister Simulator::FMinMaxV(VectorFormat vform, LogicVRegister dst,
-                                   const LogicVRegister& src, FPMinMaxOp Op) {
-  DCHECK_EQ(vform, kFormat4S);
-  USE(vform);
-  float result1 = (this->*Op)(src.Float<float>(0), src.Float<float>(1));
-  float result2 = (this->*Op)(src.Float<float>(2), src.Float<float>(3));
-  float result = (this->*Op)(result1, result2);
-  dst.ClearForWrite(kFormatS);
-  dst.SetFloat<float>(0, result);
-  return dst;
-}
-
-LogicVRegister Simulator::fmaxv(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src) {
-  return FMinMaxV(vform, dst, src, &Simulator::FPMax);
-}
-
-LogicVRegister Simulator::fminv(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src) {
-  return FMinMaxV(vform, dst, src, &Simulator::FPMin);
-}
-
-LogicVRegister Simulator::fmaxnmv(VectorFormat vform, LogicVRegister dst,
-                                  const LogicVRegister& src) {
-  return FMinMaxV(vform, dst, src, &Simulator::FPMaxNM);
-}
-
-LogicVRegister Simulator::fminnmv(VectorFormat vform, LogicVRegister dst,
-                                  const LogicVRegister& src) {
-  return FMinMaxV(vform, dst, src, &Simulator::FPMinNM);
-}
-
-LogicVRegister Simulator::fmul(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2, int index) {
-  dst.ClearForWrite(vform);
-  SimVRegister temp;
-  if (LaneSizeInBytesFromFormat(vform) == kSRegSize) {
-    LogicVRegister index_reg = dup_element(kFormat4S, temp, src2, index);
-    fmul<float>(vform, dst, src1, index_reg);
-  } else {
-    DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kDRegSize);
-    LogicVRegister index_reg = dup_element(kFormat2D, temp, src2, index);
-    fmul<double>(vform, dst, src1, index_reg);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::fmla(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2, int index) {
-  dst.ClearForWrite(vform);
-  SimVRegister temp;
-  if (LaneSizeInBytesFromFormat(vform) == kSRegSize) {
-    LogicVRegister index_reg = dup_element(kFormat4S, temp, src2, index);
-    fmla<float>(vform, dst, src1, index_reg);
-  } else {
-    DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kDRegSize);
-    LogicVRegister index_reg = dup_element(kFormat2D, temp, src2, index);
-    fmla<double>(vform, dst, src1, index_reg);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::fmls(VectorFormat vform, LogicVRegister dst,
-                               const LogicVRegister& src1,
-                               const LogicVRegister& src2, int index) {
-  dst.ClearForWrite(vform);
-  SimVRegister temp;
-  if (LaneSizeInBytesFromFormat(vform) == kSRegSize) {
-    LogicVRegister index_reg = dup_element(kFormat4S, temp, src2, index);
-    fmls<float>(vform, dst, src1, index_reg);
-  } else {
-    DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kDRegSize);
-    LogicVRegister index_reg = dup_element(kFormat2D, temp, src2, index);
-    fmls<double>(vform, dst, src1, index_reg);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::fmulx(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src1,
-                                const LogicVRegister& src2, int index) {
-  dst.ClearForWrite(vform);
-  SimVRegister temp;
-  if (LaneSizeInBytesFromFormat(vform) == kSRegSize) {
-    LogicVRegister index_reg = dup_element(kFormat4S, temp, src2, index);
-    fmulx<float>(vform, dst, src1, index_reg);
-
-  } else {
-    DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kDRegSize);
-    LogicVRegister index_reg = dup_element(kFormat2D, temp, src2, index);
-    fmulx<double>(vform, dst, src1, index_reg);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::frint(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src,
-                                FPRounding rounding_mode,
-                                bool inexact_exception) {
-  dst.ClearForWrite(vform);
-  if (LaneSizeInBytesFromFormat(vform) == kSRegSize) {
-    for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-      float input = src.Float<float>(i);
-      float rounded = FPRoundInt(input, rounding_mode);
-      if (inexact_exception && !std::isnan(input) && (input != rounded)) {
-        FPProcessException();
-      }
-      dst.SetFloat<float>(i, rounded);
-    }
-  } else {
-    DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kDRegSize);
-    for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-      double input = src.Float<double>(i);
-      double rounded = FPRoundInt(input, rounding_mode);
-      if (inexact_exception && !std::isnan(input) && (input != rounded)) {
-        FPProcessException();
-      }
-      dst.SetFloat<double>(i, rounded);
-    }
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::fcvts(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src,
-                                FPRounding rounding_mode, int fbits) {
-  dst.ClearForWrite(vform);
-  if (LaneSizeInBytesFromFormat(vform) == kSRegSize) {
-    for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-      float op = src.Float<float>(i) * std::pow(2.0f, fbits);
-      dst.SetInt(vform, i, FPToInt32(op, rounding_mode));
-    }
-  } else {
-    DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kDRegSize);
-    for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-      double op = src.Float<double>(i) * std::pow(2.0, fbits);
-      dst.SetInt(vform, i, FPToInt64(op, rounding_mode));
-    }
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::fcvtu(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src,
-                                FPRounding rounding_mode, int fbits) {
-  dst.ClearForWrite(vform);
-  if (LaneSizeInBytesFromFormat(vform) == kSRegSize) {
-    for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-      float op = src.Float<float>(i) * std::pow(2.0f, fbits);
-      dst.SetUint(vform, i, FPToUInt32(op, rounding_mode));
-    }
-  } else {
-    DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kDRegSize);
-    for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-      double op = src.Float<double>(i) * std::pow(2.0, fbits);
-      dst.SetUint(vform, i, FPToUInt64(op, rounding_mode));
-    }
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::fcvtl(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src) {
-  if (LaneSizeInBytesFromFormat(vform) == kSRegSize) {
-    for (int i = LaneCountFromFormat(vform) - 1; i >= 0; i--) {
-      dst.SetFloat(i, FPToFloat(src.Float<float16>(i)));
-    }
-  } else {
-    DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kDRegSize);
-    for (int i = LaneCountFromFormat(vform) - 1; i >= 0; i--) {
-      dst.SetFloat(i, FPToDouble(src.Float<float>(i)));
-    }
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::fcvtl2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src) {
-  int lane_count = LaneCountFromFormat(vform);
-  if (LaneSizeInBytesFromFormat(vform) == kSRegSize) {
-    for (int i = 0; i < lane_count; i++) {
-      dst.SetFloat(i, FPToFloat(src.Float<float16>(i + lane_count)));
-    }
-  } else {
-    DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kDRegSize);
-    for (int i = 0; i < lane_count; i++) {
-      dst.SetFloat(i, FPToDouble(src.Float<float>(i + lane_count)));
-    }
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::fcvtn(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src) {
-  if (LaneSizeInBytesFromFormat(vform) == kHRegSize) {
-    for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-      dst.SetFloat(i, FPToFloat16(src.Float<float>(i), FPTieEven));
-    }
-  } else {
-    DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kSRegSize);
-    for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-      dst.SetFloat(i, FPToFloat(src.Float<double>(i), FPTieEven));
-    }
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::fcvtn2(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src) {
-  int lane_count = LaneCountFromFormat(vform) / 2;
-  if (LaneSizeInBytesFromFormat(vform) == kHRegSize) {
-    for (int i = lane_count - 1; i >= 0; i--) {
-      dst.SetFloat(i + lane_count, FPToFloat16(src.Float<float>(i), FPTieEven));
-    }
-  } else {
-    DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kSRegSize);
-    for (int i = lane_count - 1; i >= 0; i--) {
-      dst.SetFloat(i + lane_count, FPToFloat(src.Float<double>(i), FPTieEven));
-    }
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::fcvtxn(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src) {
-  dst.ClearForWrite(vform);
-  DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kSRegSize);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    dst.SetFloat(i, FPToFloat(src.Float<double>(i), FPRoundOdd));
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::fcvtxn2(VectorFormat vform, LogicVRegister dst,
-                                  const LogicVRegister& src) {
-  DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kSRegSize);
-  int lane_count = LaneCountFromFormat(vform) / 2;
-  for (int i = lane_count - 1; i >= 0; i--) {
-    dst.SetFloat(i + lane_count, FPToFloat(src.Float<double>(i), FPRoundOdd));
-  }
-  return dst;
-}
-
-// Based on reference C function recip_sqrt_estimate from ARM ARM.
-double Simulator::recip_sqrt_estimate(double a) {
-  int q0, q1, s;
-  double r;
-  if (a < 0.5) {
-    q0 = static_cast<int>(a * 512.0);
-    r = 1.0 / sqrt((static_cast<double>(q0) + 0.5) / 512.0);
-  } else {
-    q1 = static_cast<int>(a * 256.0);
-    r = 1.0 / sqrt((static_cast<double>(q1) + 0.5) / 256.0);
-  }
-  s = static_cast<int>(256.0 * r + 0.5);
-  return static_cast<double>(s) / 256.0;
-}
-
-namespace {
-
-inline uint64_t Bits(uint64_t val, int start_bit, int end_bit) {
-  return unsigned_bitextract_64(start_bit, end_bit, val);
-}
-
-}  // anonymous namespace
-
-template <typename T>
-T Simulator::FPRecipSqrtEstimate(T op) {
-  static_assert(std::is_same<float, T>::value || std::is_same<double, T>::value,
-                "T must be a float or double");
-
-  if (std::isnan(op)) {
-    return FPProcessNaN(op);
-  } else if (op == 0.0) {
-    if (copysign(1.0, op) < 0.0) {
-      return kFP64NegativeInfinity;
-    } else {
-      return kFP64PositiveInfinity;
-    }
-  } else if (copysign(1.0, op) < 0.0) {
-    FPProcessException();
-    return FPDefaultNaN<T>();
-  } else if (std::isinf(op)) {
-    return 0.0;
-  } else {
-    uint64_t fraction;
-    int32_t exp, result_exp;
-
-    if (sizeof(T) == sizeof(float)) {
-      exp = static_cast<int32_t>(float_exp(op));
-      fraction = float_mantissa(op);
-      fraction <<= 29;
-    } else {
-      exp = static_cast<int32_t>(double_exp(op));
-      fraction = double_mantissa(op);
-    }
-
-    if (exp == 0) {
-      while (Bits(fraction, 51, 51) == 0) {
-        fraction = Bits(fraction, 50, 0) << 1;
-        exp -= 1;
-      }
-      fraction = Bits(fraction, 50, 0) << 1;
-    }
-
-    double scaled;
-    if (Bits(exp, 0, 0) == 0) {
-      scaled = double_pack(0, 1022, Bits(fraction, 51, 44) << 44);
-    } else {
-      scaled = double_pack(0, 1021, Bits(fraction, 51, 44) << 44);
-    }
-
-    if (sizeof(T) == sizeof(float)) {
-      result_exp = (380 - exp) / 2;
-    } else {
-      result_exp = (3068 - exp) / 2;
-    }
-
-    uint64_t estimate = bit_cast<uint64_t>(recip_sqrt_estimate(scaled));
-
-    if (sizeof(T) == sizeof(float)) {
-      uint32_t exp_bits = static_cast<uint32_t>(Bits(result_exp, 7, 0));
-      uint32_t est_bits = static_cast<uint32_t>(Bits(estimate, 51, 29));
-      return float_pack(0, exp_bits, est_bits);
-    } else {
-      return double_pack(0, Bits(result_exp, 10, 0), Bits(estimate, 51, 0));
-    }
-  }
-}
-
-LogicVRegister Simulator::frsqrte(VectorFormat vform, LogicVRegister dst,
-                                  const LogicVRegister& src) {
-  dst.ClearForWrite(vform);
-  if (LaneSizeInBytesFromFormat(vform) == kSRegSize) {
-    for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-      float input = src.Float<float>(i);
-      dst.SetFloat(i, FPRecipSqrtEstimate<float>(input));
-    }
-  } else {
-    DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kDRegSize);
-    for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-      double input = src.Float<double>(i);
-      dst.SetFloat(i, FPRecipSqrtEstimate<double>(input));
-    }
-  }
-  return dst;
-}
-
-template <typename T>
-T Simulator::FPRecipEstimate(T op, FPRounding rounding) {
-  static_assert(std::is_same<float, T>::value || std::is_same<double, T>::value,
-                "T must be a float or double");
-  uint32_t sign;
-
-  if (sizeof(T) == sizeof(float)) {
-    sign = float_sign(op);
-  } else {
-    sign = double_sign(op);
-  }
-
-  if (std::isnan(op)) {
-    return FPProcessNaN(op);
-  } else if (std::isinf(op)) {
-    return (sign == 1) ? -0.0 : 0.0;
-  } else if (op == 0.0) {
-    FPProcessException();  // FPExc_DivideByZero exception.
-    return (sign == 1) ? kFP64NegativeInfinity : kFP64PositiveInfinity;
-  } else if (((sizeof(T) == sizeof(float)) &&
-              (std::fabs(op) < std::pow(2.0, -128.0))) ||
-             ((sizeof(T) == sizeof(double)) &&
-              (std::fabs(op) < std::pow(2.0, -1024.0)))) {
-    bool overflow_to_inf = false;
-    switch (rounding) {
-      case FPTieEven:
-        overflow_to_inf = true;
-        break;
-      case FPPositiveInfinity:
-        overflow_to_inf = (sign == 0);
-        break;
-      case FPNegativeInfinity:
-        overflow_to_inf = (sign == 1);
-        break;
-      case FPZero:
-        overflow_to_inf = false;
-        break;
-      default:
-        break;
-    }
-    FPProcessException();  // FPExc_Overflow and FPExc_Inexact.
-    if (overflow_to_inf) {
-      return (sign == 1) ? kFP64NegativeInfinity : kFP64PositiveInfinity;
-    } else {
-      // Return FPMaxNormal(sign).
-      if (sizeof(T) == sizeof(float)) {
-        return float_pack(sign, 0xFE, 0x07FFFFF);
-      } else {
-        return double_pack(sign, 0x7FE, 0x0FFFFFFFFFFFFFl);
-      }
-    }
-  } else {
-    uint64_t fraction;
-    int32_t exp, result_exp;
-    uint32_t sign;
-
-    if (sizeof(T) == sizeof(float)) {
-      sign = float_sign(op);
-      exp = static_cast<int32_t>(float_exp(op));
-      fraction = float_mantissa(op);
-      fraction <<= 29;
-    } else {
-      sign = double_sign(op);
-      exp = static_cast<int32_t>(double_exp(op));
-      fraction = double_mantissa(op);
-    }
-
-    if (exp == 0) {
-      if (Bits(fraction, 51, 51) == 0) {
-        exp -= 1;
-        fraction = Bits(fraction, 49, 0) << 2;
-      } else {
-        fraction = Bits(fraction, 50, 0) << 1;
-      }
-    }
-
-    double scaled = double_pack(0, 1022, Bits(fraction, 51, 44) << 44);
-
-    if (sizeof(T) == sizeof(float)) {
-      result_exp = 253 - exp;
-    } else {
-      result_exp = 2045 - exp;
-    }
-
-    double estimate = recip_estimate(scaled);
-
-    fraction = double_mantissa(estimate);
-    if (result_exp == 0) {
-      fraction = (UINT64_C(1) << 51) | Bits(fraction, 51, 1);
-    } else if (result_exp == -1) {
-      fraction = (UINT64_C(1) << 50) | Bits(fraction, 51, 2);
-      result_exp = 0;
-    }
-    if (sizeof(T) == sizeof(float)) {
-      uint32_t exp_bits = static_cast<uint32_t>(Bits(result_exp, 7, 0));
-      uint32_t frac_bits = static_cast<uint32_t>(Bits(fraction, 51, 29));
-      return float_pack(sign, exp_bits, frac_bits);
-    } else {
-      return double_pack(sign, Bits(result_exp, 10, 0), Bits(fraction, 51, 0));
-    }
-  }
-}
-
-LogicVRegister Simulator::frecpe(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src, FPRounding round) {
-  dst.ClearForWrite(vform);
-  if (LaneSizeInBytesFromFormat(vform) == kSRegSize) {
-    for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-      float input = src.Float<float>(i);
-      dst.SetFloat(i, FPRecipEstimate<float>(input, round));
-    }
-  } else {
-    DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kDRegSize);
-    for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-      double input = src.Float<double>(i);
-      dst.SetFloat(i, FPRecipEstimate<double>(input, round));
-    }
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::ursqrte(VectorFormat vform, LogicVRegister dst,
-                                  const LogicVRegister& src) {
-  dst.ClearForWrite(vform);
-  uint64_t operand;
-  uint32_t result;
-  double dp_operand, dp_result;
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    operand = src.Uint(vform, i);
-    if (operand <= 0x3FFFFFFF) {
-      result = 0xFFFFFFFF;
-    } else {
-      dp_operand = operand * std::pow(2.0, -32);
-      dp_result = recip_sqrt_estimate(dp_operand) * std::pow(2.0, 31);
-      result = static_cast<uint32_t>(dp_result);
-    }
-    dst.SetUint(vform, i, result);
-  }
-  return dst;
-}
-
-// Based on reference C function recip_estimate from ARM ARM.
-double Simulator::recip_estimate(double a) {
-  int q, s;
-  double r;
-  q = static_cast<int>(a * 512.0);
-  r = 1.0 / ((static_cast<double>(q) + 0.5) / 512.0);
-  s = static_cast<int>(256.0 * r + 0.5);
-  return static_cast<double>(s) / 256.0;
-}
-
-LogicVRegister Simulator::urecpe(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src) {
-  dst.ClearForWrite(vform);
-  uint64_t operand;
-  uint32_t result;
-  double dp_operand, dp_result;
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    operand = src.Uint(vform, i);
-    if (operand <= 0x7FFFFFFF) {
-      result = 0xFFFFFFFF;
-    } else {
-      dp_operand = operand * std::pow(2.0, -32);
-      dp_result = recip_estimate(dp_operand) * std::pow(2.0, 31);
-      result = static_cast<uint32_t>(dp_result);
-    }
-    dst.SetUint(vform, i, result);
-  }
-  return dst;
-}
-
-template <typename T>
-LogicVRegister Simulator::frecpx(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src) {
-  dst.ClearForWrite(vform);
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    T op = src.Float<T>(i);
-    T result;
-    if (std::isnan(op)) {
-      result = FPProcessNaN(op);
-    } else {
-      int exp;
-      uint32_t sign;
-      if (sizeof(T) == sizeof(float)) {
-        sign = float_sign(op);
-        exp = static_cast<int>(float_exp(op));
-        exp = (exp == 0) ? (0xFF - 1) : static_cast<int>(Bits(~exp, 7, 0));
-        result = float_pack(sign, exp, 0);
-      } else {
-        sign = double_sign(op);
-        exp = static_cast<int>(double_exp(op));
-        exp = (exp == 0) ? (0x7FF - 1) : static_cast<int>(Bits(~exp, 10, 0));
-        result = double_pack(sign, exp, 0);
-      }
-    }
-    dst.SetFloat(i, result);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::frecpx(VectorFormat vform, LogicVRegister dst,
-                                 const LogicVRegister& src) {
-  if (LaneSizeInBytesFromFormat(vform) == kSRegSize) {
-    frecpx<float>(vform, dst, src);
-  } else {
-    DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kDRegSize);
-    frecpx<double>(vform, dst, src);
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::scvtf(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src, int fbits,
-                                FPRounding round) {
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    if (LaneSizeInBytesFromFormat(vform) == kSRegSize) {
-      float result = FixedToFloat(src.Int(kFormatS, i), fbits, round);
-      dst.SetFloat<float>(i, result);
-    } else {
-      DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kDRegSize);
-      double result = FixedToDouble(src.Int(kFormatD, i), fbits, round);
-      dst.SetFloat<double>(i, result);
-    }
-  }
-  return dst;
-}
-
-LogicVRegister Simulator::ucvtf(VectorFormat vform, LogicVRegister dst,
-                                const LogicVRegister& src, int fbits,
-                                FPRounding round) {
-  for (int i = 0; i < LaneCountFromFormat(vform); i++) {
-    if (LaneSizeInBytesFromFormat(vform) == kSRegSize) {
-      float result = UFixedToFloat(src.Uint(kFormatS, i), fbits, round);
-      dst.SetFloat<float>(i, result);
-    } else {
-      DCHECK_EQ(LaneSizeInBytesFromFormat(vform), kDRegSize);
-      double result = UFixedToDouble(src.Uint(kFormatD, i), fbits, round);
-      dst.SetFloat<double>(i, result);
-    }
-  }
-  return dst;
-}
-
-#endif  // USE_SIMULATOR
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_ARM64
diff --git a/src/v8/src/arm64/utils-arm64.cc b/src/v8/src/arm64/utils-arm64.cc
deleted file mode 100644
index f8804d8..0000000
--- a/src/v8/src/arm64/utils-arm64.cc
+++ /dev/null
@@ -1,140 +0,0 @@
-// Copyright 2013 the V8 project 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 V8_TARGET_ARCH_ARM64
-
-#include "src/arm64/utils-arm64.h"
-
-
-namespace v8 {
-namespace internal {
-
-#define __ assm->
-
-uint32_t float_sign(float val) {
-  uint32_t bits = bit_cast<uint32_t>(val);
-  return unsigned_bitextract_32(31, 31, bits);
-}
-
-uint32_t float_exp(float val) {
-  uint32_t bits = bit_cast<uint32_t>(val);
-  return unsigned_bitextract_32(30, 23, bits);
-}
-
-uint32_t float_mantissa(float val) {
-  uint32_t bits = bit_cast<uint32_t>(val);
-  return unsigned_bitextract_32(22, 0, bits);
-}
-
-uint32_t double_sign(double val) {
-  uint64_t bits = bit_cast<uint64_t>(val);
-  return static_cast<uint32_t>(unsigned_bitextract_64(63, 63, bits));
-}
-
-uint32_t double_exp(double val) {
-  uint64_t bits = bit_cast<uint64_t>(val);
-  return static_cast<uint32_t>(unsigned_bitextract_64(62, 52, bits));
-}
-
-uint64_t double_mantissa(double val) {
-  uint64_t bits = bit_cast<uint64_t>(val);
-  return unsigned_bitextract_64(51, 0, bits);
-}
-
-float float_pack(uint32_t sign, uint32_t exp, uint32_t mantissa) {
-  uint32_t bits = sign << kFloatExponentBits | exp;
-  return bit_cast<float>((bits << kFloatMantissaBits) | mantissa);
-}
-
-double double_pack(uint64_t sign, uint64_t exp, uint64_t mantissa) {
-  uint64_t bits = sign << kDoubleExponentBits | exp;
-  return bit_cast<double>((bits << kDoubleMantissaBits) | mantissa);
-}
-
-int float16classify(float16 value) {
-  const uint16_t exponent_max = (1 << kFloat16ExponentBits) - 1;
-  const uint16_t exponent_mask = exponent_max << kFloat16MantissaBits;
-  const uint16_t mantissa_mask = (1 << kFloat16MantissaBits) - 1;
-
-  const uint16_t exponent = (value & exponent_mask) >> kFloat16MantissaBits;
-  const uint16_t mantissa = value & mantissa_mask;
-  if (exponent == 0) {
-    if (mantissa == 0) {
-      return FP_ZERO;
-    }
-    return FP_SUBNORMAL;
-  } else if (exponent == exponent_max) {
-    if (mantissa == 0) {
-      return FP_INFINITE;
-    }
-    return FP_NAN;
-  }
-  return FP_NORMAL;
-}
-
-int CountLeadingZeros(uint64_t value, int width) {
-  DCHECK(base::bits::IsPowerOfTwo(width) && (width <= 64));
-  if (value == 0) {
-    return width;
-  }
-  return base::bits::CountLeadingZeros64(value << (64 - width));
-}
-
-
-int CountLeadingSignBits(int64_t value, int width) {
-  DCHECK(base::bits::IsPowerOfTwo(width) && (width <= 64));
-  if (value >= 0) {
-    return CountLeadingZeros(value, width) - 1;
-  } else {
-    return CountLeadingZeros(~value, width) - 1;
-  }
-}
-
-
-int CountTrailingZeros(uint64_t value, int width) {
-  DCHECK((width == 32) || (width == 64));
-  if (width == 64) {
-    return static_cast<int>(base::bits::CountTrailingZeros64(value));
-  }
-  return static_cast<int>(base::bits::CountTrailingZeros32(
-      static_cast<uint32_t>(value & 0xFFFFFFFFF)));
-}
-
-
-int CountSetBits(uint64_t value, int width) {
-  DCHECK((width == 32) || (width == 64));
-  if (width == 64) {
-    return static_cast<int>(base::bits::CountPopulation(value));
-  }
-  return static_cast<int>(
-      base::bits::CountPopulation(static_cast<uint32_t>(value & 0xFFFFFFFFF)));
-}
-
-int LowestSetBitPosition(uint64_t value) {
-  DCHECK_NE(value, 0U);
-  return CountTrailingZeros(value, 64) + 1;
-}
-
-int HighestSetBitPosition(uint64_t value) {
-  DCHECK_NE(value, 0U);
-  return 63 - CountLeadingZeros(value, 64);
-}
-
-
-uint64_t LargestPowerOf2Divisor(uint64_t value) {
-  return value & -value;
-}
-
-
-int MaskToBit(uint64_t mask) {
-  DCHECK_EQ(CountSetBits(mask, 64), 1);
-  return CountTrailingZeros(mask, 64);
-}
-
-#undef __
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_ARM64
diff --git a/src/v8/src/arm64/utils-arm64.h b/src/v8/src/arm64/utils-arm64.h
deleted file mode 100644
index 920a84d..0000000
--- a/src/v8/src/arm64/utils-arm64.h
+++ /dev/null
@@ -1,130 +0,0 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_ARM64_UTILS_ARM64_H_
-#define V8_ARM64_UTILS_ARM64_H_
-
-#include <cmath>
-
-#include "src/arm64/constants-arm64.h"
-#include "src/utils.h"
-
-namespace v8 {
-namespace internal {
-
-// These are global assumptions in v8.
-STATIC_ASSERT((static_cast<int32_t>(-1) >> 1) == -1);
-STATIC_ASSERT((static_cast<uint32_t>(-1) >> 1) == 0x7FFFFFFF);
-
-uint32_t float_sign(float val);
-uint32_t float_exp(float val);
-uint32_t float_mantissa(float val);
-uint32_t double_sign(double val);
-uint32_t double_exp(double val);
-uint64_t double_mantissa(double val);
-
-float float_pack(uint32_t sign, uint32_t exp, uint32_t mantissa);
-double double_pack(uint64_t sign, uint64_t exp, uint64_t mantissa);
-
-// An fpclassify() function for 16-bit half-precision floats.
-int float16classify(float16 value);
-
-// Bit counting.
-int CountLeadingZeros(uint64_t value, int width);
-int CountLeadingSignBits(int64_t value, int width);
-int CountTrailingZeros(uint64_t value, int width);
-int CountSetBits(uint64_t value, int width);
-int LowestSetBitPosition(uint64_t value);
-int HighestSetBitPosition(uint64_t value);
-uint64_t LargestPowerOf2Divisor(uint64_t value);
-int MaskToBit(uint64_t mask);
-
-
-template <typename T>
-T ReverseBytes(T value, int block_bytes_log2) {
-  DCHECK((sizeof(value) == 4) || (sizeof(value) == 8));
-  DCHECK((1U << block_bytes_log2) <= sizeof(value));
-  // Split the 64-bit value into an 8-bit array, where b[0] is the least
-  // significant byte, and b[7] is the most significant.
-  uint8_t bytes[8];
-  uint64_t mask = 0xff00000000000000;
-  for (int i = 7; i >= 0; i--) {
-    bytes[i] = (static_cast<uint64_t>(value) & mask) >> (i * 8);
-    mask >>= 8;
-  }
-
-  // Permutation tables for REV instructions.
-  //  permute_table[0] is used by REV16_x, REV16_w
-  //  permute_table[1] is used by REV32_x, REV_w
-  //  permute_table[2] is used by REV_x
-  DCHECK((0 < block_bytes_log2) && (block_bytes_log2 < 4));
-  static const uint8_t permute_table[3][8] = {{6, 7, 4, 5, 2, 3, 0, 1},
-                                              {4, 5, 6, 7, 0, 1, 2, 3},
-                                              {0, 1, 2, 3, 4, 5, 6, 7}};
-  T result = 0;
-  for (int i = 0; i < 8; i++) {
-    result <<= 8;
-    result |= bytes[permute_table[block_bytes_log2 - 1][i]];
-  }
-  return result;
-}
-
-
-// NaN tests.
-inline bool IsSignallingNaN(double num) {
-  uint64_t raw = bit_cast<uint64_t>(num);
-  if (std::isnan(num) && ((raw & kDQuietNanMask) == 0)) {
-    return true;
-  }
-  return false;
-}
-
-
-inline bool IsSignallingNaN(float num) {
-  uint32_t raw = bit_cast<uint32_t>(num);
-  if (std::isnan(num) && ((raw & kSQuietNanMask) == 0)) {
-    return true;
-  }
-  return false;
-}
-
-inline bool IsSignallingNaN(float16 num) {
-  const uint16_t kFP16QuietNaNMask = 0x0200;
-  return (float16classify(num) == FP_NAN) && ((num & kFP16QuietNaNMask) == 0);
-}
-
-template <typename T>
-inline bool IsQuietNaN(T num) {
-  return std::isnan(num) && !IsSignallingNaN(num);
-}
-
-
-// Convert the NaN in 'num' to a quiet NaN.
-inline double ToQuietNaN(double num) {
-  DCHECK(std::isnan(num));
-  return bit_cast<double>(bit_cast<uint64_t>(num) | kDQuietNanMask);
-}
-
-
-inline float ToQuietNaN(float num) {
-  DCHECK(std::isnan(num));
-  return bit_cast<float>(bit_cast<uint32_t>(num) |
-                         static_cast<uint32_t>(kSQuietNanMask));
-}
-
-
-// Fused multiply-add.
-inline double FusedMultiplyAdd(double op1, double op2, double a) {
-  return fma(op1, op2, a);
-}
-
-
-inline float FusedMultiplyAdd(float op1, float op2, float a) {
-  return fmaf(op1, op2, a);
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_ARM64_UTILS_ARM64_H_
diff --git a/src/v8/src/asmjs/switch-logic.cc b/src/v8/src/asmjs/switch-logic.cc
deleted file mode 100644
index e12b3a3..0000000
--- a/src/v8/src/asmjs/switch-logic.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2016 the V8 project 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 <algorithm>
-
-#include "src/asmjs/switch-logic.h"
-
-namespace v8 {
-namespace internal {
-namespace wasm {
-
-namespace {
-CaseNode* CreateBst(ZoneVector<CaseNode*>* nodes, size_t begin, size_t end) {
-  if (end < begin) {
-    return nullptr;
-  } else if (end == begin) {
-    return nodes->at(begin);
-  } else {
-    size_t root_index = (begin + end) / 2;
-    CaseNode* root = nodes->at(root_index);
-    if (root_index != 0) {
-      root->left = CreateBst(nodes, begin, root_index - 1);
-    }
-    root->right = CreateBst(nodes, root_index + 1, end);
-    return root;
-  }
-}
-}  // namespace
-
-CaseNode* OrderCases(ZoneVector<int>* cases, Zone* zone) {
-  const int max_distance = 2;
-  const int min_size = 4;
-  if (cases->empty()) {
-    return nullptr;
-  }
-  std::sort(cases->begin(), cases->end());
-  ZoneVector<size_t> table_breaks(zone);
-  for (size_t i = 1; i < cases->size(); ++i) {
-    if (cases->at(i) - cases->at(i - 1) > max_distance) {
-      table_breaks.push_back(i);
-    }
-  }
-  table_breaks.push_back(cases->size());
-  ZoneVector<CaseNode*> nodes(zone);
-  size_t curr_pos = 0;
-  for (size_t i = 0; i < table_breaks.size(); ++i) {
-    size_t break_pos = table_breaks[i];
-    if (break_pos - curr_pos >= min_size) {
-      int begin = cases->at(curr_pos);
-      int end = cases->at(break_pos - 1);
-      nodes.push_back(new (zone) CaseNode(begin, end));
-      curr_pos = break_pos;
-    } else {
-      for (; curr_pos < break_pos; curr_pos++) {
-        nodes.push_back(new (zone)
-                            CaseNode(cases->at(curr_pos), cases->at(curr_pos)));
-      }
-    }
-  }
-  return CreateBst(&nodes, 0, nodes.size() - 1);
-}
-}  // namespace wasm
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/asmjs/switch-logic.h b/src/v8/src/asmjs/switch-logic.h
deleted file mode 100644
index 3ef34d9..0000000
--- a/src/v8/src/asmjs/switch-logic.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_ASMJS_SWITCH_LOGIC_H
-#define V8_ASMJS_SWITCH_LOGIC_H
-
-#include "src/globals.h"
-#include "src/zone/zone-containers.h"
-#include "src/zone/zone.h"
-
-namespace v8 {
-namespace internal {
-namespace wasm {
-
-struct CaseNode : public ZoneObject {
-  const int begin;
-  const int end;
-  CaseNode* left;
-  CaseNode* right;
-  CaseNode(int begin, int end) : begin(begin), end(end) {
-    left = nullptr;
-    right = nullptr;
-  }
-};
-
-V8_EXPORT_PRIVATE CaseNode* OrderCases(ZoneVector<int>* cases, Zone* zone);
-
-}  // namespace wasm
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_ASMJS_SWITCH_LOGIC_H
diff --git a/src/v8/src/ast/ast-numbering.cc b/src/v8/src/ast/ast-numbering.cc
deleted file mode 100644
index ade1a85..0000000
--- a/src/v8/src/ast/ast-numbering.cc
+++ /dev/null
@@ -1,410 +0,0 @@
-// Copyright 2012 the V8 project 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 "src/ast/ast-numbering.h"
-
-#include "src/ast/ast.h"
-#include "src/ast/scopes.h"
-#include "src/compiler.h"
-#include "src/objects-inl.h"
-
-namespace v8 {
-namespace internal {
-
-class AstNumberingVisitor final : public AstVisitor<AstNumberingVisitor> {
- public:
-  AstNumberingVisitor(uintptr_t stack_limit, Zone* zone,
-                      Compiler::EagerInnerFunctionLiterals* eager_literals)
-      : zone_(zone), eager_literals_(eager_literals), suspend_count_(0) {
-    InitializeAstVisitor(stack_limit);
-  }
-
-  bool Renumber(FunctionLiteral* node);
-
- private:
-// AST node visitor interface.
-#define DEFINE_VISIT(type) void Visit##type(type* node);
-  AST_NODE_LIST(DEFINE_VISIT)
-#undef DEFINE_VISIT
-
-  void VisitSuspend(Suspend* node);
-
-  void VisitStatementsAndDeclarations(Block* node);
-  void VisitStatements(ZoneList<Statement*>* statements);
-  void VisitDeclarations(Declaration::List* declarations);
-  void VisitArguments(ZoneList<Expression*>* arguments);
-  void VisitLiteralProperty(LiteralProperty* property);
-
-  Zone* zone() const { return zone_; }
-
-  Zone* zone_;
-  Compiler::EagerInnerFunctionLiterals* eager_literals_;
-  int suspend_count_;
-  FunctionKind function_kind_;
-
-  DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
-  DISALLOW_COPY_AND_ASSIGN(AstNumberingVisitor);
-};
-
-void AstNumberingVisitor::VisitVariableDeclaration(VariableDeclaration* node) {
-  VisitVariableProxy(node->proxy());
-}
-
-void AstNumberingVisitor::VisitEmptyStatement(EmptyStatement* node) {
-}
-
-void AstNumberingVisitor::VisitSloppyBlockFunctionStatement(
-    SloppyBlockFunctionStatement* node) {
-  Visit(node->statement());
-}
-
-void AstNumberingVisitor::VisitContinueStatement(ContinueStatement* node) {
-}
-
-void AstNumberingVisitor::VisitBreakStatement(BreakStatement* node) {
-}
-
-void AstNumberingVisitor::VisitDebuggerStatement(DebuggerStatement* node) {
-}
-
-void AstNumberingVisitor::VisitNativeFunctionLiteral(
-    NativeFunctionLiteral* node) {
-}
-
-void AstNumberingVisitor::VisitDoExpression(DoExpression* node) {
-  Visit(node->block());
-  Visit(node->result());
-}
-
-void AstNumberingVisitor::VisitLiteral(Literal* node) {
-}
-
-void AstNumberingVisitor::VisitRegExpLiteral(RegExpLiteral* node) {
-}
-
-void AstNumberingVisitor::VisitVariableProxy(VariableProxy* node) {
-}
-
-void AstNumberingVisitor::VisitThisFunction(ThisFunction* node) {
-}
-
-void AstNumberingVisitor::VisitSuperPropertyReference(
-    SuperPropertyReference* node) {
-  Visit(node->this_var());
-  Visit(node->home_object());
-}
-
-void AstNumberingVisitor::VisitSuperCallReference(SuperCallReference* node) {
-  Visit(node->this_var());
-  Visit(node->new_target_var());
-  Visit(node->this_function_var());
-}
-
-void AstNumberingVisitor::VisitExpressionStatement(ExpressionStatement* node) {
-  Visit(node->expression());
-}
-
-void AstNumberingVisitor::VisitReturnStatement(ReturnStatement* node) {
-  Visit(node->expression());
-}
-
-void AstNumberingVisitor::VisitSuspend(Suspend* node) {
-  node->set_suspend_id(suspend_count_);
-  suspend_count_++;
-  Visit(node->expression());
-}
-
-void AstNumberingVisitor::VisitYield(Yield* node) { VisitSuspend(node); }
-
-void AstNumberingVisitor::VisitYieldStar(YieldStar* node) {
-  node->set_suspend_id(suspend_count_++);
-  if (IsAsyncGeneratorFunction(function_kind_)) {
-    node->set_await_iterator_close_suspend_id(suspend_count_++);
-    node->set_await_delegated_iterator_output_suspend_id(suspend_count_++);
-  }
-  Visit(node->expression());
-}
-
-void AstNumberingVisitor::VisitAwait(Await* node) { VisitSuspend(node); }
-
-void AstNumberingVisitor::VisitThrow(Throw* node) {
-  Visit(node->exception());
-}
-
-void AstNumberingVisitor::VisitUnaryOperation(UnaryOperation* node) {
-  Visit(node->expression());
-}
-
-void AstNumberingVisitor::VisitCountOperation(CountOperation* node) {
-  Visit(node->expression());
-}
-
-void AstNumberingVisitor::VisitBlock(Block* node) {
-  VisitStatementsAndDeclarations(node);
-}
-
-void AstNumberingVisitor::VisitStatementsAndDeclarations(Block* node) {
-  Scope* scope = node->scope();
-  DCHECK(scope == nullptr || !scope->HasBeenRemoved());
-  if (scope) VisitDeclarations(scope->declarations());
-  VisitStatements(node->statements());
-}
-
-void AstNumberingVisitor::VisitFunctionDeclaration(FunctionDeclaration* node) {
-  VisitVariableProxy(node->proxy());
-  VisitFunctionLiteral(node->fun());
-}
-
-void AstNumberingVisitor::VisitCallRuntime(CallRuntime* node) {
-  VisitArguments(node->arguments());
-}
-
-void AstNumberingVisitor::VisitWithStatement(WithStatement* node) {
-  Visit(node->expression());
-  Visit(node->statement());
-}
-
-void AstNumberingVisitor::VisitDoWhileStatement(DoWhileStatement* node) {
-  node->set_first_suspend_id(suspend_count_);
-  Visit(node->body());
-  Visit(node->cond());
-  node->set_suspend_count(suspend_count_ - node->first_suspend_id());
-}
-
-void AstNumberingVisitor::VisitWhileStatement(WhileStatement* node) {
-  node->set_first_suspend_id(suspend_count_);
-  Visit(node->cond());
-  Visit(node->body());
-  node->set_suspend_count(suspend_count_ - node->first_suspend_id());
-}
-
-void AstNumberingVisitor::VisitTryCatchStatement(TryCatchStatement* node) {
-  DCHECK(node->scope() == nullptr || !node->scope()->HasBeenRemoved());
-  Visit(node->try_block());
-  Visit(node->catch_block());
-}
-
-void AstNumberingVisitor::VisitTryFinallyStatement(TryFinallyStatement* node) {
-  Visit(node->try_block());
-  Visit(node->finally_block());
-}
-
-void AstNumberingVisitor::VisitProperty(Property* node) {
-  Visit(node->key());
-  Visit(node->obj());
-}
-
-void AstNumberingVisitor::VisitResolvedProperty(ResolvedProperty* node) {
-  Visit(node->object());
-  Visit(node->property());
-}
-
-void AstNumberingVisitor::VisitAssignment(Assignment* node) {
-  Visit(node->target());
-  Visit(node->value());
-}
-
-void AstNumberingVisitor::VisitCompoundAssignment(CompoundAssignment* node) {
-  VisitBinaryOperation(node->binary_operation());
-  VisitAssignment(node);
-}
-
-void AstNumberingVisitor::VisitBinaryOperation(BinaryOperation* node) {
-  Visit(node->left());
-  Visit(node->right());
-}
-
-void AstNumberingVisitor::VisitNaryOperation(NaryOperation* node) {
-  Visit(node->first());
-  for (size_t i = 0; i < node->subsequent_length(); ++i) {
-    Visit(node->subsequent(i));
-  }
-}
-
-void AstNumberingVisitor::VisitCompareOperation(CompareOperation* node) {
-  Visit(node->left());
-  Visit(node->right());
-}
-
-void AstNumberingVisitor::VisitSpread(Spread* node) {
-  Visit(node->expression());
-}
-
-void AstNumberingVisitor::VisitEmptyParentheses(EmptyParentheses* node) {
-  UNREACHABLE();
-}
-
-void AstNumberingVisitor::VisitGetIterator(GetIterator* node) {
-  Visit(node->iterable());
-}
-
-void AstNumberingVisitor::VisitGetTemplateObject(GetTemplateObject* node) {}
-
-void AstNumberingVisitor::VisitImportCallExpression(
-    ImportCallExpression* node) {
-  Visit(node->argument());
-}
-
-void AstNumberingVisitor::VisitForInStatement(ForInStatement* node) {
-  Visit(node->enumerable());  // Not part of loop.
-  node->set_first_suspend_id(suspend_count_);
-  Visit(node->each());
-  Visit(node->body());
-  node->set_suspend_count(suspend_count_ - node->first_suspend_id());
-}
-
-void AstNumberingVisitor::VisitForOfStatement(ForOfStatement* node) {
-  Visit(node->assign_iterator());  // Not part of loop.
-  Visit(node->assign_next());
-  node->set_first_suspend_id(suspend_count_);
-  Visit(node->next_result());
-  Visit(node->result_done());
-  Visit(node->assign_each());
-  Visit(node->body());
-  node->set_suspend_count(suspend_count_ - node->first_suspend_id());
-}
-
-void AstNumberingVisitor::VisitConditional(Conditional* node) {
-  Visit(node->condition());
-  Visit(node->then_expression());
-  Visit(node->else_expression());
-}
-
-void AstNumberingVisitor::VisitIfStatement(IfStatement* node) {
-  Visit(node->condition());
-  Visit(node->then_statement());
-  if (node->HasElseStatement()) {
-    Visit(node->else_statement());
-  }
-}
-
-void AstNumberingVisitor::VisitSwitchStatement(SwitchStatement* node) {
-  Visit(node->tag());
-  for (CaseClause* clause : *node->cases()) {
-    if (!clause->is_default()) Visit(clause->label());
-    VisitStatements(clause->statements());
-  }
-}
-
-void AstNumberingVisitor::VisitForStatement(ForStatement* node) {
-  if (node->init() != nullptr) Visit(node->init());  // Not part of loop.
-  node->set_first_suspend_id(suspend_count_);
-  if (node->cond() != nullptr) Visit(node->cond());
-  if (node->next() != nullptr) Visit(node->next());
-  Visit(node->body());
-  node->set_suspend_count(suspend_count_ - node->first_suspend_id());
-}
-
-void AstNumberingVisitor::VisitClassLiteral(ClassLiteral* node) {
-  if (node->extends()) Visit(node->extends());
-  if (node->constructor()) Visit(node->constructor());
-  if (node->static_fields_initializer() != nullptr) {
-    Visit(node->static_fields_initializer());
-  }
-  if (node->instance_fields_initializer_function() != nullptr) {
-    Visit(node->instance_fields_initializer_function());
-  }
-  for (int i = 0; i < node->properties()->length(); i++) {
-    VisitLiteralProperty(node->properties()->at(i));
-  }
-}
-
-void AstNumberingVisitor::VisitInitializeClassFieldsStatement(
-    InitializeClassFieldsStatement* node) {
-  for (int i = 0; i < node->fields()->length(); i++) {
-    VisitLiteralProperty(node->fields()->at(i));
-  }
-}
-
-void AstNumberingVisitor::VisitObjectLiteral(ObjectLiteral* node) {
-  for (int i = 0; i < node->properties()->length(); i++) {
-    VisitLiteralProperty(node->properties()->at(i));
-  }
-}
-
-void AstNumberingVisitor::VisitLiteralProperty(LiteralProperty* node) {
-  Visit(node->key());
-  Visit(node->value());
-}
-
-void AstNumberingVisitor::VisitArrayLiteral(ArrayLiteral* node) {
-  for (int i = 0; i < node->values()->length(); i++) {
-    Visit(node->values()->at(i));
-  }
-}
-
-void AstNumberingVisitor::VisitCall(Call* node) {
-  Visit(node->expression());
-  VisitArguments(node->arguments());
-}
-
-void AstNumberingVisitor::VisitCallNew(CallNew* node) {
-  Visit(node->expression());
-  VisitArguments(node->arguments());
-}
-
-void AstNumberingVisitor::VisitStatements(ZoneList<Statement*>* statements) {
-  if (statements == nullptr) return;
-  for (int i = 0; i < statements->length(); i++) {
-    Visit(statements->at(i));
-    if (statements->at(i)->IsJump()) break;
-  }
-}
-
-void AstNumberingVisitor::VisitDeclarations(Declaration::List* decls) {
-  for (Declaration* decl : *decls) Visit(decl);
-}
-
-void AstNumberingVisitor::VisitArguments(ZoneList<Expression*>* arguments) {
-  for (int i = 0; i < arguments->length(); i++) {
-    Visit(arguments->at(i));
-  }
-}
-
-void AstNumberingVisitor::VisitFunctionLiteral(FunctionLiteral* node) {
-  if (node->ShouldEagerCompile()) {
-    if (eager_literals_) {
-      eager_literals_->Add(new (zone())
-                               ThreadedListZoneEntry<FunctionLiteral*>(node));
-    }
-
-    // If the function literal is being eagerly compiled, recurse into the
-    // declarations and body of the function literal.
-    if (!AstNumbering::Renumber(stack_limit_, zone_, node, eager_literals_)) {
-      SetStackOverflow();
-      return;
-    }
-  }
-}
-
-void AstNumberingVisitor::VisitRewritableExpression(
-    RewritableExpression* node) {
-  Visit(node->expression());
-}
-
-bool AstNumberingVisitor::Renumber(FunctionLiteral* node) {
-  DeclarationScope* scope = node->scope();
-  DCHECK(!scope->HasBeenRemoved());
-  function_kind_ = node->kind();
-
-  VisitDeclarations(scope->declarations());
-  VisitStatements(node->body());
-
-  node->set_suspend_count(suspend_count_);
-
-  return !HasStackOverflow();
-}
-
-bool AstNumbering::Renumber(
-    uintptr_t stack_limit, Zone* zone, FunctionLiteral* function,
-    Compiler::EagerInnerFunctionLiterals* eager_literals) {
-  DisallowHeapAllocation no_allocation;
-  DisallowHandleAllocation no_handles;
-  DisallowHandleDereference no_deref;
-
-  AstNumberingVisitor visitor(stack_limit, zone, eager_literals);
-  return visitor.Renumber(function);
-}
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/ast/ast-numbering.h b/src/v8/src/ast/ast-numbering.h
deleted file mode 100644
index 1112280..0000000
--- a/src/v8/src/ast/ast-numbering.h
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_AST_AST_NUMBERING_H_
-#define V8_AST_AST_NUMBERING_H_
-
-#include <stdint.h>
-
-namespace v8 {
-namespace internal {
-
-// Forward declarations.
-class FunctionLiteral;
-class Isolate;
-class Zone;
-template <typename T>
-class ThreadedList;
-template <typename T>
-class ThreadedListZoneEntry;
-template <typename T>
-class ZoneVector;
-
-namespace AstNumbering {
-// Assign bailout IDs, and generator suspend IDs to an AST node tree; perform
-// catch prediction for TryStatements. If |eager_literals| is non-null, adds any
-// eager inner literal functions into it.
-bool Renumber(
-    uintptr_t stack_limit, Zone* zone, FunctionLiteral* function,
-    ThreadedList<ThreadedListZoneEntry<FunctionLiteral*>>* eager_literals);
-}
-
-// Some details on suspend IDs
-// -------------------------
-//
-// In order to assist Ignition in generating bytecode for a generator function,
-// we assign a unique number (the suspend ID) to each Suspend node in its AST.
-// We also annotate loops with the number of suspends they contain
-// (loop.suspend_count) and the smallest ID of those (loop.first_suspend_id),
-// and we annotate the function itself with the number of suspends it contains
-// (function.suspend_count).
-//
-// The way in which we choose the IDs is simply by enumerating the Suspend
-// nodes.
-// Ignition relies on the following properties:
-// - For each loop l and each suspend y of l:
-//     l.first_suspend_id  <=
-//         s.suspend_id  < l.first_suspend_id + l.suspend_count
-// - For the generator function f itself and each suspend s of f:
-//                    0  <=  s.suspend_id  <  f.suspend_count
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_AST_AST_NUMBERING_H_
diff --git a/src/v8/src/ast/compile-time-value.cc b/src/v8/src/ast/compile-time-value.cc
deleted file mode 100644
index 4345e77..0000000
--- a/src/v8/src/ast/compile-time-value.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/ast/compile-time-value.h"
-
-#include "src/ast/ast.h"
-#include "src/factory.h"
-#include "src/handles-inl.h"
-#include "src/isolate.h"
-#include "src/objects-inl.h"
-
-namespace v8 {
-namespace internal {
-
-bool CompileTimeValue::IsCompileTimeValue(Expression* expression) {
-  if (expression->IsLiteral()) return true;
-  MaterializedLiteral* literal = expression->AsMaterializedLiteral();
-  if (literal == nullptr) return false;
-  return literal->IsSimple();
-}
-
-Handle<FixedArray> CompileTimeValue::GetValue(Isolate* isolate,
-                                              Expression* expression) {
-  Factory* factory = isolate->factory();
-  DCHECK(IsCompileTimeValue(expression));
-  Handle<FixedArray> result = factory->NewFixedArray(2, TENURED);
-  if (expression->IsObjectLiteral()) {
-    ObjectLiteral* object_literal = expression->AsObjectLiteral();
-    DCHECK(object_literal->is_simple());
-    int literalTypeFlag = object_literal->EncodeLiteralType();
-    DCHECK_NE(kArrayLiteralFlag, literalTypeFlag);
-    result->set(kLiteralTypeSlot, Smi::FromInt(literalTypeFlag));
-    result->set(kElementsSlot, *object_literal->constant_properties());
-  } else {
-    ArrayLiteral* array_literal = expression->AsArrayLiteral();
-    DCHECK(array_literal->is_simple());
-    result->set(kLiteralTypeSlot, Smi::FromInt(kArrayLiteralFlag));
-    result->set(kElementsSlot, *array_literal->constant_elements());
-  }
-  return result;
-}
-
-int CompileTimeValue::GetLiteralTypeFlags(Handle<FixedArray> value) {
-  return Smi::ToInt(value->get(kLiteralTypeSlot));
-}
-
-Handle<HeapObject> CompileTimeValue::GetElements(Handle<FixedArray> value) {
-  return Handle<HeapObject>(HeapObject::cast(value->get(kElementsSlot)));
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/ast/compile-time-value.h b/src/v8/src/ast/compile-time-value.h
deleted file mode 100644
index e8ded43..0000000
--- a/src/v8/src/ast/compile-time-value.h
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_AST_COMPILE_TIME_VALUE
-#define V8_AST_COMPILE_TIME_VALUE
-
-#include "src/allocation.h"
-#include "src/globals.h"
-
-namespace v8 {
-namespace internal {
-
-class Expression;
-
-// Support for handling complex values (array and object literals) that
-// can be fully handled at compile time.
-class CompileTimeValue : public AllStatic {
- public:
-  // This is a special marker used to encode array literals. The value has to be
-  // different from any value possibly returned by
-  // ObjectLiteral::EncodeLiteralType.
-  static const int kArrayLiteralFlag = -1;
-
-  static bool IsCompileTimeValue(Expression* expression);
-
-  // Get the value as a compile time value.
-  static Handle<FixedArray> GetValue(Isolate* isolate, Expression* expression);
-
-  // Get the encoded literal type. This can either be kArrayLiteralFlag or
-  // encoded properties of an ObjectLiteral returned by
-  // ObjectLiteral::EncodeLiteralType.
-  static int GetLiteralTypeFlags(Handle<FixedArray> value);
-
-  // Get the elements of a compile time value returned by GetValue().
-  static Handle<HeapObject> GetElements(Handle<FixedArray> value);
-
- private:
-  static const int kLiteralTypeSlot = 0;
-  static const int kElementsSlot = 1;
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_AST_COMPILE_TIME_VALUE
diff --git a/src/v8/src/ast/context-slot-cache.cc b/src/v8/src/ast/context-slot-cache.cc
deleted file mode 100644
index 88d5371..0000000
--- a/src/v8/src/ast/context-slot-cache.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/ast/context-slot-cache.h"
-
-#include <stdlib.h>
-
-#include "src/ast/scopes.h"
-#include "src/bootstrapper.h"
-#include "src/objects-inl.h"
-
-namespace v8 {
-namespace internal {
-
-int ContextSlotCache::Hash(Object* data, String* name) {
-  // Uses only lower 32 bits if pointers are larger.
-  uintptr_t addr_hash =
-      static_cast<uint32_t>(reinterpret_cast<uintptr_t>(data)) >> 2;
-  return static_cast<int>((addr_hash ^ name->Hash()) % kLength);
-}
-
-int ContextSlotCache::Lookup(Object* data, String* name, VariableMode* mode,
-                             InitializationFlag* init_flag,
-                             MaybeAssignedFlag* maybe_assigned_flag) {
-  int index = Hash(data, name);
-  DCHECK(name->IsInternalizedString());
-  Key& key = keys_[index];
-  if (key.data == data && key.name == name) {
-    Value result(values_[index]);
-    if (mode != nullptr) *mode = result.mode();
-    if (init_flag != nullptr) *init_flag = result.initialization_flag();
-    if (maybe_assigned_flag != nullptr)
-      *maybe_assigned_flag = result.maybe_assigned_flag();
-    return result.index() + kNotFound;
-  }
-  return kNotFound;
-}
-
-void ContextSlotCache::Update(Handle<Object> data, Handle<String> name,
-                              VariableMode mode, InitializationFlag init_flag,
-                              MaybeAssignedFlag maybe_assigned_flag,
-                              int slot_index) {
-  DCHECK(name->IsInternalizedString());
-  DCHECK_LT(kNotFound, slot_index);
-  int index = Hash(*data, *name);
-  Key& key = keys_[index];
-  key.data = *data;
-  key.name = *name;
-  // Please note value only takes a uint as index.
-  values_[index] =
-      Value(mode, init_flag, maybe_assigned_flag, slot_index - kNotFound).raw();
-#ifdef DEBUG
-  ValidateEntry(data, name, mode, init_flag, maybe_assigned_flag, slot_index);
-#endif
-}
-
-void ContextSlotCache::Clear() {
-  for (int index = 0; index < kLength; index++) keys_[index].data = nullptr;
-}
-
-#ifdef DEBUG
-
-void ContextSlotCache::ValidateEntry(Handle<Object> data, Handle<String> name,
-                                     VariableMode mode,
-                                     InitializationFlag init_flag,
-                                     MaybeAssignedFlag maybe_assigned_flag,
-                                     int slot_index) {
-  DCHECK(name->IsInternalizedString());
-  int index = Hash(*data, *name);
-  Key& key = keys_[index];
-  DCHECK_EQ(key.data, *data);
-  DCHECK_EQ(key.name, *name);
-  Value result(values_[index]);
-  DCHECK_EQ(result.mode(), mode);
-  DCHECK_EQ(result.initialization_flag(), init_flag);
-  DCHECK_EQ(result.maybe_assigned_flag(), maybe_assigned_flag);
-  DCHECK_EQ(result.index() + kNotFound, slot_index);
-}
-
-#endif  // DEBUG
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/ast/context-slot-cache.h b/src/v8/src/ast/context-slot-cache.h
deleted file mode 100644
index bf4a6d7..0000000
--- a/src/v8/src/ast/context-slot-cache.h
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_AST_CONTEXT_SLOT_CACHE_H_
-#define V8_AST_CONTEXT_SLOT_CACHE_H_
-
-#include "src/allocation.h"
-#include "src/ast/modules.h"
-
-namespace v8 {
-namespace internal {
-
-// Cache for mapping (data, property name) into context slot index.
-// The cache contains both positive and negative results.
-// Slot index equals -1 means the property is absent.
-// Cleared at startup and prior to mark sweep collection.
-class ContextSlotCache {
- public:
-  // Lookup context slot index for (data, name).
-  // If absent, kNotFound is returned.
-  int Lookup(Object* data, String* name, VariableMode* mode,
-             InitializationFlag* init_flag,
-             MaybeAssignedFlag* maybe_assigned_flag);
-
-  // Update an element in the cache.
-  void Update(Handle<Object> data, Handle<String> name, VariableMode mode,
-              InitializationFlag init_flag,
-              MaybeAssignedFlag maybe_assigned_flag, int slot_index);
-
-  // Clear the cache.
-  void Clear();
-
-  static const int kNotFound = -2;
-
- private:
-  ContextSlotCache() {
-    for (int i = 0; i < kLength; ++i) {
-      keys_[i].data = nullptr;
-      keys_[i].name = nullptr;
-      values_[i] = static_cast<uint32_t>(kNotFound);
-    }
-  }
-
-  inline static int Hash(Object* data, String* name);
-
-#ifdef DEBUG
-  void ValidateEntry(Handle<Object> data, Handle<String> name,
-                     VariableMode mode, InitializationFlag init_flag,
-                     MaybeAssignedFlag maybe_assigned_flag, int slot_index);
-#endif
-
-  static const int kLength = 256;
-  struct Key {
-    Object* data;
-    String* name;
-  };
-
-  struct Value {
-    Value(VariableMode mode, InitializationFlag init_flag,
-          MaybeAssignedFlag maybe_assigned_flag, int index) {
-      DCHECK(ModeField::is_valid(mode));
-      DCHECK(InitField::is_valid(init_flag));
-      DCHECK(MaybeAssignedField::is_valid(maybe_assigned_flag));
-      DCHECK(IndexField::is_valid(index));
-      value_ = ModeField::encode(mode) | IndexField::encode(index) |
-               InitField::encode(init_flag) |
-               MaybeAssignedField::encode(maybe_assigned_flag);
-      DCHECK(mode == this->mode());
-      DCHECK(init_flag == this->initialization_flag());
-      DCHECK(maybe_assigned_flag == this->maybe_assigned_flag());
-      DCHECK(index == this->index());
-    }
-
-    explicit inline Value(uint32_t value) : value_(value) {}
-
-    uint32_t raw() { return value_; }
-
-    VariableMode mode() { return ModeField::decode(value_); }
-
-    InitializationFlag initialization_flag() {
-      return InitField::decode(value_);
-    }
-
-    MaybeAssignedFlag maybe_assigned_flag() {
-      return MaybeAssignedField::decode(value_);
-    }
-
-    int index() { return IndexField::decode(value_); }
-
-    // Bit fields in value_ (type, shift, size). Must be public so the
-    // constants can be embedded in generated code.
-    class ModeField : public BitField<VariableMode, 0, 4> {};
-    class InitField : public BitField<InitializationFlag, 4, 1> {};
-    class MaybeAssignedField : public BitField<MaybeAssignedFlag, 5, 1> {};
-    class IndexField : public BitField<int, 6, 32 - 6> {};
-
-   private:
-    uint32_t value_;
-  };
-
-  Key keys_[kLength];
-  uint32_t values_[kLength];
-
-  friend class Isolate;
-  DISALLOW_COPY_AND_ASSIGN(ContextSlotCache);
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_AST_CONTEXT_SLOT_CACHE_H_
diff --git a/src/v8/src/base.isolate b/src/v8/src/base.isolate
deleted file mode 100644
index d482d75..0000000
--- a/src/v8/src/base.isolate
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'includes': [
-    '../third_party/icu/icu.isolate',
-
-    # MSVS runtime libraries.
-    '../gypfiles/win/msvs_dependencies.isolate',
-  ],
-  'conditions': [
-    ['v8_use_snapshot=="true" and v8_use_external_startup_data==1', {
-      'variables': {
-        'files': [
-          '<(PRODUCT_DIR)/natives_blob.bin',
-          '<(PRODUCT_DIR)/snapshot_blob.bin',
-        ],
-      },
-    }],
-    ['tsan==1', {
-      'variables': {
-        'files': [
-          '../tools/sanitizers/tsan_suppressions.txt',
-        ],
-      },
-    }],
-    ['asan==1 or cfi_vptr==1 or msan==1 or tsan==1 or ubsan_vptr==1', {
-      'variables': {
-        'files': [
-          '../third_party/llvm-build/Release+Asserts/bin/llvm-symbolizer<(EXECUTABLE_SUFFIX)',
-        ],
-      },
-    }],
-    # Workaround for https://code.google.com/p/swarming/issues/detail?id=211
-    ['asan==0 or cfi_vptr==0 or msan==0 or tsan==0 or ubsan_vptr==0 ', {
-      'variables': {},
-    }],
-  ],
-}
diff --git a/src/v8/src/base/format-macros.h b/src/v8/src/base/format-macros.h
deleted file mode 100644
index 36613d8..0000000
--- a/src/v8/src/base/format-macros.h
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef BASE_FORMAT_MACROS_H_
-#define BASE_FORMAT_MACROS_H_
-
-// This file defines the format macros for some integer types.
-
-// To print a 64-bit value in a portable way:
-//   int64_t value;
-//   printf("xyz:%" PRId64, value);
-// The "d" in the macro corresponds to %d; you can also use PRIu64 etc.
-//
-// For wide strings, prepend "Wide" to the macro:
-//   int64_t value;
-//   StringPrintf(L"xyz: %" WidePRId64, value);
-//
-// To print a size_t value in a portable way:
-//   size_t size;
-//   printf("xyz: %" PRIuS, size);
-// The "u" in the macro corresponds to %u, and S is for "size".
-
-#include <stddef.h>
-#include <stdint.h>
-
-#include "src/base/build_config.h"
-
-#if defined(V8_OS_POSIX) && (defined(_INTTYPES_H) || defined(_INTTYPES_H_)) && \
-    !defined(PRId64)
-#error "inttypes.h has already been included before this header file, but "
-#error "without __STDC_FORMAT_MACROS defined."
-#endif
-
-#if (defined(V8_OS_POSIX) || defined(V8_OS_STARBOARD)) && !defined(__STDC_FORMAT_MACROS)
-#define __STDC_FORMAT_MACROS
-#endif
-
-#include <inttypes.h>
-
-#if defined(V8_OS_POSIX) || defined(V8_OS_STARBOARD)
-
-// GCC will concatenate wide and narrow strings correctly, so nothing needs to
-// be done here.
-#define WidePRId64 PRId64
-#define WidePRIu64 PRIu64
-#define WidePRIx64 PRIx64
-
-#if !defined(PRIuS)
-#define PRIuS "zu"
-#endif
-
-// The size of NSInteger and NSUInteger varies between 32-bit and 64-bit
-// architectures and Apple does not provides standard format macros and
-// recommends casting. This has many drawbacks, so instead define macros
-// for formatting those types.
-#if defined(V8_OS_MACOSX)
-#if defined(V8_HOST_ARCH_64_BIT)
-#if !defined(PRIdNS)
-#define PRIdNS "ld"
-#endif
-#if !defined(PRIuNS)
-#define PRIuNS "lu"
-#endif
-#if !defined(PRIxNS)
-#define PRIxNS "lx"
-#endif
-#else  // defined(V8_HOST_ARCH_64_BIT)
-#if !defined(PRIdNS)
-#define PRIdNS "d"
-#endif
-#if !defined(PRIuNS)
-#define PRIuNS "u"
-#endif
-#if !defined(PRIxNS)
-#define PRIxNS "x"
-#endif
-#endif
-#endif  // defined(V8_OS_MACOSX)
-
-#else  // V8_OS_WIN
-
-#if !defined(PRId64) || !defined(PRIu64) || !defined(PRIx64)
-#error "inttypes.h provided by win toolchain should define these."
-#endif
-
-#define WidePRId64 L"I64d"
-#define WidePRIu64 L"I64u"
-#define WidePRIx64 L"I64x"
-
-#if !defined(PRIuS)
-#define PRIuS "Iu"
-#endif
-
-#endif
-
-#endif  // BASE_FORMAT_MACROS_H_
diff --git a/src/v8/src/base/safe_math.h b/src/v8/src/base/safe_math.h
deleted file mode 100644
index 62a2f72..0000000
--- a/src/v8/src/base/safe_math.h
+++ /dev/null
@@ -1,276 +0,0 @@
-// Copyright 2014 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.
-
-// Slightly adapted for inclusion in V8.
-// Copyright 2014 the V8 project authors. All rights reserved.
-
-#ifndef V8_BASE_SAFE_MATH_H_
-#define V8_BASE_SAFE_MATH_H_
-
-#include "src/base/safe_math_impl.h"
-
-namespace v8 {
-namespace base {
-namespace internal {
-
-// CheckedNumeric implements all the logic and operators for detecting integer
-// boundary conditions such as overflow, underflow, and invalid conversions.
-// The CheckedNumeric type implicitly converts from floating point and integer
-// data types, and contains overloads for basic arithmetic operations (i.e.: +,
-// -, *, /, %).
-//
-// The following methods convert from CheckedNumeric to standard numeric values:
-// IsValid() - Returns true if the underlying numeric value is valid (i.e. has
-//             has not wrapped and is not the result of an invalid conversion).
-// ValueOrDie() - Returns the underlying value. If the state is not valid this
-//                call will crash on a CHECK.
-// ValueOrDefault() - Returns the current value, or the supplied default if the
-//                    state is not valid.
-// ValueFloating() - Returns the underlying floating point value (valid only
-//                   only for floating point CheckedNumeric types).
-//
-// Bitwise operations are explicitly not supported, because correct
-// handling of some cases (e.g. sign manipulation) is ambiguous. Comparison
-// operations are explicitly not supported because they could result in a crash
-// on a CHECK condition. You should use patterns like the following for these
-// operations:
-// Bitwise operation:
-//     CheckedNumeric<int> checked_int = untrusted_input_value;
-//     int x = checked_int.ValueOrDefault(0) | kFlagValues;
-// Comparison:
-//   CheckedNumeric<size_t> checked_size;
-//   CheckedNumeric<int> checked_size = untrusted_input_value;
-//   checked_size = checked_size + HEADER LENGTH;
-//   if (checked_size.IsValid() && checked_size.ValueOrDie() < buffer_size)
-//     Do stuff...
-template <typename T>
-class CheckedNumeric {
- public:
-  typedef T type;
-
-  CheckedNumeric() {}
-
-  // Copy constructor.
-  template <typename Src>
-  CheckedNumeric(const CheckedNumeric<Src>& rhs)
-      : state_(rhs.ValueUnsafe(), rhs.validity()) {}
-
-  template <typename Src>
-  CheckedNumeric(Src value, RangeConstraint validity)
-      : state_(value, validity) {}
-
-  // This is not an explicit constructor because we implicitly upgrade regular
-  // numerics to CheckedNumerics to make them easier to use.
-  template <typename Src>
-  CheckedNumeric(Src value)  // NOLINT
-      : state_(value) {
-    // Argument must be numeric.
-    STATIC_ASSERT(std::numeric_limits<Src>::is_specialized);
-  }
-
-  // IsValid() is the public API to test if a CheckedNumeric is currently valid.
-  bool IsValid() const { return validity() == RANGE_VALID; }
-
-  // ValueOrDie() The primary accessor for the underlying value. If the current
-  // state is not valid it will CHECK and crash.
-  T ValueOrDie() const {
-    CHECK(IsValid());
-    return state_.value();
-  }
-
-  // ValueOrDefault(T default_value) A convenience method that returns the
-  // current value if the state is valid, and the supplied default_value for
-  // any other state.
-  T ValueOrDefault(T default_value) const {
-    return IsValid() ? state_.value() : default_value;
-  }
-
-  // ValueFloating() - Since floating point values include their validity state,
-  // we provide an easy method for extracting them directly, without a risk of
-  // crashing on a CHECK.
-  T ValueFloating() const {
-    // Argument must be a floating-point value.
-    STATIC_ASSERT(std::numeric_limits<T>::is_iec559);
-    return CheckedNumeric<T>::cast(*this).ValueUnsafe();
-  }
-
-  // validity() - DO NOT USE THIS IN EXTERNAL CODE - It is public right now for
-  // tests and to avoid a big matrix of friend operator overloads. But the
-  // values it returns are likely to change in the future.
-  // Returns: current validity state (i.e. valid, overflow, underflow, nan).
-  // TODO(jschuh): crbug.com/332611 Figure out and implement semantics for
-  // saturation/wrapping so we can expose this state consistently and implement
-  // saturated arithmetic.
-  RangeConstraint validity() const { return state_.validity(); }
-
-  // ValueUnsafe() - DO NOT USE THIS IN EXTERNAL CODE - It is public right now
-  // for tests and to avoid a big matrix of friend operator overloads. But the
-  // values it returns are likely to change in the future.
-  // Returns: the raw numeric value, regardless of the current state.
-  // TODO(jschuh): crbug.com/332611 Figure out and implement semantics for
-  // saturation/wrapping so we can expose this state consistently and implement
-  // saturated arithmetic.
-  T ValueUnsafe() const { return state_.value(); }
-
-  // Prototypes for the supported arithmetic operator overloads.
-  template <typename Src> CheckedNumeric& operator+=(Src rhs);
-  template <typename Src> CheckedNumeric& operator-=(Src rhs);
-  template <typename Src> CheckedNumeric& operator*=(Src rhs);
-  template <typename Src> CheckedNumeric& operator/=(Src rhs);
-  template <typename Src> CheckedNumeric& operator%=(Src rhs);
-
-  CheckedNumeric operator-() const {
-    RangeConstraint validity;
-    T value = CheckedNeg(state_.value(), &validity);
-    // Negation is always valid for floating point.
-    if (std::numeric_limits<T>::is_iec559)
-      return CheckedNumeric<T>(value);
-
-    validity = GetRangeConstraint(state_.validity() | validity);
-    return CheckedNumeric<T>(value, validity);
-  }
-
-  CheckedNumeric Abs() const {
-    RangeConstraint validity;
-    T value = CheckedAbs(state_.value(), &validity);
-    // Absolute value is always valid for floating point.
-    if (std::numeric_limits<T>::is_iec559)
-      return CheckedNumeric<T>(value);
-
-    validity = GetRangeConstraint(state_.validity() | validity);
-    return CheckedNumeric<T>(value, validity);
-  }
-
-  CheckedNumeric& operator++() {
-    *this += 1;
-    return *this;
-  }
-
-  CheckedNumeric operator++(int) {
-    CheckedNumeric value = *this;
-    *this += 1;
-    return value;
-  }
-
-  CheckedNumeric& operator--() {
-    *this -= 1;
-    return *this;
-  }
-
-  CheckedNumeric operator--(int) {
-    CheckedNumeric value = *this;
-    *this -= 1;
-    return value;
-  }
-
-  // These static methods behave like a convenience cast operator targeting
-  // the desired CheckedNumeric type. As an optimization, a reference is
-  // returned when Src is the same type as T.
-  template <typename Src>
-  static CheckedNumeric<T> cast(
-      Src u,
-      typename enable_if<std::numeric_limits<Src>::is_specialized, int>::type =
-          0) {
-    return u;
-  }
-
-  template <typename Src>
-  static CheckedNumeric<T> cast(
-      const CheckedNumeric<Src>& u,
-      typename enable_if<!is_same<Src, T>::value, int>::type = 0) {
-    return u;
-  }
-
-  static const CheckedNumeric<T>& cast(const CheckedNumeric<T>& u) { return u; }
-
- private:
-  CheckedNumericState<T> state_;
-};
-
-// This is the boilerplate for the standard arithmetic operator overloads. A
-// macro isn't the prettiest solution, but it beats rewriting these five times.
-// Some details worth noting are:
-//  * We apply the standard arithmetic promotions.
-//  * We skip range checks for floating points.
-//  * We skip range checks for destination integers with sufficient range.
-// TODO(jschuh): extract these out into templates.
-#define BASE_NUMERIC_ARITHMETIC_OPERATORS(NAME, OP, COMPOUND_OP)              \
-  /* Binary arithmetic operator for CheckedNumerics of the same type. */      \
-  template <typename T>                                                       \
-  CheckedNumeric<typename ArithmeticPromotion<T>::type> operator OP(          \
-      const CheckedNumeric<T>& lhs, const CheckedNumeric<T>& rhs) {           \
-    typedef typename ArithmeticPromotion<T>::type Promotion;                  \
-    /* Floating point always takes the fast path */                           \
-    if (std::numeric_limits<T>::is_iec559)                                    \
-      return CheckedNumeric<T>(lhs.ValueUnsafe() OP rhs.ValueUnsafe());       \
-    if (IsIntegerArithmeticSafe<Promotion, T, T>::value)                      \
-      return CheckedNumeric<Promotion>(                                       \
-          lhs.ValueUnsafe() OP rhs.ValueUnsafe(),                             \
-          GetRangeConstraint(rhs.validity() | lhs.validity()));               \
-    RangeConstraint validity = RANGE_VALID;                                   \
-    T result = Checked##NAME(static_cast<Promotion>(lhs.ValueUnsafe()),       \
-                             static_cast<Promotion>(rhs.ValueUnsafe()),       \
-                             &validity);                                      \
-    return CheckedNumeric<Promotion>(                                         \
-        result,                                                               \
-        GetRangeConstraint(validity | lhs.validity() | rhs.validity()));      \
-  }                                                                           \
-  /* Assignment arithmetic operator implementation from CheckedNumeric. */    \
-  template <typename T>                                                       \
-  template <typename Src>                                                     \
-  CheckedNumeric<T>& CheckedNumeric<T>::operator COMPOUND_OP(Src rhs) {       \
-    *this = CheckedNumeric<T>::cast(*this) OP CheckedNumeric<Src>::cast(rhs); \
-    return *this;                                                             \
-  }                                                                           \
-  /* Binary arithmetic operator for CheckedNumeric of different type. */      \
-  template <typename T, typename Src>                                         \
-  CheckedNumeric<typename ArithmeticPromotion<T, Src>::type> operator OP(     \
-      const CheckedNumeric<Src>& lhs, const CheckedNumeric<T>& rhs) {         \
-    typedef typename ArithmeticPromotion<T, Src>::type Promotion;             \
-    if (IsIntegerArithmeticSafe<Promotion, T, Src>::value)                    \
-      return CheckedNumeric<Promotion>(                                       \
-          lhs.ValueUnsafe() OP rhs.ValueUnsafe(),                             \
-          GetRangeConstraint(rhs.validity() | lhs.validity()));               \
-    return CheckedNumeric<Promotion>::cast(lhs)                               \
-        OP CheckedNumeric<Promotion>::cast(rhs);                              \
-  }                                                                           \
-  /* Binary arithmetic operator for left CheckedNumeric and right numeric. */ \
-  template <typename T, typename Src>                                         \
-  CheckedNumeric<typename ArithmeticPromotion<T, Src>::type> operator OP(     \
-      const CheckedNumeric<T>& lhs, Src rhs) {                                \
-    typedef typename ArithmeticPromotion<T, Src>::type Promotion;             \
-    if (IsIntegerArithmeticSafe<Promotion, T, Src>::value)                    \
-      return CheckedNumeric<Promotion>(lhs.ValueUnsafe() OP rhs,              \
-                                       lhs.validity());                       \
-    return CheckedNumeric<Promotion>::cast(lhs)                               \
-        OP CheckedNumeric<Promotion>::cast(rhs);                              \
-  }                                                                           \
-  /* Binary arithmetic operator for right numeric and left CheckedNumeric. */ \
-  template <typename T, typename Src>                                         \
-  CheckedNumeric<typename ArithmeticPromotion<T, Src>::type> operator OP(     \
-      Src lhs, const CheckedNumeric<T>& rhs) {                                \
-    typedef typename ArithmeticPromotion<T, Src>::type Promotion;             \
-    if (IsIntegerArithmeticSafe<Promotion, T, Src>::value)                    \
-      return CheckedNumeric<Promotion>(lhs OP rhs.ValueUnsafe(),              \
-                                       rhs.validity());                       \
-    return CheckedNumeric<Promotion>::cast(lhs)                               \
-        OP CheckedNumeric<Promotion>::cast(rhs);                              \
-  }
-
-BASE_NUMERIC_ARITHMETIC_OPERATORS(Add, +, += )
-BASE_NUMERIC_ARITHMETIC_OPERATORS(Sub, -, -= )
-BASE_NUMERIC_ARITHMETIC_OPERATORS(Mul, *, *= )
-BASE_NUMERIC_ARITHMETIC_OPERATORS(Div, /, /= )
-BASE_NUMERIC_ARITHMETIC_OPERATORS(Mod, %, %= )
-
-#undef BASE_NUMERIC_ARITHMETIC_OPERATORS
-
-}  // namespace internal
-
-using internal::CheckedNumeric;
-
-}  // namespace base
-}  // namespace v8
-
-#endif  // V8_BASE_SAFE_MATH_H_
diff --git a/src/v8/src/base/safe_math_impl.h b/src/v8/src/base/safe_math_impl.h
deleted file mode 100644
index c5a83ab..0000000
--- a/src/v8/src/base/safe_math_impl.h
+++ /dev/null
@@ -1,531 +0,0 @@
-// Copyright 2014 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.
-
-// Slightly adapted for inclusion in V8.
-// Copyright 2014 the V8 project authors. All rights reserved.
-
-#ifndef V8_BASE_SAFE_MATH_IMPL_H_
-#define V8_BASE_SAFE_MATH_IMPL_H_
-
-#include <stdint.h>
-
-#include <cmath>
-#include <cstdlib>
-#include <limits>
-
-#include "src/base/macros.h"
-#include "src/base/safe_conversions.h"
-
-namespace v8 {
-namespace base {
-namespace internal {
-
-
-// From Chromium's base/template_util.h:
-
-template<class T, T v>
-struct integral_constant {
-  static const T value = v;
-  typedef T value_type;
-  typedef integral_constant<T, v> type;
-};
-
-template <class T, T v> const T integral_constant<T, v>::value;
-
-typedef integral_constant<bool, true> true_type;
-typedef integral_constant<bool, false> false_type;
-
-template <class T, class U> struct is_same : public false_type {};
-template <class T> struct is_same<T, T> : true_type {};
-
-template<bool B, class T = void>
-struct enable_if {};
-
-template<class T>
-struct enable_if<true, T> { typedef T type; };
-
-// </template_util.h>
-
-
-// Everything from here up to the floating point operations is portable C++,
-// but it may not be fast. This code could be split based on
-// platform/architecture and replaced with potentially faster implementations.
-
-// Integer promotion templates used by the portable checked integer arithmetic.
-template <size_t Size, bool IsSigned>
-struct IntegerForSizeAndSign;
-template <>
-struct IntegerForSizeAndSign<1, true> {
-  typedef int8_t type;
-};
-template <>
-struct IntegerForSizeAndSign<1, false> {
-  typedef uint8_t type;
-};
-template <>
-struct IntegerForSizeAndSign<2, true> {
-  typedef int16_t type;
-};
-template <>
-struct IntegerForSizeAndSign<2, false> {
-  typedef uint16_t type;
-};
-template <>
-struct IntegerForSizeAndSign<4, true> {
-  typedef int32_t type;
-};
-template <>
-struct IntegerForSizeAndSign<4, false> {
-  typedef uint32_t type;
-};
-template <>
-struct IntegerForSizeAndSign<8, true> {
-  typedef int64_t type;
-};
-template <>
-struct IntegerForSizeAndSign<8, false> {
-  typedef uint64_t type;
-};
-
-// WARNING: We have no IntegerForSizeAndSign<16, *>. If we ever add one to
-// support 128-bit math, then the ArithmeticPromotion template below will need
-// to be updated (or more likely replaced with a decltype expression).
-
-template <typename Integer>
-struct UnsignedIntegerForSize {
-  typedef typename enable_if<
-      std::numeric_limits<Integer>::is_integer,
-      typename IntegerForSizeAndSign<sizeof(Integer), false>::type>::type type;
-};
-
-template <typename Integer>
-struct SignedIntegerForSize {
-  typedef typename enable_if<
-      std::numeric_limits<Integer>::is_integer,
-      typename IntegerForSizeAndSign<sizeof(Integer), true>::type>::type type;
-};
-
-template <typename Integer>
-struct TwiceWiderInteger {
-  typedef typename enable_if<
-      std::numeric_limits<Integer>::is_integer,
-      typename IntegerForSizeAndSign<
-          sizeof(Integer) * 2,
-          std::numeric_limits<Integer>::is_signed>::type>::type type;
-};
-
-template <typename Integer>
-struct PositionOfSignBit {
-  static const typename enable_if<std::numeric_limits<Integer>::is_integer,
-                                  size_t>::type value = 8 * sizeof(Integer) - 1;
-};
-
-// Helper templates for integer manipulations.
-
-template <typename T>
-bool HasSignBit(T x) {
-  // Cast to unsigned since right shift on signed is undefined.
-  return !!(static_cast<typename UnsignedIntegerForSize<T>::type>(x) >>
-            PositionOfSignBit<T>::value);
-}
-
-// This wrapper undoes the standard integer promotions.
-template <typename T>
-T BinaryComplement(T x) {
-  return ~x;
-}
-
-// Here are the actual portable checked integer math implementations.
-// TODO(jschuh): Break this code out from the enable_if pattern and find a clean
-// way to coalesce things into the CheckedNumericState specializations below.
-
-template <typename T>
-typename enable_if<std::numeric_limits<T>::is_integer, T>::type
-CheckedAdd(T x, T y, RangeConstraint* validity) {
-  // Since the value of x+y is undefined if we have a signed type, we compute
-  // it using the unsigned type of the same size.
-  typedef typename UnsignedIntegerForSize<T>::type UnsignedDst;
-  UnsignedDst ux = static_cast<UnsignedDst>(x);
-  UnsignedDst uy = static_cast<UnsignedDst>(y);
-  UnsignedDst uresult = ux + uy;
-  // Addition is valid if the sign of (x + y) is equal to either that of x or
-  // that of y.
-  if (std::numeric_limits<T>::is_signed) {
-    if (HasSignBit(BinaryComplement((uresult ^ ux) & (uresult ^ uy))))
-      *validity = RANGE_VALID;
-    else  // Direction of wrap is inverse of result sign.
-      *validity = HasSignBit(uresult) ? RANGE_OVERFLOW : RANGE_UNDERFLOW;
-
-  } else {  // Unsigned is either valid or overflow.
-    *validity = BinaryComplement(x) >= y ? RANGE_VALID : RANGE_OVERFLOW;
-  }
-  return static_cast<T>(uresult);
-}
-
-template <typename T>
-typename enable_if<std::numeric_limits<T>::is_integer, T>::type
-CheckedSub(T x, T y, RangeConstraint* validity) {
-  // Since the value of x+y is undefined if we have a signed type, we compute
-  // it using the unsigned type of the same size.
-  typedef typename UnsignedIntegerForSize<T>::type UnsignedDst;
-  UnsignedDst ux = static_cast<UnsignedDst>(x);
-  UnsignedDst uy = static_cast<UnsignedDst>(y);
-  UnsignedDst uresult = ux - uy;
-  // Subtraction is valid if either x and y have same sign, or (x-y) and x have
-  // the same sign.
-  if (std::numeric_limits<T>::is_signed) {
-    if (HasSignBit(BinaryComplement((uresult ^ ux) & (ux ^ uy))))
-      *validity = RANGE_VALID;
-    else  // Direction of wrap is inverse of result sign.
-      *validity = HasSignBit(uresult) ? RANGE_OVERFLOW : RANGE_UNDERFLOW;
-
-  } else {  // Unsigned is either valid or underflow.
-    *validity = x >= y ? RANGE_VALID : RANGE_UNDERFLOW;
-  }
-  return static_cast<T>(uresult);
-}
-
-// Integer multiplication is a bit complicated. In the fast case we just
-// we just promote to a twice wider type, and range check the result. In the
-// slow case we need to manually check that the result won't be truncated by
-// checking with division against the appropriate bound.
-template <typename T>
-typename enable_if<
-    std::numeric_limits<T>::is_integer && sizeof(T) * 2 <= sizeof(uintmax_t),
-    T>::type
-CheckedMul(T x, T y, RangeConstraint* validity) {
-  typedef typename TwiceWiderInteger<T>::type IntermediateType;
-  IntermediateType tmp =
-      static_cast<IntermediateType>(x) * static_cast<IntermediateType>(y);
-  *validity = DstRangeRelationToSrcRange<T>(tmp);
-  return static_cast<T>(tmp);
-}
-
-template <typename T>
-typename enable_if<std::numeric_limits<T>::is_integer &&
-                       std::numeric_limits<T>::is_signed &&
-                       (sizeof(T) * 2 > sizeof(uintmax_t)),
-                   T>::type
-CheckedMul(T x, T y, RangeConstraint* validity) {
-  // If either side is zero then the result will be zero.
-  if (!x || !y) {
-    return RANGE_VALID;
-
-  } else if (x > 0) {
-    if (y > 0)
-      *validity =
-          x <= std::numeric_limits<T>::max() / y ? RANGE_VALID : RANGE_OVERFLOW;
-    else
-      *validity = y >= std::numeric_limits<T>::min() / x ? RANGE_VALID
-                                                         : RANGE_UNDERFLOW;
-
-  } else {
-    if (y > 0)
-      *validity = x >= std::numeric_limits<T>::min() / y ? RANGE_VALID
-                                                         : RANGE_UNDERFLOW;
-    else
-      *validity =
-          y >= std::numeric_limits<T>::max() / x ? RANGE_VALID : RANGE_OVERFLOW;
-  }
-
-  return x * y;
-}
-
-template <typename T>
-typename enable_if<std::numeric_limits<T>::is_integer &&
-                       !std::numeric_limits<T>::is_signed &&
-                       (sizeof(T) * 2 > sizeof(uintmax_t)),
-                   T>::type
-CheckedMul(T x, T y, RangeConstraint* validity) {
-  *validity = (y == 0 || x <= std::numeric_limits<T>::max() / y)
-                  ? RANGE_VALID
-                  : RANGE_OVERFLOW;
-  return x * y;
-}
-
-// Division just requires a check for an invalid negation on signed min/-1.
-template <typename T>
-T CheckedDiv(
-    T x,
-    T y,
-    RangeConstraint* validity,
-    typename enable_if<std::numeric_limits<T>::is_integer, int>::type = 0) {
-  if (std::numeric_limits<T>::is_signed && x == std::numeric_limits<T>::min() &&
-      y == static_cast<T>(-1)) {
-    *validity = RANGE_OVERFLOW;
-    return std::numeric_limits<T>::min();
-  }
-
-  *validity = RANGE_VALID;
-  return x / y;
-}
-
-template <typename T>
-typename enable_if<
-    std::numeric_limits<T>::is_integer && std::numeric_limits<T>::is_signed,
-    T>::type
-CheckedMod(T x, T y, RangeConstraint* validity) {
-  *validity = y > 0 ? RANGE_VALID : RANGE_INVALID;
-  return x % y;
-}
-
-template <typename T>
-typename enable_if<
-    std::numeric_limits<T>::is_integer && !std::numeric_limits<T>::is_signed,
-    T>::type
-CheckedMod(T x, T y, RangeConstraint* validity) {
-  *validity = RANGE_VALID;
-  return x % y;
-}
-
-template <typename T>
-typename enable_if<
-    std::numeric_limits<T>::is_integer && std::numeric_limits<T>::is_signed,
-    T>::type
-CheckedNeg(T value, RangeConstraint* validity) {
-  *validity =
-      value != std::numeric_limits<T>::min() ? RANGE_VALID : RANGE_OVERFLOW;
-  // The negation of signed min is min, so catch that one.
-  return -value;
-}
-
-template <typename T>
-typename enable_if<
-    std::numeric_limits<T>::is_integer && !std::numeric_limits<T>::is_signed,
-    T>::type
-CheckedNeg(T value, RangeConstraint* validity) {
-  // The only legal unsigned negation is zero.
-  *validity = value ? RANGE_UNDERFLOW : RANGE_VALID;
-  return static_cast<T>(
-      -static_cast<typename SignedIntegerForSize<T>::type>(value));
-}
-
-template <typename T>
-typename enable_if<
-    std::numeric_limits<T>::is_integer && std::numeric_limits<T>::is_signed,
-    T>::type
-CheckedAbs(T value, RangeConstraint* validity) {
-  *validity =
-      value != std::numeric_limits<T>::min() ? RANGE_VALID : RANGE_OVERFLOW;
-  return abs(value);
-}
-
-template <typename T>
-typename enable_if<
-    std::numeric_limits<T>::is_integer && !std::numeric_limits<T>::is_signed,
-    T>::type
-CheckedAbs(T value, RangeConstraint* validity) {
-  // Absolute value of a positive is just its identiy.
-  *validity = RANGE_VALID;
-  return value;
-}
-
-// These are the floating point stubs that the compiler needs to see. Only the
-// negation operation is ever called.
-#define BASE_FLOAT_ARITHMETIC_STUBS(NAME)                        \
-  template <typename T>                                          \
-  typename enable_if<std::numeric_limits<T>::is_iec559, T>::type \
-  Checked##NAME(T, T, RangeConstraint*) {                        \
-    UNREACHABLE();                                               \
-    return 0;                                                    \
-  }
-
-BASE_FLOAT_ARITHMETIC_STUBS(Add)
-BASE_FLOAT_ARITHMETIC_STUBS(Sub)
-BASE_FLOAT_ARITHMETIC_STUBS(Mul)
-BASE_FLOAT_ARITHMETIC_STUBS(Div)
-BASE_FLOAT_ARITHMETIC_STUBS(Mod)
-
-#undef BASE_FLOAT_ARITHMETIC_STUBS
-
-template <typename T>
-typename enable_if<std::numeric_limits<T>::is_iec559, T>::type CheckedNeg(
-    T value,
-    RangeConstraint*) {
-  return -value;
-}
-
-template <typename T>
-typename enable_if<std::numeric_limits<T>::is_iec559, T>::type CheckedAbs(
-    T value,
-    RangeConstraint*) {
-  return abs(value);
-}
-
-// Floats carry around their validity state with them, but integers do not. So,
-// we wrap the underlying value in a specialization in order to hide that detail
-// and expose an interface via accessors.
-enum NumericRepresentation {
-  NUMERIC_INTEGER,
-  NUMERIC_FLOATING,
-  NUMERIC_UNKNOWN
-};
-
-template <typename NumericType>
-struct GetNumericRepresentation {
-  static const NumericRepresentation value =
-      std::numeric_limits<NumericType>::is_integer
-          ? NUMERIC_INTEGER
-          : (std::numeric_limits<NumericType>::is_iec559 ? NUMERIC_FLOATING
-                                                         : NUMERIC_UNKNOWN);
-};
-
-template <typename T, NumericRepresentation type =
-                          GetNumericRepresentation<T>::value>
-class CheckedNumericState {};
-
-// Integrals require quite a bit of additional housekeeping to manage state.
-template <typename T>
-class CheckedNumericState<T, NUMERIC_INTEGER> {
- private:
-  T value_;
-  RangeConstraint validity_;
-
- public:
-  template <typename Src, NumericRepresentation type>
-  friend class CheckedNumericState;
-
-  CheckedNumericState() : value_(0), validity_(RANGE_VALID) {}
-
-  template <typename Src>
-  CheckedNumericState(Src value, RangeConstraint validity)
-      : value_(value),
-        validity_(GetRangeConstraint(validity |
-                                     DstRangeRelationToSrcRange<T>(value))) {
-    // Argument must be numeric.
-    STATIC_ASSERT(std::numeric_limits<Src>::is_specialized);
-  }
-
-  // Copy constructor.
-  template <typename Src>
-  CheckedNumericState(const CheckedNumericState<Src>& rhs)
-      : value_(static_cast<T>(rhs.value())),
-        validity_(GetRangeConstraint(
-            rhs.validity() | DstRangeRelationToSrcRange<T>(rhs.value()))) {}
-
-  template <typename Src>
-  explicit CheckedNumericState(
-      Src value,
-      typename enable_if<std::numeric_limits<Src>::is_specialized, int>::type =
-          0)
-      : value_(static_cast<T>(value)),
-        validity_(DstRangeRelationToSrcRange<T>(value)) {}
-
-  RangeConstraint validity() const { return validity_; }
-  T value() const { return value_; }
-};
-
-// Floating points maintain their own validity, but need translation wrappers.
-template <typename T>
-class CheckedNumericState<T, NUMERIC_FLOATING> {
- private:
-  T value_;
-
- public:
-  template <typename Src, NumericRepresentation type>
-  friend class CheckedNumericState;
-
-  CheckedNumericState() : value_(0.0) {}
-
-  template <typename Src>
-  CheckedNumericState(
-      Src value,
-      RangeConstraint validity,
-      typename enable_if<std::numeric_limits<Src>::is_integer, int>::type = 0) {
-    switch (DstRangeRelationToSrcRange<T>(value)) {
-      case RANGE_VALID:
-        value_ = static_cast<T>(value);
-        break;
-
-      case RANGE_UNDERFLOW:
-        value_ = -std::numeric_limits<T>::infinity();
-        break;
-
-      case RANGE_OVERFLOW:
-        value_ = std::numeric_limits<T>::infinity();
-        break;
-
-      case RANGE_INVALID:
-        value_ = std::numeric_limits<T>::quiet_NaN();
-        break;
-    }
-  }
-
-  template <typename Src>
-  explicit CheckedNumericState(
-      Src value,
-      typename enable_if<std::numeric_limits<Src>::is_specialized, int>::type =
-          0)
-      : value_(static_cast<T>(value)) {}
-
-  // Copy constructor.
-  template <typename Src>
-  CheckedNumericState(const CheckedNumericState<Src>& rhs)
-      : value_(static_cast<T>(rhs.value())) {}
-
-  RangeConstraint validity() const {
-    return GetRangeConstraint(value_ <= std::numeric_limits<T>::max(),
-                              value_ >= -std::numeric_limits<T>::max());
-  }
-  T value() const { return value_; }
-};
-
-// For integers less than 128-bit and floats 32-bit or larger, we can distil
-// C/C++ arithmetic promotions down to two simple rules:
-// 1. The type with the larger maximum exponent always takes precedence.
-// 2. The resulting type must be promoted to at least an int.
-// The following template specializations implement that promotion logic.
-enum ArithmeticPromotionCategory {
-  LEFT_PROMOTION,
-  RIGHT_PROMOTION,
-  DEFAULT_PROMOTION
-};
-
-template <typename Lhs,
-          typename Rhs = Lhs,
-          ArithmeticPromotionCategory Promotion =
-              (MaxExponent<Lhs>::value > MaxExponent<Rhs>::value)
-                  ? (MaxExponent<Lhs>::value > MaxExponent<int>::value
-                         ? LEFT_PROMOTION
-                         : DEFAULT_PROMOTION)
-                  : (MaxExponent<Rhs>::value > MaxExponent<int>::value
-                         ? RIGHT_PROMOTION
-                         : DEFAULT_PROMOTION) >
-struct ArithmeticPromotion;
-
-template <typename Lhs, typename Rhs>
-struct ArithmeticPromotion<Lhs, Rhs, LEFT_PROMOTION> {
-  typedef Lhs type;
-};
-
-template <typename Lhs, typename Rhs>
-struct ArithmeticPromotion<Lhs, Rhs, RIGHT_PROMOTION> {
-  typedef Rhs type;
-};
-
-template <typename Lhs, typename Rhs>
-struct ArithmeticPromotion<Lhs, Rhs, DEFAULT_PROMOTION> {
-  typedef int type;
-};
-
-// We can statically check if operations on the provided types can wrap, so we
-// can skip the checked operations if they're not needed. So, for an integer we
-// care if the destination type preserves the sign and is twice the width of
-// the source.
-template <typename T, typename Lhs, typename Rhs>
-struct IsIntegerArithmeticSafe {
-  static const bool value = !std::numeric_limits<T>::is_iec559 &&
-                            StaticDstRangeRelationToSrcRange<T, Lhs>::value ==
-                                NUMERIC_RANGE_CONTAINED &&
-                            sizeof(T) >= (2 * sizeof(Lhs)) &&
-                            StaticDstRangeRelationToSrcRange<T, Rhs>::value !=
-                                NUMERIC_RANGE_CONTAINED &&
-                            sizeof(T) >= (2 * sizeof(Rhs));
-};
-
-}  // namespace internal
-}  // namespace base
-}  // namespace v8
-
-#endif  // V8_BASE_SAFE_MATH_IMPL_H_
diff --git a/src/v8/src/base/tsan.h b/src/v8/src/base/tsan.h
deleted file mode 100644
index 7cf68a6..0000000
--- a/src/v8/src/base/tsan.h
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_BASE_TSAN_H_
-#define V8_BASE_TSAN_H_
-
-namespace v8 {
-namespace base {
-
-// This file contains annotations for ThreadSanitizer (TSan), a race detector.
-// See
-// https://llvm.org/svn/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interface_ann.cc
-
-#if THREAD_SANITIZER
-
-#define TSAN_ANNOTATE_IGNORE_READS_BEGIN \
-  v8::base::AnnotateIgnoreReadsBegin(__FILE__, __LINE__)
-#define TSAN_ANNOTATE_IGNORE_READS_END \
-  v8::base::AnnotateIgnoreReadsEnd(__FILE__, __LINE__)
-#define TSAN_ANNOTATE_IGNORE_WRITES_BEGIN \
-  v8::base::AnnotateIgnoreWritesBegin(__FILE__, __LINE__)
-#define TSAN_ANNOTATE_IGNORE_WRITES_END \
-  v8::base::AnnotateIgnoreWritesEnd(__FILE__, __LINE__)
-
-extern "C" {
-
-void AnnotateIgnoreReadsBegin(const char* file, int line);
-void AnnotateIgnoreReadsEnd(const char* file, int line);
-void AnnotateIgnoreWritesBegin(const char* file, int line);
-void AnnotateIgnoreWritesEnd(const char* file, int line);
-
-}  // extern "C"
-
-#else
-
-#define TSAN_ANNOTATE_IGNORE_READS_BEGIN ((void)0)
-#define TSAN_ANNOTATE_IGNORE_READS_END ((void)0)
-#define TSAN_ANNOTATE_IGNORE_WRITES_BEGIN ((void)0)
-#define TSAN_ANNOTATE_IGNORE_WRITES_END ((void)0)
-
-#endif
-
-}  // namespace base
-}  // namespace v8
-
-#endif  // V8_BASE_TSAN_H_
diff --git a/src/v8/src/builtins/builtins-boolean.cc b/src/v8/src/builtins/builtins-boolean.cc
deleted file mode 100644
index dabd803..0000000
--- a/src/v8/src/builtins/builtins-boolean.cc
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/builtins/builtins-utils.h"
-#include "src/builtins/builtins.h"
-#include "src/counters.h"
-#include "src/objects-inl.h"
-
-namespace v8 {
-namespace internal {
-
-// -----------------------------------------------------------------------------
-// ES6 section 19.3 Boolean Objects
-
-// ES6 section 19.3.1.1 Boolean ( value ) for the [[Call]] case.
-BUILTIN(BooleanConstructor) {
-  HandleScope scope(isolate);
-  Handle<Object> value = args.atOrUndefined(isolate, 1);
-  return isolate->heap()->ToBoolean(value->BooleanValue());
-}
-
-// ES6 section 19.3.1.1 Boolean ( value ) for the [[Construct]] case.
-BUILTIN(BooleanConstructor_ConstructStub) {
-  HandleScope scope(isolate);
-  Handle<Object> value = args.atOrUndefined(isolate, 1);
-  Handle<JSFunction> target = args.target();
-  Handle<JSReceiver> new_target = Handle<JSReceiver>::cast(args.new_target());
-  DCHECK(*target == target->native_context()->boolean_function());
-  Handle<JSObject> result;
-  ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
-                                     JSObject::New(target, new_target));
-  Handle<JSValue>::cast(result)->set_value(
-      isolate->heap()->ToBoolean(value->BooleanValue()));
-  return *result;
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/builtins/builtins-interpreter.cc b/src/v8/src/builtins/builtins-interpreter.cc
deleted file mode 100644
index 64c43ee..0000000
--- a/src/v8/src/builtins/builtins-interpreter.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/builtins/builtins-utils.h"
-#include "src/builtins/builtins.h"
-#include "src/globals.h"
-#include "src/handles-inl.h"
-#include "src/objects-inl.h"
-
-namespace v8 {
-namespace internal {
-
-Handle<Code> Builtins::InterpreterPushArgsThenCall(
-    ConvertReceiverMode receiver_mode, InterpreterPushArgsMode mode) {
-  switch (mode) {
-    case InterpreterPushArgsMode::kJSFunction:
-      switch (receiver_mode) {
-        case ConvertReceiverMode::kNullOrUndefined:
-          return builtin_handle(
-              kInterpreterPushUndefinedAndArgsThenCallFunction);
-        case ConvertReceiverMode::kNotNullOrUndefined:
-        case ConvertReceiverMode::kAny:
-          return builtin_handle(kInterpreterPushArgsThenCallFunction);
-      }
-    case InterpreterPushArgsMode::kWithFinalSpread:
-      return builtin_handle(kInterpreterPushArgsThenCallWithFinalSpread);
-    case InterpreterPushArgsMode::kOther:
-      switch (receiver_mode) {
-        case ConvertReceiverMode::kNullOrUndefined:
-          return builtin_handle(kInterpreterPushUndefinedAndArgsThenCall);
-        case ConvertReceiverMode::kNotNullOrUndefined:
-        case ConvertReceiverMode::kAny:
-          return builtin_handle(kInterpreterPushArgsThenCall);
-      }
-  }
-  UNREACHABLE();
-}
-
-Handle<Code> Builtins::InterpreterPushArgsThenConstruct(
-    InterpreterPushArgsMode mode) {
-  switch (mode) {
-    case InterpreterPushArgsMode::kJSFunction:
-      return builtin_handle(kInterpreterPushArgsThenConstructFunction);
-    case InterpreterPushArgsMode::kWithFinalSpread:
-      return builtin_handle(kInterpreterPushArgsThenConstructWithFinalSpread);
-    case InterpreterPushArgsMode::kOther:
-      return builtin_handle(kInterpreterPushArgsThenConstruct);
-  }
-  UNREACHABLE();
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/builtins/builtins-intl.h b/src/v8/src/builtins/builtins-intl.h
deleted file mode 100644
index 8dda0c0..0000000
--- a/src/v8/src/builtins/builtins-intl.h
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_BUILTINS_BUILTINS_INTL_H_
-#define V8_BUILTINS_BUILTINS_INTL_H_
-
-#include <stdint.h>
-#include <vector>
-
-namespace v8 {
-namespace internal {
-
-struct NumberFormatSpan {
-  int32_t field_id;
-  int32_t begin_pos;
-  int32_t end_pos;
-
-  NumberFormatSpan() {}
-  NumberFormatSpan(int32_t field_id, int32_t begin_pos, int32_t end_pos)
-      : field_id(field_id), begin_pos(begin_pos), end_pos(end_pos) {}
-};
-
-std::vector<NumberFormatSpan> FlattenRegionsToParts(
-    std::vector<NumberFormatSpan>* regions);
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_BUILTINS_BUILTINS_H_
diff --git a/src/v8/src/builtins/builtins-typedarray-gen.cc b/src/v8/src/builtins/builtins-typedarray-gen.cc
deleted file mode 100644
index b830a85..0000000
--- a/src/v8/src/builtins/builtins-typedarray-gen.cc
+++ /dev/null
@@ -1,1113 +0,0 @@
-// Copyright 2017 the V8 project 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 "src/builtins/builtins-utils-gen.h"
-#include "src/builtins/builtins.h"
-#include "src/code-stub-assembler.h"
-#include "src/handles-inl.h"
-
-namespace v8 {
-namespace internal {
-
-using compiler::Node;
-template <class T>
-using TNode = compiler::TNode<T>;
-
-// This is needed for gc_mole which will compile this file without the full set
-// of GN defined macros.
-#ifndef V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP
-#define V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP 64
-#endif
-
-// -----------------------------------------------------------------------------
-// ES6 section 22.2 TypedArray Objects
-
-class TypedArrayBuiltinsAssembler : public CodeStubAssembler {
- public:
-  explicit TypedArrayBuiltinsAssembler(compiler::CodeAssemblerState* state)
-      : CodeStubAssembler(state) {}
-
- protected:
-  void GenerateTypedArrayPrototypeGetter(Node* context, Node* receiver,
-                                         const char* method_name,
-                                         int object_offset);
-  void GenerateTypedArrayPrototypeIterationMethod(Node* context, Node* receiver,
-                                                  const char* method_name,
-                                                  IterationKind iteration_kind);
-
-  void SetupTypedArray(TNode<JSTypedArray> holder, TNode<Smi> length,
-                       TNode<Number> byte_offset, TNode<Number> byte_length);
-  void AttachBuffer(TNode<JSTypedArray> holder, TNode<JSArrayBuffer> buffer,
-                    TNode<Map> map, TNode<Smi> length,
-                    TNode<Number> byte_offset);
-
-  TNode<Map> LoadMapForType(TNode<JSTypedArray> array);
-  TNode<UintPtrT> CalculateExternalPointer(TNode<UintPtrT> backing_store,
-                                           TNode<Number> byte_offset);
-  Node* LoadDataPtr(Node* typed_array);
-  TNode<BoolT> ByteLengthIsValid(TNode<Number> byte_length);
-
-  // Returns true if kind is either UINT8_ELEMENTS or UINT8_CLAMPED_ELEMENTS.
-  TNode<Word32T> IsUint8ElementsKind(TNode<Word32T> kind);
-
-  // Loads the element kind of TypedArray instance.
-  TNode<Word32T> LoadElementsKind(TNode<Object> typed_array);
-
-  // Returns the byte size of an element for a TypedArray elements kind.
-  TNode<IntPtrT> GetTypedArrayElementSize(TNode<Word32T> elements_kind);
-
-  // Fast path for setting a TypedArray (source) onto another TypedArray
-  // (target) at an element offset.
-  void SetTypedArraySource(TNode<Context> context, TNode<JSTypedArray> source,
-                           TNode<JSTypedArray> target, TNode<IntPtrT> offset,
-                           Label* call_runtime, Label* if_source_too_large);
-
-  void SetJSArraySource(TNode<Context> context, TNode<JSArray> source,
-                        TNode<JSTypedArray> target, TNode<IntPtrT> offset,
-                        Label* call_runtime, Label* if_source_too_large);
-
-  void CallCMemmove(TNode<IntPtrT> dest_ptr, TNode<IntPtrT> src_ptr,
-                    TNode<IntPtrT> byte_length);
-
-  void CallCCopyFastNumberJSArrayElementsToTypedArray(
-      TNode<Context> context, TNode<JSArray> source, TNode<JSTypedArray> dest,
-      TNode<IntPtrT> source_length, TNode<IntPtrT> offset);
-
-  void CallCCopyTypedArrayElementsToTypedArray(TNode<JSTypedArray> source,
-                                               TNode<JSTypedArray> dest,
-                                               TNode<IntPtrT> source_length,
-                                               TNode<IntPtrT> offset);
-};
-
-TNode<Map> TypedArrayBuiltinsAssembler::LoadMapForType(
-    TNode<JSTypedArray> array) {
-  Label unreachable(this), done(this);
-  Label uint8_elements(this), uint8_clamped_elements(this), int8_elements(this),
-      uint16_elements(this), int16_elements(this), uint32_elements(this),
-      int32_elements(this), float32_elements(this), float64_elements(this);
-  Label* elements_kind_labels[] = {
-      &uint8_elements,  &uint8_clamped_elements, &int8_elements,
-      &uint16_elements, &int16_elements,         &uint32_elements,
-      &int32_elements,  &float32_elements,       &float64_elements};
-  int32_t elements_kinds[] = {
-      UINT8_ELEMENTS,  UINT8_CLAMPED_ELEMENTS, INT8_ELEMENTS,
-      UINT16_ELEMENTS, INT16_ELEMENTS,         UINT32_ELEMENTS,
-      INT32_ELEMENTS,  FLOAT32_ELEMENTS,       FLOAT64_ELEMENTS};
-  const size_t kTypedElementsKindCount = LAST_FIXED_TYPED_ARRAY_ELEMENTS_KIND -
-                                         FIRST_FIXED_TYPED_ARRAY_ELEMENTS_KIND +
-                                         1;
-  DCHECK_EQ(kTypedElementsKindCount, arraysize(elements_kinds));
-  DCHECK_EQ(kTypedElementsKindCount, arraysize(elements_kind_labels));
-
-  TVARIABLE(Map, var_typed_map);
-
-  TNode<Map> array_map = LoadMap(array);
-  TNode<Int32T> elements_kind = LoadMapElementsKind(array_map);
-  Switch(elements_kind, &unreachable, elements_kinds, elements_kind_labels,
-         kTypedElementsKindCount);
-
-  for (int i = 0; i < static_cast<int>(kTypedElementsKindCount); i++) {
-    BIND(elements_kind_labels[i]);
-    {
-      ElementsKind kind = static_cast<ElementsKind>(elements_kinds[i]);
-      ExternalArrayType type =
-          isolate()->factory()->GetArrayTypeFromElementsKind(kind);
-      Handle<Map> map(isolate()->heap()->MapForFixedTypedArray(type));
-      var_typed_map = HeapConstant(map);
-      Goto(&done);
-    }
-  }
-
-  BIND(&unreachable);
-  { Unreachable(); }
-  BIND(&done);
-  return var_typed_map;
-}
-
-// The byte_offset can be higher than Smi range, in which case to perform the
-// pointer arithmetic necessary to calculate external_pointer, converting
-// byte_offset to an intptr is more difficult. The max byte_offset is 8 * MaxSmi
-// on the particular platform. 32 bit platforms are self-limiting, because we
-// can't allocate an array bigger than our 32-bit arithmetic range anyway. 64
-// bit platforms could theoretically have an offset up to 2^35 - 1, so we may
-// need to convert the float heap number to an intptr.
-TNode<UintPtrT> TypedArrayBuiltinsAssembler::CalculateExternalPointer(
-    TNode<UintPtrT> backing_store, TNode<Number> byte_offset) {
-  return Unsigned(
-      IntPtrAdd(backing_store, ChangeNonnegativeNumberToUintPtr(byte_offset)));
-}
-
-// Setup the TypedArray which is under construction.
-//  - Set the length.
-//  - Set the byte_offset.
-//  - Set the byte_length.
-//  - Set EmbedderFields to 0.
-void TypedArrayBuiltinsAssembler::SetupTypedArray(TNode<JSTypedArray> holder,
-                                                  TNode<Smi> length,
-                                                  TNode<Number> byte_offset,
-                                                  TNode<Number> byte_length) {
-  StoreObjectField(holder, JSTypedArray::kLengthOffset, length);
-  StoreObjectField(holder, JSArrayBufferView::kByteOffsetOffset, byte_offset);
-  StoreObjectField(holder, JSArrayBufferView::kByteLengthOffset, byte_length);
-  for (int offset = JSTypedArray::kSize;
-       offset < JSTypedArray::kSizeWithEmbedderFields; offset += kPointerSize) {
-    StoreObjectField(holder, offset, SmiConstant(0));
-  }
-}
-
-// Attach an off-heap buffer to a TypedArray.
-void TypedArrayBuiltinsAssembler::AttachBuffer(TNode<JSTypedArray> holder,
-                                               TNode<JSArrayBuffer> buffer,
-                                               TNode<Map> map,
-                                               TNode<Smi> length,
-                                               TNode<Number> byte_offset) {
-  StoreObjectField(holder, JSArrayBufferView::kBufferOffset, buffer);
-
-  Node* elements = Allocate(FixedTypedArrayBase::kHeaderSize);
-  StoreMapNoWriteBarrier(elements, map);
-  StoreObjectFieldNoWriteBarrier(elements, FixedArray::kLengthOffset, length);
-  StoreObjectFieldNoWriteBarrier(
-      elements, FixedTypedArrayBase::kBasePointerOffset, SmiConstant(0));
-
-  TNode<UintPtrT> backing_store =
-      LoadObjectField<UintPtrT>(buffer, JSArrayBuffer::kBackingStoreOffset);
-
-  TNode<UintPtrT> external_pointer =
-      CalculateExternalPointer(backing_store, byte_offset);
-  StoreObjectFieldNoWriteBarrier(
-      elements, FixedTypedArrayBase::kExternalPointerOffset, external_pointer,
-      MachineType::PointerRepresentation());
-
-  StoreObjectField(holder, JSObject::kElementsOffset, elements);
-}
-
-TF_BUILTIN(TypedArrayInitializeWithBuffer, TypedArrayBuiltinsAssembler) {
-  TNode<JSTypedArray> holder = CAST(Parameter(Descriptor::kHolder));
-  TNode<Smi> length = CAST(Parameter(Descriptor::kLength));
-  TNode<JSArrayBuffer> buffer = CAST(Parameter(Descriptor::kBuffer));
-  TNode<Smi> element_size = CAST(Parameter(Descriptor::kElementSize));
-  TNode<Number> byte_offset = CAST(Parameter(Descriptor::kByteOffset));
-
-  TNode<Map> fixed_typed_map = LoadMapForType(holder);
-
-  // SmiMul returns a heap number in case of Smi overflow.
-  TNode<Number> byte_length = SmiMul(length, element_size);
-
-  SetupTypedArray(holder, length, byte_offset, byte_length);
-  AttachBuffer(holder, buffer, fixed_typed_map, length, byte_offset);
-  Return(UndefinedConstant());
-}
-
-TF_BUILTIN(TypedArrayInitialize, TypedArrayBuiltinsAssembler) {
-  TNode<JSTypedArray> holder = CAST(Parameter(Descriptor::kHolder));
-  TNode<Smi> length = CAST(Parameter(Descriptor::kLength));
-  TNode<Smi> element_size = CAST(Parameter(Descriptor::kElementSize));
-  Node* initialize = Parameter(Descriptor::kInitialize);
-  TNode<Context> context = CAST(Parameter(Descriptor::kContext));
-
-  CSA_ASSERT(this, TaggedIsPositiveSmi(length));
-  CSA_ASSERT(this, TaggedIsPositiveSmi(element_size));
-  CSA_ASSERT(this, IsBoolean(initialize));
-
-  TNode<Smi> byte_offset = SmiConstant(0);
-
-  static const int32_t fta_base_data_offset =
-      FixedTypedArrayBase::kDataOffset - kHeapObjectTag;
-
-  Label setup_holder(this), allocate_on_heap(this), aligned(this),
-      allocate_elements(this), allocate_off_heap(this),
-      allocate_off_heap_no_init(this), attach_buffer(this), done(this);
-  VARIABLE(var_total_size, MachineType::PointerRepresentation());
-
-  // SmiMul returns a heap number in case of Smi overflow.
-  TNode<Number> byte_length = SmiMul(length, element_size);
-
-  SetupTypedArray(holder, length, byte_offset, byte_length);
-
-  TNode<Map> fixed_typed_map = LoadMapForType(holder);
-  GotoIf(TaggedIsNotSmi(byte_length), &allocate_off_heap);
-  GotoIf(
-      SmiGreaterThan(byte_length, SmiConstant(V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP)),
-      &allocate_off_heap);
-  TNode<IntPtrT> word_byte_length = SmiToWord(CAST(byte_length));
-  Goto(&allocate_on_heap);
-
-  BIND(&allocate_on_heap);
-  {
-    CSA_ASSERT(this, TaggedIsPositiveSmi(byte_length));
-    // Allocate a new ArrayBuffer and initialize it with empty properties and
-    // elements.
-    Node* native_context = LoadNativeContext(context);
-    Node* map =
-        LoadContextElement(native_context, Context::ARRAY_BUFFER_MAP_INDEX);
-    Node* empty_fixed_array = LoadRoot(Heap::kEmptyFixedArrayRootIndex);
-
-    Node* buffer = Allocate(JSArrayBuffer::kSizeWithEmbedderFields);
-    StoreMapNoWriteBarrier(buffer, map);
-    StoreObjectFieldNoWriteBarrier(buffer, JSArray::kPropertiesOrHashOffset,
-                                   empty_fixed_array);
-    StoreObjectFieldNoWriteBarrier(buffer, JSArray::kElementsOffset,
-                                   empty_fixed_array);
-    // Setup the ArrayBuffer.
-    //  - Set BitField to 0.
-    //  - Set IsExternal and IsNeuterable bits of BitFieldSlot.
-    //  - Set the byte_length field to byte_length.
-    //  - Set backing_store to null/Smi(0).
-    //  - Set all embedder fields to Smi(0).
-    StoreObjectFieldNoWriteBarrier(buffer, JSArrayBuffer::kBitFieldSlot,
-                                   SmiConstant(0));
-    int32_t bitfield_value = (1 << JSArrayBuffer::IsExternal::kShift) |
-                             (1 << JSArrayBuffer::IsNeuterable::kShift);
-    StoreObjectFieldNoWriteBarrier(buffer, JSArrayBuffer::kBitFieldOffset,
-                                   Int32Constant(bitfield_value),
-                                   MachineRepresentation::kWord32);
-
-    StoreObjectFieldNoWriteBarrier(buffer, JSArrayBuffer::kByteLengthOffset,
-                                   byte_length);
-    StoreObjectFieldNoWriteBarrier(buffer, JSArrayBuffer::kBackingStoreOffset,
-                                   SmiConstant(0));
-    for (int i = 0; i < v8::ArrayBuffer::kEmbedderFieldCount; i++) {
-      int offset = JSArrayBuffer::kSize + i * kPointerSize;
-      StoreObjectFieldNoWriteBarrier(buffer, offset, SmiConstant(0));
-    }
-
-    StoreObjectField(holder, JSArrayBufferView::kBufferOffset, buffer);
-
-    // Check the alignment.
-    GotoIf(SmiEqual(SmiMod(element_size, SmiConstant(kObjectAlignment)),
-                    SmiConstant(0)),
-           &aligned);
-
-    // Fix alignment if needed.
-    DCHECK_EQ(0, FixedTypedArrayBase::kHeaderSize & kObjectAlignmentMask);
-    Node* aligned_header_size =
-        IntPtrConstant(FixedTypedArrayBase::kHeaderSize + kObjectAlignmentMask);
-    Node* size = IntPtrAdd(word_byte_length, aligned_header_size);
-    var_total_size.Bind(WordAnd(size, IntPtrConstant(~kObjectAlignmentMask)));
-    Goto(&allocate_elements);
-  }
-
-  BIND(&aligned);
-  {
-    Node* header_size = IntPtrConstant(FixedTypedArrayBase::kHeaderSize);
-    var_total_size.Bind(IntPtrAdd(word_byte_length, header_size));
-    Goto(&allocate_elements);
-  }
-
-  BIND(&allocate_elements);
-  {
-    // Allocate a FixedTypedArray and set the length, base pointer and external
-    // pointer.
-    CSA_ASSERT(this, IsRegularHeapObjectSize(var_total_size.value()));
-
-    Node* elements;
-
-    if (UnalignedLoadSupported(MachineRepresentation::kFloat64) &&
-        UnalignedStoreSupported(MachineRepresentation::kFloat64)) {
-      elements = AllocateInNewSpace(var_total_size.value());
-    } else {
-      elements = AllocateInNewSpace(var_total_size.value(), kDoubleAlignment);
-    }
-
-    StoreMapNoWriteBarrier(elements, fixed_typed_map);
-    StoreObjectFieldNoWriteBarrier(elements, FixedArray::kLengthOffset, length);
-    StoreObjectFieldNoWriteBarrier(
-        elements, FixedTypedArrayBase::kBasePointerOffset, elements);
-    StoreObjectFieldNoWriteBarrier(elements,
-                                   FixedTypedArrayBase::kExternalPointerOffset,
-                                   IntPtrConstant(fta_base_data_offset),
-                                   MachineType::PointerRepresentation());
-
-    StoreObjectField(holder, JSObject::kElementsOffset, elements);
-
-    GotoIf(IsFalse(initialize), &done);
-    // Initialize the backing store by filling it with 0s.
-    Node* backing_store = IntPtrAdd(BitcastTaggedToWord(elements),
-                                    IntPtrConstant(fta_base_data_offset));
-    // Call out to memset to perform initialization.
-    Node* memset =
-        ExternalConstant(ExternalReference::libc_memset_function(isolate()));
-    CallCFunction3(MachineType::AnyTagged(), MachineType::Pointer(),
-                   MachineType::IntPtr(), MachineType::UintPtr(), memset,
-                   backing_store, IntPtrConstant(0), word_byte_length);
-    Goto(&done);
-  }
-
-  TVARIABLE(JSArrayBuffer, var_buffer);
-
-  BIND(&allocate_off_heap);
-  {
-    GotoIf(IsFalse(initialize), &allocate_off_heap_no_init);
-
-    Node* buffer_constructor = LoadContextElement(
-        LoadNativeContext(context), Context::ARRAY_BUFFER_FUN_INDEX);
-    var_buffer = CAST(ConstructJS(CodeFactory::Construct(isolate()), context,
-                                  buffer_constructor, byte_length));
-    Goto(&attach_buffer);
-  }
-
-  BIND(&allocate_off_heap_no_init);
-  {
-    Node* buffer_constructor_noinit = LoadContextElement(
-        LoadNativeContext(context), Context::ARRAY_BUFFER_NOINIT_FUN_INDEX);
-    var_buffer = CAST(CallJS(CodeFactory::Call(isolate()), context,
-                             buffer_constructor_noinit, UndefinedConstant(),
-                             byte_length));
-    Goto(&attach_buffer);
-  }
-
-  BIND(&attach_buffer);
-  {
-    AttachBuffer(holder, var_buffer, fixed_typed_map, length, byte_offset);
-    Goto(&done);
-  }
-
-  BIND(&done);
-  Return(UndefinedConstant());
-}
-
-// ES6 #sec-typedarray-length
-TF_BUILTIN(TypedArrayConstructByLength, TypedArrayBuiltinsAssembler) {
-  Node* holder = Parameter(Descriptor::kHolder);
-  TNode<Object> maybe_length = CAST(Parameter(Descriptor::kLength));
-  TNode<Object> element_size = CAST(Parameter(Descriptor::kElementSize));
-  TNode<Context> context = CAST(Parameter(Descriptor::kContext));
-
-  CSA_ASSERT(this, IsJSTypedArray(holder));
-  CSA_ASSERT(this, TaggedIsPositiveSmi(element_size));
-
-  Label invalid_length(this);
-
-  TNode<Number> length = ToInteger_Inline(
-      context, maybe_length, CodeStubAssembler::kTruncateMinusZero);
-
-  // The maximum length of a TypedArray is MaxSmi().
-  // Note: this is not per spec, but rather a constraint of our current
-  // representation (which uses smi's).
-  GotoIf(TaggedIsNotSmi(length), &invalid_length);
-  GotoIf(SmiLessThan(length, SmiConstant(0)), &invalid_length);
-
-  CallBuiltin(Builtins::kTypedArrayInitialize, context, holder, length,
-              element_size, TrueConstant());
-  Return(UndefinedConstant());
-
-  BIND(&invalid_length);
-  {
-    CallRuntime(Runtime::kThrowRangeError, context,
-                SmiConstant(MessageTemplate::kInvalidTypedArrayLength), length);
-    Unreachable();
-  }
-}
-
-// ES6 #sec-typedarray-buffer-byteoffset-length
-TF_BUILTIN(TypedArrayConstructByArrayBuffer, TypedArrayBuiltinsAssembler) {
-  Node* holder = Parameter(Descriptor::kHolder);
-  Node* buffer = Parameter(Descriptor::kBuffer);
-  TNode<Object> byte_offset = CAST(Parameter(Descriptor::kByteOffset));
-  Node* length = Parameter(Descriptor::kLength);
-  Node* element_size = Parameter(Descriptor::kElementSize);
-  TNode<Context> context = CAST(Parameter(Descriptor::kContext));
-
-  CSA_ASSERT(this, IsJSTypedArray(holder));
-  CSA_ASSERT(this, IsJSArrayBuffer(buffer));
-  CSA_ASSERT(this, TaggedIsPositiveSmi(element_size));
-
-  VARIABLE(new_byte_length, MachineRepresentation::kTagged, SmiConstant(0));
-  VARIABLE(offset, MachineRepresentation::kTagged, SmiConstant(0));
-
-  Label start_offset_error(this, Label::kDeferred),
-      byte_length_error(this, Label::kDeferred),
-      invalid_offset_error(this, Label::kDeferred);
-  Label offset_is_smi(this), offset_not_smi(this, Label::kDeferred),
-      check_length(this), call_init(this), invalid_length(this),
-      length_undefined(this), length_defined(this), detached_error(this);
-
-  GotoIf(IsUndefined(byte_offset), &check_length);
-
-  offset.Bind(ToInteger_Inline(context, byte_offset,
-                               CodeStubAssembler::kTruncateMinusZero));
-  Branch(TaggedIsSmi(offset.value()), &offset_is_smi, &offset_not_smi);
-
-  // Check that the offset is a multiple of the element size.
-  BIND(&offset_is_smi);
-  {
-    GotoIf(SmiEqual(offset.value(), SmiConstant(0)), &check_length);
-    GotoIf(SmiLessThan(offset.value(), SmiConstant(0)), &invalid_length);
-    Node* remainder = SmiMod(offset.value(), element_size);
-    Branch(SmiEqual(remainder, SmiConstant(0)), &check_length,
-           &start_offset_error);
-  }
-  BIND(&offset_not_smi);
-  {
-    GotoIf(IsTrue(CallBuiltin(Builtins::kLessThan, context, offset.value(),
-                              SmiConstant(0))),
-           &invalid_length);
-    Node* remainder =
-        CallBuiltin(Builtins::kModulus, context, offset.value(), element_size);
-    // Remainder can be a heap number.
-    Branch(IsTrue(CallBuiltin(Builtins::kEqual, context, remainder,
-                              SmiConstant(0))),
-           &check_length, &start_offset_error);
-  }
-
-  BIND(&check_length);
-  Branch(IsUndefined(length), &length_undefined, &length_defined);
-
-  BIND(&length_undefined);
-  {
-    GotoIf(IsDetachedBuffer(buffer), &detached_error);
-    Node* buffer_byte_length =
-        LoadObjectField(buffer, JSArrayBuffer::kByteLengthOffset);
-
-    Node* remainder = CallBuiltin(Builtins::kModulus, context,
-                                  buffer_byte_length, element_size);
-    // Remainder can be a heap number.
-    GotoIf(IsFalse(CallBuiltin(Builtins::kEqual, context, remainder,
-                               SmiConstant(0))),
-           &byte_length_error);
-
-    new_byte_length.Bind(CallBuiltin(Builtins::kSubtract, context,
-                                     buffer_byte_length, offset.value()));
-
-    Branch(IsTrue(CallBuiltin(Builtins::kLessThan, context,
-                              new_byte_length.value(), SmiConstant(0))),
-           &invalid_offset_error, &call_init);
-  }
-
-  BIND(&length_defined);
-  {
-    Node* new_length = ToSmiIndex(length, context, &invalid_length);
-    GotoIf(IsDetachedBuffer(buffer), &detached_error);
-    new_byte_length.Bind(SmiMul(new_length, element_size));
-    // Reading the byte length must come after the ToIndex operation, which
-    // could cause the buffer to become detached.
-    Node* buffer_byte_length =
-        LoadObjectField(buffer, JSArrayBuffer::kByteLengthOffset);
-
-    Node* end = CallBuiltin(Builtins::kAdd, context, offset.value(),
-                            new_byte_length.value());
-
-    Branch(IsTrue(CallBuiltin(Builtins::kGreaterThan, context, end,
-                              buffer_byte_length)),
-           &invalid_length, &call_init);
-  }
-
-  BIND(&call_init);
-  {
-    Node* new_length = CallBuiltin(Builtins::kDivide, context,
-                                   new_byte_length.value(), element_size);
-    // Force the result into a Smi, or throw a range error if it doesn't fit.
-    new_length = ToSmiIndex(new_length, context, &invalid_length);
-
-    CallBuiltin(Builtins::kTypedArrayInitializeWithBuffer, context, holder,
-                new_length, buffer, element_size, offset.value());
-    Return(UndefinedConstant());
-  }
-
-  BIND(&invalid_offset_error);
-  {
-    CallRuntime(Runtime::kThrowRangeError, context,
-                SmiConstant(MessageTemplate::kInvalidOffset), byte_offset);
-    Unreachable();
-  }
-
-  BIND(&start_offset_error);
-  {
-    Node* holder_map = LoadMap(holder);
-    Node* problem_string = StringConstant("start offset");
-    CallRuntime(Runtime::kThrowInvalidTypedArrayAlignment, context, holder_map,
-                problem_string);
-
-    Unreachable();
-  }
-
-  BIND(&byte_length_error);
-  {
-    Node* holder_map = LoadMap(holder);
-    Node* problem_string = StringConstant("byte length");
-    CallRuntime(Runtime::kThrowInvalidTypedArrayAlignment, context, holder_map,
-                problem_string);
-
-    Unreachable();
-  }
-
-  BIND(&invalid_length);
-  {
-    CallRuntime(Runtime::kThrowRangeError, context,
-                SmiConstant(MessageTemplate::kInvalidTypedArrayLength), length);
-    Unreachable();
-  }
-
-  BIND(&detached_error);
-  { ThrowTypeError(context, MessageTemplate::kDetachedOperation, "Construct"); }
-}
-
-Node* TypedArrayBuiltinsAssembler::LoadDataPtr(Node* typed_array) {
-  CSA_ASSERT(this, IsJSTypedArray(typed_array));
-  Node* elements = LoadElements(typed_array);
-  CSA_ASSERT(this, IsFixedTypedArray(elements));
-  Node* base_pointer = BitcastTaggedToWord(
-      LoadObjectField(elements, FixedTypedArrayBase::kBasePointerOffset));
-  Node* external_pointer = BitcastTaggedToWord(
-      LoadObjectField(elements, FixedTypedArrayBase::kExternalPointerOffset));
-  return IntPtrAdd(base_pointer, external_pointer);
-}
-
-TNode<BoolT> TypedArrayBuiltinsAssembler::ByteLengthIsValid(
-    TNode<Number> byte_length) {
-  Label smi(this), done(this);
-  TVARIABLE(BoolT, is_valid);
-  GotoIf(TaggedIsSmi(byte_length), &smi);
-
-  TNode<Float64T> float_value = LoadHeapNumberValue(CAST(byte_length));
-  TNode<Float64T> max_byte_length_double =
-      Float64Constant(FixedTypedArrayBase::kMaxByteLength);
-  is_valid = Float64LessThanOrEqual(float_value, max_byte_length_double);
-  Goto(&done);
-
-  BIND(&smi);
-  TNode<IntPtrT> max_byte_length =
-      IntPtrConstant(FixedTypedArrayBase::kMaxByteLength);
-  is_valid =
-      UintPtrLessThanOrEqual(SmiUntag(CAST(byte_length)), max_byte_length);
-  Goto(&done);
-
-  BIND(&done);
-  return is_valid;
-}
-
-TF_BUILTIN(TypedArrayConstructByArrayLike, TypedArrayBuiltinsAssembler) {
-  Node* holder = Parameter(Descriptor::kHolder);
-  Node* array_like = Parameter(Descriptor::kArrayLike);
-  Node* initial_length = Parameter(Descriptor::kLength);
-  Node* element_size = Parameter(Descriptor::kElementSize);
-  CSA_ASSERT(this, TaggedIsSmi(element_size));
-  Node* context = Parameter(Descriptor::kContext);
-
-  Node* initialize = FalseConstant();
-
-  Label invalid_length(this), fill(this), fast_copy(this);
-
-  // The caller has looked up length on array_like, which is observable.
-  Node* length = ToSmiLength(initial_length, context, &invalid_length);
-
-  CallBuiltin(Builtins::kTypedArrayInitialize, context, holder, length,
-              element_size, initialize);
-  GotoIf(SmiNotEqual(length, SmiConstant(0)), &fill);
-  Return(UndefinedConstant());
-
-  BIND(&fill);
-  TNode<Int32T> holder_kind = LoadMapElementsKind(LoadMap(holder));
-  TNode<Int32T> source_kind = LoadMapElementsKind(LoadMap(array_like));
-  GotoIf(Word32Equal(holder_kind, source_kind), &fast_copy);
-
-  // Copy using the elements accessor.
-  CallRuntime(Runtime::kTypedArrayCopyElements, context, holder, array_like,
-              length);
-  Return(UndefinedConstant());
-
-  BIND(&fast_copy);
-  {
-    Node* holder_data_ptr = LoadDataPtr(holder);
-    Node* source_data_ptr = LoadDataPtr(array_like);
-
-    // Calculate the byte length. We shouldn't be trying to copy if the typed
-    // array was neutered.
-    CSA_ASSERT(this, SmiNotEqual(length, SmiConstant(0)));
-    CSA_ASSERT(this, Word32Equal(IsDetachedBuffer(LoadObjectField(
-                                     array_like, JSTypedArray::kBufferOffset)),
-                                 Int32Constant(0)));
-
-    TNode<Number> byte_length = SmiMul(length, element_size);
-    CSA_ASSERT(this, ByteLengthIsValid(byte_length));
-    TNode<UintPtrT> byte_length_intptr =
-        ChangeNonnegativeNumberToUintPtr(byte_length);
-    CSA_ASSERT(this, UintPtrLessThanOrEqual(
-                         byte_length_intptr,
-                         IntPtrConstant(FixedTypedArrayBase::kMaxByteLength)));
-
-    Node* memcpy =
-        ExternalConstant(ExternalReference::libc_memcpy_function(isolate()));
-    CallCFunction3(MachineType::AnyTagged(), MachineType::Pointer(),
-                   MachineType::Pointer(), MachineType::UintPtr(), memcpy,
-                   holder_data_ptr, source_data_ptr, byte_length_intptr);
-    Return(UndefinedConstant());
-  }
-
-  BIND(&invalid_length);
-  {
-    CallRuntime(Runtime::kThrowRangeError, context,
-                SmiConstant(MessageTemplate::kInvalidTypedArrayLength),
-                initial_length);
-    Unreachable();
-  }
-}
-
-void TypedArrayBuiltinsAssembler::GenerateTypedArrayPrototypeGetter(
-    Node* context, Node* receiver, const char* method_name, int object_offset) {
-  // Check if the {receiver} is actually a JSTypedArray.
-  Label receiver_is_incompatible(this, Label::kDeferred);
-  GotoIf(TaggedIsSmi(receiver), &receiver_is_incompatible);
-  GotoIfNot(HasInstanceType(receiver, JS_TYPED_ARRAY_TYPE),
-            &receiver_is_incompatible);
-
-  // Check if the {receiver}'s JSArrayBuffer was neutered.
-  Node* receiver_buffer =
-      LoadObjectField(receiver, JSTypedArray::kBufferOffset);
-  Label if_receiverisneutered(this, Label::kDeferred);
-  GotoIf(IsDetachedBuffer(receiver_buffer), &if_receiverisneutered);
-  Return(LoadObjectField(receiver, object_offset));
-
-  BIND(&if_receiverisneutered);
-  {
-    // The {receiver}s buffer was neutered, default to zero.
-    Return(SmiConstant(0));
-  }
-
-  BIND(&receiver_is_incompatible);
-  {
-    // The {receiver} is not a valid JSTypedArray.
-    CallRuntime(Runtime::kThrowIncompatibleMethodReceiver, context,
-                StringConstant(method_name), receiver);
-    Unreachable();
-  }
-}
-
-// ES6 #sec-get-%typedarray%.prototype.bytelength
-TF_BUILTIN(TypedArrayPrototypeByteLength, TypedArrayBuiltinsAssembler) {
-  Node* context = Parameter(Descriptor::kContext);
-  Node* receiver = Parameter(Descriptor::kReceiver);
-  GenerateTypedArrayPrototypeGetter(context, receiver,
-                                    "get TypedArray.prototype.byteLength",
-                                    JSTypedArray::kByteLengthOffset);
-}
-
-// ES6 #sec-get-%typedarray%.prototype.byteoffset
-TF_BUILTIN(TypedArrayPrototypeByteOffset, TypedArrayBuiltinsAssembler) {
-  Node* context = Parameter(Descriptor::kContext);
-  Node* receiver = Parameter(Descriptor::kReceiver);
-  GenerateTypedArrayPrototypeGetter(context, receiver,
-                                    "get TypedArray.prototype.byteOffset",
-                                    JSTypedArray::kByteOffsetOffset);
-}
-
-// ES6 #sec-get-%typedarray%.prototype.length
-TF_BUILTIN(TypedArrayPrototypeLength, TypedArrayBuiltinsAssembler) {
-  Node* context = Parameter(Descriptor::kContext);
-  Node* receiver = Parameter(Descriptor::kReceiver);
-  GenerateTypedArrayPrototypeGetter(context, receiver,
-                                    "get TypedArray.prototype.length",
-                                    JSTypedArray::kLengthOffset);
-}
-
-TNode<Word32T> TypedArrayBuiltinsAssembler::IsUint8ElementsKind(
-    TNode<Word32T> kind) {
-  return Word32Or(Word32Equal(kind, Int32Constant(UINT8_ELEMENTS)),
-                  Word32Equal(kind, Int32Constant(UINT8_CLAMPED_ELEMENTS)));
-}
-
-TNode<Word32T> TypedArrayBuiltinsAssembler::LoadElementsKind(
-    TNode<Object> typed_array) {
-  CSA_ASSERT(this, IsJSTypedArray(typed_array));
-  return LoadMapElementsKind(LoadMap(CAST(typed_array)));
-}
-
-TNode<IntPtrT> TypedArrayBuiltinsAssembler::GetTypedArrayElementSize(
-    TNode<Word32T> elements_kind) {
-  TVARIABLE(IntPtrT, element_size);
-  Label next(this), if_unknown_type(this, Label::kDeferred);
-
-  size_t const kTypedElementsKindCount = LAST_FIXED_TYPED_ARRAY_ELEMENTS_KIND -
-                                         FIRST_FIXED_TYPED_ARRAY_ELEMENTS_KIND +
-                                         1;
-
-  int32_t elements_kinds[kTypedElementsKindCount] = {
-#define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) TYPE##_ELEMENTS,
-      TYPED_ARRAYS(TYPED_ARRAY_CASE)
-#undef TYPED_ARRAY_CASE
-  };
-
-#define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \
-  Label if_##type##array(this);
-  TYPED_ARRAYS(TYPED_ARRAY_CASE)
-#undef TYPED_ARRAY_CASE
-
-  Label* elements_kind_labels[kTypedElementsKindCount] = {
-#define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) &if_##type##array,
-      TYPED_ARRAYS(TYPED_ARRAY_CASE)
-#undef TYPED_ARRAY_CASE
-  };
-
-  Switch(elements_kind, &if_unknown_type, elements_kinds, elements_kind_labels,
-         kTypedElementsKindCount);
-
-#define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \
-  BIND(&if_##type##array);                              \
-  {                                                     \
-    element_size = IntPtrConstant(size);                \
-    Goto(&next);                                        \
-  }
-  TYPED_ARRAYS(TYPED_ARRAY_CASE)
-#undef TYPED_ARRAY_CASE
-
-  BIND(&if_unknown_type);
-  {
-    element_size = IntPtrConstant(0);
-    Goto(&next);
-  }
-  BIND(&next);
-  return element_size;
-}
-
-void TypedArrayBuiltinsAssembler::SetTypedArraySource(
-    TNode<Context> context, TNode<JSTypedArray> source,
-    TNode<JSTypedArray> target, TNode<IntPtrT> offset, Label* call_runtime,
-    Label* if_source_too_large) {
-  CSA_ASSERT(this, Word32BinaryNot(IsDetachedBuffer(
-                       LoadObjectField(source, JSTypedArray::kBufferOffset))));
-  CSA_ASSERT(this, Word32BinaryNot(IsDetachedBuffer(
-                       LoadObjectField(target, JSTypedArray::kBufferOffset))));
-  CSA_ASSERT(this, IntPtrGreaterThanOrEqual(offset, IntPtrConstant(0)));
-  CSA_ASSERT(this,
-             IntPtrLessThanOrEqual(offset, IntPtrConstant(Smi::kMaxValue)));
-
-  // Check for possible range errors.
-
-  TNode<IntPtrT> source_length =
-      LoadAndUntagObjectField(source, JSTypedArray::kLengthOffset);
-  TNode<IntPtrT> target_length =
-      LoadAndUntagObjectField(target, JSTypedArray::kLengthOffset);
-  TNode<IntPtrT> required_target_length = IntPtrAdd(source_length, offset);
-
-  GotoIf(IntPtrGreaterThan(required_target_length, target_length),
-         if_source_too_large);
-
-  // Grab pointers and byte lengths we need later on.
-
-  TNode<IntPtrT> target_data_ptr = UncheckedCast<IntPtrT>(LoadDataPtr(target));
-  TNode<IntPtrT> source_data_ptr = UncheckedCast<IntPtrT>(LoadDataPtr(source));
-
-  TNode<Word32T> source_el_kind = LoadElementsKind(source);
-  TNode<Word32T> target_el_kind = LoadElementsKind(target);
-
-  TNode<IntPtrT> source_el_size = GetTypedArrayElementSize(source_el_kind);
-  TNode<IntPtrT> target_el_size = GetTypedArrayElementSize(target_el_kind);
-
-  // A note on byte lengths: both source- and target byte lengths must be valid,
-  // i.e. it must be possible to allocate an array of the given length. That
-  // means we're safe from overflows in the following multiplication.
-  TNode<IntPtrT> source_byte_length = IntPtrMul(source_length, source_el_size);
-  CSA_ASSERT(this,
-             UintPtrGreaterThanOrEqual(source_byte_length, IntPtrConstant(0)));
-
-  Label call_memmove(this), fast_c_call(this), out(this);
-
-  // A fast memmove call can be used when the source and target types are are
-  // the same or either Uint8 or Uint8Clamped.
-  GotoIf(Word32Equal(source_el_kind, target_el_kind), &call_memmove);
-  GotoIfNot(IsUint8ElementsKind(source_el_kind), &fast_c_call);
-  Branch(IsUint8ElementsKind(target_el_kind), &call_memmove, &fast_c_call);
-
-  BIND(&call_memmove);
-  {
-    TNode<IntPtrT> target_start =
-        IntPtrAdd(target_data_ptr, IntPtrMul(offset, target_el_size));
-    CallCMemmove(target_start, source_data_ptr, source_byte_length);
-    Goto(&out);
-  }
-
-  BIND(&fast_c_call);
-  {
-    CSA_ASSERT(
-        this, UintPtrGreaterThanOrEqual(
-                  IntPtrMul(target_length, target_el_size), IntPtrConstant(0)));
-
-    TNode<IntPtrT> source_length =
-        LoadAndUntagObjectField(source, JSTypedArray::kLengthOffset);
-    CallCCopyTypedArrayElementsToTypedArray(source, target, source_length,
-                                            offset);
-    Goto(&out);
-  }
-
-  BIND(&out);
-}
-
-void TypedArrayBuiltinsAssembler::SetJSArraySource(
-    TNode<Context> context, TNode<JSArray> source, TNode<JSTypedArray> target,
-    TNode<IntPtrT> offset, Label* call_runtime, Label* if_source_too_large) {
-  CSA_ASSERT(this, IsFastJSArray(source, context));
-  CSA_ASSERT(this, IntPtrGreaterThanOrEqual(offset, IntPtrConstant(0)));
-  CSA_ASSERT(this,
-             IntPtrLessThanOrEqual(offset, IntPtrConstant(Smi::kMaxValue)));
-
-  TNode<IntPtrT> source_length = SmiUntag(LoadFastJSArrayLength(source));
-  TNode<IntPtrT> target_length =
-      LoadAndUntagObjectField(target, JSTypedArray::kLengthOffset);
-
-  // Maybe out of bounds?
-  GotoIf(IntPtrGreaterThan(IntPtrAdd(source_length, offset), target_length),
-         if_source_too_large);
-
-  // Nothing to do if {source} is empty.
-  Label out(this), fast_c_call(this);
-  GotoIf(IntPtrEqual(source_length, IntPtrConstant(0)), &out);
-
-  // Dispatch based on the source elements kind.
-  {
-    // These are the supported elements kinds in TryCopyElementsFastNumber.
-    int32_t values[] = {
-        PACKED_SMI_ELEMENTS, HOLEY_SMI_ELEMENTS, PACKED_DOUBLE_ELEMENTS,
-        HOLEY_DOUBLE_ELEMENTS,
-    };
-    Label* labels[] = {
-        &fast_c_call, &fast_c_call, &fast_c_call, &fast_c_call,
-    };
-    STATIC_ASSERT(arraysize(values) == arraysize(labels));
-
-    TNode<Int32T> source_elements_kind = LoadMapElementsKind(LoadMap(source));
-    Switch(source_elements_kind, call_runtime, values, labels,
-           arraysize(values));
-  }
-
-  BIND(&fast_c_call);
-  CallCCopyFastNumberJSArrayElementsToTypedArray(context, source, target,
-                                                 source_length, offset);
-  Goto(&out);
-  BIND(&out);
-}
-
-void TypedArrayBuiltinsAssembler::CallCMemmove(TNode<IntPtrT> dest_ptr,
-                                               TNode<IntPtrT> src_ptr,
-                                               TNode<IntPtrT> byte_length) {
-  TNode<ExternalReference> memmove =
-      ExternalConstant(ExternalReference::libc_memmove_function(isolate()));
-  CallCFunction3(MachineType::AnyTagged(), MachineType::Pointer(),
-                 MachineType::Pointer(), MachineType::UintPtr(), memmove,
-                 dest_ptr, src_ptr, byte_length);
-}
-
-void TypedArrayBuiltinsAssembler::
-    CallCCopyFastNumberJSArrayElementsToTypedArray(TNode<Context> context,
-                                                   TNode<JSArray> source,
-                                                   TNode<JSTypedArray> dest,
-                                                   TNode<IntPtrT> source_length,
-                                                   TNode<IntPtrT> offset) {
-  TNode<ExternalReference> f = ExternalConstant(
-      ExternalReference::copy_fast_number_jsarray_elements_to_typed_array(
-          isolate()));
-  CallCFunction5(MachineType::AnyTagged(), MachineType::AnyTagged(),
-                 MachineType::AnyTagged(), MachineType::AnyTagged(),
-                 MachineType::UintPtr(), MachineType::UintPtr(), f, context,
-                 source, dest, source_length, offset);
-}
-
-void TypedArrayBuiltinsAssembler::CallCCopyTypedArrayElementsToTypedArray(
-    TNode<JSTypedArray> source, TNode<JSTypedArray> dest,
-    TNode<IntPtrT> source_length, TNode<IntPtrT> offset) {
-  TNode<ExternalReference> f = ExternalConstant(
-      ExternalReference::copy_typed_array_elements_to_typed_array(isolate()));
-  CallCFunction4(MachineType::AnyTagged(), MachineType::AnyTagged(),
-                 MachineType::AnyTagged(), MachineType::UintPtr(),
-                 MachineType::UintPtr(), f, source, dest, source_length,
-                 offset);
-}
-
-// ES #sec-get-%typedarray%.prototype.set
-TF_BUILTIN(TypedArrayPrototypeSet, TypedArrayBuiltinsAssembler) {
-  TNode<Context> context = CAST(Parameter(BuiltinDescriptor::kContext));
-  CodeStubArguments args(
-      this, ChangeInt32ToIntPtr(Parameter(BuiltinDescriptor::kArgumentsCount)));
-
-  Label if_source_is_typed_array(this), if_source_is_fast_jsarray(this),
-      if_offset_is_out_of_bounds(this, Label::kDeferred),
-      if_source_too_large(this, Label::kDeferred),
-      if_typed_array_is_neutered(this, Label::kDeferred),
-      if_receiver_is_not_typedarray(this, Label::kDeferred);
-
-  // Check the receiver is a typed array.
-  TNode<Object> receiver = args.GetReceiver();
-  GotoIf(TaggedIsSmi(receiver), &if_receiver_is_not_typedarray);
-  GotoIfNot(IsJSTypedArray(receiver), &if_receiver_is_not_typedarray);
-
-  // Normalize offset argument (using ToInteger) and handle heap number cases.
-  TNode<Object> offset = args.GetOptionalArgumentValue(1, SmiConstant(0));
-  TNode<Number> offset_num =
-      ToInteger_Inline(context, offset, kTruncateMinusZero);
-
-  // Since ToInteger always returns a Smi if the given value is within Smi
-  // range, and the only corner case of -0.0 has already been truncated to 0.0,
-  // we can simply throw unless the offset is a non-negative Smi.
-  // TODO(jgruber): It's an observable spec violation to throw here if
-  // {offset_num} is a positive number outside the Smi range. Per spec, we need
-  // to check for detached buffers and call the observable ToObject/ToLength
-  // operations first.
-  GotoIfNot(TaggedIsPositiveSmi(offset_num), &if_offset_is_out_of_bounds);
-  TNode<Smi> offset_smi = CAST(offset_num);
-
-  // Check the receiver is not neutered.
-  TNode<Object> receiver_buffer =
-      LoadObjectField(CAST(receiver), JSTypedArray::kBufferOffset);
-  GotoIf(IsDetachedBuffer(receiver_buffer), &if_typed_array_is_neutered);
-
-  // Check the source argument is valid and whether a fast path can be taken.
-  Label call_runtime(this);
-  TNode<Object> source = args.GetOptionalArgumentValue(0);
-  GotoIf(TaggedIsSmi(source), &call_runtime);
-  GotoIf(IsJSTypedArray(source), &if_source_is_typed_array);
-  BranchIfFastJSArray(source, context, &if_source_is_fast_jsarray,
-                      &call_runtime);
-
-  // Fast path for a typed array source argument.
-  BIND(&if_source_is_typed_array);
-  {
-    // Check the source argument is not neutered.
-    TNode<Object> source_buffer =
-        LoadObjectField(CAST(source), JSTypedArray::kBufferOffset);
-    GotoIf(IsDetachedBuffer(source_buffer), &if_typed_array_is_neutered);
-
-    SetTypedArraySource(context, CAST(source), CAST(receiver),
-                        SmiUntag(offset_smi), &call_runtime,
-                        &if_source_too_large);
-    args.PopAndReturn(UndefinedConstant());
-  }
-
-  // Fast path for a fast JSArray source argument.
-  BIND(&if_source_is_fast_jsarray);
-  {
-    SetJSArraySource(context, CAST(source), CAST(receiver),
-                     SmiUntag(offset_smi), &call_runtime, &if_source_too_large);
-    args.PopAndReturn(UndefinedConstant());
-  }
-
-  BIND(&call_runtime);
-  args.PopAndReturn(CallRuntime(Runtime::kTypedArraySet, context, receiver,
-                                source, offset_smi));
-
-  BIND(&if_offset_is_out_of_bounds);
-  ThrowRangeError(context, MessageTemplate::kTypedArraySetOffsetOutOfBounds);
-
-  BIND(&if_source_too_large);
-  ThrowRangeError(context, MessageTemplate::kTypedArraySetSourceTooLarge);
-
-  BIND(&if_typed_array_is_neutered);
-  ThrowTypeError(context, MessageTemplate::kDetachedOperation,
-                 "%TypedArray%.prototype.set");
-
-  BIND(&if_receiver_is_not_typedarray);
-  ThrowTypeError(context, MessageTemplate::kNotTypedArray);
-}
-
-// ES #sec-get-%typedarray%.prototype-@@tostringtag
-TF_BUILTIN(TypedArrayPrototypeToStringTag, TypedArrayBuiltinsAssembler) {
-  Node* receiver = Parameter(Descriptor::kReceiver);
-  Label if_receiverisheapobject(this), return_undefined(this);
-  Branch(TaggedIsSmi(receiver), &return_undefined, &if_receiverisheapobject);
-
-  // Dispatch on the elements kind, offset by
-  // FIRST_FIXED_TYPED_ARRAY_ELEMENTS_KIND.
-  size_t const kTypedElementsKindCount = LAST_FIXED_TYPED_ARRAY_ELEMENTS_KIND -
-                                         FIRST_FIXED_TYPED_ARRAY_ELEMENTS_KIND +
-                                         1;
-#define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \
-  Label return_##type##array(this);                     \
-  BIND(&return_##type##array);                          \
-  Return(StringConstant(#Type "Array"));
-  TYPED_ARRAYS(TYPED_ARRAY_CASE)
-#undef TYPED_ARRAY_CASE
-  Label* elements_kind_labels[kTypedElementsKindCount] = {
-#define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) &return_##type##array,
-      TYPED_ARRAYS(TYPED_ARRAY_CASE)
-#undef TYPED_ARRAY_CASE
-  };
-  int32_t elements_kinds[kTypedElementsKindCount] = {
-#define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \
-  TYPE##_ELEMENTS - FIRST_FIXED_TYPED_ARRAY_ELEMENTS_KIND,
-      TYPED_ARRAYS(TYPED_ARRAY_CASE)
-#undef TYPED_ARRAY_CASE
-  };
-
-  // We offset the dispatch by FIRST_FIXED_TYPED_ARRAY_ELEMENTS_KIND, so
-  // that this can be turned into a non-sparse table switch for ideal
-  // performance.
-  BIND(&if_receiverisheapobject);
-  Node* elements_kind =
-      Int32Sub(LoadMapElementsKind(LoadMap(receiver)),
-               Int32Constant(FIRST_FIXED_TYPED_ARRAY_ELEMENTS_KIND));
-  Switch(elements_kind, &return_undefined, elements_kinds, elements_kind_labels,
-         kTypedElementsKindCount);
-
-  BIND(&return_undefined);
-  Return(UndefinedConstant());
-}
-
-void TypedArrayBuiltinsAssembler::GenerateTypedArrayPrototypeIterationMethod(
-    Node* context, Node* receiver, const char* method_name,
-    IterationKind iteration_kind) {
-  Label throw_bad_receiver(this, Label::kDeferred);
-  Label throw_typeerror(this, Label::kDeferred);
-
-  GotoIf(TaggedIsSmi(receiver), &throw_bad_receiver);
-
-  Node* map = LoadMap(receiver);
-  Node* instance_type = LoadMapInstanceType(map);
-  GotoIfNot(InstanceTypeEqual(instance_type, JS_TYPED_ARRAY_TYPE),
-            &throw_bad_receiver);
-
-  // Check if the {receiver}'s JSArrayBuffer was neutered.
-  Node* receiver_buffer =
-      LoadObjectField(receiver, JSTypedArray::kBufferOffset);
-  Label if_receiverisneutered(this, Label::kDeferred);
-  GotoIf(IsDetachedBuffer(receiver_buffer), &if_receiverisneutered);
-
-  Return(CreateArrayIterator(receiver, map, instance_type, context,
-                             iteration_kind));
-
-  VARIABLE(var_message, MachineRepresentation::kTagged);
-  BIND(&throw_bad_receiver);
-  var_message.Bind(SmiConstant(MessageTemplate::kNotTypedArray));
-  Goto(&throw_typeerror);
-
-  BIND(&if_receiverisneutered);
-  var_message.Bind(SmiConstant(MessageTemplate::kDetachedOperation));
-  Goto(&throw_typeerror);
-
-  BIND(&throw_typeerror);
-  {
-    Node* method_arg = StringConstant(method_name);
-    Node* result = CallRuntime(Runtime::kThrowTypeError, context,
-                               var_message.value(), method_arg);
-    Return(result);
-  }
-}
-
-// ES6 #sec-%typedarray%.prototype.values
-TF_BUILTIN(TypedArrayPrototypeValues, TypedArrayBuiltinsAssembler) {
-  Node* context = Parameter(Descriptor::kContext);
-  Node* receiver = Parameter(Descriptor::kReceiver);
-  GenerateTypedArrayPrototypeIterationMethod(context, receiver,
-                                             "%TypedArray%.prototype.values()",
-                                             IterationKind::kValues);
-}
-
-// ES6 #sec-%typedarray%.prototype.entries
-TF_BUILTIN(TypedArrayPrototypeEntries, TypedArrayBuiltinsAssembler) {
-  Node* context = Parameter(Descriptor::kContext);
-  Node* receiver = Parameter(Descriptor::kReceiver);
-  GenerateTypedArrayPrototypeIterationMethod(context, receiver,
-                                             "%TypedArray%.prototype.entries()",
-                                             IterationKind::kEntries);
-}
-
-// ES6 #sec-%typedarray%.prototype.keys
-TF_BUILTIN(TypedArrayPrototypeKeys, TypedArrayBuiltinsAssembler) {
-  Node* context = Parameter(Descriptor::kContext);
-  Node* receiver = Parameter(Descriptor::kReceiver);
-  GenerateTypedArrayPrototypeIterationMethod(
-      context, receiver, "%TypedArray%.prototype.keys()", IterationKind::kKeys);
-}
-
-#undef V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/builtins/builtins-typedarray.cc b/src/v8/src/builtins/builtins-typedarray.cc
deleted file mode 100644
index 18625c8..0000000
--- a/src/v8/src/builtins/builtins-typedarray.cc
+++ /dev/null
@@ -1,325 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/builtins/builtins-utils.h"
-#include "src/builtins/builtins.h"
-#include "src/counters.h"
-#include "src/elements.h"
-#include "src/objects-inl.h"
-
-namespace v8 {
-namespace internal {
-
-// -----------------------------------------------------------------------------
-// ES6 section 22.2 TypedArray Objects
-
-// ES6 section 22.2.3.1 get %TypedArray%.prototype.buffer
-BUILTIN(TypedArrayPrototypeBuffer) {
-  HandleScope scope(isolate);
-  CHECK_RECEIVER(JSTypedArray, typed_array,
-                 "get %TypedArray%.prototype.buffer");
-  return *typed_array->GetBuffer();
-}
-
-namespace {
-
-int64_t CapRelativeIndex(Handle<Object> num, int64_t minimum, int64_t maximum) {
-  int64_t relative;
-  if (V8_LIKELY(num->IsSmi())) {
-    relative = Smi::ToInt(*num);
-  } else {
-    DCHECK(num->IsHeapNumber());
-    double fp = HeapNumber::cast(*num)->value();
-    if (V8_UNLIKELY(!std::isfinite(fp))) {
-      // +Infinity / -Infinity
-      DCHECK(!std::isnan(fp));
-      return fp < 0 ? minimum : maximum;
-    }
-    relative = static_cast<int64_t>(fp);
-  }
-  return relative < 0 ? std::max<int64_t>(relative + maximum, minimum)
-                      : std::min<int64_t>(relative, maximum);
-}
-
-MaybeHandle<JSTypedArray> TypedArraySpeciesCreateByLength(
-    Isolate* isolate, Handle<JSTypedArray> exemplar, const char* method_name,
-    int64_t length) {
-  const int argc = 1;
-  ScopedVector<Handle<Object>> argv(argc);
-  argv[0] = isolate->factory()->NewNumberFromInt64(length);
-  return JSTypedArray::SpeciesCreate(isolate, exemplar, argc, argv.start(),
-                                     method_name);
-}
-
-}  // namespace
-
-BUILTIN(TypedArrayPrototypeCopyWithin) {
-  HandleScope scope(isolate);
-
-  Handle<JSTypedArray> array;
-  const char* method = "%TypedArray%.prototype.copyWithin";
-  ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
-      isolate, array, JSTypedArray::Validate(isolate, args.receiver(), method));
-
-  int64_t len = array->length_value();
-  int64_t to = 0;
-  int64_t from = 0;
-  int64_t final = len;
-
-  if (V8_LIKELY(args.length() > 1)) {
-    Handle<Object> num;
-    ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
-        isolate, num, Object::ToInteger(isolate, args.at<Object>(1)));
-    to = CapRelativeIndex(num, 0, len);
-
-    if (args.length() > 2) {
-      ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
-          isolate, num, Object::ToInteger(isolate, args.at<Object>(2)));
-      from = CapRelativeIndex(num, 0, len);
-
-      Handle<Object> end = args.atOrUndefined(isolate, 3);
-      if (!end->IsUndefined(isolate)) {
-        ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, num,
-                                           Object::ToInteger(isolate, end));
-        final = CapRelativeIndex(num, 0, len);
-      }
-    }
-  }
-
-  int64_t count = std::min<int64_t>(final - from, len - to);
-  if (count <= 0) return *array;
-
-  // TypedArray buffer may have been transferred/detached during parameter
-  // processing above. Return early in this case, to prevent potential UAF error
-  // TODO(caitp): throw here, as though the full algorithm were performed (the
-  // throw would have come from ecma262/#sec-integerindexedelementget)
-  // (see )
-  if (V8_UNLIKELY(array->WasNeutered())) return *array;
-
-  // Ensure processed indexes are within array bounds
-  DCHECK_GE(from, 0);
-  DCHECK_LT(from, len);
-  DCHECK_GE(to, 0);
-  DCHECK_LT(to, len);
-  DCHECK_GE(len - count, 0);
-
-  Handle<FixedTypedArrayBase> elements(
-      FixedTypedArrayBase::cast(array->elements()));
-  size_t element_size = array->element_size();
-  to = to * element_size;
-  from = from * element_size;
-  count = count * element_size;
-
-  uint8_t* data = static_cast<uint8_t*>(elements->DataPtr());
-  std::memmove(data + to, data + from, count);
-
-  return *array;
-}
-
-BUILTIN(TypedArrayPrototypeFill) {
-  HandleScope scope(isolate);
-
-  Handle<JSTypedArray> array;
-  const char* method = "%TypedArray%.prototype.fill";
-  ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
-      isolate, array, JSTypedArray::Validate(isolate, args.receiver(), method));
-
-  Handle<Object> obj_value = args.atOrUndefined(isolate, 1);
-  ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
-      isolate, obj_value, Object::ToNumber(obj_value));
-
-  int64_t len = array->length_value();
-  int64_t start = 0;
-  int64_t end = len;
-
-  if (args.length() > 2) {
-    Handle<Object> num = args.atOrUndefined(isolate, 2);
-    if (!num->IsUndefined(isolate)) {
-      ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
-          isolate, num, Object::ToInteger(isolate, num));
-      start = CapRelativeIndex(num, 0, len);
-
-      num = args.atOrUndefined(isolate, 3);
-      if (!num->IsUndefined(isolate)) {
-        ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
-            isolate, num, Object::ToInteger(isolate, num));
-        end = CapRelativeIndex(num, 0, len);
-      }
-    }
-  }
-
-  int64_t count = end - start;
-  if (count <= 0) return *array;
-
-  if (V8_UNLIKELY(array->WasNeutered())) return *array;
-
-  // Ensure processed indexes are within array bounds
-  DCHECK_GE(start, 0);
-  DCHECK_LT(start, len);
-  DCHECK_GE(end, 0);
-  DCHECK_LE(end, len);
-  DCHECK_LE(count, len);
-
-  return array->GetElementsAccessor()->Fill(isolate, array, obj_value,
-                                            static_cast<uint32_t>(start),
-                                            static_cast<uint32_t>(end));
-}
-
-BUILTIN(TypedArrayPrototypeIncludes) {
-  HandleScope scope(isolate);
-
-  Handle<JSTypedArray> array;
-  const char* method = "%TypedArray%.prototype.includes";
-  ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
-      isolate, array, JSTypedArray::Validate(isolate, args.receiver(), method));
-
-  if (args.length() < 2) return isolate->heap()->false_value();
-
-  int64_t len = array->length_value();
-  if (len == 0) return isolate->heap()->false_value();
-
-  int64_t index = 0;
-  if (args.length() > 2) {
-    Handle<Object> num;
-    ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
-        isolate, num, Object::ToInteger(isolate, args.at<Object>(2)));
-    index = CapRelativeIndex(num, 0, len);
-  }
-
-  // TODO(cwhan.tunz): throw. See the above comment in CopyWithin.
-  if (V8_UNLIKELY(array->WasNeutered())) return isolate->heap()->false_value();
-
-  Handle<Object> search_element = args.atOrUndefined(isolate, 1);
-  ElementsAccessor* elements = array->GetElementsAccessor();
-  Maybe<bool> result = elements->IncludesValue(isolate, array, search_element,
-                                               static_cast<uint32_t>(index),
-                                               static_cast<uint32_t>(len));
-  MAYBE_RETURN(result, isolate->heap()->exception());
-  return *isolate->factory()->ToBoolean(result.FromJust());
-}
-
-BUILTIN(TypedArrayPrototypeIndexOf) {
-  HandleScope scope(isolate);
-
-  Handle<JSTypedArray> array;
-  const char* method = "%TypedArray%.prototype.indexOf";
-  ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
-      isolate, array, JSTypedArray::Validate(isolate, args.receiver(), method));
-
-  int64_t len = array->length_value();
-  if (len == 0) return Smi::FromInt(-1);
-
-  int64_t index = 0;
-  if (args.length() > 2) {
-    Handle<Object> num;
-    ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
-        isolate, num, Object::ToInteger(isolate, args.at<Object>(2)));
-    index = CapRelativeIndex(num, 0, len);
-  }
-
-  // TODO(cwhan.tunz): throw. See the above comment in CopyWithin.
-  if (V8_UNLIKELY(array->WasNeutered())) return Smi::FromInt(-1);
-
-  Handle<Object> search_element = args.atOrUndefined(isolate, 1);
-  ElementsAccessor* elements = array->GetElementsAccessor();
-  Maybe<int64_t> result = elements->IndexOfValue(isolate, array, search_element,
-                                                 static_cast<uint32_t>(index),
-                                                 static_cast<uint32_t>(len));
-  MAYBE_RETURN(result, isolate->heap()->exception());
-  return *isolate->factory()->NewNumberFromInt64(result.FromJust());
-}
-
-BUILTIN(TypedArrayPrototypeLastIndexOf) {
-  HandleScope scope(isolate);
-
-  Handle<JSTypedArray> array;
-  const char* method = "%TypedArray%.prototype.lastIndexOf";
-  ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
-      isolate, array, JSTypedArray::Validate(isolate, args.receiver(), method));
-
-  int64_t len = array->length_value();
-  if (len == 0) return Smi::FromInt(-1);
-
-  int64_t index = len - 1;
-  if (args.length() > 2) {
-    Handle<Object> num;
-    ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
-        isolate, num, Object::ToInteger(isolate, args.at<Object>(2)));
-    // Set a negative value (-1) for returning -1 if num is negative and
-    // len + num is still negative. Upper bound is len - 1.
-    index = std::min<int64_t>(CapRelativeIndex(num, -1, len), len - 1);
-  }
-
-  if (index < 0) return Smi::FromInt(-1);
-
-  // TODO(cwhan.tunz): throw. See the above comment in CopyWithin.
-  if (V8_UNLIKELY(array->WasNeutered())) return Smi::FromInt(-1);
-
-  Handle<Object> search_element = args.atOrUndefined(isolate, 1);
-  ElementsAccessor* elements = array->GetElementsAccessor();
-  Maybe<int64_t> result = elements->LastIndexOfValue(
-      isolate, array, search_element, static_cast<uint32_t>(index));
-  MAYBE_RETURN(result, isolate->heap()->exception());
-  return *isolate->factory()->NewNumberFromInt64(result.FromJust());
-}
-
-BUILTIN(TypedArrayPrototypeReverse) {
-  HandleScope scope(isolate);
-
-  Handle<JSTypedArray> array;
-  const char* method = "%TypedArray%.prototype.reverse";
-  ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
-      isolate, array, JSTypedArray::Validate(isolate, args.receiver(), method));
-
-  ElementsAccessor* elements = array->GetElementsAccessor();
-  elements->Reverse(*array);
-  return *array;
-}
-
-BUILTIN(TypedArrayPrototypeSlice) {
-  HandleScope scope(isolate);
-
-  Handle<JSTypedArray> array;
-  const char* method = "%TypedArray%.prototype.slice";
-  ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
-      isolate, array, JSTypedArray::Validate(isolate, args.receiver(), method));
-
-  int64_t len = array->length_value();
-  int64_t start = 0;
-  int64_t end = len;
-  {
-    Handle<Object> num = args.atOrUndefined(isolate, 1);
-    if (!num->IsUndefined(isolate)) {
-      ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, num,
-                                         Object::ToInteger(isolate, num));
-      start = CapRelativeIndex(num, 0, len);
-
-      num = args.atOrUndefined(isolate, 2);
-      if (!num->IsUndefined(isolate)) {
-        ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, num,
-                                           Object::ToInteger(isolate, num));
-        end = CapRelativeIndex(num, 0, len);
-      }
-    }
-  }
-
-  int64_t count = std::max<int64_t>(end - start, 0);
-
-  Handle<JSTypedArray> result_array;
-  ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
-      isolate, result_array,
-      TypedArraySpeciesCreateByLength(isolate, array, method, count));
-
-  // TODO(cwhan.tunz): should throw.
-  if (V8_UNLIKELY(array->WasNeutered())) return *result_array;
-
-  if (count == 0) return *result_array;
-
-  ElementsAccessor* accessor = array->GetElementsAccessor();
-  return *accessor->Slice(array, static_cast<uint32_t>(start),
-                          static_cast<uint32_t>(end), result_array);
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler-dispatcher/compiler-dispatcher-job.cc b/src/v8/src/compiler-dispatcher/compiler-dispatcher-job.cc
deleted file mode 100644
index 9e46556..0000000
--- a/src/v8/src/compiler-dispatcher/compiler-dispatcher-job.cc
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/compiler-dispatcher/compiler-dispatcher-job.h"
-
-#include "src/compiler-dispatcher/unoptimized-compile-job.h"
-
-namespace v8 {
-namespace internal {
-
-const UnoptimizedCompileJob* CompilerDispatcherJob::AsUnoptimizedCompileJob()
-    const {
-  DCHECK_EQ(type(), Type::kUnoptimizedCompile);
-  return static_cast<const UnoptimizedCompileJob*>(this);
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler-dispatcher/compiler-dispatcher-job.h b/src/v8/src/compiler-dispatcher/compiler-dispatcher-job.h
deleted file mode 100644
index aed4960..0000000
--- a/src/v8/src/compiler-dispatcher/compiler-dispatcher-job.h
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_JOB_H_
-#define V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_JOB_H_
-
-#include "src/contexts.h"
-#include "src/handles.h"
-
-namespace v8 {
-namespace internal {
-
-class SharedFunctionInfo;
-
-class UnoptimizedCompileJob;
-
-class V8_EXPORT_PRIVATE CompilerDispatcherJob {
- public:
-  enum class Type { kUnoptimizedCompile };
-
-  enum class Status {
-    kInitial,
-    kPrepared,
-    kCompiled,
-    kHasErrorsToReport,
-    kDone,
-    kFailed,
-  };
-
-  CompilerDispatcherJob(Type type) : type_(type), status_(Status::kInitial) {}
-
-  virtual ~CompilerDispatcherJob() {}
-
-  Type type() const { return type_; }
-
-  // Returns the current status of the compile
-  Status status() const { return status_; }
-
-  // Returns true if this CompilerDispatcherJob has finished (either with a
-  // success or a failure).
-  bool IsFinished() const {
-    return status() == Status::kDone || status() == Status::kFailed;
-  }
-
-  // Returns true if this CompilerDispatcherJob has failed.
-  bool IsFailed() const { return status() == Status::kFailed; }
-
-  // Return true if the next step can be run on any thread.
-  bool NextStepCanRunOnAnyThread() const {
-    return status() == Status::kPrepared;
-  }
-
-  // Casts to implementations.
-  const UnoptimizedCompileJob* AsUnoptimizedCompileJob() const;
-
-  // Transition from kInitial to kPrepared. Must only be invoked on the
-  // main thread.
-  virtual void PrepareOnMainThread(Isolate* isolate) = 0;
-
-  // Transition from kPrepared to kCompiled (or kReportErrors).
-  virtual void Compile(bool on_background_thread) = 0;
-
-  // Transition from kCompiled to kDone (or kFailed). Must only be invoked on
-  // the main thread.
-  virtual void FinalizeOnMainThread(Isolate* isolate) = 0;
-
-  // Transition from kReportErrors to kFailed. Must only be invoked on the main
-  // thread.
-  virtual void ReportErrorsOnMainThread(Isolate* isolate) = 0;
-
-  // Free all resources. Must only be invoked on the main thread.
-  virtual void ResetOnMainThread(Isolate* isolate) = 0;
-
-  // Estimate how long the next step will take using the tracer.
-  virtual double EstimateRuntimeOfNextStepInMs() const = 0;
-
-  // Print short description of job. Must only be invoked on the main thread.
-  virtual void ShortPrintOnMainThread() = 0;
-
- protected:
-  void set_status(Status status) { status_ = status; }
-
- private:
-  Type type_;
-  Status status_;
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_JOB_H_
diff --git a/src/v8/src/compiler-dispatcher/compiler-dispatcher-tracer.cc b/src/v8/src/compiler-dispatcher/compiler-dispatcher-tracer.cc
deleted file mode 100644
index 862efda..0000000
--- a/src/v8/src/compiler-dispatcher/compiler-dispatcher-tracer.cc
+++ /dev/null
@@ -1,127 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/compiler-dispatcher/compiler-dispatcher-tracer.h"
-
-#include "src/isolate.h"
-#include "src/utils.h"
-
-namespace v8 {
-namespace internal {
-
-namespace {
-
-double MonotonicallyIncreasingTimeInMs() {
-  return V8::GetCurrentPlatform()->MonotonicallyIncreasingTime() *
-         static_cast<double>(base::Time::kMillisecondsPerSecond);
-}
-
-const double kEstimatedRuntimeWithoutData = 1.0;
-
-}  // namespace
-
-CompilerDispatcherTracer::Scope::Scope(CompilerDispatcherTracer* tracer,
-                                       ScopeID scope_id, size_t num)
-    : tracer_(tracer), scope_id_(scope_id), num_(num) {
-  start_time_ = MonotonicallyIncreasingTimeInMs();
-}
-
-CompilerDispatcherTracer::Scope::~Scope() {
-  double elapsed = MonotonicallyIncreasingTimeInMs() - start_time_;
-  switch (scope_id_) {
-    case ScopeID::kPrepare:
-      tracer_->RecordPrepare(elapsed);
-      break;
-    case ScopeID::kCompile:
-      tracer_->RecordCompile(elapsed, num_);
-      break;
-    case ScopeID::kFinalize:
-      tracer_->RecordFinalize(elapsed);
-      break;
-  }
-}
-
-// static
-const char* CompilerDispatcherTracer::Scope::Name(ScopeID scope_id) {
-  switch (scope_id) {
-    case ScopeID::kPrepare:
-      return "V8.BackgroundCompile_Prepare";
-    case ScopeID::kCompile:
-      return "V8.BackgroundCompile_Compile";
-    case ScopeID::kFinalize:
-      return "V8.BackgroundCompile_Finalize";
-  }
-  UNREACHABLE();
-}
-
-CompilerDispatcherTracer::CompilerDispatcherTracer(Isolate* isolate)
-    : runtime_call_stats_(nullptr) {
-  // isolate might be nullptr during unittests.
-  if (isolate) {
-    runtime_call_stats_ = isolate->counters()->runtime_call_stats();
-  }
-}
-
-CompilerDispatcherTracer::~CompilerDispatcherTracer() {}
-
-void CompilerDispatcherTracer::RecordPrepare(double duration_ms) {
-  base::LockGuard<base::Mutex> lock(&mutex_);
-  prepare_events_.Push(duration_ms);
-}
-
-void CompilerDispatcherTracer::RecordCompile(double duration_ms,
-                                             size_t source_length) {
-  base::LockGuard<base::Mutex> lock(&mutex_);
-  compile_events_.Push(std::make_pair(source_length, duration_ms));
-}
-
-void CompilerDispatcherTracer::RecordFinalize(double duration_ms) {
-  base::LockGuard<base::Mutex> lock(&mutex_);
-  finalize_events_.Push(duration_ms);
-}
-
-double CompilerDispatcherTracer::EstimatePrepareInMs() const {
-  base::LockGuard<base::Mutex> lock(&mutex_);
-  return Average(prepare_events_);
-}
-
-double CompilerDispatcherTracer::EstimateCompileInMs(
-    size_t source_length) const {
-  base::LockGuard<base::Mutex> lock(&mutex_);
-  return Estimate(compile_events_, source_length);
-}
-
-double CompilerDispatcherTracer::EstimateFinalizeInMs() const {
-  base::LockGuard<base::Mutex> lock(&mutex_);
-  return Average(finalize_events_);
-}
-
-void CompilerDispatcherTracer::DumpStatistics() const {
-  PrintF(
-      "CompilerDispatcherTracer: "
-      "prepare=%.2lfms compiling=%.2lfms/kb finalize=%.2lfms\n",
-      EstimatePrepareInMs(), EstimateCompileInMs(1 * KB),
-      EstimateFinalizeInMs());
-}
-
-double CompilerDispatcherTracer::Average(
-    const base::RingBuffer<double>& buffer) {
-  if (buffer.Count() == 0) return 0.0;
-  double sum = buffer.Sum([](double a, double b) { return a + b; }, 0.0);
-  return sum / buffer.Count();
-}
-
-double CompilerDispatcherTracer::Estimate(
-    const base::RingBuffer<std::pair<size_t, double>>& buffer, size_t num) {
-  if (buffer.Count() == 0) return kEstimatedRuntimeWithoutData;
-  std::pair<size_t, double> sum = buffer.Sum(
-      [](std::pair<size_t, double> a, std::pair<size_t, double> b) {
-        return std::make_pair(a.first + b.first, a.second + b.second);
-      },
-      std::make_pair(0, 0.0));
-  return num * (sum.second / sum.first);
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler-dispatcher/compiler-dispatcher-tracer.h b/src/v8/src/compiler-dispatcher/compiler-dispatcher-tracer.h
deleted file mode 100644
index 3043e07..0000000
--- a/src/v8/src/compiler-dispatcher/compiler-dispatcher-tracer.h
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_TRACER_H_
-#define V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_TRACER_H_
-
-#include <utility>
-
-#include "src/base/macros.h"
-#include "src/base/platform/mutex.h"
-#include "src/base/ring-buffer.h"
-#include "src/counters.h"
-#include "src/globals.h"
-
-namespace v8 {
-namespace internal {
-
-class Isolate;
-class RuntimeCallStats;
-
-#define COMPILER_DISPATCHER_TRACE_SCOPE_WITH_NUM(tracer, scope_id, num)      \
-  CompilerDispatcherTracer::ScopeID tracer_scope_id(                         \
-      CompilerDispatcherTracer::ScopeID::scope_id);                          \
-  CompilerDispatcherTracer::Scope trace_scope(tracer, tracer_scope_id, num); \
-  TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),                      \
-               CompilerDispatcherTracer::Scope::Name(tracer_scope_id))
-
-#define COMPILER_DISPATCHER_TRACE_SCOPE(tracer, scope_id) \
-  COMPILER_DISPATCHER_TRACE_SCOPE_WITH_NUM(tracer, scope_id, 0)
-
-class V8_EXPORT_PRIVATE CompilerDispatcherTracer {
- public:
-  enum class ScopeID { kPrepare, kCompile, kFinalize };
-
-  class Scope {
-   public:
-    Scope(CompilerDispatcherTracer* tracer, ScopeID scope_id, size_t num = 0);
-    ~Scope();
-
-    static const char* Name(ScopeID scoped_id);
-
-   private:
-    CompilerDispatcherTracer* tracer_;
-    ScopeID scope_id_;
-    size_t num_;
-    double start_time_;
-
-    DISALLOW_COPY_AND_ASSIGN(Scope);
-  };
-
-  explicit CompilerDispatcherTracer(Isolate* isolate);
-  ~CompilerDispatcherTracer();
-
-  void RecordPrepare(double duration_ms);
-  void RecordCompile(double duration_ms, size_t source_length);
-  void RecordFinalize(double duration_ms);
-
-  double EstimatePrepareInMs() const;
-  double EstimateCompileInMs(size_t source_length) const;
-  double EstimateFinalizeInMs() const;
-
-  void DumpStatistics() const;
-
- private:
-  static double Average(const base::RingBuffer<double>& buffer);
-  static double Estimate(
-      const base::RingBuffer<std::pair<size_t, double>>& buffer, size_t num);
-
-  mutable base::Mutex mutex_;
-  base::RingBuffer<double> prepare_events_;
-  base::RingBuffer<std::pair<size_t, double>> compile_events_;
-  base::RingBuffer<double> finalize_events_;
-
-  RuntimeCallStats* runtime_call_stats_;
-
-  DISALLOW_COPY_AND_ASSIGN(CompilerDispatcherTracer);
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_TRACER_H_
diff --git a/src/v8/src/compiler-dispatcher/unoptimized-compile-job.cc b/src/v8/src/compiler-dispatcher/unoptimized-compile-job.cc
deleted file mode 100644
index 74b2352..0000000
--- a/src/v8/src/compiler-dispatcher/unoptimized-compile-job.cc
+++ /dev/null
@@ -1,390 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/compiler-dispatcher/unoptimized-compile-job.h"
-
-#include "src/assert-scope.h"
-#include "src/base/optional.h"
-#include "src/compilation-info.h"
-#include "src/compiler-dispatcher/compiler-dispatcher-tracer.h"
-#include "src/compiler.h"
-#include "src/flags.h"
-#include "src/global-handles.h"
-#include "src/interpreter/interpreter.h"
-#include "src/isolate.h"
-#include "src/objects-inl.h"
-#include "src/parsing/parse-info.h"
-#include "src/parsing/parser.h"
-#include "src/parsing/scanner-character-streams.h"
-#include "src/unicode-cache.h"
-#include "src/utils.h"
-
-namespace v8 {
-namespace internal {
-
-namespace {
-
-class OneByteWrapper : public v8::String::ExternalOneByteStringResource {
- public:
-  OneByteWrapper(const void* data, int length) : data_(data), length_(length) {}
-  ~OneByteWrapper() override = default;
-
-  const char* data() const override {
-    return reinterpret_cast<const char*>(data_);
-  }
-
-  size_t length() const override { return static_cast<size_t>(length_); }
-
- private:
-  const void* data_;
-  int length_;
-
-  DISALLOW_COPY_AND_ASSIGN(OneByteWrapper);
-};
-
-class TwoByteWrapper : public v8::String::ExternalStringResource {
- public:
-  TwoByteWrapper(const void* data, int length) : data_(data), length_(length) {}
-  ~TwoByteWrapper() override = default;
-
-  const uint16_t* data() const override {
-    return reinterpret_cast<const uint16_t*>(data_);
-  }
-
-  size_t length() const override { return static_cast<size_t>(length_); }
-
- private:
-  const void* data_;
-  int length_;
-
-  DISALLOW_COPY_AND_ASSIGN(TwoByteWrapper);
-};
-
-}  // namespace
-
-UnoptimizedCompileJob::UnoptimizedCompileJob(Isolate* isolate,
-                                             CompilerDispatcherTracer* tracer,
-                                             Handle<SharedFunctionInfo> shared,
-                                             size_t max_stack_size)
-    : CompilerDispatcherJob(Type::kUnoptimizedCompile),
-      main_thread_id_(isolate->thread_id().ToInteger()),
-      tracer_(tracer),
-      allocator_(isolate->allocator()),
-      context_(isolate->global_handles()->Create(isolate->context())),
-      shared_(isolate->global_handles()->Create(*shared)),
-      max_stack_size_(max_stack_size),
-      trace_compiler_dispatcher_jobs_(FLAG_trace_compiler_dispatcher_jobs) {
-  DCHECK(!shared_->is_toplevel());
-  // TODO(rmcilroy): Handle functions with non-empty outer scope info.
-  DCHECK(shared_->outer_scope_info()->IsTheHole(isolate) ||
-         ScopeInfo::cast(shared_->outer_scope_info())->length() == 0);
-  HandleScope scope(isolate);
-  Handle<Script> script(Script::cast(shared_->script()), isolate);
-  Handle<String> source(String::cast(script->source()), isolate);
-  if (trace_compiler_dispatcher_jobs_) {
-    PrintF("UnoptimizedCompileJob[%p] created for ", static_cast<void*>(this));
-    ShortPrintOnMainThread();
-    PrintF(" in initial state.\n");
-  }
-}
-
-UnoptimizedCompileJob::~UnoptimizedCompileJob() {
-  DCHECK(status() == Status::kInitial || status() == Status::kDone);
-  if (!shared_.is_null()) {
-    DCHECK_EQ(ThreadId::Current().ToInteger(), main_thread_id_);
-    i::GlobalHandles::Destroy(Handle<Object>::cast(shared_).location());
-  }
-  if (!context_.is_null()) {
-    DCHECK_EQ(ThreadId::Current().ToInteger(), main_thread_id_);
-    i::GlobalHandles::Destroy(Handle<Object>::cast(context_).location());
-  }
-}
-
-bool UnoptimizedCompileJob::IsAssociatedWith(
-    Handle<SharedFunctionInfo> shared) const {
-  return *shared_ == *shared;
-}
-
-void UnoptimizedCompileJob::PrepareOnMainThread(Isolate* isolate) {
-  DCHECK_EQ(ThreadId::Current().ToInteger(), main_thread_id_);
-  DCHECK_EQ(isolate->thread_id().ToInteger(), main_thread_id_);
-  DCHECK_EQ(status(), Status::kInitial);
-  COMPILER_DISPATCHER_TRACE_SCOPE(tracer_, kPrepare);
-
-  if (trace_compiler_dispatcher_jobs_) {
-    PrintF("UnoptimizedCompileJob[%p]: Preparing to parse\n",
-           static_cast<void*>(this));
-  }
-
-  HandleScope scope(isolate);
-  unicode_cache_.reset(new UnicodeCache());
-  Handle<Script> script(Script::cast(shared_->script()), isolate);
-  DCHECK(script->type() != Script::TYPE_NATIVE);
-
-  Handle<String> source(String::cast(script->source()), isolate);
-  parse_info_.reset(new ParseInfo(isolate->allocator()));
-  parse_info_->InitFromIsolate(isolate);
-  if (source->IsExternalTwoByteString() || source->IsExternalOneByteString()) {
-    std::unique_ptr<Utf16CharacterStream> stream(ScannerStream::For(
-        source, shared_->start_position(), shared_->end_position()));
-    parse_info_->set_character_stream(std::move(stream));
-  } else {
-    source = String::Flatten(source);
-    const void* data;
-    int offset = 0;
-    int length = source->length();
-
-    // Objects in lo_space don't move, so we can just read the contents from
-    // any thread.
-    if (isolate->heap()->lo_space()->Contains(*source)) {
-      // We need to globalize the handle to the flattened string here, in
-      // case it's not referenced from anywhere else.
-      source_ = isolate->global_handles()->Create(*source);
-      DisallowHeapAllocation no_allocation;
-      String::FlatContent content = source->GetFlatContent();
-      DCHECK(content.IsFlat());
-      data =
-          content.IsOneByte()
-              ? reinterpret_cast<const void*>(content.ToOneByteVector().start())
-              : reinterpret_cast<const void*>(content.ToUC16Vector().start());
-    } else {
-      // Otherwise, create a copy of the part of the string we'll parse in the
-      // zone.
-      length = (shared_->end_position() - shared_->start_position());
-      offset = shared_->start_position();
-
-      int byte_len = length * (source->IsOneByteRepresentation() ? 1 : 2);
-      data = parse_info_->zone()->New(byte_len);
-
-      DisallowHeapAllocation no_allocation;
-      String::FlatContent content = source->GetFlatContent();
-      DCHECK(content.IsFlat());
-      if (content.IsOneByte()) {
-        MemCopy(const_cast<void*>(data),
-                &content.ToOneByteVector().at(shared_->start_position()),
-                byte_len);
-      } else {
-        MemCopy(const_cast<void*>(data),
-                &content.ToUC16Vector().at(shared_->start_position()),
-                byte_len);
-      }
-    }
-    Handle<String> wrapper;
-    if (source->IsOneByteRepresentation()) {
-      ExternalOneByteString::Resource* resource =
-          new OneByteWrapper(data, length);
-      source_wrapper_.reset(resource);
-      wrapper = isolate->factory()
-                    ->NewExternalStringFromOneByte(resource)
-                    .ToHandleChecked();
-    } else {
-      ExternalTwoByteString::Resource* resource =
-          new TwoByteWrapper(data, length);
-      source_wrapper_.reset(resource);
-      wrapper = isolate->factory()
-                    ->NewExternalStringFromTwoByte(resource)
-                    .ToHandleChecked();
-    }
-    wrapper_ = isolate->global_handles()->Create(*wrapper);
-    std::unique_ptr<Utf16CharacterStream> stream(
-        ScannerStream::For(wrapper_, shared_->start_position() - offset,
-                           shared_->end_position() - offset));
-    parse_info_->set_character_stream(std::move(stream));
-  }
-  parse_info_->set_hash_seed(isolate->heap()->HashSeed());
-  parse_info_->set_is_named_expression(shared_->is_named_expression());
-  parse_info_->set_compiler_hints(shared_->compiler_hints());
-  parse_info_->set_start_position(shared_->start_position());
-  parse_info_->set_end_position(shared_->end_position());
-  parse_info_->set_unicode_cache(unicode_cache_.get());
-  parse_info_->set_language_mode(shared_->language_mode());
-  parse_info_->set_function_literal_id(shared_->function_literal_id());
-  if (V8_UNLIKELY(FLAG_runtime_stats)) {
-    parse_info_->set_runtime_call_stats(new (parse_info_->zone())
-                                            RuntimeCallStats());
-  }
-
-  parser_.reset(new Parser(parse_info_.get()));
-  MaybeHandle<ScopeInfo> outer_scope_info;
-  if (!shared_->outer_scope_info()->IsTheHole(isolate) &&
-      ScopeInfo::cast(shared_->outer_scope_info())->length() > 0) {
-    outer_scope_info = handle(ScopeInfo::cast(shared_->outer_scope_info()));
-  }
-  parser_->DeserializeScopeChain(parse_info_.get(), outer_scope_info);
-
-  Handle<String> name(shared_->name());
-  parse_info_->set_function_name(
-      parse_info_->ast_value_factory()->GetString(name));
-  set_status(Status::kPrepared);
-}
-
-void UnoptimizedCompileJob::Compile(bool on_background_thread) {
-  DCHECK_EQ(status(), Status::kPrepared);
-  COMPILER_DISPATCHER_TRACE_SCOPE_WITH_NUM(
-      tracer_, kCompile,
-      parse_info_->end_position() - parse_info_->start_position());
-  if (trace_compiler_dispatcher_jobs_) {
-    PrintF("UnoptimizedCompileJob[%p]: Compiling\n", static_cast<void*>(this));
-  }
-
-  DisallowHeapAllocation no_allocation;
-  DisallowHandleAllocation no_handles;
-  DisallowHandleDereference no_deref;
-
-  parse_info_->set_on_background_thread(on_background_thread);
-  uintptr_t stack_limit = GetCurrentStackPosition() - max_stack_size_ * KB;
-  parser_->set_stack_limit(stack_limit);
-  parse_info_->set_stack_limit(stack_limit);
-  parser_->ParseOnBackground(parse_info_.get());
-
-  if (parse_info_->literal() == nullptr) {
-    // Parser sets error in pending error handler.
-    set_status(Status::kHasErrorsToReport);
-    return;
-  }
-
-  if (!Compiler::Analyze(parse_info_.get())) {
-    parse_info_->pending_error_handler()->set_stack_overflow();
-    set_status(Status::kHasErrorsToReport);
-    return;
-  }
-
-  compilation_job_.reset(interpreter::Interpreter::NewCompilationJob(
-      parse_info_.get(), parse_info_->literal(), allocator_));
-
-  if (!compilation_job_.get()) {
-    parse_info_->pending_error_handler()->set_stack_overflow();
-    set_status(Status::kHasErrorsToReport);
-    return;
-  }
-
-  if (compilation_job_->ExecuteJob() != CompilationJob::SUCCEEDED) {
-    parse_info_->pending_error_handler()->set_stack_overflow();
-    set_status(Status::kHasErrorsToReport);
-    return;
-  }
-
-  set_status(Status::kCompiled);
-}
-
-void UnoptimizedCompileJob::FinalizeOnMainThread(Isolate* isolate) {
-  DCHECK_EQ(ThreadId::Current().ToInteger(), main_thread_id_);
-  DCHECK_EQ(isolate->thread_id().ToInteger(), main_thread_id_);
-  DCHECK_EQ(status(), Status::kCompiled);
-  DCHECK_NOT_NULL(parse_info_->literal());
-  DCHECK_NOT_NULL(compilation_job_.get());
-  COMPILER_DISPATCHER_TRACE_SCOPE(tracer_, kFinalize);
-  if (trace_compiler_dispatcher_jobs_) {
-    PrintF("UnoptimizedCompileJob[%p]: Finalizing compiling\n",
-           static_cast<void*>(this));
-  }
-
-  Handle<Script> script(Script::cast(shared_->script()), isolate);
-  parse_info_->set_script(script);
-  parser_->UpdateStatistics(isolate, script);
-  parse_info_->UpdateBackgroundParseStatisticsOnMainThread(isolate);
-  parser_->HandleSourceURLComments(isolate, script);
-
-  {
-    HandleScope scope(isolate);
-    // Internalize ast values onto the heap.
-    parse_info_->ast_value_factory()->Internalize(isolate);
-    // Allocate scope infos for the literal.
-    DeclarationScope::AllocateScopeInfos(parse_info_.get(), isolate,
-                                         AnalyzeMode::kRegular);
-    compilation_job_->compilation_info()->set_shared_info(shared_);
-    if (compilation_job_->state() == CompilationJob::State::kFailed ||
-        !Compiler::FinalizeCompilationJob(compilation_job_.release(),
-                                          isolate)) {
-      if (!isolate->has_pending_exception()) isolate->StackOverflow();
-      set_status(Status::kFailed);
-      return;
-    }
-  }
-
-  ResetDataOnMainThread(isolate);
-  set_status(Status::kDone);
-}
-
-void UnoptimizedCompileJob::ReportErrorsOnMainThread(Isolate* isolate) {
-  DCHECK_EQ(ThreadId::Current().ToInteger(), main_thread_id_);
-  DCHECK_EQ(isolate->thread_id().ToInteger(), main_thread_id_);
-  DCHECK_EQ(status(), Status::kHasErrorsToReport);
-
-  if (trace_compiler_dispatcher_jobs_) {
-    PrintF("UnoptimizedCompileJob[%p]: Reporting Errors\n",
-           static_cast<void*>(this));
-  }
-
-  // Ensure we report errors in the correct context for the job.
-  SaveContext save(isolate);
-  isolate->set_context(context());
-
-  Handle<Script> script(Script::cast(shared_->script()), isolate);
-  parse_info_->pending_error_handler()->ReportErrors(
-      isolate, script, parse_info_->ast_value_factory());
-
-  ResetDataOnMainThread(isolate);
-  set_status(Status::kFailed);
-}
-
-void UnoptimizedCompileJob::ResetDataOnMainThread(Isolate* isolate) {
-  DCHECK_EQ(ThreadId::Current().ToInteger(), main_thread_id_);
-  DCHECK_EQ(isolate->thread_id().ToInteger(), main_thread_id_);
-
-  compilation_job_.reset();
-  parser_.reset();
-  unicode_cache_.reset();
-  parse_info_.reset();
-
-  if (!source_.is_null()) {
-    DCHECK_EQ(ThreadId::Current().ToInteger(), main_thread_id_);
-    DCHECK_EQ(isolate->thread_id().ToInteger(), main_thread_id_);
-    i::GlobalHandles::Destroy(Handle<Object>::cast(source_).location());
-    source_ = Handle<String>::null();
-  }
-  if (!wrapper_.is_null()) {
-    DCHECK_EQ(ThreadId::Current().ToInteger(), main_thread_id_);
-    DCHECK_EQ(isolate->thread_id().ToInteger(), main_thread_id_);
-    i::GlobalHandles::Destroy(Handle<Object>::cast(wrapper_).location());
-    wrapper_ = Handle<String>::null();
-  }
-}
-
-void UnoptimizedCompileJob::ResetOnMainThread(Isolate* isolate) {
-  if (trace_compiler_dispatcher_jobs_) {
-    PrintF("UnoptimizedCompileJob[%p]: Resetting\n", static_cast<void*>(this));
-  }
-
-  ResetDataOnMainThread(isolate);
-  set_status(Status::kInitial);
-}
-
-double UnoptimizedCompileJob::EstimateRuntimeOfNextStepInMs() const {
-  switch (status()) {
-    case Status::kInitial:
-      return tracer_->EstimatePrepareInMs();
-    case Status::kPrepared:
-      return tracer_->EstimateCompileInMs(parse_info_->end_position() -
-                                          parse_info_->start_position());
-    case Status::kCompiled:
-      return tracer_->EstimateFinalizeInMs();
-
-    case Status::kHasErrorsToReport:
-    case Status::kFailed:
-    case Status::kDone:
-      return 0.0;
-  }
-
-  UNREACHABLE();
-}
-
-void UnoptimizedCompileJob::ShortPrintOnMainThread() {
-  DCHECK_EQ(ThreadId::Current().ToInteger(), main_thread_id_);
-  DCHECK(!shared_.is_null());
-  shared_->ShortPrint();
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler-dispatcher/unoptimized-compile-job.h b/src/v8/src/compiler-dispatcher/unoptimized-compile-job.h
deleted file mode 100644
index 153c8ba..0000000
--- a/src/v8/src/compiler-dispatcher/unoptimized-compile-job.h
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_DISPATCHER_UNOPTIMIZED_COMPILE_JOB_H_
-#define V8_COMPILER_DISPATCHER_UNOPTIMIZED_COMPILE_JOB_H_
-
-#include <memory>
-
-#include "include/v8.h"
-#include "src/base/macros.h"
-#include "src/compiler-dispatcher/compiler-dispatcher-job.h"
-#include "src/globals.h"
-
-namespace v8 {
-namespace internal {
-
-class AstValueFactory;
-class AstStringConstants;
-class CompilerDispatcherTracer;
-class CompilationInfo;
-class CompilationJob;
-class DeferredHandles;
-class FunctionLiteral;
-class Isolate;
-class ParseInfo;
-class Parser;
-class SharedFunctionInfo;
-class String;
-class UnicodeCache;
-class Utf16CharacterStream;
-
-class V8_EXPORT_PRIVATE UnoptimizedCompileJob : public CompilerDispatcherJob {
- public:
-  // Creates a UnoptimizedCompileJob in the initial state.
-  UnoptimizedCompileJob(Isolate* isolate, CompilerDispatcherTracer* tracer,
-                        Handle<SharedFunctionInfo> shared,
-                        size_t max_stack_size);
-  ~UnoptimizedCompileJob() override;
-
-  Handle<SharedFunctionInfo> shared() const { return shared_; }
-
-  // Returns true if this UnoptimizedCompileJob was created for the given
-  // function.
-  bool IsAssociatedWith(Handle<SharedFunctionInfo> shared) const;
-
-  // CompilerDispatcherJob implementation.
-  void PrepareOnMainThread(Isolate* isolate) override;
-  void Compile(bool on_background_thread) override;
-  void FinalizeOnMainThread(Isolate* isolate) override;
-  void ReportErrorsOnMainThread(Isolate* isolate) override;
-  void ResetOnMainThread(Isolate* isolate) override;
-  double EstimateRuntimeOfNextStepInMs() const override;
-  void ShortPrintOnMainThread() override;
-
- private:
-  friend class CompilerDispatcherTest;
-  friend class UnoptimizedCompileJobTest;
-
-  void ResetDataOnMainThread(Isolate* isolate);
-
-  Context* context() { return *context_; }
-
-  int main_thread_id_;
-  CompilerDispatcherTracer* tracer_;
-  AccountingAllocator* allocator_;
-  Handle<Context> context_;            // Global handle.
-  Handle<SharedFunctionInfo> shared_;  // Global handle.
-  Handle<String> source_;              // Global handle.
-  Handle<String> wrapper_;             // Global handle.
-  std::unique_ptr<v8::String::ExternalStringResourceBase> source_wrapper_;
-  size_t max_stack_size_;
-
-  // Members required for parsing.
-  std::unique_ptr<UnicodeCache> unicode_cache_;
-  std::unique_ptr<ParseInfo> parse_info_;
-  std::unique_ptr<Parser> parser_;
-
-  // Members required for compiling.
-  std::unique_ptr<CompilationJob> compilation_job_;
-
-  bool trace_compiler_dispatcher_jobs_;
-
-  DISALLOW_COPY_AND_ASSIGN(UnoptimizedCompileJob);
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_COMPILER_DISPATCHER_UNOPTIMIZED_COMPILE_JOB_H_
diff --git a/src/v8/src/compiler/STYLE b/src/v8/src/compiler/STYLE
deleted file mode 100644
index ae41e3f..0000000
--- a/src/v8/src/compiler/STYLE
+++ /dev/null
@@ -1,29 +0,0 @@
-Compiler Coding Style
-=====================
-
-Coding style for the TurboFan compiler generally follows the Google C++ Style
-Guide and the Chromium Coding Style. The notes below are usually just extensions
-beyond what the Google style guide already says. If this document doesn't
-mention a rule, follow the Google C++ style.
-
-
-TODOs
------
-We use the following convention for putting TODOs into the code:
-
-  * A TODO(turbofan) implies a performance improvement opportunity.
-  * A TODO(name) implies an incomplete implementation.
-
-
-Use of C++11 auto keyword
--------------------------
-Use auto to avoid type names that are just clutter. Continue to use manifest
-type declarations when it helps readability, and never use auto for anything
-but local variables, in particular auto should only be used where it is obvious
-from context what the type is:
-
-  for (auto block : x->blocks())  // clearly a Block of some kind
-  for (auto instr : x->instructions())  // clearly an Instruction of some kind
-
-  for (auto b : x->predecessors()) // less clear, better to make it explicit
-  for (BasicBlock* b : x->predecessors()) // now clear
diff --git a/src/v8/src/compiler/arm/code-generator-arm.cc b/src/v8/src/compiler/arm/code-generator-arm.cc
deleted file mode 100644
index a238cf2..0000000
--- a/src/v8/src/compiler/arm/code-generator-arm.cc
+++ /dev/null
@@ -1,3213 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/compiler/code-generator.h"
-
-#include "src/arm/macro-assembler-arm.h"
-#include "src/assembler-inl.h"
-#include "src/boxed-float.h"
-#include "src/compilation-info.h"
-#include "src/compiler/code-generator-impl.h"
-#include "src/compiler/gap-resolver.h"
-#include "src/compiler/node-matchers.h"
-#include "src/compiler/osr.h"
-#include "src/double.h"
-#include "src/heap/heap-inl.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-#define __ tasm()->
-
-#define kScratchReg r9
-
-
-// Adds Arm-specific methods to convert InstructionOperands.
-class ArmOperandConverter final : public InstructionOperandConverter {
- public:
-  ArmOperandConverter(CodeGenerator* gen, Instruction* instr)
-      : InstructionOperandConverter(gen, instr) {}
-
-  SBit OutputSBit() const {
-    switch (instr_->flags_mode()) {
-      case kFlags_branch:
-      case kFlags_deoptimize:
-      case kFlags_set:
-      case kFlags_trap:
-        return SetCC;
-      case kFlags_none:
-        return LeaveCC;
-    }
-    UNREACHABLE();
-  }
-
-  Operand InputImmediate(size_t index) {
-    Constant constant = ToConstant(instr_->InputAt(index));
-    switch (constant.type()) {
-      case Constant::kInt32:
-        return Operand(constant.ToInt32());
-      case Constant::kFloat32:
-        return Operand::EmbeddedNumber(constant.ToFloat32());
-      case Constant::kFloat64:
-        return Operand::EmbeddedNumber(constant.ToFloat64().value());
-      case Constant::kInt64:
-      case Constant::kExternalReference:
-      case Constant::kHeapObject:
-      case Constant::kRpoNumber:
-        break;
-    }
-    UNREACHABLE();
-  }
-
-  Operand InputOperand2(size_t first_index) {
-    const size_t index = first_index;
-    switch (AddressingModeField::decode(instr_->opcode())) {
-      case kMode_None:
-      case kMode_Offset_RI:
-      case kMode_Offset_RR:
-        break;
-      case kMode_Operand2_I:
-        return InputImmediate(index + 0);
-      case kMode_Operand2_R:
-        return Operand(InputRegister(index + 0));
-      case kMode_Operand2_R_ASR_I:
-        return Operand(InputRegister(index + 0), ASR, InputInt5(index + 1));
-      case kMode_Operand2_R_ASR_R:
-        return Operand(InputRegister(index + 0), ASR, InputRegister(index + 1));
-      case kMode_Operand2_R_LSL_I:
-        return Operand(InputRegister(index + 0), LSL, InputInt5(index + 1));
-      case kMode_Operand2_R_LSL_R:
-        return Operand(InputRegister(index + 0), LSL, InputRegister(index + 1));
-      case kMode_Operand2_R_LSR_I:
-        return Operand(InputRegister(index + 0), LSR, InputInt5(index + 1));
-      case kMode_Operand2_R_LSR_R:
-        return Operand(InputRegister(index + 0), LSR, InputRegister(index + 1));
-      case kMode_Operand2_R_ROR_I:
-        return Operand(InputRegister(index + 0), ROR, InputInt5(index + 1));
-      case kMode_Operand2_R_ROR_R:
-        return Operand(InputRegister(index + 0), ROR, InputRegister(index + 1));
-    }
-    UNREACHABLE();
-  }
-
-  MemOperand InputOffset(size_t* first_index) {
-    const size_t index = *first_index;
-    switch (AddressingModeField::decode(instr_->opcode())) {
-      case kMode_None:
-      case kMode_Operand2_I:
-      case kMode_Operand2_R:
-      case kMode_Operand2_R_ASR_I:
-      case kMode_Operand2_R_ASR_R:
-      case kMode_Operand2_R_LSL_R:
-      case kMode_Operand2_R_LSR_I:
-      case kMode_Operand2_R_LSR_R:
-      case kMode_Operand2_R_ROR_I:
-      case kMode_Operand2_R_ROR_R:
-        break;
-      case kMode_Operand2_R_LSL_I:
-        *first_index += 3;
-        return MemOperand(InputRegister(index + 0), InputRegister(index + 1),
-                          LSL, InputInt32(index + 2));
-      case kMode_Offset_RI:
-        *first_index += 2;
-        return MemOperand(InputRegister(index + 0), InputInt32(index + 1));
-      case kMode_Offset_RR:
-        *first_index += 2;
-        return MemOperand(InputRegister(index + 0), InputRegister(index + 1));
-    }
-    UNREACHABLE();
-  }
-
-  MemOperand InputOffset(size_t first_index = 0) {
-    return InputOffset(&first_index);
-  }
-
-  MemOperand ToMemOperand(InstructionOperand* op) const {
-    DCHECK_NOT_NULL(op);
-    DCHECK(op->IsStackSlot() || op->IsFPStackSlot());
-    return SlotToMemOperand(AllocatedOperand::cast(op)->index());
-  }
-
-  MemOperand SlotToMemOperand(int slot) const {
-    FrameOffset offset = frame_access_state()->GetFrameOffset(slot);
-    return MemOperand(offset.from_stack_pointer() ? sp : fp, offset.offset());
-  }
-
-  NeonMemOperand NeonInputOperand(size_t first_index) {
-    const size_t index = first_index;
-    switch (AddressingModeField::decode(instr_->opcode())) {
-      case kMode_Offset_RR:
-        return NeonMemOperand(InputRegister(index + 0),
-                              InputRegister(index + 1));
-      case kMode_Operand2_R:
-        return NeonMemOperand(InputRegister(index + 0));
-      default:
-        break;
-    }
-    UNREACHABLE();
-  }
-};
-
-namespace {
-
-class OutOfLineRecordWrite final : public OutOfLineCode {
- public:
-  OutOfLineRecordWrite(CodeGenerator* gen, Register object, Register index,
-                       Register value, Register scratch0, Register scratch1,
-                       RecordWriteMode mode,
-                       UnwindingInfoWriter* unwinding_info_writer)
-      : OutOfLineCode(gen),
-        object_(object),
-        index_(index),
-        index_immediate_(0),
-        value_(value),
-        scratch0_(scratch0),
-        scratch1_(scratch1),
-        mode_(mode),
-        must_save_lr_(!gen->frame_access_state()->has_frame()),
-        unwinding_info_writer_(unwinding_info_writer),
-        zone_(gen->zone()) {}
-
-  OutOfLineRecordWrite(CodeGenerator* gen, Register object, int32_t index,
-                       Register value, Register scratch0, Register scratch1,
-                       RecordWriteMode mode,
-                       UnwindingInfoWriter* unwinding_info_writer)
-      : OutOfLineCode(gen),
-        object_(object),
-        index_(no_reg),
-        index_immediate_(index),
-        value_(value),
-        scratch0_(scratch0),
-        scratch1_(scratch1),
-        mode_(mode),
-        must_save_lr_(!gen->frame_access_state()->has_frame()),
-        unwinding_info_writer_(unwinding_info_writer),
-        zone_(gen->zone()) {}
-
-  void Generate() final {
-    if (mode_ > RecordWriteMode::kValueIsPointer) {
-      __ JumpIfSmi(value_, exit());
-    }
-    __ CheckPageFlag(value_, scratch0_,
-                     MemoryChunk::kPointersToHereAreInterestingMask, eq,
-                     exit());
-    if (index_ == no_reg) {
-      __ add(scratch1_, object_, Operand(index_immediate_));
-    } else {
-      DCHECK_EQ(0, index_immediate_);
-      __ add(scratch1_, object_, Operand(index_));
-    }
-    RememberedSetAction const remembered_set_action =
-        mode_ > RecordWriteMode::kValueIsMap ? EMIT_REMEMBERED_SET
-                                             : OMIT_REMEMBERED_SET;
-    SaveFPRegsMode const save_fp_mode =
-        frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
-    if (must_save_lr_) {
-      // We need to save and restore lr if the frame was elided.
-      __ Push(lr);
-      unwinding_info_writer_->MarkLinkRegisterOnTopOfStack(__ pc_offset());
-    }
-    __ CallRecordWriteStub(object_, scratch1_, remembered_set_action,
-                           save_fp_mode);
-    if (must_save_lr_) {
-      __ Pop(lr);
-      unwinding_info_writer_->MarkPopLinkRegisterFromTopOfStack(__ pc_offset());
-    }
-  }
-
- private:
-  Register const object_;
-  Register const index_;
-  int32_t const index_immediate_;  // Valid if index_==no_reg.
-  Register const value_;
-  Register const scratch0_;
-  Register const scratch1_;
-  RecordWriteMode const mode_;
-  bool must_save_lr_;
-  UnwindingInfoWriter* const unwinding_info_writer_;
-  Zone* zone_;
-};
-
-template <typename T>
-class OutOfLineFloatMin final : public OutOfLineCode {
- public:
-  OutOfLineFloatMin(CodeGenerator* gen, T result, T left, T right)
-      : OutOfLineCode(gen), result_(result), left_(left), right_(right) {}
-
-  void Generate() final { __ FloatMinOutOfLine(result_, left_, right_); }
-
- private:
-  T const result_;
-  T const left_;
-  T const right_;
-};
-typedef OutOfLineFloatMin<SwVfpRegister> OutOfLineFloat32Min;
-typedef OutOfLineFloatMin<DwVfpRegister> OutOfLineFloat64Min;
-
-template <typename T>
-class OutOfLineFloatMax final : public OutOfLineCode {
- public:
-  OutOfLineFloatMax(CodeGenerator* gen, T result, T left, T right)
-      : OutOfLineCode(gen), result_(result), left_(left), right_(right) {}
-
-  void Generate() final { __ FloatMaxOutOfLine(result_, left_, right_); }
-
- private:
-  T const result_;
-  T const left_;
-  T const right_;
-};
-typedef OutOfLineFloatMax<SwVfpRegister> OutOfLineFloat32Max;
-typedef OutOfLineFloatMax<DwVfpRegister> OutOfLineFloat64Max;
-
-Condition FlagsConditionToCondition(FlagsCondition condition) {
-  switch (condition) {
-    case kEqual:
-      return eq;
-    case kNotEqual:
-      return ne;
-    case kSignedLessThan:
-      return lt;
-    case kSignedGreaterThanOrEqual:
-      return ge;
-    case kSignedLessThanOrEqual:
-      return le;
-    case kSignedGreaterThan:
-      return gt;
-    case kUnsignedLessThan:
-      return lo;
-    case kUnsignedGreaterThanOrEqual:
-      return hs;
-    case kUnsignedLessThanOrEqual:
-      return ls;
-    case kUnsignedGreaterThan:
-      return hi;
-    case kFloatLessThanOrUnordered:
-      return lt;
-    case kFloatGreaterThanOrEqual:
-      return ge;
-    case kFloatLessThanOrEqual:
-      return ls;
-    case kFloatGreaterThanOrUnordered:
-      return hi;
-    case kFloatLessThan:
-      return lo;
-    case kFloatGreaterThanOrEqualOrUnordered:
-      return hs;
-    case kFloatLessThanOrEqualOrUnordered:
-      return le;
-    case kFloatGreaterThan:
-      return gt;
-    case kOverflow:
-      return vs;
-    case kNotOverflow:
-      return vc;
-    case kPositiveOrZero:
-      return pl;
-    case kNegative:
-      return mi;
-    default:
-      break;
-  }
-  UNREACHABLE();
-}
-
-}  // namespace
-
-#define ASSEMBLE_ATOMIC_LOAD_INTEGER(asm_instr)                       \
-  do {                                                                \
-    __ asm_instr(i.OutputRegister(),                                  \
-                 MemOperand(i.InputRegister(0), i.InputRegister(1))); \
-    __ dmb(ISH);                                                      \
-  } while (0)
-
-#define ASSEMBLE_ATOMIC_STORE_INTEGER(asm_instr)                      \
-  do {                                                                \
-    __ dmb(ISH);                                                      \
-    __ asm_instr(i.InputRegister(2),                                  \
-                 MemOperand(i.InputRegister(0), i.InputRegister(1))); \
-    __ dmb(ISH);                                                      \
-  } while (0)
-
-#define ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(load_instr, store_instr)             \
-  do {                                                                        \
-    Label exchange;                                                           \
-    __ add(i.TempRegister(1), i.InputRegister(0), i.InputRegister(1));        \
-    __ dmb(ISH);                                                              \
-    __ bind(&exchange);                                                       \
-    __ load_instr(i.OutputRegister(0), i.TempRegister(1));                    \
-    __ store_instr(i.TempRegister(0), i.InputRegister(2), i.TempRegister(1)); \
-    __ teq(i.TempRegister(0), Operand(0));                                    \
-    __ b(ne, &exchange);                                                      \
-    __ dmb(ISH);                                                              \
-  } while (0)
-
-#define ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER(load_instr, store_instr,     \
-                                                 cmp_reg)                     \
-  do {                                                                        \
-    Label compareExchange;                                                    \
-    Label exit;                                                               \
-    __ dmb(ISH);                                                              \
-    __ bind(&compareExchange);                                                \
-    __ load_instr(i.OutputRegister(0), i.TempRegister(1));                    \
-    __ teq(cmp_reg, Operand(i.OutputRegister(0)));                            \
-    __ b(ne, &exit);                                                          \
-    __ store_instr(i.TempRegister(0), i.InputRegister(3), i.TempRegister(1)); \
-    __ teq(i.TempRegister(0), Operand(0));                                    \
-    __ b(ne, &compareExchange);                                               \
-    __ bind(&exit);                                                           \
-    __ dmb(ISH);                                                              \
-  } while (0)
-
-#define ASSEMBLE_ATOMIC_BINOP(load_instr, store_instr, bin_instr)            \
-  do {                                                                       \
-    Label binop;                                                             \
-    __ add(i.TempRegister(1), i.InputRegister(0), i.InputRegister(1));       \
-    __ dmb(ISH);                                                             \
-    __ bind(&binop);                                                         \
-    __ load_instr(i.OutputRegister(0), i.TempRegister(1));                   \
-    __ bin_instr(i.TempRegister(0), i.OutputRegister(0),                     \
-                 Operand(i.InputRegister(2)));                               \
-    __ store_instr(i.TempRegister(2), i.TempRegister(0), i.TempRegister(1)); \
-    __ teq(i.TempRegister(2), Operand(0));                                   \
-    __ b(ne, &binop);                                                        \
-    __ dmb(ISH);                                                             \
-  } while (0)
-
-#define ASSEMBLE_IEEE754_BINOP(name)                                           \
-  do {                                                                         \
-    /* TODO(bmeurer): We should really get rid of this special instruction, */ \
-    /* and generate a CallAddress instruction instead. */                      \
-    FrameScope scope(tasm(), StackFrame::MANUAL);                              \
-    __ PrepareCallCFunction(0, 2);                                             \
-    __ MovToFloatParameters(i.InputDoubleRegister(0),                          \
-                            i.InputDoubleRegister(1));                         \
-    __ CallCFunction(                                                          \
-        ExternalReference::ieee754_##name##_function(__ isolate()), 0, 2);     \
-    /* Move the result in the double result register. */                       \
-    __ MovFromFloatResult(i.OutputDoubleRegister());                           \
-    DCHECK_EQ(LeaveCC, i.OutputSBit());                                        \
-  } while (0)
-
-#define ASSEMBLE_IEEE754_UNOP(name)                                            \
-  do {                                                                         \
-    /* TODO(bmeurer): We should really get rid of this special instruction, */ \
-    /* and generate a CallAddress instruction instead. */                      \
-    FrameScope scope(tasm(), StackFrame::MANUAL);                              \
-    __ PrepareCallCFunction(0, 1);                                             \
-    __ MovToFloatParameter(i.InputDoubleRegister(0));                          \
-    __ CallCFunction(                                                          \
-        ExternalReference::ieee754_##name##_function(__ isolate()), 0, 1);     \
-    /* Move the result in the double result register. */                       \
-    __ MovFromFloatResult(i.OutputDoubleRegister());                           \
-    DCHECK_EQ(LeaveCC, i.OutputSBit());                                        \
-  } while (0)
-
-#define ASSEMBLE_NEON_NARROWING_OP(dt)                \
-  do {                                                \
-    Simd128Register dst = i.OutputSimd128Register(),  \
-                    src0 = i.InputSimd128Register(0), \
-                    src1 = i.InputSimd128Register(1); \
-    if (dst == src0 && dst == src1) {                 \
-      __ vqmovn(dt, dst.low(), src0);                 \
-      __ vmov(dst.high(), dst.low());                 \
-    } else if (dst == src0) {                         \
-      __ vqmovn(dt, dst.low(), src0);                 \
-      __ vqmovn(dt, dst.high(), src1);                \
-    } else {                                          \
-      __ vqmovn(dt, dst.high(), src1);                \
-      __ vqmovn(dt, dst.low(), src0);                 \
-    }                                                 \
-  } while (0)
-
-#define ASSEMBLE_NEON_PAIRWISE_OP(op, size)               \
-  do {                                                    \
-    Simd128Register dst = i.OutputSimd128Register(),      \
-                    src0 = i.InputSimd128Register(0),     \
-                    src1 = i.InputSimd128Register(1);     \
-    if (dst == src0) {                                    \
-      __ op(size, dst.low(), src0.low(), src0.high());    \
-      if (dst == src1) {                                  \
-        __ vmov(dst.high(), dst.low());                   \
-      } else {                                            \
-        __ op(size, dst.high(), src1.low(), src1.high()); \
-      }                                                   \
-    } else {                                              \
-      __ op(size, dst.high(), src1.low(), src1.high());   \
-      __ op(size, dst.low(), src0.low(), src0.high());    \
-    }                                                     \
-  } while (0)
-
-void CodeGenerator::AssembleDeconstructFrame() {
-  __ LeaveFrame(StackFrame::MANUAL);
-  unwinding_info_writer_.MarkFrameDeconstructed(__ pc_offset());
-}
-
-void CodeGenerator::AssemblePrepareTailCall() {
-  if (frame_access_state()->has_frame()) {
-    __ ldr(lr, MemOperand(fp, StandardFrameConstants::kCallerPCOffset));
-    __ ldr(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
-  }
-  frame_access_state()->SetFrameAccessToSP();
-}
-
-void CodeGenerator::AssemblePopArgumentsAdaptorFrame(Register args_reg,
-                                                     Register scratch1,
-                                                     Register scratch2,
-                                                     Register scratch3) {
-  DCHECK(!AreAliased(args_reg, scratch1, scratch2, scratch3));
-  Label done;
-
-  // Check if current frame is an arguments adaptor frame.
-  __ ldr(scratch1, MemOperand(fp, StandardFrameConstants::kContextOffset));
-  __ cmp(scratch1,
-         Operand(StackFrame::TypeToMarker(StackFrame::ARGUMENTS_ADAPTOR)));
-  __ b(ne, &done);
-
-  // Load arguments count from current arguments adaptor frame (note, it
-  // does not include receiver).
-  Register caller_args_count_reg = scratch1;
-  __ ldr(caller_args_count_reg,
-         MemOperand(fp, ArgumentsAdaptorFrameConstants::kLengthOffset));
-  __ SmiUntag(caller_args_count_reg);
-
-  ParameterCount callee_args_count(args_reg);
-  __ PrepareForTailCall(callee_args_count, caller_args_count_reg, scratch2,
-                        scratch3);
-  __ bind(&done);
-}
-
-namespace {
-
-void FlushPendingPushRegisters(TurboAssembler* tasm,
-                               FrameAccessState* frame_access_state,
-                               ZoneVector<Register>* pending_pushes) {
-  switch (pending_pushes->size()) {
-    case 0:
-      break;
-    case 1:
-      tasm->push((*pending_pushes)[0]);
-      break;
-    case 2:
-      tasm->Push((*pending_pushes)[0], (*pending_pushes)[1]);
-      break;
-    case 3:
-      tasm->Push((*pending_pushes)[0], (*pending_pushes)[1],
-                 (*pending_pushes)[2]);
-      break;
-    default:
-      UNREACHABLE();
-      break;
-  }
-  frame_access_state->IncreaseSPDelta(pending_pushes->size());
-  pending_pushes->clear();
-}
-
-void AdjustStackPointerForTailCall(
-    TurboAssembler* tasm, FrameAccessState* state, int new_slot_above_sp,
-    ZoneVector<Register>* pending_pushes = nullptr,
-    bool allow_shrinkage = true) {
-  int current_sp_offset = state->GetSPToFPSlotCount() +
-                          StandardFrameConstants::kFixedSlotCountAboveFp;
-  int stack_slot_delta = new_slot_above_sp - current_sp_offset;
-  if (stack_slot_delta > 0) {
-    if (pending_pushes != nullptr) {
-      FlushPendingPushRegisters(tasm, state, pending_pushes);
-    }
-    tasm->sub(sp, sp, Operand(stack_slot_delta * kPointerSize));
-    state->IncreaseSPDelta(stack_slot_delta);
-  } else if (allow_shrinkage && stack_slot_delta < 0) {
-    if (pending_pushes != nullptr) {
-      FlushPendingPushRegisters(tasm, state, pending_pushes);
-    }
-    tasm->add(sp, sp, Operand(-stack_slot_delta * kPointerSize));
-    state->IncreaseSPDelta(stack_slot_delta);
-  }
-}
-
-}  // namespace
-
-void CodeGenerator::AssembleTailCallBeforeGap(Instruction* instr,
-                                              int first_unused_stack_slot) {
-  ZoneVector<MoveOperands*> pushes(zone());
-  GetPushCompatibleMoves(instr, kRegisterPush, &pushes);
-
-  if (!pushes.empty() &&
-      (LocationOperand::cast(pushes.back()->destination()).index() + 1 ==
-       first_unused_stack_slot)) {
-    ArmOperandConverter g(this, instr);
-    ZoneVector<Register> pending_pushes(zone());
-    for (auto move : pushes) {
-      LocationOperand destination_location(
-          LocationOperand::cast(move->destination()));
-      InstructionOperand source(move->source());
-      AdjustStackPointerForTailCall(
-          tasm(), frame_access_state(),
-          destination_location.index() - pending_pushes.size(),
-          &pending_pushes);
-      // Pushes of non-register data types are not supported.
-      DCHECK(source.IsRegister());
-      LocationOperand source_location(LocationOperand::cast(source));
-      pending_pushes.push_back(source_location.GetRegister());
-      // TODO(arm): We can push more than 3 registers at once. Add support in
-      // the macro-assembler for pushing a list of registers.
-      if (pending_pushes.size() == 3) {
-        FlushPendingPushRegisters(tasm(), frame_access_state(),
-                                  &pending_pushes);
-      }
-      move->Eliminate();
-    }
-    FlushPendingPushRegisters(tasm(), frame_access_state(), &pending_pushes);
-  }
-  AdjustStackPointerForTailCall(tasm(), frame_access_state(),
-                                first_unused_stack_slot, nullptr, false);
-}
-
-void CodeGenerator::AssembleTailCallAfterGap(Instruction* instr,
-                                             int first_unused_stack_slot) {
-  AdjustStackPointerForTailCall(tasm(), frame_access_state(),
-                                first_unused_stack_slot);
-}
-
-// Check if the code object is marked for deoptimization. If it is, then it
-// jumps to the CompileLazyDeoptimizedCode builtin. In order to do this we need
-// to:
-//    1. compute the offset of the {CodeDataContainer} from our current location
-//       and load it.
-//    2. read from memory the word that contains that bit, which can be found in
-//       the flags in the referenced {CodeDataContainer} object;
-//    3. test kMarkedForDeoptimizationBit in those flags; and
-//    4. if it is not zero then it jumps to the builtin.
-void CodeGenerator::BailoutIfDeoptimized() {
-  int pc_offset = __ pc_offset();
-  int offset = Code::kCodeDataContainerOffset -
-               (Code::kHeaderSize + pc_offset + TurboAssembler::kPcLoadDelta);
-  // We can use the register pc - 8 for the address of the current instruction.
-  __ ldr_pcrel(ip, offset);
-  __ ldr(ip, FieldMemOperand(ip, CodeDataContainer::kKindSpecificFlagsOffset));
-  __ tst(ip, Operand(1 << Code::kMarkedForDeoptimizationBit));
-  Handle<Code> code = isolate()->builtins()->builtin_handle(
-      Builtins::kCompileLazyDeoptimizedCode);
-  __ Jump(code, RelocInfo::CODE_TARGET, ne);
-}
-
-// Assembles an instruction after register allocation, producing machine code.
-CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
-    Instruction* instr) {
-  ArmOperandConverter i(this, instr);
-
-  __ MaybeCheckConstPool();
-  InstructionCode opcode = instr->opcode();
-  ArchOpcode arch_opcode = ArchOpcodeField::decode(opcode);
-  switch (arch_opcode) {
-    case kArchCallCodeObject: {
-      // We must not share code targets for calls to builtins for wasm code, as
-      // they might need to be patched individually.
-      internal::Assembler::BlockCodeTargetSharingScope scope;
-      if (info()->IsWasm()) scope.Open(tasm());
-
-      if (instr->InputAt(0)->IsImmediate()) {
-        __ Call(i.InputCode(0), RelocInfo::CODE_TARGET);
-      } else {
-        __ add(ip, i.InputRegister(0),
-               Operand(Code::kHeaderSize - kHeapObjectTag));
-        __ Call(ip);
-      }
-      RecordCallPosition(instr);
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      frame_access_state()->ClearSPDelta();
-      break;
-    }
-    case kArchCallWasmFunction: {
-      // We must not share code targets for calls to builtins for wasm code, as
-      // they might need to be patched individually.
-      internal::Assembler::BlockCodeTargetSharingScope scope;
-      RelocInfo::Mode rmode = RelocInfo::JS_TO_WASM_CALL;
-      if (info()->IsWasm()) {
-        scope.Open(tasm());
-        rmode = RelocInfo::WASM_CALL;
-      }
-
-      if (instr->InputAt(0)->IsImmediate()) {
-        Address wasm_code = reinterpret_cast<Address>(
-            i.ToConstant(instr->InputAt(0)).ToInt32());
-        __ Call(wasm_code, rmode);
-      } else {
-        __ Call(i.InputRegister(0));
-      }
-      RecordCallPosition(instr);
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      frame_access_state()->ClearSPDelta();
-      break;
-    }
-    case kArchTailCallCodeObjectFromJSFunction:
-    case kArchTailCallCodeObject: {
-      // We must not share code targets for calls to builtins for wasm code, as
-      // they might need to be patched individually.
-      internal::Assembler::BlockCodeTargetSharingScope scope;
-      if (info()->IsWasm()) scope.Open(tasm());
-
-      if (arch_opcode == kArchTailCallCodeObjectFromJSFunction) {
-        AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister,
-                                         i.TempRegister(0), i.TempRegister(1),
-                                         i.TempRegister(2));
-      }
-      if (instr->InputAt(0)->IsImmediate()) {
-        __ Jump(i.InputCode(0), RelocInfo::CODE_TARGET);
-      } else {
-        __ add(ip, i.InputRegister(0),
-               Operand(Code::kHeaderSize - kHeapObjectTag));
-        __ Jump(ip);
-      }
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      unwinding_info_writer_.MarkBlockWillExit();
-      frame_access_state()->ClearSPDelta();
-      frame_access_state()->SetFrameAccessToDefault();
-      break;
-    }
-    case kArchTailCallWasm: {
-      // We must not share code targets for calls to builtins for wasm code, as
-      // they might need to be patched individually.
-      internal::Assembler::BlockCodeTargetSharingScope scope;
-      RelocInfo::Mode rmode = RelocInfo::JS_TO_WASM_CALL;
-      if (info()->IsWasm()) {
-        scope.Open(tasm());
-        rmode = RelocInfo::WASM_CALL;
-      }
-
-      if (instr->InputAt(0)->IsImmediate()) {
-        Address wasm_code = reinterpret_cast<Address>(
-            i.ToConstant(instr->InputAt(0)).ToInt32());
-        __ Jump(wasm_code, rmode);
-      } else {
-        __ Jump(i.InputRegister(0));
-      }
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      unwinding_info_writer_.MarkBlockWillExit();
-      frame_access_state()->ClearSPDelta();
-      frame_access_state()->SetFrameAccessToDefault();
-      break;
-    }
-    case kArchTailCallAddress: {
-      CHECK(!instr->InputAt(0)->IsImmediate());
-      __ Jump(i.InputRegister(0));
-      unwinding_info_writer_.MarkBlockWillExit();
-      frame_access_state()->ClearSPDelta();
-      frame_access_state()->SetFrameAccessToDefault();
-      break;
-    }
-    case kArchCallJSFunction: {
-      Register func = i.InputRegister(0);
-      if (FLAG_debug_code) {
-        // Check the function's context matches the context argument.
-        __ ldr(kScratchReg, FieldMemOperand(func, JSFunction::kContextOffset));
-        __ cmp(cp, kScratchReg);
-        __ Assert(eq, AbortReason::kWrongFunctionContext);
-      }
-      __ ldr(ip, FieldMemOperand(func, JSFunction::kCodeOffset));
-      __ add(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag));
-      __ Call(ip);
-      RecordCallPosition(instr);
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      frame_access_state()->ClearSPDelta();
-      break;
-    }
-    case kArchPrepareCallCFunction: {
-      int const num_parameters = MiscField::decode(instr->opcode());
-      __ PrepareCallCFunction(num_parameters);
-      // Frame alignment requires using FP-relative frame addressing.
-      frame_access_state()->SetFrameAccessToFP();
-      break;
-    }
-    case kArchSaveCallerRegisters: {
-      fp_mode_ =
-          static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode()));
-      DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
-      // kReturnRegister0 should have been saved before entering the stub.
-      int bytes = __ PushCallerSaved(fp_mode_, kReturnRegister0);
-      DCHECK_EQ(0, bytes % kPointerSize);
-      DCHECK_EQ(0, frame_access_state()->sp_delta());
-      frame_access_state()->IncreaseSPDelta(bytes / kPointerSize);
-      DCHECK(!caller_registers_saved_);
-      caller_registers_saved_ = true;
-      break;
-    }
-    case kArchRestoreCallerRegisters: {
-      DCHECK(fp_mode_ ==
-             static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode())));
-      DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
-      // Don't overwrite the returned value.
-      int bytes = __ PopCallerSaved(fp_mode_, kReturnRegister0);
-      frame_access_state()->IncreaseSPDelta(-(bytes / kPointerSize));
-      DCHECK_EQ(0, frame_access_state()->sp_delta());
-      DCHECK(caller_registers_saved_);
-      caller_registers_saved_ = false;
-      break;
-    }
-    case kArchPrepareTailCall:
-      AssemblePrepareTailCall();
-      break;
-    case kArchCallCFunction: {
-      int const num_parameters = MiscField::decode(instr->opcode());
-      if (instr->InputAt(0)->IsImmediate()) {
-        ExternalReference ref = i.InputExternalReference(0);
-        __ CallCFunction(ref, num_parameters);
-      } else {
-        Register func = i.InputRegister(0);
-        __ CallCFunction(func, num_parameters);
-      }
-      frame_access_state()->SetFrameAccessToDefault();
-      // Ideally, we should decrement SP delta to match the change of stack
-      // pointer in CallCFunction. However, for certain architectures (e.g.
-      // ARM), there may be more strict alignment requirement, causing old SP
-      // to be saved on the stack. In those cases, we can not calculate the SP
-      // delta statically.
-      frame_access_state()->ClearSPDelta();
-      if (caller_registers_saved_) {
-        // Need to re-sync SP delta introduced in kArchSaveCallerRegisters.
-        // Here, we assume the sequence to be:
-        //   kArchSaveCallerRegisters;
-        //   kArchCallCFunction;
-        //   kArchRestoreCallerRegisters;
-        int bytes =
-            __ RequiredStackSizeForCallerSaved(fp_mode_, kReturnRegister0);
-        frame_access_state()->IncreaseSPDelta(bytes / kPointerSize);
-      }
-      break;
-    }
-    case kArchJmp:
-      AssembleArchJump(i.InputRpo(0));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArchLookupSwitch:
-      AssembleArchLookupSwitch(instr);
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArchTableSwitch:
-      AssembleArchTableSwitch(instr);
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArchDebugAbort:
-      DCHECK(i.InputRegister(0) == r1);
-      if (!frame_access_state()->has_frame()) {
-        // We don't actually want to generate a pile of code for this, so just
-        // claim there is a stack frame, without generating one.
-        FrameScope scope(tasm(), StackFrame::NONE);
-        __ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
-                RelocInfo::CODE_TARGET);
-      } else {
-        __ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
-                RelocInfo::CODE_TARGET);
-      }
-      __ stop("kArchDebugAbort");
-      break;
-    case kArchDebugBreak:
-      __ stop("kArchDebugBreak");
-      break;
-    case kArchComment: {
-      Address comment_string = i.InputExternalReference(0).address();
-      __ RecordComment(reinterpret_cast<const char*>(comment_string));
-      break;
-    }
-    case kArchNop:
-    case kArchThrowTerminator:
-      // don't emit code for nops.
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArchDeoptimize: {
-      int deopt_state_id =
-          BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore());
-      CodeGenResult result =
-          AssembleDeoptimizerCall(deopt_state_id, current_source_position_);
-      if (result != kSuccess) return result;
-      break;
-    }
-    case kArchRet:
-      AssembleReturn(instr->InputAt(0));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArchStackPointer:
-      __ mov(i.OutputRegister(), sp);
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArchFramePointer:
-      __ mov(i.OutputRegister(), fp);
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArchParentFramePointer:
-      if (frame_access_state()->has_frame()) {
-        __ ldr(i.OutputRegister(), MemOperand(fp, 0));
-      } else {
-        __ mov(i.OutputRegister(), fp);
-      }
-      break;
-    case kArchTruncateDoubleToI:
-      __ TruncateDoubleToIDelayed(zone(), i.OutputRegister(),
-                                  i.InputDoubleRegister(0));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArchStoreWithWriteBarrier: {
-      RecordWriteMode mode =
-          static_cast<RecordWriteMode>(MiscField::decode(instr->opcode()));
-      Register object = i.InputRegister(0);
-      Register value = i.InputRegister(2);
-      Register scratch0 = i.TempRegister(0);
-      Register scratch1 = i.TempRegister(1);
-      OutOfLineRecordWrite* ool;
-
-      AddressingMode addressing_mode =
-          AddressingModeField::decode(instr->opcode());
-      if (addressing_mode == kMode_Offset_RI) {
-        int32_t index = i.InputInt32(1);
-        ool = new (zone())
-            OutOfLineRecordWrite(this, object, index, value, scratch0, scratch1,
-                                 mode, &unwinding_info_writer_);
-        __ str(value, MemOperand(object, index));
-      } else {
-        DCHECK_EQ(kMode_Offset_RR, addressing_mode);
-        Register index(i.InputRegister(1));
-        ool = new (zone())
-            OutOfLineRecordWrite(this, object, index, value, scratch0, scratch1,
-                                 mode, &unwinding_info_writer_);
-        __ str(value, MemOperand(object, index));
-      }
-      __ CheckPageFlag(object, scratch0,
-                       MemoryChunk::kPointersFromHereAreInterestingMask, ne,
-                       ool->entry());
-      __ bind(ool->exit());
-      break;
-    }
-    case kArchStackSlot: {
-      FrameOffset offset =
-          frame_access_state()->GetFrameOffset(i.InputInt32(0));
-      Register base = offset.from_stack_pointer() ? sp : fp;
-      __ add(i.OutputRegister(0), base, Operand(offset.offset()));
-      break;
-    }
-    case kIeee754Float64Acos:
-      ASSEMBLE_IEEE754_UNOP(acos);
-      break;
-    case kIeee754Float64Acosh:
-      ASSEMBLE_IEEE754_UNOP(acosh);
-      break;
-    case kIeee754Float64Asin:
-      ASSEMBLE_IEEE754_UNOP(asin);
-      break;
-    case kIeee754Float64Asinh:
-      ASSEMBLE_IEEE754_UNOP(asinh);
-      break;
-    case kIeee754Float64Atan:
-      ASSEMBLE_IEEE754_UNOP(atan);
-      break;
-    case kIeee754Float64Atanh:
-      ASSEMBLE_IEEE754_UNOP(atanh);
-      break;
-    case kIeee754Float64Atan2:
-      ASSEMBLE_IEEE754_BINOP(atan2);
-      break;
-    case kIeee754Float64Cbrt:
-      ASSEMBLE_IEEE754_UNOP(cbrt);
-      break;
-    case kIeee754Float64Cos:
-      ASSEMBLE_IEEE754_UNOP(cos);
-      break;
-    case kIeee754Float64Cosh:
-      ASSEMBLE_IEEE754_UNOP(cosh);
-      break;
-    case kIeee754Float64Exp:
-      ASSEMBLE_IEEE754_UNOP(exp);
-      break;
-    case kIeee754Float64Expm1:
-      ASSEMBLE_IEEE754_UNOP(expm1);
-      break;
-    case kIeee754Float64Log:
-      ASSEMBLE_IEEE754_UNOP(log);
-      break;
-    case kIeee754Float64Log1p:
-      ASSEMBLE_IEEE754_UNOP(log1p);
-      break;
-    case kIeee754Float64Log2:
-      ASSEMBLE_IEEE754_UNOP(log2);
-      break;
-    case kIeee754Float64Log10:
-      ASSEMBLE_IEEE754_UNOP(log10);
-      break;
-    case kIeee754Float64Pow: {
-      __ CallStubDelayed(new (zone())
-                             MathPowStub(nullptr, MathPowStub::DOUBLE));
-      __ vmov(d0, d2);
-      break;
-    }
-    case kIeee754Float64Sin:
-      ASSEMBLE_IEEE754_UNOP(sin);
-      break;
-    case kIeee754Float64Sinh:
-      ASSEMBLE_IEEE754_UNOP(sinh);
-      break;
-    case kIeee754Float64Tan:
-      ASSEMBLE_IEEE754_UNOP(tan);
-      break;
-    case kIeee754Float64Tanh:
-      ASSEMBLE_IEEE754_UNOP(tanh);
-      break;
-    case kArmAdd:
-      __ add(i.OutputRegister(), i.InputRegister(0), i.InputOperand2(1),
-             i.OutputSBit());
-      break;
-    case kArmAnd:
-      __ and_(i.OutputRegister(), i.InputRegister(0), i.InputOperand2(1),
-              i.OutputSBit());
-      break;
-    case kArmBic:
-      __ bic(i.OutputRegister(), i.InputRegister(0), i.InputOperand2(1),
-             i.OutputSBit());
-      break;
-    case kArmMul:
-      __ mul(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
-             i.OutputSBit());
-      break;
-    case kArmMla:
-      __ mla(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
-             i.InputRegister(2), i.OutputSBit());
-      break;
-    case kArmMls: {
-      CpuFeatureScope scope(tasm(), ARMv7);
-      __ mls(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
-             i.InputRegister(2));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    }
-    case kArmSmull:
-      __ smull(i.OutputRegister(0), i.OutputRegister(1), i.InputRegister(0),
-               i.InputRegister(1));
-      break;
-    case kArmSmmul:
-      __ smmul(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmSmmla:
-      __ smmla(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
-               i.InputRegister(2));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmUmull:
-      __ umull(i.OutputRegister(0), i.OutputRegister(1), i.InputRegister(0),
-               i.InputRegister(1), i.OutputSBit());
-      break;
-    case kArmSdiv: {
-      CpuFeatureScope scope(tasm(), SUDIV);
-      __ sdiv(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    }
-    case kArmUdiv: {
-      CpuFeatureScope scope(tasm(), SUDIV);
-      __ udiv(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    }
-    case kArmMov:
-      __ Move(i.OutputRegister(), i.InputOperand2(0), i.OutputSBit());
-      break;
-    case kArmMvn:
-      __ mvn(i.OutputRegister(), i.InputOperand2(0), i.OutputSBit());
-      break;
-    case kArmOrr:
-      __ orr(i.OutputRegister(), i.InputRegister(0), i.InputOperand2(1),
-             i.OutputSBit());
-      break;
-    case kArmEor:
-      __ eor(i.OutputRegister(), i.InputRegister(0), i.InputOperand2(1),
-             i.OutputSBit());
-      break;
-    case kArmSub:
-      __ sub(i.OutputRegister(), i.InputRegister(0), i.InputOperand2(1),
-             i.OutputSBit());
-      break;
-    case kArmRsb:
-      __ rsb(i.OutputRegister(), i.InputRegister(0), i.InputOperand2(1),
-             i.OutputSBit());
-      break;
-    case kArmBfc: {
-      CpuFeatureScope scope(tasm(), ARMv7);
-      __ bfc(i.OutputRegister(), i.InputInt8(1), i.InputInt8(2));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    }
-    case kArmUbfx: {
-      CpuFeatureScope scope(tasm(), ARMv7);
-      __ ubfx(i.OutputRegister(), i.InputRegister(0), i.InputInt8(1),
-              i.InputInt8(2));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    }
-    case kArmSbfx: {
-      CpuFeatureScope scope(tasm(), ARMv7);
-      __ sbfx(i.OutputRegister(), i.InputRegister(0), i.InputInt8(1),
-              i.InputInt8(2));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    }
-    case kArmSxtb:
-      __ sxtb(i.OutputRegister(), i.InputRegister(0), i.InputInt32(1));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmSxth:
-      __ sxth(i.OutputRegister(), i.InputRegister(0), i.InputInt32(1));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmSxtab:
-      __ sxtab(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
-               i.InputInt32(2));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmSxtah:
-      __ sxtah(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
-               i.InputInt32(2));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmUxtb:
-      __ uxtb(i.OutputRegister(), i.InputRegister(0), i.InputInt32(1));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmUxth:
-      __ uxth(i.OutputRegister(), i.InputRegister(0), i.InputInt32(1));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmUxtab:
-      __ uxtab(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
-               i.InputInt32(2));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmUxtah:
-      __ uxtah(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
-               i.InputInt32(2));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmRbit: {
-      CpuFeatureScope scope(tasm(), ARMv7);
-      __ rbit(i.OutputRegister(), i.InputRegister(0));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    }
-    case kArmClz:
-      __ clz(i.OutputRegister(), i.InputRegister(0));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmCmp:
-      __ cmp(i.InputRegister(0), i.InputOperand2(1));
-      DCHECK_EQ(SetCC, i.OutputSBit());
-      break;
-    case kArmCmn:
-      __ cmn(i.InputRegister(0), i.InputOperand2(1));
-      DCHECK_EQ(SetCC, i.OutputSBit());
-      break;
-    case kArmTst:
-      __ tst(i.InputRegister(0), i.InputOperand2(1));
-      DCHECK_EQ(SetCC, i.OutputSBit());
-      break;
-    case kArmTeq:
-      __ teq(i.InputRegister(0), i.InputOperand2(1));
-      DCHECK_EQ(SetCC, i.OutputSBit());
-      break;
-    case kArmAddPair:
-      // i.InputRegister(0) ... left low word.
-      // i.InputRegister(1) ... left high word.
-      // i.InputRegister(2) ... right low word.
-      // i.InputRegister(3) ... right high word.
-      __ add(i.OutputRegister(0), i.InputRegister(0), i.InputRegister(2),
-             SBit::SetCC);
-      __ adc(i.OutputRegister(1), i.InputRegister(1),
-             Operand(i.InputRegister(3)));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmSubPair:
-      // i.InputRegister(0) ... left low word.
-      // i.InputRegister(1) ... left high word.
-      // i.InputRegister(2) ... right low word.
-      // i.InputRegister(3) ... right high word.
-      __ sub(i.OutputRegister(0), i.InputRegister(0), i.InputRegister(2),
-             SBit::SetCC);
-      __ sbc(i.OutputRegister(1), i.InputRegister(1),
-             Operand(i.InputRegister(3)));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmMulPair:
-      // i.InputRegister(0) ... left low word.
-      // i.InputRegister(1) ... left high word.
-      // i.InputRegister(2) ... right low word.
-      // i.InputRegister(3) ... right high word.
-      __ umull(i.OutputRegister(0), i.OutputRegister(1), i.InputRegister(0),
-               i.InputRegister(2));
-      __ mla(i.OutputRegister(1), i.InputRegister(0), i.InputRegister(3),
-             i.OutputRegister(1));
-      __ mla(i.OutputRegister(1), i.InputRegister(2), i.InputRegister(1),
-             i.OutputRegister(1));
-      break;
-    case kArmLslPair: {
-      Register second_output =
-          instr->OutputCount() >= 2 ? i.OutputRegister(1) : i.TempRegister(0);
-      if (instr->InputAt(2)->IsImmediate()) {
-        __ LslPair(i.OutputRegister(0), second_output, i.InputRegister(0),
-                   i.InputRegister(1), i.InputInt32(2));
-      } else {
-        __ LslPair(i.OutputRegister(0), second_output, i.InputRegister(0),
-                   i.InputRegister(1), kScratchReg, i.InputRegister(2));
-      }
-      break;
-    }
-    case kArmLsrPair: {
-      Register second_output =
-          instr->OutputCount() >= 2 ? i.OutputRegister(1) : i.TempRegister(0);
-      if (instr->InputAt(2)->IsImmediate()) {
-        __ LsrPair(i.OutputRegister(0), second_output, i.InputRegister(0),
-                   i.InputRegister(1), i.InputInt32(2));
-      } else {
-        __ LsrPair(i.OutputRegister(0), second_output, i.InputRegister(0),
-                   i.InputRegister(1), kScratchReg, i.InputRegister(2));
-      }
-      break;
-    }
-    case kArmAsrPair: {
-      Register second_output =
-          instr->OutputCount() >= 2 ? i.OutputRegister(1) : i.TempRegister(0);
-      if (instr->InputAt(2)->IsImmediate()) {
-        __ AsrPair(i.OutputRegister(0), second_output, i.InputRegister(0),
-                   i.InputRegister(1), i.InputInt32(2));
-      } else {
-        __ AsrPair(i.OutputRegister(0), second_output, i.InputRegister(0),
-                   i.InputRegister(1), kScratchReg, i.InputRegister(2));
-      }
-      break;
-    }
-    case kArmVcmpF32:
-      if (instr->InputAt(1)->IsFPRegister()) {
-        __ VFPCompareAndSetFlags(i.InputFloatRegister(0),
-                                 i.InputFloatRegister(1));
-      } else {
-        DCHECK(instr->InputAt(1)->IsImmediate());
-        // 0.0 is the only immediate supported by vcmp instructions.
-        DCHECK_EQ(0.0f, i.InputFloat32(1));
-        __ VFPCompareAndSetFlags(i.InputFloatRegister(0), i.InputFloat32(1));
-      }
-      DCHECK_EQ(SetCC, i.OutputSBit());
-      break;
-    case kArmVaddF32:
-      __ vadd(i.OutputFloatRegister(), i.InputFloatRegister(0),
-              i.InputFloatRegister(1));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmVsubF32:
-      __ vsub(i.OutputFloatRegister(), i.InputFloatRegister(0),
-              i.InputFloatRegister(1));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmVmulF32:
-      __ vmul(i.OutputFloatRegister(), i.InputFloatRegister(0),
-              i.InputFloatRegister(1));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmVmlaF32:
-      __ vmla(i.OutputFloatRegister(), i.InputFloatRegister(1),
-              i.InputFloatRegister(2));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmVmlsF32:
-      __ vmls(i.OutputFloatRegister(), i.InputFloatRegister(1),
-              i.InputFloatRegister(2));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmVdivF32:
-      __ vdiv(i.OutputFloatRegister(), i.InputFloatRegister(0),
-              i.InputFloatRegister(1));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmVsqrtF32:
-      __ vsqrt(i.OutputFloatRegister(), i.InputFloatRegister(0));
-      break;
-    case kArmVabsF32:
-      __ vabs(i.OutputFloatRegister(), i.InputFloatRegister(0));
-      break;
-    case kArmVnegF32:
-      __ vneg(i.OutputFloatRegister(), i.InputFloatRegister(0));
-      break;
-    case kArmVcmpF64:
-      if (instr->InputAt(1)->IsFPRegister()) {
-        __ VFPCompareAndSetFlags(i.InputDoubleRegister(0),
-                                 i.InputDoubleRegister(1));
-      } else {
-        DCHECK(instr->InputAt(1)->IsImmediate());
-        // 0.0 is the only immediate supported by vcmp instructions.
-        DCHECK_EQ(0.0, i.InputDouble(1));
-        __ VFPCompareAndSetFlags(i.InputDoubleRegister(0), i.InputDouble(1));
-      }
-      DCHECK_EQ(SetCC, i.OutputSBit());
-      break;
-    case kArmVaddF64:
-      __ vadd(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-              i.InputDoubleRegister(1));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmVsubF64:
-      __ vsub(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-              i.InputDoubleRegister(1));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmVmulF64:
-      __ vmul(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-              i.InputDoubleRegister(1));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmVmlaF64:
-      __ vmla(i.OutputDoubleRegister(), i.InputDoubleRegister(1),
-              i.InputDoubleRegister(2));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmVmlsF64:
-      __ vmls(i.OutputDoubleRegister(), i.InputDoubleRegister(1),
-              i.InputDoubleRegister(2));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmVdivF64:
-      __ vdiv(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-              i.InputDoubleRegister(1));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmVmodF64: {
-      // TODO(bmeurer): We should really get rid of this special instruction,
-      // and generate a CallAddress instruction instead.
-      FrameScope scope(tasm(), StackFrame::MANUAL);
-      __ PrepareCallCFunction(0, 2);
-      __ MovToFloatParameters(i.InputDoubleRegister(0),
-                              i.InputDoubleRegister(1));
-      __ CallCFunction(
-          ExternalReference::mod_two_doubles_operation(__ isolate()), 0, 2);
-      // Move the result in the double result register.
-      __ MovFromFloatResult(i.OutputDoubleRegister());
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    }
-    case kArmVsqrtF64:
-      __ vsqrt(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    case kArmVabsF64:
-      __ vabs(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    case kArmVnegF64:
-      __ vneg(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    case kArmVrintmF32: {
-      CpuFeatureScope scope(tasm(), ARMv8);
-      __ vrintm(i.OutputFloatRegister(), i.InputFloatRegister(0));
-      break;
-    }
-    case kArmVrintmF64: {
-      CpuFeatureScope scope(tasm(), ARMv8);
-      __ vrintm(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    }
-    case kArmVrintpF32: {
-      CpuFeatureScope scope(tasm(), ARMv8);
-      __ vrintp(i.OutputFloatRegister(), i.InputFloatRegister(0));
-      break;
-    }
-    case kArmVrintpF64: {
-      CpuFeatureScope scope(tasm(), ARMv8);
-      __ vrintp(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    }
-    case kArmVrintzF32: {
-      CpuFeatureScope scope(tasm(), ARMv8);
-      __ vrintz(i.OutputFloatRegister(), i.InputFloatRegister(0));
-      break;
-    }
-    case kArmVrintzF64: {
-      CpuFeatureScope scope(tasm(), ARMv8);
-      __ vrintz(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    }
-    case kArmVrintaF64: {
-      CpuFeatureScope scope(tasm(), ARMv8);
-      __ vrinta(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    }
-    case kArmVrintnF32: {
-      CpuFeatureScope scope(tasm(), ARMv8);
-      __ vrintn(i.OutputFloatRegister(), i.InputFloatRegister(0));
-      break;
-    }
-    case kArmVrintnF64: {
-      CpuFeatureScope scope(tasm(), ARMv8);
-      __ vrintn(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    }
-    case kArmVcvtF32F64: {
-      __ vcvt_f32_f64(i.OutputFloatRegister(), i.InputDoubleRegister(0));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    }
-    case kArmVcvtF64F32: {
-      __ vcvt_f64_f32(i.OutputDoubleRegister(), i.InputFloatRegister(0));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    }
-    case kArmVcvtF32S32: {
-      SwVfpRegister scratch = kScratchDoubleReg.low();
-      __ vmov(scratch, i.InputRegister(0));
-      __ vcvt_f32_s32(i.OutputFloatRegister(), scratch);
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    }
-    case kArmVcvtF32U32: {
-      SwVfpRegister scratch = kScratchDoubleReg.low();
-      __ vmov(scratch, i.InputRegister(0));
-      __ vcvt_f32_u32(i.OutputFloatRegister(), scratch);
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    }
-    case kArmVcvtF64S32: {
-      SwVfpRegister scratch = kScratchDoubleReg.low();
-      __ vmov(scratch, i.InputRegister(0));
-      __ vcvt_f64_s32(i.OutputDoubleRegister(), scratch);
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    }
-    case kArmVcvtF64U32: {
-      SwVfpRegister scratch = kScratchDoubleReg.low();
-      __ vmov(scratch, i.InputRegister(0));
-      __ vcvt_f64_u32(i.OutputDoubleRegister(), scratch);
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    }
-    case kArmVcvtS32F32: {
-      SwVfpRegister scratch = kScratchDoubleReg.low();
-      __ vcvt_s32_f32(scratch, i.InputFloatRegister(0));
-      __ vmov(i.OutputRegister(), scratch);
-      // Avoid INT32_MAX as an overflow indicator and use INT32_MIN instead,
-      // because INT32_MIN allows easier out-of-bounds detection.
-      __ cmn(i.OutputRegister(), Operand(1));
-      __ mov(i.OutputRegister(), Operand(INT32_MIN), SBit::LeaveCC, vs);
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    }
-    case kArmVcvtU32F32: {
-      SwVfpRegister scratch = kScratchDoubleReg.low();
-      __ vcvt_u32_f32(scratch, i.InputFloatRegister(0));
-      __ vmov(i.OutputRegister(), scratch);
-      // Avoid UINT32_MAX as an overflow indicator and use 0 instead,
-      // because 0 allows easier out-of-bounds detection.
-      __ cmn(i.OutputRegister(), Operand(1));
-      __ adc(i.OutputRegister(), i.OutputRegister(), Operand::Zero());
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    }
-    case kArmVcvtS32F64: {
-      SwVfpRegister scratch = kScratchDoubleReg.low();
-      __ vcvt_s32_f64(scratch, i.InputDoubleRegister(0));
-      __ vmov(i.OutputRegister(), scratch);
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    }
-    case kArmVcvtU32F64: {
-      SwVfpRegister scratch = kScratchDoubleReg.low();
-      __ vcvt_u32_f64(scratch, i.InputDoubleRegister(0));
-      __ vmov(i.OutputRegister(), scratch);
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    }
-    case kArmVmovU32F32:
-      __ vmov(i.OutputRegister(), i.InputFloatRegister(0));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmVmovF32U32:
-      __ vmov(i.OutputFloatRegister(), i.InputRegister(0));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmVmovLowU32F64:
-      __ VmovLow(i.OutputRegister(), i.InputDoubleRegister(0));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmVmovLowF64U32:
-      __ VmovLow(i.OutputDoubleRegister(), i.InputRegister(1));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmVmovHighU32F64:
-      __ VmovHigh(i.OutputRegister(), i.InputDoubleRegister(0));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmVmovHighF64U32:
-      __ VmovHigh(i.OutputDoubleRegister(), i.InputRegister(1));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmVmovF64U32U32:
-      __ vmov(i.OutputDoubleRegister(), i.InputRegister(0), i.InputRegister(1));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmVmovU32U32F64:
-      __ vmov(i.OutputRegister(0), i.OutputRegister(1),
-              i.InputDoubleRegister(0));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmLdrb:
-      __ ldrb(i.OutputRegister(), i.InputOffset());
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmLdrsb:
-      __ ldrsb(i.OutputRegister(), i.InputOffset());
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmStrb:
-      __ strb(i.InputRegister(0), i.InputOffset(1));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmLdrh:
-      __ ldrh(i.OutputRegister(), i.InputOffset());
-      break;
-    case kArmLdrsh:
-      __ ldrsh(i.OutputRegister(), i.InputOffset());
-      break;
-    case kArmStrh:
-      __ strh(i.InputRegister(0), i.InputOffset(1));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmLdr:
-      __ ldr(i.OutputRegister(), i.InputOffset());
-      break;
-    case kArmStr:
-      __ str(i.InputRegister(0), i.InputOffset(1));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmVldrF32: {
-      __ vldr(i.OutputFloatRegister(), i.InputOffset());
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    }
-    case kArmVstrF32:
-      __ vstr(i.InputFloatRegister(0), i.InputOffset(1));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmVld1F64: {
-      __ vld1(Neon8, NeonListOperand(i.OutputDoubleRegister()),
-              i.NeonInputOperand(0));
-      break;
-    }
-    case kArmVst1F64: {
-      __ vst1(Neon8, NeonListOperand(i.InputDoubleRegister(0)),
-              i.NeonInputOperand(1));
-      break;
-    }
-    case kArmVld1S128: {
-      __ vld1(Neon8, NeonListOperand(i.OutputSimd128Register()),
-              i.NeonInputOperand(0));
-      break;
-    }
-    case kArmVst1S128: {
-      __ vst1(Neon8, NeonListOperand(i.InputSimd128Register(0)),
-              i.NeonInputOperand(1));
-      break;
-    }
-    case kArmVldrF64:
-      __ vldr(i.OutputDoubleRegister(), i.InputOffset());
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmVstrF64:
-      __ vstr(i.InputDoubleRegister(0), i.InputOffset(1));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmFloat32Max: {
-      SwVfpRegister result = i.OutputFloatRegister();
-      SwVfpRegister left = i.InputFloatRegister(0);
-      SwVfpRegister right = i.InputFloatRegister(1);
-      if (left == right) {
-        __ Move(result, left);
-      } else {
-        auto ool = new (zone()) OutOfLineFloat32Max(this, result, left, right);
-        __ FloatMax(result, left, right, ool->entry());
-        __ bind(ool->exit());
-      }
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    }
-    case kArmFloat64Max: {
-      DwVfpRegister result = i.OutputDoubleRegister();
-      DwVfpRegister left = i.InputDoubleRegister(0);
-      DwVfpRegister right = i.InputDoubleRegister(1);
-      if (left == right) {
-        __ Move(result, left);
-      } else {
-        auto ool = new (zone()) OutOfLineFloat64Max(this, result, left, right);
-        __ FloatMax(result, left, right, ool->entry());
-        __ bind(ool->exit());
-      }
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    }
-    case kArmFloat32Min: {
-      SwVfpRegister result = i.OutputFloatRegister();
-      SwVfpRegister left = i.InputFloatRegister(0);
-      SwVfpRegister right = i.InputFloatRegister(1);
-      if (left == right) {
-        __ Move(result, left);
-      } else {
-        auto ool = new (zone()) OutOfLineFloat32Min(this, result, left, right);
-        __ FloatMin(result, left, right, ool->entry());
-        __ bind(ool->exit());
-      }
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    }
-    case kArmFloat64Min: {
-      DwVfpRegister result = i.OutputDoubleRegister();
-      DwVfpRegister left = i.InputDoubleRegister(0);
-      DwVfpRegister right = i.InputDoubleRegister(1);
-      if (left == right) {
-        __ Move(result, left);
-      } else {
-        auto ool = new (zone()) OutOfLineFloat64Min(this, result, left, right);
-        __ FloatMin(result, left, right, ool->entry());
-        __ bind(ool->exit());
-      }
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    }
-    case kArmFloat64SilenceNaN: {
-      DwVfpRegister value = i.InputDoubleRegister(0);
-      DwVfpRegister result = i.OutputDoubleRegister();
-      __ VFPCanonicalizeNaN(result, value);
-      break;
-    }
-    case kArmPush:
-      if (instr->InputAt(0)->IsFPRegister()) {
-        LocationOperand* op = LocationOperand::cast(instr->InputAt(0));
-        switch (op->representation()) {
-          case MachineRepresentation::kFloat32:
-            __ vpush(i.InputFloatRegister(0));
-            frame_access_state()->IncreaseSPDelta(1);
-            break;
-          case MachineRepresentation::kFloat64:
-            __ vpush(i.InputDoubleRegister(0));
-            frame_access_state()->IncreaseSPDelta(kDoubleSize / kPointerSize);
-            break;
-          case MachineRepresentation::kSimd128: {
-            __ vpush(i.InputSimd128Register(0));
-            frame_access_state()->IncreaseSPDelta(kSimd128Size / kPointerSize);
-            break;
-          }
-          default:
-            UNREACHABLE();
-            break;
-        }
-      } else {
-        __ push(i.InputRegister(0));
-        frame_access_state()->IncreaseSPDelta(1);
-      }
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    case kArmPoke: {
-      int const slot = MiscField::decode(instr->opcode());
-      __ str(i.InputRegister(0), MemOperand(sp, slot * kPointerSize));
-      DCHECK_EQ(LeaveCC, i.OutputSBit());
-      break;
-    }
-    case kArmPeek: {
-      // The incoming value is 0-based, but we need a 1-based value.
-      int reverse_slot = i.InputInt32(0) + 1;
-      int offset =
-          FrameSlotToFPOffset(frame()->GetTotalFrameSlotCount() - reverse_slot);
-      if (instr->OutputAt(0)->IsFPRegister()) {
-        LocationOperand* op = LocationOperand::cast(instr->OutputAt(0));
-        if (op->representation() == MachineRepresentation::kFloat64) {
-          __ vldr(i.OutputDoubleRegister(), MemOperand(fp, offset));
-        } else {
-          DCHECK_EQ(MachineRepresentation::kFloat32, op->representation());
-          __ vldr(i.OutputFloatRegister(), MemOperand(fp, offset));
-        }
-      } else {
-        __ ldr(i.OutputRegister(), MemOperand(fp, offset));
-      }
-      break;
-    }
-    case kArmF32x4Splat: {
-      int src_code = i.InputFloatRegister(0).code();
-      __ vdup(Neon32, i.OutputSimd128Register(),
-              DwVfpRegister::from_code(src_code / 2), src_code % 2);
-      break;
-    }
-    case kArmF32x4ExtractLane: {
-      __ ExtractLane(i.OutputFloatRegister(), i.InputSimd128Register(0),
-                     i.InputInt8(1));
-      break;
-    }
-    case kArmF32x4ReplaceLane: {
-      __ ReplaceLane(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                     i.InputFloatRegister(2), i.InputInt8(1));
-      break;
-    }
-    case kArmF32x4SConvertI32x4: {
-      __ vcvt_f32_s32(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kArmF32x4UConvertI32x4: {
-      __ vcvt_f32_u32(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kArmF32x4Abs: {
-      __ vabs(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kArmF32x4Neg: {
-      __ vneg(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kArmF32x4RecipApprox: {
-      __ vrecpe(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kArmF32x4RecipSqrtApprox: {
-      __ vrsqrte(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kArmF32x4Add: {
-      __ vadd(i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmF32x4AddHoriz: {
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // Make sure we don't overwrite source data before it's used.
-      if (dst == src0) {
-        __ vpadd(dst.low(), src0.low(), src0.high());
-        if (dst == src1) {
-          __ vmov(dst.high(), dst.low());
-        } else {
-          __ vpadd(dst.high(), src1.low(), src1.high());
-        }
-      } else {
-        __ vpadd(dst.high(), src1.low(), src1.high());
-        __ vpadd(dst.low(), src0.low(), src0.high());
-      }
-      break;
-    }
-    case kArmF32x4Sub: {
-      __ vsub(i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmF32x4Mul: {
-      __ vmul(i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmF32x4Min: {
-      __ vmin(i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmF32x4Max: {
-      __ vmax(i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmF32x4Eq: {
-      __ vceq(i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmF32x4Ne: {
-      Simd128Register dst = i.OutputSimd128Register();
-      __ vceq(dst, i.InputSimd128Register(0), i.InputSimd128Register(1));
-      __ vmvn(dst, dst);
-      break;
-    }
-    case kArmF32x4Lt: {
-      __ vcgt(i.OutputSimd128Register(), i.InputSimd128Register(1),
-              i.InputSimd128Register(0));
-      break;
-    }
-    case kArmF32x4Le: {
-      __ vcge(i.OutputSimd128Register(), i.InputSimd128Register(1),
-              i.InputSimd128Register(0));
-      break;
-    }
-    case kArmI32x4Splat: {
-      __ vdup(Neon32, i.OutputSimd128Register(), i.InputRegister(0));
-      break;
-    }
-    case kArmI32x4ExtractLane: {
-      __ ExtractLane(i.OutputRegister(), i.InputSimd128Register(0), NeonS32,
-                     i.InputInt8(1));
-      break;
-    }
-    case kArmI32x4ReplaceLane: {
-      __ ReplaceLane(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                     i.InputRegister(2), NeonS32, i.InputInt8(1));
-      break;
-    }
-    case kArmI32x4SConvertF32x4: {
-      __ vcvt_s32_f32(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kArmI32x4SConvertI16x8Low: {
-      __ vmovl(NeonS16, i.OutputSimd128Register(),
-               i.InputSimd128Register(0).low());
-      break;
-    }
-    case kArmI32x4SConvertI16x8High: {
-      __ vmovl(NeonS16, i.OutputSimd128Register(),
-               i.InputSimd128Register(0).high());
-      break;
-    }
-    case kArmI32x4Neg: {
-      __ vneg(Neon32, i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kArmI32x4Shl: {
-      __ vshl(NeonS32, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputInt5(1));
-      break;
-    }
-    case kArmI32x4ShrS: {
-      __ vshr(NeonS32, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputInt5(1));
-      break;
-    }
-    case kArmI32x4Add: {
-      __ vadd(Neon32, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI32x4AddHoriz:
-      ASSEMBLE_NEON_PAIRWISE_OP(vpadd, Neon32);
-      break;
-    case kArmI32x4Sub: {
-      __ vsub(Neon32, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI32x4Mul: {
-      __ vmul(Neon32, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI32x4MinS: {
-      __ vmin(NeonS32, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI32x4MaxS: {
-      __ vmax(NeonS32, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI32x4Eq: {
-      __ vceq(Neon32, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI32x4Ne: {
-      Simd128Register dst = i.OutputSimd128Register();
-      __ vceq(Neon32, dst, i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      __ vmvn(dst, dst);
-      break;
-    }
-    case kArmI32x4GtS: {
-      __ vcgt(NeonS32, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI32x4GeS: {
-      __ vcge(NeonS32, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI32x4UConvertF32x4: {
-      __ vcvt_u32_f32(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kArmI32x4UConvertI16x8Low: {
-      __ vmovl(NeonU16, i.OutputSimd128Register(),
-               i.InputSimd128Register(0).low());
-      break;
-    }
-    case kArmI32x4UConvertI16x8High: {
-      __ vmovl(NeonU16, i.OutputSimd128Register(),
-               i.InputSimd128Register(0).high());
-      break;
-    }
-    case kArmI32x4ShrU: {
-      __ vshr(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputInt5(1));
-      break;
-    }
-    case kArmI32x4MinU: {
-      __ vmin(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI32x4MaxU: {
-      __ vmax(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI32x4GtU: {
-      __ vcgt(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI32x4GeU: {
-      __ vcge(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI16x8Splat: {
-      __ vdup(Neon16, i.OutputSimd128Register(), i.InputRegister(0));
-      break;
-    }
-    case kArmI16x8ExtractLane: {
-      __ ExtractLane(i.OutputRegister(), i.InputSimd128Register(0), NeonS16,
-                     i.InputInt8(1));
-      break;
-    }
-    case kArmI16x8ReplaceLane: {
-      __ ReplaceLane(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                     i.InputRegister(2), NeonS16, i.InputInt8(1));
-      break;
-    }
-    case kArmI16x8SConvertI8x16Low: {
-      __ vmovl(NeonS8, i.OutputSimd128Register(),
-               i.InputSimd128Register(0).low());
-      break;
-    }
-    case kArmI16x8SConvertI8x16High: {
-      __ vmovl(NeonS8, i.OutputSimd128Register(),
-               i.InputSimd128Register(0).high());
-      break;
-    }
-    case kArmI16x8Neg: {
-      __ vneg(Neon16, i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kArmI16x8Shl: {
-      __ vshl(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputInt4(1));
-      break;
-    }
-    case kArmI16x8ShrS: {
-      __ vshr(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputInt4(1));
-      break;
-    }
-    case kArmI16x8SConvertI32x4:
-      ASSEMBLE_NEON_NARROWING_OP(NeonS16);
-      break;
-    case kArmI16x8Add: {
-      __ vadd(Neon16, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI16x8AddSaturateS: {
-      __ vqadd(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(0),
-               i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI16x8AddHoriz:
-      ASSEMBLE_NEON_PAIRWISE_OP(vpadd, Neon16);
-      break;
-    case kArmI16x8Sub: {
-      __ vsub(Neon16, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI16x8SubSaturateS: {
-      __ vqsub(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(0),
-               i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI16x8Mul: {
-      __ vmul(Neon16, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI16x8MinS: {
-      __ vmin(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI16x8MaxS: {
-      __ vmax(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI16x8Eq: {
-      __ vceq(Neon16, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI16x8Ne: {
-      Simd128Register dst = i.OutputSimd128Register();
-      __ vceq(Neon16, dst, i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      __ vmvn(dst, dst);
-      break;
-    }
-    case kArmI16x8GtS: {
-      __ vcgt(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI16x8GeS: {
-      __ vcge(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI16x8UConvertI8x16Low: {
-      __ vmovl(NeonU8, i.OutputSimd128Register(),
-               i.InputSimd128Register(0).low());
-      break;
-    }
-    case kArmI16x8UConvertI8x16High: {
-      __ vmovl(NeonU8, i.OutputSimd128Register(),
-               i.InputSimd128Register(0).high());
-      break;
-    }
-    case kArmI16x8ShrU: {
-      __ vshr(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputInt4(1));
-      break;
-    }
-    case kArmI16x8UConvertI32x4:
-      ASSEMBLE_NEON_NARROWING_OP(NeonU16);
-      break;
-    case kArmI16x8AddSaturateU: {
-      __ vqadd(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0),
-               i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI16x8SubSaturateU: {
-      __ vqsub(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0),
-               i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI16x8MinU: {
-      __ vmin(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI16x8MaxU: {
-      __ vmax(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI16x8GtU: {
-      __ vcgt(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI16x8GeU: {
-      __ vcge(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI8x16Splat: {
-      __ vdup(Neon8, i.OutputSimd128Register(), i.InputRegister(0));
-      break;
-    }
-    case kArmI8x16ExtractLane: {
-      __ ExtractLane(i.OutputRegister(), i.InputSimd128Register(0), NeonS8,
-                     i.InputInt8(1));
-      break;
-    }
-    case kArmI8x16ReplaceLane: {
-      __ ReplaceLane(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                     i.InputRegister(2), NeonS8, i.InputInt8(1));
-      break;
-    }
-    case kArmI8x16Neg: {
-      __ vneg(Neon8, i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kArmI8x16Shl: {
-      __ vshl(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputInt3(1));
-      break;
-    }
-    case kArmI8x16ShrS: {
-      __ vshr(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputInt3(1));
-      break;
-    }
-    case kArmI8x16SConvertI16x8:
-      ASSEMBLE_NEON_NARROWING_OP(NeonS8);
-      break;
-    case kArmI8x16Add: {
-      __ vadd(Neon8, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI8x16AddSaturateS: {
-      __ vqadd(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(0),
-               i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI8x16Sub: {
-      __ vsub(Neon8, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI8x16SubSaturateS: {
-      __ vqsub(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(0),
-               i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI8x16Mul: {
-      __ vmul(Neon8, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI8x16MinS: {
-      __ vmin(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI8x16MaxS: {
-      __ vmax(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI8x16Eq: {
-      __ vceq(Neon8, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI8x16Ne: {
-      Simd128Register dst = i.OutputSimd128Register();
-      __ vceq(Neon8, dst, i.InputSimd128Register(0), i.InputSimd128Register(1));
-      __ vmvn(dst, dst);
-      break;
-    }
-    case kArmI8x16GtS: {
-      __ vcgt(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI8x16GeS: {
-      __ vcge(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI8x16ShrU: {
-      __ vshr(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputInt3(1));
-      break;
-    }
-    case kArmI8x16UConvertI16x8:
-      ASSEMBLE_NEON_NARROWING_OP(NeonU8);
-      break;
-    case kArmI8x16AddSaturateU: {
-      __ vqadd(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0),
-               i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI8x16SubSaturateU: {
-      __ vqsub(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0),
-               i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI8x16MinU: {
-      __ vmin(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI8x16MaxU: {
-      __ vmax(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI8x16GtU: {
-      __ vcgt(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmI8x16GeU: {
-      __ vcge(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmS128Zero: {
-      __ veor(i.OutputSimd128Register(), i.OutputSimd128Register(),
-              i.OutputSimd128Register());
-      break;
-    }
-    case kArmS128Dup: {
-      NeonSize size = static_cast<NeonSize>(i.InputInt32(1));
-      int lanes = kSimd128Size >> size;
-      int index = i.InputInt32(2);
-      DCHECK(index < lanes);
-      int d_lanes = lanes / 2;
-      int src_d_index = index & (d_lanes - 1);
-      int src_d_code = i.InputSimd128Register(0).low().code() + index / d_lanes;
-      __ vdup(size, i.OutputSimd128Register(),
-              DwVfpRegister::from_code(src_d_code), src_d_index);
-      break;
-    }
-    case kArmS128And: {
-      __ vand(i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmS128Or: {
-      __ vorr(i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmS128Xor: {
-      __ veor(i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kArmS128Not: {
-      __ vmvn(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kArmS128Select: {
-      Simd128Register dst = i.OutputSimd128Register();
-      DCHECK(dst == i.InputSimd128Register(0));
-      __ vbsl(dst, i.InputSimd128Register(1), i.InputSimd128Register(2));
-      break;
-    }
-    case kArmS32x4ZipLeft: {
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src1 = i.InputSimd128Register(1);
-      DCHECK(dst == i.InputSimd128Register(0));
-      // src0 = [0, 1, 2, 3], src1 = [4, 5, 6, 7]
-      __ vmov(dst.high(), src1.low());         // dst = [0, 1, 4, 5]
-      __ vtrn(Neon32, dst.low(), dst.high());  // dst = [0, 4, 1, 5]
-      break;
-    }
-    case kArmS32x4ZipRight: {
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src1 = i.InputSimd128Register(1);
-      DCHECK(dst == i.InputSimd128Register(0));
-      // src0 = [4, 5, 6, 7], src1 = [0, 1, 2, 3] (flipped from ZipLeft).
-      __ vmov(dst.low(), src1.high());         // dst = [2, 3, 6, 7]
-      __ vtrn(Neon32, dst.low(), dst.high());  // dst = [2, 6, 3, 7]
-      break;
-    }
-    case kArmS32x4UnzipLeft: {
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src1 = i.InputSimd128Register(1);
-      DCHECK(dst == i.InputSimd128Register(0));
-      // src0 = [0, 1, 2, 3], src1 = [4, 5, 6, 7]
-      __ vmov(kScratchQuadReg, src1);
-      __ vuzp(Neon32, dst, kScratchQuadReg);  // dst = [0, 2, 4, 6]
-      break;
-    }
-    case kArmS32x4UnzipRight: {
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src1 = i.InputSimd128Register(1);
-      DCHECK(dst == i.InputSimd128Register(0));
-      // src0 = [4, 5, 6, 7], src1 = [0, 1, 2, 3] (flipped from UnzipLeft).
-      __ vmov(kScratchQuadReg, src1);
-      __ vuzp(Neon32, kScratchQuadReg, dst);  // dst = [1, 3, 5, 7]
-      break;
-    }
-    case kArmS32x4TransposeLeft: {
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src1 = i.InputSimd128Register(1);
-      DCHECK(dst == i.InputSimd128Register(0));
-      // src0 = [0, 1, 2, 3], src1 = [4, 5, 6, 7]
-      __ vmov(kScratchQuadReg, src1);
-      __ vtrn(Neon32, dst, kScratchQuadReg);  // dst = [0, 4, 2, 6]
-      break;
-    }
-    case kArmS32x4Shuffle: {
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // Check for in-place shuffles.
-      // If dst == src0 == src1, then the shuffle is unary and we only use src0.
-      if (dst == src0) {
-        __ vmov(kScratchQuadReg, src0);
-        src0 = kScratchQuadReg;
-      } else if (dst == src1) {
-        __ vmov(kScratchQuadReg, src1);
-        src1 = kScratchQuadReg;
-      }
-      // Perform shuffle as a vmov per lane.
-      int dst_code = dst.code() * 4;
-      int src0_code = src0.code() * 4;
-      int src1_code = src1.code() * 4;
-      int32_t shuffle = i.InputInt32(2);
-      for (int i = 0; i < 4; i++) {
-        int lane = shuffle & 0x7;
-        int src_code = src0_code;
-        if (lane >= 4) {
-          src_code = src1_code;
-          lane &= 0x3;
-        }
-        __ VmovExtended(dst_code + i, src_code + lane);
-        shuffle >>= 8;
-      }
-      break;
-    }
-    case kArmS32x4TransposeRight: {
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src1 = i.InputSimd128Register(1);
-      DCHECK(dst == i.InputSimd128Register(0));
-      // src0 = [4, 5, 6, 7], src1 = [0, 1, 2, 3] (flipped from TransposeLeft).
-      __ vmov(kScratchQuadReg, src1);
-      __ vtrn(Neon32, kScratchQuadReg, dst);  // dst = [1, 5, 3, 7]
-      break;
-    }
-    case kArmS16x8ZipLeft: {
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src1 = i.InputSimd128Register(1);
-      // src0 = [0, 1, 2, 3, ... 7], src1 = [8, 9, 10, 11, ... 15]
-      DCHECK(dst == i.InputSimd128Register(0));
-      __ vmov(dst.high(), src1.low());         // dst = [0, 1, 2, 3, 8, ... 11]
-      __ vzip(Neon16, dst.low(), dst.high());  // dst = [0, 8, 1, 9, ... 11]
-      break;
-    }
-    case kArmS16x8ZipRight: {
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src1 = i.InputSimd128Register(1);
-      DCHECK(dst == i.InputSimd128Register(0));
-      // src0 = [8, 9, 10, 11, ... 15], src1 = [0, 1, 2, 3, ... 7] (flipped).
-      __ vmov(dst.low(), src1.high());
-      __ vzip(Neon16, dst.low(), dst.high());  // dst = [4, 12, 5, 13, ... 15]
-      break;
-    }
-    case kArmS16x8UnzipLeft: {
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src1 = i.InputSimd128Register(1);
-      DCHECK(dst == i.InputSimd128Register(0));
-      // src0 = [0, 1, 2, 3, ... 7], src1 = [8, 9, 10, 11, ... 15]
-      __ vmov(kScratchQuadReg, src1);
-      __ vuzp(Neon16, dst, kScratchQuadReg);  // dst = [0, 2, 4, 6, ... 14]
-      break;
-    }
-    case kArmS16x8UnzipRight: {
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src1 = i.InputSimd128Register(1);
-      DCHECK(dst == i.InputSimd128Register(0));
-      // src0 = [8, 9, 10, 11, ... 15], src1 = [0, 1, 2, 3, ... 7] (flipped).
-      __ vmov(kScratchQuadReg, src1);
-      __ vuzp(Neon16, kScratchQuadReg, dst);  // dst = [1, 3, 5, 7, ... 15]
-      break;
-    }
-    case kArmS16x8TransposeLeft: {
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src1 = i.InputSimd128Register(1);
-      DCHECK(dst == i.InputSimd128Register(0));
-      // src0 = [0, 1, 2, 3, ... 7], src1 = [8, 9, 10, 11, ... 15]
-      __ vmov(kScratchQuadReg, src1);
-      __ vtrn(Neon16, dst, kScratchQuadReg);  // dst = [0, 8, 2, 10, ... 14]
-      break;
-    }
-    case kArmS16x8TransposeRight: {
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src1 = i.InputSimd128Register(1);
-      DCHECK(dst == i.InputSimd128Register(0));
-      // src0 = [8, 9, 10, 11, ... 15], src1 = [0, 1, 2, 3, ... 7] (flipped).
-      __ vmov(kScratchQuadReg, src1);
-      __ vtrn(Neon16, kScratchQuadReg, dst);  // dst = [1, 9, 3, 11, ... 15]
-      break;
-    }
-    case kArmS8x16ZipLeft: {
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src1 = i.InputSimd128Register(1);
-      DCHECK(dst == i.InputSimd128Register(0));
-      // src0 = [0, 1, 2, 3, ... 15], src1 = [16, 17, 18, 19, ... 31]
-      __ vmov(dst.high(), src1.low());
-      __ vzip(Neon8, dst.low(), dst.high());  // dst = [0, 16, 1, 17, ... 23]
-      break;
-    }
-    case kArmS8x16ZipRight: {
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src1 = i.InputSimd128Register(1);
-      DCHECK(dst == i.InputSimd128Register(0));
-      // src0 = [16, 17, 18, 19, ... 31], src1 = [0, 1, 2, 3, ... 15] (flipped).
-      __ vmov(dst.low(), src1.high());
-      __ vzip(Neon8, dst.low(), dst.high());  // dst = [8, 24, 9, 25, ... 31]
-      break;
-    }
-    case kArmS8x16UnzipLeft: {
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src1 = i.InputSimd128Register(1);
-      DCHECK(dst == i.InputSimd128Register(0));
-      // src0 = [0, 1, 2, 3, ... 15], src1 = [16, 17, 18, 19, ... 31]
-      __ vmov(kScratchQuadReg, src1);
-      __ vuzp(Neon8, dst, kScratchQuadReg);  // dst = [0, 2, 4, 6, ... 30]
-      break;
-    }
-    case kArmS8x16UnzipRight: {
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src1 = i.InputSimd128Register(1);
-      DCHECK(dst == i.InputSimd128Register(0));
-      // src0 = [16, 17, 18, 19, ... 31], src1 = [0, 1, 2, 3, ... 15] (flipped).
-      __ vmov(kScratchQuadReg, src1);
-      __ vuzp(Neon8, kScratchQuadReg, dst);  // dst = [1, 3, 5, 7, ... 31]
-      break;
-    }
-    case kArmS8x16TransposeLeft: {
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src1 = i.InputSimd128Register(1);
-      DCHECK(dst == i.InputSimd128Register(0));
-      // src0 = [0, 1, 2, 3, ... 15], src1 = [16, 17, 18, 19, ... 31]
-      __ vmov(kScratchQuadReg, src1);
-      __ vtrn(Neon8, dst, kScratchQuadReg);  // dst = [0, 16, 2, 18, ... 30]
-      break;
-    }
-    case kArmS8x16TransposeRight: {
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src1 = i.InputSimd128Register(1);
-      DCHECK(dst == i.InputSimd128Register(0));
-      // src0 = [16, 17, 18, 19, ... 31], src1 = [0, 1, 2, 3, ... 15] (flipped).
-      __ vmov(kScratchQuadReg, src1);
-      __ vtrn(Neon8, kScratchQuadReg, dst);  // dst = [1, 17, 3, 19, ... 31]
-      break;
-    }
-    case kArmS8x16Concat: {
-      __ vext(i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1), i.InputInt4(2));
-      break;
-    }
-    case kArmS8x16Shuffle: {
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      DwVfpRegister table_base = src0.low();
-      // If unary shuffle, table is src0 (2 d-registers), otherwise src0 and
-      // src1. They must be consecutive.
-      int table_size = src0 == src1 ? 2 : 4;
-      DCHECK_IMPLIES(src0 != src1, src0.code() + 1 == src1.code());
-      // The shuffle lane mask is a byte mask, materialize in kScratchQuadReg.
-      int scratch_s_base = kScratchQuadReg.code() * 4;
-      for (int j = 0; j < 4; j++) {
-        uint32_t four_lanes = i.InputUint32(2 + j);
-        // Ensure byte indices are in [0, 31] so masks are never NaNs.
-        four_lanes &= 0x1F1F1F1F;
-        __ vmov(SwVfpRegister::from_code(scratch_s_base + j),
-                Float32::FromBits(four_lanes));
-      }
-      NeonListOperand table(table_base, table_size);
-      if (dst != src0 && dst != src1) {
-        __ vtbl(dst.low(), table, kScratchQuadReg.low());
-        __ vtbl(dst.high(), table, kScratchQuadReg.high());
-      } else {
-        __ vtbl(kScratchQuadReg.low(), table, kScratchQuadReg.low());
-        __ vtbl(kScratchQuadReg.high(), table, kScratchQuadReg.high());
-        __ vmov(dst, kScratchQuadReg);
-      }
-      break;
-    }
-    case kArmS32x2Reverse: {
-      __ vrev64(Neon32, i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kArmS16x4Reverse: {
-      __ vrev64(Neon16, i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kArmS16x2Reverse: {
-      __ vrev32(Neon16, i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kArmS8x8Reverse: {
-      __ vrev64(Neon8, i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kArmS8x4Reverse: {
-      __ vrev32(Neon8, i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kArmS8x2Reverse: {
-      __ vrev16(Neon8, i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kArmS1x4AnyTrue: {
-      const QwNeonRegister& src = i.InputSimd128Register(0);
-      __ vpmax(NeonU32, kScratchDoubleReg, src.low(), src.high());
-      __ vpmax(NeonU32, kScratchDoubleReg, kScratchDoubleReg,
-               kScratchDoubleReg);
-      __ ExtractLane(i.OutputRegister(), kScratchDoubleReg, NeonS32, 0);
-      break;
-    }
-    case kArmS1x4AllTrue: {
-      const QwNeonRegister& src = i.InputSimd128Register(0);
-      __ vpmin(NeonU32, kScratchDoubleReg, src.low(), src.high());
-      __ vpmin(NeonU32, kScratchDoubleReg, kScratchDoubleReg,
-               kScratchDoubleReg);
-      __ ExtractLane(i.OutputRegister(), kScratchDoubleReg, NeonS32, 0);
-      break;
-    }
-    case kArmS1x8AnyTrue: {
-      const QwNeonRegister& src = i.InputSimd128Register(0);
-      __ vpmax(NeonU16, kScratchDoubleReg, src.low(), src.high());
-      __ vpmax(NeonU16, kScratchDoubleReg, kScratchDoubleReg,
-               kScratchDoubleReg);
-      __ vpmax(NeonU16, kScratchDoubleReg, kScratchDoubleReg,
-               kScratchDoubleReg);
-      __ ExtractLane(i.OutputRegister(), kScratchDoubleReg, NeonS16, 0);
-      break;
-    }
-    case kArmS1x8AllTrue: {
-      const QwNeonRegister& src = i.InputSimd128Register(0);
-      __ vpmin(NeonU16, kScratchDoubleReg, src.low(), src.high());
-      __ vpmin(NeonU16, kScratchDoubleReg, kScratchDoubleReg,
-               kScratchDoubleReg);
-      __ vpmin(NeonU16, kScratchDoubleReg, kScratchDoubleReg,
-               kScratchDoubleReg);
-      __ ExtractLane(i.OutputRegister(), kScratchDoubleReg, NeonS16, 0);
-      break;
-    }
-    case kArmS1x16AnyTrue: {
-      const QwNeonRegister& src = i.InputSimd128Register(0);
-      __ vpmax(NeonU8, kScratchDoubleReg, src.low(), src.high());
-      __ vpmax(NeonU8, kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg);
-      // vtst to detect any bits in the bottom 32 bits of kScratchDoubleReg.
-      // This saves an instruction vs. the naive sequence of vpmax.
-      // kDoubleRegZero is not changed, since it is 0.
-      __ vtst(Neon32, kScratchQuadReg, kScratchQuadReg, kScratchQuadReg);
-      __ ExtractLane(i.OutputRegister(), kScratchDoubleReg, NeonS32, 0);
-      break;
-    }
-    case kArmS1x16AllTrue: {
-      const QwNeonRegister& src = i.InputSimd128Register(0);
-      __ vpmin(NeonU8, kScratchDoubleReg, src.low(), src.high());
-      __ vpmin(NeonU8, kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg);
-      __ vpmin(NeonU8, kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg);
-      __ vpmin(NeonU8, kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg);
-      __ ExtractLane(i.OutputRegister(), kScratchDoubleReg, NeonS8, 0);
-      break;
-    }
-    case kAtomicLoadInt8:
-      ASSEMBLE_ATOMIC_LOAD_INTEGER(ldrsb);
-      break;
-    case kAtomicLoadUint8:
-      ASSEMBLE_ATOMIC_LOAD_INTEGER(ldrb);
-      break;
-    case kAtomicLoadInt16:
-      ASSEMBLE_ATOMIC_LOAD_INTEGER(ldrsh);
-      break;
-    case kAtomicLoadUint16:
-      ASSEMBLE_ATOMIC_LOAD_INTEGER(ldrh);
-      break;
-    case kAtomicLoadWord32:
-      ASSEMBLE_ATOMIC_LOAD_INTEGER(ldr);
-      break;
-
-    case kAtomicStoreWord8:
-      ASSEMBLE_ATOMIC_STORE_INTEGER(strb);
-      break;
-    case kAtomicStoreWord16:
-      ASSEMBLE_ATOMIC_STORE_INTEGER(strh);
-      break;
-    case kAtomicStoreWord32:
-      ASSEMBLE_ATOMIC_STORE_INTEGER(str);
-      break;
-    case kAtomicExchangeInt8:
-      ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(ldrexb, strexb);
-      __ sxtb(i.OutputRegister(0), i.OutputRegister(0));
-      break;
-    case kAtomicExchangeUint8:
-      ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(ldrexb, strexb);
-      break;
-    case kAtomicExchangeInt16:
-      ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(ldrexh, strexh);
-      __ sxth(i.OutputRegister(0), i.OutputRegister(0));
-      break;
-    case kAtomicExchangeUint16:
-      ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(ldrexh, strexh);
-      break;
-    case kAtomicExchangeWord32:
-      ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(ldrex, strex);
-      break;
-    case kAtomicCompareExchangeInt8:
-      __ add(i.TempRegister(1), i.InputRegister(0), i.InputRegister(1));
-      __ uxtb(i.TempRegister(2), i.InputRegister(2));
-      ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER(ldrexb, strexb,
-                                               i.TempRegister(2));
-      __ sxtb(i.OutputRegister(0), i.OutputRegister(0));
-      break;
-    case kAtomicCompareExchangeUint8:
-      __ add(i.TempRegister(1), i.InputRegister(0), i.InputRegister(1));
-      __ uxtb(i.TempRegister(2), i.InputRegister(2));
-      ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER(ldrexb, strexb,
-                                               i.TempRegister(2));
-      break;
-    case kAtomicCompareExchangeInt16:
-      __ add(i.TempRegister(1), i.InputRegister(0), i.InputRegister(1));
-      __ uxth(i.TempRegister(2), i.InputRegister(2));
-      ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER(ldrexh, strexh,
-                                               i.TempRegister(2));
-      __ sxth(i.OutputRegister(0), i.OutputRegister(0));
-      break;
-    case kAtomicCompareExchangeUint16:
-      __ add(i.TempRegister(1), i.InputRegister(0), i.InputRegister(1));
-      __ uxth(i.TempRegister(2), i.InputRegister(2));
-      ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER(ldrexh, strexh,
-                                               i.TempRegister(2));
-      break;
-    case kAtomicCompareExchangeWord32:
-      __ add(i.TempRegister(1), i.InputRegister(0), i.InputRegister(1));
-      ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER(ldrex, strex,
-                                               i.InputRegister(2));
-      break;
-#define ATOMIC_BINOP_CASE(op, inst)                    \
-  case kAtomic##op##Int8:                              \
-    ASSEMBLE_ATOMIC_BINOP(ldrexb, strexb, inst);       \
-    __ sxtb(i.OutputRegister(0), i.OutputRegister(0)); \
-    break;                                             \
-  case kAtomic##op##Uint8:                             \
-    ASSEMBLE_ATOMIC_BINOP(ldrexb, strexb, inst);       \
-    break;                                             \
-  case kAtomic##op##Int16:                             \
-    ASSEMBLE_ATOMIC_BINOP(ldrexh, strexh, inst);       \
-    __ sxth(i.OutputRegister(0), i.OutputRegister(0)); \
-    break;                                             \
-  case kAtomic##op##Uint16:                            \
-    ASSEMBLE_ATOMIC_BINOP(ldrexh, strexh, inst);       \
-    break;                                             \
-  case kAtomic##op##Word32:                            \
-    ASSEMBLE_ATOMIC_BINOP(ldrex, strex, inst);         \
-    break;
-      ATOMIC_BINOP_CASE(Add, add)
-      ATOMIC_BINOP_CASE(Sub, sub)
-      ATOMIC_BINOP_CASE(And, and_)
-      ATOMIC_BINOP_CASE(Or, orr)
-      ATOMIC_BINOP_CASE(Xor, eor)
-#undef ATOMIC_BINOP_CASE
-#undef ASSEMBLE_ATOMIC_LOAD_INTEGER
-#undef ASSEMBLE_ATOMIC_STORE_INTEGER
-#undef ASSEMBLE_ATOMIC_EXCHANGE_INTEGER
-#undef ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER
-#undef ASSEMBLE_ATOMIC_BINOP
-#undef ASSEMBLE_IEEE754_BINOP
-#undef ASSEMBLE_IEEE754_UNOP
-#undef ASSEMBLE_NEON_NARROWING_OP
-#undef ASSEMBLE_NEON_PAIRWISE_OP
-  }
-  return kSuccess;
-}  // NOLINT(readability/fn_size)
-
-
-// Assembles branches after an instruction.
-void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) {
-  ArmOperandConverter i(this, instr);
-  Label* tlabel = branch->true_label;
-  Label* flabel = branch->false_label;
-  Condition cc = FlagsConditionToCondition(branch->condition);
-  __ b(cc, tlabel);
-  if (!branch->fallthru) __ b(flabel);  // no fallthru to flabel.
-}
-
-void CodeGenerator::AssembleArchDeoptBranch(Instruction* instr,
-                                            BranchInfo* branch) {
-  AssembleArchBranch(instr, branch);
-}
-
-void CodeGenerator::AssembleArchJump(RpoNumber target) {
-  if (!IsNextInAssemblyOrder(target)) __ b(GetLabel(target));
-}
-
-void CodeGenerator::AssembleArchTrap(Instruction* instr,
-                                     FlagsCondition condition) {
-  class OutOfLineTrap final : public OutOfLineCode {
-   public:
-    OutOfLineTrap(CodeGenerator* gen, bool frame_elided, Instruction* instr)
-        : OutOfLineCode(gen),
-          frame_elided_(frame_elided),
-          instr_(instr),
-          gen_(gen) {}
-
-    void Generate() final {
-      ArmOperandConverter i(gen_, instr_);
-
-      Builtins::Name trap_id =
-          static_cast<Builtins::Name>(i.InputInt32(instr_->InputCount() - 1));
-      bool old_has_frame = __ has_frame();
-      if (frame_elided_) {
-        __ set_has_frame(true);
-        __ EnterFrame(StackFrame::WASM_COMPILED);
-      }
-      GenerateCallToTrap(trap_id);
-      if (frame_elided_) {
-        __ set_has_frame(old_has_frame);
-      }
-    }
-
-   private:
-    void GenerateCallToTrap(Builtins::Name trap_id) {
-      if (trap_id == Builtins::builtin_count) {
-        // We cannot test calls to the runtime in cctest/test-run-wasm.
-        // Therefore we emit a call to C here instead of a call to the runtime.
-        // We use the context register as the scratch register, because we do
-        // not have a context here.
-        __ PrepareCallCFunction(0, 0);
-        __ CallCFunction(ExternalReference::wasm_call_trap_callback_for_testing(
-                             __ isolate()),
-                         0);
-        __ LeaveFrame(StackFrame::WASM_COMPILED);
-        CallDescriptor* descriptor = gen_->linkage()->GetIncomingDescriptor();
-        int pop_count = static_cast<int>(descriptor->StackParameterCount());
-        __ Drop(pop_count);
-        __ Ret();
-      } else {
-        gen_->AssembleSourcePosition(instr_);
-        __ Call(__ isolate()->builtins()->builtin_handle(trap_id),
-                RelocInfo::CODE_TARGET);
-        ReferenceMap* reference_map =
-            new (gen_->zone()) ReferenceMap(gen_->zone());
-        gen_->RecordSafepoint(reference_map, Safepoint::kSimple, 0,
-                              Safepoint::kNoLazyDeopt);
-        if (FLAG_debug_code) {
-          __ stop(GetAbortReason(AbortReason::kUnexpectedReturnFromWasmTrap));
-        }
-      }
-    }
-
-    bool frame_elided_;
-    Instruction* instr_;
-    CodeGenerator* gen_;
-  };
-  bool frame_elided = !frame_access_state()->has_frame();
-  auto ool = new (zone()) OutOfLineTrap(this, frame_elided, instr);
-  Label* tlabel = ool->entry();
-  Condition cc = FlagsConditionToCondition(condition);
-  __ b(cc, tlabel);
-}
-
-// Assembles boolean materializations after an instruction.
-void CodeGenerator::AssembleArchBoolean(Instruction* instr,
-                                        FlagsCondition condition) {
-  ArmOperandConverter i(this, instr);
-
-  // Materialize a full 32-bit 1 or 0 value. The result register is always the
-  // last output of the instruction.
-  DCHECK_NE(0u, instr->OutputCount());
-  Register reg = i.OutputRegister(instr->OutputCount() - 1);
-  Condition cc = FlagsConditionToCondition(condition);
-  __ mov(reg, Operand(0));
-  __ mov(reg, Operand(1), LeaveCC, cc);
-}
-
-
-void CodeGenerator::AssembleArchLookupSwitch(Instruction* instr) {
-  ArmOperandConverter i(this, instr);
-  Register input = i.InputRegister(0);
-  for (size_t index = 2; index < instr->InputCount(); index += 2) {
-    __ cmp(input, Operand(i.InputInt32(index + 0)));
-    __ b(eq, GetLabel(i.InputRpo(index + 1)));
-  }
-  AssembleArchJump(i.InputRpo(1));
-}
-
-
-void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) {
-  ArmOperandConverter i(this, instr);
-  Register input = i.InputRegister(0);
-  size_t const case_count = instr->InputCount() - 2;
-  // Ensure to emit the constant pool first if necessary.
-  __ CheckConstPool(true, true);
-  __ cmp(input, Operand(case_count));
-  __ BlockConstPoolFor(case_count + 2);
-  __ add(pc, pc, Operand(input, LSL, 2), LeaveCC, lo);
-  __ b(GetLabel(i.InputRpo(1)));
-  for (size_t index = 0; index < case_count; ++index) {
-    __ b(GetLabel(i.InputRpo(index + 2)));
-  }
-}
-
-void CodeGenerator::FinishFrame(Frame* frame) {
-  CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
-
-  const RegList saves_fp = descriptor->CalleeSavedFPRegisters();
-  if (saves_fp != 0) {
-    frame->AlignSavedCalleeRegisterSlots();
-  }
-
-  if (saves_fp != 0) {
-    // Save callee-saved FP registers.
-    STATIC_ASSERT(DwVfpRegister::kNumRegisters == 32);
-    uint32_t last = base::bits::CountLeadingZeros32(saves_fp) - 1;
-    uint32_t first = base::bits::CountTrailingZeros32(saves_fp);
-    DCHECK_EQ((last - first + 1), base::bits::CountPopulation(saves_fp));
-    frame->AllocateSavedCalleeRegisterSlots((last - first + 1) *
-                                            (kDoubleSize / kPointerSize));
-  }
-  const RegList saves = descriptor->CalleeSavedRegisters();
-  if (saves != 0) {
-    // Save callee-saved registers.
-    frame->AllocateSavedCalleeRegisterSlots(base::bits::CountPopulation(saves));
-  }
-}
-
-void CodeGenerator::AssembleConstructFrame() {
-  CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
-  if (frame_access_state()->has_frame()) {
-    if (descriptor->IsCFunctionCall()) {
-      __ Push(lr, fp);
-      __ mov(fp, sp);
-    } else if (descriptor->IsJSFunctionCall()) {
-      __ Prologue();
-      if (descriptor->PushArgumentCount()) {
-        __ Push(kJavaScriptCallArgCountRegister);
-      }
-    } else {
-      __ StubPrologue(info()->GetOutputStackFrameType());
-    }
-
-    unwinding_info_writer_.MarkFrameConstructed(__ pc_offset());
-  }
-
-  int shrink_slots =
-      frame()->GetTotalFrameSlotCount() - descriptor->CalculateFixedFrameSize();
-
-  if (info()->is_osr()) {
-    // TurboFan OSR-compiled functions cannot be entered directly.
-    __ Abort(AbortReason::kShouldNotDirectlyEnterOsrFunction);
-
-    // Unoptimized code jumps directly to this entrypoint while the unoptimized
-    // frame is still on the stack. Optimized code uses OSR values directly from
-    // the unoptimized frame. Thus, all that needs to be done is to allocate the
-    // remaining stack slots.
-    if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --");
-    osr_pc_offset_ = __ pc_offset();
-    shrink_slots -= osr_helper()->UnoptimizedFrameSlots();
-  }
-
-  const RegList saves = descriptor->CalleeSavedRegisters();
-  const RegList saves_fp = descriptor->CalleeSavedFPRegisters();
-
-  if (shrink_slots > 0) {
-    if (info()->IsWasm()) {
-      if (shrink_slots > 128) {
-        // For WebAssembly functions with big frames we have to do the stack
-        // overflow check before we construct the frame. Otherwise we may not
-        // have enough space on the stack to call the runtime for the stack
-        // overflow.
-        Label done;
-
-        // If the frame is bigger than the stack, we throw the stack overflow
-        // exception unconditionally. Thereby we can avoid the integer overflow
-        // check in the condition code.
-        if ((shrink_slots * kPointerSize) < (FLAG_stack_size * 1024)) {
-          UseScratchRegisterScope temps(tasm());
-          Register scratch = temps.Acquire();
-          __ Move(scratch,
-                  Operand(ExternalReference::address_of_real_stack_limit(
-                      __ isolate())));
-          __ ldr(scratch, MemOperand(scratch));
-          __ add(scratch, scratch, Operand(shrink_slots * kPointerSize));
-          __ cmp(sp, scratch);
-          __ b(cs, &done);
-        }
-
-        if (!frame_access_state()->has_frame()) {
-          __ set_has_frame(true);
-          // There is no need to leave the frame, we will not return from the
-          // runtime call.
-          __ EnterFrame(StackFrame::WASM_COMPILED);
-        }
-        __ Move(cp, Smi::kZero);
-        __ CallRuntimeDelayed(zone(), Runtime::kThrowWasmStackOverflow);
-        // We come from WebAssembly, there are no references for the GC.
-        ReferenceMap* reference_map = new (zone()) ReferenceMap(zone());
-        RecordSafepoint(reference_map, Safepoint::kSimple, 0,
-                        Safepoint::kNoLazyDeopt);
-        if (FLAG_debug_code) {
-          __ stop(GetAbortReason(AbortReason::kUnexpectedReturnFromThrow));
-        }
-
-        __ bind(&done);
-      }
-    }
-
-    // Skip callee-saved and return slots, which are pushed below.
-    shrink_slots -= base::bits::CountPopulation(saves);
-    shrink_slots -= frame()->GetReturnSlotCount();
-    shrink_slots -= 2 * base::bits::CountPopulation(saves_fp);
-    if (shrink_slots > 0) {
-      __ sub(sp, sp, Operand(shrink_slots * kPointerSize));
-    }
-  }
-
-  if (saves_fp != 0) {
-    // Save callee-saved FP registers.
-    STATIC_ASSERT(DwVfpRegister::kNumRegisters == 32);
-    uint32_t last = base::bits::CountLeadingZeros32(saves_fp) - 1;
-    uint32_t first = base::bits::CountTrailingZeros32(saves_fp);
-    DCHECK_EQ((last - first + 1), base::bits::CountPopulation(saves_fp));
-    __ vstm(db_w, sp, DwVfpRegister::from_code(first),
-            DwVfpRegister::from_code(last));
-  }
-
-  if (saves != 0) {
-    // Save callee-saved registers.
-    __ stm(db_w, sp, saves);
-  }
-
-  const int returns = frame()->GetReturnSlotCount();
-  if (returns != 0) {
-    // Create space for returns.
-    __ sub(sp, sp, Operand(returns * kPointerSize));
-  }
-}
-
-void CodeGenerator::AssembleReturn(InstructionOperand* pop) {
-  CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
-  int pop_count = static_cast<int>(descriptor->StackParameterCount());
-
-  const int returns = frame()->GetReturnSlotCount();
-  if (returns != 0) {
-    // Free space of returns.
-    __ add(sp, sp, Operand(returns * kPointerSize));
-  }
-
-  // Restore registers.
-  const RegList saves = descriptor->CalleeSavedRegisters();
-  if (saves != 0) {
-    __ ldm(ia_w, sp, saves);
-  }
-
-  // Restore FP registers.
-  const RegList saves_fp = descriptor->CalleeSavedFPRegisters();
-  if (saves_fp != 0) {
-    STATIC_ASSERT(DwVfpRegister::kNumRegisters == 32);
-    uint32_t last = base::bits::CountLeadingZeros32(saves_fp) - 1;
-    uint32_t first = base::bits::CountTrailingZeros32(saves_fp);
-    __ vldm(ia_w, sp, DwVfpRegister::from_code(first),
-            DwVfpRegister::from_code(last));
-  }
-
-  unwinding_info_writer_.MarkBlockWillExit();
-
-  ArmOperandConverter g(this, nullptr);
-  if (descriptor->IsCFunctionCall()) {
-    AssembleDeconstructFrame();
-  } else if (frame_access_state()->has_frame()) {
-    // Canonicalize JSFunction return sites for now unless they have an variable
-    // number of stack slot pops.
-    if (pop->IsImmediate() && g.ToConstant(pop).ToInt32() == 0) {
-      if (return_label_.is_bound()) {
-        __ b(&return_label_);
-        return;
-      } else {
-        __ bind(&return_label_);
-        AssembleDeconstructFrame();
-      }
-    } else {
-      AssembleDeconstructFrame();
-    }
-  }
-
-  if (pop->IsImmediate()) {
-    DCHECK_EQ(Constant::kInt32, g.ToConstant(pop).type());
-    pop_count += g.ToConstant(pop).ToInt32();
-  } else {
-    __ Drop(g.ToRegister(pop));
-  }
-  __ Drop(pop_count);
-  __ Ret();
-}
-
-void CodeGenerator::FinishCode() { __ CheckConstPool(true, false); }
-
-void CodeGenerator::AssembleMove(InstructionOperand* source,
-                                 InstructionOperand* destination) {
-  ArmOperandConverter g(this, nullptr);
-  // Dispatch on the source and destination operand kinds.  Not all
-  // combinations are possible.
-  if (source->IsRegister()) {
-    DCHECK(destination->IsRegister() || destination->IsStackSlot());
-    Register src = g.ToRegister(source);
-    if (destination->IsRegister()) {
-      __ mov(g.ToRegister(destination), src);
-    } else {
-      __ str(src, g.ToMemOperand(destination));
-    }
-  } else if (source->IsStackSlot()) {
-    DCHECK(destination->IsRegister() || destination->IsStackSlot());
-    MemOperand src = g.ToMemOperand(source);
-    if (destination->IsRegister()) {
-      __ ldr(g.ToRegister(destination), src);
-    } else {
-      Register temp = kScratchReg;
-      __ ldr(temp, src);
-      __ str(temp, g.ToMemOperand(destination));
-    }
-  } else if (source->IsConstant()) {
-    Constant src = g.ToConstant(source);
-    if (destination->IsRegister() || destination->IsStackSlot()) {
-      Register dst =
-          destination->IsRegister() ? g.ToRegister(destination) : kScratchReg;
-      switch (src.type()) {
-        case Constant::kInt32:
-          if (RelocInfo::IsWasmReference(src.rmode())) {
-            __ mov(dst, Operand(src.ToInt32(), src.rmode()));
-          } else {
-            __ mov(dst, Operand(src.ToInt32()));
-          }
-          break;
-        case Constant::kInt64:
-          UNREACHABLE();
-          break;
-        case Constant::kFloat32:
-          __ mov(dst, Operand::EmbeddedNumber(src.ToFloat32()));
-          break;
-        case Constant::kFloat64:
-          __ mov(dst, Operand::EmbeddedNumber(src.ToFloat64().value()));
-          break;
-        case Constant::kExternalReference:
-          __ mov(dst, Operand(src.ToExternalReference()));
-          break;
-        case Constant::kHeapObject: {
-          Handle<HeapObject> src_object = src.ToHeapObject();
-          Heap::RootListIndex index;
-          if (IsMaterializableFromRoot(src_object, &index)) {
-            __ LoadRoot(dst, index);
-          } else {
-            __ Move(dst, src_object);
-          }
-          break;
-        }
-        case Constant::kRpoNumber:
-          UNREACHABLE();  // TODO(dcarney): loading RPO constants on arm.
-          break;
-      }
-      if (destination->IsStackSlot()) __ str(dst, g.ToMemOperand(destination));
-    } else if (src.type() == Constant::kFloat32) {
-      if (destination->IsFloatStackSlot()) {
-        MemOperand dst = g.ToMemOperand(destination);
-        Register temp = kScratchReg;
-        __ mov(temp, Operand(bit_cast<int32_t>(src.ToFloat32())));
-        __ str(temp, dst);
-      } else {
-        SwVfpRegister dst = g.ToFloatRegister(destination);
-        __ vmov(dst, Float32::FromBits(src.ToFloat32AsInt()));
-      }
-    } else {
-      DCHECK_EQ(Constant::kFloat64, src.type());
-      DwVfpRegister dst = destination->IsFPRegister()
-                              ? g.ToDoubleRegister(destination)
-                              : kScratchDoubleReg;
-      __ vmov(dst, src.ToFloat64(), kScratchReg);
-      if (destination->IsDoubleStackSlot()) {
-        __ vstr(dst, g.ToMemOperand(destination));
-      }
-    }
-  } else if (source->IsFPRegister()) {
-    MachineRepresentation rep = LocationOperand::cast(source)->representation();
-    if (rep == MachineRepresentation::kFloat64) {
-      DwVfpRegister src = g.ToDoubleRegister(source);
-      if (destination->IsDoubleRegister()) {
-        DwVfpRegister dst = g.ToDoubleRegister(destination);
-        __ Move(dst, src);
-      } else {
-        DCHECK(destination->IsDoubleStackSlot());
-        __ vstr(src, g.ToMemOperand(destination));
-      }
-    } else if (rep == MachineRepresentation::kFloat32) {
-      // GapResolver may give us reg codes that don't map to actual s-registers.
-      // Generate code to work around those cases.
-      int src_code = LocationOperand::cast(source)->register_code();
-      if (destination->IsFloatRegister()) {
-        int dst_code = LocationOperand::cast(destination)->register_code();
-        __ VmovExtended(dst_code, src_code);
-      } else {
-        DCHECK(destination->IsFloatStackSlot());
-        __ VmovExtended(g.ToMemOperand(destination), src_code);
-      }
-    } else {
-      DCHECK_EQ(MachineRepresentation::kSimd128, rep);
-      QwNeonRegister src = g.ToSimd128Register(source);
-      if (destination->IsSimd128Register()) {
-        QwNeonRegister dst = g.ToSimd128Register(destination);
-        __ Move(dst, src);
-      } else {
-        DCHECK(destination->IsSimd128StackSlot());
-        MemOperand dst = g.ToMemOperand(destination);
-        __ add(kScratchReg, dst.rn(), Operand(dst.offset()));
-        __ vst1(Neon8, NeonListOperand(src.low(), 2),
-                NeonMemOperand(kScratchReg));
-      }
-    }
-  } else if (source->IsFPStackSlot()) {
-    MemOperand src = g.ToMemOperand(source);
-    MachineRepresentation rep =
-        LocationOperand::cast(destination)->representation();
-    if (destination->IsFPRegister()) {
-      if (rep == MachineRepresentation::kFloat64) {
-        __ vldr(g.ToDoubleRegister(destination), src);
-      } else if (rep == MachineRepresentation::kFloat32) {
-        // GapResolver may give us reg codes that don't map to actual
-        // s-registers. Generate code to work around those cases.
-        int dst_code = LocationOperand::cast(destination)->register_code();
-        __ VmovExtended(dst_code, src);
-      } else {
-        DCHECK_EQ(MachineRepresentation::kSimd128, rep);
-        QwNeonRegister dst = g.ToSimd128Register(destination);
-        __ add(kScratchReg, src.rn(), Operand(src.offset()));
-        __ vld1(Neon8, NeonListOperand(dst.low(), 2),
-                NeonMemOperand(kScratchReg));
-      }
-    } else {
-      DCHECK(destination->IsFPStackSlot());
-      if (rep == MachineRepresentation::kFloat64) {
-        DwVfpRegister temp = kScratchDoubleReg;
-        __ vldr(temp, src);
-        __ vstr(temp, g.ToMemOperand(destination));
-      } else if (rep == MachineRepresentation::kFloat32) {
-        SwVfpRegister temp = kScratchDoubleReg.low();
-        __ vldr(temp, src);
-        __ vstr(temp, g.ToMemOperand(destination));
-      } else {
-        DCHECK_EQ(MachineRepresentation::kSimd128, rep);
-        MemOperand dst = g.ToMemOperand(destination);
-        __ add(kScratchReg, src.rn(), Operand(src.offset()));
-        __ vld1(Neon8, NeonListOperand(kScratchQuadReg.low(), 2),
-                NeonMemOperand(kScratchReg));
-        __ add(kScratchReg, dst.rn(), Operand(dst.offset()));
-        __ vst1(Neon8, NeonListOperand(kScratchQuadReg.low(), 2),
-                NeonMemOperand(kScratchReg));
-      }
-    }
-  } else {
-    UNREACHABLE();
-  }
-}
-
-void CodeGenerator::AssembleSwap(InstructionOperand* source,
-                                 InstructionOperand* destination) {
-  ArmOperandConverter g(this, nullptr);
-  // Dispatch on the source and destination operand kinds.  Not all
-  // combinations are possible.
-  if (source->IsRegister()) {
-    // Register-register.
-    Register temp = kScratchReg;
-    Register src = g.ToRegister(source);
-    if (destination->IsRegister()) {
-      Register dst = g.ToRegister(destination);
-      __ Move(temp, src);
-      __ Move(src, dst);
-      __ Move(dst, temp);
-    } else {
-      DCHECK(destination->IsStackSlot());
-      MemOperand dst = g.ToMemOperand(destination);
-      __ mov(temp, src);
-      __ ldr(src, dst);
-      __ str(temp, dst);
-    }
-  } else if (source->IsStackSlot()) {
-    DCHECK(destination->IsStackSlot());
-    Register temp_0 = kScratchReg;
-    SwVfpRegister temp_1 = kScratchDoubleReg.low();
-    MemOperand src = g.ToMemOperand(source);
-    MemOperand dst = g.ToMemOperand(destination);
-    __ ldr(temp_0, src);
-    __ vldr(temp_1, dst);
-    __ str(temp_0, dst);
-    __ vstr(temp_1, src);
-  } else if (source->IsFPRegister()) {
-    MachineRepresentation rep = LocationOperand::cast(source)->representation();
-    LowDwVfpRegister temp = kScratchDoubleReg;
-    if (rep == MachineRepresentation::kFloat64) {
-      DwVfpRegister src = g.ToDoubleRegister(source);
-      if (destination->IsFPRegister()) {
-        DwVfpRegister dst = g.ToDoubleRegister(destination);
-        __ Swap(src, dst);
-      } else {
-        DCHECK(destination->IsFPStackSlot());
-        MemOperand dst = g.ToMemOperand(destination);
-        __ Move(temp, src);
-        __ vldr(src, dst);
-        __ vstr(temp, dst);
-      }
-    } else if (rep == MachineRepresentation::kFloat32) {
-      int src_code = LocationOperand::cast(source)->register_code();
-      if (destination->IsFPRegister()) {
-        int dst_code = LocationOperand::cast(destination)->register_code();
-        __ VmovExtended(temp.low().code(), src_code);
-        __ VmovExtended(src_code, dst_code);
-        __ VmovExtended(dst_code, temp.low().code());
-      } else {
-        DCHECK(destination->IsFPStackSlot());
-        MemOperand dst = g.ToMemOperand(destination);
-        __ VmovExtended(temp.low().code(), src_code);
-        __ VmovExtended(src_code, dst);
-        __ vstr(temp.low(), dst);
-      }
-    } else {
-      DCHECK_EQ(MachineRepresentation::kSimd128, rep);
-      QwNeonRegister src = g.ToSimd128Register(source);
-      if (destination->IsFPRegister()) {
-        QwNeonRegister dst = g.ToSimd128Register(destination);
-        __ Swap(src, dst);
-      } else {
-        DCHECK(destination->IsFPStackSlot());
-        MemOperand dst = g.ToMemOperand(destination);
-        __ Move(kScratchQuadReg, src);
-        __ add(kScratchReg, dst.rn(), Operand(dst.offset()));
-        __ vld1(Neon8, NeonListOperand(src.low(), 2),
-                NeonMemOperand(kScratchReg));
-        __ vst1(Neon8, NeonListOperand(kScratchQuadReg.low(), 2),
-                NeonMemOperand(kScratchReg));
-      }
-    }
-  } else if (source->IsFPStackSlot()) {
-    DCHECK(destination->IsFPStackSlot());
-    Register temp_0 = kScratchReg;
-    LowDwVfpRegister temp_1 = kScratchDoubleReg;
-    MemOperand src0 = g.ToMemOperand(source);
-    MemOperand dst0 = g.ToMemOperand(destination);
-    MachineRepresentation rep = LocationOperand::cast(source)->representation();
-    if (rep == MachineRepresentation::kFloat64) {
-      MemOperand src1(src0.rn(), src0.offset() + kPointerSize);
-      MemOperand dst1(dst0.rn(), dst0.offset() + kPointerSize);
-      __ vldr(temp_1, dst0);  // Save destination in temp_1.
-      __ ldr(temp_0, src0);   // Then use temp_0 to copy source to destination.
-      __ str(temp_0, dst0);
-      __ ldr(temp_0, src1);
-      __ str(temp_0, dst1);
-      __ vstr(temp_1, src0);
-    } else if (rep == MachineRepresentation::kFloat32) {
-      __ vldr(temp_1.low(), dst0);  // Save destination in temp_1.
-      __ ldr(temp_0, src0);  // Then use temp_0 to copy source to destination.
-      __ str(temp_0, dst0);
-      __ vstr(temp_1.low(), src0);
-    } else {
-      DCHECK_EQ(MachineRepresentation::kSimd128, rep);
-      MemOperand src1(src0.rn(), src0.offset() + kDoubleSize);
-      MemOperand dst1(dst0.rn(), dst0.offset() + kDoubleSize);
-      __ vldr(kScratchQuadReg.low(), dst0);
-      __ vldr(kScratchQuadReg.high(), src0);
-      __ vstr(kScratchQuadReg.low(), src0);
-      __ vstr(kScratchQuadReg.high(), dst0);
-      __ vldr(kScratchQuadReg.low(), dst1);
-      __ vldr(kScratchQuadReg.high(), src1);
-      __ vstr(kScratchQuadReg.low(), src1);
-      __ vstr(kScratchQuadReg.high(), dst1);
-    }
-  } else {
-    // No other combinations are possible.
-    UNREACHABLE();
-  }
-}
-
-void CodeGenerator::AssembleJumpTable(Label** targets, size_t target_count) {
-  // On 32-bit ARM we emit the jump tables inline.
-  UNREACHABLE();
-}
-
-#undef __
-#undef kScratchReg
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/arm/instruction-codes-arm.h b/src/v8/src/compiler/arm/instruction-codes-arm.h
deleted file mode 100644
index a7cf804..0000000
--- a/src/v8/src/compiler/arm/instruction-codes-arm.h
+++ /dev/null
@@ -1,294 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_ARM_INSTRUCTION_CODES_ARM_H_
-#define V8_COMPILER_ARM_INSTRUCTION_CODES_ARM_H_
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-// ARM-specific opcodes that specify which assembly sequence to emit.
-// Most opcodes specify a single instruction.
-#define TARGET_ARCH_OPCODE_LIST(V) \
-  V(ArmAdd)                        \
-  V(ArmAnd)                        \
-  V(ArmBic)                        \
-  V(ArmClz)                        \
-  V(ArmCmp)                        \
-  V(ArmCmn)                        \
-  V(ArmTst)                        \
-  V(ArmTeq)                        \
-  V(ArmOrr)                        \
-  V(ArmEor)                        \
-  V(ArmSub)                        \
-  V(ArmRsb)                        \
-  V(ArmMul)                        \
-  V(ArmMla)                        \
-  V(ArmMls)                        \
-  V(ArmSmull)                      \
-  V(ArmSmmul)                      \
-  V(ArmSmmla)                      \
-  V(ArmUmull)                      \
-  V(ArmSdiv)                       \
-  V(ArmUdiv)                       \
-  V(ArmMov)                        \
-  V(ArmMvn)                        \
-  V(ArmBfc)                        \
-  V(ArmUbfx)                       \
-  V(ArmSbfx)                       \
-  V(ArmSxtb)                       \
-  V(ArmSxth)                       \
-  V(ArmSxtab)                      \
-  V(ArmSxtah)                      \
-  V(ArmUxtb)                       \
-  V(ArmUxth)                       \
-  V(ArmUxtab)                      \
-  V(ArmRbit)                       \
-  V(ArmUxtah)                      \
-  V(ArmAddPair)                    \
-  V(ArmSubPair)                    \
-  V(ArmMulPair)                    \
-  V(ArmLslPair)                    \
-  V(ArmLsrPair)                    \
-  V(ArmAsrPair)                    \
-  V(ArmVcmpF32)                    \
-  V(ArmVaddF32)                    \
-  V(ArmVsubF32)                    \
-  V(ArmVmulF32)                    \
-  V(ArmVmlaF32)                    \
-  V(ArmVmlsF32)                    \
-  V(ArmVdivF32)                    \
-  V(ArmVabsF32)                    \
-  V(ArmVnegF32)                    \
-  V(ArmVsqrtF32)                   \
-  V(ArmVcmpF64)                    \
-  V(ArmVaddF64)                    \
-  V(ArmVsubF64)                    \
-  V(ArmVmulF64)                    \
-  V(ArmVmlaF64)                    \
-  V(ArmVmlsF64)                    \
-  V(ArmVdivF64)                    \
-  V(ArmVmodF64)                    \
-  V(ArmVabsF64)                    \
-  V(ArmVnegF64)                    \
-  V(ArmVsqrtF64)                   \
-  V(ArmVrintmF32)                  \
-  V(ArmVrintmF64)                  \
-  V(ArmVrintpF32)                  \
-  V(ArmVrintpF64)                  \
-  V(ArmVrintzF32)                  \
-  V(ArmVrintzF64)                  \
-  V(ArmVrintaF64)                  \
-  V(ArmVrintnF32)                  \
-  V(ArmVrintnF64)                  \
-  V(ArmVcvtF32F64)                 \
-  V(ArmVcvtF64F32)                 \
-  V(ArmVcvtF32S32)                 \
-  V(ArmVcvtF32U32)                 \
-  V(ArmVcvtF64S32)                 \
-  V(ArmVcvtF64U32)                 \
-  V(ArmVcvtS32F32)                 \
-  V(ArmVcvtU32F32)                 \
-  V(ArmVcvtS32F64)                 \
-  V(ArmVcvtU32F64)                 \
-  V(ArmVmovU32F32)                 \
-  V(ArmVmovF32U32)                 \
-  V(ArmVmovLowU32F64)              \
-  V(ArmVmovLowF64U32)              \
-  V(ArmVmovHighU32F64)             \
-  V(ArmVmovHighF64U32)             \
-  V(ArmVmovF64U32U32)              \
-  V(ArmVmovU32U32F64)              \
-  V(ArmVldrF32)                    \
-  V(ArmVstrF32)                    \
-  V(ArmVldrF64)                    \
-  V(ArmVld1F64)                    \
-  V(ArmVstrF64)                    \
-  V(ArmVst1F64)                    \
-  V(ArmVld1S128)                   \
-  V(ArmVst1S128)                   \
-  V(ArmFloat32Max)                 \
-  V(ArmFloat64Max)                 \
-  V(ArmFloat32Min)                 \
-  V(ArmFloat64Min)                 \
-  V(ArmFloat64SilenceNaN)          \
-  V(ArmLdrb)                       \
-  V(ArmLdrsb)                      \
-  V(ArmStrb)                       \
-  V(ArmLdrh)                       \
-  V(ArmLdrsh)                      \
-  V(ArmStrh)                       \
-  V(ArmLdr)                        \
-  V(ArmStr)                        \
-  V(ArmPush)                       \
-  V(ArmPoke)                       \
-  V(ArmPeek)                       \
-  V(ArmF32x4Splat)                 \
-  V(ArmF32x4ExtractLane)           \
-  V(ArmF32x4ReplaceLane)           \
-  V(ArmF32x4SConvertI32x4)         \
-  V(ArmF32x4UConvertI32x4)         \
-  V(ArmF32x4Abs)                   \
-  V(ArmF32x4Neg)                   \
-  V(ArmF32x4RecipApprox)           \
-  V(ArmF32x4RecipSqrtApprox)       \
-  V(ArmF32x4Add)                   \
-  V(ArmF32x4AddHoriz)              \
-  V(ArmF32x4Sub)                   \
-  V(ArmF32x4Mul)                   \
-  V(ArmF32x4Min)                   \
-  V(ArmF32x4Max)                   \
-  V(ArmF32x4Eq)                    \
-  V(ArmF32x4Ne)                    \
-  V(ArmF32x4Lt)                    \
-  V(ArmF32x4Le)                    \
-  V(ArmI32x4Splat)                 \
-  V(ArmI32x4ExtractLane)           \
-  V(ArmI32x4ReplaceLane)           \
-  V(ArmI32x4SConvertF32x4)         \
-  V(ArmI32x4SConvertI16x8Low)      \
-  V(ArmI32x4SConvertI16x8High)     \
-  V(ArmI32x4Neg)                   \
-  V(ArmI32x4Shl)                   \
-  V(ArmI32x4ShrS)                  \
-  V(ArmI32x4Add)                   \
-  V(ArmI32x4AddHoriz)              \
-  V(ArmI32x4Sub)                   \
-  V(ArmI32x4Mul)                   \
-  V(ArmI32x4MinS)                  \
-  V(ArmI32x4MaxS)                  \
-  V(ArmI32x4Eq)                    \
-  V(ArmI32x4Ne)                    \
-  V(ArmI32x4GtS)                   \
-  V(ArmI32x4GeS)                   \
-  V(ArmI32x4UConvertF32x4)         \
-  V(ArmI32x4UConvertI16x8Low)      \
-  V(ArmI32x4UConvertI16x8High)     \
-  V(ArmI32x4ShrU)                  \
-  V(ArmI32x4MinU)                  \
-  V(ArmI32x4MaxU)                  \
-  V(ArmI32x4GtU)                   \
-  V(ArmI32x4GeU)                   \
-  V(ArmI16x8Splat)                 \
-  V(ArmI16x8ExtractLane)           \
-  V(ArmI16x8ReplaceLane)           \
-  V(ArmI16x8SConvertI8x16Low)      \
-  V(ArmI16x8SConvertI8x16High)     \
-  V(ArmI16x8Neg)                   \
-  V(ArmI16x8Shl)                   \
-  V(ArmI16x8ShrS)                  \
-  V(ArmI16x8SConvertI32x4)         \
-  V(ArmI16x8Add)                   \
-  V(ArmI16x8AddSaturateS)          \
-  V(ArmI16x8AddHoriz)              \
-  V(ArmI16x8Sub)                   \
-  V(ArmI16x8SubSaturateS)          \
-  V(ArmI16x8Mul)                   \
-  V(ArmI16x8MinS)                  \
-  V(ArmI16x8MaxS)                  \
-  V(ArmI16x8Eq)                    \
-  V(ArmI16x8Ne)                    \
-  V(ArmI16x8GtS)                   \
-  V(ArmI16x8GeS)                   \
-  V(ArmI16x8UConvertI8x16Low)      \
-  V(ArmI16x8UConvertI8x16High)     \
-  V(ArmI16x8ShrU)                  \
-  V(ArmI16x8UConvertI32x4)         \
-  V(ArmI16x8AddSaturateU)          \
-  V(ArmI16x8SubSaturateU)          \
-  V(ArmI16x8MinU)                  \
-  V(ArmI16x8MaxU)                  \
-  V(ArmI16x8GtU)                   \
-  V(ArmI16x8GeU)                   \
-  V(ArmI8x16Splat)                 \
-  V(ArmI8x16ExtractLane)           \
-  V(ArmI8x16ReplaceLane)           \
-  V(ArmI8x16Neg)                   \
-  V(ArmI8x16Shl)                   \
-  V(ArmI8x16ShrS)                  \
-  V(ArmI8x16SConvertI16x8)         \
-  V(ArmI8x16Add)                   \
-  V(ArmI8x16AddSaturateS)          \
-  V(ArmI8x16Sub)                   \
-  V(ArmI8x16SubSaturateS)          \
-  V(ArmI8x16Mul)                   \
-  V(ArmI8x16MinS)                  \
-  V(ArmI8x16MaxS)                  \
-  V(ArmI8x16Eq)                    \
-  V(ArmI8x16Ne)                    \
-  V(ArmI8x16GtS)                   \
-  V(ArmI8x16GeS)                   \
-  V(ArmI8x16ShrU)                  \
-  V(ArmI8x16UConvertI16x8)         \
-  V(ArmI8x16AddSaturateU)          \
-  V(ArmI8x16SubSaturateU)          \
-  V(ArmI8x16MinU)                  \
-  V(ArmI8x16MaxU)                  \
-  V(ArmI8x16GtU)                   \
-  V(ArmI8x16GeU)                   \
-  V(ArmS128Zero)                   \
-  V(ArmS128Dup)                    \
-  V(ArmS128And)                    \
-  V(ArmS128Or)                     \
-  V(ArmS128Xor)                    \
-  V(ArmS128Not)                    \
-  V(ArmS128Select)                 \
-  V(ArmS32x4ZipLeft)               \
-  V(ArmS32x4ZipRight)              \
-  V(ArmS32x4UnzipLeft)             \
-  V(ArmS32x4UnzipRight)            \
-  V(ArmS32x4TransposeLeft)         \
-  V(ArmS32x4TransposeRight)        \
-  V(ArmS32x4Shuffle)               \
-  V(ArmS16x8ZipLeft)               \
-  V(ArmS16x8ZipRight)              \
-  V(ArmS16x8UnzipLeft)             \
-  V(ArmS16x8UnzipRight)            \
-  V(ArmS16x8TransposeLeft)         \
-  V(ArmS16x8TransposeRight)        \
-  V(ArmS8x16ZipLeft)               \
-  V(ArmS8x16ZipRight)              \
-  V(ArmS8x16UnzipLeft)             \
-  V(ArmS8x16UnzipRight)            \
-  V(ArmS8x16TransposeLeft)         \
-  V(ArmS8x16TransposeRight)        \
-  V(ArmS8x16Concat)                \
-  V(ArmS8x16Shuffle)               \
-  V(ArmS32x2Reverse)               \
-  V(ArmS16x4Reverse)               \
-  V(ArmS16x2Reverse)               \
-  V(ArmS8x8Reverse)                \
-  V(ArmS8x4Reverse)                \
-  V(ArmS8x2Reverse)                \
-  V(ArmS1x4AnyTrue)                \
-  V(ArmS1x4AllTrue)                \
-  V(ArmS1x8AnyTrue)                \
-  V(ArmS1x8AllTrue)                \
-  V(ArmS1x16AnyTrue)               \
-  V(ArmS1x16AllTrue)
-
-// Addressing modes represent the "shape" of inputs to an instruction.
-// Many instructions support multiple addressing modes. Addressing modes
-// are encoded into the InstructionCode of the instruction and tell the
-// code generator after register allocation which assembler method to call.
-#define TARGET_ADDRESSING_MODE_LIST(V)  \
-  V(Offset_RI)        /* [%r0 + K] */   \
-  V(Offset_RR)        /* [%r0 + %r1] */ \
-  V(Operand2_I)       /* K */           \
-  V(Operand2_R)       /* %r0 */         \
-  V(Operand2_R_ASR_I) /* %r0 ASR K */   \
-  V(Operand2_R_LSL_I) /* %r0 LSL K */   \
-  V(Operand2_R_LSR_I) /* %r0 LSR K */   \
-  V(Operand2_R_ROR_I) /* %r0 ROR K */   \
-  V(Operand2_R_ASR_R) /* %r0 ASR %r1 */ \
-  V(Operand2_R_LSL_R) /* %r0 LSL %r1 */ \
-  V(Operand2_R_LSR_R) /* %r0 LSR %r1 */ \
-  V(Operand2_R_ROR_R) /* %r0 ROR %r1 */
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_COMPILER_ARM_INSTRUCTION_CODES_ARM_H_
diff --git a/src/v8/src/compiler/arm/instruction-scheduler-arm.cc b/src/v8/src/compiler/arm/instruction-scheduler-arm.cc
deleted file mode 100644
index a592515..0000000
--- a/src/v8/src/compiler/arm/instruction-scheduler-arm.cc
+++ /dev/null
@@ -1,297 +0,0 @@
-// Copyright 2015 the V8 project 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 "src/compiler/instruction-scheduler.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-bool InstructionScheduler::SchedulerSupported() { return true; }
-
-
-int InstructionScheduler::GetTargetInstructionFlags(
-    const Instruction* instr) const {
-  switch (instr->arch_opcode()) {
-    case kArmAdd:
-    case kArmAnd:
-    case kArmBic:
-    case kArmClz:
-    case kArmCmp:
-    case kArmCmn:
-    case kArmTst:
-    case kArmTeq:
-    case kArmOrr:
-    case kArmEor:
-    case kArmSub:
-    case kArmRsb:
-    case kArmMul:
-    case kArmMla:
-    case kArmMls:
-    case kArmSmmul:
-    case kArmSmull:
-    case kArmSmmla:
-    case kArmUmull:
-    case kArmSdiv:
-    case kArmUdiv:
-    case kArmMov:
-    case kArmMvn:
-    case kArmBfc:
-    case kArmUbfx:
-    case kArmSbfx:
-    case kArmSxtb:
-    case kArmSxth:
-    case kArmSxtab:
-    case kArmSxtah:
-    case kArmUxtb:
-    case kArmUxth:
-    case kArmUxtab:
-    case kArmUxtah:
-    case kArmRbit:
-    case kArmAddPair:
-    case kArmSubPair:
-    case kArmMulPair:
-    case kArmLslPair:
-    case kArmLsrPair:
-    case kArmAsrPair:
-    case kArmVcmpF32:
-    case kArmVaddF32:
-    case kArmVsubF32:
-    case kArmVmulF32:
-    case kArmVmlaF32:
-    case kArmVmlsF32:
-    case kArmVdivF32:
-    case kArmVabsF32:
-    case kArmVnegF32:
-    case kArmVsqrtF32:
-    case kArmVcmpF64:
-    case kArmVaddF64:
-    case kArmVsubF64:
-    case kArmVmulF64:
-    case kArmVmlaF64:
-    case kArmVmlsF64:
-    case kArmVdivF64:
-    case kArmVmodF64:
-    case kArmVabsF64:
-    case kArmVnegF64:
-    case kArmVsqrtF64:
-    case kArmVrintmF32:
-    case kArmVrintmF64:
-    case kArmVrintpF32:
-    case kArmVrintpF64:
-    case kArmVrintzF32:
-    case kArmVrintzF64:
-    case kArmVrintaF64:
-    case kArmVrintnF32:
-    case kArmVrintnF64:
-    case kArmVcvtF32F64:
-    case kArmVcvtF64F32:
-    case kArmVcvtF32S32:
-    case kArmVcvtF32U32:
-    case kArmVcvtF64S32:
-    case kArmVcvtF64U32:
-    case kArmVcvtS32F32:
-    case kArmVcvtU32F32:
-    case kArmVcvtS32F64:
-    case kArmVcvtU32F64:
-    case kArmVmovU32F32:
-    case kArmVmovF32U32:
-    case kArmVmovLowU32F64:
-    case kArmVmovLowF64U32:
-    case kArmVmovHighU32F64:
-    case kArmVmovHighF64U32:
-    case kArmVmovF64U32U32:
-    case kArmVmovU32U32F64:
-    case kArmFloat32Max:
-    case kArmFloat64Max:
-    case kArmFloat32Min:
-    case kArmFloat64Min:
-    case kArmFloat64SilenceNaN:
-    case kArmF32x4Splat:
-    case kArmF32x4ExtractLane:
-    case kArmF32x4ReplaceLane:
-    case kArmF32x4SConvertI32x4:
-    case kArmF32x4UConvertI32x4:
-    case kArmF32x4Abs:
-    case kArmF32x4Neg:
-    case kArmF32x4RecipApprox:
-    case kArmF32x4RecipSqrtApprox:
-    case kArmF32x4Add:
-    case kArmF32x4AddHoriz:
-    case kArmF32x4Sub:
-    case kArmF32x4Mul:
-    case kArmF32x4Min:
-    case kArmF32x4Max:
-    case kArmF32x4Eq:
-    case kArmF32x4Ne:
-    case kArmF32x4Lt:
-    case kArmF32x4Le:
-    case kArmI32x4Splat:
-    case kArmI32x4ExtractLane:
-    case kArmI32x4ReplaceLane:
-    case kArmI32x4SConvertF32x4:
-    case kArmI32x4SConvertI16x8Low:
-    case kArmI32x4SConvertI16x8High:
-    case kArmI32x4Neg:
-    case kArmI32x4Shl:
-    case kArmI32x4ShrS:
-    case kArmI32x4Add:
-    case kArmI32x4AddHoriz:
-    case kArmI32x4Sub:
-    case kArmI32x4Mul:
-    case kArmI32x4MinS:
-    case kArmI32x4MaxS:
-    case kArmI32x4Eq:
-    case kArmI32x4Ne:
-    case kArmI32x4GtS:
-    case kArmI32x4GeS:
-    case kArmI32x4UConvertF32x4:
-    case kArmI32x4UConvertI16x8Low:
-    case kArmI32x4UConvertI16x8High:
-    case kArmI32x4ShrU:
-    case kArmI32x4MinU:
-    case kArmI32x4MaxU:
-    case kArmI32x4GtU:
-    case kArmI32x4GeU:
-    case kArmI16x8Splat:
-    case kArmI16x8ExtractLane:
-    case kArmI16x8ReplaceLane:
-    case kArmI16x8SConvertI8x16Low:
-    case kArmI16x8SConvertI8x16High:
-    case kArmI16x8Neg:
-    case kArmI16x8Shl:
-    case kArmI16x8ShrS:
-    case kArmI16x8SConvertI32x4:
-    case kArmI16x8Add:
-    case kArmI16x8AddSaturateS:
-    case kArmI16x8AddHoriz:
-    case kArmI16x8Sub:
-    case kArmI16x8SubSaturateS:
-    case kArmI16x8Mul:
-    case kArmI16x8MinS:
-    case kArmI16x8MaxS:
-    case kArmI16x8Eq:
-    case kArmI16x8Ne:
-    case kArmI16x8GtS:
-    case kArmI16x8GeS:
-    case kArmI16x8UConvertI8x16Low:
-    case kArmI16x8UConvertI8x16High:
-    case kArmI16x8ShrU:
-    case kArmI16x8UConvertI32x4:
-    case kArmI16x8AddSaturateU:
-    case kArmI16x8SubSaturateU:
-    case kArmI16x8MinU:
-    case kArmI16x8MaxU:
-    case kArmI16x8GtU:
-    case kArmI16x8GeU:
-    case kArmI8x16Splat:
-    case kArmI8x16ExtractLane:
-    case kArmI8x16ReplaceLane:
-    case kArmI8x16Neg:
-    case kArmI8x16Shl:
-    case kArmI8x16ShrS:
-    case kArmI8x16SConvertI16x8:
-    case kArmI8x16Add:
-    case kArmI8x16AddSaturateS:
-    case kArmI8x16Sub:
-    case kArmI8x16SubSaturateS:
-    case kArmI8x16Mul:
-    case kArmI8x16MinS:
-    case kArmI8x16MaxS:
-    case kArmI8x16Eq:
-    case kArmI8x16Ne:
-    case kArmI8x16GtS:
-    case kArmI8x16GeS:
-    case kArmI8x16UConvertI16x8:
-    case kArmI8x16AddSaturateU:
-    case kArmI8x16SubSaturateU:
-    case kArmI8x16ShrU:
-    case kArmI8x16MinU:
-    case kArmI8x16MaxU:
-    case kArmI8x16GtU:
-    case kArmI8x16GeU:
-    case kArmS128Zero:
-    case kArmS128Dup:
-    case kArmS128And:
-    case kArmS128Or:
-    case kArmS128Xor:
-    case kArmS128Not:
-    case kArmS128Select:
-    case kArmS32x4ZipLeft:
-    case kArmS32x4ZipRight:
-    case kArmS32x4UnzipLeft:
-    case kArmS32x4UnzipRight:
-    case kArmS32x4TransposeLeft:
-    case kArmS32x4TransposeRight:
-    case kArmS32x4Shuffle:
-    case kArmS16x8ZipLeft:
-    case kArmS16x8ZipRight:
-    case kArmS16x8UnzipLeft:
-    case kArmS16x8UnzipRight:
-    case kArmS16x8TransposeLeft:
-    case kArmS16x8TransposeRight:
-    case kArmS8x16ZipLeft:
-    case kArmS8x16ZipRight:
-    case kArmS8x16UnzipLeft:
-    case kArmS8x16UnzipRight:
-    case kArmS8x16TransposeLeft:
-    case kArmS8x16TransposeRight:
-    case kArmS8x16Concat:
-    case kArmS8x16Shuffle:
-    case kArmS32x2Reverse:
-    case kArmS16x4Reverse:
-    case kArmS16x2Reverse:
-    case kArmS8x8Reverse:
-    case kArmS8x4Reverse:
-    case kArmS8x2Reverse:
-    case kArmS1x4AnyTrue:
-    case kArmS1x4AllTrue:
-    case kArmS1x8AnyTrue:
-    case kArmS1x8AllTrue:
-    case kArmS1x16AnyTrue:
-    case kArmS1x16AllTrue:
-      return kNoOpcodeFlags;
-
-    case kArmVldrF32:
-    case kArmVldrF64:
-    case kArmVld1F64:
-    case kArmVld1S128:
-    case kArmLdrb:
-    case kArmLdrsb:
-    case kArmLdrh:
-    case kArmLdrsh:
-    case kArmLdr:
-    case kArmPeek:
-      return kIsLoadOperation;
-
-    case kArmVstrF32:
-    case kArmVstrF64:
-    case kArmVst1F64:
-    case kArmVst1S128:
-    case kArmStrb:
-    case kArmStrh:
-    case kArmStr:
-    case kArmPush:
-    case kArmPoke:
-      return kHasSideEffect;
-
-#define CASE(Name) case k##Name:
-    COMMON_ARCH_OPCODE_LIST(CASE)
-#undef CASE
-      // Already covered in architecture independent code.
-      UNREACHABLE();
-  }
-
-  UNREACHABLE();
-}
-
-
-int InstructionScheduler::GetInstructionLatency(const Instruction* instr) {
-  // TODO(all): Add instruction cost modeling.
-  return 1;
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/arm/instruction-selector-arm.cc b/src/v8/src/compiler/arm/instruction-selector-arm.cc
deleted file mode 100644
index f94d114..0000000
--- a/src/v8/src/compiler/arm/instruction-selector-arm.cc
+++ /dev/null
@@ -1,2681 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/base/adapters.h"
-#include "src/base/bits.h"
-#include "src/compiler/instruction-selector-impl.h"
-#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-// Adds Arm-specific methods for generating InstructionOperands.
-class ArmOperandGenerator : public OperandGenerator {
- public:
-  explicit ArmOperandGenerator(InstructionSelector* selector)
-      : OperandGenerator(selector) {}
-
-  bool CanBeImmediate(int32_t value) const {
-    return Assembler::ImmediateFitsAddrMode1Instruction(value);
-  }
-
-  bool CanBeImmediate(uint32_t value) const {
-    return CanBeImmediate(bit_cast<int32_t>(value));
-  }
-
-  bool CanBeImmediate(Node* node, InstructionCode opcode) {
-    Int32Matcher m(node);
-    if (!m.HasValue()) return false;
-    int32_t value = m.Value();
-    switch (ArchOpcodeField::decode(opcode)) {
-      case kArmAnd:
-      case kArmMov:
-      case kArmMvn:
-      case kArmBic:
-        return CanBeImmediate(value) || CanBeImmediate(~value);
-
-      case kArmAdd:
-      case kArmSub:
-      case kArmCmp:
-      case kArmCmn:
-        return CanBeImmediate(value) || CanBeImmediate(-value);
-
-      case kArmTst:
-      case kArmTeq:
-      case kArmOrr:
-      case kArmEor:
-      case kArmRsb:
-        return CanBeImmediate(value);
-
-      case kArmVldrF32:
-      case kArmVstrF32:
-      case kArmVldrF64:
-      case kArmVstrF64:
-        return value >= -1020 && value <= 1020 && (value % 4) == 0;
-
-      case kArmLdrb:
-      case kArmLdrsb:
-      case kArmStrb:
-      case kArmLdr:
-      case kArmStr:
-        return value >= -4095 && value <= 4095;
-
-      case kArmLdrh:
-      case kArmLdrsh:
-      case kArmStrh:
-        return value >= -255 && value <= 255;
-
-      default:
-        break;
-    }
-    return false;
-  }
-};
-
-
-namespace {
-
-void VisitRR(InstructionSelector* selector, ArchOpcode opcode, Node* node) {
-  ArmOperandGenerator g(selector);
-  selector->Emit(opcode, g.DefineAsRegister(node),
-                 g.UseRegister(node->InputAt(0)));
-}
-
-void VisitRRR(InstructionSelector* selector, ArchOpcode opcode, Node* node) {
-  ArmOperandGenerator g(selector);
-  selector->Emit(opcode, g.DefineAsRegister(node),
-                 g.UseRegister(node->InputAt(0)),
-                 g.UseRegister(node->InputAt(1)));
-}
-
-void VisitRRRShuffle(InstructionSelector* selector, ArchOpcode opcode,
-                     Node* node) {
-  ArmOperandGenerator g(selector);
-  // Swap inputs to save an instruction in the CodeGenerator for High ops.
-  if (opcode == kArmS32x4ZipRight || opcode == kArmS32x4UnzipRight ||
-      opcode == kArmS32x4TransposeRight || opcode == kArmS16x8ZipRight ||
-      opcode == kArmS16x8UnzipRight || opcode == kArmS16x8TransposeRight ||
-      opcode == kArmS8x16ZipRight || opcode == kArmS8x16UnzipRight ||
-      opcode == kArmS8x16TransposeRight) {
-    Node* in0 = node->InputAt(0);
-    Node* in1 = node->InputAt(1);
-    node->ReplaceInput(0, in1);
-    node->ReplaceInput(1, in0);
-  }
-  // Use DefineSameAsFirst for binary ops that clobber their inputs, e.g. the
-  // NEON vzip, vuzp, and vtrn instructions.
-  selector->Emit(opcode, g.DefineSameAsFirst(node),
-                 g.UseRegister(node->InputAt(0)),
-                 g.UseRegister(node->InputAt(1)));
-}
-
-void VisitRRI(InstructionSelector* selector, ArchOpcode opcode, Node* node) {
-  ArmOperandGenerator g(selector);
-  int32_t imm = OpParameter<int32_t>(node);
-  selector->Emit(opcode, g.DefineAsRegister(node),
-                 g.UseRegister(node->InputAt(0)), g.UseImmediate(imm));
-}
-
-void VisitRRIR(InstructionSelector* selector, ArchOpcode opcode, Node* node) {
-  ArmOperandGenerator g(selector);
-  int32_t imm = OpParameter<int32_t>(node);
-  selector->Emit(opcode, g.DefineAsRegister(node),
-                 g.UseRegister(node->InputAt(0)), g.UseImmediate(imm),
-                 g.UseRegister(node->InputAt(1)));
-}
-
-template <IrOpcode::Value kOpcode, int kImmMin, int kImmMax,
-          AddressingMode kImmMode, AddressingMode kRegMode>
-bool TryMatchShift(InstructionSelector* selector,
-                   InstructionCode* opcode_return, Node* node,
-                   InstructionOperand* value_return,
-                   InstructionOperand* shift_return) {
-  ArmOperandGenerator g(selector);
-  if (node->opcode() == kOpcode) {
-    Int32BinopMatcher m(node);
-    *value_return = g.UseRegister(m.left().node());
-    if (m.right().IsInRange(kImmMin, kImmMax)) {
-      *opcode_return |= AddressingModeField::encode(kImmMode);
-      *shift_return = g.UseImmediate(m.right().node());
-    } else {
-      *opcode_return |= AddressingModeField::encode(kRegMode);
-      *shift_return = g.UseRegister(m.right().node());
-    }
-    return true;
-  }
-  return false;
-}
-
-template <IrOpcode::Value kOpcode, int kImmMin, int kImmMax,
-          AddressingMode kImmMode>
-bool TryMatchShiftImmediate(InstructionSelector* selector,
-                            InstructionCode* opcode_return, Node* node,
-                            InstructionOperand* value_return,
-                            InstructionOperand* shift_return) {
-  ArmOperandGenerator g(selector);
-  if (node->opcode() == kOpcode) {
-    Int32BinopMatcher m(node);
-    if (m.right().IsInRange(kImmMin, kImmMax)) {
-      *opcode_return |= AddressingModeField::encode(kImmMode);
-      *value_return = g.UseRegister(m.left().node());
-      *shift_return = g.UseImmediate(m.right().node());
-      return true;
-    }
-  }
-  return false;
-}
-
-bool TryMatchROR(InstructionSelector* selector, InstructionCode* opcode_return,
-                 Node* node, InstructionOperand* value_return,
-                 InstructionOperand* shift_return) {
-  return TryMatchShift<IrOpcode::kWord32Ror, 1, 31, kMode_Operand2_R_ROR_I,
-                       kMode_Operand2_R_ROR_R>(selector, opcode_return, node,
-                                               value_return, shift_return);
-}
-
-
-bool TryMatchASR(InstructionSelector* selector, InstructionCode* opcode_return,
-                 Node* node, InstructionOperand* value_return,
-                 InstructionOperand* shift_return) {
-  return TryMatchShift<IrOpcode::kWord32Sar, 1, 32, kMode_Operand2_R_ASR_I,
-                       kMode_Operand2_R_ASR_R>(selector, opcode_return, node,
-                                               value_return, shift_return);
-}
-
-
-bool TryMatchLSL(InstructionSelector* selector, InstructionCode* opcode_return,
-                 Node* node, InstructionOperand* value_return,
-                 InstructionOperand* shift_return) {
-  return TryMatchShift<IrOpcode::kWord32Shl, 0, 31, kMode_Operand2_R_LSL_I,
-                       kMode_Operand2_R_LSL_R>(selector, opcode_return, node,
-                                               value_return, shift_return);
-}
-
-bool TryMatchLSLImmediate(InstructionSelector* selector,
-                          InstructionCode* opcode_return, Node* node,
-                          InstructionOperand* value_return,
-                          InstructionOperand* shift_return) {
-  return TryMatchShiftImmediate<IrOpcode::kWord32Shl, 0, 31,
-                                kMode_Operand2_R_LSL_I>(
-      selector, opcode_return, node, value_return, shift_return);
-}
-
-bool TryMatchLSR(InstructionSelector* selector, InstructionCode* opcode_return,
-                 Node* node, InstructionOperand* value_return,
-                 InstructionOperand* shift_return) {
-  return TryMatchShift<IrOpcode::kWord32Shr, 1, 32, kMode_Operand2_R_LSR_I,
-                       kMode_Operand2_R_LSR_R>(selector, opcode_return, node,
-                                               value_return, shift_return);
-}
-
-
-bool TryMatchShift(InstructionSelector* selector,
-                   InstructionCode* opcode_return, Node* node,
-                   InstructionOperand* value_return,
-                   InstructionOperand* shift_return) {
-  return (
-      TryMatchASR(selector, opcode_return, node, value_return, shift_return) ||
-      TryMatchLSL(selector, opcode_return, node, value_return, shift_return) ||
-      TryMatchLSR(selector, opcode_return, node, value_return, shift_return) ||
-      TryMatchROR(selector, opcode_return, node, value_return, shift_return));
-}
-
-
-bool TryMatchImmediateOrShift(InstructionSelector* selector,
-                              InstructionCode* opcode_return, Node* node,
-                              size_t* input_count_return,
-                              InstructionOperand* inputs) {
-  ArmOperandGenerator g(selector);
-  if (g.CanBeImmediate(node, *opcode_return)) {
-    *opcode_return |= AddressingModeField::encode(kMode_Operand2_I);
-    inputs[0] = g.UseImmediate(node);
-    *input_count_return = 1;
-    return true;
-  }
-  if (TryMatchShift(selector, opcode_return, node, &inputs[0], &inputs[1])) {
-    *input_count_return = 2;
-    return true;
-  }
-  return false;
-}
-
-
-void VisitBinop(InstructionSelector* selector, Node* node,
-                InstructionCode opcode, InstructionCode reverse_opcode,
-                FlagsContinuation* cont) {
-  ArmOperandGenerator g(selector);
-  Int32BinopMatcher m(node);
-  InstructionOperand inputs[5];
-  size_t input_count = 0;
-  InstructionOperand outputs[2];
-  size_t output_count = 0;
-
-  if (m.left().node() == m.right().node()) {
-    // If both inputs refer to the same operand, enforce allocating a register
-    // for both of them to ensure that we don't end up generating code like
-    // this:
-    //
-    //   mov r0, r1, asr #16
-    //   adds r0, r0, r1, asr #16
-    //   bvs label
-    InstructionOperand const input = g.UseRegister(m.left().node());
-    opcode |= AddressingModeField::encode(kMode_Operand2_R);
-    inputs[input_count++] = input;
-    inputs[input_count++] = input;
-  } else if (TryMatchImmediateOrShift(selector, &opcode, m.right().node(),
-                                      &input_count, &inputs[1])) {
-    inputs[0] = g.UseRegister(m.left().node());
-    input_count++;
-  } else if (TryMatchImmediateOrShift(selector, &reverse_opcode,
-                                      m.left().node(), &input_count,
-                                      &inputs[1])) {
-    inputs[0] = g.UseRegister(m.right().node());
-    opcode = reverse_opcode;
-    input_count++;
-  } else {
-    opcode |= AddressingModeField::encode(kMode_Operand2_R);
-    inputs[input_count++] = g.UseRegister(m.left().node());
-    inputs[input_count++] = g.UseRegister(m.right().node());
-  }
-
-  if (cont->IsBranch()) {
-    inputs[input_count++] = g.Label(cont->true_block());
-    inputs[input_count++] = g.Label(cont->false_block());
-  }
-
-  outputs[output_count++] = g.DefineAsRegister(node);
-  if (cont->IsSet()) {
-    outputs[output_count++] = g.DefineAsRegister(cont->result());
-  }
-
-  DCHECK_NE(0u, input_count);
-  DCHECK_NE(0u, output_count);
-  DCHECK_GE(arraysize(inputs), input_count);
-  DCHECK_GE(arraysize(outputs), output_count);
-  DCHECK_NE(kMode_None, AddressingModeField::decode(opcode));
-
-  opcode = cont->Encode(opcode);
-  if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(opcode, output_count, outputs, input_count, inputs,
-                             cont->kind(), cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else if (cont->IsTrap()) {
-    inputs[input_count++] = g.UseImmediate(cont->trap_id());
-    selector->Emit(opcode, output_count, outputs, input_count, inputs);
-  } else {
-    selector->Emit(opcode, output_count, outputs, input_count, inputs);
-  }
-}
-
-
-void VisitBinop(InstructionSelector* selector, Node* node,
-                InstructionCode opcode, InstructionCode reverse_opcode) {
-  FlagsContinuation cont;
-  VisitBinop(selector, node, opcode, reverse_opcode, &cont);
-}
-
-
-void EmitDiv(InstructionSelector* selector, ArchOpcode div_opcode,
-             ArchOpcode f64i32_opcode, ArchOpcode i32f64_opcode,
-             InstructionOperand result_operand, InstructionOperand left_operand,
-             InstructionOperand right_operand) {
-  ArmOperandGenerator g(selector);
-  if (selector->IsSupported(SUDIV)) {
-    selector->Emit(div_opcode, result_operand, left_operand, right_operand);
-    return;
-  }
-  InstructionOperand left_double_operand = g.TempDoubleRegister();
-  InstructionOperand right_double_operand = g.TempDoubleRegister();
-  InstructionOperand result_double_operand = g.TempDoubleRegister();
-  selector->Emit(f64i32_opcode, left_double_operand, left_operand);
-  selector->Emit(f64i32_opcode, right_double_operand, right_operand);
-  selector->Emit(kArmVdivF64, result_double_operand, left_double_operand,
-                 right_double_operand);
-  selector->Emit(i32f64_opcode, result_operand, result_double_operand);
-}
-
-
-void VisitDiv(InstructionSelector* selector, Node* node, ArchOpcode div_opcode,
-              ArchOpcode f64i32_opcode, ArchOpcode i32f64_opcode) {
-  ArmOperandGenerator g(selector);
-  Int32BinopMatcher m(node);
-  EmitDiv(selector, div_opcode, f64i32_opcode, i32f64_opcode,
-          g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-          g.UseRegister(m.right().node()));
-}
-
-
-void VisitMod(InstructionSelector* selector, Node* node, ArchOpcode div_opcode,
-              ArchOpcode f64i32_opcode, ArchOpcode i32f64_opcode) {
-  ArmOperandGenerator g(selector);
-  Int32BinopMatcher m(node);
-  InstructionOperand div_operand = g.TempRegister();
-  InstructionOperand result_operand = g.DefineAsRegister(node);
-  InstructionOperand left_operand = g.UseRegister(m.left().node());
-  InstructionOperand right_operand = g.UseRegister(m.right().node());
-  EmitDiv(selector, div_opcode, f64i32_opcode, i32f64_opcode, div_operand,
-          left_operand, right_operand);
-  if (selector->IsSupported(ARMv7)) {
-    selector->Emit(kArmMls, result_operand, div_operand, right_operand,
-                   left_operand);
-  } else {
-    InstructionOperand mul_operand = g.TempRegister();
-    selector->Emit(kArmMul, mul_operand, div_operand, right_operand);
-    selector->Emit(kArmSub | AddressingModeField::encode(kMode_Operand2_R),
-                   result_operand, left_operand, mul_operand);
-  }
-}
-
-void EmitLoad(InstructionSelector* selector, InstructionCode opcode,
-              InstructionOperand* output, Node* base, Node* index) {
-  ArmOperandGenerator g(selector);
-  InstructionOperand inputs[3];
-  size_t input_count = 2;
-
-  inputs[0] = g.UseRegister(base);
-  if (g.CanBeImmediate(index, opcode)) {
-    inputs[1] = g.UseImmediate(index);
-    opcode |= AddressingModeField::encode(kMode_Offset_RI);
-  } else if ((opcode == kArmLdr) &&
-             TryMatchLSLImmediate(selector, &opcode, index, &inputs[1],
-                                  &inputs[2])) {
-    input_count = 3;
-  } else {
-    inputs[1] = g.UseRegister(index);
-    opcode |= AddressingModeField::encode(kMode_Offset_RR);
-  }
-  selector->Emit(opcode, 1, output, input_count, inputs);
-}
-
-void EmitStore(InstructionSelector* selector, InstructionCode opcode,
-               size_t input_count, InstructionOperand* inputs,
-               Node* index) {
-  ArmOperandGenerator g(selector);
-
-  if (g.CanBeImmediate(index, opcode)) {
-    inputs[input_count++] = g.UseImmediate(index);
-    opcode |= AddressingModeField::encode(kMode_Offset_RI);
-  } else if ((opcode == kArmStr) &&
-             TryMatchLSLImmediate(selector, &opcode, index, &inputs[2],
-                                  &inputs[3])) {
-    input_count = 4;
-  } else {
-    inputs[input_count++] = g.UseRegister(index);
-    opcode |= AddressingModeField::encode(kMode_Offset_RR);
-  }
-  selector->Emit(opcode, 0, nullptr, input_count, inputs);
-}
-
-}  // namespace
-
-void InstructionSelector::VisitStackSlot(Node* node) {
-  StackSlotRepresentation rep = StackSlotRepresentationOf(node->op());
-  int slot = frame_->AllocateSpillSlot(rep.size());
-  OperandGenerator g(this);
-
-  Emit(kArchStackSlot, g.DefineAsRegister(node),
-       sequence()->AddImmediate(Constant(slot)), 0, nullptr);
-}
-
-void InstructionSelector::VisitDebugAbort(Node* node) {
-  ArmOperandGenerator g(this);
-  Emit(kArchDebugAbort, g.NoOutput(), g.UseFixed(node->InputAt(0), r1));
-}
-
-void InstructionSelector::VisitLoad(Node* node) {
-  LoadRepresentation load_rep = LoadRepresentationOf(node->op());
-  ArmOperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-
-  InstructionCode opcode = kArchNop;
-  switch (load_rep.representation()) {
-    case MachineRepresentation::kFloat32:
-      opcode = kArmVldrF32;
-      break;
-    case MachineRepresentation::kFloat64:
-      opcode = kArmVldrF64;
-      break;
-    case MachineRepresentation::kBit:  // Fall through.
-    case MachineRepresentation::kWord8:
-      opcode = load_rep.IsUnsigned() ? kArmLdrb : kArmLdrsb;
-      break;
-    case MachineRepresentation::kWord16:
-      opcode = load_rep.IsUnsigned() ? kArmLdrh : kArmLdrsh;
-      break;
-    case MachineRepresentation::kTaggedSigned:   // Fall through.
-    case MachineRepresentation::kTaggedPointer:  // Fall through.
-    case MachineRepresentation::kTagged:  // Fall through.
-    case MachineRepresentation::kWord32:
-      opcode = kArmLdr;
-      break;
-    case MachineRepresentation::kSimd128:
-      opcode = kArmVld1S128;
-      break;
-    case MachineRepresentation::kWord64:   // Fall through.
-    case MachineRepresentation::kNone:
-      UNREACHABLE();
-      return;
-  }
-
-  InstructionOperand output = g.DefineAsRegister(node);
-  EmitLoad(this, opcode, &output, base, index);
-}
-
-void InstructionSelector::VisitProtectedLoad(Node* node) {
-  // TODO(eholk)
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitStore(Node* node) {
-  ArmOperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-
-  StoreRepresentation store_rep = StoreRepresentationOf(node->op());
-  WriteBarrierKind write_barrier_kind = store_rep.write_barrier_kind();
-  MachineRepresentation rep = store_rep.representation();
-
-  if (write_barrier_kind != kNoWriteBarrier) {
-    DCHECK(CanBeTaggedPointer(rep));
-    AddressingMode addressing_mode;
-    InstructionOperand inputs[3];
-    size_t input_count = 0;
-    inputs[input_count++] = g.UseUniqueRegister(base);
-    // OutOfLineRecordWrite uses the index in an 'add' instruction as well as
-    // for the store itself, so we must check compatibility with both.
-    if (g.CanBeImmediate(index, kArmAdd) && g.CanBeImmediate(index, kArmStr)) {
-      inputs[input_count++] = g.UseImmediate(index);
-      addressing_mode = kMode_Offset_RI;
-    } else {
-      inputs[input_count++] = g.UseUniqueRegister(index);
-      addressing_mode = kMode_Offset_RR;
-    }
-    inputs[input_count++] = g.UseUniqueRegister(value);
-    RecordWriteMode record_write_mode = RecordWriteMode::kValueIsAny;
-    switch (write_barrier_kind) {
-      case kNoWriteBarrier:
-        UNREACHABLE();
-        break;
-      case kMapWriteBarrier:
-        record_write_mode = RecordWriteMode::kValueIsMap;
-        break;
-      case kPointerWriteBarrier:
-        record_write_mode = RecordWriteMode::kValueIsPointer;
-        break;
-      case kFullWriteBarrier:
-        record_write_mode = RecordWriteMode::kValueIsAny;
-        break;
-    }
-    InstructionOperand temps[] = {g.TempRegister(), g.TempRegister()};
-    size_t const temp_count = arraysize(temps);
-    InstructionCode code = kArchStoreWithWriteBarrier;
-    code |= AddressingModeField::encode(addressing_mode);
-    code |= MiscField::encode(static_cast<int>(record_write_mode));
-    Emit(code, 0, nullptr, input_count, inputs, temp_count, temps);
-  } else {
-    InstructionCode opcode = kArchNop;
-    switch (rep) {
-      case MachineRepresentation::kFloat32:
-        opcode = kArmVstrF32;
-        break;
-      case MachineRepresentation::kFloat64:
-        opcode = kArmVstrF64;
-        break;
-      case MachineRepresentation::kBit:  // Fall through.
-      case MachineRepresentation::kWord8:
-        opcode = kArmStrb;
-        break;
-      case MachineRepresentation::kWord16:
-        opcode = kArmStrh;
-        break;
-      case MachineRepresentation::kTaggedSigned:   // Fall through.
-      case MachineRepresentation::kTaggedPointer:  // Fall through.
-      case MachineRepresentation::kTagged:  // Fall through.
-      case MachineRepresentation::kWord32:
-        opcode = kArmStr;
-        break;
-      case MachineRepresentation::kSimd128:
-        opcode = kArmVst1S128;
-        break;
-      case MachineRepresentation::kWord64:   // Fall through.
-      case MachineRepresentation::kNone:
-        UNREACHABLE();
-        return;
-    }
-
-    InstructionOperand inputs[4];
-    size_t input_count = 0;
-    inputs[input_count++] = g.UseRegister(value);
-    inputs[input_count++] = g.UseRegister(base);
-    EmitStore(this, opcode, input_count, inputs, index);
-  }
-}
-
-void InstructionSelector::VisitProtectedStore(Node* node) {
-  // TODO(eholk)
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitUnalignedLoad(Node* node) {
-  MachineRepresentation load_rep =
-      UnalignedLoadRepresentationOf(node->op()).representation();
-  ArmOperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-
-  InstructionCode opcode = kArmLdr;
-  // Only floating point loads need to be specially handled; integer loads
-  // support unaligned access. We support unaligned FP loads by loading to
-  // integer registers first, then moving to the destination FP register. If
-  // NEON is supported, we use the vld1.8 instruction.
-  switch (load_rep) {
-    case MachineRepresentation::kFloat32: {
-      InstructionOperand temp = g.TempRegister();
-      EmitLoad(this, opcode, &temp, base, index);
-      Emit(kArmVmovF32U32, g.DefineAsRegister(node), temp);
-      return;
-    }
-    case MachineRepresentation::kFloat64:
-    case MachineRepresentation::kSimd128: {
-      // Compute the address of the least-significant byte of the FP value.
-      // We assume that the base node is unlikely to be an encodable immediate
-      // or the result of a shift operation, so only consider the addressing
-      // mode that should be used for the index node.
-      InstructionCode add_opcode = kArmAdd;
-      InstructionOperand inputs[3];
-      inputs[0] = g.UseRegister(base);
-
-      size_t input_count;
-      if (TryMatchImmediateOrShift(this, &add_opcode, index, &input_count,
-                                   &inputs[1])) {
-        // input_count has been set by TryMatchImmediateOrShift(), so
-        // increment it to account for the base register in inputs[0].
-        input_count++;
-      } else {
-        add_opcode |= AddressingModeField::encode(kMode_Operand2_R);
-        inputs[1] = g.UseRegister(index);
-        input_count = 2;  // Base register and index.
-      }
-
-      InstructionOperand addr = g.TempRegister();
-      Emit(add_opcode, 1, &addr, input_count, inputs);
-
-      if (CpuFeatures::IsSupported(NEON)) {
-        // With NEON we can load directly from the calculated address.
-        InstructionCode op = load_rep == MachineRepresentation::kFloat64
-                                 ? kArmVld1F64
-                                 : kArmVld1S128;
-        op |= AddressingModeField::encode(kMode_Operand2_R);
-        Emit(op, g.DefineAsRegister(node), addr);
-      } else {
-        DCHECK_NE(MachineRepresentation::kSimd128, load_rep);
-        // Load both halves and move to an FP register.
-        InstructionOperand fp_lo = g.TempRegister();
-        InstructionOperand fp_hi = g.TempRegister();
-        opcode |= AddressingModeField::encode(kMode_Offset_RI);
-        Emit(opcode, fp_lo, addr, g.TempImmediate(0));
-        Emit(opcode, fp_hi, addr, g.TempImmediate(4));
-        Emit(kArmVmovF64U32U32, g.DefineAsRegister(node), fp_lo, fp_hi);
-      }
-      return;
-    }
-    default:
-      // All other cases should support unaligned accesses.
-      UNREACHABLE();
-      return;
-  }
-}
-
-void InstructionSelector::VisitUnalignedStore(Node* node) {
-  ArmOperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-
-  InstructionOperand inputs[4];
-  size_t input_count = 0;
-
-  UnalignedStoreRepresentation store_rep =
-      UnalignedStoreRepresentationOf(node->op());
-
-  // Only floating point stores need to be specially handled; integer stores
-  // support unaligned access. We support unaligned FP stores by moving the
-  // value to integer registers first, then storing to the destination address.
-  // If NEON is supported, we use the vst1.8 instruction.
-  switch (store_rep) {
-    case MachineRepresentation::kFloat32: {
-      inputs[input_count++] = g.TempRegister();
-      Emit(kArmVmovU32F32, inputs[0], g.UseRegister(value));
-      inputs[input_count++] = g.UseRegister(base);
-      EmitStore(this, kArmStr, input_count, inputs, index);
-      return;
-    }
-    case MachineRepresentation::kFloat64:
-    case MachineRepresentation::kSimd128: {
-      if (CpuFeatures::IsSupported(NEON)) {
-        InstructionOperand address = g.TempRegister();
-        {
-          // First we have to calculate the actual address.
-          InstructionCode add_opcode = kArmAdd;
-          InstructionOperand inputs[3];
-          inputs[0] = g.UseRegister(base);
-
-          size_t input_count;
-          if (TryMatchImmediateOrShift(this, &add_opcode, index, &input_count,
-                                       &inputs[1])) {
-            // input_count has been set by TryMatchImmediateOrShift(), so
-            // increment it to account for the base register in inputs[0].
-            input_count++;
-          } else {
-            add_opcode |= AddressingModeField::encode(kMode_Operand2_R);
-            inputs[1] = g.UseRegister(index);
-            input_count = 2;  // Base register and index.
-          }
-
-          Emit(add_opcode, 1, &address, input_count, inputs);
-        }
-
-        inputs[input_count++] = g.UseRegister(value);
-        inputs[input_count++] = address;
-        InstructionCode op = store_rep == MachineRepresentation::kFloat64
-                                 ? kArmVst1F64
-                                 : kArmVst1S128;
-        op |= AddressingModeField::encode(kMode_Operand2_R);
-        Emit(op, 0, nullptr, input_count, inputs);
-      } else {
-        DCHECK_NE(MachineRepresentation::kSimd128, store_rep);
-        // Store a 64-bit floating point value using two 32-bit integer stores.
-        // Computing the store address here would require three live temporary
-        // registers (fp<63:32>, fp<31:0>, address), so compute base + 4 after
-        // storing the least-significant half of the value.
-
-        // First, move the 64-bit FP value into two temporary integer registers.
-        InstructionOperand fp[] = {g.TempRegister(), g.TempRegister()};
-        inputs[input_count++] = g.UseRegister(value);
-        Emit(kArmVmovU32U32F64, arraysize(fp), fp, input_count, inputs);
-
-        // Store the least-significant half.
-        inputs[0] = fp[0];  // Low 32-bits of FP value.
-        inputs[input_count++] =
-            g.UseRegister(base);  // First store base address.
-        EmitStore(this, kArmStr, input_count, inputs, index);
-
-        // Store the most-significant half.
-        InstructionOperand base4 = g.TempRegister();
-        Emit(kArmAdd | AddressingModeField::encode(kMode_Operand2_I), base4,
-             g.UseRegister(base), g.TempImmediate(4));  // Compute base + 4.
-        inputs[0] = fp[1];  // High 32-bits of FP value.
-        inputs[1] = base4;  // Second store base + 4 address.
-        EmitStore(this, kArmStr, input_count, inputs, index);
-      }
-      return;
-    }
-    default:
-      // All other cases should support unaligned accesses.
-      UNREACHABLE();
-      return;
-  }
-}
-
-namespace {
-
-void EmitBic(InstructionSelector* selector, Node* node, Node* left,
-             Node* right) {
-  ArmOperandGenerator g(selector);
-  InstructionCode opcode = kArmBic;
-  InstructionOperand value_operand;
-  InstructionOperand shift_operand;
-  if (TryMatchShift(selector, &opcode, right, &value_operand, &shift_operand)) {
-    selector->Emit(opcode, g.DefineAsRegister(node), g.UseRegister(left),
-                   value_operand, shift_operand);
-    return;
-  }
-  selector->Emit(opcode | AddressingModeField::encode(kMode_Operand2_R),
-                 g.DefineAsRegister(node), g.UseRegister(left),
-                 g.UseRegister(right));
-}
-
-
-void EmitUbfx(InstructionSelector* selector, Node* node, Node* left,
-              uint32_t lsb, uint32_t width) {
-  DCHECK_LE(1u, width);
-  DCHECK_LE(width, 32u - lsb);
-  ArmOperandGenerator g(selector);
-  selector->Emit(kArmUbfx, g.DefineAsRegister(node), g.UseRegister(left),
-                 g.TempImmediate(lsb), g.TempImmediate(width));
-}
-
-}  // namespace
-
-
-void InstructionSelector::VisitWord32And(Node* node) {
-  ArmOperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  if (m.left().IsWord32Xor() && CanCover(node, m.left().node())) {
-    Int32BinopMatcher mleft(m.left().node());
-    if (mleft.right().Is(-1)) {
-      EmitBic(this, node, m.right().node(), mleft.left().node());
-      return;
-    }
-  }
-  if (m.right().IsWord32Xor() && CanCover(node, m.right().node())) {
-    Int32BinopMatcher mright(m.right().node());
-    if (mright.right().Is(-1)) {
-      EmitBic(this, node, m.left().node(), mright.left().node());
-      return;
-    }
-  }
-  if (m.right().HasValue()) {
-    uint32_t const value = m.right().Value();
-    uint32_t width = base::bits::CountPopulation(value);
-    uint32_t leading_zeros = base::bits::CountLeadingZeros32(value);
-
-    // Try to merge SHR operations on the left hand input into this AND.
-    if (m.left().IsWord32Shr()) {
-      Int32BinopMatcher mshr(m.left().node());
-      if (mshr.right().HasValue()) {
-        uint32_t const shift = mshr.right().Value();
-
-        if (((shift == 8) || (shift == 16) || (shift == 24)) &&
-            (value == 0xFF)) {
-          // Merge SHR into AND by emitting a UXTB instruction with a
-          // bytewise rotation.
-          Emit(kArmUxtb, g.DefineAsRegister(m.node()),
-               g.UseRegister(mshr.left().node()),
-               g.TempImmediate(mshr.right().Value()));
-          return;
-        } else if (((shift == 8) || (shift == 16)) && (value == 0xFFFF)) {
-          // Merge SHR into AND by emitting a UXTH instruction with a
-          // bytewise rotation.
-          Emit(kArmUxth, g.DefineAsRegister(m.node()),
-               g.UseRegister(mshr.left().node()),
-               g.TempImmediate(mshr.right().Value()));
-          return;
-        } else if (IsSupported(ARMv7) && (width != 0) &&
-                   ((leading_zeros + width) == 32)) {
-          // Merge Shr into And by emitting a UBFX instruction.
-          DCHECK_EQ(0u, base::bits::CountTrailingZeros32(value));
-          if ((1 <= shift) && (shift <= 31)) {
-            // UBFX cannot extract bits past the register size, however since
-            // shifting the original value would have introduced some zeros we
-            // can still use UBFX with a smaller mask and the remaining bits
-            // will be zeros.
-            EmitUbfx(this, node, mshr.left().node(), shift,
-                     std::min(width, 32 - shift));
-            return;
-          }
-        }
-      }
-    } else if (value == 0xFFFF) {
-      // Emit UXTH for this AND. We don't bother testing for UXTB, as it's no
-      // better than AND 0xFF for this operation.
-      Emit(kArmUxth, g.DefineAsRegister(m.node()),
-           g.UseRegister(m.left().node()), g.TempImmediate(0));
-      return;
-    }
-    if (g.CanBeImmediate(~value)) {
-      // Emit BIC for this AND by inverting the immediate value first.
-      Emit(kArmBic | AddressingModeField::encode(kMode_Operand2_I),
-           g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-           g.TempImmediate(~value));
-      return;
-    }
-    if (!g.CanBeImmediate(value) && IsSupported(ARMv7)) {
-      // If value has 9 to 23 contiguous set bits, and has the lsb set, we can
-      // replace this AND with UBFX. Other contiguous bit patterns have already
-      // been handled by BIC or will be handled by AND.
-      if ((width != 0) && ((leading_zeros + width) == 32) &&
-          (9 <= leading_zeros) && (leading_zeros <= 23)) {
-        DCHECK_EQ(0u, base::bits::CountTrailingZeros32(value));
-        EmitUbfx(this, node, m.left().node(), 0, width);
-        return;
-      }
-
-      width = 32 - width;
-      leading_zeros = base::bits::CountLeadingZeros32(~value);
-      uint32_t lsb = base::bits::CountTrailingZeros32(~value);
-      if ((leading_zeros + width + lsb) == 32) {
-        // This AND can be replaced with BFC.
-        Emit(kArmBfc, g.DefineSameAsFirst(node), g.UseRegister(m.left().node()),
-             g.TempImmediate(lsb), g.TempImmediate(width));
-        return;
-      }
-    }
-  }
-  VisitBinop(this, node, kArmAnd, kArmAnd);
-}
-
-
-void InstructionSelector::VisitWord32Or(Node* node) {
-  VisitBinop(this, node, kArmOrr, kArmOrr);
-}
-
-
-void InstructionSelector::VisitWord32Xor(Node* node) {
-  ArmOperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  if (m.right().Is(-1)) {
-    InstructionCode opcode = kArmMvn;
-    InstructionOperand value_operand;
-    InstructionOperand shift_operand;
-    if (TryMatchShift(this, &opcode, m.left().node(), &value_operand,
-                      &shift_operand)) {
-      Emit(opcode, g.DefineAsRegister(node), value_operand, shift_operand);
-      return;
-    }
-    Emit(opcode | AddressingModeField::encode(kMode_Operand2_R),
-         g.DefineAsRegister(node), g.UseRegister(m.left().node()));
-    return;
-  }
-  VisitBinop(this, node, kArmEor, kArmEor);
-}
-
-
-namespace {
-
-template <typename TryMatchShift>
-void VisitShift(InstructionSelector* selector, Node* node,
-                TryMatchShift try_match_shift, FlagsContinuation* cont) {
-  ArmOperandGenerator g(selector);
-  InstructionCode opcode = kArmMov;
-  InstructionOperand inputs[4];
-  size_t input_count = 2;
-  InstructionOperand outputs[2];
-  size_t output_count = 0;
-
-  CHECK(try_match_shift(selector, &opcode, node, &inputs[0], &inputs[1]));
-
-  if (cont->IsBranch()) {
-    inputs[input_count++] = g.Label(cont->true_block());
-    inputs[input_count++] = g.Label(cont->false_block());
-  }
-
-  outputs[output_count++] = g.DefineAsRegister(node);
-  if (cont->IsSet()) {
-    outputs[output_count++] = g.DefineAsRegister(cont->result());
-  }
-
-  DCHECK_NE(0u, input_count);
-  DCHECK_NE(0u, output_count);
-  DCHECK_GE(arraysize(inputs), input_count);
-  DCHECK_GE(arraysize(outputs), output_count);
-  DCHECK_NE(kMode_None, AddressingModeField::decode(opcode));
-
-  opcode = cont->Encode(opcode);
-  if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(opcode, output_count, outputs, input_count, inputs,
-                             cont->kind(), cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else if (cont->IsTrap()) {
-    inputs[input_count++] = g.UseImmediate(cont->trap_id());
-    selector->Emit(opcode, output_count, outputs, input_count, inputs);
-  } else {
-    selector->Emit(opcode, output_count, outputs, input_count, inputs);
-  }
-}
-
-
-template <typename TryMatchShift>
-void VisitShift(InstructionSelector* selector, Node* node,
-                              TryMatchShift try_match_shift) {
-  FlagsContinuation cont;
-  VisitShift(selector, node, try_match_shift, &cont);
-}
-
-}  // namespace
-
-
-void InstructionSelector::VisitWord32Shl(Node* node) {
-  VisitShift(this, node, TryMatchLSL);
-}
-
-
-void InstructionSelector::VisitWord32Shr(Node* node) {
-  ArmOperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  if (IsSupported(ARMv7) && m.left().IsWord32And() &&
-      m.right().IsInRange(0, 31)) {
-    uint32_t lsb = m.right().Value();
-    Int32BinopMatcher mleft(m.left().node());
-    if (mleft.right().HasValue()) {
-      uint32_t value = (mleft.right().Value() >> lsb) << lsb;
-      uint32_t width = base::bits::CountPopulation(value);
-      uint32_t msb = base::bits::CountLeadingZeros32(value);
-      if (msb + width + lsb == 32) {
-        DCHECK_EQ(lsb, base::bits::CountTrailingZeros32(value));
-        return EmitUbfx(this, node, mleft.left().node(), lsb, width);
-      }
-    }
-  }
-  VisitShift(this, node, TryMatchLSR);
-}
-
-
-void InstructionSelector::VisitWord32Sar(Node* node) {
-  ArmOperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  if (CanCover(m.node(), m.left().node()) && m.left().IsWord32Shl()) {
-    Int32BinopMatcher mleft(m.left().node());
-    if (m.right().HasValue() && mleft.right().HasValue()) {
-      uint32_t sar = m.right().Value();
-      uint32_t shl = mleft.right().Value();
-      if ((sar == shl) && (sar == 16)) {
-        Emit(kArmSxth, g.DefineAsRegister(node),
-             g.UseRegister(mleft.left().node()), g.TempImmediate(0));
-        return;
-      } else if ((sar == shl) && (sar == 24)) {
-        Emit(kArmSxtb, g.DefineAsRegister(node),
-             g.UseRegister(mleft.left().node()), g.TempImmediate(0));
-        return;
-      } else if (IsSupported(ARMv7) && (sar >= shl)) {
-        Emit(kArmSbfx, g.DefineAsRegister(node),
-             g.UseRegister(mleft.left().node()), g.TempImmediate(sar - shl),
-             g.TempImmediate(32 - sar));
-        return;
-      }
-    }
-  }
-  VisitShift(this, node, TryMatchASR);
-}
-
-void InstructionSelector::VisitInt32PairAdd(Node* node) {
-  ArmOperandGenerator g(this);
-
-  Node* projection1 = NodeProperties::FindProjection(node, 1);
-  if (projection1) {
-    // We use UseUniqueRegister here to avoid register sharing with the output
-    // registers.
-    InstructionOperand inputs[] = {
-        g.UseRegister(node->InputAt(0)), g.UseUniqueRegister(node->InputAt(1)),
-        g.UseRegister(node->InputAt(2)), g.UseUniqueRegister(node->InputAt(3))};
-
-    InstructionOperand outputs[] = {
-        g.DefineAsRegister(node),
-        g.DefineAsRegister(NodeProperties::FindProjection(node, 1))};
-
-    Emit(kArmAddPair, 2, outputs, 4, inputs);
-  } else {
-    // The high word of the result is not used, so we emit the standard 32 bit
-    // instruction.
-    Emit(kArmAdd | AddressingModeField::encode(kMode_Operand2_R),
-         g.DefineSameAsFirst(node), g.UseRegister(node->InputAt(0)),
-         g.UseRegister(node->InputAt(2)));
-  }
-}
-
-void InstructionSelector::VisitInt32PairSub(Node* node) {
-  ArmOperandGenerator g(this);
-
-  Node* projection1 = NodeProperties::FindProjection(node, 1);
-  if (projection1) {
-    // We use UseUniqueRegister here to avoid register sharing with the output
-    // register.
-    InstructionOperand inputs[] = {
-        g.UseRegister(node->InputAt(0)), g.UseUniqueRegister(node->InputAt(1)),
-        g.UseRegister(node->InputAt(2)), g.UseUniqueRegister(node->InputAt(3))};
-
-    InstructionOperand outputs[] = {
-        g.DefineAsRegister(node),
-        g.DefineAsRegister(NodeProperties::FindProjection(node, 1))};
-
-    Emit(kArmSubPair, 2, outputs, 4, inputs);
-  } else {
-    // The high word of the result is not used, so we emit the standard 32 bit
-    // instruction.
-    Emit(kArmSub | AddressingModeField::encode(kMode_Operand2_R),
-         g.DefineSameAsFirst(node), g.UseRegister(node->InputAt(0)),
-         g.UseRegister(node->InputAt(2)));
-  }
-}
-
-void InstructionSelector::VisitInt32PairMul(Node* node) {
-  ArmOperandGenerator g(this);
-  Node* projection1 = NodeProperties::FindProjection(node, 1);
-  if (projection1) {
-    InstructionOperand inputs[] = {g.UseUniqueRegister(node->InputAt(0)),
-                                   g.UseUniqueRegister(node->InputAt(1)),
-                                   g.UseUniqueRegister(node->InputAt(2)),
-                                   g.UseUniqueRegister(node->InputAt(3))};
-
-    InstructionOperand outputs[] = {
-        g.DefineAsRegister(node),
-        g.DefineAsRegister(NodeProperties::FindProjection(node, 1))};
-
-    Emit(kArmMulPair, 2, outputs, 4, inputs);
-  } else {
-    // The high word of the result is not used, so we emit the standard 32 bit
-    // instruction.
-    Emit(kArmMul | AddressingModeField::encode(kMode_Operand2_R),
-         g.DefineSameAsFirst(node), g.UseRegister(node->InputAt(0)),
-         g.UseRegister(node->InputAt(2)));
-  }
-}
-
-namespace {
-// Shared routine for multiple shift operations.
-void VisitWord32PairShift(InstructionSelector* selector, InstructionCode opcode,
-                          Node* node) {
-  ArmOperandGenerator g(selector);
-  // We use g.UseUniqueRegister here to guarantee that there is
-  // no register aliasing of input registers with output registers.
-  Int32Matcher m(node->InputAt(2));
-  InstructionOperand shift_operand;
-  if (m.HasValue()) {
-    shift_operand = g.UseImmediate(m.node());
-  } else {
-    shift_operand = g.UseUniqueRegister(m.node());
-  }
-
-  InstructionOperand inputs[] = {g.UseUniqueRegister(node->InputAt(0)),
-                                 g.UseUniqueRegister(node->InputAt(1)),
-                                 shift_operand};
-
-  Node* projection1 = NodeProperties::FindProjection(node, 1);
-
-  InstructionOperand outputs[2];
-  InstructionOperand temps[1];
-  int32_t output_count = 0;
-  int32_t temp_count = 0;
-
-  outputs[output_count++] = g.DefineAsRegister(node);
-  if (projection1) {
-    outputs[output_count++] = g.DefineAsRegister(projection1);
-  } else {
-    temps[temp_count++] = g.TempRegister();
-  }
-
-  selector->Emit(opcode, output_count, outputs, 3, inputs, temp_count, temps);
-}
-}  // namespace
-void InstructionSelector::VisitWord32PairShl(Node* node) {
-  VisitWord32PairShift(this, kArmLslPair, node);
-}
-
-void InstructionSelector::VisitWord32PairShr(Node* node) {
-  VisitWord32PairShift(this, kArmLsrPair, node);
-}
-
-void InstructionSelector::VisitWord32PairSar(Node* node) {
-  VisitWord32PairShift(this, kArmAsrPair, node);
-}
-
-void InstructionSelector::VisitWord32Ror(Node* node) {
-  VisitShift(this, node, TryMatchROR);
-}
-
-void InstructionSelector::VisitWord32Ctz(Node* node) { UNREACHABLE(); }
-
-void InstructionSelector::VisitWord32ReverseBits(Node* node) {
-  DCHECK(IsSupported(ARMv7));
-  VisitRR(this, kArmRbit, node);
-}
-
-void InstructionSelector::VisitWord64ReverseBytes(Node* node) { UNREACHABLE(); }
-
-void InstructionSelector::VisitWord32ReverseBytes(Node* node) { UNREACHABLE(); }
-
-void InstructionSelector::VisitWord32Popcnt(Node* node) { UNREACHABLE(); }
-
-void InstructionSelector::VisitSpeculationFence(Node* node) { UNREACHABLE(); }
-
-void InstructionSelector::VisitInt32Add(Node* node) {
-  ArmOperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  if (CanCover(node, m.left().node())) {
-    switch (m.left().opcode()) {
-      case IrOpcode::kInt32Mul: {
-        Int32BinopMatcher mleft(m.left().node());
-        Emit(kArmMla, g.DefineAsRegister(node),
-             g.UseRegister(mleft.left().node()),
-             g.UseRegister(mleft.right().node()),
-             g.UseRegister(m.right().node()));
-        return;
-      }
-      case IrOpcode::kInt32MulHigh: {
-        Int32BinopMatcher mleft(m.left().node());
-        Emit(kArmSmmla, g.DefineAsRegister(node),
-             g.UseRegister(mleft.left().node()),
-             g.UseRegister(mleft.right().node()),
-             g.UseRegister(m.right().node()));
-        return;
-      }
-      case IrOpcode::kWord32And: {
-        Int32BinopMatcher mleft(m.left().node());
-        if (mleft.right().Is(0xFF)) {
-          Emit(kArmUxtab, g.DefineAsRegister(node),
-               g.UseRegister(m.right().node()),
-               g.UseRegister(mleft.left().node()), g.TempImmediate(0));
-          return;
-        } else if (mleft.right().Is(0xFFFF)) {
-          Emit(kArmUxtah, g.DefineAsRegister(node),
-               g.UseRegister(m.right().node()),
-               g.UseRegister(mleft.left().node()), g.TempImmediate(0));
-          return;
-        }
-      }
-      case IrOpcode::kWord32Sar: {
-        Int32BinopMatcher mleft(m.left().node());
-        if (CanCover(mleft.node(), mleft.left().node()) &&
-            mleft.left().IsWord32Shl()) {
-          Int32BinopMatcher mleftleft(mleft.left().node());
-          if (mleft.right().Is(24) && mleftleft.right().Is(24)) {
-            Emit(kArmSxtab, g.DefineAsRegister(node),
-                 g.UseRegister(m.right().node()),
-                 g.UseRegister(mleftleft.left().node()), g.TempImmediate(0));
-            return;
-          } else if (mleft.right().Is(16) && mleftleft.right().Is(16)) {
-            Emit(kArmSxtah, g.DefineAsRegister(node),
-                 g.UseRegister(m.right().node()),
-                 g.UseRegister(mleftleft.left().node()), g.TempImmediate(0));
-            return;
-          }
-        }
-      }
-      default:
-        break;
-    }
-  }
-  if (CanCover(node, m.right().node())) {
-    switch (m.right().opcode()) {
-      case IrOpcode::kInt32Mul: {
-        Int32BinopMatcher mright(m.right().node());
-        Emit(kArmMla, g.DefineAsRegister(node),
-             g.UseRegister(mright.left().node()),
-             g.UseRegister(mright.right().node()),
-             g.UseRegister(m.left().node()));
-        return;
-      }
-      case IrOpcode::kInt32MulHigh: {
-        Int32BinopMatcher mright(m.right().node());
-        Emit(kArmSmmla, g.DefineAsRegister(node),
-             g.UseRegister(mright.left().node()),
-             g.UseRegister(mright.right().node()),
-             g.UseRegister(m.left().node()));
-        return;
-      }
-      case IrOpcode::kWord32And: {
-        Int32BinopMatcher mright(m.right().node());
-        if (mright.right().Is(0xFF)) {
-          Emit(kArmUxtab, g.DefineAsRegister(node),
-               g.UseRegister(m.left().node()),
-               g.UseRegister(mright.left().node()), g.TempImmediate(0));
-          return;
-        } else if (mright.right().Is(0xFFFF)) {
-          Emit(kArmUxtah, g.DefineAsRegister(node),
-               g.UseRegister(m.left().node()),
-               g.UseRegister(mright.left().node()), g.TempImmediate(0));
-          return;
-        }
-      }
-      case IrOpcode::kWord32Sar: {
-        Int32BinopMatcher mright(m.right().node());
-        if (CanCover(mright.node(), mright.left().node()) &&
-            mright.left().IsWord32Shl()) {
-          Int32BinopMatcher mrightleft(mright.left().node());
-          if (mright.right().Is(24) && mrightleft.right().Is(24)) {
-            Emit(kArmSxtab, g.DefineAsRegister(node),
-                 g.UseRegister(m.left().node()),
-                 g.UseRegister(mrightleft.left().node()), g.TempImmediate(0));
-            return;
-          } else if (mright.right().Is(16) && mrightleft.right().Is(16)) {
-            Emit(kArmSxtah, g.DefineAsRegister(node),
-                 g.UseRegister(m.left().node()),
-                 g.UseRegister(mrightleft.left().node()), g.TempImmediate(0));
-            return;
-          }
-        }
-      }
-      default:
-        break;
-    }
-  }
-  VisitBinop(this, node, kArmAdd, kArmAdd);
-}
-
-
-void InstructionSelector::VisitInt32Sub(Node* node) {
-  ArmOperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  if (IsSupported(ARMv7) && m.right().IsInt32Mul() &&
-      CanCover(node, m.right().node())) {
-    Int32BinopMatcher mright(m.right().node());
-    Emit(kArmMls, g.DefineAsRegister(node), g.UseRegister(mright.left().node()),
-         g.UseRegister(mright.right().node()), g.UseRegister(m.left().node()));
-    return;
-  }
-  VisitBinop(this, node, kArmSub, kArmRsb);
-}
-
-namespace {
-
-void EmitInt32MulWithOverflow(InstructionSelector* selector, Node* node,
-                              FlagsContinuation* cont) {
-  ArmOperandGenerator g(selector);
-  Int32BinopMatcher m(node);
-  InstructionOperand result_operand = g.DefineAsRegister(node);
-  InstructionOperand temp_operand = g.TempRegister();
-  InstructionOperand outputs[] = {result_operand, temp_operand};
-  InstructionOperand inputs[] = {g.UseRegister(m.left().node()),
-                                 g.UseRegister(m.right().node())};
-  selector->Emit(kArmSmull, 2, outputs, 2, inputs);
-
-  // result operand needs shift operator.
-  InstructionOperand shift_31 = g.UseImmediate(31);
-  InstructionCode opcode = cont->Encode(kArmCmp) |
-                           AddressingModeField::encode(kMode_Operand2_R_ASR_I);
-  if (cont->IsBranch()) {
-    selector->Emit(opcode, g.NoOutput(), temp_operand, result_operand, shift_31,
-                   g.Label(cont->true_block()), g.Label(cont->false_block()));
-  } else if (cont->IsDeoptimize()) {
-    InstructionOperand in[] = {temp_operand, result_operand, shift_31};
-    selector->EmitDeoptimize(opcode, 0, nullptr, 3, in, cont->kind(),
-                             cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else if (cont->IsSet()) {
-    selector->Emit(opcode, g.DefineAsRegister(cont->result()), temp_operand,
-                   result_operand, shift_31);
-  } else {
-    DCHECK(cont->IsTrap());
-    InstructionOperand in[] = {temp_operand, result_operand, shift_31,
-                               g.UseImmediate(cont->trap_id())};
-    selector->Emit(opcode, 0, nullptr, 4, in);
-  }
-}
-
-}  // namespace
-
-void InstructionSelector::VisitInt32Mul(Node* node) {
-  ArmOperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  if (m.right().HasValue() && m.right().Value() > 0) {
-    int32_t value = m.right().Value();
-    if (base::bits::IsPowerOfTwo(value - 1)) {
-      Emit(kArmAdd | AddressingModeField::encode(kMode_Operand2_R_LSL_I),
-           g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-           g.UseRegister(m.left().node()),
-           g.TempImmediate(WhichPowerOf2(value - 1)));
-      return;
-    }
-    if (value < kMaxInt && base::bits::IsPowerOfTwo(value + 1)) {
-      Emit(kArmRsb | AddressingModeField::encode(kMode_Operand2_R_LSL_I),
-           g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-           g.UseRegister(m.left().node()),
-           g.TempImmediate(WhichPowerOf2(value + 1)));
-      return;
-    }
-  }
-  VisitRRR(this, kArmMul, node);
-}
-
-void InstructionSelector::VisitUint32MulHigh(Node* node) {
-  ArmOperandGenerator g(this);
-  InstructionOperand outputs[] = {g.TempRegister(), g.DefineAsRegister(node)};
-  InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0)),
-                                 g.UseRegister(node->InputAt(1))};
-  Emit(kArmUmull, arraysize(outputs), outputs, arraysize(inputs), inputs);
-}
-
-
-void InstructionSelector::VisitInt32Div(Node* node) {
-  VisitDiv(this, node, kArmSdiv, kArmVcvtF64S32, kArmVcvtS32F64);
-}
-
-
-void InstructionSelector::VisitUint32Div(Node* node) {
-  VisitDiv(this, node, kArmUdiv, kArmVcvtF64U32, kArmVcvtU32F64);
-}
-
-
-void InstructionSelector::VisitInt32Mod(Node* node) {
-  VisitMod(this, node, kArmSdiv, kArmVcvtF64S32, kArmVcvtS32F64);
-}
-
-
-void InstructionSelector::VisitUint32Mod(Node* node) {
-  VisitMod(this, node, kArmUdiv, kArmVcvtF64U32, kArmVcvtU32F64);
-}
-
-#define RR_OP_LIST(V)                                \
-  V(Word32Clz, kArmClz)                              \
-  V(ChangeFloat32ToFloat64, kArmVcvtF64F32)          \
-  V(RoundInt32ToFloat32, kArmVcvtF32S32)             \
-  V(RoundUint32ToFloat32, kArmVcvtF32U32)            \
-  V(ChangeInt32ToFloat64, kArmVcvtF64S32)            \
-  V(ChangeUint32ToFloat64, kArmVcvtF64U32)           \
-  V(TruncateFloat32ToInt32, kArmVcvtS32F32)          \
-  V(TruncateFloat32ToUint32, kArmVcvtU32F32)         \
-  V(ChangeFloat64ToInt32, kArmVcvtS32F64)            \
-  V(ChangeFloat64ToUint32, kArmVcvtU32F64)           \
-  V(TruncateFloat64ToUint32, kArmVcvtU32F64)         \
-  V(TruncateFloat64ToFloat32, kArmVcvtF32F64)        \
-  V(TruncateFloat64ToWord32, kArchTruncateDoubleToI) \
-  V(RoundFloat64ToInt32, kArmVcvtS32F64)             \
-  V(BitcastFloat32ToInt32, kArmVmovU32F32)           \
-  V(BitcastInt32ToFloat32, kArmVmovF32U32)           \
-  V(Float64ExtractLowWord32, kArmVmovLowU32F64)      \
-  V(Float64ExtractHighWord32, kArmVmovHighU32F64)    \
-  V(Float64SilenceNaN, kArmFloat64SilenceNaN)        \
-  V(Float32Abs, kArmVabsF32)                         \
-  V(Float64Abs, kArmVabsF64)                         \
-  V(Float32Neg, kArmVnegF32)                         \
-  V(Float64Neg, kArmVnegF64)                         \
-  V(Float32Sqrt, kArmVsqrtF32)                       \
-  V(Float64Sqrt, kArmVsqrtF64)
-
-#define RR_OP_LIST_V8(V)                 \
-  V(Float32RoundDown, kArmVrintmF32)     \
-  V(Float64RoundDown, kArmVrintmF64)     \
-  V(Float32RoundUp, kArmVrintpF32)       \
-  V(Float64RoundUp, kArmVrintpF64)       \
-  V(Float32RoundTruncate, kArmVrintzF32) \
-  V(Float64RoundTruncate, kArmVrintzF64) \
-  V(Float64RoundTiesAway, kArmVrintaF64) \
-  V(Float32RoundTiesEven, kArmVrintnF32) \
-  V(Float64RoundTiesEven, kArmVrintnF64)
-
-#define RRR_OP_LIST(V)          \
-  V(Int32MulHigh, kArmSmmul)    \
-  V(Float32Mul, kArmVmulF32)    \
-  V(Float64Mul, kArmVmulF64)    \
-  V(Float32Div, kArmVdivF32)    \
-  V(Float64Div, kArmVdivF64)    \
-  V(Float32Max, kArmFloat32Max) \
-  V(Float64Max, kArmFloat64Max) \
-  V(Float32Min, kArmFloat32Min) \
-  V(Float64Min, kArmFloat64Min)
-
-#define RR_VISITOR(Name, opcode)                      \
-  void InstructionSelector::Visit##Name(Node* node) { \
-    VisitRR(this, opcode, node);                      \
-  }
-RR_OP_LIST(RR_VISITOR)
-#undef RR_VISITOR
-
-#define RR_VISITOR_V8(Name, opcode)                   \
-  void InstructionSelector::Visit##Name(Node* node) { \
-    DCHECK(CpuFeatures::IsSupported(ARMv8));          \
-    VisitRR(this, opcode, node);                      \
-  }
-RR_OP_LIST_V8(RR_VISITOR_V8)
-#undef RR_VISITOR_V8
-
-#define RRR_VISITOR(Name, opcode)                     \
-  void InstructionSelector::Visit##Name(Node* node) { \
-    VisitRRR(this, opcode, node);                     \
-  }
-RRR_OP_LIST(RRR_VISITOR)
-#undef RRR_VISITOR
-
-void InstructionSelector::VisitFloat32Add(Node* node) {
-  ArmOperandGenerator g(this);
-  Float32BinopMatcher m(node);
-  if (m.left().IsFloat32Mul() && CanCover(node, m.left().node())) {
-    Float32BinopMatcher mleft(m.left().node());
-    Emit(kArmVmlaF32, g.DefineSameAsFirst(node),
-         g.UseRegister(m.right().node()), g.UseRegister(mleft.left().node()),
-         g.UseRegister(mleft.right().node()));
-    return;
-  }
-  if (m.right().IsFloat32Mul() && CanCover(node, m.right().node())) {
-    Float32BinopMatcher mright(m.right().node());
-    Emit(kArmVmlaF32, g.DefineSameAsFirst(node), g.UseRegister(m.left().node()),
-         g.UseRegister(mright.left().node()),
-         g.UseRegister(mright.right().node()));
-    return;
-  }
-  VisitRRR(this, kArmVaddF32, node);
-}
-
-
-void InstructionSelector::VisitFloat64Add(Node* node) {
-  ArmOperandGenerator g(this);
-  Float64BinopMatcher m(node);
-  if (m.left().IsFloat64Mul() && CanCover(node, m.left().node())) {
-    Float64BinopMatcher mleft(m.left().node());
-    Emit(kArmVmlaF64, g.DefineSameAsFirst(node),
-         g.UseRegister(m.right().node()), g.UseRegister(mleft.left().node()),
-         g.UseRegister(mleft.right().node()));
-    return;
-  }
-  if (m.right().IsFloat64Mul() && CanCover(node, m.right().node())) {
-    Float64BinopMatcher mright(m.right().node());
-    Emit(kArmVmlaF64, g.DefineSameAsFirst(node), g.UseRegister(m.left().node()),
-         g.UseRegister(mright.left().node()),
-         g.UseRegister(mright.right().node()));
-    return;
-  }
-  VisitRRR(this, kArmVaddF64, node);
-}
-
-void InstructionSelector::VisitFloat32Sub(Node* node) {
-  ArmOperandGenerator g(this);
-  Float32BinopMatcher m(node);
-  if (m.right().IsFloat32Mul() && CanCover(node, m.right().node())) {
-    Float32BinopMatcher mright(m.right().node());
-    Emit(kArmVmlsF32, g.DefineSameAsFirst(node), g.UseRegister(m.left().node()),
-         g.UseRegister(mright.left().node()),
-         g.UseRegister(mright.right().node()));
-    return;
-  }
-  VisitRRR(this, kArmVsubF32, node);
-}
-
-void InstructionSelector::VisitFloat64Sub(Node* node) {
-  ArmOperandGenerator g(this);
-  Float64BinopMatcher m(node);
-  if (m.right().IsFloat64Mul() && CanCover(node, m.right().node())) {
-    Float64BinopMatcher mright(m.right().node());
-    Emit(kArmVmlsF64, g.DefineSameAsFirst(node), g.UseRegister(m.left().node()),
-         g.UseRegister(mright.left().node()),
-         g.UseRegister(mright.right().node()));
-    return;
-  }
-  VisitRRR(this, kArmVsubF64, node);
-}
-
-void InstructionSelector::VisitFloat64Mod(Node* node) {
-  ArmOperandGenerator g(this);
-  Emit(kArmVmodF64, g.DefineAsFixed(node, d0), g.UseFixed(node->InputAt(0), d0),
-       g.UseFixed(node->InputAt(1), d1))->MarkAsCall();
-}
-
-void InstructionSelector::VisitFloat64Ieee754Binop(Node* node,
-                                                   InstructionCode opcode) {
-  ArmOperandGenerator g(this);
-  Emit(opcode, g.DefineAsFixed(node, d0), g.UseFixed(node->InputAt(0), d0),
-       g.UseFixed(node->InputAt(1), d1))
-      ->MarkAsCall();
-}
-
-void InstructionSelector::VisitFloat64Ieee754Unop(Node* node,
-                                                  InstructionCode opcode) {
-  ArmOperandGenerator g(this);
-  Emit(opcode, g.DefineAsFixed(node, d0), g.UseFixed(node->InputAt(0), d0))
-      ->MarkAsCall();
-}
-
-void InstructionSelector::EmitPrepareArguments(
-    ZoneVector<PushParameter>* arguments, const CallDescriptor* descriptor,
-    Node* node) {
-  ArmOperandGenerator g(this);
-
-  // Prepare for C function call.
-  if (descriptor->IsCFunctionCall()) {
-    Emit(kArchPrepareCallCFunction |
-             MiscField::encode(static_cast<int>(descriptor->ParameterCount())),
-         0, nullptr, 0, nullptr);
-
-    // Poke any stack arguments.
-    for (size_t n = 0; n < arguments->size(); ++n) {
-      PushParameter input = (*arguments)[n];
-      if (input.node) {
-        int slot = static_cast<int>(n);
-        Emit(kArmPoke | MiscField::encode(slot), g.NoOutput(),
-             g.UseRegister(input.node));
-      }
-    }
-  } else {
-    // Push any stack arguments.
-    for (PushParameter input : base::Reversed(*arguments)) {
-      // Skip any alignment holes in pushed nodes.
-      if (input.node == nullptr) continue;
-      Emit(kArmPush, g.NoOutput(), g.UseRegister(input.node));
-    }
-  }
-}
-
-void InstructionSelector::EmitPrepareResults(ZoneVector<PushParameter>* results,
-                                             const CallDescriptor* descriptor,
-                                             Node* node) {
-  ArmOperandGenerator g(this);
-
-  int reverse_slot = 0;
-  for (PushParameter output : *results) {
-    if (!output.location.IsCallerFrameSlot()) continue;
-    // Skip any alignment holes in nodes.
-    if (output.node != nullptr) {
-      DCHECK(!descriptor->IsCFunctionCall());
-      if (output.location.GetType() == MachineType::Float32()) {
-        MarkAsFloat32(output.node);
-      } else if (output.location.GetType() == MachineType::Float64()) {
-        MarkAsFloat64(output.node);
-      }
-      Emit(kArmPeek, g.DefineAsRegister(output.node),
-           g.UseImmediate(reverse_slot));
-    }
-    reverse_slot += output.location.GetSizeInPointers();
-  }
-}
-
-bool InstructionSelector::IsTailCallAddressImmediate() { return false; }
-
-int InstructionSelector::GetTempsCountForTailCallFromJSFunction() { return 3; }
-
-namespace {
-
-// Shared routine for multiple compare operations.
-void VisitCompare(InstructionSelector* selector, InstructionCode opcode,
-                  InstructionOperand left, InstructionOperand right,
-                  FlagsContinuation* cont) {
-  ArmOperandGenerator g(selector);
-  opcode = cont->Encode(opcode);
-  if (cont->IsBranch()) {
-    selector->Emit(opcode, g.NoOutput(), left, right,
-                   g.Label(cont->true_block()), g.Label(cont->false_block()));
-  } else if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(opcode, g.NoOutput(), left, right, cont->kind(),
-                             cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else if (cont->IsSet()) {
-    selector->Emit(opcode, g.DefineAsRegister(cont->result()), left, right);
-  } else {
-    DCHECK(cont->IsTrap());
-    selector->Emit(opcode, g.NoOutput(), left, right,
-                   g.UseImmediate(cont->trap_id()));
-  }
-}
-
-
-// Shared routine for multiple float32 compare operations.
-void VisitFloat32Compare(InstructionSelector* selector, Node* node,
-                         FlagsContinuation* cont) {
-  ArmOperandGenerator g(selector);
-  Float32BinopMatcher m(node);
-  if (m.right().Is(0.0f)) {
-    VisitCompare(selector, kArmVcmpF32, g.UseRegister(m.left().node()),
-                 g.UseImmediate(m.right().node()), cont);
-  } else if (m.left().Is(0.0f)) {
-    cont->Commute();
-    VisitCompare(selector, kArmVcmpF32, g.UseRegister(m.right().node()),
-                 g.UseImmediate(m.left().node()), cont);
-  } else {
-    VisitCompare(selector, kArmVcmpF32, g.UseRegister(m.left().node()),
-                 g.UseRegister(m.right().node()), cont);
-  }
-}
-
-
-// Shared routine for multiple float64 compare operations.
-void VisitFloat64Compare(InstructionSelector* selector, Node* node,
-                         FlagsContinuation* cont) {
-  ArmOperandGenerator g(selector);
-  Float64BinopMatcher m(node);
-  if (m.right().Is(0.0)) {
-    VisitCompare(selector, kArmVcmpF64, g.UseRegister(m.left().node()),
-                 g.UseImmediate(m.right().node()), cont);
-  } else if (m.left().Is(0.0)) {
-    cont->Commute();
-    VisitCompare(selector, kArmVcmpF64, g.UseRegister(m.right().node()),
-                 g.UseImmediate(m.left().node()), cont);
-  } else {
-    VisitCompare(selector, kArmVcmpF64, g.UseRegister(m.left().node()),
-                 g.UseRegister(m.right().node()), cont);
-  }
-}
-
-// Check whether we can convert:
-// ((a <op> b) cmp 0), b.<cond>
-// to:
-// (a <ops> b), b.<cond'>
-// where <ops> is the flag setting version of <op>.
-// We only generate conditions <cond'> that are a combination of the N
-// and Z flags. This avoids the need to make this function dependent on
-// the flag-setting operation.
-bool CanUseFlagSettingBinop(FlagsCondition cond) {
-  switch (cond) {
-    case kEqual:
-    case kNotEqual:
-    case kSignedLessThan:
-    case kSignedGreaterThanOrEqual:
-    case kUnsignedLessThanOrEqual:  // x <= 0 -> x == 0
-    case kUnsignedGreaterThan:      // x > 0 -> x != 0
-      return true;
-    default:
-      return false;
-  }
-}
-
-// Map <cond> to <cond'> so that the following transformation is possible:
-// ((a <op> b) cmp 0), b.<cond>
-// to:
-// (a <ops> b), b.<cond'>
-// where <ops> is the flag setting version of <op>.
-FlagsCondition MapForFlagSettingBinop(FlagsCondition cond) {
-  DCHECK(CanUseFlagSettingBinop(cond));
-  switch (cond) {
-    case kEqual:
-    case kNotEqual:
-      return cond;
-    case kSignedLessThan:
-      return kNegative;
-    case kSignedGreaterThanOrEqual:
-      return kPositiveOrZero;
-    case kUnsignedLessThanOrEqual:  // x <= 0 -> x == 0
-      return kEqual;
-    case kUnsignedGreaterThan:  // x > 0 -> x != 0
-      return kNotEqual;
-    default:
-      UNREACHABLE();
-  }
-}
-
-// Check if we can perform the transformation:
-// ((a <op> b) cmp 0), b.<cond>
-// to:
-// (a <ops> b), b.<cond'>
-// where <ops> is the flag setting version of <op>, and if so,
-// updates {node}, {opcode} and {cont} accordingly.
-void MaybeReplaceCmpZeroWithFlagSettingBinop(InstructionSelector* selector,
-                                             Node** node, Node* binop,
-                                             InstructionCode* opcode,
-                                             FlagsCondition cond,
-                                             FlagsContinuation* cont) {
-  InstructionCode binop_opcode;
-  InstructionCode no_output_opcode;
-  switch (binop->opcode()) {
-    case IrOpcode::kInt32Add:
-      binop_opcode = kArmAdd;
-      no_output_opcode = kArmCmn;
-      break;
-    case IrOpcode::kWord32And:
-      binop_opcode = kArmAnd;
-      no_output_opcode = kArmTst;
-      break;
-    case IrOpcode::kWord32Or:
-      binop_opcode = kArmOrr;
-      no_output_opcode = kArmOrr;
-      break;
-    case IrOpcode::kWord32Xor:
-      binop_opcode = kArmEor;
-      no_output_opcode = kArmTeq;
-      break;
-    default:
-      UNREACHABLE();
-      return;
-  }
-  if (selector->CanCover(*node, binop)) {
-    // The comparison is the only user of {node}.
-    cont->Overwrite(MapForFlagSettingBinop(cond));
-    *opcode = no_output_opcode;
-    *node = binop;
-  } else if (selector->IsOnlyUserOfNodeInSameBlock(*node, binop)) {
-    // We can also handle the case where the {node} and the comparison are in
-    // the same basic block, and the comparison is the only user of {node} in
-    // this basic block ({node} has users in other basic blocks).
-    cont->Overwrite(MapForFlagSettingBinop(cond));
-    *opcode = binop_opcode;
-    *node = binop;
-  }
-}
-
-// Shared routine for multiple word compare operations.
-void VisitWordCompare(InstructionSelector* selector, Node* node,
-                      InstructionCode opcode, FlagsContinuation* cont) {
-  ArmOperandGenerator g(selector);
-  Int32BinopMatcher m(node);
-  InstructionOperand inputs[5];
-  size_t input_count = 0;
-  InstructionOperand outputs[2];
-  size_t output_count = 0;
-  bool has_result = (opcode != kArmCmp) && (opcode != kArmCmn) &&
-                    (opcode != kArmTst) && (opcode != kArmTeq);
-
-  if (TryMatchImmediateOrShift(selector, &opcode, m.right().node(),
-                               &input_count, &inputs[1])) {
-    inputs[0] = g.UseRegister(m.left().node());
-    input_count++;
-  } else if (TryMatchImmediateOrShift(selector, &opcode, m.left().node(),
-                                      &input_count, &inputs[1])) {
-    if (!node->op()->HasProperty(Operator::kCommutative)) cont->Commute();
-    inputs[0] = g.UseRegister(m.right().node());
-    input_count++;
-  } else {
-    opcode |= AddressingModeField::encode(kMode_Operand2_R);
-    inputs[input_count++] = g.UseRegister(m.left().node());
-    inputs[input_count++] = g.UseRegister(m.right().node());
-  }
-
-  if (has_result) {
-    if (cont->IsDeoptimize()) {
-      // If we can deoptimize as a result of the binop, we need to make sure
-      // that the deopt inputs are not overwritten by the binop result. One way
-      // to achieve that is to declare the output register as same-as-first.
-      outputs[output_count++] = g.DefineSameAsFirst(node);
-    } else {
-      outputs[output_count++] = g.DefineAsRegister(node);
-    }
-  }
-
-  if (cont->IsBranch()) {
-    inputs[input_count++] = g.Label(cont->true_block());
-    inputs[input_count++] = g.Label(cont->false_block());
-  } else if (cont->IsSet()) {
-    outputs[output_count++] = g.DefineAsRegister(cont->result());
-  }
-
-  DCHECK_NE(0u, input_count);
-  DCHECK_GE(arraysize(inputs), input_count);
-  DCHECK_GE(arraysize(outputs), output_count);
-
-  opcode = cont->Encode(opcode);
-  if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(opcode, output_count, outputs, input_count, inputs,
-                             cont->kind(), cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else if (cont->IsTrap()) {
-    inputs[input_count++] = g.UseImmediate(cont->trap_id());
-    selector->Emit(opcode, output_count, outputs, input_count, inputs);
-  } else {
-    selector->Emit(opcode, output_count, outputs, input_count, inputs);
-  }
-}
-
-
-void VisitWordCompare(InstructionSelector* selector, Node* node,
-                      FlagsContinuation* cont) {
-  InstructionCode opcode = kArmCmp;
-  Int32BinopMatcher m(node);
-
-  FlagsCondition cond = cont->condition();
-  if (m.right().Is(0) && (m.left().IsInt32Add() || m.left().IsWord32Or() ||
-                          m.left().IsWord32And() || m.left().IsWord32Xor())) {
-    // Emit flag setting instructions for comparisons against zero.
-    if (CanUseFlagSettingBinop(cond)) {
-      Node* binop = m.left().node();
-      MaybeReplaceCmpZeroWithFlagSettingBinop(selector, &node, binop, &opcode,
-                                              cond, cont);
-    }
-  } else if (m.left().Is(0) &&
-             (m.right().IsInt32Add() || m.right().IsWord32Or() ||
-              m.right().IsWord32And() || m.right().IsWord32Xor())) {
-    // Same as above, but we need to commute the condition before we
-    // continue with the rest of the checks.
-    cond = CommuteFlagsCondition(cond);
-    if (CanUseFlagSettingBinop(cond)) {
-      Node* binop = m.right().node();
-      MaybeReplaceCmpZeroWithFlagSettingBinop(selector, &node, binop, &opcode,
-                                              cond, cont);
-    }
-  }
-
-  VisitWordCompare(selector, node, opcode, cont);
-}
-
-
-// Shared routine for word comparisons against zero.
-void VisitWordCompareZero(InstructionSelector* selector, Node* user,
-                          Node* value, FlagsContinuation* cont) {
-  // Try to combine with comparisons against 0 by simply inverting the branch.
-  while (value->opcode() == IrOpcode::kWord32Equal &&
-         selector->CanCover(user, value)) {
-    Int32BinopMatcher m(value);
-    if (!m.right().Is(0)) break;
-
-    user = value;
-    value = m.left().node();
-    cont->Negate();
-  }
-
-  if (selector->CanCover(user, value)) {
-    switch (value->opcode()) {
-      case IrOpcode::kWord32Equal:
-        cont->OverwriteAndNegateIfEqual(kEqual);
-        return VisitWordCompare(selector, value, cont);
-      case IrOpcode::kInt32LessThan:
-        cont->OverwriteAndNegateIfEqual(kSignedLessThan);
-        return VisitWordCompare(selector, value, cont);
-      case IrOpcode::kInt32LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kSignedLessThanOrEqual);
-        return VisitWordCompare(selector, value, cont);
-      case IrOpcode::kUint32LessThan:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThan);
-        return VisitWordCompare(selector, value, cont);
-      case IrOpcode::kUint32LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
-        return VisitWordCompare(selector, value, cont);
-      case IrOpcode::kFloat32Equal:
-        cont->OverwriteAndNegateIfEqual(kEqual);
-        return VisitFloat32Compare(selector, value, cont);
-      case IrOpcode::kFloat32LessThan:
-        cont->OverwriteAndNegateIfEqual(kFloatLessThan);
-        return VisitFloat32Compare(selector, value, cont);
-      case IrOpcode::kFloat32LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kFloatLessThanOrEqual);
-        return VisitFloat32Compare(selector, value, cont);
-      case IrOpcode::kFloat64Equal:
-        cont->OverwriteAndNegateIfEqual(kEqual);
-        return VisitFloat64Compare(selector, value, cont);
-      case IrOpcode::kFloat64LessThan:
-        cont->OverwriteAndNegateIfEqual(kFloatLessThan);
-        return VisitFloat64Compare(selector, value, cont);
-      case IrOpcode::kFloat64LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kFloatLessThanOrEqual);
-        return VisitFloat64Compare(selector, value, cont);
-      case IrOpcode::kProjection:
-        // Check if this is the overflow output projection of an
-        // <Operation>WithOverflow node.
-        if (ProjectionIndexOf(value->op()) == 1u) {
-          // We cannot combine the <Operation>WithOverflow with this branch
-          // unless the 0th projection (the use of the actual value of the
-          // <Operation> is either nullptr, which means there's no use of the
-          // actual value, or was already defined, which means it is scheduled
-          // *AFTER* this branch).
-          Node* const node = value->InputAt(0);
-          Node* const result = NodeProperties::FindProjection(node, 0);
-          if (!result || selector->IsDefined(result)) {
-            switch (node->opcode()) {
-              case IrOpcode::kInt32AddWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitBinop(selector, node, kArmAdd, kArmAdd, cont);
-              case IrOpcode::kInt32SubWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitBinop(selector, node, kArmSub, kArmRsb, cont);
-              case IrOpcode::kInt32MulWithOverflow:
-                // ARM doesn't set the overflow flag for multiplication, so we
-                // need to test on kNotEqual. Here is the code sequence used:
-                //   smull resultlow, resulthigh, left, right
-                //   cmp resulthigh, Operand(resultlow, ASR, 31)
-                cont->OverwriteAndNegateIfEqual(kNotEqual);
-                return EmitInt32MulWithOverflow(selector, node, cont);
-              default:
-                break;
-            }
-          }
-        }
-        break;
-      case IrOpcode::kInt32Add:
-        return VisitWordCompare(selector, value, kArmCmn, cont);
-      case IrOpcode::kInt32Sub:
-        return VisitWordCompare(selector, value, kArmCmp, cont);
-      case IrOpcode::kWord32And:
-        return VisitWordCompare(selector, value, kArmTst, cont);
-      case IrOpcode::kWord32Or:
-        return VisitBinop(selector, value, kArmOrr, kArmOrr, cont);
-      case IrOpcode::kWord32Xor:
-        return VisitWordCompare(selector, value, kArmTeq, cont);
-      case IrOpcode::kWord32Sar:
-        return VisitShift(selector, value, TryMatchASR, cont);
-      case IrOpcode::kWord32Shl:
-        return VisitShift(selector, value, TryMatchLSL, cont);
-      case IrOpcode::kWord32Shr:
-        return VisitShift(selector, value, TryMatchLSR, cont);
-      case IrOpcode::kWord32Ror:
-        return VisitShift(selector, value, TryMatchROR, cont);
-      default:
-        break;
-    }
-  }
-
-  if (user->opcode() == IrOpcode::kWord32Equal) {
-    return VisitWordCompare(selector, user, cont);
-  }
-
-  // Continuation could not be combined with a compare, emit compare against 0.
-  ArmOperandGenerator g(selector);
-  InstructionCode const opcode =
-      cont->Encode(kArmTst) | AddressingModeField::encode(kMode_Operand2_R);
-  InstructionOperand const value_operand = g.UseRegister(value);
-  if (cont->IsBranch()) {
-    selector->Emit(opcode, g.NoOutput(), value_operand, value_operand,
-                   g.Label(cont->true_block()), g.Label(cont->false_block()));
-  } else if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(opcode, g.NoOutput(), value_operand, value_operand,
-                             cont->kind(), cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else if (cont->IsSet()) {
-    selector->Emit(opcode, g.DefineAsRegister(cont->result()), value_operand,
-                   value_operand);
-  } else {
-    DCHECK(cont->IsTrap());
-    selector->Emit(opcode, g.NoOutput(), value_operand, value_operand,
-                   g.UseImmediate(cont->trap_id()));
-  }
-}
-
-}  // namespace
-
-void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch,
-                                      BasicBlock* fbranch) {
-  FlagsContinuation cont(kNotEqual, tbranch, fbranch);
-  VisitWordCompareZero(this, branch, branch->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitDeoptimizeIf(Node* node) {
-  DeoptimizeParameters p = DeoptimizeParametersOf(node->op());
-  FlagsContinuation cont = FlagsContinuation::ForDeoptimize(
-      kNotEqual, p.kind(), p.reason(), p.feedback(), node->InputAt(1));
-  VisitWordCompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitDeoptimizeUnless(Node* node) {
-  DeoptimizeParameters p = DeoptimizeParametersOf(node->op());
-  FlagsContinuation cont = FlagsContinuation::ForDeoptimize(
-      kEqual, p.kind(), p.reason(), p.feedback(), node->InputAt(1));
-  VisitWordCompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitTrapIf(Node* node, Runtime::FunctionId func_id) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForTrap(kNotEqual, func_id, node->InputAt(1));
-  VisitWordCompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitTrapUnless(Node* node,
-                                          Runtime::FunctionId func_id) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForTrap(kEqual, func_id, node->InputAt(1));
-  VisitWordCompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitSwitch(Node* node, const SwitchInfo& sw) {
-  ArmOperandGenerator g(this);
-  InstructionOperand value_operand = g.UseRegister(node->InputAt(0));
-
-  // Emit either ArchTableSwitch or ArchLookupSwitch.
-  static const size_t kMaxTableSwitchValueRange = 2 << 16;
-  size_t table_space_cost = 4 + sw.value_range;
-  size_t table_time_cost = 3;
-  size_t lookup_space_cost = 3 + 2 * sw.case_count;
-  size_t lookup_time_cost = sw.case_count;
-  if (sw.case_count > 0 &&
-      table_space_cost + 3 * table_time_cost <=
-          lookup_space_cost + 3 * lookup_time_cost &&
-      sw.min_value > std::numeric_limits<int32_t>::min() &&
-      sw.value_range <= kMaxTableSwitchValueRange) {
-    InstructionOperand index_operand = value_operand;
-    if (sw.min_value) {
-      index_operand = g.TempRegister();
-      Emit(kArmSub | AddressingModeField::encode(kMode_Operand2_I),
-           index_operand, value_operand, g.TempImmediate(sw.min_value));
-    }
-    // Generate a table lookup.
-    return EmitTableSwitch(sw, index_operand);
-  }
-
-  // Generate a sequence of conditional jumps.
-  return EmitLookupSwitch(sw, value_operand);
-}
-
-
-void InstructionSelector::VisitWord32Equal(Node* const node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
-  Int32BinopMatcher m(node);
-  if (m.right().Is(0)) {
-    return VisitWordCompareZero(this, m.node(), m.left().node(), &cont);
-  }
-  VisitWordCompare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitInt32LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kSignedLessThan, node);
-  VisitWordCompare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitInt32LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kSignedLessThanOrEqual, node);
-  VisitWordCompare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitUint32LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kUnsignedLessThan, node);
-  VisitWordCompare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitUint32LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedLessThanOrEqual, node);
-  VisitWordCompare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitInt32AddWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    return VisitBinop(this, node, kArmAdd, kArmAdd, &cont);
-  }
-  FlagsContinuation cont;
-  VisitBinop(this, node, kArmAdd, kArmAdd, &cont);
-}
-
-void InstructionSelector::VisitInt32SubWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    return VisitBinop(this, node, kArmSub, kArmRsb, &cont);
-  }
-  FlagsContinuation cont;
-  VisitBinop(this, node, kArmSub, kArmRsb, &cont);
-}
-
-void InstructionSelector::VisitInt32MulWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    // ARM doesn't set the overflow flag for multiplication, so we need to test
-    // on kNotEqual. Here is the code sequence used:
-    //   smull resultlow, resulthigh, left, right
-    //   cmp resulthigh, Operand(resultlow, ASR, 31)
-    FlagsContinuation cont = FlagsContinuation::ForSet(kNotEqual, ovf);
-    return EmitInt32MulWithOverflow(this, node, &cont);
-  }
-  FlagsContinuation cont;
-  EmitInt32MulWithOverflow(this, node, &cont);
-}
-
-void InstructionSelector::VisitFloat32Equal(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
-  VisitFloat32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat32LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kFloatLessThan, node);
-  VisitFloat32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat32LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kFloatLessThanOrEqual, node);
-  VisitFloat32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat64Equal(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
-  VisitFloat64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat64LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kFloatLessThan, node);
-  VisitFloat64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kFloatLessThanOrEqual, node);
-  VisitFloat64Compare(this, node, &cont);
-}
-
-void InstructionSelector::VisitFloat64InsertLowWord32(Node* node) {
-  ArmOperandGenerator g(this);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-  if (left->opcode() == IrOpcode::kFloat64InsertHighWord32 &&
-      CanCover(node, left)) {
-    left = left->InputAt(1);
-    Emit(kArmVmovF64U32U32, g.DefineAsRegister(node), g.UseRegister(right),
-         g.UseRegister(left));
-    return;
-  }
-  Emit(kArmVmovLowF64U32, g.DefineSameAsFirst(node), g.UseRegister(left),
-       g.UseRegister(right));
-}
-
-
-void InstructionSelector::VisitFloat64InsertHighWord32(Node* node) {
-  ArmOperandGenerator g(this);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-  if (left->opcode() == IrOpcode::kFloat64InsertLowWord32 &&
-      CanCover(node, left)) {
-    left = left->InputAt(1);
-    Emit(kArmVmovF64U32U32, g.DefineAsRegister(node), g.UseRegister(left),
-         g.UseRegister(right));
-    return;
-  }
-  Emit(kArmVmovHighF64U32, g.DefineSameAsFirst(node), g.UseRegister(left),
-       g.UseRegister(right));
-}
-
-void InstructionSelector::VisitAtomicLoad(Node* node) {
-  LoadRepresentation load_rep = LoadRepresentationOf(node->op());
-  ArmOperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  ArchOpcode opcode = kArchNop;
-  switch (load_rep.representation()) {
-    case MachineRepresentation::kWord8:
-      opcode = load_rep.IsSigned() ? kAtomicLoadInt8 : kAtomicLoadUint8;
-      break;
-    case MachineRepresentation::kWord16:
-      opcode = load_rep.IsSigned() ? kAtomicLoadInt16 : kAtomicLoadUint16;
-      break;
-    case MachineRepresentation::kWord32:
-      opcode = kAtomicLoadWord32;
-      break;
-    default:
-      UNREACHABLE();
-      return;
-  }
-  Emit(opcode | AddressingModeField::encode(kMode_Offset_RR),
-       g.DefineAsRegister(node), g.UseRegister(base), g.UseRegister(index));
-}
-
-void InstructionSelector::VisitAtomicStore(Node* node) {
-  MachineRepresentation rep = AtomicStoreRepresentationOf(node->op());
-  ArmOperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-  ArchOpcode opcode = kArchNop;
-  switch (rep) {
-    case MachineRepresentation::kWord8:
-      opcode = kAtomicStoreWord8;
-      break;
-    case MachineRepresentation::kWord16:
-      opcode = kAtomicStoreWord16;
-      break;
-    case MachineRepresentation::kWord32:
-      opcode = kAtomicStoreWord32;
-      break;
-    default:
-      UNREACHABLE();
-      return;
-  }
-
-  AddressingMode addressing_mode = kMode_Offset_RR;
-  InstructionOperand inputs[4];
-  size_t input_count = 0;
-  inputs[input_count++] = g.UseUniqueRegister(base);
-  inputs[input_count++] = g.UseUniqueRegister(index);
-  inputs[input_count++] = g.UseUniqueRegister(value);
-  InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
-  Emit(code, 0, nullptr, input_count, inputs);
-}
-
-void InstructionSelector::VisitAtomicExchange(Node* node) {
-  ArmOperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-  ArchOpcode opcode = kArchNop;
-  MachineType type = AtomicOpRepresentationOf(node->op());
-  if (type == MachineType::Int8()) {
-    opcode = kAtomicExchangeInt8;
-  } else if (type == MachineType::Uint8()) {
-    opcode = kAtomicExchangeUint8;
-  } else if (type == MachineType::Int16()) {
-    opcode = kAtomicExchangeInt16;
-  } else if (type == MachineType::Uint16()) {
-    opcode = kAtomicExchangeUint16;
-  } else if (type == MachineType::Int32() || type == MachineType::Uint32()) {
-    opcode = kAtomicExchangeWord32;
-  } else {
-    UNREACHABLE();
-    return;
-  }
-
-  AddressingMode addressing_mode = kMode_Offset_RR;
-  InstructionOperand inputs[3];
-  size_t input_count = 0;
-  inputs[input_count++] = g.UseRegister(base);
-  inputs[input_count++] = g.UseRegister(index);
-  inputs[input_count++] = g.UseUniqueRegister(value);
-  InstructionOperand outputs[1];
-  outputs[0] = g.DefineAsRegister(node);
-  InstructionOperand temps[] = {g.TempRegister(), g.TempRegister()};
-  InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
-  Emit(code, 1, outputs, input_count, inputs, arraysize(temps), temps);
-}
-
-void InstructionSelector::VisitAtomicCompareExchange(Node* node) {
-  ArmOperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* old_value = node->InputAt(2);
-  Node* new_value = node->InputAt(3);
-  ArchOpcode opcode = kArchNop;
-  MachineType type = AtomicOpRepresentationOf(node->op());
-  if (type == MachineType::Int8()) {
-    opcode = kAtomicCompareExchangeInt8;
-  } else if (type == MachineType::Uint8()) {
-    opcode = kAtomicCompareExchangeUint8;
-  } else if (type == MachineType::Int16()) {
-    opcode = kAtomicCompareExchangeInt16;
-  } else if (type == MachineType::Uint16()) {
-    opcode = kAtomicCompareExchangeUint16;
-  } else if (type == MachineType::Int32() || type == MachineType::Uint32()) {
-    opcode = kAtomicCompareExchangeWord32;
-  } else {
-    UNREACHABLE();
-    return;
-  }
-
-  AddressingMode addressing_mode = kMode_Offset_RR;
-  InstructionOperand inputs[4];
-  size_t input_count = 0;
-  inputs[input_count++] = g.UseRegister(base);
-  inputs[input_count++] = g.UseRegister(index);
-  inputs[input_count++] = g.UseUniqueRegister(old_value);
-  inputs[input_count++] = g.UseUniqueRegister(new_value);
-  InstructionOperand outputs[1];
-  outputs[0] = g.DefineAsRegister(node);
-  InstructionOperand temps[] = {g.TempRegister(), g.TempRegister(),
-                                g.TempRegister()};
-  InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
-  Emit(code, 1, outputs, input_count, inputs, arraysize(temps), temps);
-}
-
-void InstructionSelector::VisitAtomicBinaryOperation(
-    Node* node, ArchOpcode int8_op, ArchOpcode uint8_op, ArchOpcode int16_op,
-    ArchOpcode uint16_op, ArchOpcode word32_op) {
-  ArmOperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-  ArchOpcode opcode = kArchNop;
-  MachineType type = AtomicOpRepresentationOf(node->op());
-  if (type == MachineType::Int8()) {
-    opcode = int8_op;
-  } else if (type == MachineType::Uint8()) {
-    opcode = uint8_op;
-  } else if (type == MachineType::Int16()) {
-    opcode = int16_op;
-  } else if (type == MachineType::Uint16()) {
-    opcode = uint16_op;
-  } else if (type == MachineType::Int32() || type == MachineType::Uint32()) {
-    opcode = word32_op;
-  } else {
-    UNREACHABLE();
-    return;
-  }
-
-  AddressingMode addressing_mode = kMode_Offset_RR;
-  InstructionOperand inputs[3];
-  size_t input_count = 0;
-  inputs[input_count++] = g.UseRegister(base);
-  inputs[input_count++] = g.UseRegister(index);
-  inputs[input_count++] = g.UseUniqueRegister(value);
-  InstructionOperand outputs[1];
-  outputs[0] = g.DefineAsRegister(node);
-  InstructionOperand temps[] = {g.TempRegister(), g.TempRegister(),
-                                g.TempRegister()};
-  InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
-  Emit(code, 1, outputs, input_count, inputs, arraysize(temps), temps);
-}
-
-#define VISIT_ATOMIC_BINOP(op)                                              \
-  void InstructionSelector::VisitAtomic##op(Node* node) {                   \
-    VisitAtomicBinaryOperation(node, kAtomic##op##Int8, kAtomic##op##Uint8, \
-                               kAtomic##op##Int16, kAtomic##op##Uint16,     \
-                               kAtomic##op##Word32);                        \
-  }
-VISIT_ATOMIC_BINOP(Add)
-VISIT_ATOMIC_BINOP(Sub)
-VISIT_ATOMIC_BINOP(And)
-VISIT_ATOMIC_BINOP(Or)
-VISIT_ATOMIC_BINOP(Xor)
-#undef VISIT_ATOMIC_BINOP
-
-#define SIMD_TYPE_LIST(V) \
-  V(F32x4)                \
-  V(I32x4)                \
-  V(I16x8)                \
-  V(I8x16)
-
-#define SIMD_FORMAT_LIST(V) \
-  V(32x4, 4)                \
-  V(16x8, 8)                \
-  V(8x16, 16)
-
-#define SIMD_UNOP_LIST(V)                               \
-  V(F32x4SConvertI32x4, kArmF32x4SConvertI32x4)         \
-  V(F32x4UConvertI32x4, kArmF32x4UConvertI32x4)         \
-  V(F32x4Abs, kArmF32x4Abs)                             \
-  V(F32x4Neg, kArmF32x4Neg)                             \
-  V(F32x4RecipApprox, kArmF32x4RecipApprox)             \
-  V(F32x4RecipSqrtApprox, kArmF32x4RecipSqrtApprox)     \
-  V(I32x4SConvertF32x4, kArmI32x4SConvertF32x4)         \
-  V(I32x4SConvertI16x8Low, kArmI32x4SConvertI16x8Low)   \
-  V(I32x4SConvertI16x8High, kArmI32x4SConvertI16x8High) \
-  V(I32x4Neg, kArmI32x4Neg)                             \
-  V(I32x4UConvertF32x4, kArmI32x4UConvertF32x4)         \
-  V(I32x4UConvertI16x8Low, kArmI32x4UConvertI16x8Low)   \
-  V(I32x4UConvertI16x8High, kArmI32x4UConvertI16x8High) \
-  V(I16x8SConvertI8x16Low, kArmI16x8SConvertI8x16Low)   \
-  V(I16x8SConvertI8x16High, kArmI16x8SConvertI8x16High) \
-  V(I16x8Neg, kArmI16x8Neg)                             \
-  V(I16x8UConvertI8x16Low, kArmI16x8UConvertI8x16Low)   \
-  V(I16x8UConvertI8x16High, kArmI16x8UConvertI8x16High) \
-  V(I8x16Neg, kArmI8x16Neg)                             \
-  V(S128Not, kArmS128Not)                               \
-  V(S1x4AnyTrue, kArmS1x4AnyTrue)                       \
-  V(S1x4AllTrue, kArmS1x4AllTrue)                       \
-  V(S1x8AnyTrue, kArmS1x8AnyTrue)                       \
-  V(S1x8AllTrue, kArmS1x8AllTrue)                       \
-  V(S1x16AnyTrue, kArmS1x16AnyTrue)                     \
-  V(S1x16AllTrue, kArmS1x16AllTrue)
-
-#define SIMD_SHIFT_OP_LIST(V) \
-  V(I32x4Shl)                 \
-  V(I32x4ShrS)                \
-  V(I32x4ShrU)                \
-  V(I16x8Shl)                 \
-  V(I16x8ShrS)                \
-  V(I16x8ShrU)                \
-  V(I8x16Shl)                 \
-  V(I8x16ShrS)                \
-  V(I8x16ShrU)
-
-#define SIMD_BINOP_LIST(V)                      \
-  V(F32x4Add, kArmF32x4Add)                     \
-  V(F32x4AddHoriz, kArmF32x4AddHoriz)           \
-  V(F32x4Sub, kArmF32x4Sub)                     \
-  V(F32x4Mul, kArmF32x4Mul)                     \
-  V(F32x4Min, kArmF32x4Min)                     \
-  V(F32x4Max, kArmF32x4Max)                     \
-  V(F32x4Eq, kArmF32x4Eq)                       \
-  V(F32x4Ne, kArmF32x4Ne)                       \
-  V(F32x4Lt, kArmF32x4Lt)                       \
-  V(F32x4Le, kArmF32x4Le)                       \
-  V(I32x4Add, kArmI32x4Add)                     \
-  V(I32x4AddHoriz, kArmI32x4AddHoriz)           \
-  V(I32x4Sub, kArmI32x4Sub)                     \
-  V(I32x4Mul, kArmI32x4Mul)                     \
-  V(I32x4MinS, kArmI32x4MinS)                   \
-  V(I32x4MaxS, kArmI32x4MaxS)                   \
-  V(I32x4Eq, kArmI32x4Eq)                       \
-  V(I32x4Ne, kArmI32x4Ne)                       \
-  V(I32x4GtS, kArmI32x4GtS)                     \
-  V(I32x4GeS, kArmI32x4GeS)                     \
-  V(I32x4MinU, kArmI32x4MinU)                   \
-  V(I32x4MaxU, kArmI32x4MaxU)                   \
-  V(I32x4GtU, kArmI32x4GtU)                     \
-  V(I32x4GeU, kArmI32x4GeU)                     \
-  V(I16x8SConvertI32x4, kArmI16x8SConvertI32x4) \
-  V(I16x8Add, kArmI16x8Add)                     \
-  V(I16x8AddSaturateS, kArmI16x8AddSaturateS)   \
-  V(I16x8AddHoriz, kArmI16x8AddHoriz)           \
-  V(I16x8Sub, kArmI16x8Sub)                     \
-  V(I16x8SubSaturateS, kArmI16x8SubSaturateS)   \
-  V(I16x8Mul, kArmI16x8Mul)                     \
-  V(I16x8MinS, kArmI16x8MinS)                   \
-  V(I16x8MaxS, kArmI16x8MaxS)                   \
-  V(I16x8Eq, kArmI16x8Eq)                       \
-  V(I16x8Ne, kArmI16x8Ne)                       \
-  V(I16x8GtS, kArmI16x8GtS)                     \
-  V(I16x8GeS, kArmI16x8GeS)                     \
-  V(I16x8UConvertI32x4, kArmI16x8UConvertI32x4) \
-  V(I16x8AddSaturateU, kArmI16x8AddSaturateU)   \
-  V(I16x8SubSaturateU, kArmI16x8SubSaturateU)   \
-  V(I16x8MinU, kArmI16x8MinU)                   \
-  V(I16x8MaxU, kArmI16x8MaxU)                   \
-  V(I16x8GtU, kArmI16x8GtU)                     \
-  V(I16x8GeU, kArmI16x8GeU)                     \
-  V(I8x16SConvertI16x8, kArmI8x16SConvertI16x8) \
-  V(I8x16Add, kArmI8x16Add)                     \
-  V(I8x16AddSaturateS, kArmI8x16AddSaturateS)   \
-  V(I8x16Sub, kArmI8x16Sub)                     \
-  V(I8x16SubSaturateS, kArmI8x16SubSaturateS)   \
-  V(I8x16Mul, kArmI8x16Mul)                     \
-  V(I8x16MinS, kArmI8x16MinS)                   \
-  V(I8x16MaxS, kArmI8x16MaxS)                   \
-  V(I8x16Eq, kArmI8x16Eq)                       \
-  V(I8x16Ne, kArmI8x16Ne)                       \
-  V(I8x16GtS, kArmI8x16GtS)                     \
-  V(I8x16GeS, kArmI8x16GeS)                     \
-  V(I8x16UConvertI16x8, kArmI8x16UConvertI16x8) \
-  V(I8x16AddSaturateU, kArmI8x16AddSaturateU)   \
-  V(I8x16SubSaturateU, kArmI8x16SubSaturateU)   \
-  V(I8x16MinU, kArmI8x16MinU)                   \
-  V(I8x16MaxU, kArmI8x16MaxU)                   \
-  V(I8x16GtU, kArmI8x16GtU)                     \
-  V(I8x16GeU, kArmI8x16GeU)                     \
-  V(S128And, kArmS128And)                       \
-  V(S128Or, kArmS128Or)                         \
-  V(S128Xor, kArmS128Xor)
-
-void InstructionSelector::VisitS128Zero(Node* node) {
-  ArmOperandGenerator g(this);
-  Emit(kArmS128Zero, g.DefineAsRegister(node), g.DefineAsRegister(node));
-}
-
-#define SIMD_VISIT_SPLAT(Type)                               \
-  void InstructionSelector::Visit##Type##Splat(Node* node) { \
-    VisitRR(this, kArm##Type##Splat, node);                  \
-  }
-SIMD_TYPE_LIST(SIMD_VISIT_SPLAT)
-#undef SIMD_VISIT_SPLAT
-
-#define SIMD_VISIT_EXTRACT_LANE(Type)                              \
-  void InstructionSelector::Visit##Type##ExtractLane(Node* node) { \
-    VisitRRI(this, kArm##Type##ExtractLane, node);                 \
-  }
-SIMD_TYPE_LIST(SIMD_VISIT_EXTRACT_LANE)
-#undef SIMD_VISIT_EXTRACT_LANE
-
-#define SIMD_VISIT_REPLACE_LANE(Type)                              \
-  void InstructionSelector::Visit##Type##ReplaceLane(Node* node) { \
-    VisitRRIR(this, kArm##Type##ReplaceLane, node);                \
-  }
-SIMD_TYPE_LIST(SIMD_VISIT_REPLACE_LANE)
-#undef SIMD_VISIT_REPLACE_LANE
-
-#define SIMD_VISIT_UNOP(Name, instruction)            \
-  void InstructionSelector::Visit##Name(Node* node) { \
-    VisitRR(this, instruction, node);                 \
-  }
-SIMD_UNOP_LIST(SIMD_VISIT_UNOP)
-#undef SIMD_VISIT_UNOP
-
-#define SIMD_VISIT_SHIFT_OP(Name)                     \
-  void InstructionSelector::Visit##Name(Node* node) { \
-    VisitRRI(this, kArm##Name, node);                 \
-  }
-SIMD_SHIFT_OP_LIST(SIMD_VISIT_SHIFT_OP)
-#undef SIMD_VISIT_SHIFT_OP
-
-#define SIMD_VISIT_BINOP(Name, instruction)           \
-  void InstructionSelector::Visit##Name(Node* node) { \
-    VisitRRR(this, instruction, node);                \
-  }
-SIMD_BINOP_LIST(SIMD_VISIT_BINOP)
-#undef SIMD_VISIT_BINOP
-
-void InstructionSelector::VisitS128Select(Node* node) {
-  ArmOperandGenerator g(this);
-  Emit(kArmS128Select, g.DefineSameAsFirst(node),
-       g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)),
-       g.UseRegister(node->InputAt(2)));
-}
-
-namespace {
-
-struct ShuffleEntry {
-  uint8_t shuffle[kSimd128Size];
-  ArchOpcode opcode;
-};
-
-static const ShuffleEntry arch_shuffles[] = {
-    {{0, 1, 2, 3, 16, 17, 18, 19, 4, 5, 6, 7, 20, 21, 22, 23},
-     kArmS32x4ZipLeft},
-    {{8, 9, 10, 11, 24, 25, 26, 27, 12, 13, 14, 15, 28, 29, 30, 31},
-     kArmS32x4ZipRight},
-    {{0, 1, 2, 3, 8, 9, 10, 11, 16, 17, 18, 19, 24, 25, 26, 27},
-     kArmS32x4UnzipLeft},
-    {{4, 5, 6, 7, 12, 13, 14, 15, 20, 21, 22, 23, 28, 29, 30, 31},
-     kArmS32x4UnzipRight},
-    {{0, 1, 2, 3, 16, 17, 18, 19, 8, 9, 10, 11, 24, 25, 26, 27},
-     kArmS32x4TransposeLeft},
-    {{4, 5, 6, 7, 20, 21, 22, 23, 12, 13, 14, 15, 28, 29, 30, 31},
-     kArmS32x4TransposeRight},
-    {{4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15, 8, 9, 10, 11}, kArmS32x2Reverse},
-
-    {{0, 1, 16, 17, 2, 3, 18, 19, 4, 5, 20, 21, 6, 7, 22, 23},
-     kArmS16x8ZipLeft},
-    {{8, 9, 24, 25, 10, 11, 26, 27, 12, 13, 28, 29, 14, 15, 30, 31},
-     kArmS16x8ZipRight},
-    {{0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29},
-     kArmS16x8UnzipLeft},
-    {{2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31},
-     kArmS16x8UnzipRight},
-    {{0, 1, 16, 17, 4, 5, 20, 21, 8, 9, 24, 25, 12, 13, 28, 29},
-     kArmS16x8TransposeLeft},
-    {{2, 3, 18, 19, 6, 7, 22, 23, 10, 11, 26, 27, 14, 15, 30, 31},
-     kArmS16x8TransposeRight},
-    {{6, 7, 4, 5, 2, 3, 0, 1, 14, 15, 12, 13, 10, 11, 8, 9}, kArmS16x4Reverse},
-    {{2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 8, 9, 14, 15, 12, 13}, kArmS16x2Reverse},
-
-    {{0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7, 23},
-     kArmS8x16ZipLeft},
-    {{8, 24, 9, 25, 10, 26, 11, 27, 12, 28, 13, 29, 14, 30, 15, 31},
-     kArmS8x16ZipRight},
-    {{0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30},
-     kArmS8x16UnzipLeft},
-    {{1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31},
-     kArmS8x16UnzipRight},
-    {{0, 16, 2, 18, 4, 20, 6, 22, 8, 24, 10, 26, 12, 28, 14, 30},
-     kArmS8x16TransposeLeft},
-    {{1, 17, 3, 19, 5, 21, 7, 23, 9, 25, 11, 27, 13, 29, 15, 31},
-     kArmS8x16TransposeRight},
-    {{7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8}, kArmS8x8Reverse},
-    {{3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12}, kArmS8x4Reverse},
-    {{1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14}, kArmS8x2Reverse}};
-
-bool TryMatchArchShuffle(const uint8_t* shuffle, const ShuffleEntry* table,
-                         size_t num_entries, uint8_t mask, ArchOpcode* opcode) {
-  for (size_t i = 0; i < num_entries; ++i) {
-    const ShuffleEntry& entry = table[i];
-    int j = 0;
-    for (; j < kSimd128Size; ++j) {
-      if ((entry.shuffle[j] & mask) != (shuffle[j] & mask)) {
-        break;
-      }
-    }
-    if (j == kSimd128Size) {
-      *opcode = entry.opcode;
-      return true;
-    }
-  }
-  return false;
-}
-
-void ArrangeShuffleTable(ArmOperandGenerator* g, Node* input0, Node* input1,
-                         InstructionOperand* src0, InstructionOperand* src1) {
-  if (input0 == input1) {
-    // Unary, any q-register can be the table.
-    *src0 = *src1 = g->UseRegister(input0);
-  } else {
-    // Binary, table registers must be consecutive.
-    *src0 = g->UseFixed(input0, q0);
-    *src1 = g->UseFixed(input1, q1);
-  }
-}
-
-}  // namespace
-
-void InstructionSelector::VisitS8x16Shuffle(Node* node) {
-  const uint8_t* shuffle = OpParameter<uint8_t*>(node);
-  uint8_t mask = CanonicalizeShuffle(node);
-  uint8_t shuffle32x4[4];
-  ArmOperandGenerator g(this);
-  int index = 0;
-  if (TryMatch32x4Shuffle(shuffle, shuffle32x4)) {
-    if (TryMatchDup<4>(shuffle, &index)) {
-      InstructionOperand src = index < 4 ? g.UseRegister(node->InputAt(0))
-                                         : g.UseRegister(node->InputAt(1));
-      Emit(kArmS128Dup, g.DefineAsRegister(node), src, g.UseImmediate(Neon32),
-           g.UseImmediate(index % 4));
-    } else {
-      Emit(kArmS32x4Shuffle, g.DefineAsRegister(node),
-           g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)),
-           g.UseImmediate(Pack4Lanes(shuffle32x4, mask)));
-    }
-    return;
-  }
-  if (TryMatchDup<8>(shuffle, &index)) {
-    InstructionOperand src = index < 8 ? g.UseRegister(node->InputAt(0))
-                                       : g.UseRegister(node->InputAt(1));
-    Emit(kArmS128Dup, g.DefineAsRegister(node), src, g.UseImmediate(Neon16),
-         g.UseImmediate(index % 8));
-    return;
-  }
-  if (TryMatchDup<16>(shuffle, &index)) {
-    InstructionOperand src = index < 16 ? g.UseRegister(node->InputAt(0))
-                                        : g.UseRegister(node->InputAt(1));
-    Emit(kArmS128Dup, g.DefineAsRegister(node), src, g.UseImmediate(Neon8),
-         g.UseImmediate(index % 16));
-    return;
-  }
-  ArchOpcode opcode;
-  if (TryMatchArchShuffle(shuffle, arch_shuffles, arraysize(arch_shuffles),
-                          mask, &opcode)) {
-    VisitRRRShuffle(this, opcode, node);
-    return;
-  }
-  Node* input0 = node->InputAt(0);
-  Node* input1 = node->InputAt(1);
-  uint8_t offset;
-  if (TryMatchConcat(shuffle, mask, &offset)) {
-    Emit(kArmS8x16Concat, g.DefineAsRegister(node), g.UseRegister(input0),
-         g.UseRegister(input1), g.UseImmediate(offset));
-    return;
-  }
-  // Code generator uses vtbl, arrange sources to form a valid lookup table.
-  InstructionOperand src0, src1;
-  ArrangeShuffleTable(&g, input0, input1, &src0, &src1);
-  Emit(kArmS8x16Shuffle, g.DefineAsRegister(node), src0, src1,
-       g.UseImmediate(Pack4Lanes(shuffle, mask)),
-       g.UseImmediate(Pack4Lanes(shuffle + 4, mask)),
-       g.UseImmediate(Pack4Lanes(shuffle + 8, mask)),
-       g.UseImmediate(Pack4Lanes(shuffle + 12, mask)));
-}
-
-void InstructionSelector::VisitInt32AbsWithOverflow(Node* node) {
-  UNREACHABLE();
-}
-
-void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) {
-  UNREACHABLE();
-}
-
-// static
-MachineOperatorBuilder::Flags
-InstructionSelector::SupportedMachineOperatorFlags() {
-  MachineOperatorBuilder::Flags flags;
-  if (CpuFeatures::IsSupported(SUDIV)) {
-    // The sdiv and udiv instructions correctly return 0 if the divisor is 0,
-    // but the fall-back implementation does not.
-    flags |= MachineOperatorBuilder::kInt32DivIsSafe |
-             MachineOperatorBuilder::kUint32DivIsSafe;
-  }
-  if (CpuFeatures::IsSupported(ARMv7)) {
-    flags |= MachineOperatorBuilder::kWord32ReverseBits;
-  }
-  if (CpuFeatures::IsSupported(ARMv8)) {
-    flags |= MachineOperatorBuilder::kFloat32RoundDown |
-             MachineOperatorBuilder::kFloat64RoundDown |
-             MachineOperatorBuilder::kFloat32RoundUp |
-             MachineOperatorBuilder::kFloat64RoundUp |
-             MachineOperatorBuilder::kFloat32RoundTruncate |
-             MachineOperatorBuilder::kFloat64RoundTruncate |
-             MachineOperatorBuilder::kFloat64RoundTiesAway |
-             MachineOperatorBuilder::kFloat32RoundTiesEven |
-             MachineOperatorBuilder::kFloat64RoundTiesEven;
-  }
-  return flags;
-}
-
-// static
-MachineOperatorBuilder::AlignmentRequirements
-InstructionSelector::AlignmentRequirements() {
-  EnumSet<MachineRepresentation> req_aligned;
-  req_aligned.Add(MachineRepresentation::kFloat32);
-  req_aligned.Add(MachineRepresentation::kFloat64);
-  return MachineOperatorBuilder::AlignmentRequirements::
-      SomeUnalignedAccessUnsupported(req_aligned, req_aligned);
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/arm/unwinding-info-writer-arm.cc b/src/v8/src/compiler/arm/unwinding-info-writer-arm.cc
deleted file mode 100644
index 579e5c7..0000000
--- a/src/v8/src/compiler/arm/unwinding-info-writer-arm.cc
+++ /dev/null
@@ -1,109 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/compiler/arm/unwinding-info-writer-arm.h"
-#include "src/compiler/instruction.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-void UnwindingInfoWriter::BeginInstructionBlock(int pc_offset,
-                                                const InstructionBlock* block) {
-  if (!enabled()) return;
-
-  block_will_exit_ = false;
-
-  DCHECK_LT(block->rpo_number().ToInt(),
-            static_cast<int>(block_initial_states_.size()));
-  const BlockInitialState* initial_state =
-      block_initial_states_[block->rpo_number().ToInt()];
-  if (initial_state) {
-    if (initial_state->saved_lr_ != saved_lr_) {
-      eh_frame_writer_.AdvanceLocation(pc_offset);
-      if (initial_state->saved_lr_) {
-        eh_frame_writer_.RecordRegisterSavedToStack(lr, kPointerSize);
-      } else {
-        eh_frame_writer_.RecordRegisterFollowsInitialRule(lr);
-      }
-      saved_lr_ = initial_state->saved_lr_;
-    }
-  } else {
-    // The entry block always lacks an explicit initial state.
-    // The exit block may lack an explicit state, if it is only reached by
-    //   the block ending in a bx lr.
-    // All the other blocks must have an explicit initial state.
-    DCHECK(block->predecessors().empty() || block->successors().empty());
-  }
-}
-
-void UnwindingInfoWriter::EndInstructionBlock(const InstructionBlock* block) {
-  if (!enabled() || block_will_exit_) return;
-
-  for (const RpoNumber& successor : block->successors()) {
-    int successor_index = successor.ToInt();
-    DCHECK_LT(successor_index, static_cast<int>(block_initial_states_.size()));
-    const BlockInitialState* existing_state =
-        block_initial_states_[successor_index];
-
-    // If we already had an entry for this BB, check that the values are the
-    // same we are trying to insert.
-    if (existing_state) {
-      DCHECK_EQ(existing_state->saved_lr_, saved_lr_);
-    } else {
-      block_initial_states_[successor_index] =
-          new (zone_) BlockInitialState(saved_lr_);
-    }
-  }
-}
-
-void UnwindingInfoWriter::MarkFrameConstructed(int at_pc) {
-  if (!enabled()) return;
-
-  // Regardless of the type of frame constructed, the relevant part of the
-  // layout is always the one in the diagram:
-  //
-  // |   ....   |         higher addresses
-  // +----------+               ^
-  // |    LR    |               |            |
-  // +----------+               |            |
-  // | saved FP |               |            |
-  // +----------+ <-- FP                     v
-  // |   ....   |                       stack growth
-  //
-  // The LR is pushed on the stack, and we can record this fact at the end of
-  // the construction, since the LR itself is not modified in the process.
-  eh_frame_writer_.AdvanceLocation(at_pc);
-  eh_frame_writer_.RecordRegisterSavedToStack(lr, kPointerSize);
-  saved_lr_ = true;
-}
-
-void UnwindingInfoWriter::MarkFrameDeconstructed(int at_pc) {
-  if (!enabled()) return;
-
-  // The lr is restored by the last operation in LeaveFrame().
-  eh_frame_writer_.AdvanceLocation(at_pc);
-  eh_frame_writer_.RecordRegisterFollowsInitialRule(lr);
-  saved_lr_ = false;
-}
-
-void UnwindingInfoWriter::MarkLinkRegisterOnTopOfStack(int pc_offset) {
-  if (!enabled()) return;
-
-  eh_frame_writer_.AdvanceLocation(pc_offset);
-  eh_frame_writer_.SetBaseAddressRegisterAndOffset(sp, 0);
-  eh_frame_writer_.RecordRegisterSavedToStack(lr, 0);
-}
-
-void UnwindingInfoWriter::MarkPopLinkRegisterFromTopOfStack(int pc_offset) {
-  if (!enabled()) return;
-
-  eh_frame_writer_.AdvanceLocation(pc_offset);
-  eh_frame_writer_.SetBaseAddressRegisterAndOffset(fp, 0);
-  eh_frame_writer_.RecordRegisterFollowsInitialRule(lr);
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/arm/unwinding-info-writer-arm.h b/src/v8/src/compiler/arm/unwinding-info-writer-arm.h
deleted file mode 100644
index d47ca08..0000000
--- a/src/v8/src/compiler/arm/unwinding-info-writer-arm.h
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_ARM_UNWINDING_INFO_WRITER_H_
-#define V8_COMPILER_ARM_UNWINDING_INFO_WRITER_H_
-
-#include "src/eh-frame.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-class InstructionBlock;
-
-class UnwindingInfoWriter {
- public:
-  explicit UnwindingInfoWriter(Zone* zone)
-      : zone_(zone),
-        eh_frame_writer_(zone),
-        saved_lr_(false),
-        block_will_exit_(false),
-        block_initial_states_(zone) {
-    if (enabled()) eh_frame_writer_.Initialize();
-  }
-
-  void SetNumberOfInstructionBlocks(int number) {
-    if (enabled()) block_initial_states_.resize(number);
-  }
-
-  void BeginInstructionBlock(int pc_offset, const InstructionBlock* block);
-  void EndInstructionBlock(const InstructionBlock* block);
-
-  void MarkLinkRegisterOnTopOfStack(int pc_offset);
-  void MarkPopLinkRegisterFromTopOfStack(int pc_offset);
-
-  void MarkFrameConstructed(int at_pc);
-  void MarkFrameDeconstructed(int at_pc);
-
-  void MarkBlockWillExit() { block_will_exit_ = true; }
-
-  void Finish(int code_size) {
-    if (enabled()) eh_frame_writer_.Finish(code_size);
-  }
-
-  EhFrameWriter* eh_frame_writer() {
-    return enabled() ? &eh_frame_writer_ : nullptr;
-  }
-
- private:
-  bool enabled() const { return FLAG_perf_prof_unwinding_info; }
-
-  class BlockInitialState : public ZoneObject {
-   public:
-    explicit BlockInitialState(bool saved_lr) : saved_lr_(saved_lr) {}
-
-    bool saved_lr_;
-  };
-
-  Zone* zone_;
-  EhFrameWriter eh_frame_writer_;
-  bool saved_lr_;
-  bool block_will_exit_;
-
-  ZoneVector<const BlockInitialState*> block_initial_states_;
-};
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif
diff --git a/src/v8/src/compiler/arm64/code-generator-arm64.cc b/src/v8/src/compiler/arm64/code-generator-arm64.cc
deleted file mode 100644
index 147d85a..0000000
--- a/src/v8/src/compiler/arm64/code-generator-arm64.cc
+++ /dev/null
@@ -1,2688 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/compiler/code-generator.h"
-
-#include "src/arm64/assembler-arm64-inl.h"
-#include "src/arm64/macro-assembler-arm64-inl.h"
-#include "src/compilation-info.h"
-#include "src/compiler/code-generator-impl.h"
-#include "src/compiler/gap-resolver.h"
-#include "src/compiler/node-matchers.h"
-#include "src/compiler/osr.h"
-#include "src/frame-constants.h"
-#include "src/heap/heap-inl.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-#define __ tasm()->
-
-// Adds Arm64-specific methods to convert InstructionOperands.
-class Arm64OperandConverter final : public InstructionOperandConverter {
- public:
-  Arm64OperandConverter(CodeGenerator* gen, Instruction* instr)
-      : InstructionOperandConverter(gen, instr) {}
-
-  DoubleRegister InputFloat32Register(size_t index) {
-    return InputDoubleRegister(index).S();
-  }
-
-  DoubleRegister InputFloat64Register(size_t index) {
-    return InputDoubleRegister(index);
-  }
-
-  DoubleRegister InputSimd128Register(size_t index) {
-    return InputDoubleRegister(index).Q();
-  }
-
-  CPURegister InputFloat32OrZeroRegister(size_t index) {
-    if (instr_->InputAt(index)->IsImmediate()) {
-      DCHECK_EQ(0, bit_cast<int32_t>(InputFloat32(index)));
-      return wzr;
-    }
-    DCHECK(instr_->InputAt(index)->IsFPRegister());
-    return InputDoubleRegister(index).S();
-  }
-
-  CPURegister InputFloat64OrZeroRegister(size_t index) {
-    if (instr_->InputAt(index)->IsImmediate()) {
-      DCHECK_EQ(0, bit_cast<int64_t>(InputDouble(index)));
-      return xzr;
-    }
-    DCHECK(instr_->InputAt(index)->IsDoubleRegister());
-    return InputDoubleRegister(index);
-  }
-
-  size_t OutputCount() { return instr_->OutputCount(); }
-
-  DoubleRegister OutputFloat32Register() { return OutputDoubleRegister().S(); }
-
-  DoubleRegister OutputFloat64Register() { return OutputDoubleRegister(); }
-
-  DoubleRegister OutputSimd128Register() { return OutputDoubleRegister().Q(); }
-
-  Register InputRegister32(size_t index) {
-    return ToRegister(instr_->InputAt(index)).W();
-  }
-
-  Register InputOrZeroRegister32(size_t index) {
-    DCHECK(instr_->InputAt(index)->IsRegister() ||
-           (instr_->InputAt(index)->IsImmediate() && (InputInt32(index) == 0)));
-    if (instr_->InputAt(index)->IsImmediate()) {
-      return wzr;
-    }
-    return InputRegister32(index);
-  }
-
-  Register InputRegister64(size_t index) { return InputRegister(index); }
-
-  Register InputOrZeroRegister64(size_t index) {
-    DCHECK(instr_->InputAt(index)->IsRegister() ||
-           (instr_->InputAt(index)->IsImmediate() && (InputInt64(index) == 0)));
-    if (instr_->InputAt(index)->IsImmediate()) {
-      return xzr;
-    }
-    return InputRegister64(index);
-  }
-
-  Operand InputOperand(size_t index) {
-    return ToOperand(instr_->InputAt(index));
-  }
-
-  Operand InputOperand64(size_t index) { return InputOperand(index); }
-
-  Operand InputOperand32(size_t index) {
-    return ToOperand32(instr_->InputAt(index));
-  }
-
-  Register OutputRegister64() { return OutputRegister(); }
-
-  Register OutputRegister32() { return ToRegister(instr_->Output()).W(); }
-
-  Register TempRegister32(size_t index) {
-    return ToRegister(instr_->TempAt(index)).W();
-  }
-
-  Operand InputOperand2_32(size_t index) {
-    switch (AddressingModeField::decode(instr_->opcode())) {
-      case kMode_None:
-        return InputOperand32(index);
-      case kMode_Operand2_R_LSL_I:
-        return Operand(InputRegister32(index), LSL, InputInt5(index + 1));
-      case kMode_Operand2_R_LSR_I:
-        return Operand(InputRegister32(index), LSR, InputInt5(index + 1));
-      case kMode_Operand2_R_ASR_I:
-        return Operand(InputRegister32(index), ASR, InputInt5(index + 1));
-      case kMode_Operand2_R_ROR_I:
-        return Operand(InputRegister32(index), ROR, InputInt5(index + 1));
-      case kMode_Operand2_R_UXTB:
-        return Operand(InputRegister32(index), UXTB);
-      case kMode_Operand2_R_UXTH:
-        return Operand(InputRegister32(index), UXTH);
-      case kMode_Operand2_R_SXTB:
-        return Operand(InputRegister32(index), SXTB);
-      case kMode_Operand2_R_SXTH:
-        return Operand(InputRegister32(index), SXTH);
-      case kMode_Operand2_R_SXTW:
-        return Operand(InputRegister32(index), SXTW);
-      case kMode_MRI:
-      case kMode_MRR:
-        break;
-    }
-    UNREACHABLE();
-  }
-
-  Operand InputOperand2_64(size_t index) {
-    switch (AddressingModeField::decode(instr_->opcode())) {
-      case kMode_None:
-        return InputOperand64(index);
-      case kMode_Operand2_R_LSL_I:
-        return Operand(InputRegister64(index), LSL, InputInt6(index + 1));
-      case kMode_Operand2_R_LSR_I:
-        return Operand(InputRegister64(index), LSR, InputInt6(index + 1));
-      case kMode_Operand2_R_ASR_I:
-        return Operand(InputRegister64(index), ASR, InputInt6(index + 1));
-      case kMode_Operand2_R_ROR_I:
-        return Operand(InputRegister64(index), ROR, InputInt6(index + 1));
-      case kMode_Operand2_R_UXTB:
-        return Operand(InputRegister64(index), UXTB);
-      case kMode_Operand2_R_UXTH:
-        return Operand(InputRegister64(index), UXTH);
-      case kMode_Operand2_R_SXTB:
-        return Operand(InputRegister64(index), SXTB);
-      case kMode_Operand2_R_SXTH:
-        return Operand(InputRegister64(index), SXTH);
-      case kMode_Operand2_R_SXTW:
-        return Operand(InputRegister64(index), SXTW);
-      case kMode_MRI:
-      case kMode_MRR:
-        break;
-    }
-    UNREACHABLE();
-  }
-
-  MemOperand MemoryOperand(size_t* first_index) {
-    const size_t index = *first_index;
-    switch (AddressingModeField::decode(instr_->opcode())) {
-      case kMode_None:
-      case kMode_Operand2_R_LSR_I:
-      case kMode_Operand2_R_ASR_I:
-      case kMode_Operand2_R_ROR_I:
-      case kMode_Operand2_R_UXTB:
-      case kMode_Operand2_R_UXTH:
-      case kMode_Operand2_R_SXTB:
-      case kMode_Operand2_R_SXTH:
-      case kMode_Operand2_R_SXTW:
-        break;
-      case kMode_Operand2_R_LSL_I:
-        *first_index += 3;
-        return MemOperand(InputRegister(index + 0), InputRegister(index + 1),
-                          LSL, InputInt32(index + 2));
-      case kMode_MRI:
-        *first_index += 2;
-        return MemOperand(InputRegister(index + 0), InputInt32(index + 1));
-      case kMode_MRR:
-        *first_index += 2;
-        return MemOperand(InputRegister(index + 0), InputRegister(index + 1));
-    }
-    UNREACHABLE();
-  }
-
-  MemOperand MemoryOperand(size_t first_index = 0) {
-    return MemoryOperand(&first_index);
-  }
-
-  Operand ToOperand(InstructionOperand* op) {
-    if (op->IsRegister()) {
-      return Operand(ToRegister(op));
-    }
-    return ToImmediate(op);
-  }
-
-  Operand ToOperand32(InstructionOperand* op) {
-    if (op->IsRegister()) {
-      return Operand(ToRegister(op).W());
-    }
-    return ToImmediate(op);
-  }
-
-  Operand ToImmediate(InstructionOperand* operand) {
-    Constant constant = ToConstant(operand);
-    switch (constant.type()) {
-      case Constant::kInt32:
-        if (RelocInfo::IsWasmSizeReference(constant.rmode())) {
-          return Operand(constant.ToInt32(), constant.rmode());
-        } else {
-          return Operand(constant.ToInt32());
-        }
-      case Constant::kInt64:
-        if (RelocInfo::IsWasmPtrReference(constant.rmode())) {
-          return Operand(constant.ToInt64(), constant.rmode());
-        } else {
-          DCHECK(!RelocInfo::IsWasmSizeReference(constant.rmode()));
-          return Operand(constant.ToInt64());
-        }
-      case Constant::kFloat32:
-        return Operand(Operand::EmbeddedNumber(constant.ToFloat32()));
-      case Constant::kFloat64:
-        return Operand(Operand::EmbeddedNumber(constant.ToFloat64().value()));
-      case Constant::kExternalReference:
-        return Operand(constant.ToExternalReference());
-      case Constant::kHeapObject:
-        return Operand(constant.ToHeapObject());
-      case Constant::kRpoNumber:
-        UNREACHABLE();  // TODO(dcarney): RPO immediates on arm64.
-        break;
-    }
-    UNREACHABLE();
-  }
-
-  MemOperand ToMemOperand(InstructionOperand* op, TurboAssembler* tasm) const {
-    DCHECK_NOT_NULL(op);
-    DCHECK(op->IsStackSlot() || op->IsFPStackSlot());
-    return SlotToMemOperand(AllocatedOperand::cast(op)->index(), tasm);
-  }
-
-  MemOperand SlotToMemOperand(int slot, TurboAssembler* tasm) const {
-    FrameOffset offset = frame_access_state()->GetFrameOffset(slot);
-    if (offset.from_frame_pointer()) {
-      int from_sp = offset.offset() + frame_access_state()->GetSPToFPOffset();
-      // Convert FP-offsets to SP-offsets if it results in better code.
-      if (Assembler::IsImmLSUnscaled(from_sp) ||
-          Assembler::IsImmLSScaled(from_sp, 3)) {
-        offset = FrameOffset::FromStackPointer(from_sp);
-      }
-    }
-    return MemOperand(offset.from_stack_pointer() ? tasm->StackPointer() : fp,
-                      offset.offset());
-  }
-};
-
-
-namespace {
-
-class OutOfLineRecordWrite final : public OutOfLineCode {
- public:
-  OutOfLineRecordWrite(CodeGenerator* gen, Register object, Operand index,
-                       Register value, Register scratch0, Register scratch1,
-                       RecordWriteMode mode,
-                       UnwindingInfoWriter* unwinding_info_writer)
-      : OutOfLineCode(gen),
-        object_(object),
-        index_(index),
-        value_(value),
-        scratch0_(scratch0),
-        scratch1_(scratch1),
-        mode_(mode),
-        must_save_lr_(!gen->frame_access_state()->has_frame()),
-        unwinding_info_writer_(unwinding_info_writer),
-        zone_(gen->zone()) {}
-
-  void Generate() final {
-    if (mode_ > RecordWriteMode::kValueIsPointer) {
-      __ JumpIfSmi(value_, exit());
-    }
-    __ CheckPageFlagClear(value_, scratch0_,
-                          MemoryChunk::kPointersToHereAreInterestingMask,
-                          exit());
-    __ Add(scratch1_, object_, index_);
-    RememberedSetAction const remembered_set_action =
-        mode_ > RecordWriteMode::kValueIsMap ? EMIT_REMEMBERED_SET
-                                             : OMIT_REMEMBERED_SET;
-    SaveFPRegsMode const save_fp_mode =
-        frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
-    if (must_save_lr_) {
-      // We need to save and restore lr if the frame was elided.
-      __ Push(lr, padreg);
-      unwinding_info_writer_->MarkLinkRegisterOnTopOfStack(__ pc_offset(),
-                                                           __ StackPointer());
-    }
-    __ CallRecordWriteStub(object_, scratch1_, remembered_set_action,
-                           save_fp_mode);
-    if (must_save_lr_) {
-      __ Pop(padreg, lr);
-      unwinding_info_writer_->MarkPopLinkRegisterFromTopOfStack(__ pc_offset());
-    }
-  }
-
- private:
-  Register const object_;
-  Operand const index_;
-  Register const value_;
-  Register const scratch0_;
-  Register const scratch1_;
-  RecordWriteMode const mode_;
-  bool must_save_lr_;
-  UnwindingInfoWriter* const unwinding_info_writer_;
-  Zone* zone_;
-};
-
-
-Condition FlagsConditionToCondition(FlagsCondition condition) {
-  switch (condition) {
-    case kEqual:
-      return eq;
-    case kNotEqual:
-      return ne;
-    case kSignedLessThan:
-      return lt;
-    case kSignedGreaterThanOrEqual:
-      return ge;
-    case kSignedLessThanOrEqual:
-      return le;
-    case kSignedGreaterThan:
-      return gt;
-    case kUnsignedLessThan:
-      return lo;
-    case kUnsignedGreaterThanOrEqual:
-      return hs;
-    case kUnsignedLessThanOrEqual:
-      return ls;
-    case kUnsignedGreaterThan:
-      return hi;
-    case kFloatLessThanOrUnordered:
-      return lt;
-    case kFloatGreaterThanOrEqual:
-      return ge;
-    case kFloatLessThanOrEqual:
-      return ls;
-    case kFloatGreaterThanOrUnordered:
-      return hi;
-    case kFloatLessThan:
-      return lo;
-    case kFloatGreaterThanOrEqualOrUnordered:
-      return hs;
-    case kFloatLessThanOrEqualOrUnordered:
-      return le;
-    case kFloatGreaterThan:
-      return gt;
-    case kOverflow:
-      return vs;
-    case kNotOverflow:
-      return vc;
-    case kUnorderedEqual:
-    case kUnorderedNotEqual:
-      break;
-    case kPositiveOrZero:
-      return pl;
-    case kNegative:
-      return mi;
-  }
-  UNREACHABLE();
-}
-
-}  // namespace
-
-#define ASSEMBLE_SHIFT(asm_instr, width)                                    \
-  do {                                                                      \
-    if (instr->InputAt(1)->IsRegister()) {                                  \
-      __ asm_instr(i.OutputRegister##width(), i.InputRegister##width(0),    \
-                   i.InputRegister##width(1));                              \
-    } else {                                                                \
-      uint32_t imm =                                                        \
-          static_cast<uint32_t>(i.InputOperand##width(1).ImmediateValue()); \
-      __ asm_instr(i.OutputRegister##width(), i.InputRegister##width(0),    \
-                   imm % (width));                                          \
-    }                                                                       \
-  } while (0)
-
-#define ASSEMBLE_ATOMIC_LOAD_INTEGER(asm_instr)                        \
-  do {                                                                 \
-    __ Add(i.TempRegister(0), i.InputRegister(0), i.InputRegister(1)); \
-    __ asm_instr(i.OutputRegister32(), i.TempRegister(0));             \
-  } while (0)
-
-#define ASSEMBLE_ATOMIC_STORE_INTEGER(asm_instr)                       \
-  do {                                                                 \
-    __ Add(i.TempRegister(0), i.InputRegister(0), i.InputRegister(1)); \
-    __ asm_instr(i.InputRegister32(2), i.TempRegister(0));             \
-  } while (0)
-
-#define ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(load_instr, store_instr)      \
-  do {                                                                 \
-    Label exchange;                                                    \
-    __ Add(i.TempRegister(0), i.InputRegister(0), i.InputRegister(1)); \
-    __ Bind(&exchange);                                                \
-    __ load_instr(i.OutputRegister32(), i.TempRegister(0));            \
-    __ store_instr(i.TempRegister32(1), i.InputRegister32(2),          \
-                   i.TempRegister(0));                                 \
-    __ Cbnz(i.TempRegister32(1), &exchange);                           \
-  } while (0)
-
-#define ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER(load_instr, store_instr, ext) \
-  do {                                                                         \
-    Label compareExchange;                                                     \
-    Label exit;                                                                \
-    __ Add(i.TempRegister(0), i.InputRegister(0), i.InputRegister(1));         \
-    __ Bind(&compareExchange);                                                 \
-    __ load_instr(i.OutputRegister32(), i.TempRegister(0));                    \
-    __ Cmp(i.OutputRegister32(), Operand(i.InputRegister32(2), ext));          \
-    __ B(ne, &exit);                                                           \
-    __ store_instr(i.TempRegister32(1), i.InputRegister32(3),                  \
-                   i.TempRegister(0));                                         \
-    __ Cbnz(i.TempRegister32(1), &compareExchange);                            \
-    __ Bind(&exit);                                                            \
-  } while (0)
-
-#define ASSEMBLE_ATOMIC_BINOP(load_instr, store_instr, bin_instr)      \
-  do {                                                                 \
-    Label binop;                                                       \
-    __ Add(i.TempRegister(0), i.InputRegister(0), i.InputRegister(1)); \
-    __ Bind(&binop);                                                   \
-    __ load_instr(i.OutputRegister32(), i.TempRegister(0));            \
-    __ bin_instr(i.TempRegister32(1), i.OutputRegister32(),            \
-                 Operand(i.InputRegister32(2)));                       \
-    __ store_instr(i.TempRegister32(2), i.TempRegister32(1),           \
-                   i.TempRegister(0));                                 \
-    __ Cbnz(i.TempRegister32(2), &binop);                              \
-  } while (0)
-
-#define ASSEMBLE_IEEE754_BINOP(name)                                       \
-  do {                                                                     \
-    FrameScope scope(tasm(), StackFrame::MANUAL);                          \
-    __ CallCFunction(                                                      \
-        ExternalReference::ieee754_##name##_function(__ isolate()), 0, 2); \
-  } while (0)
-
-#define ASSEMBLE_IEEE754_UNOP(name)                                        \
-  do {                                                                     \
-    FrameScope scope(tasm(), StackFrame::MANUAL);                          \
-    __ CallCFunction(                                                      \
-        ExternalReference::ieee754_##name##_function(__ isolate()), 0, 1); \
-  } while (0)
-
-void CodeGenerator::AssembleDeconstructFrame() {
-  __ Mov(csp, fp);
-  __ Pop(fp, lr);
-
-  unwinding_info_writer_.MarkFrameDeconstructed(__ pc_offset());
-}
-
-void CodeGenerator::AssemblePrepareTailCall() {
-  if (frame_access_state()->has_frame()) {
-    __ Ldr(lr, MemOperand(fp, StandardFrameConstants::kCallerPCOffset));
-    __ Ldr(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
-  }
-  frame_access_state()->SetFrameAccessToSP();
-}
-
-void CodeGenerator::AssemblePopArgumentsAdaptorFrame(Register args_reg,
-                                                     Register scratch1,
-                                                     Register scratch2,
-                                                     Register scratch3) {
-  DCHECK(!AreAliased(args_reg, scratch1, scratch2, scratch3));
-  Label done;
-
-  // Check if current frame is an arguments adaptor frame.
-  __ Ldr(scratch1, MemOperand(fp, StandardFrameConstants::kContextOffset));
-  __ Cmp(scratch1,
-         Operand(StackFrame::TypeToMarker(StackFrame::ARGUMENTS_ADAPTOR)));
-  __ B(ne, &done);
-
-  // Load arguments count from current arguments adaptor frame (note, it
-  // does not include receiver).
-  Register caller_args_count_reg = scratch1;
-  __ Ldr(caller_args_count_reg,
-         MemOperand(fp, ArgumentsAdaptorFrameConstants::kLengthOffset));
-  __ SmiUntag(caller_args_count_reg);
-
-  ParameterCount callee_args_count(args_reg);
-  __ PrepareForTailCall(callee_args_count, caller_args_count_reg, scratch2,
-                        scratch3);
-  __ bind(&done);
-}
-
-namespace {
-
-void AdjustStackPointerForTailCall(TurboAssembler* tasm,
-                                   FrameAccessState* state,
-                                   int new_slot_above_sp,
-                                   bool allow_shrinkage = true) {
-  int current_sp_offset = state->GetSPToFPSlotCount() +
-                          StandardFrameConstants::kFixedSlotCountAboveFp;
-  int stack_slot_delta = new_slot_above_sp - current_sp_offset;
-  DCHECK_EQ(stack_slot_delta % 2, 0);
-  if (stack_slot_delta > 0) {
-    tasm->Claim(stack_slot_delta);
-    state->IncreaseSPDelta(stack_slot_delta);
-  } else if (allow_shrinkage && stack_slot_delta < 0) {
-    tasm->Drop(-stack_slot_delta);
-    state->IncreaseSPDelta(stack_slot_delta);
-  }
-}
-
-}  // namespace
-
-void CodeGenerator::AssembleTailCallBeforeGap(Instruction* instr,
-                                              int first_unused_stack_slot) {
-  AdjustStackPointerForTailCall(tasm(), frame_access_state(),
-                                first_unused_stack_slot, false);
-}
-
-void CodeGenerator::AssembleTailCallAfterGap(Instruction* instr,
-                                             int first_unused_stack_slot) {
-  DCHECK_EQ(first_unused_stack_slot % 2, 0);
-  AdjustStackPointerForTailCall(tasm(), frame_access_state(),
-                                first_unused_stack_slot);
-  DCHECK(instr->IsTailCall());
-  InstructionOperandConverter g(this, instr);
-  int optional_padding_slot = g.InputInt32(instr->InputCount() - 2);
-  if (optional_padding_slot % 2) {
-    __ Poke(padreg, optional_padding_slot * kPointerSize);
-  }
-}
-
-// Check if the code object is marked for deoptimization. If it is, then it
-// jumps to the CompileLazyDeoptimizedCode builtin. In order to do this we need
-// to:
-//    1. compute the offset of the {CodeDataContainer} from our current location
-//       and load it.
-//    2. read from memory the word that contains that bit, which can be found in
-//       the flags in the referenced {CodeDataContainer} object;
-//    3. test kMarkedForDeoptimizationBit in those flags; and
-//    4. if it is not zero then it jumps to the builtin.
-void CodeGenerator::BailoutIfDeoptimized() {
-  UseScratchRegisterScope temps(tasm());
-  Register scratch = temps.AcquireX();
-  {
-    // Since we always emit a bailout check at the very beginning we can be
-    // certain that the distance between here and the {CodeDataContainer} is
-    // fixed and always in range of a load.
-    int data_container_offset =
-        (Code::kCodeDataContainerOffset - Code::kHeaderSize) - __ pc_offset();
-    DCHECK_GE(0, data_container_offset);
-    DCHECK_EQ(0, data_container_offset % 4);
-    InstructionAccurateScope scope(tasm());
-    __ ldr_pcrel(scratch, data_container_offset >> 2);
-  }
-  __ Ldr(scratch,
-         FieldMemOperand(scratch, CodeDataContainer::kKindSpecificFlagsOffset));
-  Label not_deoptimized;
-  __ Tbz(scratch, Code::kMarkedForDeoptimizationBit, &not_deoptimized);
-  Handle<Code> code = isolate()->builtins()->builtin_handle(
-      Builtins::kCompileLazyDeoptimizedCode);
-  __ Jump(code, RelocInfo::CODE_TARGET);
-  __ Bind(&not_deoptimized);
-}
-
-// Assembles an instruction after register allocation, producing machine code.
-CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
-    Instruction* instr) {
-  Arm64OperandConverter i(this, instr);
-  InstructionCode opcode = instr->opcode();
-  ArchOpcode arch_opcode = ArchOpcodeField::decode(opcode);
-  switch (arch_opcode) {
-    case kArchCallCodeObject: {
-      // We must not share code targets for calls to builtins for wasm code, as
-      // they might need to be patched individually.
-      internal::Assembler::BlockCodeTargetSharingScope scope;
-      if (info()->IsWasm()) scope.Open(tasm());
-
-      if (instr->InputAt(0)->IsImmediate()) {
-        __ Call(i.InputCode(0), RelocInfo::CODE_TARGET);
-      } else {
-        Register target = i.InputRegister(0);
-        __ Add(target, target, Code::kHeaderSize - kHeapObjectTag);
-        __ Call(target);
-      }
-      RecordCallPosition(instr);
-      frame_access_state()->ClearSPDelta();
-      break;
-    }
-    case kArchCallWasmFunction: {
-      // We must not share code targets for calls to builtins for wasm code, as
-      // they might need to be patched individually.
-      internal::Assembler::BlockCodeTargetSharingScope scope;
-      if (info()->IsWasm()) scope.Open(tasm());
-
-      if (instr->InputAt(0)->IsImmediate()) {
-        Address wasm_code = reinterpret_cast<Address>(
-            i.ToConstant(instr->InputAt(0)).ToInt64());
-        if (info()->IsWasm()) {
-          __ Call(wasm_code, RelocInfo::WASM_CALL);
-        } else {
-          __ Call(wasm_code, RelocInfo::JS_TO_WASM_CALL);
-        }
-      } else {
-        Register target = i.InputRegister(0);
-        __ Call(target);
-      }
-      RecordCallPosition(instr);
-      frame_access_state()->ClearSPDelta();
-      break;
-    }
-    case kArchTailCallCodeObjectFromJSFunction:
-    case kArchTailCallCodeObject: {
-      // We must not share code targets for calls to builtins for wasm code, as
-      // they might need to be patched individually.
-      internal::Assembler::BlockCodeTargetSharingScope scope;
-      if (info()->IsWasm()) scope.Open(tasm());
-
-      if (arch_opcode == kArchTailCallCodeObjectFromJSFunction) {
-        AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister,
-                                         i.TempRegister(0), i.TempRegister(1),
-                                         i.TempRegister(2));
-      }
-      if (instr->InputAt(0)->IsImmediate()) {
-        __ Jump(i.InputCode(0), RelocInfo::CODE_TARGET);
-      } else {
-        Register target = i.InputRegister(0);
-        __ Add(target, target, Code::kHeaderSize - kHeapObjectTag);
-        __ Jump(target);
-      }
-      unwinding_info_writer_.MarkBlockWillExit();
-      frame_access_state()->ClearSPDelta();
-      frame_access_state()->SetFrameAccessToDefault();
-      break;
-    }
-    case kArchTailCallWasm: {
-      // We must not share code targets for calls to builtins for wasm code, as
-      // they might need to be patched individually.
-      internal::Assembler::BlockCodeTargetSharingScope scope;
-      if (info()->IsWasm()) scope.Open(tasm());
-
-      if (instr->InputAt(0)->IsImmediate()) {
-        Address wasm_code = reinterpret_cast<Address>(
-            i.ToConstant(instr->InputAt(0)).ToInt64());
-        if (info()->IsWasm()) {
-          __ Jump(wasm_code, RelocInfo::WASM_CALL);
-        } else {
-          __ Jump(wasm_code, RelocInfo::JS_TO_WASM_CALL);
-        }
-
-      } else {
-        Register target = i.InputRegister(0);
-        __ Jump(target);
-      }
-      unwinding_info_writer_.MarkBlockWillExit();
-      frame_access_state()->ClearSPDelta();
-      frame_access_state()->SetFrameAccessToDefault();
-      break;
-    }
-    case kArchTailCallAddress: {
-      CHECK(!instr->InputAt(0)->IsImmediate());
-      __ Jump(i.InputRegister(0));
-      unwinding_info_writer_.MarkBlockWillExit();
-      frame_access_state()->ClearSPDelta();
-      frame_access_state()->SetFrameAccessToDefault();
-      break;
-    }
-    case kArchCallJSFunction: {
-      Register func = i.InputRegister(0);
-      if (FLAG_debug_code) {
-        // Check the function's context matches the context argument.
-        UseScratchRegisterScope scope(tasm());
-        Register temp = scope.AcquireX();
-        __ Ldr(temp, FieldMemOperand(func, JSFunction::kContextOffset));
-        __ cmp(cp, temp);
-        __ Assert(eq, AbortReason::kWrongFunctionContext);
-      }
-      __ Ldr(x10, FieldMemOperand(func, JSFunction::kCodeOffset));
-      __ Add(x10, x10, Operand(Code::kHeaderSize - kHeapObjectTag));
-      __ Call(x10);
-      RecordCallPosition(instr);
-      frame_access_state()->ClearSPDelta();
-      break;
-    }
-    case kArchPrepareCallCFunction:
-      // We don't need kArchPrepareCallCFunction on arm64 as the instruction
-      // selector has already performed a Claim to reserve space on the stack.
-      // Frame alignment is always 16 bytes, and the stack pointer is already
-      // 16-byte aligned, therefore we do not need to align the stack pointer
-      // by an unknown value, and it is safe to continue accessing the frame
-      // via the stack pointer.
-      UNREACHABLE();
-      break;
-    case kArchSaveCallerRegisters: {
-      fp_mode_ =
-          static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode()));
-      DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
-      // kReturnRegister0 should have been saved before entering the stub.
-      int bytes = __ PushCallerSaved(fp_mode_, kReturnRegister0);
-      DCHECK_EQ(0, bytes % kPointerSize);
-      DCHECK_EQ(0, frame_access_state()->sp_delta());
-      frame_access_state()->IncreaseSPDelta(bytes / kPointerSize);
-      DCHECK(!caller_registers_saved_);
-      caller_registers_saved_ = true;
-      break;
-    }
-    case kArchRestoreCallerRegisters: {
-      DCHECK(fp_mode_ ==
-             static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode())));
-      DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
-      // Don't overwrite the returned value.
-      int bytes = __ PopCallerSaved(fp_mode_, kReturnRegister0);
-      frame_access_state()->IncreaseSPDelta(-(bytes / kPointerSize));
-      DCHECK_EQ(0, frame_access_state()->sp_delta());
-      DCHECK(caller_registers_saved_);
-      caller_registers_saved_ = false;
-      break;
-    }
-    case kArchPrepareTailCall:
-      AssemblePrepareTailCall();
-      break;
-    case kArchCallCFunction: {
-      int const num_parameters = MiscField::decode(instr->opcode());
-      if (instr->InputAt(0)->IsImmediate()) {
-        ExternalReference ref = i.InputExternalReference(0);
-        __ CallCFunction(ref, num_parameters, 0);
-      } else {
-        Register func = i.InputRegister(0);
-        __ CallCFunction(func, num_parameters, 0);
-      }
-      frame_access_state()->SetFrameAccessToDefault();
-      // Ideally, we should decrement SP delta to match the change of stack
-      // pointer in CallCFunction. However, for certain architectures (e.g.
-      // ARM), there may be more strict alignment requirement, causing old SP
-      // to be saved on the stack. In those cases, we can not calculate the SP
-      // delta statically.
-      frame_access_state()->ClearSPDelta();
-      if (caller_registers_saved_) {
-        // Need to re-sync SP delta introduced in kArchSaveCallerRegisters.
-        // Here, we assume the sequence to be:
-        //   kArchSaveCallerRegisters;
-        //   kArchCallCFunction;
-        //   kArchRestoreCallerRegisters;
-        int bytes =
-            __ RequiredStackSizeForCallerSaved(fp_mode_, kReturnRegister0);
-        frame_access_state()->IncreaseSPDelta(bytes / kPointerSize);
-      }
-      break;
-    }
-    case kArchJmp:
-      AssembleArchJump(i.InputRpo(0));
-      break;
-    case kArchTableSwitch:
-      AssembleArchTableSwitch(instr);
-      break;
-    case kArchLookupSwitch:
-      AssembleArchLookupSwitch(instr);
-      break;
-    case kArchDebugAbort:
-      DCHECK(i.InputRegister(0).is(x1));
-      if (!frame_access_state()->has_frame()) {
-        // We don't actually want to generate a pile of code for this, so just
-        // claim there is a stack frame, without generating one.
-        FrameScope scope(tasm(), StackFrame::NONE);
-        __ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
-                RelocInfo::CODE_TARGET);
-      } else {
-        __ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
-                RelocInfo::CODE_TARGET);
-      }
-      __ Debug("kArchDebugAbort", 0, BREAK);
-      break;
-    case kArchDebugBreak:
-      __ Debug("kArchDebugBreak", 0, BREAK);
-      break;
-    case kArchComment: {
-      Address comment_string = i.InputExternalReference(0).address();
-      __ RecordComment(reinterpret_cast<const char*>(comment_string));
-      break;
-    }
-    case kArchNop:
-    case kArchThrowTerminator:
-      // don't emit code for nops.
-      break;
-    case kArchDeoptimize: {
-      int deopt_state_id =
-          BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore());
-      CodeGenResult result =
-          AssembleDeoptimizerCall(deopt_state_id, current_source_position_);
-      if (result != kSuccess) return result;
-      break;
-    }
-    case kArchRet:
-      AssembleReturn(instr->InputAt(0));
-      break;
-    case kArchStackPointer:
-      __ mov(i.OutputRegister(), tasm()->StackPointer());
-      break;
-    case kArchFramePointer:
-      __ mov(i.OutputRegister(), fp);
-      break;
-    case kArchParentFramePointer:
-      if (frame_access_state()->has_frame()) {
-        __ ldr(i.OutputRegister(), MemOperand(fp, 0));
-      } else {
-        __ mov(i.OutputRegister(), fp);
-      }
-      break;
-    case kArchTruncateDoubleToI:
-      __ TruncateDoubleToIDelayed(zone(), i.OutputRegister(),
-                                  i.InputDoubleRegister(0));
-      break;
-    case kArchStoreWithWriteBarrier: {
-      RecordWriteMode mode =
-          static_cast<RecordWriteMode>(MiscField::decode(instr->opcode()));
-      AddressingMode addressing_mode =
-          AddressingModeField::decode(instr->opcode());
-      Register object = i.InputRegister(0);
-      Operand index(0);
-      if (addressing_mode == kMode_MRI) {
-        index = Operand(i.InputInt64(1));
-      } else {
-        DCHECK_EQ(addressing_mode, kMode_MRR);
-        index = Operand(i.InputRegister(1));
-      }
-      Register value = i.InputRegister(2);
-      Register scratch0 = i.TempRegister(0);
-      Register scratch1 = i.TempRegister(1);
-      auto ool = new (zone())
-          OutOfLineRecordWrite(this, object, index, value, scratch0, scratch1,
-                               mode, &unwinding_info_writer_);
-      __ Str(value, MemOperand(object, index));
-      __ CheckPageFlagSet(object, scratch0,
-                          MemoryChunk::kPointersFromHereAreInterestingMask,
-                          ool->entry());
-      __ Bind(ool->exit());
-      break;
-    }
-    case kArchStackSlot: {
-      FrameOffset offset =
-          frame_access_state()->GetFrameOffset(i.InputInt32(0));
-      Register base = offset.from_stack_pointer() ? __ StackPointer() : fp;
-      __ Add(i.OutputRegister(0), base, Operand(offset.offset()));
-      break;
-    }
-    case kIeee754Float64Acos:
-      ASSEMBLE_IEEE754_UNOP(acos);
-      break;
-    case kIeee754Float64Acosh:
-      ASSEMBLE_IEEE754_UNOP(acosh);
-      break;
-    case kIeee754Float64Asin:
-      ASSEMBLE_IEEE754_UNOP(asin);
-      break;
-    case kIeee754Float64Asinh:
-      ASSEMBLE_IEEE754_UNOP(asinh);
-      break;
-    case kIeee754Float64Atan:
-      ASSEMBLE_IEEE754_UNOP(atan);
-      break;
-    case kIeee754Float64Atanh:
-      ASSEMBLE_IEEE754_UNOP(atanh);
-      break;
-    case kIeee754Float64Atan2:
-      ASSEMBLE_IEEE754_BINOP(atan2);
-      break;
-    case kIeee754Float64Cos:
-      ASSEMBLE_IEEE754_UNOP(cos);
-      break;
-    case kIeee754Float64Cosh:
-      ASSEMBLE_IEEE754_UNOP(cosh);
-      break;
-    case kIeee754Float64Cbrt:
-      ASSEMBLE_IEEE754_UNOP(cbrt);
-      break;
-    case kIeee754Float64Exp:
-      ASSEMBLE_IEEE754_UNOP(exp);
-      break;
-    case kIeee754Float64Expm1:
-      ASSEMBLE_IEEE754_UNOP(expm1);
-      break;
-    case kIeee754Float64Log:
-      ASSEMBLE_IEEE754_UNOP(log);
-      break;
-    case kIeee754Float64Log1p:
-      ASSEMBLE_IEEE754_UNOP(log1p);
-      break;
-    case kIeee754Float64Log2:
-      ASSEMBLE_IEEE754_UNOP(log2);
-      break;
-    case kIeee754Float64Log10:
-      ASSEMBLE_IEEE754_UNOP(log10);
-      break;
-    case kIeee754Float64Pow: {
-      __ CallStubDelayed(new (zone())
-                             MathPowStub(nullptr, MathPowStub::DOUBLE));
-      break;
-    }
-    case kIeee754Float64Sin:
-      ASSEMBLE_IEEE754_UNOP(sin);
-      break;
-    case kIeee754Float64Sinh:
-      ASSEMBLE_IEEE754_UNOP(sinh);
-      break;
-    case kIeee754Float64Tan:
-      ASSEMBLE_IEEE754_UNOP(tan);
-      break;
-    case kIeee754Float64Tanh:
-      ASSEMBLE_IEEE754_UNOP(tanh);
-      break;
-    case kArm64Float32RoundDown:
-      __ Frintm(i.OutputFloat32Register(), i.InputFloat32Register(0));
-      break;
-    case kArm64Float64RoundDown:
-      __ Frintm(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    case kArm64Float32RoundUp:
-      __ Frintp(i.OutputFloat32Register(), i.InputFloat32Register(0));
-      break;
-    case kArm64Float64RoundUp:
-      __ Frintp(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    case kArm64Float64RoundTiesAway:
-      __ Frinta(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    case kArm64Float32RoundTruncate:
-      __ Frintz(i.OutputFloat32Register(), i.InputFloat32Register(0));
-      break;
-    case kArm64Float64RoundTruncate:
-      __ Frintz(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    case kArm64Float32RoundTiesEven:
-      __ Frintn(i.OutputFloat32Register(), i.InputFloat32Register(0));
-      break;
-    case kArm64Float64RoundTiesEven:
-      __ Frintn(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    case kArm64Add:
-      if (FlagsModeField::decode(opcode) != kFlags_none) {
-        __ Adds(i.OutputRegister(), i.InputOrZeroRegister64(0),
-                i.InputOperand2_64(1));
-      } else {
-      __ Add(i.OutputRegister(), i.InputOrZeroRegister64(0),
-             i.InputOperand2_64(1));
-      }
-      break;
-    case kArm64Add32:
-      if (FlagsModeField::decode(opcode) != kFlags_none) {
-        __ Adds(i.OutputRegister32(), i.InputOrZeroRegister32(0),
-                i.InputOperand2_32(1));
-      } else {
-        __ Add(i.OutputRegister32(), i.InputOrZeroRegister32(0),
-               i.InputOperand2_32(1));
-      }
-      break;
-    case kArm64And:
-      if (FlagsModeField::decode(opcode) != kFlags_none) {
-        // The ands instruction only sets N and Z, so only the following
-        // conditions make sense.
-        DCHECK(FlagsConditionField::decode(opcode) == kEqual ||
-               FlagsConditionField::decode(opcode) == kNotEqual ||
-               FlagsConditionField::decode(opcode) == kPositiveOrZero ||
-               FlagsConditionField::decode(opcode) == kNegative);
-        __ Ands(i.OutputRegister(), i.InputOrZeroRegister64(0),
-                i.InputOperand2_64(1));
-      } else {
-        __ And(i.OutputRegister(), i.InputOrZeroRegister64(0),
-               i.InputOperand2_64(1));
-      }
-      break;
-    case kArm64And32:
-      if (FlagsModeField::decode(opcode) != kFlags_none) {
-        // The ands instruction only sets N and Z, so only the following
-        // conditions make sense.
-        DCHECK(FlagsConditionField::decode(opcode) == kEqual ||
-               FlagsConditionField::decode(opcode) == kNotEqual ||
-               FlagsConditionField::decode(opcode) == kPositiveOrZero ||
-               FlagsConditionField::decode(opcode) == kNegative);
-        __ Ands(i.OutputRegister32(), i.InputOrZeroRegister32(0),
-                i.InputOperand2_32(1));
-      } else {
-        __ And(i.OutputRegister32(), i.InputOrZeroRegister32(0),
-               i.InputOperand2_32(1));
-      }
-      break;
-    case kArm64Bic:
-      __ Bic(i.OutputRegister(), i.InputOrZeroRegister64(0),
-             i.InputOperand2_64(1));
-      break;
-    case kArm64Bic32:
-      __ Bic(i.OutputRegister32(), i.InputOrZeroRegister32(0),
-             i.InputOperand2_32(1));
-      break;
-    case kArm64Mul:
-      __ Mul(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      break;
-    case kArm64Mul32:
-      __ Mul(i.OutputRegister32(), i.InputRegister32(0), i.InputRegister32(1));
-      break;
-    case kArm64Smull:
-      __ Smull(i.OutputRegister(), i.InputRegister32(0), i.InputRegister32(1));
-      break;
-    case kArm64Umull:
-      __ Umull(i.OutputRegister(), i.InputRegister32(0), i.InputRegister32(1));
-      break;
-    case kArm64Madd:
-      __ Madd(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
-              i.InputRegister(2));
-      break;
-    case kArm64Madd32:
-      __ Madd(i.OutputRegister32(), i.InputRegister32(0), i.InputRegister32(1),
-              i.InputRegister32(2));
-      break;
-    case kArm64Msub:
-      __ Msub(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
-              i.InputRegister(2));
-      break;
-    case kArm64Msub32:
-      __ Msub(i.OutputRegister32(), i.InputRegister32(0), i.InputRegister32(1),
-              i.InputRegister32(2));
-      break;
-    case kArm64Mneg:
-      __ Mneg(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      break;
-    case kArm64Mneg32:
-      __ Mneg(i.OutputRegister32(), i.InputRegister32(0), i.InputRegister32(1));
-      break;
-    case kArm64Idiv:
-      __ Sdiv(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      break;
-    case kArm64Idiv32:
-      __ Sdiv(i.OutputRegister32(), i.InputRegister32(0), i.InputRegister32(1));
-      break;
-    case kArm64Udiv:
-      __ Udiv(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      break;
-    case kArm64Udiv32:
-      __ Udiv(i.OutputRegister32(), i.InputRegister32(0), i.InputRegister32(1));
-      break;
-    case kArm64Imod: {
-      UseScratchRegisterScope scope(tasm());
-      Register temp = scope.AcquireX();
-      __ Sdiv(temp, i.InputRegister(0), i.InputRegister(1));
-      __ Msub(i.OutputRegister(), temp, i.InputRegister(1), i.InputRegister(0));
-      break;
-    }
-    case kArm64Imod32: {
-      UseScratchRegisterScope scope(tasm());
-      Register temp = scope.AcquireW();
-      __ Sdiv(temp, i.InputRegister32(0), i.InputRegister32(1));
-      __ Msub(i.OutputRegister32(), temp, i.InputRegister32(1),
-              i.InputRegister32(0));
-      break;
-    }
-    case kArm64Umod: {
-      UseScratchRegisterScope scope(tasm());
-      Register temp = scope.AcquireX();
-      __ Udiv(temp, i.InputRegister(0), i.InputRegister(1));
-      __ Msub(i.OutputRegister(), temp, i.InputRegister(1), i.InputRegister(0));
-      break;
-    }
-    case kArm64Umod32: {
-      UseScratchRegisterScope scope(tasm());
-      Register temp = scope.AcquireW();
-      __ Udiv(temp, i.InputRegister32(0), i.InputRegister32(1));
-      __ Msub(i.OutputRegister32(), temp, i.InputRegister32(1),
-              i.InputRegister32(0));
-      break;
-    }
-    case kArm64Not:
-      __ Mvn(i.OutputRegister(), i.InputOperand(0));
-      break;
-    case kArm64Not32:
-      __ Mvn(i.OutputRegister32(), i.InputOperand32(0));
-      break;
-    case kArm64Or:
-      __ Orr(i.OutputRegister(), i.InputOrZeroRegister64(0),
-             i.InputOperand2_64(1));
-      break;
-    case kArm64Or32:
-      __ Orr(i.OutputRegister32(), i.InputOrZeroRegister32(0),
-             i.InputOperand2_32(1));
-      break;
-    case kArm64Orn:
-      __ Orn(i.OutputRegister(), i.InputOrZeroRegister64(0),
-             i.InputOperand2_64(1));
-      break;
-    case kArm64Orn32:
-      __ Orn(i.OutputRegister32(), i.InputOrZeroRegister32(0),
-             i.InputOperand2_32(1));
-      break;
-    case kArm64Eor:
-      __ Eor(i.OutputRegister(), i.InputOrZeroRegister64(0),
-             i.InputOperand2_64(1));
-      break;
-    case kArm64Eor32:
-      __ Eor(i.OutputRegister32(), i.InputOrZeroRegister32(0),
-             i.InputOperand2_32(1));
-      break;
-    case kArm64Eon:
-      __ Eon(i.OutputRegister(), i.InputOrZeroRegister64(0),
-             i.InputOperand2_64(1));
-      break;
-    case kArm64Eon32:
-      __ Eon(i.OutputRegister32(), i.InputOrZeroRegister32(0),
-             i.InputOperand2_32(1));
-      break;
-    case kArm64Sub:
-      if (FlagsModeField::decode(opcode) != kFlags_none) {
-        __ Subs(i.OutputRegister(), i.InputOrZeroRegister64(0),
-                i.InputOperand2_64(1));
-      } else {
-      __ Sub(i.OutputRegister(), i.InputOrZeroRegister64(0),
-             i.InputOperand2_64(1));
-      }
-      break;
-    case kArm64Sub32:
-      if (FlagsModeField::decode(opcode) != kFlags_none) {
-        __ Subs(i.OutputRegister32(), i.InputOrZeroRegister32(0),
-                i.InputOperand2_32(1));
-      } else {
-        __ Sub(i.OutputRegister32(), i.InputOrZeroRegister32(0),
-               i.InputOperand2_32(1));
-      }
-      break;
-    case kArm64Lsl:
-      ASSEMBLE_SHIFT(Lsl, 64);
-      break;
-    case kArm64Lsl32:
-      ASSEMBLE_SHIFT(Lsl, 32);
-      break;
-    case kArm64Lsr:
-      ASSEMBLE_SHIFT(Lsr, 64);
-      break;
-    case kArm64Lsr32:
-      ASSEMBLE_SHIFT(Lsr, 32);
-      break;
-    case kArm64Asr:
-      ASSEMBLE_SHIFT(Asr, 64);
-      break;
-    case kArm64Asr32:
-      ASSEMBLE_SHIFT(Asr, 32);
-      break;
-    case kArm64Ror:
-      ASSEMBLE_SHIFT(Ror, 64);
-      break;
-    case kArm64Ror32:
-      ASSEMBLE_SHIFT(Ror, 32);
-      break;
-    case kArm64Mov32:
-      __ Mov(i.OutputRegister32(), i.InputRegister32(0));
-      break;
-    case kArm64Sxtb32:
-      __ Sxtb(i.OutputRegister32(), i.InputRegister32(0));
-      break;
-    case kArm64Sxth32:
-      __ Sxth(i.OutputRegister32(), i.InputRegister32(0));
-      break;
-    case kArm64Sxtw:
-      __ Sxtw(i.OutputRegister(), i.InputRegister32(0));
-      break;
-    case kArm64Sbfx32:
-      __ Sbfx(i.OutputRegister32(), i.InputRegister32(0), i.InputInt5(1),
-              i.InputInt5(2));
-      break;
-    case kArm64Ubfx:
-      __ Ubfx(i.OutputRegister(), i.InputRegister(0), i.InputInt6(1),
-              i.InputInt32(2));
-      break;
-    case kArm64Ubfx32:
-      __ Ubfx(i.OutputRegister32(), i.InputRegister32(0), i.InputInt5(1),
-              i.InputInt32(2));
-      break;
-    case kArm64Ubfiz32:
-      __ Ubfiz(i.OutputRegister32(), i.InputRegister32(0), i.InputInt5(1),
-               i.InputInt5(2));
-      break;
-    case kArm64Bfi:
-      __ Bfi(i.OutputRegister(), i.InputRegister(1), i.InputInt6(2),
-             i.InputInt6(3));
-      break;
-    case kArm64TestAndBranch32:
-    case kArm64TestAndBranch:
-      // Pseudo instructions turned into tbz/tbnz in AssembleArchBranch.
-      break;
-    case kArm64CompareAndBranch32:
-    case kArm64CompareAndBranch:
-      // Pseudo instruction turned into cbz/cbnz in AssembleArchBranch.
-      break;
-    case kArm64Claim: {
-      int count = i.InputInt32(0);
-      DCHECK_EQ(count % 2, 0);
-      __ AssertCspAligned();
-      if (count > 0) {
-        __ Claim(count);
-        frame_access_state()->IncreaseSPDelta(count);
-      }
-      break;
-    }
-    case kArm64Poke: {
-      Operand operand(i.InputInt32(1) * kPointerSize);
-      if (instr->InputAt(0)->IsSimd128Register()) {
-        __ Poke(i.InputSimd128Register(0), operand);
-      } else if (instr->InputAt(0)->IsFPRegister()) {
-        __ Poke(i.InputFloat64Register(0), operand);
-      } else {
-        __ Poke(i.InputOrZeroRegister64(0), operand);
-      }
-      break;
-    }
-    case kArm64PokePair: {
-      int slot = i.InputInt32(2) - 1;
-      if (instr->InputAt(0)->IsFPRegister()) {
-        __ PokePair(i.InputFloat64Register(1), i.InputFloat64Register(0),
-                    slot * kPointerSize);
-      } else {
-        __ PokePair(i.InputRegister(1), i.InputRegister(0),
-                    slot * kPointerSize);
-      }
-      break;
-    }
-    case kArm64Peek: {
-      int reverse_slot = i.InputInt32(0);
-      int offset =
-          FrameSlotToFPOffset(frame()->GetTotalFrameSlotCount() - reverse_slot);
-      if (instr->OutputAt(0)->IsFPRegister()) {
-        LocationOperand* op = LocationOperand::cast(instr->OutputAt(0));
-        if (op->representation() == MachineRepresentation::kFloat64) {
-          __ Ldr(i.OutputDoubleRegister(), MemOperand(fp, offset));
-        } else {
-          DCHECK_EQ(MachineRepresentation::kFloat32, op->representation());
-          __ Ldr(i.OutputFloatRegister(), MemOperand(fp, offset));
-        }
-      } else {
-        __ Ldr(i.OutputRegister(), MemOperand(fp, offset));
-      }
-      break;
-    }
-    case kArm64Clz:
-      __ Clz(i.OutputRegister64(), i.InputRegister64(0));
-      break;
-    case kArm64Clz32:
-      __ Clz(i.OutputRegister32(), i.InputRegister32(0));
-      break;
-    case kArm64Rbit:
-      __ Rbit(i.OutputRegister64(), i.InputRegister64(0));
-      break;
-    case kArm64Rbit32:
-      __ Rbit(i.OutputRegister32(), i.InputRegister32(0));
-      break;
-    case kArm64Cmp:
-      __ Cmp(i.InputOrZeroRegister64(0), i.InputOperand2_64(1));
-      break;
-    case kArm64Cmp32:
-      __ Cmp(i.InputOrZeroRegister32(0), i.InputOperand2_32(1));
-      break;
-    case kArm64Cmn:
-      __ Cmn(i.InputOrZeroRegister64(0), i.InputOperand2_64(1));
-      break;
-    case kArm64Cmn32:
-      __ Cmn(i.InputOrZeroRegister32(0), i.InputOperand2_32(1));
-      break;
-    case kArm64Tst:
-      __ Tst(i.InputOrZeroRegister64(0), i.InputOperand2_64(1));
-      break;
-    case kArm64Tst32:
-      __ Tst(i.InputOrZeroRegister32(0), i.InputOperand2_32(1));
-      break;
-    case kArm64Float32Cmp:
-      if (instr->InputAt(1)->IsFPRegister()) {
-        __ Fcmp(i.InputFloat32Register(0), i.InputFloat32Register(1));
-      } else {
-        DCHECK(instr->InputAt(1)->IsImmediate());
-        // 0.0 is the only immediate supported by fcmp instructions.
-        DCHECK_EQ(0.0f, i.InputFloat32(1));
-        __ Fcmp(i.InputFloat32Register(0), i.InputFloat32(1));
-      }
-      break;
-    case kArm64Float32Add:
-      __ Fadd(i.OutputFloat32Register(), i.InputFloat32Register(0),
-              i.InputFloat32Register(1));
-      break;
-    case kArm64Float32Sub:
-      __ Fsub(i.OutputFloat32Register(), i.InputFloat32Register(0),
-              i.InputFloat32Register(1));
-      break;
-    case kArm64Float32Mul:
-      __ Fmul(i.OutputFloat32Register(), i.InputFloat32Register(0),
-              i.InputFloat32Register(1));
-      break;
-    case kArm64Float32Div:
-      __ Fdiv(i.OutputFloat32Register(), i.InputFloat32Register(0),
-              i.InputFloat32Register(1));
-      break;
-    case kArm64Float32Abs:
-      __ Fabs(i.OutputFloat32Register(), i.InputFloat32Register(0));
-      break;
-    case kArm64Float32Neg:
-      __ Fneg(i.OutputFloat32Register(), i.InputFloat32Register(0));
-      break;
-    case kArm64Float32Sqrt:
-      __ Fsqrt(i.OutputFloat32Register(), i.InputFloat32Register(0));
-      break;
-    case kArm64Float64Cmp:
-      if (instr->InputAt(1)->IsFPRegister()) {
-        __ Fcmp(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
-      } else {
-        DCHECK(instr->InputAt(1)->IsImmediate());
-        // 0.0 is the only immediate supported by fcmp instructions.
-        DCHECK_EQ(0.0, i.InputDouble(1));
-        __ Fcmp(i.InputDoubleRegister(0), i.InputDouble(1));
-      }
-      break;
-    case kArm64Float64Add:
-      __ Fadd(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-              i.InputDoubleRegister(1));
-      break;
-    case kArm64Float64Sub:
-      __ Fsub(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-              i.InputDoubleRegister(1));
-      break;
-    case kArm64Float64Mul:
-      __ Fmul(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-              i.InputDoubleRegister(1));
-      break;
-    case kArm64Float64Div:
-      __ Fdiv(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-              i.InputDoubleRegister(1));
-      break;
-    case kArm64Float64Mod: {
-      // TODO(dcarney): implement directly. See note in lithium-codegen-arm64.cc
-      FrameScope scope(tasm(), StackFrame::MANUAL);
-      DCHECK(d0.is(i.InputDoubleRegister(0)));
-      DCHECK(d1.is(i.InputDoubleRegister(1)));
-      DCHECK(d0.is(i.OutputDoubleRegister()));
-      // TODO(dcarney): make sure this saves all relevant registers.
-      __ CallCFunction(
-          ExternalReference::mod_two_doubles_operation(__ isolate()), 0, 2);
-      break;
-    }
-    case kArm64Float32Max: {
-      __ Fmax(i.OutputFloat32Register(), i.InputFloat32Register(0),
-              i.InputFloat32Register(1));
-      break;
-    }
-    case kArm64Float64Max: {
-      __ Fmax(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-              i.InputDoubleRegister(1));
-      break;
-    }
-    case kArm64Float32Min: {
-      __ Fmin(i.OutputFloat32Register(), i.InputFloat32Register(0),
-              i.InputFloat32Register(1));
-      break;
-    }
-    case kArm64Float64Min: {
-      __ Fmin(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-              i.InputDoubleRegister(1));
-      break;
-    }
-    case kArm64Float64Abs:
-      __ Fabs(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    case kArm64Float64Neg:
-      __ Fneg(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    case kArm64Float64Sqrt:
-      __ Fsqrt(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    case kArm64Float32ToFloat64:
-      __ Fcvt(i.OutputDoubleRegister(), i.InputDoubleRegister(0).S());
-      break;
-    case kArm64Float64ToFloat32:
-      __ Fcvt(i.OutputDoubleRegister().S(), i.InputDoubleRegister(0));
-      break;
-    case kArm64Float32ToInt32:
-      __ Fcvtzs(i.OutputRegister32(), i.InputFloat32Register(0));
-      // Avoid INT32_MAX as an overflow indicator and use INT32_MIN instead,
-      // because INT32_MIN allows easier out-of-bounds detection.
-      __ Cmn(i.OutputRegister32(), 1);
-      __ Csinc(i.OutputRegister32(), i.OutputRegister32(), i.OutputRegister32(),
-               vc);
-      break;
-    case kArm64Float64ToInt32:
-      __ Fcvtzs(i.OutputRegister32(), i.InputDoubleRegister(0));
-      break;
-    case kArm64Float32ToUint32:
-      __ Fcvtzu(i.OutputRegister32(), i.InputFloat32Register(0));
-      // Avoid UINT32_MAX as an overflow indicator and use 0 instead,
-      // because 0 allows easier out-of-bounds detection.
-      __ Cmn(i.OutputRegister32(), 1);
-      __ Adc(i.OutputRegister32(), i.OutputRegister32(), Operand(0));
-      break;
-    case kArm64Float64ToUint32:
-      __ Fcvtzu(i.OutputRegister32(), i.InputDoubleRegister(0));
-      break;
-    case kArm64Float32ToInt64:
-      __ Fcvtzs(i.OutputRegister64(), i.InputFloat32Register(0));
-      if (i.OutputCount() > 1) {
-        __ Mov(i.OutputRegister(1), 1);
-        Label done;
-        __ Cmp(i.OutputRegister(0), 1);
-        __ Ccmp(i.OutputRegister(0), -1, VFlag, vc);
-        __ Fccmp(i.InputFloat32Register(0), i.InputFloat32Register(0), VFlag,
-                 vc);
-        __ B(vc, &done);
-        __ Fcmp(i.InputFloat32Register(0), static_cast<float>(INT64_MIN));
-        __ Cset(i.OutputRegister(1), eq);
-        __ Bind(&done);
-      }
-      break;
-    case kArm64Float64ToInt64:
-      __ Fcvtzs(i.OutputRegister(0), i.InputDoubleRegister(0));
-      if (i.OutputCount() > 1) {
-        __ Mov(i.OutputRegister(1), 1);
-        Label done;
-        __ Cmp(i.OutputRegister(0), 1);
-        __ Ccmp(i.OutputRegister(0), -1, VFlag, vc);
-        __ Fccmp(i.InputDoubleRegister(0), i.InputDoubleRegister(0), VFlag, vc);
-        __ B(vc, &done);
-        __ Fcmp(i.InputDoubleRegister(0), static_cast<double>(INT64_MIN));
-        __ Cset(i.OutputRegister(1), eq);
-        __ Bind(&done);
-      }
-      break;
-    case kArm64Float32ToUint64:
-      __ Fcvtzu(i.OutputRegister64(), i.InputFloat32Register(0));
-      if (i.OutputCount() > 1) {
-        __ Fcmp(i.InputFloat32Register(0), -1.0);
-        __ Ccmp(i.OutputRegister(0), -1, ZFlag, gt);
-        __ Cset(i.OutputRegister(1), ne);
-      }
-      break;
-    case kArm64Float64ToUint64:
-      __ Fcvtzu(i.OutputRegister64(), i.InputDoubleRegister(0));
-      if (i.OutputCount() > 1) {
-        __ Fcmp(i.InputDoubleRegister(0), -1.0);
-        __ Ccmp(i.OutputRegister(0), -1, ZFlag, gt);
-        __ Cset(i.OutputRegister(1), ne);
-      }
-      break;
-    case kArm64Int32ToFloat32:
-      __ Scvtf(i.OutputFloat32Register(), i.InputRegister32(0));
-      break;
-    case kArm64Int32ToFloat64:
-      __ Scvtf(i.OutputDoubleRegister(), i.InputRegister32(0));
-      break;
-    case kArm64Int64ToFloat32:
-      __ Scvtf(i.OutputDoubleRegister().S(), i.InputRegister64(0));
-      break;
-    case kArm64Int64ToFloat64:
-      __ Scvtf(i.OutputDoubleRegister(), i.InputRegister64(0));
-      break;
-    case kArm64Uint32ToFloat32:
-      __ Ucvtf(i.OutputFloat32Register(), i.InputRegister32(0));
-      break;
-    case kArm64Uint32ToFloat64:
-      __ Ucvtf(i.OutputDoubleRegister(), i.InputRegister32(0));
-      break;
-    case kArm64Uint64ToFloat32:
-      __ Ucvtf(i.OutputDoubleRegister().S(), i.InputRegister64(0));
-      break;
-    case kArm64Uint64ToFloat64:
-      __ Ucvtf(i.OutputDoubleRegister(), i.InputRegister64(0));
-      break;
-    case kArm64Float64ExtractLowWord32:
-      __ Fmov(i.OutputRegister32(), i.InputFloat32Register(0));
-      break;
-    case kArm64Float64ExtractHighWord32:
-      __ Umov(i.OutputRegister32(), i.InputFloat64Register(0).V2S(), 1);
-      break;
-    case kArm64Float64InsertLowWord32:
-      DCHECK(i.OutputFloat64Register().Is(i.InputFloat64Register(0)));
-      __ Ins(i.OutputFloat64Register().V2S(), 0, i.InputRegister32(1));
-      break;
-    case kArm64Float64InsertHighWord32:
-      DCHECK(i.OutputFloat64Register().Is(i.InputFloat64Register(0)));
-      __ Ins(i.OutputFloat64Register().V2S(), 1, i.InputRegister32(1));
-      break;
-    case kArm64Float64MoveU64:
-      __ Fmov(i.OutputFloat64Register(), i.InputRegister(0));
-      break;
-    case kArm64Float64SilenceNaN:
-      __ CanonicalizeNaN(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    case kArm64U64MoveFloat64:
-      __ Fmov(i.OutputRegister(), i.InputDoubleRegister(0));
-      break;
-    case kArm64Ldrb:
-      __ Ldrb(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kArm64Ldrsb:
-      __ Ldrsb(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kArm64Strb:
-      __ Strb(i.InputOrZeroRegister64(0), i.MemoryOperand(1));
-      break;
-    case kArm64Ldrh:
-      __ Ldrh(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kArm64Ldrsh:
-      __ Ldrsh(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kArm64Strh:
-      __ Strh(i.InputOrZeroRegister64(0), i.MemoryOperand(1));
-      break;
-    case kArm64Ldrsw:
-      __ Ldrsw(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kArm64LdrW:
-      __ Ldr(i.OutputRegister32(), i.MemoryOperand());
-      break;
-    case kArm64StrW:
-      __ Str(i.InputOrZeroRegister32(0), i.MemoryOperand(1));
-      break;
-    case kArm64Ldr:
-      __ Ldr(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kArm64Str:
-      __ Str(i.InputOrZeroRegister64(0), i.MemoryOperand(1));
-      break;
-    case kArm64LdrS:
-      __ Ldr(i.OutputDoubleRegister().S(), i.MemoryOperand());
-      break;
-    case kArm64StrS:
-      __ Str(i.InputFloat32OrZeroRegister(0), i.MemoryOperand(1));
-      break;
-    case kArm64LdrD:
-      __ Ldr(i.OutputDoubleRegister(), i.MemoryOperand());
-      break;
-    case kArm64StrD:
-      __ Str(i.InputFloat64OrZeroRegister(0), i.MemoryOperand(1));
-      break;
-    case kArm64LdrQ:
-      __ Ldr(i.OutputSimd128Register(), i.MemoryOperand());
-      break;
-    case kArm64StrQ:
-      __ Str(i.InputSimd128Register(0), i.MemoryOperand(1));
-      break;
-    case kAtomicLoadInt8:
-      ASSEMBLE_ATOMIC_LOAD_INTEGER(Ldarb);
-      __ Sxtb(i.OutputRegister(0), i.OutputRegister(0));
-      break;
-    case kAtomicLoadUint8:
-      ASSEMBLE_ATOMIC_LOAD_INTEGER(Ldarb);
-      break;
-    case kAtomicLoadInt16:
-      ASSEMBLE_ATOMIC_LOAD_INTEGER(Ldarh);
-      __ Sxth(i.OutputRegister(0), i.OutputRegister(0));
-      break;
-    case kAtomicLoadUint16:
-      ASSEMBLE_ATOMIC_LOAD_INTEGER(Ldarh);
-      break;
-    case kAtomicLoadWord32:
-      ASSEMBLE_ATOMIC_LOAD_INTEGER(Ldar);
-      break;
-    case kAtomicStoreWord8:
-      ASSEMBLE_ATOMIC_STORE_INTEGER(Stlrb);
-      break;
-    case kAtomicStoreWord16:
-      ASSEMBLE_ATOMIC_STORE_INTEGER(Stlrh);
-      break;
-    case kAtomicStoreWord32:
-      ASSEMBLE_ATOMIC_STORE_INTEGER(Stlr);
-      break;
-    case kAtomicExchangeInt8:
-      ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(ldaxrb, stlxrb);
-      __ Sxtb(i.OutputRegister(0), i.OutputRegister(0));
-      break;
-    case kAtomicExchangeUint8:
-      ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(ldaxrb, stlxrb);
-      break;
-    case kAtomicExchangeInt16:
-      ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(ldaxrh, stlxrh);
-      __ Sxth(i.OutputRegister(0), i.OutputRegister(0));
-      break;
-    case kAtomicExchangeUint16:
-      ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(ldaxrh, stlxrh);
-      break;
-    case kAtomicExchangeWord32:
-      ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(ldaxr, stlxr);
-      break;
-    case kAtomicCompareExchangeInt8:
-      ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER(ldaxrb, stlxrb, UXTB);
-      __ Sxtb(i.OutputRegister(0), i.OutputRegister(0));
-      break;
-    case kAtomicCompareExchangeUint8:
-      ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER(ldaxrb, stlxrb, UXTB);
-      break;
-    case kAtomicCompareExchangeInt16:
-      ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER(ldaxrh, stlxrh, UXTH);
-      __ Sxth(i.OutputRegister(0), i.OutputRegister(0));
-      break;
-    case kAtomicCompareExchangeUint16:
-      ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER(ldaxrh, stlxrh, UXTH);
-      break;
-    case kAtomicCompareExchangeWord32:
-      ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER(ldaxr, stlxr, UXTW);
-      break;
-#define ATOMIC_BINOP_CASE(op, inst)                    \
-  case kAtomic##op##Int8:                              \
-    ASSEMBLE_ATOMIC_BINOP(ldaxrb, stlxrb, inst);       \
-    __ Sxtb(i.OutputRegister(0), i.OutputRegister(0)); \
-    break;                                             \
-  case kAtomic##op##Uint8:                             \
-    ASSEMBLE_ATOMIC_BINOP(ldaxrb, stlxrb, inst);       \
-    break;                                             \
-  case kAtomic##op##Int16:                             \
-    ASSEMBLE_ATOMIC_BINOP(ldaxrh, stlxrh, inst);       \
-    __ Sxth(i.OutputRegister(0), i.OutputRegister(0)); \
-    break;                                             \
-  case kAtomic##op##Uint16:                            \
-    ASSEMBLE_ATOMIC_BINOP(ldaxrh, stlxrh, inst);       \
-    break;                                             \
-  case kAtomic##op##Word32:                            \
-    ASSEMBLE_ATOMIC_BINOP(ldaxr, stlxr, inst);         \
-    break;
-      ATOMIC_BINOP_CASE(Add, Add)
-      ATOMIC_BINOP_CASE(Sub, Sub)
-      ATOMIC_BINOP_CASE(And, And)
-      ATOMIC_BINOP_CASE(Or, Orr)
-      ATOMIC_BINOP_CASE(Xor, Eor)
-#undef ATOMIC_BINOP_CASE
-#undef ASSEMBLE_SHIFT
-#undef ASSEMBLE_ATOMIC_LOAD_INTEGER
-#undef ASSEMBLE_ATOMIC_STORE_INTEGER
-#undef ASSEMBLE_ATOMIC_EXCHANGE_INTEGER
-#undef ASSEMBLE_ATOMIC_BINOP
-#undef ASSEMBLE_IEEE754_BINOP
-#undef ASSEMBLE_IEEE754_UNOP
-#undef ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER
-
-#define SIMD_UNOP_CASE(Op, Instr, FORMAT)            \
-  case Op:                                           \
-    __ Instr(i.OutputSimd128Register().V##FORMAT(),  \
-             i.InputSimd128Register(0).V##FORMAT()); \
-    break;
-#define SIMD_WIDENING_UNOP_CASE(Op, Instr, WIDE, NARROW) \
-  case Op:                                               \
-    __ Instr(i.OutputSimd128Register().V##WIDE(),        \
-             i.InputSimd128Register(0).V##NARROW());     \
-    break;
-#define SIMD_BINOP_CASE(Op, Instr, FORMAT)           \
-  case Op:                                           \
-    __ Instr(i.OutputSimd128Register().V##FORMAT(),  \
-             i.InputSimd128Register(0).V##FORMAT(),  \
-             i.InputSimd128Register(1).V##FORMAT()); \
-    break;
-
-    case kArm64F32x4Splat: {
-      __ Dup(i.OutputSimd128Register().V4S(), i.InputSimd128Register(0).S(), 0);
-      break;
-    }
-    case kArm64F32x4ExtractLane: {
-      __ Mov(i.OutputSimd128Register().S(), i.InputSimd128Register(0).V4S(),
-             i.InputInt8(1));
-      break;
-    }
-    case kArm64F32x4ReplaceLane: {
-      VRegister dst = i.OutputSimd128Register().V4S(),
-                src1 = i.InputSimd128Register(0).V4S();
-      if (!dst.is(src1)) {
-        __ Mov(dst, src1);
-      }
-      __ Mov(dst, i.InputInt8(1), i.InputSimd128Register(2).V4S(), 0);
-      break;
-    }
-      SIMD_UNOP_CASE(kArm64F32x4SConvertI32x4, Scvtf, 4S);
-      SIMD_UNOP_CASE(kArm64F32x4UConvertI32x4, Ucvtf, 4S);
-      SIMD_UNOP_CASE(kArm64F32x4Abs, Fabs, 4S);
-      SIMD_UNOP_CASE(kArm64F32x4Neg, Fneg, 4S);
-      SIMD_UNOP_CASE(kArm64F32x4RecipApprox, Frecpe, 4S);
-      SIMD_UNOP_CASE(kArm64F32x4RecipSqrtApprox, Frsqrte, 4S);
-      SIMD_BINOP_CASE(kArm64F32x4Add, Fadd, 4S);
-      SIMD_BINOP_CASE(kArm64F32x4AddHoriz, Faddp, 4S);
-      SIMD_BINOP_CASE(kArm64F32x4Sub, Fsub, 4S);
-      SIMD_BINOP_CASE(kArm64F32x4Mul, Fmul, 4S);
-      SIMD_BINOP_CASE(kArm64F32x4Min, Fmin, 4S);
-      SIMD_BINOP_CASE(kArm64F32x4Max, Fmax, 4S);
-      SIMD_BINOP_CASE(kArm64F32x4Eq, Fcmeq, 4S);
-    case kArm64F32x4Ne: {
-      VRegister dst = i.OutputSimd128Register().V4S();
-      __ Fcmeq(dst, i.InputSimd128Register(0).V4S(),
-               i.InputSimd128Register(1).V4S());
-      __ Mvn(dst, dst);
-      break;
-    }
-    case kArm64F32x4Lt: {
-      __ Fcmgt(i.OutputSimd128Register().V4S(), i.InputSimd128Register(1).V4S(),
-               i.InputSimd128Register(0).V4S());
-      break;
-    }
-    case kArm64F32x4Le: {
-      __ Fcmge(i.OutputSimd128Register().V4S(), i.InputSimd128Register(1).V4S(),
-               i.InputSimd128Register(0).V4S());
-      break;
-    }
-    case kArm64I32x4Splat: {
-      __ Dup(i.OutputSimd128Register().V4S(), i.InputRegister32(0));
-      break;
-    }
-    case kArm64I32x4ExtractLane: {
-      __ Mov(i.OutputRegister32(), i.InputSimd128Register(0).V4S(),
-             i.InputInt8(1));
-      break;
-    }
-    case kArm64I32x4ReplaceLane: {
-      VRegister dst = i.OutputSimd128Register().V4S(),
-                src1 = i.InputSimd128Register(0).V4S();
-      if (!dst.is(src1)) {
-        __ Mov(dst, src1);
-      }
-      __ Mov(dst, i.InputInt8(1), i.InputRegister32(2));
-      break;
-    }
-      SIMD_UNOP_CASE(kArm64I32x4SConvertF32x4, Fcvtzs, 4S);
-      SIMD_WIDENING_UNOP_CASE(kArm64I32x4SConvertI16x8Low, Sxtl, 4S, 4H);
-      SIMD_WIDENING_UNOP_CASE(kArm64I32x4SConvertI16x8High, Sxtl2, 4S, 8H);
-      SIMD_UNOP_CASE(kArm64I32x4Neg, Neg, 4S);
-    case kArm64I32x4Shl: {
-      __ Shl(i.OutputSimd128Register().V4S(), i.InputSimd128Register(0).V4S(),
-             i.InputInt5(1));
-      break;
-    }
-    case kArm64I32x4ShrS: {
-      __ Sshr(i.OutputSimd128Register().V4S(), i.InputSimd128Register(0).V4S(),
-              i.InputInt5(1));
-      break;
-    }
-      SIMD_BINOP_CASE(kArm64I32x4Add, Add, 4S);
-      SIMD_BINOP_CASE(kArm64I32x4AddHoriz, Addp, 4S);
-      SIMD_BINOP_CASE(kArm64I32x4Sub, Sub, 4S);
-      SIMD_BINOP_CASE(kArm64I32x4Mul, Mul, 4S);
-      SIMD_BINOP_CASE(kArm64I32x4MinS, Smin, 4S);
-      SIMD_BINOP_CASE(kArm64I32x4MaxS, Smax, 4S);
-      SIMD_BINOP_CASE(kArm64I32x4Eq, Cmeq, 4S);
-    case kArm64I32x4Ne: {
-      VRegister dst = i.OutputSimd128Register().V4S();
-      __ Cmeq(dst, i.InputSimd128Register(0).V4S(),
-              i.InputSimd128Register(1).V4S());
-      __ Mvn(dst, dst);
-      break;
-    }
-      SIMD_BINOP_CASE(kArm64I32x4GtS, Cmgt, 4S);
-      SIMD_BINOP_CASE(kArm64I32x4GeS, Cmge, 4S);
-      SIMD_UNOP_CASE(kArm64I32x4UConvertF32x4, Fcvtzu, 4S);
-      SIMD_WIDENING_UNOP_CASE(kArm64I32x4UConvertI16x8Low, Uxtl, 4S, 4H);
-      SIMD_WIDENING_UNOP_CASE(kArm64I32x4UConvertI16x8High, Uxtl2, 4S, 8H);
-    case kArm64I32x4ShrU: {
-      __ Ushr(i.OutputSimd128Register().V4S(), i.InputSimd128Register(0).V4S(),
-              i.InputInt5(1));
-      break;
-    }
-      SIMD_BINOP_CASE(kArm64I32x4MinU, Umin, 4S);
-      SIMD_BINOP_CASE(kArm64I32x4MaxU, Umax, 4S);
-      SIMD_BINOP_CASE(kArm64I32x4GtU, Cmhi, 4S);
-      SIMD_BINOP_CASE(kArm64I32x4GeU, Cmhs, 4S);
-    case kArm64I16x8Splat: {
-      __ Dup(i.OutputSimd128Register().V8H(), i.InputRegister32(0));
-      break;
-    }
-    case kArm64I16x8ExtractLane: {
-      __ Smov(i.OutputRegister32(), i.InputSimd128Register(0).V8H(),
-              i.InputInt8(1));
-      break;
-    }
-    case kArm64I16x8ReplaceLane: {
-      VRegister dst = i.OutputSimd128Register().V8H(),
-                src1 = i.InputSimd128Register(0).V8H();
-      if (!dst.is(src1)) {
-        __ Mov(dst, src1);
-      }
-      __ Mov(dst, i.InputInt8(1), i.InputRegister32(2));
-      break;
-    }
-      SIMD_WIDENING_UNOP_CASE(kArm64I16x8SConvertI8x16Low, Sxtl, 8H, 8B);
-      SIMD_WIDENING_UNOP_CASE(kArm64I16x8SConvertI8x16High, Sxtl2, 8H, 16B);
-      SIMD_UNOP_CASE(kArm64I16x8Neg, Neg, 8H);
-    case kArm64I16x8Shl: {
-      __ Shl(i.OutputSimd128Register().V8H(), i.InputSimd128Register(0).V8H(),
-             i.InputInt5(1));
-      break;
-    }
-    case kArm64I16x8ShrS: {
-      __ Sshr(i.OutputSimd128Register().V8H(), i.InputSimd128Register(0).V8H(),
-              i.InputInt5(1));
-      break;
-    }
-    case kArm64I16x8SConvertI32x4: {
-      VRegister dst = i.OutputSimd128Register(),
-                src0 = i.InputSimd128Register(0),
-                src1 = i.InputSimd128Register(1);
-      UseScratchRegisterScope scope(tasm());
-      VRegister temp = scope.AcquireV(kFormat4S);
-      if (dst.is(src1)) {
-        __ Mov(temp, src1.V4S());
-        src1 = temp;
-      }
-      __ Sqxtn(dst.V4H(), src0.V4S());
-      __ Sqxtn2(dst.V8H(), src1.V4S());
-      break;
-    }
-      SIMD_BINOP_CASE(kArm64I16x8Add, Add, 8H);
-      SIMD_BINOP_CASE(kArm64I16x8AddSaturateS, Sqadd, 8H);
-      SIMD_BINOP_CASE(kArm64I16x8AddHoriz, Addp, 8H);
-      SIMD_BINOP_CASE(kArm64I16x8Sub, Sub, 8H);
-      SIMD_BINOP_CASE(kArm64I16x8SubSaturateS, Sqsub, 8H);
-      SIMD_BINOP_CASE(kArm64I16x8Mul, Mul, 8H);
-      SIMD_BINOP_CASE(kArm64I16x8MinS, Smin, 8H);
-      SIMD_BINOP_CASE(kArm64I16x8MaxS, Smax, 8H);
-      SIMD_BINOP_CASE(kArm64I16x8Eq, Cmeq, 8H);
-    case kArm64I16x8Ne: {
-      VRegister dst = i.OutputSimd128Register().V8H();
-      __ Cmeq(dst, i.InputSimd128Register(0).V8H(),
-              i.InputSimd128Register(1).V8H());
-      __ Mvn(dst, dst);
-      break;
-    }
-      SIMD_BINOP_CASE(kArm64I16x8GtS, Cmgt, 8H);
-      SIMD_BINOP_CASE(kArm64I16x8GeS, Cmge, 8H);
-    case kArm64I16x8UConvertI8x16Low: {
-      __ Uxtl(i.OutputSimd128Register().V8H(), i.InputSimd128Register(0).V8B());
-      break;
-    }
-    case kArm64I16x8UConvertI8x16High: {
-      __ Uxtl2(i.OutputSimd128Register().V8H(),
-               i.InputSimd128Register(0).V16B());
-      break;
-    }
-    case kArm64I16x8ShrU: {
-      __ Ushr(i.OutputSimd128Register().V8H(), i.InputSimd128Register(0).V8H(),
-              i.InputInt5(1));
-      break;
-    }
-    case kArm64I16x8UConvertI32x4: {
-      VRegister dst = i.OutputSimd128Register(),
-                src0 = i.InputSimd128Register(0),
-                src1 = i.InputSimd128Register(1);
-      UseScratchRegisterScope scope(tasm());
-      VRegister temp = scope.AcquireV(kFormat4S);
-      if (dst.is(src1)) {
-        __ Mov(temp, src1.V4S());
-        src1 = temp;
-      }
-      __ Uqxtn(dst.V4H(), src0.V4S());
-      __ Uqxtn2(dst.V8H(), src1.V4S());
-      break;
-    }
-      SIMD_BINOP_CASE(kArm64I16x8AddSaturateU, Uqadd, 8H);
-      SIMD_BINOP_CASE(kArm64I16x8SubSaturateU, Uqsub, 8H);
-      SIMD_BINOP_CASE(kArm64I16x8MinU, Umin, 8H);
-      SIMD_BINOP_CASE(kArm64I16x8MaxU, Umax, 8H);
-      SIMD_BINOP_CASE(kArm64I16x8GtU, Cmhi, 8H);
-      SIMD_BINOP_CASE(kArm64I16x8GeU, Cmhs, 8H);
-    case kArm64I8x16Splat: {
-      __ Dup(i.OutputSimd128Register().V16B(), i.InputRegister32(0));
-      break;
-    }
-    case kArm64I8x16ExtractLane: {
-      __ Smov(i.OutputRegister32(), i.InputSimd128Register(0).V16B(),
-              i.InputInt8(1));
-      break;
-    }
-    case kArm64I8x16ReplaceLane: {
-      VRegister dst = i.OutputSimd128Register().V16B(),
-                src1 = i.InputSimd128Register(0).V16B();
-      if (!dst.is(src1)) {
-        __ Mov(dst, src1);
-      }
-      __ Mov(dst, i.InputInt8(1), i.InputRegister32(2));
-      break;
-    }
-      SIMD_UNOP_CASE(kArm64I8x16Neg, Neg, 16B);
-    case kArm64I8x16Shl: {
-      __ Shl(i.OutputSimd128Register().V16B(), i.InputSimd128Register(0).V16B(),
-             i.InputInt5(1));
-      break;
-    }
-    case kArm64I8x16ShrS: {
-      __ Sshr(i.OutputSimd128Register().V16B(),
-              i.InputSimd128Register(0).V16B(), i.InputInt5(1));
-      break;
-    }
-    case kArm64I8x16SConvertI16x8: {
-      VRegister dst = i.OutputSimd128Register(),
-                src0 = i.InputSimd128Register(0),
-                src1 = i.InputSimd128Register(1);
-      UseScratchRegisterScope scope(tasm());
-      VRegister temp = scope.AcquireV(kFormat8H);
-      if (dst.is(src1)) {
-        __ Mov(temp, src1.V8H());
-        src1 = temp;
-      }
-      __ Sqxtn(dst.V8B(), src0.V8H());
-      __ Sqxtn2(dst.V16B(), src1.V8H());
-      break;
-    }
-      SIMD_BINOP_CASE(kArm64I8x16Add, Add, 16B);
-      SIMD_BINOP_CASE(kArm64I8x16AddSaturateS, Sqadd, 16B);
-      SIMD_BINOP_CASE(kArm64I8x16Sub, Sub, 16B);
-      SIMD_BINOP_CASE(kArm64I8x16SubSaturateS, Sqsub, 16B);
-      SIMD_BINOP_CASE(kArm64I8x16Mul, Mul, 16B);
-      SIMD_BINOP_CASE(kArm64I8x16MinS, Smin, 16B);
-      SIMD_BINOP_CASE(kArm64I8x16MaxS, Smax, 16B);
-      SIMD_BINOP_CASE(kArm64I8x16Eq, Cmeq, 16B);
-    case kArm64I8x16Ne: {
-      VRegister dst = i.OutputSimd128Register().V16B();
-      __ Cmeq(dst, i.InputSimd128Register(0).V16B(),
-              i.InputSimd128Register(1).V16B());
-      __ Mvn(dst, dst);
-      break;
-    }
-      SIMD_BINOP_CASE(kArm64I8x16GtS, Cmgt, 16B);
-      SIMD_BINOP_CASE(kArm64I8x16GeS, Cmge, 16B);
-    case kArm64I8x16ShrU: {
-      __ Ushr(i.OutputSimd128Register().V16B(),
-              i.InputSimd128Register(0).V16B(), i.InputInt5(1));
-      break;
-    }
-    case kArm64I8x16UConvertI16x8: {
-      VRegister dst = i.OutputSimd128Register(),
-                src0 = i.InputSimd128Register(0),
-                src1 = i.InputSimd128Register(1);
-      UseScratchRegisterScope scope(tasm());
-      VRegister temp = scope.AcquireV(kFormat8H);
-      if (dst.is(src1)) {
-        __ Mov(temp, src1.V8H());
-        src1 = temp;
-      }
-      __ Uqxtn(dst.V8B(), src0.V8H());
-      __ Uqxtn2(dst.V16B(), src1.V8H());
-      break;
-    }
-      SIMD_BINOP_CASE(kArm64I8x16AddSaturateU, Uqadd, 16B);
-      SIMD_BINOP_CASE(kArm64I8x16SubSaturateU, Uqsub, 16B);
-      SIMD_BINOP_CASE(kArm64I8x16MinU, Umin, 16B);
-      SIMD_BINOP_CASE(kArm64I8x16MaxU, Umax, 16B);
-      SIMD_BINOP_CASE(kArm64I8x16GtU, Cmhi, 16B);
-      SIMD_BINOP_CASE(kArm64I8x16GeU, Cmhs, 16B);
-    case kArm64S128Zero: {
-      __ Movi(i.OutputSimd128Register().V16B(), 0);
-      break;
-    }
-      SIMD_BINOP_CASE(kArm64S128And, And, 16B);
-      SIMD_BINOP_CASE(kArm64S128Or, Orr, 16B);
-      SIMD_BINOP_CASE(kArm64S128Xor, Eor, 16B);
-      SIMD_UNOP_CASE(kArm64S128Not, Mvn, 16B);
-    case kArm64S128Dup: {
-      VRegister dst = i.OutputSimd128Register(),
-                src = i.InputSimd128Register(0);
-      int lanes = i.InputInt32(1);
-      int index = i.InputInt32(2);
-      switch (lanes) {
-        case 4:
-          __ Dup(dst.V4S(), src.V4S(), index);
-          break;
-        case 8:
-          __ Dup(dst.V8H(), src.V8H(), index);
-          break;
-        case 16:
-          __ Dup(dst.V16B(), src.V16B(), index);
-          break;
-        default:
-          UNREACHABLE();
-          break;
-      }
-      break;
-    }
-    case kArm64S128Select: {
-      VRegister dst = i.OutputSimd128Register().V16B();
-      DCHECK(dst.is(i.InputSimd128Register(0).V16B()));
-      __ Bsl(dst, i.InputSimd128Register(1).V16B(),
-             i.InputSimd128Register(2).V16B());
-      break;
-    }
-    case kArm64S32x4Shuffle: {
-      Simd128Register dst = i.OutputSimd128Register().V4S(),
-                      src0 = i.InputSimd128Register(0).V4S(),
-                      src1 = i.InputSimd128Register(1).V4S();
-      // Check for in-place shuffles.
-      // If dst == src0 == src1, then the shuffle is unary and we only use src0.
-      UseScratchRegisterScope scope(tasm());
-      VRegister temp = scope.AcquireV(kFormat4S);
-      if (dst.is(src0)) {
-        __ Mov(temp, src0);
-        src0 = temp;
-      } else if (dst.is(src1)) {
-        __ Mov(temp, src1);
-        src1 = temp;
-      }
-      // Perform shuffle as a vmov per lane.
-      int32_t shuffle = i.InputInt32(2);
-      for (int i = 0; i < 4; i++) {
-        VRegister src = src0;
-        int lane = shuffle & 0x7;
-        if (lane >= 4) {
-          src = src1;
-          lane &= 0x3;
-        }
-        __ Mov(dst, i, src, lane);
-        shuffle >>= 8;
-      }
-      break;
-    }
-      SIMD_BINOP_CASE(kArm64S32x4ZipLeft, Zip1, 4S);
-      SIMD_BINOP_CASE(kArm64S32x4ZipRight, Zip2, 4S);
-      SIMD_BINOP_CASE(kArm64S32x4UnzipLeft, Uzp1, 4S);
-      SIMD_BINOP_CASE(kArm64S32x4UnzipRight, Uzp2, 4S);
-      SIMD_BINOP_CASE(kArm64S32x4TransposeLeft, Trn1, 4S);
-      SIMD_BINOP_CASE(kArm64S32x4TransposeRight, Trn2, 4S);
-      SIMD_BINOP_CASE(kArm64S16x8ZipLeft, Zip1, 8H);
-      SIMD_BINOP_CASE(kArm64S16x8ZipRight, Zip2, 8H);
-      SIMD_BINOP_CASE(kArm64S16x8UnzipLeft, Uzp1, 8H);
-      SIMD_BINOP_CASE(kArm64S16x8UnzipRight, Uzp2, 8H);
-      SIMD_BINOP_CASE(kArm64S16x8TransposeLeft, Trn1, 8H);
-      SIMD_BINOP_CASE(kArm64S16x8TransposeRight, Trn2, 8H);
-      SIMD_BINOP_CASE(kArm64S8x16ZipLeft, Zip1, 16B);
-      SIMD_BINOP_CASE(kArm64S8x16ZipRight, Zip2, 16B);
-      SIMD_BINOP_CASE(kArm64S8x16UnzipLeft, Uzp1, 16B);
-      SIMD_BINOP_CASE(kArm64S8x16UnzipRight, Uzp2, 16B);
-      SIMD_BINOP_CASE(kArm64S8x16TransposeLeft, Trn1, 16B);
-      SIMD_BINOP_CASE(kArm64S8x16TransposeRight, Trn2, 16B);
-    case kArm64S8x16Concat: {
-      __ Ext(i.OutputSimd128Register().V16B(), i.InputSimd128Register(0).V16B(),
-             i.InputSimd128Register(1).V16B(), i.InputInt4(2));
-      break;
-    }
-    case kArm64S8x16Shuffle: {
-      Simd128Register dst = i.OutputSimd128Register().V16B(),
-                      src0 = i.InputSimd128Register(0).V16B(),
-                      src1 = i.InputSimd128Register(1).V16B();
-      // Unary shuffle table is in src0, binary shuffle table is in src0, src1,
-      // which must be consecutive.
-      int64_t mask = 0;
-      if (src0.is(src1)) {
-        mask = 0x0F0F0F0F;
-      } else {
-        mask = 0x1F1F1F1F;
-        DCHECK(AreConsecutive(src0, src1));
-      }
-      int64_t imm1 =
-          (i.InputInt32(2) & mask) | ((i.InputInt32(3) & mask) << 32);
-      int64_t imm2 =
-          (i.InputInt32(4) & mask) | ((i.InputInt32(5) & mask) << 32);
-      UseScratchRegisterScope scope(tasm());
-      VRegister temp = scope.AcquireV(kFormat16B);
-      __ Movi(temp, imm2, imm1);
-
-      if (src0.is(src1)) {
-        __ Tbl(dst, src0, temp.V16B());
-      } else {
-        __ Tbl(dst, src0, src1, temp.V16B());
-      }
-      break;
-    }
-      SIMD_UNOP_CASE(kArm64S32x2Reverse, Rev64, 4S);
-      SIMD_UNOP_CASE(kArm64S16x4Reverse, Rev64, 8H);
-      SIMD_UNOP_CASE(kArm64S16x2Reverse, Rev32, 8H);
-      SIMD_UNOP_CASE(kArm64S8x8Reverse, Rev64, 16B);
-      SIMD_UNOP_CASE(kArm64S8x4Reverse, Rev32, 16B);
-      SIMD_UNOP_CASE(kArm64S8x2Reverse, Rev16, 16B);
-
-#define SIMD_REDUCE_OP_CASE(Op, Instr, format, FORMAT)     \
-  case Op: {                                               \
-    UseScratchRegisterScope scope(tasm());                 \
-    VRegister temp = scope.AcquireV(format);               \
-    __ Instr(temp, i.InputSimd128Register(0).V##FORMAT()); \
-    __ Umov(i.OutputRegister32(), temp, 0);                \
-    break;                                                 \
-  }
-      SIMD_REDUCE_OP_CASE(kArm64S1x4AnyTrue, Umaxv, kFormatS, 4S);
-      SIMD_REDUCE_OP_CASE(kArm64S1x4AllTrue, Uminv, kFormatS, 4S);
-      SIMD_REDUCE_OP_CASE(kArm64S1x8AnyTrue, Umaxv, kFormatH, 8H);
-      SIMD_REDUCE_OP_CASE(kArm64S1x8AllTrue, Uminv, kFormatH, 8H);
-      SIMD_REDUCE_OP_CASE(kArm64S1x16AnyTrue, Umaxv, kFormatB, 16B);
-      SIMD_REDUCE_OP_CASE(kArm64S1x16AllTrue, Uminv, kFormatB, 16B);
-  }
-  return kSuccess;
-}  // NOLINT(readability/fn_size)
-
-#undef SIMD_UNOP_CASE
-#undef SIMD_WIDENING_UNOP_CASE
-#undef SIMD_BINOP_CASE
-#undef SIMD_REDUCE_OP_CASE
-
-// Assemble branches after this instruction.
-void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) {
-  Arm64OperandConverter i(this, instr);
-  Label* tlabel = branch->true_label;
-  Label* flabel = branch->false_label;
-  FlagsCondition condition = branch->condition;
-  ArchOpcode opcode = instr->arch_opcode();
-
-  if (opcode == kArm64CompareAndBranch32) {
-    switch (condition) {
-      case kEqual:
-        __ Cbz(i.InputRegister32(0), tlabel);
-        break;
-      case kNotEqual:
-        __ Cbnz(i.InputRegister32(0), tlabel);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  } else if (opcode == kArm64CompareAndBranch) {
-    switch (condition) {
-      case kEqual:
-        __ Cbz(i.InputRegister64(0), tlabel);
-        break;
-      case kNotEqual:
-        __ Cbnz(i.InputRegister64(0), tlabel);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  } else if (opcode == kArm64TestAndBranch32) {
-    switch (condition) {
-      case kEqual:
-        __ Tbz(i.InputRegister32(0), i.InputInt5(1), tlabel);
-        break;
-      case kNotEqual:
-        __ Tbnz(i.InputRegister32(0), i.InputInt5(1), tlabel);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  } else if (opcode == kArm64TestAndBranch) {
-    switch (condition) {
-      case kEqual:
-        __ Tbz(i.InputRegister64(0), i.InputInt6(1), tlabel);
-        break;
-      case kNotEqual:
-        __ Tbnz(i.InputRegister64(0), i.InputInt6(1), tlabel);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  } else {
-    Condition cc = FlagsConditionToCondition(condition);
-    __ B(cc, tlabel);
-  }
-  if (!branch->fallthru) __ B(flabel);  // no fallthru to flabel.
-}
-
-void CodeGenerator::AssembleArchDeoptBranch(Instruction* instr,
-                                            BranchInfo* branch) {
-  AssembleArchBranch(instr, branch);
-}
-
-void CodeGenerator::AssembleArchJump(RpoNumber target) {
-  if (!IsNextInAssemblyOrder(target)) __ B(GetLabel(target));
-}
-
-void CodeGenerator::AssembleArchTrap(Instruction* instr,
-                                     FlagsCondition condition) {
-  class OutOfLineTrap final : public OutOfLineCode {
-   public:
-    OutOfLineTrap(CodeGenerator* gen, bool frame_elided, Instruction* instr)
-        : OutOfLineCode(gen),
-          frame_elided_(frame_elided),
-          instr_(instr),
-          gen_(gen) {}
-    void Generate() final {
-      Arm64OperandConverter i(gen_, instr_);
-      Builtins::Name trap_id =
-          static_cast<Builtins::Name>(i.InputInt32(instr_->InputCount() - 1));
-      bool old_has_frame = __ has_frame();
-      if (frame_elided_) {
-        __ set_has_frame(true);
-        __ EnterFrame(StackFrame::WASM_COMPILED);
-      }
-      GenerateCallToTrap(trap_id);
-      if (frame_elided_) {
-        __ set_has_frame(old_has_frame);
-      }
-    }
-
-   private:
-    void GenerateCallToTrap(Builtins::Name trap_id) {
-      if (trap_id == Builtins::builtin_count) {
-        // We cannot test calls to the runtime in cctest/test-run-wasm.
-        // Therefore we emit a call to C here instead of a call to the runtime.
-        __ CallCFunction(ExternalReference::wasm_call_trap_callback_for_testing(
-                             __ isolate()),
-                         0);
-        __ LeaveFrame(StackFrame::WASM_COMPILED);
-        CallDescriptor* descriptor = gen_->linkage()->GetIncomingDescriptor();
-        int pop_count = static_cast<int>(descriptor->StackParameterCount());
-        pop_count += (pop_count & 1);  // align
-        __ Drop(pop_count);
-        __ Ret();
-      } else {
-        DCHECK(csp.Is(__ StackPointer()));
-        gen_->AssembleSourcePosition(instr_);
-        __ Call(__ isolate()->builtins()->builtin_handle(trap_id),
-                RelocInfo::CODE_TARGET);
-        ReferenceMap* reference_map =
-            new (gen_->zone()) ReferenceMap(gen_->zone());
-        gen_->RecordSafepoint(reference_map, Safepoint::kSimple, 0,
-                              Safepoint::kNoLazyDeopt);
-        if (FLAG_debug_code) {
-          // The trap code should never return.
-          __ Brk(0);
-        }
-      }
-    }
-    bool frame_elided_;
-    Instruction* instr_;
-    CodeGenerator* gen_;
-  };
-  bool frame_elided = !frame_access_state()->has_frame();
-  auto ool = new (zone()) OutOfLineTrap(this, frame_elided, instr);
-  Label* tlabel = ool->entry();
-  Condition cc = FlagsConditionToCondition(condition);
-  __ B(cc, tlabel);
-}
-
-// Assemble boolean materializations after this instruction.
-void CodeGenerator::AssembleArchBoolean(Instruction* instr,
-                                        FlagsCondition condition) {
-  Arm64OperandConverter i(this, instr);
-
-  // Materialize a full 64-bit 1 or 0 value. The result register is always the
-  // last output of the instruction.
-  DCHECK_NE(0u, instr->OutputCount());
-  Register reg = i.OutputRegister(instr->OutputCount() - 1);
-  Condition cc = FlagsConditionToCondition(condition);
-  __ Cset(reg, cc);
-}
-
-
-void CodeGenerator::AssembleArchLookupSwitch(Instruction* instr) {
-  Arm64OperandConverter i(this, instr);
-  Register input = i.InputRegister32(0);
-  for (size_t index = 2; index < instr->InputCount(); index += 2) {
-    __ Cmp(input, i.InputInt32(index + 0));
-    __ B(eq, GetLabel(i.InputRpo(index + 1)));
-  }
-  AssembleArchJump(i.InputRpo(1));
-}
-
-
-void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) {
-  Arm64OperandConverter i(this, instr);
-  UseScratchRegisterScope scope(tasm());
-  Register input = i.InputRegister32(0);
-  Register temp = scope.AcquireX();
-  size_t const case_count = instr->InputCount() - 2;
-  Label table;
-  __ Cmp(input, case_count);
-  __ B(hs, GetLabel(i.InputRpo(1)));
-  __ Adr(temp, &table);
-  __ Add(temp, temp, Operand(input, UXTW, 2));
-  __ Br(temp);
-  __ StartBlockPools();
-  __ Bind(&table);
-  for (size_t index = 0; index < case_count; ++index) {
-    __ B(GetLabel(i.InputRpo(index + 2)));
-  }
-  __ EndBlockPools();
-}
-
-void CodeGenerator::FinishFrame(Frame* frame) {
-  frame->AlignFrame(16);
-  CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
-
-  // Save FP registers.
-  CPURegList saves_fp = CPURegList(CPURegister::kVRegister, kDRegSizeInBits,
-                                   descriptor->CalleeSavedFPRegisters());
-  int saved_count = saves_fp.Count();
-  if (saved_count != 0) {
-    DCHECK(saves_fp.list() == CPURegList::GetCalleeSavedV().list());
-    DCHECK_EQ(saved_count % 2, 0);
-    frame->AllocateSavedCalleeRegisterSlots(saved_count *
-                                            (kDoubleSize / kPointerSize));
-  }
-
-  CPURegList saves = CPURegList(CPURegister::kRegister, kXRegSizeInBits,
-                                descriptor->CalleeSavedRegisters());
-  saved_count = saves.Count();
-  if (saved_count != 0) {
-    DCHECK_EQ(saved_count % 2, 0);
-    frame->AllocateSavedCalleeRegisterSlots(saved_count);
-  }
-}
-
-void CodeGenerator::AssembleConstructFrame() {
-  CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
-  __ AssertCspAligned();
-
-  // The frame has been previously padded in CodeGenerator::FinishFrame().
-  DCHECK_EQ(frame()->GetTotalFrameSlotCount() % 2, 0);
-  int shrink_slots =
-      frame()->GetTotalFrameSlotCount() - descriptor->CalculateFixedFrameSize();
-
-  CPURegList saves = CPURegList(CPURegister::kRegister, kXRegSizeInBits,
-                                descriptor->CalleeSavedRegisters());
-  CPURegList saves_fp = CPURegList(CPURegister::kVRegister, kDRegSizeInBits,
-                                   descriptor->CalleeSavedFPRegisters());
-  // The number of slots for returns has to be even to ensure the correct stack
-  // alignment.
-  const int returns = RoundUp(frame()->GetReturnSlotCount(), 2);
-
-  if (frame_access_state()->has_frame()) {
-    // Link the frame
-    if (descriptor->IsJSFunctionCall()) {
-      __ Prologue();
-    } else {
-      __ Push(lr, fp);
-      __ Mov(fp, __ StackPointer());
-    }
-    unwinding_info_writer_.MarkFrameConstructed(__ pc_offset());
-
-    // Create OSR entry if applicable
-    if (info()->is_osr()) {
-      // TurboFan OSR-compiled functions cannot be entered directly.
-      __ Abort(AbortReason::kShouldNotDirectlyEnterOsrFunction);
-
-      // Unoptimized code jumps directly to this entrypoint while the
-      // unoptimized frame is still on the stack. Optimized code uses OSR values
-      // directly from the unoptimized frame. Thus, all that needs to be done is
-      // to allocate the remaining stack slots.
-      if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --");
-      osr_pc_offset_ = __ pc_offset();
-      shrink_slots -= osr_helper()->UnoptimizedFrameSlots();
-    }
-
-    if (info()->IsWasm() && shrink_slots > 128) {
-      // For WebAssembly functions with big frames we have to do the stack
-      // overflow check before we construct the frame. Otherwise we may not
-      // have enough space on the stack to call the runtime for the stack
-      // overflow.
-      Label done;
-      // If the frame is bigger than the stack, we throw the stack overflow
-      // exception unconditionally. Thereby we can avoid the integer overflow
-      // check in the condition code.
-      if (shrink_slots * kPointerSize < FLAG_stack_size * 1024) {
-        UseScratchRegisterScope scope(tasm());
-        Register scratch = scope.AcquireX();
-        __ Mov(scratch, Operand(ExternalReference::address_of_real_stack_limit(
-                            __ isolate())));
-        __ Ldr(scratch, MemOperand(scratch));
-        __ Add(scratch, scratch, shrink_slots * kPointerSize);
-        __ Cmp(__ StackPointer(), scratch);
-        __ B(hs, &done);
-      }
-
-      if (!frame_access_state()->has_frame()) {
-        __ set_has_frame(true);
-        // There is no need to leave the frame, we will not return from the
-        // runtime call.
-        __ EnterFrame(StackFrame::WASM_COMPILED);
-      }
-      DCHECK(__ StackPointer().Is(csp));
-      __ AssertStackConsistency();
-      __ Mov(cp, Smi::kZero);
-      __ CallRuntimeDelayed(zone(), Runtime::kThrowWasmStackOverflow);
-      // We come from WebAssembly, there are no references for the GC.
-      ReferenceMap* reference_map = new (zone()) ReferenceMap(zone());
-      RecordSafepoint(reference_map, Safepoint::kSimple, 0,
-                      Safepoint::kNoLazyDeopt);
-      if (FLAG_debug_code) {
-        __ Brk(0);
-      }
-      __ AssertStackConsistency();
-      __ Bind(&done);
-    }
-
-    // Skip callee-saved slots, which are pushed below.
-    shrink_slots -= saves.Count();
-    shrink_slots -= saves_fp.Count();
-    shrink_slots -= returns;
-
-    // Build remainder of frame, including accounting for and filling-in
-    // frame-specific header information, i.e. claiming the extra slot that
-    // other platforms explicitly push for STUB (code object) frames and frames
-    // recording their argument count.
-    switch (descriptor->kind()) {
-      case CallDescriptor::kCallJSFunction:
-        if (descriptor->PushArgumentCount()) {
-          __ Claim(shrink_slots + 1);  // Claim extra slot for argc.
-          __ Str(kJavaScriptCallArgCountRegister,
-                 MemOperand(fp, OptimizedBuiltinFrameConstants::kArgCOffset));
-        } else {
-          __ Claim(shrink_slots);
-        }
-        break;
-      case CallDescriptor::kCallCodeObject:
-      case CallDescriptor::kCallWasmFunction: {
-        UseScratchRegisterScope temps(tasm());
-        __ Claim(shrink_slots + 1);  // Claim extra slot for frame type marker.
-        Register scratch = temps.AcquireX();
-        __ Mov(scratch,
-               StackFrame::TypeToMarker(info()->GetOutputStackFrameType()));
-        __ Str(scratch, MemOperand(fp, TypedFrameConstants::kFrameTypeOffset));
-      } break;
-      case CallDescriptor::kCallAddress:
-        __ Claim(shrink_slots);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  }
-
-  // Save FP registers.
-  DCHECK_IMPLIES(saves_fp.Count() != 0,
-                 saves_fp.list() == CPURegList::GetCalleeSavedV().list());
-  __ PushCPURegList(saves_fp);
-
-  // Save registers.
-  // TODO(palfia): TF save list is not in sync with
-  // CPURegList::GetCalleeSaved(): x30 is missing.
-  // DCHECK(saves.list() == CPURegList::GetCalleeSaved().list());
-  __ PushCPURegList(saves);
-
-  if (returns != 0) {
-    __ Claim(returns);
-  }
-}
-
-void CodeGenerator::AssembleReturn(InstructionOperand* pop) {
-  CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
-
-  const int returns = RoundUp(frame()->GetReturnSlotCount(), 2);
-
-  if (returns != 0) {
-    __ Drop(returns);
-  }
-
-  // Restore registers.
-  CPURegList saves = CPURegList(CPURegister::kRegister, kXRegSizeInBits,
-                                descriptor->CalleeSavedRegisters());
-  __ PopCPURegList(saves);
-
-  // Restore fp registers.
-  CPURegList saves_fp = CPURegList(CPURegister::kVRegister, kDRegSizeInBits,
-                                   descriptor->CalleeSavedFPRegisters());
-  __ PopCPURegList(saves_fp);
-
-  unwinding_info_writer_.MarkBlockWillExit();
-
-  Arm64OperandConverter g(this, nullptr);
-  int pop_count = static_cast<int>(descriptor->StackParameterCount());
-  if (descriptor->IsCFunctionCall()) {
-    AssembleDeconstructFrame();
-  } else if (frame_access_state()->has_frame()) {
-    // Canonicalize JSFunction return sites for now unless they have an variable
-    // number of stack slot pops.
-    if (pop->IsImmediate() && g.ToConstant(pop).ToInt32() == 0) {
-      if (return_label_.is_bound()) {
-        __ B(&return_label_);
-        return;
-      } else {
-        __ Bind(&return_label_);
-        AssembleDeconstructFrame();
-      }
-    } else {
-      AssembleDeconstructFrame();
-    }
-  }
-
-  if (pop->IsImmediate()) {
-    pop_count += g.ToConstant(pop).ToInt32();
-    __ DropArguments(pop_count);
-  } else {
-    Register pop_reg = g.ToRegister(pop);
-    __ Add(pop_reg, pop_reg, pop_count);
-    __ DropArguments(pop_reg);
-  }
-
-  __ AssertCspAligned();
-  __ Ret();
-}
-
-void CodeGenerator::FinishCode() { __ CheckConstPool(true, false); }
-
-void CodeGenerator::AssembleMove(InstructionOperand* source,
-                                 InstructionOperand* destination) {
-  Arm64OperandConverter g(this, nullptr);
-  // Dispatch on the source and destination operand kinds.  Not all
-  // combinations are possible.
-  if (source->IsRegister()) {
-    DCHECK(destination->IsRegister() || destination->IsStackSlot());
-    Register src = g.ToRegister(source);
-    if (destination->IsRegister()) {
-      __ Mov(g.ToRegister(destination), src);
-    } else {
-      __ Str(src, g.ToMemOperand(destination, tasm()));
-    }
-  } else if (source->IsStackSlot()) {
-    MemOperand src = g.ToMemOperand(source, tasm());
-    DCHECK(destination->IsRegister() || destination->IsStackSlot());
-    if (destination->IsRegister()) {
-      __ Ldr(g.ToRegister(destination), src);
-    } else {
-      UseScratchRegisterScope scope(tasm());
-      Register temp = scope.AcquireX();
-      __ Ldr(temp, src);
-      __ Str(temp, g.ToMemOperand(destination, tasm()));
-    }
-  } else if (source->IsConstant()) {
-    Constant src = g.ToConstant(ConstantOperand::cast(source));
-    if (destination->IsRegister() || destination->IsStackSlot()) {
-      UseScratchRegisterScope scope(tasm());
-      Register dst = destination->IsRegister() ? g.ToRegister(destination)
-                                               : scope.AcquireX();
-      if (src.type() == Constant::kHeapObject) {
-        Handle<HeapObject> src_object = src.ToHeapObject();
-        Heap::RootListIndex index;
-        if (IsMaterializableFromRoot(src_object, &index)) {
-          __ LoadRoot(dst, index);
-        } else {
-          __ Mov(dst, src_object);
-        }
-      } else {
-        __ Mov(dst, g.ToImmediate(source));
-      }
-      if (destination->IsStackSlot()) {
-        __ Str(dst, g.ToMemOperand(destination, tasm()));
-      }
-    } else if (src.type() == Constant::kFloat32) {
-      if (destination->IsFPRegister()) {
-        VRegister dst = g.ToDoubleRegister(destination).S();
-        __ Fmov(dst, src.ToFloat32());
-      } else {
-        DCHECK(destination->IsFPStackSlot());
-        if (bit_cast<int32_t>(src.ToFloat32()) == 0) {
-          __ Str(wzr, g.ToMemOperand(destination, tasm()));
-        } else {
-          UseScratchRegisterScope scope(tasm());
-          VRegister temp = scope.AcquireS();
-          __ Fmov(temp, src.ToFloat32());
-          __ Str(temp, g.ToMemOperand(destination, tasm()));
-        }
-      }
-    } else {
-      DCHECK_EQ(Constant::kFloat64, src.type());
-      if (destination->IsFPRegister()) {
-        VRegister dst = g.ToDoubleRegister(destination);
-        __ Fmov(dst, src.ToFloat64().value());
-      } else {
-        DCHECK(destination->IsFPStackSlot());
-        if (src.ToFloat64().AsUint64() == 0) {
-          __ Str(xzr, g.ToMemOperand(destination, tasm()));
-        } else {
-          UseScratchRegisterScope scope(tasm());
-          VRegister temp = scope.AcquireD();
-          __ Fmov(temp, src.ToFloat64().value());
-          __ Str(temp, g.ToMemOperand(destination, tasm()));
-        }
-      }
-    }
-  } else if (source->IsFPRegister()) {
-    VRegister src = g.ToDoubleRegister(source);
-    if (destination->IsFPRegister()) {
-      VRegister dst = g.ToDoubleRegister(destination);
-      if (destination->IsSimd128Register()) {
-        __ Mov(dst.Q(), src.Q());
-      } else {
-        __ Mov(dst, src);
-      }
-    } else {
-      DCHECK(destination->IsFPStackSlot());
-      MemOperand dst = g.ToMemOperand(destination, tasm());
-      if (destination->IsSimd128StackSlot()) {
-        __ Str(src.Q(), dst);
-      } else {
-        __ Str(src, dst);
-      }
-    }
-  } else if (source->IsFPStackSlot()) {
-    DCHECK(destination->IsFPRegister() || destination->IsFPStackSlot());
-    MemOperand src = g.ToMemOperand(source, tasm());
-    if (destination->IsFPRegister()) {
-      VRegister dst = g.ToDoubleRegister(destination);
-      if (destination->IsSimd128Register()) {
-        __ Ldr(dst.Q(), src);
-      } else {
-        __ Ldr(dst, src);
-      }
-    } else {
-      UseScratchRegisterScope scope(tasm());
-      VRegister temp = scope.AcquireD();
-      MemOperand dst = g.ToMemOperand(destination, tasm());
-      if (destination->IsSimd128StackSlot()) {
-        __ Ldr(temp.Q(), src);
-        __ Str(temp.Q(), dst);
-      } else {
-        __ Ldr(temp, src);
-        __ Str(temp, dst);
-      }
-    }
-  } else {
-    UNREACHABLE();
-  }
-}
-
-
-void CodeGenerator::AssembleSwap(InstructionOperand* source,
-                                 InstructionOperand* destination) {
-  Arm64OperandConverter g(this, nullptr);
-  // Dispatch on the source and destination operand kinds.  Not all
-  // combinations are possible.
-  if (source->IsRegister()) {
-    // Register-register.
-    UseScratchRegisterScope scope(tasm());
-    Register temp = scope.AcquireX();
-    Register src = g.ToRegister(source);
-    if (destination->IsRegister()) {
-      Register dst = g.ToRegister(destination);
-      __ Mov(temp, src);
-      __ Mov(src, dst);
-      __ Mov(dst, temp);
-    } else {
-      DCHECK(destination->IsStackSlot());
-      MemOperand dst = g.ToMemOperand(destination, tasm());
-      __ Mov(temp, src);
-      __ Ldr(src, dst);
-      __ Str(temp, dst);
-    }
-  } else if (source->IsStackSlot() || source->IsFPStackSlot()) {
-    UseScratchRegisterScope scope(tasm());
-    VRegister temp_0 = scope.AcquireD();
-    VRegister temp_1 = scope.AcquireD();
-    MemOperand src = g.ToMemOperand(source, tasm());
-    MemOperand dst = g.ToMemOperand(destination, tasm());
-    if (source->IsSimd128StackSlot()) {
-      __ Ldr(temp_0.Q(), src);
-      __ Ldr(temp_1.Q(), dst);
-      __ Str(temp_0.Q(), dst);
-      __ Str(temp_1.Q(), src);
-    } else {
-      __ Ldr(temp_0, src);
-      __ Ldr(temp_1, dst);
-      __ Str(temp_0, dst);
-      __ Str(temp_1, src);
-    }
-  } else if (source->IsFPRegister()) {
-    UseScratchRegisterScope scope(tasm());
-    VRegister temp = scope.AcquireD();
-    VRegister src = g.ToDoubleRegister(source);
-    if (destination->IsFPRegister()) {
-      VRegister dst = g.ToDoubleRegister(destination);
-      if (source->IsSimd128Register()) {
-        __ Mov(temp.Q(), src.Q());
-        __ Mov(src.Q(), dst.Q());
-        __ Mov(dst.Q(), temp.Q());
-      } else {
-        __ Mov(temp, src);
-        __ Mov(src, dst);
-        __ Mov(dst, temp);
-      }
-    } else {
-      DCHECK(destination->IsFPStackSlot());
-      MemOperand dst = g.ToMemOperand(destination, tasm());
-      if (source->IsSimd128Register()) {
-        __ Mov(temp.Q(), src.Q());
-        __ Ldr(src.Q(), dst);
-        __ Str(temp.Q(), dst);
-      } else {
-        __ Mov(temp, src);
-        __ Ldr(src, dst);
-        __ Str(temp, dst);
-      }
-    }
-  } else {
-    // No other combinations are possible.
-    UNREACHABLE();
-  }
-}
-
-
-void CodeGenerator::AssembleJumpTable(Label** targets, size_t target_count) {
-  // On 64-bit ARM we emit the jump tables inline.
-  UNREACHABLE();
-}
-
-
-#undef __
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/arm64/instruction-codes-arm64.h b/src/v8/src/compiler/arm64/instruction-codes-arm64.h
deleted file mode 100644
index 820b55a..0000000
--- a/src/v8/src/compiler/arm64/instruction-codes-arm64.h
+++ /dev/null
@@ -1,332 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_ARM64_INSTRUCTION_CODES_ARM64_H_
-#define V8_COMPILER_ARM64_INSTRUCTION_CODES_ARM64_H_
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-// ARM64-specific opcodes that specify which assembly sequence to emit.
-// Most opcodes specify a single instruction.
-#define TARGET_ARCH_OPCODE_LIST(V) \
-  V(Arm64Add)                      \
-  V(Arm64Add32)                    \
-  V(Arm64And)                      \
-  V(Arm64And32)                    \
-  V(Arm64Bic)                      \
-  V(Arm64Bic32)                    \
-  V(Arm64Clz)                      \
-  V(Arm64Clz32)                    \
-  V(Arm64Cmp)                      \
-  V(Arm64Cmp32)                    \
-  V(Arm64Cmn)                      \
-  V(Arm64Cmn32)                    \
-  V(Arm64Tst)                      \
-  V(Arm64Tst32)                    \
-  V(Arm64Or)                       \
-  V(Arm64Or32)                     \
-  V(Arm64Orn)                      \
-  V(Arm64Orn32)                    \
-  V(Arm64Eor)                      \
-  V(Arm64Eor32)                    \
-  V(Arm64Eon)                      \
-  V(Arm64Eon32)                    \
-  V(Arm64Sub)                      \
-  V(Arm64Sub32)                    \
-  V(Arm64Mul)                      \
-  V(Arm64Mul32)                    \
-  V(Arm64Smull)                    \
-  V(Arm64Umull)                    \
-  V(Arm64Madd)                     \
-  V(Arm64Madd32)                   \
-  V(Arm64Msub)                     \
-  V(Arm64Msub32)                   \
-  V(Arm64Mneg)                     \
-  V(Arm64Mneg32)                   \
-  V(Arm64Idiv)                     \
-  V(Arm64Idiv32)                   \
-  V(Arm64Udiv)                     \
-  V(Arm64Udiv32)                   \
-  V(Arm64Imod)                     \
-  V(Arm64Imod32)                   \
-  V(Arm64Umod)                     \
-  V(Arm64Umod32)                   \
-  V(Arm64Not)                      \
-  V(Arm64Not32)                    \
-  V(Arm64Lsl)                      \
-  V(Arm64Lsl32)                    \
-  V(Arm64Lsr)                      \
-  V(Arm64Lsr32)                    \
-  V(Arm64Asr)                      \
-  V(Arm64Asr32)                    \
-  V(Arm64Ror)                      \
-  V(Arm64Ror32)                    \
-  V(Arm64Mov32)                    \
-  V(Arm64Sxtb32)                   \
-  V(Arm64Sxth32)                   \
-  V(Arm64Sxtw)                     \
-  V(Arm64Sbfx32)                   \
-  V(Arm64Ubfx)                     \
-  V(Arm64Ubfx32)                   \
-  V(Arm64Ubfiz32)                  \
-  V(Arm64Bfi)                      \
-  V(Arm64Rbit)                     \
-  V(Arm64Rbit32)                   \
-  V(Arm64TestAndBranch32)          \
-  V(Arm64TestAndBranch)            \
-  V(Arm64CompareAndBranch32)       \
-  V(Arm64CompareAndBranch)         \
-  V(Arm64Claim)                    \
-  V(Arm64Poke)                     \
-  V(Arm64PokePair)                 \
-  V(Arm64Peek)                     \
-  V(Arm64Float32Cmp)               \
-  V(Arm64Float32Add)               \
-  V(Arm64Float32Sub)               \
-  V(Arm64Float32Mul)               \
-  V(Arm64Float32Div)               \
-  V(Arm64Float32Abs)               \
-  V(Arm64Float32Neg)               \
-  V(Arm64Float32Sqrt)              \
-  V(Arm64Float32RoundDown)         \
-  V(Arm64Float32Max)               \
-  V(Arm64Float32Min)               \
-  V(Arm64Float64Cmp)               \
-  V(Arm64Float64Add)               \
-  V(Arm64Float64Sub)               \
-  V(Arm64Float64Mul)               \
-  V(Arm64Float64Div)               \
-  V(Arm64Float64Mod)               \
-  V(Arm64Float64Max)               \
-  V(Arm64Float64Min)               \
-  V(Arm64Float64Abs)               \
-  V(Arm64Float64Neg)               \
-  V(Arm64Float64Sqrt)              \
-  V(Arm64Float64RoundDown)         \
-  V(Arm64Float32RoundUp)           \
-  V(Arm64Float64RoundUp)           \
-  V(Arm64Float64RoundTiesAway)     \
-  V(Arm64Float32RoundTruncate)     \
-  V(Arm64Float64RoundTruncate)     \
-  V(Arm64Float32RoundTiesEven)     \
-  V(Arm64Float64RoundTiesEven)     \
-  V(Arm64Float64SilenceNaN)        \
-  V(Arm64Float32ToFloat64)         \
-  V(Arm64Float64ToFloat32)         \
-  V(Arm64Float32ToInt32)           \
-  V(Arm64Float64ToInt32)           \
-  V(Arm64Float32ToUint32)          \
-  V(Arm64Float64ToUint32)          \
-  V(Arm64Float32ToInt64)           \
-  V(Arm64Float64ToInt64)           \
-  V(Arm64Float32ToUint64)          \
-  V(Arm64Float64ToUint64)          \
-  V(Arm64Int32ToFloat32)           \
-  V(Arm64Int32ToFloat64)           \
-  V(Arm64Int64ToFloat32)           \
-  V(Arm64Int64ToFloat64)           \
-  V(Arm64Uint32ToFloat32)          \
-  V(Arm64Uint32ToFloat64)          \
-  V(Arm64Uint64ToFloat32)          \
-  V(Arm64Uint64ToFloat64)          \
-  V(Arm64Float64ExtractLowWord32)  \
-  V(Arm64Float64ExtractHighWord32) \
-  V(Arm64Float64InsertLowWord32)   \
-  V(Arm64Float64InsertHighWord32)  \
-  V(Arm64Float64MoveU64)           \
-  V(Arm64U64MoveFloat64)           \
-  V(Arm64LdrS)                     \
-  V(Arm64StrS)                     \
-  V(Arm64LdrD)                     \
-  V(Arm64StrD)                     \
-  V(Arm64LdrQ)                     \
-  V(Arm64StrQ)                     \
-  V(Arm64Ldrb)                     \
-  V(Arm64Ldrsb)                    \
-  V(Arm64Strb)                     \
-  V(Arm64Ldrh)                     \
-  V(Arm64Ldrsh)                    \
-  V(Arm64Strh)                     \
-  V(Arm64Ldrsw)                    \
-  V(Arm64LdrW)                     \
-  V(Arm64StrW)                     \
-  V(Arm64Ldr)                      \
-  V(Arm64Str)                      \
-  V(Arm64F32x4Splat)               \
-  V(Arm64F32x4ExtractLane)         \
-  V(Arm64F32x4ReplaceLane)         \
-  V(Arm64F32x4SConvertI32x4)       \
-  V(Arm64F32x4UConvertI32x4)       \
-  V(Arm64F32x4Abs)                 \
-  V(Arm64F32x4Neg)                 \
-  V(Arm64F32x4RecipApprox)         \
-  V(Arm64F32x4RecipSqrtApprox)     \
-  V(Arm64F32x4Add)                 \
-  V(Arm64F32x4AddHoriz)            \
-  V(Arm64F32x4Sub)                 \
-  V(Arm64F32x4Mul)                 \
-  V(Arm64F32x4Min)                 \
-  V(Arm64F32x4Max)                 \
-  V(Arm64F32x4Eq)                  \
-  V(Arm64F32x4Ne)                  \
-  V(Arm64F32x4Lt)                  \
-  V(Arm64F32x4Le)                  \
-  V(Arm64I32x4Splat)               \
-  V(Arm64I32x4ExtractLane)         \
-  V(Arm64I32x4ReplaceLane)         \
-  V(Arm64I32x4SConvertF32x4)       \
-  V(Arm64I32x4SConvertI16x8Low)    \
-  V(Arm64I32x4SConvertI16x8High)   \
-  V(Arm64I32x4Neg)                 \
-  V(Arm64I32x4Shl)                 \
-  V(Arm64I32x4ShrS)                \
-  V(Arm64I32x4Add)                 \
-  V(Arm64I32x4AddHoriz)            \
-  V(Arm64I32x4Sub)                 \
-  V(Arm64I32x4Mul)                 \
-  V(Arm64I32x4MinS)                \
-  V(Arm64I32x4MaxS)                \
-  V(Arm64I32x4Eq)                  \
-  V(Arm64I32x4Ne)                  \
-  V(Arm64I32x4GtS)                 \
-  V(Arm64I32x4GeS)                 \
-  V(Arm64I32x4UConvertF32x4)       \
-  V(Arm64I32x4UConvertI16x8Low)    \
-  V(Arm64I32x4UConvertI16x8High)   \
-  V(Arm64I32x4ShrU)                \
-  V(Arm64I32x4MinU)                \
-  V(Arm64I32x4MaxU)                \
-  V(Arm64I32x4GtU)                 \
-  V(Arm64I32x4GeU)                 \
-  V(Arm64I16x8Splat)               \
-  V(Arm64I16x8ExtractLane)         \
-  V(Arm64I16x8ReplaceLane)         \
-  V(Arm64I16x8SConvertI8x16Low)    \
-  V(Arm64I16x8SConvertI8x16High)   \
-  V(Arm64I16x8Neg)                 \
-  V(Arm64I16x8Shl)                 \
-  V(Arm64I16x8ShrS)                \
-  V(Arm64I16x8SConvertI32x4)       \
-  V(Arm64I16x8Add)                 \
-  V(Arm64I16x8AddSaturateS)        \
-  V(Arm64I16x8AddHoriz)            \
-  V(Arm64I16x8Sub)                 \
-  V(Arm64I16x8SubSaturateS)        \
-  V(Arm64I16x8Mul)                 \
-  V(Arm64I16x8MinS)                \
-  V(Arm64I16x8MaxS)                \
-  V(Arm64I16x8Eq)                  \
-  V(Arm64I16x8Ne)                  \
-  V(Arm64I16x8GtS)                 \
-  V(Arm64I16x8GeS)                 \
-  V(Arm64I16x8UConvertI8x16Low)    \
-  V(Arm64I16x8UConvertI8x16High)   \
-  V(Arm64I16x8ShrU)                \
-  V(Arm64I16x8UConvertI32x4)       \
-  V(Arm64I16x8AddSaturateU)        \
-  V(Arm64I16x8SubSaturateU)        \
-  V(Arm64I16x8MinU)                \
-  V(Arm64I16x8MaxU)                \
-  V(Arm64I16x8GtU)                 \
-  V(Arm64I16x8GeU)                 \
-  V(Arm64I8x16Splat)               \
-  V(Arm64I8x16ExtractLane)         \
-  V(Arm64I8x16ReplaceLane)         \
-  V(Arm64I8x16Neg)                 \
-  V(Arm64I8x16Shl)                 \
-  V(Arm64I8x16ShrS)                \
-  V(Arm64I8x16SConvertI16x8)       \
-  V(Arm64I8x16Add)                 \
-  V(Arm64I8x16AddSaturateS)        \
-  V(Arm64I8x16Sub)                 \
-  V(Arm64I8x16SubSaturateS)        \
-  V(Arm64I8x16Mul)                 \
-  V(Arm64I8x16MinS)                \
-  V(Arm64I8x16MaxS)                \
-  V(Arm64I8x16Eq)                  \
-  V(Arm64I8x16Ne)                  \
-  V(Arm64I8x16GtS)                 \
-  V(Arm64I8x16GeS)                 \
-  V(Arm64I8x16ShrU)                \
-  V(Arm64I8x16UConvertI16x8)       \
-  V(Arm64I8x16AddSaturateU)        \
-  V(Arm64I8x16SubSaturateU)        \
-  V(Arm64I8x16MinU)                \
-  V(Arm64I8x16MaxU)                \
-  V(Arm64I8x16GtU)                 \
-  V(Arm64I8x16GeU)                 \
-  V(Arm64S128Zero)                 \
-  V(Arm64S128Dup)                  \
-  V(Arm64S128And)                  \
-  V(Arm64S128Or)                   \
-  V(Arm64S128Xor)                  \
-  V(Arm64S128Not)                  \
-  V(Arm64S128Select)               \
-  V(Arm64S32x4ZipLeft)             \
-  V(Arm64S32x4ZipRight)            \
-  V(Arm64S32x4UnzipLeft)           \
-  V(Arm64S32x4UnzipRight)          \
-  V(Arm64S32x4TransposeLeft)       \
-  V(Arm64S32x4TransposeRight)      \
-  V(Arm64S32x4Shuffle)             \
-  V(Arm64S16x8ZipLeft)             \
-  V(Arm64S16x8ZipRight)            \
-  V(Arm64S16x8UnzipLeft)           \
-  V(Arm64S16x8UnzipRight)          \
-  V(Arm64S16x8TransposeLeft)       \
-  V(Arm64S16x8TransposeRight)      \
-  V(Arm64S8x16ZipLeft)             \
-  V(Arm64S8x16ZipRight)            \
-  V(Arm64S8x16UnzipLeft)           \
-  V(Arm64S8x16UnzipRight)          \
-  V(Arm64S8x16TransposeLeft)       \
-  V(Arm64S8x16TransposeRight)      \
-  V(Arm64S8x16Concat)              \
-  V(Arm64S8x16Shuffle)             \
-  V(Arm64S32x2Reverse)             \
-  V(Arm64S16x4Reverse)             \
-  V(Arm64S16x2Reverse)             \
-  V(Arm64S8x8Reverse)              \
-  V(Arm64S8x4Reverse)              \
-  V(Arm64S8x2Reverse)              \
-  V(Arm64S1x4AnyTrue)              \
-  V(Arm64S1x4AllTrue)              \
-  V(Arm64S1x8AnyTrue)              \
-  V(Arm64S1x8AllTrue)              \
-  V(Arm64S1x16AnyTrue)             \
-  V(Arm64S1x16AllTrue)
-
-// Addressing modes represent the "shape" of inputs to an instruction.
-// Many instructions support multiple addressing modes. Addressing modes
-// are encoded into the InstructionCode of the instruction and tell the
-// code generator after register allocation which assembler method to call.
-//
-// We use the following local notation for addressing modes:
-//
-// R = register
-// O = register or stack slot
-// D = double register
-// I = immediate (handle, external, int32)
-// MRI = [register + immediate]
-// MRR = [register + register]
-#define TARGET_ADDRESSING_MODE_LIST(V)                          \
-  V(MRI)              /* [%r0 + K] */                           \
-  V(MRR)              /* [%r0 + %r1] */                         \
-  V(Operand2_R_LSL_I) /* %r0 LSL K */                           \
-  V(Operand2_R_LSR_I) /* %r0 LSR K */                           \
-  V(Operand2_R_ASR_I) /* %r0 ASR K */                           \
-  V(Operand2_R_ROR_I) /* %r0 ROR K */                           \
-  V(Operand2_R_UXTB)  /* %r0 UXTB (unsigned extend byte) */     \
-  V(Operand2_R_UXTH)  /* %r0 UXTH (unsigned extend halfword) */ \
-  V(Operand2_R_SXTB)  /* %r0 SXTB (signed extend byte) */       \
-  V(Operand2_R_SXTH)  /* %r0 SXTH (signed extend halfword) */   \
-  V(Operand2_R_SXTW)  /* %r0 SXTW (signed extend word) */
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_COMPILER_ARM64_INSTRUCTION_CODES_ARM64_H_
diff --git a/src/v8/src/compiler/arm64/instruction-scheduler-arm64.cc b/src/v8/src/compiler/arm64/instruction-scheduler-arm64.cc
deleted file mode 100644
index c2b0a4e..0000000
--- a/src/v8/src/compiler/arm64/instruction-scheduler-arm64.cc
+++ /dev/null
@@ -1,472 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/compiler/instruction-scheduler.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-bool InstructionScheduler::SchedulerSupported() { return true; }
-
-
-int InstructionScheduler::GetTargetInstructionFlags(
-    const Instruction* instr) const {
-  switch (instr->arch_opcode()) {
-    case kArm64Add:
-    case kArm64Add32:
-    case kArm64And:
-    case kArm64And32:
-    case kArm64Bic:
-    case kArm64Bic32:
-    case kArm64Clz:
-    case kArm64Clz32:
-    case kArm64Cmp:
-    case kArm64Cmp32:
-    case kArm64Cmn:
-    case kArm64Cmn32:
-    case kArm64Tst:
-    case kArm64Tst32:
-    case kArm64Or:
-    case kArm64Or32:
-    case kArm64Orn:
-    case kArm64Orn32:
-    case kArm64Eor:
-    case kArm64Eor32:
-    case kArm64Eon:
-    case kArm64Eon32:
-    case kArm64Sub:
-    case kArm64Sub32:
-    case kArm64Mul:
-    case kArm64Mul32:
-    case kArm64Smull:
-    case kArm64Umull:
-    case kArm64Madd:
-    case kArm64Madd32:
-    case kArm64Msub:
-    case kArm64Msub32:
-    case kArm64Mneg:
-    case kArm64Mneg32:
-    case kArm64Idiv:
-    case kArm64Idiv32:
-    case kArm64Udiv:
-    case kArm64Udiv32:
-    case kArm64Imod:
-    case kArm64Imod32:
-    case kArm64Umod:
-    case kArm64Umod32:
-    case kArm64Not:
-    case kArm64Not32:
-    case kArm64Lsl:
-    case kArm64Lsl32:
-    case kArm64Lsr:
-    case kArm64Lsr32:
-    case kArm64Asr:
-    case kArm64Asr32:
-    case kArm64Ror:
-    case kArm64Ror32:
-    case kArm64Mov32:
-    case kArm64Sxtb32:
-    case kArm64Sxth32:
-    case kArm64Sxtw:
-    case kArm64Sbfx32:
-    case kArm64Ubfx:
-    case kArm64Ubfx32:
-    case kArm64Ubfiz32:
-    case kArm64Bfi:
-    case kArm64Rbit:
-    case kArm64Rbit32:
-    case kArm64Float32Cmp:
-    case kArm64Float32Add:
-    case kArm64Float32Sub:
-    case kArm64Float32Mul:
-    case kArm64Float32Div:
-    case kArm64Float32Abs:
-    case kArm64Float32Neg:
-    case kArm64Float32Sqrt:
-    case kArm64Float32RoundDown:
-    case kArm64Float32Max:
-    case kArm64Float32Min:
-    case kArm64Float64Cmp:
-    case kArm64Float64Add:
-    case kArm64Float64Sub:
-    case kArm64Float64Mul:
-    case kArm64Float64Div:
-    case kArm64Float64Max:
-    case kArm64Float64Min:
-    case kArm64Float64Abs:
-    case kArm64Float64Neg:
-    case kArm64Float64Sqrt:
-    case kArm64Float64RoundDown:
-    case kArm64Float64RoundTiesAway:
-    case kArm64Float64RoundTruncate:
-    case kArm64Float64RoundTiesEven:
-    case kArm64Float64RoundUp:
-    case kArm64Float32RoundTiesEven:
-    case kArm64Float32RoundTruncate:
-    case kArm64Float32RoundUp:
-    case kArm64Float32ToFloat64:
-    case kArm64Float64ToFloat32:
-    case kArm64Float32ToInt32:
-    case kArm64Float64ToInt32:
-    case kArm64Float32ToUint32:
-    case kArm64Float64ToUint32:
-    case kArm64Float32ToInt64:
-    case kArm64Float64ToInt64:
-    case kArm64Float32ToUint64:
-    case kArm64Float64ToUint64:
-    case kArm64Int32ToFloat32:
-    case kArm64Int32ToFloat64:
-    case kArm64Int64ToFloat32:
-    case kArm64Int64ToFloat64:
-    case kArm64Uint32ToFloat32:
-    case kArm64Uint32ToFloat64:
-    case kArm64Uint64ToFloat32:
-    case kArm64Uint64ToFloat64:
-    case kArm64Float64ExtractLowWord32:
-    case kArm64Float64ExtractHighWord32:
-    case kArm64Float64InsertLowWord32:
-    case kArm64Float64InsertHighWord32:
-    case kArm64Float64Mod:
-    case kArm64Float64MoveU64:
-    case kArm64U64MoveFloat64:
-    case kArm64Float64SilenceNaN:
-    case kArm64F32x4Splat:
-    case kArm64F32x4ExtractLane:
-    case kArm64F32x4ReplaceLane:
-    case kArm64F32x4SConvertI32x4:
-    case kArm64F32x4UConvertI32x4:
-    case kArm64F32x4Abs:
-    case kArm64F32x4Neg:
-    case kArm64F32x4RecipApprox:
-    case kArm64F32x4RecipSqrtApprox:
-    case kArm64F32x4Add:
-    case kArm64F32x4AddHoriz:
-    case kArm64F32x4Sub:
-    case kArm64F32x4Mul:
-    case kArm64F32x4Min:
-    case kArm64F32x4Max:
-    case kArm64F32x4Eq:
-    case kArm64F32x4Ne:
-    case kArm64F32x4Lt:
-    case kArm64F32x4Le:
-    case kArm64I32x4Splat:
-    case kArm64I32x4ExtractLane:
-    case kArm64I32x4ReplaceLane:
-    case kArm64I32x4SConvertF32x4:
-    case kArm64I32x4SConvertI16x8Low:
-    case kArm64I32x4SConvertI16x8High:
-    case kArm64I32x4Neg:
-    case kArm64I32x4Shl:
-    case kArm64I32x4ShrS:
-    case kArm64I32x4Add:
-    case kArm64I32x4AddHoriz:
-    case kArm64I32x4Sub:
-    case kArm64I32x4Mul:
-    case kArm64I32x4MinS:
-    case kArm64I32x4MaxS:
-    case kArm64I32x4Eq:
-    case kArm64I32x4Ne:
-    case kArm64I32x4GtS:
-    case kArm64I32x4GeS:
-    case kArm64I32x4UConvertF32x4:
-    case kArm64I32x4UConvertI16x8Low:
-    case kArm64I32x4UConvertI16x8High:
-    case kArm64I32x4ShrU:
-    case kArm64I32x4MinU:
-    case kArm64I32x4MaxU:
-    case kArm64I32x4GtU:
-    case kArm64I32x4GeU:
-    case kArm64I16x8Splat:
-    case kArm64I16x8ExtractLane:
-    case kArm64I16x8ReplaceLane:
-    case kArm64I16x8SConvertI8x16Low:
-    case kArm64I16x8SConvertI8x16High:
-    case kArm64I16x8Neg:
-    case kArm64I16x8Shl:
-    case kArm64I16x8ShrS:
-    case kArm64I16x8SConvertI32x4:
-    case kArm64I16x8Add:
-    case kArm64I16x8AddSaturateS:
-    case kArm64I16x8AddHoriz:
-    case kArm64I16x8Sub:
-    case kArm64I16x8SubSaturateS:
-    case kArm64I16x8Mul:
-    case kArm64I16x8MinS:
-    case kArm64I16x8MaxS:
-    case kArm64I16x8Eq:
-    case kArm64I16x8Ne:
-    case kArm64I16x8GtS:
-    case kArm64I16x8GeS:
-    case kArm64I16x8UConvertI8x16Low:
-    case kArm64I16x8UConvertI8x16High:
-    case kArm64I16x8ShrU:
-    case kArm64I16x8UConvertI32x4:
-    case kArm64I16x8AddSaturateU:
-    case kArm64I16x8SubSaturateU:
-    case kArm64I16x8MinU:
-    case kArm64I16x8MaxU:
-    case kArm64I16x8GtU:
-    case kArm64I16x8GeU:
-    case kArm64I8x16Splat:
-    case kArm64I8x16ExtractLane:
-    case kArm64I8x16ReplaceLane:
-    case kArm64I8x16Neg:
-    case kArm64I8x16Shl:
-    case kArm64I8x16ShrS:
-    case kArm64I8x16SConvertI16x8:
-    case kArm64I8x16Add:
-    case kArm64I8x16AddSaturateS:
-    case kArm64I8x16Sub:
-    case kArm64I8x16SubSaturateS:
-    case kArm64I8x16Mul:
-    case kArm64I8x16MinS:
-    case kArm64I8x16MaxS:
-    case kArm64I8x16Eq:
-    case kArm64I8x16Ne:
-    case kArm64I8x16GtS:
-    case kArm64I8x16GeS:
-    case kArm64I8x16UConvertI16x8:
-    case kArm64I8x16AddSaturateU:
-    case kArm64I8x16SubSaturateU:
-    case kArm64I8x16ShrU:
-    case kArm64I8x16MinU:
-    case kArm64I8x16MaxU:
-    case kArm64I8x16GtU:
-    case kArm64I8x16GeU:
-    case kArm64S128Zero:
-    case kArm64S128Dup:
-    case kArm64S128And:
-    case kArm64S128Or:
-    case kArm64S128Xor:
-    case kArm64S128Not:
-    case kArm64S128Select:
-    case kArm64S32x4ZipLeft:
-    case kArm64S32x4ZipRight:
-    case kArm64S32x4UnzipLeft:
-    case kArm64S32x4UnzipRight:
-    case kArm64S32x4TransposeLeft:
-    case kArm64S32x4TransposeRight:
-    case kArm64S32x4Shuffle:
-    case kArm64S16x8ZipLeft:
-    case kArm64S16x8ZipRight:
-    case kArm64S16x8UnzipLeft:
-    case kArm64S16x8UnzipRight:
-    case kArm64S16x8TransposeLeft:
-    case kArm64S16x8TransposeRight:
-    case kArm64S8x16ZipLeft:
-    case kArm64S8x16ZipRight:
-    case kArm64S8x16UnzipLeft:
-    case kArm64S8x16UnzipRight:
-    case kArm64S8x16TransposeLeft:
-    case kArm64S8x16TransposeRight:
-    case kArm64S8x16Concat:
-    case kArm64S8x16Shuffle:
-    case kArm64S32x2Reverse:
-    case kArm64S16x4Reverse:
-    case kArm64S16x2Reverse:
-    case kArm64S8x8Reverse:
-    case kArm64S8x4Reverse:
-    case kArm64S8x2Reverse:
-    case kArm64S1x4AnyTrue:
-    case kArm64S1x4AllTrue:
-    case kArm64S1x8AnyTrue:
-    case kArm64S1x8AllTrue:
-    case kArm64S1x16AnyTrue:
-    case kArm64S1x16AllTrue:
-      return kNoOpcodeFlags;
-
-    case kArm64TestAndBranch32:
-    case kArm64TestAndBranch:
-    case kArm64CompareAndBranch32:
-    case kArm64CompareAndBranch:
-      return kIsBlockTerminator;
-
-    case kArm64LdrS:
-    case kArm64LdrD:
-    case kArm64LdrQ:
-    case kArm64Ldrb:
-    case kArm64Ldrsb:
-    case kArm64Ldrh:
-    case kArm64Ldrsh:
-    case kArm64Ldrsw:
-    case kArm64LdrW:
-    case kArm64Ldr:
-    case kArm64Peek:
-      return kIsLoadOperation;
-
-    case kArm64Claim:
-    case kArm64Poke:
-    case kArm64PokePair:
-    case kArm64StrS:
-    case kArm64StrD:
-    case kArm64StrQ:
-    case kArm64Strb:
-    case kArm64Strh:
-    case kArm64StrW:
-    case kArm64Str:
-      return kHasSideEffect;
-
-#define CASE(Name) case k##Name:
-    COMMON_ARCH_OPCODE_LIST(CASE)
-#undef CASE
-      // Already covered in architecture independent code.
-      UNREACHABLE();
-  }
-
-  UNREACHABLE();
-}
-
-
-int InstructionScheduler::GetInstructionLatency(const Instruction* instr) {
-  // Basic latency modeling for arm64 instructions. They have been determined
-  // in an empirical way.
-  switch (instr->arch_opcode()) {
-    case kArm64Add:
-    case kArm64Add32:
-    case kArm64And:
-    case kArm64And32:
-    case kArm64Bic:
-    case kArm64Bic32:
-    case kArm64Cmn:
-    case kArm64Cmn32:
-    case kArm64Cmp:
-    case kArm64Cmp32:
-    case kArm64Eon:
-    case kArm64Eon32:
-    case kArm64Eor:
-    case kArm64Eor32:
-    case kArm64Not:
-    case kArm64Not32:
-    case kArm64Or:
-    case kArm64Or32:
-    case kArm64Orn:
-    case kArm64Orn32:
-    case kArm64Sub:
-    case kArm64Sub32:
-    case kArm64Tst:
-    case kArm64Tst32:
-      if (instr->addressing_mode() != kMode_None) {
-        return 3;
-      } else {
-        return 1;
-      }
-
-    case kArm64Clz:
-    case kArm64Clz32:
-    case kArm64Sbfx32:
-    case kArm64Sxtb32:
-    case kArm64Sxth32:
-    case kArm64Sxtw:
-    case kArm64Ubfiz32:
-    case kArm64Ubfx:
-    case kArm64Ubfx32:
-      return 1;
-
-    case kArm64Lsl:
-    case kArm64Lsl32:
-    case kArm64Lsr:
-    case kArm64Lsr32:
-    case kArm64Asr:
-    case kArm64Asr32:
-    case kArm64Ror:
-    case kArm64Ror32:
-      return 1;
-
-    case kArm64Ldr:
-    case kArm64LdrD:
-    case kArm64LdrS:
-    case kArm64LdrW:
-    case kArm64Ldrb:
-    case kArm64Ldrh:
-    case kArm64Ldrsb:
-    case kArm64Ldrsh:
-    case kArm64Ldrsw:
-      return 11;
-
-    case kArm64Str:
-    case kArm64StrD:
-    case kArm64StrS:
-    case kArm64StrW:
-    case kArm64Strb:
-    case kArm64Strh:
-      return 1;
-
-    case kArm64Madd32:
-    case kArm64Mneg32:
-    case kArm64Msub32:
-    case kArm64Mul32:
-      return 3;
-
-    case kArm64Madd:
-    case kArm64Mneg:
-    case kArm64Msub:
-    case kArm64Mul:
-      return 5;
-
-    case kArm64Idiv32:
-    case kArm64Udiv32:
-      return 12;
-
-    case kArm64Idiv:
-    case kArm64Udiv:
-      return 20;
-
-    case kArm64Float32Add:
-    case kArm64Float32Sub:
-    case kArm64Float64Add:
-    case kArm64Float64Sub:
-      return 5;
-
-    case kArm64Float32Abs:
-    case kArm64Float32Cmp:
-    case kArm64Float32Neg:
-    case kArm64Float64Abs:
-    case kArm64Float64Cmp:
-    case kArm64Float64Neg:
-      return 3;
-
-    case kArm64Float32Div:
-    case kArm64Float32Sqrt:
-      return 12;
-
-    case kArm64Float64Div:
-    case kArm64Float64Sqrt:
-      return 19;
-
-    case kArm64Float32RoundDown:
-    case kArm64Float32RoundTiesEven:
-    case kArm64Float32RoundTruncate:
-    case kArm64Float32RoundUp:
-    case kArm64Float64RoundDown:
-    case kArm64Float64RoundTiesAway:
-    case kArm64Float64RoundTiesEven:
-    case kArm64Float64RoundTruncate:
-    case kArm64Float64RoundUp:
-      return 5;
-
-    case kArm64Float32ToFloat64:
-    case kArm64Float64ToFloat32:
-    case kArm64Float64ToInt32:
-    case kArm64Float64ToUint32:
-    case kArm64Float32ToInt64:
-    case kArm64Float64ToInt64:
-    case kArm64Float32ToUint64:
-    case kArm64Float64ToUint64:
-    case kArm64Int32ToFloat64:
-    case kArm64Int64ToFloat32:
-    case kArm64Int64ToFloat64:
-    case kArm64Uint32ToFloat64:
-    case kArm64Uint64ToFloat32:
-    case kArm64Uint64ToFloat64:
-      return 5;
-
-    default:
-      return 2;
-  }
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/arm64/instruction-selector-arm64.cc b/src/v8/src/compiler/arm64/instruction-selector-arm64.cc
deleted file mode 100644
index d6082c9..0000000
--- a/src/v8/src/compiler/arm64/instruction-selector-arm64.cc
+++ /dev/null
@@ -1,3163 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/assembler-inl.h"
-#include "src/compiler/instruction-selector-impl.h"
-#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-enum ImmediateMode {
-  kArithmeticImm,  // 12 bit unsigned immediate shifted left 0 or 12 bits
-  kShift32Imm,     // 0 - 31
-  kShift64Imm,     // 0 - 63
-  kLogical32Imm,
-  kLogical64Imm,
-  kLoadStoreImm8,   // signed 8 bit or 12 bit unsigned scaled by access size
-  kLoadStoreImm16,
-  kLoadStoreImm32,
-  kLoadStoreImm64,
-  kNoImmediate
-};
-
-
-// Adds Arm64-specific methods for generating operands.
-class Arm64OperandGenerator final : public OperandGenerator {
- public:
-  explicit Arm64OperandGenerator(InstructionSelector* selector)
-      : OperandGenerator(selector) {}
-
-  InstructionOperand UseOperand(Node* node, ImmediateMode mode) {
-    if (CanBeImmediate(node, mode)) {
-      return UseImmediate(node);
-    }
-    return UseRegister(node);
-  }
-
-  // Use the zero register if the node has the immediate value zero, otherwise
-  // assign a register.
-  InstructionOperand UseRegisterOrImmediateZero(Node* node) {
-    if ((IsIntegerConstant(node) && (GetIntegerConstantValue(node) == 0)) ||
-        (IsFloatConstant(node) &&
-         (bit_cast<int64_t>(GetFloatConstantValue(node)) == 0))) {
-      return UseImmediate(node);
-    }
-    return UseRegister(node);
-  }
-
-  // Use the provided node if it has the required value, or create a
-  // TempImmediate otherwise.
-  InstructionOperand UseImmediateOrTemp(Node* node, int32_t value) {
-    if (GetIntegerConstantValue(node) == value) {
-      return UseImmediate(node);
-    }
-    return TempImmediate(value);
-  }
-
-  bool IsIntegerConstant(Node* node) {
-    return (node->opcode() == IrOpcode::kInt32Constant) ||
-           (node->opcode() == IrOpcode::kInt64Constant);
-  }
-
-  int64_t GetIntegerConstantValue(Node* node) {
-    if (node->opcode() == IrOpcode::kInt32Constant) {
-      return OpParameter<int32_t>(node);
-    }
-    DCHECK_EQ(IrOpcode::kInt64Constant, node->opcode());
-    return OpParameter<int64_t>(node);
-  }
-
-  bool IsFloatConstant(Node* node) {
-    return (node->opcode() == IrOpcode::kFloat32Constant) ||
-           (node->opcode() == IrOpcode::kFloat64Constant);
-  }
-
-  double GetFloatConstantValue(Node* node) {
-    if (node->opcode() == IrOpcode::kFloat32Constant) {
-      return OpParameter<float>(node);
-    }
-    DCHECK_EQ(IrOpcode::kFloat64Constant, node->opcode());
-    return OpParameter<double>(node);
-  }
-
-  bool CanBeImmediate(Node* node, ImmediateMode mode) {
-    return IsIntegerConstant(node) &&
-           CanBeImmediate(GetIntegerConstantValue(node), mode);
-  }
-
-  bool CanBeImmediate(int64_t value, ImmediateMode mode) {
-    unsigned ignored;
-    switch (mode) {
-      case kLogical32Imm:
-        // TODO(dcarney): some unencodable values can be handled by
-        // switching instructions.
-        return Assembler::IsImmLogical(static_cast<uint64_t>(value), 32,
-                                       &ignored, &ignored, &ignored);
-      case kLogical64Imm:
-        return Assembler::IsImmLogical(static_cast<uint64_t>(value), 64,
-                                       &ignored, &ignored, &ignored);
-      case kArithmeticImm:
-        return Assembler::IsImmAddSub(value);
-      case kLoadStoreImm8:
-        return IsLoadStoreImmediate(value, 0);
-      case kLoadStoreImm16:
-        return IsLoadStoreImmediate(value, 1);
-      case kLoadStoreImm32:
-        return IsLoadStoreImmediate(value, 2);
-      case kLoadStoreImm64:
-        return IsLoadStoreImmediate(value, 3);
-      case kNoImmediate:
-        return false;
-      case kShift32Imm:  // Fall through.
-      case kShift64Imm:
-        // Shift operations only observe the bottom 5 or 6 bits of the value.
-        // All possible shifts can be encoded by discarding bits which have no
-        // effect.
-        return true;
-    }
-    return false;
-  }
-
-  bool CanBeLoadStoreShiftImmediate(Node* node, MachineRepresentation rep) {
-    // TODO(arm64): Load and Store on 128 bit Q registers is not supported yet.
-    DCHECK_GT(MachineRepresentation::kSimd128, rep);
-    return IsIntegerConstant(node) &&
-           (GetIntegerConstantValue(node) == ElementSizeLog2Of(rep));
-  }
-
- private:
-  bool IsLoadStoreImmediate(int64_t value, unsigned size) {
-    return Assembler::IsImmLSScaled(value, size) ||
-           Assembler::IsImmLSUnscaled(value);
-  }
-};
-
-
-namespace {
-
-void VisitRR(InstructionSelector* selector, ArchOpcode opcode, Node* node) {
-  Arm64OperandGenerator g(selector);
-  selector->Emit(opcode, g.DefineAsRegister(node),
-                 g.UseRegister(node->InputAt(0)));
-}
-
-
-void VisitRRR(InstructionSelector* selector, ArchOpcode opcode, Node* node) {
-  Arm64OperandGenerator g(selector);
-  selector->Emit(opcode, g.DefineAsRegister(node),
-                 g.UseRegister(node->InputAt(0)),
-                 g.UseRegister(node->InputAt(1)));
-}
-
-void VisitRRI(InstructionSelector* selector, ArchOpcode opcode, Node* node) {
-  Arm64OperandGenerator g(selector);
-  int32_t imm = OpParameter<int32_t>(node);
-  selector->Emit(opcode, g.DefineAsRegister(node),
-                 g.UseRegister(node->InputAt(0)), g.UseImmediate(imm));
-}
-
-void VisitRRO(InstructionSelector* selector, ArchOpcode opcode, Node* node,
-              ImmediateMode operand_mode) {
-  Arm64OperandGenerator g(selector);
-  selector->Emit(opcode, g.DefineAsRegister(node),
-                 g.UseRegister(node->InputAt(0)),
-                 g.UseOperand(node->InputAt(1), operand_mode));
-}
-
-void VisitRRIR(InstructionSelector* selector, ArchOpcode opcode, Node* node) {
-  Arm64OperandGenerator g(selector);
-  int32_t imm = OpParameter<int32_t>(node);
-  selector->Emit(opcode, g.DefineAsRegister(node),
-                 g.UseRegister(node->InputAt(0)), g.UseImmediate(imm),
-                 g.UseRegister(node->InputAt(1)));
-}
-
-struct ExtendingLoadMatcher {
-  ExtendingLoadMatcher(Node* node, InstructionSelector* selector)
-      : matches_(false), selector_(selector), base_(nullptr), immediate_(0) {
-    Initialize(node);
-  }
-
-  bool Matches() const { return matches_; }
-
-  Node* base() const {
-    DCHECK(Matches());
-    return base_;
-  }
-  int64_t immediate() const {
-    DCHECK(Matches());
-    return immediate_;
-  }
-  ArchOpcode opcode() const {
-    DCHECK(Matches());
-    return opcode_;
-  }
-
- private:
-  bool matches_;
-  InstructionSelector* selector_;
-  Node* base_;
-  int64_t immediate_;
-  ArchOpcode opcode_;
-
-  void Initialize(Node* node) {
-    Int64BinopMatcher m(node);
-    // When loading a 64-bit value and shifting by 32, we should
-    // just load and sign-extend the interesting 4 bytes instead.
-    // This happens, for example, when we're loading and untagging SMIs.
-    DCHECK(m.IsWord64Sar());
-    if (m.left().IsLoad() && m.right().Is(32) &&
-        selector_->CanCover(m.node(), m.left().node())) {
-      Arm64OperandGenerator g(selector_);
-      Node* load = m.left().node();
-      Node* offset = load->InputAt(1);
-      base_ = load->InputAt(0);
-      opcode_ = kArm64Ldrsw;
-      if (g.IsIntegerConstant(offset)) {
-        immediate_ = g.GetIntegerConstantValue(offset) + 4;
-        matches_ = g.CanBeImmediate(immediate_, kLoadStoreImm32);
-      }
-    }
-  }
-};
-
-bool TryMatchExtendingLoad(InstructionSelector* selector, Node* node) {
-  ExtendingLoadMatcher m(node, selector);
-  return m.Matches();
-}
-
-bool TryEmitExtendingLoad(InstructionSelector* selector, Node* node) {
-  ExtendingLoadMatcher m(node, selector);
-  Arm64OperandGenerator g(selector);
-  if (m.Matches()) {
-    InstructionOperand inputs[2];
-    inputs[0] = g.UseRegister(m.base());
-    InstructionCode opcode =
-        m.opcode() | AddressingModeField::encode(kMode_MRI);
-    DCHECK(is_int32(m.immediate()));
-    inputs[1] = g.TempImmediate(static_cast<int32_t>(m.immediate()));
-    InstructionOperand outputs[] = {g.DefineAsRegister(node)};
-    selector->Emit(opcode, arraysize(outputs), outputs, arraysize(inputs),
-                   inputs);
-    return true;
-  }
-  return false;
-}
-
-bool TryMatchAnyShift(InstructionSelector* selector, Node* node,
-                      Node* input_node, InstructionCode* opcode, bool try_ror) {
-  Arm64OperandGenerator g(selector);
-
-  if (!selector->CanCover(node, input_node)) return false;
-  if (input_node->InputCount() != 2) return false;
-  if (!g.IsIntegerConstant(input_node->InputAt(1))) return false;
-
-  switch (input_node->opcode()) {
-    case IrOpcode::kWord32Shl:
-    case IrOpcode::kWord64Shl:
-      *opcode |= AddressingModeField::encode(kMode_Operand2_R_LSL_I);
-      return true;
-    case IrOpcode::kWord32Shr:
-    case IrOpcode::kWord64Shr:
-      *opcode |= AddressingModeField::encode(kMode_Operand2_R_LSR_I);
-      return true;
-    case IrOpcode::kWord32Sar:
-      *opcode |= AddressingModeField::encode(kMode_Operand2_R_ASR_I);
-      return true;
-    case IrOpcode::kWord64Sar:
-      if (TryMatchExtendingLoad(selector, input_node)) return false;
-      *opcode |= AddressingModeField::encode(kMode_Operand2_R_ASR_I);
-      return true;
-    case IrOpcode::kWord32Ror:
-    case IrOpcode::kWord64Ror:
-      if (try_ror) {
-        *opcode |= AddressingModeField::encode(kMode_Operand2_R_ROR_I);
-        return true;
-      }
-      return false;
-    default:
-      return false;
-  }
-}
-
-
-bool TryMatchAnyExtend(Arm64OperandGenerator* g, InstructionSelector* selector,
-                       Node* node, Node* left_node, Node* right_node,
-                       InstructionOperand* left_op,
-                       InstructionOperand* right_op, InstructionCode* opcode) {
-  if (!selector->CanCover(node, right_node)) return false;
-
-  NodeMatcher nm(right_node);
-
-  if (nm.IsWord32And()) {
-    Int32BinopMatcher mright(right_node);
-    if (mright.right().Is(0xFF) || mright.right().Is(0xFFFF)) {
-      int32_t mask = mright.right().Value();
-      *left_op = g->UseRegister(left_node);
-      *right_op = g->UseRegister(mright.left().node());
-      *opcode |= AddressingModeField::encode(
-          (mask == 0xFF) ? kMode_Operand2_R_UXTB : kMode_Operand2_R_UXTH);
-      return true;
-    }
-  } else if (nm.IsWord32Sar()) {
-    Int32BinopMatcher mright(right_node);
-    if (selector->CanCover(mright.node(), mright.left().node()) &&
-        mright.left().IsWord32Shl()) {
-      Int32BinopMatcher mleft_of_right(mright.left().node());
-      if ((mright.right().Is(16) && mleft_of_right.right().Is(16)) ||
-          (mright.right().Is(24) && mleft_of_right.right().Is(24))) {
-        int32_t shift = mright.right().Value();
-        *left_op = g->UseRegister(left_node);
-        *right_op = g->UseRegister(mleft_of_right.left().node());
-        *opcode |= AddressingModeField::encode(
-            (shift == 24) ? kMode_Operand2_R_SXTB : kMode_Operand2_R_SXTH);
-        return true;
-      }
-    }
-  }
-  return false;
-}
-
-bool TryMatchLoadStoreShift(Arm64OperandGenerator* g,
-                            InstructionSelector* selector,
-                            MachineRepresentation rep, Node* node, Node* index,
-                            InstructionOperand* index_op,
-                            InstructionOperand* shift_immediate_op) {
-  if (!selector->CanCover(node, index)) return false;
-  if (index->InputCount() != 2) return false;
-  Node* left = index->InputAt(0);
-  Node* right = index->InputAt(1);
-  switch (index->opcode()) {
-    case IrOpcode::kWord32Shl:
-    case IrOpcode::kWord64Shl:
-      if (!g->CanBeLoadStoreShiftImmediate(right, rep)) {
-        return false;
-      }
-      *index_op = g->UseRegister(left);
-      *shift_immediate_op = g->UseImmediate(right);
-      return true;
-    default:
-      return false;
-  }
-}
-
-// Bitfields describing binary operator properties:
-// CanCommuteField is true if we can switch the two operands, potentially
-// requiring commuting the flags continuation condition.
-typedef BitField8<bool, 1, 1> CanCommuteField;
-// MustCommuteCondField is true when we need to commute the flags continuation
-// condition in order to switch the operands.
-typedef BitField8<bool, 2, 1> MustCommuteCondField;
-// IsComparisonField is true when the operation is a comparison and has no other
-// result other than the condition.
-typedef BitField8<bool, 3, 1> IsComparisonField;
-// IsAddSubField is true when an instruction is encoded as ADD or SUB.
-typedef BitField8<bool, 4, 1> IsAddSubField;
-
-// Get properties of a binary operator.
-uint8_t GetBinopProperties(InstructionCode opcode) {
-  uint8_t result = 0;
-  switch (opcode) {
-    case kArm64Cmp32:
-    case kArm64Cmp:
-      // We can commute CMP by switching the inputs and commuting
-      // the flags continuation.
-      result = CanCommuteField::update(result, true);
-      result = MustCommuteCondField::update(result, true);
-      result = IsComparisonField::update(result, true);
-      // The CMP and CMN instructions are encoded as SUB or ADD
-      // with zero output register, and therefore support the same
-      // operand modes.
-      result = IsAddSubField::update(result, true);
-      break;
-    case kArm64Cmn32:
-    case kArm64Cmn:
-      result = CanCommuteField::update(result, true);
-      result = IsComparisonField::update(result, true);
-      result = IsAddSubField::update(result, true);
-      break;
-    case kArm64Add32:
-    case kArm64Add:
-      result = CanCommuteField::update(result, true);
-      result = IsAddSubField::update(result, true);
-      break;
-    case kArm64Sub32:
-    case kArm64Sub:
-      result = IsAddSubField::update(result, true);
-      break;
-    case kArm64Tst32:
-    case kArm64Tst:
-      result = CanCommuteField::update(result, true);
-      result = IsComparisonField::update(result, true);
-      break;
-    case kArm64And32:
-    case kArm64And:
-    case kArm64Or32:
-    case kArm64Or:
-    case kArm64Eor32:
-    case kArm64Eor:
-      result = CanCommuteField::update(result, true);
-      break;
-    default:
-      UNREACHABLE();
-  }
-  DCHECK_IMPLIES(MustCommuteCondField::decode(result),
-                 CanCommuteField::decode(result));
-  return result;
-}
-
-// Shared routine for multiple binary operations.
-template <typename Matcher>
-void VisitBinop(InstructionSelector* selector, Node* node,
-                InstructionCode opcode, ImmediateMode operand_mode,
-                FlagsContinuation* cont) {
-  Arm64OperandGenerator g(selector);
-  InstructionOperand inputs[5];
-  size_t input_count = 0;
-  InstructionOperand outputs[2];
-  size_t output_count = 0;
-
-  Node* left_node = node->InputAt(0);
-  Node* right_node = node->InputAt(1);
-
-  uint8_t properties = GetBinopProperties(opcode);
-  bool can_commute = CanCommuteField::decode(properties);
-  bool must_commute_cond = MustCommuteCondField::decode(properties);
-  bool is_add_sub = IsAddSubField::decode(properties);
-
-  if (g.CanBeImmediate(right_node, operand_mode)) {
-    inputs[input_count++] = g.UseRegister(left_node);
-    inputs[input_count++] = g.UseImmediate(right_node);
-  } else if (can_commute && g.CanBeImmediate(left_node, operand_mode)) {
-    if (must_commute_cond) cont->Commute();
-    inputs[input_count++] = g.UseRegister(right_node);
-    inputs[input_count++] = g.UseImmediate(left_node);
-  } else if (is_add_sub &&
-             TryMatchAnyExtend(&g, selector, node, left_node, right_node,
-                               &inputs[0], &inputs[1], &opcode)) {
-    input_count += 2;
-  } else if (is_add_sub && can_commute &&
-             TryMatchAnyExtend(&g, selector, node, right_node, left_node,
-                               &inputs[0], &inputs[1], &opcode)) {
-    if (must_commute_cond) cont->Commute();
-    input_count += 2;
-  } else if (TryMatchAnyShift(selector, node, right_node, &opcode,
-                              !is_add_sub)) {
-    Matcher m_shift(right_node);
-    inputs[input_count++] = g.UseRegisterOrImmediateZero(left_node);
-    inputs[input_count++] = g.UseRegister(m_shift.left().node());
-    // We only need at most the last 6 bits of the shift.
-    inputs[input_count++] =
-        g.UseImmediate(static_cast<int>(m_shift.right().Value() & 0x3F));
-  } else if (can_commute && TryMatchAnyShift(selector, node, left_node, &opcode,
-                                             !is_add_sub)) {
-    if (must_commute_cond) cont->Commute();
-    Matcher m_shift(left_node);
-    inputs[input_count++] = g.UseRegisterOrImmediateZero(right_node);
-    inputs[input_count++] = g.UseRegister(m_shift.left().node());
-    // We only need at most the last 6 bits of the shift.
-    inputs[input_count++] =
-        g.UseImmediate(static_cast<int>(m_shift.right().Value() & 0x3F));
-  } else {
-    inputs[input_count++] = g.UseRegisterOrImmediateZero(left_node);
-    inputs[input_count++] = g.UseRegister(right_node);
-  }
-
-  if (cont->IsBranch()) {
-    inputs[input_count++] = g.Label(cont->true_block());
-    inputs[input_count++] = g.Label(cont->false_block());
-  }
-
-  if (!IsComparisonField::decode(properties)) {
-    outputs[output_count++] = g.DefineAsRegister(node);
-  }
-
-  if (cont->IsSet()) {
-    outputs[output_count++] = g.DefineAsRegister(cont->result());
-  }
-
-  DCHECK_NE(0u, input_count);
-  DCHECK((output_count != 0) || IsComparisonField::decode(properties));
-  DCHECK_GE(arraysize(inputs), input_count);
-  DCHECK_GE(arraysize(outputs), output_count);
-
-  opcode = cont->Encode(opcode);
-  if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(opcode, output_count, outputs, input_count, inputs,
-                             cont->kind(), cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else if (cont->IsTrap()) {
-    inputs[input_count++] = g.UseImmediate(cont->trap_id());
-    selector->Emit(opcode, output_count, outputs, input_count, inputs);
-  } else {
-    selector->Emit(opcode, output_count, outputs, input_count, inputs);
-  }
-}
-
-
-// Shared routine for multiple binary operations.
-template <typename Matcher>
-void VisitBinop(InstructionSelector* selector, Node* node, ArchOpcode opcode,
-                ImmediateMode operand_mode) {
-  FlagsContinuation cont;
-  VisitBinop<Matcher>(selector, node, opcode, operand_mode, &cont);
-}
-
-
-template <typename Matcher>
-void VisitAddSub(InstructionSelector* selector, Node* node, ArchOpcode opcode,
-                 ArchOpcode negate_opcode) {
-  Arm64OperandGenerator g(selector);
-  Matcher m(node);
-  if (m.right().HasValue() && (m.right().Value() < 0) &&
-      g.CanBeImmediate(-m.right().Value(), kArithmeticImm)) {
-    selector->Emit(negate_opcode, g.DefineAsRegister(node),
-                   g.UseRegister(m.left().node()),
-                   g.TempImmediate(static_cast<int32_t>(-m.right().Value())));
-  } else {
-    VisitBinop<Matcher>(selector, node, opcode, kArithmeticImm);
-  }
-}
-
-
-// For multiplications by immediate of the form x * (2^k + 1), where k > 0,
-// return the value of k, otherwise return zero. This is used to reduce the
-// multiplication to addition with left shift: x + (x << k).
-template <typename Matcher>
-int32_t LeftShiftForReducedMultiply(Matcher* m) {
-  DCHECK(m->IsInt32Mul() || m->IsInt64Mul());
-  if (m->right().HasValue() && m->right().Value() >= 3) {
-    uint64_t value_minus_one = m->right().Value() - 1;
-    if (base::bits::IsPowerOfTwo(value_minus_one)) {
-      return WhichPowerOf2(value_minus_one);
-    }
-  }
-  return 0;
-}
-
-}  // namespace
-
-void InstructionSelector::VisitStackSlot(Node* node) {
-  StackSlotRepresentation rep = StackSlotRepresentationOf(node->op());
-  int slot = frame_->AllocateSpillSlot(rep.size());
-  OperandGenerator g(this);
-
-  Emit(kArchStackSlot, g.DefineAsRegister(node),
-       sequence()->AddImmediate(Constant(slot)), 0, nullptr);
-}
-
-void InstructionSelector::VisitDebugAbort(Node* node) {
-  Arm64OperandGenerator g(this);
-  Emit(kArchDebugAbort, g.NoOutput(), g.UseFixed(node->InputAt(0), x1));
-}
-
-void EmitLoad(InstructionSelector* selector, Node* node, InstructionCode opcode,
-              ImmediateMode immediate_mode, MachineRepresentation rep,
-              Node* output = nullptr) {
-  Arm64OperandGenerator g(selector);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  InstructionOperand inputs[3];
-  size_t input_count = 0;
-  InstructionOperand outputs[1];
-
-  // If output is not nullptr, use that as the output register. This
-  // is used when we merge a conversion into the load.
-  outputs[0] = g.DefineAsRegister(output == nullptr ? node : output);
-  inputs[0] = g.UseRegister(base);
-
-  if (g.CanBeImmediate(index, immediate_mode)) {
-    input_count = 2;
-    inputs[1] = g.UseImmediate(index);
-    opcode |= AddressingModeField::encode(kMode_MRI);
-  } else if (TryMatchLoadStoreShift(&g, selector, rep, node, index, &inputs[1],
-                                    &inputs[2])) {
-    input_count = 3;
-    opcode |= AddressingModeField::encode(kMode_Operand2_R_LSL_I);
-  } else {
-    input_count = 2;
-    inputs[1] = g.UseRegister(index);
-    opcode |= AddressingModeField::encode(kMode_MRR);
-  }
-
-  selector->Emit(opcode, arraysize(outputs), outputs, input_count, inputs);
-}
-
-void InstructionSelector::VisitLoad(Node* node) {
-  InstructionCode opcode = kArchNop;
-  ImmediateMode immediate_mode = kNoImmediate;
-  LoadRepresentation load_rep = LoadRepresentationOf(node->op());
-  MachineRepresentation rep = load_rep.representation();
-  switch (rep) {
-    case MachineRepresentation::kFloat32:
-      opcode = kArm64LdrS;
-      immediate_mode = kLoadStoreImm32;
-      break;
-    case MachineRepresentation::kFloat64:
-      opcode = kArm64LdrD;
-      immediate_mode = kLoadStoreImm64;
-      break;
-    case MachineRepresentation::kBit:  // Fall through.
-    case MachineRepresentation::kWord8:
-      opcode = load_rep.IsSigned() ? kArm64Ldrsb : kArm64Ldrb;
-      immediate_mode = kLoadStoreImm8;
-      break;
-    case MachineRepresentation::kWord16:
-      opcode = load_rep.IsSigned() ? kArm64Ldrsh : kArm64Ldrh;
-      immediate_mode = kLoadStoreImm16;
-      break;
-    case MachineRepresentation::kWord32:
-      opcode = kArm64LdrW;
-      immediate_mode = kLoadStoreImm32;
-      break;
-    case MachineRepresentation::kTaggedSigned:   // Fall through.
-    case MachineRepresentation::kTaggedPointer:  // Fall through.
-    case MachineRepresentation::kTagged:  // Fall through.
-    case MachineRepresentation::kWord64:
-      opcode = kArm64Ldr;
-      immediate_mode = kLoadStoreImm64;
-      break;
-    case MachineRepresentation::kSimd128:
-      opcode = kArm64LdrQ;
-      immediate_mode = kNoImmediate;
-      break;
-    case MachineRepresentation::kNone:
-      UNREACHABLE();
-      return;
-  }
-  EmitLoad(this, node, opcode, immediate_mode, rep);
-}
-
-void InstructionSelector::VisitProtectedLoad(Node* node) {
-  // TODO(eholk)
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitStore(Node* node) {
-  Arm64OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-
-  StoreRepresentation store_rep = StoreRepresentationOf(node->op());
-  WriteBarrierKind write_barrier_kind = store_rep.write_barrier_kind();
-  MachineRepresentation rep = store_rep.representation();
-
-  // TODO(arm64): I guess this could be done in a better way.
-  if (write_barrier_kind != kNoWriteBarrier) {
-    DCHECK(CanBeTaggedPointer(rep));
-    AddressingMode addressing_mode;
-    InstructionOperand inputs[3];
-    size_t input_count = 0;
-    inputs[input_count++] = g.UseUniqueRegister(base);
-    // OutOfLineRecordWrite uses the index in an arithmetic instruction, so we
-    // must check kArithmeticImm as well as kLoadStoreImm64.
-    if (g.CanBeImmediate(index, kArithmeticImm) &&
-        g.CanBeImmediate(index, kLoadStoreImm64)) {
-      inputs[input_count++] = g.UseImmediate(index);
-      addressing_mode = kMode_MRI;
-    } else {
-      inputs[input_count++] = g.UseUniqueRegister(index);
-      addressing_mode = kMode_MRR;
-    }
-    inputs[input_count++] = g.UseUniqueRegister(value);
-    RecordWriteMode record_write_mode = RecordWriteMode::kValueIsAny;
-    switch (write_barrier_kind) {
-      case kNoWriteBarrier:
-        UNREACHABLE();
-        break;
-      case kMapWriteBarrier:
-        record_write_mode = RecordWriteMode::kValueIsMap;
-        break;
-      case kPointerWriteBarrier:
-        record_write_mode = RecordWriteMode::kValueIsPointer;
-        break;
-      case kFullWriteBarrier:
-        record_write_mode = RecordWriteMode::kValueIsAny;
-        break;
-    }
-    InstructionOperand temps[] = {g.TempRegister(), g.TempRegister()};
-    size_t const temp_count = arraysize(temps);
-    InstructionCode code = kArchStoreWithWriteBarrier;
-    code |= AddressingModeField::encode(addressing_mode);
-    code |= MiscField::encode(static_cast<int>(record_write_mode));
-    Emit(code, 0, nullptr, input_count, inputs, temp_count, temps);
-  } else {
-    InstructionOperand inputs[4];
-    size_t input_count = 0;
-    InstructionCode opcode = kArchNop;
-    ImmediateMode immediate_mode = kNoImmediate;
-    switch (rep) {
-      case MachineRepresentation::kFloat32:
-        opcode = kArm64StrS;
-        immediate_mode = kLoadStoreImm32;
-        break;
-      case MachineRepresentation::kFloat64:
-        opcode = kArm64StrD;
-        immediate_mode = kLoadStoreImm64;
-        break;
-      case MachineRepresentation::kBit:  // Fall through.
-      case MachineRepresentation::kWord8:
-        opcode = kArm64Strb;
-        immediate_mode = kLoadStoreImm8;
-        break;
-      case MachineRepresentation::kWord16:
-        opcode = kArm64Strh;
-        immediate_mode = kLoadStoreImm16;
-        break;
-      case MachineRepresentation::kWord32:
-        opcode = kArm64StrW;
-        immediate_mode = kLoadStoreImm32;
-        break;
-      case MachineRepresentation::kTaggedSigned:   // Fall through.
-      case MachineRepresentation::kTaggedPointer:  // Fall through.
-      case MachineRepresentation::kTagged:  // Fall through.
-      case MachineRepresentation::kWord64:
-        opcode = kArm64Str;
-        immediate_mode = kLoadStoreImm64;
-        break;
-      case MachineRepresentation::kSimd128:
-        opcode = kArm64StrQ;
-        immediate_mode = kNoImmediate;
-        break;
-      case MachineRepresentation::kNone:
-        UNREACHABLE();
-        return;
-    }
-
-    inputs[0] = g.UseRegisterOrImmediateZero(value);
-    inputs[1] = g.UseRegister(base);
-
-    if (g.CanBeImmediate(index, immediate_mode)) {
-      input_count = 3;
-      inputs[2] = g.UseImmediate(index);
-      opcode |= AddressingModeField::encode(kMode_MRI);
-    } else if (TryMatchLoadStoreShift(&g, this, rep, node, index, &inputs[2],
-                                      &inputs[3])) {
-      input_count = 4;
-      opcode |= AddressingModeField::encode(kMode_Operand2_R_LSL_I);
-    } else {
-      input_count = 3;
-      inputs[2] = g.UseRegister(index);
-      opcode |= AddressingModeField::encode(kMode_MRR);
-    }
-
-    Emit(opcode, 0, nullptr, input_count, inputs);
-  }
-}
-
-void InstructionSelector::VisitProtectedStore(Node* node) {
-  // TODO(eholk)
-  UNIMPLEMENTED();
-}
-
-// Architecture supports unaligned access, therefore VisitLoad is used instead
-void InstructionSelector::VisitUnalignedLoad(Node* node) { UNREACHABLE(); }
-
-// Architecture supports unaligned access, therefore VisitStore is used instead
-void InstructionSelector::VisitUnalignedStore(Node* node) { UNREACHABLE(); }
-
-template <typename Matcher>
-static void VisitLogical(InstructionSelector* selector, Node* node, Matcher* m,
-                         ArchOpcode opcode, bool left_can_cover,
-                         bool right_can_cover, ImmediateMode imm_mode) {
-  Arm64OperandGenerator g(selector);
-
-  // Map instruction to equivalent operation with inverted right input.
-  ArchOpcode inv_opcode = opcode;
-  switch (opcode) {
-    case kArm64And32:
-      inv_opcode = kArm64Bic32;
-      break;
-    case kArm64And:
-      inv_opcode = kArm64Bic;
-      break;
-    case kArm64Or32:
-      inv_opcode = kArm64Orn32;
-      break;
-    case kArm64Or:
-      inv_opcode = kArm64Orn;
-      break;
-    case kArm64Eor32:
-      inv_opcode = kArm64Eon32;
-      break;
-    case kArm64Eor:
-      inv_opcode = kArm64Eon;
-      break;
-    default:
-      UNREACHABLE();
-  }
-
-  // Select Logical(y, ~x) for Logical(Xor(x, -1), y).
-  if ((m->left().IsWord32Xor() || m->left().IsWord64Xor()) && left_can_cover) {
-    Matcher mleft(m->left().node());
-    if (mleft.right().Is(-1)) {
-      // TODO(all): support shifted operand on right.
-      selector->Emit(inv_opcode, g.DefineAsRegister(node),
-                     g.UseRegister(m->right().node()),
-                     g.UseRegister(mleft.left().node()));
-      return;
-    }
-  }
-
-  // Select Logical(x, ~y) for Logical(x, Xor(y, -1)).
-  if ((m->right().IsWord32Xor() || m->right().IsWord64Xor()) &&
-      right_can_cover) {
-    Matcher mright(m->right().node());
-    if (mright.right().Is(-1)) {
-      // TODO(all): support shifted operand on right.
-      selector->Emit(inv_opcode, g.DefineAsRegister(node),
-                     g.UseRegister(m->left().node()),
-                     g.UseRegister(mright.left().node()));
-      return;
-    }
-  }
-
-  if (m->IsWord32Xor() && m->right().Is(-1)) {
-    selector->Emit(kArm64Not32, g.DefineAsRegister(node),
-                   g.UseRegister(m->left().node()));
-  } else if (m->IsWord64Xor() && m->right().Is(-1)) {
-    selector->Emit(kArm64Not, g.DefineAsRegister(node),
-                   g.UseRegister(m->left().node()));
-  } else {
-    VisitBinop<Matcher>(selector, node, opcode, imm_mode);
-  }
-}
-
-
-void InstructionSelector::VisitWord32And(Node* node) {
-  Arm64OperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  if (m.left().IsWord32Shr() && CanCover(node, m.left().node()) &&
-      m.right().HasValue()) {
-    uint32_t mask = m.right().Value();
-    uint32_t mask_width = base::bits::CountPopulation(mask);
-    uint32_t mask_msb = base::bits::CountLeadingZeros32(mask);
-    if ((mask_width != 0) && (mask_width != 32) &&
-        (mask_msb + mask_width == 32)) {
-      // The mask must be contiguous, and occupy the least-significant bits.
-      DCHECK_EQ(0u, base::bits::CountTrailingZeros32(mask));
-
-      // Select Ubfx for And(Shr(x, imm), mask) where the mask is in the least
-      // significant bits.
-      Int32BinopMatcher mleft(m.left().node());
-      if (mleft.right().HasValue()) {
-        // Any shift value can match; int32 shifts use `value % 32`.
-        uint32_t lsb = mleft.right().Value() & 0x1F;
-
-        // Ubfx cannot extract bits past the register size, however since
-        // shifting the original value would have introduced some zeros we can
-        // still use ubfx with a smaller mask and the remaining bits will be
-        // zeros.
-        if (lsb + mask_width > 32) mask_width = 32 - lsb;
-
-        Emit(kArm64Ubfx32, g.DefineAsRegister(node),
-             g.UseRegister(mleft.left().node()),
-             g.UseImmediateOrTemp(mleft.right().node(), lsb),
-             g.TempImmediate(mask_width));
-        return;
-      }
-      // Other cases fall through to the normal And operation.
-    }
-  }
-  VisitLogical<Int32BinopMatcher>(
-      this, node, &m, kArm64And32, CanCover(node, m.left().node()),
-      CanCover(node, m.right().node()), kLogical32Imm);
-}
-
-
-void InstructionSelector::VisitWord64And(Node* node) {
-  Arm64OperandGenerator g(this);
-  Int64BinopMatcher m(node);
-  if (m.left().IsWord64Shr() && CanCover(node, m.left().node()) &&
-      m.right().HasValue()) {
-    uint64_t mask = m.right().Value();
-    uint64_t mask_width = base::bits::CountPopulation(mask);
-    uint64_t mask_msb = base::bits::CountLeadingZeros64(mask);
-    if ((mask_width != 0) && (mask_width != 64) &&
-        (mask_msb + mask_width == 64)) {
-      // The mask must be contiguous, and occupy the least-significant bits.
-      DCHECK_EQ(0u, base::bits::CountTrailingZeros64(mask));
-
-      // Select Ubfx for And(Shr(x, imm), mask) where the mask is in the least
-      // significant bits.
-      Int64BinopMatcher mleft(m.left().node());
-      if (mleft.right().HasValue()) {
-        // Any shift value can match; int64 shifts use `value % 64`.
-        uint32_t lsb = static_cast<uint32_t>(mleft.right().Value() & 0x3F);
-
-        // Ubfx cannot extract bits past the register size, however since
-        // shifting the original value would have introduced some zeros we can
-        // still use ubfx with a smaller mask and the remaining bits will be
-        // zeros.
-        if (lsb + mask_width > 64) mask_width = 64 - lsb;
-
-        Emit(kArm64Ubfx, g.DefineAsRegister(node),
-             g.UseRegister(mleft.left().node()),
-             g.UseImmediateOrTemp(mleft.right().node(), lsb),
-             g.TempImmediate(static_cast<int32_t>(mask_width)));
-        return;
-      }
-      // Other cases fall through to the normal And operation.
-    }
-  }
-  VisitLogical<Int64BinopMatcher>(
-      this, node, &m, kArm64And, CanCover(node, m.left().node()),
-      CanCover(node, m.right().node()), kLogical64Imm);
-}
-
-
-void InstructionSelector::VisitWord32Or(Node* node) {
-  Int32BinopMatcher m(node);
-  VisitLogical<Int32BinopMatcher>(
-      this, node, &m, kArm64Or32, CanCover(node, m.left().node()),
-      CanCover(node, m.right().node()), kLogical32Imm);
-}
-
-
-void InstructionSelector::VisitWord64Or(Node* node) {
-  Int64BinopMatcher m(node);
-  VisitLogical<Int64BinopMatcher>(
-      this, node, &m, kArm64Or, CanCover(node, m.left().node()),
-      CanCover(node, m.right().node()), kLogical64Imm);
-}
-
-
-void InstructionSelector::VisitWord32Xor(Node* node) {
-  Int32BinopMatcher m(node);
-  VisitLogical<Int32BinopMatcher>(
-      this, node, &m, kArm64Eor32, CanCover(node, m.left().node()),
-      CanCover(node, m.right().node()), kLogical32Imm);
-}
-
-
-void InstructionSelector::VisitWord64Xor(Node* node) {
-  Int64BinopMatcher m(node);
-  VisitLogical<Int64BinopMatcher>(
-      this, node, &m, kArm64Eor, CanCover(node, m.left().node()),
-      CanCover(node, m.right().node()), kLogical64Imm);
-}
-
-
-void InstructionSelector::VisitWord32Shl(Node* node) {
-  Int32BinopMatcher m(node);
-  if (m.left().IsWord32And() && CanCover(node, m.left().node()) &&
-      m.right().IsInRange(1, 31)) {
-    Arm64OperandGenerator g(this);
-    Int32BinopMatcher mleft(m.left().node());
-    if (mleft.right().HasValue()) {
-      uint32_t mask = mleft.right().Value();
-      uint32_t mask_width = base::bits::CountPopulation(mask);
-      uint32_t mask_msb = base::bits::CountLeadingZeros32(mask);
-      if ((mask_width != 0) && (mask_msb + mask_width == 32)) {
-        uint32_t shift = m.right().Value();
-        DCHECK_EQ(0u, base::bits::CountTrailingZeros32(mask));
-        DCHECK_NE(0u, shift);
-
-        if ((shift + mask_width) >= 32) {
-          // If the mask is contiguous and reaches or extends beyond the top
-          // bit, only the shift is needed.
-          Emit(kArm64Lsl32, g.DefineAsRegister(node),
-               g.UseRegister(mleft.left().node()),
-               g.UseImmediate(m.right().node()));
-          return;
-        } else {
-          // Select Ubfiz for Shl(And(x, mask), imm) where the mask is
-          // contiguous, and the shift immediate non-zero.
-          Emit(kArm64Ubfiz32, g.DefineAsRegister(node),
-               g.UseRegister(mleft.left().node()),
-               g.UseImmediate(m.right().node()), g.TempImmediate(mask_width));
-          return;
-        }
-      }
-    }
-  }
-  VisitRRO(this, kArm64Lsl32, node, kShift32Imm);
-}
-
-
-void InstructionSelector::VisitWord64Shl(Node* node) {
-  Arm64OperandGenerator g(this);
-  Int64BinopMatcher m(node);
-  if ((m.left().IsChangeInt32ToInt64() || m.left().IsChangeUint32ToUint64()) &&
-      m.right().IsInRange(32, 63) && CanCover(node, m.left().node())) {
-    // There's no need to sign/zero-extend to 64-bit if we shift out the upper
-    // 32 bits anyway.
-    Emit(kArm64Lsl, g.DefineAsRegister(node),
-         g.UseRegister(m.left().node()->InputAt(0)),
-         g.UseImmediate(m.right().node()));
-    return;
-  }
-  VisitRRO(this, kArm64Lsl, node, kShift64Imm);
-}
-
-
-namespace {
-
-bool TryEmitBitfieldExtract32(InstructionSelector* selector, Node* node) {
-  Arm64OperandGenerator g(selector);
-  Int32BinopMatcher m(node);
-  if (selector->CanCover(node, m.left().node()) && m.left().IsWord32Shl()) {
-    // Select Ubfx or Sbfx for (x << (K & 0x1F)) OP (K & 0x1F), where
-    // OP is >>> or >> and (K & 0x1F) != 0.
-    Int32BinopMatcher mleft(m.left().node());
-    if (mleft.right().HasValue() && m.right().HasValue() &&
-        (mleft.right().Value() & 0x1F) != 0 &&
-        (mleft.right().Value() & 0x1F) == (m.right().Value() & 0x1F)) {
-      DCHECK(m.IsWord32Shr() || m.IsWord32Sar());
-      ArchOpcode opcode = m.IsWord32Sar() ? kArm64Sbfx32 : kArm64Ubfx32;
-
-      int right_val = m.right().Value() & 0x1F;
-      DCHECK_NE(right_val, 0);
-
-      selector->Emit(opcode, g.DefineAsRegister(node),
-                     g.UseRegister(mleft.left().node()), g.TempImmediate(0),
-                     g.TempImmediate(32 - right_val));
-      return true;
-    }
-  }
-  return false;
-}
-
-}  // namespace
-
-
-void InstructionSelector::VisitWord32Shr(Node* node) {
-  Int32BinopMatcher m(node);
-  if (m.left().IsWord32And() && m.right().HasValue()) {
-    uint32_t lsb = m.right().Value() & 0x1F;
-    Int32BinopMatcher mleft(m.left().node());
-    if (mleft.right().HasValue() && mleft.right().Value() != 0) {
-      // Select Ubfx for Shr(And(x, mask), imm) where the result of the mask is
-      // shifted into the least-significant bits.
-      uint32_t mask = (mleft.right().Value() >> lsb) << lsb;
-      unsigned mask_width = base::bits::CountPopulation(mask);
-      unsigned mask_msb = base::bits::CountLeadingZeros32(mask);
-      if ((mask_msb + mask_width + lsb) == 32) {
-        Arm64OperandGenerator g(this);
-        DCHECK_EQ(lsb, base::bits::CountTrailingZeros32(mask));
-        Emit(kArm64Ubfx32, g.DefineAsRegister(node),
-             g.UseRegister(mleft.left().node()),
-             g.UseImmediateOrTemp(m.right().node(), lsb),
-             g.TempImmediate(mask_width));
-        return;
-      }
-    }
-  } else if (TryEmitBitfieldExtract32(this, node)) {
-    return;
-  }
-
-  if (m.left().IsUint32MulHigh() && m.right().HasValue() &&
-      CanCover(node, node->InputAt(0))) {
-    // Combine this shift with the multiply and shift that would be generated
-    // by Uint32MulHigh.
-    Arm64OperandGenerator g(this);
-    Node* left = m.left().node();
-    int shift = m.right().Value() & 0x1F;
-    InstructionOperand const smull_operand = g.TempRegister();
-    Emit(kArm64Umull, smull_operand, g.UseRegister(left->InputAt(0)),
-         g.UseRegister(left->InputAt(1)));
-    Emit(kArm64Lsr, g.DefineAsRegister(node), smull_operand,
-         g.TempImmediate(32 + shift));
-    return;
-  }
-
-  VisitRRO(this, kArm64Lsr32, node, kShift32Imm);
-}
-
-
-void InstructionSelector::VisitWord64Shr(Node* node) {
-  Int64BinopMatcher m(node);
-  if (m.left().IsWord64And() && m.right().HasValue()) {
-    uint32_t lsb = m.right().Value() & 0x3F;
-    Int64BinopMatcher mleft(m.left().node());
-    if (mleft.right().HasValue() && mleft.right().Value() != 0) {
-      // Select Ubfx for Shr(And(x, mask), imm) where the result of the mask is
-      // shifted into the least-significant bits.
-      uint64_t mask = (mleft.right().Value() >> lsb) << lsb;
-      unsigned mask_width = base::bits::CountPopulation(mask);
-      unsigned mask_msb = base::bits::CountLeadingZeros64(mask);
-      if ((mask_msb + mask_width + lsb) == 64) {
-        Arm64OperandGenerator g(this);
-        DCHECK_EQ(lsb, base::bits::CountTrailingZeros64(mask));
-        Emit(kArm64Ubfx, g.DefineAsRegister(node),
-             g.UseRegister(mleft.left().node()),
-             g.UseImmediateOrTemp(m.right().node(), lsb),
-             g.TempImmediate(mask_width));
-        return;
-      }
-    }
-  }
-  VisitRRO(this, kArm64Lsr, node, kShift64Imm);
-}
-
-
-void InstructionSelector::VisitWord32Sar(Node* node) {
-  if (TryEmitBitfieldExtract32(this, node)) {
-    return;
-  }
-
-  Int32BinopMatcher m(node);
-  if (m.left().IsInt32MulHigh() && m.right().HasValue() &&
-      CanCover(node, node->InputAt(0))) {
-    // Combine this shift with the multiply and shift that would be generated
-    // by Int32MulHigh.
-    Arm64OperandGenerator g(this);
-    Node* left = m.left().node();
-    int shift = m.right().Value() & 0x1F;
-    InstructionOperand const smull_operand = g.TempRegister();
-    Emit(kArm64Smull, smull_operand, g.UseRegister(left->InputAt(0)),
-         g.UseRegister(left->InputAt(1)));
-    Emit(kArm64Asr, g.DefineAsRegister(node), smull_operand,
-         g.TempImmediate(32 + shift));
-    return;
-  }
-
-  if (m.left().IsInt32Add() && m.right().HasValue() &&
-      CanCover(node, node->InputAt(0))) {
-    Node* add_node = m.left().node();
-    Int32BinopMatcher madd_node(add_node);
-    if (madd_node.left().IsInt32MulHigh() &&
-        CanCover(add_node, madd_node.left().node())) {
-      // Combine the shift that would be generated by Int32MulHigh with the add
-      // on the left of this Sar operation. We do it here, as the result of the
-      // add potentially has 33 bits, so we have to ensure the result is
-      // truncated by being the input to this 32-bit Sar operation.
-      Arm64OperandGenerator g(this);
-      Node* mul_node = madd_node.left().node();
-
-      InstructionOperand const smull_operand = g.TempRegister();
-      Emit(kArm64Smull, smull_operand, g.UseRegister(mul_node->InputAt(0)),
-           g.UseRegister(mul_node->InputAt(1)));
-
-      InstructionOperand const add_operand = g.TempRegister();
-      Emit(kArm64Add | AddressingModeField::encode(kMode_Operand2_R_ASR_I),
-           add_operand, g.UseRegister(add_node->InputAt(1)), smull_operand,
-           g.TempImmediate(32));
-
-      Emit(kArm64Asr32, g.DefineAsRegister(node), add_operand,
-           g.UseImmediate(node->InputAt(1)));
-      return;
-    }
-  }
-
-  VisitRRO(this, kArm64Asr32, node, kShift32Imm);
-}
-
-
-void InstructionSelector::VisitWord64Sar(Node* node) {
-  if (TryEmitExtendingLoad(this, node)) return;
-  VisitRRO(this, kArm64Asr, node, kShift64Imm);
-}
-
-
-void InstructionSelector::VisitWord32Ror(Node* node) {
-  VisitRRO(this, kArm64Ror32, node, kShift32Imm);
-}
-
-
-void InstructionSelector::VisitWord64Ror(Node* node) {
-  VisitRRO(this, kArm64Ror, node, kShift64Imm);
-}
-
-#define RR_OP_LIST(V)                                         \
-  V(Word64Clz, kArm64Clz)                                     \
-  V(Word32Clz, kArm64Clz32)                                   \
-  V(Word32ReverseBits, kArm64Rbit32)                          \
-  V(Word64ReverseBits, kArm64Rbit)                            \
-  V(ChangeFloat32ToFloat64, kArm64Float32ToFloat64)           \
-  V(RoundInt32ToFloat32, kArm64Int32ToFloat32)                \
-  V(RoundUint32ToFloat32, kArm64Uint32ToFloat32)              \
-  V(ChangeInt32ToFloat64, kArm64Int32ToFloat64)               \
-  V(ChangeUint32ToFloat64, kArm64Uint32ToFloat64)             \
-  V(TruncateFloat32ToInt32, kArm64Float32ToInt32)             \
-  V(ChangeFloat64ToInt32, kArm64Float64ToInt32)               \
-  V(TruncateFloat32ToUint32, kArm64Float32ToUint32)           \
-  V(ChangeFloat64ToUint32, kArm64Float64ToUint32)             \
-  V(ChangeFloat64ToUint64, kArm64Float64ToUint64)             \
-  V(TruncateFloat64ToUint32, kArm64Float64ToUint32)           \
-  V(TruncateFloat64ToFloat32, kArm64Float64ToFloat32)         \
-  V(TruncateFloat64ToWord32, kArchTruncateDoubleToI)          \
-  V(RoundFloat64ToInt32, kArm64Float64ToInt32)                \
-  V(RoundInt64ToFloat32, kArm64Int64ToFloat32)                \
-  V(RoundInt64ToFloat64, kArm64Int64ToFloat64)                \
-  V(RoundUint64ToFloat32, kArm64Uint64ToFloat32)              \
-  V(RoundUint64ToFloat64, kArm64Uint64ToFloat64)              \
-  V(BitcastFloat32ToInt32, kArm64Float64ExtractLowWord32)     \
-  V(BitcastFloat64ToInt64, kArm64U64MoveFloat64)              \
-  V(BitcastInt32ToFloat32, kArm64Float64MoveU64)              \
-  V(BitcastInt64ToFloat64, kArm64Float64MoveU64)              \
-  V(Float32Abs, kArm64Float32Abs)                             \
-  V(Float64Abs, kArm64Float64Abs)                             \
-  V(Float32Sqrt, kArm64Float32Sqrt)                           \
-  V(Float64Sqrt, kArm64Float64Sqrt)                           \
-  V(Float32RoundDown, kArm64Float32RoundDown)                 \
-  V(Float64RoundDown, kArm64Float64RoundDown)                 \
-  V(Float32RoundUp, kArm64Float32RoundUp)                     \
-  V(Float64RoundUp, kArm64Float64RoundUp)                     \
-  V(Float32RoundTruncate, kArm64Float32RoundTruncate)         \
-  V(Float64RoundTruncate, kArm64Float64RoundTruncate)         \
-  V(Float64RoundTiesAway, kArm64Float64RoundTiesAway)         \
-  V(Float32RoundTiesEven, kArm64Float32RoundTiesEven)         \
-  V(Float64RoundTiesEven, kArm64Float64RoundTiesEven)         \
-  V(Float32Neg, kArm64Float32Neg)                             \
-  V(Float64Neg, kArm64Float64Neg)                             \
-  V(Float64ExtractLowWord32, kArm64Float64ExtractLowWord32)   \
-  V(Float64ExtractHighWord32, kArm64Float64ExtractHighWord32) \
-  V(Float64SilenceNaN, kArm64Float64SilenceNaN)
-
-#define RRR_OP_LIST(V)            \
-  V(Int32Div, kArm64Idiv32)       \
-  V(Int64Div, kArm64Idiv)         \
-  V(Uint32Div, kArm64Udiv32)      \
-  V(Uint64Div, kArm64Udiv)        \
-  V(Int32Mod, kArm64Imod32)       \
-  V(Int64Mod, kArm64Imod)         \
-  V(Uint32Mod, kArm64Umod32)      \
-  V(Uint64Mod, kArm64Umod)        \
-  V(Float32Add, kArm64Float32Add) \
-  V(Float64Add, kArm64Float64Add) \
-  V(Float32Sub, kArm64Float32Sub) \
-  V(Float64Sub, kArm64Float64Sub) \
-  V(Float32Mul, kArm64Float32Mul) \
-  V(Float64Mul, kArm64Float64Mul) \
-  V(Float32Div, kArm64Float32Div) \
-  V(Float64Div, kArm64Float64Div) \
-  V(Float32Max, kArm64Float32Max) \
-  V(Float64Max, kArm64Float64Max) \
-  V(Float32Min, kArm64Float32Min) \
-  V(Float64Min, kArm64Float64Min)
-
-#define RR_VISITOR(Name, opcode)                      \
-  void InstructionSelector::Visit##Name(Node* node) { \
-    VisitRR(this, opcode, node);                      \
-  }
-RR_OP_LIST(RR_VISITOR)
-#undef RR_VISITOR
-
-#define RRR_VISITOR(Name, opcode)                     \
-  void InstructionSelector::Visit##Name(Node* node) { \
-    VisitRRR(this, opcode, node);                     \
-  }
-RRR_OP_LIST(RRR_VISITOR)
-#undef RRR_VISITOR
-
-void InstructionSelector::VisitWord32Ctz(Node* node) { UNREACHABLE(); }
-
-void InstructionSelector::VisitWord64Ctz(Node* node) { UNREACHABLE(); }
-
-void InstructionSelector::VisitWord64ReverseBytes(Node* node) { UNREACHABLE(); }
-
-void InstructionSelector::VisitWord32ReverseBytes(Node* node) { UNREACHABLE(); }
-
-void InstructionSelector::VisitWord32Popcnt(Node* node) { UNREACHABLE(); }
-
-void InstructionSelector::VisitWord64Popcnt(Node* node) { UNREACHABLE(); }
-
-void InstructionSelector::VisitSpeculationFence(Node* node) { UNREACHABLE(); }
-
-void InstructionSelector::VisitInt32Add(Node* node) {
-  Arm64OperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  // Select Madd(x, y, z) for Add(Mul(x, y), z).
-  if (m.left().IsInt32Mul() && CanCover(node, m.left().node())) {
-    Int32BinopMatcher mleft(m.left().node());
-    // Check multiply can't be later reduced to addition with shift.
-    if (LeftShiftForReducedMultiply(&mleft) == 0) {
-      Emit(kArm64Madd32, g.DefineAsRegister(node),
-           g.UseRegister(mleft.left().node()),
-           g.UseRegister(mleft.right().node()),
-           g.UseRegister(m.right().node()));
-      return;
-    }
-  }
-  // Select Madd(x, y, z) for Add(z, Mul(x, y)).
-  if (m.right().IsInt32Mul() && CanCover(node, m.right().node())) {
-    Int32BinopMatcher mright(m.right().node());
-    // Check multiply can't be later reduced to addition with shift.
-    if (LeftShiftForReducedMultiply(&mright) == 0) {
-      Emit(kArm64Madd32, g.DefineAsRegister(node),
-           g.UseRegister(mright.left().node()),
-           g.UseRegister(mright.right().node()),
-           g.UseRegister(m.left().node()));
-      return;
-    }
-  }
-  VisitAddSub<Int32BinopMatcher>(this, node, kArm64Add32, kArm64Sub32);
-}
-
-
-void InstructionSelector::VisitInt64Add(Node* node) {
-  Arm64OperandGenerator g(this);
-  Int64BinopMatcher m(node);
-  // Select Madd(x, y, z) for Add(Mul(x, y), z).
-  if (m.left().IsInt64Mul() && CanCover(node, m.left().node())) {
-    Int64BinopMatcher mleft(m.left().node());
-    // Check multiply can't be later reduced to addition with shift.
-    if (LeftShiftForReducedMultiply(&mleft) == 0) {
-      Emit(kArm64Madd, g.DefineAsRegister(node),
-           g.UseRegister(mleft.left().node()),
-           g.UseRegister(mleft.right().node()),
-           g.UseRegister(m.right().node()));
-      return;
-    }
-  }
-  // Select Madd(x, y, z) for Add(z, Mul(x, y)).
-  if (m.right().IsInt64Mul() && CanCover(node, m.right().node())) {
-    Int64BinopMatcher mright(m.right().node());
-    // Check multiply can't be later reduced to addition with shift.
-    if (LeftShiftForReducedMultiply(&mright) == 0) {
-      Emit(kArm64Madd, g.DefineAsRegister(node),
-           g.UseRegister(mright.left().node()),
-           g.UseRegister(mright.right().node()),
-           g.UseRegister(m.left().node()));
-      return;
-    }
-  }
-  VisitAddSub<Int64BinopMatcher>(this, node, kArm64Add, kArm64Sub);
-}
-
-
-void InstructionSelector::VisitInt32Sub(Node* node) {
-  Arm64OperandGenerator g(this);
-  Int32BinopMatcher m(node);
-
-  // Select Msub(x, y, a) for Sub(a, Mul(x, y)).
-  if (m.right().IsInt32Mul() && CanCover(node, m.right().node())) {
-    Int32BinopMatcher mright(m.right().node());
-    // Check multiply can't be later reduced to addition with shift.
-    if (LeftShiftForReducedMultiply(&mright) == 0) {
-      Emit(kArm64Msub32, g.DefineAsRegister(node),
-           g.UseRegister(mright.left().node()),
-           g.UseRegister(mright.right().node()),
-           g.UseRegister(m.left().node()));
-      return;
-    }
-  }
-
-  VisitAddSub<Int32BinopMatcher>(this, node, kArm64Sub32, kArm64Add32);
-}
-
-
-void InstructionSelector::VisitInt64Sub(Node* node) {
-  Arm64OperandGenerator g(this);
-  Int64BinopMatcher m(node);
-
-  // Select Msub(x, y, a) for Sub(a, Mul(x, y)).
-  if (m.right().IsInt64Mul() && CanCover(node, m.right().node())) {
-    Int64BinopMatcher mright(m.right().node());
-    // Check multiply can't be later reduced to addition with shift.
-    if (LeftShiftForReducedMultiply(&mright) == 0) {
-      Emit(kArm64Msub, g.DefineAsRegister(node),
-           g.UseRegister(mright.left().node()),
-           g.UseRegister(mright.right().node()),
-           g.UseRegister(m.left().node()));
-      return;
-    }
-  }
-
-  VisitAddSub<Int64BinopMatcher>(this, node, kArm64Sub, kArm64Add);
-}
-
-namespace {
-
-void EmitInt32MulWithOverflow(InstructionSelector* selector, Node* node,
-                              FlagsContinuation* cont) {
-  Arm64OperandGenerator g(selector);
-  Int32BinopMatcher m(node);
-  InstructionOperand result = g.DefineAsRegister(node);
-  InstructionOperand left = g.UseRegister(m.left().node());
-  InstructionOperand right = g.UseRegister(m.right().node());
-  selector->Emit(kArm64Smull, result, left, right);
-
-  InstructionCode opcode = cont->Encode(kArm64Cmp) |
-                           AddressingModeField::encode(kMode_Operand2_R_SXTW);
-  if (cont->IsBranch()) {
-    selector->Emit(opcode, g.NoOutput(), result, result,
-                   g.Label(cont->true_block()), g.Label(cont->false_block()));
-  } else if (cont->IsDeoptimize()) {
-    InstructionOperand in[] = {result, result};
-    selector->EmitDeoptimize(opcode, 0, nullptr, 2, in, cont->kind(),
-                             cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else if (cont->IsSet()) {
-    selector->Emit(opcode, g.DefineAsRegister(cont->result()), result, result);
-  } else {
-    DCHECK(cont->IsTrap());
-    selector->Emit(opcode, g.NoOutput(), result, result,
-                   g.UseImmediate(cont->trap_id()));
-  }
-}
-
-}  // namespace
-
-void InstructionSelector::VisitInt32Mul(Node* node) {
-  Arm64OperandGenerator g(this);
-  Int32BinopMatcher m(node);
-
-  // First, try to reduce the multiplication to addition with left shift.
-  // x * (2^k + 1) -> x + (x << k)
-  int32_t shift = LeftShiftForReducedMultiply(&m);
-  if (shift > 0) {
-    Emit(kArm64Add32 | AddressingModeField::encode(kMode_Operand2_R_LSL_I),
-         g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-         g.UseRegister(m.left().node()), g.TempImmediate(shift));
-    return;
-  }
-
-  if (m.left().IsInt32Sub() && CanCover(node, m.left().node())) {
-    Int32BinopMatcher mleft(m.left().node());
-
-    // Select Mneg(x, y) for Mul(Sub(0, x), y).
-    if (mleft.left().Is(0)) {
-      Emit(kArm64Mneg32, g.DefineAsRegister(node),
-           g.UseRegister(mleft.right().node()),
-           g.UseRegister(m.right().node()));
-      return;
-    }
-  }
-
-  if (m.right().IsInt32Sub() && CanCover(node, m.right().node())) {
-    Int32BinopMatcher mright(m.right().node());
-
-    // Select Mneg(x, y) for Mul(x, Sub(0, y)).
-    if (mright.left().Is(0)) {
-      Emit(kArm64Mneg32, g.DefineAsRegister(node),
-           g.UseRegister(m.left().node()),
-           g.UseRegister(mright.right().node()));
-      return;
-    }
-  }
-
-  VisitRRR(this, kArm64Mul32, node);
-}
-
-
-void InstructionSelector::VisitInt64Mul(Node* node) {
-  Arm64OperandGenerator g(this);
-  Int64BinopMatcher m(node);
-
-  // First, try to reduce the multiplication to addition with left shift.
-  // x * (2^k + 1) -> x + (x << k)
-  int32_t shift = LeftShiftForReducedMultiply(&m);
-  if (shift > 0) {
-    Emit(kArm64Add | AddressingModeField::encode(kMode_Operand2_R_LSL_I),
-         g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-         g.UseRegister(m.left().node()), g.TempImmediate(shift));
-    return;
-  }
-
-  if (m.left().IsInt64Sub() && CanCover(node, m.left().node())) {
-    Int64BinopMatcher mleft(m.left().node());
-
-    // Select Mneg(x, y) for Mul(Sub(0, x), y).
-    if (mleft.left().Is(0)) {
-      Emit(kArm64Mneg, g.DefineAsRegister(node),
-           g.UseRegister(mleft.right().node()),
-           g.UseRegister(m.right().node()));
-      return;
-    }
-  }
-
-  if (m.right().IsInt64Sub() && CanCover(node, m.right().node())) {
-    Int64BinopMatcher mright(m.right().node());
-
-    // Select Mneg(x, y) for Mul(x, Sub(0, y)).
-    if (mright.left().Is(0)) {
-      Emit(kArm64Mneg, g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-           g.UseRegister(mright.right().node()));
-      return;
-    }
-  }
-
-  VisitRRR(this, kArm64Mul, node);
-}
-
-void InstructionSelector::VisitInt32MulHigh(Node* node) {
-  Arm64OperandGenerator g(this);
-  InstructionOperand const smull_operand = g.TempRegister();
-  Emit(kArm64Smull, smull_operand, g.UseRegister(node->InputAt(0)),
-       g.UseRegister(node->InputAt(1)));
-  Emit(kArm64Asr, g.DefineAsRegister(node), smull_operand, g.TempImmediate(32));
-}
-
-
-void InstructionSelector::VisitUint32MulHigh(Node* node) {
-  Arm64OperandGenerator g(this);
-  InstructionOperand const smull_operand = g.TempRegister();
-  Emit(kArm64Umull, smull_operand, g.UseRegister(node->InputAt(0)),
-       g.UseRegister(node->InputAt(1)));
-  Emit(kArm64Lsr, g.DefineAsRegister(node), smull_operand, g.TempImmediate(32));
-}
-
-
-void InstructionSelector::VisitTryTruncateFloat32ToInt64(Node* node) {
-  Arm64OperandGenerator g(this);
-
-  InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))};
-  InstructionOperand outputs[2];
-  size_t output_count = 0;
-  outputs[output_count++] = g.DefineAsRegister(node);
-
-  Node* success_output = NodeProperties::FindProjection(node, 1);
-  if (success_output) {
-    outputs[output_count++] = g.DefineAsRegister(success_output);
-  }
-
-  Emit(kArm64Float32ToInt64, output_count, outputs, 1, inputs);
-}
-
-
-void InstructionSelector::VisitTryTruncateFloat64ToInt64(Node* node) {
-  Arm64OperandGenerator g(this);
-
-  InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))};
-  InstructionOperand outputs[2];
-  size_t output_count = 0;
-  outputs[output_count++] = g.DefineAsRegister(node);
-
-  Node* success_output = NodeProperties::FindProjection(node, 1);
-  if (success_output) {
-    outputs[output_count++] = g.DefineAsRegister(success_output);
-  }
-
-  Emit(kArm64Float64ToInt64, output_count, outputs, 1, inputs);
-}
-
-
-void InstructionSelector::VisitTryTruncateFloat32ToUint64(Node* node) {
-  Arm64OperandGenerator g(this);
-
-  InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))};
-  InstructionOperand outputs[2];
-  size_t output_count = 0;
-  outputs[output_count++] = g.DefineAsRegister(node);
-
-  Node* success_output = NodeProperties::FindProjection(node, 1);
-  if (success_output) {
-    outputs[output_count++] = g.DefineAsRegister(success_output);
-  }
-
-  Emit(kArm64Float32ToUint64, output_count, outputs, 1, inputs);
-}
-
-
-void InstructionSelector::VisitTryTruncateFloat64ToUint64(Node* node) {
-  Arm64OperandGenerator g(this);
-
-  InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))};
-  InstructionOperand outputs[2];
-  size_t output_count = 0;
-  outputs[output_count++] = g.DefineAsRegister(node);
-
-  Node* success_output = NodeProperties::FindProjection(node, 1);
-  if (success_output) {
-    outputs[output_count++] = g.DefineAsRegister(success_output);
-  }
-
-  Emit(kArm64Float64ToUint64, output_count, outputs, 1, inputs);
-}
-
-
-void InstructionSelector::VisitChangeInt32ToInt64(Node* node) {
-  Node* value = node->InputAt(0);
-  if (value->opcode() == IrOpcode::kLoad && CanCover(node, value)) {
-    // Generate sign-extending load.
-    LoadRepresentation load_rep = LoadRepresentationOf(value->op());
-    MachineRepresentation rep = load_rep.representation();
-    InstructionCode opcode = kArchNop;
-    ImmediateMode immediate_mode = kNoImmediate;
-    switch (rep) {
-      case MachineRepresentation::kBit:  // Fall through.
-      case MachineRepresentation::kWord8:
-        opcode = load_rep.IsSigned() ? kArm64Ldrsb : kArm64Ldrb;
-        immediate_mode = kLoadStoreImm8;
-        break;
-      case MachineRepresentation::kWord16:
-        opcode = load_rep.IsSigned() ? kArm64Ldrsh : kArm64Ldrh;
-        immediate_mode = kLoadStoreImm16;
-        break;
-      case MachineRepresentation::kWord32:
-        opcode = kArm64Ldrsw;
-        immediate_mode = kLoadStoreImm32;
-        break;
-      default:
-        UNREACHABLE();
-        return;
-    }
-    EmitLoad(this, value, opcode, immediate_mode, rep, node);
-  } else {
-    VisitRR(this, kArm64Sxtw, node);
-  }
-}
-
-
-void InstructionSelector::VisitChangeUint32ToUint64(Node* node) {
-  Arm64OperandGenerator g(this);
-  Node* value = node->InputAt(0);
-  switch (value->opcode()) {
-    case IrOpcode::kWord32And:
-    case IrOpcode::kWord32Or:
-    case IrOpcode::kWord32Xor:
-    case IrOpcode::kWord32Shl:
-    case IrOpcode::kWord32Shr:
-    case IrOpcode::kWord32Sar:
-    case IrOpcode::kWord32Ror:
-    case IrOpcode::kWord32Equal:
-    case IrOpcode::kInt32Add:
-    case IrOpcode::kInt32AddWithOverflow:
-    case IrOpcode::kInt32Sub:
-    case IrOpcode::kInt32SubWithOverflow:
-    case IrOpcode::kInt32Mul:
-    case IrOpcode::kInt32MulHigh:
-    case IrOpcode::kInt32Div:
-    case IrOpcode::kInt32Mod:
-    case IrOpcode::kInt32LessThan:
-    case IrOpcode::kInt32LessThanOrEqual:
-    case IrOpcode::kUint32Div:
-    case IrOpcode::kUint32LessThan:
-    case IrOpcode::kUint32LessThanOrEqual:
-    case IrOpcode::kUint32Mod:
-    case IrOpcode::kUint32MulHigh: {
-      // 32-bit operations will write their result in a W register (implicitly
-      // clearing the top 32-bit of the corresponding X register) so the
-      // zero-extension is a no-op.
-      Emit(kArchNop, g.DefineSameAsFirst(node), g.Use(value));
-      return;
-    }
-    case IrOpcode::kLoad: {
-      // As for the operations above, a 32-bit load will implicitly clear the
-      // top 32 bits of the destination register.
-      LoadRepresentation load_rep = LoadRepresentationOf(value->op());
-      switch (load_rep.representation()) {
-        case MachineRepresentation::kWord8:
-        case MachineRepresentation::kWord16:
-        case MachineRepresentation::kWord32:
-          Emit(kArchNop, g.DefineSameAsFirst(node), g.Use(value));
-          return;
-        default:
-          break;
-      }
-    }
-    default:
-      break;
-  }
-  Emit(kArm64Mov32, g.DefineAsRegister(node), g.UseRegister(value));
-}
-
-void InstructionSelector::VisitTruncateInt64ToInt32(Node* node) {
-  Arm64OperandGenerator g(this);
-  Node* value = node->InputAt(0);
-  // The top 32 bits in the 64-bit register will be undefined, and
-  // must not be used by a dependent node.
-  Emit(kArchNop, g.DefineSameAsFirst(node), g.UseRegister(value));
-}
-
-void InstructionSelector::VisitFloat64Mod(Node* node) {
-  Arm64OperandGenerator g(this);
-  Emit(kArm64Float64Mod, g.DefineAsFixed(node, d0),
-       g.UseFixed(node->InputAt(0), d0),
-       g.UseFixed(node->InputAt(1), d1))->MarkAsCall();
-}
-
-void InstructionSelector::VisitFloat64Ieee754Binop(Node* node,
-                                                   InstructionCode opcode) {
-  Arm64OperandGenerator g(this);
-  Emit(opcode, g.DefineAsFixed(node, d0), g.UseFixed(node->InputAt(0), d0),
-       g.UseFixed(node->InputAt(1), d1))
-      ->MarkAsCall();
-}
-
-void InstructionSelector::VisitFloat64Ieee754Unop(Node* node,
-                                                  InstructionCode opcode) {
-  Arm64OperandGenerator g(this);
-  Emit(opcode, g.DefineAsFixed(node, d0), g.UseFixed(node->InputAt(0), d0))
-      ->MarkAsCall();
-}
-
-void InstructionSelector::EmitPrepareArguments(
-    ZoneVector<PushParameter>* arguments, const CallDescriptor* descriptor,
-    Node* node) {
-  Arm64OperandGenerator g(this);
-
-  // `arguments` includes alignment "holes". This means that slots bigger than
-  // kPointerSize, e.g. Simd128, will span across multiple arguments.
-  int claim_count = static_cast<int>(arguments->size());
-  int slot = claim_count - 1;
-  claim_count = RoundUp(claim_count, 2);
-  // Bump the stack pointer(s).
-  if (claim_count > 0) {
-    // TODO(titzer): claim and poke probably take small immediates.
-    // TODO(titzer): it would be better to bump the csp here only
-    //               and emit paired stores with increment for non c frames.
-    Emit(kArm64Claim, g.NoOutput(), g.TempImmediate(claim_count));
-  }
-
-  if (claim_count > 0) {
-    // Store padding, which might be overwritten.
-    Emit(kArm64Poke, g.NoOutput(), g.UseImmediate(0),
-         g.TempImmediate(claim_count - 1));
-  }
-
-  // Poke the arguments into the stack.
-  while (slot >= 0) {
-    Node* input_node = (*arguments)[slot].node;
-    // Skip any alignment holes in pushed nodes.
-    if (input_node != nullptr) {
-      Emit(kArm64Poke, g.NoOutput(), g.UseRegister(input_node),
-           g.TempImmediate(slot));
-    }
-    slot--;
-    // TODO(ahaas): Poke arguments in pairs if two subsequent arguments have the
-    //              same type.
-    // Emit(kArm64PokePair, g.NoOutput(), g.UseRegister((*arguments)[slot]),
-    //      g.UseRegister((*arguments)[slot - 1]), g.TempImmediate(slot));
-    // slot -= 2;
-  }
-}
-
-void InstructionSelector::EmitPrepareResults(ZoneVector<PushParameter>* results,
-                                             const CallDescriptor* descriptor,
-                                             Node* node) {
-  Arm64OperandGenerator g(this);
-
-  int reverse_slot = 0;
-  for (PushParameter output : *results) {
-    if (!output.location.IsCallerFrameSlot()) continue;
-    reverse_slot += output.location.GetSizeInPointers();
-    // Skip any alignment holes in nodes.
-    if (output.node == nullptr) continue;
-    DCHECK(!descriptor->IsCFunctionCall());
-
-    if (output.location.GetType() == MachineType::Float32()) {
-      MarkAsFloat32(output.node);
-    } else if (output.location.GetType() == MachineType::Float64()) {
-      MarkAsFloat64(output.node);
-    }
-
-    Emit(kArm64Peek, g.DefineAsRegister(output.node),
-         g.UseImmediate(reverse_slot));
-  }
-}
-
-bool InstructionSelector::IsTailCallAddressImmediate() { return false; }
-
-int InstructionSelector::GetTempsCountForTailCallFromJSFunction() { return 3; }
-
-namespace {
-
-// Shared routine for multiple compare operations.
-void VisitCompare(InstructionSelector* selector, InstructionCode opcode,
-                  InstructionOperand left, InstructionOperand right,
-                  FlagsContinuation* cont) {
-  Arm64OperandGenerator g(selector);
-  opcode = cont->Encode(opcode);
-  if (cont->IsBranch()) {
-    selector->Emit(opcode, g.NoOutput(), left, right,
-                   g.Label(cont->true_block()), g.Label(cont->false_block()));
-  } else if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(opcode, g.NoOutput(), left, right, cont->kind(),
-                             cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else if (cont->IsSet()) {
-    selector->Emit(opcode, g.DefineAsRegister(cont->result()), left, right);
-  } else {
-    DCHECK(cont->IsTrap());
-    selector->Emit(opcode, g.NoOutput(), left, right,
-                   g.UseImmediate(cont->trap_id()));
-  }
-}
-
-
-// Shared routine for multiple word compare operations.
-void VisitWordCompare(InstructionSelector* selector, Node* node,
-                      InstructionCode opcode, FlagsContinuation* cont,
-                      bool commutative, ImmediateMode immediate_mode) {
-  Arm64OperandGenerator g(selector);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-
-  // Match immediates on left or right side of comparison.
-  if (g.CanBeImmediate(right, immediate_mode)) {
-    VisitCompare(selector, opcode, g.UseRegister(left), g.UseImmediate(right),
-                 cont);
-  } else if (g.CanBeImmediate(left, immediate_mode)) {
-    if (!commutative) cont->Commute();
-    VisitCompare(selector, opcode, g.UseRegister(right), g.UseImmediate(left),
-                 cont);
-  } else {
-    VisitCompare(selector, opcode, g.UseRegister(left), g.UseRegister(right),
-                 cont);
-  }
-}
-
-// This function checks whether we can convert:
-// ((a <op> b) cmp 0), b.<cond>
-// to:
-// (a <ops> b), b.<cond'>
-// where <ops> is the flag setting version of <op>.
-// We only generate conditions <cond'> that are a combination of the N
-// and Z flags. This avoids the need to make this function dependent on
-// the flag-setting operation.
-bool CanUseFlagSettingBinop(FlagsCondition cond) {
-  switch (cond) {
-    case kEqual:
-    case kNotEqual:
-    case kSignedLessThan:
-    case kSignedGreaterThanOrEqual:
-    case kUnsignedLessThanOrEqual:  // x <= 0 -> x == 0
-    case kUnsignedGreaterThan:      // x > 0 -> x != 0
-      return true;
-    default:
-      return false;
-  }
-}
-
-// Map <cond> to <cond'> so that the following transformation is possible:
-// ((a <op> b) cmp 0), b.<cond>
-// to:
-// (a <ops> b), b.<cond'>
-// where <ops> is the flag setting version of <op>.
-FlagsCondition MapForFlagSettingBinop(FlagsCondition cond) {
-  DCHECK(CanUseFlagSettingBinop(cond));
-  switch (cond) {
-    case kEqual:
-    case kNotEqual:
-      return cond;
-    case kSignedLessThan:
-      return kNegative;
-    case kSignedGreaterThanOrEqual:
-      return kPositiveOrZero;
-    case kUnsignedLessThanOrEqual:  // x <= 0 -> x == 0
-      return kEqual;
-    case kUnsignedGreaterThan:  // x > 0 -> x != 0
-      return kNotEqual;
-    default:
-      UNREACHABLE();
-  }
-}
-
-// This function checks if we can perform the transformation:
-// ((a <op> b) cmp 0), b.<cond>
-// to:
-// (a <ops> b), b.<cond'>
-// where <ops> is the flag setting version of <op>, and if so,
-// updates {node}, {opcode} and {cont} accordingly.
-void MaybeReplaceCmpZeroWithFlagSettingBinop(InstructionSelector* selector,
-                                             Node** node, Node* binop,
-                                             ArchOpcode* opcode,
-                                             FlagsCondition cond,
-                                             FlagsContinuation* cont,
-                                             ImmediateMode* immediate_mode) {
-  ArchOpcode binop_opcode;
-  ArchOpcode no_output_opcode;
-  ImmediateMode binop_immediate_mode;
-  switch (binop->opcode()) {
-    case IrOpcode::kInt32Add:
-      binop_opcode = kArm64Add32;
-      no_output_opcode = kArm64Cmn32;
-      binop_immediate_mode = kArithmeticImm;
-      break;
-    case IrOpcode::kWord32And:
-      binop_opcode = kArm64And32;
-      no_output_opcode = kArm64Tst32;
-      binop_immediate_mode = kLogical32Imm;
-      break;
-    default:
-      UNREACHABLE();
-      return;
-  }
-  if (selector->CanCover(*node, binop)) {
-    // The comparison is the only user of the add or and, so we can generate
-    // a cmn or tst instead.
-    cont->Overwrite(MapForFlagSettingBinop(cond));
-    *opcode = no_output_opcode;
-    *node = binop;
-    *immediate_mode = binop_immediate_mode;
-  } else if (selector->IsOnlyUserOfNodeInSameBlock(*node, binop)) {
-    // We can also handle the case where the add and the compare are in the
-    // same basic block, and the compare is the only use of add in this basic
-    // block (the add has users in other basic blocks).
-    cont->Overwrite(MapForFlagSettingBinop(cond));
-    *opcode = binop_opcode;
-    *node = binop;
-    *immediate_mode = binop_immediate_mode;
-  }
-}
-
-// Map {cond} to kEqual or kNotEqual, so that we can select
-// either TBZ or TBNZ when generating code for:
-// (x cmp 0), b.{cond}
-FlagsCondition MapForTbz(FlagsCondition cond) {
-  switch (cond) {
-    case kSignedLessThan:  // generate TBNZ
-      return kNotEqual;
-    case kSignedGreaterThanOrEqual:  // generate TBZ
-      return kEqual;
-    default:
-      UNREACHABLE();
-  }
-}
-
-// Map {cond} to kEqual or kNotEqual, so that we can select
-// either CBZ or CBNZ when generating code for:
-// (x cmp 0), b.{cond}
-FlagsCondition MapForCbz(FlagsCondition cond) {
-  switch (cond) {
-    case kEqual:     // generate CBZ
-    case kNotEqual:  // generate CBNZ
-      return cond;
-    case kUnsignedLessThanOrEqual:  // generate CBZ
-      return kEqual;
-    case kUnsignedGreaterThan:  // generate CBNZ
-      return kNotEqual;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void EmitBranchOrDeoptimize(InstructionSelector* selector,
-                            InstructionCode opcode, InstructionOperand value,
-                            FlagsContinuation* cont) {
-  Arm64OperandGenerator g(selector);
-  if (cont->IsBranch()) {
-    selector->Emit(cont->Encode(opcode), g.NoOutput(), value,
-                   g.Label(cont->true_block()), g.Label(cont->false_block()));
-  } else {
-    DCHECK(cont->IsDeoptimize());
-    selector->EmitDeoptimize(cont->Encode(opcode), g.NoOutput(), value,
-                             cont->kind(), cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  }
-}
-
-// Try to emit TBZ, TBNZ, CBZ or CBNZ for certain comparisons of {node}
-// against {value}, depending on the condition.
-bool TryEmitCbzOrTbz(InstructionSelector* selector, Node* node, uint32_t value,
-                     Node* user, FlagsCondition cond, FlagsContinuation* cont) {
-  // Only handle branches and deoptimisations.
-  if (!cont->IsBranch() && !cont->IsDeoptimize()) return false;
-
-  switch (cond) {
-    case kSignedLessThan:
-    case kSignedGreaterThanOrEqual: {
-      // Here we handle sign tests, aka. comparisons with zero.
-      if (value != 0) return false;
-      // We don't generate TBZ/TBNZ for deoptimisations, as they have a
-      // shorter range than conditional branches and generating them for
-      // deoptimisations results in more veneers.
-      if (cont->IsDeoptimize()) return false;
-      Arm64OperandGenerator g(selector);
-      cont->Overwrite(MapForTbz(cond));
-      Int32Matcher m(node);
-      if (m.IsFloat64ExtractHighWord32() && selector->CanCover(user, node)) {
-        // SignedLessThan(Float64ExtractHighWord32(x), 0) and
-        // SignedGreaterThanOrEqual(Float64ExtractHighWord32(x), 0) essentially
-        // check the sign bit of a 64-bit floating point value.
-        InstructionOperand temp = g.TempRegister();
-        selector->Emit(kArm64U64MoveFloat64, temp,
-                       g.UseRegister(node->InputAt(0)));
-        selector->Emit(cont->Encode(kArm64TestAndBranch), g.NoOutput(), temp,
-                       g.TempImmediate(63), g.Label(cont->true_block()),
-                       g.Label(cont->false_block()));
-        return true;
-      }
-      selector->Emit(cont->Encode(kArm64TestAndBranch32), g.NoOutput(),
-                     g.UseRegister(node), g.TempImmediate(31),
-                     g.Label(cont->true_block()), g.Label(cont->false_block()));
-      return true;
-    }
-    case kEqual:
-    case kNotEqual: {
-      if (node->opcode() == IrOpcode::kWord32And) {
-        // Emit a tbz/tbnz if we are comparing with a single-bit mask:
-        //   Branch(Word32Equal(Word32And(x, 1 << N), 1 << N), true, false)
-        Int32BinopMatcher m_and(node);
-        if (cont->IsBranch() && base::bits::IsPowerOfTwo(value) &&
-            m_and.right().Is(value) && selector->CanCover(user, node)) {
-          Arm64OperandGenerator g(selector);
-          // In the code generator, Equal refers to a bit being cleared. We want
-          // the opposite here so negate the condition.
-          cont->Negate();
-          selector->Emit(cont->Encode(kArm64TestAndBranch32), g.NoOutput(),
-                         g.UseRegister(m_and.left().node()),
-                         g.TempImmediate(base::bits::CountTrailingZeros(value)),
-                         g.Label(cont->true_block()),
-                         g.Label(cont->false_block()));
-          return true;
-        }
-      }
-    }  // Fall through.
-    case kUnsignedLessThanOrEqual:
-    case kUnsignedGreaterThan: {
-      if (value != 0) return false;
-      Arm64OperandGenerator g(selector);
-      cont->Overwrite(MapForCbz(cond));
-      EmitBranchOrDeoptimize(selector, kArm64CompareAndBranch32,
-                             g.UseRegister(node), cont);
-      return true;
-    }
-    default:
-      return false;
-  }
-}
-
-void VisitWord32Compare(InstructionSelector* selector, Node* node,
-                        FlagsContinuation* cont) {
-  Int32BinopMatcher m(node);
-  FlagsCondition cond = cont->condition();
-  if (m.right().HasValue()) {
-    if (TryEmitCbzOrTbz(selector, m.left().node(), m.right().Value(), node,
-                        cond, cont)) {
-      return;
-    }
-  } else if (m.left().HasValue()) {
-    FlagsCondition commuted_cond = CommuteFlagsCondition(cond);
-    if (TryEmitCbzOrTbz(selector, m.right().node(), m.left().Value(), node,
-                        commuted_cond, cont)) {
-      return;
-    }
-  }
-  ArchOpcode opcode = kArm64Cmp32;
-  ImmediateMode immediate_mode = kArithmeticImm;
-  if (m.right().Is(0) && (m.left().IsInt32Add() || m.left().IsWord32And())) {
-    // Emit flag setting add/and instructions for comparisons against zero.
-    if (CanUseFlagSettingBinop(cond)) {
-      Node* binop = m.left().node();
-      MaybeReplaceCmpZeroWithFlagSettingBinop(selector, &node, binop, &opcode,
-                                              cond, cont, &immediate_mode);
-    }
-  } else if (m.left().Is(0) &&
-             (m.right().IsInt32Add() || m.right().IsWord32And())) {
-    // Same as above, but we need to commute the condition before we
-    // continue with the rest of the checks.
-    FlagsCondition commuted_cond = CommuteFlagsCondition(cond);
-    if (CanUseFlagSettingBinop(commuted_cond)) {
-      Node* binop = m.right().node();
-      MaybeReplaceCmpZeroWithFlagSettingBinop(selector, &node, binop, &opcode,
-                                              commuted_cond, cont,
-                                              &immediate_mode);
-    }
-  } else if (m.right().IsInt32Sub() && (cond == kEqual || cond == kNotEqual)) {
-    // Select negated compare for comparisons with negated right input.
-    // Only do this for kEqual and kNotEqual, which do not depend on the
-    // C and V flags, as those flags will be different with CMN when the
-    // right-hand side of the original subtraction is INT_MIN.
-    Node* sub = m.right().node();
-    Int32BinopMatcher msub(sub);
-    if (msub.left().Is(0)) {
-      bool can_cover = selector->CanCover(node, sub);
-      node->ReplaceInput(1, msub.right().node());
-      // Even if the comparison node covers the subtraction, after the input
-      // replacement above, the node still won't cover the input to the
-      // subtraction; the subtraction still uses it.
-      // In order to get shifted operations to work, we must remove the rhs
-      // input to the subtraction, as TryMatchAnyShift requires this node to
-      // cover the input shift. We do this by setting it to the lhs input,
-      // as we know it's zero, and the result of the subtraction isn't used by
-      // any other node.
-      if (can_cover) sub->ReplaceInput(1, msub.left().node());
-      opcode = kArm64Cmn32;
-    }
-  }
-  VisitBinop<Int32BinopMatcher>(selector, node, opcode, immediate_mode, cont);
-}
-
-
-void VisitWordTest(InstructionSelector* selector, Node* node,
-                   InstructionCode opcode, FlagsContinuation* cont) {
-  Arm64OperandGenerator g(selector);
-  VisitCompare(selector, opcode, g.UseRegister(node), g.UseRegister(node),
-               cont);
-}
-
-
-void VisitWord32Test(InstructionSelector* selector, Node* node,
-                     FlagsContinuation* cont) {
-  VisitWordTest(selector, node, kArm64Tst32, cont);
-}
-
-
-void VisitWord64Test(InstructionSelector* selector, Node* node,
-                     FlagsContinuation* cont) {
-  VisitWordTest(selector, node, kArm64Tst, cont);
-}
-
-template <typename Matcher, ArchOpcode kOpcode>
-bool TryEmitTestAndBranch(InstructionSelector* selector, Node* node,
-                          FlagsContinuation* cont) {
-  Arm64OperandGenerator g(selector);
-  Matcher m(node);
-  if (cont->IsBranch() && m.right().HasValue() &&
-      base::bits::IsPowerOfTwo(m.right().Value())) {
-    // If the mask has only one bit set, we can use tbz/tbnz.
-    DCHECK((cont->condition() == kEqual) || (cont->condition() == kNotEqual));
-    selector->Emit(
-        cont->Encode(kOpcode), g.NoOutput(), g.UseRegister(m.left().node()),
-        g.TempImmediate(base::bits::CountTrailingZeros(m.right().Value())),
-        g.Label(cont->true_block()), g.Label(cont->false_block()));
-    return true;
-  }
-  return false;
-}
-
-// Shared routine for multiple float32 compare operations.
-void VisitFloat32Compare(InstructionSelector* selector, Node* node,
-                         FlagsContinuation* cont) {
-  Arm64OperandGenerator g(selector);
-  Float32BinopMatcher m(node);
-  if (m.right().Is(0.0f)) {
-    VisitCompare(selector, kArm64Float32Cmp, g.UseRegister(m.left().node()),
-                 g.UseImmediate(m.right().node()), cont);
-  } else if (m.left().Is(0.0f)) {
-    cont->Commute();
-    VisitCompare(selector, kArm64Float32Cmp, g.UseRegister(m.right().node()),
-                 g.UseImmediate(m.left().node()), cont);
-  } else {
-    VisitCompare(selector, kArm64Float32Cmp, g.UseRegister(m.left().node()),
-                 g.UseRegister(m.right().node()), cont);
-  }
-}
-
-
-// Shared routine for multiple float64 compare operations.
-void VisitFloat64Compare(InstructionSelector* selector, Node* node,
-                         FlagsContinuation* cont) {
-  Arm64OperandGenerator g(selector);
-  Float64BinopMatcher m(node);
-  if (m.right().Is(0.0)) {
-    VisitCompare(selector, kArm64Float64Cmp, g.UseRegister(m.left().node()),
-                 g.UseImmediate(m.right().node()), cont);
-  } else if (m.left().Is(0.0)) {
-    cont->Commute();
-    VisitCompare(selector, kArm64Float64Cmp, g.UseRegister(m.right().node()),
-                 g.UseImmediate(m.left().node()), cont);
-  } else {
-    VisitCompare(selector, kArm64Float64Cmp, g.UseRegister(m.left().node()),
-                 g.UseRegister(m.right().node()), cont);
-  }
-}
-
-void VisitWordCompareZero(InstructionSelector* selector, Node* user,
-                          Node* value, FlagsContinuation* cont) {
-  Arm64OperandGenerator g(selector);
-  // Try to combine with comparisons against 0 by simply inverting the branch.
-  while (value->opcode() == IrOpcode::kWord32Equal &&
-         selector->CanCover(user, value)) {
-    Int32BinopMatcher m(value);
-    if (!m.right().Is(0)) break;
-
-    user = value;
-    value = m.left().node();
-    cont->Negate();
-  }
-
-  if (selector->CanCover(user, value)) {
-    switch (value->opcode()) {
-      case IrOpcode::kWord32Equal:
-        cont->OverwriteAndNegateIfEqual(kEqual);
-        return VisitWord32Compare(selector, value, cont);
-      case IrOpcode::kInt32LessThan:
-        cont->OverwriteAndNegateIfEqual(kSignedLessThan);
-        return VisitWord32Compare(selector, value, cont);
-      case IrOpcode::kInt32LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kSignedLessThanOrEqual);
-        return VisitWord32Compare(selector, value, cont);
-      case IrOpcode::kUint32LessThan:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThan);
-        return VisitWord32Compare(selector, value, cont);
-      case IrOpcode::kUint32LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
-        return VisitWord32Compare(selector, value, cont);
-      case IrOpcode::kWord64Equal: {
-        cont->OverwriteAndNegateIfEqual(kEqual);
-        Int64BinopMatcher m(value);
-        if (m.right().Is(0)) {
-          Node* const left = m.left().node();
-          if (selector->CanCover(value, left) &&
-              left->opcode() == IrOpcode::kWord64And) {
-            // Attempt to merge the Word64Equal(Word64And(x, y), 0) comparison
-            // into a tbz/tbnz instruction.
-            if (TryEmitTestAndBranch<Uint64BinopMatcher, kArm64TestAndBranch>(
-                    selector, left, cont)) {
-              return;
-            }
-            return VisitWordCompare(selector, left, kArm64Tst, cont, true,
-                                    kLogical64Imm);
-          }
-          // Merge the Word64Equal(x, 0) comparison into a cbz instruction.
-          if (cont->IsBranch() || cont->IsDeoptimize()) {
-            EmitBranchOrDeoptimize(selector,
-                                   cont->Encode(kArm64CompareAndBranch),
-                                   g.UseRegister(left), cont);
-            return;
-          }
-        }
-        return VisitWordCompare(selector, value, kArm64Cmp, cont, false,
-                                kArithmeticImm);
-      }
-      case IrOpcode::kInt64LessThan:
-        cont->OverwriteAndNegateIfEqual(kSignedLessThan);
-        return VisitWordCompare(selector, value, kArm64Cmp, cont, false,
-                                kArithmeticImm);
-      case IrOpcode::kInt64LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kSignedLessThanOrEqual);
-        return VisitWordCompare(selector, value, kArm64Cmp, cont, false,
-                                kArithmeticImm);
-      case IrOpcode::kUint64LessThan:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThan);
-        return VisitWordCompare(selector, value, kArm64Cmp, cont, false,
-                                kArithmeticImm);
-      case IrOpcode::kUint64LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
-        return VisitWordCompare(selector, value, kArm64Cmp, cont, false,
-                                kArithmeticImm);
-      case IrOpcode::kFloat32Equal:
-        cont->OverwriteAndNegateIfEqual(kEqual);
-        return VisitFloat32Compare(selector, value, cont);
-      case IrOpcode::kFloat32LessThan:
-        cont->OverwriteAndNegateIfEqual(kFloatLessThan);
-        return VisitFloat32Compare(selector, value, cont);
-      case IrOpcode::kFloat32LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kFloatLessThanOrEqual);
-        return VisitFloat32Compare(selector, value, cont);
-      case IrOpcode::kFloat64Equal:
-        cont->OverwriteAndNegateIfEqual(kEqual);
-        return VisitFloat64Compare(selector, value, cont);
-      case IrOpcode::kFloat64LessThan:
-        cont->OverwriteAndNegateIfEqual(kFloatLessThan);
-        return VisitFloat64Compare(selector, value, cont);
-      case IrOpcode::kFloat64LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kFloatLessThanOrEqual);
-        return VisitFloat64Compare(selector, value, cont);
-      case IrOpcode::kProjection:
-        // Check if this is the overflow output projection of an
-        // <Operation>WithOverflow node.
-        if (ProjectionIndexOf(value->op()) == 1u) {
-          // We cannot combine the <Operation>WithOverflow with this branch
-          // unless the 0th projection (the use of the actual value of the
-          // <Operation> is either nullptr, which means there's no use of the
-          // actual value, or was already defined, which means it is scheduled
-          // *AFTER* this branch).
-          Node* const node = value->InputAt(0);
-          Node* const result = NodeProperties::FindProjection(node, 0);
-          if (result == nullptr || selector->IsDefined(result)) {
-            switch (node->opcode()) {
-              case IrOpcode::kInt32AddWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitBinop<Int32BinopMatcher>(
-                    selector, node, kArm64Add32, kArithmeticImm, cont);
-              case IrOpcode::kInt32SubWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitBinop<Int32BinopMatcher>(
-                    selector, node, kArm64Sub32, kArithmeticImm, cont);
-              case IrOpcode::kInt32MulWithOverflow:
-                // ARM64 doesn't set the overflow flag for multiplication, so we
-                // need to test on kNotEqual. Here is the code sequence used:
-                //   smull result, left, right
-                //   cmp result.X(), Operand(result, SXTW)
-                cont->OverwriteAndNegateIfEqual(kNotEqual);
-                return EmitInt32MulWithOverflow(selector, node, cont);
-              case IrOpcode::kInt64AddWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitBinop<Int64BinopMatcher>(selector, node, kArm64Add,
-                                                     kArithmeticImm, cont);
-              case IrOpcode::kInt64SubWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitBinop<Int64BinopMatcher>(selector, node, kArm64Sub,
-                                                     kArithmeticImm, cont);
-              default:
-                break;
-            }
-          }
-        }
-        break;
-      case IrOpcode::kInt32Add:
-        return VisitWordCompare(selector, value, kArm64Cmn32, cont, true,
-                                kArithmeticImm);
-      case IrOpcode::kInt32Sub:
-        return VisitWord32Compare(selector, value, cont);
-      case IrOpcode::kWord32And:
-        if (TryEmitTestAndBranch<Uint32BinopMatcher, kArm64TestAndBranch32>(
-                selector, value, cont)) {
-          return;
-        }
-        return VisitWordCompare(selector, value, kArm64Tst32, cont, true,
-                                kLogical32Imm);
-      case IrOpcode::kWord64And:
-        if (TryEmitTestAndBranch<Uint64BinopMatcher, kArm64TestAndBranch>(
-                selector, value, cont)) {
-          return;
-        }
-        return VisitWordCompare(selector, value, kArm64Tst, cont, true,
-                                kLogical64Imm);
-      default:
-        break;
-    }
-  }
-
-  // Branch could not be combined with a compare, compare against 0 and branch.
-  if (cont->IsBranch()) {
-    selector->Emit(cont->Encode(kArm64CompareAndBranch32), g.NoOutput(),
-                   g.UseRegister(value), g.Label(cont->true_block()),
-                   g.Label(cont->false_block()));
-  } else if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(cont->Encode(kArm64Tst32), g.NoOutput(),
-                             g.UseRegister(value), g.UseRegister(value),
-                             cont->kind(), cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else {
-    DCHECK(cont->IsTrap());
-    selector->Emit(cont->Encode(kArm64Tst32), g.NoOutput(),
-                   g.UseRegister(value), g.UseRegister(value),
-                   g.UseImmediate(cont->trap_id()));
-  }
-}
-
-}  // namespace
-
-void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch,
-                                      BasicBlock* fbranch) {
-  FlagsContinuation cont(kNotEqual, tbranch, fbranch);
-  VisitWordCompareZero(this, branch, branch->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitDeoptimizeIf(Node* node) {
-  DeoptimizeParameters p = DeoptimizeParametersOf(node->op());
-  FlagsContinuation cont = FlagsContinuation::ForDeoptimize(
-      kNotEqual, p.kind(), p.reason(), p.feedback(), node->InputAt(1));
-  VisitWordCompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitDeoptimizeUnless(Node* node) {
-  DeoptimizeParameters p = DeoptimizeParametersOf(node->op());
-  FlagsContinuation cont = FlagsContinuation::ForDeoptimize(
-      kEqual, p.kind(), p.reason(), p.feedback(), node->InputAt(1));
-  VisitWordCompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitTrapIf(Node* node, Runtime::FunctionId func_id) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForTrap(kNotEqual, func_id, node->InputAt(1));
-  VisitWordCompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitTrapUnless(Node* node,
-                                          Runtime::FunctionId func_id) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForTrap(kEqual, func_id, node->InputAt(1));
-  VisitWordCompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitSwitch(Node* node, const SwitchInfo& sw) {
-  Arm64OperandGenerator g(this);
-  InstructionOperand value_operand = g.UseRegister(node->InputAt(0));
-
-  // Emit either ArchTableSwitch or ArchLookupSwitch.
-  static const size_t kMaxTableSwitchValueRange = 2 << 16;
-  size_t table_space_cost = 4 + sw.value_range;
-  size_t table_time_cost = 3;
-  size_t lookup_space_cost = 3 + 2 * sw.case_count;
-  size_t lookup_time_cost = sw.case_count;
-  if (sw.case_count > 0 &&
-      table_space_cost + 3 * table_time_cost <=
-          lookup_space_cost + 3 * lookup_time_cost &&
-      sw.min_value > std::numeric_limits<int32_t>::min() &&
-      sw.value_range <= kMaxTableSwitchValueRange) {
-    InstructionOperand index_operand = value_operand;
-    if (sw.min_value) {
-      index_operand = g.TempRegister();
-      Emit(kArm64Sub32, index_operand, value_operand,
-           g.TempImmediate(sw.min_value));
-    }
-    // Generate a table lookup.
-    return EmitTableSwitch(sw, index_operand);
-  }
-
-  // Generate a sequence of conditional jumps.
-  return EmitLookupSwitch(sw, value_operand);
-}
-
-
-void InstructionSelector::VisitWord32Equal(Node* const node) {
-  Node* const user = node;
-  FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
-  Int32BinopMatcher m(user);
-  if (m.right().Is(0)) {
-    Node* const value = m.left().node();
-    if (CanCover(user, value)) {
-      switch (value->opcode()) {
-        case IrOpcode::kInt32Add:
-        case IrOpcode::kWord32And:
-          return VisitWord32Compare(this, node, &cont);
-        case IrOpcode::kInt32Sub:
-          return VisitWordCompare(this, value, kArm64Cmp32, &cont, false,
-                                  kArithmeticImm);
-        case IrOpcode::kWord32Equal: {
-          // Word32Equal(Word32Equal(x, y), 0) => Word32Compare(x, y, ne).
-          Int32BinopMatcher mequal(value);
-          node->ReplaceInput(0, mequal.left().node());
-          node->ReplaceInput(1, mequal.right().node());
-          cont.Negate();
-          // {node} still does not cover its new operands, because {mequal} is
-          // still using them.
-          // Since we won't generate any more code for {mequal}, set its
-          // operands to zero to make sure {node} can cover them.
-          // This improves pattern matching in VisitWord32Compare.
-          mequal.node()->ReplaceInput(0, m.right().node());
-          mequal.node()->ReplaceInput(1, m.right().node());
-          return VisitWord32Compare(this, node, &cont);
-        }
-        default:
-          break;
-      }
-      return VisitWord32Test(this, value, &cont);
-    }
-  }
-  VisitWord32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitInt32LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kSignedLessThan, node);
-  VisitWord32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitInt32LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kSignedLessThanOrEqual, node);
-  VisitWord32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitUint32LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kUnsignedLessThan, node);
-  VisitWord32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitUint32LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedLessThanOrEqual, node);
-  VisitWord32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitWord64Equal(Node* const node) {
-  Node* const user = node;
-  FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
-  Int64BinopMatcher m(user);
-  if (m.right().Is(0)) {
-    Node* const value = m.left().node();
-    if (CanCover(user, value)) {
-      switch (value->opcode()) {
-        case IrOpcode::kWord64And:
-          return VisitWordCompare(this, value, kArm64Tst, &cont, true,
-                                  kLogical64Imm);
-        default:
-          break;
-      }
-      return VisitWord64Test(this, value, &cont);
-    }
-  }
-  VisitWordCompare(this, node, kArm64Cmp, &cont, false, kArithmeticImm);
-}
-
-
-void InstructionSelector::VisitInt32AddWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    return VisitBinop<Int32BinopMatcher>(this, node, kArm64Add32,
-                                         kArithmeticImm, &cont);
-  }
-  FlagsContinuation cont;
-  VisitBinop<Int32BinopMatcher>(this, node, kArm64Add32, kArithmeticImm, &cont);
-}
-
-
-void InstructionSelector::VisitInt32SubWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    return VisitBinop<Int32BinopMatcher>(this, node, kArm64Sub32,
-                                         kArithmeticImm, &cont);
-  }
-  FlagsContinuation cont;
-  VisitBinop<Int32BinopMatcher>(this, node, kArm64Sub32, kArithmeticImm, &cont);
-}
-
-void InstructionSelector::VisitInt32MulWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    // ARM64 doesn't set the overflow flag for multiplication, so we need to
-    // test on kNotEqual. Here is the code sequence used:
-    //   smull result, left, right
-    //   cmp result.X(), Operand(result, SXTW)
-    FlagsContinuation cont = FlagsContinuation::ForSet(kNotEqual, ovf);
-    return EmitInt32MulWithOverflow(this, node, &cont);
-  }
-  FlagsContinuation cont;
-  EmitInt32MulWithOverflow(this, node, &cont);
-}
-
-void InstructionSelector::VisitInt64AddWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    return VisitBinop<Int64BinopMatcher>(this, node, kArm64Add, kArithmeticImm,
-                                         &cont);
-  }
-  FlagsContinuation cont;
-  VisitBinop<Int64BinopMatcher>(this, node, kArm64Add, kArithmeticImm, &cont);
-}
-
-
-void InstructionSelector::VisitInt64SubWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    return VisitBinop<Int64BinopMatcher>(this, node, kArm64Sub, kArithmeticImm,
-                                         &cont);
-  }
-  FlagsContinuation cont;
-  VisitBinop<Int64BinopMatcher>(this, node, kArm64Sub, kArithmeticImm, &cont);
-}
-
-
-void InstructionSelector::VisitInt64LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kSignedLessThan, node);
-  VisitWordCompare(this, node, kArm64Cmp, &cont, false, kArithmeticImm);
-}
-
-
-void InstructionSelector::VisitInt64LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kSignedLessThanOrEqual, node);
-  VisitWordCompare(this, node, kArm64Cmp, &cont, false, kArithmeticImm);
-}
-
-
-void InstructionSelector::VisitUint64LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kUnsignedLessThan, node);
-  VisitWordCompare(this, node, kArm64Cmp, &cont, false, kArithmeticImm);
-}
-
-
-void InstructionSelector::VisitUint64LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedLessThanOrEqual, node);
-  VisitWordCompare(this, node, kArm64Cmp, &cont, false, kArithmeticImm);
-}
-
-
-void InstructionSelector::VisitFloat32Equal(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
-  VisitFloat32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat32LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kFloatLessThan, node);
-  VisitFloat32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat32LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kFloatLessThanOrEqual, node);
-  VisitFloat32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat64Equal(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
-  VisitFloat64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat64LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kFloatLessThan, node);
-  VisitFloat64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kFloatLessThanOrEqual, node);
-  VisitFloat64Compare(this, node, &cont);
-}
-
-void InstructionSelector::VisitFloat64InsertLowWord32(Node* node) {
-  Arm64OperandGenerator g(this);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-  if (left->opcode() == IrOpcode::kFloat64InsertHighWord32 &&
-      CanCover(node, left)) {
-    Node* right_of_left = left->InputAt(1);
-    Emit(kArm64Bfi, g.DefineSameAsFirst(right), g.UseRegister(right),
-         g.UseRegister(right_of_left), g.TempImmediate(32),
-         g.TempImmediate(32));
-    Emit(kArm64Float64MoveU64, g.DefineAsRegister(node), g.UseRegister(right));
-    return;
-  }
-  Emit(kArm64Float64InsertLowWord32, g.DefineSameAsFirst(node),
-       g.UseRegister(left), g.UseRegister(right));
-}
-
-
-void InstructionSelector::VisitFloat64InsertHighWord32(Node* node) {
-  Arm64OperandGenerator g(this);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-  if (left->opcode() == IrOpcode::kFloat64InsertLowWord32 &&
-      CanCover(node, left)) {
-    Node* right_of_left = left->InputAt(1);
-    Emit(kArm64Bfi, g.DefineSameAsFirst(left), g.UseRegister(right_of_left),
-         g.UseRegister(right), g.TempImmediate(32), g.TempImmediate(32));
-    Emit(kArm64Float64MoveU64, g.DefineAsRegister(node), g.UseRegister(left));
-    return;
-  }
-  Emit(kArm64Float64InsertHighWord32, g.DefineSameAsFirst(node),
-       g.UseRegister(left), g.UseRegister(right));
-}
-
-void InstructionSelector::VisitAtomicLoad(Node* node) {
-  LoadRepresentation load_rep = LoadRepresentationOf(node->op());
-  Arm64OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  ArchOpcode opcode = kArchNop;
-  switch (load_rep.representation()) {
-    case MachineRepresentation::kWord8:
-      opcode = load_rep.IsSigned() ? kAtomicLoadInt8 : kAtomicLoadUint8;
-      break;
-    case MachineRepresentation::kWord16:
-      opcode = load_rep.IsSigned() ? kAtomicLoadInt16 : kAtomicLoadUint16;
-      break;
-    case MachineRepresentation::kWord32:
-      opcode = kAtomicLoadWord32;
-      break;
-    default:
-      UNREACHABLE();
-      return;
-  }
-  InstructionOperand inputs[] = {g.UseRegister(base), g.UseRegister(index)};
-  InstructionOperand outputs[] = {g.DefineAsRegister(node)};
-  InstructionOperand temps[] = {g.TempRegister()};
-  InstructionCode code = opcode | AddressingModeField::encode(kMode_MRR);
-  Emit(code, arraysize(outputs), outputs, arraysize(inputs), inputs,
-       arraysize(temps), temps);
-}
-
-void InstructionSelector::VisitAtomicStore(Node* node) {
-  MachineRepresentation rep = AtomicStoreRepresentationOf(node->op());
-  Arm64OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-  ArchOpcode opcode = kArchNop;
-  switch (rep) {
-    case MachineRepresentation::kWord8:
-      opcode = kAtomicStoreWord8;
-      break;
-    case MachineRepresentation::kWord16:
-      opcode = kAtomicStoreWord16;
-      break;
-    case MachineRepresentation::kWord32:
-      opcode = kAtomicStoreWord32;
-      break;
-    default:
-      UNREACHABLE();
-      return;
-  }
-
-  AddressingMode addressing_mode = kMode_MRR;
-  InstructionOperand inputs[3];
-  size_t input_count = 0;
-  inputs[input_count++] = g.UseUniqueRegister(base);
-  inputs[input_count++] = g.UseUniqueRegister(index);
-  inputs[input_count++] = g.UseUniqueRegister(value);
-  InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
-  InstructionOperand temps[] = {g.TempRegister()};
-  Emit(code, 0, nullptr, input_count, inputs, arraysize(temps), temps);
-}
-
-void InstructionSelector::VisitAtomicExchange(Node* node) {
-  Arm64OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-  ArchOpcode opcode = kArchNop;
-  MachineType type = AtomicOpRepresentationOf(node->op());
-  if (type == MachineType::Int8()) {
-    opcode = kAtomicExchangeInt8;
-  } else if (type == MachineType::Uint8()) {
-    opcode = kAtomicExchangeUint8;
-  } else if (type == MachineType::Int16()) {
-    opcode = kAtomicExchangeInt16;
-  } else if (type == MachineType::Uint16()) {
-    opcode = kAtomicExchangeUint16;
-  } else if (type == MachineType::Int32() || type == MachineType::Uint32()) {
-    opcode = kAtomicExchangeWord32;
-  } else {
-    UNREACHABLE();
-    return;
-  }
-
-  AddressingMode addressing_mode = kMode_MRR;
-  InstructionOperand inputs[3];
-  size_t input_count = 0;
-  inputs[input_count++] = g.UseRegister(base);
-  inputs[input_count++] = g.UseRegister(index);
-  inputs[input_count++] = g.UseUniqueRegister(value);
-  InstructionOperand outputs[1];
-  outputs[0] = g.DefineAsRegister(node);
-  InstructionOperand temps[] = {g.TempRegister(), g.TempRegister()};
-  InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
-  Emit(code, 1, outputs, input_count, inputs, arraysize(temps), temps);
-}
-
-void InstructionSelector::VisitAtomicCompareExchange(Node* node) {
-  Arm64OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* old_value = node->InputAt(2);
-  Node* new_value = node->InputAt(3);
-  ArchOpcode opcode = kArchNop;
-  MachineType type = AtomicOpRepresentationOf(node->op());
-  if (type == MachineType::Int8()) {
-    opcode = kAtomicCompareExchangeInt8;
-  } else if (type == MachineType::Uint8()) {
-    opcode = kAtomicCompareExchangeUint8;
-  } else if (type == MachineType::Int16()) {
-    opcode = kAtomicCompareExchangeInt16;
-  } else if (type == MachineType::Uint16()) {
-    opcode = kAtomicCompareExchangeUint16;
-  } else if (type == MachineType::Int32() || type == MachineType::Uint32()) {
-    opcode = kAtomicCompareExchangeWord32;
-  } else {
-    UNREACHABLE();
-    return;
-  }
-
-  AddressingMode addressing_mode = kMode_MRR;
-  InstructionOperand inputs[4];
-  size_t input_count = 0;
-  inputs[input_count++] = g.UseRegister(base);
-  inputs[input_count++] = g.UseRegister(index);
-  inputs[input_count++] = g.UseUniqueRegister(old_value);
-  inputs[input_count++] = g.UseUniqueRegister(new_value);
-  InstructionOperand outputs[1];
-  outputs[0] = g.DefineAsRegister(node);
-  InstructionOperand temps[] = {g.TempRegister(), g.TempRegister()};
-  InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
-  Emit(code, 1, outputs, input_count, inputs, arraysize(temps), temps);
-}
-
-void InstructionSelector::VisitAtomicBinaryOperation(
-    Node* node, ArchOpcode int8_op, ArchOpcode uint8_op, ArchOpcode int16_op,
-    ArchOpcode uint16_op, ArchOpcode word32_op) {
-  Arm64OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-  ArchOpcode opcode = kArchNop;
-  MachineType type = AtomicOpRepresentationOf(node->op());
-  if (type == MachineType::Int8()) {
-    opcode = int8_op;
-  } else if (type == MachineType::Uint8()) {
-    opcode = uint8_op;
-  } else if (type == MachineType::Int16()) {
-    opcode = int16_op;
-  } else if (type == MachineType::Uint16()) {
-    opcode = uint16_op;
-  } else if (type == MachineType::Int32() || type == MachineType::Uint32()) {
-    opcode = word32_op;
-  } else {
-    UNREACHABLE();
-    return;
-  }
-
-  AddressingMode addressing_mode = kMode_MRR;
-  InstructionOperand inputs[3];
-  size_t input_count = 0;
-  inputs[input_count++] = g.UseRegister(base);
-  inputs[input_count++] = g.UseRegister(index);
-  inputs[input_count++] = g.UseUniqueRegister(value);
-  InstructionOperand outputs[1];
-  outputs[0] = g.DefineAsRegister(node);
-  InstructionOperand temps[] = {g.TempRegister(), g.TempRegister(),
-                                g.TempRegister()};
-  InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
-  Emit(code, 1, outputs, input_count, inputs, arraysize(temps), temps);
-}
-
-#define VISIT_ATOMIC_BINOP(op)                                              \
-  void InstructionSelector::VisitAtomic##op(Node* node) {                   \
-    VisitAtomicBinaryOperation(node, kAtomic##op##Int8, kAtomic##op##Uint8, \
-                               kAtomic##op##Int16, kAtomic##op##Uint16,     \
-                               kAtomic##op##Word32);                        \
-  }
-VISIT_ATOMIC_BINOP(Add)
-VISIT_ATOMIC_BINOP(Sub)
-VISIT_ATOMIC_BINOP(And)
-VISIT_ATOMIC_BINOP(Or)
-VISIT_ATOMIC_BINOP(Xor)
-#undef VISIT_ATOMIC_BINOP
-
-void InstructionSelector::VisitInt32AbsWithOverflow(Node* node) {
-  UNREACHABLE();
-}
-
-void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) {
-  UNREACHABLE();
-}
-
-#define SIMD_TYPE_LIST(V) \
-  V(F32x4)                \
-  V(I32x4)                \
-  V(I16x8)                \
-  V(I8x16)
-
-#define SIMD_FORMAT_LIST(V) \
-  V(32x4, 4)                \
-  V(16x8, 8)                \
-  V(8x16, 16)
-
-#define SIMD_UNOP_LIST(V)                                 \
-  V(F32x4SConvertI32x4, kArm64F32x4SConvertI32x4)         \
-  V(F32x4UConvertI32x4, kArm64F32x4UConvertI32x4)         \
-  V(F32x4Abs, kArm64F32x4Abs)                             \
-  V(F32x4Neg, kArm64F32x4Neg)                             \
-  V(F32x4RecipApprox, kArm64F32x4RecipApprox)             \
-  V(F32x4RecipSqrtApprox, kArm64F32x4RecipSqrtApprox)     \
-  V(I32x4SConvertF32x4, kArm64I32x4SConvertF32x4)         \
-  V(I32x4SConvertI16x8Low, kArm64I32x4SConvertI16x8Low)   \
-  V(I32x4SConvertI16x8High, kArm64I32x4SConvertI16x8High) \
-  V(I32x4Neg, kArm64I32x4Neg)                             \
-  V(I32x4UConvertF32x4, kArm64I32x4UConvertF32x4)         \
-  V(I32x4UConvertI16x8Low, kArm64I32x4UConvertI16x8Low)   \
-  V(I32x4UConvertI16x8High, kArm64I32x4UConvertI16x8High) \
-  V(I16x8SConvertI8x16Low, kArm64I16x8SConvertI8x16Low)   \
-  V(I16x8SConvertI8x16High, kArm64I16x8SConvertI8x16High) \
-  V(I16x8Neg, kArm64I16x8Neg)                             \
-  V(I16x8UConvertI8x16Low, kArm64I16x8UConvertI8x16Low)   \
-  V(I16x8UConvertI8x16High, kArm64I16x8UConvertI8x16High) \
-  V(I8x16Neg, kArm64I8x16Neg)                             \
-  V(S128Not, kArm64S128Not)                               \
-  V(S1x4AnyTrue, kArm64S1x4AnyTrue)                       \
-  V(S1x4AllTrue, kArm64S1x4AllTrue)                       \
-  V(S1x8AnyTrue, kArm64S1x8AnyTrue)                       \
-  V(S1x8AllTrue, kArm64S1x8AllTrue)                       \
-  V(S1x16AnyTrue, kArm64S1x16AnyTrue)                     \
-  V(S1x16AllTrue, kArm64S1x16AllTrue)
-
-#define SIMD_SHIFT_OP_LIST(V) \
-  V(I32x4Shl)                 \
-  V(I32x4ShrS)                \
-  V(I32x4ShrU)                \
-  V(I16x8Shl)                 \
-  V(I16x8ShrS)                \
-  V(I16x8ShrU)                \
-  V(I8x16Shl)                 \
-  V(I8x16ShrS)                \
-  V(I8x16ShrU)
-
-#define SIMD_BINOP_LIST(V)                        \
-  V(F32x4Add, kArm64F32x4Add)                     \
-  V(F32x4AddHoriz, kArm64F32x4AddHoriz)           \
-  V(F32x4Sub, kArm64F32x4Sub)                     \
-  V(F32x4Mul, kArm64F32x4Mul)                     \
-  V(F32x4Min, kArm64F32x4Min)                     \
-  V(F32x4Max, kArm64F32x4Max)                     \
-  V(F32x4Eq, kArm64F32x4Eq)                       \
-  V(F32x4Ne, kArm64F32x4Ne)                       \
-  V(F32x4Lt, kArm64F32x4Lt)                       \
-  V(F32x4Le, kArm64F32x4Le)                       \
-  V(I32x4Add, kArm64I32x4Add)                     \
-  V(I32x4AddHoriz, kArm64I32x4AddHoriz)           \
-  V(I32x4Sub, kArm64I32x4Sub)                     \
-  V(I32x4Mul, kArm64I32x4Mul)                     \
-  V(I32x4MinS, kArm64I32x4MinS)                   \
-  V(I32x4MaxS, kArm64I32x4MaxS)                   \
-  V(I32x4Eq, kArm64I32x4Eq)                       \
-  V(I32x4Ne, kArm64I32x4Ne)                       \
-  V(I32x4GtS, kArm64I32x4GtS)                     \
-  V(I32x4GeS, kArm64I32x4GeS)                     \
-  V(I32x4MinU, kArm64I32x4MinU)                   \
-  V(I32x4MaxU, kArm64I32x4MaxU)                   \
-  V(I32x4GtU, kArm64I32x4GtU)                     \
-  V(I32x4GeU, kArm64I32x4GeU)                     \
-  V(I16x8SConvertI32x4, kArm64I16x8SConvertI32x4) \
-  V(I16x8Add, kArm64I16x8Add)                     \
-  V(I16x8AddSaturateS, kArm64I16x8AddSaturateS)   \
-  V(I16x8AddHoriz, kArm64I16x8AddHoriz)           \
-  V(I16x8Sub, kArm64I16x8Sub)                     \
-  V(I16x8SubSaturateS, kArm64I16x8SubSaturateS)   \
-  V(I16x8Mul, kArm64I16x8Mul)                     \
-  V(I16x8MinS, kArm64I16x8MinS)                   \
-  V(I16x8MaxS, kArm64I16x8MaxS)                   \
-  V(I16x8Eq, kArm64I16x8Eq)                       \
-  V(I16x8Ne, kArm64I16x8Ne)                       \
-  V(I16x8GtS, kArm64I16x8GtS)                     \
-  V(I16x8GeS, kArm64I16x8GeS)                     \
-  V(I16x8UConvertI32x4, kArm64I16x8UConvertI32x4) \
-  V(I16x8AddSaturateU, kArm64I16x8AddSaturateU)   \
-  V(I16x8SubSaturateU, kArm64I16x8SubSaturateU)   \
-  V(I16x8MinU, kArm64I16x8MinU)                   \
-  V(I16x8MaxU, kArm64I16x8MaxU)                   \
-  V(I16x8GtU, kArm64I16x8GtU)                     \
-  V(I16x8GeU, kArm64I16x8GeU)                     \
-  V(I8x16SConvertI16x8, kArm64I8x16SConvertI16x8) \
-  V(I8x16Add, kArm64I8x16Add)                     \
-  V(I8x16AddSaturateS, kArm64I8x16AddSaturateS)   \
-  V(I8x16Sub, kArm64I8x16Sub)                     \
-  V(I8x16SubSaturateS, kArm64I8x16SubSaturateS)   \
-  V(I8x16Mul, kArm64I8x16Mul)                     \
-  V(I8x16MinS, kArm64I8x16MinS)                   \
-  V(I8x16MaxS, kArm64I8x16MaxS)                   \
-  V(I8x16Eq, kArm64I8x16Eq)                       \
-  V(I8x16Ne, kArm64I8x16Ne)                       \
-  V(I8x16GtS, kArm64I8x16GtS)                     \
-  V(I8x16GeS, kArm64I8x16GeS)                     \
-  V(I8x16UConvertI16x8, kArm64I8x16UConvertI16x8) \
-  V(I8x16AddSaturateU, kArm64I8x16AddSaturateU)   \
-  V(I8x16SubSaturateU, kArm64I8x16SubSaturateU)   \
-  V(I8x16MinU, kArm64I8x16MinU)                   \
-  V(I8x16MaxU, kArm64I8x16MaxU)                   \
-  V(I8x16GtU, kArm64I8x16GtU)                     \
-  V(I8x16GeU, kArm64I8x16GeU)                     \
-  V(S128And, kArm64S128And)                       \
-  V(S128Or, kArm64S128Or)                         \
-  V(S128Xor, kArm64S128Xor)
-
-void InstructionSelector::VisitS128Zero(Node* node) {
-  Arm64OperandGenerator g(this);
-  Emit(kArm64S128Zero, g.DefineAsRegister(node), g.DefineAsRegister(node));
-}
-
-#define SIMD_VISIT_SPLAT(Type)                               \
-  void InstructionSelector::Visit##Type##Splat(Node* node) { \
-    VisitRR(this, kArm64##Type##Splat, node);                \
-  }
-SIMD_TYPE_LIST(SIMD_VISIT_SPLAT)
-#undef SIMD_VISIT_SPLAT
-
-#define SIMD_VISIT_EXTRACT_LANE(Type)                              \
-  void InstructionSelector::Visit##Type##ExtractLane(Node* node) { \
-    VisitRRI(this, kArm64##Type##ExtractLane, node);               \
-  }
-SIMD_TYPE_LIST(SIMD_VISIT_EXTRACT_LANE)
-#undef SIMD_VISIT_EXTRACT_LANE
-
-#define SIMD_VISIT_REPLACE_LANE(Type)                              \
-  void InstructionSelector::Visit##Type##ReplaceLane(Node* node) { \
-    VisitRRIR(this, kArm64##Type##ReplaceLane, node);              \
-  }
-SIMD_TYPE_LIST(SIMD_VISIT_REPLACE_LANE)
-#undef SIMD_VISIT_REPLACE_LANE
-
-#define SIMD_VISIT_UNOP(Name, instruction)            \
-  void InstructionSelector::Visit##Name(Node* node) { \
-    VisitRR(this, instruction, node);                 \
-  }
-SIMD_UNOP_LIST(SIMD_VISIT_UNOP)
-#undef SIMD_VISIT_UNOP
-
-#define SIMD_VISIT_SHIFT_OP(Name)                     \
-  void InstructionSelector::Visit##Name(Node* node) { \
-    VisitRRI(this, kArm64##Name, node);               \
-  }
-SIMD_SHIFT_OP_LIST(SIMD_VISIT_SHIFT_OP)
-#undef SIMD_VISIT_SHIFT_OP
-
-#define SIMD_VISIT_BINOP(Name, instruction)           \
-  void InstructionSelector::Visit##Name(Node* node) { \
-    VisitRRR(this, instruction, node);                \
-  }
-SIMD_BINOP_LIST(SIMD_VISIT_BINOP)
-#undef SIMD_VISIT_BINOP
-
-void InstructionSelector::VisitS128Select(Node* node) {
-  Arm64OperandGenerator g(this);
-  Emit(kArm64S128Select, g.DefineSameAsFirst(node),
-       g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)),
-       g.UseRegister(node->InputAt(2)));
-}
-
-namespace {
-
-struct ShuffleEntry {
-  uint8_t shuffle[kSimd128Size];
-  ArchOpcode opcode;
-};
-
-static const ShuffleEntry arch_shuffles[] = {
-    {{0, 1, 2, 3, 16, 17, 18, 19, 4, 5, 6, 7, 20, 21, 22, 23},
-     kArm64S32x4ZipLeft},
-    {{8, 9, 10, 11, 24, 25, 26, 27, 12, 13, 14, 15, 28, 29, 30, 31},
-     kArm64S32x4ZipRight},
-    {{0, 1, 2, 3, 8, 9, 10, 11, 16, 17, 18, 19, 24, 25, 26, 27},
-     kArm64S32x4UnzipLeft},
-    {{4, 5, 6, 7, 12, 13, 14, 15, 20, 21, 22, 23, 28, 29, 30, 31},
-     kArm64S32x4UnzipRight},
-    {{0, 1, 2, 3, 16, 17, 18, 19, 8, 9, 10, 11, 24, 25, 26, 27},
-     kArm64S32x4TransposeLeft},
-    {{4, 5, 6, 7, 20, 21, 22, 23, 12, 13, 14, 15, 21, 22, 23, 24},
-     kArm64S32x4TransposeRight},
-    {{4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15, 8, 9, 10, 11},
-     kArm64S32x2Reverse},
-
-    {{0, 1, 16, 17, 2, 3, 18, 19, 4, 5, 20, 21, 6, 7, 22, 23},
-     kArm64S16x8ZipLeft},
-    {{8, 9, 24, 25, 10, 11, 26, 27, 12, 13, 28, 29, 14, 15, 30, 31},
-     kArm64S16x8ZipRight},
-    {{0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29},
-     kArm64S16x8UnzipLeft},
-    {{2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31},
-     kArm64S16x8UnzipRight},
-    {{0, 1, 16, 17, 4, 5, 20, 21, 8, 9, 24, 25, 12, 13, 28, 29},
-     kArm64S16x8TransposeLeft},
-    {{2, 3, 18, 19, 6, 7, 22, 23, 10, 11, 26, 27, 14, 15, 30, 31},
-     kArm64S16x8TransposeRight},
-    {{6, 7, 4, 5, 2, 3, 0, 1, 14, 15, 12, 13, 10, 11, 8, 9},
-     kArm64S16x4Reverse},
-    {{2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 8, 9, 14, 15, 12, 13},
-     kArm64S16x2Reverse},
-
-    {{0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7, 23},
-     kArm64S8x16ZipLeft},
-    {{8, 24, 9, 25, 10, 26, 11, 27, 12, 28, 13, 29, 14, 30, 15, 31},
-     kArm64S8x16ZipRight},
-    {{0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30},
-     kArm64S8x16UnzipLeft},
-    {{1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31},
-     kArm64S8x16UnzipRight},
-    {{0, 16, 2, 18, 4, 20, 6, 22, 8, 24, 10, 26, 12, 28, 14, 30},
-     kArm64S8x16TransposeLeft},
-    {{1, 17, 3, 19, 5, 21, 7, 23, 9, 25, 11, 27, 13, 29, 15, 31},
-     kArm64S8x16TransposeRight},
-    {{7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8}, kArm64S8x8Reverse},
-    {{3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12}, kArm64S8x4Reverse},
-    {{1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14},
-     kArm64S8x2Reverse}};
-
-bool TryMatchArchShuffle(const uint8_t* shuffle, const ShuffleEntry* table,
-                         size_t num_entries, uint8_t mask, ArchOpcode* opcode) {
-  for (size_t i = 0; i < num_entries; i++) {
-    const ShuffleEntry& entry = table[i];
-    int j = 0;
-    for (; j < kSimd128Size; j++) {
-      if ((entry.shuffle[j] & mask) != (shuffle[j] & mask)) {
-        break;
-      }
-    }
-    if (j == kSimd128Size) {
-      *opcode = entry.opcode;
-      return true;
-    }
-  }
-  return false;
-}
-
-void ArrangeShuffleTable(Arm64OperandGenerator* g, Node* input0, Node* input1,
-                         InstructionOperand* src0, InstructionOperand* src1) {
-  if (input0 == input1) {
-    // Unary, any q-register can be the table.
-    *src0 = *src1 = g->UseRegister(input0);
-  } else {
-    // Binary, table registers must be consecutive.
-    *src0 = g->UseFixed(input0, fp_fixed2);
-    *src1 = g->UseFixed(input1, fp_fixed3);
-  }
-}
-
-}  // namespace
-
-void InstructionSelector::VisitS8x16Shuffle(Node* node) {
-  const uint8_t* shuffle = OpParameter<uint8_t*>(node);
-  uint8_t mask = CanonicalizeShuffle(node);
-  uint8_t shuffle32x4[4];
-  Arm64OperandGenerator g(this);
-  ArchOpcode opcode;
-  if (TryMatchArchShuffle(shuffle, arch_shuffles, arraysize(arch_shuffles),
-                          mask, &opcode)) {
-    VisitRRR(this, opcode, node);
-    return;
-  }
-  Node* input0 = node->InputAt(0);
-  Node* input1 = node->InputAt(1);
-  uint8_t bias;
-  if (TryMatchConcat(shuffle, mask, &bias)) {
-    Emit(kArm64S8x16Concat, g.DefineAsRegister(node), g.UseRegister(input0),
-         g.UseRegister(input1), g.UseImmediate(bias));
-    return;
-  }
-  int index = 0;
-  if (TryMatch32x4Shuffle(shuffle, shuffle32x4)) {
-    if (TryMatchDup<4>(shuffle, &index)) {
-      InstructionOperand src = index < 4 ? g.UseRegister(node->InputAt(0))
-                                         : g.UseRegister(node->InputAt(1));
-      Emit(kArm64S128Dup, g.DefineAsRegister(node), src, g.UseImmediate(4),
-           g.UseImmediate(index % 4));
-    } else {
-      Emit(kArm64S32x4Shuffle, g.DefineAsRegister(node),
-           g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)),
-           g.UseImmediate(Pack4Lanes(shuffle32x4, mask)));
-    }
-    return;
-  }
-  if (TryMatchDup<8>(shuffle, &index)) {
-    InstructionOperand src = index < 8 ? g.UseRegister(node->InputAt(0))
-                                       : g.UseRegister(node->InputAt(1));
-    Emit(kArm64S128Dup, g.DefineAsRegister(node), src, g.UseImmediate(8),
-         g.UseImmediate(index % 8));
-    return;
-  }
-  if (TryMatchDup<16>(shuffle, &index)) {
-    InstructionOperand src = index < 16 ? g.UseRegister(node->InputAt(0))
-                                        : g.UseRegister(node->InputAt(1));
-    Emit(kArm64S128Dup, g.DefineAsRegister(node), src, g.UseImmediate(16),
-         g.UseImmediate(index % 16));
-    return;
-  }
-  // Code generator uses vtbl, arrange sources to form a valid lookup table.
-  InstructionOperand src0, src1;
-  ArrangeShuffleTable(&g, input0, input1, &src0, &src1);
-  Emit(kArm64S8x16Shuffle, g.DefineAsRegister(node), src0, src1,
-       g.UseImmediate(Pack4Lanes(shuffle, mask)),
-       g.UseImmediate(Pack4Lanes(shuffle + 4, mask)),
-       g.UseImmediate(Pack4Lanes(shuffle + 8, mask)),
-       g.UseImmediate(Pack4Lanes(shuffle + 12, mask)));
-}
-
-// static
-MachineOperatorBuilder::Flags
-InstructionSelector::SupportedMachineOperatorFlags() {
-  return MachineOperatorBuilder::kFloat32RoundDown |
-         MachineOperatorBuilder::kFloat64RoundDown |
-         MachineOperatorBuilder::kFloat32RoundUp |
-         MachineOperatorBuilder::kFloat64RoundUp |
-         MachineOperatorBuilder::kFloat32RoundTruncate |
-         MachineOperatorBuilder::kFloat64RoundTruncate |
-         MachineOperatorBuilder::kFloat64RoundTiesAway |
-         MachineOperatorBuilder::kFloat32RoundTiesEven |
-         MachineOperatorBuilder::kFloat64RoundTiesEven |
-         MachineOperatorBuilder::kWord32ShiftIsSafe |
-         MachineOperatorBuilder::kInt32DivIsSafe |
-         MachineOperatorBuilder::kUint32DivIsSafe |
-         MachineOperatorBuilder::kWord32ReverseBits |
-         MachineOperatorBuilder::kWord64ReverseBits;
-}
-
-// static
-MachineOperatorBuilder::AlignmentRequirements
-InstructionSelector::AlignmentRequirements() {
-  return MachineOperatorBuilder::AlignmentRequirements::
-      FullUnalignedAccessSupport();
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/arm64/unwinding-info-writer-arm64.cc b/src/v8/src/compiler/arm64/unwinding-info-writer-arm64.cc
deleted file mode 100644
index edf9602..0000000
--- a/src/v8/src/compiler/arm64/unwinding-info-writer-arm64.cc
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/compiler/arm64/unwinding-info-writer-arm64.h"
-#include "src/compiler/instruction.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-void UnwindingInfoWriter::BeginInstructionBlock(int pc_offset,
-                                                const InstructionBlock* block) {
-  if (!enabled()) return;
-
-  block_will_exit_ = false;
-
-  DCHECK_LT(block->rpo_number().ToInt(),
-            static_cast<int>(block_initial_states_.size()));
-  const BlockInitialState* initial_state =
-      block_initial_states_[block->rpo_number().ToInt()];
-  if (initial_state) {
-    if (initial_state->saved_lr_ != saved_lr_) {
-      eh_frame_writer_.AdvanceLocation(pc_offset);
-      if (initial_state->saved_lr_) {
-        eh_frame_writer_.RecordRegisterSavedToStack(lr, kPointerSize);
-        eh_frame_writer_.RecordRegisterSavedToStack(fp, 0);
-      } else {
-        eh_frame_writer_.RecordRegisterFollowsInitialRule(lr);
-      }
-      saved_lr_ = initial_state->saved_lr_;
-    }
-  } else {
-    // The entry block always lacks an explicit initial state.
-    // The exit block may lack an explicit state, if it is only reached by
-    //   the block ending in a ret.
-    // All the other blocks must have an explicit initial state.
-    DCHECK(block->predecessors().empty() || block->successors().empty());
-  }
-}
-
-void UnwindingInfoWriter::EndInstructionBlock(const InstructionBlock* block) {
-  if (!enabled() || block_will_exit_) return;
-
-  for (const RpoNumber& successor : block->successors()) {
-    int successor_index = successor.ToInt();
-    DCHECK_LT(successor_index, static_cast<int>(block_initial_states_.size()));
-    const BlockInitialState* existing_state =
-        block_initial_states_[successor_index];
-
-    // If we already had an entry for this BB, check that the values are the
-    // same we are trying to insert.
-    if (existing_state) {
-      DCHECK_EQ(existing_state->saved_lr_, saved_lr_);
-    } else {
-      block_initial_states_[successor_index] =
-          new (zone_) BlockInitialState(saved_lr_);
-    }
-  }
-}
-
-void UnwindingInfoWriter::MarkFrameConstructed(int at_pc) {
-  if (!enabled()) return;
-
-  // Regardless of the type of frame constructed, the relevant part of the
-  // layout is always the one in the diagram:
-  //
-  // |   ....   |         higher addresses
-  // +----------+               ^
-  // |    LR    |               |            |
-  // +----------+               |            |
-  // | saved FP |               |            |
-  // +----------+ <-- FP                     v
-  // |   ....   |                       stack growth
-  //
-  // The LR is pushed on the stack, and we can record this fact at the end of
-  // the construction, since the LR itself is not modified in the process.
-  eh_frame_writer_.AdvanceLocation(at_pc);
-  eh_frame_writer_.RecordRegisterSavedToStack(lr, kPointerSize);
-  eh_frame_writer_.RecordRegisterSavedToStack(fp, 0);
-  saved_lr_ = true;
-}
-
-void UnwindingInfoWriter::MarkFrameDeconstructed(int at_pc) {
-  if (!enabled()) return;
-
-  // The lr is restored by the last operation in LeaveFrame().
-  eh_frame_writer_.AdvanceLocation(at_pc);
-  eh_frame_writer_.RecordRegisterFollowsInitialRule(lr);
-  saved_lr_ = false;
-}
-
-void UnwindingInfoWriter::MarkLinkRegisterOnTopOfStack(int pc_offset,
-                                                       const Register& sp) {
-  if (!enabled()) return;
-
-  eh_frame_writer_.AdvanceLocation(pc_offset);
-  eh_frame_writer_.SetBaseAddressRegisterAndOffset(sp, 0);
-  eh_frame_writer_.RecordRegisterSavedToStack(lr, 0);
-}
-
-void UnwindingInfoWriter::MarkPopLinkRegisterFromTopOfStack(int pc_offset) {
-  if (!enabled()) return;
-
-  eh_frame_writer_.AdvanceLocation(pc_offset);
-  eh_frame_writer_.SetBaseAddressRegisterAndOffset(fp, 0);
-  eh_frame_writer_.RecordRegisterFollowsInitialRule(lr);
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/arm64/unwinding-info-writer-arm64.h b/src/v8/src/compiler/arm64/unwinding-info-writer-arm64.h
deleted file mode 100644
index a532851..0000000
--- a/src/v8/src/compiler/arm64/unwinding-info-writer-arm64.h
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_ARM64_UNWINDING_INFO_WRITER_H_
-#define V8_COMPILER_ARM64_UNWINDING_INFO_WRITER_H_
-
-#include "src/eh-frame.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-class InstructionBlock;
-
-class UnwindingInfoWriter {
- public:
-  explicit UnwindingInfoWriter(Zone* zone)
-      : zone_(zone),
-        eh_frame_writer_(zone),
-        saved_lr_(false),
-        block_will_exit_(false),
-        block_initial_states_(zone) {
-    if (enabled()) eh_frame_writer_.Initialize();
-  }
-
-  void SetNumberOfInstructionBlocks(int number) {
-    if (enabled()) block_initial_states_.resize(number);
-  }
-
-  void BeginInstructionBlock(int pc_offset, const InstructionBlock* block);
-  void EndInstructionBlock(const InstructionBlock* block);
-
-  void MarkLinkRegisterOnTopOfStack(int pc_offset, const Register& sp);
-  void MarkPopLinkRegisterFromTopOfStack(int pc_offset);
-
-  void MarkFrameConstructed(int at_pc);
-  void MarkFrameDeconstructed(int at_pc);
-
-  void MarkBlockWillExit() { block_will_exit_ = true; }
-
-  void Finish(int code_size) {
-    if (enabled()) eh_frame_writer_.Finish(code_size);
-  }
-
-  EhFrameWriter* eh_frame_writer() {
-    return enabled() ? &eh_frame_writer_ : nullptr;
-  }
-
- private:
-  bool enabled() const { return FLAG_perf_prof_unwinding_info; }
-
-  class BlockInitialState : public ZoneObject {
-   public:
-    explicit BlockInitialState(bool saved_lr) : saved_lr_(saved_lr) {}
-
-    bool saved_lr_;
-  };
-
-  Zone* zone_;
-  EhFrameWriter eh_frame_writer_;
-  bool saved_lr_;
-  bool block_will_exit_;
-
-  ZoneVector<const BlockInitialState*> block_initial_states_;
-};
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif
diff --git a/src/v8/src/compiler/code-generator-impl.h b/src/v8/src/compiler/code-generator-impl.h
deleted file mode 100644
index c6d3174..0000000
--- a/src/v8/src/compiler/code-generator-impl.h
+++ /dev/null
@@ -1,222 +0,0 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_CODE_GENERATOR_IMPL_H_
-#define V8_COMPILER_CODE_GENERATOR_IMPL_H_
-
-#include "src/code-stubs.h"
-#include "src/compiler/code-generator.h"
-#include "src/compiler/instruction.h"
-#include "src/compiler/linkage.h"
-#include "src/compiler/opcodes.h"
-#include "src/macro-assembler.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-// Converts InstructionOperands from a given instruction to
-// architecture-specific
-// registers and operands after they have been assigned by the register
-// allocator.
-class InstructionOperandConverter {
- public:
-  InstructionOperandConverter(CodeGenerator* gen, Instruction* instr)
-      : gen_(gen), instr_(instr) {}
-
-  // -- Instruction operand accesses with conversions --------------------------
-
-  Register InputRegister(size_t index) {
-    return ToRegister(instr_->InputAt(index));
-  }
-
-  FloatRegister InputFloatRegister(size_t index) {
-    return ToFloatRegister(instr_->InputAt(index));
-  }
-
-  DoubleRegister InputDoubleRegister(size_t index) {
-    return ToDoubleRegister(instr_->InputAt(index));
-  }
-
-  Simd128Register InputSimd128Register(size_t index) {
-    return ToSimd128Register(instr_->InputAt(index));
-  }
-
-  double InputDouble(size_t index) { return ToDouble(instr_->InputAt(index)); }
-
-  float InputFloat32(size_t index) { return ToFloat32(instr_->InputAt(index)); }
-
-  int32_t InputInt32(size_t index) {
-    return ToConstant(instr_->InputAt(index)).ToInt32();
-  }
-
-  uint32_t InputUint32(size_t index) {
-    return bit_cast<uint32_t>(InputInt32(index));
-  }
-
-  int64_t InputInt64(size_t index) {
-    return ToConstant(instr_->InputAt(index)).ToInt64();
-  }
-
-  int8_t InputInt8(size_t index) {
-    return static_cast<int8_t>(InputInt32(index));
-  }
-
-  int16_t InputInt16(size_t index) {
-    return static_cast<int16_t>(InputInt32(index));
-  }
-
-  uint8_t InputInt3(size_t index) {
-    return static_cast<uint8_t>(InputInt32(index) & 0x7);
-  }
-
-  uint8_t InputInt4(size_t index) {
-    return static_cast<uint8_t>(InputInt32(index) & 0xF);
-  }
-
-  uint8_t InputInt5(size_t index) {
-    return static_cast<uint8_t>(InputInt32(index) & 0x1F);
-  }
-
-  uint8_t InputInt6(size_t index) {
-    return static_cast<uint8_t>(InputInt32(index) & 0x3F);
-  }
-
-  ExternalReference InputExternalReference(size_t index) {
-    return ToExternalReference(instr_->InputAt(index));
-  }
-
-  Handle<Code> InputCode(size_t index) {
-    return ToCode(instr_->InputAt(index));
-  }
-
-  Label* InputLabel(size_t index) { return ToLabel(instr_->InputAt(index)); }
-
-  RpoNumber InputRpo(size_t index) {
-    return ToRpoNumber(instr_->InputAt(index));
-  }
-
-  Register OutputRegister(size_t index = 0) {
-    return ToRegister(instr_->OutputAt(index));
-  }
-
-  Register TempRegister(size_t index) {
-    return ToRegister(instr_->TempAt(index));
-  }
-
-  FloatRegister OutputFloatRegister() {
-    return ToFloatRegister(instr_->Output());
-  }
-
-  DoubleRegister OutputDoubleRegister() {
-    return ToDoubleRegister(instr_->Output());
-  }
-
-  Simd128Register OutputSimd128Register() {
-    return ToSimd128Register(instr_->Output());
-  }
-
-  // -- Conversions for operands -----------------------------------------------
-
-  Label* ToLabel(InstructionOperand* op) {
-    return gen_->GetLabel(ToRpoNumber(op));
-  }
-
-  RpoNumber ToRpoNumber(InstructionOperand* op) {
-    return ToConstant(op).ToRpoNumber();
-  }
-
-  Register ToRegister(InstructionOperand* op) {
-    return LocationOperand::cast(op)->GetRegister();
-  }
-
-  FloatRegister ToFloatRegister(InstructionOperand* op) {
-    return LocationOperand::cast(op)->GetFloatRegister();
-  }
-
-  DoubleRegister ToDoubleRegister(InstructionOperand* op) {
-    return LocationOperand::cast(op)->GetDoubleRegister();
-  }
-
-  Simd128Register ToSimd128Register(InstructionOperand* op) {
-    return LocationOperand::cast(op)->GetSimd128Register();
-  }
-
-  Constant ToConstant(InstructionOperand* op) {
-    if (op->IsImmediate()) {
-      return gen_->code()->GetImmediate(ImmediateOperand::cast(op));
-    }
-    return gen_->code()->GetConstant(
-        ConstantOperand::cast(op)->virtual_register());
-  }
-
-  double ToDouble(InstructionOperand* op) {
-    return ToConstant(op).ToFloat64().value();
-  }
-
-  float ToFloat32(InstructionOperand* op) { return ToConstant(op).ToFloat32(); }
-
-  ExternalReference ToExternalReference(InstructionOperand* op) {
-    return ToConstant(op).ToExternalReference();
-  }
-
-  Handle<Code> ToCode(InstructionOperand* op) {
-    return ToConstant(op).ToCode();
-  }
-
-  const Frame* frame() const { return gen_->frame(); }
-  FrameAccessState* frame_access_state() const {
-    return gen_->frame_access_state();
-  }
-  Isolate* isolate() const { return gen_->isolate(); }
-  Linkage* linkage() const { return gen_->linkage(); }
-
- protected:
-  CodeGenerator* gen_;
-  Instruction* instr_;
-};
-
-// Eager deoptimization exit.
-class DeoptimizationExit : public ZoneObject {
- public:
-  explicit DeoptimizationExit(int deoptimization_id, SourcePosition pos)
-      : deoptimization_id_(deoptimization_id), pos_(pos) {}
-
-  int deoptimization_id() const { return deoptimization_id_; }
-  Label* label() { return &label_; }
-  SourcePosition pos() const { return pos_; }
-
- private:
-  int const deoptimization_id_;
-  Label label_;
-  SourcePosition const pos_;
-};
-
-// Generator for out-of-line code that is emitted after the main code is done.
-class OutOfLineCode : public ZoneObject {
- public:
-  explicit OutOfLineCode(CodeGenerator* gen);
-  virtual ~OutOfLineCode();
-
-  virtual void Generate() = 0;
-
-  Label* entry() { return &entry_; }
-  Label* exit() { return &exit_; }
-  const Frame* frame() const { return frame_; }
-  TurboAssembler* tasm() { return tasm_; }
-  OutOfLineCode* next() const { return next_; }
-
- private:
-  Label entry_;
-  Label exit_;
-  const Frame* const frame_;
-  TurboAssembler* const tasm_;
-  OutOfLineCode* const next_;
-};
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_COMPILER_CODE_GENERATOR_IMPL_H
diff --git a/src/v8/src/compiler/code-generator.cc b/src/v8/src/compiler/code-generator.cc
deleted file mode 100644
index 0fb38e5..0000000
--- a/src/v8/src/compiler/code-generator.cc
+++ /dev/null
@@ -1,1094 +0,0 @@
-// Copyright 2013 the V8 project 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 "src/compiler/code-generator.h"
-
-#include "src/address-map.h"
-#include "src/assembler-inl.h"
-#include "src/base/adapters.h"
-#include "src/compilation-info.h"
-#include "src/compiler/code-generator-impl.h"
-#include "src/compiler/linkage.h"
-#include "src/compiler/pipeline.h"
-#include "src/eh-frame.h"
-#include "src/frames.h"
-#include "src/macro-assembler-inl.h"
-#include "src/trap-handler/trap-handler.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-class CodeGenerator::JumpTable final : public ZoneObject {
- public:
-  JumpTable(JumpTable* next, Label** targets, size_t target_count)
-      : next_(next), targets_(targets), target_count_(target_count) {}
-
-  Label* label() { return &label_; }
-  JumpTable* next() const { return next_; }
-  Label** targets() const { return targets_; }
-  size_t target_count() const { return target_count_; }
-
- private:
-  Label label_;
-  JumpTable* const next_;
-  Label** const targets_;
-  size_t const target_count_;
-};
-
-CodeGenerator::CodeGenerator(
-    Zone* codegen_zone, Frame* frame, Linkage* linkage,
-    InstructionSequence* code, CompilationInfo* info, Isolate* isolate,
-    base::Optional<OsrHelper> osr_helper, int start_source_position,
-    JumpOptimizationInfo* jump_opt,
-    std::vector<trap_handler::ProtectedInstructionData>* protected_instructions)
-    : zone_(codegen_zone),
-      isolate_(isolate),
-      frame_access_state_(nullptr),
-      linkage_(linkage),
-      code_(code),
-      unwinding_info_writer_(zone()),
-      info_(info),
-      labels_(zone()->NewArray<Label>(code->InstructionBlockCount())),
-      current_block_(RpoNumber::Invalid()),
-      start_source_position_(start_source_position),
-      current_source_position_(SourcePosition::Unknown()),
-      tasm_(isolate, nullptr, 0, CodeObjectRequired::kNo),
-      resolver_(this),
-      safepoints_(zone()),
-      handlers_(zone()),
-      deoptimization_exits_(zone()),
-      deoptimization_states_(zone()),
-      deoptimization_literals_(zone()),
-      inlined_function_count_(0),
-      translations_(zone()),
-      last_lazy_deopt_pc_(0),
-      caller_registers_saved_(false),
-      jump_tables_(nullptr),
-      ools_(nullptr),
-      osr_helper_(osr_helper),
-      osr_pc_offset_(-1),
-      optimized_out_literal_id_(-1),
-      source_position_table_builder_(info->SourcePositionRecordingMode()),
-      protected_instructions_(protected_instructions),
-      result_(kSuccess) {
-  for (int i = 0; i < code->InstructionBlockCount(); ++i) {
-    new (&labels_[i]) Label;
-  }
-  CreateFrameAccessState(frame);
-  CHECK_EQ(info->is_osr(), osr_helper_.has_value());
-  tasm_.set_jump_optimization_info(jump_opt);
-  Code::Kind code_kind = info_->code_kind();
-  if (code_kind == Code::JS_TO_WASM_FUNCTION ||
-      code_kind == Code::WASM_FUNCTION) {
-    tasm_.enable_serializer();
-  }
-}
-
-void CodeGenerator::AddProtectedInstructionLanding(uint32_t instr_offset,
-                                                   uint32_t landing_offset) {
-  if (protected_instructions_ != nullptr) {
-    trap_handler::ProtectedInstructionData data = {instr_offset,
-                                                   landing_offset};
-    protected_instructions_->emplace_back(data);
-  }
-}
-
-void CodeGenerator::CreateFrameAccessState(Frame* frame) {
-  FinishFrame(frame);
-  frame_access_state_ = new (zone()) FrameAccessState(frame);
-}
-
-CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall(
-    int deoptimization_id, SourcePosition pos) {
-  DeoptimizeKind deopt_kind = GetDeoptimizationKind(deoptimization_id);
-  Deoptimizer::BailoutType bailout_type;
-  switch (deopt_kind) {
-    case DeoptimizeKind::kSoft: {
-      bailout_type = Deoptimizer::SOFT;
-      break;
-    }
-    case DeoptimizeKind::kEager: {
-      bailout_type = Deoptimizer::EAGER;
-      break;
-    }
-    case DeoptimizeKind::kLazy: {
-      bailout_type = Deoptimizer::LAZY;
-      break;
-    }
-    default: { UNREACHABLE(); }
-  }
-  DeoptimizeReason deoptimization_reason =
-      GetDeoptimizationReason(deoptimization_id);
-  Address deopt_entry = Deoptimizer::GetDeoptimizationEntry(
-      tasm()->isolate(), deoptimization_id, bailout_type);
-  if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts;
-  if (info()->is_source_positions_enabled()) {
-    tasm()->RecordDeoptReason(deoptimization_reason, pos, deoptimization_id);
-  }
-  tasm()->CallForDeoptimization(deopt_entry, RelocInfo::RUNTIME_ENTRY);
-  return kSuccess;
-}
-
-void CodeGenerator::AssembleCode() {
-  CompilationInfo* info = this->info();
-
-  // Open a frame scope to indicate that there is a frame on the stack.  The
-  // MANUAL indicates that the scope shouldn't actually generate code to set up
-  // the frame (that is done in AssemblePrologue).
-  FrameScope frame_scope(tasm(), StackFrame::MANUAL);
-
-  if (info->is_source_positions_enabled()) {
-    AssembleSourcePosition(start_source_position());
-  }
-
-  // Place function entry hook if requested to do so.
-  if (linkage()->GetIncomingDescriptor()->IsJSFunctionCall()) {
-    ProfileEntryHookStub::MaybeCallEntryHookDelayed(tasm(), zone());
-  }
-
-  // TODO(jupvfranco): This should be the first thing in the code,
-  // or otherwise MaybeCallEntryHookDelayed may happen twice (for
-  // optimized and deoptimized code).
-  // We want to bailout only from JS functions, which are the only ones
-  // that are optimized.
-  if (info->IsOptimizing()) {
-    DCHECK(linkage()->GetIncomingDescriptor()->IsJSFunctionCall());
-    BailoutIfDeoptimized();
-  }
-
-  // Define deoptimization literals for all inlined functions.
-  DCHECK_EQ(0u, deoptimization_literals_.size());
-  for (CompilationInfo::InlinedFunctionHolder& inlined :
-       info->inlined_functions()) {
-    if (!inlined.shared_info.equals(info->shared_info())) {
-      int index = DefineDeoptimizationLiteral(
-          DeoptimizationLiteral(inlined.shared_info));
-      inlined.RegisterInlinedFunctionId(index);
-    }
-  }
-  inlined_function_count_ = deoptimization_literals_.size();
-
-  unwinding_info_writer_.SetNumberOfInstructionBlocks(
-      code()->InstructionBlockCount());
-
-  // Assemble all non-deferred blocks, followed by deferred ones.
-  for (int deferred = 0; deferred < 2; ++deferred) {
-    for (const InstructionBlock* block : code()->instruction_blocks()) {
-      if (block->IsDeferred() == (deferred == 0)) {
-        continue;
-      }
-
-      // Align loop headers on 16-byte boundaries.
-      if (block->IsLoopHeader() && !tasm()->jump_optimization_info()) {
-        tasm()->Align(16);
-      }
-      // Bind a label for a block.
-      current_block_ = block->rpo_number();
-      unwinding_info_writer_.BeginInstructionBlock(tasm()->pc_offset(), block);
-      if (FLAG_code_comments) {
-        // TODO(titzer): these code comments are a giant memory leak.
-        Vector<char> buffer = Vector<char>::New(200);
-        char* buffer_start = buffer.start();
-
-        int next = SNPrintF(
-            buffer, "-- B%d start%s%s%s%s", block->rpo_number().ToInt(),
-            block->IsDeferred() ? " (deferred)" : "",
-            block->needs_frame() ? "" : " (no frame)",
-            block->must_construct_frame() ? " (construct frame)" : "",
-            block->must_deconstruct_frame() ? " (deconstruct frame)" : "");
-
-        buffer = buffer.SubVector(next, buffer.length());
-
-        if (block->IsLoopHeader()) {
-          next =
-              SNPrintF(buffer, " (loop up to %d)", block->loop_end().ToInt());
-          buffer = buffer.SubVector(next, buffer.length());
-        }
-        if (block->loop_header().IsValid()) {
-          next =
-              SNPrintF(buffer, " (in loop %d)", block->loop_header().ToInt());
-          buffer = buffer.SubVector(next, buffer.length());
-        }
-        SNPrintF(buffer, " --");
-        tasm()->RecordComment(buffer_start);
-      }
-
-      frame_access_state()->MarkHasFrame(block->needs_frame());
-
-      tasm()->bind(GetLabel(current_block_));
-      if (block->must_construct_frame()) {
-        AssembleConstructFrame();
-        // We need to setup the root register after we assemble the prologue, to
-        // avoid clobbering callee saved registers in case of C linkage and
-        // using the roots.
-        // TODO(mtrofin): investigate how we can avoid doing this repeatedly.
-        if (linkage()->GetIncomingDescriptor()->InitializeRootRegister()) {
-          tasm()->InitializeRootRegister();
-        }
-      }
-
-      if (FLAG_enable_embedded_constant_pool && !block->needs_frame()) {
-        ConstantPoolUnavailableScope constant_pool_unavailable(tasm());
-        result_ = AssembleBlock(block);
-      } else {
-        result_ = AssembleBlock(block);
-      }
-      if (result_ != kSuccess) return;
-      unwinding_info_writer_.EndInstructionBlock(block);
-    }
-  }
-
-  // Assemble all out-of-line code.
-  if (ools_) {
-    tasm()->RecordComment("-- Out of line code --");
-    for (OutOfLineCode* ool = ools_; ool; ool = ool->next()) {
-      tasm()->bind(ool->entry());
-      ool->Generate();
-      if (ool->exit()->is_bound()) tasm()->jmp(ool->exit());
-    }
-  }
-
-  // This nop operation is needed to ensure that the trampoline is not
-  // confused with the pc of the call before deoptimization.
-  // The test regress/regress-259 is an example of where we need it.
-  tasm()->nop();
-
-  // Assemble deoptimization exits.
-  int last_updated = 0;
-  for (DeoptimizationExit* exit : deoptimization_exits_) {
-    tasm()->bind(exit->label());
-    int trampoline_pc = tasm()->pc_offset();
-    int deoptimization_id = exit->deoptimization_id();
-    DeoptimizationState* ds = deoptimization_states_[deoptimization_id];
-
-    if (ds->kind() == DeoptimizeKind::kLazy) {
-      last_updated = safepoints()->UpdateDeoptimizationInfo(
-          ds->pc_offset(), trampoline_pc, last_updated);
-    }
-    AssembleDeoptimizerCall(deoptimization_id, exit->pos());
-  }
-
-  FinishCode();
-
-  // Emit the jump tables.
-  if (jump_tables_) {
-    tasm()->Align(kPointerSize);
-    for (JumpTable* table = jump_tables_; table; table = table->next()) {
-      tasm()->bind(table->label());
-      AssembleJumpTable(table->targets(), table->target_count());
-    }
-  }
-
-  // The PerfJitLogger logs code up until here, excluding the safepoint
-  // table. Resolve the unwinding info now so it is aware of the same code size
-  // as reported by perf.
-  unwinding_info_writer_.Finish(tasm()->pc_offset());
-
-  safepoints()->Emit(tasm(), frame()->GetTotalFrameSlotCount());
-  result_ = kSuccess;
-}
-
-Handle<ByteArray> CodeGenerator::GetSourcePositionTable() {
-  return source_position_table_builder_.ToSourcePositionTable(isolate());
-}
-
-MaybeHandle<HandlerTable> CodeGenerator::GetHandlerTable() const {
-  if (!handlers_.empty()) {
-    Handle<HandlerTable> table =
-        Handle<HandlerTable>::cast(isolate()->factory()->NewFixedArray(
-            HandlerTable::LengthForReturn(static_cast<int>(handlers_.size())),
-            TENURED));
-    for (size_t i = 0; i < handlers_.size(); ++i) {
-      table->SetReturnOffset(static_cast<int>(i), handlers_[i].pc_offset);
-      table->SetReturnHandler(static_cast<int>(i), handlers_[i].handler->pos());
-    }
-    return table;
-  }
-  return {};
-}
-
-Handle<Code> CodeGenerator::FinalizeCode() {
-  if (result_ != kSuccess) {
-    tasm()->AbortedCodeGeneration();
-    return Handle<Code>();
-  }
-
-  // Allocate exception handler table.
-  Handle<HandlerTable> table = HandlerTable::Empty(isolate());
-  if (!handlers_.empty()) {
-    table = Handle<HandlerTable>::cast(isolate()->factory()->NewFixedArray(
-        HandlerTable::LengthForReturn(static_cast<int>(handlers_.size())),
-        TENURED));
-    for (size_t i = 0; i < handlers_.size(); ++i) {
-      table->SetReturnOffset(static_cast<int>(i), handlers_[i].pc_offset);
-      table->SetReturnHandler(static_cast<int>(i), handlers_[i].handler->pos());
-    }
-  }
-
-  // Allocate the source position table.
-  Handle<ByteArray> source_positions =
-      source_position_table_builder_.ToSourcePositionTable(isolate());
-
-  // Allocate deoptimization data.
-  Handle<DeoptimizationData> deopt_data = GenerateDeoptimizationData();
-
-  // Allocate and install the code.
-  CodeDesc desc;
-  tasm()->GetCode(isolate(), &desc);
-  if (unwinding_info_writer_.eh_frame_writer()) {
-    unwinding_info_writer_.eh_frame_writer()->GetEhFrame(&desc);
-  }
-
-  Handle<Code> result = isolate()->factory()->NewCode(
-      desc, info()->code_kind(), Handle<Object>(), info()->builtin_index(),
-      table, source_positions, deopt_data, kMovable, info()->stub_key(), true,
-      frame()->GetTotalFrameSlotCount(), safepoints()->GetCodeOffset());
-  isolate()->counters()->total_compiled_code_size()->Increment(
-      result->instruction_size());
-
-  LOG_CODE_EVENT(isolate(),
-                 CodeLinePosInfoRecordEvent(result->instruction_start(),
-                                            *source_positions));
-
-  return result;
-}
-
-
-bool CodeGenerator::IsNextInAssemblyOrder(RpoNumber block) const {
-  return code()
-      ->InstructionBlockAt(current_block_)
-      ->ao_number()
-      .IsNext(code()->InstructionBlockAt(block)->ao_number());
-}
-
-
-void CodeGenerator::RecordSafepoint(ReferenceMap* references,
-                                    Safepoint::Kind kind, int arguments,
-                                    Safepoint::DeoptMode deopt_mode) {
-  Safepoint safepoint =
-      safepoints()->DefineSafepoint(tasm(), kind, arguments, deopt_mode);
-  int stackSlotToSpillSlotDelta =
-      frame()->GetTotalFrameSlotCount() - frame()->GetSpillSlotCount();
-  for (const InstructionOperand& operand : references->reference_operands()) {
-    if (operand.IsStackSlot()) {
-      int index = LocationOperand::cast(operand).index();
-      DCHECK_LE(0, index);
-      // We might index values in the fixed part of the frame (i.e. the
-      // closure pointer or the context pointer); these are not spill slots
-      // and therefore don't work with the SafepointTable currently, but
-      // we also don't need to worry about them, since the GC has special
-      // knowledge about those fields anyway.
-      if (index < stackSlotToSpillSlotDelta) continue;
-      safepoint.DefinePointerSlot(index, zone());
-    } else if (operand.IsRegister() && (kind & Safepoint::kWithRegisters)) {
-      Register reg = LocationOperand::cast(operand).GetRegister();
-      safepoint.DefinePointerRegister(reg, zone());
-    }
-  }
-}
-
-bool CodeGenerator::IsMaterializableFromRoot(
-    Handle<HeapObject> object, Heap::RootListIndex* index_return) {
-  const CallDescriptor* incoming_descriptor =
-      linkage()->GetIncomingDescriptor();
-  if (incoming_descriptor->flags() & CallDescriptor::kCanUseRoots) {
-    Heap* heap = isolate()->heap();
-    return heap->IsRootHandle(object, index_return) &&
-           !heap->RootCanBeWrittenAfterInitialization(*index_return);
-  }
-  return false;
-}
-
-CodeGenerator::CodeGenResult CodeGenerator::AssembleBlock(
-    const InstructionBlock* block) {
-  for (int i = block->code_start(); i < block->code_end(); ++i) {
-    Instruction* instr = code()->InstructionAt(i);
-    CodeGenResult result = AssembleInstruction(instr, block);
-    if (result != kSuccess) return result;
-  }
-  return kSuccess;
-}
-
-bool CodeGenerator::IsValidPush(InstructionOperand source,
-                                CodeGenerator::PushTypeFlags push_type) {
-  if (source.IsImmediate() &&
-      ((push_type & CodeGenerator::kImmediatePush) != 0)) {
-    return true;
-  }
-  if (source.IsRegister() &&
-      ((push_type & CodeGenerator::kRegisterPush) != 0)) {
-    return true;
-  }
-  if (source.IsStackSlot() &&
-      ((push_type & CodeGenerator::kStackSlotPush) != 0)) {
-    return true;
-  }
-  return false;
-}
-
-void CodeGenerator::GetPushCompatibleMoves(Instruction* instr,
-                                           PushTypeFlags push_type,
-                                           ZoneVector<MoveOperands*>* pushes) {
-  pushes->clear();
-  for (int i = Instruction::FIRST_GAP_POSITION;
-       i <= Instruction::LAST_GAP_POSITION; ++i) {
-    Instruction::GapPosition inner_pos =
-        static_cast<Instruction::GapPosition>(i);
-    ParallelMove* parallel_move = instr->GetParallelMove(inner_pos);
-    if (parallel_move != nullptr) {
-      for (auto move : *parallel_move) {
-        InstructionOperand source = move->source();
-        InstructionOperand destination = move->destination();
-        int first_push_compatible_index =
-            V8_TARGET_ARCH_STORES_RETURN_ADDRESS_ON_STACK ? 1 : 0;
-        // If there are any moves from slots that will be overridden by pushes,
-        // then the full gap resolver must be used since optimization with
-        // pushes don't participate in the parallel move and might clobber
-        // values needed for the gap resolve.
-        if (source.IsStackSlot() &&
-            LocationOperand::cast(source).index() >=
-                first_push_compatible_index) {
-          pushes->clear();
-          return;
-        }
-        // TODO(danno): Right now, only consider moves from the FIRST gap for
-        // pushes. Theoretically, we could extract pushes for both gaps (there
-        // are cases where this happens), but the logic for that would also have
-        // to check to make sure that non-memory inputs to the pushes from the
-        // LAST gap don't get clobbered in the FIRST gap.
-        if (i == Instruction::FIRST_GAP_POSITION) {
-          if (destination.IsStackSlot() &&
-              LocationOperand::cast(destination).index() >=
-                  first_push_compatible_index) {
-            int index = LocationOperand::cast(destination).index();
-            if (IsValidPush(source, push_type)) {
-              if (index >= static_cast<int>(pushes->size())) {
-                pushes->resize(index + 1);
-              }
-              (*pushes)[index] = move;
-            }
-          }
-        }
-      }
-    }
-  }
-
-  // For now, only support a set of continuous pushes at the end of the list.
-  size_t push_count_upper_bound = pushes->size();
-  size_t push_begin = push_count_upper_bound;
-  for (auto move : base::Reversed(*pushes)) {
-    if (move == nullptr) break;
-    push_begin--;
-  }
-  size_t push_count = pushes->size() - push_begin;
-  std::copy(pushes->begin() + push_begin,
-            pushes->begin() + push_begin + push_count, pushes->begin());
-  pushes->resize(push_count);
-}
-
-CodeGenerator::CodeGenResult CodeGenerator::AssembleInstruction(
-    Instruction* instr, const InstructionBlock* block) {
-  int first_unused_stack_slot;
-  FlagsMode mode = FlagsModeField::decode(instr->opcode());
-  if (mode != kFlags_trap) {
-    AssembleSourcePosition(instr);
-  }
-  bool adjust_stack =
-      GetSlotAboveSPBeforeTailCall(instr, &first_unused_stack_slot);
-  if (adjust_stack) AssembleTailCallBeforeGap(instr, first_unused_stack_slot);
-  AssembleGaps(instr);
-  if (adjust_stack) AssembleTailCallAfterGap(instr, first_unused_stack_slot);
-  DCHECK_IMPLIES(
-      block->must_deconstruct_frame(),
-      instr != code()->InstructionAt(block->last_instruction_index()) ||
-          instr->IsRet() || instr->IsJump());
-  if (instr->IsJump() && block->must_deconstruct_frame()) {
-    AssembleDeconstructFrame();
-  }
-  // Assemble architecture-specific code for the instruction.
-  CodeGenResult result = AssembleArchInstruction(instr);
-  if (result != kSuccess) return result;
-
-  FlagsCondition condition = FlagsConditionField::decode(instr->opcode());
-  switch (mode) {
-    case kFlags_branch: {
-      // Assemble a branch after this instruction.
-      InstructionOperandConverter i(this, instr);
-      RpoNumber true_rpo = i.InputRpo(instr->InputCount() - 2);
-      RpoNumber false_rpo = i.InputRpo(instr->InputCount() - 1);
-
-      if (true_rpo == false_rpo) {
-        // redundant branch.
-        if (!IsNextInAssemblyOrder(true_rpo)) {
-          AssembleArchJump(true_rpo);
-        }
-        return kSuccess;
-      }
-      if (IsNextInAssemblyOrder(true_rpo)) {
-        // true block is next, can fall through if condition negated.
-        std::swap(true_rpo, false_rpo);
-        condition = NegateFlagsCondition(condition);
-      }
-      BranchInfo branch;
-      branch.condition = condition;
-      branch.true_label = GetLabel(true_rpo);
-      branch.false_label = GetLabel(false_rpo);
-      branch.fallthru = IsNextInAssemblyOrder(false_rpo);
-      // Assemble architecture-specific branch.
-      AssembleArchBranch(instr, &branch);
-      break;
-    }
-    case kFlags_deoptimize: {
-      // Assemble a conditional eager deoptimization after this instruction.
-      InstructionOperandConverter i(this, instr);
-      size_t frame_state_offset = MiscField::decode(instr->opcode());
-      DeoptimizationExit* const exit =
-          AddDeoptimizationExit(instr, frame_state_offset);
-      Label continue_label;
-      BranchInfo branch;
-      branch.condition = condition;
-      branch.true_label = exit->label();
-      branch.false_label = &continue_label;
-      branch.fallthru = true;
-      // Assemble architecture-specific branch.
-      AssembleArchDeoptBranch(instr, &branch);
-      tasm()->bind(&continue_label);
-      break;
-    }
-    case kFlags_set: {
-      // Assemble a boolean materialization after this instruction.
-      AssembleArchBoolean(instr, condition);
-      break;
-    }
-    case kFlags_trap: {
-      AssembleArchTrap(instr, condition);
-      break;
-    }
-    case kFlags_none: {
-      break;
-    }
-  }
-  return kSuccess;
-}
-
-void CodeGenerator::AssembleSourcePosition(Instruction* instr) {
-  SourcePosition source_position = SourcePosition::Unknown();
-  if (instr->IsNop() && instr->AreMovesRedundant()) return;
-  if (!code()->GetSourcePosition(instr, &source_position)) return;
-  AssembleSourcePosition(source_position);
-}
-
-void CodeGenerator::AssembleSourcePosition(SourcePosition source_position) {
-  if (source_position == current_source_position_) return;
-  current_source_position_ = source_position;
-  if (!source_position.IsKnown()) return;
-  source_position_table_builder_.AddPosition(tasm()->pc_offset(),
-                                             source_position, false);
-  if (FLAG_code_comments) {
-    CompilationInfo* info = this->info();
-    if (info->IsStub()) return;
-    std::ostringstream buffer;
-    buffer << "-- ";
-    if (FLAG_trace_turbo || FLAG_trace_turbo_graph ||
-        tasm()->isolate()->concurrent_recompilation_enabled()) {
-      buffer << source_position;
-    } else {
-      AllowHeapAllocation allocation;
-      AllowHandleAllocation handles;
-      AllowHandleDereference deref;
-      buffer << source_position.InliningStack(info);
-    }
-    buffer << " --";
-    tasm()->RecordComment(StrDup(buffer.str().c_str()));
-  }
-}
-
-bool CodeGenerator::GetSlotAboveSPBeforeTailCall(Instruction* instr,
-                                                 int* slot) {
-  if (instr->IsTailCall()) {
-    InstructionOperandConverter g(this, instr);
-    *slot = g.InputInt32(instr->InputCount() - 1);
-    return true;
-  } else {
-    return false;
-  }
-}
-
-void CodeGenerator::AssembleGaps(Instruction* instr) {
-  for (int i = Instruction::FIRST_GAP_POSITION;
-       i <= Instruction::LAST_GAP_POSITION; i++) {
-    Instruction::GapPosition inner_pos =
-        static_cast<Instruction::GapPosition>(i);
-    ParallelMove* move = instr->GetParallelMove(inner_pos);
-    if (move != nullptr) resolver()->Resolve(move);
-  }
-}
-
-namespace {
-
-Handle<PodArray<InliningPosition>> CreateInliningPositions(
-    CompilationInfo* info, Isolate* isolate) {
-  const CompilationInfo::InlinedFunctionList& inlined_functions =
-      info->inlined_functions();
-  if (inlined_functions.size() == 0) {
-    return Handle<PodArray<InliningPosition>>::cast(
-        isolate->factory()->empty_byte_array());
-  }
-  Handle<PodArray<InliningPosition>> inl_positions =
-      PodArray<InliningPosition>::New(
-          isolate, static_cast<int>(inlined_functions.size()), TENURED);
-  for (size_t i = 0; i < inlined_functions.size(); ++i) {
-    inl_positions->set(static_cast<int>(i), inlined_functions[i].position);
-  }
-  return inl_positions;
-}
-
-}  // namespace
-
-Handle<DeoptimizationData> CodeGenerator::GenerateDeoptimizationData() {
-  CompilationInfo* info = this->info();
-  int deopt_count = static_cast<int>(deoptimization_states_.size());
-  if (deopt_count == 0 && !info->is_osr()) {
-    return DeoptimizationData::Empty(isolate());
-  }
-  Handle<DeoptimizationData> data =
-      DeoptimizationData::New(isolate(), deopt_count, TENURED);
-
-  Handle<ByteArray> translation_array =
-      translations_.CreateByteArray(isolate()->factory());
-
-  data->SetTranslationByteArray(*translation_array);
-  data->SetInlinedFunctionCount(
-      Smi::FromInt(static_cast<int>(inlined_function_count_)));
-  data->SetOptimizationId(Smi::FromInt(info->optimization_id()));
-
-  if (info->has_shared_info()) {
-    data->SetSharedFunctionInfo(*info->shared_info());
-  } else {
-    data->SetSharedFunctionInfo(Smi::kZero);
-  }
-
-  Handle<FixedArray> literals = isolate()->factory()->NewFixedArray(
-      static_cast<int>(deoptimization_literals_.size()), TENURED);
-  for (unsigned i = 0; i < deoptimization_literals_.size(); i++) {
-    Handle<Object> object = deoptimization_literals_[i].Reify(isolate());
-    literals->set(i, *object);
-  }
-  data->SetLiteralArray(*literals);
-
-  Handle<PodArray<InliningPosition>> inl_pos =
-      CreateInliningPositions(info, isolate());
-  data->SetInliningPositions(*inl_pos);
-
-  if (info->is_osr()) {
-    DCHECK_LE(0, osr_pc_offset_);
-    data->SetOsrBytecodeOffset(Smi::FromInt(info_->osr_offset().ToInt()));
-    data->SetOsrPcOffset(Smi::FromInt(osr_pc_offset_));
-  } else {
-    BailoutId osr_offset = BailoutId::None();
-    data->SetOsrBytecodeOffset(Smi::FromInt(osr_offset.ToInt()));
-    data->SetOsrPcOffset(Smi::FromInt(-1));
-  }
-
-  // Populate deoptimization entries.
-  for (int i = 0; i < deopt_count; i++) {
-    DeoptimizationState* deoptimization_state = deoptimization_states_[i];
-    data->SetBytecodeOffset(i, deoptimization_state->bailout_id());
-    CHECK(deoptimization_state);
-    data->SetTranslationIndex(
-        i, Smi::FromInt(deoptimization_state->translation_id()));
-    data->SetPc(i, Smi::FromInt(deoptimization_state->pc_offset()));
-  }
-
-  return data;
-}
-
-
-Label* CodeGenerator::AddJumpTable(Label** targets, size_t target_count) {
-  jump_tables_ = new (zone()) JumpTable(jump_tables_, targets, target_count);
-  return jump_tables_->label();
-}
-
-
-void CodeGenerator::RecordCallPosition(Instruction* instr) {
-  CallDescriptor::Flags flags(MiscField::decode(instr->opcode()));
-
-  bool needs_frame_state = (flags & CallDescriptor::kNeedsFrameState);
-
-  RecordSafepoint(
-      instr->reference_map(), Safepoint::kSimple, 0,
-      needs_frame_state ? Safepoint::kLazyDeopt : Safepoint::kNoLazyDeopt);
-
-  if (flags & CallDescriptor::kHasExceptionHandler) {
-    InstructionOperandConverter i(this, instr);
-    RpoNumber handler_rpo = i.InputRpo(instr->InputCount() - 1);
-    handlers_.push_back({GetLabel(handler_rpo), tasm()->pc_offset()});
-  }
-
-  if (needs_frame_state) {
-    MarkLazyDeoptSite();
-    // If the frame state is present, it starts at argument 1 (just after the
-    // code address).
-    size_t frame_state_offset = 1;
-    FrameStateDescriptor* descriptor =
-        GetDeoptimizationEntry(instr, frame_state_offset).descriptor();
-    int pc_offset = tasm()->pc_offset();
-    int deopt_state_id = BuildTranslation(instr, pc_offset, frame_state_offset,
-                                          descriptor->state_combine());
-
-    DeoptimizationExit* const exit = new (zone())
-        DeoptimizationExit(deopt_state_id, current_source_position_);
-    deoptimization_exits_.push_back(exit);
-    safepoints()->RecordLazyDeoptimizationIndex(deopt_state_id);
-  }
-}
-
-int CodeGenerator::DefineDeoptimizationLiteral(DeoptimizationLiteral literal) {
-  int result = static_cast<int>(deoptimization_literals_.size());
-  for (unsigned i = 0; i < deoptimization_literals_.size(); ++i) {
-    if (deoptimization_literals_[i] == literal) return i;
-  }
-  deoptimization_literals_.push_back(literal);
-  return result;
-}
-
-DeoptimizationEntry const& CodeGenerator::GetDeoptimizationEntry(
-    Instruction* instr, size_t frame_state_offset) {
-  InstructionOperandConverter i(this, instr);
-  int const state_id = i.InputInt32(frame_state_offset);
-  return code()->GetDeoptimizationEntry(state_id);
-}
-
-DeoptimizeKind CodeGenerator::GetDeoptimizationKind(
-    int deoptimization_id) const {
-  size_t const index = static_cast<size_t>(deoptimization_id);
-  DCHECK_LT(index, deoptimization_states_.size());
-  return deoptimization_states_[index]->kind();
-}
-
-DeoptimizeReason CodeGenerator::GetDeoptimizationReason(
-    int deoptimization_id) const {
-  size_t const index = static_cast<size_t>(deoptimization_id);
-  DCHECK_LT(index, deoptimization_states_.size());
-  return deoptimization_states_[index]->reason();
-}
-
-void CodeGenerator::TranslateStateValueDescriptor(
-    StateValueDescriptor* desc, StateValueList* nested,
-    Translation* translation, InstructionOperandIterator* iter) {
-  // Note:
-  // If translation is null, we just skip the relevant instruction operands.
-  if (desc->IsNested()) {
-    if (translation != nullptr) {
-      translation->BeginCapturedObject(static_cast<int>(nested->size()));
-    }
-    for (auto field : *nested) {
-      TranslateStateValueDescriptor(field.desc, field.nested, translation,
-                                    iter);
-    }
-  } else if (desc->IsArgumentsElements()) {
-    if (translation != nullptr) {
-      translation->ArgumentsElements(desc->arguments_type());
-    }
-  } else if (desc->IsArgumentsLength()) {
-    if (translation != nullptr) {
-      translation->ArgumentsLength(desc->arguments_type());
-    }
-  } else if (desc->IsDuplicate()) {
-    if (translation != nullptr) {
-      translation->DuplicateObject(static_cast<int>(desc->id()));
-    }
-  } else if (desc->IsPlain()) {
-    InstructionOperand* op = iter->Advance();
-    if (translation != nullptr) {
-      AddTranslationForOperand(translation, iter->instruction(), op,
-                               desc->type());
-    }
-  } else {
-    DCHECK(desc->IsOptimizedOut());
-    if (translation != nullptr) {
-      if (optimized_out_literal_id_ == -1) {
-        optimized_out_literal_id_ = DefineDeoptimizationLiteral(
-            DeoptimizationLiteral(isolate()->factory()->optimized_out()));
-      }
-      translation->StoreLiteral(optimized_out_literal_id_);
-    }
-  }
-}
-
-
-void CodeGenerator::TranslateFrameStateDescriptorOperands(
-    FrameStateDescriptor* desc, InstructionOperandIterator* iter,
-    OutputFrameStateCombine combine, Translation* translation) {
-  size_t index = 0;
-  StateValueList* values = desc->GetStateValueDescriptors();
-  for (StateValueList::iterator it = values->begin(); it != values->end();
-       ++it, ++index) {
-    StateValueDescriptor* value_desc = (*it).desc;
-    if (!combine.IsOutputIgnored()) {
-      // The result of the call should be placed at position
-      // [index_from_top] in the stack (overwriting whatever was
-      // previously there).
-      size_t index_from_top = desc->GetSize() - 1 - combine.GetOffsetToPokeAt();
-      if (index >= index_from_top &&
-          index < index_from_top + iter->instruction()->OutputCount()) {
-        DCHECK_NOT_NULL(translation);
-        AddTranslationForOperand(
-            translation, iter->instruction(),
-            iter->instruction()->OutputAt(index - index_from_top),
-            MachineType::AnyTagged());
-        // Skip the instruction operands.
-        TranslateStateValueDescriptor(value_desc, (*it).nested, nullptr, iter);
-        continue;
-      }
-    }
-    TranslateStateValueDescriptor(value_desc, (*it).nested, translation, iter);
-  }
-  DCHECK_EQ(desc->GetSize(), index);
-}
-
-
-void CodeGenerator::BuildTranslationForFrameStateDescriptor(
-    FrameStateDescriptor* descriptor, InstructionOperandIterator* iter,
-    Translation* translation, OutputFrameStateCombine state_combine) {
-  // Outer-most state must be added to translation first.
-  if (descriptor->outer_state() != nullptr) {
-    BuildTranslationForFrameStateDescriptor(descriptor->outer_state(), iter,
-                                            translation,
-                                            OutputFrameStateCombine::Ignore());
-  }
-
-  Handle<SharedFunctionInfo> shared_info;
-  if (!descriptor->shared_info().ToHandle(&shared_info)) {
-    if (!info()->has_shared_info()) {
-      return;  // Stub with no SharedFunctionInfo.
-    }
-    shared_info = info()->shared_info();
-  }
-  int shared_info_id =
-      DefineDeoptimizationLiteral(DeoptimizationLiteral(shared_info));
-
-  switch (descriptor->type()) {
-    case FrameStateType::kInterpretedFunction:
-      translation->BeginInterpretedFrame(
-          descriptor->bailout_id(), shared_info_id,
-          static_cast<unsigned int>(descriptor->locals_count() + 1));
-      break;
-    case FrameStateType::kArgumentsAdaptor:
-      translation->BeginArgumentsAdaptorFrame(
-          shared_info_id,
-          static_cast<unsigned int>(descriptor->parameters_count()));
-      break;
-    case FrameStateType::kConstructStub:
-      DCHECK(descriptor->bailout_id().IsValidForConstructStub());
-      translation->BeginConstructStubFrame(
-          descriptor->bailout_id(), shared_info_id,
-          static_cast<unsigned int>(descriptor->parameters_count()));
-      break;
-    case FrameStateType::kBuiltinContinuation: {
-      BailoutId bailout_id = descriptor->bailout_id();
-      int parameter_count =
-          static_cast<unsigned int>(descriptor->parameters_count());
-      translation->BeginBuiltinContinuationFrame(bailout_id, shared_info_id,
-                                                 parameter_count);
-      break;
-    }
-    case FrameStateType::kJavaScriptBuiltinContinuation: {
-      BailoutId bailout_id = descriptor->bailout_id();
-      int parameter_count =
-          static_cast<unsigned int>(descriptor->parameters_count());
-      translation->BeginJavaScriptBuiltinContinuationFrame(
-          bailout_id, shared_info_id, parameter_count);
-      break;
-    }
-  }
-
-  TranslateFrameStateDescriptorOperands(descriptor, iter, state_combine,
-                                        translation);
-}
-
-
-int CodeGenerator::BuildTranslation(Instruction* instr, int pc_offset,
-                                    size_t frame_state_offset,
-                                    OutputFrameStateCombine state_combine) {
-  DeoptimizationEntry const& entry =
-      GetDeoptimizationEntry(instr, frame_state_offset);
-  FrameStateDescriptor* const descriptor = entry.descriptor();
-  frame_state_offset++;
-
-  int update_feedback_count = entry.feedback().IsValid() ? 1 : 0;
-  Translation translation(&translations_,
-                          static_cast<int>(descriptor->GetFrameCount()),
-                          static_cast<int>(descriptor->GetJSFrameCount()),
-                          update_feedback_count, zone());
-  if (entry.feedback().IsValid()) {
-    DeoptimizationLiteral literal =
-        DeoptimizationLiteral(entry.feedback().vector());
-    int literal_id = DefineDeoptimizationLiteral(literal);
-    translation.AddUpdateFeedback(literal_id, entry.feedback().slot().ToInt());
-  }
-  InstructionOperandIterator iter(instr, frame_state_offset);
-  BuildTranslationForFrameStateDescriptor(descriptor, &iter, &translation,
-                                          state_combine);
-
-  int deoptimization_id = static_cast<int>(deoptimization_states_.size());
-
-  deoptimization_states_.push_back(new (zone()) DeoptimizationState(
-      descriptor->bailout_id(), translation.index(), pc_offset, entry.kind(),
-      entry.reason()));
-
-  return deoptimization_id;
-}
-
-void CodeGenerator::AddTranslationForOperand(Translation* translation,
-                                             Instruction* instr,
-                                             InstructionOperand* op,
-                                             MachineType type) {
-  if (op->IsStackSlot()) {
-    if (type.representation() == MachineRepresentation::kBit) {
-      translation->StoreBoolStackSlot(LocationOperand::cast(op)->index());
-    } else if (type == MachineType::Int8() || type == MachineType::Int16() ||
-               type == MachineType::Int32()) {
-      translation->StoreInt32StackSlot(LocationOperand::cast(op)->index());
-    } else if (type == MachineType::Uint8() || type == MachineType::Uint16() ||
-               type == MachineType::Uint32()) {
-      translation->StoreUint32StackSlot(LocationOperand::cast(op)->index());
-    } else {
-      CHECK_EQ(MachineRepresentation::kTagged, type.representation());
-      translation->StoreStackSlot(LocationOperand::cast(op)->index());
-    }
-  } else if (op->IsFPStackSlot()) {
-    if (type.representation() == MachineRepresentation::kFloat64) {
-      translation->StoreDoubleStackSlot(LocationOperand::cast(op)->index());
-    } else {
-      CHECK_EQ(MachineRepresentation::kFloat32, type.representation());
-      translation->StoreFloatStackSlot(LocationOperand::cast(op)->index());
-    }
-  } else if (op->IsRegister()) {
-    InstructionOperandConverter converter(this, instr);
-    if (type.representation() == MachineRepresentation::kBit) {
-      translation->StoreBoolRegister(converter.ToRegister(op));
-    } else if (type == MachineType::Int8() || type == MachineType::Int16() ||
-               type == MachineType::Int32()) {
-      translation->StoreInt32Register(converter.ToRegister(op));
-    } else if (type == MachineType::Uint8() || type == MachineType::Uint16() ||
-               type == MachineType::Uint32()) {
-      translation->StoreUint32Register(converter.ToRegister(op));
-    } else {
-      CHECK_EQ(MachineRepresentation::kTagged, type.representation());
-      translation->StoreRegister(converter.ToRegister(op));
-    }
-  } else if (op->IsFPRegister()) {
-    InstructionOperandConverter converter(this, instr);
-    if (type.representation() == MachineRepresentation::kFloat64) {
-      translation->StoreDoubleRegister(converter.ToDoubleRegister(op));
-    } else {
-      CHECK_EQ(MachineRepresentation::kFloat32, type.representation());
-      translation->StoreFloatRegister(converter.ToFloatRegister(op));
-    }
-  } else {
-    CHECK(op->IsImmediate());
-    InstructionOperandConverter converter(this, instr);
-    Constant constant = converter.ToConstant(op);
-    DeoptimizationLiteral literal;
-    switch (constant.type()) {
-      case Constant::kInt32:
-        if (type.representation() == MachineRepresentation::kTagged) {
-          // When pointers are 4 bytes, we can use int32 constants to represent
-          // Smis.
-          DCHECK_EQ(4, kPointerSize);
-          Smi* smi = reinterpret_cast<Smi*>(constant.ToInt32());
-          DCHECK(smi->IsSmi());
-          literal = DeoptimizationLiteral(smi->value());
-        } else if (type.representation() == MachineRepresentation::kBit) {
-          if (constant.ToInt32() == 0) {
-            literal =
-                DeoptimizationLiteral(isolate()->factory()->false_value());
-          } else {
-            DCHECK_EQ(1, constant.ToInt32());
-            literal = DeoptimizationLiteral(isolate()->factory()->true_value());
-          }
-        } else {
-          DCHECK(type == MachineType::Int32() ||
-                 type == MachineType::Uint32() ||
-                 type.representation() == MachineRepresentation::kWord32 ||
-                 type.representation() == MachineRepresentation::kNone);
-          DCHECK(type.representation() != MachineRepresentation::kNone ||
-                 constant.ToInt32() == FrameStateDescriptor::kImpossibleValue);
-          if (type == MachineType::Uint32()) {
-            literal = DeoptimizationLiteral(
-                static_cast<uint32_t>(constant.ToInt32()));
-          } else {
-            literal = DeoptimizationLiteral(constant.ToInt32());
-          }
-        }
-        break;
-      case Constant::kInt64:
-        // When pointers are 8 bytes, we can use int64 constants to represent
-        // Smis.
-        DCHECK(type.representation() == MachineRepresentation::kWord64 ||
-               type.representation() == MachineRepresentation::kTagged);
-        DCHECK_EQ(8, kPointerSize);
-        {
-          Smi* smi = reinterpret_cast<Smi*>(constant.ToInt64());
-          DCHECK(smi->IsSmi());
-          literal = DeoptimizationLiteral(smi->value());
-        }
-        break;
-      case Constant::kFloat32:
-        DCHECK(type.representation() == MachineRepresentation::kFloat32 ||
-               type.representation() == MachineRepresentation::kTagged);
-        literal = DeoptimizationLiteral(constant.ToFloat32());
-        break;
-      case Constant::kFloat64:
-        DCHECK(type.representation() == MachineRepresentation::kFloat64 ||
-               type.representation() == MachineRepresentation::kTagged);
-        literal = DeoptimizationLiteral(constant.ToFloat64().value());
-        break;
-      case Constant::kHeapObject:
-        DCHECK_EQ(MachineRepresentation::kTagged, type.representation());
-        literal = DeoptimizationLiteral(constant.ToHeapObject());
-        break;
-      default:
-        UNREACHABLE();
-    }
-    if (literal.object().equals(info()->closure())) {
-      translation->StoreJSFrameFunction();
-    } else {
-      int literal_id = DefineDeoptimizationLiteral(literal);
-      translation->StoreLiteral(literal_id);
-    }
-  }
-}
-
-void CodeGenerator::MarkLazyDeoptSite() {
-  last_lazy_deopt_pc_ = tasm()->pc_offset();
-}
-
-DeoptimizationExit* CodeGenerator::AddDeoptimizationExit(
-    Instruction* instr, size_t frame_state_offset) {
-  int const deoptimization_id = BuildTranslation(
-      instr, -1, frame_state_offset, OutputFrameStateCombine::Ignore());
-
-  DeoptimizationExit* const exit = new (zone())
-      DeoptimizationExit(deoptimization_id, current_source_position_);
-  deoptimization_exits_.push_back(exit);
-  return exit;
-}
-
-OutOfLineCode::OutOfLineCode(CodeGenerator* gen)
-    : frame_(gen->frame()), tasm_(gen->tasm()), next_(gen->ools_) {
-  gen->ools_ = this;
-}
-
-OutOfLineCode::~OutOfLineCode() {}
-
-Handle<Object> DeoptimizationLiteral::Reify(Isolate* isolate) const {
-  return object_.is_null() ? isolate->factory()->NewNumber(number_) : object_;
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/code-generator.h b/src/v8/src/compiler/code-generator.h
deleted file mode 100644
index 425ea2e..0000000
--- a/src/v8/src/compiler/code-generator.h
+++ /dev/null
@@ -1,377 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_CODE_GENERATOR_H_
-#define V8_COMPILER_CODE_GENERATOR_H_
-
-#include "src/base/optional.h"
-#include "src/compiler/gap-resolver.h"
-#include "src/compiler/instruction.h"
-#include "src/compiler/osr.h"
-#include "src/compiler/unwinding-info-writer.h"
-#include "src/deoptimizer.h"
-#include "src/macro-assembler.h"
-#include "src/safepoint-table.h"
-#include "src/source-position-table.h"
-
-namespace v8 {
-namespace internal {
-
-class CompilationInfo;
-
-namespace trap_handler {
-struct ProtectedInstructionData;
-}  // namespace trap_handler
-
-namespace compiler {
-
-// Forward declarations.
-class DeoptimizationExit;
-class FrameAccessState;
-class Linkage;
-class OutOfLineCode;
-
-struct BranchInfo {
-  FlagsCondition condition;
-  Label* true_label;
-  Label* false_label;
-  bool fallthru;
-};
-
-
-class InstructionOperandIterator {
- public:
-  InstructionOperandIterator(Instruction* instr, size_t pos)
-      : instr_(instr), pos_(pos) {}
-
-  Instruction* instruction() const { return instr_; }
-  InstructionOperand* Advance() { return instr_->InputAt(pos_++); }
-
- private:
-  Instruction* instr_;
-  size_t pos_;
-};
-
-// Either a non-null Handle<Object> or a double.
-class DeoptimizationLiteral {
- public:
-  DeoptimizationLiteral() : object_(), number_(0) {}
-  explicit DeoptimizationLiteral(Handle<Object> object)
-      : object_(object), number_(0) {
-    DCHECK(!object_.is_null());
-  }
-  explicit DeoptimizationLiteral(double number) : object_(), number_(number) {}
-
-  Handle<Object> object() const { return object_; }
-
-  bool operator==(const DeoptimizationLiteral& other) const {
-    return object_.equals(other.object_) &&
-           bit_cast<uint64_t>(number_) == bit_cast<uint64_t>(other.number_);
-  }
-
-  Handle<Object> Reify(Isolate* isolate) const;
-
- private:
-  Handle<Object> object_;
-  double number_;
-};
-
-// Generates native code for a sequence of instructions.
-class CodeGenerator final : public GapResolver::Assembler {
- public:
-  explicit CodeGenerator(Zone* codegen_zone, Frame* frame, Linkage* linkage,
-                         InstructionSequence* code, CompilationInfo* info,
-                         Isolate* isolate, base::Optional<OsrHelper> osr_helper,
-                         int start_source_position,
-                         JumpOptimizationInfo* jump_opt,
-                         std::vector<trap_handler::ProtectedInstructionData>*
-                             protected_instructions);
-
-  // Generate native code. After calling AssembleCode, call FinalizeCode to
-  // produce the actual code object. If an error occurs during either phase,
-  // FinalizeCode returns a null handle.
-  void AssembleCode();  // Does not need to run on main thread.
-  Handle<Code> FinalizeCode();
-
-  Handle<ByteArray> GetSourcePositionTable();
-  MaybeHandle<HandlerTable> GetHandlerTable() const;
-
-  InstructionSequence* code() const { return code_; }
-  FrameAccessState* frame_access_state() const { return frame_access_state_; }
-  const Frame* frame() const { return frame_access_state_->frame(); }
-  Isolate* isolate() const { return isolate_; }
-  Linkage* linkage() const { return linkage_; }
-
-  Label* GetLabel(RpoNumber rpo) { return &labels_[rpo.ToSize()]; }
-
-  void AddProtectedInstructionLanding(uint32_t instr_offset,
-                                      uint32_t landing_offset);
-
-  SourcePosition start_source_position() const {
-    return start_source_position_;
-  }
-
-  void AssembleSourcePosition(Instruction* instr);
-  void AssembleSourcePosition(SourcePosition source_position);
-
-  // Record a safepoint with the given pointer map.
-  void RecordSafepoint(ReferenceMap* references, Safepoint::Kind kind,
-                       int arguments, Safepoint::DeoptMode deopt_mode);
-
-  Zone* zone() const { return zone_; }
-  TurboAssembler* tasm() { return &tasm_; }
-  size_t GetSafepointTableOffset() const { return safepoints_.GetCodeOffset(); }
-
- private:
-  GapResolver* resolver() { return &resolver_; }
-  SafepointTableBuilder* safepoints() { return &safepoints_; }
-  CompilationInfo* info() const { return info_; }
-  OsrHelper* osr_helper() { return &(*osr_helper_); }
-
-  // Create the FrameAccessState object. The Frame is immutable from here on.
-  void CreateFrameAccessState(Frame* frame);
-
-  // Architecture - specific frame finalization.
-  void FinishFrame(Frame* frame);
-
-  // Checks if {block} will appear directly after {current_block_} when
-  // assembling code, in which case, a fall-through can be used.
-  bool IsNextInAssemblyOrder(RpoNumber block) const;
-
-  // Check if a heap object can be materialized by loading from a heap root,
-  // which is cheaper on some platforms than materializing the actual heap
-  // object constant.
-  bool IsMaterializableFromRoot(Handle<HeapObject> object,
-                                Heap::RootListIndex* index_return);
-
-  enum CodeGenResult { kSuccess, kTooManyDeoptimizationBailouts };
-
-  // Assemble instructions for the specified block.
-  CodeGenResult AssembleBlock(const InstructionBlock* block);
-
-  // Assemble code for the specified instruction.
-  CodeGenResult AssembleInstruction(Instruction* instr,
-                                    const InstructionBlock* block);
-  void AssembleGaps(Instruction* instr);
-
-  // Returns true if a instruction is a tail call that needs to adjust the stack
-  // pointer before execution. The stack slot index to the empty slot above the
-  // adjusted stack pointer is returned in |slot|.
-  bool GetSlotAboveSPBeforeTailCall(Instruction* instr, int* slot);
-
-  CodeGenResult AssembleDeoptimizerCall(int deoptimization_id,
-                                        SourcePosition pos);
-
-  // ===========================================================================
-  // ============= Architecture-specific code generation methods. ==============
-  // ===========================================================================
-
-  CodeGenResult AssembleArchInstruction(Instruction* instr);
-  void AssembleArchJump(RpoNumber target);
-  void AssembleArchBranch(Instruction* instr, BranchInfo* branch);
-
-  // Generates special branch for deoptimization condition.
-  void AssembleArchDeoptBranch(Instruction* instr, BranchInfo* branch);
-
-  void AssembleArchBoolean(Instruction* instr, FlagsCondition condition);
-  void AssembleArchTrap(Instruction* instr, FlagsCondition condition);
-  void AssembleArchLookupSwitch(Instruction* instr);
-  void AssembleArchTableSwitch(Instruction* instr);
-
-  // When entering a code that is marked for deoptimization, rather continuing
-  // with its execution, we jump to a lazy compiled code. We need to do this
-  // because this code has already been deoptimized and needs to be unlinked
-  // from the JS functions referring it.
-  void BailoutIfDeoptimized();
-
-  // Generates an architecture-specific, descriptor-specific prologue
-  // to set up a stack frame.
-  void AssembleConstructFrame();
-
-  // Generates an architecture-specific, descriptor-specific return sequence
-  // to tear down a stack frame.
-  void AssembleReturn(InstructionOperand* pop);
-
-  void AssembleDeconstructFrame();
-
-  // Generates code to manipulate the stack in preparation for a tail call.
-  void AssemblePrepareTailCall();
-
-  // Generates code to pop current frame if it is an arguments adaptor frame.
-  void AssemblePopArgumentsAdaptorFrame(Register args_reg, Register scratch1,
-                                        Register scratch2, Register scratch3);
-
-  enum PushTypeFlag {
-    kImmediatePush = 0x1,
-    kRegisterPush = 0x2,
-    kStackSlotPush = 0x4,
-    kScalarPush = kRegisterPush | kStackSlotPush
-  };
-
-  typedef base::Flags<PushTypeFlag> PushTypeFlags;
-
-  static bool IsValidPush(InstructionOperand source, PushTypeFlags push_type);
-
-  // Generate a list moves from an instruction that are candidates to be turned
-  // into push instructions on platforms that support them. In general, the list
-  // of push candidates are moves to a set of contiguous destination
-  // InstructionOperand locations on the stack that don't clobber values that
-  // are needed for resolve the gap or use values generated by the gap,
-  // i.e. moves that can be hoisted together before the actual gap and assembled
-  // together.
-  static void GetPushCompatibleMoves(Instruction* instr,
-                                     PushTypeFlags push_type,
-                                     ZoneVector<MoveOperands*>* pushes);
-
-  // Called before a tail call |instr|'s gap moves are assembled and allows
-  // gap-specific pre-processing, e.g. adjustment of the sp for tail calls that
-  // need it before gap moves or conversion of certain gap moves into pushes.
-  void AssembleTailCallBeforeGap(Instruction* instr,
-                                 int first_unused_stack_slot);
-  // Called after a tail call |instr|'s gap moves are assembled and allows
-  // gap-specific post-processing, e.g. adjustment of the sp for tail calls that
-  // need it after gap moves.
-  void AssembleTailCallAfterGap(Instruction* instr,
-                                int first_unused_stack_slot);
-
-  void FinishCode();
-
-  // ===========================================================================
-  // ============== Architecture-specific gap resolver methods. ================
-  // ===========================================================================
-
-  // Interface used by the gap resolver to emit moves and swaps.
-  void AssembleMove(InstructionOperand* source,
-                    InstructionOperand* destination) final;
-  void AssembleSwap(InstructionOperand* source,
-                    InstructionOperand* destination) final;
-
-  // ===========================================================================
-  // =================== Jump table construction methods. ======================
-  // ===========================================================================
-
-  class JumpTable;
-  // Adds a jump table that is emitted after the actual code.  Returns label
-  // pointing to the beginning of the table.  {targets} is assumed to be static
-  // or zone allocated.
-  Label* AddJumpTable(Label** targets, size_t target_count);
-  // Emits a jump table.
-  void AssembleJumpTable(Label** targets, size_t target_count);
-
-  // ===========================================================================
-  // ================== Deoptimization table construction. =====================
-  // ===========================================================================
-
-  void RecordCallPosition(Instruction* instr);
-  Handle<DeoptimizationData> GenerateDeoptimizationData();
-  int DefineDeoptimizationLiteral(DeoptimizationLiteral literal);
-  DeoptimizationEntry const& GetDeoptimizationEntry(Instruction* instr,
-                                                    size_t frame_state_offset);
-  DeoptimizeKind GetDeoptimizationKind(int deoptimization_id) const;
-  DeoptimizeReason GetDeoptimizationReason(int deoptimization_id) const;
-  int BuildTranslation(Instruction* instr, int pc_offset,
-                       size_t frame_state_offset,
-                       OutputFrameStateCombine state_combine);
-  void BuildTranslationForFrameStateDescriptor(
-      FrameStateDescriptor* descriptor, InstructionOperandIterator* iter,
-      Translation* translation, OutputFrameStateCombine state_combine);
-  void TranslateStateValueDescriptor(StateValueDescriptor* desc,
-                                     StateValueList* nested,
-                                     Translation* translation,
-                                     InstructionOperandIterator* iter);
-  void TranslateFrameStateDescriptorOperands(FrameStateDescriptor* desc,
-                                             InstructionOperandIterator* iter,
-                                             OutputFrameStateCombine combine,
-                                             Translation* translation);
-  void AddTranslationForOperand(Translation* translation, Instruction* instr,
-                                InstructionOperand* op, MachineType type);
-  void MarkLazyDeoptSite();
-
-  DeoptimizationExit* AddDeoptimizationExit(Instruction* instr,
-                                            size_t frame_state_offset);
-
-  // ===========================================================================
-
-  class DeoptimizationState final : public ZoneObject {
-   public:
-    DeoptimizationState(BailoutId bailout_id, int translation_id, int pc_offset,
-                        DeoptimizeKind kind, DeoptimizeReason reason)
-        : bailout_id_(bailout_id),
-          translation_id_(translation_id),
-          pc_offset_(pc_offset),
-          kind_(kind),
-          reason_(reason) {}
-
-    BailoutId bailout_id() const { return bailout_id_; }
-    int translation_id() const { return translation_id_; }
-    int pc_offset() const { return pc_offset_; }
-    DeoptimizeKind kind() const { return kind_; }
-    DeoptimizeReason reason() const { return reason_; }
-
-   private:
-    BailoutId bailout_id_;
-    int translation_id_;
-    int pc_offset_;
-    DeoptimizeKind kind_;
-    DeoptimizeReason reason_;
-  };
-
-  struct HandlerInfo {
-    Label* handler;
-    int pc_offset;
-  };
-
-  friend class OutOfLineCode;
-  friend class CodeGeneratorTester;
-
-  Zone* zone_;
-  Isolate* isolate_;
-  FrameAccessState* frame_access_state_;
-  Linkage* const linkage_;
-  InstructionSequence* const code_;
-  UnwindingInfoWriter unwinding_info_writer_;
-  CompilationInfo* const info_;
-  Label* const labels_;
-  Label return_label_;
-  RpoNumber current_block_;
-  SourcePosition start_source_position_;
-  SourcePosition current_source_position_;
-  TurboAssembler tasm_;
-  GapResolver resolver_;
-  SafepointTableBuilder safepoints_;
-  ZoneVector<HandlerInfo> handlers_;
-  ZoneDeque<DeoptimizationExit*> deoptimization_exits_;
-  ZoneDeque<DeoptimizationState*> deoptimization_states_;
-  ZoneDeque<DeoptimizationLiteral> deoptimization_literals_;
-  size_t inlined_function_count_;
-  TranslationBuffer translations_;
-  int last_lazy_deopt_pc_;
-
-  // kArchCallCFunction could be reached either:
-  //   kArchCallCFunction;
-  // or:
-  //   kArchSaveCallerRegisters;
-  //   kArchCallCFunction;
-  //   kArchRestoreCallerRegisters;
-  // The boolean is used to distinguish the two cases. In the latter case, we
-  // also need to decide if FP registers need to be saved, which is controlled
-  // by fp_mode_.
-  bool caller_registers_saved_;
-  SaveFPRegsMode fp_mode_;
-
-  JumpTable* jump_tables_;
-  OutOfLineCode* ools_;
-  base::Optional<OsrHelper> osr_helper_;
-  int osr_pc_offset_;
-  int optimized_out_literal_id_;
-  SourcePositionTableBuilder source_position_table_builder_;
-  std::vector<trap_handler::ProtectedInstructionData>* protected_instructions_;
-  CodeGenResult result_;
-};
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_COMPILER_CODE_GENERATOR_H
diff --git a/src/v8/src/compiler/frame-elider.cc b/src/v8/src/compiler/frame-elider.cc
deleted file mode 100644
index 35d292b..0000000
--- a/src/v8/src/compiler/frame-elider.cc
+++ /dev/null
@@ -1,167 +0,0 @@
-// Copyright 2015 the V8 project 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 "src/compiler/frame-elider.h"
-
-#include "src/base/adapters.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-FrameElider::FrameElider(InstructionSequence* code) : code_(code) {}
-
-void FrameElider::Run() {
-  MarkBlocks();
-  PropagateMarks();
-  MarkDeConstruction();
-}
-
-
-void FrameElider::MarkBlocks() {
-  for (InstructionBlock* block : instruction_blocks()) {
-    if (block->needs_frame()) continue;
-    for (int i = block->code_start(); i < block->code_end(); ++i) {
-      const Instruction* instr = InstructionAt(i);
-      if (instr->IsCall() || instr->IsDeoptimizeCall() ||
-          instr->arch_opcode() == ArchOpcode::kArchStackPointer ||
-          instr->arch_opcode() == ArchOpcode::kArchFramePointer) {
-        block->mark_needs_frame();
-        break;
-      }
-    }
-  }
-}
-
-
-void FrameElider::PropagateMarks() {
-  while (PropagateInOrder() || PropagateReversed()) {
-  }
-}
-
-
-void FrameElider::MarkDeConstruction() {
-  for (InstructionBlock* block : instruction_blocks()) {
-    if (block->needs_frame()) {
-      // Special case: The start block needs a frame.
-      if (block->predecessors().empty()) {
-        block->mark_must_construct_frame();
-      }
-      // Find "frame -> no frame" transitions, inserting frame
-      // deconstructions.
-      for (RpoNumber& succ : block->successors()) {
-        if (!InstructionBlockAt(succ)->needs_frame()) {
-          DCHECK_EQ(1U, block->SuccessorCount());
-          const Instruction* last =
-              InstructionAt(block->last_instruction_index());
-          if (last->IsThrow() || last->IsTailCall() ||
-              last->IsDeoptimizeCall()) {
-            // We need to keep the frame if we exit the block through any
-            // of these.
-            continue;
-          }
-          // The only cases when we need to deconstruct are ret and jump.
-          DCHECK(last->IsRet() || last->IsJump());
-          block->mark_must_deconstruct_frame();
-        }
-      }
-    } else {
-      // Find "no frame -> frame" transitions, inserting frame constructions.
-      for (RpoNumber& succ : block->successors()) {
-        if (InstructionBlockAt(succ)->needs_frame()) {
-          DCHECK_NE(1U, block->SuccessorCount());
-          InstructionBlockAt(succ)->mark_must_construct_frame();
-        }
-      }
-    }
-  }
-}
-
-
-bool FrameElider::PropagateInOrder() {
-  bool changed = false;
-  for (InstructionBlock* block : instruction_blocks()) {
-    changed |= PropagateIntoBlock(block);
-  }
-  return changed;
-}
-
-
-bool FrameElider::PropagateReversed() {
-  bool changed = false;
-  for (InstructionBlock* block : base::Reversed(instruction_blocks())) {
-    changed |= PropagateIntoBlock(block);
-  }
-  return changed;
-}
-
-
-bool FrameElider::PropagateIntoBlock(InstructionBlock* block) {
-  // Already marked, nothing to do...
-  if (block->needs_frame()) return false;
-
-  // Never mark the dummy end node, otherwise we might incorrectly decide to
-  // put frame deconstruction code there later,
-  if (block->successors().empty()) return false;
-
-  // Propagate towards the end ("downwards") if there is a predecessor needing
-  // a frame, but don't "bleed" from deferred code to non-deferred code.
-  for (RpoNumber& pred : block->predecessors()) {
-    if (InstructionBlockAt(pred)->needs_frame() &&
-        (!InstructionBlockAt(pred)->IsDeferred() || block->IsDeferred())) {
-      block->mark_needs_frame();
-      return true;
-    }
-  }
-
-  // Propagate towards start ("upwards")
-  bool need_frame_successors = false;
-  if (block->SuccessorCount() == 1) {
-    // For single successors, propagate the needs_frame information.
-    need_frame_successors =
-        InstructionBlockAt(block->successors()[0])->needs_frame();
-  } else {
-    // For multiple successors, each successor must only have a single
-    // predecessor (because the graph is in edge-split form), so each successor
-    // can independently create/dismantle a frame if needed. Given this
-    // independent control, only propagate needs_frame if all non-deferred
-    // blocks need a frame.
-    for (RpoNumber& succ : block->successors()) {
-      InstructionBlock* successor_block = InstructionBlockAt(succ);
-      DCHECK_EQ(1, successor_block->PredecessorCount());
-      if (!successor_block->IsDeferred()) {
-        if (successor_block->needs_frame()) {
-          need_frame_successors = true;
-        } else {
-          return false;
-        }
-      }
-    }
-  }
-  if (need_frame_successors) {
-    block->mark_needs_frame();
-    return true;
-  } else {
-    return false;
-  }
-}
-
-
-const InstructionBlocks& FrameElider::instruction_blocks() const {
-  return code_->instruction_blocks();
-}
-
-
-InstructionBlock* FrameElider::InstructionBlockAt(RpoNumber rpo_number) const {
-  return code_->InstructionBlockAt(rpo_number);
-}
-
-
-Instruction* FrameElider::InstructionAt(int index) const {
-  return code_->InstructionAt(index);
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/frame-elider.h b/src/v8/src/compiler/frame-elider.h
deleted file mode 100644
index 7d31619..0000000
--- a/src/v8/src/compiler/frame-elider.h
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_FRAME_ELIDER_H_
-#define V8_COMPILER_FRAME_ELIDER_H_
-
-#include "src/compiler/instruction.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-
-// Determine which instruction blocks need a frame and where frames must be
-// constructed/deconstructed.
-class FrameElider {
- public:
-  explicit FrameElider(InstructionSequence* code);
-  void Run();
-
-
- private:
-  void MarkBlocks();
-  void PropagateMarks();
-  void MarkDeConstruction();
-  bool PropagateInOrder();
-  bool PropagateReversed();
-  bool PropagateIntoBlock(InstructionBlock* block);
-  const InstructionBlocks& instruction_blocks() const;
-  InstructionBlock* InstructionBlockAt(RpoNumber rpo_number) const;
-  Instruction* InstructionAt(int index) const;
-
-  InstructionSequence* const code_;
-};
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_COMPILER_FRAME_ELIDER_H_
diff --git a/src/v8/src/compiler/gap-resolver.cc b/src/v8/src/compiler/gap-resolver.cc
deleted file mode 100644
index 4542a73..0000000
--- a/src/v8/src/compiler/gap-resolver.cc
+++ /dev/null
@@ -1,249 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/compiler/gap-resolver.h"
-
-#include <algorithm>
-#include <set>
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-namespace {
-
-#define REP_BIT(rep) (1 << static_cast<int>(rep))
-
-const int kFloat32Bit = REP_BIT(MachineRepresentation::kFloat32);
-const int kFloat64Bit = REP_BIT(MachineRepresentation::kFloat64);
-
-// Splits a FP move between two location operands into the equivalent series of
-// moves between smaller sub-operands, e.g. a double move to two single moves.
-// This helps reduce the number of cycles that would normally occur under FP
-// aliasing, and makes swaps much easier to implement.
-MoveOperands* Split(MoveOperands* move, MachineRepresentation smaller_rep,
-                    ParallelMove* moves) {
-  DCHECK(!kSimpleFPAliasing);
-  // Splitting is only possible when the slot size is the same as float size.
-  DCHECK_EQ(kPointerSize, kFloatSize);
-  const LocationOperand& src_loc = LocationOperand::cast(move->source());
-  const LocationOperand& dst_loc = LocationOperand::cast(move->destination());
-  MachineRepresentation dst_rep = dst_loc.representation();
-  DCHECK_NE(smaller_rep, dst_rep);
-  auto src_kind = src_loc.location_kind();
-  auto dst_kind = dst_loc.location_kind();
-
-  int aliases =
-      1 << (ElementSizeLog2Of(dst_rep) - ElementSizeLog2Of(smaller_rep));
-  int base = -1;
-  USE(base);
-  DCHECK_EQ(aliases, RegisterConfiguration::Default()->GetAliases(
-                         dst_rep, 0, smaller_rep, &base));
-
-  int src_index = -1;
-  int slot_size = (1 << ElementSizeLog2Of(smaller_rep)) / kPointerSize;
-  int src_step = 1;
-  if (src_kind == LocationOperand::REGISTER) {
-    src_index = src_loc.register_code() * aliases;
-  } else {
-    src_index = src_loc.index();
-    // For operands that occupy multiple slots, the index refers to the last
-    // slot. On little-endian architectures, we start at the high slot and use a
-    // negative step so that register-to-slot moves are in the correct order.
-    src_step = -slot_size;
-  }
-  int dst_index = -1;
-  int dst_step = 1;
-  if (dst_kind == LocationOperand::REGISTER) {
-    dst_index = dst_loc.register_code() * aliases;
-  } else {
-    dst_index = dst_loc.index();
-    dst_step = -slot_size;
-  }
-
-  // Reuse 'move' for the first fragment. It is not pending.
-  move->set_source(AllocatedOperand(src_kind, smaller_rep, src_index));
-  move->set_destination(AllocatedOperand(dst_kind, smaller_rep, dst_index));
-  // Add the remaining fragment moves.
-  for (int i = 1; i < aliases; ++i) {
-    src_index += src_step;
-    dst_index += dst_step;
-    moves->AddMove(AllocatedOperand(src_kind, smaller_rep, src_index),
-                   AllocatedOperand(dst_kind, smaller_rep, dst_index));
-  }
-  // Return the first fragment.
-  return move;
-}
-
-}  // namespace
-
-void GapResolver::Resolve(ParallelMove* moves) {
-  // Clear redundant moves, and collect FP move representations if aliasing
-  // is non-simple.
-  int reps = 0;
-  for (size_t i = 0; i < moves->size();) {
-    MoveOperands* move = (*moves)[i];
-    if (move->IsRedundant()) {
-      (*moves)[i] = moves->back();
-      moves->pop_back();
-      continue;
-    }
-    i++;
-    if (!kSimpleFPAliasing && move->destination().IsFPRegister()) {
-      reps |=
-          REP_BIT(LocationOperand::cast(move->destination()).representation());
-    }
-  }
-
-  if (!kSimpleFPAliasing) {
-    if (reps && !base::bits::IsPowerOfTwo(reps)) {
-      // Start with the smallest FP moves, so we never encounter smaller moves
-      // in the middle of a cycle of larger moves.
-      if ((reps & kFloat32Bit) != 0) {
-        split_rep_ = MachineRepresentation::kFloat32;
-        for (size_t i = 0; i < moves->size(); ++i) {
-          auto move = (*moves)[i];
-          if (!move->IsEliminated() && move->destination().IsFloatRegister())
-            PerformMove(moves, move);
-        }
-      }
-      if ((reps & kFloat64Bit) != 0) {
-        split_rep_ = MachineRepresentation::kFloat64;
-        for (size_t i = 0; i < moves->size(); ++i) {
-          auto move = (*moves)[i];
-          if (!move->IsEliminated() && move->destination().IsDoubleRegister())
-            PerformMove(moves, move);
-        }
-      }
-    }
-    split_rep_ = MachineRepresentation::kSimd128;
-  }
-
-  for (size_t i = 0; i < moves->size(); ++i) {
-    auto move = (*moves)[i];
-    if (!move->IsEliminated()) PerformMove(moves, move);
-  }
-}
-
-void GapResolver::PerformMove(ParallelMove* moves, MoveOperands* move) {
-  // Each call to this function performs a move and deletes it from the move
-  // graph.  We first recursively perform any move blocking this one.  We mark a
-  // move as "pending" on entry to PerformMove in order to detect cycles in the
-  // move graph.  We use operand swaps to resolve cycles, which means that a
-  // call to PerformMove could change any source operand in the move graph.
-  DCHECK(!move->IsPending());
-  DCHECK(!move->IsRedundant());
-
-  // Clear this move's destination to indicate a pending move.  The actual
-  // destination is saved on the side.
-  InstructionOperand source = move->source();
-  DCHECK(!source.IsInvalid());  // Or else it will look eliminated.
-  InstructionOperand destination = move->destination();
-  move->SetPending();
-
-  // We may need to split moves between FP locations differently.
-  const bool is_fp_loc_move =
-      !kSimpleFPAliasing && destination.IsFPLocationOperand();
-
-  // Perform a depth-first traversal of the move graph to resolve dependencies.
-  // Any unperformed, unpending move with a source the same as this one's
-  // destination blocks this one so recursively perform all such moves.
-  for (size_t i = 0; i < moves->size(); ++i) {
-    auto other = (*moves)[i];
-    if (other->IsEliminated()) continue;
-    if (other->IsPending()) continue;
-    if (other->source().InterferesWith(destination)) {
-      if (is_fp_loc_move &&
-          LocationOperand::cast(other->source()).representation() >
-              split_rep_) {
-        // 'other' must also be an FP location move. Break it into fragments
-        // of the same size as 'move'. 'other' is set to one of the fragments,
-        // and the rest are appended to 'moves'.
-        other = Split(other, split_rep_, moves);
-        // 'other' may not block destination now.
-        if (!other->source().InterferesWith(destination)) continue;
-      }
-      // Though PerformMove can change any source operand in the move graph,
-      // this call cannot create a blocking move via a swap (this loop does not
-      // miss any).  Assume there is a non-blocking move with source A and this
-      // move is blocked on source B and there is a swap of A and B.  Then A and
-      // B must be involved in the same cycle (or they would not be swapped).
-      // Since this move's destination is B and there is only a single incoming
-      // edge to an operand, this move must also be involved in the same cycle.
-      // In that case, the blocking move will be created but will be "pending"
-      // when we return from PerformMove.
-      PerformMove(moves, other);
-    }
-  }
-
-  // This move's source may have changed due to swaps to resolve cycles and so
-  // it may now be the last move in the cycle.  If so remove it.
-  source = move->source();
-  if (source.EqualsCanonicalized(destination)) {
-    move->Eliminate();
-    return;
-  }
-
-  // We are about to resolve this move and don't need it marked as pending, so
-  // restore its destination.
-  move->set_destination(destination);
-
-  // The move may be blocked on a (at most one) pending move, in which case we
-  // have a cycle.  Search for such a blocking move and perform a swap to
-  // resolve it.
-  auto blocker =
-      std::find_if(moves->begin(), moves->end(), [&](MoveOperands* move) {
-        return !move->IsEliminated() &&
-               move->source().InterferesWith(destination);
-      });
-  if (blocker == moves->end()) {
-    // The easy case: This move is not blocked.
-    assembler_->AssembleMove(&source, &destination);
-    move->Eliminate();
-    return;
-  }
-
-  // Ensure source is a register or both are stack slots, to limit swap cases.
-  if (source.IsStackSlot() || source.IsFPStackSlot()) {
-    std::swap(source, destination);
-  }
-  assembler_->AssembleSwap(&source, &destination);
-  move->Eliminate();
-
-  // Update outstanding moves whose source may now have been moved.
-  if (is_fp_loc_move) {
-    // We may have to split larger moves.
-    for (size_t i = 0; i < moves->size(); ++i) {
-      auto other = (*moves)[i];
-      if (other->IsEliminated()) continue;
-      if (source.InterferesWith(other->source())) {
-        if (LocationOperand::cast(other->source()).representation() >
-            split_rep_) {
-          other = Split(other, split_rep_, moves);
-          if (!source.InterferesWith(other->source())) continue;
-        }
-        other->set_source(destination);
-      } else if (destination.InterferesWith(other->source())) {
-        if (LocationOperand::cast(other->source()).representation() >
-            split_rep_) {
-          other = Split(other, split_rep_, moves);
-          if (!destination.InterferesWith(other->source())) continue;
-        }
-        other->set_source(source);
-      }
-    }
-  } else {
-    for (auto other : *moves) {
-      if (other->IsEliminated()) continue;
-      if (source.EqualsCanonicalized(other->source())) {
-        other->set_source(destination);
-      } else if (destination.EqualsCanonicalized(other->source())) {
-        other->set_source(source);
-      }
-    }
-  }
-}
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/gap-resolver.h b/src/v8/src/compiler/gap-resolver.h
deleted file mode 100644
index d4c4025..0000000
--- a/src/v8/src/compiler/gap-resolver.h
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_GAP_RESOLVER_H_
-#define V8_COMPILER_GAP_RESOLVER_H_
-
-#include "src/compiler/instruction.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-class GapResolver final {
- public:
-  // Interface used by the gap resolver to emit moves and swaps.
-  class Assembler {
-   public:
-    virtual ~Assembler() {}
-
-    // Assemble move.
-    virtual void AssembleMove(InstructionOperand* source,
-                              InstructionOperand* destination) = 0;
-    // Assemble swap.
-    virtual void AssembleSwap(InstructionOperand* source,
-                              InstructionOperand* destination) = 0;
-  };
-
-  explicit GapResolver(Assembler* assembler)
-      : assembler_(assembler), split_rep_(MachineRepresentation::kSimd128) {}
-
-  // Resolve a set of parallel moves, emitting assembler instructions.
-  void Resolve(ParallelMove* parallel_move);
-
- private:
-  // Performs the given move, possibly performing other moves to unblock the
-  // destination operand.
-  void PerformMove(ParallelMove* moves, MoveOperands* move);
-
-  // Assembler used to emit moves and save registers.
-  Assembler* const assembler_;
-
-  // While resolving moves, the largest FP representation that can be moved.
-  // Any larger moves must be split into an equivalent series of moves of this
-  // representation.
-  MachineRepresentation split_rep_;
-};
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_COMPILER_GAP_RESOLVER_H_
diff --git a/src/v8/src/compiler/ia32/code-generator-ia32.cc b/src/v8/src/compiler/ia32/code-generator-ia32.cc
deleted file mode 100644
index 47ded6a..0000000
--- a/src/v8/src/compiler/ia32/code-generator-ia32.cc
+++ /dev/null
@@ -1,3457 +0,0 @@
-// Copyright 2013 the V8 project 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 "src/compiler/code-generator.h"
-
-#include "src/assembler-inl.h"
-#include "src/callable.h"
-#include "src/compilation-info.h"
-#include "src/compiler/code-generator-impl.h"
-#include "src/compiler/gap-resolver.h"
-#include "src/compiler/node-matchers.h"
-#include "src/compiler/osr.h"
-#include "src/frame-constants.h"
-#include "src/frames.h"
-#include "src/heap/heap-inl.h"
-#include "src/ia32/assembler-ia32.h"
-#include "src/ia32/macro-assembler-ia32.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-#define __ tasm()->
-
-#define kScratchDoubleReg xmm0
-
-
-// Adds IA-32 specific methods for decoding operands.
-class IA32OperandConverter : public InstructionOperandConverter {
- public:
-  IA32OperandConverter(CodeGenerator* gen, Instruction* instr)
-      : InstructionOperandConverter(gen, instr) {}
-
-  Operand InputOperand(size_t index, int extra = 0) {
-    return ToOperand(instr_->InputAt(index), extra);
-  }
-
-  Immediate InputImmediate(size_t index) {
-    return ToImmediate(instr_->InputAt(index));
-  }
-
-  Operand OutputOperand() { return ToOperand(instr_->Output()); }
-
-  Operand ToOperand(InstructionOperand* op, int extra = 0) {
-    if (op->IsRegister()) {
-      DCHECK_EQ(0, extra);
-      return Operand(ToRegister(op));
-    } else if (op->IsFPRegister()) {
-      DCHECK_EQ(0, extra);
-      return Operand(ToDoubleRegister(op));
-    }
-    DCHECK(op->IsStackSlot() || op->IsFPStackSlot());
-    return SlotToOperand(AllocatedOperand::cast(op)->index(), extra);
-  }
-
-  Operand SlotToOperand(int slot, int extra = 0) {
-    FrameOffset offset = frame_access_state()->GetFrameOffset(slot);
-    return Operand(offset.from_stack_pointer() ? esp : ebp,
-                   offset.offset() + extra);
-  }
-
-  Immediate ToImmediate(InstructionOperand* operand) {
-    Constant constant = ToConstant(operand);
-    if (constant.type() == Constant::kInt32 &&
-        RelocInfo::IsWasmReference(constant.rmode())) {
-      return Immediate(reinterpret_cast<Address>(constant.ToInt32()),
-                       constant.rmode());
-    }
-    switch (constant.type()) {
-      case Constant::kInt32:
-        return Immediate(constant.ToInt32());
-      case Constant::kFloat32:
-        return Immediate::EmbeddedNumber(constant.ToFloat32());
-      case Constant::kFloat64:
-        return Immediate::EmbeddedNumber(constant.ToFloat64().value());
-      case Constant::kExternalReference:
-        return Immediate(constant.ToExternalReference());
-      case Constant::kHeapObject:
-        return Immediate(constant.ToHeapObject());
-      case Constant::kInt64:
-        break;
-      case Constant::kRpoNumber:
-        return Immediate::CodeRelativeOffset(ToLabel(operand));
-    }
-    UNREACHABLE();
-  }
-
-  static size_t NextOffset(size_t* offset) {
-    size_t i = *offset;
-    (*offset)++;
-    return i;
-  }
-
-  static ScaleFactor ScaleFor(AddressingMode one, AddressingMode mode) {
-    STATIC_ASSERT(0 == static_cast<int>(times_1));
-    STATIC_ASSERT(1 == static_cast<int>(times_2));
-    STATIC_ASSERT(2 == static_cast<int>(times_4));
-    STATIC_ASSERT(3 == static_cast<int>(times_8));
-    int scale = static_cast<int>(mode - one);
-    DCHECK(scale >= 0 && scale < 4);
-    return static_cast<ScaleFactor>(scale);
-  }
-
-  Operand MemoryOperand(size_t* offset) {
-    AddressingMode mode = AddressingModeField::decode(instr_->opcode());
-    switch (mode) {
-      case kMode_MR: {
-        Register base = InputRegister(NextOffset(offset));
-        int32_t disp = 0;
-        return Operand(base, disp);
-      }
-      case kMode_MRI: {
-        Register base = InputRegister(NextOffset(offset));
-        Constant ctant = ToConstant(instr_->InputAt(NextOffset(offset)));
-        return Operand(base, ctant.ToInt32(), ctant.rmode());
-      }
-      case kMode_MR1:
-      case kMode_MR2:
-      case kMode_MR4:
-      case kMode_MR8: {
-        Register base = InputRegister(NextOffset(offset));
-        Register index = InputRegister(NextOffset(offset));
-        ScaleFactor scale = ScaleFor(kMode_MR1, mode);
-        int32_t disp = 0;
-        return Operand(base, index, scale, disp);
-      }
-      case kMode_MR1I:
-      case kMode_MR2I:
-      case kMode_MR4I:
-      case kMode_MR8I: {
-        Register base = InputRegister(NextOffset(offset));
-        Register index = InputRegister(NextOffset(offset));
-        ScaleFactor scale = ScaleFor(kMode_MR1I, mode);
-        Constant ctant = ToConstant(instr_->InputAt(NextOffset(offset)));
-        return Operand(base, index, scale, ctant.ToInt32(), ctant.rmode());
-      }
-      case kMode_M1:
-      case kMode_M2:
-      case kMode_M4:
-      case kMode_M8: {
-        Register index = InputRegister(NextOffset(offset));
-        ScaleFactor scale = ScaleFor(kMode_M1, mode);
-        int32_t disp = 0;
-        return Operand(index, scale, disp);
-      }
-      case kMode_M1I:
-      case kMode_M2I:
-      case kMode_M4I:
-      case kMode_M8I: {
-        Register index = InputRegister(NextOffset(offset));
-        ScaleFactor scale = ScaleFor(kMode_M1I, mode);
-        Constant ctant = ToConstant(instr_->InputAt(NextOffset(offset)));
-        return Operand(index, scale, ctant.ToInt32(), ctant.rmode());
-      }
-      case kMode_MI: {
-        Constant ctant = ToConstant(instr_->InputAt(NextOffset(offset)));
-        return Operand(ctant.ToInt32(), ctant.rmode());
-      }
-      case kMode_None:
-        UNREACHABLE();
-    }
-    UNREACHABLE();
-  }
-
-  Operand MemoryOperand(size_t first_input = 0) {
-    return MemoryOperand(&first_input);
-  }
-};
-
-
-namespace {
-
-bool HasImmediateInput(Instruction* instr, size_t index) {
-  return instr->InputAt(index)->IsImmediate();
-}
-
-class OutOfLineLoadFloat32NaN final : public OutOfLineCode {
- public:
-  OutOfLineLoadFloat32NaN(CodeGenerator* gen, XMMRegister result)
-      : OutOfLineCode(gen), result_(result) {}
-
-  void Generate() final {
-    __ xorps(result_, result_);
-    __ divss(result_, result_);
-  }
-
- private:
-  XMMRegister const result_;
-};
-
-class OutOfLineLoadFloat64NaN final : public OutOfLineCode {
- public:
-  OutOfLineLoadFloat64NaN(CodeGenerator* gen, XMMRegister result)
-      : OutOfLineCode(gen), result_(result) {}
-
-  void Generate() final {
-    __ xorpd(result_, result_);
-    __ divsd(result_, result_);
-  }
-
- private:
-  XMMRegister const result_;
-};
-
-class OutOfLineTruncateDoubleToI final : public OutOfLineCode {
- public:
-  OutOfLineTruncateDoubleToI(CodeGenerator* gen, Register result,
-                             XMMRegister input)
-      : OutOfLineCode(gen),
-        result_(result),
-        input_(input),
-        zone_(gen->zone()) {}
-
-  void Generate() final {
-    __ sub(esp, Immediate(kDoubleSize));
-    __ movsd(MemOperand(esp, 0), input_);
-    __ SlowTruncateToIDelayed(zone_, result_);
-    __ add(esp, Immediate(kDoubleSize));
-  }
-
- private:
-  Register const result_;
-  XMMRegister const input_;
-  Zone* zone_;
-};
-
-
-class OutOfLineRecordWrite final : public OutOfLineCode {
- public:
-  OutOfLineRecordWrite(CodeGenerator* gen, Register object, Operand operand,
-                       Register value, Register scratch0, Register scratch1,
-                       RecordWriteMode mode)
-      : OutOfLineCode(gen),
-        object_(object),
-        operand_(operand),
-        value_(value),
-        scratch0_(scratch0),
-        scratch1_(scratch1),
-        mode_(mode),
-        zone_(gen->zone()) {}
-
-  void SaveRegisters(RegList registers) {
-    DCHECK_LT(0, NumRegs(registers));
-    for (int i = 0; i < Register::kNumRegisters; ++i) {
-      if ((registers >> i) & 1u) {
-        __ push(Register::from_code(i));
-      }
-    }
-  }
-
-  void RestoreRegisters(RegList registers) {
-    DCHECK_LT(0, NumRegs(registers));
-    for (int i = Register::kNumRegisters - 1; i >= 0; --i) {
-      if ((registers >> i) & 1u) {
-        __ pop(Register::from_code(i));
-      }
-    }
-  }
-
-  void Generate() final {
-    if (mode_ > RecordWriteMode::kValueIsPointer) {
-      __ JumpIfSmi(value_, exit());
-    }
-    __ CheckPageFlag(value_, scratch0_,
-                     MemoryChunk::kPointersToHereAreInterestingMask, zero,
-                     exit());
-    __ lea(scratch1_, operand_);
-    RememberedSetAction const remembered_set_action =
-        mode_ > RecordWriteMode::kValueIsMap ? EMIT_REMEMBERED_SET
-                                             : OMIT_REMEMBERED_SET;
-    SaveFPRegsMode const save_fp_mode =
-        frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
-    __ CallRecordWriteStub(object_, scratch1_, remembered_set_action,
-                           save_fp_mode);
-  }
-
- private:
-  Register const object_;
-  Operand const operand_;
-  Register const value_;
-  Register const scratch0_;
-  Register const scratch1_;
-  RecordWriteMode const mode_;
-  Zone* zone_;
-};
-
-}  // namespace
-
-#define ASSEMBLE_COMPARE(asm_instr)                                   \
-  do {                                                                \
-    if (AddressingModeField::decode(instr->opcode()) != kMode_None) { \
-      size_t index = 0;                                               \
-      Operand left = i.MemoryOperand(&index);                         \
-      if (HasImmediateInput(instr, index)) {                          \
-        __ asm_instr(left, i.InputImmediate(index));                  \
-      } else {                                                        \
-        __ asm_instr(left, i.InputRegister(index));                   \
-      }                                                               \
-    } else {                                                          \
-      if (HasImmediateInput(instr, 1)) {                              \
-        if (instr->InputAt(0)->IsRegister()) {                        \
-          __ asm_instr(i.InputRegister(0), i.InputImmediate(1));      \
-        } else {                                                      \
-          __ asm_instr(i.InputOperand(0), i.InputImmediate(1));       \
-        }                                                             \
-      } else {                                                        \
-        if (instr->InputAt(1)->IsRegister()) {                        \
-          __ asm_instr(i.InputRegister(0), i.InputRegister(1));       \
-        } else {                                                      \
-          __ asm_instr(i.InputRegister(0), i.InputOperand(1));        \
-        }                                                             \
-      }                                                               \
-    }                                                                 \
-  } while (0)
-
-#define ASSEMBLE_IEEE754_BINOP(name)                                    \
-  do {                                                                  \
-    /* Pass two doubles as arguments on the stack. */                   \
-    __ PrepareCallCFunction(4, eax);                                    \
-    __ movsd(Operand(esp, 0 * kDoubleSize), i.InputDoubleRegister(0));  \
-    __ movsd(Operand(esp, 1 * kDoubleSize), i.InputDoubleRegister(1));  \
-    __ CallCFunction(                                                   \
-        ExternalReference::ieee754_##name##_function(__ isolate()), 4); \
-    /* Return value is in st(0) on ia32. */                             \
-    /* Store it into the result register. */                            \
-    __ sub(esp, Immediate(kDoubleSize));                                \
-    __ fstp_d(Operand(esp, 0));                                         \
-    __ movsd(i.OutputDoubleRegister(), Operand(esp, 0));                \
-    __ add(esp, Immediate(kDoubleSize));                                \
-  } while (false)
-
-#define ASSEMBLE_IEEE754_UNOP(name)                                     \
-  do {                                                                  \
-    /* Pass one double as argument on the stack. */                     \
-    __ PrepareCallCFunction(2, eax);                                    \
-    __ movsd(Operand(esp, 0 * kDoubleSize), i.InputDoubleRegister(0));  \
-    __ CallCFunction(                                                   \
-        ExternalReference::ieee754_##name##_function(__ isolate()), 2); \
-    /* Return value is in st(0) on ia32. */                             \
-    /* Store it into the result register. */                            \
-    __ sub(esp, Immediate(kDoubleSize));                                \
-    __ fstp_d(Operand(esp, 0));                                         \
-    __ movsd(i.OutputDoubleRegister(), Operand(esp, 0));                \
-    __ add(esp, Immediate(kDoubleSize));                                \
-  } while (false)
-
-#define ASSEMBLE_BINOP(asm_instr)                                     \
-  do {                                                                \
-    if (AddressingModeField::decode(instr->opcode()) != kMode_None) { \
-      size_t index = 1;                                               \
-      Operand right = i.MemoryOperand(&index);                        \
-      __ asm_instr(i.InputRegister(0), right);                        \
-    } else {                                                          \
-      if (HasImmediateInput(instr, 1)) {                              \
-        __ asm_instr(i.InputOperand(0), i.InputImmediate(1));         \
-      } else {                                                        \
-        __ asm_instr(i.InputRegister(0), i.InputOperand(1));          \
-      }                                                               \
-    }                                                                 \
-  } while (0)
-
-#define ASSEMBLE_ATOMIC_BINOP(bin_inst, mov_inst, cmpxchg_inst) \
-  do {                                                          \
-    Label binop;                                                \
-    __ bind(&binop);                                            \
-    __ mov_inst(eax, i.MemoryOperand(1));                       \
-    __ Move(i.TempRegister(0), eax);                            \
-    __ bin_inst(i.TempRegister(0), i.InputRegister(0));         \
-    __ lock();                                                  \
-    __ cmpxchg_inst(i.MemoryOperand(1), i.TempRegister(0));     \
-    __ j(not_equal, &binop);                                    \
-  } while (false)
-
-void CodeGenerator::AssembleDeconstructFrame() {
-  __ mov(esp, ebp);
-  __ pop(ebp);
-}
-
-void CodeGenerator::AssemblePrepareTailCall() {
-  if (frame_access_state()->has_frame()) {
-    __ mov(ebp, MemOperand(ebp, 0));
-  }
-  frame_access_state()->SetFrameAccessToSP();
-}
-
-void CodeGenerator::AssemblePopArgumentsAdaptorFrame(Register args_reg,
-                                                     Register, Register,
-                                                     Register) {
-  // There are not enough temp registers left on ia32 for a call instruction
-  // so we pick some scratch registers and save/restore them manually here.
-  int scratch_count = 3;
-  Register scratch1 = ebx;
-  Register scratch2 = ecx;
-  Register scratch3 = edx;
-  DCHECK(!AreAliased(args_reg, scratch1, scratch2, scratch3));
-  Label done;
-
-  // Check if current frame is an arguments adaptor frame.
-  __ cmp(Operand(ebp, StandardFrameConstants::kContextOffset),
-         Immediate(StackFrame::TypeToMarker(StackFrame::ARGUMENTS_ADAPTOR)));
-  __ j(not_equal, &done, Label::kNear);
-
-  __ push(scratch1);
-  __ push(scratch2);
-  __ push(scratch3);
-
-  // Load arguments count from current arguments adaptor frame (note, it
-  // does not include receiver).
-  Register caller_args_count_reg = scratch1;
-  __ mov(caller_args_count_reg,
-         Operand(ebp, ArgumentsAdaptorFrameConstants::kLengthOffset));
-  __ SmiUntag(caller_args_count_reg);
-
-  ParameterCount callee_args_count(args_reg);
-  __ PrepareForTailCall(callee_args_count, caller_args_count_reg, scratch2,
-                        scratch3, scratch_count);
-  __ pop(scratch3);
-  __ pop(scratch2);
-  __ pop(scratch1);
-
-  __ bind(&done);
-}
-
-namespace {
-
-void AdjustStackPointerForTailCall(TurboAssembler* tasm,
-                                   FrameAccessState* state,
-                                   int new_slot_above_sp,
-                                   bool allow_shrinkage = true) {
-  int current_sp_offset = state->GetSPToFPSlotCount() +
-                          StandardFrameConstants::kFixedSlotCountAboveFp;
-  int stack_slot_delta = new_slot_above_sp - current_sp_offset;
-  if (stack_slot_delta > 0) {
-    tasm->sub(esp, Immediate(stack_slot_delta * kPointerSize));
-    state->IncreaseSPDelta(stack_slot_delta);
-  } else if (allow_shrinkage && stack_slot_delta < 0) {
-    tasm->add(esp, Immediate(-stack_slot_delta * kPointerSize));
-    state->IncreaseSPDelta(stack_slot_delta);
-  }
-}
-
-}  // namespace
-
-void CodeGenerator::AssembleTailCallBeforeGap(Instruction* instr,
-                                              int first_unused_stack_slot) {
-  CodeGenerator::PushTypeFlags flags(kImmediatePush | kScalarPush);
-  ZoneVector<MoveOperands*> pushes(zone());
-  GetPushCompatibleMoves(instr, flags, &pushes);
-
-  if (!pushes.empty() &&
-      (LocationOperand::cast(pushes.back()->destination()).index() + 1 ==
-       first_unused_stack_slot)) {
-    IA32OperandConverter g(this, instr);
-    for (auto move : pushes) {
-      LocationOperand destination_location(
-          LocationOperand::cast(move->destination()));
-      InstructionOperand source(move->source());
-      AdjustStackPointerForTailCall(tasm(), frame_access_state(),
-                                    destination_location.index());
-      if (source.IsStackSlot()) {
-        LocationOperand source_location(LocationOperand::cast(source));
-        __ push(g.SlotToOperand(source_location.index()));
-      } else if (source.IsRegister()) {
-        LocationOperand source_location(LocationOperand::cast(source));
-        __ push(source_location.GetRegister());
-      } else if (source.IsImmediate()) {
-        __ push(Immediate(ImmediateOperand::cast(source).inline_value()));
-      } else {
-        // Pushes of non-scalar data types is not supported.
-        UNIMPLEMENTED();
-      }
-      frame_access_state()->IncreaseSPDelta(1);
-      move->Eliminate();
-    }
-  }
-  AdjustStackPointerForTailCall(tasm(), frame_access_state(),
-                                first_unused_stack_slot, false);
-}
-
-void CodeGenerator::AssembleTailCallAfterGap(Instruction* instr,
-                                             int first_unused_stack_slot) {
-  AdjustStackPointerForTailCall(tasm(), frame_access_state(),
-                                first_unused_stack_slot);
-}
-
-// Check if the code object is marked for deoptimization. If it is, then it
-// jumps to the CompileLazyDeoptimizedCode builtin. In order to do this we need
-// to:
-//    1. load the address of the current instruction;
-//    2. read from memory the word that contains that bit, which can be found in
-//       the flags in the referenced {CodeDataContainer} object;
-//    3. test kMarkedForDeoptimizationBit in those flags; and
-//    4. if it is not zero then it jumps to the builtin.
-void CodeGenerator::BailoutIfDeoptimized() {
-  Label current;
-  __ call(&current);
-  int pc = __ pc_offset();
-  __ bind(&current);
-  // In order to get the address of the current instruction, we first need
-  // to use a call and then use a pop, thus pushing the return address to
-  // the stack and then popping it into the register.
-  __ pop(ecx);
-  int offset = Code::kCodeDataContainerOffset - (Code::kHeaderSize + pc);
-  __ mov(ecx, Operand(ecx, offset));
-  __ test(FieldOperand(ecx, CodeDataContainer::kKindSpecificFlagsOffset),
-          Immediate(1 << Code::kMarkedForDeoptimizationBit));
-  Handle<Code> code = isolate()->builtins()->builtin_handle(
-      Builtins::kCompileLazyDeoptimizedCode);
-  __ j(not_zero, code, RelocInfo::CODE_TARGET);
-}
-
-// Assembles an instruction after register allocation, producing machine code.
-CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
-    Instruction* instr) {
-  IA32OperandConverter i(this, instr);
-  InstructionCode opcode = instr->opcode();
-  ArchOpcode arch_opcode = ArchOpcodeField::decode(opcode);
-  switch (arch_opcode) {
-    case kArchCallCodeObject: {
-      if (HasImmediateInput(instr, 0)) {
-        Handle<Code> code = i.InputCode(0);
-        __ call(code, RelocInfo::CODE_TARGET);
-      } else {
-        Register reg = i.InputRegister(0);
-        __ add(reg, Immediate(Code::kHeaderSize - kHeapObjectTag));
-        __ call(reg);
-      }
-      RecordCallPosition(instr);
-      frame_access_state()->ClearSPDelta();
-      break;
-    }
-    case kArchCallWasmFunction: {
-      if (HasImmediateInput(instr, 0)) {
-        Address wasm_code = reinterpret_cast<Address>(
-            i.ToConstant(instr->InputAt(0)).ToInt32());
-        if (info()->IsWasm()) {
-          __ wasm_call(wasm_code, RelocInfo::WASM_CALL);
-        } else {
-          __ call(wasm_code, RelocInfo::JS_TO_WASM_CALL);
-        }
-      } else {
-        Register reg = i.InputRegister(0);
-        __ call(reg);
-      }
-      RecordCallPosition(instr);
-      frame_access_state()->ClearSPDelta();
-      break;
-    }
-    case kArchTailCallCodeObjectFromJSFunction:
-    case kArchTailCallCodeObject: {
-      if (arch_opcode == kArchTailCallCodeObjectFromJSFunction) {
-        AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister,
-                                         no_reg, no_reg, no_reg);
-      }
-      if (HasImmediateInput(instr, 0)) {
-        Handle<Code> code = i.InputCode(0);
-        __ jmp(code, RelocInfo::CODE_TARGET);
-      } else {
-        Register reg = i.InputRegister(0);
-        __ add(reg, Immediate(Code::kHeaderSize - kHeapObjectTag));
-        __ jmp(reg);
-      }
-      frame_access_state()->ClearSPDelta();
-      frame_access_state()->SetFrameAccessToDefault();
-      break;
-    }
-    case kArchTailCallWasm: {
-      if (HasImmediateInput(instr, 0)) {
-        Address wasm_code = reinterpret_cast<Address>(
-            i.ToConstant(instr->InputAt(0)).ToInt32());
-        if (info()->IsWasm()) {
-          __ jmp(wasm_code, RelocInfo::WASM_CALL);
-        } else {
-          __ jmp(wasm_code, RelocInfo::JS_TO_WASM_CALL);
-        }
-      } else {
-        Register reg = i.InputRegister(0);
-        __ jmp(reg);
-      }
-      frame_access_state()->ClearSPDelta();
-      frame_access_state()->SetFrameAccessToDefault();
-      break;
-    }
-    case kArchTailCallAddress: {
-      CHECK(!HasImmediateInput(instr, 0));
-      Register reg = i.InputRegister(0);
-      __ jmp(reg);
-      frame_access_state()->ClearSPDelta();
-      frame_access_state()->SetFrameAccessToDefault();
-      break;
-    }
-    case kArchCallJSFunction: {
-      Register func = i.InputRegister(0);
-      if (FLAG_debug_code) {
-        // Check the function's context matches the context argument.
-        __ cmp(esi, FieldOperand(func, JSFunction::kContextOffset));
-        __ Assert(equal, AbortReason::kWrongFunctionContext);
-      }
-      __ mov(ecx, FieldOperand(func, JSFunction::kCodeOffset));
-      __ add(ecx, Immediate(Code::kHeaderSize - kHeapObjectTag));
-      __ call(ecx);
-      RecordCallPosition(instr);
-      frame_access_state()->ClearSPDelta();
-      break;
-    }
-    case kArchPrepareCallCFunction: {
-      // Frame alignment requires using FP-relative frame addressing.
-      frame_access_state()->SetFrameAccessToFP();
-      int const num_parameters = MiscField::decode(instr->opcode());
-      __ PrepareCallCFunction(num_parameters, i.TempRegister(0));
-      break;
-    }
-    case kArchSaveCallerRegisters: {
-      fp_mode_ =
-          static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode()));
-      DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
-      // kReturnRegister0 should have been saved before entering the stub.
-      int bytes = __ PushCallerSaved(fp_mode_, kReturnRegister0);
-      DCHECK_EQ(0, bytes % kPointerSize);
-      DCHECK_EQ(0, frame_access_state()->sp_delta());
-      frame_access_state()->IncreaseSPDelta(bytes / kPointerSize);
-      DCHECK(!caller_registers_saved_);
-      caller_registers_saved_ = true;
-      break;
-    }
-    case kArchRestoreCallerRegisters: {
-      DCHECK(fp_mode_ ==
-             static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode())));
-      DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
-      // Don't overwrite the returned value.
-      int bytes = __ PopCallerSaved(fp_mode_, kReturnRegister0);
-      frame_access_state()->IncreaseSPDelta(-(bytes / kPointerSize));
-      DCHECK_EQ(0, frame_access_state()->sp_delta());
-      DCHECK(caller_registers_saved_);
-      caller_registers_saved_ = false;
-      break;
-    }
-    case kArchPrepareTailCall:
-      AssemblePrepareTailCall();
-      break;
-    case kArchCallCFunction: {
-      int const num_parameters = MiscField::decode(instr->opcode());
-      if (HasImmediateInput(instr, 0)) {
-        ExternalReference ref = i.InputExternalReference(0);
-        __ CallCFunction(ref, num_parameters);
-      } else {
-        Register func = i.InputRegister(0);
-        __ CallCFunction(func, num_parameters);
-      }
-      frame_access_state()->SetFrameAccessToDefault();
-      // Ideally, we should decrement SP delta to match the change of stack
-      // pointer in CallCFunction. However, for certain architectures (e.g.
-      // ARM), there may be more strict alignment requirement, causing old SP
-      // to be saved on the stack. In those cases, we can not calculate the SP
-      // delta statically.
-      frame_access_state()->ClearSPDelta();
-      if (caller_registers_saved_) {
-        // Need to re-sync SP delta introduced in kArchSaveCallerRegisters.
-        // Here, we assume the sequence to be:
-        //   kArchSaveCallerRegisters;
-        //   kArchCallCFunction;
-        //   kArchRestoreCallerRegisters;
-        int bytes =
-            __ RequiredStackSizeForCallerSaved(fp_mode_, kReturnRegister0);
-        frame_access_state()->IncreaseSPDelta(bytes / kPointerSize);
-      }
-      break;
-    }
-    case kArchJmp:
-      AssembleArchJump(i.InputRpo(0));
-      break;
-    case kArchLookupSwitch:
-      AssembleArchLookupSwitch(instr);
-      break;
-    case kArchTableSwitch:
-      AssembleArchTableSwitch(instr);
-      break;
-    case kArchComment: {
-      Address comment_string = i.InputExternalReference(0).address();
-      __ RecordComment(reinterpret_cast<const char*>(comment_string));
-      break;
-    }
-    case kArchDebugAbort:
-      DCHECK(i.InputRegister(0) == edx);
-      if (!frame_access_state()->has_frame()) {
-        // We don't actually want to generate a pile of code for this, so just
-        // claim there is a stack frame, without generating one.
-        FrameScope scope(tasm(), StackFrame::NONE);
-        __ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
-                RelocInfo::CODE_TARGET);
-      } else {
-        __ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
-                RelocInfo::CODE_TARGET);
-      }
-      __ int3();
-      break;
-    case kArchDebugBreak:
-      __ int3();
-      break;
-    case kArchNop:
-    case kArchThrowTerminator:
-      // don't emit code for nops.
-      break;
-    case kArchDeoptimize: {
-      int deopt_state_id =
-          BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore());
-      CodeGenResult result =
-          AssembleDeoptimizerCall(deopt_state_id, current_source_position_);
-      if (result != kSuccess) return result;
-      break;
-    }
-    case kArchRet:
-      AssembleReturn(instr->InputAt(0));
-      break;
-    case kArchStackPointer:
-      __ mov(i.OutputRegister(), esp);
-      break;
-    case kArchFramePointer:
-      __ mov(i.OutputRegister(), ebp);
-      break;
-    case kArchParentFramePointer:
-      if (frame_access_state()->has_frame()) {
-        __ mov(i.OutputRegister(), Operand(ebp, 0));
-      } else {
-        __ mov(i.OutputRegister(), ebp);
-      }
-      break;
-    case kArchTruncateDoubleToI: {
-      auto result = i.OutputRegister();
-      auto input = i.InputDoubleRegister(0);
-      auto ool = new (zone()) OutOfLineTruncateDoubleToI(this, result, input);
-      __ cvttsd2si(result, Operand(input));
-      __ cmp(result, 1);
-      __ j(overflow, ool->entry());
-      __ bind(ool->exit());
-      break;
-    }
-    case kArchStoreWithWriteBarrier: {
-      RecordWriteMode mode =
-          static_cast<RecordWriteMode>(MiscField::decode(instr->opcode()));
-      Register object = i.InputRegister(0);
-      size_t index = 0;
-      Operand operand = i.MemoryOperand(&index);
-      Register value = i.InputRegister(index);
-      Register scratch0 = i.TempRegister(0);
-      Register scratch1 = i.TempRegister(1);
-      auto ool = new (zone()) OutOfLineRecordWrite(this, object, operand, value,
-                                                   scratch0, scratch1, mode);
-      __ mov(operand, value);
-      __ CheckPageFlag(object, scratch0,
-                       MemoryChunk::kPointersFromHereAreInterestingMask,
-                       not_zero, ool->entry());
-      __ bind(ool->exit());
-      break;
-    }
-    case kArchStackSlot: {
-      FrameOffset offset =
-          frame_access_state()->GetFrameOffset(i.InputInt32(0));
-      Register base = offset.from_stack_pointer() ? esp : ebp;
-      __ lea(i.OutputRegister(), Operand(base, offset.offset()));
-      break;
-    }
-    case kIeee754Float64Acos:
-      ASSEMBLE_IEEE754_UNOP(acos);
-      break;
-    case kIeee754Float64Acosh:
-      ASSEMBLE_IEEE754_UNOP(acosh);
-      break;
-    case kIeee754Float64Asin:
-      ASSEMBLE_IEEE754_UNOP(asin);
-      break;
-    case kIeee754Float64Asinh:
-      ASSEMBLE_IEEE754_UNOP(asinh);
-      break;
-    case kIeee754Float64Atan:
-      ASSEMBLE_IEEE754_UNOP(atan);
-      break;
-    case kIeee754Float64Atanh:
-      ASSEMBLE_IEEE754_UNOP(atanh);
-      break;
-    case kIeee754Float64Atan2:
-      ASSEMBLE_IEEE754_BINOP(atan2);
-      break;
-    case kIeee754Float64Cbrt:
-      ASSEMBLE_IEEE754_UNOP(cbrt);
-      break;
-    case kIeee754Float64Cos:
-      ASSEMBLE_IEEE754_UNOP(cos);
-      break;
-    case kIeee754Float64Cosh:
-      ASSEMBLE_IEEE754_UNOP(cosh);
-      break;
-    case kIeee754Float64Expm1:
-      ASSEMBLE_IEEE754_UNOP(expm1);
-      break;
-    case kIeee754Float64Exp:
-      ASSEMBLE_IEEE754_UNOP(exp);
-      break;
-    case kIeee754Float64Log:
-      ASSEMBLE_IEEE754_UNOP(log);
-      break;
-    case kIeee754Float64Log1p:
-      ASSEMBLE_IEEE754_UNOP(log1p);
-      break;
-    case kIeee754Float64Log2:
-      ASSEMBLE_IEEE754_UNOP(log2);
-      break;
-    case kIeee754Float64Log10:
-      ASSEMBLE_IEEE754_UNOP(log10);
-      break;
-    case kIeee754Float64Pow: {
-      // TODO(bmeurer): Improve integration of the stub.
-      if (i.InputDoubleRegister(1) != xmm2) {
-        __ movaps(xmm2, i.InputDoubleRegister(0));
-        __ movaps(xmm1, i.InputDoubleRegister(1));
-      } else {
-        __ movaps(xmm0, i.InputDoubleRegister(0));
-        __ movaps(xmm1, xmm2);
-        __ movaps(xmm2, xmm0);
-      }
-      __ CallStubDelayed(new (zone())
-                             MathPowStub(nullptr, MathPowStub::DOUBLE));
-      __ movaps(i.OutputDoubleRegister(), xmm3);
-      break;
-    }
-    case kIeee754Float64Sin:
-      ASSEMBLE_IEEE754_UNOP(sin);
-      break;
-    case kIeee754Float64Sinh:
-      ASSEMBLE_IEEE754_UNOP(sinh);
-      break;
-    case kIeee754Float64Tan:
-      ASSEMBLE_IEEE754_UNOP(tan);
-      break;
-    case kIeee754Float64Tanh:
-      ASSEMBLE_IEEE754_UNOP(tanh);
-      break;
-    case kIA32Add:
-      ASSEMBLE_BINOP(add);
-      break;
-    case kIA32And:
-      ASSEMBLE_BINOP(and_);
-      break;
-    case kIA32Cmp:
-      ASSEMBLE_COMPARE(cmp);
-      break;
-    case kIA32Cmp16:
-      ASSEMBLE_COMPARE(cmpw);
-      break;
-    case kIA32Cmp8:
-      ASSEMBLE_COMPARE(cmpb);
-      break;
-    case kIA32Test:
-      ASSEMBLE_COMPARE(test);
-      break;
-    case kIA32Test16:
-      ASSEMBLE_COMPARE(test_w);
-      break;
-    case kIA32Test8:
-      ASSEMBLE_COMPARE(test_b);
-      break;
-    case kIA32Imul:
-      if (HasImmediateInput(instr, 1)) {
-        __ imul(i.OutputRegister(), i.InputOperand(0), i.InputInt32(1));
-      } else {
-        __ imul(i.OutputRegister(), i.InputOperand(1));
-      }
-      break;
-    case kIA32ImulHigh:
-      __ imul(i.InputRegister(1));
-      break;
-    case kIA32UmulHigh:
-      __ mul(i.InputRegister(1));
-      break;
-    case kIA32Idiv:
-      __ cdq();
-      __ idiv(i.InputOperand(1));
-      break;
-    case kIA32Udiv:
-      __ Move(edx, Immediate(0));
-      __ div(i.InputOperand(1));
-      break;
-    case kIA32Not:
-      __ not_(i.OutputOperand());
-      break;
-    case kIA32Neg:
-      __ neg(i.OutputOperand());
-      break;
-    case kIA32Or:
-      ASSEMBLE_BINOP(or_);
-      break;
-    case kIA32Xor:
-      ASSEMBLE_BINOP(xor_);
-      break;
-    case kIA32Sub:
-      ASSEMBLE_BINOP(sub);
-      break;
-    case kIA32Shl:
-      if (HasImmediateInput(instr, 1)) {
-        __ shl(i.OutputOperand(), i.InputInt5(1));
-      } else {
-        __ shl_cl(i.OutputOperand());
-      }
-      break;
-    case kIA32Shr:
-      if (HasImmediateInput(instr, 1)) {
-        __ shr(i.OutputOperand(), i.InputInt5(1));
-      } else {
-        __ shr_cl(i.OutputOperand());
-      }
-      break;
-    case kIA32Sar:
-      if (HasImmediateInput(instr, 1)) {
-        __ sar(i.OutputOperand(), i.InputInt5(1));
-      } else {
-        __ sar_cl(i.OutputOperand());
-      }
-      break;
-    case kIA32AddPair: {
-      // i.OutputRegister(0) == i.InputRegister(0) ... left low word.
-      // i.InputRegister(1) ... left high word.
-      // i.InputRegister(2) ... right low word.
-      // i.InputRegister(3) ... right high word.
-      bool use_temp = false;
-      if (i.OutputRegister(0).code() == i.InputRegister(1).code() ||
-          i.OutputRegister(0).code() == i.InputRegister(3).code()) {
-        // We cannot write to the output register directly, because it would
-        // overwrite an input for adc. We have to use the temp register.
-        use_temp = true;
-        __ Move(i.TempRegister(0), i.InputRegister(0));
-        __ add(i.TempRegister(0), i.InputRegister(2));
-      } else {
-        __ add(i.OutputRegister(0), i.InputRegister(2));
-      }
-      if (i.OutputRegister(1).code() != i.InputRegister(1).code()) {
-        __ Move(i.OutputRegister(1), i.InputRegister(1));
-      }
-      __ adc(i.OutputRegister(1), Operand(i.InputRegister(3)));
-      if (use_temp) {
-        __ Move(i.OutputRegister(0), i.TempRegister(0));
-      }
-      break;
-    }
-    case kIA32SubPair: {
-      // i.OutputRegister(0) == i.InputRegister(0) ... left low word.
-      // i.InputRegister(1) ... left high word.
-      // i.InputRegister(2) ... right low word.
-      // i.InputRegister(3) ... right high word.
-      bool use_temp = false;
-      if (i.OutputRegister(0).code() == i.InputRegister(1).code() ||
-          i.OutputRegister(0).code() == i.InputRegister(3).code()) {
-        // We cannot write to the output register directly, because it would
-        // overwrite an input for adc. We have to use the temp register.
-        use_temp = true;
-        __ Move(i.TempRegister(0), i.InputRegister(0));
-        __ sub(i.TempRegister(0), i.InputRegister(2));
-      } else {
-        __ sub(i.OutputRegister(0), i.InputRegister(2));
-      }
-      if (i.OutputRegister(1).code() != i.InputRegister(1).code()) {
-        __ Move(i.OutputRegister(1), i.InputRegister(1));
-      }
-      __ sbb(i.OutputRegister(1), Operand(i.InputRegister(3)));
-      if (use_temp) {
-        __ Move(i.OutputRegister(0), i.TempRegister(0));
-      }
-      break;
-    }
-    case kIA32MulPair: {
-      __ imul(i.OutputRegister(1), i.InputOperand(0));
-      __ mov(i.TempRegister(0), i.InputOperand(1));
-      __ imul(i.TempRegister(0), i.InputOperand(2));
-      __ add(i.OutputRegister(1), i.TempRegister(0));
-      __ mov(i.OutputRegister(0), i.InputOperand(0));
-      // Multiplies the low words and stores them in eax and edx.
-      __ mul(i.InputRegister(2));
-      __ add(i.OutputRegister(1), i.TempRegister(0));
-
-      break;
-    }
-    case kIA32ShlPair:
-      if (HasImmediateInput(instr, 2)) {
-        __ ShlPair(i.InputRegister(1), i.InputRegister(0), i.InputInt6(2));
-      } else {
-        // Shift has been loaded into CL by the register allocator.
-        __ ShlPair_cl(i.InputRegister(1), i.InputRegister(0));
-      }
-      break;
-    case kIA32ShrPair:
-      if (HasImmediateInput(instr, 2)) {
-        __ ShrPair(i.InputRegister(1), i.InputRegister(0), i.InputInt6(2));
-      } else {
-        // Shift has been loaded into CL by the register allocator.
-        __ ShrPair_cl(i.InputRegister(1), i.InputRegister(0));
-      }
-      break;
-    case kIA32SarPair:
-      if (HasImmediateInput(instr, 2)) {
-        __ SarPair(i.InputRegister(1), i.InputRegister(0), i.InputInt6(2));
-      } else {
-        // Shift has been loaded into CL by the register allocator.
-        __ SarPair_cl(i.InputRegister(1), i.InputRegister(0));
-      }
-      break;
-    case kIA32Ror:
-      if (HasImmediateInput(instr, 1)) {
-        __ ror(i.OutputOperand(), i.InputInt5(1));
-      } else {
-        __ ror_cl(i.OutputOperand());
-      }
-      break;
-    case kIA32Lzcnt:
-      __ Lzcnt(i.OutputRegister(), i.InputOperand(0));
-      break;
-    case kIA32Tzcnt:
-      __ Tzcnt(i.OutputRegister(), i.InputOperand(0));
-      break;
-    case kIA32Popcnt:
-      __ Popcnt(i.OutputRegister(), i.InputOperand(0));
-      break;
-    case kLFence:
-      __ lfence();
-      break;
-    case kSSEFloat32Cmp:
-      __ ucomiss(i.InputDoubleRegister(0), i.InputOperand(1));
-      break;
-    case kSSEFloat32Add:
-      __ addss(i.InputDoubleRegister(0), i.InputOperand(1));
-      break;
-    case kSSEFloat32Sub:
-      __ subss(i.InputDoubleRegister(0), i.InputOperand(1));
-      break;
-    case kSSEFloat32Mul:
-      __ mulss(i.InputDoubleRegister(0), i.InputOperand(1));
-      break;
-    case kSSEFloat32Div:
-      __ divss(i.InputDoubleRegister(0), i.InputOperand(1));
-      // Don't delete this mov. It may improve performance on some CPUs,
-      // when there is a (v)mulss depending on the result.
-      __ movaps(i.OutputDoubleRegister(), i.OutputDoubleRegister());
-      break;
-    case kSSEFloat32Sqrt:
-      __ sqrtss(i.OutputDoubleRegister(), i.InputOperand(0));
-      break;
-    case kSSEFloat32Abs: {
-      // TODO(bmeurer): Use 128-bit constants.
-      __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
-      __ psrlq(kScratchDoubleReg, 33);
-      __ andps(i.OutputDoubleRegister(), kScratchDoubleReg);
-      break;
-    }
-    case kSSEFloat32Neg: {
-      // TODO(bmeurer): Use 128-bit constants.
-      __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
-      __ psllq(kScratchDoubleReg, 31);
-      __ xorps(i.OutputDoubleRegister(), kScratchDoubleReg);
-      break;
-    }
-    case kSSEFloat32Round: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      RoundingMode const mode =
-          static_cast<RoundingMode>(MiscField::decode(instr->opcode()));
-      __ roundss(i.OutputDoubleRegister(), i.InputDoubleRegister(0), mode);
-      break;
-    }
-    case kSSEFloat64Cmp:
-      __ ucomisd(i.InputDoubleRegister(0), i.InputOperand(1));
-      break;
-    case kSSEFloat64Add:
-      __ addsd(i.InputDoubleRegister(0), i.InputOperand(1));
-      break;
-    case kSSEFloat64Sub:
-      __ subsd(i.InputDoubleRegister(0), i.InputOperand(1));
-      break;
-    case kSSEFloat64Mul:
-      __ mulsd(i.InputDoubleRegister(0), i.InputOperand(1));
-      break;
-    case kSSEFloat64Div:
-      __ divsd(i.InputDoubleRegister(0), i.InputOperand(1));
-      // Don't delete this mov. It may improve performance on some CPUs,
-      // when there is a (v)mulsd depending on the result.
-      __ movaps(i.OutputDoubleRegister(), i.OutputDoubleRegister());
-      break;
-    case kSSEFloat32Max: {
-      Label compare_nan, compare_swap, done_compare;
-      if (instr->InputAt(1)->IsFPRegister()) {
-        __ ucomiss(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
-      } else {
-        __ ucomiss(i.InputDoubleRegister(0), i.InputOperand(1));
-      }
-      auto ool =
-          new (zone()) OutOfLineLoadFloat32NaN(this, i.OutputDoubleRegister());
-      __ j(parity_even, ool->entry());
-      __ j(above, &done_compare, Label::kNear);
-      __ j(below, &compare_swap, Label::kNear);
-      __ movmskps(i.TempRegister(0), i.InputDoubleRegister(0));
-      __ test(i.TempRegister(0), Immediate(1));
-      __ j(zero, &done_compare, Label::kNear);
-      __ bind(&compare_swap);
-      if (instr->InputAt(1)->IsFPRegister()) {
-        __ movss(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
-      } else {
-        __ movss(i.InputDoubleRegister(0), i.InputOperand(1));
-      }
-      __ bind(&done_compare);
-      __ bind(ool->exit());
-      break;
-    }
-
-    case kSSEFloat64Max: {
-      Label compare_nan, compare_swap, done_compare;
-      if (instr->InputAt(1)->IsFPRegister()) {
-        __ ucomisd(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
-      } else {
-        __ ucomisd(i.InputDoubleRegister(0), i.InputOperand(1));
-      }
-      auto ool =
-          new (zone()) OutOfLineLoadFloat64NaN(this, i.OutputDoubleRegister());
-      __ j(parity_even, ool->entry());
-      __ j(above, &done_compare, Label::kNear);
-      __ j(below, &compare_swap, Label::kNear);
-      __ movmskpd(i.TempRegister(0), i.InputDoubleRegister(0));
-      __ test(i.TempRegister(0), Immediate(1));
-      __ j(zero, &done_compare, Label::kNear);
-      __ bind(&compare_swap);
-      if (instr->InputAt(1)->IsFPRegister()) {
-        __ movsd(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
-      } else {
-        __ movsd(i.InputDoubleRegister(0), i.InputOperand(1));
-      }
-      __ bind(&done_compare);
-      __ bind(ool->exit());
-      break;
-    }
-    case kSSEFloat32Min: {
-      Label compare_swap, done_compare;
-      if (instr->InputAt(1)->IsFPRegister()) {
-        __ ucomiss(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
-      } else {
-        __ ucomiss(i.InputDoubleRegister(0), i.InputOperand(1));
-      }
-      auto ool =
-          new (zone()) OutOfLineLoadFloat32NaN(this, i.OutputDoubleRegister());
-      __ j(parity_even, ool->entry());
-      __ j(below, &done_compare, Label::kNear);
-      __ j(above, &compare_swap, Label::kNear);
-      if (instr->InputAt(1)->IsFPRegister()) {
-        __ movmskps(i.TempRegister(0), i.InputDoubleRegister(1));
-      } else {
-        __ movss(kScratchDoubleReg, i.InputOperand(1));
-        __ movmskps(i.TempRegister(0), kScratchDoubleReg);
-      }
-      __ test(i.TempRegister(0), Immediate(1));
-      __ j(zero, &done_compare, Label::kNear);
-      __ bind(&compare_swap);
-      if (instr->InputAt(1)->IsFPRegister()) {
-        __ movss(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
-      } else {
-        __ movss(i.InputDoubleRegister(0), i.InputOperand(1));
-      }
-      __ bind(&done_compare);
-      __ bind(ool->exit());
-      break;
-    }
-    case kSSEFloat64Min: {
-      Label compare_swap, done_compare;
-      if (instr->InputAt(1)->IsFPRegister()) {
-        __ ucomisd(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
-      } else {
-        __ ucomisd(i.InputDoubleRegister(0), i.InputOperand(1));
-      }
-      auto ool =
-          new (zone()) OutOfLineLoadFloat64NaN(this, i.OutputDoubleRegister());
-      __ j(parity_even, ool->entry());
-      __ j(below, &done_compare, Label::kNear);
-      __ j(above, &compare_swap, Label::kNear);
-      if (instr->InputAt(1)->IsFPRegister()) {
-        __ movmskpd(i.TempRegister(0), i.InputDoubleRegister(1));
-      } else {
-        __ movsd(kScratchDoubleReg, i.InputOperand(1));
-        __ movmskpd(i.TempRegister(0), kScratchDoubleReg);
-      }
-      __ test(i.TempRegister(0), Immediate(1));
-      __ j(zero, &done_compare, Label::kNear);
-      __ bind(&compare_swap);
-      if (instr->InputAt(1)->IsFPRegister()) {
-        __ movsd(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
-      } else {
-        __ movsd(i.InputDoubleRegister(0), i.InputOperand(1));
-      }
-      __ bind(&done_compare);
-      __ bind(ool->exit());
-      break;
-    }
-    case kSSEFloat64Mod: {
-      // TODO(dcarney): alignment is wrong.
-      __ sub(esp, Immediate(kDoubleSize));
-      // Move values to st(0) and st(1).
-      __ movsd(Operand(esp, 0), i.InputDoubleRegister(1));
-      __ fld_d(Operand(esp, 0));
-      __ movsd(Operand(esp, 0), i.InputDoubleRegister(0));
-      __ fld_d(Operand(esp, 0));
-      // Loop while fprem isn't done.
-      Label mod_loop;
-      __ bind(&mod_loop);
-      // This instructions traps on all kinds inputs, but we are assuming the
-      // floating point control word is set to ignore them all.
-      __ fprem();
-      // The following 2 instruction implicitly use eax.
-      __ fnstsw_ax();
-      __ sahf();
-      __ j(parity_even, &mod_loop);
-      // Move output to stack and clean up.
-      __ fstp(1);
-      __ fstp_d(Operand(esp, 0));
-      __ movsd(i.OutputDoubleRegister(), Operand(esp, 0));
-      __ add(esp, Immediate(kDoubleSize));
-      break;
-    }
-    case kSSEFloat64Abs: {
-      // TODO(bmeurer): Use 128-bit constants.
-      __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
-      __ psrlq(kScratchDoubleReg, 1);
-      __ andpd(i.OutputDoubleRegister(), kScratchDoubleReg);
-      break;
-    }
-    case kSSEFloat64Neg: {
-      // TODO(bmeurer): Use 128-bit constants.
-      __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
-      __ psllq(kScratchDoubleReg, 63);
-      __ xorpd(i.OutputDoubleRegister(), kScratchDoubleReg);
-      break;
-    }
-    case kSSEFloat64Sqrt:
-      __ sqrtsd(i.OutputDoubleRegister(), i.InputOperand(0));
-      break;
-    case kSSEFloat64Round: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      RoundingMode const mode =
-          static_cast<RoundingMode>(MiscField::decode(instr->opcode()));
-      __ roundsd(i.OutputDoubleRegister(), i.InputDoubleRegister(0), mode);
-      break;
-    }
-    case kSSEFloat32ToFloat64:
-      __ cvtss2sd(i.OutputDoubleRegister(), i.InputOperand(0));
-      break;
-    case kSSEFloat64ToFloat32:
-      __ cvtsd2ss(i.OutputDoubleRegister(), i.InputOperand(0));
-      break;
-    case kSSEFloat32ToInt32:
-      __ cvttss2si(i.OutputRegister(), i.InputOperand(0));
-      break;
-    case kSSEFloat32ToUint32: {
-      Label success;
-      __ cvttss2si(i.OutputRegister(), i.InputOperand(0));
-      __ test(i.OutputRegister(), i.OutputRegister());
-      __ j(positive, &success);
-      __ Move(kScratchDoubleReg, static_cast<float>(INT32_MIN));
-      __ addss(kScratchDoubleReg, i.InputOperand(0));
-      __ cvttss2si(i.OutputRegister(), kScratchDoubleReg);
-      __ or_(i.OutputRegister(), Immediate(0x80000000));
-      __ bind(&success);
-      break;
-    }
-    case kSSEFloat64ToInt32:
-      __ cvttsd2si(i.OutputRegister(), i.InputOperand(0));
-      break;
-    case kSSEFloat64ToUint32: {
-      __ Move(kScratchDoubleReg, -2147483648.0);
-      __ addsd(kScratchDoubleReg, i.InputOperand(0));
-      __ cvttsd2si(i.OutputRegister(), kScratchDoubleReg);
-      __ add(i.OutputRegister(), Immediate(0x80000000));
-      break;
-    }
-    case kSSEInt32ToFloat32:
-      __ cvtsi2ss(i.OutputDoubleRegister(), i.InputOperand(0));
-      break;
-    case kSSEUint32ToFloat32: {
-      Register scratch0 = i.TempRegister(0);
-      Register scratch1 = i.TempRegister(1);
-      __ mov(scratch0, i.InputOperand(0));
-      __ Cvtui2ss(i.OutputDoubleRegister(), scratch0, scratch1);
-      break;
-    }
-    case kSSEInt32ToFloat64:
-      __ cvtsi2sd(i.OutputDoubleRegister(), i.InputOperand(0));
-      break;
-    case kSSEUint32ToFloat64:
-      __ LoadUint32(i.OutputDoubleRegister(), i.InputOperand(0));
-      break;
-    case kSSEFloat64ExtractLowWord32:
-      if (instr->InputAt(0)->IsFPStackSlot()) {
-        __ mov(i.OutputRegister(), i.InputOperand(0));
-      } else {
-        __ movd(i.OutputRegister(), i.InputDoubleRegister(0));
-      }
-      break;
-    case kSSEFloat64ExtractHighWord32:
-      if (instr->InputAt(0)->IsFPStackSlot()) {
-        __ mov(i.OutputRegister(), i.InputOperand(0, kDoubleSize / 2));
-      } else {
-        __ Pextrd(i.OutputRegister(), i.InputDoubleRegister(0), 1);
-      }
-      break;
-    case kSSEFloat64InsertLowWord32:
-      __ Pinsrd(i.OutputDoubleRegister(), i.InputOperand(1), 0, true);
-      break;
-    case kSSEFloat64InsertHighWord32:
-      __ Pinsrd(i.OutputDoubleRegister(), i.InputOperand(1), 1, true);
-      break;
-    case kSSEFloat64LoadLowWord32:
-      __ movd(i.OutputDoubleRegister(), i.InputOperand(0));
-      break;
-    case kAVXFloat32Add: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vaddss(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-                i.InputOperand(1));
-      break;
-    }
-    case kAVXFloat32Sub: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vsubss(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-                i.InputOperand(1));
-      break;
-    }
-    case kAVXFloat32Mul: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vmulss(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-                i.InputOperand(1));
-      break;
-    }
-    case kAVXFloat32Div: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vdivss(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-                i.InputOperand(1));
-      // Don't delete this mov. It may improve performance on some CPUs,
-      // when there is a (v)mulss depending on the result.
-      __ movaps(i.OutputDoubleRegister(), i.OutputDoubleRegister());
-      break;
-    }
-    case kAVXFloat64Add: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vaddsd(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-                i.InputOperand(1));
-      break;
-    }
-    case kAVXFloat64Sub: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vsubsd(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-                i.InputOperand(1));
-      break;
-    }
-    case kAVXFloat64Mul: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vmulsd(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-                i.InputOperand(1));
-      break;
-    }
-    case kAVXFloat64Div: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vdivsd(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-                i.InputOperand(1));
-      // Don't delete this mov. It may improve performance on some CPUs,
-      // when there is a (v)mulsd depending on the result.
-      __ movaps(i.OutputDoubleRegister(), i.OutputDoubleRegister());
-      break;
-    }
-    case kAVXFloat32Abs: {
-      // TODO(bmeurer): Use RIP relative 128-bit constants.
-      __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
-      __ psrlq(kScratchDoubleReg, 33);
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vandps(i.OutputDoubleRegister(), kScratchDoubleReg, i.InputOperand(0));
-      break;
-    }
-    case kAVXFloat32Neg: {
-      // TODO(bmeurer): Use RIP relative 128-bit constants.
-      __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
-      __ psllq(kScratchDoubleReg, 31);
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vxorps(i.OutputDoubleRegister(), kScratchDoubleReg, i.InputOperand(0));
-      break;
-    }
-    case kAVXFloat64Abs: {
-      // TODO(bmeurer): Use RIP relative 128-bit constants.
-      __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
-      __ psrlq(kScratchDoubleReg, 1);
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vandpd(i.OutputDoubleRegister(), kScratchDoubleReg, i.InputOperand(0));
-      break;
-    }
-    case kAVXFloat64Neg: {
-      // TODO(bmeurer): Use RIP relative 128-bit constants.
-      __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
-      __ psllq(kScratchDoubleReg, 63);
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vxorpd(i.OutputDoubleRegister(), kScratchDoubleReg, i.InputOperand(0));
-      break;
-    }
-    case kSSEFloat64SilenceNaN:
-      __ xorpd(kScratchDoubleReg, kScratchDoubleReg);
-      __ subsd(i.InputDoubleRegister(0), kScratchDoubleReg);
-      break;
-    case kIA32Movsxbl:
-      __ movsx_b(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kIA32Movzxbl:
-      __ movzx_b(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kIA32Movb: {
-      size_t index = 0;
-      Operand operand = i.MemoryOperand(&index);
-      if (HasImmediateInput(instr, index)) {
-        __ mov_b(operand, i.InputInt8(index));
-      } else {
-        __ mov_b(operand, i.InputRegister(index));
-      }
-      break;
-    }
-    case kIA32Movsxwl:
-      __ movsx_w(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kIA32Movzxwl:
-      __ movzx_w(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kIA32Movw: {
-      size_t index = 0;
-      Operand operand = i.MemoryOperand(&index);
-      if (HasImmediateInput(instr, index)) {
-        __ mov_w(operand, i.InputInt16(index));
-      } else {
-        __ mov_w(operand, i.InputRegister(index));
-      }
-      break;
-    }
-    case kIA32Movl:
-      if (instr->HasOutput()) {
-        __ mov(i.OutputRegister(), i.MemoryOperand());
-      } else {
-        size_t index = 0;
-        Operand operand = i.MemoryOperand(&index);
-        if (HasImmediateInput(instr, index)) {
-          __ mov(operand, i.InputImmediate(index));
-        } else {
-          __ mov(operand, i.InputRegister(index));
-        }
-      }
-      break;
-    case kIA32Movsd:
-      if (instr->HasOutput()) {
-        __ movsd(i.OutputDoubleRegister(), i.MemoryOperand());
-      } else {
-        size_t index = 0;
-        Operand operand = i.MemoryOperand(&index);
-        __ movsd(operand, i.InputDoubleRegister(index));
-      }
-      break;
-    case kIA32Movss:
-      if (instr->HasOutput()) {
-        __ movss(i.OutputDoubleRegister(), i.MemoryOperand());
-      } else {
-        size_t index = 0;
-        Operand operand = i.MemoryOperand(&index);
-        __ movss(operand, i.InputDoubleRegister(index));
-      }
-      break;
-    case kIA32Movdqu:
-      if (instr->HasOutput()) {
-        __ Movdqu(i.OutputSimd128Register(), i.MemoryOperand());
-      } else {
-        size_t index = 0;
-        Operand operand = i.MemoryOperand(&index);
-        __ Movdqu(operand, i.InputSimd128Register(index));
-      }
-      break;
-    case kIA32BitcastFI:
-      if (instr->InputAt(0)->IsFPStackSlot()) {
-        __ mov(i.OutputRegister(), i.InputOperand(0));
-      } else {
-        __ movd(i.OutputRegister(), i.InputDoubleRegister(0));
-      }
-      break;
-    case kIA32BitcastIF:
-      if (instr->InputAt(0)->IsRegister()) {
-        __ movd(i.OutputDoubleRegister(), i.InputRegister(0));
-      } else {
-        __ movss(i.OutputDoubleRegister(), i.InputOperand(0));
-      }
-      break;
-    case kIA32Lea: {
-      AddressingMode mode = AddressingModeField::decode(instr->opcode());
-      // Shorten "leal" to "addl", "subl" or "shll" if the register allocation
-      // and addressing mode just happens to work out. The "addl"/"subl" forms
-      // in these cases are faster based on measurements.
-      if (mode == kMode_MI) {
-        __ Move(i.OutputRegister(), Immediate(i.InputInt32(0)));
-      } else if (i.InputRegister(0) == i.OutputRegister()) {
-        if (mode == kMode_MRI) {
-          int32_t constant_summand = i.InputInt32(1);
-          if (constant_summand > 0) {
-            __ add(i.OutputRegister(), Immediate(constant_summand));
-          } else if (constant_summand < 0) {
-            __ sub(i.OutputRegister(), Immediate(-constant_summand));
-          }
-        } else if (mode == kMode_MR1) {
-          if (i.InputRegister(1) == i.OutputRegister()) {
-            __ shl(i.OutputRegister(), 1);
-          } else {
-            __ add(i.OutputRegister(), i.InputRegister(1));
-          }
-        } else if (mode == kMode_M2) {
-          __ shl(i.OutputRegister(), 1);
-        } else if (mode == kMode_M4) {
-          __ shl(i.OutputRegister(), 2);
-        } else if (mode == kMode_M8) {
-          __ shl(i.OutputRegister(), 3);
-        } else {
-          __ lea(i.OutputRegister(), i.MemoryOperand());
-        }
-      } else if (mode == kMode_MR1 &&
-                 i.InputRegister(1) == i.OutputRegister()) {
-        __ add(i.OutputRegister(), i.InputRegister(0));
-      } else {
-        __ lea(i.OutputRegister(), i.MemoryOperand());
-      }
-      break;
-    }
-    case kIA32PushFloat32:
-      if (instr->InputAt(0)->IsFPRegister()) {
-        __ sub(esp, Immediate(kFloatSize));
-        __ movss(Operand(esp, 0), i.InputDoubleRegister(0));
-        frame_access_state()->IncreaseSPDelta(kFloatSize / kPointerSize);
-      } else if (HasImmediateInput(instr, 0)) {
-        __ Move(kScratchDoubleReg, i.InputFloat32(0));
-        __ sub(esp, Immediate(kFloatSize));
-        __ movss(Operand(esp, 0), kScratchDoubleReg);
-        frame_access_state()->IncreaseSPDelta(kFloatSize / kPointerSize);
-      } else {
-        __ movss(kScratchDoubleReg, i.InputOperand(0));
-        __ sub(esp, Immediate(kFloatSize));
-        __ movss(Operand(esp, 0), kScratchDoubleReg);
-        frame_access_state()->IncreaseSPDelta(kFloatSize / kPointerSize);
-      }
-      break;
-    case kIA32PushFloat64:
-      if (instr->InputAt(0)->IsFPRegister()) {
-        __ sub(esp, Immediate(kDoubleSize));
-        __ movsd(Operand(esp, 0), i.InputDoubleRegister(0));
-        frame_access_state()->IncreaseSPDelta(kDoubleSize / kPointerSize);
-      } else if (HasImmediateInput(instr, 0)) {
-        __ Move(kScratchDoubleReg, i.InputDouble(0));
-        __ sub(esp, Immediate(kDoubleSize));
-        __ movsd(Operand(esp, 0), kScratchDoubleReg);
-        frame_access_state()->IncreaseSPDelta(kDoubleSize / kPointerSize);
-      } else {
-        __ movsd(kScratchDoubleReg, i.InputOperand(0));
-        __ sub(esp, Immediate(kDoubleSize));
-        __ movsd(Operand(esp, 0), kScratchDoubleReg);
-        frame_access_state()->IncreaseSPDelta(kDoubleSize / kPointerSize);
-      }
-      break;
-    case kIA32PushSimd128:
-      if (instr->InputAt(0)->IsFPRegister()) {
-        __ sub(esp, Immediate(kSimd128Size));
-        __ movups(Operand(esp, 0), i.InputSimd128Register(0));
-      } else {
-        __ movups(kScratchDoubleReg, i.InputOperand(0));
-        __ sub(esp, Immediate(kSimd128Size));
-        __ movups(Operand(esp, 0), kScratchDoubleReg);
-      }
-      frame_access_state()->IncreaseSPDelta(kSimd128Size / kPointerSize);
-      break;
-    case kIA32Push:
-      if (AddressingModeField::decode(instr->opcode()) != kMode_None) {
-        size_t index = 0;
-        Operand operand = i.MemoryOperand(&index);
-        __ push(operand);
-        frame_access_state()->IncreaseSPDelta(kFloatSize / kPointerSize);
-      } else if (instr->InputAt(0)->IsFPRegister()) {
-        __ sub(esp, Immediate(kFloatSize));
-        __ movsd(Operand(esp, 0), i.InputDoubleRegister(0));
-        frame_access_state()->IncreaseSPDelta(kFloatSize / kPointerSize);
-      } else if (HasImmediateInput(instr, 0)) {
-        __ push(i.InputImmediate(0));
-        frame_access_state()->IncreaseSPDelta(1);
-      } else {
-        __ push(i.InputOperand(0));
-        frame_access_state()->IncreaseSPDelta(1);
-      }
-      break;
-    case kIA32Poke: {
-      int slot = MiscField::decode(instr->opcode());
-      if (HasImmediateInput(instr, 0)) {
-        __ mov(Operand(esp, slot * kPointerSize), i.InputImmediate(0));
-      } else {
-        __ mov(Operand(esp, slot * kPointerSize), i.InputRegister(0));
-      }
-      break;
-    }
-    case kIA32Peek: {
-      int reverse_slot = i.InputInt32(0) + 1;
-      int offset =
-          FrameSlotToFPOffset(frame()->GetTotalFrameSlotCount() - reverse_slot);
-      if (instr->OutputAt(0)->IsFPRegister()) {
-        LocationOperand* op = LocationOperand::cast(instr->OutputAt(0));
-        if (op->representation() == MachineRepresentation::kFloat64) {
-          __ movsd(i.OutputDoubleRegister(), Operand(ebp, offset));
-        } else {
-          DCHECK_EQ(MachineRepresentation::kFloat32, op->representation());
-          __ movss(i.OutputFloatRegister(), Operand(ebp, offset));
-        }
-      } else {
-        __ mov(i.OutputRegister(), Operand(ebp, offset));
-      }
-      break;
-    }
-    case kSSEF32x4Splat: {
-      DCHECK_EQ(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      XMMRegister dst = i.OutputSimd128Register();
-      __ shufps(dst, dst, 0x0);
-      break;
-    }
-    case kAVXF32x4Splat: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      XMMRegister src = i.InputFloatRegister(0);
-      __ vshufps(i.OutputSimd128Register(), src, src, 0x0);
-      break;
-    }
-    case kSSEF32x4ExtractLane: {
-      DCHECK_EQ(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      XMMRegister dst = i.OutputFloatRegister();
-      int8_t lane = i.InputInt8(1);
-      if (lane != 0) {
-        DCHECK_LT(lane, 4);
-        __ shufps(dst, dst, lane);
-      }
-      break;
-    }
-    case kAVXF32x4ExtractLane: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      XMMRegister dst = i.OutputFloatRegister();
-      XMMRegister src = i.InputSimd128Register(0);
-      int8_t lane = i.InputInt8(1);
-      if (lane == 0) {
-        if (dst != src) __ vmovaps(dst, src);
-      } else {
-        DCHECK_LT(lane, 4);
-        __ vshufps(dst, src, src, lane);
-      }
-      break;
-    }
-    case kSSEF32x4ReplaceLane: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ insertps(i.OutputSimd128Register(), i.InputOperand(2),
-                  i.InputInt8(1) << 4);
-      break;
-    }
-    case kAVXF32x4ReplaceLane: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vinsertps(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                   i.InputOperand(2), i.InputInt8(1) << 4);
-      break;
-    }
-    case kSSEF32x4Abs: {
-      XMMRegister dst = i.OutputSimd128Register();
-      Operand src = i.InputOperand(0);
-      if (src.is_reg(dst)) {
-        __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
-        __ psrld(kScratchDoubleReg, 1);
-        __ andps(dst, kScratchDoubleReg);
-      } else {
-        __ pcmpeqd(dst, dst);
-        __ psrld(dst, 1);
-        __ andps(dst, src);
-      }
-      break;
-    }
-    case kAVXF32x4Abs: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpcmpeqd(kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg);
-      __ vpsrld(kScratchDoubleReg, kScratchDoubleReg, 1);
-      __ vandps(i.OutputSimd128Register(), kScratchDoubleReg,
-                i.InputOperand(0));
-      break;
-    }
-    case kSSEF32x4Neg: {
-      XMMRegister dst = i.OutputSimd128Register();
-      Operand src = i.InputOperand(0);
-      if (src.is_reg(dst)) {
-        __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
-        __ pslld(kScratchDoubleReg, 31);
-        __ xorps(dst, kScratchDoubleReg);
-      } else {
-        __ pcmpeqd(dst, dst);
-        __ pslld(dst, 31);
-        __ xorps(dst, src);
-      }
-      break;
-    }
-    case kAVXF32x4Neg: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpcmpeqd(kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg);
-      __ vpslld(kScratchDoubleReg, kScratchDoubleReg, 31);
-      __ vxorps(i.OutputSimd128Register(), kScratchDoubleReg,
-                i.InputOperand(0));
-      break;
-    }
-    case kSSEF32x4Add: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ addps(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXF32x4Add: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vaddps(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputOperand(1));
-      break;
-    }
-    case kSSEF32x4Sub: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ subps(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXF32x4Sub: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vsubps(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputOperand(1));
-      break;
-    }
-    case kSSEF32x4Mul: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ mulps(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXF32x4Mul: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vmulps(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputOperand(1));
-      break;
-    }
-    case kSSEF32x4Min: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ minps(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXF32x4Min: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vminps(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputOperand(1));
-      break;
-    }
-    case kSSEF32x4Max: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ maxps(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXF32x4Max: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vmaxps(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputOperand(1));
-      break;
-    }
-    case kSSEF32x4Eq: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ cmpeqps(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXF32x4Eq: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vcmpeqps(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputOperand(1));
-      break;
-    }
-    case kSSEF32x4Ne: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ cmpneqps(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXF32x4Ne: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vcmpneqps(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                   i.InputOperand(1));
-      break;
-    }
-    case kSSEF32x4Lt: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ cmpltps(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXF32x4Lt: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vcmpltps(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputOperand(1));
-      break;
-    }
-    case kSSEF32x4Le: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ cmpleps(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXF32x4Le: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vcmpleps(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputOperand(1));
-      break;
-    }
-    case kIA32I32x4Splat: {
-      XMMRegister dst = i.OutputSimd128Register();
-      __ Movd(dst, i.InputOperand(0));
-      __ Pshufd(dst, dst, 0x0);
-      break;
-    }
-    case kIA32I32x4ExtractLane: {
-      __ Pextrd(i.OutputRegister(), i.InputSimd128Register(0), i.InputInt8(1));
-      break;
-    }
-    case kSSEI32x4ReplaceLane: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ pinsrd(i.OutputSimd128Register(), i.InputOperand(2), i.InputInt8(1));
-      break;
-    }
-    case kAVXI32x4ReplaceLane: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpinsrd(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputOperand(2), i.InputInt8(1));
-      break;
-    }
-    case kIA32I32x4Neg: {
-      XMMRegister dst = i.OutputSimd128Register();
-      Operand src = i.InputOperand(0);
-      if (src.is_reg(dst)) {
-        __ Pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
-        __ Psignd(dst, kScratchDoubleReg);
-      } else {
-        __ Pxor(dst, dst);
-        __ Psubd(dst, src);
-      }
-      break;
-    }
-    case kSSEI32x4Shl: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ pslld(i.OutputSimd128Register(), i.InputInt8(1));
-      break;
-    }
-    case kAVXI32x4Shl: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpslld(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputInt8(1));
-      break;
-    }
-    case kSSEI32x4ShrS: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ psrad(i.OutputSimd128Register(), i.InputInt8(1));
-      break;
-    }
-    case kAVXI32x4ShrS: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpsrad(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputInt8(1));
-      break;
-    }
-    case kSSEI32x4Add: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ paddd(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI32x4Add: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpaddd(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputOperand(1));
-      break;
-    }
-    case kSSEI32x4Sub: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ psubd(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI32x4Sub: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpsubd(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputOperand(1));
-      break;
-    }
-    case kSSEI32x4Mul: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ pmulld(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI32x4Mul: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpmulld(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputOperand(1));
-      break;
-    }
-    case kSSEI32x4MinS: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ pminsd(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI32x4MinS: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpminsd(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputOperand(1));
-      break;
-    }
-    case kSSEI32x4MaxS: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ pmaxsd(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI32x4MaxS: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpmaxsd(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputOperand(1));
-      break;
-    }
-    case kSSEI32x4Eq: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ pcmpeqd(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI32x4Eq: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpcmpeqd(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputOperand(1));
-      break;
-    }
-    case kSSEI32x4Ne: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ pcmpeqd(i.OutputSimd128Register(), i.InputOperand(1));
-      __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
-      __ pxor(i.OutputSimd128Register(), kScratchDoubleReg);
-      break;
-    }
-    case kAVXI32x4Ne: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpcmpeqd(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputOperand(1));
-      __ vpcmpeqd(kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg);
-      __ vpxor(i.OutputSimd128Register(), i.OutputSimd128Register(),
-               kScratchDoubleReg);
-      break;
-    }
-    case kSSEI32x4GtS: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ pcmpgtd(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI32x4GtS: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpcmpgtd(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputOperand(1));
-      break;
-    }
-    case kSSEI32x4GeS: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      XMMRegister dst = i.OutputSimd128Register();
-      Operand src = i.InputOperand(1);
-      __ pminsd(dst, src);
-      __ pcmpeqd(dst, src);
-      break;
-    }
-    case kAVXI32x4GeS: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      XMMRegister src1 = i.InputSimd128Register(0);
-      Operand src2 = i.InputOperand(1);
-      __ vpminsd(kScratchDoubleReg, src1, src2);
-      __ vpcmpeqd(i.OutputSimd128Register(), kScratchDoubleReg, src2);
-      break;
-    }
-    case kSSEI32x4ShrU: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ psrld(i.OutputSimd128Register(), i.InputInt8(1));
-      break;
-    }
-    case kAVXI32x4ShrU: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpsrld(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputInt8(1));
-      break;
-    }
-    case kSSEI32x4MinU: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ pminud(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI32x4MinU: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpminud(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputOperand(1));
-      break;
-    }
-    case kSSEI32x4MaxU: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ pmaxud(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI32x4MaxU: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpmaxud(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputOperand(1));
-      break;
-    }
-    case kSSEI32x4GtU: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      XMMRegister dst = i.OutputSimd128Register();
-      Operand src = i.InputOperand(1);
-      __ pmaxud(dst, src);
-      __ pcmpeqd(dst, src);
-      __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
-      __ pxor(dst, kScratchDoubleReg);
-      break;
-    }
-    case kAVXI32x4GtU: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      XMMRegister dst = i.OutputSimd128Register();
-      XMMRegister src1 = i.InputSimd128Register(0);
-      Operand src2 = i.InputOperand(1);
-      __ vpmaxud(kScratchDoubleReg, src1, src2);
-      __ vpcmpeqd(dst, kScratchDoubleReg, src2);
-      __ vpcmpeqd(kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg);
-      __ vpxor(dst, dst, kScratchDoubleReg);
-      break;
-    }
-    case kSSEI32x4GeU: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      XMMRegister dst = i.OutputSimd128Register();
-      Operand src = i.InputOperand(1);
-      __ pminud(dst, src);
-      __ pcmpeqd(dst, src);
-      break;
-    }
-    case kAVXI32x4GeU: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      XMMRegister src1 = i.InputSimd128Register(0);
-      Operand src2 = i.InputOperand(1);
-      __ vpminud(kScratchDoubleReg, src1, src2);
-      __ vpcmpeqd(i.OutputSimd128Register(), kScratchDoubleReg, src2);
-      break;
-    }
-    case kIA32I16x8Splat: {
-      XMMRegister dst = i.OutputSimd128Register();
-      __ Movd(dst, i.InputOperand(0));
-      __ Pshuflw(dst, dst, 0x0);
-      __ Pshufd(dst, dst, 0x0);
-      break;
-    }
-    case kIA32I16x8ExtractLane: {
-      Register dst = i.OutputRegister();
-      __ Pextrw(dst, i.InputSimd128Register(0), i.InputInt8(1));
-      __ movsx_w(dst, dst);
-      break;
-    }
-    case kSSEI16x8ReplaceLane: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ pinsrw(i.OutputSimd128Register(), i.InputOperand(2), i.InputInt8(1));
-      break;
-    }
-    case kAVXI16x8ReplaceLane: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpinsrw(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputOperand(2), i.InputInt8(1));
-      break;
-    }
-    case kIA32I16x8Neg: {
-      XMMRegister dst = i.OutputSimd128Register();
-      Operand src = i.InputOperand(0);
-      if (src.is_reg(dst)) {
-        __ Pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
-        __ Psignw(dst, kScratchDoubleReg);
-      } else {
-        __ Pxor(dst, dst);
-        __ Psubw(dst, src);
-      }
-      break;
-    }
-    case kSSEI16x8Shl: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ psllw(i.OutputSimd128Register(), i.InputInt8(1));
-      break;
-    }
-    case kAVXI16x8Shl: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpsllw(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputInt8(1));
-      break;
-    }
-    case kSSEI16x8ShrS: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ psraw(i.OutputSimd128Register(), i.InputInt8(1));
-      break;
-    }
-    case kAVXI16x8ShrS: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpsraw(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputInt8(1));
-      break;
-    }
-    case kSSEI16x8Add: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ paddw(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI16x8Add: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpaddw(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputOperand(1));
-      break;
-    }
-    case kSSEI16x8AddSaturateS: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ paddsw(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI16x8AddSaturateS: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpaddsw(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputOperand(1));
-      break;
-    }
-    case kSSEI16x8Sub: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ psubw(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI16x8Sub: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpsubw(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputOperand(1));
-      break;
-    }
-    case kSSEI16x8SubSaturateS: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ psubsw(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI16x8SubSaturateS: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpsubsw(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputOperand(1));
-      break;
-    }
-    case kSSEI16x8Mul: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ pmullw(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI16x8Mul: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpmullw(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputOperand(1));
-      break;
-    }
-    case kSSEI16x8MinS: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ pminsw(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI16x8MinS: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpminsw(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputOperand(1));
-      break;
-    }
-    case kSSEI16x8MaxS: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ pmaxsw(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI16x8MaxS: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpmaxsw(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputOperand(1));
-      break;
-    }
-    case kSSEI16x8Eq: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ pcmpeqw(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI16x8Eq: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpcmpeqw(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputOperand(1));
-      break;
-    }
-    case kSSEI16x8Ne: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ pcmpeqw(i.OutputSimd128Register(), i.InputOperand(1));
-      __ pcmpeqw(kScratchDoubleReg, kScratchDoubleReg);
-      __ pxor(i.OutputSimd128Register(), kScratchDoubleReg);
-      break;
-    }
-    case kAVXI16x8Ne: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpcmpeqw(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputOperand(1));
-      __ vpcmpeqw(kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg);
-      __ vpxor(i.OutputSimd128Register(), i.OutputSimd128Register(),
-               kScratchDoubleReg);
-      break;
-    }
-    case kSSEI16x8GtS: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ pcmpgtw(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI16x8GtS: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpcmpgtw(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputOperand(1));
-      break;
-    }
-    case kSSEI16x8GeS: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      XMMRegister dst = i.OutputSimd128Register();
-      Operand src = i.InputOperand(1);
-      __ pminsw(dst, src);
-      __ pcmpeqw(dst, src);
-      break;
-    }
-    case kAVXI16x8GeS: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      XMMRegister src1 = i.InputSimd128Register(0);
-      Operand src2 = i.InputOperand(1);
-      __ vpminsw(kScratchDoubleReg, src1, src2);
-      __ vpcmpeqw(i.OutputSimd128Register(), kScratchDoubleReg, src2);
-      break;
-    }
-    case kSSEI16x8ShrU: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ psrlw(i.OutputSimd128Register(), i.InputInt8(1));
-      break;
-    }
-    case kAVXI16x8ShrU: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpsrlw(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputInt8(1));
-      break;
-    }
-    case kSSEI16x8AddSaturateU: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ paddusw(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI16x8AddSaturateU: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpaddusw(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputOperand(1));
-      break;
-    }
-    case kSSEI16x8SubSaturateU: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ psubusw(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI16x8SubSaturateU: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpsubusw(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputOperand(1));
-      break;
-    }
-    case kSSEI16x8MinU: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ pminuw(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI16x8MinU: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpminuw(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputOperand(1));
-      break;
-    }
-    case kSSEI16x8MaxU: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ pmaxuw(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI16x8MaxU: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpmaxuw(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputOperand(1));
-      break;
-    }
-    case kSSEI16x8GtU: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      XMMRegister dst = i.OutputSimd128Register();
-      Operand src = i.InputOperand(1);
-      __ pmaxuw(dst, src);
-      __ pcmpeqw(dst, src);
-      __ pcmpeqw(kScratchDoubleReg, kScratchDoubleReg);
-      __ pxor(dst, kScratchDoubleReg);
-      break;
-    }
-    case kAVXI16x8GtU: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      XMMRegister dst = i.OutputSimd128Register();
-      XMMRegister src1 = i.InputSimd128Register(0);
-      Operand src2 = i.InputOperand(1);
-      __ vpmaxuw(kScratchDoubleReg, src1, src2);
-      __ vpcmpeqw(dst, kScratchDoubleReg, src2);
-      __ vpcmpeqw(kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg);
-      __ vpxor(dst, dst, kScratchDoubleReg);
-      break;
-    }
-    case kSSEI16x8GeU: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      XMMRegister dst = i.OutputSimd128Register();
-      Operand src = i.InputOperand(1);
-      __ pminuw(dst, src);
-      __ pcmpeqw(dst, src);
-      break;
-    }
-    case kAVXI16x8GeU: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      XMMRegister src1 = i.InputSimd128Register(0);
-      Operand src2 = i.InputOperand(1);
-      __ vpminuw(kScratchDoubleReg, src1, src2);
-      __ vpcmpeqw(i.OutputSimd128Register(), kScratchDoubleReg, src2);
-      break;
-    }
-    case kIA32I8x16Splat: {
-      XMMRegister dst = i.OutputSimd128Register();
-      __ Movd(dst, i.InputOperand(0));
-      __ Pxor(kScratchDoubleReg, kScratchDoubleReg);
-      __ Pshufb(dst, kScratchDoubleReg);
-      break;
-    }
-    case kIA32I8x16ExtractLane: {
-      Register dst = i.OutputRegister();
-      __ Pextrb(dst, i.InputSimd128Register(0), i.InputInt8(1));
-      __ movsx_b(dst, dst);
-      break;
-    }
-    case kSSEI8x16ReplaceLane: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ pinsrb(i.OutputSimd128Register(), i.InputOperand(2), i.InputInt8(1));
-      break;
-    }
-    case kAVXI8x16ReplaceLane: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpinsrb(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputOperand(2), i.InputInt8(1));
-      break;
-    }
-    case kIA32I8x16Neg: {
-      XMMRegister dst = i.OutputSimd128Register();
-      Operand src = i.InputOperand(0);
-      if (src.is_reg(dst)) {
-        __ Pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
-        __ Psignb(dst, kScratchDoubleReg);
-      } else {
-        __ Pxor(dst, dst);
-        __ Psubb(dst, src);
-      }
-      break;
-    }
-    case kSSEI8x16Add: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ paddb(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI8x16Add: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpaddb(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputOperand(1));
-      break;
-    }
-    case kSSEI8x16AddSaturateS: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ paddsb(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI8x16AddSaturateS: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpaddsb(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputOperand(1));
-      break;
-    }
-    case kSSEI8x16Sub: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ psubb(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI8x16Sub: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpsubb(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputOperand(1));
-      break;
-    }
-    case kSSEI8x16SubSaturateS: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ psubsb(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI8x16SubSaturateS: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpsubsb(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputOperand(1));
-      break;
-    }
-    case kSSEI8x16MinS: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ pminsb(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI8x16MinS: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpminsb(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputOperand(1));
-      break;
-    }
-    case kSSEI8x16MaxS: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ pmaxsb(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI8x16MaxS: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpmaxsb(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputOperand(1));
-      break;
-    }
-    case kSSEI8x16Eq: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ pcmpeqb(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI8x16Eq: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpcmpeqb(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputOperand(1));
-      break;
-    }
-    case kSSEI8x16Ne: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ pcmpeqb(i.OutputSimd128Register(), i.InputOperand(1));
-      __ pcmpeqb(kScratchDoubleReg, kScratchDoubleReg);
-      __ pxor(i.OutputSimd128Register(), kScratchDoubleReg);
-      break;
-    }
-    case kAVXI8x16Ne: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpcmpeqb(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputOperand(1));
-      __ vpcmpeqb(kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg);
-      __ vpxor(i.OutputSimd128Register(), i.OutputSimd128Register(),
-               kScratchDoubleReg);
-      break;
-    }
-    case kSSEI8x16GtS: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ pcmpgtb(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI8x16GtS: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpcmpgtb(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputOperand(1));
-      break;
-    }
-    case kSSEI8x16GeS: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      XMMRegister dst = i.OutputSimd128Register();
-      Operand src = i.InputOperand(1);
-      __ pminsb(dst, src);
-      __ pcmpeqb(dst, src);
-      break;
-    }
-    case kAVXI8x16GeS: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      XMMRegister src1 = i.InputSimd128Register(0);
-      Operand src2 = i.InputOperand(1);
-      __ vpminsb(kScratchDoubleReg, src1, src2);
-      __ vpcmpeqb(i.OutputSimd128Register(), kScratchDoubleReg, src2);
-      break;
-    }
-    case kSSEI8x16AddSaturateU: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ paddusb(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI8x16AddSaturateU: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpaddusb(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputOperand(1));
-      break;
-    }
-    case kSSEI8x16SubSaturateU: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ psubusb(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI8x16SubSaturateU: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpsubusb(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputOperand(1));
-      break;
-    }
-    case kSSEI8x16MinU: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ pminub(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI8x16MinU: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpminub(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputOperand(1));
-      break;
-    }
-    case kSSEI8x16MaxU: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ pmaxub(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXI8x16MaxU: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpmaxub(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputOperand(1));
-      break;
-    }
-    case kSSEI8x16GtU: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      XMMRegister dst = i.OutputSimd128Register();
-      Operand src = i.InputOperand(1);
-      __ pmaxub(dst, src);
-      __ pcmpeqb(dst, src);
-      __ pcmpeqb(kScratchDoubleReg, kScratchDoubleReg);
-      __ pxor(dst, kScratchDoubleReg);
-      break;
-    }
-    case kAVXI8x16GtU: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      XMMRegister dst = i.OutputSimd128Register();
-      XMMRegister src1 = i.InputSimd128Register(0);
-      Operand src2 = i.InputOperand(1);
-      __ vpmaxub(kScratchDoubleReg, src1, src2);
-      __ vpcmpeqb(dst, kScratchDoubleReg, src2);
-      __ vpcmpeqb(kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg);
-      __ vpxor(dst, dst, kScratchDoubleReg);
-      break;
-    }
-    case kSSEI8x16GeU: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      XMMRegister dst = i.OutputSimd128Register();
-      Operand src = i.InputOperand(1);
-      __ pminub(dst, src);
-      __ pcmpeqb(dst, src);
-      break;
-    }
-    case kAVXI8x16GeU: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      XMMRegister src1 = i.InputSimd128Register(0);
-      Operand src2 = i.InputOperand(1);
-      __ vpminub(kScratchDoubleReg, src1, src2);
-      __ vpcmpeqb(i.OutputSimd128Register(), kScratchDoubleReg, src2);
-      break;
-    }
-    case kIA32S128Zero: {
-      XMMRegister dst = i.OutputSimd128Register();
-      __ Pxor(dst, dst);
-      break;
-    }
-    case kSSES128Not: {
-      XMMRegister dst = i.OutputSimd128Register();
-      Operand src = i.InputOperand(0);
-      if (src.is_reg(dst)) {
-        __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
-        __ pxor(dst, kScratchDoubleReg);
-      } else {
-        __ pcmpeqd(dst, dst);
-        __ pxor(dst, src);
-      }
-      break;
-    }
-    case kAVXS128Not: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpcmpeqd(kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg);
-      __ vpxor(i.OutputSimd128Register(), kScratchDoubleReg, i.InputOperand(0));
-      break;
-    }
-    case kSSES128And: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ pand(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXS128And: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpand(i.OutputSimd128Register(), i.InputSimd128Register(0),
-               i.InputOperand(1));
-      break;
-    }
-    case kSSES128Or: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ por(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXS128Or: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpor(i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputOperand(1));
-      break;
-    }
-    case kSSES128Xor: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ pxor(i.OutputSimd128Register(), i.InputOperand(1));
-      break;
-    }
-    case kAVXS128Xor: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpxor(i.OutputSimd128Register(), i.InputSimd128Register(0),
-               i.InputOperand(1));
-      break;
-    }
-    case kIA32StackCheck: {
-      ExternalReference const stack_limit =
-          ExternalReference::address_of_stack_limit(__ isolate());
-      __ cmp(esp, Operand::StaticVariable(stack_limit));
-      break;
-    }
-    case kAtomicExchangeInt8: {
-      __ xchg_b(i.InputRegister(0), i.MemoryOperand(1));
-      __ movsx_b(i.InputRegister(0), i.InputRegister(0));
-      break;
-    }
-    case kAtomicExchangeUint8: {
-      __ xchg_b(i.InputRegister(0), i.MemoryOperand(1));
-      __ movzx_b(i.InputRegister(0), i.InputRegister(0));
-      break;
-    }
-    case kAtomicExchangeInt16: {
-      __ xchg_w(i.InputRegister(0), i.MemoryOperand(1));
-      __ movsx_w(i.InputRegister(0), i.InputRegister(0));
-      break;
-    }
-    case kAtomicExchangeUint16: {
-      __ xchg_w(i.InputRegister(0), i.MemoryOperand(1));
-      __ movzx_w(i.InputRegister(0), i.InputRegister(0));
-      break;
-    }
-    case kAtomicExchangeWord32: {
-      __ xchg(i.InputRegister(0), i.MemoryOperand(1));
-      break;
-    }
-    case kAtomicCompareExchangeInt8: {
-      __ lock();
-      __ cmpxchg_b(i.MemoryOperand(2), i.InputRegister(1));
-      __ movsx_b(eax, eax);
-      break;
-    }
-    case kAtomicCompareExchangeUint8: {
-      __ lock();
-      __ cmpxchg_b(i.MemoryOperand(2), i.InputRegister(1));
-      __ movzx_b(eax, eax);
-      break;
-    }
-    case kAtomicCompareExchangeInt16: {
-      __ lock();
-      __ cmpxchg_w(i.MemoryOperand(2), i.InputRegister(1));
-      __ movsx_w(eax, eax);
-      break;
-    }
-    case kAtomicCompareExchangeUint16: {
-      __ lock();
-      __ cmpxchg_w(i.MemoryOperand(2), i.InputRegister(1));
-      __ movzx_w(eax, eax);
-      break;
-    }
-    case kAtomicCompareExchangeWord32: {
-      __ lock();
-      __ cmpxchg(i.MemoryOperand(2), i.InputRegister(1));
-      break;
-    }
-#define ATOMIC_BINOP_CASE(op, inst)                \
-  case kAtomic##op##Int8: {                        \
-    ASSEMBLE_ATOMIC_BINOP(inst, mov_b, cmpxchg_b); \
-    __ movsx_b(eax, eax);                          \
-    break;                                         \
-  }                                                \
-  case kAtomic##op##Uint8: {                       \
-    ASSEMBLE_ATOMIC_BINOP(inst, mov_b, cmpxchg_b); \
-    __ movzx_b(eax, eax);                          \
-    break;                                         \
-  }                                                \
-  case kAtomic##op##Int16: {                       \
-    ASSEMBLE_ATOMIC_BINOP(inst, mov_w, cmpxchg_w); \
-    __ movsx_w(eax, eax);                          \
-    break;                                         \
-  }                                                \
-  case kAtomic##op##Uint16: {                      \
-    ASSEMBLE_ATOMIC_BINOP(inst, mov_w, cmpxchg_w); \
-    __ movzx_w(eax, eax);                          \
-    break;                                         \
-  }                                                \
-  case kAtomic##op##Word32: {                      \
-    ASSEMBLE_ATOMIC_BINOP(inst, mov, cmpxchg);     \
-    break;                                         \
-  }
-      ATOMIC_BINOP_CASE(Add, add)
-      ATOMIC_BINOP_CASE(Sub, sub)
-      ATOMIC_BINOP_CASE(And, and_)
-      ATOMIC_BINOP_CASE(Or, or_)
-      ATOMIC_BINOP_CASE(Xor, xor_)
-#undef ATOMIC_BINOP_CASE
-    case kAtomicLoadInt8:
-    case kAtomicLoadUint8:
-    case kAtomicLoadInt16:
-    case kAtomicLoadUint16:
-    case kAtomicLoadWord32:
-    case kAtomicStoreWord8:
-    case kAtomicStoreWord16:
-    case kAtomicStoreWord32:
-      UNREACHABLE();  // Won't be generated by instruction selector.
-      break;
-  }
-  return kSuccess;
-}  // NOLINT(readability/fn_size)
-
-static Condition FlagsConditionToCondition(FlagsCondition condition) {
-  switch (condition) {
-    case kUnorderedEqual:
-    case kEqual:
-      return equal;
-      break;
-    case kUnorderedNotEqual:
-    case kNotEqual:
-      return not_equal;
-      break;
-    case kSignedLessThan:
-      return less;
-      break;
-    case kSignedGreaterThanOrEqual:
-      return greater_equal;
-      break;
-    case kSignedLessThanOrEqual:
-      return less_equal;
-      break;
-    case kSignedGreaterThan:
-      return greater;
-      break;
-    case kUnsignedLessThan:
-      return below;
-      break;
-    case kUnsignedGreaterThanOrEqual:
-      return above_equal;
-      break;
-    case kUnsignedLessThanOrEqual:
-      return below_equal;
-      break;
-    case kUnsignedGreaterThan:
-      return above;
-      break;
-    case kOverflow:
-      return overflow;
-      break;
-    case kNotOverflow:
-      return no_overflow;
-      break;
-    default:
-      UNREACHABLE();
-      break;
-  }
-}
-
-// Assembles a branch after an instruction.
-void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) {
-  Label::Distance flabel_distance =
-      branch->fallthru ? Label::kNear : Label::kFar;
-  Label* tlabel = branch->true_label;
-  Label* flabel = branch->false_label;
-  if (branch->condition == kUnorderedEqual) {
-    __ j(parity_even, flabel, flabel_distance);
-  } else if (branch->condition == kUnorderedNotEqual) {
-    __ j(parity_even, tlabel);
-  }
-  __ j(FlagsConditionToCondition(branch->condition), tlabel);
-
-  // Add a jump if not falling through to the next block.
-  if (!branch->fallthru) __ jmp(flabel);
-}
-
-void CodeGenerator::AssembleArchDeoptBranch(Instruction* instr,
-                                            BranchInfo* branch) {
-  AssembleArchBranch(instr, branch);
-}
-
-void CodeGenerator::AssembleArchJump(RpoNumber target) {
-  if (!IsNextInAssemblyOrder(target)) __ jmp(GetLabel(target));
-}
-
-void CodeGenerator::AssembleArchTrap(Instruction* instr,
-                                     FlagsCondition condition) {
-  class OutOfLineTrap final : public OutOfLineCode {
-   public:
-    OutOfLineTrap(CodeGenerator* gen, bool frame_elided, Instruction* instr)
-        : OutOfLineCode(gen),
-          frame_elided_(frame_elided),
-          instr_(instr),
-          gen_(gen) {}
-
-    void Generate() final {
-      IA32OperandConverter i(gen_, instr_);
-
-      Builtins::Name trap_id =
-          static_cast<Builtins::Name>(i.InputInt32(instr_->InputCount() - 1));
-      bool old_has_frame = __ has_frame();
-      if (frame_elided_) {
-        __ set_has_frame(true);
-        __ EnterFrame(StackFrame::WASM_COMPILED);
-      }
-      GenerateCallToTrap(trap_id);
-      if (frame_elided_) {
-        __ set_has_frame(old_has_frame);
-      }
-    }
-
-   private:
-    void GenerateCallToTrap(Builtins::Name trap_id) {
-      if (trap_id == Builtins::builtin_count) {
-        // We cannot test calls to the runtime in cctest/test-run-wasm.
-        // Therefore we emit a call to C here instead of a call to the runtime.
-        __ PrepareCallCFunction(0, esi);
-        __ CallCFunction(ExternalReference::wasm_call_trap_callback_for_testing(
-                             __ isolate()),
-                         0);
-        __ LeaveFrame(StackFrame::WASM_COMPILED);
-        CallDescriptor* descriptor = gen_->linkage()->GetIncomingDescriptor();
-        size_t pop_size = descriptor->StackParameterCount() * kPointerSize;
-        // Use ecx as a scratch register, we return anyways immediately.
-        __ Ret(static_cast<int>(pop_size), ecx);
-      } else {
-        gen_->AssembleSourcePosition(instr_);
-        __ Call(__ isolate()->builtins()->builtin_handle(trap_id),
-                RelocInfo::CODE_TARGET);
-        ReferenceMap* reference_map =
-            new (gen_->zone()) ReferenceMap(gen_->zone());
-        gen_->RecordSafepoint(reference_map, Safepoint::kSimple, 0,
-                              Safepoint::kNoLazyDeopt);
-        __ AssertUnreachable(AbortReason::kUnexpectedReturnFromWasmTrap);
-      }
-    }
-
-    bool frame_elided_;
-    Instruction* instr_;
-    CodeGenerator* gen_;
-  };
-  bool frame_elided = !frame_access_state()->has_frame();
-  auto ool = new (zone()) OutOfLineTrap(this, frame_elided, instr);
-  Label* tlabel = ool->entry();
-  Label end;
-  if (condition == kUnorderedEqual) {
-    __ j(parity_even, &end);
-  } else if (condition == kUnorderedNotEqual) {
-    __ j(parity_even, tlabel);
-  }
-  __ j(FlagsConditionToCondition(condition), tlabel);
-  __ bind(&end);
-}
-
-// Assembles boolean materializations after an instruction.
-void CodeGenerator::AssembleArchBoolean(Instruction* instr,
-                                        FlagsCondition condition) {
-  IA32OperandConverter i(this, instr);
-  Label done;
-
-  // Materialize a full 32-bit 1 or 0 value. The result register is always the
-  // last output of the instruction.
-  Label check;
-  DCHECK_NE(0u, instr->OutputCount());
-  Register reg = i.OutputRegister(instr->OutputCount() - 1);
-  if (condition == kUnorderedEqual) {
-    __ j(parity_odd, &check, Label::kNear);
-    __ Move(reg, Immediate(0));
-    __ jmp(&done, Label::kNear);
-  } else if (condition == kUnorderedNotEqual) {
-    __ j(parity_odd, &check, Label::kNear);
-    __ mov(reg, Immediate(1));
-    __ jmp(&done, Label::kNear);
-  }
-  Condition cc = FlagsConditionToCondition(condition);
-
-  __ bind(&check);
-  if (reg.is_byte_register()) {
-    // setcc for byte registers (al, bl, cl, dl).
-    __ setcc(cc, reg);
-    __ movzx_b(reg, reg);
-  } else {
-    // Emit a branch to set a register to either 1 or 0.
-    Label set;
-    __ j(cc, &set, Label::kNear);
-    __ Move(reg, Immediate(0));
-    __ jmp(&done, Label::kNear);
-    __ bind(&set);
-    __ mov(reg, Immediate(1));
-  }
-  __ bind(&done);
-}
-
-
-void CodeGenerator::AssembleArchLookupSwitch(Instruction* instr) {
-  IA32OperandConverter i(this, instr);
-  Register input = i.InputRegister(0);
-  for (size_t index = 2; index < instr->InputCount(); index += 2) {
-    __ cmp(input, Immediate(i.InputInt32(index + 0)));
-    __ j(equal, GetLabel(i.InputRpo(index + 1)));
-  }
-  AssembleArchJump(i.InputRpo(1));
-}
-
-
-void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) {
-  IA32OperandConverter i(this, instr);
-  Register input = i.InputRegister(0);
-  size_t const case_count = instr->InputCount() - 2;
-  Label** cases = zone()->NewArray<Label*>(case_count);
-  for (size_t index = 0; index < case_count; ++index) {
-    cases[index] = GetLabel(i.InputRpo(index + 2));
-  }
-  Label* const table = AddJumpTable(cases, case_count);
-  __ cmp(input, Immediate(case_count));
-  __ j(above_equal, GetLabel(i.InputRpo(1)));
-  __ jmp(Operand::JumpTable(input, times_4, table));
-}
-
-
-// The calling convention for JSFunctions on IA32 passes arguments on the
-// stack and the JSFunction and context in EDI and ESI, respectively, thus
-// the steps of the call look as follows:
-
-// --{ before the call instruction }--------------------------------------------
-//                                                         |  caller frame |
-//                                                         ^ esp           ^ ebp
-
-// --{ push arguments and setup ESI, EDI }--------------------------------------
-//                                       | args + receiver |  caller frame |
-//                                       ^ esp                             ^ ebp
-//                 [edi = JSFunction, esi = context]
-
-// --{ call [edi + kCodeEntryOffset] }------------------------------------------
-//                                 | RET | args + receiver |  caller frame |
-//                                 ^ esp                                   ^ ebp
-
-// =={ prologue of called function }============================================
-// --{ push ebp }---------------------------------------------------------------
-//                            | FP | RET | args + receiver |  caller frame |
-//                            ^ esp                                        ^ ebp
-
-// --{ mov ebp, esp }-----------------------------------------------------------
-//                            | FP | RET | args + receiver |  caller frame |
-//                            ^ ebp,esp
-
-// --{ push esi }---------------------------------------------------------------
-//                      | CTX | FP | RET | args + receiver |  caller frame |
-//                      ^esp  ^ ebp
-
-// --{ push edi }---------------------------------------------------------------
-//                | FNC | CTX | FP | RET | args + receiver |  caller frame |
-//                ^esp        ^ ebp
-
-// --{ subi esp, #N }-----------------------------------------------------------
-// | callee frame | FNC | CTX | FP | RET | args + receiver |  caller frame |
-// ^esp                       ^ ebp
-
-// =={ body of called function }================================================
-
-// =={ epilogue of called function }============================================
-// --{ mov esp, ebp }-----------------------------------------------------------
-//                            | FP | RET | args + receiver |  caller frame |
-//                            ^ esp,ebp
-
-// --{ pop ebp }-----------------------------------------------------------
-// |                               | RET | args + receiver |  caller frame |
-//                                 ^ esp                                   ^ ebp
-
-// --{ ret #A+1 }-----------------------------------------------------------
-// |                                                       |  caller frame |
-//                                                         ^ esp           ^ ebp
-
-
-// Runtime function calls are accomplished by doing a stub call to the
-// CEntryStub (a real code object). On IA32 passes arguments on the
-// stack, the number of arguments in EAX, the address of the runtime function
-// in EBX, and the context in ESI.
-
-// --{ before the call instruction }--------------------------------------------
-//                                                         |  caller frame |
-//                                                         ^ esp           ^ ebp
-
-// --{ push arguments and setup EAX, EBX, and ESI }-----------------------------
-//                                       | args + receiver |  caller frame |
-//                                       ^ esp                             ^ ebp
-//              [eax = #args, ebx = runtime function, esi = context]
-
-// --{ call #CEntryStub }-------------------------------------------------------
-//                                 | RET | args + receiver |  caller frame |
-//                                 ^ esp                                   ^ ebp
-
-// =={ body of runtime function }===============================================
-
-// --{ runtime returns }--------------------------------------------------------
-//                                                         |  caller frame |
-//                                                         ^ esp           ^ ebp
-
-// Other custom linkages (e.g. for calling directly into and out of C++) may
-// need to save callee-saved registers on the stack, which is done in the
-// function prologue of generated code.
-
-// --{ before the call instruction }--------------------------------------------
-//                                                         |  caller frame |
-//                                                         ^ esp           ^ ebp
-
-// --{ set up arguments in registers on stack }---------------------------------
-//                                                  | args |  caller frame |
-//                                                  ^ esp                  ^ ebp
-//                  [r0 = arg0, r1 = arg1, ...]
-
-// --{ call code }--------------------------------------------------------------
-//                                            | RET | args |  caller frame |
-//                                            ^ esp                        ^ ebp
-
-// =={ prologue of called function }============================================
-// --{ push ebp }---------------------------------------------------------------
-//                                       | FP | RET | args |  caller frame |
-//                                       ^ esp                             ^ ebp
-
-// --{ mov ebp, esp }-----------------------------------------------------------
-//                                       | FP | RET | args |  caller frame |
-//                                       ^ ebp,esp
-
-// --{ save registers }---------------------------------------------------------
-//                                | regs | FP | RET | args |  caller frame |
-//                                ^ esp  ^ ebp
-
-// --{ subi esp, #N }-----------------------------------------------------------
-//                 | callee frame | regs | FP | RET | args |  caller frame |
-//                 ^esp                  ^ ebp
-
-// =={ body of called function }================================================
-
-// =={ epilogue of called function }============================================
-// --{ restore registers }------------------------------------------------------
-//                                | regs | FP | RET | args |  caller frame |
-//                                ^ esp  ^ ebp
-
-// --{ mov esp, ebp }-----------------------------------------------------------
-//                                       | FP | RET | args |  caller frame |
-//                                       ^ esp,ebp
-
-// --{ pop ebp }----------------------------------------------------------------
-//                                            | RET | args |  caller frame |
-//                                            ^ esp                        ^ ebp
-
-void CodeGenerator::FinishFrame(Frame* frame) {
-  CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
-  const RegList saves = descriptor->CalleeSavedRegisters();
-  if (saves != 0) {  // Save callee-saved registers.
-    DCHECK(!info()->is_osr());
-    int pushed = 0;
-    for (int i = Register::kNumRegisters - 1; i >= 0; i--) {
-      if (!((1 << i) & saves)) continue;
-      ++pushed;
-    }
-    frame->AllocateSavedCalleeRegisterSlots(pushed);
-  }
-}
-
-void CodeGenerator::AssembleConstructFrame() {
-  CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
-  if (frame_access_state()->has_frame()) {
-    if (descriptor->IsCFunctionCall()) {
-      __ push(ebp);
-      __ mov(ebp, esp);
-    } else if (descriptor->IsJSFunctionCall()) {
-      __ Prologue();
-      if (descriptor->PushArgumentCount()) {
-        __ push(kJavaScriptCallArgCountRegister);
-      }
-    } else {
-      __ StubPrologue(info()->GetOutputStackFrameType());
-    }
-  }
-
-  int shrink_slots =
-      frame()->GetTotalFrameSlotCount() - descriptor->CalculateFixedFrameSize();
-
-  if (info()->is_osr()) {
-    // TurboFan OSR-compiled functions cannot be entered directly.
-    __ Abort(AbortReason::kShouldNotDirectlyEnterOsrFunction);
-
-    // Unoptimized code jumps directly to this entrypoint while the unoptimized
-    // frame is still on the stack. Optimized code uses OSR values directly from
-    // the unoptimized frame. Thus, all that needs to be done is to allocate the
-    // remaining stack slots.
-    if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --");
-    osr_pc_offset_ = __ pc_offset();
-    shrink_slots -= osr_helper()->UnoptimizedFrameSlots();
-  }
-
-  const RegList saves = descriptor->CalleeSavedRegisters();
-  if (shrink_slots > 0) {
-    if (info()->IsWasm() && shrink_slots > 128) {
-      // For WebAssembly functions with big frames we have to do the stack
-      // overflow check before we construct the frame. Otherwise we may not
-      // have enough space on the stack to call the runtime for the stack
-      // overflow.
-      Label done;
-
-      // If the frame is bigger than the stack, we throw the stack overflow
-      // exception unconditionally. Thereby we can avoid the integer overflow
-      // check in the condition code.
-      if (shrink_slots * kPointerSize < FLAG_stack_size * 1024) {
-        Register scratch = esi;
-        __ push(scratch);
-        __ mov(scratch,
-               Immediate(ExternalReference::address_of_real_stack_limit(
-                   __ isolate())));
-        __ mov(scratch, Operand(scratch, 0));
-        __ add(scratch, Immediate(shrink_slots * kPointerSize));
-        __ cmp(esp, scratch);
-        __ pop(scratch);
-        __ j(above_equal, &done);
-      }
-      if (!frame_access_state()->has_frame()) {
-        __ set_has_frame(true);
-        __ EnterFrame(StackFrame::WASM_COMPILED);
-      }
-      __ Move(esi, Smi::kZero);
-      __ CallRuntimeDelayed(zone(), Runtime::kThrowWasmStackOverflow);
-      ReferenceMap* reference_map = new (zone()) ReferenceMap(zone());
-      RecordSafepoint(reference_map, Safepoint::kSimple, 0,
-                      Safepoint::kNoLazyDeopt);
-      __ AssertUnreachable(AbortReason::kUnexpectedReturnFromWasmTrap);
-      __ bind(&done);
-    }
-
-    // Skip callee-saved and return slots, which are created below.
-    shrink_slots -= base::bits::CountPopulation(saves);
-    shrink_slots -= frame()->GetReturnSlotCount();
-    if (shrink_slots > 0) {
-      __ sub(esp, Immediate(shrink_slots * kPointerSize));
-    }
-  }
-
-  if (saves != 0) {  // Save callee-saved registers.
-    DCHECK(!info()->is_osr());
-    for (int i = Register::kNumRegisters - 1; i >= 0; i--) {
-      if (((1 << i) & saves)) __ push(Register::from_code(i));
-    }
-  }
-
-  // Allocate return slots (located after callee-saved).
-  if (frame()->GetReturnSlotCount() > 0) {
-    __ sub(esp, Immediate(frame()->GetReturnSlotCount() * kPointerSize));
-  }
-}
-
-void CodeGenerator::AssembleReturn(InstructionOperand* pop) {
-  CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
-
-  const RegList saves = descriptor->CalleeSavedRegisters();
-  // Restore registers.
-  if (saves != 0) {
-    const int returns = frame()->GetReturnSlotCount();
-    if (returns != 0) {
-      __ add(esp, Immediate(returns * kPointerSize));
-    }
-    for (int i = 0; i < Register::kNumRegisters; i++) {
-      if (!((1 << i) & saves)) continue;
-      __ pop(Register::from_code(i));
-    }
-  }
-
-  // Might need ecx for scratch if pop_size is too big or if there is a variable
-  // pop count.
-  DCHECK_EQ(0u, descriptor->CalleeSavedRegisters() & ecx.bit());
-  size_t pop_size = descriptor->StackParameterCount() * kPointerSize;
-  IA32OperandConverter g(this, nullptr);
-  if (descriptor->IsCFunctionCall()) {
-    AssembleDeconstructFrame();
-  } else if (frame_access_state()->has_frame()) {
-    // Canonicalize JSFunction return sites for now if they always have the same
-    // number of return args.
-    if (pop->IsImmediate() && g.ToConstant(pop).ToInt32() == 0) {
-      if (return_label_.is_bound()) {
-        __ jmp(&return_label_);
-        return;
-      } else {
-        __ bind(&return_label_);
-        AssembleDeconstructFrame();
-      }
-    } else {
-      AssembleDeconstructFrame();
-    }
-  }
-  DCHECK_EQ(0u, descriptor->CalleeSavedRegisters() & edx.bit());
-  DCHECK_EQ(0u, descriptor->CalleeSavedRegisters() & ecx.bit());
-  if (pop->IsImmediate()) {
-    DCHECK_EQ(Constant::kInt32, g.ToConstant(pop).type());
-    pop_size += g.ToConstant(pop).ToInt32() * kPointerSize;
-    __ Ret(static_cast<int>(pop_size), ecx);
-  } else {
-    Register pop_reg = g.ToRegister(pop);
-    Register scratch_reg = pop_reg == ecx ? edx : ecx;
-    __ pop(scratch_reg);
-    __ lea(esp, Operand(esp, pop_reg, times_4, static_cast<int>(pop_size)));
-    __ jmp(scratch_reg);
-  }
-}
-
-void CodeGenerator::FinishCode() {}
-
-void CodeGenerator::AssembleMove(InstructionOperand* source,
-                                 InstructionOperand* destination) {
-  IA32OperandConverter g(this, nullptr);
-  // Dispatch on the source and destination operand kinds.  Not all
-  // combinations are possible.
-  if (source->IsRegister()) {
-    DCHECK(destination->IsRegister() || destination->IsStackSlot());
-    Register src = g.ToRegister(source);
-    Operand dst = g.ToOperand(destination);
-    __ mov(dst, src);
-  } else if (source->IsStackSlot()) {
-    DCHECK(destination->IsRegister() || destination->IsStackSlot());
-    Operand src = g.ToOperand(source);
-    if (destination->IsRegister()) {
-      Register dst = g.ToRegister(destination);
-      __ mov(dst, src);
-    } else {
-      Operand dst = g.ToOperand(destination);
-      __ push(src);
-      __ pop(dst);
-    }
-  } else if (source->IsConstant()) {
-    Constant src_constant = g.ToConstant(source);
-    if (src_constant.type() == Constant::kHeapObject) {
-      Handle<HeapObject> src = src_constant.ToHeapObject();
-      if (destination->IsRegister()) {
-        Register dst = g.ToRegister(destination);
-        __ Move(dst, src);
-      } else {
-        DCHECK(destination->IsStackSlot());
-        Operand dst = g.ToOperand(destination);
-        __ mov(dst, src);
-      }
-    } else if (destination->IsRegister()) {
-      Register dst = g.ToRegister(destination);
-      __ Move(dst, g.ToImmediate(source));
-    } else if (destination->IsStackSlot()) {
-      Operand dst = g.ToOperand(destination);
-      __ Move(dst, g.ToImmediate(source));
-    } else if (src_constant.type() == Constant::kFloat32) {
-      // TODO(turbofan): Can we do better here?
-      uint32_t src = src_constant.ToFloat32AsInt();
-      if (destination->IsFPRegister()) {
-        XMMRegister dst = g.ToDoubleRegister(destination);
-        __ Move(dst, src);
-      } else {
-        DCHECK(destination->IsFPStackSlot());
-        Operand dst = g.ToOperand(destination);
-        __ Move(dst, Immediate(src));
-      }
-    } else {
-      DCHECK_EQ(Constant::kFloat64, src_constant.type());
-      uint64_t src = src_constant.ToFloat64().AsUint64();
-      uint32_t lower = static_cast<uint32_t>(src);
-      uint32_t upper = static_cast<uint32_t>(src >> 32);
-      if (destination->IsFPRegister()) {
-        XMMRegister dst = g.ToDoubleRegister(destination);
-        __ Move(dst, src);
-      } else {
-        DCHECK(destination->IsFPStackSlot());
-        Operand dst0 = g.ToOperand(destination);
-        Operand dst1 = g.ToOperand(destination, kPointerSize);
-        __ Move(dst0, Immediate(lower));
-        __ Move(dst1, Immediate(upper));
-      }
-    }
-  } else if (source->IsFPRegister()) {
-    XMMRegister src = g.ToDoubleRegister(source);
-    if (destination->IsFPRegister()) {
-      XMMRegister dst = g.ToDoubleRegister(destination);
-      __ movaps(dst, src);
-    } else {
-      DCHECK(destination->IsFPStackSlot());
-      Operand dst = g.ToOperand(destination);
-      MachineRepresentation rep =
-          LocationOperand::cast(source)->representation();
-      if (rep == MachineRepresentation::kFloat64) {
-        __ movsd(dst, src);
-      } else if (rep == MachineRepresentation::kFloat32) {
-        __ movss(dst, src);
-      } else {
-        DCHECK_EQ(MachineRepresentation::kSimd128, rep);
-        __ movups(dst, src);
-      }
-    }
-  } else if (source->IsFPStackSlot()) {
-    DCHECK(destination->IsFPRegister() || destination->IsFPStackSlot());
-    Operand src = g.ToOperand(source);
-    MachineRepresentation rep = LocationOperand::cast(source)->representation();
-    if (destination->IsFPRegister()) {
-      XMMRegister dst = g.ToDoubleRegister(destination);
-      if (rep == MachineRepresentation::kFloat64) {
-        __ movsd(dst, src);
-      } else if (rep == MachineRepresentation::kFloat32) {
-        __ movss(dst, src);
-      } else {
-        DCHECK_EQ(MachineRepresentation::kSimd128, rep);
-        __ movups(dst, src);
-      }
-    } else {
-      Operand dst = g.ToOperand(destination);
-      if (rep == MachineRepresentation::kFloat64) {
-        __ movsd(kScratchDoubleReg, src);
-        __ movsd(dst, kScratchDoubleReg);
-      } else if (rep == MachineRepresentation::kFloat32) {
-        __ movss(kScratchDoubleReg, src);
-        __ movss(dst, kScratchDoubleReg);
-      } else {
-        DCHECK_EQ(MachineRepresentation::kSimd128, rep);
-        __ movups(kScratchDoubleReg, src);
-        __ movups(dst, kScratchDoubleReg);
-      }
-    }
-  } else {
-    UNREACHABLE();
-  }
-}
-
-
-void CodeGenerator::AssembleSwap(InstructionOperand* source,
-                                 InstructionOperand* destination) {
-  IA32OperandConverter g(this, nullptr);
-  // Dispatch on the source and destination operand kinds.  Not all
-  // combinations are possible.
-  if (source->IsRegister() && destination->IsRegister()) {
-    // Register-register.
-    Register src = g.ToRegister(source);
-    Register dst = g.ToRegister(destination);
-    __ push(src);
-    __ mov(src, dst);
-    __ pop(dst);
-  } else if (source->IsRegister() && destination->IsStackSlot()) {
-    // Register-memory.
-    Register src = g.ToRegister(source);
-    __ push(src);
-    frame_access_state()->IncreaseSPDelta(1);
-    Operand dst = g.ToOperand(destination);
-    __ mov(src, dst);
-    frame_access_state()->IncreaseSPDelta(-1);
-    dst = g.ToOperand(destination);
-    __ pop(dst);
-  } else if (source->IsStackSlot() && destination->IsStackSlot()) {
-    // Memory-memory.
-    Operand dst1 = g.ToOperand(destination);
-    __ push(dst1);
-    frame_access_state()->IncreaseSPDelta(1);
-    Operand src1 = g.ToOperand(source);
-    __ push(src1);
-    Operand dst2 = g.ToOperand(destination);
-    __ pop(dst2);
-    frame_access_state()->IncreaseSPDelta(-1);
-    Operand src2 = g.ToOperand(source);
-    __ pop(src2);
-  } else if (source->IsFPRegister() && destination->IsFPRegister()) {
-    // XMM register-register swap.
-    XMMRegister src = g.ToDoubleRegister(source);
-    XMMRegister dst = g.ToDoubleRegister(destination);
-    __ movaps(kScratchDoubleReg, src);
-    __ movaps(src, dst);
-    __ movaps(dst, kScratchDoubleReg);
-  } else if (source->IsFPRegister() && destination->IsFPStackSlot()) {
-    // XMM register-memory swap.
-    XMMRegister reg = g.ToDoubleRegister(source);
-    Operand other = g.ToOperand(destination);
-    MachineRepresentation rep = LocationOperand::cast(source)->representation();
-    if (rep == MachineRepresentation::kFloat64) {
-      __ movsd(kScratchDoubleReg, other);
-      __ movsd(other, reg);
-      __ movaps(reg, kScratchDoubleReg);
-    } else if (rep == MachineRepresentation::kFloat32) {
-      __ movss(kScratchDoubleReg, other);
-      __ movss(other, reg);
-      __ movaps(reg, kScratchDoubleReg);
-    } else {
-      DCHECK_EQ(MachineRepresentation::kSimd128, rep);
-      __ movups(kScratchDoubleReg, other);
-      __ movups(other, reg);
-      __ movups(reg, kScratchDoubleReg);
-    }
-  } else if (source->IsFPStackSlot() && destination->IsFPStackSlot()) {
-    // Double-width memory-to-memory.
-    Operand src0 = g.ToOperand(source);
-    Operand dst0 = g.ToOperand(destination);
-    MachineRepresentation rep = LocationOperand::cast(source)->representation();
-    if (rep == MachineRepresentation::kFloat64) {
-      __ movsd(kScratchDoubleReg, dst0);  // Save dst in scratch register.
-      __ push(src0);  // Then use stack to copy src to destination.
-      __ pop(dst0);
-      __ push(g.ToOperand(source, kPointerSize));
-      __ pop(g.ToOperand(destination, kPointerSize));
-      __ movsd(src0, kScratchDoubleReg);
-    } else if (rep == MachineRepresentation::kFloat32) {
-      __ movss(kScratchDoubleReg, dst0);  // Save dst in scratch register.
-      __ push(src0);  // Then use stack to copy src to destination.
-      __ pop(dst0);
-      __ movss(src0, kScratchDoubleReg);
-    } else {
-      DCHECK_EQ(MachineRepresentation::kSimd128, rep);
-      __ movups(kScratchDoubleReg, dst0);  // Save dst in scratch register.
-      __ push(src0);  // Then use stack to copy src to destination.
-      __ pop(dst0);
-      __ push(g.ToOperand(source, kPointerSize));
-      __ pop(g.ToOperand(destination, kPointerSize));
-      __ push(g.ToOperand(source, 2 * kPointerSize));
-      __ pop(g.ToOperand(destination, 2 * kPointerSize));
-      __ push(g.ToOperand(source, 3 * kPointerSize));
-      __ pop(g.ToOperand(destination, 3 * kPointerSize));
-      __ movups(src0, kScratchDoubleReg);
-    }
-  } else {
-    // No other combinations are possible.
-    UNREACHABLE();
-  }
-}
-
-
-void CodeGenerator::AssembleJumpTable(Label** targets, size_t target_count) {
-  for (size_t index = 0; index < target_count; ++index) {
-    __ dd(targets[index]);
-  }
-}
-
-#undef __
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/ia32/instruction-codes-ia32.h b/src/v8/src/compiler/ia32/instruction-codes-ia32.h
deleted file mode 100644
index a17d9f0..0000000
--- a/src/v8/src/compiler/ia32/instruction-codes-ia32.h
+++ /dev/null
@@ -1,312 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_IA32_INSTRUCTION_CODES_IA32_H_
-#define V8_COMPILER_IA32_INSTRUCTION_CODES_IA32_H_
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-// IA32-specific opcodes that specify which assembly sequence to emit.
-// Most opcodes specify a single instruction.
-#define TARGET_ARCH_OPCODE_LIST(V) \
-  V(IA32Add)                       \
-  V(IA32And)                       \
-  V(IA32Cmp)                       \
-  V(IA32Cmp16)                     \
-  V(IA32Cmp8)                      \
-  V(IA32Test)                      \
-  V(IA32Test16)                    \
-  V(IA32Test8)                     \
-  V(IA32Or)                        \
-  V(IA32Xor)                       \
-  V(IA32Sub)                       \
-  V(IA32Imul)                      \
-  V(IA32ImulHigh)                  \
-  V(IA32UmulHigh)                  \
-  V(IA32Idiv)                      \
-  V(IA32Udiv)                      \
-  V(IA32Not)                       \
-  V(IA32Neg)                       \
-  V(IA32Shl)                       \
-  V(IA32Shr)                       \
-  V(IA32Sar)                       \
-  V(IA32AddPair)                   \
-  V(IA32SubPair)                   \
-  V(IA32MulPair)                   \
-  V(IA32ShlPair)                   \
-  V(IA32ShrPair)                   \
-  V(IA32SarPair)                   \
-  V(IA32Ror)                       \
-  V(IA32Lzcnt)                     \
-  V(IA32Tzcnt)                     \
-  V(IA32Popcnt)                    \
-  V(LFence)                        \
-  V(SSEFloat32Cmp)                 \
-  V(SSEFloat32Add)                 \
-  V(SSEFloat32Sub)                 \
-  V(SSEFloat32Mul)                 \
-  V(SSEFloat32Div)                 \
-  V(SSEFloat32Abs)                 \
-  V(SSEFloat32Neg)                 \
-  V(SSEFloat32Sqrt)                \
-  V(SSEFloat32Round)               \
-  V(SSEFloat64Cmp)                 \
-  V(SSEFloat64Add)                 \
-  V(SSEFloat64Sub)                 \
-  V(SSEFloat64Mul)                 \
-  V(SSEFloat64Div)                 \
-  V(SSEFloat64Mod)                 \
-  V(SSEFloat32Max)                 \
-  V(SSEFloat64Max)                 \
-  V(SSEFloat32Min)                 \
-  V(SSEFloat64Min)                 \
-  V(SSEFloat64Abs)                 \
-  V(SSEFloat64Neg)                 \
-  V(SSEFloat64Sqrt)                \
-  V(SSEFloat64Round)               \
-  V(SSEFloat32ToFloat64)           \
-  V(SSEFloat64ToFloat32)           \
-  V(SSEFloat32ToInt32)             \
-  V(SSEFloat32ToUint32)            \
-  V(SSEFloat64ToInt32)             \
-  V(SSEFloat64ToUint32)            \
-  V(SSEInt32ToFloat32)             \
-  V(SSEUint32ToFloat32)            \
-  V(SSEInt32ToFloat64)             \
-  V(SSEUint32ToFloat64)            \
-  V(SSEFloat64ExtractLowWord32)    \
-  V(SSEFloat64ExtractHighWord32)   \
-  V(SSEFloat64InsertLowWord32)     \
-  V(SSEFloat64InsertHighWord32)    \
-  V(SSEFloat64LoadLowWord32)       \
-  V(SSEFloat64SilenceNaN)          \
-  V(AVXFloat32Add)                 \
-  V(AVXFloat32Sub)                 \
-  V(AVXFloat32Mul)                 \
-  V(AVXFloat32Div)                 \
-  V(AVXFloat64Add)                 \
-  V(AVXFloat64Sub)                 \
-  V(AVXFloat64Mul)                 \
-  V(AVXFloat64Div)                 \
-  V(AVXFloat64Abs)                 \
-  V(AVXFloat64Neg)                 \
-  V(AVXFloat32Abs)                 \
-  V(AVXFloat32Neg)                 \
-  V(IA32Movsxbl)                   \
-  V(IA32Movzxbl)                   \
-  V(IA32Movb)                      \
-  V(IA32Movsxwl)                   \
-  V(IA32Movzxwl)                   \
-  V(IA32Movw)                      \
-  V(IA32Movl)                      \
-  V(IA32Movss)                     \
-  V(IA32Movsd)                     \
-  V(IA32Movdqu)                    \
-  V(IA32BitcastFI)                 \
-  V(IA32BitcastIF)                 \
-  V(IA32Lea)                       \
-  V(IA32Push)                      \
-  V(IA32PushFloat32)               \
-  V(IA32PushFloat64)               \
-  V(IA32PushSimd128)               \
-  V(IA32Poke)                      \
-  V(IA32Peek)                      \
-  V(IA32StackCheck)                \
-  V(SSEF32x4Splat)                 \
-  V(AVXF32x4Splat)                 \
-  V(SSEF32x4ExtractLane)           \
-  V(AVXF32x4ExtractLane)           \
-  V(SSEF32x4ReplaceLane)           \
-  V(AVXF32x4ReplaceLane)           \
-  V(SSEF32x4Abs)                   \
-  V(AVXF32x4Abs)                   \
-  V(SSEF32x4Neg)                   \
-  V(AVXF32x4Neg)                   \
-  V(SSEF32x4Add)                   \
-  V(AVXF32x4Add)                   \
-  V(SSEF32x4Sub)                   \
-  V(AVXF32x4Sub)                   \
-  V(SSEF32x4Mul)                   \
-  V(AVXF32x4Mul)                   \
-  V(SSEF32x4Min)                   \
-  V(AVXF32x4Min)                   \
-  V(SSEF32x4Max)                   \
-  V(AVXF32x4Max)                   \
-  V(SSEF32x4Eq)                    \
-  V(AVXF32x4Eq)                    \
-  V(SSEF32x4Ne)                    \
-  V(AVXF32x4Ne)                    \
-  V(SSEF32x4Lt)                    \
-  V(AVXF32x4Lt)                    \
-  V(SSEF32x4Le)                    \
-  V(AVXF32x4Le)                    \
-  V(IA32I32x4Splat)                \
-  V(IA32I32x4ExtractLane)          \
-  V(SSEI32x4ReplaceLane)           \
-  V(AVXI32x4ReplaceLane)           \
-  V(IA32I32x4Neg)                  \
-  V(SSEI32x4Shl)                   \
-  V(AVXI32x4Shl)                   \
-  V(SSEI32x4ShrS)                  \
-  V(AVXI32x4ShrS)                  \
-  V(SSEI32x4Add)                   \
-  V(AVXI32x4Add)                   \
-  V(SSEI32x4Sub)                   \
-  V(AVXI32x4Sub)                   \
-  V(SSEI32x4Mul)                   \
-  V(AVXI32x4Mul)                   \
-  V(SSEI32x4MinS)                  \
-  V(AVXI32x4MinS)                  \
-  V(SSEI32x4MaxS)                  \
-  V(AVXI32x4MaxS)                  \
-  V(SSEI32x4Eq)                    \
-  V(AVXI32x4Eq)                    \
-  V(SSEI32x4Ne)                    \
-  V(AVXI32x4Ne)                    \
-  V(SSEI32x4GtS)                   \
-  V(AVXI32x4GtS)                   \
-  V(SSEI32x4GeS)                   \
-  V(AVXI32x4GeS)                   \
-  V(SSEI32x4ShrU)                  \
-  V(AVXI32x4ShrU)                  \
-  V(SSEI32x4MinU)                  \
-  V(AVXI32x4MinU)                  \
-  V(SSEI32x4MaxU)                  \
-  V(AVXI32x4MaxU)                  \
-  V(SSEI32x4GtU)                   \
-  V(AVXI32x4GtU)                   \
-  V(SSEI32x4GeU)                   \
-  V(AVXI32x4GeU)                   \
-  V(IA32I16x8Splat)                \
-  V(IA32I16x8ExtractLane)          \
-  V(SSEI16x8ReplaceLane)           \
-  V(AVXI16x8ReplaceLane)           \
-  V(IA32I16x8Neg)                  \
-  V(SSEI16x8Shl)                   \
-  V(AVXI16x8Shl)                   \
-  V(SSEI16x8ShrS)                  \
-  V(AVXI16x8ShrS)                  \
-  V(SSEI16x8Add)                   \
-  V(AVXI16x8Add)                   \
-  V(SSEI16x8AddSaturateS)          \
-  V(AVXI16x8AddSaturateS)          \
-  V(SSEI16x8Sub)                   \
-  V(AVXI16x8Sub)                   \
-  V(SSEI16x8SubSaturateS)          \
-  V(AVXI16x8SubSaturateS)          \
-  V(SSEI16x8Mul)                   \
-  V(AVXI16x8Mul)                   \
-  V(SSEI16x8MinS)                  \
-  V(AVXI16x8MinS)                  \
-  V(SSEI16x8MaxS)                  \
-  V(AVXI16x8MaxS)                  \
-  V(SSEI16x8Eq)                    \
-  V(AVXI16x8Eq)                    \
-  V(SSEI16x8Ne)                    \
-  V(AVXI16x8Ne)                    \
-  V(SSEI16x8GtS)                   \
-  V(AVXI16x8GtS)                   \
-  V(SSEI16x8GeS)                   \
-  V(AVXI16x8GeS)                   \
-  V(SSEI16x8ShrU)                  \
-  V(AVXI16x8ShrU)                  \
-  V(SSEI16x8AddSaturateU)          \
-  V(AVXI16x8AddSaturateU)          \
-  V(SSEI16x8SubSaturateU)          \
-  V(AVXI16x8SubSaturateU)          \
-  V(SSEI16x8MinU)                  \
-  V(AVXI16x8MinU)                  \
-  V(SSEI16x8MaxU)                  \
-  V(AVXI16x8MaxU)                  \
-  V(SSEI16x8GtU)                   \
-  V(AVXI16x8GtU)                   \
-  V(SSEI16x8GeU)                   \
-  V(AVXI16x8GeU)                   \
-  V(IA32I8x16Splat)                \
-  V(IA32I8x16ExtractLane)          \
-  V(SSEI8x16ReplaceLane)           \
-  V(AVXI8x16ReplaceLane)           \
-  V(IA32I8x16Neg)                  \
-  V(SSEI8x16Add)                   \
-  V(AVXI8x16Add)                   \
-  V(SSEI8x16AddSaturateS)          \
-  V(AVXI8x16AddSaturateS)          \
-  V(SSEI8x16Sub)                   \
-  V(AVXI8x16Sub)                   \
-  V(SSEI8x16SubSaturateS)          \
-  V(AVXI8x16SubSaturateS)          \
-  V(SSEI8x16MinS)                  \
-  V(AVXI8x16MinS)                  \
-  V(SSEI8x16MaxS)                  \
-  V(AVXI8x16MaxS)                  \
-  V(SSEI8x16Eq)                    \
-  V(AVXI8x16Eq)                    \
-  V(SSEI8x16Ne)                    \
-  V(AVXI8x16Ne)                    \
-  V(SSEI8x16GtS)                   \
-  V(AVXI8x16GtS)                   \
-  V(SSEI8x16GeS)                   \
-  V(AVXI8x16GeS)                   \
-  V(SSEI8x16AddSaturateU)          \
-  V(AVXI8x16AddSaturateU)          \
-  V(SSEI8x16SubSaturateU)          \
-  V(AVXI8x16SubSaturateU)          \
-  V(SSEI8x16MinU)                  \
-  V(AVXI8x16MinU)                  \
-  V(SSEI8x16MaxU)                  \
-  V(AVXI8x16MaxU)                  \
-  V(SSEI8x16GtU)                   \
-  V(AVXI8x16GtU)                   \
-  V(SSEI8x16GeU)                   \
-  V(AVXI8x16GeU)                   \
-  V(IA32S128Zero)                  \
-  V(SSES128Not)                    \
-  V(AVXS128Not)                    \
-  V(SSES128And)                    \
-  V(AVXS128And)                    \
-  V(SSES128Or)                     \
-  V(AVXS128Or)                     \
-  V(SSES128Xor)                    \
-  V(AVXS128Xor)
-
-// Addressing modes represent the "shape" of inputs to an instruction.
-// Many instructions support multiple addressing modes. Addressing modes
-// are encoded into the InstructionCode of the instruction and tell the
-// code generator after register allocation which assembler method to call.
-//
-// We use the following local notation for addressing modes:
-//
-// M = memory operand
-// R = base register
-// N = index register * N for N in {1, 2, 4, 8}
-// I = immediate displacement (int32_t)
-
-#define TARGET_ADDRESSING_MODE_LIST(V) \
-  V(MR)   /* [%r1            ] */      \
-  V(MRI)  /* [%r1         + K] */      \
-  V(MR1)  /* [%r1 + %r2*1    ] */      \
-  V(MR2)  /* [%r1 + %r2*2    ] */      \
-  V(MR4)  /* [%r1 + %r2*4    ] */      \
-  V(MR8)  /* [%r1 + %r2*8    ] */      \
-  V(MR1I) /* [%r1 + %r2*1 + K] */      \
-  V(MR2I) /* [%r1 + %r2*2 + K] */      \
-  V(MR4I) /* [%r1 + %r2*3 + K] */      \
-  V(MR8I) /* [%r1 + %r2*4 + K] */      \
-  V(M1)   /* [      %r2*1    ] */      \
-  V(M2)   /* [      %r2*2    ] */      \
-  V(M4)   /* [      %r2*4    ] */      \
-  V(M8)   /* [      %r2*8    ] */      \
-  V(M1I)  /* [      %r2*1 + K] */      \
-  V(M2I)  /* [      %r2*2 + K] */      \
-  V(M4I)  /* [      %r2*4 + K] */      \
-  V(M8I)  /* [      %r2*8 + K] */      \
-  V(MI)   /* [              K] */
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_COMPILER_IA32_INSTRUCTION_CODES_IA32_H_
diff --git a/src/v8/src/compiler/ia32/instruction-scheduler-ia32.cc b/src/v8/src/compiler/ia32/instruction-scheduler-ia32.cc
deleted file mode 100644
index db43c1e..0000000
--- a/src/v8/src/compiler/ia32/instruction-scheduler-ia32.cc
+++ /dev/null
@@ -1,361 +0,0 @@
-// Copyright 2015 the V8 project 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 "src/compiler/instruction-scheduler.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-bool InstructionScheduler::SchedulerSupported() { return true; }
-
-
-int InstructionScheduler::GetTargetInstructionFlags(
-    const Instruction* instr) const {
-  switch (instr->arch_opcode()) {
-    case kIA32Add:
-    case kIA32And:
-    case kIA32Cmp:
-    case kIA32Cmp16:
-    case kIA32Cmp8:
-    case kIA32Test:
-    case kIA32Test16:
-    case kIA32Test8:
-    case kIA32Or:
-    case kIA32Xor:
-    case kIA32Sub:
-    case kIA32Imul:
-    case kIA32ImulHigh:
-    case kIA32UmulHigh:
-    case kIA32Not:
-    case kIA32Neg:
-    case kIA32Shl:
-    case kIA32Shr:
-    case kIA32Sar:
-    case kIA32AddPair:
-    case kIA32SubPair:
-    case kIA32MulPair:
-    case kIA32ShlPair:
-    case kIA32ShrPair:
-    case kIA32SarPair:
-    case kIA32Ror:
-    case kIA32Lzcnt:
-    case kIA32Tzcnt:
-    case kIA32Popcnt:
-    case kIA32Lea:
-    case kSSEFloat32Cmp:
-    case kSSEFloat32Add:
-    case kSSEFloat32Sub:
-    case kSSEFloat32Mul:
-    case kSSEFloat32Div:
-    case kSSEFloat32Abs:
-    case kSSEFloat32Neg:
-    case kSSEFloat32Sqrt:
-    case kSSEFloat32Round:
-    case kSSEFloat64Cmp:
-    case kSSEFloat64Add:
-    case kSSEFloat64Sub:
-    case kSSEFloat64Mul:
-    case kSSEFloat64Div:
-    case kSSEFloat64Mod:
-    case kSSEFloat32Max:
-    case kSSEFloat64Max:
-    case kSSEFloat32Min:
-    case kSSEFloat64Min:
-    case kSSEFloat64Abs:
-    case kSSEFloat64Neg:
-    case kSSEFloat64Sqrt:
-    case kSSEFloat64Round:
-    case kSSEFloat32ToFloat64:
-    case kSSEFloat64ToFloat32:
-    case kSSEFloat32ToInt32:
-    case kSSEFloat32ToUint32:
-    case kSSEFloat64ToInt32:
-    case kSSEFloat64ToUint32:
-    case kSSEInt32ToFloat32:
-    case kSSEUint32ToFloat32:
-    case kSSEInt32ToFloat64:
-    case kSSEUint32ToFloat64:
-    case kSSEFloat64ExtractLowWord32:
-    case kSSEFloat64ExtractHighWord32:
-    case kSSEFloat64InsertLowWord32:
-    case kSSEFloat64InsertHighWord32:
-    case kSSEFloat64LoadLowWord32:
-    case kSSEFloat64SilenceNaN:
-    case kAVXFloat32Add:
-    case kAVXFloat32Sub:
-    case kAVXFloat32Mul:
-    case kAVXFloat32Div:
-    case kAVXFloat64Add:
-    case kAVXFloat64Sub:
-    case kAVXFloat64Mul:
-    case kAVXFloat64Div:
-    case kAVXFloat64Abs:
-    case kAVXFloat64Neg:
-    case kAVXFloat32Abs:
-    case kAVXFloat32Neg:
-    case kIA32BitcastFI:
-    case kIA32BitcastIF:
-    case kSSEF32x4Splat:
-    case kAVXF32x4Splat:
-    case kSSEF32x4ExtractLane:
-    case kAVXF32x4ExtractLane:
-    case kSSEF32x4ReplaceLane:
-    case kAVXF32x4ReplaceLane:
-    case kSSEF32x4Abs:
-    case kAVXF32x4Abs:
-    case kSSEF32x4Neg:
-    case kAVXF32x4Neg:
-    case kSSEF32x4Add:
-    case kAVXF32x4Add:
-    case kSSEF32x4Sub:
-    case kAVXF32x4Sub:
-    case kSSEF32x4Mul:
-    case kAVXF32x4Mul:
-    case kSSEF32x4Min:
-    case kAVXF32x4Min:
-    case kSSEF32x4Max:
-    case kAVXF32x4Max:
-    case kSSEF32x4Eq:
-    case kAVXF32x4Eq:
-    case kSSEF32x4Ne:
-    case kAVXF32x4Ne:
-    case kSSEF32x4Lt:
-    case kAVXF32x4Lt:
-    case kSSEF32x4Le:
-    case kAVXF32x4Le:
-    case kIA32I32x4Splat:
-    case kIA32I32x4ExtractLane:
-    case kSSEI32x4ReplaceLane:
-    case kAVXI32x4ReplaceLane:
-    case kIA32I32x4Neg:
-    case kSSEI32x4Shl:
-    case kAVXI32x4Shl:
-    case kSSEI32x4ShrS:
-    case kAVXI32x4ShrS:
-    case kSSEI32x4Add:
-    case kAVXI32x4Add:
-    case kSSEI32x4Sub:
-    case kAVXI32x4Sub:
-    case kSSEI32x4Mul:
-    case kAVXI32x4Mul:
-    case kSSEI32x4MinS:
-    case kAVXI32x4MinS:
-    case kSSEI32x4MaxS:
-    case kAVXI32x4MaxS:
-    case kSSEI32x4Eq:
-    case kAVXI32x4Eq:
-    case kSSEI32x4Ne:
-    case kAVXI32x4Ne:
-    case kSSEI32x4GtS:
-    case kAVXI32x4GtS:
-    case kSSEI32x4GeS:
-    case kAVXI32x4GeS:
-    case kSSEI32x4ShrU:
-    case kAVXI32x4ShrU:
-    case kSSEI32x4MinU:
-    case kAVXI32x4MinU:
-    case kSSEI32x4MaxU:
-    case kAVXI32x4MaxU:
-    case kSSEI32x4GtU:
-    case kAVXI32x4GtU:
-    case kSSEI32x4GeU:
-    case kAVXI32x4GeU:
-    case kIA32I16x8Splat:
-    case kIA32I16x8ExtractLane:
-    case kSSEI16x8ReplaceLane:
-    case kAVXI16x8ReplaceLane:
-    case kIA32I16x8Neg:
-    case kSSEI16x8Shl:
-    case kAVXI16x8Shl:
-    case kSSEI16x8ShrS:
-    case kAVXI16x8ShrS:
-    case kSSEI16x8Add:
-    case kAVXI16x8Add:
-    case kSSEI16x8AddSaturateS:
-    case kAVXI16x8AddSaturateS:
-    case kSSEI16x8Sub:
-    case kAVXI16x8Sub:
-    case kSSEI16x8SubSaturateS:
-    case kAVXI16x8SubSaturateS:
-    case kSSEI16x8Mul:
-    case kAVXI16x8Mul:
-    case kSSEI16x8MinS:
-    case kAVXI16x8MinS:
-    case kSSEI16x8MaxS:
-    case kAVXI16x8MaxS:
-    case kSSEI16x8Eq:
-    case kAVXI16x8Eq:
-    case kSSEI16x8Ne:
-    case kAVXI16x8Ne:
-    case kSSEI16x8GtS:
-    case kAVXI16x8GtS:
-    case kSSEI16x8GeS:
-    case kAVXI16x8GeS:
-    case kSSEI16x8ShrU:
-    case kAVXI16x8ShrU:
-    case kSSEI16x8AddSaturateU:
-    case kAVXI16x8AddSaturateU:
-    case kSSEI16x8SubSaturateU:
-    case kAVXI16x8SubSaturateU:
-    case kSSEI16x8MinU:
-    case kAVXI16x8MinU:
-    case kSSEI16x8MaxU:
-    case kAVXI16x8MaxU:
-    case kSSEI16x8GtU:
-    case kAVXI16x8GtU:
-    case kSSEI16x8GeU:
-    case kAVXI16x8GeU:
-    case kIA32I8x16Splat:
-    case kIA32I8x16ExtractLane:
-    case kSSEI8x16ReplaceLane:
-    case kAVXI8x16ReplaceLane:
-    case kIA32I8x16Neg:
-    case kSSEI8x16Add:
-    case kAVXI8x16Add:
-    case kSSEI8x16AddSaturateS:
-    case kAVXI8x16AddSaturateS:
-    case kSSEI8x16Sub:
-    case kAVXI8x16Sub:
-    case kSSEI8x16SubSaturateS:
-    case kAVXI8x16SubSaturateS:
-    case kSSEI8x16MinS:
-    case kAVXI8x16MinS:
-    case kSSEI8x16MaxS:
-    case kAVXI8x16MaxS:
-    case kSSEI8x16Eq:
-    case kAVXI8x16Eq:
-    case kSSEI8x16Ne:
-    case kAVXI8x16Ne:
-    case kSSEI8x16GtS:
-    case kAVXI8x16GtS:
-    case kSSEI8x16GeS:
-    case kAVXI8x16GeS:
-    case kSSEI8x16AddSaturateU:
-    case kAVXI8x16AddSaturateU:
-    case kSSEI8x16SubSaturateU:
-    case kAVXI8x16SubSaturateU:
-    case kSSEI8x16MinU:
-    case kAVXI8x16MinU:
-    case kSSEI8x16MaxU:
-    case kAVXI8x16MaxU:
-    case kSSEI8x16GtU:
-    case kAVXI8x16GtU:
-    case kSSEI8x16GeU:
-    case kAVXI8x16GeU:
-    case kIA32S128Zero:
-    case kSSES128Not:
-    case kAVXS128Not:
-    case kSSES128And:
-    case kAVXS128And:
-    case kSSES128Or:
-    case kAVXS128Or:
-    case kSSES128Xor:
-    case kAVXS128Xor:
-      return (instr->addressing_mode() == kMode_None)
-          ? kNoOpcodeFlags
-          : kIsLoadOperation | kHasSideEffect;
-
-    case kIA32Idiv:
-    case kIA32Udiv:
-      return (instr->addressing_mode() == kMode_None)
-                 ? kMayNeedDeoptOrTrapCheck
-                 : kMayNeedDeoptOrTrapCheck | kIsLoadOperation | kHasSideEffect;
-
-    case kIA32Movsxbl:
-    case kIA32Movzxbl:
-    case kIA32Movb:
-    case kIA32Movsxwl:
-    case kIA32Movzxwl:
-    case kIA32Movw:
-    case kIA32Movl:
-    case kIA32Movss:
-    case kIA32Movsd:
-    case kIA32Movdqu:
-      // Moves are used for memory load/store operations.
-      return instr->HasOutput() ? kIsLoadOperation : kHasSideEffect;
-
-    case kIA32StackCheck:
-    case kIA32Peek:
-      return kIsLoadOperation;
-
-    case kIA32Push:
-    case kIA32PushFloat32:
-    case kIA32PushFloat64:
-    case kIA32PushSimd128:
-    case kIA32Poke:
-    case kLFence:
-      return kHasSideEffect;
-
-#define CASE(Name) case k##Name:
-    COMMON_ARCH_OPCODE_LIST(CASE)
-#undef CASE
-      // Already covered in architecture independent code.
-      UNREACHABLE();
-  }
-
-  UNREACHABLE();
-}
-
-
-int InstructionScheduler::GetInstructionLatency(const Instruction* instr) {
-  // Basic latency modeling for ia32 instructions. They have been determined
-  // in an empirical way.
-  switch (instr->arch_opcode()) {
-    case kSSEFloat64Mul:
-      return 5;
-    case kIA32Imul:
-    case kIA32ImulHigh:
-      return 5;
-    case kSSEFloat32Cmp:
-    case kSSEFloat64Cmp:
-      return 9;
-    case kSSEFloat32Add:
-    case kSSEFloat32Sub:
-    case kSSEFloat32Abs:
-    case kSSEFloat32Neg:
-    case kSSEFloat64Add:
-    case kSSEFloat64Sub:
-    case kSSEFloat64Max:
-    case kSSEFloat64Min:
-    case kSSEFloat64Abs:
-    case kSSEFloat64Neg:
-      return 5;
-    case kSSEFloat32Mul:
-      return 4;
-    case kSSEFloat32ToFloat64:
-    case kSSEFloat64ToFloat32:
-      return 6;
-    case kSSEFloat32Round:
-    case kSSEFloat64Round:
-    case kSSEFloat32ToInt32:
-    case kSSEFloat64ToInt32:
-      return 8;
-    case kSSEFloat32ToUint32:
-      return 21;
-    case kSSEFloat64ToUint32:
-      return 15;
-    case kIA32Idiv:
-      return 33;
-    case kIA32Udiv:
-      return 26;
-    case kSSEFloat32Div:
-      return 35;
-    case kSSEFloat64Div:
-      return 63;
-    case kSSEFloat32Sqrt:
-    case kSSEFloat64Sqrt:
-      return 25;
-    case kSSEFloat64Mod:
-      return 50;
-    case kArchTruncateDoubleToI:
-      return 9;
-    default:
-      return 1;
-  }
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/ia32/instruction-selector-ia32.cc b/src/v8/src/compiler/ia32/instruction-selector-ia32.cc
deleted file mode 100644
index d8bf250..0000000
--- a/src/v8/src/compiler/ia32/instruction-selector-ia32.cc
+++ /dev/null
@@ -1,2010 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/base/adapters.h"
-#include "src/compiler/instruction-selector-impl.h"
-#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-// Adds IA32-specific methods for generating operands.
-class IA32OperandGenerator final : public OperandGenerator {
- public:
-  explicit IA32OperandGenerator(InstructionSelector* selector)
-      : OperandGenerator(selector) {}
-
-  InstructionOperand UseByteRegister(Node* node) {
-    // TODO(titzer): encode byte register use constraints.
-    return UseFixed(node, edx);
-  }
-
-  InstructionOperand DefineAsByteRegister(Node* node) {
-    // TODO(titzer): encode byte register def constraints.
-    return DefineAsRegister(node);
-  }
-
-  bool CanBeMemoryOperand(InstructionCode opcode, Node* node, Node* input,
-                          int effect_level) {
-    if (input->opcode() != IrOpcode::kLoad ||
-        !selector()->CanCover(node, input)) {
-      return false;
-    }
-    if (effect_level != selector()->GetEffectLevel(input)) {
-      return false;
-    }
-    MachineRepresentation rep =
-        LoadRepresentationOf(input->op()).representation();
-    switch (opcode) {
-      case kIA32And:
-      case kIA32Or:
-      case kIA32Xor:
-      case kIA32Add:
-      case kIA32Sub:
-      case kIA32Cmp:
-      case kIA32Test:
-        return rep == MachineRepresentation::kWord32 || IsAnyTagged(rep);
-      case kIA32Cmp16:
-      case kIA32Test16:
-        return rep == MachineRepresentation::kWord16;
-      case kIA32Cmp8:
-      case kIA32Test8:
-        return rep == MachineRepresentation::kWord8;
-      default:
-        break;
-    }
-    return false;
-  }
-
-  bool CanBeImmediate(Node* node) {
-    switch (node->opcode()) {
-      case IrOpcode::kInt32Constant:
-      case IrOpcode::kNumberConstant:
-      case IrOpcode::kExternalConstant:
-      case IrOpcode::kRelocatableInt32Constant:
-      case IrOpcode::kRelocatableInt64Constant:
-        return true;
-      case IrOpcode::kHeapConstant: {
-// TODO(bmeurer): We must not dereference handles concurrently. If we
-// really have to this here, then we need to find a way to put this
-// information on the HeapConstant node already.
-#if 0
-        // Constants in new space cannot be used as immediates in V8 because
-        // the GC does not scan code objects when collecting the new generation.
-        Handle<HeapObject> value = OpParameter<Handle<HeapObject>>(node);
-        Isolate* isolate = value->GetIsolate();
-        return !isolate->heap()->InNewSpace(*value);
-#endif
-      }
-      default:
-        return false;
-    }
-  }
-
-  AddressingMode GenerateMemoryOperandInputs(Node* index, int scale, Node* base,
-                                             Node* displacement_node,
-                                             DisplacementMode displacement_mode,
-                                             InstructionOperand inputs[],
-                                             size_t* input_count) {
-    AddressingMode mode = kMode_MRI;
-    int32_t displacement = (displacement_node == nullptr)
-                               ? 0
-                               : OpParameter<int32_t>(displacement_node);
-    if (displacement_mode == kNegativeDisplacement) {
-      displacement = -displacement;
-    }
-    if (base != nullptr) {
-      if (base->opcode() == IrOpcode::kInt32Constant) {
-        displacement += OpParameter<int32_t>(base);
-        base = nullptr;
-      }
-    }
-    if (base != nullptr) {
-      inputs[(*input_count)++] = UseRegister(base);
-      if (index != nullptr) {
-        DCHECK(scale >= 0 && scale <= 3);
-        inputs[(*input_count)++] = UseRegister(index);
-        if (displacement != 0) {
-          inputs[(*input_count)++] = TempImmediate(displacement);
-          static const AddressingMode kMRnI_modes[] = {kMode_MR1I, kMode_MR2I,
-                                                       kMode_MR4I, kMode_MR8I};
-          mode = kMRnI_modes[scale];
-        } else {
-          static const AddressingMode kMRn_modes[] = {kMode_MR1, kMode_MR2,
-                                                      kMode_MR4, kMode_MR8};
-          mode = kMRn_modes[scale];
-        }
-      } else {
-        if (displacement == 0) {
-          mode = kMode_MR;
-        } else {
-          inputs[(*input_count)++] = TempImmediate(displacement);
-          mode = kMode_MRI;
-        }
-      }
-    } else {
-      DCHECK(scale >= 0 && scale <= 3);
-      if (index != nullptr) {
-        inputs[(*input_count)++] = UseRegister(index);
-        if (displacement != 0) {
-          inputs[(*input_count)++] = TempImmediate(displacement);
-          static const AddressingMode kMnI_modes[] = {kMode_MRI, kMode_M2I,
-                                                      kMode_M4I, kMode_M8I};
-          mode = kMnI_modes[scale];
-        } else {
-          static const AddressingMode kMn_modes[] = {kMode_MR, kMode_M2,
-                                                     kMode_M4, kMode_M8};
-          mode = kMn_modes[scale];
-        }
-      } else {
-        inputs[(*input_count)++] = TempImmediate(displacement);
-        return kMode_MI;
-      }
-    }
-    return mode;
-  }
-
-  AddressingMode GetEffectiveAddressMemoryOperand(Node* node,
-                                                  InstructionOperand inputs[],
-                                                  size_t* input_count) {
-    BaseWithIndexAndDisplacement32Matcher m(node, AddressOption::kAllowAll);
-    DCHECK(m.matches());
-    if ((m.displacement() == nullptr || CanBeImmediate(m.displacement()))) {
-      return GenerateMemoryOperandInputs(
-          m.index(), m.scale(), m.base(), m.displacement(),
-          m.displacement_mode(), inputs, input_count);
-    } else {
-      inputs[(*input_count)++] = UseRegister(node->InputAt(0));
-      inputs[(*input_count)++] = UseRegister(node->InputAt(1));
-      return kMode_MR1;
-    }
-  }
-
-  bool CanBeBetterLeftOperand(Node* node) const {
-    return !selector()->IsLive(node);
-  }
-};
-
-
-namespace {
-
-void VisitRO(InstructionSelector* selector, Node* node, ArchOpcode opcode) {
-  IA32OperandGenerator g(selector);
-  selector->Emit(opcode, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
-}
-
-
-void VisitRR(InstructionSelector* selector, Node* node,
-             InstructionCode opcode) {
-  IA32OperandGenerator g(selector);
-  selector->Emit(opcode, g.DefineAsRegister(node),
-                 g.UseRegister(node->InputAt(0)));
-}
-
-
-void VisitRROFloat(InstructionSelector* selector, Node* node,
-                   ArchOpcode avx_opcode, ArchOpcode sse_opcode) {
-  IA32OperandGenerator g(selector);
-  InstructionOperand operand0 = g.UseRegister(node->InputAt(0));
-  InstructionOperand operand1 = g.Use(node->InputAt(1));
-  if (selector->IsSupported(AVX)) {
-    selector->Emit(avx_opcode, g.DefineAsRegister(node), operand0, operand1);
-  } else {
-    selector->Emit(sse_opcode, g.DefineSameAsFirst(node), operand0, operand1);
-  }
-}
-
-
-void VisitFloatUnop(InstructionSelector* selector, Node* node, Node* input,
-                    ArchOpcode avx_opcode, ArchOpcode sse_opcode) {
-  IA32OperandGenerator g(selector);
-  if (selector->IsSupported(AVX)) {
-    selector->Emit(avx_opcode, g.DefineAsRegister(node), g.Use(input));
-  } else {
-    selector->Emit(sse_opcode, g.DefineSameAsFirst(node), g.UseRegister(input));
-  }
-}
-
-
-}  // namespace
-
-void InstructionSelector::VisitStackSlot(Node* node) {
-  StackSlotRepresentation rep = StackSlotRepresentationOf(node->op());
-  int slot = frame_->AllocateSpillSlot(rep.size());
-  OperandGenerator g(this);
-
-  Emit(kArchStackSlot, g.DefineAsRegister(node),
-       sequence()->AddImmediate(Constant(slot)), 0, nullptr);
-}
-
-void InstructionSelector::VisitDebugAbort(Node* node) {
-  IA32OperandGenerator g(this);
-  Emit(kArchDebugAbort, g.NoOutput(), g.UseFixed(node->InputAt(0), edx));
-}
-
-void InstructionSelector::VisitSpeculationFence(Node* node) {
-  IA32OperandGenerator g(this);
-  Emit(kLFence, g.NoOutput());
-}
-
-void InstructionSelector::VisitLoad(Node* node) {
-  LoadRepresentation load_rep = LoadRepresentationOf(node->op());
-
-  ArchOpcode opcode = kArchNop;
-  switch (load_rep.representation()) {
-    case MachineRepresentation::kFloat32:
-      opcode = kIA32Movss;
-      break;
-    case MachineRepresentation::kFloat64:
-      opcode = kIA32Movsd;
-      break;
-    case MachineRepresentation::kBit:  // Fall through.
-    case MachineRepresentation::kWord8:
-      opcode = load_rep.IsSigned() ? kIA32Movsxbl : kIA32Movzxbl;
-      break;
-    case MachineRepresentation::kWord16:
-      opcode = load_rep.IsSigned() ? kIA32Movsxwl : kIA32Movzxwl;
-      break;
-    case MachineRepresentation::kTaggedSigned:   // Fall through.
-    case MachineRepresentation::kTaggedPointer:  // Fall through.
-    case MachineRepresentation::kTagged:         // Fall through.
-    case MachineRepresentation::kWord32:
-      opcode = kIA32Movl;
-      break;
-    case MachineRepresentation::kSimd128:
-      opcode = kIA32Movdqu;
-      break;
-    case MachineRepresentation::kWord64:   // Fall through.
-    case MachineRepresentation::kNone:
-      UNREACHABLE();
-      return;
-  }
-
-  IA32OperandGenerator g(this);
-  InstructionOperand outputs[1];
-  outputs[0] = g.DefineAsRegister(node);
-  InstructionOperand inputs[3];
-  size_t input_count = 0;
-  AddressingMode mode =
-      g.GetEffectiveAddressMemoryOperand(node, inputs, &input_count);
-  InstructionCode code = opcode | AddressingModeField::encode(mode);
-  Emit(code, 1, outputs, input_count, inputs);
-}
-
-void InstructionSelector::VisitProtectedLoad(Node* node) {
-  // TODO(eholk)
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitStore(Node* node) {
-  IA32OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-
-  StoreRepresentation store_rep = StoreRepresentationOf(node->op());
-  WriteBarrierKind write_barrier_kind = store_rep.write_barrier_kind();
-  MachineRepresentation rep = store_rep.representation();
-
-  if (write_barrier_kind != kNoWriteBarrier) {
-    DCHECK(CanBeTaggedPointer(rep));
-    AddressingMode addressing_mode;
-    InstructionOperand inputs[3];
-    size_t input_count = 0;
-    inputs[input_count++] = g.UseUniqueRegister(base);
-    if (g.CanBeImmediate(index)) {
-      inputs[input_count++] = g.UseImmediate(index);
-      addressing_mode = kMode_MRI;
-    } else {
-      inputs[input_count++] = g.UseUniqueRegister(index);
-      addressing_mode = kMode_MR1;
-    }
-    inputs[input_count++] = g.UseUniqueRegister(value);
-    RecordWriteMode record_write_mode = RecordWriteMode::kValueIsAny;
-    switch (write_barrier_kind) {
-      case kNoWriteBarrier:
-        UNREACHABLE();
-        break;
-      case kMapWriteBarrier:
-        record_write_mode = RecordWriteMode::kValueIsMap;
-        break;
-      case kPointerWriteBarrier:
-        record_write_mode = RecordWriteMode::kValueIsPointer;
-        break;
-      case kFullWriteBarrier:
-        record_write_mode = RecordWriteMode::kValueIsAny;
-        break;
-    }
-    InstructionOperand temps[] = {g.TempRegister(), g.TempRegister()};
-    size_t const temp_count = arraysize(temps);
-    InstructionCode code = kArchStoreWithWriteBarrier;
-    code |= AddressingModeField::encode(addressing_mode);
-    code |= MiscField::encode(static_cast<int>(record_write_mode));
-    Emit(code, 0, nullptr, input_count, inputs, temp_count, temps);
-  } else {
-    ArchOpcode opcode = kArchNop;
-    switch (rep) {
-      case MachineRepresentation::kFloat32:
-        opcode = kIA32Movss;
-        break;
-      case MachineRepresentation::kFloat64:
-        opcode = kIA32Movsd;
-        break;
-      case MachineRepresentation::kBit:  // Fall through.
-      case MachineRepresentation::kWord8:
-        opcode = kIA32Movb;
-        break;
-      case MachineRepresentation::kWord16:
-        opcode = kIA32Movw;
-        break;
-      case MachineRepresentation::kTaggedSigned:   // Fall through.
-      case MachineRepresentation::kTaggedPointer:  // Fall through.
-      case MachineRepresentation::kTagged:         // Fall through.
-      case MachineRepresentation::kWord32:
-        opcode = kIA32Movl;
-        break;
-      case MachineRepresentation::kSimd128:
-        opcode = kIA32Movdqu;
-        break;
-      case MachineRepresentation::kWord64:   // Fall through.
-      case MachineRepresentation::kNone:
-        UNREACHABLE();
-        return;
-    }
-
-    InstructionOperand val;
-    if (g.CanBeImmediate(value)) {
-      val = g.UseImmediate(value);
-    } else if (rep == MachineRepresentation::kWord8 ||
-               rep == MachineRepresentation::kBit) {
-      val = g.UseByteRegister(value);
-    } else {
-      val = g.UseRegister(value);
-    }
-
-    InstructionOperand inputs[4];
-    size_t input_count = 0;
-    AddressingMode addressing_mode =
-        g.GetEffectiveAddressMemoryOperand(node, inputs, &input_count);
-    InstructionCode code =
-        opcode | AddressingModeField::encode(addressing_mode);
-    inputs[input_count++] = val;
-    Emit(code, 0, static_cast<InstructionOperand*>(nullptr), input_count,
-         inputs);
-  }
-}
-
-void InstructionSelector::VisitProtectedStore(Node* node) {
-  // TODO(eholk)
-  UNIMPLEMENTED();
-}
-
-// Architecture supports unaligned access, therefore VisitLoad is used instead
-void InstructionSelector::VisitUnalignedLoad(Node* node) { UNREACHABLE(); }
-
-// Architecture supports unaligned access, therefore VisitStore is used instead
-void InstructionSelector::VisitUnalignedStore(Node* node) { UNREACHABLE(); }
-
-namespace {
-
-// Shared routine for multiple binary operations.
-void VisitBinop(InstructionSelector* selector, Node* node,
-                InstructionCode opcode, FlagsContinuation* cont) {
-  IA32OperandGenerator g(selector);
-  Int32BinopMatcher m(node);
-  Node* left = m.left().node();
-  Node* right = m.right().node();
-  InstructionOperand inputs[6];
-  size_t input_count = 0;
-  InstructionOperand outputs[2];
-  size_t output_count = 0;
-
-  // TODO(turbofan): match complex addressing modes.
-  if (left == right) {
-    // If both inputs refer to the same operand, enforce allocating a register
-    // for both of them to ensure that we don't end up generating code like
-    // this:
-    //
-    //   mov eax, [ebp-0x10]
-    //   add eax, [ebp-0x10]
-    //   jo label
-    InstructionOperand const input = g.UseRegister(left);
-    inputs[input_count++] = input;
-    inputs[input_count++] = input;
-  } else if (g.CanBeImmediate(right)) {
-    inputs[input_count++] = g.UseRegister(left);
-    inputs[input_count++] = g.UseImmediate(right);
-  } else {
-    int effect_level = selector->GetEffectLevel(node);
-    if (cont->IsBranch()) {
-      effect_level = selector->GetEffectLevel(
-          cont->true_block()->PredecessorAt(0)->control_input());
-    }
-    if (node->op()->HasProperty(Operator::kCommutative) &&
-        g.CanBeBetterLeftOperand(right) &&
-        (!g.CanBeBetterLeftOperand(left) ||
-         !g.CanBeMemoryOperand(opcode, node, right, effect_level))) {
-      std::swap(left, right);
-    }
-    if (g.CanBeMemoryOperand(opcode, node, right, effect_level)) {
-      inputs[input_count++] = g.UseRegister(left);
-      AddressingMode addressing_mode =
-          g.GetEffectiveAddressMemoryOperand(right, inputs, &input_count);
-      opcode |= AddressingModeField::encode(addressing_mode);
-    } else {
-      inputs[input_count++] = g.UseRegister(left);
-      inputs[input_count++] = g.Use(right);
-    }
-  }
-
-  if (cont->IsBranch()) {
-    inputs[input_count++] = g.Label(cont->true_block());
-    inputs[input_count++] = g.Label(cont->false_block());
-  }
-
-  outputs[output_count++] = g.DefineSameAsFirst(node);
-  if (cont->IsSet()) {
-    outputs[output_count++] = g.DefineAsByteRegister(cont->result());
-  }
-
-  DCHECK_NE(0u, input_count);
-  DCHECK_NE(0u, output_count);
-  DCHECK_GE(arraysize(inputs), input_count);
-  DCHECK_GE(arraysize(outputs), output_count);
-
-  opcode = cont->Encode(opcode);
-  if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(opcode, output_count, outputs, input_count, inputs,
-                             cont->kind(), cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else {
-    selector->Emit(opcode, output_count, outputs, input_count, inputs);
-  }
-}
-
-
-// Shared routine for multiple binary operations.
-void VisitBinop(InstructionSelector* selector, Node* node,
-                InstructionCode opcode) {
-  FlagsContinuation cont;
-  VisitBinop(selector, node, opcode, &cont);
-}
-
-}  // namespace
-
-void InstructionSelector::VisitWord32And(Node* node) {
-  VisitBinop(this, node, kIA32And);
-}
-
-
-void InstructionSelector::VisitWord32Or(Node* node) {
-  VisitBinop(this, node, kIA32Or);
-}
-
-
-void InstructionSelector::VisitWord32Xor(Node* node) {
-  IA32OperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  if (m.right().Is(-1)) {
-    Emit(kIA32Not, g.DefineSameAsFirst(node), g.UseRegister(m.left().node()));
-  } else {
-    VisitBinop(this, node, kIA32Xor);
-  }
-}
-
-
-// Shared routine for multiple shift operations.
-static inline void VisitShift(InstructionSelector* selector, Node* node,
-                              ArchOpcode opcode) {
-  IA32OperandGenerator g(selector);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-
-  if (g.CanBeImmediate(right)) {
-    selector->Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left),
-                   g.UseImmediate(right));
-  } else {
-    selector->Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left),
-                   g.UseFixed(right, ecx));
-  }
-}
-
-
-namespace {
-
-void VisitMulHigh(InstructionSelector* selector, Node* node,
-                  ArchOpcode opcode) {
-  IA32OperandGenerator g(selector);
-  InstructionOperand temps[] = {g.TempRegister(eax)};
-  selector->Emit(
-      opcode, g.DefineAsFixed(node, edx), g.UseFixed(node->InputAt(0), eax),
-      g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps);
-}
-
-
-void VisitDiv(InstructionSelector* selector, Node* node, ArchOpcode opcode) {
-  IA32OperandGenerator g(selector);
-  InstructionOperand temps[] = {g.TempRegister(edx)};
-  selector->Emit(opcode, g.DefineAsFixed(node, eax),
-                 g.UseFixed(node->InputAt(0), eax),
-                 g.UseUnique(node->InputAt(1)), arraysize(temps), temps);
-}
-
-
-void VisitMod(InstructionSelector* selector, Node* node, ArchOpcode opcode) {
-  IA32OperandGenerator g(selector);
-  InstructionOperand temps[] = {g.TempRegister(eax)};
-  selector->Emit(opcode, g.DefineAsFixed(node, edx),
-                 g.UseFixed(node->InputAt(0), eax),
-                 g.UseUnique(node->InputAt(1)), arraysize(temps), temps);
-}
-
-void EmitLea(InstructionSelector* selector, Node* result, Node* index,
-             int scale, Node* base, Node* displacement,
-             DisplacementMode displacement_mode) {
-  IA32OperandGenerator g(selector);
-  InstructionOperand inputs[4];
-  size_t input_count = 0;
-  AddressingMode mode =
-      g.GenerateMemoryOperandInputs(index, scale, base, displacement,
-                                    displacement_mode, inputs, &input_count);
-
-  DCHECK_NE(0u, input_count);
-  DCHECK_GE(arraysize(inputs), input_count);
-
-  InstructionOperand outputs[1];
-  outputs[0] = g.DefineAsRegister(result);
-
-  InstructionCode opcode = AddressingModeField::encode(mode) | kIA32Lea;
-
-  selector->Emit(opcode, 1, outputs, input_count, inputs);
-}
-
-}  // namespace
-
-
-void InstructionSelector::VisitWord32Shl(Node* node) {
-  Int32ScaleMatcher m(node, true);
-  if (m.matches()) {
-    Node* index = node->InputAt(0);
-    Node* base = m.power_of_two_plus_one() ? index : nullptr;
-    EmitLea(this, node, index, m.scale(), base, nullptr, kPositiveDisplacement);
-    return;
-  }
-  VisitShift(this, node, kIA32Shl);
-}
-
-
-void InstructionSelector::VisitWord32Shr(Node* node) {
-  VisitShift(this, node, kIA32Shr);
-}
-
-
-void InstructionSelector::VisitWord32Sar(Node* node) {
-  VisitShift(this, node, kIA32Sar);
-}
-
-void InstructionSelector::VisitInt32PairAdd(Node* node) {
-  IA32OperandGenerator g(this);
-
-  Node* projection1 = NodeProperties::FindProjection(node, 1);
-  if (projection1) {
-    // We use UseUniqueRegister here to avoid register sharing with the temp
-    // register.
-    InstructionOperand inputs[] = {
-        g.UseRegister(node->InputAt(0)), g.UseUniqueRegister(node->InputAt(1)),
-        g.UseRegister(node->InputAt(2)), g.UseUniqueRegister(node->InputAt(3))};
-
-    InstructionOperand outputs[] = {g.DefineSameAsFirst(node),
-                                    g.DefineAsRegister(projection1)};
-
-    InstructionOperand temps[] = {g.TempRegister()};
-
-    Emit(kIA32AddPair, 2, outputs, 4, inputs, 1, temps);
-  } else {
-    // The high word of the result is not used, so we emit the standard 32 bit
-    // instruction.
-    Emit(kIA32Add, g.DefineSameAsFirst(node), g.UseRegister(node->InputAt(0)),
-         g.Use(node->InputAt(2)));
-  }
-}
-
-void InstructionSelector::VisitInt32PairSub(Node* node) {
-  IA32OperandGenerator g(this);
-
-  Node* projection1 = NodeProperties::FindProjection(node, 1);
-  if (projection1) {
-    // We use UseUniqueRegister here to avoid register sharing with the temp
-    // register.
-    InstructionOperand inputs[] = {
-        g.UseRegister(node->InputAt(0)), g.UseUniqueRegister(node->InputAt(1)),
-        g.UseRegister(node->InputAt(2)), g.UseUniqueRegister(node->InputAt(3))};
-
-    InstructionOperand outputs[] = {g.DefineSameAsFirst(node),
-                                    g.DefineAsRegister(projection1)};
-
-    InstructionOperand temps[] = {g.TempRegister()};
-
-    Emit(kIA32SubPair, 2, outputs, 4, inputs, 1, temps);
-  } else {
-    // The high word of the result is not used, so we emit the standard 32 bit
-    // instruction.
-    Emit(kIA32Sub, g.DefineSameAsFirst(node), g.UseRegister(node->InputAt(0)),
-         g.Use(node->InputAt(2)));
-  }
-}
-
-void InstructionSelector::VisitInt32PairMul(Node* node) {
-  IA32OperandGenerator g(this);
-
-  Node* projection1 = NodeProperties::FindProjection(node, 1);
-  if (projection1) {
-    // InputAt(3) explicitly shares ecx with OutputRegister(1) to save one
-    // register and one mov instruction.
-    InstructionOperand inputs[] = {g.UseUnique(node->InputAt(0)),
-                                   g.UseUnique(node->InputAt(1)),
-                                   g.UseUniqueRegister(node->InputAt(2)),
-                                   g.UseFixed(node->InputAt(3), ecx)};
-
-    InstructionOperand outputs[] = {
-        g.DefineAsFixed(node, eax),
-        g.DefineAsFixed(NodeProperties::FindProjection(node, 1), ecx)};
-
-    InstructionOperand temps[] = {g.TempRegister(edx)};
-
-    Emit(kIA32MulPair, 2, outputs, 4, inputs, 1, temps);
-  } else {
-    // The high word of the result is not used, so we emit the standard 32 bit
-    // instruction.
-    Emit(kIA32Imul, g.DefineSameAsFirst(node), g.UseRegister(node->InputAt(0)),
-         g.Use(node->InputAt(2)));
-  }
-}
-
-void VisitWord32PairShift(InstructionSelector* selector, InstructionCode opcode,
-                          Node* node) {
-  IA32OperandGenerator g(selector);
-
-  Node* shift = node->InputAt(2);
-  InstructionOperand shift_operand;
-  if (g.CanBeImmediate(shift)) {
-    shift_operand = g.UseImmediate(shift);
-  } else {
-    shift_operand = g.UseFixed(shift, ecx);
-  }
-  InstructionOperand inputs[] = {g.UseFixed(node->InputAt(0), eax),
-                                 g.UseFixed(node->InputAt(1), edx),
-                                 shift_operand};
-
-  InstructionOperand outputs[2];
-  InstructionOperand temps[1];
-  int32_t output_count = 0;
-  int32_t temp_count = 0;
-  outputs[output_count++] = g.DefineAsFixed(node, eax);
-  Node* projection1 = NodeProperties::FindProjection(node, 1);
-  if (projection1) {
-    outputs[output_count++] = g.DefineAsFixed(projection1, edx);
-  } else {
-    temps[temp_count++] = g.TempRegister(edx);
-  }
-
-  selector->Emit(opcode, output_count, outputs, 3, inputs, temp_count, temps);
-}
-
-void InstructionSelector::VisitWord32PairShl(Node* node) {
-  VisitWord32PairShift(this, kIA32ShlPair, node);
-}
-
-void InstructionSelector::VisitWord32PairShr(Node* node) {
-  VisitWord32PairShift(this, kIA32ShrPair, node);
-}
-
-void InstructionSelector::VisitWord32PairSar(Node* node) {
-  VisitWord32PairShift(this, kIA32SarPair, node);
-}
-
-void InstructionSelector::VisitWord32Ror(Node* node) {
-  VisitShift(this, node, kIA32Ror);
-}
-
-#define RO_OP_LIST(V)                                     \
-  V(Word32Clz, kIA32Lzcnt)                                \
-  V(Word32Ctz, kIA32Tzcnt)                                \
-  V(Word32Popcnt, kIA32Popcnt)                            \
-  V(ChangeFloat32ToFloat64, kSSEFloat32ToFloat64)         \
-  V(RoundInt32ToFloat32, kSSEInt32ToFloat32)              \
-  V(ChangeInt32ToFloat64, kSSEInt32ToFloat64)             \
-  V(ChangeUint32ToFloat64, kSSEUint32ToFloat64)           \
-  V(TruncateFloat32ToInt32, kSSEFloat32ToInt32)           \
-  V(TruncateFloat32ToUint32, kSSEFloat32ToUint32)         \
-  V(ChangeFloat64ToInt32, kSSEFloat64ToInt32)             \
-  V(ChangeFloat64ToUint32, kSSEFloat64ToUint32)           \
-  V(TruncateFloat64ToUint32, kSSEFloat64ToUint32)         \
-  V(TruncateFloat64ToFloat32, kSSEFloat64ToFloat32)       \
-  V(RoundFloat64ToInt32, kSSEFloat64ToInt32)              \
-  V(BitcastFloat32ToInt32, kIA32BitcastFI)                \
-  V(BitcastInt32ToFloat32, kIA32BitcastIF)                \
-  V(Float32Sqrt, kSSEFloat32Sqrt)                         \
-  V(Float64Sqrt, kSSEFloat64Sqrt)                         \
-  V(Float64ExtractLowWord32, kSSEFloat64ExtractLowWord32) \
-  V(Float64ExtractHighWord32, kSSEFloat64ExtractHighWord32)
-
-#define RR_OP_LIST(V)                                                         \
-  V(TruncateFloat64ToWord32, kArchTruncateDoubleToI)                          \
-  V(Float32RoundDown, kSSEFloat32Round | MiscField::encode(kRoundDown))       \
-  V(Float64RoundDown, kSSEFloat64Round | MiscField::encode(kRoundDown))       \
-  V(Float32RoundUp, kSSEFloat32Round | MiscField::encode(kRoundUp))           \
-  V(Float64RoundUp, kSSEFloat64Round | MiscField::encode(kRoundUp))           \
-  V(Float32RoundTruncate, kSSEFloat32Round | MiscField::encode(kRoundToZero)) \
-  V(Float64RoundTruncate, kSSEFloat64Round | MiscField::encode(kRoundToZero)) \
-  V(Float32RoundTiesEven,                                                     \
-    kSSEFloat32Round | MiscField::encode(kRoundToNearest))                    \
-  V(Float64RoundTiesEven, kSSEFloat64Round | MiscField::encode(kRoundToNearest))
-
-#define RRO_FLOAT_OP_LIST(V)                    \
-  V(Float32Add, kAVXFloat32Add, kSSEFloat32Add) \
-  V(Float64Add, kAVXFloat64Add, kSSEFloat64Add) \
-  V(Float32Sub, kAVXFloat32Sub, kSSEFloat32Sub) \
-  V(Float64Sub, kAVXFloat64Sub, kSSEFloat64Sub) \
-  V(Float32Mul, kAVXFloat32Mul, kSSEFloat32Mul) \
-  V(Float64Mul, kAVXFloat64Mul, kSSEFloat64Mul) \
-  V(Float32Div, kAVXFloat32Div, kSSEFloat32Div) \
-  V(Float64Div, kAVXFloat64Div, kSSEFloat64Div)
-
-#define FLOAT_UNOP_LIST(V)                      \
-  V(Float32Abs, kAVXFloat32Abs, kSSEFloat32Abs) \
-  V(Float64Abs, kAVXFloat64Abs, kSSEFloat64Abs) \
-  V(Float32Neg, kAVXFloat32Neg, kSSEFloat32Neg) \
-  V(Float64Neg, kAVXFloat64Neg, kSSEFloat64Neg)
-
-#define RO_VISITOR(Name, opcode)                      \
-  void InstructionSelector::Visit##Name(Node* node) { \
-    VisitRO(this, node, opcode);                      \
-  }
-RO_OP_LIST(RO_VISITOR)
-#undef RO_VISITOR
-
-#define RR_VISITOR(Name, opcode)                      \
-  void InstructionSelector::Visit##Name(Node* node) { \
-    VisitRR(this, node, opcode);                      \
-  }
-RR_OP_LIST(RR_VISITOR)
-#undef RR_VISITOR
-
-#define RRO_FLOAT_VISITOR(Name, avx, sse)             \
-  void InstructionSelector::Visit##Name(Node* node) { \
-    VisitRROFloat(this, node, avx, sse);              \
-  }
-RRO_FLOAT_OP_LIST(RRO_FLOAT_VISITOR)
-#undef RRO_FLOAT_VISITOR
-
-#define FLOAT_UNOP_VISITOR(Name, avx, sse)                  \
-  void InstructionSelector::Visit##Name(Node* node) {       \
-    VisitFloatUnop(this, node, node->InputAt(0), avx, sse); \
-  }
-FLOAT_UNOP_LIST(FLOAT_UNOP_VISITOR)
-#undef FLOAT_UNOP_VISITOR
-
-void InstructionSelector::VisitWord32ReverseBits(Node* node) { UNREACHABLE(); }
-
-void InstructionSelector::VisitWord64ReverseBytes(Node* node) { UNREACHABLE(); }
-
-void InstructionSelector::VisitWord32ReverseBytes(Node* node) { UNREACHABLE(); }
-
-void InstructionSelector::VisitInt32Add(Node* node) {
-  IA32OperandGenerator g(this);
-
-  // Try to match the Add to a lea pattern
-  BaseWithIndexAndDisplacement32Matcher m(node);
-  if (m.matches() &&
-      (m.displacement() == nullptr || g.CanBeImmediate(m.displacement()))) {
-    InstructionOperand inputs[4];
-    size_t input_count = 0;
-    AddressingMode mode = g.GenerateMemoryOperandInputs(
-        m.index(), m.scale(), m.base(), m.displacement(), m.displacement_mode(),
-        inputs, &input_count);
-
-    DCHECK_NE(0u, input_count);
-    DCHECK_GE(arraysize(inputs), input_count);
-
-    InstructionOperand outputs[1];
-    outputs[0] = g.DefineAsRegister(node);
-
-    InstructionCode opcode = AddressingModeField::encode(mode) | kIA32Lea;
-    Emit(opcode, 1, outputs, input_count, inputs);
-    return;
-  }
-
-  // No lea pattern match, use add
-  VisitBinop(this, node, kIA32Add);
-}
-
-
-void InstructionSelector::VisitInt32Sub(Node* node) {
-  IA32OperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  if (m.left().Is(0)) {
-    Emit(kIA32Neg, g.DefineSameAsFirst(node), g.Use(m.right().node()));
-  } else {
-    VisitBinop(this, node, kIA32Sub);
-  }
-}
-
-
-void InstructionSelector::VisitInt32Mul(Node* node) {
-  Int32ScaleMatcher m(node, true);
-  if (m.matches()) {
-    Node* index = node->InputAt(0);
-    Node* base = m.power_of_two_plus_one() ? index : nullptr;
-    EmitLea(this, node, index, m.scale(), base, nullptr, kPositiveDisplacement);
-    return;
-  }
-  IA32OperandGenerator g(this);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-  if (g.CanBeImmediate(right)) {
-    Emit(kIA32Imul, g.DefineAsRegister(node), g.Use(left),
-         g.UseImmediate(right));
-  } else {
-    if (g.CanBeBetterLeftOperand(right)) {
-      std::swap(left, right);
-    }
-    Emit(kIA32Imul, g.DefineSameAsFirst(node), g.UseRegister(left),
-         g.Use(right));
-  }
-}
-
-
-void InstructionSelector::VisitInt32MulHigh(Node* node) {
-  VisitMulHigh(this, node, kIA32ImulHigh);
-}
-
-
-void InstructionSelector::VisitUint32MulHigh(Node* node) {
-  VisitMulHigh(this, node, kIA32UmulHigh);
-}
-
-
-void InstructionSelector::VisitInt32Div(Node* node) {
-  VisitDiv(this, node, kIA32Idiv);
-}
-
-
-void InstructionSelector::VisitUint32Div(Node* node) {
-  VisitDiv(this, node, kIA32Udiv);
-}
-
-
-void InstructionSelector::VisitInt32Mod(Node* node) {
-  VisitMod(this, node, kIA32Idiv);
-}
-
-
-void InstructionSelector::VisitUint32Mod(Node* node) {
-  VisitMod(this, node, kIA32Udiv);
-}
-
-
-void InstructionSelector::VisitRoundUint32ToFloat32(Node* node) {
-  IA32OperandGenerator g(this);
-  InstructionOperand temps[] = {g.TempRegister(), g.TempRegister()};
-  Emit(kSSEUint32ToFloat32, g.DefineAsRegister(node), g.Use(node->InputAt(0)),
-       arraysize(temps), temps);
-}
-
-void InstructionSelector::VisitFloat64Mod(Node* node) {
-  IA32OperandGenerator g(this);
-  InstructionOperand temps[] = {g.TempRegister(eax)};
-  Emit(kSSEFloat64Mod, g.DefineSameAsFirst(node),
-       g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)), 1,
-       temps);
-}
-
-void InstructionSelector::VisitFloat32Max(Node* node) {
-  IA32OperandGenerator g(this);
-  InstructionOperand temps[] = {g.TempRegister()};
-  Emit(kSSEFloat32Max, g.DefineSameAsFirst(node),
-       g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1)),
-       arraysize(temps), temps);
-}
-
-void InstructionSelector::VisitFloat64Max(Node* node) {
-  IA32OperandGenerator g(this);
-  InstructionOperand temps[] = {g.TempRegister()};
-  Emit(kSSEFloat64Max, g.DefineSameAsFirst(node),
-       g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1)),
-       arraysize(temps), temps);
-}
-
-void InstructionSelector::VisitFloat32Min(Node* node) {
-  IA32OperandGenerator g(this);
-  InstructionOperand temps[] = {g.TempRegister()};
-  Emit(kSSEFloat32Min, g.DefineSameAsFirst(node),
-       g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1)),
-       arraysize(temps), temps);
-}
-
-void InstructionSelector::VisitFloat64Min(Node* node) {
-  IA32OperandGenerator g(this);
-  InstructionOperand temps[] = {g.TempRegister()};
-  Emit(kSSEFloat64Min, g.DefineSameAsFirst(node),
-       g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1)),
-       arraysize(temps), temps);
-}
-
-void InstructionSelector::VisitFloat64RoundTiesAway(Node* node) {
-  UNREACHABLE();
-}
-
-void InstructionSelector::VisitFloat64Ieee754Binop(Node* node,
-                                                   InstructionCode opcode) {
-  IA32OperandGenerator g(this);
-  Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(node->InputAt(0)),
-       g.UseRegister(node->InputAt(1)))
-      ->MarkAsCall();
-}
-
-void InstructionSelector::VisitFloat64Ieee754Unop(Node* node,
-                                                  InstructionCode opcode) {
-  IA32OperandGenerator g(this);
-  Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(node->InputAt(0)))
-      ->MarkAsCall();
-}
-
-void InstructionSelector::EmitPrepareArguments(
-    ZoneVector<PushParameter>* arguments, const CallDescriptor* descriptor,
-    Node* node) {
-  IA32OperandGenerator g(this);
-
-  // Prepare for C function call.
-  if (descriptor->IsCFunctionCall()) {
-    InstructionOperand temps[] = {g.TempRegister()};
-    size_t const temp_count = arraysize(temps);
-    Emit(kArchPrepareCallCFunction |
-             MiscField::encode(static_cast<int>(descriptor->ParameterCount())),
-         0, nullptr, 0, nullptr, temp_count, temps);
-
-    // Poke any stack arguments.
-    for (size_t n = 0; n < arguments->size(); ++n) {
-      PushParameter input = (*arguments)[n];
-      if (input.node) {
-        int const slot = static_cast<int>(n);
-        InstructionOperand value = g.CanBeImmediate(node)
-                                       ? g.UseImmediate(input.node)
-                                       : g.UseRegister(input.node);
-        Emit(kIA32Poke | MiscField::encode(slot), g.NoOutput(), value);
-      }
-    }
-  } else {
-    // Push any stack arguments.
-    int effect_level = GetEffectLevel(node);
-    for (PushParameter input : base::Reversed(*arguments)) {
-      // Skip any alignment holes in pushed nodes.
-      if (input.node == nullptr) continue;
-      if (g.CanBeMemoryOperand(kIA32Push, node, input.node, effect_level)) {
-        InstructionOperand outputs[1];
-        InstructionOperand inputs[4];
-        size_t input_count = 0;
-        InstructionCode opcode = kIA32Push;
-        AddressingMode mode = g.GetEffectiveAddressMemoryOperand(
-            input.node, inputs, &input_count);
-        opcode |= AddressingModeField::encode(mode);
-        Emit(opcode, 0, outputs, input_count, inputs);
-      } else {
-        InstructionOperand value =
-            g.CanBeImmediate(input.node)
-                ? g.UseImmediate(input.node)
-                : IsSupported(ATOM) ||
-                          sequence()->IsFP(GetVirtualRegister(input.node))
-                      ? g.UseRegister(input.node)
-                      : g.Use(input.node);
-        if (input.location.GetType() == MachineType::Float32()) {
-          Emit(kIA32PushFloat32, g.NoOutput(), value);
-        } else if (input.location.GetType() == MachineType::Float64()) {
-          Emit(kIA32PushFloat64, g.NoOutput(), value);
-        } else if (input.location.GetType() == MachineType::Simd128()) {
-          Emit(kIA32PushSimd128, g.NoOutput(), value);
-        } else {
-          Emit(kIA32Push, g.NoOutput(), value);
-        }
-      }
-    }
-  }
-}
-
-void InstructionSelector::EmitPrepareResults(ZoneVector<PushParameter>* results,
-                                             const CallDescriptor* descriptor,
-                                             Node* node) {
-  IA32OperandGenerator g(this);
-
-  int reverse_slot = 0;
-  for (PushParameter output : *results) {
-    if (!output.location.IsCallerFrameSlot()) continue;
-    // Skip any alignment holes in nodes.
-    if (output.node != nullptr) {
-      DCHECK(!descriptor->IsCFunctionCall());
-      if (output.location.GetType() == MachineType::Float32()) {
-        MarkAsFloat32(output.node);
-      } else if (output.location.GetType() == MachineType::Float64()) {
-        MarkAsFloat64(output.node);
-      }
-      Emit(kIA32Peek, g.DefineAsRegister(output.node),
-           g.UseImmediate(reverse_slot));
-    }
-    reverse_slot += output.location.GetSizeInPointers();
-  }
-}
-
-
-bool InstructionSelector::IsTailCallAddressImmediate() { return true; }
-
-int InstructionSelector::GetTempsCountForTailCallFromJSFunction() { return 0; }
-
-namespace {
-
-void VisitCompareWithMemoryOperand(InstructionSelector* selector,
-                                   InstructionCode opcode, Node* left,
-                                   InstructionOperand right,
-                                   FlagsContinuation* cont) {
-  DCHECK_EQ(IrOpcode::kLoad, left->opcode());
-  IA32OperandGenerator g(selector);
-  size_t input_count = 0;
-  InstructionOperand inputs[6];
-  AddressingMode addressing_mode =
-      g.GetEffectiveAddressMemoryOperand(left, inputs, &input_count);
-  opcode |= AddressingModeField::encode(addressing_mode);
-  opcode = cont->Encode(opcode);
-  inputs[input_count++] = right;
-
-  if (cont->IsBranch()) {
-    inputs[input_count++] = g.Label(cont->true_block());
-    inputs[input_count++] = g.Label(cont->false_block());
-    selector->Emit(opcode, 0, nullptr, input_count, inputs);
-  } else if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(opcode, 0, nullptr, input_count, inputs,
-                             cont->kind(), cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else if (cont->IsSet()) {
-    InstructionOperand output = g.DefineAsRegister(cont->result());
-    selector->Emit(opcode, 1, &output, input_count, inputs);
-  } else {
-    DCHECK(cont->IsTrap());
-    inputs[input_count++] = g.UseImmediate(cont->trap_id());
-    selector->Emit(opcode, 0, nullptr, input_count, inputs);
-  }
-}
-
-// Shared routine for multiple compare operations.
-void VisitCompare(InstructionSelector* selector, InstructionCode opcode,
-                  InstructionOperand left, InstructionOperand right,
-                  FlagsContinuation* cont) {
-  IA32OperandGenerator g(selector);
-  opcode = cont->Encode(opcode);
-  if (cont->IsBranch()) {
-    selector->Emit(opcode, g.NoOutput(), left, right,
-                   g.Label(cont->true_block()), g.Label(cont->false_block()));
-  } else if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(opcode, g.NoOutput(), left, right, cont->kind(),
-                             cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else if (cont->IsSet()) {
-    selector->Emit(opcode, g.DefineAsByteRegister(cont->result()), left, right);
-  } else {
-    DCHECK(cont->IsTrap());
-    selector->Emit(opcode, g.NoOutput(), left, right,
-                   g.UseImmediate(cont->trap_id()));
-  }
-}
-
-
-// Shared routine for multiple compare operations.
-void VisitCompare(InstructionSelector* selector, InstructionCode opcode,
-                  Node* left, Node* right, FlagsContinuation* cont,
-                  bool commutative) {
-  IA32OperandGenerator g(selector);
-  if (commutative && g.CanBeBetterLeftOperand(right)) {
-    std::swap(left, right);
-  }
-  VisitCompare(selector, opcode, g.UseRegister(left), g.Use(right), cont);
-}
-
-MachineType MachineTypeForNarrow(Node* node, Node* hint_node) {
-  if (hint_node->opcode() == IrOpcode::kLoad) {
-    MachineType hint = LoadRepresentationOf(hint_node->op());
-    if (node->opcode() == IrOpcode::kInt32Constant ||
-        node->opcode() == IrOpcode::kInt64Constant) {
-      int64_t constant = node->opcode() == IrOpcode::kInt32Constant
-                             ? OpParameter<int32_t>(node)
-                             : OpParameter<int64_t>(node);
-      if (hint == MachineType::Int8()) {
-        if (constant >= std::numeric_limits<int8_t>::min() &&
-            constant <= std::numeric_limits<int8_t>::max()) {
-          return hint;
-        }
-      } else if (hint == MachineType::Uint8()) {
-        if (constant >= std::numeric_limits<uint8_t>::min() &&
-            constant <= std::numeric_limits<uint8_t>::max()) {
-          return hint;
-        }
-      } else if (hint == MachineType::Int16()) {
-        if (constant >= std::numeric_limits<int16_t>::min() &&
-            constant <= std::numeric_limits<int16_t>::max()) {
-          return hint;
-        }
-      } else if (hint == MachineType::Uint16()) {
-        if (constant >= std::numeric_limits<uint16_t>::min() &&
-            constant <= std::numeric_limits<uint16_t>::max()) {
-          return hint;
-        }
-      } else if (hint == MachineType::Int32()) {
-        return hint;
-      } else if (hint == MachineType::Uint32()) {
-        if (constant >= 0) return hint;
-      }
-    }
-  }
-  return node->opcode() == IrOpcode::kLoad ? LoadRepresentationOf(node->op())
-                                           : MachineType::None();
-}
-
-// Tries to match the size of the given opcode to that of the operands, if
-// possible.
-InstructionCode TryNarrowOpcodeSize(InstructionCode opcode, Node* left,
-                                    Node* right, FlagsContinuation* cont) {
-  // TODO(epertoso): we can probably get some size information out of phi nodes.
-  // If the load representations don't match, both operands will be
-  // zero/sign-extended to 32bit.
-  MachineType left_type = MachineTypeForNarrow(left, right);
-  MachineType right_type = MachineTypeForNarrow(right, left);
-  if (left_type == right_type) {
-    switch (left_type.representation()) {
-      case MachineRepresentation::kBit:
-      case MachineRepresentation::kWord8: {
-        if (opcode == kIA32Test) return kIA32Test8;
-        if (opcode == kIA32Cmp) {
-          if (left_type.semantic() == MachineSemantic::kUint32) {
-            cont->OverwriteUnsignedIfSigned();
-          } else {
-            CHECK_EQ(MachineSemantic::kInt32, left_type.semantic());
-          }
-          return kIA32Cmp8;
-        }
-        break;
-      }
-      case MachineRepresentation::kWord16:
-        if (opcode == kIA32Test) return kIA32Test16;
-        if (opcode == kIA32Cmp) {
-          if (left_type.semantic() == MachineSemantic::kUint32) {
-            cont->OverwriteUnsignedIfSigned();
-          } else {
-            CHECK_EQ(MachineSemantic::kInt32, left_type.semantic());
-          }
-          return kIA32Cmp16;
-        }
-        break;
-      default:
-        break;
-    }
-  }
-  return opcode;
-}
-
-// Shared routine for multiple float32 compare operations (inputs commuted).
-void VisitFloat32Compare(InstructionSelector* selector, Node* node,
-                         FlagsContinuation* cont) {
-  Node* const left = node->InputAt(0);
-  Node* const right = node->InputAt(1);
-  VisitCompare(selector, kSSEFloat32Cmp, right, left, cont, false);
-}
-
-
-// Shared routine for multiple float64 compare operations (inputs commuted).
-void VisitFloat64Compare(InstructionSelector* selector, Node* node,
-                         FlagsContinuation* cont) {
-  Node* const left = node->InputAt(0);
-  Node* const right = node->InputAt(1);
-  VisitCompare(selector, kSSEFloat64Cmp, right, left, cont, false);
-}
-
-// Shared routine for multiple word compare operations.
-void VisitWordCompare(InstructionSelector* selector, Node* node,
-                      InstructionCode opcode, FlagsContinuation* cont) {
-  IA32OperandGenerator g(selector);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-
-  InstructionCode narrowed_opcode =
-      TryNarrowOpcodeSize(opcode, left, right, cont);
-
-  int effect_level = selector->GetEffectLevel(node);
-  if (cont->IsBranch()) {
-    effect_level = selector->GetEffectLevel(
-        cont->true_block()->PredecessorAt(0)->control_input());
-  }
-
-  // If one of the two inputs is an immediate, make sure it's on the right, or
-  // if one of the two inputs is a memory operand, make sure it's on the left.
-  if ((!g.CanBeImmediate(right) && g.CanBeImmediate(left)) ||
-      (g.CanBeMemoryOperand(narrowed_opcode, node, right, effect_level) &&
-       !g.CanBeMemoryOperand(narrowed_opcode, node, left, effect_level))) {
-    if (!node->op()->HasProperty(Operator::kCommutative)) cont->Commute();
-    std::swap(left, right);
-  }
-
-  // Match immediates on right side of comparison.
-  if (g.CanBeImmediate(right)) {
-    if (g.CanBeMemoryOperand(narrowed_opcode, node, left, effect_level)) {
-      return VisitCompareWithMemoryOperand(selector, narrowed_opcode, left,
-                                           g.UseImmediate(right), cont);
-    }
-    return VisitCompare(selector, opcode, g.Use(left), g.UseImmediate(right),
-                        cont);
-  }
-
-  // Match memory operands on left side of comparison.
-  if (g.CanBeMemoryOperand(narrowed_opcode, node, left, effect_level)) {
-    bool needs_byte_register =
-        narrowed_opcode == kIA32Test8 || narrowed_opcode == kIA32Cmp8;
-    return VisitCompareWithMemoryOperand(
-        selector, narrowed_opcode, left,
-        needs_byte_register ? g.UseByteRegister(right) : g.UseRegister(right),
-        cont);
-  }
-
-  return VisitCompare(selector, opcode, left, right, cont,
-                      node->op()->HasProperty(Operator::kCommutative));
-}
-
-void VisitWordCompare(InstructionSelector* selector, Node* node,
-                      FlagsContinuation* cont) {
-  IA32OperandGenerator g(selector);
-  Int32BinopMatcher m(node);
-  if (m.left().IsLoad() && m.right().IsLoadStackPointer()) {
-    LoadMatcher<ExternalReferenceMatcher> mleft(m.left().node());
-    ExternalReference js_stack_limit =
-        ExternalReference::address_of_stack_limit(selector->isolate());
-    if (mleft.object().Is(js_stack_limit) && mleft.index().Is(0)) {
-      // Compare(Load(js_stack_limit), LoadStackPointer)
-      if (!node->op()->HasProperty(Operator::kCommutative)) cont->Commute();
-      InstructionCode opcode = cont->Encode(kIA32StackCheck);
-      if (cont->IsBranch()) {
-        selector->Emit(opcode, g.NoOutput(), g.Label(cont->true_block()),
-                       g.Label(cont->false_block()));
-      } else if (cont->IsDeoptimize()) {
-        selector->EmitDeoptimize(opcode, 0, nullptr, 0, nullptr, cont->kind(),
-                                 cont->reason(), cont->feedback(),
-                                 cont->frame_state());
-      } else {
-        DCHECK(cont->IsSet());
-        selector->Emit(opcode, g.DefineAsRegister(cont->result()));
-      }
-      return;
-    }
-  }
-  VisitWordCompare(selector, node, kIA32Cmp, cont);
-}
-
-
-// Shared routine for word comparison with zero.
-void VisitWordCompareZero(InstructionSelector* selector, Node* user,
-                          Node* value, FlagsContinuation* cont) {
-  // Try to combine with comparisons against 0 by simply inverting the branch.
-  while (value->opcode() == IrOpcode::kWord32Equal &&
-         selector->CanCover(user, value)) {
-    Int32BinopMatcher m(value);
-    if (!m.right().Is(0)) break;
-
-    user = value;
-    value = m.left().node();
-    cont->Negate();
-  }
-
-  if (selector->CanCover(user, value)) {
-    switch (value->opcode()) {
-      case IrOpcode::kWord32Equal:
-        cont->OverwriteAndNegateIfEqual(kEqual);
-        return VisitWordCompare(selector, value, cont);
-      case IrOpcode::kInt32LessThan:
-        cont->OverwriteAndNegateIfEqual(kSignedLessThan);
-        return VisitWordCompare(selector, value, cont);
-      case IrOpcode::kInt32LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kSignedLessThanOrEqual);
-        return VisitWordCompare(selector, value, cont);
-      case IrOpcode::kUint32LessThan:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThan);
-        return VisitWordCompare(selector, value, cont);
-      case IrOpcode::kUint32LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
-        return VisitWordCompare(selector, value, cont);
-      case IrOpcode::kFloat32Equal:
-        cont->OverwriteAndNegateIfEqual(kUnorderedEqual);
-        return VisitFloat32Compare(selector, value, cont);
-      case IrOpcode::kFloat32LessThan:
-        cont->OverwriteAndNegateIfEqual(kUnsignedGreaterThan);
-        return VisitFloat32Compare(selector, value, cont);
-      case IrOpcode::kFloat32LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kUnsignedGreaterThanOrEqual);
-        return VisitFloat32Compare(selector, value, cont);
-      case IrOpcode::kFloat64Equal:
-        cont->OverwriteAndNegateIfEqual(kUnorderedEqual);
-        return VisitFloat64Compare(selector, value, cont);
-      case IrOpcode::kFloat64LessThan:
-        cont->OverwriteAndNegateIfEqual(kUnsignedGreaterThan);
-        return VisitFloat64Compare(selector, value, cont);
-      case IrOpcode::kFloat64LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kUnsignedGreaterThanOrEqual);
-        return VisitFloat64Compare(selector, value, cont);
-      case IrOpcode::kProjection:
-        // Check if this is the overflow output projection of an
-        // <Operation>WithOverflow node.
-        if (ProjectionIndexOf(value->op()) == 1u) {
-          // We cannot combine the <Operation>WithOverflow with this branch
-          // unless the 0th projection (the use of the actual value of the
-          // <Operation> is either nullptr, which means there's no use of the
-          // actual value, or was already defined, which means it is scheduled
-          // *AFTER* this branch).
-          Node* const node = value->InputAt(0);
-          Node* const result = NodeProperties::FindProjection(node, 0);
-          if (result == nullptr || selector->IsDefined(result)) {
-            switch (node->opcode()) {
-              case IrOpcode::kInt32AddWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitBinop(selector, node, kIA32Add, cont);
-              case IrOpcode::kInt32SubWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitBinop(selector, node, kIA32Sub, cont);
-              case IrOpcode::kInt32MulWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitBinop(selector, node, kIA32Imul, cont);
-              default:
-                break;
-            }
-          }
-        }
-        break;
-      case IrOpcode::kInt32Sub:
-        return VisitWordCompare(selector, value, cont);
-      case IrOpcode::kWord32And:
-        return VisitWordCompare(selector, value, kIA32Test, cont);
-      default:
-        break;
-    }
-  }
-
-  // Continuation could not be combined with a compare, emit compare against 0.
-  IA32OperandGenerator g(selector);
-  VisitCompare(selector, kIA32Cmp, g.Use(value), g.TempImmediate(0), cont);
-}
-
-}  // namespace
-
-void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch,
-                                      BasicBlock* fbranch) {
-  FlagsContinuation cont(kNotEqual, tbranch, fbranch);
-  VisitWordCompareZero(this, branch, branch->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitDeoptimizeIf(Node* node) {
-  DeoptimizeParameters p = DeoptimizeParametersOf(node->op());
-  FlagsContinuation cont = FlagsContinuation::ForDeoptimize(
-      kNotEqual, p.kind(), p.reason(), p.feedback(), node->InputAt(1));
-  VisitWordCompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitDeoptimizeUnless(Node* node) {
-  DeoptimizeParameters p = DeoptimizeParametersOf(node->op());
-  FlagsContinuation cont = FlagsContinuation::ForDeoptimize(
-      kEqual, p.kind(), p.reason(), p.feedback(), node->InputAt(1));
-  VisitWordCompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitTrapIf(Node* node, Runtime::FunctionId func_id) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForTrap(kNotEqual, func_id, node->InputAt(1));
-  VisitWordCompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitTrapUnless(Node* node,
-                                          Runtime::FunctionId func_id) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForTrap(kEqual, func_id, node->InputAt(1));
-  VisitWordCompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitSwitch(Node* node, const SwitchInfo& sw) {
-  IA32OperandGenerator g(this);
-  InstructionOperand value_operand = g.UseRegister(node->InputAt(0));
-
-  // Emit either ArchTableSwitch or ArchLookupSwitch.
-  static const size_t kMaxTableSwitchValueRange = 2 << 16;
-  size_t table_space_cost = 4 + sw.value_range;
-  size_t table_time_cost = 3;
-  size_t lookup_space_cost = 3 + 2 * sw.case_count;
-  size_t lookup_time_cost = sw.case_count;
-  if (sw.case_count > 4 &&
-      table_space_cost + 3 * table_time_cost <=
-          lookup_space_cost + 3 * lookup_time_cost &&
-      sw.min_value > std::numeric_limits<int32_t>::min() &&
-      sw.value_range <= kMaxTableSwitchValueRange) {
-    InstructionOperand index_operand = value_operand;
-    if (sw.min_value) {
-      index_operand = g.TempRegister();
-      Emit(kIA32Lea | AddressingModeField::encode(kMode_MRI), index_operand,
-           value_operand, g.TempImmediate(-sw.min_value));
-    }
-    // Generate a table lookup.
-    return EmitTableSwitch(sw, index_operand);
-  }
-
-  // Generate a sequence of conditional jumps.
-  return EmitLookupSwitch(sw, value_operand);
-}
-
-
-void InstructionSelector::VisitWord32Equal(Node* const node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
-  Int32BinopMatcher m(node);
-  if (m.right().Is(0)) {
-    return VisitWordCompareZero(this, m.node(), m.left().node(), &cont);
-  }
-  VisitWordCompare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitInt32LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kSignedLessThan, node);
-  VisitWordCompare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitInt32LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kSignedLessThanOrEqual, node);
-  VisitWordCompare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitUint32LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kUnsignedLessThan, node);
-  VisitWordCompare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitUint32LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedLessThanOrEqual, node);
-  VisitWordCompare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitInt32AddWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    return VisitBinop(this, node, kIA32Add, &cont);
-  }
-  FlagsContinuation cont;
-  VisitBinop(this, node, kIA32Add, &cont);
-}
-
-
-void InstructionSelector::VisitInt32SubWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    return VisitBinop(this, node, kIA32Sub, &cont);
-  }
-  FlagsContinuation cont;
-  VisitBinop(this, node, kIA32Sub, &cont);
-}
-
-void InstructionSelector::VisitInt32MulWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    return VisitBinop(this, node, kIA32Imul, &cont);
-  }
-  FlagsContinuation cont;
-  VisitBinop(this, node, kIA32Imul, &cont);
-}
-
-void InstructionSelector::VisitFloat32Equal(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kUnorderedEqual, node);
-  VisitFloat32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat32LessThan(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedGreaterThan, node);
-  VisitFloat32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat32LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedGreaterThanOrEqual, node);
-  VisitFloat32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat64Equal(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kUnorderedEqual, node);
-  VisitFloat64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat64LessThan(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedGreaterThan, node);
-  VisitFloat64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedGreaterThanOrEqual, node);
-  VisitFloat64Compare(this, node, &cont);
-}
-
-
-
-void InstructionSelector::VisitFloat64InsertLowWord32(Node* node) {
-  IA32OperandGenerator g(this);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-  Float64Matcher mleft(left);
-  if (mleft.HasValue() && (bit_cast<uint64_t>(mleft.Value()) >> 32) == 0u) {
-    Emit(kSSEFloat64LoadLowWord32, g.DefineAsRegister(node), g.Use(right));
-    return;
-  }
-  Emit(kSSEFloat64InsertLowWord32, g.DefineSameAsFirst(node),
-       g.UseRegister(left), g.Use(right));
-}
-
-
-void InstructionSelector::VisitFloat64InsertHighWord32(Node* node) {
-  IA32OperandGenerator g(this);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-  Emit(kSSEFloat64InsertHighWord32, g.DefineSameAsFirst(node),
-       g.UseRegister(left), g.Use(right));
-}
-
-void InstructionSelector::VisitFloat64SilenceNaN(Node* node) {
-  IA32OperandGenerator g(this);
-  Emit(kSSEFloat64SilenceNaN, g.DefineSameAsFirst(node),
-       g.UseRegister(node->InputAt(0)));
-}
-
-void InstructionSelector::VisitAtomicLoad(Node* node) {
-  LoadRepresentation load_rep = LoadRepresentationOf(node->op());
-  DCHECK(load_rep.representation() == MachineRepresentation::kWord8 ||
-         load_rep.representation() == MachineRepresentation::kWord16 ||
-         load_rep.representation() == MachineRepresentation::kWord32);
-  USE(load_rep);
-  VisitLoad(node);
-}
-
-void InstructionSelector::VisitAtomicStore(Node* node) {
-  IA32OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-
-  MachineRepresentation rep = AtomicStoreRepresentationOf(node->op());
-  ArchOpcode opcode = kArchNop;
-  switch (rep) {
-    case MachineRepresentation::kWord8:
-      opcode = kAtomicExchangeInt8;
-      break;
-    case MachineRepresentation::kWord16:
-      opcode = kAtomicExchangeInt16;
-      break;
-    case MachineRepresentation::kWord32:
-      opcode = kAtomicExchangeWord32;
-      break;
-    default:
-      UNREACHABLE();
-      break;
-  }
-  AddressingMode addressing_mode;
-  InstructionOperand inputs[4];
-  size_t input_count = 0;
-  if (rep == MachineRepresentation::kWord8) {
-    inputs[input_count++] = g.UseByteRegister(value);
-  } else {
-    inputs[input_count++] = g.UseUniqueRegister(value);
-  }
-  inputs[input_count++] = g.UseUniqueRegister(base);
-  if (g.CanBeImmediate(index)) {
-    inputs[input_count++] = g.UseImmediate(index);
-    addressing_mode = kMode_MRI;
-  } else {
-    inputs[input_count++] = g.UseUniqueRegister(index);
-    addressing_mode = kMode_MR1;
-  }
-  InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
-  Emit(code, 0, nullptr, input_count, inputs);
-}
-
-void InstructionSelector::VisitAtomicExchange(Node* node) {
-  IA32OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-
-  MachineType type = AtomicOpRepresentationOf(node->op());
-  ArchOpcode opcode = kArchNop;
-  if (type == MachineType::Int8()) {
-    opcode = kAtomicExchangeInt8;
-  } else if (type == MachineType::Uint8()) {
-    opcode = kAtomicExchangeUint8;
-  } else if (type == MachineType::Int16()) {
-    opcode = kAtomicExchangeInt16;
-  } else if (type == MachineType::Uint16()) {
-    opcode = kAtomicExchangeUint16;
-  } else if (type == MachineType::Int32() || type == MachineType::Uint32()) {
-    opcode = kAtomicExchangeWord32;
-  } else {
-    UNREACHABLE();
-    return;
-  }
-  InstructionOperand outputs[1];
-  AddressingMode addressing_mode;
-  InstructionOperand inputs[3];
-  size_t input_count = 0;
-  if (type == MachineType::Int8() || type == MachineType::Uint8()) {
-    inputs[input_count++] = g.UseFixed(value, edx);
-  } else {
-    inputs[input_count++] = g.UseUniqueRegister(value);
-  }
-  inputs[input_count++] = g.UseUniqueRegister(base);
-  if (g.CanBeImmediate(index)) {
-    inputs[input_count++] = g.UseImmediate(index);
-    addressing_mode = kMode_MRI;
-  } else {
-    inputs[input_count++] = g.UseUniqueRegister(index);
-    addressing_mode = kMode_MR1;
-  }
-  if (type == MachineType::Int8() || type == MachineType::Uint8()) {
-    // Using DefineSameAsFirst requires the register to be unallocated.
-    outputs[0] = g.DefineAsFixed(node, edx);
-  } else {
-    outputs[0] = g.DefineSameAsFirst(node);
-  }
-  InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
-  Emit(code, 1, outputs, input_count, inputs);
-}
-
-void InstructionSelector::VisitAtomicCompareExchange(Node* node) {
-  IA32OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* old_value = node->InputAt(2);
-  Node* new_value = node->InputAt(3);
-
-  MachineType type = AtomicOpRepresentationOf(node->op());
-  ArchOpcode opcode = kArchNop;
-  if (type == MachineType::Int8()) {
-    opcode = kAtomicCompareExchangeInt8;
-  } else if (type == MachineType::Uint8()) {
-    opcode = kAtomicCompareExchangeUint8;
-  } else if (type == MachineType::Int16()) {
-    opcode = kAtomicCompareExchangeInt16;
-  } else if (type == MachineType::Uint16()) {
-    opcode = kAtomicCompareExchangeUint16;
-  } else if (type == MachineType::Int32() || type == MachineType::Uint32()) {
-    opcode = kAtomicCompareExchangeWord32;
-  } else {
-    UNREACHABLE();
-    return;
-  }
-  InstructionOperand outputs[1];
-  AddressingMode addressing_mode;
-  InstructionOperand inputs[4];
-  size_t input_count = 0;
-  inputs[input_count++] = g.UseFixed(old_value, eax);
-  if (type == MachineType::Int8() || type == MachineType::Uint8()) {
-    inputs[input_count++] = g.UseByteRegister(new_value);
-  } else {
-    inputs[input_count++] = g.UseUniqueRegister(new_value);
-  }
-  inputs[input_count++] = g.UseUniqueRegister(base);
-  if (g.CanBeImmediate(index)) {
-    inputs[input_count++] = g.UseImmediate(index);
-    addressing_mode = kMode_MRI;
-  } else {
-    inputs[input_count++] = g.UseUniqueRegister(index);
-    addressing_mode = kMode_MR1;
-  }
-  outputs[0] = g.DefineAsFixed(node, eax);
-  InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
-  Emit(code, 1, outputs, input_count, inputs);
-}
-
-void InstructionSelector::VisitAtomicBinaryOperation(
-    Node* node, ArchOpcode int8_op, ArchOpcode uint8_op, ArchOpcode int16_op,
-    ArchOpcode uint16_op, ArchOpcode word32_op) {
-  IA32OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-
-  MachineType type = AtomicOpRepresentationOf(node->op());
-  ArchOpcode opcode = kArchNop;
-  if (type == MachineType::Int8()) {
-    opcode = int8_op;
-  } else if (type == MachineType::Uint8()) {
-    opcode = uint8_op;
-  } else if (type == MachineType::Int16()) {
-    opcode = int16_op;
-  } else if (type == MachineType::Uint16()) {
-    opcode = uint16_op;
-  } else if (type == MachineType::Int32() || type == MachineType::Uint32()) {
-    opcode = word32_op;
-  } else {
-    UNREACHABLE();
-    return;
-  }
-  InstructionOperand outputs[1];
-  AddressingMode addressing_mode;
-  InstructionOperand inputs[3];
-  size_t input_count = 0;
-  inputs[input_count++] = g.UseUniqueRegister(value);
-  inputs[input_count++] = g.UseUniqueRegister(base);
-  if (g.CanBeImmediate(index)) {
-    inputs[input_count++] = g.UseImmediate(index);
-    addressing_mode = kMode_MRI;
-  } else {
-    inputs[input_count++] = g.UseUniqueRegister(index);
-    addressing_mode = kMode_MR1;
-  }
-  outputs[0] = g.DefineAsFixed(node, eax);
-  InstructionOperand temp[1];
-  if (type == MachineType::Int8() || type == MachineType::Uint8()) {
-    temp[0] = g.UseByteRegister(node);
-  } else {
-    temp[0] = g.TempRegister();
-  }
-  InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
-  Emit(code, 1, outputs, input_count, inputs, 1, temp);
-}
-
-#define VISIT_ATOMIC_BINOP(op)                                              \
-  void InstructionSelector::VisitAtomic##op(Node* node) {                   \
-    VisitAtomicBinaryOperation(node, kAtomic##op##Int8, kAtomic##op##Uint8, \
-                               kAtomic##op##Int16, kAtomic##op##Uint16,     \
-                               kAtomic##op##Word32);                        \
-  }
-VISIT_ATOMIC_BINOP(Add)
-VISIT_ATOMIC_BINOP(Sub)
-VISIT_ATOMIC_BINOP(And)
-VISIT_ATOMIC_BINOP(Or)
-VISIT_ATOMIC_BINOP(Xor)
-#undef VISIT_ATOMIC_BINOP
-
-#define SIMD_INT_TYPES(V) \
-  V(I32x4)                \
-  V(I16x8)                \
-  V(I8x16)
-
-#define SIMD_BINOP_LIST(V) \
-  V(F32x4Add)              \
-  V(F32x4Sub)              \
-  V(F32x4Mul)              \
-  V(F32x4Min)              \
-  V(F32x4Max)              \
-  V(F32x4Eq)               \
-  V(F32x4Ne)               \
-  V(F32x4Lt)               \
-  V(F32x4Le)               \
-  V(I32x4Add)              \
-  V(I32x4Sub)              \
-  V(I32x4Mul)              \
-  V(I32x4MinS)             \
-  V(I32x4MaxS)             \
-  V(I32x4Eq)               \
-  V(I32x4Ne)               \
-  V(I32x4GtS)              \
-  V(I32x4GeS)              \
-  V(I32x4MinU)             \
-  V(I32x4MaxU)             \
-  V(I32x4GtU)              \
-  V(I32x4GeU)              \
-  V(I16x8Add)              \
-  V(I16x8AddSaturateS)     \
-  V(I16x8Sub)              \
-  V(I16x8SubSaturateS)     \
-  V(I16x8Mul)              \
-  V(I16x8MinS)             \
-  V(I16x8MaxS)             \
-  V(I16x8Eq)               \
-  V(I16x8Ne)               \
-  V(I16x8GtS)              \
-  V(I16x8GeS)              \
-  V(I16x8AddSaturateU)     \
-  V(I16x8SubSaturateU)     \
-  V(I16x8MinU)             \
-  V(I16x8MaxU)             \
-  V(I16x8GtU)              \
-  V(I16x8GeU)              \
-  V(I8x16Add)              \
-  V(I8x16AddSaturateS)     \
-  V(I8x16Sub)              \
-  V(I8x16SubSaturateS)     \
-  V(I8x16MinS)             \
-  V(I8x16MaxS)             \
-  V(I8x16Eq)               \
-  V(I8x16Ne)               \
-  V(I8x16GtS)              \
-  V(I8x16GeS)              \
-  V(I8x16AddSaturateU)     \
-  V(I8x16SubSaturateU)     \
-  V(I8x16MinU)             \
-  V(I8x16MaxU)             \
-  V(I8x16GtU)              \
-  V(I8x16GeU)              \
-  V(S128And)               \
-  V(S128Or)                \
-  V(S128Xor)
-
-#define SIMD_INT_UNOP_LIST(V) \
-  V(I32x4Neg)                 \
-  V(I16x8Neg)                 \
-  V(I8x16Neg)
-
-#define SIMD_OTHER_UNOP_LIST(V) \
-  V(F32x4Abs)                   \
-  V(F32x4Neg)                   \
-  V(S128Not)
-
-#define SIMD_SHIFT_OPCODES(V) \
-  V(I32x4Shl)                 \
-  V(I32x4ShrS)                \
-  V(I32x4ShrU)                \
-  V(I16x8Shl)                 \
-  V(I16x8ShrS)                \
-  V(I16x8ShrU)
-
-void InstructionSelector::VisitF32x4Splat(Node* node) {
-  IA32OperandGenerator g(this);
-  InstructionOperand operand0 = g.UseRegister(node->InputAt(0));
-  if (IsSupported(AVX)) {
-    Emit(kAVXF32x4Splat, g.DefineAsRegister(node), operand0);
-  } else {
-    Emit(kSSEF32x4Splat, g.DefineSameAsFirst(node), operand0);
-  }
-}
-
-void InstructionSelector::VisitF32x4ExtractLane(Node* node) {
-  IA32OperandGenerator g(this);
-  InstructionOperand operand0 = g.UseRegister(node->InputAt(0));
-  InstructionOperand operand1 = g.UseImmediate(OpParameter<int32_t>(node));
-  if (IsSupported(AVX)) {
-    Emit(kAVXF32x4ExtractLane, g.DefineAsRegister(node), operand0, operand1);
-  } else {
-    Emit(kSSEF32x4ExtractLane, g.DefineSameAsFirst(node), operand0, operand1);
-  }
-}
-
-void InstructionSelector::VisitS128Zero(Node* node) {
-  IA32OperandGenerator g(this);
-  Emit(kIA32S128Zero, g.DefineAsRegister(node));
-}
-
-
-#define VISIT_SIMD_SPLAT(Type)                               \
-  void InstructionSelector::Visit##Type##Splat(Node* node) { \
-    VisitRO(this, node, kIA32##Type##Splat);                 \
-  }
-SIMD_INT_TYPES(VISIT_SIMD_SPLAT)
-#undef VISIT_SIMD_SPLAT
-
-#define VISIT_SIMD_EXTRACT_LANE(Type)                              \
-  void InstructionSelector::Visit##Type##ExtractLane(Node* node) { \
-    IA32OperandGenerator g(this);                                  \
-    int32_t lane = OpParameter<int32_t>(node);                     \
-    Emit(kIA32##Type##ExtractLane, g.DefineAsRegister(node),       \
-         g.UseRegister(node->InputAt(0)), g.UseImmediate(lane));   \
-  }
-SIMD_INT_TYPES(VISIT_SIMD_EXTRACT_LANE)
-#undef VISIT_SIMD_EXTRACT_LANE
-
-#define VISIT_SIMD_REPLACE_LANE(Type)                                         \
-  void InstructionSelector::Visit##Type##ReplaceLane(Node* node) {            \
-    IA32OperandGenerator g(this);                                             \
-    InstructionOperand operand0 = g.UseRegister(node->InputAt(0));            \
-    InstructionOperand operand1 = g.UseImmediate(OpParameter<int32_t>(node)); \
-    InstructionOperand operand2 = g.Use(node->InputAt(1));                    \
-    if (IsSupported(AVX)) {                                                   \
-      Emit(kAVX##Type##ReplaceLane, g.DefineAsRegister(node), operand0,       \
-           operand1, operand2);                                               \
-    } else {                                                                  \
-      Emit(kSSE##Type##ReplaceLane, g.DefineSameAsFirst(node), operand0,      \
-           operand1, operand2);                                               \
-    }                                                                         \
-  }
-SIMD_INT_TYPES(VISIT_SIMD_REPLACE_LANE)
-VISIT_SIMD_REPLACE_LANE(F32x4)
-#undef VISIT_SIMD_REPLACE_LANE
-
-#define VISIT_SIMD_SHIFT(Opcode)                                              \
-  void InstructionSelector::Visit##Opcode(Node* node) {                       \
-    IA32OperandGenerator g(this);                                             \
-    InstructionOperand operand0 = g.UseRegister(node->InputAt(0));            \
-    InstructionOperand operand1 = g.UseImmediate(OpParameter<int32_t>(node)); \
-    if (IsSupported(AVX)) {                                                   \
-      Emit(kAVX##Opcode, g.DefineAsRegister(node), operand0, operand1);       \
-    } else {                                                                  \
-      Emit(kSSE##Opcode, g.DefineSameAsFirst(node), operand0, operand1);      \
-    }                                                                         \
-  }
-SIMD_SHIFT_OPCODES(VISIT_SIMD_SHIFT)
-#undef VISIT_SIMD_SHIFT
-
-#define VISIT_SIMD_INT_UNOP(Opcode)                                         \
-  void InstructionSelector::Visit##Opcode(Node* node) {                     \
-    IA32OperandGenerator g(this);                                           \
-    Emit(kIA32##Opcode, g.DefineAsRegister(node), g.Use(node->InputAt(0))); \
-  }
-SIMD_INT_UNOP_LIST(VISIT_SIMD_INT_UNOP)
-#undef VISIT_SIMD_INT_UNOP
-
-#define VISIT_SIMD_OTHER_UNOP(Opcode)                                        \
-  void InstructionSelector::Visit##Opcode(Node* node) {                      \
-    IA32OperandGenerator g(this);                                            \
-    InstructionCode opcode = IsSupported(AVX) ? kAVX##Opcode : kSSE##Opcode; \
-    Emit(opcode, g.DefineAsRegister(node), g.Use(node->InputAt(0)));         \
-  }
-SIMD_OTHER_UNOP_LIST(VISIT_SIMD_OTHER_UNOP)
-#undef VISIT_SIMD_OTHER_UNOP
-
-#define VISIT_SIMD_BINOP(Opcode)                           \
-  void InstructionSelector::Visit##Opcode(Node* node) {    \
-    VisitRROFloat(this, node, kAVX##Opcode, kSSE##Opcode); \
-  }
-SIMD_BINOP_LIST(VISIT_SIMD_BINOP)
-#undef VISIT_SIMD_BINOP
-
-void InstructionSelector::VisitInt32AbsWithOverflow(Node* node) {
-  UNREACHABLE();
-}
-
-void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) {
-  UNREACHABLE();
-}
-
-// static
-MachineOperatorBuilder::Flags
-InstructionSelector::SupportedMachineOperatorFlags() {
-  MachineOperatorBuilder::Flags flags =
-      MachineOperatorBuilder::kWord32ShiftIsSafe |
-      MachineOperatorBuilder::kWord32Ctz |
-      MachineOperatorBuilder::kSpeculationFence;
-  if (CpuFeatures::IsSupported(POPCNT)) {
-    flags |= MachineOperatorBuilder::kWord32Popcnt;
-  }
-  if (CpuFeatures::IsSupported(SSE4_1)) {
-    flags |= MachineOperatorBuilder::kFloat32RoundDown |
-             MachineOperatorBuilder::kFloat64RoundDown |
-             MachineOperatorBuilder::kFloat32RoundUp |
-             MachineOperatorBuilder::kFloat64RoundUp |
-             MachineOperatorBuilder::kFloat32RoundTruncate |
-             MachineOperatorBuilder::kFloat64RoundTruncate |
-             MachineOperatorBuilder::kFloat32RoundTiesEven |
-             MachineOperatorBuilder::kFloat64RoundTiesEven;
-  }
-  return flags;
-}
-
-// static
-MachineOperatorBuilder::AlignmentRequirements
-InstructionSelector::AlignmentRequirements() {
-  return MachineOperatorBuilder::AlignmentRequirements::
-      FullUnalignedAccessSupport();
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/instruction-codes.h b/src/v8/src/compiler/instruction-codes.h
deleted file mode 100644
index df3078d..0000000
--- a/src/v8/src/compiler/instruction-codes.h
+++ /dev/null
@@ -1,242 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_INSTRUCTION_CODES_H_
-#define V8_COMPILER_INSTRUCTION_CODES_H_
-
-#include <iosfwd>
-
-#if V8_TARGET_ARCH_ARM
-#include "src/compiler/arm/instruction-codes-arm.h"
-#elif V8_TARGET_ARCH_ARM64
-#include "src/compiler/arm64/instruction-codes-arm64.h"
-#elif V8_TARGET_ARCH_IA32
-#include "src/compiler/ia32/instruction-codes-ia32.h"
-#elif V8_TARGET_ARCH_MIPS
-#include "src/compiler/mips/instruction-codes-mips.h"
-#elif V8_TARGET_ARCH_MIPS64
-#include "src/compiler/mips64/instruction-codes-mips64.h"
-#elif V8_TARGET_ARCH_X64
-#include "src/compiler/x64/instruction-codes-x64.h"
-#elif V8_TARGET_ARCH_PPC
-#include "src/compiler/ppc/instruction-codes-ppc.h"
-#elif V8_TARGET_ARCH_S390
-#include "src/compiler/s390/instruction-codes-s390.h"
-#else
-#define TARGET_ARCH_OPCODE_LIST(V)
-#define TARGET_ADDRESSING_MODE_LIST(V)
-#endif
-#include "src/globals.h"
-#include "src/utils.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-// Modes for ArchStoreWithWriteBarrier below.
-enum class RecordWriteMode { kValueIsMap, kValueIsPointer, kValueIsAny };
-
-
-// Target-specific opcodes that specify which assembly sequence to emit.
-// Most opcodes specify a single instruction.
-#define COMMON_ARCH_OPCODE_LIST(V)        \
-  V(ArchCallCodeObject)                   \
-  V(ArchTailCallCodeObjectFromJSFunction) \
-  V(ArchTailCallCodeObject)               \
-  V(ArchCallJSFunction)                   \
-  V(ArchTailCallAddress)                  \
-  V(ArchPrepareCallCFunction)             \
-  V(ArchSaveCallerRegisters)              \
-  V(ArchRestoreCallerRegisters)           \
-  V(ArchCallCFunction)                    \
-  V(ArchPrepareTailCall)                  \
-  V(ArchCallWasmFunction)                 \
-  V(ArchTailCallWasm)                     \
-  V(ArchJmp)                              \
-  V(ArchLookupSwitch)                     \
-  V(ArchTableSwitch)                      \
-  V(ArchNop)                              \
-  V(ArchDebugAbort)                       \
-  V(ArchDebugBreak)                       \
-  V(ArchComment)                          \
-  V(ArchThrowTerminator)                  \
-  V(ArchDeoptimize)                       \
-  V(ArchRet)                              \
-  V(ArchStackPointer)                     \
-  V(ArchFramePointer)                     \
-  V(ArchParentFramePointer)               \
-  V(ArchTruncateDoubleToI)                \
-  V(ArchStoreWithWriteBarrier)            \
-  V(ArchStackSlot)                        \
-  V(AtomicLoadInt8)                       \
-  V(AtomicLoadUint8)                      \
-  V(AtomicLoadInt16)                      \
-  V(AtomicLoadUint16)                     \
-  V(AtomicLoadWord32)                     \
-  V(AtomicStoreWord8)                     \
-  V(AtomicStoreWord16)                    \
-  V(AtomicStoreWord32)                    \
-  V(AtomicExchangeInt8)                   \
-  V(AtomicExchangeUint8)                  \
-  V(AtomicExchangeInt16)                  \
-  V(AtomicExchangeUint16)                 \
-  V(AtomicExchangeWord32)                 \
-  V(AtomicCompareExchangeInt8)            \
-  V(AtomicCompareExchangeUint8)           \
-  V(AtomicCompareExchangeInt16)           \
-  V(AtomicCompareExchangeUint16)          \
-  V(AtomicCompareExchangeWord32)          \
-  V(AtomicAddInt8)                        \
-  V(AtomicAddUint8)                       \
-  V(AtomicAddInt16)                       \
-  V(AtomicAddUint16)                      \
-  V(AtomicAddWord32)                      \
-  V(AtomicSubInt8)                        \
-  V(AtomicSubUint8)                       \
-  V(AtomicSubInt16)                       \
-  V(AtomicSubUint16)                      \
-  V(AtomicSubWord32)                      \
-  V(AtomicAndInt8)                        \
-  V(AtomicAndUint8)                       \
-  V(AtomicAndInt16)                       \
-  V(AtomicAndUint16)                      \
-  V(AtomicAndWord32)                      \
-  V(AtomicOrInt8)                         \
-  V(AtomicOrUint8)                        \
-  V(AtomicOrInt16)                        \
-  V(AtomicOrUint16)                       \
-  V(AtomicOrWord32)                       \
-  V(AtomicXorInt8)                        \
-  V(AtomicXorUint8)                       \
-  V(AtomicXorInt16)                       \
-  V(AtomicXorUint16)                      \
-  V(AtomicXorWord32)                      \
-  V(Ieee754Float64Acos)                   \
-  V(Ieee754Float64Acosh)                  \
-  V(Ieee754Float64Asin)                   \
-  V(Ieee754Float64Asinh)                  \
-  V(Ieee754Float64Atan)                   \
-  V(Ieee754Float64Atanh)                  \
-  V(Ieee754Float64Atan2)                  \
-  V(Ieee754Float64Cbrt)                   \
-  V(Ieee754Float64Cos)                    \
-  V(Ieee754Float64Cosh)                   \
-  V(Ieee754Float64Exp)                    \
-  V(Ieee754Float64Expm1)                  \
-  V(Ieee754Float64Log)                    \
-  V(Ieee754Float64Log1p)                  \
-  V(Ieee754Float64Log10)                  \
-  V(Ieee754Float64Log2)                   \
-  V(Ieee754Float64Pow)                    \
-  V(Ieee754Float64Sin)                    \
-  V(Ieee754Float64Sinh)                   \
-  V(Ieee754Float64Tan)                    \
-  V(Ieee754Float64Tanh)
-
-#define ARCH_OPCODE_LIST(V)  \
-  COMMON_ARCH_OPCODE_LIST(V) \
-  TARGET_ARCH_OPCODE_LIST(V)
-
-enum ArchOpcode {
-#define DECLARE_ARCH_OPCODE(Name) k##Name,
-  ARCH_OPCODE_LIST(DECLARE_ARCH_OPCODE)
-#undef DECLARE_ARCH_OPCODE
-#define COUNT_ARCH_OPCODE(Name) +1
-  kLastArchOpcode = -1 ARCH_OPCODE_LIST(COUNT_ARCH_OPCODE)
-#undef COUNT_ARCH_OPCODE
-};
-
-V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os,
-                                           const ArchOpcode& ao);
-
-// Addressing modes represent the "shape" of inputs to an instruction.
-// Many instructions support multiple addressing modes. Addressing modes
-// are encoded into the InstructionCode of the instruction and tell the
-// code generator after register allocation which assembler method to call.
-#define ADDRESSING_MODE_LIST(V) \
-  V(None)                       \
-  TARGET_ADDRESSING_MODE_LIST(V)
-
-enum AddressingMode {
-#define DECLARE_ADDRESSING_MODE(Name) kMode_##Name,
-  ADDRESSING_MODE_LIST(DECLARE_ADDRESSING_MODE)
-#undef DECLARE_ADDRESSING_MODE
-#define COUNT_ADDRESSING_MODE(Name) +1
-  kLastAddressingMode = -1 ADDRESSING_MODE_LIST(COUNT_ADDRESSING_MODE)
-#undef COUNT_ADDRESSING_MODE
-};
-
-V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os,
-                                           const AddressingMode& am);
-
-// The mode of the flags continuation (see below).
-enum FlagsMode {
-  kFlags_none = 0,
-  kFlags_branch = 1,
-  kFlags_deoptimize = 2,
-  kFlags_set = 3,
-  kFlags_trap = 4
-};
-
-V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os,
-                                           const FlagsMode& fm);
-
-// The condition of flags continuation (see below).
-enum FlagsCondition {
-  kEqual,
-  kNotEqual,
-  kSignedLessThan,
-  kSignedGreaterThanOrEqual,
-  kSignedLessThanOrEqual,
-  kSignedGreaterThan,
-  kUnsignedLessThan,
-  kUnsignedGreaterThanOrEqual,
-  kUnsignedLessThanOrEqual,
-  kUnsignedGreaterThan,
-  kFloatLessThanOrUnordered,
-  kFloatGreaterThanOrEqual,
-  kFloatLessThanOrEqual,
-  kFloatGreaterThanOrUnordered,
-  kFloatLessThan,
-  kFloatGreaterThanOrEqualOrUnordered,
-  kFloatLessThanOrEqualOrUnordered,
-  kFloatGreaterThan,
-  kUnorderedEqual,
-  kUnorderedNotEqual,
-  kOverflow,
-  kNotOverflow,
-  kPositiveOrZero,
-  kNegative
-};
-
-inline FlagsCondition NegateFlagsCondition(FlagsCondition condition) {
-  return static_cast<FlagsCondition>(condition ^ 1);
-}
-
-FlagsCondition CommuteFlagsCondition(FlagsCondition condition);
-
-V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os,
-                                           const FlagsCondition& fc);
-
-// The InstructionCode is an opaque, target-specific integer that encodes
-// what code to emit for an instruction in the code generator. It is not
-// interesting to the register allocator, as the inputs and flags on the
-// instructions specify everything of interest.
-typedef int32_t InstructionCode;
-
-// Helpers for encoding / decoding InstructionCode into the fields needed
-// for code generation. We encode the instruction, addressing mode, and flags
-// continuation into a single InstructionCode which is stored as part of
-// the instruction.
-typedef BitField<ArchOpcode, 0, 9> ArchOpcodeField;
-typedef BitField<AddressingMode, 9, 5> AddressingModeField;
-typedef BitField<FlagsMode, 14, 3> FlagsModeField;
-typedef BitField<FlagsCondition, 17, 5> FlagsConditionField;
-typedef BitField<int, 22, 10> MiscField;
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_COMPILER_INSTRUCTION_CODES_H_
diff --git a/src/v8/src/compiler/instruction-scheduler.cc b/src/v8/src/compiler/instruction-scheduler.cc
deleted file mode 100644
index f7afaab..0000000
--- a/src/v8/src/compiler/instruction-scheduler.cc
+++ /dev/null
@@ -1,389 +0,0 @@
-// Copyright 2015 the V8 project 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 "src/compiler/instruction-scheduler.h"
-
-#include "src/base/adapters.h"
-#include "src/base/utils/random-number-generator.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-void InstructionScheduler::SchedulingQueueBase::AddNode(
-    ScheduleGraphNode* node) {
-  // We keep the ready list sorted by total latency so that we can quickly find
-  // the next best candidate to schedule.
-  auto it = nodes_.begin();
-  while ((it != nodes_.end()) &&
-         ((*it)->total_latency() >= node->total_latency())) {
-    ++it;
-  }
-  nodes_.insert(it, node);
-}
-
-
-InstructionScheduler::ScheduleGraphNode*
-InstructionScheduler::CriticalPathFirstQueue::PopBestCandidate(int cycle) {
-  DCHECK(!IsEmpty());
-  auto candidate = nodes_.end();
-  for (auto iterator = nodes_.begin(); iterator != nodes_.end(); ++iterator) {
-    // We only consider instructions that have all their operands ready.
-    if (cycle >= (*iterator)->start_cycle()) {
-      candidate = iterator;
-      break;
-    }
-  }
-
-  if (candidate != nodes_.end()) {
-    ScheduleGraphNode *result = *candidate;
-    nodes_.erase(candidate);
-    return result;
-  }
-
-  return nullptr;
-}
-
-
-InstructionScheduler::ScheduleGraphNode*
-InstructionScheduler::StressSchedulerQueue::PopBestCandidate(int cycle) {
-  DCHECK(!IsEmpty());
-  // Choose a random element from the ready list.
-  auto candidate = nodes_.begin();
-  std::advance(candidate, isolate()->random_number_generator()->NextInt(
-      static_cast<int>(nodes_.size())));
-  ScheduleGraphNode *result = *candidate;
-  nodes_.erase(candidate);
-  return result;
-}
-
-
-InstructionScheduler::ScheduleGraphNode::ScheduleGraphNode(
-    Zone* zone,
-    Instruction* instr)
-    : instr_(instr),
-      successors_(zone),
-      unscheduled_predecessors_count_(0),
-      latency_(GetInstructionLatency(instr)),
-      total_latency_(-1),
-      start_cycle_(-1) {
-}
-
-
-void InstructionScheduler::ScheduleGraphNode::AddSuccessor(
-    ScheduleGraphNode* node) {
-  successors_.push_back(node);
-  node->unscheduled_predecessors_count_++;
-}
-
-InstructionScheduler::InstructionScheduler(Zone* zone,
-                                           InstructionSequence* sequence)
-    : zone_(zone),
-      sequence_(sequence),
-      graph_(zone),
-      last_side_effect_instr_(nullptr),
-      pending_loads_(zone),
-      last_live_in_reg_marker_(nullptr),
-      last_deopt_or_trap_(nullptr),
-      operands_map_(zone) {}
-
-void InstructionScheduler::StartBlock(RpoNumber rpo) {
-  DCHECK(graph_.empty());
-  DCHECK_NULL(last_side_effect_instr_);
-  DCHECK(pending_loads_.empty());
-  DCHECK_NULL(last_live_in_reg_marker_);
-  DCHECK_NULL(last_deopt_or_trap_);
-  DCHECK(operands_map_.empty());
-  sequence()->StartBlock(rpo);
-}
-
-
-void InstructionScheduler::EndBlock(RpoNumber rpo) {
-  if (FLAG_turbo_stress_instruction_scheduling) {
-    ScheduleBlock<StressSchedulerQueue>();
-  } else {
-    ScheduleBlock<CriticalPathFirstQueue>();
-  }
-  sequence()->EndBlock(rpo);
-  graph_.clear();
-  last_side_effect_instr_ = nullptr;
-  pending_loads_.clear();
-  last_live_in_reg_marker_ = nullptr;
-  last_deopt_or_trap_ = nullptr;
-  operands_map_.clear();
-}
-
-
-void InstructionScheduler::AddInstruction(Instruction* instr) {
-  ScheduleGraphNode* new_node = new (zone()) ScheduleGraphNode(zone(), instr);
-
-  if (IsBlockTerminator(instr)) {
-    // Make sure that basic block terminators are not moved by adding them
-    // as successor of every instruction.
-    for (ScheduleGraphNode* node : graph_) {
-      node->AddSuccessor(new_node);
-    }
-  } else if (IsFixedRegisterParameter(instr)) {
-    if (last_live_in_reg_marker_ != nullptr) {
-      last_live_in_reg_marker_->AddSuccessor(new_node);
-    }
-    last_live_in_reg_marker_ = new_node;
-  } else {
-    if (last_live_in_reg_marker_ != nullptr) {
-      last_live_in_reg_marker_->AddSuccessor(new_node);
-    }
-
-    // Make sure that instructions are not scheduled before the last
-    // deoptimization or trap point when they depend on it.
-    if ((last_deopt_or_trap_ != nullptr) && DependsOnDeoptOrTrap(instr)) {
-      last_deopt_or_trap_->AddSuccessor(new_node);
-    }
-
-    // Instructions with side effects and memory operations can't be
-    // reordered with respect to each other.
-    if (HasSideEffect(instr)) {
-      if (last_side_effect_instr_ != nullptr) {
-        last_side_effect_instr_->AddSuccessor(new_node);
-      }
-      for (ScheduleGraphNode* load : pending_loads_) {
-        load->AddSuccessor(new_node);
-      }
-      pending_loads_.clear();
-      last_side_effect_instr_ = new_node;
-    } else if (IsLoadOperation(instr)) {
-      // Load operations can't be reordered with side effects instructions but
-      // independent loads can be reordered with respect to each other.
-      if (last_side_effect_instr_ != nullptr) {
-        last_side_effect_instr_->AddSuccessor(new_node);
-      }
-      pending_loads_.push_back(new_node);
-    } else if (instr->IsDeoptimizeCall() || instr->IsTrap()) {
-      // Ensure that deopts or traps are not reordered with respect to
-      // side-effect instructions.
-      if (last_side_effect_instr_ != nullptr) {
-        last_side_effect_instr_->AddSuccessor(new_node);
-      }
-      last_deopt_or_trap_ = new_node;
-    }
-
-    // Look for operand dependencies.
-    for (size_t i = 0; i < instr->InputCount(); ++i) {
-      const InstructionOperand* input = instr->InputAt(i);
-      if (input->IsUnallocated()) {
-        int32_t vreg = UnallocatedOperand::cast(input)->virtual_register();
-        auto it = operands_map_.find(vreg);
-        if (it != operands_map_.end()) {
-          it->second->AddSuccessor(new_node);
-        }
-      }
-    }
-
-    // Record the virtual registers defined by this instruction.
-    for (size_t i = 0; i < instr->OutputCount(); ++i) {
-      const InstructionOperand* output = instr->OutputAt(i);
-      if (output->IsUnallocated()) {
-        operands_map_[UnallocatedOperand::cast(output)->virtual_register()] =
-            new_node;
-      } else if (output->IsConstant()) {
-        operands_map_[ConstantOperand::cast(output)->virtual_register()] =
-            new_node;
-      }
-    }
-  }
-
-  graph_.push_back(new_node);
-}
-
-
-template <typename QueueType>
-void InstructionScheduler::ScheduleBlock() {
-  QueueType ready_list(this);
-
-  // Compute total latencies so that we can schedule the critical path first.
-  ComputeTotalLatencies();
-
-  // Add nodes which don't have dependencies to the ready list.
-  for (ScheduleGraphNode* node : graph_) {
-    if (!node->HasUnscheduledPredecessor()) {
-      ready_list.AddNode(node);
-    }
-  }
-
-  // Go through the ready list and schedule the instructions.
-  int cycle = 0;
-  while (!ready_list.IsEmpty()) {
-    ScheduleGraphNode* candidate = ready_list.PopBestCandidate(cycle);
-
-    if (candidate != nullptr) {
-      sequence()->AddInstruction(candidate->instruction());
-
-      for (ScheduleGraphNode* successor : candidate->successors()) {
-        successor->DropUnscheduledPredecessor();
-        successor->set_start_cycle(
-            std::max(successor->start_cycle(),
-                     cycle + candidate->latency()));
-
-        if (!successor->HasUnscheduledPredecessor()) {
-          ready_list.AddNode(successor);
-        }
-      }
-    }
-
-    cycle++;
-  }
-}
-
-
-int InstructionScheduler::GetInstructionFlags(const Instruction* instr) const {
-  switch (instr->arch_opcode()) {
-    case kArchNop:
-    case kArchFramePointer:
-    case kArchParentFramePointer:
-    case kArchStackSlot:  // Despite its name this opcode will produce a
-                          // reference to a frame slot, so it is not affected
-                          // by the arm64 dual stack issues mentioned below.
-    case kArchComment:
-      return kNoOpcodeFlags;
-
-    case kArchTruncateDoubleToI:
-    case kIeee754Float64Acos:
-    case kIeee754Float64Acosh:
-    case kIeee754Float64Asin:
-    case kIeee754Float64Asinh:
-    case kIeee754Float64Atan:
-    case kIeee754Float64Atanh:
-    case kIeee754Float64Atan2:
-    case kIeee754Float64Cbrt:
-    case kIeee754Float64Cos:
-    case kIeee754Float64Cosh:
-    case kIeee754Float64Exp:
-    case kIeee754Float64Expm1:
-    case kIeee754Float64Log:
-    case kIeee754Float64Log1p:
-    case kIeee754Float64Log10:
-    case kIeee754Float64Log2:
-    case kIeee754Float64Pow:
-    case kIeee754Float64Sin:
-    case kIeee754Float64Sinh:
-    case kIeee754Float64Tan:
-    case kIeee754Float64Tanh:
-      return kNoOpcodeFlags;
-
-    case kArchStackPointer:
-      // ArchStackPointer instruction loads the current stack pointer value and
-      // must not be reordered with instruction with side effects.
-      return kIsLoadOperation;
-
-    case kArchPrepareCallCFunction:
-    case kArchSaveCallerRegisters:
-    case kArchRestoreCallerRegisters:
-    case kArchPrepareTailCall:
-    case kArchCallCFunction:
-    case kArchCallCodeObject:
-    case kArchCallJSFunction:
-    case kArchCallWasmFunction:
-      return kHasSideEffect;
-
-    case kArchTailCallCodeObjectFromJSFunction:
-    case kArchTailCallCodeObject:
-    case kArchTailCallAddress:
-    case kArchTailCallWasm:
-      return kHasSideEffect | kIsBlockTerminator;
-
-    case kArchDeoptimize:
-    case kArchJmp:
-    case kArchLookupSwitch:
-    case kArchTableSwitch:
-    case kArchRet:
-    case kArchDebugAbort:
-    case kArchDebugBreak:
-    case kArchThrowTerminator:
-      return kIsBlockTerminator;
-
-    case kArchStoreWithWriteBarrier:
-      return kHasSideEffect;
-
-    case kAtomicLoadInt8:
-    case kAtomicLoadUint8:
-    case kAtomicLoadInt16:
-    case kAtomicLoadUint16:
-    case kAtomicLoadWord32:
-      return kIsLoadOperation;
-
-    case kAtomicStoreWord8:
-    case kAtomicStoreWord16:
-    case kAtomicStoreWord32:
-      return kHasSideEffect;
-
-    case kAtomicExchangeInt8:
-    case kAtomicExchangeUint8:
-    case kAtomicExchangeInt16:
-    case kAtomicExchangeUint16:
-    case kAtomicExchangeWord32:
-    case kAtomicCompareExchangeInt8:
-    case kAtomicCompareExchangeUint8:
-    case kAtomicCompareExchangeInt16:
-    case kAtomicCompareExchangeUint16:
-    case kAtomicCompareExchangeWord32:
-    case kAtomicAddInt8:
-    case kAtomicAddUint8:
-    case kAtomicAddInt16:
-    case kAtomicAddUint16:
-    case kAtomicAddWord32:
-    case kAtomicSubInt8:
-    case kAtomicSubUint8:
-    case kAtomicSubInt16:
-    case kAtomicSubUint16:
-    case kAtomicSubWord32:
-    case kAtomicAndInt8:
-    case kAtomicAndUint8:
-    case kAtomicAndInt16:
-    case kAtomicAndUint16:
-    case kAtomicAndWord32:
-    case kAtomicOrInt8:
-    case kAtomicOrUint8:
-    case kAtomicOrInt16:
-    case kAtomicOrUint16:
-    case kAtomicOrWord32:
-    case kAtomicXorInt8:
-    case kAtomicXorUint8:
-    case kAtomicXorInt16:
-    case kAtomicXorUint16:
-    case kAtomicXorWord32:
-      return kHasSideEffect;
-
-#define CASE(Name) case k##Name:
-    TARGET_ARCH_OPCODE_LIST(CASE)
-#undef CASE
-      return GetTargetInstructionFlags(instr);
-  }
-
-  UNREACHABLE();
-}
-
-
-bool InstructionScheduler::IsBlockTerminator(const Instruction* instr) const {
-  return ((GetInstructionFlags(instr) & kIsBlockTerminator) ||
-          (instr->flags_mode() == kFlags_branch));
-}
-
-
-void InstructionScheduler::ComputeTotalLatencies() {
-  for (ScheduleGraphNode* node : base::Reversed(graph_)) {
-    int max_latency = 0;
-
-    for (ScheduleGraphNode* successor : node->successors()) {
-      DCHECK_NE(-1, successor->total_latency());
-      if (successor->total_latency() > max_latency) {
-        max_latency = successor->total_latency();
-      }
-    }
-
-    node->set_total_latency(max_latency + node->latency());
-  }
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/instruction-scheduler.h b/src/v8/src/compiler/instruction-scheduler.h
deleted file mode 100644
index 3d7b88f..0000000
--- a/src/v8/src/compiler/instruction-scheduler.h
+++ /dev/null
@@ -1,239 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_INSTRUCTION_SCHEDULER_H_
-#define V8_COMPILER_INSTRUCTION_SCHEDULER_H_
-
-#include "src/compiler/instruction.h"
-#include "src/zone/zone-containers.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-// A set of flags describing properties of the instructions so that the
-// scheduler is aware of dependencies between instructions.
-enum ArchOpcodeFlags {
-  kNoOpcodeFlags = 0,
-  kIsBlockTerminator = 1,  // The instruction marks the end of a basic block
-                           // e.g.: jump and return instructions.
-  kHasSideEffect = 2,      // The instruction has some side effects (memory
-                           // store, function call...)
-  kIsLoadOperation = 4,    // The instruction is a memory load.
-  kMayNeedDeoptOrTrapCheck = 8,  // The instruction may be associated with a
-                                 // deopt or trap check which must be run before
-                                 // instruction e.g. div on Intel platform which
-                                 // will raise an exception when the divisor is
-                                 // zero.
-};
-
-class InstructionScheduler final : public ZoneObject {
- public:
-  InstructionScheduler(Zone* zone, InstructionSequence* sequence);
-
-  void StartBlock(RpoNumber rpo);
-  void EndBlock(RpoNumber rpo);
-
-  void AddInstruction(Instruction* instr);
-
-  static bool SchedulerSupported();
-
- private:
-  // A scheduling graph node.
-  // Represent an instruction and their dependencies.
-  class ScheduleGraphNode: public ZoneObject {
-   public:
-    ScheduleGraphNode(Zone* zone, Instruction* instr);
-
-    // Mark the instruction represented by 'node' as a dependecy of this one.
-    // The current instruction will be registered as an unscheduled predecessor
-    // of 'node' (i.e. it must be scheduled before 'node').
-    void AddSuccessor(ScheduleGraphNode* node);
-
-    // Check if all the predecessors of this instruction have been scheduled.
-    bool HasUnscheduledPredecessor() {
-      return unscheduled_predecessors_count_ != 0;
-    }
-
-    // Record that we have scheduled one of the predecessors of this node.
-    void DropUnscheduledPredecessor() {
-      DCHECK_LT(0, unscheduled_predecessors_count_);
-      unscheduled_predecessors_count_--;
-    }
-
-    Instruction* instruction() { return instr_; }
-    ZoneDeque<ScheduleGraphNode*>& successors() { return successors_; }
-    int latency() const { return latency_; }
-
-    int total_latency() const { return total_latency_; }
-    void set_total_latency(int latency) { total_latency_ = latency; }
-
-    int start_cycle() const { return start_cycle_; }
-    void set_start_cycle(int start_cycle) { start_cycle_ = start_cycle; }
-
-   private:
-    Instruction* instr_;
-    ZoneDeque<ScheduleGraphNode*> successors_;
-
-    // Number of unscheduled predecessors for this node.
-    int unscheduled_predecessors_count_;
-
-    // Estimate of the instruction latency (the number of cycles it takes for
-    // instruction to complete).
-    int latency_;
-
-    // The sum of all the latencies on the path from this node to the end of
-    // the graph (i.e. a node with no successor).
-    int total_latency_;
-
-    // The scheduler keeps a nominal cycle count to keep track of when the
-    // result of an instruction is available. This field is updated by the
-    // scheduler to indicate when the value of all the operands of this
-    // instruction will be available.
-    int start_cycle_;
-  };
-
-  // Keep track of all nodes ready to be scheduled (i.e. all their dependencies
-  // have been scheduled. Note that this class is inteded to be extended by
-  // concrete implementation of the scheduling queue which define the policy
-  // to pop node from the queue.
-  class SchedulingQueueBase {
-   public:
-    explicit SchedulingQueueBase(InstructionScheduler* scheduler)
-      : scheduler_(scheduler),
-        nodes_(scheduler->zone()) {
-    }
-
-    void AddNode(ScheduleGraphNode* node);
-
-    bool IsEmpty() const {
-      return nodes_.empty();
-    }
-
-   protected:
-    InstructionScheduler* scheduler_;
-    ZoneLinkedList<ScheduleGraphNode*> nodes_;
-  };
-
-  // A scheduling queue which prioritize nodes on the critical path (we look
-  // for the instruction with the highest latency on the path to reach the end
-  // of the graph).
-  class CriticalPathFirstQueue : public SchedulingQueueBase  {
-   public:
-    explicit CriticalPathFirstQueue(InstructionScheduler* scheduler)
-      : SchedulingQueueBase(scheduler) { }
-
-    // Look for the best candidate to schedule, remove it from the queue and
-    // return it.
-    ScheduleGraphNode* PopBestCandidate(int cycle);
-  };
-
-  // A queue which pop a random node from the queue to perform stress tests on
-  // the scheduler.
-  class StressSchedulerQueue : public SchedulingQueueBase  {
-   public:
-    explicit StressSchedulerQueue(InstructionScheduler* scheduler)
-      : SchedulingQueueBase(scheduler) { }
-
-    ScheduleGraphNode* PopBestCandidate(int cycle);
-
-   private:
-    Isolate *isolate() {
-      return scheduler_->isolate();
-    }
-  };
-
-  // Perform scheduling for the current block specifying the queue type to
-  // use to determine the next best candidate.
-  template <typename QueueType>
-  void ScheduleBlock();
-
-  // Return the scheduling properties of the given instruction.
-  int GetInstructionFlags(const Instruction* instr) const;
-  int GetTargetInstructionFlags(const Instruction* instr) const;
-
-  // Return true if the instruction is a basic block terminator.
-  bool IsBlockTerminator(const Instruction* instr) const;
-
-  // Check whether the given instruction has side effects (e.g. function call,
-  // memory store).
-  bool HasSideEffect(const Instruction* instr) const {
-    return (GetInstructionFlags(instr) & kHasSideEffect) != 0;
-  }
-
-  // Return true if the instruction is a memory load.
-  bool IsLoadOperation(const Instruction* instr) const {
-    return (GetInstructionFlags(instr) & kIsLoadOperation) != 0;
-  }
-
-  // The scheduler will not move the following instructions before the last
-  // deopt/trap check:
-  //  * loads (this is conservative)
-  //  * instructions with side effect
-  //  * other deopts/traps
-  // Any other instruction can be moved, apart from those that raise exceptions
-  // on specific inputs - these are filtered out by the deopt/trap check.
-  bool MayNeedDeoptOrTrapCheck(const Instruction* instr) const {
-    return (GetInstructionFlags(instr) & kMayNeedDeoptOrTrapCheck) != 0;
-  }
-
-  // Return true if the instruction cannot be moved before the last deopt or
-  // trap point we encountered.
-  bool DependsOnDeoptOrTrap(const Instruction* instr) const {
-    return MayNeedDeoptOrTrapCheck(instr) || instr->IsDeoptimizeCall() ||
-           instr->IsTrap() || HasSideEffect(instr) || IsLoadOperation(instr);
-  }
-
-  // Identify nops used as a definition point for live-in registers at
-  // function entry.
-  bool IsFixedRegisterParameter(const Instruction* instr) const {
-    return (instr->arch_opcode() == kArchNop) && (instr->OutputCount() == 1) &&
-           (instr->OutputAt(0)->IsUnallocated()) &&
-           (UnallocatedOperand::cast(instr->OutputAt(0))
-                ->HasFixedRegisterPolicy() ||
-            UnallocatedOperand::cast(instr->OutputAt(0))
-                ->HasFixedFPRegisterPolicy());
-  }
-
-  void ComputeTotalLatencies();
-
-  static int GetInstructionLatency(const Instruction* instr);
-
-  Zone* zone() { return zone_; }
-  InstructionSequence* sequence() { return sequence_; }
-  Isolate* isolate() { return sequence()->isolate(); }
-
-  Zone* zone_;
-  InstructionSequence* sequence_;
-  ZoneVector<ScheduleGraphNode*> graph_;
-
-  // Last side effect instruction encountered while building the graph.
-  ScheduleGraphNode* last_side_effect_instr_;
-
-  // Set of load instructions encountered since the last side effect instruction
-  // which will be added as predecessors of the next instruction with side
-  // effects.
-  ZoneVector<ScheduleGraphNode*> pending_loads_;
-
-  // Live-in register markers are nop instructions which are emitted at the
-  // beginning of a basic block so that the register allocator will find a
-  // defining instruction for live-in values. They must not be moved.
-  // All these nops are chained together and added as a predecessor of every
-  // other instructions in the basic block.
-  ScheduleGraphNode* last_live_in_reg_marker_;
-
-  // Last deoptimization or trap instruction encountered while building the
-  // graph.
-  ScheduleGraphNode* last_deopt_or_trap_;
-
-  // Keep track of definition points for virtual registers. This is used to
-  // record operand dependencies in the scheduling graph.
-  ZoneMap<int32_t, ScheduleGraphNode*> operands_map_;
-};
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_COMPILER_INSTRUCTION_SCHEDULER_H_
diff --git a/src/v8/src/compiler/instruction-selector-impl.h b/src/v8/src/compiler/instruction-selector-impl.h
deleted file mode 100644
index 7c7a270..0000000
--- a/src/v8/src/compiler/instruction-selector-impl.h
+++ /dev/null
@@ -1,519 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_
-#define V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_
-
-#include "src/compiler/instruction-selector.h"
-#include "src/compiler/instruction.h"
-#include "src/compiler/linkage.h"
-#include "src/compiler/schedule.h"
-#include "src/macro-assembler.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-// Helper struct containing data about a table or lookup switch.
-struct SwitchInfo {
-  int32_t min_value;           // minimum value of {case_values}
-  int32_t max_value;           // maximum value of {case_values}
-  size_t value_range;          // |max_value - min_value| + 1
-  size_t case_count;           // number of cases
-  int32_t* case_values;        // actual case values, unsorted
-  BasicBlock** case_branches;  // basic blocks corresponding to case values
-  BasicBlock* default_branch;  // default branch target
-};
-
-// A helper class for the instruction selector that simplifies construction of
-// Operands. This class implements a base for architecture-specific helpers.
-class OperandGenerator {
- public:
-  explicit OperandGenerator(InstructionSelector* selector)
-      : selector_(selector) {}
-
-  InstructionOperand NoOutput() {
-    return InstructionOperand();  // Generates an invalid operand.
-  }
-
-  InstructionOperand DefineAsRegister(Node* node) {
-    return Define(node,
-                  UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER,
-                                     GetVReg(node)));
-  }
-
-  InstructionOperand DefineSameAsFirst(Node* node) {
-    return Define(node,
-                  UnallocatedOperand(UnallocatedOperand::SAME_AS_FIRST_INPUT,
-                                     GetVReg(node)));
-  }
-
-  InstructionOperand DefineAsFixed(Node* node, Register reg) {
-    return Define(node, UnallocatedOperand(UnallocatedOperand::FIXED_REGISTER,
-                                           reg.code(), GetVReg(node)));
-  }
-
-  template <typename FPRegType>
-  InstructionOperand DefineAsFixed(Node* node, FPRegType reg) {
-    return Define(node,
-                  UnallocatedOperand(UnallocatedOperand::FIXED_FP_REGISTER,
-                                     reg.code(), GetVReg(node)));
-  }
-
-  InstructionOperand DefineAsConstant(Node* node) {
-    return DefineAsConstant(node, ToConstant(node));
-  }
-
-  InstructionOperand DefineAsConstant(Node* node, Constant constant) {
-    selector()->MarkAsDefined(node);
-    int virtual_register = GetVReg(node);
-    sequence()->AddConstant(virtual_register, constant);
-    return ConstantOperand(virtual_register);
-  }
-
-  InstructionOperand DefineAsLocation(Node* node, LinkageLocation location) {
-    return Define(node, ToUnallocatedOperand(location, GetVReg(node)));
-  }
-
-  InstructionOperand DefineAsDualLocation(Node* node,
-                                          LinkageLocation primary_location,
-                                          LinkageLocation secondary_location) {
-    return Define(node,
-                  ToDualLocationUnallocatedOperand(
-                      primary_location, secondary_location, GetVReg(node)));
-  }
-
-  InstructionOperand Use(Node* node) {
-    return Use(node, UnallocatedOperand(UnallocatedOperand::NONE,
-                                        UnallocatedOperand::USED_AT_START,
-                                        GetVReg(node)));
-  }
-
-  InstructionOperand UseAnyAtEnd(Node* node) {
-    return Use(node, UnallocatedOperand(UnallocatedOperand::ANY,
-                                        UnallocatedOperand::USED_AT_END,
-                                        GetVReg(node)));
-  }
-
-  InstructionOperand UseAny(Node* node) {
-    return Use(node, UnallocatedOperand(UnallocatedOperand::ANY,
-                                        UnallocatedOperand::USED_AT_START,
-                                        GetVReg(node)));
-  }
-
-  InstructionOperand UseRegister(Node* node) {
-    return Use(node, UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER,
-                                        UnallocatedOperand::USED_AT_START,
-                                        GetVReg(node)));
-  }
-
-  InstructionOperand UseUniqueSlot(Node* node) {
-    return Use(node, UnallocatedOperand(UnallocatedOperand::MUST_HAVE_SLOT,
-                                        GetVReg(node)));
-  }
-
-  // Use register or operand for the node. If a register is chosen, it won't
-  // alias any temporary or output registers.
-  InstructionOperand UseUnique(Node* node) {
-    return Use(node,
-               UnallocatedOperand(UnallocatedOperand::NONE, GetVReg(node)));
-  }
-
-  // Use a unique register for the node that does not alias any temporary or
-  // output registers.
-  InstructionOperand UseUniqueRegister(Node* node) {
-    return Use(node, UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER,
-                                        GetVReg(node)));
-  }
-
-  InstructionOperand UseFixed(Node* node, Register reg) {
-    return Use(node, UnallocatedOperand(UnallocatedOperand::FIXED_REGISTER,
-                                        reg.code(), GetVReg(node)));
-  }
-
-  template <typename FPRegType>
-  InstructionOperand UseFixed(Node* node, FPRegType reg) {
-    return Use(node, UnallocatedOperand(UnallocatedOperand::FIXED_FP_REGISTER,
-                                        reg.code(), GetVReg(node)));
-  }
-
-  InstructionOperand UseExplicit(LinkageLocation location) {
-    MachineRepresentation rep = InstructionSequence::DefaultRepresentation();
-    if (location.IsRegister()) {
-      return ExplicitOperand(LocationOperand::REGISTER, rep,
-                             location.AsRegister());
-    } else {
-      return ExplicitOperand(LocationOperand::STACK_SLOT, rep,
-                             location.GetLocation());
-    }
-  }
-
-  InstructionOperand UseImmediate(int immediate) {
-    return sequence()->AddImmediate(Constant(immediate));
-  }
-
-  InstructionOperand UseImmediate(Node* node) {
-    return sequence()->AddImmediate(ToConstant(node));
-  }
-
-  InstructionOperand UseNegatedImmediate(Node* node) {
-    return sequence()->AddImmediate(ToNegatedConstant(node));
-  }
-
-  InstructionOperand UseLocation(Node* node, LinkageLocation location) {
-    return Use(node, ToUnallocatedOperand(location, GetVReg(node)));
-  }
-
-  // Used to force gap moves from the from_location to the to_location
-  // immediately before an instruction.
-  InstructionOperand UsePointerLocation(LinkageLocation to_location,
-                                        LinkageLocation from_location) {
-    UnallocatedOperand casted_from_operand =
-        UnallocatedOperand::cast(TempLocation(from_location));
-    selector_->Emit(kArchNop, casted_from_operand);
-    return ToUnallocatedOperand(to_location,
-                                casted_from_operand.virtual_register());
-  }
-
-  InstructionOperand TempRegister() {
-    return UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER,
-                              UnallocatedOperand::USED_AT_START,
-                              sequence()->NextVirtualRegister());
-  }
-
-  int AllocateVirtualRegister() { return sequence()->NextVirtualRegister(); }
-
-  InstructionOperand DefineSameAsFirstForVreg(int vreg) {
-    return UnallocatedOperand(UnallocatedOperand::SAME_AS_FIRST_INPUT, vreg);
-  }
-
-  InstructionOperand DefineAsRegistertForVreg(int vreg) {
-    return UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER, vreg);
-  }
-
-  InstructionOperand UseRegisterForVreg(int vreg) {
-    return UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER,
-                              UnallocatedOperand::USED_AT_START, vreg);
-  }
-
-  InstructionOperand TempDoubleRegister() {
-    UnallocatedOperand op = UnallocatedOperand(
-        UnallocatedOperand::MUST_HAVE_REGISTER,
-        UnallocatedOperand::USED_AT_START, sequence()->NextVirtualRegister());
-    sequence()->MarkAsRepresentation(MachineRepresentation::kFloat64,
-                                     op.virtual_register());
-    return op;
-  }
-
-  InstructionOperand TempRegister(Register reg) {
-    return UnallocatedOperand(UnallocatedOperand::FIXED_REGISTER, reg.code(),
-                              InstructionOperand::kInvalidVirtualRegister);
-  }
-
-  InstructionOperand TempImmediate(int32_t imm) {
-    return sequence()->AddImmediate(Constant(imm));
-  }
-
-  InstructionOperand TempLocation(LinkageLocation location) {
-    return ToUnallocatedOperand(location, sequence()->NextVirtualRegister());
-  }
-
-  InstructionOperand Label(BasicBlock* block) {
-    return sequence()->AddImmediate(
-        Constant(RpoNumber::FromInt(block->rpo_number())));
-  }
-
- protected:
-  InstructionSelector* selector() const { return selector_; }
-  InstructionSequence* sequence() const { return selector()->sequence(); }
-  Zone* zone() const { return selector()->instruction_zone(); }
-
- private:
-  int GetVReg(Node* node) const { return selector_->GetVirtualRegister(node); }
-
-  static Constant ToConstant(const Node* node) {
-    switch (node->opcode()) {
-      case IrOpcode::kInt32Constant:
-        return Constant(OpParameter<int32_t>(node));
-      case IrOpcode::kInt64Constant:
-        return Constant(OpParameter<int64_t>(node));
-      case IrOpcode::kFloat32Constant:
-        return Constant(OpParameter<float>(node));
-      case IrOpcode::kRelocatableInt32Constant:
-      case IrOpcode::kRelocatableInt64Constant:
-        return Constant(OpParameter<RelocatablePtrConstantInfo>(node));
-      case IrOpcode::kFloat64Constant:
-      case IrOpcode::kNumberConstant:
-        return Constant(OpParameter<double>(node));
-      case IrOpcode::kExternalConstant:
-      case IrOpcode::kComment:
-        return Constant(OpParameter<ExternalReference>(node));
-      case IrOpcode::kHeapConstant:
-        return Constant(OpParameter<Handle<HeapObject>>(node));
-      case IrOpcode::kDeadValue: {
-        switch (DeadValueRepresentationOf(node->op())) {
-          case MachineRepresentation::kBit:
-          case MachineRepresentation::kWord32:
-          case MachineRepresentation::kTagged:
-          case MachineRepresentation::kTaggedSigned:
-          case MachineRepresentation::kTaggedPointer:
-            return Constant(static_cast<int32_t>(0));
-          case MachineRepresentation::kFloat64:
-            return Constant(static_cast<double>(0));
-          case MachineRepresentation::kFloat32:
-            return Constant(static_cast<float>(0));
-          default:
-            UNREACHABLE();
-        }
-        break;
-      }
-      default:
-        break;
-    }
-    UNREACHABLE();
-  }
-
-  static Constant ToNegatedConstant(const Node* node) {
-    switch (node->opcode()) {
-      case IrOpcode::kInt32Constant:
-        return Constant(-OpParameter<int32_t>(node));
-      case IrOpcode::kInt64Constant:
-        return Constant(-OpParameter<int64_t>(node));
-      default:
-        break;
-    }
-    UNREACHABLE();
-  }
-
-  UnallocatedOperand Define(Node* node, UnallocatedOperand operand) {
-    DCHECK_NOT_NULL(node);
-    DCHECK_EQ(operand.virtual_register(), GetVReg(node));
-    selector()->MarkAsDefined(node);
-    return operand;
-  }
-
-  UnallocatedOperand Use(Node* node, UnallocatedOperand operand) {
-    DCHECK_NOT_NULL(node);
-    DCHECK_EQ(operand.virtual_register(), GetVReg(node));
-    selector()->MarkAsUsed(node);
-    return operand;
-  }
-
-  UnallocatedOperand ToDualLocationUnallocatedOperand(
-      LinkageLocation primary_location, LinkageLocation secondary_location,
-      int virtual_register) {
-    // We only support the primary location being a register and the secondary
-    // one a slot.
-    DCHECK(primary_location.IsRegister() &&
-           secondary_location.IsCalleeFrameSlot());
-    int reg_id = primary_location.AsRegister();
-    int slot_id = secondary_location.AsCalleeFrameSlot();
-    return UnallocatedOperand(reg_id, slot_id, virtual_register);
-  }
-
-  UnallocatedOperand ToUnallocatedOperand(LinkageLocation location,
-                                          int virtual_register) {
-    if (location.IsAnyRegister()) {
-      // any machine register.
-      return UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER,
-                                virtual_register);
-    }
-    if (location.IsCallerFrameSlot()) {
-      // a location on the caller frame.
-      return UnallocatedOperand(UnallocatedOperand::FIXED_SLOT,
-                                location.AsCallerFrameSlot(), virtual_register);
-    }
-    if (location.IsCalleeFrameSlot()) {
-      // a spill location on this (callee) frame.
-      return UnallocatedOperand(UnallocatedOperand::FIXED_SLOT,
-                                location.AsCalleeFrameSlot(), virtual_register);
-    }
-    // a fixed register.
-    if (IsFloatingPoint(location.GetType().representation())) {
-      return UnallocatedOperand(UnallocatedOperand::FIXED_FP_REGISTER,
-                                location.AsRegister(), virtual_register);
-    }
-    return UnallocatedOperand(UnallocatedOperand::FIXED_REGISTER,
-                              location.AsRegister(), virtual_register);
-  }
-
-  InstructionSelector* selector_;
-};
-
-
-// The flags continuation is a way to combine a branch or a materialization
-// of a boolean value with an instruction that sets the flags register.
-// The whole instruction is treated as a unit by the register allocator, and
-// thus no spills or moves can be introduced between the flags-setting
-// instruction and the branch or set it should be combined with.
-class FlagsContinuation final {
- public:
-  FlagsContinuation() : mode_(kFlags_none) {}
-
-  // Creates a new flags continuation from the given condition and true/false
-  // blocks.
-  FlagsContinuation(FlagsCondition condition, BasicBlock* true_block,
-                    BasicBlock* false_block)
-      : mode_(kFlags_branch),
-        condition_(condition),
-        true_block_(true_block),
-        false_block_(false_block) {
-    DCHECK_NOT_NULL(true_block);
-    DCHECK_NOT_NULL(false_block);
-  }
-
-  // Creates a new flags continuation for an eager deoptimization exit.
-  static FlagsContinuation ForDeoptimize(FlagsCondition condition,
-                                         DeoptimizeKind kind,
-                                         DeoptimizeReason reason,
-                                         VectorSlotPair const& feedback,
-                                         Node* frame_state) {
-    return FlagsContinuation(condition, kind, reason, feedback, frame_state);
-  }
-
-  // Creates a new flags continuation for a boolean value.
-  static FlagsContinuation ForSet(FlagsCondition condition, Node* result) {
-    return FlagsContinuation(condition, result);
-  }
-
-  // Creates a new flags continuation for a wasm trap.
-  static FlagsContinuation ForTrap(FlagsCondition condition,
-                                   Runtime::FunctionId trap_id, Node* result) {
-    return FlagsContinuation(condition, trap_id, result);
-  }
-
-  bool IsNone() const { return mode_ == kFlags_none; }
-  bool IsBranch() const { return mode_ == kFlags_branch; }
-  bool IsDeoptimize() const { return mode_ == kFlags_deoptimize; }
-  bool IsSet() const { return mode_ == kFlags_set; }
-  bool IsTrap() const { return mode_ == kFlags_trap; }
-  FlagsCondition condition() const {
-    DCHECK(!IsNone());
-    return condition_;
-  }
-  DeoptimizeKind kind() const {
-    DCHECK(IsDeoptimize());
-    return kind_;
-  }
-  DeoptimizeReason reason() const {
-    DCHECK(IsDeoptimize());
-    return reason_;
-  }
-  VectorSlotPair const& feedback() const {
-    DCHECK(IsDeoptimize());
-    return feedback_;
-  }
-  Node* frame_state() const {
-    DCHECK(IsDeoptimize());
-    return frame_state_or_result_;
-  }
-  Node* result() const {
-    DCHECK(IsSet());
-    return frame_state_or_result_;
-  }
-  Runtime::FunctionId trap_id() const {
-    DCHECK(IsTrap());
-    return trap_id_;
-  }
-  BasicBlock* true_block() const {
-    DCHECK(IsBranch());
-    return true_block_;
-  }
-  BasicBlock* false_block() const {
-    DCHECK(IsBranch());
-    return false_block_;
-  }
-
-  void Negate() {
-    DCHECK(!IsNone());
-    condition_ = NegateFlagsCondition(condition_);
-  }
-
-  void Commute() {
-    DCHECK(!IsNone());
-    condition_ = CommuteFlagsCondition(condition_);
-  }
-
-  void Overwrite(FlagsCondition condition) { condition_ = condition; }
-
-  void OverwriteAndNegateIfEqual(FlagsCondition condition) {
-    DCHECK(condition_ == kEqual || condition_ == kNotEqual);
-    bool negate = condition_ == kEqual;
-    condition_ = condition;
-    if (negate) Negate();
-  }
-
-  void OverwriteUnsignedIfSigned() {
-    switch (condition_) {
-      case kSignedLessThan:
-        condition_ = kUnsignedLessThan;
-        break;
-      case kSignedLessThanOrEqual:
-        condition_ = kUnsignedLessThanOrEqual;
-        break;
-      case kSignedGreaterThan:
-        condition_ = kUnsignedGreaterThan;
-        break;
-      case kSignedGreaterThanOrEqual:
-        condition_ = kUnsignedGreaterThanOrEqual;
-        break;
-      default:
-        break;
-    }
-  }
-
-  // Encodes this flags continuation into the given opcode.
-  InstructionCode Encode(InstructionCode opcode) {
-    opcode |= FlagsModeField::encode(mode_);
-    if (mode_ != kFlags_none) {
-      opcode |= FlagsConditionField::encode(condition_);
-    }
-    return opcode;
-  }
-
- private:
-  FlagsContinuation(FlagsCondition condition, DeoptimizeKind kind,
-                    DeoptimizeReason reason, VectorSlotPair const& feedback,
-                    Node* frame_state)
-      : mode_(kFlags_deoptimize),
-        condition_(condition),
-        kind_(kind),
-        reason_(reason),
-        feedback_(feedback),
-        frame_state_or_result_(frame_state) {
-    DCHECK_NOT_NULL(frame_state);
-  }
-  FlagsContinuation(FlagsCondition condition, Node* result)
-      : mode_(kFlags_set),
-        condition_(condition),
-        frame_state_or_result_(result) {
-    DCHECK_NOT_NULL(result);
-  }
-
-  FlagsContinuation(FlagsCondition condition, Runtime::FunctionId trap_id,
-                    Node* result)
-      : mode_(kFlags_trap),
-        condition_(condition),
-        frame_state_or_result_(result),
-        trap_id_(trap_id) {
-    DCHECK_NOT_NULL(result);
-  }
-
-  FlagsMode const mode_;
-  FlagsCondition condition_;
-  DeoptimizeKind kind_;          // Only valid if mode_ == kFlags_deoptimize
-  DeoptimizeReason reason_;      // Only valid if mode_ == kFlags_deoptimize
-  VectorSlotPair feedback_;      // Only valid if mode_ == kFlags_deoptimize
-  Node* frame_state_or_result_;  // Only valid if mode_ == kFlags_deoptimize
-                                 // or mode_ == kFlags_set.
-  BasicBlock* true_block_;       // Only valid if mode_ == kFlags_branch.
-  BasicBlock* false_block_;      // Only valid if mode_ == kFlags_branch.
-  Runtime::FunctionId trap_id_;  // Only valid if mode_ == kFlags_trap.
-};
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_
diff --git a/src/v8/src/compiler/instruction-selector.cc b/src/v8/src/compiler/instruction-selector.cc
deleted file mode 100644
index c94b42b..0000000
--- a/src/v8/src/compiler/instruction-selector.cc
+++ /dev/null
@@ -1,2752 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/compiler/instruction-selector.h"
-
-#include <limits>
-
-#include "src/assembler-inl.h"
-#include "src/base/adapters.h"
-#include "src/compiler/compiler-source-position-table.h"
-#include "src/compiler/instruction-selector-impl.h"
-#include "src/compiler/node-matchers.h"
-#include "src/compiler/pipeline.h"
-#include "src/compiler/schedule.h"
-#include "src/compiler/state-values-utils.h"
-#include "src/deoptimizer.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-InstructionSelector::InstructionSelector(
-    Zone* zone, size_t node_count, Linkage* linkage,
-    InstructionSequence* sequence, Schedule* schedule,
-    SourcePositionTable* source_positions, Frame* frame,
-    SourcePositionMode source_position_mode, Features features,
-    EnableScheduling enable_scheduling,
-    EnableSerialization enable_serialization)
-    : zone_(zone),
-      linkage_(linkage),
-      sequence_(sequence),
-      source_positions_(source_positions),
-      source_position_mode_(source_position_mode),
-      features_(features),
-      schedule_(schedule),
-      current_block_(nullptr),
-      instructions_(zone),
-      defined_(node_count, false, zone),
-      used_(node_count, false, zone),
-      effect_level_(node_count, 0, zone),
-      virtual_registers_(node_count,
-                         InstructionOperand::kInvalidVirtualRegister, zone),
-      virtual_register_rename_(zone),
-      scheduler_(nullptr),
-      enable_scheduling_(enable_scheduling),
-      enable_serialization_(enable_serialization),
-      frame_(frame),
-      instruction_selection_failed_(false) {
-  instructions_.reserve(node_count);
-}
-
-bool InstructionSelector::SelectInstructions() {
-  // Mark the inputs of all phis in loop headers as used.
-  BasicBlockVector* blocks = schedule()->rpo_order();
-  for (auto const block : *blocks) {
-    if (!block->IsLoopHeader()) continue;
-    DCHECK_LE(2u, block->PredecessorCount());
-    for (Node* const phi : *block) {
-      if (phi->opcode() != IrOpcode::kPhi) continue;
-
-      // Mark all inputs as used.
-      for (Node* const input : phi->inputs()) {
-        MarkAsUsed(input);
-      }
-    }
-  }
-
-  // Visit each basic block in post order.
-  for (auto i = blocks->rbegin(); i != blocks->rend(); ++i) {
-    VisitBlock(*i);
-    if (instruction_selection_failed()) return false;
-  }
-
-  // Schedule the selected instructions.
-  if (UseInstructionScheduling()) {
-    scheduler_ = new (zone()) InstructionScheduler(zone(), sequence());
-  }
-
-  for (auto const block : *blocks) {
-    InstructionBlock* instruction_block =
-        sequence()->InstructionBlockAt(RpoNumber::FromInt(block->rpo_number()));
-    for (size_t i = 0; i < instruction_block->phis().size(); i++) {
-      UpdateRenamesInPhi(instruction_block->PhiAt(i));
-    }
-    size_t end = instruction_block->code_end();
-    size_t start = instruction_block->code_start();
-    DCHECK_LE(end, start);
-    StartBlock(RpoNumber::FromInt(block->rpo_number()));
-    while (start-- > end) {
-      UpdateRenames(instructions_[start]);
-      AddInstruction(instructions_[start]);
-    }
-    EndBlock(RpoNumber::FromInt(block->rpo_number()));
-  }
-#if DEBUG
-  sequence()->ValidateSSA();
-#endif
-  return true;
-}
-
-void InstructionSelector::StartBlock(RpoNumber rpo) {
-  if (UseInstructionScheduling()) {
-    DCHECK_NOT_NULL(scheduler_);
-    scheduler_->StartBlock(rpo);
-  } else {
-    sequence()->StartBlock(rpo);
-  }
-}
-
-
-void InstructionSelector::EndBlock(RpoNumber rpo) {
-  if (UseInstructionScheduling()) {
-    DCHECK_NOT_NULL(scheduler_);
-    scheduler_->EndBlock(rpo);
-  } else {
-    sequence()->EndBlock(rpo);
-  }
-}
-
-
-void InstructionSelector::AddInstruction(Instruction* instr) {
-  if (UseInstructionScheduling()) {
-    DCHECK_NOT_NULL(scheduler_);
-    scheduler_->AddInstruction(instr);
-  } else {
-    sequence()->AddInstruction(instr);
-  }
-}
-
-Instruction* InstructionSelector::Emit(InstructionCode opcode,
-                                       InstructionOperand output,
-                                       size_t temp_count,
-                                       InstructionOperand* temps) {
-  size_t output_count = output.IsInvalid() ? 0 : 1;
-  return Emit(opcode, output_count, &output, 0, nullptr, temp_count, temps);
-}
-
-
-Instruction* InstructionSelector::Emit(InstructionCode opcode,
-                                       InstructionOperand output,
-                                       InstructionOperand a, size_t temp_count,
-                                       InstructionOperand* temps) {
-  size_t output_count = output.IsInvalid() ? 0 : 1;
-  return Emit(opcode, output_count, &output, 1, &a, temp_count, temps);
-}
-
-
-Instruction* InstructionSelector::Emit(InstructionCode opcode,
-                                       InstructionOperand output,
-                                       InstructionOperand a,
-                                       InstructionOperand b, size_t temp_count,
-                                       InstructionOperand* temps) {
-  size_t output_count = output.IsInvalid() ? 0 : 1;
-  InstructionOperand inputs[] = {a, b};
-  size_t input_count = arraysize(inputs);
-  return Emit(opcode, output_count, &output, input_count, inputs, temp_count,
-              temps);
-}
-
-
-Instruction* InstructionSelector::Emit(InstructionCode opcode,
-                                       InstructionOperand output,
-                                       InstructionOperand a,
-                                       InstructionOperand b,
-                                       InstructionOperand c, size_t temp_count,
-                                       InstructionOperand* temps) {
-  size_t output_count = output.IsInvalid() ? 0 : 1;
-  InstructionOperand inputs[] = {a, b, c};
-  size_t input_count = arraysize(inputs);
-  return Emit(opcode, output_count, &output, input_count, inputs, temp_count,
-              temps);
-}
-
-
-Instruction* InstructionSelector::Emit(
-    InstructionCode opcode, InstructionOperand output, InstructionOperand a,
-    InstructionOperand b, InstructionOperand c, InstructionOperand d,
-    size_t temp_count, InstructionOperand* temps) {
-  size_t output_count = output.IsInvalid() ? 0 : 1;
-  InstructionOperand inputs[] = {a, b, c, d};
-  size_t input_count = arraysize(inputs);
-  return Emit(opcode, output_count, &output, input_count, inputs, temp_count,
-              temps);
-}
-
-
-Instruction* InstructionSelector::Emit(
-    InstructionCode opcode, InstructionOperand output, InstructionOperand a,
-    InstructionOperand b, InstructionOperand c, InstructionOperand d,
-    InstructionOperand e, size_t temp_count, InstructionOperand* temps) {
-  size_t output_count = output.IsInvalid() ? 0 : 1;
-  InstructionOperand inputs[] = {a, b, c, d, e};
-  size_t input_count = arraysize(inputs);
-  return Emit(opcode, output_count, &output, input_count, inputs, temp_count,
-              temps);
-}
-
-
-Instruction* InstructionSelector::Emit(
-    InstructionCode opcode, InstructionOperand output, InstructionOperand a,
-    InstructionOperand b, InstructionOperand c, InstructionOperand d,
-    InstructionOperand e, InstructionOperand f, size_t temp_count,
-    InstructionOperand* temps) {
-  size_t output_count = output.IsInvalid() ? 0 : 1;
-  InstructionOperand inputs[] = {a, b, c, d, e, f};
-  size_t input_count = arraysize(inputs);
-  return Emit(opcode, output_count, &output, input_count, inputs, temp_count,
-              temps);
-}
-
-
-Instruction* InstructionSelector::Emit(
-    InstructionCode opcode, size_t output_count, InstructionOperand* outputs,
-    size_t input_count, InstructionOperand* inputs, size_t temp_count,
-    InstructionOperand* temps) {
-  if (output_count >= Instruction::kMaxOutputCount ||
-      input_count >= Instruction::kMaxInputCount ||
-      temp_count >= Instruction::kMaxTempCount) {
-    set_instruction_selection_failed();
-    return nullptr;
-  }
-
-  Instruction* instr =
-      Instruction::New(instruction_zone(), opcode, output_count, outputs,
-                       input_count, inputs, temp_count, temps);
-  return Emit(instr);
-}
-
-
-Instruction* InstructionSelector::Emit(Instruction* instr) {
-  instructions_.push_back(instr);
-  return instr;
-}
-
-
-bool InstructionSelector::CanCover(Node* user, Node* node) const {
-  // 1. Both {user} and {node} must be in the same basic block.
-  if (schedule()->block(node) != schedule()->block(user)) {
-    return false;
-  }
-  // 2. Pure {node}s must be owned by the {user}.
-  if (node->op()->HasProperty(Operator::kPure)) {
-    return node->OwnedBy(user);
-  }
-  // 3. Impure {node}s must match the effect level of {user}.
-  if (GetEffectLevel(node) != GetEffectLevel(user)) {
-    return false;
-  }
-  // 4. Only {node} must have value edges pointing to {user}.
-  for (Edge const edge : node->use_edges()) {
-    if (edge.from() != user && NodeProperties::IsValueEdge(edge)) {
-      return false;
-    }
-  }
-  return true;
-}
-
-bool InstructionSelector::IsOnlyUserOfNodeInSameBlock(Node* user,
-                                                      Node* node) const {
-  BasicBlock* bb_user = schedule()->block(user);
-  BasicBlock* bb_node = schedule()->block(node);
-  if (bb_user != bb_node) return false;
-  for (Edge const edge : node->use_edges()) {
-    Node* from = edge.from();
-    if ((from != user) && (schedule()->block(from) == bb_user)) {
-      return false;
-    }
-  }
-  return true;
-}
-
-void InstructionSelector::UpdateRenames(Instruction* instruction) {
-  for (size_t i = 0; i < instruction->InputCount(); i++) {
-    TryRename(instruction->InputAt(i));
-  }
-}
-
-void InstructionSelector::UpdateRenamesInPhi(PhiInstruction* phi) {
-  for (size_t i = 0; i < phi->operands().size(); i++) {
-    int vreg = phi->operands()[i];
-    int renamed = GetRename(vreg);
-    if (vreg != renamed) {
-      phi->RenameInput(i, renamed);
-    }
-  }
-}
-
-int InstructionSelector::GetRename(int virtual_register) {
-  int rename = virtual_register;
-  while (true) {
-    if (static_cast<size_t>(rename) >= virtual_register_rename_.size()) break;
-    int next = virtual_register_rename_[rename];
-    if (next == InstructionOperand::kInvalidVirtualRegister) {
-      break;
-    }
-    rename = next;
-  }
-  return rename;
-}
-
-void InstructionSelector::TryRename(InstructionOperand* op) {
-  if (!op->IsUnallocated()) return;
-  UnallocatedOperand* unalloc = UnallocatedOperand::cast(op);
-  int vreg = unalloc->virtual_register();
-  int rename = GetRename(vreg);
-  if (rename != vreg) {
-    *unalloc = UnallocatedOperand(*unalloc, rename);
-  }
-}
-
-void InstructionSelector::SetRename(const Node* node, const Node* rename) {
-  int vreg = GetVirtualRegister(node);
-  if (static_cast<size_t>(vreg) >= virtual_register_rename_.size()) {
-    int invalid = InstructionOperand::kInvalidVirtualRegister;
-    virtual_register_rename_.resize(vreg + 1, invalid);
-  }
-  virtual_register_rename_[vreg] = GetVirtualRegister(rename);
-}
-
-int InstructionSelector::GetVirtualRegister(const Node* node) {
-  DCHECK_NOT_NULL(node);
-  size_t const id = node->id();
-  DCHECK_LT(id, virtual_registers_.size());
-  int virtual_register = virtual_registers_[id];
-  if (virtual_register == InstructionOperand::kInvalidVirtualRegister) {
-    virtual_register = sequence()->NextVirtualRegister();
-    virtual_registers_[id] = virtual_register;
-  }
-  return virtual_register;
-}
-
-
-const std::map<NodeId, int> InstructionSelector::GetVirtualRegistersForTesting()
-    const {
-  std::map<NodeId, int> virtual_registers;
-  for (size_t n = 0; n < virtual_registers_.size(); ++n) {
-    if (virtual_registers_[n] != InstructionOperand::kInvalidVirtualRegister) {
-      NodeId const id = static_cast<NodeId>(n);
-      virtual_registers.insert(std::make_pair(id, virtual_registers_[n]));
-    }
-  }
-  return virtual_registers;
-}
-
-
-bool InstructionSelector::IsDefined(Node* node) const {
-  DCHECK_NOT_NULL(node);
-  size_t const id = node->id();
-  DCHECK_LT(id, defined_.size());
-  return defined_[id];
-}
-
-
-void InstructionSelector::MarkAsDefined(Node* node) {
-  DCHECK_NOT_NULL(node);
-  size_t const id = node->id();
-  DCHECK_LT(id, defined_.size());
-  defined_[id] = true;
-}
-
-
-bool InstructionSelector::IsUsed(Node* node) const {
-  DCHECK_NOT_NULL(node);
-  // TODO(bmeurer): This is a terrible monster hack, but we have to make sure
-  // that the Retain is actually emitted, otherwise the GC will mess up.
-  if (node->opcode() == IrOpcode::kRetain) return true;
-  if (!node->op()->HasProperty(Operator::kEliminatable)) return true;
-  size_t const id = node->id();
-  DCHECK_LT(id, used_.size());
-  return used_[id];
-}
-
-
-void InstructionSelector::MarkAsUsed(Node* node) {
-  DCHECK_NOT_NULL(node);
-  size_t const id = node->id();
-  DCHECK_LT(id, used_.size());
-  used_[id] = true;
-}
-
-int InstructionSelector::GetEffectLevel(Node* node) const {
-  DCHECK_NOT_NULL(node);
-  size_t const id = node->id();
-  DCHECK_LT(id, effect_level_.size());
-  return effect_level_[id];
-}
-
-void InstructionSelector::SetEffectLevel(Node* node, int effect_level) {
-  DCHECK_NOT_NULL(node);
-  size_t const id = node->id();
-  DCHECK_LT(id, effect_level_.size());
-  effect_level_[id] = effect_level;
-}
-
-bool InstructionSelector::CanAddressRelativeToRootsRegister() const {
-  return enable_serialization_ == kDisableSerialization &&
-         CanUseRootsRegister();
-}
-
-bool InstructionSelector::CanUseRootsRegister() const {
-  return linkage()->GetIncomingDescriptor()->flags() &
-         CallDescriptor::kCanUseRoots;
-}
-
-void InstructionSelector::MarkAsRepresentation(MachineRepresentation rep,
-                                               const InstructionOperand& op) {
-  UnallocatedOperand unalloc = UnallocatedOperand::cast(op);
-  sequence()->MarkAsRepresentation(rep, unalloc.virtual_register());
-}
-
-
-void InstructionSelector::MarkAsRepresentation(MachineRepresentation rep,
-                                               Node* node) {
-  sequence()->MarkAsRepresentation(rep, GetVirtualRegister(node));
-}
-
-namespace {
-
-InstructionOperand OperandForDeopt(Isolate* isolate, OperandGenerator* g,
-                                   Node* input, FrameStateInputKind kind,
-                                   MachineRepresentation rep) {
-  if (rep == MachineRepresentation::kNone) {
-    return g->TempImmediate(FrameStateDescriptor::kImpossibleValue);
-  }
-
-  switch (input->opcode()) {
-    case IrOpcode::kInt32Constant:
-    case IrOpcode::kInt64Constant:
-    case IrOpcode::kNumberConstant:
-    case IrOpcode::kFloat32Constant:
-    case IrOpcode::kFloat64Constant:
-      return g->UseImmediate(input);
-    case IrOpcode::kHeapConstant: {
-      if (!CanBeTaggedPointer(rep)) {
-        // If we have inconsistent static and dynamic types, e.g. if we
-        // smi-check a string, we can get here with a heap object that
-        // says it is a smi. In that case, we return an invalid instruction
-        // operand, which will be interpreted as an optimized-out value.
-
-        // TODO(jarin) Ideally, we should turn the current instruction
-        // into an abort (we should never execute it).
-        return InstructionOperand();
-      }
-
-      Handle<HeapObject> constant = OpParameter<Handle<HeapObject>>(input);
-      Heap::RootListIndex root_index;
-      if (isolate->heap()->IsRootHandle(constant, &root_index) &&
-          root_index == Heap::kOptimizedOutRootIndex) {
-        // For an optimized-out object we return an invalid instruction
-        // operand, so that we take the fast path for optimized-out values.
-        return InstructionOperand();
-      }
-
-      return g->UseImmediate(input);
-    }
-    case IrOpcode::kArgumentsElementsState:
-    case IrOpcode::kArgumentsLengthState:
-    case IrOpcode::kObjectState:
-    case IrOpcode::kTypedObjectState:
-      UNREACHABLE();
-      break;
-    default:
-      switch (kind) {
-        case FrameStateInputKind::kStackSlot:
-          return g->UseUniqueSlot(input);
-        case FrameStateInputKind::kAny:
-          // Currently deopts "wrap" other operations, so the deopt's inputs
-          // are potentially needed until the end of the deoptimising code.
-          return g->UseAnyAtEnd(input);
-      }
-  }
-  UNREACHABLE();
-}
-
-}  // namespace
-
-class StateObjectDeduplicator {
- public:
-  explicit StateObjectDeduplicator(Zone* zone) : objects_(zone) {}
-  static const size_t kNotDuplicated = SIZE_MAX;
-
-  size_t GetObjectId(Node* node) {
-    DCHECK(node->opcode() == IrOpcode::kTypedObjectState ||
-           node->opcode() == IrOpcode::kObjectId ||
-           node->opcode() == IrOpcode::kArgumentsElementsState);
-    for (size_t i = 0; i < objects_.size(); ++i) {
-      if (objects_[i] == node) return i;
-      // ObjectId nodes are the Turbofan way to express objects with the same
-      // identity in the deopt info. So they should always be mapped to
-      // previously appearing TypedObjectState nodes.
-      if (HasObjectId(objects_[i]) && HasObjectId(node) &&
-          ObjectIdOf(objects_[i]->op()) == ObjectIdOf(node->op())) {
-        return i;
-      }
-    }
-    DCHECK(node->opcode() == IrOpcode::kTypedObjectState ||
-           node->opcode() == IrOpcode::kArgumentsElementsState);
-    return kNotDuplicated;
-  }
-
-  size_t InsertObject(Node* node) {
-    DCHECK(node->opcode() == IrOpcode::kTypedObjectState ||
-           node->opcode() == IrOpcode::kObjectId ||
-           node->opcode() == IrOpcode::kArgumentsElementsState);
-    size_t id = objects_.size();
-    objects_.push_back(node);
-    return id;
-  }
-
- private:
-  static bool HasObjectId(Node* node) {
-    return node->opcode() == IrOpcode::kTypedObjectState ||
-           node->opcode() == IrOpcode::kObjectId;
-  }
-
-  ZoneVector<Node*> objects_;
-};
-
-// Returns the number of instruction operands added to inputs.
-size_t InstructionSelector::AddOperandToStateValueDescriptor(
-    StateValueList* values, InstructionOperandVector* inputs,
-    OperandGenerator* g, StateObjectDeduplicator* deduplicator, Node* input,
-    MachineType type, FrameStateInputKind kind, Zone* zone) {
-  if (input == nullptr) {
-    values->PushOptimizedOut();
-    return 0;
-  }
-
-  switch (input->opcode()) {
-    case IrOpcode::kArgumentsElementsState: {
-      values->PushArgumentsElements(ArgumentsStateTypeOf(input->op()));
-      // The elements backing store of an arguments object participates in the
-      // duplicate object counting, but can itself never appear duplicated.
-      DCHECK_EQ(StateObjectDeduplicator::kNotDuplicated,
-                deduplicator->GetObjectId(input));
-      deduplicator->InsertObject(input);
-      return 0;
-    }
-    case IrOpcode::kArgumentsLengthState: {
-      values->PushArgumentsLength(ArgumentsStateTypeOf(input->op()));
-      return 0;
-    }
-    case IrOpcode::kObjectState: {
-      UNREACHABLE();
-    }
-    case IrOpcode::kTypedObjectState:
-    case IrOpcode::kObjectId: {
-      size_t id = deduplicator->GetObjectId(input);
-      if (id == StateObjectDeduplicator::kNotDuplicated) {
-        DCHECK_EQ(IrOpcode::kTypedObjectState, input->opcode());
-        size_t entries = 0;
-        id = deduplicator->InsertObject(input);
-        StateValueList* nested = values->PushRecursiveField(zone, id);
-        int const input_count = input->op()->ValueInputCount();
-        ZoneVector<MachineType> const* types = MachineTypesOf(input->op());
-        for (int i = 0; i < input_count; ++i) {
-          entries += AddOperandToStateValueDescriptor(
-              nested, inputs, g, deduplicator, input->InputAt(i), types->at(i),
-              kind, zone);
-        }
-        return entries;
-      } else {
-        // Crankshaft counts duplicate objects for the running id, so we have
-        // to push the input again.
-        deduplicator->InsertObject(input);
-        values->PushDuplicate(id);
-        return 0;
-      }
-    }
-    default: {
-      InstructionOperand op =
-          OperandForDeopt(isolate(), g, input, kind, type.representation());
-      if (op.kind() == InstructionOperand::INVALID) {
-        // Invalid operand means the value is impossible or optimized-out.
-        values->PushOptimizedOut();
-        return 0;
-      } else {
-        inputs->push_back(op);
-        values->PushPlain(type);
-        return 1;
-      }
-    }
-  }
-}
-
-
-// Returns the number of instruction operands added to inputs.
-size_t InstructionSelector::AddInputsToFrameStateDescriptor(
-    FrameStateDescriptor* descriptor, Node* state, OperandGenerator* g,
-    StateObjectDeduplicator* deduplicator, InstructionOperandVector* inputs,
-    FrameStateInputKind kind, Zone* zone) {
-  DCHECK_EQ(IrOpcode::kFrameState, state->op()->opcode());
-
-  size_t entries = 0;
-  size_t initial_size = inputs->size();
-  USE(initial_size);  // initial_size is only used for debug.
-
-  if (descriptor->outer_state()) {
-    entries += AddInputsToFrameStateDescriptor(
-        descriptor->outer_state(), state->InputAt(kFrameStateOuterStateInput),
-        g, deduplicator, inputs, kind, zone);
-  }
-
-  Node* parameters = state->InputAt(kFrameStateParametersInput);
-  Node* locals = state->InputAt(kFrameStateLocalsInput);
-  Node* stack = state->InputAt(kFrameStateStackInput);
-  Node* context = state->InputAt(kFrameStateContextInput);
-  Node* function = state->InputAt(kFrameStateFunctionInput);
-
-  DCHECK_EQ(descriptor->parameters_count(),
-            StateValuesAccess(parameters).size());
-  DCHECK_EQ(descriptor->locals_count(), StateValuesAccess(locals).size());
-  DCHECK_EQ(descriptor->stack_count(), StateValuesAccess(stack).size());
-
-  StateValueList* values_descriptor = descriptor->GetStateValueDescriptors();
-
-  DCHECK_EQ(values_descriptor->size(), 0u);
-  values_descriptor->ReserveSize(descriptor->GetSize());
-
-  entries += AddOperandToStateValueDescriptor(
-      values_descriptor, inputs, g, deduplicator, function,
-      MachineType::AnyTagged(), FrameStateInputKind::kStackSlot, zone);
-  for (StateValuesAccess::TypedNode input_node :
-       StateValuesAccess(parameters)) {
-    entries += AddOperandToStateValueDescriptor(values_descriptor, inputs, g,
-                                                deduplicator, input_node.node,
-                                                input_node.type, kind, zone);
-  }
-  if (descriptor->HasContext()) {
-    entries += AddOperandToStateValueDescriptor(
-        values_descriptor, inputs, g, deduplicator, context,
-        MachineType::AnyTagged(), FrameStateInputKind::kStackSlot, zone);
-  }
-  for (StateValuesAccess::TypedNode input_node : StateValuesAccess(locals)) {
-    entries += AddOperandToStateValueDescriptor(values_descriptor, inputs, g,
-                                                deduplicator, input_node.node,
-                                                input_node.type, kind, zone);
-  }
-  for (StateValuesAccess::TypedNode input_node : StateValuesAccess(stack)) {
-    entries += AddOperandToStateValueDescriptor(values_descriptor, inputs, g,
-                                                deduplicator, input_node.node,
-                                                input_node.type, kind, zone);
-  }
-  DCHECK_EQ(initial_size + entries, inputs->size());
-  return entries;
-}
-
-
-// An internal helper class for generating the operands to calls.
-// TODO(bmeurer): Get rid of the CallBuffer business and make
-// InstructionSelector::VisitCall platform independent instead.
-struct CallBuffer {
-  CallBuffer(Zone* zone, const CallDescriptor* descriptor,
-             FrameStateDescriptor* frame_state)
-      : descriptor(descriptor),
-        frame_state_descriptor(frame_state),
-        output_nodes(zone),
-        outputs(zone),
-        instruction_args(zone),
-        pushed_nodes(zone) {
-    output_nodes.reserve(descriptor->ReturnCount());
-    outputs.reserve(descriptor->ReturnCount());
-    pushed_nodes.reserve(input_count());
-    instruction_args.reserve(input_count() + frame_state_value_count());
-  }
-
-
-  const CallDescriptor* descriptor;
-  FrameStateDescriptor* frame_state_descriptor;
-  ZoneVector<PushParameter> output_nodes;
-  InstructionOperandVector outputs;
-  InstructionOperandVector instruction_args;
-  ZoneVector<PushParameter> pushed_nodes;
-
-  size_t input_count() const { return descriptor->InputCount(); }
-
-  size_t frame_state_count() const { return descriptor->FrameStateCount(); }
-
-  size_t frame_state_value_count() const {
-    return (frame_state_descriptor == nullptr)
-               ? 0
-               : (frame_state_descriptor->GetTotalSize() +
-                  1);  // Include deopt id.
-  }
-};
-
-
-// TODO(bmeurer): Get rid of the CallBuffer business and make
-// InstructionSelector::VisitCall platform independent instead.
-void InstructionSelector::InitializeCallBuffer(Node* call, CallBuffer* buffer,
-                                               CallBufferFlags flags,
-                                               bool is_tail_call,
-                                               int stack_param_delta) {
-  OperandGenerator g(this);
-  size_t ret_count = buffer->descriptor->ReturnCount();
-  DCHECK_LE(call->op()->ValueOutputCount(), ret_count);
-  DCHECK_EQ(
-      call->op()->ValueInputCount(),
-      static_cast<int>(buffer->input_count() + buffer->frame_state_count()));
-
-  if (ret_count > 0) {
-    // Collect the projections that represent multiple outputs from this call.
-    if (ret_count == 1) {
-      PushParameter result = {call, buffer->descriptor->GetReturnLocation(0)};
-      buffer->output_nodes.push_back(result);
-    } else {
-      buffer->output_nodes.resize(ret_count);
-      int stack_count = 0;
-      for (size_t i = 0; i < ret_count; ++i) {
-        LinkageLocation location = buffer->descriptor->GetReturnLocation(i);
-        buffer->output_nodes[i] = PushParameter(nullptr, location);
-        if (location.IsCallerFrameSlot()) {
-          stack_count += location.GetSizeInPointers();
-        }
-      }
-      for (Edge const edge : call->use_edges()) {
-        if (!NodeProperties::IsValueEdge(edge)) continue;
-        Node* node = edge.from();
-        DCHECK_EQ(IrOpcode::kProjection, node->opcode());
-        size_t const index = ProjectionIndexOf(node->op());
-
-        DCHECK_LT(index, buffer->output_nodes.size());
-        DCHECK(!buffer->output_nodes[index].node);
-        buffer->output_nodes[index].node = node;
-      }
-      frame_->EnsureReturnSlots(stack_count);
-    }
-
-    // Filter out the outputs that aren't live because no projection uses them.
-    size_t outputs_needed_by_framestate =
-        buffer->frame_state_descriptor == nullptr
-            ? 0
-            : buffer->frame_state_descriptor->state_combine()
-                  .ConsumedOutputCount();
-    for (size_t i = 0; i < buffer->output_nodes.size(); i++) {
-      bool output_is_live = buffer->output_nodes[i].node != nullptr ||
-                            i < outputs_needed_by_framestate;
-      if (output_is_live) {
-        LinkageLocation location = buffer->output_nodes[i].location;
-        MachineRepresentation rep = location.GetType().representation();
-
-        Node* output = buffer->output_nodes[i].node;
-        InstructionOperand op = output == nullptr
-                                    ? g.TempLocation(location)
-                                    : g.DefineAsLocation(output, location);
-        MarkAsRepresentation(rep, op);
-
-        if (!UnallocatedOperand::cast(op).HasFixedSlotPolicy()) {
-          buffer->outputs.push_back(op);
-          buffer->output_nodes[i].node = nullptr;
-        }
-      }
-    }
-  }
-
-  // The first argument is always the callee code.
-  Node* callee = call->InputAt(0);
-  bool call_code_immediate = (flags & kCallCodeImmediate) != 0;
-  bool call_address_immediate = (flags & kCallAddressImmediate) != 0;
-  switch (buffer->descriptor->kind()) {
-    case CallDescriptor::kCallCodeObject:
-      buffer->instruction_args.push_back(
-          (call_code_immediate && callee->opcode() == IrOpcode::kHeapConstant)
-              ? g.UseImmediate(callee)
-              : g.UseRegister(callee));
-      break;
-    case CallDescriptor::kCallAddress:
-      buffer->instruction_args.push_back(
-          (call_address_immediate &&
-           callee->opcode() == IrOpcode::kExternalConstant)
-              ? g.UseImmediate(callee)
-              : g.UseRegister(callee));
-      break;
-    case CallDescriptor::kCallWasmFunction:
-      buffer->instruction_args.push_back(
-          (call_address_immediate &&
-           (callee->opcode() == IrOpcode::kRelocatableInt64Constant ||
-            callee->opcode() == IrOpcode::kRelocatableInt32Constant))
-              ? g.UseImmediate(callee)
-              : g.UseRegister(callee));
-      break;
-    case CallDescriptor::kCallJSFunction:
-      buffer->instruction_args.push_back(
-          g.UseLocation(callee, buffer->descriptor->GetInputLocation(0)));
-      break;
-  }
-  DCHECK_EQ(1u, buffer->instruction_args.size());
-
-  // If the call needs a frame state, we insert the state information as
-  // follows (n is the number of value inputs to the frame state):
-  // arg 1               : deoptimization id.
-  // arg 2 - arg (n + 1) : value inputs to the frame state.
-  size_t frame_state_entries = 0;
-  USE(frame_state_entries);  // frame_state_entries is only used for debug.
-  if (buffer->frame_state_descriptor != nullptr) {
-    Node* frame_state =
-        call->InputAt(static_cast<int>(buffer->descriptor->InputCount()));
-
-    // If it was a syntactic tail call we need to drop the current frame and
-    // all the frames on top of it that are either an arguments adaptor frame
-    // or a tail caller frame.
-    if (is_tail_call) {
-      frame_state = NodeProperties::GetFrameStateInput(frame_state);
-      buffer->frame_state_descriptor =
-          buffer->frame_state_descriptor->outer_state();
-      while (buffer->frame_state_descriptor != nullptr &&
-             buffer->frame_state_descriptor->type() ==
-                 FrameStateType::kArgumentsAdaptor) {
-        frame_state = NodeProperties::GetFrameStateInput(frame_state);
-        buffer->frame_state_descriptor =
-            buffer->frame_state_descriptor->outer_state();
-      }
-    }
-
-    int const state_id = sequence()->AddDeoptimizationEntry(
-        buffer->frame_state_descriptor, DeoptimizeKind::kLazy,
-        DeoptimizeReason::kUnknown, VectorSlotPair());
-    buffer->instruction_args.push_back(g.TempImmediate(state_id));
-
-    StateObjectDeduplicator deduplicator(instruction_zone());
-
-    frame_state_entries =
-        1 + AddInputsToFrameStateDescriptor(
-                buffer->frame_state_descriptor, frame_state, &g, &deduplicator,
-                &buffer->instruction_args, FrameStateInputKind::kStackSlot,
-                instruction_zone());
-
-    DCHECK_EQ(1 + frame_state_entries, buffer->instruction_args.size());
-  }
-
-  size_t input_count = static_cast<size_t>(buffer->input_count());
-
-  // Split the arguments into pushed_nodes and instruction_args. Pushed
-  // arguments require an explicit push instruction before the call and do
-  // not appear as arguments to the call. Everything else ends up
-  // as an InstructionOperand argument to the call.
-  auto iter(call->inputs().begin());
-  size_t pushed_count = 0;
-  bool call_tail = (flags & kCallTail) != 0;
-  for (size_t index = 0; index < input_count; ++iter, ++index) {
-    DCHECK(iter != call->inputs().end());
-    DCHECK_NE(IrOpcode::kFrameState, (*iter)->op()->opcode());
-    if (index == 0) continue;  // The first argument (callee) is already done.
-
-    LinkageLocation location = buffer->descriptor->GetInputLocation(index);
-    if (call_tail) {
-      location = LinkageLocation::ConvertToTailCallerLocation(
-          location, stack_param_delta);
-    }
-    InstructionOperand op = g.UseLocation(*iter, location);
-    if (UnallocatedOperand::cast(op).HasFixedSlotPolicy() && !call_tail) {
-      int stack_index = -UnallocatedOperand::cast(op).fixed_slot_index() - 1;
-      if (static_cast<size_t>(stack_index) >= buffer->pushed_nodes.size()) {
-        buffer->pushed_nodes.resize(stack_index + 1);
-      }
-      PushParameter param = {*iter, location};
-      buffer->pushed_nodes[stack_index] = param;
-      pushed_count++;
-    } else {
-      buffer->instruction_args.push_back(op);
-    }
-  }
-  DCHECK_EQ(input_count, buffer->instruction_args.size() + pushed_count -
-                             frame_state_entries);
-  if (V8_TARGET_ARCH_STORES_RETURN_ADDRESS_ON_STACK && call_tail &&
-      stack_param_delta != 0) {
-    // For tail calls that change the size of their parameter list and keep
-    // their return address on the stack, move the return address to just above
-    // the parameters.
-    LinkageLocation saved_return_location =
-        LinkageLocation::ForSavedCallerReturnAddress();
-    InstructionOperand return_address =
-        g.UsePointerLocation(LinkageLocation::ConvertToTailCallerLocation(
-                                 saved_return_location, stack_param_delta),
-                             saved_return_location);
-    buffer->instruction_args.push_back(return_address);
-  }
-}
-
-bool InstructionSelector::IsSourcePositionUsed(Node* node) {
-  return (source_position_mode_ == kAllSourcePositions ||
-          node->opcode() == IrOpcode::kCall ||
-          node->opcode() == IrOpcode::kCallWithCallerSavedRegisters ||
-          node->opcode() == IrOpcode::kTrapIf ||
-          node->opcode() == IrOpcode::kTrapUnless ||
-          node->opcode() == IrOpcode::kProtectedLoad ||
-          node->opcode() == IrOpcode::kProtectedStore);
-}
-
-void InstructionSelector::VisitBlock(BasicBlock* block) {
-  DCHECK(!current_block_);
-  current_block_ = block;
-  auto current_num_instructions = [&] {
-    DCHECK_GE(kMaxInt, instructions_.size());
-    return static_cast<int>(instructions_.size());
-  };
-  int current_block_end = current_num_instructions();
-
-  int effect_level = 0;
-  for (Node* const node : *block) {
-    SetEffectLevel(node, effect_level);
-    if (node->opcode() == IrOpcode::kStore ||
-        node->opcode() == IrOpcode::kUnalignedStore ||
-        node->opcode() == IrOpcode::kCall ||
-        node->opcode() == IrOpcode::kCallWithCallerSavedRegisters ||
-        node->opcode() == IrOpcode::kProtectedLoad ||
-        node->opcode() == IrOpcode::kProtectedStore) {
-      ++effect_level;
-    }
-  }
-
-  // We visit the control first, then the nodes in the block, so the block's
-  // control input should be on the same effect level as the last node.
-  if (block->control_input() != nullptr) {
-    SetEffectLevel(block->control_input(), effect_level);
-  }
-
-  auto FinishEmittedInstructions = [&](Node* node, int instruction_start) {
-    if (instruction_selection_failed()) return false;
-    if (current_num_instructions() == instruction_start) return true;
-    std::reverse(instructions_.begin() + instruction_start,
-                 instructions_.end());
-    if (!node) return true;
-    SourcePosition source_position = source_positions_->GetSourcePosition(node);
-    if (source_position.IsKnown() && IsSourcePositionUsed(node)) {
-      sequence()->SetSourcePosition(instructions_[instruction_start],
-                                    source_position);
-    }
-    return true;
-  };
-
-  // Generate code for the block control "top down", but schedule the code
-  // "bottom up".
-  VisitControl(block);
-  if (!FinishEmittedInstructions(block->control_input(), current_block_end))
-    return;
-
-  // Visit code in reverse control flow order, because architecture-specific
-  // matching may cover more than one node at a time.
-  for (auto node : base::Reversed(*block)) {
-    // Skip nodes that are unused or already defined.
-    if (!IsUsed(node) || IsDefined(node)) continue;
-    // Generate code for this node "top down", but schedule the code "bottom
-    // up".
-    int current_node_end = current_num_instructions();
-    VisitNode(node);
-    if (!FinishEmittedInstructions(node, current_node_end)) return;
-  }
-
-  // We're done with the block.
-  InstructionBlock* instruction_block =
-      sequence()->InstructionBlockAt(RpoNumber::FromInt(block->rpo_number()));
-  instruction_block->set_code_start(static_cast<int>(instructions_.size()));
-  instruction_block->set_code_end(current_block_end);
-
-  current_block_ = nullptr;
-}
-
-
-void InstructionSelector::VisitControl(BasicBlock* block) {
-#ifdef DEBUG
-  // SSA deconstruction requires targets of branches not to have phis.
-  // Edge split form guarantees this property, but is more strict.
-  if (block->SuccessorCount() > 1) {
-    for (BasicBlock* const successor : block->successors()) {
-      for (Node* const node : *successor) {
-        if (IrOpcode::IsPhiOpcode(node->opcode())) {
-          std::ostringstream str;
-          str << "You might have specified merged variables for a label with "
-              << "only one predecessor." << std::endl
-              << "# Current Block: " << *successor << std::endl
-              << "#          Node: " << *node;
-          FATAL("%s", str.str().c_str());
-        }
-      }
-    }
-  }
-#endif
-
-  Node* input = block->control_input();
-  switch (block->control()) {
-    case BasicBlock::kGoto:
-      return VisitGoto(block->SuccessorAt(0));
-    case BasicBlock::kCall: {
-      DCHECK_EQ(IrOpcode::kCall, input->opcode());
-      BasicBlock* success = block->SuccessorAt(0);
-      BasicBlock* exception = block->SuccessorAt(1);
-      return VisitCall(input, exception), VisitGoto(success);
-    }
-    case BasicBlock::kTailCall: {
-      DCHECK_EQ(IrOpcode::kTailCall, input->opcode());
-      return VisitTailCall(input);
-    }
-    case BasicBlock::kBranch: {
-      DCHECK_EQ(IrOpcode::kBranch, input->opcode());
-      BasicBlock* tbranch = block->SuccessorAt(0);
-      BasicBlock* fbranch = block->SuccessorAt(1);
-      if (tbranch == fbranch) return VisitGoto(tbranch);
-      return VisitBranch(input, tbranch, fbranch);
-    }
-    case BasicBlock::kSwitch: {
-      DCHECK_EQ(IrOpcode::kSwitch, input->opcode());
-      SwitchInfo sw;
-      // Last successor must be Default.
-      sw.default_branch = block->successors().back();
-      DCHECK_EQ(IrOpcode::kIfDefault, sw.default_branch->front()->opcode());
-      // All other successors must be cases.
-      sw.case_count = block->SuccessorCount() - 1;
-      sw.case_branches = &block->successors().front();
-      // Determine case values and their min/max.
-      sw.case_values = zone()->NewArray<int32_t>(sw.case_count);
-      sw.min_value = std::numeric_limits<int32_t>::max();
-      sw.max_value = std::numeric_limits<int32_t>::min();
-      for (size_t index = 0; index < sw.case_count; ++index) {
-        BasicBlock* branch = sw.case_branches[index];
-        int32_t value = OpParameter<int32_t>(branch->front()->op());
-        sw.case_values[index] = value;
-        if (sw.min_value > value) sw.min_value = value;
-        if (sw.max_value < value) sw.max_value = value;
-      }
-      if (sw.case_count != 0) {
-        DCHECK_LE(sw.min_value, sw.max_value);
-        // Note that {value_range} can be 0 if {min_value} is -2^31 and
-        // {max_value} is 2^31-1, so don't assume that it's non-zero below.
-        sw.value_range = 1u + bit_cast<uint32_t>(sw.max_value) -
-                         bit_cast<uint32_t>(sw.min_value);
-      } else {
-        sw.value_range = 0;
-      }
-      return VisitSwitch(input, sw);
-    }
-    case BasicBlock::kReturn: {
-      DCHECK_EQ(IrOpcode::kReturn, input->opcode());
-      return VisitReturn(input);
-    }
-    case BasicBlock::kDeoptimize: {
-      DeoptimizeParameters p = DeoptimizeParametersOf(input->op());
-      Node* value = input->InputAt(0);
-      return VisitDeoptimize(p.kind(), p.reason(), p.feedback(), value);
-    }
-    case BasicBlock::kThrow:
-      DCHECK_EQ(IrOpcode::kThrow, input->opcode());
-      return VisitThrow(input);
-    case BasicBlock::kNone: {
-      // Exit block doesn't have control.
-      DCHECK_NULL(input);
-      break;
-    }
-    default:
-      UNREACHABLE();
-      break;
-  }
-}
-
-void InstructionSelector::MarkPairProjectionsAsWord32(Node* node) {
-  Node* projection0 = NodeProperties::FindProjection(node, 0);
-  if (projection0) {
-    MarkAsWord32(projection0);
-  }
-  Node* projection1 = NodeProperties::FindProjection(node, 1);
-  if (projection1) {
-    MarkAsWord32(projection1);
-  }
-}
-
-void InstructionSelector::VisitNode(Node* node) {
-  DCHECK_NOT_NULL(schedule()->block(node));  // should only use scheduled nodes.
-  switch (node->opcode()) {
-    case IrOpcode::kStart:
-    case IrOpcode::kLoop:
-    case IrOpcode::kEnd:
-    case IrOpcode::kBranch:
-    case IrOpcode::kIfTrue:
-    case IrOpcode::kIfFalse:
-    case IrOpcode::kIfSuccess:
-    case IrOpcode::kSwitch:
-    case IrOpcode::kIfValue:
-    case IrOpcode::kIfDefault:
-    case IrOpcode::kEffectPhi:
-    case IrOpcode::kMerge:
-    case IrOpcode::kTerminate:
-    case IrOpcode::kBeginRegion:
-      // No code needed for these graph artifacts.
-      return;
-    case IrOpcode::kIfException:
-      return MarkAsReference(node), VisitIfException(node);
-    case IrOpcode::kFinishRegion:
-      return MarkAsReference(node), VisitFinishRegion(node);
-    case IrOpcode::kParameter: {
-      MachineType type =
-          linkage()->GetParameterType(ParameterIndexOf(node->op()));
-      MarkAsRepresentation(type.representation(), node);
-      return VisitParameter(node);
-    }
-    case IrOpcode::kOsrValue:
-      return MarkAsReference(node), VisitOsrValue(node);
-    case IrOpcode::kPhi: {
-      MachineRepresentation rep = PhiRepresentationOf(node->op());
-      if (rep == MachineRepresentation::kNone) return;
-      MarkAsRepresentation(rep, node);
-      return VisitPhi(node);
-    }
-    case IrOpcode::kProjection:
-      return VisitProjection(node);
-    case IrOpcode::kInt32Constant:
-    case IrOpcode::kInt64Constant:
-    case IrOpcode::kExternalConstant:
-    case IrOpcode::kRelocatableInt32Constant:
-    case IrOpcode::kRelocatableInt64Constant:
-      return VisitConstant(node);
-    case IrOpcode::kFloat32Constant:
-      return MarkAsFloat32(node), VisitConstant(node);
-    case IrOpcode::kFloat64Constant:
-      return MarkAsFloat64(node), VisitConstant(node);
-    case IrOpcode::kHeapConstant:
-      return MarkAsReference(node), VisitConstant(node);
-    case IrOpcode::kNumberConstant: {
-      double value = OpParameter<double>(node);
-      if (!IsSmiDouble(value)) MarkAsReference(node);
-      return VisitConstant(node);
-    }
-    case IrOpcode::kCall:
-      return VisitCall(node);
-    case IrOpcode::kCallWithCallerSavedRegisters:
-      return VisitCallWithCallerSavedRegisters(node);
-    case IrOpcode::kDeoptimizeIf:
-      return VisitDeoptimizeIf(node);
-    case IrOpcode::kDeoptimizeUnless:
-      return VisitDeoptimizeUnless(node);
-    case IrOpcode::kTrapIf:
-      return VisitTrapIf(node, static_cast<Runtime::FunctionId>(
-                                   OpParameter<int32_t>(node->op())));
-    case IrOpcode::kTrapUnless:
-      return VisitTrapUnless(node, static_cast<Runtime::FunctionId>(
-                                       OpParameter<int32_t>(node->op())));
-    case IrOpcode::kFrameState:
-    case IrOpcode::kStateValues:
-    case IrOpcode::kObjectState:
-      return;
-    case IrOpcode::kDebugAbort:
-      VisitDebugAbort(node);
-      return;
-    case IrOpcode::kDebugBreak:
-      VisitDebugBreak(node);
-      return;
-    case IrOpcode::kUnreachable:
-      VisitUnreachable(node);
-      return;
-    case IrOpcode::kDeadValue:
-      VisitDeadValue(node);
-      return;
-    case IrOpcode::kComment:
-      VisitComment(node);
-      return;
-    case IrOpcode::kRetain:
-      VisitRetain(node);
-      return;
-    case IrOpcode::kLoad: {
-      LoadRepresentation type = LoadRepresentationOf(node->op());
-      MarkAsRepresentation(type.representation(), node);
-      return VisitLoad(node);
-    }
-    case IrOpcode::kStore:
-      return VisitStore(node);
-    case IrOpcode::kProtectedStore:
-      return VisitProtectedStore(node);
-    case IrOpcode::kWord32And:
-      return MarkAsWord32(node), VisitWord32And(node);
-    case IrOpcode::kWord32Or:
-      return MarkAsWord32(node), VisitWord32Or(node);
-    case IrOpcode::kWord32Xor:
-      return MarkAsWord32(node), VisitWord32Xor(node);
-    case IrOpcode::kWord32Shl:
-      return MarkAsWord32(node), VisitWord32Shl(node);
-    case IrOpcode::kWord32Shr:
-      return MarkAsWord32(node), VisitWord32Shr(node);
-    case IrOpcode::kWord32Sar:
-      return MarkAsWord32(node), VisitWord32Sar(node);
-    case IrOpcode::kWord32Ror:
-      return MarkAsWord32(node), VisitWord32Ror(node);
-    case IrOpcode::kWord32Equal:
-      return VisitWord32Equal(node);
-    case IrOpcode::kWord32Clz:
-      return MarkAsWord32(node), VisitWord32Clz(node);
-    case IrOpcode::kWord32Ctz:
-      return MarkAsWord32(node), VisitWord32Ctz(node);
-    case IrOpcode::kWord32ReverseBits:
-      return MarkAsWord32(node), VisitWord32ReverseBits(node);
-    case IrOpcode::kWord32ReverseBytes:
-      return MarkAsWord32(node), VisitWord32ReverseBytes(node);
-    case IrOpcode::kInt32AbsWithOverflow:
-      return MarkAsWord32(node), VisitInt32AbsWithOverflow(node);
-    case IrOpcode::kWord32Popcnt:
-      return MarkAsWord32(node), VisitWord32Popcnt(node);
-    case IrOpcode::kWord64Popcnt:
-      return MarkAsWord32(node), VisitWord64Popcnt(node);
-    case IrOpcode::kWord64And:
-      return MarkAsWord64(node), VisitWord64And(node);
-    case IrOpcode::kWord64Or:
-      return MarkAsWord64(node), VisitWord64Or(node);
-    case IrOpcode::kWord64Xor:
-      return MarkAsWord64(node), VisitWord64Xor(node);
-    case IrOpcode::kWord64Shl:
-      return MarkAsWord64(node), VisitWord64Shl(node);
-    case IrOpcode::kWord64Shr:
-      return MarkAsWord64(node), VisitWord64Shr(node);
-    case IrOpcode::kWord64Sar:
-      return MarkAsWord64(node), VisitWord64Sar(node);
-    case IrOpcode::kWord64Ror:
-      return MarkAsWord64(node), VisitWord64Ror(node);
-    case IrOpcode::kWord64Clz:
-      return MarkAsWord64(node), VisitWord64Clz(node);
-    case IrOpcode::kWord64Ctz:
-      return MarkAsWord64(node), VisitWord64Ctz(node);
-    case IrOpcode::kWord64ReverseBits:
-      return MarkAsWord64(node), VisitWord64ReverseBits(node);
-    case IrOpcode::kWord64ReverseBytes:
-      return MarkAsWord64(node), VisitWord64ReverseBytes(node);
-    case IrOpcode::kInt64AbsWithOverflow:
-      return MarkAsWord64(node), VisitInt64AbsWithOverflow(node);
-    case IrOpcode::kWord64Equal:
-      return VisitWord64Equal(node);
-    case IrOpcode::kInt32Add:
-      return MarkAsWord32(node), VisitInt32Add(node);
-    case IrOpcode::kInt32AddWithOverflow:
-      return MarkAsWord32(node), VisitInt32AddWithOverflow(node);
-    case IrOpcode::kInt32Sub:
-      return MarkAsWord32(node), VisitInt32Sub(node);
-    case IrOpcode::kInt32SubWithOverflow:
-      return VisitInt32SubWithOverflow(node);
-    case IrOpcode::kInt32Mul:
-      return MarkAsWord32(node), VisitInt32Mul(node);
-    case IrOpcode::kInt32MulWithOverflow:
-      return MarkAsWord32(node), VisitInt32MulWithOverflow(node);
-    case IrOpcode::kInt32MulHigh:
-      return VisitInt32MulHigh(node);
-    case IrOpcode::kInt32Div:
-      return MarkAsWord32(node), VisitInt32Div(node);
-    case IrOpcode::kInt32Mod:
-      return MarkAsWord32(node), VisitInt32Mod(node);
-    case IrOpcode::kInt32LessThan:
-      return VisitInt32LessThan(node);
-    case IrOpcode::kInt32LessThanOrEqual:
-      return VisitInt32LessThanOrEqual(node);
-    case IrOpcode::kUint32Div:
-      return MarkAsWord32(node), VisitUint32Div(node);
-    case IrOpcode::kUint32LessThan:
-      return VisitUint32LessThan(node);
-    case IrOpcode::kUint32LessThanOrEqual:
-      return VisitUint32LessThanOrEqual(node);
-    case IrOpcode::kUint32Mod:
-      return MarkAsWord32(node), VisitUint32Mod(node);
-    case IrOpcode::kUint32MulHigh:
-      return VisitUint32MulHigh(node);
-    case IrOpcode::kInt64Add:
-      return MarkAsWord64(node), VisitInt64Add(node);
-    case IrOpcode::kInt64AddWithOverflow:
-      return MarkAsWord64(node), VisitInt64AddWithOverflow(node);
-    case IrOpcode::kInt64Sub:
-      return MarkAsWord64(node), VisitInt64Sub(node);
-    case IrOpcode::kInt64SubWithOverflow:
-      return MarkAsWord64(node), VisitInt64SubWithOverflow(node);
-    case IrOpcode::kInt64Mul:
-      return MarkAsWord64(node), VisitInt64Mul(node);
-    case IrOpcode::kInt64Div:
-      return MarkAsWord64(node), VisitInt64Div(node);
-    case IrOpcode::kInt64Mod:
-      return MarkAsWord64(node), VisitInt64Mod(node);
-    case IrOpcode::kInt64LessThan:
-      return VisitInt64LessThan(node);
-    case IrOpcode::kInt64LessThanOrEqual:
-      return VisitInt64LessThanOrEqual(node);
-    case IrOpcode::kUint64Div:
-      return MarkAsWord64(node), VisitUint64Div(node);
-    case IrOpcode::kUint64LessThan:
-      return VisitUint64LessThan(node);
-    case IrOpcode::kUint64LessThanOrEqual:
-      return VisitUint64LessThanOrEqual(node);
-    case IrOpcode::kUint64Mod:
-      return MarkAsWord64(node), VisitUint64Mod(node);
-    case IrOpcode::kBitcastTaggedToWord:
-      return MarkAsRepresentation(MachineType::PointerRepresentation(), node),
-             VisitBitcastTaggedToWord(node);
-    case IrOpcode::kBitcastWordToTagged:
-      return MarkAsReference(node), VisitBitcastWordToTagged(node);
-    case IrOpcode::kBitcastWordToTaggedSigned:
-      return MarkAsRepresentation(MachineRepresentation::kTaggedSigned, node),
-             EmitIdentity(node);
-    case IrOpcode::kChangeFloat32ToFloat64:
-      return MarkAsFloat64(node), VisitChangeFloat32ToFloat64(node);
-    case IrOpcode::kChangeInt32ToFloat64:
-      return MarkAsFloat64(node), VisitChangeInt32ToFloat64(node);
-    case IrOpcode::kChangeUint32ToFloat64:
-      return MarkAsFloat64(node), VisitChangeUint32ToFloat64(node);
-    case IrOpcode::kChangeFloat64ToInt32:
-      return MarkAsWord32(node), VisitChangeFloat64ToInt32(node);
-    case IrOpcode::kChangeFloat64ToUint32:
-      return MarkAsWord32(node), VisitChangeFloat64ToUint32(node);
-    case IrOpcode::kChangeFloat64ToUint64:
-      return MarkAsWord64(node), VisitChangeFloat64ToUint64(node);
-    case IrOpcode::kFloat64SilenceNaN:
-      MarkAsFloat64(node);
-      if (CanProduceSignalingNaN(node->InputAt(0))) {
-        return VisitFloat64SilenceNaN(node);
-      } else {
-        return EmitIdentity(node);
-      }
-    case IrOpcode::kTruncateFloat64ToUint32:
-      return MarkAsWord32(node), VisitTruncateFloat64ToUint32(node);
-    case IrOpcode::kTruncateFloat32ToInt32:
-      return MarkAsWord32(node), VisitTruncateFloat32ToInt32(node);
-    case IrOpcode::kTruncateFloat32ToUint32:
-      return MarkAsWord32(node), VisitTruncateFloat32ToUint32(node);
-    case IrOpcode::kTryTruncateFloat32ToInt64:
-      return MarkAsWord64(node), VisitTryTruncateFloat32ToInt64(node);
-    case IrOpcode::kTryTruncateFloat64ToInt64:
-      return MarkAsWord64(node), VisitTryTruncateFloat64ToInt64(node);
-    case IrOpcode::kTryTruncateFloat32ToUint64:
-      return MarkAsWord64(node), VisitTryTruncateFloat32ToUint64(node);
-    case IrOpcode::kTryTruncateFloat64ToUint64:
-      return MarkAsWord64(node), VisitTryTruncateFloat64ToUint64(node);
-    case IrOpcode::kChangeInt32ToInt64:
-      return MarkAsWord64(node), VisitChangeInt32ToInt64(node);
-    case IrOpcode::kChangeUint32ToUint64:
-      return MarkAsWord64(node), VisitChangeUint32ToUint64(node);
-    case IrOpcode::kTruncateFloat64ToFloat32:
-      return MarkAsFloat32(node), VisitTruncateFloat64ToFloat32(node);
-    case IrOpcode::kTruncateFloat64ToWord32:
-      return MarkAsWord32(node), VisitTruncateFloat64ToWord32(node);
-    case IrOpcode::kTruncateInt64ToInt32:
-      return MarkAsWord32(node), VisitTruncateInt64ToInt32(node);
-    case IrOpcode::kRoundFloat64ToInt32:
-      return MarkAsWord32(node), VisitRoundFloat64ToInt32(node);
-    case IrOpcode::kRoundInt64ToFloat32:
-      return MarkAsFloat32(node), VisitRoundInt64ToFloat32(node);
-    case IrOpcode::kRoundInt32ToFloat32:
-      return MarkAsFloat32(node), VisitRoundInt32ToFloat32(node);
-    case IrOpcode::kRoundInt64ToFloat64:
-      return MarkAsFloat64(node), VisitRoundInt64ToFloat64(node);
-    case IrOpcode::kBitcastFloat32ToInt32:
-      return MarkAsWord32(node), VisitBitcastFloat32ToInt32(node);
-    case IrOpcode::kRoundUint32ToFloat32:
-      return MarkAsFloat32(node), VisitRoundUint32ToFloat32(node);
-    case IrOpcode::kRoundUint64ToFloat32:
-      return MarkAsFloat64(node), VisitRoundUint64ToFloat32(node);
-    case IrOpcode::kRoundUint64ToFloat64:
-      return MarkAsFloat64(node), VisitRoundUint64ToFloat64(node);
-    case IrOpcode::kBitcastFloat64ToInt64:
-      return MarkAsWord64(node), VisitBitcastFloat64ToInt64(node);
-    case IrOpcode::kBitcastInt32ToFloat32:
-      return MarkAsFloat32(node), VisitBitcastInt32ToFloat32(node);
-    case IrOpcode::kBitcastInt64ToFloat64:
-      return MarkAsFloat64(node), VisitBitcastInt64ToFloat64(node);
-    case IrOpcode::kFloat32Add:
-      return MarkAsFloat32(node), VisitFloat32Add(node);
-    case IrOpcode::kFloat32Sub:
-      return MarkAsFloat32(node), VisitFloat32Sub(node);
-    case IrOpcode::kFloat32Neg:
-      return MarkAsFloat32(node), VisitFloat32Neg(node);
-    case IrOpcode::kFloat32Mul:
-      return MarkAsFloat32(node), VisitFloat32Mul(node);
-    case IrOpcode::kFloat32Div:
-      return MarkAsFloat32(node), VisitFloat32Div(node);
-    case IrOpcode::kFloat32Abs:
-      return MarkAsFloat32(node), VisitFloat32Abs(node);
-    case IrOpcode::kFloat32Sqrt:
-      return MarkAsFloat32(node), VisitFloat32Sqrt(node);
-    case IrOpcode::kFloat32Equal:
-      return VisitFloat32Equal(node);
-    case IrOpcode::kFloat32LessThan:
-      return VisitFloat32LessThan(node);
-    case IrOpcode::kFloat32LessThanOrEqual:
-      return VisitFloat32LessThanOrEqual(node);
-    case IrOpcode::kFloat32Max:
-      return MarkAsFloat32(node), VisitFloat32Max(node);
-    case IrOpcode::kFloat32Min:
-      return MarkAsFloat32(node), VisitFloat32Min(node);
-    case IrOpcode::kFloat64Add:
-      return MarkAsFloat64(node), VisitFloat64Add(node);
-    case IrOpcode::kFloat64Sub:
-      return MarkAsFloat64(node), VisitFloat64Sub(node);
-    case IrOpcode::kFloat64Neg:
-      return MarkAsFloat64(node), VisitFloat64Neg(node);
-    case IrOpcode::kFloat64Mul:
-      return MarkAsFloat64(node), VisitFloat64Mul(node);
-    case IrOpcode::kFloat64Div:
-      return MarkAsFloat64(node), VisitFloat64Div(node);
-    case IrOpcode::kFloat64Mod:
-      return MarkAsFloat64(node), VisitFloat64Mod(node);
-    case IrOpcode::kFloat64Min:
-      return MarkAsFloat64(node), VisitFloat64Min(node);
-    case IrOpcode::kFloat64Max:
-      return MarkAsFloat64(node), VisitFloat64Max(node);
-    case IrOpcode::kFloat64Abs:
-      return MarkAsFloat64(node), VisitFloat64Abs(node);
-    case IrOpcode::kFloat64Acos:
-      return MarkAsFloat64(node), VisitFloat64Acos(node);
-    case IrOpcode::kFloat64Acosh:
-      return MarkAsFloat64(node), VisitFloat64Acosh(node);
-    case IrOpcode::kFloat64Asin:
-      return MarkAsFloat64(node), VisitFloat64Asin(node);
-    case IrOpcode::kFloat64Asinh:
-      return MarkAsFloat64(node), VisitFloat64Asinh(node);
-    case IrOpcode::kFloat64Atan:
-      return MarkAsFloat64(node), VisitFloat64Atan(node);
-    case IrOpcode::kFloat64Atanh:
-      return MarkAsFloat64(node), VisitFloat64Atanh(node);
-    case IrOpcode::kFloat64Atan2:
-      return MarkAsFloat64(node), VisitFloat64Atan2(node);
-    case IrOpcode::kFloat64Cbrt:
-      return MarkAsFloat64(node), VisitFloat64Cbrt(node);
-    case IrOpcode::kFloat64Cos:
-      return MarkAsFloat64(node), VisitFloat64Cos(node);
-    case IrOpcode::kFloat64Cosh:
-      return MarkAsFloat64(node), VisitFloat64Cosh(node);
-    case IrOpcode::kFloat64Exp:
-      return MarkAsFloat64(node), VisitFloat64Exp(node);
-    case IrOpcode::kFloat64Expm1:
-      return MarkAsFloat64(node), VisitFloat64Expm1(node);
-    case IrOpcode::kFloat64Log:
-      return MarkAsFloat64(node), VisitFloat64Log(node);
-    case IrOpcode::kFloat64Log1p:
-      return MarkAsFloat64(node), VisitFloat64Log1p(node);
-    case IrOpcode::kFloat64Log10:
-      return MarkAsFloat64(node), VisitFloat64Log10(node);
-    case IrOpcode::kFloat64Log2:
-      return MarkAsFloat64(node), VisitFloat64Log2(node);
-    case IrOpcode::kFloat64Pow:
-      return MarkAsFloat64(node), VisitFloat64Pow(node);
-    case IrOpcode::kFloat64Sin:
-      return MarkAsFloat64(node), VisitFloat64Sin(node);
-    case IrOpcode::kFloat64Sinh:
-      return MarkAsFloat64(node), VisitFloat64Sinh(node);
-    case IrOpcode::kFloat64Sqrt:
-      return MarkAsFloat64(node), VisitFloat64Sqrt(node);
-    case IrOpcode::kFloat64Tan:
-      return MarkAsFloat64(node), VisitFloat64Tan(node);
-    case IrOpcode::kFloat64Tanh:
-      return MarkAsFloat64(node), VisitFloat64Tanh(node);
-    case IrOpcode::kFloat64Equal:
-      return VisitFloat64Equal(node);
-    case IrOpcode::kFloat64LessThan:
-      return VisitFloat64LessThan(node);
-    case IrOpcode::kFloat64LessThanOrEqual:
-      return VisitFloat64LessThanOrEqual(node);
-    case IrOpcode::kFloat32RoundDown:
-      return MarkAsFloat32(node), VisitFloat32RoundDown(node);
-    case IrOpcode::kFloat64RoundDown:
-      return MarkAsFloat64(node), VisitFloat64RoundDown(node);
-    case IrOpcode::kFloat32RoundUp:
-      return MarkAsFloat32(node), VisitFloat32RoundUp(node);
-    case IrOpcode::kFloat64RoundUp:
-      return MarkAsFloat64(node), VisitFloat64RoundUp(node);
-    case IrOpcode::kFloat32RoundTruncate:
-      return MarkAsFloat32(node), VisitFloat32RoundTruncate(node);
-    case IrOpcode::kFloat64RoundTruncate:
-      return MarkAsFloat64(node), VisitFloat64RoundTruncate(node);
-    case IrOpcode::kFloat64RoundTiesAway:
-      return MarkAsFloat64(node), VisitFloat64RoundTiesAway(node);
-    case IrOpcode::kFloat32RoundTiesEven:
-      return MarkAsFloat32(node), VisitFloat32RoundTiesEven(node);
-    case IrOpcode::kFloat64RoundTiesEven:
-      return MarkAsFloat64(node), VisitFloat64RoundTiesEven(node);
-    case IrOpcode::kFloat64ExtractLowWord32:
-      return MarkAsWord32(node), VisitFloat64ExtractLowWord32(node);
-    case IrOpcode::kFloat64ExtractHighWord32:
-      return MarkAsWord32(node), VisitFloat64ExtractHighWord32(node);
-    case IrOpcode::kFloat64InsertLowWord32:
-      return MarkAsFloat64(node), VisitFloat64InsertLowWord32(node);
-    case IrOpcode::kFloat64InsertHighWord32:
-      return MarkAsFloat64(node), VisitFloat64InsertHighWord32(node);
-    case IrOpcode::kStackSlot:
-      return VisitStackSlot(node);
-    case IrOpcode::kLoadStackPointer:
-      return VisitLoadStackPointer(node);
-    case IrOpcode::kLoadFramePointer:
-      return VisitLoadFramePointer(node);
-    case IrOpcode::kLoadParentFramePointer:
-      return VisitLoadParentFramePointer(node);
-    case IrOpcode::kUnalignedLoad: {
-      UnalignedLoadRepresentation type =
-          UnalignedLoadRepresentationOf(node->op());
-      MarkAsRepresentation(type.representation(), node);
-      return VisitUnalignedLoad(node);
-    }
-    case IrOpcode::kUnalignedStore:
-      return VisitUnalignedStore(node);
-    case IrOpcode::kInt32PairAdd:
-      MarkAsWord32(node);
-      MarkPairProjectionsAsWord32(node);
-      return VisitInt32PairAdd(node);
-    case IrOpcode::kInt32PairSub:
-      MarkAsWord32(node);
-      MarkPairProjectionsAsWord32(node);
-      return VisitInt32PairSub(node);
-    case IrOpcode::kInt32PairMul:
-      MarkAsWord32(node);
-      MarkPairProjectionsAsWord32(node);
-      return VisitInt32PairMul(node);
-    case IrOpcode::kWord32PairShl:
-      MarkAsWord32(node);
-      MarkPairProjectionsAsWord32(node);
-      return VisitWord32PairShl(node);
-    case IrOpcode::kWord32PairShr:
-      MarkAsWord32(node);
-      MarkPairProjectionsAsWord32(node);
-      return VisitWord32PairShr(node);
-    case IrOpcode::kWord32PairSar:
-      MarkAsWord32(node);
-      MarkPairProjectionsAsWord32(node);
-      return VisitWord32PairSar(node);
-    case IrOpcode::kAtomicLoad: {
-      LoadRepresentation type = LoadRepresentationOf(node->op());
-      MarkAsRepresentation(type.representation(), node);
-      return VisitAtomicLoad(node);
-    }
-    case IrOpcode::kAtomicStore:
-      return VisitAtomicStore(node);
-#define ATOMIC_CASE(name)                                    \
-  case IrOpcode::kAtomic##name: {                            \
-    MachineType type = AtomicOpRepresentationOf(node->op()); \
-    MarkAsRepresentation(type.representation(), node);       \
-    return VisitAtomic##name(node);                          \
-  }
-      ATOMIC_CASE(Exchange)
-      ATOMIC_CASE(CompareExchange)
-      ATOMIC_CASE(Add)
-      ATOMIC_CASE(Sub)
-      ATOMIC_CASE(And)
-      ATOMIC_CASE(Or)
-      ATOMIC_CASE(Xor)
-#undef ATOMIC_CASE
-    case IrOpcode::kSpeculationFence:
-      return VisitSpeculationFence(node);
-    case IrOpcode::kProtectedLoad: {
-      LoadRepresentation type = LoadRepresentationOf(node->op());
-      MarkAsRepresentation(type.representation(), node);
-      return VisitProtectedLoad(node);
-    }
-    case IrOpcode::kUnsafePointerAdd:
-      MarkAsRepresentation(MachineType::PointerRepresentation(), node);
-      return VisitUnsafePointerAdd(node);
-    case IrOpcode::kF32x4Splat:
-      return MarkAsSimd128(node), VisitF32x4Splat(node);
-    case IrOpcode::kF32x4ExtractLane:
-      return MarkAsFloat32(node), VisitF32x4ExtractLane(node);
-    case IrOpcode::kF32x4ReplaceLane:
-      return MarkAsSimd128(node), VisitF32x4ReplaceLane(node);
-    case IrOpcode::kF32x4SConvertI32x4:
-      return MarkAsSimd128(node), VisitF32x4SConvertI32x4(node);
-    case IrOpcode::kF32x4UConvertI32x4:
-      return MarkAsSimd128(node), VisitF32x4UConvertI32x4(node);
-    case IrOpcode::kF32x4Abs:
-      return MarkAsSimd128(node), VisitF32x4Abs(node);
-    case IrOpcode::kF32x4Neg:
-      return MarkAsSimd128(node), VisitF32x4Neg(node);
-    case IrOpcode::kF32x4RecipApprox:
-      return MarkAsSimd128(node), VisitF32x4RecipApprox(node);
-    case IrOpcode::kF32x4RecipSqrtApprox:
-      return MarkAsSimd128(node), VisitF32x4RecipSqrtApprox(node);
-    case IrOpcode::kF32x4Add:
-      return MarkAsSimd128(node), VisitF32x4Add(node);
-    case IrOpcode::kF32x4AddHoriz:
-      return MarkAsSimd128(node), VisitF32x4AddHoriz(node);
-    case IrOpcode::kF32x4Sub:
-      return MarkAsSimd128(node), VisitF32x4Sub(node);
-    case IrOpcode::kF32x4Mul:
-      return MarkAsSimd128(node), VisitF32x4Mul(node);
-    case IrOpcode::kF32x4Min:
-      return MarkAsSimd128(node), VisitF32x4Min(node);
-    case IrOpcode::kF32x4Max:
-      return MarkAsSimd128(node), VisitF32x4Max(node);
-    case IrOpcode::kF32x4Eq:
-      return MarkAsSimd128(node), VisitF32x4Eq(node);
-    case IrOpcode::kF32x4Ne:
-      return MarkAsSimd128(node), VisitF32x4Ne(node);
-    case IrOpcode::kF32x4Lt:
-      return MarkAsSimd128(node), VisitF32x4Lt(node);
-    case IrOpcode::kF32x4Le:
-      return MarkAsSimd128(node), VisitF32x4Le(node);
-    case IrOpcode::kI32x4Splat:
-      return MarkAsSimd128(node), VisitI32x4Splat(node);
-    case IrOpcode::kI32x4ExtractLane:
-      return MarkAsWord32(node), VisitI32x4ExtractLane(node);
-    case IrOpcode::kI32x4ReplaceLane:
-      return MarkAsSimd128(node), VisitI32x4ReplaceLane(node);
-    case IrOpcode::kI32x4SConvertF32x4:
-      return MarkAsSimd128(node), VisitI32x4SConvertF32x4(node);
-    case IrOpcode::kI32x4SConvertI16x8Low:
-      return MarkAsSimd128(node), VisitI32x4SConvertI16x8Low(node);
-    case IrOpcode::kI32x4SConvertI16x8High:
-      return MarkAsSimd128(node), VisitI32x4SConvertI16x8High(node);
-    case IrOpcode::kI32x4Neg:
-      return MarkAsSimd128(node), VisitI32x4Neg(node);
-    case IrOpcode::kI32x4Shl:
-      return MarkAsSimd128(node), VisitI32x4Shl(node);
-    case IrOpcode::kI32x4ShrS:
-      return MarkAsSimd128(node), VisitI32x4ShrS(node);
-    case IrOpcode::kI32x4Add:
-      return MarkAsSimd128(node), VisitI32x4Add(node);
-    case IrOpcode::kI32x4AddHoriz:
-      return MarkAsSimd128(node), VisitI32x4AddHoriz(node);
-    case IrOpcode::kI32x4Sub:
-      return MarkAsSimd128(node), VisitI32x4Sub(node);
-    case IrOpcode::kI32x4Mul:
-      return MarkAsSimd128(node), VisitI32x4Mul(node);
-    case IrOpcode::kI32x4MinS:
-      return MarkAsSimd128(node), VisitI32x4MinS(node);
-    case IrOpcode::kI32x4MaxS:
-      return MarkAsSimd128(node), VisitI32x4MaxS(node);
-    case IrOpcode::kI32x4Eq:
-      return MarkAsSimd128(node), VisitI32x4Eq(node);
-    case IrOpcode::kI32x4Ne:
-      return MarkAsSimd128(node), VisitI32x4Ne(node);
-    case IrOpcode::kI32x4GtS:
-      return MarkAsSimd128(node), VisitI32x4GtS(node);
-    case IrOpcode::kI32x4GeS:
-      return MarkAsSimd128(node), VisitI32x4GeS(node);
-    case IrOpcode::kI32x4UConvertF32x4:
-      return MarkAsSimd128(node), VisitI32x4UConvertF32x4(node);
-    case IrOpcode::kI32x4UConvertI16x8Low:
-      return MarkAsSimd128(node), VisitI32x4UConvertI16x8Low(node);
-    case IrOpcode::kI32x4UConvertI16x8High:
-      return MarkAsSimd128(node), VisitI32x4UConvertI16x8High(node);
-    case IrOpcode::kI32x4ShrU:
-      return MarkAsSimd128(node), VisitI32x4ShrU(node);
-    case IrOpcode::kI32x4MinU:
-      return MarkAsSimd128(node), VisitI32x4MinU(node);
-    case IrOpcode::kI32x4MaxU:
-      return MarkAsSimd128(node), VisitI32x4MaxU(node);
-    case IrOpcode::kI32x4GtU:
-      return MarkAsSimd128(node), VisitI32x4GtU(node);
-    case IrOpcode::kI32x4GeU:
-      return MarkAsSimd128(node), VisitI32x4GeU(node);
-    case IrOpcode::kI16x8Splat:
-      return MarkAsSimd128(node), VisitI16x8Splat(node);
-    case IrOpcode::kI16x8ExtractLane:
-      return MarkAsWord32(node), VisitI16x8ExtractLane(node);
-    case IrOpcode::kI16x8ReplaceLane:
-      return MarkAsSimd128(node), VisitI16x8ReplaceLane(node);
-    case IrOpcode::kI16x8SConvertI8x16Low:
-      return MarkAsSimd128(node), VisitI16x8SConvertI8x16Low(node);
-    case IrOpcode::kI16x8SConvertI8x16High:
-      return MarkAsSimd128(node), VisitI16x8SConvertI8x16High(node);
-    case IrOpcode::kI16x8Neg:
-      return MarkAsSimd128(node), VisitI16x8Neg(node);
-    case IrOpcode::kI16x8Shl:
-      return MarkAsSimd128(node), VisitI16x8Shl(node);
-    case IrOpcode::kI16x8ShrS:
-      return MarkAsSimd128(node), VisitI16x8ShrS(node);
-    case IrOpcode::kI16x8SConvertI32x4:
-      return MarkAsSimd128(node), VisitI16x8SConvertI32x4(node);
-    case IrOpcode::kI16x8Add:
-      return MarkAsSimd128(node), VisitI16x8Add(node);
-    case IrOpcode::kI16x8AddSaturateS:
-      return MarkAsSimd128(node), VisitI16x8AddSaturateS(node);
-    case IrOpcode::kI16x8AddHoriz:
-      return MarkAsSimd128(node), VisitI16x8AddHoriz(node);
-    case IrOpcode::kI16x8Sub:
-      return MarkAsSimd128(node), VisitI16x8Sub(node);
-    case IrOpcode::kI16x8SubSaturateS:
-      return MarkAsSimd128(node), VisitI16x8SubSaturateS(node);
-    case IrOpcode::kI16x8Mul:
-      return MarkAsSimd128(node), VisitI16x8Mul(node);
-    case IrOpcode::kI16x8MinS:
-      return MarkAsSimd128(node), VisitI16x8MinS(node);
-    case IrOpcode::kI16x8MaxS:
-      return MarkAsSimd128(node), VisitI16x8MaxS(node);
-    case IrOpcode::kI16x8Eq:
-      return MarkAsSimd128(node), VisitI16x8Eq(node);
-    case IrOpcode::kI16x8Ne:
-      return MarkAsSimd128(node), VisitI16x8Ne(node);
-    case IrOpcode::kI16x8GtS:
-      return MarkAsSimd128(node), VisitI16x8GtS(node);
-    case IrOpcode::kI16x8GeS:
-      return MarkAsSimd128(node), VisitI16x8GeS(node);
-    case IrOpcode::kI16x8UConvertI8x16Low:
-      return MarkAsSimd128(node), VisitI16x8UConvertI8x16Low(node);
-    case IrOpcode::kI16x8UConvertI8x16High:
-      return MarkAsSimd128(node), VisitI16x8UConvertI8x16High(node);
-    case IrOpcode::kI16x8ShrU:
-      return MarkAsSimd128(node), VisitI16x8ShrU(node);
-    case IrOpcode::kI16x8UConvertI32x4:
-      return MarkAsSimd128(node), VisitI16x8UConvertI32x4(node);
-    case IrOpcode::kI16x8AddSaturateU:
-      return MarkAsSimd128(node), VisitI16x8AddSaturateU(node);
-    case IrOpcode::kI16x8SubSaturateU:
-      return MarkAsSimd128(node), VisitI16x8SubSaturateU(node);
-    case IrOpcode::kI16x8MinU:
-      return MarkAsSimd128(node), VisitI16x8MinU(node);
-    case IrOpcode::kI16x8MaxU:
-      return MarkAsSimd128(node), VisitI16x8MaxU(node);
-    case IrOpcode::kI16x8GtU:
-      return MarkAsSimd128(node), VisitI16x8GtU(node);
-    case IrOpcode::kI16x8GeU:
-      return MarkAsSimd128(node), VisitI16x8GeU(node);
-    case IrOpcode::kI8x16Splat:
-      return MarkAsSimd128(node), VisitI8x16Splat(node);
-    case IrOpcode::kI8x16ExtractLane:
-      return MarkAsWord32(node), VisitI8x16ExtractLane(node);
-    case IrOpcode::kI8x16ReplaceLane:
-      return MarkAsSimd128(node), VisitI8x16ReplaceLane(node);
-    case IrOpcode::kI8x16Neg:
-      return MarkAsSimd128(node), VisitI8x16Neg(node);
-    case IrOpcode::kI8x16Shl:
-      return MarkAsSimd128(node), VisitI8x16Shl(node);
-    case IrOpcode::kI8x16ShrS:
-      return MarkAsSimd128(node), VisitI8x16ShrS(node);
-    case IrOpcode::kI8x16SConvertI16x8:
-      return MarkAsSimd128(node), VisitI8x16SConvertI16x8(node);
-    case IrOpcode::kI8x16Add:
-      return MarkAsSimd128(node), VisitI8x16Add(node);
-    case IrOpcode::kI8x16AddSaturateS:
-      return MarkAsSimd128(node), VisitI8x16AddSaturateS(node);
-    case IrOpcode::kI8x16Sub:
-      return MarkAsSimd128(node), VisitI8x16Sub(node);
-    case IrOpcode::kI8x16SubSaturateS:
-      return MarkAsSimd128(node), VisitI8x16SubSaturateS(node);
-    case IrOpcode::kI8x16Mul:
-      return MarkAsSimd128(node), VisitI8x16Mul(node);
-    case IrOpcode::kI8x16MinS:
-      return MarkAsSimd128(node), VisitI8x16MinS(node);
-    case IrOpcode::kI8x16MaxS:
-      return MarkAsSimd128(node), VisitI8x16MaxS(node);
-    case IrOpcode::kI8x16Eq:
-      return MarkAsSimd128(node), VisitI8x16Eq(node);
-    case IrOpcode::kI8x16Ne:
-      return MarkAsSimd128(node), VisitI8x16Ne(node);
-    case IrOpcode::kI8x16GtS:
-      return MarkAsSimd128(node), VisitI8x16GtS(node);
-    case IrOpcode::kI8x16GeS:
-      return MarkAsSimd128(node), VisitI8x16GeS(node);
-    case IrOpcode::kI8x16ShrU:
-      return MarkAsSimd128(node), VisitI8x16ShrU(node);
-    case IrOpcode::kI8x16UConvertI16x8:
-      return MarkAsSimd128(node), VisitI8x16UConvertI16x8(node);
-    case IrOpcode::kI8x16AddSaturateU:
-      return MarkAsSimd128(node), VisitI8x16AddSaturateU(node);
-    case IrOpcode::kI8x16SubSaturateU:
-      return MarkAsSimd128(node), VisitI8x16SubSaturateU(node);
-    case IrOpcode::kI8x16MinU:
-      return MarkAsSimd128(node), VisitI8x16MinU(node);
-    case IrOpcode::kI8x16MaxU:
-      return MarkAsSimd128(node), VisitI8x16MaxU(node);
-    case IrOpcode::kI8x16GtU:
-      return MarkAsSimd128(node), VisitI8x16GtU(node);
-    case IrOpcode::kI8x16GeU:
-      return MarkAsSimd128(node), VisitI16x8GeU(node);
-    case IrOpcode::kS128Zero:
-      return MarkAsSimd128(node), VisitS128Zero(node);
-    case IrOpcode::kS128And:
-      return MarkAsSimd128(node), VisitS128And(node);
-    case IrOpcode::kS128Or:
-      return MarkAsSimd128(node), VisitS128Or(node);
-    case IrOpcode::kS128Xor:
-      return MarkAsSimd128(node), VisitS128Xor(node);
-    case IrOpcode::kS128Not:
-      return MarkAsSimd128(node), VisitS128Not(node);
-    case IrOpcode::kS128Select:
-      return MarkAsSimd128(node), VisitS128Select(node);
-    case IrOpcode::kS8x16Shuffle:
-      return MarkAsSimd128(node), VisitS8x16Shuffle(node);
-    case IrOpcode::kS1x4AnyTrue:
-      return MarkAsWord32(node), VisitS1x4AnyTrue(node);
-    case IrOpcode::kS1x4AllTrue:
-      return MarkAsWord32(node), VisitS1x4AllTrue(node);
-    case IrOpcode::kS1x8AnyTrue:
-      return MarkAsWord32(node), VisitS1x8AnyTrue(node);
-    case IrOpcode::kS1x8AllTrue:
-      return MarkAsWord32(node), VisitS1x8AllTrue(node);
-    case IrOpcode::kS1x16AnyTrue:
-      return MarkAsWord32(node), VisitS1x16AnyTrue(node);
-    case IrOpcode::kS1x16AllTrue:
-      return MarkAsWord32(node), VisitS1x16AllTrue(node);
-    default:
-      V8_Fatal(__FILE__, __LINE__, "Unexpected operator #%d:%s @ node #%d",
-               node->opcode(), node->op()->mnemonic(), node->id());
-      break;
-  }
-}
-
-void InstructionSelector::VisitLoadStackPointer(Node* node) {
-  OperandGenerator g(this);
-  Emit(kArchStackPointer, g.DefineAsRegister(node));
-}
-
-void InstructionSelector::VisitLoadFramePointer(Node* node) {
-  OperandGenerator g(this);
-  Emit(kArchFramePointer, g.DefineAsRegister(node));
-}
-
-void InstructionSelector::VisitLoadParentFramePointer(Node* node) {
-  OperandGenerator g(this);
-  Emit(kArchParentFramePointer, g.DefineAsRegister(node));
-}
-
-void InstructionSelector::VisitFloat64Acos(Node* node) {
-  VisitFloat64Ieee754Unop(node, kIeee754Float64Acos);
-}
-
-void InstructionSelector::VisitFloat64Acosh(Node* node) {
-  VisitFloat64Ieee754Unop(node, kIeee754Float64Acosh);
-}
-
-void InstructionSelector::VisitFloat64Asin(Node* node) {
-  VisitFloat64Ieee754Unop(node, kIeee754Float64Asin);
-}
-
-void InstructionSelector::VisitFloat64Asinh(Node* node) {
-  VisitFloat64Ieee754Unop(node, kIeee754Float64Asinh);
-}
-
-void InstructionSelector::VisitFloat64Atan(Node* node) {
-  VisitFloat64Ieee754Unop(node, kIeee754Float64Atan);
-}
-
-void InstructionSelector::VisitFloat64Atanh(Node* node) {
-  VisitFloat64Ieee754Unop(node, kIeee754Float64Atanh);
-}
-
-void InstructionSelector::VisitFloat64Atan2(Node* node) {
-  VisitFloat64Ieee754Binop(node, kIeee754Float64Atan2);
-}
-
-void InstructionSelector::VisitFloat64Cbrt(Node* node) {
-  VisitFloat64Ieee754Unop(node, kIeee754Float64Cbrt);
-}
-
-void InstructionSelector::VisitFloat64Cos(Node* node) {
-  VisitFloat64Ieee754Unop(node, kIeee754Float64Cos);
-}
-
-void InstructionSelector::VisitFloat64Cosh(Node* node) {
-  VisitFloat64Ieee754Unop(node, kIeee754Float64Cosh);
-}
-
-void InstructionSelector::VisitFloat64Exp(Node* node) {
-  VisitFloat64Ieee754Unop(node, kIeee754Float64Exp);
-}
-
-void InstructionSelector::VisitFloat64Expm1(Node* node) {
-  VisitFloat64Ieee754Unop(node, kIeee754Float64Expm1);
-}
-
-void InstructionSelector::VisitFloat64Log(Node* node) {
-  VisitFloat64Ieee754Unop(node, kIeee754Float64Log);
-}
-
-void InstructionSelector::VisitFloat64Log1p(Node* node) {
-  VisitFloat64Ieee754Unop(node, kIeee754Float64Log1p);
-}
-
-void InstructionSelector::VisitFloat64Log2(Node* node) {
-  VisitFloat64Ieee754Unop(node, kIeee754Float64Log2);
-}
-
-void InstructionSelector::VisitFloat64Log10(Node* node) {
-  VisitFloat64Ieee754Unop(node, kIeee754Float64Log10);
-}
-
-void InstructionSelector::VisitFloat64Pow(Node* node) {
-  VisitFloat64Ieee754Binop(node, kIeee754Float64Pow);
-}
-
-void InstructionSelector::VisitFloat64Sin(Node* node) {
-  VisitFloat64Ieee754Unop(node, kIeee754Float64Sin);
-}
-
-void InstructionSelector::VisitFloat64Sinh(Node* node) {
-  VisitFloat64Ieee754Unop(node, kIeee754Float64Sinh);
-}
-
-void InstructionSelector::VisitFloat64Tan(Node* node) {
-  VisitFloat64Ieee754Unop(node, kIeee754Float64Tan);
-}
-
-void InstructionSelector::VisitFloat64Tanh(Node* node) {
-  VisitFloat64Ieee754Unop(node, kIeee754Float64Tanh);
-}
-
-void InstructionSelector::EmitTableSwitch(const SwitchInfo& sw,
-                                          InstructionOperand& index_operand) {
-  OperandGenerator g(this);
-  size_t input_count = 2 + sw.value_range;
-  DCHECK_LE(sw.value_range, std::numeric_limits<size_t>::max() - 2);
-  auto* inputs = zone()->NewArray<InstructionOperand>(input_count);
-  inputs[0] = index_operand;
-  InstructionOperand default_operand = g.Label(sw.default_branch);
-  std::fill(&inputs[1], &inputs[input_count], default_operand);
-  for (size_t index = 0; index < sw.case_count; ++index) {
-    size_t value = sw.case_values[index] - sw.min_value;
-    BasicBlock* branch = sw.case_branches[index];
-    DCHECK_LE(0u, value);
-    DCHECK_LT(value + 2, input_count);
-    inputs[value + 2] = g.Label(branch);
-  }
-  Emit(kArchTableSwitch, 0, nullptr, input_count, inputs, 0, nullptr);
-}
-
-
-void InstructionSelector::EmitLookupSwitch(const SwitchInfo& sw,
-                                           InstructionOperand& value_operand) {
-  OperandGenerator g(this);
-  size_t input_count = 2 + sw.case_count * 2;
-  DCHECK_LE(sw.case_count, (std::numeric_limits<size_t>::max() - 2) / 2);
-  auto* inputs = zone()->NewArray<InstructionOperand>(input_count);
-  inputs[0] = value_operand;
-  inputs[1] = g.Label(sw.default_branch);
-  for (size_t index = 0; index < sw.case_count; ++index) {
-    int32_t value = sw.case_values[index];
-    BasicBlock* branch = sw.case_branches[index];
-    inputs[index * 2 + 2 + 0] = g.TempImmediate(value);
-    inputs[index * 2 + 2 + 1] = g.Label(branch);
-  }
-  Emit(kArchLookupSwitch, 0, nullptr, input_count, inputs, 0, nullptr);
-}
-
-
-void InstructionSelector::VisitBitcastTaggedToWord(Node* node) {
-  EmitIdentity(node);
-}
-
-void InstructionSelector::VisitBitcastWordToTagged(Node* node) {
-  OperandGenerator g(this);
-  Emit(kArchNop, g.DefineSameAsFirst(node), g.Use(node->InputAt(0)));
-}
-
-// 32 bit targets do not implement the following instructions.
-#if V8_TARGET_ARCH_32_BIT
-
-void InstructionSelector::VisitWord64And(Node* node) { UNIMPLEMENTED(); }
-
-
-void InstructionSelector::VisitWord64Or(Node* node) { UNIMPLEMENTED(); }
-
-
-void InstructionSelector::VisitWord64Xor(Node* node) { UNIMPLEMENTED(); }
-
-
-void InstructionSelector::VisitWord64Shl(Node* node) { UNIMPLEMENTED(); }
-
-
-void InstructionSelector::VisitWord64Shr(Node* node) { UNIMPLEMENTED(); }
-
-
-void InstructionSelector::VisitWord64Sar(Node* node) { UNIMPLEMENTED(); }
-
-
-void InstructionSelector::VisitWord64Ror(Node* node) { UNIMPLEMENTED(); }
-
-
-void InstructionSelector::VisitWord64Clz(Node* node) { UNIMPLEMENTED(); }
-
-
-void InstructionSelector::VisitWord64Ctz(Node* node) { UNIMPLEMENTED(); }
-
-
-void InstructionSelector::VisitWord64ReverseBits(Node* node) {
-  UNIMPLEMENTED();
-}
-
-
-void InstructionSelector::VisitWord64Popcnt(Node* node) { UNIMPLEMENTED(); }
-
-
-void InstructionSelector::VisitWord64Equal(Node* node) { UNIMPLEMENTED(); }
-
-
-void InstructionSelector::VisitInt64Add(Node* node) { UNIMPLEMENTED(); }
-
-
-void InstructionSelector::VisitInt64AddWithOverflow(Node* node) {
-  UNIMPLEMENTED();
-}
-
-
-void InstructionSelector::VisitInt64Sub(Node* node) { UNIMPLEMENTED(); }
-
-
-void InstructionSelector::VisitInt64SubWithOverflow(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitInt64Mul(Node* node) { UNIMPLEMENTED(); }
-
-
-void InstructionSelector::VisitInt64Div(Node* node) { UNIMPLEMENTED(); }
-
-
-void InstructionSelector::VisitInt64LessThan(Node* node) { UNIMPLEMENTED(); }
-
-
-void InstructionSelector::VisitInt64LessThanOrEqual(Node* node) {
-  UNIMPLEMENTED();
-}
-
-
-void InstructionSelector::VisitUint64Div(Node* node) { UNIMPLEMENTED(); }
-
-
-void InstructionSelector::VisitInt64Mod(Node* node) { UNIMPLEMENTED(); }
-
-
-void InstructionSelector::VisitUint64LessThan(Node* node) { UNIMPLEMENTED(); }
-
-
-void InstructionSelector::VisitUint64LessThanOrEqual(Node* node) {
-  UNIMPLEMENTED();
-}
-
-
-void InstructionSelector::VisitUint64Mod(Node* node) { UNIMPLEMENTED(); }
-
-
-void InstructionSelector::VisitChangeInt32ToInt64(Node* node) {
-  UNIMPLEMENTED();
-}
-
-
-void InstructionSelector::VisitChangeUint32ToUint64(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitChangeFloat64ToUint64(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitTryTruncateFloat32ToInt64(Node* node) {
-  UNIMPLEMENTED();
-}
-
-
-void InstructionSelector::VisitTryTruncateFloat64ToInt64(Node* node) {
-  UNIMPLEMENTED();
-}
-
-
-void InstructionSelector::VisitTryTruncateFloat32ToUint64(Node* node) {
-  UNIMPLEMENTED();
-}
-
-
-void InstructionSelector::VisitTryTruncateFloat64ToUint64(Node* node) {
-  UNIMPLEMENTED();
-}
-
-
-void InstructionSelector::VisitTruncateInt64ToInt32(Node* node) {
-  UNIMPLEMENTED();
-}
-
-
-void InstructionSelector::VisitRoundInt64ToFloat32(Node* node) {
-  UNIMPLEMENTED();
-}
-
-
-void InstructionSelector::VisitRoundInt64ToFloat64(Node* node) {
-  UNIMPLEMENTED();
-}
-
-
-void InstructionSelector::VisitRoundUint64ToFloat32(Node* node) {
-  UNIMPLEMENTED();
-}
-
-
-void InstructionSelector::VisitRoundUint64ToFloat64(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitBitcastFloat64ToInt64(Node* node) {
-  UNIMPLEMENTED();
-}
-
-
-void InstructionSelector::VisitBitcastInt64ToFloat64(Node* node) {
-  UNIMPLEMENTED();
-}
-#endif  // V8_TARGET_ARCH_32_BIT
-
-// 64 bit targets do not implement the following instructions.
-#if V8_TARGET_ARCH_64_BIT
-void InstructionSelector::VisitInt32PairAdd(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitInt32PairSub(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitInt32PairMul(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitWord32PairShl(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitWord32PairShr(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitWord32PairSar(Node* node) { UNIMPLEMENTED(); }
-#endif  // V8_TARGET_ARCH_64_BIT
-
-#if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS && \
-    !V8_TARGET_ARCH_MIPS64
-void InstructionSelector::VisitF32x4SConvertI32x4(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitF32x4UConvertI32x4(Node* node) {
-  UNIMPLEMENTED();
-}
-#endif  // !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS
-        // && !V8_TARGET_ARCH_MIPS64
-
-#if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS && \
-    !V8_TARGET_ARCH_MIPS64 && !V8_TARGET_ARCH_IA32
-void InstructionSelector::VisitF32x4Abs(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitF32x4Neg(Node* node) { UNIMPLEMENTED(); }
-#endif  // !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS
-        // && !V8_TARGET_ARCH_MIPS64 && !V8_TARGET_ARCH_IA32
-
-#if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS && \
-    !V8_TARGET_ARCH_MIPS64 && !V8_TARGET_ARCH_X64
-void InstructionSelector::VisitF32x4RecipSqrtApprox(Node* node) {
-  UNIMPLEMENTED();
-}
-#endif  // !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS
-        // && !V8_TARGET_ARCH_MIPS64 && !V8_TARGET_ARCH_X64
-
-#if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS && \
-    !V8_TARGET_ARCH_MIPS64
-void InstructionSelector::VisitF32x4AddHoriz(Node* node) { UNIMPLEMENTED(); }
-#endif  // !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS
-        // && !V8_TARGET_ARCH_MIPS64
-
-#if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS && \
-    !V8_TARGET_ARCH_MIPS64 && !V8_TARGET_ARCH_X64
-void InstructionSelector::VisitF32x4RecipApprox(Node* node) { UNIMPLEMENTED(); }
-#endif  // !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS
-        // && !V8_TARGET_ARCH_MIPS64 && !V8_TARGET_ARCH_X64
-
-#if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_X64 && \
-    !V8_TARGET_ARCH_MIPS && !V8_TARGET_ARCH_MIPS64
-void InstructionSelector::VisitI32x4AddHoriz(Node* node) { UNIMPLEMENTED(); }
-#endif  // !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_X64
-        // && !V8_TARGET_ARCH_MIPS && !V8_TARGET_ARCH_MIPS64
-
-#if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS && \
-    !V8_TARGET_ARCH_MIPS64
-void InstructionSelector::VisitI32x4SConvertF32x4(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitI32x4UConvertF32x4(Node* node) {
-  UNIMPLEMENTED();
-}
-#endif  // !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS
-        // && !V8_TARGET_ARCH_MIPS64
-
-#if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS && \
-    !V8_TARGET_ARCH_MIPS64
-void InstructionSelector::VisitI32x4SConvertI16x8Low(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitI32x4SConvertI16x8High(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitI32x4UConvertI16x8Low(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitI32x4UConvertI16x8High(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitI16x8SConvertI8x16Low(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitI16x8SConvertI8x16High(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitI16x8SConvertI32x4(Node* node) {
-  UNIMPLEMENTED();
-}
-#endif  // !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS
-        // && !V8_TARGET_ARCH_MIPS64
-
-#if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_X64 && \
-    !V8_TARGET_ARCH_MIPS && !V8_TARGET_ARCH_MIPS64
-void InstructionSelector::VisitI16x8AddHoriz(Node* node) { UNIMPLEMENTED(); }
-#endif  // !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_X64
-        // && !V8_TARGET_ARCH_MIPS && !V8_TARGET_ARCH_MIPS64
-
-#if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS && \
-    !V8_TARGET_ARCH_MIPS64
-void InstructionSelector::VisitI16x8UConvertI32x4(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitI16x8UConvertI8x16Low(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitI16x8UConvertI8x16High(Node* node) {
-  UNIMPLEMENTED();
-}
-#endif  // !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS
-        // && !V8_TARGET_ARCH_MIPS64
-
-#if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS && \
-    !V8_TARGET_ARCH_MIPS64
-void InstructionSelector::VisitI8x16Shl(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16ShrS(Node* node) { UNIMPLEMENTED(); }
-#endif  // !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS
-        // && !V8_TARGET_ARCH_MIPS64
-
-#if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS && \
-    !V8_TARGET_ARCH_MIPS64
-void InstructionSelector::VisitI8x16SConvertI16x8(Node* node) {
-  UNIMPLEMENTED();
-}
-#endif  // !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS
-        // && !V8_TARGET_ARCH_MIPS64
-
-#if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS && \
-    !V8_TARGET_ARCH_MIPS64
-void InstructionSelector::VisitI8x16Mul(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16ShrU(Node* node) { UNIMPLEMENTED(); }
-#endif  // !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS
-        // && !V8_TARGET_ARCH_MIPS64
-
-#if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS && \
-    !V8_TARGET_ARCH_MIPS64
-void InstructionSelector::VisitI8x16UConvertI16x8(Node* node) {
-  UNIMPLEMENTED();
-}
-#endif  // !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS
-        // && !V8_TARGET_ARCH_MIPS64
-
-#if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_X64 && \
-    !V8_TARGET_ARCH_MIPS && !V8_TARGET_ARCH_MIPS64
-void InstructionSelector::VisitS128Select(Node* node) { UNIMPLEMENTED(); }
-#endif  // !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_X64
-        // && !V8_TARGET_ARCH_MIPS && !V8_TARGET_ARCH_MIPS64
-
-#if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS && \
-    !V8_TARGET_ARCH_MIPS64
-void InstructionSelector::VisitS8x16Shuffle(Node* node) { UNIMPLEMENTED(); }
-#endif  // !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS
-        // && !V8_TARGET_ARCH_MIPS64
-
-#if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS && \
-    !V8_TARGET_ARCH_MIPS64
-void InstructionSelector::VisitS1x4AnyTrue(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitS1x4AllTrue(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitS1x8AnyTrue(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitS1x8AllTrue(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitS1x16AnyTrue(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitS1x16AllTrue(Node* node) { UNIMPLEMENTED(); }
-#endif  // !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS
-        // && !V8_TARGET_ARCH_MIPS64
-
-void InstructionSelector::VisitFinishRegion(Node* node) { EmitIdentity(node); }
-
-void InstructionSelector::VisitParameter(Node* node) {
-  OperandGenerator g(this);
-  int index = ParameterIndexOf(node->op());
-  InstructionOperand op =
-      linkage()->ParameterHasSecondaryLocation(index)
-          ? g.DefineAsDualLocation(
-                node, linkage()->GetParameterLocation(index),
-                linkage()->GetParameterSecondaryLocation(index))
-          : g.DefineAsLocation(node, linkage()->GetParameterLocation(index));
-
-  Emit(kArchNop, op);
-}
-
-namespace {
-LinkageLocation ExceptionLocation() {
-  return LinkageLocation::ForRegister(kReturnRegister0.code(),
-                                      MachineType::IntPtr());
-}
-}
-
-void InstructionSelector::VisitIfException(Node* node) {
-  OperandGenerator g(this);
-  DCHECK_EQ(IrOpcode::kCall, node->InputAt(1)->opcode());
-  Emit(kArchNop, g.DefineAsLocation(node, ExceptionLocation()));
-}
-
-
-void InstructionSelector::VisitOsrValue(Node* node) {
-  OperandGenerator g(this);
-  int index = OsrValueIndexOf(node->op());
-  Emit(kArchNop,
-       g.DefineAsLocation(node, linkage()->GetOsrValueLocation(index)));
-}
-
-
-void InstructionSelector::VisitPhi(Node* node) {
-  const int input_count = node->op()->ValueInputCount();
-  DCHECK_EQ(input_count, current_block_->PredecessorCount());
-  PhiInstruction* phi = new (instruction_zone())
-      PhiInstruction(instruction_zone(), GetVirtualRegister(node),
-                     static_cast<size_t>(input_count));
-  sequence()
-      ->InstructionBlockAt(RpoNumber::FromInt(current_block_->rpo_number()))
-      ->AddPhi(phi);
-  for (int i = 0; i < input_count; ++i) {
-    Node* const input = node->InputAt(i);
-    MarkAsUsed(input);
-    phi->SetInput(static_cast<size_t>(i), GetVirtualRegister(input));
-  }
-}
-
-
-void InstructionSelector::VisitProjection(Node* node) {
-  OperandGenerator g(this);
-  Node* value = node->InputAt(0);
-  switch (value->opcode()) {
-    case IrOpcode::kInt32AddWithOverflow:
-    case IrOpcode::kInt32SubWithOverflow:
-    case IrOpcode::kInt32MulWithOverflow:
-    case IrOpcode::kInt64AddWithOverflow:
-    case IrOpcode::kInt64SubWithOverflow:
-    case IrOpcode::kTryTruncateFloat32ToInt64:
-    case IrOpcode::kTryTruncateFloat64ToInt64:
-    case IrOpcode::kTryTruncateFloat32ToUint64:
-    case IrOpcode::kTryTruncateFloat64ToUint64:
-    case IrOpcode::kInt32PairAdd:
-    case IrOpcode::kInt32PairSub:
-    case IrOpcode::kInt32PairMul:
-    case IrOpcode::kWord32PairShl:
-    case IrOpcode::kWord32PairShr:
-    case IrOpcode::kWord32PairSar:
-    case IrOpcode::kInt32AbsWithOverflow:
-    case IrOpcode::kInt64AbsWithOverflow:
-      if (ProjectionIndexOf(node->op()) == 0u) {
-        Emit(kArchNop, g.DefineSameAsFirst(node), g.Use(value));
-      } else {
-        DCHECK_EQ(1u, ProjectionIndexOf(node->op()));
-        MarkAsUsed(value);
-      }
-      break;
-    default:
-      break;
-  }
-}
-
-
-void InstructionSelector::VisitConstant(Node* node) {
-  // We must emit a NOP here because every live range needs a defining
-  // instruction in the register allocator.
-  OperandGenerator g(this);
-  Emit(kArchNop, g.DefineAsConstant(node));
-}
-
-
-void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) {
-  OperandGenerator g(this);
-  const CallDescriptor* descriptor = CallDescriptorOf(node->op());
-
-  FrameStateDescriptor* frame_state_descriptor = nullptr;
-  if (descriptor->NeedsFrameState()) {
-    frame_state_descriptor = GetFrameStateDescriptor(
-        node->InputAt(static_cast<int>(descriptor->InputCount())));
-  }
-
-  CallBuffer buffer(zone(), descriptor, frame_state_descriptor);
-
-  // Compute InstructionOperands for inputs and outputs.
-  // TODO(turbofan): on some architectures it's probably better to use
-  // the code object in a register if there are multiple uses of it.
-  // Improve constant pool and the heuristics in the register allocator
-  // for where to emit constants.
-  CallBufferFlags call_buffer_flags(kCallCodeImmediate | kCallAddressImmediate);
-  InitializeCallBuffer(node, &buffer, call_buffer_flags, false);
-
-  EmitPrepareArguments(&(buffer.pushed_nodes), descriptor, node);
-
-  // Pass label of exception handler block.
-  CallDescriptor::Flags flags = descriptor->flags();
-  if (handler) {
-    DCHECK_EQ(IrOpcode::kIfException, handler->front()->opcode());
-    flags |= CallDescriptor::kHasExceptionHandler;
-    buffer.instruction_args.push_back(g.Label(handler));
-  }
-
-  // Select the appropriate opcode based on the call type.
-  InstructionCode opcode = kArchNop;
-  switch (descriptor->kind()) {
-    case CallDescriptor::kCallAddress:
-      opcode =
-          kArchCallCFunction |
-          MiscField::encode(static_cast<int>(descriptor->ParameterCount()));
-      break;
-    case CallDescriptor::kCallCodeObject:
-      opcode = kArchCallCodeObject | MiscField::encode(flags);
-      break;
-    case CallDescriptor::kCallJSFunction:
-      opcode = kArchCallJSFunction | MiscField::encode(flags);
-      break;
-    case CallDescriptor::kCallWasmFunction:
-      opcode = kArchCallWasmFunction | MiscField::encode(flags);
-      break;
-  }
-
-  // Emit the call instruction.
-  size_t const output_count = buffer.outputs.size();
-  auto* outputs = output_count ? &buffer.outputs.front() : nullptr;
-  Instruction* call_instr =
-      Emit(opcode, output_count, outputs, buffer.instruction_args.size(),
-           &buffer.instruction_args.front());
-  if (instruction_selection_failed()) return;
-  call_instr->MarkAsCall();
-
-  EmitPrepareResults(&(buffer.output_nodes), descriptor, node);
-}
-
-void InstructionSelector::VisitCallWithCallerSavedRegisters(
-    Node* node, BasicBlock* handler) {
-  OperandGenerator g(this);
-  const auto fp_mode = CallDescriptorOf(node->op())->get_save_fp_mode();
-  Emit(kArchSaveCallerRegisters | MiscField::encode(static_cast<int>(fp_mode)),
-       g.NoOutput());
-  VisitCall(node, handler);
-  Emit(kArchRestoreCallerRegisters |
-           MiscField::encode(static_cast<int>(fp_mode)),
-       g.NoOutput());
-}
-
-void InstructionSelector::VisitTailCall(Node* node) {
-  OperandGenerator g(this);
-  CallDescriptor const* descriptor = CallDescriptorOf(node->op());
-
-  CallDescriptor* caller = linkage()->GetIncomingDescriptor();
-  DCHECK(caller->CanTailCall(node));
-  const CallDescriptor* callee = CallDescriptorOf(node->op());
-  int stack_param_delta = callee->GetStackParameterDelta(caller);
-  CallBuffer buffer(zone(), descriptor, nullptr);
-
-  // Compute InstructionOperands for inputs and outputs.
-  CallBufferFlags flags(kCallCodeImmediate | kCallTail);
-  if (IsTailCallAddressImmediate()) {
-    flags |= kCallAddressImmediate;
-  }
-  InitializeCallBuffer(node, &buffer, flags, true, stack_param_delta);
-
-  // Select the appropriate opcode based on the call type.
-  InstructionCode opcode;
-  InstructionOperandVector temps(zone());
-  if (linkage()->GetIncomingDescriptor()->IsJSFunctionCall()) {
-    switch (descriptor->kind()) {
-      case CallDescriptor::kCallCodeObject:
-        opcode = kArchTailCallCodeObjectFromJSFunction;
-        break;
-      default:
-        UNREACHABLE();
-        return;
-    }
-    int temps_count = GetTempsCountForTailCallFromJSFunction();
-    for (int i = 0; i < temps_count; i++) {
-      temps.push_back(g.TempRegister());
-    }
-  } else {
-    switch (descriptor->kind()) {
-      case CallDescriptor::kCallCodeObject:
-        opcode = kArchTailCallCodeObject;
-        break;
-      case CallDescriptor::kCallAddress:
-        opcode = kArchTailCallAddress;
-        break;
-      case CallDescriptor::kCallWasmFunction:
-        opcode = kArchTailCallWasm;
-        break;
-      default:
-        UNREACHABLE();
-        return;
-    }
-  }
-  opcode |= MiscField::encode(descriptor->flags());
-
-  Emit(kArchPrepareTailCall, g.NoOutput());
-
-  // Add an immediate operand that represents the first slot that is unused
-  // with respect to the stack pointer that has been updated for the tail call
-  // instruction. This is used by backends that need to pad arguments for stack
-  // alignment, in order to store an optional slot of padding above the
-  // arguments.
-  int optional_padding_slot = callee->GetFirstUnusedStackSlot();
-  buffer.instruction_args.push_back(g.TempImmediate(optional_padding_slot));
-
-  int first_unused_stack_slot =
-      (V8_TARGET_ARCH_STORES_RETURN_ADDRESS_ON_STACK ? 1 : 0) +
-      stack_param_delta;
-  buffer.instruction_args.push_back(g.TempImmediate(first_unused_stack_slot));
-
-  // Emit the tailcall instruction.
-  Emit(opcode, 0, nullptr, buffer.instruction_args.size(),
-       &buffer.instruction_args.front(), temps.size(),
-       temps.empty() ? nullptr : &temps.front());
-}
-
-
-void InstructionSelector::VisitGoto(BasicBlock* target) {
-  // jump to the next block.
-  OperandGenerator g(this);
-  Emit(kArchJmp, g.NoOutput(), g.Label(target));
-}
-
-void InstructionSelector::VisitReturn(Node* ret) {
-  OperandGenerator g(this);
-  const int input_count = linkage()->GetIncomingDescriptor()->ReturnCount() == 0
-                              ? 1
-                              : ret->op()->ValueInputCount();
-  DCHECK_GE(input_count, 1);
-  auto value_locations = zone()->NewArray<InstructionOperand>(input_count);
-  Node* pop_count = ret->InputAt(0);
-  value_locations[0] = (pop_count->opcode() == IrOpcode::kInt32Constant ||
-                        pop_count->opcode() == IrOpcode::kInt64Constant)
-                           ? g.UseImmediate(pop_count)
-                           : g.UseRegister(pop_count);
-  for (int i = 1; i < input_count; ++i) {
-    value_locations[i] =
-        g.UseLocation(ret->InputAt(i), linkage()->GetReturnLocation(i - 1));
-  }
-  Emit(kArchRet, 0, nullptr, input_count, value_locations);
-}
-
-Instruction* InstructionSelector::EmitDeoptimize(
-    InstructionCode opcode, InstructionOperand output, InstructionOperand a,
-    DeoptimizeKind kind, DeoptimizeReason reason,
-    VectorSlotPair const& feedback, Node* frame_state) {
-  size_t output_count = output.IsInvalid() ? 0 : 1;
-  InstructionOperand inputs[] = {a};
-  size_t input_count = arraysize(inputs);
-  return EmitDeoptimize(opcode, output_count, &output, input_count, inputs,
-                        kind, reason, feedback, frame_state);
-}
-
-Instruction* InstructionSelector::EmitDeoptimize(
-    InstructionCode opcode, InstructionOperand output, InstructionOperand a,
-    InstructionOperand b, DeoptimizeKind kind, DeoptimizeReason reason,
-    VectorSlotPair const& feedback, Node* frame_state) {
-  size_t output_count = output.IsInvalid() ? 0 : 1;
-  InstructionOperand inputs[] = {a, b};
-  size_t input_count = arraysize(inputs);
-  return EmitDeoptimize(opcode, output_count, &output, input_count, inputs,
-                        kind, reason, feedback, frame_state);
-}
-
-Instruction* InstructionSelector::EmitDeoptimize(
-    InstructionCode opcode, size_t output_count, InstructionOperand* outputs,
-    size_t input_count, InstructionOperand* inputs, DeoptimizeKind kind,
-    DeoptimizeReason reason, VectorSlotPair const& feedback,
-    Node* frame_state) {
-  OperandGenerator g(this);
-  FrameStateDescriptor* const descriptor = GetFrameStateDescriptor(frame_state);
-  InstructionOperandVector args(instruction_zone());
-  args.reserve(input_count + 1 + descriptor->GetTotalSize());
-  for (size_t i = 0; i < input_count; ++i) {
-    args.push_back(inputs[i]);
-  }
-  opcode |= MiscField::encode(static_cast<int>(input_count));
-  DCHECK_NE(DeoptimizeKind::kLazy, kind);
-  int const state_id =
-      sequence()->AddDeoptimizationEntry(descriptor, kind, reason, feedback);
-  args.push_back(g.TempImmediate(state_id));
-  StateObjectDeduplicator deduplicator(instruction_zone());
-  AddInputsToFrameStateDescriptor(descriptor, frame_state, &g, &deduplicator,
-                                  &args, FrameStateInputKind::kAny,
-                                  instruction_zone());
-  return Emit(opcode, output_count, outputs, args.size(), &args.front(), 0,
-              nullptr);
-}
-
-void InstructionSelector::EmitIdentity(Node* node) {
-  OperandGenerator g(this);
-  MarkAsUsed(node->InputAt(0));
-  SetRename(node, node->InputAt(0));
-}
-
-void InstructionSelector::VisitDeoptimize(DeoptimizeKind kind,
-                                          DeoptimizeReason reason,
-                                          VectorSlotPair const& feedback,
-                                          Node* value) {
-  EmitDeoptimize(kArchDeoptimize, 0, nullptr, 0, nullptr, kind, reason,
-                 feedback, value);
-}
-
-void InstructionSelector::VisitThrow(Node* node) {
-  OperandGenerator g(this);
-  Emit(kArchThrowTerminator, g.NoOutput());
-}
-
-void InstructionSelector::VisitDebugBreak(Node* node) {
-  OperandGenerator g(this);
-  Emit(kArchDebugBreak, g.NoOutput());
-}
-
-void InstructionSelector::VisitUnreachable(Node* node) {
-  OperandGenerator g(this);
-  Emit(kArchDebugBreak, g.NoOutput());
-}
-
-void InstructionSelector::VisitDeadValue(Node* node) {
-  OperandGenerator g(this);
-  MarkAsRepresentation(DeadValueRepresentationOf(node->op()), node);
-  Emit(kArchDebugBreak, g.DefineAsConstant(node));
-}
-
-void InstructionSelector::VisitComment(Node* node) {
-  OperandGenerator g(this);
-  InstructionOperand operand(g.UseImmediate(node));
-  Emit(kArchComment, 0, nullptr, 1, &operand);
-}
-
-void InstructionSelector::VisitUnsafePointerAdd(Node* node) {
-#if V8_TARGET_ARCH_64_BIT
-  VisitInt64Add(node);
-#else   // V8_TARGET_ARCH_64_BIT
-  VisitInt32Add(node);
-#endif  // V8_TARGET_ARCH_64_BIT
-}
-
-void InstructionSelector::VisitRetain(Node* node) {
-  OperandGenerator g(this);
-  Emit(kArchNop, g.NoOutput(), g.UseAny(node->InputAt(0)));
-}
-
-bool InstructionSelector::CanProduceSignalingNaN(Node* node) {
-  // TODO(jarin) Improve the heuristic here.
-  if (node->opcode() == IrOpcode::kFloat64Add ||
-      node->opcode() == IrOpcode::kFloat64Sub ||
-      node->opcode() == IrOpcode::kFloat64Mul) {
-    return false;
-  }
-  return true;
-}
-
-FrameStateDescriptor* InstructionSelector::GetFrameStateDescriptor(
-    Node* state) {
-  DCHECK_EQ(IrOpcode::kFrameState, state->opcode());
-  DCHECK_EQ(kFrameStateInputCount, state->InputCount());
-  FrameStateInfo state_info = OpParameter<FrameStateInfo>(state);
-
-  int parameters = static_cast<int>(
-      StateValuesAccess(state->InputAt(kFrameStateParametersInput)).size());
-  int locals = static_cast<int>(
-      StateValuesAccess(state->InputAt(kFrameStateLocalsInput)).size());
-  int stack = static_cast<int>(
-      StateValuesAccess(state->InputAt(kFrameStateStackInput)).size());
-
-  DCHECK_EQ(parameters, state_info.parameter_count());
-  DCHECK_EQ(locals, state_info.local_count());
-
-  FrameStateDescriptor* outer_state = nullptr;
-  Node* outer_node = state->InputAt(kFrameStateOuterStateInput);
-  if (outer_node->opcode() == IrOpcode::kFrameState) {
-    outer_state = GetFrameStateDescriptor(outer_node);
-  }
-
-  return new (instruction_zone()) FrameStateDescriptor(
-      instruction_zone(), state_info.type(), state_info.bailout_id(),
-      state_info.state_combine(), parameters, locals, stack,
-      state_info.shared_info(), outer_state);
-}
-
-// static
-bool InstructionSelector::TryMatch32x4Shuffle(const uint8_t* shuffle,
-                                              uint8_t* shuffle32x4) {
-  for (int i = 0; i < 4; ++i) {
-    if (shuffle[i * 4] % 4 != 0) return false;
-    for (int j = 1; j < 4; ++j) {
-      if (shuffle[i * 4 + j] - shuffle[i * 4 + j - 1] != 1) return false;
-    }
-    shuffle32x4[i] = shuffle[i * 4] / 4;
-  }
-  return true;
-}
-
-// static
-bool InstructionSelector::TryMatchConcat(const uint8_t* shuffle, uint8_t mask,
-                                         uint8_t* vext) {
-  uint8_t start = shuffle[0];
-  int i = 1;
-  for (; i < 16 - start; ++i) {
-    if ((shuffle[i] & mask) != ((shuffle[i - 1] + 1) & mask)) return false;
-  }
-  uint8_t wrap = 16;
-  for (; i < 16; ++i, ++wrap) {
-    if ((shuffle[i] & mask) != (wrap & mask)) return false;
-  }
-  *vext = start;
-  return true;
-}
-
-// Canonicalize shuffles to make pattern matching simpler. Returns a mask that
-// will ignore the high bit of indices in some cases.
-uint8_t InstructionSelector::CanonicalizeShuffle(Node* node) {
-  static const int kMaxLaneIndex = 15;
-  static const int kMaxShuffleIndex = 31;
-
-  const uint8_t* shuffle = OpParameter<uint8_t*>(node);
-  uint8_t mask = kMaxShuffleIndex;
-  // If shuffle is unary, set 'mask' to ignore the high bit of the indices.
-  // Replace any unused source with the other.
-  if (GetVirtualRegister(node->InputAt(0)) ==
-      GetVirtualRegister(node->InputAt(1))) {
-    // unary, src0 == src1.
-    mask = kMaxLaneIndex;
-  } else {
-    bool src0_is_used = false;
-    bool src1_is_used = false;
-    for (int i = 0; i < 16; ++i) {
-      if (shuffle[i] < 16) {
-        src0_is_used = true;
-      } else {
-        src1_is_used = true;
-      }
-    }
-    if (src0_is_used && !src1_is_used) {
-      node->ReplaceInput(1, node->InputAt(0));
-      mask = kMaxLaneIndex;
-    } else if (src1_is_used && !src0_is_used) {
-      node->ReplaceInput(0, node->InputAt(1));
-      mask = kMaxLaneIndex;
-    }
-  }
-  return mask;
-}
-
-// static
-int32_t InstructionSelector::Pack4Lanes(const uint8_t* shuffle, uint8_t mask) {
-  int32_t result = 0;
-  for (int i = 3; i >= 0; --i) {
-    result <<= 8;
-    result |= shuffle[i] & mask;
-  }
-  return result;
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/instruction-selector.h b/src/v8/src/compiler/instruction-selector.h
deleted file mode 100644
index 75c41c1..0000000
--- a/src/v8/src/compiler/instruction-selector.h
+++ /dev/null
@@ -1,456 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_INSTRUCTION_SELECTOR_H_
-#define V8_COMPILER_INSTRUCTION_SELECTOR_H_
-
-#include <map>
-
-#include "src/compiler/common-operator.h"
-#include "src/compiler/instruction-scheduler.h"
-#include "src/compiler/instruction.h"
-#include "src/compiler/linkage.h"
-#include "src/compiler/machine-operator.h"
-#include "src/compiler/node.h"
-#include "src/globals.h"
-#include "src/zone/zone-containers.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-// Forward declarations.
-class BasicBlock;
-struct CallBuffer;  // TODO(bmeurer): Remove this.
-class FlagsContinuation;
-class Linkage;
-class OperandGenerator;
-struct SwitchInfo;
-class StateObjectDeduplicator;
-
-// This struct connects nodes of parameters which are going to be pushed on the
-// call stack with their parameter index in the call descriptor of the callee.
-struct PushParameter {
-  PushParameter(Node* n = nullptr,
-                LinkageLocation l = LinkageLocation::ForAnyRegister())
-      : node(n), location(l) {}
-
-  Node* node;
-  LinkageLocation location;
-};
-
-enum class FrameStateInputKind { kAny, kStackSlot };
-
-// Instruction selection generates an InstructionSequence for a given Schedule.
-class V8_EXPORT_PRIVATE InstructionSelector final {
- public:
-  // Forward declarations.
-  class Features;
-
-  enum SourcePositionMode { kCallSourcePositions, kAllSourcePositions };
-  enum EnableScheduling { kDisableScheduling, kEnableScheduling };
-  enum EnableSerialization { kDisableSerialization, kEnableSerialization };
-
-  InstructionSelector(
-      Zone* zone, size_t node_count, Linkage* linkage,
-      InstructionSequence* sequence, Schedule* schedule,
-      SourcePositionTable* source_positions, Frame* frame,
-      SourcePositionMode source_position_mode = kCallSourcePositions,
-      Features features = SupportedFeatures(),
-      EnableScheduling enable_scheduling = FLAG_turbo_instruction_scheduling
-                                               ? kEnableScheduling
-                                               : kDisableScheduling,
-      EnableSerialization enable_serialization = kDisableSerialization);
-
-  // Visit code for the entire graph with the included schedule.
-  bool SelectInstructions();
-
-  void StartBlock(RpoNumber rpo);
-  void EndBlock(RpoNumber rpo);
-  void AddInstruction(Instruction* instr);
-
-  // ===========================================================================
-  // ============= Architecture-independent code emission methods. =============
-  // ===========================================================================
-
-  Instruction* Emit(InstructionCode opcode, InstructionOperand output,
-                    size_t temp_count = 0, InstructionOperand* temps = nullptr);
-  Instruction* Emit(InstructionCode opcode, InstructionOperand output,
-                    InstructionOperand a, size_t temp_count = 0,
-                    InstructionOperand* temps = nullptr);
-  Instruction* Emit(InstructionCode opcode, InstructionOperand output,
-                    InstructionOperand a, InstructionOperand b,
-                    size_t temp_count = 0, InstructionOperand* temps = nullptr);
-  Instruction* Emit(InstructionCode opcode, InstructionOperand output,
-                    InstructionOperand a, InstructionOperand b,
-                    InstructionOperand c, size_t temp_count = 0,
-                    InstructionOperand* temps = nullptr);
-  Instruction* Emit(InstructionCode opcode, InstructionOperand output,
-                    InstructionOperand a, InstructionOperand b,
-                    InstructionOperand c, InstructionOperand d,
-                    size_t temp_count = 0, InstructionOperand* temps = nullptr);
-  Instruction* Emit(InstructionCode opcode, InstructionOperand output,
-                    InstructionOperand a, InstructionOperand b,
-                    InstructionOperand c, InstructionOperand d,
-                    InstructionOperand e, size_t temp_count = 0,
-                    InstructionOperand* temps = nullptr);
-  Instruction* Emit(InstructionCode opcode, InstructionOperand output,
-                    InstructionOperand a, InstructionOperand b,
-                    InstructionOperand c, InstructionOperand d,
-                    InstructionOperand e, InstructionOperand f,
-                    size_t temp_count = 0, InstructionOperand* temps = nullptr);
-  Instruction* Emit(InstructionCode opcode, size_t output_count,
-                    InstructionOperand* outputs, size_t input_count,
-                    InstructionOperand* inputs, size_t temp_count = 0,
-                    InstructionOperand* temps = nullptr);
-  Instruction* Emit(Instruction* instr);
-
-  // ===========================================================================
-  // ===== Architecture-independent deoptimization exit emission methods. ======
-  // ===========================================================================
-
-  Instruction* EmitDeoptimize(InstructionCode opcode, InstructionOperand output,
-                              InstructionOperand a, DeoptimizeKind kind,
-                              DeoptimizeReason reason,
-                              VectorSlotPair const& feedback,
-                              Node* frame_state);
-  Instruction* EmitDeoptimize(InstructionCode opcode, InstructionOperand output,
-                              InstructionOperand a, InstructionOperand b,
-                              DeoptimizeKind kind, DeoptimizeReason reason,
-                              VectorSlotPair const& feedback,
-                              Node* frame_state);
-  Instruction* EmitDeoptimize(InstructionCode opcode, size_t output_count,
-                              InstructionOperand* outputs, size_t input_count,
-                              InstructionOperand* inputs, DeoptimizeKind kind,
-                              DeoptimizeReason reason,
-                              VectorSlotPair const& feedback,
-                              Node* frame_state);
-
-  // ===========================================================================
-  // ============== Architecture-independent CPU feature methods. ==============
-  // ===========================================================================
-
-  class Features final {
-   public:
-    Features() : bits_(0) {}
-    explicit Features(unsigned bits) : bits_(bits) {}
-    explicit Features(CpuFeature f) : bits_(1u << f) {}
-    Features(CpuFeature f1, CpuFeature f2) : bits_((1u << f1) | (1u << f2)) {}
-
-    bool Contains(CpuFeature f) const { return (bits_ & (1u << f)); }
-
-   private:
-    unsigned bits_;
-  };
-
-  bool IsSupported(CpuFeature feature) const {
-    return features_.Contains(feature);
-  }
-
-  // Returns the features supported on the target platform.
-  static Features SupportedFeatures() {
-    return Features(CpuFeatures::SupportedFeatures());
-  }
-
-  // TODO(sigurds) This should take a CpuFeatures argument.
-  static MachineOperatorBuilder::Flags SupportedMachineOperatorFlags();
-
-  static MachineOperatorBuilder::AlignmentRequirements AlignmentRequirements();
-
-  // ===========================================================================
-  // ============ Architecture-independent graph covering methods. =============
-  // ===========================================================================
-
-  // Used in pattern matching during code generation.
-  // Check if {node} can be covered while generating code for the current
-  // instruction. A node can be covered if the {user} of the node has the only
-  // edge and the two are in the same basic block.
-  bool CanCover(Node* user, Node* node) const;
-
-  // Used in pattern matching during code generation.
-  // This function checks that {node} and {user} are in the same basic block,
-  // and that {user} is the only user of {node} in this basic block.  This
-  // check guarantees that there are no users of {node} scheduled between
-  // {node} and {user}, and thus we can select a single instruction for both
-  // nodes, if such an instruction exists. This check can be used for example
-  // when selecting instructions for:
-  //   n = Int32Add(a, b)
-  //   c = Word32Compare(n, 0, cond)
-  //   Branch(c, true_label, false_label)
-  // Here we can generate a flag-setting add instruction, even if the add has
-  // uses in other basic blocks, since the flag-setting add instruction will
-  // still generate the result of the addition and not just set the flags.
-  // However, if we had uses of the add in the same basic block, we could have:
-  //   n = Int32Add(a, b)
-  //   o = OtherOp(n, ...)
-  //   c = Word32Compare(n, 0, cond)
-  //   Branch(c, true_label, false_label)
-  // where we cannot select the add and the compare together.  If we were to
-  // select a flag-setting add instruction for Word32Compare and Int32Add while
-  // visiting Word32Compare, we would then have to select an instruction for
-  // OtherOp *afterwards*, which means we would attempt to use the result of
-  // the add before we have defined it.
-  bool IsOnlyUserOfNodeInSameBlock(Node* user, Node* node) const;
-
-  // Checks if {node} was already defined, and therefore code was already
-  // generated for it.
-  bool IsDefined(Node* node) const;
-
-  // Checks if {node} has any uses, and therefore code has to be generated for
-  // it.
-  bool IsUsed(Node* node) const;
-
-  // Checks if {node} is currently live.
-  bool IsLive(Node* node) const { return !IsDefined(node) && IsUsed(node); }
-
-  // Gets the effect level of {node}.
-  int GetEffectLevel(Node* node) const;
-
-  int GetVirtualRegister(const Node* node);
-  const std::map<NodeId, int> GetVirtualRegistersForTesting() const;
-
-  // Check if we can generate loads and stores of ExternalConstants relative
-  // to the roots register, i.e. if both a root register is available for this
-  // compilation unit and the serializer is disabled.
-  bool CanAddressRelativeToRootsRegister() const;
-  // Check if we can use the roots register to access GC roots.
-  bool CanUseRootsRegister() const;
-
-  Isolate* isolate() const { return sequence()->isolate(); }
-
- private:
-  friend class OperandGenerator;
-
-  bool UseInstructionScheduling() const {
-    return (enable_scheduling_ == kEnableScheduling) &&
-           InstructionScheduler::SchedulerSupported();
-  }
-
-  void EmitTableSwitch(const SwitchInfo& sw, InstructionOperand& index_operand);
-  void EmitLookupSwitch(const SwitchInfo& sw,
-                        InstructionOperand& value_operand);
-
-  void TryRename(InstructionOperand* op);
-  int GetRename(int virtual_register);
-  void SetRename(const Node* node, const Node* rename);
-  void UpdateRenames(Instruction* instruction);
-  void UpdateRenamesInPhi(PhiInstruction* phi);
-
-  // Inform the instruction selection that {node} was just defined.
-  void MarkAsDefined(Node* node);
-
-  // Inform the instruction selection that {node} has at least one use and we
-  // will need to generate code for it.
-  void MarkAsUsed(Node* node);
-
-  // Sets the effect level of {node}.
-  void SetEffectLevel(Node* node, int effect_level);
-
-  // Inform the register allocation of the representation of the value produced
-  // by {node}.
-  void MarkAsRepresentation(MachineRepresentation rep, Node* node);
-  void MarkAsWord32(Node* node) {
-    MarkAsRepresentation(MachineRepresentation::kWord32, node);
-  }
-  void MarkAsWord64(Node* node) {
-    MarkAsRepresentation(MachineRepresentation::kWord64, node);
-  }
-  void MarkAsFloat32(Node* node) {
-    MarkAsRepresentation(MachineRepresentation::kFloat32, node);
-  }
-  void MarkAsFloat64(Node* node) {
-    MarkAsRepresentation(MachineRepresentation::kFloat64, node);
-  }
-  void MarkAsSimd128(Node* node) {
-    MarkAsRepresentation(MachineRepresentation::kSimd128, node);
-  }
-  void MarkAsReference(Node* node) {
-    MarkAsRepresentation(MachineRepresentation::kTagged, node);
-  }
-
-  // Inform the register allocation of the representation of the unallocated
-  // operand {op}.
-  void MarkAsRepresentation(MachineRepresentation rep,
-                            const InstructionOperand& op);
-
-  enum CallBufferFlag {
-    kCallCodeImmediate = 1u << 0,
-    kCallAddressImmediate = 1u << 1,
-    kCallTail = 1u << 2
-  };
-  typedef base::Flags<CallBufferFlag> CallBufferFlags;
-
-  // Initialize the call buffer with the InstructionOperands, nodes, etc,
-  // corresponding
-  // to the inputs and outputs of the call.
-  // {call_code_immediate} to generate immediate operands to calls of code.
-  // {call_address_immediate} to generate immediate operands to address calls.
-  void InitializeCallBuffer(Node* call, CallBuffer* buffer,
-                            CallBufferFlags flags, bool is_tail_call,
-                            int stack_slot_delta = 0);
-  bool IsTailCallAddressImmediate();
-  int GetTempsCountForTailCallFromJSFunction();
-
-  FrameStateDescriptor* GetFrameStateDescriptor(Node* node);
-  size_t AddInputsToFrameStateDescriptor(FrameStateDescriptor* descriptor,
-                                         Node* state, OperandGenerator* g,
-                                         StateObjectDeduplicator* deduplicator,
-                                         InstructionOperandVector* inputs,
-                                         FrameStateInputKind kind, Zone* zone);
-  size_t AddOperandToStateValueDescriptor(StateValueList* values,
-                                          InstructionOperandVector* inputs,
-                                          OperandGenerator* g,
-                                          StateObjectDeduplicator* deduplicator,
-                                          Node* input, MachineType type,
-                                          FrameStateInputKind kind, Zone* zone);
-
-  // ===========================================================================
-  // ============= Architecture-specific graph covering methods. ===============
-  // ===========================================================================
-
-  // Visit nodes in the given block and generate code.
-  void VisitBlock(BasicBlock* block);
-
-  // Visit the node for the control flow at the end of the block, generating
-  // code if necessary.
-  void VisitControl(BasicBlock* block);
-
-  // Visit the node and generate code, if any.
-  void VisitNode(Node* node);
-
-  // Visit the node and generate code for IEEE 754 functions.
-  void VisitFloat64Ieee754Binop(Node*, InstructionCode code);
-  void VisitFloat64Ieee754Unop(Node*, InstructionCode code);
-
-#define DECLARE_GENERATOR(x) void Visit##x(Node* node);
-  MACHINE_OP_LIST(DECLARE_GENERATOR)
-  MACHINE_SIMD_OP_LIST(DECLARE_GENERATOR)
-#undef DECLARE_GENERATOR
-
-  void VisitFinishRegion(Node* node);
-  void VisitParameter(Node* node);
-  void VisitIfException(Node* node);
-  void VisitOsrValue(Node* node);
-  void VisitPhi(Node* node);
-  void VisitProjection(Node* node);
-  void VisitConstant(Node* node);
-  void VisitCall(Node* call, BasicBlock* handler = nullptr);
-  void VisitCallWithCallerSavedRegisters(Node* call,
-                                         BasicBlock* handler = nullptr);
-  void VisitDeoptimizeIf(Node* node);
-  void VisitDeoptimizeUnless(Node* node);
-  void VisitTrapIf(Node* node, Runtime::FunctionId func_id);
-  void VisitTrapUnless(Node* node, Runtime::FunctionId func_id);
-  void VisitTailCall(Node* call);
-  void VisitGoto(BasicBlock* target);
-  void VisitBranch(Node* input, BasicBlock* tbranch, BasicBlock* fbranch);
-  void VisitSwitch(Node* node, const SwitchInfo& sw);
-  void VisitDeoptimize(DeoptimizeKind kind, DeoptimizeReason reason,
-                       VectorSlotPair const& feedback, Node* value);
-  void VisitReturn(Node* ret);
-  void VisitThrow(Node* node);
-  void VisitRetain(Node* node);
-  void VisitUnreachable(Node* node);
-  void VisitDeadValue(Node* node);
-
-  void EmitPrepareArguments(ZoneVector<compiler::PushParameter>* arguments,
-                            const CallDescriptor* descriptor, Node* node);
-  void EmitPrepareResults(ZoneVector<compiler::PushParameter>* results,
-                          const CallDescriptor* descriptor, Node* node);
-
-  void EmitIdentity(Node* node);
-  bool CanProduceSignalingNaN(Node* node);
-
-  // ===========================================================================
-  // ============= Vector instruction (SIMD) helper fns. =======================
-  // ===========================================================================
-
-  // Tries to match a byte shuffle to a scalar splat operation. Returns the
-  // index of the lane if successful.
-  template <int LANES>
-  static bool TryMatchDup(const uint8_t* shuffle, int* index) {
-    const int kBytesPerLane = kSimd128Size / LANES;
-    // Get the first lane's worth of bytes and check that indices start at a
-    // lane boundary and are consecutive.
-    uint8_t lane0[kBytesPerLane];
-    lane0[0] = shuffle[0];
-    if (lane0[0] % kBytesPerLane != 0) return false;
-    for (int i = 1; i < kBytesPerLane; ++i) {
-      lane0[i] = shuffle[i];
-      if (lane0[i] != lane0[0] + i) return false;
-    }
-    // Now check that the other lanes are identical to lane0.
-    for (int i = 1; i < LANES; ++i) {
-      for (int j = 0; j < kBytesPerLane; ++j) {
-        if (lane0[j] != shuffle[i * kBytesPerLane + j]) return false;
-      }
-    }
-    *index = lane0[0] / kBytesPerLane;
-    return true;
-  }
-
-  // Tries to match 8x16 byte shuffle to an equivalent 32x4 word shuffle. If
-  // successful, it writes the 32x4 shuffle word indices.
-  static bool TryMatch32x4Shuffle(const uint8_t* shuffle, uint8_t* shuffle32x4);
-
-  // Tries to match a byte shuffle to a concatenate operation. If successful,
-  // it writes the byte offset.
-  static bool TryMatchConcat(const uint8_t* shuffle, uint8_t mask,
-                             uint8_t* offset);
-
-  // Packs 4 bytes of shuffle into a 32 bit immediate, using a mask from
-  // CanonicalizeShuffle to convert unary shuffles.
-  static int32_t Pack4Lanes(const uint8_t* shuffle, uint8_t mask);
-
-  // Canonicalize shuffles to make pattern matching simpler. Returns a mask that
-  // will ignore the high bit of indices if shuffle is unary.
-  uint8_t CanonicalizeShuffle(Node* node);
-
-  // ===========================================================================
-
-  Schedule* schedule() const { return schedule_; }
-  Linkage* linkage() const { return linkage_; }
-  InstructionSequence* sequence() const { return sequence_; }
-  Zone* instruction_zone() const { return sequence()->zone(); }
-  Zone* zone() const { return zone_; }
-
-  void set_instruction_selection_failed() {
-    instruction_selection_failed_ = true;
-  }
-  bool instruction_selection_failed() { return instruction_selection_failed_; }
-
-  void MarkPairProjectionsAsWord32(Node* node);
-  bool IsSourcePositionUsed(Node* node);
-  void VisitAtomicBinaryOperation(Node* node, ArchOpcode int8_op,
-                                  ArchOpcode uint8_op, ArchOpcode int16_op,
-                                  ArchOpcode uint16_op, ArchOpcode word32_op);
-
-  // ===========================================================================
-
-  Zone* const zone_;
-  Linkage* const linkage_;
-  InstructionSequence* const sequence_;
-  SourcePositionTable* const source_positions_;
-  SourcePositionMode const source_position_mode_;
-  Features features_;
-  Schedule* const schedule_;
-  BasicBlock* current_block_;
-  ZoneVector<Instruction*> instructions_;
-  BoolVector defined_;
-  BoolVector used_;
-  IntVector effect_level_;
-  IntVector virtual_registers_;
-  IntVector virtual_register_rename_;
-  InstructionScheduler* scheduler_;
-  EnableScheduling enable_scheduling_;
-  EnableSerialization enable_serialization_;
-  Frame* frame_;
-  bool instruction_selection_failed_;
-};
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_COMPILER_INSTRUCTION_SELECTOR_H_
diff --git a/src/v8/src/compiler/instruction.cc b/src/v8/src/compiler/instruction.cc
deleted file mode 100644
index a43f6ac..0000000
--- a/src/v8/src/compiler/instruction.cc
+++ /dev/null
@@ -1,1098 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/compiler/instruction.h"
-
-#include "src/compiler/common-operator.h"
-#include "src/compiler/graph.h"
-#include "src/compiler/schedule.h"
-#include "src/compiler/state-values-utils.h"
-#include "src/source-position.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-const RegisterConfiguration* (*GetRegConfig)() = RegisterConfiguration::Default;
-
-FlagsCondition CommuteFlagsCondition(FlagsCondition condition) {
-  switch (condition) {
-    case kSignedLessThan:
-      return kSignedGreaterThan;
-    case kSignedGreaterThanOrEqual:
-      return kSignedLessThanOrEqual;
-    case kSignedLessThanOrEqual:
-      return kSignedGreaterThanOrEqual;
-    case kSignedGreaterThan:
-      return kSignedLessThan;
-    case kUnsignedLessThan:
-      return kUnsignedGreaterThan;
-    case kUnsignedGreaterThanOrEqual:
-      return kUnsignedLessThanOrEqual;
-    case kUnsignedLessThanOrEqual:
-      return kUnsignedGreaterThanOrEqual;
-    case kUnsignedGreaterThan:
-      return kUnsignedLessThan;
-    case kFloatLessThanOrUnordered:
-      return kFloatGreaterThanOrUnordered;
-    case kFloatGreaterThanOrEqual:
-      return kFloatLessThanOrEqual;
-    case kFloatLessThanOrEqual:
-      return kFloatGreaterThanOrEqual;
-    case kFloatGreaterThanOrUnordered:
-      return kFloatLessThanOrUnordered;
-    case kFloatLessThan:
-      return kFloatGreaterThan;
-    case kFloatGreaterThanOrEqualOrUnordered:
-      return kFloatLessThanOrEqualOrUnordered;
-    case kFloatLessThanOrEqualOrUnordered:
-      return kFloatGreaterThanOrEqualOrUnordered;
-    case kFloatGreaterThan:
-      return kFloatLessThan;
-    case kPositiveOrZero:
-    case kNegative:
-      UNREACHABLE();
-      break;
-    case kEqual:
-    case kNotEqual:
-    case kOverflow:
-    case kNotOverflow:
-    case kUnorderedEqual:
-    case kUnorderedNotEqual:
-      return condition;
-  }
-  UNREACHABLE();
-}
-
-bool InstructionOperand::InterferesWith(const InstructionOperand& other) const {
-  if (kSimpleFPAliasing || !this->IsFPLocationOperand() ||
-      !other.IsFPLocationOperand())
-    return EqualsCanonicalized(other);
-  // Aliasing is complex and both operands are fp locations.
-  const LocationOperand& loc = *LocationOperand::cast(this);
-  const LocationOperand& other_loc = LocationOperand::cast(other);
-  LocationOperand::LocationKind kind = loc.location_kind();
-  LocationOperand::LocationKind other_kind = other_loc.location_kind();
-  if (kind != other_kind) return false;
-  MachineRepresentation rep = loc.representation();
-  MachineRepresentation other_rep = other_loc.representation();
-  if (rep == other_rep) return EqualsCanonicalized(other);
-  if (kind == LocationOperand::REGISTER) {
-    // FP register-register interference.
-    return GetRegConfig()->AreAliases(rep, loc.register_code(), other_rep,
-                                      other_loc.register_code());
-  } else {
-    // FP slot-slot interference. Slots of different FP reps can alias because
-    // the gap resolver may break a move into 2 or 4 equivalent smaller moves.
-    DCHECK_EQ(LocationOperand::STACK_SLOT, kind);
-    int index_hi = loc.index();
-    int index_lo = index_hi - (1 << ElementSizeLog2Of(rep)) / kPointerSize + 1;
-    int other_index_hi = other_loc.index();
-    int other_index_lo =
-        other_index_hi - (1 << ElementSizeLog2Of(other_rep)) / kPointerSize + 1;
-    return other_index_hi >= index_lo && index_hi >= other_index_lo;
-  }
-  return false;
-}
-
-void InstructionOperand::Print(const RegisterConfiguration* config) const {
-#ifndef V8_OS_STARBOARD
-  OFStream os(stdout);
-  PrintableInstructionOperand wrapper;
-  wrapper.register_configuration_ = config;
-  wrapper.op_ = *this;
-  os << wrapper << std::endl;
-#endif
-}
-
-void InstructionOperand::Print() const { Print(GetRegConfig()); }
-
-std::ostream& operator<<(std::ostream& os,
-                         const PrintableInstructionOperand& printable) {
-  const InstructionOperand& op = printable.op_;
-  const RegisterConfiguration* conf = printable.register_configuration_;
-  switch (op.kind()) {
-    case InstructionOperand::UNALLOCATED: {
-      const UnallocatedOperand* unalloc = UnallocatedOperand::cast(&op);
-      os << "v" << unalloc->virtual_register();
-      if (unalloc->basic_policy() == UnallocatedOperand::FIXED_SLOT) {
-        return os << "(=" << unalloc->fixed_slot_index() << "S)";
-      }
-      switch (unalloc->extended_policy()) {
-        case UnallocatedOperand::NONE:
-          return os;
-        case UnallocatedOperand::FIXED_REGISTER:
-          return os << "(="
-                    << conf->GetGeneralRegisterName(
-                           unalloc->fixed_register_index())
-                    << ")";
-        case UnallocatedOperand::FIXED_FP_REGISTER:
-          return os << "(="
-                    << conf->GetDoubleRegisterName(
-                           unalloc->fixed_register_index())
-                    << ")";
-        case UnallocatedOperand::MUST_HAVE_REGISTER:
-          return os << "(R)";
-        case UnallocatedOperand::MUST_HAVE_SLOT:
-          return os << "(S)";
-        case UnallocatedOperand::SAME_AS_FIRST_INPUT:
-          return os << "(1)";
-        case UnallocatedOperand::ANY:
-          return os << "(-)";
-      }
-    }
-    case InstructionOperand::CONSTANT:
-      return os << "[constant:" << ConstantOperand::cast(op).virtual_register()
-                << "]";
-    case InstructionOperand::IMMEDIATE: {
-      ImmediateOperand imm = ImmediateOperand::cast(op);
-      switch (imm.type()) {
-        case ImmediateOperand::INLINE:
-          return os << "#" << imm.inline_value();
-        case ImmediateOperand::INDEXED:
-          return os << "[immediate:" << imm.indexed_value() << "]";
-      }
-    }
-    case InstructionOperand::EXPLICIT:
-    case InstructionOperand::ALLOCATED: {
-      LocationOperand allocated = LocationOperand::cast(op);
-      if (op.IsStackSlot()) {
-        os << "[stack:" << allocated.index();
-      } else if (op.IsFPStackSlot()) {
-        os << "[fp_stack:" << allocated.index();
-      } else if (op.IsRegister()) {
-        os << "["
-           << GetRegConfig()->GetGeneralRegisterName(allocated.register_code())
-           << "|R";
-      } else if (op.IsDoubleRegister()) {
-        os << "["
-           << GetRegConfig()->GetDoubleRegisterName(allocated.register_code())
-           << "|R";
-      } else if (op.IsFloatRegister()) {
-        os << "["
-           << GetRegConfig()->GetFloatRegisterName(allocated.register_code())
-           << "|R";
-      } else {
-        DCHECK(op.IsSimd128Register());
-        os << "["
-           << GetRegConfig()->GetSimd128RegisterName(allocated.register_code())
-           << "|R";
-      }
-      if (allocated.IsExplicit()) {
-        os << "|E";
-      }
-      switch (allocated.representation()) {
-        case MachineRepresentation::kNone:
-          os << "|-";
-          break;
-        case MachineRepresentation::kBit:
-          os << "|b";
-          break;
-        case MachineRepresentation::kWord8:
-          os << "|w8";
-          break;
-        case MachineRepresentation::kWord16:
-          os << "|w16";
-          break;
-        case MachineRepresentation::kWord32:
-          os << "|w32";
-          break;
-        case MachineRepresentation::kWord64:
-          os << "|w64";
-          break;
-        case MachineRepresentation::kFloat32:
-          os << "|f32";
-          break;
-        case MachineRepresentation::kFloat64:
-          os << "|f64";
-          break;
-        case MachineRepresentation::kSimd128:
-          os << "|s128";
-          break;
-        case MachineRepresentation::kTaggedSigned:
-          os << "|ts";
-          break;
-        case MachineRepresentation::kTaggedPointer:
-          os << "|tp";
-          break;
-        case MachineRepresentation::kTagged:
-          os << "|t";
-          break;
-      }
-      return os << "]";
-    }
-    case InstructionOperand::INVALID:
-      return os << "(x)";
-  }
-  UNREACHABLE();
-}
-
-void MoveOperands::Print(const RegisterConfiguration* config) const {
-#ifndef V8_OS_STARBOARD
-  OFStream os(stdout);
-  PrintableInstructionOperand wrapper;
-  wrapper.register_configuration_ = config;
-  wrapper.op_ = destination();
-  os << wrapper << " = ";
-  wrapper.op_ = source();
-  os << wrapper << std::endl;
-#endif
-}
-
-void MoveOperands::Print() const { Print(GetRegConfig()); }
-
-std::ostream& operator<<(std::ostream& os,
-                         const PrintableMoveOperands& printable) {
-  const MoveOperands& mo = *printable.move_operands_;
-  PrintableInstructionOperand printable_op = {printable.register_configuration_,
-                                              mo.destination()};
-  os << printable_op;
-  if (!mo.source().Equals(mo.destination())) {
-    printable_op.op_ = mo.source();
-    os << " = " << printable_op;
-  }
-  return os << ";";
-}
-
-
-bool ParallelMove::IsRedundant() const {
-  for (MoveOperands* move : *this) {
-    if (!move->IsRedundant()) return false;
-  }
-  return true;
-}
-
-void ParallelMove::PrepareInsertAfter(
-    MoveOperands* move, ZoneVector<MoveOperands*>* to_eliminate) const {
-  bool no_aliasing =
-      kSimpleFPAliasing || !move->destination().IsFPLocationOperand();
-  MoveOperands* replacement = nullptr;
-  MoveOperands* eliminated = nullptr;
-  for (MoveOperands* curr : *this) {
-    if (curr->IsEliminated()) continue;
-    if (curr->destination().EqualsCanonicalized(move->source())) {
-      // We must replace move's source with curr's destination in order to
-      // insert it into this ParallelMove.
-      DCHECK(!replacement);
-      replacement = curr;
-      if (no_aliasing && eliminated != nullptr) break;
-    } else if (curr->destination().InterferesWith(move->destination())) {
-      // We can eliminate curr, since move overwrites at least a part of its
-      // destination, implying its value is no longer live.
-      eliminated = curr;
-      to_eliminate->push_back(curr);
-      if (no_aliasing && replacement != nullptr) break;
-    }
-  }
-  if (replacement != nullptr) move->set_source(replacement->source());
-}
-
-ExplicitOperand::ExplicitOperand(LocationKind kind, MachineRepresentation rep,
-                                 int index)
-    : LocationOperand(EXPLICIT, kind, rep, index) {
-  DCHECK_IMPLIES(kind == REGISTER && !IsFloatingPoint(rep),
-                 GetRegConfig()->IsAllocatableGeneralCode(index));
-  DCHECK_IMPLIES(kind == REGISTER && rep == MachineRepresentation::kFloat32,
-                 GetRegConfig()->IsAllocatableFloatCode(index));
-  DCHECK_IMPLIES(kind == REGISTER && (rep == MachineRepresentation::kFloat64),
-                 GetRegConfig()->IsAllocatableDoubleCode(index));
-}
-
-Instruction::Instruction(InstructionCode opcode)
-    : opcode_(opcode),
-      bit_field_(OutputCountField::encode(0) | InputCountField::encode(0) |
-                 TempCountField::encode(0) | IsCallField::encode(false)),
-      reference_map_(nullptr),
-      block_(nullptr) {
-  parallel_moves_[0] = nullptr;
-  parallel_moves_[1] = nullptr;
-}
-
-Instruction::Instruction(InstructionCode opcode, size_t output_count,
-                         InstructionOperand* outputs, size_t input_count,
-                         InstructionOperand* inputs, size_t temp_count,
-                         InstructionOperand* temps)
-    : opcode_(opcode),
-      bit_field_(OutputCountField::encode(output_count) |
-                 InputCountField::encode(input_count) |
-                 TempCountField::encode(temp_count) |
-                 IsCallField::encode(false)),
-      reference_map_(nullptr),
-      block_(nullptr) {
-  parallel_moves_[0] = nullptr;
-  parallel_moves_[1] = nullptr;
-  size_t offset = 0;
-  for (size_t i = 0; i < output_count; ++i) {
-    DCHECK(!outputs[i].IsInvalid());
-    operands_[offset++] = outputs[i];
-  }
-  for (size_t i = 0; i < input_count; ++i) {
-    DCHECK(!inputs[i].IsInvalid());
-    operands_[offset++] = inputs[i];
-  }
-  for (size_t i = 0; i < temp_count; ++i) {
-    DCHECK(!temps[i].IsInvalid());
-    operands_[offset++] = temps[i];
-  }
-}
-
-
-bool Instruction::AreMovesRedundant() const {
-  for (int i = Instruction::FIRST_GAP_POSITION;
-       i <= Instruction::LAST_GAP_POSITION; i++) {
-    if (parallel_moves_[i] != nullptr && !parallel_moves_[i]->IsRedundant()) {
-      return false;
-    }
-  }
-  return true;
-}
-
-void Instruction::Print(const RegisterConfiguration* config) const {
-#ifndef V8_OS_STARBOARD
-  OFStream os(stdout);
-  PrintableInstruction wrapper;
-  wrapper.instr_ = this;
-  wrapper.register_configuration_ = config;
-  os << wrapper << std::endl;
-#endif
-}
-
-void Instruction::Print() const { Print(GetRegConfig()); }
-
-std::ostream& operator<<(std::ostream& os,
-                         const PrintableParallelMove& printable) {
-  const ParallelMove& pm = *printable.parallel_move_;
-  bool first = true;
-  for (MoveOperands* move : pm) {
-    if (move->IsEliminated()) continue;
-    if (!first) os << " ";
-    first = false;
-    PrintableMoveOperands pmo = {printable.register_configuration_, move};
-    os << pmo;
-  }
-  return os;
-}
-
-
-void ReferenceMap::RecordReference(const AllocatedOperand& op) {
-  // Do not record arguments as pointers.
-  if (op.IsStackSlot() && LocationOperand::cast(op).index() < 0) return;
-  DCHECK(!op.IsFPRegister() && !op.IsFPStackSlot());
-  reference_operands_.push_back(op);
-}
-
-
-std::ostream& operator<<(std::ostream& os, const ReferenceMap& pm) {
-  os << "{";
-  bool first = true;
-  PrintableInstructionOperand poi = {GetRegConfig(), InstructionOperand()};
-  for (const InstructionOperand& op : pm.reference_operands_) {
-    if (!first) {
-      os << ";";
-    } else {
-      first = false;
-    }
-    poi.op_ = op;
-    os << poi;
-  }
-  return os << "}";
-}
-
-
-std::ostream& operator<<(std::ostream& os, const ArchOpcode& ao) {
-  switch (ao) {
-#define CASE(Name) \
-  case k##Name:    \
-    return os << #Name;
-    ARCH_OPCODE_LIST(CASE)
-#undef CASE
-  }
-  UNREACHABLE();
-}
-
-
-std::ostream& operator<<(std::ostream& os, const AddressingMode& am) {
-  switch (am) {
-    case kMode_None:
-      return os;
-#define CASE(Name)   \
-  case kMode_##Name: \
-    return os << #Name;
-      TARGET_ADDRESSING_MODE_LIST(CASE)
-#undef CASE
-  }
-  UNREACHABLE();
-}
-
-
-std::ostream& operator<<(std::ostream& os, const FlagsMode& fm) {
-  switch (fm) {
-    case kFlags_none:
-      return os;
-    case kFlags_branch:
-      return os << "branch";
-    case kFlags_deoptimize:
-      return os << "deoptimize";
-    case kFlags_set:
-      return os << "set";
-    case kFlags_trap:
-      return os << "trap";
-  }
-  UNREACHABLE();
-}
-
-
-std::ostream& operator<<(std::ostream& os, const FlagsCondition& fc) {
-  switch (fc) {
-    case kEqual:
-      return os << "equal";
-    case kNotEqual:
-      return os << "not equal";
-    case kSignedLessThan:
-      return os << "signed less than";
-    case kSignedGreaterThanOrEqual:
-      return os << "signed greater than or equal";
-    case kSignedLessThanOrEqual:
-      return os << "signed less than or equal";
-    case kSignedGreaterThan:
-      return os << "signed greater than";
-    case kUnsignedLessThan:
-      return os << "unsigned less than";
-    case kUnsignedGreaterThanOrEqual:
-      return os << "unsigned greater than or equal";
-    case kUnsignedLessThanOrEqual:
-      return os << "unsigned less than or equal";
-    case kUnsignedGreaterThan:
-      return os << "unsigned greater than";
-    case kFloatLessThanOrUnordered:
-      return os << "less than or unordered (FP)";
-    case kFloatGreaterThanOrEqual:
-      return os << "greater than or equal (FP)";
-    case kFloatLessThanOrEqual:
-      return os << "less than or equal (FP)";
-    case kFloatGreaterThanOrUnordered:
-      return os << "greater than or unordered (FP)";
-    case kFloatLessThan:
-      return os << "less than (FP)";
-    case kFloatGreaterThanOrEqualOrUnordered:
-      return os << "greater than, equal or unordered (FP)";
-    case kFloatLessThanOrEqualOrUnordered:
-      return os << "less than, equal or unordered (FP)";
-    case kFloatGreaterThan:
-      return os << "greater than (FP)";
-    case kUnorderedEqual:
-      return os << "unordered equal";
-    case kUnorderedNotEqual:
-      return os << "unordered not equal";
-    case kOverflow:
-      return os << "overflow";
-    case kNotOverflow:
-      return os << "not overflow";
-    case kPositiveOrZero:
-      return os << "positive or zero";
-    case kNegative:
-      return os << "negative";
-  }
-  UNREACHABLE();
-}
-
-
-std::ostream& operator<<(std::ostream& os,
-                         const PrintableInstruction& printable) {
-  const Instruction& instr = *printable.instr_;
-  PrintableInstructionOperand printable_op = {printable.register_configuration_,
-                                              InstructionOperand()};
-  os << "gap ";
-  for (int i = Instruction::FIRST_GAP_POSITION;
-       i <= Instruction::LAST_GAP_POSITION; i++) {
-    os << "(";
-    if (instr.parallel_moves()[i] != nullptr) {
-      PrintableParallelMove ppm = {printable.register_configuration_,
-                                   instr.parallel_moves()[i]};
-      os << ppm;
-    }
-    os << ") ";
-  }
-  os << "\n          ";
-
-  if (instr.OutputCount() > 1) os << "(";
-  for (size_t i = 0; i < instr.OutputCount(); i++) {
-    if (i > 0) os << ", ";
-    printable_op.op_ = *instr.OutputAt(i);
-    os << printable_op;
-  }
-
-  if (instr.OutputCount() > 1) os << ") = ";
-  if (instr.OutputCount() == 1) os << " = ";
-
-  os << ArchOpcodeField::decode(instr.opcode());
-  AddressingMode am = AddressingModeField::decode(instr.opcode());
-  if (am != kMode_None) {
-    os << " : " << AddressingModeField::decode(instr.opcode());
-  }
-  FlagsMode fm = FlagsModeField::decode(instr.opcode());
-  if (fm != kFlags_none) {
-    os << " && " << fm << " if " << FlagsConditionField::decode(instr.opcode());
-  }
-  if (instr.InputCount() > 0) {
-    for (size_t i = 0; i < instr.InputCount(); i++) {
-      printable_op.op_ = *instr.InputAt(i);
-      os << " " << printable_op;
-    }
-  }
-  return os;
-}
-
-
-Constant::Constant(int32_t v) : type_(kInt32), value_(v) {}
-
-Constant::Constant(RelocatablePtrConstantInfo info) {
-  if (info.type() == RelocatablePtrConstantInfo::kInt32) {
-    type_ = kInt32;
-  } else if (info.type() == RelocatablePtrConstantInfo::kInt64) {
-    type_ = kInt64;
-  } else {
-    UNREACHABLE();
-  }
-  value_ = info.value();
-  rmode_ = info.rmode();
-}
-
-Handle<HeapObject> Constant::ToHeapObject() const {
-  DCHECK_EQ(kHeapObject, type());
-  Handle<HeapObject> value(
-      bit_cast<HeapObject**>(static_cast<intptr_t>(value_)));
-  return value;
-}
-
-Handle<Code> Constant::ToCode() const {
-  DCHECK_EQ(kHeapObject, type());
-  Handle<Code> value(bit_cast<Code**>(static_cast<intptr_t>(value_)));
-  return value;
-}
-
-std::ostream& operator<<(std::ostream& os, const Constant& constant) {
-  switch (constant.type()) {
-    case Constant::kInt32:
-      return os << constant.ToInt32();
-    case Constant::kInt64:
-      return os << constant.ToInt64() << "l";
-    case Constant::kFloat32:
-      return os << constant.ToFloat32() << "f";
-    case Constant::kFloat64:
-      return os << constant.ToFloat64().value();
-    case Constant::kExternalReference:
-      return os << static_cast<const void*>(
-                       constant.ToExternalReference().address());
-    case Constant::kHeapObject:
-      return os << Brief(*constant.ToHeapObject());
-    case Constant::kRpoNumber:
-      return os << "RPO" << constant.ToRpoNumber().ToInt();
-  }
-  UNREACHABLE();
-}
-
-
-PhiInstruction::PhiInstruction(Zone* zone, int virtual_register,
-                               size_t input_count)
-    : virtual_register_(virtual_register),
-      output_(UnallocatedOperand(UnallocatedOperand::NONE, virtual_register)),
-      operands_(input_count, InstructionOperand::kInvalidVirtualRegister,
-                zone) {}
-
-
-void PhiInstruction::SetInput(size_t offset, int virtual_register) {
-  DCHECK_EQ(InstructionOperand::kInvalidVirtualRegister, operands_[offset]);
-  operands_[offset] = virtual_register;
-}
-
-void PhiInstruction::RenameInput(size_t offset, int virtual_register) {
-  DCHECK_NE(InstructionOperand::kInvalidVirtualRegister, operands_[offset]);
-  operands_[offset] = virtual_register;
-}
-
-InstructionBlock::InstructionBlock(Zone* zone, RpoNumber rpo_number,
-                                   RpoNumber loop_header, RpoNumber loop_end,
-                                   bool deferred, bool handler)
-    : successors_(zone),
-      predecessors_(zone),
-      phis_(zone),
-      ao_number_(rpo_number),
-      rpo_number_(rpo_number),
-      loop_header_(loop_header),
-      loop_end_(loop_end),
-      code_start_(-1),
-      code_end_(-1),
-      deferred_(deferred),
-      handler_(handler),
-      needs_frame_(false),
-      must_construct_frame_(false),
-      must_deconstruct_frame_(false) {}
-
-size_t InstructionBlock::PredecessorIndexOf(RpoNumber rpo_number) const {
-  size_t j = 0;
-  for (InstructionBlock::Predecessors::const_iterator i = predecessors_.begin();
-       i != predecessors_.end(); ++i, ++j) {
-    if (*i == rpo_number) break;
-  }
-  return j;
-}
-
-
-static RpoNumber GetRpo(const BasicBlock* block) {
-  if (block == nullptr) return RpoNumber::Invalid();
-  return RpoNumber::FromInt(block->rpo_number());
-}
-
-
-static RpoNumber GetLoopEndRpo(const BasicBlock* block) {
-  if (!block->IsLoopHeader()) return RpoNumber::Invalid();
-  return RpoNumber::FromInt(block->loop_end()->rpo_number());
-}
-
-
-static InstructionBlock* InstructionBlockFor(Zone* zone,
-                                             const BasicBlock* block) {
-  bool is_handler =
-      !block->empty() && block->front()->opcode() == IrOpcode::kIfException;
-  InstructionBlock* instr_block = new (zone)
-      InstructionBlock(zone, GetRpo(block), GetRpo(block->loop_header()),
-                       GetLoopEndRpo(block), block->deferred(), is_handler);
-  // Map successors and precessors
-  instr_block->successors().reserve(block->SuccessorCount());
-  for (BasicBlock* successor : block->successors()) {
-    instr_block->successors().push_back(GetRpo(successor));
-  }
-  instr_block->predecessors().reserve(block->PredecessorCount());
-  for (BasicBlock* predecessor : block->predecessors()) {
-    instr_block->predecessors().push_back(GetRpo(predecessor));
-  }
-  return instr_block;
-}
-
-std::ostream& operator<<(std::ostream& os,
-                         PrintableInstructionBlock& printable_block) {
-  const InstructionBlock* block = printable_block.block_;
-  const RegisterConfiguration* config = printable_block.register_configuration_;
-  const InstructionSequence* code = printable_block.code_;
-
-  os << "B" << block->rpo_number();
-  os << ": AO#" << block->ao_number();
-  if (block->IsDeferred()) os << " (deferred)";
-  if (!block->needs_frame()) os << " (no frame)";
-  if (block->must_construct_frame()) os << " (construct frame)";
-  if (block->must_deconstruct_frame()) os << " (deconstruct frame)";
-  if (block->IsLoopHeader()) {
-    os << " loop blocks: [" << block->rpo_number() << ", " << block->loop_end()
-       << ")";
-  }
-  os << "  instructions: [" << block->code_start() << ", " << block->code_end()
-     << ")" << std::endl
-     << " predecessors:";
-
-  for (RpoNumber pred : block->predecessors()) {
-    os << " B" << pred.ToInt();
-  }
-  os << std::endl;
-
-  for (const PhiInstruction* phi : block->phis()) {
-    PrintableInstructionOperand printable_op = {config, phi->output()};
-    os << "     phi: " << printable_op << " =";
-    for (int input : phi->operands()) {
-      os << " v" << input;
-    }
-    os << std::endl;
-  }
-
-  ScopedVector<char> buf(32);
-  PrintableInstruction printable_instr;
-  printable_instr.register_configuration_ = config;
-  for (int j = block->first_instruction_index();
-       j <= block->last_instruction_index(); j++) {
-    // TODO(svenpanne) Add some basic formatting to our streams.
-    SNPrintF(buf, "%5d", j);
-    printable_instr.instr_ = code->InstructionAt(j);
-    os << "   " << buf.start() << ": " << printable_instr << std::endl;
-  }
-
-  for (RpoNumber succ : block->successors()) {
-    os << " B" << succ.ToInt();
-  }
-  os << std::endl;
-  return os;
-}
-
-InstructionBlocks* InstructionSequence::InstructionBlocksFor(
-    Zone* zone, const Schedule* schedule) {
-  InstructionBlocks* blocks = zone->NewArray<InstructionBlocks>(1);
-  new (blocks) InstructionBlocks(
-      static_cast<int>(schedule->rpo_order()->size()), nullptr, zone);
-  size_t rpo_number = 0;
-  for (BasicBlockVector::const_iterator it = schedule->rpo_order()->begin();
-       it != schedule->rpo_order()->end(); ++it, ++rpo_number) {
-    DCHECK(!(*blocks)[rpo_number]);
-    DCHECK(GetRpo(*it).ToSize() == rpo_number);
-    (*blocks)[rpo_number] = InstructionBlockFor(zone, *it);
-  }
-  ComputeAssemblyOrder(blocks);
-  return blocks;
-}
-
-void InstructionSequence::ValidateEdgeSplitForm() const {
-  // Validate blocks are in edge-split form: no block with multiple successors
-  // has an edge to a block (== a successor) with more than one predecessors.
-  for (const InstructionBlock* block : instruction_blocks()) {
-    if (block->SuccessorCount() > 1) {
-      for (const RpoNumber& successor_id : block->successors()) {
-        const InstructionBlock* successor = InstructionBlockAt(successor_id);
-        // Expect precisely one predecessor: "block".
-        CHECK(successor->PredecessorCount() == 1 &&
-              successor->predecessors()[0] == block->rpo_number());
-      }
-    }
-  }
-}
-
-void InstructionSequence::ValidateDeferredBlockExitPaths() const {
-  // A deferred block with more than one successor must have all its successors
-  // deferred.
-  for (const InstructionBlock* block : instruction_blocks()) {
-    if (!block->IsDeferred() || block->SuccessorCount() <= 1) continue;
-    for (RpoNumber successor_id : block->successors()) {
-      CHECK(InstructionBlockAt(successor_id)->IsDeferred());
-    }
-  }
-}
-
-void InstructionSequence::ValidateDeferredBlockEntryPaths() const {
-  // If a deferred block has multiple predecessors, they have to
-  // all be deferred. Otherwise, we can run into a situation where a range
-  // that spills only in deferred blocks inserts its spill in the block, but
-  // other ranges need moves inserted by ResolveControlFlow in the predecessors,
-  // which may clobber the register of this range.
-  for (const InstructionBlock* block : instruction_blocks()) {
-    if (!block->IsDeferred() || block->PredecessorCount() <= 1) continue;
-    for (RpoNumber predecessor_id : block->predecessors()) {
-      CHECK(InstructionBlockAt(predecessor_id)->IsDeferred());
-    }
-  }
-}
-
-void InstructionSequence::ValidateSSA() const {
-  // TODO(mtrofin): We could use a local zone here instead.
-  BitVector definitions(VirtualRegisterCount(), zone());
-  for (const Instruction* instruction : *this) {
-    for (size_t i = 0; i < instruction->OutputCount(); ++i) {
-      const InstructionOperand* output = instruction->OutputAt(i);
-      int vreg = (output->IsConstant())
-                     ? ConstantOperand::cast(output)->virtual_register()
-                     : UnallocatedOperand::cast(output)->virtual_register();
-      CHECK(!definitions.Contains(vreg));
-      definitions.Add(vreg);
-    }
-  }
-}
-
-void InstructionSequence::ComputeAssemblyOrder(InstructionBlocks* blocks) {
-  int ao = 0;
-  for (InstructionBlock* const block : *blocks) {
-    if (!block->IsDeferred()) {
-      block->set_ao_number(RpoNumber::FromInt(ao++));
-    }
-  }
-  for (InstructionBlock* const block : *blocks) {
-    if (block->IsDeferred()) {
-      block->set_ao_number(RpoNumber::FromInt(ao++));
-    }
-  }
-}
-
-InstructionSequence::InstructionSequence(Isolate* isolate,
-                                         Zone* instruction_zone,
-                                         InstructionBlocks* instruction_blocks)
-    : isolate_(isolate),
-      zone_(instruction_zone),
-      instruction_blocks_(instruction_blocks),
-      source_positions_(zone()),
-      constants_(ConstantMap::key_compare(),
-                 ConstantMap::allocator_type(zone())),
-      immediates_(zone()),
-      instructions_(zone()),
-      next_virtual_register_(0),
-      reference_maps_(zone()),
-      representations_(zone()),
-      representation_mask_(0),
-      deoptimization_entries_(zone()),
-      current_block_(nullptr) {}
-
-int InstructionSequence::NextVirtualRegister() {
-  int virtual_register = next_virtual_register_++;
-  CHECK_NE(virtual_register, InstructionOperand::kInvalidVirtualRegister);
-  return virtual_register;
-}
-
-
-Instruction* InstructionSequence::GetBlockStart(RpoNumber rpo) const {
-  const InstructionBlock* block = InstructionBlockAt(rpo);
-  return InstructionAt(block->code_start());
-}
-
-
-void InstructionSequence::StartBlock(RpoNumber rpo) {
-  DCHECK_NULL(current_block_);
-  current_block_ = InstructionBlockAt(rpo);
-  int code_start = static_cast<int>(instructions_.size());
-  current_block_->set_code_start(code_start);
-}
-
-
-void InstructionSequence::EndBlock(RpoNumber rpo) {
-  int end = static_cast<int>(instructions_.size());
-  DCHECK_EQ(current_block_->rpo_number(), rpo);
-  if (current_block_->code_start() == end) {  // Empty block.  Insert a nop.
-    AddInstruction(Instruction::New(zone(), kArchNop));
-    end = static_cast<int>(instructions_.size());
-  }
-  DCHECK(current_block_->code_start() >= 0 &&
-         current_block_->code_start() < end);
-  current_block_->set_code_end(end);
-  current_block_ = nullptr;
-}
-
-
-int InstructionSequence::AddInstruction(Instruction* instr) {
-  DCHECK_NOT_NULL(current_block_);
-  int index = static_cast<int>(instructions_.size());
-  instr->set_block(current_block_);
-  instructions_.push_back(instr);
-  if (instr->NeedsReferenceMap()) {
-    DCHECK_NULL(instr->reference_map());
-    ReferenceMap* reference_map = new (zone()) ReferenceMap(zone());
-    reference_map->set_instruction_position(index);
-    instr->set_reference_map(reference_map);
-    reference_maps_.push_back(reference_map);
-  }
-  return index;
-}
-
-
-InstructionBlock* InstructionSequence::GetInstructionBlock(
-    int instruction_index) const {
-  return instructions()[instruction_index]->block();
-}
-
-
-static MachineRepresentation FilterRepresentation(MachineRepresentation rep) {
-  switch (rep) {
-    case MachineRepresentation::kBit:
-    case MachineRepresentation::kWord8:
-    case MachineRepresentation::kWord16:
-      return InstructionSequence::DefaultRepresentation();
-    case MachineRepresentation::kWord32:
-    case MachineRepresentation::kWord64:
-    case MachineRepresentation::kTaggedSigned:
-    case MachineRepresentation::kTaggedPointer:
-    case MachineRepresentation::kTagged:
-    case MachineRepresentation::kFloat32:
-    case MachineRepresentation::kFloat64:
-    case MachineRepresentation::kSimd128:
-      return rep;
-    case MachineRepresentation::kNone:
-      break;
-  }
-
-  UNREACHABLE();
-}
-
-
-MachineRepresentation InstructionSequence::GetRepresentation(
-    int virtual_register) const {
-  DCHECK_LE(0, virtual_register);
-  DCHECK_LT(virtual_register, VirtualRegisterCount());
-  if (virtual_register >= static_cast<int>(representations_.size())) {
-    return DefaultRepresentation();
-  }
-  return representations_[virtual_register];
-}
-
-
-void InstructionSequence::MarkAsRepresentation(MachineRepresentation rep,
-                                               int virtual_register) {
-  DCHECK_LE(0, virtual_register);
-  DCHECK_LT(virtual_register, VirtualRegisterCount());
-  if (virtual_register >= static_cast<int>(representations_.size())) {
-    representations_.resize(VirtualRegisterCount(), DefaultRepresentation());
-  }
-  rep = FilterRepresentation(rep);
-  DCHECK_IMPLIES(representations_[virtual_register] != rep,
-                 representations_[virtual_register] == DefaultRepresentation());
-  representations_[virtual_register] = rep;
-  representation_mask_ |= 1 << static_cast<int>(rep);
-}
-
-int InstructionSequence::AddDeoptimizationEntry(
-    FrameStateDescriptor* descriptor, DeoptimizeKind kind,
-    DeoptimizeReason reason, VectorSlotPair const& feedback) {
-  int deoptimization_id = static_cast<int>(deoptimization_entries_.size());
-  deoptimization_entries_.push_back(
-      DeoptimizationEntry(descriptor, kind, reason, feedback));
-  return deoptimization_id;
-}
-
-DeoptimizationEntry const& InstructionSequence::GetDeoptimizationEntry(
-    int state_id) {
-  return deoptimization_entries_[state_id];
-}
-
-
-RpoNumber InstructionSequence::InputRpo(Instruction* instr, size_t index) {
-  InstructionOperand* operand = instr->InputAt(index);
-  Constant constant =
-      operand->IsImmediate()
-          ? GetImmediate(ImmediateOperand::cast(operand))
-          : GetConstant(ConstantOperand::cast(operand)->virtual_register());
-  return constant.ToRpoNumber();
-}
-
-
-bool InstructionSequence::GetSourcePosition(const Instruction* instr,
-                                            SourcePosition* result) const {
-  auto it = source_positions_.find(instr);
-  if (it == source_positions_.end()) return false;
-  *result = it->second;
-  return true;
-}
-
-
-void InstructionSequence::SetSourcePosition(const Instruction* instr,
-                                            SourcePosition value) {
-  source_positions_.insert(std::make_pair(instr, value));
-}
-
-void InstructionSequence::Print(const RegisterConfiguration* config) const {
-#ifndef V8_OS_STARBOARD
-  OFStream os(stdout);
-  PrintableInstructionSequence wrapper;
-  wrapper.register_configuration_ = config;
-  wrapper.sequence_ = this;
-  os << wrapper << std::endl;
-#endif
-}
-
-void InstructionSequence::Print() const { Print(GetRegConfig()); }
-
-void InstructionSequence::PrintBlock(const RegisterConfiguration* config,
-                                     int block_id) const {
-#ifndef V8_OS_STARBOARD
-  OFStream os(stdout);
-  RpoNumber rpo = RpoNumber::FromInt(block_id);
-  const InstructionBlock* block = InstructionBlockAt(rpo);
-  CHECK(block->rpo_number() == rpo);
-  PrintableInstructionBlock printable_block = {config, block, this};
-  os << printable_block << std::endl;
-#endif
-}
-
-void InstructionSequence::PrintBlock(int block_id) const {
-  PrintBlock(GetRegConfig(), block_id);
-}
-
-const RegisterConfiguration*
-    InstructionSequence::registerConfigurationForTesting_ = nullptr;
-
-const RegisterConfiguration*
-InstructionSequence::RegisterConfigurationForTesting() {
-  DCHECK_NOT_NULL(registerConfigurationForTesting_);
-  return registerConfigurationForTesting_;
-}
-
-void InstructionSequence::SetRegisterConfigurationForTesting(
-    const RegisterConfiguration* regConfig) {
-  registerConfigurationForTesting_ = regConfig;
-  GetRegConfig = InstructionSequence::RegisterConfigurationForTesting;
-}
-
-FrameStateDescriptor::FrameStateDescriptor(
-    Zone* zone, FrameStateType type, BailoutId bailout_id,
-    OutputFrameStateCombine state_combine, size_t parameters_count,
-    size_t locals_count, size_t stack_count,
-    MaybeHandle<SharedFunctionInfo> shared_info,
-    FrameStateDescriptor* outer_state)
-    : type_(type),
-      bailout_id_(bailout_id),
-      frame_state_combine_(state_combine),
-      parameters_count_(parameters_count),
-      locals_count_(locals_count),
-      stack_count_(stack_count),
-      values_(zone),
-      shared_info_(shared_info),
-      outer_state_(outer_state) {}
-
-size_t FrameStateDescriptor::GetSize() const {
-  return 1 + parameters_count() + locals_count() + stack_count() +
-         (HasContext() ? 1 : 0);
-}
-
-
-size_t FrameStateDescriptor::GetTotalSize() const {
-  size_t total_size = 0;
-  for (const FrameStateDescriptor* iter = this; iter != nullptr;
-       iter = iter->outer_state_) {
-    total_size += iter->GetSize();
-  }
-  return total_size;
-}
-
-
-size_t FrameStateDescriptor::GetFrameCount() const {
-  size_t count = 0;
-  for (const FrameStateDescriptor* iter = this; iter != nullptr;
-       iter = iter->outer_state_) {
-    ++count;
-  }
-  return count;
-}
-
-
-size_t FrameStateDescriptor::GetJSFrameCount() const {
-  size_t count = 0;
-  for (const FrameStateDescriptor* iter = this; iter != nullptr;
-       iter = iter->outer_state_) {
-    if (FrameStateFunctionInfo::IsJSFunctionType(iter->type_)) {
-      ++count;
-    }
-  }
-  return count;
-}
-
-
-std::ostream& operator<<(std::ostream& os, const RpoNumber& rpo) {
-  return os << rpo.ToSize();
-}
-
-
-std::ostream& operator<<(std::ostream& os,
-                         const PrintableInstructionSequence& printable) {
-  const InstructionSequence& code = *printable.sequence_;
-  for (size_t i = 0; i < code.immediates_.size(); ++i) {
-    Constant constant = code.immediates_[i];
-    os << "IMM#" << i << ": " << constant << "\n";
-  }
-  int i = 0;
-  for (ConstantMap::const_iterator it = code.constants_.begin();
-       it != code.constants_.end(); ++i, ++it) {
-    os << "CST#" << i << ": v" << it->first << " = " << it->second << "\n";
-  }
-  PrintableInstructionBlock printable_block = {
-      printable.register_configuration_, nullptr, printable.sequence_};
-  for (int i = 0; i < code.InstructionBlockCount(); i++) {
-    printable_block.block_ = code.InstructionBlockAt(RpoNumber::FromInt(i));
-    os << printable_block;
-  }
-  return os;
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/instruction.h b/src/v8/src/compiler/instruction.h
deleted file mode 100644
index 7772f18..0000000
--- a/src/v8/src/compiler/instruction.h
+++ /dev/null
@@ -1,1671 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_INSTRUCTION_H_
-#define V8_COMPILER_INSTRUCTION_H_
-
-#include <deque>
-#include <iosfwd>
-#include <map>
-#include <set>
-
-#include "src/base/compiler-specific.h"
-#include "src/compiler/common-operator.h"
-#include "src/compiler/frame.h"
-#include "src/compiler/instruction-codes.h"
-#include "src/compiler/opcodes.h"
-#include "src/double.h"
-#include "src/globals.h"
-#include "src/macro-assembler.h"
-#include "src/register-configuration.h"
-#include "src/source-position.h"
-#include "src/zone/zone-allocator.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-class Schedule;
-class SourcePositionTable;
-
-class V8_EXPORT_PRIVATE InstructionOperand {
- public:
-  static const int kInvalidVirtualRegister = -1;
-
-  enum Kind {
-    INVALID,
-    UNALLOCATED,
-    CONSTANT,
-    IMMEDIATE,
-    // Location operand kinds.
-    EXPLICIT,
-    ALLOCATED,
-    FIRST_LOCATION_OPERAND_KIND = EXPLICIT
-    // Location operand kinds must be last.
-  };
-
-  InstructionOperand() : InstructionOperand(INVALID) {}
-
-  Kind kind() const { return KindField::decode(value_); }
-
-#define INSTRUCTION_OPERAND_PREDICATE(name, type) \
-  bool Is##name() const { return kind() == type; }
-  INSTRUCTION_OPERAND_PREDICATE(Invalid, INVALID)
-  // UnallocatedOperands are place-holder operands created before register
-  // allocation. They later are assigned registers and become AllocatedOperands.
-  INSTRUCTION_OPERAND_PREDICATE(Unallocated, UNALLOCATED)
-  // Constant operands participate in register allocation. They are allocated to
-  // registers but have a special "spilling" behavior. When a ConstantOperand
-  // value must be rematerialized, it is loaded from an immediate constant
-  // rather from an unspilled slot.
-  INSTRUCTION_OPERAND_PREDICATE(Constant, CONSTANT)
-  // ImmediateOperands do not participate in register allocation and are only
-  // embedded directly in instructions, e.g. small integers and on some
-  // platforms Objects.
-  INSTRUCTION_OPERAND_PREDICATE(Immediate, IMMEDIATE)
-  // ExplicitOperands do not participate in register allocation. They are
-  // created by the instruction selector for direct access to registers and
-  // stack slots, completely bypassing the register allocator. They are never
-  // associated with a virtual register
-  INSTRUCTION_OPERAND_PREDICATE(Explicit, EXPLICIT)
-  // AllocatedOperands are registers or stack slots that are assigned by the
-  // register allocator and are always associated with a virtual register.
-  INSTRUCTION_OPERAND_PREDICATE(Allocated, ALLOCATED)
-#undef INSTRUCTION_OPERAND_PREDICATE
-
-  inline bool IsAnyLocationOperand() const;
-  inline bool IsLocationOperand() const;
-  inline bool IsFPLocationOperand() const;
-  inline bool IsAnyRegister() const;
-  inline bool IsRegister() const;
-  inline bool IsFPRegister() const;
-  inline bool IsFloatRegister() const;
-  inline bool IsDoubleRegister() const;
-  inline bool IsSimd128Register() const;
-  inline bool IsAnyStackSlot() const;
-  inline bool IsStackSlot() const;
-  inline bool IsFPStackSlot() const;
-  inline bool IsFloatStackSlot() const;
-  inline bool IsDoubleStackSlot() const;
-  inline bool IsSimd128StackSlot() const;
-
-  template <typename SubKindOperand>
-  static SubKindOperand* New(Zone* zone, const SubKindOperand& op) {
-    void* buffer = zone->New(sizeof(op));
-    return new (buffer) SubKindOperand(op);
-  }
-
-  static void ReplaceWith(InstructionOperand* dest,
-                          const InstructionOperand* src) {
-    *dest = *src;
-  }
-
-  bool Equals(const InstructionOperand& that) const {
-    return this->value_ == that.value_;
-  }
-
-  bool Compare(const InstructionOperand& that) const {
-    return this->value_ < that.value_;
-  }
-
-  bool EqualsCanonicalized(const InstructionOperand& that) const {
-    return this->GetCanonicalizedValue() == that.GetCanonicalizedValue();
-  }
-
-  bool CompareCanonicalized(const InstructionOperand& that) const {
-    return this->GetCanonicalizedValue() < that.GetCanonicalizedValue();
-  }
-
-  bool InterferesWith(const InstructionOperand& other) const;
-
-  // APIs to aid debugging. For general-stream APIs, use operator<<
-  void Print(const RegisterConfiguration* config) const;
-  void Print() const;
-
- protected:
-  explicit InstructionOperand(Kind kind) : value_(KindField::encode(kind)) {}
-
-  inline uint64_t GetCanonicalizedValue() const;
-
-  class KindField : public BitField64<Kind, 0, 3> {};
-
-  uint64_t value_;
-};
-
-
-typedef ZoneVector<InstructionOperand> InstructionOperandVector;
-
-
-struct PrintableInstructionOperand {
-  const RegisterConfiguration* register_configuration_;
-  InstructionOperand op_;
-};
-
-
-std::ostream& operator<<(std::ostream& os,
-                         const PrintableInstructionOperand& op);
-
-
-#define INSTRUCTION_OPERAND_CASTS(OperandType, OperandKind)      \
-                                                                 \
-  static OperandType* cast(InstructionOperand* op) {             \
-    DCHECK_EQ(OperandKind, op->kind());                          \
-    return static_cast<OperandType*>(op);                        \
-  }                                                              \
-                                                                 \
-  static const OperandType* cast(const InstructionOperand* op) { \
-    DCHECK_EQ(OperandKind, op->kind());                          \
-    return static_cast<const OperandType*>(op);                  \
-  }                                                              \
-                                                                 \
-  static OperandType cast(const InstructionOperand& op) {        \
-    DCHECK_EQ(OperandKind, op.kind());                           \
-    return *static_cast<const OperandType*>(&op);                \
-  }
-
-class UnallocatedOperand final : public InstructionOperand {
- public:
-  enum BasicPolicy { FIXED_SLOT, EXTENDED_POLICY };
-
-  enum ExtendedPolicy {
-    NONE,
-    ANY,
-    FIXED_REGISTER,
-    FIXED_FP_REGISTER,
-    MUST_HAVE_REGISTER,
-    MUST_HAVE_SLOT,
-    SAME_AS_FIRST_INPUT
-  };
-
-  // Lifetime of operand inside the instruction.
-  enum Lifetime {
-    // USED_AT_START operand is guaranteed to be live only at instruction start.
-    // The register allocator is free to assign the same register to some other
-    // operand used inside instruction (i.e. temporary or output).
-    USED_AT_START,
-
-    // USED_AT_END operand is treated as live until the end of instruction.
-    // This means that register allocator will not reuse its register for any
-    // other operand inside instruction.
-    USED_AT_END
-  };
-
-  UnallocatedOperand(ExtendedPolicy policy, int virtual_register)
-      : UnallocatedOperand(virtual_register) {
-    value_ |= BasicPolicyField::encode(EXTENDED_POLICY);
-    value_ |= ExtendedPolicyField::encode(policy);
-    value_ |= LifetimeField::encode(USED_AT_END);
-  }
-
-  UnallocatedOperand(BasicPolicy policy, int index, int virtual_register)
-      : UnallocatedOperand(virtual_register) {
-    DCHECK(policy == FIXED_SLOT);
-    value_ |= BasicPolicyField::encode(policy);
-    value_ |= static_cast<int64_t>(index) << FixedSlotIndexField::kShift;
-    DCHECK(this->fixed_slot_index() == index);
-  }
-
-  UnallocatedOperand(ExtendedPolicy policy, int index, int virtual_register)
-      : UnallocatedOperand(virtual_register) {
-    DCHECK(policy == FIXED_REGISTER || policy == FIXED_FP_REGISTER);
-    value_ |= BasicPolicyField::encode(EXTENDED_POLICY);
-    value_ |= ExtendedPolicyField::encode(policy);
-    value_ |= LifetimeField::encode(USED_AT_END);
-    value_ |= FixedRegisterField::encode(index);
-  }
-
-  UnallocatedOperand(ExtendedPolicy policy, Lifetime lifetime,
-                     int virtual_register)
-      : UnallocatedOperand(virtual_register) {
-    value_ |= BasicPolicyField::encode(EXTENDED_POLICY);
-    value_ |= ExtendedPolicyField::encode(policy);
-    value_ |= LifetimeField::encode(lifetime);
-  }
-
-  UnallocatedOperand(int reg_id, int slot_id, int virtual_register)
-      : UnallocatedOperand(FIXED_REGISTER, reg_id, virtual_register) {
-    value_ |= HasSecondaryStorageField::encode(true);
-    value_ |= SecondaryStorageField::encode(slot_id);
-  }
-
-  UnallocatedOperand(const UnallocatedOperand& other, int virtual_register) {
-    DCHECK_NE(kInvalidVirtualRegister, virtual_register);
-    value_ = VirtualRegisterField::update(
-        other.value_, static_cast<uint32_t>(virtual_register));
-  }
-
-  // Predicates for the operand policy.
-  bool HasAnyPolicy() const {
-    return basic_policy() == EXTENDED_POLICY && extended_policy() == ANY;
-  }
-  bool HasFixedPolicy() const {
-    return basic_policy() == FIXED_SLOT ||
-           extended_policy() == FIXED_REGISTER ||
-           extended_policy() == FIXED_FP_REGISTER;
-  }
-  bool HasRegisterPolicy() const {
-    return basic_policy() == EXTENDED_POLICY &&
-           extended_policy() == MUST_HAVE_REGISTER;
-  }
-  bool HasSlotPolicy() const {
-    return basic_policy() == EXTENDED_POLICY &&
-           extended_policy() == MUST_HAVE_SLOT;
-  }
-  bool HasSameAsInputPolicy() const {
-    return basic_policy() == EXTENDED_POLICY &&
-           extended_policy() == SAME_AS_FIRST_INPUT;
-  }
-  bool HasFixedSlotPolicy() const { return basic_policy() == FIXED_SLOT; }
-  bool HasFixedRegisterPolicy() const {
-    return basic_policy() == EXTENDED_POLICY &&
-           extended_policy() == FIXED_REGISTER;
-  }
-  bool HasFixedFPRegisterPolicy() const {
-    return basic_policy() == EXTENDED_POLICY &&
-           extended_policy() == FIXED_FP_REGISTER;
-  }
-  bool HasSecondaryStorage() const {
-    return basic_policy() == EXTENDED_POLICY &&
-           extended_policy() == FIXED_REGISTER &&
-           HasSecondaryStorageField::decode(value_);
-  }
-  int GetSecondaryStorage() const {
-    DCHECK(HasSecondaryStorage());
-    return SecondaryStorageField::decode(value_);
-  }
-
-  // [basic_policy]: Distinguish between FIXED_SLOT and all other policies.
-  BasicPolicy basic_policy() const {
-    return BasicPolicyField::decode(value_);
-  }
-
-  // [extended_policy]: Only for non-FIXED_SLOT. The finer-grained policy.
-  ExtendedPolicy extended_policy() const {
-    DCHECK(basic_policy() == EXTENDED_POLICY);
-    return ExtendedPolicyField::decode(value_);
-  }
-
-  // [fixed_slot_index]: Only for FIXED_SLOT.
-  int fixed_slot_index() const {
-    DCHECK(HasFixedSlotPolicy());
-    return static_cast<int>(static_cast<int64_t>(value_) >>
-                            FixedSlotIndexField::kShift);
-  }
-
-  // [fixed_register_index]: Only for FIXED_REGISTER or FIXED_FP_REGISTER.
-  int fixed_register_index() const {
-    DCHECK(HasFixedRegisterPolicy() || HasFixedFPRegisterPolicy());
-    return FixedRegisterField::decode(value_);
-  }
-
-  // [virtual_register]: The virtual register ID for this operand.
-  int32_t virtual_register() const {
-    return static_cast<int32_t>(VirtualRegisterField::decode(value_));
-  }
-
-  // [lifetime]: Only for non-FIXED_SLOT.
-  bool IsUsedAtStart() const {
-    DCHECK(basic_policy() == EXTENDED_POLICY);
-    return LifetimeField::decode(value_) == USED_AT_START;
-  }
-
-  INSTRUCTION_OPERAND_CASTS(UnallocatedOperand, UNALLOCATED);
-
-  // The encoding used for UnallocatedOperand operands depends on the policy
-  // that is
-  // stored within the operand. The FIXED_SLOT policy uses a compact encoding
-  // because it accommodates a larger pay-load.
-  //
-  // For FIXED_SLOT policy:
-  //     +------------------------------------------------+
-  //     |      slot_index   | 0 | virtual_register | 001 |
-  //     +------------------------------------------------+
-  //
-  // For all other (extended) policies:
-  //     +-----------------------------------------------------+
-  //     |  reg_index  | L | PPP |  1 | virtual_register | 001 |
-  //     +-----------------------------------------------------+
-  //     L ... Lifetime
-  //     P ... Policy
-  //
-  // The slot index is a signed value which requires us to decode it manually
-  // instead of using the BitField utility class.
-
-  STATIC_ASSERT(KindField::kSize == 3);
-
-  class VirtualRegisterField : public BitField64<uint32_t, 3, 32> {};
-
-  // BitFields for all unallocated operands.
-  class BasicPolicyField : public BitField64<BasicPolicy, 35, 1> {};
-
-  // BitFields specific to BasicPolicy::FIXED_SLOT.
-  class FixedSlotIndexField : public BitField64<int, 36, 28> {};
-
-  // BitFields specific to BasicPolicy::EXTENDED_POLICY.
-  class ExtendedPolicyField : public BitField64<ExtendedPolicy, 36, 3> {};
-  class LifetimeField : public BitField64<Lifetime, 39, 1> {};
-  class HasSecondaryStorageField : public BitField64<bool, 40, 1> {};
-  class FixedRegisterField : public BitField64<int, 41, 6> {};
-  class SecondaryStorageField : public BitField64<int, 47, 3> {};
-
- private:
-  explicit UnallocatedOperand(int virtual_register)
-      : InstructionOperand(UNALLOCATED) {
-    value_ |=
-        VirtualRegisterField::encode(static_cast<uint32_t>(virtual_register));
-  }
-};
-
-
-class ConstantOperand : public InstructionOperand {
- public:
-  explicit ConstantOperand(int virtual_register)
-      : InstructionOperand(CONSTANT) {
-    value_ |=
-        VirtualRegisterField::encode(static_cast<uint32_t>(virtual_register));
-  }
-
-  int32_t virtual_register() const {
-    return static_cast<int32_t>(VirtualRegisterField::decode(value_));
-  }
-
-  static ConstantOperand* New(Zone* zone, int virtual_register) {
-    return InstructionOperand::New(zone, ConstantOperand(virtual_register));
-  }
-
-  INSTRUCTION_OPERAND_CASTS(ConstantOperand, CONSTANT);
-
-  STATIC_ASSERT(KindField::kSize == 3);
-  class VirtualRegisterField : public BitField64<uint32_t, 3, 32> {};
-};
-
-
-class ImmediateOperand : public InstructionOperand {
- public:
-  enum ImmediateType { INLINE, INDEXED };
-
-  explicit ImmediateOperand(ImmediateType type, int32_t value)
-      : InstructionOperand(IMMEDIATE) {
-    value_ |= TypeField::encode(type);
-    value_ |= static_cast<int64_t>(value) << ValueField::kShift;
-  }
-
-  ImmediateType type() const { return TypeField::decode(value_); }
-
-  int32_t inline_value() const {
-    DCHECK_EQ(INLINE, type());
-    return static_cast<int64_t>(value_) >> ValueField::kShift;
-  }
-
-  int32_t indexed_value() const {
-    DCHECK_EQ(INDEXED, type());
-    return static_cast<int64_t>(value_) >> ValueField::kShift;
-  }
-
-  static ImmediateOperand* New(Zone* zone, ImmediateType type, int32_t value) {
-    return InstructionOperand::New(zone, ImmediateOperand(type, value));
-  }
-
-  INSTRUCTION_OPERAND_CASTS(ImmediateOperand, IMMEDIATE);
-
-  STATIC_ASSERT(KindField::kSize == 3);
-  class TypeField : public BitField64<ImmediateType, 3, 1> {};
-  class ValueField : public BitField64<int32_t, 32, 32> {};
-};
-
-
-class LocationOperand : public InstructionOperand {
- public:
-  enum LocationKind { REGISTER, STACK_SLOT };
-
-  LocationOperand(InstructionOperand::Kind operand_kind,
-                  LocationOperand::LocationKind location_kind,
-                  MachineRepresentation rep, int index)
-      : InstructionOperand(operand_kind) {
-    DCHECK_IMPLIES(location_kind == REGISTER, index >= 0);
-    DCHECK(IsSupportedRepresentation(rep));
-    value_ |= LocationKindField::encode(location_kind);
-    value_ |= RepresentationField::encode(rep);
-    value_ |= static_cast<int64_t>(index) << IndexField::kShift;
-  }
-
-  int index() const {
-    DCHECK(IsStackSlot() || IsFPStackSlot());
-    return static_cast<int64_t>(value_) >> IndexField::kShift;
-  }
-
-  int register_code() const {
-    DCHECK(IsRegister() || IsFPRegister());
-    return static_cast<int64_t>(value_) >> IndexField::kShift;
-  }
-
-  Register GetRegister() const {
-    DCHECK(IsRegister());
-    return Register::from_code(register_code());
-  }
-
-  FloatRegister GetFloatRegister() const {
-    DCHECK(IsFloatRegister());
-    return FloatRegister::from_code(register_code());
-  }
-
-  DoubleRegister GetDoubleRegister() const {
-    // On platforms where FloatRegister, DoubleRegister, and Simd128Register
-    // are all the same type, it's convenient to treat everything as a
-    // DoubleRegister, so be lax about type checking here.
-    DCHECK(IsFPRegister());
-    return DoubleRegister::from_code(register_code());
-  }
-
-  Simd128Register GetSimd128Register() const {
-    DCHECK(IsSimd128Register());
-    return Simd128Register::from_code(register_code());
-  }
-
-  LocationKind location_kind() const {
-    return LocationKindField::decode(value_);
-  }
-
-  MachineRepresentation representation() const {
-    return RepresentationField::decode(value_);
-  }
-
-  static bool IsSupportedRepresentation(MachineRepresentation rep) {
-    switch (rep) {
-      case MachineRepresentation::kWord32:
-      case MachineRepresentation::kWord64:
-      case MachineRepresentation::kFloat32:
-      case MachineRepresentation::kFloat64:
-      case MachineRepresentation::kSimd128:
-      case MachineRepresentation::kTaggedSigned:
-      case MachineRepresentation::kTaggedPointer:
-      case MachineRepresentation::kTagged:
-        return true;
-      case MachineRepresentation::kBit:
-      case MachineRepresentation::kWord8:
-      case MachineRepresentation::kWord16:
-      case MachineRepresentation::kNone:
-        return false;
-    }
-    UNREACHABLE();
-  }
-
-  static LocationOperand* cast(InstructionOperand* op) {
-    DCHECK(op->IsAnyLocationOperand());
-    return static_cast<LocationOperand*>(op);
-  }
-
-  static const LocationOperand* cast(const InstructionOperand* op) {
-    DCHECK(op->IsAnyLocationOperand());
-    return static_cast<const LocationOperand*>(op);
-  }
-
-  static LocationOperand cast(const InstructionOperand& op) {
-    DCHECK(op.IsAnyLocationOperand());
-    return *static_cast<const LocationOperand*>(&op);
-  }
-
-  STATIC_ASSERT(KindField::kSize == 3);
-  class LocationKindField : public BitField64<LocationKind, 3, 2> {};
-  class RepresentationField : public BitField64<MachineRepresentation, 5, 8> {};
-  class IndexField : public BitField64<int32_t, 35, 29> {};
-};
-
-class V8_EXPORT_PRIVATE ExplicitOperand
-    : public NON_EXPORTED_BASE(LocationOperand) {
- public:
-  ExplicitOperand(LocationKind kind, MachineRepresentation rep, int index);
-
-  static ExplicitOperand* New(Zone* zone, LocationKind kind,
-                              MachineRepresentation rep, int index) {
-    return InstructionOperand::New(zone, ExplicitOperand(kind, rep, index));
-  }
-
-  INSTRUCTION_OPERAND_CASTS(ExplicitOperand, EXPLICIT);
-};
-
-
-class AllocatedOperand : public LocationOperand {
- public:
-  AllocatedOperand(LocationKind kind, MachineRepresentation rep, int index)
-      : LocationOperand(ALLOCATED, kind, rep, index) {}
-
-  static AllocatedOperand* New(Zone* zone, LocationKind kind,
-                               MachineRepresentation rep, int index) {
-    return InstructionOperand::New(zone, AllocatedOperand(kind, rep, index));
-  }
-
-  INSTRUCTION_OPERAND_CASTS(AllocatedOperand, ALLOCATED);
-};
-
-
-#undef INSTRUCTION_OPERAND_CASTS
-
-bool InstructionOperand::IsAnyLocationOperand() const {
-  return this->kind() >= FIRST_LOCATION_OPERAND_KIND;
-}
-
-bool InstructionOperand::IsLocationOperand() const {
-  return IsAnyLocationOperand() &&
-         !IsFloatingPoint(LocationOperand::cast(this)->representation());
-}
-
-bool InstructionOperand::IsFPLocationOperand() const {
-  return IsAnyLocationOperand() &&
-         IsFloatingPoint(LocationOperand::cast(this)->representation());
-}
-
-bool InstructionOperand::IsAnyRegister() const {
-  return IsAnyLocationOperand() &&
-         LocationOperand::cast(this)->location_kind() ==
-             LocationOperand::REGISTER;
-}
-
-
-bool InstructionOperand::IsRegister() const {
-  return IsAnyRegister() &&
-         !IsFloatingPoint(LocationOperand::cast(this)->representation());
-}
-
-bool InstructionOperand::IsFPRegister() const {
-  return IsAnyRegister() &&
-         IsFloatingPoint(LocationOperand::cast(this)->representation());
-}
-
-bool InstructionOperand::IsFloatRegister() const {
-  return IsAnyRegister() &&
-         LocationOperand::cast(this)->representation() ==
-             MachineRepresentation::kFloat32;
-}
-
-bool InstructionOperand::IsDoubleRegister() const {
-  return IsAnyRegister() &&
-         LocationOperand::cast(this)->representation() ==
-             MachineRepresentation::kFloat64;
-}
-
-bool InstructionOperand::IsSimd128Register() const {
-  return IsAnyRegister() && LocationOperand::cast(this)->representation() ==
-                                MachineRepresentation::kSimd128;
-}
-
-bool InstructionOperand::IsAnyStackSlot() const {
-  return IsAnyLocationOperand() &&
-         LocationOperand::cast(this)->location_kind() ==
-             LocationOperand::STACK_SLOT;
-}
-
-bool InstructionOperand::IsStackSlot() const {
-  return IsAnyStackSlot() &&
-         !IsFloatingPoint(LocationOperand::cast(this)->representation());
-}
-
-bool InstructionOperand::IsFPStackSlot() const {
-  return IsAnyStackSlot() &&
-         IsFloatingPoint(LocationOperand::cast(this)->representation());
-}
-
-bool InstructionOperand::IsFloatStackSlot() const {
-  return IsAnyLocationOperand() &&
-         LocationOperand::cast(this)->location_kind() ==
-             LocationOperand::STACK_SLOT &&
-         LocationOperand::cast(this)->representation() ==
-             MachineRepresentation::kFloat32;
-}
-
-bool InstructionOperand::IsDoubleStackSlot() const {
-  return IsAnyLocationOperand() &&
-         LocationOperand::cast(this)->location_kind() ==
-             LocationOperand::STACK_SLOT &&
-         LocationOperand::cast(this)->representation() ==
-             MachineRepresentation::kFloat64;
-}
-
-bool InstructionOperand::IsSimd128StackSlot() const {
-  return IsAnyLocationOperand() &&
-         LocationOperand::cast(this)->location_kind() ==
-             LocationOperand::STACK_SLOT &&
-         LocationOperand::cast(this)->representation() ==
-             MachineRepresentation::kSimd128;
-}
-
-uint64_t InstructionOperand::GetCanonicalizedValue() const {
-  if (IsAnyLocationOperand()) {
-    MachineRepresentation canonical = MachineRepresentation::kNone;
-    if (IsFPRegister()) {
-      if (kSimpleFPAliasing) {
-        // We treat all FP register operands the same for simple aliasing.
-        canonical = MachineRepresentation::kFloat64;
-      } else {
-        // We need to distinguish FP register operands of different reps when
-        // aliasing is not simple (e.g. ARM).
-        canonical = LocationOperand::cast(this)->representation();
-      }
-    }
-    return InstructionOperand::KindField::update(
-        LocationOperand::RepresentationField::update(this->value_, canonical),
-        LocationOperand::EXPLICIT);
-  }
-  return this->value_;
-}
-
-// Required for maps that don't care about machine type.
-struct CompareOperandModuloType {
-  bool operator()(const InstructionOperand& a,
-                  const InstructionOperand& b) const {
-    return a.CompareCanonicalized(b);
-  }
-};
-
-class V8_EXPORT_PRIVATE MoveOperands final
-    : public NON_EXPORTED_BASE(ZoneObject) {
- public:
-  MoveOperands(const InstructionOperand& source,
-               const InstructionOperand& destination)
-      : source_(source), destination_(destination) {
-    DCHECK(!source.IsInvalid() && !destination.IsInvalid());
-  }
-
-  const InstructionOperand& source() const { return source_; }
-  InstructionOperand& source() { return source_; }
-  void set_source(const InstructionOperand& operand) { source_ = operand; }
-
-  const InstructionOperand& destination() const { return destination_; }
-  InstructionOperand& destination() { return destination_; }
-  void set_destination(const InstructionOperand& operand) {
-    destination_ = operand;
-  }
-
-  // The gap resolver marks moves as "in-progress" by clearing the
-  // destination (but not the source).
-  bool IsPending() const {
-    return destination_.IsInvalid() && !source_.IsInvalid();
-  }
-  void SetPending() { destination_ = InstructionOperand(); }
-
-  // A move is redundant if it's been eliminated or if its source and
-  // destination are the same.
-  bool IsRedundant() const {
-    DCHECK_IMPLIES(!destination_.IsInvalid(), !destination_.IsConstant());
-    return IsEliminated() || source_.EqualsCanonicalized(destination_);
-  }
-
-  // We clear both operands to indicate move that's been eliminated.
-  void Eliminate() { source_ = destination_ = InstructionOperand(); }
-  bool IsEliminated() const {
-    DCHECK_IMPLIES(source_.IsInvalid(), destination_.IsInvalid());
-    return source_.IsInvalid();
-  }
-
-  // APIs to aid debugging. For general-stream APIs, use operator<<
-  void Print(const RegisterConfiguration* config) const;
-  void Print() const;
-
- private:
-  InstructionOperand source_;
-  InstructionOperand destination_;
-
-  DISALLOW_COPY_AND_ASSIGN(MoveOperands);
-};
-
-
-struct PrintableMoveOperands {
-  const RegisterConfiguration* register_configuration_;
-  const MoveOperands* move_operands_;
-};
-
-
-std::ostream& operator<<(std::ostream& os, const PrintableMoveOperands& mo);
-
-class V8_EXPORT_PRIVATE ParallelMove final
-    : public NON_EXPORTED_BASE(ZoneVector<MoveOperands *>),
-      public NON_EXPORTED_BASE(ZoneObject) {
- public:
-  explicit ParallelMove(Zone* zone) : ZoneVector<MoveOperands*>(zone) {
-    reserve(4);
-  }
-
-  MoveOperands* AddMove(const InstructionOperand& from,
-                        const InstructionOperand& to) {
-    Zone* zone = get_allocator().zone();
-    return AddMove(from, to, zone);
-  }
-
-  MoveOperands* AddMove(const InstructionOperand& from,
-                        const InstructionOperand& to,
-                        Zone* operand_allocation_zone) {
-    MoveOperands* move = new (operand_allocation_zone) MoveOperands(from, to);
-    push_back(move);
-    return move;
-  }
-
-  bool IsRedundant() const;
-
-  // Prepare this ParallelMove to insert move as if it happened in a subsequent
-  // ParallelMove.  move->source() may be changed.  Any MoveOperands added to
-  // to_eliminate must be Eliminated.
-  void PrepareInsertAfter(MoveOperands* move,
-                          ZoneVector<MoveOperands*>* to_eliminate) const;
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(ParallelMove);
-};
-
-
-struct PrintableParallelMove {
-  const RegisterConfiguration* register_configuration_;
-  const ParallelMove* parallel_move_;
-};
-
-
-std::ostream& operator<<(std::ostream& os, const PrintableParallelMove& pm);
-
-
-class ReferenceMap final : public ZoneObject {
- public:
-  explicit ReferenceMap(Zone* zone)
-      : reference_operands_(8, zone), instruction_position_(-1) {}
-
-  const ZoneVector<InstructionOperand>& reference_operands() const {
-    return reference_operands_;
-  }
-  int instruction_position() const { return instruction_position_; }
-
-  void set_instruction_position(int pos) {
-    DCHECK_EQ(-1, instruction_position_);
-    instruction_position_ = pos;
-  }
-
-  void RecordReference(const AllocatedOperand& op);
-
- private:
-  friend std::ostream& operator<<(std::ostream& os, const ReferenceMap& pm);
-
-  ZoneVector<InstructionOperand> reference_operands_;
-  int instruction_position_;
-};
-
-std::ostream& operator<<(std::ostream& os, const ReferenceMap& pm);
-
-class InstructionBlock;
-
-class V8_EXPORT_PRIVATE Instruction final {
- public:
-  size_t OutputCount() const { return OutputCountField::decode(bit_field_); }
-  const InstructionOperand* OutputAt(size_t i) const {
-    DCHECK(i < OutputCount());
-    return &operands_[i];
-  }
-  InstructionOperand* OutputAt(size_t i) {
-    DCHECK(i < OutputCount());
-    return &operands_[i];
-  }
-
-  bool HasOutput() const { return OutputCount() == 1; }
-  const InstructionOperand* Output() const { return OutputAt(0); }
-  InstructionOperand* Output() { return OutputAt(0); }
-
-  size_t InputCount() const { return InputCountField::decode(bit_field_); }
-  const InstructionOperand* InputAt(size_t i) const {
-    DCHECK(i < InputCount());
-    return &operands_[OutputCount() + i];
-  }
-  InstructionOperand* InputAt(size_t i) {
-    DCHECK(i < InputCount());
-    return &operands_[OutputCount() + i];
-  }
-
-  size_t TempCount() const { return TempCountField::decode(bit_field_); }
-  const InstructionOperand* TempAt(size_t i) const {
-    DCHECK(i < TempCount());
-    return &operands_[OutputCount() + InputCount() + i];
-  }
-  InstructionOperand* TempAt(size_t i) {
-    DCHECK(i < TempCount());
-    return &operands_[OutputCount() + InputCount() + i];
-  }
-
-  InstructionCode opcode() const { return opcode_; }
-  ArchOpcode arch_opcode() const { return ArchOpcodeField::decode(opcode()); }
-  AddressingMode addressing_mode() const {
-    return AddressingModeField::decode(opcode());
-  }
-  FlagsMode flags_mode() const { return FlagsModeField::decode(opcode()); }
-  FlagsCondition flags_condition() const {
-    return FlagsConditionField::decode(opcode());
-  }
-
-  static Instruction* New(Zone* zone, InstructionCode opcode) {
-    return New(zone, opcode, 0, nullptr, 0, nullptr, 0, nullptr);
-  }
-
-  static Instruction* New(Zone* zone, InstructionCode opcode,
-                          size_t output_count, InstructionOperand* outputs,
-                          size_t input_count, InstructionOperand* inputs,
-                          size_t temp_count, InstructionOperand* temps) {
-    DCHECK_LE(0, opcode);
-    DCHECK(output_count == 0 || outputs != nullptr);
-    DCHECK(input_count == 0 || inputs != nullptr);
-    DCHECK(temp_count == 0 || temps != nullptr);
-    // TODO(jarin/mstarzinger): Handle this gracefully. See crbug.com/582702.
-    CHECK(InputCountField::is_valid(input_count));
-
-    size_t total_extra_ops = output_count + input_count + temp_count;
-    if (total_extra_ops != 0) total_extra_ops--;
-    int size = static_cast<int>(
-        RoundUp(sizeof(Instruction), sizeof(InstructionOperand)) +
-        total_extra_ops * sizeof(InstructionOperand));
-    return new (zone->New(size)) Instruction(
-        opcode, output_count, outputs, input_count, inputs, temp_count, temps);
-  }
-
-  Instruction* MarkAsCall() {
-    bit_field_ = IsCallField::update(bit_field_, true);
-    return this;
-  }
-  bool IsCall() const { return IsCallField::decode(bit_field_); }
-  bool NeedsReferenceMap() const { return IsCall(); }
-  bool HasReferenceMap() const { return reference_map_ != nullptr; }
-
-  bool ClobbersRegisters() const { return IsCall(); }
-  bool ClobbersTemps() const { return IsCall(); }
-  bool ClobbersDoubleRegisters() const { return IsCall(); }
-  ReferenceMap* reference_map() const { return reference_map_; }
-
-  void set_reference_map(ReferenceMap* map) {
-    DCHECK(NeedsReferenceMap());
-    DCHECK(!reference_map_);
-    reference_map_ = map;
-  }
-
-  void OverwriteWithNop() {
-    opcode_ = ArchOpcodeField::encode(kArchNop);
-    bit_field_ = 0;
-    reference_map_ = nullptr;
-  }
-
-  bool IsNop() const { return arch_opcode() == kArchNop; }
-
-  bool IsDeoptimizeCall() const {
-    return arch_opcode() == ArchOpcode::kArchDeoptimize ||
-           FlagsModeField::decode(opcode()) == kFlags_deoptimize;
-  }
-
-  bool IsTrap() const {
-    return FlagsModeField::decode(opcode()) == kFlags_trap;
-  }
-
-  bool IsJump() const { return arch_opcode() == ArchOpcode::kArchJmp; }
-  bool IsRet() const { return arch_opcode() == ArchOpcode::kArchRet; }
-  bool IsTailCall() const {
-    return arch_opcode() == ArchOpcode::kArchTailCallCodeObject ||
-           arch_opcode() == ArchOpcode::kArchTailCallCodeObjectFromJSFunction ||
-           arch_opcode() == ArchOpcode::kArchTailCallAddress ||
-           arch_opcode() == ArchOpcode::kArchTailCallWasm;
-  }
-  bool IsThrow() const {
-    return arch_opcode() == ArchOpcode::kArchThrowTerminator;
-  }
-
-  enum GapPosition {
-    START,
-    END,
-    FIRST_GAP_POSITION = START,
-    LAST_GAP_POSITION = END
-  };
-
-  ParallelMove* GetOrCreateParallelMove(GapPosition pos, Zone* zone) {
-    if (parallel_moves_[pos] == nullptr) {
-      parallel_moves_[pos] = new (zone) ParallelMove(zone);
-    }
-    return parallel_moves_[pos];
-  }
-
-  ParallelMove* GetParallelMove(GapPosition pos) {
-    return parallel_moves_[pos];
-  }
-
-  const ParallelMove* GetParallelMove(GapPosition pos) const {
-    return parallel_moves_[pos];
-  }
-
-  bool AreMovesRedundant() const;
-
-  ParallelMove* const* parallel_moves() const { return &parallel_moves_[0]; }
-  ParallelMove** parallel_moves() { return &parallel_moves_[0]; }
-
-  // The block_id may be invalidated in JumpThreading. It is only important for
-  // register allocation, to avoid searching for blocks from instruction
-  // indexes.
-  InstructionBlock* block() const { return block_; }
-  void set_block(InstructionBlock* block) {
-    DCHECK_NOT_NULL(block);
-    block_ = block;
-  }
-
-  // APIs to aid debugging. For general-stream APIs, use operator<<
-  void Print(const RegisterConfiguration* config) const;
-  void Print() const;
-
-  typedef BitField<size_t, 0, 8> OutputCountField;
-  typedef BitField<size_t, 8, 16> InputCountField;
-  typedef BitField<size_t, 24, 6> TempCountField;
-
-  static const size_t kMaxOutputCount = OutputCountField::kMax;
-  static const size_t kMaxInputCount = InputCountField::kMax;
-  static const size_t kMaxTempCount = TempCountField::kMax;
-
- private:
-  explicit Instruction(InstructionCode opcode);
-
-  Instruction(InstructionCode opcode, size_t output_count,
-              InstructionOperand* outputs, size_t input_count,
-              InstructionOperand* inputs, size_t temp_count,
-              InstructionOperand* temps);
-
-  typedef BitField<bool, 30, 1> IsCallField;
-
-  InstructionCode opcode_;
-  uint32_t bit_field_;
-  ParallelMove* parallel_moves_[2];
-  ReferenceMap* reference_map_;
-  InstructionBlock* block_;
-  InstructionOperand operands_[1];
-
-  DISALLOW_COPY_AND_ASSIGN(Instruction);
-};
-
-
-struct PrintableInstruction {
-  const RegisterConfiguration* register_configuration_;
-  const Instruction* instr_;
-};
-std::ostream& operator<<(std::ostream& os, const PrintableInstruction& instr);
-
-
-class RpoNumber final {
- public:
-  static const int kInvalidRpoNumber = -1;
-  int ToInt() const {
-    DCHECK(IsValid());
-    return index_;
-  }
-  size_t ToSize() const {
-    DCHECK(IsValid());
-    return static_cast<size_t>(index_);
-  }
-  bool IsValid() const { return index_ >= 0; }
-  static RpoNumber FromInt(int index) { return RpoNumber(index); }
-  static RpoNumber Invalid() { return RpoNumber(kInvalidRpoNumber); }
-
-  bool IsNext(const RpoNumber other) const {
-    DCHECK(IsValid());
-    return other.index_ == this->index_ + 1;
-  }
-
-  // Comparison operators.
-  bool operator==(RpoNumber other) const { return index_ == other.index_; }
-  bool operator!=(RpoNumber other) const { return index_ != other.index_; }
-  bool operator>(RpoNumber other) const { return index_ > other.index_; }
-  bool operator<(RpoNumber other) const { return index_ < other.index_; }
-  bool operator<=(RpoNumber other) const { return index_ <= other.index_; }
-  bool operator>=(RpoNumber other) const { return index_ >= other.index_; }
-
- private:
-  explicit RpoNumber(int32_t index) : index_(index) {}
-  int32_t index_;
-};
-
-
-std::ostream& operator<<(std::ostream&, const RpoNumber&);
-
-class V8_EXPORT_PRIVATE Constant final {
- public:
-  enum Type {
-    kInt32,
-    kInt64,
-    kFloat32,
-    kFloat64,
-    kExternalReference,
-    kHeapObject,
-    kRpoNumber
-  };
-
-  explicit Constant(int32_t v);
-  explicit Constant(int64_t v) : type_(kInt64), value_(v) {}
-  explicit Constant(float v) : type_(kFloat32), value_(bit_cast<int32_t>(v)) {}
-  explicit Constant(double v) : type_(kFloat64), value_(bit_cast<int64_t>(v)) {}
-  explicit Constant(ExternalReference ref)
-      : type_(kExternalReference), value_(bit_cast<intptr_t>(ref)) {}
-  explicit Constant(Handle<HeapObject> obj)
-      : type_(kHeapObject), value_(bit_cast<intptr_t>(obj)) {}
-  explicit Constant(RpoNumber rpo) : type_(kRpoNumber), value_(rpo.ToInt()) {}
-  explicit Constant(RelocatablePtrConstantInfo info);
-
-  Type type() const { return type_; }
-
-  RelocInfo::Mode rmode() const { return rmode_; }
-
-  int32_t ToInt32() const {
-    DCHECK(type() == kInt32 || type() == kInt64);
-    const int32_t value = static_cast<int32_t>(value_);
-    DCHECK_EQ(value_, static_cast<int64_t>(value));
-    return value;
-  }
-
-  int64_t ToInt64() const {
-    if (type() == kInt32) return ToInt32();
-    DCHECK_EQ(kInt64, type());
-    return value_;
-  }
-
-  float ToFloat32() const {
-    // TODO(ahaas): We should remove this function. If value_ has the bit
-    // representation of a signalling NaN, then returning it as float can cause
-    // the signalling bit to flip, and value_ is returned as a quiet NaN.
-    DCHECK_EQ(kFloat32, type());
-    return bit_cast<float>(static_cast<int32_t>(value_));
-  }
-
-  uint32_t ToFloat32AsInt() const {
-    DCHECK_EQ(kFloat32, type());
-    return bit_cast<uint32_t>(static_cast<int32_t>(value_));
-  }
-
-  Double ToFloat64() const {
-    DCHECK_EQ(kFloat64, type());
-    return Double(bit_cast<uint64_t>(value_));
-  }
-
-  ExternalReference ToExternalReference() const {
-    DCHECK_EQ(kExternalReference, type());
-    return bit_cast<ExternalReference>(static_cast<intptr_t>(value_));
-  }
-
-  RpoNumber ToRpoNumber() const {
-    DCHECK_EQ(kRpoNumber, type());
-    return RpoNumber::FromInt(static_cast<int>(value_));
-  }
-
-  Handle<HeapObject> ToHeapObject() const;
-  Handle<Code> ToCode() const;
-
- private:
-  Type type_;
-#if V8_TARGET_ARCH_32_BIT
-  RelocInfo::Mode rmode_ = RelocInfo::NONE32;
-#else
-  RelocInfo::Mode rmode_ = RelocInfo::NONE64;
-#endif
-  int64_t value_;
-};
-
-
-std::ostream& operator<<(std::ostream& os, const Constant& constant);
-
-
-// Forward declarations.
-class FrameStateDescriptor;
-
-enum class StateValueKind : uint8_t {
-  kArgumentsElements,
-  kArgumentsLength,
-  kPlain,
-  kOptimizedOut,
-  kNested,
-  kDuplicate
-};
-
-class StateValueDescriptor {
- public:
-  StateValueDescriptor()
-      : kind_(StateValueKind::kPlain), type_(MachineType::AnyTagged()) {}
-
-  static StateValueDescriptor ArgumentsElements(ArgumentsStateType type) {
-    StateValueDescriptor descr(StateValueKind::kArgumentsElements,
-                               MachineType::AnyTagged());
-    descr.args_type_ = type;
-    return descr;
-  }
-  static StateValueDescriptor ArgumentsLength(ArgumentsStateType type) {
-    StateValueDescriptor descr(StateValueKind::kArgumentsLength,
-                               MachineType::AnyTagged());
-    descr.args_type_ = type;
-    return descr;
-  }
-  static StateValueDescriptor Plain(MachineType type) {
-    return StateValueDescriptor(StateValueKind::kPlain, type);
-  }
-  static StateValueDescriptor OptimizedOut() {
-    return StateValueDescriptor(StateValueKind::kOptimizedOut,
-                                MachineType::AnyTagged());
-  }
-  static StateValueDescriptor Recursive(size_t id) {
-    StateValueDescriptor descr(StateValueKind::kNested,
-                               MachineType::AnyTagged());
-    descr.id_ = id;
-    return descr;
-  }
-  static StateValueDescriptor Duplicate(size_t id) {
-    StateValueDescriptor descr(StateValueKind::kDuplicate,
-                               MachineType::AnyTagged());
-    descr.id_ = id;
-    return descr;
-  }
-
-  bool IsArgumentsElements() const {
-    return kind_ == StateValueKind::kArgumentsElements;
-  }
-  bool IsArgumentsLength() const {
-    return kind_ == StateValueKind::kArgumentsLength;
-  }
-  bool IsPlain() const { return kind_ == StateValueKind::kPlain; }
-  bool IsOptimizedOut() const { return kind_ == StateValueKind::kOptimizedOut; }
-  bool IsNested() const { return kind_ == StateValueKind::kNested; }
-  bool IsDuplicate() const { return kind_ == StateValueKind::kDuplicate; }
-  MachineType type() const { return type_; }
-  size_t id() const {
-    DCHECK(kind_ == StateValueKind::kDuplicate ||
-           kind_ == StateValueKind::kNested);
-    return id_;
-  }
-  ArgumentsStateType arguments_type() const {
-    DCHECK(kind_ == StateValueKind::kArgumentsElements ||
-           kind_ == StateValueKind::kArgumentsLength);
-    return args_type_;
-  }
-
- private:
-  StateValueDescriptor(StateValueKind kind, MachineType type)
-      : kind_(kind), type_(type) {}
-
-  StateValueKind kind_;
-  MachineType type_;
-  union {
-    size_t id_;
-    ArgumentsStateType args_type_;
-  };
-};
-
-class StateValueList {
- public:
-  explicit StateValueList(Zone* zone) : fields_(zone), nested_(zone) {}
-
-  size_t size() { return fields_.size(); }
-
-  struct Value {
-    StateValueDescriptor* desc;
-    StateValueList* nested;
-
-    Value(StateValueDescriptor* desc, StateValueList* nested)
-        : desc(desc), nested(nested) {}
-  };
-
-  class iterator {
-   public:
-    // Bare minimum of operators needed for range iteration.
-    bool operator!=(const iterator& other) const {
-      return field_iterator != other.field_iterator;
-    }
-    bool operator==(const iterator& other) const {
-      return field_iterator == other.field_iterator;
-    }
-    iterator& operator++() {
-      if (field_iterator->IsNested()) {
-        nested_iterator++;
-      }
-      ++field_iterator;
-      return *this;
-    }
-    Value operator*() {
-      StateValueDescriptor* desc = &(*field_iterator);
-      StateValueList* nested = desc->IsNested() ? *nested_iterator : nullptr;
-      return Value(desc, nested);
-    }
-
-   private:
-    friend class StateValueList;
-
-    iterator(ZoneVector<StateValueDescriptor>::iterator it,
-             ZoneVector<StateValueList*>::iterator nested)
-        : field_iterator(it), nested_iterator(nested) {}
-
-    ZoneVector<StateValueDescriptor>::iterator field_iterator;
-    ZoneVector<StateValueList*>::iterator nested_iterator;
-  };
-
-  void ReserveSize(size_t size) { fields_.reserve(size); }
-
-  StateValueList* PushRecursiveField(Zone* zone, size_t id) {
-    fields_.push_back(StateValueDescriptor::Recursive(id));
-    StateValueList* nested =
-        new (zone->New(sizeof(StateValueList))) StateValueList(zone);
-    nested_.push_back(nested);
-    return nested;
-  }
-  void PushArgumentsElements(ArgumentsStateType type) {
-    fields_.push_back(StateValueDescriptor::ArgumentsElements(type));
-  }
-  void PushArgumentsLength(ArgumentsStateType type) {
-    fields_.push_back(StateValueDescriptor::ArgumentsLength(type));
-  }
-  void PushDuplicate(size_t id) {
-    fields_.push_back(StateValueDescriptor::Duplicate(id));
-  }
-  void PushPlain(MachineType type) {
-    fields_.push_back(StateValueDescriptor::Plain(type));
-  }
-  void PushOptimizedOut() {
-    fields_.push_back(StateValueDescriptor::OptimizedOut());
-  }
-
-  iterator begin() { return iterator(fields_.begin(), nested_.begin()); }
-  iterator end() { return iterator(fields_.end(), nested_.end()); }
-
- private:
-  ZoneVector<StateValueDescriptor> fields_;
-  ZoneVector<StateValueList*> nested_;
-};
-
-class FrameStateDescriptor : public ZoneObject {
- public:
-  FrameStateDescriptor(Zone* zone, FrameStateType type, BailoutId bailout_id,
-                       OutputFrameStateCombine state_combine,
-                       size_t parameters_count, size_t locals_count,
-                       size_t stack_count,
-                       MaybeHandle<SharedFunctionInfo> shared_info,
-                       FrameStateDescriptor* outer_state = nullptr);
-
-  FrameStateType type() const { return type_; }
-  BailoutId bailout_id() const { return bailout_id_; }
-  OutputFrameStateCombine state_combine() const { return frame_state_combine_; }
-  size_t parameters_count() const { return parameters_count_; }
-  size_t locals_count() const { return locals_count_; }
-  size_t stack_count() const { return stack_count_; }
-  MaybeHandle<SharedFunctionInfo> shared_info() const { return shared_info_; }
-  FrameStateDescriptor* outer_state() const { return outer_state_; }
-  bool HasContext() const {
-    return FrameStateFunctionInfo::IsJSFunctionType(type_) ||
-           type_ == FrameStateType::kBuiltinContinuation;
-  }
-
-  size_t GetSize() const;
-  size_t GetTotalSize() const;
-  size_t GetFrameCount() const;
-  size_t GetJSFrameCount() const;
-
-  StateValueList* GetStateValueDescriptors() { return &values_; }
-
-  static const int kImpossibleValue = 0xdead;
-
- private:
-  FrameStateType type_;
-  BailoutId bailout_id_;
-  OutputFrameStateCombine frame_state_combine_;
-  size_t parameters_count_;
-  size_t locals_count_;
-  size_t stack_count_;
-  StateValueList values_;
-  MaybeHandle<SharedFunctionInfo> const shared_info_;
-  FrameStateDescriptor* outer_state_;
-};
-
-// A deoptimization entry is a pair of the reason why we deoptimize and the
-// frame state descriptor that we have to go back to.
-class DeoptimizationEntry final {
- public:
-  DeoptimizationEntry() {}
-  DeoptimizationEntry(FrameStateDescriptor* descriptor, DeoptimizeKind kind,
-                      DeoptimizeReason reason, VectorSlotPair const& feedback)
-      : descriptor_(descriptor),
-        kind_(kind),
-        reason_(reason),
-        feedback_(feedback) {}
-
-  FrameStateDescriptor* descriptor() const { return descriptor_; }
-  DeoptimizeKind kind() const { return kind_; }
-  DeoptimizeReason reason() const { return reason_; }
-  VectorSlotPair const& feedback() const { return feedback_; }
-
- private:
-  FrameStateDescriptor* descriptor_ = nullptr;
-  DeoptimizeKind kind_ = DeoptimizeKind::kEager;
-  DeoptimizeReason reason_ = DeoptimizeReason::kUnknown;
-  VectorSlotPair feedback_ = VectorSlotPair();
-};
-
-typedef ZoneVector<DeoptimizationEntry> DeoptimizationVector;
-
-class V8_EXPORT_PRIVATE PhiInstruction final
-    : public NON_EXPORTED_BASE(ZoneObject) {
- public:
-  typedef ZoneVector<InstructionOperand> Inputs;
-
-  PhiInstruction(Zone* zone, int virtual_register, size_t input_count);
-
-  void SetInput(size_t offset, int virtual_register);
-  void RenameInput(size_t offset, int virtual_register);
-
-  int virtual_register() const { return virtual_register_; }
-  const IntVector& operands() const { return operands_; }
-
-  // TODO(dcarney): this has no real business being here, since it's internal to
-  // the register allocator, but putting it here was convenient.
-  const InstructionOperand& output() const { return output_; }
-  InstructionOperand& output() { return output_; }
-
- private:
-  const int virtual_register_;
-  InstructionOperand output_;
-  IntVector operands_;
-};
-
-
-// Analogue of BasicBlock for Instructions instead of Nodes.
-class V8_EXPORT_PRIVATE InstructionBlock final
-    : public NON_EXPORTED_BASE(ZoneObject) {
- public:
-  InstructionBlock(Zone* zone, RpoNumber rpo_number, RpoNumber loop_header,
-                   RpoNumber loop_end, bool deferred, bool handler);
-
-  // Instruction indexes (used by the register allocator).
-  int first_instruction_index() const {
-    DCHECK_LE(0, code_start_);
-    DCHECK_LT(0, code_end_);
-    DCHECK_GE(code_end_, code_start_);
-    return code_start_;
-  }
-  int last_instruction_index() const {
-    DCHECK_LE(0, code_start_);
-    DCHECK_LT(0, code_end_);
-    DCHECK_GE(code_end_, code_start_);
-    return code_end_ - 1;
-  }
-
-  int32_t code_start() const { return code_start_; }
-  void set_code_start(int32_t start) { code_start_ = start; }
-
-  int32_t code_end() const { return code_end_; }
-  void set_code_end(int32_t end) { code_end_ = end; }
-
-  bool IsDeferred() const { return deferred_; }
-  bool IsHandler() const { return handler_; }
-
-  RpoNumber ao_number() const { return ao_number_; }
-  RpoNumber rpo_number() const { return rpo_number_; }
-  RpoNumber loop_header() const { return loop_header_; }
-  RpoNumber loop_end() const {
-    DCHECK(IsLoopHeader());
-    return loop_end_;
-  }
-  inline bool IsLoopHeader() const { return loop_end_.IsValid(); }
-
-  typedef ZoneVector<RpoNumber> Predecessors;
-  Predecessors& predecessors() { return predecessors_; }
-  const Predecessors& predecessors() const { return predecessors_; }
-  size_t PredecessorCount() const { return predecessors_.size(); }
-  size_t PredecessorIndexOf(RpoNumber rpo_number) const;
-
-  typedef ZoneVector<RpoNumber> Successors;
-  Successors& successors() { return successors_; }
-  const Successors& successors() const { return successors_; }
-  size_t SuccessorCount() const { return successors_.size(); }
-
-  typedef ZoneVector<PhiInstruction*> PhiInstructions;
-  const PhiInstructions& phis() const { return phis_; }
-  PhiInstruction* PhiAt(size_t i) const { return phis_[i]; }
-  void AddPhi(PhiInstruction* phi) { phis_.push_back(phi); }
-
-  void set_ao_number(RpoNumber ao_number) { ao_number_ = ao_number; }
-
-  bool needs_frame() const { return needs_frame_; }
-  void mark_needs_frame() { needs_frame_ = true; }
-
-  bool must_construct_frame() const { return must_construct_frame_; }
-  void mark_must_construct_frame() { must_construct_frame_ = true; }
-
-  bool must_deconstruct_frame() const { return must_deconstruct_frame_; }
-  void mark_must_deconstruct_frame() { must_deconstruct_frame_ = true; }
-
- private:
-  Successors successors_;
-  Predecessors predecessors_;
-  PhiInstructions phis_;
-  RpoNumber ao_number_;  // Assembly order number.
-  const RpoNumber rpo_number_;
-  const RpoNumber loop_header_;
-  const RpoNumber loop_end_;
-  int32_t code_start_;   // start index of arch-specific code.
-  int32_t code_end_;     // end index of arch-specific code.
-  const bool deferred_;  // Block contains deferred code.
-  const bool handler_;   // Block is a handler entry point.
-  bool needs_frame_;
-  bool must_construct_frame_;
-  bool must_deconstruct_frame_;
-};
-
-class InstructionSequence;
-
-struct PrintableInstructionBlock {
-  const RegisterConfiguration* register_configuration_;
-  const InstructionBlock* block_;
-  const InstructionSequence* code_;
-};
-
-std::ostream& operator<<(std::ostream& os,
-                         const PrintableInstructionBlock& printable_block);
-
-typedef ZoneDeque<Constant> ConstantDeque;
-typedef std::map<int, Constant, std::less<int>,
-                 ZoneAllocator<std::pair<const int, Constant> > >
-    ConstantMap;
-
-typedef ZoneDeque<Instruction*> InstructionDeque;
-typedef ZoneDeque<ReferenceMap*> ReferenceMapDeque;
-typedef ZoneVector<InstructionBlock*> InstructionBlocks;
-
-
-// Forward declarations.
-struct PrintableInstructionSequence;
-
-
-// Represents architecture-specific generated code before, during, and after
-// register allocation.
-class V8_EXPORT_PRIVATE InstructionSequence final
-    : public NON_EXPORTED_BASE(ZoneObject) {
- public:
-  static InstructionBlocks* InstructionBlocksFor(Zone* zone,
-                                                 const Schedule* schedule);
-  // Puts the deferred blocks last.
-  static void ComputeAssemblyOrder(InstructionBlocks* blocks);
-
-  InstructionSequence(Isolate* isolate, Zone* zone,
-                      InstructionBlocks* instruction_blocks);
-
-  int NextVirtualRegister();
-  int VirtualRegisterCount() const { return next_virtual_register_; }
-
-  const InstructionBlocks& instruction_blocks() const {
-    return *instruction_blocks_;
-  }
-
-  int InstructionBlockCount() const {
-    return static_cast<int>(instruction_blocks_->size());
-  }
-
-  InstructionBlock* InstructionBlockAt(RpoNumber rpo_number) {
-    return instruction_blocks_->at(rpo_number.ToSize());
-  }
-
-  int LastLoopInstructionIndex(const InstructionBlock* block) {
-    return instruction_blocks_->at(block->loop_end().ToSize() - 1)
-        ->last_instruction_index();
-  }
-
-  const InstructionBlock* InstructionBlockAt(RpoNumber rpo_number) const {
-    return instruction_blocks_->at(rpo_number.ToSize());
-  }
-
-  InstructionBlock* GetInstructionBlock(int instruction_index) const;
-
-  static MachineRepresentation DefaultRepresentation() {
-    return MachineType::PointerRepresentation();
-  }
-  MachineRepresentation GetRepresentation(int virtual_register) const;
-  void MarkAsRepresentation(MachineRepresentation rep, int virtual_register);
-  int representation_mask() const { return representation_mask_; }
-
-  bool IsReference(int virtual_register) const {
-    return CanBeTaggedPointer(GetRepresentation(virtual_register));
-  }
-  bool IsFP(int virtual_register) const {
-    return IsFloatingPoint(GetRepresentation(virtual_register));
-  }
-
-  Instruction* GetBlockStart(RpoNumber rpo) const;
-
-  typedef InstructionDeque::const_iterator const_iterator;
-  const_iterator begin() const { return instructions_.begin(); }
-  const_iterator end() const { return instructions_.end(); }
-  const InstructionDeque& instructions() const { return instructions_; }
-  int LastInstructionIndex() const {
-    return static_cast<int>(instructions().size()) - 1;
-  }
-
-  Instruction* InstructionAt(int index) const {
-    DCHECK_LE(0, index);
-    DCHECK_GT(instructions_.size(), index);
-    return instructions_[index];
-  }
-
-  Isolate* isolate() const { return isolate_; }
-  const ReferenceMapDeque* reference_maps() const { return &reference_maps_; }
-  Zone* zone() const { return zone_; }
-
-  // Used by the instruction selector while adding instructions.
-  int AddInstruction(Instruction* instr);
-  void StartBlock(RpoNumber rpo);
-  void EndBlock(RpoNumber rpo);
-
-  int AddConstant(int virtual_register, Constant constant) {
-    // TODO(titzer): allow RPO numbers as constants?
-    DCHECK_NE(Constant::kRpoNumber, constant.type());
-    DCHECK(virtual_register >= 0 && virtual_register < next_virtual_register_);
-    DCHECK(constants_.find(virtual_register) == constants_.end());
-    constants_.insert(std::make_pair(virtual_register, constant));
-    return virtual_register;
-  }
-  Constant GetConstant(int virtual_register) const {
-    ConstantMap::const_iterator it = constants_.find(virtual_register);
-    DCHECK(it != constants_.end());
-    DCHECK_EQ(virtual_register, it->first);
-    return it->second;
-  }
-
-  typedef ZoneVector<Constant> Immediates;
-  Immediates& immediates() { return immediates_; }
-
-  ImmediateOperand AddImmediate(const Constant& constant) {
-    if (constant.type() == Constant::kInt32 &&
-        RelocInfo::IsNone(constant.rmode())) {
-      return ImmediateOperand(ImmediateOperand::INLINE, constant.ToInt32());
-    }
-    int index = static_cast<int>(immediates_.size());
-    immediates_.push_back(constant);
-    return ImmediateOperand(ImmediateOperand::INDEXED, index);
-  }
-
-  Constant GetImmediate(const ImmediateOperand* op) const {
-    switch (op->type()) {
-      case ImmediateOperand::INLINE:
-        return Constant(op->inline_value());
-      case ImmediateOperand::INDEXED: {
-        int index = op->indexed_value();
-        DCHECK_LE(0, index);
-        DCHECK_GT(immediates_.size(), index);
-        return immediates_[index];
-      }
-    }
-    UNREACHABLE();
-  }
-
-  int AddDeoptimizationEntry(FrameStateDescriptor* descriptor,
-                             DeoptimizeKind kind, DeoptimizeReason reason,
-                             VectorSlotPair const& feedback);
-  DeoptimizationEntry const& GetDeoptimizationEntry(int deoptimization_id);
-  int GetDeoptimizationEntryCount() const {
-    return static_cast<int>(deoptimization_entries_.size());
-  }
-
-  RpoNumber InputRpo(Instruction* instr, size_t index);
-
-  bool GetSourcePosition(const Instruction* instr,
-                         SourcePosition* result) const;
-  void SetSourcePosition(const Instruction* instr, SourcePosition value);
-
-  bool ContainsCall() const {
-    for (Instruction* instr : instructions_) {
-      if (instr->IsCall()) return true;
-    }
-    return false;
-  }
-
-  // APIs to aid debugging. For general-stream APIs, use operator<<
-  void Print(const RegisterConfiguration* config) const;
-  void Print() const;
-
-  void PrintBlock(const RegisterConfiguration* config, int block_id) const;
-  void PrintBlock(int block_id) const;
-
-  void ValidateEdgeSplitForm() const;
-  void ValidateDeferredBlockExitPaths() const;
-  void ValidateDeferredBlockEntryPaths() const;
-  void ValidateSSA() const;
-
-  static void SetRegisterConfigurationForTesting(
-      const RegisterConfiguration* regConfig);
-  static void ClearRegisterConfigurationForTesting();
-
- private:
-  friend V8_EXPORT_PRIVATE std::ostream& operator<<(
-      std::ostream& os, const PrintableInstructionSequence& code);
-
-  typedef ZoneMap<const Instruction*, SourcePosition> SourcePositionMap;
-
-  static const RegisterConfiguration* RegisterConfigurationForTesting();
-  static const RegisterConfiguration* registerConfigurationForTesting_;
-
-  Isolate* isolate_;
-  Zone* const zone_;
-  InstructionBlocks* const instruction_blocks_;
-  SourcePositionMap source_positions_;
-  ConstantMap constants_;
-  Immediates immediates_;
-  InstructionDeque instructions_;
-  int next_virtual_register_;
-  ReferenceMapDeque reference_maps_;
-  ZoneVector<MachineRepresentation> representations_;
-  int representation_mask_;
-  DeoptimizationVector deoptimization_entries_;
-
-  // Used at construction time
-  InstructionBlock* current_block_;
-
-  DISALLOW_COPY_AND_ASSIGN(InstructionSequence);
-};
-
-
-struct PrintableInstructionSequence {
-  const RegisterConfiguration* register_configuration_;
-  const InstructionSequence* sequence_;
-};
-
-V8_EXPORT_PRIVATE std::ostream& operator<<(
-    std::ostream& os, const PrintableInstructionSequence& code);
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_COMPILER_INSTRUCTION_H_
diff --git a/src/v8/src/compiler/js-builtin-reducer.cc b/src/v8/src/compiler/js-builtin-reducer.cc
deleted file mode 100644
index 7ff2bf6..0000000
--- a/src/v8/src/compiler/js-builtin-reducer.cc
+++ /dev/null
@@ -1,2538 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/compiler/js-builtin-reducer.h"
-
-#include "src/base/bits.h"
-#include "src/builtins/builtins-utils.h"
-#include "src/code-factory.h"
-#include "src/compilation-dependencies.h"
-#include "src/compiler/access-builder.h"
-#include "src/compiler/allocation-builder.h"
-#include "src/compiler/js-graph.h"
-#include "src/compiler/linkage.h"
-#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties.h"
-#include "src/compiler/simplified-operator.h"
-#include "src/compiler/type-cache.h"
-#include "src/compiler/types.h"
-#include "src/objects-inl.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-// Helper class to access JSCall nodes that are potential candidates
-// for reduction when they have a BuiltinFunctionId associated with them.
-class JSCallReduction {
- public:
-  explicit JSCallReduction(Node* node) : node_(node) {}
-
-  // Determines whether the node is a JSCall operation that targets a
-  // constant callee being a well-known builtin with a BuiltinFunctionId.
-  bool HasBuiltinFunctionId() {
-    if (node_->opcode() != IrOpcode::kJSCall) return false;
-    HeapObjectMatcher m(NodeProperties::GetValueInput(node_, 0));
-    if (!m.HasValue() || !m.Value()->IsJSFunction()) return false;
-    Handle<JSFunction> function = Handle<JSFunction>::cast(m.Value());
-    return function->shared()->HasBuiltinFunctionId();
-  }
-
-  // Retrieves the BuiltinFunctionId as described above.
-  BuiltinFunctionId GetBuiltinFunctionId() {
-    DCHECK_EQ(IrOpcode::kJSCall, node_->opcode());
-    HeapObjectMatcher m(NodeProperties::GetValueInput(node_, 0));
-    Handle<JSFunction> function = Handle<JSFunction>::cast(m.Value());
-    return function->shared()->builtin_function_id();
-  }
-
-  bool ReceiverMatches(Type* type) {
-    return NodeProperties::GetType(receiver())->Is(type);
-  }
-
-  // Determines whether the call takes zero inputs.
-  bool InputsMatchZero() { return GetJSCallArity() == 0; }
-
-  // Determines whether the call takes one input of the given type.
-  bool InputsMatchOne(Type* t1) {
-    return GetJSCallArity() == 1 &&
-           NodeProperties::GetType(GetJSCallInput(0))->Is(t1);
-  }
-
-  // Determines whether the call takes two inputs of the given types.
-  bool InputsMatchTwo(Type* t1, Type* t2) {
-    return GetJSCallArity() == 2 &&
-           NodeProperties::GetType(GetJSCallInput(0))->Is(t1) &&
-           NodeProperties::GetType(GetJSCallInput(1))->Is(t2);
-  }
-
-  // Determines whether the call takes inputs all of the given type.
-  bool InputsMatchAll(Type* t) {
-    for (int i = 0; i < GetJSCallArity(); i++) {
-      if (!NodeProperties::GetType(GetJSCallInput(i))->Is(t)) {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  Node* receiver() { return NodeProperties::GetValueInput(node_, 1); }
-  Node* left() { return GetJSCallInput(0); }
-  Node* right() { return GetJSCallInput(1); }
-
-  int GetJSCallArity() {
-    DCHECK_EQ(IrOpcode::kJSCall, node_->opcode());
-    // Skip first (i.e. callee) and second (i.e. receiver) operand.
-    return node_->op()->ValueInputCount() - 2;
-  }
-
-  Node* GetJSCallInput(int index) {
-    DCHECK_EQ(IrOpcode::kJSCall, node_->opcode());
-    DCHECK_LT(index, GetJSCallArity());
-    // Skip first (i.e. callee) and second (i.e. receiver) operand.
-    return NodeProperties::GetValueInput(node_, index + 2);
-  }
-
- private:
-  Node* node_;
-};
-
-JSBuiltinReducer::JSBuiltinReducer(Editor* editor, JSGraph* jsgraph,
-                                   CompilationDependencies* dependencies,
-                                   Handle<Context> native_context)
-    : AdvancedReducer(editor),
-      dependencies_(dependencies),
-      jsgraph_(jsgraph),
-      native_context_(native_context),
-      type_cache_(TypeCache::Get()) {}
-
-namespace {
-
-Maybe<InstanceType> GetInstanceTypeWitness(Node* node) {
-  ZoneHandleSet<Map> maps;
-  Node* receiver = NodeProperties::GetValueInput(node, 1);
-  Node* effect = NodeProperties::GetEffectInput(node);
-  NodeProperties::InferReceiverMapsResult result =
-      NodeProperties::InferReceiverMaps(receiver, effect, &maps);
-
-  if (result == NodeProperties::kNoReceiverMaps || maps.size() == 0) {
-    return Nothing<InstanceType>();
-  }
-
-  InstanceType first_type = maps[0]->instance_type();
-  for (const Handle<Map>& map : maps) {
-    if (map->instance_type() != first_type) return Nothing<InstanceType>();
-  }
-  return Just(first_type);
-}
-
-bool CanInlineJSArrayIteration(Handle<Map> receiver_map) {
-  Isolate* const isolate = receiver_map->GetIsolate();
-  // Ensure that the [[Prototype]] is actually an exotic Array
-  if (!receiver_map->prototype()->IsJSArray()) return false;
-
-  // Don't inline JSArrays with slow elements of any kind
-  if (!IsFastElementsKind(receiver_map->elements_kind())) return false;
-
-  // If the receiver map has packed elements, no need to check the prototype.
-  // This requires a MapCheck where this is used.
-  if (!IsHoleyElementsKind(receiver_map->elements_kind())) return true;
-
-  Handle<JSArray> receiver_prototype(JSArray::cast(receiver_map->prototype()),
-                                     isolate);
-  // Ensure all prototypes of the {receiver} are stable.
-  for (PrototypeIterator it(isolate, receiver_prototype, kStartAtReceiver);
-       !it.IsAtEnd(); it.Advance()) {
-    Handle<JSReceiver> current = PrototypeIterator::GetCurrent<JSReceiver>(it);
-    if (!current->map()->is_stable()) return false;
-  }
-
-  // For holey Arrays, ensure that the no_elements_protector cell is valid (must
-  // be a CompilationDependency), and the JSArray prototype has not been
-  // altered.
-  return receiver_map->instance_type() == JS_ARRAY_TYPE &&
-         (!receiver_map->is_dictionary_map() || receiver_map->is_stable()) &&
-         isolate->IsNoElementsProtectorIntact() &&
-         isolate->IsAnyInitialArrayPrototype(receiver_prototype);
-}
-
-}  // namespace
-
-Reduction JSBuiltinReducer::ReduceArrayIterator(Node* node,
-                                                IterationKind kind) {
-  Handle<Map> receiver_map;
-  if (NodeProperties::GetMapWitness(node).ToHandle(&receiver_map)) {
-    return ReduceArrayIterator(receiver_map, node, kind,
-                               ArrayIteratorKind::kArray);
-  }
-  return NoChange();
-}
-
-Reduction JSBuiltinReducer::ReduceTypedArrayIterator(Node* node,
-                                                     IterationKind kind) {
-  Handle<Map> receiver_map;
-  if (NodeProperties::GetMapWitness(node).ToHandle(&receiver_map) &&
-      receiver_map->instance_type() == JS_TYPED_ARRAY_TYPE) {
-    return ReduceArrayIterator(receiver_map, node, kind,
-                               ArrayIteratorKind::kTypedArray);
-  }
-  return NoChange();
-}
-
-Reduction JSBuiltinReducer::ReduceArrayIterator(Handle<Map> receiver_map,
-                                                Node* node, IterationKind kind,
-                                                ArrayIteratorKind iter_kind) {
-  Node* receiver = NodeProperties::GetValueInput(node, 1);
-  Node* effect = NodeProperties::GetEffectInput(node);
-  Node* control = NodeProperties::GetControlInput(node);
-
-  if (iter_kind == ArrayIteratorKind::kTypedArray) {
-    // See if we can skip the neutering check.
-    if (isolate()->IsArrayBufferNeuteringIntact()) {
-      // Add a code dependency so we are deoptimized in case an ArrayBuffer
-      // gets neutered.
-      dependencies()->AssumePropertyCell(
-          factory()->array_buffer_neutering_protector());
-    } else {
-      // For JSTypedArray iterator methods, deopt if the buffer is neutered.
-      // This is potentially a deopt loop, but should be extremely unlikely.
-      DCHECK_EQ(JS_TYPED_ARRAY_TYPE, receiver_map->instance_type());
-      Node* buffer = effect = graph()->NewNode(
-          simplified()->LoadField(AccessBuilder::ForJSArrayBufferViewBuffer()),
-          receiver, effect, control);
-
-      // Deoptimize if the {buffer} has been neutered.
-      Node* check = effect = graph()->NewNode(
-          simplified()->ArrayBufferWasNeutered(), buffer, effect, control);
-      check = graph()->NewNode(simplified()->BooleanNot(), check);
-      effect = graph()->NewNode(
-          simplified()->CheckIf(DeoptimizeReason::kArrayBufferWasNeutered),
-          check, effect, control);
-    }
-  }
-
-  int map_index = -1;
-  Node* object_map = jsgraph()->UndefinedConstant();
-  switch (receiver_map->instance_type()) {
-    case JS_ARRAY_TYPE:
-      if (kind == IterationKind::kKeys) {
-        map_index = Context::FAST_ARRAY_KEY_ITERATOR_MAP_INDEX;
-      } else {
-        map_index = kind == IterationKind::kValues
-                        ? Context::FAST_SMI_ARRAY_VALUE_ITERATOR_MAP_INDEX
-                        : Context::FAST_SMI_ARRAY_KEY_VALUE_ITERATOR_MAP_INDEX;
-
-        if (CanInlineJSArrayIteration(receiver_map)) {
-          // Use `generic` elements for holey arrays if there may be elements
-          // on the prototype chain.
-          map_index += static_cast<int>(receiver_map->elements_kind());
-          object_map = jsgraph()->Constant(receiver_map);
-          if (IsHoleyElementsKind(receiver_map->elements_kind())) {
-            Handle<JSObject> initial_array_prototype(
-                native_context()->initial_array_prototype(), isolate());
-            dependencies()->AssumePrototypeMapsStable(receiver_map,
-                                                      initial_array_prototype);
-          }
-        } else {
-          map_index += (Context::GENERIC_ARRAY_VALUE_ITERATOR_MAP_INDEX -
-                        Context::FAST_SMI_ARRAY_VALUE_ITERATOR_MAP_INDEX);
-        }
-      }
-      break;
-    case JS_TYPED_ARRAY_TYPE:
-      if (kind == IterationKind::kKeys) {
-        map_index = Context::TYPED_ARRAY_KEY_ITERATOR_MAP_INDEX;
-      } else {
-        DCHECK_GE(receiver_map->elements_kind(), UINT8_ELEMENTS);
-        DCHECK_LE(receiver_map->elements_kind(), UINT8_CLAMPED_ELEMENTS);
-        map_index = (kind == IterationKind::kValues
-                         ? Context::UINT8_ARRAY_VALUE_ITERATOR_MAP_INDEX
-                         : Context::UINT8_ARRAY_KEY_VALUE_ITERATOR_MAP_INDEX) +
-                    (receiver_map->elements_kind() - UINT8_ELEMENTS);
-      }
-      break;
-    default:
-      if (kind == IterationKind::kKeys) {
-        map_index = Context::GENERIC_ARRAY_KEY_ITERATOR_MAP_INDEX;
-      } else if (kind == IterationKind::kValues) {
-        map_index = Context::GENERIC_ARRAY_VALUE_ITERATOR_MAP_INDEX;
-      } else {
-        map_index = Context::GENERIC_ARRAY_KEY_VALUE_ITERATOR_MAP_INDEX;
-      }
-      break;
-  }
-
-  DCHECK_GE(map_index, Context::TYPED_ARRAY_KEY_ITERATOR_MAP_INDEX);
-  DCHECK_LE(map_index, Context::GENERIC_ARRAY_VALUE_ITERATOR_MAP_INDEX);
-
-  Handle<Map> map(Map::cast(native_context()->get(map_index)), isolate());
-
-  // Allocate new iterator and attach the iterator to this object.
-  AllocationBuilder a(jsgraph(), effect, control);
-  a.Allocate(JSArrayIterator::kSize, NOT_TENURED, Type::OtherObject());
-  a.Store(AccessBuilder::ForMap(), map);
-  a.Store(AccessBuilder::ForJSObjectPropertiesOrHash(),
-          jsgraph()->EmptyFixedArrayConstant());
-  a.Store(AccessBuilder::ForJSObjectElements(),
-          jsgraph()->EmptyFixedArrayConstant());
-  a.Store(AccessBuilder::ForJSArrayIteratorObject(), receiver);
-  a.Store(AccessBuilder::ForJSArrayIteratorIndex(), jsgraph()->ZeroConstant());
-  a.Store(AccessBuilder::ForJSArrayIteratorObjectMap(), object_map);
-  Node* value = effect = a.Finish();
-
-  // Replace it.
-  ReplaceWithValue(node, value, effect, control);
-  return Replace(value);
-}
-
-Reduction JSBuiltinReducer::ReduceFastArrayIteratorNext(InstanceType type,
-                                                        Node* node,
-                                                        IterationKind kind) {
-  Node* iterator = NodeProperties::GetValueInput(node, 1);
-  Node* effect = NodeProperties::GetEffectInput(node);
-  Node* control = NodeProperties::GetControlInput(node);
-  Node* context = NodeProperties::GetContextInput(node);
-
-  if (kind != IterationKind::kKeys &&
-      !isolate()->IsFastArrayIterationIntact()) {
-    // Avoid deopt loops for non-key iteration if the
-    // fast_array_iteration_protector cell has been invalidated.
-    return NoChange();
-  }
-
-  ElementsKind elements_kind =
-      JSArrayIterator::ElementsKindForInstanceType(type);
-
-  if (IsHoleyElementsKind(elements_kind)) {
-    if (!isolate()->IsNoElementsProtectorIntact()) {
-      return NoChange();
-    } else {
-      Handle<JSObject> initial_array_prototype(
-          native_context()->initial_array_prototype(), isolate());
-      dependencies()->AssumePropertyCell(factory()->no_elements_protector());
-    }
-  }
-
-  Node* array = effect = graph()->NewNode(
-      simplified()->LoadField(AccessBuilder::ForJSArrayIteratorObject()),
-      iterator, effect, control);
-  Node* check0 = graph()->NewNode(simplified()->ReferenceEqual(), array,
-                                  jsgraph()->UndefinedConstant());
-  Node* branch0 =
-      graph()->NewNode(common()->Branch(BranchHint::kFalse), check0, control);
-
-  Node* vdone_false0;
-  Node* vfalse0;
-  Node* efalse0 = effect;
-  Node* if_false0 = graph()->NewNode(common()->IfFalse(), branch0);
-  {
-    // iterator.[[IteratedObject]] !== undefined, continue iterating.
-    Node* index = efalse0 = graph()->NewNode(
-        simplified()->LoadField(AccessBuilder::ForJSArrayIteratorIndex(
-            JS_ARRAY_TYPE, elements_kind)),
-        iterator, efalse0, if_false0);
-
-    Node* length = efalse0 = graph()->NewNode(
-        simplified()->LoadField(AccessBuilder::ForJSArrayLength(elements_kind)),
-        array, efalse0, if_false0);
-    Node* check1 =
-        graph()->NewNode(simplified()->NumberLessThan(), index, length);
-    Node* branch1 = graph()->NewNode(common()->Branch(BranchHint::kTrue),
-                                     check1, if_false0);
-
-    Node* vdone_true1;
-    Node* vtrue1;
-    Node* etrue1 = efalse0;
-    Node* if_true1 = graph()->NewNode(common()->IfTrue(), branch1);
-    {
-      // iterator.[[NextIndex]] < array.length, continue iterating
-      vdone_true1 = jsgraph()->FalseConstant();
-      if (kind == IterationKind::kKeys) {
-        vtrue1 = index;
-      } else {
-        // For value/entry iteration, first step is a mapcheck to ensure
-        // inlining is still valid.
-        Node* array_map = etrue1 =
-            graph()->NewNode(simplified()->LoadField(AccessBuilder::ForMap()),
-                             array, etrue1, if_true1);
-        Node* orig_map = etrue1 =
-            graph()->NewNode(simplified()->LoadField(
-                                 AccessBuilder::ForJSArrayIteratorObjectMap()),
-                             iterator, etrue1, if_true1);
-        Node* check_map = graph()->NewNode(simplified()->ReferenceEqual(),
-                                           array_map, orig_map);
-        etrue1 =
-            graph()->NewNode(simplified()->CheckIf(DeoptimizeReason::kWrongMap),
-                             check_map, etrue1, if_true1);
-      }
-
-      if (kind != IterationKind::kKeys) {
-        Node* elements = etrue1 = graph()->NewNode(
-            simplified()->LoadField(AccessBuilder::ForJSObjectElements()),
-            array, etrue1, if_true1);
-        Node* value = etrue1 = graph()->NewNode(
-            simplified()->LoadElement(
-                AccessBuilder::ForFixedArrayElement(elements_kind)),
-            elements, index, etrue1, if_true1);
-
-        // Convert hole to undefined if needed.
-        if (elements_kind == HOLEY_ELEMENTS ||
-            elements_kind == HOLEY_SMI_ELEMENTS) {
-          value = graph()->NewNode(simplified()->ConvertTaggedHoleToUndefined(),
-                                   value);
-        } else if (elements_kind == HOLEY_DOUBLE_ELEMENTS) {
-          // TODO(6587): avoid deopt if not all uses of value are truncated.
-          CheckFloat64HoleMode mode = CheckFloat64HoleMode::kAllowReturnHole;
-          value = etrue1 = graph()->NewNode(
-              simplified()->CheckFloat64Hole(mode), value, etrue1, if_true1);
-        }
-
-        if (kind == IterationKind::kEntries) {
-          // Allocate elements for key/value pair
-          vtrue1 = etrue1 =
-              graph()->NewNode(javascript()->CreateKeyValueArray(), index,
-                               value, context, etrue1);
-        } else {
-          DCHECK_EQ(kind, IterationKind::kValues);
-          vtrue1 = value;
-        }
-      }
-
-      Node* next_index = graph()->NewNode(simplified()->NumberAdd(), index,
-                                          jsgraph()->OneConstant());
-      next_index = graph()->NewNode(simplified()->NumberToUint32(), next_index);
-
-      etrue1 = graph()->NewNode(
-          simplified()->StoreField(AccessBuilder::ForJSArrayIteratorIndex(
-              JS_ARRAY_TYPE, elements_kind)),
-          iterator, next_index, etrue1, if_true1);
-    }
-
-    Node* vdone_false1;
-    Node* vfalse1;
-    Node* efalse1 = efalse0;
-    Node* if_false1 = graph()->NewNode(common()->IfFalse(), branch1);
-    {
-      // iterator.[[NextIndex]] >= array.length, stop iterating.
-      vdone_false1 = jsgraph()->TrueConstant();
-      vfalse1 = jsgraph()->UndefinedConstant();
-      efalse1 = graph()->NewNode(
-          simplified()->StoreField(AccessBuilder::ForJSArrayIteratorObject()),
-          iterator, vfalse1, efalse1, if_false1);
-    }
-
-    if_false0 = graph()->NewNode(common()->Merge(2), if_true1, if_false1);
-    efalse0 =
-        graph()->NewNode(common()->EffectPhi(2), etrue1, efalse1, if_false0);
-    vfalse0 = graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2),
-                               vtrue1, vfalse1, if_false0);
-    vdone_false0 =
-        graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2),
-                         vdone_true1, vdone_false1, if_false0);
-  }
-
-  Node* vdone_true0;
-  Node* vtrue0;
-  Node* etrue0 = effect;
-  Node* if_true0 = graph()->NewNode(common()->IfTrue(), branch0);
-  {
-    // iterator.[[IteratedObject]] === undefined, the iterator is done.
-    vdone_true0 = jsgraph()->TrueConstant();
-    vtrue0 = jsgraph()->UndefinedConstant();
-  }
-
-  control = graph()->NewNode(common()->Merge(2), if_false0, if_true0);
-  effect = graph()->NewNode(common()->EffectPhi(2), efalse0, etrue0, control);
-  Node* value =
-      graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2),
-                       vfalse0, vtrue0, control);
-  Node* done =
-      graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2),
-                       vdone_false0, vdone_true0, control);
-
-  // Create IteratorResult object.
-  value = effect = graph()->NewNode(javascript()->CreateIterResultObject(),
-                                    value, done, context, effect);
-  ReplaceWithValue(node, value, effect, control);
-  return Replace(value);
-}
-
-Reduction JSBuiltinReducer::ReduceTypedArrayIteratorNext(InstanceType type,
-                                                         Node* node,
-                                                         IterationKind kind) {
-  Node* iterator = NodeProperties::GetValueInput(node, 1);
-  Node* effect = NodeProperties::GetEffectInput(node);
-  Node* control = NodeProperties::GetControlInput(node);
-  Node* context = NodeProperties::GetContextInput(node);
-
-  ElementsKind elements_kind =
-      JSArrayIterator::ElementsKindForInstanceType(type);
-
-  Node* array = effect = graph()->NewNode(
-      simplified()->LoadField(AccessBuilder::ForJSArrayIteratorObject()),
-      iterator, effect, control);
-  Node* check0 = graph()->NewNode(simplified()->ReferenceEqual(), array,
-                                  jsgraph()->UndefinedConstant());
-  Node* branch0 =
-      graph()->NewNode(common()->Branch(BranchHint::kFalse), check0, control);
-
-  Node* vdone_false0;
-  Node* vfalse0;
-  Node* efalse0 = effect;
-  Node* if_false0 = graph()->NewNode(common()->IfFalse(), branch0);
-  {
-    // iterator.[[IteratedObject]] !== undefined, continue iterating.
-    Node* index = efalse0 = graph()->NewNode(
-        simplified()->LoadField(AccessBuilder::ForJSArrayIteratorIndex(
-            JS_TYPED_ARRAY_TYPE, elements_kind)),
-        iterator, efalse0, if_false0);
-
-    // typedarray.[[ViewedArrayBuffer]]
-    Node* buffer = efalse0 = graph()->NewNode(
-        simplified()->LoadField(AccessBuilder::ForJSArrayBufferViewBuffer()),
-        array, efalse0, if_false0);
-
-    // See if we can skip the neutering check.
-    if (isolate()->IsArrayBufferNeuteringIntact()) {
-      // Add a code dependency so we are deoptimized in case an ArrayBuffer
-      // gets neutered.
-      dependencies()->AssumePropertyCell(
-          factory()->array_buffer_neutering_protector());
-    } else {
-      // Deoptimize if the array buffer was neutered.
-      Node* check1 = efalse0 = graph()->NewNode(
-          simplified()->ArrayBufferWasNeutered(), buffer, efalse0, if_false0);
-      check1 = graph()->NewNode(simplified()->BooleanNot(), check1);
-      efalse0 = graph()->NewNode(
-          simplified()->CheckIf(DeoptimizeReason::kArrayBufferWasNeutered),
-          check1, efalse0, if_false0);
-    }
-
-    Node* length = efalse0 = graph()->NewNode(
-        simplified()->LoadField(AccessBuilder::ForJSTypedArrayLength()), array,
-        efalse0, if_false0);
-
-    Node* check2 =
-        graph()->NewNode(simplified()->NumberLessThan(), index, length);
-    Node* branch2 = graph()->NewNode(common()->Branch(BranchHint::kTrue),
-                                     check2, if_false0);
-
-    Node* vdone_true2;
-    Node* vtrue2;
-    Node* etrue2 = efalse0;
-    Node* if_true2 = graph()->NewNode(common()->IfTrue(), branch2);
-    {
-      // iterator.[[NextIndex]] < array.length, continue iterating
-      vdone_true2 = jsgraph()->FalseConstant();
-      if (kind == IterationKind::kKeys) {
-        vtrue2 = index;
-      }
-
-      Node* next_index = graph()->NewNode(simplified()->NumberAdd(), index,
-                                          jsgraph()->OneConstant());
-      next_index = graph()->NewNode(simplified()->NumberToUint32(), next_index);
-
-      etrue2 = graph()->NewNode(
-          simplified()->StoreField(AccessBuilder::ForJSArrayIteratorIndex(
-              JS_TYPED_ARRAY_TYPE, elements_kind)),
-          iterator, next_index, etrue2, if_true2);
-
-      if (kind != IterationKind::kKeys) {
-        Node* elements = etrue2 = graph()->NewNode(
-            simplified()->LoadField(AccessBuilder::ForJSObjectElements()),
-            array, etrue2, if_true2);
-        Node* base_ptr = etrue2 = graph()->NewNode(
-            simplified()->LoadField(
-                AccessBuilder::ForFixedTypedArrayBaseBasePointer()),
-            elements, etrue2, if_true2);
-        Node* external_ptr = etrue2 = graph()->NewNode(
-            simplified()->LoadField(
-                AccessBuilder::ForFixedTypedArrayBaseExternalPointer()),
-            elements, etrue2, if_true2);
-
-        ExternalArrayType array_type = kExternalInt8Array;
-        switch (elements_kind) {
-#define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \
-  case TYPE##_ELEMENTS:                                 \
-    array_type = kExternal##Type##Array;                \
-    break;
-          TYPED_ARRAYS(TYPED_ARRAY_CASE)
-          default:
-            UNREACHABLE();
-#undef TYPED_ARRAY_CASE
-        }
-
-        Node* value = etrue2 =
-            graph()->NewNode(simplified()->LoadTypedElement(array_type), buffer,
-                             base_ptr, external_ptr, index, etrue2, if_true2);
-
-        if (kind == IterationKind::kEntries) {
-          // Allocate elements for key/value pair
-          vtrue2 = etrue2 =
-              graph()->NewNode(javascript()->CreateKeyValueArray(), index,
-                               value, context, etrue2);
-        } else {
-          DCHECK_EQ(IterationKind::kValues, kind);
-          vtrue2 = value;
-        }
-      }
-    }
-
-    Node* vdone_false2;
-    Node* vfalse2;
-    Node* efalse2 = efalse0;
-    Node* if_false2 = graph()->NewNode(common()->IfFalse(), branch2);
-    {
-      // iterator.[[NextIndex]] >= array.length, stop iterating.
-      vdone_false2 = jsgraph()->TrueConstant();
-      vfalse2 = jsgraph()->UndefinedConstant();
-      efalse2 = graph()->NewNode(
-          simplified()->StoreField(AccessBuilder::ForJSArrayIteratorObject()),
-          iterator, vfalse2, efalse2, if_false2);
-    }
-
-    if_false0 = graph()->NewNode(common()->Merge(2), if_true2, if_false2);
-    efalse0 =
-        graph()->NewNode(common()->EffectPhi(2), etrue2, efalse2, if_false0);
-    vfalse0 = graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2),
-                               vtrue2, vfalse2, if_false0);
-    vdone_false0 =
-        graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2),
-                         vdone_true2, vdone_false2, if_false0);
-  }
-
-  Node* vdone_true0;
-  Node* vtrue0;
-  Node* etrue0 = effect;
-  Node* if_true0 = graph()->NewNode(common()->IfTrue(), branch0);
-  {
-    // iterator.[[IteratedObject]] === undefined, the iterator is done.
-    vdone_true0 = jsgraph()->TrueConstant();
-    vtrue0 = jsgraph()->UndefinedConstant();
-  }
-
-  control = graph()->NewNode(common()->Merge(2), if_false0, if_true0);
-  effect = graph()->NewNode(common()->EffectPhi(2), efalse0, etrue0, control);
-  Node* value =
-      graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2),
-                       vfalse0, vtrue0, control);
-  Node* done =
-      graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2),
-                       vdone_false0, vdone_true0, control);
-
-  // Create IteratorResult object.
-  value = effect = graph()->NewNode(javascript()->CreateIterResultObject(),
-                                    value, done, context, effect);
-  ReplaceWithValue(node, value, effect, control);
-  return Replace(value);
-}
-
-// ES #sec-get-%typedarray%.prototype-@@tostringtag
-Reduction JSBuiltinReducer::ReduceTypedArrayToStringTag(Node* node) {
-  Node* receiver = NodeProperties::GetValueInput(node, 1);
-  Node* effect = NodeProperties::GetEffectInput(node);
-  Node* control = NodeProperties::GetControlInput(node);
-
-  NodeVector values(graph()->zone());
-  NodeVector effects(graph()->zone());
-  NodeVector controls(graph()->zone());
-
-  Node* check = graph()->NewNode(simplified()->ObjectIsSmi(), receiver);
-  control =
-      graph()->NewNode(common()->Branch(BranchHint::kFalse), check, control);
-
-  values.push_back(jsgraph()->UndefinedConstant());
-  effects.push_back(effect);
-  controls.push_back(graph()->NewNode(common()->IfTrue(), control));
-
-  control = graph()->NewNode(common()->IfFalse(), control);
-  Node* receiver_map = effect =
-      graph()->NewNode(simplified()->LoadField(AccessBuilder::ForMap()),
-                       receiver, effect, control);
-  Node* receiver_bit_field2 = effect = graph()->NewNode(
-      simplified()->LoadField(AccessBuilder::ForMapBitField2()), receiver_map,
-      effect, control);
-  Node* receiver_elements_kind = graph()->NewNode(
-      simplified()->NumberShiftRightLogical(),
-      graph()->NewNode(simplified()->NumberBitwiseAnd(), receiver_bit_field2,
-                       jsgraph()->Constant(Map::ElementsKindBits::kMask)),
-      jsgraph()->Constant(Map::ElementsKindBits::kShift));
-
-  // Offset the elements kind by FIRST_FIXED_TYPED_ARRAY_ELEMENTS_KIND,
-  // so that the branch cascade below is turned into a simple table
-  // switch by the ControlFlowOptimizer later.
-  receiver_elements_kind = graph()->NewNode(
-      simplified()->NumberSubtract(), receiver_elements_kind,
-      jsgraph()->Constant(FIRST_FIXED_TYPED_ARRAY_ELEMENTS_KIND));
-
-#define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size)                \
-  do {                                                                 \
-    Node* check = graph()->NewNode(                                    \
-        simplified()->NumberEqual(), receiver_elements_kind,           \
-        jsgraph()->Constant(TYPE##_ELEMENTS -                          \
-                            FIRST_FIXED_TYPED_ARRAY_ELEMENTS_KIND));   \
-    control = graph()->NewNode(common()->Branch(), check, control);    \
-    values.push_back(jsgraph()->HeapConstant(                          \
-        factory()->InternalizeUtf8String(#Type "Array")));             \
-    effects.push_back(effect);                                         \
-    controls.push_back(graph()->NewNode(common()->IfTrue(), control)); \
-    control = graph()->NewNode(common()->IfFalse(), control);          \
-  } while (false);
-  TYPED_ARRAYS(TYPED_ARRAY_CASE)
-#undef TYPED_ARRAY_CASE
-
-  values.push_back(jsgraph()->UndefinedConstant());
-  effects.push_back(effect);
-  controls.push_back(control);
-
-  int const count = static_cast<int>(controls.size());
-  control = graph()->NewNode(common()->Merge(count), count, &controls.front());
-  effects.push_back(control);
-  effect =
-      graph()->NewNode(common()->EffectPhi(count), count + 1, &effects.front());
-  values.push_back(control);
-  Node* value =
-      graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, count),
-                       count + 1, &values.front());
-  ReplaceWithValue(node, value, effect, control);
-  return Replace(value);
-}
-
-Reduction JSBuiltinReducer::ReduceArrayIteratorNext(Node* node) {
-  Maybe<InstanceType> maybe_type = GetInstanceTypeWitness(node);
-  if (!maybe_type.IsJust()) return NoChange();
-  InstanceType type = maybe_type.FromJust();
-  switch (type) {
-    case JS_TYPED_ARRAY_KEY_ITERATOR_TYPE:
-      return ReduceTypedArrayIteratorNext(type, node, IterationKind::kKeys);
-
-    case JS_FAST_ARRAY_KEY_ITERATOR_TYPE:
-      return ReduceFastArrayIteratorNext(type, node, IterationKind::kKeys);
-
-    case JS_INT8_ARRAY_KEY_VALUE_ITERATOR_TYPE:
-    case JS_UINT8_ARRAY_KEY_VALUE_ITERATOR_TYPE:
-    case JS_INT16_ARRAY_KEY_VALUE_ITERATOR_TYPE:
-    case JS_UINT16_ARRAY_KEY_VALUE_ITERATOR_TYPE:
-    case JS_INT32_ARRAY_KEY_VALUE_ITERATOR_TYPE:
-    case JS_UINT32_ARRAY_KEY_VALUE_ITERATOR_TYPE:
-    case JS_FLOAT32_ARRAY_KEY_VALUE_ITERATOR_TYPE:
-    case JS_FLOAT64_ARRAY_KEY_VALUE_ITERATOR_TYPE:
-    case JS_UINT8_CLAMPED_ARRAY_KEY_VALUE_ITERATOR_TYPE:
-      return ReduceTypedArrayIteratorNext(type, node, IterationKind::kEntries);
-
-    case JS_FAST_SMI_ARRAY_KEY_VALUE_ITERATOR_TYPE:
-    case JS_FAST_HOLEY_SMI_ARRAY_KEY_VALUE_ITERATOR_TYPE:
-    case JS_FAST_ARRAY_KEY_VALUE_ITERATOR_TYPE:
-    case JS_FAST_HOLEY_ARRAY_KEY_VALUE_ITERATOR_TYPE:
-    case JS_FAST_DOUBLE_ARRAY_KEY_VALUE_ITERATOR_TYPE:
-    case JS_FAST_HOLEY_DOUBLE_ARRAY_KEY_VALUE_ITERATOR_TYPE:
-      return ReduceFastArrayIteratorNext(type, node, IterationKind::kEntries);
-
-    case JS_INT8_ARRAY_VALUE_ITERATOR_TYPE:
-    case JS_UINT8_ARRAY_VALUE_ITERATOR_TYPE:
-    case JS_INT16_ARRAY_VALUE_ITERATOR_TYPE:
-    case JS_UINT16_ARRAY_VALUE_ITERATOR_TYPE:
-    case JS_INT32_ARRAY_VALUE_ITERATOR_TYPE:
-    case JS_UINT32_ARRAY_VALUE_ITERATOR_TYPE:
-    case JS_FLOAT32_ARRAY_VALUE_ITERATOR_TYPE:
-    case JS_FLOAT64_ARRAY_VALUE_ITERATOR_TYPE:
-    case JS_UINT8_CLAMPED_ARRAY_VALUE_ITERATOR_TYPE:
-      return ReduceTypedArrayIteratorNext(type, node, IterationKind::kValues);
-
-    case JS_FAST_SMI_ARRAY_VALUE_ITERATOR_TYPE:
-    case JS_FAST_HOLEY_SMI_ARRAY_VALUE_ITERATOR_TYPE:
-    case JS_FAST_ARRAY_VALUE_ITERATOR_TYPE:
-    case JS_FAST_HOLEY_ARRAY_VALUE_ITERATOR_TYPE:
-    case JS_FAST_DOUBLE_ARRAY_VALUE_ITERATOR_TYPE:
-    case JS_FAST_HOLEY_DOUBLE_ARRAY_VALUE_ITERATOR_TYPE:
-      return ReduceFastArrayIteratorNext(type, node, IterationKind::kValues);
-
-    default:
-      // Slow array iterators are not reduced
-      return NoChange();
-  }
-}
-
-// ES6 section 22.1.2.2 Array.isArray ( arg )
-Reduction JSBuiltinReducer::ReduceArrayIsArray(Node* node) {
-  // We certainly know that undefined is not an array.
-  if (node->op()->ValueInputCount() < 3) {
-    Node* value = jsgraph()->FalseConstant();
-    ReplaceWithValue(node, value);
-    return Replace(value);
-  }
-  Node* value = NodeProperties::GetValueInput(node, 2);
-  Type* value_type = NodeProperties::GetType(value);
-  Node* context = NodeProperties::GetContextInput(node);
-  Node* frame_state = NodeProperties::GetFrameStateInput(node);
-  Node* effect = NodeProperties::GetEffectInput(node);
-  Node* control = NodeProperties::GetControlInput(node);
-
-  // Constant-fold based on {value} type.
-  if (value_type->Is(Type::Array())) {
-    Node* value = jsgraph()->TrueConstant();
-    ReplaceWithValue(node, value);
-    return Replace(value);
-  } else if (!value_type->Maybe(Type::ArrayOrProxy())) {
-    Node* value = jsgraph()->FalseConstant();
-    ReplaceWithValue(node, value);
-    return Replace(value);
-  }
-
-  int count = 0;
-  Node* values[5];
-  Node* effects[5];
-  Node* controls[4];
-
-  // Check if the {value} is a Smi.
-  Node* check = graph()->NewNode(simplified()->ObjectIsSmi(), value);
-  control =
-      graph()->NewNode(common()->Branch(BranchHint::kFalse), check, control);
-
-  // The {value} is a Smi.
-  controls[count] = graph()->NewNode(common()->IfTrue(), control);
-  effects[count] = effect;
-  values[count] = jsgraph()->FalseConstant();
-  count++;
-
-  control = graph()->NewNode(common()->IfFalse(), control);
-
-  // Load the {value}s instance type.
-  Node* value_map = effect = graph()->NewNode(
-      simplified()->LoadField(AccessBuilder::ForMap()), value, effect, control);
-  Node* value_instance_type = effect = graph()->NewNode(
-      simplified()->LoadField(AccessBuilder::ForMapInstanceType()), value_map,
-      effect, control);
-
-  // Check if the {value} is a JSArray.
-  check = graph()->NewNode(simplified()->NumberEqual(), value_instance_type,
-                           jsgraph()->Constant(JS_ARRAY_TYPE));
-  control = graph()->NewNode(common()->Branch(), check, control);
-
-  // The {value} is a JSArray.
-  controls[count] = graph()->NewNode(common()->IfTrue(), control);
-  effects[count] = effect;
-  values[count] = jsgraph()->TrueConstant();
-  count++;
-
-  control = graph()->NewNode(common()->IfFalse(), control);
-
-  // Check if the {value} is a JSProxy.
-  check = graph()->NewNode(simplified()->NumberEqual(), value_instance_type,
-                           jsgraph()->Constant(JS_PROXY_TYPE));
-  control =
-      graph()->NewNode(common()->Branch(BranchHint::kFalse), check, control);
-
-  // The {value} is neither a JSArray nor a JSProxy.
-  controls[count] = graph()->NewNode(common()->IfFalse(), control);
-  effects[count] = effect;
-  values[count] = jsgraph()->FalseConstant();
-  count++;
-
-  control = graph()->NewNode(common()->IfTrue(), control);
-
-  // Let the %ArrayIsArray runtime function deal with the JSProxy {value}.
-  value = effect = control =
-      graph()->NewNode(javascript()->CallRuntime(Runtime::kArrayIsArray), value,
-                       context, frame_state, effect, control);
-  NodeProperties::SetType(value, Type::Boolean());
-
-  // Update potential {IfException} uses of {node} to point to the above
-  // %ArrayIsArray runtime call node instead.
-  Node* on_exception = nullptr;
-  if (NodeProperties::IsExceptionalCall(node, &on_exception)) {
-    NodeProperties::ReplaceControlInput(on_exception, control);
-    NodeProperties::ReplaceEffectInput(on_exception, effect);
-    control = graph()->NewNode(common()->IfSuccess(), control);
-    Revisit(on_exception);
-  }
-
-  // The {value} is neither a JSArray nor a JSProxy.
-  controls[count] = control;
-  effects[count] = effect;
-  values[count] = value;
-  count++;
-
-  control = graph()->NewNode(common()->Merge(count), count, controls);
-  effects[count] = control;
-  values[count] = control;
-  effect = graph()->NewNode(common()->EffectPhi(count), count + 1, effects);
-  value = graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, count),
-                           count + 1, values);
-  ReplaceWithValue(node, value, effect, control);
-  return Replace(value);
-}
-
-namespace {
-
-bool HasInstanceTypeWitness(Node* receiver, Node* effect,
-                            InstanceType instance_type) {
-  ZoneHandleSet<Map> receiver_maps;
-  NodeProperties::InferReceiverMapsResult result =
-      NodeProperties::InferReceiverMaps(receiver, effect, &receiver_maps);
-  switch (result) {
-    case NodeProperties::kUnreliableReceiverMaps:
-    case NodeProperties::kReliableReceiverMaps:
-      DCHECK_NE(0, receiver_maps.size());
-      for (size_t i = 0; i < receiver_maps.size(); ++i) {
-        if (receiver_maps[i]->instance_type() != instance_type) return false;
-      }
-      return true;
-
-    case NodeProperties::kNoReceiverMaps:
-      return false;
-  }
-  UNREACHABLE();
-}
-
-}  // namespace
-
-Reduction JSBuiltinReducer::ReduceCollectionIterator(
-    Node* node, InstanceType collection_instance_type,
-    int collection_iterator_map_index) {
-  DCHECK_EQ(IrOpcode::kJSCall, node->opcode());
-  Node* receiver = NodeProperties::GetValueInput(node, 1);
-  Node* effect = NodeProperties::GetEffectInput(node);
-  Node* control = NodeProperties::GetControlInput(node);
-  if (HasInstanceTypeWitness(receiver, effect, collection_instance_type)) {
-    // Figure out the proper collection iterator map.
-    Handle<Map> collection_iterator_map(
-        Map::cast(native_context()->get(collection_iterator_map_index)),
-        isolate());
-
-    // Load the OrderedHashTable from the {receiver}.
-    Node* table = effect = graph()->NewNode(
-        simplified()->LoadField(AccessBuilder::ForJSCollectionTable()),
-        receiver, effect, control);
-
-    // Create the JSCollectionIterator result.
-    AllocationBuilder a(jsgraph(), effect, control);
-    a.Allocate(JSCollectionIterator::kSize, NOT_TENURED, Type::OtherObject());
-    a.Store(AccessBuilder::ForMap(), collection_iterator_map);
-    a.Store(AccessBuilder::ForJSObjectPropertiesOrHash(),
-            jsgraph()->EmptyFixedArrayConstant());
-    a.Store(AccessBuilder::ForJSObjectElements(),
-            jsgraph()->EmptyFixedArrayConstant());
-    a.Store(AccessBuilder::ForJSCollectionIteratorTable(), table);
-    a.Store(AccessBuilder::ForJSCollectionIteratorIndex(),
-            jsgraph()->ZeroConstant());
-    Node* value = effect = a.Finish();
-    ReplaceWithValue(node, value, effect, control);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-Reduction JSBuiltinReducer::ReduceCollectionSize(
-    Node* node, InstanceType collection_instance_type) {
-  DCHECK_EQ(IrOpcode::kJSCall, node->opcode());
-  Node* receiver = NodeProperties::GetValueInput(node, 1);
-  Node* effect = NodeProperties::GetEffectInput(node);
-  Node* control = NodeProperties::GetControlInput(node);
-  if (HasInstanceTypeWitness(receiver, effect, collection_instance_type)) {
-    Node* table = effect = graph()->NewNode(
-        simplified()->LoadField(AccessBuilder::ForJSCollectionTable()),
-        receiver, effect, control);
-    Node* value = effect = graph()->NewNode(
-        simplified()->LoadField(
-            AccessBuilder::ForOrderedHashTableBaseNumberOfElements()),
-        table, effect, control);
-    ReplaceWithValue(node, value, effect, control);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-Reduction JSBuiltinReducer::ReduceCollectionIteratorNext(
-    Node* node, int entry_size, Handle<HeapObject> empty_collection,
-    InstanceType collection_iterator_instance_type_first,
-    InstanceType collection_iterator_instance_type_last) {
-  DCHECK_EQ(IrOpcode::kJSCall, node->opcode());
-  Node* receiver = NodeProperties::GetValueInput(node, 1);
-  Node* context = NodeProperties::GetContextInput(node);
-  Node* effect = NodeProperties::GetEffectInput(node);
-  Node* control = NodeProperties::GetControlInput(node);
-
-  // A word of warning to begin with: This whole method might look a bit
-  // strange at times, but that's mostly because it was carefully handcrafted
-  // to allow for full escape analysis and scalar replacement of both the
-  // collection iterator object and the iterator results, including the
-  // key-value arrays in case of Set/Map entry iteration.
-  //
-  // TODO(turbofan): Currently the escape analysis (and the store-load
-  // forwarding) is unable to eliminate the allocations for the key-value
-  // arrays in case of Set/Map entry iteration, and we should investigate
-  // how to update the escape analysis / arrange the graph in a way that
-  // this becomes possible.
-
-  // Infer the {receiver} instance type.
-  InstanceType receiver_instance_type;
-  ZoneHandleSet<Map> receiver_maps;
-  NodeProperties::InferReceiverMapsResult result =
-      NodeProperties::InferReceiverMaps(receiver, effect, &receiver_maps);
-  if (result == NodeProperties::kNoReceiverMaps) return NoChange();
-  DCHECK_NE(0, receiver_maps.size());
-  receiver_instance_type = receiver_maps[0]->instance_type();
-  for (size_t i = 1; i < receiver_maps.size(); ++i) {
-    if (receiver_maps[i]->instance_type() != receiver_instance_type) {
-      return NoChange();
-    }
-  }
-  if (receiver_instance_type < collection_iterator_instance_type_first ||
-      receiver_instance_type > collection_iterator_instance_type_last) {
-    return NoChange();
-  }
-
-  // Transition the JSCollectionIterator {receiver} if necessary
-  // (i.e. there were certain mutations while we're iterating).
-  {
-    Node* done_loop;
-    Node* done_eloop;
-    Node* loop = control =
-        graph()->NewNode(common()->Loop(2), control, control);
-    Node* eloop = effect =
-        graph()->NewNode(common()->EffectPhi(2), effect, effect, loop);
-    Node* terminate = graph()->NewNode(common()->Terminate(), eloop, loop);
-    NodeProperties::MergeControlToEnd(graph(), common(), terminate);
-
-    // Check if reached the final table of the {receiver}.
-    Node* table = effect = graph()->NewNode(
-        simplified()->LoadField(AccessBuilder::ForJSCollectionIteratorTable()),
-        receiver, effect, control);
-    Node* next_table = effect =
-        graph()->NewNode(simplified()->LoadField(
-                             AccessBuilder::ForOrderedHashTableBaseNextTable()),
-                         table, effect, control);
-    Node* check = graph()->NewNode(simplified()->ObjectIsSmi(), next_table);
-    control =
-        graph()->NewNode(common()->Branch(BranchHint::kTrue), check, control);
-
-    // Abort the {loop} when we reach the final table.
-    done_loop = graph()->NewNode(common()->IfTrue(), control);
-    done_eloop = effect;
-
-    // Migrate to the {next_table} otherwise.
-    control = graph()->NewNode(common()->IfFalse(), control);
-
-    // Self-heal the {receiver}s index.
-    Node* index = effect = graph()->NewNode(
-        simplified()->LoadField(AccessBuilder::ForJSCollectionIteratorIndex()),
-        receiver, effect, control);
-    Callable const callable =
-        Builtins::CallableFor(isolate(), Builtins::kOrderedHashTableHealIndex);
-    CallDescriptor const* const desc = Linkage::GetStubCallDescriptor(
-        isolate(), graph()->zone(), callable.descriptor(), 0,
-        CallDescriptor::kNoFlags, Operator::kEliminatable);
-    index = effect = graph()->NewNode(
-        common()->Call(desc), jsgraph()->HeapConstant(callable.code()), table,
-        index, jsgraph()->NoContextConstant(), effect);
-    NodeProperties::SetType(index, type_cache_.kFixedArrayLengthType);
-
-    // Update the {index} and {table} on the {receiver}.
-    effect = graph()->NewNode(
-        simplified()->StoreField(AccessBuilder::ForJSCollectionIteratorIndex()),
-        receiver, index, effect, control);
-    effect = graph()->NewNode(
-        simplified()->StoreField(AccessBuilder::ForJSCollectionIteratorTable()),
-        receiver, next_table, effect, control);
-
-    // Tie the knot.
-    loop->ReplaceInput(1, control);
-    eloop->ReplaceInput(1, effect);
-
-    control = done_loop;
-    effect = done_eloop;
-  }
-
-  // Get current index and table from the JSCollectionIterator {receiver}.
-  Node* index = effect = graph()->NewNode(
-      simplified()->LoadField(AccessBuilder::ForJSCollectionIteratorIndex()),
-      receiver, effect, control);
-  Node* table = effect = graph()->NewNode(
-      simplified()->LoadField(AccessBuilder::ForJSCollectionIteratorTable()),
-      receiver, effect, control);
-
-  // Create the {JSIteratorResult} first to ensure that we always have
-  // a dominating Allocate node for the allocation folding phase.
-  Node* iterator_result = effect = graph()->NewNode(
-      javascript()->CreateIterResultObject(), jsgraph()->UndefinedConstant(),
-      jsgraph()->TrueConstant(), context, effect);
-
-  // Look for the next non-holey key, starting from {index} in the {table}.
-  Node* controls[2];
-  Node* effects[3];
-  {
-    // Compute the currently used capacity.
-    Node* number_of_buckets = effect = graph()->NewNode(
-        simplified()->LoadField(
-            AccessBuilder::ForOrderedHashTableBaseNumberOfBuckets()),
-        table, effect, control);
-    Node* number_of_elements = effect = graph()->NewNode(
-        simplified()->LoadField(
-            AccessBuilder::ForOrderedHashTableBaseNumberOfElements()),
-        table, effect, control);
-    Node* number_of_deleted_elements = effect = graph()->NewNode(
-        simplified()->LoadField(
-            AccessBuilder::ForOrderedHashTableBaseNumberOfDeletedElements()),
-        table, effect, control);
-    Node* used_capacity =
-        graph()->NewNode(simplified()->NumberAdd(), number_of_elements,
-                         number_of_deleted_elements);
-
-    // Skip holes and update the {index}.
-    Node* loop = graph()->NewNode(common()->Loop(2), control, control);
-    Node* eloop =
-        graph()->NewNode(common()->EffectPhi(2), effect, effect, loop);
-    Node* terminate = graph()->NewNode(common()->Terminate(), eloop, loop);
-    NodeProperties::MergeControlToEnd(graph(), common(), terminate);
-    Node* iloop = graph()->NewNode(
-        common()->Phi(MachineRepresentation::kTagged, 2), index, index, loop);
-    NodeProperties::SetType(iloop, type_cache_.kFixedArrayLengthType);
-    {
-      Node* check0 = graph()->NewNode(simplified()->NumberLessThan(), iloop,
-                                      used_capacity);
-      Node* branch0 =
-          graph()->NewNode(common()->Branch(BranchHint::kTrue), check0, loop);
-
-      Node* if_false0 = graph()->NewNode(common()->IfFalse(), branch0);
-      Node* efalse0 = eloop;
-      {
-        // Mark the {receiver} as exhausted.
-        efalse0 = graph()->NewNode(
-            simplified()->StoreField(
-                AccessBuilder::ForJSCollectionIteratorTable()),
-            receiver, jsgraph()->HeapConstant(empty_collection), efalse0,
-            if_false0);
-
-        controls[0] = if_false0;
-        effects[0] = efalse0;
-      }
-
-      Node* if_true0 = graph()->NewNode(common()->IfTrue(), branch0);
-      Node* etrue0 = eloop;
-      {
-        // Load the key of the entry.
-        Node* entry_start_position = graph()->NewNode(
-            simplified()->NumberAdd(),
-            graph()->NewNode(
-                simplified()->NumberAdd(),
-                graph()->NewNode(simplified()->NumberMultiply(), iloop,
-                                 jsgraph()->Constant(entry_size)),
-                number_of_buckets),
-            jsgraph()->Constant(OrderedHashTableBase::kHashTableStartIndex));
-        Node* entry_key = etrue0 = graph()->NewNode(
-            simplified()->LoadElement(AccessBuilder::ForFixedArrayElement()),
-            table, entry_start_position, etrue0, if_true0);
-
-        // Advance the index.
-        Node* index = graph()->NewNode(simplified()->NumberAdd(), iloop,
-                                       jsgraph()->OneConstant());
-
-        Node* check1 =
-            graph()->NewNode(simplified()->ReferenceEqual(), entry_key,
-                             jsgraph()->TheHoleConstant());
-        Node* branch1 = graph()->NewNode(common()->Branch(BranchHint::kFalse),
-                                         check1, if_true0);
-
-        {
-          // Abort loop with resulting value.
-          Node* control = graph()->NewNode(common()->IfFalse(), branch1);
-          Node* effect = etrue0;
-          Node* value = effect =
-              graph()->NewNode(common()->TypeGuard(Type::NonInternal()),
-                               entry_key, effect, control);
-          Node* done = jsgraph()->FalseConstant();
-
-          // Advance the index on the {receiver}.
-          effect = graph()->NewNode(
-              simplified()->StoreField(
-                  AccessBuilder::ForJSCollectionIteratorIndex()),
-              receiver, index, effect, control);
-
-          // The actual {value} depends on the {receiver} iteration type.
-          switch (receiver_instance_type) {
-            case JS_MAP_KEY_ITERATOR_TYPE:
-            case JS_SET_VALUE_ITERATOR_TYPE:
-              break;
-
-            case JS_SET_KEY_VALUE_ITERATOR_TYPE:
-              value = effect =
-                  graph()->NewNode(javascript()->CreateKeyValueArray(), value,
-                                   value, context, effect);
-              break;
-
-            case JS_MAP_VALUE_ITERATOR_TYPE:
-              value = effect = graph()->NewNode(
-                  simplified()->LoadElement(
-                      AccessBuilder::ForFixedArrayElement()),
-                  table,
-                  graph()->NewNode(
-                      simplified()->NumberAdd(), entry_start_position,
-                      jsgraph()->Constant(OrderedHashMap::kValueOffset)),
-                  effect, control);
-              break;
-
-            case JS_MAP_KEY_VALUE_ITERATOR_TYPE:
-              value = effect = graph()->NewNode(
-                  simplified()->LoadElement(
-                      AccessBuilder::ForFixedArrayElement()),
-                  table,
-                  graph()->NewNode(
-                      simplified()->NumberAdd(), entry_start_position,
-                      jsgraph()->Constant(OrderedHashMap::kValueOffset)),
-                  effect, control);
-              value = effect =
-                  graph()->NewNode(javascript()->CreateKeyValueArray(),
-                                   entry_key, value, context, effect);
-              break;
-
-            default:
-              UNREACHABLE();
-              break;
-          }
-
-          // Store final {value} and {done} into the {iterator_result}.
-          effect =
-              graph()->NewNode(simplified()->StoreField(
-                                   AccessBuilder::ForJSIteratorResultValue()),
-                               iterator_result, value, effect, control);
-          effect =
-              graph()->NewNode(simplified()->StoreField(
-                                   AccessBuilder::ForJSIteratorResultDone()),
-                               iterator_result, done, effect, control);
-
-          controls[1] = control;
-          effects[1] = effect;
-        }
-
-        // Continue with next loop index.
-        loop->ReplaceInput(1, graph()->NewNode(common()->IfTrue(), branch1));
-        eloop->ReplaceInput(1, etrue0);
-        iloop->ReplaceInput(1, index);
-      }
-    }
-
-    control = effects[2] = graph()->NewNode(common()->Merge(2), 2, controls);
-    effect = graph()->NewNode(common()->EffectPhi(2), 3, effects);
-  }
-
-  // Yield the final {iterator_result}.
-  ReplaceWithValue(node, iterator_result, effect, control);
-  return Replace(iterator_result);
-}
-
-// ES6 section 20.3.3.1 Date.now ( )
-Reduction JSBuiltinReducer::ReduceDateNow(Node* node) {
-  NodeProperties::RemoveValueInputs(node);
-  NodeProperties::ChangeOp(
-      node, javascript()->CallRuntime(Runtime::kDateCurrentTime));
-  return Changed(node);
-}
-
-// ES6 section 20.3.4.10 Date.prototype.getTime ( )
-Reduction JSBuiltinReducer::ReduceDateGetTime(Node* node) {
-  Node* receiver = NodeProperties::GetValueInput(node, 1);
-  Node* effect = NodeProperties::GetEffectInput(node);
-  Node* control = NodeProperties::GetControlInput(node);
-  if (HasInstanceTypeWitness(receiver, effect, JS_DATE_TYPE)) {
-    Node* value = effect = graph()->NewNode(
-        simplified()->LoadField(AccessBuilder::ForJSDateValue()), receiver,
-        effect, control);
-    ReplaceWithValue(node, value, effect, control);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 18.2.2 isFinite ( number )
-Reduction JSBuiltinReducer::ReduceGlobalIsFinite(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // isFinite(a:plain-primitive) -> NumberEqual(a', a')
-    // where a' = NumberSubtract(ToNumber(a), ToNumber(a))
-    Node* input = ToNumber(r.GetJSCallInput(0));
-    Node* diff = graph()->NewNode(simplified()->NumberSubtract(), input, input);
-    Node* value = graph()->NewNode(simplified()->NumberEqual(), diff, diff);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 18.2.3 isNaN ( number )
-Reduction JSBuiltinReducer::ReduceGlobalIsNaN(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // isNaN(a:plain-primitive) -> BooleanNot(NumberEqual(a', a'))
-    // where a' = ToNumber(a)
-    Node* input = ToNumber(r.GetJSCallInput(0));
-    Node* check = graph()->NewNode(simplified()->NumberEqual(), input, input);
-    Node* value = graph()->NewNode(simplified()->BooleanNot(), check);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-Reduction JSBuiltinReducer::ReduceMapGet(Node* node) {
-  // We only optimize if we have target, receiver and key parameters.
-  if (node->op()->ValueInputCount() != 3) return NoChange();
-  Node* receiver = NodeProperties::GetValueInput(node, 1);
-  Node* effect = NodeProperties::GetEffectInput(node);
-  Node* control = NodeProperties::GetControlInput(node);
-  Node* key = NodeProperties::GetValueInput(node, 2);
-
-  if (!HasInstanceTypeWitness(receiver, effect, JS_MAP_TYPE)) return NoChange();
-
-  Node* table = effect = graph()->NewNode(
-      simplified()->LoadField(AccessBuilder::ForJSCollectionTable()), receiver,
-      effect, control);
-
-  Node* entry = effect = graph()->NewNode(
-      simplified()->FindOrderedHashMapEntry(), table, key, effect, control);
-
-  Node* check = graph()->NewNode(simplified()->NumberEqual(), entry,
-                                 jsgraph()->MinusOneConstant());
-
-  Node* branch = graph()->NewNode(common()->Branch(), check, control);
-
-  // Key not found.
-  Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
-  Node* etrue = effect;
-  Node* vtrue = jsgraph()->UndefinedConstant();
-
-  // Key found.
-  Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
-  Node* efalse = effect;
-  Node* vfalse = efalse = graph()->NewNode(
-      simplified()->LoadElement(AccessBuilder::ForOrderedHashMapEntryValue()),
-      table, entry, efalse, if_false);
-
-  control = graph()->NewNode(common()->Merge(2), if_true, if_false);
-  Node* value = graph()->NewNode(
-      common()->Phi(MachineRepresentation::kTagged, 2), vtrue, vfalse, control);
-  effect = graph()->NewNode(common()->EffectPhi(2), etrue, efalse, control);
-
-  ReplaceWithValue(node, value, effect, control);
-  return Replace(value);
-}
-
-Reduction JSBuiltinReducer::ReduceMapHas(Node* node) {
-  // We only optimize if we have target, receiver and key parameters.
-  if (node->op()->ValueInputCount() != 3) return NoChange();
-  Node* receiver = NodeProperties::GetValueInput(node, 1);
-  Node* effect = NodeProperties::GetEffectInput(node);
-  Node* control = NodeProperties::GetControlInput(node);
-  Node* key = NodeProperties::GetValueInput(node, 2);
-
-  if (!HasInstanceTypeWitness(receiver, effect, JS_MAP_TYPE)) return NoChange();
-
-  Node* table = effect = graph()->NewNode(
-      simplified()->LoadField(AccessBuilder::ForJSCollectionTable()), receiver,
-      effect, control);
-
-  Node* index = effect = graph()->NewNode(
-      simplified()->FindOrderedHashMapEntry(), table, key, effect, control);
-
-  Node* value = graph()->NewNode(simplified()->NumberEqual(), index,
-                                 jsgraph()->MinusOneConstant());
-  value = graph()->NewNode(simplified()->BooleanNot(), value);
-
-  ReplaceWithValue(node, value, effect, control);
-  return Replace(value);
-}
-
-// ES6 section 20.2.2.1 Math.abs ( x )
-Reduction JSBuiltinReducer::ReduceMathAbs(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // Math.abs(a:plain-primitive) -> NumberAbs(ToNumber(a))
-    Node* input = ToNumber(r.GetJSCallInput(0));
-    Node* value = graph()->NewNode(simplified()->NumberAbs(), input);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.2 Math.acos ( x )
-Reduction JSBuiltinReducer::ReduceMathAcos(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // Math.acos(a:plain-primitive) -> NumberAcos(ToNumber(a))
-    Node* input = ToNumber(r.GetJSCallInput(0));
-    Node* value = graph()->NewNode(simplified()->NumberAcos(), input);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.3 Math.acosh ( x )
-Reduction JSBuiltinReducer::ReduceMathAcosh(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // Math.acosh(a:plain-primitive) -> NumberAcosh(ToNumber(a))
-    Node* input = ToNumber(r.GetJSCallInput(0));
-    Node* value = graph()->NewNode(simplified()->NumberAcosh(), input);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.4 Math.asin ( x )
-Reduction JSBuiltinReducer::ReduceMathAsin(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // Math.asin(a:plain-primitive) -> NumberAsin(ToNumber(a))
-    Node* input = ToNumber(r.GetJSCallInput(0));
-    Node* value = graph()->NewNode(simplified()->NumberAsin(), input);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.5 Math.asinh ( x )
-Reduction JSBuiltinReducer::ReduceMathAsinh(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // Math.asinh(a:plain-primitive) -> NumberAsinh(ToNumber(a))
-    Node* input = ToNumber(r.GetJSCallInput(0));
-    Node* value = graph()->NewNode(simplified()->NumberAsinh(), input);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.6 Math.atan ( x )
-Reduction JSBuiltinReducer::ReduceMathAtan(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // Math.atan(a:plain-primitive) -> NumberAtan(ToNumber(a))
-    Node* input = ToNumber(r.GetJSCallInput(0));
-    Node* value = graph()->NewNode(simplified()->NumberAtan(), input);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.7 Math.atanh ( x )
-Reduction JSBuiltinReducer::ReduceMathAtanh(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // Math.atanh(a:plain-primitive) -> NumberAtanh(ToNumber(a))
-    Node* input = ToNumber(r.GetJSCallInput(0));
-    Node* value = graph()->NewNode(simplified()->NumberAtanh(), input);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.8 Math.atan2 ( y, x )
-Reduction JSBuiltinReducer::ReduceMathAtan2(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchTwo(Type::PlainPrimitive(), Type::PlainPrimitive())) {
-    // Math.atan2(a:plain-primitive,
-    //            b:plain-primitive) -> NumberAtan2(ToNumber(a),
-    //                                              ToNumber(b))
-    Node* left = ToNumber(r.left());
-    Node* right = ToNumber(r.right());
-    Node* value = graph()->NewNode(simplified()->NumberAtan2(), left, right);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.10 Math.ceil ( x )
-Reduction JSBuiltinReducer::ReduceMathCeil(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // Math.ceil(a:plain-primitive) -> NumberCeil(ToNumber(a))
-    Node* input = ToNumber(r.GetJSCallInput(0));
-    Node* value = graph()->NewNode(simplified()->NumberCeil(), input);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.11 Math.clz32 ( x )
-Reduction JSBuiltinReducer::ReduceMathClz32(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // Math.clz32(a:plain-primitive) -> NumberClz32(ToUint32(a))
-    Node* input = ToUint32(r.GetJSCallInput(0));
-    Node* value = graph()->NewNode(simplified()->NumberClz32(), input);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.12 Math.cos ( x )
-Reduction JSBuiltinReducer::ReduceMathCos(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // Math.cos(a:plain-primitive) -> NumberCos(ToNumber(a))
-    Node* input = ToNumber(r.GetJSCallInput(0));
-    Node* value = graph()->NewNode(simplified()->NumberCos(), input);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.13 Math.cosh ( x )
-Reduction JSBuiltinReducer::ReduceMathCosh(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // Math.cosh(a:plain-primitive) -> NumberCosh(ToNumber(a))
-    Node* input = ToNumber(r.GetJSCallInput(0));
-    Node* value = graph()->NewNode(simplified()->NumberCosh(), input);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.14 Math.exp ( x )
-Reduction JSBuiltinReducer::ReduceMathExp(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // Math.exp(a:plain-primitive) -> NumberExp(ToNumber(a))
-    Node* input = ToNumber(r.GetJSCallInput(0));
-    Node* value = graph()->NewNode(simplified()->NumberExp(), input);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.15 Math.expm1 ( x )
-Reduction JSBuiltinReducer::ReduceMathExpm1(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::Number())) {
-    // Math.expm1(a:number) -> NumberExpm1(a)
-    Node* value = graph()->NewNode(simplified()->NumberExpm1(), r.left());
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.16 Math.floor ( x )
-Reduction JSBuiltinReducer::ReduceMathFloor(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // Math.floor(a:plain-primitive) -> NumberFloor(ToNumber(a))
-    Node* input = ToNumber(r.GetJSCallInput(0));
-    Node* value = graph()->NewNode(simplified()->NumberFloor(), input);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.17 Math.fround ( x )
-Reduction JSBuiltinReducer::ReduceMathFround(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // Math.fround(a:plain-primitive) -> NumberFround(ToNumber(a))
-    Node* input = ToNumber(r.GetJSCallInput(0));
-    Node* value = graph()->NewNode(simplified()->NumberFround(), input);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.19 Math.imul ( x, y )
-Reduction JSBuiltinReducer::ReduceMathImul(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchTwo(Type::PlainPrimitive(), Type::PlainPrimitive())) {
-    // Math.imul(a:plain-primitive,
-    //           b:plain-primitive) -> NumberImul(ToUint32(a),
-    //                                            ToUint32(b))
-    Node* left = ToUint32(r.left());
-    Node* right = ToUint32(r.right());
-    Node* value = graph()->NewNode(simplified()->NumberImul(), left, right);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.20 Math.log ( x )
-Reduction JSBuiltinReducer::ReduceMathLog(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // Math.log(a:plain-primitive) -> NumberLog(ToNumber(a))
-    Node* input = ToNumber(r.GetJSCallInput(0));
-    Node* value = graph()->NewNode(simplified()->NumberLog(), input);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.21 Math.log1p ( x )
-Reduction JSBuiltinReducer::ReduceMathLog1p(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // Math.log1p(a:plain-primitive) -> NumberLog1p(ToNumber(a))
-    Node* input = ToNumber(r.GetJSCallInput(0));
-    Node* value = graph()->NewNode(simplified()->NumberLog1p(), input);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.22 Math.log10 ( x )
-Reduction JSBuiltinReducer::ReduceMathLog10(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::Number())) {
-    // Math.log10(a:number) -> NumberLog10(a)
-    Node* value = graph()->NewNode(simplified()->NumberLog10(), r.left());
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.23 Math.log2 ( x )
-Reduction JSBuiltinReducer::ReduceMathLog2(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::Number())) {
-    // Math.log2(a:number) -> NumberLog(a)
-    Node* value = graph()->NewNode(simplified()->NumberLog2(), r.left());
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.24 Math.max ( value1, value2, ...values )
-Reduction JSBuiltinReducer::ReduceMathMax(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchZero()) {
-    // Math.max() -> -Infinity
-    return Replace(jsgraph()->Constant(-V8_INFINITY));
-  }
-  if (r.InputsMatchAll(Type::PlainPrimitive())) {
-    // Math.max(a:plain-primitive, b:plain-primitive, ...)
-    Node* value = ToNumber(r.GetJSCallInput(0));
-    for (int i = 1; i < r.GetJSCallArity(); i++) {
-      Node* input = ToNumber(r.GetJSCallInput(i));
-      value = graph()->NewNode(simplified()->NumberMax(), value, input);
-    }
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.25 Math.min ( value1, value2, ...values )
-Reduction JSBuiltinReducer::ReduceMathMin(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchZero()) {
-    // Math.min() -> Infinity
-    return Replace(jsgraph()->Constant(V8_INFINITY));
-  }
-  if (r.InputsMatchAll(Type::PlainPrimitive())) {
-    // Math.min(a:plain-primitive, b:plain-primitive, ...)
-    Node* value = ToNumber(r.GetJSCallInput(0));
-    for (int i = 1; i < r.GetJSCallArity(); i++) {
-      Node* input = ToNumber(r.GetJSCallInput(i));
-      value = graph()->NewNode(simplified()->NumberMin(), value, input);
-    }
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.26 Math.pow ( x, y )
-Reduction JSBuiltinReducer::ReduceMathPow(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchTwo(Type::PlainPrimitive(), Type::PlainPrimitive())) {
-    // Math.pow(a:plain-primitive,
-    //          b:plain-primitive) -> NumberPow(ToNumber(a), ToNumber(b))
-    Node* left = ToNumber(r.left());
-    Node* right = ToNumber(r.right());
-    Node* value = graph()->NewNode(simplified()->NumberPow(), left, right);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.28 Math.round ( x )
-Reduction JSBuiltinReducer::ReduceMathRound(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // Math.round(a:plain-primitive) -> NumberRound(ToNumber(a))
-    Node* input = ToNumber(r.GetJSCallInput(0));
-    Node* value = graph()->NewNode(simplified()->NumberRound(), input);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.9 Math.cbrt ( x )
-Reduction JSBuiltinReducer::ReduceMathCbrt(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::Number())) {
-    // Math.cbrt(a:number) -> NumberCbrt(a)
-    Node* value = graph()->NewNode(simplified()->NumberCbrt(), r.left());
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.29 Math.sign ( x )
-Reduction JSBuiltinReducer::ReduceMathSign(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // Math.sign(a:plain-primitive) -> NumberSign(ToNumber(a))
-    Node* input = ToNumber(r.GetJSCallInput(0));
-    Node* value = graph()->NewNode(simplified()->NumberSign(), input);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.30 Math.sin ( x )
-Reduction JSBuiltinReducer::ReduceMathSin(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // Math.sin(a:plain-primitive) -> NumberSin(ToNumber(a))
-    Node* input = ToNumber(r.GetJSCallInput(0));
-    Node* value = graph()->NewNode(simplified()->NumberSin(), input);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.31 Math.sinh ( x )
-Reduction JSBuiltinReducer::ReduceMathSinh(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // Math.sinh(a:plain-primitive) -> NumberSinh(ToNumber(a))
-    Node* input = ToNumber(r.GetJSCallInput(0));
-    Node* value = graph()->NewNode(simplified()->NumberSinh(), input);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.32 Math.sqrt ( x )
-Reduction JSBuiltinReducer::ReduceMathSqrt(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // Math.sqrt(a:plain-primitive) -> NumberSqrt(ToNumber(a))
-    Node* input = ToNumber(r.GetJSCallInput(0));
-    Node* value = graph()->NewNode(simplified()->NumberSqrt(), input);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.33 Math.tan ( x )
-Reduction JSBuiltinReducer::ReduceMathTan(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // Math.tan(a:plain-primitive) -> NumberTan(ToNumber(a))
-    Node* input = ToNumber(r.GetJSCallInput(0));
-    Node* value = graph()->NewNode(simplified()->NumberTan(), input);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.34 Math.tanh ( x )
-Reduction JSBuiltinReducer::ReduceMathTanh(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // Math.tanh(a:plain-primitive) -> NumberTanh(ToNumber(a))
-    Node* input = ToNumber(r.GetJSCallInput(0));
-    Node* value = graph()->NewNode(simplified()->NumberTanh(), input);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.2.2.35 Math.trunc ( x )
-Reduction JSBuiltinReducer::ReduceMathTrunc(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // Math.trunc(a:plain-primitive) -> NumberTrunc(ToNumber(a))
-    Node* input = ToNumber(r.GetJSCallInput(0));
-    Node* value = graph()->NewNode(simplified()->NumberTrunc(), input);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.1.2.2 Number.isFinite ( number )
-Reduction JSBuiltinReducer::ReduceNumberIsFinite(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::Number())) {
-    // Number.isFinite(a:number) -> NumberEqual(a', a')
-    // where a' = NumberSubtract(a, a)
-    Node* input = r.GetJSCallInput(0);
-    Node* diff = graph()->NewNode(simplified()->NumberSubtract(), input, input);
-    Node* value = graph()->NewNode(simplified()->NumberEqual(), diff, diff);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.1.2.3 Number.isInteger ( number )
-Reduction JSBuiltinReducer::ReduceNumberIsInteger(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::Number())) {
-    // Number.isInteger(x:number) -> NumberEqual(NumberSubtract(x, x'), #0)
-    // where x' = NumberTrunc(x)
-    Node* input = r.GetJSCallInput(0);
-    Node* trunc = graph()->NewNode(simplified()->NumberTrunc(), input);
-    Node* diff = graph()->NewNode(simplified()->NumberSubtract(), input, trunc);
-    Node* value = graph()->NewNode(simplified()->NumberEqual(), diff,
-                                   jsgraph()->ZeroConstant());
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.1.2.4 Number.isNaN ( number )
-Reduction JSBuiltinReducer::ReduceNumberIsNaN(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchZero()) {
-    // Number.isNaN() -> #false
-    Node* value = jsgraph()->FalseConstant();
-    return Replace(value);
-  }
-  // Number.isNaN(a:number) -> ObjectIsNaN(a)
-  Node* input = r.GetJSCallInput(0);
-  Node* value = graph()->NewNode(simplified()->ObjectIsNaN(), input);
-  return Replace(value);
-}
-
-// ES6 section 20.1.2.5 Number.isSafeInteger ( number )
-Reduction JSBuiltinReducer::ReduceNumberIsSafeInteger(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(type_cache_.kSafeInteger)) {
-    // Number.isInteger(x:safe-integer) -> #true
-    Node* value = jsgraph()->TrueConstant();
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section 20.1.2.13 Number.parseInt ( string, radix )
-Reduction JSBuiltinReducer::ReduceNumberParseInt(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(type_cache_.kSafeInteger) ||
-      r.InputsMatchTwo(type_cache_.kSafeInteger,
-                       type_cache_.kZeroOrUndefined) ||
-      r.InputsMatchTwo(type_cache_.kSafeInteger, type_cache_.kTenOrUndefined)) {
-    // Number.parseInt(a:safe-integer) -> a
-    // Number.parseInt(a:safe-integer,b:#0\/undefined) -> a
-    // Number.parseInt(a:safe-integer,b:#10\/undefined) -> a
-    Node* value = r.GetJSCallInput(0);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES6 section #sec-object.create Object.create(proto, properties)
-Reduction JSBuiltinReducer::ReduceObjectCreate(Node* node) {
-  // We need exactly target, receiver and value parameters.
-  int arg_count = node->op()->ValueInputCount();
-  if (arg_count != 3) return NoChange();
-  Node* effect = NodeProperties::GetEffectInput(node);
-  Node* control = NodeProperties::GetControlInput(node);
-  Node* prototype = NodeProperties::GetValueInput(node, 2);
-  Type* prototype_type = NodeProperties::GetType(prototype);
-  if (!prototype_type->IsHeapConstant()) return NoChange();
-  Handle<HeapObject> prototype_const =
-      prototype_type->AsHeapConstant()->Value();
-  Handle<Map> instance_map;
-  MaybeHandle<Map> maybe_instance_map =
-      Map::TryGetObjectCreateMap(prototype_const);
-  if (!maybe_instance_map.ToHandle(&instance_map)) return NoChange();
-  Node* properties = jsgraph()->EmptyFixedArrayConstant();
-  if (instance_map->is_dictionary_map()) {
-    // Allocated an empty NameDictionary as backing store for the properties.
-    Handle<Map> map(isolate()->heap()->name_dictionary_map(), isolate());
-    int capacity =
-        NameDictionary::ComputeCapacity(NameDictionary::kInitialCapacity);
-    DCHECK(base::bits::IsPowerOfTwo(capacity));
-    int length = NameDictionary::EntryToIndex(capacity);
-    int size = NameDictionary::SizeFor(length);
-
-    AllocationBuilder a(jsgraph(), effect, control);
-    a.Allocate(size, NOT_TENURED, Type::Any());
-    a.Store(AccessBuilder::ForMap(), map);
-    // Initialize FixedArray fields.
-    a.Store(AccessBuilder::ForFixedArrayLength(),
-            jsgraph()->SmiConstant(length));
-    // Initialize HashTable fields.
-    a.Store(AccessBuilder::ForHashTableBaseNumberOfElements(),
-            jsgraph()->SmiConstant(0));
-    a.Store(AccessBuilder::ForHashTableBaseNumberOfDeletedElement(),
-            jsgraph()->SmiConstant(0));
-    a.Store(AccessBuilder::ForHashTableBaseCapacity(),
-            jsgraph()->SmiConstant(capacity));
-    // Initialize Dictionary fields.
-    a.Store(AccessBuilder::ForDictionaryNextEnumerationIndex(),
-            jsgraph()->SmiConstant(PropertyDetails::kInitialIndex));
-    a.Store(AccessBuilder::ForDictionaryObjectHashIndex(),
-            jsgraph()->SmiConstant(PropertyArray::kNoHashSentinel));
-    // Initialize the Properties fields.
-    Node* undefined = jsgraph()->UndefinedConstant();
-    STATIC_ASSERT(NameDictionary::kElementsStartIndex ==
-                  NameDictionary::kObjectHashIndex + 1);
-    for (int index = NameDictionary::kElementsStartIndex; index < length;
-         index++) {
-      a.Store(AccessBuilder::ForFixedArraySlot(index, kNoWriteBarrier),
-              undefined);
-    }
-    properties = effect = a.Finish();
-  }
-
-  int const instance_size = instance_map->instance_size();
-  if (instance_size > kMaxRegularHeapObjectSize) return NoChange();
-  dependencies()->AssumeInitialMapCantChange(instance_map);
-
-  // Emit code to allocate the JSObject instance for the given
-  // {instance_map}.
-  AllocationBuilder a(jsgraph(), effect, control);
-  a.Allocate(instance_size, NOT_TENURED, Type::Any());
-  a.Store(AccessBuilder::ForMap(), instance_map);
-  a.Store(AccessBuilder::ForJSObjectPropertiesOrHash(), properties);
-  a.Store(AccessBuilder::ForJSObjectElements(),
-          jsgraph()->EmptyFixedArrayConstant());
-  // Initialize Object fields.
-  Node* undefined = jsgraph()->UndefinedConstant();
-  for (int offset = JSObject::kHeaderSize; offset < instance_size;
-       offset += kPointerSize) {
-    a.Store(AccessBuilder::ForJSObjectOffset(offset, kNoWriteBarrier),
-            undefined);
-  }
-  Node* value = effect = a.Finish();
-
-  // replace it
-  ReplaceWithValue(node, value, effect, control);
-  return Replace(value);
-}
-
-// ES6 section 21.1.2.1 String.fromCharCode ( ...codeUnits )
-Reduction JSBuiltinReducer::ReduceStringFromCharCode(Node* node) {
-  JSCallReduction r(node);
-  if (r.InputsMatchOne(Type::PlainPrimitive())) {
-    // String.fromCharCode(a:plain-primitive) -> StringFromCharCode(a)
-    Node* input = ToNumber(r.GetJSCallInput(0));
-    Node* value = graph()->NewNode(simplified()->StringFromCharCode(), input);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-namespace {
-
-Node* GetStringWitness(Node* node) {
-  Node* receiver = NodeProperties::GetValueInput(node, 1);
-  Type* receiver_type = NodeProperties::GetType(receiver);
-  Node* effect = NodeProperties::GetEffectInput(node);
-  if (receiver_type->Is(Type::String())) return receiver;
-  // Check if the {node} is dominated by a CheckString renaming for
-  // it's {receiver}, and if so use that renaming as {receiver} for
-  // the lowering below.
-  for (Node* dominator = effect;;) {
-    if ((dominator->opcode() == IrOpcode::kCheckString ||
-         dominator->opcode() == IrOpcode::kCheckInternalizedString ||
-         dominator->opcode() == IrOpcode::kCheckSeqString) &&
-        NodeProperties::IsSame(dominator->InputAt(0), receiver)) {
-      return dominator;
-    }
-    if (dominator->op()->EffectInputCount() != 1) {
-      // Didn't find any appropriate CheckString node.
-      return nullptr;
-    }
-    dominator = NodeProperties::GetEffectInput(dominator);
-  }
-}
-
-}  // namespace
-
-// ES6 String.prototype.concat(...args)
-// #sec-string.prototype.concat
-Reduction JSBuiltinReducer::ReduceStringConcat(Node* node) {
-  if (Node* receiver = GetStringWitness(node)) {
-    JSCallReduction r(node);
-    if (r.InputsMatchOne(Type::PlainPrimitive())) {
-      // String.prototype.concat(lhs:string, rhs:plain-primitive)
-      //   -> Call[StringAddStub](lhs, rhs)
-      StringAddFlags flags = r.InputsMatchOne(Type::String())
-                                 ? STRING_ADD_CHECK_NONE
-                                 : STRING_ADD_CONVERT_RIGHT;
-      // TODO(turbofan): Massage the FrameState of the {node} here once we
-      // have an artificial builtin frame type, so that it looks like the
-      // exception from StringAdd overflow came from String.prototype.concat
-      // builtin instead of the calling function.
-      Callable const callable =
-          CodeFactory::StringAdd(isolate(), flags, NOT_TENURED);
-      CallDescriptor const* const desc = Linkage::GetStubCallDescriptor(
-          isolate(), graph()->zone(), callable.descriptor(), 0,
-          CallDescriptor::kNeedsFrameState,
-          Operator::kNoDeopt | Operator::kNoWrite);
-      node->ReplaceInput(0, jsgraph()->HeapConstant(callable.code()));
-      node->ReplaceInput(1, receiver);
-      NodeProperties::ChangeOp(node, common()->Call(desc));
-      return Changed(node);
-    }
-  }
-
-  return NoChange();
-}
-
-Reduction JSBuiltinReducer::ReduceStringIterator(Node* node) {
-  if (Node* receiver = GetStringWitness(node)) {
-    Node* effect = NodeProperties::GetEffectInput(node);
-    Node* control = NodeProperties::GetControlInput(node);
-
-    Node* map = jsgraph()->HeapConstant(
-        handle(native_context()->string_iterator_map(), isolate()));
-
-    // Allocate new iterator and attach the iterator to this string.
-    AllocationBuilder a(jsgraph(), effect, control);
-    a.Allocate(JSStringIterator::kSize, NOT_TENURED, Type::OtherObject());
-    a.Store(AccessBuilder::ForMap(), map);
-    a.Store(AccessBuilder::ForJSObjectPropertiesOrHash(),
-            jsgraph()->EmptyFixedArrayConstant());
-    a.Store(AccessBuilder::ForJSObjectElements(),
-            jsgraph()->EmptyFixedArrayConstant());
-    a.Store(AccessBuilder::ForJSStringIteratorString(), receiver);
-    a.Store(AccessBuilder::ForJSStringIteratorIndex(),
-            jsgraph()->SmiConstant(0));
-    Node* value = effect = a.Finish();
-
-    // Replace it.
-    ReplaceWithValue(node, value, effect, control);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-Reduction JSBuiltinReducer::ReduceStringIteratorNext(Node* node) {
-  Node* receiver = NodeProperties::GetValueInput(node, 1);
-  Node* effect = NodeProperties::GetEffectInput(node);
-  Node* control = NodeProperties::GetControlInput(node);
-  Node* context = NodeProperties::GetContextInput(node);
-  if (HasInstanceTypeWitness(receiver, effect, JS_STRING_ITERATOR_TYPE)) {
-    Node* string = effect = graph()->NewNode(
-        simplified()->LoadField(AccessBuilder::ForJSStringIteratorString()),
-        receiver, effect, control);
-    Node* index = effect = graph()->NewNode(
-        simplified()->LoadField(AccessBuilder::ForJSStringIteratorIndex()),
-        receiver, effect, control);
-    Node* length = graph()->NewNode(simplified()->StringLength(), string);
-
-    // branch0: if (index < length)
-    Node* check0 =
-        graph()->NewNode(simplified()->NumberLessThan(), index, length);
-    Node* branch0 =
-        graph()->NewNode(common()->Branch(BranchHint::kTrue), check0, control);
-
-    Node* etrue0 = effect;
-    Node* if_true0 = graph()->NewNode(common()->IfTrue(), branch0);
-    Node* done_true;
-    Node* vtrue0;
-    {
-      done_true = jsgraph()->FalseConstant();
-      Node* lead = graph()->NewNode(simplified()->StringCharCodeAt(), string,
-                                    index, if_true0);
-
-      // branch1: if ((lead & 0xFC00) === 0xD800)
-      Node* check1 =
-          graph()->NewNode(simplified()->NumberEqual(),
-                           graph()->NewNode(simplified()->NumberBitwiseAnd(),
-                                            lead, jsgraph()->Constant(0xFC00)),
-                           jsgraph()->Constant(0xD800));
-      Node* branch1 = graph()->NewNode(common()->Branch(BranchHint::kFalse),
-                                       check1, if_true0);
-      Node* if_true1 = graph()->NewNode(common()->IfTrue(), branch1);
-      Node* vtrue1;
-      {
-        Node* next_index = graph()->NewNode(simplified()->NumberAdd(), index,
-                                            jsgraph()->OneConstant());
-        // branch2: if ((index + 1) < length)
-        Node* check2 = graph()->NewNode(simplified()->NumberLessThan(),
-                                        next_index, length);
-        Node* branch2 = graph()->NewNode(common()->Branch(BranchHint::kTrue),
-                                         check2, if_true1);
-        Node* if_true2 = graph()->NewNode(common()->IfTrue(), branch2);
-        Node* vtrue2;
-        {
-          Node* trail = graph()->NewNode(simplified()->StringCharCodeAt(),
-                                         string, next_index, if_true2);
-          // branch3: if ((trail & 0xFC00) === 0xDC00)
-          Node* check3 = graph()->NewNode(
-              simplified()->NumberEqual(),
-              graph()->NewNode(simplified()->NumberBitwiseAnd(), trail,
-                               jsgraph()->Constant(0xFC00)),
-              jsgraph()->Constant(0xDC00));
-          Node* branch3 = graph()->NewNode(common()->Branch(BranchHint::kTrue),
-                                           check3, if_true2);
-          Node* if_true3 = graph()->NewNode(common()->IfTrue(), branch3);
-          Node* vtrue3;
-          {
-            vtrue3 = graph()->NewNode(
-                simplified()->NumberBitwiseOr(),
-// Need to swap the order for big-endian platforms
-#if V8_TARGET_BIG_ENDIAN
-                graph()->NewNode(simplified()->NumberShiftLeft(), lead,
-                                 jsgraph()->Constant(16)),
-                trail);
-#else
-                graph()->NewNode(simplified()->NumberShiftLeft(), trail,
-                                 jsgraph()->Constant(16)),
-                lead);
-#endif
-          }
-
-          Node* if_false3 = graph()->NewNode(common()->IfFalse(), branch3);
-          Node* vfalse3 = lead;
-          if_true2 = graph()->NewNode(common()->Merge(2), if_true3, if_false3);
-          vtrue2 =
-              graph()->NewNode(common()->Phi(MachineRepresentation::kWord32, 2),
-                               vtrue3, vfalse3, if_true2);
-        }
-
-        Node* if_false2 = graph()->NewNode(common()->IfFalse(), branch2);
-        Node* vfalse2 = lead;
-        if_true1 = graph()->NewNode(common()->Merge(2), if_true2, if_false2);
-        vtrue1 =
-            graph()->NewNode(common()->Phi(MachineRepresentation::kWord32, 2),
-                             vtrue2, vfalse2, if_true1);
-      }
-
-      Node* if_false1 = graph()->NewNode(common()->IfFalse(), branch1);
-      Node* vfalse1 = lead;
-      if_true0 = graph()->NewNode(common()->Merge(2), if_true1, if_false1);
-      vtrue0 =
-          graph()->NewNode(common()->Phi(MachineRepresentation::kWord32, 2),
-                           vtrue1, vfalse1, if_true0);
-      vtrue0 = graph()->NewNode(
-          simplified()->StringFromCodePoint(UnicodeEncoding::UTF16), vtrue0);
-
-      // Update iterator.[[NextIndex]]
-      Node* char_length =
-          graph()->NewNode(simplified()->StringLength(), vtrue0);
-      index = graph()->NewNode(simplified()->NumberAdd(), index, char_length);
-      etrue0 = graph()->NewNode(
-          simplified()->StoreField(AccessBuilder::ForJSStringIteratorIndex()),
-          receiver, index, etrue0, if_true0);
-    }
-
-    Node* if_false0 = graph()->NewNode(common()->IfFalse(), branch0);
-    Node* done_false;
-    Node* vfalse0;
-    {
-      vfalse0 = jsgraph()->UndefinedConstant();
-      done_false = jsgraph()->TrueConstant();
-    }
-
-    control = graph()->NewNode(common()->Merge(2), if_true0, if_false0);
-    effect = graph()->NewNode(common()->EffectPhi(2), etrue0, effect, control);
-    Node* value =
-        graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2),
-                         vtrue0, vfalse0, control);
-    Node* done =
-        graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2),
-                         done_true, done_false, control);
-
-    value = effect = graph()->NewNode(javascript()->CreateIterResultObject(),
-                                      value, done, context, effect);
-
-    ReplaceWithValue(node, value, effect, control);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-// ES section #sec-string.prototype.slice
-Reduction JSBuiltinReducer::ReduceStringSlice(Node* node) {
-  if (Node* receiver = GetStringWitness(node)) {
-    Node* start = node->op()->ValueInputCount() >= 3
-                      ? NodeProperties::GetValueInput(node, 2)
-                      : jsgraph()->UndefinedConstant();
-    Type* start_type = NodeProperties::GetType(start);
-    Node* end = node->op()->ValueInputCount() >= 4
-                    ? NodeProperties::GetValueInput(node, 3)
-                    : jsgraph()->UndefinedConstant();
-    Type* end_type = NodeProperties::GetType(end);
-    Node* effect = NodeProperties::GetEffectInput(node);
-    Node* control = NodeProperties::GetControlInput(node);
-
-    if (start_type->Is(type_cache_.kSingletonMinusOne) &&
-        end_type->Is(Type::Undefined())) {
-      Node* receiver_length =
-          graph()->NewNode(simplified()->StringLength(), receiver);
-
-      Node* check =
-          graph()->NewNode(simplified()->NumberEqual(), receiver_length,
-                           jsgraph()->ZeroConstant());
-      Node* branch = graph()->NewNode(common()->Branch(BranchHint::kFalse),
-                                      check, control);
-
-      Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
-      Node* vtrue = jsgraph()->EmptyStringConstant();
-
-      Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
-      Node* vfalse;
-      {
-        // We need to convince TurboFan that {receiver_length}-1 is a valid
-        // Unsigned32 value, so we just apply NumberToUint32 to the result
-        // of the subtraction, which is a no-op and merely acts as a marker.
-        Node* index =
-            graph()->NewNode(simplified()->NumberSubtract(), receiver_length,
-                             jsgraph()->OneConstant());
-        index = graph()->NewNode(simplified()->NumberToUint32(), index);
-        vfalse = graph()->NewNode(simplified()->StringCharAt(), receiver, index,
-                                  if_false);
-      }
-
-      control = graph()->NewNode(common()->Merge(2), if_true, if_false);
-      Node* value =
-          graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2),
-                           vtrue, vfalse, control);
-      ReplaceWithValue(node, value, effect, control);
-      return Replace(value);
-    }
-  }
-  return NoChange();
-}
-
-Reduction JSBuiltinReducer::ReduceStringToLowerCaseIntl(Node* node) {
-  if (Node* receiver = GetStringWitness(node)) {
-    RelaxEffectsAndControls(node);
-    node->ReplaceInput(0, receiver);
-    node->TrimInputCount(1);
-    NodeProperties::ChangeOp(node, simplified()->StringToLowerCaseIntl());
-    NodeProperties::SetType(node, Type::String());
-    return Changed(node);
-  }
-  return NoChange();
-}
-
-Reduction JSBuiltinReducer::ReduceStringToUpperCaseIntl(Node* node) {
-  if (Node* receiver = GetStringWitness(node)) {
-    RelaxEffectsAndControls(node);
-    node->ReplaceInput(0, receiver);
-    node->TrimInputCount(1);
-    NodeProperties::ChangeOp(node, simplified()->StringToUpperCaseIntl());
-    NodeProperties::SetType(node, Type::String());
-    return Changed(node);
-  }
-  return NoChange();
-}
-
-Reduction JSBuiltinReducer::ReduceArrayBufferIsView(Node* node) {
-  Node* value = node->op()->ValueInputCount() >= 3
-                    ? NodeProperties::GetValueInput(node, 2)
-                    : jsgraph()->UndefinedConstant();
-  RelaxEffectsAndControls(node);
-  node->ReplaceInput(0, value);
-  node->TrimInputCount(1);
-  NodeProperties::ChangeOp(node, simplified()->ObjectIsArrayBufferView());
-  return Changed(node);
-}
-
-Reduction JSBuiltinReducer::ReduceArrayBufferViewAccessor(
-    Node* node, InstanceType instance_type, FieldAccess const& access) {
-  Node* receiver = NodeProperties::GetValueInput(node, 1);
-  Node* effect = NodeProperties::GetEffectInput(node);
-  Node* control = NodeProperties::GetControlInput(node);
-  if (HasInstanceTypeWitness(receiver, effect, instance_type)) {
-    // Load the {receiver}s field.
-    Node* value = effect = graph()->NewNode(simplified()->LoadField(access),
-                                            receiver, effect, control);
-
-    // See if we can skip the neutering check.
-    if (isolate()->IsArrayBufferNeuteringIntact()) {
-      // Add a code dependency so we are deoptimized in case an ArrayBuffer
-      // gets neutered.
-      dependencies()->AssumePropertyCell(
-          factory()->array_buffer_neutering_protector());
-    } else {
-      // Check if the {receiver}s buffer was neutered.
-      Node* receiver_buffer = effect = graph()->NewNode(
-          simplified()->LoadField(AccessBuilder::ForJSArrayBufferViewBuffer()),
-          receiver, effect, control);
-      Node* check = effect =
-          graph()->NewNode(simplified()->ArrayBufferWasNeutered(),
-                           receiver_buffer, effect, control);
-
-      // Default to zero if the {receiver}s buffer was neutered.
-      value = graph()->NewNode(
-          common()->Select(MachineRepresentation::kTagged, BranchHint::kFalse),
-          check, jsgraph()->ZeroConstant(), value);
-    }
-
-    ReplaceWithValue(node, value, effect, control);
-    return Replace(value);
-  }
-  return NoChange();
-}
-
-Reduction JSBuiltinReducer::Reduce(Node* node) {
-  Reduction reduction = NoChange();
-  JSCallReduction r(node);
-
-  // Dispatch according to the BuiltinFunctionId if present.
-  if (!r.HasBuiltinFunctionId()) return NoChange();
-  switch (r.GetBuiltinFunctionId()) {
-    case kArrayEntries:
-      return ReduceArrayIterator(node, IterationKind::kEntries);
-    case kArrayKeys:
-      return ReduceArrayIterator(node, IterationKind::kKeys);
-    case kArrayValues:
-      return ReduceArrayIterator(node, IterationKind::kValues);
-    case kArrayIteratorNext:
-      return ReduceArrayIteratorNext(node);
-    case kArrayIsArray:
-      return ReduceArrayIsArray(node);
-    case kDateNow:
-      return ReduceDateNow(node);
-    case kDateGetTime:
-      return ReduceDateGetTime(node);
-    case kGlobalIsFinite:
-      reduction = ReduceGlobalIsFinite(node);
-      break;
-    case kGlobalIsNaN:
-      reduction = ReduceGlobalIsNaN(node);
-      break;
-    case kMapEntries:
-      return ReduceCollectionIterator(
-          node, JS_MAP_TYPE, Context::MAP_KEY_VALUE_ITERATOR_MAP_INDEX);
-    case kMapGet:
-      reduction = ReduceMapGet(node);
-      break;
-    case kMapHas:
-      reduction = ReduceMapHas(node);
-      break;
-    case kMapKeys:
-      return ReduceCollectionIterator(node, JS_MAP_TYPE,
-                                      Context::MAP_KEY_ITERATOR_MAP_INDEX);
-    case kMapSize:
-      return ReduceCollectionSize(node, JS_MAP_TYPE);
-    case kMapValues:
-      return ReduceCollectionIterator(node, JS_MAP_TYPE,
-                                      Context::MAP_VALUE_ITERATOR_MAP_INDEX);
-    case kMapIteratorNext:
-      return ReduceCollectionIteratorNext(
-          node, OrderedHashMap::kEntrySize, factory()->empty_ordered_hash_map(),
-          FIRST_MAP_ITERATOR_TYPE, LAST_MAP_ITERATOR_TYPE);
-    case kMathAbs:
-      reduction = ReduceMathAbs(node);
-      break;
-    case kMathAcos:
-      reduction = ReduceMathAcos(node);
-      break;
-    case kMathAcosh:
-      reduction = ReduceMathAcosh(node);
-      break;
-    case kMathAsin:
-      reduction = ReduceMathAsin(node);
-      break;
-    case kMathAsinh:
-      reduction = ReduceMathAsinh(node);
-      break;
-    case kMathAtan:
-      reduction = ReduceMathAtan(node);
-      break;
-    case kMathAtanh:
-      reduction = ReduceMathAtanh(node);
-      break;
-    case kMathAtan2:
-      reduction = ReduceMathAtan2(node);
-      break;
-    case kMathCbrt:
-      reduction = ReduceMathCbrt(node);
-      break;
-    case kMathCeil:
-      reduction = ReduceMathCeil(node);
-      break;
-    case kMathClz32:
-      reduction = ReduceMathClz32(node);
-      break;
-    case kMathCos:
-      reduction = ReduceMathCos(node);
-      break;
-    case kMathCosh:
-      reduction = ReduceMathCosh(node);
-      break;
-    case kMathExp:
-      reduction = ReduceMathExp(node);
-      break;
-    case kMathExpm1:
-      reduction = ReduceMathExpm1(node);
-      break;
-    case kMathFloor:
-      reduction = ReduceMathFloor(node);
-      break;
-    case kMathFround:
-      reduction = ReduceMathFround(node);
-      break;
-    case kMathImul:
-      reduction = ReduceMathImul(node);
-      break;
-    case kMathLog:
-      reduction = ReduceMathLog(node);
-      break;
-    case kMathLog1p:
-      reduction = ReduceMathLog1p(node);
-      break;
-    case kMathLog10:
-      reduction = ReduceMathLog10(node);
-      break;
-    case kMathLog2:
-      reduction = ReduceMathLog2(node);
-      break;
-    case kMathMax:
-      reduction = ReduceMathMax(node);
-      break;
-    case kMathMin:
-      reduction = ReduceMathMin(node);
-      break;
-    case kMathPow:
-      reduction = ReduceMathPow(node);
-      break;
-    case kMathRound:
-      reduction = ReduceMathRound(node);
-      break;
-    case kMathSign:
-      reduction = ReduceMathSign(node);
-      break;
-    case kMathSin:
-      reduction = ReduceMathSin(node);
-      break;
-    case kMathSinh:
-      reduction = ReduceMathSinh(node);
-      break;
-    case kMathSqrt:
-      reduction = ReduceMathSqrt(node);
-      break;
-    case kMathTan:
-      reduction = ReduceMathTan(node);
-      break;
-    case kMathTanh:
-      reduction = ReduceMathTanh(node);
-      break;
-    case kMathTrunc:
-      reduction = ReduceMathTrunc(node);
-      break;
-    case kNumberIsFinite:
-      reduction = ReduceNumberIsFinite(node);
-      break;
-    case kNumberIsInteger:
-      reduction = ReduceNumberIsInteger(node);
-      break;
-    case kNumberIsNaN:
-      reduction = ReduceNumberIsNaN(node);
-      break;
-    case kNumberIsSafeInteger:
-      reduction = ReduceNumberIsSafeInteger(node);
-      break;
-    case kNumberParseInt:
-      reduction = ReduceNumberParseInt(node);
-      break;
-    case kObjectCreate:
-      reduction = ReduceObjectCreate(node);
-      break;
-    case kSetEntries:
-      return ReduceCollectionIterator(
-          node, JS_SET_TYPE, Context::SET_KEY_VALUE_ITERATOR_MAP_INDEX);
-    case kSetSize:
-      return ReduceCollectionSize(node, JS_SET_TYPE);
-    case kSetValues:
-      return ReduceCollectionIterator(node, JS_SET_TYPE,
-                                      Context::SET_VALUE_ITERATOR_MAP_INDEX);
-    case kSetIteratorNext:
-      return ReduceCollectionIteratorNext(
-          node, OrderedHashSet::kEntrySize, factory()->empty_ordered_hash_set(),
-          FIRST_SET_ITERATOR_TYPE, LAST_SET_ITERATOR_TYPE);
-    case kStringFromCharCode:
-      reduction = ReduceStringFromCharCode(node);
-      break;
-    case kStringConcat:
-      return ReduceStringConcat(node);
-    case kStringIterator:
-      return ReduceStringIterator(node);
-    case kStringIteratorNext:
-      return ReduceStringIteratorNext(node);
-    case kStringSlice:
-      return ReduceStringSlice(node);
-    case kStringToLowerCaseIntl:
-      return ReduceStringToLowerCaseIntl(node);
-    case kStringToUpperCaseIntl:
-      return ReduceStringToUpperCaseIntl(node);
-    case kArrayBufferIsView:
-      return ReduceArrayBufferIsView(node);
-    case kDataViewByteLength:
-      return ReduceArrayBufferViewAccessor(
-          node, JS_DATA_VIEW_TYPE,
-          AccessBuilder::ForJSArrayBufferViewByteLength());
-    case kDataViewByteOffset:
-      return ReduceArrayBufferViewAccessor(
-          node, JS_DATA_VIEW_TYPE,
-          AccessBuilder::ForJSArrayBufferViewByteOffset());
-    case kTypedArrayByteLength:
-      return ReduceArrayBufferViewAccessor(
-          node, JS_TYPED_ARRAY_TYPE,
-          AccessBuilder::ForJSArrayBufferViewByteLength());
-    case kTypedArrayByteOffset:
-      return ReduceArrayBufferViewAccessor(
-          node, JS_TYPED_ARRAY_TYPE,
-          AccessBuilder::ForJSArrayBufferViewByteOffset());
-    case kTypedArrayLength:
-      return ReduceArrayBufferViewAccessor(
-          node, JS_TYPED_ARRAY_TYPE, AccessBuilder::ForJSTypedArrayLength());
-    case kTypedArrayEntries:
-      return ReduceTypedArrayIterator(node, IterationKind::kEntries);
-    case kTypedArrayKeys:
-      return ReduceTypedArrayIterator(node, IterationKind::kKeys);
-    case kTypedArrayValues:
-      return ReduceTypedArrayIterator(node, IterationKind::kValues);
-    case kTypedArrayToStringTag:
-      return ReduceTypedArrayToStringTag(node);
-    default:
-      break;
-  }
-
-  // Replace builtin call assuming replacement nodes are pure values that don't
-  // produce an effect. Replaces {node} with {reduction} and relaxes effects.
-  if (reduction.Changed()) ReplaceWithValue(node, reduction.replacement());
-
-  return reduction;
-}
-
-Node* JSBuiltinReducer::ToNumber(Node* input) {
-  Type* input_type = NodeProperties::GetType(input);
-  if (input_type->Is(Type::Number())) return input;
-  return graph()->NewNode(simplified()->PlainPrimitiveToNumber(), input);
-}
-
-Node* JSBuiltinReducer::ToUint32(Node* input) {
-  input = ToNumber(input);
-  Type* input_type = NodeProperties::GetType(input);
-  if (input_type->Is(Type::Unsigned32())) return input;
-  return graph()->NewNode(simplified()->NumberToUint32(), input);
-}
-
-Graph* JSBuiltinReducer::graph() const { return jsgraph()->graph(); }
-
-Factory* JSBuiltinReducer::factory() const { return isolate()->factory(); }
-
-Isolate* JSBuiltinReducer::isolate() const { return jsgraph()->isolate(); }
-
-
-CommonOperatorBuilder* JSBuiltinReducer::common() const {
-  return jsgraph()->common();
-}
-
-
-SimplifiedOperatorBuilder* JSBuiltinReducer::simplified() const {
-  return jsgraph()->simplified();
-}
-
-JSOperatorBuilder* JSBuiltinReducer::javascript() const {
-  return jsgraph()->javascript();
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/js-builtin-reducer.h b/src/v8/src/compiler/js-builtin-reducer.h
deleted file mode 100644
index b3c44c7..0000000
--- a/src/v8/src/compiler/js-builtin-reducer.h
+++ /dev/null
@@ -1,146 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_JS_BUILTIN_REDUCER_H_
-#define V8_COMPILER_JS_BUILTIN_REDUCER_H_
-
-#include "src/base/compiler-specific.h"
-#include "src/compiler/graph-reducer.h"
-#include "src/globals.h"
-
-namespace v8 {
-namespace internal {
-
-// Forward declarations.
-class CompilationDependencies;
-class Factory;
-
-namespace compiler {
-
-// Forward declarations.
-class CommonOperatorBuilder;
-struct FieldAccess;
-class JSGraph;
-class JSOperatorBuilder;
-class SimplifiedOperatorBuilder;
-class TypeCache;
-
-class V8_EXPORT_PRIVATE JSBuiltinReducer final
-    : public NON_EXPORTED_BASE(AdvancedReducer) {
- public:
-  JSBuiltinReducer(Editor* editor, JSGraph* jsgraph,
-                   CompilationDependencies* dependencies,
-                   Handle<Context> native_context);
-  ~JSBuiltinReducer() final {}
-
-  const char* reducer_name() const override { return "JSBuiltinReducer"; }
-
-  Reduction Reduce(Node* node) final;
-
- private:
-  enum class ArrayIteratorKind { kArray, kTypedArray };
-
-  Reduction ReduceArrayIterator(Node* node, IterationKind kind);
-  Reduction ReduceTypedArrayIterator(Node* node, IterationKind kind);
-  Reduction ReduceArrayIterator(Handle<Map> receiver_map, Node* node,
-                                IterationKind kind,
-                                ArrayIteratorKind iter_kind);
-  Reduction ReduceArrayIteratorNext(Node* node);
-  Reduction ReduceFastArrayIteratorNext(InstanceType type, Node* node,
-                                        IterationKind kind);
-  Reduction ReduceTypedArrayIteratorNext(InstanceType type, Node* node,
-                                         IterationKind kind);
-  Reduction ReduceTypedArrayToStringTag(Node* node);
-  Reduction ReduceArrayIsArray(Node* node);
-
-  Reduction ReduceCollectionIterator(Node* node,
-                                     InstanceType collection_instance_type,
-                                     int collection_iterator_map_index);
-  Reduction ReduceCollectionSize(Node* node,
-                                 InstanceType collection_instance_type);
-  Reduction ReduceCollectionIteratorNext(
-      Node* node, int entry_size, Handle<HeapObject> empty_collection,
-      InstanceType collection_iterator_instance_type_first,
-      InstanceType collection_iterator_instance_type_last);
-  Reduction ReduceDateNow(Node* node);
-  Reduction ReduceDateGetTime(Node* node);
-  Reduction ReduceGlobalIsFinite(Node* node);
-  Reduction ReduceGlobalIsNaN(Node* node);
-  Reduction ReduceMapHas(Node* node);
-  Reduction ReduceMapGet(Node* node);
-  Reduction ReduceMathAbs(Node* node);
-  Reduction ReduceMathAcos(Node* node);
-  Reduction ReduceMathAcosh(Node* node);
-  Reduction ReduceMathAsin(Node* node);
-  Reduction ReduceMathAsinh(Node* node);
-  Reduction ReduceMathAtan(Node* node);
-  Reduction ReduceMathAtanh(Node* node);
-  Reduction ReduceMathAtan2(Node* node);
-  Reduction ReduceMathCbrt(Node* node);
-  Reduction ReduceMathCeil(Node* node);
-  Reduction ReduceMathClz32(Node* node);
-  Reduction ReduceMathCos(Node* node);
-  Reduction ReduceMathCosh(Node* node);
-  Reduction ReduceMathExp(Node* node);
-  Reduction ReduceMathExpm1(Node* node);
-  Reduction ReduceMathFloor(Node* node);
-  Reduction ReduceMathFround(Node* node);
-  Reduction ReduceMathImul(Node* node);
-  Reduction ReduceMathLog(Node* node);
-  Reduction ReduceMathLog1p(Node* node);
-  Reduction ReduceMathLog10(Node* node);
-  Reduction ReduceMathLog2(Node* node);
-  Reduction ReduceMathMax(Node* node);
-  Reduction ReduceMathMin(Node* node);
-  Reduction ReduceMathPow(Node* node);
-  Reduction ReduceMathRound(Node* node);
-  Reduction ReduceMathSign(Node* node);
-  Reduction ReduceMathSin(Node* node);
-  Reduction ReduceMathSinh(Node* node);
-  Reduction ReduceMathSqrt(Node* node);
-  Reduction ReduceMathTan(Node* node);
-  Reduction ReduceMathTanh(Node* node);
-  Reduction ReduceMathTrunc(Node* node);
-  Reduction ReduceNumberIsFinite(Node* node);
-  Reduction ReduceNumberIsInteger(Node* node);
-  Reduction ReduceNumberIsNaN(Node* node);
-  Reduction ReduceNumberIsSafeInteger(Node* node);
-  Reduction ReduceNumberParseInt(Node* node);
-  Reduction ReduceObjectCreate(Node* node);
-  Reduction ReduceStringConcat(Node* node);
-  Reduction ReduceStringFromCharCode(Node* node);
-  Reduction ReduceStringIterator(Node* node);
-  Reduction ReduceStringIteratorNext(Node* node);
-  Reduction ReduceStringSlice(Node* node);
-  Reduction ReduceStringToLowerCaseIntl(Node* node);
-  Reduction ReduceStringToUpperCaseIntl(Node* node);
-  Reduction ReduceArrayBufferIsView(Node* node);
-  Reduction ReduceArrayBufferViewAccessor(Node* node,
-                                          InstanceType instance_type,
-                                          FieldAccess const& access);
-
-  Node* ToNumber(Node* value);
-  Node* ToUint32(Node* value);
-
-  Graph* graph() const;
-  Factory* factory() const;
-  JSGraph* jsgraph() const { return jsgraph_; }
-  Isolate* isolate() const;
-  Handle<Context> native_context() const { return native_context_; }
-  CommonOperatorBuilder* common() const;
-  SimplifiedOperatorBuilder* simplified() const;
-  JSOperatorBuilder* javascript() const;
-  CompilationDependencies* dependencies() const { return dependencies_; }
-
-  CompilationDependencies* const dependencies_;
-  JSGraph* const jsgraph_;
-  Handle<Context> const native_context_;
-  TypeCache const& type_cache_;
-};
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_COMPILER_JS_BUILTIN_REDUCER_H_
diff --git a/src/v8/src/compiler/jump-threading.cc b/src/v8/src/compiler/jump-threading.cc
deleted file mode 100644
index c2a84cc..0000000
--- a/src/v8/src/compiler/jump-threading.cc
+++ /dev/null
@@ -1,203 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/compiler/jump-threading.h"
-#include "src/compiler/code-generator-impl.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-#define TRACE(...)                                \
-  do {                                            \
-    if (FLAG_trace_turbo_jt) PrintF(__VA_ARGS__); \
-  } while (false)
-
-struct JumpThreadingState {
-  bool forwarded;
-  ZoneVector<RpoNumber>& result;
-  ZoneStack<RpoNumber>& stack;
-
-  void Clear(size_t count) { result.assign(count, unvisited()); }
-  void PushIfUnvisited(RpoNumber num) {
-    if (result[num.ToInt()] == unvisited()) {
-      stack.push(num);
-      result[num.ToInt()] = onstack();
-    }
-  }
-  void Forward(RpoNumber to) {
-    RpoNumber from = stack.top();
-    RpoNumber to_to = result[to.ToInt()];
-    bool pop = true;
-    if (to == from) {
-      TRACE("  xx %d\n", from.ToInt());
-      result[from.ToInt()] = from;
-    } else if (to_to == unvisited()) {
-      TRACE("  fw %d -> %d (recurse)\n", from.ToInt(), to.ToInt());
-      stack.push(to);
-      result[to.ToInt()] = onstack();
-      pop = false;  // recurse.
-    } else if (to_to == onstack()) {
-      TRACE("  fw %d -> %d (cycle)\n", from.ToInt(), to.ToInt());
-      result[from.ToInt()] = to;  // break the cycle.
-      forwarded = true;
-    } else {
-      TRACE("  fw %d -> %d (forward)\n", from.ToInt(), to.ToInt());
-      result[from.ToInt()] = to_to;  // forward the block.
-      forwarded = true;
-    }
-    if (pop) stack.pop();
-  }
-  RpoNumber unvisited() { return RpoNumber::FromInt(-1); }
-  RpoNumber onstack() { return RpoNumber::FromInt(-2); }
-};
-
-bool JumpThreading::ComputeForwarding(Zone* local_zone,
-                                      ZoneVector<RpoNumber>& result,
-                                      InstructionSequence* code,
-                                      bool frame_at_start) {
-  ZoneStack<RpoNumber> stack(local_zone);
-  JumpThreadingState state = {false, result, stack};
-  state.Clear(code->InstructionBlockCount());
-
-  // Iterate over the blocks forward, pushing the blocks onto the stack.
-  for (auto const block : code->instruction_blocks()) {
-    RpoNumber current = block->rpo_number();
-    state.PushIfUnvisited(current);
-
-    // Process the stack, which implements DFS through empty blocks.
-    while (!state.stack.empty()) {
-      InstructionBlock* block = code->InstructionBlockAt(state.stack.top());
-      // Process the instructions in a block up to a non-empty instruction.
-      TRACE("jt [%d] B%d\n", static_cast<int>(stack.size()),
-            block->rpo_number().ToInt());
-      bool fallthru = true;
-      RpoNumber fw = block->rpo_number();
-      for (int i = block->code_start(); i < block->code_end(); ++i) {
-        Instruction* instr = code->InstructionAt(i);
-        if (!instr->AreMovesRedundant()) {
-          // can't skip instructions with non redundant moves.
-          TRACE("  parallel move\n");
-          fallthru = false;
-        } else if (FlagsModeField::decode(instr->opcode()) != kFlags_none) {
-          // can't skip instructions with flags continuations.
-          TRACE("  flags\n");
-          fallthru = false;
-        } else if (instr->IsNop()) {
-          // skip nops.
-          TRACE("  nop\n");
-          continue;
-        } else if (instr->arch_opcode() == kArchJmp) {
-          // try to forward the jump instruction.
-          TRACE("  jmp\n");
-          // if this block deconstructs the frame, we can't forward it.
-          // TODO(mtrofin): we can still forward if we end up building
-          // the frame at start. So we should move the decision of whether
-          // to build a frame or not in the register allocator, and trickle it
-          // here and to the code generator.
-          if (frame_at_start ||
-              !(block->must_deconstruct_frame() ||
-                block->must_construct_frame())) {
-            fw = code->InputRpo(instr, 0);
-          }
-          fallthru = false;
-        } else {
-          // can't skip other instructions.
-          TRACE("  other\n");
-          fallthru = false;
-        }
-        break;
-      }
-      if (fallthru) {
-        int next = 1 + block->rpo_number().ToInt();
-        if (next < code->InstructionBlockCount()) fw = RpoNumber::FromInt(next);
-      }
-      state.Forward(fw);
-    }
-  }
-
-#ifdef DEBUG
-  for (RpoNumber num : result) {
-    DCHECK(num.IsValid());
-  }
-#endif
-
-  if (FLAG_trace_turbo_jt) {
-    for (int i = 0; i < static_cast<int>(result.size()); i++) {
-      TRACE("B%d ", i);
-      int to = result[i].ToInt();
-      if (i != to) {
-        TRACE("-> B%d\n", to);
-      } else {
-        TRACE("\n");
-      }
-    }
-  }
-
-  return state.forwarded;
-}
-
-
-void JumpThreading::ApplyForwarding(ZoneVector<RpoNumber>& result,
-                                    InstructionSequence* code) {
-  if (!FLAG_turbo_jt) return;
-
-  Zone local_zone(code->isolate()->allocator(), ZONE_NAME);
-  ZoneVector<bool> skip(static_cast<int>(result.size()), false, &local_zone);
-
-  // Skip empty blocks when the previous block doesn't fall through.
-  bool prev_fallthru = true;
-  for (auto const block : code->instruction_blocks()) {
-    int block_num = block->rpo_number().ToInt();
-    skip[block_num] = !prev_fallthru && result[block_num].ToInt() != block_num;
-
-    bool fallthru = true;
-    for (int i = block->code_start(); i < block->code_end(); ++i) {
-      Instruction* instr = code->InstructionAt(i);
-      if (FlagsModeField::decode(instr->opcode()) == kFlags_branch) {
-        fallthru = false;  // branches don't fall through to the next block.
-      } else if (instr->arch_opcode() == kArchJmp) {
-        if (skip[block_num]) {
-          // Overwrite a redundant jump with a nop.
-          TRACE("jt-fw nop @%d\n", i);
-          instr->OverwriteWithNop();
-        }
-        fallthru = false;  // jumps don't fall through to the next block.
-      }
-    }
-    prev_fallthru = fallthru;
-  }
-
-  // Patch RPO immediates.
-  InstructionSequence::Immediates& immediates = code->immediates();
-  for (size_t i = 0; i < immediates.size(); i++) {
-    Constant constant = immediates[i];
-    if (constant.type() == Constant::kRpoNumber) {
-      RpoNumber rpo = constant.ToRpoNumber();
-      RpoNumber fw = result[rpo.ToInt()];
-      if (!(fw == rpo)) immediates[i] = Constant(fw);
-    }
-  }
-
-  // Recompute assembly order numbers.
-  int ao = 0;
-  for (auto const block : code->instruction_blocks()) {
-    if (!block->IsDeferred()) {
-      block->set_ao_number(RpoNumber::FromInt(ao));
-      if (!skip[block->rpo_number().ToInt()]) ao++;
-    }
-  }
-  for (auto const block : code->instruction_blocks()) {
-    if (block->IsDeferred()) {
-      block->set_ao_number(RpoNumber::FromInt(ao));
-      if (!skip[block->rpo_number().ToInt()]) ao++;
-    }
-  }
-}
-
-#undef TRACE
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/jump-threading.h b/src/v8/src/compiler/jump-threading.h
deleted file mode 100644
index 84520ba..0000000
--- a/src/v8/src/compiler/jump-threading.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_JUMP_THREADING_H_
-#define V8_COMPILER_JUMP_THREADING_H_
-
-#include "src/compiler/instruction.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-// Forwards jumps to empty basic blocks that end with a second jump to the
-// destination of the second jump, transitively.
-class JumpThreading {
- public:
-  // Compute the forwarding map of basic blocks to their ultimate destination.
-  // Returns {true} if there is at least one block that is forwarded.
-  static bool ComputeForwarding(Zone* local_zone, ZoneVector<RpoNumber>& result,
-                                InstructionSequence* code, bool frame_at_start);
-
-  // Rewrite the instructions to forward jumps and branches.
-  // May also negate some branches.
-  static void ApplyForwarding(ZoneVector<RpoNumber>& forwarding,
-                              InstructionSequence* code);
-};
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_COMPILER_JUMP_THREADING_H
diff --git a/src/v8/src/compiler/live-range-separator.cc b/src/v8/src/compiler/live-range-separator.cc
deleted file mode 100644
index 67d1c77..0000000
--- a/src/v8/src/compiler/live-range-separator.cc
+++ /dev/null
@@ -1,181 +0,0 @@
-// Copyright 2015 the V8 project 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 "src/compiler/live-range-separator.h"
-#include "src/compiler/register-allocator.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-
-#define TRACE(...)                             \
-  do {                                         \
-    if (FLAG_trace_alloc) PrintF(__VA_ARGS__); \
-  } while (false)
-
-
-namespace {
-
-
-void CreateSplinter(TopLevelLiveRange *range, RegisterAllocationData *data,
-                    LifetimePosition first_cut, LifetimePosition last_cut) {
-  DCHECK(!range->IsSplinter());
-  // We can ignore ranges that live solely in deferred blocks.
-  // If a range ends right at the end of a deferred block, it is marked by
-  // the range builder as ending at gap start of the next block - since the
-  // end is a position where the variable isn't live. We need to take that
-  // into consideration.
-  LifetimePosition max_allowed_end = last_cut.NextFullStart();
-
-  if (first_cut <= range->Start() && max_allowed_end >= range->End()) {
-    return;
-  }
-
-  LifetimePosition start = Max(first_cut, range->Start());
-  LifetimePosition end = Min(last_cut, range->End());
-
-  if (start < end) {
-    // Ensure the original range has a spill range associated, before it gets
-    // splintered. Splinters will point to it. This way, when attempting to
-    // reuse spill slots of splinters, during allocation, we avoid clobbering
-    // such slots.
-    if (range->MayRequireSpillRange()) {
-      data->CreateSpillRangeForLiveRange(range);
-    }
-    if (range->splinter() == nullptr) {
-      TopLevelLiveRange *splinter =
-          data->NextLiveRange(range->representation());
-      DCHECK_NULL(data->live_ranges()[splinter->vreg()]);
-      data->live_ranges()[splinter->vreg()] = splinter;
-      range->SetSplinter(splinter);
-    }
-    Zone *zone = data->allocation_zone();
-    TRACE("creating splinter for range %d between %d and %d\n", range->vreg(),
-          start.ToInstructionIndex(), end.ToInstructionIndex());
-    range->Splinter(start, end, zone);
-  }
-}
-
-void SetSlotUse(TopLevelLiveRange *range) {
-  range->set_has_slot_use(false);
-  for (const UsePosition *pos = range->first_pos();
-       !range->has_slot_use() && pos != nullptr; pos = pos->next()) {
-    if (pos->type() == UsePositionType::kRequiresSlot) {
-      range->set_has_slot_use(true);
-    }
-  }
-}
-
-void SplinterLiveRange(TopLevelLiveRange *range, RegisterAllocationData *data) {
-  const InstructionSequence *code = data->code();
-  UseInterval *interval = range->first_interval();
-
-  LifetimePosition first_cut = LifetimePosition::Invalid();
-  LifetimePosition last_cut = LifetimePosition::Invalid();
-
-  while (interval != nullptr) {
-    UseInterval *next_interval = interval->next();
-    const InstructionBlock *first_block =
-        code->GetInstructionBlock(interval->FirstGapIndex());
-    const InstructionBlock *last_block =
-        code->GetInstructionBlock(interval->LastGapIndex());
-    int first_block_nr = first_block->rpo_number().ToInt();
-    int last_block_nr = last_block->rpo_number().ToInt();
-    for (int block_id = first_block_nr; block_id <= last_block_nr; ++block_id) {
-      const InstructionBlock *current_block =
-          code->InstructionBlockAt(RpoNumber::FromInt(block_id));
-      if (current_block->IsDeferred()) {
-        if (!first_cut.IsValid()) {
-          first_cut = LifetimePosition::GapFromInstructionIndex(
-              current_block->first_instruction_index());
-        }
-        last_cut = LifetimePosition::GapFromInstructionIndex(
-            current_block->last_instruction_index());
-      } else {
-        if (first_cut.IsValid()) {
-          CreateSplinter(range, data, first_cut, last_cut);
-          first_cut = LifetimePosition::Invalid();
-          last_cut = LifetimePosition::Invalid();
-        }
-      }
-    }
-    interval = next_interval;
-  }
-  // When the range ends in deferred blocks, first_cut will be valid here.
-  // Splinter from there to the last instruction that was in a deferred block.
-  if (first_cut.IsValid()) {
-    CreateSplinter(range, data, first_cut, last_cut);
-  }
-
-  // Redo has_slot_use
-  if (range->has_slot_use() && range->splinter() != nullptr) {
-    SetSlotUse(range);
-    SetSlotUse(range->splinter());
-  }
-}
-
-}  // namespace
-
-
-void LiveRangeSeparator::Splinter() {
-  size_t virt_reg_count = data()->live_ranges().size();
-  for (size_t vreg = 0; vreg < virt_reg_count; ++vreg) {
-    TopLevelLiveRange *range = data()->live_ranges()[vreg];
-    if (range == nullptr || range->IsEmpty() || range->IsSplinter()) {
-      continue;
-    }
-    int first_instr = range->first_interval()->FirstGapIndex();
-    if (!data()->code()->GetInstructionBlock(first_instr)->IsDeferred()) {
-      SplinterLiveRange(range, data());
-    }
-  }
-}
-
-
-void LiveRangeMerger::MarkRangesSpilledInDeferredBlocks() {
-  const InstructionSequence *code = data()->code();
-  for (TopLevelLiveRange *top : data()->live_ranges()) {
-    if (top == nullptr || top->IsEmpty() || top->splinter() == nullptr ||
-        top->HasSpillOperand() || !top->splinter()->HasSpillRange()) {
-      continue;
-    }
-
-    LiveRange *child = top;
-    for (; child != nullptr; child = child->next()) {
-      if (child->spilled() ||
-          child->NextSlotPosition(child->Start()) != nullptr) {
-        break;
-      }
-    }
-    if (child == nullptr) {
-      top->TreatAsSpilledInDeferredBlock(data()->allocation_zone(),
-                                         code->InstructionBlockCount());
-    }
-  }
-}
-
-
-void LiveRangeMerger::Merge() {
-  MarkRangesSpilledInDeferredBlocks();
-
-  int live_range_count = static_cast<int>(data()->live_ranges().size());
-  for (int i = 0; i < live_range_count; ++i) {
-    TopLevelLiveRange *range = data()->live_ranges()[i];
-    if (range == nullptr || range->IsEmpty() || !range->IsSplinter()) {
-      continue;
-    }
-    TopLevelLiveRange *splinter_parent = range->splintered_from();
-
-    int to_remove = range->vreg();
-    splinter_parent->Merge(range, data()->allocation_zone());
-    data()->live_ranges()[to_remove] = nullptr;
-  }
-}
-
-#undef TRACE
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/live-range-separator.h b/src/v8/src/compiler/live-range-separator.h
deleted file mode 100644
index 6aaf6b6..0000000
--- a/src/v8/src/compiler/live-range-separator.h
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_LIVE_RANGE_SEPARATOR_H_
-#define V8_LIVE_RANGE_SEPARATOR_H_
-
-#include "src/zone/zone.h"
-namespace v8 {
-namespace internal {
-
-class Zone;
-
-namespace compiler {
-
-class RegisterAllocationData;
-
-
-// A register allocation pair of transformations: splinter and merge live ranges
-class LiveRangeSeparator final : public ZoneObject {
- public:
-  LiveRangeSeparator(RegisterAllocationData* data, Zone* zone)
-      : data_(data), zone_(zone) {}
-
-  void Splinter();
-
- private:
-  RegisterAllocationData* data() const { return data_; }
-  Zone* zone() const { return zone_; }
-
-  RegisterAllocationData* const data_;
-  Zone* const zone_;
-
-  DISALLOW_COPY_AND_ASSIGN(LiveRangeSeparator);
-};
-
-
-class LiveRangeMerger final : public ZoneObject {
- public:
-  LiveRangeMerger(RegisterAllocationData* data, Zone* zone)
-      : data_(data), zone_(zone) {}
-
-  void Merge();
-
- private:
-  RegisterAllocationData* data() const { return data_; }
-  Zone* zone() const { return zone_; }
-
-  // Mark ranges spilled in deferred blocks, that also cover non-deferred code.
-  // We do nothing special for ranges fully contained in deferred blocks,
-  // because they would "spill in deferred blocks" anyway.
-  void MarkRangesSpilledInDeferredBlocks();
-
-  RegisterAllocationData* const data_;
-  Zone* const zone_;
-
-  DISALLOW_COPY_AND_ASSIGN(LiveRangeMerger);
-};
-
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-#endif  // V8_LIVE_RANGE_SEPARATOR_H_
diff --git a/src/v8/src/compiler/mips/code-generator-mips.cc b/src/v8/src/compiler/mips/code-generator-mips.cc
deleted file mode 100644
index 3b57081..0000000
--- a/src/v8/src/compiler/mips/code-generator-mips.cc
+++ /dev/null
@@ -1,3648 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/assembler-inl.h"
-#include "src/callable.h"
-#include "src/compilation-info.h"
-#include "src/compiler/code-generator-impl.h"
-#include "src/compiler/code-generator.h"
-#include "src/compiler/gap-resolver.h"
-#include "src/compiler/node-matchers.h"
-#include "src/compiler/osr.h"
-#include "src/heap/heap-inl.h"
-#include "src/mips/macro-assembler-mips.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-#define __ tasm()->
-
-// TODO(plind): Possibly avoid using these lithium names.
-#define kScratchReg kLithiumScratchReg
-#define kCompareReg kLithiumScratchReg2
-#define kScratchReg2 kLithiumScratchReg2
-#define kScratchDoubleReg kLithiumScratchDouble
-
-
-// TODO(plind): consider renaming these macros.
-#define TRACE_MSG(msg)                                                      \
-  PrintF("code_gen: \'%s\' in function %s at line %d\n", msg, __FUNCTION__, \
-         __LINE__)
-
-#define TRACE_UNIMPL()                                                       \
-  PrintF("UNIMPLEMENTED code_generator_mips: %s at line %d\n", __FUNCTION__, \
-         __LINE__)
-
-
-// Adds Mips-specific methods to convert InstructionOperands.
-class MipsOperandConverter final : public InstructionOperandConverter {
- public:
-  MipsOperandConverter(CodeGenerator* gen, Instruction* instr)
-      : InstructionOperandConverter(gen, instr) {}
-
-  FloatRegister OutputSingleRegister(size_t index = 0) {
-    return ToSingleRegister(instr_->OutputAt(index));
-  }
-
-  FloatRegister InputSingleRegister(size_t index) {
-    return ToSingleRegister(instr_->InputAt(index));
-  }
-
-  FloatRegister ToSingleRegister(InstructionOperand* op) {
-    // Single (Float) and Double register namespace is same on MIPS,
-    // both are typedefs of FPURegister.
-    return ToDoubleRegister(op);
-  }
-
-  Register InputOrZeroRegister(size_t index) {
-    if (instr_->InputAt(index)->IsImmediate()) {
-      DCHECK_EQ(0, InputInt32(index));
-      return zero_reg;
-    }
-    return InputRegister(index);
-  }
-
-  DoubleRegister InputOrZeroDoubleRegister(size_t index) {
-    if (instr_->InputAt(index)->IsImmediate()) return kDoubleRegZero;
-
-    return InputDoubleRegister(index);
-  }
-
-  DoubleRegister InputOrZeroSingleRegister(size_t index) {
-    if (instr_->InputAt(index)->IsImmediate()) return kDoubleRegZero;
-
-    return InputSingleRegister(index);
-  }
-
-  Operand InputImmediate(size_t index) {
-    Constant constant = ToConstant(instr_->InputAt(index));
-    switch (constant.type()) {
-      case Constant::kInt32:
-        return Operand(constant.ToInt32());
-      case Constant::kFloat32:
-        return Operand::EmbeddedNumber(constant.ToFloat32());
-      case Constant::kFloat64:
-        return Operand::EmbeddedNumber(constant.ToFloat64().value());
-      case Constant::kInt64:
-      case Constant::kExternalReference:
-      case Constant::kHeapObject:
-        // TODO(plind): Maybe we should handle ExtRef & HeapObj here?
-        //    maybe not done on arm due to const pool ??
-        break;
-      case Constant::kRpoNumber:
-        UNREACHABLE();  // TODO(titzer): RPO immediates on mips?
-        break;
-    }
-    UNREACHABLE();
-  }
-
-  Operand InputOperand(size_t index) {
-    InstructionOperand* op = instr_->InputAt(index);
-    if (op->IsRegister()) {
-      return Operand(ToRegister(op));
-    }
-    return InputImmediate(index);
-  }
-
-  MemOperand MemoryOperand(size_t* first_index) {
-    const size_t index = *first_index;
-    switch (AddressingModeField::decode(instr_->opcode())) {
-      case kMode_None:
-        break;
-      case kMode_MRI:
-        *first_index += 2;
-        return MemOperand(InputRegister(index + 0), InputInt32(index + 1));
-      case kMode_MRR:
-        // TODO(plind): r6 address mode, to be implemented ...
-        UNREACHABLE();
-    }
-    UNREACHABLE();
-  }
-
-  MemOperand MemoryOperand(size_t index = 0) { return MemoryOperand(&index); }
-
-  MemOperand ToMemOperand(InstructionOperand* op) const {
-    DCHECK_NOT_NULL(op);
-    DCHECK(op->IsStackSlot() || op->IsFPStackSlot());
-    return SlotToMemOperand(AllocatedOperand::cast(op)->index());
-  }
-
-  MemOperand SlotToMemOperand(int slot) const {
-    FrameOffset offset = frame_access_state()->GetFrameOffset(slot);
-    return MemOperand(offset.from_stack_pointer() ? sp : fp, offset.offset());
-  }
-};
-
-
-static inline bool HasRegisterInput(Instruction* instr, size_t index) {
-  return instr->InputAt(index)->IsRegister();
-}
-
-
-namespace {
-
-class OutOfLineRound : public OutOfLineCode {
- public:
-  OutOfLineRound(CodeGenerator* gen, DoubleRegister result)
-      : OutOfLineCode(gen), result_(result) {}
-
-  void Generate() final {
-    // Handle rounding to zero case where sign has to be preserved.
-    // High bits of double input already in kScratchReg.
-    __ srl(at, kScratchReg, 31);
-    __ sll(at, at, 31);
-    __ Mthc1(at, result_);
-  }
-
- private:
-  DoubleRegister const result_;
-};
-
-
-class OutOfLineRound32 : public OutOfLineCode {
- public:
-  OutOfLineRound32(CodeGenerator* gen, DoubleRegister result)
-      : OutOfLineCode(gen), result_(result) {}
-
-  void Generate() final {
-    // Handle rounding to zero case where sign has to be preserved.
-    // High bits of float input already in kScratchReg.
-    __ srl(at, kScratchReg, 31);
-    __ sll(at, at, 31);
-    __ mtc1(at, result_);
-  }
-
- private:
-  DoubleRegister const result_;
-};
-
-
-class OutOfLineRecordWrite final : public OutOfLineCode {
- public:
-  OutOfLineRecordWrite(CodeGenerator* gen, Register object, Register index,
-                       Register value, Register scratch0, Register scratch1,
-                       RecordWriteMode mode)
-      : OutOfLineCode(gen),
-        object_(object),
-        index_(index),
-        value_(value),
-        scratch0_(scratch0),
-        scratch1_(scratch1),
-        mode_(mode),
-        must_save_lr_(!gen->frame_access_state()->has_frame()),
-        zone_(gen->zone()) {}
-
-  void SaveRegisters(RegList registers) {
-    DCHECK_LT(0, NumRegs(registers));
-    RegList regs = 0;
-    for (int i = 0; i < Register::kNumRegisters; ++i) {
-      if ((registers >> i) & 1u) {
-        regs |= Register::from_code(i).bit();
-      }
-    }
-    __ MultiPush(regs | ra.bit());
-  }
-
-  void RestoreRegisters(RegList registers) {
-    DCHECK_LT(0, NumRegs(registers));
-    RegList regs = 0;
-    for (int i = 0; i < Register::kNumRegisters; ++i) {
-      if ((registers >> i) & 1u) {
-        regs |= Register::from_code(i).bit();
-      }
-    }
-    __ MultiPop(regs | ra.bit());
-  }
-
-  void Generate() final {
-    if (mode_ > RecordWriteMode::kValueIsPointer) {
-      __ JumpIfSmi(value_, exit());
-    }
-    __ CheckPageFlag(value_, scratch0_,
-                     MemoryChunk::kPointersToHereAreInterestingMask, eq,
-                     exit());
-    __ Addu(scratch1_, object_, index_);
-    RememberedSetAction const remembered_set_action =
-        mode_ > RecordWriteMode::kValueIsMap ? EMIT_REMEMBERED_SET
-                                             : OMIT_REMEMBERED_SET;
-    SaveFPRegsMode const save_fp_mode =
-        frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
-    if (must_save_lr_) {
-      // We need to save and restore ra if the frame was elided.
-      __ Push(ra);
-    }
-    __ CallRecordWriteStub(object_, scratch1_, remembered_set_action,
-                           save_fp_mode);
-    if (must_save_lr_) {
-      __ Pop(ra);
-    }
-  }
-
- private:
-  Register const object_;
-  Register const index_;
-  Register const value_;
-  Register const scratch0_;
-  Register const scratch1_;
-  RecordWriteMode const mode_;
-  bool must_save_lr_;
-  Zone* zone_;
-};
-
-#define CREATE_OOL_CLASS(ool_name, tasm_ool_name, T)                 \
-  class ool_name final : public OutOfLineCode {                      \
-   public:                                                           \
-    ool_name(CodeGenerator* gen, T dst, T src1, T src2)              \
-        : OutOfLineCode(gen), dst_(dst), src1_(src1), src2_(src2) {} \
-                                                                     \
-    void Generate() final { __ tasm_ool_name(dst_, src1_, src2_); }  \
-                                                                     \
-   private:                                                          \
-    T const dst_;                                                    \
-    T const src1_;                                                   \
-    T const src2_;                                                   \
-  }
-
-CREATE_OOL_CLASS(OutOfLineFloat32Max, Float32MaxOutOfLine, FPURegister);
-CREATE_OOL_CLASS(OutOfLineFloat32Min, Float32MinOutOfLine, FPURegister);
-CREATE_OOL_CLASS(OutOfLineFloat64Max, Float64MaxOutOfLine, DoubleRegister);
-CREATE_OOL_CLASS(OutOfLineFloat64Min, Float64MinOutOfLine, DoubleRegister);
-
-#undef CREATE_OOL_CLASS
-
-Condition FlagsConditionToConditionCmp(FlagsCondition condition) {
-  switch (condition) {
-    case kEqual:
-      return eq;
-    case kNotEqual:
-      return ne;
-    case kSignedLessThan:
-      return lt;
-    case kSignedGreaterThanOrEqual:
-      return ge;
-    case kSignedLessThanOrEqual:
-      return le;
-    case kSignedGreaterThan:
-      return gt;
-    case kUnsignedLessThan:
-      return lo;
-    case kUnsignedGreaterThanOrEqual:
-      return hs;
-    case kUnsignedLessThanOrEqual:
-      return ls;
-    case kUnsignedGreaterThan:
-      return hi;
-    case kUnorderedEqual:
-    case kUnorderedNotEqual:
-      break;
-    default:
-      break;
-  }
-  UNREACHABLE();
-}
-
-
-Condition FlagsConditionToConditionTst(FlagsCondition condition) {
-  switch (condition) {
-    case kNotEqual:
-      return ne;
-    case kEqual:
-      return eq;
-    default:
-      break;
-  }
-  UNREACHABLE();
-}
-
-
-FPUCondition FlagsConditionToConditionCmpFPU(bool& predicate,
-                                             FlagsCondition condition) {
-  switch (condition) {
-    case kEqual:
-      predicate = true;
-      return EQ;
-    case kNotEqual:
-      predicate = false;
-      return EQ;
-    case kUnsignedLessThan:
-      predicate = true;
-      return OLT;
-    case kUnsignedGreaterThanOrEqual:
-      predicate = false;
-      return ULT;
-    case kUnsignedLessThanOrEqual:
-      predicate = true;
-      return OLE;
-    case kUnsignedGreaterThan:
-      predicate = false;
-      return ULE;
-    case kUnorderedEqual:
-    case kUnorderedNotEqual:
-      predicate = true;
-      break;
-    default:
-      predicate = true;
-      break;
-  }
-  UNREACHABLE();
-}
-
-}  // namespace
-
-#define ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(mode)                                  \
-  if (IsMipsArchVariant(kMips32r6)) {                                          \
-    __ cfc1(kScratchReg, FCSR);                                                \
-    __ li(at, Operand(mode_##mode));                                           \
-    __ ctc1(at, FCSR);                                                         \
-    __ rint_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0));             \
-    __ ctc1(kScratchReg, FCSR);                                                \
-  } else {                                                                     \
-    auto ool = new (zone()) OutOfLineRound(this, i.OutputDoubleRegister());    \
-    Label done;                                                                \
-    __ Mfhc1(kScratchReg, i.InputDoubleRegister(0));                           \
-    __ Ext(at, kScratchReg, HeapNumber::kExponentShift,                        \
-           HeapNumber::kExponentBits);                                         \
-    __ Branch(USE_DELAY_SLOT, &done, hs, at,                                   \
-              Operand(HeapNumber::kExponentBias + HeapNumber::kMantissaBits)); \
-    __ mov_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0));              \
-    __ mode##_l_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0));         \
-    __ Move(at, kScratchReg2, i.OutputDoubleRegister());                       \
-    __ or_(at, at, kScratchReg2);                                              \
-    __ Branch(USE_DELAY_SLOT, ool->entry(), eq, at, Operand(zero_reg));        \
-    __ cvt_d_l(i.OutputDoubleRegister(), i.OutputDoubleRegister());            \
-    __ bind(ool->exit());                                                      \
-    __ bind(&done);                                                            \
-  }
-
-
-#define ASSEMBLE_ROUND_FLOAT_TO_FLOAT(mode)                                   \
-  if (IsMipsArchVariant(kMips32r6)) {                                         \
-    __ cfc1(kScratchReg, FCSR);                                               \
-    __ li(at, Operand(mode_##mode));                                          \
-    __ ctc1(at, FCSR);                                                        \
-    __ rint_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0));            \
-    __ ctc1(kScratchReg, FCSR);                                               \
-  } else {                                                                    \
-    int32_t kFloat32ExponentBias = 127;                                       \
-    int32_t kFloat32MantissaBits = 23;                                        \
-    int32_t kFloat32ExponentBits = 8;                                         \
-    auto ool = new (zone()) OutOfLineRound32(this, i.OutputDoubleRegister()); \
-    Label done;                                                               \
-    __ mfc1(kScratchReg, i.InputDoubleRegister(0));                           \
-    __ Ext(at, kScratchReg, kFloat32MantissaBits, kFloat32ExponentBits);      \
-    __ Branch(USE_DELAY_SLOT, &done, hs, at,                                  \
-              Operand(kFloat32ExponentBias + kFloat32MantissaBits));          \
-    __ mov_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0));             \
-    __ mode##_w_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0));        \
-    __ mfc1(at, i.OutputDoubleRegister());                                    \
-    __ Branch(USE_DELAY_SLOT, ool->entry(), eq, at, Operand(zero_reg));       \
-    __ cvt_s_w(i.OutputDoubleRegister(), i.OutputDoubleRegister());           \
-    __ bind(ool->exit());                                                     \
-    __ bind(&done);                                                           \
-  }
-
-#define ASSEMBLE_ATOMIC_LOAD_INTEGER(asm_instr)          \
-  do {                                                   \
-    __ asm_instr(i.OutputRegister(), i.MemoryOperand()); \
-    __ sync();                                           \
-  } while (0)
-
-#define ASSEMBLE_ATOMIC_STORE_INTEGER(asm_instr)               \
-  do {                                                         \
-    __ sync();                                                 \
-    __ asm_instr(i.InputOrZeroRegister(2), i.MemoryOperand()); \
-    __ sync();                                                 \
-  } while (0)
-
-#define ASSEMBLE_ATOMIC_BINOP(bin_instr)                                \
-  do {                                                                  \
-    Label binop;                                                        \
-    __ Addu(i.TempRegister(0), i.InputRegister(0), i.InputRegister(1)); \
-    __ sync();                                                          \
-    __ bind(&binop);                                                    \
-    __ Ll(i.OutputRegister(0), MemOperand(i.TempRegister(0), 0));       \
-    __ bin_instr(i.TempRegister(1), i.OutputRegister(0),                \
-                 Operand(i.InputRegister(2)));                          \
-    __ Sc(i.TempRegister(1), MemOperand(i.TempRegister(0), 0));         \
-    __ BranchShort(&binop, eq, i.TempRegister(1), Operand(zero_reg));   \
-    __ sync();                                                          \
-  } while (0)
-
-#define ASSEMBLE_ATOMIC_BINOP_EXT(sign_extend, size, bin_instr)                \
-  do {                                                                         \
-    Label binop;                                                               \
-    __ Addu(i.TempRegister(0), i.InputRegister(0), i.InputRegister(1));        \
-    __ andi(i.TempRegister(3), i.TempRegister(0), 0x3);                        \
-    __ Subu(i.TempRegister(0), i.TempRegister(0), Operand(i.TempRegister(3))); \
-    __ sll(i.TempRegister(3), i.TempRegister(3), 3);                           \
-    __ sync();                                                                 \
-    __ bind(&binop);                                                           \
-    __ Ll(i.TempRegister(1), MemOperand(i.TempRegister(0), 0));                \
-    __ ExtractBits(i.OutputRegister(0), i.TempRegister(1), i.TempRegister(3),  \
-                   size, sign_extend);                                         \
-    __ bin_instr(i.TempRegister(2), i.OutputRegister(0),                       \
-                 Operand(i.InputRegister(2)));                                 \
-    __ InsertBits(i.TempRegister(1), i.TempRegister(2), i.TempRegister(3),     \
-                  size);                                                       \
-    __ Sc(i.TempRegister(1), MemOperand(i.TempRegister(0), 0));                \
-    __ BranchShort(&binop, eq, i.TempRegister(1), Operand(zero_reg));          \
-    __ sync();                                                                 \
-  } while (0)
-
-#define ASSEMBLE_ATOMIC_EXCHANGE_INTEGER()                               \
-  do {                                                                   \
-    Label exchange;                                                      \
-    __ sync();                                                           \
-    __ bind(&exchange);                                                  \
-    __ Addu(i.TempRegister(0), i.InputRegister(0), i.InputRegister(1));  \
-    __ Ll(i.OutputRegister(0), MemOperand(i.TempRegister(0), 0));        \
-    __ mov(i.TempRegister(1), i.InputRegister(2));                       \
-    __ Sc(i.TempRegister(1), MemOperand(i.TempRegister(0), 0));          \
-    __ BranchShort(&exchange, eq, i.TempRegister(1), Operand(zero_reg)); \
-    __ sync();                                                           \
-  } while (0)
-
-#define ASSEMBLE_ATOMIC_EXCHANGE_INTEGER_EXT(sign_extend, size)                \
-  do {                                                                         \
-    Label exchange;                                                            \
-    __ Addu(i.TempRegister(0), i.InputRegister(0), i.InputRegister(1));        \
-    __ andi(i.TempRegister(1), i.TempRegister(0), 0x3);                        \
-    __ Subu(i.TempRegister(0), i.TempRegister(0), Operand(i.TempRegister(1))); \
-    __ sll(i.TempRegister(1), i.TempRegister(1), 3);                           \
-    __ sync();                                                                 \
-    __ bind(&exchange);                                                        \
-    __ Ll(i.TempRegister(2), MemOperand(i.TempRegister(0), 0));                \
-    __ ExtractBits(i.OutputRegister(0), i.TempRegister(2), i.TempRegister(1),  \
-                   size, sign_extend);                                         \
-    __ InsertBits(i.TempRegister(2), i.InputRegister(2), i.TempRegister(1),    \
-                  size);                                                       \
-    __ Sc(i.TempRegister(2), MemOperand(i.TempRegister(0), 0));                \
-    __ BranchShort(&exchange, eq, i.TempRegister(2), Operand(zero_reg));       \
-    __ sync();                                                                 \
-  } while (0)
-
-#define ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER()                      \
-  do {                                                                  \
-    Label compareExchange;                                              \
-    Label exit;                                                         \
-    __ Addu(i.TempRegister(0), i.InputRegister(0), i.InputRegister(1)); \
-    __ sync();                                                          \
-    __ bind(&compareExchange);                                          \
-    __ Ll(i.OutputRegister(0), MemOperand(i.TempRegister(0), 0));       \
-    __ BranchShort(&exit, ne, i.InputRegister(2),                       \
-                   Operand(i.OutputRegister(0)));                       \
-    __ mov(i.TempRegister(2), i.InputRegister(3));                      \
-    __ Sc(i.TempRegister(2), MemOperand(i.TempRegister(0), 0));         \
-    __ BranchShort(&compareExchange, eq, i.TempRegister(2),             \
-                   Operand(zero_reg));                                  \
-    __ bind(&exit);                                                     \
-    __ sync();                                                          \
-  } while (0)
-
-#define ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER_EXT(sign_extend, size)        \
-  do {                                                                         \
-    Label compareExchange;                                                     \
-    Label exit;                                                                \
-    __ Addu(i.TempRegister(0), i.InputRegister(0), i.InputRegister(1));        \
-    __ andi(i.TempRegister(1), i.TempRegister(0), 0x3);                        \
-    __ Subu(i.TempRegister(0), i.TempRegister(0), Operand(i.TempRegister(1))); \
-    __ sll(i.TempRegister(1), i.TempRegister(1), 3);                           \
-    __ sync();                                                                 \
-    __ bind(&compareExchange);                                                 \
-    __ Ll(i.TempRegister(2), MemOperand(i.TempRegister(0), 0));                \
-    __ ExtractBits(i.OutputRegister(0), i.TempRegister(2), i.TempRegister(1),  \
-                   size, sign_extend);                                         \
-    __ BranchShort(&exit, ne, i.InputRegister(2),                              \
-                   Operand(i.OutputRegister(0)));                              \
-    __ InsertBits(i.TempRegister(2), i.InputRegister(3), i.TempRegister(1),    \
-                  size);                                                       \
-    __ Sc(i.TempRegister(2), MemOperand(i.TempRegister(0), 0));                \
-    __ BranchShort(&compareExchange, eq, i.TempRegister(2),                    \
-                   Operand(zero_reg));                                         \
-    __ bind(&exit);                                                            \
-    __ sync();                                                                 \
-  } while (0)
-
-#define ASSEMBLE_IEEE754_BINOP(name)                                          \
-  do {                                                                        \
-    FrameScope scope(tasm(), StackFrame::MANUAL);                             \
-    __ PrepareCallCFunction(0, 2, kScratchReg);                               \
-    __ MovToFloatParameters(i.InputDoubleRegister(0),                         \
-                            i.InputDoubleRegister(1));                        \
-    __ CallCFunction(ExternalReference::ieee754_##name##_function(isolate()), \
-                     0, 2);                                                   \
-    /* Move the result in the double result register. */                      \
-    __ MovFromFloatResult(i.OutputDoubleRegister());                          \
-  } while (0)
-
-#define ASSEMBLE_IEEE754_UNOP(name)                                           \
-  do {                                                                        \
-    FrameScope scope(tasm(), StackFrame::MANUAL);                             \
-    __ PrepareCallCFunction(0, 1, kScratchReg);                               \
-    __ MovToFloatParameter(i.InputDoubleRegister(0));                         \
-    __ CallCFunction(ExternalReference::ieee754_##name##_function(isolate()), \
-                     0, 1);                                                   \
-    /* Move the result in the double result register. */                      \
-    __ MovFromFloatResult(i.OutputDoubleRegister());                          \
-  } while (0)
-
-void CodeGenerator::AssembleDeconstructFrame() {
-  __ mov(sp, fp);
-  __ Pop(ra, fp);
-}
-
-void CodeGenerator::AssemblePrepareTailCall() {
-  if (frame_access_state()->has_frame()) {
-    __ lw(ra, MemOperand(fp, StandardFrameConstants::kCallerPCOffset));
-    __ lw(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
-  }
-  frame_access_state()->SetFrameAccessToSP();
-}
-
-void CodeGenerator::AssemblePopArgumentsAdaptorFrame(Register args_reg,
-                                                     Register scratch1,
-                                                     Register scratch2,
-                                                     Register scratch3) {
-  DCHECK(!AreAliased(args_reg, scratch1, scratch2, scratch3));
-  Label done;
-
-  // Check if current frame is an arguments adaptor frame.
-  __ lw(scratch1, MemOperand(fp, StandardFrameConstants::kContextOffset));
-  __ Branch(&done, ne, scratch1,
-            Operand(StackFrame::TypeToMarker(StackFrame::ARGUMENTS_ADAPTOR)));
-
-  // Load arguments count from current arguments adaptor frame (note, it
-  // does not include receiver).
-  Register caller_args_count_reg = scratch1;
-  __ lw(caller_args_count_reg,
-        MemOperand(fp, ArgumentsAdaptorFrameConstants::kLengthOffset));
-  __ SmiUntag(caller_args_count_reg);
-
-  ParameterCount callee_args_count(args_reg);
-  __ PrepareForTailCall(callee_args_count, caller_args_count_reg, scratch2,
-                        scratch3);
-  __ bind(&done);
-}
-
-namespace {
-
-void AdjustStackPointerForTailCall(TurboAssembler* tasm,
-                                   FrameAccessState* state,
-                                   int new_slot_above_sp,
-                                   bool allow_shrinkage = true) {
-  int current_sp_offset = state->GetSPToFPSlotCount() +
-                          StandardFrameConstants::kFixedSlotCountAboveFp;
-  int stack_slot_delta = new_slot_above_sp - current_sp_offset;
-  if (stack_slot_delta > 0) {
-    tasm->Subu(sp, sp, stack_slot_delta * kPointerSize);
-    state->IncreaseSPDelta(stack_slot_delta);
-  } else if (allow_shrinkage && stack_slot_delta < 0) {
-    tasm->Addu(sp, sp, -stack_slot_delta * kPointerSize);
-    state->IncreaseSPDelta(stack_slot_delta);
-  }
-}
-
-}  // namespace
-
-void CodeGenerator::AssembleTailCallBeforeGap(Instruction* instr,
-                                              int first_unused_stack_slot) {
-  AdjustStackPointerForTailCall(tasm(), frame_access_state(),
-                                first_unused_stack_slot, false);
-}
-
-void CodeGenerator::AssembleTailCallAfterGap(Instruction* instr,
-                                             int first_unused_stack_slot) {
-  AdjustStackPointerForTailCall(tasm(), frame_access_state(),
-                                first_unused_stack_slot);
-}
-
-// Check if the code object is marked for deoptimization. If it is, then it
-// jumps to the CompileLazyDeoptimizedCode builtin. In order to do this we need
-// to:
-//    1. load the address of the current instruction;
-//    2. read from memory the word that contains that bit, which can be found in
-//       the flags in the referenced {CodeDataContainer} object;
-//    3. test kMarkedForDeoptimizationBit in those flags; and
-//    4. if it is not zero then it jumps to the builtin.
-void CodeGenerator::BailoutIfDeoptimized() {
-  Label current;
-  // This push on ra and the pop below together ensure that we restore the
-  // register ra, which is needed while computing frames for deoptimization.
-  __ push(ra);
-  // The bal instruction puts the address of the current instruction into
-  // the return address (ra) register, which we can use later on.
-  __ bal(&current);
-  __ nop();
-  int pc = __ pc_offset();
-  __ bind(&current);
-  int offset = Code::kCodeDataContainerOffset - (Code::kHeaderSize + pc);
-  __ lw(a2, MemOperand(ra, offset));
-  __ pop(ra);
-  __ lw(a2, FieldMemOperand(a2, CodeDataContainer::kKindSpecificFlagsOffset));
-  __ And(a2, a2, Operand(1 << Code::kMarkedForDeoptimizationBit));
-  Handle<Code> code = isolate()->builtins()->builtin_handle(
-      Builtins::kCompileLazyDeoptimizedCode);
-  __ Jump(code, RelocInfo::CODE_TARGET, ne, a2, Operand(zero_reg));
-}
-
-// Assembles an instruction after register allocation, producing machine code.
-CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
-    Instruction* instr) {
-  MipsOperandConverter i(this, instr);
-  InstructionCode opcode = instr->opcode();
-  ArchOpcode arch_opcode = ArchOpcodeField::decode(opcode);
-  switch (arch_opcode) {
-    case kArchCallCodeObject: {
-      if (instr->InputAt(0)->IsImmediate()) {
-        __ Call(i.InputCode(0), RelocInfo::CODE_TARGET);
-      } else {
-        __ Call(at, i.InputRegister(0), Code::kHeaderSize - kHeapObjectTag);
-      }
-      RecordCallPosition(instr);
-      frame_access_state()->ClearSPDelta();
-      break;
-    }
-    case kArchCallWasmFunction: {
-      if (instr->InputAt(0)->IsImmediate()) {
-        Address wasm_code = reinterpret_cast<Address>(
-            i.ToConstant(instr->InputAt(0)).ToInt32());
-        __ Call(wasm_code, info()->IsWasm() ? RelocInfo::WASM_CALL
-                                            : RelocInfo::JS_TO_WASM_CALL);
-      } else {
-        __ Call(i.InputRegister(0));
-      }
-      RecordCallPosition(instr);
-      frame_access_state()->ClearSPDelta();
-      break;
-    }
-    case kArchTailCallCodeObjectFromJSFunction:
-    case kArchTailCallCodeObject: {
-      if (arch_opcode == kArchTailCallCodeObjectFromJSFunction) {
-        AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister,
-                                         i.TempRegister(0), i.TempRegister(1),
-                                         i.TempRegister(2));
-      }
-      if (instr->InputAt(0)->IsImmediate()) {
-        __ Jump(i.InputCode(0), RelocInfo::CODE_TARGET);
-      } else {
-        __ Jump(at, i.InputRegister(0), Code::kHeaderSize - kHeapObjectTag);
-      }
-      frame_access_state()->ClearSPDelta();
-      frame_access_state()->SetFrameAccessToDefault();
-      break;
-    }
-    case kArchTailCallWasm: {
-      if (instr->InputAt(0)->IsImmediate()) {
-        Address wasm_code = reinterpret_cast<Address>(
-            i.ToConstant(instr->InputAt(0)).ToInt32());
-        __ Jump(wasm_code, info()->IsWasm() ? RelocInfo::WASM_CALL
-                                            : RelocInfo::JS_TO_WASM_CALL);
-      } else {
-        __ Jump(i.InputRegister(0));
-      }
-      frame_access_state()->ClearSPDelta();
-      frame_access_state()->SetFrameAccessToDefault();
-      break;
-    }
-    case kArchTailCallAddress: {
-      CHECK(!instr->InputAt(0)->IsImmediate());
-      __ Jump(i.InputRegister(0));
-      frame_access_state()->ClearSPDelta();
-      frame_access_state()->SetFrameAccessToDefault();
-      break;
-    }
-    case kArchCallJSFunction: {
-      Register func = i.InputRegister(0);
-      if (FLAG_debug_code) {
-        // Check the function's context matches the context argument.
-        __ lw(kScratchReg, FieldMemOperand(func, JSFunction::kContextOffset));
-        __ Assert(eq, AbortReason::kWrongFunctionContext, cp,
-                  Operand(kScratchReg));
-      }
-      __ lw(at, FieldMemOperand(func, JSFunction::kCodeOffset));
-      __ Call(at, Code::kHeaderSize - kHeapObjectTag);
-      RecordCallPosition(instr);
-      frame_access_state()->ClearSPDelta();
-      frame_access_state()->SetFrameAccessToDefault();
-      break;
-    }
-    case kArchPrepareCallCFunction: {
-      int const num_parameters = MiscField::decode(instr->opcode());
-      __ PrepareCallCFunction(num_parameters, kScratchReg);
-      // Frame alignment requires using FP-relative frame addressing.
-      frame_access_state()->SetFrameAccessToFP();
-      break;
-    }
-    case kArchSaveCallerRegisters: {
-      fp_mode_ =
-          static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode()));
-      DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
-      // kReturnRegister0 should have been saved before entering the stub.
-      int bytes = __ PushCallerSaved(fp_mode_, kReturnRegister0);
-      DCHECK_EQ(0, bytes % kPointerSize);
-      DCHECK_EQ(0, frame_access_state()->sp_delta());
-      frame_access_state()->IncreaseSPDelta(bytes / kPointerSize);
-      DCHECK(!caller_registers_saved_);
-      caller_registers_saved_ = true;
-      break;
-    }
-    case kArchRestoreCallerRegisters: {
-      DCHECK(fp_mode_ ==
-             static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode())));
-      DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
-      // Don't overwrite the returned value.
-      int bytes = __ PopCallerSaved(fp_mode_, kReturnRegister0);
-      frame_access_state()->IncreaseSPDelta(-(bytes / kPointerSize));
-      DCHECK_EQ(0, frame_access_state()->sp_delta());
-      DCHECK(caller_registers_saved_);
-      caller_registers_saved_ = false;
-      break;
-    }
-    case kArchPrepareTailCall:
-      AssemblePrepareTailCall();
-      break;
-    case kArchCallCFunction: {
-      int const num_parameters = MiscField::decode(instr->opcode());
-      if (instr->InputAt(0)->IsImmediate()) {
-        ExternalReference ref = i.InputExternalReference(0);
-        __ CallCFunction(ref, num_parameters);
-      } else {
-        Register func = i.InputRegister(0);
-        __ CallCFunction(func, num_parameters);
-      }
-      frame_access_state()->SetFrameAccessToDefault();
-      // Ideally, we should decrement SP delta to match the change of stack
-      // pointer in CallCFunction. However, for certain architectures (e.g.
-      // ARM), there may be more strict alignment requirement, causing old SP
-      // to be saved on the stack. In those cases, we can not calculate the SP
-      // delta statically.
-      frame_access_state()->ClearSPDelta();
-      if (caller_registers_saved_) {
-        // Need to re-sync SP delta introduced in kArchSaveCallerRegisters.
-        // Here, we assume the sequence to be:
-        //   kArchSaveCallerRegisters;
-        //   kArchCallCFunction;
-        //   kArchRestoreCallerRegisters;
-        int bytes =
-            __ RequiredStackSizeForCallerSaved(fp_mode_, kReturnRegister0);
-        frame_access_state()->IncreaseSPDelta(bytes / kPointerSize);
-      }
-      break;
-    }
-    case kArchJmp:
-      AssembleArchJump(i.InputRpo(0));
-      break;
-    case kArchLookupSwitch:
-      AssembleArchLookupSwitch(instr);
-      break;
-    case kArchTableSwitch:
-      AssembleArchTableSwitch(instr);
-      break;
-    case kArchDebugAbort:
-      DCHECK(i.InputRegister(0) == a0);
-      if (!frame_access_state()->has_frame()) {
-        // We don't actually want to generate a pile of code for this, so just
-        // claim there is a stack frame, without generating one.
-        FrameScope scope(tasm(), StackFrame::NONE);
-        __ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
-                RelocInfo::CODE_TARGET);
-      } else {
-        __ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
-                RelocInfo::CODE_TARGET);
-      }
-      __ stop("kArchDebugAbort");
-      break;
-    case kArchDebugBreak:
-      __ stop("kArchDebugBreak");
-      break;
-    case kArchComment: {
-      Address comment_string = i.InputExternalReference(0).address();
-      __ RecordComment(reinterpret_cast<const char*>(comment_string));
-      break;
-    }
-    case kArchNop:
-    case kArchThrowTerminator:
-      // don't emit code for nops.
-      break;
-    case kArchDeoptimize: {
-      int deopt_state_id =
-          BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore());
-      CodeGenResult result =
-          AssembleDeoptimizerCall(deopt_state_id, current_source_position_);
-      if (result != kSuccess) return result;
-      break;
-    }
-    case kArchRet:
-      AssembleReturn(instr->InputAt(0));
-      break;
-    case kArchStackPointer:
-      __ mov(i.OutputRegister(), sp);
-      break;
-    case kArchFramePointer:
-      __ mov(i.OutputRegister(), fp);
-      break;
-    case kArchParentFramePointer:
-      if (frame_access_state()->has_frame()) {
-        __ lw(i.OutputRegister(), MemOperand(fp, 0));
-      } else {
-        __ mov(i.OutputRegister(), fp);
-      }
-      break;
-    case kArchTruncateDoubleToI:
-      __ TruncateDoubleToIDelayed(zone(), i.OutputRegister(),
-                                  i.InputDoubleRegister(0));
-      break;
-    case kArchStoreWithWriteBarrier: {
-      RecordWriteMode mode =
-          static_cast<RecordWriteMode>(MiscField::decode(instr->opcode()));
-      Register object = i.InputRegister(0);
-      Register index = i.InputRegister(1);
-      Register value = i.InputRegister(2);
-      Register scratch0 = i.TempRegister(0);
-      Register scratch1 = i.TempRegister(1);
-      auto ool = new (zone()) OutOfLineRecordWrite(this, object, index, value,
-                                                   scratch0, scratch1, mode);
-      __ Addu(at, object, index);
-      __ sw(value, MemOperand(at));
-      __ CheckPageFlag(object, scratch0,
-                       MemoryChunk::kPointersFromHereAreInterestingMask, ne,
-                       ool->entry());
-      __ bind(ool->exit());
-      break;
-    }
-    case kArchStackSlot: {
-      FrameOffset offset =
-          frame_access_state()->GetFrameOffset(i.InputInt32(0));
-      Register base_reg = offset.from_stack_pointer() ? sp : fp;
-      __ Addu(i.OutputRegister(), base_reg, Operand(offset.offset()));
-      int alignment = i.InputInt32(1);
-      DCHECK(alignment == 0 || alignment == 4 || alignment == 8 ||
-             alignment == 16);
-      if (FLAG_debug_code && alignment > 0) {
-        // Verify that the output_register is properly aligned
-        __ And(kScratchReg, i.OutputRegister(), Operand(kPointerSize - 1));
-        __ Assert(eq, AbortReason::kAllocationIsNotDoubleAligned, kScratchReg,
-                  Operand(zero_reg));
-      }
-
-      if (alignment == 2 * kPointerSize) {
-        Label done;
-        __ Addu(kScratchReg, base_reg, Operand(offset.offset()));
-        __ And(kScratchReg, kScratchReg, Operand(alignment - 1));
-        __ BranchShort(&done, eq, kScratchReg, Operand(zero_reg));
-        __ Addu(i.OutputRegister(), i.OutputRegister(), kPointerSize);
-        __ bind(&done);
-      } else if (alignment > 2 * kPointerSize) {
-        Label done;
-        __ Addu(kScratchReg, base_reg, Operand(offset.offset()));
-        __ And(kScratchReg, kScratchReg, Operand(alignment - 1));
-        __ BranchShort(&done, eq, kScratchReg, Operand(zero_reg));
-        __ li(kScratchReg2, alignment);
-        __ Subu(kScratchReg2, kScratchReg2, Operand(kScratchReg));
-        __ Addu(i.OutputRegister(), i.OutputRegister(), kScratchReg2);
-        __ bind(&done);
-      }
-      break;
-    }
-    case kIeee754Float64Acos:
-      ASSEMBLE_IEEE754_UNOP(acos);
-      break;
-    case kIeee754Float64Acosh:
-      ASSEMBLE_IEEE754_UNOP(acosh);
-      break;
-    case kIeee754Float64Asin:
-      ASSEMBLE_IEEE754_UNOP(asin);
-      break;
-    case kIeee754Float64Asinh:
-      ASSEMBLE_IEEE754_UNOP(asinh);
-      break;
-    case kIeee754Float64Atan:
-      ASSEMBLE_IEEE754_UNOP(atan);
-      break;
-    case kIeee754Float64Atanh:
-      ASSEMBLE_IEEE754_UNOP(atanh);
-      break;
-    case kIeee754Float64Atan2:
-      ASSEMBLE_IEEE754_BINOP(atan2);
-      break;
-    case kIeee754Float64Cos:
-      ASSEMBLE_IEEE754_UNOP(cos);
-      break;
-    case kIeee754Float64Cosh:
-      ASSEMBLE_IEEE754_UNOP(cosh);
-      break;
-    case kIeee754Float64Cbrt:
-      ASSEMBLE_IEEE754_UNOP(cbrt);
-      break;
-    case kIeee754Float64Exp:
-      ASSEMBLE_IEEE754_UNOP(exp);
-      break;
-    case kIeee754Float64Expm1:
-      ASSEMBLE_IEEE754_UNOP(expm1);
-      break;
-    case kIeee754Float64Log:
-      ASSEMBLE_IEEE754_UNOP(log);
-      break;
-    case kIeee754Float64Log1p:
-      ASSEMBLE_IEEE754_UNOP(log1p);
-      break;
-    case kIeee754Float64Log10:
-      ASSEMBLE_IEEE754_UNOP(log10);
-      break;
-    case kIeee754Float64Log2:
-      ASSEMBLE_IEEE754_UNOP(log2);
-      break;
-    case kIeee754Float64Pow: {
-      __ CallStubDelayed(new (zone())
-                             MathPowStub(nullptr, MathPowStub::DOUBLE));
-      break;
-    }
-    case kIeee754Float64Sin:
-      ASSEMBLE_IEEE754_UNOP(sin);
-      break;
-    case kIeee754Float64Sinh:
-      ASSEMBLE_IEEE754_UNOP(sinh);
-      break;
-    case kIeee754Float64Tan:
-      ASSEMBLE_IEEE754_UNOP(tan);
-      break;
-    case kIeee754Float64Tanh:
-      ASSEMBLE_IEEE754_UNOP(tanh);
-      break;
-    case kMipsAdd:
-      __ Addu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMipsAddOvf:
-      // Pseudo-instruction used for overflow/branch. No opcode emitted here.
-      break;
-    case kMipsSub:
-      __ Subu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMipsSubOvf:
-      // Pseudo-instruction used for overflow/branch. No opcode emitted here.
-      break;
-    case kMipsMul:
-      __ Mul(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMipsMulOvf:
-      // Pseudo-instruction used for overflow/branch. No opcode emitted here.
-      break;
-    case kMipsMulHigh:
-      __ Mulh(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMipsMulHighU:
-      __ Mulhu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMipsDiv:
-      __ Div(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      if (IsMipsArchVariant(kMips32r6)) {
-        __ selnez(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      } else {
-        __ Movz(i.OutputRegister(), i.InputRegister(1), i.InputRegister(1));
-      }
-      break;
-    case kMipsDivU:
-      __ Divu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      if (IsMipsArchVariant(kMips32r6)) {
-        __ selnez(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      } else {
-        __ Movz(i.OutputRegister(), i.InputRegister(1), i.InputRegister(1));
-      }
-      break;
-    case kMipsMod:
-      __ Mod(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMipsModU:
-      __ Modu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMipsAnd:
-      __ And(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMipsOr:
-      __ Or(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMipsNor:
-      if (instr->InputAt(1)->IsRegister()) {
-        __ Nor(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      } else {
-        DCHECK_EQ(0, i.InputOperand(1).immediate());
-        __ Nor(i.OutputRegister(), i.InputRegister(0), zero_reg);
-      }
-      break;
-    case kMipsXor:
-      __ Xor(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMipsClz:
-      __ Clz(i.OutputRegister(), i.InputRegister(0));
-      break;
-    case kMipsCtz: {
-      Register src = i.InputRegister(0);
-      Register dst = i.OutputRegister();
-      if (IsMipsArchVariant(kMips32r6)) {
-        // We don't have an instruction to count the number of trailing zeroes.
-        // Start by flipping the bits end-for-end so we can count the number of
-        // leading zeroes instead.
-        __ Ror(dst, src, 16);
-        __ wsbh(dst, dst);
-        __ bitswap(dst, dst);
-        __ Clz(dst, dst);
-      } else {
-        // Convert trailing zeroes to trailing ones, and bits to their left
-        // to zeroes.
-        __ Addu(kScratchReg, src, -1);
-        __ Xor(dst, kScratchReg, src);
-        __ And(dst, dst, kScratchReg);
-        // Count number of leading zeroes.
-        __ Clz(dst, dst);
-        // Subtract number of leading zeroes from 32 to get number of trailing
-        // ones. Remember that the trailing ones were formerly trailing zeroes.
-        __ li(kScratchReg, 32);
-        __ Subu(dst, kScratchReg, dst);
-      }
-    } break;
-    case kMipsPopcnt: {
-      // https://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel
-      //
-      // A generalization of the best bit counting method to integers of
-      // bit-widths up to 128 (parameterized by type T) is this:
-      //
-      // v = v - ((v >> 1) & (T)~(T)0/3);                           // temp
-      // v = (v & (T)~(T)0/15*3) + ((v >> 2) & (T)~(T)0/15*3);      // temp
-      // v = (v + (v >> 4)) & (T)~(T)0/255*15;                      // temp
-      // c = (T)(v * ((T)~(T)0/255)) >> (sizeof(T) - 1) * BITS_PER_BYTE; //count
-      //
-      // For comparison, for 32-bit quantities, this algorithm can be executed
-      // using 20 MIPS instructions (the calls to LoadConst32() generate two
-      // machine instructions each for the values being used in this algorithm).
-      // A(n unrolled) loop-based algorithm requires 25 instructions.
-      //
-      // For 64-bit quantities, this algorithm gets executed twice, (once
-      // for in_lo, and again for in_hi), but saves a few instructions
-      // because the mask values only have to be loaded once. Using this
-      // algorithm the count for a 64-bit operand can be performed in 29
-      // instructions compared to a loop-based algorithm which requires 47
-      // instructions.
-      Register src = i.InputRegister(0);
-      Register dst = i.OutputRegister();
-      uint32_t B0 = 0x55555555;     // (T)~(T)0/3
-      uint32_t B1 = 0x33333333;     // (T)~(T)0/15*3
-      uint32_t B2 = 0x0F0F0F0F;     // (T)~(T)0/255*15
-      uint32_t value = 0x01010101;  // (T)~(T)0/255
-      uint32_t shift = 24;          // (sizeof(T) - 1) * BITS_PER_BYTE
-      __ srl(kScratchReg, src, 1);
-      __ li(kScratchReg2, B0);
-      __ And(kScratchReg, kScratchReg, kScratchReg2);
-      __ Subu(kScratchReg, src, kScratchReg);
-      __ li(kScratchReg2, B1);
-      __ And(dst, kScratchReg, kScratchReg2);
-      __ srl(kScratchReg, kScratchReg, 2);
-      __ And(kScratchReg, kScratchReg, kScratchReg2);
-      __ Addu(kScratchReg, dst, kScratchReg);
-      __ srl(dst, kScratchReg, 4);
-      __ Addu(dst, dst, kScratchReg);
-      __ li(kScratchReg2, B2);
-      __ And(dst, dst, kScratchReg2);
-      __ li(kScratchReg, value);
-      __ Mul(dst, dst, kScratchReg);
-      __ srl(dst, dst, shift);
-    } break;
-    case kMipsShl:
-      if (instr->InputAt(1)->IsRegister()) {
-        __ sllv(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      } else {
-        int32_t imm = i.InputOperand(1).immediate();
-        __ sll(i.OutputRegister(), i.InputRegister(0), imm);
-      }
-      break;
-    case kMipsShr:
-      if (instr->InputAt(1)->IsRegister()) {
-        __ srlv(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      } else {
-        int32_t imm = i.InputOperand(1).immediate();
-        __ srl(i.OutputRegister(), i.InputRegister(0), imm);
-      }
-      break;
-    case kMipsSar:
-      if (instr->InputAt(1)->IsRegister()) {
-        __ srav(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      } else {
-        int32_t imm = i.InputOperand(1).immediate();
-        __ sra(i.OutputRegister(), i.InputRegister(0), imm);
-      }
-      break;
-    case kMipsShlPair: {
-      Register second_output =
-          instr->OutputCount() >= 2 ? i.OutputRegister(1) : i.TempRegister(0);
-      if (instr->InputAt(2)->IsRegister()) {
-        __ ShlPair(i.OutputRegister(0), second_output, i.InputRegister(0),
-                   i.InputRegister(1), i.InputRegister(2));
-      } else {
-        uint32_t imm = i.InputOperand(2).immediate();
-        __ ShlPair(i.OutputRegister(0), second_output, i.InputRegister(0),
-                   i.InputRegister(1), imm);
-      }
-    } break;
-    case kMipsShrPair: {
-      Register second_output =
-          instr->OutputCount() >= 2 ? i.OutputRegister(1) : i.TempRegister(0);
-      if (instr->InputAt(2)->IsRegister()) {
-        __ ShrPair(i.OutputRegister(0), second_output, i.InputRegister(0),
-                   i.InputRegister(1), i.InputRegister(2));
-      } else {
-        uint32_t imm = i.InputOperand(2).immediate();
-        __ ShrPair(i.OutputRegister(0), second_output, i.InputRegister(0),
-                   i.InputRegister(1), imm);
-      }
-    } break;
-    case kMipsSarPair: {
-      Register second_output =
-          instr->OutputCount() >= 2 ? i.OutputRegister(1) : i.TempRegister(0);
-      if (instr->InputAt(2)->IsRegister()) {
-        __ SarPair(i.OutputRegister(0), second_output, i.InputRegister(0),
-                   i.InputRegister(1), i.InputRegister(2));
-      } else {
-        uint32_t imm = i.InputOperand(2).immediate();
-        __ SarPair(i.OutputRegister(0), second_output, i.InputRegister(0),
-                   i.InputRegister(1), imm);
-      }
-    } break;
-    case kMipsExt:
-      __ Ext(i.OutputRegister(), i.InputRegister(0), i.InputInt8(1),
-             i.InputInt8(2));
-      break;
-    case kMipsIns:
-      if (instr->InputAt(1)->IsImmediate() && i.InputInt8(1) == 0) {
-        __ Ins(i.OutputRegister(), zero_reg, i.InputInt8(1), i.InputInt8(2));
-      } else {
-        __ Ins(i.OutputRegister(), i.InputRegister(0), i.InputInt8(1),
-               i.InputInt8(2));
-      }
-      break;
-    case kMipsRor:
-      __ Ror(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMipsTst:
-      // Pseudo-instruction used for tst/branch. No opcode emitted here.
-      break;
-    case kMipsCmp:
-      // Pseudo-instruction used for cmp/branch. No opcode emitted here.
-      break;
-    case kMipsMov:
-      // TODO(plind): Should we combine mov/li like this, or use separate instr?
-      //    - Also see x64 ASSEMBLE_BINOP & RegisterOrOperandType
-      if (HasRegisterInput(instr, 0)) {
-        __ mov(i.OutputRegister(), i.InputRegister(0));
-      } else {
-        __ li(i.OutputRegister(), i.InputOperand(0));
-      }
-      break;
-    case kMipsLsa:
-      DCHECK(instr->InputAt(2)->IsImmediate());
-      __ Lsa(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
-             i.InputInt8(2));
-      break;
-    case kMipsCmpS:
-      // Pseudo-instruction used for FP cmp/branch. No opcode emitted here.
-      break;
-    case kMipsAddS:
-      // TODO(plind): add special case: combine mult & add.
-      __ add_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-               i.InputDoubleRegister(1));
-      break;
-    case kMipsSubS:
-      __ sub_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-               i.InputDoubleRegister(1));
-      break;
-    case kMipsMulS:
-      // TODO(plind): add special case: right op is -1.0, see arm port.
-      __ mul_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-               i.InputDoubleRegister(1));
-      break;
-    case kMipsDivS:
-      __ div_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-               i.InputDoubleRegister(1));
-      break;
-    case kMipsModS: {
-      // TODO(bmeurer): We should really get rid of this special instruction,
-      // and generate a CallAddress instruction instead.
-      FrameScope scope(tasm(), StackFrame::MANUAL);
-      __ PrepareCallCFunction(0, 2, kScratchReg);
-      __ MovToFloatParameters(i.InputDoubleRegister(0),
-                              i.InputDoubleRegister(1));
-      // TODO(balazs.kilvady): implement mod_two_floats_operation(isolate())
-      __ CallCFunction(ExternalReference::mod_two_doubles_operation(isolate()),
-                       0, 2);
-      // Move the result in the double result register.
-      __ MovFromFloatResult(i.OutputSingleRegister());
-      break;
-    }
-    case kMipsAbsS:
-      __ abs_s(i.OutputSingleRegister(), i.InputSingleRegister(0));
-      break;
-    case kMipsSqrtS: {
-      __ sqrt_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    }
-    case kMipsMaxS:
-      __ max_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-               i.InputDoubleRegister(1));
-      break;
-    case kMipsMinS:
-      __ min_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-               i.InputDoubleRegister(1));
-      break;
-    case kMipsCmpD:
-      // Pseudo-instruction used for FP cmp/branch. No opcode emitted here.
-      break;
-    case kMipsAddPair:
-      __ AddPair(i.OutputRegister(0), i.OutputRegister(1), i.InputRegister(0),
-                 i.InputRegister(1), i.InputRegister(2), i.InputRegister(3));
-      break;
-    case kMipsSubPair:
-      __ SubPair(i.OutputRegister(0), i.OutputRegister(1), i.InputRegister(0),
-                 i.InputRegister(1), i.InputRegister(2), i.InputRegister(3));
-      break;
-    case kMipsMulPair: {
-      __ Mulu(i.OutputRegister(1), i.OutputRegister(0), i.InputRegister(0),
-              i.InputRegister(2));
-      __ Mul(kScratchReg, i.InputRegister(0), i.InputRegister(3));
-      __ Mul(kScratchReg2, i.InputRegister(1), i.InputRegister(2));
-      __ Addu(i.OutputRegister(1), i.OutputRegister(1), kScratchReg);
-      __ Addu(i.OutputRegister(1), i.OutputRegister(1), kScratchReg2);
-    } break;
-    case kMipsAddD:
-      // TODO(plind): add special case: combine mult & add.
-      __ add_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-               i.InputDoubleRegister(1));
-      break;
-    case kMipsSubD:
-      __ sub_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-               i.InputDoubleRegister(1));
-      break;
-    case kMipsMaddS:
-      __ Madd_s(i.OutputFloatRegister(), i.InputFloatRegister(0),
-                i.InputFloatRegister(1), i.InputFloatRegister(2),
-                kScratchDoubleReg);
-      break;
-    case kMipsMaddD:
-      __ Madd_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-                i.InputDoubleRegister(1), i.InputDoubleRegister(2),
-                kScratchDoubleReg);
-      break;
-    case kMipsMsubS:
-      __ Msub_s(i.OutputFloatRegister(), i.InputFloatRegister(0),
-                i.InputFloatRegister(1), i.InputFloatRegister(2),
-                kScratchDoubleReg);
-      break;
-    case kMipsMsubD:
-      __ Msub_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-                i.InputDoubleRegister(1), i.InputDoubleRegister(2),
-                kScratchDoubleReg);
-      break;
-    case kMipsMulD:
-      // TODO(plind): add special case: right op is -1.0, see arm port.
-      __ mul_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-               i.InputDoubleRegister(1));
-      break;
-    case kMipsDivD:
-      __ div_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-               i.InputDoubleRegister(1));
-      break;
-    case kMipsModD: {
-      // TODO(bmeurer): We should really get rid of this special instruction,
-      // and generate a CallAddress instruction instead.
-      FrameScope scope(tasm(), StackFrame::MANUAL);
-      __ PrepareCallCFunction(0, 2, kScratchReg);
-      __ MovToFloatParameters(i.InputDoubleRegister(0),
-                              i.InputDoubleRegister(1));
-      __ CallCFunction(ExternalReference::mod_two_doubles_operation(isolate()),
-                       0, 2);
-      // Move the result in the double result register.
-      __ MovFromFloatResult(i.OutputDoubleRegister());
-      break;
-    }
-    case kMipsAbsD:
-      __ abs_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    case kMipsNegS:
-      __ Neg_s(i.OutputSingleRegister(), i.InputSingleRegister(0));
-      break;
-    case kMipsNegD:
-      __ Neg_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    case kMipsSqrtD: {
-      __ sqrt_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    }
-    case kMipsMaxD:
-      __ max_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-               i.InputDoubleRegister(1));
-      break;
-    case kMipsMinD:
-      __ min_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-               i.InputDoubleRegister(1));
-      break;
-    case kMipsFloat64RoundDown: {
-      ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(floor);
-      break;
-    }
-    case kMipsFloat32RoundDown: {
-      ASSEMBLE_ROUND_FLOAT_TO_FLOAT(floor);
-      break;
-    }
-    case kMipsFloat64RoundTruncate: {
-      ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(trunc);
-      break;
-    }
-    case kMipsFloat32RoundTruncate: {
-      ASSEMBLE_ROUND_FLOAT_TO_FLOAT(trunc);
-      break;
-    }
-    case kMipsFloat64RoundUp: {
-      ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(ceil);
-      break;
-    }
-    case kMipsFloat32RoundUp: {
-      ASSEMBLE_ROUND_FLOAT_TO_FLOAT(ceil);
-      break;
-    }
-    case kMipsFloat64RoundTiesEven: {
-      ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(round);
-      break;
-    }
-    case kMipsFloat32RoundTiesEven: {
-      ASSEMBLE_ROUND_FLOAT_TO_FLOAT(round);
-      break;
-    }
-    case kMipsFloat32Max: {
-      FPURegister dst = i.OutputSingleRegister();
-      FPURegister src1 = i.InputSingleRegister(0);
-      FPURegister src2 = i.InputSingleRegister(1);
-      auto ool = new (zone()) OutOfLineFloat32Max(this, dst, src1, src2);
-      __ Float32Max(dst, src1, src2, ool->entry());
-      __ bind(ool->exit());
-      break;
-    }
-    case kMipsFloat64Max: {
-      DoubleRegister dst = i.OutputDoubleRegister();
-      DoubleRegister src1 = i.InputDoubleRegister(0);
-      DoubleRegister src2 = i.InputDoubleRegister(1);
-      auto ool = new (zone()) OutOfLineFloat64Max(this, dst, src1, src2);
-      __ Float64Max(dst, src1, src2, ool->entry());
-      __ bind(ool->exit());
-      break;
-    }
-    case kMipsFloat32Min: {
-      FPURegister dst = i.OutputSingleRegister();
-      FPURegister src1 = i.InputSingleRegister(0);
-      FPURegister src2 = i.InputSingleRegister(1);
-      auto ool = new (zone()) OutOfLineFloat32Min(this, dst, src1, src2);
-      __ Float32Min(dst, src1, src2, ool->entry());
-      __ bind(ool->exit());
-      break;
-    }
-    case kMipsFloat64Min: {
-      DoubleRegister dst = i.OutputDoubleRegister();
-      DoubleRegister src1 = i.InputDoubleRegister(0);
-      DoubleRegister src2 = i.InputDoubleRegister(1);
-      auto ool = new (zone()) OutOfLineFloat64Min(this, dst, src1, src2);
-      __ Float64Min(dst, src1, src2, ool->entry());
-      __ bind(ool->exit());
-      break;
-    }
-    case kMipsCvtSD: {
-      __ cvt_s_d(i.OutputSingleRegister(), i.InputDoubleRegister(0));
-      break;
-    }
-    case kMipsCvtDS: {
-      __ cvt_d_s(i.OutputDoubleRegister(), i.InputSingleRegister(0));
-      break;
-    }
-    case kMipsCvtDW: {
-      FPURegister scratch = kScratchDoubleReg;
-      __ mtc1(i.InputRegister(0), scratch);
-      __ cvt_d_w(i.OutputDoubleRegister(), scratch);
-      break;
-    }
-    case kMipsCvtSW: {
-      FPURegister scratch = kScratchDoubleReg;
-      __ mtc1(i.InputRegister(0), scratch);
-      __ cvt_s_w(i.OutputDoubleRegister(), scratch);
-      break;
-    }
-    case kMipsCvtSUw: {
-      FPURegister scratch = kScratchDoubleReg;
-      __ Cvt_d_uw(i.OutputDoubleRegister(), i.InputRegister(0), scratch);
-      __ cvt_s_d(i.OutputDoubleRegister(), i.OutputDoubleRegister());
-      break;
-    }
-    case kMipsCvtDUw: {
-      FPURegister scratch = kScratchDoubleReg;
-      __ Cvt_d_uw(i.OutputDoubleRegister(), i.InputRegister(0), scratch);
-      break;
-    }
-    case kMipsFloorWD: {
-      FPURegister scratch = kScratchDoubleReg;
-      __ Floor_w_d(scratch, i.InputDoubleRegister(0));
-      __ mfc1(i.OutputRegister(), scratch);
-      break;
-    }
-    case kMipsCeilWD: {
-      FPURegister scratch = kScratchDoubleReg;
-      __ Ceil_w_d(scratch, i.InputDoubleRegister(0));
-      __ mfc1(i.OutputRegister(), scratch);
-      break;
-    }
-    case kMipsRoundWD: {
-      FPURegister scratch = kScratchDoubleReg;
-      __ Round_w_d(scratch, i.InputDoubleRegister(0));
-      __ mfc1(i.OutputRegister(), scratch);
-      break;
-    }
-    case kMipsTruncWD: {
-      FPURegister scratch = kScratchDoubleReg;
-      // Other arches use round to zero here, so we follow.
-      __ Trunc_w_d(scratch, i.InputDoubleRegister(0));
-      __ mfc1(i.OutputRegister(), scratch);
-      break;
-    }
-    case kMipsFloorWS: {
-      FPURegister scratch = kScratchDoubleReg;
-      __ floor_w_s(scratch, i.InputDoubleRegister(0));
-      __ mfc1(i.OutputRegister(), scratch);
-      break;
-    }
-    case kMipsCeilWS: {
-      FPURegister scratch = kScratchDoubleReg;
-      __ ceil_w_s(scratch, i.InputDoubleRegister(0));
-      __ mfc1(i.OutputRegister(), scratch);
-      break;
-    }
-    case kMipsRoundWS: {
-      FPURegister scratch = kScratchDoubleReg;
-      __ round_w_s(scratch, i.InputDoubleRegister(0));
-      __ mfc1(i.OutputRegister(), scratch);
-      break;
-    }
-    case kMipsTruncWS: {
-      FPURegister scratch = kScratchDoubleReg;
-      __ trunc_w_s(scratch, i.InputDoubleRegister(0));
-      __ mfc1(i.OutputRegister(), scratch);
-      // Avoid INT32_MAX as an overflow indicator and use INT32_MIN instead,
-      // because INT32_MIN allows easier out-of-bounds detection.
-      __ Addu(kScratchReg, i.OutputRegister(), 1);
-      __ Slt(kScratchReg2, kScratchReg, i.OutputRegister());
-      __ Movn(i.OutputRegister(), kScratchReg, kScratchReg2);
-      break;
-    }
-    case kMipsTruncUwD: {
-      FPURegister scratch = kScratchDoubleReg;
-      // TODO(plind): Fix wrong param order of Trunc_uw_d() macro-asm function.
-      __ Trunc_uw_d(i.InputDoubleRegister(0), i.OutputRegister(), scratch);
-      break;
-    }
-    case kMipsTruncUwS: {
-      FPURegister scratch = kScratchDoubleReg;
-      // TODO(plind): Fix wrong param order of Trunc_uw_s() macro-asm function.
-      __ Trunc_uw_s(i.InputDoubleRegister(0), i.OutputRegister(), scratch);
-      // Avoid UINT32_MAX as an overflow indicator and use 0 instead,
-      // because 0 allows easier out-of-bounds detection.
-      __ Addu(kScratchReg, i.OutputRegister(), 1);
-      __ Movz(i.OutputRegister(), zero_reg, kScratchReg);
-      break;
-    }
-    case kMipsFloat64ExtractLowWord32:
-      __ FmoveLow(i.OutputRegister(), i.InputDoubleRegister(0));
-      break;
-    case kMipsFloat64ExtractHighWord32:
-      __ FmoveHigh(i.OutputRegister(), i.InputDoubleRegister(0));
-      break;
-    case kMipsFloat64InsertLowWord32:
-      __ FmoveLow(i.OutputDoubleRegister(), i.InputRegister(1));
-      break;
-    case kMipsFloat64InsertHighWord32:
-      __ FmoveHigh(i.OutputDoubleRegister(), i.InputRegister(1));
-      break;
-    case kMipsFloat64SilenceNaN:
-      __ FPUCanonicalizeNaN(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-
-    // ... more basic instructions ...
-    case kMipsSeb:
-      __ Seb(i.OutputRegister(), i.InputRegister(0));
-      break;
-    case kMipsSeh:
-      __ Seh(i.OutputRegister(), i.InputRegister(0));
-      break;
-    case kMipsLbu:
-      __ lbu(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kMipsLb:
-      __ lb(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kMipsSb:
-      __ sb(i.InputOrZeroRegister(2), i.MemoryOperand());
-      break;
-    case kMipsLhu:
-      __ lhu(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kMipsUlhu:
-      __ Ulhu(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kMipsLh:
-      __ lh(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kMipsUlh:
-      __ Ulh(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kMipsSh:
-      __ sh(i.InputOrZeroRegister(2), i.MemoryOperand());
-      break;
-    case kMipsUsh:
-      __ Ush(i.InputOrZeroRegister(2), i.MemoryOperand(), kScratchReg);
-      break;
-    case kMipsLw:
-      __ lw(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kMipsUlw:
-      __ Ulw(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kMipsSw:
-      __ sw(i.InputOrZeroRegister(2), i.MemoryOperand());
-      break;
-    case kMipsUsw:
-      __ Usw(i.InputOrZeroRegister(2), i.MemoryOperand());
-      break;
-    case kMipsLwc1: {
-      __ lwc1(i.OutputSingleRegister(), i.MemoryOperand());
-      break;
-    }
-    case kMipsUlwc1: {
-      __ Ulwc1(i.OutputSingleRegister(), i.MemoryOperand(), kScratchReg);
-      break;
-    }
-    case kMipsSwc1: {
-      size_t index = 0;
-      MemOperand operand = i.MemoryOperand(&index);
-      FPURegister ft = i.InputOrZeroSingleRegister(index);
-      if (ft == kDoubleRegZero && !__ IsDoubleZeroRegSet()) {
-        __ Move(kDoubleRegZero, 0.0);
-      }
-      __ swc1(ft, operand);
-      break;
-    }
-    case kMipsUswc1: {
-      size_t index = 0;
-      MemOperand operand = i.MemoryOperand(&index);
-      FPURegister ft = i.InputOrZeroSingleRegister(index);
-      if (ft == kDoubleRegZero && !__ IsDoubleZeroRegSet()) {
-        __ Move(kDoubleRegZero, 0.0);
-      }
-      __ Uswc1(ft, operand, kScratchReg);
-      break;
-    }
-    case kMipsLdc1:
-      __ Ldc1(i.OutputDoubleRegister(), i.MemoryOperand());
-      break;
-    case kMipsUldc1:
-      __ Uldc1(i.OutputDoubleRegister(), i.MemoryOperand(), kScratchReg);
-      break;
-    case kMipsSdc1: {
-      FPURegister ft = i.InputOrZeroDoubleRegister(2);
-      if (ft == kDoubleRegZero && !__ IsDoubleZeroRegSet()) {
-        __ Move(kDoubleRegZero, 0.0);
-      }
-      __ Sdc1(ft, i.MemoryOperand());
-      break;
-    }
-    case kMipsUsdc1: {
-      FPURegister ft = i.InputOrZeroDoubleRegister(2);
-      if (ft == kDoubleRegZero && !__ IsDoubleZeroRegSet()) {
-        __ Move(kDoubleRegZero, 0.0);
-      }
-      __ Usdc1(ft, i.MemoryOperand(), kScratchReg);
-      break;
-    }
-    case kMipsPush:
-      if (instr->InputAt(0)->IsFPRegister()) {
-        LocationOperand* op = LocationOperand::cast(instr->InputAt(0));
-        switch (op->representation()) {
-          case MachineRepresentation::kFloat32:
-            __ swc1(i.InputFloatRegister(0), MemOperand(sp, -kFloatSize));
-            __ Subu(sp, sp, Operand(kFloatSize));
-            frame_access_state()->IncreaseSPDelta(kFloatSize / kPointerSize);
-            break;
-          case MachineRepresentation::kFloat64:
-            __ Sdc1(i.InputDoubleRegister(0), MemOperand(sp, -kDoubleSize));
-            __ Subu(sp, sp, Operand(kDoubleSize));
-            frame_access_state()->IncreaseSPDelta(kDoubleSize / kPointerSize);
-            break;
-          default: {
-            UNREACHABLE();
-            break;
-          }
-        }
-      } else {
-        __ Push(i.InputRegister(0));
-        frame_access_state()->IncreaseSPDelta(1);
-      }
-      break;
-    case kMipsPeek: {
-      int reverse_slot = MiscField::decode(instr->opcode());
-      int offset =
-          FrameSlotToFPOffset(frame()->GetTotalFrameSlotCount() - reverse_slot);
-      if (instr->OutputAt(0)->IsFPRegister()) {
-        LocationOperand* op = LocationOperand::cast(instr->OutputAt(0));
-        if (op->representation() == MachineRepresentation::kFloat64) {
-          __ Ldc1(i.OutputDoubleRegister(), MemOperand(fp, offset));
-        } else {
-          DCHECK_EQ(op->representation(), MachineRepresentation::kFloat32);
-          __ lwc1(i.OutputSingleRegister(0), MemOperand(fp, offset));
-        }
-      } else {
-        __ lw(i.OutputRegister(0), MemOperand(fp, offset));
-      }
-      break;
-    }
-    case kMipsStackClaim: {
-      __ Subu(sp, sp, Operand(i.InputInt32(0)));
-      frame_access_state()->IncreaseSPDelta(i.InputInt32(0) / kPointerSize);
-      break;
-    }
-    case kMipsStoreToStackSlot: {
-      if (instr->InputAt(0)->IsFPRegister()) {
-        LocationOperand* op = LocationOperand::cast(instr->InputAt(0));
-        if (op->representation() == MachineRepresentation::kFloat64) {
-          __ Sdc1(i.InputDoubleRegister(0), MemOperand(sp, i.InputInt32(1)));
-        } else {
-          DCHECK_EQ(MachineRepresentation::kFloat32, op->representation());
-          __ swc1(i.InputSingleRegister(0), MemOperand(sp, i.InputInt32(1)));
-        }
-      } else {
-        __ sw(i.InputRegister(0), MemOperand(sp, i.InputInt32(1)));
-      }
-      break;
-    }
-    case kMipsByteSwap32: {
-      __ ByteSwapSigned(i.OutputRegister(0), i.InputRegister(0), 4);
-      break;
-    }
-    case kAtomicLoadInt8:
-      ASSEMBLE_ATOMIC_LOAD_INTEGER(lb);
-      break;
-    case kAtomicLoadUint8:
-      ASSEMBLE_ATOMIC_LOAD_INTEGER(lbu);
-      break;
-    case kAtomicLoadInt16:
-      ASSEMBLE_ATOMIC_LOAD_INTEGER(lh);
-      break;
-    case kAtomicLoadUint16:
-      ASSEMBLE_ATOMIC_LOAD_INTEGER(lhu);
-      break;
-    case kAtomicLoadWord32:
-      ASSEMBLE_ATOMIC_LOAD_INTEGER(lw);
-      break;
-    case kAtomicStoreWord8:
-      ASSEMBLE_ATOMIC_STORE_INTEGER(sb);
-      break;
-    case kAtomicStoreWord16:
-      ASSEMBLE_ATOMIC_STORE_INTEGER(sh);
-      break;
-    case kAtomicStoreWord32:
-      ASSEMBLE_ATOMIC_STORE_INTEGER(sw);
-      break;
-    case kAtomicExchangeInt8:
-      ASSEMBLE_ATOMIC_EXCHANGE_INTEGER_EXT(true, 8);
-      break;
-    case kAtomicExchangeUint8:
-      ASSEMBLE_ATOMIC_EXCHANGE_INTEGER_EXT(false, 8);
-      break;
-    case kAtomicExchangeInt16:
-      ASSEMBLE_ATOMIC_EXCHANGE_INTEGER_EXT(true, 16);
-      break;
-    case kAtomicExchangeUint16:
-      ASSEMBLE_ATOMIC_EXCHANGE_INTEGER_EXT(false, 16);
-      break;
-    case kAtomicExchangeWord32:
-      ASSEMBLE_ATOMIC_EXCHANGE_INTEGER();
-      break;
-    case kAtomicCompareExchangeInt8:
-      ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER_EXT(true, 8);
-      break;
-    case kAtomicCompareExchangeUint8:
-      ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER_EXT(false, 8);
-      break;
-    case kAtomicCompareExchangeInt16:
-      ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER_EXT(true, 16);
-      break;
-    case kAtomicCompareExchangeUint16:
-      ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER_EXT(false, 16);
-      break;
-    case kAtomicCompareExchangeWord32:
-      ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER();
-      break;
-#define ATOMIC_BINOP_CASE(op, inst)             \
-  case kAtomic##op##Int8:                       \
-    ASSEMBLE_ATOMIC_BINOP_EXT(true, 8, inst);   \
-    break;                                      \
-  case kAtomic##op##Uint8:                      \
-    ASSEMBLE_ATOMIC_BINOP_EXT(false, 8, inst);  \
-    break;                                      \
-  case kAtomic##op##Int16:                      \
-    ASSEMBLE_ATOMIC_BINOP_EXT(true, 16, inst);  \
-    break;                                      \
-  case kAtomic##op##Uint16:                     \
-    ASSEMBLE_ATOMIC_BINOP_EXT(false, 16, inst); \
-    break;                                      \
-  case kAtomic##op##Word32:                     \
-    ASSEMBLE_ATOMIC_BINOP(inst);                \
-    break;
-      ATOMIC_BINOP_CASE(Add, Addu)
-      ATOMIC_BINOP_CASE(Sub, Subu)
-      ATOMIC_BINOP_CASE(And, And)
-      ATOMIC_BINOP_CASE(Or, Or)
-      ATOMIC_BINOP_CASE(Xor, Xor)
-#undef ATOMIC_BINOP_CASE
-    case kMipsS128Zero: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ xor_v(i.OutputSimd128Register(), i.OutputSimd128Register(),
-               i.OutputSimd128Register());
-      break;
-    }
-    case kMipsI32x4Splat: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ fill_w(i.OutputSimd128Register(), i.InputRegister(0));
-      break;
-    }
-    case kMipsI32x4ExtractLane: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ copy_s_w(i.OutputRegister(), i.InputSimd128Register(0),
-                  i.InputInt8(1));
-      break;
-    }
-    case kMipsI32x4ReplaceLane: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register src = i.InputSimd128Register(0);
-      Simd128Register dst = i.OutputSimd128Register();
-      if (src != dst) {
-        __ move_v(dst, src);
-      }
-      __ insert_w(dst, i.InputInt8(1), i.InputRegister(2));
-      break;
-    }
-    case kMipsI32x4Add: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ addv_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI32x4Sub: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ subv_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsF32x4Splat: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ FmoveLow(kScratchReg, i.InputSingleRegister(0));
-      __ fill_w(i.OutputSimd128Register(), kScratchReg);
-      break;
-    }
-    case kMipsF32x4ExtractLane: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ copy_u_w(kScratchReg, i.InputSimd128Register(0), i.InputInt8(1));
-      __ FmoveLow(i.OutputSingleRegister(), kScratchReg);
-      break;
-    }
-    case kMipsF32x4ReplaceLane: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register src = i.InputSimd128Register(0);
-      Simd128Register dst = i.OutputSimd128Register();
-      if (src != dst) {
-        __ move_v(dst, src);
-      }
-      __ FmoveLow(kScratchReg, i.InputSingleRegister(2));
-      __ insert_w(dst, i.InputInt8(1), kScratchReg);
-      break;
-    }
-    case kMipsF32x4SConvertI32x4: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ ffint_s_w(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kMipsF32x4UConvertI32x4: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ ffint_u_w(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kMipsI32x4Mul: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ mulv_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI32x4MaxS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ max_s_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI32x4MinS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ min_s_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI32x4Eq: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ ceq_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-               i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI32x4Ne: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register();
-      __ ceq_w(dst, i.InputSimd128Register(0), i.InputSimd128Register(1));
-      __ nor_v(dst, dst, dst);
-      break;
-    }
-    case kMipsI32x4Shl: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ slli_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputInt5(1));
-      break;
-    }
-    case kMipsI32x4ShrS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ srai_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputInt5(1));
-      break;
-    }
-    case kMipsI32x4ShrU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ srli_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputInt5(1));
-      break;
-    }
-    case kMipsI32x4MaxU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ max_u_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI32x4MinU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ min_u_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsS128Select: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      DCHECK(i.OutputSimd128Register() == i.InputSimd128Register(0));
-      __ bsel_v(i.OutputSimd128Register(), i.InputSimd128Register(2),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsF32x4Abs: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ bclri_w(i.OutputSimd128Register(), i.InputSimd128Register(0), 31);
-      break;
-    }
-    case kMipsF32x4Neg: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ bnegi_w(i.OutputSimd128Register(), i.InputSimd128Register(0), 31);
-      break;
-    }
-    case kMipsF32x4RecipApprox: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ frcp_w(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kMipsF32x4RecipSqrtApprox: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ frsqrt_w(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kMipsF32x4Add: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ fadd_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsF32x4Sub: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ fsub_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsF32x4Mul: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ fmul_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsF32x4Max: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ fmax_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsF32x4Min: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ fmin_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsF32x4Eq: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ fceq_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsF32x4Ne: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ fcne_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsF32x4Lt: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ fclt_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsF32x4Le: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ fcle_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI32x4SConvertF32x4: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ ftrunc_s_w(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kMipsI32x4UConvertF32x4: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ ftrunc_u_w(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kMipsI32x4Neg: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
-      __ subv_w(i.OutputSimd128Register(), kSimd128RegZero,
-                i.InputSimd128Register(0));
-      break;
-    }
-    case kMipsI32x4GtS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ clt_s_w(i.OutputSimd128Register(), i.InputSimd128Register(1),
-                 i.InputSimd128Register(0));
-      break;
-    }
-    case kMipsI32x4GeS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ cle_s_w(i.OutputSimd128Register(), i.InputSimd128Register(1),
-                 i.InputSimd128Register(0));
-      break;
-    }
-    case kMipsI32x4GtU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ clt_u_w(i.OutputSimd128Register(), i.InputSimd128Register(1),
-                 i.InputSimd128Register(0));
-      break;
-    }
-    case kMipsI32x4GeU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ cle_u_w(i.OutputSimd128Register(), i.InputSimd128Register(1),
-                 i.InputSimd128Register(0));
-      break;
-    }
-    case kMipsI16x8Splat: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ fill_h(i.OutputSimd128Register(), i.InputRegister(0));
-      break;
-    }
-    case kMipsI16x8ExtractLane: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ copy_s_h(i.OutputRegister(), i.InputSimd128Register(0),
-                  i.InputInt8(1));
-      break;
-    }
-    case kMipsI16x8ReplaceLane: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register src = i.InputSimd128Register(0);
-      Simd128Register dst = i.OutputSimd128Register();
-      if (src != dst) {
-        __ move_v(dst, src);
-      }
-      __ insert_h(dst, i.InputInt8(1), i.InputRegister(2));
-      break;
-    }
-    case kMipsI16x8Neg: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
-      __ subv_h(i.OutputSimd128Register(), kSimd128RegZero,
-                i.InputSimd128Register(0));
-      break;
-    }
-    case kMipsI16x8Shl: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ slli_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputInt4(1));
-      break;
-    }
-    case kMipsI16x8ShrS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ srai_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputInt4(1));
-      break;
-    }
-    case kMipsI16x8ShrU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ srli_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputInt4(1));
-      break;
-    }
-    case kMipsI16x8Add: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ addv_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI16x8AddSaturateS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ adds_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI16x8Sub: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ subv_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI16x8SubSaturateS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ subs_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI16x8Mul: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ mulv_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI16x8MaxS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ max_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI16x8MinS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ min_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI16x8Eq: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ ceq_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-               i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI16x8Ne: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register();
-      __ ceq_h(dst, i.InputSimd128Register(0), i.InputSimd128Register(1));
-      __ nor_v(dst, dst, dst);
-      break;
-    }
-    case kMipsI16x8GtS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ clt_s_h(i.OutputSimd128Register(), i.InputSimd128Register(1),
-                 i.InputSimd128Register(0));
-      break;
-    }
-    case kMipsI16x8GeS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ cle_s_h(i.OutputSimd128Register(), i.InputSimd128Register(1),
-                 i.InputSimd128Register(0));
-      break;
-    }
-    case kMipsI16x8AddSaturateU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ adds_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI16x8SubSaturateU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ subs_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI16x8MaxU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ max_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI16x8MinU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ min_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI16x8GtU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ clt_u_h(i.OutputSimd128Register(), i.InputSimd128Register(1),
-                 i.InputSimd128Register(0));
-      break;
-    }
-    case kMipsI16x8GeU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ cle_u_h(i.OutputSimd128Register(), i.InputSimd128Register(1),
-                 i.InputSimd128Register(0));
-      break;
-    }
-    case kMipsI8x16Splat: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ fill_b(i.OutputSimd128Register(), i.InputRegister(0));
-      break;
-    }
-    case kMipsI8x16ExtractLane: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ copy_s_b(i.OutputRegister(), i.InputSimd128Register(0),
-                  i.InputInt8(1));
-      break;
-    }
-    case kMipsI8x16ReplaceLane: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register src = i.InputSimd128Register(0);
-      Simd128Register dst = i.OutputSimd128Register();
-      if (src != dst) {
-        __ move_v(dst, src);
-      }
-      __ insert_b(dst, i.InputInt8(1), i.InputRegister(2));
-      break;
-    }
-    case kMipsI8x16Neg: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
-      __ subv_b(i.OutputSimd128Register(), kSimd128RegZero,
-                i.InputSimd128Register(0));
-      break;
-    }
-    case kMipsI8x16Shl: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ slli_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputInt3(1));
-      break;
-    }
-    case kMipsI8x16ShrS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ srai_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputInt3(1));
-      break;
-    }
-    case kMipsI8x16Add: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ addv_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI8x16AddSaturateS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ adds_s_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI8x16Sub: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ subv_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI8x16SubSaturateS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ subs_s_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI8x16Mul: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ mulv_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI8x16MaxS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ max_s_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI8x16MinS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ min_s_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI8x16Eq: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ ceq_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-               i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI8x16Ne: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register();
-      __ ceq_b(dst, i.InputSimd128Register(0), i.InputSimd128Register(1));
-      __ nor_v(dst, dst, dst);
-      break;
-    }
-    case kMipsI8x16GtS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ clt_s_b(i.OutputSimd128Register(), i.InputSimd128Register(1),
-                 i.InputSimd128Register(0));
-      break;
-    }
-    case kMipsI8x16GeS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ cle_s_b(i.OutputSimd128Register(), i.InputSimd128Register(1),
-                 i.InputSimd128Register(0));
-      break;
-    }
-    case kMipsI8x16ShrU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ srli_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputInt3(1));
-      break;
-    }
-    case kMipsI8x16AddSaturateU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ adds_u_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI8x16SubSaturateU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ subs_u_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI8x16MaxU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ max_u_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI8x16MinU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ min_u_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsI8x16GtU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ clt_u_b(i.OutputSimd128Register(), i.InputSimd128Register(1),
-                 i.InputSimd128Register(0));
-      break;
-    }
-    case kMipsI8x16GeU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ cle_u_b(i.OutputSimd128Register(), i.InputSimd128Register(1),
-                 i.InputSimd128Register(0));
-      break;
-    }
-    case kMipsS128And: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ and_v(i.OutputSimd128Register(), i.InputSimd128Register(0),
-               i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsS128Or: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ or_v(i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsS128Xor: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ xor_v(i.OutputSimd128Register(), i.InputSimd128Register(0),
-               i.InputSimd128Register(1));
-      break;
-    }
-    case kMipsS128Not: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ nor_v(i.OutputSimd128Register(), i.InputSimd128Register(0),
-               i.InputSimd128Register(0));
-      break;
-    }
-    case kMipsS1x4AnyTrue:
-    case kMipsS1x8AnyTrue:
-    case kMipsS1x16AnyTrue: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Register dst = i.OutputRegister();
-      Label all_false;
-
-      __ BranchMSA(&all_false, MSA_BRANCH_V, all_zero,
-                   i.InputSimd128Register(0), USE_DELAY_SLOT);
-      __ li(dst, 0);  // branch delay slot
-      __ li(dst, -1);
-      __ bind(&all_false);
-      break;
-    }
-    case kMipsS1x4AllTrue: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Register dst = i.OutputRegister();
-      Label all_true;
-      __ BranchMSA(&all_true, MSA_BRANCH_W, all_not_zero,
-                   i.InputSimd128Register(0), USE_DELAY_SLOT);
-      __ li(dst, -1);  // branch delay slot
-      __ li(dst, 0);
-      __ bind(&all_true);
-      break;
-    }
-    case kMipsS1x8AllTrue: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Register dst = i.OutputRegister();
-      Label all_true;
-      __ BranchMSA(&all_true, MSA_BRANCH_H, all_not_zero,
-                   i.InputSimd128Register(0), USE_DELAY_SLOT);
-      __ li(dst, -1);  // branch delay slot
-      __ li(dst, 0);
-      __ bind(&all_true);
-      break;
-    }
-    case kMipsS1x16AllTrue: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Register dst = i.OutputRegister();
-      Label all_true;
-      __ BranchMSA(&all_true, MSA_BRANCH_B, all_not_zero,
-                   i.InputSimd128Register(0), USE_DELAY_SLOT);
-      __ li(dst, -1);  // branch delay slot
-      __ li(dst, 0);
-      __ bind(&all_true);
-      break;
-    }
-    case kMipsMsaLd: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ ld_b(i.OutputSimd128Register(), i.MemoryOperand());
-      break;
-    }
-    case kMipsMsaSt: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ st_b(i.InputSimd128Register(2), i.MemoryOperand());
-      break;
-    }
-    case kMipsS32x4InterleaveRight: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [7, 6, 5, 4], src0 = [3, 2, 1, 0]
-      // dst = [5, 1, 4, 0]
-      __ ilvr_w(dst, src1, src0);
-      break;
-    }
-    case kMipsS32x4InterleaveLeft: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [7, 6, 5, 4], src0 = [3, 2, 1, 0]
-      // dst = [7, 3, 6, 2]
-      __ ilvl_w(dst, src1, src0);
-      break;
-    }
-    case kMipsS32x4PackEven: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [7, 6, 5, 4], src0 = [3, 2, 1, 0]
-      // dst = [6, 4, 2, 0]
-      __ pckev_w(dst, src1, src0);
-      break;
-    }
-    case kMipsS32x4PackOdd: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [7, 6, 5, 4], src0 = [3, 2, 1, 0]
-      // dst = [7, 5, 3, 1]
-      __ pckod_w(dst, src1, src0);
-      break;
-    }
-    case kMipsS32x4InterleaveEven: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [7, 6, 5, 4], src0 = [3, 2, 1, 0]
-      // dst = [6, 2, 4, 0]
-      __ ilvev_w(dst, src1, src0);
-      break;
-    }
-    case kMipsS32x4InterleaveOdd: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [7, 6, 5, 4], src0 = [3, 2, 1, 0]
-      // dst = [7, 3, 5, 1]
-      __ ilvod_w(dst, src1, src0);
-      break;
-    }
-    case kMipsS32x4Shuffle: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-
-      int32_t shuffle = i.InputInt32(2);
-
-      if (src0 == src1) {
-        // Unary S32x4 shuffles are handled with shf.w instruction
-        unsigned lane = shuffle & 0xFF;
-        if (FLAG_debug_code) {
-          // range of all four lanes, for unary instruction,
-          // should belong to the same range, which can be one of these:
-          // [0, 3] or [4, 7]
-          if (lane >= 4) {
-            int32_t shuffle_helper = shuffle;
-            for (int i = 0; i < 4; ++i) {
-              lane = shuffle_helper & 0xFF;
-              CHECK_GE(lane, 4);
-              shuffle_helper >>= 8;
-            }
-          }
-        }
-        uint32_t i8 = 0;
-        for (int i = 0; i < 4; i++) {
-          lane = shuffle & 0xFF;
-          if (lane >= 4) {
-            lane -= 4;
-          }
-          DCHECK_GT(4, lane);
-          i8 |= lane << (2 * i);
-          shuffle >>= 8;
-        }
-        __ shf_w(dst, src0, i8);
-      } else {
-        // For binary shuffles use vshf.w instruction
-        if (dst == src0) {
-          __ move_v(kSimd128ScratchReg, src0);
-          src0 = kSimd128ScratchReg;
-        } else if (dst == src1) {
-          __ move_v(kSimd128ScratchReg, src1);
-          src1 = kSimd128ScratchReg;
-        }
-
-        __ li(kScratchReg, i.InputInt32(2));
-        __ insert_w(dst, 0, kScratchReg);
-        __ xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
-        __ ilvr_b(dst, kSimd128RegZero, dst);
-        __ ilvr_h(dst, kSimd128RegZero, dst);
-        __ vshf_w(dst, src1, src0);
-      }
-      break;
-    }
-    case kMipsS16x8InterleaveRight: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [15, ... 11, 10, 9, 8], src0 = [7, ... 3, 2, 1, 0]
-      // dst = [11, 3, 10, 2, 9, 1, 8, 0]
-      __ ilvr_h(dst, src1, src0);
-      break;
-    }
-    case kMipsS16x8InterleaveLeft: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [15, ... 11, 10, 9, 8], src0 = [7, ... 3, 2, 1, 0]
-      // dst = [15, 7, 14, 6, 13, 5, 12, 4]
-      __ ilvl_h(dst, src1, src0);
-      break;
-    }
-    case kMipsS16x8PackEven: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [15, ... 11, 10, 9, 8], src0 = [7, ... 3, 2, 1, 0]
-      // dst = [14, 12, 10, 8, 6, 4, 2, 0]
-      __ pckev_h(dst, src1, src0);
-      break;
-    }
-    case kMipsS16x8PackOdd: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [15, ... 11, 10, 9, 8], src0 = [7, ... 3, 2, 1, 0]
-      // dst = [15, 13, 11, 9, 7, 5, 3, 1]
-      __ pckod_h(dst, src1, src0);
-      break;
-    }
-    case kMipsS16x8InterleaveEven: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [15, ... 11, 10, 9, 8], src0 = [7, ... 3, 2, 1, 0]
-      // dst = [14, 6, 12, 4, 10, 2, 8, 0]
-      __ ilvev_h(dst, src1, src0);
-      break;
-    }
-    case kMipsS16x8InterleaveOdd: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [15, ... 11, 10, 9, 8], src0 = [7, ... 3, 2, 1, 0]
-      // dst = [15, 7, ... 11, 3, 9, 1]
-      __ ilvod_h(dst, src1, src0);
-      break;
-    }
-    case kMipsS16x4Reverse: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      // src = [7, 6, 5, 4, 3, 2, 1, 0], dst = [4, 5, 6, 7, 0, 1, 2, 3]
-      // shf.df imm field: 0 1 2 3 = 00011011 = 0x1B
-      __ shf_h(i.OutputSimd128Register(), i.InputSimd128Register(0), 0x1B);
-      break;
-    }
-    case kMipsS16x2Reverse: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      // src = [7, 6, 5, 4, 3, 2, 1, 0], dst = [6, 7, 4, 5, 3, 2, 0, 1]
-      // shf.df imm field: 2 3 0 1 = 10110001 = 0xB1
-      __ shf_h(i.OutputSimd128Register(), i.InputSimd128Register(0), 0xB1);
-      break;
-    }
-    case kMipsS8x16InterleaveRight: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [31, ... 19, 18, 17, 16], src0 = [15, ... 3, 2, 1, 0]
-      // dst = [23, 7, ... 17, 1, 16, 0]
-      __ ilvr_b(dst, src1, src0);
-      break;
-    }
-    case kMipsS8x16InterleaveLeft: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [31, ... 19, 18, 17, 16], src0 = [15, ... 3, 2, 1, 0]
-      // dst = [31, 15, ... 25, 9, 24, 8]
-      __ ilvl_b(dst, src1, src0);
-      break;
-    }
-    case kMipsS8x16PackEven: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [31, ... 19, 18, 17, 16], src0 = [15, ... 3, 2, 1, 0]
-      // dst = [30, 28, ... 6, 4, 2, 0]
-      __ pckev_b(dst, src1, src0);
-      break;
-    }
-    case kMipsS8x16PackOdd: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [31, ... 19, 18, 17, 16], src0 = [15, ... 3, 2, 1, 0]
-      // dst = [31, 29, ... 7, 5, 3, 1]
-      __ pckod_b(dst, src1, src0);
-      break;
-    }
-    case kMipsS8x16InterleaveEven: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [31, ... 19, 18, 17, 16], src0 = [15, ... 3, 2, 1, 0]
-      // dst = [30, 14, ... 18, 2, 16, 0]
-      __ ilvev_b(dst, src1, src0);
-      break;
-    }
-    case kMipsS8x16InterleaveOdd: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [31, ... 19, 18, 17, 16], src0 = [15, ... 3, 2, 1, 0]
-      // dst = [31, 15, ... 19, 3, 17, 1]
-      __ ilvod_b(dst, src1, src0);
-      break;
-    }
-    case kMipsS8x16Concat: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register();
-      DCHECK(dst == i.InputSimd128Register(0));
-      __ sldi_b(dst, i.InputSimd128Register(1), i.InputInt4(2));
-      break;
-    }
-    case kMipsS8x16Shuffle: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-
-      if (dst == src0) {
-        __ move_v(kSimd128ScratchReg, src0);
-        src0 = kSimd128ScratchReg;
-      } else if (dst == src1) {
-        __ move_v(kSimd128ScratchReg, src1);
-        src1 = kSimd128ScratchReg;
-      }
-
-      __ li(kScratchReg, i.InputInt32(2));
-      __ insert_w(dst, 0, kScratchReg);
-      __ li(kScratchReg, i.InputInt32(3));
-      __ insert_w(dst, 1, kScratchReg);
-      __ li(kScratchReg, i.InputInt32(4));
-      __ insert_w(dst, 2, kScratchReg);
-      __ li(kScratchReg, i.InputInt32(5));
-      __ insert_w(dst, 3, kScratchReg);
-      __ vshf_b(dst, src1, src0);
-      break;
-    }
-    case kMipsS8x8Reverse: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      // src = [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
-      // dst = [8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7]
-      // [A B C D] => [B A D C]: shf.w imm: 2 3 0 1 = 10110001 = 0xB1
-      // C: [7, 6, 5, 4] => A': [4, 5, 6, 7]: shf.b imm: 00011011 = 0x1B
-      __ shf_w(kSimd128ScratchReg, i.InputSimd128Register(0), 0xB1);
-      __ shf_b(i.OutputSimd128Register(), kSimd128ScratchReg, 0x1B);
-      break;
-    }
-    case kMipsS8x4Reverse: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      // src = [15, 14, ... 3, 2, 1, 0], dst = [12, 13, 14, 15, ... 0, 1, 2, 3]
-      // shf.df imm field: 0 1 2 3 = 00011011 = 0x1B
-      __ shf_b(i.OutputSimd128Register(), i.InputSimd128Register(0), 0x1B);
-      break;
-    }
-    case kMipsS8x2Reverse: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      // src = [15, 14, ... 3, 2, 1, 0], dst = [14, 15, 12, 13, ... 2, 3, 0, 1]
-      // shf.df imm field: 2 3 0 1 = 10110001 = 0xB1
-      __ shf_b(i.OutputSimd128Register(), i.InputSimd128Register(0), 0xB1);
-      break;
-    }
-    case kMipsI32x4SConvertI16x8Low: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register();
-      Simd128Register src = i.InputSimd128Register(0);
-      __ ilvr_h(kSimd128ScratchReg, src, src);
-      __ slli_w(dst, kSimd128ScratchReg, 16);
-      __ srai_w(dst, dst, 16);
-      break;
-    }
-    case kMipsI32x4SConvertI16x8High: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register();
-      Simd128Register src = i.InputSimd128Register(0);
-      __ ilvl_h(kSimd128ScratchReg, src, src);
-      __ slli_w(dst, kSimd128ScratchReg, 16);
-      __ srai_w(dst, dst, 16);
-      break;
-    }
-    case kMipsI32x4UConvertI16x8Low: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
-      __ ilvr_h(i.OutputSimd128Register(), kSimd128RegZero,
-                i.InputSimd128Register(0));
-      break;
-    }
-    case kMipsI32x4UConvertI16x8High: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
-      __ ilvl_h(i.OutputSimd128Register(), kSimd128RegZero,
-                i.InputSimd128Register(0));
-      break;
-    }
-    case kMipsI16x8SConvertI8x16Low: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register();
-      Simd128Register src = i.InputSimd128Register(0);
-      __ ilvr_b(kSimd128ScratchReg, src, src);
-      __ slli_h(dst, kSimd128ScratchReg, 8);
-      __ srai_h(dst, dst, 8);
-      break;
-    }
-    case kMipsI16x8SConvertI8x16High: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register();
-      Simd128Register src = i.InputSimd128Register(0);
-      __ ilvl_b(kSimd128ScratchReg, src, src);
-      __ slli_h(dst, kSimd128ScratchReg, 8);
-      __ srai_h(dst, dst, 8);
-      break;
-    }
-    case kMipsI16x8SConvertI32x4: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register();
-      Simd128Register src0 = i.InputSimd128Register(0);
-      Simd128Register src1 = i.InputSimd128Register(1);
-      __ sat_s_w(kSimd128ScratchReg, src0, 15);
-      __ sat_s_w(kSimd128RegZero, src1, 15);  // kSimd128RegZero as scratch
-      __ pckev_h(dst, kSimd128RegZero, kSimd128ScratchReg);
-      break;
-    }
-    case kMipsI16x8UConvertI32x4: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register();
-      Simd128Register src0 = i.InputSimd128Register(0);
-      Simd128Register src1 = i.InputSimd128Register(1);
-      __ sat_u_w(kSimd128ScratchReg, src0, 15);
-      __ sat_u_w(kSimd128RegZero, src1, 15);  // kSimd128RegZero as scratch
-      __ pckev_h(dst, kSimd128RegZero, kSimd128ScratchReg);
-      break;
-    }
-    case kMipsI16x8UConvertI8x16Low: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
-      __ ilvr_b(i.OutputSimd128Register(), kSimd128RegZero,
-                i.InputSimd128Register(0));
-      break;
-    }
-    case kMipsI16x8UConvertI8x16High: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
-      __ ilvl_b(i.OutputSimd128Register(), kSimd128RegZero,
-                i.InputSimd128Register(0));
-      break;
-    }
-    case kMipsI8x16SConvertI16x8: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register();
-      Simd128Register src0 = i.InputSimd128Register(0);
-      Simd128Register src1 = i.InputSimd128Register(1);
-      __ sat_s_h(kSimd128ScratchReg, src0, 7);
-      __ sat_s_h(kSimd128RegZero, src1, 7);  // kSimd128RegZero as scratch
-      __ pckev_b(dst, kSimd128RegZero, kSimd128ScratchReg);
-      break;
-    }
-    case kMipsI8x16UConvertI16x8: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register();
-      Simd128Register src0 = i.InputSimd128Register(0);
-      Simd128Register src1 = i.InputSimd128Register(1);
-      __ sat_u_h(kSimd128ScratchReg, src0, 7);
-      __ sat_u_h(kSimd128RegZero, src1, 7);  // kSimd128RegZero as scratch
-      __ pckev_b(dst, kSimd128RegZero, kSimd128ScratchReg);
-      break;
-    }
-    case kMipsF32x4AddHoriz: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register src0 = i.InputSimd128Register(0);
-      Simd128Register src1 = i.InputSimd128Register(1);
-      Simd128Register dst = i.OutputSimd128Register();
-      __ shf_w(kSimd128ScratchReg, src0, 0xB1);  // 2 3 0 1 : 10110001 : 0xB1
-      __ shf_w(kSimd128RegZero, src1, 0xB1);     // kSimd128RegZero as scratch
-      __ fadd_w(kSimd128ScratchReg, kSimd128ScratchReg, src0);
-      __ fadd_w(kSimd128RegZero, kSimd128RegZero, src1);
-      __ pckev_w(dst, kSimd128RegZero, kSimd128ScratchReg);
-      break;
-    }
-    case kMipsI32x4AddHoriz: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register src0 = i.InputSimd128Register(0);
-      Simd128Register src1 = i.InputSimd128Register(1);
-      Simd128Register dst = i.OutputSimd128Register();
-      __ hadd_s_d(kSimd128ScratchReg, src0, src0);
-      __ hadd_s_d(kSimd128RegZero, src1, src1);  // kSimd128RegZero as scratch
-      __ pckev_w(dst, kSimd128RegZero, kSimd128ScratchReg);
-      break;
-    }
-    case kMipsI16x8AddHoriz: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register src0 = i.InputSimd128Register(0);
-      Simd128Register src1 = i.InputSimd128Register(1);
-      Simd128Register dst = i.OutputSimd128Register();
-      __ hadd_s_w(kSimd128ScratchReg, src0, src0);
-      __ hadd_s_w(kSimd128RegZero, src1, src1);  // kSimd128RegZero as scratch
-      __ pckev_h(dst, kSimd128RegZero, kSimd128ScratchReg);
-      break;
-    }
-  }
-  return kSuccess;
-}  // NOLINT(readability/fn_size)
-
-
-#define UNSUPPORTED_COND(opcode, condition)                                  \
-  OFStream out(stdout);                                                      \
-  out << "Unsupported " << #opcode << " condition: \"" << condition << "\""; \
-  UNIMPLEMENTED();
-
-static bool convertCondition(FlagsCondition condition, Condition& cc) {
-  switch (condition) {
-    case kEqual:
-      cc = eq;
-      return true;
-    case kNotEqual:
-      cc = ne;
-      return true;
-    case kUnsignedLessThan:
-      cc = lt;
-      return true;
-    case kUnsignedGreaterThanOrEqual:
-      cc = uge;
-      return true;
-    case kUnsignedLessThanOrEqual:
-      cc = le;
-      return true;
-    case kUnsignedGreaterThan:
-      cc = ugt;
-      return true;
-    default:
-      break;
-  }
-  return false;
-}
-
-void AssembleBranchToLabels(CodeGenerator* gen, TurboAssembler* tasm,
-                            Instruction* instr, FlagsCondition condition,
-                            Label* tlabel, Label* flabel, bool fallthru) {
-#undef __
-#define __ tasm->
-
-  Condition cc = kNoCondition;
-  // MIPS does not have condition code flags, so compare and branch are
-  // implemented differently than on the other arch's. The compare operations
-  // emit mips pseudo-instructions, which are handled here by branch
-  // instructions that do the actual comparison. Essential that the input
-  // registers to compare pseudo-op are not modified before this branch op, as
-  // they are tested here.
-
-  MipsOperandConverter i(gen, instr);
-  if (instr->arch_opcode() == kMipsTst) {
-    cc = FlagsConditionToConditionTst(condition);
-    __ And(at, i.InputRegister(0), i.InputOperand(1));
-    __ Branch(tlabel, cc, at, Operand(zero_reg));
-  } else if (instr->arch_opcode() == kMipsAddOvf) {
-    switch (condition) {
-      case kOverflow:
-        __ AddBranchOvf(i.OutputRegister(), i.InputRegister(0),
-                        i.InputOperand(1), tlabel, flabel);
-        break;
-      case kNotOverflow:
-        __ AddBranchOvf(i.OutputRegister(), i.InputRegister(0),
-                        i.InputOperand(1), flabel, tlabel);
-        break;
-      default:
-        UNSUPPORTED_COND(kMipsAddOvf, condition);
-        break;
-    }
-  } else if (instr->arch_opcode() == kMipsSubOvf) {
-    switch (condition) {
-      case kOverflow:
-        __ SubBranchOvf(i.OutputRegister(), i.InputRegister(0),
-                        i.InputOperand(1), tlabel, flabel);
-        break;
-      case kNotOverflow:
-        __ SubBranchOvf(i.OutputRegister(), i.InputRegister(0),
-                        i.InputOperand(1), flabel, tlabel);
-        break;
-      default:
-        UNSUPPORTED_COND(kMipsAddOvf, condition);
-        break;
-    }
-  } else if (instr->arch_opcode() == kMipsMulOvf) {
-    switch (condition) {
-      case kOverflow:
-        __ MulBranchOvf(i.OutputRegister(), i.InputRegister(0),
-                        i.InputOperand(1), tlabel, flabel);
-        break;
-      case kNotOverflow:
-        __ MulBranchOvf(i.OutputRegister(), i.InputRegister(0),
-                        i.InputOperand(1), flabel, tlabel);
-        break;
-      default:
-        UNSUPPORTED_COND(kMipsMulOvf, condition);
-        break;
-    }
-  } else if (instr->arch_opcode() == kMipsCmp) {
-    cc = FlagsConditionToConditionCmp(condition);
-    __ Branch(tlabel, cc, i.InputRegister(0), i.InputOperand(1));
-  } else if (instr->arch_opcode() == kMipsCmpS) {
-    if (!convertCondition(condition, cc)) {
-      UNSUPPORTED_COND(kMips64CmpS, condition);
-    }
-    FPURegister left = i.InputOrZeroSingleRegister(0);
-    FPURegister right = i.InputOrZeroSingleRegister(1);
-    if ((left == kDoubleRegZero || right == kDoubleRegZero) &&
-        !__ IsDoubleZeroRegSet()) {
-      __ Move(kDoubleRegZero, 0.0);
-    }
-    __ BranchF32(tlabel, nullptr, cc, left, right);
-  } else if (instr->arch_opcode() == kMipsCmpD) {
-    if (!convertCondition(condition, cc)) {
-      UNSUPPORTED_COND(kMips64CmpD, condition);
-    }
-    FPURegister left = i.InputOrZeroDoubleRegister(0);
-    FPURegister right = i.InputOrZeroDoubleRegister(1);
-    if ((left == kDoubleRegZero || right == kDoubleRegZero) &&
-        !__ IsDoubleZeroRegSet()) {
-      __ Move(kDoubleRegZero, 0.0);
-    }
-    __ BranchF64(tlabel, nullptr, cc, left, right);
-  } else {
-    PrintF("AssembleArchBranch Unimplemented arch_opcode: %d\n",
-           instr->arch_opcode());
-    UNIMPLEMENTED();
-  }
-  if (!fallthru) __ Branch(flabel);  // no fallthru to flabel.
-#undef __
-#define __ tasm()->
-}
-
-// Assembles branches after an instruction.
-void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) {
-  Label* tlabel = branch->true_label;
-  Label* flabel = branch->false_label;
-  AssembleBranchToLabels(this, tasm(), instr, branch->condition, tlabel, flabel,
-                         branch->fallthru);
-}
-
-void CodeGenerator::AssembleArchDeoptBranch(Instruction* instr,
-                                            BranchInfo* branch) {
-  AssembleArchBranch(instr, branch);
-}
-
-void CodeGenerator::AssembleArchJump(RpoNumber target) {
-  if (!IsNextInAssemblyOrder(target)) __ Branch(GetLabel(target));
-}
-
-void CodeGenerator::AssembleArchTrap(Instruction* instr,
-                                     FlagsCondition condition) {
-  class OutOfLineTrap final : public OutOfLineCode {
-   public:
-    OutOfLineTrap(CodeGenerator* gen, bool frame_elided, Instruction* instr)
-        : OutOfLineCode(gen),
-          frame_elided_(frame_elided),
-          instr_(instr),
-          gen_(gen) {}
-
-    void Generate() final {
-      MipsOperandConverter i(gen_, instr_);
-
-      Builtins::Name trap_id =
-          static_cast<Builtins::Name>(i.InputInt32(instr_->InputCount() - 1));
-      bool old_has_frame = __ has_frame();
-      if (frame_elided_) {
-        __ set_has_frame(true);
-        __ EnterFrame(StackFrame::WASM_COMPILED);
-      }
-      GenerateCallToTrap(trap_id);
-      if (frame_elided_) {
-        __ set_has_frame(old_has_frame);
-      }
-    }
-
-   private:
-    void GenerateCallToTrap(Builtins::Name trap_id) {
-      if (trap_id == Builtins::builtin_count) {
-        // We cannot test calls to the runtime in cctest/test-run-wasm.
-        // Therefore we emit a call to C here instead of a call to the runtime.
-        // We use the context register as the scratch register, because we do
-        // not have a context here.
-        __ PrepareCallCFunction(0, 0, cp);
-        __ CallCFunction(ExternalReference::wasm_call_trap_callback_for_testing(
-                             tasm()->isolate()),
-                         0);
-        __ LeaveFrame(StackFrame::WASM_COMPILED);
-        CallDescriptor* descriptor = gen_->linkage()->GetIncomingDescriptor();
-        int pop_count = static_cast<int>(descriptor->StackParameterCount());
-        __ Drop(pop_count);
-        __ Ret();
-      } else {
-        gen_->AssembleSourcePosition(instr_);
-        __ Call(tasm()->isolate()->builtins()->builtin_handle(trap_id),
-                RelocInfo::CODE_TARGET);
-        ReferenceMap* reference_map =
-            new (gen_->zone()) ReferenceMap(gen_->zone());
-        gen_->RecordSafepoint(reference_map, Safepoint::kSimple, 0,
-                              Safepoint::kNoLazyDeopt);
-        if (FLAG_debug_code) {
-          __ stop(GetAbortReason(AbortReason::kUnexpectedReturnFromWasmTrap));
-        }
-      }
-    }
-
-    bool frame_elided_;
-    Instruction* instr_;
-    CodeGenerator* gen_;
-  };
-  bool frame_elided = !frame_access_state()->has_frame();
-  auto ool = new (zone()) OutOfLineTrap(this, frame_elided, instr);
-  Label* tlabel = ool->entry();
-  AssembleBranchToLabels(this, tasm(), instr, condition, tlabel, nullptr, true);
-}
-
-// Assembles boolean materializations after an instruction.
-void CodeGenerator::AssembleArchBoolean(Instruction* instr,
-                                        FlagsCondition condition) {
-  MipsOperandConverter i(this, instr);
-  Label done;
-
-  // Materialize a full 32-bit 1 or 0 value. The result register is always the
-  // last output of the instruction.
-  Label false_value;
-  DCHECK_NE(0u, instr->OutputCount());
-  Register result = i.OutputRegister(instr->OutputCount() - 1);
-  Condition cc = kNoCondition;
-  // MIPS does not have condition code flags, so compare and branch are
-  // implemented differently than on the other arch's. The compare operations
-  // emit mips pseudo-instructions, which are checked and handled here.
-
-  if (instr->arch_opcode() == kMipsTst) {
-    cc = FlagsConditionToConditionTst(condition);
-    if (instr->InputAt(1)->IsImmediate() &&
-        base::bits::IsPowerOfTwo(i.InputOperand(1).immediate())) {
-      uint16_t pos =
-          base::bits::CountTrailingZeros32(i.InputOperand(1).immediate());
-      __ Ext(result, i.InputRegister(0), pos, 1);
-      if (cc == eq) {
-        __ xori(result, result, 1);
-      }
-    } else {
-      __ And(kScratchReg, i.InputRegister(0), i.InputOperand(1));
-      if (cc == eq) {
-        __ Sltu(result, kScratchReg, 1);
-      } else {
-        __ Sltu(result, zero_reg, kScratchReg);
-      }
-    }
-    return;
-  } else if (instr->arch_opcode() == kMipsAddOvf ||
-             instr->arch_opcode() == kMipsSubOvf ||
-             instr->arch_opcode() == kMipsMulOvf) {
-    Label flabel, tlabel;
-    switch (instr->arch_opcode()) {
-      case kMipsAddOvf:
-        __ AddBranchNoOvf(i.OutputRegister(), i.InputRegister(0),
-                          i.InputOperand(1), &flabel);
-
-        break;
-      case kMipsSubOvf:
-        __ SubBranchNoOvf(i.OutputRegister(), i.InputRegister(0),
-                          i.InputOperand(1), &flabel);
-        break;
-      case kMipsMulOvf:
-        __ MulBranchNoOvf(i.OutputRegister(), i.InputRegister(0),
-                          i.InputOperand(1), &flabel);
-        break;
-      default:
-        UNREACHABLE();
-        break;
-    }
-    __ li(result, 1);
-    __ Branch(&tlabel);
-    __ bind(&flabel);
-    __ li(result, 0);
-    __ bind(&tlabel);
-  } else if (instr->arch_opcode() == kMipsCmp) {
-    cc = FlagsConditionToConditionCmp(condition);
-    switch (cc) {
-      case eq:
-      case ne: {
-        Register left = i.InputRegister(0);
-        Operand right = i.InputOperand(1);
-        if (instr->InputAt(1)->IsImmediate()) {
-          if (is_int16(-right.immediate())) {
-            if (right.immediate() == 0) {
-              if (cc == eq) {
-                __ Sltu(result, left, 1);
-              } else {
-                __ Sltu(result, zero_reg, left);
-              }
-            } else {
-              __ Addu(result, left, -right.immediate());
-              if (cc == eq) {
-                __ Sltu(result, result, 1);
-              } else {
-                __ Sltu(result, zero_reg, result);
-              }
-            }
-          } else {
-            if (is_uint16(right.immediate())) {
-              __ Xor(result, left, right);
-            } else {
-              __ li(kScratchReg, right);
-              __ Xor(result, left, kScratchReg);
-            }
-            if (cc == eq) {
-              __ Sltu(result, result, 1);
-            } else {
-              __ Sltu(result, zero_reg, result);
-            }
-          }
-        } else {
-          __ Xor(result, left, right);
-          if (cc == eq) {
-            __ Sltu(result, result, 1);
-          } else {
-            __ Sltu(result, zero_reg, result);
-          }
-        }
-      } break;
-      case lt:
-      case ge: {
-        Register left = i.InputRegister(0);
-        Operand right = i.InputOperand(1);
-        __ Slt(result, left, right);
-        if (cc == ge) {
-          __ xori(result, result, 1);
-        }
-      } break;
-      case gt:
-      case le: {
-        Register left = i.InputRegister(1);
-        Operand right = i.InputOperand(0);
-        __ Slt(result, left, right);
-        if (cc == le) {
-          __ xori(result, result, 1);
-        }
-      } break;
-      case lo:
-      case hs: {
-        Register left = i.InputRegister(0);
-        Operand right = i.InputOperand(1);
-        __ Sltu(result, left, right);
-        if (cc == hs) {
-          __ xori(result, result, 1);
-        }
-      } break;
-      case hi:
-      case ls: {
-        Register left = i.InputRegister(1);
-        Operand right = i.InputOperand(0);
-        __ Sltu(result, left, right);
-        if (cc == ls) {
-          __ xori(result, result, 1);
-        }
-      } break;
-      default:
-        UNREACHABLE();
-    }
-    return;
-  } else if (instr->arch_opcode() == kMipsCmpD ||
-             instr->arch_opcode() == kMipsCmpS) {
-    FPURegister left = i.InputOrZeroDoubleRegister(0);
-    FPURegister right = i.InputOrZeroDoubleRegister(1);
-    if ((left == kDoubleRegZero || right == kDoubleRegZero) &&
-        !__ IsDoubleZeroRegSet()) {
-      __ Move(kDoubleRegZero, 0.0);
-    }
-    bool predicate;
-    FPUCondition cc = FlagsConditionToConditionCmpFPU(predicate, condition);
-    if (!IsMipsArchVariant(kMips32r6)) {
-      __ li(result, Operand(1));
-      if (instr->arch_opcode() == kMipsCmpD) {
-        __ c(cc, D, left, right);
-      } else {
-        DCHECK_EQ(kMipsCmpS, instr->arch_opcode());
-        __ c(cc, S, left, right);
-      }
-      if (predicate) {
-        __ Movf(result, zero_reg);
-      } else {
-        __ Movt(result, zero_reg);
-      }
-    } else {
-      if (instr->arch_opcode() == kMipsCmpD) {
-        __ cmp(cc, L, kDoubleCompareReg, left, right);
-      } else {
-        DCHECK_EQ(kMipsCmpS, instr->arch_opcode());
-        __ cmp(cc, W, kDoubleCompareReg, left, right);
-      }
-      __ mfc1(result, kDoubleCompareReg);
-      if (predicate) {
-        __ And(result, result, 1);  // cmp returns all 1's/0's, use only LSB.
-      } else {
-        __ Addu(result, result, 1);  // Toggle result for not equal.
-      }
-    }
-    return;
-  } else {
-    PrintF("AssembleArchBoolean Unimplemented arch_opcode is : %d\n",
-           instr->arch_opcode());
-    TRACE_UNIMPL();
-    UNIMPLEMENTED();
-  }
-}
-
-
-void CodeGenerator::AssembleArchLookupSwitch(Instruction* instr) {
-  MipsOperandConverter i(this, instr);
-  Register input = i.InputRegister(0);
-  for (size_t index = 2; index < instr->InputCount(); index += 2) {
-    __ li(at, Operand(i.InputInt32(index + 0)));
-    __ beq(input, at, GetLabel(i.InputRpo(index + 1)));
-  }
-  __ nop();  // Branch delay slot of the last beq.
-  AssembleArchJump(i.InputRpo(1));
-}
-
-
-void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) {
-  MipsOperandConverter i(this, instr);
-  Register input = i.InputRegister(0);
-  size_t const case_count = instr->InputCount() - 2;
-  __ Branch(GetLabel(i.InputRpo(1)), hs, input, Operand(case_count));
-  __ GenerateSwitchTable(input, case_count, [&i, this](size_t index) {
-    return GetLabel(i.InputRpo(index + 2));
-  });
-}
-
-void CodeGenerator::FinishFrame(Frame* frame) {
-  CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
-
-  const RegList saves_fpu = descriptor->CalleeSavedFPRegisters();
-  if (saves_fpu != 0) {
-    frame->AlignSavedCalleeRegisterSlots();
-  }
-
-  if (saves_fpu != 0) {
-    int count = base::bits::CountPopulation(saves_fpu);
-    DCHECK_EQ(kNumCalleeSavedFPU, count);
-    frame->AllocateSavedCalleeRegisterSlots(count *
-                                            (kDoubleSize / kPointerSize));
-  }
-
-  const RegList saves = descriptor->CalleeSavedRegisters();
-  if (saves != 0) {
-    int count = base::bits::CountPopulation(saves);
-    DCHECK_EQ(kNumCalleeSaved, count + 1);
-    frame->AllocateSavedCalleeRegisterSlots(count);
-  }
-}
-
-void CodeGenerator::AssembleConstructFrame() {
-  CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
-  if (frame_access_state()->has_frame()) {
-    if (descriptor->IsCFunctionCall()) {
-      __ Push(ra, fp);
-      __ mov(fp, sp);
-    } else if (descriptor->IsJSFunctionCall()) {
-      __ Prologue();
-      if (descriptor->PushArgumentCount()) {
-        __ Push(kJavaScriptCallArgCountRegister);
-      }
-    } else {
-      __ StubPrologue(info()->GetOutputStackFrameType());
-    }
-  }
-
-  int shrink_slots =
-      frame()->GetTotalFrameSlotCount() - descriptor->CalculateFixedFrameSize();
-
-  if (info()->is_osr()) {
-    // TurboFan OSR-compiled functions cannot be entered directly.
-    __ Abort(AbortReason::kShouldNotDirectlyEnterOsrFunction);
-
-    // Unoptimized code jumps directly to this entrypoint while the unoptimized
-    // frame is still on the stack. Optimized code uses OSR values directly from
-    // the unoptimized frame. Thus, all that needs to be done is to allocate the
-    // remaining stack slots.
-    if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --");
-    osr_pc_offset_ = __ pc_offset();
-    shrink_slots -= osr_helper()->UnoptimizedFrameSlots();
-  }
-
-  const RegList saves = descriptor->CalleeSavedRegisters();
-  const RegList saves_fpu = descriptor->CalleeSavedFPRegisters();
-  const int returns = frame()->GetReturnSlotCount();
-
-  // Skip callee-saved and return slots, which are pushed below.
-  shrink_slots -= base::bits::CountPopulation(saves);
-  shrink_slots -= 2 * base::bits::CountPopulation(saves_fpu);
-  shrink_slots -= returns;
-  if (shrink_slots > 0) {
-    __ Subu(sp, sp, Operand(shrink_slots * kPointerSize));
-  }
-
-  // Save callee-saved FPU registers.
-  if (saves_fpu != 0) {
-    __ MultiPushFPU(saves_fpu);
-  }
-
-  if (saves != 0) {
-    // Save callee-saved registers.
-    __ MultiPush(saves);
-    DCHECK_EQ(kNumCalleeSaved, base::bits::CountPopulation(saves) + 1);
-  }
-
-  if (returns != 0) {
-    // Create space for returns.
-    __ Subu(sp, sp, Operand(returns * kPointerSize));
-  }
-}
-
-void CodeGenerator::AssembleReturn(InstructionOperand* pop) {
-  CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
-  int pop_count = static_cast<int>(descriptor->StackParameterCount());
-
-  const int returns = frame()->GetReturnSlotCount();
-  if (returns != 0) {
-    __ Addu(sp, sp, Operand(returns * kPointerSize));
-  }
-
-  // Restore GP registers.
-  const RegList saves = descriptor->CalleeSavedRegisters();
-  if (saves != 0) {
-    __ MultiPop(saves);
-  }
-
-  // Restore FPU registers.
-  const RegList saves_fpu = descriptor->CalleeSavedFPRegisters();
-  if (saves_fpu != 0) {
-    __ MultiPopFPU(saves_fpu);
-  }
-
-  MipsOperandConverter g(this, nullptr);
-  if (descriptor->IsCFunctionCall()) {
-    AssembleDeconstructFrame();
-  } else if (frame_access_state()->has_frame()) {
-    // Canonicalize JSFunction return sites for now unless they have an variable
-    // number of stack slot pops.
-    if (pop->IsImmediate() && g.ToConstant(pop).ToInt32() == 0) {
-      if (return_label_.is_bound()) {
-        __ Branch(&return_label_);
-        return;
-      } else {
-        __ bind(&return_label_);
-        AssembleDeconstructFrame();
-      }
-    } else {
-      AssembleDeconstructFrame();
-    }
-  }
-  if (pop->IsImmediate()) {
-    DCHECK_EQ(Constant::kInt32, g.ToConstant(pop).type());
-    pop_count += g.ToConstant(pop).ToInt32();
-  } else {
-    Register pop_reg = g.ToRegister(pop);
-    __ sll(pop_reg, pop_reg, kPointerSizeLog2);
-    __ Addu(sp, sp, Operand(pop_reg));
-  }
-  if (pop_count != 0) {
-    __ DropAndRet(pop_count);
-  } else {
-    __ Ret();
-  }
-}
-
-void CodeGenerator::FinishCode() {}
-
-void CodeGenerator::AssembleMove(InstructionOperand* source,
-                                 InstructionOperand* destination) {
-  MipsOperandConverter g(this, nullptr);
-  // Dispatch on the source and destination operand kinds.  Not all
-  // combinations are possible.
-  if (source->IsRegister()) {
-    DCHECK(destination->IsRegister() || destination->IsStackSlot());
-    Register src = g.ToRegister(source);
-    if (destination->IsRegister()) {
-      __ mov(g.ToRegister(destination), src);
-    } else {
-      __ sw(src, g.ToMemOperand(destination));
-    }
-  } else if (source->IsStackSlot()) {
-    DCHECK(destination->IsRegister() || destination->IsStackSlot());
-    MemOperand src = g.ToMemOperand(source);
-    if (destination->IsRegister()) {
-      __ lw(g.ToRegister(destination), src);
-    } else {
-      Register temp = kScratchReg;
-      __ lw(temp, src);
-      __ sw(temp, g.ToMemOperand(destination));
-    }
-  } else if (source->IsConstant()) {
-    Constant src = g.ToConstant(source);
-    if (destination->IsRegister() || destination->IsStackSlot()) {
-      Register dst =
-          destination->IsRegister() ? g.ToRegister(destination) : kScratchReg;
-      switch (src.type()) {
-        case Constant::kInt32:
-          if (RelocInfo::IsWasmReference(src.rmode())) {
-            __ li(dst, Operand(src.ToInt32(), src.rmode()));
-          } else {
-            __ li(dst, Operand(src.ToInt32()));
-          }
-          break;
-        case Constant::kFloat32:
-          __ li(dst, Operand::EmbeddedNumber(src.ToFloat32()));
-          break;
-        case Constant::kInt64:
-          UNREACHABLE();
-          break;
-        case Constant::kFloat64:
-          __ li(dst, Operand::EmbeddedNumber(src.ToFloat64().value()));
-          break;
-        case Constant::kExternalReference:
-          __ li(dst, Operand(src.ToExternalReference()));
-          break;
-        case Constant::kHeapObject: {
-          Handle<HeapObject> src_object = src.ToHeapObject();
-          Heap::RootListIndex index;
-          if (IsMaterializableFromRoot(src_object, &index)) {
-            __ LoadRoot(dst, index);
-          } else {
-            __ li(dst, src_object);
-          }
-          break;
-        }
-        case Constant::kRpoNumber:
-          UNREACHABLE();  // TODO(titzer): loading RPO numbers on mips.
-          break;
-      }
-      if (destination->IsStackSlot()) __ sw(dst, g.ToMemOperand(destination));
-    } else if (src.type() == Constant::kFloat32) {
-      if (destination->IsFPStackSlot()) {
-        MemOperand dst = g.ToMemOperand(destination);
-        if (bit_cast<int32_t>(src.ToFloat32()) == 0) {
-          __ sw(zero_reg, dst);
-        } else {
-          __ li(at, Operand(bit_cast<int32_t>(src.ToFloat32())));
-          __ sw(at, dst);
-        }
-      } else {
-        DCHECK(destination->IsFPRegister());
-        FloatRegister dst = g.ToSingleRegister(destination);
-        __ Move(dst, src.ToFloat32());
-      }
-    } else {
-      DCHECK_EQ(Constant::kFloat64, src.type());
-      DoubleRegister dst = destination->IsFPRegister()
-                               ? g.ToDoubleRegister(destination)
-                               : kScratchDoubleReg;
-      __ Move(dst, src.ToFloat64().value());
-      if (destination->IsFPStackSlot()) {
-        __ Sdc1(dst, g.ToMemOperand(destination));
-      }
-    }
-  } else if (source->IsFPRegister()) {
-    FPURegister src = g.ToDoubleRegister(source);
-    if (destination->IsFPRegister()) {
-      FPURegister dst = g.ToDoubleRegister(destination);
-      __ Move(dst, src);
-    } else {
-      DCHECK(destination->IsFPStackSlot());
-      MachineRepresentation rep =
-          LocationOperand::cast(source)->representation();
-      if (rep == MachineRepresentation::kFloat64) {
-        __ Sdc1(src, g.ToMemOperand(destination));
-      } else if (rep == MachineRepresentation::kFloat32) {
-        __ swc1(src, g.ToMemOperand(destination));
-      } else {
-        DCHECK_EQ(MachineRepresentation::kSimd128, rep);
-        UNREACHABLE();
-      }
-    }
-  } else if (source->IsFPStackSlot()) {
-    DCHECK(destination->IsFPRegister() || destination->IsFPStackSlot());
-    MemOperand src = g.ToMemOperand(source);
-    MachineRepresentation rep = LocationOperand::cast(source)->representation();
-    if (destination->IsFPRegister()) {
-      if (rep == MachineRepresentation::kFloat64) {
-        __ Ldc1(g.ToDoubleRegister(destination), src);
-      } else if (rep == MachineRepresentation::kFloat32) {
-        __ lwc1(g.ToDoubleRegister(destination), src);
-      } else {
-        DCHECK_EQ(MachineRepresentation::kSimd128, rep);
-        UNREACHABLE();
-      }
-    } else {
-      FPURegister temp = kScratchDoubleReg;
-      if (rep == MachineRepresentation::kFloat64) {
-        __ Ldc1(temp, src);
-        __ Sdc1(temp, g.ToMemOperand(destination));
-      } else if (rep == MachineRepresentation::kFloat32) {
-        __ lwc1(temp, src);
-        __ swc1(temp, g.ToMemOperand(destination));
-      } else {
-        DCHECK_EQ(MachineRepresentation::kSimd128, rep);
-        UNREACHABLE();
-      }
-    }
-  } else {
-    UNREACHABLE();
-  }
-}
-
-
-void CodeGenerator::AssembleSwap(InstructionOperand* source,
-                                 InstructionOperand* destination) {
-  MipsOperandConverter g(this, nullptr);
-  // Dispatch on the source and destination operand kinds.  Not all
-  // combinations are possible.
-  if (source->IsRegister()) {
-    // Register-register.
-    Register temp = kScratchReg;
-    Register src = g.ToRegister(source);
-    if (destination->IsRegister()) {
-      Register dst = g.ToRegister(destination);
-      __ Move(temp, src);
-      __ Move(src, dst);
-      __ Move(dst, temp);
-    } else {
-      DCHECK(destination->IsStackSlot());
-      MemOperand dst = g.ToMemOperand(destination);
-      __ mov(temp, src);
-      __ lw(src, dst);
-      __ sw(temp, dst);
-    }
-  } else if (source->IsStackSlot()) {
-    DCHECK(destination->IsStackSlot());
-    Register temp_0 = kScratchReg;
-    Register temp_1 = kCompareReg;
-    MemOperand src = g.ToMemOperand(source);
-    MemOperand dst = g.ToMemOperand(destination);
-    __ lw(temp_0, src);
-    __ lw(temp_1, dst);
-    __ sw(temp_0, dst);
-    __ sw(temp_1, src);
-  } else if (source->IsFPRegister()) {
-    FPURegister temp = kScratchDoubleReg;
-    FPURegister src = g.ToDoubleRegister(source);
-    if (destination->IsFPRegister()) {
-      FPURegister dst = g.ToDoubleRegister(destination);
-      __ Move(temp, src);
-      __ Move(src, dst);
-      __ Move(dst, temp);
-    } else {
-      DCHECK(destination->IsFPStackSlot());
-      MemOperand dst = g.ToMemOperand(destination);
-      MachineRepresentation rep =
-          LocationOperand::cast(source)->representation();
-      if (rep == MachineRepresentation::kFloat64) {
-        __ Move(temp, src);
-        __ Ldc1(src, dst);
-        __ Sdc1(temp, dst);
-      } else if (rep == MachineRepresentation::kFloat32) {
-        __ Move(temp, src);
-        __ lwc1(src, dst);
-        __ swc1(temp, dst);
-      } else {
-        DCHECK_EQ(MachineRepresentation::kSimd128, rep);
-        UNREACHABLE();
-      }
-    }
-  } else if (source->IsFPStackSlot()) {
-    DCHECK(destination->IsFPStackSlot());
-    Register temp_0 = kScratchReg;
-    FPURegister temp_1 = kScratchDoubleReg;
-    MemOperand src0 = g.ToMemOperand(source);
-    MemOperand dst0 = g.ToMemOperand(destination);
-    MachineRepresentation rep = LocationOperand::cast(source)->representation();
-    if (rep == MachineRepresentation::kFloat64) {
-      MemOperand src1(src0.rm(), src0.offset() + kIntSize);
-      MemOperand dst1(dst0.rm(), dst0.offset() + kIntSize);
-      __ Ldc1(temp_1, dst0);  // Save destination in temp_1.
-      __ lw(temp_0, src0);    // Then use temp_0 to copy source to destination.
-      __ sw(temp_0, dst0);
-      __ lw(temp_0, src1);
-      __ sw(temp_0, dst1);
-      __ Sdc1(temp_1, src0);
-    } else if (rep == MachineRepresentation::kFloat32) {
-      __ lwc1(temp_1, dst0);  // Save destination in temp_1.
-      __ lw(temp_0, src0);    // Then use temp_0 to copy source to destination.
-      __ sw(temp_0, dst0);
-      __ swc1(temp_1, src0);
-    } else {
-      DCHECK_EQ(MachineRepresentation::kSimd128, rep);
-      UNREACHABLE();
-    }
-  } else {
-    // No other combinations are possible.
-    UNREACHABLE();
-  }
-}
-
-
-void CodeGenerator::AssembleJumpTable(Label** targets, size_t target_count) {
-  // On 32-bit MIPS we emit the jump tables inline.
-  UNREACHABLE();
-}
-
-#undef __
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/mips/instruction-codes-mips.h b/src/v8/src/compiler/mips/instruction-codes-mips.h
deleted file mode 100644
index dd789d0..0000000
--- a/src/v8/src/compiler/mips/instruction-codes-mips.h
+++ /dev/null
@@ -1,304 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_MIPS_INSTRUCTION_CODES_MIPS_H_
-#define V8_COMPILER_MIPS_INSTRUCTION_CODES_MIPS_H_
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-// MIPS-specific opcodes that specify which assembly sequence to emit.
-// Most opcodes specify a single instruction.
-#define TARGET_ARCH_OPCODE_LIST(V) \
-  V(MipsAdd)                       \
-  V(MipsAddOvf)                    \
-  V(MipsSub)                       \
-  V(MipsSubOvf)                    \
-  V(MipsMul)                       \
-  V(MipsMulOvf)                    \
-  V(MipsMulHigh)                   \
-  V(MipsMulHighU)                  \
-  V(MipsDiv)                       \
-  V(MipsDivU)                      \
-  V(MipsMod)                       \
-  V(MipsModU)                      \
-  V(MipsAnd)                       \
-  V(MipsOr)                        \
-  V(MipsNor)                       \
-  V(MipsXor)                       \
-  V(MipsClz)                       \
-  V(MipsCtz)                       \
-  V(MipsPopcnt)                    \
-  V(MipsLsa)                       \
-  V(MipsShl)                       \
-  V(MipsShr)                       \
-  V(MipsSar)                       \
-  V(MipsShlPair)                   \
-  V(MipsShrPair)                   \
-  V(MipsSarPair)                   \
-  V(MipsExt)                       \
-  V(MipsIns)                       \
-  V(MipsRor)                       \
-  V(MipsMov)                       \
-  V(MipsTst)                       \
-  V(MipsCmp)                       \
-  V(MipsCmpS)                      \
-  V(MipsAddS)                      \
-  V(MipsSubS)                      \
-  V(MipsMulS)                      \
-  V(MipsDivS)                      \
-  V(MipsModS)                      \
-  V(MipsAbsS)                      \
-  V(MipsSqrtS)                     \
-  V(MipsMaxS)                      \
-  V(MipsMinS)                      \
-  V(MipsCmpD)                      \
-  V(MipsAddD)                      \
-  V(MipsSubD)                      \
-  V(MipsMulD)                      \
-  V(MipsDivD)                      \
-  V(MipsModD)                      \
-  V(MipsAbsD)                      \
-  V(MipsSqrtD)                     \
-  V(MipsMaxD)                      \
-  V(MipsMinD)                      \
-  V(MipsNegS)                      \
-  V(MipsNegD)                      \
-  V(MipsAddPair)                   \
-  V(MipsSubPair)                   \
-  V(MipsMulPair)                   \
-  V(MipsMaddS)                     \
-  V(MipsMaddD)                     \
-  V(MipsMsubS)                     \
-  V(MipsMsubD)                     \
-  V(MipsFloat32RoundDown)          \
-  V(MipsFloat32RoundTruncate)      \
-  V(MipsFloat32RoundUp)            \
-  V(MipsFloat32RoundTiesEven)      \
-  V(MipsFloat64RoundDown)          \
-  V(MipsFloat64RoundTruncate)      \
-  V(MipsFloat64RoundUp)            \
-  V(MipsFloat64RoundTiesEven)      \
-  V(MipsCvtSD)                     \
-  V(MipsCvtDS)                     \
-  V(MipsTruncWD)                   \
-  V(MipsRoundWD)                   \
-  V(MipsFloorWD)                   \
-  V(MipsCeilWD)                    \
-  V(MipsTruncWS)                   \
-  V(MipsRoundWS)                   \
-  V(MipsFloorWS)                   \
-  V(MipsCeilWS)                    \
-  V(MipsTruncUwD)                  \
-  V(MipsTruncUwS)                  \
-  V(MipsCvtDW)                     \
-  V(MipsCvtDUw)                    \
-  V(MipsCvtSW)                     \
-  V(MipsCvtSUw)                    \
-  V(MipsLb)                        \
-  V(MipsLbu)                       \
-  V(MipsSb)                        \
-  V(MipsLh)                        \
-  V(MipsUlh)                       \
-  V(MipsLhu)                       \
-  V(MipsUlhu)                      \
-  V(MipsSh)                        \
-  V(MipsUsh)                       \
-  V(MipsLw)                        \
-  V(MipsUlw)                       \
-  V(MipsSw)                        \
-  V(MipsUsw)                       \
-  V(MipsLwc1)                      \
-  V(MipsUlwc1)                     \
-  V(MipsSwc1)                      \
-  V(MipsUswc1)                     \
-  V(MipsLdc1)                      \
-  V(MipsUldc1)                     \
-  V(MipsSdc1)                      \
-  V(MipsUsdc1)                     \
-  V(MipsFloat64ExtractLowWord32)   \
-  V(MipsFloat64ExtractHighWord32)  \
-  V(MipsFloat64InsertLowWord32)    \
-  V(MipsFloat64InsertHighWord32)   \
-  V(MipsFloat64SilenceNaN)         \
-  V(MipsFloat32Max)                \
-  V(MipsFloat64Max)                \
-  V(MipsFloat32Min)                \
-  V(MipsFloat64Min)                \
-  V(MipsPush)                      \
-  V(MipsPeek)                      \
-  V(MipsStoreToStackSlot)          \
-  V(MipsByteSwap32)                \
-  V(MipsStackClaim)                \
-  V(MipsSeb)                       \
-  V(MipsSeh)                       \
-  V(MipsS128Zero)                  \
-  V(MipsI32x4Splat)                \
-  V(MipsI32x4ExtractLane)          \
-  V(MipsI32x4ReplaceLane)          \
-  V(MipsI32x4Add)                  \
-  V(MipsI32x4AddHoriz)             \
-  V(MipsI32x4Sub)                  \
-  V(MipsF32x4Splat)                \
-  V(MipsF32x4ExtractLane)          \
-  V(MipsF32x4ReplaceLane)          \
-  V(MipsF32x4SConvertI32x4)        \
-  V(MipsF32x4UConvertI32x4)        \
-  V(MipsI32x4Mul)                  \
-  V(MipsI32x4MaxS)                 \
-  V(MipsI32x4MinS)                 \
-  V(MipsI32x4Eq)                   \
-  V(MipsI32x4Ne)                   \
-  V(MipsI32x4Shl)                  \
-  V(MipsI32x4ShrS)                 \
-  V(MipsI32x4ShrU)                 \
-  V(MipsI32x4MaxU)                 \
-  V(MipsI32x4MinU)                 \
-  V(MipsF32x4Abs)                  \
-  V(MipsF32x4Neg)                  \
-  V(MipsF32x4RecipApprox)          \
-  V(MipsF32x4RecipSqrtApprox)      \
-  V(MipsF32x4Add)                  \
-  V(MipsF32x4AddHoriz)             \
-  V(MipsF32x4Sub)                  \
-  V(MipsF32x4Mul)                  \
-  V(MipsF32x4Max)                  \
-  V(MipsF32x4Min)                  \
-  V(MipsF32x4Eq)                   \
-  V(MipsF32x4Ne)                   \
-  V(MipsF32x4Lt)                   \
-  V(MipsF32x4Le)                   \
-  V(MipsI32x4SConvertF32x4)        \
-  V(MipsI32x4UConvertF32x4)        \
-  V(MipsI32x4Neg)                  \
-  V(MipsI32x4GtS)                  \
-  V(MipsI32x4GeS)                  \
-  V(MipsI32x4GtU)                  \
-  V(MipsI32x4GeU)                  \
-  V(MipsI16x8Splat)                \
-  V(MipsI16x8ExtractLane)          \
-  V(MipsI16x8ReplaceLane)          \
-  V(MipsI16x8Neg)                  \
-  V(MipsI16x8Shl)                  \
-  V(MipsI16x8ShrS)                 \
-  V(MipsI16x8ShrU)                 \
-  V(MipsI16x8Add)                  \
-  V(MipsI16x8AddSaturateS)         \
-  V(MipsI16x8AddHoriz)             \
-  V(MipsI16x8Sub)                  \
-  V(MipsI16x8SubSaturateS)         \
-  V(MipsI16x8Mul)                  \
-  V(MipsI16x8MaxS)                 \
-  V(MipsI16x8MinS)                 \
-  V(MipsI16x8Eq)                   \
-  V(MipsI16x8Ne)                   \
-  V(MipsI16x8GtS)                  \
-  V(MipsI16x8GeS)                  \
-  V(MipsI16x8AddSaturateU)         \
-  V(MipsI16x8SubSaturateU)         \
-  V(MipsI16x8MaxU)                 \
-  V(MipsI16x8MinU)                 \
-  V(MipsI16x8GtU)                  \
-  V(MipsI16x8GeU)                  \
-  V(MipsI8x16Splat)                \
-  V(MipsI8x16ExtractLane)          \
-  V(MipsI8x16ReplaceLane)          \
-  V(MipsI8x16Neg)                  \
-  V(MipsI8x16Shl)                  \
-  V(MipsI8x16ShrS)                 \
-  V(MipsI8x16Add)                  \
-  V(MipsI8x16AddSaturateS)         \
-  V(MipsI8x16Sub)                  \
-  V(MipsI8x16SubSaturateS)         \
-  V(MipsI8x16Mul)                  \
-  V(MipsI8x16MaxS)                 \
-  V(MipsI8x16MinS)                 \
-  V(MipsI8x16Eq)                   \
-  V(MipsI8x16Ne)                   \
-  V(MipsI8x16GtS)                  \
-  V(MipsI8x16GeS)                  \
-  V(MipsI8x16ShrU)                 \
-  V(MipsI8x16AddSaturateU)         \
-  V(MipsI8x16SubSaturateU)         \
-  V(MipsI8x16MaxU)                 \
-  V(MipsI8x16MinU)                 \
-  V(MipsI8x16GtU)                  \
-  V(MipsI8x16GeU)                  \
-  V(MipsS128And)                   \
-  V(MipsS128Or)                    \
-  V(MipsS128Xor)                   \
-  V(MipsS128Not)                   \
-  V(MipsS128Select)                \
-  V(MipsS1x4AnyTrue)               \
-  V(MipsS1x4AllTrue)               \
-  V(MipsS1x8AnyTrue)               \
-  V(MipsS1x8AllTrue)               \
-  V(MipsS1x16AnyTrue)              \
-  V(MipsS1x16AllTrue)              \
-  V(MipsS32x4InterleaveRight)      \
-  V(MipsS32x4InterleaveLeft)       \
-  V(MipsS32x4PackEven)             \
-  V(MipsS32x4PackOdd)              \
-  V(MipsS32x4InterleaveEven)       \
-  V(MipsS32x4InterleaveOdd)        \
-  V(MipsS32x4Shuffle)              \
-  V(MipsS16x8InterleaveRight)      \
-  V(MipsS16x8InterleaveLeft)       \
-  V(MipsS16x8PackEven)             \
-  V(MipsS16x8PackOdd)              \
-  V(MipsS16x8InterleaveEven)       \
-  V(MipsS16x8InterleaveOdd)        \
-  V(MipsS16x4Reverse)              \
-  V(MipsS16x2Reverse)              \
-  V(MipsS8x16InterleaveRight)      \
-  V(MipsS8x16InterleaveLeft)       \
-  V(MipsS8x16PackEven)             \
-  V(MipsS8x16PackOdd)              \
-  V(MipsS8x16InterleaveEven)       \
-  V(MipsS8x16InterleaveOdd)        \
-  V(MipsS8x16Shuffle)              \
-  V(MipsS8x16Concat)               \
-  V(MipsS8x8Reverse)               \
-  V(MipsS8x4Reverse)               \
-  V(MipsS8x2Reverse)               \
-  V(MipsMsaLd)                     \
-  V(MipsMsaSt)                     \
-  V(MipsI32x4SConvertI16x8Low)     \
-  V(MipsI32x4SConvertI16x8High)    \
-  V(MipsI32x4UConvertI16x8Low)     \
-  V(MipsI32x4UConvertI16x8High)    \
-  V(MipsI16x8SConvertI8x16Low)     \
-  V(MipsI16x8SConvertI8x16High)    \
-  V(MipsI16x8SConvertI32x4)        \
-  V(MipsI16x8UConvertI32x4)        \
-  V(MipsI16x8UConvertI8x16Low)     \
-  V(MipsI16x8UConvertI8x16High)    \
-  V(MipsI8x16SConvertI16x8)        \
-  V(MipsI8x16UConvertI16x8)
-
-// Addressing modes represent the "shape" of inputs to an instruction.
-// Many instructions support multiple addressing modes. Addressing modes
-// are encoded into the InstructionCode of the instruction and tell the
-// code generator after register allocation which assembler method to call.
-//
-// We use the following local notation for addressing modes:
-//
-// R = register
-// O = register or stack slot
-// D = double register
-// I = immediate (handle, external, int32)
-// MRI = [register + immediate]
-// MRR = [register + register]
-// TODO(plind): Add the new r6 address modes.
-#define TARGET_ADDRESSING_MODE_LIST(V) \
-  V(MRI) /* [%r0 + K] */               \
-  V(MRR) /* [%r0 + %r1] */
-
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_COMPILER_MIPS_INSTRUCTION_CODES_MIPS_H_
diff --git a/src/v8/src/compiler/mips/instruction-scheduler-mips.cc b/src/v8/src/compiler/mips/instruction-scheduler-mips.cc
deleted file mode 100644
index af86a87..0000000
--- a/src/v8/src/compiler/mips/instruction-scheduler-mips.cc
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2015 the V8 project 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 "src/compiler/instruction-scheduler.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-bool InstructionScheduler::SchedulerSupported() { return false; }
-
-
-int InstructionScheduler::GetTargetInstructionFlags(
-    const Instruction* instr) const {
-  UNIMPLEMENTED();
-}
-
-
-int InstructionScheduler::GetInstructionLatency(const Instruction* instr) {
-  UNIMPLEMENTED();
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/mips/instruction-selector-mips.cc b/src/v8/src/compiler/mips/instruction-selector-mips.cc
deleted file mode 100644
index 35b8a23..0000000
--- a/src/v8/src/compiler/mips/instruction-selector-mips.cc
+++ /dev/null
@@ -1,2315 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/base/adapters.h"
-#include "src/base/bits.h"
-#include "src/compiler/instruction-selector-impl.h"
-#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-#define TRACE_UNIMPL() \
-  PrintF("UNIMPLEMENTED instr_sel: %s at line %d\n", __FUNCTION__, __LINE__)
-
-#define TRACE() PrintF("instr_sel: %s at line %d\n", __FUNCTION__, __LINE__)
-
-
-// Adds Mips-specific methods for generating InstructionOperands.
-class MipsOperandGenerator final : public OperandGenerator {
- public:
-  explicit MipsOperandGenerator(InstructionSelector* selector)
-      : OperandGenerator(selector) {}
-
-  InstructionOperand UseOperand(Node* node, InstructionCode opcode) {
-    if (CanBeImmediate(node, opcode)) {
-      return UseImmediate(node);
-    }
-    return UseRegister(node);
-  }
-
-  // Use the zero register if the node has the immediate value zero, otherwise
-  // assign a register.
-  InstructionOperand UseRegisterOrImmediateZero(Node* node) {
-    if ((IsIntegerConstant(node) && (GetIntegerConstantValue(node) == 0)) ||
-        (IsFloatConstant(node) &&
-         (bit_cast<int64_t>(GetFloatConstantValue(node)) == 0))) {
-      return UseImmediate(node);
-    }
-    return UseRegister(node);
-  }
-
-  bool IsIntegerConstant(Node* node) {
-    return (node->opcode() == IrOpcode::kInt32Constant);
-  }
-
-  int64_t GetIntegerConstantValue(Node* node) {
-    DCHECK_EQ(IrOpcode::kInt32Constant, node->opcode());
-    return OpParameter<int32_t>(node);
-  }
-
-  bool IsFloatConstant(Node* node) {
-    return (node->opcode() == IrOpcode::kFloat32Constant) ||
-           (node->opcode() == IrOpcode::kFloat64Constant);
-  }
-
-  double GetFloatConstantValue(Node* node) {
-    if (node->opcode() == IrOpcode::kFloat32Constant) {
-      return OpParameter<float>(node);
-    }
-    DCHECK_EQ(IrOpcode::kFloat64Constant, node->opcode());
-    return OpParameter<double>(node);
-  }
-
-  bool CanBeImmediate(Node* node, InstructionCode opcode) {
-    Int32Matcher m(node);
-    if (!m.HasValue()) return false;
-    int32_t value = m.Value();
-    switch (ArchOpcodeField::decode(opcode)) {
-      case kMipsShl:
-      case kMipsSar:
-      case kMipsShr:
-        return is_uint5(value);
-      case kMipsAdd:
-      case kMipsAnd:
-      case kMipsOr:
-      case kMipsTst:
-      case kMipsSub:
-      case kMipsXor:
-        return is_uint16(value);
-      case kMipsLb:
-      case kMipsLbu:
-      case kMipsSb:
-      case kMipsLh:
-      case kMipsLhu:
-      case kMipsSh:
-      case kMipsLw:
-      case kMipsSw:
-      case kMipsLwc1:
-      case kMipsSwc1:
-      case kMipsLdc1:
-      case kMipsSdc1:
-        // true even for 32b values, offsets > 16b
-        // are handled in assembler-mips.cc
-        return is_int32(value);
-      default:
-        return is_int16(value);
-    }
-  }
-
- private:
-  bool ImmediateFitsAddrMode1Instruction(int32_t imm) const {
-    TRACE_UNIMPL();
-    return false;
-  }
-};
-
-
-static void VisitRRR(InstructionSelector* selector, ArchOpcode opcode,
-                     Node* node) {
-  MipsOperandGenerator g(selector);
-  selector->Emit(opcode, g.DefineAsRegister(node),
-                 g.UseRegister(node->InputAt(0)),
-                 g.UseRegister(node->InputAt(1)));
-}
-
-void VisitRRRR(InstructionSelector* selector, ArchOpcode opcode, Node* node) {
-  MipsOperandGenerator g(selector);
-  selector->Emit(
-      opcode, g.DefineSameAsFirst(node), g.UseRegister(node->InputAt(0)),
-      g.UseRegister(node->InputAt(1)), g.UseRegister(node->InputAt(2)));
-}
-
-static void VisitRR(InstructionSelector* selector, ArchOpcode opcode,
-                    Node* node) {
-  MipsOperandGenerator g(selector);
-  selector->Emit(opcode, g.DefineAsRegister(node),
-                 g.UseRegister(node->InputAt(0)));
-}
-
-static void VisitRRI(InstructionSelector* selector, ArchOpcode opcode,
-                     Node* node) {
-  MipsOperandGenerator g(selector);
-  int32_t imm = OpParameter<int32_t>(node);
-  selector->Emit(opcode, g.DefineAsRegister(node),
-                 g.UseRegister(node->InputAt(0)), g.UseImmediate(imm));
-}
-
-static void VisitRRIR(InstructionSelector* selector, ArchOpcode opcode,
-                      Node* node) {
-  MipsOperandGenerator g(selector);
-  int32_t imm = OpParameter<int32_t>(node);
-  selector->Emit(opcode, g.DefineAsRegister(node),
-                 g.UseRegister(node->InputAt(0)), g.UseImmediate(imm),
-                 g.UseRegister(node->InputAt(1)));
-}
-
-static void VisitRRO(InstructionSelector* selector, ArchOpcode opcode,
-                     Node* node) {
-  MipsOperandGenerator g(selector);
-  selector->Emit(opcode, g.DefineAsRegister(node),
-                 g.UseRegister(node->InputAt(0)),
-                 g.UseOperand(node->InputAt(1), opcode));
-}
-
-bool TryMatchImmediate(InstructionSelector* selector,
-                       InstructionCode* opcode_return, Node* node,
-                       size_t* input_count_return, InstructionOperand* inputs) {
-  MipsOperandGenerator g(selector);
-  if (g.CanBeImmediate(node, *opcode_return)) {
-    *opcode_return |= AddressingModeField::encode(kMode_MRI);
-    inputs[0] = g.UseImmediate(node);
-    *input_count_return = 1;
-    return true;
-  }
-  return false;
-}
-
-static void VisitBinop(InstructionSelector* selector, Node* node,
-                       InstructionCode opcode, bool has_reverse_opcode,
-                       InstructionCode reverse_opcode,
-                       FlagsContinuation* cont) {
-  MipsOperandGenerator g(selector);
-  Int32BinopMatcher m(node);
-  InstructionOperand inputs[4];
-  size_t input_count = 0;
-  InstructionOperand outputs[2];
-  size_t output_count = 0;
-
-  if (TryMatchImmediate(selector, &opcode, m.right().node(), &input_count,
-                        &inputs[1])) {
-    inputs[0] = g.UseRegister(m.left().node());
-    input_count++;
-  } else if (has_reverse_opcode &&
-             TryMatchImmediate(selector, &reverse_opcode, m.left().node(),
-                               &input_count, &inputs[1])) {
-    inputs[0] = g.UseRegister(m.right().node());
-    opcode = reverse_opcode;
-    input_count++;
-  } else {
-    inputs[input_count++] = g.UseRegister(m.left().node());
-    inputs[input_count++] = g.UseOperand(m.right().node(), opcode);
-  }
-
-  if (cont->IsBranch()) {
-    inputs[input_count++] = g.Label(cont->true_block());
-    inputs[input_count++] = g.Label(cont->false_block());
-  } else if (cont->IsTrap()) {
-    inputs[input_count++] = g.TempImmediate(cont->trap_id());
-  }
-
-  if (cont->IsDeoptimize()) {
-    // If we can deoptimize as a result of the binop, we need to make sure that
-    // the deopt inputs are not overwritten by the binop result. One way
-    // to achieve that is to declare the output register as same-as-first.
-    outputs[output_count++] = g.DefineSameAsFirst(node);
-  } else {
-    outputs[output_count++] = g.DefineAsRegister(node);
-  }
-  if (cont->IsSet()) {
-    outputs[output_count++] = g.DefineAsRegister(cont->result());
-  }
-
-  DCHECK_NE(0u, input_count);
-  DCHECK_NE(0u, output_count);
-  DCHECK_GE(arraysize(inputs), input_count);
-  DCHECK_GE(arraysize(outputs), output_count);
-
-  opcode = cont->Encode(opcode);
-  if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(opcode, output_count, outputs, input_count, inputs,
-                             cont->kind(), cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else {
-    selector->Emit(opcode, output_count, outputs, input_count, inputs);
-  }
-}
-
-static void VisitBinop(InstructionSelector* selector, Node* node,
-                       InstructionCode opcode, bool has_reverse_opcode,
-                       InstructionCode reverse_opcode) {
-  FlagsContinuation cont;
-  VisitBinop(selector, node, opcode, has_reverse_opcode, reverse_opcode, &cont);
-}
-
-static void VisitBinop(InstructionSelector* selector, Node* node,
-                       InstructionCode opcode, FlagsContinuation* cont) {
-  VisitBinop(selector, node, opcode, false, kArchNop, cont);
-}
-
-static void VisitBinop(InstructionSelector* selector, Node* node,
-                       InstructionCode opcode) {
-  VisitBinop(selector, node, opcode, false, kArchNop);
-}
-
-void InstructionSelector::VisitStackSlot(Node* node) {
-  StackSlotRepresentation rep = StackSlotRepresentationOf(node->op());
-  int alignment = rep.alignment();
-  int slot = frame_->AllocateSpillSlot(rep.size(), alignment);
-  OperandGenerator g(this);
-
-  Emit(kArchStackSlot, g.DefineAsRegister(node),
-       sequence()->AddImmediate(Constant(slot)),
-       sequence()->AddImmediate(Constant(alignment)), 0, nullptr);
-}
-
-void InstructionSelector::VisitDebugAbort(Node* node) {
-  MipsOperandGenerator g(this);
-  Emit(kArchDebugAbort, g.NoOutput(), g.UseFixed(node->InputAt(0), a0));
-}
-
-void InstructionSelector::VisitLoad(Node* node) {
-  LoadRepresentation load_rep = LoadRepresentationOf(node->op());
-  MipsOperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-
-  ArchOpcode opcode = kArchNop;
-  switch (load_rep.representation()) {
-    case MachineRepresentation::kFloat32:
-      opcode = kMipsLwc1;
-      break;
-    case MachineRepresentation::kFloat64:
-      opcode = kMipsLdc1;
-      break;
-    case MachineRepresentation::kBit:  // Fall through.
-    case MachineRepresentation::kWord8:
-      opcode = load_rep.IsUnsigned() ? kMipsLbu : kMipsLb;
-      break;
-    case MachineRepresentation::kWord16:
-      opcode = load_rep.IsUnsigned() ? kMipsLhu : kMipsLh;
-      break;
-    case MachineRepresentation::kTaggedSigned:   // Fall through.
-    case MachineRepresentation::kTaggedPointer:  // Fall through.
-    case MachineRepresentation::kTagged:  // Fall through.
-    case MachineRepresentation::kWord32:
-      opcode = kMipsLw;
-      break;
-    case MachineRepresentation::kSimd128:
-      opcode = kMipsMsaLd;
-      break;
-    case MachineRepresentation::kWord64:   // Fall through.
-    case MachineRepresentation::kNone:
-      UNREACHABLE();
-      return;
-  }
-
-  if (g.CanBeImmediate(index, opcode)) {
-    Emit(opcode | AddressingModeField::encode(kMode_MRI),
-         g.DefineAsRegister(node), g.UseRegister(base), g.UseImmediate(index));
-  } else {
-    InstructionOperand addr_reg = g.TempRegister();
-    Emit(kMipsAdd | AddressingModeField::encode(kMode_None), addr_reg,
-         g.UseRegister(index), g.UseRegister(base));
-    // Emit desired load opcode, using temp addr_reg.
-    Emit(opcode | AddressingModeField::encode(kMode_MRI),
-         g.DefineAsRegister(node), addr_reg, g.TempImmediate(0));
-  }
-}
-
-void InstructionSelector::VisitProtectedLoad(Node* node) {
-  // TODO(eholk)
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitStore(Node* node) {
-  MipsOperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-
-  StoreRepresentation store_rep = StoreRepresentationOf(node->op());
-  WriteBarrierKind write_barrier_kind = store_rep.write_barrier_kind();
-  MachineRepresentation rep = store_rep.representation();
-
-  // TODO(mips): I guess this could be done in a better way.
-  if (write_barrier_kind != kNoWriteBarrier) {
-    DCHECK(CanBeTaggedPointer(rep));
-    InstructionOperand inputs[3];
-    size_t input_count = 0;
-    inputs[input_count++] = g.UseUniqueRegister(base);
-    inputs[input_count++] = g.UseUniqueRegister(index);
-    inputs[input_count++] = g.UseUniqueRegister(value);
-    RecordWriteMode record_write_mode = RecordWriteMode::kValueIsAny;
-    switch (write_barrier_kind) {
-      case kNoWriteBarrier:
-        UNREACHABLE();
-        break;
-      case kMapWriteBarrier:
-        record_write_mode = RecordWriteMode::kValueIsMap;
-        break;
-      case kPointerWriteBarrier:
-        record_write_mode = RecordWriteMode::kValueIsPointer;
-        break;
-      case kFullWriteBarrier:
-        record_write_mode = RecordWriteMode::kValueIsAny;
-        break;
-    }
-    InstructionOperand temps[] = {g.TempRegister(), g.TempRegister()};
-    size_t const temp_count = arraysize(temps);
-    InstructionCode code = kArchStoreWithWriteBarrier;
-    code |= MiscField::encode(static_cast<int>(record_write_mode));
-    Emit(code, 0, nullptr, input_count, inputs, temp_count, temps);
-  } else {
-    ArchOpcode opcode = kArchNop;
-    switch (rep) {
-      case MachineRepresentation::kFloat32:
-        opcode = kMipsSwc1;
-        break;
-      case MachineRepresentation::kFloat64:
-        opcode = kMipsSdc1;
-        break;
-      case MachineRepresentation::kBit:  // Fall through.
-      case MachineRepresentation::kWord8:
-        opcode = kMipsSb;
-        break;
-      case MachineRepresentation::kWord16:
-        opcode = kMipsSh;
-        break;
-      case MachineRepresentation::kTaggedSigned:   // Fall through.
-      case MachineRepresentation::kTaggedPointer:  // Fall through.
-      case MachineRepresentation::kTagged:  // Fall through.
-      case MachineRepresentation::kWord32:
-        opcode = kMipsSw;
-        break;
-      case MachineRepresentation::kSimd128:
-        opcode = kMipsMsaSt;
-        break;
-      case MachineRepresentation::kWord64:   // Fall through.
-      case MachineRepresentation::kNone:
-        UNREACHABLE();
-        return;
-    }
-
-    if (g.CanBeImmediate(index, opcode)) {
-      Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(),
-           g.UseRegister(base), g.UseImmediate(index),
-           g.UseRegisterOrImmediateZero(value));
-    } else {
-      InstructionOperand addr_reg = g.TempRegister();
-      Emit(kMipsAdd | AddressingModeField::encode(kMode_None), addr_reg,
-           g.UseRegister(index), g.UseRegister(base));
-      // Emit desired store opcode, using temp addr_reg.
-      Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(),
-           addr_reg, g.TempImmediate(0), g.UseRegisterOrImmediateZero(value));
-    }
-  }
-}
-
-void InstructionSelector::VisitProtectedStore(Node* node) {
-  // TODO(eholk)
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitWord32And(Node* node) {
-  MipsOperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  if (m.left().IsWord32Shr() && CanCover(node, m.left().node()) &&
-      m.right().HasValue()) {
-    uint32_t mask = m.right().Value();
-    uint32_t mask_width = base::bits::CountPopulation(mask);
-    uint32_t mask_msb = base::bits::CountLeadingZeros32(mask);
-    if ((mask_width != 0) && (mask_msb + mask_width == 32)) {
-      // The mask must be contiguous, and occupy the least-significant bits.
-      DCHECK_EQ(0u, base::bits::CountTrailingZeros32(mask));
-
-      // Select Ext for And(Shr(x, imm), mask) where the mask is in the least
-      // significant bits.
-      Int32BinopMatcher mleft(m.left().node());
-      if (mleft.right().HasValue()) {
-        // Any shift value can match; int32 shifts use `value % 32`.
-        uint32_t lsb = mleft.right().Value() & 0x1F;
-
-        // Ext cannot extract bits past the register size, however since
-        // shifting the original value would have introduced some zeros we can
-        // still use Ext with a smaller mask and the remaining bits will be
-        // zeros.
-        if (lsb + mask_width > 32) mask_width = 32 - lsb;
-
-        if (lsb == 0 && mask_width == 32) {
-          Emit(kArchNop, g.DefineSameAsFirst(node), g.Use(mleft.left().node()));
-        } else {
-          Emit(kMipsExt, g.DefineAsRegister(node),
-               g.UseRegister(mleft.left().node()), g.TempImmediate(lsb),
-               g.TempImmediate(mask_width));
-        }
-        return;
-      }
-      // Other cases fall through to the normal And operation.
-    }
-  }
-  if (m.right().HasValue()) {
-    uint32_t mask = m.right().Value();
-    uint32_t shift = base::bits::CountPopulation(~mask);
-    uint32_t msb = base::bits::CountLeadingZeros32(~mask);
-    if (shift != 0 && shift != 32 && msb + shift == 32) {
-      // Insert zeros for (x >> K) << K => x & ~(2^K - 1) expression reduction
-      // and remove constant loading of invereted mask.
-      Emit(kMipsIns, g.DefineSameAsFirst(node), g.UseRegister(m.left().node()),
-           g.TempImmediate(0), g.TempImmediate(shift));
-      return;
-    }
-  }
-  VisitBinop(this, node, kMipsAnd, true, kMipsAnd);
-}
-
-
-void InstructionSelector::VisitWord32Or(Node* node) {
-  VisitBinop(this, node, kMipsOr, true, kMipsOr);
-}
-
-
-void InstructionSelector::VisitWord32Xor(Node* node) {
-  Int32BinopMatcher m(node);
-  if (m.left().IsWord32Or() && CanCover(node, m.left().node()) &&
-      m.right().Is(-1)) {
-    Int32BinopMatcher mleft(m.left().node());
-    if (!mleft.right().HasValue()) {
-      MipsOperandGenerator g(this);
-      Emit(kMipsNor, g.DefineAsRegister(node),
-           g.UseRegister(mleft.left().node()),
-           g.UseRegister(mleft.right().node()));
-      return;
-    }
-  }
-  if (m.right().Is(-1)) {
-    // Use Nor for bit negation and eliminate constant loading for xori.
-    MipsOperandGenerator g(this);
-    Emit(kMipsNor, g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-         g.TempImmediate(0));
-    return;
-  }
-  VisitBinop(this, node, kMipsXor, true, kMipsXor);
-}
-
-
-void InstructionSelector::VisitWord32Shl(Node* node) {
-  Int32BinopMatcher m(node);
-  if (m.left().IsWord32And() && CanCover(node, m.left().node()) &&
-      m.right().IsInRange(1, 31)) {
-    MipsOperandGenerator g(this);
-    Int32BinopMatcher mleft(m.left().node());
-    // Match Word32Shl(Word32And(x, mask), imm) to Shl where the mask is
-    // contiguous, and the shift immediate non-zero.
-    if (mleft.right().HasValue()) {
-      uint32_t mask = mleft.right().Value();
-      uint32_t mask_width = base::bits::CountPopulation(mask);
-      uint32_t mask_msb = base::bits::CountLeadingZeros32(mask);
-      if ((mask_width != 0) && (mask_msb + mask_width == 32)) {
-        uint32_t shift = m.right().Value();
-        DCHECK_EQ(0u, base::bits::CountTrailingZeros32(mask));
-        DCHECK_NE(0u, shift);
-        if ((shift + mask_width) >= 32) {
-          // If the mask is contiguous and reaches or extends beyond the top
-          // bit, only the shift is needed.
-          Emit(kMipsShl, g.DefineAsRegister(node),
-               g.UseRegister(mleft.left().node()),
-               g.UseImmediate(m.right().node()));
-          return;
-        }
-      }
-    }
-  }
-  VisitRRO(this, kMipsShl, node);
-}
-
-
-void InstructionSelector::VisitWord32Shr(Node* node) {
-  Int32BinopMatcher m(node);
-  if (m.left().IsWord32And() && m.right().HasValue()) {
-    uint32_t lsb = m.right().Value() & 0x1F;
-    Int32BinopMatcher mleft(m.left().node());
-    if (mleft.right().HasValue() && mleft.right().Value() != 0) {
-      // Select Ext for Shr(And(x, mask), imm) where the result of the mask is
-      // shifted into the least-significant bits.
-      uint32_t mask = (mleft.right().Value() >> lsb) << lsb;
-      unsigned mask_width = base::bits::CountPopulation(mask);
-      unsigned mask_msb = base::bits::CountLeadingZeros32(mask);
-      if ((mask_msb + mask_width + lsb) == 32) {
-        MipsOperandGenerator g(this);
-        DCHECK_EQ(lsb, base::bits::CountTrailingZeros32(mask));
-        Emit(kMipsExt, g.DefineAsRegister(node),
-             g.UseRegister(mleft.left().node()), g.TempImmediate(lsb),
-             g.TempImmediate(mask_width));
-        return;
-      }
-    }
-  }
-  VisitRRO(this, kMipsShr, node);
-}
-
-
-void InstructionSelector::VisitWord32Sar(Node* node) {
-  Int32BinopMatcher m(node);
-  if (m.left().IsWord32Shl() && CanCover(node, m.left().node())) {
-    Int32BinopMatcher mleft(m.left().node());
-    if (m.right().HasValue() && mleft.right().HasValue()) {
-      MipsOperandGenerator g(this);
-      uint32_t sar = m.right().Value();
-      uint32_t shl = mleft.right().Value();
-      if ((sar == shl) && (sar == 16)) {
-        Emit(kMipsSeh, g.DefineAsRegister(node),
-             g.UseRegister(mleft.left().node()));
-        return;
-      } else if ((sar == shl) && (sar == 24)) {
-        Emit(kMipsSeb, g.DefineAsRegister(node),
-             g.UseRegister(mleft.left().node()));
-        return;
-      }
-    }
-  }
-  VisitRRO(this, kMipsSar, node);
-}
-
-static void VisitInt32PairBinop(InstructionSelector* selector,
-                                InstructionCode pair_opcode,
-                                InstructionCode single_opcode, Node* node) {
-  MipsOperandGenerator g(selector);
-
-  Node* projection1 = NodeProperties::FindProjection(node, 1);
-
-  if (projection1) {
-    // We use UseUniqueRegister here to avoid register sharing with the output
-    // register.
-    InstructionOperand inputs[] = {g.UseUniqueRegister(node->InputAt(0)),
-                                   g.UseUniqueRegister(node->InputAt(1)),
-                                   g.UseUniqueRegister(node->InputAt(2)),
-                                   g.UseUniqueRegister(node->InputAt(3))};
-
-    InstructionOperand outputs[] = {
-        g.DefineAsRegister(node),
-        g.DefineAsRegister(NodeProperties::FindProjection(node, 1))};
-    selector->Emit(pair_opcode, 2, outputs, 4, inputs);
-  } else {
-    // The high word of the result is not used, so we emit the standard 32 bit
-    // instruction.
-    selector->Emit(single_opcode, g.DefineSameAsFirst(node),
-                   g.UseRegister(node->InputAt(0)),
-                   g.UseRegister(node->InputAt(2)));
-  }
-}
-
-void InstructionSelector::VisitInt32PairAdd(Node* node) {
-  VisitInt32PairBinop(this, kMipsAddPair, kMipsAdd, node);
-}
-
-void InstructionSelector::VisitInt32PairSub(Node* node) {
-  VisitInt32PairBinop(this, kMipsSubPair, kMipsSub, node);
-}
-
-void InstructionSelector::VisitInt32PairMul(Node* node) {
-  VisitInt32PairBinop(this, kMipsMulPair, kMipsMul, node);
-}
-
-// Shared routine for multiple shift operations.
-static void VisitWord32PairShift(InstructionSelector* selector,
-                                 InstructionCode opcode, Node* node) {
-  MipsOperandGenerator g(selector);
-  Int32Matcher m(node->InputAt(2));
-  InstructionOperand shift_operand;
-  if (m.HasValue()) {
-    shift_operand = g.UseImmediate(m.node());
-  } else {
-    shift_operand = g.UseUniqueRegister(m.node());
-  }
-
-  // We use UseUniqueRegister here to avoid register sharing with the output
-  // register.
-  InstructionOperand inputs[] = {g.UseUniqueRegister(node->InputAt(0)),
-                                 g.UseUniqueRegister(node->InputAt(1)),
-                                 shift_operand};
-
-  Node* projection1 = NodeProperties::FindProjection(node, 1);
-
-  InstructionOperand outputs[2];
-  InstructionOperand temps[1];
-  int32_t output_count = 0;
-  int32_t temp_count = 0;
-
-  outputs[output_count++] = g.DefineAsRegister(node);
-  if (projection1) {
-    outputs[output_count++] = g.DefineAsRegister(projection1);
-  } else {
-    temps[temp_count++] = g.TempRegister();
-  }
-
-  selector->Emit(opcode, output_count, outputs, 3, inputs, temp_count, temps);
-}
-
-void InstructionSelector::VisitWord32PairShl(Node* node) {
-  VisitWord32PairShift(this, kMipsShlPair, node);
-}
-
-void InstructionSelector::VisitWord32PairShr(Node* node) {
-  VisitWord32PairShift(this, kMipsShrPair, node);
-}
-
-void InstructionSelector::VisitWord32PairSar(Node* node) {
-  VisitWord32PairShift(this, kMipsSarPair, node);
-}
-
-void InstructionSelector::VisitWord32Ror(Node* node) {
-  VisitRRO(this, kMipsRor, node);
-}
-
-
-void InstructionSelector::VisitWord32Clz(Node* node) {
-  VisitRR(this, kMipsClz, node);
-}
-
-
-void InstructionSelector::VisitWord32ReverseBits(Node* node) { UNREACHABLE(); }
-
-void InstructionSelector::VisitWord64ReverseBytes(Node* node) { UNREACHABLE(); }
-
-void InstructionSelector::VisitWord32ReverseBytes(Node* node) {
-  MipsOperandGenerator g(this);
-  Emit(kMipsByteSwap32, g.DefineAsRegister(node),
-       g.UseRegister(node->InputAt(0)));
-}
-
-void InstructionSelector::VisitWord32Ctz(Node* node) {
-  MipsOperandGenerator g(this);
-  Emit(kMipsCtz, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0)));
-}
-
-
-void InstructionSelector::VisitWord32Popcnt(Node* node) {
-  MipsOperandGenerator g(this);
-  Emit(kMipsPopcnt, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0)));
-}
-
-
-void InstructionSelector::VisitInt32Add(Node* node) {
-  MipsOperandGenerator g(this);
-  Int32BinopMatcher m(node);
-
-  // Select Lsa for (left + (left_of_right << imm)).
-  if (m.right().opcode() == IrOpcode::kWord32Shl &&
-      CanCover(node, m.left().node()) && CanCover(node, m.right().node())) {
-    Int32BinopMatcher mright(m.right().node());
-    if (mright.right().HasValue() && !m.left().HasValue()) {
-      int32_t shift_value = static_cast<int32_t>(mright.right().Value());
-      Emit(kMipsLsa, g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-           g.UseRegister(mright.left().node()), g.TempImmediate(shift_value));
-      return;
-    }
-  }
-
-  // Select Lsa for ((left_of_left << imm) + right).
-  if (m.left().opcode() == IrOpcode::kWord32Shl &&
-      CanCover(node, m.right().node()) && CanCover(node, m.left().node())) {
-    Int32BinopMatcher mleft(m.left().node());
-    if (mleft.right().HasValue() && !m.right().HasValue()) {
-      int32_t shift_value = static_cast<int32_t>(mleft.right().Value());
-      Emit(kMipsLsa, g.DefineAsRegister(node), g.UseRegister(m.right().node()),
-           g.UseRegister(mleft.left().node()), g.TempImmediate(shift_value));
-      return;
-    }
-  }
-
-  VisitBinop(this, node, kMipsAdd, true, kMipsAdd);
-}
-
-
-void InstructionSelector::VisitInt32Sub(Node* node) {
-  VisitBinop(this, node, kMipsSub);
-}
-
-
-void InstructionSelector::VisitInt32Mul(Node* node) {
-  MipsOperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  if (m.right().HasValue() && m.right().Value() > 0) {
-    uint32_t value = static_cast<uint32_t>(m.right().Value());
-    if (base::bits::IsPowerOfTwo(value)) {
-      Emit(kMipsShl | AddressingModeField::encode(kMode_None),
-           g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-           g.TempImmediate(WhichPowerOf2(value)));
-      return;
-    }
-    if (base::bits::IsPowerOfTwo(value - 1)) {
-      Emit(kMipsLsa, g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-           g.UseRegister(m.left().node()),
-           g.TempImmediate(WhichPowerOf2(value - 1)));
-      return;
-    }
-    if (base::bits::IsPowerOfTwo(value + 1)) {
-      InstructionOperand temp = g.TempRegister();
-      Emit(kMipsShl | AddressingModeField::encode(kMode_None), temp,
-           g.UseRegister(m.left().node()),
-           g.TempImmediate(WhichPowerOf2(value + 1)));
-      Emit(kMipsSub | AddressingModeField::encode(kMode_None),
-           g.DefineAsRegister(node), temp, g.UseRegister(m.left().node()));
-      return;
-    }
-  }
-  VisitRRR(this, kMipsMul, node);
-}
-
-
-void InstructionSelector::VisitInt32MulHigh(Node* node) {
-  VisitRRR(this, kMipsMulHigh, node);
-}
-
-
-void InstructionSelector::VisitUint32MulHigh(Node* node) {
-  MipsOperandGenerator g(this);
-  Emit(kMipsMulHighU, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0)),
-       g.UseRegister(node->InputAt(1)));
-}
-
-
-void InstructionSelector::VisitInt32Div(Node* node) {
-  MipsOperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  Emit(kMipsDiv, g.DefineSameAsFirst(node), g.UseRegister(m.left().node()),
-       g.UseRegister(m.right().node()));
-}
-
-
-void InstructionSelector::VisitUint32Div(Node* node) {
-  MipsOperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  Emit(kMipsDivU, g.DefineSameAsFirst(node), g.UseRegister(m.left().node()),
-       g.UseRegister(m.right().node()));
-}
-
-
-void InstructionSelector::VisitInt32Mod(Node* node) {
-  MipsOperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  Emit(kMipsMod, g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-       g.UseRegister(m.right().node()));
-}
-
-
-void InstructionSelector::VisitUint32Mod(Node* node) {
-  MipsOperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  Emit(kMipsModU, g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-       g.UseRegister(m.right().node()));
-}
-
-
-void InstructionSelector::VisitChangeFloat32ToFloat64(Node* node) {
-  VisitRR(this, kMipsCvtDS, node);
-}
-
-
-void InstructionSelector::VisitRoundInt32ToFloat32(Node* node) {
-  VisitRR(this, kMipsCvtSW, node);
-}
-
-
-void InstructionSelector::VisitRoundUint32ToFloat32(Node* node) {
-  VisitRR(this, kMipsCvtSUw, node);
-}
-
-
-void InstructionSelector::VisitChangeInt32ToFloat64(Node* node) {
-  VisitRR(this, kMipsCvtDW, node);
-}
-
-
-void InstructionSelector::VisitChangeUint32ToFloat64(Node* node) {
-  VisitRR(this, kMipsCvtDUw, node);
-}
-
-
-void InstructionSelector::VisitTruncateFloat32ToInt32(Node* node) {
-  VisitRR(this, kMipsTruncWS, node);
-}
-
-
-void InstructionSelector::VisitTruncateFloat32ToUint32(Node* node) {
-  VisitRR(this, kMipsTruncUwS, node);
-}
-
-
-void InstructionSelector::VisitChangeFloat64ToInt32(Node* node) {
-  MipsOperandGenerator g(this);
-  Node* value = node->InputAt(0);
-  // Match ChangeFloat64ToInt32(Float64Round##OP) to corresponding instruction
-  // which does rounding and conversion to integer format.
-  if (CanCover(node, value)) {
-    switch (value->opcode()) {
-      case IrOpcode::kFloat64RoundDown:
-        Emit(kMipsFloorWD, g.DefineAsRegister(node),
-             g.UseRegister(value->InputAt(0)));
-        return;
-      case IrOpcode::kFloat64RoundUp:
-        Emit(kMipsCeilWD, g.DefineAsRegister(node),
-             g.UseRegister(value->InputAt(0)));
-        return;
-      case IrOpcode::kFloat64RoundTiesEven:
-        Emit(kMipsRoundWD, g.DefineAsRegister(node),
-             g.UseRegister(value->InputAt(0)));
-        return;
-      case IrOpcode::kFloat64RoundTruncate:
-        Emit(kMipsTruncWD, g.DefineAsRegister(node),
-             g.UseRegister(value->InputAt(0)));
-        return;
-      default:
-        break;
-    }
-    if (value->opcode() == IrOpcode::kChangeFloat32ToFloat64) {
-      Node* next = value->InputAt(0);
-      if (CanCover(value, next)) {
-        // Match ChangeFloat64ToInt32(ChangeFloat32ToFloat64(Float64Round##OP))
-        switch (next->opcode()) {
-          case IrOpcode::kFloat32RoundDown:
-            Emit(kMipsFloorWS, g.DefineAsRegister(node),
-                 g.UseRegister(next->InputAt(0)));
-            return;
-          case IrOpcode::kFloat32RoundUp:
-            Emit(kMipsCeilWS, g.DefineAsRegister(node),
-                 g.UseRegister(next->InputAt(0)));
-            return;
-          case IrOpcode::kFloat32RoundTiesEven:
-            Emit(kMipsRoundWS, g.DefineAsRegister(node),
-                 g.UseRegister(next->InputAt(0)));
-            return;
-          case IrOpcode::kFloat32RoundTruncate:
-            Emit(kMipsTruncWS, g.DefineAsRegister(node),
-                 g.UseRegister(next->InputAt(0)));
-            return;
-          default:
-            Emit(kMipsTruncWS, g.DefineAsRegister(node),
-                 g.UseRegister(value->InputAt(0)));
-            return;
-        }
-      } else {
-        // Match float32 -> float64 -> int32 representation change path.
-        Emit(kMipsTruncWS, g.DefineAsRegister(node),
-             g.UseRegister(value->InputAt(0)));
-        return;
-      }
-    }
-  }
-  VisitRR(this, kMipsTruncWD, node);
-}
-
-
-void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) {
-  VisitRR(this, kMipsTruncUwD, node);
-}
-
-void InstructionSelector::VisitTruncateFloat64ToUint32(Node* node) {
-  VisitRR(this, kMipsTruncUwD, node);
-}
-
-void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) {
-  MipsOperandGenerator g(this);
-  Node* value = node->InputAt(0);
-  // Match TruncateFloat64ToFloat32(ChangeInt32ToFloat64) to corresponding
-  // instruction.
-  if (CanCover(node, value) &&
-      value->opcode() == IrOpcode::kChangeInt32ToFloat64) {
-    Emit(kMipsCvtSW, g.DefineAsRegister(node),
-         g.UseRegister(value->InputAt(0)));
-    return;
-  }
-  VisitRR(this, kMipsCvtSD, node);
-}
-
-void InstructionSelector::VisitTruncateFloat64ToWord32(Node* node) {
-  VisitRR(this, kArchTruncateDoubleToI, node);
-}
-
-void InstructionSelector::VisitRoundFloat64ToInt32(Node* node) {
-  VisitRR(this, kMipsTruncWD, node);
-}
-
-void InstructionSelector::VisitBitcastFloat32ToInt32(Node* node) {
-  VisitRR(this, kMipsFloat64ExtractLowWord32, node);
-}
-
-
-void InstructionSelector::VisitBitcastInt32ToFloat32(Node* node) {
-  MipsOperandGenerator g(this);
-  Emit(kMipsFloat64InsertLowWord32, g.DefineAsRegister(node),
-       ImmediateOperand(ImmediateOperand::INLINE, 0),
-       g.UseRegister(node->InputAt(0)));
-}
-
-
-void InstructionSelector::VisitFloat32Add(Node* node) {
-  MipsOperandGenerator g(this);
-  if (IsMipsArchVariant(kMips32r2)) {  // Select Madd.S(z, x, y).
-    Float32BinopMatcher m(node);
-    if (m.left().IsFloat32Mul() && CanCover(node, m.left().node())) {
-      // For Add.S(Mul.S(x, y), z):
-      Float32BinopMatcher mleft(m.left().node());
-      Emit(kMipsMaddS, g.DefineAsRegister(node),
-           g.UseRegister(m.right().node()), g.UseRegister(mleft.left().node()),
-           g.UseRegister(mleft.right().node()));
-      return;
-    }
-    if (m.right().IsFloat32Mul() && CanCover(node, m.right().node())) {
-      // For Add.S(x, Mul.S(y, z)):
-      Float32BinopMatcher mright(m.right().node());
-      Emit(kMipsMaddS, g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-           g.UseRegister(mright.left().node()),
-           g.UseRegister(mright.right().node()));
-      return;
-    }
-  }
-  VisitRRR(this, kMipsAddS, node);
-}
-
-
-void InstructionSelector::VisitFloat64Add(Node* node) {
-  MipsOperandGenerator g(this);
-  if (IsMipsArchVariant(kMips32r2)) {  // Select Madd.S(z, x, y).
-    Float64BinopMatcher m(node);
-    if (m.left().IsFloat64Mul() && CanCover(node, m.left().node())) {
-      // For Add.D(Mul.D(x, y), z):
-      Float64BinopMatcher mleft(m.left().node());
-      Emit(kMipsMaddD, g.DefineAsRegister(node),
-           g.UseRegister(m.right().node()), g.UseRegister(mleft.left().node()),
-           g.UseRegister(mleft.right().node()));
-      return;
-    }
-    if (m.right().IsFloat64Mul() && CanCover(node, m.right().node())) {
-      // For Add.D(x, Mul.D(y, z)):
-      Float64BinopMatcher mright(m.right().node());
-      Emit(kMipsMaddD, g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-           g.UseRegister(mright.left().node()),
-           g.UseRegister(mright.right().node()));
-      return;
-    }
-  }
-  VisitRRR(this, kMipsAddD, node);
-}
-
-
-void InstructionSelector::VisitFloat32Sub(Node* node) {
-  MipsOperandGenerator g(this);
-  if (IsMipsArchVariant(kMips32r2)) {  // Select Madd.S(z, x, y).
-    Float32BinopMatcher m(node);
-    if (m.left().IsFloat32Mul() && CanCover(node, m.left().node())) {
-      // For Sub.S(Mul.S(x,y), z) select Msub.S(z, x, y).
-      Float32BinopMatcher mleft(m.left().node());
-      Emit(kMipsMsubS, g.DefineAsRegister(node),
-           g.UseRegister(m.right().node()), g.UseRegister(mleft.left().node()),
-           g.UseRegister(mleft.right().node()));
-      return;
-    }
-  }
-  VisitRRR(this, kMipsSubS, node);
-}
-
-void InstructionSelector::VisitFloat64Sub(Node* node) {
-  MipsOperandGenerator g(this);
-  if (IsMipsArchVariant(kMips32r2)) {  // Select Madd.S(z, x, y).
-    Float64BinopMatcher m(node);
-    if (m.left().IsFloat64Mul() && CanCover(node, m.left().node())) {
-      // For Sub.D(Mul.S(x,y), z) select Msub.D(z, x, y).
-      Float64BinopMatcher mleft(m.left().node());
-      Emit(kMipsMsubD, g.DefineAsRegister(node),
-           g.UseRegister(m.right().node()), g.UseRegister(mleft.left().node()),
-           g.UseRegister(mleft.right().node()));
-      return;
-    }
-  }
-  VisitRRR(this, kMipsSubD, node);
-}
-
-void InstructionSelector::VisitFloat32Mul(Node* node) {
-  VisitRRR(this, kMipsMulS, node);
-}
-
-
-void InstructionSelector::VisitFloat64Mul(Node* node) {
-  VisitRRR(this, kMipsMulD, node);
-}
-
-
-void InstructionSelector::VisitFloat32Div(Node* node) {
-  VisitRRR(this, kMipsDivS, node);
-}
-
-
-void InstructionSelector::VisitFloat64Div(Node* node) {
-  VisitRRR(this, kMipsDivD, node);
-}
-
-
-void InstructionSelector::VisitFloat64Mod(Node* node) {
-  MipsOperandGenerator g(this);
-  Emit(kMipsModD, g.DefineAsFixed(node, f0), g.UseFixed(node->InputAt(0), f12),
-       g.UseFixed(node->InputAt(1), f14))->MarkAsCall();
-}
-
-void InstructionSelector::VisitFloat32Max(Node* node) {
-  MipsOperandGenerator g(this);
-  Emit(kMipsFloat32Max, g.DefineAsRegister(node),
-       g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)));
-}
-
-void InstructionSelector::VisitFloat64Max(Node* node) {
-  MipsOperandGenerator g(this);
-  Emit(kMipsFloat64Max, g.DefineAsRegister(node),
-       g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)));
-}
-
-void InstructionSelector::VisitFloat32Min(Node* node) {
-  MipsOperandGenerator g(this);
-  Emit(kMipsFloat32Min, g.DefineAsRegister(node),
-       g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)));
-}
-
-void InstructionSelector::VisitFloat64Min(Node* node) {
-  MipsOperandGenerator g(this);
-  Emit(kMipsFloat64Min, g.DefineAsRegister(node),
-       g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)));
-}
-
-
-void InstructionSelector::VisitFloat32Abs(Node* node) {
-  VisitRR(this, kMipsAbsS, node);
-}
-
-
-void InstructionSelector::VisitFloat64Abs(Node* node) {
-  VisitRR(this, kMipsAbsD, node);
-}
-
-void InstructionSelector::VisitFloat32Sqrt(Node* node) {
-  VisitRR(this, kMipsSqrtS, node);
-}
-
-
-void InstructionSelector::VisitFloat64Sqrt(Node* node) {
-  VisitRR(this, kMipsSqrtD, node);
-}
-
-
-void InstructionSelector::VisitFloat32RoundDown(Node* node) {
-  VisitRR(this, kMipsFloat32RoundDown, node);
-}
-
-
-void InstructionSelector::VisitFloat64RoundDown(Node* node) {
-  VisitRR(this, kMipsFloat64RoundDown, node);
-}
-
-
-void InstructionSelector::VisitFloat32RoundUp(Node* node) {
-  VisitRR(this, kMipsFloat32RoundUp, node);
-}
-
-
-void InstructionSelector::VisitFloat64RoundUp(Node* node) {
-  VisitRR(this, kMipsFloat64RoundUp, node);
-}
-
-
-void InstructionSelector::VisitFloat32RoundTruncate(Node* node) {
-  VisitRR(this, kMipsFloat32RoundTruncate, node);
-}
-
-
-void InstructionSelector::VisitFloat64RoundTruncate(Node* node) {
-  VisitRR(this, kMipsFloat64RoundTruncate, node);
-}
-
-
-void InstructionSelector::VisitFloat64RoundTiesAway(Node* node) {
-  UNREACHABLE();
-}
-
-
-void InstructionSelector::VisitFloat32RoundTiesEven(Node* node) {
-  VisitRR(this, kMipsFloat32RoundTiesEven, node);
-}
-
-
-void InstructionSelector::VisitFloat64RoundTiesEven(Node* node) {
-  VisitRR(this, kMipsFloat64RoundTiesEven, node);
-}
-
-void InstructionSelector::VisitFloat32Neg(Node* node) {
-  VisitRR(this, kMipsNegS, node);
-}
-
-void InstructionSelector::VisitFloat64Neg(Node* node) {
-  VisitRR(this, kMipsNegD, node);
-}
-
-void InstructionSelector::VisitFloat64Ieee754Binop(Node* node,
-                                                   InstructionCode opcode) {
-  MipsOperandGenerator g(this);
-  Emit(opcode, g.DefineAsFixed(node, f0), g.UseFixed(node->InputAt(0), f2),
-       g.UseFixed(node->InputAt(1), f4))
-      ->MarkAsCall();
-}
-
-void InstructionSelector::VisitFloat64Ieee754Unop(Node* node,
-                                                  InstructionCode opcode) {
-  MipsOperandGenerator g(this);
-  Emit(opcode, g.DefineAsFixed(node, f0), g.UseFixed(node->InputAt(0), f12))
-      ->MarkAsCall();
-}
-
-void InstructionSelector::EmitPrepareArguments(
-    ZoneVector<PushParameter>* arguments, const CallDescriptor* descriptor,
-    Node* node) {
-  MipsOperandGenerator g(this);
-
-  // Prepare for C function call.
-  if (descriptor->IsCFunctionCall()) {
-    Emit(kArchPrepareCallCFunction |
-             MiscField::encode(static_cast<int>(descriptor->ParameterCount())),
-         0, nullptr, 0, nullptr);
-
-    // Poke any stack arguments.
-    int slot = kCArgSlotCount;
-    for (PushParameter input : (*arguments)) {
-      if (input.node) {
-        Emit(kMipsStoreToStackSlot, g.NoOutput(), g.UseRegister(input.node),
-             g.TempImmediate(slot << kPointerSizeLog2));
-        ++slot;
-      }
-    }
-  } else {
-    // Possibly align stack here for functions.
-    int push_count = static_cast<int>(descriptor->StackParameterCount());
-    if (push_count > 0) {
-      // Calculate needed space
-      int stack_size = 0;
-      for (size_t n = 0; n < arguments->size(); ++n) {
-        PushParameter input = (*arguments)[n];
-        if (input.node) {
-          stack_size += input.location.GetSizeInPointers();
-        }
-      }
-      Emit(kMipsStackClaim, g.NoOutput(),
-           g.TempImmediate(stack_size << kPointerSizeLog2));
-    }
-    for (size_t n = 0; n < arguments->size(); ++n) {
-      PushParameter input = (*arguments)[n];
-      if (input.node) {
-        Emit(kMipsStoreToStackSlot, g.NoOutput(), g.UseRegister(input.node),
-             g.TempImmediate(n << kPointerSizeLog2));
-      }
-    }
-  }
-}
-
-void InstructionSelector::EmitPrepareResults(ZoneVector<PushParameter>* results,
-                                             const CallDescriptor* descriptor,
-                                             Node* node) {
-  MipsOperandGenerator g(this);
-
-  int reverse_slot = 0;
-  for (PushParameter output : *results) {
-    if (!output.location.IsCallerFrameSlot()) continue;
-    ++reverse_slot;
-    // Skip any alignment holes in nodes.
-    if (output.node != nullptr) {
-      DCHECK(!descriptor->IsCFunctionCall());
-      if (output.location.GetType() == MachineType::Float32()) {
-        MarkAsFloat32(output.node);
-      } else if (output.location.GetType() == MachineType::Float64()) {
-        MarkAsFloat64(output.node);
-      }
-      InstructionOperand result = g.DefineAsRegister(output.node);
-      Emit(kMipsPeek | MiscField::encode(reverse_slot), result);
-    }
-    if (output.location.GetType() == MachineType::Float64()) {
-      // Float64 require an implicit second slot.
-      ++reverse_slot;
-    }
-  }
-}
-
-bool InstructionSelector::IsTailCallAddressImmediate() { return false; }
-
-int InstructionSelector::GetTempsCountForTailCallFromJSFunction() { return 3; }
-
-void InstructionSelector::VisitUnalignedLoad(Node* node) {
-  UnalignedLoadRepresentation load_rep =
-      UnalignedLoadRepresentationOf(node->op());
-  MipsOperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-
-  ArchOpcode opcode = kArchNop;
-  switch (load_rep.representation()) {
-    case MachineRepresentation::kBit:  // Fall through.
-    case MachineRepresentation::kWord8:
-      UNREACHABLE();
-      break;
-    case MachineRepresentation::kWord16:
-      opcode = load_rep.IsUnsigned() ? kMipsUlhu : kMipsUlh;
-      break;
-    case MachineRepresentation::kTaggedSigned:   // Fall through.
-    case MachineRepresentation::kTaggedPointer:  // Fall through.
-    case MachineRepresentation::kTagged:  // Fall through.
-    case MachineRepresentation::kWord32:
-      opcode = kMipsUlw;
-      break;
-    case MachineRepresentation::kFloat32:
-      opcode = kMipsUlwc1;
-      break;
-    case MachineRepresentation::kFloat64:
-      opcode = kMipsUldc1;
-      break;
-    case MachineRepresentation::kSimd128:
-      opcode = kMipsMsaLd;
-      break;
-    case MachineRepresentation::kWord64:   // Fall through.
-    case MachineRepresentation::kNone:
-      UNREACHABLE();
-      return;
-  }
-
-  if (g.CanBeImmediate(index, opcode)) {
-    Emit(opcode | AddressingModeField::encode(kMode_MRI),
-         g.DefineAsRegister(node), g.UseRegister(base), g.UseImmediate(index));
-  } else {
-    InstructionOperand addr_reg = g.TempRegister();
-    Emit(kMipsAdd | AddressingModeField::encode(kMode_None), addr_reg,
-         g.UseRegister(index), g.UseRegister(base));
-    // Emit desired load opcode, using temp addr_reg.
-    Emit(opcode | AddressingModeField::encode(kMode_MRI),
-         g.DefineAsRegister(node), addr_reg, g.TempImmediate(0));
-  }
-}
-
-void InstructionSelector::VisitUnalignedStore(Node* node) {
-  MipsOperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-
-  UnalignedStoreRepresentation rep = UnalignedStoreRepresentationOf(node->op());
-
-  // TODO(mips): I guess this could be done in a better way.
-  ArchOpcode opcode = kArchNop;
-  switch (rep) {
-    case MachineRepresentation::kFloat32:
-      opcode = kMipsUswc1;
-      break;
-    case MachineRepresentation::kFloat64:
-      opcode = kMipsUsdc1;
-      break;
-    case MachineRepresentation::kBit:  // Fall through.
-    case MachineRepresentation::kWord8:
-      UNREACHABLE();
-      break;
-    case MachineRepresentation::kWord16:
-      opcode = kMipsUsh;
-      break;
-    case MachineRepresentation::kTaggedSigned:   // Fall through.
-    case MachineRepresentation::kTaggedPointer:  // Fall through.
-    case MachineRepresentation::kTagged:  // Fall through.
-    case MachineRepresentation::kWord32:
-      opcode = kMipsUsw;
-      break;
-    case MachineRepresentation::kSimd128:
-      opcode = kMipsMsaSt;
-      break;
-    case MachineRepresentation::kWord64:   // Fall through.
-    case MachineRepresentation::kNone:
-      UNREACHABLE();
-      return;
-  }
-
-  if (g.CanBeImmediate(index, opcode)) {
-    Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(),
-         g.UseRegister(base), g.UseImmediate(index),
-         g.UseRegisterOrImmediateZero(value));
-  } else {
-    InstructionOperand addr_reg = g.TempRegister();
-    Emit(kMipsAdd | AddressingModeField::encode(kMode_None), addr_reg,
-         g.UseRegister(index), g.UseRegister(base));
-    // Emit desired store opcode, using temp addr_reg.
-    Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(),
-         addr_reg, g.TempImmediate(0), g.UseRegisterOrImmediateZero(value));
-  }
-}
-
-namespace {
-// Shared routine for multiple compare operations.
-static void VisitCompare(InstructionSelector* selector, InstructionCode opcode,
-                         InstructionOperand left, InstructionOperand right,
-                         FlagsContinuation* cont) {
-  MipsOperandGenerator g(selector);
-  opcode = cont->Encode(opcode);
-  if (cont->IsBranch()) {
-    selector->Emit(opcode, g.NoOutput(), left, right,
-                   g.Label(cont->true_block()), g.Label(cont->false_block()));
-  } else if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(opcode, g.NoOutput(), left, right, cont->kind(),
-                             cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else if (cont->IsSet()) {
-    selector->Emit(opcode, g.DefineAsRegister(cont->result()), left, right);
-  } else {
-    DCHECK(cont->IsTrap());
-    selector->Emit(opcode, g.NoOutput(), left, right,
-                   g.TempImmediate(cont->trap_id()));
-  }
-}
-
-
-// Shared routine for multiple float32 compare operations.
-void VisitFloat32Compare(InstructionSelector* selector, Node* node,
-                         FlagsContinuation* cont) {
-  MipsOperandGenerator g(selector);
-  Float32BinopMatcher m(node);
-  InstructionOperand lhs, rhs;
-
-  lhs = m.left().IsZero() ? g.UseImmediate(m.left().node())
-                          : g.UseRegister(m.left().node());
-  rhs = m.right().IsZero() ? g.UseImmediate(m.right().node())
-                           : g.UseRegister(m.right().node());
-  VisitCompare(selector, kMipsCmpS, lhs, rhs, cont);
-}
-
-
-// Shared routine for multiple float64 compare operations.
-void VisitFloat64Compare(InstructionSelector* selector, Node* node,
-                         FlagsContinuation* cont) {
-  MipsOperandGenerator g(selector);
-  Float64BinopMatcher m(node);
-  InstructionOperand lhs, rhs;
-
-  lhs = m.left().IsZero() ? g.UseImmediate(m.left().node())
-                          : g.UseRegister(m.left().node());
-  rhs = m.right().IsZero() ? g.UseImmediate(m.right().node())
-                           : g.UseRegister(m.right().node());
-  VisitCompare(selector, kMipsCmpD, lhs, rhs, cont);
-}
-
-
-// Shared routine for multiple word compare operations.
-void VisitWordCompare(InstructionSelector* selector, Node* node,
-                      InstructionCode opcode, FlagsContinuation* cont,
-                      bool commutative) {
-  MipsOperandGenerator g(selector);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-
-  // Match immediates on left or right side of comparison.
-  if (g.CanBeImmediate(right, opcode)) {
-    if (opcode == kMipsTst) {
-      VisitCompare(selector, opcode, g.UseRegister(left), g.UseImmediate(right),
-                   cont);
-    } else {
-      switch (cont->condition()) {
-        case kEqual:
-        case kNotEqual:
-          if (cont->IsSet()) {
-            VisitCompare(selector, opcode, g.UseRegister(left),
-                         g.UseImmediate(right), cont);
-          } else {
-            VisitCompare(selector, opcode, g.UseRegister(left),
-                         g.UseRegister(right), cont);
-          }
-          break;
-        case kSignedLessThan:
-        case kSignedGreaterThanOrEqual:
-        case kUnsignedLessThan:
-        case kUnsignedGreaterThanOrEqual:
-          VisitCompare(selector, opcode, g.UseRegister(left),
-                       g.UseImmediate(right), cont);
-          break;
-        default:
-          VisitCompare(selector, opcode, g.UseRegister(left),
-                       g.UseRegister(right), cont);
-      }
-    }
-  } else if (g.CanBeImmediate(left, opcode)) {
-    if (!commutative) cont->Commute();
-    if (opcode == kMipsTst) {
-      VisitCompare(selector, opcode, g.UseRegister(right), g.UseImmediate(left),
-                   cont);
-    } else {
-      switch (cont->condition()) {
-        case kEqual:
-        case kNotEqual:
-          if (cont->IsSet()) {
-            VisitCompare(selector, opcode, g.UseRegister(right),
-                         g.UseImmediate(left), cont);
-          } else {
-            VisitCompare(selector, opcode, g.UseRegister(right),
-                         g.UseRegister(left), cont);
-          }
-          break;
-        case kSignedLessThan:
-        case kSignedGreaterThanOrEqual:
-        case kUnsignedLessThan:
-        case kUnsignedGreaterThanOrEqual:
-          VisitCompare(selector, opcode, g.UseRegister(right),
-                       g.UseImmediate(left), cont);
-          break;
-        default:
-          VisitCompare(selector, opcode, g.UseRegister(right),
-                       g.UseRegister(left), cont);
-      }
-    }
-  } else {
-    VisitCompare(selector, opcode, g.UseRegister(left), g.UseRegister(right),
-                 cont);
-  }
-}
-
-
-void VisitWordCompare(InstructionSelector* selector, Node* node,
-                      FlagsContinuation* cont) {
-  VisitWordCompare(selector, node, kMipsCmp, cont, false);
-}
-
-// Shared routine for word comparisons against zero.
-void VisitWordCompareZero(InstructionSelector* selector, Node* user,
-                          Node* value, FlagsContinuation* cont) {
-  // Try to combine with comparisons against 0 by simply inverting the branch.
-  while (value->opcode() == IrOpcode::kWord32Equal &&
-         selector->CanCover(user, value)) {
-    Int32BinopMatcher m(value);
-    if (!m.right().Is(0)) break;
-
-    user = value;
-    value = m.left().node();
-    cont->Negate();
-  }
-
-  if (selector->CanCover(user, value)) {
-    switch (value->opcode()) {
-      case IrOpcode::kWord32Equal:
-        cont->OverwriteAndNegateIfEqual(kEqual);
-        return VisitWordCompare(selector, value, cont);
-      case IrOpcode::kInt32LessThan:
-        cont->OverwriteAndNegateIfEqual(kSignedLessThan);
-        return VisitWordCompare(selector, value, cont);
-      case IrOpcode::kInt32LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kSignedLessThanOrEqual);
-        return VisitWordCompare(selector, value, cont);
-      case IrOpcode::kUint32LessThan:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThan);
-        return VisitWordCompare(selector, value, cont);
-      case IrOpcode::kUint32LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
-        return VisitWordCompare(selector, value, cont);
-      case IrOpcode::kFloat32Equal:
-        cont->OverwriteAndNegateIfEqual(kEqual);
-        return VisitFloat32Compare(selector, value, cont);
-      case IrOpcode::kFloat32LessThan:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThan);
-        return VisitFloat32Compare(selector, value, cont);
-      case IrOpcode::kFloat32LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
-        return VisitFloat32Compare(selector, value, cont);
-      case IrOpcode::kFloat64Equal:
-        cont->OverwriteAndNegateIfEqual(kEqual);
-        return VisitFloat64Compare(selector, value, cont);
-      case IrOpcode::kFloat64LessThan:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThan);
-        return VisitFloat64Compare(selector, value, cont);
-      case IrOpcode::kFloat64LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
-        return VisitFloat64Compare(selector, value, cont);
-      case IrOpcode::kProjection:
-        // Check if this is the overflow output projection of an
-        // <Operation>WithOverflow node.
-        if (ProjectionIndexOf(value->op()) == 1u) {
-          // We cannot combine the <Operation>WithOverflow with this branch
-          // unless the 0th projection (the use of the actual value of the
-          // <Operation> is either nullptr, which means there's no use of the
-          // actual value, or was already defined, which means it is scheduled
-          // *AFTER* this branch).
-          Node* const node = value->InputAt(0);
-          Node* const result = NodeProperties::FindProjection(node, 0);
-          if (!result || selector->IsDefined(result)) {
-            switch (node->opcode()) {
-              case IrOpcode::kInt32AddWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitBinop(selector, node, kMipsAddOvf, cont);
-              case IrOpcode::kInt32SubWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitBinop(selector, node, kMipsSubOvf, cont);
-              case IrOpcode::kInt32MulWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitBinop(selector, node, kMipsMulOvf, cont);
-              default:
-                break;
-            }
-          }
-        }
-        break;
-      case IrOpcode::kWord32And:
-        return VisitWordCompare(selector, value, kMipsTst, cont, true);
-      default:
-        break;
-    }
-  }
-
-  // Continuation could not be combined with a compare, emit compare against 0.
-  MipsOperandGenerator g(selector);
-  InstructionCode const opcode = cont->Encode(kMipsCmp);
-  InstructionOperand const value_operand = g.UseRegister(value);
-  if (cont->IsBranch()) {
-    selector->Emit(opcode, g.NoOutput(), value_operand, g.TempImmediate(0),
-                   g.Label(cont->true_block()), g.Label(cont->false_block()));
-  } else if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(opcode, g.NoOutput(), value_operand,
-                             g.TempImmediate(0), cont->kind(), cont->reason(),
-                             cont->feedback(), cont->frame_state());
-  } else if (cont->IsSet()) {
-    selector->Emit(opcode, g.DefineAsRegister(cont->result()), value_operand,
-                   g.TempImmediate(0));
-  } else {
-    DCHECK(cont->IsTrap());
-    selector->Emit(opcode, g.NoOutput(), value_operand, g.TempImmediate(0),
-                   g.TempImmediate(cont->trap_id()));
-  }
-}
-
-}  // namespace
-
-void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch,
-                                      BasicBlock* fbranch) {
-  FlagsContinuation cont(kNotEqual, tbranch, fbranch);
-  VisitWordCompareZero(this, branch, branch->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitDeoptimizeIf(Node* node) {
-  DeoptimizeParameters p = DeoptimizeParametersOf(node->op());
-  FlagsContinuation cont = FlagsContinuation::ForDeoptimize(
-      kNotEqual, p.kind(), p.reason(), p.feedback(), node->InputAt(1));
-  VisitWordCompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitDeoptimizeUnless(Node* node) {
-  DeoptimizeParameters p = DeoptimizeParametersOf(node->op());
-  FlagsContinuation cont = FlagsContinuation::ForDeoptimize(
-      kEqual, p.kind(), p.reason(), p.feedback(), node->InputAt(1));
-  VisitWordCompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitTrapIf(Node* node, Runtime::FunctionId func_id) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForTrap(kNotEqual, func_id, node->InputAt(1));
-  VisitWordCompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitTrapUnless(Node* node,
-                                          Runtime::FunctionId func_id) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForTrap(kEqual, func_id, node->InputAt(1));
-  VisitWordCompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitSwitch(Node* node, const SwitchInfo& sw) {
-  MipsOperandGenerator g(this);
-  InstructionOperand value_operand = g.UseRegister(node->InputAt(0));
-
-  // Emit either ArchTableSwitch or ArchLookupSwitch.
-  static const size_t kMaxTableSwitchValueRange = 2 << 16;
-  size_t table_space_cost = 9 + sw.value_range;
-  size_t table_time_cost = 3;
-  size_t lookup_space_cost = 2 + 2 * sw.case_count;
-  size_t lookup_time_cost = sw.case_count;
-  if (sw.case_count > 0 &&
-      table_space_cost + 3 * table_time_cost <=
-          lookup_space_cost + 3 * lookup_time_cost &&
-      sw.min_value > std::numeric_limits<int32_t>::min() &&
-      sw.value_range <= kMaxTableSwitchValueRange) {
-    InstructionOperand index_operand = value_operand;
-    if (sw.min_value) {
-      index_operand = g.TempRegister();
-      Emit(kMipsSub, index_operand, value_operand,
-           g.TempImmediate(sw.min_value));
-    }
-    // Generate a table lookup.
-    return EmitTableSwitch(sw, index_operand);
-  }
-
-  // Generate a sequence of conditional jumps.
-  return EmitLookupSwitch(sw, value_operand);
-}
-
-
-void InstructionSelector::VisitWord32Equal(Node* const node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
-  Int32BinopMatcher m(node);
-  if (m.right().Is(0)) {
-    return VisitWordCompareZero(this, m.node(), m.left().node(), &cont);
-  }
-  VisitWordCompare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitInt32LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kSignedLessThan, node);
-  VisitWordCompare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitInt32LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kSignedLessThanOrEqual, node);
-  VisitWordCompare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitUint32LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kUnsignedLessThan, node);
-  VisitWordCompare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitUint32LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedLessThanOrEqual, node);
-  VisitWordCompare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitInt32AddWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    return VisitBinop(this, node, kMipsAddOvf, &cont);
-  }
-  FlagsContinuation cont;
-  VisitBinop(this, node, kMipsAddOvf, &cont);
-}
-
-
-void InstructionSelector::VisitInt32SubWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    return VisitBinop(this, node, kMipsSubOvf, &cont);
-  }
-  FlagsContinuation cont;
-  VisitBinop(this, node, kMipsSubOvf, &cont);
-}
-
-void InstructionSelector::VisitInt32MulWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    return VisitBinop(this, node, kMipsMulOvf, &cont);
-  }
-  FlagsContinuation cont;
-  VisitBinop(this, node, kMipsMulOvf, &cont);
-}
-
-void InstructionSelector::VisitFloat32Equal(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
-  VisitFloat32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat32LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kUnsignedLessThan, node);
-  VisitFloat32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat32LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedLessThanOrEqual, node);
-  VisitFloat32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat64Equal(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
-  VisitFloat64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat64LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kUnsignedLessThan, node);
-  VisitFloat64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedLessThanOrEqual, node);
-  VisitFloat64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat64ExtractLowWord32(Node* node) {
-  MipsOperandGenerator g(this);
-  Emit(kMipsFloat64ExtractLowWord32, g.DefineAsRegister(node),
-       g.UseRegister(node->InputAt(0)));
-}
-
-
-void InstructionSelector::VisitFloat64ExtractHighWord32(Node* node) {
-  MipsOperandGenerator g(this);
-  Emit(kMipsFloat64ExtractHighWord32, g.DefineAsRegister(node),
-       g.UseRegister(node->InputAt(0)));
-}
-
-
-void InstructionSelector::VisitFloat64InsertLowWord32(Node* node) {
-  MipsOperandGenerator g(this);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-  Emit(kMipsFloat64InsertLowWord32, g.DefineSameAsFirst(node),
-       g.UseRegister(left), g.UseRegister(right));
-}
-
-
-void InstructionSelector::VisitFloat64InsertHighWord32(Node* node) {
-  MipsOperandGenerator g(this);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-  Emit(kMipsFloat64InsertHighWord32, g.DefineSameAsFirst(node),
-       g.UseRegister(left), g.UseRegister(right));
-}
-
-void InstructionSelector::VisitFloat64SilenceNaN(Node* node) {
-  MipsOperandGenerator g(this);
-  Node* left = node->InputAt(0);
-  InstructionOperand temps[] = {g.TempRegister()};
-  Emit(kMipsFloat64SilenceNaN, g.DefineSameAsFirst(node), g.UseRegister(left),
-       arraysize(temps), temps);
-}
-
-void InstructionSelector::VisitAtomicLoad(Node* node) {
-  LoadRepresentation load_rep = LoadRepresentationOf(node->op());
-  MipsOperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  ArchOpcode opcode = kArchNop;
-  switch (load_rep.representation()) {
-    case MachineRepresentation::kWord8:
-      opcode = load_rep.IsSigned() ? kAtomicLoadInt8 : kAtomicLoadUint8;
-      break;
-    case MachineRepresentation::kWord16:
-      opcode = load_rep.IsSigned() ? kAtomicLoadInt16 : kAtomicLoadUint16;
-      break;
-    case MachineRepresentation::kWord32:
-      opcode = kAtomicLoadWord32;
-      break;
-    default:
-      UNREACHABLE();
-      return;
-  }
-
-  if (g.CanBeImmediate(index, opcode)) {
-    Emit(opcode | AddressingModeField::encode(kMode_MRI),
-         g.DefineAsRegister(node), g.UseRegister(base), g.UseImmediate(index));
-  } else {
-    InstructionOperand addr_reg = g.TempRegister();
-    Emit(kMipsAdd | AddressingModeField::encode(kMode_None), addr_reg,
-         g.UseRegister(index), g.UseRegister(base));
-    // Emit desired load opcode, using temp addr_reg.
-    Emit(opcode | AddressingModeField::encode(kMode_MRI),
-         g.DefineAsRegister(node), addr_reg, g.TempImmediate(0));
-  }
-}
-
-void InstructionSelector::VisitAtomicStore(Node* node) {
-  MachineRepresentation rep = AtomicStoreRepresentationOf(node->op());
-  MipsOperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-  ArchOpcode opcode = kArchNop;
-  switch (rep) {
-    case MachineRepresentation::kWord8:
-      opcode = kAtomicStoreWord8;
-      break;
-    case MachineRepresentation::kWord16:
-      opcode = kAtomicStoreWord16;
-      break;
-    case MachineRepresentation::kWord32:
-      opcode = kAtomicStoreWord32;
-      break;
-    default:
-      UNREACHABLE();
-      return;
-  }
-
-  if (g.CanBeImmediate(index, opcode)) {
-    Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(),
-         g.UseRegister(base), g.UseImmediate(index),
-         g.UseRegisterOrImmediateZero(value));
-  } else {
-    InstructionOperand addr_reg = g.TempRegister();
-    Emit(kMipsAdd | AddressingModeField::encode(kMode_None), addr_reg,
-         g.UseRegister(index), g.UseRegister(base));
-    // Emit desired store opcode, using temp addr_reg.
-    Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(),
-         addr_reg, g.TempImmediate(0), g.UseRegisterOrImmediateZero(value));
-  }
-}
-
-void InstructionSelector::VisitAtomicExchange(Node* node) {
-  MipsOperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-  ArchOpcode opcode = kArchNop;
-  MachineType type = AtomicOpRepresentationOf(node->op());
-  if (type == MachineType::Int8()) {
-    opcode = kAtomicExchangeInt8;
-  } else if (type == MachineType::Uint8()) {
-    opcode = kAtomicExchangeUint8;
-  } else if (type == MachineType::Int16()) {
-    opcode = kAtomicExchangeInt16;
-  } else if (type == MachineType::Uint16()) {
-    opcode = kAtomicExchangeUint16;
-  } else if (type == MachineType::Int32() || type == MachineType::Uint32()) {
-    opcode = kAtomicExchangeWord32;
-  } else {
-    UNREACHABLE();
-    return;
-  }
-
-  AddressingMode addressing_mode = kMode_MRI;
-  InstructionOperand inputs[3];
-  size_t input_count = 0;
-  inputs[input_count++] = g.UseUniqueRegister(base);
-  inputs[input_count++] = g.UseUniqueRegister(index);
-  inputs[input_count++] = g.UseUniqueRegister(value);
-  InstructionOperand outputs[1];
-  outputs[0] = g.UseUniqueRegister(node);
-  InstructionOperand temp[3];
-  temp[0] = g.TempRegister();
-  temp[1] = g.TempRegister();
-  temp[2] = g.TempRegister();
-  InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
-  Emit(code, 1, outputs, input_count, inputs, 3, temp);
-}
-
-void InstructionSelector::VisitAtomicCompareExchange(Node* node) {
-  MipsOperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* old_value = node->InputAt(2);
-  Node* new_value = node->InputAt(3);
-  ArchOpcode opcode = kArchNop;
-  MachineType type = AtomicOpRepresentationOf(node->op());
-  if (type == MachineType::Int8()) {
-    opcode = kAtomicCompareExchangeInt8;
-  } else if (type == MachineType::Uint8()) {
-    opcode = kAtomicCompareExchangeUint8;
-  } else if (type == MachineType::Int16()) {
-    opcode = kAtomicCompareExchangeInt16;
-  } else if (type == MachineType::Uint16()) {
-    opcode = kAtomicCompareExchangeUint16;
-  } else if (type == MachineType::Int32() || type == MachineType::Uint32()) {
-    opcode = kAtomicCompareExchangeWord32;
-  } else {
-    UNREACHABLE();
-    return;
-  }
-
-  AddressingMode addressing_mode = kMode_MRI;
-  InstructionOperand inputs[4];
-  size_t input_count = 0;
-  inputs[input_count++] = g.UseUniqueRegister(base);
-  inputs[input_count++] = g.UseUniqueRegister(index);
-  inputs[input_count++] = g.UseUniqueRegister(old_value);
-  inputs[input_count++] = g.UseUniqueRegister(new_value);
-  InstructionOperand outputs[1];
-  outputs[0] = g.UseUniqueRegister(node);
-  InstructionOperand temp[3];
-  temp[0] = g.TempRegister();
-  temp[1] = g.TempRegister();
-  temp[2] = g.TempRegister();
-  InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
-  Emit(code, 1, outputs, input_count, inputs, 3, temp);
-}
-
-void InstructionSelector::VisitAtomicBinaryOperation(
-    Node* node, ArchOpcode int8_op, ArchOpcode uint8_op, ArchOpcode int16_op,
-    ArchOpcode uint16_op, ArchOpcode word32_op) {
-  MipsOperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-  ArchOpcode opcode = kArchNop;
-  MachineType type = AtomicOpRepresentationOf(node->op());
-  if (type == MachineType::Int8()) {
-    opcode = int8_op;
-  } else if (type == MachineType::Uint8()) {
-    opcode = uint8_op;
-  } else if (type == MachineType::Int16()) {
-    opcode = int16_op;
-  } else if (type == MachineType::Uint16()) {
-    opcode = uint16_op;
-  } else if (type == MachineType::Int32() || type == MachineType::Uint32()) {
-    opcode = word32_op;
-  } else {
-    UNREACHABLE();
-    return;
-  }
-
-  AddressingMode addressing_mode = kMode_MRI;
-  InstructionOperand inputs[3];
-  size_t input_count = 0;
-  inputs[input_count++] = g.UseUniqueRegister(base);
-  inputs[input_count++] = g.UseUniqueRegister(index);
-  inputs[input_count++] = g.UseUniqueRegister(value);
-  InstructionOperand outputs[1];
-  outputs[0] = g.UseUniqueRegister(node);
-  InstructionOperand temps[4];
-  temps[0] = g.TempRegister();
-  temps[1] = g.TempRegister();
-  temps[2] = g.TempRegister();
-  temps[3] = g.TempRegister();
-  InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
-  Emit(code, 1, outputs, input_count, inputs, 4, temps);
-}
-
-#define VISIT_ATOMIC_BINOP(op)                                              \
-  void InstructionSelector::VisitAtomic##op(Node* node) {                   \
-    VisitAtomicBinaryOperation(node, kAtomic##op##Int8, kAtomic##op##Uint8, \
-                               kAtomic##op##Int16, kAtomic##op##Uint16,     \
-                               kAtomic##op##Word32);                        \
-  }
-VISIT_ATOMIC_BINOP(Add)
-VISIT_ATOMIC_BINOP(Sub)
-VISIT_ATOMIC_BINOP(And)
-VISIT_ATOMIC_BINOP(Or)
-VISIT_ATOMIC_BINOP(Xor)
-#undef VISIT_ATOMIC_BINOP
-
-void InstructionSelector::VisitInt32AbsWithOverflow(Node* node) {
-  UNREACHABLE();
-}
-
-void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) {
-  UNREACHABLE();
-}
-
-void InstructionSelector::VisitSpeculationFence(Node* node) { UNREACHABLE(); }
-
-#define SIMD_TYPE_LIST(V) \
-  V(F32x4)                \
-  V(I32x4)                \
-  V(I16x8)                \
-  V(I8x16)
-
-#define SIMD_FORMAT_LIST(V) \
-  V(32x4)                   \
-  V(16x8)                   \
-  V(8x16)
-
-#define SIMD_UNOP_LIST(V)                                \
-  V(F32x4SConvertI32x4, kMipsF32x4SConvertI32x4)         \
-  V(F32x4UConvertI32x4, kMipsF32x4UConvertI32x4)         \
-  V(F32x4Abs, kMipsF32x4Abs)                             \
-  V(F32x4Neg, kMipsF32x4Neg)                             \
-  V(F32x4RecipApprox, kMipsF32x4RecipApprox)             \
-  V(F32x4RecipSqrtApprox, kMipsF32x4RecipSqrtApprox)     \
-  V(I32x4SConvertF32x4, kMipsI32x4SConvertF32x4)         \
-  V(I32x4UConvertF32x4, kMipsI32x4UConvertF32x4)         \
-  V(I32x4Neg, kMipsI32x4Neg)                             \
-  V(I32x4SConvertI16x8Low, kMipsI32x4SConvertI16x8Low)   \
-  V(I32x4SConvertI16x8High, kMipsI32x4SConvertI16x8High) \
-  V(I32x4UConvertI16x8Low, kMipsI32x4UConvertI16x8Low)   \
-  V(I32x4UConvertI16x8High, kMipsI32x4UConvertI16x8High) \
-  V(I16x8Neg, kMipsI16x8Neg)                             \
-  V(I16x8SConvertI8x16Low, kMipsI16x8SConvertI8x16Low)   \
-  V(I16x8SConvertI8x16High, kMipsI16x8SConvertI8x16High) \
-  V(I16x8UConvertI8x16Low, kMipsI16x8UConvertI8x16Low)   \
-  V(I16x8UConvertI8x16High, kMipsI16x8UConvertI8x16High) \
-  V(I8x16Neg, kMipsI8x16Neg)                             \
-  V(S128Not, kMipsS128Not)                               \
-  V(S1x4AnyTrue, kMipsS1x4AnyTrue)                       \
-  V(S1x4AllTrue, kMipsS1x4AllTrue)                       \
-  V(S1x8AnyTrue, kMipsS1x8AnyTrue)                       \
-  V(S1x8AllTrue, kMipsS1x8AllTrue)                       \
-  V(S1x16AnyTrue, kMipsS1x16AnyTrue)                     \
-  V(S1x16AllTrue, kMipsS1x16AllTrue)
-
-#define SIMD_SHIFT_OP_LIST(V) \
-  V(I32x4Shl)                 \
-  V(I32x4ShrS)                \
-  V(I32x4ShrU)                \
-  V(I16x8Shl)                 \
-  V(I16x8ShrS)                \
-  V(I16x8ShrU)                \
-  V(I8x16Shl)                 \
-  V(I8x16ShrS)                \
-  V(I8x16ShrU)
-
-#define SIMD_BINOP_LIST(V)                       \
-  V(F32x4Add, kMipsF32x4Add)                     \
-  V(F32x4AddHoriz, kMipsF32x4AddHoriz)           \
-  V(F32x4Sub, kMipsF32x4Sub)                     \
-  V(F32x4Mul, kMipsF32x4Mul)                     \
-  V(F32x4Max, kMipsF32x4Max)                     \
-  V(F32x4Min, kMipsF32x4Min)                     \
-  V(F32x4Eq, kMipsF32x4Eq)                       \
-  V(F32x4Ne, kMipsF32x4Ne)                       \
-  V(F32x4Lt, kMipsF32x4Lt)                       \
-  V(F32x4Le, kMipsF32x4Le)                       \
-  V(I32x4Add, kMipsI32x4Add)                     \
-  V(I32x4AddHoriz, kMipsI32x4AddHoriz)           \
-  V(I32x4Sub, kMipsI32x4Sub)                     \
-  V(I32x4Mul, kMipsI32x4Mul)                     \
-  V(I32x4MaxS, kMipsI32x4MaxS)                   \
-  V(I32x4MinS, kMipsI32x4MinS)                   \
-  V(I32x4MaxU, kMipsI32x4MaxU)                   \
-  V(I32x4MinU, kMipsI32x4MinU)                   \
-  V(I32x4Eq, kMipsI32x4Eq)                       \
-  V(I32x4Ne, kMipsI32x4Ne)                       \
-  V(I32x4GtS, kMipsI32x4GtS)                     \
-  V(I32x4GeS, kMipsI32x4GeS)                     \
-  V(I32x4GtU, kMipsI32x4GtU)                     \
-  V(I32x4GeU, kMipsI32x4GeU)                     \
-  V(I16x8Add, kMipsI16x8Add)                     \
-  V(I16x8AddSaturateS, kMipsI16x8AddSaturateS)   \
-  V(I16x8AddSaturateU, kMipsI16x8AddSaturateU)   \
-  V(I16x8AddHoriz, kMipsI16x8AddHoriz)           \
-  V(I16x8Sub, kMipsI16x8Sub)                     \
-  V(I16x8SubSaturateS, kMipsI16x8SubSaturateS)   \
-  V(I16x8SubSaturateU, kMipsI16x8SubSaturateU)   \
-  V(I16x8Mul, kMipsI16x8Mul)                     \
-  V(I16x8MaxS, kMipsI16x8MaxS)                   \
-  V(I16x8MinS, kMipsI16x8MinS)                   \
-  V(I16x8MaxU, kMipsI16x8MaxU)                   \
-  V(I16x8MinU, kMipsI16x8MinU)                   \
-  V(I16x8Eq, kMipsI16x8Eq)                       \
-  V(I16x8Ne, kMipsI16x8Ne)                       \
-  V(I16x8GtS, kMipsI16x8GtS)                     \
-  V(I16x8GeS, kMipsI16x8GeS)                     \
-  V(I16x8GtU, kMipsI16x8GtU)                     \
-  V(I16x8GeU, kMipsI16x8GeU)                     \
-  V(I16x8SConvertI32x4, kMipsI16x8SConvertI32x4) \
-  V(I16x8UConvertI32x4, kMipsI16x8UConvertI32x4) \
-  V(I8x16Add, kMipsI8x16Add)                     \
-  V(I8x16AddSaturateS, kMipsI8x16AddSaturateS)   \
-  V(I8x16AddSaturateU, kMipsI8x16AddSaturateU)   \
-  V(I8x16Sub, kMipsI8x16Sub)                     \
-  V(I8x16SubSaturateS, kMipsI8x16SubSaturateS)   \
-  V(I8x16SubSaturateU, kMipsI8x16SubSaturateU)   \
-  V(I8x16Mul, kMipsI8x16Mul)                     \
-  V(I8x16MaxS, kMipsI8x16MaxS)                   \
-  V(I8x16MinS, kMipsI8x16MinS)                   \
-  V(I8x16MaxU, kMipsI8x16MaxU)                   \
-  V(I8x16MinU, kMipsI8x16MinU)                   \
-  V(I8x16Eq, kMipsI8x16Eq)                       \
-  V(I8x16Ne, kMipsI8x16Ne)                       \
-  V(I8x16GtS, kMipsI8x16GtS)                     \
-  V(I8x16GeS, kMipsI8x16GeS)                     \
-  V(I8x16GtU, kMipsI8x16GtU)                     \
-  V(I8x16GeU, kMipsI8x16GeU)                     \
-  V(I8x16SConvertI16x8, kMipsI8x16SConvertI16x8) \
-  V(I8x16UConvertI16x8, kMipsI8x16UConvertI16x8) \
-  V(S128And, kMipsS128And)                       \
-  V(S128Or, kMipsS128Or)                         \
-  V(S128Xor, kMipsS128Xor)
-
-void InstructionSelector::VisitS128Zero(Node* node) {
-  MipsOperandGenerator g(this);
-  Emit(kMipsS128Zero, g.DefineSameAsFirst(node));
-}
-
-#define SIMD_VISIT_SPLAT(Type)                               \
-  void InstructionSelector::Visit##Type##Splat(Node* node) { \
-    VisitRR(this, kMips##Type##Splat, node);                 \
-  }
-SIMD_TYPE_LIST(SIMD_VISIT_SPLAT)
-#undef SIMD_VISIT_SPLAT
-
-#define SIMD_VISIT_EXTRACT_LANE(Type)                              \
-  void InstructionSelector::Visit##Type##ExtractLane(Node* node) { \
-    VisitRRI(this, kMips##Type##ExtractLane, node);                \
-  }
-SIMD_TYPE_LIST(SIMD_VISIT_EXTRACT_LANE)
-#undef SIMD_VISIT_EXTRACT_LANE
-
-#define SIMD_VISIT_REPLACE_LANE(Type)                              \
-  void InstructionSelector::Visit##Type##ReplaceLane(Node* node) { \
-    VisitRRIR(this, kMips##Type##ReplaceLane, node);               \
-  }
-SIMD_TYPE_LIST(SIMD_VISIT_REPLACE_LANE)
-#undef SIMD_VISIT_REPLACE_LANE
-
-#define SIMD_VISIT_UNOP(Name, instruction)            \
-  void InstructionSelector::Visit##Name(Node* node) { \
-    VisitRR(this, instruction, node);                 \
-  }
-SIMD_UNOP_LIST(SIMD_VISIT_UNOP)
-#undef SIMD_VISIT_UNOP
-
-#define SIMD_VISIT_SHIFT_OP(Name)                     \
-  void InstructionSelector::Visit##Name(Node* node) { \
-    VisitRRI(this, kMips##Name, node);                \
-  }
-SIMD_SHIFT_OP_LIST(SIMD_VISIT_SHIFT_OP)
-#undef SIMD_VISIT_SHIFT_OP
-
-#define SIMD_VISIT_BINOP(Name, instruction)           \
-  void InstructionSelector::Visit##Name(Node* node) { \
-    VisitRRR(this, instruction, node);                \
-  }
-SIMD_BINOP_LIST(SIMD_VISIT_BINOP)
-#undef SIMD_VISIT_BINOP
-
-void InstructionSelector::VisitS128Select(Node* node) {
-  VisitRRRR(this, kMipsS128Select, node);
-}
-
-namespace {
-
-struct ShuffleEntry {
-  uint8_t shuffle[kSimd128Size];
-  ArchOpcode opcode;
-};
-
-static const ShuffleEntry arch_shuffles[] = {
-    {{0, 1, 2, 3, 16, 17, 18, 19, 4, 5, 6, 7, 20, 21, 22, 23},
-     kMipsS32x4InterleaveRight},
-    {{8, 9, 10, 11, 24, 25, 26, 27, 12, 13, 14, 15, 28, 29, 30, 31},
-     kMipsS32x4InterleaveLeft},
-    {{0, 1, 2, 3, 8, 9, 10, 11, 16, 17, 18, 19, 24, 25, 26, 27},
-     kMipsS32x4PackEven},
-    {{4, 5, 6, 7, 12, 13, 14, 15, 20, 21, 22, 23, 28, 29, 30, 31},
-     kMipsS32x4PackOdd},
-    {{0, 1, 2, 3, 16, 17, 18, 19, 8, 9, 10, 11, 24, 25, 26, 27},
-     kMipsS32x4InterleaveEven},
-    {{4, 5, 6, 7, 20, 21, 22, 23, 12, 13, 14, 15, 28, 29, 30, 31},
-     kMipsS32x4InterleaveOdd},
-
-    {{0, 1, 16, 17, 2, 3, 18, 19, 4, 5, 20, 21, 6, 7, 22, 23},
-     kMipsS16x8InterleaveRight},
-    {{8, 9, 24, 25, 10, 11, 26, 27, 12, 13, 28, 29, 14, 15, 30, 31},
-     kMipsS16x8InterleaveLeft},
-    {{0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29},
-     kMipsS16x8PackEven},
-    {{2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31},
-     kMipsS16x8PackOdd},
-    {{0, 1, 16, 17, 4, 5, 20, 21, 8, 9, 24, 25, 12, 13, 28, 29},
-     kMipsS16x8InterleaveEven},
-    {{2, 3, 18, 19, 6, 7, 22, 23, 10, 11, 26, 27, 14, 15, 30, 31},
-     kMipsS16x8InterleaveOdd},
-    {{6, 7, 4, 5, 2, 3, 0, 1, 14, 15, 12, 13, 10, 11, 8, 9}, kMipsS16x4Reverse},
-    {{2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 8, 9, 14, 15, 12, 13}, kMipsS16x2Reverse},
-
-    {{0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7, 23},
-     kMipsS8x16InterleaveRight},
-    {{8, 24, 9, 25, 10, 26, 11, 27, 12, 28, 13, 29, 14, 30, 15, 31},
-     kMipsS8x16InterleaveLeft},
-    {{0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30},
-     kMipsS8x16PackEven},
-    {{1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31},
-     kMipsS8x16PackOdd},
-    {{0, 16, 2, 18, 4, 20, 6, 22, 8, 24, 10, 26, 12, 28, 14, 30},
-     kMipsS8x16InterleaveEven},
-    {{1, 17, 3, 19, 5, 21, 7, 23, 9, 25, 11, 27, 13, 29, 15, 31},
-     kMipsS8x16InterleaveOdd},
-    {{7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8}, kMipsS8x8Reverse},
-    {{3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12}, kMipsS8x4Reverse},
-    {{1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14}, kMipsS8x2Reverse}};
-
-bool TryMatchArchShuffle(const uint8_t* shuffle, const ShuffleEntry* table,
-                         size_t num_entries, uint8_t mask, ArchOpcode* opcode) {
-  for (size_t i = 0; i < num_entries; ++i) {
-    const ShuffleEntry& entry = table[i];
-    int j = 0;
-    for (; j < kSimd128Size; ++j) {
-      if ((entry.shuffle[j] & mask) != (shuffle[j] & mask)) {
-        break;
-      }
-    }
-    if (j == kSimd128Size) {
-      *opcode = entry.opcode;
-      return true;
-    }
-  }
-  return false;
-}
-
-}  // namespace
-
-void InstructionSelector::VisitS8x16Shuffle(Node* node) {
-  const uint8_t* shuffle = OpParameter<uint8_t*>(node);
-  uint8_t mask = CanonicalizeShuffle(node);
-  uint8_t shuffle32x4[4];
-  ArchOpcode opcode;
-  if (TryMatchArchShuffle(shuffle, arch_shuffles, arraysize(arch_shuffles),
-                          mask, &opcode)) {
-    VisitRRR(this, opcode, node);
-    return;
-  }
-  uint8_t offset;
-  MipsOperandGenerator g(this);
-  if (TryMatchConcat(shuffle, mask, &offset)) {
-    Emit(kMipsS8x16Concat, g.DefineSameAsFirst(node),
-         g.UseRegister(node->InputAt(1)), g.UseRegister(node->InputAt(0)),
-         g.UseImmediate(offset));
-    return;
-  }
-  if (TryMatch32x4Shuffle(shuffle, shuffle32x4)) {
-    Emit(kMipsS32x4Shuffle, g.DefineAsRegister(node),
-         g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)),
-         g.UseImmediate(Pack4Lanes(shuffle32x4, mask)));
-    return;
-  }
-  Emit(kMipsS8x16Shuffle, g.DefineAsRegister(node),
-       g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)),
-       g.UseImmediate(Pack4Lanes(shuffle, mask)),
-       g.UseImmediate(Pack4Lanes(shuffle + 4, mask)),
-       g.UseImmediate(Pack4Lanes(shuffle + 8, mask)),
-       g.UseImmediate(Pack4Lanes(shuffle + 12, mask)));
-}
-
-// static
-MachineOperatorBuilder::Flags
-InstructionSelector::SupportedMachineOperatorFlags() {
-  MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags;
-  if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) &&
-      IsFp64Mode()) {
-    flags |= MachineOperatorBuilder::kFloat64RoundDown |
-             MachineOperatorBuilder::kFloat64RoundUp |
-             MachineOperatorBuilder::kFloat64RoundTruncate |
-             MachineOperatorBuilder::kFloat64RoundTiesEven;
-  }
-
-  return flags | MachineOperatorBuilder::kWord32Ctz |
-         MachineOperatorBuilder::kWord32Popcnt |
-         MachineOperatorBuilder::kInt32DivIsSafe |
-         MachineOperatorBuilder::kUint32DivIsSafe |
-         MachineOperatorBuilder::kWord32ShiftIsSafe |
-         MachineOperatorBuilder::kFloat32RoundDown |
-         MachineOperatorBuilder::kFloat32RoundUp |
-         MachineOperatorBuilder::kFloat32RoundTruncate |
-         MachineOperatorBuilder::kFloat32RoundTiesEven |
-         MachineOperatorBuilder::kWord32ReverseBytes |
-         MachineOperatorBuilder::kWord64ReverseBytes;
-}
-
-// static
-MachineOperatorBuilder::AlignmentRequirements
-InstructionSelector::AlignmentRequirements() {
-  if (IsMipsArchVariant(kMips32r6)) {
-    return MachineOperatorBuilder::AlignmentRequirements::
-        FullUnalignedAccessSupport();
-  } else {
-    DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) ||
-           IsMipsArchVariant(kMips32r2));
-    return MachineOperatorBuilder::AlignmentRequirements::
-        NoUnalignedAccessSupport();
-  }
-}
-
-#undef SIMD_BINOP_LIST
-#undef SIMD_SHIFT_OP_LIST
-#undef SIMD_UNOP_LIST
-#undef SIMD_TYPE_LIST
-#undef SIMD_FORMAT_LIST
-#undef TRACE_UNIMPL
-#undef TRACE
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/mips64/code-generator-mips64.cc b/src/v8/src/compiler/mips64/code-generator-mips64.cc
deleted file mode 100644
index d446300..0000000
--- a/src/v8/src/compiler/mips64/code-generator-mips64.cc
+++ /dev/null
@@ -1,3874 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/assembler-inl.h"
-#include "src/callable.h"
-#include "src/compilation-info.h"
-#include "src/compiler/code-generator-impl.h"
-#include "src/compiler/code-generator.h"
-#include "src/compiler/gap-resolver.h"
-#include "src/compiler/node-matchers.h"
-#include "src/compiler/osr.h"
-#include "src/heap/heap-inl.h"
-#include "src/mips64/macro-assembler-mips64.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-#define __ tasm()->
-
-// TODO(plind): Possibly avoid using these lithium names.
-#define kScratchReg kLithiumScratchReg
-#define kScratchReg2 kLithiumScratchReg2
-#define kScratchDoubleReg kLithiumScratchDouble
-
-
-// TODO(plind): consider renaming these macros.
-#define TRACE_MSG(msg)                                                      \
-  PrintF("code_gen: \'%s\' in function %s at line %d\n", msg, __FUNCTION__, \
-         __LINE__)
-
-#define TRACE_UNIMPL()                                                       \
-  PrintF("UNIMPLEMENTED code_generator_mips: %s at line %d\n", __FUNCTION__, \
-         __LINE__)
-
-
-// Adds Mips-specific methods to convert InstructionOperands.
-class MipsOperandConverter final : public InstructionOperandConverter {
- public:
-  MipsOperandConverter(CodeGenerator* gen, Instruction* instr)
-      : InstructionOperandConverter(gen, instr) {}
-
-  FloatRegister OutputSingleRegister(size_t index = 0) {
-    return ToSingleRegister(instr_->OutputAt(index));
-  }
-
-  FloatRegister InputSingleRegister(size_t index) {
-    return ToSingleRegister(instr_->InputAt(index));
-  }
-
-  FloatRegister ToSingleRegister(InstructionOperand* op) {
-    // Single (Float) and Double register namespace is same on MIPS,
-    // both are typedefs of FPURegister.
-    return ToDoubleRegister(op);
-  }
-
-  Register InputOrZeroRegister(size_t index) {
-    if (instr_->InputAt(index)->IsImmediate()) {
-      DCHECK_EQ(0, InputInt32(index));
-      return zero_reg;
-    }
-    return InputRegister(index);
-  }
-
-  DoubleRegister InputOrZeroDoubleRegister(size_t index) {
-    if (instr_->InputAt(index)->IsImmediate()) return kDoubleRegZero;
-
-    return InputDoubleRegister(index);
-  }
-
-  DoubleRegister InputOrZeroSingleRegister(size_t index) {
-    if (instr_->InputAt(index)->IsImmediate()) return kDoubleRegZero;
-
-    return InputSingleRegister(index);
-  }
-
-  Operand InputImmediate(size_t index) {
-    Constant constant = ToConstant(instr_->InputAt(index));
-    switch (constant.type()) {
-      case Constant::kInt32:
-        return Operand(constant.ToInt32());
-      case Constant::kInt64:
-        return Operand(constant.ToInt64());
-      case Constant::kFloat32:
-        return Operand::EmbeddedNumber(constant.ToFloat32());
-      case Constant::kFloat64:
-        return Operand::EmbeddedNumber(constant.ToFloat64().value());
-      case Constant::kExternalReference:
-      case Constant::kHeapObject:
-        // TODO(plind): Maybe we should handle ExtRef & HeapObj here?
-        //    maybe not done on arm due to const pool ??
-        break;
-      case Constant::kRpoNumber:
-        UNREACHABLE();  // TODO(titzer): RPO immediates on mips?
-        break;
-    }
-    UNREACHABLE();
-  }
-
-  Operand InputOperand(size_t index) {
-    InstructionOperand* op = instr_->InputAt(index);
-    if (op->IsRegister()) {
-      return Operand(ToRegister(op));
-    }
-    return InputImmediate(index);
-  }
-
-  MemOperand MemoryOperand(size_t* first_index) {
-    const size_t index = *first_index;
-    switch (AddressingModeField::decode(instr_->opcode())) {
-      case kMode_None:
-        break;
-      case kMode_MRI:
-        *first_index += 2;
-        return MemOperand(InputRegister(index + 0), InputInt32(index + 1));
-      case kMode_MRR:
-        // TODO(plind): r6 address mode, to be implemented ...
-        UNREACHABLE();
-    }
-    UNREACHABLE();
-  }
-
-  MemOperand MemoryOperand(size_t index = 0) { return MemoryOperand(&index); }
-
-  MemOperand ToMemOperand(InstructionOperand* op) const {
-    DCHECK_NOT_NULL(op);
-    DCHECK(op->IsStackSlot() || op->IsFPStackSlot());
-    return SlotToMemOperand(AllocatedOperand::cast(op)->index());
-  }
-
-  MemOperand SlotToMemOperand(int slot) const {
-    FrameOffset offset = frame_access_state()->GetFrameOffset(slot);
-    return MemOperand(offset.from_stack_pointer() ? sp : fp, offset.offset());
-  }
-};
-
-
-static inline bool HasRegisterInput(Instruction* instr, size_t index) {
-  return instr->InputAt(index)->IsRegister();
-}
-
-
-namespace {
-
-class OutOfLineRound : public OutOfLineCode {
- public:
-  OutOfLineRound(CodeGenerator* gen, DoubleRegister result)
-      : OutOfLineCode(gen), result_(result) {}
-
-  void Generate() final {
-    // Handle rounding to zero case where sign has to be preserved.
-    // High bits of double input already in kScratchReg.
-    __ dsrl(at, kScratchReg, 31);
-    __ dsll(at, at, 31);
-    __ mthc1(at, result_);
-  }
-
- private:
-  DoubleRegister const result_;
-};
-
-
-class OutOfLineRound32 : public OutOfLineCode {
- public:
-  OutOfLineRound32(CodeGenerator* gen, DoubleRegister result)
-      : OutOfLineCode(gen), result_(result) {}
-
-  void Generate() final {
-    // Handle rounding to zero case where sign has to be preserved.
-    // High bits of float input already in kScratchReg.
-    __ srl(at, kScratchReg, 31);
-    __ sll(at, at, 31);
-    __ mtc1(at, result_);
-  }
-
- private:
-  DoubleRegister const result_;
-};
-
-
-class OutOfLineRecordWrite final : public OutOfLineCode {
- public:
-  OutOfLineRecordWrite(CodeGenerator* gen, Register object, Register index,
-                       Register value, Register scratch0, Register scratch1,
-                       RecordWriteMode mode)
-      : OutOfLineCode(gen),
-        object_(object),
-        index_(index),
-        value_(value),
-        scratch0_(scratch0),
-        scratch1_(scratch1),
-        mode_(mode),
-        must_save_lr_(!gen->frame_access_state()->has_frame()),
-        zone_(gen->zone()) {}
-
-  void SaveRegisters(RegList registers) {
-    DCHECK_LT(0, NumRegs(registers));
-    RegList regs = 0;
-    for (int i = 0; i < Register::kNumRegisters; ++i) {
-      if ((registers >> i) & 1u) {
-        regs |= Register::from_code(i).bit();
-      }
-    }
-    __ MultiPush(regs | ra.bit());
-  }
-
-  void RestoreRegisters(RegList registers) {
-    DCHECK_LT(0, NumRegs(registers));
-    RegList regs = 0;
-    for (int i = 0; i < Register::kNumRegisters; ++i) {
-      if ((registers >> i) & 1u) {
-        regs |= Register::from_code(i).bit();
-      }
-    }
-    __ MultiPop(regs | ra.bit());
-  }
-
-  void Generate() final {
-    if (mode_ > RecordWriteMode::kValueIsPointer) {
-      __ JumpIfSmi(value_, exit());
-    }
-    __ CheckPageFlag(value_, scratch0_,
-                     MemoryChunk::kPointersToHereAreInterestingMask, eq,
-                     exit());
-    __ Daddu(scratch1_, object_, index_);
-    RememberedSetAction const remembered_set_action =
-        mode_ > RecordWriteMode::kValueIsMap ? EMIT_REMEMBERED_SET
-                                             : OMIT_REMEMBERED_SET;
-    SaveFPRegsMode const save_fp_mode =
-        frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
-    if (must_save_lr_) {
-      // We need to save and restore ra if the frame was elided.
-      __ Push(ra);
-    }
-    __ CallRecordWriteStub(object_, scratch1_, remembered_set_action,
-                           save_fp_mode);
-    if (must_save_lr_) {
-      __ Pop(ra);
-    }
-  }
-
- private:
-  Register const object_;
-  Register const index_;
-  Register const value_;
-  Register const scratch0_;
-  Register const scratch1_;
-  RecordWriteMode const mode_;
-  bool must_save_lr_;
-  Zone* zone_;
-};
-
-#define CREATE_OOL_CLASS(ool_name, tasm_ool_name, T)                 \
-  class ool_name final : public OutOfLineCode {                      \
-   public:                                                           \
-    ool_name(CodeGenerator* gen, T dst, T src1, T src2)              \
-        : OutOfLineCode(gen), dst_(dst), src1_(src1), src2_(src2) {} \
-                                                                     \
-    void Generate() final { __ tasm_ool_name(dst_, src1_, src2_); }  \
-                                                                     \
-   private:                                                          \
-    T const dst_;                                                    \
-    T const src1_;                                                   \
-    T const src2_;                                                   \
-  }
-
-CREATE_OOL_CLASS(OutOfLineFloat32Max, Float32MaxOutOfLine, FPURegister);
-CREATE_OOL_CLASS(OutOfLineFloat32Min, Float32MinOutOfLine, FPURegister);
-CREATE_OOL_CLASS(OutOfLineFloat64Max, Float64MaxOutOfLine, FPURegister);
-CREATE_OOL_CLASS(OutOfLineFloat64Min, Float64MinOutOfLine, FPURegister);
-
-#undef CREATE_OOL_CLASS
-
-Condition FlagsConditionToConditionCmp(FlagsCondition condition) {
-  switch (condition) {
-    case kEqual:
-      return eq;
-    case kNotEqual:
-      return ne;
-    case kSignedLessThan:
-      return lt;
-    case kSignedGreaterThanOrEqual:
-      return ge;
-    case kSignedLessThanOrEqual:
-      return le;
-    case kSignedGreaterThan:
-      return gt;
-    case kUnsignedLessThan:
-      return lo;
-    case kUnsignedGreaterThanOrEqual:
-      return hs;
-    case kUnsignedLessThanOrEqual:
-      return ls;
-    case kUnsignedGreaterThan:
-      return hi;
-    case kUnorderedEqual:
-    case kUnorderedNotEqual:
-      break;
-    default:
-      break;
-  }
-  UNREACHABLE();
-}
-
-
-Condition FlagsConditionToConditionTst(FlagsCondition condition) {
-  switch (condition) {
-    case kNotEqual:
-      return ne;
-    case kEqual:
-      return eq;
-    default:
-      break;
-  }
-  UNREACHABLE();
-}
-
-
-Condition FlagsConditionToConditionOvf(FlagsCondition condition) {
-  switch (condition) {
-    case kOverflow:
-      return ne;
-    case kNotOverflow:
-      return eq;
-    default:
-      break;
-  }
-  UNREACHABLE();
-}
-
-
-FPUCondition FlagsConditionToConditionCmpFPU(bool& predicate,
-                                             FlagsCondition condition) {
-  switch (condition) {
-    case kEqual:
-      predicate = true;
-      return EQ;
-    case kNotEqual:
-      predicate = false;
-      return EQ;
-    case kUnsignedLessThan:
-      predicate = true;
-      return OLT;
-    case kUnsignedGreaterThanOrEqual:
-      predicate = false;
-      return ULT;
-    case kUnsignedLessThanOrEqual:
-      predicate = true;
-      return OLE;
-    case kUnsignedGreaterThan:
-      predicate = false;
-      return ULE;
-    case kUnorderedEqual:
-    case kUnorderedNotEqual:
-      predicate = true;
-      break;
-    default:
-      predicate = true;
-      break;
-  }
-  UNREACHABLE();
-}
-
-}  // namespace
-
-#define ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(mode)                                  \
-  if (kArchVariant == kMips64r6) {                                             \
-    __ cfc1(kScratchReg, FCSR);                                                \
-    __ li(at, Operand(mode_##mode));                                           \
-    __ ctc1(at, FCSR);                                                         \
-    __ rint_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0));             \
-    __ ctc1(kScratchReg, FCSR);                                                \
-  } else {                                                                     \
-    auto ool = new (zone()) OutOfLineRound(this, i.OutputDoubleRegister());    \
-    Label done;                                                                \
-    __ mfhc1(kScratchReg, i.InputDoubleRegister(0));                           \
-    __ Ext(at, kScratchReg, HeapNumber::kExponentShift,                        \
-           HeapNumber::kExponentBits);                                         \
-    __ Branch(USE_DELAY_SLOT, &done, hs, at,                                   \
-              Operand(HeapNumber::kExponentBias + HeapNumber::kMantissaBits)); \
-    __ mov_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0));              \
-    __ mode##_l_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0));         \
-    __ dmfc1(at, i.OutputDoubleRegister());                                    \
-    __ Branch(USE_DELAY_SLOT, ool->entry(), eq, at, Operand(zero_reg));        \
-    __ cvt_d_l(i.OutputDoubleRegister(), i.OutputDoubleRegister());            \
-    __ bind(ool->exit());                                                      \
-    __ bind(&done);                                                            \
-  }
-
-#define ASSEMBLE_ROUND_FLOAT_TO_FLOAT(mode)                                   \
-  if (kArchVariant == kMips64r6) {                                            \
-    __ cfc1(kScratchReg, FCSR);                                               \
-    __ li(at, Operand(mode_##mode));                                          \
-    __ ctc1(at, FCSR);                                                        \
-    __ rint_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0));            \
-    __ ctc1(kScratchReg, FCSR);                                               \
-  } else {                                                                    \
-    int32_t kFloat32ExponentBias = 127;                                       \
-    int32_t kFloat32MantissaBits = 23;                                        \
-    int32_t kFloat32ExponentBits = 8;                                         \
-    auto ool = new (zone()) OutOfLineRound32(this, i.OutputDoubleRegister()); \
-    Label done;                                                               \
-    __ mfc1(kScratchReg, i.InputDoubleRegister(0));                           \
-    __ Ext(at, kScratchReg, kFloat32MantissaBits, kFloat32ExponentBits);      \
-    __ Branch(USE_DELAY_SLOT, &done, hs, at,                                  \
-              Operand(kFloat32ExponentBias + kFloat32MantissaBits));          \
-    __ mov_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0));             \
-    __ mode##_w_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0));        \
-    __ mfc1(at, i.OutputDoubleRegister());                                    \
-    __ Branch(USE_DELAY_SLOT, ool->entry(), eq, at, Operand(zero_reg));       \
-    __ cvt_s_w(i.OutputDoubleRegister(), i.OutputDoubleRegister());           \
-    __ bind(ool->exit());                                                     \
-    __ bind(&done);                                                           \
-  }
-
-#define ASSEMBLE_ATOMIC_LOAD_INTEGER(asm_instr)          \
-  do {                                                   \
-    __ asm_instr(i.OutputRegister(), i.MemoryOperand()); \
-    __ sync();                                           \
-  } while (0)
-
-#define ASSEMBLE_ATOMIC_STORE_INTEGER(asm_instr)               \
-  do {                                                         \
-    __ sync();                                                 \
-    __ asm_instr(i.InputOrZeroRegister(2), i.MemoryOperand()); \
-    __ sync();                                                 \
-  } while (0)
-
-#define ASSEMBLE_ATOMIC_BINOP(bin_instr)                                 \
-  do {                                                                   \
-    Label binop;                                                         \
-    __ Daddu(i.TempRegister(0), i.InputRegister(0), i.InputRegister(1)); \
-    __ sync();                                                           \
-    __ bind(&binop);                                                     \
-    __ Ll(i.OutputRegister(0), MemOperand(i.TempRegister(0), 0));        \
-    __ bin_instr(i.TempRegister(1), i.OutputRegister(0),                 \
-                 Operand(i.InputRegister(2)));                           \
-    __ Sc(i.TempRegister(1), MemOperand(i.TempRegister(0), 0));          \
-    __ BranchShort(&binop, eq, i.TempRegister(1), Operand(zero_reg));    \
-    __ sync();                                                           \
-  } while (0)
-
-#define ASSEMBLE_ATOMIC_BINOP_EXT(sign_extend, size, bin_instr)               \
-  do {                                                                        \
-    Label binop;                                                              \
-    __ daddu(i.TempRegister(0), i.InputRegister(0), i.InputRegister(1));      \
-    __ andi(i.TempRegister(3), i.TempRegister(0), 0x3);                       \
-    __ Dsubu(i.TempRegister(0), i.TempRegister(0),                            \
-             Operand(i.TempRegister(3)));                                     \
-    __ sll(i.TempRegister(3), i.TempRegister(3), 3);                          \
-    __ sync();                                                                \
-    __ bind(&binop);                                                          \
-    __ Ll(i.TempRegister(1), MemOperand(i.TempRegister(0), 0));               \
-    __ ExtractBits(i.OutputRegister(0), i.TempRegister(1), i.TempRegister(3), \
-                   size, sign_extend);                                        \
-    __ bin_instr(i.TempRegister(2), i.OutputRegister(0),                      \
-                 Operand(i.InputRegister(2)));                                \
-    __ InsertBits(i.TempRegister(1), i.TempRegister(2), i.TempRegister(3),    \
-                  size);                                                      \
-    __ Sc(i.TempRegister(1), MemOperand(i.TempRegister(0), 0));               \
-    __ BranchShort(&binop, eq, i.TempRegister(1), Operand(zero_reg));         \
-    __ sync();                                                                \
-  } while (0)
-
-#define ASSEMBLE_ATOMIC_EXCHANGE_INTEGER()                               \
-  do {                                                                   \
-    Label exchange;                                                      \
-    __ sync();                                                           \
-    __ bind(&exchange);                                                  \
-    __ daddu(i.TempRegister(0), i.InputRegister(0), i.InputRegister(1)); \
-    __ Ll(i.OutputRegister(0), MemOperand(i.TempRegister(0), 0));        \
-    __ mov(i.TempRegister(1), i.InputRegister(2));                       \
-    __ Sc(i.TempRegister(1), MemOperand(i.TempRegister(0), 0));          \
-    __ BranchShort(&exchange, eq, i.TempRegister(1), Operand(zero_reg)); \
-    __ sync();                                                           \
-  } while (0)
-
-#define ASSEMBLE_ATOMIC_EXCHANGE_INTEGER_EXT(sign_extend, size)               \
-  do {                                                                        \
-    Label exchange;                                                           \
-    __ daddu(i.TempRegister(0), i.InputRegister(0), i.InputRegister(1));      \
-    __ andi(i.TempRegister(1), i.TempRegister(0), 0x3);                       \
-    __ Dsubu(i.TempRegister(0), i.TempRegister(0),                            \
-             Operand(i.TempRegister(1)));                                     \
-    __ sll(i.TempRegister(1), i.TempRegister(1), 3);                          \
-    __ sync();                                                                \
-    __ bind(&exchange);                                                       \
-    __ Ll(i.TempRegister(2), MemOperand(i.TempRegister(0), 0));               \
-    __ ExtractBits(i.OutputRegister(0), i.TempRegister(2), i.TempRegister(1), \
-                   size, sign_extend);                                        \
-    __ InsertBits(i.TempRegister(2), i.InputRegister(2), i.TempRegister(1),   \
-                  size);                                                      \
-    __ Sc(i.TempRegister(2), MemOperand(i.TempRegister(0), 0));               \
-    __ BranchShort(&exchange, eq, i.TempRegister(2), Operand(zero_reg));      \
-    __ sync();                                                                \
-  } while (0)
-
-#define ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER()                       \
-  do {                                                                   \
-    Label compareExchange;                                               \
-    Label exit;                                                          \
-    __ daddu(i.TempRegister(0), i.InputRegister(0), i.InputRegister(1)); \
-    __ sync();                                                           \
-    __ bind(&compareExchange);                                           \
-    __ Ll(i.OutputRegister(0), MemOperand(i.TempRegister(0), 0));        \
-    __ BranchShort(&exit, ne, i.InputRegister(2),                        \
-                   Operand(i.OutputRegister(0)));                        \
-    __ mov(i.TempRegister(2), i.InputRegister(3));                       \
-    __ Sc(i.TempRegister(2), MemOperand(i.TempRegister(0), 0));          \
-    __ BranchShort(&compareExchange, eq, i.TempRegister(2),              \
-                   Operand(zero_reg));                                   \
-    __ bind(&exit);                                                      \
-    __ sync();                                                           \
-  } while (0)
-
-#define ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER_EXT(sign_extend, size)       \
-  do {                                                                        \
-    Label compareExchange;                                                    \
-    Label exit;                                                               \
-    __ daddu(i.TempRegister(0), i.InputRegister(0), i.InputRegister(1));      \
-    __ andi(i.TempRegister(1), i.TempRegister(0), 0x3);                       \
-    __ Dsubu(i.TempRegister(0), i.TempRegister(0),                            \
-             Operand(i.TempRegister(1)));                                     \
-    __ sll(i.TempRegister(1), i.TempRegister(1), 3);                          \
-    __ sync();                                                                \
-    __ bind(&compareExchange);                                                \
-    __ Ll(i.TempRegister(2), MemOperand(i.TempRegister(0), 0));               \
-    __ ExtractBits(i.OutputRegister(0), i.TempRegister(2), i.TempRegister(1), \
-                   size, sign_extend);                                        \
-    __ BranchShort(&exit, ne, i.InputRegister(2),                             \
-                   Operand(i.OutputRegister(0)));                             \
-    __ InsertBits(i.TempRegister(2), i.InputRegister(3), i.TempRegister(1),   \
-                  size);                                                      \
-    __ Sc(i.TempRegister(2), MemOperand(i.TempRegister(0), 0));               \
-    __ BranchShort(&compareExchange, eq, i.TempRegister(2),                   \
-                   Operand(zero_reg));                                        \
-    __ bind(&exit);                                                           \
-    __ sync();                                                                \
-  } while (0)
-
-#define ASSEMBLE_IEEE754_BINOP(name)                                        \
-  do {                                                                      \
-    FrameScope scope(tasm(), StackFrame::MANUAL);                           \
-    __ PrepareCallCFunction(0, 2, kScratchReg);                             \
-    __ MovToFloatParameters(i.InputDoubleRegister(0),                       \
-                            i.InputDoubleRegister(1));                      \
-    __ CallCFunction(                                                       \
-        ExternalReference::ieee754_##name##_function(tasm()->isolate()), 0, \
-        2);                                                                 \
-    /* Move the result in the double result register. */                    \
-    __ MovFromFloatResult(i.OutputDoubleRegister());                        \
-  } while (0)
-
-#define ASSEMBLE_IEEE754_UNOP(name)                                         \
-  do {                                                                      \
-    FrameScope scope(tasm(), StackFrame::MANUAL);                           \
-    __ PrepareCallCFunction(0, 1, kScratchReg);                             \
-    __ MovToFloatParameter(i.InputDoubleRegister(0));                       \
-    __ CallCFunction(                                                       \
-        ExternalReference::ieee754_##name##_function(tasm()->isolate()), 0, \
-        1);                                                                 \
-    /* Move the result in the double result register. */                    \
-    __ MovFromFloatResult(i.OutputDoubleRegister());                        \
-  } while (0)
-
-void CodeGenerator::AssembleDeconstructFrame() {
-  __ mov(sp, fp);
-  __ Pop(ra, fp);
-}
-
-void CodeGenerator::AssemblePrepareTailCall() {
-  if (frame_access_state()->has_frame()) {
-    __ Ld(ra, MemOperand(fp, StandardFrameConstants::kCallerPCOffset));
-    __ Ld(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
-  }
-  frame_access_state()->SetFrameAccessToSP();
-}
-
-void CodeGenerator::AssemblePopArgumentsAdaptorFrame(Register args_reg,
-                                                     Register scratch1,
-                                                     Register scratch2,
-                                                     Register scratch3) {
-  DCHECK(!AreAliased(args_reg, scratch1, scratch2, scratch3));
-  Label done;
-
-  // Check if current frame is an arguments adaptor frame.
-  __ Ld(scratch3, MemOperand(fp, StandardFrameConstants::kContextOffset));
-  __ Branch(&done, ne, scratch3,
-            Operand(StackFrame::TypeToMarker(StackFrame::ARGUMENTS_ADAPTOR)));
-
-  // Load arguments count from current arguments adaptor frame (note, it
-  // does not include receiver).
-  Register caller_args_count_reg = scratch1;
-  __ Ld(caller_args_count_reg,
-        MemOperand(fp, ArgumentsAdaptorFrameConstants::kLengthOffset));
-  __ SmiUntag(caller_args_count_reg);
-
-  ParameterCount callee_args_count(args_reg);
-  __ PrepareForTailCall(callee_args_count, caller_args_count_reg, scratch2,
-                        scratch3);
-  __ bind(&done);
-}
-
-namespace {
-
-void AdjustStackPointerForTailCall(TurboAssembler* tasm,
-                                   FrameAccessState* state,
-                                   int new_slot_above_sp,
-                                   bool allow_shrinkage = true) {
-  int current_sp_offset = state->GetSPToFPSlotCount() +
-                          StandardFrameConstants::kFixedSlotCountAboveFp;
-  int stack_slot_delta = new_slot_above_sp - current_sp_offset;
-  if (stack_slot_delta > 0) {
-    tasm->Dsubu(sp, sp, stack_slot_delta * kPointerSize);
-    state->IncreaseSPDelta(stack_slot_delta);
-  } else if (allow_shrinkage && stack_slot_delta < 0) {
-    tasm->Daddu(sp, sp, -stack_slot_delta * kPointerSize);
-    state->IncreaseSPDelta(stack_slot_delta);
-  }
-}
-
-}  // namespace
-
-void CodeGenerator::AssembleTailCallBeforeGap(Instruction* instr,
-                                              int first_unused_stack_slot) {
-  AdjustStackPointerForTailCall(tasm(), frame_access_state(),
-                                first_unused_stack_slot, false);
-}
-
-void CodeGenerator::AssembleTailCallAfterGap(Instruction* instr,
-                                             int first_unused_stack_slot) {
-  AdjustStackPointerForTailCall(tasm(), frame_access_state(),
-                                first_unused_stack_slot);
-}
-
-// Check if the code object is marked for deoptimization. If it is, then it
-// jumps to the CompileLazyDeoptimizedCode builtin. In order to do this we need
-// to:
-//    1. load the address of the current instruction;
-//    2. read from memory the word that contains that bit, which can be found in
-//       the flags in the referenced {CodeDataContainer} object;
-//    3. test kMarkedForDeoptimizationBit in those flags; and
-//    4. if it is not zero then it jumps to the builtin.
-void CodeGenerator::BailoutIfDeoptimized() {
-  Label current;
-  // This push on ra and the pop below together ensure that we restore the
-  // register ra, which is needed while computing frames for deoptimization.
-  __ push(ra);
-  // The bal instruction puts the address of the current instruction into
-  // the return address (ra) register, which we can use later on.
-  __ bal(&current);
-  __ nop();
-  int pc = __ pc_offset();
-  __ bind(&current);
-  int offset = Code::kCodeDataContainerOffset - (Code::kHeaderSize + pc);
-  __ Ld(a2, MemOperand(ra, offset));
-  __ pop(ra);
-  __ Lw(a2, FieldMemOperand(a2, CodeDataContainer::kKindSpecificFlagsOffset));
-  __ And(a2, a2, Operand(1 << Code::kMarkedForDeoptimizationBit));
-  Handle<Code> code = isolate()->builtins()->builtin_handle(
-      Builtins::kCompileLazyDeoptimizedCode);
-  __ Jump(code, RelocInfo::CODE_TARGET, ne, a2, Operand(zero_reg));
-}
-
-// Assembles an instruction after register allocation, producing machine code.
-CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
-    Instruction* instr) {
-  MipsOperandConverter i(this, instr);
-  InstructionCode opcode = instr->opcode();
-  ArchOpcode arch_opcode = ArchOpcodeField::decode(opcode);
-  switch (arch_opcode) {
-    case kArchCallCodeObject: {
-      if (instr->InputAt(0)->IsImmediate()) {
-        __ Call(i.InputCode(0), RelocInfo::CODE_TARGET);
-      } else {
-        __ daddiu(at, i.InputRegister(0), Code::kHeaderSize - kHeapObjectTag);
-        __ Call(at);
-      }
-      RecordCallPosition(instr);
-      frame_access_state()->ClearSPDelta();
-      break;
-    }
-    case kArchCallWasmFunction: {
-      if (arch_opcode == kArchTailCallCodeObjectFromJSFunction) {
-        AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister,
-                                         i.TempRegister(0), i.TempRegister(1),
-                                         i.TempRegister(2));
-      }
-      if (instr->InputAt(0)->IsImmediate()) {
-        Address wasm_code = reinterpret_cast<Address>(
-            i.ToConstant(instr->InputAt(0)).ToInt64());
-        __ Call(wasm_code, info()->IsWasm() ? RelocInfo::WASM_CALL
-                                            : RelocInfo::JS_TO_WASM_CALL);
-      } else {
-        __ daddiu(at, i.InputRegister(0), 0);
-        __ Call(at);
-      }
-      RecordCallPosition(instr);
-      frame_access_state()->ClearSPDelta();
-      break;
-    }
-    case kArchTailCallCodeObjectFromJSFunction:
-    case kArchTailCallCodeObject: {
-      if (arch_opcode == kArchTailCallCodeObjectFromJSFunction) {
-        AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister,
-                                         i.TempRegister(0), i.TempRegister(1),
-                                         i.TempRegister(2));
-      }
-      if (instr->InputAt(0)->IsImmediate()) {
-        __ Jump(i.InputCode(0), RelocInfo::CODE_TARGET);
-      } else {
-        __ daddiu(at, i.InputRegister(0), Code::kHeaderSize - kHeapObjectTag);
-        __ Jump(at);
-      }
-      frame_access_state()->ClearSPDelta();
-      frame_access_state()->SetFrameAccessToDefault();
-      break;
-    }
-    case kArchTailCallWasm: {
-      if (instr->InputAt(0)->IsImmediate()) {
-        Address wasm_code = reinterpret_cast<Address>(
-            i.ToConstant(instr->InputAt(0)).ToInt64());
-        __ Jump(wasm_code, info()->IsWasm() ? RelocInfo::WASM_CALL
-                                            : RelocInfo::JS_TO_WASM_CALL);
-      } else {
-        __ daddiu(at, i.InputRegister(0), 0);
-        __ Jump(at);
-      }
-      frame_access_state()->ClearSPDelta();
-      frame_access_state()->SetFrameAccessToDefault();
-      break;
-    }
-    case kArchTailCallAddress: {
-      CHECK(!instr->InputAt(0)->IsImmediate());
-      __ Jump(i.InputRegister(0));
-      frame_access_state()->ClearSPDelta();
-      frame_access_state()->SetFrameAccessToDefault();
-      break;
-    }
-    case kArchCallJSFunction: {
-      Register func = i.InputRegister(0);
-      if (FLAG_debug_code) {
-        // Check the function's context matches the context argument.
-        __ Ld(kScratchReg, FieldMemOperand(func, JSFunction::kContextOffset));
-        __ Assert(eq, AbortReason::kWrongFunctionContext, cp,
-                  Operand(kScratchReg));
-      }
-      __ Ld(at, FieldMemOperand(func, JSFunction::kCodeOffset));
-      __ Daddu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag));
-      __ Call(at);
-      RecordCallPosition(instr);
-      frame_access_state()->ClearSPDelta();
-      break;
-    }
-    case kArchPrepareCallCFunction: {
-      int const num_parameters = MiscField::decode(instr->opcode());
-      __ PrepareCallCFunction(num_parameters, kScratchReg);
-      // Frame alignment requires using FP-relative frame addressing.
-      frame_access_state()->SetFrameAccessToFP();
-      break;
-    }
-    case kArchSaveCallerRegisters: {
-      fp_mode_ =
-          static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode()));
-      DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
-      // kReturnRegister0 should have been saved before entering the stub.
-      int bytes = __ PushCallerSaved(fp_mode_, kReturnRegister0);
-      DCHECK_EQ(0, bytes % kPointerSize);
-      DCHECK_EQ(0, frame_access_state()->sp_delta());
-      frame_access_state()->IncreaseSPDelta(bytes / kPointerSize);
-      DCHECK(!caller_registers_saved_);
-      caller_registers_saved_ = true;
-      break;
-    }
-    case kArchRestoreCallerRegisters: {
-      DCHECK(fp_mode_ ==
-             static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode())));
-      DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
-      // Don't overwrite the returned value.
-      int bytes = __ PopCallerSaved(fp_mode_, kReturnRegister0);
-      frame_access_state()->IncreaseSPDelta(-(bytes / kPointerSize));
-      DCHECK_EQ(0, frame_access_state()->sp_delta());
-      DCHECK(caller_registers_saved_);
-      caller_registers_saved_ = false;
-      break;
-    }
-    case kArchPrepareTailCall:
-      AssemblePrepareTailCall();
-      break;
-    case kArchCallCFunction: {
-      int const num_parameters = MiscField::decode(instr->opcode());
-      if (instr->InputAt(0)->IsImmediate()) {
-        ExternalReference ref = i.InputExternalReference(0);
-        __ CallCFunction(ref, num_parameters);
-      } else {
-        Register func = i.InputRegister(0);
-        __ CallCFunction(func, num_parameters);
-      }
-      frame_access_state()->SetFrameAccessToDefault();
-      // Ideally, we should decrement SP delta to match the change of stack
-      // pointer in CallCFunction. However, for certain architectures (e.g.
-      // ARM), there may be more strict alignment requirement, causing old SP
-      // to be saved on the stack. In those cases, we can not calculate the SP
-      // delta statically.
-      frame_access_state()->ClearSPDelta();
-      if (caller_registers_saved_) {
-        // Need to re-sync SP delta introduced in kArchSaveCallerRegisters.
-        // Here, we assume the sequence to be:
-        //   kArchSaveCallerRegisters;
-        //   kArchCallCFunction;
-        //   kArchRestoreCallerRegisters;
-        int bytes =
-            __ RequiredStackSizeForCallerSaved(fp_mode_, kReturnRegister0);
-        frame_access_state()->IncreaseSPDelta(bytes / kPointerSize);
-      }
-      break;
-    }
-    case kArchJmp:
-      AssembleArchJump(i.InputRpo(0));
-      break;
-    case kArchLookupSwitch:
-      AssembleArchLookupSwitch(instr);
-      break;
-    case kArchTableSwitch:
-      AssembleArchTableSwitch(instr);
-      break;
-    case kArchDebugAbort:
-      DCHECK(i.InputRegister(0) == a0);
-      if (!frame_access_state()->has_frame()) {
-        // We don't actually want to generate a pile of code for this, so just
-        // claim there is a stack frame, without generating one.
-        FrameScope scope(tasm(), StackFrame::NONE);
-        __ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
-                RelocInfo::CODE_TARGET);
-      } else {
-        __ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
-                RelocInfo::CODE_TARGET);
-      }
-      __ stop("kArchDebugAbort");
-      break;
-    case kArchDebugBreak:
-      __ stop("kArchDebugBreak");
-      break;
-    case kArchComment: {
-      Address comment_string = i.InputExternalReference(0).address();
-      __ RecordComment(reinterpret_cast<const char*>(comment_string));
-      break;
-    }
-    case kArchNop:
-    case kArchThrowTerminator:
-      // don't emit code for nops.
-      break;
-    case kArchDeoptimize: {
-      int deopt_state_id =
-          BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore());
-      CodeGenResult result =
-          AssembleDeoptimizerCall(deopt_state_id, current_source_position_);
-      if (result != kSuccess) return result;
-      break;
-    }
-    case kArchRet:
-      AssembleReturn(instr->InputAt(0));
-      break;
-    case kArchStackPointer:
-      __ mov(i.OutputRegister(), sp);
-      break;
-    case kArchFramePointer:
-      __ mov(i.OutputRegister(), fp);
-      break;
-    case kArchParentFramePointer:
-      if (frame_access_state()->has_frame()) {
-        __ Ld(i.OutputRegister(), MemOperand(fp, 0));
-      } else {
-        __ mov(i.OutputRegister(), fp);
-      }
-      break;
-    case kArchTruncateDoubleToI:
-      __ TruncateDoubleToIDelayed(zone(), i.OutputRegister(),
-                                  i.InputDoubleRegister(0));
-      break;
-    case kArchStoreWithWriteBarrier: {
-      RecordWriteMode mode =
-          static_cast<RecordWriteMode>(MiscField::decode(instr->opcode()));
-      Register object = i.InputRegister(0);
-      Register index = i.InputRegister(1);
-      Register value = i.InputRegister(2);
-      Register scratch0 = i.TempRegister(0);
-      Register scratch1 = i.TempRegister(1);
-      auto ool = new (zone()) OutOfLineRecordWrite(this, object, index, value,
-                                                   scratch0, scratch1, mode);
-      __ Daddu(at, object, index);
-      __ Sd(value, MemOperand(at));
-      __ CheckPageFlag(object, scratch0,
-                       MemoryChunk::kPointersFromHereAreInterestingMask, ne,
-                       ool->entry());
-      __ bind(ool->exit());
-      break;
-    }
-    case kArchStackSlot: {
-      FrameOffset offset =
-          frame_access_state()->GetFrameOffset(i.InputInt32(0));
-      Register base_reg = offset.from_stack_pointer() ? sp : fp;
-      __ Daddu(i.OutputRegister(), base_reg, Operand(offset.offset()));
-      int alignment = i.InputInt32(1);
-      DCHECK(alignment == 0 || alignment == 4 || alignment == 8 ||
-             alignment == 16);
-      if (FLAG_debug_code && alignment > 0) {
-        // Verify that the output_register is properly aligned
-        __ And(kScratchReg, i.OutputRegister(), Operand(kPointerSize - 1));
-        __ Assert(eq, AbortReason::kAllocationIsNotDoubleAligned, kScratchReg,
-                  Operand(zero_reg));
-      }
-      if (alignment == 2 * kPointerSize) {
-        Label done;
-        __ Daddu(kScratchReg, base_reg, Operand(offset.offset()));
-        __ And(kScratchReg, kScratchReg, Operand(alignment - 1));
-        __ BranchShort(&done, eq, kScratchReg, Operand(zero_reg));
-        __ Daddu(i.OutputRegister(), i.OutputRegister(), kPointerSize);
-        __ bind(&done);
-      } else if (alignment > 2 * kPointerSize) {
-        Label done;
-        __ Daddu(kScratchReg, base_reg, Operand(offset.offset()));
-        __ And(kScratchReg, kScratchReg, Operand(alignment - 1));
-        __ BranchShort(&done, eq, kScratchReg, Operand(zero_reg));
-        __ li(kScratchReg2, alignment);
-        __ Dsubu(kScratchReg2, kScratchReg2, Operand(kScratchReg));
-        __ Daddu(i.OutputRegister(), i.OutputRegister(), kScratchReg2);
-        __ bind(&done);
-      }
-
-      break;
-    }
-    case kIeee754Float64Acos:
-      ASSEMBLE_IEEE754_UNOP(acos);
-      break;
-    case kIeee754Float64Acosh:
-      ASSEMBLE_IEEE754_UNOP(acosh);
-      break;
-    case kIeee754Float64Asin:
-      ASSEMBLE_IEEE754_UNOP(asin);
-      break;
-    case kIeee754Float64Asinh:
-      ASSEMBLE_IEEE754_UNOP(asinh);
-      break;
-    case kIeee754Float64Atan:
-      ASSEMBLE_IEEE754_UNOP(atan);
-      break;
-    case kIeee754Float64Atanh:
-      ASSEMBLE_IEEE754_UNOP(atanh);
-      break;
-    case kIeee754Float64Atan2:
-      ASSEMBLE_IEEE754_BINOP(atan2);
-      break;
-    case kIeee754Float64Cos:
-      ASSEMBLE_IEEE754_UNOP(cos);
-      break;
-    case kIeee754Float64Cosh:
-      ASSEMBLE_IEEE754_UNOP(cosh);
-      break;
-    case kIeee754Float64Cbrt:
-      ASSEMBLE_IEEE754_UNOP(cbrt);
-      break;
-    case kIeee754Float64Exp:
-      ASSEMBLE_IEEE754_UNOP(exp);
-      break;
-    case kIeee754Float64Expm1:
-      ASSEMBLE_IEEE754_UNOP(expm1);
-      break;
-    case kIeee754Float64Log:
-      ASSEMBLE_IEEE754_UNOP(log);
-      break;
-    case kIeee754Float64Log1p:
-      ASSEMBLE_IEEE754_UNOP(log1p);
-      break;
-    case kIeee754Float64Log2:
-      ASSEMBLE_IEEE754_UNOP(log2);
-      break;
-    case kIeee754Float64Log10:
-      ASSEMBLE_IEEE754_UNOP(log10);
-      break;
-    case kIeee754Float64Pow: {
-      __ CallStubDelayed(new (zone())
-                             MathPowStub(nullptr, MathPowStub::DOUBLE));
-      break;
-    }
-    case kIeee754Float64Sin:
-      ASSEMBLE_IEEE754_UNOP(sin);
-      break;
-    case kIeee754Float64Sinh:
-      ASSEMBLE_IEEE754_UNOP(sinh);
-      break;
-    case kIeee754Float64Tan:
-      ASSEMBLE_IEEE754_UNOP(tan);
-      break;
-    case kIeee754Float64Tanh:
-      ASSEMBLE_IEEE754_UNOP(tanh);
-      break;
-    case kMips64Add:
-      __ Addu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMips64Dadd:
-      __ Daddu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMips64DaddOvf:
-      // Pseudo-instruction used for overflow/branch. No opcode emitted here.
-      break;
-    case kMips64Sub:
-      __ Subu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMips64Dsub:
-      __ Dsubu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMips64DsubOvf:
-      // Pseudo-instruction used for overflow/branch. No opcode emitted here.
-      break;
-    case kMips64Mul:
-      __ Mul(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMips64MulOvf:
-      // Pseudo-instruction used for overflow/branch. No opcode emitted here.
-      break;
-    case kMips64MulHigh:
-      __ Mulh(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMips64MulHighU:
-      __ Mulhu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMips64DMulHigh:
-      __ Dmulh(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMips64Div:
-      __ Div(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      if (kArchVariant == kMips64r6) {
-        __ selnez(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      } else {
-        __ Movz(i.OutputRegister(), i.InputRegister(1), i.InputRegister(1));
-      }
-      break;
-    case kMips64DivU:
-      __ Divu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      if (kArchVariant == kMips64r6) {
-        __ selnez(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      } else {
-        __ Movz(i.OutputRegister(), i.InputRegister(1), i.InputRegister(1));
-      }
-      break;
-    case kMips64Mod:
-      __ Mod(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMips64ModU:
-      __ Modu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMips64Dmul:
-      __ Dmul(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMips64Ddiv:
-      __ Ddiv(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      if (kArchVariant == kMips64r6) {
-        __ selnez(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      } else {
-        __ Movz(i.OutputRegister(), i.InputRegister(1), i.InputRegister(1));
-      }
-      break;
-    case kMips64DdivU:
-      __ Ddivu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      if (kArchVariant == kMips64r6) {
-        __ selnez(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      } else {
-        __ Movz(i.OutputRegister(), i.InputRegister(1), i.InputRegister(1));
-      }
-      break;
-    case kMips64Dmod:
-      __ Dmod(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMips64DmodU:
-      __ Dmodu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMips64Dlsa:
-      DCHECK(instr->InputAt(2)->IsImmediate());
-      __ Dlsa(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
-              i.InputInt8(2));
-      break;
-    case kMips64Lsa:
-      DCHECK(instr->InputAt(2)->IsImmediate());
-      __ Lsa(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
-             i.InputInt8(2));
-      break;
-    case kMips64And:
-      __ And(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMips64And32:
-      if (instr->InputAt(1)->IsRegister()) {
-        __ sll(i.InputRegister(0), i.InputRegister(0), 0x0);
-        __ sll(i.InputRegister(1), i.InputRegister(1), 0x0);
-        __ And(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      } else {
-        __ sll(i.InputRegister(0), i.InputRegister(0), 0x0);
-        __ And(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      }
-      break;
-    case kMips64Or:
-      __ Or(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMips64Or32:
-      if (instr->InputAt(1)->IsRegister()) {
-        __ sll(i.InputRegister(0), i.InputRegister(0), 0x0);
-        __ sll(i.InputRegister(1), i.InputRegister(1), 0x0);
-        __ Or(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      } else {
-        __ sll(i.InputRegister(0), i.InputRegister(0), 0x0);
-        __ Or(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      }
-      break;
-    case kMips64Nor:
-      if (instr->InputAt(1)->IsRegister()) {
-        __ Nor(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      } else {
-        DCHECK_EQ(0, i.InputOperand(1).immediate());
-        __ Nor(i.OutputRegister(), i.InputRegister(0), zero_reg);
-      }
-      break;
-    case kMips64Nor32:
-      if (instr->InputAt(1)->IsRegister()) {
-        __ sll(i.InputRegister(0), i.InputRegister(0), 0x0);
-        __ sll(i.InputRegister(1), i.InputRegister(1), 0x0);
-        __ Nor(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      } else {
-        DCHECK_EQ(0, i.InputOperand(1).immediate());
-        __ sll(i.InputRegister(0), i.InputRegister(0), 0x0);
-        __ Nor(i.OutputRegister(), i.InputRegister(0), zero_reg);
-      }
-      break;
-    case kMips64Xor:
-      __ Xor(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMips64Xor32:
-      if (instr->InputAt(1)->IsRegister()) {
-        __ sll(i.InputRegister(0), i.InputRegister(0), 0x0);
-        __ sll(i.InputRegister(1), i.InputRegister(1), 0x0);
-        __ Xor(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      } else {
-        __ sll(i.InputRegister(0), i.InputRegister(0), 0x0);
-        __ Xor(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      }
-      break;
-    case kMips64Clz:
-      __ Clz(i.OutputRegister(), i.InputRegister(0));
-      break;
-    case kMips64Dclz:
-      __ dclz(i.OutputRegister(), i.InputRegister(0));
-      break;
-    case kMips64Ctz: {
-      Register src = i.InputRegister(0);
-      Register dst = i.OutputRegister();
-      if (kArchVariant == kMips64r6) {
-        // We don't have an instruction to count the number of trailing zeroes.
-        // Start by flipping the bits end-for-end so we can count the number of
-        // leading zeroes instead.
-        __ rotr(dst, src, 16);
-        __ wsbh(dst, dst);
-        __ bitswap(dst, dst);
-        __ Clz(dst, dst);
-      } else {
-        // Convert trailing zeroes to trailing ones, and bits to their left
-        // to zeroes.
-        __ Daddu(kScratchReg, src, -1);
-        __ Xor(dst, kScratchReg, src);
-        __ And(dst, dst, kScratchReg);
-        // Count number of leading zeroes.
-        __ Clz(dst, dst);
-        // Subtract number of leading zeroes from 32 to get number of trailing
-        // ones. Remember that the trailing ones were formerly trailing zeroes.
-        __ li(kScratchReg, 32);
-        __ Subu(dst, kScratchReg, dst);
-      }
-    } break;
-    case kMips64Dctz: {
-      Register src = i.InputRegister(0);
-      Register dst = i.OutputRegister();
-      if (kArchVariant == kMips64r6) {
-        // We don't have an instruction to count the number of trailing zeroes.
-        // Start by flipping the bits end-for-end so we can count the number of
-        // leading zeroes instead.
-        __ dsbh(dst, src);
-        __ dshd(dst, dst);
-        __ dbitswap(dst, dst);
-        __ dclz(dst, dst);
-      } else {
-        // Convert trailing zeroes to trailing ones, and bits to their left
-        // to zeroes.
-        __ Daddu(kScratchReg, src, -1);
-        __ Xor(dst, kScratchReg, src);
-        __ And(dst, dst, kScratchReg);
-        // Count number of leading zeroes.
-        __ dclz(dst, dst);
-        // Subtract number of leading zeroes from 64 to get number of trailing
-        // ones. Remember that the trailing ones were formerly trailing zeroes.
-        __ li(kScratchReg, 64);
-        __ Dsubu(dst, kScratchReg, dst);
-      }
-    } break;
-    case kMips64Popcnt: {
-      // https://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel
-      //
-      // A generalization of the best bit counting method to integers of
-      // bit-widths up to 128 (parameterized by type T) is this:
-      //
-      // v = v - ((v >> 1) & (T)~(T)0/3);                           // temp
-      // v = (v & (T)~(T)0/15*3) + ((v >> 2) & (T)~(T)0/15*3);      // temp
-      // v = (v + (v >> 4)) & (T)~(T)0/255*15;                      // temp
-      // c = (T)(v * ((T)~(T)0/255)) >> (sizeof(T) - 1) * BITS_PER_BYTE; //count
-      //
-      // For comparison, for 32-bit quantities, this algorithm can be executed
-      // using 20 MIPS instructions (the calls to LoadConst32() generate two
-      // machine instructions each for the values being used in this algorithm).
-      // A(n unrolled) loop-based algorithm requires 25 instructions.
-      //
-      // For a 64-bit operand this can be performed in 24 instructions compared
-      // to a(n unrolled) loop based algorithm which requires 38 instructions.
-      //
-      // There are algorithms which are faster in the cases where very few
-      // bits are set but the algorithm here attempts to minimize the total
-      // number of instructions executed even when a large number of bits
-      // are set.
-      Register src = i.InputRegister(0);
-      Register dst = i.OutputRegister();
-      uint32_t B0 = 0x55555555;     // (T)~(T)0/3
-      uint32_t B1 = 0x33333333;     // (T)~(T)0/15*3
-      uint32_t B2 = 0x0F0F0F0F;     // (T)~(T)0/255*15
-      uint32_t value = 0x01010101;  // (T)~(T)0/255
-      uint32_t shift = 24;          // (sizeof(T) - 1) * BITS_PER_BYTE
-      __ srl(kScratchReg, src, 1);
-      __ li(kScratchReg2, B0);
-      __ And(kScratchReg, kScratchReg, kScratchReg2);
-      __ Subu(kScratchReg, src, kScratchReg);
-      __ li(kScratchReg2, B1);
-      __ And(dst, kScratchReg, kScratchReg2);
-      __ srl(kScratchReg, kScratchReg, 2);
-      __ And(kScratchReg, kScratchReg, kScratchReg2);
-      __ Addu(kScratchReg, dst, kScratchReg);
-      __ srl(dst, kScratchReg, 4);
-      __ Addu(dst, dst, kScratchReg);
-      __ li(kScratchReg2, B2);
-      __ And(dst, dst, kScratchReg2);
-      __ li(kScratchReg, value);
-      __ Mul(dst, dst, kScratchReg);
-      __ srl(dst, dst, shift);
-    } break;
-    case kMips64Dpopcnt: {
-      Register src = i.InputRegister(0);
-      Register dst = i.OutputRegister();
-      uint64_t B0 = 0x5555555555555555l;     // (T)~(T)0/3
-      uint64_t B1 = 0x3333333333333333l;     // (T)~(T)0/15*3
-      uint64_t B2 = 0x0F0F0F0F0F0F0F0Fl;     // (T)~(T)0/255*15
-      uint64_t value = 0x0101010101010101l;  // (T)~(T)0/255
-      uint64_t shift = 24;                   // (sizeof(T) - 1) * BITS_PER_BYTE
-      __ dsrl(kScratchReg, src, 1);
-      __ li(kScratchReg2, B0);
-      __ And(kScratchReg, kScratchReg, kScratchReg2);
-      __ Dsubu(kScratchReg, src, kScratchReg);
-      __ li(kScratchReg2, B1);
-      __ And(dst, kScratchReg, kScratchReg2);
-      __ dsrl(kScratchReg, kScratchReg, 2);
-      __ And(kScratchReg, kScratchReg, kScratchReg2);
-      __ Daddu(kScratchReg, dst, kScratchReg);
-      __ dsrl(dst, kScratchReg, 4);
-      __ Daddu(dst, dst, kScratchReg);
-      __ li(kScratchReg2, B2);
-      __ And(dst, dst, kScratchReg2);
-      __ li(kScratchReg, value);
-      __ Dmul(dst, dst, kScratchReg);
-      __ dsrl32(dst, dst, shift);
-    } break;
-    case kMips64Shl:
-      if (instr->InputAt(1)->IsRegister()) {
-        __ sllv(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      } else {
-        int64_t imm = i.InputOperand(1).immediate();
-        __ sll(i.OutputRegister(), i.InputRegister(0),
-               static_cast<uint16_t>(imm));
-      }
-      break;
-    case kMips64Shr:
-      if (instr->InputAt(1)->IsRegister()) {
-        __ sll(i.InputRegister(0), i.InputRegister(0), 0x0);
-        __ srlv(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      } else {
-        int64_t imm = i.InputOperand(1).immediate();
-        __ sll(i.InputRegister(0), i.InputRegister(0), 0x0);
-        __ srl(i.OutputRegister(), i.InputRegister(0),
-               static_cast<uint16_t>(imm));
-      }
-      break;
-    case kMips64Sar:
-      if (instr->InputAt(1)->IsRegister()) {
-        __ sll(i.InputRegister(0), i.InputRegister(0), 0x0);
-        __ srav(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      } else {
-        int64_t imm = i.InputOperand(1).immediate();
-        __ sll(i.InputRegister(0), i.InputRegister(0), 0x0);
-        __ sra(i.OutputRegister(), i.InputRegister(0),
-               static_cast<uint16_t>(imm));
-      }
-      break;
-    case kMips64Ext:
-      __ Ext(i.OutputRegister(), i.InputRegister(0), i.InputInt8(1),
-             i.InputInt8(2));
-      break;
-    case kMips64Ins:
-      if (instr->InputAt(1)->IsImmediate() && i.InputInt8(1) == 0) {
-        __ Ins(i.OutputRegister(), zero_reg, i.InputInt8(1), i.InputInt8(2));
-      } else {
-        __ Ins(i.OutputRegister(), i.InputRegister(0), i.InputInt8(1),
-               i.InputInt8(2));
-      }
-      break;
-    case kMips64Dext: {
-      __ Dext(i.OutputRegister(), i.InputRegister(0), i.InputInt8(1),
-              i.InputInt8(2));
-      break;
-    }
-    case kMips64Dins:
-      if (instr->InputAt(1)->IsImmediate() && i.InputInt8(1) == 0) {
-        __ Dins(i.OutputRegister(), zero_reg, i.InputInt8(1), i.InputInt8(2));
-      } else {
-        __ Dins(i.OutputRegister(), i.InputRegister(0), i.InputInt8(1),
-                i.InputInt8(2));
-      }
-      break;
-    case kMips64Dshl:
-      if (instr->InputAt(1)->IsRegister()) {
-        __ dsllv(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      } else {
-        int64_t imm = i.InputOperand(1).immediate();
-        if (imm < 32) {
-          __ dsll(i.OutputRegister(), i.InputRegister(0),
-                  static_cast<uint16_t>(imm));
-        } else {
-          __ dsll32(i.OutputRegister(), i.InputRegister(0),
-                    static_cast<uint16_t>(imm - 32));
-        }
-      }
-      break;
-    case kMips64Dshr:
-      if (instr->InputAt(1)->IsRegister()) {
-        __ dsrlv(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      } else {
-        int64_t imm = i.InputOperand(1).immediate();
-        if (imm < 32) {
-          __ dsrl(i.OutputRegister(), i.InputRegister(0),
-                  static_cast<uint16_t>(imm));
-        } else {
-          __ dsrl32(i.OutputRegister(), i.InputRegister(0),
-                    static_cast<uint16_t>(imm - 32));
-        }
-      }
-      break;
-    case kMips64Dsar:
-      if (instr->InputAt(1)->IsRegister()) {
-        __ dsrav(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      } else {
-        int64_t imm = i.InputOperand(1).immediate();
-        if (imm < 32) {
-          __ dsra(i.OutputRegister(), i.InputRegister(0), imm);
-        } else {
-          __ dsra32(i.OutputRegister(), i.InputRegister(0), imm - 32);
-        }
-      }
-      break;
-    case kMips64Ror:
-      __ Ror(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMips64Dror:
-      __ Dror(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
-      break;
-    case kMips64Tst:
-      // Pseudo-instruction used for cmp/branch. No opcode emitted here.
-      break;
-    case kMips64Cmp:
-      // Pseudo-instruction used for cmp/branch. No opcode emitted here.
-      break;
-    case kMips64Mov:
-      // TODO(plind): Should we combine mov/li like this, or use separate instr?
-      //    - Also see x64 ASSEMBLE_BINOP & RegisterOrOperandType
-      if (HasRegisterInput(instr, 0)) {
-        __ mov(i.OutputRegister(), i.InputRegister(0));
-      } else {
-        __ li(i.OutputRegister(), i.InputOperand(0));
-      }
-      break;
-
-    case kMips64CmpS:
-      // Pseudo-instruction used for FP cmp/branch. No opcode emitted here.
-      break;
-    case kMips64AddS:
-      // TODO(plind): add special case: combine mult & add.
-      __ add_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-               i.InputDoubleRegister(1));
-      break;
-    case kMips64SubS:
-      __ sub_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-               i.InputDoubleRegister(1));
-      break;
-    case kMips64MulS:
-      // TODO(plind): add special case: right op is -1.0, see arm port.
-      __ mul_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-               i.InputDoubleRegister(1));
-      break;
-    case kMips64DivS:
-      __ div_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-               i.InputDoubleRegister(1));
-      break;
-    case kMips64ModS: {
-      // TODO(bmeurer): We should really get rid of this special instruction,
-      // and generate a CallAddress instruction instead.
-      FrameScope scope(tasm(), StackFrame::MANUAL);
-      __ PrepareCallCFunction(0, 2, kScratchReg);
-      __ MovToFloatParameters(i.InputDoubleRegister(0),
-                              i.InputDoubleRegister(1));
-      // TODO(balazs.kilvady): implement mod_two_floats_operation(isolate())
-      __ CallCFunction(
-          ExternalReference::mod_two_doubles_operation(tasm()->isolate()), 0,
-          2);
-      // Move the result in the double result register.
-      __ MovFromFloatResult(i.OutputSingleRegister());
-      break;
-    }
-    case kMips64AbsS:
-      __ abs_s(i.OutputSingleRegister(), i.InputSingleRegister(0));
-      break;
-    case kMips64NegS:
-      __ Neg_s(i.OutputSingleRegister(), i.InputSingleRegister(0));
-      break;
-    case kMips64SqrtS: {
-      __ sqrt_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    }
-    case kMips64MaxS:
-      __ max_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-               i.InputDoubleRegister(1));
-      break;
-    case kMips64MinS:
-      __ min_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-               i.InputDoubleRegister(1));
-      break;
-    case kMips64CmpD:
-      // Pseudo-instruction used for FP cmp/branch. No opcode emitted here.
-      break;
-    case kMips64AddD:
-      // TODO(plind): add special case: combine mult & add.
-      __ add_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-               i.InputDoubleRegister(1));
-      break;
-    case kMips64SubD:
-      __ sub_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-               i.InputDoubleRegister(1));
-      break;
-    case kMips64MulD:
-      // TODO(plind): add special case: right op is -1.0, see arm port.
-      __ mul_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-               i.InputDoubleRegister(1));
-      break;
-    case kMips64DivD:
-      __ div_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-               i.InputDoubleRegister(1));
-      break;
-    case kMips64ModD: {
-      // TODO(bmeurer): We should really get rid of this special instruction,
-      // and generate a CallAddress instruction instead.
-      FrameScope scope(tasm(), StackFrame::MANUAL);
-      __ PrepareCallCFunction(0, 2, kScratchReg);
-      __ MovToFloatParameters(i.InputDoubleRegister(0),
-                              i.InputDoubleRegister(1));
-      __ CallCFunction(
-          ExternalReference::mod_two_doubles_operation(tasm()->isolate()), 0,
-          2);
-      // Move the result in the double result register.
-      __ MovFromFloatResult(i.OutputDoubleRegister());
-      break;
-    }
-    case kMips64AbsD:
-      __ abs_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    case kMips64NegD:
-      __ Neg_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    case kMips64SqrtD: {
-      __ sqrt_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    }
-    case kMips64MaxD:
-      __ max_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-               i.InputDoubleRegister(1));
-      break;
-    case kMips64MinD:
-      __ min_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-               i.InputDoubleRegister(1));
-      break;
-    case kMips64Float64RoundDown: {
-      ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(floor);
-      break;
-    }
-    case kMips64Float32RoundDown: {
-      ASSEMBLE_ROUND_FLOAT_TO_FLOAT(floor);
-      break;
-    }
-    case kMips64Float64RoundTruncate: {
-      ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(trunc);
-      break;
-    }
-    case kMips64Float32RoundTruncate: {
-      ASSEMBLE_ROUND_FLOAT_TO_FLOAT(trunc);
-      break;
-    }
-    case kMips64Float64RoundUp: {
-      ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(ceil);
-      break;
-    }
-    case kMips64Float32RoundUp: {
-      ASSEMBLE_ROUND_FLOAT_TO_FLOAT(ceil);
-      break;
-    }
-    case kMips64Float64RoundTiesEven: {
-      ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(round);
-      break;
-    }
-    case kMips64Float32RoundTiesEven: {
-      ASSEMBLE_ROUND_FLOAT_TO_FLOAT(round);
-      break;
-    }
-    case kMips64Float32Max: {
-      FPURegister dst = i.OutputSingleRegister();
-      FPURegister src1 = i.InputSingleRegister(0);
-      FPURegister src2 = i.InputSingleRegister(1);
-      auto ool = new (zone()) OutOfLineFloat32Max(this, dst, src1, src2);
-      __ Float32Max(dst, src1, src2, ool->entry());
-      __ bind(ool->exit());
-      break;
-    }
-    case kMips64Float64Max: {
-      FPURegister dst = i.OutputDoubleRegister();
-      FPURegister src1 = i.InputDoubleRegister(0);
-      FPURegister src2 = i.InputDoubleRegister(1);
-      auto ool = new (zone()) OutOfLineFloat64Max(this, dst, src1, src2);
-      __ Float64Max(dst, src1, src2, ool->entry());
-      __ bind(ool->exit());
-      break;
-    }
-    case kMips64Float32Min: {
-      FPURegister dst = i.OutputSingleRegister();
-      FPURegister src1 = i.InputSingleRegister(0);
-      FPURegister src2 = i.InputSingleRegister(1);
-      auto ool = new (zone()) OutOfLineFloat32Min(this, dst, src1, src2);
-      __ Float32Min(dst, src1, src2, ool->entry());
-      __ bind(ool->exit());
-      break;
-    }
-    case kMips64Float64Min: {
-      FPURegister dst = i.OutputDoubleRegister();
-      FPURegister src1 = i.InputDoubleRegister(0);
-      FPURegister src2 = i.InputDoubleRegister(1);
-      auto ool = new (zone()) OutOfLineFloat64Min(this, dst, src1, src2);
-      __ Float64Min(dst, src1, src2, ool->entry());
-      __ bind(ool->exit());
-      break;
-    }
-    case kMips64Float64SilenceNaN:
-      __ FPUCanonicalizeNaN(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    case kMips64CvtSD:
-      __ cvt_s_d(i.OutputSingleRegister(), i.InputDoubleRegister(0));
-      break;
-    case kMips64CvtDS:
-      __ cvt_d_s(i.OutputDoubleRegister(), i.InputSingleRegister(0));
-      break;
-    case kMips64CvtDW: {
-      FPURegister scratch = kScratchDoubleReg;
-      __ mtc1(i.InputRegister(0), scratch);
-      __ cvt_d_w(i.OutputDoubleRegister(), scratch);
-      break;
-    }
-    case kMips64CvtSW: {
-      FPURegister scratch = kScratchDoubleReg;
-      __ mtc1(i.InputRegister(0), scratch);
-      __ cvt_s_w(i.OutputDoubleRegister(), scratch);
-      break;
-    }
-    case kMips64CvtSUw: {
-      __ Cvt_s_uw(i.OutputDoubleRegister(), i.InputRegister(0));
-      break;
-    }
-    case kMips64CvtSL: {
-      FPURegister scratch = kScratchDoubleReg;
-      __ dmtc1(i.InputRegister(0), scratch);
-      __ cvt_s_l(i.OutputDoubleRegister(), scratch);
-      break;
-    }
-    case kMips64CvtDL: {
-      FPURegister scratch = kScratchDoubleReg;
-      __ dmtc1(i.InputRegister(0), scratch);
-      __ cvt_d_l(i.OutputDoubleRegister(), scratch);
-      break;
-    }
-    case kMips64CvtDUw: {
-      __ Cvt_d_uw(i.OutputDoubleRegister(), i.InputRegister(0));
-      break;
-    }
-    case kMips64CvtDUl: {
-      __ Cvt_d_ul(i.OutputDoubleRegister(), i.InputRegister(0));
-      break;
-    }
-    case kMips64CvtSUl: {
-      __ Cvt_s_ul(i.OutputDoubleRegister(), i.InputRegister(0));
-      break;
-    }
-    case kMips64FloorWD: {
-      FPURegister scratch = kScratchDoubleReg;
-      __ floor_w_d(scratch, i.InputDoubleRegister(0));
-      __ mfc1(i.OutputRegister(), scratch);
-      break;
-    }
-    case kMips64CeilWD: {
-      FPURegister scratch = kScratchDoubleReg;
-      __ ceil_w_d(scratch, i.InputDoubleRegister(0));
-      __ mfc1(i.OutputRegister(), scratch);
-      break;
-    }
-    case kMips64RoundWD: {
-      FPURegister scratch = kScratchDoubleReg;
-      __ round_w_d(scratch, i.InputDoubleRegister(0));
-      __ mfc1(i.OutputRegister(), scratch);
-      break;
-    }
-    case kMips64TruncWD: {
-      FPURegister scratch = kScratchDoubleReg;
-      // Other arches use round to zero here, so we follow.
-      __ trunc_w_d(scratch, i.InputDoubleRegister(0));
-      __ mfc1(i.OutputRegister(), scratch);
-      break;
-    }
-    case kMips64FloorWS: {
-      FPURegister scratch = kScratchDoubleReg;
-      __ floor_w_s(scratch, i.InputDoubleRegister(0));
-      __ mfc1(i.OutputRegister(), scratch);
-      break;
-    }
-    case kMips64CeilWS: {
-      FPURegister scratch = kScratchDoubleReg;
-      __ ceil_w_s(scratch, i.InputDoubleRegister(0));
-      __ mfc1(i.OutputRegister(), scratch);
-      break;
-    }
-    case kMips64RoundWS: {
-      FPURegister scratch = kScratchDoubleReg;
-      __ round_w_s(scratch, i.InputDoubleRegister(0));
-      __ mfc1(i.OutputRegister(), scratch);
-      break;
-    }
-    case kMips64TruncWS: {
-      FPURegister scratch = kScratchDoubleReg;
-      __ trunc_w_s(scratch, i.InputDoubleRegister(0));
-      __ mfc1(i.OutputRegister(), scratch);
-      // Avoid INT32_MAX as an overflow indicator and use INT32_MIN instead,
-      // because INT32_MIN allows easier out-of-bounds detection.
-      __ addiu(kScratchReg, i.OutputRegister(), 1);
-      __ slt(kScratchReg2, kScratchReg, i.OutputRegister());
-      __ Movn(i.OutputRegister(), kScratchReg, kScratchReg2);
-      break;
-    }
-    case kMips64TruncLS: {
-      FPURegister scratch = kScratchDoubleReg;
-      Register tmp_fcsr = kScratchReg;
-      Register result = kScratchReg2;
-
-      bool load_status = instr->OutputCount() > 1;
-      if (load_status) {
-        // Save FCSR.
-        __ cfc1(tmp_fcsr, FCSR);
-        // Clear FPU flags.
-        __ ctc1(zero_reg, FCSR);
-      }
-      // Other arches use round to zero here, so we follow.
-      __ trunc_l_s(scratch, i.InputDoubleRegister(0));
-      __ dmfc1(i.OutputRegister(), scratch);
-      if (load_status) {
-        __ cfc1(result, FCSR);
-        // Check for overflow and NaNs.
-        __ andi(result, result,
-                (kFCSROverflowFlagMask | kFCSRInvalidOpFlagMask));
-        __ Slt(result, zero_reg, result);
-        __ xori(result, result, 1);
-        __ mov(i.OutputRegister(1), result);
-        // Restore FCSR
-        __ ctc1(tmp_fcsr, FCSR);
-      }
-      break;
-    }
-    case kMips64TruncLD: {
-      FPURegister scratch = kScratchDoubleReg;
-      Register tmp_fcsr = kScratchReg;
-      Register result = kScratchReg2;
-
-      bool load_status = instr->OutputCount() > 1;
-      if (load_status) {
-        // Save FCSR.
-        __ cfc1(tmp_fcsr, FCSR);
-        // Clear FPU flags.
-        __ ctc1(zero_reg, FCSR);
-      }
-      // Other arches use round to zero here, so we follow.
-      __ trunc_l_d(scratch, i.InputDoubleRegister(0));
-      __ dmfc1(i.OutputRegister(0), scratch);
-      if (load_status) {
-        __ cfc1(result, FCSR);
-        // Check for overflow and NaNs.
-        __ andi(result, result,
-                (kFCSROverflowFlagMask | kFCSRInvalidOpFlagMask));
-        __ Slt(result, zero_reg, result);
-        __ xori(result, result, 1);
-        __ mov(i.OutputRegister(1), result);
-        // Restore FCSR
-        __ ctc1(tmp_fcsr, FCSR);
-      }
-      break;
-    }
-    case kMips64TruncUwD: {
-      FPURegister scratch = kScratchDoubleReg;
-      // TODO(plind): Fix wrong param order of Trunc_uw_d() macro-asm function.
-      __ Trunc_uw_d(i.InputDoubleRegister(0), i.OutputRegister(), scratch);
-      break;
-    }
-    case kMips64TruncUwS: {
-      FPURegister scratch = kScratchDoubleReg;
-      // TODO(plind): Fix wrong param order of Trunc_uw_d() macro-asm function.
-      __ Trunc_uw_s(i.InputDoubleRegister(0), i.OutputRegister(), scratch);
-      // Avoid UINT32_MAX as an overflow indicator and use 0 instead,
-      // because 0 allows easier out-of-bounds detection.
-      __ addiu(kScratchReg, i.OutputRegister(), 1);
-      __ Movz(i.OutputRegister(), zero_reg, kScratchReg);
-      break;
-    }
-    case kMips64TruncUlS: {
-      FPURegister scratch = kScratchDoubleReg;
-      Register result = instr->OutputCount() > 1 ? i.OutputRegister(1) : no_reg;
-      // TODO(plind): Fix wrong param order of Trunc_ul_s() macro-asm function.
-      __ Trunc_ul_s(i.InputDoubleRegister(0), i.OutputRegister(), scratch,
-                    result);
-      break;
-    }
-    case kMips64TruncUlD: {
-      FPURegister scratch = kScratchDoubleReg;
-      Register result = instr->OutputCount() > 1 ? i.OutputRegister(1) : no_reg;
-      // TODO(plind): Fix wrong param order of Trunc_ul_d() macro-asm function.
-      __ Trunc_ul_d(i.InputDoubleRegister(0), i.OutputRegister(0), scratch,
-                    result);
-      break;
-    }
-    case kMips64BitcastDL:
-      __ dmfc1(i.OutputRegister(), i.InputDoubleRegister(0));
-      break;
-    case kMips64BitcastLD:
-      __ dmtc1(i.InputRegister(0), i.OutputDoubleRegister());
-      break;
-    case kMips64Float64ExtractLowWord32:
-      __ FmoveLow(i.OutputRegister(), i.InputDoubleRegister(0));
-      break;
-    case kMips64Float64ExtractHighWord32:
-      __ FmoveHigh(i.OutputRegister(), i.InputDoubleRegister(0));
-      break;
-    case kMips64Float64InsertLowWord32:
-      __ FmoveLow(i.OutputDoubleRegister(), i.InputRegister(1));
-      break;
-    case kMips64Float64InsertHighWord32:
-      __ FmoveHigh(i.OutputDoubleRegister(), i.InputRegister(1));
-      break;
-    // ... more basic instructions ...
-
-    case kMips64Seb:
-      __ seb(i.OutputRegister(), i.InputRegister(0));
-      break;
-    case kMips64Seh:
-      __ seh(i.OutputRegister(), i.InputRegister(0));
-      break;
-    case kMips64Lbu:
-      __ Lbu(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kMips64Lb:
-      __ Lb(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kMips64Sb:
-      __ Sb(i.InputOrZeroRegister(2), i.MemoryOperand());
-      break;
-    case kMips64Lhu:
-      __ Lhu(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kMips64Ulhu:
-      __ Ulhu(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kMips64Lh:
-      __ Lh(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kMips64Ulh:
-      __ Ulh(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kMips64Sh:
-      __ Sh(i.InputOrZeroRegister(2), i.MemoryOperand());
-      break;
-    case kMips64Ush:
-      __ Ush(i.InputOrZeroRegister(2), i.MemoryOperand(), kScratchReg);
-      break;
-    case kMips64Lw:
-      __ Lw(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kMips64Ulw:
-      __ Ulw(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kMips64Lwu:
-      __ Lwu(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kMips64Ulwu:
-      __ Ulwu(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kMips64Ld:
-      __ Ld(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kMips64Uld:
-      __ Uld(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kMips64Sw:
-      __ Sw(i.InputOrZeroRegister(2), i.MemoryOperand());
-      break;
-    case kMips64Usw:
-      __ Usw(i.InputOrZeroRegister(2), i.MemoryOperand());
-      break;
-    case kMips64Sd:
-      __ Sd(i.InputOrZeroRegister(2), i.MemoryOperand());
-      break;
-    case kMips64Usd:
-      __ Usd(i.InputOrZeroRegister(2), i.MemoryOperand());
-      break;
-    case kMips64Lwc1: {
-      __ Lwc1(i.OutputSingleRegister(), i.MemoryOperand());
-      break;
-    }
-    case kMips64Ulwc1: {
-      __ Ulwc1(i.OutputSingleRegister(), i.MemoryOperand(), kScratchReg);
-      break;
-    }
-    case kMips64Swc1: {
-      size_t index = 0;
-      MemOperand operand = i.MemoryOperand(&index);
-      FPURegister ft = i.InputOrZeroSingleRegister(index);
-      if (ft == kDoubleRegZero && !__ IsDoubleZeroRegSet()) {
-        __ Move(kDoubleRegZero, 0.0);
-      }
-      __ Swc1(ft, operand);
-      break;
-    }
-    case kMips64Uswc1: {
-      size_t index = 0;
-      MemOperand operand = i.MemoryOperand(&index);
-      FPURegister ft = i.InputOrZeroSingleRegister(index);
-      if (ft == kDoubleRegZero && !__ IsDoubleZeroRegSet()) {
-        __ Move(kDoubleRegZero, 0.0);
-      }
-      __ Uswc1(ft, operand, kScratchReg);
-      break;
-    }
-    case kMips64Ldc1:
-      __ Ldc1(i.OutputDoubleRegister(), i.MemoryOperand());
-      break;
-    case kMips64Uldc1:
-      __ Uldc1(i.OutputDoubleRegister(), i.MemoryOperand(), kScratchReg);
-      break;
-    case kMips64Sdc1: {
-      FPURegister ft = i.InputOrZeroDoubleRegister(2);
-      if (ft == kDoubleRegZero && !__ IsDoubleZeroRegSet()) {
-        __ Move(kDoubleRegZero, 0.0);
-      }
-      __ Sdc1(ft, i.MemoryOperand());
-      break;
-    }
-    case kMips64Usdc1: {
-      FPURegister ft = i.InputOrZeroDoubleRegister(2);
-      if (ft == kDoubleRegZero && !__ IsDoubleZeroRegSet()) {
-        __ Move(kDoubleRegZero, 0.0);
-      }
-      __ Usdc1(ft, i.MemoryOperand(), kScratchReg);
-      break;
-    }
-    case kMips64Push:
-      if (instr->InputAt(0)->IsFPRegister()) {
-        __ Sdc1(i.InputDoubleRegister(0), MemOperand(sp, -kDoubleSize));
-        __ Subu(sp, sp, Operand(kDoubleSize));
-        frame_access_state()->IncreaseSPDelta(kDoubleSize / kPointerSize);
-      } else {
-        __ Push(i.InputRegister(0));
-        frame_access_state()->IncreaseSPDelta(1);
-      }
-      break;
-    case kMips64Peek: {
-      // The incoming value is 0-based, but we need a 1-based value.
-      int reverse_slot = MiscField::decode(instr->opcode()) + 1;
-      int offset =
-          FrameSlotToFPOffset(frame()->GetTotalFrameSlotCount() - reverse_slot);
-      if (instr->OutputAt(0)->IsFPRegister()) {
-        LocationOperand* op = LocationOperand::cast(instr->OutputAt(0));
-        if (op->representation() == MachineRepresentation::kFloat64) {
-          __ Ldc1(i.OutputDoubleRegister(), MemOperand(fp, offset));
-        } else {
-          DCHECK_EQ(op->representation(), MachineRepresentation::kFloat32);
-          __ lwc1(i.OutputSingleRegister(0), MemOperand(fp, offset));
-        }
-      } else {
-        __ Ld(i.OutputRegister(0), MemOperand(fp, offset));
-      }
-      break;
-    }
-    case kMips64StackClaim: {
-      __ Dsubu(sp, sp, Operand(i.InputInt32(0)));
-      frame_access_state()->IncreaseSPDelta(i.InputInt32(0) / kPointerSize);
-      break;
-    }
-    case kMips64StoreToStackSlot: {
-      if (instr->InputAt(0)->IsFPRegister()) {
-        __ Sdc1(i.InputDoubleRegister(0), MemOperand(sp, i.InputInt32(1)));
-      } else {
-        __ Sd(i.InputRegister(0), MemOperand(sp, i.InputInt32(1)));
-      }
-      break;
-    }
-    case kMips64ByteSwap64: {
-      __ ByteSwapSigned(i.OutputRegister(0), i.InputRegister(0), 8);
-      break;
-    }
-    case kMips64ByteSwap32: {
-      __ ByteSwapUnsigned(i.OutputRegister(0), i.InputRegister(0), 4);
-      __ dsrl32(i.OutputRegister(0), i.OutputRegister(0), 0);
-      break;
-    }
-    case kAtomicLoadInt8:
-      ASSEMBLE_ATOMIC_LOAD_INTEGER(Lb);
-      break;
-    case kAtomicLoadUint8:
-      ASSEMBLE_ATOMIC_LOAD_INTEGER(Lbu);
-      break;
-    case kAtomicLoadInt16:
-      ASSEMBLE_ATOMIC_LOAD_INTEGER(Lh);
-      break;
-    case kAtomicLoadUint16:
-      ASSEMBLE_ATOMIC_LOAD_INTEGER(Lhu);
-      break;
-    case kAtomicLoadWord32:
-      ASSEMBLE_ATOMIC_LOAD_INTEGER(Lw);
-      break;
-    case kAtomicStoreWord8:
-      ASSEMBLE_ATOMIC_STORE_INTEGER(Sb);
-      break;
-    case kAtomicStoreWord16:
-      ASSEMBLE_ATOMIC_STORE_INTEGER(Sh);
-      break;
-    case kAtomicStoreWord32:
-      ASSEMBLE_ATOMIC_STORE_INTEGER(Sw);
-      break;
-    case kAtomicExchangeInt8:
-      ASSEMBLE_ATOMIC_EXCHANGE_INTEGER_EXT(true, 8);
-      break;
-    case kAtomicExchangeUint8:
-      ASSEMBLE_ATOMIC_EXCHANGE_INTEGER_EXT(false, 8);
-      break;
-    case kAtomicExchangeInt16:
-      ASSEMBLE_ATOMIC_EXCHANGE_INTEGER_EXT(true, 16);
-      break;
-    case kAtomicExchangeUint16:
-      ASSEMBLE_ATOMIC_EXCHANGE_INTEGER_EXT(false, 16);
-      break;
-    case kAtomicExchangeWord32:
-      ASSEMBLE_ATOMIC_EXCHANGE_INTEGER();
-      break;
-    case kAtomicCompareExchangeInt8:
-      ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER_EXT(true, 8);
-      break;
-    case kAtomicCompareExchangeUint8:
-      ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER_EXT(false, 8);
-      break;
-    case kAtomicCompareExchangeInt16:
-      ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER_EXT(true, 16);
-      break;
-    case kAtomicCompareExchangeUint16:
-      ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER_EXT(false, 16);
-      break;
-    case kAtomicCompareExchangeWord32:
-      __ sll(i.InputRegister(2), i.InputRegister(2), 0);
-      ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_INTEGER();
-      break;
-#define ATOMIC_BINOP_CASE(op, inst)             \
-  case kAtomic##op##Int8:                       \
-    ASSEMBLE_ATOMIC_BINOP_EXT(true, 8, inst);   \
-    break;                                      \
-  case kAtomic##op##Uint8:                      \
-    ASSEMBLE_ATOMIC_BINOP_EXT(false, 8, inst);  \
-    break;                                      \
-  case kAtomic##op##Int16:                      \
-    ASSEMBLE_ATOMIC_BINOP_EXT(true, 16, inst);  \
-    break;                                      \
-  case kAtomic##op##Uint16:                     \
-    ASSEMBLE_ATOMIC_BINOP_EXT(false, 16, inst); \
-    break;                                      \
-  case kAtomic##op##Word32:                     \
-    ASSEMBLE_ATOMIC_BINOP(inst);                \
-    break;
-      ATOMIC_BINOP_CASE(Add, Addu)
-      ATOMIC_BINOP_CASE(Sub, Subu)
-      ATOMIC_BINOP_CASE(And, And)
-      ATOMIC_BINOP_CASE(Or, Or)
-      ATOMIC_BINOP_CASE(Xor, Xor)
-#undef ATOMIC_BINOP_CASE
-    case kMips64AssertEqual:
-      __ Assert(eq, static_cast<AbortReason>(i.InputOperand(2).immediate()),
-                i.InputRegister(0), Operand(i.InputRegister(1)));
-      break;
-    case kMips64S128Zero: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ xor_v(i.OutputSimd128Register(), i.OutputSimd128Register(),
-               i.OutputSimd128Register());
-      break;
-    }
-    case kMips64I32x4Splat: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ fill_w(i.OutputSimd128Register(), i.InputRegister(0));
-      break;
-    }
-    case kMips64I32x4ExtractLane: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ copy_s_w(i.OutputRegister(), i.InputSimd128Register(0),
-                  i.InputInt8(1));
-      break;
-    }
-    case kMips64I32x4ReplaceLane: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register src = i.InputSimd128Register(0);
-      Simd128Register dst = i.OutputSimd128Register();
-      if (src != dst) {
-        __ move_v(dst, src);
-      }
-      __ insert_w(dst, i.InputInt8(1), i.InputRegister(2));
-      break;
-    }
-    case kMips64I32x4Add: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ addv_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I32x4Sub: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ subv_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64F32x4Splat: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ FmoveLow(kScratchReg, i.InputSingleRegister(0));
-      __ fill_w(i.OutputSimd128Register(), kScratchReg);
-      break;
-    }
-    case kMips64F32x4ExtractLane: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ copy_u_w(kScratchReg, i.InputSimd128Register(0), i.InputInt8(1));
-      __ FmoveLow(i.OutputSingleRegister(), kScratchReg);
-      break;
-    }
-    case kMips64F32x4ReplaceLane: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register src = i.InputSimd128Register(0);
-      Simd128Register dst = i.OutputSimd128Register();
-      if (src != dst) {
-        __ move_v(dst, src);
-      }
-      __ FmoveLow(kScratchReg, i.InputSingleRegister(2));
-      __ insert_w(dst, i.InputInt8(1), kScratchReg);
-      break;
-    }
-    case kMips64F32x4SConvertI32x4: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ ffint_s_w(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kMips64F32x4UConvertI32x4: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ ffint_u_w(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kMips64I32x4Mul: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ mulv_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I32x4MaxS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ max_s_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I32x4MinS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ min_s_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I32x4Eq: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ ceq_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-               i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I32x4Ne: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register();
-      __ ceq_w(dst, i.InputSimd128Register(0), i.InputSimd128Register(1));
-      __ nor_v(dst, dst, dst);
-      break;
-    }
-    case kMips64I32x4Shl: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ slli_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputInt5(1));
-      break;
-    }
-    case kMips64I32x4ShrS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ srai_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputInt5(1));
-      break;
-    }
-    case kMips64I32x4ShrU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ srli_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputInt5(1));
-      break;
-    }
-    case kMips64I32x4MaxU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ max_u_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I32x4MinU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ min_u_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64S128Select: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      DCHECK(i.OutputSimd128Register() == i.InputSimd128Register(0));
-      __ bsel_v(i.OutputSimd128Register(), i.InputSimd128Register(2),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64F32x4Abs: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ bclri_w(i.OutputSimd128Register(), i.InputSimd128Register(0), 31);
-      break;
-    }
-    case kMips64F32x4Neg: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ bnegi_w(i.OutputSimd128Register(), i.InputSimd128Register(0), 31);
-      break;
-    }
-    case kMips64F32x4RecipApprox: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ frcp_w(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kMips64F32x4RecipSqrtApprox: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ frsqrt_w(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kMips64F32x4Add: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ fadd_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64F32x4Sub: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ fsub_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64F32x4Mul: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ fmul_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64F32x4Max: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ fmax_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64F32x4Min: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ fmin_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64F32x4Eq: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ fceq_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64F32x4Ne: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ fcne_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64F32x4Lt: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ fclt_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64F32x4Le: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ fcle_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I32x4SConvertF32x4: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ ftrunc_s_w(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kMips64I32x4UConvertF32x4: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ ftrunc_u_w(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kMips64I32x4Neg: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
-      __ subv_w(i.OutputSimd128Register(), kSimd128RegZero,
-                i.InputSimd128Register(0));
-      break;
-    }
-    case kMips64I32x4GtS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ clt_s_w(i.OutputSimd128Register(), i.InputSimd128Register(1),
-                 i.InputSimd128Register(0));
-      break;
-    }
-    case kMips64I32x4GeS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ cle_s_w(i.OutputSimd128Register(), i.InputSimd128Register(1),
-                 i.InputSimd128Register(0));
-      break;
-    }
-    case kMips64I32x4GtU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ clt_u_w(i.OutputSimd128Register(), i.InputSimd128Register(1),
-                 i.InputSimd128Register(0));
-      break;
-    }
-    case kMips64I32x4GeU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ cle_u_w(i.OutputSimd128Register(), i.InputSimd128Register(1),
-                 i.InputSimd128Register(0));
-      break;
-    }
-    case kMips64I16x8Splat: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ fill_h(i.OutputSimd128Register(), i.InputRegister(0));
-      break;
-    }
-    case kMips64I16x8ExtractLane: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ copy_s_h(i.OutputRegister(), i.InputSimd128Register(0),
-                  i.InputInt8(1));
-      break;
-    }
-    case kMips64I16x8ReplaceLane: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register src = i.InputSimd128Register(0);
-      Simd128Register dst = i.OutputSimd128Register();
-      if (src != dst) {
-        __ move_v(dst, src);
-      }
-      __ insert_h(dst, i.InputInt8(1), i.InputRegister(2));
-      break;
-    }
-    case kMips64I16x8Neg: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
-      __ subv_h(i.OutputSimd128Register(), kSimd128RegZero,
-                i.InputSimd128Register(0));
-      break;
-    }
-    case kMips64I16x8Shl: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ slli_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputInt4(1));
-      break;
-    }
-    case kMips64I16x8ShrS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ srai_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputInt4(1));
-      break;
-    }
-    case kMips64I16x8ShrU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ srli_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputInt4(1));
-      break;
-    }
-    case kMips64I16x8Add: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ addv_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I16x8AddSaturateS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ adds_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I16x8Sub: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ subv_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I16x8SubSaturateS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ subs_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I16x8Mul: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ mulv_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I16x8MaxS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ max_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I16x8MinS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ min_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I16x8Eq: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ ceq_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-               i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I16x8Ne: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register();
-      __ ceq_h(dst, i.InputSimd128Register(0), i.InputSimd128Register(1));
-      __ nor_v(dst, dst, dst);
-      break;
-    }
-    case kMips64I16x8GtS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ clt_s_h(i.OutputSimd128Register(), i.InputSimd128Register(1),
-                 i.InputSimd128Register(0));
-      break;
-    }
-    case kMips64I16x8GeS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ cle_s_h(i.OutputSimd128Register(), i.InputSimd128Register(1),
-                 i.InputSimd128Register(0));
-      break;
-    }
-    case kMips64I16x8AddSaturateU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ adds_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I16x8SubSaturateU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ subs_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I16x8MaxU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ max_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I16x8MinU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ min_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I16x8GtU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ clt_u_h(i.OutputSimd128Register(), i.InputSimd128Register(1),
-                 i.InputSimd128Register(0));
-      break;
-    }
-    case kMips64I16x8GeU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ cle_u_h(i.OutputSimd128Register(), i.InputSimd128Register(1),
-                 i.InputSimd128Register(0));
-      break;
-    }
-    case kMips64I8x16Splat: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ fill_b(i.OutputSimd128Register(), i.InputRegister(0));
-      break;
-    }
-    case kMips64I8x16ExtractLane: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ copy_s_b(i.OutputRegister(), i.InputSimd128Register(0),
-                  i.InputInt8(1));
-      break;
-    }
-    case kMips64I8x16ReplaceLane: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register src = i.InputSimd128Register(0);
-      Simd128Register dst = i.OutputSimd128Register();
-      if (src != dst) {
-        __ move_v(dst, src);
-      }
-      __ insert_b(dst, i.InputInt8(1), i.InputRegister(2));
-      break;
-    }
-    case kMips64I8x16Neg: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
-      __ subv_b(i.OutputSimd128Register(), kSimd128RegZero,
-                i.InputSimd128Register(0));
-      break;
-    }
-    case kMips64I8x16Shl: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ slli_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputInt3(1));
-      break;
-    }
-    case kMips64I8x16ShrS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ srai_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputInt3(1));
-      break;
-    }
-    case kMips64I8x16Add: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ addv_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I8x16AddSaturateS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ adds_s_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I8x16Sub: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ subv_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I8x16SubSaturateS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ subs_s_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I8x16Mul: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ mulv_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I8x16MaxS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ max_s_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I8x16MinS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ min_s_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I8x16Eq: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ ceq_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-               i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I8x16Ne: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register();
-      __ ceq_b(dst, i.InputSimd128Register(0), i.InputSimd128Register(1));
-      __ nor_v(dst, dst, dst);
-      break;
-    }
-    case kMips64I8x16GtS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ clt_s_b(i.OutputSimd128Register(), i.InputSimd128Register(1),
-                 i.InputSimd128Register(0));
-      break;
-    }
-    case kMips64I8x16GeS: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ cle_s_b(i.OutputSimd128Register(), i.InputSimd128Register(1),
-                 i.InputSimd128Register(0));
-      break;
-    }
-    case kMips64I8x16ShrU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ srli_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                i.InputInt3(1));
-      break;
-    }
-    case kMips64I8x16AddSaturateU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ adds_u_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I8x16SubSaturateU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ subs_u_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                  i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I8x16MaxU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ max_u_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I8x16MinU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ min_u_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
-                 i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64I8x16GtU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ clt_u_b(i.OutputSimd128Register(), i.InputSimd128Register(1),
-                 i.InputSimd128Register(0));
-      break;
-    }
-    case kMips64I8x16GeU: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ cle_u_b(i.OutputSimd128Register(), i.InputSimd128Register(1),
-                 i.InputSimd128Register(0));
-      break;
-    }
-    case kMips64S128And: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ and_v(i.OutputSimd128Register(), i.InputSimd128Register(0),
-               i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64S128Or: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ or_v(i.OutputSimd128Register(), i.InputSimd128Register(0),
-              i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64S128Xor: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ xor_v(i.OutputSimd128Register(), i.InputSimd128Register(0),
-               i.InputSimd128Register(1));
-      break;
-    }
-    case kMips64S128Not: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ nor_v(i.OutputSimd128Register(), i.InputSimd128Register(0),
-               i.InputSimd128Register(0));
-      break;
-    }
-    case kMips64S1x4AnyTrue:
-    case kMips64S1x8AnyTrue:
-    case kMips64S1x16AnyTrue: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Register dst = i.OutputRegister();
-      Label all_false;
-      __ BranchMSA(&all_false, MSA_BRANCH_V, all_zero,
-                   i.InputSimd128Register(0), USE_DELAY_SLOT);
-      __ li(dst, 0);  // branch delay slot
-      __ li(dst, -1);
-      __ bind(&all_false);
-      break;
-    }
-    case kMips64S1x4AllTrue: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Register dst = i.OutputRegister();
-      Label all_true;
-      __ BranchMSA(&all_true, MSA_BRANCH_W, all_not_zero,
-                   i.InputSimd128Register(0), USE_DELAY_SLOT);
-      __ li(dst, -1);  // branch delay slot
-      __ li(dst, 0);
-      __ bind(&all_true);
-      break;
-    }
-    case kMips64S1x8AllTrue: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Register dst = i.OutputRegister();
-      Label all_true;
-      __ BranchMSA(&all_true, MSA_BRANCH_H, all_not_zero,
-                   i.InputSimd128Register(0), USE_DELAY_SLOT);
-      __ li(dst, -1);  // branch delay slot
-      __ li(dst, 0);
-      __ bind(&all_true);
-      break;
-    }
-    case kMips64S1x16AllTrue: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Register dst = i.OutputRegister();
-      Label all_true;
-      __ BranchMSA(&all_true, MSA_BRANCH_B, all_not_zero,
-                   i.InputSimd128Register(0), USE_DELAY_SLOT);
-      __ li(dst, -1);  // branch delay slot
-      __ li(dst, 0);
-      __ bind(&all_true);
-      break;
-    }
-    case kMips64MsaLd: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ ld_b(i.OutputSimd128Register(), i.MemoryOperand());
-      break;
-    }
-    case kMips64MsaSt: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ st_b(i.InputSimd128Register(2), i.MemoryOperand());
-      break;
-    }
-    case kMips64S32x4InterleaveRight: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [7, 6, 5, 4], src0 = [3, 2, 1, 0]
-      // dst = [5, 1, 4, 0]
-      __ ilvr_w(dst, src1, src0);
-      break;
-    }
-    case kMips64S32x4InterleaveLeft: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [7, 6, 5, 4], src0 = [3, 2, 1, 0]
-      // dst = [7, 3, 6, 2]
-      __ ilvl_w(dst, src1, src0);
-      break;
-    }
-    case kMips64S32x4PackEven: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [7, 6, 5, 4], src0 = [3, 2, 1, 0]
-      // dst = [6, 4, 2, 0]
-      __ pckev_w(dst, src1, src0);
-      break;
-    }
-    case kMips64S32x4PackOdd: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [7, 6, 5, 4], src0 = [3, 2, 1, 0]
-      // dst = [7, 5, 3, 1]
-      __ pckod_w(dst, src1, src0);
-      break;
-    }
-    case kMips64S32x4InterleaveEven: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [7, 6, 5, 4], src0 = [3, 2, 1, 0]
-      // dst = [6, 2, 4, 0]
-      __ ilvev_w(dst, src1, src0);
-      break;
-    }
-    case kMips64S32x4InterleaveOdd: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [7, 6, 5, 4], src0 = [3, 2, 1, 0]
-      // dst = [7, 3, 5, 1]
-      __ ilvod_w(dst, src1, src0);
-      break;
-    }
-    case kMips64S32x4Shuffle: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-
-      int32_t shuffle = i.InputInt32(2);
-
-      if (src0 == src1) {
-        // Unary S32x4 shuffles are handled with shf.w instruction
-        unsigned lane = shuffle & 0xFF;
-        if (FLAG_debug_code) {
-          // range of all four lanes, for unary instruction,
-          // should belong to the same range, which can be one of these:
-          // [0, 3] or [4, 7]
-          if (lane >= 4) {
-            int32_t shuffle_helper = shuffle;
-            for (int i = 0; i < 4; ++i) {
-              lane = shuffle_helper & 0xFF;
-              CHECK_GE(lane, 4);
-              shuffle_helper >>= 8;
-            }
-          }
-        }
-        uint32_t i8 = 0;
-        for (int i = 0; i < 4; i++) {
-          lane = shuffle & 0xFF;
-          if (lane >= 4) {
-            lane -= 4;
-          }
-          DCHECK_GT(4, lane);
-          i8 |= lane << (2 * i);
-          shuffle >>= 8;
-        }
-        __ shf_w(dst, src0, i8);
-      } else {
-        // For binary shuffles use vshf.w instruction
-        if (dst == src0) {
-          __ move_v(kSimd128ScratchReg, src0);
-          src0 = kSimd128ScratchReg;
-        } else if (dst == src1) {
-          __ move_v(kSimd128ScratchReg, src1);
-          src1 = kSimd128ScratchReg;
-        }
-
-        __ li(kScratchReg, i.InputInt32(2));
-        __ insert_w(dst, 0, kScratchReg);
-        __ xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
-        __ ilvr_b(dst, kSimd128RegZero, dst);
-        __ ilvr_h(dst, kSimd128RegZero, dst);
-        __ vshf_w(dst, src1, src0);
-      }
-      break;
-    }
-    case kMips64S16x8InterleaveRight: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [15, ... 11, 10, 9, 8], src0 = [7, ... 3, 2, 1, 0]
-      // dst = [11, 3, 10, 2, 9, 1, 8, 0]
-      __ ilvr_h(dst, src1, src0);
-      break;
-    }
-    case kMips64S16x8InterleaveLeft: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [15, ... 11, 10, 9, 8], src0 = [7, ... 3, 2, 1, 0]
-      // dst = [15, 7, 14, 6, 13, 5, 12, 4]
-      __ ilvl_h(dst, src1, src0);
-      break;
-    }
-    case kMips64S16x8PackEven: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [15, ... 11, 10, 9, 8], src0 = [7, ... 3, 2, 1, 0]
-      // dst = [14, 12, 10, 8, 6, 4, 2, 0]
-      __ pckev_h(dst, src1, src0);
-      break;
-    }
-    case kMips64S16x8PackOdd: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [15, ... 11, 10, 9, 8], src0 = [7, ... 3, 2, 1, 0]
-      // dst = [15, 13, 11, 9, 7, 5, 3, 1]
-      __ pckod_h(dst, src1, src0);
-      break;
-    }
-    case kMips64S16x8InterleaveEven: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [15, ... 11, 10, 9, 8], src0 = [7, ... 3, 2, 1, 0]
-      // dst = [14, 6, 12, 4, 10, 2, 8, 0]
-      __ ilvev_h(dst, src1, src0);
-      break;
-    }
-    case kMips64S16x8InterleaveOdd: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [15, ... 11, 10, 9, 8], src0 = [7, ... 3, 2, 1, 0]
-      // dst = [15, 7, ... 11, 3, 9, 1]
-      __ ilvod_h(dst, src1, src0);
-      break;
-    }
-    case kMips64S16x4Reverse: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      // src = [7, 6, 5, 4, 3, 2, 1, 0], dst = [4, 5, 6, 7, 0, 1, 2, 3]
-      // shf.df imm field: 0 1 2 3 = 00011011 = 0x1B
-      __ shf_h(i.OutputSimd128Register(), i.InputSimd128Register(0), 0x1B);
-      break;
-    }
-    case kMips64S16x2Reverse: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      // src = [7, 6, 5, 4, 3, 2, 1, 0], dst = [6, 7, 4, 5, 3, 2, 0, 1]
-      // shf.df imm field: 2 3 0 1 = 10110001 = 0xB1
-      __ shf_h(i.OutputSimd128Register(), i.InputSimd128Register(0), 0xB1);
-      break;
-    }
-    case kMips64S8x16InterleaveRight: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [31, ... 19, 18, 17, 16], src0 = [15, ... 3, 2, 1, 0]
-      // dst = [23, 7, ... 17, 1, 16, 0]
-      __ ilvr_b(dst, src1, src0);
-      break;
-    }
-    case kMips64S8x16InterleaveLeft: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [31, ... 19, 18, 17, 16], src0 = [15, ... 3, 2, 1, 0]
-      // dst = [31, 15, ... 25, 9, 24, 8]
-      __ ilvl_b(dst, src1, src0);
-      break;
-    }
-    case kMips64S8x16PackEven: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [31, ... 19, 18, 17, 16], src0 = [15, ... 3, 2, 1, 0]
-      // dst = [30, 28, ... 6, 4, 2, 0]
-      __ pckev_b(dst, src1, src0);
-      break;
-    }
-    case kMips64S8x16PackOdd: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [31, ... 19, 18, 17, 16], src0 = [15, ... 3, 2, 1, 0]
-      // dst = [31, 29, ... 7, 5, 3, 1]
-      __ pckod_b(dst, src1, src0);
-      break;
-    }
-    case kMips64S8x16InterleaveEven: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [31, ... 19, 18, 17, 16], src0 = [15, ... 3, 2, 1, 0]
-      // dst = [30, 14, ... 18, 2, 16, 0]
-      __ ilvev_b(dst, src1, src0);
-      break;
-    }
-    case kMips64S8x16InterleaveOdd: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-      // src1 = [31, ... 19, 18, 17, 16], src0 = [15, ... 3, 2, 1, 0]
-      // dst = [31, 15, ... 19, 3, 17, 1]
-      __ ilvod_b(dst, src1, src0);
-      break;
-    }
-    case kMips64S8x16Concat: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register();
-      DCHECK(dst == i.InputSimd128Register(0));
-      __ sldi_b(dst, i.InputSimd128Register(1), i.InputInt4(2));
-      break;
-    }
-    case kMips64S8x16Shuffle: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register(),
-                      src0 = i.InputSimd128Register(0),
-                      src1 = i.InputSimd128Register(1);
-
-      if (dst == src0) {
-        __ move_v(kSimd128ScratchReg, src0);
-        src0 = kSimd128ScratchReg;
-      } else if (dst == src1) {
-        __ move_v(kSimd128ScratchReg, src1);
-        src1 = kSimd128ScratchReg;
-      }
-
-      int64_t control_low =
-          static_cast<int64_t>(i.InputInt32(3)) << 32 | i.InputInt32(2);
-      int64_t control_hi =
-          static_cast<int64_t>(i.InputInt32(5)) << 32 | i.InputInt32(4);
-      __ li(kScratchReg, control_low);
-      __ insert_d(dst, 0, kScratchReg);
-      __ li(kScratchReg, control_hi);
-      __ insert_d(dst, 1, kScratchReg);
-      __ vshf_b(dst, src1, src0);
-      break;
-    }
-    case kMips64S8x8Reverse: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      // src = [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
-      // dst = [8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7]
-      // [A B C D] => [B A D C]: shf.w imm: 2 3 0 1 = 10110001 = 0xB1
-      // C: [7, 6, 5, 4] => A': [4, 5, 6, 7]: shf.b imm: 00011011 = 0x1B
-      __ shf_w(kSimd128ScratchReg, i.InputSimd128Register(0), 0xB1);
-      __ shf_b(i.OutputSimd128Register(), kSimd128ScratchReg, 0x1B);
-      break;
-    }
-    case kMips64S8x4Reverse: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      // src = [15, 14, ... 3, 2, 1, 0], dst = [12, 13, 14, 15, ... 0, 1, 2, 3]
-      // shf.df imm field: 0 1 2 3 = 00011011 = 0x1B
-      __ shf_b(i.OutputSimd128Register(), i.InputSimd128Register(0), 0x1B);
-      break;
-    }
-    case kMips64S8x2Reverse: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      // src = [15, 14, ... 3, 2, 1, 0], dst = [14, 15, 12, 13, ... 2, 3, 0, 1]
-      // shf.df imm field: 2 3 0 1 = 10110001 = 0xB1
-      __ shf_b(i.OutputSimd128Register(), i.InputSimd128Register(0), 0xB1);
-      break;
-    }
-    case kMips64I32x4SConvertI16x8Low: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register();
-      Simd128Register src = i.InputSimd128Register(0);
-      __ ilvr_h(kSimd128ScratchReg, src, src);
-      __ slli_w(dst, kSimd128ScratchReg, 16);
-      __ srai_w(dst, dst, 16);
-      break;
-    }
-    case kMips64I32x4SConvertI16x8High: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register();
-      Simd128Register src = i.InputSimd128Register(0);
-      __ ilvl_h(kSimd128ScratchReg, src, src);
-      __ slli_w(dst, kSimd128ScratchReg, 16);
-      __ srai_w(dst, dst, 16);
-      break;
-    }
-    case kMips64I32x4UConvertI16x8Low: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
-      __ ilvr_h(i.OutputSimd128Register(), kSimd128RegZero,
-                i.InputSimd128Register(0));
-      break;
-    }
-    case kMips64I32x4UConvertI16x8High: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
-      __ ilvl_h(i.OutputSimd128Register(), kSimd128RegZero,
-                i.InputSimd128Register(0));
-      break;
-    }
-    case kMips64I16x8SConvertI8x16Low: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register();
-      Simd128Register src = i.InputSimd128Register(0);
-      __ ilvr_b(kSimd128ScratchReg, src, src);
-      __ slli_h(dst, kSimd128ScratchReg, 8);
-      __ srai_h(dst, dst, 8);
-      break;
-    }
-    case kMips64I16x8SConvertI8x16High: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register();
-      Simd128Register src = i.InputSimd128Register(0);
-      __ ilvl_b(kSimd128ScratchReg, src, src);
-      __ slli_h(dst, kSimd128ScratchReg, 8);
-      __ srai_h(dst, dst, 8);
-      break;
-    }
-    case kMips64I16x8SConvertI32x4: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register();
-      Simd128Register src0 = i.InputSimd128Register(0);
-      Simd128Register src1 = i.InputSimd128Register(1);
-      __ sat_s_w(kSimd128ScratchReg, src0, 15);
-      __ sat_s_w(kSimd128RegZero, src1, 15);  // kSimd128RegZero as scratch
-      __ pckev_h(dst, kSimd128RegZero, kSimd128ScratchReg);
-      break;
-    }
-    case kMips64I16x8UConvertI32x4: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register();
-      Simd128Register src0 = i.InputSimd128Register(0);
-      Simd128Register src1 = i.InputSimd128Register(1);
-      __ sat_u_w(kSimd128ScratchReg, src0, 15);
-      __ sat_u_w(kSimd128RegZero, src1, 15);  // kSimd128RegZero as scratch
-      __ pckev_h(dst, kSimd128RegZero, kSimd128ScratchReg);
-      break;
-    }
-    case kMips64I16x8UConvertI8x16Low: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
-      __ ilvr_b(i.OutputSimd128Register(), kSimd128RegZero,
-                i.InputSimd128Register(0));
-      break;
-    }
-    case kMips64I16x8UConvertI8x16High: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      __ xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
-      __ ilvl_b(i.OutputSimd128Register(), kSimd128RegZero,
-                i.InputSimd128Register(0));
-      break;
-    }
-    case kMips64I8x16SConvertI16x8: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register();
-      Simd128Register src0 = i.InputSimd128Register(0);
-      Simd128Register src1 = i.InputSimd128Register(1);
-      __ sat_s_h(kSimd128ScratchReg, src0, 7);
-      __ sat_s_h(kSimd128RegZero, src1, 7);  // kSimd128RegZero as scratch
-      __ pckev_b(dst, kSimd128RegZero, kSimd128ScratchReg);
-      break;
-    }
-    case kMips64I8x16UConvertI16x8: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register dst = i.OutputSimd128Register();
-      Simd128Register src0 = i.InputSimd128Register(0);
-      Simd128Register src1 = i.InputSimd128Register(1);
-      __ sat_u_h(kSimd128ScratchReg, src0, 7);
-      __ sat_u_h(kSimd128RegZero, src1, 7);  // kSimd128RegZero as scratch
-      __ pckev_b(dst, kSimd128RegZero, kSimd128ScratchReg);
-      break;
-    }
-    case kMips64F32x4AddHoriz: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register src0 = i.InputSimd128Register(0);
-      Simd128Register src1 = i.InputSimd128Register(1);
-      Simd128Register dst = i.OutputSimd128Register();
-      __ shf_w(kSimd128ScratchReg, src0, 0xB1);  // 2 3 0 1 : 10110001 : 0xB1
-      __ shf_w(kSimd128RegZero, src1, 0xB1);     // kSimd128RegZero as scratch
-      __ fadd_w(kSimd128ScratchReg, kSimd128ScratchReg, src0);
-      __ fadd_w(kSimd128RegZero, kSimd128RegZero, src1);
-      __ pckev_w(dst, kSimd128RegZero, kSimd128ScratchReg);
-      break;
-    }
-    case kMips64I32x4AddHoriz: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register src0 = i.InputSimd128Register(0);
-      Simd128Register src1 = i.InputSimd128Register(1);
-      Simd128Register dst = i.OutputSimd128Register();
-      __ hadd_s_d(kSimd128ScratchReg, src0, src0);
-      __ hadd_s_d(kSimd128RegZero, src1, src1);  // kSimd128RegZero as scratch
-      __ pckev_w(dst, kSimd128RegZero, kSimd128ScratchReg);
-      break;
-    }
-    case kMips64I16x8AddHoriz: {
-      CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
-      Simd128Register src0 = i.InputSimd128Register(0);
-      Simd128Register src1 = i.InputSimd128Register(1);
-      Simd128Register dst = i.OutputSimd128Register();
-      __ hadd_s_w(kSimd128ScratchReg, src0, src0);
-      __ hadd_s_w(kSimd128RegZero, src1, src1);  // kSimd128RegZero as scratch
-      __ pckev_h(dst, kSimd128RegZero, kSimd128ScratchReg);
-      break;
-    }
-  }
-  return kSuccess;
-}  // NOLINT(readability/fn_size)
-
-
-#define UNSUPPORTED_COND(opcode, condition)                                  \
-  OFStream out(stdout);                                                      \
-  out << "Unsupported " << #opcode << " condition: \"" << condition << "\""; \
-  UNIMPLEMENTED();
-
-static bool convertCondition(FlagsCondition condition, Condition& cc) {
-  switch (condition) {
-    case kEqual:
-      cc = eq;
-      return true;
-    case kNotEqual:
-      cc = ne;
-      return true;
-    case kUnsignedLessThan:
-      cc = lt;
-      return true;
-    case kUnsignedGreaterThanOrEqual:
-      cc = uge;
-      return true;
-    case kUnsignedLessThanOrEqual:
-      cc = le;
-      return true;
-    case kUnsignedGreaterThan:
-      cc = ugt;
-      return true;
-    default:
-      break;
-  }
-  return false;
-}
-
-void AssembleBranchToLabels(CodeGenerator* gen, TurboAssembler* tasm,
-                            Instruction* instr, FlagsCondition condition,
-                            Label* tlabel, Label* flabel, bool fallthru) {
-#undef __
-#define __ tasm->
-  MipsOperandConverter i(gen, instr);
-
-  Condition cc = kNoCondition;
-  // MIPS does not have condition code flags, so compare and branch are
-  // implemented differently than on the other arch's. The compare operations
-  // emit mips pseudo-instructions, which are handled here by branch
-  // instructions that do the actual comparison. Essential that the input
-  // registers to compare pseudo-op are not modified before this branch op, as
-  // they are tested here.
-
-  if (instr->arch_opcode() == kMips64Tst) {
-    cc = FlagsConditionToConditionTst(condition);
-    __ And(at, i.InputRegister(0), i.InputOperand(1));
-    __ Branch(tlabel, cc, at, Operand(zero_reg));
-  } else if (instr->arch_opcode() == kMips64Dadd ||
-             instr->arch_opcode() == kMips64Dsub) {
-    cc = FlagsConditionToConditionOvf(condition);
-    __ dsra32(kScratchReg, i.OutputRegister(), 0);
-    __ sra(at, i.OutputRegister(), 31);
-    __ Branch(tlabel, cc, at, Operand(kScratchReg));
-  } else if (instr->arch_opcode() == kMips64DaddOvf) {
-    switch (condition) {
-      case kOverflow:
-        __ DaddBranchOvf(i.OutputRegister(), i.InputRegister(0),
-                         i.InputOperand(1), tlabel, flabel);
-        break;
-      case kNotOverflow:
-        __ DaddBranchOvf(i.OutputRegister(), i.InputRegister(0),
-                         i.InputOperand(1), flabel, tlabel);
-        break;
-      default:
-        UNSUPPORTED_COND(kMips64DaddOvf, condition);
-        break;
-    }
-  } else if (instr->arch_opcode() == kMips64DsubOvf) {
-    switch (condition) {
-      case kOverflow:
-        __ DsubBranchOvf(i.OutputRegister(), i.InputRegister(0),
-                         i.InputOperand(1), tlabel, flabel);
-        break;
-      case kNotOverflow:
-        __ DsubBranchOvf(i.OutputRegister(), i.InputRegister(0),
-                         i.InputOperand(1), flabel, tlabel);
-        break;
-      default:
-        UNSUPPORTED_COND(kMips64DsubOvf, condition);
-        break;
-    }
-  } else if (instr->arch_opcode() == kMips64MulOvf) {
-    switch (condition) {
-      case kOverflow: {
-        __ MulBranchOvf(i.OutputRegister(), i.InputRegister(0),
-                        i.InputOperand(1), tlabel, flabel, kScratchReg);
-      } break;
-      case kNotOverflow: {
-        __ MulBranchOvf(i.OutputRegister(), i.InputRegister(0),
-                        i.InputOperand(1), flabel, tlabel, kScratchReg);
-      } break;
-      default:
-        UNSUPPORTED_COND(kMips64MulOvf, condition);
-        break;
-    }
-  } else if (instr->arch_opcode() == kMips64Cmp) {
-    cc = FlagsConditionToConditionCmp(condition);
-    __ Branch(tlabel, cc, i.InputRegister(0), i.InputOperand(1));
-  } else if (instr->arch_opcode() == kMips64CmpS) {
-    if (!convertCondition(condition, cc)) {
-      UNSUPPORTED_COND(kMips64CmpS, condition);
-    }
-    FPURegister left = i.InputOrZeroSingleRegister(0);
-    FPURegister right = i.InputOrZeroSingleRegister(1);
-    if ((left == kDoubleRegZero || right == kDoubleRegZero) &&
-        !__ IsDoubleZeroRegSet()) {
-      __ Move(kDoubleRegZero, 0.0);
-    }
-    __ BranchF32(tlabel, nullptr, cc, left, right);
-  } else if (instr->arch_opcode() == kMips64CmpD) {
-    if (!convertCondition(condition, cc)) {
-      UNSUPPORTED_COND(kMips64CmpD, condition);
-    }
-    FPURegister left = i.InputOrZeroDoubleRegister(0);
-    FPURegister right = i.InputOrZeroDoubleRegister(1);
-    if ((left == kDoubleRegZero || right == kDoubleRegZero) &&
-        !__ IsDoubleZeroRegSet()) {
-      __ Move(kDoubleRegZero, 0.0);
-    }
-    __ BranchF64(tlabel, nullptr, cc, left, right);
-  } else {
-    PrintF("AssembleArchBranch Unimplemented arch_opcode: %d\n",
-           instr->arch_opcode());
-    UNIMPLEMENTED();
-  }
-  if (!fallthru) __ Branch(flabel);  // no fallthru to flabel.
-#undef __
-#define __ tasm()->
-}
-
-// Assembles branches after an instruction.
-void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) {
-  Label* tlabel = branch->true_label;
-  Label* flabel = branch->false_label;
-
-  AssembleBranchToLabels(this, tasm(), instr, branch->condition, tlabel, flabel,
-                         branch->fallthru);
-}
-
-void CodeGenerator::AssembleArchDeoptBranch(Instruction* instr,
-                                            BranchInfo* branch) {
-  AssembleArchBranch(instr, branch);
-}
-
-void CodeGenerator::AssembleArchJump(RpoNumber target) {
-  if (!IsNextInAssemblyOrder(target)) __ Branch(GetLabel(target));
-}
-
-void CodeGenerator::AssembleArchTrap(Instruction* instr,
-                                     FlagsCondition condition) {
-  class OutOfLineTrap final : public OutOfLineCode {
-   public:
-    OutOfLineTrap(CodeGenerator* gen, bool frame_elided, Instruction* instr)
-        : OutOfLineCode(gen),
-          frame_elided_(frame_elided),
-          instr_(instr),
-          gen_(gen) {}
-    void Generate() final {
-      MipsOperandConverter i(gen_, instr_);
-      Builtins::Name trap_id =
-          static_cast<Builtins::Name>(i.InputInt32(instr_->InputCount() - 1));
-      bool old_has_frame = __ has_frame();
-      if (frame_elided_) {
-        __ set_has_frame(true);
-        __ EnterFrame(StackFrame::WASM_COMPILED);
-      }
-      GenerateCallToTrap(trap_id);
-      if (frame_elided_) {
-        __ set_has_frame(old_has_frame);
-      }
-    }
-
-   private:
-    void GenerateCallToTrap(Builtins::Name trap_id) {
-      if (trap_id == Builtins::builtin_count) {
-        // We cannot test calls to the runtime in cctest/test-run-wasm.
-        // Therefore we emit a call to C here instead of a call to the runtime.
-        // We use the context register as the scratch register, because we do
-        // not have a context here.
-        __ PrepareCallCFunction(0, 0, cp);
-        __ CallCFunction(ExternalReference::wasm_call_trap_callback_for_testing(
-                             tasm()->isolate()),
-                         0);
-        __ LeaveFrame(StackFrame::WASM_COMPILED);
-        CallDescriptor* descriptor = gen_->linkage()->GetIncomingDescriptor();
-        int pop_count = static_cast<int>(descriptor->StackParameterCount());
-        pop_count += (pop_count & 1);  // align
-        __ Drop(pop_count);
-        __ Ret();
-      } else {
-        gen_->AssembleSourcePosition(instr_);
-        __ Call(tasm()->isolate()->builtins()->builtin_handle(trap_id),
-                RelocInfo::CODE_TARGET);
-        ReferenceMap* reference_map =
-            new (gen_->zone()) ReferenceMap(gen_->zone());
-        gen_->RecordSafepoint(reference_map, Safepoint::kSimple, 0,
-                              Safepoint::kNoLazyDeopt);
-        if (FLAG_debug_code) {
-          __ stop(GetAbortReason(AbortReason::kUnexpectedReturnFromWasmTrap));
-        }
-      }
-    }
-    bool frame_elided_;
-    Instruction* instr_;
-    CodeGenerator* gen_;
-  };
-  bool frame_elided = !frame_access_state()->has_frame();
-  auto ool = new (zone()) OutOfLineTrap(this, frame_elided, instr);
-  Label* tlabel = ool->entry();
-  AssembleBranchToLabels(this, tasm(), instr, condition, tlabel, nullptr, true);
-}
-
-// Assembles boolean materializations after an instruction.
-void CodeGenerator::AssembleArchBoolean(Instruction* instr,
-                                        FlagsCondition condition) {
-  MipsOperandConverter i(this, instr);
-  Label done;
-
-  // Materialize a full 32-bit 1 or 0 value. The result register is always the
-  // last output of the instruction.
-  Label false_value;
-  DCHECK_NE(0u, instr->OutputCount());
-  Register result = i.OutputRegister(instr->OutputCount() - 1);
-  Condition cc = kNoCondition;
-  // MIPS does not have condition code flags, so compare and branch are
-  // implemented differently than on the other arch's. The compare operations
-  // emit mips pseudo-instructions, which are checked and handled here.
-
-  if (instr->arch_opcode() == kMips64Tst) {
-    cc = FlagsConditionToConditionTst(condition);
-    if (instr->InputAt(1)->IsImmediate() &&
-        base::bits::IsPowerOfTwo(i.InputOperand(1).immediate())) {
-      uint16_t pos =
-          base::bits::CountTrailingZeros64(i.InputOperand(1).immediate());
-      __ Dext(result, i.InputRegister(0), pos, 1);
-      if (cc == eq) {
-        __ xori(result, result, 1);
-      }
-    } else {
-      __ And(kScratchReg, i.InputRegister(0), i.InputOperand(1));
-      if (cc == eq) {
-        __ Sltu(result, kScratchReg, 1);
-      } else {
-        __ Sltu(result, zero_reg, kScratchReg);
-      }
-    }
-    return;
-  } else if (instr->arch_opcode() == kMips64Dadd ||
-             instr->arch_opcode() == kMips64Dsub) {
-    cc = FlagsConditionToConditionOvf(condition);
-    // Check for overflow creates 1 or 0 for result.
-    __ dsrl32(kScratchReg, i.OutputRegister(), 31);
-    __ srl(at, i.OutputRegister(), 31);
-    __ xor_(result, kScratchReg, at);
-    if (cc == eq)  // Toggle result for not overflow.
-      __ xori(result, result, 1);
-    return;
-  } else if (instr->arch_opcode() == kMips64DaddOvf ||
-             instr->arch_opcode() == kMips64DsubOvf ||
-             instr->arch_opcode() == kMips64MulOvf) {
-    Label flabel, tlabel;
-    switch (instr->arch_opcode()) {
-      case kMips64DaddOvf:
-        __ DaddBranchNoOvf(i.OutputRegister(), i.InputRegister(0),
-                           i.InputOperand(1), &flabel);
-
-        break;
-      case kMips64DsubOvf:
-        __ DsubBranchNoOvf(i.OutputRegister(), i.InputRegister(0),
-                           i.InputOperand(1), &flabel);
-        break;
-      case kMips64MulOvf:
-        __ MulBranchNoOvf(i.OutputRegister(), i.InputRegister(0),
-                          i.InputOperand(1), &flabel, kScratchReg);
-        break;
-      default:
-        UNREACHABLE();
-        break;
-    }
-    __ li(result, 1);
-    __ Branch(&tlabel);
-    __ bind(&flabel);
-    __ li(result, 0);
-    __ bind(&tlabel);
-  } else if (instr->arch_opcode() == kMips64Cmp) {
-    cc = FlagsConditionToConditionCmp(condition);
-    switch (cc) {
-      case eq:
-      case ne: {
-        Register left = i.InputRegister(0);
-        Operand right = i.InputOperand(1);
-        if (instr->InputAt(1)->IsImmediate()) {
-          if (is_int16(-right.immediate())) {
-            if (right.immediate() == 0) {
-              if (cc == eq) {
-                __ Sltu(result, left, 1);
-              } else {
-                __ Sltu(result, zero_reg, left);
-              }
-            } else {
-              __ Daddu(result, left, Operand(-right.immediate()));
-              if (cc == eq) {
-                __ Sltu(result, result, 1);
-              } else {
-                __ Sltu(result, zero_reg, result);
-              }
-            }
-          } else {
-            if (is_uint16(right.immediate())) {
-              __ Xor(result, left, right);
-            } else {
-              __ li(kScratchReg, right);
-              __ Xor(result, left, kScratchReg);
-            }
-            if (cc == eq) {
-              __ Sltu(result, result, 1);
-            } else {
-              __ Sltu(result, zero_reg, result);
-            }
-          }
-        } else {
-          __ Xor(result, left, right);
-          if (cc == eq) {
-            __ Sltu(result, result, 1);
-          } else {
-            __ Sltu(result, zero_reg, result);
-          }
-        }
-      } break;
-      case lt:
-      case ge: {
-        Register left = i.InputRegister(0);
-        Operand right = i.InputOperand(1);
-        __ Slt(result, left, right);
-        if (cc == ge) {
-          __ xori(result, result, 1);
-        }
-      } break;
-      case gt:
-      case le: {
-        Register left = i.InputRegister(1);
-        Operand right = i.InputOperand(0);
-        __ Slt(result, left, right);
-        if (cc == le) {
-          __ xori(result, result, 1);
-        }
-      } break;
-      case lo:
-      case hs: {
-        Register left = i.InputRegister(0);
-        Operand right = i.InputOperand(1);
-        __ Sltu(result, left, right);
-        if (cc == hs) {
-          __ xori(result, result, 1);
-        }
-      } break;
-      case hi:
-      case ls: {
-        Register left = i.InputRegister(1);
-        Operand right = i.InputOperand(0);
-        __ Sltu(result, left, right);
-        if (cc == ls) {
-          __ xori(result, result, 1);
-        }
-      } break;
-      default:
-        UNREACHABLE();
-    }
-    return;
-  } else if (instr->arch_opcode() == kMips64CmpD ||
-             instr->arch_opcode() == kMips64CmpS) {
-    FPURegister left = i.InputOrZeroDoubleRegister(0);
-    FPURegister right = i.InputOrZeroDoubleRegister(1);
-    if ((left == kDoubleRegZero || right == kDoubleRegZero) &&
-        !__ IsDoubleZeroRegSet()) {
-      __ Move(kDoubleRegZero, 0.0);
-    }
-    bool predicate;
-    FPUCondition cc = FlagsConditionToConditionCmpFPU(predicate, condition);
-    if (kArchVariant != kMips64r6) {
-      __ li(result, Operand(1));
-      if (instr->arch_opcode() == kMips64CmpD) {
-        __ c(cc, D, left, right);
-      } else {
-        DCHECK_EQ(kMips64CmpS, instr->arch_opcode());
-        __ c(cc, S, left, right);
-      }
-      if (predicate) {
-        __ Movf(result, zero_reg);
-      } else {
-        __ Movt(result, zero_reg);
-      }
-    } else {
-      if (instr->arch_opcode() == kMips64CmpD) {
-        __ cmp(cc, L, kDoubleCompareReg, left, right);
-        __ dmfc1(result, kDoubleCompareReg);
-      } else {
-        DCHECK_EQ(kMips64CmpS, instr->arch_opcode());
-        __ cmp(cc, W, kDoubleCompareReg, left, right);
-        __ mfc1(result, kDoubleCompareReg);
-      }
-      if (predicate) {
-        __ And(result, result, 1);  // cmp returns all 1's/0's, use only LSB.
-      } else {
-        __ Addu(result, result, 1);  // Toggle result for not equal.
-      }
-    }
-    return;
-  } else {
-    PrintF("AssembleArchBranch Unimplemented arch_opcode is : %d\n",
-           instr->arch_opcode());
-    TRACE_UNIMPL();
-    UNIMPLEMENTED();
-  }
-}
-
-
-void CodeGenerator::AssembleArchLookupSwitch(Instruction* instr) {
-  MipsOperandConverter i(this, instr);
-  Register input = i.InputRegister(0);
-  for (size_t index = 2; index < instr->InputCount(); index += 2) {
-    __ li(at, Operand(i.InputInt32(index + 0)));
-    __ beq(input, at, GetLabel(i.InputRpo(index + 1)));
-  }
-  __ nop();  // Branch delay slot of the last beq.
-  AssembleArchJump(i.InputRpo(1));
-}
-
-void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) {
-  MipsOperandConverter i(this, instr);
-  Register input = i.InputRegister(0);
-  size_t const case_count = instr->InputCount() - 2;
-
-  __ Branch(GetLabel(i.InputRpo(1)), hs, input, Operand(case_count));
-  __ GenerateSwitchTable(input, case_count, [&i, this](size_t index) {
-    return GetLabel(i.InputRpo(index + 2));
-  });
-}
-
-void CodeGenerator::FinishFrame(Frame* frame) {
-  CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
-
-  const RegList saves_fpu = descriptor->CalleeSavedFPRegisters();
-  if (saves_fpu != 0) {
-    int count = base::bits::CountPopulation(saves_fpu);
-    DCHECK_EQ(kNumCalleeSavedFPU, count);
-    frame->AllocateSavedCalleeRegisterSlots(count *
-                                            (kDoubleSize / kPointerSize));
-  }
-
-  const RegList saves = descriptor->CalleeSavedRegisters();
-  if (saves != 0) {
-    int count = base::bits::CountPopulation(saves);
-    DCHECK_EQ(kNumCalleeSaved, count + 1);
-    frame->AllocateSavedCalleeRegisterSlots(count);
-  }
-}
-
-void CodeGenerator::AssembleConstructFrame() {
-  CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
-
-  if (frame_access_state()->has_frame()) {
-    if (descriptor->IsCFunctionCall()) {
-      __ Push(ra, fp);
-      __ mov(fp, sp);
-    } else if (descriptor->IsJSFunctionCall()) {
-      __ Prologue();
-      if (descriptor->PushArgumentCount()) {
-        __ Push(kJavaScriptCallArgCountRegister);
-      }
-    } else {
-      __ StubPrologue(info()->GetOutputStackFrameType());
-    }
-  }
-
-  int shrink_slots =
-      frame()->GetTotalFrameSlotCount() - descriptor->CalculateFixedFrameSize();
-
-  if (info()->is_osr()) {
-    // TurboFan OSR-compiled functions cannot be entered directly.
-    __ Abort(AbortReason::kShouldNotDirectlyEnterOsrFunction);
-
-    // Unoptimized code jumps directly to this entrypoint while the unoptimized
-    // frame is still on the stack. Optimized code uses OSR values directly from
-    // the unoptimized frame. Thus, all that needs to be done is to allocate the
-    // remaining stack slots.
-    if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --");
-    osr_pc_offset_ = __ pc_offset();
-    shrink_slots -= osr_helper()->UnoptimizedFrameSlots();
-  }
-
-  const RegList saves = descriptor->CalleeSavedRegisters();
-  const RegList saves_fpu = descriptor->CalleeSavedFPRegisters();
-  const int returns = frame()->GetReturnSlotCount();
-
-  // Skip callee-saved and return slots, which are pushed below.
-  shrink_slots -= base::bits::CountPopulation(saves);
-  shrink_slots -= base::bits::CountPopulation(saves_fpu);
-  shrink_slots -= returns;
-  if (shrink_slots > 0) {
-    __ Dsubu(sp, sp, Operand(shrink_slots * kPointerSize));
-  }
-
-  if (saves_fpu != 0) {
-    // Save callee-saved FPU registers.
-    __ MultiPushFPU(saves_fpu);
-    DCHECK_EQ(kNumCalleeSavedFPU, base::bits::CountPopulation(saves_fpu));
-  }
-
-  if (saves != 0) {
-    // Save callee-saved registers.
-    __ MultiPush(saves);
-    DCHECK_EQ(kNumCalleeSaved, base::bits::CountPopulation(saves) + 1);
-  }
-
-  if (returns != 0) {
-    // Create space for returns.
-    __ Dsubu(sp, sp, Operand(returns * kPointerSize));
-  }
-}
-
-void CodeGenerator::AssembleReturn(InstructionOperand* pop) {
-  CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
-
-  const int returns = frame()->GetReturnSlotCount();
-  if (returns != 0) {
-    __ Daddu(sp, sp, Operand(returns * kPointerSize));
-  }
-
-  // Restore GP registers.
-  const RegList saves = descriptor->CalleeSavedRegisters();
-  if (saves != 0) {
-    __ MultiPop(saves);
-  }
-
-  // Restore FPU registers.
-  const RegList saves_fpu = descriptor->CalleeSavedFPRegisters();
-  if (saves_fpu != 0) {
-    __ MultiPopFPU(saves_fpu);
-  }
-
-  MipsOperandConverter g(this, nullptr);
-  if (descriptor->IsCFunctionCall()) {
-    AssembleDeconstructFrame();
-  } else if (frame_access_state()->has_frame()) {
-    // Canonicalize JSFunction return sites for now unless they have an variable
-    // number of stack slot pops.
-    if (pop->IsImmediate() && g.ToConstant(pop).ToInt32() == 0) {
-      if (return_label_.is_bound()) {
-        __ Branch(&return_label_);
-        return;
-      } else {
-        __ bind(&return_label_);
-        AssembleDeconstructFrame();
-      }
-    } else {
-      AssembleDeconstructFrame();
-    }
-  }
-  int pop_count = static_cast<int>(descriptor->StackParameterCount());
-  if (pop->IsImmediate()) {
-    pop_count += g.ToConstant(pop).ToInt32();
-  } else {
-    Register pop_reg = g.ToRegister(pop);
-    __ dsll(pop_reg, pop_reg, kPointerSizeLog2);
-    __ Daddu(sp, sp, pop_reg);
-  }
-  if (pop_count != 0) {
-    __ DropAndRet(pop_count);
-  } else {
-    __ Ret();
-  }
-}
-
-void CodeGenerator::FinishCode() {}
-
-void CodeGenerator::AssembleMove(InstructionOperand* source,
-                                 InstructionOperand* destination) {
-  MipsOperandConverter g(this, nullptr);
-  // Dispatch on the source and destination operand kinds.  Not all
-  // combinations are possible.
-  if (source->IsRegister()) {
-    DCHECK(destination->IsRegister() || destination->IsStackSlot());
-    Register src = g.ToRegister(source);
-    if (destination->IsRegister()) {
-      __ mov(g.ToRegister(destination), src);
-    } else {
-      __ Sd(src, g.ToMemOperand(destination));
-    }
-  } else if (source->IsStackSlot()) {
-    DCHECK(destination->IsRegister() || destination->IsStackSlot());
-    MemOperand src = g.ToMemOperand(source);
-    if (destination->IsRegister()) {
-      __ Ld(g.ToRegister(destination), src);
-    } else {
-      Register temp = kScratchReg;
-      __ Ld(temp, src);
-      __ Sd(temp, g.ToMemOperand(destination));
-    }
-  } else if (source->IsConstant()) {
-    Constant src = g.ToConstant(source);
-    if (destination->IsRegister() || destination->IsStackSlot()) {
-      Register dst =
-          destination->IsRegister() ? g.ToRegister(destination) : kScratchReg;
-      switch (src.type()) {
-        case Constant::kInt32:
-          if (RelocInfo::IsWasmSizeReference(src.rmode())) {
-            __ li(dst, Operand(src.ToInt32(), src.rmode()));
-          } else {
-            __ li(dst, Operand(src.ToInt32()));
-          }
-          break;
-        case Constant::kFloat32:
-          __ li(dst, Operand::EmbeddedNumber(src.ToFloat32()));
-          break;
-        case Constant::kInt64:
-          if (RelocInfo::IsWasmPtrReference(src.rmode())) {
-            __ li(dst, Operand(src.ToInt64(), src.rmode()));
-          } else {
-            DCHECK(!RelocInfo::IsWasmSizeReference(src.rmode()));
-            __ li(dst, Operand(src.ToInt64()));
-          }
-          break;
-        case Constant::kFloat64:
-          __ li(dst, Operand::EmbeddedNumber(src.ToFloat64().value()));
-          break;
-        case Constant::kExternalReference:
-          __ li(dst, Operand(src.ToExternalReference()));
-          break;
-        case Constant::kHeapObject: {
-          Handle<HeapObject> src_object = src.ToHeapObject();
-          Heap::RootListIndex index;
-          if (IsMaterializableFromRoot(src_object, &index)) {
-            __ LoadRoot(dst, index);
-          } else {
-            __ li(dst, src_object);
-          }
-          break;
-        }
-        case Constant::kRpoNumber:
-          UNREACHABLE();  // TODO(titzer): loading RPO numbers on mips64.
-          break;
-      }
-      if (destination->IsStackSlot()) __ Sd(dst, g.ToMemOperand(destination));
-    } else if (src.type() == Constant::kFloat32) {
-      if (destination->IsFPStackSlot()) {
-        MemOperand dst = g.ToMemOperand(destination);
-        if (bit_cast<int32_t>(src.ToFloat32()) == 0) {
-          __ Sw(zero_reg, dst);
-        } else {
-          __ li(at, Operand(bit_cast<int32_t>(src.ToFloat32())));
-          __ Sw(at, dst);
-        }
-      } else {
-        DCHECK(destination->IsFPRegister());
-        FloatRegister dst = g.ToSingleRegister(destination);
-        __ Move(dst, src.ToFloat32());
-      }
-    } else {
-      DCHECK_EQ(Constant::kFloat64, src.type());
-      DoubleRegister dst = destination->IsFPRegister()
-                               ? g.ToDoubleRegister(destination)
-                               : kScratchDoubleReg;
-      __ Move(dst, src.ToFloat64().value());
-      if (destination->IsFPStackSlot()) {
-        __ Sdc1(dst, g.ToMemOperand(destination));
-      }
-    }
-  } else if (source->IsFPRegister()) {
-    FPURegister src = g.ToDoubleRegister(source);
-    if (destination->IsFPRegister()) {
-      FPURegister dst = g.ToDoubleRegister(destination);
-      __ Move(dst, src);
-    } else {
-      DCHECK(destination->IsFPStackSlot());
-      __ Sdc1(src, g.ToMemOperand(destination));
-    }
-  } else if (source->IsFPStackSlot()) {
-    DCHECK(destination->IsFPRegister() || destination->IsFPStackSlot());
-    MemOperand src = g.ToMemOperand(source);
-    if (destination->IsFPRegister()) {
-      __ Ldc1(g.ToDoubleRegister(destination), src);
-    } else {
-      FPURegister temp = kScratchDoubleReg;
-      __ Ldc1(temp, src);
-      __ Sdc1(temp, g.ToMemOperand(destination));
-    }
-  } else {
-    UNREACHABLE();
-  }
-}
-
-
-void CodeGenerator::AssembleSwap(InstructionOperand* source,
-                                 InstructionOperand* destination) {
-  MipsOperandConverter g(this, nullptr);
-  // Dispatch on the source and destination operand kinds.  Not all
-  // combinations are possible.
-  if (source->IsRegister()) {
-    // Register-register.
-    Register temp = kScratchReg;
-    Register src = g.ToRegister(source);
-    if (destination->IsRegister()) {
-      Register dst = g.ToRegister(destination);
-      __ Move(temp, src);
-      __ Move(src, dst);
-      __ Move(dst, temp);
-    } else {
-      DCHECK(destination->IsStackSlot());
-      MemOperand dst = g.ToMemOperand(destination);
-      __ mov(temp, src);
-      __ Ld(src, dst);
-      __ Sd(temp, dst);
-    }
-  } else if (source->IsStackSlot()) {
-    DCHECK(destination->IsStackSlot());
-    Register temp_0 = kScratchReg;
-    Register temp_1 = kScratchReg2;
-    MemOperand src = g.ToMemOperand(source);
-    MemOperand dst = g.ToMemOperand(destination);
-    __ Ld(temp_0, src);
-    __ Ld(temp_1, dst);
-    __ Sd(temp_0, dst);
-    __ Sd(temp_1, src);
-  } else if (source->IsFPRegister()) {
-    FPURegister temp = kScratchDoubleReg;
-    FPURegister src = g.ToDoubleRegister(source);
-    if (destination->IsFPRegister()) {
-      FPURegister dst = g.ToDoubleRegister(destination);
-      __ Move(temp, src);
-      __ Move(src, dst);
-      __ Move(dst, temp);
-    } else {
-      DCHECK(destination->IsFPStackSlot());
-      MemOperand dst = g.ToMemOperand(destination);
-      __ Move(temp, src);
-      __ Ldc1(src, dst);
-      __ Sdc1(temp, dst);
-    }
-  } else if (source->IsFPStackSlot()) {
-    DCHECK(destination->IsFPStackSlot());
-    Register temp_0 = kScratchReg;
-    FPURegister temp_1 = kScratchDoubleReg;
-    MemOperand src0 = g.ToMemOperand(source);
-    MemOperand src1(src0.rm(), src0.offset() + kIntSize);
-    MemOperand dst0 = g.ToMemOperand(destination);
-    MemOperand dst1(dst0.rm(), dst0.offset() + kIntSize);
-    __ Ldc1(temp_1, dst0);  // Save destination in temp_1.
-    __ Lw(temp_0, src0);    // Then use temp_0 to copy source to destination.
-    __ Sw(temp_0, dst0);
-    __ Lw(temp_0, src1);
-    __ Sw(temp_0, dst1);
-    __ Sdc1(temp_1, src0);
-  } else {
-    // No other combinations are possible.
-    UNREACHABLE();
-  }
-}
-
-
-void CodeGenerator::AssembleJumpTable(Label** targets, size_t target_count) {
-  // On 64-bit MIPS we emit the jump tables inline.
-  UNREACHABLE();
-}
-
-
-#undef __
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/mips64/instruction-codes-mips64.h b/src/v8/src/compiler/mips64/instruction-codes-mips64.h
deleted file mode 100644
index 3058812..0000000
--- a/src/v8/src/compiler/mips64/instruction-codes-mips64.h
+++ /dev/null
@@ -1,334 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_MIPS_INSTRUCTION_CODES_MIPS_H_
-#define V8_COMPILER_MIPS_INSTRUCTION_CODES_MIPS_H_
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-// MIPS64-specific opcodes that specify which assembly sequence to emit.
-// Most opcodes specify a single instruction.
-#define TARGET_ARCH_OPCODE_LIST(V)  \
-  V(Mips64Add)                      \
-  V(Mips64Dadd)                     \
-  V(Mips64DaddOvf)                  \
-  V(Mips64Sub)                      \
-  V(Mips64Dsub)                     \
-  V(Mips64DsubOvf)                  \
-  V(Mips64Mul)                      \
-  V(Mips64MulOvf)                   \
-  V(Mips64MulHigh)                  \
-  V(Mips64DMulHigh)                 \
-  V(Mips64MulHighU)                 \
-  V(Mips64Dmul)                     \
-  V(Mips64Div)                      \
-  V(Mips64Ddiv)                     \
-  V(Mips64DivU)                     \
-  V(Mips64DdivU)                    \
-  V(Mips64Mod)                      \
-  V(Mips64Dmod)                     \
-  V(Mips64ModU)                     \
-  V(Mips64DmodU)                    \
-  V(Mips64And)                      \
-  V(Mips64And32)                    \
-  V(Mips64Or)                       \
-  V(Mips64Or32)                     \
-  V(Mips64Nor)                      \
-  V(Mips64Nor32)                    \
-  V(Mips64Xor)                      \
-  V(Mips64Xor32)                    \
-  V(Mips64Clz)                      \
-  V(Mips64Lsa)                      \
-  V(Mips64Dlsa)                     \
-  V(Mips64Shl)                      \
-  V(Mips64Shr)                      \
-  V(Mips64Sar)                      \
-  V(Mips64Ext)                      \
-  V(Mips64Ins)                      \
-  V(Mips64Dext)                     \
-  V(Mips64Dins)                     \
-  V(Mips64Dclz)                     \
-  V(Mips64Ctz)                      \
-  V(Mips64Dctz)                     \
-  V(Mips64Popcnt)                   \
-  V(Mips64Dpopcnt)                  \
-  V(Mips64Dshl)                     \
-  V(Mips64Dshr)                     \
-  V(Mips64Dsar)                     \
-  V(Mips64Ror)                      \
-  V(Mips64Dror)                     \
-  V(Mips64Mov)                      \
-  V(Mips64Tst)                      \
-  V(Mips64Cmp)                      \
-  V(Mips64CmpS)                     \
-  V(Mips64AddS)                     \
-  V(Mips64SubS)                     \
-  V(Mips64MulS)                     \
-  V(Mips64DivS)                     \
-  V(Mips64ModS)                     \
-  V(Mips64AbsS)                     \
-  V(Mips64NegS)                     \
-  V(Mips64SqrtS)                    \
-  V(Mips64MaxS)                     \
-  V(Mips64MinS)                     \
-  V(Mips64CmpD)                     \
-  V(Mips64AddD)                     \
-  V(Mips64SubD)                     \
-  V(Mips64MulD)                     \
-  V(Mips64DivD)                     \
-  V(Mips64ModD)                     \
-  V(Mips64AbsD)                     \
-  V(Mips64NegD)                     \
-  V(Mips64SqrtD)                    \
-  V(Mips64MaxD)                     \
-  V(Mips64MinD)                     \
-  V(Mips64Float64RoundDown)         \
-  V(Mips64Float64RoundTruncate)     \
-  V(Mips64Float64RoundUp)           \
-  V(Mips64Float64RoundTiesEven)     \
-  V(Mips64Float32RoundDown)         \
-  V(Mips64Float32RoundTruncate)     \
-  V(Mips64Float32RoundUp)           \
-  V(Mips64Float32RoundTiesEven)     \
-  V(Mips64CvtSD)                    \
-  V(Mips64CvtDS)                    \
-  V(Mips64TruncWD)                  \
-  V(Mips64RoundWD)                  \
-  V(Mips64FloorWD)                  \
-  V(Mips64CeilWD)                   \
-  V(Mips64TruncWS)                  \
-  V(Mips64RoundWS)                  \
-  V(Mips64FloorWS)                  \
-  V(Mips64CeilWS)                   \
-  V(Mips64TruncLS)                  \
-  V(Mips64TruncLD)                  \
-  V(Mips64TruncUwD)                 \
-  V(Mips64TruncUwS)                 \
-  V(Mips64TruncUlS)                 \
-  V(Mips64TruncUlD)                 \
-  V(Mips64CvtDW)                    \
-  V(Mips64CvtSL)                    \
-  V(Mips64CvtSW)                    \
-  V(Mips64CvtSUw)                   \
-  V(Mips64CvtSUl)                   \
-  V(Mips64CvtDL)                    \
-  V(Mips64CvtDUw)                   \
-  V(Mips64CvtDUl)                   \
-  V(Mips64Lb)                       \
-  V(Mips64Lbu)                      \
-  V(Mips64Sb)                       \
-  V(Mips64Lh)                       \
-  V(Mips64Ulh)                      \
-  V(Mips64Lhu)                      \
-  V(Mips64Ulhu)                     \
-  V(Mips64Sh)                       \
-  V(Mips64Ush)                      \
-  V(Mips64Ld)                       \
-  V(Mips64Uld)                      \
-  V(Mips64Lw)                       \
-  V(Mips64Ulw)                      \
-  V(Mips64Lwu)                      \
-  V(Mips64Ulwu)                     \
-  V(Mips64Sw)                       \
-  V(Mips64Usw)                      \
-  V(Mips64Sd)                       \
-  V(Mips64Usd)                      \
-  V(Mips64Lwc1)                     \
-  V(Mips64Ulwc1)                    \
-  V(Mips64Swc1)                     \
-  V(Mips64Uswc1)                    \
-  V(Mips64Ldc1)                     \
-  V(Mips64Uldc1)                    \
-  V(Mips64Sdc1)                     \
-  V(Mips64Usdc1)                    \
-  V(Mips64BitcastDL)                \
-  V(Mips64BitcastLD)                \
-  V(Mips64Float64ExtractLowWord32)  \
-  V(Mips64Float64ExtractHighWord32) \
-  V(Mips64Float64InsertLowWord32)   \
-  V(Mips64Float64InsertHighWord32)  \
-  V(Mips64Float32Max)               \
-  V(Mips64Float64Max)               \
-  V(Mips64Float32Min)               \
-  V(Mips64Float64Min)               \
-  V(Mips64Float64SilenceNaN)        \
-  V(Mips64Push)                     \
-  V(Mips64Peek)                     \
-  V(Mips64StoreToStackSlot)         \
-  V(Mips64ByteSwap64)               \
-  V(Mips64ByteSwap32)               \
-  V(Mips64StackClaim)               \
-  V(Mips64Seb)                      \
-  V(Mips64Seh)                      \
-  V(Mips64AssertEqual)              \
-  V(Mips64S128Zero)                 \
-  V(Mips64I32x4Splat)               \
-  V(Mips64I32x4ExtractLane)         \
-  V(Mips64I32x4ReplaceLane)         \
-  V(Mips64I32x4Add)                 \
-  V(Mips64I32x4AddHoriz)            \
-  V(Mips64I32x4Sub)                 \
-  V(Mips64F32x4Splat)               \
-  V(Mips64F32x4ExtractLane)         \
-  V(Mips64F32x4ReplaceLane)         \
-  V(Mips64F32x4SConvertI32x4)       \
-  V(Mips64F32x4UConvertI32x4)       \
-  V(Mips64I32x4Mul)                 \
-  V(Mips64I32x4MaxS)                \
-  V(Mips64I32x4MinS)                \
-  V(Mips64I32x4Eq)                  \
-  V(Mips64I32x4Ne)                  \
-  V(Mips64I32x4Shl)                 \
-  V(Mips64I32x4ShrS)                \
-  V(Mips64I32x4ShrU)                \
-  V(Mips64I32x4MaxU)                \
-  V(Mips64I32x4MinU)                \
-  V(Mips64F32x4Abs)                 \
-  V(Mips64F32x4Neg)                 \
-  V(Mips64F32x4RecipApprox)         \
-  V(Mips64F32x4RecipSqrtApprox)     \
-  V(Mips64F32x4Add)                 \
-  V(Mips64F32x4AddHoriz)            \
-  V(Mips64F32x4Sub)                 \
-  V(Mips64F32x4Mul)                 \
-  V(Mips64F32x4Max)                 \
-  V(Mips64F32x4Min)                 \
-  V(Mips64F32x4Eq)                  \
-  V(Mips64F32x4Ne)                  \
-  V(Mips64F32x4Lt)                  \
-  V(Mips64F32x4Le)                  \
-  V(Mips64I32x4SConvertF32x4)       \
-  V(Mips64I32x4UConvertF32x4)       \
-  V(Mips64I32x4Neg)                 \
-  V(Mips64I32x4GtS)                 \
-  V(Mips64I32x4GeS)                 \
-  V(Mips64I32x4GtU)                 \
-  V(Mips64I32x4GeU)                 \
-  V(Mips64I16x8Splat)               \
-  V(Mips64I16x8ExtractLane)         \
-  V(Mips64I16x8ReplaceLane)         \
-  V(Mips64I16x8Neg)                 \
-  V(Mips64I16x8Shl)                 \
-  V(Mips64I16x8ShrS)                \
-  V(Mips64I16x8ShrU)                \
-  V(Mips64I16x8Add)                 \
-  V(Mips64I16x8AddSaturateS)        \
-  V(Mips64I16x8AddHoriz)            \
-  V(Mips64I16x8Sub)                 \
-  V(Mips64I16x8SubSaturateS)        \
-  V(Mips64I16x8Mul)                 \
-  V(Mips64I16x8MaxS)                \
-  V(Mips64I16x8MinS)                \
-  V(Mips64I16x8Eq)                  \
-  V(Mips64I16x8Ne)                  \
-  V(Mips64I16x8GtS)                 \
-  V(Mips64I16x8GeS)                 \
-  V(Mips64I16x8AddSaturateU)        \
-  V(Mips64I16x8SubSaturateU)        \
-  V(Mips64I16x8MaxU)                \
-  V(Mips64I16x8MinU)                \
-  V(Mips64I16x8GtU)                 \
-  V(Mips64I16x8GeU)                 \
-  V(Mips64I8x16Splat)               \
-  V(Mips64I8x16ExtractLane)         \
-  V(Mips64I8x16ReplaceLane)         \
-  V(Mips64I8x16Neg)                 \
-  V(Mips64I8x16Shl)                 \
-  V(Mips64I8x16ShrS)                \
-  V(Mips64I8x16Add)                 \
-  V(Mips64I8x16AddSaturateS)        \
-  V(Mips64I8x16Sub)                 \
-  V(Mips64I8x16SubSaturateS)        \
-  V(Mips64I8x16Mul)                 \
-  V(Mips64I8x16MaxS)                \
-  V(Mips64I8x16MinS)                \
-  V(Mips64I8x16Eq)                  \
-  V(Mips64I8x16Ne)                  \
-  V(Mips64I8x16GtS)                 \
-  V(Mips64I8x16GeS)                 \
-  V(Mips64I8x16ShrU)                \
-  V(Mips64I8x16AddSaturateU)        \
-  V(Mips64I8x16SubSaturateU)        \
-  V(Mips64I8x16MaxU)                \
-  V(Mips64I8x16MinU)                \
-  V(Mips64I8x16GtU)                 \
-  V(Mips64I8x16GeU)                 \
-  V(Mips64S128And)                  \
-  V(Mips64S128Or)                   \
-  V(Mips64S128Xor)                  \
-  V(Mips64S128Not)                  \
-  V(Mips64S128Select)               \
-  V(Mips64S1x4AnyTrue)              \
-  V(Mips64S1x4AllTrue)              \
-  V(Mips64S1x8AnyTrue)              \
-  V(Mips64S1x8AllTrue)              \
-  V(Mips64S1x16AnyTrue)             \
-  V(Mips64S1x16AllTrue)             \
-  V(Mips64S32x4InterleaveRight)     \
-  V(Mips64S32x4InterleaveLeft)      \
-  V(Mips64S32x4PackEven)            \
-  V(Mips64S32x4PackOdd)             \
-  V(Mips64S32x4InterleaveEven)      \
-  V(Mips64S32x4InterleaveOdd)       \
-  V(Mips64S32x4Shuffle)             \
-  V(Mips64S16x8InterleaveRight)     \
-  V(Mips64S16x8InterleaveLeft)      \
-  V(Mips64S16x8PackEven)            \
-  V(Mips64S16x8PackOdd)             \
-  V(Mips64S16x8InterleaveEven)      \
-  V(Mips64S16x8InterleaveOdd)       \
-  V(Mips64S16x4Reverse)             \
-  V(Mips64S16x2Reverse)             \
-  V(Mips64S8x16InterleaveRight)     \
-  V(Mips64S8x16InterleaveLeft)      \
-  V(Mips64S8x16PackEven)            \
-  V(Mips64S8x16PackOdd)             \
-  V(Mips64S8x16InterleaveEven)      \
-  V(Mips64S8x16InterleaveOdd)       \
-  V(Mips64S8x16Shuffle)             \
-  V(Mips64S8x16Concat)              \
-  V(Mips64S8x8Reverse)              \
-  V(Mips64S8x4Reverse)              \
-  V(Mips64S8x2Reverse)              \
-  V(Mips64MsaLd)                    \
-  V(Mips64MsaSt)                    \
-  V(Mips64I32x4SConvertI16x8Low)    \
-  V(Mips64I32x4SConvertI16x8High)   \
-  V(Mips64I32x4UConvertI16x8Low)    \
-  V(Mips64I32x4UConvertI16x8High)   \
-  V(Mips64I16x8SConvertI8x16Low)    \
-  V(Mips64I16x8SConvertI8x16High)   \
-  V(Mips64I16x8SConvertI32x4)       \
-  V(Mips64I16x8UConvertI32x4)       \
-  V(Mips64I16x8UConvertI8x16Low)    \
-  V(Mips64I16x8UConvertI8x16High)   \
-  V(Mips64I8x16SConvertI16x8)       \
-  V(Mips64I8x16UConvertI16x8)
-
-// Addressing modes represent the "shape" of inputs to an instruction.
-// Many instructions support multiple addressing modes. Addressing modes
-// are encoded into the InstructionCode of the instruction and tell the
-// code generator after register allocation which assembler method to call.
-//
-// We use the following local notation for addressing modes:
-//
-// R = register
-// O = register or stack slot
-// D = double register
-// I = immediate (handle, external, int32)
-// MRI = [register + immediate]
-// MRR = [register + register]
-// TODO(plind): Add the new r6 address modes.
-#define TARGET_ADDRESSING_MODE_LIST(V) \
-  V(MRI) /* [%r0 + K] */               \
-  V(MRR) /* [%r0 + %r1] */
-
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_COMPILER_MIPS_INSTRUCTION_CODES_MIPS_H_
diff --git a/src/v8/src/compiler/mips64/instruction-scheduler-mips64.cc b/src/v8/src/compiler/mips64/instruction-scheduler-mips64.cc
deleted file mode 100644
index af86a87..0000000
--- a/src/v8/src/compiler/mips64/instruction-scheduler-mips64.cc
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2015 the V8 project 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 "src/compiler/instruction-scheduler.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-bool InstructionScheduler::SchedulerSupported() { return false; }
-
-
-int InstructionScheduler::GetTargetInstructionFlags(
-    const Instruction* instr) const {
-  UNIMPLEMENTED();
-}
-
-
-int InstructionScheduler::GetInstructionLatency(const Instruction* instr) {
-  UNIMPLEMENTED();
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/mips64/instruction-selector-mips64.cc b/src/v8/src/compiler/mips64/instruction-selector-mips64.cc
deleted file mode 100644
index 38f077c..0000000
--- a/src/v8/src/compiler/mips64/instruction-selector-mips64.cc
+++ /dev/null
@@ -1,2970 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/base/adapters.h"
-#include "src/base/bits.h"
-#include "src/compiler/instruction-selector-impl.h"
-#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-#define TRACE_UNIMPL() \
-  PrintF("UNIMPLEMENTED instr_sel: %s at line %d\n", __FUNCTION__, __LINE__)
-
-#define TRACE() PrintF("instr_sel: %s at line %d\n", __FUNCTION__, __LINE__)
-
-
-// Adds Mips-specific methods for generating InstructionOperands.
-class Mips64OperandGenerator final : public OperandGenerator {
- public:
-  explicit Mips64OperandGenerator(InstructionSelector* selector)
-      : OperandGenerator(selector) {}
-
-  InstructionOperand UseOperand(Node* node, InstructionCode opcode) {
-    if (CanBeImmediate(node, opcode)) {
-      return UseImmediate(node);
-    }
-    return UseRegister(node);
-  }
-
-  // Use the zero register if the node has the immediate value zero, otherwise
-  // assign a register.
-  InstructionOperand UseRegisterOrImmediateZero(Node* node) {
-    if ((IsIntegerConstant(node) && (GetIntegerConstantValue(node) == 0)) ||
-        (IsFloatConstant(node) &&
-         (bit_cast<int64_t>(GetFloatConstantValue(node)) == 0))) {
-      return UseImmediate(node);
-    }
-    return UseRegister(node);
-  }
-
-  bool IsIntegerConstant(Node* node) {
-    return (node->opcode() == IrOpcode::kInt32Constant) ||
-           (node->opcode() == IrOpcode::kInt64Constant);
-  }
-
-  int64_t GetIntegerConstantValue(Node* node) {
-    if (node->opcode() == IrOpcode::kInt32Constant) {
-      return OpParameter<int32_t>(node);
-    }
-    DCHECK_EQ(IrOpcode::kInt64Constant, node->opcode());
-    return OpParameter<int64_t>(node);
-  }
-
-  bool IsFloatConstant(Node* node) {
-    return (node->opcode() == IrOpcode::kFloat32Constant) ||
-           (node->opcode() == IrOpcode::kFloat64Constant);
-  }
-
-  double GetFloatConstantValue(Node* node) {
-    if (node->opcode() == IrOpcode::kFloat32Constant) {
-      return OpParameter<float>(node);
-    }
-    DCHECK_EQ(IrOpcode::kFloat64Constant, node->opcode());
-    return OpParameter<double>(node);
-  }
-
-  bool CanBeImmediate(Node* node, InstructionCode mode) {
-    return IsIntegerConstant(node) &&
-           CanBeImmediate(GetIntegerConstantValue(node), mode);
-  }
-
-  bool CanBeImmediate(int64_t value, InstructionCode opcode) {
-    switch (ArchOpcodeField::decode(opcode)) {
-      case kMips64Shl:
-      case kMips64Sar:
-      case kMips64Shr:
-        return is_uint5(value);
-      case kMips64Dshl:
-      case kMips64Dsar:
-      case kMips64Dshr:
-        return is_uint6(value);
-      case kMips64Add:
-      case kMips64And32:
-      case kMips64And:
-      case kMips64Dadd:
-      case kMips64Or32:
-      case kMips64Or:
-      case kMips64Tst:
-      case kMips64Xor:
-        return is_uint16(value);
-      case kMips64Lb:
-      case kMips64Lbu:
-      case kMips64Sb:
-      case kMips64Lh:
-      case kMips64Lhu:
-      case kMips64Sh:
-      case kMips64Lw:
-      case kMips64Sw:
-      case kMips64Ld:
-      case kMips64Sd:
-      case kMips64Lwc1:
-      case kMips64Swc1:
-      case kMips64Ldc1:
-      case kMips64Sdc1:
-        return is_int32(value);
-      default:
-        return is_int16(value);
-    }
-  }
-
- private:
-  bool ImmediateFitsAddrMode1Instruction(int32_t imm) const {
-    TRACE_UNIMPL();
-    return false;
-  }
-};
-
-
-static void VisitRR(InstructionSelector* selector, ArchOpcode opcode,
-                    Node* node) {
-  Mips64OperandGenerator g(selector);
-  selector->Emit(opcode, g.DefineAsRegister(node),
-                 g.UseRegister(node->InputAt(0)));
-}
-
-static void VisitRRI(InstructionSelector* selector, ArchOpcode opcode,
-                     Node* node) {
-  Mips64OperandGenerator g(selector);
-  int32_t imm = OpParameter<int32_t>(node);
-  selector->Emit(opcode, g.DefineAsRegister(node),
-                 g.UseRegister(node->InputAt(0)), g.UseImmediate(imm));
-}
-
-static void VisitRRIR(InstructionSelector* selector, ArchOpcode opcode,
-                      Node* node) {
-  Mips64OperandGenerator g(selector);
-  int32_t imm = OpParameter<int32_t>(node);
-  selector->Emit(opcode, g.DefineAsRegister(node),
-                 g.UseRegister(node->InputAt(0)), g.UseImmediate(imm),
-                 g.UseRegister(node->InputAt(1)));
-}
-
-static void VisitRRR(InstructionSelector* selector, ArchOpcode opcode,
-                     Node* node) {
-  Mips64OperandGenerator g(selector);
-  selector->Emit(opcode, g.DefineAsRegister(node),
-                 g.UseRegister(node->InputAt(0)),
-                 g.UseRegister(node->InputAt(1)));
-}
-
-void VisitRRRR(InstructionSelector* selector, ArchOpcode opcode, Node* node) {
-  Mips64OperandGenerator g(selector);
-  selector->Emit(
-      opcode, g.DefineSameAsFirst(node), g.UseRegister(node->InputAt(0)),
-      g.UseRegister(node->InputAt(1)), g.UseRegister(node->InputAt(2)));
-}
-
-static void VisitRRO(InstructionSelector* selector, ArchOpcode opcode,
-                     Node* node) {
-  Mips64OperandGenerator g(selector);
-  selector->Emit(opcode, g.DefineAsRegister(node),
-                 g.UseRegister(node->InputAt(0)),
-                 g.UseOperand(node->InputAt(1), opcode));
-}
-
-struct ExtendingLoadMatcher {
-  ExtendingLoadMatcher(Node* node, InstructionSelector* selector)
-      : matches_(false), selector_(selector), base_(nullptr), immediate_(0) {
-    Initialize(node);
-  }
-
-  bool Matches() const { return matches_; }
-
-  Node* base() const {
-    DCHECK(Matches());
-    return base_;
-  }
-  int64_t immediate() const {
-    DCHECK(Matches());
-    return immediate_;
-  }
-  ArchOpcode opcode() const {
-    DCHECK(Matches());
-    return opcode_;
-  }
-
- private:
-  bool matches_;
-  InstructionSelector* selector_;
-  Node* base_;
-  int64_t immediate_;
-  ArchOpcode opcode_;
-
-  void Initialize(Node* node) {
-    Int64BinopMatcher m(node);
-    // When loading a 64-bit value and shifting by 32, we should
-    // just load and sign-extend the interesting 4 bytes instead.
-    // This happens, for example, when we're loading and untagging SMIs.
-    DCHECK(m.IsWord64Sar());
-    if (m.left().IsLoad() && m.right().Is(32) &&
-        selector_->CanCover(m.node(), m.left().node())) {
-      MachineRepresentation rep =
-          LoadRepresentationOf(m.left().node()->op()).representation();
-      DCHECK_EQ(3, ElementSizeLog2Of(rep));
-      if (rep != MachineRepresentation::kTaggedSigned &&
-          rep != MachineRepresentation::kTaggedPointer &&
-          rep != MachineRepresentation::kTagged &&
-          rep != MachineRepresentation::kWord64) {
-        return;
-      }
-
-      Mips64OperandGenerator g(selector_);
-      Node* load = m.left().node();
-      Node* offset = load->InputAt(1);
-      base_ = load->InputAt(0);
-      opcode_ = kMips64Lw;
-      if (g.CanBeImmediate(offset, opcode_)) {
-#if defined(V8_TARGET_LITTLE_ENDIAN)
-        immediate_ = g.GetIntegerConstantValue(offset) + 4;
-#elif defined(V8_TARGET_BIG_ENDIAN)
-        immediate_ = g.GetIntegerConstantValue(offset);
-#endif
-        matches_ = g.CanBeImmediate(immediate_, kMips64Lw);
-      }
-    }
-  }
-};
-
-bool TryEmitExtendingLoad(InstructionSelector* selector, Node* node,
-                          Node* output_node) {
-  ExtendingLoadMatcher m(node, selector);
-  Mips64OperandGenerator g(selector);
-  if (m.Matches()) {
-    InstructionOperand inputs[2];
-    inputs[0] = g.UseRegister(m.base());
-    InstructionCode opcode =
-        m.opcode() | AddressingModeField::encode(kMode_MRI);
-    DCHECK(is_int32(m.immediate()));
-    inputs[1] = g.TempImmediate(static_cast<int32_t>(m.immediate()));
-    InstructionOperand outputs[] = {g.DefineAsRegister(output_node)};
-    selector->Emit(opcode, arraysize(outputs), outputs, arraysize(inputs),
-                   inputs);
-    return true;
-  }
-  return false;
-}
-
-bool TryMatchImmediate(InstructionSelector* selector,
-                       InstructionCode* opcode_return, Node* node,
-                       size_t* input_count_return, InstructionOperand* inputs) {
-  Mips64OperandGenerator g(selector);
-  if (g.CanBeImmediate(node, *opcode_return)) {
-    *opcode_return |= AddressingModeField::encode(kMode_MRI);
-    inputs[0] = g.UseImmediate(node);
-    *input_count_return = 1;
-    return true;
-  }
-  return false;
-}
-
-static void VisitBinop(InstructionSelector* selector, Node* node,
-                       InstructionCode opcode, bool has_reverse_opcode,
-                       InstructionCode reverse_opcode,
-                       FlagsContinuation* cont) {
-  Mips64OperandGenerator g(selector);
-  Int32BinopMatcher m(node);
-  InstructionOperand inputs[4];
-  size_t input_count = 0;
-  InstructionOperand outputs[2];
-  size_t output_count = 0;
-
-  if (TryMatchImmediate(selector, &opcode, m.right().node(), &input_count,
-                        &inputs[1])) {
-    inputs[0] = g.UseRegister(m.left().node());
-    input_count++;
-  } else if (has_reverse_opcode &&
-             TryMatchImmediate(selector, &reverse_opcode, m.left().node(),
-                               &input_count, &inputs[1])) {
-    inputs[0] = g.UseRegister(m.right().node());
-    opcode = reverse_opcode;
-    input_count++;
-  } else {
-    inputs[input_count++] = g.UseRegister(m.left().node());
-    inputs[input_count++] = g.UseOperand(m.right().node(), opcode);
-  }
-
-  if (cont->IsBranch()) {
-    inputs[input_count++] = g.Label(cont->true_block());
-    inputs[input_count++] = g.Label(cont->false_block());
-  } else if (cont->IsTrap()) {
-    inputs[input_count++] = g.TempImmediate(cont->trap_id());
-  }
-
-  if (cont->IsDeoptimize()) {
-    // If we can deoptimize as a result of the binop, we need to make sure that
-    // the deopt inputs are not overwritten by the binop result. One way
-    // to achieve that is to declare the output register as same-as-first.
-    outputs[output_count++] = g.DefineSameAsFirst(node);
-  } else {
-    outputs[output_count++] = g.DefineAsRegister(node);
-  }
-  if (cont->IsSet()) {
-    outputs[output_count++] = g.DefineAsRegister(cont->result());
-  }
-
-  DCHECK_NE(0u, input_count);
-  DCHECK_NE(0u, output_count);
-  DCHECK_GE(arraysize(inputs), input_count);
-  DCHECK_GE(arraysize(outputs), output_count);
-
-  opcode = cont->Encode(opcode);
-  if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(opcode, output_count, outputs, input_count, inputs,
-                             cont->kind(), cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else {
-    selector->Emit(opcode, output_count, outputs, input_count, inputs);
-  }
-}
-
-static void VisitBinop(InstructionSelector* selector, Node* node,
-                       InstructionCode opcode, bool has_reverse_opcode,
-                       InstructionCode reverse_opcode) {
-  FlagsContinuation cont;
-  VisitBinop(selector, node, opcode, has_reverse_opcode, reverse_opcode, &cont);
-}
-
-static void VisitBinop(InstructionSelector* selector, Node* node,
-                       InstructionCode opcode, FlagsContinuation* cont) {
-  VisitBinop(selector, node, opcode, false, kArchNop, cont);
-}
-
-static void VisitBinop(InstructionSelector* selector, Node* node,
-                       InstructionCode opcode) {
-  VisitBinop(selector, node, opcode, false, kArchNop);
-}
-
-void InstructionSelector::VisitStackSlot(Node* node) {
-  StackSlotRepresentation rep = StackSlotRepresentationOf(node->op());
-  int alignment = rep.alignment();
-  int slot = frame_->AllocateSpillSlot(rep.size(), alignment);
-  OperandGenerator g(this);
-
-  Emit(kArchStackSlot, g.DefineAsRegister(node),
-       sequence()->AddImmediate(Constant(slot)),
-       sequence()->AddImmediate(Constant(alignment)), 0, nullptr);
-}
-
-void InstructionSelector::VisitDebugAbort(Node* node) {
-  Mips64OperandGenerator g(this);
-  Emit(kArchDebugAbort, g.NoOutput(), g.UseFixed(node->InputAt(0), a0));
-}
-
-void EmitLoad(InstructionSelector* selector, Node* node, InstructionCode opcode,
-              Node* output = nullptr) {
-  Mips64OperandGenerator g(selector);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-
-  if (g.CanBeImmediate(index, opcode)) {
-    selector->Emit(opcode | AddressingModeField::encode(kMode_MRI),
-                   g.DefineAsRegister(output == nullptr ? node : output),
-                   g.UseRegister(base), g.UseImmediate(index));
-  } else {
-    InstructionOperand addr_reg = g.TempRegister();
-    selector->Emit(kMips64Dadd | AddressingModeField::encode(kMode_None),
-                   addr_reg, g.UseRegister(index), g.UseRegister(base));
-    // Emit desired load opcode, using temp addr_reg.
-    selector->Emit(opcode | AddressingModeField::encode(kMode_MRI),
-                   g.DefineAsRegister(output == nullptr ? node : output),
-                   addr_reg, g.TempImmediate(0));
-  }
-}
-
-void InstructionSelector::VisitLoad(Node* node) {
-  LoadRepresentation load_rep = LoadRepresentationOf(node->op());
-
-  ArchOpcode opcode = kArchNop;
-  switch (load_rep.representation()) {
-    case MachineRepresentation::kFloat32:
-      opcode = kMips64Lwc1;
-      break;
-    case MachineRepresentation::kFloat64:
-      opcode = kMips64Ldc1;
-      break;
-    case MachineRepresentation::kBit:  // Fall through.
-    case MachineRepresentation::kWord8:
-      opcode = load_rep.IsUnsigned() ? kMips64Lbu : kMips64Lb;
-      break;
-    case MachineRepresentation::kWord16:
-      opcode = load_rep.IsUnsigned() ? kMips64Lhu : kMips64Lh;
-      break;
-    case MachineRepresentation::kWord32:
-      opcode = load_rep.IsUnsigned() ? kMips64Lwu : kMips64Lw;
-      break;
-    case MachineRepresentation::kTaggedSigned:   // Fall through.
-    case MachineRepresentation::kTaggedPointer:  // Fall through.
-    case MachineRepresentation::kTagged:  // Fall through.
-    case MachineRepresentation::kWord64:
-      opcode = kMips64Ld;
-      break;
-    case MachineRepresentation::kSimd128:
-      opcode = kMips64MsaLd;
-      break;
-    case MachineRepresentation::kNone:
-      UNREACHABLE();
-      return;
-  }
-
-  EmitLoad(this, node, opcode);
-}
-
-void InstructionSelector::VisitProtectedLoad(Node* node) {
-  // TODO(eholk)
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitStore(Node* node) {
-  Mips64OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-
-  StoreRepresentation store_rep = StoreRepresentationOf(node->op());
-  WriteBarrierKind write_barrier_kind = store_rep.write_barrier_kind();
-  MachineRepresentation rep = store_rep.representation();
-
-  // TODO(mips): I guess this could be done in a better way.
-  if (write_barrier_kind != kNoWriteBarrier) {
-    DCHECK(CanBeTaggedPointer(rep));
-    InstructionOperand inputs[3];
-    size_t input_count = 0;
-    inputs[input_count++] = g.UseUniqueRegister(base);
-    inputs[input_count++] = g.UseUniqueRegister(index);
-    inputs[input_count++] = g.UseUniqueRegister(value);
-    RecordWriteMode record_write_mode = RecordWriteMode::kValueIsAny;
-    switch (write_barrier_kind) {
-      case kNoWriteBarrier:
-        UNREACHABLE();
-        break;
-      case kMapWriteBarrier:
-        record_write_mode = RecordWriteMode::kValueIsMap;
-        break;
-      case kPointerWriteBarrier:
-        record_write_mode = RecordWriteMode::kValueIsPointer;
-        break;
-      case kFullWriteBarrier:
-        record_write_mode = RecordWriteMode::kValueIsAny;
-        break;
-    }
-    InstructionOperand temps[] = {g.TempRegister(), g.TempRegister()};
-    size_t const temp_count = arraysize(temps);
-    InstructionCode code = kArchStoreWithWriteBarrier;
-    code |= MiscField::encode(static_cast<int>(record_write_mode));
-    Emit(code, 0, nullptr, input_count, inputs, temp_count, temps);
-  } else {
-    ArchOpcode opcode = kArchNop;
-    switch (rep) {
-      case MachineRepresentation::kFloat32:
-        opcode = kMips64Swc1;
-        break;
-      case MachineRepresentation::kFloat64:
-        opcode = kMips64Sdc1;
-        break;
-      case MachineRepresentation::kBit:  // Fall through.
-      case MachineRepresentation::kWord8:
-        opcode = kMips64Sb;
-        break;
-      case MachineRepresentation::kWord16:
-        opcode = kMips64Sh;
-        break;
-      case MachineRepresentation::kWord32:
-        opcode = kMips64Sw;
-        break;
-      case MachineRepresentation::kTaggedSigned:   // Fall through.
-      case MachineRepresentation::kTaggedPointer:  // Fall through.
-      case MachineRepresentation::kTagged:  // Fall through.
-      case MachineRepresentation::kWord64:
-        opcode = kMips64Sd;
-        break;
-      case MachineRepresentation::kSimd128:
-        opcode = kMips64MsaSt;
-        break;
-      case MachineRepresentation::kNone:
-        UNREACHABLE();
-        return;
-    }
-
-    if (g.CanBeImmediate(index, opcode)) {
-      Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(),
-           g.UseRegister(base), g.UseImmediate(index),
-           g.UseRegisterOrImmediateZero(value));
-    } else {
-      InstructionOperand addr_reg = g.TempRegister();
-      Emit(kMips64Dadd | AddressingModeField::encode(kMode_None), addr_reg,
-           g.UseRegister(index), g.UseRegister(base));
-      // Emit desired store opcode, using temp addr_reg.
-      Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(),
-           addr_reg, g.TempImmediate(0), g.UseRegisterOrImmediateZero(value));
-    }
-  }
-}
-
-void InstructionSelector::VisitProtectedStore(Node* node) {
-  // TODO(eholk)
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitWord32And(Node* node) {
-  Mips64OperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  if (m.left().IsWord32Shr() && CanCover(node, m.left().node()) &&
-      m.right().HasValue()) {
-    uint32_t mask = m.right().Value();
-    uint32_t mask_width = base::bits::CountPopulation(mask);
-    uint32_t mask_msb = base::bits::CountLeadingZeros32(mask);
-    if ((mask_width != 0) && (mask_msb + mask_width == 32)) {
-      // The mask must be contiguous, and occupy the least-significant bits.
-      DCHECK_EQ(0u, base::bits::CountTrailingZeros32(mask));
-
-      // Select Ext for And(Shr(x, imm), mask) where the mask is in the least
-      // significant bits.
-      Int32BinopMatcher mleft(m.left().node());
-      if (mleft.right().HasValue()) {
-        // Any shift value can match; int32 shifts use `value % 32`.
-        uint32_t lsb = mleft.right().Value() & 0x1F;
-
-        // Ext cannot extract bits past the register size, however since
-        // shifting the original value would have introduced some zeros we can
-        // still use Ext with a smaller mask and the remaining bits will be
-        // zeros.
-        if (lsb + mask_width > 32) mask_width = 32 - lsb;
-
-        Emit(kMips64Ext, g.DefineAsRegister(node),
-             g.UseRegister(mleft.left().node()), g.TempImmediate(lsb),
-             g.TempImmediate(mask_width));
-        return;
-      }
-      // Other cases fall through to the normal And operation.
-    }
-  }
-  if (m.right().HasValue()) {
-    uint32_t mask = m.right().Value();
-    uint32_t shift = base::bits::CountPopulation(~mask);
-    uint32_t msb = base::bits::CountLeadingZeros32(~mask);
-    if (shift != 0 && shift != 32 && msb + shift == 32) {
-      // Insert zeros for (x >> K) << K => x & ~(2^K - 1) expression reduction
-      // and remove constant loading of inverted mask.
-      Emit(kMips64Ins, g.DefineSameAsFirst(node),
-           g.UseRegister(m.left().node()), g.TempImmediate(0),
-           g.TempImmediate(shift));
-      return;
-    }
-  }
-  VisitBinop(this, node, kMips64And32, true, kMips64And32);
-}
-
-
-void InstructionSelector::VisitWord64And(Node* node) {
-  Mips64OperandGenerator g(this);
-  Int64BinopMatcher m(node);
-  if (m.left().IsWord64Shr() && CanCover(node, m.left().node()) &&
-      m.right().HasValue()) {
-    uint64_t mask = m.right().Value();
-    uint32_t mask_width = base::bits::CountPopulation(mask);
-    uint32_t mask_msb = base::bits::CountLeadingZeros64(mask);
-    if ((mask_width != 0) && (mask_msb + mask_width == 64)) {
-      // The mask must be contiguous, and occupy the least-significant bits.
-      DCHECK_EQ(0u, base::bits::CountTrailingZeros64(mask));
-
-      // Select Dext for And(Shr(x, imm), mask) where the mask is in the least
-      // significant bits.
-      Int64BinopMatcher mleft(m.left().node());
-      if (mleft.right().HasValue()) {
-        // Any shift value can match; int64 shifts use `value % 64`.
-        uint32_t lsb = static_cast<uint32_t>(mleft.right().Value() & 0x3F);
-
-        // Dext cannot extract bits past the register size, however since
-        // shifting the original value would have introduced some zeros we can
-        // still use Dext with a smaller mask and the remaining bits will be
-        // zeros.
-        if (lsb + mask_width > 64) mask_width = 64 - lsb;
-
-        if (lsb == 0 && mask_width == 64) {
-          Emit(kArchNop, g.DefineSameAsFirst(node), g.Use(mleft.left().node()));
-        } else {
-          Emit(kMips64Dext, g.DefineAsRegister(node),
-               g.UseRegister(mleft.left().node()), g.TempImmediate(lsb),
-               g.TempImmediate(static_cast<int32_t>(mask_width)));
-        }
-        return;
-      }
-      // Other cases fall through to the normal And operation.
-    }
-  }
-  if (m.right().HasValue()) {
-    uint64_t mask = m.right().Value();
-    uint32_t shift = base::bits::CountPopulation(~mask);
-    uint32_t msb = base::bits::CountLeadingZeros64(~mask);
-    if (shift != 0 && shift < 32 && msb + shift == 64) {
-      // Insert zeros for (x >> K) << K => x & ~(2^K - 1) expression reduction
-      // and remove constant loading of inverted mask. Dins cannot insert bits
-      // past word size, so shifts smaller than 32 are covered.
-      Emit(kMips64Dins, g.DefineSameAsFirst(node),
-           g.UseRegister(m.left().node()), g.TempImmediate(0),
-           g.TempImmediate(shift));
-      return;
-    }
-  }
-  VisitBinop(this, node, kMips64And, true, kMips64And);
-}
-
-
-void InstructionSelector::VisitWord32Or(Node* node) {
-  VisitBinop(this, node, kMips64Or32, true, kMips64Or32);
-}
-
-
-void InstructionSelector::VisitWord64Or(Node* node) {
-  VisitBinop(this, node, kMips64Or, true, kMips64Or);
-}
-
-
-void InstructionSelector::VisitWord32Xor(Node* node) {
-  Int32BinopMatcher m(node);
-  if (m.left().IsWord32Or() && CanCover(node, m.left().node()) &&
-      m.right().Is(-1)) {
-    Int32BinopMatcher mleft(m.left().node());
-    if (!mleft.right().HasValue()) {
-      Mips64OperandGenerator g(this);
-      Emit(kMips64Nor32, g.DefineAsRegister(node),
-           g.UseRegister(mleft.left().node()),
-           g.UseRegister(mleft.right().node()));
-      return;
-    }
-  }
-  if (m.right().Is(-1)) {
-    // Use Nor for bit negation and eliminate constant loading for xori.
-    Mips64OperandGenerator g(this);
-    Emit(kMips64Nor32, g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-         g.TempImmediate(0));
-    return;
-  }
-  VisitBinop(this, node, kMips64Xor32, true, kMips64Xor32);
-}
-
-
-void InstructionSelector::VisitWord64Xor(Node* node) {
-  Int64BinopMatcher m(node);
-  if (m.left().IsWord64Or() && CanCover(node, m.left().node()) &&
-      m.right().Is(-1)) {
-    Int64BinopMatcher mleft(m.left().node());
-    if (!mleft.right().HasValue()) {
-      Mips64OperandGenerator g(this);
-      Emit(kMips64Nor, g.DefineAsRegister(node),
-           g.UseRegister(mleft.left().node()),
-           g.UseRegister(mleft.right().node()));
-      return;
-    }
-  }
-  if (m.right().Is(-1)) {
-    // Use Nor for bit negation and eliminate constant loading for xori.
-    Mips64OperandGenerator g(this);
-    Emit(kMips64Nor, g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-         g.TempImmediate(0));
-    return;
-  }
-  VisitBinop(this, node, kMips64Xor, true, kMips64Xor);
-}
-
-
-void InstructionSelector::VisitWord32Shl(Node* node) {
-  Int32BinopMatcher m(node);
-  if (m.left().IsWord32And() && CanCover(node, m.left().node()) &&
-      m.right().IsInRange(1, 31)) {
-    Mips64OperandGenerator g(this);
-    Int32BinopMatcher mleft(m.left().node());
-    // Match Word32Shl(Word32And(x, mask), imm) to Shl where the mask is
-    // contiguous, and the shift immediate non-zero.
-    if (mleft.right().HasValue()) {
-      uint32_t mask = mleft.right().Value();
-      uint32_t mask_width = base::bits::CountPopulation(mask);
-      uint32_t mask_msb = base::bits::CountLeadingZeros32(mask);
-      if ((mask_width != 0) && (mask_msb + mask_width == 32)) {
-        uint32_t shift = m.right().Value();
-        DCHECK_EQ(0u, base::bits::CountTrailingZeros32(mask));
-        DCHECK_NE(0u, shift);
-        if ((shift + mask_width) >= 32) {
-          // If the mask is contiguous and reaches or extends beyond the top
-          // bit, only the shift is needed.
-          Emit(kMips64Shl, g.DefineAsRegister(node),
-               g.UseRegister(mleft.left().node()),
-               g.UseImmediate(m.right().node()));
-          return;
-        }
-      }
-    }
-  }
-  VisitRRO(this, kMips64Shl, node);
-}
-
-
-void InstructionSelector::VisitWord32Shr(Node* node) {
-  Int32BinopMatcher m(node);
-  if (m.left().IsWord32And() && m.right().HasValue()) {
-    uint32_t lsb = m.right().Value() & 0x1F;
-    Int32BinopMatcher mleft(m.left().node());
-    if (mleft.right().HasValue() && mleft.right().Value() != 0) {
-      // Select Ext for Shr(And(x, mask), imm) where the result of the mask is
-      // shifted into the least-significant bits.
-      uint32_t mask = (mleft.right().Value() >> lsb) << lsb;
-      unsigned mask_width = base::bits::CountPopulation(mask);
-      unsigned mask_msb = base::bits::CountLeadingZeros32(mask);
-      if ((mask_msb + mask_width + lsb) == 32) {
-        Mips64OperandGenerator g(this);
-        DCHECK_EQ(lsb, base::bits::CountTrailingZeros32(mask));
-        Emit(kMips64Ext, g.DefineAsRegister(node),
-             g.UseRegister(mleft.left().node()), g.TempImmediate(lsb),
-             g.TempImmediate(mask_width));
-        return;
-      }
-    }
-  }
-  VisitRRO(this, kMips64Shr, node);
-}
-
-
-void InstructionSelector::VisitWord32Sar(Node* node) {
-  Int32BinopMatcher m(node);
-  if (m.left().IsWord32Shl() && CanCover(node, m.left().node())) {
-    Int32BinopMatcher mleft(m.left().node());
-    if (m.right().HasValue() && mleft.right().HasValue()) {
-      Mips64OperandGenerator g(this);
-      uint32_t sar = m.right().Value();
-      uint32_t shl = mleft.right().Value();
-      if ((sar == shl) && (sar == 16)) {
-        Emit(kMips64Seh, g.DefineAsRegister(node),
-             g.UseRegister(mleft.left().node()));
-        return;
-      } else if ((sar == shl) && (sar == 24)) {
-        Emit(kMips64Seb, g.DefineAsRegister(node),
-             g.UseRegister(mleft.left().node()));
-        return;
-      } else if ((sar == shl) && (sar == 32)) {
-        Emit(kMips64Shl, g.DefineAsRegister(node),
-             g.UseRegister(mleft.left().node()), g.TempImmediate(0));
-        return;
-      }
-    }
-  }
-  VisitRRO(this, kMips64Sar, node);
-}
-
-
-void InstructionSelector::VisitWord64Shl(Node* node) {
-  Mips64OperandGenerator g(this);
-  Int64BinopMatcher m(node);
-  if ((m.left().IsChangeInt32ToInt64() || m.left().IsChangeUint32ToUint64()) &&
-      m.right().IsInRange(32, 63) && CanCover(node, m.left().node())) {
-    // There's no need to sign/zero-extend to 64-bit if we shift out the upper
-    // 32 bits anyway.
-    Emit(kMips64Dshl, g.DefineSameAsFirst(node),
-         g.UseRegister(m.left().node()->InputAt(0)),
-         g.UseImmediate(m.right().node()));
-    return;
-  }
-  if (m.left().IsWord64And() && CanCover(node, m.left().node()) &&
-      m.right().IsInRange(1, 63)) {
-    // Match Word64Shl(Word64And(x, mask), imm) to Dshl where the mask is
-    // contiguous, and the shift immediate non-zero.
-    Int64BinopMatcher mleft(m.left().node());
-    if (mleft.right().HasValue()) {
-      uint64_t mask = mleft.right().Value();
-      uint32_t mask_width = base::bits::CountPopulation(mask);
-      uint32_t mask_msb = base::bits::CountLeadingZeros64(mask);
-      if ((mask_width != 0) && (mask_msb + mask_width == 64)) {
-        uint64_t shift = m.right().Value();
-        DCHECK_EQ(0u, base::bits::CountTrailingZeros64(mask));
-        DCHECK_NE(0u, shift);
-
-        if ((shift + mask_width) >= 64) {
-          // If the mask is contiguous and reaches or extends beyond the top
-          // bit, only the shift is needed.
-          Emit(kMips64Dshl, g.DefineAsRegister(node),
-               g.UseRegister(mleft.left().node()),
-               g.UseImmediate(m.right().node()));
-          return;
-        }
-      }
-    }
-  }
-  VisitRRO(this, kMips64Dshl, node);
-}
-
-
-void InstructionSelector::VisitWord64Shr(Node* node) {
-  Int64BinopMatcher m(node);
-  if (m.left().IsWord64And() && m.right().HasValue()) {
-    uint32_t lsb = m.right().Value() & 0x3F;
-    Int64BinopMatcher mleft(m.left().node());
-    if (mleft.right().HasValue() && mleft.right().Value() != 0) {
-      // Select Dext for Shr(And(x, mask), imm) where the result of the mask is
-      // shifted into the least-significant bits.
-      uint64_t mask = (mleft.right().Value() >> lsb) << lsb;
-      unsigned mask_width = base::bits::CountPopulation(mask);
-      unsigned mask_msb = base::bits::CountLeadingZeros64(mask);
-      if ((mask_msb + mask_width + lsb) == 64) {
-        Mips64OperandGenerator g(this);
-        DCHECK_EQ(lsb, base::bits::CountTrailingZeros64(mask));
-        Emit(kMips64Dext, g.DefineAsRegister(node),
-             g.UseRegister(mleft.left().node()), g.TempImmediate(lsb),
-             g.TempImmediate(mask_width));
-        return;
-      }
-    }
-  }
-  VisitRRO(this, kMips64Dshr, node);
-}
-
-
-void InstructionSelector::VisitWord64Sar(Node* node) {
-  if (TryEmitExtendingLoad(this, node, node)) return;
-  VisitRRO(this, kMips64Dsar, node);
-}
-
-
-void InstructionSelector::VisitWord32Ror(Node* node) {
-  VisitRRO(this, kMips64Ror, node);
-}
-
-
-void InstructionSelector::VisitWord32Clz(Node* node) {
-  VisitRR(this, kMips64Clz, node);
-}
-
-
-void InstructionSelector::VisitWord32ReverseBits(Node* node) { UNREACHABLE(); }
-
-
-void InstructionSelector::VisitWord64ReverseBits(Node* node) { UNREACHABLE(); }
-
-void InstructionSelector::VisitWord64ReverseBytes(Node* node) {
-  Mips64OperandGenerator g(this);
-  Emit(kMips64ByteSwap64, g.DefineAsRegister(node),
-       g.UseRegister(node->InputAt(0)));
-}
-
-void InstructionSelector::VisitWord32ReverseBytes(Node* node) {
-  Mips64OperandGenerator g(this);
-  Emit(kMips64ByteSwap32, g.DefineAsRegister(node),
-       g.UseRegister(node->InputAt(0)));
-}
-
-void InstructionSelector::VisitWord32Ctz(Node* node) {
-  Mips64OperandGenerator g(this);
-  Emit(kMips64Ctz, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0)));
-}
-
-
-void InstructionSelector::VisitWord64Ctz(Node* node) {
-  Mips64OperandGenerator g(this);
-  Emit(kMips64Dctz, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0)));
-}
-
-
-void InstructionSelector::VisitWord32Popcnt(Node* node) {
-  Mips64OperandGenerator g(this);
-  Emit(kMips64Popcnt, g.DefineAsRegister(node),
-       g.UseRegister(node->InputAt(0)));
-}
-
-
-void InstructionSelector::VisitWord64Popcnt(Node* node) {
-  Mips64OperandGenerator g(this);
-  Emit(kMips64Dpopcnt, g.DefineAsRegister(node),
-       g.UseRegister(node->InputAt(0)));
-}
-
-
-void InstructionSelector::VisitWord64Ror(Node* node) {
-  VisitRRO(this, kMips64Dror, node);
-}
-
-
-void InstructionSelector::VisitWord64Clz(Node* node) {
-  VisitRR(this, kMips64Dclz, node);
-}
-
-
-void InstructionSelector::VisitInt32Add(Node* node) {
-  Mips64OperandGenerator g(this);
-  Int32BinopMatcher m(node);
-
-  // Select Lsa for (left + (left_of_right << imm)).
-  if (m.right().opcode() == IrOpcode::kWord32Shl &&
-      CanCover(node, m.left().node()) && CanCover(node, m.right().node())) {
-    Int32BinopMatcher mright(m.right().node());
-    if (mright.right().HasValue() && !m.left().HasValue()) {
-      int32_t shift_value = static_cast<int32_t>(mright.right().Value());
-      Emit(kMips64Lsa, g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-           g.UseRegister(mright.left().node()), g.TempImmediate(shift_value));
-      return;
-    }
-  }
-
-  // Select Lsa for ((left_of_left << imm) + right).
-  if (m.left().opcode() == IrOpcode::kWord32Shl &&
-      CanCover(node, m.right().node()) && CanCover(node, m.left().node())) {
-    Int32BinopMatcher mleft(m.left().node());
-    if (mleft.right().HasValue() && !m.right().HasValue()) {
-      int32_t shift_value = static_cast<int32_t>(mleft.right().Value());
-      Emit(kMips64Lsa, g.DefineAsRegister(node),
-           g.UseRegister(m.right().node()), g.UseRegister(mleft.left().node()),
-           g.TempImmediate(shift_value));
-      return;
-    }
-  }
-  VisitBinop(this, node, kMips64Add, true, kMips64Add);
-}
-
-
-void InstructionSelector::VisitInt64Add(Node* node) {
-  Mips64OperandGenerator g(this);
-  Int64BinopMatcher m(node);
-
-  // Select Dlsa for (left + (left_of_right << imm)).
-  if (m.right().opcode() == IrOpcode::kWord64Shl &&
-      CanCover(node, m.left().node()) && CanCover(node, m.right().node())) {
-    Int64BinopMatcher mright(m.right().node());
-    if (mright.right().HasValue() && !m.left().HasValue()) {
-      int32_t shift_value = static_cast<int32_t>(mright.right().Value());
-      Emit(kMips64Dlsa, g.DefineAsRegister(node),
-           g.UseRegister(m.left().node()), g.UseRegister(mright.left().node()),
-           g.TempImmediate(shift_value));
-      return;
-    }
-  }
-
-  // Select Dlsa for ((left_of_left << imm) + right).
-  if (m.left().opcode() == IrOpcode::kWord64Shl &&
-      CanCover(node, m.right().node()) && CanCover(node, m.left().node())) {
-    Int64BinopMatcher mleft(m.left().node());
-    if (mleft.right().HasValue() && !m.right().HasValue()) {
-      int32_t shift_value = static_cast<int32_t>(mleft.right().Value());
-      Emit(kMips64Dlsa, g.DefineAsRegister(node),
-           g.UseRegister(m.right().node()), g.UseRegister(mleft.left().node()),
-           g.TempImmediate(shift_value));
-      return;
-    }
-  }
-
-  VisitBinop(this, node, kMips64Dadd, true, kMips64Dadd);
-}
-
-
-void InstructionSelector::VisitInt32Sub(Node* node) {
-  VisitBinop(this, node, kMips64Sub);
-}
-
-
-void InstructionSelector::VisitInt64Sub(Node* node) {
-  VisitBinop(this, node, kMips64Dsub);
-}
-
-
-void InstructionSelector::VisitInt32Mul(Node* node) {
-  Mips64OperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  if (m.right().HasValue() && m.right().Value() > 0) {
-    uint32_t value = static_cast<uint32_t>(m.right().Value());
-    if (base::bits::IsPowerOfTwo(value)) {
-      Emit(kMips64Shl | AddressingModeField::encode(kMode_None),
-           g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-           g.TempImmediate(WhichPowerOf2(value)));
-      return;
-    }
-    if (base::bits::IsPowerOfTwo(value - 1)) {
-      Emit(kMips64Lsa, g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-           g.UseRegister(m.left().node()),
-           g.TempImmediate(WhichPowerOf2(value - 1)));
-      return;
-    }
-    if (base::bits::IsPowerOfTwo(value + 1)) {
-      InstructionOperand temp = g.TempRegister();
-      Emit(kMips64Shl | AddressingModeField::encode(kMode_None), temp,
-           g.UseRegister(m.left().node()),
-           g.TempImmediate(WhichPowerOf2(value + 1)));
-      Emit(kMips64Sub | AddressingModeField::encode(kMode_None),
-           g.DefineAsRegister(node), temp, g.UseRegister(m.left().node()));
-      return;
-    }
-  }
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-  if (CanCover(node, left) && CanCover(node, right)) {
-    if (left->opcode() == IrOpcode::kWord64Sar &&
-        right->opcode() == IrOpcode::kWord64Sar) {
-      Int64BinopMatcher leftInput(left), rightInput(right);
-      if (leftInput.right().Is(32) && rightInput.right().Is(32)) {
-        // Combine untagging shifts with Dmul high.
-        Emit(kMips64DMulHigh, g.DefineSameAsFirst(node),
-             g.UseRegister(leftInput.left().node()),
-             g.UseRegister(rightInput.left().node()));
-        return;
-      }
-    }
-  }
-  VisitRRR(this, kMips64Mul, node);
-}
-
-
-void InstructionSelector::VisitInt32MulHigh(Node* node) {
-  VisitRRR(this, kMips64MulHigh, node);
-}
-
-
-void InstructionSelector::VisitUint32MulHigh(Node* node) {
-  VisitRRR(this, kMips64MulHighU, node);
-}
-
-
-void InstructionSelector::VisitInt64Mul(Node* node) {
-  Mips64OperandGenerator g(this);
-  Int64BinopMatcher m(node);
-  // TODO(dusmil): Add optimization for shifts larger than 32.
-  if (m.right().HasValue() && m.right().Value() > 0) {
-    uint32_t value = static_cast<uint32_t>(m.right().Value());
-    if (base::bits::IsPowerOfTwo(value)) {
-      Emit(kMips64Dshl | AddressingModeField::encode(kMode_None),
-           g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-           g.TempImmediate(WhichPowerOf2(value)));
-      return;
-    }
-    if (base::bits::IsPowerOfTwo(value - 1)) {
-      // Dlsa macro will handle the shifting value out of bound cases.
-      Emit(kMips64Dlsa, g.DefineAsRegister(node),
-           g.UseRegister(m.left().node()), g.UseRegister(m.left().node()),
-           g.TempImmediate(WhichPowerOf2(value - 1)));
-      return;
-    }
-    if (base::bits::IsPowerOfTwo(value + 1)) {
-      InstructionOperand temp = g.TempRegister();
-      Emit(kMips64Dshl | AddressingModeField::encode(kMode_None), temp,
-           g.UseRegister(m.left().node()),
-           g.TempImmediate(WhichPowerOf2(value + 1)));
-      Emit(kMips64Dsub | AddressingModeField::encode(kMode_None),
-           g.DefineAsRegister(node), temp, g.UseRegister(m.left().node()));
-      return;
-    }
-  }
-  Emit(kMips64Dmul, g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-       g.UseRegister(m.right().node()));
-}
-
-
-void InstructionSelector::VisitInt32Div(Node* node) {
-  Mips64OperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-  if (CanCover(node, left) && CanCover(node, right)) {
-    if (left->opcode() == IrOpcode::kWord64Sar &&
-        right->opcode() == IrOpcode::kWord64Sar) {
-      Int64BinopMatcher rightInput(right), leftInput(left);
-      if (rightInput.right().Is(32) && leftInput.right().Is(32)) {
-        // Combine both shifted operands with Ddiv.
-        Emit(kMips64Ddiv, g.DefineSameAsFirst(node),
-             g.UseRegister(leftInput.left().node()),
-             g.UseRegister(rightInput.left().node()));
-        return;
-      }
-    }
-  }
-  Emit(kMips64Div, g.DefineSameAsFirst(node), g.UseRegister(m.left().node()),
-       g.UseRegister(m.right().node()));
-}
-
-
-void InstructionSelector::VisitUint32Div(Node* node) {
-  Mips64OperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  Emit(kMips64DivU, g.DefineSameAsFirst(node), g.UseRegister(m.left().node()),
-       g.UseRegister(m.right().node()));
-}
-
-
-void InstructionSelector::VisitInt32Mod(Node* node) {
-  Mips64OperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-  if (CanCover(node, left) && CanCover(node, right)) {
-    if (left->opcode() == IrOpcode::kWord64Sar &&
-        right->opcode() == IrOpcode::kWord64Sar) {
-      Int64BinopMatcher rightInput(right), leftInput(left);
-      if (rightInput.right().Is(32) && leftInput.right().Is(32)) {
-        // Combine both shifted operands with Dmod.
-        Emit(kMips64Dmod, g.DefineSameAsFirst(node),
-             g.UseRegister(leftInput.left().node()),
-             g.UseRegister(rightInput.left().node()));
-        return;
-      }
-    }
-  }
-  Emit(kMips64Mod, g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-       g.UseRegister(m.right().node()));
-}
-
-
-void InstructionSelector::VisitUint32Mod(Node* node) {
-  Mips64OperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  Emit(kMips64ModU, g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-       g.UseRegister(m.right().node()));
-}
-
-
-void InstructionSelector::VisitInt64Div(Node* node) {
-  Mips64OperandGenerator g(this);
-  Int64BinopMatcher m(node);
-  Emit(kMips64Ddiv, g.DefineSameAsFirst(node), g.UseRegister(m.left().node()),
-       g.UseRegister(m.right().node()));
-}
-
-
-void InstructionSelector::VisitUint64Div(Node* node) {
-  Mips64OperandGenerator g(this);
-  Int64BinopMatcher m(node);
-  Emit(kMips64DdivU, g.DefineSameAsFirst(node), g.UseRegister(m.left().node()),
-       g.UseRegister(m.right().node()));
-}
-
-
-void InstructionSelector::VisitInt64Mod(Node* node) {
-  Mips64OperandGenerator g(this);
-  Int64BinopMatcher m(node);
-  Emit(kMips64Dmod, g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-       g.UseRegister(m.right().node()));
-}
-
-
-void InstructionSelector::VisitUint64Mod(Node* node) {
-  Mips64OperandGenerator g(this);
-  Int64BinopMatcher m(node);
-  Emit(kMips64DmodU, g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-       g.UseRegister(m.right().node()));
-}
-
-
-void InstructionSelector::VisitChangeFloat32ToFloat64(Node* node) {
-  VisitRR(this, kMips64CvtDS, node);
-}
-
-
-void InstructionSelector::VisitRoundInt32ToFloat32(Node* node) {
-  VisitRR(this, kMips64CvtSW, node);
-}
-
-
-void InstructionSelector::VisitRoundUint32ToFloat32(Node* node) {
-  VisitRR(this, kMips64CvtSUw, node);
-}
-
-
-void InstructionSelector::VisitChangeInt32ToFloat64(Node* node) {
-  VisitRR(this, kMips64CvtDW, node);
-}
-
-
-void InstructionSelector::VisitChangeUint32ToFloat64(Node* node) {
-  VisitRR(this, kMips64CvtDUw, node);
-}
-
-
-void InstructionSelector::VisitTruncateFloat32ToInt32(Node* node) {
-  VisitRR(this, kMips64TruncWS, node);
-}
-
-
-void InstructionSelector::VisitTruncateFloat32ToUint32(Node* node) {
-  VisitRR(this, kMips64TruncUwS, node);
-}
-
-
-void InstructionSelector::VisitChangeFloat64ToInt32(Node* node) {
-  Mips64OperandGenerator g(this);
-  Node* value = node->InputAt(0);
-  // Match ChangeFloat64ToInt32(Float64Round##OP) to corresponding instruction
-  // which does rounding and conversion to integer format.
-  if (CanCover(node, value)) {
-    switch (value->opcode()) {
-      case IrOpcode::kFloat64RoundDown:
-        Emit(kMips64FloorWD, g.DefineAsRegister(node),
-             g.UseRegister(value->InputAt(0)));
-        return;
-      case IrOpcode::kFloat64RoundUp:
-        Emit(kMips64CeilWD, g.DefineAsRegister(node),
-             g.UseRegister(value->InputAt(0)));
-        return;
-      case IrOpcode::kFloat64RoundTiesEven:
-        Emit(kMips64RoundWD, g.DefineAsRegister(node),
-             g.UseRegister(value->InputAt(0)));
-        return;
-      case IrOpcode::kFloat64RoundTruncate:
-        Emit(kMips64TruncWD, g.DefineAsRegister(node),
-             g.UseRegister(value->InputAt(0)));
-        return;
-      default:
-        break;
-    }
-    if (value->opcode() == IrOpcode::kChangeFloat32ToFloat64) {
-      Node* next = value->InputAt(0);
-      if (CanCover(value, next)) {
-        // Match ChangeFloat64ToInt32(ChangeFloat32ToFloat64(Float64Round##OP))
-        switch (next->opcode()) {
-          case IrOpcode::kFloat32RoundDown:
-            Emit(kMips64FloorWS, g.DefineAsRegister(node),
-                 g.UseRegister(next->InputAt(0)));
-            return;
-          case IrOpcode::kFloat32RoundUp:
-            Emit(kMips64CeilWS, g.DefineAsRegister(node),
-                 g.UseRegister(next->InputAt(0)));
-            return;
-          case IrOpcode::kFloat32RoundTiesEven:
-            Emit(kMips64RoundWS, g.DefineAsRegister(node),
-                 g.UseRegister(next->InputAt(0)));
-            return;
-          case IrOpcode::kFloat32RoundTruncate:
-            Emit(kMips64TruncWS, g.DefineAsRegister(node),
-                 g.UseRegister(next->InputAt(0)));
-            return;
-          default:
-            Emit(kMips64TruncWS, g.DefineAsRegister(node),
-                 g.UseRegister(value->InputAt(0)));
-            return;
-        }
-      } else {
-        // Match float32 -> float64 -> int32 representation change path.
-        Emit(kMips64TruncWS, g.DefineAsRegister(node),
-             g.UseRegister(value->InputAt(0)));
-        return;
-      }
-    }
-  }
-  VisitRR(this, kMips64TruncWD, node);
-}
-
-
-void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) {
-  VisitRR(this, kMips64TruncUwD, node);
-}
-
-void InstructionSelector::VisitChangeFloat64ToUint64(Node* node) {
-  VisitRR(this, kMips64TruncUlD, node);
-}
-
-void InstructionSelector::VisitTruncateFloat64ToUint32(Node* node) {
-  VisitRR(this, kMips64TruncUwD, node);
-}
-
-void InstructionSelector::VisitTryTruncateFloat32ToInt64(Node* node) {
-  Mips64OperandGenerator g(this);
-  InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))};
-  InstructionOperand outputs[2];
-  size_t output_count = 0;
-  outputs[output_count++] = g.DefineAsRegister(node);
-
-  Node* success_output = NodeProperties::FindProjection(node, 1);
-  if (success_output) {
-    outputs[output_count++] = g.DefineAsRegister(success_output);
-  }
-
-  this->Emit(kMips64TruncLS, output_count, outputs, 1, inputs);
-}
-
-
-void InstructionSelector::VisitTryTruncateFloat64ToInt64(Node* node) {
-  Mips64OperandGenerator g(this);
-  InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))};
-  InstructionOperand outputs[2];
-  size_t output_count = 0;
-  outputs[output_count++] = g.DefineAsRegister(node);
-
-  Node* success_output = NodeProperties::FindProjection(node, 1);
-  if (success_output) {
-    outputs[output_count++] = g.DefineAsRegister(success_output);
-  }
-
-  Emit(kMips64TruncLD, output_count, outputs, 1, inputs);
-}
-
-
-void InstructionSelector::VisitTryTruncateFloat32ToUint64(Node* node) {
-  Mips64OperandGenerator g(this);
-  InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))};
-  InstructionOperand outputs[2];
-  size_t output_count = 0;
-  outputs[output_count++] = g.DefineAsRegister(node);
-
-  Node* success_output = NodeProperties::FindProjection(node, 1);
-  if (success_output) {
-    outputs[output_count++] = g.DefineAsRegister(success_output);
-  }
-
-  Emit(kMips64TruncUlS, output_count, outputs, 1, inputs);
-}
-
-
-void InstructionSelector::VisitTryTruncateFloat64ToUint64(Node* node) {
-  Mips64OperandGenerator g(this);
-
-  InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))};
-  InstructionOperand outputs[2];
-  size_t output_count = 0;
-  outputs[output_count++] = g.DefineAsRegister(node);
-
-  Node* success_output = NodeProperties::FindProjection(node, 1);
-  if (success_output) {
-    outputs[output_count++] = g.DefineAsRegister(success_output);
-  }
-
-  Emit(kMips64TruncUlD, output_count, outputs, 1, inputs);
-}
-
-
-void InstructionSelector::VisitChangeInt32ToInt64(Node* node) {
-  Node* value = node->InputAt(0);
-  if (value->opcode() == IrOpcode::kLoad && CanCover(node, value)) {
-    // Generate sign-extending load.
-    LoadRepresentation load_rep = LoadRepresentationOf(value->op());
-    InstructionCode opcode = kArchNop;
-    switch (load_rep.representation()) {
-      case MachineRepresentation::kBit:  // Fall through.
-      case MachineRepresentation::kWord8:
-        opcode = load_rep.IsUnsigned() ? kMips64Lbu : kMips64Lb;
-        break;
-      case MachineRepresentation::kWord16:
-        opcode = load_rep.IsUnsigned() ? kMips64Lhu : kMips64Lh;
-        break;
-      case MachineRepresentation::kWord32:
-        opcode = kMips64Lw;
-        break;
-      default:
-        UNREACHABLE();
-        return;
-    }
-    EmitLoad(this, value, opcode, node);
-  } else {
-    Mips64OperandGenerator g(this);
-    Emit(kMips64Shl, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0)),
-         g.TempImmediate(0));
-  }
-}
-
-
-void InstructionSelector::VisitChangeUint32ToUint64(Node* node) {
-  Mips64OperandGenerator g(this);
-  Node* value = node->InputAt(0);
-  switch (value->opcode()) {
-    // 32-bit operations will write their result in a 64 bit register,
-    // clearing the top 32 bits of the destination register.
-    case IrOpcode::kUint32Div:
-    case IrOpcode::kUint32Mod:
-    case IrOpcode::kUint32MulHigh: {
-      Emit(kArchNop, g.DefineSameAsFirst(node), g.Use(value));
-      return;
-    }
-    case IrOpcode::kLoad: {
-      LoadRepresentation load_rep = LoadRepresentationOf(value->op());
-      if (load_rep.IsUnsigned()) {
-        switch (load_rep.representation()) {
-          case MachineRepresentation::kWord8:
-          case MachineRepresentation::kWord16:
-          case MachineRepresentation::kWord32:
-            Emit(kArchNop, g.DefineSameAsFirst(node), g.Use(value));
-            return;
-          default:
-            break;
-        }
-      }
-    }
-    default:
-      break;
-  }
-  Emit(kMips64Dext, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0)),
-       g.TempImmediate(0), g.TempImmediate(32));
-}
-
-
-void InstructionSelector::VisitTruncateInt64ToInt32(Node* node) {
-  Mips64OperandGenerator g(this);
-  Node* value = node->InputAt(0);
-  if (CanCover(node, value)) {
-    switch (value->opcode()) {
-      case IrOpcode::kWord64Sar: {
-        if (TryEmitExtendingLoad(this, value, node)) {
-          return;
-        } else {
-          Int64BinopMatcher m(value);
-          if (m.right().IsInRange(32, 63)) {
-            // After smi untagging no need for truncate. Combine sequence.
-            Emit(kMips64Dsar, g.DefineSameAsFirst(node),
-                 g.UseRegister(m.left().node()),
-                 g.UseImmediate(m.right().node()));
-            return;
-          }
-        }
-        break;
-      }
-      default:
-        break;
-    }
-  }
-  Emit(kMips64Ext, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0)),
-       g.TempImmediate(0), g.TempImmediate(32));
-}
-
-
-void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) {
-  Mips64OperandGenerator g(this);
-  Node* value = node->InputAt(0);
-  // Match TruncateFloat64ToFloat32(ChangeInt32ToFloat64) to corresponding
-  // instruction.
-  if (CanCover(node, value) &&
-      value->opcode() == IrOpcode::kChangeInt32ToFloat64) {
-    Emit(kMips64CvtSW, g.DefineAsRegister(node),
-         g.UseRegister(value->InputAt(0)));
-    return;
-  }
-  VisitRR(this, kMips64CvtSD, node);
-}
-
-void InstructionSelector::VisitTruncateFloat64ToWord32(Node* node) {
-  VisitRR(this, kArchTruncateDoubleToI, node);
-}
-
-void InstructionSelector::VisitRoundFloat64ToInt32(Node* node) {
-  VisitRR(this, kMips64TruncWD, node);
-}
-
-void InstructionSelector::VisitRoundInt64ToFloat32(Node* node) {
-  VisitRR(this, kMips64CvtSL, node);
-}
-
-
-void InstructionSelector::VisitRoundInt64ToFloat64(Node* node) {
-  VisitRR(this, kMips64CvtDL, node);
-}
-
-
-void InstructionSelector::VisitRoundUint64ToFloat32(Node* node) {
-  VisitRR(this, kMips64CvtSUl, node);
-}
-
-
-void InstructionSelector::VisitRoundUint64ToFloat64(Node* node) {
-  VisitRR(this, kMips64CvtDUl, node);
-}
-
-
-void InstructionSelector::VisitBitcastFloat32ToInt32(Node* node) {
-  VisitRR(this, kMips64Float64ExtractLowWord32, node);
-}
-
-
-void InstructionSelector::VisitBitcastFloat64ToInt64(Node* node) {
-  VisitRR(this, kMips64BitcastDL, node);
-}
-
-
-void InstructionSelector::VisitBitcastInt32ToFloat32(Node* node) {
-  Mips64OperandGenerator g(this);
-  Emit(kMips64Float64InsertLowWord32, g.DefineAsRegister(node),
-       ImmediateOperand(ImmediateOperand::INLINE, 0),
-       g.UseRegister(node->InputAt(0)));
-}
-
-
-void InstructionSelector::VisitBitcastInt64ToFloat64(Node* node) {
-  VisitRR(this, kMips64BitcastLD, node);
-}
-
-
-void InstructionSelector::VisitFloat32Add(Node* node) {
-  // Optimization with Madd.S(z, x, y) is intentionally removed.
-  // See explanation for madd_s in assembler-mips64.cc.
-  VisitRRR(this, kMips64AddS, node);
-}
-
-
-void InstructionSelector::VisitFloat64Add(Node* node) {
-  // Optimization with Madd.D(z, x, y) is intentionally removed.
-  // See explanation for madd_d in assembler-mips64.cc.
-  VisitRRR(this, kMips64AddD, node);
-}
-
-
-void InstructionSelector::VisitFloat32Sub(Node* node) {
-  // Optimization with Msub.S(z, x, y) is intentionally removed.
-  // See explanation for madd_s in assembler-mips64.cc.
-  VisitRRR(this, kMips64SubS, node);
-}
-
-void InstructionSelector::VisitFloat64Sub(Node* node) {
-  // Optimization with Msub.D(z, x, y) is intentionally removed.
-  // See explanation for madd_d in assembler-mips64.cc.
-  VisitRRR(this, kMips64SubD, node);
-}
-
-void InstructionSelector::VisitFloat32Mul(Node* node) {
-  VisitRRR(this, kMips64MulS, node);
-}
-
-
-void InstructionSelector::VisitFloat64Mul(Node* node) {
-  VisitRRR(this, kMips64MulD, node);
-}
-
-
-void InstructionSelector::VisitFloat32Div(Node* node) {
-  VisitRRR(this, kMips64DivS, node);
-}
-
-
-void InstructionSelector::VisitFloat64Div(Node* node) {
-  VisitRRR(this, kMips64DivD, node);
-}
-
-
-void InstructionSelector::VisitFloat64Mod(Node* node) {
-  Mips64OperandGenerator g(this);
-  Emit(kMips64ModD, g.DefineAsFixed(node, f0),
-       g.UseFixed(node->InputAt(0), f12),
-       g.UseFixed(node->InputAt(1), f14))->MarkAsCall();
-}
-
-void InstructionSelector::VisitFloat32Max(Node* node) {
-  Mips64OperandGenerator g(this);
-  Emit(kMips64Float32Max, g.DefineAsRegister(node),
-       g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)));
-}
-
-void InstructionSelector::VisitFloat64Max(Node* node) {
-  Mips64OperandGenerator g(this);
-  Emit(kMips64Float64Max, g.DefineAsRegister(node),
-       g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)));
-}
-
-void InstructionSelector::VisitFloat32Min(Node* node) {
-  Mips64OperandGenerator g(this);
-  Emit(kMips64Float32Min, g.DefineAsRegister(node),
-       g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)));
-}
-
-void InstructionSelector::VisitFloat64Min(Node* node) {
-  Mips64OperandGenerator g(this);
-  Emit(kMips64Float64Min, g.DefineAsRegister(node),
-       g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)));
-}
-
-
-void InstructionSelector::VisitFloat32Abs(Node* node) {
-  VisitRR(this, kMips64AbsS, node);
-}
-
-
-void InstructionSelector::VisitFloat64Abs(Node* node) {
-  VisitRR(this, kMips64AbsD, node);
-}
-
-void InstructionSelector::VisitFloat32Sqrt(Node* node) {
-  VisitRR(this, kMips64SqrtS, node);
-}
-
-
-void InstructionSelector::VisitFloat64Sqrt(Node* node) {
-  VisitRR(this, kMips64SqrtD, node);
-}
-
-
-void InstructionSelector::VisitFloat32RoundDown(Node* node) {
-  VisitRR(this, kMips64Float32RoundDown, node);
-}
-
-
-void InstructionSelector::VisitFloat64RoundDown(Node* node) {
-  VisitRR(this, kMips64Float64RoundDown, node);
-}
-
-
-void InstructionSelector::VisitFloat32RoundUp(Node* node) {
-  VisitRR(this, kMips64Float32RoundUp, node);
-}
-
-
-void InstructionSelector::VisitFloat64RoundUp(Node* node) {
-  VisitRR(this, kMips64Float64RoundUp, node);
-}
-
-
-void InstructionSelector::VisitFloat32RoundTruncate(Node* node) {
-  VisitRR(this, kMips64Float32RoundTruncate, node);
-}
-
-
-void InstructionSelector::VisitFloat64RoundTruncate(Node* node) {
-  VisitRR(this, kMips64Float64RoundTruncate, node);
-}
-
-
-void InstructionSelector::VisitFloat64RoundTiesAway(Node* node) {
-  UNREACHABLE();
-}
-
-
-void InstructionSelector::VisitFloat32RoundTiesEven(Node* node) {
-  VisitRR(this, kMips64Float32RoundTiesEven, node);
-}
-
-
-void InstructionSelector::VisitFloat64RoundTiesEven(Node* node) {
-  VisitRR(this, kMips64Float64RoundTiesEven, node);
-}
-
-void InstructionSelector::VisitFloat32Neg(Node* node) {
-  VisitRR(this, kMips64NegS, node);
-}
-
-void InstructionSelector::VisitFloat64Neg(Node* node) {
-  VisitRR(this, kMips64NegD, node);
-}
-
-void InstructionSelector::VisitFloat64Ieee754Binop(Node* node,
-                                                   InstructionCode opcode) {
-  Mips64OperandGenerator g(this);
-  Emit(opcode, g.DefineAsFixed(node, f0), g.UseFixed(node->InputAt(0), f2),
-       g.UseFixed(node->InputAt(1), f4))
-      ->MarkAsCall();
-}
-
-void InstructionSelector::VisitFloat64Ieee754Unop(Node* node,
-                                                  InstructionCode opcode) {
-  Mips64OperandGenerator g(this);
-  Emit(opcode, g.DefineAsFixed(node, f0), g.UseFixed(node->InputAt(0), f12))
-      ->MarkAsCall();
-}
-
-void InstructionSelector::EmitPrepareArguments(
-    ZoneVector<PushParameter>* arguments, const CallDescriptor* descriptor,
-    Node* node) {
-  Mips64OperandGenerator g(this);
-
-  // Prepare for C function call.
-  if (descriptor->IsCFunctionCall()) {
-    Emit(kArchPrepareCallCFunction |
-             MiscField::encode(static_cast<int>(descriptor->ParameterCount())),
-         0, nullptr, 0, nullptr);
-
-    // Poke any stack arguments.
-    int slot = kCArgSlotCount;
-    for (PushParameter input : (*arguments)) {
-      Emit(kMips64StoreToStackSlot, g.NoOutput(), g.UseRegister(input.node),
-           g.TempImmediate(slot << kPointerSizeLog2));
-      ++slot;
-    }
-  } else {
-    int push_count = static_cast<int>(descriptor->StackParameterCount());
-    if (push_count > 0) {
-      Emit(kMips64StackClaim, g.NoOutput(),
-           g.TempImmediate(push_count << kPointerSizeLog2));
-    }
-    for (size_t n = 0; n < arguments->size(); ++n) {
-      PushParameter input = (*arguments)[n];
-      if (input.node) {
-        Emit(kMips64StoreToStackSlot, g.NoOutput(), g.UseRegister(input.node),
-             g.TempImmediate(static_cast<int>(n << kPointerSizeLog2)));
-      }
-    }
-  }
-}
-
-void InstructionSelector::EmitPrepareResults(ZoneVector<PushParameter>* results,
-                                             const CallDescriptor* descriptor,
-                                             Node* node) {
-  Mips64OperandGenerator g(this);
-
-  int reverse_slot = 0;
-  for (PushParameter output : *results) {
-    if (!output.location.IsCallerFrameSlot()) continue;
-    // Skip any alignment holes in nodes.
-    if (output.node != nullptr) {
-      DCHECK(!descriptor->IsCFunctionCall());
-      if (output.location.GetType() == MachineType::Float32()) {
-        MarkAsFloat32(output.node);
-      } else if (output.location.GetType() == MachineType::Float64()) {
-        MarkAsFloat64(output.node);
-      }
-      InstructionOperand result = g.DefineAsRegister(output.node);
-      Emit(kMips64Peek | MiscField::encode(reverse_slot), result);
-    }
-    reverse_slot += output.location.GetSizeInPointers();
-  }
-}
-
-bool InstructionSelector::IsTailCallAddressImmediate() { return false; }
-
-int InstructionSelector::GetTempsCountForTailCallFromJSFunction() { return 3; }
-
-void InstructionSelector::VisitUnalignedLoad(Node* node) {
-  UnalignedLoadRepresentation load_rep =
-      UnalignedLoadRepresentationOf(node->op());
-  Mips64OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-
-  ArchOpcode opcode = kArchNop;
-  switch (load_rep.representation()) {
-    case MachineRepresentation::kFloat32:
-      opcode = kMips64Ulwc1;
-      break;
-    case MachineRepresentation::kFloat64:
-      opcode = kMips64Uldc1;
-      break;
-    case MachineRepresentation::kBit:  // Fall through.
-    case MachineRepresentation::kWord8:
-      UNREACHABLE();
-      break;
-    case MachineRepresentation::kWord16:
-      opcode = load_rep.IsUnsigned() ? kMips64Ulhu : kMips64Ulh;
-      break;
-    case MachineRepresentation::kWord32:
-      opcode = load_rep.IsUnsigned() ? kMips64Ulwu : kMips64Ulw;
-      break;
-    case MachineRepresentation::kTaggedSigned:   // Fall through.
-    case MachineRepresentation::kTaggedPointer:  // Fall through.
-    case MachineRepresentation::kTagged:  // Fall through.
-    case MachineRepresentation::kWord64:
-      opcode = kMips64Uld;
-      break;
-    case MachineRepresentation::kSimd128:
-      opcode = kMips64MsaLd;
-      break;
-    case MachineRepresentation::kNone:
-      UNREACHABLE();
-      return;
-  }
-
-  if (g.CanBeImmediate(index, opcode)) {
-    Emit(opcode | AddressingModeField::encode(kMode_MRI),
-         g.DefineAsRegister(node), g.UseRegister(base), g.UseImmediate(index));
-  } else {
-    InstructionOperand addr_reg = g.TempRegister();
-    Emit(kMips64Dadd | AddressingModeField::encode(kMode_None), addr_reg,
-         g.UseRegister(index), g.UseRegister(base));
-    // Emit desired load opcode, using temp addr_reg.
-    Emit(opcode | AddressingModeField::encode(kMode_MRI),
-         g.DefineAsRegister(node), addr_reg, g.TempImmediate(0));
-  }
-}
-
-void InstructionSelector::VisitUnalignedStore(Node* node) {
-  Mips64OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-
-  UnalignedStoreRepresentation rep = UnalignedStoreRepresentationOf(node->op());
-  ArchOpcode opcode = kArchNop;
-  switch (rep) {
-    case MachineRepresentation::kFloat32:
-      opcode = kMips64Uswc1;
-      break;
-    case MachineRepresentation::kFloat64:
-      opcode = kMips64Usdc1;
-      break;
-    case MachineRepresentation::kBit:  // Fall through.
-    case MachineRepresentation::kWord8:
-      UNREACHABLE();
-      break;
-    case MachineRepresentation::kWord16:
-      opcode = kMips64Ush;
-      break;
-    case MachineRepresentation::kWord32:
-      opcode = kMips64Usw;
-      break;
-    case MachineRepresentation::kTaggedSigned:   // Fall through.
-    case MachineRepresentation::kTaggedPointer:  // Fall through.
-    case MachineRepresentation::kTagged:  // Fall through.
-    case MachineRepresentation::kWord64:
-      opcode = kMips64Usd;
-      break;
-    case MachineRepresentation::kSimd128:
-      opcode = kMips64MsaSt;
-      break;
-    case MachineRepresentation::kNone:
-      UNREACHABLE();
-      return;
-  }
-
-  if (g.CanBeImmediate(index, opcode)) {
-    Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(),
-         g.UseRegister(base), g.UseImmediate(index),
-         g.UseRegisterOrImmediateZero(value));
-  } else {
-    InstructionOperand addr_reg = g.TempRegister();
-    Emit(kMips64Dadd | AddressingModeField::encode(kMode_None), addr_reg,
-         g.UseRegister(index), g.UseRegister(base));
-    // Emit desired store opcode, using temp addr_reg.
-    Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(),
-         addr_reg, g.TempImmediate(0), g.UseRegisterOrImmediateZero(value));
-  }
-}
-
-namespace {
-
-// Shared routine for multiple compare operations.
-static void VisitCompare(InstructionSelector* selector, InstructionCode opcode,
-                         InstructionOperand left, InstructionOperand right,
-                         FlagsContinuation* cont) {
-  Mips64OperandGenerator g(selector);
-  opcode = cont->Encode(opcode);
-  if (cont->IsBranch()) {
-    selector->Emit(opcode, g.NoOutput(), left, right,
-                   g.Label(cont->true_block()), g.Label(cont->false_block()));
-  } else if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(opcode, g.NoOutput(), left, right, cont->kind(),
-                             cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else if (cont->IsSet()) {
-    selector->Emit(opcode, g.DefineAsRegister(cont->result()), left, right);
-  } else {
-    DCHECK(cont->IsTrap());
-    selector->Emit(opcode, g.NoOutput(), left, right,
-                   g.TempImmediate(cont->trap_id()));
-  }
-}
-
-
-// Shared routine for multiple float32 compare operations.
-void VisitFloat32Compare(InstructionSelector* selector, Node* node,
-                         FlagsContinuation* cont) {
-  Mips64OperandGenerator g(selector);
-  Float32BinopMatcher m(node);
-  InstructionOperand lhs, rhs;
-
-  lhs = m.left().IsZero() ? g.UseImmediate(m.left().node())
-                          : g.UseRegister(m.left().node());
-  rhs = m.right().IsZero() ? g.UseImmediate(m.right().node())
-                           : g.UseRegister(m.right().node());
-  VisitCompare(selector, kMips64CmpS, lhs, rhs, cont);
-}
-
-
-// Shared routine for multiple float64 compare operations.
-void VisitFloat64Compare(InstructionSelector* selector, Node* node,
-                         FlagsContinuation* cont) {
-  Mips64OperandGenerator g(selector);
-  Float64BinopMatcher m(node);
-  InstructionOperand lhs, rhs;
-
-  lhs = m.left().IsZero() ? g.UseImmediate(m.left().node())
-                          : g.UseRegister(m.left().node());
-  rhs = m.right().IsZero() ? g.UseImmediate(m.right().node())
-                           : g.UseRegister(m.right().node());
-  VisitCompare(selector, kMips64CmpD, lhs, rhs, cont);
-}
-
-
-// Shared routine for multiple word compare operations.
-void VisitWordCompare(InstructionSelector* selector, Node* node,
-                      InstructionCode opcode, FlagsContinuation* cont,
-                      bool commutative) {
-  Mips64OperandGenerator g(selector);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-
-  // Match immediates on left or right side of comparison.
-  if (g.CanBeImmediate(right, opcode)) {
-    if (opcode == kMips64Tst) {
-      VisitCompare(selector, opcode, g.UseRegister(left), g.UseImmediate(right),
-                   cont);
-    } else {
-      switch (cont->condition()) {
-        case kEqual:
-        case kNotEqual:
-          if (cont->IsSet()) {
-            VisitCompare(selector, opcode, g.UseRegister(left),
-                         g.UseImmediate(right), cont);
-          } else {
-            VisitCompare(selector, opcode, g.UseRegister(left),
-                         g.UseRegister(right), cont);
-          }
-          break;
-        case kSignedLessThan:
-        case kSignedGreaterThanOrEqual:
-        case kUnsignedLessThan:
-        case kUnsignedGreaterThanOrEqual:
-          VisitCompare(selector, opcode, g.UseRegister(left),
-                       g.UseImmediate(right), cont);
-          break;
-        default:
-          VisitCompare(selector, opcode, g.UseRegister(left),
-                       g.UseRegister(right), cont);
-      }
-    }
-  } else if (g.CanBeImmediate(left, opcode)) {
-    if (!commutative) cont->Commute();
-    if (opcode == kMips64Tst) {
-      VisitCompare(selector, opcode, g.UseRegister(right), g.UseImmediate(left),
-                   cont);
-    } else {
-      switch (cont->condition()) {
-        case kEqual:
-        case kNotEqual:
-          if (cont->IsSet()) {
-            VisitCompare(selector, opcode, g.UseRegister(right),
-                         g.UseImmediate(left), cont);
-          } else {
-            VisitCompare(selector, opcode, g.UseRegister(right),
-                         g.UseRegister(left), cont);
-          }
-          break;
-        case kSignedLessThan:
-        case kSignedGreaterThanOrEqual:
-        case kUnsignedLessThan:
-        case kUnsignedGreaterThanOrEqual:
-          VisitCompare(selector, opcode, g.UseRegister(right),
-                       g.UseImmediate(left), cont);
-          break;
-        default:
-          VisitCompare(selector, opcode, g.UseRegister(right),
-                       g.UseRegister(left), cont);
-      }
-    }
-  } else {
-    VisitCompare(selector, opcode, g.UseRegister(left), g.UseRegister(right),
-                 cont);
-  }
-}
-
-bool IsNodeUnsigned(Node* n) {
-  NodeMatcher m(n);
-
-  if (m.IsLoad()) {
-    LoadRepresentation load_rep = LoadRepresentationOf(n->op());
-    return load_rep.IsUnsigned();
-  } else if (m.IsUnalignedLoad()) {
-    UnalignedLoadRepresentation load_rep =
-        UnalignedLoadRepresentationOf(n->op());
-    return load_rep.IsUnsigned();
-  } else {
-    return m.IsUint32Div() || m.IsUint32LessThan() ||
-           m.IsUint32LessThanOrEqual() || m.IsUint32Mod() ||
-           m.IsUint32MulHigh() || m.IsChangeFloat64ToUint32() ||
-           m.IsTruncateFloat64ToUint32() || m.IsTruncateFloat32ToUint32();
-  }
-}
-
-// Shared routine for multiple word compare operations.
-void VisitFullWord32Compare(InstructionSelector* selector, Node* node,
-                            InstructionCode opcode, FlagsContinuation* cont) {
-  Mips64OperandGenerator g(selector);
-  InstructionOperand leftOp = g.TempRegister();
-  InstructionOperand rightOp = g.TempRegister();
-
-  selector->Emit(kMips64Dshl, leftOp, g.UseRegister(node->InputAt(0)),
-                 g.TempImmediate(32));
-  selector->Emit(kMips64Dshl, rightOp, g.UseRegister(node->InputAt(1)),
-                 g.TempImmediate(32));
-
-  VisitCompare(selector, opcode, leftOp, rightOp, cont);
-}
-
-void VisitOptimizedWord32Compare(InstructionSelector* selector, Node* node,
-                                 InstructionCode opcode,
-                                 FlagsContinuation* cont) {
-  if (FLAG_debug_code) {
-    Mips64OperandGenerator g(selector);
-    InstructionOperand leftOp = g.TempRegister();
-    InstructionOperand rightOp = g.TempRegister();
-    InstructionOperand optimizedResult = g.TempRegister();
-    InstructionOperand fullResult = g.TempRegister();
-    FlagsCondition condition = cont->condition();
-    InstructionCode testOpcode = opcode |
-                                 FlagsConditionField::encode(condition) |
-                                 FlagsModeField::encode(kFlags_set);
-
-    selector->Emit(testOpcode, optimizedResult, g.UseRegister(node->InputAt(0)),
-                   g.UseRegister(node->InputAt(1)));
-
-    selector->Emit(kMips64Dshl, leftOp, g.UseRegister(node->InputAt(0)),
-                   g.TempImmediate(32));
-    selector->Emit(kMips64Dshl, rightOp, g.UseRegister(node->InputAt(1)),
-                   g.TempImmediate(32));
-    selector->Emit(testOpcode, fullResult, leftOp, rightOp);
-
-    selector->Emit(
-        kMips64AssertEqual, g.NoOutput(), optimizedResult, fullResult,
-        g.TempImmediate(
-            static_cast<int>(AbortReason::kUnsupportedNonPrimitiveCompare)));
-  }
-
-  VisitWordCompare(selector, node, opcode, cont, false);
-}
-
-void VisitWord32Compare(InstructionSelector* selector, Node* node,
-                        FlagsContinuation* cont) {
-  // MIPS64 doesn't support Word32 compare instructions. Instead it relies
-  // that the values in registers are correctly sign-extended and uses
-  // Word64 comparison instead. This behavior is correct in most cases,
-  // but doesn't work when comparing signed with unsigned operands.
-  // We could simulate full Word32 compare in all cases but this would
-  // create an unnecessary overhead since unsigned integers are rarely
-  // used in JavaScript.
-  // The solution proposed here tries to match a comparison of signed
-  // with unsigned operand, and perform full Word32Compare only
-  // in those cases. Unfortunately, the solution is not complete because
-  // it might skip cases where Word32 full compare is needed, so
-  // basically it is a hack.
-  if (IsNodeUnsigned(node->InputAt(0)) != IsNodeUnsigned(node->InputAt(1))) {
-    VisitFullWord32Compare(selector, node, kMips64Cmp, cont);
-  } else {
-    VisitOptimizedWord32Compare(selector, node, kMips64Cmp, cont);
-  }
-}
-
-
-void VisitWord64Compare(InstructionSelector* selector, Node* node,
-                        FlagsContinuation* cont) {
-  VisitWordCompare(selector, node, kMips64Cmp, cont, false);
-}
-
-
-
-void EmitWordCompareZero(InstructionSelector* selector, Node* value,
-                         FlagsContinuation* cont) {
-  Mips64OperandGenerator g(selector);
-  InstructionCode opcode = cont->Encode(kMips64Cmp);
-  InstructionOperand const value_operand = g.UseRegister(value);
-  if (cont->IsBranch()) {
-    selector->Emit(opcode, g.NoOutput(), value_operand, g.TempImmediate(0),
-                   g.Label(cont->true_block()), g.Label(cont->false_block()));
-  } else if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(opcode, g.NoOutput(), value_operand,
-                             g.TempImmediate(0), cont->kind(), cont->reason(),
-                             cont->feedback(), cont->frame_state());
-  } else if (cont->IsTrap()) {
-    selector->Emit(opcode, g.NoOutput(), value_operand, g.TempImmediate(0),
-                   g.TempImmediate(cont->trap_id()));
-  } else {
-    selector->Emit(opcode, g.DefineAsRegister(cont->result()), value_operand,
-                   g.TempImmediate(0));
-  }
-}
-
-
-// Shared routine for word comparisons against zero.
-void VisitWordCompareZero(InstructionSelector* selector, Node* user,
-                          Node* value, FlagsContinuation* cont) {
-  // Try to combine with comparisons against 0 by simply inverting the branch.
-  while (selector->CanCover(user, value)) {
-    if (value->opcode() == IrOpcode::kWord32Equal) {
-      Int32BinopMatcher m(value);
-      if (!m.right().Is(0)) break;
-      user = value;
-      value = m.left().node();
-    } else if (value->opcode() == IrOpcode::kWord64Equal) {
-      Int64BinopMatcher m(value);
-      if (!m.right().Is(0)) break;
-      user = value;
-      value = m.left().node();
-    } else {
-      break;
-    }
-
-    cont->Negate();
-  }
-
-  if (selector->CanCover(user, value)) {
-    switch (value->opcode()) {
-      case IrOpcode::kWord32Equal:
-        cont->OverwriteAndNegateIfEqual(kEqual);
-        return VisitWord32Compare(selector, value, cont);
-      case IrOpcode::kInt32LessThan:
-        cont->OverwriteAndNegateIfEqual(kSignedLessThan);
-        return VisitWord32Compare(selector, value, cont);
-      case IrOpcode::kInt32LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kSignedLessThanOrEqual);
-        return VisitWord32Compare(selector, value, cont);
-      case IrOpcode::kUint32LessThan:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThan);
-        return VisitWord32Compare(selector, value, cont);
-      case IrOpcode::kUint32LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
-        return VisitWord32Compare(selector, value, cont);
-      case IrOpcode::kWord64Equal:
-        cont->OverwriteAndNegateIfEqual(kEqual);
-        return VisitWord64Compare(selector, value, cont);
-      case IrOpcode::kInt64LessThan:
-        cont->OverwriteAndNegateIfEqual(kSignedLessThan);
-        return VisitWord64Compare(selector, value, cont);
-      case IrOpcode::kInt64LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kSignedLessThanOrEqual);
-        return VisitWord64Compare(selector, value, cont);
-      case IrOpcode::kUint64LessThan:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThan);
-        return VisitWord64Compare(selector, value, cont);
-      case IrOpcode::kUint64LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
-        return VisitWord64Compare(selector, value, cont);
-      case IrOpcode::kFloat32Equal:
-        cont->OverwriteAndNegateIfEqual(kEqual);
-        return VisitFloat32Compare(selector, value, cont);
-      case IrOpcode::kFloat32LessThan:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThan);
-        return VisitFloat32Compare(selector, value, cont);
-      case IrOpcode::kFloat32LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
-        return VisitFloat32Compare(selector, value, cont);
-      case IrOpcode::kFloat64Equal:
-        cont->OverwriteAndNegateIfEqual(kEqual);
-        return VisitFloat64Compare(selector, value, cont);
-      case IrOpcode::kFloat64LessThan:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThan);
-        return VisitFloat64Compare(selector, value, cont);
-      case IrOpcode::kFloat64LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
-        return VisitFloat64Compare(selector, value, cont);
-      case IrOpcode::kProjection:
-        // Check if this is the overflow output projection of an
-        // <Operation>WithOverflow node.
-        if (ProjectionIndexOf(value->op()) == 1u) {
-          // We cannot combine the <Operation>WithOverflow with this branch
-          // unless the 0th projection (the use of the actual value of the
-          // <Operation> is either nullptr, which means there's no use of the
-          // actual value, or was already defined, which means it is scheduled
-          // *AFTER* this branch).
-          Node* const node = value->InputAt(0);
-          Node* const result = NodeProperties::FindProjection(node, 0);
-          if (result == nullptr || selector->IsDefined(result)) {
-            switch (node->opcode()) {
-              case IrOpcode::kInt32AddWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitBinop(selector, node, kMips64Dadd, cont);
-              case IrOpcode::kInt32SubWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitBinop(selector, node, kMips64Dsub, cont);
-              case IrOpcode::kInt32MulWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitBinop(selector, node, kMips64MulOvf, cont);
-              case IrOpcode::kInt64AddWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitBinop(selector, node, kMips64DaddOvf, cont);
-              case IrOpcode::kInt64SubWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitBinop(selector, node, kMips64DsubOvf, cont);
-              default:
-                break;
-            }
-          }
-        }
-        break;
-      case IrOpcode::kWord32And:
-      case IrOpcode::kWord64And:
-        return VisitWordCompare(selector, value, kMips64Tst, cont, true);
-      default:
-        break;
-    }
-  }
-
-  // Continuation could not be combined with a compare, emit compare against 0.
-  EmitWordCompareZero(selector, value, cont);
-}
-
-}  // namespace
-
-void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch,
-                                      BasicBlock* fbranch) {
-  FlagsContinuation cont(kNotEqual, tbranch, fbranch);
-  VisitWordCompareZero(this, branch, branch->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitDeoptimizeIf(Node* node) {
-  DeoptimizeParameters p = DeoptimizeParametersOf(node->op());
-  FlagsContinuation cont = FlagsContinuation::ForDeoptimize(
-      kNotEqual, p.kind(), p.reason(), p.feedback(), node->InputAt(1));
-  VisitWordCompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitDeoptimizeUnless(Node* node) {
-  DeoptimizeParameters p = DeoptimizeParametersOf(node->op());
-  FlagsContinuation cont = FlagsContinuation::ForDeoptimize(
-      kEqual, p.kind(), p.reason(), p.feedback(), node->InputAt(1));
-  VisitWordCompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitTrapIf(Node* node, Runtime::FunctionId func_id) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForTrap(kNotEqual, func_id, node->InputAt(1));
-  VisitWordCompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitTrapUnless(Node* node,
-                                          Runtime::FunctionId func_id) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForTrap(kEqual, func_id, node->InputAt(1));
-  VisitWordCompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitSwitch(Node* node, const SwitchInfo& sw) {
-  Mips64OperandGenerator g(this);
-  InstructionOperand value_operand = g.UseRegister(node->InputAt(0));
-
-  // Emit either ArchTableSwitch or ArchLookupSwitch.
-  static const size_t kMaxTableSwitchValueRange = 2 << 16;
-  size_t table_space_cost = 10 + 2 * sw.value_range;
-  size_t table_time_cost = 3;
-  size_t lookup_space_cost = 2 + 2 * sw.case_count;
-  size_t lookup_time_cost = sw.case_count;
-  if (sw.case_count > 0 &&
-      table_space_cost + 3 * table_time_cost <=
-          lookup_space_cost + 3 * lookup_time_cost &&
-      sw.min_value > std::numeric_limits<int32_t>::min() &&
-      sw.value_range <= kMaxTableSwitchValueRange) {
-    InstructionOperand index_operand = value_operand;
-    if (sw.min_value) {
-      index_operand = g.TempRegister();
-      Emit(kMips64Sub, index_operand, value_operand,
-           g.TempImmediate(sw.min_value));
-    }
-    // Generate a table lookup.
-    return EmitTableSwitch(sw, index_operand);
-  }
-
-  // Generate a sequence of conditional jumps.
-  return EmitLookupSwitch(sw, value_operand);
-}
-
-
-void InstructionSelector::VisitWord32Equal(Node* const node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
-  Int32BinopMatcher m(node);
-  if (m.right().Is(0)) {
-    return VisitWordCompareZero(this, m.node(), m.left().node(), &cont);
-  }
-
-  VisitWord32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitInt32LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kSignedLessThan, node);
-  VisitWord32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitInt32LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kSignedLessThanOrEqual, node);
-  VisitWord32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitUint32LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kUnsignedLessThan, node);
-  VisitWord32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitUint32LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedLessThanOrEqual, node);
-  VisitWord32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitInt32AddWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    return VisitBinop(this, node, kMips64Dadd, &cont);
-  }
-  FlagsContinuation cont;
-  VisitBinop(this, node, kMips64Dadd, &cont);
-}
-
-
-void InstructionSelector::VisitInt32SubWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    return VisitBinop(this, node, kMips64Dsub, &cont);
-  }
-  FlagsContinuation cont;
-  VisitBinop(this, node, kMips64Dsub, &cont);
-}
-
-void InstructionSelector::VisitInt32MulWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    return VisitBinop(this, node, kMips64MulOvf, &cont);
-  }
-  FlagsContinuation cont;
-  VisitBinop(this, node, kMips64MulOvf, &cont);
-}
-
-void InstructionSelector::VisitInt64AddWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    return VisitBinop(this, node, kMips64DaddOvf, &cont);
-  }
-  FlagsContinuation cont;
-  VisitBinop(this, node, kMips64DaddOvf, &cont);
-}
-
-
-void InstructionSelector::VisitInt64SubWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    return VisitBinop(this, node, kMips64DsubOvf, &cont);
-  }
-  FlagsContinuation cont;
-  VisitBinop(this, node, kMips64DsubOvf, &cont);
-}
-
-
-void InstructionSelector::VisitWord64Equal(Node* const node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
-  Int64BinopMatcher m(node);
-  if (m.right().Is(0)) {
-    return VisitWordCompareZero(this, m.node(), m.left().node(), &cont);
-  }
-
-  VisitWord64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitInt64LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kSignedLessThan, node);
-  VisitWord64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitInt64LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kSignedLessThanOrEqual, node);
-  VisitWord64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitUint64LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kUnsignedLessThan, node);
-  VisitWord64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitUint64LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedLessThanOrEqual, node);
-  VisitWord64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat32Equal(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
-  VisitFloat32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat32LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kUnsignedLessThan, node);
-  VisitFloat32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat32LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedLessThanOrEqual, node);
-  VisitFloat32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat64Equal(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
-  VisitFloat64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat64LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kUnsignedLessThan, node);
-  VisitFloat64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedLessThanOrEqual, node);
-  VisitFloat64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat64ExtractLowWord32(Node* node) {
-  VisitRR(this, kMips64Float64ExtractLowWord32, node);
-}
-
-
-void InstructionSelector::VisitFloat64ExtractHighWord32(Node* node) {
-  VisitRR(this, kMips64Float64ExtractHighWord32, node);
-}
-
-void InstructionSelector::VisitFloat64SilenceNaN(Node* node) {
-  VisitRR(this, kMips64Float64SilenceNaN, node);
-}
-
-void InstructionSelector::VisitFloat64InsertLowWord32(Node* node) {
-  Mips64OperandGenerator g(this);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-  Emit(kMips64Float64InsertLowWord32, g.DefineSameAsFirst(node),
-       g.UseRegister(left), g.UseRegister(right));
-}
-
-
-void InstructionSelector::VisitFloat64InsertHighWord32(Node* node) {
-  Mips64OperandGenerator g(this);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-  Emit(kMips64Float64InsertHighWord32, g.DefineSameAsFirst(node),
-       g.UseRegister(left), g.UseRegister(right));
-}
-
-void InstructionSelector::VisitAtomicLoad(Node* node) {
-  LoadRepresentation load_rep = LoadRepresentationOf(node->op());
-  Mips64OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  ArchOpcode opcode = kArchNop;
-  switch (load_rep.representation()) {
-    case MachineRepresentation::kWord8:
-      opcode = load_rep.IsSigned() ? kAtomicLoadInt8 : kAtomicLoadUint8;
-      break;
-    case MachineRepresentation::kWord16:
-      opcode = load_rep.IsSigned() ? kAtomicLoadInt16 : kAtomicLoadUint16;
-      break;
-    case MachineRepresentation::kWord32:
-      opcode = kAtomicLoadWord32;
-      break;
-    default:
-      UNREACHABLE();
-      return;
-  }
-  if (g.CanBeImmediate(index, opcode)) {
-    Emit(opcode | AddressingModeField::encode(kMode_MRI),
-         g.DefineAsRegister(node), g.UseRegister(base), g.UseImmediate(index));
-  } else {
-    InstructionOperand addr_reg = g.TempRegister();
-    Emit(kMips64Dadd | AddressingModeField::encode(kMode_None), addr_reg,
-         g.UseRegister(index), g.UseRegister(base));
-    // Emit desired load opcode, using temp addr_reg.
-    Emit(opcode | AddressingModeField::encode(kMode_MRI),
-         g.DefineAsRegister(node), addr_reg, g.TempImmediate(0));
-  }
-}
-
-void InstructionSelector::VisitAtomicStore(Node* node) {
-  MachineRepresentation rep = AtomicStoreRepresentationOf(node->op());
-  Mips64OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-  ArchOpcode opcode = kArchNop;
-  switch (rep) {
-    case MachineRepresentation::kWord8:
-      opcode = kAtomicStoreWord8;
-      break;
-    case MachineRepresentation::kWord16:
-      opcode = kAtomicStoreWord16;
-      break;
-    case MachineRepresentation::kWord32:
-      opcode = kAtomicStoreWord32;
-      break;
-    default:
-      UNREACHABLE();
-      return;
-  }
-
-  if (g.CanBeImmediate(index, opcode)) {
-    Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(),
-         g.UseRegister(base), g.UseImmediate(index),
-         g.UseRegisterOrImmediateZero(value));
-  } else {
-    InstructionOperand addr_reg = g.TempRegister();
-    Emit(kMips64Dadd | AddressingModeField::encode(kMode_None), addr_reg,
-         g.UseRegister(index), g.UseRegister(base));
-    // Emit desired store opcode, using temp addr_reg.
-    Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(),
-         addr_reg, g.TempImmediate(0), g.UseRegisterOrImmediateZero(value));
-  }
-}
-
-void InstructionSelector::VisitAtomicExchange(Node* node) {
-  Mips64OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-  ArchOpcode opcode = kArchNop;
-  MachineType type = AtomicOpRepresentationOf(node->op());
-  if (type == MachineType::Int8()) {
-    opcode = kAtomicExchangeInt8;
-  } else if (type == MachineType::Uint8()) {
-    opcode = kAtomicExchangeUint8;
-  } else if (type == MachineType::Int16()) {
-    opcode = kAtomicExchangeInt16;
-  } else if (type == MachineType::Uint16()) {
-    opcode = kAtomicExchangeUint16;
-  } else if (type == MachineType::Int32() || type == MachineType::Uint32()) {
-    opcode = kAtomicExchangeWord32;
-  } else {
-    UNREACHABLE();
-    return;
-  }
-
-  AddressingMode addressing_mode = kMode_MRI;
-  InstructionOperand inputs[3];
-  size_t input_count = 0;
-  inputs[input_count++] = g.UseUniqueRegister(base);
-  inputs[input_count++] = g.UseUniqueRegister(index);
-  inputs[input_count++] = g.UseUniqueRegister(value);
-  InstructionOperand outputs[1];
-  outputs[0] = g.UseUniqueRegister(node);
-  InstructionOperand temp[3];
-  temp[0] = g.TempRegister();
-  temp[1] = g.TempRegister();
-  temp[2] = g.TempRegister();
-  InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
-  Emit(code, 1, outputs, input_count, inputs, 3, temp);
-}
-
-void InstructionSelector::VisitAtomicCompareExchange(Node* node) {
-  Mips64OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* old_value = node->InputAt(2);
-  Node* new_value = node->InputAt(3);
-  ArchOpcode opcode = kArchNop;
-  MachineType type = AtomicOpRepresentationOf(node->op());
-  if (type == MachineType::Int8()) {
-    opcode = kAtomicCompareExchangeInt8;
-  } else if (type == MachineType::Uint8()) {
-    opcode = kAtomicCompareExchangeUint8;
-  } else if (type == MachineType::Int16()) {
-    opcode = kAtomicCompareExchangeInt16;
-  } else if (type == MachineType::Uint16()) {
-    opcode = kAtomicCompareExchangeUint16;
-  } else if (type == MachineType::Int32() || type == MachineType::Uint32()) {
-    opcode = kAtomicCompareExchangeWord32;
-  } else {
-    UNREACHABLE();
-    return;
-  }
-
-  AddressingMode addressing_mode = kMode_MRI;
-  InstructionOperand inputs[4];
-  size_t input_count = 0;
-  inputs[input_count++] = g.UseUniqueRegister(base);
-  inputs[input_count++] = g.UseUniqueRegister(index);
-  inputs[input_count++] = g.UseUniqueRegister(old_value);
-  inputs[input_count++] = g.UseUniqueRegister(new_value);
-  InstructionOperand outputs[1];
-  outputs[0] = g.UseUniqueRegister(node);
-  InstructionOperand temp[3];
-  temp[0] = g.TempRegister();
-  temp[1] = g.TempRegister();
-  temp[2] = g.TempRegister();
-  InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
-  Emit(code, 1, outputs, input_count, inputs, 3, temp);
-}
-
-void InstructionSelector::VisitAtomicBinaryOperation(
-    Node* node, ArchOpcode int8_op, ArchOpcode uint8_op, ArchOpcode int16_op,
-    ArchOpcode uint16_op, ArchOpcode word32_op) {
-  Mips64OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-  ArchOpcode opcode = kArchNop;
-  MachineType type = AtomicOpRepresentationOf(node->op());
-  if (type == MachineType::Int8()) {
-    opcode = int8_op;
-  } else if (type == MachineType::Uint8()) {
-    opcode = uint8_op;
-  } else if (type == MachineType::Int16()) {
-    opcode = int16_op;
-  } else if (type == MachineType::Uint16()) {
-    opcode = uint16_op;
-  } else if (type == MachineType::Int32() || type == MachineType::Uint32()) {
-    opcode = word32_op;
-  } else {
-    UNREACHABLE();
-    return;
-  }
-
-  AddressingMode addressing_mode = kMode_MRI;
-  InstructionOperand inputs[3];
-  size_t input_count = 0;
-  inputs[input_count++] = g.UseUniqueRegister(base);
-  inputs[input_count++] = g.UseUniqueRegister(index);
-  inputs[input_count++] = g.UseUniqueRegister(value);
-  InstructionOperand outputs[1];
-  outputs[0] = g.UseUniqueRegister(node);
-  InstructionOperand temps[4];
-  temps[0] = g.TempRegister();
-  temps[1] = g.TempRegister();
-  temps[2] = g.TempRegister();
-  temps[3] = g.TempRegister();
-  InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
-  Emit(code, 1, outputs, input_count, inputs, 4, temps);
-}
-
-#define VISIT_ATOMIC_BINOP(op)                                              \
-  void InstructionSelector::VisitAtomic##op(Node* node) {                   \
-    VisitAtomicBinaryOperation(node, kAtomic##op##Int8, kAtomic##op##Uint8, \
-                               kAtomic##op##Int16, kAtomic##op##Uint16,     \
-                               kAtomic##op##Word32);                        \
-  }
-VISIT_ATOMIC_BINOP(Add)
-VISIT_ATOMIC_BINOP(Sub)
-VISIT_ATOMIC_BINOP(And)
-VISIT_ATOMIC_BINOP(Or)
-VISIT_ATOMIC_BINOP(Xor)
-#undef VISIT_ATOMIC_BINOP
-
-void InstructionSelector::VisitInt32AbsWithOverflow(Node* node) {
-  UNREACHABLE();
-}
-
-void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) {
-  UNREACHABLE();
-}
-
-void InstructionSelector::VisitSpeculationFence(Node* node) { UNREACHABLE(); }
-
-#define SIMD_TYPE_LIST(V) \
-  V(F32x4)                \
-  V(I32x4)                \
-  V(I16x8)                \
-  V(I8x16)
-
-// TODO(mostynb@opera.com): this is never used, remove it?
-#define SIMD_FORMAT_LIST(V) \
-  V(32x4)                   \
-  V(16x8)                   \
-  V(8x16)
-
-#define SIMD_UNOP_LIST(V)                                  \
-  V(F32x4SConvertI32x4, kMips64F32x4SConvertI32x4)         \
-  V(F32x4UConvertI32x4, kMips64F32x4UConvertI32x4)         \
-  V(F32x4Abs, kMips64F32x4Abs)                             \
-  V(F32x4Neg, kMips64F32x4Neg)                             \
-  V(F32x4RecipApprox, kMips64F32x4RecipApprox)             \
-  V(F32x4RecipSqrtApprox, kMips64F32x4RecipSqrtApprox)     \
-  V(I32x4SConvertF32x4, kMips64I32x4SConvertF32x4)         \
-  V(I32x4UConvertF32x4, kMips64I32x4UConvertF32x4)         \
-  V(I32x4Neg, kMips64I32x4Neg)                             \
-  V(I32x4SConvertI16x8Low, kMips64I32x4SConvertI16x8Low)   \
-  V(I32x4SConvertI16x8High, kMips64I32x4SConvertI16x8High) \
-  V(I32x4UConvertI16x8Low, kMips64I32x4UConvertI16x8Low)   \
-  V(I32x4UConvertI16x8High, kMips64I32x4UConvertI16x8High) \
-  V(I16x8Neg, kMips64I16x8Neg)                             \
-  V(I16x8SConvertI8x16Low, kMips64I16x8SConvertI8x16Low)   \
-  V(I16x8SConvertI8x16High, kMips64I16x8SConvertI8x16High) \
-  V(I16x8UConvertI8x16Low, kMips64I16x8UConvertI8x16Low)   \
-  V(I16x8UConvertI8x16High, kMips64I16x8UConvertI8x16High) \
-  V(I8x16Neg, kMips64I8x16Neg)                             \
-  V(S128Not, kMips64S128Not)                               \
-  V(S1x4AnyTrue, kMips64S1x4AnyTrue)                       \
-  V(S1x4AllTrue, kMips64S1x4AllTrue)                       \
-  V(S1x8AnyTrue, kMips64S1x8AnyTrue)                       \
-  V(S1x8AllTrue, kMips64S1x8AllTrue)                       \
-  V(S1x16AnyTrue, kMips64S1x16AnyTrue)                     \
-  V(S1x16AllTrue, kMips64S1x16AllTrue)
-
-#define SIMD_SHIFT_OP_LIST(V) \
-  V(I32x4Shl)                 \
-  V(I32x4ShrS)                \
-  V(I32x4ShrU)                \
-  V(I16x8Shl)                 \
-  V(I16x8ShrS)                \
-  V(I16x8ShrU)                \
-  V(I8x16Shl)                 \
-  V(I8x16ShrS)                \
-  V(I8x16ShrU)
-
-#define SIMD_BINOP_LIST(V)                         \
-  V(F32x4Add, kMips64F32x4Add)                     \
-  V(F32x4AddHoriz, kMips64F32x4AddHoriz)           \
-  V(F32x4Sub, kMips64F32x4Sub)                     \
-  V(F32x4Mul, kMips64F32x4Mul)                     \
-  V(F32x4Max, kMips64F32x4Max)                     \
-  V(F32x4Min, kMips64F32x4Min)                     \
-  V(F32x4Eq, kMips64F32x4Eq)                       \
-  V(F32x4Ne, kMips64F32x4Ne)                       \
-  V(F32x4Lt, kMips64F32x4Lt)                       \
-  V(F32x4Le, kMips64F32x4Le)                       \
-  V(I32x4Add, kMips64I32x4Add)                     \
-  V(I32x4AddHoriz, kMips64I32x4AddHoriz)           \
-  V(I32x4Sub, kMips64I32x4Sub)                     \
-  V(I32x4Mul, kMips64I32x4Mul)                     \
-  V(I32x4MaxS, kMips64I32x4MaxS)                   \
-  V(I32x4MinS, kMips64I32x4MinS)                   \
-  V(I32x4MaxU, kMips64I32x4MaxU)                   \
-  V(I32x4MinU, kMips64I32x4MinU)                   \
-  V(I32x4Eq, kMips64I32x4Eq)                       \
-  V(I32x4Ne, kMips64I32x4Ne)                       \
-  V(I32x4GtS, kMips64I32x4GtS)                     \
-  V(I32x4GeS, kMips64I32x4GeS)                     \
-  V(I32x4GtU, kMips64I32x4GtU)                     \
-  V(I32x4GeU, kMips64I32x4GeU)                     \
-  V(I16x8Add, kMips64I16x8Add)                     \
-  V(I16x8AddSaturateS, kMips64I16x8AddSaturateS)   \
-  V(I16x8AddSaturateU, kMips64I16x8AddSaturateU)   \
-  V(I16x8AddHoriz, kMips64I16x8AddHoriz)           \
-  V(I16x8Sub, kMips64I16x8Sub)                     \
-  V(I16x8SubSaturateS, kMips64I16x8SubSaturateS)   \
-  V(I16x8SubSaturateU, kMips64I16x8SubSaturateU)   \
-  V(I16x8Mul, kMips64I16x8Mul)                     \
-  V(I16x8MaxS, kMips64I16x8MaxS)                   \
-  V(I16x8MinS, kMips64I16x8MinS)                   \
-  V(I16x8MaxU, kMips64I16x8MaxU)                   \
-  V(I16x8MinU, kMips64I16x8MinU)                   \
-  V(I16x8Eq, kMips64I16x8Eq)                       \
-  V(I16x8Ne, kMips64I16x8Ne)                       \
-  V(I16x8GtS, kMips64I16x8GtS)                     \
-  V(I16x8GeS, kMips64I16x8GeS)                     \
-  V(I16x8GtU, kMips64I16x8GtU)                     \
-  V(I16x8GeU, kMips64I16x8GeU)                     \
-  V(I16x8SConvertI32x4, kMips64I16x8SConvertI32x4) \
-  V(I16x8UConvertI32x4, kMips64I16x8UConvertI32x4) \
-  V(I8x16Add, kMips64I8x16Add)                     \
-  V(I8x16AddSaturateS, kMips64I8x16AddSaturateS)   \
-  V(I8x16AddSaturateU, kMips64I8x16AddSaturateU)   \
-  V(I8x16Sub, kMips64I8x16Sub)                     \
-  V(I8x16SubSaturateS, kMips64I8x16SubSaturateS)   \
-  V(I8x16SubSaturateU, kMips64I8x16SubSaturateU)   \
-  V(I8x16Mul, kMips64I8x16Mul)                     \
-  V(I8x16MaxS, kMips64I8x16MaxS)                   \
-  V(I8x16MinS, kMips64I8x16MinS)                   \
-  V(I8x16MaxU, kMips64I8x16MaxU)                   \
-  V(I8x16MinU, kMips64I8x16MinU)                   \
-  V(I8x16Eq, kMips64I8x16Eq)                       \
-  V(I8x16Ne, kMips64I8x16Ne)                       \
-  V(I8x16GtS, kMips64I8x16GtS)                     \
-  V(I8x16GeS, kMips64I8x16GeS)                     \
-  V(I8x16GtU, kMips64I8x16GtU)                     \
-  V(I8x16GeU, kMips64I8x16GeU)                     \
-  V(I8x16SConvertI16x8, kMips64I8x16SConvertI16x8) \
-  V(I8x16UConvertI16x8, kMips64I8x16UConvertI16x8) \
-  V(S128And, kMips64S128And)                       \
-  V(S128Or, kMips64S128Or)                         \
-  V(S128Xor, kMips64S128Xor)
-
-void InstructionSelector::VisitS128Zero(Node* node) {
-  Mips64OperandGenerator g(this);
-  Emit(kMips64S128Zero, g.DefineSameAsFirst(node));
-}
-
-#define SIMD_VISIT_SPLAT(Type)                               \
-  void InstructionSelector::Visit##Type##Splat(Node* node) { \
-    VisitRR(this, kMips64##Type##Splat, node);               \
-  }
-SIMD_TYPE_LIST(SIMD_VISIT_SPLAT)
-#undef SIMD_VISIT_SPLAT
-
-#define SIMD_VISIT_EXTRACT_LANE(Type)                              \
-  void InstructionSelector::Visit##Type##ExtractLane(Node* node) { \
-    VisitRRI(this, kMips64##Type##ExtractLane, node);              \
-  }
-SIMD_TYPE_LIST(SIMD_VISIT_EXTRACT_LANE)
-#undef SIMD_VISIT_EXTRACT_LANE
-
-#define SIMD_VISIT_REPLACE_LANE(Type)                              \
-  void InstructionSelector::Visit##Type##ReplaceLane(Node* node) { \
-    VisitRRIR(this, kMips64##Type##ReplaceLane, node);             \
-  }
-SIMD_TYPE_LIST(SIMD_VISIT_REPLACE_LANE)
-#undef SIMD_VISIT_REPLACE_LANE
-
-#define SIMD_VISIT_UNOP(Name, instruction)            \
-  void InstructionSelector::Visit##Name(Node* node) { \
-    VisitRR(this, instruction, node);                 \
-  }
-SIMD_UNOP_LIST(SIMD_VISIT_UNOP)
-#undef SIMD_VISIT_UNOP
-
-#define SIMD_VISIT_SHIFT_OP(Name)                     \
-  void InstructionSelector::Visit##Name(Node* node) { \
-    VisitRRI(this, kMips64##Name, node);              \
-  }
-SIMD_SHIFT_OP_LIST(SIMD_VISIT_SHIFT_OP)
-#undef SIMD_VISIT_SHIFT_OP
-
-#define SIMD_VISIT_BINOP(Name, instruction)           \
-  void InstructionSelector::Visit##Name(Node* node) { \
-    VisitRRR(this, instruction, node);                \
-  }
-SIMD_BINOP_LIST(SIMD_VISIT_BINOP)
-#undef SIMD_VISIT_BINOP
-
-void InstructionSelector::VisitS128Select(Node* node) {
-  VisitRRRR(this, kMips64S128Select, node);
-}
-
-namespace {
-
-struct ShuffleEntry {
-  uint8_t shuffle[kSimd128Size];
-  ArchOpcode opcode;
-};
-
-static const ShuffleEntry arch_shuffles[] = {
-    {{0, 1, 2, 3, 16, 17, 18, 19, 4, 5, 6, 7, 20, 21, 22, 23},
-     kMips64S32x4InterleaveRight},
-    {{8, 9, 10, 11, 24, 25, 26, 27, 12, 13, 14, 15, 28, 29, 30, 31},
-     kMips64S32x4InterleaveLeft},
-    {{0, 1, 2, 3, 8, 9, 10, 11, 16, 17, 18, 19, 24, 25, 26, 27},
-     kMips64S32x4PackEven},
-    {{4, 5, 6, 7, 12, 13, 14, 15, 20, 21, 22, 23, 28, 29, 30, 31},
-     kMips64S32x4PackOdd},
-    {{0, 1, 2, 3, 16, 17, 18, 19, 8, 9, 10, 11, 24, 25, 26, 27},
-     kMips64S32x4InterleaveEven},
-    {{4, 5, 6, 7, 20, 21, 22, 23, 12, 13, 14, 15, 28, 29, 30, 31},
-     kMips64S32x4InterleaveOdd},
-
-    {{0, 1, 16, 17, 2, 3, 18, 19, 4, 5, 20, 21, 6, 7, 22, 23},
-     kMips64S16x8InterleaveRight},
-    {{8, 9, 24, 25, 10, 11, 26, 27, 12, 13, 28, 29, 14, 15, 30, 31},
-     kMips64S16x8InterleaveLeft},
-    {{0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29},
-     kMips64S16x8PackEven},
-    {{2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31},
-     kMips64S16x8PackOdd},
-    {{0, 1, 16, 17, 4, 5, 20, 21, 8, 9, 24, 25, 12, 13, 28, 29},
-     kMips64S16x8InterleaveEven},
-    {{2, 3, 18, 19, 6, 7, 22, 23, 10, 11, 26, 27, 14, 15, 30, 31},
-     kMips64S16x8InterleaveOdd},
-    {{6, 7, 4, 5, 2, 3, 0, 1, 14, 15, 12, 13, 10, 11, 8, 9},
-     kMips64S16x4Reverse},
-    {{2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 8, 9, 14, 15, 12, 13},
-     kMips64S16x2Reverse},
-
-    {{0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7, 23},
-     kMips64S8x16InterleaveRight},
-    {{8, 24, 9, 25, 10, 26, 11, 27, 12, 28, 13, 29, 14, 30, 15, 31},
-     kMips64S8x16InterleaveLeft},
-    {{0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30},
-     kMips64S8x16PackEven},
-    {{1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31},
-     kMips64S8x16PackOdd},
-    {{0, 16, 2, 18, 4, 20, 6, 22, 8, 24, 10, 26, 12, 28, 14, 30},
-     kMips64S8x16InterleaveEven},
-    {{1, 17, 3, 19, 5, 21, 7, 23, 9, 25, 11, 27, 13, 29, 15, 31},
-     kMips64S8x16InterleaveOdd},
-    {{7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8},
-     kMips64S8x8Reverse},
-    {{3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12},
-     kMips64S8x4Reverse},
-    {{1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14},
-     kMips64S8x2Reverse}};
-
-bool TryMatchArchShuffle(const uint8_t* shuffle, const ShuffleEntry* table,
-                         size_t num_entries, uint8_t mask, ArchOpcode* opcode) {
-  for (size_t i = 0; i < num_entries; ++i) {
-    const ShuffleEntry& entry = table[i];
-    int j = 0;
-    for (; j < kSimd128Size; ++j) {
-      if ((entry.shuffle[j] & mask) != (shuffle[j] & mask)) {
-        break;
-      }
-    }
-    if (j == kSimd128Size) {
-      *opcode = entry.opcode;
-      return true;
-    }
-  }
-  return false;
-}
-
-}  // namespace
-
-void InstructionSelector::VisitS8x16Shuffle(Node* node) {
-  const uint8_t* shuffle = OpParameter<uint8_t*>(node);
-  uint8_t mask = CanonicalizeShuffle(node);
-  uint8_t shuffle32x4[4];
-  ArchOpcode opcode;
-  if (TryMatchArchShuffle(shuffle, arch_shuffles, arraysize(arch_shuffles),
-                          mask, &opcode)) {
-    VisitRRR(this, opcode, node);
-    return;
-  }
-  uint8_t offset;
-  Mips64OperandGenerator g(this);
-  if (TryMatchConcat(shuffle, mask, &offset)) {
-    Emit(kMips64S8x16Concat, g.DefineSameAsFirst(node),
-         g.UseRegister(node->InputAt(1)), g.UseRegister(node->InputAt(0)),
-         g.UseImmediate(offset));
-    return;
-  }
-  if (TryMatch32x4Shuffle(shuffle, shuffle32x4)) {
-    Emit(kMips64S32x4Shuffle, g.DefineAsRegister(node),
-         g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)),
-         g.UseImmediate(Pack4Lanes(shuffle32x4, mask)));
-    return;
-  }
-  Emit(kMips64S8x16Shuffle, g.DefineAsRegister(node),
-       g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)),
-       g.UseImmediate(Pack4Lanes(shuffle, mask)),
-       g.UseImmediate(Pack4Lanes(shuffle + 4, mask)),
-       g.UseImmediate(Pack4Lanes(shuffle + 8, mask)),
-       g.UseImmediate(Pack4Lanes(shuffle + 12, mask)));
-}
-
-// static
-MachineOperatorBuilder::Flags
-InstructionSelector::SupportedMachineOperatorFlags() {
-  MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags;
-  return flags | MachineOperatorBuilder::kWord32Ctz |
-         MachineOperatorBuilder::kWord64Ctz |
-         MachineOperatorBuilder::kWord32Popcnt |
-         MachineOperatorBuilder::kWord64Popcnt |
-         MachineOperatorBuilder::kWord32ShiftIsSafe |
-         MachineOperatorBuilder::kInt32DivIsSafe |
-         MachineOperatorBuilder::kUint32DivIsSafe |
-         MachineOperatorBuilder::kFloat64RoundDown |
-         MachineOperatorBuilder::kFloat32RoundDown |
-         MachineOperatorBuilder::kFloat64RoundUp |
-         MachineOperatorBuilder::kFloat32RoundUp |
-         MachineOperatorBuilder::kFloat64RoundTruncate |
-         MachineOperatorBuilder::kFloat32RoundTruncate |
-         MachineOperatorBuilder::kFloat64RoundTiesEven |
-         MachineOperatorBuilder::kFloat32RoundTiesEven |
-         MachineOperatorBuilder::kWord32ReverseBytes |
-         MachineOperatorBuilder::kWord64ReverseBytes;
-}
-
-// static
-MachineOperatorBuilder::AlignmentRequirements
-InstructionSelector::AlignmentRequirements() {
-  if (kArchVariant == kMips64r6) {
-    return MachineOperatorBuilder::AlignmentRequirements::
-        FullUnalignedAccessSupport();
-  } else {
-    DCHECK_EQ(kMips64r2, kArchVariant);
-    return MachineOperatorBuilder::AlignmentRequirements::
-        NoUnalignedAccessSupport();
-  }
-}
-
-#undef SIMD_BINOP_LIST
-#undef SIMD_SHIFT_OP_LIST
-#undef SIMD_UNOP_LIST
-#undef SIMD_FORMAT_LIST
-#undef SIMD_TYPE_LIST
-#undef TRACE_UNIMPL
-#undef TRACE
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/move-optimizer.cc b/src/v8/src/compiler/move-optimizer.cc
deleted file mode 100644
index 82f4b63..0000000
--- a/src/v8/src/compiler/move-optimizer.cc
+++ /dev/null
@@ -1,562 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/compiler/move-optimizer.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-namespace {
-
-struct MoveKey {
-  InstructionOperand source;
-  InstructionOperand destination;
-};
-
-struct MoveKeyCompare {
-  bool operator()(const MoveKey& a, const MoveKey& b) const {
-    if (a.source.EqualsCanonicalized(b.source)) {
-      return a.destination.CompareCanonicalized(b.destination);
-    }
-    return a.source.CompareCanonicalized(b.source);
-  }
-};
-
-typedef ZoneMap<MoveKey, unsigned, MoveKeyCompare> MoveMap;
-
-class OperandSet {
- public:
-  explicit OperandSet(ZoneVector<InstructionOperand>* buffer)
-      : set_(buffer), fp_reps_(0) {
-    buffer->clear();
-  }
-
-  void InsertOp(const InstructionOperand& op) {
-    set_->push_back(op);
-
-    if (!kSimpleFPAliasing && op.IsFPRegister())
-      fp_reps_ |= RepBit(LocationOperand::cast(op).representation());
-  }
-
-  bool Contains(const InstructionOperand& op) const {
-    for (const InstructionOperand& elem : *set_) {
-      if (elem.EqualsCanonicalized(op)) return true;
-    }
-    return false;
-  }
-
-  bool ContainsOpOrAlias(const InstructionOperand& op) const {
-    if (Contains(op)) return true;
-
-    if (!kSimpleFPAliasing && op.IsFPRegister()) {
-      // Platforms where FP registers have complex aliasing need extra checks.
-      const LocationOperand& loc = LocationOperand::cast(op);
-      MachineRepresentation rep = loc.representation();
-      // If haven't encountered mixed rep FP registers, skip the extra checks.
-      if (!HasMixedFPReps(fp_reps_ | RepBit(rep))) return false;
-
-      // Check register against aliasing registers of other FP representations.
-      MachineRepresentation other_rep1, other_rep2;
-      switch (rep) {
-        case MachineRepresentation::kFloat32:
-          other_rep1 = MachineRepresentation::kFloat64;
-          other_rep2 = MachineRepresentation::kSimd128;
-          break;
-        case MachineRepresentation::kFloat64:
-          other_rep1 = MachineRepresentation::kFloat32;
-          other_rep2 = MachineRepresentation::kSimd128;
-          break;
-        case MachineRepresentation::kSimd128:
-          other_rep1 = MachineRepresentation::kFloat32;
-          other_rep2 = MachineRepresentation::kFloat64;
-          break;
-        default:
-          UNREACHABLE();
-          break;
-      }
-      const RegisterConfiguration* config = RegisterConfiguration::Default();
-      int base = -1;
-      int aliases =
-          config->GetAliases(rep, loc.register_code(), other_rep1, &base);
-      DCHECK(aliases > 0 || (aliases == 0 && base == -1));
-      while (aliases--) {
-        if (Contains(AllocatedOperand(LocationOperand::REGISTER, other_rep1,
-                                      base + aliases))) {
-          return true;
-        }
-      }
-      aliases = config->GetAliases(rep, loc.register_code(), other_rep2, &base);
-      DCHECK(aliases > 0 || (aliases == 0 && base == -1));
-      while (aliases--) {
-        if (Contains(AllocatedOperand(LocationOperand::REGISTER, other_rep2,
-                                      base + aliases))) {
-          return true;
-        }
-      }
-    }
-    return false;
-  }
-
- private:
-  static int RepBit(MachineRepresentation rep) {
-    return 1 << static_cast<int>(rep);
-  }
-
-  static bool HasMixedFPReps(int reps) {
-    return reps && !base::bits::IsPowerOfTwo(reps);
-  }
-
-  ZoneVector<InstructionOperand>* set_;
-  int fp_reps_;
-};
-
-int FindFirstNonEmptySlot(const Instruction* instr) {
-  int i = Instruction::FIRST_GAP_POSITION;
-  for (; i <= Instruction::LAST_GAP_POSITION; i++) {
-    ParallelMove* moves = instr->parallel_moves()[i];
-    if (moves == nullptr) continue;
-    for (MoveOperands* move : *moves) {
-      if (!move->IsRedundant()) return i;
-      move->Eliminate();
-    }
-    moves->clear();  // Clear this redundant move.
-  }
-  return i;
-}
-
-}  // namespace
-
-MoveOptimizer::MoveOptimizer(Zone* local_zone, InstructionSequence* code)
-    : local_zone_(local_zone),
-      code_(code),
-      local_vector_(local_zone),
-      operand_buffer1(local_zone),
-      operand_buffer2(local_zone) {}
-
-void MoveOptimizer::Run() {
-  for (Instruction* instruction : code()->instructions()) {
-    CompressGaps(instruction);
-  }
-  for (InstructionBlock* block : code()->instruction_blocks()) {
-    CompressBlock(block);
-  }
-  for (InstructionBlock* block : code()->instruction_blocks()) {
-    if (block->PredecessorCount() <= 1) continue;
-    if (!block->IsDeferred()) {
-      bool has_only_deferred = true;
-      for (RpoNumber& pred_id : block->predecessors()) {
-        if (!code()->InstructionBlockAt(pred_id)->IsDeferred()) {
-          has_only_deferred = false;
-          break;
-        }
-      }
-      // This would pull down common moves. If the moves occur in deferred
-      // blocks, and the closest common successor is not deferred, we lose the
-      // optimization of just spilling/filling in deferred blocks, when the
-      // current block is not deferred.
-      if (has_only_deferred) continue;
-    }
-    OptimizeMerge(block);
-  }
-  for (Instruction* gap : code()->instructions()) {
-    FinalizeMoves(gap);
-  }
-}
-
-void MoveOptimizer::RemoveClobberedDestinations(Instruction* instruction) {
-  if (instruction->IsCall()) return;
-  ParallelMove* moves = instruction->parallel_moves()[0];
-  if (moves == nullptr) return;
-
-  DCHECK(instruction->parallel_moves()[1] == nullptr ||
-         instruction->parallel_moves()[1]->empty());
-
-  OperandSet outputs(&operand_buffer1);
-  OperandSet inputs(&operand_buffer2);
-
-  // Outputs and temps are treated together as potentially clobbering a
-  // destination operand.
-  for (size_t i = 0; i < instruction->OutputCount(); ++i) {
-    outputs.InsertOp(*instruction->OutputAt(i));
-  }
-  for (size_t i = 0; i < instruction->TempCount(); ++i) {
-    outputs.InsertOp(*instruction->TempAt(i));
-  }
-
-  // Input operands block elisions.
-  for (size_t i = 0; i < instruction->InputCount(); ++i) {
-    inputs.InsertOp(*instruction->InputAt(i));
-  }
-
-  // Elide moves made redundant by the instruction.
-  for (MoveOperands* move : *moves) {
-    if (outputs.ContainsOpOrAlias(move->destination()) &&
-        !inputs.ContainsOpOrAlias(move->destination())) {
-      move->Eliminate();
-    }
-  }
-
-  // The ret instruction makes any assignment before it unnecessary, except for
-  // the one for its input.
-  if (instruction->IsRet() || instruction->IsTailCall()) {
-    for (MoveOperands* move : *moves) {
-      if (!inputs.ContainsOpOrAlias(move->destination())) {
-        move->Eliminate();
-      }
-    }
-  }
-}
-
-void MoveOptimizer::MigrateMoves(Instruction* to, Instruction* from) {
-  if (from->IsCall()) return;
-
-  ParallelMove* from_moves = from->parallel_moves()[0];
-  if (from_moves == nullptr || from_moves->empty()) return;
-
-  OperandSet dst_cant_be(&operand_buffer1);
-  OperandSet src_cant_be(&operand_buffer2);
-
-  // If an operand is an input to the instruction, we cannot move assignments
-  // where it appears on the LHS.
-  for (size_t i = 0; i < from->InputCount(); ++i) {
-    dst_cant_be.InsertOp(*from->InputAt(i));
-  }
-  // If an operand is output to the instruction, we cannot move assignments
-  // where it appears on the RHS, because we would lose its value before the
-  // instruction.
-  // Same for temp operands.
-  // The output can't appear on the LHS because we performed
-  // RemoveClobberedDestinations for the "from" instruction.
-  for (size_t i = 0; i < from->OutputCount(); ++i) {
-    src_cant_be.InsertOp(*from->OutputAt(i));
-  }
-  for (size_t i = 0; i < from->TempCount(); ++i) {
-    src_cant_be.InsertOp(*from->TempAt(i));
-  }
-  for (MoveOperands* move : *from_moves) {
-    if (move->IsRedundant()) continue;
-    // Assume dest has a value "V". If we have a "dest = y" move, then we can't
-    // move "z = dest", because z would become y rather than "V".
-    // We assume CompressMoves has happened before this, which means we don't
-    // have more than one assignment to dest.
-    src_cant_be.InsertOp(move->destination());
-  }
-
-  ZoneSet<MoveKey, MoveKeyCompare> move_candidates(local_zone());
-  // We start with all the moves that don't have conflicting source or
-  // destination operands are eligible for being moved down.
-  for (MoveOperands* move : *from_moves) {
-    if (move->IsRedundant()) continue;
-    if (!dst_cant_be.ContainsOpOrAlias(move->destination())) {
-      MoveKey key = {move->source(), move->destination()};
-      move_candidates.insert(key);
-    }
-  }
-  if (move_candidates.empty()) return;
-
-  // Stabilize the candidate set.
-  bool changed = false;
-  do {
-    changed = false;
-    for (auto iter = move_candidates.begin(); iter != move_candidates.end();) {
-      auto current = iter;
-      ++iter;
-      InstructionOperand src = current->source;
-      if (src_cant_be.ContainsOpOrAlias(src)) {
-        src_cant_be.InsertOp(current->destination);
-        move_candidates.erase(current);
-        changed = true;
-      }
-    }
-  } while (changed);
-
-  ParallelMove to_move(local_zone());
-  for (MoveOperands* move : *from_moves) {
-    if (move->IsRedundant()) continue;
-    MoveKey key = {move->source(), move->destination()};
-    if (move_candidates.find(key) != move_candidates.end()) {
-      to_move.AddMove(move->source(), move->destination(), code_zone());
-      move->Eliminate();
-    }
-  }
-  if (to_move.empty()) return;
-
-  ParallelMove* dest =
-      to->GetOrCreateParallelMove(Instruction::GapPosition::START, code_zone());
-
-  CompressMoves(&to_move, dest);
-  DCHECK(dest->empty());
-  for (MoveOperands* m : to_move) {
-    dest->push_back(m);
-  }
-}
-
-void MoveOptimizer::CompressMoves(ParallelMove* left, MoveOpVector* right) {
-  if (right == nullptr) return;
-
-  MoveOpVector& eliminated = local_vector();
-  DCHECK(eliminated.empty());
-
-  if (!left->empty()) {
-    // Modify the right moves in place and collect moves that will be killed by
-    // merging the two gaps.
-    for (MoveOperands* move : *right) {
-      if (move->IsRedundant()) continue;
-      left->PrepareInsertAfter(move, &eliminated);
-    }
-    // Eliminate dead moves.
-    for (MoveOperands* to_eliminate : eliminated) {
-      to_eliminate->Eliminate();
-    }
-    eliminated.clear();
-  }
-  // Add all possibly modified moves from right side.
-  for (MoveOperands* move : *right) {
-    if (move->IsRedundant()) continue;
-    left->push_back(move);
-  }
-  // Nuke right.
-  right->clear();
-  DCHECK(eliminated.empty());
-}
-
-void MoveOptimizer::CompressGaps(Instruction* instruction) {
-  int i = FindFirstNonEmptySlot(instruction);
-  bool has_moves = i <= Instruction::LAST_GAP_POSITION;
-  USE(has_moves);
-
-  if (i == Instruction::LAST_GAP_POSITION) {
-    std::swap(instruction->parallel_moves()[Instruction::FIRST_GAP_POSITION],
-              instruction->parallel_moves()[Instruction::LAST_GAP_POSITION]);
-  } else if (i == Instruction::FIRST_GAP_POSITION) {
-    CompressMoves(
-        instruction->parallel_moves()[Instruction::FIRST_GAP_POSITION],
-        instruction->parallel_moves()[Instruction::LAST_GAP_POSITION]);
-  }
-  // We either have no moves, or, after swapping or compressing, we have
-  // all the moves in the first gap position, and none in the second/end gap
-  // position.
-  ParallelMove* first =
-      instruction->parallel_moves()[Instruction::FIRST_GAP_POSITION];
-  ParallelMove* last =
-      instruction->parallel_moves()[Instruction::LAST_GAP_POSITION];
-  USE(first);
-  USE(last);
-
-  DCHECK(!has_moves ||
-         (first != nullptr && (last == nullptr || last->empty())));
-}
-
-void MoveOptimizer::CompressBlock(InstructionBlock* block) {
-  int first_instr_index = block->first_instruction_index();
-  int last_instr_index = block->last_instruction_index();
-
-  // Start by removing gap assignments where the output of the subsequent
-  // instruction appears on LHS, as long as they are not needed by its input.
-  Instruction* prev_instr = code()->instructions()[first_instr_index];
-  RemoveClobberedDestinations(prev_instr);
-
-  for (int index = first_instr_index + 1; index <= last_instr_index; ++index) {
-    Instruction* instr = code()->instructions()[index];
-    // Migrate to the gap of prev_instr eligible moves from instr.
-    MigrateMoves(instr, prev_instr);
-    // Remove gap assignments clobbered by instr's output.
-    RemoveClobberedDestinations(instr);
-    prev_instr = instr;
-  }
-}
-
-
-const Instruction* MoveOptimizer::LastInstruction(
-    const InstructionBlock* block) const {
-  return code()->instructions()[block->last_instruction_index()];
-}
-
-
-void MoveOptimizer::OptimizeMerge(InstructionBlock* block) {
-  DCHECK_LT(1, block->PredecessorCount());
-  // Ensure that the last instruction in all incoming blocks don't contain
-  // things that would prevent moving gap moves across them.
-  for (RpoNumber& pred_index : block->predecessors()) {
-    const InstructionBlock* pred = code()->InstructionBlockAt(pred_index);
-
-    // If the predecessor has more than one successor, we shouldn't attempt to
-    // move down to this block (one of the successors) any of the gap moves,
-    // because their effect may be necessary to the other successors.
-    if (pred->SuccessorCount() > 1) return;
-
-    const Instruction* last_instr =
-        code()->instructions()[pred->last_instruction_index()];
-    if (last_instr->IsCall()) return;
-    if (last_instr->TempCount() != 0) return;
-    if (last_instr->OutputCount() != 0) return;
-    for (size_t i = 0; i < last_instr->InputCount(); ++i) {
-      const InstructionOperand* op = last_instr->InputAt(i);
-      if (!op->IsConstant() && !op->IsImmediate()) return;
-    }
-  }
-  // TODO(dcarney): pass a ZoneStats down for this?
-  MoveMap move_map(local_zone());
-  size_t correct_counts = 0;
-  // Accumulate set of shared moves.
-  for (RpoNumber& pred_index : block->predecessors()) {
-    const InstructionBlock* pred = code()->InstructionBlockAt(pred_index);
-    const Instruction* instr = LastInstruction(pred);
-    if (instr->parallel_moves()[0] == nullptr ||
-        instr->parallel_moves()[0]->empty()) {
-      return;
-    }
-    for (const MoveOperands* move : *instr->parallel_moves()[0]) {
-      if (move->IsRedundant()) continue;
-      InstructionOperand src = move->source();
-      InstructionOperand dst = move->destination();
-      MoveKey key = {src, dst};
-      auto res = move_map.insert(std::make_pair(key, 1));
-      if (!res.second) {
-        res.first->second++;
-        if (res.first->second == block->PredecessorCount()) {
-          correct_counts++;
-        }
-      }
-    }
-  }
-  if (move_map.empty() || correct_counts == 0) return;
-
-  // Find insertion point.
-  Instruction* instr = code()->instructions()[block->first_instruction_index()];
-
-  if (correct_counts != move_map.size()) {
-    // Moves that are unique to each predecessor won't be pushed to the common
-    // successor.
-    OperandSet conflicting_srcs(&operand_buffer1);
-    for (auto iter = move_map.begin(), end = move_map.end(); iter != end;) {
-      auto current = iter;
-      ++iter;
-      if (current->second != block->PredecessorCount()) {
-        InstructionOperand dest = current->first.destination;
-        // Not all the moves in all the gaps are the same. Maybe some are. If
-        // there are such moves, we could move them, but the destination of the
-        // moves staying behind can't appear as a source of a common move,
-        // because the move staying behind will clobber this destination.
-        conflicting_srcs.InsertOp(dest);
-        move_map.erase(current);
-      }
-    }
-
-    bool changed = false;
-    do {
-      // If a common move can't be pushed to the common successor, then its
-      // destination also can't appear as source to any move being pushed.
-      changed = false;
-      for (auto iter = move_map.begin(), end = move_map.end(); iter != end;) {
-        auto current = iter;
-        ++iter;
-        DCHECK_EQ(block->PredecessorCount(), current->second);
-        if (conflicting_srcs.ContainsOpOrAlias(current->first.source)) {
-          conflicting_srcs.InsertOp(current->first.destination);
-          move_map.erase(current);
-          changed = true;
-        }
-      }
-    } while (changed);
-  }
-
-  if (move_map.empty()) return;
-
-  DCHECK_NOT_NULL(instr);
-  bool gap_initialized = true;
-  if (instr->parallel_moves()[0] != nullptr &&
-      !instr->parallel_moves()[0]->empty()) {
-    // Will compress after insertion.
-    gap_initialized = false;
-    std::swap(instr->parallel_moves()[0], instr->parallel_moves()[1]);
-  }
-  ParallelMove* moves = instr->GetOrCreateParallelMove(
-      static_cast<Instruction::GapPosition>(0), code_zone());
-  // Delete relevant entries in predecessors and move everything to block.
-  bool first_iteration = true;
-  for (RpoNumber& pred_index : block->predecessors()) {
-    const InstructionBlock* pred = code()->InstructionBlockAt(pred_index);
-    for (MoveOperands* move : *LastInstruction(pred)->parallel_moves()[0]) {
-      if (move->IsRedundant()) continue;
-      MoveKey key = {move->source(), move->destination()};
-      auto it = move_map.find(key);
-      if (it != move_map.end()) {
-        if (first_iteration) {
-          moves->AddMove(move->source(), move->destination());
-        }
-        move->Eliminate();
-      }
-    }
-    first_iteration = false;
-  }
-  // Compress.
-  if (!gap_initialized) {
-    CompressMoves(instr->parallel_moves()[0], instr->parallel_moves()[1]);
-  }
-  CompressBlock(block);
-}
-
-
-namespace {
-
-bool IsSlot(const InstructionOperand& op) {
-  return op.IsStackSlot() || op.IsFPStackSlot();
-}
-
-
-bool LoadCompare(const MoveOperands* a, const MoveOperands* b) {
-  if (!a->source().EqualsCanonicalized(b->source())) {
-    return a->source().CompareCanonicalized(b->source());
-  }
-  if (IsSlot(a->destination()) && !IsSlot(b->destination())) return false;
-  if (!IsSlot(a->destination()) && IsSlot(b->destination())) return true;
-  return a->destination().CompareCanonicalized(b->destination());
-}
-
-}  // namespace
-
-
-// Split multiple loads of the same constant or stack slot off into the second
-// slot and keep remaining moves in the first slot.
-void MoveOptimizer::FinalizeMoves(Instruction* instr) {
-  MoveOpVector& loads = local_vector();
-  DCHECK(loads.empty());
-
-  ParallelMove* parallel_moves = instr->parallel_moves()[0];
-  if (parallel_moves == nullptr) return;
-  // Find all the loads.
-  for (MoveOperands* move : *parallel_moves) {
-    if (move->IsRedundant()) continue;
-    if (move->source().IsConstant() || IsSlot(move->source())) {
-      loads.push_back(move);
-    }
-  }
-  if (loads.empty()) return;
-  // Group the loads by source, moving the preferred destination to the
-  // beginning of the group.
-  std::sort(loads.begin(), loads.end(), LoadCompare);
-  MoveOperands* group_begin = nullptr;
-  for (MoveOperands* load : loads) {
-    // New group.
-    if (group_begin == nullptr ||
-        !load->source().EqualsCanonicalized(group_begin->source())) {
-      group_begin = load;
-      continue;
-    }
-    // Nothing to be gained from splitting here.
-    if (IsSlot(group_begin->destination())) continue;
-    // Insert new move into slot 1.
-    ParallelMove* slot_1 = instr->GetOrCreateParallelMove(
-        static_cast<Instruction::GapPosition>(1), code_zone());
-    slot_1->AddMove(group_begin->destination(), load->destination());
-    load->Eliminate();
-  }
-  loads.clear();
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/move-optimizer.h b/src/v8/src/compiler/move-optimizer.h
deleted file mode 100644
index 7c132ab..0000000
--- a/src/v8/src/compiler/move-optimizer.h
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_MOVE_OPTIMIZER_
-#define V8_COMPILER_MOVE_OPTIMIZER_
-
-#include "src/compiler/instruction.h"
-#include "src/globals.h"
-#include "src/zone/zone-containers.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-class V8_EXPORT_PRIVATE MoveOptimizer final {
- public:
-  MoveOptimizer(Zone* local_zone, InstructionSequence* code);
-  void Run();
-
- private:
-  typedef ZoneVector<MoveOperands*> MoveOpVector;
-  typedef ZoneVector<Instruction*> Instructions;
-
-  InstructionSequence* code() const { return code_; }
-  Zone* local_zone() const { return local_zone_; }
-  Zone* code_zone() const { return code()->zone(); }
-  MoveOpVector& local_vector() { return local_vector_; }
-
-  // Consolidate moves into the first gap.
-  void CompressGaps(Instruction* instr);
-
-  // Attempt to push down to the last instruction those moves that can.
-  void CompressBlock(InstructionBlock* block);
-
-  // Consolidate moves into the first gap.
-  void CompressMoves(ParallelMove* left, MoveOpVector* right);
-
-  // Push down those moves in the gap of from that do not change the
-  // semantics of the from instruction, nor the semantics of the moves
-  // that remain behind.
-  void MigrateMoves(Instruction* to, Instruction* from);
-
-  void RemoveClobberedDestinations(Instruction* instruction);
-
-  const Instruction* LastInstruction(const InstructionBlock* block) const;
-
-  // Consolidate common moves appearing across all predecessors of a block.
-  void OptimizeMerge(InstructionBlock* block);
-  void FinalizeMoves(Instruction* instr);
-
-  Zone* const local_zone_;
-  InstructionSequence* const code_;
-  MoveOpVector local_vector_;
-
-  // Reusable buffers for storing operand sets. We need at most two sets
-  // at any given time, so we create two buffers.
-  ZoneVector<InstructionOperand> operand_buffer1;
-  ZoneVector<InstructionOperand> operand_buffer2;
-
-  DISALLOW_COPY_AND_ASSIGN(MoveOptimizer);
-};
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_COMPILER_MOVE_OPTIMIZER_
diff --git a/src/v8/src/compiler/ppc/code-generator-ppc.cc b/src/v8/src/compiler/ppc/code-generator-ppc.cc
deleted file mode 100644
index 7fc5377..0000000
--- a/src/v8/src/compiler/ppc/code-generator-ppc.cc
+++ /dev/null
@@ -1,2472 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/compiler/code-generator.h"
-
-#include "src/assembler-inl.h"
-#include "src/callable.h"
-#include "src/compilation-info.h"
-#include "src/compiler/code-generator-impl.h"
-#include "src/compiler/gap-resolver.h"
-#include "src/compiler/node-matchers.h"
-#include "src/compiler/osr.h"
-#include "src/double.h"
-#include "src/ppc/macro-assembler-ppc.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-#define __ tasm()->
-
-#define kScratchReg r11
-
-
-// Adds PPC-specific methods to convert InstructionOperands.
-class PPCOperandConverter final : public InstructionOperandConverter {
- public:
-  PPCOperandConverter(CodeGenerator* gen, Instruction* instr)
-      : InstructionOperandConverter(gen, instr) {}
-
-  size_t OutputCount() { return instr_->OutputCount(); }
-
-  RCBit OutputRCBit() const {
-    switch (instr_->flags_mode()) {
-      case kFlags_branch:
-      case kFlags_deoptimize:
-      case kFlags_set:
-      case kFlags_trap:
-        return SetRC;
-      case kFlags_none:
-        return LeaveRC;
-    }
-    UNREACHABLE();
-  }
-
-  bool CompareLogical() const {
-    switch (instr_->flags_condition()) {
-      case kUnsignedLessThan:
-      case kUnsignedGreaterThanOrEqual:
-      case kUnsignedLessThanOrEqual:
-      case kUnsignedGreaterThan:
-        return true;
-      default:
-        return false;
-    }
-    UNREACHABLE();
-  }
-
-  Operand InputImmediate(size_t index) {
-    Constant constant = ToConstant(instr_->InputAt(index));
-    switch (constant.type()) {
-      case Constant::kInt32:
-        return Operand(constant.ToInt32());
-      case Constant::kFloat32:
-        return Operand::EmbeddedNumber(constant.ToFloat32());
-      case Constant::kFloat64:
-        return Operand::EmbeddedNumber(constant.ToFloat64().value());
-      case Constant::kInt64:
-#if V8_TARGET_ARCH_PPC64
-        return Operand(constant.ToInt64());
-#endif
-      case Constant::kExternalReference:
-      case Constant::kHeapObject:
-      case Constant::kRpoNumber:
-        break;
-    }
-    UNREACHABLE();
-  }
-
-  MemOperand MemoryOperand(AddressingMode* mode, size_t* first_index) {
-    const size_t index = *first_index;
-    *mode = AddressingModeField::decode(instr_->opcode());
-    switch (*mode) {
-      case kMode_None:
-        break;
-      case kMode_MRI:
-        *first_index += 2;
-        return MemOperand(InputRegister(index + 0), InputInt32(index + 1));
-      case kMode_MRR:
-        *first_index += 2;
-        return MemOperand(InputRegister(index + 0), InputRegister(index + 1));
-    }
-    UNREACHABLE();
-  }
-
-  MemOperand MemoryOperand(AddressingMode* mode, size_t first_index = 0) {
-    return MemoryOperand(mode, &first_index);
-  }
-
-  MemOperand ToMemOperand(InstructionOperand* op) const {
-    DCHECK_NOT_NULL(op);
-    DCHECK(op->IsStackSlot() || op->IsFPStackSlot());
-    return SlotToMemOperand(AllocatedOperand::cast(op)->index());
-  }
-
-  MemOperand SlotToMemOperand(int slot) const {
-    FrameOffset offset = frame_access_state()->GetFrameOffset(slot);
-    return MemOperand(offset.from_stack_pointer() ? sp : fp, offset.offset());
-  }
-};
-
-
-static inline bool HasRegisterInput(Instruction* instr, size_t index) {
-  return instr->InputAt(index)->IsRegister();
-}
-
-
-namespace {
-
-class OutOfLineRecordWrite final : public OutOfLineCode {
- public:
-  OutOfLineRecordWrite(CodeGenerator* gen, Register object, Register offset,
-                       Register value, Register scratch0, Register scratch1,
-                       RecordWriteMode mode)
-      : OutOfLineCode(gen),
-        object_(object),
-        offset_(offset),
-        offset_immediate_(0),
-        value_(value),
-        scratch0_(scratch0),
-        scratch1_(scratch1),
-        mode_(mode),
-        must_save_lr_(!gen->frame_access_state()->has_frame()),
-        zone_(gen->zone()) {}
-
-  OutOfLineRecordWrite(CodeGenerator* gen, Register object, int32_t offset,
-                       Register value, Register scratch0, Register scratch1,
-                       RecordWriteMode mode)
-      : OutOfLineCode(gen),
-        object_(object),
-        offset_(no_reg),
-        offset_immediate_(offset),
-        value_(value),
-        scratch0_(scratch0),
-        scratch1_(scratch1),
-        mode_(mode),
-        must_save_lr_(!gen->frame_access_state()->has_frame()),
-        zone_(gen->zone()) {}
-
-  void SaveRegisters(RegList registers) {
-    DCHECK_LT(0, NumRegs(registers));
-    RegList regs = 0;
-    for (int i = 0; i < Register::kNumRegisters; ++i) {
-      if ((registers >> i) & 1u) {
-        regs |= Register::from_code(i).bit();
-      }
-    }
-
-    __ MultiPush(regs);
-  }
-
-  void RestoreRegisters(RegList registers) {
-    DCHECK_LT(0, NumRegs(registers));
-    RegList regs = 0;
-    for (int i = 0; i < Register::kNumRegisters; ++i) {
-      if ((registers >> i) & 1u) {
-        regs |= Register::from_code(i).bit();
-      }
-    }
-    __ MultiPop(regs);
-  }
-
-  void Generate() final {
-    ConstantPoolUnavailableScope constant_pool_unavailable(tasm());
-    if (mode_ > RecordWriteMode::kValueIsPointer) {
-      __ JumpIfSmi(value_, exit());
-    }
-    __ CheckPageFlag(value_, scratch0_,
-                     MemoryChunk::kPointersToHereAreInterestingMask, eq,
-                     exit());
-    if (offset_ == no_reg) {
-      __ addi(scratch1_, object_, Operand(offset_immediate_));
-    } else {
-      DCHECK_EQ(0, offset_immediate_);
-      __ add(scratch1_, object_, offset_);
-    }
-    RememberedSetAction const remembered_set_action =
-        mode_ > RecordWriteMode::kValueIsMap ? EMIT_REMEMBERED_SET
-                                             : OMIT_REMEMBERED_SET;
-    SaveFPRegsMode const save_fp_mode =
-        frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
-    if (must_save_lr_) {
-      // We need to save and restore lr if the frame was elided.
-      __ mflr(scratch0_);
-      __ Push(scratch0_);
-    }
-    __ CallRecordWriteStub(object_, scratch1_, remembered_set_action,
-                           save_fp_mode);
-    if (must_save_lr_) {
-      // We need to save and restore lr if the frame was elided.
-      __ Pop(scratch0_);
-      __ mtlr(scratch0_);
-    }
-  }
-
- private:
-  Register const object_;
-  Register const offset_;
-  int32_t const offset_immediate_;  // Valid if offset_ == no_reg.
-  Register const value_;
-  Register const scratch0_;
-  Register const scratch1_;
-  RecordWriteMode const mode_;
-  bool must_save_lr_;
-  Zone* zone_;
-};
-
-
-Condition FlagsConditionToCondition(FlagsCondition condition, ArchOpcode op) {
-  switch (condition) {
-    case kEqual:
-      return eq;
-    case kNotEqual:
-      return ne;
-    case kSignedLessThan:
-    case kUnsignedLessThan:
-      return lt;
-    case kSignedGreaterThanOrEqual:
-    case kUnsignedGreaterThanOrEqual:
-      return ge;
-    case kSignedLessThanOrEqual:
-    case kUnsignedLessThanOrEqual:
-      return le;
-    case kSignedGreaterThan:
-    case kUnsignedGreaterThan:
-      return gt;
-    case kOverflow:
-      // Overflow checked for add/sub only.
-      switch (op) {
-#if V8_TARGET_ARCH_PPC64
-        case kPPC_Add32:
-        case kPPC_Add64:
-        case kPPC_Sub:
-#endif
-        case kPPC_AddWithOverflow32:
-        case kPPC_SubWithOverflow32:
-          return lt;
-        default:
-          break;
-      }
-      break;
-    case kNotOverflow:
-      switch (op) {
-#if V8_TARGET_ARCH_PPC64
-        case kPPC_Add32:
-        case kPPC_Add64:
-        case kPPC_Sub:
-#endif
-        case kPPC_AddWithOverflow32:
-        case kPPC_SubWithOverflow32:
-          return ge;
-        default:
-          break;
-      }
-      break;
-    default:
-      break;
-  }
-  UNREACHABLE();
-}
-
-}  // namespace
-
-#define ASSEMBLE_FLOAT_UNOP_RC(asm_instr, round)                     \
-  do {                                                               \
-    __ asm_instr(i.OutputDoubleRegister(), i.InputDoubleRegister(0), \
-                 i.OutputRCBit());                                   \
-    if (round) {                                                     \
-      __ frsp(i.OutputDoubleRegister(), i.OutputDoubleRegister());   \
-    }                                                                \
-  } while (0)
-
-#define ASSEMBLE_FLOAT_BINOP_RC(asm_instr, round)                    \
-  do {                                                               \
-    __ asm_instr(i.OutputDoubleRegister(), i.InputDoubleRegister(0), \
-                 i.InputDoubleRegister(1), i.OutputRCBit());         \
-    if (round) {                                                     \
-      __ frsp(i.OutputDoubleRegister(), i.OutputDoubleRegister());   \
-    }                                                                \
-  } while (0)
-
-#define ASSEMBLE_BINOP(asm_instr_reg, asm_instr_imm)           \
-  do {                                                         \
-    if (HasRegisterInput(instr, 1)) {                          \
-      __ asm_instr_reg(i.OutputRegister(), i.InputRegister(0), \
-                       i.InputRegister(1));                    \
-    } else {                                                   \
-      __ asm_instr_imm(i.OutputRegister(), i.InputRegister(0), \
-                       i.InputImmediate(1));                   \
-    }                                                          \
-  } while (0)
-
-
-#define ASSEMBLE_BINOP_RC(asm_instr_reg, asm_instr_imm)        \
-  do {                                                         \
-    if (HasRegisterInput(instr, 1)) {                          \
-      __ asm_instr_reg(i.OutputRegister(), i.InputRegister(0), \
-                       i.InputRegister(1), i.OutputRCBit());   \
-    } else {                                                   \
-      __ asm_instr_imm(i.OutputRegister(), i.InputRegister(0), \
-                       i.InputImmediate(1), i.OutputRCBit());  \
-    }                                                          \
-  } while (0)
-
-
-#define ASSEMBLE_BINOP_INT_RC(asm_instr_reg, asm_instr_imm)    \
-  do {                                                         \
-    if (HasRegisterInput(instr, 1)) {                          \
-      __ asm_instr_reg(i.OutputRegister(), i.InputRegister(0), \
-                       i.InputRegister(1), i.OutputRCBit());   \
-    } else {                                                   \
-      __ asm_instr_imm(i.OutputRegister(), i.InputRegister(0), \
-                       i.InputInt32(1), i.OutputRCBit());      \
-    }                                                          \
-  } while (0)
-
-
-#define ASSEMBLE_ADD_WITH_OVERFLOW()                                    \
-  do {                                                                  \
-    if (HasRegisterInput(instr, 1)) {                                   \
-      __ AddAndCheckForOverflow(i.OutputRegister(), i.InputRegister(0), \
-                                i.InputRegister(1), kScratchReg, r0);   \
-    } else {                                                            \
-      __ AddAndCheckForOverflow(i.OutputRegister(), i.InputRegister(0), \
-                                i.InputInt32(1), kScratchReg, r0);      \
-    }                                                                   \
-  } while (0)
-
-
-#define ASSEMBLE_SUB_WITH_OVERFLOW()                                    \
-  do {                                                                  \
-    if (HasRegisterInput(instr, 1)) {                                   \
-      __ SubAndCheckForOverflow(i.OutputRegister(), i.InputRegister(0), \
-                                i.InputRegister(1), kScratchReg, r0);   \
-    } else {                                                            \
-      __ AddAndCheckForOverflow(i.OutputRegister(), i.InputRegister(0), \
-                                -i.InputInt32(1), kScratchReg, r0);     \
-    }                                                                   \
-  } while (0)
-
-
-#if V8_TARGET_ARCH_PPC64
-#define ASSEMBLE_ADD_WITH_OVERFLOW32()         \
-  do {                                         \
-    ASSEMBLE_ADD_WITH_OVERFLOW();              \
-    __ extsw(kScratchReg, kScratchReg, SetRC); \
-  } while (0)
-
-#define ASSEMBLE_SUB_WITH_OVERFLOW32()         \
-  do {                                         \
-    ASSEMBLE_SUB_WITH_OVERFLOW();              \
-    __ extsw(kScratchReg, kScratchReg, SetRC); \
-  } while (0)
-#else
-#define ASSEMBLE_ADD_WITH_OVERFLOW32 ASSEMBLE_ADD_WITH_OVERFLOW
-#define ASSEMBLE_SUB_WITH_OVERFLOW32 ASSEMBLE_SUB_WITH_OVERFLOW
-#endif
-
-
-#define ASSEMBLE_COMPARE(cmp_instr, cmpl_instr)                        \
-  do {                                                                 \
-    const CRegister cr = cr0;                                          \
-    if (HasRegisterInput(instr, 1)) {                                  \
-      if (i.CompareLogical()) {                                        \
-        __ cmpl_instr(i.InputRegister(0), i.InputRegister(1), cr);     \
-      } else {                                                         \
-        __ cmp_instr(i.InputRegister(0), i.InputRegister(1), cr);      \
-      }                                                                \
-    } else {                                                           \
-      if (i.CompareLogical()) {                                        \
-        __ cmpl_instr##i(i.InputRegister(0), i.InputImmediate(1), cr); \
-      } else {                                                         \
-        __ cmp_instr##i(i.InputRegister(0), i.InputImmediate(1), cr);  \
-      }                                                                \
-    }                                                                  \
-    DCHECK_EQ(SetRC, i.OutputRCBit());                                 \
-  } while (0)
-
-
-#define ASSEMBLE_FLOAT_COMPARE(cmp_instr)                                 \
-  do {                                                                    \
-    const CRegister cr = cr0;                                             \
-    __ cmp_instr(i.InputDoubleRegister(0), i.InputDoubleRegister(1), cr); \
-    DCHECK_EQ(SetRC, i.OutputRCBit());                                    \
-  } while (0)
-
-
-#define ASSEMBLE_MODULO(div_instr, mul_instr)                        \
-  do {                                                               \
-    const Register scratch = kScratchReg;                            \
-    __ div_instr(scratch, i.InputRegister(0), i.InputRegister(1));   \
-    __ mul_instr(scratch, scratch, i.InputRegister(1));              \
-    __ sub(i.OutputRegister(), i.InputRegister(0), scratch, LeaveOE, \
-           i.OutputRCBit());                                         \
-  } while (0)
-
-#define ASSEMBLE_FLOAT_MODULO()                                            \
-  do {                                                                     \
-    FrameScope scope(tasm(), StackFrame::MANUAL);                          \
-    __ PrepareCallCFunction(0, 2, kScratchReg);                            \
-    __ MovToFloatParameters(i.InputDoubleRegister(0),                      \
-                            i.InputDoubleRegister(1));                     \
-    __ CallCFunction(                                                      \
-        ExternalReference::mod_two_doubles_operation(__ isolate()), 0, 2); \
-    __ MovFromFloatResult(i.OutputDoubleRegister());                       \
-    DCHECK_EQ(LeaveRC, i.OutputRCBit());                                   \
-  } while (0)
-
-#define ASSEMBLE_IEEE754_UNOP(name)                                            \
-  do {                                                                         \
-    /* TODO(bmeurer): We should really get rid of this special instruction, */ \
-    /* and generate a CallAddress instruction instead. */                      \
-    FrameScope scope(tasm(), StackFrame::MANUAL);                              \
-    __ PrepareCallCFunction(0, 1, kScratchReg);                                \
-    __ MovToFloatParameter(i.InputDoubleRegister(0));                          \
-    __ CallCFunction(                                                          \
-        ExternalReference::ieee754_##name##_function(__ isolate()), 0, 1);     \
-    /* Move the result in the double result register. */                       \
-    __ MovFromFloatResult(i.OutputDoubleRegister());                           \
-    DCHECK_EQ(LeaveRC, i.OutputRCBit());                                       \
-  } while (0)
-
-#define ASSEMBLE_IEEE754_BINOP(name)                                           \
-  do {                                                                         \
-    /* TODO(bmeurer): We should really get rid of this special instruction, */ \
-    /* and generate a CallAddress instruction instead. */                      \
-    FrameScope scope(tasm(), StackFrame::MANUAL);                              \
-    __ PrepareCallCFunction(0, 2, kScratchReg);                                \
-    __ MovToFloatParameters(i.InputDoubleRegister(0),                          \
-                            i.InputDoubleRegister(1));                         \
-    __ CallCFunction(                                                          \
-        ExternalReference::ieee754_##name##_function(__ isolate()), 0, 2);     \
-    /* Move the result in the double result register. */                       \
-    __ MovFromFloatResult(i.OutputDoubleRegister());                           \
-    DCHECK_EQ(LeaveRC, i.OutputRCBit());                                       \
-  } while (0)
-
-#define ASSEMBLE_FLOAT_MAX()                                           \
-  do {                                                                 \
-    DoubleRegister left_reg = i.InputDoubleRegister(0);                \
-    DoubleRegister right_reg = i.InputDoubleRegister(1);               \
-    DoubleRegister result_reg = i.OutputDoubleRegister();              \
-    Label check_nan_left, check_zero, return_left, return_right, done; \
-    __ fcmpu(left_reg, right_reg);                                     \
-    __ bunordered(&check_nan_left);                                    \
-    __ beq(&check_zero);                                               \
-    __ bge(&return_left);                                              \
-    __ b(&return_right);                                               \
-                                                                       \
-    __ bind(&check_zero);                                              \
-    __ fcmpu(left_reg, kDoubleRegZero);                                \
-    /* left == right != 0. */                                          \
-    __ bne(&return_left);                                              \
-    /* At this point, both left and right are either 0 or -0. */       \
-    __ fadd(result_reg, left_reg, right_reg);                          \
-    __ b(&done);                                                       \
-                                                                       \
-    __ bind(&check_nan_left);                                          \
-    __ fcmpu(left_reg, left_reg);                                      \
-    /* left == NaN. */                                                 \
-    __ bunordered(&return_left);                                       \
-    __ bind(&return_right);                                            \
-    if (right_reg != result_reg) {                                     \
-      __ fmr(result_reg, right_reg);                                   \
-    }                                                                  \
-    __ b(&done);                                                       \
-                                                                       \
-    __ bind(&return_left);                                             \
-    if (left_reg != result_reg) {                                      \
-      __ fmr(result_reg, left_reg);                                    \
-    }                                                                  \
-    __ bind(&done);                                                    \
-  } while (0)
-
-#define ASSEMBLE_FLOAT_MIN()                                              \
-  do {                                                                    \
-    DoubleRegister left_reg = i.InputDoubleRegister(0);                   \
-    DoubleRegister right_reg = i.InputDoubleRegister(1);                  \
-    DoubleRegister result_reg = i.OutputDoubleRegister();                 \
-    Label check_nan_left, check_zero, return_left, return_right, done;    \
-    __ fcmpu(left_reg, right_reg);                                        \
-    __ bunordered(&check_nan_left);                                       \
-    __ beq(&check_zero);                                                  \
-    __ ble(&return_left);                                                 \
-    __ b(&return_right);                                                  \
-                                                                          \
-    __ bind(&check_zero);                                                 \
-    __ fcmpu(left_reg, kDoubleRegZero);                                   \
-    /* left == right != 0. */                                             \
-    __ bne(&return_left);                                                 \
-    /* At this point, both left and right are either 0 or -0. */          \
-    /* Min: The algorithm is: -((-L) + (-R)), which in case of L and R */ \
-    /* being different registers is most efficiently expressed */         \
-    /* as -((-L) - R). */                                                 \
-    __ fneg(left_reg, left_reg);                                          \
-    if (left_reg == right_reg) {                                          \
-      __ fadd(result_reg, left_reg, right_reg);                           \
-    } else {                                                              \
-      __ fsub(result_reg, left_reg, right_reg);                           \
-    }                                                                     \
-    __ fneg(result_reg, result_reg);                                      \
-    __ b(&done);                                                          \
-                                                                          \
-    __ bind(&check_nan_left);                                             \
-    __ fcmpu(left_reg, left_reg);                                         \
-    /* left == NaN. */                                                    \
-    __ bunordered(&return_left);                                          \
-                                                                          \
-    __ bind(&return_right);                                               \
-    if (right_reg != result_reg) {                                        \
-      __ fmr(result_reg, right_reg);                                      \
-    }                                                                     \
-    __ b(&done);                                                          \
-                                                                          \
-    __ bind(&return_left);                                                \
-    if (left_reg != result_reg) {                                         \
-      __ fmr(result_reg, left_reg);                                       \
-    }                                                                     \
-    __ bind(&done);                                                       \
-  } while (0)
-
-#define ASSEMBLE_LOAD_FLOAT(asm_instr, asm_instrx)    \
-  do {                                                \
-    DoubleRegister result = i.OutputDoubleRegister(); \
-    AddressingMode mode = kMode_None;                 \
-    MemOperand operand = i.MemoryOperand(&mode);      \
-    if (mode == kMode_MRI) {                          \
-      __ asm_instr(result, operand);                  \
-    } else {                                          \
-      __ asm_instrx(result, operand);                 \
-    }                                                 \
-    DCHECK_EQ(LeaveRC, i.OutputRCBit());              \
-  } while (0)
-
-
-#define ASSEMBLE_LOAD_INTEGER(asm_instr, asm_instrx) \
-  do {                                               \
-    Register result = i.OutputRegister();            \
-    AddressingMode mode = kMode_None;                \
-    MemOperand operand = i.MemoryOperand(&mode);     \
-    if (mode == kMode_MRI) {                         \
-      __ asm_instr(result, operand);                 \
-    } else {                                         \
-      __ asm_instrx(result, operand);                \
-    }                                                \
-    DCHECK_EQ(LeaveRC, i.OutputRCBit());             \
-  } while (0)
-
-
-#define ASSEMBLE_STORE_FLOAT32()                         \
-  do {                                                   \
-    size_t index = 0;                                    \
-    AddressingMode mode = kMode_None;                    \
-    MemOperand operand = i.MemoryOperand(&mode, &index); \
-    DoubleRegister value = i.InputDoubleRegister(index); \
-    /* removed frsp as instruction-selector checked */   \
-    /* value to be kFloat32 */                           \
-    if (mode == kMode_MRI) {                             \
-      __ stfs(value, operand);                           \
-    } else {                                             \
-      __ stfsx(value, operand);                          \
-    }                                                    \
-    DCHECK_EQ(LeaveRC, i.OutputRCBit());                 \
-  } while (0)
-
-
-#define ASSEMBLE_STORE_DOUBLE()                          \
-  do {                                                   \
-    size_t index = 0;                                    \
-    AddressingMode mode = kMode_None;                    \
-    MemOperand operand = i.MemoryOperand(&mode, &index); \
-    DoubleRegister value = i.InputDoubleRegister(index); \
-    if (mode == kMode_MRI) {                             \
-      __ stfd(value, operand);                           \
-    } else {                                             \
-      __ stfdx(value, operand);                          \
-    }                                                    \
-    DCHECK_EQ(LeaveRC, i.OutputRCBit());                 \
-  } while (0)
-
-
-#define ASSEMBLE_STORE_INTEGER(asm_instr, asm_instrx)    \
-  do {                                                   \
-    size_t index = 0;                                    \
-    AddressingMode mode = kMode_None;                    \
-    MemOperand operand = i.MemoryOperand(&mode, &index); \
-    Register value = i.InputRegister(index);             \
-    if (mode == kMode_MRI) {                             \
-      __ asm_instr(value, operand);                      \
-    } else {                                             \
-      __ asm_instrx(value, operand);                     \
-    }                                                    \
-    DCHECK_EQ(LeaveRC, i.OutputRCBit());                 \
-  } while (0)
-
-#if V8_TARGET_ARCH_PPC64
-// TODO(mbrandy): fix paths that produce garbage in offset's upper 32-bits.
-#define CleanUInt32(x) __ ClearLeftImm(x, x, Operand(32))
-#else
-#define CleanUInt32(x)
-#endif
-
-#define ASSEMBLE_ATOMIC_LOAD_INTEGER(asm_instr, asm_instrx) \
-  do {                                                      \
-    Label done;                                             \
-    Register result = i.OutputRegister();                   \
-    AddressingMode mode = kMode_None;                       \
-    MemOperand operand = i.MemoryOperand(&mode);            \
-    if (mode == kMode_MRI) {                                \
-      __ asm_instr(result, operand);                        \
-    } else {                                                \
-      __ asm_instrx(result, operand);                       \
-    }                                                       \
-    __ lwsync();                                            \
-  } while (0)
-#define ASSEMBLE_ATOMIC_STORE_INTEGER(asm_instr, asm_instrx) \
-  do {                                                       \
-    size_t index = 0;                                        \
-    AddressingMode mode = kMode_None;                        \
-    MemOperand operand = i.MemoryOperand(&mode, &index);     \
-    Register value = i.InputRegister(index);                 \
-    __ lwsync();                                             \
-    if (mode == kMode_MRI) {                                 \
-      __ asm_instr(value, operand);                          \
-    } else {                                                 \
-      __ asm_instrx(value, operand);                         \
-    }                                                        \
-    __ sync();                                               \
-    DCHECK_EQ(LeaveRC, i.OutputRCBit());                     \
-  } while (0)
-#define ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(load_instr, store_instr)       \
-  do {                                                                  \
-    Label exchange;                                                     \
-    __ bind(&exchange);                                                 \
-    __ load_instr(i.OutputRegister(0),                                  \
-                  MemOperand(i.InputRegister(0), i.InputRegister(1)));  \
-    __ store_instr(i.InputRegister(2),                                  \
-                   MemOperand(i.InputRegister(0), i.InputRegister(1))); \
-    __ bne(&exchange, cr0);                                             \
-  } while (0)
-
-void CodeGenerator::AssembleDeconstructFrame() {
-  __ LeaveFrame(StackFrame::MANUAL);
-}
-
-void CodeGenerator::AssemblePrepareTailCall() {
-  if (frame_access_state()->has_frame()) {
-    __ RestoreFrameStateForTailCall();
-  }
-  frame_access_state()->SetFrameAccessToSP();
-}
-
-void CodeGenerator::AssemblePopArgumentsAdaptorFrame(Register args_reg,
-                                                     Register scratch1,
-                                                     Register scratch2,
-                                                     Register scratch3) {
-  DCHECK(!AreAliased(args_reg, scratch1, scratch2, scratch3));
-  Label done;
-
-  // Check if current frame is an arguments adaptor frame.
-  __ LoadP(scratch1, MemOperand(fp, StandardFrameConstants::kContextOffset));
-  __ cmpi(scratch1,
-          Operand(StackFrame::TypeToMarker(StackFrame::ARGUMENTS_ADAPTOR)));
-  __ bne(&done);
-
-  // Load arguments count from current arguments adaptor frame (note, it
-  // does not include receiver).
-  Register caller_args_count_reg = scratch1;
-  __ LoadP(caller_args_count_reg,
-           MemOperand(fp, ArgumentsAdaptorFrameConstants::kLengthOffset));
-  __ SmiUntag(caller_args_count_reg);
-
-  ParameterCount callee_args_count(args_reg);
-  __ PrepareForTailCall(callee_args_count, caller_args_count_reg, scratch2,
-                        scratch3);
-  __ bind(&done);
-}
-
-namespace {
-
-void FlushPendingPushRegisters(TurboAssembler* tasm,
-                               FrameAccessState* frame_access_state,
-                               ZoneVector<Register>* pending_pushes) {
-  switch (pending_pushes->size()) {
-    case 0:
-      break;
-    case 1:
-      tasm->Push((*pending_pushes)[0]);
-      break;
-    case 2:
-      tasm->Push((*pending_pushes)[0], (*pending_pushes)[1]);
-      break;
-    case 3:
-      tasm->Push((*pending_pushes)[0], (*pending_pushes)[1],
-                 (*pending_pushes)[2]);
-      break;
-    default:
-      UNREACHABLE();
-      break;
-  }
-  frame_access_state->IncreaseSPDelta(pending_pushes->size());
-  pending_pushes->clear();
-}
-
-void AdjustStackPointerForTailCall(
-    TurboAssembler* tasm, FrameAccessState* state, int new_slot_above_sp,
-    ZoneVector<Register>* pending_pushes = nullptr,
-    bool allow_shrinkage = true) {
-  int current_sp_offset = state->GetSPToFPSlotCount() +
-                          StandardFrameConstants::kFixedSlotCountAboveFp;
-  int stack_slot_delta = new_slot_above_sp - current_sp_offset;
-  if (stack_slot_delta > 0) {
-    if (pending_pushes != nullptr) {
-      FlushPendingPushRegisters(tasm, state, pending_pushes);
-    }
-    tasm->Add(sp, sp, -stack_slot_delta * kPointerSize, r0);
-    state->IncreaseSPDelta(stack_slot_delta);
-  } else if (allow_shrinkage && stack_slot_delta < 0) {
-    if (pending_pushes != nullptr) {
-      FlushPendingPushRegisters(tasm, state, pending_pushes);
-    }
-    tasm->Add(sp, sp, -stack_slot_delta * kPointerSize, r0);
-    state->IncreaseSPDelta(stack_slot_delta);
-  }
-}
-
-}  // namespace
-
-void CodeGenerator::AssembleTailCallBeforeGap(Instruction* instr,
-                                              int first_unused_stack_slot) {
-  ZoneVector<MoveOperands*> pushes(zone());
-  GetPushCompatibleMoves(instr, kRegisterPush, &pushes);
-
-  if (!pushes.empty() &&
-      (LocationOperand::cast(pushes.back()->destination()).index() + 1 ==
-       first_unused_stack_slot)) {
-    PPCOperandConverter g(this, instr);
-    ZoneVector<Register> pending_pushes(zone());
-    for (auto move : pushes) {
-      LocationOperand destination_location(
-          LocationOperand::cast(move->destination()));
-      InstructionOperand source(move->source());
-      AdjustStackPointerForTailCall(
-          tasm(), frame_access_state(),
-          destination_location.index() - pending_pushes.size(),
-          &pending_pushes);
-      // Pushes of non-register data types are not supported.
-      DCHECK(source.IsRegister());
-      LocationOperand source_location(LocationOperand::cast(source));
-      pending_pushes.push_back(source_location.GetRegister());
-      // TODO(arm): We can push more than 3 registers at once. Add support in
-      // the macro-assembler for pushing a list of registers.
-      if (pending_pushes.size() == 3) {
-        FlushPendingPushRegisters(tasm(), frame_access_state(),
-                                  &pending_pushes);
-      }
-      move->Eliminate();
-    }
-    FlushPendingPushRegisters(tasm(), frame_access_state(), &pending_pushes);
-  }
-  AdjustStackPointerForTailCall(tasm(), frame_access_state(),
-                                first_unused_stack_slot, nullptr, false);
-}
-
-void CodeGenerator::AssembleTailCallAfterGap(Instruction* instr,
-                                             int first_unused_stack_slot) {
-  AdjustStackPointerForTailCall(tasm(), frame_access_state(),
-                                first_unused_stack_slot);
-}
-
-// Check if the code object is marked for deoptimization. If it is, then it
-// jumps to the CompileLazyDeoptimizedCode builtin. In order to do this we need
-// to:
-//    1. load the address of the current instruction;
-//    2. read from memory the word that contains that bit, which can be found in
-//       the flags in the referenced {CodeDataContainer} object;
-//    3. test kMarkedForDeoptimizationBit in those flags; and
-//    4. if it is not zero then it jumps to the builtin.
-void CodeGenerator::BailoutIfDeoptimized() {
-  Label current;
-  __ mov_label_addr(r11, &current);
-  int pc_offset = __ pc_offset();
-  __ bind(&current);
-  int offset = Code::kCodeDataContainerOffset - (Code::kHeaderSize + pc_offset);
-  __ LoadP(r11, MemOperand(r11, offset));
-  __ LoadWordArith(
-      r11, FieldMemOperand(r11, CodeDataContainer::kKindSpecificFlagsOffset));
-  __ TestBit(r11, Code::kMarkedForDeoptimizationBit);
-  Handle<Code> code = isolate()->builtins()->builtin_handle(
-      Builtins::kCompileLazyDeoptimizedCode);
-  __ Jump(code, RelocInfo::CODE_TARGET, ne, cr0);
-}
-
-// Assembles an instruction after register allocation, producing machine code.
-CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
-    Instruction* instr) {
-  PPCOperandConverter i(this, instr);
-  ArchOpcode opcode = ArchOpcodeField::decode(instr->opcode());
-
-  switch (opcode) {
-    case kArchCallCodeObject: {
-      v8::internal::Assembler::BlockTrampolinePoolScope block_trampoline_pool(
-          tasm());
-      if (HasRegisterInput(instr, 0)) {
-        __ addi(ip, i.InputRegister(0),
-                Operand(Code::kHeaderSize - kHeapObjectTag));
-        __ Call(ip);
-      } else {
-        __ Call(i.InputCode(0), RelocInfo::CODE_TARGET);
-      }
-      RecordCallPosition(instr);
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      frame_access_state()->ClearSPDelta();
-      break;
-    }
-    case kArchCallWasmFunction: {
-      // We must not share code targets for calls to builtins for wasm code, as
-      // they might need to be patched individually.
-      RelocInfo::Mode rmode = RelocInfo::JS_TO_WASM_CALL;
-      if (info()->IsWasm()) {
-        rmode = RelocInfo::WASM_CALL;
-      }
-
-      if (instr->InputAt(0)->IsImmediate()) {
-#ifdef V8_TARGET_ARCH_PPC64
-        Address wasm_code = reinterpret_cast<Address>(
-            i.ToConstant(instr->InputAt(0)).ToInt64());
-#else
-        Address wasm_code = reinterpret_cast<Address>(
-            i.ToConstant(instr->InputAt(0)).ToInt32());
-#endif
-        __ Call(wasm_code, rmode);
-      } else {
-        __ Call(i.InputRegister(0));
-      }
-      RecordCallPosition(instr);
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      frame_access_state()->ClearSPDelta();
-      break;
-    }
-    case kArchTailCallCodeObjectFromJSFunction:
-    case kArchTailCallCodeObject: {
-      if (opcode == kArchTailCallCodeObjectFromJSFunction) {
-        AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister,
-                                         i.TempRegister(0), i.TempRegister(1),
-                                         i.TempRegister(2));
-      }
-      if (HasRegisterInput(instr, 0)) {
-        __ addi(ip, i.InputRegister(0),
-                Operand(Code::kHeaderSize - kHeapObjectTag));
-        __ Jump(ip);
-      } else {
-        // We cannot use the constant pool to load the target since
-        // we've already restored the caller's frame.
-        ConstantPoolUnavailableScope constant_pool_unavailable(tasm());
-        __ Jump(i.InputCode(0), RelocInfo::CODE_TARGET);
-      }
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      frame_access_state()->ClearSPDelta();
-      frame_access_state()->SetFrameAccessToDefault();
-      break;
-    }
-    case kArchTailCallWasm: {
-      // We must not share code targets for calls to builtins for wasm code, as
-      // they might need to be patched individually.
-      RelocInfo::Mode rmode = RelocInfo::JS_TO_WASM_CALL;
-      if (info()->IsWasm()) {
-        rmode = RelocInfo::WASM_CALL;
-      }
-
-      if (instr->InputAt(0)->IsImmediate()) {
-        Address wasm_code = reinterpret_cast<Address>(
-            i.ToConstant(instr->InputAt(0)).ToInt32());
-        __ Jump(wasm_code, rmode);
-      } else {
-        __ Jump(i.InputRegister(0));
-      }
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      frame_access_state()->ClearSPDelta();
-      frame_access_state()->SetFrameAccessToDefault();
-      break;
-    }
-    case kArchTailCallAddress: {
-      CHECK(!instr->InputAt(0)->IsImmediate());
-      __ Jump(i.InputRegister(0));
-      frame_access_state()->ClearSPDelta();
-      frame_access_state()->SetFrameAccessToDefault();
-      break;
-    }
-    case kArchCallJSFunction: {
-      v8::internal::Assembler::BlockTrampolinePoolScope block_trampoline_pool(
-          tasm());
-      Register func = i.InputRegister(0);
-      if (FLAG_debug_code) {
-        // Check the function's context matches the context argument.
-        __ LoadP(kScratchReg,
-                 FieldMemOperand(func, JSFunction::kContextOffset));
-        __ cmp(cp, kScratchReg);
-        __ Assert(eq, AbortReason::kWrongFunctionContext);
-      }
-      __ LoadP(ip, FieldMemOperand(func, JSFunction::kCodeOffset));
-      __ addi(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag));
-      __ Call(ip);
-      RecordCallPosition(instr);
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      frame_access_state()->ClearSPDelta();
-      break;
-    }
-    case kArchPrepareCallCFunction: {
-      int const num_parameters = MiscField::decode(instr->opcode());
-      __ PrepareCallCFunction(num_parameters, kScratchReg);
-      // Frame alignment requires using FP-relative frame addressing.
-      frame_access_state()->SetFrameAccessToFP();
-      break;
-    }
-    case kArchSaveCallerRegisters: {
-      fp_mode_ =
-          static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode()));
-      DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
-      // kReturnRegister0 should have been saved before entering the stub.
-      int bytes = __ PushCallerSaved(fp_mode_, kReturnRegister0);
-      DCHECK_EQ(0, bytes % kPointerSize);
-      DCHECK_EQ(0, frame_access_state()->sp_delta());
-      frame_access_state()->IncreaseSPDelta(bytes / kPointerSize);
-      DCHECK(!caller_registers_saved_);
-      caller_registers_saved_ = true;
-      break;
-    }
-    case kArchRestoreCallerRegisters: {
-      DCHECK(fp_mode_ ==
-             static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode())));
-      DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
-      // Don't overwrite the returned value.
-      int bytes = __ PopCallerSaved(fp_mode_, kReturnRegister0);
-      frame_access_state()->IncreaseSPDelta(-(bytes / kPointerSize));
-      DCHECK_EQ(0, frame_access_state()->sp_delta());
-      DCHECK(caller_registers_saved_);
-      caller_registers_saved_ = false;
-      break;
-    }
-    case kArchPrepareTailCall:
-      AssemblePrepareTailCall();
-      break;
-    case kArchComment: {
-      Address comment_string = i.InputExternalReference(0).address();
-      __ RecordComment(reinterpret_cast<const char*>(comment_string));
-      break;
-    }
-    case kArchCallCFunction: {
-      int const num_parameters = MiscField::decode(instr->opcode());
-      if (instr->InputAt(0)->IsImmediate()) {
-        ExternalReference ref = i.InputExternalReference(0);
-        __ CallCFunction(ref, num_parameters);
-      } else {
-        Register func = i.InputRegister(0);
-        __ CallCFunction(func, num_parameters);
-      }
-      frame_access_state()->SetFrameAccessToDefault();
-      // Ideally, we should decrement SP delta to match the change of stack
-      // pointer in CallCFunction. However, for certain architectures (e.g.
-      // ARM), there may be more strict alignment requirement, causing old SP
-      // to be saved on the stack. In those cases, we can not calculate the SP
-      // delta statically.
-      frame_access_state()->ClearSPDelta();
-      if (caller_registers_saved_) {
-        // Need to re-sync SP delta introduced in kArchSaveCallerRegisters.
-        // Here, we assume the sequence to be:
-        //   kArchSaveCallerRegisters;
-        //   kArchCallCFunction;
-        //   kArchRestoreCallerRegisters;
-        int bytes =
-            __ RequiredStackSizeForCallerSaved(fp_mode_, kReturnRegister0);
-        frame_access_state()->IncreaseSPDelta(bytes / kPointerSize);
-      }
-      break;
-    }
-    case kArchJmp:
-      AssembleArchJump(i.InputRpo(0));
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kArchLookupSwitch:
-      AssembleArchLookupSwitch(instr);
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kArchTableSwitch:
-      AssembleArchTableSwitch(instr);
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kArchDebugAbort:
-      DCHECK(i.InputRegister(0) == r4);
-      if (!frame_access_state()->has_frame()) {
-        // We don't actually want to generate a pile of code for this, so just
-        // claim there is a stack frame, without generating one.
-        FrameScope scope(tasm(), StackFrame::NONE);
-        __ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
-                RelocInfo::CODE_TARGET);
-      } else {
-        __ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
-                RelocInfo::CODE_TARGET);
-      }
-      __ stop("kArchDebugAbort");
-      break;
-    case kArchDebugBreak:
-      __ stop("kArchDebugBreak");
-      break;
-    case kArchNop:
-    case kArchThrowTerminator:
-      // don't emit code for nops.
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kArchDeoptimize: {
-      int deopt_state_id =
-          BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore());
-      CodeGenResult result =
-          AssembleDeoptimizerCall(deopt_state_id, current_source_position_);
-      if (result != kSuccess) return result;
-      break;
-    }
-    case kArchRet:
-      AssembleReturn(instr->InputAt(0));
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kArchStackPointer:
-      __ mr(i.OutputRegister(), sp);
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kArchFramePointer:
-      __ mr(i.OutputRegister(), fp);
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kArchParentFramePointer:
-      if (frame_access_state()->has_frame()) {
-        __ LoadP(i.OutputRegister(), MemOperand(fp, 0));
-      } else {
-        __ mr(i.OutputRegister(), fp);
-      }
-      break;
-    case kArchTruncateDoubleToI:
-      // TODO(mbrandy): move slow call to stub out of line.
-      __ TruncateDoubleToIDelayed(zone(), i.OutputRegister(),
-                                  i.InputDoubleRegister(0));
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kArchStoreWithWriteBarrier: {
-      RecordWriteMode mode =
-          static_cast<RecordWriteMode>(MiscField::decode(instr->opcode()));
-      Register object = i.InputRegister(0);
-      Register value = i.InputRegister(2);
-      Register scratch0 = i.TempRegister(0);
-      Register scratch1 = i.TempRegister(1);
-      OutOfLineRecordWrite* ool;
-
-      AddressingMode addressing_mode =
-          AddressingModeField::decode(instr->opcode());
-      if (addressing_mode == kMode_MRI) {
-        int32_t offset = i.InputInt32(1);
-        ool = new (zone()) OutOfLineRecordWrite(this, object, offset, value,
-                                                scratch0, scratch1, mode);
-        __ StoreP(value, MemOperand(object, offset));
-      } else {
-        DCHECK_EQ(kMode_MRR, addressing_mode);
-        Register offset(i.InputRegister(1));
-        ool = new (zone()) OutOfLineRecordWrite(this, object, offset, value,
-                                                scratch0, scratch1, mode);
-        __ StorePX(value, MemOperand(object, offset));
-      }
-      __ CheckPageFlag(object, scratch0,
-                       MemoryChunk::kPointersFromHereAreInterestingMask, ne,
-                       ool->entry());
-      __ bind(ool->exit());
-      break;
-    }
-    case kArchStackSlot: {
-      FrameOffset offset =
-          frame_access_state()->GetFrameOffset(i.InputInt32(0));
-      __ addi(i.OutputRegister(), offset.from_stack_pointer() ? sp : fp,
-              Operand(offset.offset()));
-      break;
-    }
-    case kPPC_And:
-      if (HasRegisterInput(instr, 1)) {
-        __ and_(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
-                i.OutputRCBit());
-      } else {
-        __ andi(i.OutputRegister(), i.InputRegister(0), i.InputImmediate(1));
-      }
-      break;
-    case kPPC_AndComplement:
-      __ andc(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
-              i.OutputRCBit());
-      break;
-    case kPPC_Or:
-      if (HasRegisterInput(instr, 1)) {
-        __ orx(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
-               i.OutputRCBit());
-      } else {
-        __ ori(i.OutputRegister(), i.InputRegister(0), i.InputImmediate(1));
-        DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      }
-      break;
-    case kPPC_OrComplement:
-      __ orc(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
-             i.OutputRCBit());
-      break;
-    case kPPC_Xor:
-      if (HasRegisterInput(instr, 1)) {
-        __ xor_(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
-                i.OutputRCBit());
-      } else {
-        __ xori(i.OutputRegister(), i.InputRegister(0), i.InputImmediate(1));
-        DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      }
-      break;
-    case kPPC_ShiftLeft32:
-      ASSEMBLE_BINOP_RC(slw, slwi);
-      break;
-#if V8_TARGET_ARCH_PPC64
-    case kPPC_ShiftLeft64:
-      ASSEMBLE_BINOP_RC(sld, sldi);
-      break;
-#endif
-    case kPPC_ShiftRight32:
-      ASSEMBLE_BINOP_RC(srw, srwi);
-      break;
-#if V8_TARGET_ARCH_PPC64
-    case kPPC_ShiftRight64:
-      ASSEMBLE_BINOP_RC(srd, srdi);
-      break;
-#endif
-    case kPPC_ShiftRightAlg32:
-      ASSEMBLE_BINOP_INT_RC(sraw, srawi);
-      break;
-#if V8_TARGET_ARCH_PPC64
-    case kPPC_ShiftRightAlg64:
-      ASSEMBLE_BINOP_INT_RC(srad, sradi);
-      break;
-#endif
-#if !V8_TARGET_ARCH_PPC64
-    case kPPC_AddPair:
-      // i.InputRegister(0) ... left low word.
-      // i.InputRegister(1) ... left high word.
-      // i.InputRegister(2) ... right low word.
-      // i.InputRegister(3) ... right high word.
-      __ addc(i.OutputRegister(0), i.InputRegister(0), i.InputRegister(2));
-      __ adde(i.OutputRegister(1), i.InputRegister(1), i.InputRegister(3));
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kPPC_SubPair:
-      // i.InputRegister(0) ... left low word.
-      // i.InputRegister(1) ... left high word.
-      // i.InputRegister(2) ... right low word.
-      // i.InputRegister(3) ... right high word.
-      __ subc(i.OutputRegister(0), i.InputRegister(0), i.InputRegister(2));
-      __ sube(i.OutputRegister(1), i.InputRegister(1), i.InputRegister(3));
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kPPC_MulPair:
-      // i.InputRegister(0) ... left low word.
-      // i.InputRegister(1) ... left high word.
-      // i.InputRegister(2) ... right low word.
-      // i.InputRegister(3) ... right high word.
-      __ mullw(i.TempRegister(0), i.InputRegister(0), i.InputRegister(3));
-      __ mullw(i.TempRegister(1), i.InputRegister(2), i.InputRegister(1));
-      __ add(i.TempRegister(0), i.TempRegister(0), i.TempRegister(1));
-      __ mullw(i.OutputRegister(0), i.InputRegister(0), i.InputRegister(2));
-      __ mulhwu(i.OutputRegister(1), i.InputRegister(0), i.InputRegister(2));
-      __ add(i.OutputRegister(1), i.OutputRegister(1), i.TempRegister(0));
-      break;
-    case kPPC_ShiftLeftPair: {
-      Register second_output =
-          instr->OutputCount() >= 2 ? i.OutputRegister(1) : i.TempRegister(0);
-      if (instr->InputAt(2)->IsImmediate()) {
-        __ ShiftLeftPair(i.OutputRegister(0), second_output, i.InputRegister(0),
-                         i.InputRegister(1), i.InputInt32(2));
-      } else {
-        __ ShiftLeftPair(i.OutputRegister(0), second_output, i.InputRegister(0),
-                         i.InputRegister(1), kScratchReg, i.InputRegister(2));
-      }
-      break;
-    }
-    case kPPC_ShiftRightPair: {
-      Register second_output =
-          instr->OutputCount() >= 2 ? i.OutputRegister(1) : i.TempRegister(0);
-      if (instr->InputAt(2)->IsImmediate()) {
-        __ ShiftRightPair(i.OutputRegister(0), second_output,
-                          i.InputRegister(0), i.InputRegister(1),
-                          i.InputInt32(2));
-      } else {
-        __ ShiftRightPair(i.OutputRegister(0), second_output,
-                          i.InputRegister(0), i.InputRegister(1), kScratchReg,
-                          i.InputRegister(2));
-      }
-      break;
-    }
-    case kPPC_ShiftRightAlgPair: {
-      Register second_output =
-          instr->OutputCount() >= 2 ? i.OutputRegister(1) : i.TempRegister(0);
-      if (instr->InputAt(2)->IsImmediate()) {
-        __ ShiftRightAlgPair(i.OutputRegister(0), second_output,
-                             i.InputRegister(0), i.InputRegister(1),
-                             i.InputInt32(2));
-      } else {
-        __ ShiftRightAlgPair(i.OutputRegister(0), second_output,
-                             i.InputRegister(0), i.InputRegister(1),
-                             kScratchReg, i.InputRegister(2));
-      }
-      break;
-    }
-#endif
-    case kPPC_RotRight32:
-      if (HasRegisterInput(instr, 1)) {
-        __ subfic(kScratchReg, i.InputRegister(1), Operand(32));
-        __ rotlw(i.OutputRegister(), i.InputRegister(0), kScratchReg,
-                 i.OutputRCBit());
-      } else {
-        int sh = i.InputInt32(1);
-        __ rotrwi(i.OutputRegister(), i.InputRegister(0), sh, i.OutputRCBit());
-      }
-      break;
-#if V8_TARGET_ARCH_PPC64
-    case kPPC_RotRight64:
-      if (HasRegisterInput(instr, 1)) {
-        __ subfic(kScratchReg, i.InputRegister(1), Operand(64));
-        __ rotld(i.OutputRegister(), i.InputRegister(0), kScratchReg,
-                 i.OutputRCBit());
-      } else {
-        int sh = i.InputInt32(1);
-        __ rotrdi(i.OutputRegister(), i.InputRegister(0), sh, i.OutputRCBit());
-      }
-      break;
-#endif
-    case kPPC_Not:
-      __ notx(i.OutputRegister(), i.InputRegister(0), i.OutputRCBit());
-      break;
-    case kPPC_RotLeftAndMask32:
-      __ rlwinm(i.OutputRegister(), i.InputRegister(0), i.InputInt32(1),
-                31 - i.InputInt32(2), 31 - i.InputInt32(3), i.OutputRCBit());
-      break;
-#if V8_TARGET_ARCH_PPC64
-    case kPPC_RotLeftAndClear64:
-      __ rldic(i.OutputRegister(), i.InputRegister(0), i.InputInt32(1),
-               63 - i.InputInt32(2), i.OutputRCBit());
-      break;
-    case kPPC_RotLeftAndClearLeft64:
-      __ rldicl(i.OutputRegister(), i.InputRegister(0), i.InputInt32(1),
-                63 - i.InputInt32(2), i.OutputRCBit());
-      break;
-    case kPPC_RotLeftAndClearRight64:
-      __ rldicr(i.OutputRegister(), i.InputRegister(0), i.InputInt32(1),
-                63 - i.InputInt32(2), i.OutputRCBit());
-      break;
-#endif
-    case kPPC_Add32:
-#if V8_TARGET_ARCH_PPC64
-      if (FlagsModeField::decode(instr->opcode()) != kFlags_none) {
-        ASSEMBLE_ADD_WITH_OVERFLOW();
-      } else {
-#endif
-        if (HasRegisterInput(instr, 1)) {
-          __ add(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
-                 LeaveOE, i.OutputRCBit());
-        } else {
-          __ addi(i.OutputRegister(), i.InputRegister(0), i.InputImmediate(1));
-          DCHECK_EQ(LeaveRC, i.OutputRCBit());
-        }
-        __ extsw(i.OutputRegister(), i.OutputRegister());
-#if V8_TARGET_ARCH_PPC64
-      }
-#endif
-      break;
-#if V8_TARGET_ARCH_PPC64
-    case kPPC_Add64:
-      if (FlagsModeField::decode(instr->opcode()) != kFlags_none) {
-        ASSEMBLE_ADD_WITH_OVERFLOW();
-      } else {
-        if (HasRegisterInput(instr, 1)) {
-          __ add(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
-                 LeaveOE, i.OutputRCBit());
-        } else {
-          __ addi(i.OutputRegister(), i.InputRegister(0), i.InputImmediate(1));
-          DCHECK_EQ(LeaveRC, i.OutputRCBit());
-        }
-      }
-      break;
-#endif
-    case kPPC_AddWithOverflow32:
-      ASSEMBLE_ADD_WITH_OVERFLOW32();
-      break;
-    case kPPC_AddDouble:
-      ASSEMBLE_FLOAT_BINOP_RC(fadd, MiscField::decode(instr->opcode()));
-      break;
-    case kPPC_Sub:
-#if V8_TARGET_ARCH_PPC64
-      if (FlagsModeField::decode(instr->opcode()) != kFlags_none) {
-        ASSEMBLE_SUB_WITH_OVERFLOW();
-      } else {
-#endif
-        if (HasRegisterInput(instr, 1)) {
-          __ sub(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
-                 LeaveOE, i.OutputRCBit());
-        } else {
-          if (is_int16(i.InputImmediate(1).immediate())) {
-            __ subi(i.OutputRegister(), i.InputRegister(0),
-                    i.InputImmediate(1));
-            DCHECK_EQ(LeaveRC, i.OutputRCBit());
-          } else {
-            __ mov(kScratchReg, i.InputImmediate(1));
-            __ sub(i.OutputRegister(), i.InputRegister(0), kScratchReg, LeaveOE,
-                   i.OutputRCBit());
-          }
-        }
-#if V8_TARGET_ARCH_PPC64
-      }
-#endif
-      break;
-    case kPPC_SubWithOverflow32:
-      ASSEMBLE_SUB_WITH_OVERFLOW32();
-      break;
-    case kPPC_SubDouble:
-      ASSEMBLE_FLOAT_BINOP_RC(fsub, MiscField::decode(instr->opcode()));
-      break;
-    case kPPC_Mul32:
-      __ mullw(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
-               LeaveOE, i.OutputRCBit());
-      break;
-#if V8_TARGET_ARCH_PPC64
-    case kPPC_Mul64:
-      __ mulld(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
-               LeaveOE, i.OutputRCBit());
-      break;
-#endif
-
-    case kPPC_Mul32WithHigh32:
-      if (i.OutputRegister(0) == i.InputRegister(0) ||
-          i.OutputRegister(0) == i.InputRegister(1) ||
-          i.OutputRegister(1) == i.InputRegister(0) ||
-          i.OutputRegister(1) == i.InputRegister(1)) {
-        __ mullw(kScratchReg,
-                 i.InputRegister(0), i.InputRegister(1));  // low
-        __ mulhw(i.OutputRegister(1),
-                 i.InputRegister(0), i.InputRegister(1));  // high
-        __ mr(i.OutputRegister(0), kScratchReg);
-      } else {
-        __ mullw(i.OutputRegister(0),
-                 i.InputRegister(0), i.InputRegister(1));  // low
-        __ mulhw(i.OutputRegister(1),
-                 i.InputRegister(0), i.InputRegister(1));  // high
-      }
-      break;
-    case kPPC_MulHigh32:
-      __ mulhw(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
-               i.OutputRCBit());
-      break;
-    case kPPC_MulHighU32:
-      __ mulhwu(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
-                i.OutputRCBit());
-      break;
-    case kPPC_MulDouble:
-      ASSEMBLE_FLOAT_BINOP_RC(fmul, MiscField::decode(instr->opcode()));
-      break;
-    case kPPC_Div32:
-      __ divw(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-#if V8_TARGET_ARCH_PPC64
-    case kPPC_Div64:
-      __ divd(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-#endif
-    case kPPC_DivU32:
-      __ divwu(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-#if V8_TARGET_ARCH_PPC64
-    case kPPC_DivU64:
-      __ divdu(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-#endif
-    case kPPC_DivDouble:
-      ASSEMBLE_FLOAT_BINOP_RC(fdiv, MiscField::decode(instr->opcode()));
-      break;
-    case kPPC_Mod32:
-      if (CpuFeatures::IsSupported(MODULO)) {
-        __ modsw(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      } else {
-        ASSEMBLE_MODULO(divw, mullw);
-      }
-      break;
-#if V8_TARGET_ARCH_PPC64
-    case kPPC_Mod64:
-      if (CpuFeatures::IsSupported(MODULO)) {
-        __ modsd(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      } else {
-        ASSEMBLE_MODULO(divd, mulld);
-      }
-      break;
-#endif
-    case kPPC_ModU32:
-      if (CpuFeatures::IsSupported(MODULO)) {
-        __ moduw(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      } else {
-        ASSEMBLE_MODULO(divwu, mullw);
-      }
-      break;
-#if V8_TARGET_ARCH_PPC64
-    case kPPC_ModU64:
-      if (CpuFeatures::IsSupported(MODULO)) {
-        __ modud(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
-      } else {
-        ASSEMBLE_MODULO(divdu, mulld);
-      }
-      break;
-#endif
-    case kPPC_ModDouble:
-      // TODO(bmeurer): We should really get rid of this special instruction,
-      // and generate a CallAddress instruction instead.
-      ASSEMBLE_FLOAT_MODULO();
-      break;
-    case kIeee754Float64Acos:
-      ASSEMBLE_IEEE754_UNOP(acos);
-      break;
-    case kIeee754Float64Acosh:
-      ASSEMBLE_IEEE754_UNOP(acosh);
-      break;
-    case kIeee754Float64Asin:
-      ASSEMBLE_IEEE754_UNOP(asin);
-      break;
-    case kIeee754Float64Asinh:
-      ASSEMBLE_IEEE754_UNOP(asinh);
-      break;
-    case kIeee754Float64Atan:
-      ASSEMBLE_IEEE754_UNOP(atan);
-      break;
-    case kIeee754Float64Atan2:
-      ASSEMBLE_IEEE754_BINOP(atan2);
-      break;
-    case kIeee754Float64Atanh:
-      ASSEMBLE_IEEE754_UNOP(atanh);
-      break;
-    case kIeee754Float64Tan:
-      ASSEMBLE_IEEE754_UNOP(tan);
-      break;
-    case kIeee754Float64Tanh:
-      ASSEMBLE_IEEE754_UNOP(tanh);
-      break;
-    case kIeee754Float64Cbrt:
-      ASSEMBLE_IEEE754_UNOP(cbrt);
-      break;
-    case kIeee754Float64Sin:
-      ASSEMBLE_IEEE754_UNOP(sin);
-      break;
-    case kIeee754Float64Sinh:
-      ASSEMBLE_IEEE754_UNOP(sinh);
-      break;
-    case kIeee754Float64Cos:
-      ASSEMBLE_IEEE754_UNOP(cos);
-      break;
-    case kIeee754Float64Cosh:
-      ASSEMBLE_IEEE754_UNOP(cosh);
-      break;
-    case kIeee754Float64Exp:
-      ASSEMBLE_IEEE754_UNOP(exp);
-      break;
-    case kIeee754Float64Expm1:
-      ASSEMBLE_IEEE754_UNOP(expm1);
-      break;
-    case kIeee754Float64Log:
-      ASSEMBLE_IEEE754_UNOP(log);
-      break;
-    case kIeee754Float64Log1p:
-      ASSEMBLE_IEEE754_UNOP(log1p);
-      break;
-    case kIeee754Float64Log2:
-      ASSEMBLE_IEEE754_UNOP(log2);
-      break;
-    case kIeee754Float64Log10:
-      ASSEMBLE_IEEE754_UNOP(log10);
-      break;
-    case kIeee754Float64Pow: {
-      __ CallStubDelayed(new (zone())
-                             MathPowStub(nullptr, MathPowStub::DOUBLE));
-      __ Move(d1, d3);
-      break;
-    }
-    case kPPC_Neg:
-      __ neg(i.OutputRegister(), i.InputRegister(0), LeaveOE, i.OutputRCBit());
-      break;
-    case kPPC_MaxDouble:
-      ASSEMBLE_FLOAT_MAX();
-      break;
-    case kPPC_MinDouble:
-      ASSEMBLE_FLOAT_MIN();
-      break;
-    case kPPC_AbsDouble:
-      ASSEMBLE_FLOAT_UNOP_RC(fabs, 0);
-      break;
-    case kPPC_SqrtDouble:
-      ASSEMBLE_FLOAT_UNOP_RC(fsqrt, MiscField::decode(instr->opcode()));
-      break;
-    case kPPC_FloorDouble:
-      ASSEMBLE_FLOAT_UNOP_RC(frim, MiscField::decode(instr->opcode()));
-      break;
-    case kPPC_CeilDouble:
-      ASSEMBLE_FLOAT_UNOP_RC(frip, MiscField::decode(instr->opcode()));
-      break;
-    case kPPC_TruncateDouble:
-      ASSEMBLE_FLOAT_UNOP_RC(friz, MiscField::decode(instr->opcode()));
-      break;
-    case kPPC_RoundDouble:
-      ASSEMBLE_FLOAT_UNOP_RC(frin, MiscField::decode(instr->opcode()));
-      break;
-    case kPPC_NegDouble:
-      ASSEMBLE_FLOAT_UNOP_RC(fneg, 0);
-      break;
-    case kPPC_Cntlz32:
-      __ cntlzw(i.OutputRegister(), i.InputRegister(0));
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-#if V8_TARGET_ARCH_PPC64
-    case kPPC_Cntlz64:
-      __ cntlzd(i.OutputRegister(), i.InputRegister(0));
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-#endif
-    case kPPC_Popcnt32:
-      __ popcntw(i.OutputRegister(), i.InputRegister(0));
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-#if V8_TARGET_ARCH_PPC64
-    case kPPC_Popcnt64:
-      __ popcntd(i.OutputRegister(), i.InputRegister(0));
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-#endif
-    case kPPC_Cmp32:
-      ASSEMBLE_COMPARE(cmpw, cmplw);
-      break;
-#if V8_TARGET_ARCH_PPC64
-    case kPPC_Cmp64:
-      ASSEMBLE_COMPARE(cmp, cmpl);
-      break;
-#endif
-    case kPPC_CmpDouble:
-      ASSEMBLE_FLOAT_COMPARE(fcmpu);
-      break;
-    case kPPC_Tst32:
-      if (HasRegisterInput(instr, 1)) {
-        __ and_(r0, i.InputRegister(0), i.InputRegister(1), i.OutputRCBit());
-      } else {
-        __ andi(r0, i.InputRegister(0), i.InputImmediate(1));
-      }
-#if V8_TARGET_ARCH_PPC64
-      __ extsw(r0, r0, i.OutputRCBit());
-#endif
-      DCHECK_EQ(SetRC, i.OutputRCBit());
-      break;
-#if V8_TARGET_ARCH_PPC64
-    case kPPC_Tst64:
-      if (HasRegisterInput(instr, 1)) {
-        __ and_(r0, i.InputRegister(0), i.InputRegister(1), i.OutputRCBit());
-      } else {
-        __ andi(r0, i.InputRegister(0), i.InputImmediate(1));
-      }
-      DCHECK_EQ(SetRC, i.OutputRCBit());
-      break;
-#endif
-    case kPPC_Float64SilenceNaN: {
-      DoubleRegister value = i.InputDoubleRegister(0);
-      DoubleRegister result = i.OutputDoubleRegister();
-      __ CanonicalizeNaN(result, value);
-      break;
-    }
-    case kPPC_Push:
-      if (instr->InputAt(0)->IsFPRegister()) {
-        LocationOperand* op = LocationOperand::cast(instr->InputAt(0));
-        if (op->representation() == MachineRepresentation::kFloat64) {
-          __ StoreDoubleU(i.InputDoubleRegister(0),
-                          MemOperand(sp, -kDoubleSize), r0);
-          frame_access_state()->IncreaseSPDelta(kDoubleSize / kPointerSize);
-        } else {
-          DCHECK_EQ(MachineRepresentation::kFloat32, op->representation());
-          __ StoreSingleU(i.InputDoubleRegister(0),
-                          MemOperand(sp, -kPointerSize), r0);
-          frame_access_state()->IncreaseSPDelta(1);
-        }
-      } else {
-        __ StorePU(i.InputRegister(0), MemOperand(sp, -kPointerSize), r0);
-        frame_access_state()->IncreaseSPDelta(1);
-      }
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kPPC_PushFrame: {
-      int num_slots = i.InputInt32(1);
-      if (instr->InputAt(0)->IsFPRegister()) {
-        LocationOperand* op = LocationOperand::cast(instr->InputAt(0));
-        if (op->representation() == MachineRepresentation::kFloat64) {
-          __ StoreDoubleU(i.InputDoubleRegister(0),
-                        MemOperand(sp, -num_slots * kPointerSize), r0);
-        } else {
-          DCHECK_EQ(MachineRepresentation::kFloat32, op->representation());
-          __ StoreSingleU(i.InputDoubleRegister(0),
-                        MemOperand(sp, -num_slots * kPointerSize), r0);
-        }
-      } else {
-        __ StorePU(i.InputRegister(0),
-                   MemOperand(sp, -num_slots * kPointerSize), r0);
-      }
-      break;
-    }
-    case kPPC_StoreToStackSlot: {
-      int slot = i.InputInt32(1);
-      if (instr->InputAt(0)->IsFPRegister()) {
-        LocationOperand* op = LocationOperand::cast(instr->InputAt(0));
-        if (op->representation() == MachineRepresentation::kFloat64) {
-          __ StoreDouble(i.InputDoubleRegister(0),
-                        MemOperand(sp, slot * kPointerSize), r0);
-        } else {
-          DCHECK_EQ(MachineRepresentation::kFloat32, op->representation());
-          __ StoreSingle(i.InputDoubleRegister(0),
-                        MemOperand(sp, slot * kPointerSize), r0);
-        }
-      } else {
-        __ StoreP(i.InputRegister(0), MemOperand(sp, slot * kPointerSize), r0);
-      }
-      break;
-    }
-    case kPPC_ExtendSignWord8:
-      __ extsb(i.OutputRegister(), i.InputRegister(0));
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kPPC_ExtendSignWord16:
-      __ extsh(i.OutputRegister(), i.InputRegister(0));
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-#if V8_TARGET_ARCH_PPC64
-    case kPPC_ExtendSignWord32:
-      __ extsw(i.OutputRegister(), i.InputRegister(0));
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kPPC_Uint32ToUint64:
-      // Zero extend
-      __ clrldi(i.OutputRegister(), i.InputRegister(0), Operand(32));
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kPPC_Int64ToInt32:
-      __ extsw(i.OutputRegister(), i.InputRegister(0));
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kPPC_Int64ToFloat32:
-      __ ConvertInt64ToFloat(i.InputRegister(0), i.OutputDoubleRegister());
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kPPC_Int64ToDouble:
-      __ ConvertInt64ToDouble(i.InputRegister(0), i.OutputDoubleRegister());
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kPPC_Uint64ToFloat32:
-      __ ConvertUnsignedInt64ToFloat(i.InputRegister(0),
-                                     i.OutputDoubleRegister());
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kPPC_Uint64ToDouble:
-      __ ConvertUnsignedInt64ToDouble(i.InputRegister(0),
-                                      i.OutputDoubleRegister());
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-#endif
-    case kPPC_Int32ToFloat32:
-      __ ConvertIntToFloat(i.InputRegister(0), i.OutputDoubleRegister());
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kPPC_Int32ToDouble:
-      __ ConvertIntToDouble(i.InputRegister(0), i.OutputDoubleRegister());
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kPPC_Uint32ToFloat32:
-      __ ConvertUnsignedIntToFloat(i.InputRegister(0),
-                                   i.OutputDoubleRegister());
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kPPC_Uint32ToDouble:
-      __ ConvertUnsignedIntToDouble(i.InputRegister(0),
-                                    i.OutputDoubleRegister());
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kPPC_DoubleToInt32:
-    case kPPC_DoubleToUint32:
-    case kPPC_DoubleToInt64: {
-#if V8_TARGET_ARCH_PPC64
-      bool check_conversion =
-          (opcode == kPPC_DoubleToInt64 && i.OutputCount() > 1);
-      if (check_conversion) {
-        __ mtfsb0(VXCVI);  // clear FPSCR:VXCVI bit
-      }
-#endif
-      __ ConvertDoubleToInt64(i.InputDoubleRegister(0),
-#if !V8_TARGET_ARCH_PPC64
-                              kScratchReg,
-#endif
-                              i.OutputRegister(0), kScratchDoubleReg);
-#if V8_TARGET_ARCH_PPC64
-      if (check_conversion) {
-        // Set 2nd output to zero if conversion fails.
-        CRegister cr = cr7;
-        int crbit = v8::internal::Assembler::encode_crbit(
-            cr, static_cast<CRBit>(VXCVI % CRWIDTH));
-        __ mcrfs(cr, VXCVI);  // extract FPSCR field containing VXCVI into cr7
-        if (CpuFeatures::IsSupported(ISELECT)) {
-          __ li(i.OutputRegister(1), Operand(1));
-          __ isel(i.OutputRegister(1), r0, i.OutputRegister(1), crbit);
-        } else {
-          __ li(i.OutputRegister(1), Operand::Zero());
-          __ bc(v8::internal::Assembler::kInstrSize * 2, BT, crbit);
-          __ li(i.OutputRegister(1), Operand(1));
-        }
-      }
-#endif
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    }
-#if V8_TARGET_ARCH_PPC64
-    case kPPC_DoubleToUint64: {
-      bool check_conversion = (i.OutputCount() > 1);
-      if (check_conversion) {
-        __ mtfsb0(VXCVI);  // clear FPSCR:VXCVI bit
-      }
-      __ ConvertDoubleToUnsignedInt64(i.InputDoubleRegister(0),
-                                      i.OutputRegister(0), kScratchDoubleReg);
-      if (check_conversion) {
-        // Set 2nd output to zero if conversion fails.
-        CRegister cr = cr7;
-        int crbit = v8::internal::Assembler::encode_crbit(
-            cr, static_cast<CRBit>(VXCVI % CRWIDTH));
-        __ mcrfs(cr, VXCVI);  // extract FPSCR field containing VXCVI into cr7
-        if (CpuFeatures::IsSupported(ISELECT)) {
-          __ li(i.OutputRegister(1), Operand(1));
-          __ isel(i.OutputRegister(1), r0, i.OutputRegister(1), crbit);
-        } else {
-          __ li(i.OutputRegister(1), Operand::Zero());
-          __ bc(v8::internal::Assembler::kInstrSize * 2, BT, crbit);
-          __ li(i.OutputRegister(1), Operand(1));
-        }
-      }
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    }
-#endif
-    case kPPC_DoubleToFloat32:
-      ASSEMBLE_FLOAT_UNOP_RC(frsp, 0);
-      break;
-    case kPPC_Float32ToDouble:
-      // Nothing to do.
-      __ Move(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kPPC_DoubleExtractLowWord32:
-      __ MovDoubleLowToInt(i.OutputRegister(), i.InputDoubleRegister(0));
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kPPC_DoubleExtractHighWord32:
-      __ MovDoubleHighToInt(i.OutputRegister(), i.InputDoubleRegister(0));
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kPPC_DoubleInsertLowWord32:
-      __ InsertDoubleLow(i.OutputDoubleRegister(), i.InputRegister(1), r0);
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kPPC_DoubleInsertHighWord32:
-      __ InsertDoubleHigh(i.OutputDoubleRegister(), i.InputRegister(1), r0);
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kPPC_DoubleConstruct:
-#if V8_TARGET_ARCH_PPC64
-      __ MovInt64ComponentsToDouble(i.OutputDoubleRegister(),
-                                    i.InputRegister(0), i.InputRegister(1), r0);
-#else
-      __ MovInt64ToDouble(i.OutputDoubleRegister(), i.InputRegister(0),
-                          i.InputRegister(1));
-#endif
-      DCHECK_EQ(LeaveRC, i.OutputRCBit());
-      break;
-    case kPPC_BitcastFloat32ToInt32:
-      __ MovFloatToInt(i.OutputRegister(), i.InputDoubleRegister(0));
-      break;
-    case kPPC_BitcastInt32ToFloat32:
-      __ MovIntToFloat(i.OutputDoubleRegister(), i.InputRegister(0));
-      break;
-#if V8_TARGET_ARCH_PPC64
-    case kPPC_BitcastDoubleToInt64:
-      __ MovDoubleToInt64(i.OutputRegister(), i.InputDoubleRegister(0));
-      break;
-    case kPPC_BitcastInt64ToDouble:
-      __ MovInt64ToDouble(i.OutputDoubleRegister(), i.InputRegister(0));
-      break;
-#endif
-    case kPPC_LoadWordU8:
-      ASSEMBLE_LOAD_INTEGER(lbz, lbzx);
-      break;
-    case kPPC_LoadWordS8:
-      ASSEMBLE_LOAD_INTEGER(lbz, lbzx);
-      __ extsb(i.OutputRegister(), i.OutputRegister());
-      break;
-    case kPPC_LoadWordU16:
-      ASSEMBLE_LOAD_INTEGER(lhz, lhzx);
-      break;
-    case kPPC_LoadWordS16:
-      ASSEMBLE_LOAD_INTEGER(lha, lhax);
-      break;
-    case kPPC_LoadWordU32:
-      ASSEMBLE_LOAD_INTEGER(lwz, lwzx);
-      break;
-    case kPPC_LoadWordS32:
-      ASSEMBLE_LOAD_INTEGER(lwa, lwax);
-      break;
-#if V8_TARGET_ARCH_PPC64
-    case kPPC_LoadWord64:
-      ASSEMBLE_LOAD_INTEGER(ld, ldx);
-      break;
-#endif
-    case kPPC_LoadFloat32:
-      ASSEMBLE_LOAD_FLOAT(lfs, lfsx);
-      break;
-    case kPPC_LoadDouble:
-      ASSEMBLE_LOAD_FLOAT(lfd, lfdx);
-      break;
-    case kPPC_StoreWord8:
-      ASSEMBLE_STORE_INTEGER(stb, stbx);
-      break;
-    case kPPC_StoreWord16:
-      ASSEMBLE_STORE_INTEGER(sth, sthx);
-      break;
-    case kPPC_StoreWord32:
-      ASSEMBLE_STORE_INTEGER(stw, stwx);
-      break;
-#if V8_TARGET_ARCH_PPC64
-    case kPPC_StoreWord64:
-      ASSEMBLE_STORE_INTEGER(std, stdx);
-      break;
-#endif
-    case kPPC_StoreFloat32:
-      ASSEMBLE_STORE_FLOAT32();
-      break;
-    case kPPC_StoreDouble:
-      ASSEMBLE_STORE_DOUBLE();
-      break;
-    case kAtomicLoadInt8:
-      ASSEMBLE_ATOMIC_LOAD_INTEGER(lbz, lbzx);
-      __ extsb(i.OutputRegister(), i.OutputRegister());
-      break;
-    case kAtomicLoadUint8:
-      ASSEMBLE_ATOMIC_LOAD_INTEGER(lbz, lbzx);
-      break;
-    case kAtomicLoadInt16:
-      ASSEMBLE_ATOMIC_LOAD_INTEGER(lha, lhax);
-      break;
-    case kAtomicLoadUint16:
-      ASSEMBLE_ATOMIC_LOAD_INTEGER(lhz, lhzx);
-      break;
-    case kAtomicLoadWord32:
-      ASSEMBLE_ATOMIC_LOAD_INTEGER(lwz, lwzx);
-      break;
-
-    case kAtomicStoreWord8:
-      ASSEMBLE_ATOMIC_STORE_INTEGER(stb, stbx);
-      break;
-    case kAtomicStoreWord16:
-      ASSEMBLE_ATOMIC_STORE_INTEGER(sth, sthx);
-      break;
-    case kAtomicStoreWord32:
-      ASSEMBLE_ATOMIC_STORE_INTEGER(stw, stwx);
-      break;
-    case kAtomicExchangeInt8:
-      ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(lbarx, stbcx);
-      __ extsb(i.OutputRegister(0), i.OutputRegister(0));
-      break;
-    case kAtomicExchangeUint8:
-      ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(lbarx, stbcx);
-      break;
-    case kAtomicExchangeInt16:
-      ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(lharx, sthcx);
-      __ extsh(i.OutputRegister(0), i.OutputRegister(0));
-      break;
-    case kAtomicExchangeUint16:
-      ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(lharx, sthcx);
-      break;
-    case kAtomicExchangeWord32:
-      ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(lwarx, stwcx);
-      break;
-    default:
-      UNREACHABLE();
-      break;
-  }
-  return kSuccess;
-}  // NOLINT(readability/fn_size)
-
-
-// Assembles branches after an instruction.
-void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) {
-  PPCOperandConverter i(this, instr);
-  Label* tlabel = branch->true_label;
-  Label* flabel = branch->false_label;
-  ArchOpcode op = instr->arch_opcode();
-  FlagsCondition condition = branch->condition;
-  CRegister cr = cr0;
-
-  Condition cond = FlagsConditionToCondition(condition, op);
-  if (op == kPPC_CmpDouble) {
-    // check for unordered if necessary
-    if (cond == le) {
-      __ bunordered(flabel, cr);
-      // Unnecessary for eq/lt since only FU bit will be set.
-    } else if (cond == gt) {
-      __ bunordered(tlabel, cr);
-      // Unnecessary for ne/ge since only FU bit will be set.
-    }
-  }
-  __ b(cond, tlabel, cr);
-  if (!branch->fallthru) __ b(flabel);  // no fallthru to flabel.
-}
-
-void CodeGenerator::AssembleArchDeoptBranch(Instruction* instr,
-                                            BranchInfo* branch) {
-  AssembleArchBranch(instr, branch);
-}
-
-void CodeGenerator::AssembleArchJump(RpoNumber target) {
-  if (!IsNextInAssemblyOrder(target)) __ b(GetLabel(target));
-}
-
-void CodeGenerator::AssembleArchTrap(Instruction* instr,
-                                     FlagsCondition condition) {
-  class OutOfLineTrap final : public OutOfLineCode {
-   public:
-    OutOfLineTrap(CodeGenerator* gen, bool frame_elided, Instruction* instr)
-        : OutOfLineCode(gen),
-          frame_elided_(frame_elided),
-          instr_(instr),
-          gen_(gen) {}
-
-    void Generate() final {
-      PPCOperandConverter i(gen_, instr_);
-
-      Builtins::Name trap_id =
-          static_cast<Builtins::Name>(i.InputInt32(instr_->InputCount() - 1));
-      bool old_has_frame = __ has_frame();
-      if (frame_elided_) {
-        __ set_has_frame(true);
-        __ EnterFrame(StackFrame::WASM_COMPILED, true);
-      }
-      GenerateCallToTrap(trap_id);
-      if (frame_elided_) {
-        __ set_has_frame(old_has_frame);
-      }
-    }
-
-   private:
-    void GenerateCallToTrap(Builtins::Name trap_id) {
-      if (trap_id == Builtins::builtin_count) {
-        // We cannot test calls to the runtime in cctest/test-run-wasm.
-        // Therefore we emit a call to C here instead of a call to the runtime.
-        // We use the context register as the scratch register, because we do
-        // not have a context here.
-        __ PrepareCallCFunction(0, 0, cp);
-        __ CallCFunction(ExternalReference::wasm_call_trap_callback_for_testing(
-                             __ isolate()),
-                         0);
-        __ LeaveFrame(StackFrame::WASM_COMPILED);
-        CallDescriptor* descriptor = gen_->linkage()->GetIncomingDescriptor();
-        int pop_count = static_cast<int>(descriptor->StackParameterCount());
-        __ Drop(pop_count);
-        __ Ret();
-      } else {
-        gen_->AssembleSourcePosition(instr_);
-        __ Call(__ isolate()->builtins()->builtin_handle(trap_id),
-                RelocInfo::CODE_TARGET);
-        ReferenceMap* reference_map =
-            new (gen_->zone()) ReferenceMap(gen_->zone());
-        gen_->RecordSafepoint(reference_map, Safepoint::kSimple, 0,
-                              Safepoint::kNoLazyDeopt);
-        if (FLAG_debug_code) {
-          __ stop(GetAbortReason(AbortReason::kUnexpectedReturnFromWasmTrap));
-        }
-      }
-    }
-
-    bool frame_elided_;
-    Instruction* instr_;
-    CodeGenerator* gen_;
-  };
-  bool frame_elided = !frame_access_state()->has_frame();
-  auto ool = new (zone()) OutOfLineTrap(this, frame_elided, instr);
-  Label* tlabel = ool->entry();
-  Label end;
-
-  ArchOpcode op = instr->arch_opcode();
-  CRegister cr = cr0;
-  Condition cond = FlagsConditionToCondition(condition, op);
-  if (op == kPPC_CmpDouble) {
-    // check for unordered if necessary
-    if (cond == le) {
-      __ bunordered(&end, cr);
-      // Unnecessary for eq/lt since only FU bit will be set.
-    } else if (cond == gt) {
-      __ bunordered(tlabel, cr);
-      // Unnecessary for ne/ge since only FU bit will be set.
-    }
-  }
-  __ b(cond, tlabel, cr);
-  __ bind(&end);
-}
-
-// Assembles boolean materializations after an instruction.
-void CodeGenerator::AssembleArchBoolean(Instruction* instr,
-                                        FlagsCondition condition) {
-  PPCOperandConverter i(this, instr);
-  Label done;
-  ArchOpcode op = instr->arch_opcode();
-  CRegister cr = cr0;
-  int reg_value = -1;
-
-  // Materialize a full 32-bit 1 or 0 value. The result register is always the
-  // last output of the instruction.
-  DCHECK_NE(0u, instr->OutputCount());
-  Register reg = i.OutputRegister(instr->OutputCount() - 1);
-
-  Condition cond = FlagsConditionToCondition(condition, op);
-  if (op == kPPC_CmpDouble) {
-    // check for unordered if necessary
-    if (cond == le) {
-      reg_value = 0;
-      __ li(reg, Operand::Zero());
-      __ bunordered(&done, cr);
-    } else if (cond == gt) {
-      reg_value = 1;
-      __ li(reg, Operand(1));
-      __ bunordered(&done, cr);
-    }
-    // Unnecessary for eq/lt & ne/ge since only FU bit will be set.
-  }
-
-  if (CpuFeatures::IsSupported(ISELECT)) {
-    switch (cond) {
-      case eq:
-      case lt:
-      case gt:
-        if (reg_value != 1) __ li(reg, Operand(1));
-        __ li(kScratchReg, Operand::Zero());
-        __ isel(cond, reg, reg, kScratchReg, cr);
-        break;
-      case ne:
-      case ge:
-      case le:
-        if (reg_value != 1) __ li(reg, Operand(1));
-        // r0 implies logical zero in this form
-        __ isel(NegateCondition(cond), reg, r0, reg, cr);
-        break;
-    default:
-      UNREACHABLE();
-      break;
-    }
-  } else {
-    if (reg_value != 0) __ li(reg, Operand::Zero());
-    __ b(NegateCondition(cond), &done, cr);
-    __ li(reg, Operand(1));
-  }
-  __ bind(&done);
-}
-
-
-void CodeGenerator::AssembleArchLookupSwitch(Instruction* instr) {
-  PPCOperandConverter i(this, instr);
-  Register input = i.InputRegister(0);
-  for (size_t index = 2; index < instr->InputCount(); index += 2) {
-    __ Cmpwi(input, Operand(i.InputInt32(index + 0)), r0);
-    __ beq(GetLabel(i.InputRpo(index + 1)));
-  }
-  AssembleArchJump(i.InputRpo(1));
-}
-
-
-void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) {
-  PPCOperandConverter i(this, instr);
-  Register input = i.InputRegister(0);
-  int32_t const case_count = static_cast<int32_t>(instr->InputCount() - 2);
-  Label** cases = zone()->NewArray<Label*>(case_count);
-  for (int32_t index = 0; index < case_count; ++index) {
-    cases[index] = GetLabel(i.InputRpo(index + 2));
-  }
-  Label* const table = AddJumpTable(cases, case_count);
-  __ Cmpli(input, Operand(case_count), r0);
-  __ bge(GetLabel(i.InputRpo(1)));
-  __ mov_label_addr(kScratchReg, table);
-  __ ShiftLeftImm(r0, input, Operand(kPointerSizeLog2));
-  __ LoadPX(kScratchReg, MemOperand(kScratchReg, r0));
-  __ Jump(kScratchReg);
-}
-
-void CodeGenerator::FinishFrame(Frame* frame) {
-  CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
-  const RegList double_saves = descriptor->CalleeSavedFPRegisters();
-
-  // Save callee-saved Double registers.
-  if (double_saves != 0) {
-    frame->AlignSavedCalleeRegisterSlots();
-    DCHECK_EQ(kNumCalleeSavedDoubles,
-              base::bits::CountPopulation(double_saves));
-    frame->AllocateSavedCalleeRegisterSlots(kNumCalleeSavedDoubles *
-                                             (kDoubleSize / kPointerSize));
-  }
-  // Save callee-saved registers.
-  const RegList saves =
-      FLAG_enable_embedded_constant_pool
-          ? descriptor->CalleeSavedRegisters() & ~kConstantPoolRegister.bit()
-          : descriptor->CalleeSavedRegisters();
-  if (saves != 0) {
-    // register save area does not include the fp or constant pool pointer.
-    const int num_saves =
-        kNumCalleeSaved - 1 - (FLAG_enable_embedded_constant_pool ? 1 : 0);
-    DCHECK(num_saves == base::bits::CountPopulation(saves));
-    frame->AllocateSavedCalleeRegisterSlots(num_saves);
-  }
-}
-
-void CodeGenerator::AssembleConstructFrame() {
-  CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
-  if (frame_access_state()->has_frame()) {
-    if (descriptor->IsCFunctionCall()) {
-      __ function_descriptor();
-      __ mflr(r0);
-      if (FLAG_enable_embedded_constant_pool) {
-        __ Push(r0, fp, kConstantPoolRegister);
-        // Adjust FP to point to saved FP.
-        __ subi(fp, sp, Operand(StandardFrameConstants::kConstantPoolOffset));
-      } else {
-        __ Push(r0, fp);
-        __ mr(fp, sp);
-      }
-    } else if (descriptor->IsJSFunctionCall()) {
-      __ Prologue(ip);
-      if (descriptor->PushArgumentCount()) {
-        __ Push(kJavaScriptCallArgCountRegister);
-      }
-    } else {
-      StackFrame::Type type = info()->GetOutputStackFrameType();
-      // TODO(mbrandy): Detect cases where ip is the entrypoint (for
-      // efficient intialization of the constant pool pointer register).
-      __ StubPrologue(type);
-    }
-  }
-
-  int shrink_slots =
-      frame()->GetTotalFrameSlotCount() - descriptor->CalculateFixedFrameSize();
-  if (info()->is_osr()) {
-    // TurboFan OSR-compiled functions cannot be entered directly.
-    __ Abort(AbortReason::kShouldNotDirectlyEnterOsrFunction);
-
-    // Unoptimized code jumps directly to this entrypoint while the unoptimized
-    // frame is still on the stack. Optimized code uses OSR values directly from
-    // the unoptimized frame. Thus, all that needs to be done is to allocate the
-    // remaining stack slots.
-    if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --");
-    osr_pc_offset_ = __ pc_offset();
-    shrink_slots -= osr_helper()->UnoptimizedFrameSlots();
-  }
-
-  const RegList double_saves = descriptor->CalleeSavedFPRegisters();
-  if (shrink_slots > 0) {
-    __ Add(sp, sp, -shrink_slots * kPointerSize, r0);
-  }
-
-  // Save callee-saved Double registers.
-  if (double_saves != 0) {
-    __ MultiPushDoubles(double_saves);
-    DCHECK_EQ(kNumCalleeSavedDoubles,
-              base::bits::CountPopulation(double_saves));
-  }
-
-  // Save callee-saved registers.
-  const RegList saves =
-      FLAG_enable_embedded_constant_pool
-          ? descriptor->CalleeSavedRegisters() & ~kConstantPoolRegister.bit()
-          : descriptor->CalleeSavedRegisters();
-  if (saves != 0) {
-    __ MultiPush(saves);
-    // register save area does not include the fp or constant pool pointer.
-  }
-}
-
-void CodeGenerator::AssembleReturn(InstructionOperand* pop) {
-  CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
-  int pop_count = static_cast<int>(descriptor->StackParameterCount());
-
-  // Restore registers.
-  const RegList saves =
-      FLAG_enable_embedded_constant_pool
-          ? descriptor->CalleeSavedRegisters() & ~kConstantPoolRegister.bit()
-          : descriptor->CalleeSavedRegisters();
-  if (saves != 0) {
-    __ MultiPop(saves);
-  }
-
-  // Restore double registers.
-  const RegList double_saves = descriptor->CalleeSavedFPRegisters();
-  if (double_saves != 0) {
-    __ MultiPopDoubles(double_saves);
-  }
-  PPCOperandConverter g(this, nullptr);
-
-  if (descriptor->IsCFunctionCall()) {
-    AssembleDeconstructFrame();
-  } else if (frame_access_state()->has_frame()) {
-    // Canonicalize JSFunction return sites for now unless they have an variable
-    // number of stack slot pops
-    if (pop->IsImmediate() && g.ToConstant(pop).ToInt32() == 0) {
-      if (return_label_.is_bound()) {
-        __ b(&return_label_);
-        return;
-      } else {
-        __ bind(&return_label_);
-        AssembleDeconstructFrame();
-      }
-    } else {
-      AssembleDeconstructFrame();
-    }
-  }
-  // Constant pool is unavailable since the frame has been destructed
-  ConstantPoolUnavailableScope constant_pool_unavailable(tasm());
-  if (pop->IsImmediate()) {
-    DCHECK_EQ(Constant::kInt32, g.ToConstant(pop).type());
-    pop_count += g.ToConstant(pop).ToInt32();
-  } else {
-    __ Drop(g.ToRegister(pop));
-  }
-  __ Drop(pop_count);
-  __ Ret();
-}
-
-void CodeGenerator::FinishCode() { __ EmitConstantPool(); }
-
-void CodeGenerator::AssembleMove(InstructionOperand* source,
-                                 InstructionOperand* destination) {
-  PPCOperandConverter g(this, nullptr);
-  // Dispatch on the source and destination operand kinds.  Not all
-  // combinations are possible.
-  if (source->IsRegister()) {
-    DCHECK(destination->IsRegister() || destination->IsStackSlot());
-    Register src = g.ToRegister(source);
-    if (destination->IsRegister()) {
-      __ Move(g.ToRegister(destination), src);
-    } else {
-      __ StoreP(src, g.ToMemOperand(destination), r0);
-    }
-  } else if (source->IsStackSlot()) {
-    DCHECK(destination->IsRegister() || destination->IsStackSlot());
-    MemOperand src = g.ToMemOperand(source);
-    if (destination->IsRegister()) {
-      __ LoadP(g.ToRegister(destination), src, r0);
-    } else {
-      Register temp = kScratchReg;
-      __ LoadP(temp, src, r0);
-      __ StoreP(temp, g.ToMemOperand(destination), r0);
-    }
-  } else if (source->IsConstant()) {
-    Constant src = g.ToConstant(source);
-    if (destination->IsRegister() || destination->IsStackSlot()) {
-      Register dst =
-          destination->IsRegister() ? g.ToRegister(destination) : kScratchReg;
-      switch (src.type()) {
-        case Constant::kInt32:
-#if V8_TARGET_ARCH_PPC64
-          if (RelocInfo::IsWasmSizeReference(src.rmode())) {
-#else
-          if (RelocInfo::IsWasmReference(src.rmode())) {
-#endif
-            __ mov(dst, Operand(src.ToInt32(), src.rmode()));
-          } else {
-            __ mov(dst, Operand(src.ToInt32()));
-          }
-          break;
-        case Constant::kInt64:
-#if V8_TARGET_ARCH_PPC64
-          if (RelocInfo::IsWasmPtrReference(src.rmode())) {
-            __ mov(dst, Operand(src.ToInt64(), src.rmode()));
-          } else {
-            DCHECK(!RelocInfo::IsWasmSizeReference(src.rmode()));
-#endif
-            __ mov(dst, Operand(src.ToInt64()));
-#if V8_TARGET_ARCH_PPC64
-          }
-#endif
-          break;
-        case Constant::kFloat32:
-          __ mov(dst, Operand::EmbeddedNumber(src.ToFloat32()));
-          break;
-        case Constant::kFloat64:
-          __ mov(dst, Operand::EmbeddedNumber(src.ToFloat64().value()));
-          break;
-        case Constant::kExternalReference:
-          __ mov(dst, Operand(src.ToExternalReference()));
-          break;
-        case Constant::kHeapObject: {
-          Handle<HeapObject> src_object = src.ToHeapObject();
-          Heap::RootListIndex index;
-          if (IsMaterializableFromRoot(src_object, &index)) {
-            __ LoadRoot(dst, index);
-          } else {
-            __ Move(dst, src_object);
-          }
-          break;
-        }
-        case Constant::kRpoNumber:
-          UNREACHABLE();  // TODO(dcarney): loading RPO constants on PPC.
-          break;
-      }
-      if (destination->IsStackSlot()) {
-        __ StoreP(dst, g.ToMemOperand(destination), r0);
-      }
-    } else {
-      DoubleRegister dst = destination->IsFPRegister()
-                               ? g.ToDoubleRegister(destination)
-                               : kScratchDoubleReg;
-      Double value;
-#if V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64
-      // casting double precision snan to single precision
-      // converts it to qnan on ia32/x64
-      if (src.type() == Constant::kFloat32) {
-        uint32_t val = src.ToFloat32AsInt();
-        if ((val & 0x7F800000) == 0x7F800000) {
-          uint64_t dval = static_cast<uint64_t>(val);
-          dval = ((dval & 0xC0000000) << 32) | ((dval & 0x40000000) << 31) |
-                 ((dval & 0x40000000) << 30) | ((dval & 0x7FFFFFFF) << 29);
-          value = Double(dval);
-        } else {
-          value = Double(static_cast<double>(src.ToFloat32()));
-        }
-      } else {
-        value = Double(src.ToFloat64());
-      }
-#else
-      value = src.type() == Constant::kFloat32
-                  ? Double(static_cast<double>(src.ToFloat32()))
-                  : Double(src.ToFloat64());
-#endif
-      __ LoadDoubleLiteral(dst, value, kScratchReg);
-      if (destination->IsDoubleStackSlot()) {
-        __ StoreDouble(dst, g.ToMemOperand(destination), r0);
-      } else if (destination->IsFloatStackSlot()) {
-        __ StoreSingle(dst, g.ToMemOperand(destination), r0);
-      }
-    }
-  } else if (source->IsFPRegister()) {
-    DoubleRegister src = g.ToDoubleRegister(source);
-    if (destination->IsFPRegister()) {
-      DoubleRegister dst = g.ToDoubleRegister(destination);
-      __ Move(dst, src);
-    } else {
-      DCHECK(destination->IsFPStackSlot());
-      LocationOperand* op = LocationOperand::cast(source);
-      if (op->representation() == MachineRepresentation::kFloat64) {
-        __ StoreDouble(src, g.ToMemOperand(destination), r0);
-      } else {
-        __ StoreSingle(src, g.ToMemOperand(destination), r0);
-      }
-    }
-  } else if (source->IsFPStackSlot()) {
-    DCHECK(destination->IsFPRegister() || destination->IsFPStackSlot());
-    MemOperand src = g.ToMemOperand(source);
-    if (destination->IsFPRegister()) {
-      LocationOperand* op = LocationOperand::cast(source);
-      if (op->representation() == MachineRepresentation::kFloat64) {
-        __ LoadDouble(g.ToDoubleRegister(destination), src, r0);
-      } else {
-        __ LoadSingle(g.ToDoubleRegister(destination), src, r0);
-      }
-    } else {
-      LocationOperand* op = LocationOperand::cast(source);
-      DoubleRegister temp = kScratchDoubleReg;
-      if (op->representation() == MachineRepresentation::kFloat64) {
-        __ LoadDouble(temp, src, r0);
-        __ StoreDouble(temp, g.ToMemOperand(destination), r0);
-      } else {
-        __ LoadSingle(temp, src, r0);
-        __ StoreSingle(temp, g.ToMemOperand(destination), r0);
-      }
-    }
-  } else {
-    UNREACHABLE();
-  }
-}
-
-// Swaping contents in source and destination.
-// source and destination could be:
-//   Register,
-//   FloatRegister,
-//   DoubleRegister,
-//   StackSlot,
-//   FloatStackSlot,
-//   or DoubleStackSlot
-void CodeGenerator::AssembleSwap(InstructionOperand* source,
-                                 InstructionOperand* destination) {
-  PPCOperandConverter g(this, nullptr);
-  if (source->IsRegister()) {
-    Register src = g.ToRegister(source);
-    if (destination->IsRegister()) {
-      __ SwapP(src, g.ToRegister(destination), kScratchReg);
-    } else {
-      DCHECK(destination->IsStackSlot());
-      __ SwapP(src, g.ToMemOperand(destination), kScratchReg);
-    }
-  } else if (source->IsStackSlot()) {
-    DCHECK(destination->IsStackSlot());
-    __ SwapP(g.ToMemOperand(source), g.ToMemOperand(destination), kScratchReg,
-             r0);
-  } else if (source->IsFloatRegister()) {
-    DoubleRegister src = g.ToDoubleRegister(source);
-    if (destination->IsFloatRegister()) {
-      __ SwapFloat32(src, g.ToDoubleRegister(destination), kScratchDoubleReg);
-    } else {
-      DCHECK(destination->IsFloatStackSlot());
-      __ SwapFloat32(src, g.ToMemOperand(destination), kScratchDoubleReg);
-    }
-  } else if (source->IsDoubleRegister()) {
-    DoubleRegister src = g.ToDoubleRegister(source);
-    if (destination->IsDoubleRegister()) {
-      __ SwapDouble(src, g.ToDoubleRegister(destination), kScratchDoubleReg);
-    } else {
-      DCHECK(destination->IsDoubleStackSlot());
-      __ SwapDouble(src, g.ToMemOperand(destination), kScratchDoubleReg);
-    }
-  } else if (source->IsFloatStackSlot()) {
-    DCHECK(destination->IsFloatStackSlot());
-    __ SwapFloat32(g.ToMemOperand(source), g.ToMemOperand(destination),
-                   kScratchDoubleReg, d0);
-  } else if (source->IsDoubleStackSlot()) {
-    DCHECK(destination->IsDoubleStackSlot());
-    __ SwapDouble(g.ToMemOperand(source), g.ToMemOperand(destination),
-                  kScratchDoubleReg, d0);
-  } else if (source->IsSimd128Register()) {
-    UNREACHABLE();
-  } else {
-    UNREACHABLE();
-  }
-
-  return;
-}
-
-
-void CodeGenerator::AssembleJumpTable(Label** targets, size_t target_count) {
-  for (size_t index = 0; index < target_count; ++index) {
-    __ emit_label_addr(targets[index]);
-  }
-}
-
-
-#undef __
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/ppc/instruction-codes-ppc.h b/src/v8/src/compiler/ppc/instruction-codes-ppc.h
deleted file mode 100644
index f68ab3a..0000000
--- a/src/v8/src/compiler/ppc/instruction-codes-ppc.h
+++ /dev/null
@@ -1,150 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_PPC_INSTRUCTION_CODES_PPC_H_
-#define V8_COMPILER_PPC_INSTRUCTION_CODES_PPC_H_
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-// PPC-specific opcodes that specify which assembly sequence to emit.
-// Most opcodes specify a single instruction.
-#define TARGET_ARCH_OPCODE_LIST(V) \
-  V(PPC_And)                       \
-  V(PPC_AndComplement)             \
-  V(PPC_Or)                        \
-  V(PPC_OrComplement)              \
-  V(PPC_Xor)                       \
-  V(PPC_ShiftLeft32)               \
-  V(PPC_ShiftLeft64)               \
-  V(PPC_ShiftLeftPair)             \
-  V(PPC_ShiftRight32)              \
-  V(PPC_ShiftRight64)              \
-  V(PPC_ShiftRightPair)            \
-  V(PPC_ShiftRightAlg32)           \
-  V(PPC_ShiftRightAlg64)           \
-  V(PPC_ShiftRightAlgPair)         \
-  V(PPC_RotRight32)                \
-  V(PPC_RotRight64)                \
-  V(PPC_Not)                       \
-  V(PPC_RotLeftAndMask32)          \
-  V(PPC_RotLeftAndClear64)         \
-  V(PPC_RotLeftAndClearLeft64)     \
-  V(PPC_RotLeftAndClearRight64)    \
-  V(PPC_Add32)                     \
-  V(PPC_Add64)                     \
-  V(PPC_AddWithOverflow32)         \
-  V(PPC_AddPair)                   \
-  V(PPC_AddDouble)                 \
-  V(PPC_Sub)                       \
-  V(PPC_SubWithOverflow32)         \
-  V(PPC_SubPair)                   \
-  V(PPC_SubDouble)                 \
-  V(PPC_Mul32)                     \
-  V(PPC_Mul32WithHigh32)           \
-  V(PPC_Mul64)                     \
-  V(PPC_MulHigh32)                 \
-  V(PPC_MulHighU32)                \
-  V(PPC_MulPair)                   \
-  V(PPC_MulDouble)                 \
-  V(PPC_Div32)                     \
-  V(PPC_Div64)                     \
-  V(PPC_DivU32)                    \
-  V(PPC_DivU64)                    \
-  V(PPC_DivDouble)                 \
-  V(PPC_Mod32)                     \
-  V(PPC_Mod64)                     \
-  V(PPC_ModU32)                    \
-  V(PPC_ModU64)                    \
-  V(PPC_ModDouble)                 \
-  V(PPC_Neg)                       \
-  V(PPC_NegDouble)                 \
-  V(PPC_SqrtDouble)                \
-  V(PPC_FloorDouble)               \
-  V(PPC_CeilDouble)                \
-  V(PPC_TruncateDouble)            \
-  V(PPC_RoundDouble)               \
-  V(PPC_MaxDouble)                 \
-  V(PPC_MinDouble)                 \
-  V(PPC_AbsDouble)                 \
-  V(PPC_Cntlz32)                   \
-  V(PPC_Cntlz64)                   \
-  V(PPC_Popcnt32)                  \
-  V(PPC_Popcnt64)                  \
-  V(PPC_Cmp32)                     \
-  V(PPC_Cmp64)                     \
-  V(PPC_CmpDouble)                 \
-  V(PPC_Tst32)                     \
-  V(PPC_Tst64)                     \
-  V(PPC_Push)                      \
-  V(PPC_PushFrame)                 \
-  V(PPC_StoreToStackSlot)          \
-  V(PPC_ExtendSignWord8)           \
-  V(PPC_ExtendSignWord16)          \
-  V(PPC_ExtendSignWord32)          \
-  V(PPC_Uint32ToUint64)            \
-  V(PPC_Int64ToInt32)              \
-  V(PPC_Int64ToFloat32)            \
-  V(PPC_Int64ToDouble)             \
-  V(PPC_Uint64ToFloat32)           \
-  V(PPC_Uint64ToDouble)            \
-  V(PPC_Int32ToFloat32)            \
-  V(PPC_Int32ToDouble)             \
-  V(PPC_Uint32ToFloat32)           \
-  V(PPC_Uint32ToDouble)            \
-  V(PPC_Float32ToDouble)           \
-  V(PPC_Float64SilenceNaN)         \
-  V(PPC_DoubleToInt32)             \
-  V(PPC_DoubleToUint32)            \
-  V(PPC_DoubleToInt64)             \
-  V(PPC_DoubleToUint64)            \
-  V(PPC_DoubleToFloat32)           \
-  V(PPC_DoubleExtractLowWord32)    \
-  V(PPC_DoubleExtractHighWord32)   \
-  V(PPC_DoubleInsertLowWord32)     \
-  V(PPC_DoubleInsertHighWord32)    \
-  V(PPC_DoubleConstruct)           \
-  V(PPC_BitcastInt32ToFloat32)     \
-  V(PPC_BitcastFloat32ToInt32)     \
-  V(PPC_BitcastInt64ToDouble)      \
-  V(PPC_BitcastDoubleToInt64)      \
-  V(PPC_LoadWordS8)                \
-  V(PPC_LoadWordU8)                \
-  V(PPC_LoadWordS16)               \
-  V(PPC_LoadWordU16)               \
-  V(PPC_LoadWordS32)               \
-  V(PPC_LoadWordU32)               \
-  V(PPC_LoadWord64)                \
-  V(PPC_LoadFloat32)               \
-  V(PPC_LoadDouble)                \
-  V(PPC_StoreWord8)                \
-  V(PPC_StoreWord16)               \
-  V(PPC_StoreWord32)               \
-  V(PPC_StoreWord64)               \
-  V(PPC_StoreFloat32)              \
-  V(PPC_StoreDouble)
-
-// Addressing modes represent the "shape" of inputs to an instruction.
-// Many instructions support multiple addressing modes. Addressing modes
-// are encoded into the InstructionCode of the instruction and tell the
-// code generator after register allocation which assembler method to call.
-//
-// We use the following local notation for addressing modes:
-//
-// R = register
-// O = register or stack slot
-// D = double register
-// I = immediate (handle, external, int32)
-// MRI = [register + immediate]
-// MRR = [register + register]
-#define TARGET_ADDRESSING_MODE_LIST(V) \
-  V(MRI) /* [%r0 + K] */               \
-  V(MRR) /* [%r0 + %r1] */
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_COMPILER_PPC_INSTRUCTION_CODES_PPC_H_
diff --git a/src/v8/src/compiler/ppc/instruction-scheduler-ppc.cc b/src/v8/src/compiler/ppc/instruction-scheduler-ppc.cc
deleted file mode 100644
index 2b491f1..0000000
--- a/src/v8/src/compiler/ppc/instruction-scheduler-ppc.cc
+++ /dev/null
@@ -1,154 +0,0 @@
-// Copyright 2015 the V8 project 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 "src/compiler/instruction-scheduler.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-bool InstructionScheduler::SchedulerSupported() { return true; }
-
-
-int InstructionScheduler::GetTargetInstructionFlags(
-    const Instruction* instr) const {
-  switch (instr->arch_opcode()) {
-    case kPPC_And:
-    case kPPC_AndComplement:
-    case kPPC_Or:
-    case kPPC_OrComplement:
-    case kPPC_Xor:
-    case kPPC_ShiftLeft32:
-    case kPPC_ShiftLeft64:
-    case kPPC_ShiftLeftPair:
-    case kPPC_ShiftRight32:
-    case kPPC_ShiftRight64:
-    case kPPC_ShiftRightPair:
-    case kPPC_ShiftRightAlg32:
-    case kPPC_ShiftRightAlg64:
-    case kPPC_ShiftRightAlgPair:
-    case kPPC_RotRight32:
-    case kPPC_RotRight64:
-    case kPPC_Not:
-    case kPPC_RotLeftAndMask32:
-    case kPPC_RotLeftAndClear64:
-    case kPPC_RotLeftAndClearLeft64:
-    case kPPC_RotLeftAndClearRight64:
-    case kPPC_Add32:
-    case kPPC_Add64:
-    case kPPC_AddWithOverflow32:
-    case kPPC_AddPair:
-    case kPPC_AddDouble:
-    case kPPC_Sub:
-    case kPPC_SubWithOverflow32:
-    case kPPC_SubPair:
-    case kPPC_SubDouble:
-    case kPPC_Mul32:
-    case kPPC_Mul32WithHigh32:
-    case kPPC_Mul64:
-    case kPPC_MulHigh32:
-    case kPPC_MulHighU32:
-    case kPPC_MulPair:
-    case kPPC_MulDouble:
-    case kPPC_Div32:
-    case kPPC_Div64:
-    case kPPC_DivU32:
-    case kPPC_DivU64:
-    case kPPC_DivDouble:
-    case kPPC_Mod32:
-    case kPPC_Mod64:
-    case kPPC_ModU32:
-    case kPPC_ModU64:
-    case kPPC_ModDouble:
-    case kPPC_Neg:
-    case kPPC_NegDouble:
-    case kPPC_SqrtDouble:
-    case kPPC_FloorDouble:
-    case kPPC_CeilDouble:
-    case kPPC_TruncateDouble:
-    case kPPC_RoundDouble:
-    case kPPC_MaxDouble:
-    case kPPC_MinDouble:
-    case kPPC_AbsDouble:
-    case kPPC_Cntlz32:
-    case kPPC_Cntlz64:
-    case kPPC_Popcnt32:
-    case kPPC_Popcnt64:
-    case kPPC_Cmp32:
-    case kPPC_Cmp64:
-    case kPPC_CmpDouble:
-    case kPPC_Tst32:
-    case kPPC_Tst64:
-    case kPPC_ExtendSignWord8:
-    case kPPC_ExtendSignWord16:
-    case kPPC_ExtendSignWord32:
-    case kPPC_Uint32ToUint64:
-    case kPPC_Int64ToInt32:
-    case kPPC_Int64ToFloat32:
-    case kPPC_Int64ToDouble:
-    case kPPC_Uint64ToFloat32:
-    case kPPC_Uint64ToDouble:
-    case kPPC_Int32ToFloat32:
-    case kPPC_Int32ToDouble:
-    case kPPC_Uint32ToFloat32:
-    case kPPC_Uint32ToDouble:
-    case kPPC_Float32ToDouble:
-    case kPPC_Float64SilenceNaN:
-    case kPPC_DoubleToInt32:
-    case kPPC_DoubleToUint32:
-    case kPPC_DoubleToInt64:
-    case kPPC_DoubleToUint64:
-    case kPPC_DoubleToFloat32:
-    case kPPC_DoubleExtractLowWord32:
-    case kPPC_DoubleExtractHighWord32:
-    case kPPC_DoubleInsertLowWord32:
-    case kPPC_DoubleInsertHighWord32:
-    case kPPC_DoubleConstruct:
-    case kPPC_BitcastInt32ToFloat32:
-    case kPPC_BitcastFloat32ToInt32:
-    case kPPC_BitcastInt64ToDouble:
-    case kPPC_BitcastDoubleToInt64:
-      return kNoOpcodeFlags;
-
-    case kPPC_LoadWordS8:
-    case kPPC_LoadWordU8:
-    case kPPC_LoadWordS16:
-    case kPPC_LoadWordU16:
-    case kPPC_LoadWordS32:
-    case kPPC_LoadWordU32:
-    case kPPC_LoadWord64:
-    case kPPC_LoadFloat32:
-    case kPPC_LoadDouble:
-      return kIsLoadOperation;
-
-    case kPPC_StoreWord8:
-    case kPPC_StoreWord16:
-    case kPPC_StoreWord32:
-    case kPPC_StoreWord64:
-    case kPPC_StoreFloat32:
-    case kPPC_StoreDouble:
-    case kPPC_Push:
-    case kPPC_PushFrame:
-    case kPPC_StoreToStackSlot:
-      return kHasSideEffect;
-
-#define CASE(Name) case k##Name:
-    COMMON_ARCH_OPCODE_LIST(CASE)
-#undef CASE
-      // Already covered in architecture independent code.
-      UNREACHABLE();
-  }
-
-  UNREACHABLE();
-}
-
-
-int InstructionScheduler::GetInstructionLatency(const Instruction* instr) {
-  // TODO(all): Add instruction cost modeling.
-  return 1;
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/ppc/instruction-selector-ppc.cc b/src/v8/src/compiler/ppc/instruction-selector-ppc.cc
deleted file mode 100644
index fced556..0000000
--- a/src/v8/src/compiler/ppc/instruction-selector-ppc.cc
+++ /dev/null
@@ -1,2284 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/base/adapters.h"
-#include "src/compiler/instruction-selector-impl.h"
-#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties.h"
-#include "src/ppc/frame-constants-ppc.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-enum ImmediateMode {
-  kInt16Imm,
-  kInt16Imm_Unsigned,
-  kInt16Imm_Negate,
-  kInt16Imm_4ByteAligned,
-  kShift32Imm,
-  kShift64Imm,
-  kNoImmediate
-};
-
-
-// Adds PPC-specific methods for generating operands.
-class PPCOperandGenerator final : public OperandGenerator {
- public:
-  explicit PPCOperandGenerator(InstructionSelector* selector)
-      : OperandGenerator(selector) {}
-
-  InstructionOperand UseOperand(Node* node, ImmediateMode mode) {
-    if (CanBeImmediate(node, mode)) {
-      return UseImmediate(node);
-    }
-    return UseRegister(node);
-  }
-
-  bool CanBeImmediate(Node* node, ImmediateMode mode) {
-    int64_t value;
-    if (node->opcode() == IrOpcode::kInt32Constant)
-      value = OpParameter<int32_t>(node);
-    else if (node->opcode() == IrOpcode::kInt64Constant)
-      value = OpParameter<int64_t>(node);
-    else
-      return false;
-    return CanBeImmediate(value, mode);
-  }
-
-  bool CanBeImmediate(int64_t value, ImmediateMode mode) {
-    switch (mode) {
-      case kInt16Imm:
-        return is_int16(value);
-      case kInt16Imm_Unsigned:
-        return is_uint16(value);
-      case kInt16Imm_Negate:
-        return is_int16(-value);
-      case kInt16Imm_4ByteAligned:
-        return is_int16(value) && !(value & 3);
-      case kShift32Imm:
-        return 0 <= value && value < 32;
-      case kShift64Imm:
-        return 0 <= value && value < 64;
-      case kNoImmediate:
-        return false;
-    }
-    return false;
-  }
-};
-
-
-namespace {
-
-void VisitRR(InstructionSelector* selector, InstructionCode opcode,
-             Node* node) {
-  PPCOperandGenerator g(selector);
-  selector->Emit(opcode, g.DefineAsRegister(node),
-                 g.UseRegister(node->InputAt(0)));
-}
-
-void VisitRRR(InstructionSelector* selector, InstructionCode opcode,
-              Node* node) {
-  PPCOperandGenerator g(selector);
-  selector->Emit(opcode, g.DefineAsRegister(node),
-                 g.UseRegister(node->InputAt(0)),
-                 g.UseRegister(node->InputAt(1)));
-}
-
-void VisitRRO(InstructionSelector* selector, InstructionCode opcode, Node* node,
-              ImmediateMode operand_mode) {
-  PPCOperandGenerator g(selector);
-  selector->Emit(opcode, g.DefineAsRegister(node),
-                 g.UseRegister(node->InputAt(0)),
-                 g.UseOperand(node->InputAt(1), operand_mode));
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-void VisitTryTruncateDouble(InstructionSelector* selector,
-                            InstructionCode opcode, Node* node) {
-  PPCOperandGenerator g(selector);
-  InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))};
-  InstructionOperand outputs[2];
-  size_t output_count = 0;
-  outputs[output_count++] = g.DefineAsRegister(node);
-
-  Node* success_output = NodeProperties::FindProjection(node, 1);
-  if (success_output) {
-    outputs[output_count++] = g.DefineAsRegister(success_output);
-  }
-
-  selector->Emit(opcode, output_count, outputs, 1, inputs);
-}
-#endif
-
-
-// Shared routine for multiple binary operations.
-template <typename Matcher>
-void VisitBinop(InstructionSelector* selector, Node* node,
-                InstructionCode opcode, ImmediateMode operand_mode,
-                FlagsContinuation* cont) {
-  PPCOperandGenerator g(selector);
-  Matcher m(node);
-  InstructionOperand inputs[4];
-  size_t input_count = 0;
-  InstructionOperand outputs[2];
-  size_t output_count = 0;
-
-  inputs[input_count++] = g.UseRegister(m.left().node());
-  inputs[input_count++] = g.UseOperand(m.right().node(), operand_mode);
-
-  if (cont->IsBranch()) {
-    inputs[input_count++] = g.Label(cont->true_block());
-    inputs[input_count++] = g.Label(cont->false_block());
-  }
-
-  if (cont->IsDeoptimize()) {
-    // If we can deoptimize as a result of the binop, we need to make sure that
-    // the deopt inputs are not overwritten by the binop result. One way
-    // to achieve that is to declare the output register as same-as-first.
-    outputs[output_count++] = g.DefineSameAsFirst(node);
-  } else {
-    outputs[output_count++] = g.DefineAsRegister(node);
-  }
-  if (cont->IsSet()) {
-    outputs[output_count++] = g.DefineAsRegister(cont->result());
-  }
-
-  DCHECK_NE(0u, input_count);
-  DCHECK_NE(0u, output_count);
-  DCHECK_GE(arraysize(inputs), input_count);
-  DCHECK_GE(arraysize(outputs), output_count);
-
-  opcode = cont->Encode(opcode);
-  if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(opcode, output_count, outputs, input_count, inputs,
-                             cont->kind(), cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else if (cont->IsTrap()) {
-    inputs[input_count++] = g.UseImmediate(cont->trap_id());
-    selector->Emit(opcode, output_count, outputs, input_count, inputs);
-  } else {
-    selector->Emit(opcode, output_count, outputs, input_count, inputs);
-  }
-}
-
-
-// Shared routine for multiple binary operations.
-template <typename Matcher>
-void VisitBinop(InstructionSelector* selector, Node* node,
-                InstructionCode opcode, ImmediateMode operand_mode) {
-  FlagsContinuation cont;
-  VisitBinop<Matcher>(selector, node, opcode, operand_mode, &cont);
-}
-
-}  // namespace
-
-void InstructionSelector::VisitStackSlot(Node* node) {
-  StackSlotRepresentation rep = StackSlotRepresentationOf(node->op());
-  int slot = frame_->AllocateSpillSlot(rep.size());
-  OperandGenerator g(this);
-
-  Emit(kArchStackSlot, g.DefineAsRegister(node),
-       sequence()->AddImmediate(Constant(slot)), 0, nullptr);
-}
-
-void InstructionSelector::VisitDebugAbort(Node* node) {
-  PPCOperandGenerator g(this);
-  Emit(kArchDebugAbort, g.NoOutput(), g.UseFixed(node->InputAt(0), r4));
-}
-
-void InstructionSelector::VisitLoad(Node* node) {
-  LoadRepresentation load_rep = LoadRepresentationOf(node->op());
-  PPCOperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* offset = node->InputAt(1);
-  ArchOpcode opcode = kArchNop;
-  ImmediateMode mode = kInt16Imm;
-  switch (load_rep.representation()) {
-    case MachineRepresentation::kFloat32:
-      opcode = kPPC_LoadFloat32;
-      break;
-    case MachineRepresentation::kFloat64:
-      opcode = kPPC_LoadDouble;
-      break;
-    case MachineRepresentation::kBit:  // Fall through.
-    case MachineRepresentation::kWord8:
-      opcode = load_rep.IsSigned() ? kPPC_LoadWordS8 : kPPC_LoadWordU8;
-      break;
-    case MachineRepresentation::kWord16:
-      opcode = load_rep.IsSigned() ? kPPC_LoadWordS16 : kPPC_LoadWordU16;
-      break;
-#if !V8_TARGET_ARCH_PPC64
-    case MachineRepresentation::kTaggedSigned:   // Fall through.
-    case MachineRepresentation::kTaggedPointer:  // Fall through.
-    case MachineRepresentation::kTagged:  // Fall through.
-#endif
-    case MachineRepresentation::kWord32:
-      opcode = kPPC_LoadWordU32;
-      break;
-#if V8_TARGET_ARCH_PPC64
-    case MachineRepresentation::kTaggedSigned:   // Fall through.
-    case MachineRepresentation::kTaggedPointer:  // Fall through.
-    case MachineRepresentation::kTagged:  // Fall through.
-    case MachineRepresentation::kWord64:
-      opcode = kPPC_LoadWord64;
-      mode = kInt16Imm_4ByteAligned;
-      break;
-#else
-    case MachineRepresentation::kWord64:  // Fall through.
-#endif
-    case MachineRepresentation::kSimd128:  // Fall through.
-    case MachineRepresentation::kNone:
-      UNREACHABLE();
-      return;
-  }
-  if (g.CanBeImmediate(offset, mode)) {
-    Emit(opcode | AddressingModeField::encode(kMode_MRI),
-         g.DefineAsRegister(node), g.UseRegister(base), g.UseImmediate(offset));
-  } else if (g.CanBeImmediate(base, mode)) {
-    Emit(opcode | AddressingModeField::encode(kMode_MRI),
-         g.DefineAsRegister(node), g.UseRegister(offset), g.UseImmediate(base));
-  } else {
-    Emit(opcode | AddressingModeField::encode(kMode_MRR),
-         g.DefineAsRegister(node), g.UseRegister(base), g.UseRegister(offset));
-  }
-}
-
-void InstructionSelector::VisitProtectedLoad(Node* node) {
-  // TODO(eholk)
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitStore(Node* node) {
-  PPCOperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* offset = node->InputAt(1);
-  Node* value = node->InputAt(2);
-
-  StoreRepresentation store_rep = StoreRepresentationOf(node->op());
-  WriteBarrierKind write_barrier_kind = store_rep.write_barrier_kind();
-  MachineRepresentation rep = store_rep.representation();
-
-  if (write_barrier_kind != kNoWriteBarrier) {
-    DCHECK(CanBeTaggedPointer(rep));
-    AddressingMode addressing_mode;
-    InstructionOperand inputs[3];
-    size_t input_count = 0;
-    inputs[input_count++] = g.UseUniqueRegister(base);
-    // OutOfLineRecordWrite uses the offset in an 'add' instruction as well as
-    // for the store itself, so we must check compatibility with both.
-    if (g.CanBeImmediate(offset, kInt16Imm)
-#if V8_TARGET_ARCH_PPC64
-        && g.CanBeImmediate(offset, kInt16Imm_4ByteAligned)
-#endif
-            ) {
-      inputs[input_count++] = g.UseImmediate(offset);
-      addressing_mode = kMode_MRI;
-    } else {
-      inputs[input_count++] = g.UseUniqueRegister(offset);
-      addressing_mode = kMode_MRR;
-    }
-    inputs[input_count++] = g.UseUniqueRegister(value);
-    RecordWriteMode record_write_mode = RecordWriteMode::kValueIsAny;
-    switch (write_barrier_kind) {
-      case kNoWriteBarrier:
-        UNREACHABLE();
-        break;
-      case kMapWriteBarrier:
-        record_write_mode = RecordWriteMode::kValueIsMap;
-        break;
-      case kPointerWriteBarrier:
-        record_write_mode = RecordWriteMode::kValueIsPointer;
-        break;
-      case kFullWriteBarrier:
-        record_write_mode = RecordWriteMode::kValueIsAny;
-        break;
-    }
-    InstructionOperand temps[] = {g.TempRegister(), g.TempRegister()};
-    size_t const temp_count = arraysize(temps);
-    InstructionCode code = kArchStoreWithWriteBarrier;
-    code |= AddressingModeField::encode(addressing_mode);
-    code |= MiscField::encode(static_cast<int>(record_write_mode));
-    Emit(code, 0, nullptr, input_count, inputs, temp_count, temps);
-  } else {
-    ArchOpcode opcode = kArchNop;
-    ImmediateMode mode = kInt16Imm;
-    switch (rep) {
-      case MachineRepresentation::kFloat32:
-        opcode = kPPC_StoreFloat32;
-        break;
-      case MachineRepresentation::kFloat64:
-        opcode = kPPC_StoreDouble;
-        break;
-      case MachineRepresentation::kBit:  // Fall through.
-      case MachineRepresentation::kWord8:
-        opcode = kPPC_StoreWord8;
-        break;
-      case MachineRepresentation::kWord16:
-        opcode = kPPC_StoreWord16;
-        break;
-#if !V8_TARGET_ARCH_PPC64
-      case MachineRepresentation::kTaggedSigned:   // Fall through.
-      case MachineRepresentation::kTaggedPointer:  // Fall through.
-      case MachineRepresentation::kTagged:  // Fall through.
-#endif
-      case MachineRepresentation::kWord32:
-        opcode = kPPC_StoreWord32;
-        break;
-#if V8_TARGET_ARCH_PPC64
-      case MachineRepresentation::kTaggedSigned:   // Fall through.
-      case MachineRepresentation::kTaggedPointer:  // Fall through.
-      case MachineRepresentation::kTagged:  // Fall through.
-      case MachineRepresentation::kWord64:
-        opcode = kPPC_StoreWord64;
-        mode = kInt16Imm_4ByteAligned;
-        break;
-#else
-      case MachineRepresentation::kWord64:  // Fall through.
-#endif
-      case MachineRepresentation::kSimd128:  // Fall through.
-      case MachineRepresentation::kNone:
-        UNREACHABLE();
-        return;
-    }
-    if (g.CanBeImmediate(offset, mode)) {
-      Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(),
-           g.UseRegister(base), g.UseImmediate(offset), g.UseRegister(value));
-    } else if (g.CanBeImmediate(base, mode)) {
-      Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(),
-           g.UseRegister(offset), g.UseImmediate(base), g.UseRegister(value));
-    } else {
-      Emit(opcode | AddressingModeField::encode(kMode_MRR), g.NoOutput(),
-           g.UseRegister(base), g.UseRegister(offset), g.UseRegister(value));
-    }
-  }
-}
-
-void InstructionSelector::VisitProtectedStore(Node* node) {
-  // TODO(eholk)
-  UNIMPLEMENTED();
-}
-
-// Architecture supports unaligned access, therefore VisitLoad is used instead
-void InstructionSelector::VisitUnalignedLoad(Node* node) { UNREACHABLE(); }
-
-// Architecture supports unaligned access, therefore VisitStore is used instead
-void InstructionSelector::VisitUnalignedStore(Node* node) { UNREACHABLE(); }
-
-template <typename Matcher>
-static void VisitLogical(InstructionSelector* selector, Node* node, Matcher* m,
-                         ArchOpcode opcode, bool left_can_cover,
-                         bool right_can_cover, ImmediateMode imm_mode) {
-  PPCOperandGenerator g(selector);
-
-  // Map instruction to equivalent operation with inverted right input.
-  ArchOpcode inv_opcode = opcode;
-  switch (opcode) {
-    case kPPC_And:
-      inv_opcode = kPPC_AndComplement;
-      break;
-    case kPPC_Or:
-      inv_opcode = kPPC_OrComplement;
-      break;
-    default:
-      UNREACHABLE();
-  }
-
-  // Select Logical(y, ~x) for Logical(Xor(x, -1), y).
-  if ((m->left().IsWord32Xor() || m->left().IsWord64Xor()) && left_can_cover) {
-    Matcher mleft(m->left().node());
-    if (mleft.right().Is(-1)) {
-      selector->Emit(inv_opcode, g.DefineAsRegister(node),
-                     g.UseRegister(m->right().node()),
-                     g.UseRegister(mleft.left().node()));
-      return;
-    }
-  }
-
-  // Select Logical(x, ~y) for Logical(x, Xor(y, -1)).
-  if ((m->right().IsWord32Xor() || m->right().IsWord64Xor()) &&
-      right_can_cover) {
-    Matcher mright(m->right().node());
-    if (mright.right().Is(-1)) {
-      // TODO(all): support shifted operand on right.
-      selector->Emit(inv_opcode, g.DefineAsRegister(node),
-                     g.UseRegister(m->left().node()),
-                     g.UseRegister(mright.left().node()));
-      return;
-    }
-  }
-
-  VisitBinop<Matcher>(selector, node, opcode, imm_mode);
-}
-
-
-static inline bool IsContiguousMask32(uint32_t value, int* mb, int* me) {
-  int mask_width = base::bits::CountPopulation(value);
-  int mask_msb = base::bits::CountLeadingZeros32(value);
-  int mask_lsb = base::bits::CountTrailingZeros32(value);
-  if ((mask_width == 0) || (mask_msb + mask_width + mask_lsb != 32))
-    return false;
-  *mb = mask_lsb + mask_width - 1;
-  *me = mask_lsb;
-  return true;
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-static inline bool IsContiguousMask64(uint64_t value, int* mb, int* me) {
-  int mask_width = base::bits::CountPopulation(value);
-  int mask_msb = base::bits::CountLeadingZeros64(value);
-  int mask_lsb = base::bits::CountTrailingZeros64(value);
-  if ((mask_width == 0) || (mask_msb + mask_width + mask_lsb != 64))
-    return false;
-  *mb = mask_lsb + mask_width - 1;
-  *me = mask_lsb;
-  return true;
-}
-#endif
-
-
-// TODO(mbrandy): Absorb rotate-right into rlwinm?
-void InstructionSelector::VisitWord32And(Node* node) {
-  PPCOperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  int mb = 0;
-  int me = 0;
-  if (m.right().HasValue() && IsContiguousMask32(m.right().Value(), &mb, &me)) {
-    int sh = 0;
-    Node* left = m.left().node();
-    if ((m.left().IsWord32Shr() || m.left().IsWord32Shl()) &&
-        CanCover(node, left)) {
-      // Try to absorb left/right shift into rlwinm
-      Int32BinopMatcher mleft(m.left().node());
-      if (mleft.right().IsInRange(0, 31)) {
-        left = mleft.left().node();
-        sh = mleft.right().Value();
-        if (m.left().IsWord32Shr()) {
-          // Adjust the mask such that it doesn't include any rotated bits.
-          if (mb > 31 - sh) mb = 31 - sh;
-          sh = (32 - sh) & 0x1F;
-        } else {
-          // Adjust the mask such that it doesn't include any rotated bits.
-          if (me < sh) me = sh;
-        }
-      }
-    }
-    if (mb >= me) {
-      Emit(kPPC_RotLeftAndMask32, g.DefineAsRegister(node), g.UseRegister(left),
-           g.TempImmediate(sh), g.TempImmediate(mb), g.TempImmediate(me));
-      return;
-    }
-  }
-  VisitLogical<Int32BinopMatcher>(
-      this, node, &m, kPPC_And, CanCover(node, m.left().node()),
-      CanCover(node, m.right().node()), kInt16Imm_Unsigned);
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-// TODO(mbrandy): Absorb rotate-right into rldic?
-void InstructionSelector::VisitWord64And(Node* node) {
-  PPCOperandGenerator g(this);
-  Int64BinopMatcher m(node);
-  int mb = 0;
-  int me = 0;
-  if (m.right().HasValue() && IsContiguousMask64(m.right().Value(), &mb, &me)) {
-    int sh = 0;
-    Node* left = m.left().node();
-    if ((m.left().IsWord64Shr() || m.left().IsWord64Shl()) &&
-        CanCover(node, left)) {
-      // Try to absorb left/right shift into rldic
-      Int64BinopMatcher mleft(m.left().node());
-      if (mleft.right().IsInRange(0, 63)) {
-        left = mleft.left().node();
-        sh = mleft.right().Value();
-        if (m.left().IsWord64Shr()) {
-          // Adjust the mask such that it doesn't include any rotated bits.
-          if (mb > 63 - sh) mb = 63 - sh;
-          sh = (64 - sh) & 0x3F;
-        } else {
-          // Adjust the mask such that it doesn't include any rotated bits.
-          if (me < sh) me = sh;
-        }
-      }
-    }
-    if (mb >= me) {
-      bool match = false;
-      ArchOpcode opcode;
-      int mask;
-      if (me == 0) {
-        match = true;
-        opcode = kPPC_RotLeftAndClearLeft64;
-        mask = mb;
-      } else if (mb == 63) {
-        match = true;
-        opcode = kPPC_RotLeftAndClearRight64;
-        mask = me;
-      } else if (sh && me <= sh && m.left().IsWord64Shl()) {
-        match = true;
-        opcode = kPPC_RotLeftAndClear64;
-        mask = mb;
-      }
-      if (match) {
-        Emit(opcode, g.DefineAsRegister(node), g.UseRegister(left),
-             g.TempImmediate(sh), g.TempImmediate(mask));
-        return;
-      }
-    }
-  }
-  VisitLogical<Int64BinopMatcher>(
-      this, node, &m, kPPC_And, CanCover(node, m.left().node()),
-      CanCover(node, m.right().node()), kInt16Imm_Unsigned);
-}
-#endif
-
-
-void InstructionSelector::VisitWord32Or(Node* node) {
-  Int32BinopMatcher m(node);
-  VisitLogical<Int32BinopMatcher>(
-      this, node, &m, kPPC_Or, CanCover(node, m.left().node()),
-      CanCover(node, m.right().node()), kInt16Imm_Unsigned);
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-void InstructionSelector::VisitWord64Or(Node* node) {
-  Int64BinopMatcher m(node);
-  VisitLogical<Int64BinopMatcher>(
-      this, node, &m, kPPC_Or, CanCover(node, m.left().node()),
-      CanCover(node, m.right().node()), kInt16Imm_Unsigned);
-}
-#endif
-
-
-void InstructionSelector::VisitWord32Xor(Node* node) {
-  PPCOperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  if (m.right().Is(-1)) {
-    Emit(kPPC_Not, g.DefineAsRegister(node), g.UseRegister(m.left().node()));
-  } else {
-    VisitBinop<Int32BinopMatcher>(this, node, kPPC_Xor, kInt16Imm_Unsigned);
-  }
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-void InstructionSelector::VisitWord64Xor(Node* node) {
-  PPCOperandGenerator g(this);
-  Int64BinopMatcher m(node);
-  if (m.right().Is(-1)) {
-    Emit(kPPC_Not, g.DefineAsRegister(node), g.UseRegister(m.left().node()));
-  } else {
-    VisitBinop<Int64BinopMatcher>(this, node, kPPC_Xor, kInt16Imm_Unsigned);
-  }
-}
-#endif
-
-
-void InstructionSelector::VisitWord32Shl(Node* node) {
-  PPCOperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  if (m.left().IsWord32And() && m.right().IsInRange(0, 31)) {
-    // Try to absorb logical-and into rlwinm
-    Int32BinopMatcher mleft(m.left().node());
-    int sh = m.right().Value();
-    int mb;
-    int me;
-    if (mleft.right().HasValue() &&
-        IsContiguousMask32(mleft.right().Value() << sh, &mb, &me)) {
-      // Adjust the mask such that it doesn't include any rotated bits.
-      if (me < sh) me = sh;
-      if (mb >= me) {
-        Emit(kPPC_RotLeftAndMask32, g.DefineAsRegister(node),
-             g.UseRegister(mleft.left().node()), g.TempImmediate(sh),
-             g.TempImmediate(mb), g.TempImmediate(me));
-        return;
-      }
-    }
-  }
-  VisitRRO(this, kPPC_ShiftLeft32, node, kShift32Imm);
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-void InstructionSelector::VisitWord64Shl(Node* node) {
-  PPCOperandGenerator g(this);
-  Int64BinopMatcher m(node);
-  // TODO(mbrandy): eliminate left sign extension if right >= 32
-  if (m.left().IsWord64And() && m.right().IsInRange(0, 63)) {
-    // Try to absorb logical-and into rldic
-    Int64BinopMatcher mleft(m.left().node());
-    int sh = m.right().Value();
-    int mb;
-    int me;
-    if (mleft.right().HasValue() &&
-        IsContiguousMask64(mleft.right().Value() << sh, &mb, &me)) {
-      // Adjust the mask such that it doesn't include any rotated bits.
-      if (me < sh) me = sh;
-      if (mb >= me) {
-        bool match = false;
-        ArchOpcode opcode;
-        int mask;
-        if (me == 0) {
-          match = true;
-          opcode = kPPC_RotLeftAndClearLeft64;
-          mask = mb;
-        } else if (mb == 63) {
-          match = true;
-          opcode = kPPC_RotLeftAndClearRight64;
-          mask = me;
-        } else if (sh && me <= sh) {
-          match = true;
-          opcode = kPPC_RotLeftAndClear64;
-          mask = mb;
-        }
-        if (match) {
-          Emit(opcode, g.DefineAsRegister(node),
-               g.UseRegister(mleft.left().node()), g.TempImmediate(sh),
-               g.TempImmediate(mask));
-          return;
-        }
-      }
-    }
-  }
-  VisitRRO(this, kPPC_ShiftLeft64, node, kShift64Imm);
-}
-#endif
-
-
-void InstructionSelector::VisitWord32Shr(Node* node) {
-  PPCOperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  if (m.left().IsWord32And() && m.right().IsInRange(0, 31)) {
-    // Try to absorb logical-and into rlwinm
-    Int32BinopMatcher mleft(m.left().node());
-    int sh = m.right().Value();
-    int mb;
-    int me;
-    if (mleft.right().HasValue() &&
-        IsContiguousMask32((uint32_t)(mleft.right().Value()) >> sh, &mb, &me)) {
-      // Adjust the mask such that it doesn't include any rotated bits.
-      if (mb > 31 - sh) mb = 31 - sh;
-      sh = (32 - sh) & 0x1F;
-      if (mb >= me) {
-        Emit(kPPC_RotLeftAndMask32, g.DefineAsRegister(node),
-             g.UseRegister(mleft.left().node()), g.TempImmediate(sh),
-             g.TempImmediate(mb), g.TempImmediate(me));
-        return;
-      }
-    }
-  }
-  VisitRRO(this, kPPC_ShiftRight32, node, kShift32Imm);
-}
-
-#if V8_TARGET_ARCH_PPC64
-void InstructionSelector::VisitWord64Shr(Node* node) {
-  PPCOperandGenerator g(this);
-  Int64BinopMatcher m(node);
-  if (m.left().IsWord64And() && m.right().IsInRange(0, 63)) {
-    // Try to absorb logical-and into rldic
-    Int64BinopMatcher mleft(m.left().node());
-    int sh = m.right().Value();
-    int mb;
-    int me;
-    if (mleft.right().HasValue() &&
-        IsContiguousMask64((uint64_t)(mleft.right().Value()) >> sh, &mb, &me)) {
-      // Adjust the mask such that it doesn't include any rotated bits.
-      if (mb > 63 - sh) mb = 63 - sh;
-      sh = (64 - sh) & 0x3F;
-      if (mb >= me) {
-        bool match = false;
-        ArchOpcode opcode;
-        int mask;
-        if (me == 0) {
-          match = true;
-          opcode = kPPC_RotLeftAndClearLeft64;
-          mask = mb;
-        } else if (mb == 63) {
-          match = true;
-          opcode = kPPC_RotLeftAndClearRight64;
-          mask = me;
-        }
-        if (match) {
-          Emit(opcode, g.DefineAsRegister(node),
-               g.UseRegister(mleft.left().node()), g.TempImmediate(sh),
-               g.TempImmediate(mask));
-          return;
-        }
-      }
-    }
-  }
-  VisitRRO(this, kPPC_ShiftRight64, node, kShift64Imm);
-}
-#endif
-
-
-void InstructionSelector::VisitWord32Sar(Node* node) {
-  PPCOperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  // Replace with sign extension for (x << K) >> K where K is 16 or 24.
-  if (CanCover(node, m.left().node()) && m.left().IsWord32Shl()) {
-    Int32BinopMatcher mleft(m.left().node());
-    if (mleft.right().Is(16) && m.right().Is(16)) {
-      Emit(kPPC_ExtendSignWord16, g.DefineAsRegister(node),
-           g.UseRegister(mleft.left().node()));
-      return;
-    } else if (mleft.right().Is(24) && m.right().Is(24)) {
-      Emit(kPPC_ExtendSignWord8, g.DefineAsRegister(node),
-           g.UseRegister(mleft.left().node()));
-      return;
-    }
-  }
-  VisitRRO(this, kPPC_ShiftRightAlg32, node, kShift32Imm);
-}
-
-#if !V8_TARGET_ARCH_PPC64
-void VisitPairBinop(InstructionSelector* selector, InstructionCode opcode,
-                    InstructionCode opcode2, Node* node) {
-  PPCOperandGenerator g(selector);
-
-  Node* projection1 = NodeProperties::FindProjection(node, 1);
-  if (projection1) {
-    // We use UseUniqueRegister here to avoid register sharing with the output
-    // registers.
-    InstructionOperand inputs[] = {
-        g.UseRegister(node->InputAt(0)), g.UseUniqueRegister(node->InputAt(1)),
-        g.UseRegister(node->InputAt(2)), g.UseUniqueRegister(node->InputAt(3))};
-
-    InstructionOperand outputs[] = {
-        g.DefineAsRegister(node),
-        g.DefineAsRegister(NodeProperties::FindProjection(node, 1))};
-
-    selector->Emit(opcode, 2, outputs, 4, inputs);
-  } else {
-    // The high word of the result is not used, so we emit the standard 32 bit
-    // instruction.
-    selector->Emit(opcode2, g.DefineSameAsFirst(node),
-                   g.UseRegister(node->InputAt(0)),
-                   g.UseRegister(node->InputAt(2)));
-  }
-}
-
-void InstructionSelector::VisitInt32PairAdd(Node* node) {
-  VisitPairBinop(this, kPPC_AddPair, kPPC_Add32, node);
-}
-
-void InstructionSelector::VisitInt32PairSub(Node* node) {
-  VisitPairBinop(this, kPPC_SubPair, kPPC_Sub, node);
-}
-
-void InstructionSelector::VisitInt32PairMul(Node* node) {
-  PPCOperandGenerator g(this);
-  Node* projection1 = NodeProperties::FindProjection(node, 1);
-  if (projection1) {
-    InstructionOperand inputs[] = {g.UseUniqueRegister(node->InputAt(0)),
-                                   g.UseUniqueRegister(node->InputAt(1)),
-                                   g.UseUniqueRegister(node->InputAt(2)),
-                                   g.UseUniqueRegister(node->InputAt(3))};
-
-    InstructionOperand outputs[] = {
-        g.DefineAsRegister(node),
-        g.DefineAsRegister(NodeProperties::FindProjection(node, 1))};
-
-    InstructionOperand temps[] = {g.TempRegister(), g.TempRegister()};
-
-    Emit(kPPC_MulPair, 2, outputs, 4, inputs, 2, temps);
-  } else {
-    // The high word of the result is not used, so we emit the standard 32 bit
-    // instruction.
-    Emit(kPPC_Mul32, g.DefineSameAsFirst(node), g.UseRegister(node->InputAt(0)),
-         g.UseRegister(node->InputAt(2)));
-  }
-}
-
-namespace {
-// Shared routine for multiple shift operations.
-void VisitPairShift(InstructionSelector* selector, InstructionCode opcode,
-                    Node* node) {
-  PPCOperandGenerator g(selector);
-  // We use g.UseUniqueRegister here to guarantee that there is
-  // no register aliasing of input registers with output registers.
-  Int32Matcher m(node->InputAt(2));
-  InstructionOperand shift_operand;
-  if (m.HasValue()) {
-    shift_operand = g.UseImmediate(m.node());
-  } else {
-    shift_operand = g.UseUniqueRegister(m.node());
-  }
-
-  InstructionOperand inputs[] = {g.UseUniqueRegister(node->InputAt(0)),
-                                 g.UseUniqueRegister(node->InputAt(1)),
-                                 shift_operand};
-
-  Node* projection1 = NodeProperties::FindProjection(node, 1);
-
-  InstructionOperand outputs[2];
-  InstructionOperand temps[1];
-  int32_t output_count = 0;
-  int32_t temp_count = 0;
-
-  outputs[output_count++] = g.DefineAsRegister(node);
-  if (projection1) {
-    outputs[output_count++] = g.DefineAsRegister(projection1);
-  } else {
-    temps[temp_count++] = g.TempRegister();
-  }
-
-  selector->Emit(opcode, output_count, outputs, 3, inputs, temp_count, temps);
-}
-}  // namespace
-
-void InstructionSelector::VisitWord32PairShl(Node* node) {
-  VisitPairShift(this, kPPC_ShiftLeftPair, node);
-}
-
-void InstructionSelector::VisitWord32PairShr(Node* node) {
-  VisitPairShift(this, kPPC_ShiftRightPair, node);
-}
-
-void InstructionSelector::VisitWord32PairSar(Node* node) {
-  VisitPairShift(this, kPPC_ShiftRightAlgPair, node);
-}
-#endif
-
-#if V8_TARGET_ARCH_PPC64
-void InstructionSelector::VisitWord64Sar(Node* node) {
-  PPCOperandGenerator g(this);
-  Int64BinopMatcher m(node);
-  if (CanCover(m.node(), m.left().node()) && m.left().IsLoad() &&
-      m.right().Is(32)) {
-    // Just load and sign-extend the interesting 4 bytes instead. This happens,
-    // for example, when we're loading and untagging SMIs.
-    BaseWithIndexAndDisplacement64Matcher mleft(m.left().node(),
-                                                AddressOption::kAllowAll);
-    if (mleft.matches() && mleft.index() == nullptr) {
-      int64_t offset = 0;
-      Node* displacement = mleft.displacement();
-      if (displacement != nullptr) {
-        Int64Matcher mdisplacement(displacement);
-        DCHECK(mdisplacement.HasValue());
-        offset = mdisplacement.Value();
-      }
-      offset = SmiWordOffset(offset);
-      if (g.CanBeImmediate(offset, kInt16Imm_4ByteAligned)) {
-        Emit(kPPC_LoadWordS32 | AddressingModeField::encode(kMode_MRI),
-             g.DefineAsRegister(node), g.UseRegister(mleft.base()),
-             g.TempImmediate(offset));
-        return;
-      }
-    }
-  }
-  VisitRRO(this, kPPC_ShiftRightAlg64, node, kShift64Imm);
-}
-#endif
-
-
-// TODO(mbrandy): Absorb logical-and into rlwinm?
-void InstructionSelector::VisitWord32Ror(Node* node) {
-  VisitRRO(this, kPPC_RotRight32, node, kShift32Imm);
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-// TODO(mbrandy): Absorb logical-and into rldic?
-void InstructionSelector::VisitWord64Ror(Node* node) {
-  VisitRRO(this, kPPC_RotRight64, node, kShift64Imm);
-}
-#endif
-
-
-void InstructionSelector::VisitWord32Clz(Node* node) {
-  PPCOperandGenerator g(this);
-  Emit(kPPC_Cntlz32, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0)));
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-void InstructionSelector::VisitWord64Clz(Node* node) {
-  PPCOperandGenerator g(this);
-  Emit(kPPC_Cntlz64, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0)));
-}
-#endif
-
-
-void InstructionSelector::VisitWord32Popcnt(Node* node) {
-  PPCOperandGenerator g(this);
-  Emit(kPPC_Popcnt32, g.DefineAsRegister(node),
-       g.UseRegister(node->InputAt(0)));
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-void InstructionSelector::VisitWord64Popcnt(Node* node) {
-  PPCOperandGenerator g(this);
-  Emit(kPPC_Popcnt64, g.DefineAsRegister(node),
-       g.UseRegister(node->InputAt(0)));
-}
-#endif
-
-
-void InstructionSelector::VisitWord32Ctz(Node* node) { UNREACHABLE(); }
-
-
-#if V8_TARGET_ARCH_PPC64
-void InstructionSelector::VisitWord64Ctz(Node* node) { UNREACHABLE(); }
-#endif
-
-
-void InstructionSelector::VisitWord32ReverseBits(Node* node) { UNREACHABLE(); }
-
-
-#if V8_TARGET_ARCH_PPC64
-void InstructionSelector::VisitWord64ReverseBits(Node* node) { UNREACHABLE(); }
-#endif
-
-void InstructionSelector::VisitWord64ReverseBytes(Node* node) { UNREACHABLE(); }
-
-void InstructionSelector::VisitWord32ReverseBytes(Node* node) { UNREACHABLE(); }
-
-void InstructionSelector::VisitSpeculationFence(Node* node) { UNREACHABLE(); }
-
-void InstructionSelector::VisitInt32Add(Node* node) {
-  VisitBinop<Int32BinopMatcher>(this, node, kPPC_Add32, kInt16Imm);
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-void InstructionSelector::VisitInt64Add(Node* node) {
-  VisitBinop<Int64BinopMatcher>(this, node, kPPC_Add64, kInt16Imm);
-}
-#endif
-
-void InstructionSelector::VisitInt32Sub(Node* node) {
-  PPCOperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  if (m.left().Is(0)) {
-    Emit(kPPC_Neg, g.DefineAsRegister(node), g.UseRegister(m.right().node()));
-  } else {
-    VisitBinop<Int32BinopMatcher>(this, node, kPPC_Sub, kInt16Imm_Negate);
-  }
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-void InstructionSelector::VisitInt64Sub(Node* node) {
-  PPCOperandGenerator g(this);
-  Int64BinopMatcher m(node);
-  if (m.left().Is(0)) {
-    Emit(kPPC_Neg, g.DefineAsRegister(node), g.UseRegister(m.right().node()));
-  } else {
-    VisitBinop<Int64BinopMatcher>(this, node, kPPC_Sub, kInt16Imm_Negate);
-  }
-}
-#endif
-
-namespace {
-
-void VisitCompare(InstructionSelector* selector, InstructionCode opcode,
-                  InstructionOperand left, InstructionOperand right,
-                  FlagsContinuation* cont);
-void EmitInt32MulWithOverflow(InstructionSelector* selector, Node* node,
-                              FlagsContinuation* cont) {
-  PPCOperandGenerator g(selector);
-  Int32BinopMatcher m(node);
-  InstructionOperand result_operand = g.DefineAsRegister(node);
-  InstructionOperand high32_operand = g.TempRegister();
-  InstructionOperand temp_operand = g.TempRegister();
-  {
-    InstructionOperand outputs[] = {result_operand, high32_operand};
-    InstructionOperand inputs[] = {g.UseRegister(m.left().node()),
-                                   g.UseRegister(m.right().node())};
-    selector->Emit(kPPC_Mul32WithHigh32, 2, outputs, 2, inputs);
-  }
-  {
-    InstructionOperand shift_31 = g.UseImmediate(31);
-    InstructionOperand outputs[] = {temp_operand};
-    InstructionOperand inputs[] = {result_operand, shift_31};
-    selector->Emit(kPPC_ShiftRightAlg32, 1, outputs, 2, inputs);
-  }
-
-  VisitCompare(selector, kPPC_Cmp32, high32_operand, temp_operand, cont);
-}
-
-}  // namespace
-
-
-void InstructionSelector::VisitInt32Mul(Node* node) {
-  VisitRRR(this, kPPC_Mul32, node);
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-void InstructionSelector::VisitInt64Mul(Node* node) {
-  VisitRRR(this, kPPC_Mul64, node);
-}
-#endif
-
-
-void InstructionSelector::VisitInt32MulHigh(Node* node) {
-  PPCOperandGenerator g(this);
-  Emit(kPPC_MulHigh32, g.DefineAsRegister(node),
-       g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)));
-}
-
-
-void InstructionSelector::VisitUint32MulHigh(Node* node) {
-  PPCOperandGenerator g(this);
-  Emit(kPPC_MulHighU32, g.DefineAsRegister(node),
-       g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)));
-}
-
-
-void InstructionSelector::VisitInt32Div(Node* node) {
-  VisitRRR(this, kPPC_Div32, node);
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-void InstructionSelector::VisitInt64Div(Node* node) {
-  VisitRRR(this, kPPC_Div64, node);
-}
-#endif
-
-
-void InstructionSelector::VisitUint32Div(Node* node) {
-  VisitRRR(this, kPPC_DivU32, node);
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-void InstructionSelector::VisitUint64Div(Node* node) {
-  VisitRRR(this, kPPC_DivU64, node);
-}
-#endif
-
-
-void InstructionSelector::VisitInt32Mod(Node* node) {
-  VisitRRR(this, kPPC_Mod32, node);
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-void InstructionSelector::VisitInt64Mod(Node* node) {
-  VisitRRR(this, kPPC_Mod64, node);
-}
-#endif
-
-
-void InstructionSelector::VisitUint32Mod(Node* node) {
-  VisitRRR(this, kPPC_ModU32, node);
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-void InstructionSelector::VisitUint64Mod(Node* node) {
-  VisitRRR(this, kPPC_ModU64, node);
-}
-#endif
-
-
-void InstructionSelector::VisitChangeFloat32ToFloat64(Node* node) {
-  VisitRR(this, kPPC_Float32ToDouble, node);
-}
-
-
-void InstructionSelector::VisitRoundInt32ToFloat32(Node* node) {
-  VisitRR(this, kPPC_Int32ToFloat32, node);
-}
-
-
-void InstructionSelector::VisitRoundUint32ToFloat32(Node* node) {
-  VisitRR(this, kPPC_Uint32ToFloat32, node);
-}
-
-
-void InstructionSelector::VisitChangeInt32ToFloat64(Node* node) {
-  VisitRR(this, kPPC_Int32ToDouble, node);
-}
-
-
-void InstructionSelector::VisitChangeUint32ToFloat64(Node* node) {
-  VisitRR(this, kPPC_Uint32ToDouble, node);
-}
-
-
-void InstructionSelector::VisitChangeFloat64ToInt32(Node* node) {
-  VisitRR(this, kPPC_DoubleToInt32, node);
-}
-
-
-void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) {
-  VisitRR(this, kPPC_DoubleToUint32, node);
-}
-
-void InstructionSelector::VisitTruncateFloat64ToUint32(Node* node) {
-  VisitRR(this, kPPC_DoubleToUint32, node);
-}
-
-#if V8_TARGET_ARCH_PPC64
-void InstructionSelector::VisitTryTruncateFloat32ToInt64(Node* node) {
-  VisitTryTruncateDouble(this, kPPC_DoubleToInt64, node);
-}
-
-
-void InstructionSelector::VisitTryTruncateFloat64ToInt64(Node* node) {
-  VisitTryTruncateDouble(this, kPPC_DoubleToInt64, node);
-}
-
-
-void InstructionSelector::VisitTryTruncateFloat32ToUint64(Node* node) {
-  VisitTryTruncateDouble(this, kPPC_DoubleToUint64, node);
-}
-
-
-void InstructionSelector::VisitTryTruncateFloat64ToUint64(Node* node) {
-  VisitTryTruncateDouble(this, kPPC_DoubleToUint64, node);
-}
-
-
-void InstructionSelector::VisitChangeInt32ToInt64(Node* node) {
-  // TODO(mbrandy): inspect input to see if nop is appropriate.
-  VisitRR(this, kPPC_ExtendSignWord32, node);
-}
-
-
-void InstructionSelector::VisitChangeUint32ToUint64(Node* node) {
-  // TODO(mbrandy): inspect input to see if nop is appropriate.
-  VisitRR(this, kPPC_Uint32ToUint64, node);
-}
-
-void InstructionSelector::VisitChangeFloat64ToUint64(Node* node) {
-  VisitRR(this, kPPC_DoubleToUint64, node);
-}
-#endif
-
-
-void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) {
-  VisitRR(this, kPPC_DoubleToFloat32, node);
-}
-
-void InstructionSelector::VisitTruncateFloat64ToWord32(Node* node) {
-  VisitRR(this, kArchTruncateDoubleToI, node);
-}
-
-void InstructionSelector::VisitRoundFloat64ToInt32(Node* node) {
-  VisitRR(this, kPPC_DoubleToInt32, node);
-}
-
-
-void InstructionSelector::VisitTruncateFloat32ToInt32(Node* node) {
-  VisitRR(this, kPPC_DoubleToInt32, node);
-}
-
-
-void InstructionSelector::VisitTruncateFloat32ToUint32(Node* node) {
-  VisitRR(this, kPPC_DoubleToUint32, node);
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-void InstructionSelector::VisitTruncateInt64ToInt32(Node* node) {
-  // TODO(mbrandy): inspect input to see if nop is appropriate.
-  VisitRR(this, kPPC_Int64ToInt32, node);
-}
-
-
-void InstructionSelector::VisitRoundInt64ToFloat32(Node* node) {
-  VisitRR(this, kPPC_Int64ToFloat32, node);
-}
-
-
-void InstructionSelector::VisitRoundInt64ToFloat64(Node* node) {
-  VisitRR(this, kPPC_Int64ToDouble, node);
-}
-
-
-void InstructionSelector::VisitRoundUint64ToFloat32(Node* node) {
-  VisitRR(this, kPPC_Uint64ToFloat32, node);
-}
-
-
-void InstructionSelector::VisitRoundUint64ToFloat64(Node* node) {
-  VisitRR(this, kPPC_Uint64ToDouble, node);
-}
-#endif
-
-
-void InstructionSelector::VisitBitcastFloat32ToInt32(Node* node) {
-  VisitRR(this, kPPC_BitcastFloat32ToInt32, node);
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-void InstructionSelector::VisitBitcastFloat64ToInt64(Node* node) {
-  VisitRR(this, kPPC_BitcastDoubleToInt64, node);
-}
-#endif
-
-
-void InstructionSelector::VisitBitcastInt32ToFloat32(Node* node) {
-  VisitRR(this, kPPC_BitcastInt32ToFloat32, node);
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-void InstructionSelector::VisitBitcastInt64ToFloat64(Node* node) {
-  VisitRR(this, kPPC_BitcastInt64ToDouble, node);
-}
-#endif
-
-
-void InstructionSelector::VisitFloat32Add(Node* node) {
-  VisitRRR(this, kPPC_AddDouble | MiscField::encode(1), node);
-}
-
-
-void InstructionSelector::VisitFloat64Add(Node* node) {
-  // TODO(mbrandy): detect multiply-add
-  VisitRRR(this, kPPC_AddDouble, node);
-}
-
-
-void InstructionSelector::VisitFloat32Sub(Node* node) {
-  VisitRRR(this, kPPC_SubDouble | MiscField::encode(1), node);
-}
-
-void InstructionSelector::VisitFloat64Sub(Node* node) {
-  // TODO(mbrandy): detect multiply-subtract
-  VisitRRR(this, kPPC_SubDouble, node);
-}
-
-void InstructionSelector::VisitFloat32Mul(Node* node) {
-  VisitRRR(this, kPPC_MulDouble | MiscField::encode(1), node);
-}
-
-
-void InstructionSelector::VisitFloat64Mul(Node* node) {
-  // TODO(mbrandy): detect negate
-  VisitRRR(this, kPPC_MulDouble, node);
-}
-
-
-void InstructionSelector::VisitFloat32Div(Node* node) {
-  VisitRRR(this, kPPC_DivDouble | MiscField::encode(1), node);
-}
-
-
-void InstructionSelector::VisitFloat64Div(Node* node) {
-  VisitRRR(this, kPPC_DivDouble, node);
-}
-
-
-void InstructionSelector::VisitFloat64Mod(Node* node) {
-  PPCOperandGenerator g(this);
-  Emit(kPPC_ModDouble, g.DefineAsFixed(node, d1),
-       g.UseFixed(node->InputAt(0), d1),
-       g.UseFixed(node->InputAt(1), d2))->MarkAsCall();
-}
-
-void InstructionSelector::VisitFloat32Max(Node* node) {
-  VisitRRR(this, kPPC_MaxDouble | MiscField::encode(1), node);
-}
-
-void InstructionSelector::VisitFloat64Max(Node* node) {
-  VisitRRR(this, kPPC_MaxDouble, node);
-}
-
-
-void InstructionSelector::VisitFloat64SilenceNaN(Node* node) {
-  VisitRR(this, kPPC_Float64SilenceNaN, node);
-}
-
-void InstructionSelector::VisitFloat32Min(Node* node) {
-  VisitRRR(this, kPPC_MinDouble | MiscField::encode(1), node);
-}
-
-void InstructionSelector::VisitFloat64Min(Node* node) {
-  VisitRRR(this, kPPC_MinDouble, node);
-}
-
-
-void InstructionSelector::VisitFloat32Abs(Node* node) {
-  VisitRR(this, kPPC_AbsDouble | MiscField::encode(1), node);
-}
-
-
-void InstructionSelector::VisitFloat64Abs(Node* node) {
-  VisitRR(this, kPPC_AbsDouble, node);
-}
-
-void InstructionSelector::VisitFloat32Sqrt(Node* node) {
-  VisitRR(this, kPPC_SqrtDouble | MiscField::encode(1), node);
-}
-
-void InstructionSelector::VisitFloat64Ieee754Unop(Node* node,
-                                                  InstructionCode opcode) {
-  PPCOperandGenerator g(this);
-  Emit(opcode, g.DefineAsFixed(node, d1), g.UseFixed(node->InputAt(0), d1))
-       ->MarkAsCall();
-}
-
-void InstructionSelector::VisitFloat64Ieee754Binop(Node* node,
-                                                  InstructionCode opcode) {
-  PPCOperandGenerator g(this);
-  Emit(opcode, g.DefineAsFixed(node, d1),
-       g.UseFixed(node->InputAt(0), d1),
-       g.UseFixed(node->InputAt(1), d2))->MarkAsCall();
-}
-
-void InstructionSelector::VisitFloat64Sqrt(Node* node) {
-  VisitRR(this, kPPC_SqrtDouble, node);
-}
-
-
-void InstructionSelector::VisitFloat32RoundDown(Node* node) {
-  VisitRR(this, kPPC_FloorDouble | MiscField::encode(1), node);
-}
-
-
-void InstructionSelector::VisitFloat64RoundDown(Node* node) {
-  VisitRR(this, kPPC_FloorDouble, node);
-}
-
-
-void InstructionSelector::VisitFloat32RoundUp(Node* node) {
-  VisitRR(this, kPPC_CeilDouble | MiscField::encode(1), node);
-}
-
-
-void InstructionSelector::VisitFloat64RoundUp(Node* node) {
-  VisitRR(this, kPPC_CeilDouble, node);
-}
-
-
-void InstructionSelector::VisitFloat32RoundTruncate(Node* node) {
-  VisitRR(this, kPPC_TruncateDouble | MiscField::encode(1), node);
-}
-
-
-void InstructionSelector::VisitFloat64RoundTruncate(Node* node) {
-  VisitRR(this, kPPC_TruncateDouble, node);
-}
-
-
-void InstructionSelector::VisitFloat64RoundTiesAway(Node* node) {
-  VisitRR(this, kPPC_RoundDouble, node);
-}
-
-
-void InstructionSelector::VisitFloat32RoundTiesEven(Node* node) {
-  UNREACHABLE();
-}
-
-
-void InstructionSelector::VisitFloat64RoundTiesEven(Node* node) {
-  UNREACHABLE();
-}
-
-void InstructionSelector::VisitFloat32Neg(Node* node) {
-  VisitRR(this, kPPC_NegDouble, node);
-}
-
-void InstructionSelector::VisitFloat64Neg(Node* node) {
-  VisitRR(this, kPPC_NegDouble, node);
-}
-
-void InstructionSelector::VisitInt32AddWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    return VisitBinop<Int32BinopMatcher>(this, node, kPPC_AddWithOverflow32,
-                                         kInt16Imm, &cont);
-  }
-  FlagsContinuation cont;
-  VisitBinop<Int32BinopMatcher>(this, node, kPPC_AddWithOverflow32, kInt16Imm,
-                                &cont);
-}
-
-
-void InstructionSelector::VisitInt32SubWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    return VisitBinop<Int32BinopMatcher>(this, node, kPPC_SubWithOverflow32,
-                                         kInt16Imm_Negate, &cont);
-  }
-  FlagsContinuation cont;
-  VisitBinop<Int32BinopMatcher>(this, node, kPPC_SubWithOverflow32,
-                                kInt16Imm_Negate, &cont);
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-void InstructionSelector::VisitInt64AddWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    return VisitBinop<Int64BinopMatcher>(this, node, kPPC_Add64, kInt16Imm,
-                                         &cont);
-  }
-  FlagsContinuation cont;
-  VisitBinop<Int64BinopMatcher>(this, node, kPPC_Add64, kInt16Imm, &cont);
-}
-
-
-void InstructionSelector::VisitInt64SubWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    return VisitBinop<Int64BinopMatcher>(this, node, kPPC_Sub, kInt16Imm_Negate,
-                                         &cont);
-  }
-  FlagsContinuation cont;
-  VisitBinop<Int64BinopMatcher>(this, node, kPPC_Sub, kInt16Imm_Negate, &cont);
-}
-#endif
-
-
-static bool CompareLogical(FlagsContinuation* cont) {
-  switch (cont->condition()) {
-    case kUnsignedLessThan:
-    case kUnsignedGreaterThanOrEqual:
-    case kUnsignedLessThanOrEqual:
-    case kUnsignedGreaterThan:
-      return true;
-    default:
-      return false;
-  }
-  UNREACHABLE();
-}
-
-
-namespace {
-
-// Shared routine for multiple compare operations.
-void VisitCompare(InstructionSelector* selector, InstructionCode opcode,
-                  InstructionOperand left, InstructionOperand right,
-                  FlagsContinuation* cont) {
-  PPCOperandGenerator g(selector);
-  opcode = cont->Encode(opcode);
-  if (cont->IsBranch()) {
-    selector->Emit(opcode, g.NoOutput(), left, right,
-                   g.Label(cont->true_block()), g.Label(cont->false_block()));
-  } else if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(opcode, g.NoOutput(), left, right, cont->kind(),
-                             cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else if (cont->IsSet()) {
-    selector->Emit(opcode, g.DefineAsRegister(cont->result()), left, right);
-  } else {
-    DCHECK(cont->IsTrap());
-    selector->Emit(opcode, g.NoOutput(), left, right,
-                   g.UseImmediate(cont->trap_id()));
-  }
-}
-
-
-// Shared routine for multiple word compare operations.
-void VisitWordCompare(InstructionSelector* selector, Node* node,
-                      InstructionCode opcode, FlagsContinuation* cont,
-                      bool commutative, ImmediateMode immediate_mode) {
-  PPCOperandGenerator g(selector);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-
-  // Match immediates on left or right side of comparison.
-  if (g.CanBeImmediate(right, immediate_mode)) {
-    VisitCompare(selector, opcode, g.UseRegister(left), g.UseImmediate(right),
-                 cont);
-  } else if (g.CanBeImmediate(left, immediate_mode)) {
-    if (!commutative) cont->Commute();
-    VisitCompare(selector, opcode, g.UseRegister(right), g.UseImmediate(left),
-                 cont);
-  } else {
-    VisitCompare(selector, opcode, g.UseRegister(left), g.UseRegister(right),
-                 cont);
-  }
-}
-
-
-void VisitWord32Compare(InstructionSelector* selector, Node* node,
-                        FlagsContinuation* cont) {
-  ImmediateMode mode = (CompareLogical(cont) ? kInt16Imm_Unsigned : kInt16Imm);
-  VisitWordCompare(selector, node, kPPC_Cmp32, cont, false, mode);
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-void VisitWord64Compare(InstructionSelector* selector, Node* node,
-                        FlagsContinuation* cont) {
-  ImmediateMode mode = (CompareLogical(cont) ? kInt16Imm_Unsigned : kInt16Imm);
-  VisitWordCompare(selector, node, kPPC_Cmp64, cont, false, mode);
-}
-#endif
-
-
-// Shared routine for multiple float32 compare operations.
-void VisitFloat32Compare(InstructionSelector* selector, Node* node,
-                         FlagsContinuation* cont) {
-  PPCOperandGenerator g(selector);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-  VisitCompare(selector, kPPC_CmpDouble, g.UseRegister(left),
-               g.UseRegister(right), cont);
-}
-
-
-// Shared routine for multiple float64 compare operations.
-void VisitFloat64Compare(InstructionSelector* selector, Node* node,
-                         FlagsContinuation* cont) {
-  PPCOperandGenerator g(selector);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-  VisitCompare(selector, kPPC_CmpDouble, g.UseRegister(left),
-               g.UseRegister(right), cont);
-}
-
-
-// Shared routine for word comparisons against zero.
-void VisitWordCompareZero(InstructionSelector* selector, Node* user,
-                          Node* value, InstructionCode opcode,
-                          FlagsContinuation* cont) {
-  // Try to combine with comparisons against 0 by simply inverting the branch.
-  while (value->opcode() == IrOpcode::kWord32Equal &&
-         selector->CanCover(user, value)) {
-    Int32BinopMatcher m(value);
-    if (!m.right().Is(0)) break;
-
-    user = value;
-    value = m.left().node();
-    cont->Negate();
-  }
-
-  if (selector->CanCover(user, value)) {
-    switch (value->opcode()) {
-      case IrOpcode::kWord32Equal:
-        cont->OverwriteAndNegateIfEqual(kEqual);
-        return VisitWord32Compare(selector, value, cont);
-      case IrOpcode::kInt32LessThan:
-        cont->OverwriteAndNegateIfEqual(kSignedLessThan);
-        return VisitWord32Compare(selector, value, cont);
-      case IrOpcode::kInt32LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kSignedLessThanOrEqual);
-        return VisitWord32Compare(selector, value, cont);
-      case IrOpcode::kUint32LessThan:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThan);
-        return VisitWord32Compare(selector, value, cont);
-      case IrOpcode::kUint32LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
-        return VisitWord32Compare(selector, value, cont);
-#if V8_TARGET_ARCH_PPC64
-      case IrOpcode::kWord64Equal:
-        cont->OverwriteAndNegateIfEqual(kEqual);
-        return VisitWord64Compare(selector, value, cont);
-      case IrOpcode::kInt64LessThan:
-        cont->OverwriteAndNegateIfEqual(kSignedLessThan);
-        return VisitWord64Compare(selector, value, cont);
-      case IrOpcode::kInt64LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kSignedLessThanOrEqual);
-        return VisitWord64Compare(selector, value, cont);
-      case IrOpcode::kUint64LessThan:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThan);
-        return VisitWord64Compare(selector, value, cont);
-      case IrOpcode::kUint64LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
-        return VisitWord64Compare(selector, value, cont);
-#endif
-      case IrOpcode::kFloat32Equal:
-        cont->OverwriteAndNegateIfEqual(kEqual);
-        return VisitFloat32Compare(selector, value, cont);
-      case IrOpcode::kFloat32LessThan:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThan);
-        return VisitFloat32Compare(selector, value, cont);
-      case IrOpcode::kFloat32LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
-        return VisitFloat32Compare(selector, value, cont);
-      case IrOpcode::kFloat64Equal:
-        cont->OverwriteAndNegateIfEqual(kEqual);
-        return VisitFloat64Compare(selector, value, cont);
-      case IrOpcode::kFloat64LessThan:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThan);
-        return VisitFloat64Compare(selector, value, cont);
-      case IrOpcode::kFloat64LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
-        return VisitFloat64Compare(selector, value, cont);
-      case IrOpcode::kProjection:
-        // Check if this is the overflow output projection of an
-        // <Operation>WithOverflow node.
-        if (ProjectionIndexOf(value->op()) == 1u) {
-          // We cannot combine the <Operation>WithOverflow with this branch
-          // unless the 0th projection (the use of the actual value of the
-          // <Operation> is either nullptr, which means there's no use of the
-          // actual value, or was already defined, which means it is scheduled
-          // *AFTER* this branch).
-          Node* const node = value->InputAt(0);
-          Node* const result = NodeProperties::FindProjection(node, 0);
-          if (result == nullptr || selector->IsDefined(result)) {
-            switch (node->opcode()) {
-              case IrOpcode::kInt32AddWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitBinop<Int32BinopMatcher>(
-                    selector, node, kPPC_AddWithOverflow32, kInt16Imm, cont);
-              case IrOpcode::kInt32SubWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitBinop<Int32BinopMatcher>(selector, node,
-                                                     kPPC_SubWithOverflow32,
-                                                     kInt16Imm_Negate, cont);
-              case IrOpcode::kInt32MulWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kNotEqual);
-                return EmitInt32MulWithOverflow(selector, node, cont);
-#if V8_TARGET_ARCH_PPC64
-              case IrOpcode::kInt64AddWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitBinop<Int64BinopMatcher>(selector, node, kPPC_Add64,
-                                                     kInt16Imm, cont);
-              case IrOpcode::kInt64SubWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitBinop<Int64BinopMatcher>(selector, node, kPPC_Sub,
-                                                     kInt16Imm_Negate, cont);
-#endif
-              default:
-                break;
-            }
-          }
-        }
-        break;
-      case IrOpcode::kInt32Sub:
-        return VisitWord32Compare(selector, value, cont);
-      case IrOpcode::kWord32And:
-        // TODO(mbandy): opportunity for rlwinm?
-        return VisitWordCompare(selector, value, kPPC_Tst32, cont, true,
-                                kInt16Imm_Unsigned);
-// TODO(mbrandy): Handle?
-// case IrOpcode::kInt32Add:
-// case IrOpcode::kWord32Or:
-// case IrOpcode::kWord32Xor:
-// case IrOpcode::kWord32Sar:
-// case IrOpcode::kWord32Shl:
-// case IrOpcode::kWord32Shr:
-// case IrOpcode::kWord32Ror:
-#if V8_TARGET_ARCH_PPC64
-      case IrOpcode::kInt64Sub:
-        return VisitWord64Compare(selector, value, cont);
-      case IrOpcode::kWord64And:
-        // TODO(mbandy): opportunity for rldic?
-        return VisitWordCompare(selector, value, kPPC_Tst64, cont, true,
-                                kInt16Imm_Unsigned);
-// TODO(mbrandy): Handle?
-// case IrOpcode::kInt64Add:
-// case IrOpcode::kWord64Or:
-// case IrOpcode::kWord64Xor:
-// case IrOpcode::kWord64Sar:
-// case IrOpcode::kWord64Shl:
-// case IrOpcode::kWord64Shr:
-// case IrOpcode::kWord64Ror:
-#endif
-      default:
-        break;
-    }
-  }
-
-  // Branch could not be combined with a compare, emit compare against 0.
-  PPCOperandGenerator g(selector);
-  VisitCompare(selector, opcode, g.UseRegister(value), g.TempImmediate(0),
-               cont);
-}
-
-
-void VisitWord32CompareZero(InstructionSelector* selector, Node* user,
-                            Node* value, FlagsContinuation* cont) {
-  VisitWordCompareZero(selector, user, value, kPPC_Cmp32, cont);
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-void VisitWord64CompareZero(InstructionSelector* selector, Node* user,
-                            Node* value, FlagsContinuation* cont) {
-  VisitWordCompareZero(selector, user, value, kPPC_Cmp64, cont);
-}
-#endif
-
-}  // namespace
-
-
-void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch,
-                                      BasicBlock* fbranch) {
-  FlagsContinuation cont(kNotEqual, tbranch, fbranch);
-  VisitWord32CompareZero(this, branch, branch->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitDeoptimizeIf(Node* node) {
-  DeoptimizeParameters p = DeoptimizeParametersOf(node->op());
-  FlagsContinuation cont = FlagsContinuation::ForDeoptimize(
-      kNotEqual, p.kind(), p.reason(), p.feedback(), node->InputAt(1));
-  VisitWord32CompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitDeoptimizeUnless(Node* node) {
-  DeoptimizeParameters p = DeoptimizeParametersOf(node->op());
-  FlagsContinuation cont = FlagsContinuation::ForDeoptimize(
-      kEqual, p.kind(), p.reason(), p.feedback(), node->InputAt(1));
-  VisitWord32CompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitTrapIf(Node* node, Runtime::FunctionId func_id) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForTrap(kNotEqual, func_id, node->InputAt(1));
-  VisitWord32CompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitTrapUnless(Node* node,
-                                          Runtime::FunctionId func_id) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForTrap(kEqual, func_id, node->InputAt(1));
-  VisitWord32CompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitSwitch(Node* node, const SwitchInfo& sw) {
-  PPCOperandGenerator g(this);
-  InstructionOperand value_operand = g.UseRegister(node->InputAt(0));
-
-  // Emit either ArchTableSwitch or ArchLookupSwitch.
-  static const size_t kMaxTableSwitchValueRange = 2 << 16;
-  size_t table_space_cost = 4 + sw.value_range;
-  size_t table_time_cost = 3;
-  size_t lookup_space_cost = 3 + 2 * sw.case_count;
-  size_t lookup_time_cost = sw.case_count;
-  if (sw.case_count > 0 &&
-      table_space_cost + 3 * table_time_cost <=
-          lookup_space_cost + 3 * lookup_time_cost &&
-      sw.min_value > std::numeric_limits<int32_t>::min() &&
-      sw.value_range <= kMaxTableSwitchValueRange) {
-    InstructionOperand index_operand = value_operand;
-    if (sw.min_value) {
-      index_operand = g.TempRegister();
-      Emit(kPPC_Sub, index_operand, value_operand,
-           g.TempImmediate(sw.min_value));
-    }
-    // Generate a table lookup.
-    return EmitTableSwitch(sw, index_operand);
-  }
-
-  // Generate a sequence of conditional jumps.
-  return EmitLookupSwitch(sw, value_operand);
-}
-
-
-void InstructionSelector::VisitWord32Equal(Node* const node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
-  Int32BinopMatcher m(node);
-  if (m.right().Is(0)) {
-    return VisitWord32CompareZero(this, m.node(), m.left().node(), &cont);
-  }
-  VisitWord32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitInt32LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kSignedLessThan, node);
-  VisitWord32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitInt32LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kSignedLessThanOrEqual, node);
-  VisitWord32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitUint32LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kUnsignedLessThan, node);
-  VisitWord32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitUint32LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedLessThanOrEqual, node);
-  VisitWord32Compare(this, node, &cont);
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-void InstructionSelector::VisitWord64Equal(Node* const node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
-  Int64BinopMatcher m(node);
-  if (m.right().Is(0)) {
-    return VisitWord64CompareZero(this, m.node(), m.left().node(), &cont);
-  }
-  VisitWord64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitInt64LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kSignedLessThan, node);
-  VisitWord64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitInt64LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kSignedLessThanOrEqual, node);
-  VisitWord64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitUint64LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kUnsignedLessThan, node);
-  VisitWord64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitUint64LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedLessThanOrEqual, node);
-  VisitWord64Compare(this, node, &cont);
-}
-#endif
-
-void InstructionSelector::VisitInt32MulWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kNotEqual, ovf);
-    return EmitInt32MulWithOverflow(this, node, &cont);
-  }
-  FlagsContinuation cont;
-  EmitInt32MulWithOverflow(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat32Equal(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
-  VisitFloat32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat32LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kUnsignedLessThan, node);
-  VisitFloat32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat32LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedLessThanOrEqual, node);
-  VisitFloat32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat64Equal(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
-  VisitFloat64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat64LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kUnsignedLessThan, node);
-  VisitFloat64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedLessThanOrEqual, node);
-  VisitFloat64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::EmitPrepareArguments(
-    ZoneVector<PushParameter>* arguments, const CallDescriptor* descriptor,
-    Node* node) {
-  PPCOperandGenerator g(this);
-
-  // Prepare for C function call.
-  if (descriptor->IsCFunctionCall()) {
-    Emit(kArchPrepareCallCFunction |
-             MiscField::encode(static_cast<int>(descriptor->ParameterCount())),
-         0, nullptr, 0, nullptr);
-
-    // Poke any stack arguments.
-    int slot = kStackFrameExtraParamSlot;
-    for (PushParameter input : (*arguments)) {
-      Emit(kPPC_StoreToStackSlot, g.NoOutput(), g.UseRegister(input.node),
-           g.TempImmediate(slot));
-      ++slot;
-    }
-  } else {
-    // Push any stack arguments.
-    for (PushParameter input : base::Reversed(*arguments)) {
-      // Skip any alignment holes in pushed nodes.
-      if (input.node == nullptr) continue;
-      Emit(kPPC_Push, g.NoOutput(), g.UseRegister(input.node));
-    }
-  }
-}
-
-
-bool InstructionSelector::IsTailCallAddressImmediate() { return false; }
-
-int InstructionSelector::GetTempsCountForTailCallFromJSFunction() { return 3; }
-
-void InstructionSelector::VisitFloat64ExtractLowWord32(Node* node) {
-  PPCOperandGenerator g(this);
-  Emit(kPPC_DoubleExtractLowWord32, g.DefineAsRegister(node),
-       g.UseRegister(node->InputAt(0)));
-}
-
-
-void InstructionSelector::VisitFloat64ExtractHighWord32(Node* node) {
-  PPCOperandGenerator g(this);
-  Emit(kPPC_DoubleExtractHighWord32, g.DefineAsRegister(node),
-       g.UseRegister(node->InputAt(0)));
-}
-
-
-void InstructionSelector::VisitFloat64InsertLowWord32(Node* node) {
-  PPCOperandGenerator g(this);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-  if (left->opcode() == IrOpcode::kFloat64InsertHighWord32 &&
-      CanCover(node, left)) {
-    left = left->InputAt(1);
-    Emit(kPPC_DoubleConstruct, g.DefineAsRegister(node), g.UseRegister(left),
-         g.UseRegister(right));
-    return;
-  }
-  Emit(kPPC_DoubleInsertLowWord32, g.DefineSameAsFirst(node),
-       g.UseRegister(left), g.UseRegister(right));
-}
-
-
-void InstructionSelector::VisitFloat64InsertHighWord32(Node* node) {
-  PPCOperandGenerator g(this);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-  if (left->opcode() == IrOpcode::kFloat64InsertLowWord32 &&
-      CanCover(node, left)) {
-    left = left->InputAt(1);
-    Emit(kPPC_DoubleConstruct, g.DefineAsRegister(node), g.UseRegister(right),
-         g.UseRegister(left));
-    return;
-  }
-  Emit(kPPC_DoubleInsertHighWord32, g.DefineSameAsFirst(node),
-       g.UseRegister(left), g.UseRegister(right));
-}
-
-void InstructionSelector::VisitAtomicLoad(Node* node) {
-  LoadRepresentation load_rep = LoadRepresentationOf(node->op());
-  PPCOperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  ArchOpcode opcode = kArchNop;
-  switch (load_rep.representation()) {
-    case MachineRepresentation::kWord8:
-      opcode = load_rep.IsSigned() ? kAtomicLoadInt8 : kAtomicLoadUint8;
-      break;
-    case MachineRepresentation::kWord16:
-      opcode = load_rep.IsSigned() ? kAtomicLoadInt16 : kAtomicLoadUint16;
-      break;
-    case MachineRepresentation::kWord32:
-      opcode = kAtomicLoadWord32;
-      break;
-    default:
-      UNREACHABLE();
-      return;
-  }
-  Emit(opcode | AddressingModeField::encode(kMode_MRR),
-      g.DefineAsRegister(node), g.UseRegister(base), g.UseRegister(index));
-}
-
-void InstructionSelector::VisitAtomicStore(Node* node) {
-  MachineRepresentation rep = AtomicStoreRepresentationOf(node->op());
-  PPCOperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-  ArchOpcode opcode = kArchNop;
-  switch (rep) {
-    case MachineRepresentation::kWord8:
-      opcode = kAtomicStoreWord8;
-      break;
-    case MachineRepresentation::kWord16:
-      opcode = kAtomicStoreWord16;
-      break;
-    case MachineRepresentation::kWord32:
-      opcode = kAtomicStoreWord32;
-      break;
-    default:
-      UNREACHABLE();
-      return;
-  }
-
-  InstructionOperand inputs[4];
-  size_t input_count = 0;
-  inputs[input_count++] = g.UseUniqueRegister(base);
-  inputs[input_count++] = g.UseUniqueRegister(index);
-  inputs[input_count++] = g.UseUniqueRegister(value);
-  Emit(opcode | AddressingModeField::encode(kMode_MRR),
-      0, nullptr, input_count, inputs);
-}
-
-void InstructionSelector::VisitAtomicExchange(Node* node) {
-  PPCOperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-  ArchOpcode opcode = kArchNop;
-  MachineType type = AtomicOpRepresentationOf(node->op());
-  if (type == MachineType::Int8()) {
-    opcode = kAtomicExchangeInt8;
-  } else if (type == MachineType::Uint8()) {
-    opcode = kAtomicExchangeUint8;
-  } else if (type == MachineType::Int16()) {
-    opcode = kAtomicExchangeInt16;
-  } else if (type == MachineType::Uint16()) {
-    opcode = kAtomicExchangeUint16;
-  } else if (type == MachineType::Int32() || type == MachineType::Uint32()) {
-    opcode = kAtomicExchangeWord32;
-  } else {
-    UNREACHABLE();
-    return;
-  }
-
-  AddressingMode addressing_mode = kMode_MRR;
-  InstructionOperand inputs[3];
-  size_t input_count = 0;
-  inputs[input_count++] = g.UseUniqueRegister(base);
-  inputs[input_count++] = g.UseUniqueRegister(index);
-  inputs[input_count++] = g.UseUniqueRegister(value);
-  InstructionOperand outputs[1];
-  outputs[0] = g.UseUniqueRegister(node);
-  InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
-  Emit(code, 1, outputs, input_count, inputs);
-}
-
-void InstructionSelector::VisitAtomicCompareExchange(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitAtomicAdd(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitAtomicSub(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitAtomicAnd(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitAtomicOr(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitAtomicXor(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitInt32AbsWithOverflow(Node* node) {
-  UNREACHABLE();
-}
-
-void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) {
-  UNREACHABLE();
-}
-
-void InstructionSelector::VisitI32x4Splat(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4ExtractLane(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4ReplaceLane(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4Add(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4Sub(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4Shl(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4ShrS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4Mul(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4MaxS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4MinS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4Eq(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4Ne(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4MinU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4MaxU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4ShrU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4Neg(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4GtS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4GeS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4GtU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4GeU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8Splat(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8ExtractLane(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8ReplaceLane(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8Shl(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8ShrS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8ShrU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8Add(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8AddSaturateS(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitI16x8Sub(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8SubSaturateS(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitI16x8Mul(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8MinS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8MaxS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8Eq(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8Ne(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8AddSaturateU(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitI16x8SubSaturateU(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitI16x8MinU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8MaxU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8Neg(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8GtS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8GeS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8GtU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8GeU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16Neg(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16Splat(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16ExtractLane(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16ReplaceLane(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16Add(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16AddSaturateS(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitI8x16Sub(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16SubSaturateS(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitI8x16MinS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16MaxS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16Eq(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16Ne(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16GtS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16GeS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16AddSaturateU(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitI8x16SubSaturateU(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitI8x16MinU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16MaxU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16GtU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16GeU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitS128And(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitS128Or(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitS128Xor(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitS128Not(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitS128Zero(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitF32x4Eq(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitF32x4Ne(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitF32x4Lt(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitF32x4Le(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitF32x4Splat(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitF32x4ExtractLane(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitF32x4ReplaceLane(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::EmitPrepareResults(ZoneVector<PushParameter>* results,
-                                             const CallDescriptor* descriptor,
-                                             Node* node) {
-  // TODO(John): Port.
-}
-
-void InstructionSelector::VisitF32x4Add(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitF32x4Sub(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitF32x4Mul(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitF32x4Min(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitF32x4Max(Node* node) { UNIMPLEMENTED(); }
-
-// static
-MachineOperatorBuilder::Flags
-InstructionSelector::SupportedMachineOperatorFlags() {
-  return MachineOperatorBuilder::kFloat32RoundDown |
-         MachineOperatorBuilder::kFloat64RoundDown |
-         MachineOperatorBuilder::kFloat32RoundUp |
-         MachineOperatorBuilder::kFloat64RoundUp |
-         MachineOperatorBuilder::kFloat32RoundTruncate |
-         MachineOperatorBuilder::kFloat64RoundTruncate |
-         MachineOperatorBuilder::kFloat64RoundTiesAway |
-         MachineOperatorBuilder::kWord32Popcnt |
-         MachineOperatorBuilder::kWord64Popcnt;
-  // We omit kWord32ShiftIsSafe as s[rl]w use 0x3F as a mask rather than 0x1F.
-}
-
-// static
-MachineOperatorBuilder::AlignmentRequirements
-InstructionSelector::AlignmentRequirements() {
-  return MachineOperatorBuilder::AlignmentRequirements::
-      FullUnalignedAccessSupport();
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/register-allocator-verifier.cc b/src/v8/src/compiler/register-allocator-verifier.cc
deleted file mode 100644
index e195817..0000000
--- a/src/v8/src/compiler/register-allocator-verifier.cc
+++ /dev/null
@@ -1,561 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/compiler/register-allocator-verifier.h"
-
-#include "src/bit-vector.h"
-#include "src/compiler/instruction.h"
-#include "src/ostreams.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-namespace {
-
-size_t OperandCount(const Instruction* instr) {
-  return instr->InputCount() + instr->OutputCount() + instr->TempCount();
-}
-
-void VerifyEmptyGaps(const Instruction* instr) {
-  for (int i = Instruction::FIRST_GAP_POSITION;
-       i <= Instruction::LAST_GAP_POSITION; i++) {
-    Instruction::GapPosition inner_pos =
-        static_cast<Instruction::GapPosition>(i);
-    CHECK_NULL(instr->GetParallelMove(inner_pos));
-  }
-}
-
-void VerifyAllocatedGaps(const Instruction* instr, const char* caller_info) {
-  for (int i = Instruction::FIRST_GAP_POSITION;
-       i <= Instruction::LAST_GAP_POSITION; i++) {
-    Instruction::GapPosition inner_pos =
-        static_cast<Instruction::GapPosition>(i);
-    const ParallelMove* moves = instr->GetParallelMove(inner_pos);
-    if (moves == nullptr) continue;
-    for (const MoveOperands* move : *moves) {
-      if (move->IsRedundant()) continue;
-      CHECK_WITH_MSG(
-          move->source().IsAllocated() || move->source().IsConstant(),
-          caller_info);
-      CHECK_WITH_MSG(move->destination().IsAllocated(), caller_info);
-    }
-  }
-}
-
-}  // namespace
-
-RegisterAllocatorVerifier::RegisterAllocatorVerifier(
-    Zone* zone, const RegisterConfiguration* config,
-    const InstructionSequence* sequence)
-    : zone_(zone),
-      config_(config),
-      sequence_(sequence),
-      constraints_(zone),
-      assessments_(zone),
-      outstanding_assessments_(zone) {
-  constraints_.reserve(sequence->instructions().size());
-  // TODO(dcarney): model unique constraints.
-  // Construct OperandConstraints for all InstructionOperands, eliminating
-  // kSameAsFirst along the way.
-  for (const Instruction* instr : sequence->instructions()) {
-    // All gaps should be totally unallocated at this point.
-    VerifyEmptyGaps(instr);
-    const size_t operand_count = OperandCount(instr);
-    OperandConstraint* op_constraints =
-        zone->NewArray<OperandConstraint>(operand_count);
-    size_t count = 0;
-    for (size_t i = 0; i < instr->InputCount(); ++i, ++count) {
-      BuildConstraint(instr->InputAt(i), &op_constraints[count]);
-      VerifyInput(op_constraints[count]);
-    }
-    for (size_t i = 0; i < instr->TempCount(); ++i, ++count) {
-      BuildConstraint(instr->TempAt(i), &op_constraints[count]);
-      VerifyTemp(op_constraints[count]);
-    }
-    for (size_t i = 0; i < instr->OutputCount(); ++i, ++count) {
-      BuildConstraint(instr->OutputAt(i), &op_constraints[count]);
-      if (op_constraints[count].type_ == kSameAsFirst) {
-        CHECK_LT(0, instr->InputCount());
-        op_constraints[count].type_ = op_constraints[0].type_;
-        op_constraints[count].value_ = op_constraints[0].value_;
-      }
-      VerifyOutput(op_constraints[count]);
-    }
-    InstructionConstraint instr_constraint = {instr, operand_count,
-                                              op_constraints};
-    constraints()->push_back(instr_constraint);
-  }
-}
-
-void RegisterAllocatorVerifier::VerifyInput(
-    const OperandConstraint& constraint) {
-  CHECK_NE(kSameAsFirst, constraint.type_);
-  if (constraint.type_ != kImmediate && constraint.type_ != kExplicit) {
-    CHECK_NE(InstructionOperand::kInvalidVirtualRegister,
-             constraint.virtual_register_);
-  }
-}
-
-void RegisterAllocatorVerifier::VerifyTemp(
-    const OperandConstraint& constraint) {
-  CHECK_NE(kSameAsFirst, constraint.type_);
-  CHECK_NE(kImmediate, constraint.type_);
-  CHECK_NE(kExplicit, constraint.type_);
-  CHECK_NE(kConstant, constraint.type_);
-}
-
-void RegisterAllocatorVerifier::VerifyOutput(
-    const OperandConstraint& constraint) {
-  CHECK_NE(kImmediate, constraint.type_);
-  CHECK_NE(kExplicit, constraint.type_);
-  CHECK_NE(InstructionOperand::kInvalidVirtualRegister,
-           constraint.virtual_register_);
-}
-
-void RegisterAllocatorVerifier::VerifyAssignment(const char* caller_info) {
-  caller_info_ = caller_info;
-  CHECK(sequence()->instructions().size() == constraints()->size());
-  auto instr_it = sequence()->begin();
-  for (const auto& instr_constraint : *constraints()) {
-    const Instruction* instr = instr_constraint.instruction_;
-    // All gaps should be totally allocated at this point.
-    VerifyAllocatedGaps(instr, caller_info_);
-    const size_t operand_count = instr_constraint.operand_constaints_size_;
-    const OperandConstraint* op_constraints =
-        instr_constraint.operand_constraints_;
-    CHECK_EQ(instr, *instr_it);
-    CHECK(operand_count == OperandCount(instr));
-    size_t count = 0;
-    for (size_t i = 0; i < instr->InputCount(); ++i, ++count) {
-      CheckConstraint(instr->InputAt(i), &op_constraints[count]);
-    }
-    for (size_t i = 0; i < instr->TempCount(); ++i, ++count) {
-      CheckConstraint(instr->TempAt(i), &op_constraints[count]);
-    }
-    for (size_t i = 0; i < instr->OutputCount(); ++i, ++count) {
-      CheckConstraint(instr->OutputAt(i), &op_constraints[count]);
-    }
-    ++instr_it;
-  }
-}
-
-void RegisterAllocatorVerifier::BuildConstraint(const InstructionOperand* op,
-                                                OperandConstraint* constraint) {
-  constraint->value_ = kMinInt;
-  constraint->virtual_register_ = InstructionOperand::kInvalidVirtualRegister;
-  if (op->IsConstant()) {
-    constraint->type_ = kConstant;
-    constraint->value_ = ConstantOperand::cast(op)->virtual_register();
-    constraint->virtual_register_ = constraint->value_;
-  } else if (op->IsExplicit()) {
-    constraint->type_ = kExplicit;
-  } else if (op->IsImmediate()) {
-    const ImmediateOperand* imm = ImmediateOperand::cast(op);
-    int value = imm->type() == ImmediateOperand::INLINE ? imm->inline_value()
-                                                        : imm->indexed_value();
-    constraint->type_ = kImmediate;
-    constraint->value_ = value;
-  } else {
-    CHECK(op->IsUnallocated());
-    const UnallocatedOperand* unallocated = UnallocatedOperand::cast(op);
-    int vreg = unallocated->virtual_register();
-    constraint->virtual_register_ = vreg;
-    if (unallocated->basic_policy() == UnallocatedOperand::FIXED_SLOT) {
-      constraint->type_ = kFixedSlot;
-      constraint->value_ = unallocated->fixed_slot_index();
-    } else {
-      switch (unallocated->extended_policy()) {
-        case UnallocatedOperand::ANY:
-        case UnallocatedOperand::NONE:
-          if (sequence()->IsFP(vreg)) {
-            constraint->type_ = kNoneFP;
-          } else {
-            constraint->type_ = kNone;
-          }
-          break;
-        case UnallocatedOperand::FIXED_REGISTER:
-          if (unallocated->HasSecondaryStorage()) {
-            constraint->type_ = kRegisterAndSlot;
-            constraint->spilled_slot_ = unallocated->GetSecondaryStorage();
-          } else {
-            constraint->type_ = kFixedRegister;
-          }
-          constraint->value_ = unallocated->fixed_register_index();
-          break;
-        case UnallocatedOperand::FIXED_FP_REGISTER:
-          constraint->type_ = kFixedFPRegister;
-          constraint->value_ = unallocated->fixed_register_index();
-          break;
-        case UnallocatedOperand::MUST_HAVE_REGISTER:
-          if (sequence()->IsFP(vreg)) {
-            constraint->type_ = kFPRegister;
-          } else {
-            constraint->type_ = kRegister;
-          }
-          break;
-        case UnallocatedOperand::MUST_HAVE_SLOT:
-          constraint->type_ = kSlot;
-          constraint->value_ =
-              ElementSizeLog2Of(sequence()->GetRepresentation(vreg));
-          break;
-        case UnallocatedOperand::SAME_AS_FIRST_INPUT:
-          constraint->type_ = kSameAsFirst;
-          break;
-      }
-    }
-  }
-}
-
-void RegisterAllocatorVerifier::CheckConstraint(
-    const InstructionOperand* op, const OperandConstraint* constraint) {
-  switch (constraint->type_) {
-    case kConstant:
-      CHECK_WITH_MSG(op->IsConstant(), caller_info_);
-      CHECK_EQ(ConstantOperand::cast(op)->virtual_register(),
-               constraint->value_);
-      return;
-    case kImmediate: {
-      CHECK_WITH_MSG(op->IsImmediate(), caller_info_);
-      const ImmediateOperand* imm = ImmediateOperand::cast(op);
-      int value = imm->type() == ImmediateOperand::INLINE
-                      ? imm->inline_value()
-                      : imm->indexed_value();
-      CHECK_EQ(value, constraint->value_);
-      return;
-    }
-    case kRegister:
-      CHECK_WITH_MSG(op->IsRegister(), caller_info_);
-      return;
-    case kFPRegister:
-      CHECK_WITH_MSG(op->IsFPRegister(), caller_info_);
-      return;
-    case kExplicit:
-      CHECK_WITH_MSG(op->IsExplicit(), caller_info_);
-      return;
-    case kFixedRegister:
-    case kRegisterAndSlot:
-      CHECK_WITH_MSG(op->IsRegister(), caller_info_);
-      CHECK_EQ(LocationOperand::cast(op)->register_code(), constraint->value_);
-      return;
-    case kFixedFPRegister:
-      CHECK_WITH_MSG(op->IsFPRegister(), caller_info_);
-      CHECK_EQ(LocationOperand::cast(op)->register_code(), constraint->value_);
-      return;
-    case kFixedSlot:
-      CHECK_WITH_MSG(op->IsStackSlot() || op->IsFPStackSlot(), caller_info_);
-      CHECK_EQ(LocationOperand::cast(op)->index(), constraint->value_);
-      return;
-    case kSlot:
-      CHECK_WITH_MSG(op->IsStackSlot() || op->IsFPStackSlot(), caller_info_);
-      CHECK_EQ(ElementSizeLog2Of(LocationOperand::cast(op)->representation()),
-               constraint->value_);
-      return;
-    case kNone:
-      CHECK_WITH_MSG(op->IsRegister() || op->IsStackSlot(), caller_info_);
-      return;
-    case kNoneFP:
-      CHECK_WITH_MSG(op->IsFPRegister() || op->IsFPStackSlot(), caller_info_);
-      return;
-    case kSameAsFirst:
-      CHECK_WITH_MSG(false, caller_info_);
-      return;
-  }
-}
-
-void BlockAssessments::PerformMoves(const Instruction* instruction) {
-  const ParallelMove* first =
-      instruction->GetParallelMove(Instruction::GapPosition::START);
-  PerformParallelMoves(first);
-  const ParallelMove* last =
-      instruction->GetParallelMove(Instruction::GapPosition::END);
-  PerformParallelMoves(last);
-}
-
-void BlockAssessments::PerformParallelMoves(const ParallelMove* moves) {
-  if (moves == nullptr) return;
-
-  CHECK(map_for_moves_.empty());
-  for (MoveOperands* move : *moves) {
-    if (move->IsEliminated() || move->IsRedundant()) continue;
-    auto it = map_.find(move->source());
-    // The RHS of a parallel move should have been already assessed.
-    CHECK(it != map_.end());
-    // The LHS of a parallel move should not have been assigned in this
-    // parallel move.
-    CHECK(map_for_moves_.find(move->destination()) == map_for_moves_.end());
-    // Copy the assessment to the destination.
-    map_for_moves_[move->destination()] = it->second;
-  }
-  for (auto pair : map_for_moves_) {
-    map_[pair.first] = pair.second;
-  }
-  map_for_moves_.clear();
-}
-
-void BlockAssessments::DropRegisters() {
-  for (auto iterator = map().begin(), end = map().end(); iterator != end;) {
-    auto current = iterator;
-    ++iterator;
-    InstructionOperand op = current->first;
-    if (op.IsAnyRegister()) map().erase(current);
-  }
-}
-
-void BlockAssessments::Print() const {
-#ifndef V8_OS_STARBOARD
-  OFStream os(stdout);
-  for (const auto pair : map()) {
-    const InstructionOperand op = pair.first;
-    const Assessment* assessment = pair.second;
-    // Use operator<< so we can write the assessment on the same
-    // line. Since we need a register configuration, just pick
-    // Turbofan for now.
-    PrintableInstructionOperand wrapper = {RegisterConfiguration::Default(),
-                                           op};
-    os << wrapper << " : ";
-    if (assessment->kind() == AssessmentKind::Final) {
-      os << "v" << FinalAssessment::cast(assessment)->virtual_register();
-    } else {
-      os << "P";
-    }
-    os << std::endl;
-  }
-  os << std::endl;
-#endif
-}
-
-BlockAssessments* RegisterAllocatorVerifier::CreateForBlock(
-    const InstructionBlock* block) {
-  RpoNumber current_block_id = block->rpo_number();
-
-  BlockAssessments* ret = new (zone()) BlockAssessments(zone());
-  if (block->PredecessorCount() == 0) {
-    // TODO(mtrofin): the following check should hold, however, in certain
-    // unit tests it is invalidated by the last block. Investigate and
-    // normalize the CFG.
-    // CHECK_EQ(0, current_block_id.ToInt());
-    // The phi size test below is because we can, technically, have phi
-    // instructions with one argument. Some tests expose that, too.
-  } else if (block->PredecessorCount() == 1 && block->phis().size() == 0) {
-    const BlockAssessments* prev_block = assessments_[block->predecessors()[0]];
-    ret->CopyFrom(prev_block);
-  } else {
-    for (RpoNumber pred_id : block->predecessors()) {
-      // For every operand coming from any of the predecessors, create an
-      // Unfinalized assessment.
-      auto iterator = assessments_.find(pred_id);
-      if (iterator == assessments_.end()) {
-        // This block is the head of a loop, and this predecessor is the
-        // loopback
-        // arc.
-        // Validate this is a loop case, otherwise the CFG is malformed.
-        CHECK(pred_id >= current_block_id);
-        CHECK(block->IsLoopHeader());
-        continue;
-      }
-      const BlockAssessments* pred_assessments = iterator->second;
-      CHECK_NOT_NULL(pred_assessments);
-      for (auto pair : pred_assessments->map()) {
-        InstructionOperand operand = pair.first;
-        if (ret->map().find(operand) == ret->map().end()) {
-          ret->map().insert(std::make_pair(
-              operand, new (zone()) PendingAssessment(zone(), block, operand)));
-        }
-      }
-    }
-  }
-  return ret;
-}
-
-void RegisterAllocatorVerifier::ValidatePendingAssessment(
-    RpoNumber block_id, InstructionOperand op,
-    const BlockAssessments* current_assessments,
-    PendingAssessment* const assessment, int virtual_register) {
-  if (assessment->IsAliasOf(virtual_register)) return;
-
-  // When validating a pending assessment, it is possible some of the
-  // assessments for the original operand (the one where the assessment was
-  // created for first) are also pending. To avoid recursion, we use a work
-  // list. To deal with cycles, we keep a set of seen nodes.
-  Zone local_zone(zone()->allocator(), ZONE_NAME);
-  ZoneQueue<std::pair<const PendingAssessment*, int>> worklist(&local_zone);
-  ZoneSet<RpoNumber> seen(&local_zone);
-  worklist.push(std::make_pair(assessment, virtual_register));
-  seen.insert(block_id);
-
-  while (!worklist.empty()) {
-    auto work = worklist.front();
-    const PendingAssessment* current_assessment = work.first;
-    int current_virtual_register = work.second;
-    InstructionOperand current_operand = current_assessment->operand();
-    worklist.pop();
-
-    const InstructionBlock* origin = current_assessment->origin();
-    CHECK(origin->PredecessorCount() > 1 || origin->phis().size() > 0);
-
-    // Check if the virtual register is a phi first, instead of relying on
-    // the incoming assessments. In particular, this handles the case
-    // v1 = phi v0 v0, which structurally is identical to v0 having been
-    // defined at the top of a diamond, and arriving at the node joining the
-    // diamond's branches.
-    const PhiInstruction* phi = nullptr;
-    for (const PhiInstruction* candidate : origin->phis()) {
-      if (candidate->virtual_register() == current_virtual_register) {
-        phi = candidate;
-        break;
-      }
-    }
-
-    int op_index = 0;
-    for (RpoNumber pred : origin->predecessors()) {
-      int expected =
-          phi != nullptr ? phi->operands()[op_index] : current_virtual_register;
-
-      ++op_index;
-      auto pred_assignment = assessments_.find(pred);
-      if (pred_assignment == assessments_.end()) {
-        CHECK(origin->IsLoopHeader());
-        auto todo_iter = outstanding_assessments_.find(pred);
-        DelayedAssessments* set = nullptr;
-        if (todo_iter == outstanding_assessments_.end()) {
-          set = new (zone()) DelayedAssessments(zone());
-          outstanding_assessments_.insert(std::make_pair(pred, set));
-        } else {
-          set = todo_iter->second;
-        }
-        set->AddDelayedAssessment(current_operand, expected);
-        continue;
-      }
-
-      const BlockAssessments* pred_assessments = pred_assignment->second;
-      auto found_contribution = pred_assessments->map().find(current_operand);
-      CHECK(found_contribution != pred_assessments->map().end());
-      Assessment* contribution = found_contribution->second;
-
-      switch (contribution->kind()) {
-        case Final:
-          CHECK_EQ(FinalAssessment::cast(contribution)->virtual_register(),
-                   expected);
-          break;
-        case Pending: {
-          // This happens if we have a diamond feeding into another one, and
-          // the inner one never being used - other than for carrying the value.
-          const PendingAssessment* next = PendingAssessment::cast(contribution);
-          if (seen.find(pred) == seen.end()) {
-            worklist.push({next, expected});
-            seen.insert(pred);
-          }
-          // Note that we do not want to finalize pending assessments at the
-          // beginning of a block - which is the information we'd have
-          // available here. This is because this operand may be reused to
-          // define duplicate phis.
-          break;
-        }
-      }
-    }
-  }
-  assessment->AddAlias(virtual_register);
-}
-
-void RegisterAllocatorVerifier::ValidateUse(
-    RpoNumber block_id, BlockAssessments* current_assessments,
-    InstructionOperand op, int virtual_register) {
-  auto iterator = current_assessments->map().find(op);
-  // We should have seen this operand before.
-  CHECK(iterator != current_assessments->map().end());
-  Assessment* assessment = iterator->second;
-
-  switch (assessment->kind()) {
-    case Final:
-      CHECK_EQ(FinalAssessment::cast(assessment)->virtual_register(),
-               virtual_register);
-      break;
-    case Pending: {
-      PendingAssessment* pending = PendingAssessment::cast(assessment);
-      ValidatePendingAssessment(block_id, op, current_assessments, pending,
-                                virtual_register);
-      break;
-    }
-  }
-}
-
-void RegisterAllocatorVerifier::VerifyGapMoves() {
-  CHECK(assessments_.empty());
-  CHECK(outstanding_assessments_.empty());
-  const size_t block_count = sequence()->instruction_blocks().size();
-  for (size_t block_index = 0; block_index < block_count; ++block_index) {
-    const InstructionBlock* block =
-        sequence()->instruction_blocks()[block_index];
-    BlockAssessments* block_assessments = CreateForBlock(block);
-
-    for (int instr_index = block->code_start(); instr_index < block->code_end();
-         ++instr_index) {
-      const InstructionConstraint& instr_constraint = constraints_[instr_index];
-      const Instruction* instr = instr_constraint.instruction_;
-      block_assessments->PerformMoves(instr);
-
-      const OperandConstraint* op_constraints =
-          instr_constraint.operand_constraints_;
-      size_t count = 0;
-      for (size_t i = 0; i < instr->InputCount(); ++i, ++count) {
-        if (op_constraints[count].type_ == kImmediate ||
-            op_constraints[count].type_ == kExplicit) {
-          continue;
-        }
-        int virtual_register = op_constraints[count].virtual_register_;
-        InstructionOperand op = *instr->InputAt(i);
-        ValidateUse(block->rpo_number(), block_assessments, op,
-                    virtual_register);
-      }
-      for (size_t i = 0; i < instr->TempCount(); ++i, ++count) {
-        block_assessments->Drop(*instr->TempAt(i));
-      }
-      if (instr->IsCall()) {
-        block_assessments->DropRegisters();
-      }
-      for (size_t i = 0; i < instr->OutputCount(); ++i, ++count) {
-        int virtual_register = op_constraints[count].virtual_register_;
-        block_assessments->AddDefinition(*instr->OutputAt(i), virtual_register);
-        if (op_constraints[count].type_ == kRegisterAndSlot) {
-          const AllocatedOperand* reg_op =
-              AllocatedOperand::cast(instr->OutputAt(i));
-          MachineRepresentation rep = reg_op->representation();
-          const AllocatedOperand* stack_op = AllocatedOperand::New(
-              zone(), LocationOperand::LocationKind::STACK_SLOT, rep,
-              op_constraints[i].spilled_slot_);
-          block_assessments->AddDefinition(*stack_op, virtual_register);
-        }
-      }
-    }
-    // Now commit the assessments for this block. If there are any delayed
-    // assessments, ValidatePendingAssessment should see this block, too.
-    assessments_[block->rpo_number()] = block_assessments;
-
-    auto todo_iter = outstanding_assessments_.find(block->rpo_number());
-    if (todo_iter == outstanding_assessments_.end()) continue;
-    DelayedAssessments* todo = todo_iter->second;
-    for (auto pair : todo->map()) {
-      InstructionOperand op = pair.first;
-      int vreg = pair.second;
-      auto found_op = block_assessments->map().find(op);
-      CHECK(found_op != block_assessments->map().end());
-      switch (found_op->second->kind()) {
-        case Final:
-          CHECK_EQ(FinalAssessment::cast(found_op->second)->virtual_register(),
-                   vreg);
-          break;
-        case Pending:
-          ValidatePendingAssessment(block->rpo_number(), op, block_assessments,
-                                    PendingAssessment::cast(found_op->second),
-                                    vreg);
-          break;
-      }
-    }
-  }
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/register-allocator-verifier.h b/src/v8/src/compiler/register-allocator-verifier.h
deleted file mode 100644
index a961f00..0000000
--- a/src/v8/src/compiler/register-allocator-verifier.h
+++ /dev/null
@@ -1,273 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_REGISTER_ALLOCATOR_VERIFIER_H_
-#define V8_REGISTER_ALLOCATOR_VERIFIER_H_
-
-#include "src/compiler/instruction.h"
-#include "src/zone/zone-containers.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-class InstructionBlock;
-class InstructionSequence;
-
-// The register allocator validator traverses instructions in the instruction
-// sequence, and verifies the correctness of machine operand substitutions of
-// virtual registers. It collects the virtual register instruction signatures
-// before register allocation. Then, after the register allocation pipeline
-// completes, it compares the operand substitutions against the pre-allocation
-// data.
-// At a high level, validation works as follows: we iterate through each block,
-// and, in a block, through each instruction; then:
-// - when an operand is the output of an instruction, we associate it to the
-// virtual register that the instruction sequence declares as its output. We
-// use the concept of "FinalAssessment" to model this.
-// - when an operand is used in an instruction, we check that the assessment
-// matches the expectation of the instruction
-// - moves simply copy the assessment over to the new operand
-// - blocks with more than one predecessor associate to each operand a "Pending"
-// assessment. The pending assessment remembers the operand and block where it
-// was created. Then, when the value is used (which may be as a different
-// operand, because of moves), we check that the virtual register at the use
-// site matches the definition of this pending operand: either the phi inputs
-// match, or, if it's not a phi, all the predecessors at the point the pending
-// assessment was defined have that operand assigned to the given virtual
-// register. If all checks out, we record in the assessment that the virtual
-// register is aliased by the specific operand.
-// If a block is a loop header - so one or more of its predecessors are it or
-// below - we still treat uses of operands as above, but we record which operand
-// assessments haven't been made yet, and what virtual register they must
-// correspond to, and verify that when we are done with the respective
-// predecessor blocks.
-// This way, the algorithm always makes a final decision about the operands
-// in an instruction, ensuring convergence.
-// Operand assessments are recorded per block, as the result at the exit from
-// the block. When moving to a new block, we copy assessments from its single
-// predecessor, or, if the block has multiple predecessors, the mechanism was
-// described already.
-
-enum AssessmentKind { Final, Pending };
-
-class Assessment : public ZoneObject {
- public:
-  AssessmentKind kind() const { return kind_; }
-
- protected:
-  explicit Assessment(AssessmentKind kind) : kind_(kind) {}
-  AssessmentKind kind_;
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(Assessment);
-};
-
-// PendingAssessments are associated to operands coming from the multiple
-// predecessors of a block. We only record the operand and the block, and
-// will determine if the way the operand is defined (from the predecessors)
-// matches a particular use. We allow more than one vreg association with
-// an operand - this handles scenarios where multiple phis are
-// defined with identical operands, and the move optimizer moved down the moves
-// separating the 2 phis in the block defining them.
-class PendingAssessment final : public Assessment {
- public:
-  explicit PendingAssessment(Zone* zone, const InstructionBlock* origin,
-                             InstructionOperand operand)
-      : Assessment(Pending),
-        origin_(origin),
-        operand_(operand),
-        aliases_(zone) {}
-
-  static const PendingAssessment* cast(const Assessment* assessment) {
-    CHECK(assessment->kind() == Pending);
-    return static_cast<const PendingAssessment*>(assessment);
-  }
-
-  static PendingAssessment* cast(Assessment* assessment) {
-    CHECK(assessment->kind() == Pending);
-    return static_cast<PendingAssessment*>(assessment);
-  }
-
-  const InstructionBlock* origin() const { return origin_; }
-  InstructionOperand operand() const { return operand_; }
-  bool IsAliasOf(int vreg) const { return aliases_.count(vreg) > 0; }
-  void AddAlias(int vreg) { aliases_.insert(vreg); }
-
- private:
-  const InstructionBlock* const origin_;
-  InstructionOperand operand_;
-  ZoneSet<int> aliases_;
-
-  DISALLOW_COPY_AND_ASSIGN(PendingAssessment);
-};
-
-// FinalAssessments are associated to operands that we know to be a certain
-// virtual register.
-class FinalAssessment final : public Assessment {
- public:
-  explicit FinalAssessment(int virtual_register)
-      : Assessment(Final), virtual_register_(virtual_register) {}
-
-  int virtual_register() const { return virtual_register_; }
-  static const FinalAssessment* cast(const Assessment* assessment) {
-    CHECK(assessment->kind() == Final);
-    return static_cast<const FinalAssessment*>(assessment);
-  }
-
- private:
-  int virtual_register_;
-
-  DISALLOW_COPY_AND_ASSIGN(FinalAssessment);
-};
-
-struct OperandAsKeyLess {
-  bool operator()(const InstructionOperand& a,
-                  const InstructionOperand& b) const {
-    return a.CompareCanonicalized(b);
-  }
-};
-
-// Assessments associated with a basic block.
-class BlockAssessments : public ZoneObject {
- public:
-  typedef ZoneMap<InstructionOperand, Assessment*, OperandAsKeyLess> OperandMap;
-  explicit BlockAssessments(Zone* zone)
-      : map_(zone), map_for_moves_(zone), zone_(zone) {}
-  void Drop(InstructionOperand operand) { map_.erase(operand); }
-  void DropRegisters();
-  void AddDefinition(InstructionOperand operand, int virtual_register) {
-    auto existent = map_.find(operand);
-    if (existent != map_.end()) {
-      // Drop the assignment
-      map_.erase(existent);
-    }
-    map_.insert(
-        std::make_pair(operand, new (zone_) FinalAssessment(virtual_register)));
-  }
-
-  void PerformMoves(const Instruction* instruction);
-  void PerformParallelMoves(const ParallelMove* moves);
-  void CopyFrom(const BlockAssessments* other) {
-    CHECK(map_.empty());
-    CHECK_NOT_NULL(other);
-    map_.insert(other->map_.begin(), other->map_.end());
-  }
-
-  OperandMap& map() { return map_; }
-  const OperandMap& map() const { return map_; }
-  void Print() const;
-
- private:
-  OperandMap map_;
-  OperandMap map_for_moves_;
-  Zone* zone_;
-
-  DISALLOW_COPY_AND_ASSIGN(BlockAssessments);
-};
-
-class RegisterAllocatorVerifier final : public ZoneObject {
- public:
-  RegisterAllocatorVerifier(Zone* zone, const RegisterConfiguration* config,
-                            const InstructionSequence* sequence);
-
-  void VerifyAssignment(const char* caller_info);
-  void VerifyGapMoves();
-
- private:
-  enum ConstraintType {
-    kConstant,
-    kImmediate,
-    kRegister,
-    kFixedRegister,
-    kFPRegister,
-    kFixedFPRegister,
-    kSlot,
-    kFixedSlot,
-    kNone,
-    kNoneFP,
-    kExplicit,
-    kSameAsFirst,
-    kRegisterAndSlot
-  };
-
-  struct OperandConstraint {
-    ConstraintType type_;
-    // Constant or immediate value, register code, slot index, or slot size
-    // when relevant.
-    int value_;
-    int spilled_slot_;
-    int virtual_register_;
-  };
-
-  struct InstructionConstraint {
-    const Instruction* instruction_;
-    size_t operand_constaints_size_;
-    OperandConstraint* operand_constraints_;
-  };
-
-  typedef ZoneVector<InstructionConstraint> Constraints;
-
-  class DelayedAssessments : public ZoneObject {
-   public:
-    explicit DelayedAssessments(Zone* zone) : map_(zone) {}
-
-    const ZoneMap<InstructionOperand, int, OperandAsKeyLess>& map() const {
-      return map_;
-    }
-
-    void AddDelayedAssessment(InstructionOperand op, int vreg) {
-      auto it = map_.find(op);
-      if (it == map_.end()) {
-        map_.insert(std::make_pair(op, vreg));
-      } else {
-        CHECK_EQ(it->second, vreg);
-      }
-    }
-
-   private:
-    ZoneMap<InstructionOperand, int, OperandAsKeyLess> map_;
-  };
-
-  Zone* zone() const { return zone_; }
-  const RegisterConfiguration* config() { return config_; }
-  const InstructionSequence* sequence() const { return sequence_; }
-  Constraints* constraints() { return &constraints_; }
-
-  static void VerifyInput(const OperandConstraint& constraint);
-  static void VerifyTemp(const OperandConstraint& constraint);
-  static void VerifyOutput(const OperandConstraint& constraint);
-
-  void BuildConstraint(const InstructionOperand* op,
-                       OperandConstraint* constraint);
-  void CheckConstraint(const InstructionOperand* op,
-                       const OperandConstraint* constraint);
-  BlockAssessments* CreateForBlock(const InstructionBlock* block);
-
-  // Prove that this operand is an alias of this virtual register in the given
-  // block. Update the assessment if that's the case.
-  void ValidatePendingAssessment(RpoNumber block_id, InstructionOperand op,
-                                 const BlockAssessments* current_assessments,
-                                 PendingAssessment* const assessment,
-                                 int virtual_register);
-  void ValidateUse(RpoNumber block_id, BlockAssessments* current_assessments,
-                   InstructionOperand op, int virtual_register);
-
-  Zone* const zone_;
-  const RegisterConfiguration* config_;
-  const InstructionSequence* const sequence_;
-  Constraints constraints_;
-  ZoneMap<RpoNumber, BlockAssessments*> assessments_;
-  ZoneMap<RpoNumber, DelayedAssessments*> outstanding_assessments_;
-  // TODO(chromium:725559): remove after we understand this bug's root cause.
-  const char* caller_info_ = nullptr;
-
-  DISALLOW_COPY_AND_ASSIGN(RegisterAllocatorVerifier);
-};
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif
diff --git a/src/v8/src/compiler/register-allocator.cc b/src/v8/src/compiler/register-allocator.cc
deleted file mode 100644
index 9968579..0000000
--- a/src/v8/src/compiler/register-allocator.cc
+++ /dev/null
@@ -1,4028 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/compiler/register-allocator.h"
-
-#include "src/assembler-inl.h"
-#include "src/base/adapters.h"
-#include "src/compiler/linkage.h"
-#include "src/string-stream.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-#define TRACE(...)                             \
-  do {                                         \
-    if (FLAG_trace_alloc) PrintF(__VA_ARGS__); \
-  } while (false)
-
-
-namespace {
-
-static const int kFloatRepBit =
-    1 << static_cast<int>(MachineRepresentation::kFloat32);
-static const int kSimd128RepBit =
-    1 << static_cast<int>(MachineRepresentation::kSimd128);
-
-void RemoveElement(ZoneVector<LiveRange*>* v, LiveRange* range) {
-  auto it = std::find(v->begin(), v->end(), range);
-  DCHECK(it != v->end());
-  v->erase(it);
-}
-
-int GetRegisterCount(const RegisterConfiguration* cfg, RegisterKind kind) {
-  return kind == FP_REGISTERS ? cfg->num_double_registers()
-                              : cfg->num_general_registers();
-}
-
-
-int GetAllocatableRegisterCount(const RegisterConfiguration* cfg,
-                                RegisterKind kind) {
-  return kind == FP_REGISTERS ? cfg->num_allocatable_double_registers()
-                              : cfg->num_allocatable_general_registers();
-}
-
-
-const int* GetAllocatableRegisterCodes(const RegisterConfiguration* cfg,
-                                       RegisterKind kind) {
-  return kind == FP_REGISTERS ? cfg->allocatable_double_codes()
-                              : cfg->allocatable_general_codes();
-}
-
-
-const InstructionBlock* GetContainingLoop(const InstructionSequence* sequence,
-                                          const InstructionBlock* block) {
-  RpoNumber index = block->loop_header();
-  if (!index.IsValid()) return nullptr;
-  return sequence->InstructionBlockAt(index);
-}
-
-
-const InstructionBlock* GetInstructionBlock(const InstructionSequence* code,
-                                            LifetimePosition pos) {
-  return code->GetInstructionBlock(pos.ToInstructionIndex());
-}
-
-
-Instruction* GetLastInstruction(InstructionSequence* code,
-                                const InstructionBlock* block) {
-  return code->InstructionAt(block->last_instruction_index());
-}
-
-// TODO(dcarney): fix frame to allow frame accesses to half size location.
-int GetByteWidth(MachineRepresentation rep) {
-  switch (rep) {
-    case MachineRepresentation::kBit:
-    case MachineRepresentation::kWord8:
-    case MachineRepresentation::kWord16:
-    case MachineRepresentation::kWord32:
-    case MachineRepresentation::kTaggedSigned:
-    case MachineRepresentation::kTaggedPointer:
-    case MachineRepresentation::kTagged:
-    case MachineRepresentation::kFloat32:
-      return kPointerSize;
-    case MachineRepresentation::kWord64:
-    case MachineRepresentation::kFloat64:
-      return kDoubleSize;
-    case MachineRepresentation::kSimd128:
-      return kSimd128Size;
-    case MachineRepresentation::kNone:
-      break;
-  }
-  UNREACHABLE();
-}
-
-}  // namespace
-
-class LiveRangeBound {
- public:
-  explicit LiveRangeBound(LiveRange* range, bool skip)
-      : range_(range), start_(range->Start()), end_(range->End()), skip_(skip) {
-    DCHECK(!range->IsEmpty());
-  }
-
-  bool CanCover(LifetimePosition position) {
-    return start_ <= position && position < end_;
-  }
-
-  LiveRange* const range_;
-  const LifetimePosition start_;
-  const LifetimePosition end_;
-  const bool skip_;
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(LiveRangeBound);
-};
-
-
-struct FindResult {
-  LiveRange* cur_cover_;
-  LiveRange* pred_cover_;
-};
-
-
-class LiveRangeBoundArray {
- public:
-  LiveRangeBoundArray() : length_(0), start_(nullptr) {}
-
-  bool ShouldInitialize() { return start_ == nullptr; }
-
-  void Initialize(Zone* zone, TopLevelLiveRange* range) {
-    length_ = range->GetChildCount();
-
-    start_ = zone->NewArray<LiveRangeBound>(length_);
-    LiveRangeBound* curr = start_;
-    // Normally, spilled ranges do not need connecting moves, because the spill
-    // location has been assigned at definition. For ranges spilled in deferred
-    // blocks, that is not the case, so we need to connect the spilled children.
-    for (LiveRange *i = range; i != nullptr; i = i->next(), ++curr) {
-      new (curr) LiveRangeBound(i, i->spilled());
-    }
-  }
-
-  LiveRangeBound* Find(const LifetimePosition position) const {
-    size_t left_index = 0;
-    size_t right_index = length_;
-    while (true) {
-      size_t current_index = left_index + (right_index - left_index) / 2;
-      DCHECK(right_index > current_index);
-      LiveRangeBound* bound = &start_[current_index];
-      if (bound->start_ <= position) {
-        if (position < bound->end_) return bound;
-        DCHECK(left_index < current_index);
-        left_index = current_index;
-      } else {
-        right_index = current_index;
-      }
-    }
-  }
-
-  LiveRangeBound* FindPred(const InstructionBlock* pred) {
-    LifetimePosition pred_end =
-        LifetimePosition::InstructionFromInstructionIndex(
-            pred->last_instruction_index());
-    return Find(pred_end);
-  }
-
-  LiveRangeBound* FindSucc(const InstructionBlock* succ) {
-    LifetimePosition succ_start = LifetimePosition::GapFromInstructionIndex(
-        succ->first_instruction_index());
-    return Find(succ_start);
-  }
-
-  bool FindConnectableSubranges(const InstructionBlock* block,
-                                const InstructionBlock* pred,
-                                FindResult* result) const {
-    LifetimePosition pred_end =
-        LifetimePosition::InstructionFromInstructionIndex(
-            pred->last_instruction_index());
-    LiveRangeBound* bound = Find(pred_end);
-    result->pred_cover_ = bound->range_;
-    LifetimePosition cur_start = LifetimePosition::GapFromInstructionIndex(
-        block->first_instruction_index());
-
-    if (bound->CanCover(cur_start)) {
-      // Both blocks are covered by the same range, so there is nothing to
-      // connect.
-      return false;
-    }
-    bound = Find(cur_start);
-    if (bound->skip_) {
-      return false;
-    }
-    result->cur_cover_ = bound->range_;
-    DCHECK(result->pred_cover_ != nullptr && result->cur_cover_ != nullptr);
-    return (result->cur_cover_ != result->pred_cover_);
-  }
-
- private:
-  size_t length_;
-  LiveRangeBound* start_;
-
-  DISALLOW_COPY_AND_ASSIGN(LiveRangeBoundArray);
-};
-
-
-class LiveRangeFinder {
- public:
-  explicit LiveRangeFinder(const RegisterAllocationData* data, Zone* zone)
-      : data_(data),
-        bounds_length_(static_cast<int>(data_->live_ranges().size())),
-        bounds_(zone->NewArray<LiveRangeBoundArray>(bounds_length_)),
-        zone_(zone) {
-    for (int i = 0; i < bounds_length_; ++i) {
-      new (&bounds_[i]) LiveRangeBoundArray();
-    }
-  }
-
-  LiveRangeBoundArray* ArrayFor(int operand_index) {
-    DCHECK(operand_index < bounds_length_);
-    TopLevelLiveRange* range = data_->live_ranges()[operand_index];
-    DCHECK(range != nullptr && !range->IsEmpty());
-    LiveRangeBoundArray* array = &bounds_[operand_index];
-    if (array->ShouldInitialize()) {
-      array->Initialize(zone_, range);
-    }
-    return array;
-  }
-
- private:
-  const RegisterAllocationData* const data_;
-  const int bounds_length_;
-  LiveRangeBoundArray* const bounds_;
-  Zone* const zone_;
-
-  DISALLOW_COPY_AND_ASSIGN(LiveRangeFinder);
-};
-
-
-typedef std::pair<ParallelMove*, InstructionOperand> DelayedInsertionMapKey;
-
-
-struct DelayedInsertionMapCompare {
-  bool operator()(const DelayedInsertionMapKey& a,
-                  const DelayedInsertionMapKey& b) const {
-    if (a.first == b.first) {
-      return a.second.Compare(b.second);
-    }
-    return a.first < b.first;
-  }
-};
-
-
-typedef ZoneMap<DelayedInsertionMapKey, InstructionOperand,
-                DelayedInsertionMapCompare> DelayedInsertionMap;
-
-
-UsePosition::UsePosition(LifetimePosition pos, InstructionOperand* operand,
-                         void* hint, UsePositionHintType hint_type)
-    : operand_(operand), hint_(hint), next_(nullptr), pos_(pos), flags_(0) {
-  DCHECK_IMPLIES(hint == nullptr, hint_type == UsePositionHintType::kNone);
-  bool register_beneficial = true;
-  UsePositionType type = UsePositionType::kAny;
-  if (operand_ != nullptr && operand_->IsUnallocated()) {
-    const UnallocatedOperand* unalloc = UnallocatedOperand::cast(operand_);
-    if (unalloc->HasRegisterPolicy()) {
-      type = UsePositionType::kRequiresRegister;
-    } else if (unalloc->HasSlotPolicy()) {
-      type = UsePositionType::kRequiresSlot;
-      register_beneficial = false;
-    } else {
-      register_beneficial = !unalloc->HasAnyPolicy();
-    }
-  }
-  flags_ = TypeField::encode(type) | HintTypeField::encode(hint_type) |
-           RegisterBeneficialField::encode(register_beneficial) |
-           AssignedRegisterField::encode(kUnassignedRegister);
-  DCHECK(pos_.IsValid());
-}
-
-
-bool UsePosition::HasHint() const {
-  int hint_register;
-  return HintRegister(&hint_register);
-}
-
-
-bool UsePosition::HintRegister(int* register_code) const {
-  if (hint_ == nullptr) return false;
-  switch (HintTypeField::decode(flags_)) {
-    case UsePositionHintType::kNone:
-    case UsePositionHintType::kUnresolved:
-      return false;
-    case UsePositionHintType::kUsePos: {
-      UsePosition* use_pos = reinterpret_cast<UsePosition*>(hint_);
-      int assigned_register = AssignedRegisterField::decode(use_pos->flags_);
-      if (assigned_register == kUnassignedRegister) return false;
-      *register_code = assigned_register;
-      return true;
-    }
-    case UsePositionHintType::kOperand: {
-      InstructionOperand* operand =
-          reinterpret_cast<InstructionOperand*>(hint_);
-      *register_code = LocationOperand::cast(operand)->register_code();
-      return true;
-    }
-    case UsePositionHintType::kPhi: {
-      RegisterAllocationData::PhiMapValue* phi =
-          reinterpret_cast<RegisterAllocationData::PhiMapValue*>(hint_);
-      int assigned_register = phi->assigned_register();
-      if (assigned_register == kUnassignedRegister) return false;
-      *register_code = assigned_register;
-      return true;
-    }
-  }
-  UNREACHABLE();
-}
-
-
-UsePositionHintType UsePosition::HintTypeForOperand(
-    const InstructionOperand& op) {
-  switch (op.kind()) {
-    case InstructionOperand::CONSTANT:
-    case InstructionOperand::IMMEDIATE:
-    case InstructionOperand::EXPLICIT:
-      return UsePositionHintType::kNone;
-    case InstructionOperand::UNALLOCATED:
-      return UsePositionHintType::kUnresolved;
-    case InstructionOperand::ALLOCATED:
-      if (op.IsRegister() || op.IsFPRegister()) {
-        return UsePositionHintType::kOperand;
-      } else {
-        DCHECK(op.IsStackSlot() || op.IsFPStackSlot());
-        return UsePositionHintType::kNone;
-      }
-    case InstructionOperand::INVALID:
-      break;
-  }
-  UNREACHABLE();
-}
-
-void UsePosition::SetHint(UsePosition* use_pos) {
-  DCHECK_NOT_NULL(use_pos);
-  hint_ = use_pos;
-  flags_ = HintTypeField::update(flags_, UsePositionHintType::kUsePos);
-}
-
-void UsePosition::ResolveHint(UsePosition* use_pos) {
-  DCHECK_NOT_NULL(use_pos);
-  if (HintTypeField::decode(flags_) != UsePositionHintType::kUnresolved) return;
-  hint_ = use_pos;
-  flags_ = HintTypeField::update(flags_, UsePositionHintType::kUsePos);
-}
-
-
-void UsePosition::set_type(UsePositionType type, bool register_beneficial) {
-  DCHECK_IMPLIES(type == UsePositionType::kRequiresSlot, !register_beneficial);
-  DCHECK_EQ(kUnassignedRegister, AssignedRegisterField::decode(flags_));
-  flags_ = TypeField::encode(type) |
-           RegisterBeneficialField::encode(register_beneficial) |
-           HintTypeField::encode(HintTypeField::decode(flags_)) |
-           AssignedRegisterField::encode(kUnassignedRegister);
-}
-
-
-UseInterval* UseInterval::SplitAt(LifetimePosition pos, Zone* zone) {
-  DCHECK(Contains(pos) && pos != start());
-  UseInterval* after = new (zone) UseInterval(pos, end_);
-  after->next_ = next_;
-  next_ = nullptr;
-  end_ = pos;
-  return after;
-}
-
-
-void LifetimePosition::Print() const {
-#ifndef V8_OS_STARBOARD
-  OFStream os(stdout);
-  os << *this << std::endl;
-#endif
-}
-
-
-std::ostream& operator<<(std::ostream& os, const LifetimePosition pos) {
-  os << '@' << pos.ToInstructionIndex();
-  if (pos.IsGapPosition()) {
-    os << 'g';
-  } else {
-    os << 'i';
-  }
-  if (pos.IsStart()) {
-    os << 's';
-  } else {
-    os << 'e';
-  }
-  return os;
-}
-
-LiveRange::LiveRange(int relative_id, MachineRepresentation rep,
-                     TopLevelLiveRange* top_level)
-    : relative_id_(relative_id),
-      bits_(0),
-      last_interval_(nullptr),
-      first_interval_(nullptr),
-      first_pos_(nullptr),
-      top_level_(top_level),
-      next_(nullptr),
-      current_interval_(nullptr),
-      last_processed_use_(nullptr),
-      current_hint_position_(nullptr),
-      splitting_pointer_(nullptr) {
-  DCHECK(AllocatedOperand::IsSupportedRepresentation(rep));
-  bits_ = AssignedRegisterField::encode(kUnassignedRegister) |
-          RepresentationField::encode(rep);
-}
-
-
-void LiveRange::VerifyPositions() const {
-  // Walk the positions, verifying that each is in an interval.
-  UseInterval* interval = first_interval_;
-  for (UsePosition* pos = first_pos_; pos != nullptr; pos = pos->next()) {
-    CHECK(Start() <= pos->pos());
-    CHECK(pos->pos() <= End());
-    CHECK_NOT_NULL(interval);
-    while (!interval->Contains(pos->pos()) && interval->end() != pos->pos()) {
-      interval = interval->next();
-      CHECK_NOT_NULL(interval);
-    }
-  }
-}
-
-
-void LiveRange::VerifyIntervals() const {
-  DCHECK(first_interval()->start() == Start());
-  LifetimePosition last_end = first_interval()->end();
-  for (UseInterval* interval = first_interval()->next(); interval != nullptr;
-       interval = interval->next()) {
-    DCHECK(last_end <= interval->start());
-    last_end = interval->end();
-  }
-  DCHECK(last_end == End());
-}
-
-
-void LiveRange::set_assigned_register(int reg) {
-  DCHECK(!HasRegisterAssigned() && !spilled());
-  bits_ = AssignedRegisterField::update(bits_, reg);
-}
-
-
-void LiveRange::UnsetAssignedRegister() {
-  DCHECK(HasRegisterAssigned() && !spilled());
-  bits_ = AssignedRegisterField::update(bits_, kUnassignedRegister);
-}
-
-
-void LiveRange::Spill() {
-  DCHECK(!spilled());
-  DCHECK(!TopLevel()->HasNoSpillType());
-  set_spilled(true);
-  bits_ = AssignedRegisterField::update(bits_, kUnassignedRegister);
-}
-
-
-RegisterKind LiveRange::kind() const {
-  return IsFloatingPoint(representation()) ? FP_REGISTERS : GENERAL_REGISTERS;
-}
-
-
-UsePosition* LiveRange::FirstHintPosition(int* register_index) const {
-  for (UsePosition* pos = first_pos_; pos != nullptr; pos = pos->next()) {
-    if (pos->HintRegister(register_index)) return pos;
-  }
-  return nullptr;
-}
-
-
-UsePosition* LiveRange::NextUsePosition(LifetimePosition start) const {
-  UsePosition* use_pos = last_processed_use_;
-  if (use_pos == nullptr || use_pos->pos() > start) {
-    use_pos = first_pos();
-  }
-  while (use_pos != nullptr && use_pos->pos() < start) {
-    use_pos = use_pos->next();
-  }
-  last_processed_use_ = use_pos;
-  return use_pos;
-}
-
-
-UsePosition* LiveRange::NextUsePositionRegisterIsBeneficial(
-    LifetimePosition start) const {
-  UsePosition* pos = NextUsePosition(start);
-  while (pos != nullptr && !pos->RegisterIsBeneficial()) {
-    pos = pos->next();
-  }
-  return pos;
-}
-
-LifetimePosition LiveRange::NextLifetimePositionRegisterIsBeneficial(
-    const LifetimePosition& start) const {
-  UsePosition* next_use = NextUsePositionRegisterIsBeneficial(start);
-  if (next_use == nullptr) return End();
-  return next_use->pos();
-}
-
-UsePosition* LiveRange::PreviousUsePositionRegisterIsBeneficial(
-    LifetimePosition start) const {
-  UsePosition* pos = first_pos();
-  UsePosition* prev = nullptr;
-  while (pos != nullptr && pos->pos() < start) {
-    if (pos->RegisterIsBeneficial()) prev = pos;
-    pos = pos->next();
-  }
-  return prev;
-}
-
-
-UsePosition* LiveRange::NextRegisterPosition(LifetimePosition start) const {
-  UsePosition* pos = NextUsePosition(start);
-  while (pos != nullptr && pos->type() != UsePositionType::kRequiresRegister) {
-    pos = pos->next();
-  }
-  return pos;
-}
-
-
-UsePosition* LiveRange::NextSlotPosition(LifetimePosition start) const {
-  for (UsePosition* pos = NextUsePosition(start); pos != nullptr;
-       pos = pos->next()) {
-    if (pos->type() != UsePositionType::kRequiresSlot) continue;
-    return pos;
-  }
-  return nullptr;
-}
-
-
-bool LiveRange::CanBeSpilled(LifetimePosition pos) const {
-  // We cannot spill a live range that has a use requiring a register
-  // at the current or the immediate next position.
-  UsePosition* use_pos = NextRegisterPosition(pos);
-  if (use_pos == nullptr) return true;
-  return use_pos->pos() > pos.NextStart().End();
-}
-
-
-bool LiveRange::IsTopLevel() const { return top_level_ == this; }
-
-
-InstructionOperand LiveRange::GetAssignedOperand() const {
-  if (HasRegisterAssigned()) {
-    DCHECK(!spilled());
-    return AllocatedOperand(LocationOperand::REGISTER, representation(),
-                            assigned_register());
-  }
-  DCHECK(spilled());
-  DCHECK(!HasRegisterAssigned());
-  if (TopLevel()->HasSpillOperand()) {
-    InstructionOperand* op = TopLevel()->GetSpillOperand();
-    DCHECK(!op->IsUnallocated());
-    return *op;
-  }
-  return TopLevel()->GetSpillRangeOperand();
-}
-
-
-UseInterval* LiveRange::FirstSearchIntervalForPosition(
-    LifetimePosition position) const {
-  if (current_interval_ == nullptr) return first_interval_;
-  if (current_interval_->start() > position) {
-    current_interval_ = nullptr;
-    return first_interval_;
-  }
-  return current_interval_;
-}
-
-
-void LiveRange::AdvanceLastProcessedMarker(
-    UseInterval* to_start_of, LifetimePosition but_not_past) const {
-  if (to_start_of == nullptr) return;
-  if (to_start_of->start() > but_not_past) return;
-  LifetimePosition start = current_interval_ == nullptr
-                               ? LifetimePosition::Invalid()
-                               : current_interval_->start();
-  if (to_start_of->start() > start) {
-    current_interval_ = to_start_of;
-  }
-}
-
-
-LiveRange* LiveRange::SplitAt(LifetimePosition position, Zone* zone) {
-  int new_id = TopLevel()->GetNextChildId();
-  LiveRange* child = new (zone) LiveRange(new_id, representation(), TopLevel());
-  // If we split, we do so because we're about to switch registers or move
-  // to/from a slot, so there's no value in connecting hints.
-  DetachAt(position, child, zone, DoNotConnectHints);
-
-  child->top_level_ = TopLevel();
-  child->next_ = next_;
-  next_ = child;
-  return child;
-}
-
-UsePosition* LiveRange::DetachAt(LifetimePosition position, LiveRange* result,
-                                 Zone* zone,
-                                 HintConnectionOption connect_hints) {
-  DCHECK(Start() < position);
-  DCHECK(End() > position);
-  DCHECK(result->IsEmpty());
-  // Find the last interval that ends before the position. If the
-  // position is contained in one of the intervals in the chain, we
-  // split that interval and use the first part.
-  UseInterval* current = FirstSearchIntervalForPosition(position);
-
-  // If the split position coincides with the beginning of a use interval
-  // we need to split use positons in a special way.
-  bool split_at_start = false;
-
-  if (current->start() == position) {
-    // When splitting at start we need to locate the previous use interval.
-    current = first_interval_;
-  }
-
-  UseInterval* after = nullptr;
-  while (current != nullptr) {
-    if (current->Contains(position)) {
-      after = current->SplitAt(position, zone);
-      break;
-    }
-    UseInterval* next = current->next();
-    if (next->start() >= position) {
-      split_at_start = (next->start() == position);
-      after = next;
-      current->set_next(nullptr);
-      break;
-    }
-    current = next;
-  }
-  DCHECK_NOT_NULL(after);
-
-  // Partition original use intervals to the two live ranges.
-  UseInterval* before = current;
-  result->last_interval_ =
-      (last_interval_ == before)
-          ? after            // Only interval in the range after split.
-          : last_interval_;  // Last interval of the original range.
-  result->first_interval_ = after;
-  last_interval_ = before;
-
-  // Find the last use position before the split and the first use
-  // position after it.
-  UsePosition* use_after =
-      splitting_pointer_ == nullptr || splitting_pointer_->pos() > position
-          ? first_pos()
-          : splitting_pointer_;
-  UsePosition* use_before = nullptr;
-  if (split_at_start) {
-    // The split position coincides with the beginning of a use interval (the
-    // end of a lifetime hole). Use at this position should be attributed to
-    // the split child because split child owns use interval covering it.
-    while (use_after != nullptr && use_after->pos() < position) {
-      use_before = use_after;
-      use_after = use_after->next();
-    }
-  } else {
-    while (use_after != nullptr && use_after->pos() <= position) {
-      use_before = use_after;
-      use_after = use_after->next();
-    }
-  }
-
-  // Partition original use positions to the two live ranges.
-  if (use_before != nullptr) {
-    use_before->set_next(nullptr);
-  } else {
-    first_pos_ = nullptr;
-  }
-  result->first_pos_ = use_after;
-
-  // Discard cached iteration state. It might be pointing
-  // to the use that no longer belongs to this live range.
-  last_processed_use_ = nullptr;
-  current_interval_ = nullptr;
-
-  if (connect_hints == ConnectHints && use_before != nullptr &&
-      use_after != nullptr) {
-    use_after->SetHint(use_before);
-  }
-#ifdef DEBUG
-  VerifyChildStructure();
-  result->VerifyChildStructure();
-#endif
-  return use_before;
-}
-
-
-void LiveRange::UpdateParentForAllChildren(TopLevelLiveRange* new_top_level) {
-  LiveRange* child = this;
-  for (; child != nullptr; child = child->next()) {
-    child->top_level_ = new_top_level;
-  }
-}
-
-
-void LiveRange::ConvertUsesToOperand(const InstructionOperand& op,
-                                     const InstructionOperand& spill_op) {
-  for (UsePosition* pos = first_pos(); pos != nullptr; pos = pos->next()) {
-    DCHECK(Start() <= pos->pos() && pos->pos() <= End());
-    if (!pos->HasOperand()) continue;
-    switch (pos->type()) {
-      case UsePositionType::kRequiresSlot:
-        DCHECK(spill_op.IsStackSlot() || spill_op.IsFPStackSlot());
-        InstructionOperand::ReplaceWith(pos->operand(), &spill_op);
-        break;
-      case UsePositionType::kRequiresRegister:
-        DCHECK(op.IsRegister() || op.IsFPRegister());
-      // Fall through.
-      case UsePositionType::kAny:
-        InstructionOperand::ReplaceWith(pos->operand(), &op);
-        break;
-    }
-  }
-}
-
-
-// This implements an ordering on live ranges so that they are ordered by their
-// start positions.  This is needed for the correctness of the register
-// allocation algorithm.  If two live ranges start at the same offset then there
-// is a tie breaker based on where the value is first used.  This part of the
-// ordering is merely a heuristic.
-bool LiveRange::ShouldBeAllocatedBefore(const LiveRange* other) const {
-  LifetimePosition start = Start();
-  LifetimePosition other_start = other->Start();
-  if (start == other_start) {
-    UsePosition* pos = first_pos();
-    if (pos == nullptr) return false;
-    UsePosition* other_pos = other->first_pos();
-    if (other_pos == nullptr) return true;
-    return pos->pos() < other_pos->pos();
-  }
-  return start < other_start;
-}
-
-
-void LiveRange::SetUseHints(int register_index) {
-  for (UsePosition* pos = first_pos(); pos != nullptr; pos = pos->next()) {
-    if (!pos->HasOperand()) continue;
-    switch (pos->type()) {
-      case UsePositionType::kRequiresSlot:
-        break;
-      case UsePositionType::kRequiresRegister:
-      case UsePositionType::kAny:
-        pos->set_assigned_register(register_index);
-        break;
-    }
-  }
-}
-
-
-bool LiveRange::CanCover(LifetimePosition position) const {
-  if (IsEmpty()) return false;
-  return Start() <= position && position < End();
-}
-
-
-bool LiveRange::Covers(LifetimePosition position) const {
-  if (!CanCover(position)) return false;
-  UseInterval* start_search = FirstSearchIntervalForPosition(position);
-  for (UseInterval* interval = start_search; interval != nullptr;
-       interval = interval->next()) {
-    DCHECK(interval->next() == nullptr ||
-           interval->next()->start() >= interval->start());
-    AdvanceLastProcessedMarker(interval, position);
-    if (interval->Contains(position)) return true;
-    if (interval->start() > position) return false;
-  }
-  return false;
-}
-
-
-LifetimePosition LiveRange::FirstIntersection(LiveRange* other) const {
-  UseInterval* b = other->first_interval();
-  if (b == nullptr) return LifetimePosition::Invalid();
-  LifetimePosition advance_last_processed_up_to = b->start();
-  UseInterval* a = FirstSearchIntervalForPosition(b->start());
-  while (a != nullptr && b != nullptr) {
-    if (a->start() > other->End()) break;
-    if (b->start() > End()) break;
-    LifetimePosition cur_intersection = a->Intersect(b);
-    if (cur_intersection.IsValid()) {
-      return cur_intersection;
-    }
-    if (a->start() < b->start()) {
-      a = a->next();
-      if (a == nullptr || a->start() > other->End()) break;
-      AdvanceLastProcessedMarker(a, advance_last_processed_up_to);
-    } else {
-      b = b->next();
-    }
-  }
-  return LifetimePosition::Invalid();
-}
-
-void LiveRange::Print(const RegisterConfiguration* config,
-                      bool with_children) const {
-#ifndef V8_OS_STARBOARD
-  OFStream os(stdout);
-  PrintableLiveRange wrapper;
-  wrapper.register_configuration_ = config;
-  for (const LiveRange* i = this; i != nullptr; i = i->next()) {
-    wrapper.range_ = i;
-    os << wrapper << std::endl;
-    if (!with_children) break;
-  }
-#endif
-}
-
-
-void LiveRange::Print(bool with_children) const {
-  Print(RegisterConfiguration::Default(), with_children);
-}
-
-
-struct TopLevelLiveRange::SpillMoveInsertionList : ZoneObject {
-  SpillMoveInsertionList(int gap_index, InstructionOperand* operand,
-                         SpillMoveInsertionList* next)
-      : gap_index(gap_index), operand(operand), next(next) {}
-  const int gap_index;
-  InstructionOperand* const operand;
-  SpillMoveInsertionList* const next;
-};
-
-
-TopLevelLiveRange::TopLevelLiveRange(int vreg, MachineRepresentation rep)
-    : LiveRange(0, rep, this),
-      vreg_(vreg),
-      last_child_id_(0),
-      splintered_from_(nullptr),
-      spill_operand_(nullptr),
-      spill_move_insertion_locations_(nullptr),
-      spilled_in_deferred_blocks_(false),
-      spill_start_index_(kMaxInt),
-      last_pos_(nullptr),
-      splinter_(nullptr),
-      has_preassigned_slot_(false) {
-  bits_ |= SpillTypeField::encode(SpillType::kNoSpillType);
-}
-
-
-#if DEBUG
-int TopLevelLiveRange::debug_virt_reg() const {
-  return IsSplinter() ? splintered_from()->vreg() : vreg();
-}
-#endif
-
-
-void TopLevelLiveRange::RecordSpillLocation(Zone* zone, int gap_index,
-                                            InstructionOperand* operand) {
-  DCHECK(HasNoSpillType());
-  spill_move_insertion_locations_ = new (zone) SpillMoveInsertionList(
-      gap_index, operand, spill_move_insertion_locations_);
-}
-
-void TopLevelLiveRange::CommitSpillMoves(InstructionSequence* sequence,
-                                         const InstructionOperand& op,
-                                         bool might_be_duplicated) {
-  DCHECK_IMPLIES(op.IsConstant(), GetSpillMoveInsertionLocations() == nullptr);
-  Zone* zone = sequence->zone();
-
-  for (SpillMoveInsertionList* to_spill = GetSpillMoveInsertionLocations();
-       to_spill != nullptr; to_spill = to_spill->next) {
-    Instruction* instr = sequence->InstructionAt(to_spill->gap_index);
-    ParallelMove* move =
-        instr->GetOrCreateParallelMove(Instruction::START, zone);
-    // Skip insertion if it's possible that the move exists already as a
-    // constraint move from a fixed output register to a slot.
-    if (might_be_duplicated || has_preassigned_slot()) {
-      bool found = false;
-      for (MoveOperands* move_op : *move) {
-        if (move_op->IsEliminated()) continue;
-        if (move_op->source().Equals(*to_spill->operand) &&
-            move_op->destination().Equals(op)) {
-          found = true;
-          if (has_preassigned_slot()) move_op->Eliminate();
-          break;
-        }
-      }
-      if (found) continue;
-    }
-    if (!has_preassigned_slot()) {
-      move->AddMove(*to_spill->operand, op);
-    }
-  }
-}
-
-
-void TopLevelLiveRange::SetSpillOperand(InstructionOperand* operand) {
-  DCHECK(HasNoSpillType());
-  DCHECK(!operand->IsUnallocated() && !operand->IsImmediate());
-  set_spill_type(SpillType::kSpillOperand);
-  spill_operand_ = operand;
-}
-
-
-void TopLevelLiveRange::SetSpillRange(SpillRange* spill_range) {
-  DCHECK(!HasSpillOperand());
-  DCHECK(spill_range);
-  spill_range_ = spill_range;
-}
-
-
-AllocatedOperand TopLevelLiveRange::GetSpillRangeOperand() const {
-  SpillRange* spill_range = GetSpillRange();
-  int index = spill_range->assigned_slot();
-  return AllocatedOperand(LocationOperand::STACK_SLOT, representation(), index);
-}
-
-
-void TopLevelLiveRange::Splinter(LifetimePosition start, LifetimePosition end,
-                                 Zone* zone) {
-  DCHECK(start != Start() || end != End());
-  DCHECK(start < end);
-
-  TopLevelLiveRange splinter_temp(-1, representation());
-  UsePosition* last_in_splinter = nullptr;
-  // Live ranges defined in deferred blocks stay in deferred blocks, so we
-  // don't need to splinter them. That means that start should always be
-  // after the beginning of the range.
-  DCHECK(start > Start());
-
-  if (end >= End()) {
-    DCHECK(start > Start());
-    DetachAt(start, &splinter_temp, zone, ConnectHints);
-    next_ = nullptr;
-  } else {
-    DCHECK(start < End() && Start() < end);
-
-    const int kInvalidId = std::numeric_limits<int>::max();
-
-    UsePosition* last = DetachAt(start, &splinter_temp, zone, ConnectHints);
-
-    LiveRange end_part(kInvalidId, this->representation(), nullptr);
-    // The last chunk exits the deferred region, and we don't want to connect
-    // hints here, because the non-deferred region shouldn't be affected
-    // by allocation decisions on the deferred path.
-    last_in_splinter =
-        splinter_temp.DetachAt(end, &end_part, zone, DoNotConnectHints);
-
-    next_ = end_part.next_;
-    last_interval_->set_next(end_part.first_interval_);
-    // The next splinter will happen either at or after the current interval.
-    // We can optimize DetachAt by setting current_interval_ accordingly,
-    // which will then be picked up by FirstSearchIntervalForPosition.
-    current_interval_ = last_interval_;
-    last_interval_ = end_part.last_interval_;
-
-    if (first_pos_ == nullptr) {
-      first_pos_ = end_part.first_pos_;
-    } else {
-      splitting_pointer_ = last;
-      if (last != nullptr) last->set_next(end_part.first_pos_);
-    }
-  }
-
-  if (splinter()->IsEmpty()) {
-    splinter()->first_interval_ = splinter_temp.first_interval_;
-    splinter()->last_interval_ = splinter_temp.last_interval_;
-  } else {
-    splinter()->last_interval_->set_next(splinter_temp.first_interval_);
-    splinter()->last_interval_ = splinter_temp.last_interval_;
-  }
-  if (splinter()->first_pos() == nullptr) {
-    splinter()->first_pos_ = splinter_temp.first_pos_;
-  } else {
-    splinter()->last_pos_->set_next(splinter_temp.first_pos_);
-  }
-  if (last_in_splinter != nullptr) {
-    splinter()->last_pos_ = last_in_splinter;
-  } else {
-    if (splinter()->first_pos() != nullptr &&
-        splinter()->last_pos_ == nullptr) {
-      splinter()->last_pos_ = splinter()->first_pos();
-      for (UsePosition* pos = splinter()->first_pos(); pos != nullptr;
-           pos = pos->next()) {
-        splinter()->last_pos_ = pos;
-      }
-    }
-  }
-#if DEBUG
-  Verify();
-  splinter()->Verify();
-#endif
-}
-
-
-void TopLevelLiveRange::SetSplinteredFrom(TopLevelLiveRange* splinter_parent) {
-  splintered_from_ = splinter_parent;
-  if (!HasSpillOperand() && splinter_parent->spill_range_ != nullptr) {
-    SetSpillRange(splinter_parent->spill_range_);
-  }
-}
-
-
-void TopLevelLiveRange::UpdateSpillRangePostMerge(TopLevelLiveRange* merged) {
-  DCHECK(merged->TopLevel() == this);
-
-  if (HasNoSpillType() && merged->HasSpillRange()) {
-    set_spill_type(merged->spill_type());
-    DCHECK_LT(0, GetSpillRange()->live_ranges().size());
-    merged->spill_range_ = nullptr;
-    merged->bits_ =
-        SpillTypeField::update(merged->bits_, SpillType::kNoSpillType);
-  }
-}
-
-
-void TopLevelLiveRange::Merge(TopLevelLiveRange* other, Zone* zone) {
-  DCHECK(Start() < other->Start());
-  DCHECK(other->splintered_from() == this);
-
-  LiveRange* first = this;
-  LiveRange* second = other;
-  DCHECK(first->Start() < second->Start());
-  while (first != nullptr && second != nullptr) {
-    DCHECK(first != second);
-    // Make sure the ranges are in order each time we iterate.
-    if (second->Start() < first->Start()) {
-      LiveRange* tmp = second;
-      second = first;
-      first = tmp;
-      continue;
-    }
-
-    if (first->End() <= second->Start()) {
-      if (first->next() == nullptr ||
-          first->next()->Start() > second->Start()) {
-        // First is in order before second.
-        LiveRange* temp = first->next();
-        first->next_ = second;
-        first = temp;
-      } else {
-        // First is in order before its successor (or second), so advance first.
-        first = first->next();
-      }
-      continue;
-    }
-
-    DCHECK(first->Start() < second->Start());
-    // If first and second intersect, split first.
-    if (first->Start() < second->End() && second->Start() < first->End()) {
-      LiveRange* temp = first->SplitAt(second->Start(), zone);
-      CHECK(temp != first);
-      temp->set_spilled(first->spilled());
-      if (!temp->spilled())
-        temp->set_assigned_register(first->assigned_register());
-
-      first->next_ = second;
-      first = temp;
-      continue;
-    }
-    DCHECK(first->End() <= second->Start());
-  }
-
-  TopLevel()->UpdateParentForAllChildren(TopLevel());
-  TopLevel()->UpdateSpillRangePostMerge(other);
-  TopLevel()->set_has_slot_use(TopLevel()->has_slot_use() ||
-                               other->has_slot_use());
-
-#if DEBUG
-  Verify();
-#endif
-}
-
-
-void TopLevelLiveRange::VerifyChildrenInOrder() const {
-  LifetimePosition last_end = End();
-  for (const LiveRange* child = this->next(); child != nullptr;
-       child = child->next()) {
-    DCHECK(last_end <= child->Start());
-    last_end = child->End();
-  }
-}
-
-
-void TopLevelLiveRange::Verify() const {
-  VerifyChildrenInOrder();
-  for (const LiveRange* child = this; child != nullptr; child = child->next()) {
-    VerifyChildStructure();
-  }
-}
-
-
-void TopLevelLiveRange::ShortenTo(LifetimePosition start) {
-  TRACE("Shorten live range %d to [%d\n", vreg(), start.value());
-  DCHECK_NOT_NULL(first_interval_);
-  DCHECK(first_interval_->start() <= start);
-  DCHECK(start < first_interval_->end());
-  first_interval_->set_start(start);
-}
-
-
-void TopLevelLiveRange::EnsureInterval(LifetimePosition start,
-                                       LifetimePosition end, Zone* zone) {
-  TRACE("Ensure live range %d in interval [%d %d[\n", vreg(), start.value(),
-        end.value());
-  LifetimePosition new_end = end;
-  while (first_interval_ != nullptr && first_interval_->start() <= end) {
-    if (first_interval_->end() > end) {
-      new_end = first_interval_->end();
-    }
-    first_interval_ = first_interval_->next();
-  }
-
-  UseInterval* new_interval = new (zone) UseInterval(start, new_end);
-  new_interval->set_next(first_interval_);
-  first_interval_ = new_interval;
-  if (new_interval->next() == nullptr) {
-    last_interval_ = new_interval;
-  }
-}
-
-
-void TopLevelLiveRange::AddUseInterval(LifetimePosition start,
-                                       LifetimePosition end, Zone* zone) {
-  TRACE("Add to live range %d interval [%d %d[\n", vreg(), start.value(),
-        end.value());
-  if (first_interval_ == nullptr) {
-    UseInterval* interval = new (zone) UseInterval(start, end);
-    first_interval_ = interval;
-    last_interval_ = interval;
-  } else {
-    if (end == first_interval_->start()) {
-      first_interval_->set_start(start);
-    } else if (end < first_interval_->start()) {
-      UseInterval* interval = new (zone) UseInterval(start, end);
-      interval->set_next(first_interval_);
-      first_interval_ = interval;
-    } else {
-      // Order of instruction's processing (see ProcessInstructions) guarantees
-      // that each new use interval either precedes, intersects with or touches
-      // the last added interval.
-      DCHECK(start <= first_interval_->end());
-      first_interval_->set_start(Min(start, first_interval_->start()));
-      first_interval_->set_end(Max(end, first_interval_->end()));
-    }
-  }
-}
-
-
-void TopLevelLiveRange::AddUsePosition(UsePosition* use_pos) {
-  LifetimePosition pos = use_pos->pos();
-  TRACE("Add to live range %d use position %d\n", vreg(), pos.value());
-  UsePosition* prev_hint = nullptr;
-  UsePosition* prev = nullptr;
-  UsePosition* current = first_pos_;
-  while (current != nullptr && current->pos() < pos) {
-    prev_hint = current->HasHint() ? current : prev_hint;
-    prev = current;
-    current = current->next();
-  }
-
-  if (prev == nullptr) {
-    use_pos->set_next(first_pos_);
-    first_pos_ = use_pos;
-  } else {
-    use_pos->set_next(prev->next());
-    prev->set_next(use_pos);
-  }
-
-  if (prev_hint == nullptr && use_pos->HasHint()) {
-    current_hint_position_ = use_pos;
-  }
-}
-
-
-static bool AreUseIntervalsIntersecting(UseInterval* interval1,
-                                        UseInterval* interval2) {
-  while (interval1 != nullptr && interval2 != nullptr) {
-    if (interval1->start() < interval2->start()) {
-      if (interval1->end() > interval2->start()) {
-        return true;
-      }
-      interval1 = interval1->next();
-    } else {
-      if (interval2->end() > interval1->start()) {
-        return true;
-      }
-      interval2 = interval2->next();
-    }
-  }
-  return false;
-}
-
-
-std::ostream& operator<<(std::ostream& os,
-                         const PrintableLiveRange& printable_range) {
-  const LiveRange* range = printable_range.range_;
-  os << "Range: " << range->TopLevel()->vreg() << ":" << range->relative_id()
-     << " ";
-  if (range->TopLevel()->is_phi()) os << "phi ";
-  if (range->TopLevel()->is_non_loop_phi()) os << "nlphi ";
-
-  os << "{" << std::endl;
-  UseInterval* interval = range->first_interval();
-  UsePosition* use_pos = range->first_pos();
-  PrintableInstructionOperand pio;
-  pio.register_configuration_ = printable_range.register_configuration_;
-  while (use_pos != nullptr) {
-    if (use_pos->HasOperand()) {
-      pio.op_ = *use_pos->operand();
-      os << pio << use_pos->pos() << " ";
-    }
-    use_pos = use_pos->next();
-  }
-  os << std::endl;
-
-  while (interval != nullptr) {
-    os << '[' << interval->start() << ", " << interval->end() << ')'
-       << std::endl;
-    interval = interval->next();
-  }
-  os << "}";
-  return os;
-}
-
-SpillRange::SpillRange(TopLevelLiveRange* parent, Zone* zone)
-    : live_ranges_(zone),
-      assigned_slot_(kUnassignedSlot),
-      byte_width_(GetByteWidth(parent->representation())) {
-  // Spill ranges are created for top level, non-splintered ranges. This is so
-  // that, when merging decisions are made, we consider the full extent of the
-  // virtual register, and avoid clobbering it.
-  DCHECK(!parent->IsSplinter());
-  UseInterval* result = nullptr;
-  UseInterval* node = nullptr;
-  // Copy the intervals for all ranges.
-  for (LiveRange* range = parent; range != nullptr; range = range->next()) {
-    UseInterval* src = range->first_interval();
-    while (src != nullptr) {
-      UseInterval* new_node = new (zone) UseInterval(src->start(), src->end());
-      if (result == nullptr) {
-        result = new_node;
-      } else {
-        node->set_next(new_node);
-      }
-      node = new_node;
-      src = src->next();
-    }
-  }
-  use_interval_ = result;
-  live_ranges().push_back(parent);
-  end_position_ = node->end();
-  parent->SetSpillRange(this);
-}
-
-bool SpillRange::IsIntersectingWith(SpillRange* other) const {
-  if (this->use_interval_ == nullptr || other->use_interval_ == nullptr ||
-      this->End() <= other->use_interval_->start() ||
-      other->End() <= this->use_interval_->start()) {
-    return false;
-  }
-  return AreUseIntervalsIntersecting(use_interval_, other->use_interval_);
-}
-
-
-bool SpillRange::TryMerge(SpillRange* other) {
-  if (HasSlot() || other->HasSlot()) return false;
-  if (byte_width() != other->byte_width() || IsIntersectingWith(other))
-    return false;
-
-  LifetimePosition max = LifetimePosition::MaxPosition();
-  if (End() < other->End() && other->End() != max) {
-    end_position_ = other->End();
-  }
-  other->end_position_ = max;
-
-  MergeDisjointIntervals(other->use_interval_);
-  other->use_interval_ = nullptr;
-
-  for (TopLevelLiveRange* range : other->live_ranges()) {
-    DCHECK(range->GetSpillRange() == other);
-    range->SetSpillRange(this);
-  }
-
-  live_ranges().insert(live_ranges().end(), other->live_ranges().begin(),
-                       other->live_ranges().end());
-  other->live_ranges().clear();
-
-  return true;
-}
-
-
-void SpillRange::MergeDisjointIntervals(UseInterval* other) {
-  UseInterval* tail = nullptr;
-  UseInterval* current = use_interval_;
-  while (other != nullptr) {
-    // Make sure the 'current' list starts first
-    if (current == nullptr || current->start() > other->start()) {
-      std::swap(current, other);
-    }
-    // Check disjointness
-    DCHECK(other == nullptr || current->end() <= other->start());
-    // Append the 'current' node to the result accumulator and move forward
-    if (tail == nullptr) {
-      use_interval_ = current;
-    } else {
-      tail->set_next(current);
-    }
-    tail = current;
-    current = current->next();
-  }
-  // Other list is empty => we are done
-}
-
-
-void SpillRange::Print() const {
-#ifndef V8_OS_STARBOARD
-  OFStream os(stdout);
-  os << "{" << std::endl;
-  for (TopLevelLiveRange* range : live_ranges()) {
-    os << range->vreg() << " ";
-  }
-  os << std::endl;
-
-  for (UseInterval* i = interval(); i != nullptr; i = i->next()) {
-    os << '[' << i->start() << ", " << i->end() << ')' << std::endl;
-  }
-  os << "}" << std::endl;
-#endif
-}
-
-
-RegisterAllocationData::PhiMapValue::PhiMapValue(PhiInstruction* phi,
-                                                 const InstructionBlock* block,
-                                                 Zone* zone)
-    : phi_(phi),
-      block_(block),
-      incoming_operands_(zone),
-      assigned_register_(kUnassignedRegister) {
-  incoming_operands_.reserve(phi->operands().size());
-}
-
-
-void RegisterAllocationData::PhiMapValue::AddOperand(
-    InstructionOperand* operand) {
-  incoming_operands_.push_back(operand);
-}
-
-
-void RegisterAllocationData::PhiMapValue::CommitAssignment(
-    const InstructionOperand& assigned) {
-  for (InstructionOperand* operand : incoming_operands_) {
-    InstructionOperand::ReplaceWith(operand, &assigned);
-  }
-}
-
-RegisterAllocationData::RegisterAllocationData(
-    const RegisterConfiguration* config, Zone* zone, Frame* frame,
-    InstructionSequence* code, const char* debug_name)
-    : allocation_zone_(zone),
-      frame_(frame),
-      code_(code),
-      debug_name_(debug_name),
-      config_(config),
-      phi_map_(allocation_zone()),
-      live_in_sets_(code->InstructionBlockCount(), nullptr, allocation_zone()),
-      live_out_sets_(code->InstructionBlockCount(), nullptr, allocation_zone()),
-      live_ranges_(code->VirtualRegisterCount() * 2, nullptr,
-                   allocation_zone()),
-      fixed_live_ranges_(this->config()->num_general_registers(), nullptr,
-                         allocation_zone()),
-      fixed_float_live_ranges_(allocation_zone()),
-      fixed_double_live_ranges_(this->config()->num_double_registers(), nullptr,
-                                allocation_zone()),
-      fixed_simd128_live_ranges_(allocation_zone()),
-      spill_ranges_(code->VirtualRegisterCount(), nullptr, allocation_zone()),
-      delayed_references_(allocation_zone()),
-      assigned_registers_(nullptr),
-      assigned_double_registers_(nullptr),
-      virtual_register_count_(code->VirtualRegisterCount()),
-      preassigned_slot_ranges_(zone) {
-  if (!kSimpleFPAliasing) {
-    fixed_float_live_ranges_.resize(this->config()->num_float_registers(),
-                                    nullptr);
-    fixed_simd128_live_ranges_.resize(this->config()->num_simd128_registers(),
-                                      nullptr);
-  }
-
-  assigned_registers_ = new (code_zone())
-      BitVector(this->config()->num_general_registers(), code_zone());
-  assigned_double_registers_ = new (code_zone())
-      BitVector(this->config()->num_double_registers(), code_zone());
-  this->frame()->SetAllocatedRegisters(assigned_registers_);
-  this->frame()->SetAllocatedDoubleRegisters(assigned_double_registers_);
-}
-
-
-MoveOperands* RegisterAllocationData::AddGapMove(
-    int index, Instruction::GapPosition position,
-    const InstructionOperand& from, const InstructionOperand& to) {
-  Instruction* instr = code()->InstructionAt(index);
-  ParallelMove* moves = instr->GetOrCreateParallelMove(position, code_zone());
-  return moves->AddMove(from, to);
-}
-
-
-MachineRepresentation RegisterAllocationData::RepresentationFor(
-    int virtual_register) {
-  DCHECK_LT(virtual_register, code()->VirtualRegisterCount());
-  return code()->GetRepresentation(virtual_register);
-}
-
-
-TopLevelLiveRange* RegisterAllocationData::GetOrCreateLiveRangeFor(int index) {
-  if (index >= static_cast<int>(live_ranges().size())) {
-    live_ranges().resize(index + 1, nullptr);
-  }
-  TopLevelLiveRange* result = live_ranges()[index];
-  if (result == nullptr) {
-    result = NewLiveRange(index, RepresentationFor(index));
-    live_ranges()[index] = result;
-  }
-  return result;
-}
-
-
-TopLevelLiveRange* RegisterAllocationData::NewLiveRange(
-    int index, MachineRepresentation rep) {
-  return new (allocation_zone()) TopLevelLiveRange(index, rep);
-}
-
-
-int RegisterAllocationData::GetNextLiveRangeId() {
-  int vreg = virtual_register_count_++;
-  if (vreg >= static_cast<int>(live_ranges().size())) {
-    live_ranges().resize(vreg + 1, nullptr);
-  }
-  return vreg;
-}
-
-
-TopLevelLiveRange* RegisterAllocationData::NextLiveRange(
-    MachineRepresentation rep) {
-  int vreg = GetNextLiveRangeId();
-  TopLevelLiveRange* ret = NewLiveRange(vreg, rep);
-  return ret;
-}
-
-
-RegisterAllocationData::PhiMapValue* RegisterAllocationData::InitializePhiMap(
-    const InstructionBlock* block, PhiInstruction* phi) {
-  RegisterAllocationData::PhiMapValue* map_value = new (allocation_zone())
-      RegisterAllocationData::PhiMapValue(phi, block, allocation_zone());
-  auto res =
-      phi_map_.insert(std::make_pair(phi->virtual_register(), map_value));
-  DCHECK(res.second);
-  USE(res);
-  return map_value;
-}
-
-
-RegisterAllocationData::PhiMapValue* RegisterAllocationData::GetPhiMapValueFor(
-    int virtual_register) {
-  auto it = phi_map_.find(virtual_register);
-  DCHECK(it != phi_map_.end());
-  return it->second;
-}
-
-
-RegisterAllocationData::PhiMapValue* RegisterAllocationData::GetPhiMapValueFor(
-    TopLevelLiveRange* top_range) {
-  return GetPhiMapValueFor(top_range->vreg());
-}
-
-
-bool RegisterAllocationData::ExistsUseWithoutDefinition() {
-  bool found = false;
-  BitVector::Iterator iterator(live_in_sets()[0]);
-  while (!iterator.Done()) {
-    found = true;
-    int operand_index = iterator.Current();
-    PrintF("Register allocator error: live v%d reached first block.\n",
-           operand_index);
-    LiveRange* range = GetOrCreateLiveRangeFor(operand_index);
-    PrintF("  (first use is at %d)\n", range->first_pos()->pos().value());
-    if (debug_name() == nullptr) {
-      PrintF("\n");
-    } else {
-      PrintF("  (function: %s)\n", debug_name());
-    }
-    iterator.Advance();
-  }
-  return found;
-}
-
-
-// If a range is defined in a deferred block, we can expect all the range
-// to only cover positions in deferred blocks. Otherwise, a block on the
-// hot path would be dominated by a deferred block, meaning it is unreachable
-// without passing through the deferred block, which is contradictory.
-// In particular, when such a range contributes a result back on the hot
-// path, it will be as one of the inputs of a phi. In that case, the value
-// will be transferred via a move in the Gap::END's of the last instruction
-// of a deferred block.
-bool RegisterAllocationData::RangesDefinedInDeferredStayInDeferred() {
-  for (const TopLevelLiveRange* range : live_ranges()) {
-    if (range == nullptr || range->IsEmpty() ||
-        !code()
-             ->GetInstructionBlock(range->Start().ToInstructionIndex())
-             ->IsDeferred()) {
-      continue;
-    }
-    for (const UseInterval* i = range->first_interval(); i != nullptr;
-         i = i->next()) {
-      int first = i->FirstGapIndex();
-      int last = i->LastGapIndex();
-      for (int instr = first; instr <= last;) {
-        const InstructionBlock* block = code()->GetInstructionBlock(instr);
-        if (!block->IsDeferred()) return false;
-        instr = block->last_instruction_index() + 1;
-      }
-    }
-  }
-  return true;
-}
-
-SpillRange* RegisterAllocationData::AssignSpillRangeToLiveRange(
-    TopLevelLiveRange* range) {
-  DCHECK(!range->HasSpillOperand());
-
-  SpillRange* spill_range = range->GetAllocatedSpillRange();
-  if (spill_range == nullptr) {
-    DCHECK(!range->IsSplinter());
-    spill_range = new (allocation_zone()) SpillRange(range, allocation_zone());
-  }
-  range->set_spill_type(TopLevelLiveRange::SpillType::kSpillRange);
-
-  int spill_range_index =
-      range->IsSplinter() ? range->splintered_from()->vreg() : range->vreg();
-
-  spill_ranges()[spill_range_index] = spill_range;
-
-  return spill_range;
-}
-
-
-SpillRange* RegisterAllocationData::CreateSpillRangeForLiveRange(
-    TopLevelLiveRange* range) {
-  DCHECK(!range->HasSpillOperand());
-  DCHECK(!range->IsSplinter());
-  SpillRange* spill_range =
-      new (allocation_zone()) SpillRange(range, allocation_zone());
-  return spill_range;
-}
-
-void RegisterAllocationData::MarkAllocated(MachineRepresentation rep,
-                                           int index) {
-  switch (rep) {
-    case MachineRepresentation::kFloat32:
-    case MachineRepresentation::kSimd128:
-      if (kSimpleFPAliasing) {
-        assigned_double_registers_->Add(index);
-      } else {
-        int alias_base_index = -1;
-        int aliases = config()->GetAliases(
-            rep, index, MachineRepresentation::kFloat64, &alias_base_index);
-        DCHECK(aliases > 0 || (aliases == 0 && alias_base_index == -1));
-        while (aliases--) {
-          int aliased_reg = alias_base_index + aliases;
-          assigned_double_registers_->Add(aliased_reg);
-        }
-      }
-      break;
-    case MachineRepresentation::kFloat64:
-      assigned_double_registers_->Add(index);
-      break;
-    default:
-      DCHECK(!IsFloatingPoint(rep));
-      assigned_registers_->Add(index);
-      break;
-  }
-}
-
-bool RegisterAllocationData::IsBlockBoundary(LifetimePosition pos) const {
-  return pos.IsFullStart() &&
-         code()->GetInstructionBlock(pos.ToInstructionIndex())->code_start() ==
-             pos.ToInstructionIndex();
-}
-
-
-ConstraintBuilder::ConstraintBuilder(RegisterAllocationData* data)
-    : data_(data) {}
-
-
-InstructionOperand* ConstraintBuilder::AllocateFixed(
-    UnallocatedOperand* operand, int pos, bool is_tagged) {
-  TRACE("Allocating fixed reg for op %d\n", operand->virtual_register());
-  DCHECK(operand->HasFixedPolicy());
-  InstructionOperand allocated;
-  MachineRepresentation rep = InstructionSequence::DefaultRepresentation();
-  int virtual_register = operand->virtual_register();
-  if (virtual_register != InstructionOperand::kInvalidVirtualRegister) {
-    rep = data()->RepresentationFor(virtual_register);
-  }
-  if (operand->HasFixedSlotPolicy()) {
-    allocated = AllocatedOperand(AllocatedOperand::STACK_SLOT, rep,
-                                 operand->fixed_slot_index());
-  } else if (operand->HasFixedRegisterPolicy()) {
-    DCHECK(!IsFloatingPoint(rep));
-    DCHECK(data()->config()->IsAllocatableGeneralCode(
-        operand->fixed_register_index()));
-    allocated = AllocatedOperand(AllocatedOperand::REGISTER, rep,
-                                 operand->fixed_register_index());
-  } else if (operand->HasFixedFPRegisterPolicy()) {
-    DCHECK(IsFloatingPoint(rep));
-    DCHECK_NE(InstructionOperand::kInvalidVirtualRegister, virtual_register);
-    allocated = AllocatedOperand(AllocatedOperand::REGISTER, rep,
-                                 operand->fixed_register_index());
-  } else {
-    UNREACHABLE();
-  }
-  InstructionOperand::ReplaceWith(operand, &allocated);
-  if (is_tagged) {
-    TRACE("Fixed reg is tagged at %d\n", pos);
-    Instruction* instr = code()->InstructionAt(pos);
-    if (instr->HasReferenceMap()) {
-      instr->reference_map()->RecordReference(*AllocatedOperand::cast(operand));
-    }
-  }
-  return operand;
-}
-
-
-void ConstraintBuilder::MeetRegisterConstraints() {
-  for (InstructionBlock* block : code()->instruction_blocks()) {
-    MeetRegisterConstraints(block);
-  }
-}
-
-
-void ConstraintBuilder::MeetRegisterConstraints(const InstructionBlock* block) {
-  int start = block->first_instruction_index();
-  int end = block->last_instruction_index();
-  DCHECK_NE(-1, start);
-  for (int i = start; i <= end; ++i) {
-    MeetConstraintsBefore(i);
-    if (i != end) MeetConstraintsAfter(i);
-  }
-  // Meet register constraints for the instruction in the end.
-  MeetRegisterConstraintsForLastInstructionInBlock(block);
-}
-
-
-void ConstraintBuilder::MeetRegisterConstraintsForLastInstructionInBlock(
-    const InstructionBlock* block) {
-  int end = block->last_instruction_index();
-  Instruction* last_instruction = code()->InstructionAt(end);
-  for (size_t i = 0; i < last_instruction->OutputCount(); i++) {
-    InstructionOperand* output_operand = last_instruction->OutputAt(i);
-    DCHECK(!output_operand->IsConstant());
-    UnallocatedOperand* output = UnallocatedOperand::cast(output_operand);
-    int output_vreg = output->virtual_register();
-    TopLevelLiveRange* range = data()->GetOrCreateLiveRangeFor(output_vreg);
-    bool assigned = false;
-    if (output->HasFixedPolicy()) {
-      AllocateFixed(output, -1, false);
-      // This value is produced on the stack, we never need to spill it.
-      if (output->IsStackSlot()) {
-        DCHECK(LocationOperand::cast(output)->index() <
-               data()->frame()->GetSpillSlotCount());
-        range->SetSpillOperand(LocationOperand::cast(output));
-        range->SetSpillStartIndex(end);
-        assigned = true;
-      }
-
-      for (const RpoNumber& succ : block->successors()) {
-        const InstructionBlock* successor = code()->InstructionBlockAt(succ);
-        DCHECK_EQ(1, successor->PredecessorCount());
-        int gap_index = successor->first_instruction_index();
-        // Create an unconstrained operand for the same virtual register
-        // and insert a gap move from the fixed output to the operand.
-        UnallocatedOperand output_copy(UnallocatedOperand::ANY, output_vreg);
-        data()->AddGapMove(gap_index, Instruction::START, *output, output_copy);
-      }
-    }
-
-    if (!assigned) {
-      for (const RpoNumber& succ : block->successors()) {
-        const InstructionBlock* successor = code()->InstructionBlockAt(succ);
-        DCHECK_EQ(1, successor->PredecessorCount());
-        int gap_index = successor->first_instruction_index();
-        range->RecordSpillLocation(allocation_zone(), gap_index, output);
-        range->SetSpillStartIndex(gap_index);
-      }
-    }
-  }
-}
-
-
-void ConstraintBuilder::MeetConstraintsAfter(int instr_index) {
-  Instruction* first = code()->InstructionAt(instr_index);
-  // Handle fixed temporaries.
-  for (size_t i = 0; i < first->TempCount(); i++) {
-    UnallocatedOperand* temp = UnallocatedOperand::cast(first->TempAt(i));
-    if (temp->HasFixedPolicy()) AllocateFixed(temp, instr_index, false);
-  }
-  // Handle constant/fixed output operands.
-  for (size_t i = 0; i < first->OutputCount(); i++) {
-    InstructionOperand* output = first->OutputAt(i);
-    if (output->IsConstant()) {
-      int output_vreg = ConstantOperand::cast(output)->virtual_register();
-      TopLevelLiveRange* range = data()->GetOrCreateLiveRangeFor(output_vreg);
-      range->SetSpillStartIndex(instr_index + 1);
-      range->SetSpillOperand(output);
-      continue;
-    }
-    UnallocatedOperand* first_output = UnallocatedOperand::cast(output);
-    TopLevelLiveRange* range =
-        data()->GetOrCreateLiveRangeFor(first_output->virtual_register());
-    bool assigned = false;
-    if (first_output->HasFixedPolicy()) {
-      int output_vreg = first_output->virtual_register();
-      UnallocatedOperand output_copy(UnallocatedOperand::ANY, output_vreg);
-      bool is_tagged = code()->IsReference(output_vreg);
-      if (first_output->HasSecondaryStorage()) {
-        range->MarkHasPreassignedSlot();
-        data()->preassigned_slot_ranges().push_back(
-            std::make_pair(range, first_output->GetSecondaryStorage()));
-      }
-      AllocateFixed(first_output, instr_index, is_tagged);
-
-      // This value is produced on the stack, we never need to spill it.
-      if (first_output->IsStackSlot()) {
-        DCHECK(LocationOperand::cast(first_output)->index() <
-               data()->frame()->GetTotalFrameSlotCount());
-        range->SetSpillOperand(LocationOperand::cast(first_output));
-        range->SetSpillStartIndex(instr_index + 1);
-        assigned = true;
-      }
-      data()->AddGapMove(instr_index + 1, Instruction::START, *first_output,
-                         output_copy);
-    }
-    // Make sure we add a gap move for spilling (if we have not done
-    // so already).
-    if (!assigned) {
-      range->RecordSpillLocation(allocation_zone(), instr_index + 1,
-                                 first_output);
-      range->SetSpillStartIndex(instr_index + 1);
-    }
-  }
-}
-
-
-void ConstraintBuilder::MeetConstraintsBefore(int instr_index) {
-  Instruction* second = code()->InstructionAt(instr_index);
-  // Handle fixed input operands of second instruction.
-  for (size_t i = 0; i < second->InputCount(); i++) {
-    InstructionOperand* input = second->InputAt(i);
-    if (input->IsImmediate() || input->IsExplicit()) {
-      continue;  // Ignore immediates and explicitly reserved registers.
-    }
-    UnallocatedOperand* cur_input = UnallocatedOperand::cast(input);
-    if (cur_input->HasFixedPolicy()) {
-      int input_vreg = cur_input->virtual_register();
-      UnallocatedOperand input_copy(UnallocatedOperand::ANY, input_vreg);
-      bool is_tagged = code()->IsReference(input_vreg);
-      AllocateFixed(cur_input, instr_index, is_tagged);
-      data()->AddGapMove(instr_index, Instruction::END, input_copy, *cur_input);
-    }
-  }
-  // Handle "output same as input" for second instruction.
-  for (size_t i = 0; i < second->OutputCount(); i++) {
-    InstructionOperand* output = second->OutputAt(i);
-    if (!output->IsUnallocated()) continue;
-    UnallocatedOperand* second_output = UnallocatedOperand::cast(output);
-    if (!second_output->HasSameAsInputPolicy()) continue;
-    DCHECK_EQ(0, i);  // Only valid for first output.
-    UnallocatedOperand* cur_input =
-        UnallocatedOperand::cast(second->InputAt(0));
-    int output_vreg = second_output->virtual_register();
-    int input_vreg = cur_input->virtual_register();
-    UnallocatedOperand input_copy(UnallocatedOperand::ANY, input_vreg);
-    *cur_input =
-        UnallocatedOperand(*cur_input, second_output->virtual_register());
-    MoveOperands* gap_move = data()->AddGapMove(instr_index, Instruction::END,
-                                                input_copy, *cur_input);
-    if (code()->IsReference(input_vreg) && !code()->IsReference(output_vreg)) {
-      if (second->HasReferenceMap()) {
-        RegisterAllocationData::DelayedReference delayed_reference = {
-            second->reference_map(), &gap_move->source()};
-        data()->delayed_references().push_back(delayed_reference);
-      }
-    } else if (!code()->IsReference(input_vreg) &&
-               code()->IsReference(output_vreg)) {
-      // The input is assumed to immediately have a tagged representation,
-      // before the pointer map can be used. I.e. the pointer map at the
-      // instruction will include the output operand (whose value at the
-      // beginning of the instruction is equal to the input operand). If
-      // this is not desired, then the pointer map at this instruction needs
-      // to be adjusted manually.
-    }
-  }
-}
-
-
-void ConstraintBuilder::ResolvePhis() {
-  // Process the blocks in reverse order.
-  for (InstructionBlock* block : base::Reversed(code()->instruction_blocks())) {
-    ResolvePhis(block);
-  }
-}
-
-
-void ConstraintBuilder::ResolvePhis(const InstructionBlock* block) {
-  for (PhiInstruction* phi : block->phis()) {
-    int phi_vreg = phi->virtual_register();
-    RegisterAllocationData::PhiMapValue* map_value =
-        data()->InitializePhiMap(block, phi);
-    InstructionOperand& output = phi->output();
-    // Map the destination operands, so the commitment phase can find them.
-    for (size_t i = 0; i < phi->operands().size(); ++i) {
-      InstructionBlock* cur_block =
-          code()->InstructionBlockAt(block->predecessors()[i]);
-      UnallocatedOperand input(UnallocatedOperand::ANY, phi->operands()[i]);
-      MoveOperands* move = data()->AddGapMove(
-          cur_block->last_instruction_index(), Instruction::END, input, output);
-      map_value->AddOperand(&move->destination());
-      DCHECK(!code()
-                  ->InstructionAt(cur_block->last_instruction_index())
-                  ->HasReferenceMap());
-    }
-    TopLevelLiveRange* live_range = data()->GetOrCreateLiveRangeFor(phi_vreg);
-    int gap_index = block->first_instruction_index();
-    live_range->RecordSpillLocation(allocation_zone(), gap_index, &output);
-    live_range->SetSpillStartIndex(gap_index);
-    // We use the phi-ness of some nodes in some later heuristics.
-    live_range->set_is_phi(true);
-    live_range->set_is_non_loop_phi(!block->IsLoopHeader());
-  }
-}
-
-
-LiveRangeBuilder::LiveRangeBuilder(RegisterAllocationData* data,
-                                   Zone* local_zone)
-    : data_(data), phi_hints_(local_zone) {}
-
-
-BitVector* LiveRangeBuilder::ComputeLiveOut(const InstructionBlock* block,
-                                            RegisterAllocationData* data) {
-  size_t block_index = block->rpo_number().ToSize();
-  BitVector* live_out = data->live_out_sets()[block_index];
-  if (live_out == nullptr) {
-    // Compute live out for the given block, except not including backward
-    // successor edges.
-    Zone* zone = data->allocation_zone();
-    const InstructionSequence* code = data->code();
-
-    live_out = new (zone) BitVector(code->VirtualRegisterCount(), zone);
-
-    // Process all successor blocks.
-    for (const RpoNumber& succ : block->successors()) {
-      // Add values live on entry to the successor.
-      if (succ <= block->rpo_number()) continue;
-      BitVector* live_in = data->live_in_sets()[succ.ToSize()];
-      if (live_in != nullptr) live_out->Union(*live_in);
-
-      // All phi input operands corresponding to this successor edge are live
-      // out from this block.
-      const InstructionBlock* successor = code->InstructionBlockAt(succ);
-      size_t index = successor->PredecessorIndexOf(block->rpo_number());
-      DCHECK(index < successor->PredecessorCount());
-      for (PhiInstruction* phi : successor->phis()) {
-        live_out->Add(phi->operands()[index]);
-      }
-    }
-    data->live_out_sets()[block_index] = live_out;
-  }
-  return live_out;
-}
-
-
-void LiveRangeBuilder::AddInitialIntervals(const InstructionBlock* block,
-                                           BitVector* live_out) {
-  // Add an interval that includes the entire block to the live range for
-  // each live_out value.
-  LifetimePosition start = LifetimePosition::GapFromInstructionIndex(
-      block->first_instruction_index());
-  LifetimePosition end = LifetimePosition::InstructionFromInstructionIndex(
-                             block->last_instruction_index())
-                             .NextStart();
-  BitVector::Iterator iterator(live_out);
-  while (!iterator.Done()) {
-    int operand_index = iterator.Current();
-    TopLevelLiveRange* range = data()->GetOrCreateLiveRangeFor(operand_index);
-    range->AddUseInterval(start, end, allocation_zone());
-    iterator.Advance();
-  }
-}
-
-int LiveRangeBuilder::FixedFPLiveRangeID(int index, MachineRepresentation rep) {
-  int result = -index - 1;
-  switch (rep) {
-    case MachineRepresentation::kSimd128:
-      result -= config()->num_float_registers();
-    // Fall through.
-    case MachineRepresentation::kFloat32:
-      result -= config()->num_double_registers();
-    // Fall through.
-    case MachineRepresentation::kFloat64:
-      result -= config()->num_general_registers();
-      break;
-    default:
-      UNREACHABLE();
-      break;
-  }
-  return result;
-}
-
-TopLevelLiveRange* LiveRangeBuilder::FixedLiveRangeFor(int index) {
-  DCHECK(index < config()->num_general_registers());
-  TopLevelLiveRange* result = data()->fixed_live_ranges()[index];
-  if (result == nullptr) {
-    MachineRepresentation rep = InstructionSequence::DefaultRepresentation();
-    result = data()->NewLiveRange(FixedLiveRangeID(index), rep);
-    DCHECK(result->IsFixed());
-    result->set_assigned_register(index);
-    data()->MarkAllocated(rep, index);
-    data()->fixed_live_ranges()[index] = result;
-  }
-  return result;
-}
-
-TopLevelLiveRange* LiveRangeBuilder::FixedFPLiveRangeFor(
-    int index, MachineRepresentation rep) {
-  int num_regs = config()->num_double_registers();
-  ZoneVector<TopLevelLiveRange*>* live_ranges =
-      &data()->fixed_double_live_ranges();
-  if (!kSimpleFPAliasing) {
-    switch (rep) {
-      case MachineRepresentation::kFloat32:
-        num_regs = config()->num_float_registers();
-        live_ranges = &data()->fixed_float_live_ranges();
-        break;
-      case MachineRepresentation::kSimd128:
-        num_regs = config()->num_simd128_registers();
-        live_ranges = &data()->fixed_simd128_live_ranges();
-        break;
-      default:
-        break;
-    }
-  }
-
-  DCHECK(index < num_regs);
-  USE(num_regs);
-  TopLevelLiveRange* result = (*live_ranges)[index];
-  if (result == nullptr) {
-    result = data()->NewLiveRange(FixedFPLiveRangeID(index, rep), rep);
-    DCHECK(result->IsFixed());
-    result->set_assigned_register(index);
-    data()->MarkAllocated(rep, index);
-    (*live_ranges)[index] = result;
-  }
-  return result;
-}
-
-TopLevelLiveRange* LiveRangeBuilder::LiveRangeFor(InstructionOperand* operand) {
-  if (operand->IsUnallocated()) {
-    return data()->GetOrCreateLiveRangeFor(
-        UnallocatedOperand::cast(operand)->virtual_register());
-  } else if (operand->IsConstant()) {
-    return data()->GetOrCreateLiveRangeFor(
-        ConstantOperand::cast(operand)->virtual_register());
-  } else if (operand->IsRegister()) {
-    return FixedLiveRangeFor(
-        LocationOperand::cast(operand)->GetRegister().code());
-  } else if (operand->IsFPRegister()) {
-    LocationOperand* op = LocationOperand::cast(operand);
-    return FixedFPLiveRangeFor(op->register_code(), op->representation());
-  } else {
-    return nullptr;
-  }
-}
-
-
-UsePosition* LiveRangeBuilder::NewUsePosition(LifetimePosition pos,
-                                              InstructionOperand* operand,
-                                              void* hint,
-                                              UsePositionHintType hint_type) {
-  return new (allocation_zone()) UsePosition(pos, operand, hint, hint_type);
-}
-
-
-UsePosition* LiveRangeBuilder::Define(LifetimePosition position,
-                                      InstructionOperand* operand, void* hint,
-                                      UsePositionHintType hint_type) {
-  TopLevelLiveRange* range = LiveRangeFor(operand);
-  if (range == nullptr) return nullptr;
-
-  if (range->IsEmpty() || range->Start() > position) {
-    // Can happen if there is a definition without use.
-    range->AddUseInterval(position, position.NextStart(), allocation_zone());
-    range->AddUsePosition(NewUsePosition(position.NextStart()));
-  } else {
-    range->ShortenTo(position);
-  }
-  if (!operand->IsUnallocated()) return nullptr;
-  UnallocatedOperand* unalloc_operand = UnallocatedOperand::cast(operand);
-  UsePosition* use_pos =
-      NewUsePosition(position, unalloc_operand, hint, hint_type);
-  range->AddUsePosition(use_pos);
-  return use_pos;
-}
-
-
-UsePosition* LiveRangeBuilder::Use(LifetimePosition block_start,
-                                   LifetimePosition position,
-                                   InstructionOperand* operand, void* hint,
-                                   UsePositionHintType hint_type) {
-  TopLevelLiveRange* range = LiveRangeFor(operand);
-  if (range == nullptr) return nullptr;
-  UsePosition* use_pos = nullptr;
-  if (operand->IsUnallocated()) {
-    UnallocatedOperand* unalloc_operand = UnallocatedOperand::cast(operand);
-    use_pos = NewUsePosition(position, unalloc_operand, hint, hint_type);
-    range->AddUsePosition(use_pos);
-  }
-  range->AddUseInterval(block_start, position, allocation_zone());
-  return use_pos;
-}
-
-
-void LiveRangeBuilder::ProcessInstructions(const InstructionBlock* block,
-                                           BitVector* live) {
-  int block_start = block->first_instruction_index();
-  LifetimePosition block_start_position =
-      LifetimePosition::GapFromInstructionIndex(block_start);
-  bool fixed_float_live_ranges = false;
-  bool fixed_simd128_live_ranges = false;
-  if (!kSimpleFPAliasing) {
-    int mask = data()->code()->representation_mask();
-    fixed_float_live_ranges = (mask & kFloatRepBit) != 0;
-    fixed_simd128_live_ranges = (mask & kSimd128RepBit) != 0;
-  }
-
-  for (int index = block->last_instruction_index(); index >= block_start;
-       index--) {
-    LifetimePosition curr_position =
-        LifetimePosition::InstructionFromInstructionIndex(index);
-    Instruction* instr = code()->InstructionAt(index);
-    DCHECK_NOT_NULL(instr);
-    DCHECK(curr_position.IsInstructionPosition());
-    // Process output, inputs, and temps of this instruction.
-    for (size_t i = 0; i < instr->OutputCount(); i++) {
-      InstructionOperand* output = instr->OutputAt(i);
-      if (output->IsUnallocated()) {
-        // Unsupported.
-        DCHECK(!UnallocatedOperand::cast(output)->HasSlotPolicy());
-        int out_vreg = UnallocatedOperand::cast(output)->virtual_register();
-        live->Remove(out_vreg);
-      } else if (output->IsConstant()) {
-        int out_vreg = ConstantOperand::cast(output)->virtual_register();
-        live->Remove(out_vreg);
-      }
-      if (block->IsHandler() && index == block_start && output->IsAllocated() &&
-          output->IsRegister() &&
-          AllocatedOperand::cast(output)->GetRegister() ==
-              v8::internal::kReturnRegister0) {
-        // The register defined here is blocked from gap start - it is the
-        // exception value.
-        // TODO(mtrofin): should we explore an explicit opcode for
-        // the first instruction in the handler?
-        Define(LifetimePosition::GapFromInstructionIndex(index), output);
-      } else {
-        Define(curr_position, output);
-      }
-    }
-
-    if (instr->ClobbersRegisters()) {
-      for (int i = 0; i < config()->num_allocatable_general_registers(); ++i) {
-        // Create a UseInterval at this instruction for all fixed registers,
-        // (including the instruction outputs). Adding another UseInterval here
-        // is OK because AddUseInterval will just merge it with the existing
-        // one at the end of the range.
-        int code = config()->GetAllocatableGeneralCode(i);
-        TopLevelLiveRange* range = FixedLiveRangeFor(code);
-        range->AddUseInterval(curr_position, curr_position.End(),
-                              allocation_zone());
-      }
-    }
-
-    if (instr->ClobbersDoubleRegisters()) {
-      for (int i = 0; i < config()->num_allocatable_double_registers(); ++i) {
-        // Add a UseInterval for all DoubleRegisters. See comment above for
-        // general registers.
-        int code = config()->GetAllocatableDoubleCode(i);
-        TopLevelLiveRange* range =
-            FixedFPLiveRangeFor(code, MachineRepresentation::kFloat64);
-        range->AddUseInterval(curr_position, curr_position.End(),
-                              allocation_zone());
-      }
-      // Clobber fixed float registers on archs with non-simple aliasing.
-      if (!kSimpleFPAliasing) {
-        if (fixed_float_live_ranges) {
-          for (int i = 0; i < config()->num_allocatable_float_registers();
-               ++i) {
-            // Add a UseInterval for all FloatRegisters. See comment above for
-            // general registers.
-            int code = config()->GetAllocatableFloatCode(i);
-            TopLevelLiveRange* range =
-                FixedFPLiveRangeFor(code, MachineRepresentation::kFloat32);
-            range->AddUseInterval(curr_position, curr_position.End(),
-                                  allocation_zone());
-          }
-        }
-        if (fixed_simd128_live_ranges) {
-          for (int i = 0; i < config()->num_allocatable_simd128_registers();
-               ++i) {
-            int code = config()->GetAllocatableSimd128Code(i);
-            TopLevelLiveRange* range =
-                FixedFPLiveRangeFor(code, MachineRepresentation::kSimd128);
-            range->AddUseInterval(curr_position, curr_position.End(),
-                                  allocation_zone());
-          }
-        }
-      }
-    }
-
-    for (size_t i = 0; i < instr->InputCount(); i++) {
-      InstructionOperand* input = instr->InputAt(i);
-      if (input->IsImmediate() || input->IsExplicit()) {
-        continue;  // Ignore immediates and explicitly reserved registers.
-      }
-      LifetimePosition use_pos;
-      if (input->IsUnallocated() &&
-          UnallocatedOperand::cast(input)->IsUsedAtStart()) {
-        use_pos = curr_position;
-      } else {
-        use_pos = curr_position.End();
-      }
-
-      if (input->IsUnallocated()) {
-        UnallocatedOperand* unalloc = UnallocatedOperand::cast(input);
-        int vreg = unalloc->virtual_register();
-        live->Add(vreg);
-        if (unalloc->HasSlotPolicy()) {
-          data()->GetOrCreateLiveRangeFor(vreg)->set_has_slot_use(true);
-        }
-      }
-      Use(block_start_position, use_pos, input);
-    }
-
-    for (size_t i = 0; i < instr->TempCount(); i++) {
-      InstructionOperand* temp = instr->TempAt(i);
-      // Unsupported.
-      DCHECK_IMPLIES(temp->IsUnallocated(),
-                     !UnallocatedOperand::cast(temp)->HasSlotPolicy());
-      if (instr->ClobbersTemps()) {
-        if (temp->IsRegister()) continue;
-        if (temp->IsUnallocated()) {
-          UnallocatedOperand* temp_unalloc = UnallocatedOperand::cast(temp);
-          if (temp_unalloc->HasFixedPolicy()) {
-            continue;
-          }
-        }
-      }
-      Use(block_start_position, curr_position.End(), temp);
-      Define(curr_position, temp);
-    }
-
-    // Process the moves of the instruction's gaps, making their sources live.
-    const Instruction::GapPosition kPositions[] = {Instruction::END,
-                                                   Instruction::START};
-    curr_position = curr_position.PrevStart();
-    DCHECK(curr_position.IsGapPosition());
-    for (const Instruction::GapPosition& position : kPositions) {
-      ParallelMove* move = instr->GetParallelMove(position);
-      if (move == nullptr) continue;
-      if (position == Instruction::END) {
-        curr_position = curr_position.End();
-      } else {
-        curr_position = curr_position.Start();
-      }
-      for (MoveOperands* cur : *move) {
-        InstructionOperand& from = cur->source();
-        InstructionOperand& to = cur->destination();
-        void* hint = &to;
-        UsePositionHintType hint_type = UsePosition::HintTypeForOperand(to);
-        UsePosition* to_use = nullptr;
-        int phi_vreg = -1;
-        if (to.IsUnallocated()) {
-          int to_vreg = UnallocatedOperand::cast(to).virtual_register();
-          TopLevelLiveRange* to_range =
-              data()->GetOrCreateLiveRangeFor(to_vreg);
-          if (to_range->is_phi()) {
-            phi_vreg = to_vreg;
-            if (to_range->is_non_loop_phi()) {
-              hint = to_range->current_hint_position();
-              hint_type = hint == nullptr ? UsePositionHintType::kNone
-                                          : UsePositionHintType::kUsePos;
-            } else {
-              hint_type = UsePositionHintType::kPhi;
-              hint = data()->GetPhiMapValueFor(to_vreg);
-            }
-          } else {
-            if (live->Contains(to_vreg)) {
-              to_use = Define(curr_position, &to, &from,
-                              UsePosition::HintTypeForOperand(from));
-              live->Remove(to_vreg);
-            } else {
-              cur->Eliminate();
-              continue;
-            }
-          }
-        } else {
-          Define(curr_position, &to);
-        }
-        UsePosition* from_use =
-            Use(block_start_position, curr_position, &from, hint, hint_type);
-        // Mark range live.
-        if (from.IsUnallocated()) {
-          live->Add(UnallocatedOperand::cast(from).virtual_register());
-        }
-        // Resolve use position hints just created.
-        if (to_use != nullptr && from_use != nullptr) {
-          to_use->ResolveHint(from_use);
-          from_use->ResolveHint(to_use);
-        }
-        DCHECK_IMPLIES(to_use != nullptr, to_use->IsResolved());
-        DCHECK_IMPLIES(from_use != nullptr, from_use->IsResolved());
-        // Potentially resolve phi hint.
-        if (phi_vreg != -1) ResolvePhiHint(&from, from_use);
-      }
-    }
-  }
-}
-
-void LiveRangeBuilder::ProcessPhis(const InstructionBlock* block,
-                                   BitVector* live) {
-  for (PhiInstruction* phi : block->phis()) {
-    // The live range interval already ends at the first instruction of the
-    // block.
-    int phi_vreg = phi->virtual_register();
-    live->Remove(phi_vreg);
-    // Select a hint from a predecessor block that precedes this block in the
-    // rpo order. In order of priority:
-    // - Avoid hints from deferred blocks.
-    // - Prefer hints from allocated (or explicit) operands.
-    // - Prefer hints from empty blocks (containing just parallel moves and a
-    //   jump). In these cases, if we can elide the moves, the jump threader
-    //   is likely to be able to elide the jump.
-    // The enforcement of hinting in rpo order is required because hint
-    // resolution that happens later in the compiler pipeline visits
-    // instructions in reverse rpo order, relying on the fact that phis are
-    // encountered before their hints.
-    InstructionOperand* hint = nullptr;
-    int hint_preference = 0;
-
-    // The cost of hinting increases with the number of predecessors. At the
-    // same time, the typical benefit decreases, since this hinting only
-    // optimises the execution path through one predecessor. A limit of 2 is
-    // sufficient to hit the common if/else pattern.
-    int predecessor_limit = 2;
-
-    for (RpoNumber predecessor : block->predecessors()) {
-      const InstructionBlock* predecessor_block =
-          code()->InstructionBlockAt(predecessor);
-      DCHECK_EQ(predecessor_block->rpo_number(), predecessor);
-
-      // Only take hints from earlier rpo numbers.
-      if (predecessor >= block->rpo_number()) continue;
-
-      // Look up the predecessor instruction.
-      const Instruction* predecessor_instr =
-          GetLastInstruction(code(), predecessor_block);
-      InstructionOperand* predecessor_hint = nullptr;
-      // Phis are assigned in the END position of the last instruction in each
-      // predecessor block.
-      for (MoveOperands* move :
-           *predecessor_instr->GetParallelMove(Instruction::END)) {
-        InstructionOperand& to = move->destination();
-        if (to.IsUnallocated() &&
-            UnallocatedOperand::cast(to).virtual_register() == phi_vreg) {
-          predecessor_hint = &move->source();
-          break;
-        }
-      }
-      DCHECK_NOT_NULL(predecessor_hint);
-
-      // For each predecessor, generate a score according to the priorities
-      // described above, and pick the best one. Flags in higher-order bits have
-      // a higher priority than those in lower-order bits.
-      int predecessor_hint_preference = 0;
-      const int kNotDeferredBlockPreference = (1 << 2);
-      const int kMoveIsAllocatedPreference = (1 << 1);
-      const int kBlockIsEmptyPreference = (1 << 0);
-
-      // - Avoid hints from deferred blocks.
-      if (!predecessor_block->IsDeferred()) {
-        predecessor_hint_preference |= kNotDeferredBlockPreference;
-      }
-
-      // - Prefer hints from allocated (or explicit) operands.
-      //
-      // Already-allocated or explicit operands are typically assigned using
-      // the parallel moves on the last instruction. For example:
-      //
-      //      gap (v101 = [x0|R|w32]) (v100 = v101)
-      //      ArchJmp
-      //    ...
-      //    phi: v100 = v101 v102
-      //
-      // We have already found the END move, so look for a matching START move
-      // from an allocated (or explicit) operand.
-      //
-      // Note that we cannot simply look up data()->live_ranges()[vreg] here
-      // because the live ranges are still being built when this function is
-      // called.
-      // TODO(v8): Find a way to separate hinting from live range analysis in
-      // BuildLiveRanges so that we can use the O(1) live-range look-up.
-      auto moves = predecessor_instr->GetParallelMove(Instruction::START);
-      if (moves != nullptr) {
-        for (MoveOperands* move : *moves) {
-          InstructionOperand& to = move->destination();
-          if (predecessor_hint->Equals(to)) {
-            if (move->source().IsAllocated() || move->source().IsExplicit()) {
-              predecessor_hint_preference |= kMoveIsAllocatedPreference;
-            }
-            break;
-          }
-        }
-      }
-
-      // - Prefer hints from empty blocks.
-      if (predecessor_block->last_instruction_index() ==
-          predecessor_block->first_instruction_index()) {
-        predecessor_hint_preference |= kBlockIsEmptyPreference;
-      }
-
-      if ((hint == nullptr) ||
-          (predecessor_hint_preference > hint_preference)) {
-        // Take the hint from this predecessor.
-        hint = predecessor_hint;
-        hint_preference = predecessor_hint_preference;
-      }
-
-      if (--predecessor_limit <= 0) break;
-    }
-    DCHECK_NOT_NULL(hint);
-
-    LifetimePosition block_start = LifetimePosition::GapFromInstructionIndex(
-        block->first_instruction_index());
-    UsePosition* use_pos = Define(block_start, &phi->output(), hint,
-                                  UsePosition::HintTypeForOperand(*hint));
-    MapPhiHint(hint, use_pos);
-  }
-}
-
-
-void LiveRangeBuilder::ProcessLoopHeader(const InstructionBlock* block,
-                                         BitVector* live) {
-  DCHECK(block->IsLoopHeader());
-  // Add a live range stretching from the first loop instruction to the last
-  // for each value live on entry to the header.
-  BitVector::Iterator iterator(live);
-  LifetimePosition start = LifetimePosition::GapFromInstructionIndex(
-      block->first_instruction_index());
-  LifetimePosition end = LifetimePosition::GapFromInstructionIndex(
-                             code()->LastLoopInstructionIndex(block))
-                             .NextFullStart();
-  while (!iterator.Done()) {
-    int operand_index = iterator.Current();
-    TopLevelLiveRange* range = data()->GetOrCreateLiveRangeFor(operand_index);
-    range->EnsureInterval(start, end, allocation_zone());
-    iterator.Advance();
-  }
-  // Insert all values into the live in sets of all blocks in the loop.
-  for (int i = block->rpo_number().ToInt() + 1; i < block->loop_end().ToInt();
-       ++i) {
-    live_in_sets()[i]->Union(*live);
-  }
-}
-
-
-void LiveRangeBuilder::BuildLiveRanges() {
-  // Process the blocks in reverse order.
-  for (int block_id = code()->InstructionBlockCount() - 1; block_id >= 0;
-       --block_id) {
-    InstructionBlock* block =
-        code()->InstructionBlockAt(RpoNumber::FromInt(block_id));
-    BitVector* live = ComputeLiveOut(block, data());
-    // Initially consider all live_out values live for the entire block. We
-    // will shorten these intervals if necessary.
-    AddInitialIntervals(block, live);
-    // Process the instructions in reverse order, generating and killing
-    // live values.
-    ProcessInstructions(block, live);
-    // All phi output operands are killed by this block.
-    ProcessPhis(block, live);
-    // Now live is live_in for this block except not including values live
-    // out on backward successor edges.
-    if (block->IsLoopHeader()) ProcessLoopHeader(block, live);
-    live_in_sets()[block_id] = live;
-  }
-  // Postprocess the ranges.
-  for (TopLevelLiveRange* range : data()->live_ranges()) {
-    if (range == nullptr) continue;
-    // Give slots to all ranges with a non fixed slot use.
-    if (range->has_slot_use() && range->HasNoSpillType()) {
-      data()->AssignSpillRangeToLiveRange(range);
-    }
-    // TODO(bmeurer): This is a horrible hack to make sure that for constant
-    // live ranges, every use requires the constant to be in a register.
-    // Without this hack, all uses with "any" policy would get the constant
-    // operand assigned.
-    if (range->HasSpillOperand() && range->GetSpillOperand()->IsConstant()) {
-      for (UsePosition* pos = range->first_pos(); pos != nullptr;
-           pos = pos->next()) {
-        if (pos->type() == UsePositionType::kRequiresSlot) continue;
-        UsePositionType new_type = UsePositionType::kAny;
-        // Can't mark phis as needing a register.
-        if (!pos->pos().IsGapPosition()) {
-          new_type = UsePositionType::kRequiresRegister;
-        }
-        pos->set_type(new_type, true);
-      }
-    }
-  }
-  for (auto preassigned : data()->preassigned_slot_ranges()) {
-    TopLevelLiveRange* range = preassigned.first;
-    int slot_id = preassigned.second;
-    SpillRange* spill = range->HasSpillRange()
-                            ? range->GetSpillRange()
-                            : data()->AssignSpillRangeToLiveRange(range);
-    spill->set_assigned_slot(slot_id);
-  }
-#ifdef DEBUG
-  Verify();
-#endif
-}
-
-
-void LiveRangeBuilder::MapPhiHint(InstructionOperand* operand,
-                                  UsePosition* use_pos) {
-  DCHECK(!use_pos->IsResolved());
-  auto res = phi_hints_.insert(std::make_pair(operand, use_pos));
-  DCHECK(res.second);
-  USE(res);
-}
-
-
-void LiveRangeBuilder::ResolvePhiHint(InstructionOperand* operand,
-                                      UsePosition* use_pos) {
-  auto it = phi_hints_.find(operand);
-  if (it == phi_hints_.end()) return;
-  DCHECK(!it->second->IsResolved());
-  it->second->ResolveHint(use_pos);
-}
-
-
-void LiveRangeBuilder::Verify() const {
-  for (auto& hint : phi_hints_) {
-    CHECK(hint.second->IsResolved());
-  }
-  for (const TopLevelLiveRange* current : data()->live_ranges()) {
-    if (current != nullptr && !current->IsEmpty()) {
-      // New LiveRanges should not be split.
-      CHECK_NULL(current->next());
-      // General integrity check.
-      current->Verify();
-      const UseInterval* first = current->first_interval();
-      if (first->next() == nullptr) continue;
-
-      // Consecutive intervals should not end and start in the same block,
-      // otherwise the intervals should have been joined, because the
-      // variable is live throughout that block.
-      CHECK(NextIntervalStartsInDifferentBlocks(first));
-
-      for (const UseInterval* i = first->next(); i != nullptr; i = i->next()) {
-        // Except for the first interval, the other intevals must start at
-        // a block boundary, otherwise data wouldn't flow to them.
-        CHECK(IntervalStartsAtBlockBoundary(i));
-        // The last instruction of the predecessors of the block the interval
-        // starts must be covered by the range.
-        CHECK(IntervalPredecessorsCoveredByRange(i, current));
-        if (i->next() != nullptr) {
-          // Check the consecutive intervals property, except for the last
-          // interval, where it doesn't apply.
-          CHECK(NextIntervalStartsInDifferentBlocks(i));
-        }
-      }
-    }
-  }
-}
-
-bool LiveRangeBuilder::IntervalStartsAtBlockBoundary(
-    const UseInterval* interval) const {
-  LifetimePosition start = interval->start();
-  if (!start.IsFullStart()) return false;
-  int instruction_index = start.ToInstructionIndex();
-  const InstructionBlock* block =
-      data()->code()->GetInstructionBlock(instruction_index);
-  return block->first_instruction_index() == instruction_index;
-}
-
-bool LiveRangeBuilder::IntervalPredecessorsCoveredByRange(
-    const UseInterval* interval, const TopLevelLiveRange* range) const {
-  LifetimePosition start = interval->start();
-  int instruction_index = start.ToInstructionIndex();
-  const InstructionBlock* block =
-      data()->code()->GetInstructionBlock(instruction_index);
-  for (RpoNumber pred_index : block->predecessors()) {
-    const InstructionBlock* predecessor =
-        data()->code()->InstructionBlockAt(pred_index);
-    LifetimePosition last_pos = LifetimePosition::GapFromInstructionIndex(
-        predecessor->last_instruction_index());
-    last_pos = last_pos.NextStart().End();
-    if (!range->Covers(last_pos)) return false;
-  }
-  return true;
-}
-
-bool LiveRangeBuilder::NextIntervalStartsInDifferentBlocks(
-    const UseInterval* interval) const {
-  DCHECK_NOT_NULL(interval->next());
-  LifetimePosition end = interval->end();
-  LifetimePosition next_start = interval->next()->start();
-  // Since end is not covered, but the previous position is, move back a
-  // position
-  end = end.IsStart() ? end.PrevStart().End() : end.Start();
-  int last_covered_index = end.ToInstructionIndex();
-  const InstructionBlock* block =
-      data()->code()->GetInstructionBlock(last_covered_index);
-  const InstructionBlock* next_block =
-      data()->code()->GetInstructionBlock(next_start.ToInstructionIndex());
-  return block->rpo_number() < next_block->rpo_number();
-}
-
-RegisterAllocator::RegisterAllocator(RegisterAllocationData* data,
-                                     RegisterKind kind)
-    : data_(data),
-      mode_(kind),
-      num_registers_(GetRegisterCount(data->config(), kind)),
-      num_allocatable_registers_(
-          GetAllocatableRegisterCount(data->config(), kind)),
-      allocatable_register_codes_(
-          GetAllocatableRegisterCodes(data->config(), kind)),
-      check_fp_aliasing_(false) {
-  if (!kSimpleFPAliasing && kind == FP_REGISTERS) {
-    check_fp_aliasing_ = (data->code()->representation_mask() &
-                          (kFloatRepBit | kSimd128RepBit)) != 0;
-  }
-}
-
-LifetimePosition RegisterAllocator::GetSplitPositionForInstruction(
-    const LiveRange* range, int instruction_index) {
-  LifetimePosition ret = LifetimePosition::Invalid();
-
-  ret = LifetimePosition::GapFromInstructionIndex(instruction_index);
-  if (range->Start() >= ret || ret >= range->End()) {
-    return LifetimePosition::Invalid();
-  }
-  return ret;
-}
-
-void RegisterAllocator::SplitAndSpillRangesDefinedByMemoryOperand() {
-  size_t initial_range_count = data()->live_ranges().size();
-  for (size_t i = 0; i < initial_range_count; ++i) {
-    TopLevelLiveRange* range = data()->live_ranges()[i];
-    if (!CanProcessRange(range)) continue;
-    if (range->HasNoSpillType() ||
-        (range->HasSpillRange() && !range->has_slot_use())) {
-      continue;
-    }
-    LifetimePosition start = range->Start();
-    TRACE("Live range %d:%d is defined by a spill operand.\n",
-          range->TopLevel()->vreg(), range->relative_id());
-    LifetimePosition next_pos = start;
-    if (next_pos.IsGapPosition()) {
-      next_pos = next_pos.NextStart();
-    }
-
-    // With splinters, we can be more strict and skip over positions
-    // not strictly needing registers.
-    UsePosition* pos =
-        range->IsSplinter()
-            ? range->NextRegisterPosition(next_pos)
-            : range->NextUsePositionRegisterIsBeneficial(next_pos);
-    // If the range already has a spill operand and it doesn't need a
-    // register immediately, split it and spill the first part of the range.
-    if (pos == nullptr) {
-      Spill(range);
-    } else if (pos->pos() > range->Start().NextStart()) {
-      // Do not spill live range eagerly if use position that can benefit from
-      // the register is too close to the start of live range.
-      LifetimePosition split_pos = GetSplitPositionForInstruction(
-          range, pos->pos().ToInstructionIndex());
-      // There is no place to split, so we can't split and spill.
-      if (!split_pos.IsValid()) continue;
-
-      split_pos =
-          FindOptimalSplitPos(range->Start().NextFullStart(), split_pos);
-
-      SplitRangeAt(range, split_pos);
-      Spill(range);
-    }
-  }
-}
-
-
-LiveRange* RegisterAllocator::SplitRangeAt(LiveRange* range,
-                                           LifetimePosition pos) {
-  DCHECK(!range->TopLevel()->IsFixed());
-  TRACE("Splitting live range %d:%d at %d\n", range->TopLevel()->vreg(),
-        range->relative_id(), pos.value());
-
-  if (pos <= range->Start()) return range;
-
-  // We can't properly connect liveranges if splitting occurred at the end
-  // a block.
-  DCHECK(pos.IsStart() || pos.IsGapPosition() ||
-         (GetInstructionBlock(code(), pos)->last_instruction_index() !=
-          pos.ToInstructionIndex()));
-
-  LiveRange* result = range->SplitAt(pos, allocation_zone());
-  return result;
-}
-
-
-LiveRange* RegisterAllocator::SplitBetween(LiveRange* range,
-                                           LifetimePosition start,
-                                           LifetimePosition end) {
-  DCHECK(!range->TopLevel()->IsFixed());
-  TRACE("Splitting live range %d:%d in position between [%d, %d]\n",
-        range->TopLevel()->vreg(), range->relative_id(), start.value(),
-        end.value());
-
-  LifetimePosition split_pos = FindOptimalSplitPos(start, end);
-  DCHECK(split_pos >= start);
-  return SplitRangeAt(range, split_pos);
-}
-
-
-LifetimePosition RegisterAllocator::FindOptimalSplitPos(LifetimePosition start,
-                                                        LifetimePosition end) {
-  int start_instr = start.ToInstructionIndex();
-  int end_instr = end.ToInstructionIndex();
-  DCHECK(start_instr <= end_instr);
-
-  // We have no choice
-  if (start_instr == end_instr) return end;
-
-  const InstructionBlock* start_block = GetInstructionBlock(code(), start);
-  const InstructionBlock* end_block = GetInstructionBlock(code(), end);
-
-  if (end_block == start_block) {
-    // The interval is split in the same basic block. Split at the latest
-    // possible position.
-    return end;
-  }
-
-  const InstructionBlock* block = end_block;
-  // Find header of outermost loop.
-  do {
-    const InstructionBlock* loop = GetContainingLoop(code(), block);
-    if (loop == nullptr ||
-        loop->rpo_number().ToInt() <= start_block->rpo_number().ToInt()) {
-      // No more loops or loop starts before the lifetime start.
-      break;
-    }
-    block = loop;
-  } while (true);
-
-  // We did not find any suitable outer loop. Split at the latest possible
-  // position unless end_block is a loop header itself.
-  if (block == end_block && !end_block->IsLoopHeader()) return end;
-
-  return LifetimePosition::GapFromInstructionIndex(
-      block->first_instruction_index());
-}
-
-
-LifetimePosition RegisterAllocator::FindOptimalSpillingPos(
-    LiveRange* range, LifetimePosition pos) {
-  const InstructionBlock* block = GetInstructionBlock(code(), pos.Start());
-  const InstructionBlock* loop_header =
-      block->IsLoopHeader() ? block : GetContainingLoop(code(), block);
-
-  if (loop_header == nullptr) return pos;
-
-  const UsePosition* prev_use =
-      range->PreviousUsePositionRegisterIsBeneficial(pos);
-
-  while (loop_header != nullptr) {
-    // We are going to spill live range inside the loop.
-    // If possible try to move spilling position backwards to loop header.
-    // This will reduce number of memory moves on the back edge.
-    LifetimePosition loop_start = LifetimePosition::GapFromInstructionIndex(
-        loop_header->first_instruction_index());
-
-    if (range->Covers(loop_start)) {
-      if (prev_use == nullptr || prev_use->pos() < loop_start) {
-        // No register beneficial use inside the loop before the pos.
-        pos = loop_start;
-      }
-    }
-
-    // Try hoisting out to an outer loop.
-    loop_header = GetContainingLoop(code(), loop_header);
-  }
-
-  return pos;
-}
-
-
-void RegisterAllocator::Spill(LiveRange* range) {
-  DCHECK(!range->spilled());
-  TopLevelLiveRange* first = range->TopLevel();
-  TRACE("Spilling live range %d:%d\n", first->vreg(), range->relative_id());
-
-  if (first->HasNoSpillType()) {
-    data()->AssignSpillRangeToLiveRange(first);
-  }
-  range->Spill();
-}
-
-const char* RegisterAllocator::RegisterName(int register_code) const {
-  if (mode() == GENERAL_REGISTERS) {
-    return data()->config()->GetGeneralRegisterName(register_code);
-  } else {
-    return data()->config()->GetDoubleRegisterName(register_code);
-  }
-}
-
-
-LinearScanAllocator::LinearScanAllocator(RegisterAllocationData* data,
-                                         RegisterKind kind, Zone* local_zone)
-    : RegisterAllocator(data, kind),
-      unhandled_live_ranges_(local_zone),
-      active_live_ranges_(local_zone),
-      inactive_live_ranges_(local_zone) {
-  unhandled_live_ranges().reserve(
-      static_cast<size_t>(code()->VirtualRegisterCount() * 2));
-  active_live_ranges().reserve(8);
-  inactive_live_ranges().reserve(8);
-  // TryAllocateFreeReg and AllocateBlockedReg assume this
-  // when allocating local arrays.
-  DCHECK_GE(RegisterConfiguration::kMaxFPRegisters,
-            this->data()->config()->num_general_registers());
-}
-
-
-void LinearScanAllocator::AllocateRegisters() {
-  DCHECK(unhandled_live_ranges().empty());
-  DCHECK(active_live_ranges().empty());
-  DCHECK(inactive_live_ranges().empty());
-
-  SplitAndSpillRangesDefinedByMemoryOperand();
-
-  for (TopLevelLiveRange* range : data()->live_ranges()) {
-    if (!CanProcessRange(range)) continue;
-    for (LiveRange* to_add = range; to_add != nullptr;
-         to_add = to_add->next()) {
-      if (!to_add->spilled()) {
-        AddToUnhandledUnsorted(to_add);
-      }
-    }
-  }
-  SortUnhandled();
-  DCHECK(UnhandledIsSorted());
-
-  if (mode() == GENERAL_REGISTERS) {
-    for (TopLevelLiveRange* current : data()->fixed_live_ranges()) {
-      if (current != nullptr) AddToInactive(current);
-    }
-  } else {
-    for (TopLevelLiveRange* current : data()->fixed_double_live_ranges()) {
-      if (current != nullptr) AddToInactive(current);
-    }
-    if (!kSimpleFPAliasing && check_fp_aliasing()) {
-      for (TopLevelLiveRange* current : data()->fixed_float_live_ranges()) {
-        if (current != nullptr) AddToInactive(current);
-      }
-      for (TopLevelLiveRange* current : data()->fixed_simd128_live_ranges()) {
-        if (current != nullptr) AddToInactive(current);
-      }
-    }
-  }
-
-  while (!unhandled_live_ranges().empty()) {
-    DCHECK(UnhandledIsSorted());
-    LiveRange* current = unhandled_live_ranges().back();
-    unhandled_live_ranges().pop_back();
-    DCHECK(UnhandledIsSorted());
-    LifetimePosition position = current->Start();
-#ifdef DEBUG
-    allocation_finger_ = position;
-#endif
-    TRACE("Processing interval %d:%d start=%d\n", current->TopLevel()->vreg(),
-          current->relative_id(), position.value());
-
-    if (current->IsTopLevel() && TryReuseSpillForPhi(current->TopLevel()))
-      continue;
-
-    for (size_t i = 0; i < active_live_ranges().size(); ++i) {
-      LiveRange* cur_active = active_live_ranges()[i];
-      if (cur_active->End() <= position) {
-        ActiveToHandled(cur_active);
-        --i;  // The live range was removed from the list of active live ranges.
-      } else if (!cur_active->Covers(position)) {
-        ActiveToInactive(cur_active);
-        --i;  // The live range was removed from the list of active live ranges.
-      }
-    }
-
-    for (size_t i = 0; i < inactive_live_ranges().size(); ++i) {
-      LiveRange* cur_inactive = inactive_live_ranges()[i];
-      if (cur_inactive->End() <= position) {
-        InactiveToHandled(cur_inactive);
-        --i;  // Live range was removed from the list of inactive live ranges.
-      } else if (cur_inactive->Covers(position)) {
-        InactiveToActive(cur_inactive);
-        --i;  // Live range was removed from the list of inactive live ranges.
-      }
-    }
-
-    DCHECK(!current->HasRegisterAssigned() && !current->spilled());
-
-    ProcessCurrentRange(current);
-  }
-}
-
-bool LinearScanAllocator::TrySplitAndSpillSplinter(LiveRange* range) {
-  DCHECK(range->TopLevel()->IsSplinter());
-  // If we can spill the whole range, great. Otherwise, split above the
-  // first use needing a register and spill the top part.
-  const UsePosition* next_reg = range->NextRegisterPosition(range->Start());
-  if (next_reg == nullptr) {
-    Spill(range);
-    return true;
-  } else if (range->FirstHintPosition() == nullptr) {
-    // If there was no hint, but we have a use position requiring a
-    // register, apply the hot path heuristics.
-    return false;
-  } else if (next_reg->pos().PrevStart() > range->Start()) {
-    LiveRange* tail = SplitRangeAt(range, next_reg->pos().PrevStart());
-    AddToUnhandledSorted(tail);
-    Spill(range);
-    return true;
-  }
-  return false;
-}
-
-void LinearScanAllocator::SetLiveRangeAssignedRegister(LiveRange* range,
-                                                       int reg) {
-  data()->MarkAllocated(range->representation(), reg);
-  range->set_assigned_register(reg);
-  range->SetUseHints(reg);
-  if (range->IsTopLevel() && range->TopLevel()->is_phi()) {
-    data()->GetPhiMapValueFor(range->TopLevel())->set_assigned_register(reg);
-  }
-}
-
-
-void LinearScanAllocator::AddToActive(LiveRange* range) {
-  TRACE("Add live range %d:%d to active\n", range->TopLevel()->vreg(),
-        range->relative_id());
-  active_live_ranges().push_back(range);
-}
-
-
-void LinearScanAllocator::AddToInactive(LiveRange* range) {
-  TRACE("Add live range %d:%d to inactive\n", range->TopLevel()->vreg(),
-        range->relative_id());
-  inactive_live_ranges().push_back(range);
-}
-
-
-void LinearScanAllocator::AddToUnhandledSorted(LiveRange* range) {
-  if (range == nullptr || range->IsEmpty()) return;
-  DCHECK(!range->HasRegisterAssigned() && !range->spilled());
-  DCHECK(allocation_finger_ <= range->Start());
-  for (int i = static_cast<int>(unhandled_live_ranges().size() - 1); i >= 0;
-       --i) {
-    LiveRange* cur_range = unhandled_live_ranges().at(i);
-    if (!range->ShouldBeAllocatedBefore(cur_range)) continue;
-    TRACE("Add live range %d:%d to unhandled at %d\n",
-          range->TopLevel()->vreg(), range->relative_id(), i + 1);
-    auto it = unhandled_live_ranges().begin() + (i + 1);
-    unhandled_live_ranges().insert(it, range);
-    DCHECK(UnhandledIsSorted());
-    return;
-  }
-  TRACE("Add live range %d:%d to unhandled at start\n",
-        range->TopLevel()->vreg(), range->relative_id());
-  unhandled_live_ranges().insert(unhandled_live_ranges().begin(), range);
-  DCHECK(UnhandledIsSorted());
-}
-
-
-void LinearScanAllocator::AddToUnhandledUnsorted(LiveRange* range) {
-  if (range == nullptr || range->IsEmpty()) return;
-  DCHECK(!range->HasRegisterAssigned() && !range->spilled());
-  TRACE("Add live range %d:%d to unhandled unsorted at end\n",
-        range->TopLevel()->vreg(), range->relative_id());
-  unhandled_live_ranges().push_back(range);
-}
-
-
-static bool UnhandledSortHelper(LiveRange* a, LiveRange* b) {
-  DCHECK(!a->ShouldBeAllocatedBefore(b) || !b->ShouldBeAllocatedBefore(a));
-  if (a->ShouldBeAllocatedBefore(b)) return false;
-  if (b->ShouldBeAllocatedBefore(a)) return true;
-  return a->TopLevel()->vreg() < b->TopLevel()->vreg();
-}
-
-
-// Sort the unhandled live ranges so that the ranges to be processed first are
-// at the end of the array list.  This is convenient for the register allocation
-// algorithm because it is efficient to remove elements from the end.
-void LinearScanAllocator::SortUnhandled() {
-  TRACE("Sort unhandled\n");
-  std::sort(unhandled_live_ranges().begin(), unhandled_live_ranges().end(),
-            &UnhandledSortHelper);
-}
-
-
-bool LinearScanAllocator::UnhandledIsSorted() {
-  size_t len = unhandled_live_ranges().size();
-  for (size_t i = 1; i < len; i++) {
-    LiveRange* a = unhandled_live_ranges().at(i - 1);
-    LiveRange* b = unhandled_live_ranges().at(i);
-    if (a->Start() < b->Start()) return false;
-  }
-  return true;
-}
-
-
-void LinearScanAllocator::ActiveToHandled(LiveRange* range) {
-  RemoveElement(&active_live_ranges(), range);
-  TRACE("Moving live range %d:%d from active to handled\n",
-        range->TopLevel()->vreg(), range->relative_id());
-}
-
-
-void LinearScanAllocator::ActiveToInactive(LiveRange* range) {
-  RemoveElement(&active_live_ranges(), range);
-  inactive_live_ranges().push_back(range);
-  TRACE("Moving live range %d:%d from active to inactive\n",
-        range->TopLevel()->vreg(), range->relative_id());
-}
-
-
-void LinearScanAllocator::InactiveToHandled(LiveRange* range) {
-  RemoveElement(&inactive_live_ranges(), range);
-  TRACE("Moving live range %d:%d from inactive to handled\n",
-        range->TopLevel()->vreg(), range->relative_id());
-}
-
-
-void LinearScanAllocator::InactiveToActive(LiveRange* range) {
-  RemoveElement(&inactive_live_ranges(), range);
-  active_live_ranges().push_back(range);
-  TRACE("Moving live range %d:%d from inactive to active\n",
-        range->TopLevel()->vreg(), range->relative_id());
-}
-
-void LinearScanAllocator::GetFPRegisterSet(MachineRepresentation rep,
-                                           int* num_regs, int* num_codes,
-                                           const int** codes) const {
-  DCHECK(!kSimpleFPAliasing);
-  if (rep == MachineRepresentation::kFloat32) {
-    *num_regs = data()->config()->num_float_registers();
-    *num_codes = data()->config()->num_allocatable_float_registers();
-    *codes = data()->config()->allocatable_float_codes();
-  } else if (rep == MachineRepresentation::kSimd128) {
-    *num_regs = data()->config()->num_simd128_registers();
-    *num_codes = data()->config()->num_allocatable_simd128_registers();
-    *codes = data()->config()->allocatable_simd128_codes();
-  } else {
-    UNREACHABLE();
-  }
-}
-
-void LinearScanAllocator::FindFreeRegistersForRange(
-    LiveRange* range, Vector<LifetimePosition> positions) {
-  int num_regs = num_registers();
-  int num_codes = num_allocatable_registers();
-  const int* codes = allocatable_register_codes();
-  MachineRepresentation rep = range->representation();
-  if (!kSimpleFPAliasing && (rep == MachineRepresentation::kFloat32 ||
-                             rep == MachineRepresentation::kSimd128))
-    GetFPRegisterSet(rep, &num_regs, &num_codes, &codes);
-  DCHECK_GE(positions.length(), num_regs);
-
-  for (int i = 0; i < num_regs; ++i) {
-    positions[i] = LifetimePosition::MaxPosition();
-  }
-
-  for (LiveRange* cur_active : active_live_ranges()) {
-    int cur_reg = cur_active->assigned_register();
-    if (kSimpleFPAliasing || !check_fp_aliasing()) {
-      positions[cur_reg] = LifetimePosition::GapFromInstructionIndex(0);
-      TRACE("Register %s is free until pos %d (1)\n", RegisterName(cur_reg),
-            LifetimePosition::GapFromInstructionIndex(0).value());
-    } else {
-      int alias_base_index = -1;
-      int aliases = data()->config()->GetAliases(
-          cur_active->representation(), cur_reg, rep, &alias_base_index);
-      DCHECK(aliases > 0 || (aliases == 0 && alias_base_index == -1));
-      while (aliases--) {
-        int aliased_reg = alias_base_index + aliases;
-        positions[aliased_reg] = LifetimePosition::GapFromInstructionIndex(0);
-      }
-    }
-  }
-
-  for (LiveRange* cur_inactive : inactive_live_ranges()) {
-    DCHECK(cur_inactive->End() > range->Start());
-    int cur_reg = cur_inactive->assigned_register();
-    // No need to carry out intersections, when this register won't be
-    // interesting to this range anyway.
-    // TODO(mtrofin): extend to aliased ranges, too.
-    if ((kSimpleFPAliasing || !check_fp_aliasing()) &&
-        positions[cur_reg] < range->Start()) {
-      continue;
-    }
-
-    LifetimePosition next_intersection = cur_inactive->FirstIntersection(range);
-    if (!next_intersection.IsValid()) continue;
-    if (kSimpleFPAliasing || !check_fp_aliasing()) {
-      positions[cur_reg] = Min(positions[cur_reg], next_intersection);
-      TRACE("Register %s is free until pos %d (2)\n", RegisterName(cur_reg),
-            Min(positions[cur_reg], next_intersection).value());
-    } else {
-      int alias_base_index = -1;
-      int aliases = data()->config()->GetAliases(
-          cur_inactive->representation(), cur_reg, rep, &alias_base_index);
-      DCHECK(aliases > 0 || (aliases == 0 && alias_base_index == -1));
-      while (aliases--) {
-        int aliased_reg = alias_base_index + aliases;
-        positions[aliased_reg] = Min(positions[aliased_reg], next_intersection);
-      }
-    }
-  }
-}
-
-// High-level register allocation summary:
-//
-// For regular, or hot (i.e. not splinter) ranges, we attempt to first
-// allocate first the preferred (hint) register. If that is not possible,
-// we find a register that's free, and allocate that. If that's not possible,
-// we search for a register to steal from a range that was allocated. The
-// goal is to optimize for throughput by avoiding register-to-memory
-// moves, which are expensive.
-//
-// For splinters, the goal is to minimize the number of moves. First we try
-// to allocate the preferred register (more discussion follows). Failing that,
-// we bail out and spill as far as we can, unless the first use is at start,
-// case in which we apply the same behavior as we do for regular ranges.
-// If there is no hint, we apply the hot-path behavior.
-//
-// For the splinter, the hint register may come from:
-//
-// - the hot path (we set it at splintering time with SetHint). In this case, if
-// we cannot offer the hint register, spilling is better because it's at most
-// 1 move, while trying to find and offer another register is at least 1 move.
-//
-// - a constraint. If we cannot offer that register, it's because  there is some
-// interference. So offering the hint register up to the interference would
-// result
-// in a move at the interference, plus a move to satisfy the constraint. This is
-// also the number of moves if we spill, with the potential of the range being
-// already spilled and thus saving a move (the spill).
-// Note that this can only be an input constraint, if it were an output one,
-// the range wouldn't be a splinter because it means it'd be defined in a
-// deferred
-// block, and we don't mark those as splinters (they live in deferred blocks
-// only).
-//
-// - a phi. The same analysis as in the case of the input constraint applies.
-//
-void LinearScanAllocator::ProcessCurrentRange(LiveRange* current) {
-  LifetimePosition free_until_pos_buff[RegisterConfiguration::kMaxFPRegisters];
-  Vector<LifetimePosition> free_until_pos(
-      free_until_pos_buff, RegisterConfiguration::kMaxFPRegisters);
-  FindFreeRegistersForRange(current, free_until_pos);
-  if (!TryAllocatePreferredReg(current, free_until_pos)) {
-    if (current->TopLevel()->IsSplinter()) {
-      if (TrySplitAndSpillSplinter(current)) return;
-    }
-    if (!TryAllocateFreeReg(current, free_until_pos)) {
-      AllocateBlockedReg(current);
-    }
-  }
-  if (current->HasRegisterAssigned()) {
-    AddToActive(current);
-  }
-}
-
-bool LinearScanAllocator::TryAllocatePreferredReg(
-    LiveRange* current, const Vector<LifetimePosition>& free_until_pos) {
-  int hint_register;
-  if (current->FirstHintPosition(&hint_register) != nullptr) {
-    TRACE(
-        "Found reg hint %s (free until [%d) for live range %d:%d (end %d[).\n",
-        RegisterName(hint_register), free_until_pos[hint_register].value(),
-        current->TopLevel()->vreg(), current->relative_id(),
-        current->End().value());
-
-    // The desired register is free until the end of the current live range.
-    if (free_until_pos[hint_register] >= current->End()) {
-      TRACE("Assigning preferred reg %s to live range %d:%d\n",
-            RegisterName(hint_register), current->TopLevel()->vreg(),
-            current->relative_id());
-      SetLiveRangeAssignedRegister(current, hint_register);
-      return true;
-    }
-  }
-  return false;
-}
-
-bool LinearScanAllocator::TryAllocateFreeReg(
-    LiveRange* current, const Vector<LifetimePosition>& free_until_pos) {
-  int num_regs = 0;  // used only for the call to GetFPRegisterSet.
-  int num_codes = num_allocatable_registers();
-  const int* codes = allocatable_register_codes();
-  MachineRepresentation rep = current->representation();
-  if (!kSimpleFPAliasing && (rep == MachineRepresentation::kFloat32 ||
-                             rep == MachineRepresentation::kSimd128)) {
-    GetFPRegisterSet(rep, &num_regs, &num_codes, &codes);
-  }
-
-  DCHECK_GE(free_until_pos.length(), num_codes);
-
-  // Find the register which stays free for the longest time.
-  int reg = codes[0];
-  for (int i = 1; i < num_codes; ++i) {
-    int code = codes[i];
-    if (free_until_pos[code] > free_until_pos[reg]) {
-      reg = code;
-    }
-  }
-
-  LifetimePosition pos = free_until_pos[reg];
-
-  if (pos <= current->Start()) {
-    // All registers are blocked.
-    return false;
-  }
-
-  if (pos < current->End()) {
-    // Register reg is available at the range start but becomes blocked before
-    // the range end. Split current at position where it becomes blocked.
-    LiveRange* tail = SplitRangeAt(current, pos);
-    AddToUnhandledSorted(tail);
-
-    // Try to allocate preferred register once more.
-    if (TryAllocatePreferredReg(current, free_until_pos)) return true;
-  }
-
-  // Register reg is available at the range start and is free until the range
-  // end.
-  DCHECK(pos >= current->End());
-  TRACE("Assigning free reg %s to live range %d:%d\n", RegisterName(reg),
-        current->TopLevel()->vreg(), current->relative_id());
-  SetLiveRangeAssignedRegister(current, reg);
-
-  return true;
-}
-
-void LinearScanAllocator::AllocateBlockedReg(LiveRange* current) {
-  UsePosition* register_use = current->NextRegisterPosition(current->Start());
-  if (register_use == nullptr) {
-    // There is no use in the current live range that requires a register.
-    // We can just spill it.
-    Spill(current);
-    return;
-  }
-
-  int num_regs = num_registers();
-  int num_codes = num_allocatable_registers();
-  const int* codes = allocatable_register_codes();
-  MachineRepresentation rep = current->representation();
-  if (!kSimpleFPAliasing && (rep == MachineRepresentation::kFloat32 ||
-                             rep == MachineRepresentation::kSimd128))
-    GetFPRegisterSet(rep, &num_regs, &num_codes, &codes);
-
-  // use_pos keeps track of positions a register/alias is used at.
-  // block_pos keeps track of positions where a register/alias is blocked
-  // from.
-  LifetimePosition use_pos[RegisterConfiguration::kMaxFPRegisters];
-  LifetimePosition block_pos[RegisterConfiguration::kMaxFPRegisters];
-  for (int i = 0; i < num_regs; i++) {
-    use_pos[i] = block_pos[i] = LifetimePosition::MaxPosition();
-  }
-
-  for (LiveRange* range : active_live_ranges()) {
-    int cur_reg = range->assigned_register();
-    bool is_fixed_or_cant_spill =
-        range->TopLevel()->IsFixed() || !range->CanBeSpilled(current->Start());
-    if (kSimpleFPAliasing || !check_fp_aliasing()) {
-      if (is_fixed_or_cant_spill) {
-        block_pos[cur_reg] = use_pos[cur_reg] =
-            LifetimePosition::GapFromInstructionIndex(0);
-      } else {
-        DCHECK_NE(LifetimePosition::GapFromInstructionIndex(0),
-                  block_pos[cur_reg]);
-        use_pos[cur_reg] =
-            range->NextLifetimePositionRegisterIsBeneficial(current->Start());
-      }
-    } else {
-      int alias_base_index = -1;
-      int aliases = data()->config()->GetAliases(
-          range->representation(), cur_reg, rep, &alias_base_index);
-      DCHECK(aliases > 0 || (aliases == 0 && alias_base_index == -1));
-      while (aliases--) {
-        int aliased_reg = alias_base_index + aliases;
-        if (is_fixed_or_cant_spill) {
-          block_pos[aliased_reg] = use_pos[aliased_reg] =
-              LifetimePosition::GapFromInstructionIndex(0);
-        } else {
-          use_pos[aliased_reg] =
-              Min(block_pos[aliased_reg],
-                  range->NextLifetimePositionRegisterIsBeneficial(
-                      current->Start()));
-        }
-      }
-    }
-  }
-
-  for (LiveRange* range : inactive_live_ranges()) {
-    DCHECK(range->End() > current->Start());
-    int cur_reg = range->assigned_register();
-    bool is_fixed = range->TopLevel()->IsFixed();
-
-    // Don't perform costly intersections if they are guaranteed to not update
-    // block_pos or use_pos.
-    // TODO(mtrofin): extend to aliased ranges, too.
-    if ((kSimpleFPAliasing || !check_fp_aliasing())) {
-      if (is_fixed) {
-        if (block_pos[cur_reg] < range->Start()) continue;
-      } else {
-        if (use_pos[cur_reg] < range->Start()) continue;
-      }
-    }
-
-    LifetimePosition next_intersection = range->FirstIntersection(current);
-    if (!next_intersection.IsValid()) continue;
-
-    if (kSimpleFPAliasing || !check_fp_aliasing()) {
-      if (is_fixed) {
-        block_pos[cur_reg] = Min(block_pos[cur_reg], next_intersection);
-        use_pos[cur_reg] = Min(block_pos[cur_reg], use_pos[cur_reg]);
-      } else {
-        use_pos[cur_reg] = Min(use_pos[cur_reg], next_intersection);
-      }
-    } else {
-      int alias_base_index = -1;
-      int aliases = data()->config()->GetAliases(
-          range->representation(), cur_reg, rep, &alias_base_index);
-      DCHECK(aliases > 0 || (aliases == 0 && alias_base_index == -1));
-      while (aliases--) {
-        int aliased_reg = alias_base_index + aliases;
-        if (is_fixed) {
-          block_pos[aliased_reg] =
-              Min(block_pos[aliased_reg], next_intersection);
-          use_pos[aliased_reg] =
-              Min(block_pos[aliased_reg], use_pos[aliased_reg]);
-        } else {
-          use_pos[aliased_reg] = Min(use_pos[aliased_reg], next_intersection);
-        }
-      }
-    }
-  }
-
-  int reg = codes[0];
-  for (int i = 1; i < num_codes; ++i) {
-    int code = codes[i];
-    if (use_pos[code] > use_pos[reg]) {
-      reg = code;
-    }
-  }
-
-  if (use_pos[reg] < register_use->pos()) {
-    // If there is a gap position before the next register use, we can
-    // spill until there. The gap position will then fit the fill move.
-    if (LifetimePosition::ExistsGapPositionBetween(current->Start(),
-                                                   register_use->pos())) {
-      SpillBetween(current, current->Start(), register_use->pos());
-      return;
-    }
-  }
-
-  // We couldn't spill until the next register use. Split before the register
-  // is blocked, if applicable.
-  if (block_pos[reg] < current->End()) {
-    // Register becomes blocked before the current range end. Split before that
-    // position.
-    LiveRange* tail =
-        SplitBetween(current, current->Start(), block_pos[reg].Start());
-    AddToUnhandledSorted(tail);
-  }
-
-  // Register reg is not blocked for the whole range.
-  DCHECK(block_pos[reg] >= current->End());
-  TRACE("Assigning blocked reg %s to live range %d:%d\n", RegisterName(reg),
-        current->TopLevel()->vreg(), current->relative_id());
-  SetLiveRangeAssignedRegister(current, reg);
-
-  // This register was not free. Thus we need to find and spill
-  // parts of active and inactive live regions that use the same register
-  // at the same lifetime positions as current.
-  SplitAndSpillIntersecting(current);
-}
-
-
-void LinearScanAllocator::SplitAndSpillIntersecting(LiveRange* current) {
-  DCHECK(current->HasRegisterAssigned());
-  int reg = current->assigned_register();
-  LifetimePosition split_pos = current->Start();
-  for (size_t i = 0; i < active_live_ranges().size(); ++i) {
-    LiveRange* range = active_live_ranges()[i];
-    if (kSimpleFPAliasing || !check_fp_aliasing()) {
-      if (range->assigned_register() != reg) continue;
-    } else {
-      if (!data()->config()->AreAliases(current->representation(), reg,
-                                        range->representation(),
-                                        range->assigned_register())) {
-        continue;
-      }
-    }
-
-    UsePosition* next_pos = range->NextRegisterPosition(current->Start());
-    LifetimePosition spill_pos = FindOptimalSpillingPos(range, split_pos);
-    if (next_pos == nullptr) {
-      SpillAfter(range, spill_pos);
-    } else {
-      // When spilling between spill_pos and next_pos ensure that the range
-      // remains spilled at least until the start of the current live range.
-      // This guarantees that we will not introduce new unhandled ranges that
-      // start before the current range as this violates allocation invariants
-      // and will lead to an inconsistent state of active and inactive
-      // live-ranges: ranges are allocated in order of their start positions,
-      // ranges are retired from active/inactive when the start of the
-      // current live-range is larger than their end.
-      DCHECK(LifetimePosition::ExistsGapPositionBetween(current->Start(),
-                                                        next_pos->pos()));
-      SpillBetweenUntil(range, spill_pos, current->Start(), next_pos->pos());
-    }
-    ActiveToHandled(range);
-    --i;
-  }
-
-  for (size_t i = 0; i < inactive_live_ranges().size(); ++i) {
-    LiveRange* range = inactive_live_ranges()[i];
-    DCHECK(range->End() > current->Start());
-    if (range->TopLevel()->IsFixed()) continue;
-    if (kSimpleFPAliasing || !check_fp_aliasing()) {
-      if (range->assigned_register() != reg) continue;
-    } else {
-      if (!data()->config()->AreAliases(current->representation(), reg,
-                                        range->representation(),
-                                        range->assigned_register()))
-        continue;
-    }
-
-    LifetimePosition next_intersection = range->FirstIntersection(current);
-    if (next_intersection.IsValid()) {
-      UsePosition* next_pos = range->NextRegisterPosition(current->Start());
-      if (next_pos == nullptr) {
-        SpillAfter(range, split_pos);
-      } else {
-        next_intersection = Min(next_intersection, next_pos->pos());
-        SpillBetween(range, split_pos, next_intersection);
-      }
-      InactiveToHandled(range);
-      --i;
-    }
-  }
-}
-
-
-bool LinearScanAllocator::TryReuseSpillForPhi(TopLevelLiveRange* range) {
-  if (!range->is_phi()) return false;
-
-  DCHECK(!range->HasSpillOperand());
-  RegisterAllocationData::PhiMapValue* phi_map_value =
-      data()->GetPhiMapValueFor(range);
-  const PhiInstruction* phi = phi_map_value->phi();
-  const InstructionBlock* block = phi_map_value->block();
-  // Count the number of spilled operands.
-  size_t spilled_count = 0;
-  LiveRange* first_op = nullptr;
-  for (size_t i = 0; i < phi->operands().size(); i++) {
-    int op = phi->operands()[i];
-    LiveRange* op_range = data()->GetOrCreateLiveRangeFor(op);
-    if (!op_range->TopLevel()->HasSpillRange()) continue;
-    const InstructionBlock* pred =
-        code()->InstructionBlockAt(block->predecessors()[i]);
-    LifetimePosition pred_end =
-        LifetimePosition::InstructionFromInstructionIndex(
-            pred->last_instruction_index());
-    while (op_range != nullptr && !op_range->CanCover(pred_end)) {
-      op_range = op_range->next();
-    }
-    if (op_range != nullptr && op_range->spilled()) {
-      spilled_count++;
-      if (first_op == nullptr) {
-        first_op = op_range->TopLevel();
-      }
-    }
-  }
-
-  // Only continue if more than half of the operands are spilled.
-  if (spilled_count * 2 <= phi->operands().size()) {
-    return false;
-  }
-
-  // Try to merge the spilled operands and count the number of merged spilled
-  // operands.
-  DCHECK_NOT_NULL(first_op);
-  SpillRange* first_op_spill = first_op->TopLevel()->GetSpillRange();
-  size_t num_merged = 1;
-  for (size_t i = 1; i < phi->operands().size(); i++) {
-    int op = phi->operands()[i];
-    TopLevelLiveRange* op_range = data()->live_ranges()[op];
-    if (!op_range->HasSpillRange()) continue;
-    SpillRange* op_spill = op_range->GetSpillRange();
-    if (op_spill == first_op_spill || first_op_spill->TryMerge(op_spill)) {
-      num_merged++;
-    }
-  }
-
-  // Only continue if enough operands could be merged to the
-  // same spill slot.
-  if (num_merged * 2 <= phi->operands().size() ||
-      AreUseIntervalsIntersecting(first_op_spill->interval(),
-                                  range->first_interval())) {
-    return false;
-  }
-
-  // If the range does not need register soon, spill it to the merged
-  // spill range.
-  LifetimePosition next_pos = range->Start();
-  if (next_pos.IsGapPosition()) next_pos = next_pos.NextStart();
-  UsePosition* pos = range->NextUsePositionRegisterIsBeneficial(next_pos);
-  if (pos == nullptr) {
-    SpillRange* spill_range =
-        range->TopLevel()->HasSpillRange()
-            ? range->TopLevel()->GetSpillRange()
-            : data()->AssignSpillRangeToLiveRange(range->TopLevel());
-    bool merged = first_op_spill->TryMerge(spill_range);
-    if (!merged) return false;
-    Spill(range);
-    return true;
-  } else if (pos->pos() > range->Start().NextStart()) {
-    SpillRange* spill_range =
-        range->TopLevel()->HasSpillRange()
-            ? range->TopLevel()->GetSpillRange()
-            : data()->AssignSpillRangeToLiveRange(range->TopLevel());
-    bool merged = first_op_spill->TryMerge(spill_range);
-    if (!merged) return false;
-    SpillBetween(range, range->Start(), pos->pos());
-    DCHECK(UnhandledIsSorted());
-    return true;
-  }
-  return false;
-}
-
-
-void LinearScanAllocator::SpillAfter(LiveRange* range, LifetimePosition pos) {
-  LiveRange* second_part = SplitRangeAt(range, pos);
-  Spill(second_part);
-}
-
-
-void LinearScanAllocator::SpillBetween(LiveRange* range, LifetimePosition start,
-                                       LifetimePosition end) {
-  SpillBetweenUntil(range, start, start, end);
-}
-
-
-void LinearScanAllocator::SpillBetweenUntil(LiveRange* range,
-                                            LifetimePosition start,
-                                            LifetimePosition until,
-                                            LifetimePosition end) {
-  CHECK(start < end);
-  LiveRange* second_part = SplitRangeAt(range, start);
-
-  if (second_part->Start() < end) {
-    // The split result intersects with [start, end[.
-    // Split it at position between ]start+1, end[, spill the middle part
-    // and put the rest to unhandled.
-    LifetimePosition third_part_end = end.PrevStart().End();
-    if (data()->IsBlockBoundary(end.Start())) {
-      third_part_end = end.Start();
-    }
-    LiveRange* third_part = SplitBetween(
-        second_part, Max(second_part->Start().End(), until), third_part_end);
-
-    DCHECK(third_part != second_part);
-
-    Spill(second_part);
-    AddToUnhandledSorted(third_part);
-  } else {
-    // The split result does not intersect with [start, end[.
-    // Nothing to spill. Just put it to unhandled as whole.
-    AddToUnhandledSorted(second_part);
-  }
-}
-
-
-SpillSlotLocator::SpillSlotLocator(RegisterAllocationData* data)
-    : data_(data) {}
-
-
-void SpillSlotLocator::LocateSpillSlots() {
-  const InstructionSequence* code = data()->code();
-  for (TopLevelLiveRange* range : data()->live_ranges()) {
-    if (range == nullptr || range->IsEmpty()) continue;
-    // We care only about ranges which spill in the frame.
-    if (!range->HasSpillRange() || range->IsSpilledOnlyInDeferredBlocks()) {
-      continue;
-    }
-    TopLevelLiveRange::SpillMoveInsertionList* spills =
-        range->GetSpillMoveInsertionLocations();
-    DCHECK_NOT_NULL(spills);
-    for (; spills != nullptr; spills = spills->next) {
-      code->GetInstructionBlock(spills->gap_index)->mark_needs_frame();
-    }
-  }
-}
-
-
-OperandAssigner::OperandAssigner(RegisterAllocationData* data) : data_(data) {}
-
-
-void OperandAssigner::AssignSpillSlots() {
-  ZoneVector<SpillRange*>& spill_ranges = data()->spill_ranges();
-  // Merge disjoint spill ranges
-  for (size_t i = 0; i < spill_ranges.size(); ++i) {
-    SpillRange* range = spill_ranges[i];
-    if (range == nullptr) continue;
-    if (range->IsEmpty()) continue;
-    for (size_t j = i + 1; j < spill_ranges.size(); ++j) {
-      SpillRange* other = spill_ranges[j];
-      if (other != nullptr && !other->IsEmpty()) {
-        range->TryMerge(other);
-      }
-    }
-  }
-  // Allocate slots for the merged spill ranges.
-  for (SpillRange* range : spill_ranges) {
-    if (range == nullptr || range->IsEmpty()) continue;
-    // Allocate a new operand referring to the spill slot.
-    if (!range->HasSlot()) {
-      int index = data()->frame()->AllocateSpillSlot(range->byte_width());
-      range->set_assigned_slot(index);
-    }
-  }
-}
-
-
-void OperandAssigner::CommitAssignment() {
-  for (TopLevelLiveRange* top_range : data()->live_ranges()) {
-    if (top_range == nullptr || top_range->IsEmpty()) continue;
-    InstructionOperand spill_operand;
-    if (top_range->HasSpillOperand()) {
-      spill_operand = *top_range->TopLevel()->GetSpillOperand();
-    } else if (top_range->TopLevel()->HasSpillRange()) {
-      spill_operand = top_range->TopLevel()->GetSpillRangeOperand();
-    }
-    if (top_range->is_phi()) {
-      data()->GetPhiMapValueFor(top_range)->CommitAssignment(
-          top_range->GetAssignedOperand());
-    }
-    for (LiveRange* range = top_range; range != nullptr;
-         range = range->next()) {
-      InstructionOperand assigned = range->GetAssignedOperand();
-      DCHECK(!assigned.IsUnallocated());
-      range->ConvertUsesToOperand(assigned, spill_operand);
-    }
-
-    if (!spill_operand.IsInvalid()) {
-      // If this top level range has a child spilled in a deferred block, we use
-      // the range and control flow connection mechanism instead of spilling at
-      // definition. Refer to the ConnectLiveRanges and ResolveControlFlow
-      // phases. Normally, when we spill at definition, we do not insert a
-      // connecting move when a successor child range is spilled - because the
-      // spilled range picks up its value from the slot which was assigned at
-      // definition. For ranges that are determined to spill only in deferred
-      // blocks, we let ConnectLiveRanges and ResolveControlFlow find the blocks
-      // where a spill operand is expected, and then finalize by inserting the
-      // spills in the deferred blocks dominators.
-      if (!top_range->IsSpilledOnlyInDeferredBlocks()) {
-        // Spill at definition if the range isn't spilled only in deferred
-        // blocks.
-        top_range->CommitSpillMoves(
-            data()->code(), spill_operand,
-            top_range->has_slot_use() || top_range->spilled());
-      }
-    }
-  }
-}
-
-
-ReferenceMapPopulator::ReferenceMapPopulator(RegisterAllocationData* data)
-    : data_(data) {}
-
-
-bool ReferenceMapPopulator::SafePointsAreInOrder() const {
-  int safe_point = 0;
-  for (ReferenceMap* map : *data()->code()->reference_maps()) {
-    if (safe_point > map->instruction_position()) return false;
-    safe_point = map->instruction_position();
-  }
-  return true;
-}
-
-
-void ReferenceMapPopulator::PopulateReferenceMaps() {
-  DCHECK(SafePointsAreInOrder());
-  // Map all delayed references.
-  for (RegisterAllocationData::DelayedReference& delayed_reference :
-       data()->delayed_references()) {
-    delayed_reference.map->RecordReference(
-        AllocatedOperand::cast(*delayed_reference.operand));
-  }
-  // Iterate over all safe point positions and record a pointer
-  // for all spilled live ranges at this point.
-  int last_range_start = 0;
-  const ReferenceMapDeque* reference_maps = data()->code()->reference_maps();
-  ReferenceMapDeque::const_iterator first_it = reference_maps->begin();
-  for (TopLevelLiveRange* range : data()->live_ranges()) {
-    if (range == nullptr) continue;
-    // Skip non-reference values.
-    if (!data()->IsReference(range)) continue;
-    // Skip empty live ranges.
-    if (range->IsEmpty()) continue;
-    if (range->has_preassigned_slot()) continue;
-
-    // Find the extent of the range and its children.
-    int start = range->Start().ToInstructionIndex();
-    int end = 0;
-    for (LiveRange* cur = range; cur != nullptr; cur = cur->next()) {
-      LifetimePosition this_end = cur->End();
-      if (this_end.ToInstructionIndex() > end)
-        end = this_end.ToInstructionIndex();
-      DCHECK(cur->Start().ToInstructionIndex() >= start);
-    }
-
-    // Most of the ranges are in order, but not all.  Keep an eye on when they
-    // step backwards and reset the first_it so we don't miss any safe points.
-    if (start < last_range_start) first_it = reference_maps->begin();
-    last_range_start = start;
-
-    // Step across all the safe points that are before the start of this range,
-    // recording how far we step in order to save doing this for the next range.
-    for (; first_it != reference_maps->end(); ++first_it) {
-      ReferenceMap* map = *first_it;
-      if (map->instruction_position() >= start) break;
-    }
-
-    InstructionOperand spill_operand;
-    if (((range->HasSpillOperand() &&
-          !range->GetSpillOperand()->IsConstant()) ||
-         range->HasSpillRange())) {
-      if (range->HasSpillOperand()) {
-        spill_operand = *range->GetSpillOperand();
-      } else {
-        spill_operand = range->GetSpillRangeOperand();
-      }
-      DCHECK(spill_operand.IsStackSlot());
-      DCHECK(CanBeTaggedPointer(
-          AllocatedOperand::cast(spill_operand).representation()));
-    }
-
-    LiveRange* cur = range;
-    // Step through the safe points to see whether they are in the range.
-    for (auto it = first_it; it != reference_maps->end(); ++it) {
-      ReferenceMap* map = *it;
-      int safe_point = map->instruction_position();
-
-      // The safe points are sorted so we can stop searching here.
-      if (safe_point - 1 > end) break;
-
-      // Advance to the next active range that covers the current
-      // safe point position.
-      LifetimePosition safe_point_pos =
-          LifetimePosition::InstructionFromInstructionIndex(safe_point);
-
-      // Search for the child range (cur) that covers safe_point_pos. If we
-      // don't find it before the children pass safe_point_pos, keep cur at
-      // the last child, because the next safe_point_pos may be covered by cur.
-      // This may happen if cur has more than one interval, and the current
-      // safe_point_pos is in between intervals.
-      // For that reason, cur may be at most the last child.
-      DCHECK_NOT_NULL(cur);
-      DCHECK(safe_point_pos >= cur->Start() || range == cur);
-      bool found = false;
-      while (!found) {
-        if (cur->Covers(safe_point_pos)) {
-          found = true;
-        } else {
-          LiveRange* next = cur->next();
-          if (next == nullptr || next->Start() > safe_point_pos) {
-            break;
-          }
-          cur = next;
-        }
-      }
-
-      if (!found) {
-        continue;
-      }
-
-      // Check if the live range is spilled and the safe point is after
-      // the spill position.
-      int spill_index = range->IsSpilledOnlyInDeferredBlocks()
-                            ? cur->Start().ToInstructionIndex()
-                            : range->spill_start_index();
-
-      if (!spill_operand.IsInvalid() && safe_point >= spill_index) {
-        TRACE("Pointer for range %d (spilled at %d) at safe point %d\n",
-              range->vreg(), spill_index, safe_point);
-        map->RecordReference(AllocatedOperand::cast(spill_operand));
-      }
-
-      if (!cur->spilled()) {
-        TRACE(
-            "Pointer in register for range %d:%d (start at %d) "
-            "at safe point %d\n",
-            range->vreg(), cur->relative_id(), cur->Start().value(),
-            safe_point);
-        InstructionOperand operand = cur->GetAssignedOperand();
-        DCHECK(!operand.IsStackSlot());
-        DCHECK(CanBeTaggedPointer(
-            AllocatedOperand::cast(operand).representation()));
-        map->RecordReference(AllocatedOperand::cast(operand));
-      }
-    }
-  }
-}
-
-
-LiveRangeConnector::LiveRangeConnector(RegisterAllocationData* data)
-    : data_(data) {}
-
-
-bool LiveRangeConnector::CanEagerlyResolveControlFlow(
-    const InstructionBlock* block) const {
-  if (block->PredecessorCount() != 1) return false;
-  return block->predecessors()[0].IsNext(block->rpo_number());
-}
-
-
-void LiveRangeConnector::ResolveControlFlow(Zone* local_zone) {
-  // Lazily linearize live ranges in memory for fast lookup.
-  LiveRangeFinder finder(data(), local_zone);
-  ZoneVector<BitVector*>& live_in_sets = data()->live_in_sets();
-  for (const InstructionBlock* block : code()->instruction_blocks()) {
-    if (CanEagerlyResolveControlFlow(block)) continue;
-    BitVector* live = live_in_sets[block->rpo_number().ToInt()];
-    BitVector::Iterator iterator(live);
-    while (!iterator.Done()) {
-      int vreg = iterator.Current();
-      LiveRangeBoundArray* array = finder.ArrayFor(vreg);
-      for (const RpoNumber& pred : block->predecessors()) {
-        FindResult result;
-        const InstructionBlock* pred_block = code()->InstructionBlockAt(pred);
-        if (!array->FindConnectableSubranges(block, pred_block, &result)) {
-          continue;
-        }
-        InstructionOperand pred_op = result.pred_cover_->GetAssignedOperand();
-        InstructionOperand cur_op = result.cur_cover_->GetAssignedOperand();
-        if (pred_op.Equals(cur_op)) continue;
-        if (!pred_op.IsAnyRegister() && cur_op.IsAnyRegister()) {
-          // We're doing a reload.
-          // We don't need to, if:
-          // 1) there's no register use in this block, and
-          // 2) the range ends before the block does, and
-          // 3) we don't have a successor, or the successor is spilled.
-          LifetimePosition block_start =
-              LifetimePosition::GapFromInstructionIndex(block->code_start());
-          LifetimePosition block_end =
-              LifetimePosition::GapFromInstructionIndex(block->code_end());
-          const LiveRange* current = result.cur_cover_;
-          const LiveRange* successor = current->next();
-          if (current->End() < block_end &&
-              (successor == nullptr || successor->spilled())) {
-            // verify point 1: no register use. We can go to the end of the
-            // range, since it's all within the block.
-
-            bool uses_reg = false;
-            for (const UsePosition* use = current->NextUsePosition(block_start);
-                 use != nullptr; use = use->next()) {
-              if (use->operand()->IsAnyRegister()) {
-                uses_reg = true;
-                break;
-              }
-            }
-            if (!uses_reg) continue;
-          }
-          if (current->TopLevel()->IsSpilledOnlyInDeferredBlocks() &&
-              pred_block->IsDeferred()) {
-            // The spill location should be defined in pred_block, so add
-            // pred_block to the list of blocks requiring a spill operand.
-            current->TopLevel()->GetListOfBlocksRequiringSpillOperands()->Add(
-                pred_block->rpo_number().ToInt());
-          }
-        }
-        int move_loc = ResolveControlFlow(block, cur_op, pred_block, pred_op);
-        USE(move_loc);
-        DCHECK_IMPLIES(
-            result.cur_cover_->TopLevel()->IsSpilledOnlyInDeferredBlocks() &&
-                !(pred_op.IsAnyRegister() && cur_op.IsAnyRegister()),
-            code()->GetInstructionBlock(move_loc)->IsDeferred());
-      }
-      iterator.Advance();
-    }
-  }
-
-  // At this stage, we collected blocks needing a spill operand from
-  // ConnectRanges and from ResolveControlFlow. Time to commit the spills for
-  // deferred blocks.
-  for (TopLevelLiveRange* top : data()->live_ranges()) {
-    if (top == nullptr || top->IsEmpty() ||
-        !top->IsSpilledOnlyInDeferredBlocks())
-      continue;
-    CommitSpillsInDeferredBlocks(top, finder.ArrayFor(top->vreg()), local_zone);
-  }
-}
-
-
-int LiveRangeConnector::ResolveControlFlow(const InstructionBlock* block,
-                                           const InstructionOperand& cur_op,
-                                           const InstructionBlock* pred,
-                                           const InstructionOperand& pred_op) {
-  DCHECK(!pred_op.Equals(cur_op));
-  int gap_index;
-  Instruction::GapPosition position;
-  if (block->PredecessorCount() == 1) {
-    gap_index = block->first_instruction_index();
-    position = Instruction::START;
-  } else {
-    DCHECK_EQ(1, pred->SuccessorCount());
-    DCHECK(!code()
-                ->InstructionAt(pred->last_instruction_index())
-                ->HasReferenceMap());
-    gap_index = pred->last_instruction_index();
-    position = Instruction::END;
-  }
-  data()->AddGapMove(gap_index, position, pred_op, cur_op);
-  return gap_index;
-}
-
-void LiveRangeConnector::ConnectRanges(Zone* local_zone) {
-  DelayedInsertionMap delayed_insertion_map(local_zone);
-  for (TopLevelLiveRange* top_range : data()->live_ranges()) {
-    if (top_range == nullptr) continue;
-    bool connect_spilled = top_range->IsSpilledOnlyInDeferredBlocks();
-    LiveRange* first_range = top_range;
-    for (LiveRange *second_range = first_range->next(); second_range != nullptr;
-         first_range = second_range, second_range = second_range->next()) {
-      LifetimePosition pos = second_range->Start();
-      // Add gap move if the two live ranges touch and there is no block
-      // boundary.
-      if (second_range->spilled()) continue;
-      if (first_range->End() != pos) continue;
-      if (data()->IsBlockBoundary(pos) &&
-          !CanEagerlyResolveControlFlow(GetInstructionBlock(code(), pos))) {
-        continue;
-      }
-      InstructionOperand prev_operand = first_range->GetAssignedOperand();
-      InstructionOperand cur_operand = second_range->GetAssignedOperand();
-      if (prev_operand.Equals(cur_operand)) continue;
-      bool delay_insertion = false;
-      Instruction::GapPosition gap_pos;
-      int gap_index = pos.ToInstructionIndex();
-      if (connect_spilled && !prev_operand.IsAnyRegister() &&
-          cur_operand.IsAnyRegister()) {
-        const InstructionBlock* block = code()->GetInstructionBlock(gap_index);
-        DCHECK(block->IsDeferred());
-        // Performing a reload in this block, meaning the spill operand must
-        // be defined here.
-        top_range->GetListOfBlocksRequiringSpillOperands()->Add(
-            block->rpo_number().ToInt());
-      }
-
-      if (pos.IsGapPosition()) {
-        gap_pos = pos.IsStart() ? Instruction::START : Instruction::END;
-      } else {
-        if (pos.IsStart()) {
-          delay_insertion = true;
-        } else {
-          gap_index++;
-        }
-        gap_pos = delay_insertion ? Instruction::END : Instruction::START;
-      }
-      // Reloads or spills for spilled in deferred blocks ranges must happen
-      // only in deferred blocks.
-      DCHECK_IMPLIES(
-          connect_spilled &&
-              !(prev_operand.IsAnyRegister() && cur_operand.IsAnyRegister()),
-          code()->GetInstructionBlock(gap_index)->IsDeferred());
-
-      ParallelMove* move =
-          code()->InstructionAt(gap_index)->GetOrCreateParallelMove(
-              gap_pos, code_zone());
-      if (!delay_insertion) {
-        move->AddMove(prev_operand, cur_operand);
-      } else {
-        delayed_insertion_map.insert(
-            std::make_pair(std::make_pair(move, prev_operand), cur_operand));
-      }
-    }
-  }
-  if (delayed_insertion_map.empty()) return;
-  // Insert all the moves which should occur after the stored move.
-  ZoneVector<MoveOperands*> to_insert(local_zone);
-  ZoneVector<MoveOperands*> to_eliminate(local_zone);
-  to_insert.reserve(4);
-  to_eliminate.reserve(4);
-  ParallelMove* moves = delayed_insertion_map.begin()->first.first;
-  for (auto it = delayed_insertion_map.begin();; ++it) {
-    bool done = it == delayed_insertion_map.end();
-    if (done || it->first.first != moves) {
-      // Commit the MoveOperands for current ParallelMove.
-      for (MoveOperands* move : to_eliminate) {
-        move->Eliminate();
-      }
-      for (MoveOperands* move : to_insert) {
-        moves->push_back(move);
-      }
-      if (done) break;
-      // Reset state.
-      to_eliminate.clear();
-      to_insert.clear();
-      moves = it->first.first;
-    }
-    // Gather all MoveOperands for a single ParallelMove.
-    MoveOperands* move =
-        new (code_zone()) MoveOperands(it->first.second, it->second);
-    moves->PrepareInsertAfter(move, &to_eliminate);
-    to_insert.push_back(move);
-  }
-}
-
-
-void LiveRangeConnector::CommitSpillsInDeferredBlocks(
-    TopLevelLiveRange* range, LiveRangeBoundArray* array, Zone* temp_zone) {
-  DCHECK(range->IsSpilledOnlyInDeferredBlocks());
-  DCHECK(!range->spilled());
-
-  InstructionSequence* code = data()->code();
-  InstructionOperand spill_operand = range->GetSpillRangeOperand();
-
-  TRACE("Live Range %d will be spilled only in deferred blocks.\n",
-        range->vreg());
-  // If we have ranges that aren't spilled but require the operand on the stack,
-  // make sure we insert the spill.
-  for (const LiveRange* child = range; child != nullptr;
-       child = child->next()) {
-    for (const UsePosition* pos = child->first_pos(); pos != nullptr;
-         pos = pos->next()) {
-      if (pos->type() != UsePositionType::kRequiresSlot && !child->spilled())
-        continue;
-      range->AddBlockRequiringSpillOperand(
-          code->GetInstructionBlock(pos->pos().ToInstructionIndex())
-              ->rpo_number());
-    }
-  }
-
-  ZoneQueue<int> worklist(temp_zone);
-
-  for (BitVector::Iterator iterator(
-           range->GetListOfBlocksRequiringSpillOperands());
-       !iterator.Done(); iterator.Advance()) {
-    worklist.push(iterator.Current());
-  }
-
-  ZoneSet<std::pair<RpoNumber, int>> done_moves(temp_zone);
-  // Seek the deferred blocks that dominate locations requiring spill operands,
-  // and spill there. We only need to spill at the start of such blocks.
-  BitVector done_blocks(
-      range->GetListOfBlocksRequiringSpillOperands()->length(), temp_zone);
-  while (!worklist.empty()) {
-    int block_id = worklist.front();
-    worklist.pop();
-    if (done_blocks.Contains(block_id)) continue;
-    done_blocks.Add(block_id);
-    InstructionBlock* spill_block =
-        code->InstructionBlockAt(RpoNumber::FromInt(block_id));
-
-    for (const RpoNumber& pred : spill_block->predecessors()) {
-      const InstructionBlock* pred_block = code->InstructionBlockAt(pred);
-
-      if (pred_block->IsDeferred()) {
-        worklist.push(pred_block->rpo_number().ToInt());
-      } else {
-        LifetimePosition pred_end =
-            LifetimePosition::InstructionFromInstructionIndex(
-                pred_block->last_instruction_index());
-
-        LiveRangeBound* bound = array->Find(pred_end);
-
-        InstructionOperand pred_op = bound->range_->GetAssignedOperand();
-
-        RpoNumber spill_block_number = spill_block->rpo_number();
-        if (done_moves.find(std::make_pair(
-                spill_block_number, range->vreg())) == done_moves.end()) {
-          data()->AddGapMove(spill_block->first_instruction_index(),
-                             Instruction::GapPosition::START, pred_op,
-                             spill_operand);
-          done_moves.insert(std::make_pair(spill_block_number, range->vreg()));
-          spill_block->mark_needs_frame();
-        }
-      }
-    }
-  }
-}
-
-#undef TRACE
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/register-allocator.h b/src/v8/src/compiler/register-allocator.h
deleted file mode 100644
index 63e94fb..0000000
--- a/src/v8/src/compiler/register-allocator.h
+++ /dev/null
@@ -1,1216 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_REGISTER_ALLOCATOR_H_
-#define V8_REGISTER_ALLOCATOR_H_
-
-#include "src/base/bits.h"
-#include "src/base/compiler-specific.h"
-#include "src/compiler/instruction.h"
-#include "src/globals.h"
-#include "src/ostreams.h"
-#include "src/register-configuration.h"
-#include "src/zone/zone-containers.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-enum RegisterKind { GENERAL_REGISTERS, FP_REGISTERS };
-
-// This class represents a single point of a InstructionOperand's lifetime. For
-// each instruction there are four lifetime positions:
-//
-//   [[START, END], [START, END]]
-//
-// Where the first half position corresponds to
-//
-//  [GapPosition::START, GapPosition::END]
-//
-// and the second half position corresponds to
-//
-//  [Lifetime::USED_AT_START, Lifetime::USED_AT_END]
-//
-class LifetimePosition final {
- public:
-  // Return the lifetime position that corresponds to the beginning of
-  // the gap with the given index.
-  static LifetimePosition GapFromInstructionIndex(int index) {
-    return LifetimePosition(index * kStep);
-  }
-  // Return the lifetime position that corresponds to the beginning of
-  // the instruction with the given index.
-  static LifetimePosition InstructionFromInstructionIndex(int index) {
-    return LifetimePosition(index * kStep + kHalfStep);
-  }
-
-  static bool ExistsGapPositionBetween(LifetimePosition pos1,
-                                       LifetimePosition pos2) {
-    if (pos1 > pos2) std::swap(pos1, pos2);
-    LifetimePosition next(pos1.value_ + 1);
-    if (next.IsGapPosition()) return next < pos2;
-    return next.NextFullStart() < pos2;
-  }
-
-  // Returns a numeric representation of this lifetime position.
-  int value() const { return value_; }
-
-  // Returns the index of the instruction to which this lifetime position
-  // corresponds.
-  int ToInstructionIndex() const {
-    DCHECK(IsValid());
-    return value_ / kStep;
-  }
-
-  // Returns true if this lifetime position corresponds to a START value
-  bool IsStart() const { return (value_ & (kHalfStep - 1)) == 0; }
-  // Returns true if this lifetime position corresponds to an END value
-  bool IsEnd() const { return (value_ & (kHalfStep - 1)) == 1; }
-  // Returns true if this lifetime position corresponds to a gap START value
-  bool IsFullStart() const { return (value_ & (kStep - 1)) == 0; }
-
-  bool IsGapPosition() const { return (value_ & 0x2) == 0; }
-  bool IsInstructionPosition() const { return !IsGapPosition(); }
-
-  // Returns the lifetime position for the current START.
-  LifetimePosition Start() const {
-    DCHECK(IsValid());
-    return LifetimePosition(value_ & ~(kHalfStep - 1));
-  }
-
-  // Returns the lifetime position for the current gap START.
-  LifetimePosition FullStart() const {
-    DCHECK(IsValid());
-    return LifetimePosition(value_ & ~(kStep - 1));
-  }
-
-  // Returns the lifetime position for the current END.
-  LifetimePosition End() const {
-    DCHECK(IsValid());
-    return LifetimePosition(Start().value_ + kHalfStep / 2);
-  }
-
-  // Returns the lifetime position for the beginning of the next START.
-  LifetimePosition NextStart() const {
-    DCHECK(IsValid());
-    return LifetimePosition(Start().value_ + kHalfStep);
-  }
-
-  // Returns the lifetime position for the beginning of the next gap START.
-  LifetimePosition NextFullStart() const {
-    DCHECK(IsValid());
-    return LifetimePosition(FullStart().value_ + kStep);
-  }
-
-  // Returns the lifetime position for the beginning of the previous START.
-  LifetimePosition PrevStart() const {
-    DCHECK(IsValid());
-    DCHECK_LE(kHalfStep, value_);
-    return LifetimePosition(Start().value_ - kHalfStep);
-  }
-
-  // Constructs the lifetime position which does not correspond to any
-  // instruction.
-  LifetimePosition() : value_(-1) {}
-
-  // Returns true if this lifetime positions corrensponds to some
-  // instruction.
-  bool IsValid() const { return value_ != -1; }
-
-  bool operator<(const LifetimePosition& that) const {
-    return this->value_ < that.value_;
-  }
-
-  bool operator<=(const LifetimePosition& that) const {
-    return this->value_ <= that.value_;
-  }
-
-  bool operator==(const LifetimePosition& that) const {
-    return this->value_ == that.value_;
-  }
-
-  bool operator!=(const LifetimePosition& that) const {
-    return this->value_ != that.value_;
-  }
-
-  bool operator>(const LifetimePosition& that) const {
-    return this->value_ > that.value_;
-  }
-
-  bool operator>=(const LifetimePosition& that) const {
-    return this->value_ >= that.value_;
-  }
-
-  void Print() const;
-
-  static inline LifetimePosition Invalid() { return LifetimePosition(); }
-
-  static inline LifetimePosition MaxPosition() {
-    // We have to use this kind of getter instead of static member due to
-    // crash bug in GDB.
-    return LifetimePosition(kMaxInt);
-  }
-
-  static inline LifetimePosition FromInt(int value) {
-    return LifetimePosition(value);
-  }
-
- private:
-  static const int kHalfStep = 2;
-  static const int kStep = 2 * kHalfStep;
-
-  static_assert(base::bits::IsPowerOfTwo(kHalfStep),
-                "Code relies on kStep and kHalfStep being a power of two");
-
-  explicit LifetimePosition(int value) : value_(value) {}
-
-  int value_;
-};
-
-
-std::ostream& operator<<(std::ostream& os, const LifetimePosition pos);
-
-
-// Representation of the non-empty interval [start,end[.
-class UseInterval final : public ZoneObject {
- public:
-  UseInterval(LifetimePosition start, LifetimePosition end)
-      : start_(start), end_(end), next_(nullptr) {
-    DCHECK(start < end);
-  }
-
-  LifetimePosition start() const { return start_; }
-  void set_start(LifetimePosition start) { start_ = start; }
-  LifetimePosition end() const { return end_; }
-  void set_end(LifetimePosition end) { end_ = end; }
-  UseInterval* next() const { return next_; }
-  void set_next(UseInterval* next) { next_ = next; }
-
-  // Split this interval at the given position without effecting the
-  // live range that owns it. The interval must contain the position.
-  UseInterval* SplitAt(LifetimePosition pos, Zone* zone);
-
-  // If this interval intersects with other return smallest position
-  // that belongs to both of them.
-  LifetimePosition Intersect(const UseInterval* other) const {
-    if (other->start() < start_) return other->Intersect(this);
-    if (other->start() < end_) return other->start();
-    return LifetimePosition::Invalid();
-  }
-
-  bool Contains(LifetimePosition point) const {
-    return start_ <= point && point < end_;
-  }
-
-  // Returns the index of the first gap covered by this interval.
-  int FirstGapIndex() const {
-    int ret = start_.ToInstructionIndex();
-    if (start_.IsInstructionPosition()) {
-      ++ret;
-    }
-    return ret;
-  }
-
-  // Returns the index of the last gap covered by this interval.
-  int LastGapIndex() const {
-    int ret = end_.ToInstructionIndex();
-    if (end_.IsGapPosition() && end_.IsStart()) {
-      --ret;
-    }
-    return ret;
-  }
-
- private:
-  LifetimePosition start_;
-  LifetimePosition end_;
-  UseInterval* next_;
-
-  DISALLOW_COPY_AND_ASSIGN(UseInterval);
-};
-
-
-enum class UsePositionType : uint8_t { kAny, kRequiresRegister, kRequiresSlot };
-
-
-enum class UsePositionHintType : uint8_t {
-  kNone,
-  kOperand,
-  kUsePos,
-  kPhi,
-  kUnresolved
-};
-
-
-static const int32_t kUnassignedRegister =
-    RegisterConfiguration::kMaxGeneralRegisters;
-
-static_assert(kUnassignedRegister <= RegisterConfiguration::kMaxFPRegisters,
-              "kUnassignedRegister too small");
-
-// Representation of a use position.
-class V8_EXPORT_PRIVATE UsePosition final
-    : public NON_EXPORTED_BASE(ZoneObject) {
- public:
-  UsePosition(LifetimePosition pos, InstructionOperand* operand, void* hint,
-              UsePositionHintType hint_type);
-
-  InstructionOperand* operand() const { return operand_; }
-  bool HasOperand() const { return operand_ != nullptr; }
-
-  bool RegisterIsBeneficial() const {
-    return RegisterBeneficialField::decode(flags_);
-  }
-  UsePositionType type() const { return TypeField::decode(flags_); }
-  void set_type(UsePositionType type, bool register_beneficial);
-
-  LifetimePosition pos() const { return pos_; }
-
-  UsePosition* next() const { return next_; }
-  void set_next(UsePosition* next) { next_ = next; }
-
-  // For hinting only.
-  void set_assigned_register(int register_code) {
-    flags_ = AssignedRegisterField::update(flags_, register_code);
-  }
-
-  UsePositionHintType hint_type() const {
-    return HintTypeField::decode(flags_);
-  }
-  bool HasHint() const;
-  bool HintRegister(int* register_code) const;
-  void SetHint(UsePosition* use_pos);
-  void ResolveHint(UsePosition* use_pos);
-  bool IsResolved() const {
-    return hint_type() != UsePositionHintType::kUnresolved;
-  }
-  static UsePositionHintType HintTypeForOperand(const InstructionOperand& op);
-
- private:
-  typedef BitField<UsePositionType, 0, 2> TypeField;
-  typedef BitField<UsePositionHintType, 2, 3> HintTypeField;
-  typedef BitField<bool, 5, 1> RegisterBeneficialField;
-  typedef BitField<int32_t, 6, 6> AssignedRegisterField;
-
-  InstructionOperand* const operand_;
-  void* hint_;
-  UsePosition* next_;
-  LifetimePosition const pos_;
-  uint32_t flags_;
-
-  DISALLOW_COPY_AND_ASSIGN(UsePosition);
-};
-
-
-class SpillRange;
-class RegisterAllocationData;
-class TopLevelLiveRange;
-class LiveRangeGroup;
-
-// Representation of SSA values' live ranges as a collection of (continuous)
-// intervals over the instruction ordering.
-class V8_EXPORT_PRIVATE LiveRange : public NON_EXPORTED_BASE(ZoneObject) {
- public:
-  UseInterval* first_interval() const { return first_interval_; }
-  UsePosition* first_pos() const { return first_pos_; }
-  TopLevelLiveRange* TopLevel() { return top_level_; }
-  const TopLevelLiveRange* TopLevel() const { return top_level_; }
-
-  bool IsTopLevel() const;
-
-  LiveRange* next() const { return next_; }
-
-  int relative_id() const { return relative_id_; }
-
-  bool IsEmpty() const { return first_interval() == nullptr; }
-
-  InstructionOperand GetAssignedOperand() const;
-
-  MachineRepresentation representation() const {
-    return RepresentationField::decode(bits_);
-  }
-
-  int assigned_register() const { return AssignedRegisterField::decode(bits_); }
-  bool HasRegisterAssigned() const {
-    return assigned_register() != kUnassignedRegister;
-  }
-  void set_assigned_register(int reg);
-  void UnsetAssignedRegister();
-
-  bool spilled() const { return SpilledField::decode(bits_); }
-  void Spill();
-
-  RegisterKind kind() const;
-
-  // Returns use position in this live range that follows both start
-  // and last processed use position.
-  UsePosition* NextUsePosition(LifetimePosition start) const;
-
-  // Returns use position for which register is required in this live
-  // range and which follows both start and last processed use position
-  UsePosition* NextRegisterPosition(LifetimePosition start) const;
-
-  // Returns the first use position requiring stack slot, or nullptr.
-  UsePosition* NextSlotPosition(LifetimePosition start) const;
-
-  // Returns use position for which register is beneficial in this live
-  // range and which follows both start and last processed use position
-  UsePosition* NextUsePositionRegisterIsBeneficial(
-      LifetimePosition start) const;
-
-  // Returns lifetime position for which register is beneficial in this live
-  // range and which follows both start and last processed use position.
-  LifetimePosition NextLifetimePositionRegisterIsBeneficial(
-      const LifetimePosition& start) const;
-
-  // Returns use position for which register is beneficial in this live
-  // range and which precedes start.
-  UsePosition* PreviousUsePositionRegisterIsBeneficial(
-      LifetimePosition start) const;
-
-  // Can this live range be spilled at this position.
-  bool CanBeSpilled(LifetimePosition pos) const;
-
-  // Splitting primitive used by both splitting and splintering members.
-  // Performs the split, but does not link the resulting ranges.
-  // The given position must follow the start of the range.
-  // All uses following the given position will be moved from this
-  // live range to the result live range.
-  // The current range will terminate at position, while result will start from
-  // position.
-  enum HintConnectionOption : bool {
-    DoNotConnectHints = false,
-    ConnectHints = true
-  };
-  UsePosition* DetachAt(LifetimePosition position, LiveRange* result,
-                        Zone* zone, HintConnectionOption connect_hints);
-
-  // Detaches at position, and then links the resulting ranges. Returns the
-  // child, which starts at position.
-  LiveRange* SplitAt(LifetimePosition position, Zone* zone);
-
-  // Returns nullptr when no register is hinted, otherwise sets register_index.
-  UsePosition* FirstHintPosition(int* register_index) const;
-  UsePosition* FirstHintPosition() const {
-    int register_index;
-    return FirstHintPosition(&register_index);
-  }
-
-  UsePosition* current_hint_position() const {
-    DCHECK(current_hint_position_ == FirstHintPosition());
-    return current_hint_position_;
-  }
-
-  LifetimePosition Start() const {
-    DCHECK(!IsEmpty());
-    return first_interval()->start();
-  }
-
-  LifetimePosition End() const {
-    DCHECK(!IsEmpty());
-    return last_interval_->end();
-  }
-
-  bool ShouldBeAllocatedBefore(const LiveRange* other) const;
-  bool CanCover(LifetimePosition position) const;
-  bool Covers(LifetimePosition position) const;
-  LifetimePosition FirstIntersection(LiveRange* other) const;
-
-  void VerifyChildStructure() const {
-    VerifyIntervals();
-    VerifyPositions();
-  }
-
-  void ConvertUsesToOperand(const InstructionOperand& op,
-                            const InstructionOperand& spill_op);
-  void SetUseHints(int register_index);
-  void UnsetUseHints() { SetUseHints(kUnassignedRegister); }
-
-  void Print(const RegisterConfiguration* config, bool with_children) const;
-  void Print(bool with_children) const;
-
- private:
-  friend class TopLevelLiveRange;
-  explicit LiveRange(int relative_id, MachineRepresentation rep,
-                     TopLevelLiveRange* top_level);
-
-  void UpdateParentForAllChildren(TopLevelLiveRange* new_top_level);
-
-  void set_spilled(bool value) { bits_ = SpilledField::update(bits_, value); }
-
-  UseInterval* FirstSearchIntervalForPosition(LifetimePosition position) const;
-  void AdvanceLastProcessedMarker(UseInterval* to_start_of,
-                                  LifetimePosition but_not_past) const;
-
-  void VerifyPositions() const;
-  void VerifyIntervals() const;
-
-  typedef BitField<bool, 0, 1> SpilledField;
-  typedef BitField<int32_t, 6, 6> AssignedRegisterField;
-  typedef BitField<MachineRepresentation, 12, 8> RepresentationField;
-
-  // Unique among children and splinters of the same virtual register.
-  int relative_id_;
-  uint32_t bits_;
-  UseInterval* last_interval_;
-  UseInterval* first_interval_;
-  UsePosition* first_pos_;
-  TopLevelLiveRange* top_level_;
-  LiveRange* next_;
-  // This is used as a cache, it doesn't affect correctness.
-  mutable UseInterval* current_interval_;
-  // This is used as a cache, it doesn't affect correctness.
-  mutable UsePosition* last_processed_use_;
-  // This is used as a cache, it's invalid outside of BuildLiveRanges.
-  mutable UsePosition* current_hint_position_;
-  // Cache the last position splintering stopped at.
-  mutable UsePosition* splitting_pointer_;
-
-  DISALLOW_COPY_AND_ASSIGN(LiveRange);
-};
-
-
-class LiveRangeGroup final : public ZoneObject {
- public:
-  explicit LiveRangeGroup(Zone* zone) : ranges_(zone) {}
-  ZoneVector<LiveRange*>& ranges() { return ranges_; }
-  const ZoneVector<LiveRange*>& ranges() const { return ranges_; }
-
-  int assigned_register() const { return assigned_register_; }
-  void set_assigned_register(int reg) { assigned_register_ = reg; }
-
- private:
-  ZoneVector<LiveRange*> ranges_;
-  int assigned_register_;
-  DISALLOW_COPY_AND_ASSIGN(LiveRangeGroup);
-};
-
-class V8_EXPORT_PRIVATE TopLevelLiveRange final : public LiveRange {
- public:
-  explicit TopLevelLiveRange(int vreg, MachineRepresentation rep);
-  int spill_start_index() const { return spill_start_index_; }
-
-  bool IsFixed() const { return vreg_ < 0; }
-
-  bool is_phi() const { return IsPhiField::decode(bits_); }
-  void set_is_phi(bool value) { bits_ = IsPhiField::update(bits_, value); }
-
-  bool is_non_loop_phi() const { return IsNonLoopPhiField::decode(bits_); }
-  void set_is_non_loop_phi(bool value) {
-    bits_ = IsNonLoopPhiField::update(bits_, value);
-  }
-
-  bool has_slot_use() const { return HasSlotUseField::decode(bits_); }
-  void set_has_slot_use(bool value) {
-    bits_ = HasSlotUseField::update(bits_, value);
-  }
-
-  // Add a new interval or a new use position to this live range.
-  void EnsureInterval(LifetimePosition start, LifetimePosition end, Zone* zone);
-  void AddUseInterval(LifetimePosition start, LifetimePosition end, Zone* zone);
-  void AddUsePosition(UsePosition* pos);
-
-  // Shorten the most recently added interval by setting a new start.
-  void ShortenTo(LifetimePosition start);
-
-  // Detaches between start and end, and attributes the resulting range to
-  // result.
-  // The current range is pointed to as "splintered_from". No parent/child
-  // relationship is established between this and result.
-  void Splinter(LifetimePosition start, LifetimePosition end, Zone* zone);
-
-  // Assuming other was splintered from this range, embeds other and its
-  // children as part of the children sequence of this range.
-  void Merge(TopLevelLiveRange* other, Zone* zone);
-
-  // Spill range management.
-  void SetSpillRange(SpillRange* spill_range);
-  enum class SpillType { kNoSpillType, kSpillOperand, kSpillRange };
-  void set_spill_type(SpillType value) {
-    bits_ = SpillTypeField::update(bits_, value);
-  }
-  SpillType spill_type() const { return SpillTypeField::decode(bits_); }
-  InstructionOperand* GetSpillOperand() const {
-    DCHECK_EQ(SpillType::kSpillOperand, spill_type());
-    return spill_operand_;
-  }
-
-  SpillRange* GetAllocatedSpillRange() const {
-    DCHECK_NE(SpillType::kSpillOperand, spill_type());
-    return spill_range_;
-  }
-
-  SpillRange* GetSpillRange() const {
-    DCHECK_EQ(SpillType::kSpillRange, spill_type());
-    return spill_range_;
-  }
-  bool HasNoSpillType() const {
-    return spill_type() == SpillType::kNoSpillType;
-  }
-  bool HasSpillOperand() const {
-    return spill_type() == SpillType::kSpillOperand;
-  }
-  bool HasSpillRange() const { return spill_type() == SpillType::kSpillRange; }
-
-  AllocatedOperand GetSpillRangeOperand() const;
-
-  void RecordSpillLocation(Zone* zone, int gap_index,
-                           InstructionOperand* operand);
-  void SetSpillOperand(InstructionOperand* operand);
-  void SetSpillStartIndex(int start) {
-    spill_start_index_ = Min(start, spill_start_index_);
-  }
-
-  void CommitSpillMoves(InstructionSequence* sequence,
-                        const InstructionOperand& operand,
-                        bool might_be_duplicated);
-
-  // If all the children of this range are spilled in deferred blocks, and if
-  // for any non-spilled child with a use position requiring a slot, that range
-  // is contained in a deferred block, mark the range as
-  // IsSpilledOnlyInDeferredBlocks, so that we avoid spilling at definition,
-  // and instead let the LiveRangeConnector perform the spills within the
-  // deferred blocks. If so, we insert here spills for non-spilled ranges
-  // with slot use positions.
-  void TreatAsSpilledInDeferredBlock(Zone* zone, int total_block_count) {
-    spill_start_index_ = -1;
-    spilled_in_deferred_blocks_ = true;
-    spill_move_insertion_locations_ = nullptr;
-    list_of_blocks_requiring_spill_operands_ =
-        new (zone) BitVector(total_block_count, zone);
-  }
-
-  void CommitSpillInDeferredBlocks(RegisterAllocationData* data,
-                                   const InstructionOperand& spill_operand,
-                                   BitVector* necessary_spill_points);
-
-  TopLevelLiveRange* splintered_from() const { return splintered_from_; }
-  bool IsSplinter() const { return splintered_from_ != nullptr; }
-  bool MayRequireSpillRange() const {
-    DCHECK(!IsSplinter());
-    return !HasSpillOperand() && spill_range_ == nullptr;
-  }
-  void UpdateSpillRangePostMerge(TopLevelLiveRange* merged);
-  int vreg() const { return vreg_; }
-
-#if DEBUG
-  int debug_virt_reg() const;
-#endif
-
-  void Verify() const;
-  void VerifyChildrenInOrder() const;
-
-  int GetNextChildId() {
-    return IsSplinter() ? splintered_from()->GetNextChildId()
-                        : ++last_child_id_;
-  }
-
-  int GetChildCount() const { return last_child_id_ + 1; }
-
-  bool IsSpilledOnlyInDeferredBlocks() const {
-    return spilled_in_deferred_blocks_;
-  }
-
-  struct SpillMoveInsertionList;
-
-  SpillMoveInsertionList* GetSpillMoveInsertionLocations() const {
-    DCHECK(!IsSpilledOnlyInDeferredBlocks());
-    return spill_move_insertion_locations_;
-  }
-  TopLevelLiveRange* splinter() const { return splinter_; }
-  void SetSplinter(TopLevelLiveRange* splinter) {
-    DCHECK_NULL(splinter_);
-    DCHECK_NOT_NULL(splinter);
-
-    splinter_ = splinter;
-    splinter->relative_id_ = GetNextChildId();
-    splinter->set_spill_type(spill_type());
-    splinter->SetSplinteredFrom(this);
-  }
-
-  void MarkHasPreassignedSlot() { has_preassigned_slot_ = true; }
-  bool has_preassigned_slot() const { return has_preassigned_slot_; }
-
-  void AddBlockRequiringSpillOperand(RpoNumber block_id) {
-    DCHECK(IsSpilledOnlyInDeferredBlocks());
-    GetListOfBlocksRequiringSpillOperands()->Add(block_id.ToInt());
-  }
-
-  BitVector* GetListOfBlocksRequiringSpillOperands() const {
-    DCHECK(IsSpilledOnlyInDeferredBlocks());
-    return list_of_blocks_requiring_spill_operands_;
-  }
-
- private:
-  void SetSplinteredFrom(TopLevelLiveRange* splinter_parent);
-
-  typedef BitField<bool, 1, 1> HasSlotUseField;
-  typedef BitField<bool, 2, 1> IsPhiField;
-  typedef BitField<bool, 3, 1> IsNonLoopPhiField;
-  typedef BitField<SpillType, 4, 2> SpillTypeField;
-
-  int vreg_;
-  int last_child_id_;
-  TopLevelLiveRange* splintered_from_;
-  union {
-    // Correct value determined by spill_type()
-    InstructionOperand* spill_operand_;
-    SpillRange* spill_range_;
-  };
-
-  union {
-    SpillMoveInsertionList* spill_move_insertion_locations_;
-    BitVector* list_of_blocks_requiring_spill_operands_;
-  };
-
-  // TODO(mtrofin): generalize spilling after definition, currently specialized
-  // just for spill in a single deferred block.
-  bool spilled_in_deferred_blocks_;
-  int spill_start_index_;
-  UsePosition* last_pos_;
-  TopLevelLiveRange* splinter_;
-  bool has_preassigned_slot_;
-
-  DISALLOW_COPY_AND_ASSIGN(TopLevelLiveRange);
-};
-
-
-struct PrintableLiveRange {
-  const RegisterConfiguration* register_configuration_;
-  const LiveRange* range_;
-};
-
-
-std::ostream& operator<<(std::ostream& os,
-                         const PrintableLiveRange& printable_range);
-
-
-class SpillRange final : public ZoneObject {
- public:
-  static const int kUnassignedSlot = -1;
-  SpillRange(TopLevelLiveRange* range, Zone* zone);
-
-  UseInterval* interval() const { return use_interval_; }
-
-  bool IsEmpty() const { return live_ranges_.empty(); }
-  bool TryMerge(SpillRange* other);
-  bool HasSlot() const { return assigned_slot_ != kUnassignedSlot; }
-
-  void set_assigned_slot(int index) {
-    DCHECK_EQ(kUnassignedSlot, assigned_slot_);
-    assigned_slot_ = index;
-  }
-  int assigned_slot() {
-    DCHECK_NE(kUnassignedSlot, assigned_slot_);
-    return assigned_slot_;
-  }
-  const ZoneVector<TopLevelLiveRange*>& live_ranges() const {
-    return live_ranges_;
-  }
-  ZoneVector<TopLevelLiveRange*>& live_ranges() { return live_ranges_; }
-  // Spill slots can be 4, 8, or 16 bytes wide.
-  int byte_width() const { return byte_width_; }
-  void Print() const;
-
- private:
-  LifetimePosition End() const { return end_position_; }
-  bool IsIntersectingWith(SpillRange* other) const;
-  // Merge intervals, making sure the use intervals are sorted
-  void MergeDisjointIntervals(UseInterval* other);
-
-  ZoneVector<TopLevelLiveRange*> live_ranges_;
-  UseInterval* use_interval_;
-  LifetimePosition end_position_;
-  int assigned_slot_;
-  int byte_width_;
-
-  DISALLOW_COPY_AND_ASSIGN(SpillRange);
-};
-
-
-class RegisterAllocationData final : public ZoneObject {
- public:
-  class PhiMapValue : public ZoneObject {
-   public:
-    PhiMapValue(PhiInstruction* phi, const InstructionBlock* block, Zone* zone);
-
-    const PhiInstruction* phi() const { return phi_; }
-    const InstructionBlock* block() const { return block_; }
-
-    // For hinting.
-    int assigned_register() const { return assigned_register_; }
-    void set_assigned_register(int register_code) {
-      DCHECK_EQ(assigned_register_, kUnassignedRegister);
-      assigned_register_ = register_code;
-    }
-    void UnsetAssignedRegister() { assigned_register_ = kUnassignedRegister; }
-
-    void AddOperand(InstructionOperand* operand);
-    void CommitAssignment(const InstructionOperand& operand);
-
-   private:
-    PhiInstruction* const phi_;
-    const InstructionBlock* const block_;
-    ZoneVector<InstructionOperand*> incoming_operands_;
-    int assigned_register_;
-  };
-  typedef ZoneMap<int, PhiMapValue*> PhiMap;
-
-  struct DelayedReference {
-    ReferenceMap* map;
-    InstructionOperand* operand;
-  };
-  typedef ZoneVector<DelayedReference> DelayedReferences;
-  typedef ZoneVector<std::pair<TopLevelLiveRange*, int>>
-      RangesWithPreassignedSlots;
-
-  RegisterAllocationData(const RegisterConfiguration* config,
-                         Zone* allocation_zone, Frame* frame,
-                         InstructionSequence* code,
-                         const char* debug_name = nullptr);
-
-  const ZoneVector<TopLevelLiveRange*>& live_ranges() const {
-    return live_ranges_;
-  }
-  ZoneVector<TopLevelLiveRange*>& live_ranges() { return live_ranges_; }
-  const ZoneVector<TopLevelLiveRange*>& fixed_live_ranges() const {
-    return fixed_live_ranges_;
-  }
-  ZoneVector<TopLevelLiveRange*>& fixed_live_ranges() {
-    return fixed_live_ranges_;
-  }
-  ZoneVector<TopLevelLiveRange*>& fixed_float_live_ranges() {
-    return fixed_float_live_ranges_;
-  }
-  const ZoneVector<TopLevelLiveRange*>& fixed_float_live_ranges() const {
-    return fixed_float_live_ranges_;
-  }
-  ZoneVector<TopLevelLiveRange*>& fixed_double_live_ranges() {
-    return fixed_double_live_ranges_;
-  }
-  const ZoneVector<TopLevelLiveRange*>& fixed_double_live_ranges() const {
-    return fixed_double_live_ranges_;
-  }
-  ZoneVector<TopLevelLiveRange*>& fixed_simd128_live_ranges() {
-    return fixed_simd128_live_ranges_;
-  }
-  const ZoneVector<TopLevelLiveRange*>& fixed_simd128_live_ranges() const {
-    return fixed_simd128_live_ranges_;
-  }
-  ZoneVector<BitVector*>& live_in_sets() { return live_in_sets_; }
-  ZoneVector<BitVector*>& live_out_sets() { return live_out_sets_; }
-  ZoneVector<SpillRange*>& spill_ranges() { return spill_ranges_; }
-  DelayedReferences& delayed_references() { return delayed_references_; }
-  InstructionSequence* code() const { return code_; }
-  // This zone is for data structures only needed during register allocation
-  // phases.
-  Zone* allocation_zone() const { return allocation_zone_; }
-  // This zone is for InstructionOperands and moves that live beyond register
-  // allocation.
-  Zone* code_zone() const { return code()->zone(); }
-  Frame* frame() const { return frame_; }
-  const char* debug_name() const { return debug_name_; }
-  const RegisterConfiguration* config() const { return config_; }
-
-  MachineRepresentation RepresentationFor(int virtual_register);
-
-  TopLevelLiveRange* GetOrCreateLiveRangeFor(int index);
-  // Creates a new live range.
-  TopLevelLiveRange* NewLiveRange(int index, MachineRepresentation rep);
-  TopLevelLiveRange* NextLiveRange(MachineRepresentation rep);
-
-  SpillRange* AssignSpillRangeToLiveRange(TopLevelLiveRange* range);
-  SpillRange* CreateSpillRangeForLiveRange(TopLevelLiveRange* range);
-
-  MoveOperands* AddGapMove(int index, Instruction::GapPosition position,
-                           const InstructionOperand& from,
-                           const InstructionOperand& to);
-
-  bool IsReference(TopLevelLiveRange* top_range) const {
-    return code()->IsReference(top_range->vreg());
-  }
-
-  bool ExistsUseWithoutDefinition();
-  bool RangesDefinedInDeferredStayInDeferred();
-
-  void MarkAllocated(MachineRepresentation rep, int index);
-
-  PhiMapValue* InitializePhiMap(const InstructionBlock* block,
-                                PhiInstruction* phi);
-  PhiMapValue* GetPhiMapValueFor(TopLevelLiveRange* top_range);
-  PhiMapValue* GetPhiMapValueFor(int virtual_register);
-  bool IsBlockBoundary(LifetimePosition pos) const;
-
-  RangesWithPreassignedSlots& preassigned_slot_ranges() {
-    return preassigned_slot_ranges_;
-  }
-
- private:
-  int GetNextLiveRangeId();
-
-  Zone* const allocation_zone_;
-  Frame* const frame_;
-  InstructionSequence* const code_;
-  const char* const debug_name_;
-  const RegisterConfiguration* const config_;
-  PhiMap phi_map_;
-  ZoneVector<BitVector*> live_in_sets_;
-  ZoneVector<BitVector*> live_out_sets_;
-  ZoneVector<TopLevelLiveRange*> live_ranges_;
-  ZoneVector<TopLevelLiveRange*> fixed_live_ranges_;
-  ZoneVector<TopLevelLiveRange*> fixed_float_live_ranges_;
-  ZoneVector<TopLevelLiveRange*> fixed_double_live_ranges_;
-  ZoneVector<TopLevelLiveRange*> fixed_simd128_live_ranges_;
-  ZoneVector<SpillRange*> spill_ranges_;
-  DelayedReferences delayed_references_;
-  BitVector* assigned_registers_;
-  BitVector* assigned_double_registers_;
-  int virtual_register_count_;
-  RangesWithPreassignedSlots preassigned_slot_ranges_;
-
-  DISALLOW_COPY_AND_ASSIGN(RegisterAllocationData);
-};
-
-
-class ConstraintBuilder final : public ZoneObject {
- public:
-  explicit ConstraintBuilder(RegisterAllocationData* data);
-
-  // Phase 1 : insert moves to account for fixed register operands.
-  void MeetRegisterConstraints();
-
-  // Phase 2: deconstruct SSA by inserting moves in successors and the headers
-  // of blocks containing phis.
-  void ResolvePhis();
-
- private:
-  RegisterAllocationData* data() const { return data_; }
-  InstructionSequence* code() const { return data()->code(); }
-  Zone* allocation_zone() const { return data()->allocation_zone(); }
-
-  InstructionOperand* AllocateFixed(UnallocatedOperand* operand, int pos,
-                                    bool is_tagged);
-  void MeetRegisterConstraints(const InstructionBlock* block);
-  void MeetConstraintsBefore(int index);
-  void MeetConstraintsAfter(int index);
-  void MeetRegisterConstraintsForLastInstructionInBlock(
-      const InstructionBlock* block);
-  void ResolvePhis(const InstructionBlock* block);
-
-  RegisterAllocationData* const data_;
-
-  DISALLOW_COPY_AND_ASSIGN(ConstraintBuilder);
-};
-
-
-class LiveRangeBuilder final : public ZoneObject {
- public:
-  explicit LiveRangeBuilder(RegisterAllocationData* data, Zone* local_zone);
-
-  // Phase 3: compute liveness of all virtual register.
-  void BuildLiveRanges();
-  static BitVector* ComputeLiveOut(const InstructionBlock* block,
-                                   RegisterAllocationData* data);
-
- private:
-  RegisterAllocationData* data() const { return data_; }
-  InstructionSequence* code() const { return data()->code(); }
-  Zone* allocation_zone() const { return data()->allocation_zone(); }
-  Zone* code_zone() const { return code()->zone(); }
-  const RegisterConfiguration* config() const { return data()->config(); }
-  ZoneVector<BitVector*>& live_in_sets() const {
-    return data()->live_in_sets();
-  }
-
-  // Verification.
-  void Verify() const;
-  bool IntervalStartsAtBlockBoundary(const UseInterval* interval) const;
-  bool IntervalPredecessorsCoveredByRange(const UseInterval* interval,
-                                          const TopLevelLiveRange* range) const;
-  bool NextIntervalStartsInDifferentBlocks(const UseInterval* interval) const;
-
-  // Liveness analysis support.
-  void AddInitialIntervals(const InstructionBlock* block, BitVector* live_out);
-  void ProcessInstructions(const InstructionBlock* block, BitVector* live);
-  void ProcessPhis(const InstructionBlock* block, BitVector* live);
-  void ProcessLoopHeader(const InstructionBlock* block, BitVector* live);
-
-  static int FixedLiveRangeID(int index) { return -index - 1; }
-  int FixedFPLiveRangeID(int index, MachineRepresentation rep);
-  TopLevelLiveRange* FixedLiveRangeFor(int index);
-  TopLevelLiveRange* FixedFPLiveRangeFor(int index, MachineRepresentation rep);
-
-  void MapPhiHint(InstructionOperand* operand, UsePosition* use_pos);
-  void ResolvePhiHint(InstructionOperand* operand, UsePosition* use_pos);
-
-  UsePosition* NewUsePosition(LifetimePosition pos, InstructionOperand* operand,
-                              void* hint, UsePositionHintType hint_type);
-  UsePosition* NewUsePosition(LifetimePosition pos) {
-    return NewUsePosition(pos, nullptr, nullptr, UsePositionHintType::kNone);
-  }
-  TopLevelLiveRange* LiveRangeFor(InstructionOperand* operand);
-  // Helper methods for building intervals.
-  UsePosition* Define(LifetimePosition position, InstructionOperand* operand,
-                      void* hint, UsePositionHintType hint_type);
-  void Define(LifetimePosition position, InstructionOperand* operand) {
-    Define(position, operand, nullptr, UsePositionHintType::kNone);
-  }
-  UsePosition* Use(LifetimePosition block_start, LifetimePosition position,
-                   InstructionOperand* operand, void* hint,
-                   UsePositionHintType hint_type);
-  void Use(LifetimePosition block_start, LifetimePosition position,
-           InstructionOperand* operand) {
-    Use(block_start, position, operand, nullptr, UsePositionHintType::kNone);
-  }
-
-  RegisterAllocationData* const data_;
-  ZoneMap<InstructionOperand*, UsePosition*> phi_hints_;
-
-  DISALLOW_COPY_AND_ASSIGN(LiveRangeBuilder);
-};
-
-
-class RegisterAllocator : public ZoneObject {
- public:
-  RegisterAllocator(RegisterAllocationData* data, RegisterKind kind);
-
- protected:
-  RegisterAllocationData* data() const { return data_; }
-  InstructionSequence* code() const { return data()->code(); }
-  RegisterKind mode() const { return mode_; }
-  int num_registers() const { return num_registers_; }
-  int num_allocatable_registers() const { return num_allocatable_registers_; }
-  const int* allocatable_register_codes() const {
-    return allocatable_register_codes_;
-  }
-  // Returns true iff. we must check float register aliasing.
-  bool check_fp_aliasing() const { return check_fp_aliasing_; }
-
-  // TODO(mtrofin): explain why splitting in gap START is always OK.
-  LifetimePosition GetSplitPositionForInstruction(const LiveRange* range,
-                                                  int instruction_index);
-
-  Zone* allocation_zone() const { return data()->allocation_zone(); }
-
-  // Find the optimal split for ranges defined by a memory operand, e.g.
-  // constants or function parameters passed on the stack.
-  void SplitAndSpillRangesDefinedByMemoryOperand();
-
-  // Split the given range at the given position.
-  // If range starts at or after the given position then the
-  // original range is returned.
-  // Otherwise returns the live range that starts at pos and contains
-  // all uses from the original range that follow pos. Uses at pos will
-  // still be owned by the original range after splitting.
-  LiveRange* SplitRangeAt(LiveRange* range, LifetimePosition pos);
-
-  bool CanProcessRange(LiveRange* range) const {
-    return range != nullptr && !range->IsEmpty() && range->kind() == mode();
-  }
-
-
-  // Split the given range in a position from the interval [start, end].
-  LiveRange* SplitBetween(LiveRange* range, LifetimePosition start,
-                          LifetimePosition end);
-
-  // Find a lifetime position in the interval [start, end] which
-  // is optimal for splitting: it is either header of the outermost
-  // loop covered by this interval or the latest possible position.
-  LifetimePosition FindOptimalSplitPos(LifetimePosition start,
-                                       LifetimePosition end);
-
-  void Spill(LiveRange* range);
-
-  // If we are trying to spill a range inside the loop try to
-  // hoist spill position out to the point just before the loop.
-  LifetimePosition FindOptimalSpillingPos(LiveRange* range,
-                                          LifetimePosition pos);
-
-  const ZoneVector<TopLevelLiveRange*>& GetFixedRegisters() const;
-  const char* RegisterName(int allocation_index) const;
-
- private:
-  RegisterAllocationData* const data_;
-  const RegisterKind mode_;
-  const int num_registers_;
-  int num_allocatable_registers_;
-  const int* allocatable_register_codes_;
-  bool check_fp_aliasing_;
-
- private:
-  bool no_combining_;
-
-  DISALLOW_COPY_AND_ASSIGN(RegisterAllocator);
-};
-
-
-class LinearScanAllocator final : public RegisterAllocator {
- public:
-  LinearScanAllocator(RegisterAllocationData* data, RegisterKind kind,
-                      Zone* local_zone);
-
-  // Phase 4: compute register assignments.
-  void AllocateRegisters();
-
- private:
-  ZoneVector<LiveRange*>& unhandled_live_ranges() {
-    return unhandled_live_ranges_;
-  }
-  ZoneVector<LiveRange*>& active_live_ranges() { return active_live_ranges_; }
-  ZoneVector<LiveRange*>& inactive_live_ranges() {
-    return inactive_live_ranges_;
-  }
-
-  void SetLiveRangeAssignedRegister(LiveRange* range, int reg);
-
-  // Helper methods for updating the life range lists.
-  void AddToActive(LiveRange* range);
-  void AddToInactive(LiveRange* range);
-  void AddToUnhandledSorted(LiveRange* range);
-  void AddToUnhandledUnsorted(LiveRange* range);
-  void SortUnhandled();
-  bool UnhandledIsSorted();
-  void ActiveToHandled(LiveRange* range);
-  void ActiveToInactive(LiveRange* range);
-  void InactiveToHandled(LiveRange* range);
-  void InactiveToActive(LiveRange* range);
-
-  // Helper methods for allocating registers.
-  bool TryReuseSpillForPhi(TopLevelLiveRange* range);
-  bool TryAllocateFreeReg(LiveRange* range,
-                          const Vector<LifetimePosition>& free_until_pos);
-  bool TryAllocatePreferredReg(LiveRange* range,
-                               const Vector<LifetimePosition>& free_until_pos);
-  void GetFPRegisterSet(MachineRepresentation rep, int* num_regs,
-                        int* num_codes, const int** codes) const;
-  void FindFreeRegistersForRange(LiveRange* range,
-                                 Vector<LifetimePosition> free_until_pos);
-  void ProcessCurrentRange(LiveRange* current);
-  void AllocateBlockedReg(LiveRange* range);
-  bool TrySplitAndSpillSplinter(LiveRange* range);
-
-  // Spill the given life range after position pos.
-  void SpillAfter(LiveRange* range, LifetimePosition pos);
-
-  // Spill the given life range after position [start] and up to position [end].
-  void SpillBetween(LiveRange* range, LifetimePosition start,
-                    LifetimePosition end);
-
-  // Spill the given life range after position [start] and up to position [end].
-  // Range is guaranteed to be spilled at least until position [until].
-  void SpillBetweenUntil(LiveRange* range, LifetimePosition start,
-                         LifetimePosition until, LifetimePosition end);
-
-  void SplitAndSpillIntersecting(LiveRange* range);
-
-  ZoneVector<LiveRange*> unhandled_live_ranges_;
-  ZoneVector<LiveRange*> active_live_ranges_;
-  ZoneVector<LiveRange*> inactive_live_ranges_;
-
-#ifdef DEBUG
-  LifetimePosition allocation_finger_;
-#endif
-
-  DISALLOW_COPY_AND_ASSIGN(LinearScanAllocator);
-};
-
-
-class SpillSlotLocator final : public ZoneObject {
- public:
-  explicit SpillSlotLocator(RegisterAllocationData* data);
-
-  void LocateSpillSlots();
-
- private:
-  RegisterAllocationData* data() const { return data_; }
-
-  RegisterAllocationData* const data_;
-
-  DISALLOW_COPY_AND_ASSIGN(SpillSlotLocator);
-};
-
-
-class OperandAssigner final : public ZoneObject {
- public:
-  explicit OperandAssigner(RegisterAllocationData* data);
-
-  // Phase 5: assign spill splots.
-  void AssignSpillSlots();
-
-  // Phase 6: commit assignment.
-  void CommitAssignment();
-
- private:
-  RegisterAllocationData* data() const { return data_; }
-
-  RegisterAllocationData* const data_;
-
-  DISALLOW_COPY_AND_ASSIGN(OperandAssigner);
-};
-
-
-class ReferenceMapPopulator final : public ZoneObject {
- public:
-  explicit ReferenceMapPopulator(RegisterAllocationData* data);
-
-  // Phase 7: compute values for pointer maps.
-  void PopulateReferenceMaps();
-
- private:
-  RegisterAllocationData* data() const { return data_; }
-
-  bool SafePointsAreInOrder() const;
-
-  RegisterAllocationData* const data_;
-
-  DISALLOW_COPY_AND_ASSIGN(ReferenceMapPopulator);
-};
-
-
-class LiveRangeBoundArray;
-// Insert moves of the form
-//
-//          Operand(child_(k+1)) = Operand(child_k)
-//
-// where child_k and child_(k+1) are consecutive children of a range (so
-// child_k->next() == child_(k+1)), and Operand(...) refers to the
-// assigned operand, be it a register or a slot.
-class LiveRangeConnector final : public ZoneObject {
- public:
-  explicit LiveRangeConnector(RegisterAllocationData* data);
-
-  // Phase 8: reconnect split ranges with moves, when the control flow
-  // between the ranges is trivial (no branches).
-  void ConnectRanges(Zone* local_zone);
-
-  // Phase 9: insert moves to connect ranges across basic blocks, when the
-  // control flow between them cannot be trivially resolved, such as joining
-  // branches.
-  void ResolveControlFlow(Zone* local_zone);
-
- private:
-  RegisterAllocationData* data() const { return data_; }
-  InstructionSequence* code() const { return data()->code(); }
-  Zone* code_zone() const { return code()->zone(); }
-
-  bool CanEagerlyResolveControlFlow(const InstructionBlock* block) const;
-
-  int ResolveControlFlow(const InstructionBlock* block,
-                         const InstructionOperand& cur_op,
-                         const InstructionBlock* pred,
-                         const InstructionOperand& pred_op);
-
-  void CommitSpillsInDeferredBlocks(TopLevelLiveRange* range,
-                                    LiveRangeBoundArray* array,
-                                    Zone* temp_zone);
-
-  RegisterAllocationData* const data_;
-
-  DISALLOW_COPY_AND_ASSIGN(LiveRangeConnector);
-};
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_REGISTER_ALLOCATOR_H_
diff --git a/src/v8/src/compiler/s390/code-generator-s390.cc b/src/v8/src/compiler/s390/code-generator-s390.cc
deleted file mode 100644
index c0d3146..0000000
--- a/src/v8/src/compiler/s390/code-generator-s390.cc
+++ /dev/null
@@ -1,2864 +0,0 @@
-// Copyright 2015 the V8 project 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 "src/compiler/code-generator.h"
-
-#include "src/assembler-inl.h"
-#include "src/callable.h"
-#include "src/compilation-info.h"
-#include "src/compiler/code-generator-impl.h"
-#include "src/compiler/gap-resolver.h"
-#include "src/compiler/node-matchers.h"
-#include "src/compiler/osr.h"
-#include "src/s390/macro-assembler-s390.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-#define __ tasm()->
-
-#define kScratchReg ip
-
-// Adds S390-specific methods to convert InstructionOperands.
-class S390OperandConverter final : public InstructionOperandConverter {
- public:
-  S390OperandConverter(CodeGenerator* gen, Instruction* instr)
-      : InstructionOperandConverter(gen, instr) {}
-
-  size_t OutputCount() { return instr_->OutputCount(); }
-
-  bool Is64BitOperand(int index) {
-    return LocationOperand::cast(instr_->InputAt(index))->representation() ==
-           MachineRepresentation::kWord64;
-  }
-
-  bool Is32BitOperand(int index) {
-    return LocationOperand::cast(instr_->InputAt(index))->representation() ==
-           MachineRepresentation::kWord32;
-  }
-
-  bool CompareLogical() const {
-    switch (instr_->flags_condition()) {
-      case kUnsignedLessThan:
-      case kUnsignedGreaterThanOrEqual:
-      case kUnsignedLessThanOrEqual:
-      case kUnsignedGreaterThan:
-        return true;
-      default:
-        return false;
-    }
-    UNREACHABLE();
-  }
-
-  Operand InputImmediate(size_t index) {
-    Constant constant = ToConstant(instr_->InputAt(index));
-    switch (constant.type()) {
-      case Constant::kInt32:
-        return Operand(constant.ToInt32());
-      case Constant::kFloat32:
-        return Operand::EmbeddedNumber(constant.ToFloat32());
-      case Constant::kFloat64:
-        return Operand::EmbeddedNumber(constant.ToFloat64().value());
-      case Constant::kInt64:
-#if V8_TARGET_ARCH_S390X
-        return Operand(constant.ToInt64());
-#endif
-      case Constant::kExternalReference:
-      case Constant::kHeapObject:
-      case Constant::kRpoNumber:
-        break;
-    }
-    UNREACHABLE();
-  }
-
-  MemOperand MemoryOperand(AddressingMode* mode, size_t* first_index) {
-    const size_t index = *first_index;
-    if (mode) *mode = AddressingModeField::decode(instr_->opcode());
-    switch (AddressingModeField::decode(instr_->opcode())) {
-      case kMode_None:
-        break;
-      case kMode_MR:
-        *first_index += 1;
-        return MemOperand(InputRegister(index + 0), 0);
-      case kMode_MRI:
-        *first_index += 2;
-        return MemOperand(InputRegister(index + 0), InputInt32(index + 1));
-      case kMode_MRR:
-        *first_index += 2;
-        return MemOperand(InputRegister(index + 0), InputRegister(index + 1));
-      case kMode_MRRI:
-        *first_index += 3;
-        return MemOperand(InputRegister(index + 0), InputRegister(index + 1),
-                          InputInt32(index + 2));
-    }
-    UNREACHABLE();
-  }
-
-  MemOperand MemoryOperand(AddressingMode* mode = nullptr,
-                           size_t first_index = 0) {
-    return MemoryOperand(mode, &first_index);
-  }
-
-  MemOperand ToMemOperand(InstructionOperand* op) const {
-    DCHECK_NOT_NULL(op);
-    DCHECK(op->IsStackSlot() || op->IsFPStackSlot());
-    return SlotToMemOperand(AllocatedOperand::cast(op)->index());
-  }
-
-  MemOperand SlotToMemOperand(int slot) const {
-    FrameOffset offset = frame_access_state()->GetFrameOffset(slot);
-    return MemOperand(offset.from_stack_pointer() ? sp : fp, offset.offset());
-  }
-
-  MemOperand InputStackSlot(size_t index) {
-    InstructionOperand* op = instr_->InputAt(index);
-    return SlotToMemOperand(AllocatedOperand::cast(op)->index());
-  }
-
-  MemOperand InputStackSlot32(size_t index) {
-#if V8_TARGET_ARCH_S390X && !V8_TARGET_LITTLE_ENDIAN
-    // We want to read the 32-bits directly from memory
-    MemOperand mem = InputStackSlot(index);
-    return MemOperand(mem.rb(), mem.rx(), mem.offset() + 4);
-#else
-    return InputStackSlot(index);
-#endif
-  }
-};
-
-static inline bool HasRegisterOutput(Instruction* instr, int index = 0) {
-  return instr->OutputCount() > 0 && instr->OutputAt(index)->IsRegister();
-}
-
-static inline bool HasFPRegisterInput(Instruction* instr, int index) {
-  return instr->InputAt(index)->IsFPRegister();
-}
-
-static inline bool HasRegisterInput(Instruction* instr, int index) {
-  return instr->InputAt(index)->IsRegister() ||
-         HasFPRegisterInput(instr, index);
-}
-
-static inline bool HasImmediateInput(Instruction* instr, size_t index) {
-  return instr->InputAt(index)->IsImmediate();
-}
-
-static inline bool HasFPStackSlotInput(Instruction* instr, size_t index) {
-  return instr->InputAt(index)->IsFPStackSlot();
-}
-
-static inline bool HasStackSlotInput(Instruction* instr, size_t index) {
-  return instr->InputAt(index)->IsStackSlot() ||
-         HasFPStackSlotInput(instr, index);
-}
-
-namespace {
-
-class OutOfLineRecordWrite final : public OutOfLineCode {
- public:
-  OutOfLineRecordWrite(CodeGenerator* gen, Register object, Register offset,
-                       Register value, Register scratch0, Register scratch1,
-                       RecordWriteMode mode)
-      : OutOfLineCode(gen),
-        object_(object),
-        offset_(offset),
-        offset_immediate_(0),
-        value_(value),
-        scratch0_(scratch0),
-        scratch1_(scratch1),
-        mode_(mode),
-        must_save_lr_(!gen->frame_access_state()->has_frame()),
-        zone_(gen->zone()) {}
-
-  OutOfLineRecordWrite(CodeGenerator* gen, Register object, int32_t offset,
-                       Register value, Register scratch0, Register scratch1,
-                       RecordWriteMode mode)
-      : OutOfLineCode(gen),
-        object_(object),
-        offset_(no_reg),
-        offset_immediate_(offset),
-        value_(value),
-        scratch0_(scratch0),
-        scratch1_(scratch1),
-        mode_(mode),
-        must_save_lr_(!gen->frame_access_state()->has_frame()),
-        zone_(gen->zone()) {}
-
-  void SaveRegisters(RegList registers) {
-    DCHECK_LT(0, NumRegs(registers));
-    RegList regs = 0;
-    for (int i = 0; i < Register::kNumRegisters; ++i) {
-      if ((registers >> i) & 1u) {
-        regs |= Register::from_code(i).bit();
-      }
-    }
-    __ MultiPush(regs | r14.bit());
-  }
-
-  void RestoreRegisters(RegList registers) {
-    DCHECK_LT(0, NumRegs(registers));
-    RegList regs = 0;
-    for (int i = 0; i < Register::kNumRegisters; ++i) {
-      if ((registers >> i) & 1u) {
-        regs |= Register::from_code(i).bit();
-      }
-    }
-    __ MultiPop(regs | r14.bit());
-  }
-
-  void Generate() final {
-    if (mode_ > RecordWriteMode::kValueIsPointer) {
-      __ JumpIfSmi(value_, exit());
-    }
-    __ CheckPageFlag(value_, scratch0_,
-                     MemoryChunk::kPointersToHereAreInterestingMask, eq,
-                     exit());
-    if (offset_ == no_reg) {
-      __ AddP(scratch1_, object_, Operand(offset_immediate_));
-    } else {
-      DCHECK_EQ(0, offset_immediate_);
-      __ AddP(scratch1_, object_, offset_);
-    }
-    RememberedSetAction const remembered_set_action =
-        mode_ > RecordWriteMode::kValueIsMap ? EMIT_REMEMBERED_SET
-                                             : OMIT_REMEMBERED_SET;
-    SaveFPRegsMode const save_fp_mode =
-        frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
-    if (must_save_lr_) {
-      // We need to save and restore r14 if the frame was elided.
-      __ Push(r14);
-    }
-    __ CallRecordWriteStub(object_, scratch1_, remembered_set_action,
-                           save_fp_mode);
-    if (must_save_lr_) {
-      // We need to save and restore r14 if the frame was elided.
-      __ Pop(r14);
-    }
-  }
-
- private:
-  Register const object_;
-  Register const offset_;
-  int32_t const offset_immediate_;  // Valid if offset_ == no_reg.
-  Register const value_;
-  Register const scratch0_;
-  Register const scratch1_;
-  RecordWriteMode const mode_;
-  bool must_save_lr_;
-  Zone* zone_;
-};
-
-Condition FlagsConditionToCondition(FlagsCondition condition, ArchOpcode op) {
-  switch (condition) {
-    case kEqual:
-      return eq;
-    case kNotEqual:
-      return ne;
-    case kUnsignedLessThan:
-      // unsigned number never less than 0
-      if (op == kS390_LoadAndTestWord32 || op == kS390_LoadAndTestWord64)
-        return CC_NOP;
-    // fall through
-    case kSignedLessThan:
-      return lt;
-    case kUnsignedGreaterThanOrEqual:
-      // unsigned number always greater than or equal 0
-      if (op == kS390_LoadAndTestWord32 || op == kS390_LoadAndTestWord64)
-        return CC_ALWAYS;
-    // fall through
-    case kSignedGreaterThanOrEqual:
-      return ge;
-    case kUnsignedLessThanOrEqual:
-      // unsigned number never less than 0
-      if (op == kS390_LoadAndTestWord32 || op == kS390_LoadAndTestWord64)
-        return CC_EQ;
-    // fall through
-    case kSignedLessThanOrEqual:
-      return le;
-    case kUnsignedGreaterThan:
-      // unsigned number always greater than or equal 0
-      if (op == kS390_LoadAndTestWord32 || op == kS390_LoadAndTestWord64)
-        return ne;
-    // fall through
-    case kSignedGreaterThan:
-      return gt;
-    case kOverflow:
-      // Overflow checked for AddP/SubP only.
-      switch (op) {
-        case kS390_Add32:
-        case kS390_Add64:
-        case kS390_Sub32:
-        case kS390_Sub64:
-        case kS390_Abs64:
-        case kS390_Abs32:
-        case kS390_Mul32:
-          return overflow;
-        default:
-          break;
-      }
-      break;
-    case kNotOverflow:
-      switch (op) {
-        case kS390_Add32:
-        case kS390_Add64:
-        case kS390_Sub32:
-        case kS390_Sub64:
-        case kS390_Abs64:
-        case kS390_Abs32:
-        case kS390_Mul32:
-          return nooverflow;
-        default:
-          break;
-      }
-      break;
-    default:
-      break;
-  }
-  UNREACHABLE();
-}
-
-#define GET_MEMOPERAND32(ret, fi)                                       \
-  ([&](int& ret) {                                                      \
-    AddressingMode mode = AddressingModeField::decode(instr->opcode()); \
-    MemOperand mem(r0);                                                 \
-    if (mode != kMode_None) {                                           \
-      size_t first_index = (fi);                                        \
-      mem = i.MemoryOperand(&mode, &first_index);                       \
-      ret = first_index;                                                \
-    } else {                                                            \
-      mem = i.InputStackSlot32(fi);                                     \
-    }                                                                   \
-    return mem;                                                         \
-  })(ret)
-
-#define GET_MEMOPERAND(ret, fi)                                         \
-  ([&](int& ret) {                                                      \
-    AddressingMode mode = AddressingModeField::decode(instr->opcode()); \
-    MemOperand mem(r0);                                                 \
-    if (mode != kMode_None) {                                           \
-      size_t first_index = (fi);                                        \
-      mem = i.MemoryOperand(&mode, &first_index);                       \
-      ret = first_index;                                                \
-    } else {                                                            \
-      mem = i.InputStackSlot(fi);                                       \
-    }                                                                   \
-    return mem;                                                         \
-  })(ret)
-
-#define RRInstr(instr)                                \
-  [&]() {                                             \
-    DCHECK(i.OutputRegister() == i.InputRegister(0)); \
-    __ instr(i.OutputRegister(), i.InputRegister(1)); \
-    return 2;                                         \
-  }
-#define RIInstr(instr)                                 \
-  [&]() {                                              \
-    DCHECK(i.OutputRegister() == i.InputRegister(0));  \
-    __ instr(i.OutputRegister(), i.InputImmediate(1)); \
-    return 2;                                          \
-  }
-#define RMInstr(instr, GETMEM)                        \
-  [&]() {                                             \
-    DCHECK(i.OutputRegister() == i.InputRegister(0)); \
-    int ret = 2;                                      \
-    __ instr(i.OutputRegister(), GETMEM(ret, 1));     \
-    return ret;                                       \
-  }
-#define RM32Instr(instr) RMInstr(instr, GET_MEMOPERAND32)
-#define RM64Instr(instr) RMInstr(instr, GET_MEMOPERAND)
-
-#define RRRInstr(instr)                                                   \
-  [&]() {                                                                 \
-    __ instr(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1)); \
-    return 2;                                                             \
-  }
-#define RRIInstr(instr)                                                    \
-  [&]() {                                                                  \
-    __ instr(i.OutputRegister(), i.InputRegister(0), i.InputImmediate(1)); \
-    return 2;                                                              \
-  }
-#define RRMInstr(instr, GETMEM)                                       \
-  [&]() {                                                             \
-    int ret = 2;                                                      \
-    __ instr(i.OutputRegister(), i.InputRegister(0), GETMEM(ret, 1)); \
-    return ret;                                                       \
-  }
-#define RRM32Instr(instr) RRMInstr(instr, GET_MEMOPERAND32)
-#define RRM64Instr(instr) RRMInstr(instr, GET_MEMOPERAND)
-
-#define DDInstr(instr)                                            \
-  [&]() {                                                         \
-    DCHECK(i.OutputDoubleRegister() == i.InputDoubleRegister(0)); \
-    __ instr(i.OutputDoubleRegister(), i.InputDoubleRegister(1)); \
-    return 2;                                                     \
-  }
-
-#define DMInstr(instr)                                            \
-  [&]() {                                                         \
-    DCHECK(i.OutputDoubleRegister() == i.InputDoubleRegister(0)); \
-    int ret = 2;                                                  \
-    __ instr(i.OutputDoubleRegister(), GET_MEMOPERAND(ret, 1));   \
-    return ret;                                                   \
-  }
-
-#define DMTInstr(instr)                                           \
-  [&]() {                                                         \
-    DCHECK(i.OutputDoubleRegister() == i.InputDoubleRegister(0)); \
-    int ret = 2;                                                  \
-    __ instr(i.OutputDoubleRegister(), GET_MEMOPERAND(ret, 1),    \
-             kScratchDoubleReg);                                  \
-    return ret;                                                   \
-  }
-
-#define R_MInstr(instr)                                   \
-  [&]() {                                                 \
-    int ret = 2;                                          \
-    __ instr(i.OutputRegister(), GET_MEMOPERAND(ret, 0)); \
-    return ret;                                           \
-  }
-
-#define R_DInstr(instr)                                     \
-  [&]() {                                                   \
-    __ instr(i.OutputRegister(), i.InputDoubleRegister(0)); \
-    return 2;                                               \
-  }
-
-#define D_DInstr(instr)                                           \
-  [&]() {                                                         \
-    __ instr(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); \
-    return 2;                                                     \
-  }
-
-#define D_MInstr(instr)                                         \
-  [&]() {                                                       \
-    int ret = 2;                                                \
-    __ instr(i.OutputDoubleRegister(), GET_MEMOPERAND(ret, 0)); \
-    return ret;                                                 \
-  }
-
-#define D_MTInstr(instr)                                       \
-  [&]() {                                                      \
-    int ret = 2;                                               \
-    __ instr(i.OutputDoubleRegister(), GET_MEMOPERAND(ret, 0), \
-             kScratchDoubleReg);                               \
-    return ret;                                                \
-  }
-
-static int nullInstr() {
-  UNREACHABLE();
-}
-
-template <int numOfOperand, class RType, class MType, class IType>
-static inline int AssembleOp(Instruction* instr, RType r, MType m, IType i) {
-  AddressingMode mode = AddressingModeField::decode(instr->opcode());
-  if (mode != kMode_None || HasStackSlotInput(instr, numOfOperand - 1)) {
-    return m();
-  } else if (HasRegisterInput(instr, numOfOperand - 1)) {
-    return r();
-  } else if (HasImmediateInput(instr, numOfOperand - 1)) {
-    return i();
-  } else {
-    UNREACHABLE();
-  }
-}
-
-template <class _RR, class _RM, class _RI>
-static inline int AssembleBinOp(Instruction* instr, _RR _rr, _RM _rm, _RI _ri) {
-  return AssembleOp<2>(instr, _rr, _rm, _ri);
-}
-
-template <class _R, class _M, class _I>
-static inline int AssembleUnaryOp(Instruction* instr, _R _r, _M _m, _I _i) {
-  return AssembleOp<1>(instr, _r, _m, _i);
-}
-
-#define ASSEMBLE_BIN_OP(_rr, _rm, _ri) AssembleBinOp(instr, _rr, _rm, _ri)
-#define ASSEMBLE_UNARY_OP(_r, _m, _i) AssembleUnaryOp(instr, _r, _m, _i)
-
-#ifdef V8_TARGET_ARCH_S390X
-#define CHECK_AND_ZERO_EXT_OUTPUT(num)                                \
-  ([&](int index) {                                                   \
-    DCHECK(HasImmediateInput(instr, (index)));                        \
-    int doZeroExt = i.InputInt32(index);                              \
-    if (doZeroExt) __ LoadlW(i.OutputRegister(), i.OutputRegister()); \
-  })(num)
-
-#define ASSEMBLE_BIN32_OP(_rr, _rm, _ri) \
-  { CHECK_AND_ZERO_EXT_OUTPUT(AssembleBinOp(instr, _rr, _rm, _ri)); }
-#else
-#define ASSEMBLE_BIN32_OP ASSEMBLE_BIN_OP
-#define CHECK_AND_ZERO_EXT_OUTPUT(num)
-#endif
-
-}  // namespace
-
-#define ASSEMBLE_FLOAT_UNOP(asm_instr)                                \
-  do {                                                                \
-    __ asm_instr(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); \
-  } while (0)
-
-#define ASSEMBLE_FLOAT_BINOP(asm_instr)                              \
-  do {                                                               \
-    __ asm_instr(i.OutputDoubleRegister(), i.InputDoubleRegister(0), \
-                 i.InputDoubleRegister(1));                          \
-  } while (0)
-
-#define ASSEMBLE_COMPARE(cmp_instr, cmpl_instr)                         \
-  do {                                                                  \
-    AddressingMode mode = AddressingModeField::decode(instr->opcode()); \
-    if (mode != kMode_None) {                                           \
-      size_t first_index = 1;                                           \
-      MemOperand operand = i.MemoryOperand(&mode, &first_index);        \
-      if (i.CompareLogical()) {                                         \
-        __ cmpl_instr(i.InputRegister(0), operand);                     \
-      } else {                                                          \
-        __ cmp_instr(i.InputRegister(0), operand);                      \
-      }                                                                 \
-    } else if (HasRegisterInput(instr, 1)) {                            \
-      if (i.CompareLogical()) {                                         \
-        __ cmpl_instr(i.InputRegister(0), i.InputRegister(1));          \
-      } else {                                                          \
-        __ cmp_instr(i.InputRegister(0), i.InputRegister(1));           \
-      }                                                                 \
-    } else if (HasImmediateInput(instr, 1)) {                           \
-      if (i.CompareLogical()) {                                         \
-        __ cmpl_instr(i.InputRegister(0), i.InputImmediate(1));         \
-      } else {                                                          \
-        __ cmp_instr(i.InputRegister(0), i.InputImmediate(1));          \
-      }                                                                 \
-    } else {                                                            \
-      DCHECK(HasStackSlotInput(instr, 1));                              \
-      if (i.CompareLogical()) {                                         \
-        __ cmpl_instr(i.InputRegister(0), i.InputStackSlot(1));         \
-      } else {                                                          \
-        __ cmp_instr(i.InputRegister(0), i.InputStackSlot(1));          \
-      }                                                                 \
-    }                                                                   \
-  } while (0)
-
-#define ASSEMBLE_COMPARE32(cmp_instr, cmpl_instr)                       \
-  do {                                                                  \
-    AddressingMode mode = AddressingModeField::decode(instr->opcode()); \
-    if (mode != kMode_None) {                                           \
-      size_t first_index = 1;                                           \
-      MemOperand operand = i.MemoryOperand(&mode, &first_index);        \
-      if (i.CompareLogical()) {                                         \
-        __ cmpl_instr(i.InputRegister(0), operand);                     \
-      } else {                                                          \
-        __ cmp_instr(i.InputRegister(0), operand);                      \
-      }                                                                 \
-    } else if (HasRegisterInput(instr, 1)) {                            \
-      if (i.CompareLogical()) {                                         \
-        __ cmpl_instr(i.InputRegister(0), i.InputRegister(1));          \
-      } else {                                                          \
-        __ cmp_instr(i.InputRegister(0), i.InputRegister(1));           \
-      }                                                                 \
-    } else if (HasImmediateInput(instr, 1)) {                           \
-      if (i.CompareLogical()) {                                         \
-        __ cmpl_instr(i.InputRegister(0), i.InputImmediate(1));         \
-      } else {                                                          \
-        __ cmp_instr(i.InputRegister(0), i.InputImmediate(1));          \
-      }                                                                 \
-    } else {                                                            \
-      DCHECK(HasStackSlotInput(instr, 1));                              \
-      if (i.CompareLogical()) {                                         \
-        __ cmpl_instr(i.InputRegister(0), i.InputStackSlot32(1));       \
-      } else {                                                          \
-        __ cmp_instr(i.InputRegister(0), i.InputStackSlot32(1));        \
-      }                                                                 \
-    }                                                                   \
-  } while (0)
-
-#define ASSEMBLE_FLOAT_COMPARE(cmp_rr_instr, cmp_rm_instr, load_instr)     \
-  do {                                                                     \
-    AddressingMode mode = AddressingModeField::decode(instr->opcode());    \
-    if (mode != kMode_None) {                                              \
-      size_t first_index = 1;                                              \
-      MemOperand operand = i.MemoryOperand(&mode, &first_index);           \
-      __ cmp_rm_instr(i.InputDoubleRegister(0), operand);                  \
-    } else if (HasFPRegisterInput(instr, 1)) {                             \
-      __ cmp_rr_instr(i.InputDoubleRegister(0), i.InputDoubleRegister(1)); \
-    } else {                                                               \
-      USE(HasFPStackSlotInput);                                            \
-      DCHECK(HasFPStackSlotInput(instr, 1));                               \
-      MemOperand operand = i.InputStackSlot(1);                            \
-      if (operand.offset() >= 0) {                                         \
-        __ cmp_rm_instr(i.InputDoubleRegister(0), operand);                \
-      } else {                                                             \
-        __ load_instr(kScratchDoubleReg, operand);                         \
-        __ cmp_rr_instr(i.InputDoubleRegister(0), kScratchDoubleReg);      \
-      }                                                                    \
-    }                                                                      \
-  } while (0)
-
-// Divide instruction dr will implicity use register pair
-// r0 & r1 below.
-// R0:R1 = R1 / divisor - R0 remainder
-// Copy remainder to output reg
-#define ASSEMBLE_MODULO(div_instr, shift_instr) \
-  do {                                          \
-    __ LoadRR(r0, i.InputRegister(0));          \
-    __ shift_instr(r0, Operand(32));            \
-    __ div_instr(r0, i.InputRegister(1));       \
-    __ LoadlW(i.OutputRegister(), r0);          \
-  } while (0)
-
-#define ASSEMBLE_FLOAT_MODULO()                                            \
-  do {                                                                     \
-    FrameScope scope(tasm(), StackFrame::MANUAL);                          \
-    __ PrepareCallCFunction(0, 2, kScratchReg);                            \
-    __ MovToFloatParameters(i.InputDoubleRegister(0),                      \
-                            i.InputDoubleRegister(1));                     \
-    __ CallCFunction(                                                      \
-        ExternalReference::mod_two_doubles_operation(__ isolate()), 0, 2); \
-    __ MovFromFloatResult(i.OutputDoubleRegister());                       \
-  } while (0)
-
-#define ASSEMBLE_IEEE754_UNOP(name)                                            \
-  do {                                                                         \
-    /* TODO(bmeurer): We should really get rid of this special instruction, */ \
-    /* and generate a CallAddress instruction instead. */                      \
-    FrameScope scope(tasm(), StackFrame::MANUAL);                              \
-    __ PrepareCallCFunction(0, 1, kScratchReg);                                \
-    __ MovToFloatParameter(i.InputDoubleRegister(0));                          \
-    __ CallCFunction(                                                          \
-        ExternalReference::ieee754_##name##_function(__ isolate()), 0, 1);     \
-    /* Move the result in the double result register. */                       \
-    __ MovFromFloatResult(i.OutputDoubleRegister());                           \
-  } while (0)
-
-#define ASSEMBLE_IEEE754_BINOP(name)                                           \
-  do {                                                                         \
-    /* TODO(bmeurer): We should really get rid of this special instruction, */ \
-    /* and generate a CallAddress instruction instead. */                      \
-    FrameScope scope(tasm(), StackFrame::MANUAL);                              \
-    __ PrepareCallCFunction(0, 2, kScratchReg);                                \
-    __ MovToFloatParameters(i.InputDoubleRegister(0),                          \
-                            i.InputDoubleRegister(1));                         \
-    __ CallCFunction(                                                          \
-        ExternalReference::ieee754_##name##_function(__ isolate()), 0, 2);     \
-    /* Move the result in the double result register. */                       \
-    __ MovFromFloatResult(i.OutputDoubleRegister());                           \
-  } while (0)
-
-#define ASSEMBLE_DOUBLE_MAX()                                          \
-  do {                                                                 \
-    DoubleRegister left_reg = i.InputDoubleRegister(0);                \
-    DoubleRegister right_reg = i.InputDoubleRegister(1);               \
-    DoubleRegister result_reg = i.OutputDoubleRegister();              \
-    Label check_nan_left, check_zero, return_left, return_right, done; \
-    __ cdbr(left_reg, right_reg);                                      \
-    __ bunordered(&check_nan_left, Label::kNear);                      \
-    __ beq(&check_zero);                                               \
-    __ bge(&return_left, Label::kNear);                                \
-    __ b(&return_right, Label::kNear);                                 \
-                                                                       \
-    __ bind(&check_zero);                                              \
-    __ lzdr(kDoubleRegZero);                                           \
-    __ cdbr(left_reg, kDoubleRegZero);                                 \
-    /* left == right != 0. */                                          \
-    __ bne(&return_left, Label::kNear);                                \
-    /* At this point, both left and right are either 0 or -0. */       \
-    /* N.B. The following works because +0 + -0 == +0 */               \
-    /* For max we want logical-and of sign bit: (L + R) */             \
-    __ ldr(result_reg, left_reg);                                      \
-    __ adbr(result_reg, right_reg);                                    \
-    __ b(&done, Label::kNear);                                         \
-                                                                       \
-    __ bind(&check_nan_left);                                          \
-    __ cdbr(left_reg, left_reg);                                       \
-    /* left == NaN. */                                                 \
-    __ bunordered(&return_left, Label::kNear);                         \
-                                                                       \
-    __ bind(&return_right);                                            \
-    if (right_reg != result_reg) {                                     \
-      __ ldr(result_reg, right_reg);                                   \
-    }                                                                  \
-    __ b(&done, Label::kNear);                                         \
-                                                                       \
-    __ bind(&return_left);                                             \
-    if (left_reg != result_reg) {                                      \
-      __ ldr(result_reg, left_reg);                                    \
-    }                                                                  \
-    __ bind(&done);                                                    \
-  } while (0)
-
-#define ASSEMBLE_DOUBLE_MIN()                                          \
-  do {                                                                 \
-    DoubleRegister left_reg = i.InputDoubleRegister(0);                \
-    DoubleRegister right_reg = i.InputDoubleRegister(1);               \
-    DoubleRegister result_reg = i.OutputDoubleRegister();              \
-    Label check_nan_left, check_zero, return_left, return_right, done; \
-    __ cdbr(left_reg, right_reg);                                      \
-    __ bunordered(&check_nan_left, Label::kNear);                      \
-    __ beq(&check_zero);                                               \
-    __ ble(&return_left, Label::kNear);                                \
-    __ b(&return_right, Label::kNear);                                 \
-                                                                       \
-    __ bind(&check_zero);                                              \
-    __ lzdr(kDoubleRegZero);                                           \
-    __ cdbr(left_reg, kDoubleRegZero);                                 \
-    /* left == right != 0. */                                          \
-    __ bne(&return_left, Label::kNear);                                \
-    /* At this point, both left and right are either 0 or -0. */       \
-    /* N.B. The following works because +0 + -0 == +0 */               \
-    /* For min we want logical-or of sign bit: -(-L + -R) */           \
-    __ lcdbr(left_reg, left_reg);                                      \
-    __ ldr(result_reg, left_reg);                                      \
-    if (left_reg == right_reg) {                                       \
-      __ adbr(result_reg, right_reg);                                  \
-    } else {                                                           \
-      __ sdbr(result_reg, right_reg);                                  \
-    }                                                                  \
-    __ lcdbr(result_reg, result_reg);                                  \
-    __ b(&done, Label::kNear);                                         \
-                                                                       \
-    __ bind(&check_nan_left);                                          \
-    __ cdbr(left_reg, left_reg);                                       \
-    /* left == NaN. */                                                 \
-    __ bunordered(&return_left, Label::kNear);                         \
-                                                                       \
-    __ bind(&return_right);                                            \
-    if (right_reg != result_reg) {                                     \
-      __ ldr(result_reg, right_reg);                                   \
-    }                                                                  \
-    __ b(&done, Label::kNear);                                         \
-                                                                       \
-    __ bind(&return_left);                                             \
-    if (left_reg != result_reg) {                                      \
-      __ ldr(result_reg, left_reg);                                    \
-    }                                                                  \
-    __ bind(&done);                                                    \
-  } while (0)
-
-#define ASSEMBLE_FLOAT_MAX()                                           \
-  do {                                                                 \
-    DoubleRegister left_reg = i.InputDoubleRegister(0);                \
-    DoubleRegister right_reg = i.InputDoubleRegister(1);               \
-    DoubleRegister result_reg = i.OutputDoubleRegister();              \
-    Label check_nan_left, check_zero, return_left, return_right, done; \
-    __ cebr(left_reg, right_reg);                                      \
-    __ bunordered(&check_nan_left, Label::kNear);                      \
-    __ beq(&check_zero);                                               \
-    __ bge(&return_left, Label::kNear);                                \
-    __ b(&return_right, Label::kNear);                                 \
-                                                                       \
-    __ bind(&check_zero);                                              \
-    __ lzdr(kDoubleRegZero);                                           \
-    __ cebr(left_reg, kDoubleRegZero);                                 \
-    /* left == right != 0. */                                          \
-    __ bne(&return_left, Label::kNear);                                \
-    /* At this point, both left and right are either 0 or -0. */       \
-    /* N.B. The following works because +0 + -0 == +0 */               \
-    /* For max we want logical-and of sign bit: (L + R) */             \
-    __ ldr(result_reg, left_reg);                                      \
-    __ aebr(result_reg, right_reg);                                    \
-    __ b(&done, Label::kNear);                                         \
-                                                                       \
-    __ bind(&check_nan_left);                                          \
-    __ cebr(left_reg, left_reg);                                       \
-    /* left == NaN. */                                                 \
-    __ bunordered(&return_left, Label::kNear);                         \
-                                                                       \
-    __ bind(&return_right);                                            \
-    if (right_reg != result_reg) {                                     \
-      __ ldr(result_reg, right_reg);                                   \
-    }                                                                  \
-    __ b(&done, Label::kNear);                                         \
-                                                                       \
-    __ bind(&return_left);                                             \
-    if (left_reg != result_reg) {                                      \
-      __ ldr(result_reg, left_reg);                                    \
-    }                                                                  \
-    __ bind(&done);                                                    \
-  } while (0)
-
-#define ASSEMBLE_FLOAT_MIN()                                           \
-  do {                                                                 \
-    DoubleRegister left_reg = i.InputDoubleRegister(0);                \
-    DoubleRegister right_reg = i.InputDoubleRegister(1);               \
-    DoubleRegister result_reg = i.OutputDoubleRegister();              \
-    Label check_nan_left, check_zero, return_left, return_right, done; \
-    __ cebr(left_reg, right_reg);                                      \
-    __ bunordered(&check_nan_left, Label::kNear);                      \
-    __ beq(&check_zero);                                               \
-    __ ble(&return_left, Label::kNear);                                \
-    __ b(&return_right, Label::kNear);                                 \
-                                                                       \
-    __ bind(&check_zero);                                              \
-    __ lzdr(kDoubleRegZero);                                           \
-    __ cebr(left_reg, kDoubleRegZero);                                 \
-    /* left == right != 0. */                                          \
-    __ bne(&return_left, Label::kNear);                                \
-    /* At this point, both left and right are either 0 or -0. */       \
-    /* N.B. The following works because +0 + -0 == +0 */               \
-    /* For min we want logical-or of sign bit: -(-L + -R) */           \
-    __ lcebr(left_reg, left_reg);                                      \
-    __ ldr(result_reg, left_reg);                                      \
-    if (left_reg == right_reg) {                                       \
-      __ aebr(result_reg, right_reg);                                  \
-    } else {                                                           \
-      __ sebr(result_reg, right_reg);                                  \
-    }                                                                  \
-    __ lcebr(result_reg, result_reg);                                  \
-    __ b(&done, Label::kNear);                                         \
-                                                                       \
-    __ bind(&check_nan_left);                                          \
-    __ cebr(left_reg, left_reg);                                       \
-    /* left == NaN. */                                                 \
-    __ bunordered(&return_left, Label::kNear);                         \
-                                                                       \
-    __ bind(&return_right);                                            \
-    if (right_reg != result_reg) {                                     \
-      __ ldr(result_reg, right_reg);                                   \
-    }                                                                  \
-    __ b(&done, Label::kNear);                                         \
-                                                                       \
-    __ bind(&return_left);                                             \
-    if (left_reg != result_reg) {                                      \
-      __ ldr(result_reg, left_reg);                                    \
-    }                                                                  \
-    __ bind(&done);                                                    \
-  } while (0)
-//
-// Only MRI mode for these instructions available
-#define ASSEMBLE_LOAD_FLOAT(asm_instr)                \
-  do {                                                \
-    DoubleRegister result = i.OutputDoubleRegister(); \
-    AddressingMode mode = kMode_None;                 \
-    MemOperand operand = i.MemoryOperand(&mode);      \
-    __ asm_instr(result, operand);                    \
-  } while (0)
-
-#define ASSEMBLE_LOAD_INTEGER(asm_instr)         \
-  do {                                           \
-    Register result = i.OutputRegister();        \
-    AddressingMode mode = kMode_None;            \
-    MemOperand operand = i.MemoryOperand(&mode); \
-    __ asm_instr(result, operand);               \
-  } while (0)
-
-#define ASSEMBLE_LOADANDTEST64(asm_instr_rr, asm_instr_rm)              \
-  {                                                                     \
-    AddressingMode mode = AddressingModeField::decode(instr->opcode()); \
-    Register dst = HasRegisterOutput(instr) ? i.OutputRegister() : r0;  \
-    if (mode != kMode_None) {                                           \
-      size_t first_index = 0;                                           \
-      MemOperand operand = i.MemoryOperand(&mode, &first_index);        \
-      __ asm_instr_rm(dst, operand);                                    \
-    } else if (HasRegisterInput(instr, 0)) {                            \
-      __ asm_instr_rr(dst, i.InputRegister(0));                         \
-    } else {                                                            \
-      DCHECK(HasStackSlotInput(instr, 0));                              \
-      __ asm_instr_rm(dst, i.InputStackSlot(0));                        \
-    }                                                                   \
-  }
-
-#define ASSEMBLE_LOADANDTEST32(asm_instr_rr, asm_instr_rm)              \
-  {                                                                     \
-    AddressingMode mode = AddressingModeField::decode(instr->opcode()); \
-    Register dst = HasRegisterOutput(instr) ? i.OutputRegister() : r0;  \
-    if (mode != kMode_None) {                                           \
-      size_t first_index = 0;                                           \
-      MemOperand operand = i.MemoryOperand(&mode, &first_index);        \
-      __ asm_instr_rm(dst, operand);                                    \
-    } else if (HasRegisterInput(instr, 0)) {                            \
-      __ asm_instr_rr(dst, i.InputRegister(0));                         \
-    } else {                                                            \
-      DCHECK(HasStackSlotInput(instr, 0));                              \
-      __ asm_instr_rm(dst, i.InputStackSlot32(0));                      \
-    }                                                                   \
-  }
-
-#define ASSEMBLE_STORE_FLOAT32()                         \
-  do {                                                   \
-    size_t index = 0;                                    \
-    AddressingMode mode = kMode_None;                    \
-    MemOperand operand = i.MemoryOperand(&mode, &index); \
-    DoubleRegister value = i.InputDoubleRegister(index); \
-    __ StoreFloat32(value, operand);                     \
-  } while (0)
-
-#define ASSEMBLE_STORE_DOUBLE()                          \
-  do {                                                   \
-    size_t index = 0;                                    \
-    AddressingMode mode = kMode_None;                    \
-    MemOperand operand = i.MemoryOperand(&mode, &index); \
-    DoubleRegister value = i.InputDoubleRegister(index); \
-    __ StoreDouble(value, operand);                      \
-  } while (0)
-
-#define ASSEMBLE_STORE_INTEGER(asm_instr)                \
-  do {                                                   \
-    size_t index = 0;                                    \
-    AddressingMode mode = kMode_None;                    \
-    MemOperand operand = i.MemoryOperand(&mode, &index); \
-    Register value = i.InputRegister(index);             \
-    __ asm_instr(value, operand);                        \
-  } while (0)
-
-void CodeGenerator::AssembleDeconstructFrame() {
-  __ LeaveFrame(StackFrame::MANUAL);
-}
-
-void CodeGenerator::AssemblePrepareTailCall() {
-  if (frame_access_state()->has_frame()) {
-    __ RestoreFrameStateForTailCall();
-  }
-  frame_access_state()->SetFrameAccessToSP();
-}
-
-void CodeGenerator::AssemblePopArgumentsAdaptorFrame(Register args_reg,
-                                                     Register scratch1,
-                                                     Register scratch2,
-                                                     Register scratch3) {
-  DCHECK(!AreAliased(args_reg, scratch1, scratch2, scratch3));
-  Label done;
-
-  // Check if current frame is an arguments adaptor frame.
-  __ LoadP(scratch1, MemOperand(fp, StandardFrameConstants::kContextOffset));
-  __ CmpP(scratch1,
-          Operand(StackFrame::TypeToMarker(StackFrame::ARGUMENTS_ADAPTOR)));
-  __ bne(&done);
-
-  // Load arguments count from current arguments adaptor frame (note, it
-  // does not include receiver).
-  Register caller_args_count_reg = scratch1;
-  __ LoadP(caller_args_count_reg,
-           MemOperand(fp, ArgumentsAdaptorFrameConstants::kLengthOffset));
-  __ SmiUntag(caller_args_count_reg);
-
-  ParameterCount callee_args_count(args_reg);
-  __ PrepareForTailCall(callee_args_count, caller_args_count_reg, scratch2,
-                        scratch3);
-  __ bind(&done);
-}
-
-namespace {
-
-void FlushPendingPushRegisters(TurboAssembler* tasm,
-                               FrameAccessState* frame_access_state,
-                               ZoneVector<Register>* pending_pushes) {
-  switch (pending_pushes->size()) {
-    case 0:
-      break;
-    case 1:
-      tasm->Push((*pending_pushes)[0]);
-      break;
-    case 2:
-      tasm->Push((*pending_pushes)[0], (*pending_pushes)[1]);
-      break;
-    case 3:
-      tasm->Push((*pending_pushes)[0], (*pending_pushes)[1],
-                 (*pending_pushes)[2]);
-      break;
-    default:
-      UNREACHABLE();
-      break;
-  }
-  frame_access_state->IncreaseSPDelta(pending_pushes->size());
-  pending_pushes->clear();
-}
-
-void AdjustStackPointerForTailCall(
-    TurboAssembler* tasm, FrameAccessState* state, int new_slot_above_sp,
-    ZoneVector<Register>* pending_pushes = nullptr,
-    bool allow_shrinkage = true) {
-  int current_sp_offset = state->GetSPToFPSlotCount() +
-                          StandardFrameConstants::kFixedSlotCountAboveFp;
-  int stack_slot_delta = new_slot_above_sp - current_sp_offset;
-  if (stack_slot_delta > 0) {
-    if (pending_pushes != nullptr) {
-      FlushPendingPushRegisters(tasm, state, pending_pushes);
-    }
-    tasm->AddP(sp, sp, Operand(-stack_slot_delta * kPointerSize));
-    state->IncreaseSPDelta(stack_slot_delta);
-  } else if (allow_shrinkage && stack_slot_delta < 0) {
-    if (pending_pushes != nullptr) {
-      FlushPendingPushRegisters(tasm, state, pending_pushes);
-    }
-    tasm->AddP(sp, sp, Operand(-stack_slot_delta * kPointerSize));
-    state->IncreaseSPDelta(stack_slot_delta);
-  }
-}
-
-}  // namespace
-
-void CodeGenerator::AssembleTailCallBeforeGap(Instruction* instr,
-                                              int first_unused_stack_slot) {
-  ZoneVector<MoveOperands*> pushes(zone());
-  GetPushCompatibleMoves(instr, kRegisterPush, &pushes);
-
-  if (!pushes.empty() &&
-      (LocationOperand::cast(pushes.back()->destination()).index() + 1 ==
-       first_unused_stack_slot)) {
-    S390OperandConverter g(this, instr);
-    ZoneVector<Register> pending_pushes(zone());
-    for (auto move : pushes) {
-      LocationOperand destination_location(
-          LocationOperand::cast(move->destination()));
-      InstructionOperand source(move->source());
-      AdjustStackPointerForTailCall(
-          tasm(), frame_access_state(),
-          destination_location.index() - pending_pushes.size(),
-          &pending_pushes);
-      // Pushes of non-register data types are not supported.
-      DCHECK(source.IsRegister());
-      LocationOperand source_location(LocationOperand::cast(source));
-      pending_pushes.push_back(source_location.GetRegister());
-      // TODO(arm): We can push more than 3 registers at once. Add support in
-      // the macro-assembler for pushing a list of registers.
-      if (pending_pushes.size() == 3) {
-        FlushPendingPushRegisters(tasm(), frame_access_state(),
-                                  &pending_pushes);
-      }
-      move->Eliminate();
-    }
-    FlushPendingPushRegisters(tasm(), frame_access_state(), &pending_pushes);
-  }
-  AdjustStackPointerForTailCall(tasm(), frame_access_state(),
-                                first_unused_stack_slot, nullptr, false);
-}
-
-void CodeGenerator::AssembleTailCallAfterGap(Instruction* instr,
-                                             int first_unused_stack_slot) {
-  AdjustStackPointerForTailCall(tasm(), frame_access_state(),
-                                first_unused_stack_slot);
-}
-
-// Check if the code object is marked for deoptimization. If it is, then it
-// jumps to the CompileLazyDeoptimizedCode builtin. In order to do this we need
-// to:
-//    1. load the address of the current instruction;
-//    2. read from memory the word that contains that bit, which can be found in
-//       the flags in the referenced {CodeDataContainer} object;
-//    3. test kMarkedForDeoptimizationBit in those flags; and
-//    4. if it is not zero then it jumps to the builtin.
-void CodeGenerator::BailoutIfDeoptimized() {
-  Label current;
-  __ larl(r1, &current);
-  int pc_offset = __ pc_offset();
-  __ bind(&current);
-  int offset = Code::kCodeDataContainerOffset - (Code::kHeaderSize + pc_offset);
-  __ LoadP(ip, MemOperand(r1, offset));
-  __ LoadW(ip,
-           FieldMemOperand(ip, CodeDataContainer::kKindSpecificFlagsOffset));
-  __ TestBit(ip, Code::kMarkedForDeoptimizationBit);
-  Handle<Code> code = isolate()->builtins()->builtin_handle(
-      Builtins::kCompileLazyDeoptimizedCode);
-  __ Jump(code, RelocInfo::CODE_TARGET, ne);
-}
-
-// Assembles an instruction after register allocation, producing machine code.
-CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
-    Instruction* instr) {
-  S390OperandConverter i(this, instr);
-  ArchOpcode opcode = ArchOpcodeField::decode(instr->opcode());
-
-  switch (opcode) {
-    case kArchComment: {
-      Address comment_string = i.InputExternalReference(0).address();
-      __ RecordComment(reinterpret_cast<const char*>(comment_string));
-      break;
-    }
-    case kArchCallCodeObject: {
-      if (HasRegisterInput(instr, 0)) {
-        __ AddP(ip, i.InputRegister(0),
-                Operand(Code::kHeaderSize - kHeapObjectTag));
-        __ Call(ip);
-      } else {
-        __ Call(i.InputCode(0), RelocInfo::CODE_TARGET);
-      }
-      RecordCallPosition(instr);
-      frame_access_state()->ClearSPDelta();
-      break;
-    }
-    case kArchCallWasmFunction: {
-      // We must not share code targets for calls to builtins for wasm code, as
-      // they might need to be patched individually.
-      RelocInfo::Mode rmode = RelocInfo::JS_TO_WASM_CALL;
-      if (info()->IsWasm()) {
-        rmode = RelocInfo::WASM_CALL;
-      }
-
-      if (instr->InputAt(0)->IsImmediate()) {
-#ifdef V8_TARGET_ARCH_S390X
-        Address wasm_code = reinterpret_cast<Address>(
-            i.ToConstant(instr->InputAt(0)).ToInt64());
-#else
-        Address wasm_code = reinterpret_cast<Address>(
-            i.ToConstant(instr->InputAt(0)).ToInt32());
-#endif
-        __ Call(wasm_code, rmode);
-      } else {
-        __ Call(i.InputRegister(0));
-      }
-      RecordCallPosition(instr);
-      frame_access_state()->ClearSPDelta();
-      break;
-    }
-    case kArchTailCallCodeObjectFromJSFunction:
-    case kArchTailCallCodeObject: {
-      if (opcode == kArchTailCallCodeObjectFromJSFunction) {
-        AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister,
-                                         i.TempRegister(0), i.TempRegister(1),
-                                         i.TempRegister(2));
-      }
-      if (HasRegisterInput(instr, 0)) {
-        __ AddP(ip, i.InputRegister(0),
-                Operand(Code::kHeaderSize - kHeapObjectTag));
-        __ Jump(ip);
-      } else {
-        // We cannot use the constant pool to load the target since
-        // we've already restored the caller's frame.
-        ConstantPoolUnavailableScope constant_pool_unavailable(tasm());
-        __ Jump(i.InputCode(0), RelocInfo::CODE_TARGET);
-      }
-      frame_access_state()->ClearSPDelta();
-      frame_access_state()->SetFrameAccessToDefault();
-      break;
-    }
-    case kArchTailCallWasm: {
-      // We must not share code targets for calls to builtins for wasm code, as
-      // they might need to be patched individually.
-      RelocInfo::Mode rmode = RelocInfo::JS_TO_WASM_CALL;
-      if (info()->IsWasm()) {
-        rmode = RelocInfo::WASM_CALL;
-      }
-
-      if (instr->InputAt(0)->IsImmediate()) {
-        Address wasm_code = reinterpret_cast<Address>(
-            i.ToConstant(instr->InputAt(0)).ToInt32());
-        __ Jump(wasm_code, rmode);
-      } else {
-        __ Jump(i.InputRegister(0));
-      }
-      frame_access_state()->ClearSPDelta();
-      frame_access_state()->SetFrameAccessToDefault();
-      break;
-    }
-    case kArchTailCallAddress: {
-      CHECK(!instr->InputAt(0)->IsImmediate());
-      __ Jump(i.InputRegister(0));
-      frame_access_state()->ClearSPDelta();
-      frame_access_state()->SetFrameAccessToDefault();
-      break;
-    }
-    case kArchCallJSFunction: {
-      Register func = i.InputRegister(0);
-      if (FLAG_debug_code) {
-        // Check the function's context matches the context argument.
-        __ LoadP(kScratchReg,
-                 FieldMemOperand(func, JSFunction::kContextOffset));
-        __ CmpP(cp, kScratchReg);
-        __ Assert(eq, AbortReason::kWrongFunctionContext);
-      }
-      __ LoadP(ip, FieldMemOperand(func, JSFunction::kCodeOffset));
-      __ AddP(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag));
-      __ Call(ip);
-      RecordCallPosition(instr);
-      frame_access_state()->ClearSPDelta();
-      break;
-    }
-    case kArchPrepareCallCFunction: {
-      int const num_parameters = MiscField::decode(instr->opcode());
-      __ PrepareCallCFunction(num_parameters, kScratchReg);
-      // Frame alignment requires using FP-relative frame addressing.
-      frame_access_state()->SetFrameAccessToFP();
-      break;
-    }
-    case kArchSaveCallerRegisters: {
-      fp_mode_ =
-          static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode()));
-      DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
-      // kReturnRegister0 should have been saved before entering the stub.
-      int bytes = __ PushCallerSaved(fp_mode_, kReturnRegister0);
-      DCHECK_EQ(0, bytes % kPointerSize);
-      DCHECK_EQ(0, frame_access_state()->sp_delta());
-      frame_access_state()->IncreaseSPDelta(bytes / kPointerSize);
-      DCHECK(!caller_registers_saved_);
-      caller_registers_saved_ = true;
-      break;
-    }
-    case kArchRestoreCallerRegisters: {
-      DCHECK(fp_mode_ ==
-             static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode())));
-      DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
-      // Don't overwrite the returned value.
-      int bytes = __ PopCallerSaved(fp_mode_, kReturnRegister0);
-      frame_access_state()->IncreaseSPDelta(-(bytes / kPointerSize));
-      DCHECK_EQ(0, frame_access_state()->sp_delta());
-      DCHECK(caller_registers_saved_);
-      caller_registers_saved_ = false;
-      break;
-    }
-    case kArchPrepareTailCall:
-      AssemblePrepareTailCall();
-      break;
-    case kArchCallCFunction: {
-      int const num_parameters = MiscField::decode(instr->opcode());
-      if (instr->InputAt(0)->IsImmediate()) {
-        ExternalReference ref = i.InputExternalReference(0);
-        __ CallCFunction(ref, num_parameters);
-      } else {
-        Register func = i.InputRegister(0);
-        __ CallCFunction(func, num_parameters);
-      }
-      frame_access_state()->SetFrameAccessToDefault();
-      // Ideally, we should decrement SP delta to match the change of stack
-      // pointer in CallCFunction. However, for certain architectures (e.g.
-      // ARM), there may be more strict alignment requirement, causing old SP
-      // to be saved on the stack. In those cases, we can not calculate the SP
-      // delta statically.
-      frame_access_state()->ClearSPDelta();
-      if (caller_registers_saved_) {
-        // Need to re-sync SP delta introduced in kArchSaveCallerRegisters.
-        // Here, we assume the sequence to be:
-        //   kArchSaveCallerRegisters;
-        //   kArchCallCFunction;
-        //   kArchRestoreCallerRegisters;
-        int bytes =
-            __ RequiredStackSizeForCallerSaved(fp_mode_, kReturnRegister0);
-        frame_access_state()->IncreaseSPDelta(bytes / kPointerSize);
-      }
-      break;
-    }
-    case kArchJmp:
-      AssembleArchJump(i.InputRpo(0));
-      break;
-    case kArchLookupSwitch:
-      AssembleArchLookupSwitch(instr);
-      break;
-    case kArchTableSwitch:
-      AssembleArchTableSwitch(instr);
-      break;
-    case kArchDebugAbort:
-      DCHECK(i.InputRegister(0) == r3);
-      if (!frame_access_state()->has_frame()) {
-        // We don't actually want to generate a pile of code for this, so just
-        // claim there is a stack frame, without generating one.
-        FrameScope scope(tasm(), StackFrame::NONE);
-        __ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
-                RelocInfo::CODE_TARGET);
-      } else {
-        __ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
-                RelocInfo::CODE_TARGET);
-      }
-      __ stop("kArchDebugAbort");
-      break;
-    case kArchDebugBreak:
-      __ stop("kArchDebugBreak");
-      break;
-    case kArchNop:
-    case kArchThrowTerminator:
-      // don't emit code for nops.
-      break;
-    case kArchDeoptimize: {
-      int deopt_state_id =
-          BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore());
-      CodeGenResult result =
-          AssembleDeoptimizerCall(deopt_state_id, current_source_position_);
-      if (result != kSuccess) return result;
-      break;
-    }
-    case kArchRet:
-      AssembleReturn(instr->InputAt(0));
-      break;
-    case kArchStackPointer:
-      __ LoadRR(i.OutputRegister(), sp);
-      break;
-    case kArchFramePointer:
-      __ LoadRR(i.OutputRegister(), fp);
-      break;
-    case kArchParentFramePointer:
-      if (frame_access_state()->has_frame()) {
-        __ LoadP(i.OutputRegister(), MemOperand(fp, 0));
-      } else {
-        __ LoadRR(i.OutputRegister(), fp);
-      }
-      break;
-    case kArchTruncateDoubleToI:
-      // TODO(mbrandy): move slow call to stub out of line.
-      __ TruncateDoubleToIDelayed(zone(), i.OutputRegister(),
-                                  i.InputDoubleRegister(0));
-      break;
-    case kArchStoreWithWriteBarrier: {
-      RecordWriteMode mode =
-          static_cast<RecordWriteMode>(MiscField::decode(instr->opcode()));
-      Register object = i.InputRegister(0);
-      Register value = i.InputRegister(2);
-      Register scratch0 = i.TempRegister(0);
-      Register scratch1 = i.TempRegister(1);
-      OutOfLineRecordWrite* ool;
-
-      AddressingMode addressing_mode =
-          AddressingModeField::decode(instr->opcode());
-      if (addressing_mode == kMode_MRI) {
-        int32_t offset = i.InputInt32(1);
-        ool = new (zone()) OutOfLineRecordWrite(this, object, offset, value,
-                                                scratch0, scratch1, mode);
-        __ StoreP(value, MemOperand(object, offset));
-      } else {
-        DCHECK_EQ(kMode_MRR, addressing_mode);
-        Register offset(i.InputRegister(1));
-        ool = new (zone()) OutOfLineRecordWrite(this, object, offset, value,
-                                                scratch0, scratch1, mode);
-        __ StoreP(value, MemOperand(object, offset));
-      }
-      __ CheckPageFlag(object, scratch0,
-                       MemoryChunk::kPointersFromHereAreInterestingMask, ne,
-                       ool->entry());
-      __ bind(ool->exit());
-      break;
-    }
-    case kArchStackSlot: {
-      FrameOffset offset =
-          frame_access_state()->GetFrameOffset(i.InputInt32(0));
-      __ AddP(i.OutputRegister(), offset.from_stack_pointer() ? sp : fp,
-              Operand(offset.offset()));
-      break;
-    }
-    case kS390_Abs32:
-      // TODO(john.yan): zero-ext
-      __ lpr(i.OutputRegister(0), i.InputRegister(0));
-      break;
-    case kS390_Abs64:
-      __ lpgr(i.OutputRegister(0), i.InputRegister(0));
-      break;
-    case kS390_And32:
-      // zero-ext
-      if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-        ASSEMBLE_BIN32_OP(RRRInstr(nrk), RM32Instr(And), RIInstr(nilf));
-      } else {
-        ASSEMBLE_BIN32_OP(RRInstr(nr), RM32Instr(And), RIInstr(nilf));
-      }
-      break;
-    case kS390_And64:
-      if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-        ASSEMBLE_BIN_OP(RRRInstr(ngrk), RM64Instr(ng), nullInstr);
-      } else {
-        ASSEMBLE_BIN_OP(RRInstr(ngr), RM64Instr(ng), nullInstr);
-      }
-      break;
-    case kS390_Or32:
-      // zero-ext
-      if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-        ASSEMBLE_BIN32_OP(RRRInstr(ork), RM32Instr(Or), RIInstr(oilf));
-      } else {
-        ASSEMBLE_BIN32_OP(RRInstr(or_z), RM32Instr(Or), RIInstr(oilf));
-      }
-      break;
-    case kS390_Or64:
-      if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-        ASSEMBLE_BIN_OP(RRRInstr(ogrk), RM64Instr(og), nullInstr);
-      } else {
-        ASSEMBLE_BIN_OP(RRInstr(ogr), RM64Instr(og), nullInstr);
-      }
-      break;
-    case kS390_Xor32:
-      // zero-ext
-      if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-        ASSEMBLE_BIN32_OP(RRRInstr(xrk), RM32Instr(Xor), RIInstr(xilf));
-      } else {
-        ASSEMBLE_BIN32_OP(RRInstr(xr), RM32Instr(Xor), RIInstr(xilf));
-      }
-      break;
-    case kS390_Xor64:
-      if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-        ASSEMBLE_BIN_OP(RRRInstr(xgrk), RM64Instr(xg), nullInstr);
-      } else {
-        ASSEMBLE_BIN_OP(RRInstr(xgr), RM64Instr(xg), nullInstr);
-      }
-      break;
-    case kS390_ShiftLeft32:
-      // zero-ext
-      if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-        ASSEMBLE_BIN32_OP(RRRInstr(ShiftLeft), nullInstr, RRIInstr(ShiftLeft));
-      } else {
-        ASSEMBLE_BIN32_OP(RRInstr(sll), nullInstr, RIInstr(sll));
-      }
-      break;
-    case kS390_ShiftLeft64:
-      ASSEMBLE_BIN_OP(RRRInstr(sllg), nullInstr, RRIInstr(sllg));
-      break;
-    case kS390_ShiftRight32:
-      // zero-ext
-      if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-        ASSEMBLE_BIN32_OP(RRRInstr(srlk), nullInstr, RRIInstr(srlk));
-      } else {
-        ASSEMBLE_BIN32_OP(RRInstr(srl), nullInstr, RIInstr(srl));
-      }
-      break;
-    case kS390_ShiftRight64:
-      ASSEMBLE_BIN_OP(RRRInstr(srlg), nullInstr, RRIInstr(srlg));
-      break;
-    case kS390_ShiftRightArith32:
-      // zero-ext
-      if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-        ASSEMBLE_BIN32_OP(RRRInstr(srak), nullInstr, RRIInstr(srak));
-      } else {
-        ASSEMBLE_BIN32_OP(RRInstr(sra), nullInstr, RIInstr(sra));
-      }
-      break;
-    case kS390_ShiftRightArith64:
-      ASSEMBLE_BIN_OP(RRRInstr(srag), nullInstr, RRIInstr(srag));
-      break;
-#if !V8_TARGET_ARCH_S390X
-    case kS390_AddPair:
-      // i.InputRegister(0) ... left low word.
-      // i.InputRegister(1) ... left high word.
-      // i.InputRegister(2) ... right low word.
-      // i.InputRegister(3) ... right high word.
-      __ AddLogical32(i.OutputRegister(0), i.InputRegister(0),
-                      i.InputRegister(2));
-      __ AddLogicalWithCarry32(i.OutputRegister(1), i.InputRegister(1),
-                               i.InputRegister(3));
-      break;
-    case kS390_SubPair:
-      // i.InputRegister(0) ... left low word.
-      // i.InputRegister(1) ... left high word.
-      // i.InputRegister(2) ... right low word.
-      // i.InputRegister(3) ... right high word.
-      __ SubLogical32(i.OutputRegister(0), i.InputRegister(0),
-                      i.InputRegister(2));
-      __ SubLogicalWithBorrow32(i.OutputRegister(1), i.InputRegister(1),
-                                i.InputRegister(3));
-      break;
-    case kS390_MulPair:
-      // i.InputRegister(0) ... left low word.
-      // i.InputRegister(1) ... left high word.
-      // i.InputRegister(2) ... right low word.
-      // i.InputRegister(3) ... right high word.
-      __ sllg(r0, i.InputRegister(1), Operand(32));
-      __ sllg(r1, i.InputRegister(3), Operand(32));
-      __ lr(r0, i.InputRegister(0));
-      __ lr(r1, i.InputRegister(2));
-      __ msgr(r1, r0);
-      __ lr(i.OutputRegister(0), r1);
-      __ srag(i.OutputRegister(1), r1, Operand(32));
-      break;
-    case kS390_ShiftLeftPair: {
-      Register second_output =
-          instr->OutputCount() >= 2 ? i.OutputRegister(1) : i.TempRegister(0);
-      if (instr->InputAt(2)->IsImmediate()) {
-        __ ShiftLeftPair(i.OutputRegister(0), second_output, i.InputRegister(0),
-                         i.InputRegister(1), i.InputInt32(2));
-      } else {
-        __ ShiftLeftPair(i.OutputRegister(0), second_output, i.InputRegister(0),
-                         i.InputRegister(1), kScratchReg, i.InputRegister(2));
-      }
-      break;
-    }
-    case kS390_ShiftRightPair: {
-      Register second_output =
-          instr->OutputCount() >= 2 ? i.OutputRegister(1) : i.TempRegister(0);
-      if (instr->InputAt(2)->IsImmediate()) {
-        __ ShiftRightPair(i.OutputRegister(0), second_output,
-                          i.InputRegister(0), i.InputRegister(1),
-                          i.InputInt32(2));
-      } else {
-        __ ShiftRightPair(i.OutputRegister(0), second_output,
-                          i.InputRegister(0), i.InputRegister(1), kScratchReg,
-                          i.InputRegister(2));
-      }
-      break;
-    }
-    case kS390_ShiftRightArithPair: {
-      Register second_output =
-          instr->OutputCount() >= 2 ? i.OutputRegister(1) : i.TempRegister(0);
-      if (instr->InputAt(2)->IsImmediate()) {
-        __ ShiftRightArithPair(i.OutputRegister(0), second_output,
-                               i.InputRegister(0), i.InputRegister(1),
-                               i.InputInt32(2));
-      } else {
-        __ ShiftRightArithPair(i.OutputRegister(0), second_output,
-                               i.InputRegister(0), i.InputRegister(1),
-                               kScratchReg, i.InputRegister(2));
-      }
-      break;
-    }
-#endif
-    case kS390_RotRight32: {
-      // zero-ext
-      if (HasRegisterInput(instr, 1)) {
-        __ LoadComplementRR(kScratchReg, i.InputRegister(1));
-        __ rll(i.OutputRegister(), i.InputRegister(0), kScratchReg);
-      } else {
-        __ rll(i.OutputRegister(), i.InputRegister(0),
-               Operand(32 - i.InputInt32(1)));
-      }
-      CHECK_AND_ZERO_EXT_OUTPUT(2);
-      break;
-    }
-    case kS390_RotRight64:
-      if (HasRegisterInput(instr, 1)) {
-        __ lcgr(kScratchReg, i.InputRegister(1));
-        __ rllg(i.OutputRegister(), i.InputRegister(0), kScratchReg);
-      } else {
-        DCHECK(HasImmediateInput(instr, 1));
-        __ rllg(i.OutputRegister(), i.InputRegister(0),
-                Operand(64 - i.InputInt32(1)));
-      }
-      break;
-    // TODO(john.yan): clean up kS390_RotLeftAnd...
-    case kS390_RotLeftAndClear64:
-      if (CpuFeatures::IsSupported(GENERAL_INSTR_EXT)) {
-        int shiftAmount = i.InputInt32(1);
-        int endBit = 63 - shiftAmount;
-        int startBit = 63 - i.InputInt32(2);
-        __ risbg(i.OutputRegister(), i.InputRegister(0), Operand(startBit),
-                 Operand(endBit), Operand(shiftAmount), true);
-      } else {
-        int shiftAmount = i.InputInt32(1);
-        int clearBit = 63 - i.InputInt32(2);
-        __ rllg(i.OutputRegister(), i.InputRegister(0), Operand(shiftAmount));
-        __ sllg(i.OutputRegister(), i.OutputRegister(), Operand(clearBit));
-        __ srlg(i.OutputRegister(), i.OutputRegister(),
-                Operand(clearBit + shiftAmount));
-        __ sllg(i.OutputRegister(), i.OutputRegister(), Operand(shiftAmount));
-      }
-      break;
-    case kS390_RotLeftAndClearLeft64:
-      if (CpuFeatures::IsSupported(GENERAL_INSTR_EXT)) {
-        int shiftAmount = i.InputInt32(1);
-        int endBit = 63;
-        int startBit = 63 - i.InputInt32(2);
-        __ risbg(i.OutputRegister(), i.InputRegister(0), Operand(startBit),
-                 Operand(endBit), Operand(shiftAmount), true);
-      } else {
-        int shiftAmount = i.InputInt32(1);
-        int clearBit = 63 - i.InputInt32(2);
-        __ rllg(i.OutputRegister(), i.InputRegister(0), Operand(shiftAmount));
-        __ sllg(i.OutputRegister(), i.OutputRegister(), Operand(clearBit));
-        __ srlg(i.OutputRegister(), i.OutputRegister(), Operand(clearBit));
-      }
-      break;
-    case kS390_RotLeftAndClearRight64:
-      if (CpuFeatures::IsSupported(GENERAL_INSTR_EXT)) {
-        int shiftAmount = i.InputInt32(1);
-        int endBit = 63 - i.InputInt32(2);
-        int startBit = 0;
-        __ risbg(i.OutputRegister(), i.InputRegister(0), Operand(startBit),
-                 Operand(endBit), Operand(shiftAmount), true);
-      } else {
-        int shiftAmount = i.InputInt32(1);
-        int clearBit = i.InputInt32(2);
-        __ rllg(i.OutputRegister(), i.InputRegister(0), Operand(shiftAmount));
-        __ srlg(i.OutputRegister(), i.OutputRegister(), Operand(clearBit));
-        __ sllg(i.OutputRegister(), i.OutputRegister(), Operand(clearBit));
-      }
-      break;
-    case kS390_Add32: {
-      // zero-ext
-      if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-        ASSEMBLE_BIN32_OP(RRRInstr(ark), RM32Instr(Add32), RRIInstr(Add32));
-      } else {
-        ASSEMBLE_BIN32_OP(RRInstr(ar), RM32Instr(Add32), RIInstr(Add32));
-      }
-      break;
-    }
-    case kS390_Add64:
-      if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-        ASSEMBLE_BIN_OP(RRRInstr(agrk), RM64Instr(ag), RRIInstr(AddP));
-      } else {
-        ASSEMBLE_BIN_OP(RRInstr(agr), RM64Instr(ag), RIInstr(agfi));
-      }
-      break;
-    case kS390_AddFloat:
-      ASSEMBLE_BIN_OP(DDInstr(aebr), DMTInstr(AddFloat32), nullInstr);
-      break;
-    case kS390_AddDouble:
-      ASSEMBLE_BIN_OP(DDInstr(adbr), DMTInstr(AddFloat64), nullInstr);
-      break;
-    case kS390_Sub32:
-      // zero-ext
-      if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-        ASSEMBLE_BIN32_OP(RRRInstr(srk), RM32Instr(Sub32), RRIInstr(Sub32));
-      } else {
-        ASSEMBLE_BIN32_OP(RRInstr(sr), RM32Instr(Sub32), RIInstr(Sub32));
-      }
-      break;
-    case kS390_Sub64:
-      if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-        ASSEMBLE_BIN_OP(RRRInstr(sgrk), RM64Instr(sg), RRIInstr(SubP));
-      } else {
-        ASSEMBLE_BIN_OP(RRInstr(sgr), RM64Instr(sg), RIInstr(SubP));
-      }
-      break;
-    case kS390_SubFloat:
-      ASSEMBLE_BIN_OP(DDInstr(sebr), DMTInstr(SubFloat32), nullInstr);
-      break;
-    case kS390_SubDouble:
-      ASSEMBLE_BIN_OP(DDInstr(sdbr), DMTInstr(SubFloat64), nullInstr);
-      break;
-    case kS390_Mul32:
-      // zero-ext
-      if (CpuFeatures::IsSupported(MISC_INSTR_EXT2)) {
-        ASSEMBLE_BIN32_OP(RRRInstr(msrkc), RM32Instr(msc), RIInstr(Mul32));
-      } else {
-        ASSEMBLE_BIN32_OP(RRInstr(Mul32), RM32Instr(Mul32), RIInstr(Mul32));
-      }
-      break;
-    case kS390_Mul32WithOverflow:
-      // zero-ext
-      ASSEMBLE_BIN32_OP(RRRInstr(Mul32WithOverflowIfCCUnequal),
-                        RRM32Instr(Mul32WithOverflowIfCCUnequal),
-                        RRIInstr(Mul32WithOverflowIfCCUnequal));
-      break;
-    case kS390_Mul64:
-      ASSEMBLE_BIN_OP(RRInstr(Mul64), RM64Instr(Mul64), RIInstr(Mul64));
-      break;
-    case kS390_MulHigh32:
-      // zero-ext
-      ASSEMBLE_BIN_OP(RRRInstr(MulHigh32), RRM32Instr(MulHigh32),
-                      RRIInstr(MulHigh32));
-      break;
-    case kS390_MulHighU32:
-      // zero-ext
-      ASSEMBLE_BIN_OP(RRRInstr(MulHighU32), RRM32Instr(MulHighU32),
-                      RRIInstr(MulHighU32));
-      break;
-    case kS390_MulFloat:
-      ASSEMBLE_BIN_OP(DDInstr(meebr), DMTInstr(MulFloat32), nullInstr);
-      break;
-    case kS390_MulDouble:
-      ASSEMBLE_BIN_OP(DDInstr(mdbr), DMTInstr(MulFloat64), nullInstr);
-      break;
-    case kS390_Div64:
-      ASSEMBLE_BIN_OP(RRRInstr(Div64), RRM64Instr(Div64), nullInstr);
-      break;
-    case kS390_Div32: {
-      // zero-ext
-      ASSEMBLE_BIN_OP(RRRInstr(Div32), RRM32Instr(Div32), nullInstr);
-      break;
-    }
-    case kS390_DivU64:
-      ASSEMBLE_BIN_OP(RRRInstr(DivU64), RRM64Instr(DivU64), nullInstr);
-      break;
-    case kS390_DivU32: {
-      // zero-ext
-      ASSEMBLE_BIN_OP(RRRInstr(DivU32), RRM32Instr(DivU32), nullInstr);
-      break;
-    }
-    case kS390_DivFloat:
-      ASSEMBLE_BIN_OP(DDInstr(debr), DMTInstr(DivFloat32), nullInstr);
-      break;
-    case kS390_DivDouble:
-      ASSEMBLE_BIN_OP(DDInstr(ddbr), DMTInstr(DivFloat64), nullInstr);
-      break;
-    case kS390_Mod32:
-      // zero-ext
-      ASSEMBLE_BIN_OP(RRRInstr(Mod32), RRM32Instr(Mod32), nullInstr);
-      break;
-    case kS390_ModU32:
-      // zero-ext
-      ASSEMBLE_BIN_OP(RRRInstr(ModU32), RRM32Instr(ModU32), nullInstr);
-      break;
-    case kS390_Mod64:
-      ASSEMBLE_BIN_OP(RRRInstr(Mod64), RRM64Instr(Mod64), nullInstr);
-      break;
-    case kS390_ModU64:
-      ASSEMBLE_BIN_OP(RRRInstr(ModU64), RRM64Instr(ModU64), nullInstr);
-      break;
-    case kS390_AbsFloat:
-      __ lpebr(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    case kS390_SqrtFloat:
-      ASSEMBLE_UNARY_OP(D_DInstr(sqebr), nullInstr, nullInstr);
-      break;
-    case kS390_SqrtDouble:
-      ASSEMBLE_UNARY_OP(D_DInstr(sqdbr), nullInstr, nullInstr);
-      break;
-    case kS390_FloorFloat:
-      __ fiebra(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-                v8::internal::Assembler::FIDBRA_ROUND_TOWARD_NEG_INF);
-      break;
-    case kS390_CeilFloat:
-      __ fiebra(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-                v8::internal::Assembler::FIDBRA_ROUND_TOWARD_POS_INF);
-      break;
-    case kS390_TruncateFloat:
-      __ fiebra(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-                v8::internal::Assembler::FIDBRA_ROUND_TOWARD_0);
-      break;
-    //  Double operations
-    case kS390_ModDouble:
-      ASSEMBLE_FLOAT_MODULO();
-      break;
-    case kIeee754Float64Acos:
-      ASSEMBLE_IEEE754_UNOP(acos);
-      break;
-    case kIeee754Float64Acosh:
-      ASSEMBLE_IEEE754_UNOP(acosh);
-      break;
-    case kIeee754Float64Asin:
-      ASSEMBLE_IEEE754_UNOP(asin);
-      break;
-    case kIeee754Float64Asinh:
-      ASSEMBLE_IEEE754_UNOP(asinh);
-      break;
-    case kIeee754Float64Atanh:
-      ASSEMBLE_IEEE754_UNOP(atanh);
-      break;
-    case kIeee754Float64Atan:
-      ASSEMBLE_IEEE754_UNOP(atan);
-      break;
-    case kIeee754Float64Atan2:
-      ASSEMBLE_IEEE754_BINOP(atan2);
-      break;
-    case kIeee754Float64Tan:
-      ASSEMBLE_IEEE754_UNOP(tan);
-      break;
-    case kIeee754Float64Tanh:
-      ASSEMBLE_IEEE754_UNOP(tanh);
-      break;
-    case kIeee754Float64Cbrt:
-      ASSEMBLE_IEEE754_UNOP(cbrt);
-      break;
-    case kIeee754Float64Sin:
-      ASSEMBLE_IEEE754_UNOP(sin);
-      break;
-    case kIeee754Float64Sinh:
-      ASSEMBLE_IEEE754_UNOP(sinh);
-      break;
-    case kIeee754Float64Cos:
-      ASSEMBLE_IEEE754_UNOP(cos);
-      break;
-    case kIeee754Float64Cosh:
-      ASSEMBLE_IEEE754_UNOP(cosh);
-      break;
-    case kIeee754Float64Exp:
-      ASSEMBLE_IEEE754_UNOP(exp);
-      break;
-    case kIeee754Float64Expm1:
-      ASSEMBLE_IEEE754_UNOP(expm1);
-      break;
-    case kIeee754Float64Log:
-      ASSEMBLE_IEEE754_UNOP(log);
-      break;
-    case kIeee754Float64Log1p:
-      ASSEMBLE_IEEE754_UNOP(log1p);
-      break;
-    case kIeee754Float64Log2:
-      ASSEMBLE_IEEE754_UNOP(log2);
-      break;
-    case kIeee754Float64Log10:
-      ASSEMBLE_IEEE754_UNOP(log10);
-      break;
-    case kIeee754Float64Pow: {
-      __ CallStubDelayed(new (zone())
-                             MathPowStub(nullptr, MathPowStub::DOUBLE));
-      __ Move(d1, d3);
-      break;
-    }
-    case kS390_Neg32:
-      __ lcr(i.OutputRegister(), i.InputRegister(0));
-      CHECK_AND_ZERO_EXT_OUTPUT(1);
-      break;
-    case kS390_Neg64:
-      __ lcgr(i.OutputRegister(), i.InputRegister(0));
-      break;
-    case kS390_MaxFloat:
-      ASSEMBLE_FLOAT_MAX();
-      break;
-    case kS390_MaxDouble:
-      ASSEMBLE_DOUBLE_MAX();
-      break;
-    case kS390_MinFloat:
-      ASSEMBLE_FLOAT_MIN();
-      break;
-    case kS390_MinDouble:
-      ASSEMBLE_DOUBLE_MIN();
-      break;
-    case kS390_AbsDouble:
-      __ lpdbr(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
-      break;
-    case kS390_FloorDouble:
-      __ fidbra(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-                v8::internal::Assembler::FIDBRA_ROUND_TOWARD_NEG_INF);
-      break;
-    case kS390_CeilDouble:
-      __ fidbra(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-                v8::internal::Assembler::FIDBRA_ROUND_TOWARD_POS_INF);
-      break;
-    case kS390_TruncateDouble:
-      __ fidbra(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-                v8::internal::Assembler::FIDBRA_ROUND_TOWARD_0);
-      break;
-    case kS390_RoundDouble:
-      __ fidbra(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
-                v8::internal::Assembler::FIDBRA_ROUND_TO_NEAREST_AWAY_FROM_0);
-      break;
-    case kS390_NegFloat:
-      ASSEMBLE_UNARY_OP(D_DInstr(lcebr), nullInstr, nullInstr);
-      break;
-    case kS390_NegDouble:
-      ASSEMBLE_UNARY_OP(D_DInstr(lcdbr), nullInstr, nullInstr);
-      break;
-    case kS390_Cntlz32: {
-      __ llgfr(i.OutputRegister(), i.InputRegister(0));
-      __ flogr(r0, i.OutputRegister());
-      __ Add32(i.OutputRegister(), r0, Operand(-32));
-      // No need to zero-ext b/c llgfr is done already
-      break;
-    }
-#if V8_TARGET_ARCH_S390X
-    case kS390_Cntlz64: {
-      __ flogr(r0, i.InputRegister(0));
-      __ LoadRR(i.OutputRegister(), r0);
-      break;
-    }
-#endif
-    case kS390_Popcnt32:
-      __ Popcnt32(i.OutputRegister(), i.InputRegister(0));
-      break;
-#if V8_TARGET_ARCH_S390X
-    case kS390_Popcnt64:
-      __ Popcnt64(i.OutputRegister(), i.InputRegister(0));
-      break;
-#endif
-    case kS390_Cmp32:
-      ASSEMBLE_COMPARE32(Cmp32, CmpLogical32);
-      break;
-#if V8_TARGET_ARCH_S390X
-    case kS390_Cmp64:
-      ASSEMBLE_COMPARE(CmpP, CmpLogicalP);
-      break;
-#endif
-    case kS390_CmpFloat:
-      ASSEMBLE_FLOAT_COMPARE(cebr, ceb, ley);
-      // __ cebr(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
-      break;
-    case kS390_CmpDouble:
-      ASSEMBLE_FLOAT_COMPARE(cdbr, cdb, ldy);
-      // __ cdbr(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
-      break;
-    case kS390_Tst32:
-      if (HasRegisterInput(instr, 1)) {
-        __ And(r0, i.InputRegister(0), i.InputRegister(1));
-      } else {
-        // detect tmlh/tmhl/tmhh case
-        Operand opnd = i.InputImmediate(1);
-        if (is_uint16(opnd.immediate())) {
-          __ tmll(i.InputRegister(0), opnd);
-        } else {
-          __ lr(r0, i.InputRegister(0));
-          __ nilf(r0, opnd);
-        }
-      }
-      break;
-    case kS390_Tst64:
-      if (HasRegisterInput(instr, 1)) {
-        __ AndP(r0, i.InputRegister(0), i.InputRegister(1));
-      } else {
-        Operand opnd = i.InputImmediate(1);
-        if (is_uint16(opnd.immediate())) {
-          __ tmll(i.InputRegister(0), opnd);
-        } else {
-          __ AndP(r0, i.InputRegister(0), opnd);
-        }
-      }
-      break;
-    case kS390_Float64SilenceNaN: {
-      DoubleRegister value = i.InputDoubleRegister(0);
-      DoubleRegister result = i.OutputDoubleRegister();
-      __ CanonicalizeNaN(result, value);
-      break;
-    }
-    case kS390_StackClaim: {
-      int num_slots = i.InputInt32(0);
-      __ lay(sp, MemOperand(sp, -num_slots * kPointerSize));
-      frame_access_state()->IncreaseSPDelta(num_slots);
-      break;
-    }
-    case kS390_Push:
-      if (instr->InputAt(0)->IsFPRegister()) {
-        LocationOperand* op = LocationOperand::cast(instr->InputAt(0));
-        if (op->representation() == MachineRepresentation::kFloat64) {
-          __ lay(sp, MemOperand(sp, -kDoubleSize));
-          __ StoreDouble(i.InputDoubleRegister(0), MemOperand(sp));
-          frame_access_state()->IncreaseSPDelta(kDoubleSize / kPointerSize);
-        } else {
-          DCHECK_EQ(MachineRepresentation::kFloat32, op->representation());
-          __ lay(sp, MemOperand(sp, -kPointerSize));
-          __ StoreFloat32(i.InputDoubleRegister(0), MemOperand(sp));
-          frame_access_state()->IncreaseSPDelta(1);
-        }
-      } else {
-        __ Push(i.InputRegister(0));
-        frame_access_state()->IncreaseSPDelta(1);
-      }
-      break;
-    case kS390_PushFrame: {
-      int num_slots = i.InputInt32(1);
-      __ lay(sp, MemOperand(sp, -num_slots * kPointerSize));
-      if (instr->InputAt(0)->IsFPRegister()) {
-        LocationOperand* op = LocationOperand::cast(instr->InputAt(0));
-        if (op->representation() == MachineRepresentation::kFloat64) {
-          __ StoreDouble(i.InputDoubleRegister(0), MemOperand(sp));
-        } else {
-          DCHECK_EQ(MachineRepresentation::kFloat32, op->representation());
-          __ StoreFloat32(i.InputDoubleRegister(0), MemOperand(sp));
-        }
-      } else {
-        __ StoreP(i.InputRegister(0),
-                  MemOperand(sp));
-      }
-      break;
-    }
-    case kS390_StoreToStackSlot: {
-      int slot = i.InputInt32(1);
-      if (instr->InputAt(0)->IsFPRegister()) {
-        LocationOperand* op = LocationOperand::cast(instr->InputAt(0));
-        if (op->representation() == MachineRepresentation::kFloat64) {
-          __ StoreDouble(i.InputDoubleRegister(0),
-                         MemOperand(sp, slot * kPointerSize));
-        } else {
-          DCHECK_EQ(MachineRepresentation::kFloat32, op->representation());
-          __ StoreFloat32(i.InputDoubleRegister(0),
-                          MemOperand(sp, slot * kPointerSize));
-        }
-      } else {
-        __ StoreP(i.InputRegister(0), MemOperand(sp, slot * kPointerSize));
-      }
-      break;
-    }
-    case kS390_ExtendSignWord8:
-      __ lbr(i.OutputRegister(), i.InputRegister(0));
-      CHECK_AND_ZERO_EXT_OUTPUT(1);
-      break;
-    case kS390_ExtendSignWord16:
-      __ lhr(i.OutputRegister(), i.InputRegister(0));
-      CHECK_AND_ZERO_EXT_OUTPUT(1);
-      break;
-    case kS390_ExtendSignWord32:
-      __ lgfr(i.OutputRegister(), i.InputRegister(0));
-      break;
-    case kS390_Uint32ToUint64:
-      // Zero extend
-      __ llgfr(i.OutputRegister(), i.InputRegister(0));
-      break;
-    case kS390_Int64ToInt32:
-      // sign extend
-      __ lgfr(i.OutputRegister(), i.InputRegister(0));
-      break;
-    // Convert Fixed to Floating Point
-    case kS390_Int64ToFloat32:
-      __ ConvertInt64ToFloat(i.OutputDoubleRegister(), i.InputRegister(0));
-      break;
-    case kS390_Int64ToDouble:
-      __ ConvertInt64ToDouble(i.OutputDoubleRegister(), i.InputRegister(0));
-      break;
-    case kS390_Uint64ToFloat32:
-      __ ConvertUnsignedInt64ToFloat(i.OutputDoubleRegister(),
-                                     i.InputRegister(0));
-      break;
-    case kS390_Uint64ToDouble:
-      __ ConvertUnsignedInt64ToDouble(i.OutputDoubleRegister(),
-                                      i.InputRegister(0));
-      break;
-    case kS390_Int32ToFloat32:
-      __ ConvertIntToFloat(i.OutputDoubleRegister(), i.InputRegister(0));
-      break;
-    case kS390_Int32ToDouble:
-      __ ConvertIntToDouble(i.OutputDoubleRegister(), i.InputRegister(0));
-      break;
-    case kS390_Uint32ToFloat32:
-      __ ConvertUnsignedIntToFloat(i.OutputDoubleRegister(),
-                                   i.InputRegister(0));
-      break;
-    case kS390_Uint32ToDouble:
-      __ ConvertUnsignedIntToDouble(i.OutputDoubleRegister(),
-                                    i.InputRegister(0));
-      break;
-    case kS390_DoubleToInt32: {
-      Label done;
-      __ ConvertDoubleToInt32(i.OutputRegister(0), i.InputDoubleRegister(0),
-                              kRoundToNearest);
-      __ b(Condition(0xE), &done, Label::kNear);  // normal case
-      __ lghi(i.OutputRegister(0), Operand::Zero());
-      __ bind(&done);
-      break;
-    }
-    case kS390_DoubleToUint32: {
-      Label done;
-      __ ConvertDoubleToUnsignedInt32(i.OutputRegister(0),
-                                      i.InputDoubleRegister(0));
-      __ b(Condition(0xE), &done, Label::kNear);  // normal case
-      __ lghi(i.OutputRegister(0), Operand::Zero());
-      __ bind(&done);
-      break;
-    }
-    case kS390_DoubleToInt64: {
-      Label done;
-      if (i.OutputCount() > 1) {
-        __ lghi(i.OutputRegister(1), Operand(1));
-      }
-      __ ConvertDoubleToInt64(i.OutputRegister(0), i.InputDoubleRegister(0));
-      __ b(Condition(0xE), &done, Label::kNear);  // normal case
-      if (i.OutputCount() > 1) {
-        __ lghi(i.OutputRegister(1), Operand::Zero());
-      } else {
-        __ lghi(i.OutputRegister(0), Operand::Zero());
-      }
-      __ bind(&done);
-      break;
-    }
-    case kS390_DoubleToUint64: {
-      Label done;
-      if (i.OutputCount() > 1) {
-        __ lghi(i.OutputRegister(1), Operand(1));
-      }
-      __ ConvertDoubleToUnsignedInt64(i.OutputRegister(0),
-                                      i.InputDoubleRegister(0));
-      __ b(Condition(0xE), &done, Label::kNear);  // normal case
-      if (i.OutputCount() > 1) {
-        __ lghi(i.OutputRegister(1), Operand::Zero());
-      } else {
-        __ lghi(i.OutputRegister(0), Operand::Zero());
-      }
-      __ bind(&done);
-      break;
-    }
-    case kS390_Float32ToInt32: {
-      Label done;
-      __ ConvertFloat32ToInt32(i.OutputRegister(0), i.InputDoubleRegister(0),
-                               kRoundToZero);
-      __ b(Condition(0xE), &done, Label::kNear);  // normal case
-      __ lghi(i.OutputRegister(0), Operand::Zero());
-      __ bind(&done);
-      break;
-    }
-    case kS390_Float32ToUint32: {
-      Label done;
-      __ ConvertFloat32ToUnsignedInt32(i.OutputRegister(0),
-                                       i.InputDoubleRegister(0));
-      __ b(Condition(0xE), &done, Label::kNear);  // normal case
-      __ lghi(i.OutputRegister(0), Operand::Zero());
-      __ bind(&done);
-      break;
-    }
-    case kS390_Float32ToUint64: {
-      Label done;
-      if (i.OutputCount() > 1) {
-        __ lghi(i.OutputRegister(1), Operand(1));
-      }
-      __ ConvertFloat32ToUnsignedInt64(i.OutputRegister(0),
-                                       i.InputDoubleRegister(0));
-      __ b(Condition(0xE), &done, Label::kNear);  // normal case
-      if (i.OutputCount() > 1) {
-        __ lghi(i.OutputRegister(1), Operand::Zero());
-      } else {
-        __ lghi(i.OutputRegister(0), Operand::Zero());
-      }
-      __ bind(&done);
-      break;
-    }
-    case kS390_Float32ToInt64: {
-      Label done;
-      if (i.OutputCount() > 1) {
-        __ lghi(i.OutputRegister(1), Operand(1));
-      }
-      __ ConvertFloat32ToInt64(i.OutputRegister(0), i.InputDoubleRegister(0));
-      __ b(Condition(0xE), &done, Label::kNear);  // normal case
-      if (i.OutputCount() > 1) {
-        __ lghi(i.OutputRegister(1), Operand::Zero());
-      } else {
-        __ lghi(i.OutputRegister(0), Operand::Zero());
-      }
-      __ bind(&done);
-      break;
-    }
-    case kS390_DoubleToFloat32:
-      ASSEMBLE_UNARY_OP(D_DInstr(ledbr), nullInstr, nullInstr);
-      break;
-    case kS390_Float32ToDouble:
-      ASSEMBLE_UNARY_OP(D_DInstr(ldebr), D_MTInstr(LoadFloat32ToDouble),
-                        nullInstr);
-      break;
-    case kS390_DoubleExtractLowWord32:
-      __ lgdr(i.OutputRegister(), i.InputDoubleRegister(0));
-      __ llgfr(i.OutputRegister(), i.OutputRegister());
-      break;
-    case kS390_DoubleExtractHighWord32:
-      __ lgdr(i.OutputRegister(), i.InputDoubleRegister(0));
-      __ srlg(i.OutputRegister(), i.OutputRegister(), Operand(32));
-      break;
-    case kS390_DoubleInsertLowWord32:
-      __ lgdr(kScratchReg, i.InputDoubleRegister(0));
-      __ lr(kScratchReg, i.InputRegister(1));
-      __ ldgr(i.OutputDoubleRegister(), kScratchReg);
-      break;
-    case kS390_DoubleInsertHighWord32:
-      __ sllg(kScratchReg, i.InputRegister(1), Operand(32));
-      __ lgdr(r0, i.InputDoubleRegister(0));
-      __ lr(kScratchReg, r0);
-      __ ldgr(i.OutputDoubleRegister(), kScratchReg);
-      break;
-    case kS390_DoubleConstruct:
-      __ sllg(kScratchReg, i.InputRegister(0), Operand(32));
-      __ lr(kScratchReg, i.InputRegister(1));
-
-      // Bitwise convert from GPR to FPR
-      __ ldgr(i.OutputDoubleRegister(), kScratchReg);
-      break;
-    case kS390_LoadWordS8:
-      ASSEMBLE_LOAD_INTEGER(LoadB);
-      break;
-    case kS390_BitcastFloat32ToInt32:
-      ASSEMBLE_UNARY_OP(R_DInstr(MovFloatToInt), R_MInstr(LoadlW), nullInstr);
-      break;
-    case kS390_BitcastInt32ToFloat32:
-      __ MovIntToFloat(i.OutputDoubleRegister(), i.InputRegister(0));
-      break;
-#if V8_TARGET_ARCH_S390X
-    case kS390_BitcastDoubleToInt64:
-      __ MovDoubleToInt64(i.OutputRegister(), i.InputDoubleRegister(0));
-      break;
-    case kS390_BitcastInt64ToDouble:
-      __ MovInt64ToDouble(i.OutputDoubleRegister(), i.InputRegister(0));
-      break;
-#endif
-    case kS390_LoadWordU8:
-      ASSEMBLE_LOAD_INTEGER(LoadlB);
-      break;
-    case kS390_LoadWordU16:
-      ASSEMBLE_LOAD_INTEGER(LoadLogicalHalfWordP);
-      break;
-    case kS390_LoadWordS16:
-      ASSEMBLE_LOAD_INTEGER(LoadHalfWordP);
-      break;
-    case kS390_LoadWordU32:
-      ASSEMBLE_LOAD_INTEGER(LoadlW);
-      break;
-    case kS390_LoadWordS32:
-      ASSEMBLE_LOAD_INTEGER(LoadW);
-      break;
-    case kS390_LoadReverse16:
-      ASSEMBLE_LOAD_INTEGER(lrvh);
-      break;
-    case kS390_LoadReverse32:
-      ASSEMBLE_LOAD_INTEGER(lrv);
-      break;
-    case kS390_LoadReverse64:
-      ASSEMBLE_LOAD_INTEGER(lrvg);
-      break;
-    case kS390_LoadReverse16RR:
-      __ lrvr(i.OutputRegister(), i.InputRegister(0));
-      __ rll(i.OutputRegister(), i.OutputRegister(), Operand(16));
-      break;
-    case kS390_LoadReverse32RR:
-      __ lrvr(i.OutputRegister(), i.InputRegister(0));
-      break;
-    case kS390_LoadReverse64RR:
-      __ lrvgr(i.OutputRegister(), i.InputRegister(0));
-      break;
-    case kS390_LoadWord64:
-      ASSEMBLE_LOAD_INTEGER(lg);
-      break;
-    case kS390_LoadAndTestWord32: {
-      ASSEMBLE_LOADANDTEST32(ltr, lt_z);
-      break;
-    }
-    case kS390_LoadAndTestWord64: {
-      ASSEMBLE_LOADANDTEST64(ltgr, ltg);
-      break;
-    }
-    case kS390_LoadFloat32:
-      ASSEMBLE_LOAD_FLOAT(LoadFloat32);
-      break;
-    case kS390_LoadDouble:
-      ASSEMBLE_LOAD_FLOAT(LoadDouble);
-      break;
-    case kS390_StoreWord8:
-      ASSEMBLE_STORE_INTEGER(StoreByte);
-      break;
-    case kS390_StoreWord16:
-      ASSEMBLE_STORE_INTEGER(StoreHalfWord);
-      break;
-    case kS390_StoreWord32:
-      ASSEMBLE_STORE_INTEGER(StoreW);
-      break;
-#if V8_TARGET_ARCH_S390X
-    case kS390_StoreWord64:
-      ASSEMBLE_STORE_INTEGER(StoreP);
-      break;
-#endif
-    case kS390_StoreReverse16:
-      ASSEMBLE_STORE_INTEGER(strvh);
-      break;
-    case kS390_StoreReverse32:
-      ASSEMBLE_STORE_INTEGER(strv);
-      break;
-    case kS390_StoreReverse64:
-      ASSEMBLE_STORE_INTEGER(strvg);
-      break;
-    case kS390_StoreFloat32:
-      ASSEMBLE_STORE_FLOAT32();
-      break;
-    case kS390_StoreDouble:
-      ASSEMBLE_STORE_DOUBLE();
-      break;
-    case kS390_Lay:
-      __ lay(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kAtomicLoadInt8:
-      __ LoadB(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kAtomicLoadUint8:
-      __ LoadlB(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kAtomicLoadInt16:
-      __ LoadHalfWordP(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kAtomicLoadUint16:
-      __ LoadLogicalHalfWordP(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kAtomicLoadWord32:
-      __ LoadlW(i.OutputRegister(), i.MemoryOperand());
-      break;
-    case kAtomicStoreWord8:
-      __ StoreByte(i.InputRegister(0), i.MemoryOperand(nullptr, 1));
-      break;
-    case kAtomicStoreWord16:
-      __ StoreHalfWord(i.InputRegister(0), i.MemoryOperand(nullptr, 1));
-      break;
-    case kAtomicStoreWord32:
-      __ StoreW(i.InputRegister(0), i.MemoryOperand(nullptr, 1));
-      break;
-//         0x aa bb cc dd
-// index =    3..2..1..0
-#define ATOMIC_EXCHANGE(start, end, shift_amount, offset)                    \
-  {                                                                          \
-    Label do_cs;                                                             \
-    __ LoadlW(output, MemOperand(r1));                                       \
-    __ bind(&do_cs);                                                         \
-    __ llgfr(r0, output);                                                    \
-    __ risbg(r0, value, Operand(start), Operand(end), Operand(shift_amount), \
-             false);                                                         \
-    __ csy(output, r0, MemOperand(r1, offset));                              \
-    __ bne(&do_cs, Label::kNear);                                            \
-    __ srl(output, Operand(shift_amount));                                   \
-  }
-#ifdef V8_TARGET_BIG_ENDIAN
-#define ATOMIC_EXCHANGE_BYTE(i)                                  \
-  {                                                              \
-    constexpr int idx = (i);                                     \
-    static_assert(idx <= 3 && idx >= 0, "idx is out of range!"); \
-    constexpr int start = 32 + 8 * idx;                          \
-    constexpr int end = start + 7;                               \
-    constexpr int shift_amount = (3 - idx) * 8;                  \
-    ATOMIC_EXCHANGE(start, end, shift_amount, -idx);             \
-  }
-#define ATOMIC_EXCHANGE_HALFWORD(i)                              \
-  {                                                              \
-    constexpr int idx = (i);                                     \
-    static_assert(idx <= 1 && idx >= 0, "idx is out of range!"); \
-    constexpr int start = 32 + 16 * idx;                         \
-    constexpr int end = start + 15;                              \
-    constexpr int shift_amount = (1 - idx) * 16;                 \
-    ATOMIC_EXCHANGE(start, end, shift_amount, -idx * 2);         \
-  }
-#else
-#define ATOMIC_EXCHANGE_BYTE(i)                                  \
-  {                                                              \
-    constexpr int idx = (i);                                     \
-    static_assert(idx <= 3 && idx >= 0, "idx is out of range!"); \
-    constexpr int start = 32 + 8 * (3 - idx);                    \
-    constexpr int end = start + 7;                               \
-    constexpr int shift_amount = idx * 8;                        \
-    ATOMIC_EXCHANGE(start, end, shift_amount, -idx);             \
-  }
-#define ATOMIC_EXCHANGE_HALFWORD(i)                              \
-  {                                                              \
-    constexpr int idx = (i);                                     \
-    static_assert(idx <= 1 && idx >= 0, "idx is out of range!"); \
-    constexpr int start = 32 + 16 * (1 - idx);                   \
-    constexpr int end = start + 15;                              \
-    constexpr int shift_amount = idx * 16;                       \
-    ATOMIC_EXCHANGE(start, end, shift_amount, -idx * 2);         \
-  }
-#endif
-    case kAtomicExchangeInt8:
-    case kAtomicExchangeUint8: {
-      Register base = i.InputRegister(0);
-      Register index = i.InputRegister(1);
-      Register value = i.InputRegister(2);
-      Register output = i.OutputRegister();
-      Label three, two, one, done;
-      __ la(r1, MemOperand(base, index));
-      __ tmll(r1, Operand(3));
-      __ b(Condition(1), &three);
-      __ b(Condition(2), &two);
-      __ b(Condition(4), &one);
-
-      // end with 0b00
-      ATOMIC_EXCHANGE_BYTE(0);
-      __ b(&done);
-
-      // ending with 0b01
-      __ bind(&one);
-      ATOMIC_EXCHANGE_BYTE(1);
-      __ b(&done);
-
-      // ending with 0b10
-      __ bind(&two);
-      ATOMIC_EXCHANGE_BYTE(2);
-      __ b(&done);
-
-      // ending with 0b11
-      __ bind(&three);
-      ATOMIC_EXCHANGE_BYTE(3);
-
-      __ bind(&done);
-      if (opcode == kAtomicExchangeInt8) {
-        __ lbr(output, output);
-      } else {
-        __ llcr(output, output);
-      }
-      break;
-    }
-    case kAtomicExchangeInt16:
-    case kAtomicExchangeUint16: {
-      Register base = i.InputRegister(0);
-      Register index = i.InputRegister(1);
-      Register value = i.InputRegister(2);
-      Register output = i.OutputRegister();
-      Label two, unaligned, done;
-      __ la(r1, MemOperand(base, index));
-      __ tmll(r1, Operand(3));
-      __ b(Condition(2), &two);
-
-      // end with 0b00
-      ATOMIC_EXCHANGE_HALFWORD(0);
-      __ b(&done);
-
-      // ending with 0b10
-      __ bind(&two);
-      ATOMIC_EXCHANGE_HALFWORD(1);
-
-      __ bind(&done);
-      if (opcode == kAtomicExchangeInt8) {
-        __ lhr(output, output);
-      } else {
-        __ llhr(output, output);
-      }
-      break;
-    }
-    case kAtomicExchangeWord32: {
-      Register base = i.InputRegister(0);
-      Register index = i.InputRegister(1);
-      Register value = i.InputRegister(2);
-      Register output = i.OutputRegister();
-      Label do_cs;
-      __ lay(r1, MemOperand(base, index));
-      __ LoadlW(output, MemOperand(r1));
-      __ bind(&do_cs);
-      __ cs(output, value, MemOperand(r1));
-      __ bne(&do_cs, Label::kNear);
-      break;
-    }
-    default:
-      UNREACHABLE();
-      break;
-  }
-  return kSuccess;
-}  // NOLINT(readability/fn_size)
-
-// Assembles branches after an instruction.
-void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) {
-  S390OperandConverter i(this, instr);
-  Label* tlabel = branch->true_label;
-  Label* flabel = branch->false_label;
-  ArchOpcode op = instr->arch_opcode();
-  FlagsCondition condition = branch->condition;
-
-  Condition cond = FlagsConditionToCondition(condition, op);
-  if (op == kS390_CmpFloat || op == kS390_CmpDouble) {
-    // check for unordered if necessary
-    // Branching to flabel/tlabel according to what's expected by tests
-    if (cond == le || cond == eq || cond == lt) {
-      __ bunordered(flabel);
-    } else if (cond == gt || cond == ne || cond == ge) {
-      __ bunordered(tlabel);
-    }
-  }
-  __ b(cond, tlabel);
-  if (!branch->fallthru) __ b(flabel);  // no fallthru to flabel.
-}
-
-void CodeGenerator::AssembleArchDeoptBranch(Instruction* instr,
-                                            BranchInfo* branch) {
-  AssembleArchBranch(instr, branch);
-}
-
-void CodeGenerator::AssembleArchJump(RpoNumber target) {
-  if (!IsNextInAssemblyOrder(target)) __ b(GetLabel(target));
-}
-
-void CodeGenerator::AssembleArchTrap(Instruction* instr,
-                                     FlagsCondition condition) {
-  class OutOfLineTrap final : public OutOfLineCode {
-   public:
-    OutOfLineTrap(CodeGenerator* gen, bool frame_elided, Instruction* instr)
-        : OutOfLineCode(gen),
-          frame_elided_(frame_elided),
-          instr_(instr),
-          gen_(gen) {}
-
-    void Generate() final {
-      S390OperandConverter i(gen_, instr_);
-
-      Builtins::Name trap_id =
-          static_cast<Builtins::Name>(i.InputInt32(instr_->InputCount() - 1));
-      bool old_has_frame = __ has_frame();
-      if (frame_elided_) {
-        __ set_has_frame(true);
-        __ EnterFrame(StackFrame::WASM_COMPILED);
-      }
-      GenerateCallToTrap(trap_id);
-      if (frame_elided_) {
-        __ set_has_frame(old_has_frame);
-      }
-    }
-
-   private:
-    void GenerateCallToTrap(Builtins::Name trap_id) {
-      if (trap_id == Builtins::builtin_count) {
-        // We cannot test calls to the runtime in cctest/test-run-wasm.
-        // Therefore we emit a call to C here instead of a call to the runtime.
-        // We use the context register as the scratch register, because we do
-        // not have a context here.
-        __ PrepareCallCFunction(0, 0, cp);
-        __ CallCFunction(ExternalReference::wasm_call_trap_callback_for_testing(
-                             __ isolate()),
-                         0);
-        __ LeaveFrame(StackFrame::WASM_COMPILED);
-        CallDescriptor* descriptor = gen_->linkage()->GetIncomingDescriptor();
-        int pop_count = static_cast<int>(descriptor->StackParameterCount());
-        __ Drop(pop_count);
-        __ Ret();
-      } else {
-        gen_->AssembleSourcePosition(instr_);
-        __ Call(__ isolate()->builtins()->builtin_handle(trap_id),
-                RelocInfo::CODE_TARGET);
-        ReferenceMap* reference_map =
-            new (gen_->zone()) ReferenceMap(gen_->zone());
-        gen_->RecordSafepoint(reference_map, Safepoint::kSimple, 0,
-                              Safepoint::kNoLazyDeopt);
-        if (FLAG_debug_code) {
-          __ stop(GetAbortReason(AbortReason::kUnexpectedReturnFromWasmTrap));
-        }
-      }
-    }
-
-    bool frame_elided_;
-    Instruction* instr_;
-    CodeGenerator* gen_;
-  };
-  bool frame_elided = !frame_access_state()->has_frame();
-  auto ool = new (zone()) OutOfLineTrap(this, frame_elided, instr);
-  Label* tlabel = ool->entry();
-  Label end;
-
-  ArchOpcode op = instr->arch_opcode();
-  Condition cond = FlagsConditionToCondition(condition, op);
-  if (op == kS390_CmpFloat || op == kS390_CmpDouble) {
-    // check for unordered if necessary
-    if (cond == le || cond == eq || cond == lt) {
-      __ bunordered(&end);
-    } else if (cond == gt || cond == ne || cond == ge) {
-      __ bunordered(tlabel);
-    }
-  }
-  __ b(cond, tlabel);
-  __ bind(&end);
-}
-
-// Assembles boolean materializations after an instruction.
-void CodeGenerator::AssembleArchBoolean(Instruction* instr,
-                                        FlagsCondition condition) {
-  S390OperandConverter i(this, instr);
-  ArchOpcode op = instr->arch_opcode();
-  bool check_unordered = (op == kS390_CmpDouble || op == kS390_CmpFloat);
-
-  // Overflow checked for add/sub only.
-  DCHECK((condition != kOverflow && condition != kNotOverflow) ||
-         (op == kS390_Add32 || op == kS390_Add64 || op == kS390_Sub32 ||
-          op == kS390_Sub64 || op == kS390_Mul32));
-
-  // Materialize a full 32-bit 1 or 0 value. The result register is always the
-  // last output of the instruction.
-  DCHECK_NE(0u, instr->OutputCount());
-  Register reg = i.OutputRegister(instr->OutputCount() - 1);
-  Condition cond = FlagsConditionToCondition(condition, op);
-  Label done;
-  if (check_unordered) {
-    __ LoadImmP(reg, (cond == eq || cond == le || cond == lt) ? Operand::Zero()
-                                                              : Operand(1));
-    __ bunordered(&done);
-  }
-
-  // TODO(john.yan): use load imm high on condition here
-  __ LoadImmP(reg, Operand::Zero());
-  __ LoadImmP(kScratchReg, Operand(1));
-  // locr is sufficient since reg's upper 32 is guarrantee to be 0
-  __ locr(cond, reg, kScratchReg);
-  __ bind(&done);
-}
-
-void CodeGenerator::AssembleArchLookupSwitch(Instruction* instr) {
-  S390OperandConverter i(this, instr);
-  Register input = i.InputRegister(0);
-  for (size_t index = 2; index < instr->InputCount(); index += 2) {
-    __ Cmp32(input, Operand(i.InputInt32(index + 0)));
-    __ beq(GetLabel(i.InputRpo(index + 1)));
-  }
-  AssembleArchJump(i.InputRpo(1));
-}
-
-void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) {
-  S390OperandConverter i(this, instr);
-  Register input = i.InputRegister(0);
-  int32_t const case_count = static_cast<int32_t>(instr->InputCount() - 2);
-  Label** cases = zone()->NewArray<Label*>(case_count);
-  for (int32_t index = 0; index < case_count; ++index) {
-    cases[index] = GetLabel(i.InputRpo(index + 2));
-  }
-  Label* const table = AddJumpTable(cases, case_count);
-  __ CmpLogicalP(input, Operand(case_count));
-  __ bge(GetLabel(i.InputRpo(1)));
-  __ larl(kScratchReg, table);
-  __ ShiftLeftP(r1, input, Operand(kPointerSizeLog2));
-  __ LoadP(kScratchReg, MemOperand(kScratchReg, r1));
-  __ Jump(kScratchReg);
-}
-
-void CodeGenerator::FinishFrame(Frame* frame) {
-  CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
-  const RegList double_saves = descriptor->CalleeSavedFPRegisters();
-
-  // Save callee-saved Double registers.
-  if (double_saves != 0) {
-    frame->AlignSavedCalleeRegisterSlots();
-    DCHECK_EQ(kNumCalleeSavedDoubles,
-              base::bits::CountPopulation(double_saves));
-    frame->AllocateSavedCalleeRegisterSlots(kNumCalleeSavedDoubles *
-                                            (kDoubleSize / kPointerSize));
-  }
-  // Save callee-saved registers.
-  const RegList saves = descriptor->CalleeSavedRegisters();
-  if (saves != 0) {
-    // register save area does not include the fp or constant pool pointer.
-    const int num_saves = kNumCalleeSaved - 1;
-    DCHECK(num_saves == base::bits::CountPopulation(saves));
-    frame->AllocateSavedCalleeRegisterSlots(num_saves);
-  }
-}
-
-void CodeGenerator::AssembleConstructFrame() {
-  CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
-
-  if (frame_access_state()->has_frame()) {
-    if (descriptor->IsCFunctionCall()) {
-      __ Push(r14, fp);
-      __ LoadRR(fp, sp);
-    } else if (descriptor->IsJSFunctionCall()) {
-      __ Prologue(ip);
-      if (descriptor->PushArgumentCount()) {
-        __ Push(kJavaScriptCallArgCountRegister);
-      }
-    } else {
-      StackFrame::Type type = info()->GetOutputStackFrameType();
-      // TODO(mbrandy): Detect cases where ip is the entrypoint (for
-      // efficient intialization of the constant pool pointer register).
-      __ StubPrologue(type);
-    }
-  }
-
-  int shrink_slots =
-      frame()->GetTotalFrameSlotCount() - descriptor->CalculateFixedFrameSize();
-  if (info()->is_osr()) {
-    // TurboFan OSR-compiled functions cannot be entered directly.
-    __ Abort(AbortReason::kShouldNotDirectlyEnterOsrFunction);
-
-    // Unoptimized code jumps directly to this entrypoint while the unoptimized
-    // frame is still on the stack. Optimized code uses OSR values directly from
-    // the unoptimized frame. Thus, all that needs to be done is to allocate the
-    // remaining stack slots.
-    if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --");
-    osr_pc_offset_ = __ pc_offset();
-    shrink_slots -= osr_helper()->UnoptimizedFrameSlots();
-  }
-
-  const RegList double_saves = descriptor->CalleeSavedFPRegisters();
-  if (shrink_slots > 0) {
-    __ lay(sp, MemOperand(sp, -shrink_slots * kPointerSize));
-  }
-
-  // Save callee-saved Double registers.
-  if (double_saves != 0) {
-    __ MultiPushDoubles(double_saves);
-    DCHECK_EQ(kNumCalleeSavedDoubles,
-              base::bits::CountPopulation(double_saves));
-  }
-
-  // Save callee-saved registers.
-  const RegList saves = descriptor->CalleeSavedRegisters();
-  if (saves != 0) {
-    __ MultiPush(saves);
-    // register save area does not include the fp or constant pool pointer.
-  }
-}
-
-void CodeGenerator::AssembleReturn(InstructionOperand* pop) {
-  CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
-  int pop_count = static_cast<int>(descriptor->StackParameterCount());
-
-  // Restore registers.
-  const RegList saves = descriptor->CalleeSavedRegisters();
-  if (saves != 0) {
-    __ MultiPop(saves);
-  }
-
-  // Restore double registers.
-  const RegList double_saves = descriptor->CalleeSavedFPRegisters();
-  if (double_saves != 0) {
-    __ MultiPopDoubles(double_saves);
-  }
-
-  S390OperandConverter g(this, nullptr);
-  if (descriptor->IsCFunctionCall()) {
-    AssembleDeconstructFrame();
-  } else if (frame_access_state()->has_frame()) {
-    // Canonicalize JSFunction return sites for now unless they have an variable
-    // number of stack slot pops
-    if (pop->IsImmediate() && g.ToConstant(pop).ToInt32() == 0) {
-      if (return_label_.is_bound()) {
-        __ b(&return_label_);
-        return;
-      } else {
-        __ bind(&return_label_);
-        AssembleDeconstructFrame();
-      }
-    } else {
-      AssembleDeconstructFrame();
-    }
-  }
-  if (pop->IsImmediate()) {
-    DCHECK_EQ(Constant::kInt32, g.ToConstant(pop).type());
-    pop_count += g.ToConstant(pop).ToInt32();
-  } else {
-    __ Drop(g.ToRegister(pop));
-  }
-  __ Drop(pop_count);
-  __ Ret();
-}
-
-void CodeGenerator::FinishCode() {}
-
-void CodeGenerator::AssembleMove(InstructionOperand* source,
-                                 InstructionOperand* destination) {
-  S390OperandConverter g(this, nullptr);
-  // Dispatch on the source and destination operand kinds.  Not all
-  // combinations are possible.
-  if (source->IsRegister()) {
-    DCHECK(destination->IsRegister() || destination->IsStackSlot());
-    Register src = g.ToRegister(source);
-    if (destination->IsRegister()) {
-      __ Move(g.ToRegister(destination), src);
-    } else {
-      __ StoreP(src, g.ToMemOperand(destination));
-    }
-  } else if (source->IsStackSlot()) {
-    DCHECK(destination->IsRegister() || destination->IsStackSlot());
-    MemOperand src = g.ToMemOperand(source);
-    if (destination->IsRegister()) {
-      __ LoadP(g.ToRegister(destination), src);
-    } else {
-      Register temp = kScratchReg;
-      __ LoadP(temp, src, r0);
-      __ StoreP(temp, g.ToMemOperand(destination));
-    }
-  } else if (source->IsConstant()) {
-    Constant src = g.ToConstant(source);
-    if (destination->IsRegister() || destination->IsStackSlot()) {
-      Register dst =
-          destination->IsRegister() ? g.ToRegister(destination) : kScratchReg;
-      switch (src.type()) {
-        case Constant::kInt32:
-#if V8_TARGET_ARCH_S390X
-          if (RelocInfo::IsWasmSizeReference(src.rmode())) {
-#else
-          if (RelocInfo::IsWasmReference(src.rmode())) {
-#endif
-            __ mov(dst, Operand(src.ToInt32(), src.rmode()));
-          } else {
-            __ Load(dst, Operand(src.ToInt32()));
-          }
-          break;
-        case Constant::kInt64:
-#if V8_TARGET_ARCH_S390X
-          if (RelocInfo::IsWasmPtrReference(src.rmode())) {
-            __ mov(dst, Operand(src.ToInt64(), src.rmode()));
-          } else {
-            DCHECK(!RelocInfo::IsWasmSizeReference(src.rmode()));
-            __ Load(dst, Operand(src.ToInt64()));
-          }
-#else
-          __ mov(dst, Operand(src.ToInt64()));
-#endif  // V8_TARGET_ARCH_S390X
-          break;
-        case Constant::kFloat32:
-          __ mov(dst, Operand::EmbeddedNumber(src.ToFloat32()));
-          break;
-        case Constant::kFloat64:
-          __ mov(dst, Operand::EmbeddedNumber(src.ToFloat64().value()));
-          break;
-        case Constant::kExternalReference:
-          __ mov(dst, Operand(src.ToExternalReference()));
-          break;
-        case Constant::kHeapObject: {
-          Handle<HeapObject> src_object = src.ToHeapObject();
-          Heap::RootListIndex index;
-          if (IsMaterializableFromRoot(src_object, &index)) {
-            __ LoadRoot(dst, index);
-          } else {
-            __ Move(dst, src_object);
-          }
-          break;
-        }
-        case Constant::kRpoNumber:
-          UNREACHABLE();  // TODO(dcarney): loading RPO constants on S390.
-          break;
-      }
-      if (destination->IsStackSlot()) {
-        __ StoreP(dst, g.ToMemOperand(destination), r0);
-      }
-    } else {
-      DoubleRegister dst = destination->IsFPRegister()
-                               ? g.ToDoubleRegister(destination)
-                               : kScratchDoubleReg;
-      double value = (src.type() == Constant::kFloat32)
-                         ? src.ToFloat32()
-                         : src.ToFloat64().value();
-      if (src.type() == Constant::kFloat32) {
-        __ LoadFloat32Literal(dst, src.ToFloat32(), kScratchReg);
-      } else {
-        __ LoadDoubleLiteral(dst, value, kScratchReg);
-      }
-
-      if (destination->IsFloatStackSlot()) {
-        __ StoreFloat32(dst, g.ToMemOperand(destination));
-      } else if (destination->IsDoubleStackSlot()) {
-        __ StoreDouble(dst, g.ToMemOperand(destination));
-      }
-    }
-  } else if (source->IsFPRegister()) {
-    DoubleRegister src = g.ToDoubleRegister(source);
-    if (destination->IsFPRegister()) {
-      DoubleRegister dst = g.ToDoubleRegister(destination);
-      __ Move(dst, src);
-    } else {
-      DCHECK(destination->IsFPStackSlot());
-      LocationOperand* op = LocationOperand::cast(source);
-      if (op->representation() == MachineRepresentation::kFloat64) {
-        __ StoreDouble(src, g.ToMemOperand(destination));
-      } else {
-        __ StoreFloat32(src, g.ToMemOperand(destination));
-      }
-    }
-  } else if (source->IsFPStackSlot()) {
-    DCHECK(destination->IsFPRegister() || destination->IsFPStackSlot());
-    MemOperand src = g.ToMemOperand(source);
-    if (destination->IsFPRegister()) {
-      LocationOperand* op = LocationOperand::cast(source);
-      if (op->representation() == MachineRepresentation::kFloat64) {
-        __ LoadDouble(g.ToDoubleRegister(destination), src);
-      } else {
-        __ LoadFloat32(g.ToDoubleRegister(destination), src);
-      }
-    } else {
-      LocationOperand* op = LocationOperand::cast(source);
-      DoubleRegister temp = kScratchDoubleReg;
-      if (op->representation() == MachineRepresentation::kFloat64) {
-        __ LoadDouble(temp, src);
-        __ StoreDouble(temp, g.ToMemOperand(destination));
-      } else {
-        __ LoadFloat32(temp, src);
-        __ StoreFloat32(temp, g.ToMemOperand(destination));
-      }
-    }
-  } else {
-    UNREACHABLE();
-  }
-}
-
-// Swaping contents in source and destination.
-// source and destination could be:
-//   Register,
-//   FloatRegister,
-//   DoubleRegister,
-//   StackSlot,
-//   FloatStackSlot,
-//   or DoubleStackSlot
-void CodeGenerator::AssembleSwap(InstructionOperand* source,
-                                 InstructionOperand* destination) {
-  S390OperandConverter g(this, nullptr);
-  if (source->IsRegister()) {
-    Register src = g.ToRegister(source);
-    if (destination->IsRegister()) {
-      __ SwapP(src, g.ToRegister(destination), kScratchReg);
-    } else {
-      DCHECK(destination->IsStackSlot());
-      __ SwapP(src, g.ToMemOperand(destination), kScratchReg);
-    }
-  } else if (source->IsStackSlot()) {
-    DCHECK(destination->IsStackSlot());
-    __ SwapP(g.ToMemOperand(source), g.ToMemOperand(destination), kScratchReg,
-             r0);
-  } else if (source->IsFloatRegister()) {
-    DoubleRegister src = g.ToDoubleRegister(source);
-    if (destination->IsFloatRegister()) {
-      __ SwapFloat32(src, g.ToDoubleRegister(destination), kScratchDoubleReg);
-    } else {
-      DCHECK(destination->IsFloatStackSlot());
-      __ SwapFloat32(src, g.ToMemOperand(destination), kScratchDoubleReg);
-    }
-  } else if (source->IsDoubleRegister()) {
-    DoubleRegister src = g.ToDoubleRegister(source);
-    if (destination->IsDoubleRegister()) {
-      __ SwapDouble(src, g.ToDoubleRegister(destination), kScratchDoubleReg);
-    } else {
-      DCHECK(destination->IsDoubleStackSlot());
-      __ SwapDouble(src, g.ToMemOperand(destination), kScratchDoubleReg);
-    }
-  } else if (source->IsFloatStackSlot()) {
-    DCHECK(destination->IsFloatStackSlot());
-    __ SwapFloat32(g.ToMemOperand(source), g.ToMemOperand(destination),
-                   kScratchDoubleReg, d0);
-  } else if (source->IsDoubleStackSlot()) {
-    DCHECK(destination->IsDoubleStackSlot());
-    __ SwapDouble(g.ToMemOperand(source), g.ToMemOperand(destination),
-                  kScratchDoubleReg, d0);
-  } else if (source->IsSimd128Register()) {
-    UNREACHABLE();
-  } else {
-    UNREACHABLE();
-  }
-}
-
-void CodeGenerator::AssembleJumpTable(Label** targets, size_t target_count) {
-  for (size_t index = 0; index < target_count; ++index) {
-    __ emit_label_addr(targets[index]);
-  }
-}
-
-
-#undef __
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/s390/instruction-codes-s390.h b/src/v8/src/compiler/s390/instruction-codes-s390.h
deleted file mode 100644
index cb94da2..0000000
--- a/src/v8/src/compiler/s390/instruction-codes-s390.h
+++ /dev/null
@@ -1,187 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_S390_INSTRUCTION_CODES_S390_H_
-#define V8_COMPILER_S390_INSTRUCTION_CODES_S390_H_
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-// S390-specific opcodes that specify which assembly sequence to emit.
-// Most opcodes specify a single instruction.
-#define TARGET_ARCH_OPCODE_LIST(V) \
-  V(S390_Abs32)                    \
-  V(S390_Abs64)                    \
-  V(S390_And32)                    \
-  V(S390_And64)                    \
-  V(S390_Or32)                     \
-  V(S390_Or64)                     \
-  V(S390_Xor32)                    \
-  V(S390_Xor64)                    \
-  V(S390_ShiftLeft32)              \
-  V(S390_ShiftLeft64)              \
-  V(S390_ShiftLeftPair)            \
-  V(S390_ShiftRight32)             \
-  V(S390_ShiftRight64)             \
-  V(S390_ShiftRightPair)           \
-  V(S390_ShiftRightArith32)        \
-  V(S390_ShiftRightArith64)        \
-  V(S390_ShiftRightArithPair)      \
-  V(S390_RotRight32)               \
-  V(S390_RotRight64)               \
-  V(S390_Not32)                    \
-  V(S390_Not64)                    \
-  V(S390_RotLeftAndClear64)        \
-  V(S390_RotLeftAndClearLeft64)    \
-  V(S390_RotLeftAndClearRight64)   \
-  V(S390_Lay)                      \
-  V(S390_Add32)                    \
-  V(S390_Add64)                    \
-  V(S390_AddPair)                  \
-  V(S390_AddFloat)                 \
-  V(S390_AddDouble)                \
-  V(S390_Sub32)                    \
-  V(S390_Sub64)                    \
-  V(S390_SubFloat)                 \
-  V(S390_SubDouble)                \
-  V(S390_SubPair)                  \
-  V(S390_MulPair)                  \
-  V(S390_Mul32)                    \
-  V(S390_Mul32WithOverflow)        \
-  V(S390_Mul64)                    \
-  V(S390_MulHigh32)                \
-  V(S390_MulHighU32)               \
-  V(S390_MulFloat)                 \
-  V(S390_MulDouble)                \
-  V(S390_Div32)                    \
-  V(S390_Div64)                    \
-  V(S390_DivU32)                   \
-  V(S390_DivU64)                   \
-  V(S390_DivFloat)                 \
-  V(S390_DivDouble)                \
-  V(S390_Mod32)                    \
-  V(S390_Mod64)                    \
-  V(S390_ModU32)                   \
-  V(S390_ModU64)                   \
-  V(S390_ModDouble)                \
-  V(S390_Neg32)                    \
-  V(S390_Neg64)                    \
-  V(S390_NegDouble)                \
-  V(S390_NegFloat)                 \
-  V(S390_SqrtFloat)                \
-  V(S390_FloorFloat)               \
-  V(S390_CeilFloat)                \
-  V(S390_TruncateFloat)            \
-  V(S390_AbsFloat)                 \
-  V(S390_SqrtDouble)               \
-  V(S390_FloorDouble)              \
-  V(S390_CeilDouble)               \
-  V(S390_TruncateDouble)           \
-  V(S390_RoundDouble)              \
-  V(S390_MaxFloat)                 \
-  V(S390_MaxDouble)                \
-  V(S390_MinFloat)                 \
-  V(S390_MinDouble)                \
-  V(S390_AbsDouble)                \
-  V(S390_Cntlz32)                  \
-  V(S390_Cntlz64)                  \
-  V(S390_Popcnt32)                 \
-  V(S390_Popcnt64)                 \
-  V(S390_Cmp32)                    \
-  V(S390_Cmp64)                    \
-  V(S390_CmpFloat)                 \
-  V(S390_CmpDouble)                \
-  V(S390_Tst32)                    \
-  V(S390_Tst64)                    \
-  V(S390_Push)                     \
-  V(S390_PushFrame)                \
-  V(S390_StackClaim)               \
-  V(S390_StoreToStackSlot)         \
-  V(S390_ExtendSignWord8)          \
-  V(S390_ExtendSignWord16)         \
-  V(S390_ExtendSignWord32)         \
-  V(S390_Uint32ToUint64)           \
-  V(S390_Int64ToInt32)             \
-  V(S390_Int64ToFloat32)           \
-  V(S390_Int64ToDouble)            \
-  V(S390_Uint64ToFloat32)          \
-  V(S390_Uint64ToDouble)           \
-  V(S390_Int32ToFloat32)           \
-  V(S390_Int32ToDouble)            \
-  V(S390_Uint32ToFloat32)          \
-  V(S390_Uint32ToDouble)           \
-  V(S390_Float32ToInt64)           \
-  V(S390_Float32ToUint64)          \
-  V(S390_Float32ToInt32)           \
-  V(S390_Float32ToUint32)          \
-  V(S390_Float32ToDouble)          \
-  V(S390_Float64SilenceNaN)        \
-  V(S390_DoubleToInt32)            \
-  V(S390_DoubleToUint32)           \
-  V(S390_DoubleToInt64)            \
-  V(S390_DoubleToUint64)           \
-  V(S390_DoubleToFloat32)          \
-  V(S390_DoubleExtractLowWord32)   \
-  V(S390_DoubleExtractHighWord32)  \
-  V(S390_DoubleInsertLowWord32)    \
-  V(S390_DoubleInsertHighWord32)   \
-  V(S390_DoubleConstruct)          \
-  V(S390_BitcastInt32ToFloat32)    \
-  V(S390_BitcastFloat32ToInt32)    \
-  V(S390_BitcastInt64ToDouble)     \
-  V(S390_BitcastDoubleToInt64)     \
-  V(S390_LoadWordS8)               \
-  V(S390_LoadWordU8)               \
-  V(S390_LoadWordS16)              \
-  V(S390_LoadWordU16)              \
-  V(S390_LoadWordS32)              \
-  V(S390_LoadWordU32)              \
-  V(S390_LoadAndTestWord32)        \
-  V(S390_LoadAndTestWord64)        \
-  V(S390_LoadAndTestFloat32)       \
-  V(S390_LoadAndTestFloat64)       \
-  V(S390_LoadReverse16RR)          \
-  V(S390_LoadReverse32RR)          \
-  V(S390_LoadReverse64RR)          \
-  V(S390_LoadReverse16)            \
-  V(S390_LoadReverse32)            \
-  V(S390_LoadReverse64)            \
-  V(S390_LoadWord64)               \
-  V(S390_LoadFloat32)              \
-  V(S390_LoadDouble)               \
-  V(S390_StoreWord8)               \
-  V(S390_StoreWord16)              \
-  V(S390_StoreWord32)              \
-  V(S390_StoreWord64)              \
-  V(S390_StoreReverse16)           \
-  V(S390_StoreReverse32)           \
-  V(S390_StoreReverse64)           \
-  V(S390_StoreFloat32)             \
-  V(S390_StoreDouble)
-
-// Addressing modes represent the "shape" of inputs to an instruction.
-// Many instructions support multiple addressing modes. Addressing modes
-// are encoded into the InstructionCode of the instruction and tell the
-// code generator after register allocation which assembler method to call.
-//
-// We use the following local notation for addressing modes:
-//
-// R = register
-// O = register or stack slot
-// D = double register
-// I = immediate (handle, external, int32)
-// MRI = [register + immediate]
-// MRR = [register + register]
-#define TARGET_ADDRESSING_MODE_LIST(V) \
-  V(MR)   /* [%r0          ] */        \
-  V(MRI)  /* [%r0       + K] */        \
-  V(MRR)  /* [%r0 + %r1    ] */        \
-  V(MRRI) /* [%r0 + %r1 + K] */
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_COMPILER_S390_INSTRUCTION_CODES_S390_H_
diff --git a/src/v8/src/compiler/s390/instruction-scheduler-s390.cc b/src/v8/src/compiler/s390/instruction-scheduler-s390.cc
deleted file mode 100644
index 1850830..0000000
--- a/src/v8/src/compiler/s390/instruction-scheduler-s390.cc
+++ /dev/null
@@ -1,187 +0,0 @@
-// Copyright 2015 the V8 project 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 "src/compiler/instruction-scheduler.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-bool InstructionScheduler::SchedulerSupported() { return true; }
-
-int InstructionScheduler::GetTargetInstructionFlags(
-    const Instruction* instr) const {
-  switch (instr->arch_opcode()) {
-    case kS390_Abs32:
-    case kS390_Abs64:
-    case kS390_And32:
-    case kS390_And64:
-    case kS390_Or32:
-    case kS390_Or64:
-    case kS390_Xor32:
-    case kS390_Xor64:
-    case kS390_ShiftLeft32:
-    case kS390_ShiftLeft64:
-    case kS390_ShiftLeftPair:
-    case kS390_ShiftRight32:
-    case kS390_ShiftRight64:
-    case kS390_ShiftRightPair:
-    case kS390_ShiftRightArith32:
-    case kS390_ShiftRightArith64:
-    case kS390_ShiftRightArithPair:
-    case kS390_RotRight32:
-    case kS390_RotRight64:
-    case kS390_Not32:
-    case kS390_Not64:
-    case kS390_RotLeftAndClear64:
-    case kS390_RotLeftAndClearLeft64:
-    case kS390_RotLeftAndClearRight64:
-    case kS390_Lay:
-    case kS390_Add32:
-    case kS390_Add64:
-    case kS390_AddPair:
-    case kS390_AddFloat:
-    case kS390_AddDouble:
-    case kS390_Sub32:
-    case kS390_Sub64:
-    case kS390_SubPair:
-    case kS390_MulPair:
-    case kS390_SubFloat:
-    case kS390_SubDouble:
-    case kS390_Mul32:
-    case kS390_Mul32WithOverflow:
-    case kS390_Mul64:
-    case kS390_MulHigh32:
-    case kS390_MulHighU32:
-    case kS390_MulFloat:
-    case kS390_MulDouble:
-    case kS390_Div32:
-    case kS390_Div64:
-    case kS390_DivU32:
-    case kS390_DivU64:
-    case kS390_DivFloat:
-    case kS390_DivDouble:
-    case kS390_Mod32:
-    case kS390_Mod64:
-    case kS390_ModU32:
-    case kS390_ModU64:
-    case kS390_ModDouble:
-    case kS390_Neg32:
-    case kS390_Neg64:
-    case kS390_NegDouble:
-    case kS390_NegFloat:
-    case kS390_SqrtFloat:
-    case kS390_FloorFloat:
-    case kS390_CeilFloat:
-    case kS390_TruncateFloat:
-    case kS390_AbsFloat:
-    case kS390_SqrtDouble:
-    case kS390_FloorDouble:
-    case kS390_CeilDouble:
-    case kS390_TruncateDouble:
-    case kS390_RoundDouble:
-    case kS390_MaxFloat:
-    case kS390_MaxDouble:
-    case kS390_MinFloat:
-    case kS390_MinDouble:
-    case kS390_AbsDouble:
-    case kS390_Cntlz32:
-    case kS390_Cntlz64:
-    case kS390_Popcnt32:
-    case kS390_Popcnt64:
-    case kS390_Cmp32:
-    case kS390_Cmp64:
-    case kS390_CmpFloat:
-    case kS390_CmpDouble:
-    case kS390_Tst32:
-    case kS390_Tst64:
-    case kS390_ExtendSignWord8:
-    case kS390_ExtendSignWord16:
-    case kS390_ExtendSignWord32:
-    case kS390_Uint32ToUint64:
-    case kS390_Int64ToInt32:
-    case kS390_Int64ToFloat32:
-    case kS390_Int64ToDouble:
-    case kS390_Uint64ToFloat32:
-    case kS390_Uint64ToDouble:
-    case kS390_Int32ToFloat32:
-    case kS390_Int32ToDouble:
-    case kS390_Uint32ToFloat32:
-    case kS390_Uint32ToDouble:
-    case kS390_Float32ToInt32:
-    case kS390_Float32ToUint32:
-    case kS390_Float32ToUint64:
-    case kS390_Float32ToDouble:
-    case kS390_Float64SilenceNaN:
-    case kS390_DoubleToInt32:
-    case kS390_DoubleToUint32:
-    case kS390_Float32ToInt64:
-    case kS390_DoubleToInt64:
-    case kS390_DoubleToUint64:
-    case kS390_DoubleToFloat32:
-    case kS390_DoubleExtractLowWord32:
-    case kS390_DoubleExtractHighWord32:
-    case kS390_DoubleInsertLowWord32:
-    case kS390_DoubleInsertHighWord32:
-    case kS390_DoubleConstruct:
-    case kS390_BitcastInt32ToFloat32:
-    case kS390_BitcastFloat32ToInt32:
-    case kS390_BitcastInt64ToDouble:
-    case kS390_BitcastDoubleToInt64:
-    case kS390_LoadReverse16RR:
-    case kS390_LoadReverse32RR:
-    case kS390_LoadReverse64RR:
-    case kS390_LoadAndTestWord32:
-    case kS390_LoadAndTestWord64:
-    case kS390_LoadAndTestFloat32:
-    case kS390_LoadAndTestFloat64:
-      return kNoOpcodeFlags;
-
-    case kS390_LoadWordS8:
-    case kS390_LoadWordU8:
-    case kS390_LoadWordS16:
-    case kS390_LoadWordU16:
-    case kS390_LoadWordS32:
-    case kS390_LoadWordU32:
-    case kS390_LoadWord64:
-    case kS390_LoadFloat32:
-    case kS390_LoadDouble:
-    case kS390_LoadReverse16:
-    case kS390_LoadReverse32:
-    case kS390_LoadReverse64:
-      return kIsLoadOperation;
-
-    case kS390_StoreWord8:
-    case kS390_StoreWord16:
-    case kS390_StoreWord32:
-    case kS390_StoreWord64:
-    case kS390_StoreReverse16:
-    case kS390_StoreReverse32:
-    case kS390_StoreReverse64:
-    case kS390_StoreFloat32:
-    case kS390_StoreDouble:
-    case kS390_Push:
-    case kS390_PushFrame:
-    case kS390_StoreToStackSlot:
-    case kS390_StackClaim:
-      return kHasSideEffect;
-
-#define CASE(Name) case k##Name:
-      COMMON_ARCH_OPCODE_LIST(CASE)
-#undef CASE
-      // Already covered in architecture independent code.
-      UNREACHABLE();
-  }
-
-  UNREACHABLE();
-}
-
-int InstructionScheduler::GetInstructionLatency(const Instruction* instr) {
-  // TODO(all): Add instruction cost modeling.
-  return 1;
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/s390/instruction-selector-s390.cc b/src/v8/src/compiler/s390/instruction-selector-s390.cc
deleted file mode 100644
index 457c5a1..0000000
--- a/src/v8/src/compiler/s390/instruction-selector-s390.cc
+++ /dev/null
@@ -1,2618 +0,0 @@
-// Copyright 2015 the V8 project 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 "src/base/adapters.h"
-#include "src/compiler/instruction-selector-impl.h"
-#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties.h"
-#include "src/frame-constants.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-enum class OperandMode : uint32_t {
-  kNone = 0u,
-  // Immediate mode
-  kShift32Imm = 1u << 0,
-  kShift64Imm = 1u << 1,
-  kInt32Imm = 1u << 2,
-  kInt32Imm_Negate = 1u << 3,
-  kUint32Imm = 1u << 4,
-  kInt20Imm = 1u << 5,
-  kUint12Imm = 1u << 6,
-  // Instr format
-  kAllowRRR = 1u << 7,
-  kAllowRM = 1u << 8,
-  kAllowRI = 1u << 9,
-  kAllowRRI = 1u << 10,
-  kAllowRRM = 1u << 11,
-  // Useful combination
-  kAllowImmediate = kAllowRI | kAllowRRI,
-  kAllowMemoryOperand = kAllowRM | kAllowRRM,
-  kAllowDistinctOps = kAllowRRR | kAllowRRI | kAllowRRM,
-  kBitWiseCommonMode = kAllowRI,
-  kArithmeticCommonMode = kAllowRM | kAllowRI
-};
-
-typedef base::Flags<OperandMode, uint32_t> OperandModes;
-DEFINE_OPERATORS_FOR_FLAGS(OperandModes);
-OperandModes immediateModeMask =
-    OperandMode::kShift32Imm | OperandMode::kShift64Imm |
-    OperandMode::kInt32Imm | OperandMode::kInt32Imm_Negate |
-    OperandMode::kUint32Imm | OperandMode::kInt20Imm;
-
-#define AndCommonMode                                                \
-  ((OperandMode::kAllowRM |                                          \
-    (CpuFeatures::IsSupported(DISTINCT_OPS) ? OperandMode::kAllowRRR \
-                                            : OperandMode::kNone)))
-#define And64OperandMode AndCommonMode
-#define Or64OperandMode And64OperandMode
-#define Xor64OperandMode And64OperandMode
-
-#define And32OperandMode \
-  (AndCommonMode | OperandMode::kAllowRI | OperandMode::kUint32Imm)
-#define Or32OperandMode And32OperandMode
-#define Xor32OperandMode And32OperandMode
-
-#define Shift32OperandMode                                   \
-  ((OperandMode::kAllowRI | OperandMode::kShift64Imm |       \
-    (CpuFeatures::IsSupported(DISTINCT_OPS)                  \
-         ? (OperandMode::kAllowRRR | OperandMode::kAllowRRI) \
-         : OperandMode::kNone)))
-
-#define Shift64OperandMode                             \
-  ((OperandMode::kAllowRI | OperandMode::kShift64Imm | \
-    OperandMode::kAllowRRR | OperandMode::kAllowRRI))
-
-#define AddOperandMode                                            \
-  ((OperandMode::kArithmeticCommonMode | OperandMode::kInt32Imm | \
-    (CpuFeatures::IsSupported(DISTINCT_OPS)                       \
-         ? (OperandMode::kAllowRRR | OperandMode::kAllowRRI)      \
-         : OperandMode::kArithmeticCommonMode)))
-#define SubOperandMode                                                   \
-  ((OperandMode::kArithmeticCommonMode | OperandMode::kInt32Imm_Negate | \
-    (CpuFeatures::IsSupported(DISTINCT_OPS)                              \
-         ? (OperandMode::kAllowRRR | OperandMode::kAllowRRI)             \
-         : OperandMode::kArithmeticCommonMode)))
-#define MulOperandMode \
-  (OperandMode::kArithmeticCommonMode | OperandMode::kInt32Imm)
-
-// Adds S390-specific methods for generating operands.
-class S390OperandGenerator final : public OperandGenerator {
- public:
-  explicit S390OperandGenerator(InstructionSelector* selector)
-      : OperandGenerator(selector) {}
-
-  InstructionOperand UseOperand(Node* node, OperandModes mode) {
-    if (CanBeImmediate(node, mode)) {
-      return UseImmediate(node);
-    }
-    return UseRegister(node);
-  }
-
-  InstructionOperand UseAnyExceptImmediate(Node* node) {
-    if (NodeProperties::IsConstant(node))
-      return UseRegister(node);
-    else
-      return Use(node);
-  }
-
-  int64_t GetImmediate(Node* node) {
-    if (node->opcode() == IrOpcode::kInt32Constant)
-      return OpParameter<int32_t>(node);
-    else if (node->opcode() == IrOpcode::kInt64Constant)
-      return OpParameter<int64_t>(node);
-    else
-      UNIMPLEMENTED();
-    return 0L;
-  }
-
-  bool CanBeImmediate(Node* node, OperandModes mode) {
-    int64_t value;
-    if (node->opcode() == IrOpcode::kInt32Constant)
-      value = OpParameter<int32_t>(node);
-    else if (node->opcode() == IrOpcode::kInt64Constant)
-      value = OpParameter<int64_t>(node);
-    else
-      return false;
-    return CanBeImmediate(value, mode);
-  }
-
-  bool CanBeImmediate(int64_t value, OperandModes mode) {
-    if (mode & OperandMode::kShift32Imm)
-      return 0 <= value && value < 32;
-    else if (mode & OperandMode::kShift64Imm)
-      return 0 <= value && value < 64;
-    else if (mode & OperandMode::kInt32Imm)
-      return is_int32(value);
-    else if (mode & OperandMode::kInt32Imm_Negate)
-      return is_int32(-value);
-    else if (mode & OperandMode::kUint32Imm)
-      return is_uint32(value);
-    else if (mode & OperandMode::kInt20Imm)
-      return is_int20(value);
-    else if (mode & OperandMode::kUint12Imm)
-      return is_uint12(value);
-    else
-      return false;
-  }
-
-  bool CanBeMemoryOperand(InstructionCode opcode, Node* user, Node* input,
-                          int effect_level) {
-    if (input->opcode() != IrOpcode::kLoad ||
-        !selector()->CanCover(user, input)) {
-      return false;
-    }
-
-    if (effect_level != selector()->GetEffectLevel(input)) {
-      return false;
-    }
-
-    MachineRepresentation rep =
-        LoadRepresentationOf(input->op()).representation();
-    switch (opcode) {
-      case kS390_Cmp64:
-      case kS390_LoadAndTestWord64:
-        return rep == MachineRepresentation::kWord64 || IsAnyTagged(rep);
-      case kS390_LoadAndTestWord32:
-      case kS390_Cmp32:
-        return rep == MachineRepresentation::kWord32;
-      default:
-        break;
-    }
-    return false;
-  }
-
-  AddressingMode GenerateMemoryOperandInputs(Node* index, Node* base,
-                                             Node* displacement,
-                                             DisplacementMode displacement_mode,
-                                             InstructionOperand inputs[],
-                                             size_t* input_count) {
-    AddressingMode mode = kMode_MRI;
-    if (base != nullptr) {
-      inputs[(*input_count)++] = UseRegister(base);
-      if (index != nullptr) {
-        inputs[(*input_count)++] = UseRegister(index);
-        if (displacement != nullptr) {
-          inputs[(*input_count)++] = displacement_mode
-                                         ? UseNegatedImmediate(displacement)
-                                         : UseImmediate(displacement);
-          mode = kMode_MRRI;
-        } else {
-          mode = kMode_MRR;
-        }
-      } else {
-        if (displacement == nullptr) {
-          mode = kMode_MR;
-        } else {
-          inputs[(*input_count)++] = displacement_mode == kNegativeDisplacement
-                                         ? UseNegatedImmediate(displacement)
-                                         : UseImmediate(displacement);
-          mode = kMode_MRI;
-        }
-      }
-    } else {
-      DCHECK_NOT_NULL(index);
-      inputs[(*input_count)++] = UseRegister(index);
-      if (displacement != nullptr) {
-        inputs[(*input_count)++] = displacement_mode == kNegativeDisplacement
-                                       ? UseNegatedImmediate(displacement)
-                                       : UseImmediate(displacement);
-        mode = kMode_MRI;
-      } else {
-        mode = kMode_MR;
-      }
-    }
-    return mode;
-  }
-
-  AddressingMode GetEffectiveAddressMemoryOperand(
-      Node* operand, InstructionOperand inputs[], size_t* input_count,
-      OperandModes immediate_mode = OperandMode::kInt20Imm) {
-#if V8_TARGET_ARCH_S390X
-    BaseWithIndexAndDisplacement64Matcher m(operand,
-                                            AddressOption::kAllowInputSwap);
-#else
-    BaseWithIndexAndDisplacement32Matcher m(operand,
-                                            AddressOption::kAllowInputSwap);
-#endif
-    DCHECK(m.matches());
-    if ((m.displacement() == nullptr ||
-         CanBeImmediate(m.displacement(), immediate_mode))) {
-      DCHECK_EQ(0, m.scale());
-      return GenerateMemoryOperandInputs(m.index(), m.base(), m.displacement(),
-                                         m.displacement_mode(), inputs,
-                                         input_count);
-    } else {
-      inputs[(*input_count)++] = UseRegister(operand->InputAt(0));
-      inputs[(*input_count)++] = UseRegister(operand->InputAt(1));
-      return kMode_MRR;
-    }
-  }
-
-  bool CanBeBetterLeftOperand(Node* node) const {
-    return !selector()->IsLive(node);
-  }
-
-  MachineRepresentation GetRepresentation(Node* node) {
-    return sequence()->GetRepresentation(selector()->GetVirtualRegister(node));
-  }
-
-  bool Is64BitOperand(Node* node) {
-    return MachineRepresentation::kWord64 == GetRepresentation(node);
-  }
-};
-
-namespace {
-
-bool S390OpcodeOnlySupport12BitDisp(ArchOpcode opcode) {
-  switch (opcode) {
-    case kS390_AddFloat:
-    case kS390_AddDouble:
-    case kS390_CmpFloat:
-    case kS390_CmpDouble:
-    case kS390_Float32ToDouble:
-      return true;
-    default:
-      return false;
-  }
-}
-
-bool S390OpcodeOnlySupport12BitDisp(InstructionCode op) {
-  ArchOpcode opcode = ArchOpcodeField::decode(op);
-  return S390OpcodeOnlySupport12BitDisp(opcode);
-}
-
-#define OpcodeImmMode(op)                                       \
-  (S390OpcodeOnlySupport12BitDisp(op) ? OperandMode::kUint12Imm \
-                                      : OperandMode::kInt20Imm)
-
-ArchOpcode SelectLoadOpcode(Node* node) {
-  NodeMatcher m(node);
-  DCHECK(m.IsLoad());
-  LoadRepresentation load_rep = LoadRepresentationOf(node->op());
-  ArchOpcode opcode = kArchNop;
-  switch (load_rep.representation()) {
-    case MachineRepresentation::kFloat32:
-      opcode = kS390_LoadFloat32;
-      break;
-    case MachineRepresentation::kFloat64:
-      opcode = kS390_LoadDouble;
-      break;
-    case MachineRepresentation::kBit:  // Fall through.
-    case MachineRepresentation::kWord8:
-      opcode = load_rep.IsSigned() ? kS390_LoadWordS8 : kS390_LoadWordU8;
-      break;
-    case MachineRepresentation::kWord16:
-      opcode = load_rep.IsSigned() ? kS390_LoadWordS16 : kS390_LoadWordU16;
-      break;
-#if !V8_TARGET_ARCH_S390X
-    case MachineRepresentation::kTaggedSigned:   // Fall through.
-    case MachineRepresentation::kTaggedPointer:  // Fall through.
-    case MachineRepresentation::kTagged:         // Fall through.
-#endif
-    case MachineRepresentation::kWord32:
-      opcode = kS390_LoadWordU32;
-      break;
-#if V8_TARGET_ARCH_S390X
-    case MachineRepresentation::kTaggedSigned:   // Fall through.
-    case MachineRepresentation::kTaggedPointer:  // Fall through.
-    case MachineRepresentation::kTagged:         // Fall through.
-    case MachineRepresentation::kWord64:
-      opcode = kS390_LoadWord64;
-      break;
-#else
-    case MachineRepresentation::kWord64:  // Fall through.
-#endif
-    case MachineRepresentation::kSimd128:  // Fall through.
-    case MachineRepresentation::kNone:
-    default:
-      UNREACHABLE();
-  }
-  return opcode;
-}
-
-#define RESULT_IS_WORD32_LIST(V)   \
-  /* Float unary op*/              \
-  V(BitcastFloat32ToInt32)         \
-  /* V(TruncateFloat64ToWord32) */ \
-  /* V(RoundFloat64ToInt32)     */ \
-  /* V(TruncateFloat32ToInt32)  */ \
-  /* V(TruncateFloat32ToUint32) */ \
-  /* V(TruncateFloat64ToUint32) */ \
-  /* V(ChangeFloat64ToInt32)    */ \
-  /* V(ChangeFloat64ToUint32)   */ \
-  /* Word32 unary op */            \
-  V(Word32Clz)                     \
-  V(Word32Popcnt)                  \
-  V(Float64ExtractLowWord32)       \
-  V(Float64ExtractHighWord32)      \
-  /* Word32 bin op */              \
-  V(Int32Add)                      \
-  V(Int32Sub)                      \
-  V(Int32Mul)                      \
-  V(Int32AddWithOverflow)          \
-  V(Int32SubWithOverflow)          \
-  V(Int32MulWithOverflow)          \
-  V(Int32MulHigh)                  \
-  V(Uint32MulHigh)                 \
-  V(Int32Div)                      \
-  V(Uint32Div)                     \
-  V(Int32Mod)                      \
-  V(Uint32Mod)                     \
-  V(Word32Ror)                     \
-  V(Word32And)                     \
-  V(Word32Or)                      \
-  V(Word32Xor)                     \
-  V(Word32Shl)                     \
-  V(Word32Shr)                     \
-  V(Word32Sar)
-
-bool ProduceWord32Result(Node* node) {
-#if !V8_TARGET_ARCH_S390X
-  return true;
-#else
-  switch (node->opcode()) {
-#define VISITOR(name) case IrOpcode::k##name:
-    RESULT_IS_WORD32_LIST(VISITOR)
-#undef VISITOR
-    return true;
-    // TODO(john.yan): consider the following case to be valid
-    // case IrOpcode::kWord32Equal:
-    // case IrOpcode::kInt32LessThan:
-    // case IrOpcode::kInt32LessThanOrEqual:
-    // case IrOpcode::kUint32LessThan:
-    // case IrOpcode::kUint32LessThanOrEqual:
-    // case IrOpcode::kUint32MulHigh:
-    //   // These 32-bit operations implicitly zero-extend to 64-bit on x64, so
-    //   the
-    //   // zero-extension is a no-op.
-    //   return true;
-    // case IrOpcode::kProjection: {
-    //   Node* const value = node->InputAt(0);
-    //   switch (value->opcode()) {
-    //     case IrOpcode::kInt32AddWithOverflow:
-    //     case IrOpcode::kInt32SubWithOverflow:
-    //     case IrOpcode::kInt32MulWithOverflow:
-    //       return true;
-    //     default:
-    //       return false;
-    //   }
-    // }
-    case IrOpcode::kLoad: {
-      LoadRepresentation load_rep = LoadRepresentationOf(node->op());
-      switch (load_rep.representation()) {
-        case MachineRepresentation::kWord32:
-          return true;
-        case MachineRepresentation::kWord8:
-          if (load_rep.IsSigned())
-            return false;
-          else
-            return true;
-        default:
-          return false;
-      }
-    }
-    default:
-      return false;
-  }
-#endif
-}
-
-static inline bool DoZeroExtForResult(Node* node) {
-#if V8_TARGET_ARCH_S390X
-  return ProduceWord32Result(node);
-#else
-  return false;
-#endif
-}
-
-// TODO(john.yan): Create VisiteShift to match dst = src shift (R+I)
-#if 0
-void VisitShift() { }
-#endif
-
-#if V8_TARGET_ARCH_S390X
-void VisitTryTruncateDouble(InstructionSelector* selector, ArchOpcode opcode,
-                            Node* node) {
-  S390OperandGenerator g(selector);
-  InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))};
-  InstructionOperand outputs[2];
-  size_t output_count = 0;
-  outputs[output_count++] = g.DefineAsRegister(node);
-
-  Node* success_output = NodeProperties::FindProjection(node, 1);
-  if (success_output) {
-    outputs[output_count++] = g.DefineAsRegister(success_output);
-  }
-
-  selector->Emit(opcode, output_count, outputs, 1, inputs);
-}
-#endif
-
-template <class CanCombineWithLoad>
-void GenerateRightOperands(InstructionSelector* selector, Node* node,
-                           Node* right, InstructionCode& opcode,
-                           OperandModes& operand_mode,
-                           InstructionOperand* inputs, size_t& input_count,
-                           CanCombineWithLoad canCombineWithLoad) {
-  S390OperandGenerator g(selector);
-
-  if ((operand_mode & OperandMode::kAllowImmediate) &&
-      g.CanBeImmediate(right, operand_mode)) {
-    inputs[input_count++] = g.UseImmediate(right);
-    // Can only be RI or RRI
-    operand_mode &= OperandMode::kAllowImmediate;
-  } else if (operand_mode & OperandMode::kAllowMemoryOperand) {
-    NodeMatcher mright(right);
-    if (mright.IsLoad() && selector->CanCover(node, right) &&
-        canCombineWithLoad(SelectLoadOpcode(right))) {
-      AddressingMode mode = g.GetEffectiveAddressMemoryOperand(
-          right, inputs, &input_count, OpcodeImmMode(opcode));
-      opcode |= AddressingModeField::encode(mode);
-      operand_mode &= ~OperandMode::kAllowImmediate;
-      if (operand_mode & OperandMode::kAllowRM)
-        operand_mode &= ~OperandMode::kAllowDistinctOps;
-    } else if (operand_mode & OperandMode::kAllowRM) {
-      DCHECK(!(operand_mode & OperandMode::kAllowRRM));
-      inputs[input_count++] = g.UseAnyExceptImmediate(right);
-      // Can not be Immediate
-      operand_mode &=
-          ~OperandMode::kAllowImmediate & ~OperandMode::kAllowDistinctOps;
-    } else if (operand_mode & OperandMode::kAllowRRM) {
-      DCHECK(!(operand_mode & OperandMode::kAllowRM));
-      inputs[input_count++] = g.UseAnyExceptImmediate(right);
-      // Can not be Immediate
-      operand_mode &= ~OperandMode::kAllowImmediate;
-    } else {
-      UNREACHABLE();
-    }
-  } else {
-    inputs[input_count++] = g.UseRegister(right);
-    // Can only be RR or RRR
-    operand_mode &= OperandMode::kAllowRRR;
-  }
-}
-
-template <class CanCombineWithLoad>
-void GenerateBinOpOperands(InstructionSelector* selector, Node* node,
-                           Node* left, Node* right, InstructionCode& opcode,
-                           OperandModes& operand_mode,
-                           InstructionOperand* inputs, size_t& input_count,
-                           CanCombineWithLoad canCombineWithLoad) {
-  S390OperandGenerator g(selector);
-  // left is always register
-  InstructionOperand const left_input = g.UseRegister(left);
-  inputs[input_count++] = left_input;
-
-  if (left == right) {
-    inputs[input_count++] = left_input;
-    // Can only be RR or RRR
-    operand_mode &= OperandMode::kAllowRRR;
-  } else {
-    GenerateRightOperands(selector, node, right, opcode, operand_mode, inputs,
-                          input_count, canCombineWithLoad);
-  }
-}
-
-template <class CanCombineWithLoad>
-void VisitUnaryOp(InstructionSelector* selector, Node* node,
-                  InstructionCode opcode, OperandModes operand_mode,
-                  FlagsContinuation* cont,
-                  CanCombineWithLoad canCombineWithLoad);
-
-template <class CanCombineWithLoad>
-void VisitBinOp(InstructionSelector* selector, Node* node,
-                InstructionCode opcode, OperandModes operand_mode,
-                FlagsContinuation* cont, CanCombineWithLoad canCombineWithLoad);
-
-// Generate The following variations:
-//   VisitWord32UnaryOp, VisitWord32BinOp,
-//   VisitWord64UnaryOp, VisitWord64BinOp,
-//   VisitFloat32UnaryOp, VisitFloat32BinOp,
-//   VisitFloat64UnaryOp, VisitFloat64BinOp
-#define VISIT_OP_LIST_32(V)                                            \
-  V(Word32, Unary, [](ArchOpcode opcode) {                             \
-    return opcode == kS390_LoadWordS32 || opcode == kS390_LoadWordU32; \
-  })                                                                   \
-  V(Word64, Unary,                                                     \
-    [](ArchOpcode opcode) { return opcode == kS390_LoadWord64; })      \
-  V(Float32, Unary,                                                    \
-    [](ArchOpcode opcode) { return opcode == kS390_LoadFloat32; })     \
-  V(Float64, Unary,                                                    \
-    [](ArchOpcode opcode) { return opcode == kS390_LoadDouble; })      \
-  V(Word32, Bin, [](ArchOpcode opcode) {                               \
-    return opcode == kS390_LoadWordS32 || opcode == kS390_LoadWordU32; \
-  })                                                                   \
-  V(Float32, Bin,                                                      \
-    [](ArchOpcode opcode) { return opcode == kS390_LoadFloat32; })     \
-  V(Float64, Bin, [](ArchOpcode opcode) { return opcode == kS390_LoadDouble; })
-
-#if V8_TARGET_ARCH_S390X
-#define VISIT_OP_LIST(V)                                          \
-  VISIT_OP_LIST_32(V)                                             \
-  V(Word64, Bin, [](ArchOpcode opcode) { return opcode == kS390_LoadWord64; })
-#else
-#define VISIT_OP_LIST VISIT_OP_LIST_32
-#endif
-
-#define DECLARE_VISIT_HELPER_FUNCTIONS(type1, type2, canCombineWithLoad)  \
-  static inline void Visit##type1##type2##Op(                             \
-      InstructionSelector* selector, Node* node, InstructionCode opcode,  \
-      OperandModes operand_mode, FlagsContinuation* cont) {               \
-    Visit##type2##Op(selector, node, opcode, operand_mode, cont,          \
-                     canCombineWithLoad);                                 \
-  }                                                                       \
-  static inline void Visit##type1##type2##Op(                             \
-      InstructionSelector* selector, Node* node, InstructionCode opcode,  \
-      OperandModes operand_mode) {                                        \
-    FlagsContinuation cont;                                               \
-    Visit##type1##type2##Op(selector, node, opcode, operand_mode, &cont); \
-  }
-VISIT_OP_LIST(DECLARE_VISIT_HELPER_FUNCTIONS);
-#undef DECLARE_VISIT_HELPER_FUNCTIONS
-#undef VISIT_OP_LIST_32
-#undef VISIT_OP_LIST
-
-template <class CanCombineWithLoad>
-void VisitUnaryOp(InstructionSelector* selector, Node* node,
-                  InstructionCode opcode, OperandModes operand_mode,
-                  FlagsContinuation* cont,
-                  CanCombineWithLoad canCombineWithLoad) {
-  S390OperandGenerator g(selector);
-  InstructionOperand inputs[8];
-  size_t input_count = 0;
-  InstructionOperand outputs[2];
-  size_t output_count = 0;
-  Node* input = node->InputAt(0);
-
-  GenerateRightOperands(selector, node, input, opcode, operand_mode, inputs,
-                        input_count, canCombineWithLoad);
-
-  bool input_is_word32 = ProduceWord32Result(input);
-
-  bool doZeroExt = DoZeroExtForResult(node);
-  bool canEliminateZeroExt = input_is_word32;
-
-  if (doZeroExt) {
-    // Add zero-ext indication
-    inputs[input_count++] = g.TempImmediate(!canEliminateZeroExt);
-  }
-
-  if (cont->IsBranch()) {
-    inputs[input_count++] = g.Label(cont->true_block());
-    inputs[input_count++] = g.Label(cont->false_block());
-  }
-
-  if (!cont->IsDeoptimize()) {
-    // If we can deoptimize as a result of the binop, we need to make sure
-    // that the deopt inputs are not overwritten by the binop result. One way
-    // to achieve that is to declare the output register as same-as-first.
-    if (doZeroExt && canEliminateZeroExt) {
-      // we have to make sure result and left use the same register
-      outputs[output_count++] = g.DefineSameAsFirst(node);
-    } else {
-      outputs[output_count++] = g.DefineAsRegister(node);
-    }
-  } else {
-    outputs[output_count++] = g.DefineSameAsFirst(node);
-  }
-
-  if (cont->IsSet()) {
-    outputs[output_count++] = g.DefineAsRegister(cont->result());
-  }
-
-  DCHECK_NE(0u, input_count);
-  DCHECK_NE(0u, output_count);
-  DCHECK_GE(arraysize(inputs), input_count);
-  DCHECK_GE(arraysize(outputs), output_count);
-
-  opcode = cont->Encode(opcode);
-
-  if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(opcode, output_count, outputs, input_count, inputs,
-                             cont->kind(), cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else if (cont->IsTrap()) {
-    inputs[input_count++] = g.UseImmediate(cont->trap_id());
-    selector->Emit(opcode, output_count, outputs, input_count, inputs);
-  } else {
-    selector->Emit(opcode, output_count, outputs, input_count, inputs);
-  }
-}
-
-template <class CanCombineWithLoad>
-void VisitBinOp(InstructionSelector* selector, Node* node,
-                InstructionCode opcode, OperandModes operand_mode,
-                FlagsContinuation* cont,
-                CanCombineWithLoad canCombineWithLoad) {
-  S390OperandGenerator g(selector);
-  Int32BinopMatcher m(node);
-  Node* left = m.left().node();
-  Node* right = m.right().node();
-  InstructionOperand inputs[8];
-  size_t input_count = 0;
-  InstructionOperand outputs[2];
-  size_t output_count = 0;
-
-  if (node->op()->HasProperty(Operator::kCommutative) &&
-      !g.CanBeImmediate(right, operand_mode) &&
-      (g.CanBeBetterLeftOperand(right))) {
-    std::swap(left, right);
-  }
-
-  GenerateBinOpOperands(selector, node, left, right, opcode, operand_mode,
-                        inputs, input_count, canCombineWithLoad);
-
-  bool left_is_word32 = ProduceWord32Result(left);
-
-  bool doZeroExt = DoZeroExtForResult(node);
-  bool canEliminateZeroExt = left_is_word32;
-
-  if (doZeroExt) {
-    // Add zero-ext indication
-    inputs[input_count++] = g.TempImmediate(!canEliminateZeroExt);
-  }
-
-  if (cont->IsBranch()) {
-    inputs[input_count++] = g.Label(cont->true_block());
-    inputs[input_count++] = g.Label(cont->false_block());
-  }
-
-  if ((operand_mode & OperandMode::kAllowDistinctOps) &&
-      // If we can deoptimize as a result of the binop, we need to make sure
-      // that the deopt inputs are not overwritten by the binop result. One way
-      // to achieve that is to declare the output register as same-as-first.
-      !cont->IsDeoptimize()) {
-    if (doZeroExt && canEliminateZeroExt) {
-      // we have to make sure result and left use the same register
-      outputs[output_count++] = g.DefineSameAsFirst(node);
-    } else {
-      outputs[output_count++] = g.DefineAsRegister(node);
-    }
-  } else {
-    outputs[output_count++] = g.DefineSameAsFirst(node);
-  }
-
-  if (cont->IsSet()) {
-    outputs[output_count++] = g.DefineAsRegister(cont->result());
-  }
-
-  DCHECK_NE(0u, input_count);
-  DCHECK_NE(0u, output_count);
-  DCHECK_GE(arraysize(inputs), input_count);
-  DCHECK_GE(arraysize(outputs), output_count);
-
-  opcode = cont->Encode(opcode);
-
-  if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(opcode, output_count, outputs, input_count, inputs,
-                             cont->kind(), cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else if (cont->IsTrap()) {
-    inputs[input_count++] = g.UseImmediate(cont->trap_id());
-    selector->Emit(opcode, output_count, outputs, input_count, inputs);
-  } else {
-    selector->Emit(opcode, output_count, outputs, input_count, inputs);
-  }
-}
-
-}  // namespace
-
-void InstructionSelector::VisitStackSlot(Node* node) {
-  StackSlotRepresentation rep = StackSlotRepresentationOf(node->op());
-  int slot = frame_->AllocateSpillSlot(rep.size());
-  OperandGenerator g(this);
-
-  Emit(kArchStackSlot, g.DefineAsRegister(node),
-       sequence()->AddImmediate(Constant(slot)), 0, nullptr);
-}
-
-void InstructionSelector::VisitDebugAbort(Node* node) {
-  S390OperandGenerator g(this);
-  Emit(kArchDebugAbort, g.NoOutput(), g.UseFixed(node->InputAt(0), r3));
-}
-
-void InstructionSelector::VisitLoad(Node* node) {
-  S390OperandGenerator g(this);
-  ArchOpcode opcode = SelectLoadOpcode(node);
-  InstructionOperand outputs[1];
-  outputs[0] = g.DefineAsRegister(node);
-  InstructionOperand inputs[3];
-  size_t input_count = 0;
-  AddressingMode mode =
-      g.GetEffectiveAddressMemoryOperand(node, inputs, &input_count);
-  InstructionCode code = opcode | AddressingModeField::encode(mode);
-  Emit(code, 1, outputs, input_count, inputs);
-}
-
-void InstructionSelector::VisitProtectedLoad(Node* node) {
-  // TODO(eholk)
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitStore(Node* node) {
-  S390OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* offset = node->InputAt(1);
-  Node* value = node->InputAt(2);
-
-  StoreRepresentation store_rep = StoreRepresentationOf(node->op());
-  WriteBarrierKind write_barrier_kind = store_rep.write_barrier_kind();
-  MachineRepresentation rep = store_rep.representation();
-
-  if (write_barrier_kind != kNoWriteBarrier) {
-    DCHECK(CanBeTaggedPointer(rep));
-    AddressingMode addressing_mode;
-    InstructionOperand inputs[3];
-    size_t input_count = 0;
-    inputs[input_count++] = g.UseUniqueRegister(base);
-    // OutOfLineRecordWrite uses the offset in an 'AddP' instruction as well as
-    // for the store itself, so we must check compatibility with both.
-    if (g.CanBeImmediate(offset, OperandMode::kInt20Imm)) {
-      inputs[input_count++] = g.UseImmediate(offset);
-      addressing_mode = kMode_MRI;
-    } else {
-      inputs[input_count++] = g.UseUniqueRegister(offset);
-      addressing_mode = kMode_MRR;
-    }
-    inputs[input_count++] = g.UseUniqueRegister(value);
-    RecordWriteMode record_write_mode = RecordWriteMode::kValueIsAny;
-    switch (write_barrier_kind) {
-      case kNoWriteBarrier:
-        UNREACHABLE();
-        break;
-      case kMapWriteBarrier:
-        record_write_mode = RecordWriteMode::kValueIsMap;
-        break;
-      case kPointerWriteBarrier:
-        record_write_mode = RecordWriteMode::kValueIsPointer;
-        break;
-      case kFullWriteBarrier:
-        record_write_mode = RecordWriteMode::kValueIsAny;
-        break;
-    }
-    InstructionOperand temps[] = {g.TempRegister(), g.TempRegister()};
-    size_t const temp_count = arraysize(temps);
-    InstructionCode code = kArchStoreWithWriteBarrier;
-    code |= AddressingModeField::encode(addressing_mode);
-    code |= MiscField::encode(static_cast<int>(record_write_mode));
-    Emit(code, 0, nullptr, input_count, inputs, temp_count, temps);
-  } else {
-    ArchOpcode opcode = kArchNop;
-    NodeMatcher m(value);
-    switch (rep) {
-      case MachineRepresentation::kFloat32:
-        opcode = kS390_StoreFloat32;
-        break;
-      case MachineRepresentation::kFloat64:
-        opcode = kS390_StoreDouble;
-        break;
-      case MachineRepresentation::kBit:  // Fall through.
-      case MachineRepresentation::kWord8:
-        opcode = kS390_StoreWord8;
-        break;
-      case MachineRepresentation::kWord16:
-        opcode = kS390_StoreWord16;
-        break;
-#if !V8_TARGET_ARCH_S390X
-      case MachineRepresentation::kTaggedSigned:   // Fall through.
-      case MachineRepresentation::kTaggedPointer:  // Fall through.
-      case MachineRepresentation::kTagged:  // Fall through.
-#endif
-      case MachineRepresentation::kWord32:
-        opcode = kS390_StoreWord32;
-        if (m.IsWord32ReverseBytes()) {
-          opcode = kS390_StoreReverse32;
-          value = value->InputAt(0);
-        }
-        break;
-#if V8_TARGET_ARCH_S390X
-      case MachineRepresentation::kTaggedSigned:   // Fall through.
-      case MachineRepresentation::kTaggedPointer:  // Fall through.
-      case MachineRepresentation::kTagged:  // Fall through.
-      case MachineRepresentation::kWord64:
-        opcode = kS390_StoreWord64;
-        if (m.IsWord64ReverseBytes()) {
-          opcode = kS390_StoreReverse64;
-          value = value->InputAt(0);
-        }
-        break;
-#else
-      case MachineRepresentation::kWord64:  // Fall through.
-#endif
-      case MachineRepresentation::kSimd128:  // Fall through.
-      case MachineRepresentation::kNone:
-        UNREACHABLE();
-        return;
-    }
-    InstructionOperand inputs[4];
-    size_t input_count = 0;
-    AddressingMode addressing_mode =
-        g.GetEffectiveAddressMemoryOperand(node, inputs, &input_count);
-    InstructionCode code =
-        opcode | AddressingModeField::encode(addressing_mode);
-    InstructionOperand value_operand = g.UseRegister(value);
-    inputs[input_count++] = value_operand;
-    Emit(code, 0, static_cast<InstructionOperand*>(nullptr), input_count,
-         inputs);
-  }
-}
-
-void InstructionSelector::VisitProtectedStore(Node* node) {
-  // TODO(eholk)
-  UNIMPLEMENTED();
-}
-
-// Architecture supports unaligned access, therefore VisitLoad is used instead
-void InstructionSelector::VisitUnalignedLoad(Node* node) { UNREACHABLE(); }
-
-// Architecture supports unaligned access, therefore VisitStore is used instead
-void InstructionSelector::VisitUnalignedStore(Node* node) { UNREACHABLE(); }
-
-#if 0
-static inline bool IsContiguousMask32(uint32_t value, int* mb, int* me) {
-  int mask_width = base::bits::CountPopulation(value);
-  int mask_msb = base::bits::CountLeadingZeros32(value);
-  int mask_lsb = base::bits::CountTrailingZeros32(value);
-  if ((mask_width == 0) || (mask_msb + mask_width + mask_lsb != 32))
-    return false;
-  *mb = mask_lsb + mask_width - 1;
-  *me = mask_lsb;
-  return true;
-}
-#endif
-
-#if V8_TARGET_ARCH_S390X
-static inline bool IsContiguousMask64(uint64_t value, int* mb, int* me) {
-  int mask_width = base::bits::CountPopulation(value);
-  int mask_msb = base::bits::CountLeadingZeros64(value);
-  int mask_lsb = base::bits::CountTrailingZeros64(value);
-  if ((mask_width == 0) || (mask_msb + mask_width + mask_lsb != 64))
-    return false;
-  *mb = mask_lsb + mask_width - 1;
-  *me = mask_lsb;
-  return true;
-}
-#endif
-
-#if V8_TARGET_ARCH_S390X
-void InstructionSelector::VisitWord64And(Node* node) {
-  S390OperandGenerator g(this);
-  Int64BinopMatcher m(node);
-  int mb = 0;
-  int me = 0;
-  if (m.right().HasValue() && IsContiguousMask64(m.right().Value(), &mb, &me)) {
-    int sh = 0;
-    Node* left = m.left().node();
-    if ((m.left().IsWord64Shr() || m.left().IsWord64Shl()) &&
-        CanCover(node, left)) {
-      Int64BinopMatcher mleft(m.left().node());
-      if (mleft.right().IsInRange(0, 63)) {
-        left = mleft.left().node();
-        sh = mleft.right().Value();
-        if (m.left().IsWord64Shr()) {
-          // Adjust the mask such that it doesn't include any rotated bits.
-          if (mb > 63 - sh) mb = 63 - sh;
-          sh = (64 - sh) & 0x3F;
-        } else {
-          // Adjust the mask such that it doesn't include any rotated bits.
-          if (me < sh) me = sh;
-        }
-      }
-    }
-    if (mb >= me) {
-      bool match = false;
-      ArchOpcode opcode;
-      int mask;
-      if (me == 0) {
-        match = true;
-        opcode = kS390_RotLeftAndClearLeft64;
-        mask = mb;
-      } else if (mb == 63) {
-        match = true;
-        opcode = kS390_RotLeftAndClearRight64;
-        mask = me;
-      } else if (sh && me <= sh && m.left().IsWord64Shl()) {
-        match = true;
-        opcode = kS390_RotLeftAndClear64;
-        mask = mb;
-      }
-      if (match && CpuFeatures::IsSupported(GENERAL_INSTR_EXT)) {
-        Emit(opcode, g.DefineAsRegister(node), g.UseRegister(left),
-             g.TempImmediate(sh), g.TempImmediate(mask));
-        return;
-      }
-    }
-  }
-  VisitWord64BinOp(this, node, kS390_And64, And64OperandMode);
-}
-
-void InstructionSelector::VisitWord64Shl(Node* node) {
-  S390OperandGenerator g(this);
-  Int64BinopMatcher m(node);
-  // TODO(mbrandy): eliminate left sign extension if right >= 32
-  if (m.left().IsWord64And() && m.right().IsInRange(0, 63)) {
-    Int64BinopMatcher mleft(m.left().node());
-    int sh = m.right().Value();
-    int mb;
-    int me;
-    if (mleft.right().HasValue() &&
-        IsContiguousMask64(mleft.right().Value() << sh, &mb, &me)) {
-      // Adjust the mask such that it doesn't include any rotated bits.
-      if (me < sh) me = sh;
-      if (mb >= me) {
-        bool match = false;
-        ArchOpcode opcode;
-        int mask;
-        if (me == 0) {
-          match = true;
-          opcode = kS390_RotLeftAndClearLeft64;
-          mask = mb;
-        } else if (mb == 63) {
-          match = true;
-          opcode = kS390_RotLeftAndClearRight64;
-          mask = me;
-        } else if (sh && me <= sh) {
-          match = true;
-          opcode = kS390_RotLeftAndClear64;
-          mask = mb;
-        }
-        if (match && CpuFeatures::IsSupported(GENERAL_INSTR_EXT)) {
-          Emit(opcode, g.DefineAsRegister(node),
-               g.UseRegister(mleft.left().node()), g.TempImmediate(sh),
-               g.TempImmediate(mask));
-          return;
-        }
-      }
-    }
-  }
-  VisitWord64BinOp(this, node, kS390_ShiftLeft64, Shift64OperandMode);
-}
-
-void InstructionSelector::VisitWord64Shr(Node* node) {
-  S390OperandGenerator g(this);
-  Int64BinopMatcher m(node);
-  if (m.left().IsWord64And() && m.right().IsInRange(0, 63)) {
-    Int64BinopMatcher mleft(m.left().node());
-    int sh = m.right().Value();
-    int mb;
-    int me;
-    if (mleft.right().HasValue() &&
-        IsContiguousMask64((uint64_t)(mleft.right().Value()) >> sh, &mb, &me)) {
-      // Adjust the mask such that it doesn't include any rotated bits.
-      if (mb > 63 - sh) mb = 63 - sh;
-      sh = (64 - sh) & 0x3F;
-      if (mb >= me) {
-        bool match = false;
-        ArchOpcode opcode;
-        int mask;
-        if (me == 0) {
-          match = true;
-          opcode = kS390_RotLeftAndClearLeft64;
-          mask = mb;
-        } else if (mb == 63) {
-          match = true;
-          opcode = kS390_RotLeftAndClearRight64;
-          mask = me;
-        }
-        if (match) {
-          Emit(opcode, g.DefineAsRegister(node),
-               g.UseRegister(mleft.left().node()), g.TempImmediate(sh),
-               g.TempImmediate(mask));
-          return;
-        }
-      }
-    }
-  }
-  VisitWord64BinOp(this, node, kS390_ShiftRight64, Shift64OperandMode);
-}
-#endif
-
-static inline bool TryMatchSignExtInt16OrInt8FromWord32Sar(
-    InstructionSelector* selector, Node* node) {
-  S390OperandGenerator g(selector);
-  Int32BinopMatcher m(node);
-  if (selector->CanCover(node, m.left().node()) && m.left().IsWord32Shl()) {
-    Int32BinopMatcher mleft(m.left().node());
-    if (mleft.right().Is(16) && m.right().Is(16)) {
-      bool canEliminateZeroExt = ProduceWord32Result(mleft.left().node());
-      selector->Emit(kS390_ExtendSignWord16,
-                     canEliminateZeroExt ? g.DefineSameAsFirst(node)
-                                         : g.DefineAsRegister(node),
-                     g.UseRegister(mleft.left().node()),
-                     g.TempImmediate(!canEliminateZeroExt));
-      return true;
-    } else if (mleft.right().Is(24) && m.right().Is(24)) {
-      bool canEliminateZeroExt = ProduceWord32Result(mleft.left().node());
-      selector->Emit(kS390_ExtendSignWord8,
-                     canEliminateZeroExt ? g.DefineSameAsFirst(node)
-                                         : g.DefineAsRegister(node),
-                     g.UseRegister(mleft.left().node()),
-                     g.TempImmediate(!canEliminateZeroExt));
-      return true;
-    }
-  }
-  return false;
-}
-
-#if !V8_TARGET_ARCH_S390X
-void VisitPairBinop(InstructionSelector* selector, InstructionCode opcode,
-                    InstructionCode opcode2, Node* node) {
-  S390OperandGenerator g(selector);
-
-  Node* projection1 = NodeProperties::FindProjection(node, 1);
-  if (projection1) {
-    // We use UseUniqueRegister here to avoid register sharing with the output
-    // registers.
-    InstructionOperand inputs[] = {
-        g.UseRegister(node->InputAt(0)), g.UseUniqueRegister(node->InputAt(1)),
-        g.UseRegister(node->InputAt(2)), g.UseUniqueRegister(node->InputAt(3))};
-
-    InstructionOperand outputs[] = {
-        g.DefineAsRegister(node),
-        g.DefineAsRegister(NodeProperties::FindProjection(node, 1))};
-
-    selector->Emit(opcode, 2, outputs, 4, inputs);
-  } else {
-    // The high word of the result is not used, so we emit the standard 32 bit
-    // instruction.
-    selector->Emit(opcode2, g.DefineSameAsFirst(node),
-                   g.UseRegister(node->InputAt(0)),
-                   g.UseRegister(node->InputAt(2)), g.TempImmediate(0));
-  }
-}
-
-void InstructionSelector::VisitInt32PairAdd(Node* node) {
-  VisitPairBinop(this, kS390_AddPair, kS390_Add32, node);
-}
-
-void InstructionSelector::VisitInt32PairSub(Node* node) {
-  VisitPairBinop(this, kS390_SubPair, kS390_Sub32, node);
-}
-
-void InstructionSelector::VisitInt32PairMul(Node* node) {
-  S390OperandGenerator g(this);
-  Node* projection1 = NodeProperties::FindProjection(node, 1);
-  if (projection1) {
-    InstructionOperand inputs[] = {g.UseUniqueRegister(node->InputAt(0)),
-                                   g.UseUniqueRegister(node->InputAt(1)),
-                                   g.UseUniqueRegister(node->InputAt(2)),
-                                   g.UseUniqueRegister(node->InputAt(3))};
-
-    InstructionOperand outputs[] = {
-        g.DefineAsRegister(node),
-        g.DefineAsRegister(NodeProperties::FindProjection(node, 1))};
-
-    Emit(kS390_MulPair, 2, outputs, 4, inputs);
-  } else {
-    // The high word of the result is not used, so we emit the standard 32 bit
-    // instruction.
-    Emit(kS390_Mul32, g.DefineSameAsFirst(node),
-         g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(2)),
-         g.TempImmediate(0));
-  }
-}
-
-namespace {
-// Shared routine for multiple shift operations.
-void VisitPairShift(InstructionSelector* selector, InstructionCode opcode,
-                    Node* node) {
-  S390OperandGenerator g(selector);
-  // We use g.UseUniqueRegister here to guarantee that there is
-  // no register aliasing of input registers with output registers.
-  Int32Matcher m(node->InputAt(2));
-  InstructionOperand shift_operand;
-  if (m.HasValue()) {
-    shift_operand = g.UseImmediate(m.node());
-  } else {
-    shift_operand = g.UseUniqueRegister(m.node());
-  }
-
-  InstructionOperand inputs[] = {g.UseUniqueRegister(node->InputAt(0)),
-                                 g.UseUniqueRegister(node->InputAt(1)),
-                                 shift_operand};
-
-  Node* projection1 = NodeProperties::FindProjection(node, 1);
-
-  InstructionOperand outputs[2];
-  InstructionOperand temps[1];
-  int32_t output_count = 0;
-  int32_t temp_count = 0;
-
-  outputs[output_count++] = g.DefineAsRegister(node);
-  if (projection1) {
-    outputs[output_count++] = g.DefineAsRegister(projection1);
-  } else {
-    temps[temp_count++] = g.TempRegister();
-  }
-
-  selector->Emit(opcode, output_count, outputs, 3, inputs, temp_count, temps);
-}
-}  // namespace
-
-void InstructionSelector::VisitWord32PairShl(Node* node) {
-  VisitPairShift(this, kS390_ShiftLeftPair, node);
-}
-
-void InstructionSelector::VisitWord32PairShr(Node* node) {
-  VisitPairShift(this, kS390_ShiftRightPair, node);
-}
-
-void InstructionSelector::VisitWord32PairSar(Node* node) {
-  VisitPairShift(this, kS390_ShiftRightArithPair, node);
-}
-#endif
-
-void InstructionSelector::VisitWord32Ctz(Node* node) { UNREACHABLE(); }
-
-#if V8_TARGET_ARCH_S390X
-void InstructionSelector::VisitWord64Ctz(Node* node) { UNREACHABLE(); }
-#endif
-
-void InstructionSelector::VisitWord32ReverseBits(Node* node) { UNREACHABLE(); }
-
-#if V8_TARGET_ARCH_S390X
-void InstructionSelector::VisitWord64ReverseBits(Node* node) { UNREACHABLE(); }
-#endif
-
-void InstructionSelector::VisitSpeculationFence(Node* node) { UNREACHABLE(); }
-
-void InstructionSelector::VisitInt32AbsWithOverflow(Node* node) {
-  VisitWord32UnaryOp(this, node, kS390_Abs32, OperandMode::kNone);
-}
-
-void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) {
-  VisitWord64UnaryOp(this, node, kS390_Abs64, OperandMode::kNone);
-}
-
-void InstructionSelector::VisitWord64ReverseBytes(Node* node) {
-  S390OperandGenerator g(this);
-  Emit(kS390_LoadReverse64RR, g.DefineAsRegister(node),
-       g.UseRegister(node->InputAt(0)));
-}
-
-void InstructionSelector::VisitWord32ReverseBytes(Node* node) {
-  S390OperandGenerator g(this);
-  NodeMatcher input(node->InputAt(0));
-  if (CanCover(node, input.node()) && input.IsLoad()) {
-    LoadRepresentation load_rep = LoadRepresentationOf(input.node()->op());
-    if (load_rep.representation() == MachineRepresentation::kWord32) {
-      Node* base = input.node()->InputAt(0);
-      Node* offset = input.node()->InputAt(1);
-      Emit(kS390_LoadReverse32 | AddressingModeField::encode(kMode_MRR),
-           // TODO(john.yan): one of the base and offset can be imm.
-           g.DefineAsRegister(node), g.UseRegister(base),
-           g.UseRegister(offset));
-      return;
-    }
-  }
-  Emit(kS390_LoadReverse32RR, g.DefineAsRegister(node),
-       g.UseRegister(node->InputAt(0)));
-}
-
-template <class Matcher, ArchOpcode neg_opcode>
-static inline bool TryMatchNegFromSub(InstructionSelector* selector,
-                                      Node* node) {
-  S390OperandGenerator g(selector);
-  Matcher m(node);
-  static_assert(neg_opcode == kS390_Neg32 || neg_opcode == kS390_Neg64,
-                "Provided opcode is not a Neg opcode.");
-  if (m.left().Is(0)) {
-    Node* value = m.right().node();
-    bool doZeroExt = DoZeroExtForResult(node);
-    bool canEliminateZeroExt = ProduceWord32Result(value);
-    if (doZeroExt) {
-      selector->Emit(neg_opcode,
-                     canEliminateZeroExt ? g.DefineSameAsFirst(node)
-                                         : g.DefineAsRegister(node),
-                     g.UseRegister(value),
-                     g.TempImmediate(!canEliminateZeroExt));
-    } else {
-      selector->Emit(neg_opcode, g.DefineAsRegister(node),
-                     g.UseRegister(value));
-    }
-    return true;
-  }
-  return false;
-}
-
-template <class Matcher, ArchOpcode shift_op>
-bool TryMatchShiftFromMul(InstructionSelector* selector, Node* node) {
-  S390OperandGenerator g(selector);
-  Matcher m(node);
-  Node* left = m.left().node();
-  Node* right = m.right().node();
-  if (g.CanBeImmediate(right, OperandMode::kInt32Imm) &&
-      base::bits::IsPowerOfTwo(g.GetImmediate(right))) {
-    int power = 63 - base::bits::CountLeadingZeros64(g.GetImmediate(right));
-    bool doZeroExt = DoZeroExtForResult(node);
-    bool canEliminateZeroExt = ProduceWord32Result(left);
-    InstructionOperand dst = (doZeroExt && !canEliminateZeroExt &&
-                              CpuFeatures::IsSupported(DISTINCT_OPS))
-                                 ? g.DefineAsRegister(node)
-                                 : g.DefineSameAsFirst(node);
-
-    if (doZeroExt) {
-      selector->Emit(shift_op, dst, g.UseRegister(left), g.UseImmediate(power),
-                     g.TempImmediate(!canEliminateZeroExt));
-    } else {
-      selector->Emit(shift_op, dst, g.UseRegister(left), g.UseImmediate(power));
-    }
-    return true;
-  }
-  return false;
-}
-
-template <ArchOpcode opcode>
-static inline bool TryMatchInt32OpWithOverflow(InstructionSelector* selector,
-                                               Node* node, OperandModes mode) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    VisitWord32BinOp(selector, node, opcode, mode, &cont);
-    return true;
-  }
-  return false;
-}
-
-static inline bool TryMatchInt32AddWithOverflow(InstructionSelector* selector,
-                                                Node* node) {
-  return TryMatchInt32OpWithOverflow<kS390_Add32>(selector, node,
-                                                  AddOperandMode);
-}
-
-static inline bool TryMatchInt32SubWithOverflow(InstructionSelector* selector,
-                                                Node* node) {
-  return TryMatchInt32OpWithOverflow<kS390_Sub32>(selector, node,
-                                                  SubOperandMode);
-}
-
-static inline bool TryMatchInt32MulWithOverflow(InstructionSelector* selector,
-                                                Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    if (CpuFeatures::IsSupported(MISC_INSTR_EXT2)) {
-      TryMatchInt32OpWithOverflow<kS390_Mul32>(
-          selector, node, OperandMode::kAllowRRR | OperandMode::kAllowRM);
-    } else {
-      FlagsContinuation cont = FlagsContinuation::ForSet(kNotEqual, ovf);
-      VisitWord32BinOp(selector, node, kS390_Mul32WithOverflow,
-                       OperandMode::kInt32Imm | OperandMode::kAllowDistinctOps,
-                       &cont);
-    }
-    return true;
-  }
-  return TryMatchShiftFromMul<Int32BinopMatcher, kS390_ShiftLeft32>(selector,
-                                                                    node);
-}
-
-#if V8_TARGET_ARCH_S390X
-template <ArchOpcode opcode>
-static inline bool TryMatchInt64OpWithOverflow(InstructionSelector* selector,
-                                               Node* node, OperandModes mode) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    VisitWord64BinOp(selector, node, opcode, mode, &cont);
-    return true;
-  }
-  return false;
-}
-
-static inline bool TryMatchInt64AddWithOverflow(InstructionSelector* selector,
-                                                Node* node) {
-  return TryMatchInt64OpWithOverflow<kS390_Add64>(selector, node,
-                                                  AddOperandMode);
-}
-
-static inline bool TryMatchInt64SubWithOverflow(InstructionSelector* selector,
-                                                Node* node) {
-  return TryMatchInt64OpWithOverflow<kS390_Sub64>(selector, node,
-                                                  SubOperandMode);
-}
-#endif
-
-static inline bool TryMatchDoubleConstructFromInsert(
-    InstructionSelector* selector, Node* node) {
-  S390OperandGenerator g(selector);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-  Node* lo32 = nullptr;
-  Node* hi32 = nullptr;
-
-  if (node->opcode() == IrOpcode::kFloat64InsertLowWord32) {
-    lo32 = right;
-  } else if (node->opcode() == IrOpcode::kFloat64InsertHighWord32) {
-    hi32 = right;
-  } else {
-    return false;  // doesn't match
-  }
-
-  if (left->opcode() == IrOpcode::kFloat64InsertLowWord32) {
-    lo32 = left->InputAt(1);
-  } else if (left->opcode() == IrOpcode::kFloat64InsertHighWord32) {
-    hi32 = left->InputAt(1);
-  } else {
-    return false;  // doesn't match
-  }
-
-  if (!lo32 || !hi32) return false;  // doesn't match
-
-  selector->Emit(kS390_DoubleConstruct, g.DefineAsRegister(node),
-                 g.UseRegister(hi32), g.UseRegister(lo32));
-  return true;
-}
-
-#define null ([]() { return false; })
-// TODO(john.yan): place kAllowRM where available
-#define FLOAT_UNARY_OP_LIST_32(V)                                              \
-  V(Float32, ChangeFloat32ToFloat64, kS390_Float32ToDouble,                    \
-    OperandMode::kAllowRM, null)                                               \
-  V(Float32, BitcastFloat32ToInt32, kS390_BitcastFloat32ToInt32,               \
-    OperandMode::kAllowRM, null)                                               \
-  V(Float64, TruncateFloat64ToFloat32, kS390_DoubleToFloat32,                  \
-    OperandMode::kNone, null)                                                  \
-  V(Float64, TruncateFloat64ToWord32, kArchTruncateDoubleToI,                  \
-    OperandMode::kNone, null)                                                  \
-  V(Float64, RoundFloat64ToInt32, kS390_DoubleToInt32, OperandMode::kNone,     \
-    null)                                                                      \
-  V(Float32, TruncateFloat32ToInt32, kS390_Float32ToInt32, OperandMode::kNone, \
-    null)                                                                      \
-  V(Float32, TruncateFloat32ToUint32, kS390_Float32ToUint32,                   \
-    OperandMode::kNone, null)                                                  \
-  V(Float64, TruncateFloat64ToUint32, kS390_DoubleToUint32,                    \
-    OperandMode::kNone, null)                                                  \
-  V(Float64, ChangeFloat64ToInt32, kS390_DoubleToInt32, OperandMode::kNone,    \
-    null)                                                                      \
-  V(Float64, ChangeFloat64ToUint32, kS390_DoubleToUint32, OperandMode::kNone,  \
-    null)                                                                      \
-  V(Float64, Float64SilenceNaN, kS390_Float64SilenceNaN, OperandMode::kNone,   \
-    null)                                                                      \
-  V(Float32, Float32Abs, kS390_AbsFloat, OperandMode::kNone, null)             \
-  V(Float64, Float64Abs, kS390_AbsDouble, OperandMode::kNone, null)            \
-  V(Float32, Float32Sqrt, kS390_SqrtFloat, OperandMode::kNone, null)           \
-  V(Float64, Float64Sqrt, kS390_SqrtDouble, OperandMode::kNone, null)          \
-  V(Float32, Float32RoundDown, kS390_FloorFloat, OperandMode::kNone, null)     \
-  V(Float64, Float64RoundDown, kS390_FloorDouble, OperandMode::kNone, null)    \
-  V(Float32, Float32RoundUp, kS390_CeilFloat, OperandMode::kNone, null)        \
-  V(Float64, Float64RoundUp, kS390_CeilDouble, OperandMode::kNone, null)       \
-  V(Float32, Float32RoundTruncate, kS390_TruncateFloat, OperandMode::kNone,    \
-    null)                                                                      \
-  V(Float64, Float64RoundTruncate, kS390_TruncateDouble, OperandMode::kNone,   \
-    null)                                                                      \
-  V(Float64, Float64RoundTiesAway, kS390_RoundDouble, OperandMode::kNone,      \
-    null)                                                                      \
-  V(Float32, Float32Neg, kS390_NegFloat, OperandMode::kNone, null)             \
-  V(Float64, Float64Neg, kS390_NegDouble, OperandMode::kNone, null)            \
-  /* TODO(john.yan): can use kAllowRM */                                       \
-  V(Word32, Float64ExtractLowWord32, kS390_DoubleExtractLowWord32,             \
-    OperandMode::kNone, null)                                                  \
-  V(Word32, Float64ExtractHighWord32, kS390_DoubleExtractHighWord32,           \
-    OperandMode::kNone, null)
-
-#define FLOAT_BIN_OP_LIST(V)                                           \
-  V(Float32, Float32Add, kS390_AddFloat, OperandMode::kAllowRM, null)  \
-  V(Float64, Float64Add, kS390_AddDouble, OperandMode::kAllowRM, null) \
-  V(Float32, Float32Sub, kS390_SubFloat, OperandMode::kAllowRM, null)  \
-  V(Float64, Float64Sub, kS390_SubDouble, OperandMode::kAllowRM, null) \
-  V(Float32, Float32Mul, kS390_MulFloat, OperandMode::kAllowRM, null)  \
-  V(Float64, Float64Mul, kS390_MulDouble, OperandMode::kAllowRM, null) \
-  V(Float32, Float32Div, kS390_DivFloat, OperandMode::kAllowRM, null)  \
-  V(Float64, Float64Div, kS390_DivDouble, OperandMode::kAllowRM, null) \
-  V(Float32, Float32Max, kS390_MaxFloat, OperandMode::kNone, null)     \
-  V(Float64, Float64Max, kS390_MaxDouble, OperandMode::kNone, null)    \
-  V(Float32, Float32Min, kS390_MinFloat, OperandMode::kNone, null)     \
-  V(Float64, Float64Min, kS390_MinDouble, OperandMode::kNone, null)
-
-#define WORD32_UNARY_OP_LIST_32(V)                                           \
-  V(Word32, Word32Clz, kS390_Cntlz32, OperandMode::kNone, null)              \
-  V(Word32, Word32Popcnt, kS390_Popcnt32, OperandMode::kNone, null)          \
-  V(Word32, RoundInt32ToFloat32, kS390_Int32ToFloat32, OperandMode::kNone,   \
-    null)                                                                    \
-  V(Word32, RoundUint32ToFloat32, kS390_Uint32ToFloat32, OperandMode::kNone, \
-    null)                                                                    \
-  V(Word32, ChangeInt32ToFloat64, kS390_Int32ToDouble, OperandMode::kNone,   \
-    null)                                                                    \
-  V(Word32, ChangeUint32ToFloat64, kS390_Uint32ToDouble, OperandMode::kNone, \
-    null)                                                                    \
-  V(Word32, BitcastInt32ToFloat32, kS390_BitcastInt32ToFloat32,              \
-    OperandMode::kNone, null)
-
-#ifdef V8_TARGET_ARCH_S390X
-#define FLOAT_UNARY_OP_LIST(V)                                                \
-  FLOAT_UNARY_OP_LIST_32(V)                                                   \
-  V(Float64, ChangeFloat64ToUint64, kS390_DoubleToUint64, OperandMode::kNone, \
-    null)                                                                     \
-  V(Float64, BitcastFloat64ToInt64, kS390_BitcastDoubleToInt64,               \
-    OperandMode::kNone, null)
-#define WORD32_UNARY_OP_LIST(V)                                             \
-  WORD32_UNARY_OP_LIST_32(V)                                                \
-  V(Word32, ChangeInt32ToInt64, kS390_ExtendSignWord32, OperandMode::kNone, \
-    null)                                                                   \
-  V(Word32, ChangeUint32ToUint64, kS390_Uint32ToUint64, OperandMode::kNone, \
-    [&]() -> bool {                                                         \
-      if (ProduceWord32Result(node->InputAt(0))) {                          \
-        EmitIdentity(node);                                                 \
-        return true;                                                        \
-      }                                                                     \
-      return false;                                                         \
-    })
-
-#else
-#define FLOAT_UNARY_OP_LIST(V) FLOAT_UNARY_OP_LIST_32(V)
-#define WORD32_UNARY_OP_LIST(V) WORD32_UNARY_OP_LIST_32(V)
-#endif
-
-#define WORD32_BIN_OP_LIST(V)                                                  \
-  V(Word32, Int32Add, kS390_Add32, AddOperandMode, null)                       \
-  V(Word32, Int32Sub, kS390_Sub32, SubOperandMode, ([&]() {                    \
-      return TryMatchNegFromSub<Int32BinopMatcher, kS390_Neg32>(this, node);   \
-    }))                                                                        \
-  V(Word32, Int32Mul, kS390_Mul32, MulOperandMode, ([&]() {                    \
-      return TryMatchShiftFromMul<Int32BinopMatcher, kS390_ShiftLeft32>(this,  \
-                                                                        node); \
-    }))                                                                        \
-  V(Word32, Int32AddWithOverflow, kS390_Add32, AddOperandMode,                 \
-    ([&]() { return TryMatchInt32AddWithOverflow(this, node); }))              \
-  V(Word32, Int32SubWithOverflow, kS390_Sub32, SubOperandMode,                 \
-    ([&]() { return TryMatchInt32SubWithOverflow(this, node); }))              \
-  V(Word32, Int32MulWithOverflow, kS390_Mul32, MulOperandMode,                 \
-    ([&]() { return TryMatchInt32MulWithOverflow(this, node); }))              \
-  V(Word32, Int32MulHigh, kS390_MulHigh32,                                     \
-    OperandMode::kInt32Imm | OperandMode::kAllowDistinctOps, null)             \
-  V(Word32, Uint32MulHigh, kS390_MulHighU32,                                   \
-    OperandMode::kAllowRRM | OperandMode::kAllowRRR, null)                     \
-  V(Word32, Int32Div, kS390_Div32,                                             \
-    OperandMode::kAllowRRM | OperandMode::kAllowRRR, null)                     \
-  V(Word32, Uint32Div, kS390_DivU32,                                           \
-    OperandMode::kAllowRRM | OperandMode::kAllowRRR, null)                     \
-  V(Word32, Int32Mod, kS390_Mod32,                                             \
-    OperandMode::kAllowRRM | OperandMode::kAllowRRR, null)                     \
-  V(Word32, Uint32Mod, kS390_ModU32,                                           \
-    OperandMode::kAllowRRM | OperandMode::kAllowRRR, null)                     \
-  V(Word32, Word32Ror, kS390_RotRight32,                                       \
-    OperandMode::kAllowRI | OperandMode::kAllowRRR | OperandMode::kAllowRRI |  \
-        OperandMode::kShift32Imm,                                              \
-    null)                                                                      \
-  V(Word32, Word32And, kS390_And32, And32OperandMode, null)                    \
-  V(Word32, Word32Or, kS390_Or32, Or32OperandMode, null)                       \
-  V(Word32, Word32Xor, kS390_Xor32, Xor32OperandMode, null)                    \
-  V(Word32, Word32Shl, kS390_ShiftLeft32, Shift32OperandMode, null)            \
-  V(Word32, Word32Shr, kS390_ShiftRight32, Shift32OperandMode, null)           \
-  V(Word32, Word32Sar, kS390_ShiftRightArith32, Shift32OperandMode,            \
-    [&]() { return TryMatchSignExtInt16OrInt8FromWord32Sar(this, node); })     \
-  V(Word32, Float64InsertLowWord32, kS390_DoubleInsertLowWord32,               \
-    OperandMode::kAllowRRR,                                                    \
-    [&]() -> bool { return TryMatchDoubleConstructFromInsert(this, node); })   \
-  V(Word32, Float64InsertHighWord32, kS390_DoubleInsertHighWord32,             \
-    OperandMode::kAllowRRR,                                                    \
-    [&]() -> bool { return TryMatchDoubleConstructFromInsert(this, node); })
-
-#define WORD64_UNARY_OP_LIST(V)                                              \
-  V(Word64, Word64Popcnt, kS390_Popcnt64, OperandMode::kNone, null)          \
-  V(Word64, Word64Clz, kS390_Cntlz64, OperandMode::kNone, null)              \
-  V(Word64, TruncateInt64ToInt32, kS390_Int64ToInt32, OperandMode::kNone,    \
-    null)                                                                    \
-  V(Word64, RoundInt64ToFloat32, kS390_Int64ToFloat32, OperandMode::kNone,   \
-    null)                                                                    \
-  V(Word64, RoundInt64ToFloat64, kS390_Int64ToDouble, OperandMode::kNone,    \
-    null)                                                                    \
-  V(Word64, RoundUint64ToFloat32, kS390_Uint64ToFloat32, OperandMode::kNone, \
-    null)                                                                    \
-  V(Word64, RoundUint64ToFloat64, kS390_Uint64ToDouble, OperandMode::kNone,  \
-    null)                                                                    \
-  V(Word64, BitcastInt64ToFloat64, kS390_BitcastInt64ToDouble,               \
-    OperandMode::kNone, null)
-
-#define WORD64_BIN_OP_LIST(V)                                                  \
-  V(Word64, Int64Add, kS390_Add64, AddOperandMode, null)                       \
-  V(Word64, Int64Sub, kS390_Sub64, SubOperandMode, ([&]() {                    \
-      return TryMatchNegFromSub<Int64BinopMatcher, kS390_Neg64>(this, node);   \
-    }))                                                                        \
-  V(Word64, Int64AddWithOverflow, kS390_Add64, AddOperandMode,                 \
-    ([&]() { return TryMatchInt64AddWithOverflow(this, node); }))              \
-  V(Word64, Int64SubWithOverflow, kS390_Sub64, SubOperandMode,                 \
-    ([&]() { return TryMatchInt64SubWithOverflow(this, node); }))              \
-  V(Word64, Int64Mul, kS390_Mul64, MulOperandMode, ([&]() {                    \
-      return TryMatchShiftFromMul<Int64BinopMatcher, kS390_ShiftLeft64>(this,  \
-                                                                        node); \
-    }))                                                                        \
-  V(Word64, Int64Div, kS390_Div64,                                             \
-    OperandMode::kAllowRRM | OperandMode::kAllowRRR, null)                     \
-  V(Word64, Uint64Div, kS390_DivU64,                                           \
-    OperandMode::kAllowRRM | OperandMode::kAllowRRR, null)                     \
-  V(Word64, Int64Mod, kS390_Mod64,                                             \
-    OperandMode::kAllowRRM | OperandMode::kAllowRRR, null)                     \
-  V(Word64, Uint64Mod, kS390_ModU64,                                           \
-    OperandMode::kAllowRRM | OperandMode::kAllowRRR, null)                     \
-  V(Word64, Word64Sar, kS390_ShiftRightArith64, Shift64OperandMode, null)      \
-  V(Word64, Word64Ror, kS390_RotRight64, Shift64OperandMode, null)             \
-  V(Word64, Word64Or, kS390_Or64, Or64OperandMode, null)                       \
-  V(Word64, Word64Xor, kS390_Xor64, Xor64OperandMode, null)
-
-#define DECLARE_UNARY_OP(type, name, op, mode, try_extra) \
-  void InstructionSelector::Visit##name(Node* node) {     \
-    if (std::function<bool()>(try_extra)()) return;       \
-    Visit##type##UnaryOp(this, node, op, mode);           \
-  }
-
-#define DECLARE_BIN_OP(type, name, op, mode, try_extra) \
-  void InstructionSelector::Visit##name(Node* node) {   \
-    if (std::function<bool()>(try_extra)()) return;     \
-    Visit##type##BinOp(this, node, op, mode);           \
-  }
-
-WORD32_BIN_OP_LIST(DECLARE_BIN_OP);
-WORD32_UNARY_OP_LIST(DECLARE_UNARY_OP);
-FLOAT_UNARY_OP_LIST(DECLARE_UNARY_OP);
-FLOAT_BIN_OP_LIST(DECLARE_BIN_OP);
-
-#if V8_TARGET_ARCH_S390X
-WORD64_UNARY_OP_LIST(DECLARE_UNARY_OP)
-WORD64_BIN_OP_LIST(DECLARE_BIN_OP)
-#endif
-
-#undef DECLARE_BIN_OP
-#undef DECLARE_UNARY_OP
-#undef WORD64_BIN_OP_LIST
-#undef WORD64_UNARY_OP_LIST
-#undef WORD32_BIN_OP_LIST
-#undef WORD32_UNARY_OP_LIST
-#undef FLOAT_UNARY_OP_LIST
-#undef WORD32_UNARY_OP_LIST_32
-#undef FLOAT_BIN_OP_LIST
-#undef FLOAT_BIN_OP_LIST_32
-#undef null
-
-#if V8_TARGET_ARCH_S390X
-void InstructionSelector::VisitTryTruncateFloat32ToInt64(Node* node) {
-  VisitTryTruncateDouble(this, kS390_Float32ToInt64, node);
-}
-
-void InstructionSelector::VisitTryTruncateFloat64ToInt64(Node* node) {
-  VisitTryTruncateDouble(this, kS390_DoubleToInt64, node);
-}
-
-void InstructionSelector::VisitTryTruncateFloat32ToUint64(Node* node) {
-  VisitTryTruncateDouble(this, kS390_Float32ToUint64, node);
-}
-
-void InstructionSelector::VisitTryTruncateFloat64ToUint64(Node* node) {
-  VisitTryTruncateDouble(this, kS390_DoubleToUint64, node);
-}
-
-#endif
-
-void InstructionSelector::VisitFloat64Mod(Node* node) {
-  S390OperandGenerator g(this);
-  Emit(kS390_ModDouble, g.DefineAsFixed(node, d1),
-       g.UseFixed(node->InputAt(0), d1), g.UseFixed(node->InputAt(1), d2))
-      ->MarkAsCall();
-}
-
-void InstructionSelector::VisitFloat64Ieee754Unop(Node* node,
-                                                  InstructionCode opcode) {
-  S390OperandGenerator g(this);
-  Emit(opcode, g.DefineAsFixed(node, d1), g.UseFixed(node->InputAt(0), d1))
-      ->MarkAsCall();
-}
-
-void InstructionSelector::VisitFloat64Ieee754Binop(Node* node,
-                                                   InstructionCode opcode) {
-  S390OperandGenerator g(this);
-  Emit(opcode, g.DefineAsFixed(node, d1), g.UseFixed(node->InputAt(0), d1),
-       g.UseFixed(node->InputAt(1), d2))
-      ->MarkAsCall();
-}
-
-void InstructionSelector::VisitFloat32RoundTiesEven(Node* node) {
-  UNREACHABLE();
-}
-
-void InstructionSelector::VisitFloat64RoundTiesEven(Node* node) {
-  UNREACHABLE();
-}
-
-static bool CompareLogical(FlagsContinuation* cont) {
-  switch (cont->condition()) {
-    case kUnsignedLessThan:
-    case kUnsignedGreaterThanOrEqual:
-    case kUnsignedLessThanOrEqual:
-    case kUnsignedGreaterThan:
-      return true;
-    default:
-      return false;
-  }
-  UNREACHABLE();
-}
-
-namespace {
-
-// Shared routine for multiple compare operations.
-void VisitCompare(InstructionSelector* selector, InstructionCode opcode,
-                  InstructionOperand left, InstructionOperand right,
-                  FlagsContinuation* cont) {
-  S390OperandGenerator g(selector);
-  opcode = cont->Encode(opcode);
-  if (cont->IsBranch()) {
-    selector->Emit(opcode, g.NoOutput(), left, right,
-                   g.Label(cont->true_block()), g.Label(cont->false_block()));
-  } else if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(opcode, g.NoOutput(), left, right, cont->kind(),
-                             cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else if (cont->IsSet()) {
-    selector->Emit(opcode, g.DefineAsRegister(cont->result()), left, right);
-  } else {
-    DCHECK(cont->IsTrap());
-    selector->Emit(opcode, g.NoOutput(), left, right,
-                   g.UseImmediate(cont->trap_id()));
-  }
-}
-
-void VisitWordCompareZero(InstructionSelector* selector, Node* user,
-                          Node* value, InstructionCode opcode,
-                          FlagsContinuation* cont);
-
-void VisitLoadAndTest(InstructionSelector* selector, InstructionCode opcode,
-                      Node* node, Node* value, FlagsContinuation* cont,
-                      bool discard_output = false);
-
-// Shared routine for multiple word compare operations.
-void VisitWordCompare(InstructionSelector* selector, Node* node,
-                      InstructionCode opcode, FlagsContinuation* cont,
-                      OperandModes immediate_mode) {
-  S390OperandGenerator g(selector);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-
-  DCHECK(IrOpcode::IsComparisonOpcode(node->opcode()) ||
-         node->opcode() == IrOpcode::kInt32Sub ||
-         node->opcode() == IrOpcode::kInt64Sub);
-
-  InstructionOperand inputs[8];
-  InstructionOperand outputs[1];
-  size_t input_count = 0;
-  size_t output_count = 0;
-
-  // If one of the two inputs is an immediate, make sure it's on the right, or
-  // if one of the two inputs is a memory operand, make sure it's on the left.
-  int effect_level = selector->GetEffectLevel(node);
-  if (cont->IsBranch()) {
-    effect_level = selector->GetEffectLevel(
-        cont->true_block()->PredecessorAt(0)->control_input());
-  }
-
-  if ((!g.CanBeImmediate(right, immediate_mode) &&
-       g.CanBeImmediate(left, immediate_mode)) ||
-      (!g.CanBeMemoryOperand(opcode, node, right, effect_level) &&
-       g.CanBeMemoryOperand(opcode, node, left, effect_level))) {
-    if (!node->op()->HasProperty(Operator::kCommutative)) cont->Commute();
-    std::swap(left, right);
-  }
-
-  // check if compare with 0
-  if (g.CanBeImmediate(right, immediate_mode) && g.GetImmediate(right) == 0) {
-    DCHECK(opcode == kS390_Cmp32 || opcode == kS390_Cmp64);
-    ArchOpcode load_and_test = (opcode == kS390_Cmp32)
-                                   ? kS390_LoadAndTestWord32
-                                   : kS390_LoadAndTestWord64;
-    return VisitLoadAndTest(selector, load_and_test, node, left, cont, true);
-  }
-
-  inputs[input_count++] = g.UseRegister(left);
-  if (g.CanBeMemoryOperand(opcode, node, right, effect_level)) {
-    // generate memory operand
-    AddressingMode addressing_mode = g.GetEffectiveAddressMemoryOperand(
-        right, inputs, &input_count, OpcodeImmMode(opcode));
-    opcode |= AddressingModeField::encode(addressing_mode);
-  } else if (g.CanBeImmediate(right, immediate_mode)) {
-    inputs[input_count++] = g.UseImmediate(right);
-  } else {
-    inputs[input_count++] = g.UseAnyExceptImmediate(right);
-  }
-
-  opcode = cont->Encode(opcode);
-  if (cont->IsBranch()) {
-    inputs[input_count++] = g.Label(cont->true_block());
-    inputs[input_count++] = g.Label(cont->false_block());
-  } else if (cont->IsSet()) {
-    outputs[output_count++] = g.DefineAsRegister(cont->result());
-  } else if (cont->IsTrap()) {
-    inputs[input_count++] = g.UseImmediate(cont->trap_id());
-  } else {
-    DCHECK(cont->IsDeoptimize());
-    // nothing to do
-  }
-
-  DCHECK(input_count <= 8 && output_count <= 1);
-  if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(opcode, 0, nullptr, input_count, inputs,
-                             cont->kind(), cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else {
-    selector->Emit(opcode, output_count, outputs, input_count, inputs);
-  }
-}
-
-void VisitWord32Compare(InstructionSelector* selector, Node* node,
-                        FlagsContinuation* cont) {
-  OperandModes mode =
-      (CompareLogical(cont) ? OperandMode::kUint32Imm : OperandMode::kInt32Imm);
-  VisitWordCompare(selector, node, kS390_Cmp32, cont, mode);
-}
-
-#if V8_TARGET_ARCH_S390X
-void VisitWord64Compare(InstructionSelector* selector, Node* node,
-                        FlagsContinuation* cont) {
-  OperandModes mode =
-      (CompareLogical(cont) ? OperandMode::kUint32Imm : OperandMode::kInt32Imm);
-  VisitWordCompare(selector, node, kS390_Cmp64, cont, mode);
-}
-#endif
-
-// Shared routine for multiple float32 compare operations.
-void VisitFloat32Compare(InstructionSelector* selector, Node* node,
-                         FlagsContinuation* cont) {
-  VisitWordCompare(selector, node, kS390_CmpFloat, cont, OperandMode::kNone);
-}
-
-// Shared routine for multiple float64 compare operations.
-void VisitFloat64Compare(InstructionSelector* selector, Node* node,
-                         FlagsContinuation* cont) {
-  VisitWordCompare(selector, node, kS390_CmpDouble, cont, OperandMode::kNone);
-}
-
-void VisitTestUnderMask(InstructionSelector* selector, Node* node,
-                        FlagsContinuation* cont) {
-  DCHECK(node->opcode() == IrOpcode::kWord32And ||
-         node->opcode() == IrOpcode::kWord64And);
-  ArchOpcode opcode =
-      (node->opcode() == IrOpcode::kWord32And) ? kS390_Tst32 : kS390_Tst64;
-  S390OperandGenerator g(selector);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-  if (!g.CanBeImmediate(right, OperandMode::kUint32Imm) &&
-      g.CanBeImmediate(left, OperandMode::kUint32Imm)) {
-    std::swap(left, right);
-  }
-  VisitCompare(selector, opcode, g.UseRegister(left),
-               g.UseOperand(right, OperandMode::kUint32Imm), cont);
-}
-
-void VisitLoadAndTest(InstructionSelector* selector, InstructionCode opcode,
-                      Node* node, Node* value, FlagsContinuation* cont,
-                      bool discard_output) {
-  static_assert(kS390_LoadAndTestFloat64 - kS390_LoadAndTestWord32 == 3,
-                "LoadAndTest Opcode shouldn't contain other opcodes.");
-
-  // TODO(john.yan): Add support for Float32/Float64.
-  DCHECK(opcode >= kS390_LoadAndTestWord32 ||
-         opcode <= kS390_LoadAndTestWord64);
-
-  S390OperandGenerator g(selector);
-  InstructionOperand inputs[8];
-  InstructionOperand outputs[2];
-  size_t input_count = 0;
-  size_t output_count = 0;
-  bool use_value = false;
-
-  int effect_level = selector->GetEffectLevel(node);
-  if (cont->IsBranch()) {
-    effect_level = selector->GetEffectLevel(
-        cont->true_block()->PredecessorAt(0)->control_input());
-  }
-
-  if (g.CanBeMemoryOperand(opcode, node, value, effect_level)) {
-    // generate memory operand
-    AddressingMode addressing_mode =
-        g.GetEffectiveAddressMemoryOperand(value, inputs, &input_count);
-    opcode |= AddressingModeField::encode(addressing_mode);
-  } else {
-    inputs[input_count++] = g.UseAnyExceptImmediate(value);
-    use_value = true;
-  }
-
-  if (!discard_output && !use_value) {
-    outputs[output_count++] = g.DefineAsRegister(value);
-  }
-
-  opcode = cont->Encode(opcode);
-  if (cont->IsBranch()) {
-    inputs[input_count++] = g.Label(cont->true_block());
-    inputs[input_count++] = g.Label(cont->false_block());
-  } else if (cont->IsSet()) {
-    outputs[output_count++] = g.DefineAsRegister(cont->result());
-  } else if (cont->IsTrap()) {
-    inputs[input_count++] = g.UseImmediate(cont->trap_id());
-  } else {
-    DCHECK(cont->IsDeoptimize());
-    // nothing to do
-  }
-
-  DCHECK(input_count <= 8 && output_count <= 2);
-  opcode = cont->Encode(opcode);
-  if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(opcode, output_count, outputs, input_count, inputs,
-                             cont->kind(), cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else {
-    selector->Emit(opcode, output_count, outputs, input_count, inputs);
-  }
-}
-
-// Shared routine for word comparisons against zero.
-void VisitWordCompareZero(InstructionSelector* selector, Node* user,
-                          Node* value, InstructionCode opcode,
-                          FlagsContinuation* cont) {
-  // Try to combine with comparisons against 0 by simply inverting the branch.
-  while (value->opcode() == IrOpcode::kWord32Equal &&
-         selector->CanCover(user, value)) {
-    Int32BinopMatcher m(value);
-    if (!m.right().Is(0)) break;
-
-    user = value;
-    value = m.left().node();
-    cont->Negate();
-  }
-
-  FlagsCondition fc = cont->condition();
-  if (selector->CanCover(user, value)) {
-    switch (value->opcode()) {
-      case IrOpcode::kWord32Equal: {
-        cont->OverwriteAndNegateIfEqual(kEqual);
-        Int32BinopMatcher m(value);
-        if (m.right().Is(0)) {
-          // Try to combine the branch with a comparison.
-          Node* const user = m.node();
-          Node* const value = m.left().node();
-          if (selector->CanCover(user, value)) {
-            switch (value->opcode()) {
-              case IrOpcode::kInt32Sub:
-                return VisitWord32Compare(selector, value, cont);
-              case IrOpcode::kWord32And:
-                return VisitTestUnderMask(selector, value, cont);
-              default:
-                break;
-            }
-          }
-        }
-        return VisitWord32Compare(selector, value, cont);
-      }
-      case IrOpcode::kInt32LessThan:
-        cont->OverwriteAndNegateIfEqual(kSignedLessThan);
-        return VisitWord32Compare(selector, value, cont);
-      case IrOpcode::kInt32LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kSignedLessThanOrEqual);
-        return VisitWord32Compare(selector, value, cont);
-      case IrOpcode::kUint32LessThan:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThan);
-        return VisitWord32Compare(selector, value, cont);
-      case IrOpcode::kUint32LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
-        return VisitWord32Compare(selector, value, cont);
-#if V8_TARGET_ARCH_S390X
-      case IrOpcode::kWord64Equal: {
-        cont->OverwriteAndNegateIfEqual(kEqual);
-        Int64BinopMatcher m(value);
-        if (m.right().Is(0)) {
-          // Try to combine the branch with a comparison.
-          Node* const user = m.node();
-          Node* const value = m.left().node();
-          if (selector->CanCover(user, value)) {
-            switch (value->opcode()) {
-              case IrOpcode::kInt64Sub:
-                return VisitWord64Compare(selector, value, cont);
-              case IrOpcode::kWord64And:
-                return VisitTestUnderMask(selector, value, cont);
-              default:
-                break;
-            }
-          }
-        }
-        return VisitWord64Compare(selector, value, cont);
-      }
-      case IrOpcode::kInt64LessThan:
-        cont->OverwriteAndNegateIfEqual(kSignedLessThan);
-        return VisitWord64Compare(selector, value, cont);
-      case IrOpcode::kInt64LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kSignedLessThanOrEqual);
-        return VisitWord64Compare(selector, value, cont);
-      case IrOpcode::kUint64LessThan:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThan);
-        return VisitWord64Compare(selector, value, cont);
-      case IrOpcode::kUint64LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
-        return VisitWord64Compare(selector, value, cont);
-#endif
-      case IrOpcode::kFloat32Equal:
-        cont->OverwriteAndNegateIfEqual(kEqual);
-        return VisitFloat32Compare(selector, value, cont);
-      case IrOpcode::kFloat32LessThan:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThan);
-        return VisitFloat32Compare(selector, value, cont);
-      case IrOpcode::kFloat32LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
-        return VisitFloat32Compare(selector, value, cont);
-      case IrOpcode::kFloat64Equal:
-        cont->OverwriteAndNegateIfEqual(kEqual);
-        return VisitFloat64Compare(selector, value, cont);
-      case IrOpcode::kFloat64LessThan:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThan);
-        return VisitFloat64Compare(selector, value, cont);
-      case IrOpcode::kFloat64LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
-        return VisitFloat64Compare(selector, value, cont);
-      case IrOpcode::kProjection:
-        // Check if this is the overflow output projection of an
-        // <Operation>WithOverflow node.
-        if (ProjectionIndexOf(value->op()) == 1u) {
-          // We cannot combine the <Operation>WithOverflow with this branch
-          // unless the 0th projection (the use of the actual value of the
-          // <Operation> is either nullptr, which means there's no use of the
-          // actual value, or was already defined, which means it is scheduled
-          // *AFTER* this branch).
-          Node* const node = value->InputAt(0);
-          Node* const result = NodeProperties::FindProjection(node, 0);
-          if (result == nullptr || selector->IsDefined(result)) {
-            switch (node->opcode()) {
-              case IrOpcode::kInt32AddWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitWord32BinOp(selector, node, kS390_Add32,
-                                        AddOperandMode, cont);
-              case IrOpcode::kInt32SubWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitWord32BinOp(selector, node, kS390_Sub32,
-                                        SubOperandMode, cont);
-              case IrOpcode::kInt32MulWithOverflow:
-                if (CpuFeatures::IsSupported(MISC_INSTR_EXT2)) {
-                  cont->OverwriteAndNegateIfEqual(kOverflow);
-                  return VisitWord32BinOp(
-                      selector, node, kS390_Mul32,
-                      OperandMode::kAllowRRR | OperandMode::kAllowRM, cont);
-                } else {
-                  cont->OverwriteAndNegateIfEqual(kNotEqual);
-                  return VisitWord32BinOp(
-                      selector, node, kS390_Mul32WithOverflow,
-                      OperandMode::kInt32Imm | OperandMode::kAllowDistinctOps,
-                      cont);
-                }
-              case IrOpcode::kInt32AbsWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitWord32UnaryOp(selector, node, kS390_Abs32,
-                                          OperandMode::kNone, cont);
-#if V8_TARGET_ARCH_S390X
-              case IrOpcode::kInt64AbsWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitWord64UnaryOp(selector, node, kS390_Abs64,
-                                          OperandMode::kNone, cont);
-              case IrOpcode::kInt64AddWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitWord64BinOp(selector, node, kS390_Add64,
-                                        AddOperandMode, cont);
-              case IrOpcode::kInt64SubWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitWord64BinOp(selector, node, kS390_Sub64,
-                                        SubOperandMode, cont);
-#endif
-              default:
-                break;
-            }
-          }
-        }
-        break;
-      case IrOpcode::kInt32Sub:
-        if (fc == kNotEqual || fc == kEqual)
-          return VisitWord32Compare(selector, value, cont);
-        break;
-      case IrOpcode::kWord32And:
-        return VisitTestUnderMask(selector, value, cont);
-      case IrOpcode::kLoad: {
-        LoadRepresentation load_rep = LoadRepresentationOf(value->op());
-        switch (load_rep.representation()) {
-          case MachineRepresentation::kWord32:
-            if (opcode == kS390_LoadAndTestWord32) {
-              return VisitLoadAndTest(selector, opcode, user, value, cont);
-            }
-          default:
-            break;
-        }
-        break;
-      }
-      case IrOpcode::kInt32Add:
-        // can't handle overflow case.
-        break;
-      case IrOpcode::kWord32Or:
-        if (fc == kNotEqual || fc == kEqual)
-          return VisitWord32BinOp(selector, value, kS390_Or32, Or32OperandMode,
-                                  cont);
-        break;
-      case IrOpcode::kWord32Xor:
-        if (fc == kNotEqual || fc == kEqual)
-          return VisitWord32BinOp(selector, value, kS390_Xor32,
-                                  Xor32OperandMode, cont);
-        break;
-      case IrOpcode::kWord32Sar:
-      case IrOpcode::kWord32Shl:
-      case IrOpcode::kWord32Shr:
-      case IrOpcode::kWord32Ror:
-        // doesn't generate cc, so ignore.
-        break;
-#if V8_TARGET_ARCH_S390X
-      case IrOpcode::kInt64Sub:
-        if (fc == kNotEqual || fc == kEqual)
-          return VisitWord64Compare(selector, value, cont);
-        break;
-      case IrOpcode::kWord64And:
-        return VisitTestUnderMask(selector, value, cont);
-      case IrOpcode::kInt64Add:
-        // can't handle overflow case.
-        break;
-      case IrOpcode::kWord64Or:
-        if (fc == kNotEqual || fc == kEqual)
-          return VisitWord64BinOp(selector, value, kS390_Or64, Or64OperandMode,
-                                  cont);
-        break;
-      case IrOpcode::kWord64Xor:
-        if (fc == kNotEqual || fc == kEqual)
-          return VisitWord64BinOp(selector, value, kS390_Xor64,
-                                  Xor64OperandMode, cont);
-        break;
-      case IrOpcode::kWord64Sar:
-      case IrOpcode::kWord64Shl:
-      case IrOpcode::kWord64Shr:
-      case IrOpcode::kWord64Ror:
-        // doesn't generate cc, so ignore
-        break;
-#endif
-      default:
-        break;
-    }
-  }
-
-  // Branch could not be combined with a compare, emit LoadAndTest
-  VisitLoadAndTest(selector, opcode, user, value, cont, true);
-}
-
-void VisitWord32CompareZero(InstructionSelector* selector, Node* user,
-                            Node* value, FlagsContinuation* cont) {
-  VisitWordCompareZero(selector, user, value, kS390_LoadAndTestWord32, cont);
-}
-
-#if V8_TARGET_ARCH_S390X
-void VisitWord64CompareZero(InstructionSelector* selector, Node* user,
-                            Node* value, FlagsContinuation* cont) {
-  VisitWordCompareZero(selector, user, value, kS390_LoadAndTestWord64, cont);
-}
-#endif
-
-}  // namespace
-
-void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch,
-                                      BasicBlock* fbranch) {
-  FlagsContinuation cont(kNotEqual, tbranch, fbranch);
-  VisitWord32CompareZero(this, branch, branch->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitDeoptimizeIf(Node* node) {
-  DeoptimizeParameters p = DeoptimizeParametersOf(node->op());
-  FlagsContinuation cont = FlagsContinuation::ForDeoptimize(
-      kNotEqual, p.kind(), p.reason(), p.feedback(), node->InputAt(1));
-  VisitWord32CompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitDeoptimizeUnless(Node* node) {
-  DeoptimizeParameters p = DeoptimizeParametersOf(node->op());
-  FlagsContinuation cont = FlagsContinuation::ForDeoptimize(
-      kEqual, p.kind(), p.reason(), p.feedback(), node->InputAt(1));
-  VisitWord32CompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitTrapIf(Node* node, Runtime::FunctionId func_id) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForTrap(kNotEqual, func_id, node->InputAt(1));
-  VisitWord32CompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitTrapUnless(Node* node,
-                                          Runtime::FunctionId func_id) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForTrap(kEqual, func_id, node->InputAt(1));
-  VisitWord32CompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitSwitch(Node* node, const SwitchInfo& sw) {
-  S390OperandGenerator g(this);
-  InstructionOperand value_operand = g.UseRegister(node->InputAt(0));
-
-  // Emit either ArchTableSwitch or ArchLookupSwitch.
-  static const size_t kMaxTableSwitchValueRange = 2 << 16;
-  size_t table_space_cost = 4 + sw.value_range;
-  size_t table_time_cost = 3;
-  size_t lookup_space_cost = 3 + 2 * sw.case_count;
-  size_t lookup_time_cost = sw.case_count;
-  if (sw.case_count > 0 &&
-      table_space_cost + 3 * table_time_cost <=
-          lookup_space_cost + 3 * lookup_time_cost &&
-      sw.min_value > std::numeric_limits<int32_t>::min() &&
-      sw.value_range <= kMaxTableSwitchValueRange) {
-    InstructionOperand index_operand = value_operand;
-    if (sw.min_value) {
-      index_operand = g.TempRegister();
-      Emit(kS390_Lay | AddressingModeField::encode(kMode_MRI), index_operand,
-           value_operand, g.TempImmediate(-sw.min_value));
-    }
-#if V8_TARGET_ARCH_S390X
-    InstructionOperand index_operand_zero_ext = g.TempRegister();
-    Emit(kS390_Uint32ToUint64, index_operand_zero_ext, index_operand);
-    index_operand = index_operand_zero_ext;
-#endif
-    // Generate a table lookup.
-    return EmitTableSwitch(sw, index_operand);
-  }
-
-  // Generate a sequence of conditional jumps.
-  return EmitLookupSwitch(sw, value_operand);
-}
-
-void InstructionSelector::VisitWord32Equal(Node* const node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
-  Int32BinopMatcher m(node);
-  if (m.right().Is(0)) {
-    return VisitWord32CompareZero(this, m.node(), m.left().node(), &cont);
-  }
-  VisitWord32Compare(this, node, &cont);
-}
-
-void InstructionSelector::VisitInt32LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kSignedLessThan, node);
-  VisitWord32Compare(this, node, &cont);
-}
-
-void InstructionSelector::VisitInt32LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kSignedLessThanOrEqual, node);
-  VisitWord32Compare(this, node, &cont);
-}
-
-void InstructionSelector::VisitUint32LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kUnsignedLessThan, node);
-  VisitWord32Compare(this, node, &cont);
-}
-
-void InstructionSelector::VisitUint32LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedLessThanOrEqual, node);
-  VisitWord32Compare(this, node, &cont);
-}
-
-#if V8_TARGET_ARCH_S390X
-void InstructionSelector::VisitWord64Equal(Node* const node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
-  Int64BinopMatcher m(node);
-  if (m.right().Is(0)) {
-    return VisitWord64CompareZero(this, m.node(), m.left().node(), &cont);
-  }
-  VisitWord64Compare(this, node, &cont);
-}
-
-void InstructionSelector::VisitInt64LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kSignedLessThan, node);
-  VisitWord64Compare(this, node, &cont);
-}
-
-void InstructionSelector::VisitInt64LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kSignedLessThanOrEqual, node);
-  VisitWord64Compare(this, node, &cont);
-}
-
-void InstructionSelector::VisitUint64LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kUnsignedLessThan, node);
-  VisitWord64Compare(this, node, &cont);
-}
-
-void InstructionSelector::VisitUint64LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedLessThanOrEqual, node);
-  VisitWord64Compare(this, node, &cont);
-}
-#endif
-
-void InstructionSelector::VisitFloat32Equal(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
-  VisitFloat32Compare(this, node, &cont);
-}
-
-void InstructionSelector::VisitFloat32LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kUnsignedLessThan, node);
-  VisitFloat32Compare(this, node, &cont);
-}
-
-void InstructionSelector::VisitFloat32LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedLessThanOrEqual, node);
-  VisitFloat32Compare(this, node, &cont);
-}
-
-void InstructionSelector::VisitFloat64Equal(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
-  VisitFloat64Compare(this, node, &cont);
-}
-
-void InstructionSelector::VisitFloat64LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kUnsignedLessThan, node);
-  VisitFloat64Compare(this, node, &cont);
-}
-
-void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedLessThanOrEqual, node);
-  VisitFloat64Compare(this, node, &cont);
-}
-
-void InstructionSelector::EmitPrepareArguments(
-    ZoneVector<PushParameter>* arguments, const CallDescriptor* descriptor,
-    Node* node) {
-  S390OperandGenerator g(this);
-
-  // Prepare for C function call.
-  if (descriptor->IsCFunctionCall()) {
-    Emit(kArchPrepareCallCFunction |
-             MiscField::encode(static_cast<int>(descriptor->ParameterCount())),
-         0, nullptr, 0, nullptr);
-
-    // Poke any stack arguments.
-    int slot = kStackFrameExtraParamSlot;
-    for (PushParameter input : (*arguments)) {
-      Emit(kS390_StoreToStackSlot, g.NoOutput(), g.UseRegister(input.node),
-           g.TempImmediate(slot));
-      ++slot;
-    }
-  } else {
-    // Push any stack arguments.
-    int num_slots = 0;
-    int slot = 0;
-
-    for (PushParameter input : *arguments) {
-      if (input.node == nullptr) continue;
-      num_slots += input.location.GetType().representation() ==
-                           MachineRepresentation::kFloat64
-                       ? kDoubleSize / kPointerSize
-                       : 1;
-    }
-    Emit(kS390_StackClaim, g.NoOutput(), g.TempImmediate(num_slots));
-    for (PushParameter input : *arguments) {
-      // Skip any alignment holes in pushed nodes.
-      if (input.node) {
-        Emit(kS390_StoreToStackSlot, g.NoOutput(), g.UseRegister(input.node),
-             g.TempImmediate(slot));
-        slot += input.location.GetType().representation() ==
-                        MachineRepresentation::kFloat64
-                    ? (kDoubleSize / kPointerSize)
-                    : 1;
-      }
-    }
-    DCHECK(num_slots == slot);
-  }
-}
-
-bool InstructionSelector::IsTailCallAddressImmediate() { return false; }
-
-int InstructionSelector::GetTempsCountForTailCallFromJSFunction() { return 3; }
-
-void InstructionSelector::VisitAtomicLoad(Node* node) {
-  LoadRepresentation load_rep = LoadRepresentationOf(node->op());
-  S390OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  ArchOpcode opcode = kArchNop;
-  switch (load_rep.representation()) {
-    case MachineRepresentation::kWord8:
-      opcode = load_rep.IsSigned() ? kAtomicLoadInt8 : kAtomicLoadUint8;
-      break;
-    case MachineRepresentation::kWord16:
-      opcode = load_rep.IsSigned() ? kAtomicLoadInt16 : kAtomicLoadUint16;
-      break;
-    case MachineRepresentation::kWord32:
-      opcode = kAtomicLoadWord32;
-      break;
-    default:
-      UNREACHABLE();
-      return;
-  }
-  Emit(opcode | AddressingModeField::encode(kMode_MRR),
-       g.DefineAsRegister(node), g.UseRegister(base), g.UseRegister(index));
-}
-
-void InstructionSelector::VisitAtomicStore(Node* node) {
-  MachineRepresentation rep = AtomicStoreRepresentationOf(node->op());
-  S390OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-  ArchOpcode opcode = kArchNop;
-  switch (rep) {
-    case MachineRepresentation::kWord8:
-      opcode = kAtomicStoreWord8;
-      break;
-    case MachineRepresentation::kWord16:
-      opcode = kAtomicStoreWord16;
-      break;
-    case MachineRepresentation::kWord32:
-      opcode = kAtomicStoreWord32;
-      break;
-    default:
-      UNREACHABLE();
-      return;
-  }
-
-  InstructionOperand inputs[4];
-  size_t input_count = 0;
-  inputs[input_count++] = g.UseUniqueRegister(value);
-  inputs[input_count++] = g.UseUniqueRegister(base);
-  inputs[input_count++] = g.UseUniqueRegister(index);
-  Emit(opcode | AddressingModeField::encode(kMode_MRR), 0, nullptr, input_count,
-       inputs);
-}
-
-void InstructionSelector::VisitAtomicExchange(Node* node) {
-  S390OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-  ArchOpcode opcode = kArchNop;
-  MachineType type = AtomicOpRepresentationOf(node->op());
-  if (type == MachineType::Int8()) {
-    opcode = kAtomicExchangeInt8;
-  } else if (type == MachineType::Uint8()) {
-    opcode = kAtomicExchangeUint8;
-  } else if (type == MachineType::Int16()) {
-    opcode = kAtomicExchangeInt16;
-  } else if (type == MachineType::Uint16()) {
-    opcode = kAtomicExchangeUint16;
-  } else if (type == MachineType::Int32() || type == MachineType::Uint32()) {
-    opcode = kAtomicExchangeWord32;
-  } else {
-    UNREACHABLE();
-    return;
-  }
-
-  AddressingMode addressing_mode = kMode_MRR;
-  InstructionOperand inputs[3];
-  size_t input_count = 0;
-  inputs[input_count++] = g.UseUniqueRegister(base);
-  inputs[input_count++] = g.UseUniqueRegister(index);
-  inputs[input_count++] = g.UseUniqueRegister(value);
-  InstructionOperand outputs[1];
-  outputs[0] = g.UseUniqueRegister(node);
-  InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
-  Emit(code, 1, outputs, input_count, inputs);
-}
-
-void InstructionSelector::VisitAtomicCompareExchange(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitAtomicAdd(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitAtomicSub(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitAtomicAnd(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitAtomicOr(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitAtomicXor(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4Splat(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4ExtractLane(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4ReplaceLane(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4Add(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4Sub(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4Shl(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4ShrS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4Mul(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4MaxS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4MinS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4Eq(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4Ne(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4MinU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4MaxU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4ShrU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4Neg(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4GtS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4GeS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4GtU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI32x4GeU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8Splat(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8ExtractLane(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8ReplaceLane(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8Shl(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8ShrS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8ShrU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8Add(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8AddSaturateS(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitI16x8Sub(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8SubSaturateS(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitI16x8Mul(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8MinS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8MaxS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8Eq(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8Ne(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8AddSaturateU(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitI16x8SubSaturateU(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitI16x8MinU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8MaxU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8Neg(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8GtS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8GeS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8GtU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI16x8GeU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16Neg(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16Splat(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16ExtractLane(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16ReplaceLane(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16Add(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16AddSaturateS(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitI8x16Sub(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16SubSaturateS(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitI8x16MinS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16MaxS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16Eq(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16Ne(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16GtS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16GeS(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16AddSaturateU(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitI8x16SubSaturateU(Node* node) {
-  UNIMPLEMENTED();
-}
-
-void InstructionSelector::VisitI8x16MinU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16MaxU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16GtU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitI8x16GeU(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitS128And(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitS128Or(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitS128Xor(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitS128Not(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitS128Zero(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitF32x4Eq(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitF32x4Ne(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitF32x4Lt(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitF32x4Le(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitF32x4Splat(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitF32x4ExtractLane(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitF32x4ReplaceLane(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::EmitPrepareResults(ZoneVector<PushParameter>* results,
-                                             const CallDescriptor* descriptor,
-                                             Node* node) {
-  // TODO(John): Port.
-}
-
-void InstructionSelector::VisitF32x4Add(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitF32x4Sub(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitF32x4Mul(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitF32x4Min(Node* node) { UNIMPLEMENTED(); }
-
-void InstructionSelector::VisitF32x4Max(Node* node) { UNIMPLEMENTED(); }
-
-// static
-MachineOperatorBuilder::Flags
-InstructionSelector::SupportedMachineOperatorFlags() {
-  return MachineOperatorBuilder::kFloat32RoundDown |
-         MachineOperatorBuilder::kFloat64RoundDown |
-         MachineOperatorBuilder::kFloat32RoundUp |
-         MachineOperatorBuilder::kFloat64RoundUp |
-         MachineOperatorBuilder::kFloat32RoundTruncate |
-         MachineOperatorBuilder::kFloat64RoundTruncate |
-         MachineOperatorBuilder::kFloat64RoundTiesAway |
-         MachineOperatorBuilder::kWord32Popcnt |
-         MachineOperatorBuilder::kWord32ReverseBytes |
-         MachineOperatorBuilder::kWord64ReverseBytes |
-         MachineOperatorBuilder::kInt32AbsWithOverflow |
-         MachineOperatorBuilder::kInt64AbsWithOverflow |
-         MachineOperatorBuilder::kWord64Popcnt;
-}
-
-// static
-MachineOperatorBuilder::AlignmentRequirements
-InstructionSelector::AlignmentRequirements() {
-  return MachineOperatorBuilder::AlignmentRequirements::
-      FullUnalignedAccessSupport();
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/unwinding-info-writer.h b/src/v8/src/compiler/unwinding-info-writer.h
deleted file mode 100644
index 86f5e9e..0000000
--- a/src/v8/src/compiler/unwinding-info-writer.h
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_UNWINDING_INFO_WRITER_H_
-#define V8_COMPILER_UNWINDING_INFO_WRITER_H_
-
-#if V8_TARGET_ARCH_ARM
-#include "src/compiler/arm/unwinding-info-writer-arm.h"
-#elif V8_TARGET_ARCH_ARM64
-#include "src/compiler/arm64/unwinding-info-writer-arm64.h"
-#elif V8_TARGET_ARCH_X64
-#include "src/compiler/x64/unwinding-info-writer-x64.h"
-#else
-
-// Placeholder for unsupported architectures.
-
-#include "src/base/logging.h"
-
-namespace v8 {
-namespace internal {
-
-class EhFrameWriter;
-
-namespace compiler {
-
-class InstructionBlock;
-
-class UnwindingInfoWriter {
- public:
-  explicit UnwindingInfoWriter(Zone* zone) {}
-
-  void SetNumberOfInstructionBlocks(int number) {
-    if (FLAG_perf_prof_unwinding_info) UNIMPLEMENTED();
-  }
-
-  void BeginInstructionBlock(int pc_offset, const InstructionBlock* block) {
-    if (FLAG_perf_prof_unwinding_info) UNIMPLEMENTED();
-  }
-  void EndInstructionBlock(const InstructionBlock* block) {
-    if (FLAG_perf_prof_unwinding_info) UNIMPLEMENTED();
-  }
-
-  void Finish(int code_size) {}
-
-  EhFrameWriter* eh_frame_writer() { return nullptr; }
-};
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif
-
-#endif
diff --git a/src/v8/src/compiler/wasm-linkage.cc b/src/v8/src/compiler/wasm-linkage.cc
deleted file mode 100644
index e7bb3c1..0000000
--- a/src/v8/src/compiler/wasm-linkage.cc
+++ /dev/null
@@ -1,365 +0,0 @@
-// Copyright 2015 the V8 project 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 "src/assembler-inl.h"
-#include "src/base/lazy-instance.h"
-#include "src/macro-assembler.h"
-#include "src/register-configuration.h"
-
-#include "src/compiler/linkage.h"
-#include "src/compiler/wasm-compiler.h"
-
-#include "src/zone/zone.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-using wasm::ValueType;
-
-namespace {
-
-MachineType MachineTypeFor(ValueType type) {
-  switch (type) {
-    case wasm::kWasmI32:
-      return MachineType::Int32();
-    case wasm::kWasmI64:
-      return MachineType::Int64();
-    case wasm::kWasmF64:
-      return MachineType::Float64();
-    case wasm::kWasmF32:
-      return MachineType::Float32();
-    case wasm::kWasmS128:
-      return MachineType::Simd128();
-    default:
-      UNREACHABLE();
-  }
-}
-
-LinkageLocation stackloc(int i, MachineType type) {
-  return LinkageLocation::ForCallerFrameSlot(i, type);
-}
-
-
-#if V8_TARGET_ARCH_IA32
-// ===========================================================================
-// == ia32 ===================================================================
-// ===========================================================================
-#define GP_PARAM_REGISTERS esi, eax, edx, ecx, ebx
-#define GP_RETURN_REGISTERS eax, edx
-#define FP_PARAM_REGISTERS xmm1, xmm2, xmm3, xmm4, xmm5, xmm6
-#define FP_RETURN_REGISTERS xmm1, xmm2
-
-#elif V8_TARGET_ARCH_X64
-// ===========================================================================
-// == x64 ====================================================================
-// ===========================================================================
-#define GP_PARAM_REGISTERS rsi, rax, rdx, rcx, rbx, rdi
-#define GP_RETURN_REGISTERS rax, rdx
-#define FP_PARAM_REGISTERS xmm1, xmm2, xmm3, xmm4, xmm5, xmm6
-#define FP_RETURN_REGISTERS xmm1, xmm2
-
-#elif V8_TARGET_ARCH_ARM
-// ===========================================================================
-// == arm ====================================================================
-// ===========================================================================
-#define GP_PARAM_REGISTERS r3, r0, r1, r2
-#define GP_RETURN_REGISTERS r0, r1
-#define FP_PARAM_REGISTERS d0, d1, d2, d3, d4, d5, d6, d7
-#define FP_RETURN_REGISTERS d0, d1
-
-#elif V8_TARGET_ARCH_ARM64
-// ===========================================================================
-// == arm64 ====================================================================
-// ===========================================================================
-#define GP_PARAM_REGISTERS x7, x0, x1, x2, x3, x4, x5, x6
-#define GP_RETURN_REGISTERS x0, x1
-#define FP_PARAM_REGISTERS d0, d1, d2, d3, d4, d5, d6, d7
-#define FP_RETURN_REGISTERS d0, d1
-
-#elif V8_TARGET_ARCH_MIPS
-// ===========================================================================
-// == mips ===================================================================
-// ===========================================================================
-#define GP_PARAM_REGISTERS a0, a1, a2, a3
-#define GP_RETURN_REGISTERS v0, v1
-#define FP_PARAM_REGISTERS f2, f4, f6, f8, f10, f12, f14
-#define FP_RETURN_REGISTERS f2, f4
-
-#elif V8_TARGET_ARCH_MIPS64
-// ===========================================================================
-// == mips64 =================================================================
-// ===========================================================================
-#define GP_PARAM_REGISTERS a0, a1, a2, a3, a4, a5, a6, a7
-#define GP_RETURN_REGISTERS v0, v1
-#define FP_PARAM_REGISTERS f2, f4, f6, f8, f10, f12, f14
-#define FP_RETURN_REGISTERS f2, f4
-
-#elif V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_PPC64
-// ===========================================================================
-// == ppc & ppc64 ============================================================
-// ===========================================================================
-#define GP_PARAM_REGISTERS r10, r3, r4, r5, r6, r7, r8, r9
-#define GP_RETURN_REGISTERS r3, r4
-#define FP_PARAM_REGISTERS d1, d2, d3, d4, d5, d6, d7, d8
-#define FP_RETURN_REGISTERS d1, d2
-
-#elif V8_TARGET_ARCH_S390X
-// ===========================================================================
-// == s390x ==================================================================
-// ===========================================================================
-#define GP_PARAM_REGISTERS r6, r2, r3, r4, r5
-#define GP_RETURN_REGISTERS r2, r3
-#define FP_PARAM_REGISTERS d0, d2, d4, d6
-#define FP_RETURN_REGISTERS d0, d2, d4, d6
-
-#elif V8_TARGET_ARCH_S390
-// ===========================================================================
-// == s390 ===================================================================
-// ===========================================================================
-#define GP_PARAM_REGISTERS r6, r2, r3, r4, r5
-#define GP_RETURN_REGISTERS r2, r3
-#define FP_PARAM_REGISTERS d0, d2
-#define FP_RETURN_REGISTERS d0, d2
-
-#else
-// ===========================================================================
-// == unknown ================================================================
-// ===========================================================================
-// Do not use any registers, we will just always use the stack.
-#define GP_PARAM_REGISTERS
-#define GP_RETURN_REGISTERS
-#define FP_PARAM_REGISTERS
-#define FP_RETURN_REGISTERS
-
-#endif
-
-
-// Helper for allocating either an GP or FP reg, or the next stack slot.
-struct Allocator {
-  constexpr Allocator(const Register* gp, int gpc, const DoubleRegister* fp,
-                      int fpc)
-      : gp_count(gpc),
-        gp_offset(0),
-        gp_regs(gp),
-        fp_count(fpc),
-        fp_offset(0),
-        fp_regs(fp),
-        stack_offset(0) {}
-
-  int gp_count;
-  int gp_offset;
-  const Register* gp_regs;
-
-  int fp_count;
-  int fp_offset;
-  const DoubleRegister* fp_regs;
-
-  int stack_offset;
-
-  void AdjustStackOffset(int offset) { stack_offset += offset; }
-
-  LinkageLocation Next(ValueType type) {
-    if (IsFloatingPoint(type)) {
-      // Allocate a floating point register/stack location.
-      if (fp_offset < fp_count) {
-        DoubleRegister reg = fp_regs[fp_offset++];
-#if V8_TARGET_ARCH_ARM
-        // Allocate floats using a double register, but modify the code to
-        // reflect how ARM FP registers alias.
-        // TODO(bbudge) Modify wasm linkage to allow use of all float regs.
-        if (type == wasm::kWasmF32) {
-          int float_reg_code = reg.code() * 2;
-          DCHECK_GT(RegisterConfiguration::kMaxFPRegisters, float_reg_code);
-          return LinkageLocation::ForRegister(
-              DoubleRegister::from_code(float_reg_code).code(),
-              MachineTypeFor(type));
-        }
-#endif
-        return LinkageLocation::ForRegister(reg.code(), MachineTypeFor(type));
-      } else {
-        int offset = -1 - stack_offset;
-        stack_offset += Words(type);
-        return stackloc(offset, MachineTypeFor(type));
-      }
-    } else {
-      // Allocate a general purpose register/stack location.
-      if (gp_offset < gp_count) {
-        return LinkageLocation::ForRegister(gp_regs[gp_offset++].code(),
-                                            MachineTypeFor(type));
-      } else {
-        int offset = -1 - stack_offset;
-        stack_offset += Words(type);
-        return stackloc(offset, MachineTypeFor(type));
-      }
-    }
-  }
-  bool IsFloatingPoint(ValueType type) {
-    return type == wasm::kWasmF32 || type == wasm::kWasmF64;
-  }
-  int Words(ValueType type) {
-    if (kPointerSize < 8 &&
-        (type == wasm::kWasmI64 || type == wasm::kWasmF64)) {
-      return 2;
-    }
-    return 1;
-  }
-};
-
-static constexpr Register kGPReturnRegisters[] = {GP_RETURN_REGISTERS};
-static constexpr DoubleRegister kFPReturnRegisters[] = {FP_RETURN_REGISTERS};
-static constexpr Register kGPParamRegisters[] = {GP_PARAM_REGISTERS};
-static constexpr DoubleRegister kFPParamRegisters[] = {FP_PARAM_REGISTERS};
-static constexpr Allocator return_registers(kGPReturnRegisters,
-                                            arraysize(kGPReturnRegisters),
-                                            kFPReturnRegisters,
-                                            arraysize(kFPReturnRegisters));
-static constexpr Allocator parameter_registers(kGPParamRegisters,
-                                               arraysize(kGPParamRegisters),
-                                               kFPParamRegisters,
-                                               arraysize(kFPParamRegisters));
-
-}  // namespace
-
-// General code uses the above configuration data.
-CallDescriptor* GetWasmCallDescriptor(Zone* zone, wasm::FunctionSig* fsig) {
-  // The '+ 1' here is to accomodate the wasm_context as first parameter.
-  LocationSignature::Builder locations(zone, fsig->return_count(),
-                                       fsig->parameter_count() + 1);
-
-  // Add register and/or stack parameter(s).
-  Allocator params = parameter_registers;
-
-  // The wasm_context.
-  locations.AddParam(params.Next(MachineType::PointerRepresentation()));
-
-  const int parameter_count = static_cast<int>(fsig->parameter_count());
-  for (int i = 0; i < parameter_count; i++) {
-    ValueType param = fsig->GetParam(i);
-    auto l = params.Next(param);
-    locations.AddParam(l);
-  }
-
-  // Add return location(s).
-  Allocator rets = return_registers;
-  rets.AdjustStackOffset(params.stack_offset);
-
-  const int return_count = static_cast<int>(locations.return_count_);
-  for (int i = 0; i < return_count; i++) {
-    ValueType ret = fsig->GetReturn(i);
-    auto l = rets.Next(ret);
-    locations.AddReturn(l);
-  }
-
-  const RegList kCalleeSaveRegisters = 0;
-  const RegList kCalleeSaveFPRegisters = 0;
-
-  // The target for wasm calls is always a code object.
-  MachineType target_type = FLAG_wasm_jit_to_native ? MachineType::Pointer()
-                                                    : MachineType::AnyTagged();
-  LinkageLocation target_loc = LinkageLocation::ForAnyRegister(target_type);
-
-  CallDescriptor::Kind kind = FLAG_wasm_jit_to_native
-                                  ? CallDescriptor::kCallWasmFunction
-                                  : CallDescriptor::kCallCodeObject;
-
-  return new (zone) CallDescriptor(              // --
-      kind,                                      // kind
-      target_type,                               // target MachineType
-      target_loc,                                // target location
-      locations.Build(),                         // location_sig
-      params.stack_offset,                       // stack_parameter_count
-      compiler::Operator::kNoProperties,         // properties
-      kCalleeSaveRegisters,                      // callee-saved registers
-      kCalleeSaveFPRegisters,                    // callee-saved fp regs
-      CallDescriptor::kNoFlags,                  // flags
-      "wasm-call",                               // debug name
-      0,                                         // allocatable registers
-      rets.stack_offset - params.stack_offset);  // stack_return_count
-}
-
-CallDescriptor* ReplaceTypeInCallDescriptorWith(
-    Zone* zone, CallDescriptor* descriptor, size_t num_replacements,
-    MachineType input_type, MachineRepresentation output_type) {
-  size_t parameter_count = descriptor->ParameterCount();
-  size_t return_count = descriptor->ReturnCount();
-  for (size_t i = 0; i < descriptor->ParameterCount(); i++) {
-    if (descriptor->GetParameterType(i) == input_type) {
-      parameter_count += num_replacements - 1;
-    }
-  }
-  for (size_t i = 0; i < descriptor->ReturnCount(); i++) {
-    if (descriptor->GetReturnType(i) == input_type) {
-      return_count += num_replacements - 1;
-    }
-  }
-  if (parameter_count == descriptor->ParameterCount() &&
-      return_count == descriptor->ReturnCount()) {
-    return descriptor;
-  }
-
-  LocationSignature::Builder locations(zone, return_count, parameter_count);
-
-  Allocator params = parameter_registers;
-  for (size_t i = 0; i < descriptor->ParameterCount(); i++) {
-    if (descriptor->GetParameterType(i) == input_type) {
-      for (size_t j = 0; j < num_replacements; j++) {
-        locations.AddParam(params.Next(output_type));
-      }
-    } else {
-      locations.AddParam(
-          params.Next(descriptor->GetParameterType(i).representation()));
-    }
-  }
-
-  Allocator rets = return_registers;
-  rets.AdjustStackOffset(params.stack_offset);
-  for (size_t i = 0; i < descriptor->ReturnCount(); i++) {
-    if (descriptor->GetReturnType(i) == input_type) {
-      for (size_t j = 0; j < num_replacements; j++) {
-        locations.AddReturn(rets.Next(output_type));
-      }
-    } else {
-      locations.AddReturn(
-          rets.Next(descriptor->GetReturnType(i).representation()));
-    }
-  }
-
-  return new (zone) CallDescriptor(              // --
-      descriptor->kind(),                        // kind
-      descriptor->GetInputType(0),               // target MachineType
-      descriptor->GetInputLocation(0),           // target location
-      locations.Build(),                         // location_sig
-      params.stack_offset,                       // stack_parameter_count
-      descriptor->properties(),                  // properties
-      descriptor->CalleeSavedRegisters(),        // callee-saved registers
-      descriptor->CalleeSavedFPRegisters(),      // callee-saved fp regs
-      descriptor->flags(),                       // flags
-      descriptor->debug_name(),                  // debug name
-      descriptor->AllocatableRegisters(),        // allocatable registers
-      rets.stack_offset - params.stack_offset);  // stack_return_count
-}
-
-CallDescriptor* GetI32WasmCallDescriptor(Zone* zone,
-                                         CallDescriptor* descriptor) {
-  return ReplaceTypeInCallDescriptorWith(zone, descriptor, 2,
-                                         MachineType::Int64(),
-                                         MachineRepresentation::kWord32);
-}
-
-CallDescriptor* GetI32WasmCallDescriptorForSimd(Zone* zone,
-                                                CallDescriptor* descriptor) {
-  return ReplaceTypeInCallDescriptorWith(zone, descriptor, 4,
-                                         MachineType::Simd128(),
-                                         MachineRepresentation::kWord32);
-}
-
-#undef GP_PARAM_REGISTERS
-#undef GP_RETURN_REGISTERS
-#undef FP_PARAM_REGISTERS
-#undef FP_RETURN_REGISTERS
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/x64/code-generator-x64.cc b/src/v8/src/compiler/x64/code-generator-x64.cc
deleted file mode 100644
index bc92f97..0000000
--- a/src/v8/src/compiler/x64/code-generator-x64.cc
+++ /dev/null
@@ -1,3341 +0,0 @@
-// Copyright 2013 the V8 project 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 "src/compiler/code-generator.h"
-
-#include <limits>
-
-#include "src/compilation-info.h"
-#include "src/compiler/code-generator-impl.h"
-#include "src/compiler/gap-resolver.h"
-#include "src/compiler/node-matchers.h"
-#include "src/compiler/osr.h"
-#include "src/heap/heap-inl.h"
-#include "src/x64/assembler-x64.h"
-#include "src/x64/macro-assembler-x64.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-#define __ tasm()->
-
-// Adds X64 specific methods for decoding operands.
-class X64OperandConverter : public InstructionOperandConverter {
- public:
-  X64OperandConverter(CodeGenerator* gen, Instruction* instr)
-      : InstructionOperandConverter(gen, instr) {}
-
-  Immediate InputImmediate(size_t index) {
-    return ToImmediate(instr_->InputAt(index));
-  }
-
-  Operand InputOperand(size_t index, int extra = 0) {
-    return ToOperand(instr_->InputAt(index), extra);
-  }
-
-  Operand OutputOperand() { return ToOperand(instr_->Output()); }
-
-  Immediate ToImmediate(InstructionOperand* operand) {
-    Constant constant = ToConstant(operand);
-    if (constant.type() == Constant::kFloat64) {
-      DCHECK_EQ(0, constant.ToFloat64().AsUint64());
-      return Immediate(0);
-    }
-    if (RelocInfo::IsWasmReference(constant.rmode())) {
-      return Immediate(constant.ToInt32(), constant.rmode());
-    }
-    return Immediate(constant.ToInt32());
-  }
-
-  Operand ToOperand(InstructionOperand* op, int extra = 0) {
-    DCHECK(op->IsStackSlot() || op->IsFPStackSlot());
-    return SlotToOperand(AllocatedOperand::cast(op)->index(), extra);
-  }
-
-  Operand SlotToOperand(int slot_index, int extra = 0) {
-    FrameOffset offset = frame_access_state()->GetFrameOffset(slot_index);
-    return Operand(offset.from_stack_pointer() ? rsp : rbp,
-                   offset.offset() + extra);
-  }
-
-  static size_t NextOffset(size_t* offset) {
-    size_t i = *offset;
-    (*offset)++;
-    return i;
-  }
-
-  static ScaleFactor ScaleFor(AddressingMode one, AddressingMode mode) {
-    STATIC_ASSERT(0 == static_cast<int>(times_1));
-    STATIC_ASSERT(1 == static_cast<int>(times_2));
-    STATIC_ASSERT(2 == static_cast<int>(times_4));
-    STATIC_ASSERT(3 == static_cast<int>(times_8));
-    int scale = static_cast<int>(mode - one);
-    DCHECK(scale >= 0 && scale < 4);
-    return static_cast<ScaleFactor>(scale);
-  }
-
-  Operand MemoryOperand(size_t* offset) {
-    AddressingMode mode = AddressingModeField::decode(instr_->opcode());
-    switch (mode) {
-      case kMode_MR: {
-        Register base = InputRegister(NextOffset(offset));
-        int32_t disp = 0;
-        return Operand(base, disp);
-      }
-      case kMode_MRI: {
-        Register base = InputRegister(NextOffset(offset));
-        int32_t disp = InputInt32(NextOffset(offset));
-        return Operand(base, disp);
-      }
-      case kMode_MR1:
-      case kMode_MR2:
-      case kMode_MR4:
-      case kMode_MR8: {
-        Register base = InputRegister(NextOffset(offset));
-        Register index = InputRegister(NextOffset(offset));
-        ScaleFactor scale = ScaleFor(kMode_MR1, mode);
-        int32_t disp = 0;
-        return Operand(base, index, scale, disp);
-      }
-      case kMode_MR1I:
-      case kMode_MR2I:
-      case kMode_MR4I:
-      case kMode_MR8I: {
-        Register base = InputRegister(NextOffset(offset));
-        Register index = InputRegister(NextOffset(offset));
-        ScaleFactor scale = ScaleFor(kMode_MR1I, mode);
-        int32_t disp = InputInt32(NextOffset(offset));
-        return Operand(base, index, scale, disp);
-      }
-      case kMode_M1: {
-        Register base = InputRegister(NextOffset(offset));
-        int32_t disp = 0;
-        return Operand(base, disp);
-      }
-      case kMode_M2:
-        UNREACHABLE();  // Should use kModeMR with more compact encoding instead
-        return Operand(no_reg, 0);
-      case kMode_M4:
-      case kMode_M8: {
-        Register index = InputRegister(NextOffset(offset));
-        ScaleFactor scale = ScaleFor(kMode_M1, mode);
-        int32_t disp = 0;
-        return Operand(index, scale, disp);
-      }
-      case kMode_M1I:
-      case kMode_M2I:
-      case kMode_M4I:
-      case kMode_M8I: {
-        Register index = InputRegister(NextOffset(offset));
-        ScaleFactor scale = ScaleFor(kMode_M1I, mode);
-        int32_t disp = InputInt32(NextOffset(offset));
-        return Operand(index, scale, disp);
-      }
-      case kMode_Root: {
-        Register base = kRootRegister;
-        int32_t disp = InputInt32(NextOffset(offset));
-        return Operand(base, disp);
-      }
-      case kMode_None:
-        UNREACHABLE();
-    }
-    UNREACHABLE();
-  }
-
-  Operand MemoryOperand(size_t first_input = 0) {
-    return MemoryOperand(&first_input);
-  }
-};
-
-
-namespace {
-
-bool HasImmediateInput(Instruction* instr, size_t index) {
-  return instr->InputAt(index)->IsImmediate();
-}
-
-class OutOfLineLoadFloat32NaN final : public OutOfLineCode {
- public:
-  OutOfLineLoadFloat32NaN(CodeGenerator* gen, XMMRegister result)
-      : OutOfLineCode(gen), result_(result) {}
-
-  void Generate() final {
-    __ Xorps(result_, result_);
-    __ Divss(result_, result_);
-  }
-
- private:
-  XMMRegister const result_;
-};
-
-class OutOfLineLoadFloat64NaN final : public OutOfLineCode {
- public:
-  OutOfLineLoadFloat64NaN(CodeGenerator* gen, XMMRegister result)
-      : OutOfLineCode(gen), result_(result) {}
-
-  void Generate() final {
-    __ Xorpd(result_, result_);
-    __ Divsd(result_, result_);
-  }
-
- private:
-  XMMRegister const result_;
-};
-
-class OutOfLineTruncateDoubleToI final : public OutOfLineCode {
- public:
-  OutOfLineTruncateDoubleToI(CodeGenerator* gen, Register result,
-                             XMMRegister input,
-                             UnwindingInfoWriter* unwinding_info_writer)
-      : OutOfLineCode(gen),
-        result_(result),
-        input_(input),
-        unwinding_info_writer_(unwinding_info_writer),
-        zone_(gen->zone()) {}
-
-  void Generate() final {
-    __ subp(rsp, Immediate(kDoubleSize));
-    unwinding_info_writer_->MaybeIncreaseBaseOffsetAt(__ pc_offset(),
-                                                      kDoubleSize);
-    __ Movsd(MemOperand(rsp, 0), input_);
-    __ SlowTruncateToIDelayed(zone_, result_);
-    __ addp(rsp, Immediate(kDoubleSize));
-    unwinding_info_writer_->MaybeIncreaseBaseOffsetAt(__ pc_offset(),
-                                                      -kDoubleSize);
-  }
-
- private:
-  Register const result_;
-  XMMRegister const input_;
-  UnwindingInfoWriter* const unwinding_info_writer_;
-  Zone* zone_;
-};
-
-
-class OutOfLineRecordWrite final : public OutOfLineCode {
- public:
-  OutOfLineRecordWrite(CodeGenerator* gen, Register object, Operand operand,
-                       Register value, Register scratch0, Register scratch1,
-                       RecordWriteMode mode)
-      : OutOfLineCode(gen),
-        object_(object),
-        operand_(operand),
-        value_(value),
-        scratch0_(scratch0),
-        scratch1_(scratch1),
-        mode_(mode),
-        zone_(gen->zone()) {}
-
-  void Generate() final {
-    if (mode_ > RecordWriteMode::kValueIsPointer) {
-      __ JumpIfSmi(value_, exit());
-    }
-    __ CheckPageFlag(value_, scratch0_,
-                     MemoryChunk::kPointersToHereAreInterestingMask, zero,
-                     exit());
-    __ leap(scratch1_, operand_);
-
-    RememberedSetAction const remembered_set_action =
-        mode_ > RecordWriteMode::kValueIsMap ? EMIT_REMEMBERED_SET
-                                             : OMIT_REMEMBERED_SET;
-    SaveFPRegsMode const save_fp_mode =
-        frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
-
-    __ CallRecordWriteStub(object_, scratch1_, remembered_set_action,
-                           save_fp_mode);
-  }
-
- private:
-  Register const object_;
-  Operand const operand_;
-  Register const value_;
-  Register const scratch0_;
-  Register const scratch1_;
-  RecordWriteMode const mode_;
-  Zone* zone_;
-};
-
-class WasmOutOfLineTrap final : public OutOfLineCode {
- public:
-  WasmOutOfLineTrap(CodeGenerator* gen, int pc, bool frame_elided,
-                    Instruction* instr)
-      : OutOfLineCode(gen),
-        gen_(gen),
-        pc_(pc),
-        frame_elided_(frame_elided),
-        instr_(instr) {}
-
-  // TODO(eholk): Refactor this method to take the code generator as a
-  // parameter.
-  void Generate() final {
-    gen_->AddProtectedInstructionLanding(pc_, __ pc_offset());
-
-    if (frame_elided_) {
-      __ EnterFrame(StackFrame::WASM_COMPILED);
-    }
-
-    gen_->AssembleSourcePosition(instr_);
-    __ Call(__ isolate()->builtins()->builtin_handle(
-                Builtins::kThrowWasmTrapMemOutOfBounds),
-            RelocInfo::CODE_TARGET);
-    ReferenceMap* reference_map = new (gen_->zone()) ReferenceMap(gen_->zone());
-    gen_->RecordSafepoint(reference_map, Safepoint::kSimple, 0,
-                          Safepoint::kNoLazyDeopt);
-    __ AssertUnreachable(AbortReason::kUnexpectedReturnFromWasmTrap);
-  }
-
- private:
-  CodeGenerator* gen_;
-  int pc_;
-  bool frame_elided_;
-  Instruction* instr_;
-};
-
-void EmitOOLTrapIfNeeded(Zone* zone, CodeGenerator* codegen,
-                         InstructionCode opcode, Instruction* instr,
-                         X64OperandConverter& i, int pc) {
-  const X64MemoryProtection protection =
-      static_cast<X64MemoryProtection>(MiscField::decode(opcode));
-  if (protection == X64MemoryProtection::kProtected) {
-    const bool frame_elided = !codegen->frame_access_state()->has_frame();
-    new (zone) WasmOutOfLineTrap(codegen, pc, frame_elided, instr);
-  }
-}
-}  // namespace
-
-
-#define ASSEMBLE_UNOP(asm_instr)         \
-  do {                                   \
-    if (instr->Output()->IsRegister()) { \
-      __ asm_instr(i.OutputRegister());  \
-    } else {                             \
-      __ asm_instr(i.OutputOperand());   \
-    }                                    \
-  } while (0)
-
-#define ASSEMBLE_BINOP(asm_instr)                                     \
-  do {                                                                \
-    if (AddressingModeField::decode(instr->opcode()) != kMode_None) { \
-      size_t index = 1;                                               \
-      Operand right = i.MemoryOperand(&index);                        \
-      __ asm_instr(i.InputRegister(0), right);                        \
-    } else {                                                          \
-      if (HasImmediateInput(instr, 1)) {                              \
-        if (instr->InputAt(0)->IsRegister()) {                        \
-          __ asm_instr(i.InputRegister(0), i.InputImmediate(1));      \
-        } else {                                                      \
-          __ asm_instr(i.InputOperand(0), i.InputImmediate(1));       \
-        }                                                             \
-      } else {                                                        \
-        if (instr->InputAt(1)->IsRegister()) {                        \
-          __ asm_instr(i.InputRegister(0), i.InputRegister(1));       \
-        } else {                                                      \
-          __ asm_instr(i.InputRegister(0), i.InputOperand(1));        \
-        }                                                             \
-      }                                                               \
-    }                                                                 \
-  } while (0)
-
-#define ASSEMBLE_COMPARE(asm_instr)                                   \
-  do {                                                                \
-    if (AddressingModeField::decode(instr->opcode()) != kMode_None) { \
-      size_t index = 0;                                               \
-      Operand left = i.MemoryOperand(&index);                         \
-      if (HasImmediateInput(instr, index)) {                          \
-        __ asm_instr(left, i.InputImmediate(index));                  \
-      } else {                                                        \
-        __ asm_instr(left, i.InputRegister(index));                   \
-      }                                                               \
-    } else {                                                          \
-      if (HasImmediateInput(instr, 1)) {                              \
-        if (instr->InputAt(0)->IsRegister()) {                        \
-          __ asm_instr(i.InputRegister(0), i.InputImmediate(1));      \
-        } else {                                                      \
-          __ asm_instr(i.InputOperand(0), i.InputImmediate(1));       \
-        }                                                             \
-      } else {                                                        \
-        if (instr->InputAt(1)->IsRegister()) {                        \
-          __ asm_instr(i.InputRegister(0), i.InputRegister(1));       \
-        } else {                                                      \
-          __ asm_instr(i.InputRegister(0), i.InputOperand(1));        \
-        }                                                             \
-      }                                                               \
-    }                                                                 \
-  } while (0)
-
-#define ASSEMBLE_MULT(asm_instr)                              \
-  do {                                                        \
-    if (HasImmediateInput(instr, 1)) {                        \
-      if (instr->InputAt(0)->IsRegister()) {                  \
-        __ asm_instr(i.OutputRegister(), i.InputRegister(0),  \
-                     i.InputImmediate(1));                    \
-      } else {                                                \
-        __ asm_instr(i.OutputRegister(), i.InputOperand(0),   \
-                     i.InputImmediate(1));                    \
-      }                                                       \
-    } else {                                                  \
-      if (instr->InputAt(1)->IsRegister()) {                  \
-        __ asm_instr(i.OutputRegister(), i.InputRegister(1)); \
-      } else {                                                \
-        __ asm_instr(i.OutputRegister(), i.InputOperand(1));  \
-      }                                                       \
-    }                                                         \
-  } while (0)
-
-
-#define ASSEMBLE_SHIFT(asm_instr, width)                                   \
-  do {                                                                     \
-    if (HasImmediateInput(instr, 1)) {                                     \
-      if (instr->Output()->IsRegister()) {                                 \
-        __ asm_instr(i.OutputRegister(), Immediate(i.InputInt##width(1))); \
-      } else {                                                             \
-        __ asm_instr(i.OutputOperand(), Immediate(i.InputInt##width(1)));  \
-      }                                                                    \
-    } else {                                                               \
-      if (instr->Output()->IsRegister()) {                                 \
-        __ asm_instr##_cl(i.OutputRegister());                             \
-      } else {                                                             \
-        __ asm_instr##_cl(i.OutputOperand());                              \
-      }                                                                    \
-    }                                                                      \
-  } while (0)
-
-
-#define ASSEMBLE_MOVX(asm_instr)                            \
-  do {                                                      \
-    if (instr->addressing_mode() != kMode_None) {           \
-      __ asm_instr(i.OutputRegister(), i.MemoryOperand());  \
-    } else if (instr->InputAt(0)->IsRegister()) {           \
-      __ asm_instr(i.OutputRegister(), i.InputRegister(0)); \
-    } else {                                                \
-      __ asm_instr(i.OutputRegister(), i.InputOperand(0));  \
-    }                                                       \
-  } while (0)
-
-#define ASSEMBLE_SSE_BINOP(asm_instr)                                   \
-  do {                                                                  \
-    if (instr->InputAt(1)->IsFPRegister()) {                            \
-      __ asm_instr(i.InputDoubleRegister(0), i.InputDoubleRegister(1)); \
-    } else {                                                            \
-      __ asm_instr(i.InputDoubleRegister(0), i.InputOperand(1));        \
-    }                                                                   \
-  } while (0)
-
-#define ASSEMBLE_SSE_UNOP(asm_instr)                                    \
-  do {                                                                  \
-    if (instr->InputAt(0)->IsFPRegister()) {                            \
-      __ asm_instr(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); \
-    } else {                                                            \
-      __ asm_instr(i.OutputDoubleRegister(), i.InputOperand(0));        \
-    }                                                                   \
-  } while (0)
-
-#define ASSEMBLE_AVX_BINOP(asm_instr)                                  \
-  do {                                                                 \
-    CpuFeatureScope avx_scope(tasm(), AVX);                            \
-    if (instr->InputAt(1)->IsFPRegister()) {                           \
-      __ asm_instr(i.OutputDoubleRegister(), i.InputDoubleRegister(0), \
-                   i.InputDoubleRegister(1));                          \
-    } else {                                                           \
-      __ asm_instr(i.OutputDoubleRegister(), i.InputDoubleRegister(0), \
-                   i.InputOperand(1));                                 \
-    }                                                                  \
-  } while (0)
-
-#define ASSEMBLE_IEEE754_BINOP(name)                                    \
-  do {                                                                  \
-    __ PrepareCallCFunction(2);                                         \
-    __ CallCFunction(                                                   \
-        ExternalReference::ieee754_##name##_function(__ isolate()), 2); \
-  } while (false)
-
-#define ASSEMBLE_IEEE754_UNOP(name)                                     \
-  do {                                                                  \
-    __ PrepareCallCFunction(1);                                         \
-    __ CallCFunction(                                                   \
-        ExternalReference::ieee754_##name##_function(__ isolate()), 1); \
-  } while (false)
-
-#define ASSEMBLE_ATOMIC_BINOP(bin_inst, mov_inst, cmpxchg_inst) \
-  do {                                                          \
-    Label binop;                                                \
-    __ bind(&binop);                                            \
-    __ mov_inst(rax, i.MemoryOperand(1));                       \
-    __ movl(i.TempRegister(0), rax);                            \
-    __ bin_inst(i.TempRegister(0), i.InputRegister(0));         \
-    __ lock();                                                  \
-    __ cmpxchg_inst(i.MemoryOperand(1), i.TempRegister(0));     \
-    __ j(not_equal, &binop);                                    \
-  } while (false)
-
-void CodeGenerator::AssembleDeconstructFrame() {
-  unwinding_info_writer_.MarkFrameDeconstructed(__ pc_offset());
-  __ movq(rsp, rbp);
-  __ popq(rbp);
-}
-
-void CodeGenerator::AssemblePrepareTailCall() {
-  if (frame_access_state()->has_frame()) {
-    __ movq(rbp, MemOperand(rbp, 0));
-  }
-  frame_access_state()->SetFrameAccessToSP();
-}
-
-void CodeGenerator::AssemblePopArgumentsAdaptorFrame(Register args_reg,
-                                                     Register scratch1,
-                                                     Register scratch2,
-                                                     Register scratch3) {
-  DCHECK(!AreAliased(args_reg, scratch1, scratch2, scratch3));
-  Label done;
-
-  // Check if current frame is an arguments adaptor frame.
-  __ cmpp(Operand(rbp, CommonFrameConstants::kContextOrFrameTypeOffset),
-          Immediate(StackFrame::TypeToMarker(StackFrame::ARGUMENTS_ADAPTOR)));
-  __ j(not_equal, &done, Label::kNear);
-
-  // Load arguments count from current arguments adaptor frame (note, it
-  // does not include receiver).
-  Register caller_args_count_reg = scratch1;
-  __ SmiToInteger32(
-      caller_args_count_reg,
-      Operand(rbp, ArgumentsAdaptorFrameConstants::kLengthOffset));
-
-  ParameterCount callee_args_count(args_reg);
-  __ PrepareForTailCall(callee_args_count, caller_args_count_reg, scratch2,
-                        scratch3);
-  __ bind(&done);
-}
-
-namespace {
-
-void AdjustStackPointerForTailCall(Assembler* assembler,
-                                   FrameAccessState* state,
-                                   int new_slot_above_sp,
-                                   bool allow_shrinkage = true) {
-  int current_sp_offset = state->GetSPToFPSlotCount() +
-                          StandardFrameConstants::kFixedSlotCountAboveFp;
-  int stack_slot_delta = new_slot_above_sp - current_sp_offset;
-  if (stack_slot_delta > 0) {
-    assembler->subq(rsp, Immediate(stack_slot_delta * kPointerSize));
-    state->IncreaseSPDelta(stack_slot_delta);
-  } else if (allow_shrinkage && stack_slot_delta < 0) {
-    assembler->addq(rsp, Immediate(-stack_slot_delta * kPointerSize));
-    state->IncreaseSPDelta(stack_slot_delta);
-  }
-}
-
-}  // namespace
-
-void CodeGenerator::AssembleTailCallBeforeGap(Instruction* instr,
-                                              int first_unused_stack_slot) {
-  CodeGenerator::PushTypeFlags flags(kImmediatePush | kScalarPush);
-  ZoneVector<MoveOperands*> pushes(zone());
-  GetPushCompatibleMoves(instr, flags, &pushes);
-
-  if (!pushes.empty() &&
-      (LocationOperand::cast(pushes.back()->destination()).index() + 1 ==
-       first_unused_stack_slot)) {
-    X64OperandConverter g(this, instr);
-    for (auto move : pushes) {
-      LocationOperand destination_location(
-          LocationOperand::cast(move->destination()));
-      InstructionOperand source(move->source());
-      AdjustStackPointerForTailCall(tasm(), frame_access_state(),
-                                    destination_location.index());
-      if (source.IsStackSlot()) {
-        LocationOperand source_location(LocationOperand::cast(source));
-        __ Push(g.SlotToOperand(source_location.index()));
-      } else if (source.IsRegister()) {
-        LocationOperand source_location(LocationOperand::cast(source));
-        __ Push(source_location.GetRegister());
-      } else if (source.IsImmediate()) {
-        __ Push(Immediate(ImmediateOperand::cast(source).inline_value()));
-      } else {
-        // Pushes of non-scalar data types is not supported.
-        UNIMPLEMENTED();
-      }
-      frame_access_state()->IncreaseSPDelta(1);
-      move->Eliminate();
-    }
-  }
-  AdjustStackPointerForTailCall(tasm(), frame_access_state(),
-                                first_unused_stack_slot, false);
-}
-
-void CodeGenerator::AssembleTailCallAfterGap(Instruction* instr,
-                                             int first_unused_stack_slot) {
-  AdjustStackPointerForTailCall(tasm(), frame_access_state(),
-                                first_unused_stack_slot);
-}
-
-// Check if the code object is marked for deoptimization. If it is, then it
-// jumps to CompileLazyDeoptimizedCode builtin. In order to do this we need to:
-//    1. load the address of the current instruction;
-//    2. read from memory the word that contains that bit, which can be found in
-//       the flags in the referenced {CodeDataContainer} object;
-//    3. test kMarkedForDeoptimizationBit in those flags; and
-//    4. if it is not zero then it jumps to the builtin.
-void CodeGenerator::BailoutIfDeoptimized() {
-  Label current;
-  // Load effective address to get the address of the current instruction into
-  // rcx.
-  __ leaq(rcx, Operand(&current));
-  __ bind(&current);
-  int pc = __ pc_offset();
-  int offset = Code::kCodeDataContainerOffset - (Code::kHeaderSize + pc);
-  __ movp(rcx, Operand(rcx, offset));
-  __ testl(FieldOperand(rcx, CodeDataContainer::kKindSpecificFlagsOffset),
-           Immediate(1 << Code::kMarkedForDeoptimizationBit));
-  Handle<Code> code = isolate()->builtins()->builtin_handle(
-      Builtins::kCompileLazyDeoptimizedCode);
-  __ j(not_zero, code, RelocInfo::CODE_TARGET);
-}
-
-inline bool HasCallDescriptorFlag(Instruction* instr,
-                                  CallDescriptor::Flag flag) {
-  return MiscField::decode(instr->opcode()) & flag;
-}
-
-// Assembles an instruction after register allocation, producing machine code.
-CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
-    Instruction* instr) {
-  X64OperandConverter i(this, instr);
-  InstructionCode opcode = instr->opcode();
-  ArchOpcode arch_opcode = ArchOpcodeField::decode(opcode);
-  switch (arch_opcode) {
-    case kArchCallCodeObject: {
-      if (HasImmediateInput(instr, 0)) {
-        Handle<Code> code = i.InputCode(0);
-        __ Call(code, RelocInfo::CODE_TARGET);
-      } else {
-        Register reg = i.InputRegister(0);
-        __ addp(reg, Immediate(Code::kHeaderSize - kHeapObjectTag));
-        if (HasCallDescriptorFlag(instr, CallDescriptor::kRetpoline)) {
-          __ RetpolineCall(reg);
-        } else {
-          __ call(reg);
-        }
-      }
-      RecordCallPosition(instr);
-      frame_access_state()->ClearSPDelta();
-      break;
-    }
-    case kArchCallWasmFunction: {
-      if (HasImmediateInput(instr, 0)) {
-        Address wasm_code = reinterpret_cast<Address>(
-            i.ToConstant(instr->InputAt(0)).ToInt64());
-        if (info()->IsWasm()) {
-          __ near_call(wasm_code, RelocInfo::WASM_CALL);
-        } else {
-          if (HasCallDescriptorFlag(instr, CallDescriptor::kRetpoline)) {
-            __ RetpolineCall(wasm_code, RelocInfo::JS_TO_WASM_CALL);
-          } else {
-            __ Call(wasm_code, RelocInfo::JS_TO_WASM_CALL);
-          }
-        }
-      } else {
-        Register reg = i.InputRegister(0);
-        if (HasCallDescriptorFlag(instr, CallDescriptor::kRetpoline)) {
-          __ RetpolineCall(reg);
-        } else {
-          __ call(reg);
-        }
-      }
-      RecordCallPosition(instr);
-      frame_access_state()->ClearSPDelta();
-      break;
-    }
-    case kArchTailCallCodeObjectFromJSFunction:
-    case kArchTailCallCodeObject: {
-      if (arch_opcode == kArchTailCallCodeObjectFromJSFunction) {
-        AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister,
-                                         i.TempRegister(0), i.TempRegister(1),
-                                         i.TempRegister(2));
-      }
-      if (HasImmediateInput(instr, 0)) {
-        Handle<Code> code = i.InputCode(0);
-        __ jmp(code, RelocInfo::CODE_TARGET);
-      } else {
-        Register reg = i.InputRegister(0);
-        __ addp(reg, Immediate(Code::kHeaderSize - kHeapObjectTag));
-        if (HasCallDescriptorFlag(instr, CallDescriptor::kRetpoline)) {
-          __ RetpolineJump(reg);
-        } else {
-          __ jmp(reg);
-        }
-      }
-      unwinding_info_writer_.MarkBlockWillExit();
-      frame_access_state()->ClearSPDelta();
-      frame_access_state()->SetFrameAccessToDefault();
-      break;
-    }
-    case kArchTailCallWasm: {
-      if (HasImmediateInput(instr, 0)) {
-        Address wasm_code = reinterpret_cast<Address>(
-            i.ToConstant(instr->InputAt(0)).ToInt64());
-        if (info()->IsWasm()) {
-          __ near_jmp(wasm_code, RelocInfo::WASM_CALL);
-        } else {
-          __ Move(kScratchRegister, wasm_code, RelocInfo::JS_TO_WASM_CALL);
-          __ jmp(kScratchRegister);
-        }
-      } else {
-        Register reg = i.InputRegister(0);
-        if (HasCallDescriptorFlag(instr, CallDescriptor::kRetpoline)) {
-          __ RetpolineJump(reg);
-        } else {
-          __ jmp(reg);
-        }
-      }
-      unwinding_info_writer_.MarkBlockWillExit();
-      frame_access_state()->ClearSPDelta();
-      frame_access_state()->SetFrameAccessToDefault();
-      break;
-    }
-    case kArchTailCallAddress: {
-      CHECK(!HasImmediateInput(instr, 0));
-      Register reg = i.InputRegister(0);
-      if (HasCallDescriptorFlag(instr, CallDescriptor::kRetpoline)) {
-        __ RetpolineJump(reg);
-      } else {
-        __ jmp(reg);
-      }
-      unwinding_info_writer_.MarkBlockWillExit();
-      frame_access_state()->ClearSPDelta();
-      frame_access_state()->SetFrameAccessToDefault();
-      break;
-    }
-    case kArchCallJSFunction: {
-      Register func = i.InputRegister(0);
-      if (FLAG_debug_code) {
-        // Check the function's context matches the context argument.
-        __ cmpp(rsi, FieldOperand(func, JSFunction::kContextOffset));
-        __ Assert(equal, AbortReason::kWrongFunctionContext);
-      }
-      __ movp(rcx, FieldOperand(func, JSFunction::kCodeOffset));
-      __ addp(rcx, Immediate(Code::kHeaderSize - kHeapObjectTag));
-      __ call(rcx);
-      frame_access_state()->ClearSPDelta();
-      RecordCallPosition(instr);
-      break;
-    }
-    case kArchPrepareCallCFunction: {
-      // Frame alignment requires using FP-relative frame addressing.
-      frame_access_state()->SetFrameAccessToFP();
-      int const num_parameters = MiscField::decode(instr->opcode());
-      __ PrepareCallCFunction(num_parameters);
-      break;
-    }
-    case kArchSaveCallerRegisters: {
-      fp_mode_ =
-          static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode()));
-      DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
-      // kReturnRegister0 should have been saved before entering the stub.
-      int bytes = __ PushCallerSaved(fp_mode_, kReturnRegister0);
-      DCHECK_EQ(0, bytes % kPointerSize);
-      DCHECK_EQ(0, frame_access_state()->sp_delta());
-      frame_access_state()->IncreaseSPDelta(bytes / kPointerSize);
-      DCHECK(!caller_registers_saved_);
-      caller_registers_saved_ = true;
-      break;
-    }
-    case kArchRestoreCallerRegisters: {
-      DCHECK(fp_mode_ ==
-             static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode())));
-      DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
-      // Don't overwrite the returned value.
-      int bytes = __ PopCallerSaved(fp_mode_, kReturnRegister0);
-      frame_access_state()->IncreaseSPDelta(-(bytes / kPointerSize));
-      DCHECK_EQ(0, frame_access_state()->sp_delta());
-      DCHECK(caller_registers_saved_);
-      caller_registers_saved_ = false;
-      break;
-    }
-    case kArchPrepareTailCall:
-      AssemblePrepareTailCall();
-      break;
-    case kArchCallCFunction: {
-      int const num_parameters = MiscField::decode(instr->opcode());
-      if (HasImmediateInput(instr, 0)) {
-        ExternalReference ref = i.InputExternalReference(0);
-        __ CallCFunction(ref, num_parameters);
-      } else {
-        Register func = i.InputRegister(0);
-        __ CallCFunction(func, num_parameters);
-      }
-      frame_access_state()->SetFrameAccessToDefault();
-      // Ideally, we should decrement SP delta to match the change of stack
-      // pointer in CallCFunction. However, for certain architectures (e.g.
-      // ARM), there may be more strict alignment requirement, causing old SP
-      // to be saved on the stack. In those cases, we can not calculate the SP
-      // delta statically.
-      frame_access_state()->ClearSPDelta();
-      if (caller_registers_saved_) {
-        // Need to re-sync SP delta introduced in kArchSaveCallerRegisters.
-        // Here, we assume the sequence to be:
-        //   kArchSaveCallerRegisters;
-        //   kArchCallCFunction;
-        //   kArchRestoreCallerRegisters;
-        int bytes =
-            __ RequiredStackSizeForCallerSaved(fp_mode_, kReturnRegister0);
-        frame_access_state()->IncreaseSPDelta(bytes / kPointerSize);
-      }
-      break;
-    }
-    case kArchJmp:
-      AssembleArchJump(i.InputRpo(0));
-      break;
-    case kArchLookupSwitch:
-      AssembleArchLookupSwitch(instr);
-      break;
-    case kArchTableSwitch:
-      AssembleArchTableSwitch(instr);
-      break;
-    case kArchComment: {
-      Address comment_string = i.InputExternalReference(0).address();
-      __ RecordComment(reinterpret_cast<const char*>(comment_string));
-      break;
-    }
-    case kArchDebugAbort:
-      DCHECK(i.InputRegister(0) == rdx);
-      if (!frame_access_state()->has_frame()) {
-        // We don't actually want to generate a pile of code for this, so just
-        // claim there is a stack frame, without generating one.
-        FrameScope scope(tasm(), StackFrame::NONE);
-        __ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
-                RelocInfo::CODE_TARGET);
-      } else {
-        __ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
-                RelocInfo::CODE_TARGET);
-      }
-      __ int3();
-      break;
-    case kArchDebugBreak:
-      __ int3();
-      break;
-    case kArchNop:
-    case kArchThrowTerminator:
-      // don't emit code for nops.
-      break;
-    case kArchDeoptimize: {
-      int deopt_state_id =
-          BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore());
-      CodeGenResult result =
-          AssembleDeoptimizerCall(deopt_state_id, current_source_position_);
-      if (result != kSuccess) return result;
-      break;
-    }
-    case kArchRet:
-      AssembleReturn(instr->InputAt(0));
-      break;
-    case kArchStackPointer:
-      __ movq(i.OutputRegister(), rsp);
-      break;
-    case kArchFramePointer:
-      __ movq(i.OutputRegister(), rbp);
-      break;
-    case kArchParentFramePointer:
-      if (frame_access_state()->has_frame()) {
-        __ movq(i.OutputRegister(), Operand(rbp, 0));
-      } else {
-        __ movq(i.OutputRegister(), rbp);
-      }
-      break;
-    case kArchTruncateDoubleToI: {
-      auto result = i.OutputRegister();
-      auto input = i.InputDoubleRegister(0);
-      auto ool = new (zone()) OutOfLineTruncateDoubleToI(
-          this, result, input, &unwinding_info_writer_);
-      // We use Cvttsd2siq instead of Cvttsd2si due to performance reasons. The
-      // use of Cvttsd2siq requires the movl below to avoid sign extension.
-      __ Cvttsd2siq(result, input);
-      __ cmpq(result, Immediate(1));
-      __ j(overflow, ool->entry());
-      __ bind(ool->exit());
-      __ movl(result, result);
-      break;
-    }
-    case kArchStoreWithWriteBarrier: {
-      RecordWriteMode mode =
-          static_cast<RecordWriteMode>(MiscField::decode(instr->opcode()));
-      Register object = i.InputRegister(0);
-      size_t index = 0;
-      Operand operand = i.MemoryOperand(&index);
-      Register value = i.InputRegister(index);
-      Register scratch0 = i.TempRegister(0);
-      Register scratch1 = i.TempRegister(1);
-      auto ool = new (zone()) OutOfLineRecordWrite(this, object, operand, value,
-                                                   scratch0, scratch1, mode);
-      __ movp(operand, value);
-      __ CheckPageFlag(object, scratch0,
-                       MemoryChunk::kPointersFromHereAreInterestingMask,
-                       not_zero, ool->entry());
-      __ bind(ool->exit());
-      break;
-    }
-    case kLFence:
-      __ lfence();
-      break;
-    case kArchStackSlot: {
-      FrameOffset offset =
-          frame_access_state()->GetFrameOffset(i.InputInt32(0));
-      Register base = offset.from_stack_pointer() ? rsp : rbp;
-      __ leaq(i.OutputRegister(), Operand(base, offset.offset()));
-      break;
-    }
-    case kIeee754Float64Acos:
-      ASSEMBLE_IEEE754_UNOP(acos);
-      break;
-    case kIeee754Float64Acosh:
-      ASSEMBLE_IEEE754_UNOP(acosh);
-      break;
-    case kIeee754Float64Asin:
-      ASSEMBLE_IEEE754_UNOP(asin);
-      break;
-    case kIeee754Float64Asinh:
-      ASSEMBLE_IEEE754_UNOP(asinh);
-      break;
-    case kIeee754Float64Atan:
-      ASSEMBLE_IEEE754_UNOP(atan);
-      break;
-    case kIeee754Float64Atanh:
-      ASSEMBLE_IEEE754_UNOP(atanh);
-      break;
-    case kIeee754Float64Atan2:
-      ASSEMBLE_IEEE754_BINOP(atan2);
-      break;
-    case kIeee754Float64Cbrt:
-      ASSEMBLE_IEEE754_UNOP(cbrt);
-      break;
-    case kIeee754Float64Cos:
-      ASSEMBLE_IEEE754_UNOP(cos);
-      break;
-    case kIeee754Float64Cosh:
-      ASSEMBLE_IEEE754_UNOP(cosh);
-      break;
-    case kIeee754Float64Exp:
-      ASSEMBLE_IEEE754_UNOP(exp);
-      break;
-    case kIeee754Float64Expm1:
-      ASSEMBLE_IEEE754_UNOP(expm1);
-      break;
-    case kIeee754Float64Log:
-      ASSEMBLE_IEEE754_UNOP(log);
-      break;
-    case kIeee754Float64Log1p:
-      ASSEMBLE_IEEE754_UNOP(log1p);
-      break;
-    case kIeee754Float64Log2:
-      ASSEMBLE_IEEE754_UNOP(log2);
-      break;
-    case kIeee754Float64Log10:
-      ASSEMBLE_IEEE754_UNOP(log10);
-      break;
-    case kIeee754Float64Pow: {
-      // TODO(bmeurer): Improve integration of the stub.
-      __ Movsd(xmm2, xmm0);
-      __ CallStubDelayed(new (zone())
-                             MathPowStub(nullptr, MathPowStub::DOUBLE));
-      __ Movsd(xmm0, xmm3);
-      break;
-    }
-    case kIeee754Float64Sin:
-      ASSEMBLE_IEEE754_UNOP(sin);
-      break;
-    case kIeee754Float64Sinh:
-      ASSEMBLE_IEEE754_UNOP(sinh);
-      break;
-    case kIeee754Float64Tan:
-      ASSEMBLE_IEEE754_UNOP(tan);
-      break;
-    case kIeee754Float64Tanh:
-      ASSEMBLE_IEEE754_UNOP(tanh);
-      break;
-    case kX64Add32:
-      ASSEMBLE_BINOP(addl);
-      break;
-    case kX64Add:
-      ASSEMBLE_BINOP(addq);
-      break;
-    case kX64Sub32:
-      ASSEMBLE_BINOP(subl);
-      break;
-    case kX64Sub:
-      ASSEMBLE_BINOP(subq);
-      break;
-    case kX64And32:
-      ASSEMBLE_BINOP(andl);
-      break;
-    case kX64And:
-      ASSEMBLE_BINOP(andq);
-      break;
-    case kX64Cmp8:
-      ASSEMBLE_COMPARE(cmpb);
-      break;
-    case kX64Cmp16:
-      ASSEMBLE_COMPARE(cmpw);
-      break;
-    case kX64Cmp32:
-      ASSEMBLE_COMPARE(cmpl);
-      break;
-    case kX64Cmp:
-      ASSEMBLE_COMPARE(cmpq);
-      break;
-    case kX64Test8:
-      ASSEMBLE_COMPARE(testb);
-      break;
-    case kX64Test16:
-      ASSEMBLE_COMPARE(testw);
-      break;
-    case kX64Test32:
-      ASSEMBLE_COMPARE(testl);
-      break;
-    case kX64Test:
-      ASSEMBLE_COMPARE(testq);
-      break;
-    case kX64Imul32:
-      ASSEMBLE_MULT(imull);
-      break;
-    case kX64Imul:
-      ASSEMBLE_MULT(imulq);
-      break;
-    case kX64ImulHigh32:
-      if (instr->InputAt(1)->IsRegister()) {
-        __ imull(i.InputRegister(1));
-      } else {
-        __ imull(i.InputOperand(1));
-      }
-      break;
-    case kX64UmulHigh32:
-      if (instr->InputAt(1)->IsRegister()) {
-        __ mull(i.InputRegister(1));
-      } else {
-        __ mull(i.InputOperand(1));
-      }
-      break;
-    case kX64Idiv32:
-      __ cdq();
-      __ idivl(i.InputRegister(1));
-      break;
-    case kX64Idiv:
-      __ cqo();
-      __ idivq(i.InputRegister(1));
-      break;
-    case kX64Udiv32:
-      __ xorl(rdx, rdx);
-      __ divl(i.InputRegister(1));
-      break;
-    case kX64Udiv:
-      __ xorq(rdx, rdx);
-      __ divq(i.InputRegister(1));
-      break;
-    case kX64Not:
-      ASSEMBLE_UNOP(notq);
-      break;
-    case kX64Not32:
-      ASSEMBLE_UNOP(notl);
-      break;
-    case kX64Neg:
-      ASSEMBLE_UNOP(negq);
-      break;
-    case kX64Neg32:
-      ASSEMBLE_UNOP(negl);
-      break;
-    case kX64Or32:
-      ASSEMBLE_BINOP(orl);
-      break;
-    case kX64Or:
-      ASSEMBLE_BINOP(orq);
-      break;
-    case kX64Xor32:
-      ASSEMBLE_BINOP(xorl);
-      break;
-    case kX64Xor:
-      ASSEMBLE_BINOP(xorq);
-      break;
-    case kX64Shl32:
-      ASSEMBLE_SHIFT(shll, 5);
-      break;
-    case kX64Shl:
-      ASSEMBLE_SHIFT(shlq, 6);
-      break;
-    case kX64Shr32:
-      ASSEMBLE_SHIFT(shrl, 5);
-      break;
-    case kX64Shr:
-      ASSEMBLE_SHIFT(shrq, 6);
-      break;
-    case kX64Sar32:
-      ASSEMBLE_SHIFT(sarl, 5);
-      break;
-    case kX64Sar:
-      ASSEMBLE_SHIFT(sarq, 6);
-      break;
-    case kX64Ror32:
-      ASSEMBLE_SHIFT(rorl, 5);
-      break;
-    case kX64Ror:
-      ASSEMBLE_SHIFT(rorq, 6);
-      break;
-    case kX64Lzcnt:
-      if (instr->InputAt(0)->IsRegister()) {
-        __ Lzcntq(i.OutputRegister(), i.InputRegister(0));
-      } else {
-        __ Lzcntq(i.OutputRegister(), i.InputOperand(0));
-      }
-      break;
-    case kX64Lzcnt32:
-      if (instr->InputAt(0)->IsRegister()) {
-        __ Lzcntl(i.OutputRegister(), i.InputRegister(0));
-      } else {
-        __ Lzcntl(i.OutputRegister(), i.InputOperand(0));
-      }
-      break;
-    case kX64Tzcnt:
-      if (instr->InputAt(0)->IsRegister()) {
-        __ Tzcntq(i.OutputRegister(), i.InputRegister(0));
-      } else {
-        __ Tzcntq(i.OutputRegister(), i.InputOperand(0));
-      }
-      break;
-    case kX64Tzcnt32:
-      if (instr->InputAt(0)->IsRegister()) {
-        __ Tzcntl(i.OutputRegister(), i.InputRegister(0));
-      } else {
-        __ Tzcntl(i.OutputRegister(), i.InputOperand(0));
-      }
-      break;
-    case kX64Popcnt:
-      if (instr->InputAt(0)->IsRegister()) {
-        __ Popcntq(i.OutputRegister(), i.InputRegister(0));
-      } else {
-        __ Popcntq(i.OutputRegister(), i.InputOperand(0));
-      }
-      break;
-    case kX64Popcnt32:
-      if (instr->InputAt(0)->IsRegister()) {
-        __ Popcntl(i.OutputRegister(), i.InputRegister(0));
-      } else {
-        __ Popcntl(i.OutputRegister(), i.InputOperand(0));
-      }
-      break;
-    case kSSEFloat32Cmp:
-      ASSEMBLE_SSE_BINOP(Ucomiss);
-      break;
-    case kSSEFloat32Add:
-      ASSEMBLE_SSE_BINOP(addss);
-      break;
-    case kSSEFloat32Sub:
-      ASSEMBLE_SSE_BINOP(subss);
-      break;
-    case kSSEFloat32Mul:
-      ASSEMBLE_SSE_BINOP(mulss);
-      break;
-    case kSSEFloat32Div:
-      ASSEMBLE_SSE_BINOP(divss);
-      // Don't delete this mov. It may improve performance on some CPUs,
-      // when there is a (v)mulss depending on the result.
-      __ movaps(i.OutputDoubleRegister(), i.OutputDoubleRegister());
-      break;
-    case kSSEFloat32Abs: {
-      // TODO(bmeurer): Use RIP relative 128-bit constants.
-      __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
-      __ psrlq(kScratchDoubleReg, 33);
-      __ andps(i.OutputDoubleRegister(), kScratchDoubleReg);
-      break;
-    }
-    case kSSEFloat32Neg: {
-      // TODO(bmeurer): Use RIP relative 128-bit constants.
-      __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
-      __ psllq(kScratchDoubleReg, 31);
-      __ xorps(i.OutputDoubleRegister(), kScratchDoubleReg);
-      break;
-    }
-    case kSSEFloat32Sqrt:
-      ASSEMBLE_SSE_UNOP(sqrtss);
-      break;
-    case kSSEFloat32ToFloat64:
-      ASSEMBLE_SSE_UNOP(Cvtss2sd);
-      break;
-    case kSSEFloat32Round: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      RoundingMode const mode =
-          static_cast<RoundingMode>(MiscField::decode(instr->opcode()));
-      __ Roundss(i.OutputDoubleRegister(), i.InputDoubleRegister(0), mode);
-      break;
-    }
-    case kSSEFloat32ToInt32:
-      if (instr->InputAt(0)->IsFPRegister()) {
-        __ Cvttss2si(i.OutputRegister(), i.InputDoubleRegister(0));
-      } else {
-        __ Cvttss2si(i.OutputRegister(), i.InputOperand(0));
-      }
-      break;
-    case kSSEFloat32ToUint32: {
-      if (instr->InputAt(0)->IsFPRegister()) {
-        __ Cvttss2siq(i.OutputRegister(), i.InputDoubleRegister(0));
-      } else {
-        __ Cvttss2siq(i.OutputRegister(), i.InputOperand(0));
-      }
-      break;
-    }
-    case kSSEFloat64Cmp:
-      ASSEMBLE_SSE_BINOP(Ucomisd);
-      break;
-    case kSSEFloat64Add:
-      ASSEMBLE_SSE_BINOP(addsd);
-      break;
-    case kSSEFloat64Sub:
-      ASSEMBLE_SSE_BINOP(subsd);
-      break;
-    case kSSEFloat64Mul:
-      ASSEMBLE_SSE_BINOP(mulsd);
-      break;
-    case kSSEFloat64Div:
-      ASSEMBLE_SSE_BINOP(divsd);
-      // Don't delete this mov. It may improve performance on some CPUs,
-      // when there is a (v)mulsd depending on the result.
-      __ Movapd(i.OutputDoubleRegister(), i.OutputDoubleRegister());
-      break;
-    case kSSEFloat64Mod: {
-      __ subq(rsp, Immediate(kDoubleSize));
-      unwinding_info_writer_.MaybeIncreaseBaseOffsetAt(__ pc_offset(),
-                                                       kDoubleSize);
-      // Move values to st(0) and st(1).
-      __ Movsd(Operand(rsp, 0), i.InputDoubleRegister(1));
-      __ fld_d(Operand(rsp, 0));
-      __ Movsd(Operand(rsp, 0), i.InputDoubleRegister(0));
-      __ fld_d(Operand(rsp, 0));
-      // Loop while fprem isn't done.
-      Label mod_loop;
-      __ bind(&mod_loop);
-      // This instructions traps on all kinds inputs, but we are assuming the
-      // floating point control word is set to ignore them all.
-      __ fprem();
-      // The following 2 instruction implicitly use rax.
-      __ fnstsw_ax();
-      if (CpuFeatures::IsSupported(SAHF)) {
-        CpuFeatureScope sahf_scope(tasm(), SAHF);
-        __ sahf();
-      } else {
-        __ shrl(rax, Immediate(8));
-        __ andl(rax, Immediate(0xFF));
-        __ pushq(rax);
-        unwinding_info_writer_.MaybeIncreaseBaseOffsetAt(__ pc_offset(),
-                                                         kPointerSize);
-        __ popfq();
-        unwinding_info_writer_.MaybeIncreaseBaseOffsetAt(__ pc_offset(),
-                                                         -kPointerSize);
-      }
-      __ j(parity_even, &mod_loop);
-      // Move output to stack and clean up.
-      __ fstp(1);
-      __ fstp_d(Operand(rsp, 0));
-      __ Movsd(i.OutputDoubleRegister(), Operand(rsp, 0));
-      __ addq(rsp, Immediate(kDoubleSize));
-      unwinding_info_writer_.MaybeIncreaseBaseOffsetAt(__ pc_offset(),
-                                                       -kDoubleSize);
-      break;
-    }
-    case kSSEFloat32Max: {
-      Label compare_nan, compare_swap, done_compare;
-      if (instr->InputAt(1)->IsFPRegister()) {
-        __ Ucomiss(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
-      } else {
-        __ Ucomiss(i.InputDoubleRegister(0), i.InputOperand(1));
-      }
-      auto ool =
-          new (zone()) OutOfLineLoadFloat32NaN(this, i.OutputDoubleRegister());
-      __ j(parity_even, ool->entry());
-      __ j(above, &done_compare, Label::kNear);
-      __ j(below, &compare_swap, Label::kNear);
-      __ Movmskps(kScratchRegister, i.InputDoubleRegister(0));
-      __ testl(kScratchRegister, Immediate(1));
-      __ j(zero, &done_compare, Label::kNear);
-      __ bind(&compare_swap);
-      if (instr->InputAt(1)->IsFPRegister()) {
-        __ Movss(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
-      } else {
-        __ Movss(i.InputDoubleRegister(0), i.InputOperand(1));
-      }
-      __ bind(&done_compare);
-      __ bind(ool->exit());
-      break;
-    }
-    case kSSEFloat32Min: {
-      Label compare_swap, done_compare;
-      if (instr->InputAt(1)->IsFPRegister()) {
-        __ Ucomiss(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
-      } else {
-        __ Ucomiss(i.InputDoubleRegister(0), i.InputOperand(1));
-      }
-      auto ool =
-          new (zone()) OutOfLineLoadFloat32NaN(this, i.OutputDoubleRegister());
-      __ j(parity_even, ool->entry());
-      __ j(below, &done_compare, Label::kNear);
-      __ j(above, &compare_swap, Label::kNear);
-      if (instr->InputAt(1)->IsFPRegister()) {
-        __ Movmskps(kScratchRegister, i.InputDoubleRegister(1));
-      } else {
-        __ Movss(kScratchDoubleReg, i.InputOperand(1));
-        __ Movmskps(kScratchRegister, kScratchDoubleReg);
-      }
-      __ testl(kScratchRegister, Immediate(1));
-      __ j(zero, &done_compare, Label::kNear);
-      __ bind(&compare_swap);
-      if (instr->InputAt(1)->IsFPRegister()) {
-        __ Movss(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
-      } else {
-        __ Movss(i.InputDoubleRegister(0), i.InputOperand(1));
-      }
-      __ bind(&done_compare);
-      __ bind(ool->exit());
-      break;
-    }
-    case kSSEFloat64Max: {
-      Label compare_nan, compare_swap, done_compare;
-      if (instr->InputAt(1)->IsFPRegister()) {
-        __ Ucomisd(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
-      } else {
-        __ Ucomisd(i.InputDoubleRegister(0), i.InputOperand(1));
-      }
-      auto ool =
-          new (zone()) OutOfLineLoadFloat64NaN(this, i.OutputDoubleRegister());
-      __ j(parity_even, ool->entry());
-      __ j(above, &done_compare, Label::kNear);
-      __ j(below, &compare_swap, Label::kNear);
-      __ Movmskpd(kScratchRegister, i.InputDoubleRegister(0));
-      __ testl(kScratchRegister, Immediate(1));
-      __ j(zero, &done_compare, Label::kNear);
-      __ bind(&compare_swap);
-      if (instr->InputAt(1)->IsFPRegister()) {
-        __ Movsd(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
-      } else {
-        __ Movsd(i.InputDoubleRegister(0), i.InputOperand(1));
-      }
-      __ bind(&done_compare);
-      __ bind(ool->exit());
-      break;
-    }
-    case kSSEFloat64Min: {
-      Label compare_swap, done_compare;
-      if (instr->InputAt(1)->IsFPRegister()) {
-        __ Ucomisd(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
-      } else {
-        __ Ucomisd(i.InputDoubleRegister(0), i.InputOperand(1));
-      }
-      auto ool =
-          new (zone()) OutOfLineLoadFloat64NaN(this, i.OutputDoubleRegister());
-      __ j(parity_even, ool->entry());
-      __ j(below, &done_compare, Label::kNear);
-      __ j(above, &compare_swap, Label::kNear);
-      if (instr->InputAt(1)->IsFPRegister()) {
-        __ Movmskpd(kScratchRegister, i.InputDoubleRegister(1));
-      } else {
-        __ Movsd(kScratchDoubleReg, i.InputOperand(1));
-        __ Movmskpd(kScratchRegister, kScratchDoubleReg);
-      }
-      __ testl(kScratchRegister, Immediate(1));
-      __ j(zero, &done_compare, Label::kNear);
-      __ bind(&compare_swap);
-      if (instr->InputAt(1)->IsFPRegister()) {
-        __ Movsd(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
-      } else {
-        __ Movsd(i.InputDoubleRegister(0), i.InputOperand(1));
-      }
-      __ bind(&done_compare);
-      __ bind(ool->exit());
-      break;
-    }
-    case kSSEFloat64Abs: {
-      // TODO(bmeurer): Use RIP relative 128-bit constants.
-      __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
-      __ psrlq(kScratchDoubleReg, 1);
-      __ andpd(i.OutputDoubleRegister(), kScratchDoubleReg);
-      break;
-    }
-    case kSSEFloat64Neg: {
-      // TODO(bmeurer): Use RIP relative 128-bit constants.
-      __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
-      __ psllq(kScratchDoubleReg, 63);
-      __ xorpd(i.OutputDoubleRegister(), kScratchDoubleReg);
-      break;
-    }
-    case kSSEFloat64Sqrt:
-      ASSEMBLE_SSE_UNOP(Sqrtsd);
-      break;
-    case kSSEFloat64Round: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      RoundingMode const mode =
-          static_cast<RoundingMode>(MiscField::decode(instr->opcode()));
-      __ Roundsd(i.OutputDoubleRegister(), i.InputDoubleRegister(0), mode);
-      break;
-    }
-    case kSSEFloat64ToFloat32:
-      ASSEMBLE_SSE_UNOP(Cvtsd2ss);
-      break;
-    case kSSEFloat64ToInt32:
-      if (instr->InputAt(0)->IsFPRegister()) {
-        __ Cvttsd2si(i.OutputRegister(), i.InputDoubleRegister(0));
-      } else {
-        __ Cvttsd2si(i.OutputRegister(), i.InputOperand(0));
-      }
-      break;
-    case kSSEFloat64ToUint32: {
-      if (instr->InputAt(0)->IsFPRegister()) {
-        __ Cvttsd2siq(i.OutputRegister(), i.InputDoubleRegister(0));
-      } else {
-        __ Cvttsd2siq(i.OutputRegister(), i.InputOperand(0));
-      }
-      if (MiscField::decode(instr->opcode())) {
-        __ AssertZeroExtended(i.OutputRegister());
-      }
-      break;
-    }
-    case kSSEFloat32ToInt64:
-      if (instr->InputAt(0)->IsFPRegister()) {
-        __ Cvttss2siq(i.OutputRegister(), i.InputDoubleRegister(0));
-      } else {
-        __ Cvttss2siq(i.OutputRegister(), i.InputOperand(0));
-      }
-      if (instr->OutputCount() > 1) {
-        __ Set(i.OutputRegister(1), 1);
-        Label done;
-        Label fail;
-        __ Move(kScratchDoubleReg, static_cast<float>(INT64_MIN));
-        if (instr->InputAt(0)->IsFPRegister()) {
-          __ Ucomiss(kScratchDoubleReg, i.InputDoubleRegister(0));
-        } else {
-          __ Ucomiss(kScratchDoubleReg, i.InputOperand(0));
-        }
-        // If the input is NaN, then the conversion fails.
-        __ j(parity_even, &fail);
-        // If the input is INT64_MIN, then the conversion succeeds.
-        __ j(equal, &done);
-        __ cmpq(i.OutputRegister(0), Immediate(1));
-        // If the conversion results in INT64_MIN, but the input was not
-        // INT64_MIN, then the conversion fails.
-        __ j(no_overflow, &done);
-        __ bind(&fail);
-        __ Set(i.OutputRegister(1), 0);
-        __ bind(&done);
-      }
-      break;
-    case kSSEFloat64ToInt64:
-      if (instr->InputAt(0)->IsFPRegister()) {
-        __ Cvttsd2siq(i.OutputRegister(0), i.InputDoubleRegister(0));
-      } else {
-        __ Cvttsd2siq(i.OutputRegister(0), i.InputOperand(0));
-      }
-      if (instr->OutputCount() > 1) {
-        __ Set(i.OutputRegister(1), 1);
-        Label done;
-        Label fail;
-        __ Move(kScratchDoubleReg, static_cast<double>(INT64_MIN));
-        if (instr->InputAt(0)->IsFPRegister()) {
-          __ Ucomisd(kScratchDoubleReg, i.InputDoubleRegister(0));
-        } else {
-          __ Ucomisd(kScratchDoubleReg, i.InputOperand(0));
-        }
-        // If the input is NaN, then the conversion fails.
-        __ j(parity_even, &fail);
-        // If the input is INT64_MIN, then the conversion succeeds.
-        __ j(equal, &done);
-        __ cmpq(i.OutputRegister(0), Immediate(1));
-        // If the conversion results in INT64_MIN, but the input was not
-        // INT64_MIN, then the conversion fails.
-        __ j(no_overflow, &done);
-        __ bind(&fail);
-        __ Set(i.OutputRegister(1), 0);
-        __ bind(&done);
-      }
-      break;
-    case kSSEFloat32ToUint64: {
-      Label done;
-      Label success;
-      if (instr->OutputCount() > 1) {
-        __ Set(i.OutputRegister(1), 0);
-      }
-      // There does not exist a Float32ToUint64 instruction, so we have to use
-      // the Float32ToInt64 instruction.
-      if (instr->InputAt(0)->IsFPRegister()) {
-        __ Cvttss2siq(i.OutputRegister(), i.InputDoubleRegister(0));
-      } else {
-        __ Cvttss2siq(i.OutputRegister(), i.InputOperand(0));
-      }
-      // Check if the result of the Float32ToInt64 conversion is positive, we
-      // are already done.
-      __ testq(i.OutputRegister(), i.OutputRegister());
-      __ j(positive, &success);
-      // The result of the first conversion was negative, which means that the
-      // input value was not within the positive int64 range. We subtract 2^64
-      // and convert it again to see if it is within the uint64 range.
-      __ Move(kScratchDoubleReg, -9223372036854775808.0f);
-      if (instr->InputAt(0)->IsFPRegister()) {
-        __ addss(kScratchDoubleReg, i.InputDoubleRegister(0));
-      } else {
-        __ addss(kScratchDoubleReg, i.InputOperand(0));
-      }
-      __ Cvttss2siq(i.OutputRegister(), kScratchDoubleReg);
-      __ testq(i.OutputRegister(), i.OutputRegister());
-      // The only possible negative value here is 0x80000000000000000, which is
-      // used on x64 to indicate an integer overflow.
-      __ j(negative, &done);
-      // The input value is within uint64 range and the second conversion worked
-      // successfully, but we still have to undo the subtraction we did
-      // earlier.
-      __ Set(kScratchRegister, 0x8000000000000000);
-      __ orq(i.OutputRegister(), kScratchRegister);
-      __ bind(&success);
-      if (instr->OutputCount() > 1) {
-        __ Set(i.OutputRegister(1), 1);
-      }
-      __ bind(&done);
-      break;
-    }
-    case kSSEFloat64ToUint64: {
-      Label done;
-      Label success;
-      if (instr->OutputCount() > 1) {
-        __ Set(i.OutputRegister(1), 0);
-      }
-      // There does not exist a Float64ToUint64 instruction, so we have to use
-      // the Float64ToInt64 instruction.
-      if (instr->InputAt(0)->IsFPRegister()) {
-        __ Cvttsd2siq(i.OutputRegister(), i.InputDoubleRegister(0));
-      } else {
-        __ Cvttsd2siq(i.OutputRegister(), i.InputOperand(0));
-      }
-      // Check if the result of the Float64ToInt64 conversion is positive, we
-      // are already done.
-      __ testq(i.OutputRegister(), i.OutputRegister());
-      __ j(positive, &success);
-      // The result of the first conversion was negative, which means that the
-      // input value was not within the positive int64 range. We subtract 2^64
-      // and convert it again to see if it is within the uint64 range.
-      __ Move(kScratchDoubleReg, -9223372036854775808.0);
-      if (instr->InputAt(0)->IsFPRegister()) {
-        __ addsd(kScratchDoubleReg, i.InputDoubleRegister(0));
-      } else {
-        __ addsd(kScratchDoubleReg, i.InputOperand(0));
-      }
-      __ Cvttsd2siq(i.OutputRegister(), kScratchDoubleReg);
-      __ testq(i.OutputRegister(), i.OutputRegister());
-      // The only possible negative value here is 0x80000000000000000, which is
-      // used on x64 to indicate an integer overflow.
-      __ j(negative, &done);
-      // The input value is within uint64 range and the second conversion worked
-      // successfully, but we still have to undo the subtraction we did
-      // earlier.
-      __ Set(kScratchRegister, 0x8000000000000000);
-      __ orq(i.OutputRegister(), kScratchRegister);
-      __ bind(&success);
-      if (instr->OutputCount() > 1) {
-        __ Set(i.OutputRegister(1), 1);
-      }
-      __ bind(&done);
-      break;
-    }
-    case kSSEInt32ToFloat64:
-      if (instr->InputAt(0)->IsRegister()) {
-        __ Cvtlsi2sd(i.OutputDoubleRegister(), i.InputRegister(0));
-      } else {
-        __ Cvtlsi2sd(i.OutputDoubleRegister(), i.InputOperand(0));
-      }
-      break;
-    case kSSEInt32ToFloat32:
-      if (instr->InputAt(0)->IsRegister()) {
-        __ Cvtlsi2ss(i.OutputDoubleRegister(), i.InputRegister(0));
-      } else {
-        __ Cvtlsi2ss(i.OutputDoubleRegister(), i.InputOperand(0));
-      }
-      break;
-    case kSSEInt64ToFloat32:
-      if (instr->InputAt(0)->IsRegister()) {
-        __ Cvtqsi2ss(i.OutputDoubleRegister(), i.InputRegister(0));
-      } else {
-        __ Cvtqsi2ss(i.OutputDoubleRegister(), i.InputOperand(0));
-      }
-      break;
-    case kSSEInt64ToFloat64:
-      if (instr->InputAt(0)->IsRegister()) {
-        __ Cvtqsi2sd(i.OutputDoubleRegister(), i.InputRegister(0));
-      } else {
-        __ Cvtqsi2sd(i.OutputDoubleRegister(), i.InputOperand(0));
-      }
-      break;
-    case kSSEUint64ToFloat32:
-      if (instr->InputAt(0)->IsRegister()) {
-        __ movq(kScratchRegister, i.InputRegister(0));
-      } else {
-        __ movq(kScratchRegister, i.InputOperand(0));
-      }
-      __ Cvtqui2ss(i.OutputDoubleRegister(), kScratchRegister,
-                   i.TempRegister(0));
-      break;
-    case kSSEUint64ToFloat64:
-      if (instr->InputAt(0)->IsRegister()) {
-        __ movq(kScratchRegister, i.InputRegister(0));
-      } else {
-        __ movq(kScratchRegister, i.InputOperand(0));
-      }
-      __ Cvtqui2sd(i.OutputDoubleRegister(), kScratchRegister,
-                   i.TempRegister(0));
-      break;
-    case kSSEUint32ToFloat64:
-      if (instr->InputAt(0)->IsRegister()) {
-        __ movl(kScratchRegister, i.InputRegister(0));
-      } else {
-        __ movl(kScratchRegister, i.InputOperand(0));
-      }
-      __ Cvtqsi2sd(i.OutputDoubleRegister(), kScratchRegister);
-      break;
-    case kSSEUint32ToFloat32:
-      if (instr->InputAt(0)->IsRegister()) {
-        __ movl(kScratchRegister, i.InputRegister(0));
-      } else {
-        __ movl(kScratchRegister, i.InputOperand(0));
-      }
-      __ Cvtqsi2ss(i.OutputDoubleRegister(), kScratchRegister);
-      break;
-    case kSSEFloat64ExtractLowWord32:
-      if (instr->InputAt(0)->IsFPStackSlot()) {
-        __ movl(i.OutputRegister(), i.InputOperand(0));
-      } else {
-        __ Movd(i.OutputRegister(), i.InputDoubleRegister(0));
-      }
-      break;
-    case kSSEFloat64ExtractHighWord32:
-      if (instr->InputAt(0)->IsFPStackSlot()) {
-        __ movl(i.OutputRegister(), i.InputOperand(0, kDoubleSize / 2));
-      } else {
-        __ Pextrd(i.OutputRegister(), i.InputDoubleRegister(0), 1);
-      }
-      break;
-    case kSSEFloat64InsertLowWord32:
-      if (instr->InputAt(1)->IsRegister()) {
-        __ Pinsrd(i.OutputDoubleRegister(), i.InputRegister(1), 0);
-      } else {
-        __ Pinsrd(i.OutputDoubleRegister(), i.InputOperand(1), 0);
-      }
-      break;
-    case kSSEFloat64InsertHighWord32:
-      if (instr->InputAt(1)->IsRegister()) {
-        __ Pinsrd(i.OutputDoubleRegister(), i.InputRegister(1), 1);
-      } else {
-        __ Pinsrd(i.OutputDoubleRegister(), i.InputOperand(1), 1);
-      }
-      break;
-    case kSSEFloat64LoadLowWord32:
-      if (instr->InputAt(0)->IsRegister()) {
-        __ Movd(i.OutputDoubleRegister(), i.InputRegister(0));
-      } else {
-        __ Movd(i.OutputDoubleRegister(), i.InputOperand(0));
-      }
-      break;
-    case kAVXFloat32Cmp: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      if (instr->InputAt(1)->IsFPRegister()) {
-        __ vucomiss(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
-      } else {
-        __ vucomiss(i.InputDoubleRegister(0), i.InputOperand(1));
-      }
-      break;
-    }
-    case kAVXFloat32Add:
-      ASSEMBLE_AVX_BINOP(vaddss);
-      break;
-    case kAVXFloat32Sub:
-      ASSEMBLE_AVX_BINOP(vsubss);
-      break;
-    case kAVXFloat32Mul:
-      ASSEMBLE_AVX_BINOP(vmulss);
-      break;
-    case kAVXFloat32Div:
-      ASSEMBLE_AVX_BINOP(vdivss);
-      // Don't delete this mov. It may improve performance on some CPUs,
-      // when there is a (v)mulss depending on the result.
-      __ Movaps(i.OutputDoubleRegister(), i.OutputDoubleRegister());
-      break;
-    case kAVXFloat64Cmp: {
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      if (instr->InputAt(1)->IsFPRegister()) {
-        __ vucomisd(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
-      } else {
-        __ vucomisd(i.InputDoubleRegister(0), i.InputOperand(1));
-      }
-      break;
-    }
-    case kAVXFloat64Add:
-      ASSEMBLE_AVX_BINOP(vaddsd);
-      break;
-    case kAVXFloat64Sub:
-      ASSEMBLE_AVX_BINOP(vsubsd);
-      break;
-    case kAVXFloat64Mul:
-      ASSEMBLE_AVX_BINOP(vmulsd);
-      break;
-    case kAVXFloat64Div:
-      ASSEMBLE_AVX_BINOP(vdivsd);
-      // Don't delete this mov. It may improve performance on some CPUs,
-      // when there is a (v)mulsd depending on the result.
-      __ Movapd(i.OutputDoubleRegister(), i.OutputDoubleRegister());
-      break;
-    case kAVXFloat32Abs: {
-      // TODO(bmeurer): Use RIP relative 128-bit constants.
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpcmpeqd(kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg);
-      __ vpsrlq(kScratchDoubleReg, kScratchDoubleReg, 33);
-      if (instr->InputAt(0)->IsFPRegister()) {
-        __ vandps(i.OutputDoubleRegister(), kScratchDoubleReg,
-                  i.InputDoubleRegister(0));
-      } else {
-        __ vandps(i.OutputDoubleRegister(), kScratchDoubleReg,
-                  i.InputOperand(0));
-      }
-      break;
-    }
-    case kAVXFloat32Neg: {
-      // TODO(bmeurer): Use RIP relative 128-bit constants.
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpcmpeqd(kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg);
-      __ vpsllq(kScratchDoubleReg, kScratchDoubleReg, 31);
-      if (instr->InputAt(0)->IsFPRegister()) {
-        __ vxorps(i.OutputDoubleRegister(), kScratchDoubleReg,
-                  i.InputDoubleRegister(0));
-      } else {
-        __ vxorps(i.OutputDoubleRegister(), kScratchDoubleReg,
-                  i.InputOperand(0));
-      }
-      break;
-    }
-    case kAVXFloat64Abs: {
-      // TODO(bmeurer): Use RIP relative 128-bit constants.
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpcmpeqd(kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg);
-      __ vpsrlq(kScratchDoubleReg, kScratchDoubleReg, 1);
-      if (instr->InputAt(0)->IsFPRegister()) {
-        __ vandpd(i.OutputDoubleRegister(), kScratchDoubleReg,
-                  i.InputDoubleRegister(0));
-      } else {
-        __ vandpd(i.OutputDoubleRegister(), kScratchDoubleReg,
-                  i.InputOperand(0));
-      }
-      break;
-    }
-    case kAVXFloat64Neg: {
-      // TODO(bmeurer): Use RIP relative 128-bit constants.
-      CpuFeatureScope avx_scope(tasm(), AVX);
-      __ vpcmpeqd(kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg);
-      __ vpsllq(kScratchDoubleReg, kScratchDoubleReg, 63);
-      if (instr->InputAt(0)->IsFPRegister()) {
-        __ vxorpd(i.OutputDoubleRegister(), kScratchDoubleReg,
-                  i.InputDoubleRegister(0));
-      } else {
-        __ vxorpd(i.OutputDoubleRegister(), kScratchDoubleReg,
-                  i.InputOperand(0));
-      }
-      break;
-    }
-    case kSSEFloat64SilenceNaN:
-      __ Xorpd(kScratchDoubleReg, kScratchDoubleReg);
-      __ Subsd(i.InputDoubleRegister(0), kScratchDoubleReg);
-      break;
-    case kX64Movsxbl:
-      EmitOOLTrapIfNeeded(zone(), this, opcode, instr, i, __ pc_offset());
-      ASSEMBLE_MOVX(movsxbl);
-      __ AssertZeroExtended(i.OutputRegister());
-      break;
-    case kX64Movzxbl:
-      EmitOOLTrapIfNeeded(zone(), this, opcode, instr, i, __ pc_offset());
-      ASSEMBLE_MOVX(movzxbl);
-      __ AssertZeroExtended(i.OutputRegister());
-      break;
-    case kX64Movsxbq:
-      EmitOOLTrapIfNeeded(zone(), this, opcode, instr, i, __ pc_offset());
-      ASSEMBLE_MOVX(movsxbq);
-      break;
-    case kX64Movzxbq:
-      EmitOOLTrapIfNeeded(zone(), this, opcode, instr, i, __ pc_offset());
-      ASSEMBLE_MOVX(movzxbq);
-      __ AssertZeroExtended(i.OutputRegister());
-      break;
-    case kX64Movb: {
-      EmitOOLTrapIfNeeded(zone(), this, opcode, instr, i, __ pc_offset());
-      size_t index = 0;
-      Operand operand = i.MemoryOperand(&index);
-      if (HasImmediateInput(instr, index)) {
-        __ movb(operand, Immediate(i.InputInt8(index)));
-      } else {
-        __ movb(operand, i.InputRegister(index));
-      }
-      break;
-    }
-    case kX64Movsxwl:
-      EmitOOLTrapIfNeeded(zone(), this, opcode, instr, i, __ pc_offset());
-      ASSEMBLE_MOVX(movsxwl);
-      __ AssertZeroExtended(i.OutputRegister());
-      break;
-    case kX64Movzxwl:
-      EmitOOLTrapIfNeeded(zone(), this, opcode, instr, i, __ pc_offset());
-      ASSEMBLE_MOVX(movzxwl);
-      __ AssertZeroExtended(i.OutputRegister());
-      break;
-    case kX64Movsxwq:
-      EmitOOLTrapIfNeeded(zone(), this, opcode, instr, i, __ pc_offset());
-      ASSEMBLE_MOVX(movsxwq);
-      break;
-    case kX64Movzxwq:
-      EmitOOLTrapIfNeeded(zone(), this, opcode, instr, i, __ pc_offset());
-      ASSEMBLE_MOVX(movzxwq);
-      __ AssertZeroExtended(i.OutputRegister());
-      break;
-    case kX64Movw: {
-      EmitOOLTrapIfNeeded(zone(), this, opcode, instr, i, __ pc_offset());
-      size_t index = 0;
-      Operand operand = i.MemoryOperand(&index);
-      if (HasImmediateInput(instr, index)) {
-        __ movw(operand, Immediate(i.InputInt16(index)));
-      } else {
-        __ movw(operand, i.InputRegister(index));
-      }
-      break;
-    }
-    case kX64Movl:
-      EmitOOLTrapIfNeeded(zone(), this, opcode, instr, i, __ pc_offset());
-      if (instr->HasOutput()) {
-        if (instr->addressing_mode() == kMode_None) {
-          if (instr->InputAt(0)->IsRegister()) {
-            __ movl(i.OutputRegister(), i.InputRegister(0));
-          } else {
-            __ movl(i.OutputRegister(), i.InputOperand(0));
-          }
-        } else {
-          __ movl(i.OutputRegister(), i.MemoryOperand());
-        }
-        __ AssertZeroExtended(i.OutputRegister());
-      } else {
-        size_t index = 0;
-        Operand operand = i.MemoryOperand(&index);
-        if (HasImmediateInput(instr, index)) {
-          __ movl(operand, i.InputImmediate(index));
-        } else {
-          __ movl(operand, i.InputRegister(index));
-        }
-      }
-      break;
-    case kX64Movsxlq:
-      EmitOOLTrapIfNeeded(zone(), this, opcode, instr, i, __ pc_offset());
-      ASSEMBLE_MOVX(movsxlq);
-      break;
-    case kX64Movq:
-      EmitOOLTrapIfNeeded(zone(), this, opcode, instr, i, __ pc_offset());
-      if (instr->HasOutput()) {
-        __ movq(i.OutputRegister(), i.MemoryOperand());
-      } else {
-        size_t index = 0;
-        Operand operand = i.MemoryOperand(&index);
-        if (HasImmediateInput(instr, index)) {
-          __ movq(operand, i.InputImmediate(index));
-        } else {
-          __ movq(operand, i.InputRegister(index));
-        }
-      }
-      break;
-    case kX64Movss:
-      EmitOOLTrapIfNeeded(zone(), this, opcode, instr, i, __ pc_offset());
-      if (instr->HasOutput()) {
-        __ movss(i.OutputDoubleRegister(), i.MemoryOperand());
-      } else {
-        size_t index = 0;
-        Operand operand = i.MemoryOperand(&index);
-        __ movss(operand, i.InputDoubleRegister(index));
-      }
-      break;
-    case kX64Movsd:
-      EmitOOLTrapIfNeeded(zone(), this, opcode, instr, i, __ pc_offset());
-      if (instr->HasOutput()) {
-        __ Movsd(i.OutputDoubleRegister(), i.MemoryOperand());
-      } else {
-        size_t index = 0;
-        Operand operand = i.MemoryOperand(&index);
-        __ Movsd(operand, i.InputDoubleRegister(index));
-      }
-      break;
-    case kX64Movdqu: {
-      CpuFeatureScope sse_scope(tasm(), SSSE3);
-      EmitOOLTrapIfNeeded(zone(), this, opcode, instr, i, __ pc_offset());
-      if (instr->HasOutput()) {
-        __ movdqu(i.OutputSimd128Register(), i.MemoryOperand());
-      } else {
-        size_t index = 0;
-        Operand operand = i.MemoryOperand(&index);
-        __ movdqu(operand, i.InputSimd128Register(index));
-      }
-      break;
-    }
-    case kX64BitcastFI:
-      if (instr->InputAt(0)->IsFPStackSlot()) {
-        __ movl(i.OutputRegister(), i.InputOperand(0));
-      } else {
-        __ Movd(i.OutputRegister(), i.InputDoubleRegister(0));
-      }
-      break;
-    case kX64BitcastDL:
-      if (instr->InputAt(0)->IsFPStackSlot()) {
-        __ movq(i.OutputRegister(), i.InputOperand(0));
-      } else {
-        __ Movq(i.OutputRegister(), i.InputDoubleRegister(0));
-      }
-      break;
-    case kX64BitcastIF:
-      if (instr->InputAt(0)->IsRegister()) {
-        __ Movd(i.OutputDoubleRegister(), i.InputRegister(0));
-      } else {
-        __ movss(i.OutputDoubleRegister(), i.InputOperand(0));
-      }
-      break;
-    case kX64BitcastLD:
-      if (instr->InputAt(0)->IsRegister()) {
-        __ Movq(i.OutputDoubleRegister(), i.InputRegister(0));
-      } else {
-        __ Movsd(i.OutputDoubleRegister(), i.InputOperand(0));
-      }
-      break;
-    case kX64Lea32: {
-      AddressingMode mode = AddressingModeField::decode(instr->opcode());
-      // Shorten "leal" to "addl", "subl" or "shll" if the register allocation
-      // and addressing mode just happens to work out. The "addl"/"subl" forms
-      // in these cases are faster based on measurements.
-      if (i.InputRegister(0) == i.OutputRegister()) {
-        if (mode == kMode_MRI) {
-          int32_t constant_summand = i.InputInt32(1);
-          if (constant_summand > 0) {
-            __ addl(i.OutputRegister(), Immediate(constant_summand));
-          } else if (constant_summand < 0) {
-            __ subl(i.OutputRegister(), Immediate(-constant_summand));
-          }
-        } else if (mode == kMode_MR1) {
-          if (i.InputRegister(1) == i.OutputRegister()) {
-            __ shll(i.OutputRegister(), Immediate(1));
-          } else {
-            __ addl(i.OutputRegister(), i.InputRegister(1));
-          }
-        } else if (mode == kMode_M2) {
-          __ shll(i.OutputRegister(), Immediate(1));
-        } else if (mode == kMode_M4) {
-          __ shll(i.OutputRegister(), Immediate(2));
-        } else if (mode == kMode_M8) {
-          __ shll(i.OutputRegister(), Immediate(3));
-        } else {
-          __ leal(i.OutputRegister(), i.MemoryOperand());
-        }
-      } else if (mode == kMode_MR1 &&
-                 i.InputRegister(1) == i.OutputRegister()) {
-        __ addl(i.OutputRegister(), i.InputRegister(0));
-      } else {
-        __ leal(i.OutputRegister(), i.MemoryOperand());
-      }
-      __ AssertZeroExtended(i.OutputRegister());
-      break;
-    }
-    case kX64Lea: {
-      AddressingMode mode = AddressingModeField::decode(instr->opcode());
-      // Shorten "leaq" to "addq", "subq" or "shlq" if the register allocation
-      // and addressing mode just happens to work out. The "addq"/"subq" forms
-      // in these cases are faster based on measurements.
-      if (i.InputRegister(0) == i.OutputRegister()) {
-        if (mode == kMode_MRI) {
-          int32_t constant_summand = i.InputInt32(1);
-          if (constant_summand > 0) {
-            __ addq(i.OutputRegister(), Immediate(constant_summand));
-          } else if (constant_summand < 0) {
-            __ subq(i.OutputRegister(), Immediate(-constant_summand));
-          }
-        } else if (mode == kMode_MR1) {
-          if (i.InputRegister(1) == i.OutputRegister()) {
-            __ shlq(i.OutputRegister(), Immediate(1));
-          } else {
-            __ addq(i.OutputRegister(), i.InputRegister(1));
-          }
-        } else if (mode == kMode_M2) {
-          __ shlq(i.OutputRegister(), Immediate(1));
-        } else if (mode == kMode_M4) {
-          __ shlq(i.OutputRegister(), Immediate(2));
-        } else if (mode == kMode_M8) {
-          __ shlq(i.OutputRegister(), Immediate(3));
-        } else {
-          __ leaq(i.OutputRegister(), i.MemoryOperand());
-        }
-      } else if (mode == kMode_MR1 &&
-                 i.InputRegister(1) == i.OutputRegister()) {
-        __ addq(i.OutputRegister(), i.InputRegister(0));
-      } else {
-        __ leaq(i.OutputRegister(), i.MemoryOperand());
-      }
-      break;
-    }
-    case kX64Dec32:
-      __ decl(i.OutputRegister());
-      break;
-    case kX64Inc32:
-      __ incl(i.OutputRegister());
-      break;
-    case kX64Push:
-      if (AddressingModeField::decode(instr->opcode()) != kMode_None) {
-        size_t index = 0;
-        Operand operand = i.MemoryOperand(&index);
-        __ pushq(operand);
-        frame_access_state()->IncreaseSPDelta(1);
-        unwinding_info_writer_.MaybeIncreaseBaseOffsetAt(__ pc_offset(),
-                                                         kPointerSize);
-      } else if (HasImmediateInput(instr, 0)) {
-        __ pushq(i.InputImmediate(0));
-        frame_access_state()->IncreaseSPDelta(1);
-        unwinding_info_writer_.MaybeIncreaseBaseOffsetAt(__ pc_offset(),
-                                                         kPointerSize);
-      } else if (instr->InputAt(0)->IsRegister()) {
-        __ pushq(i.InputRegister(0));
-        frame_access_state()->IncreaseSPDelta(1);
-        unwinding_info_writer_.MaybeIncreaseBaseOffsetAt(__ pc_offset(),
-                                                         kPointerSize);
-      } else if (instr->InputAt(0)->IsFloatRegister() ||
-                 instr->InputAt(0)->IsDoubleRegister()) {
-        // TODO(titzer): use another machine instruction?
-        __ subq(rsp, Immediate(kDoubleSize));
-        frame_access_state()->IncreaseSPDelta(kDoubleSize / kPointerSize);
-        unwinding_info_writer_.MaybeIncreaseBaseOffsetAt(__ pc_offset(),
-                                                         kDoubleSize);
-        __ Movsd(Operand(rsp, 0), i.InputDoubleRegister(0));
-      } else if (instr->InputAt(0)->IsSimd128Register()) {
-        // TODO(titzer): use another machine instruction?
-        __ subq(rsp, Immediate(kSimd128Size));
-        frame_access_state()->IncreaseSPDelta(kSimd128Size / kPointerSize);
-        unwinding_info_writer_.MaybeIncreaseBaseOffsetAt(__ pc_offset(),
-                                                         kSimd128Size);
-        __ Movups(Operand(rsp, 0), i.InputSimd128Register(0));
-      } else if (instr->InputAt(0)->IsStackSlot() ||
-                 instr->InputAt(0)->IsFloatStackSlot() ||
-                 instr->InputAt(0)->IsDoubleStackSlot()) {
-        __ pushq(i.InputOperand(0));
-        frame_access_state()->IncreaseSPDelta(1);
-        unwinding_info_writer_.MaybeIncreaseBaseOffsetAt(__ pc_offset(),
-                                                         kPointerSize);
-      } else {
-        DCHECK(instr->InputAt(0)->IsSimd128StackSlot());
-        __ Movups(kScratchDoubleReg, i.InputOperand(0));
-        // TODO(titzer): use another machine instruction?
-        __ subq(rsp, Immediate(kSimd128Size));
-        frame_access_state()->IncreaseSPDelta(kSimd128Size / kPointerSize);
-        unwinding_info_writer_.MaybeIncreaseBaseOffsetAt(__ pc_offset(),
-                                                         kSimd128Size);
-        __ Movups(Operand(rsp, 0), kScratchDoubleReg);
-      }
-      break;
-    case kX64Poke: {
-      int slot = MiscField::decode(instr->opcode());
-      if (HasImmediateInput(instr, 0)) {
-        __ movq(Operand(rsp, slot * kPointerSize), i.InputImmediate(0));
-      } else {
-        __ movq(Operand(rsp, slot * kPointerSize), i.InputRegister(0));
-      }
-      break;
-    }
-    case kX64Peek: {
-      int reverse_slot = i.InputInt32(0);
-      int offset =
-          FrameSlotToFPOffset(frame()->GetTotalFrameSlotCount() - reverse_slot);
-      if (instr->OutputAt(0)->IsFPRegister()) {
-        LocationOperand* op = LocationOperand::cast(instr->OutputAt(0));
-        if (op->representation() == MachineRepresentation::kFloat64) {
-          __ Movsd(i.OutputDoubleRegister(), Operand(rbp, offset));
-        } else {
-          DCHECK_EQ(MachineRepresentation::kFloat32, op->representation());
-          __ Movss(i.OutputFloatRegister(), Operand(rbp, offset));
-        }
-      } else {
-        __ movq(i.OutputRegister(), Operand(rbp, offset));
-      }
-      break;
-    }
-    // TODO(gdeepti): Get rid of redundant moves for F32x4Splat/Extract below
-    case kX64F32x4Splat: {
-      XMMRegister dst = i.OutputSimd128Register();
-      if (instr->InputAt(0)->IsFPRegister()) {
-        __ Movss(dst, i.InputDoubleRegister(0));
-      } else {
-        __ Movss(dst, i.InputOperand(0));
-      }
-      __ shufps(dst, dst, 0x0);
-      break;
-    }
-    case kX64F32x4ExtractLane: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ extractps(kScratchRegister, i.InputSimd128Register(0), i.InputInt8(1));
-      __ movd(i.OutputDoubleRegister(), kScratchRegister);
-      break;
-    }
-    case kX64F32x4ReplaceLane: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      // The insertps instruction uses imm8[5:4] to indicate the lane
-      // that needs to be replaced.
-      byte select = i.InputInt8(1) << 4 & 0x30;
-      __ insertps(i.OutputSimd128Register(), i.InputDoubleRegister(2), select);
-      break;
-    }
-    case kX64F32x4RecipApprox: {
-      __ rcpps(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kX64F32x4RecipSqrtApprox: {
-      __ rsqrtps(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      break;
-    }
-    case kX64F32x4Add: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ addps(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64F32x4Sub: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ subps(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64F32x4Mul: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ mulps(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64F32x4Min: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ minps(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64F32x4Max: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ maxps(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64F32x4Eq: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ cmpps(i.OutputSimd128Register(), i.InputSimd128Register(1), 0x0);
-      break;
-    }
-    case kX64F32x4Ne: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ cmpps(i.OutputSimd128Register(), i.InputSimd128Register(1), 0x4);
-      break;
-    }
-    case kX64F32x4Lt: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ cmpltps(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64F32x4Le: {
-      DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
-      __ cmpleps(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I32x4Splat: {
-      XMMRegister dst = i.OutputSimd128Register();
-      __ movd(dst, i.InputRegister(0));
-      __ pshufd(dst, dst, 0x0);
-      break;
-    }
-    case kX64I32x4ExtractLane: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ Pextrd(i.OutputRegister(), i.InputSimd128Register(0), i.InputInt8(1));
-      break;
-    }
-    case kX64I32x4ReplaceLane: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      if (instr->InputAt(2)->IsRegister()) {
-        __ Pinsrd(i.OutputSimd128Register(), i.InputRegister(2),
-                  i.InputInt8(1));
-      } else {
-        __ Pinsrd(i.OutputSimd128Register(), i.InputOperand(2), i.InputInt8(1));
-      }
-      break;
-    }
-    case kX64I32x4Neg: {
-      CpuFeatureScope sse_scope(tasm(), SSSE3);
-      XMMRegister dst = i.OutputSimd128Register();
-      XMMRegister src = i.InputSimd128Register(0);
-      if (dst == src) {
-        __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
-        __ psignd(dst, kScratchDoubleReg);
-      } else {
-        __ pxor(dst, dst);
-        __ psubd(dst, src);
-      }
-      break;
-    }
-    case kX64I32x4Shl: {
-      __ pslld(i.OutputSimd128Register(), i.InputInt8(1));
-      break;
-    }
-    case kX64I32x4ShrS: {
-      __ psrad(i.OutputSimd128Register(), i.InputInt8(1));
-      break;
-    }
-    case kX64I32x4Add: {
-      __ paddd(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I32x4AddHoriz: {
-      CpuFeatureScope sse_scope(tasm(), SSSE3);
-      __ phaddd(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I32x4Sub: {
-      __ psubd(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I32x4Mul: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ pmulld(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I32x4MinS: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ pminsd(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I32x4MaxS: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ pmaxsd(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I32x4Eq: {
-      __ pcmpeqd(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I32x4Ne: {
-      __ pcmpeqd(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
-      __ pxor(i.OutputSimd128Register(), kScratchDoubleReg);
-      break;
-    }
-    case kX64I32x4GtS: {
-      __ pcmpgtd(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I32x4GeS: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      XMMRegister dst = i.OutputSimd128Register();
-      XMMRegister src = i.InputSimd128Register(1);
-      __ pminsd(dst, src);
-      __ pcmpeqd(dst, src);
-      break;
-    }
-    case kX64I32x4ShrU: {
-      __ psrld(i.OutputSimd128Register(), i.InputInt8(1));
-      break;
-    }
-    case kX64I32x4MinU: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ pminud(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I32x4MaxU: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ pmaxud(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I32x4GtU: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      XMMRegister dst = i.OutputSimd128Register();
-      XMMRegister src = i.InputSimd128Register(1);
-      __ pmaxud(dst, src);
-      __ pcmpeqd(dst, src);
-      __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
-      __ pxor(dst, kScratchDoubleReg);
-      break;
-    }
-    case kX64I32x4GeU: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      XMMRegister dst = i.OutputSimd128Register();
-      XMMRegister src = i.InputSimd128Register(1);
-      __ pminud(dst, src);
-      __ pcmpeqd(dst, src);
-      break;
-    }
-    case kX64S128Zero: {
-      XMMRegister dst = i.OutputSimd128Register();
-      __ xorps(dst, dst);
-      break;
-    }
-    case kX64I16x8Splat: {
-      XMMRegister dst = i.OutputSimd128Register();
-      __ movd(dst, i.InputRegister(0));
-      __ pshuflw(dst, dst, 0x0);
-      __ pshufhw(dst, dst, 0x0);
-      __ pshufd(dst, dst, 0x0);
-      break;
-    }
-    case kX64I16x8ExtractLane: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      Register dst = i.OutputRegister();
-      __ pextrw(dst, i.InputSimd128Register(0), i.InputInt8(1));
-      __ movsxwl(dst, dst);
-      break;
-    }
-    case kX64I16x8ReplaceLane: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      if (instr->InputAt(2)->IsRegister()) {
-        __ pinsrw(i.OutputSimd128Register(), i.InputRegister(2),
-                  i.InputInt8(1));
-      } else {
-        __ pinsrw(i.OutputSimd128Register(), i.InputOperand(2), i.InputInt8(1));
-      }
-      break;
-    }
-    case kX64I16x8Neg: {
-      CpuFeatureScope sse_scope(tasm(), SSSE3);
-      XMMRegister dst = i.OutputSimd128Register();
-      XMMRegister src = i.InputSimd128Register(0);
-      if (dst == src) {
-        __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
-        __ psignw(dst, kScratchDoubleReg);
-      } else {
-        __ pxor(dst, dst);
-        __ psubw(dst, src);
-      }
-      break;
-    }
-    case kX64I16x8Shl: {
-      __ psllw(i.OutputSimd128Register(), i.InputInt8(1));
-      break;
-    }
-    case kX64I16x8ShrS: {
-      __ psraw(i.OutputSimd128Register(), i.InputInt8(1));
-      break;
-    }
-    case kX64I16x8Add: {
-      __ paddw(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I16x8AddSaturateS: {
-      __ paddsw(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I16x8AddHoriz: {
-      CpuFeatureScope sse_scope(tasm(), SSSE3);
-      __ phaddw(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I16x8Sub: {
-      __ psubw(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I16x8SubSaturateS: {
-      __ psubsw(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I16x8Mul: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ pmullw(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I16x8MinS: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ pminsw(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I16x8MaxS: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ pmaxsw(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I16x8Eq: {
-      __ pcmpeqw(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I16x8Ne: {
-      __ pcmpeqw(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      __ pcmpeqw(kScratchDoubleReg, kScratchDoubleReg);
-      __ pxor(i.OutputSimd128Register(), kScratchDoubleReg);
-      break;
-    }
-    case kX64I16x8GtS: {
-      __ pcmpgtw(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I16x8GeS: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      XMMRegister dst = i.OutputSimd128Register();
-      XMMRegister src = i.InputSimd128Register(1);
-      __ pminsw(dst, src);
-      __ pcmpeqw(dst, src);
-      break;
-    }
-    case kX64I16x8ShrU: {
-      __ psrlw(i.OutputSimd128Register(), i.InputInt8(1));
-      break;
-    }
-    case kX64I16x8AddSaturateU: {
-      __ paddusw(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I16x8SubSaturateU: {
-      __ psubusw(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I16x8MinU: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ pminuw(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I16x8MaxU: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ pmaxuw(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I16x8GtU: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      XMMRegister dst = i.OutputSimd128Register();
-      XMMRegister src = i.InputSimd128Register(1);
-      __ pmaxuw(dst, src);
-      __ pcmpeqw(dst, src);
-      __ pcmpeqw(kScratchDoubleReg, kScratchDoubleReg);
-      __ pxor(dst, kScratchDoubleReg);
-      break;
-    }
-    case kX64I16x8GeU: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      XMMRegister dst = i.OutputSimd128Register();
-      XMMRegister src = i.InputSimd128Register(1);
-      __ pminuw(dst, src);
-      __ pcmpeqw(dst, src);
-      break;
-    }
-    case kX64I8x16Splat: {
-      CpuFeatureScope sse_scope(tasm(), SSSE3);
-      XMMRegister dst = i.OutputSimd128Register();
-      __ movd(dst, i.InputRegister(0));
-      __ xorps(kScratchDoubleReg, kScratchDoubleReg);
-      __ pshufb(dst, kScratchDoubleReg);
-      break;
-    }
-    case kX64I8x16ExtractLane: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      Register dst = i.OutputRegister();
-      __ pextrb(dst, i.InputSimd128Register(0), i.InputInt8(1));
-      __ movsxbl(dst, dst);
-      break;
-    }
-    case kX64I8x16ReplaceLane: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      if (instr->InputAt(2)->IsRegister()) {
-        __ pinsrb(i.OutputSimd128Register(), i.InputRegister(2),
-                  i.InputInt8(1));
-      } else {
-        __ pinsrb(i.OutputSimd128Register(), i.InputOperand(2), i.InputInt8(1));
-      }
-      break;
-    }
-    case kX64I8x16Neg: {
-      CpuFeatureScope sse_scope(tasm(), SSSE3);
-      XMMRegister dst = i.OutputSimd128Register();
-      XMMRegister src = i.InputSimd128Register(0);
-      if (dst == src) {
-        __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
-        __ psignb(dst, kScratchDoubleReg);
-      } else {
-        __ pxor(dst, dst);
-        __ psubb(dst, src);
-      }
-      break;
-    }
-    case kX64I8x16Add: {
-      __ paddb(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I8x16AddSaturateS: {
-      __ paddsb(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I8x16Sub: {
-      __ psubb(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I8x16SubSaturateS: {
-      __ psubsb(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I8x16MinS: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ pminsb(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I8x16MaxS: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ pmaxsb(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I8x16Eq: {
-      __ pcmpeqb(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I8x16Ne: {
-      __ pcmpeqb(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      __ pcmpeqb(kScratchDoubleReg, kScratchDoubleReg);
-      __ pxor(i.OutputSimd128Register(), kScratchDoubleReg);
-      break;
-    }
-    case kX64I8x16GtS: {
-      __ pcmpgtb(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I8x16GeS: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      XMMRegister dst = i.OutputSimd128Register();
-      XMMRegister src = i.InputSimd128Register(1);
-      __ pminsb(dst, src);
-      __ pcmpeqb(dst, src);
-      break;
-    }
-    case kX64I8x16AddSaturateU: {
-      __ paddusb(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I8x16SubSaturateU: {
-      __ psubusb(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I8x16MinU: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ pminub(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I8x16MaxU: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      __ pmaxub(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64I8x16GtU: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      XMMRegister dst = i.OutputSimd128Register();
-      XMMRegister src = i.InputSimd128Register(1);
-      __ pmaxub(dst, src);
-      __ pcmpeqb(dst, src);
-      __ pcmpeqb(kScratchDoubleReg, kScratchDoubleReg);
-      __ pxor(dst, kScratchDoubleReg);
-      break;
-    }
-    case kX64I8x16GeU: {
-      CpuFeatureScope sse_scope(tasm(), SSE4_1);
-      XMMRegister dst = i.OutputSimd128Register();
-      XMMRegister src = i.InputSimd128Register(1);
-      __ pminub(dst, src);
-      __ pcmpeqb(dst, src);
-      break;
-    }
-    case kX64S128And: {
-      __ pand(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64S128Or: {
-      __ por(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64S128Xor: {
-      __ pxor(i.OutputSimd128Register(), i.InputSimd128Register(1));
-      break;
-    }
-    case kX64S128Not: {
-      XMMRegister dst = i.OutputSimd128Register();
-      XMMRegister src = i.InputSimd128Register(0);
-      if (dst == src) {
-        __ movaps(kScratchDoubleReg, dst);
-        __ pcmpeqd(dst, dst);
-        __ pxor(dst, kScratchDoubleReg);
-      } else {
-        __ pcmpeqd(dst, dst);
-        __ pxor(dst, src);
-      }
-
-      break;
-    }
-    case kX64S128Select: {
-      // Mask used here is stored in dst.
-      XMMRegister dst = i.OutputSimd128Register();
-      __ movaps(kScratchDoubleReg, i.InputSimd128Register(1));
-      __ xorps(kScratchDoubleReg, i.InputSimd128Register(2));
-      __ andps(dst, kScratchDoubleReg);
-      __ xorps(dst, i.InputSimd128Register(2));
-      break;
-    }
-    case kX64StackCheck:
-      __ CompareRoot(rsp, Heap::kStackLimitRootIndex);
-      break;
-    case kAtomicExchangeInt8: {
-      __ xchgb(i.InputRegister(0), i.MemoryOperand(1));
-      __ movsxbl(i.InputRegister(0), i.InputRegister(0));
-      break;
-    }
-    case kAtomicExchangeUint8: {
-      __ xchgb(i.InputRegister(0), i.MemoryOperand(1));
-      __ movzxbl(i.InputRegister(0), i.InputRegister(0));
-      break;
-    }
-    case kAtomicExchangeInt16: {
-      __ xchgw(i.InputRegister(0), i.MemoryOperand(1));
-      __ movsxwl(i.InputRegister(0), i.InputRegister(0));
-      break;
-    }
-    case kAtomicExchangeUint16: {
-      __ xchgw(i.InputRegister(0), i.MemoryOperand(1));
-      __ movzxwl(i.InputRegister(0), i.InputRegister(0));
-      break;
-    }
-    case kAtomicExchangeWord32: {
-      __ xchgl(i.InputRegister(0), i.MemoryOperand(1));
-      break;
-    }
-    case kAtomicCompareExchangeInt8: {
-      __ lock();
-      __ cmpxchgb(i.MemoryOperand(2), i.InputRegister(1));
-      __ movsxbl(rax, rax);
-      break;
-    }
-    case kAtomicCompareExchangeUint8: {
-      __ lock();
-      __ cmpxchgb(i.MemoryOperand(2), i.InputRegister(1));
-      __ movzxbl(rax, rax);
-      break;
-    }
-    case kAtomicCompareExchangeInt16: {
-      __ lock();
-      __ cmpxchgw(i.MemoryOperand(2), i.InputRegister(1));
-      __ movsxwl(rax, rax);
-      break;
-    }
-    case kAtomicCompareExchangeUint16: {
-      __ lock();
-      __ cmpxchgw(i.MemoryOperand(2), i.InputRegister(1));
-      __ movzxwl(rax, rax);
-      break;
-    }
-    case kAtomicCompareExchangeWord32: {
-      __ lock();
-      __ cmpxchgl(i.MemoryOperand(2), i.InputRegister(1));
-      break;
-    }
-#define ATOMIC_BINOP_CASE(op, inst)              \
-  case kAtomic##op##Int8:                        \
-    ASSEMBLE_ATOMIC_BINOP(inst, movb, cmpxchgb); \
-    __ movsxbl(rax, rax);                        \
-    break;                                       \
-  case kAtomic##op##Uint8:                       \
-    ASSEMBLE_ATOMIC_BINOP(inst, movb, cmpxchgb); \
-    __ movzxbl(rax, rax);                        \
-    break;                                       \
-  case kAtomic##op##Int16:                       \
-    ASSEMBLE_ATOMIC_BINOP(inst, movw, cmpxchgw); \
-    __ movsxwl(rax, rax);                        \
-    break;                                       \
-  case kAtomic##op##Uint16:                      \
-    ASSEMBLE_ATOMIC_BINOP(inst, movw, cmpxchgw); \
-    __ movzxwl(rax, rax);                        \
-    break;                                       \
-  case kAtomic##op##Word32:                      \
-    ASSEMBLE_ATOMIC_BINOP(inst, movl, cmpxchgl); \
-    break;
-      ATOMIC_BINOP_CASE(Add, addl)
-      ATOMIC_BINOP_CASE(Sub, subl)
-      ATOMIC_BINOP_CASE(And, andl)
-      ATOMIC_BINOP_CASE(Or, orl)
-      ATOMIC_BINOP_CASE(Xor, xorl)
-#undef ATOMIC_BINOP_CASE
-    case kAtomicLoadInt8:
-    case kAtomicLoadUint8:
-    case kAtomicLoadInt16:
-    case kAtomicLoadUint16:
-    case kAtomicLoadWord32:
-    case kAtomicStoreWord8:
-    case kAtomicStoreWord16:
-    case kAtomicStoreWord32:
-      UNREACHABLE();  // Won't be generated by instruction selector.
-      break;
-  }
-  return kSuccess;
-}  // NOLINT(readability/fn_size)
-
-namespace {
-
-Condition FlagsConditionToCondition(FlagsCondition condition) {
-  switch (condition) {
-    case kUnorderedEqual:
-    case kEqual:
-      return equal;
-    case kUnorderedNotEqual:
-    case kNotEqual:
-      return not_equal;
-    case kSignedLessThan:
-      return less;
-    case kSignedGreaterThanOrEqual:
-      return greater_equal;
-    case kSignedLessThanOrEqual:
-      return less_equal;
-    case kSignedGreaterThan:
-      return greater;
-    case kUnsignedLessThan:
-      return below;
-    case kUnsignedGreaterThanOrEqual:
-      return above_equal;
-    case kUnsignedLessThanOrEqual:
-      return below_equal;
-    case kUnsignedGreaterThan:
-      return above;
-    case kOverflow:
-      return overflow;
-    case kNotOverflow:
-      return no_overflow;
-    default:
-      break;
-  }
-  UNREACHABLE();
-}
-
-}  // namespace
-
-// Assembles branches after this instruction.
-void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) {
-  Label::Distance flabel_distance =
-      branch->fallthru ? Label::kNear : Label::kFar;
-  Label* tlabel = branch->true_label;
-  Label* flabel = branch->false_label;
-  if (branch->condition == kUnorderedEqual) {
-    __ j(parity_even, flabel, flabel_distance);
-  } else if (branch->condition == kUnorderedNotEqual) {
-    __ j(parity_even, tlabel);
-  }
-  __ j(FlagsConditionToCondition(branch->condition), tlabel);
-
-  if (!branch->fallthru) __ jmp(flabel, flabel_distance);
-}
-
-void CodeGenerator::AssembleArchDeoptBranch(Instruction* instr,
-                                            BranchInfo* branch) {
-  Label::Distance flabel_distance =
-      branch->fallthru ? Label::kNear : Label::kFar;
-  Label* tlabel = branch->true_label;
-  Label* flabel = branch->false_label;
-  Label nodeopt;
-  if (branch->condition == kUnorderedEqual) {
-    __ j(parity_even, flabel, flabel_distance);
-  } else if (branch->condition == kUnorderedNotEqual) {
-    __ j(parity_even, tlabel);
-  }
-  __ j(FlagsConditionToCondition(branch->condition), tlabel);
-
-  if (FLAG_deopt_every_n_times > 0) {
-    ExternalReference counter =
-        ExternalReference::stress_deopt_count(isolate());
-
-    __ pushfq();
-    __ pushq(rax);
-    __ load_rax(counter);
-    __ decl(rax);
-    __ j(not_zero, &nodeopt);
-
-    __ Set(rax, FLAG_deopt_every_n_times);
-    __ store_rax(counter);
-    __ popq(rax);
-    __ popfq();
-    __ jmp(tlabel);
-
-    __ bind(&nodeopt);
-    __ store_rax(counter);
-    __ popq(rax);
-    __ popfq();
-  }
-
-  if (!branch->fallthru) {
-    __ jmp(flabel, flabel_distance);
-  }
-}
-
-void CodeGenerator::AssembleArchJump(RpoNumber target) {
-  if (!IsNextInAssemblyOrder(target)) __ jmp(GetLabel(target));
-}
-
-void CodeGenerator::AssembleArchTrap(Instruction* instr,
-                                     FlagsCondition condition) {
-  class OutOfLineTrap final : public OutOfLineCode {
-   public:
-    OutOfLineTrap(CodeGenerator* gen, bool frame_elided, Instruction* instr)
-        : OutOfLineCode(gen),
-          frame_elided_(frame_elided),
-          instr_(instr),
-          gen_(gen) {}
-
-    void Generate() final {
-      X64OperandConverter i(gen_, instr_);
-
-      Builtins::Name trap_id =
-          static_cast<Builtins::Name>(i.InputInt32(instr_->InputCount() - 1));
-      bool old_has_frame = __ has_frame();
-      if (frame_elided_) {
-        __ set_has_frame(true);
-        __ EnterFrame(StackFrame::WASM_COMPILED);
-      }
-      GenerateCallToTrap(trap_id);
-      if (frame_elided_) {
-        __ set_has_frame(old_has_frame);
-      }
-    }
-
-   private:
-    void GenerateCallToTrap(Builtins::Name trap_id) {
-      if (trap_id == Builtins::builtin_count) {
-        // We cannot test calls to the runtime in cctest/test-run-wasm.
-        // Therefore we emit a call to C here instead of a call to the runtime.
-        __ PrepareCallCFunction(0);
-        __ CallCFunction(ExternalReference::wasm_call_trap_callback_for_testing(
-                             __ isolate()),
-                         0);
-        __ LeaveFrame(StackFrame::WASM_COMPILED);
-        CallDescriptor* descriptor = gen_->linkage()->GetIncomingDescriptor();
-        size_t pop_size = descriptor->StackParameterCount() * kPointerSize;
-        // Use rcx as a scratch register, we return anyways immediately.
-        __ Ret(static_cast<int>(pop_size), rcx);
-      } else {
-        gen_->AssembleSourcePosition(instr_);
-        __ Call(__ isolate()->builtins()->builtin_handle(trap_id),
-                RelocInfo::CODE_TARGET);
-        ReferenceMap* reference_map =
-            new (gen_->zone()) ReferenceMap(gen_->zone());
-        gen_->RecordSafepoint(reference_map, Safepoint::kSimple, 0,
-                              Safepoint::kNoLazyDeopt);
-        __ AssertUnreachable(AbortReason::kUnexpectedReturnFromWasmTrap);
-      }
-    }
-
-    bool frame_elided_;
-    Instruction* instr_;
-    CodeGenerator* gen_;
-  };
-  bool frame_elided = !frame_access_state()->has_frame();
-  auto ool = new (zone()) OutOfLineTrap(this, frame_elided, instr);
-  Label* tlabel = ool->entry();
-  Label end;
-  if (condition == kUnorderedEqual) {
-    __ j(parity_even, &end);
-  } else if (condition == kUnorderedNotEqual) {
-    __ j(parity_even, tlabel);
-  }
-  __ j(FlagsConditionToCondition(condition), tlabel);
-  __ bind(&end);
-}
-
-// Assembles boolean materializations after this instruction.
-void CodeGenerator::AssembleArchBoolean(Instruction* instr,
-                                        FlagsCondition condition) {
-  X64OperandConverter i(this, instr);
-  Label done;
-
-  // Materialize a full 64-bit 1 or 0 value. The result register is always the
-  // last output of the instruction.
-  Label check;
-  DCHECK_NE(0u, instr->OutputCount());
-  Register reg = i.OutputRegister(instr->OutputCount() - 1);
-  if (condition == kUnorderedEqual) {
-    __ j(parity_odd, &check, Label::kNear);
-    __ movl(reg, Immediate(0));
-    __ jmp(&done, Label::kNear);
-  } else if (condition == kUnorderedNotEqual) {
-    __ j(parity_odd, &check, Label::kNear);
-    __ movl(reg, Immediate(1));
-    __ jmp(&done, Label::kNear);
-  }
-  __ bind(&check);
-  __ setcc(FlagsConditionToCondition(condition), reg);
-  __ movzxbl(reg, reg);
-  __ bind(&done);
-}
-
-
-void CodeGenerator::AssembleArchLookupSwitch(Instruction* instr) {
-  X64OperandConverter i(this, instr);
-  Register input = i.InputRegister(0);
-  for (size_t index = 2; index < instr->InputCount(); index += 2) {
-    __ cmpl(input, Immediate(i.InputInt32(index + 0)));
-    __ j(equal, GetLabel(i.InputRpo(index + 1)));
-  }
-  AssembleArchJump(i.InputRpo(1));
-}
-
-
-void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) {
-  X64OperandConverter i(this, instr);
-  Register input = i.InputRegister(0);
-  int32_t const case_count = static_cast<int32_t>(instr->InputCount() - 2);
-  Label** cases = zone()->NewArray<Label*>(case_count);
-  for (int32_t index = 0; index < case_count; ++index) {
-    cases[index] = GetLabel(i.InputRpo(index + 2));
-  }
-  Label* const table = AddJumpTable(cases, case_count);
-  __ cmpl(input, Immediate(case_count));
-  __ j(above_equal, GetLabel(i.InputRpo(1)));
-  __ leaq(kScratchRegister, Operand(table));
-  __ jmp(Operand(kScratchRegister, input, times_8, 0));
-}
-
-namespace {
-
-static const int kQuadWordSize = 16;
-
-}  // namespace
-
-void CodeGenerator::FinishFrame(Frame* frame) {
-  CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
-
-  const RegList saves_fp = descriptor->CalleeSavedFPRegisters();
-  if (saves_fp != 0) {
-    frame->AlignSavedCalleeRegisterSlots();
-    if (saves_fp != 0) {  // Save callee-saved XMM registers.
-      const uint32_t saves_fp_count = base::bits::CountPopulation(saves_fp);
-      frame->AllocateSavedCalleeRegisterSlots(saves_fp_count *
-                                              (kQuadWordSize / kPointerSize));
-    }
-  }
-  const RegList saves = descriptor->CalleeSavedRegisters();
-  if (saves != 0) {  // Save callee-saved registers.
-    int count = 0;
-    for (int i = Register::kNumRegisters - 1; i >= 0; i--) {
-      if (((1 << i) & saves)) {
-        ++count;
-      }
-    }
-    frame->AllocateSavedCalleeRegisterSlots(count);
-  }
-}
-
-void CodeGenerator::AssembleConstructFrame() {
-  CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
-  if (frame_access_state()->has_frame()) {
-    int pc_base = __ pc_offset();
-
-    if (descriptor->IsCFunctionCall()) {
-      __ pushq(rbp);
-      __ movq(rbp, rsp);
-    } else if (descriptor->IsJSFunctionCall()) {
-      __ Prologue();
-      if (descriptor->PushArgumentCount()) {
-        __ pushq(kJavaScriptCallArgCountRegister);
-      }
-    } else {
-      __ StubPrologue(info()->GetOutputStackFrameType());
-    }
-
-    unwinding_info_writer_.MarkFrameConstructed(pc_base);
-  }
-  int shrink_slots =
-      frame()->GetTotalFrameSlotCount() - descriptor->CalculateFixedFrameSize();
-
-  if (info()->is_osr()) {
-    // TurboFan OSR-compiled functions cannot be entered directly.
-    __ Abort(AbortReason::kShouldNotDirectlyEnterOsrFunction);
-
-    // Unoptimized code jumps directly to this entrypoint while the unoptimized
-    // frame is still on the stack. Optimized code uses OSR values directly from
-    // the unoptimized frame. Thus, all that needs to be done is to allocate the
-    // remaining stack slots.
-    if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --");
-    osr_pc_offset_ = __ pc_offset();
-    shrink_slots -= static_cast<int>(osr_helper()->UnoptimizedFrameSlots());
-  }
-
-  const RegList saves = descriptor->CalleeSavedRegisters();
-  const RegList saves_fp = descriptor->CalleeSavedFPRegisters();
-
-  if (shrink_slots > 0) {
-    if (info()->IsWasm() && shrink_slots > 128) {
-      // For WebAssembly functions with big frames we have to do the stack
-      // overflow check before we construct the frame. Otherwise we may not
-      // have enough space on the stack to call the runtime for the stack
-      // overflow.
-      Label done;
-
-      // If the frame is bigger than the stack, we throw the stack overflow
-      // exception unconditionally. Thereby we can avoid the integer overflow
-      // check in the condition code.
-      if (shrink_slots * kPointerSize < FLAG_stack_size * 1024) {
-        __ Move(kScratchRegister,
-                ExternalReference::address_of_real_stack_limit(__ isolate()));
-        __ movq(kScratchRegister, Operand(kScratchRegister, 0));
-        __ addq(kScratchRegister, Immediate(shrink_slots * kPointerSize));
-        __ cmpq(rsp, kScratchRegister);
-        __ j(above_equal, &done);
-      }
-      if (!frame_access_state()->has_frame()) {
-        __ set_has_frame(true);
-        __ EnterFrame(StackFrame::WASM_COMPILED);
-      }
-      __ Move(rsi, Smi::kZero);
-      __ CallRuntimeDelayed(zone(), Runtime::kThrowWasmStackOverflow);
-      ReferenceMap* reference_map = new (zone()) ReferenceMap(zone());
-      RecordSafepoint(reference_map, Safepoint::kSimple, 0,
-                      Safepoint::kNoLazyDeopt);
-      __ AssertUnreachable(AbortReason::kUnexpectedReturnFromWasmTrap);
-      __ bind(&done);
-    }
-
-    // Skip callee-saved and return slots, which are created below.
-    shrink_slots -= base::bits::CountPopulation(saves);
-    shrink_slots -=
-        base::bits::CountPopulation(saves_fp) * (kQuadWordSize / kPointerSize);
-    shrink_slots -= frame()->GetReturnSlotCount();
-    if (shrink_slots > 0) {
-      __ subq(rsp, Immediate(shrink_slots * kPointerSize));
-    }
-  }
-
-  if (saves_fp != 0) {  // Save callee-saved XMM registers.
-    const uint32_t saves_fp_count = base::bits::CountPopulation(saves_fp);
-    const int stack_size = saves_fp_count * kQuadWordSize;
-    // Adjust the stack pointer.
-    __ subp(rsp, Immediate(stack_size));
-    // Store the registers on the stack.
-    int slot_idx = 0;
-    for (int i = 0; i < XMMRegister::kNumRegisters; i++) {
-      if (!((1 << i) & saves_fp)) continue;
-      __ movdqu(Operand(rsp, kQuadWordSize * slot_idx),
-                XMMRegister::from_code(i));
-      slot_idx++;
-    }
-  }
-
-  if (saves != 0) {  // Save callee-saved registers.
-    for (int i = Register::kNumRegisters - 1; i >= 0; i--) {
-      if (!((1 << i) & saves)) continue;
-      __ pushq(Register::from_code(i));
-    }
-  }
-
-  // Allocate return slots (located after callee-saved).
-  if (frame()->GetReturnSlotCount() > 0) {
-    __ subq(rsp, Immediate(frame()->GetReturnSlotCount() * kPointerSize));
-  }
-}
-
-void CodeGenerator::AssembleReturn(InstructionOperand* pop) {
-  CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
-
-  // Restore registers.
-  const RegList saves = descriptor->CalleeSavedRegisters();
-  if (saves != 0) {
-    const int returns = frame()->GetReturnSlotCount();
-    if (returns != 0) {
-      __ addq(rsp, Immediate(returns * kPointerSize));
-    }
-    for (int i = 0; i < Register::kNumRegisters; i++) {
-      if (!((1 << i) & saves)) continue;
-      __ popq(Register::from_code(i));
-    }
-  }
-  const RegList saves_fp = descriptor->CalleeSavedFPRegisters();
-  if (saves_fp != 0) {
-    const uint32_t saves_fp_count = base::bits::CountPopulation(saves_fp);
-    const int stack_size = saves_fp_count * kQuadWordSize;
-    // Load the registers from the stack.
-    int slot_idx = 0;
-    for (int i = 0; i < XMMRegister::kNumRegisters; i++) {
-      if (!((1 << i) & saves_fp)) continue;
-      __ movdqu(XMMRegister::from_code(i),
-                Operand(rsp, kQuadWordSize * slot_idx));
-      slot_idx++;
-    }
-    // Adjust the stack pointer.
-    __ addp(rsp, Immediate(stack_size));
-  }
-
-  unwinding_info_writer_.MarkBlockWillExit();
-
-  // Might need rcx for scratch if pop_size is too big or if there is a variable
-  // pop count.
-  DCHECK_EQ(0u, descriptor->CalleeSavedRegisters() & rcx.bit());
-  DCHECK_EQ(0u, descriptor->CalleeSavedRegisters() & rdx.bit());
-  size_t pop_size = descriptor->StackParameterCount() * kPointerSize;
-  X64OperandConverter g(this, nullptr);
-  if (descriptor->IsCFunctionCall()) {
-    AssembleDeconstructFrame();
-  } else if (frame_access_state()->has_frame()) {
-    if (pop->IsImmediate() && g.ToConstant(pop).ToInt32() == 0) {
-      // Canonicalize JSFunction return sites for now.
-      if (return_label_.is_bound()) {
-        __ jmp(&return_label_);
-        return;
-      } else {
-        __ bind(&return_label_);
-        AssembleDeconstructFrame();
-      }
-    } else {
-      AssembleDeconstructFrame();
-    }
-  }
-
-  if (pop->IsImmediate()) {
-    pop_size += g.ToConstant(pop).ToInt32() * kPointerSize;
-    CHECK_LT(pop_size, static_cast<size_t>(std::numeric_limits<int>::max()));
-    __ Ret(static_cast<int>(pop_size), rcx);
-  } else {
-    Register pop_reg = g.ToRegister(pop);
-    Register scratch_reg = pop_reg == rcx ? rdx : rcx;
-    __ popq(scratch_reg);
-    __ leaq(rsp, Operand(rsp, pop_reg, times_8, static_cast<int>(pop_size)));
-    __ jmp(scratch_reg);
-  }
-}
-
-void CodeGenerator::FinishCode() {}
-
-void CodeGenerator::AssembleMove(InstructionOperand* source,
-                                 InstructionOperand* destination) {
-  X64OperandConverter g(this, nullptr);
-  // Dispatch on the source and destination operand kinds.  Not all
-  // combinations are possible.
-  if (source->IsRegister()) {
-    DCHECK(destination->IsRegister() || destination->IsStackSlot());
-    Register src = g.ToRegister(source);
-    if (destination->IsRegister()) {
-      __ movq(g.ToRegister(destination), src);
-    } else {
-      __ movq(g.ToOperand(destination), src);
-    }
-  } else if (source->IsStackSlot()) {
-    DCHECK(destination->IsRegister() || destination->IsStackSlot());
-    Operand src = g.ToOperand(source);
-    if (destination->IsRegister()) {
-      Register dst = g.ToRegister(destination);
-      __ movq(dst, src);
-    } else {
-      // Spill on demand to use a temporary register for memory-to-memory
-      // moves.
-      Register tmp = kScratchRegister;
-      Operand dst = g.ToOperand(destination);
-      __ movq(tmp, src);
-      __ movq(dst, tmp);
-    }
-  } else if (source->IsConstant()) {
-    ConstantOperand* constant_source = ConstantOperand::cast(source);
-    Constant src = g.ToConstant(constant_source);
-    if (destination->IsRegister() || destination->IsStackSlot()) {
-      Register dst = destination->IsRegister() ? g.ToRegister(destination)
-                                               : kScratchRegister;
-      switch (src.type()) {
-        case Constant::kInt32: {
-          if (RelocInfo::IsWasmPtrReference(src.rmode())) {
-            __ movq(dst, src.ToInt64(), src.rmode());
-          } else {
-            int32_t value = src.ToInt32();
-            if (RelocInfo::IsWasmSizeReference(src.rmode())) {
-              __ movl(dst, Immediate(value, src.rmode()));
-            } else if (value == 0) {
-              __ xorl(dst, dst);
-            } else {
-              __ movl(dst, Immediate(value));
-            }
-          }
-          break;
-        }
-        case Constant::kInt64:
-          if (RelocInfo::IsWasmPtrReference(src.rmode())) {
-            __ movq(dst, src.ToInt64(), src.rmode());
-          } else {
-            DCHECK(!RelocInfo::IsWasmSizeReference(src.rmode()));
-            __ Set(dst, src.ToInt64());
-          }
-          break;
-        case Constant::kFloat32:
-          __ MoveNumber(dst, src.ToFloat32());
-          break;
-        case Constant::kFloat64:
-          __ MoveNumber(dst, src.ToFloat64().value());
-          break;
-        case Constant::kExternalReference:
-          __ Move(dst, src.ToExternalReference());
-          break;
-        case Constant::kHeapObject: {
-          Handle<HeapObject> src_object = src.ToHeapObject();
-          Heap::RootListIndex index;
-          if (IsMaterializableFromRoot(src_object, &index)) {
-            __ LoadRoot(dst, index);
-          } else {
-            __ Move(dst, src_object);
-          }
-          break;
-        }
-        case Constant::kRpoNumber:
-          UNREACHABLE();  // TODO(dcarney): load of labels on x64.
-          break;
-      }
-      if (destination->IsStackSlot()) {
-        __ movq(g.ToOperand(destination), kScratchRegister);
-      }
-    } else if (src.type() == Constant::kFloat32) {
-      // TODO(turbofan): Can we do better here?
-      uint32_t src_const = bit_cast<uint32_t>(src.ToFloat32());
-      if (destination->IsFPRegister()) {
-        __ Move(g.ToDoubleRegister(destination), src_const);
-      } else {
-        DCHECK(destination->IsFPStackSlot());
-        Operand dst = g.ToOperand(destination);
-        __ movl(dst, Immediate(src_const));
-      }
-    } else {
-      DCHECK_EQ(Constant::kFloat64, src.type());
-      uint64_t src_const = src.ToFloat64().AsUint64();
-      if (destination->IsFPRegister()) {
-        __ Move(g.ToDoubleRegister(destination), src_const);
-      } else {
-        DCHECK(destination->IsFPStackSlot());
-        __ movq(kScratchRegister, src_const);
-        __ movq(g.ToOperand(destination), kScratchRegister);
-      }
-    }
-  } else if (source->IsFPRegister()) {
-    XMMRegister src = g.ToDoubleRegister(source);
-    if (destination->IsFPRegister()) {
-      XMMRegister dst = g.ToDoubleRegister(destination);
-      __ Movapd(dst, src);
-    } else {
-      DCHECK(destination->IsFPStackSlot());
-      Operand dst = g.ToOperand(destination);
-      MachineRepresentation rep =
-          LocationOperand::cast(source)->representation();
-      if (rep != MachineRepresentation::kSimd128) {
-        __ Movsd(dst, src);
-      } else {
-        __ Movups(dst, src);
-      }
-    }
-  } else if (source->IsFPStackSlot()) {
-    DCHECK(destination->IsFPRegister() || destination->IsFPStackSlot());
-    Operand src = g.ToOperand(source);
-    MachineRepresentation rep = LocationOperand::cast(source)->representation();
-    if (destination->IsFPRegister()) {
-      XMMRegister dst = g.ToDoubleRegister(destination);
-      if (rep != MachineRepresentation::kSimd128) {
-        __ Movsd(dst, src);
-      } else {
-        __ Movups(dst, src);
-      }
-    } else {
-      Operand dst = g.ToOperand(destination);
-      if (rep != MachineRepresentation::kSimd128) {
-        __ Movsd(kScratchDoubleReg, src);
-        __ Movsd(dst, kScratchDoubleReg);
-      } else {
-        __ Movups(kScratchDoubleReg, src);
-        __ Movups(dst, kScratchDoubleReg);
-      }
-    }
-  } else {
-    UNREACHABLE();
-  }
-}
-
-
-void CodeGenerator::AssembleSwap(InstructionOperand* source,
-                                 InstructionOperand* destination) {
-  X64OperandConverter g(this, nullptr);
-  // Dispatch on the source and destination operand kinds.  Not all
-  // combinations are possible.
-  if (source->IsRegister() && destination->IsRegister()) {
-    // Register-register.
-    Register src = g.ToRegister(source);
-    Register dst = g.ToRegister(destination);
-    __ movq(kScratchRegister, src);
-    __ movq(src, dst);
-    __ movq(dst, kScratchRegister);
-  } else if (source->IsRegister() && destination->IsStackSlot()) {
-    Register src = g.ToRegister(source);
-    __ pushq(src);
-    frame_access_state()->IncreaseSPDelta(1);
-    unwinding_info_writer_.MaybeIncreaseBaseOffsetAt(__ pc_offset(),
-                                                     kPointerSize);
-    Operand dst = g.ToOperand(destination);
-    __ movq(src, dst);
-    frame_access_state()->IncreaseSPDelta(-1);
-    dst = g.ToOperand(destination);
-    __ popq(dst);
-    unwinding_info_writer_.MaybeIncreaseBaseOffsetAt(__ pc_offset(),
-                                                     -kPointerSize);
-  } else if ((source->IsStackSlot() && destination->IsStackSlot()) ||
-             (source->IsFPStackSlot() && destination->IsFPStackSlot())) {
-    // Memory-memory.
-    Operand src = g.ToOperand(source);
-    Operand dst = g.ToOperand(destination);
-    MachineRepresentation rep = LocationOperand::cast(source)->representation();
-    if (rep != MachineRepresentation::kSimd128) {
-      Register tmp = kScratchRegister;
-      __ movq(tmp, dst);
-      __ pushq(src);  // Then use stack to copy src to destination.
-      unwinding_info_writer_.MaybeIncreaseBaseOffsetAt(__ pc_offset(),
-                                                       kPointerSize);
-      __ popq(dst);
-      unwinding_info_writer_.MaybeIncreaseBaseOffsetAt(__ pc_offset(),
-                                                       -kPointerSize);
-      __ movq(src, tmp);
-    } else {
-      // Without AVX, misaligned reads and writes will trap. Move using the
-      // stack, in two parts.
-      __ movups(kScratchDoubleReg, dst);  // Save dst in scratch register.
-      __ pushq(src);  // Then use stack to copy src to destination.
-      unwinding_info_writer_.MaybeIncreaseBaseOffsetAt(__ pc_offset(),
-                                                       kPointerSize);
-      __ popq(dst);
-      unwinding_info_writer_.MaybeIncreaseBaseOffsetAt(__ pc_offset(),
-                                                       -kPointerSize);
-      __ pushq(g.ToOperand(source, kPointerSize));
-      unwinding_info_writer_.MaybeIncreaseBaseOffsetAt(__ pc_offset(),
-                                                       kPointerSize);
-      __ popq(g.ToOperand(destination, kPointerSize));
-      unwinding_info_writer_.MaybeIncreaseBaseOffsetAt(__ pc_offset(),
-                                                       -kPointerSize);
-      __ movups(src, kScratchDoubleReg);
-    }
-  } else if (source->IsFPRegister() && destination->IsFPRegister()) {
-    // XMM register-register swap.
-    XMMRegister src = g.ToDoubleRegister(source);
-    XMMRegister dst = g.ToDoubleRegister(destination);
-    __ Movapd(kScratchDoubleReg, src);
-    __ Movapd(src, dst);
-    __ Movapd(dst, kScratchDoubleReg);
-  } else if (source->IsFPRegister() && destination->IsFPStackSlot()) {
-    // XMM register-memory swap.
-    XMMRegister src = g.ToDoubleRegister(source);
-    Operand dst = g.ToOperand(destination);
-    MachineRepresentation rep = LocationOperand::cast(source)->representation();
-    if (rep != MachineRepresentation::kSimd128) {
-      __ Movsd(kScratchDoubleReg, src);
-      __ Movsd(src, dst);
-      __ Movsd(dst, kScratchDoubleReg);
-    } else {
-      __ Movups(kScratchDoubleReg, src);
-      __ Movups(src, dst);
-      __ Movups(dst, kScratchDoubleReg);
-    }
-  } else {
-    // No other combinations are possible.
-    UNREACHABLE();
-  }
-}
-
-
-void CodeGenerator::AssembleJumpTable(Label** targets, size_t target_count) {
-  for (size_t index = 0; index < target_count; ++index) {
-    __ dq(targets[index]);
-  }
-}
-
-#undef __
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/x64/instruction-codes-x64.h b/src/v8/src/compiler/x64/instruction-codes-x64.h
deleted file mode 100644
index 6d9bc6f..0000000
--- a/src/v8/src/compiler/x64/instruction-codes-x64.h
+++ /dev/null
@@ -1,275 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_X64_INSTRUCTION_CODES_X64_H_
-#define V8_COMPILER_X64_INSTRUCTION_CODES_X64_H_
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-// X64-specific opcodes that specify which assembly sequence to emit.
-// Most opcodes specify a single instruction.
-#define TARGET_ARCH_OPCODE_LIST(V) \
-  V(X64Add)                        \
-  V(X64Add32)                      \
-  V(X64And)                        \
-  V(X64And32)                      \
-  V(X64Cmp)                        \
-  V(X64Cmp32)                      \
-  V(X64Cmp16)                      \
-  V(X64Cmp8)                       \
-  V(X64Test)                       \
-  V(X64Test32)                     \
-  V(X64Test16)                     \
-  V(X64Test8)                      \
-  V(X64Or)                         \
-  V(X64Or32)                       \
-  V(X64Xor)                        \
-  V(X64Xor32)                      \
-  V(X64Sub)                        \
-  V(X64Sub32)                      \
-  V(X64Imul)                       \
-  V(X64Imul32)                     \
-  V(X64ImulHigh32)                 \
-  V(X64UmulHigh32)                 \
-  V(X64Idiv)                       \
-  V(X64Idiv32)                     \
-  V(X64Udiv)                       \
-  V(X64Udiv32)                     \
-  V(X64Not)                        \
-  V(X64Not32)                      \
-  V(X64Neg)                        \
-  V(X64Neg32)                      \
-  V(X64Shl)                        \
-  V(X64Shl32)                      \
-  V(X64Shr)                        \
-  V(X64Shr32)                      \
-  V(X64Sar)                        \
-  V(X64Sar32)                      \
-  V(X64Ror)                        \
-  V(X64Ror32)                      \
-  V(X64Lzcnt)                      \
-  V(X64Lzcnt32)                    \
-  V(X64Tzcnt)                      \
-  V(X64Tzcnt32)                    \
-  V(X64Popcnt)                     \
-  V(X64Popcnt32)                   \
-  V(LFence)                        \
-  V(SSEFloat32Cmp)                 \
-  V(SSEFloat32Add)                 \
-  V(SSEFloat32Sub)                 \
-  V(SSEFloat32Mul)                 \
-  V(SSEFloat32Div)                 \
-  V(SSEFloat32Abs)                 \
-  V(SSEFloat32Neg)                 \
-  V(SSEFloat32Sqrt)                \
-  V(SSEFloat32ToFloat64)           \
-  V(SSEFloat32ToInt32)             \
-  V(SSEFloat32ToUint32)            \
-  V(SSEFloat32Round)               \
-  V(SSEFloat64Cmp)                 \
-  V(SSEFloat64Add)                 \
-  V(SSEFloat64Sub)                 \
-  V(SSEFloat64Mul)                 \
-  V(SSEFloat64Div)                 \
-  V(SSEFloat64Mod)                 \
-  V(SSEFloat64Abs)                 \
-  V(SSEFloat64Neg)                 \
-  V(SSEFloat64Sqrt)                \
-  V(SSEFloat64Round)               \
-  V(SSEFloat32Max)                 \
-  V(SSEFloat64Max)                 \
-  V(SSEFloat32Min)                 \
-  V(SSEFloat64Min)                 \
-  V(SSEFloat64ToFloat32)           \
-  V(SSEFloat64ToInt32)             \
-  V(SSEFloat64ToUint32)            \
-  V(SSEFloat32ToInt64)             \
-  V(SSEFloat64ToInt64)             \
-  V(SSEFloat32ToUint64)            \
-  V(SSEFloat64ToUint64)            \
-  V(SSEInt32ToFloat64)             \
-  V(SSEInt32ToFloat32)             \
-  V(SSEInt64ToFloat32)             \
-  V(SSEInt64ToFloat64)             \
-  V(SSEUint64ToFloat32)            \
-  V(SSEUint64ToFloat64)            \
-  V(SSEUint32ToFloat64)            \
-  V(SSEUint32ToFloat32)            \
-  V(SSEFloat64ExtractLowWord32)    \
-  V(SSEFloat64ExtractHighWord32)   \
-  V(SSEFloat64InsertLowWord32)     \
-  V(SSEFloat64InsertHighWord32)    \
-  V(SSEFloat64LoadLowWord32)       \
-  V(SSEFloat64SilenceNaN)          \
-  V(AVXFloat32Cmp)                 \
-  V(AVXFloat32Add)                 \
-  V(AVXFloat32Sub)                 \
-  V(AVXFloat32Mul)                 \
-  V(AVXFloat32Div)                 \
-  V(AVXFloat64Cmp)                 \
-  V(AVXFloat64Add)                 \
-  V(AVXFloat64Sub)                 \
-  V(AVXFloat64Mul)                 \
-  V(AVXFloat64Div)                 \
-  V(AVXFloat64Abs)                 \
-  V(AVXFloat64Neg)                 \
-  V(AVXFloat32Abs)                 \
-  V(AVXFloat32Neg)                 \
-  V(X64Movsxbl)                    \
-  V(X64Movzxbl)                    \
-  V(X64Movsxbq)                    \
-  V(X64Movzxbq)                    \
-  V(X64Movb)                       \
-  V(X64Movsxwl)                    \
-  V(X64Movzxwl)                    \
-  V(X64Movsxwq)                    \
-  V(X64Movzxwq)                    \
-  V(X64Movw)                       \
-  V(X64Movl)                       \
-  V(X64Movsxlq)                    \
-  V(X64Movq)                       \
-  V(X64Movsd)                      \
-  V(X64Movss)                      \
-  V(X64Movdqu)                     \
-  V(X64BitcastFI)                  \
-  V(X64BitcastDL)                  \
-  V(X64BitcastIF)                  \
-  V(X64BitcastLD)                  \
-  V(X64Lea32)                      \
-  V(X64Lea)                        \
-  V(X64Dec32)                      \
-  V(X64Inc32)                      \
-  V(X64Push)                       \
-  V(X64Poke)                       \
-  V(X64Peek)                       \
-  V(X64StackCheck)                 \
-  V(X64F32x4Splat)                 \
-  V(X64F32x4ExtractLane)           \
-  V(X64F32x4ReplaceLane)           \
-  V(X64F32x4RecipApprox)           \
-  V(X64F32x4RecipSqrtApprox)       \
-  V(X64F32x4Add)                   \
-  V(X64F32x4Sub)                   \
-  V(X64F32x4Mul)                   \
-  V(X64F32x4Min)                   \
-  V(X64F32x4Max)                   \
-  V(X64F32x4Eq)                    \
-  V(X64F32x4Ne)                    \
-  V(X64F32x4Lt)                    \
-  V(X64F32x4Le)                    \
-  V(X64I32x4Splat)                 \
-  V(X64I32x4ExtractLane)           \
-  V(X64I32x4ReplaceLane)           \
-  V(X64I32x4Neg)                   \
-  V(X64I32x4Shl)                   \
-  V(X64I32x4ShrS)                  \
-  V(X64I32x4Add)                   \
-  V(X64I32x4AddHoriz)              \
-  V(X64I32x4Sub)                   \
-  V(X64I32x4Mul)                   \
-  V(X64I32x4MinS)                  \
-  V(X64I32x4MaxS)                  \
-  V(X64I32x4Eq)                    \
-  V(X64I32x4Ne)                    \
-  V(X64I32x4GtS)                   \
-  V(X64I32x4GeS)                   \
-  V(X64I32x4ShrU)                  \
-  V(X64I32x4MinU)                  \
-  V(X64I32x4MaxU)                  \
-  V(X64I32x4GtU)                   \
-  V(X64I32x4GeU)                   \
-  V(X64I16x8Splat)                 \
-  V(X64I16x8ExtractLane)           \
-  V(X64I16x8ReplaceLane)           \
-  V(X64I16x8Neg)                   \
-  V(X64I16x8Shl)                   \
-  V(X64I16x8ShrS)                  \
-  V(X64I16x8Add)                   \
-  V(X64I16x8AddSaturateS)          \
-  V(X64I16x8AddHoriz)              \
-  V(X64I16x8Sub)                   \
-  V(X64I16x8SubSaturateS)          \
-  V(X64I16x8Mul)                   \
-  V(X64I16x8MinS)                  \
-  V(X64I16x8MaxS)                  \
-  V(X64I16x8Eq)                    \
-  V(X64I16x8Ne)                    \
-  V(X64I16x8GtS)                   \
-  V(X64I16x8GeS)                   \
-  V(X64I16x8ShrU)                  \
-  V(X64I16x8AddSaturateU)          \
-  V(X64I16x8SubSaturateU)          \
-  V(X64I16x8MinU)                  \
-  V(X64I16x8MaxU)                  \
-  V(X64I16x8GtU)                   \
-  V(X64I16x8GeU)                   \
-  V(X64I8x16Splat)                 \
-  V(X64I8x16ExtractLane)           \
-  V(X64I8x16ReplaceLane)           \
-  V(X64I8x16Neg)                   \
-  V(X64I8x16Add)                   \
-  V(X64I8x16AddSaturateS)          \
-  V(X64I8x16Sub)                   \
-  V(X64I8x16SubSaturateS)          \
-  V(X64I8x16MinS)                  \
-  V(X64I8x16MaxS)                  \
-  V(X64I8x16Eq)                    \
-  V(X64I8x16Ne)                    \
-  V(X64I8x16GtS)                   \
-  V(X64I8x16GeS)                   \
-  V(X64I8x16AddSaturateU)          \
-  V(X64I8x16SubSaturateU)          \
-  V(X64I8x16MinU)                  \
-  V(X64I8x16MaxU)                  \
-  V(X64I8x16GtU)                   \
-  V(X64I8x16GeU)                   \
-  V(X64S128And)                    \
-  V(X64S128Or)                     \
-  V(X64S128Xor)                    \
-  V(X64S128Not)                    \
-  V(X64S128Select)                 \
-  V(X64S128Zero)
-
-// Addressing modes represent the "shape" of inputs to an instruction.
-// Many instructions support multiple addressing modes. Addressing modes
-// are encoded into the InstructionCode of the instruction and tell the
-// code generator after register allocation which assembler method to call.
-//
-// We use the following local notation for addressing modes:
-//
-// M = memory operand
-// R = base register
-// N = index register * N for N in {1, 2, 4, 8}
-// I = immediate displacement (32-bit signed integer)
-
-#define TARGET_ADDRESSING_MODE_LIST(V) \
-  V(MR)   /* [%r1            ] */      \
-  V(MRI)  /* [%r1         + K] */      \
-  V(MR1)  /* [%r1 + %r2*1    ] */      \
-  V(MR2)  /* [%r1 + %r2*2    ] */      \
-  V(MR4)  /* [%r1 + %r2*4    ] */      \
-  V(MR8)  /* [%r1 + %r2*8    ] */      \
-  V(MR1I) /* [%r1 + %r2*1 + K] */      \
-  V(MR2I) /* [%r1 + %r2*2 + K] */      \
-  V(MR4I) /* [%r1 + %r2*3 + K] */      \
-  V(MR8I) /* [%r1 + %r2*4 + K] */      \
-  V(M1)   /* [      %r2*1    ] */      \
-  V(M2)   /* [      %r2*2    ] */      \
-  V(M4)   /* [      %r2*4    ] */      \
-  V(M8)   /* [      %r2*8    ] */      \
-  V(M1I)  /* [      %r2*1 + K] */      \
-  V(M2I)  /* [      %r2*2 + K] */      \
-  V(M4I)  /* [      %r2*4 + K] */      \
-  V(M8I)  /* [      %r2*8 + K] */      \
-  V(Root) /* [%root       + K] */
-
-enum X64MemoryProtection { kUnprotected = 0, kProtected = 1 };
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_COMPILER_X64_INSTRUCTION_CODES_X64_H_
diff --git a/src/v8/src/compiler/x64/instruction-scheduler-x64.cc b/src/v8/src/compiler/x64/instruction-scheduler-x64.cc
deleted file mode 100644
index c16fee5..0000000
--- a/src/v8/src/compiler/x64/instruction-scheduler-x64.cc
+++ /dev/null
@@ -1,340 +0,0 @@
-// Copyright 2015 the V8 project 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 "src/compiler/instruction-scheduler.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-bool InstructionScheduler::SchedulerSupported() { return true; }
-
-
-int InstructionScheduler::GetTargetInstructionFlags(
-    const Instruction* instr) const {
-  switch (instr->arch_opcode()) {
-    case kX64Add:
-    case kX64Add32:
-    case kX64And:
-    case kX64And32:
-    case kX64Cmp:
-    case kX64Cmp32:
-    case kX64Cmp16:
-    case kX64Cmp8:
-    case kX64Test:
-    case kX64Test32:
-    case kX64Test16:
-    case kX64Test8:
-    case kX64Or:
-    case kX64Or32:
-    case kX64Xor:
-    case kX64Xor32:
-    case kX64Sub:
-    case kX64Sub32:
-    case kX64Imul:
-    case kX64Imul32:
-    case kX64ImulHigh32:
-    case kX64UmulHigh32:
-    case kX64Not:
-    case kX64Not32:
-    case kX64Neg:
-    case kX64Neg32:
-    case kX64Shl:
-    case kX64Shl32:
-    case kX64Shr:
-    case kX64Shr32:
-    case kX64Sar:
-    case kX64Sar32:
-    case kX64Ror:
-    case kX64Ror32:
-    case kX64Lzcnt:
-    case kX64Lzcnt32:
-    case kX64Tzcnt:
-    case kX64Tzcnt32:
-    case kX64Popcnt:
-    case kX64Popcnt32:
-    case kSSEFloat32Cmp:
-    case kSSEFloat32Add:
-    case kSSEFloat32Sub:
-    case kSSEFloat32Mul:
-    case kSSEFloat32Div:
-    case kSSEFloat32Abs:
-    case kSSEFloat32Neg:
-    case kSSEFloat32Sqrt:
-    case kSSEFloat32Round:
-    case kSSEFloat32ToFloat64:
-    case kSSEFloat64Cmp:
-    case kSSEFloat64Add:
-    case kSSEFloat64Sub:
-    case kSSEFloat64Mul:
-    case kSSEFloat64Div:
-    case kSSEFloat64Mod:
-    case kSSEFloat64Abs:
-    case kSSEFloat64Neg:
-    case kSSEFloat64Sqrt:
-    case kSSEFloat64Round:
-    case kSSEFloat32Max:
-    case kSSEFloat64Max:
-    case kSSEFloat32Min:
-    case kSSEFloat64Min:
-    case kSSEFloat64ToFloat32:
-    case kSSEFloat32ToInt32:
-    case kSSEFloat32ToUint32:
-    case kSSEFloat64ToInt32:
-    case kSSEFloat64ToUint32:
-    case kSSEFloat64ToInt64:
-    case kSSEFloat32ToInt64:
-    case kSSEFloat64ToUint64:
-    case kSSEFloat32ToUint64:
-    case kSSEInt32ToFloat64:
-    case kSSEInt32ToFloat32:
-    case kSSEInt64ToFloat32:
-    case kSSEInt64ToFloat64:
-    case kSSEUint64ToFloat32:
-    case kSSEUint64ToFloat64:
-    case kSSEUint32ToFloat64:
-    case kSSEUint32ToFloat32:
-    case kSSEFloat64ExtractLowWord32:
-    case kSSEFloat64ExtractHighWord32:
-    case kSSEFloat64InsertLowWord32:
-    case kSSEFloat64InsertHighWord32:
-    case kSSEFloat64LoadLowWord32:
-    case kSSEFloat64SilenceNaN:
-    case kAVXFloat32Cmp:
-    case kAVXFloat32Add:
-    case kAVXFloat32Sub:
-    case kAVXFloat32Mul:
-    case kAVXFloat32Div:
-    case kAVXFloat64Cmp:
-    case kAVXFloat64Add:
-    case kAVXFloat64Sub:
-    case kAVXFloat64Mul:
-    case kAVXFloat64Div:
-    case kAVXFloat64Abs:
-    case kAVXFloat64Neg:
-    case kAVXFloat32Abs:
-    case kAVXFloat32Neg:
-    case kX64BitcastFI:
-    case kX64BitcastDL:
-    case kX64BitcastIF:
-    case kX64BitcastLD:
-    case kX64Lea32:
-    case kX64Lea:
-    case kX64Dec32:
-    case kX64Inc32:
-    case kX64F32x4Splat:
-    case kX64F32x4ExtractLane:
-    case kX64F32x4ReplaceLane:
-    case kX64F32x4RecipApprox:
-    case kX64F32x4RecipSqrtApprox:
-    case kX64F32x4Add:
-    case kX64F32x4Sub:
-    case kX64F32x4Mul:
-    case kX64F32x4Min:
-    case kX64F32x4Max:
-    case kX64F32x4Eq:
-    case kX64F32x4Ne:
-    case kX64F32x4Lt:
-    case kX64F32x4Le:
-    case kX64I32x4Splat:
-    case kX64I32x4ExtractLane:
-    case kX64I32x4ReplaceLane:
-    case kX64I32x4Neg:
-    case kX64I32x4Shl:
-    case kX64I32x4ShrS:
-    case kX64I32x4Add:
-    case kX64I32x4AddHoriz:
-    case kX64I32x4Sub:
-    case kX64I32x4Mul:
-    case kX64I32x4MinS:
-    case kX64I32x4MaxS:
-    case kX64I32x4Eq:
-    case kX64I32x4Ne:
-    case kX64I32x4GtS:
-    case kX64I32x4GeS:
-    case kX64I32x4ShrU:
-    case kX64I32x4MinU:
-    case kX64I32x4MaxU:
-    case kX64I32x4GtU:
-    case kX64I32x4GeU:
-    case kX64I16x8Splat:
-    case kX64I16x8ExtractLane:
-    case kX64I16x8ReplaceLane:
-    case kX64I16x8Neg:
-    case kX64I16x8Shl:
-    case kX64I16x8ShrS:
-    case kX64I16x8Add:
-    case kX64I16x8AddSaturateS:
-    case kX64I16x8AddHoriz:
-    case kX64I16x8Sub:
-    case kX64I16x8SubSaturateS:
-    case kX64I16x8Mul:
-    case kX64I16x8MinS:
-    case kX64I16x8MaxS:
-    case kX64I16x8Eq:
-    case kX64I16x8Ne:
-    case kX64I16x8GtS:
-    case kX64I16x8GeS:
-    case kX64I16x8ShrU:
-    case kX64I16x8AddSaturateU:
-    case kX64I16x8SubSaturateU:
-    case kX64I16x8MinU:
-    case kX64I16x8MaxU:
-    case kX64I16x8GtU:
-    case kX64I16x8GeU:
-    case kX64I8x16Splat:
-    case kX64I8x16ExtractLane:
-    case kX64I8x16ReplaceLane:
-    case kX64I8x16Neg:
-    case kX64I8x16Add:
-    case kX64I8x16AddSaturateS:
-    case kX64I8x16Sub:
-    case kX64I8x16SubSaturateS:
-    case kX64I8x16MinS:
-    case kX64I8x16MaxS:
-    case kX64I8x16Eq:
-    case kX64I8x16Ne:
-    case kX64I8x16GtS:
-    case kX64I8x16GeS:
-    case kX64I8x16AddSaturateU:
-    case kX64I8x16SubSaturateU:
-    case kX64I8x16MinU:
-    case kX64I8x16MaxU:
-    case kX64I8x16GtU:
-    case kX64I8x16GeU:
-    case kX64S128And:
-    case kX64S128Or:
-    case kX64S128Xor:
-    case kX64S128Not:
-    case kX64S128Select:
-    case kX64S128Zero:
-      return (instr->addressing_mode() == kMode_None)
-          ? kNoOpcodeFlags
-          : kIsLoadOperation | kHasSideEffect;
-
-    case kX64Idiv:
-    case kX64Idiv32:
-    case kX64Udiv:
-    case kX64Udiv32:
-      return (instr->addressing_mode() == kMode_None)
-                 ? kMayNeedDeoptOrTrapCheck
-                 : kMayNeedDeoptOrTrapCheck | kIsLoadOperation | kHasSideEffect;
-
-    case kX64Movsxbl:
-    case kX64Movzxbl:
-    case kX64Movsxbq:
-    case kX64Movzxbq:
-    case kX64Movsxwl:
-    case kX64Movzxwl:
-    case kX64Movsxwq:
-    case kX64Movzxwq:
-    case kX64Movsxlq:
-      DCHECK_LE(1, instr->InputCount());
-      return instr->InputAt(0)->IsRegister() ? kNoOpcodeFlags
-                                             : kIsLoadOperation;
-
-    case kX64Movb:
-    case kX64Movw:
-      return kHasSideEffect;
-
-    case kX64Movl:
-      if (instr->HasOutput()) {
-        DCHECK_LE(1, instr->InputCount());
-        return instr->InputAt(0)->IsRegister() ? kNoOpcodeFlags
-                                               : kIsLoadOperation;
-      } else {
-        return kHasSideEffect;
-      }
-
-    case kX64Movq:
-    case kX64Movsd:
-    case kX64Movss:
-    case kX64Movdqu:
-      return instr->HasOutput() ? kIsLoadOperation : kHasSideEffect;
-
-    case kX64StackCheck:
-    case kX64Peek:
-      return kIsLoadOperation;
-
-    case kX64Push:
-    case kX64Poke:
-      return kHasSideEffect;
-
-    case kLFence:
-      return kHasSideEffect;
-
-#define CASE(Name) case k##Name:
-    COMMON_ARCH_OPCODE_LIST(CASE)
-#undef CASE
-      // Already covered in architecture independent code.
-      UNREACHABLE();
-  }
-
-  UNREACHABLE();
-}
-
-
-int InstructionScheduler::GetInstructionLatency(const Instruction* instr) {
-  // Basic latency modeling for x64 instructions. They have been determined
-  // in an empirical way.
-  switch (instr->arch_opcode()) {
-    case kSSEFloat64Mul:
-      return 5;
-    case kX64Imul:
-    case kX64Imul32:
-    case kX64ImulHigh32:
-    case kX64UmulHigh32:
-    case kSSEFloat32Cmp:
-    case kSSEFloat32Add:
-    case kSSEFloat32Sub:
-    case kSSEFloat32Abs:
-    case kSSEFloat32Neg:
-    case kSSEFloat64Cmp:
-    case kSSEFloat64Add:
-    case kSSEFloat64Sub:
-    case kSSEFloat64Max:
-    case kSSEFloat64Min:
-    case kSSEFloat64Abs:
-    case kSSEFloat64Neg:
-      return 3;
-    case kSSEFloat32Mul:
-    case kSSEFloat32ToFloat64:
-    case kSSEFloat64ToFloat32:
-    case kSSEFloat32Round:
-    case kSSEFloat64Round:
-    case kSSEFloat32ToInt32:
-    case kSSEFloat32ToUint32:
-    case kSSEFloat64ToInt32:
-    case kSSEFloat64ToUint32:
-      return 4;
-    case kX64Idiv:
-      return 49;
-    case kX64Idiv32:
-      return 35;
-    case kX64Udiv:
-      return 38;
-    case kX64Udiv32:
-      return 26;
-    case kSSEFloat32Div:
-    case kSSEFloat64Div:
-    case kSSEFloat32Sqrt:
-    case kSSEFloat64Sqrt:
-      return 13;
-    case kSSEFloat32ToInt64:
-    case kSSEFloat64ToInt64:
-    case kSSEFloat32ToUint64:
-    case kSSEFloat64ToUint64:
-      return 10;
-    case kSSEFloat64Mod:
-      return 50;
-    case kArchTruncateDoubleToI:
-      return 6;
-    default:
-      return 1;
-  }
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/x64/instruction-selector-x64.cc b/src/v8/src/compiler/x64/instruction-selector-x64.cc
deleted file mode 100644
index a0f14c6..0000000
--- a/src/v8/src/compiler/x64/instruction-selector-x64.cc
+++ /dev/null
@@ -1,2570 +0,0 @@
-// Copyright 2014 the V8 project 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 <algorithm>
-
-#include "src/base/adapters.h"
-#include "src/compiler/instruction-selector-impl.h"
-#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-// Adds X64-specific methods for generating operands.
-class X64OperandGenerator final : public OperandGenerator {
- public:
-  explicit X64OperandGenerator(InstructionSelector* selector)
-      : OperandGenerator(selector) {}
-
-  bool CanBeImmediate(Node* node) {
-    switch (node->opcode()) {
-      case IrOpcode::kInt32Constant:
-      case IrOpcode::kRelocatableInt32Constant:
-        return true;
-      case IrOpcode::kInt64Constant: {
-        const int64_t value = OpParameter<int64_t>(node);
-        return std::numeric_limits<int32_t>::min() < value &&
-               value <= std::numeric_limits<int32_t>::max();
-      }
-      case IrOpcode::kNumberConstant: {
-        const double value = OpParameter<double>(node);
-        return bit_cast<int64_t>(value) == 0;
-      }
-      default:
-        return false;
-    }
-  }
-
-  int32_t GetImmediateIntegerValue(Node* node) {
-    DCHECK(CanBeImmediate(node));
-    if (node->opcode() == IrOpcode::kInt32Constant) {
-      return OpParameter<int32_t>(node);
-    }
-    DCHECK_EQ(IrOpcode::kInt64Constant, node->opcode());
-    return static_cast<int32_t>(OpParameter<int64_t>(node));
-  }
-
-  bool CanBeMemoryOperand(InstructionCode opcode, Node* node, Node* input,
-                          int effect_level) {
-    if (input->opcode() != IrOpcode::kLoad ||
-        !selector()->CanCover(node, input)) {
-      return false;
-    }
-    if (effect_level != selector()->GetEffectLevel(input)) {
-      return false;
-    }
-    MachineRepresentation rep =
-        LoadRepresentationOf(input->op()).representation();
-    switch (opcode) {
-      case kX64And:
-      case kX64Or:
-      case kX64Xor:
-      case kX64Add:
-      case kX64Sub:
-      case kX64Push:
-      case kX64Cmp:
-      case kX64Test:
-        return rep == MachineRepresentation::kWord64 || IsAnyTagged(rep);
-      case kX64And32:
-      case kX64Or32:
-      case kX64Xor32:
-      case kX64Add32:
-      case kX64Sub32:
-      case kX64Cmp32:
-      case kX64Test32:
-        return rep == MachineRepresentation::kWord32;
-      case kX64Cmp16:
-      case kX64Test16:
-        return rep == MachineRepresentation::kWord16;
-      case kX64Cmp8:
-      case kX64Test8:
-        return rep == MachineRepresentation::kWord8;
-      default:
-        break;
-    }
-    return false;
-  }
-
-  AddressingMode GenerateMemoryOperandInputs(Node* index, int scale_exponent,
-                                             Node* base, Node* displacement,
-                                             DisplacementMode displacement_mode,
-                                             InstructionOperand inputs[],
-                                             size_t* input_count) {
-    AddressingMode mode = kMode_MRI;
-    if (base != nullptr && (index != nullptr || displacement != nullptr)) {
-      if (base->opcode() == IrOpcode::kInt32Constant &&
-          OpParameter<int32_t>(base) == 0) {
-        base = nullptr;
-      } else if (base->opcode() == IrOpcode::kInt64Constant &&
-                 OpParameter<int64_t>(base) == 0) {
-        base = nullptr;
-      }
-    }
-    if (base != nullptr) {
-      inputs[(*input_count)++] = UseRegister(base);
-      if (index != nullptr) {
-        DCHECK(scale_exponent >= 0 && scale_exponent <= 3);
-        inputs[(*input_count)++] = UseRegister(index);
-        if (displacement != nullptr) {
-          inputs[(*input_count)++] = displacement_mode == kNegativeDisplacement
-                                         ? UseNegatedImmediate(displacement)
-                                         : UseImmediate(displacement);
-          static const AddressingMode kMRnI_modes[] = {kMode_MR1I, kMode_MR2I,
-                                                       kMode_MR4I, kMode_MR8I};
-          mode = kMRnI_modes[scale_exponent];
-        } else {
-          static const AddressingMode kMRn_modes[] = {kMode_MR1, kMode_MR2,
-                                                      kMode_MR4, kMode_MR8};
-          mode = kMRn_modes[scale_exponent];
-        }
-      } else {
-        if (displacement == nullptr) {
-          mode = kMode_MR;
-        } else {
-          inputs[(*input_count)++] = displacement_mode == kNegativeDisplacement
-                                         ? UseNegatedImmediate(displacement)
-                                         : UseImmediate(displacement);
-          mode = kMode_MRI;
-        }
-      }
-    } else {
-      DCHECK(scale_exponent >= 0 && scale_exponent <= 3);
-      if (displacement != nullptr) {
-        if (index == nullptr) {
-          inputs[(*input_count)++] = UseRegister(displacement);
-          mode = kMode_MR;
-        } else {
-          inputs[(*input_count)++] = UseRegister(index);
-          inputs[(*input_count)++] = displacement_mode == kNegativeDisplacement
-                                         ? UseNegatedImmediate(displacement)
-                                         : UseImmediate(displacement);
-          static const AddressingMode kMnI_modes[] = {kMode_MRI, kMode_M2I,
-                                                      kMode_M4I, kMode_M8I};
-          mode = kMnI_modes[scale_exponent];
-        }
-      } else {
-        inputs[(*input_count)++] = UseRegister(index);
-        static const AddressingMode kMn_modes[] = {kMode_MR, kMode_MR1,
-                                                   kMode_M4, kMode_M8};
-        mode = kMn_modes[scale_exponent];
-        if (mode == kMode_MR1) {
-          // [%r1 + %r1*1] has a smaller encoding than [%r1*2+0]
-          inputs[(*input_count)++] = UseRegister(index);
-        }
-      }
-    }
-    return mode;
-  }
-
-  AddressingMode GetEffectiveAddressMemoryOperand(Node* operand,
-                                                  InstructionOperand inputs[],
-                                                  size_t* input_count) {
-    if (selector()->CanAddressRelativeToRootsRegister()) {
-      LoadMatcher<ExternalReferenceMatcher> m(operand);
-      if (m.index().HasValue() && m.object().HasValue()) {
-        Address const kRootsRegisterValue =
-            kRootRegisterBias +
-            reinterpret_cast<Address>(
-                selector()->isolate()->heap()->roots_array_start());
-        ptrdiff_t const delta =
-            m.index().Value() +
-            (m.object().Value().address() - kRootsRegisterValue);
-        if (is_int32(delta)) {
-          inputs[(*input_count)++] = TempImmediate(static_cast<int32_t>(delta));
-          return kMode_Root;
-        }
-      }
-    }
-    BaseWithIndexAndDisplacement64Matcher m(operand, AddressOption::kAllowAll);
-    DCHECK(m.matches());
-    if (m.displacement() == nullptr || CanBeImmediate(m.displacement())) {
-      return GenerateMemoryOperandInputs(
-          m.index(), m.scale(), m.base(), m.displacement(),
-          m.displacement_mode(), inputs, input_count);
-    } else if (m.base() == nullptr &&
-               m.displacement_mode() == kPositiveDisplacement) {
-      // The displacement cannot be an immediate, but we can use the
-      // displacement as base instead and still benefit from addressing
-      // modes for the scale.
-      return GenerateMemoryOperandInputs(m.index(), m.scale(), m.displacement(),
-                                         nullptr, m.displacement_mode(), inputs,
-                                         input_count);
-    } else {
-      inputs[(*input_count)++] = UseRegister(operand->InputAt(0));
-      inputs[(*input_count)++] = UseRegister(operand->InputAt(1));
-      return kMode_MR1;
-    }
-  }
-
-  bool CanBeBetterLeftOperand(Node* node) const {
-    return !selector()->IsLive(node);
-  }
-};
-
-namespace {
-ArchOpcode GetLoadOpcode(LoadRepresentation load_rep) {
-  ArchOpcode opcode = kArchNop;
-  switch (load_rep.representation()) {
-    case MachineRepresentation::kFloat32:
-      opcode = kX64Movss;
-      break;
-    case MachineRepresentation::kFloat64:
-      opcode = kX64Movsd;
-      break;
-    case MachineRepresentation::kBit:  // Fall through.
-    case MachineRepresentation::kWord8:
-      opcode = load_rep.IsSigned() ? kX64Movsxbl : kX64Movzxbl;
-      break;
-    case MachineRepresentation::kWord16:
-      opcode = load_rep.IsSigned() ? kX64Movsxwl : kX64Movzxwl;
-      break;
-    case MachineRepresentation::kWord32:
-      opcode = kX64Movl;
-      break;
-    case MachineRepresentation::kTaggedSigned:   // Fall through.
-    case MachineRepresentation::kTaggedPointer:  // Fall through.
-    case MachineRepresentation::kTagged:  // Fall through.
-    case MachineRepresentation::kWord64:
-      opcode = kX64Movq;
-      break;
-    case MachineRepresentation::kSimd128:  // Fall through.
-      opcode = kX64Movdqu;
-      break;
-    case MachineRepresentation::kNone:
-      UNREACHABLE();
-      break;
-  }
-  return opcode;
-}
-
-ArchOpcode GetStoreOpcode(StoreRepresentation store_rep) {
-  switch (store_rep.representation()) {
-    case MachineRepresentation::kFloat32:
-      return kX64Movss;
-      break;
-    case MachineRepresentation::kFloat64:
-      return kX64Movsd;
-      break;
-    case MachineRepresentation::kBit:  // Fall through.
-    case MachineRepresentation::kWord8:
-      return kX64Movb;
-      break;
-    case MachineRepresentation::kWord16:
-      return kX64Movw;
-      break;
-    case MachineRepresentation::kWord32:
-      return kX64Movl;
-      break;
-    case MachineRepresentation::kTaggedSigned:   // Fall through.
-    case MachineRepresentation::kTaggedPointer:  // Fall through.
-    case MachineRepresentation::kTagged:         // Fall through.
-    case MachineRepresentation::kWord64:
-      return kX64Movq;
-      break;
-    case MachineRepresentation::kSimd128:  // Fall through.
-      return kX64Movdqu;
-      break;
-    case MachineRepresentation::kNone:
-      UNREACHABLE();
-  }
-  UNREACHABLE();
-}
-
-}  // namespace
-
-void InstructionSelector::VisitStackSlot(Node* node) {
-  StackSlotRepresentation rep = StackSlotRepresentationOf(node->op());
-  int slot = frame_->AllocateSpillSlot(rep.size());
-  OperandGenerator g(this);
-
-  Emit(kArchStackSlot, g.DefineAsRegister(node),
-       sequence()->AddImmediate(Constant(slot)), 0, nullptr);
-}
-
-void InstructionSelector::VisitDebugAbort(Node* node) {
-  X64OperandGenerator g(this);
-  Emit(kArchDebugAbort, g.NoOutput(), g.UseFixed(node->InputAt(0), rdx));
-}
-
-void InstructionSelector::VisitSpeculationFence(Node* node) {
-  X64OperandGenerator g(this);
-  Emit(kLFence, g.NoOutput());
-}
-
-void InstructionSelector::VisitLoad(Node* node) {
-  LoadRepresentation load_rep = LoadRepresentationOf(node->op());
-  X64OperandGenerator g(this);
-
-  ArchOpcode opcode = GetLoadOpcode(load_rep);
-  InstructionOperand outputs[1];
-  outputs[0] = g.DefineAsRegister(node);
-  InstructionOperand inputs[3];
-  size_t input_count = 0;
-  AddressingMode mode =
-      g.GetEffectiveAddressMemoryOperand(node, inputs, &input_count);
-  InstructionCode code = opcode | AddressingModeField::encode(mode);
-  if (node->opcode() == IrOpcode::kProtectedLoad) {
-    code |= MiscField::encode(X64MemoryProtection::kProtected);
-  }
-  Emit(code, 1, outputs, input_count, inputs);
-}
-
-void InstructionSelector::VisitProtectedLoad(Node* node) { VisitLoad(node); }
-
-void InstructionSelector::VisitStore(Node* node) {
-  X64OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-
-  StoreRepresentation store_rep = StoreRepresentationOf(node->op());
-  WriteBarrierKind write_barrier_kind = store_rep.write_barrier_kind();
-
-  if (write_barrier_kind != kNoWriteBarrier) {
-    DCHECK(CanBeTaggedPointer(store_rep.representation()));
-    AddressingMode addressing_mode;
-    InstructionOperand inputs[3];
-    size_t input_count = 0;
-    inputs[input_count++] = g.UseUniqueRegister(base);
-    if (g.CanBeImmediate(index)) {
-      inputs[input_count++] = g.UseImmediate(index);
-      addressing_mode = kMode_MRI;
-    } else {
-      inputs[input_count++] = g.UseUniqueRegister(index);
-      addressing_mode = kMode_MR1;
-    }
-    inputs[input_count++] = g.UseUniqueRegister(value);
-    RecordWriteMode record_write_mode = RecordWriteMode::kValueIsAny;
-    switch (write_barrier_kind) {
-      case kNoWriteBarrier:
-        UNREACHABLE();
-        break;
-      case kMapWriteBarrier:
-        record_write_mode = RecordWriteMode::kValueIsMap;
-        break;
-      case kPointerWriteBarrier:
-        record_write_mode = RecordWriteMode::kValueIsPointer;
-        break;
-      case kFullWriteBarrier:
-        record_write_mode = RecordWriteMode::kValueIsAny;
-        break;
-    }
-    InstructionOperand temps[] = {g.TempRegister(), g.TempRegister()};
-    size_t const temp_count = arraysize(temps);
-    InstructionCode code = kArchStoreWithWriteBarrier;
-    code |= AddressingModeField::encode(addressing_mode);
-    code |= MiscField::encode(static_cast<int>(record_write_mode));
-    Emit(code, 0, nullptr, input_count, inputs, temp_count, temps);
-  } else {
-    ArchOpcode opcode = GetStoreOpcode(store_rep);
-    InstructionOperand inputs[4];
-    size_t input_count = 0;
-    AddressingMode addressing_mode =
-        g.GetEffectiveAddressMemoryOperand(node, inputs, &input_count);
-    InstructionCode code =
-        opcode | AddressingModeField::encode(addressing_mode);
-    if ((ElementSizeLog2Of(store_rep.representation()) < kPointerSizeLog2) &&
-        (value->opcode() == IrOpcode::kTruncateInt64ToInt32) &&
-        CanCover(node, value)) {
-      value = value->InputAt(0);
-    }
-    InstructionOperand value_operand =
-        g.CanBeImmediate(value) ? g.UseImmediate(value) : g.UseRegister(value);
-    inputs[input_count++] = value_operand;
-    Emit(code, 0, static_cast<InstructionOperand*>(nullptr), input_count,
-         inputs);
-  }
-}
-
-void InstructionSelector::VisitProtectedStore(Node* node) {
-  X64OperandGenerator g(this);
-  Node* value = node->InputAt(2);
-
-  StoreRepresentation store_rep = StoreRepresentationOf(node->op());
-
-  ArchOpcode opcode = GetStoreOpcode(store_rep);
-  InstructionOperand inputs[4];
-  size_t input_count = 0;
-  AddressingMode addressing_mode =
-      g.GetEffectiveAddressMemoryOperand(node, inputs, &input_count);
-  InstructionCode code = opcode | AddressingModeField::encode(addressing_mode) |
-                         MiscField::encode(X64MemoryProtection::kProtected);
-  InstructionOperand value_operand =
-      g.CanBeImmediate(value) ? g.UseImmediate(value) : g.UseRegister(value);
-  inputs[input_count++] = value_operand;
-  Emit(code, 0, static_cast<InstructionOperand*>(nullptr), input_count, inputs);
-}
-
-// Architecture supports unaligned access, therefore VisitLoad is used instead
-void InstructionSelector::VisitUnalignedLoad(Node* node) { UNREACHABLE(); }
-
-// Architecture supports unaligned access, therefore VisitStore is used instead
-void InstructionSelector::VisitUnalignedStore(Node* node) { UNREACHABLE(); }
-
-// Shared routine for multiple binary operations.
-static void VisitBinop(InstructionSelector* selector, Node* node,
-                       InstructionCode opcode, FlagsContinuation* cont) {
-  X64OperandGenerator g(selector);
-  Int32BinopMatcher m(node);
-  Node* left = m.left().node();
-  Node* right = m.right().node();
-  InstructionOperand inputs[6];
-  size_t input_count = 0;
-  InstructionOperand outputs[2];
-  size_t output_count = 0;
-
-  // TODO(turbofan): match complex addressing modes.
-  if (left == right) {
-    // If both inputs refer to the same operand, enforce allocating a register
-    // for both of them to ensure that we don't end up generating code like
-    // this:
-    //
-    //   mov rax, [rbp-0x10]
-    //   add rax, [rbp-0x10]
-    //   jo label
-    InstructionOperand const input = g.UseRegister(left);
-    inputs[input_count++] = input;
-    inputs[input_count++] = input;
-  } else if (g.CanBeImmediate(right)) {
-    inputs[input_count++] = g.UseRegister(left);
-    inputs[input_count++] = g.UseImmediate(right);
-  } else {
-    int effect_level = selector->GetEffectLevel(node);
-    if (cont->IsBranch()) {
-      effect_level = selector->GetEffectLevel(
-          cont->true_block()->PredecessorAt(0)->control_input());
-    }
-    if (node->op()->HasProperty(Operator::kCommutative) &&
-        g.CanBeBetterLeftOperand(right) &&
-        (!g.CanBeBetterLeftOperand(left) ||
-         !g.CanBeMemoryOperand(opcode, node, right, effect_level))) {
-      std::swap(left, right);
-    }
-    if (g.CanBeMemoryOperand(opcode, node, right, effect_level)) {
-      inputs[input_count++] = g.UseRegister(left);
-      AddressingMode addressing_mode =
-          g.GetEffectiveAddressMemoryOperand(right, inputs, &input_count);
-      opcode |= AddressingModeField::encode(addressing_mode);
-    } else {
-      inputs[input_count++] = g.UseRegister(left);
-      inputs[input_count++] = g.Use(right);
-    }
-  }
-
-  if (cont->IsBranch()) {
-    inputs[input_count++] = g.Label(cont->true_block());
-    inputs[input_count++] = g.Label(cont->false_block());
-  }
-
-  outputs[output_count++] = g.DefineSameAsFirst(node);
-  if (cont->IsSet()) {
-    outputs[output_count++] = g.DefineAsRegister(cont->result());
-  }
-
-  DCHECK_NE(0u, input_count);
-  DCHECK_NE(0u, output_count);
-  DCHECK_GE(arraysize(inputs), input_count);
-  DCHECK_GE(arraysize(outputs), output_count);
-
-  opcode = cont->Encode(opcode);
-  if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(opcode, output_count, outputs, input_count, inputs,
-                             cont->kind(), cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else {
-    selector->Emit(opcode, output_count, outputs, input_count, inputs);
-  }
-}
-
-
-// Shared routine for multiple binary operations.
-static void VisitBinop(InstructionSelector* selector, Node* node,
-                       InstructionCode opcode) {
-  FlagsContinuation cont;
-  VisitBinop(selector, node, opcode, &cont);
-}
-
-
-void InstructionSelector::VisitWord32And(Node* node) {
-  X64OperandGenerator g(this);
-  Uint32BinopMatcher m(node);
-  if (m.right().Is(0xFF)) {
-    Emit(kX64Movzxbl, g.DefineAsRegister(node), g.Use(m.left().node()));
-  } else if (m.right().Is(0xFFFF)) {
-    Emit(kX64Movzxwl, g.DefineAsRegister(node), g.Use(m.left().node()));
-  } else {
-    VisitBinop(this, node, kX64And32);
-  }
-}
-
-
-void InstructionSelector::VisitWord64And(Node* node) {
-  VisitBinop(this, node, kX64And);
-}
-
-
-void InstructionSelector::VisitWord32Or(Node* node) {
-  VisitBinop(this, node, kX64Or32);
-}
-
-
-void InstructionSelector::VisitWord64Or(Node* node) {
-  VisitBinop(this, node, kX64Or);
-}
-
-
-void InstructionSelector::VisitWord32Xor(Node* node) {
-  X64OperandGenerator g(this);
-  Uint32BinopMatcher m(node);
-  if (m.right().Is(-1)) {
-    Emit(kX64Not32, g.DefineSameAsFirst(node), g.UseRegister(m.left().node()));
-  } else {
-    VisitBinop(this, node, kX64Xor32);
-  }
-}
-
-
-void InstructionSelector::VisitWord64Xor(Node* node) {
-  X64OperandGenerator g(this);
-  Uint64BinopMatcher m(node);
-  if (m.right().Is(-1)) {
-    Emit(kX64Not, g.DefineSameAsFirst(node), g.UseRegister(m.left().node()));
-  } else {
-    VisitBinop(this, node, kX64Xor);
-  }
-}
-
-
-namespace {
-
-// Shared routine for multiple 32-bit shift operations.
-// TODO(bmeurer): Merge this with VisitWord64Shift using template magic?
-void VisitWord32Shift(InstructionSelector* selector, Node* node,
-                      ArchOpcode opcode) {
-  X64OperandGenerator g(selector);
-  Int32BinopMatcher m(node);
-  Node* left = m.left().node();
-  Node* right = m.right().node();
-
-  if (g.CanBeImmediate(right)) {
-    selector->Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left),
-                   g.UseImmediate(right));
-  } else {
-    selector->Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left),
-                   g.UseFixed(right, rcx));
-  }
-}
-
-
-// Shared routine for multiple 64-bit shift operations.
-// TODO(bmeurer): Merge this with VisitWord32Shift using template magic?
-void VisitWord64Shift(InstructionSelector* selector, Node* node,
-                      ArchOpcode opcode) {
-  X64OperandGenerator g(selector);
-  Int64BinopMatcher m(node);
-  Node* left = m.left().node();
-  Node* right = m.right().node();
-
-  if (g.CanBeImmediate(right)) {
-    selector->Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left),
-                   g.UseImmediate(right));
-  } else {
-    if (m.right().IsWord64And()) {
-      Int64BinopMatcher mright(right);
-      if (mright.right().Is(0x3F)) {
-        right = mright.left().node();
-      }
-    }
-    selector->Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left),
-                   g.UseFixed(right, rcx));
-  }
-}
-
-void EmitLea(InstructionSelector* selector, InstructionCode opcode,
-             Node* result, Node* index, int scale, Node* base,
-             Node* displacement, DisplacementMode displacement_mode) {
-  X64OperandGenerator g(selector);
-
-  InstructionOperand inputs[4];
-  size_t input_count = 0;
-  AddressingMode mode =
-      g.GenerateMemoryOperandInputs(index, scale, base, displacement,
-                                    displacement_mode, inputs, &input_count);
-
-  DCHECK_NE(0u, input_count);
-  DCHECK_GE(arraysize(inputs), input_count);
-
-  InstructionOperand outputs[1];
-  outputs[0] = g.DefineAsRegister(result);
-
-  opcode = AddressingModeField::encode(mode) | opcode;
-
-  selector->Emit(opcode, 1, outputs, input_count, inputs);
-}
-
-}  // namespace
-
-
-void InstructionSelector::VisitWord32Shl(Node* node) {
-  Int32ScaleMatcher m(node, true);
-  if (m.matches()) {
-    Node* index = node->InputAt(0);
-    Node* base = m.power_of_two_plus_one() ? index : nullptr;
-    EmitLea(this, kX64Lea32, node, index, m.scale(), base, nullptr,
-            kPositiveDisplacement);
-    return;
-  }
-  VisitWord32Shift(this, node, kX64Shl32);
-}
-
-
-void InstructionSelector::VisitWord64Shl(Node* node) {
-  X64OperandGenerator g(this);
-  Int64ScaleMatcher m(node, true);
-  if (m.matches()) {
-    Node* index = node->InputAt(0);
-    Node* base = m.power_of_two_plus_one() ? index : nullptr;
-    EmitLea(this, kX64Lea, node, index, m.scale(), base, nullptr,
-            kPositiveDisplacement);
-    return;
-  } else {
-    Int64BinopMatcher m(node);
-    if ((m.left().IsChangeInt32ToInt64() ||
-         m.left().IsChangeUint32ToUint64()) &&
-        m.right().IsInRange(32, 63)) {
-      // There's no need to sign/zero-extend to 64-bit if we shift out the upper
-      // 32 bits anyway.
-      Emit(kX64Shl, g.DefineSameAsFirst(node),
-           g.UseRegister(m.left().node()->InputAt(0)),
-           g.UseImmediate(m.right().node()));
-      return;
-    }
-  }
-  VisitWord64Shift(this, node, kX64Shl);
-}
-
-
-void InstructionSelector::VisitWord32Shr(Node* node) {
-  VisitWord32Shift(this, node, kX64Shr32);
-}
-
-namespace {
-bool TryMatchLoadWord64AndShiftRight(InstructionSelector* selector, Node* node,
-                                     InstructionCode opcode) {
-  DCHECK(IrOpcode::kWord64Sar == node->opcode() ||
-         IrOpcode::kWord64Shr == node->opcode());
-  X64OperandGenerator g(selector);
-  Int64BinopMatcher m(node);
-  if (selector->CanCover(m.node(), m.left().node()) && m.left().IsLoad() &&
-      m.right().Is(32)) {
-    // Just load and sign-extend the interesting 4 bytes instead. This happens,
-    // for example, when we're loading and untagging SMIs.
-    BaseWithIndexAndDisplacement64Matcher mleft(m.left().node(),
-                                                AddressOption::kAllowAll);
-    if (mleft.matches() && (mleft.displacement() == nullptr ||
-                            g.CanBeImmediate(mleft.displacement()))) {
-      size_t input_count = 0;
-      InstructionOperand inputs[3];
-      AddressingMode mode = g.GetEffectiveAddressMemoryOperand(
-          m.left().node(), inputs, &input_count);
-      if (mleft.displacement() == nullptr) {
-        // Make sure that the addressing mode indicates the presence of an
-        // immediate displacement. It seems that we never use M1 and M2, but we
-        // handle them here anyways.
-        switch (mode) {
-          case kMode_MR:
-            mode = kMode_MRI;
-            break;
-          case kMode_MR1:
-            mode = kMode_MR1I;
-            break;
-          case kMode_MR2:
-            mode = kMode_MR2I;
-            break;
-          case kMode_MR4:
-            mode = kMode_MR4I;
-            break;
-          case kMode_MR8:
-            mode = kMode_MR8I;
-            break;
-          case kMode_M1:
-            mode = kMode_M1I;
-            break;
-          case kMode_M2:
-            mode = kMode_M2I;
-            break;
-          case kMode_M4:
-            mode = kMode_M4I;
-            break;
-          case kMode_M8:
-            mode = kMode_M8I;
-            break;
-          case kMode_None:
-          case kMode_MRI:
-          case kMode_MR1I:
-          case kMode_MR2I:
-          case kMode_MR4I:
-          case kMode_MR8I:
-          case kMode_M1I:
-          case kMode_M2I:
-          case kMode_M4I:
-          case kMode_M8I:
-          case kMode_Root:
-            UNREACHABLE();
-        }
-        inputs[input_count++] = ImmediateOperand(ImmediateOperand::INLINE, 4);
-      } else {
-        // In the case that the base address was zero, the displacement will be
-        // in a register and replacing it with an immediate is not allowed. This
-        // usually only happens in dead code anyway.
-        if (!inputs[input_count - 1].IsImmediate()) return false;
-        int32_t displacement = g.GetImmediateIntegerValue(mleft.displacement());
-        inputs[input_count - 1] =
-            ImmediateOperand(ImmediateOperand::INLINE, displacement + 4);
-      }
-      InstructionOperand outputs[] = {g.DefineAsRegister(node)};
-      InstructionCode code = opcode | AddressingModeField::encode(mode);
-      selector->Emit(code, 1, outputs, input_count, inputs);
-      return true;
-    }
-  }
-  return false;
-}
-}  // namespace
-
-void InstructionSelector::VisitWord64Shr(Node* node) {
-  if (TryMatchLoadWord64AndShiftRight(this, node, kX64Movl)) return;
-  VisitWord64Shift(this, node, kX64Shr);
-}
-
-void InstructionSelector::VisitWord32Sar(Node* node) {
-  X64OperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  if (CanCover(m.node(), m.left().node()) && m.left().IsWord32Shl()) {
-    Int32BinopMatcher mleft(m.left().node());
-    if (mleft.right().Is(16) && m.right().Is(16)) {
-      Emit(kX64Movsxwl, g.DefineAsRegister(node), g.Use(mleft.left().node()));
-      return;
-    } else if (mleft.right().Is(24) && m.right().Is(24)) {
-      Emit(kX64Movsxbl, g.DefineAsRegister(node), g.Use(mleft.left().node()));
-      return;
-    }
-  }
-  VisitWord32Shift(this, node, kX64Sar32);
-}
-
-void InstructionSelector::VisitWord64Sar(Node* node) {
-  if (TryMatchLoadWord64AndShiftRight(this, node, kX64Movsxlq)) return;
-  VisitWord64Shift(this, node, kX64Sar);
-}
-
-
-void InstructionSelector::VisitWord32Ror(Node* node) {
-  VisitWord32Shift(this, node, kX64Ror32);
-}
-
-
-void InstructionSelector::VisitWord64Ror(Node* node) {
-  VisitWord64Shift(this, node, kX64Ror);
-}
-
-void InstructionSelector::VisitWord32ReverseBits(Node* node) { UNREACHABLE(); }
-
-
-void InstructionSelector::VisitWord64ReverseBits(Node* node) { UNREACHABLE(); }
-
-void InstructionSelector::VisitWord64ReverseBytes(Node* node) { UNREACHABLE(); }
-
-void InstructionSelector::VisitWord32ReverseBytes(Node* node) { UNREACHABLE(); }
-
-void InstructionSelector::VisitInt32Add(Node* node) {
-  X64OperandGenerator g(this);
-
-  // Try to match the Add to a leal pattern
-  BaseWithIndexAndDisplacement32Matcher m(node);
-  if (m.matches() &&
-      (m.displacement() == nullptr || g.CanBeImmediate(m.displacement()))) {
-    EmitLea(this, kX64Lea32, node, m.index(), m.scale(), m.base(),
-            m.displacement(), m.displacement_mode());
-    return;
-  }
-
-  // No leal pattern match, use addl
-  VisitBinop(this, node, kX64Add32);
-}
-
-
-void InstructionSelector::VisitInt64Add(Node* node) {
-  X64OperandGenerator g(this);
-
-  // Try to match the Add to a leaq pattern
-  BaseWithIndexAndDisplacement64Matcher m(node);
-  if (m.matches() &&
-      (m.displacement() == nullptr || g.CanBeImmediate(m.displacement()))) {
-    EmitLea(this, kX64Lea, node, m.index(), m.scale(), m.base(),
-            m.displacement(), m.displacement_mode());
-    return;
-  }
-
-  // No leal pattern match, use addq
-  VisitBinop(this, node, kX64Add);
-}
-
-
-void InstructionSelector::VisitInt64AddWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    return VisitBinop(this, node, kX64Add, &cont);
-  }
-  FlagsContinuation cont;
-  VisitBinop(this, node, kX64Add, &cont);
-}
-
-
-void InstructionSelector::VisitInt32Sub(Node* node) {
-  X64OperandGenerator g(this);
-  Int32BinopMatcher m(node);
-  if (m.left().Is(0)) {
-    Emit(kX64Neg32, g.DefineSameAsFirst(node), g.UseRegister(m.right().node()));
-  } else {
-    if (m.right().HasValue() && g.CanBeImmediate(m.right().node())) {
-      // Turn subtractions of constant values into immediate "leal" instructions
-      // by negating the value.
-      Emit(kX64Lea32 | AddressingModeField::encode(kMode_MRI),
-           g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-           g.TempImmediate(-m.right().Value()));
-      return;
-    }
-    VisitBinop(this, node, kX64Sub32);
-  }
-}
-
-
-void InstructionSelector::VisitInt64Sub(Node* node) {
-  X64OperandGenerator g(this);
-  Int64BinopMatcher m(node);
-  if (m.left().Is(0)) {
-    Emit(kX64Neg, g.DefineSameAsFirst(node), g.UseRegister(m.right().node()));
-  } else {
-    if (m.right().HasValue() && g.CanBeImmediate(m.right().node())) {
-      // Turn subtractions of constant values into immediate "leaq" instructions
-      // by negating the value.
-      Emit(kX64Lea | AddressingModeField::encode(kMode_MRI),
-           g.DefineAsRegister(node), g.UseRegister(m.left().node()),
-           g.TempImmediate(-static_cast<int32_t>(m.right().Value())));
-      return;
-    }
-    VisitBinop(this, node, kX64Sub);
-  }
-}
-
-
-void InstructionSelector::VisitInt64SubWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    return VisitBinop(this, node, kX64Sub, &cont);
-  }
-  FlagsContinuation cont;
-  VisitBinop(this, node, kX64Sub, &cont);
-}
-
-
-namespace {
-
-void VisitMul(InstructionSelector* selector, Node* node, ArchOpcode opcode) {
-  X64OperandGenerator g(selector);
-  Int32BinopMatcher m(node);
-  Node* left = m.left().node();
-  Node* right = m.right().node();
-  if (g.CanBeImmediate(right)) {
-    selector->Emit(opcode, g.DefineAsRegister(node), g.Use(left),
-                   g.UseImmediate(right));
-  } else {
-    if (g.CanBeBetterLeftOperand(right)) {
-      std::swap(left, right);
-    }
-    selector->Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left),
-                   g.Use(right));
-  }
-}
-
-void VisitMulHigh(InstructionSelector* selector, Node* node,
-                  ArchOpcode opcode) {
-  X64OperandGenerator g(selector);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-  if (selector->IsLive(left) && !selector->IsLive(right)) {
-    std::swap(left, right);
-  }
-  InstructionOperand temps[] = {g.TempRegister(rax)};
-  // TODO(turbofan): We use UseUniqueRegister here to improve register
-  // allocation.
-  selector->Emit(opcode, g.DefineAsFixed(node, rdx), g.UseFixed(left, rax),
-                 g.UseUniqueRegister(right), arraysize(temps), temps);
-}
-
-
-void VisitDiv(InstructionSelector* selector, Node* node, ArchOpcode opcode) {
-  X64OperandGenerator g(selector);
-  InstructionOperand temps[] = {g.TempRegister(rdx)};
-  selector->Emit(
-      opcode, g.DefineAsFixed(node, rax), g.UseFixed(node->InputAt(0), rax),
-      g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps);
-}
-
-
-void VisitMod(InstructionSelector* selector, Node* node, ArchOpcode opcode) {
-  X64OperandGenerator g(selector);
-  InstructionOperand temps[] = {g.TempRegister(rax)};
-  selector->Emit(
-      opcode, g.DefineAsFixed(node, rdx), g.UseFixed(node->InputAt(0), rax),
-      g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps);
-}
-
-}  // namespace
-
-
-void InstructionSelector::VisitInt32Mul(Node* node) {
-  Int32ScaleMatcher m(node, true);
-  if (m.matches()) {
-    Node* index = node->InputAt(0);
-    Node* base = m.power_of_two_plus_one() ? index : nullptr;
-    EmitLea(this, kX64Lea32, node, index, m.scale(), base, nullptr,
-            kPositiveDisplacement);
-    return;
-  }
-  VisitMul(this, node, kX64Imul32);
-}
-
-void InstructionSelector::VisitInt32MulWithOverflow(Node* node) {
-  // TODO(mvstanton): Use Int32ScaleMatcher somehow.
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    return VisitBinop(this, node, kX64Imul32, &cont);
-  }
-  FlagsContinuation cont;
-  VisitBinop(this, node, kX64Imul32, &cont);
-}
-
-void InstructionSelector::VisitInt64Mul(Node* node) {
-  VisitMul(this, node, kX64Imul);
-}
-
-void InstructionSelector::VisitInt32MulHigh(Node* node) {
-  VisitMulHigh(this, node, kX64ImulHigh32);
-}
-
-
-void InstructionSelector::VisitInt32Div(Node* node) {
-  VisitDiv(this, node, kX64Idiv32);
-}
-
-
-void InstructionSelector::VisitInt64Div(Node* node) {
-  VisitDiv(this, node, kX64Idiv);
-}
-
-
-void InstructionSelector::VisitUint32Div(Node* node) {
-  VisitDiv(this, node, kX64Udiv32);
-}
-
-
-void InstructionSelector::VisitUint64Div(Node* node) {
-  VisitDiv(this, node, kX64Udiv);
-}
-
-
-void InstructionSelector::VisitInt32Mod(Node* node) {
-  VisitMod(this, node, kX64Idiv32);
-}
-
-
-void InstructionSelector::VisitInt64Mod(Node* node) {
-  VisitMod(this, node, kX64Idiv);
-}
-
-
-void InstructionSelector::VisitUint32Mod(Node* node) {
-  VisitMod(this, node, kX64Udiv32);
-}
-
-
-void InstructionSelector::VisitUint64Mod(Node* node) {
-  VisitMod(this, node, kX64Udiv);
-}
-
-
-void InstructionSelector::VisitUint32MulHigh(Node* node) {
-  VisitMulHigh(this, node, kX64UmulHigh32);
-}
-
-void InstructionSelector::VisitTryTruncateFloat32ToInt64(Node* node) {
-  X64OperandGenerator g(this);
-  InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))};
-  InstructionOperand outputs[2];
-  size_t output_count = 0;
-  outputs[output_count++] = g.DefineAsRegister(node);
-
-  Node* success_output = NodeProperties::FindProjection(node, 1);
-  if (success_output) {
-    outputs[output_count++] = g.DefineAsRegister(success_output);
-  }
-
-  Emit(kSSEFloat32ToInt64, output_count, outputs, 1, inputs);
-}
-
-
-void InstructionSelector::VisitTryTruncateFloat64ToInt64(Node* node) {
-  X64OperandGenerator g(this);
-  InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))};
-  InstructionOperand outputs[2];
-  size_t output_count = 0;
-  outputs[output_count++] = g.DefineAsRegister(node);
-
-  Node* success_output = NodeProperties::FindProjection(node, 1);
-  if (success_output) {
-    outputs[output_count++] = g.DefineAsRegister(success_output);
-  }
-
-  Emit(kSSEFloat64ToInt64, output_count, outputs, 1, inputs);
-}
-
-
-void InstructionSelector::VisitTryTruncateFloat32ToUint64(Node* node) {
-  X64OperandGenerator g(this);
-  InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))};
-  InstructionOperand outputs[2];
-  size_t output_count = 0;
-  outputs[output_count++] = g.DefineAsRegister(node);
-
-  Node* success_output = NodeProperties::FindProjection(node, 1);
-  if (success_output) {
-    outputs[output_count++] = g.DefineAsRegister(success_output);
-  }
-
-  Emit(kSSEFloat32ToUint64, output_count, outputs, 1, inputs);
-}
-
-
-void InstructionSelector::VisitTryTruncateFloat64ToUint64(Node* node) {
-  X64OperandGenerator g(this);
-  InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))};
-  InstructionOperand outputs[2];
-  size_t output_count = 0;
-  outputs[output_count++] = g.DefineAsRegister(node);
-
-  Node* success_output = NodeProperties::FindProjection(node, 1);
-  if (success_output) {
-    outputs[output_count++] = g.DefineAsRegister(success_output);
-  }
-
-  Emit(kSSEFloat64ToUint64, output_count, outputs, 1, inputs);
-}
-
-
-void InstructionSelector::VisitChangeInt32ToInt64(Node* node) {
-  X64OperandGenerator g(this);
-  Node* const value = node->InputAt(0);
-  if (value->opcode() == IrOpcode::kLoad && CanCover(node, value)) {
-    LoadRepresentation load_rep = LoadRepresentationOf(value->op());
-    MachineRepresentation rep = load_rep.representation();
-    InstructionCode opcode = kArchNop;
-    switch (rep) {
-      case MachineRepresentation::kBit:  // Fall through.
-      case MachineRepresentation::kWord8:
-        opcode = load_rep.IsSigned() ? kX64Movsxbq : kX64Movzxbq;
-        break;
-      case MachineRepresentation::kWord16:
-        opcode = load_rep.IsSigned() ? kX64Movsxwq : kX64Movzxwq;
-        break;
-      case MachineRepresentation::kWord32:
-        opcode = load_rep.IsSigned() ? kX64Movsxlq : kX64Movl;
-        break;
-      default:
-        UNREACHABLE();
-        return;
-    }
-    InstructionOperand outputs[] = {g.DefineAsRegister(node)};
-    size_t input_count = 0;
-    InstructionOperand inputs[3];
-    AddressingMode mode = g.GetEffectiveAddressMemoryOperand(
-        node->InputAt(0), inputs, &input_count);
-    opcode |= AddressingModeField::encode(mode);
-    Emit(opcode, 1, outputs, input_count, inputs);
-  } else {
-    Emit(kX64Movsxlq, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
-  }
-}
-
-namespace {
-
-bool ZeroExtendsWord32ToWord64(Node* node) {
-  switch (node->opcode()) {
-    case IrOpcode::kWord32And:
-    case IrOpcode::kWord32Or:
-    case IrOpcode::kWord32Xor:
-    case IrOpcode::kWord32Shl:
-    case IrOpcode::kWord32Shr:
-    case IrOpcode::kWord32Sar:
-    case IrOpcode::kWord32Ror:
-    case IrOpcode::kWord32Equal:
-    case IrOpcode::kInt32Add:
-    case IrOpcode::kInt32Sub:
-    case IrOpcode::kInt32Mul:
-    case IrOpcode::kInt32MulHigh:
-    case IrOpcode::kInt32Div:
-    case IrOpcode::kInt32LessThan:
-    case IrOpcode::kInt32LessThanOrEqual:
-    case IrOpcode::kInt32Mod:
-    case IrOpcode::kUint32Div:
-    case IrOpcode::kUint32LessThan:
-    case IrOpcode::kUint32LessThanOrEqual:
-    case IrOpcode::kUint32Mod:
-    case IrOpcode::kUint32MulHigh:
-      // These 32-bit operations implicitly zero-extend to 64-bit on x64, so the
-      // zero-extension is a no-op.
-      return true;
-    case IrOpcode::kProjection: {
-      Node* const value = node->InputAt(0);
-      switch (value->opcode()) {
-        case IrOpcode::kInt32AddWithOverflow:
-        case IrOpcode::kInt32SubWithOverflow:
-        case IrOpcode::kInt32MulWithOverflow:
-          return true;
-        default:
-          return false;
-      }
-    }
-    case IrOpcode::kLoad: {
-      // The movzxbl/movsxbl/movzxwl/movsxwl/movl operations implicitly
-      // zero-extend to 64-bit on x64, so the zero-extension is a no-op.
-      LoadRepresentation load_rep = LoadRepresentationOf(node->op());
-      switch (load_rep.representation()) {
-        case MachineRepresentation::kWord8:
-        case MachineRepresentation::kWord16:
-        case MachineRepresentation::kWord32:
-          return true;
-        default:
-          return false;
-      }
-    }
-    default:
-      return false;
-  }
-}
-
-}  // namespace
-
-void InstructionSelector::VisitChangeUint32ToUint64(Node* node) {
-  X64OperandGenerator g(this);
-  Node* value = node->InputAt(0);
-  if (ZeroExtendsWord32ToWord64(value)) {
-    // These 32-bit operations implicitly zero-extend to 64-bit on x64, so the
-    // zero-extension is a no-op.
-    return EmitIdentity(node);
-  }
-  Emit(kX64Movl, g.DefineAsRegister(node), g.Use(value));
-}
-
-
-namespace {
-
-void VisitRO(InstructionSelector* selector, Node* node,
-             InstructionCode opcode) {
-  X64OperandGenerator g(selector);
-  selector->Emit(opcode, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
-}
-
-
-void VisitRR(InstructionSelector* selector, Node* node,
-             InstructionCode opcode) {
-  X64OperandGenerator g(selector);
-  selector->Emit(opcode, g.DefineAsRegister(node),
-                 g.UseRegister(node->InputAt(0)));
-}
-
-void VisitRRO(InstructionSelector* selector, Node* node,
-              InstructionCode opcode) {
-  X64OperandGenerator g(selector);
-  selector->Emit(opcode, g.DefineSameAsFirst(node),
-                 g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1)));
-}
-
-void VisitFloatBinop(InstructionSelector* selector, Node* node,
-                     ArchOpcode avx_opcode, ArchOpcode sse_opcode) {
-  X64OperandGenerator g(selector);
-  InstructionOperand operand0 = g.UseRegister(node->InputAt(0));
-  InstructionOperand operand1 = g.Use(node->InputAt(1));
-  if (selector->IsSupported(AVX)) {
-    selector->Emit(avx_opcode, g.DefineAsRegister(node), operand0, operand1);
-  } else {
-    selector->Emit(sse_opcode, g.DefineSameAsFirst(node), operand0, operand1);
-  }
-}
-
-
-void VisitFloatUnop(InstructionSelector* selector, Node* node, Node* input,
-                    ArchOpcode avx_opcode, ArchOpcode sse_opcode) {
-  X64OperandGenerator g(selector);
-  if (selector->IsSupported(AVX)) {
-    selector->Emit(avx_opcode, g.DefineAsRegister(node), g.Use(input));
-  } else {
-    selector->Emit(sse_opcode, g.DefineSameAsFirst(node), g.UseRegister(input));
-  }
-}
-
-}  // namespace
-
-#define RO_OP_LIST(V)                                                    \
-  V(Word64Clz, kX64Lzcnt)                                                \
-  V(Word32Clz, kX64Lzcnt32)                                              \
-  V(Word64Ctz, kX64Tzcnt)                                                \
-  V(Word32Ctz, kX64Tzcnt32)                                              \
-  V(Word64Popcnt, kX64Popcnt)                                            \
-  V(Word32Popcnt, kX64Popcnt32)                                          \
-  V(Float64Sqrt, kSSEFloat64Sqrt)                                        \
-  V(Float32Sqrt, kSSEFloat32Sqrt)                                        \
-  V(ChangeFloat64ToInt32, kSSEFloat64ToInt32)                            \
-  V(ChangeFloat64ToUint32, kSSEFloat64ToUint32 | MiscField::encode(1))   \
-  V(TruncateFloat64ToUint32, kSSEFloat64ToUint32 | MiscField::encode(0)) \
-  V(ChangeFloat64ToUint64, kSSEFloat64ToUint64)                          \
-  V(TruncateFloat64ToFloat32, kSSEFloat64ToFloat32)                      \
-  V(ChangeFloat32ToFloat64, kSSEFloat32ToFloat64)                        \
-  V(TruncateFloat32ToInt32, kSSEFloat32ToInt32)                          \
-  V(TruncateFloat32ToUint32, kSSEFloat32ToUint32)                        \
-  V(ChangeInt32ToFloat64, kSSEInt32ToFloat64)                            \
-  V(ChangeUint32ToFloat64, kSSEUint32ToFloat64)                          \
-  V(RoundFloat64ToInt32, kSSEFloat64ToInt32)                             \
-  V(RoundInt32ToFloat32, kSSEInt32ToFloat32)                             \
-  V(RoundInt64ToFloat32, kSSEInt64ToFloat32)                             \
-  V(RoundInt64ToFloat64, kSSEInt64ToFloat64)                             \
-  V(RoundUint32ToFloat32, kSSEUint32ToFloat32)                           \
-  V(BitcastFloat32ToInt32, kX64BitcastFI)                                \
-  V(BitcastFloat64ToInt64, kX64BitcastDL)                                \
-  V(BitcastInt32ToFloat32, kX64BitcastIF)                                \
-  V(BitcastInt64ToFloat64, kX64BitcastLD)                                \
-  V(Float64ExtractLowWord32, kSSEFloat64ExtractLowWord32)                \
-  V(Float64ExtractHighWord32, kSSEFloat64ExtractHighWord32)
-
-#define RR_OP_LIST(V)                                                         \
-  V(Float32RoundDown, kSSEFloat32Round | MiscField::encode(kRoundDown))       \
-  V(Float64RoundDown, kSSEFloat64Round | MiscField::encode(kRoundDown))       \
-  V(Float32RoundUp, kSSEFloat32Round | MiscField::encode(kRoundUp))           \
-  V(Float64RoundUp, kSSEFloat64Round | MiscField::encode(kRoundUp))           \
-  V(Float32RoundTruncate, kSSEFloat32Round | MiscField::encode(kRoundToZero)) \
-  V(Float64RoundTruncate, kSSEFloat64Round | MiscField::encode(kRoundToZero)) \
-  V(Float32RoundTiesEven,                                                     \
-    kSSEFloat32Round | MiscField::encode(kRoundToNearest))                    \
-  V(Float64RoundTiesEven, kSSEFloat64Round | MiscField::encode(kRoundToNearest))
-
-#define RO_VISITOR(Name, opcode)                      \
-  void InstructionSelector::Visit##Name(Node* node) { \
-    VisitRO(this, node, opcode);                      \
-  }
-RO_OP_LIST(RO_VISITOR)
-#undef RO_VISITOR
-#undef RO_OP_LIST
-
-#define RR_VISITOR(Name, opcode)                      \
-  void InstructionSelector::Visit##Name(Node* node) { \
-    VisitRR(this, node, opcode);                      \
-  }
-RR_OP_LIST(RR_VISITOR)
-#undef RR_VISITOR
-#undef RR_OP_LIST
-
-void InstructionSelector::VisitTruncateFloat64ToWord32(Node* node) {
-  VisitRR(this, node, kArchTruncateDoubleToI);
-}
-
-void InstructionSelector::VisitTruncateInt64ToInt32(Node* node) {
-  X64OperandGenerator g(this);
-  Node* value = node->InputAt(0);
-  if (CanCover(node, value)) {
-    switch (value->opcode()) {
-      case IrOpcode::kWord64Sar:
-      case IrOpcode::kWord64Shr: {
-        Int64BinopMatcher m(value);
-        if (m.right().Is(32)) {
-          if (TryMatchLoadWord64AndShiftRight(this, value, kX64Movl)) {
-            return EmitIdentity(node);
-          }
-          Emit(kX64Shr, g.DefineSameAsFirst(node),
-               g.UseRegister(m.left().node()), g.TempImmediate(32));
-          return;
-        }
-        break;
-      }
-      default:
-        break;
-    }
-  }
-  Emit(kX64Movl, g.DefineAsRegister(node), g.Use(value));
-}
-
-void InstructionSelector::VisitRoundUint64ToFloat32(Node* node) {
-  X64OperandGenerator g(this);
-  InstructionOperand temps[] = {g.TempRegister()};
-  Emit(kSSEUint64ToFloat32, g.DefineAsRegister(node), g.Use(node->InputAt(0)),
-       arraysize(temps), temps);
-}
-
-
-void InstructionSelector::VisitRoundUint64ToFloat64(Node* node) {
-  X64OperandGenerator g(this);
-  InstructionOperand temps[] = {g.TempRegister()};
-  Emit(kSSEUint64ToFloat64, g.DefineAsRegister(node), g.Use(node->InputAt(0)),
-       arraysize(temps), temps);
-}
-
-void InstructionSelector::VisitFloat32Add(Node* node) {
-  VisitFloatBinop(this, node, kAVXFloat32Add, kSSEFloat32Add);
-}
-
-
-void InstructionSelector::VisitFloat32Sub(Node* node) {
-  VisitFloatBinop(this, node, kAVXFloat32Sub, kSSEFloat32Sub);
-}
-
-void InstructionSelector::VisitFloat32Mul(Node* node) {
-  VisitFloatBinop(this, node, kAVXFloat32Mul, kSSEFloat32Mul);
-}
-
-
-void InstructionSelector::VisitFloat32Div(Node* node) {
-  VisitFloatBinop(this, node, kAVXFloat32Div, kSSEFloat32Div);
-}
-
-
-void InstructionSelector::VisitFloat32Abs(Node* node) {
-  VisitFloatUnop(this, node, node->InputAt(0), kAVXFloat32Abs, kSSEFloat32Abs);
-}
-
-
-void InstructionSelector::VisitFloat32Max(Node* node) {
-  VisitRRO(this, node, kSSEFloat32Max);
-}
-
-void InstructionSelector::VisitFloat32Min(Node* node) {
-  VisitRRO(this, node, kSSEFloat32Min);
-}
-
-void InstructionSelector::VisitFloat64Add(Node* node) {
-  VisitFloatBinop(this, node, kAVXFloat64Add, kSSEFloat64Add);
-}
-
-
-void InstructionSelector::VisitFloat64Sub(Node* node) {
-  VisitFloatBinop(this, node, kAVXFloat64Sub, kSSEFloat64Sub);
-}
-
-void InstructionSelector::VisitFloat64Mul(Node* node) {
-  VisitFloatBinop(this, node, kAVXFloat64Mul, kSSEFloat64Mul);
-}
-
-
-void InstructionSelector::VisitFloat64Div(Node* node) {
-  VisitFloatBinop(this, node, kAVXFloat64Div, kSSEFloat64Div);
-}
-
-
-void InstructionSelector::VisitFloat64Mod(Node* node) {
-  X64OperandGenerator g(this);
-  InstructionOperand temps[] = {g.TempRegister(rax)};
-  Emit(kSSEFloat64Mod, g.DefineSameAsFirst(node),
-       g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)), 1,
-       temps);
-}
-
-
-void InstructionSelector::VisitFloat64Max(Node* node) {
-  VisitRRO(this, node, kSSEFloat64Max);
-}
-
-
-void InstructionSelector::VisitFloat64Min(Node* node) {
-  VisitRRO(this, node, kSSEFloat64Min);
-}
-
-
-void InstructionSelector::VisitFloat64Abs(Node* node) {
-  VisitFloatUnop(this, node, node->InputAt(0), kAVXFloat64Abs, kSSEFloat64Abs);
-}
-
-
-void InstructionSelector::VisitFloat64RoundTiesAway(Node* node) {
-  UNREACHABLE();
-}
-
-
-void InstructionSelector::VisitFloat32Neg(Node* node) {
-  VisitFloatUnop(this, node, node->InputAt(0), kAVXFloat32Neg, kSSEFloat32Neg);
-}
-
-void InstructionSelector::VisitFloat64Neg(Node* node) {
-  VisitFloatUnop(this, node, node->InputAt(0), kAVXFloat64Neg, kSSEFloat64Neg);
-}
-
-void InstructionSelector::VisitFloat64Ieee754Binop(Node* node,
-                                                   InstructionCode opcode) {
-  X64OperandGenerator g(this);
-  Emit(opcode, g.DefineAsFixed(node, xmm0), g.UseFixed(node->InputAt(0), xmm0),
-       g.UseFixed(node->InputAt(1), xmm1))
-      ->MarkAsCall();
-}
-
-void InstructionSelector::VisitFloat64Ieee754Unop(Node* node,
-                                                  InstructionCode opcode) {
-  X64OperandGenerator g(this);
-  Emit(opcode, g.DefineAsFixed(node, xmm0), g.UseFixed(node->InputAt(0), xmm0))
-      ->MarkAsCall();
-}
-
-void InstructionSelector::EmitPrepareArguments(
-    ZoneVector<PushParameter>* arguments, const CallDescriptor* descriptor,
-    Node* node) {
-  X64OperandGenerator g(this);
-
-  // Prepare for C function call.
-  if (descriptor->IsCFunctionCall()) {
-    Emit(kArchPrepareCallCFunction |
-             MiscField::encode(static_cast<int>(descriptor->ParameterCount())),
-         0, nullptr, 0, nullptr);
-
-    // Poke any stack arguments.
-    for (size_t n = 0; n < arguments->size(); ++n) {
-      PushParameter input = (*arguments)[n];
-      if (input.node) {
-        int slot = static_cast<int>(n);
-        InstructionOperand value = g.CanBeImmediate(input.node)
-                                       ? g.UseImmediate(input.node)
-                                       : g.UseRegister(input.node);
-        Emit(kX64Poke | MiscField::encode(slot), g.NoOutput(), value);
-      }
-    }
-  } else {
-    // Push any stack arguments.
-    int effect_level = GetEffectLevel(node);
-    for (PushParameter input : base::Reversed(*arguments)) {
-      // Skip any alignment holes in pushed nodes. We may have one in case of a
-      // Simd128 stack argument.
-      if (input.node == nullptr) continue;
-      if (g.CanBeImmediate(input.node)) {
-        Emit(kX64Push, g.NoOutput(), g.UseImmediate(input.node));
-      } else if (IsSupported(ATOM) ||
-                 sequence()->IsFP(GetVirtualRegister(input.node))) {
-        // TODO(titzer): X64Push cannot handle stack->stack double moves
-        // because there is no way to encode fixed double slots.
-        Emit(kX64Push, g.NoOutput(), g.UseRegister(input.node));
-      } else if (g.CanBeMemoryOperand(kX64Push, node, input.node,
-                                      effect_level)) {
-        InstructionOperand outputs[1];
-        InstructionOperand inputs[4];
-        size_t input_count = 0;
-        InstructionCode opcode = kX64Push;
-        AddressingMode mode = g.GetEffectiveAddressMemoryOperand(
-            input.node, inputs, &input_count);
-        opcode |= AddressingModeField::encode(mode);
-        Emit(opcode, 0, outputs, input_count, inputs);
-      } else {
-        Emit(kX64Push, g.NoOutput(), g.Use(input.node));
-      }
-    }
-  }
-}
-
-void InstructionSelector::EmitPrepareResults(ZoneVector<PushParameter>* results,
-                                             const CallDescriptor* descriptor,
-                                             Node* node) {
-  X64OperandGenerator g(this);
-
-  int reverse_slot = 0;
-  for (PushParameter output : *results) {
-    if (!output.location.IsCallerFrameSlot()) continue;
-    reverse_slot += output.location.GetSizeInPointers();
-    // Skip any alignment holes in nodes.
-    if (output.node == nullptr) continue;
-    DCHECK(!descriptor->IsCFunctionCall());
-    if (output.location.GetType() == MachineType::Float32()) {
-      MarkAsFloat32(output.node);
-    } else if (output.location.GetType() == MachineType::Float64()) {
-      MarkAsFloat64(output.node);
-    }
-    InstructionOperand result = g.DefineAsRegister(output.node);
-    InstructionOperand slot = g.UseImmediate(reverse_slot);
-    Emit(kX64Peek, 1, &result, 1, &slot);
-  }
-}
-
-bool InstructionSelector::IsTailCallAddressImmediate() { return true; }
-
-int InstructionSelector::GetTempsCountForTailCallFromJSFunction() { return 3; }
-
-namespace {
-
-void VisitCompareWithMemoryOperand(InstructionSelector* selector,
-                                   InstructionCode opcode, Node* left,
-                                   InstructionOperand right,
-                                   FlagsContinuation* cont) {
-  DCHECK_EQ(IrOpcode::kLoad, left->opcode());
-  X64OperandGenerator g(selector);
-  size_t input_count = 0;
-  InstructionOperand inputs[6];
-  AddressingMode addressing_mode =
-      g.GetEffectiveAddressMemoryOperand(left, inputs, &input_count);
-  opcode |= AddressingModeField::encode(addressing_mode);
-  opcode = cont->Encode(opcode);
-  inputs[input_count++] = right;
-
-  if (cont->IsBranch()) {
-    inputs[input_count++] = g.Label(cont->true_block());
-    inputs[input_count++] = g.Label(cont->false_block());
-    selector->Emit(opcode, 0, nullptr, input_count, inputs);
-  } else if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(opcode, 0, nullptr, input_count, inputs,
-                             cont->kind(), cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else if (cont->IsSet()) {
-    InstructionOperand output = g.DefineAsRegister(cont->result());
-    selector->Emit(opcode, 1, &output, input_count, inputs);
-  } else {
-    DCHECK(cont->IsTrap());
-    inputs[input_count++] = g.UseImmediate(cont->trap_id());
-    selector->Emit(opcode, 0, nullptr, input_count, inputs);
-  }
-}
-
-// Shared routine for multiple compare operations.
-void VisitCompare(InstructionSelector* selector, InstructionCode opcode,
-                  InstructionOperand left, InstructionOperand right,
-                  FlagsContinuation* cont) {
-  X64OperandGenerator g(selector);
-  opcode = cont->Encode(opcode);
-  if (cont->IsBranch()) {
-    selector->Emit(opcode, g.NoOutput(), left, right,
-                   g.Label(cont->true_block()), g.Label(cont->false_block()));
-  } else if (cont->IsDeoptimize()) {
-    selector->EmitDeoptimize(opcode, g.NoOutput(), left, right, cont->kind(),
-                             cont->reason(), cont->feedback(),
-                             cont->frame_state());
-  } else if (cont->IsSet()) {
-    selector->Emit(opcode, g.DefineAsRegister(cont->result()), left, right);
-  } else {
-    DCHECK(cont->IsTrap());
-    selector->Emit(opcode, g.NoOutput(), left, right,
-                   g.UseImmediate(cont->trap_id()));
-  }
-}
-
-
-// Shared routine for multiple compare operations.
-void VisitCompare(InstructionSelector* selector, InstructionCode opcode,
-                  Node* left, Node* right, FlagsContinuation* cont,
-                  bool commutative) {
-  X64OperandGenerator g(selector);
-  if (commutative && g.CanBeBetterLeftOperand(right)) {
-    std::swap(left, right);
-  }
-  VisitCompare(selector, opcode, g.UseRegister(left), g.Use(right), cont);
-}
-
-MachineType MachineTypeForNarrow(Node* node, Node* hint_node) {
-  if (hint_node->opcode() == IrOpcode::kLoad) {
-    MachineType hint = LoadRepresentationOf(hint_node->op());
-    if (node->opcode() == IrOpcode::kInt32Constant ||
-        node->opcode() == IrOpcode::kInt64Constant) {
-      int64_t constant = node->opcode() == IrOpcode::kInt32Constant
-                             ? OpParameter<int32_t>(node)
-                             : OpParameter<int64_t>(node);
-      if (hint == MachineType::Int8()) {
-        if (constant >= std::numeric_limits<int8_t>::min() &&
-            constant <= std::numeric_limits<int8_t>::max()) {
-          return hint;
-        }
-      } else if (hint == MachineType::Uint8()) {
-        if (constant >= std::numeric_limits<uint8_t>::min() &&
-            constant <= std::numeric_limits<uint8_t>::max()) {
-          return hint;
-        }
-      } else if (hint == MachineType::Int16()) {
-        if (constant >= std::numeric_limits<int16_t>::min() &&
-            constant <= std::numeric_limits<int16_t>::max()) {
-          return hint;
-        }
-      } else if (hint == MachineType::Uint16()) {
-        if (constant >= std::numeric_limits<uint16_t>::min() &&
-            constant <= std::numeric_limits<uint16_t>::max()) {
-          return hint;
-        }
-      } else if (hint == MachineType::Int32()) {
-        return hint;
-      } else if (hint == MachineType::Uint32()) {
-        if (constant >= 0) return hint;
-      }
-    }
-  }
-  return node->opcode() == IrOpcode::kLoad ? LoadRepresentationOf(node->op())
-                                           : MachineType::None();
-}
-
-// Tries to match the size of the given opcode to that of the operands, if
-// possible.
-InstructionCode TryNarrowOpcodeSize(InstructionCode opcode, Node* left,
-                                    Node* right, FlagsContinuation* cont) {
-  // TODO(epertoso): we can probably get some size information out phi nodes.
-  // If the load representations don't match, both operands will be
-  // zero/sign-extended to 32bit.
-  MachineType left_type = MachineTypeForNarrow(left, right);
-  MachineType right_type = MachineTypeForNarrow(right, left);
-  if (left_type == right_type) {
-    switch (left_type.representation()) {
-      case MachineRepresentation::kBit:
-      case MachineRepresentation::kWord8: {
-        if (opcode == kX64Test32) return kX64Test8;
-        if (opcode == kX64Cmp32) {
-          if (left_type.semantic() == MachineSemantic::kUint32) {
-            cont->OverwriteUnsignedIfSigned();
-          } else {
-            CHECK_EQ(MachineSemantic::kInt32, left_type.semantic());
-          }
-          return kX64Cmp8;
-        }
-        break;
-      }
-      case MachineRepresentation::kWord16:
-        if (opcode == kX64Test32) return kX64Test16;
-        if (opcode == kX64Cmp32) {
-          if (left_type.semantic() == MachineSemantic::kUint32) {
-            cont->OverwriteUnsignedIfSigned();
-          } else {
-            CHECK_EQ(MachineSemantic::kInt32, left_type.semantic());
-          }
-          return kX64Cmp16;
-        }
-        break;
-      default:
-        break;
-    }
-  }
-  return opcode;
-}
-
-// Shared routine for multiple word compare operations.
-void VisitWordCompare(InstructionSelector* selector, Node* node,
-                      InstructionCode opcode, FlagsContinuation* cont) {
-  X64OperandGenerator g(selector);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-
-  opcode = TryNarrowOpcodeSize(opcode, left, right, cont);
-
-  // If one of the two inputs is an immediate, make sure it's on the right, or
-  // if one of the two inputs is a memory operand, make sure it's on the left.
-  int effect_level = selector->GetEffectLevel(node);
-  if (cont->IsBranch()) {
-    effect_level = selector->GetEffectLevel(
-        cont->true_block()->PredecessorAt(0)->control_input());
-  }
-
-  if ((!g.CanBeImmediate(right) && g.CanBeImmediate(left)) ||
-      (g.CanBeMemoryOperand(opcode, node, right, effect_level) &&
-       !g.CanBeMemoryOperand(opcode, node, left, effect_level))) {
-    if (!node->op()->HasProperty(Operator::kCommutative)) cont->Commute();
-    std::swap(left, right);
-  }
-
-  // Match immediates on right side of comparison.
-  if (g.CanBeImmediate(right)) {
-    if (g.CanBeMemoryOperand(opcode, node, left, effect_level)) {
-      return VisitCompareWithMemoryOperand(selector, opcode, left,
-                                           g.UseImmediate(right), cont);
-    }
-    return VisitCompare(selector, opcode, g.Use(left), g.UseImmediate(right),
-                        cont);
-  }
-
-  // Match memory operands on left side of comparison.
-  if (g.CanBeMemoryOperand(opcode, node, left, effect_level)) {
-    return VisitCompareWithMemoryOperand(selector, opcode, left,
-                                         g.UseRegister(right), cont);
-  }
-
-  return VisitCompare(selector, opcode, left, right, cont,
-                      node->op()->HasProperty(Operator::kCommutative));
-}
-
-// Shared routine for 64-bit word comparison operations.
-void VisitWord64Compare(InstructionSelector* selector, Node* node,
-                        FlagsContinuation* cont) {
-  X64OperandGenerator g(selector);
-  if (selector->CanUseRootsRegister()) {
-    Heap* const heap = selector->isolate()->heap();
-    Heap::RootListIndex root_index;
-    HeapObjectBinopMatcher m(node);
-    if (m.right().HasValue() &&
-        heap->IsRootHandle(m.right().Value(), &root_index)) {
-      if (!node->op()->HasProperty(Operator::kCommutative)) cont->Commute();
-      InstructionCode opcode =
-          kX64Cmp | AddressingModeField::encode(kMode_Root);
-      return VisitCompare(
-          selector, opcode,
-          g.TempImmediate((root_index * kPointerSize) - kRootRegisterBias),
-          g.UseRegister(m.left().node()), cont);
-    } else if (m.left().HasValue() &&
-               heap->IsRootHandle(m.left().Value(), &root_index)) {
-      InstructionCode opcode =
-          kX64Cmp | AddressingModeField::encode(kMode_Root);
-      return VisitCompare(
-          selector, opcode,
-          g.TempImmediate((root_index * kPointerSize) - kRootRegisterBias),
-          g.UseRegister(m.right().node()), cont);
-    }
-  }
-  Int64BinopMatcher m(node);
-  if (m.left().IsLoad() && m.right().IsLoadStackPointer()) {
-    LoadMatcher<ExternalReferenceMatcher> mleft(m.left().node());
-    ExternalReference js_stack_limit =
-        ExternalReference::address_of_stack_limit(selector->isolate());
-    if (mleft.object().Is(js_stack_limit) && mleft.index().Is(0)) {
-      // Compare(Load(js_stack_limit), LoadStackPointer)
-      if (!node->op()->HasProperty(Operator::kCommutative)) cont->Commute();
-      InstructionCode opcode = cont->Encode(kX64StackCheck);
-      if (cont->IsBranch()) {
-        selector->Emit(opcode, g.NoOutput(), g.Label(cont->true_block()),
-                       g.Label(cont->false_block()));
-      } else if (cont->IsDeoptimize()) {
-        selector->EmitDeoptimize(opcode, 0, nullptr, 0, nullptr, cont->kind(),
-                                 cont->reason(), cont->feedback(),
-                                 cont->frame_state());
-      } else if (cont->IsSet()) {
-        selector->Emit(opcode, g.DefineAsRegister(cont->result()));
-      } else {
-        DCHECK(cont->IsTrap());
-        selector->Emit(opcode, g.NoOutput(), g.UseImmediate(cont->trap_id()));
-      }
-      return;
-    }
-  }
-  VisitWordCompare(selector, node, kX64Cmp, cont);
-}
-
-
-// Shared routine for comparison with zero.
-void VisitCompareZero(InstructionSelector* selector, Node* node,
-                      InstructionCode opcode, FlagsContinuation* cont) {
-  X64OperandGenerator g(selector);
-  VisitCompare(selector, opcode, g.Use(node), g.TempImmediate(0), cont);
-}
-
-
-// Shared routine for multiple float32 compare operations (inputs commuted).
-void VisitFloat32Compare(InstructionSelector* selector, Node* node,
-                         FlagsContinuation* cont) {
-  Node* const left = node->InputAt(0);
-  Node* const right = node->InputAt(1);
-  InstructionCode const opcode =
-      selector->IsSupported(AVX) ? kAVXFloat32Cmp : kSSEFloat32Cmp;
-  VisitCompare(selector, opcode, right, left, cont, false);
-}
-
-
-// Shared routine for multiple float64 compare operations (inputs commuted).
-void VisitFloat64Compare(InstructionSelector* selector, Node* node,
-                         FlagsContinuation* cont) {
-  Node* const left = node->InputAt(0);
-  Node* const right = node->InputAt(1);
-  InstructionCode const opcode =
-      selector->IsSupported(AVX) ? kAVXFloat64Cmp : kSSEFloat64Cmp;
-  VisitCompare(selector, opcode, right, left, cont, false);
-}
-
-// Shared routine for word comparison against zero.
-void VisitWordCompareZero(InstructionSelector* selector, Node* user,
-                          Node* value, FlagsContinuation* cont) {
-  // Try to combine with comparisons against 0 by simply inverting the branch.
-  while (value->opcode() == IrOpcode::kWord32Equal &&
-         selector->CanCover(user, value)) {
-    Int32BinopMatcher m(value);
-    if (!m.right().Is(0)) break;
-
-    user = value;
-    value = m.left().node();
-    cont->Negate();
-  }
-
-  if (selector->CanCover(user, value)) {
-    switch (value->opcode()) {
-      case IrOpcode::kWord32Equal:
-        cont->OverwriteAndNegateIfEqual(kEqual);
-        return VisitWordCompare(selector, value, kX64Cmp32, cont);
-      case IrOpcode::kInt32LessThan:
-        cont->OverwriteAndNegateIfEqual(kSignedLessThan);
-        return VisitWordCompare(selector, value, kX64Cmp32, cont);
-      case IrOpcode::kInt32LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kSignedLessThanOrEqual);
-        return VisitWordCompare(selector, value, kX64Cmp32, cont);
-      case IrOpcode::kUint32LessThan:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThan);
-        return VisitWordCompare(selector, value, kX64Cmp32, cont);
-      case IrOpcode::kUint32LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
-        return VisitWordCompare(selector, value, kX64Cmp32, cont);
-      case IrOpcode::kWord64Equal: {
-        cont->OverwriteAndNegateIfEqual(kEqual);
-        Int64BinopMatcher m(value);
-        if (m.right().Is(0)) {
-          // Try to combine the branch with a comparison.
-          Node* const user = m.node();
-          Node* const value = m.left().node();
-          if (selector->CanCover(user, value)) {
-            switch (value->opcode()) {
-              case IrOpcode::kInt64Sub:
-                return VisitWord64Compare(selector, value, cont);
-              case IrOpcode::kWord64And:
-                return VisitWordCompare(selector, value, kX64Test, cont);
-              default:
-                break;
-            }
-          }
-          return VisitCompareZero(selector, value, kX64Cmp, cont);
-        }
-        return VisitWord64Compare(selector, value, cont);
-      }
-      case IrOpcode::kInt64LessThan:
-        cont->OverwriteAndNegateIfEqual(kSignedLessThan);
-        return VisitWord64Compare(selector, value, cont);
-      case IrOpcode::kInt64LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kSignedLessThanOrEqual);
-        return VisitWord64Compare(selector, value, cont);
-      case IrOpcode::kUint64LessThan:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThan);
-        return VisitWord64Compare(selector, value, cont);
-      case IrOpcode::kUint64LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
-        return VisitWord64Compare(selector, value, cont);
-      case IrOpcode::kFloat32Equal:
-        cont->OverwriteAndNegateIfEqual(kUnorderedEqual);
-        return VisitFloat32Compare(selector, value, cont);
-      case IrOpcode::kFloat32LessThan:
-        cont->OverwriteAndNegateIfEqual(kUnsignedGreaterThan);
-        return VisitFloat32Compare(selector, value, cont);
-      case IrOpcode::kFloat32LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kUnsignedGreaterThanOrEqual);
-        return VisitFloat32Compare(selector, value, cont);
-      case IrOpcode::kFloat64Equal:
-        cont->OverwriteAndNegateIfEqual(kUnorderedEqual);
-        return VisitFloat64Compare(selector, value, cont);
-      case IrOpcode::kFloat64LessThan: {
-        Float64BinopMatcher m(value);
-        if (m.left().Is(0.0) && m.right().IsFloat64Abs()) {
-          // This matches the pattern
-          //
-          //   Float64LessThan(#0.0, Float64Abs(x))
-          //
-          // which TurboFan generates for NumberToBoolean in the general case,
-          // and which evaluates to false if x is 0, -0 or NaN. We can compile
-          // this to a simple (v)ucomisd using not_equal flags condition, which
-          // avoids the costly Float64Abs.
-          cont->OverwriteAndNegateIfEqual(kNotEqual);
-          InstructionCode const opcode =
-              selector->IsSupported(AVX) ? kAVXFloat64Cmp : kSSEFloat64Cmp;
-          return VisitCompare(selector, opcode, m.left().node(),
-                              m.right().InputAt(0), cont, false);
-        }
-        cont->OverwriteAndNegateIfEqual(kUnsignedGreaterThan);
-        return VisitFloat64Compare(selector, value, cont);
-      }
-      case IrOpcode::kFloat64LessThanOrEqual:
-        cont->OverwriteAndNegateIfEqual(kUnsignedGreaterThanOrEqual);
-        return VisitFloat64Compare(selector, value, cont);
-      case IrOpcode::kProjection:
-        // Check if this is the overflow output projection of an
-        // <Operation>WithOverflow node.
-        if (ProjectionIndexOf(value->op()) == 1u) {
-          // We cannot combine the <Operation>WithOverflow with this branch
-          // unless the 0th projection (the use of the actual value of the
-          // <Operation> is either nullptr, which means there's no use of the
-          // actual value, or was already defined, which means it is scheduled
-          // *AFTER* this branch).
-          Node* const node = value->InputAt(0);
-          Node* const result = NodeProperties::FindProjection(node, 0);
-          if (result == nullptr || selector->IsDefined(result)) {
-            switch (node->opcode()) {
-              case IrOpcode::kInt32AddWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitBinop(selector, node, kX64Add32, cont);
-              case IrOpcode::kInt32SubWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitBinop(selector, node, kX64Sub32, cont);
-              case IrOpcode::kInt32MulWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitBinop(selector, node, kX64Imul32, cont);
-              case IrOpcode::kInt64AddWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitBinop(selector, node, kX64Add, cont);
-              case IrOpcode::kInt64SubWithOverflow:
-                cont->OverwriteAndNegateIfEqual(kOverflow);
-                return VisitBinop(selector, node, kX64Sub, cont);
-              default:
-                break;
-            }
-          }
-        }
-        break;
-      case IrOpcode::kInt32Sub:
-        return VisitWordCompare(selector, value, kX64Cmp32, cont);
-      case IrOpcode::kWord32And:
-        return VisitWordCompare(selector, value, kX64Test32, cont);
-      default:
-        break;
-    }
-  }
-
-  // Branch could not be combined with a compare, emit compare against 0.
-  VisitCompareZero(selector, value, kX64Cmp32, cont);
-}
-
-}  // namespace
-
-void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch,
-                                      BasicBlock* fbranch) {
-  FlagsContinuation cont(kNotEqual, tbranch, fbranch);
-  VisitWordCompareZero(this, branch, branch->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitDeoptimizeIf(Node* node) {
-  DeoptimizeParameters p = DeoptimizeParametersOf(node->op());
-  FlagsContinuation cont = FlagsContinuation::ForDeoptimize(
-      kNotEqual, p.kind(), p.reason(), p.feedback(), node->InputAt(1));
-  VisitWordCompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitDeoptimizeUnless(Node* node) {
-  DeoptimizeParameters p = DeoptimizeParametersOf(node->op());
-  FlagsContinuation cont = FlagsContinuation::ForDeoptimize(
-      kEqual, p.kind(), p.reason(), p.feedback(), node->InputAt(1));
-  VisitWordCompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitTrapIf(Node* node, Runtime::FunctionId func_id) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForTrap(kNotEqual, func_id, node->InputAt(1));
-  VisitWordCompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitTrapUnless(Node* node,
-                                          Runtime::FunctionId func_id) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForTrap(kEqual, func_id, node->InputAt(1));
-  VisitWordCompareZero(this, node, node->InputAt(0), &cont);
-}
-
-void InstructionSelector::VisitSwitch(Node* node, const SwitchInfo& sw) {
-  X64OperandGenerator g(this);
-  InstructionOperand value_operand = g.UseRegister(node->InputAt(0));
-
-  // Emit either ArchTableSwitch or ArchLookupSwitch.
-  static const size_t kMaxTableSwitchValueRange = 2 << 16;
-  size_t table_space_cost = 4 + sw.value_range;
-  size_t table_time_cost = 3;
-  size_t lookup_space_cost = 3 + 2 * sw.case_count;
-  size_t lookup_time_cost = sw.case_count;
-  if (sw.case_count > 4 &&
-      table_space_cost + 3 * table_time_cost <=
-          lookup_space_cost + 3 * lookup_time_cost &&
-      sw.min_value > std::numeric_limits<int32_t>::min() &&
-      sw.value_range <= kMaxTableSwitchValueRange) {
-    InstructionOperand index_operand = g.TempRegister();
-    if (sw.min_value) {
-      // The leal automatically zero extends, so result is a valid 64-bit index.
-      Emit(kX64Lea32 | AddressingModeField::encode(kMode_MRI), index_operand,
-           value_operand, g.TempImmediate(-sw.min_value));
-    } else {
-      // Zero extend, because we use it as 64-bit index into the jump table.
-      Emit(kX64Movl, index_operand, value_operand);
-    }
-    // Generate a table lookup.
-    return EmitTableSwitch(sw, index_operand);
-  }
-
-  // Generate a sequence of conditional jumps.
-  return EmitLookupSwitch(sw, value_operand);
-}
-
-
-void InstructionSelector::VisitWord32Equal(Node* const node) {
-  Node* user = node;
-  FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
-  Int32BinopMatcher m(user);
-  if (m.right().Is(0)) {
-    return VisitWordCompareZero(this, m.node(), m.left().node(), &cont);
-  }
-  VisitWordCompare(this, node, kX64Cmp32, &cont);
-}
-
-
-void InstructionSelector::VisitInt32LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kSignedLessThan, node);
-  VisitWordCompare(this, node, kX64Cmp32, &cont);
-}
-
-
-void InstructionSelector::VisitInt32LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kSignedLessThanOrEqual, node);
-  VisitWordCompare(this, node, kX64Cmp32, &cont);
-}
-
-
-void InstructionSelector::VisitUint32LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kUnsignedLessThan, node);
-  VisitWordCompare(this, node, kX64Cmp32, &cont);
-}
-
-
-void InstructionSelector::VisitUint32LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedLessThanOrEqual, node);
-  VisitWordCompare(this, node, kX64Cmp32, &cont);
-}
-
-
-void InstructionSelector::VisitWord64Equal(Node* const node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
-  Int64BinopMatcher m(node);
-  if (m.right().Is(0)) {
-    // Try to combine the equality check with a comparison.
-    Node* const user = m.node();
-    Node* const value = m.left().node();
-    if (CanCover(user, value)) {
-      switch (value->opcode()) {
-        case IrOpcode::kInt64Sub:
-          return VisitWord64Compare(this, value, &cont);
-        case IrOpcode::kWord64And:
-          return VisitWordCompare(this, value, kX64Test, &cont);
-        default:
-          break;
-      }
-    }
-  }
-  VisitWord64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitInt32AddWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    return VisitBinop(this, node, kX64Add32, &cont);
-  }
-  FlagsContinuation cont;
-  VisitBinop(this, node, kX64Add32, &cont);
-}
-
-
-void InstructionSelector::VisitInt32SubWithOverflow(Node* node) {
-  if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
-    FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
-    return VisitBinop(this, node, kX64Sub32, &cont);
-  }
-  FlagsContinuation cont;
-  VisitBinop(this, node, kX64Sub32, &cont);
-}
-
-
-void InstructionSelector::VisitInt64LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kSignedLessThan, node);
-  VisitWord64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitInt64LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kSignedLessThanOrEqual, node);
-  VisitWord64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitUint64LessThan(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kUnsignedLessThan, node);
-  VisitWord64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitUint64LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedLessThanOrEqual, node);
-  VisitWord64Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat32Equal(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kUnorderedEqual, node);
-  VisitFloat32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat32LessThan(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedGreaterThan, node);
-  VisitFloat32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat32LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedGreaterThanOrEqual, node);
-  VisitFloat32Compare(this, node, &cont);
-}
-
-
-void InstructionSelector::VisitFloat64Equal(Node* node) {
-  FlagsContinuation cont = FlagsContinuation::ForSet(kUnorderedEqual, node);
-  VisitFloat64Compare(this, node, &cont);
-}
-
-void InstructionSelector::VisitFloat64LessThan(Node* node) {
-  Float64BinopMatcher m(node);
-  if (m.left().Is(0.0) && m.right().IsFloat64Abs()) {
-    // This matches the pattern
-    //
-    //   Float64LessThan(#0.0, Float64Abs(x))
-    //
-    // which TurboFan generates for NumberToBoolean in the general case,
-    // and which evaluates to false if x is 0, -0 or NaN. We can compile
-    // this to a simple (v)ucomisd using not_equal flags condition, which
-    // avoids the costly Float64Abs.
-    FlagsContinuation cont = FlagsContinuation::ForSet(kNotEqual, node);
-    InstructionCode const opcode =
-        IsSupported(AVX) ? kAVXFloat64Cmp : kSSEFloat64Cmp;
-    return VisitCompare(this, opcode, m.left().node(), m.right().InputAt(0),
-                        &cont, false);
-  }
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedGreaterThan, node);
-  VisitFloat64Compare(this, node, &cont);
-}
-
-void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) {
-  FlagsContinuation cont =
-      FlagsContinuation::ForSet(kUnsignedGreaterThanOrEqual, node);
-  VisitFloat64Compare(this, node, &cont);
-}
-
-void InstructionSelector::VisitFloat64InsertLowWord32(Node* node) {
-  X64OperandGenerator g(this);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-  Float64Matcher mleft(left);
-  if (mleft.HasValue() && (bit_cast<uint64_t>(mleft.Value()) >> 32) == 0u) {
-    Emit(kSSEFloat64LoadLowWord32, g.DefineAsRegister(node), g.Use(right));
-    return;
-  }
-  Emit(kSSEFloat64InsertLowWord32, g.DefineSameAsFirst(node),
-       g.UseRegister(left), g.Use(right));
-}
-
-
-void InstructionSelector::VisitFloat64InsertHighWord32(Node* node) {
-  X64OperandGenerator g(this);
-  Node* left = node->InputAt(0);
-  Node* right = node->InputAt(1);
-  Emit(kSSEFloat64InsertHighWord32, g.DefineSameAsFirst(node),
-       g.UseRegister(left), g.Use(right));
-}
-
-void InstructionSelector::VisitFloat64SilenceNaN(Node* node) {
-  X64OperandGenerator g(this);
-  Emit(kSSEFloat64SilenceNaN, g.DefineSameAsFirst(node),
-       g.UseRegister(node->InputAt(0)));
-}
-
-void InstructionSelector::VisitAtomicLoad(Node* node) {
-  LoadRepresentation load_rep = LoadRepresentationOf(node->op());
-  DCHECK(load_rep.representation() == MachineRepresentation::kWord8 ||
-         load_rep.representation() == MachineRepresentation::kWord16 ||
-         load_rep.representation() == MachineRepresentation::kWord32);
-  USE(load_rep);
-  VisitLoad(node);
-}
-
-void InstructionSelector::VisitAtomicStore(Node* node) {
-  X64OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-
-  MachineRepresentation rep = AtomicStoreRepresentationOf(node->op());
-  ArchOpcode opcode = kArchNop;
-  switch (rep) {
-    case MachineRepresentation::kWord8:
-      opcode = kAtomicExchangeInt8;
-      break;
-    case MachineRepresentation::kWord16:
-      opcode = kAtomicExchangeInt16;
-      break;
-    case MachineRepresentation::kWord32:
-      opcode = kAtomicExchangeWord32;
-      break;
-    default:
-      UNREACHABLE();
-      return;
-  }
-  AddressingMode addressing_mode;
-  InstructionOperand inputs[4];
-  size_t input_count = 0;
-  inputs[input_count++] = g.UseUniqueRegister(value);
-  inputs[input_count++] = g.UseUniqueRegister(base);
-  if (g.CanBeImmediate(index)) {
-    inputs[input_count++] = g.UseImmediate(index);
-    addressing_mode = kMode_MRI;
-  } else {
-    inputs[input_count++] = g.UseUniqueRegister(index);
-    addressing_mode = kMode_MR1;
-  }
-  InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
-  Emit(code, 0, static_cast<InstructionOperand*>(nullptr), input_count, inputs);
-}
-
-void InstructionSelector::VisitAtomicExchange(Node* node) {
-  X64OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-
-  MachineType type = AtomicOpRepresentationOf(node->op());
-  ArchOpcode opcode = kArchNop;
-  if (type == MachineType::Int8()) {
-    opcode = kAtomicExchangeInt8;
-  } else if (type == MachineType::Uint8()) {
-    opcode = kAtomicExchangeUint8;
-  } else if (type == MachineType::Int16()) {
-    opcode = kAtomicExchangeInt16;
-  } else if (type == MachineType::Uint16()) {
-    opcode = kAtomicExchangeUint16;
-  } else if (type == MachineType::Int32() || type == MachineType::Uint32()) {
-    opcode = kAtomicExchangeWord32;
-  } else {
-    UNREACHABLE();
-    return;
-  }
-  InstructionOperand outputs[1];
-  AddressingMode addressing_mode;
-  InstructionOperand inputs[3];
-  size_t input_count = 0;
-  inputs[input_count++] = g.UseUniqueRegister(value);
-  inputs[input_count++] = g.UseUniqueRegister(base);
-  if (g.CanBeImmediate(index)) {
-    inputs[input_count++] = g.UseImmediate(index);
-    addressing_mode = kMode_MRI;
-  } else {
-    inputs[input_count++] = g.UseUniqueRegister(index);
-    addressing_mode = kMode_MR1;
-  }
-  outputs[0] = g.DefineSameAsFirst(node);
-  InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
-  Emit(code, 1, outputs, input_count, inputs);
-}
-
-void InstructionSelector::VisitAtomicCompareExchange(Node* node) {
-  X64OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* old_value = node->InputAt(2);
-  Node* new_value = node->InputAt(3);
-
-  MachineType type = AtomicOpRepresentationOf(node->op());
-  ArchOpcode opcode = kArchNop;
-  if (type == MachineType::Int8()) {
-    opcode = kAtomicCompareExchangeInt8;
-  } else if (type == MachineType::Uint8()) {
-    opcode = kAtomicCompareExchangeUint8;
-  } else if (type == MachineType::Int16()) {
-    opcode = kAtomicCompareExchangeInt16;
-  } else if (type == MachineType::Uint16()) {
-    opcode = kAtomicCompareExchangeUint16;
-  } else if (type == MachineType::Int32() || type == MachineType::Uint32()) {
-    opcode = kAtomicCompareExchangeWord32;
-  } else {
-    UNREACHABLE();
-    return;
-  }
-  InstructionOperand outputs[1];
-  AddressingMode addressing_mode;
-  InstructionOperand inputs[4];
-  size_t input_count = 0;
-  inputs[input_count++] = g.UseFixed(old_value, rax);
-  inputs[input_count++] = g.UseUniqueRegister(new_value);
-  inputs[input_count++] = g.UseUniqueRegister(base);
-  if (g.CanBeImmediate(index)) {
-    inputs[input_count++] = g.UseImmediate(index);
-    addressing_mode = kMode_MRI;
-  } else {
-    inputs[input_count++] = g.UseUniqueRegister(index);
-    addressing_mode = kMode_MR1;
-  }
-  outputs[0] = g.DefineAsFixed(node, rax);
-  InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
-  Emit(code, 1, outputs, input_count, inputs);
-}
-
-void InstructionSelector::VisitAtomicBinaryOperation(
-    Node* node, ArchOpcode int8_op, ArchOpcode uint8_op, ArchOpcode int16_op,
-    ArchOpcode uint16_op, ArchOpcode word32_op) {
-  X64OperandGenerator g(this);
-  Node* base = node->InputAt(0);
-  Node* index = node->InputAt(1);
-  Node* value = node->InputAt(2);
-
-  MachineType type = AtomicOpRepresentationOf(node->op());
-  ArchOpcode opcode = kArchNop;
-  if (type == MachineType::Int8()) {
-    opcode = int8_op;
-  } else if (type == MachineType::Uint8()) {
-    opcode = uint8_op;
-  } else if (type == MachineType::Int16()) {
-    opcode = int16_op;
-  } else if (type == MachineType::Uint16()) {
-    opcode = uint16_op;
-  } else if (type == MachineType::Int32() || type == MachineType::Uint32()) {
-    opcode = word32_op;
-  } else {
-    UNREACHABLE();
-    return;
-  }
-  InstructionOperand outputs[1];
-  AddressingMode addressing_mode;
-  InstructionOperand inputs[3];
-  size_t input_count = 0;
-  inputs[input_count++] = g.UseUniqueRegister(value);
-  inputs[input_count++] = g.UseUniqueRegister(base);
-  if (g.CanBeImmediate(index)) {
-    inputs[input_count++] = g.UseImmediate(index);
-    addressing_mode = kMode_MRI;
-  } else {
-    inputs[input_count++] = g.UseUniqueRegister(index);
-    addressing_mode = kMode_MR1;
-  }
-  outputs[0] = g.DefineAsFixed(node, rax);
-  InstructionOperand temp[1];
-  temp[0] = g.TempRegister();
-  InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
-  Emit(code, 1, outputs, input_count, inputs, 1, temp);
-}
-
-#define VISIT_ATOMIC_BINOP(op)                                              \
-  void InstructionSelector::VisitAtomic##op(Node* node) {                   \
-    VisitAtomicBinaryOperation(node, kAtomic##op##Int8, kAtomic##op##Uint8, \
-                               kAtomic##op##Int16, kAtomic##op##Uint16,     \
-                               kAtomic##op##Word32);                        \
-  }
-VISIT_ATOMIC_BINOP(Add)
-VISIT_ATOMIC_BINOP(Sub)
-VISIT_ATOMIC_BINOP(And)
-VISIT_ATOMIC_BINOP(Or)
-VISIT_ATOMIC_BINOP(Xor)
-#undef VISIT_ATOMIC_BINOP
-
-#define SIMD_TYPES(V) \
-  V(F32x4)            \
-  V(I32x4)            \
-  V(I16x8)            \
-  V(I8x16)
-
-#define SIMD_BINOP_LIST(V) \
-  V(F32x4Add)              \
-  V(F32x4Sub)              \
-  V(F32x4Mul)              \
-  V(F32x4Min)              \
-  V(F32x4Max)              \
-  V(F32x4Eq)               \
-  V(F32x4Ne)               \
-  V(F32x4Lt)               \
-  V(F32x4Le)               \
-  V(I32x4Add)              \
-  V(I32x4AddHoriz)         \
-  V(I32x4Sub)              \
-  V(I32x4Mul)              \
-  V(I32x4MinS)             \
-  V(I32x4MaxS)             \
-  V(I32x4Eq)               \
-  V(I32x4Ne)               \
-  V(I32x4GtS)              \
-  V(I32x4GeS)              \
-  V(I32x4MinU)             \
-  V(I32x4MaxU)             \
-  V(I32x4GtU)              \
-  V(I32x4GeU)              \
-  V(I16x8Add)              \
-  V(I16x8AddSaturateS)     \
-  V(I16x8AddHoriz)         \
-  V(I16x8Sub)              \
-  V(I16x8SubSaturateS)     \
-  V(I16x8Mul)              \
-  V(I16x8MinS)             \
-  V(I16x8MaxS)             \
-  V(I16x8Eq)               \
-  V(I16x8Ne)               \
-  V(I16x8GtS)              \
-  V(I16x8GeS)              \
-  V(I16x8AddSaturateU)     \
-  V(I16x8SubSaturateU)     \
-  V(I16x8MinU)             \
-  V(I16x8MaxU)             \
-  V(I16x8GtU)              \
-  V(I16x8GeU)              \
-  V(I8x16Add)              \
-  V(I8x16AddSaturateS)     \
-  V(I8x16Sub)              \
-  V(I8x16SubSaturateS)     \
-  V(I8x16MinS)             \
-  V(I8x16MaxS)             \
-  V(I8x16Eq)               \
-  V(I8x16Ne)               \
-  V(I8x16GtS)              \
-  V(I8x16GeS)              \
-  V(I8x16AddSaturateU)     \
-  V(I8x16SubSaturateU)     \
-  V(I8x16MinU)             \
-  V(I8x16MaxU)             \
-  V(I8x16GtU)              \
-  V(I8x16GeU)              \
-  V(S128And)               \
-  V(S128Or)                \
-  V(S128Xor)
-
-#define SIMD_UNOP_LIST(V) \
-  V(F32x4RecipApprox)     \
-  V(F32x4RecipSqrtApprox) \
-  V(I32x4Neg)             \
-  V(I16x8Neg)             \
-  V(I8x16Neg)             \
-  V(S128Not)
-
-#define SIMD_SHIFT_OPCODES(V) \
-  V(I32x4Shl)                 \
-  V(I32x4ShrS)                \
-  V(I32x4ShrU)                \
-  V(I16x8Shl)                 \
-  V(I16x8ShrS)                \
-  V(I16x8ShrU)
-
-void InstructionSelector::VisitS128Zero(Node* node) {
-  X64OperandGenerator g(this);
-  Emit(kX64S128Zero, g.DefineAsRegister(node), g.DefineAsRegister(node));
-}
-
-#define VISIT_SIMD_SPLAT(Type)                               \
-  void InstructionSelector::Visit##Type##Splat(Node* node) { \
-    X64OperandGenerator g(this);                             \
-    Emit(kX64##Type##Splat, g.DefineAsRegister(node),        \
-         g.Use(node->InputAt(0)));                           \
-  }
-SIMD_TYPES(VISIT_SIMD_SPLAT)
-#undef VISIT_SIMD_SPLAT
-
-#define VISIT_SIMD_EXTRACT_LANE(Type)                              \
-  void InstructionSelector::Visit##Type##ExtractLane(Node* node) { \
-    X64OperandGenerator g(this);                                   \
-    int32_t lane = OpParameter<int32_t>(node);                     \
-    Emit(kX64##Type##ExtractLane, g.DefineAsRegister(node),        \
-         g.UseRegister(node->InputAt(0)), g.UseImmediate(lane));   \
-  }
-SIMD_TYPES(VISIT_SIMD_EXTRACT_LANE)
-#undef VISIT_SIMD_EXTRACT_LANE
-
-#define VISIT_SIMD_REPLACE_LANE(Type)                              \
-  void InstructionSelector::Visit##Type##ReplaceLane(Node* node) { \
-    X64OperandGenerator g(this);                                   \
-    int32_t lane = OpParameter<int32_t>(node);                     \
-    Emit(kX64##Type##ReplaceLane, g.DefineSameAsFirst(node),       \
-         g.UseRegister(node->InputAt(0)), g.UseImmediate(lane),    \
-         g.Use(node->InputAt(1)));                                 \
-  }
-SIMD_TYPES(VISIT_SIMD_REPLACE_LANE)
-#undef VISIT_SIMD_REPLACE_LANE
-
-#define VISIT_SIMD_SHIFT(Opcode)                                  \
-  void InstructionSelector::Visit##Opcode(Node* node) {           \
-    X64OperandGenerator g(this);                                  \
-    int32_t value = OpParameter<int32_t>(node);                   \
-    Emit(kX64##Opcode, g.DefineSameAsFirst(node),                 \
-         g.UseRegister(node->InputAt(0)), g.UseImmediate(value)); \
-  }
-SIMD_SHIFT_OPCODES(VISIT_SIMD_SHIFT)
-#undef VISIT_SIMD_SHIFT
-
-#define VISIT_SIMD_UNOP(Opcode)                         \
-  void InstructionSelector::Visit##Opcode(Node* node) { \
-    X64OperandGenerator g(this);                        \
-    Emit(kX64##Opcode, g.DefineAsRegister(node),        \
-         g.UseRegister(node->InputAt(0)));              \
-  }
-SIMD_UNOP_LIST(VISIT_SIMD_UNOP)
-#undef VISIT_SIMD_UNOP
-
-#define VISIT_SIMD_BINOP(Opcode)                                            \
-  void InstructionSelector::Visit##Opcode(Node* node) {                     \
-    X64OperandGenerator g(this);                                            \
-    Emit(kX64##Opcode, g.DefineSameAsFirst(node),                           \
-         g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1))); \
-  }
-SIMD_BINOP_LIST(VISIT_SIMD_BINOP)
-#undef VISIT_SIMD_BINOP
-#undef SIMD_TYPES
-#undef SIMD_BINOP_LIST
-#undef SIMD_UNOP_LIST
-#undef SIMD_SHIFT_OPCODES
-
-void InstructionSelector::VisitS128Select(Node* node) {
-  X64OperandGenerator g(this);
-  Emit(kX64S128Select, g.DefineSameAsFirst(node),
-       g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)),
-       g.UseRegister(node->InputAt(2)));
-}
-
-void InstructionSelector::VisitInt32AbsWithOverflow(Node* node) {
-  UNREACHABLE();
-}
-
-void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) {
-  UNREACHABLE();
-}
-
-// static
-MachineOperatorBuilder::Flags
-InstructionSelector::SupportedMachineOperatorFlags() {
-  MachineOperatorBuilder::Flags flags =
-      MachineOperatorBuilder::kWord32ShiftIsSafe |
-      MachineOperatorBuilder::kWord32Ctz | MachineOperatorBuilder::kWord64Ctz |
-      MachineOperatorBuilder::kSpeculationFence;
-  if (CpuFeatures::IsSupported(POPCNT)) {
-    flags |= MachineOperatorBuilder::kWord32Popcnt |
-             MachineOperatorBuilder::kWord64Popcnt;
-  }
-  if (CpuFeatures::IsSupported(SSE4_1)) {
-    flags |= MachineOperatorBuilder::kFloat32RoundDown |
-             MachineOperatorBuilder::kFloat64RoundDown |
-             MachineOperatorBuilder::kFloat32RoundUp |
-             MachineOperatorBuilder::kFloat64RoundUp |
-             MachineOperatorBuilder::kFloat32RoundTruncate |
-             MachineOperatorBuilder::kFloat64RoundTruncate |
-             MachineOperatorBuilder::kFloat32RoundTiesEven |
-             MachineOperatorBuilder::kFloat64RoundTiesEven;
-  }
-  return flags;
-}
-
-// static
-MachineOperatorBuilder::AlignmentRequirements
-InstructionSelector::AlignmentRequirements() {
-  return MachineOperatorBuilder::AlignmentRequirements::
-      FullUnalignedAccessSupport();
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/x64/unwinding-info-writer-x64.cc b/src/v8/src/compiler/x64/unwinding-info-writer-x64.cc
deleted file mode 100644
index b54c871..0000000
--- a/src/v8/src/compiler/x64/unwinding-info-writer-x64.cc
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/compiler/x64/unwinding-info-writer-x64.h"
-#include "src/compiler/instruction.h"
-
-#if defined(V8_OS_STARBOARD)
-#include "src/objects/tagged-impl-inl.h"
-#endif
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-void UnwindingInfoWriter::BeginInstructionBlock(int pc_offset,
-                                                const InstructionBlock* block) {
-  if (!enabled()) return;
-
-  block_will_exit_ = false;
-
-  DCHECK_LT(block->rpo_number().ToInt(),
-            static_cast<int>(block_initial_states_.size()));
-  const BlockInitialState* initial_state =
-      block_initial_states_[block->rpo_number().ToInt()];
-  if (initial_state) {
-    if (initial_state->register_ != eh_frame_writer_.base_register() &&
-        initial_state->offset_ != eh_frame_writer_.base_offset()) {
-      eh_frame_writer_.AdvanceLocation(pc_offset);
-      eh_frame_writer_.SetBaseAddressRegisterAndOffset(initial_state->register_,
-                                                       initial_state->offset_);
-    } else if (initial_state->register_ != eh_frame_writer_.base_register()) {
-      eh_frame_writer_.AdvanceLocation(pc_offset);
-      eh_frame_writer_.SetBaseAddressRegister(initial_state->register_);
-    } else if (initial_state->offset_ != eh_frame_writer_.base_offset()) {
-      eh_frame_writer_.AdvanceLocation(pc_offset);
-      eh_frame_writer_.SetBaseAddressOffset(initial_state->offset_);
-    }
-
-    tracking_fp_ = initial_state->tracking_fp_;
-  } else {
-    // The entry block always lacks an explicit initial state.
-    // The exit block may lack an explicit state, if it is only reached by
-    //   the block ending in a ret.
-    // All the other blocks must have an explicit initial state.
-    DCHECK(block->predecessors().empty() || block->successors().empty());
-  }
-}
-
-void UnwindingInfoWriter::EndInstructionBlock(const InstructionBlock* block) {
-  if (!enabled() || block_will_exit_) return;
-
-  for (const RpoNumber& successor : block->successors()) {
-    int successor_index = successor.ToInt();
-    DCHECK_LT(successor_index, static_cast<int>(block_initial_states_.size()));
-    const BlockInitialState* existing_state =
-        block_initial_states_[successor_index];
-    // If we already had an entry for this BB, check that the values are the
-    // same we are trying to insert.
-    if (existing_state) {
-      DCHECK(existing_state->register_ == eh_frame_writer_.base_register());
-      DCHECK_EQ(existing_state->offset_, eh_frame_writer_.base_offset());
-      DCHECK_EQ(existing_state->tracking_fp_, tracking_fp_);
-    } else {
-      block_initial_states_[successor_index] = new (zone_)
-          BlockInitialState(eh_frame_writer_.base_register(),
-                            eh_frame_writer_.base_offset(), tracking_fp_);
-    }
-  }
-}
-
-void UnwindingInfoWriter::MarkFrameConstructed(int pc_base) {
-  if (!enabled()) return;
-
-  // push rbp
-  eh_frame_writer_.AdvanceLocation(pc_base + 1);
-  eh_frame_writer_.IncreaseBaseAddressOffset(kInt64Size);
-  // <base address> points at the bottom of the current frame on x64 and
-  // <base register> is rsp, which points to the top of the frame by definition.
-  // Thus, the distance between <base address> and the top is -<base offset>.
-  int top_of_stack = -eh_frame_writer_.base_offset();
-  eh_frame_writer_.RecordRegisterSavedToStack(rbp, top_of_stack);
-
-  // mov rbp, rsp
-  eh_frame_writer_.AdvanceLocation(pc_base + 4);
-  eh_frame_writer_.SetBaseAddressRegister(rbp);
-
-  tracking_fp_ = true;
-}
-
-void UnwindingInfoWriter::MarkFrameDeconstructed(int pc_base) {
-  if (!enabled()) return;
-
-  // mov rsp, rbp
-  eh_frame_writer_.AdvanceLocation(pc_base + 3);
-  eh_frame_writer_.SetBaseAddressRegister(rsp);
-
-  // pop rbp
-  eh_frame_writer_.AdvanceLocation(pc_base + 4);
-  eh_frame_writer_.IncreaseBaseAddressOffset(-kInt64Size);
-
-  tracking_fp_ = false;
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/compiler/x64/unwinding-info-writer-x64.h b/src/v8/src/compiler/x64/unwinding-info-writer-x64.h
deleted file mode 100644
index 8bb5903..0000000
--- a/src/v8/src/compiler/x64/unwinding-info-writer-x64.h
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_X64_UNWINDING_INFO_WRITER_H_
-#define V8_COMPILER_X64_UNWINDING_INFO_WRITER_H_
-
-#include "src/eh-frame.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-class InstructionBlock;
-
-class UnwindingInfoWriter {
- public:
-  explicit UnwindingInfoWriter(Zone* zone)
-      : zone_(zone),
-        eh_frame_writer_(zone),
-        tracking_fp_(false),
-        block_will_exit_(false),
-        block_initial_states_(zone) {
-    if (enabled()) eh_frame_writer_.Initialize();
-  }
-
-  void MaybeIncreaseBaseOffsetAt(int pc_offset, int base_delta) {
-    if (enabled() && !tracking_fp_) {
-      eh_frame_writer_.AdvanceLocation(pc_offset);
-      eh_frame_writer_.IncreaseBaseAddressOffset(base_delta);
-    }
-  }
-
-  void SetNumberOfInstructionBlocks(int number) {
-    if (enabled()) block_initial_states_.resize(number);
-  }
-
-  void BeginInstructionBlock(int pc_offset, const InstructionBlock* block);
-  void EndInstructionBlock(const InstructionBlock* block);
-
-  void MarkFrameConstructed(int pc_base);
-  void MarkFrameDeconstructed(int pc_base);
-
-  void MarkBlockWillExit() { block_will_exit_ = true; }
-
-  void Finish(int code_size) {
-    if (enabled()) eh_frame_writer_.Finish(code_size);
-  }
-
-  EhFrameWriter* eh_frame_writer() {
-    return enabled() ? &eh_frame_writer_ : nullptr;
-  }
-
- private:
-  bool enabled() const { return FLAG_perf_prof_unwinding_info; }
-
-  class BlockInitialState : public ZoneObject {
-   public:
-    BlockInitialState(Register reg, int offset, bool tracking_fp)
-        : register_(reg), offset_(offset), tracking_fp_(tracking_fp) {}
-
-    Register register_;
-    int offset_;
-    bool tracking_fp_;
-  };
-
-  Zone* zone_;
-  EhFrameWriter eh_frame_writer_;
-  bool tracking_fp_;
-  bool block_will_exit_;
-
-  ZoneVector<const BlockInitialState*> block_initial_states_;
-};
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif
diff --git a/src/v8/src/debug/debug.js b/src/v8/src/debug/debug.js
deleted file mode 100644
index 43be3c4..0000000
--- a/src/v8/src/debug/debug.js
+++ /dev/null
@@ -1,1012 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-(function (global, utils) {
-"use strict";
-
-// ----------------------------------------------------------------------------
-// Imports
-
-var FrameMirror = global.FrameMirror;
-var GlobalArray = global.Array;
-var GlobalRegExp = global.RegExp;
-var IsNaN = global.isNaN;
-var MakeMirror = global.MakeMirror;
-var MathMin = global.Math.min;
-var Mirror = global.Mirror;
-var ValueMirror = global.ValueMirror;
-
-//----------------------------------------------------------------------------
-
-// Default number of frames to include in the response to backtrace request.
-var kDefaultBacktraceLength = 10;
-
-var Debug = {};
-
-// Regular expression to skip "crud" at the beginning of a source line which is
-// not really code. Currently the regular expression matches whitespace and
-// comments.
-var sourceLineBeginningSkip = /^(?:\s*(?:\/\*.*?\*\/)*)*/;
-
-// Debug events which can occur in the V8 JavaScript engine. These originate
-// from the API include file debug.h.
-Debug.DebugEvent = { Break: 1,
-                     Exception: 2,
-                     AfterCompile: 3,
-                     CompileError: 4,
-                     AsyncTaskEvent: 5 };
-
-// Types of exceptions that can be broken upon.
-Debug.ExceptionBreak = { Caught : 0,
-                         Uncaught: 1 };
-
-// The different types of steps.
-Debug.StepAction = { StepOut: 0,
-                     StepNext: 1,
-                     StepIn: 2 };
-
-// The different types of scripts matching enum ScriptType in objects.h.
-Debug.ScriptType = { Native: 0,
-                     Extension: 1,
-                     Normal: 2,
-                     Wasm: 3};
-
-// The different types of script compilations matching enum
-// Script::CompilationType in objects.h.
-Debug.ScriptCompilationType = { Host: 0,
-                                Eval: 1,
-                                JSON: 2 };
-
-// The different script break point types.
-Debug.ScriptBreakPointType = { ScriptId: 0,
-                               ScriptName: 1,
-                               ScriptRegExp: 2 };
-
-function ScriptTypeFlag(type) {
-  return (1 << type);
-}
-
-// Globals.
-var next_response_seq = 0;
-var next_break_point_number = 1;
-var break_points = [];
-var script_break_points = [];
-var debugger_flags = {
-  breakPointsActive: {
-    value: true,
-    getValue: function() { return this.value; },
-    setValue: function(value) {
-      this.value = !!value;
-      %SetBreakPointsActive(this.value);
-    }
-  },
-  breakOnCaughtException: {
-    getValue: function() { return Debug.isBreakOnException(); },
-    setValue: function(value) {
-      if (value) {
-        Debug.setBreakOnException();
-      } else {
-        Debug.clearBreakOnException();
-      }
-    }
-  },
-  breakOnUncaughtException: {
-    getValue: function() { return Debug.isBreakOnUncaughtException(); },
-    setValue: function(value) {
-      if (value) {
-        Debug.setBreakOnUncaughtException();
-      } else {
-        Debug.clearBreakOnUncaughtException();
-      }
-    }
-  },
-};
-
-
-// Create a new break point object and add it to the list of break points.
-function MakeBreakPoint(source_position, opt_script_break_point) {
-  var break_point = new BreakPoint(source_position, opt_script_break_point);
-  break_points.push(break_point);
-  return break_point;
-}
-
-
-// Object representing a break point.
-// NOTE: This object does not have a reference to the function having break
-// point as this would cause function not to be garbage collected when it is
-// not used any more. We do not want break points to keep functions alive.
-function BreakPoint(source_position, opt_script_break_point) {
-  this.source_position_ = source_position;
-  if (opt_script_break_point) {
-    this.script_break_point_ = opt_script_break_point;
-  } else {
-    this.number_ = next_break_point_number++;
-  }
-  this.active_ = true;
-  this.condition_ = null;
-}
-
-
-BreakPoint.prototype.number = function() {
-  return this.number_;
-};
-
-
-BreakPoint.prototype.func = function() {
-  return this.func_;
-};
-
-
-BreakPoint.prototype.source_position = function() {
-  return this.source_position_;
-};
-
-
-BreakPoint.prototype.active = function() {
-  if (this.script_break_point()) {
-    return this.script_break_point().active();
-  }
-  return this.active_;
-};
-
-
-BreakPoint.prototype.condition = function() {
-  if (this.script_break_point() && this.script_break_point().condition()) {
-    return this.script_break_point().condition();
-  }
-  return this.condition_;
-};
-
-
-BreakPoint.prototype.script_break_point = function() {
-  return this.script_break_point_;
-};
-
-
-BreakPoint.prototype.enable = function() {
-  this.active_ = true;
-};
-
-
-BreakPoint.prototype.disable = function() {
-  this.active_ = false;
-};
-
-
-BreakPoint.prototype.setCondition = function(condition) {
-  this.condition_ = condition;
-};
-
-
-BreakPoint.prototype.isTriggered = function(exec_state) {
-  // Break point not active - not triggered.
-  if (!this.active()) return false;
-
-  // Check for conditional break point.
-  if (this.condition()) {
-    // If break point has condition try to evaluate it in the top frame.
-    try {
-      var mirror = exec_state.frame(0).evaluate(this.condition());
-      // If no sensible mirror or non true value break point not triggered.
-      if (!(mirror instanceof ValueMirror) || !mirror.value_) {
-        return false;
-      }
-    } catch (e) {
-      // Exception evaluating condition counts as not triggered.
-      return false;
-    }
-  }
-
-  // Break point triggered.
-  return true;
-};
-
-
-// Function called from the runtime when a break point is hit. Returns true if
-// the break point is triggered and supposed to break execution.
-function IsBreakPointTriggered(break_id, break_point) {
-  return break_point.isTriggered(MakeExecutionState(break_id));
-}
-
-
-// Object representing a script break point. The script is referenced by its
-// script name or script id and the break point is represented as line and
-// column.
-function ScriptBreakPoint(type, script_id_or_name, opt_line, opt_column,
-                          opt_groupId) {
-  this.type_ = type;
-  if (type == Debug.ScriptBreakPointType.ScriptId) {
-    this.script_id_ = script_id_or_name;
-  } else if (type == Debug.ScriptBreakPointType.ScriptName) {
-    this.script_name_ = script_id_or_name;
-  } else if (type == Debug.ScriptBreakPointType.ScriptRegExp) {
-    this.script_regexp_object_ = new GlobalRegExp(script_id_or_name);
-  } else {
-    throw %make_error(kDebugger, "Unexpected breakpoint type " + type);
-  }
-  this.line_ = opt_line || 0;
-  this.column_ = opt_column;
-  this.groupId_ = opt_groupId;
-  this.active_ = true;
-  this.condition_ = null;
-  this.break_points_ = [];
-}
-
-
-ScriptBreakPoint.prototype.number = function() {
-  return this.number_;
-};
-
-
-ScriptBreakPoint.prototype.groupId = function() {
-  return this.groupId_;
-};
-
-
-ScriptBreakPoint.prototype.type = function() {
-  return this.type_;
-};
-
-
-ScriptBreakPoint.prototype.script_id = function() {
-  return this.script_id_;
-};
-
-
-ScriptBreakPoint.prototype.script_name = function() {
-  return this.script_name_;
-};
-
-
-ScriptBreakPoint.prototype.script_regexp_object = function() {
-  return this.script_regexp_object_;
-};
-
-
-ScriptBreakPoint.prototype.line = function() {
-  return this.line_;
-};
-
-
-ScriptBreakPoint.prototype.column = function() {
-  return this.column_;
-};
-
-
-ScriptBreakPoint.prototype.actual_locations = function() {
-  var locations = [];
-  for (var i = 0; i < this.break_points_.length; i++) {
-    locations.push(this.break_points_[i].actual_location);
-  }
-  return locations;
-};
-
-
-ScriptBreakPoint.prototype.update_positions = function(line, column) {
-  this.line_ = line;
-  this.column_ = column;
-};
-
-
-ScriptBreakPoint.prototype.active = function() {
-  return this.active_;
-};
-
-
-ScriptBreakPoint.prototype.condition = function() {
-  return this.condition_;
-};
-
-
-ScriptBreakPoint.prototype.enable = function() {
-  this.active_ = true;
-};
-
-
-ScriptBreakPoint.prototype.disable = function() {
-  this.active_ = false;
-};
-
-
-ScriptBreakPoint.prototype.setCondition = function(condition) {
-  this.condition_ = condition;
-};
-
-
-// Check whether a script matches this script break point. Currently this is
-// only based on script name.
-ScriptBreakPoint.prototype.matchesScript = function(script) {
-  if (this.type_ == Debug.ScriptBreakPointType.ScriptId) {
-    return this.script_id_ == script.id;
-  } else {
-    // We might want to account columns here as well.
-    if (!(script.line_offset <= this.line_  &&
-          this.line_ < script.line_offset + %ScriptLineCount(script))) {
-      return false;
-    }
-    if (this.type_ == Debug.ScriptBreakPointType.ScriptName) {
-      return this.script_name_ == script.nameOrSourceURL();
-    } else if (this.type_ == Debug.ScriptBreakPointType.ScriptRegExp) {
-      return this.script_regexp_object_.test(script.nameOrSourceURL());
-    } else {
-      throw %make_error(kDebugger, "Unexpected breakpoint type " + this.type_);
-    }
-  }
-};
-
-
-// Set the script break point in a script.
-ScriptBreakPoint.prototype.set = function (script) {
-  var column = this.column();
-  var line = this.line();
-  // If the column is undefined the break is on the line. To help locate the
-  // first piece of breakable code on the line try to find the column on the
-  // line which contains some source.
-  if (IS_UNDEFINED(column)) {
-    var source_line = %ScriptSourceLine(script, line || script.line_offset);
-
-    // Allocate array for caching the columns where the actual source starts.
-    if (!script.sourceColumnStart_) {
-      script.sourceColumnStart_ = new GlobalArray(%ScriptLineCount(script));
-    }
-
-    // Fill cache if needed and get column where the actual source starts.
-    if (IS_UNDEFINED(script.sourceColumnStart_[line])) {
-      script.sourceColumnStart_[line] =
-          source_line.match(sourceLineBeginningSkip)[0].length;
-    }
-    column = script.sourceColumnStart_[line];
-  }
-
-  // Convert the line and column into an absolute position within the script.
-  var position = Debug.findScriptSourcePosition(script, this.line(), column);
-
-  // If the position is not found in the script (the script might be shorter
-  // than it used to be) just ignore it.
-  if (IS_NULL(position)) return;
-
-  // Create a break point object and set the break point.
-  var break_point = MakeBreakPoint(position, this);
-  var actual_position = %SetScriptBreakPoint(script, position,
-                                             break_point);
-  if (IS_UNDEFINED(actual_position)) {
-    actual_position = position;
-  }
-  var actual_location = script.locationFromPosition(actual_position, true);
-  break_point.actual_location = { line: actual_location.line,
-                                  column: actual_location.column,
-                                  script_id: script.id };
-  this.break_points_.push(break_point);
-  return break_point;
-};
-
-
-// Clear all the break points created from this script break point
-ScriptBreakPoint.prototype.clear = function () {
-  var remaining_break_points = [];
-  for (var i = 0; i < break_points.length; i++) {
-    if (break_points[i].script_break_point() &&
-        break_points[i].script_break_point() === this) {
-      %ClearBreakPoint(break_points[i]);
-    } else {
-      remaining_break_points.push(break_points[i]);
-    }
-  }
-  break_points = remaining_break_points;
-  this.break_points_ = [];
-};
-
-
-Debug.setListener = function(listener, opt_data) {
-  if (!IS_FUNCTION(listener) && !IS_UNDEFINED(listener) && !IS_NULL(listener)) {
-    throw %make_type_error(kDebuggerType);
-  }
-  %SetDebugEventListener(listener, opt_data);
-};
-
-
-// Returns a Script object. If the parameter is a function the return value
-// is the script in which the function is defined. If the parameter is a string
-// the return value is the script for which the script name has that string
-// value.  If it is a regexp and there is a unique script whose name matches
-// we return that, otherwise undefined.
-Debug.findScript = function(func_or_script_name) {
-  if (IS_FUNCTION(func_or_script_name)) {
-    return %FunctionGetScript(func_or_script_name);
-  } else if (%IsRegExp(func_or_script_name)) {
-    var scripts = this.scripts();
-    var last_result = null;
-    var result_count = 0;
-    for (var i in scripts) {
-      var script = scripts[i];
-      if (func_or_script_name.test(script.name)) {
-        last_result = script;
-        result_count++;
-      }
-    }
-    // Return the unique script matching the regexp.  If there are more
-    // than one we don't return a value since there is no good way to
-    // decide which one to return.  Returning a "random" one, say the
-    // first, would introduce nondeterminism (or something close to it)
-    // because the order is the heap iteration order.
-    if (result_count == 1) {
-      return last_result;
-    } else {
-      return UNDEFINED;
-    }
-  } else {
-    return %GetScript(func_or_script_name);
-  }
-};
-
-// Returns the script source. If the parameter is a function the return value
-// is the script source for the script in which the function is defined. If the
-// parameter is a string the return value is the script for which the script
-// name has that string value.
-Debug.scriptSource = function(func_or_script_name) {
-  return this.findScript(func_or_script_name).source;
-};
-
-
-Debug.source = function(f) {
-  if (!IS_FUNCTION(f)) throw %make_type_error(kDebuggerType);
-  return %FunctionGetSourceCode(f);
-};
-
-
-Debug.sourcePosition = function(f) {
-  if (!IS_FUNCTION(f)) throw %make_type_error(kDebuggerType);
-  return %FunctionGetScriptSourcePosition(f);
-};
-
-
-Debug.findFunctionSourceLocation = function(func, opt_line, opt_column) {
-  var script = %FunctionGetScript(func);
-  var script_offset = %FunctionGetScriptSourcePosition(func);
-  return %ScriptLocationFromLine(script, opt_line, opt_column, script_offset);
-};
-
-
-// Returns the character position in a script based on a line number and an
-// optional position within that line.
-Debug.findScriptSourcePosition = function(script, opt_line, opt_column) {
-  var location = %ScriptLocationFromLine(script, opt_line, opt_column, 0);
-  return location ? location.position : null;
-};
-
-
-Debug.findBreakPoint = function(break_point_number, remove) {
-  var break_point;
-  for (var i = 0; i < break_points.length; i++) {
-    if (break_points[i].number() == break_point_number) {
-      break_point = break_points[i];
-      // Remove the break point from the list if requested.
-      if (remove) {
-        break_points.splice(i, 1);
-      }
-      break;
-    }
-  }
-  if (break_point) {
-    return break_point;
-  } else {
-    return this.findScriptBreakPoint(break_point_number, remove);
-  }
-};
-
-Debug.findBreakPointActualLocations = function(break_point_number) {
-  for (var i = 0; i < script_break_points.length; i++) {
-    if (script_break_points[i].number() == break_point_number) {
-      return script_break_points[i].actual_locations();
-    }
-  }
-  for (var i = 0; i < break_points.length; i++) {
-    if (break_points[i].number() == break_point_number) {
-      return [break_points[i].actual_location];
-    }
-  }
-  return [];
-};
-
-Debug.setBreakPoint = function(func, opt_line, opt_column, opt_condition) {
-  if (!IS_FUNCTION(func)) throw %make_type_error(kDebuggerType);
-  // Break points in API functions are not supported.
-  if (%FunctionIsAPIFunction(func)) {
-    throw %make_error(kDebugger, 'Cannot set break point in native code.');
-  }
-  // Find source position.
-  var source_position =
-      this.findFunctionSourceLocation(func, opt_line, opt_column).position;
-  // Find the script for the function.
-  var script = %FunctionGetScript(func);
-  // Break in builtin JavaScript code is not supported.
-  if (script.type == Debug.ScriptType.Native) {
-    throw %make_error(kDebugger, 'Cannot set break point in native code.');
-  }
-  // If the script for the function has a name convert this to a script break
-  // point.
-  if (script && script.id) {
-    // Find line and column for the position in the script and set a script
-    // break point from that.
-    var location = script.locationFromPosition(source_position, false);
-    return this.setScriptBreakPointById(script.id,
-                                        location.line, location.column,
-                                        opt_condition);
-  } else {
-    // Set a break point directly on the function.
-    var break_point = MakeBreakPoint(source_position);
-    var actual_position =
-        %SetFunctionBreakPoint(func, source_position, break_point);
-    var actual_location = script.locationFromPosition(actual_position, true);
-    break_point.actual_location = { line: actual_location.line,
-                                    column: actual_location.column,
-                                    script_id: script.id };
-    break_point.setCondition(opt_condition);
-    return break_point.number();
-  }
-};
-
-
-Debug.setBreakPointByScriptIdAndPosition = function(script_id, position,
-                                                    condition, enabled)
-{
-  var break_point = MakeBreakPoint(position);
-  break_point.setCondition(condition);
-  if (!enabled) {
-    break_point.disable();
-  }
-  var script = scriptById(script_id);
-  if (script) {
-    break_point.actual_position = %SetScriptBreakPoint(script, position, break_point);
-  }
-  return break_point;
-};
-
-
-Debug.enableBreakPoint = function(break_point_number) {
-  var break_point = this.findBreakPoint(break_point_number, false);
-  // Only enable if the breakpoint hasn't been deleted:
-  if (break_point) {
-    break_point.enable();
-  }
-};
-
-
-Debug.disableBreakPoint = function(break_point_number) {
-  var break_point = this.findBreakPoint(break_point_number, false);
-  // Only enable if the breakpoint hasn't been deleted:
-  if (break_point) {
-    break_point.disable();
-  }
-};
-
-
-Debug.changeBreakPointCondition = function(break_point_number, condition) {
-  var break_point = this.findBreakPoint(break_point_number, false);
-  break_point.setCondition(condition);
-};
-
-
-Debug.clearBreakPoint = function(break_point_number) {
-  var break_point = this.findBreakPoint(break_point_number, true);
-  if (break_point) {
-    return %ClearBreakPoint(break_point);
-  } else {
-    break_point = this.findScriptBreakPoint(break_point_number, true);
-    if (!break_point) throw %make_error(kDebugger, 'Invalid breakpoint');
-  }
-};
-
-
-Debug.clearAllBreakPoints = function() {
-  for (var i = 0; i < break_points.length; i++) {
-    var break_point = break_points[i];
-    %ClearBreakPoint(break_point);
-  }
-  break_points = [];
-};
-
-
-Debug.disableAllBreakPoints = function() {
-  // Disable all user defined breakpoints:
-  for (var i = 1; i < next_break_point_number; i++) {
-    Debug.disableBreakPoint(i);
-  }
-  // Disable all exception breakpoints:
-  %ChangeBreakOnException(Debug.ExceptionBreak.Caught, false);
-  %ChangeBreakOnException(Debug.ExceptionBreak.Uncaught, false);
-};
-
-
-Debug.findScriptBreakPoint = function(break_point_number, remove) {
-  var script_break_point;
-  for (var i = 0; i < script_break_points.length; i++) {
-    if (script_break_points[i].number() == break_point_number) {
-      script_break_point = script_break_points[i];
-      // Remove the break point from the list if requested.
-      if (remove) {
-        script_break_point.clear();
-        script_break_points.splice(i,1);
-      }
-      break;
-    }
-  }
-  return script_break_point;
-};
-
-
-// Sets a breakpoint in a script identified through id or name at the
-// specified source line and column within that line.
-Debug.setScriptBreakPoint = function(type, script_id_or_name,
-                                     opt_line, opt_column, opt_condition,
-                                     opt_groupId) {
-  // Create script break point object.
-  var script_break_point =
-      new ScriptBreakPoint(type, script_id_or_name, opt_line, opt_column,
-                           opt_groupId);
-
-  // Assign number to the new script break point and add it.
-  script_break_point.number_ = next_break_point_number++;
-  script_break_point.setCondition(opt_condition);
-  script_break_points.push(script_break_point);
-
-  // Run through all scripts to see if this script break point matches any
-  // loaded scripts.
-  var scripts = this.scripts();
-  for (var i = 0; i < scripts.length; i++) {
-    if (script_break_point.matchesScript(scripts[i])) {
-      script_break_point.set(scripts[i]);
-    }
-  }
-
-  return script_break_point.number();
-};
-
-
-Debug.setScriptBreakPointById = function(script_id,
-                                         opt_line, opt_column,
-                                         opt_condition, opt_groupId) {
-  return this.setScriptBreakPoint(Debug.ScriptBreakPointType.ScriptId,
-                                  script_id, opt_line, opt_column,
-                                  opt_condition, opt_groupId);
-};
-
-
-Debug.setScriptBreakPointByName = function(script_name,
-                                           opt_line, opt_column,
-                                           opt_condition, opt_groupId) {
-  return this.setScriptBreakPoint(Debug.ScriptBreakPointType.ScriptName,
-                                  script_name, opt_line, opt_column,
-                                  opt_condition, opt_groupId);
-};
-
-
-Debug.setScriptBreakPointByRegExp = function(script_regexp,
-                                             opt_line, opt_column,
-                                             opt_condition, opt_groupId) {
-  return this.setScriptBreakPoint(Debug.ScriptBreakPointType.ScriptRegExp,
-                                  script_regexp, opt_line, opt_column,
-                                  opt_condition, opt_groupId);
-};
-
-
-Debug.enableScriptBreakPoint = function(break_point_number) {
-  var script_break_point = this.findScriptBreakPoint(break_point_number, false);
-  script_break_point.enable();
-};
-
-
-Debug.disableScriptBreakPoint = function(break_point_number) {
-  var script_break_point = this.findScriptBreakPoint(break_point_number, false);
-  script_break_point.disable();
-};
-
-
-Debug.changeScriptBreakPointCondition = function(
-    break_point_number, condition) {
-  var script_break_point = this.findScriptBreakPoint(break_point_number, false);
-  script_break_point.setCondition(condition);
-};
-
-
-Debug.scriptBreakPoints = function() {
-  return script_break_points;
-};
-
-
-Debug.clearStepping = function() {
-  %ClearStepping();
-};
-
-Debug.setBreakOnException = function() {
-  return %ChangeBreakOnException(Debug.ExceptionBreak.Caught, true);
-};
-
-Debug.clearBreakOnException = function() {
-  return %ChangeBreakOnException(Debug.ExceptionBreak.Caught, false);
-};
-
-Debug.isBreakOnException = function() {
-  return !!%IsBreakOnException(Debug.ExceptionBreak.Caught);
-};
-
-Debug.setBreakOnUncaughtException = function() {
-  return %ChangeBreakOnException(Debug.ExceptionBreak.Uncaught, true);
-};
-
-Debug.clearBreakOnUncaughtException = function() {
-  return %ChangeBreakOnException(Debug.ExceptionBreak.Uncaught, false);
-};
-
-Debug.isBreakOnUncaughtException = function() {
-  return !!%IsBreakOnException(Debug.ExceptionBreak.Uncaught);
-};
-
-Debug.showBreakPoints = function(f, full) {
-  if (!IS_FUNCTION(f)) throw %make_error(kDebuggerType);
-  var source = full ? this.scriptSource(f) : this.source(f);
-  var offset = full ? 0 : this.sourcePosition(f);
-  var locations = %GetBreakLocations(f);
-  if (!locations) return source;
-  locations.sort(function(x, y) { return x - y; });
-  var result = "";
-  var prev_pos = 0;
-  var pos;
-  for (var i = 0; i < locations.length; i++) {
-    pos = locations[i] - offset;
-    result += source.slice(prev_pos, pos);
-    result += "[B" + i + "]";
-    prev_pos = pos;
-  }
-  pos = source.length;
-  result += source.substring(prev_pos, pos);
-  return result;
-};
-
-
-// Get all the scripts currently loaded. Locating all the scripts is based on
-// scanning the heap.
-Debug.scripts = function() {
-  // Collect all scripts in the heap.
-  return %DebugGetLoadedScripts();
-};
-
-
-// Get a specific script currently loaded. This is based on scanning the heap.
-// TODO(clemensh): Create a runtime function for this.
-function scriptById(scriptId) {
-  var scripts = Debug.scripts();
-  for (var script of scripts) {
-    if (script.id == scriptId) return script;
-  }
-  return UNDEFINED;
-};
-
-
-Debug.debuggerFlags = function() {
-  return debugger_flags;
-};
-
-Debug.MakeMirror = MakeMirror;
-
-function MakeExecutionState(break_id) {
-  return new ExecutionState(break_id);
-}
-
-function ExecutionState(break_id) {
-  this.break_id = break_id;
-  this.selected_frame = 0;
-}
-
-ExecutionState.prototype.prepareStep = function(action) {
-  if (action === Debug.StepAction.StepIn ||
-      action === Debug.StepAction.StepOut ||
-      action === Debug.StepAction.StepNext) {
-    return %PrepareStep(this.break_id, action);
-  }
-  throw %make_type_error(kDebuggerType);
-};
-
-ExecutionState.prototype.evaluateGlobal = function(source) {
-  return MakeMirror(%DebugEvaluateGlobal(this.break_id, source));
-};
-
-ExecutionState.prototype.frameCount = function() {
-  return %GetFrameCount(this.break_id);
-};
-
-ExecutionState.prototype.frame = function(opt_index) {
-  // If no index supplied return the selected frame.
-  if (opt_index == null) opt_index = this.selected_frame;
-  if (opt_index < 0 || opt_index >= this.frameCount()) {
-    throw %make_type_error(kDebuggerFrame);
-  }
-  return new FrameMirror(this.break_id, opt_index);
-};
-
-ExecutionState.prototype.setSelectedFrame = function(index) {
-  var i = TO_NUMBER(index);
-  if (i < 0 || i >= this.frameCount()) {
-    throw %make_type_error(kDebuggerFrame);
-  }
-  this.selected_frame = i;
-};
-
-ExecutionState.prototype.selectedFrame = function() {
-  return this.selected_frame;
-};
-
-function MakeBreakEvent(break_id, break_points_hit) {
-  return new BreakEvent(break_id, break_points_hit);
-}
-
-
-function BreakEvent(break_id, break_points_hit) {
-  this.frame_ = new FrameMirror(break_id, 0);
-  this.break_points_hit_ = break_points_hit;
-}
-
-
-BreakEvent.prototype.eventType = function() {
-  return Debug.DebugEvent.Break;
-};
-
-
-BreakEvent.prototype.func = function() {
-  return this.frame_.func();
-};
-
-
-BreakEvent.prototype.sourceLine = function() {
-  return this.frame_.sourceLine();
-};
-
-
-BreakEvent.prototype.sourceColumn = function() {
-  return this.frame_.sourceColumn();
-};
-
-
-BreakEvent.prototype.sourceLineText = function() {
-  return this.frame_.sourceLineText();
-};
-
-
-BreakEvent.prototype.breakPointsHit = function() {
-  return this.break_points_hit_;
-};
-
-
-function MakeExceptionEvent(break_id, exception, uncaught, promise) {
-  return new ExceptionEvent(break_id, exception, uncaught, promise);
-}
-
-
-function ExceptionEvent(break_id, exception, uncaught, promise) {
-  this.exec_state_ = new ExecutionState(break_id);
-  this.exception_ = exception;
-  this.uncaught_ = uncaught;
-  this.promise_ = promise;
-}
-
-
-ExceptionEvent.prototype.eventType = function() {
-  return Debug.DebugEvent.Exception;
-};
-
-
-ExceptionEvent.prototype.exception = function() {
-  return this.exception_;
-};
-
-
-ExceptionEvent.prototype.uncaught = function() {
-  return this.uncaught_;
-};
-
-
-ExceptionEvent.prototype.promise = function() {
-  return this.promise_;
-};
-
-
-ExceptionEvent.prototype.func = function() {
-  return this.exec_state_.frame(0).func();
-};
-
-
-ExceptionEvent.prototype.sourceLine = function() {
-  return this.exec_state_.frame(0).sourceLine();
-};
-
-
-ExceptionEvent.prototype.sourceColumn = function() {
-  return this.exec_state_.frame(0).sourceColumn();
-};
-
-
-ExceptionEvent.prototype.sourceLineText = function() {
-  return this.exec_state_.frame(0).sourceLineText();
-};
-
-
-function MakeCompileEvent(script, type) {
-  return new CompileEvent(script, type);
-}
-
-
-function CompileEvent(script, type) {
-  this.script_ = MakeMirror(script);
-  this.type_ = type;
-}
-
-
-CompileEvent.prototype.eventType = function() {
-  return this.type_;
-};
-
-
-CompileEvent.prototype.script = function() {
-  return this.script_;
-};
-
-
-function MakeScriptObject_(script, include_source) {
-  var o = { id: script.id(),
-            name: script.name(),
-            lineOffset: script.lineOffset(),
-            columnOffset: script.columnOffset(),
-            lineCount: script.lineCount(),
-          };
-  if (!IS_UNDEFINED(script.data())) {
-    o.data = script.data();
-  }
-  if (include_source) {
-    o.source = script.source();
-  }
-  return o;
-}
-
-
-function MakeAsyncTaskEvent(type, id) {
-  return new AsyncTaskEvent(type, id);
-}
-
-
-function AsyncTaskEvent(type, id) {
-  this.type_ = type;
-  this.id_ = id;
-}
-
-
-AsyncTaskEvent.prototype.type = function() {
-  return this.type_;
-}
-
-
-AsyncTaskEvent.prototype.id = function() {
-  return this.id_;
-}
-
-// -------------------------------------------------------------------
-// Exports
-
-utils.InstallConstants(global, [
-  "Debug", Debug,
-  "BreakEvent", BreakEvent,
-  "CompileEvent", CompileEvent,
-  "BreakPoint", BreakPoint,
-]);
-
-// Functions needed by the debugger runtime.
-utils.InstallConstants(utils, [
-  "MakeExecutionState", MakeExecutionState,
-  "MakeExceptionEvent", MakeExceptionEvent,
-  "MakeBreakEvent", MakeBreakEvent,
-  "MakeCompileEvent", MakeCompileEvent,
-  "MakeAsyncTaskEvent", MakeAsyncTaskEvent,
-  "IsBreakPointTriggered", IsBreakPointTriggered,
-]);
-
-})
diff --git a/src/v8/src/debug/liveedit.js b/src/v8/src/debug/liveedit.js
deleted file mode 100644
index 6c68e52..0000000
--- a/src/v8/src/debug/liveedit.js
+++ /dev/null
@@ -1,1058 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// LiveEdit feature implementation. The script should be executed after
-// debug.js.
-
-// A LiveEdit namespace. It contains functions that modifies JavaScript code
-// according to changes of script source (if possible).
-//
-// When new script source is put in, the difference is calculated textually,
-// in form of list of delete/add/change chunks. The functions that include
-// change chunk(s) get recompiled, or their enclosing functions are
-// recompiled instead.
-// If the function may not be recompiled (e.g. it was completely erased in new
-// version of the script) it remains unchanged, but the code that could
-// create a new instance of this function goes away. An old version of script
-// is created to back up this obsolete function.
-// All unchanged functions have their positions updated accordingly.
-//
-// LiveEdit namespace is declared inside a single function constructor.
-
-(function(global, utils) {
-  "use strict";
-
-  // -------------------------------------------------------------------
-  // Imports
-
-  var FindScriptSourcePosition = global.Debug.findScriptSourcePosition;
-  var GlobalArray = global.Array;
-  var MathFloor = global.Math.floor;
-  var MathMax = global.Math.max;
-  var SyntaxError = global.SyntaxError;
-
-  // -------------------------------------------------------------------
-
-  // Forward declaration for minifier.
-  var FunctionStatus;
-
-  // Applies the change to the script.
-  // The change is in form of list of chunks encoded in a single array as
-  // a series of triplets (pos1_start, pos1_end, pos2_end)
-  function ApplyPatchMultiChunk(script, diff_array, new_source, preview_only,
-      change_log) {
-
-    var old_source = script.source;
-
-    // Gather compile information about old version of script.
-    var old_compile_info = GatherCompileInfo(old_source, script);
-
-    // Build tree structures for old and new versions of the script.
-    var root_old_node = BuildCodeInfoTree(old_compile_info);
-
-    var pos_translator = new PosTranslator(diff_array);
-
-    // Analyze changes.
-    MarkChangedFunctions(root_old_node, pos_translator.GetChunks());
-
-    // Find all SharedFunctionInfo's that were compiled from this script.
-    FindLiveSharedInfos(root_old_node, script);
-
-    // Gather compile information about new version of script.
-    var new_compile_info;
-    try {
-      new_compile_info = GatherCompileInfo(new_source, script);
-    } catch (e) {
-      var failure =
-          new Failure("Failed to compile new version of script: " + e);
-      if (e instanceof SyntaxError) {
-        var details = {
-          type: "liveedit_compile_error",
-          syntaxErrorMessage: e.message
-        };
-        CopyErrorPositionToDetails(e, details);
-        failure.details = details;
-      }
-      throw failure;
-    }
-
-    var max_function_literal_id = new_compile_info.reduce(
-        (max, info) => MathMax(max, info.function_literal_id), 0);
-
-    var root_new_node = BuildCodeInfoTree(new_compile_info);
-
-    // Link recompiled script data with other data.
-    FindCorrespondingFunctions(root_old_node, root_new_node);
-
-    // Prepare to-do lists.
-    var replace_code_list = new GlobalArray();
-    var link_to_old_script_list = new GlobalArray();
-    var link_to_original_script_list = new GlobalArray();
-    var update_positions_list = new GlobalArray();
-
-    function HarvestTodo(old_node) {
-      function CollectDamaged(node) {
-        link_to_old_script_list.push(node);
-        for (var i = 0; i < node.children.length; i++) {
-          CollectDamaged(node.children[i]);
-        }
-      }
-
-      // Recursively collects all newly compiled functions that are going into
-      // business and should have link to the actual script updated.
-      function CollectNew(node_list) {
-        for (var i = 0; i < node_list.length; i++) {
-          link_to_original_script_list.push(node_list[i]);
-          CollectNew(node_list[i].children);
-        }
-      }
-
-      if (old_node.status == FunctionStatus.DAMAGED) {
-        CollectDamaged(old_node);
-        return;
-      }
-      if (old_node.status == FunctionStatus.UNCHANGED) {
-        update_positions_list.push(old_node);
-      } else if (old_node.status == FunctionStatus.SOURCE_CHANGED) {
-        update_positions_list.push(old_node);
-      } else if (old_node.status == FunctionStatus.CHANGED) {
-        replace_code_list.push(old_node);
-        CollectNew(old_node.unmatched_new_nodes);
-      }
-      for (var i = 0; i < old_node.children.length; i++) {
-        HarvestTodo(old_node.children[i]);
-      }
-    }
-
-    var preview_description = {
-        change_tree: DescribeChangeTree(root_old_node),
-        textual_diff: {
-          old_len: old_source.length,
-          new_len: new_source.length,
-          chunks: diff_array
-        },
-        updated: false
-    };
-
-    if (preview_only) {
-      return preview_description;
-    }
-
-    HarvestTodo(root_old_node);
-
-    // Collect shared infos for functions whose code need to be patched.
-    var replaced_function_old_infos = new GlobalArray();
-    var replaced_function_new_infos = new GlobalArray();
-    for (var i = 0; i < replace_code_list.length; i++) {
-      var old_infos = replace_code_list[i].live_shared_function_infos;
-      var new_info =
-          replace_code_list[i].corresponding_node.info.shared_function_info;
-
-      if (old_infos) {
-        for (var j = 0; j < old_infos.length; j++) {
-          replaced_function_old_infos.push(old_infos[j]);
-          replaced_function_new_infos.push(new_info);
-        }
-      }
-    }
-
-    // We haven't changed anything before this line yet.
-    // Committing all changes.
-
-    // Check that function being patched is not currently on stack or drop them.
-    var dropped_functions_number =
-        CheckStackActivations(replaced_function_old_infos,
-                              replaced_function_new_infos,
-                              change_log);
-
-    // Our current implementation requires client to manually issue "step in"
-    // command for correct stack state if the stack was modified.
-    preview_description.stack_modified = dropped_functions_number != 0;
-
-    var old_script;
-
-    // Create an old script only if there are function that should be linked
-    // to old version.
-    if (link_to_old_script_list.length == 0) {
-      %LiveEditReplaceScript(script, new_source, null);
-      old_script = UNDEFINED;
-    } else {
-      var old_script_name = CreateNameForOldScript(script);
-
-      // Update the script text and create a new script representing an old
-      // version of the script.
-      old_script = %LiveEditReplaceScript(script, new_source, old_script_name);
-
-      var link_to_old_script_report = new GlobalArray();
-      change_log.push( { linked_to_old_script: link_to_old_script_report } );
-
-      // We need to link to old script all former nested functions.
-      for (var i = 0; i < link_to_old_script_list.length; i++) {
-        LinkToOldScript(link_to_old_script_list[i], old_script,
-            link_to_old_script_report);
-      }
-
-      preview_description.created_script_name = old_script_name;
-    }
-
-    for (var i = 0; i < replace_code_list.length; i++) {
-      PatchFunctionCode(replace_code_list[i], change_log);
-    }
-
-    var position_patch_report = new GlobalArray();
-    change_log.push( {position_patched: position_patch_report} );
-
-    for (var i = 0; i < update_positions_list.length; i++) {
-      // TODO(LiveEdit): take into account whether it's source_changed or
-      // unchanged and whether positions changed at all.
-      PatchPositions(update_positions_list[i], diff_array,
-          position_patch_report);
-
-      if (update_positions_list[i].live_shared_function_infos) {
-        var new_function_literal_id =
-            update_positions_list[i]
-                .corresponding_node.info.function_literal_id;
-        update_positions_list[i].live_shared_function_infos.forEach(function(
-            info) {
-          %LiveEditFunctionSourceUpdated(
-              info.raw_array, new_function_literal_id);
-        });
-      }
-    }
-
-    %LiveEditFixupScript(script, max_function_literal_id);
-
-    // Link all the functions we're going to use to an actual script.
-    for (var i = 0; i < link_to_original_script_list.length; i++) {
-      %LiveEditFunctionSetScript(
-          link_to_original_script_list[i].info.shared_function_info, script);
-    }
-
-    preview_description.updated = true;
-    return preview_description;
-  }
-
-  // Fully compiles source string as a script. Returns Array of
-  // FunctionCompileInfo -- a descriptions of all functions of the script.
-  // Elements of array are ordered by start positions of functions (from top
-  // to bottom) in the source. Fields outer_index and next_sibling_index help
-  // to navigate the nesting structure of functions.
-  //
-  // All functions get compiled linked to script provided as parameter script.
-  // TODO(LiveEdit): consider not using actual scripts as script, because
-  // we have to manually erase all links right after compile.
-  function GatherCompileInfo(source, script) {
-    // Get function info, elements are partially sorted (it is a tree of
-    // nested functions serialized as parent followed by serialized children.
-    var raw_compile_info = %LiveEditGatherCompileInfo(script, source);
-
-    // Sort function infos by start position field.
-    var compile_info = new GlobalArray();
-    var old_index_map = new GlobalArray();
-    for (var i = 0; i < raw_compile_info.length; i++) {
-      var info = new FunctionCompileInfo(raw_compile_info[i]);
-      // Remove all links to the actual script. Breakpoints system and
-      // LiveEdit itself believe that any function in heap that points to a
-      // particular script is a regular function.
-      // For some functions we will restore this link later.
-      %LiveEditFunctionSetScript(info.shared_function_info, UNDEFINED);
-      compile_info.push(info);
-      old_index_map.push(i);
-    }
-
-    for (var i = 0; i < compile_info.length; i++) {
-      var k = i;
-      for (var j = i + 1; j < compile_info.length; j++) {
-        if (compile_info[k].start_position > compile_info[j].start_position) {
-          k = j;
-        }
-      }
-      if (k != i) {
-        var temp_info = compile_info[k];
-        var temp_index = old_index_map[k];
-        compile_info[k] = compile_info[i];
-        old_index_map[k] = old_index_map[i];
-        compile_info[i] = temp_info;
-        old_index_map[i] = temp_index;
-      }
-    }
-
-    // After sorting update outer_index field using old_index_map. Also
-    // set next_sibling_index field.
-    var current_index = 0;
-
-    // The recursive function, that goes over all children of a particular
-    // node (i.e. function info).
-    function ResetIndexes(new_parent_index, old_parent_index) {
-      var previous_sibling = -1;
-      while (current_index < compile_info.length &&
-          compile_info[current_index].outer_index == old_parent_index) {
-        var saved_index = current_index;
-        compile_info[saved_index].outer_index = new_parent_index;
-        if (previous_sibling != -1) {
-          compile_info[previous_sibling].next_sibling_index = saved_index;
-        }
-        previous_sibling = saved_index;
-        current_index++;
-        ResetIndexes(saved_index, old_index_map[saved_index]);
-      }
-      if (previous_sibling != -1) {
-        compile_info[previous_sibling].next_sibling_index = -1;
-      }
-    }
-
-    ResetIndexes(-1, -1);
-    Assert(current_index == compile_info.length);
-
-    return compile_info;
-  }
-
-
-  // Replaces function's Code.
-  function PatchFunctionCode(old_node, change_log) {
-    var new_info = old_node.corresponding_node.info;
-    if (old_node.live_shared_function_infos) {
-      old_node.live_shared_function_infos.forEach(function (old_info) {
-        %LiveEditReplaceFunctionCode(new_info.raw_array,
-                                     old_info.raw_array);
-
-        // The function got a new code. However, this new code brings all new
-        // instances of SharedFunctionInfo for nested functions. However,
-        // we want the original instances to be used wherever possible.
-        // (This is because old instances and new instances will be both
-        // linked to a script and breakpoints subsystem does not really
-        // expects this; neither does LiveEdit subsystem on next call).
-        for (var i = 0; i < old_node.children.length; i++) {
-          if (old_node.children[i].corresponding_node) {
-            var corresponding_child_info =
-                old_node.children[i].corresponding_node.info.
-                    shared_function_info;
-
-            if (old_node.children[i].live_shared_function_infos) {
-              old_node.children[i].live_shared_function_infos.
-                  forEach(function (old_child_info) {
-                    %LiveEditReplaceRefToNestedFunction(
-                        old_info.info,
-                        corresponding_child_info,
-                        old_child_info.info);
-                  });
-            }
-          }
-        }
-      });
-
-      change_log.push( {function_patched: new_info.function_name} );
-    } else {
-      change_log.push( {function_patched: new_info.function_name,
-          function_info_not_found: true} );
-    }
-  }
-
-
-  // Makes a function associated with another instance of a script (the
-  // one representing its old version). This way the function still
-  // may access its own text.
-  function LinkToOldScript(old_info_node, old_script, report_array) {
-    if (old_info_node.live_shared_function_infos) {
-      old_info_node.live_shared_function_infos.
-          forEach(function (info) {
-            %LiveEditFunctionSetScript(info.info, old_script);
-          });
-
-      report_array.push( { name: old_info_node.info.function_name } );
-    } else {
-      report_array.push(
-          { name: old_info_node.info.function_name, not_found: true } );
-    }
-  }
-
-  function Assert(condition, message) {
-    if (!condition) {
-      if (message) {
-        throw "Assert " + message;
-      } else {
-        throw "Assert";
-      }
-    }
-  }
-
-  function DiffChunk(pos1, pos2, len1, len2) {
-    this.pos1 = pos1;
-    this.pos2 = pos2;
-    this.len1 = len1;
-    this.len2 = len2;
-  }
-
-  function PosTranslator(diff_array) {
-    var chunks = new GlobalArray();
-    var current_diff = 0;
-    for (var i = 0; i < diff_array.length; i += 3) {
-      var pos1_begin = diff_array[i];
-      var pos2_begin = pos1_begin + current_diff;
-      var pos1_end = diff_array[i + 1];
-      var pos2_end = diff_array[i + 2];
-      chunks.push(new DiffChunk(pos1_begin, pos2_begin, pos1_end - pos1_begin,
-          pos2_end - pos2_begin));
-      current_diff = pos2_end - pos1_end;
-    }
-    this.chunks = chunks;
-  }
-  PosTranslator.prototype.GetChunks = function() {
-    return this.chunks;
-  };
-
-  PosTranslator.prototype.Translate = function(pos, inside_chunk_handler) {
-    var array = this.chunks;
-    if (array.length == 0 || pos < array[0].pos1) {
-      return pos;
-    }
-    var chunk_index1 = 0;
-    var chunk_index2 = array.length - 1;
-
-    while (chunk_index1 < chunk_index2) {
-      var middle_index = MathFloor((chunk_index1 + chunk_index2) / 2);
-      if (pos < array[middle_index + 1].pos1) {
-        chunk_index2 = middle_index;
-      } else {
-        chunk_index1 = middle_index + 1;
-      }
-    }
-    var chunk = array[chunk_index1];
-    if (pos >= chunk.pos1 + chunk.len1) {
-      return pos + chunk.pos2 + chunk.len2 - chunk.pos1 - chunk.len1;
-    }
-
-    if (!inside_chunk_handler) {
-      inside_chunk_handler = PosTranslator.DefaultInsideChunkHandler;
-    }
-    return inside_chunk_handler(pos, chunk);
-  };
-
-  PosTranslator.DefaultInsideChunkHandler = function(pos, diff_chunk) {
-    Assert(false, "Cannot translate position in changed area");
-  };
-
-  PosTranslator.ShiftWithTopInsideChunkHandler =
-      function(pos, diff_chunk) {
-    // We carelessly do not check whether we stay inside the chunk after
-    // translation.
-    return pos - diff_chunk.pos1 + diff_chunk.pos2;
-  };
-
-  var FunctionStatus = {
-      // No change to function or its inner functions; however its positions
-      // in script may have been shifted.
-      UNCHANGED: "unchanged",
-      // The code of a function remains unchanged, but something happened inside
-      // some inner functions.
-      SOURCE_CHANGED: "source changed",
-      // The code of a function is changed or some nested function cannot be
-      // properly patched so this function must be recompiled.
-      CHANGED: "changed",
-      // Function is changed but cannot be patched.
-      DAMAGED: "damaged"
-  };
-
-  function CodeInfoTreeNode(code_info, children, array_index) {
-    this.info = code_info;
-    this.children = children;
-    // an index in array of compile_info
-    this.array_index = array_index;
-    this.parent = UNDEFINED;
-
-    this.status = FunctionStatus.UNCHANGED;
-    // Status explanation is used for debugging purposes and will be shown
-    // in user UI if some explanations are needed.
-    this.status_explanation = UNDEFINED;
-    this.new_start_pos = UNDEFINED;
-    this.new_end_pos = UNDEFINED;
-    this.corresponding_node = UNDEFINED;
-    this.unmatched_new_nodes = UNDEFINED;
-
-    // 'Textual' correspondence/matching is weaker than 'pure'
-    // correspondence/matching. We need 'textual' level for visual presentation
-    // in UI, we use 'pure' level for actual code manipulation.
-    // Sometimes only function body is changed (functions in old and new script
-    // textually correspond), but we cannot patch the code, so we see them
-    // as an old function deleted and new function created.
-    this.textual_corresponding_node = UNDEFINED;
-    this.textually_unmatched_new_nodes = UNDEFINED;
-
-    this.live_shared_function_infos = UNDEFINED;
-  }
-
-  // From array of function infos that is implicitly a tree creates
-  // an actual tree of functions in script.
-  function BuildCodeInfoTree(code_info_array) {
-    // Throughtout all function we iterate over input array.
-    var index = 0;
-
-    // Recursive function that builds a branch of tree.
-    function BuildNode() {
-      var my_index = index;
-      index++;
-      var child_array = new GlobalArray();
-      while (index < code_info_array.length &&
-          code_info_array[index].outer_index == my_index) {
-        child_array.push(BuildNode());
-      }
-      var node = new CodeInfoTreeNode(code_info_array[my_index], child_array,
-          my_index);
-      for (var i = 0; i < child_array.length; i++) {
-        child_array[i].parent = node;
-      }
-      return node;
-    }
-
-    var root = BuildNode();
-    Assert(index == code_info_array.length);
-    return root;
-  }
-
-  // Applies a list of the textual diff chunks onto the tree of functions.
-  // Determines status of each function (from unchanged to damaged). However
-  // children of unchanged functions are ignored.
-  function MarkChangedFunctions(code_info_tree, chunks) {
-
-    // A convenient iterator over diff chunks that also translates
-    // positions from old to new in a current non-changed part of script.
-    var chunk_it = new function() {
-      var chunk_index = 0;
-      var pos_diff = 0;
-      this.current = function() { return chunks[chunk_index]; };
-      this.next = function() {
-        var chunk = chunks[chunk_index];
-        pos_diff = chunk.pos2 + chunk.len2 - (chunk.pos1 + chunk.len1);
-        chunk_index++;
-      };
-      this.done = function() { return chunk_index >= chunks.length; };
-      this.TranslatePos = function(pos) { return pos + pos_diff; };
-    };
-
-    // A recursive function that processes internals of a function and all its
-    // inner functions. Iterator chunk_it initially points to a chunk that is
-    // below function start.
-    function ProcessInternals(info_node) {
-      info_node.new_start_pos = chunk_it.TranslatePos(
-          info_node.info.start_position);
-      var child_index = 0;
-      var code_changed = false;
-      var source_changed = false;
-      // Simultaneously iterates over child functions and over chunks.
-      while (!chunk_it.done() &&
-          chunk_it.current().pos1 < info_node.info.end_position) {
-        if (child_index < info_node.children.length) {
-          var child = info_node.children[child_index];
-
-          if (child.info.end_position <= chunk_it.current().pos1) {
-            ProcessUnchangedChild(child);
-            child_index++;
-            continue;
-          } else if (child.info.start_position >=
-              chunk_it.current().pos1 + chunk_it.current().len1) {
-            code_changed = true;
-            chunk_it.next();
-            continue;
-          } else if (child.info.start_position <= chunk_it.current().pos1 &&
-              child.info.end_position >= chunk_it.current().pos1 +
-              chunk_it.current().len1) {
-            ProcessInternals(child);
-            source_changed = source_changed ||
-                ( child.status != FunctionStatus.UNCHANGED );
-            code_changed = code_changed ||
-                ( child.status == FunctionStatus.DAMAGED );
-            child_index++;
-            continue;
-          } else {
-            code_changed = true;
-            child.status = FunctionStatus.DAMAGED;
-            child.status_explanation =
-                "Text diff overlaps with function boundary";
-            child_index++;
-            continue;
-          }
-        } else {
-          if (chunk_it.current().pos1 + chunk_it.current().len1 <=
-              info_node.info.end_position) {
-            info_node.status = FunctionStatus.CHANGED;
-            chunk_it.next();
-            continue;
-          } else {
-            info_node.status = FunctionStatus.DAMAGED;
-            info_node.status_explanation =
-                "Text diff overlaps with function boundary";
-            return;
-          }
-        }
-        Assert("Unreachable", false);
-      }
-      while (child_index < info_node.children.length) {
-        var child = info_node.children[child_index];
-        ProcessUnchangedChild(child);
-        child_index++;
-      }
-      if (code_changed) {
-        info_node.status = FunctionStatus.CHANGED;
-      } else if (source_changed) {
-        info_node.status = FunctionStatus.SOURCE_CHANGED;
-      }
-      info_node.new_end_pos =
-          chunk_it.TranslatePos(info_node.info.end_position);
-    }
-
-    function ProcessUnchangedChild(node) {
-      node.new_start_pos = chunk_it.TranslatePos(node.info.start_position);
-      node.new_end_pos = chunk_it.TranslatePos(node.info.end_position);
-    }
-
-    ProcessInternals(code_info_tree);
-  }
-
-  // For each old function (if it is not damaged) tries to find a corresponding
-  // function in new script. Typically it should succeed (non-damaged functions
-  // by definition may only have changes inside their bodies). However there are
-  // reasons for correspondence not to be found; function with unmodified text
-  // in new script may become enclosed into other function; the innocent change
-  // inside function body may in fact be something like "} function B() {" that
-  // splits a function into 2 functions.
-  function FindCorrespondingFunctions(old_code_tree, new_code_tree) {
-
-    // A recursive function that tries to find a correspondence for all
-    // child functions and for their inner functions.
-    function ProcessNode(old_node, new_node) {
-      var scope_change_description =
-          IsFunctionContextLocalsChanged(old_node.info, new_node.info);
-      if (scope_change_description) {
-        old_node.status = FunctionStatus.CHANGED;
-      }
-
-      var old_children = old_node.children;
-      var new_children = new_node.children;
-
-      var unmatched_new_nodes_list = [];
-      var textually_unmatched_new_nodes_list = [];
-
-      var old_index = 0;
-      var new_index = 0;
-      while (old_index < old_children.length) {
-        if (old_children[old_index].status == FunctionStatus.DAMAGED) {
-          old_index++;
-        } else if (new_index < new_children.length) {
-          if (new_children[new_index].info.start_position <
-              old_children[old_index].new_start_pos) {
-            unmatched_new_nodes_list.push(new_children[new_index]);
-            textually_unmatched_new_nodes_list.push(new_children[new_index]);
-            new_index++;
-          } else if (new_children[new_index].info.start_position ==
-              old_children[old_index].new_start_pos) {
-            if (new_children[new_index].info.end_position ==
-                old_children[old_index].new_end_pos) {
-              old_children[old_index].corresponding_node =
-                  new_children[new_index];
-              old_children[old_index].textual_corresponding_node =
-                  new_children[new_index];
-              if (scope_change_description) {
-                old_children[old_index].status = FunctionStatus.DAMAGED;
-                old_children[old_index].status_explanation =
-                    "Enclosing function is now incompatible. " +
-                    scope_change_description;
-                old_children[old_index].corresponding_node = UNDEFINED;
-              } else if (old_children[old_index].status !=
-                  FunctionStatus.UNCHANGED) {
-                ProcessNode(old_children[old_index],
-                    new_children[new_index]);
-                if (old_children[old_index].status == FunctionStatus.DAMAGED) {
-                  unmatched_new_nodes_list.push(
-                      old_children[old_index].corresponding_node);
-                  old_children[old_index].corresponding_node = UNDEFINED;
-                  old_node.status = FunctionStatus.CHANGED;
-                }
-              } else {
-                ProcessNode(old_children[old_index], new_children[new_index]);
-              }
-            } else {
-              old_children[old_index].status = FunctionStatus.DAMAGED;
-              old_children[old_index].status_explanation =
-                  "No corresponding function in new script found";
-              old_node.status = FunctionStatus.CHANGED;
-              unmatched_new_nodes_list.push(new_children[new_index]);
-              textually_unmatched_new_nodes_list.push(new_children[new_index]);
-            }
-            new_index++;
-            old_index++;
-          } else {
-            old_children[old_index].status = FunctionStatus.DAMAGED;
-            old_children[old_index].status_explanation =
-                "No corresponding function in new script found";
-            old_node.status = FunctionStatus.CHANGED;
-            old_index++;
-          }
-        } else {
-          old_children[old_index].status = FunctionStatus.DAMAGED;
-          old_children[old_index].status_explanation =
-              "No corresponding function in new script found";
-          old_node.status = FunctionStatus.CHANGED;
-          old_index++;
-        }
-      }
-
-      while (new_index < new_children.length) {
-        unmatched_new_nodes_list.push(new_children[new_index]);
-        textually_unmatched_new_nodes_list.push(new_children[new_index]);
-        new_index++;
-      }
-
-      if (old_node.status == FunctionStatus.CHANGED) {
-        if (old_node.info.param_num != new_node.info.param_num) {
-          old_node.status = FunctionStatus.DAMAGED;
-          old_node.status_explanation = "Changed parameter number: " +
-              old_node.info.param_num + " and " + new_node.info.param_num;
-        }
-      }
-      old_node.unmatched_new_nodes = unmatched_new_nodes_list;
-      old_node.textually_unmatched_new_nodes =
-          textually_unmatched_new_nodes_list;
-    }
-
-    ProcessNode(old_code_tree, new_code_tree);
-
-    old_code_tree.corresponding_node = new_code_tree;
-    old_code_tree.textual_corresponding_node = new_code_tree;
-
-    Assert(old_code_tree.status != FunctionStatus.DAMAGED,
-        "Script became damaged");
-  }
-
-  function FindLiveSharedInfos(old_code_tree, script) {
-    var shared_raw_list = %LiveEditFindSharedFunctionInfosForScript(script);
-
-    var shared_infos = new GlobalArray();
-
-    for (var i = 0; i < shared_raw_list.length; i++) {
-      shared_infos.push(new SharedInfoWrapper(shared_raw_list[i]));
-    }
-
-    // Finds all SharedFunctionInfos that corresponds to compile info
-    // in old version of the script.
-    function FindFunctionInfos(compile_info) {
-      var wrappers = [];
-
-      for (var i = 0; i < shared_infos.length; i++) {
-        var wrapper = shared_infos[i];
-        if (wrapper.start_position == compile_info.start_position &&
-            wrapper.end_position == compile_info.end_position) {
-          wrappers.push(wrapper);
-        }
-      }
-
-      if (wrappers.length > 0) {
-        return wrappers;
-      }
-    }
-
-    function TraverseTree(node) {
-      node.live_shared_function_infos = FindFunctionInfos(node.info);
-
-      for (var i = 0; i < node.children.length; i++) {
-        TraverseTree(node.children[i]);
-      }
-    }
-
-    TraverseTree(old_code_tree);
-  }
-
-
-  // An object describing function compilation details. Its index fields
-  // apply to indexes inside array that stores these objects.
-  function FunctionCompileInfo(raw_array) {
-    this.function_name = raw_array[0];
-    this.start_position = raw_array[1];
-    this.end_position = raw_array[2];
-    this.param_num = raw_array[3];
-    this.scope_info = raw_array[4];
-    this.outer_index = raw_array[5];
-    this.shared_function_info = raw_array[6];
-    this.function_literal_id = raw_array[7];
-    this.next_sibling_index = null;
-    this.raw_array = raw_array;
-  }
-
-  function SharedInfoWrapper(raw_array) {
-    this.function_name = raw_array[0];
-    this.start_position = raw_array[1];
-    this.end_position = raw_array[2];
-    this.info = raw_array[3];
-    this.raw_array = raw_array;
-  }
-
-  // Changes positions (including all statements) in function.
-  function PatchPositions(old_info_node, diff_array, report_array) {
-    if (old_info_node.live_shared_function_infos) {
-      old_info_node.live_shared_function_infos.forEach(function (info) {
-          %LiveEditPatchFunctionPositions(info.raw_array,
-                                          diff_array);
-      });
-
-      report_array.push( { name: old_info_node.info.function_name } );
-    } else {
-      // TODO(LiveEdit): function is not compiled yet or is already collected.
-      report_array.push(
-          { name: old_info_node.info.function_name, info_not_found: true } );
-    }
-  }
-
-  // Adds a suffix to script name to mark that it is old version.
-  function CreateNameForOldScript(script) {
-    // TODO(635): try better than this; support several changes.
-    return script.name + " (old)";
-  }
-
-  // Compares a function scope heap structure, old and new version, whether it
-  // changed or not. Returns explanation if they differ.
-  function IsFunctionContextLocalsChanged(function_info1, function_info2) {
-    var scope_info1 = function_info1.scope_info;
-    var scope_info2 = function_info2.scope_info;
-
-    var scope_info1_text;
-    var scope_info2_text;
-
-    if (scope_info1) {
-      scope_info1_text = scope_info1.toString();
-    } else {
-      scope_info1_text = "";
-    }
-    if (scope_info2) {
-      scope_info2_text = scope_info2.toString();
-    } else {
-      scope_info2_text = "";
-    }
-
-    if (scope_info1_text != scope_info2_text) {
-      return "Variable map changed: [" + scope_info1_text +
-          "] => [" + scope_info2_text + "]";
-    }
-    // No differences. Return undefined.
-    return;
-  }
-
-  // Minifier forward declaration.
-  var FunctionPatchabilityStatus;
-
-  // For array of wrapped shared function infos checks that none of them
-  // have activations on stack (of any thread). Throws a Failure exception
-  // if this proves to be false.
-  function CheckStackActivations(old_shared_wrapper_list,
-                                 new_shared_list,
-                                 change_log) {
-    var old_shared_list = new GlobalArray();
-    for (var i = 0; i < old_shared_wrapper_list.length; i++) {
-      old_shared_list[i] = old_shared_wrapper_list[i].info;
-    }
-    var result = %LiveEditCheckAndDropActivations(
-                     old_shared_list, new_shared_list, true);
-    if (result[old_shared_wrapper_list.length]) {
-      // Extra array element may contain error message.
-      throw new Failure(result[old_shared_wrapper_list.length]);
-    }
-
-    var problems = new GlobalArray();
-    var dropped = new GlobalArray();
-    for (var i = 0; i < old_shared_list.length; i++) {
-      var shared = old_shared_wrapper_list[i];
-      if (result[i] == FunctionPatchabilityStatus.REPLACED_ON_ACTIVE_STACK) {
-        dropped.push({ name: shared.function_name } );
-      } else if (result[i] != FunctionPatchabilityStatus.AVAILABLE_FOR_PATCH) {
-        var description = {
-            name: shared.function_name,
-            start_pos: shared.start_position,
-            end_pos: shared.end_position,
-            replace_problem:
-                FunctionPatchabilityStatus.SymbolName(result[i])
-        };
-        problems.push(description);
-      }
-    }
-    if (dropped.length > 0) {
-      change_log.push({ dropped_from_stack: dropped });
-    }
-    if (problems.length > 0) {
-      change_log.push( { functions_on_stack: problems } );
-      throw new Failure("Blocked by functions on stack");
-    }
-
-    return dropped.length;
-  }
-
-  // A copy of the FunctionPatchabilityStatus enum from liveedit.h
-  var FunctionPatchabilityStatus = {
-      AVAILABLE_FOR_PATCH: 1,
-      BLOCKED_ON_ACTIVE_STACK: 2,
-      BLOCKED_ON_OTHER_STACK: 3,
-      BLOCKED_UNDER_NATIVE_CODE: 4,
-      REPLACED_ON_ACTIVE_STACK: 5,
-      BLOCKED_UNDER_GENERATOR: 6,
-      BLOCKED_ACTIVE_GENERATOR: 7,
-      BLOCKED_NO_NEW_TARGET_ON_RESTART: 8
-  };
-
-  FunctionPatchabilityStatus.SymbolName = function(code) {
-    var enumeration = FunctionPatchabilityStatus;
-    for (var name in enumeration) {
-      if (enumeration[name] == code) {
-        return name;
-      }
-    }
-  };
-
-
-  // A logical failure in liveedit process. This means that change_log
-  // is valid and consistent description of what happened.
-  function Failure(message) {
-    this.message = message;
-  }
-
-  Failure.prototype.toString = function() {
-    return "LiveEdit Failure: " + this.message;
-  };
-
-  function CopyErrorPositionToDetails(e, details) {
-    function createPositionStruct(script, position) {
-      if (position == -1) return;
-      var location = script.locationFromPosition(position, true);
-      if (location == null) return;
-      return {
-        line: location.line + 1,
-        column: location.column + 1,
-        position: position
-      };
-    }
-
-    if (!("scriptObject" in e) || !("startPosition" in e)) {
-      return;
-    }
-
-    var script = e.scriptObject;
-
-    var position_struct = {
-      start: createPositionStruct(script, e.startPosition),
-      end: createPositionStruct(script, e.endPosition)
-    };
-    details.position = position_struct;
-  }
-
-  // LiveEdit main entry point: changes a script text to a new string.
-  function SetScriptSource(script, new_source, preview_only, change_log) {
-    var old_source = script.source;
-    var diff = CompareStrings(old_source, new_source);
-    return ApplyPatchMultiChunk(script, diff, new_source, preview_only,
-        change_log);
-  }
-
-  function CompareStrings(s1, s2) {
-    return %LiveEditCompareStrings(s1, s2);
-  }
-
-  // Applies the change to the script.
-  // The change is always a substring (change_pos, change_pos + change_len)
-  // being replaced with a completely different string new_str.
-  // This API is a legacy and is obsolete.
-  //
-  // @param {Script} script that is being changed
-  // @param {Array} change_log a list that collects engineer-readable
-  //     description of what happened.
-  function ApplySingleChunkPatch(script, change_pos, change_len, new_str,
-      change_log) {
-    var old_source = script.source;
-
-    // Prepare new source string.
-    var new_source = old_source.substring(0, change_pos) +
-        new_str + old_source.substring(change_pos + change_len);
-
-    return ApplyPatchMultiChunk(script,
-        [ change_pos, change_pos + change_len, change_pos + new_str.length],
-        new_source, false, change_log);
-  }
-
-  // Creates JSON description for a change tree.
-  function DescribeChangeTree(old_code_tree) {
-
-    function ProcessOldNode(node) {
-      var child_infos = [];
-      for (var i = 0; i < node.children.length; i++) {
-        var child = node.children[i];
-        if (child.status != FunctionStatus.UNCHANGED) {
-          child_infos.push(ProcessOldNode(child));
-        }
-      }
-      var new_child_infos = [];
-      if (node.textually_unmatched_new_nodes) {
-        for (var i = 0; i < node.textually_unmatched_new_nodes.length; i++) {
-          var child = node.textually_unmatched_new_nodes[i];
-          new_child_infos.push(ProcessNewNode(child));
-        }
-      }
-      var res = {
-        name: node.info.function_name,
-        positions: DescribePositions(node),
-        status: node.status,
-        children: child_infos,
-        new_children: new_child_infos
-      };
-      if (node.status_explanation) {
-        res.status_explanation = node.status_explanation;
-      }
-      if (node.textual_corresponding_node) {
-        res.new_positions = DescribePositions(node.textual_corresponding_node);
-      }
-      return res;
-    }
-
-    function ProcessNewNode(node) {
-      var child_infos = [];
-      // Do not list ancestors.
-      if (false) {
-        for (var i = 0; i < node.children.length; i++) {
-          child_infos.push(ProcessNewNode(node.children[i]));
-        }
-      }
-      var res = {
-        name: node.info.function_name,
-        positions: DescribePositions(node),
-        children: child_infos,
-      };
-      return res;
-    }
-
-    function DescribePositions(node) {
-      return {
-        start_position: node.info.start_position,
-        end_position: node.info.end_position
-      };
-    }
-
-    return ProcessOldNode(old_code_tree);
-  }
-
-  // -------------------------------------------------------------------
-  // Exports
-
-  var LiveEdit = {};
-  LiveEdit.SetScriptSource = SetScriptSource;
-  LiveEdit.ApplyPatchMultiChunk = ApplyPatchMultiChunk;
-  LiveEdit.Failure = Failure;
-
-  LiveEdit.TestApi = {
-    PosTranslator: PosTranslator,
-    CompareStrings: CompareStrings,
-    ApplySingleChunkPatch: ApplySingleChunkPatch
-  };
-
-  // Functions needed by the debugger runtime.
-  utils.InstallConstants(utils, [
-    "SetScriptSource", LiveEdit.SetScriptSource,
-  ]);
-
-  global.Debug.LiveEdit = LiveEdit;
-
-})
diff --git a/src/v8/src/debug/mirrors.js b/src/v8/src/debug/mirrors.js
deleted file mode 100644
index 15d5e64..0000000
--- a/src/v8/src/debug/mirrors.js
+++ /dev/null
@@ -1,2439 +0,0 @@
-// Copyright 2006-2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-(function(global, utils) {
-"use strict";
-
-// ----------------------------------------------------------------------------
-// Imports
-
-var GlobalArray = global.Array;
-var IsNaN = global.isNaN;
-var JSONStringify = global.JSON.stringify;
-var MapEntries = global.Map.prototype.entries;
-var MapIteratorNext = (new global.Map).entries().next;
-var SetIteratorNext = (new global.Set).values().next;
-var SetValues = global.Set.prototype.values;
-
-// ----------------------------------------------------------------------------
-
-// Mirror hierarchy:
-// - Mirror
-//   - ValueMirror
-//     - UndefinedMirror
-//     - NullMirror
-//     - BooleanMirror
-//     - NumberMirror
-//     - StringMirror
-//     - SymbolMirror
-//     - ObjectMirror
-//       - FunctionMirror
-//         - UnresolvedFunctionMirror
-//       - ArrayMirror
-//       - DateMirror
-//       - RegExpMirror
-//       - ErrorMirror
-//       - PromiseMirror
-//       - MapMirror
-//       - SetMirror
-//       - IteratorMirror
-//       - GeneratorMirror
-//   - PropertyMirror
-//   - InternalPropertyMirror
-//   - FrameMirror
-//   - ScriptMirror
-//   - ScopeMirror
-
-macro IS_BOOLEAN(arg)
-(typeof(arg) === 'boolean')
-endmacro
-
-macro IS_DATE(arg)
-(%IsDate(arg))
-endmacro
-
-macro IS_ERROR(arg)
-(%_ClassOf(arg) === 'Error')
-endmacro
-
-macro IS_GENERATOR(arg)
-(%_ClassOf(arg) === 'Generator')
-endmacro
-
-macro IS_MAP(arg)
-(%_IsJSMap(arg))
-endmacro
-
-macro IS_MAP_ITERATOR(arg)
-(%_ClassOf(arg) === 'Map Iterator')
-endmacro
-
-macro IS_SCRIPT(arg)
-(%_ClassOf(arg) === 'Script')
-endmacro
-
-macro IS_SET(arg)
-(%_IsJSSet(arg))
-endmacro
-
-macro IS_SET_ITERATOR(arg)
-(%_ClassOf(arg) === 'Set Iterator')
-endmacro
-
-// Must match PropertyFilter in property-details.h
-define PROPERTY_FILTER_NONE = 0;
-
-// Type names of the different mirrors.
-var MirrorType = {
-  UNDEFINED_TYPE : 'undefined',
-  NULL_TYPE : 'null',
-  BOOLEAN_TYPE : 'boolean',
-  NUMBER_TYPE : 'number',
-  STRING_TYPE : 'string',
-  SYMBOL_TYPE : 'symbol',
-  OBJECT_TYPE : 'object',
-  FUNCTION_TYPE : 'function',
-  REGEXP_TYPE : 'regexp',
-  ERROR_TYPE : 'error',
-  PROPERTY_TYPE : 'property',
-  INTERNAL_PROPERTY_TYPE : 'internalProperty',
-  FRAME_TYPE : 'frame',
-  SCRIPT_TYPE : 'script',
-  CONTEXT_TYPE : 'context',
-  SCOPE_TYPE : 'scope',
-  PROMISE_TYPE : 'promise',
-  MAP_TYPE : 'map',
-  SET_TYPE : 'set',
-  ITERATOR_TYPE : 'iterator',
-  GENERATOR_TYPE : 'generator',
-}
-
-/**
- * Returns the mirror for a specified value or object.
- *
- * @param {value or Object} value the value or object to retrieve the mirror for
- * @returns {Mirror} the mirror reflects the passed value or object
- */
-function MakeMirror(value) {
-  var mirror;
-
-  if (IS_UNDEFINED(value)) {
-    mirror = new UndefinedMirror();
-  } else if (IS_NULL(value)) {
-    mirror = new NullMirror();
-  } else if (IS_BOOLEAN(value)) {
-    mirror = new BooleanMirror(value);
-  } else if (IS_NUMBER(value)) {
-    mirror = new NumberMirror(value);
-  } else if (IS_STRING(value)) {
-    mirror = new StringMirror(value);
-  } else if (IS_SYMBOL(value)) {
-    mirror = new SymbolMirror(value);
-  } else if (IS_ARRAY(value)) {
-    mirror = new ArrayMirror(value);
-  } else if (IS_DATE(value)) {
-    mirror = new DateMirror(value);
-  } else if (IS_FUNCTION(value)) {
-    mirror = new FunctionMirror(value);
-  } else if (%IsRegExp(value)) {
-    mirror = new RegExpMirror(value);
-  } else if (IS_ERROR(value)) {
-    mirror = new ErrorMirror(value);
-  } else if (IS_SCRIPT(value)) {
-    mirror = new ScriptMirror(value);
-  } else if (IS_MAP(value) || IS_WEAKMAP(value)) {
-    mirror = new MapMirror(value);
-  } else if (IS_SET(value) || IS_WEAKSET(value)) {
-    mirror = new SetMirror(value);
-  } else if (IS_MAP_ITERATOR(value) || IS_SET_ITERATOR(value)) {
-    mirror = new IteratorMirror(value);
-  } else if (%is_promise(value)) {
-    mirror = new PromiseMirror(value);
-  } else if (IS_GENERATOR(value)) {
-    mirror = new GeneratorMirror(value);
-  } else {
-    mirror = new ObjectMirror(value, MirrorType.OBJECT_TYPE);
-  }
-
-  return mirror;
-}
-
-
-/**
- * Returns the mirror for the undefined value.
- *
- * @returns {Mirror} the mirror reflects the undefined value
- */
-function GetUndefinedMirror() {
-  return MakeMirror(UNDEFINED);
-}
-
-
-/**
- * Inherit the prototype methods from one constructor into another.
- *
- * The Function.prototype.inherits from lang.js rewritten as a standalone
- * function (not on Function.prototype). NOTE: If this file is to be loaded
- * during bootstrapping this function needs to be revritten using some native
- * functions as prototype setup using normal JavaScript does not work as
- * expected during bootstrapping (see mirror.js in r114903).
- *
- * @param {function} ctor Constructor function which needs to inherit the
- *     prototype
- * @param {function} superCtor Constructor function to inherit prototype from
- */
-function inherits(ctor, superCtor) {
-  var tempCtor = function(){};
-  tempCtor.prototype = superCtor.prototype;
-  ctor.super_ = superCtor.prototype;
-  ctor.prototype = new tempCtor();
-  ctor.prototype.constructor = ctor;
-}
-
-// Maximum length when sending strings through the JSON protocol.
-var kMaxProtocolStringLength = 80;
-
-
-// A copy of the PropertyKind enum from property-details.h
-var PropertyType = {};
-PropertyType.Data     = 0;
-PropertyType.Accessor = 1;
-
-
-// Different attributes for a property.
-var PropertyAttribute = {};
-PropertyAttribute.None       = NONE;
-PropertyAttribute.ReadOnly   = READ_ONLY;
-PropertyAttribute.DontEnum   = DONT_ENUM;
-PropertyAttribute.DontDelete = DONT_DELETE;
-
-
-// A copy of the scope types from runtime-debug.cc.
-// NOTE: these constants should be backward-compatible, so
-// add new ones to the end of this list.
-var ScopeType = { Global:  0,
-                  Local:   1,
-                  With:    2,
-                  Closure: 3,
-                  Catch:   4,
-                  Block:   5,
-                  Script:  6,
-                  Eval:    7,
-                  Module:  8,
-                };
-
-/**
- * Base class for all mirror objects.
- * @param {string} type The type of the mirror
- * @constructor
- */
-function Mirror(type) {
-  this.type_ = type;
-}
-
-
-Mirror.prototype.type = function() {
-  return this.type_;
-};
-
-
-/**
- * Check whether the mirror reflects a value.
- * @returns {boolean} True if the mirror reflects a value.
- */
-Mirror.prototype.isValue = function() {
-  return this instanceof ValueMirror;
-};
-
-
-/**
- * Check whether the mirror reflects the undefined value.
- * @returns {boolean} True if the mirror reflects the undefined value.
- */
-Mirror.prototype.isUndefined = function() {
-  return this instanceof UndefinedMirror;
-};
-
-
-/**
- * Check whether the mirror reflects the null value.
- * @returns {boolean} True if the mirror reflects the null value
- */
-Mirror.prototype.isNull = function() {
-  return this instanceof NullMirror;
-};
-
-
-/**
- * Check whether the mirror reflects a boolean value.
- * @returns {boolean} True if the mirror reflects a boolean value
- */
-Mirror.prototype.isBoolean = function() {
-  return this instanceof BooleanMirror;
-};
-
-
-/**
- * Check whether the mirror reflects a number value.
- * @returns {boolean} True if the mirror reflects a number value
- */
-Mirror.prototype.isNumber = function() {
-  return this instanceof NumberMirror;
-};
-
-
-/**
- * Check whether the mirror reflects a string value.
- * @returns {boolean} True if the mirror reflects a string value
- */
-Mirror.prototype.isString = function() {
-  return this instanceof StringMirror;
-};
-
-
-/**
- * Check whether the mirror reflects a symbol.
- * @returns {boolean} True if the mirror reflects a symbol
- */
-Mirror.prototype.isSymbol = function() {
-  return this instanceof SymbolMirror;
-};
-
-
-/**
- * Check whether the mirror reflects an object.
- * @returns {boolean} True if the mirror reflects an object
- */
-Mirror.prototype.isObject = function() {
-  return this instanceof ObjectMirror;
-};
-
-
-/**
- * Check whether the mirror reflects a function.
- * @returns {boolean} True if the mirror reflects a function
- */
-Mirror.prototype.isFunction = function() {
-  return this instanceof FunctionMirror;
-};
-
-
-/**
- * Check whether the mirror reflects an unresolved function.
- * @returns {boolean} True if the mirror reflects an unresolved function
- */
-Mirror.prototype.isUnresolvedFunction = function() {
-  return this instanceof UnresolvedFunctionMirror;
-};
-
-
-/**
- * Check whether the mirror reflects an array.
- * @returns {boolean} True if the mirror reflects an array
- */
-Mirror.prototype.isArray = function() {
-  return this instanceof ArrayMirror;
-};
-
-
-/**
- * Check whether the mirror reflects a date.
- * @returns {boolean} True if the mirror reflects a date
- */
-Mirror.prototype.isDate = function() {
-  return this instanceof DateMirror;
-};
-
-
-/**
- * Check whether the mirror reflects a regular expression.
- * @returns {boolean} True if the mirror reflects a regular expression
- */
-Mirror.prototype.isRegExp = function() {
-  return this instanceof RegExpMirror;
-};
-
-
-/**
- * Check whether the mirror reflects an error.
- * @returns {boolean} True if the mirror reflects an error
- */
-Mirror.prototype.isError = function() {
-  return this instanceof ErrorMirror;
-};
-
-
-/**
- * Check whether the mirror reflects a promise.
- * @returns {boolean} True if the mirror reflects a promise
- */
-Mirror.prototype.isPromise = function() {
-  return this instanceof PromiseMirror;
-};
-
-
-/**
- * Check whether the mirror reflects a generator object.
- * @returns {boolean} True if the mirror reflects a generator object
- */
-Mirror.prototype.isGenerator = function() {
-  return this instanceof GeneratorMirror;
-};
-
-
-/**
- * Check whether the mirror reflects a property.
- * @returns {boolean} True if the mirror reflects a property
- */
-Mirror.prototype.isProperty = function() {
-  return this instanceof PropertyMirror;
-};
-
-
-/**
- * Check whether the mirror reflects an internal property.
- * @returns {boolean} True if the mirror reflects an internal property
- */
-Mirror.prototype.isInternalProperty = function() {
-  return this instanceof InternalPropertyMirror;
-};
-
-
-/**
- * Check whether the mirror reflects a stack frame.
- * @returns {boolean} True if the mirror reflects a stack frame
- */
-Mirror.prototype.isFrame = function() {
-  return this instanceof FrameMirror;
-};
-
-
-/**
- * Check whether the mirror reflects a script.
- * @returns {boolean} True if the mirror reflects a script
- */
-Mirror.prototype.isScript = function() {
-  return this instanceof ScriptMirror;
-};
-
-
-/**
- * Check whether the mirror reflects a context.
- * @returns {boolean} True if the mirror reflects a context
- */
-Mirror.prototype.isContext = function() {
-  return this instanceof ContextMirror;
-};
-
-
-/**
- * Check whether the mirror reflects a scope.
- * @returns {boolean} True if the mirror reflects a scope
- */
-Mirror.prototype.isScope = function() {
-  return this instanceof ScopeMirror;
-};
-
-
-/**
- * Check whether the mirror reflects a map.
- * @returns {boolean} True if the mirror reflects a map
- */
-Mirror.prototype.isMap = function() {
-  return this instanceof MapMirror;
-};
-
-
-/**
- * Check whether the mirror reflects a set.
- * @returns {boolean} True if the mirror reflects a set
- */
-Mirror.prototype.isSet = function() {
-  return this instanceof SetMirror;
-};
-
-
-/**
- * Check whether the mirror reflects an iterator.
- * @returns {boolean} True if the mirror reflects an iterator
- */
-Mirror.prototype.isIterator = function() {
-  return this instanceof IteratorMirror;
-};
-
-
-Mirror.prototype.toText = function() {
-  // Simpel to text which is used when on specialization in subclass.
-  return "#<" + this.constructor.name + ">";
-};
-
-
-/**
- * Base class for all value mirror objects.
- * @param {string} type The type of the mirror
- * @param {value} value The value reflected by this mirror
- * @constructor
- * @extends Mirror
- */
-function ValueMirror(type, value) {
-  %_Call(Mirror, this, type);
-  this.value_ = value;
-}
-inherits(ValueMirror, Mirror);
-
-
-/**
- * Check whether this is a primitive value.
- * @return {boolean} True if the mirror reflects a primitive value
- */
-ValueMirror.prototype.isPrimitive = function() {
-  var type = this.type();
-  return type === 'undefined' ||
-         type === 'null' ||
-         type === 'boolean' ||
-         type === 'number' ||
-         type === 'string' ||
-         type === 'symbol';
-};
-
-
-/**
- * Get the actual value reflected by this mirror.
- * @return {value} The value reflected by this mirror
- */
-ValueMirror.prototype.value = function() {
-  return this.value_;
-};
-
-
-/**
- * Mirror object for Undefined.
- * @constructor
- * @extends ValueMirror
- */
-function UndefinedMirror() {
-  %_Call(ValueMirror, this, MirrorType.UNDEFINED_TYPE, UNDEFINED);
-}
-inherits(UndefinedMirror, ValueMirror);
-
-
-UndefinedMirror.prototype.toText = function() {
-  return 'undefined';
-};
-
-
-/**
- * Mirror object for null.
- * @constructor
- * @extends ValueMirror
- */
-function NullMirror() {
-  %_Call(ValueMirror, this, MirrorType.NULL_TYPE, null);
-}
-inherits(NullMirror, ValueMirror);
-
-
-NullMirror.prototype.toText = function() {
-  return 'null';
-};
-
-
-/**
- * Mirror object for boolean values.
- * @param {boolean} value The boolean value reflected by this mirror
- * @constructor
- * @extends ValueMirror
- */
-function BooleanMirror(value) {
-  %_Call(ValueMirror, this, MirrorType.BOOLEAN_TYPE, value);
-}
-inherits(BooleanMirror, ValueMirror);
-
-
-BooleanMirror.prototype.toText = function() {
-  return this.value_ ? 'true' : 'false';
-};
-
-
-/**
- * Mirror object for number values.
- * @param {number} value The number value reflected by this mirror
- * @constructor
- * @extends ValueMirror
- */
-function NumberMirror(value) {
-  %_Call(ValueMirror, this, MirrorType.NUMBER_TYPE, value);
-}
-inherits(NumberMirror, ValueMirror);
-
-
-NumberMirror.prototype.toText = function() {
-  return '' + this.value_;
-};
-
-
-/**
- * Mirror object for string values.
- * @param {string} value The string value reflected by this mirror
- * @constructor
- * @extends ValueMirror
- */
-function StringMirror(value) {
-  %_Call(ValueMirror, this, MirrorType.STRING_TYPE, value);
-}
-inherits(StringMirror, ValueMirror);
-
-
-StringMirror.prototype.length = function() {
-  return this.value_.length;
-};
-
-StringMirror.prototype.getTruncatedValue = function(maxLength) {
-  if (maxLength != -1 && this.length() > maxLength) {
-    return this.value_.substring(0, maxLength) +
-           '... (length: ' + this.length() + ')';
-  }
-  return this.value_;
-};
-
-StringMirror.prototype.toText = function() {
-  return this.getTruncatedValue(kMaxProtocolStringLength);
-};
-
-
-/**
- * Mirror object for a Symbol
- * @param {Object} value The Symbol
- * @constructor
- * @extends Mirror
- */
-function SymbolMirror(value) {
-  %_Call(ValueMirror, this, MirrorType.SYMBOL_TYPE, value);
-}
-inherits(SymbolMirror, ValueMirror);
-
-
-SymbolMirror.prototype.description = function() {
-  return %SymbolDescription(%ValueOf(this.value_));
-}
-
-
-SymbolMirror.prototype.toText = function() {
-  return %SymbolDescriptiveString(%ValueOf(this.value_));
-}
-
-
-/**
- * Mirror object for objects.
- * @param {object} value The object reflected by this mirror
- * @constructor
- * @extends ValueMirror
- */
-function ObjectMirror(value, type) {
-  type = type || MirrorType.OBJECT_TYPE;
-  %_Call(ValueMirror, this, type, value);
-}
-inherits(ObjectMirror, ValueMirror);
-
-
-ObjectMirror.prototype.className = function() {
-  return %_ClassOf(this.value_);
-};
-
-
-ObjectMirror.prototype.constructorFunction = function() {
-  return MakeMirror(%DebugGetProperty(this.value_, 'constructor'));
-};
-
-
-ObjectMirror.prototype.prototypeObject = function() {
-  return MakeMirror(%DebugGetProperty(this.value_, 'prototype'));
-};
-
-
-ObjectMirror.prototype.protoObject = function() {
-  return MakeMirror(%DebugGetPrototype(this.value_));
-};
-
-
-ObjectMirror.prototype.hasNamedInterceptor = function() {
-  // Get information on interceptors for this object.
-  var x = %GetInterceptorInfo(this.value_);
-  return (x & 2) != 0;
-};
-
-
-ObjectMirror.prototype.hasIndexedInterceptor = function() {
-  // Get information on interceptors for this object.
-  var x = %GetInterceptorInfo(this.value_);
-  return (x & 1) != 0;
-};
-
-
-/**
- * Return the property names for this object.
- * @param {number} kind Indicate whether named, indexed or both kinds of
- *     properties are requested
- * @param {number} limit Limit the number of names returend to the specified
-       value
- * @return {Array} Property names for this object
- */
-ObjectMirror.prototype.propertyNames = function() {
-  return %GetOwnPropertyKeys(this.value_, PROPERTY_FILTER_NONE);
-};
-
-
-/**
- * Return the properties for this object as an array of PropertyMirror objects.
- * @param {number} kind Indicate whether named, indexed or both kinds of
- *     properties are requested
- * @param {number} limit Limit the number of properties returned to the
-       specified value
- * @return {Array} Property mirrors for this object
- */
-ObjectMirror.prototype.properties = function() {
-  var names = this.propertyNames();
-  var properties = new GlobalArray(names.length);
-  for (var i = 0; i < names.length; i++) {
-    properties[i] = this.property(names[i]);
-  }
-
-  return properties;
-};
-
-
-/**
- * Return the internal properties for this object as an array of
- * InternalPropertyMirror objects.
- * @return {Array} Property mirrors for this object
- */
-ObjectMirror.prototype.internalProperties = function() {
-  return ObjectMirror.GetInternalProperties(this.value_);
-}
-
-
-ObjectMirror.prototype.property = function(name) {
-  var details = %DebugGetPropertyDetails(this.value_, name);
-  if (details) {
-    return new PropertyMirror(this, name, details);
-  }
-
-  // Nothing found.
-  return GetUndefinedMirror();
-};
-
-
-
-/**
- * Try to find a property from its value.
- * @param {Mirror} value The property value to look for
- * @return {PropertyMirror} The property with the specified value. If no
- *     property was found with the specified value UndefinedMirror is returned
- */
-ObjectMirror.prototype.lookupProperty = function(value) {
-  var properties = this.properties();
-
-  // Look for property value in properties.
-  for (var i = 0; i < properties.length; i++) {
-
-    // Skip properties which are defined through accessors.
-    var property = properties[i];
-    if (property.propertyType() == PropertyType.Data) {
-      if (property.value_ === value.value_) {
-        return property;
-      }
-    }
-  }
-
-  // Nothing found.
-  return GetUndefinedMirror();
-};
-
-
-/**
- * Returns objects which has direct references to this object
- * @param {number} opt_max_objects Optional parameter specifying the maximum
- *     number of referencing objects to return.
- * @return {Array} The objects which has direct references to this object.
- */
-ObjectMirror.prototype.referencedBy = function(opt_max_objects) {
-  // Find all objects with direct references to this object.
-  var result = %DebugReferencedBy(this.value_,
-                                  Mirror.prototype, opt_max_objects || 0);
-
-  // Make mirrors for all the references found.
-  for (var i = 0; i < result.length; i++) {
-    result[i] = MakeMirror(result[i]);
-  }
-
-  return result;
-};
-
-
-ObjectMirror.prototype.toText = function() {
-  var name;
-  var ctor = this.constructorFunction();
-  if (!ctor.isFunction()) {
-    name = this.className();
-  } else {
-    name = ctor.name();
-    if (!name) {
-      name = this.className();
-    }
-  }
-  return '#<' + name + '>';
-};
-
-
-/**
- * Return the internal properties of the value, such as [[PrimitiveValue]] of
- * scalar wrapper objects, properties of the bound function and properties of
- * the promise.
- * This method is done static to be accessible from Debug API with the bare
- * values without mirrors.
- * @return {Array} array (possibly empty) of InternalProperty instances
- */
-ObjectMirror.GetInternalProperties = function(value) {
-  var properties = %DebugGetInternalProperties(value);
-  var result = [];
-  for (var i = 0; i < properties.length; i += 2) {
-    result.push(new InternalPropertyMirror(properties[i], properties[i + 1]));
-  }
-  return result;
-}
-
-
-/**
- * Mirror object for functions.
- * @param {function} value The function object reflected by this mirror.
- * @constructor
- * @extends ObjectMirror
- */
-function FunctionMirror(value) {
-  %_Call(ObjectMirror, this, value, MirrorType.FUNCTION_TYPE);
-  this.resolved_ = true;
-}
-inherits(FunctionMirror, ObjectMirror);
-
-
-/**
- * Returns whether the function is resolved.
- * @return {boolean} True if the function is resolved. Unresolved functions can
- *     only originate as functions from stack frames
- */
-FunctionMirror.prototype.resolved = function() {
-  return this.resolved_;
-};
-
-
-/**
- * Returns the name of the function.
- * @return {string} Name of the function
- */
-FunctionMirror.prototype.name = function() {
-  return %FunctionGetName(this.value_);
-};
-
-
-/**
- * Returns the displayName if it is set, otherwise name, otherwise inferred
- * name.
- * @return {string} Name of the function
- */
-FunctionMirror.prototype.debugName = function() {
-  return %FunctionGetDebugName(this.value_);
-}
-
-
-/**
- * Returns the inferred name of the function.
- * @return {string} Name of the function
- */
-FunctionMirror.prototype.inferredName = function() {
-  return %FunctionGetInferredName(this.value_);
-};
-
-
-/**
- * Returns the source code for the function.
- * @return {string or undefined} The source code for the function. If the
- *     function is not resolved undefined will be returned.
- */
-FunctionMirror.prototype.source = function() {
-  // Return source if function is resolved. Otherwise just fall through to
-  // return undefined.
-  if (this.resolved()) {
-    return %FunctionToString(this.value_);
-  }
-};
-
-
-/**
- * Returns the script object for the function.
- * @return {ScriptMirror or undefined} Script object for the function or
- *     undefined if the function has no script
- */
-FunctionMirror.prototype.script = function() {
-  // Return script if function is resolved. Otherwise just fall through
-  // to return undefined.
-  if (this.resolved()) {
-    if (this.script_) {
-      return this.script_;
-    }
-    var script = %FunctionGetScript(this.value_);
-    if (script) {
-      return this.script_ = MakeMirror(script);
-    }
-  }
-};
-
-
-/**
- * Returns the script source position for the function. Only makes sense
- * for functions which has a script defined.
- * @return {Number or undefined} in-script position for the function
- */
-FunctionMirror.prototype.sourcePosition_ = function() {
-  // Return position if function is resolved. Otherwise just fall
-  // through to return undefined.
-  if (this.resolved()) {
-    return %FunctionGetScriptSourcePosition(this.value_);
-  }
-};
-
-
-/**
- * Returns the script source location object for the function. Only makes sense
- * for functions which has a script defined.
- * @return {Location or undefined} in-script location for the function begin
- */
-FunctionMirror.prototype.sourceLocation = function() {
-  if (this.resolved()) {
-    var script = this.script();
-    if (script) {
-      return script.locationFromPosition(this.sourcePosition_(), true);
-    }
-  }
-};
-
-
-/**
- * Returns objects constructed by this function.
- * @param {number} opt_max_instances Optional parameter specifying the maximum
- *     number of instances to return.
- * @return {Array or undefined} The objects constructed by this function.
- */
-FunctionMirror.prototype.constructedBy = function(opt_max_instances) {
-  if (this.resolved()) {
-    // Find all objects constructed from this function.
-    var result = %DebugConstructedBy(this.value_, opt_max_instances || 0);
-
-    // Make mirrors for all the instances found.
-    for (var i = 0; i < result.length; i++) {
-      result[i] = MakeMirror(result[i]);
-    }
-
-    return result;
-  } else {
-    return [];
-  }
-};
-
-
-FunctionMirror.prototype.scopeCount = function() {
-  if (this.resolved()) {
-    if (IS_UNDEFINED(this.scopeCount_)) {
-      this.scopeCount_ = %GetFunctionScopeCount(this.value());
-    }
-    return this.scopeCount_;
-  } else {
-    return 0;
-  }
-};
-
-
-FunctionMirror.prototype.scope = function(index) {
-  if (this.resolved()) {
-    return new ScopeMirror(UNDEFINED, this, UNDEFINED, index);
-  }
-};
-
-
-FunctionMirror.prototype.toText = function() {
-  return this.source();
-};
-
-
-FunctionMirror.prototype.context = function() {
-  if (this.resolved()) {
-    if (!this._context)
-      this._context = new ContextMirror(%FunctionGetContextData(this.value_));
-    return this._context;
-  }
-};
-
-
-/**
- * Mirror object for unresolved functions.
- * @param {string} value The name for the unresolved function reflected by this
- *     mirror.
- * @constructor
- * @extends ObjectMirror
- */
-function UnresolvedFunctionMirror(value) {
-  // Construct this using the ValueMirror as an unresolved function is not a
-  // real object but just a string.
-  %_Call(ValueMirror, this, MirrorType.FUNCTION_TYPE, value);
-  this.propertyCount_ = 0;
-  this.elementCount_ = 0;
-  this.resolved_ = false;
-}
-inherits(UnresolvedFunctionMirror, FunctionMirror);
-
-
-UnresolvedFunctionMirror.prototype.className = function() {
-  return 'Function';
-};
-
-
-UnresolvedFunctionMirror.prototype.constructorFunction = function() {
-  return GetUndefinedMirror();
-};
-
-
-UnresolvedFunctionMirror.prototype.prototypeObject = function() {
-  return GetUndefinedMirror();
-};
-
-
-UnresolvedFunctionMirror.prototype.protoObject = function() {
-  return GetUndefinedMirror();
-};
-
-
-UnresolvedFunctionMirror.prototype.name = function() {
-  return this.value_;
-};
-
-
-UnresolvedFunctionMirror.prototype.debugName = function() {
-  return this.value_;
-};
-
-
-UnresolvedFunctionMirror.prototype.inferredName = function() {
-  return UNDEFINED;
-};
-
-
-UnresolvedFunctionMirror.prototype.propertyNames = function(kind, limit) {
-  return [];
-};
-
-
-/**
- * Mirror object for arrays.
- * @param {Array} value The Array object reflected by this mirror
- * @constructor
- * @extends ObjectMirror
- */
-function ArrayMirror(value) {
-  %_Call(ObjectMirror, this, value);
-}
-inherits(ArrayMirror, ObjectMirror);
-
-
-ArrayMirror.prototype.length = function() {
-  return this.value_.length;
-};
-
-
-ArrayMirror.prototype.indexedPropertiesFromRange = function(opt_from_index,
-                                                            opt_to_index) {
-  var from_index = opt_from_index || 0;
-  var to_index = opt_to_index || this.length() - 1;
-  if (from_index > to_index) return new GlobalArray();
-  var values = new GlobalArray(to_index - from_index + 1);
-  for (var i = from_index; i <= to_index; i++) {
-    var details = %DebugGetPropertyDetails(this.value_, TO_STRING(i));
-    var value;
-    if (details) {
-      value = new PropertyMirror(this, i, details);
-    } else {
-      value = GetUndefinedMirror();
-    }
-    values[i - from_index] = value;
-  }
-  return values;
-};
-
-
-/**
- * Mirror object for dates.
- * @param {Date} value The Date object reflected by this mirror
- * @constructor
- * @extends ObjectMirror
- */
-function DateMirror(value) {
-  %_Call(ObjectMirror, this, value);
-}
-inherits(DateMirror, ObjectMirror);
-
-
-DateMirror.prototype.toText = function() {
-  var s = JSONStringify(this.value_);
-  return s.substring(1, s.length - 1);  // cut quotes
-};
-
-
-/**
- * Mirror object for regular expressions.
- * @param {RegExp} value The RegExp object reflected by this mirror
- * @constructor
- * @extends ObjectMirror
- */
-function RegExpMirror(value) {
-  %_Call(ObjectMirror, this, value, MirrorType.REGEXP_TYPE);
-}
-inherits(RegExpMirror, ObjectMirror);
-
-
-/**
- * Returns the source to the regular expression.
- * @return {string or undefined} The source to the regular expression
- */
-RegExpMirror.prototype.source = function() {
-  return this.value_.source;
-};
-
-
-/**
- * Returns whether this regular expression has the global (g) flag set.
- * @return {boolean} Value of the global flag
- */
-RegExpMirror.prototype.global = function() {
-  return this.value_.global;
-};
-
-
-/**
- * Returns whether this regular expression has the ignore case (i) flag set.
- * @return {boolean} Value of the ignore case flag
- */
-RegExpMirror.prototype.ignoreCase = function() {
-  return this.value_.ignoreCase;
-};
-
-
-/**
- * Returns whether this regular expression has the multiline (m) flag set.
- * @return {boolean} Value of the multiline flag
- */
-RegExpMirror.prototype.multiline = function() {
-  return this.value_.multiline;
-};
-
-
-/**
- * Returns whether this regular expression has the sticky (y) flag set.
- * @return {boolean} Value of the sticky flag
- */
-RegExpMirror.prototype.sticky = function() {
-  return this.value_.sticky;
-};
-
-
-/**
- * Returns whether this regular expression has the unicode (u) flag set.
- * @return {boolean} Value of the unicode flag
- */
-RegExpMirror.prototype.unicode = function() {
-  return this.value_.unicode;
-};
-
-
-RegExpMirror.prototype.toText = function() {
-  // Simpel to text which is used when on specialization in subclass.
-  return "/" + this.source() + "/";
-};
-
-
-/**
- * Mirror object for error objects.
- * @param {Error} value The error object reflected by this mirror
- * @constructor
- * @extends ObjectMirror
- */
-function ErrorMirror(value) {
-  %_Call(ObjectMirror, this, value, MirrorType.ERROR_TYPE);
-}
-inherits(ErrorMirror, ObjectMirror);
-
-
-/**
- * Returns the message for this eror object.
- * @return {string or undefined} The message for this eror object
- */
-ErrorMirror.prototype.message = function() {
-  return this.value_.message;
-};
-
-
-ErrorMirror.prototype.toText = function() {
-  // Use the same text representation as in messages.js.
-  var text;
-  try {
-    text = %ErrorToString(this.value_);
-  } catch (e) {
-    text = '#<Error>';
-  }
-  return text;
-};
-
-
-/**
- * Mirror object for a Promise object.
- * @param {Object} value The Promise object
- * @constructor
- * @extends ObjectMirror
- */
-function PromiseMirror(value) {
-  %_Call(ObjectMirror, this, value, MirrorType.PROMISE_TYPE);
-}
-inherits(PromiseMirror, ObjectMirror);
-
-
-function PromiseGetStatus_(value) {
-  var status = %PromiseStatus(value);
-  if (status == 0) return "pending";
-  if (status == 1) return "resolved";
-  return "rejected";
-}
-
-
-function PromiseGetValue_(value) {
-  return %PromiseResult(value);
-}
-
-
-PromiseMirror.prototype.status = function() {
-  return PromiseGetStatus_(this.value_);
-};
-
-
-PromiseMirror.prototype.promiseValue = function() {
-  return MakeMirror(PromiseGetValue_(this.value_));
-};
-
-
-function MapMirror(value) {
-  %_Call(ObjectMirror, this, value, MirrorType.MAP_TYPE);
-}
-inherits(MapMirror, ObjectMirror);
-
-
-/**
- * Returns an array of key/value pairs of a map.
- * This will keep keys alive for WeakMaps.
- *
- * @param {number=} opt_limit Max elements to return.
- * @returns {Array.<Object>} Array of key/value pairs of a map.
- */
-MapMirror.prototype.entries = function(opt_limit) {
-  var result = [];
-
-  if (IS_WEAKMAP(this.value_)) {
-    var entries = %GetWeakMapEntries(this.value_, opt_limit || 0);
-    for (var i = 0; i < entries.length; i += 2) {
-      result.push({
-        key: entries[i],
-        value: entries[i + 1]
-      });
-    }
-    return result;
-  }
-
-  var iter = %_Call(MapEntries, this.value_);
-  var next;
-  while ((!opt_limit || result.length < opt_limit) &&
-         !(next = iter.next()).done) {
-    result.push({
-      key: next.value[0],
-      value: next.value[1]
-    });
-  }
-  return result;
-};
-
-
-function SetMirror(value) {
-  %_Call(ObjectMirror, this, value, MirrorType.SET_TYPE);
-}
-inherits(SetMirror, ObjectMirror);
-
-
-function IteratorGetValues_(iter, next_function, opt_limit) {
-  var result = [];
-  var next;
-  while ((!opt_limit || result.length < opt_limit) &&
-         !(next = %_Call(next_function, iter)).done) {
-    result.push(next.value);
-  }
-  return result;
-}
-
-
-/**
- * Returns an array of elements of a set.
- * This will keep elements alive for WeakSets.
- *
- * @param {number=} opt_limit Max elements to return.
- * @returns {Array.<Object>} Array of elements of a set.
- */
-SetMirror.prototype.values = function(opt_limit) {
-  if (IS_WEAKSET(this.value_)) {
-    return %GetWeakSetValues(this.value_, opt_limit || 0);
-  }
-
-  var iter = %_Call(SetValues, this.value_);
-  return IteratorGetValues_(iter, SetIteratorNext, opt_limit);
-};
-
-
-function IteratorMirror(value) {
-  %_Call(ObjectMirror, this, value, MirrorType.ITERATOR_TYPE);
-}
-inherits(IteratorMirror, ObjectMirror);
-
-
-/**
- * Returns a preview of elements of an iterator.
- * Does not change the backing iterator state.
- *
- * @param {number=} opt_limit Max elements to return.
- * @returns {Array.<Object>} Array of elements of an iterator.
- */
-IteratorMirror.prototype.preview = function(opt_limit) {
-  if (IS_MAP_ITERATOR(this.value_)) {
-    return IteratorGetValues_(%MapIteratorClone(this.value_),
-                              MapIteratorNext,
-                              opt_limit);
-  } else if (IS_SET_ITERATOR(this.value_)) {
-    return IteratorGetValues_(%SetIteratorClone(this.value_),
-                              SetIteratorNext,
-                              opt_limit);
-  }
-};
-
-
-/**
- * Mirror object for a Generator object.
- * @param {Object} data The Generator object
- * @constructor
- * @extends Mirror
- */
-function GeneratorMirror(value) {
-  %_Call(ObjectMirror, this, value, MirrorType.GENERATOR_TYPE);
-}
-inherits(GeneratorMirror, ObjectMirror);
-
-
-function GeneratorGetStatus_(value) {
-  var continuation = %GeneratorGetContinuation(value);
-  if (continuation < -1) return "running";
-  if (continuation == -1) return "closed";
-  return "suspended";
-}
-
-
-GeneratorMirror.prototype.status = function() {
-  return GeneratorGetStatus_(this.value_);
-};
-
-
-GeneratorMirror.prototype.sourcePosition_ = function() {
-  return %GeneratorGetSourcePosition(this.value_);
-};
-
-
-GeneratorMirror.prototype.sourceLocation = function() {
-  var pos = this.sourcePosition_();
-  if (!IS_UNDEFINED(pos)) {
-    var script = this.func().script();
-    if (script) {
-      return script.locationFromPosition(pos, true);
-    }
-  }
-};
-
-
-GeneratorMirror.prototype.func = function() {
-  if (!this.func_) {
-    this.func_ = MakeMirror(%GeneratorGetFunction(this.value_));
-  }
-  return this.func_;
-};
-
-
-GeneratorMirror.prototype.receiver = function() {
-  if (!this.receiver_) {
-    this.receiver_ = MakeMirror(%GeneratorGetReceiver(this.value_));
-  }
-  return this.receiver_;
-};
-
-
-GeneratorMirror.prototype.scopeCount = function() {
-  // This value can change over time as the underlying generator is suspended
-  // at different locations.
-  return %GetGeneratorScopeCount(this.value());
-};
-
-
-GeneratorMirror.prototype.scope = function(index) {
-  return new ScopeMirror(UNDEFINED, UNDEFINED, this, index);
-};
-
-
-GeneratorMirror.prototype.allScopes = function() {
-  var scopes = [];
-  for (let i = 0; i < this.scopeCount(); i++) {
-    scopes.push(this.scope(i));
-  }
-  return scopes;
-};
-
-
-/**
- * Base mirror object for properties.
- * @param {ObjectMirror} mirror The mirror object having this property
- * @param {string} name The name of the property
- * @param {Array} details Details about the property
- * @constructor
- * @extends Mirror
- */
-function PropertyMirror(mirror, name, details) {
-  %_Call(Mirror, this, MirrorType.PROPERTY_TYPE);
-  this.mirror_ = mirror;
-  this.name_ = name;
-  this.value_ = details[0];
-  this.details_ = details[1];
-  this.is_interceptor_ = details[2];
-  if (details.length > 3) {
-    this.exception_ = details[3];
-    this.getter_ = details[4];
-    this.setter_ = details[5];
-  }
-}
-inherits(PropertyMirror, Mirror);
-
-
-PropertyMirror.prototype.isReadOnly = function() {
-  return (this.attributes() & PropertyAttribute.ReadOnly) != 0;
-};
-
-
-PropertyMirror.prototype.isEnum = function() {
-  return (this.attributes() & PropertyAttribute.DontEnum) == 0;
-};
-
-
-PropertyMirror.prototype.canDelete = function() {
-  return (this.attributes() & PropertyAttribute.DontDelete) == 0;
-};
-
-
-PropertyMirror.prototype.name = function() {
-  return this.name_;
-};
-
-
-PropertyMirror.prototype.toText = function() {
-  if (IS_SYMBOL(this.name_)) return %SymbolDescriptiveString(this.name_);
-  return this.name_;
-};
-
-
-PropertyMirror.prototype.isIndexed = function() {
-  for (var i = 0; i < this.name_.length; i++) {
-    if (this.name_[i] < '0' || '9' < this.name_[i]) {
-      return false;
-    }
-  }
-  return true;
-};
-
-
-PropertyMirror.prototype.value = function() {
-  return MakeMirror(this.value_, false);
-};
-
-
-/**
- * Returns whether this property value is an exception.
- * @return {boolean} True if this property value is an exception
- */
-PropertyMirror.prototype.isException = function() {
-  return this.exception_ ? true : false;
-};
-
-
-PropertyMirror.prototype.attributes = function() {
-  return %DebugPropertyAttributesFromDetails(this.details_);
-};
-
-
-PropertyMirror.prototype.propertyType = function() {
-  return %DebugPropertyKindFromDetails(this.details_);
-};
-
-
-/**
- * Returns whether this property has a getter defined through __defineGetter__.
- * @return {boolean} True if this property has a getter
- */
-PropertyMirror.prototype.hasGetter = function() {
-  return this.getter_ ? true : false;
-};
-
-
-/**
- * Returns whether this property has a setter defined through __defineSetter__.
- * @return {boolean} True if this property has a setter
- */
-PropertyMirror.prototype.hasSetter = function() {
-  return this.setter_ ? true : false;
-};
-
-
-/**
- * Returns the getter for this property defined through __defineGetter__.
- * @return {Mirror} FunctionMirror reflecting the getter function or
- *     UndefinedMirror if there is no getter for this property
- */
-PropertyMirror.prototype.getter = function() {
-  if (this.hasGetter()) {
-    return MakeMirror(this.getter_);
-  } else {
-    return GetUndefinedMirror();
-  }
-};
-
-
-/**
- * Returns the setter for this property defined through __defineSetter__.
- * @return {Mirror} FunctionMirror reflecting the setter function or
- *     UndefinedMirror if there is no setter for this property
- */
-PropertyMirror.prototype.setter = function() {
-  if (this.hasSetter()) {
-    return MakeMirror(this.setter_);
-  } else {
-    return GetUndefinedMirror();
-  }
-};
-
-
-/**
- * Returns whether this property is natively implemented by the host or a set
- * through JavaScript code.
- * @return {boolean} True if the property is
- *     UndefinedMirror if there is no setter for this property
- */
-PropertyMirror.prototype.isNative = function() {
-  return this.is_interceptor_ ||
-         ((this.propertyType() == PropertyType.Accessor) &&
-          !this.hasGetter() && !this.hasSetter());
-};
-
-
-/**
- * Mirror object for internal properties. Internal property reflects properties
- * not accessible from user code such as [[BoundThis]] in bound function.
- * Their names are merely symbolic.
- * @param {string} name The name of the property
- * @param {value} property value
- * @constructor
- * @extends Mirror
- */
-function InternalPropertyMirror(name, value) {
-  %_Call(Mirror, this, MirrorType.INTERNAL_PROPERTY_TYPE);
-  this.name_ = name;
-  this.value_ = value;
-}
-inherits(InternalPropertyMirror, Mirror);
-
-
-InternalPropertyMirror.prototype.name = function() {
-  return this.name_;
-};
-
-
-InternalPropertyMirror.prototype.value = function() {
-  return MakeMirror(this.value_, false);
-};
-
-
-var kFrameDetailsFrameIdIndex = 0;
-var kFrameDetailsReceiverIndex = 1;
-var kFrameDetailsFunctionIndex = 2;
-var kFrameDetailsScriptIndex = 3;
-var kFrameDetailsArgumentCountIndex = 4;
-var kFrameDetailsLocalCountIndex = 5;
-var kFrameDetailsSourcePositionIndex = 6;
-var kFrameDetailsConstructCallIndex = 7;
-var kFrameDetailsAtReturnIndex = 8;
-var kFrameDetailsFlagsIndex = 9;
-var kFrameDetailsFirstDynamicIndex = 10;
-
-var kFrameDetailsNameIndex = 0;
-var kFrameDetailsValueIndex = 1;
-var kFrameDetailsNameValueSize = 2;
-
-var kFrameDetailsFlagDebuggerFrameMask = 1 << 0;
-var kFrameDetailsFlagOptimizedFrameMask = 1 << 1;
-var kFrameDetailsFlagInlinedFrameIndexMask = 7 << 2;
-
-/**
- * Wrapper for the frame details information retreived from the VM. The frame
- * details from the VM is an array with the following content. See runtime.cc
- * Runtime_GetFrameDetails.
- *     0: Id
- *     1: Receiver
- *     2: Function
- *     3: Script
- *     4: Argument count
- *     5: Local count
- *     6: Source position
- *     7: Construct call
- *     8: Is at return
- *     9: Flags (debugger frame, optimized frame, inlined frame index)
- *     Arguments name, value
- *     Locals name, value
- *     Return value if any
- * @param {number} break_id Current break id
- * @param {number} index Frame number
- * @constructor
- */
-function FrameDetails(break_id, index) {
-  this.break_id_ = break_id;
-  this.details_ = %GetFrameDetails(break_id, index);
-}
-
-
-FrameDetails.prototype.frameId = function() {
-  %CheckExecutionState(this.break_id_);
-  return this.details_[kFrameDetailsFrameIdIndex];
-};
-
-
-FrameDetails.prototype.receiver = function() {
-  %CheckExecutionState(this.break_id_);
-  return this.details_[kFrameDetailsReceiverIndex];
-};
-
-
-FrameDetails.prototype.func = function() {
-  %CheckExecutionState(this.break_id_);
-  return this.details_[kFrameDetailsFunctionIndex];
-};
-
-
-FrameDetails.prototype.script = function() {
-  %CheckExecutionState(this.break_id_);
-  return this.details_[kFrameDetailsScriptIndex];
-};
-
-
-FrameDetails.prototype.isConstructCall = function() {
-  %CheckExecutionState(this.break_id_);
-  return this.details_[kFrameDetailsConstructCallIndex];
-};
-
-
-FrameDetails.prototype.isAtReturn = function() {
-  %CheckExecutionState(this.break_id_);
-  return this.details_[kFrameDetailsAtReturnIndex];
-};
-
-
-FrameDetails.prototype.isDebuggerFrame = function() {
-  %CheckExecutionState(this.break_id_);
-  var f = kFrameDetailsFlagDebuggerFrameMask;
-  return (this.details_[kFrameDetailsFlagsIndex] & f) == f;
-};
-
-
-FrameDetails.prototype.isOptimizedFrame = function() {
-  %CheckExecutionState(this.break_id_);
-  var f = kFrameDetailsFlagOptimizedFrameMask;
-  return (this.details_[kFrameDetailsFlagsIndex] & f) == f;
-};
-
-
-FrameDetails.prototype.isInlinedFrame = function() {
-  return this.inlinedFrameIndex() > 0;
-};
-
-
-FrameDetails.prototype.inlinedFrameIndex = function() {
-  %CheckExecutionState(this.break_id_);
-  var f = kFrameDetailsFlagInlinedFrameIndexMask;
-  return (this.details_[kFrameDetailsFlagsIndex] & f) >> 2;
-};
-
-
-FrameDetails.prototype.argumentCount = function() {
-  %CheckExecutionState(this.break_id_);
-  return this.details_[kFrameDetailsArgumentCountIndex];
-};
-
-
-FrameDetails.prototype.argumentName = function(index) {
-  %CheckExecutionState(this.break_id_);
-  if (index >= 0 && index < this.argumentCount()) {
-    return this.details_[kFrameDetailsFirstDynamicIndex +
-                         index * kFrameDetailsNameValueSize +
-                         kFrameDetailsNameIndex];
-  }
-};
-
-
-FrameDetails.prototype.argumentValue = function(index) {
-  %CheckExecutionState(this.break_id_);
-  if (index >= 0 && index < this.argumentCount()) {
-    return this.details_[kFrameDetailsFirstDynamicIndex +
-                         index * kFrameDetailsNameValueSize +
-                         kFrameDetailsValueIndex];
-  }
-};
-
-
-FrameDetails.prototype.localCount = function() {
-  %CheckExecutionState(this.break_id_);
-  return this.details_[kFrameDetailsLocalCountIndex];
-};
-
-
-FrameDetails.prototype.sourcePosition = function() {
-  %CheckExecutionState(this.break_id_);
-  return this.details_[kFrameDetailsSourcePositionIndex];
-};
-
-
-FrameDetails.prototype.localName = function(index) {
-  %CheckExecutionState(this.break_id_);
-  if (index >= 0 && index < this.localCount()) {
-    var locals_offset = kFrameDetailsFirstDynamicIndex +
-                        this.argumentCount() * kFrameDetailsNameValueSize;
-    return this.details_[locals_offset +
-                         index * kFrameDetailsNameValueSize +
-                         kFrameDetailsNameIndex];
-  }
-};
-
-
-FrameDetails.prototype.localValue = function(index) {
-  %CheckExecutionState(this.break_id_);
-  if (index >= 0 && index < this.localCount()) {
-    var locals_offset = kFrameDetailsFirstDynamicIndex +
-                        this.argumentCount() * kFrameDetailsNameValueSize;
-    return this.details_[locals_offset +
-                         index * kFrameDetailsNameValueSize +
-                         kFrameDetailsValueIndex];
-  }
-};
-
-
-FrameDetails.prototype.returnValue = function() {
-  %CheckExecutionState(this.break_id_);
-  var return_value_offset =
-      kFrameDetailsFirstDynamicIndex +
-      (this.argumentCount() + this.localCount()) * kFrameDetailsNameValueSize;
-  if (this.details_[kFrameDetailsAtReturnIndex]) {
-    return this.details_[return_value_offset];
-  }
-};
-
-
-FrameDetails.prototype.scopeCount = function() {
-  if (IS_UNDEFINED(this.scopeCount_)) {
-    this.scopeCount_ = %GetScopeCount(this.break_id_, this.frameId());
-  }
-  return this.scopeCount_;
-};
-
-
-/**
- * Mirror object for stack frames.
- * @param {number} break_id The break id in the VM for which this frame is
-       valid
- * @param {number} index The frame index (top frame is index 0)
- * @constructor
- * @extends Mirror
- */
-function FrameMirror(break_id, index) {
-  %_Call(Mirror, this, MirrorType.FRAME_TYPE);
-  this.break_id_ = break_id;
-  this.index_ = index;
-  this.details_ = new FrameDetails(break_id, index);
-}
-inherits(FrameMirror, Mirror);
-
-
-FrameMirror.prototype.details = function() {
-  return this.details_;
-};
-
-
-FrameMirror.prototype.index = function() {
-  return this.index_;
-};
-
-
-FrameMirror.prototype.func = function() {
-  if (this.func_) {
-    return this.func_;
-  }
-
-  // Get the function for this frame from the VM.
-  var f = this.details_.func();
-
-  // Create a function mirror. NOTE: MakeMirror cannot be used here as the
-  // value returned from the VM might be a string if the function for the
-  // frame is unresolved.
-  if (IS_FUNCTION(f)) {
-    return this.func_ = MakeMirror(f);
-  } else {
-    return new UnresolvedFunctionMirror(f);
-  }
-};
-
-
-FrameMirror.prototype.script = function() {
-  if (!this.script_) {
-    this.script_ = MakeMirror(this.details_.script());
-  }
-
-  return this.script_;
-}
-
-
-FrameMirror.prototype.receiver = function() {
-  return MakeMirror(this.details_.receiver());
-};
-
-
-FrameMirror.prototype.isConstructCall = function() {
-  return this.details_.isConstructCall();
-};
-
-
-FrameMirror.prototype.isAtReturn = function() {
-  return this.details_.isAtReturn();
-};
-
-
-FrameMirror.prototype.isDebuggerFrame = function() {
-  return this.details_.isDebuggerFrame();
-};
-
-
-FrameMirror.prototype.isOptimizedFrame = function() {
-  return this.details_.isOptimizedFrame();
-};
-
-
-FrameMirror.prototype.isInlinedFrame = function() {
-  return this.details_.isInlinedFrame();
-};
-
-
-FrameMirror.prototype.inlinedFrameIndex = function() {
-  return this.details_.inlinedFrameIndex();
-};
-
-
-FrameMirror.prototype.argumentCount = function() {
-  return this.details_.argumentCount();
-};
-
-
-FrameMirror.prototype.argumentName = function(index) {
-  return this.details_.argumentName(index);
-};
-
-
-FrameMirror.prototype.argumentValue = function(index) {
-  return MakeMirror(this.details_.argumentValue(index));
-};
-
-
-FrameMirror.prototype.localCount = function() {
-  return this.details_.localCount();
-};
-
-
-FrameMirror.prototype.localName = function(index) {
-  return this.details_.localName(index);
-};
-
-
-FrameMirror.prototype.localValue = function(index) {
-  return MakeMirror(this.details_.localValue(index));
-};
-
-
-FrameMirror.prototype.returnValue = function() {
-  return MakeMirror(this.details_.returnValue());
-};
-
-
-FrameMirror.prototype.sourcePosition = function() {
-  return this.details_.sourcePosition();
-};
-
-
-FrameMirror.prototype.sourceLocation = function() {
-  var script = this.script();
-  if (script) {
-    return script.locationFromPosition(this.sourcePosition(), true);
-  }
-};
-
-
-FrameMirror.prototype.sourceLine = function() {
-  var location = this.sourceLocation();
-  if (location) {
-    return location.line;
-  }
-};
-
-
-FrameMirror.prototype.sourceColumn = function() {
-  var location = this.sourceLocation();
-  if (location) {
-    return location.column;
-  }
-};
-
-
-FrameMirror.prototype.sourceLineText = function() {
-  var location = this.sourceLocation();
-  if (location) {
-    return location.sourceText;
-  }
-};
-
-
-FrameMirror.prototype.scopeCount = function() {
-  return this.details_.scopeCount();
-};
-
-
-FrameMirror.prototype.scope = function(index) {
-  return new ScopeMirror(this, UNDEFINED, UNDEFINED, index);
-};
-
-
-FrameMirror.prototype.allScopes = function(opt_ignore_nested_scopes) {
-  var scopeDetails = %GetAllScopesDetails(this.break_id_,
-                                          this.details_.frameId(),
-                                          this.details_.inlinedFrameIndex(),
-                                          !!opt_ignore_nested_scopes);
-  var result = [];
-  for (var i = 0; i < scopeDetails.length; ++i) {
-    result.push(new ScopeMirror(this, UNDEFINED, UNDEFINED, i,
-                                scopeDetails[i]));
-  }
-  return result;
-};
-
-
-FrameMirror.prototype.evaluate = function(source, throw_on_side_effect = false) {
-  return MakeMirror(%DebugEvaluate(this.break_id_,
-                                   this.details_.frameId(),
-                                   this.details_.inlinedFrameIndex(),
-                                   source,
-                                   throw_on_side_effect));
-};
-
-
-FrameMirror.prototype.invocationText = function() {
-  // Format frame invoaction (receiver, function and arguments).
-  var result = '';
-  var func = this.func();
-  var receiver = this.receiver();
-  if (this.isConstructCall()) {
-    // For constructor frames display new followed by the function name.
-    result += 'new ';
-    result += func.name() ? func.name() : '[anonymous]';
-  } else if (this.isDebuggerFrame()) {
-    result += '[debugger]';
-  } else {
-    // If the receiver has a className which is 'global' don't display it.
-    var display_receiver =
-      !receiver.className || (receiver.className() != 'global');
-    if (display_receiver) {
-      result += receiver.toText();
-    }
-    // Try to find the function as a property in the receiver. Include the
-    // prototype chain in the lookup.
-    var property = GetUndefinedMirror();
-    if (receiver.isObject()) {
-      for (var r = receiver;
-           !r.isNull() && property.isUndefined();
-           r = r.protoObject()) {
-        property = r.lookupProperty(func);
-      }
-    }
-    if (!property.isUndefined()) {
-      // The function invoked was found on the receiver. Use the property name
-      // for the backtrace.
-      if (!property.isIndexed()) {
-        if (display_receiver) {
-          result += '.';
-        }
-        result += property.toText();
-      } else {
-        result += '[';
-        result += property.toText();
-        result += ']';
-      }
-      // Also known as - if the name in the function doesn't match the name
-      // under which it was looked up.
-      if (func.name() && func.name() != property.name()) {
-        result += '(aka ' + func.name() + ')';
-      }
-    } else {
-      // The function invoked was not found on the receiver. Use the function
-      // name if available for the backtrace.
-      if (display_receiver) {
-        result += '.';
-      }
-      result += func.name() ? func.name() : '[anonymous]';
-    }
-  }
-
-  // Render arguments for normal frames.
-  if (!this.isDebuggerFrame()) {
-    result += '(';
-    for (var i = 0; i < this.argumentCount(); i++) {
-      if (i != 0) result += ', ';
-      if (this.argumentName(i)) {
-        result += this.argumentName(i);
-        result += '=';
-      }
-      result += this.argumentValue(i).toText();
-    }
-    result += ')';
-  }
-
-  if (this.isAtReturn()) {
-    result += ' returning ';
-    result += this.returnValue().toText();
-  }
-
-  return result;
-};
-
-
-FrameMirror.prototype.sourceAndPositionText = function() {
-  // Format source and position.
-  var result = '';
-  var func = this.func();
-  if (func.resolved()) {
-    var script = func.script();
-    if (script) {
-      if (script.name()) {
-        result += script.name();
-      } else {
-        result += '[unnamed]';
-      }
-      if (!this.isDebuggerFrame()) {
-        var location = this.sourceLocation();
-        result += ' line ';
-        result += !IS_UNDEFINED(location) ? (location.line + 1) : '?';
-        result += ' column ';
-        result += !IS_UNDEFINED(location) ? (location.column + 1) : '?';
-        if (!IS_UNDEFINED(this.sourcePosition())) {
-          result += ' (position ' + (this.sourcePosition() + 1) + ')';
-        }
-      }
-    } else {
-      result += '[no source]';
-    }
-  } else {
-    result += '[unresolved]';
-  }
-
-  return result;
-};
-
-
-FrameMirror.prototype.localsText = function() {
-  // Format local variables.
-  var result = '';
-  var locals_count = this.localCount();
-  if (locals_count > 0) {
-    for (var i = 0; i < locals_count; ++i) {
-      result += '      var ';
-      result += this.localName(i);
-      result += ' = ';
-      result += this.localValue(i).toText();
-      if (i < locals_count - 1) result += '\n';
-    }
-  }
-
-  return result;
-};
-
-
-FrameMirror.prototype.restart = function() {
-  var result = %LiveEditRestartFrame(this.break_id_, this.index_);
-  if (IS_UNDEFINED(result)) {
-    result = "Failed to find requested frame";
-  }
-  return result;
-};
-
-
-FrameMirror.prototype.toText = function(opt_locals) {
-  var result = '';
-  result += '#' + (this.index() <= 9 ? '0' : '') + this.index();
-  result += ' ';
-  result += this.invocationText();
-  result += ' ';
-  result += this.sourceAndPositionText();
-  if (opt_locals) {
-    result += '\n';
-    result += this.localsText();
-  }
-  return result;
-};
-
-
-// This indexes correspond definitions in debug-scopes.h.
-var kScopeDetailsTypeIndex = 0;
-var kScopeDetailsObjectIndex = 1;
-var kScopeDetailsNameIndex = 2;
-var kScopeDetailsStartPositionIndex = 3;
-var kScopeDetailsEndPositionIndex = 4;
-var kScopeDetailsFunctionIndex = 5;
-
-function ScopeDetails(frame, fun, gen, index, opt_details) {
-  if (frame) {
-    this.break_id_ = frame.break_id_;
-    this.details_ = opt_details ||
-                    %GetScopeDetails(frame.break_id_,
-                                     frame.details_.frameId(),
-                                     frame.details_.inlinedFrameIndex(),
-                                     index);
-    this.frame_id_ = frame.details_.frameId();
-    this.inlined_frame_id_ = frame.details_.inlinedFrameIndex();
-  } else if (fun) {
-    this.details_ = opt_details || %GetFunctionScopeDetails(fun.value(), index);
-    this.fun_value_ = fun.value();
-    this.break_id_ = UNDEFINED;
-  } else {
-    this.details_ =
-      opt_details || %GetGeneratorScopeDetails(gen.value(), index);
-    this.gen_value_ = gen.value();
-    this.break_id_ = UNDEFINED;
-  }
-  this.index_ = index;
-}
-
-
-ScopeDetails.prototype.type = function() {
-  if (!IS_UNDEFINED(this.break_id_)) {
-    %CheckExecutionState(this.break_id_);
-  }
-  return this.details_[kScopeDetailsTypeIndex];
-};
-
-
-ScopeDetails.prototype.object = function() {
-  if (!IS_UNDEFINED(this.break_id_)) {
-    %CheckExecutionState(this.break_id_);
-  }
-  return this.details_[kScopeDetailsObjectIndex];
-};
-
-
-ScopeDetails.prototype.name = function() {
-  if (!IS_UNDEFINED(this.break_id_)) {
-    %CheckExecutionState(this.break_id_);
-  }
-  return this.details_[kScopeDetailsNameIndex];
-};
-
-
-ScopeDetails.prototype.startPosition = function() {
-  if (!IS_UNDEFINED(this.break_id_)) {
-    %CheckExecutionState(this.break_id_);
-  }
-  return this.details_[kScopeDetailsStartPositionIndex];
-}
-
-
-ScopeDetails.prototype.endPosition = function() {
-  if (!IS_UNDEFINED(this.break_id_)) {
-    %CheckExecutionState(this.break_id_);
-  }
-  return this.details_[kScopeDetailsEndPositionIndex];
-}
-
-ScopeDetails.prototype.func = function() {
-  if (!IS_UNDEFINED(this.break_id_)) {
-    %CheckExecutionState(this.break_id_);
-  }
-  return this.details_[kScopeDetailsFunctionIndex];
-}
-
-
-ScopeDetails.prototype.setVariableValueImpl = function(name, new_value) {
-  var raw_res;
-  if (!IS_UNDEFINED(this.break_id_)) {
-    %CheckExecutionState(this.break_id_);
-    raw_res = %SetScopeVariableValue(this.break_id_, this.frame_id_,
-        this.inlined_frame_id_, this.index_, name, new_value);
-  } else if (!IS_UNDEFINED(this.fun_value_)) {
-    raw_res = %SetScopeVariableValue(this.fun_value_, null, null, this.index_,
-        name, new_value);
-  } else {
-    raw_res = %SetScopeVariableValue(this.gen_value_, null, null, this.index_,
-        name, new_value);
-  }
-  if (!raw_res) throw %make_error(kDebugger, "Failed to set variable value");
-};
-
-
-/**
- * Mirror object for scope of frame or function. Either frame or function must
- * be specified.
- * @param {FrameMirror} frame The frame this scope is a part of
- * @param {FunctionMirror} function The function this scope is a part of
- * @param {GeneratorMirror} gen The generator this scope is a part of
- * @param {number} index The scope index in the frame
- * @param {Array=} opt_details Raw scope details data
- * @constructor
- * @extends Mirror
- */
-function ScopeMirror(frame, fun, gen, index, opt_details) {
-  %_Call(Mirror, this, MirrorType.SCOPE_TYPE);
-  if (frame) {
-    this.frame_index_ = frame.index_;
-  } else {
-    this.frame_index_ = UNDEFINED;
-  }
-  this.scope_index_ = index;
-  this.details_ = new ScopeDetails(frame, fun, gen, index, opt_details);
-}
-inherits(ScopeMirror, Mirror);
-
-
-ScopeMirror.prototype.details = function() {
-  return this.details_;
-};
-
-
-ScopeMirror.prototype.frameIndex = function() {
-  return this.frame_index_;
-};
-
-
-ScopeMirror.prototype.scopeIndex = function() {
-  return this.scope_index_;
-};
-
-
-ScopeMirror.prototype.scopeType = function() {
-  return this.details_.type();
-};
-
-
-ScopeMirror.prototype.scopeObject = function() {
-  // For local, closure and script scopes create a mirror
-  // as these objects are created on the fly materializing the local
-  // or closure scopes and therefore will not preserve identity.
-  return MakeMirror(this.details_.object());
-};
-
-
-ScopeMirror.prototype.setVariableValue = function(name, new_value) {
-  this.details_.setVariableValueImpl(name, new_value);
-};
-
-
-/**
- * Mirror object for script source.
- * @param {Script} script The script object
- * @constructor
- * @extends Mirror
- */
-function ScriptMirror(script) {
-  %_Call(Mirror, this, MirrorType.SCRIPT_TYPE);
-  this.script_ = script;
-  this.context_ = new ContextMirror(script.context_data);
-}
-inherits(ScriptMirror, Mirror);
-
-
-ScriptMirror.prototype.value = function() {
-  return this.script_;
-};
-
-
-ScriptMirror.prototype.name = function() {
-  return this.script_.name || this.script_.nameOrSourceURL();
-};
-
-
-ScriptMirror.prototype.id = function() {
-  return this.script_.id;
-};
-
-
-ScriptMirror.prototype.source = function() {
-  return this.script_.source;
-};
-
-
-ScriptMirror.prototype.setSource = function(source) {
-  if (!IS_STRING(source)) throw %make_error(kDebugger, "Source is not a string");
-  %DebugSetScriptSource(this.script_, source);
-};
-
-
-ScriptMirror.prototype.lineOffset = function() {
-  return this.script_.line_offset;
-};
-
-
-ScriptMirror.prototype.columnOffset = function() {
-  return this.script_.column_offset;
-};
-
-
-ScriptMirror.prototype.data = function() {
-  return this.script_.data;
-};
-
-
-ScriptMirror.prototype.scriptType = function() {
-  return this.script_.type;
-};
-
-
-ScriptMirror.prototype.compilationType = function() {
-  return this.script_.compilation_type;
-};
-
-
-ScriptMirror.prototype.lineCount = function() {
-  return %ScriptLineCount(this.script_);
-};
-
-
-ScriptMirror.prototype.locationFromPosition = function(
-    position, include_resource_offset) {
-  return this.script_.locationFromPosition(position, include_resource_offset);
-};
-
-
-ScriptMirror.prototype.context = function() {
-  return this.context_;
-};
-
-
-ScriptMirror.prototype.evalFromScript = function() {
-  return MakeMirror(this.script_.eval_from_script);
-};
-
-
-ScriptMirror.prototype.evalFromFunctionName = function() {
-  return MakeMirror(this.script_.eval_from_function_name);
-};
-
-
-ScriptMirror.prototype.evalFromLocation = function() {
-  var eval_from_script = this.evalFromScript();
-  if (!eval_from_script.isUndefined()) {
-    var position = this.script_.eval_from_script_position;
-    return eval_from_script.locationFromPosition(position, true);
-  }
-};
-
-
-ScriptMirror.prototype.toText = function() {
-  var result = '';
-  result += this.name();
-  result += ' (lines: ';
-  if (this.lineOffset() > 0) {
-    result += this.lineOffset();
-    result += '-';
-    result += this.lineOffset() + this.lineCount() - 1;
-  } else {
-    result += this.lineCount();
-  }
-  result += ')';
-  return result;
-};
-
-
-/**
- * Mirror object for context.
- * @param {Object} data The context data
- * @constructor
- * @extends Mirror
- */
-function ContextMirror(data) {
-  %_Call(Mirror, this, MirrorType.CONTEXT_TYPE);
-  this.data_ = data;
-}
-inherits(ContextMirror, Mirror);
-
-
-ContextMirror.prototype.data = function() {
-  return this.data_;
-};
-
-// ----------------------------------------------------------------------------
-// Exports
-
-utils.InstallConstants(global, [
-  "MakeMirror", MakeMirror,
-  "ScopeType", ScopeType,
-  "PropertyType", PropertyType,
-  "PropertyAttribute", PropertyAttribute,
-  "Mirror", Mirror,
-  "ValueMirror", ValueMirror,
-  "UndefinedMirror", UndefinedMirror,
-  "NullMirror", NullMirror,
-  "BooleanMirror", BooleanMirror,
-  "NumberMirror", NumberMirror,
-  "StringMirror", StringMirror,
-  "SymbolMirror", SymbolMirror,
-  "ObjectMirror", ObjectMirror,
-  "FunctionMirror", FunctionMirror,
-  "UnresolvedFunctionMirror", UnresolvedFunctionMirror,
-  "ArrayMirror", ArrayMirror,
-  "DateMirror", DateMirror,
-  "RegExpMirror", RegExpMirror,
-  "ErrorMirror", ErrorMirror,
-  "PromiseMirror", PromiseMirror,
-  "MapMirror", MapMirror,
-  "SetMirror", SetMirror,
-  "IteratorMirror", IteratorMirror,
-  "GeneratorMirror", GeneratorMirror,
-  "PropertyMirror", PropertyMirror,
-  "InternalPropertyMirror", InternalPropertyMirror,
-  "FrameMirror", FrameMirror,
-  "ScriptMirror", ScriptMirror,
-  "ScopeMirror", ScopeMirror,
-  "FrameDetails", FrameDetails,
-]);
-
-})
diff --git a/src/v8/src/ia32/assembler-ia32-inl.h b/src/v8/src/ia32/assembler-ia32-inl.h
deleted file mode 100644
index 368addd..0000000
--- a/src/v8/src/ia32/assembler-ia32-inl.h
+++ /dev/null
@@ -1,333 +0,0 @@
-// Copyright (c) 1994-2006 Sun Microsystems Inc.
-// 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.
-//
-// - Redistribution 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 Sun Microsystems or the names of 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.
-
-// The original source code covered by the above license above has been
-// modified significantly by Google Inc.
-// Copyright 2012 the V8 project authors. All rights reserved.
-
-// A light-weight IA32 Assembler.
-
-#ifndef V8_IA32_ASSEMBLER_IA32_INL_H_
-#define V8_IA32_ASSEMBLER_IA32_INL_H_
-
-#include "src/ia32/assembler-ia32.h"
-
-#include "src/assembler.h"
-#include "src/debug/debug.h"
-#include "src/objects-inl.h"
-
-namespace v8 {
-namespace internal {
-
-bool CpuFeatures::SupportsCrankshaft() { return true; }
-
-bool CpuFeatures::SupportsWasmSimd128() { return IsSupported(SSE4_1); }
-
-static const byte kCallOpcode = 0xE8;
-static const int kNoCodeAgeSequenceLength = 5;
-
-
-// The modes possibly affected by apply must be in kApplyMask.
-void RelocInfo::apply(intptr_t delta) {
-  if (IsRuntimeEntry(rmode_) || IsCodeTarget(rmode_) ||
-      rmode_ == RelocInfo::JS_TO_WASM_CALL) {
-    int32_t* p = reinterpret_cast<int32_t*>(pc_);
-    *p -= delta;  // Relocate entry.
-  } else if (IsInternalReference(rmode_)) {
-    // absolute code pointer inside code object moves with the code object.
-    int32_t* p = reinterpret_cast<int32_t*>(pc_);
-    *p += delta;  // Relocate entry.
-  }
-}
-
-
-Address RelocInfo::target_address() {
-  DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) || IsWasmCall(rmode_));
-  return Assembler::target_address_at(pc_, constant_pool_);
-}
-
-Address RelocInfo::target_address_address() {
-  DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) || IsWasmCall(rmode_) ||
-         rmode_ == EMBEDDED_OBJECT || rmode_ == EXTERNAL_REFERENCE);
-  return reinterpret_cast<Address>(pc_);
-}
-
-
-Address RelocInfo::constant_pool_entry_address() {
-  UNREACHABLE();
-}
-
-
-int RelocInfo::target_address_size() {
-  return Assembler::kSpecialTargetSize;
-}
-
-HeapObject* RelocInfo::target_object() {
-  DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
-  return HeapObject::cast(Memory::Object_at(pc_));
-}
-
-Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
-  DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
-  return Handle<HeapObject>::cast(Memory::Object_Handle_at(pc_));
-}
-
-void RelocInfo::set_target_object(HeapObject* target,
-                                  WriteBarrierMode write_barrier_mode,
-                                  ICacheFlushMode icache_flush_mode) {
-  DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
-  Memory::Object_at(pc_) = target;
-  if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
-    Assembler::FlushICache(target->GetIsolate(), pc_, sizeof(Address));
-  }
-  if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != nullptr) {
-    host()->GetHeap()->RecordWriteIntoCode(host(), this, target);
-    host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(host(), this,
-                                                                  target);
-  }
-}
-
-
-Address RelocInfo::target_external_reference() {
-  DCHECK(rmode_ == RelocInfo::EXTERNAL_REFERENCE);
-  return Memory::Address_at(pc_);
-}
-
-
-Address RelocInfo::target_internal_reference() {
-  DCHECK(rmode_ == INTERNAL_REFERENCE);
-  return Memory::Address_at(pc_);
-}
-
-
-Address RelocInfo::target_internal_reference_address() {
-  DCHECK(rmode_ == INTERNAL_REFERENCE);
-  return reinterpret_cast<Address>(pc_);
-}
-
-
-Address RelocInfo::target_runtime_entry(Assembler* origin) {
-  DCHECK(IsRuntimeEntry(rmode_));
-  return reinterpret_cast<Address>(*reinterpret_cast<int32_t*>(pc_));
-}
-
-void RelocInfo::set_target_runtime_entry(Isolate* isolate, Address target,
-                                         WriteBarrierMode write_barrier_mode,
-                                         ICacheFlushMode icache_flush_mode) {
-  DCHECK(IsRuntimeEntry(rmode_));
-  if (target_address() != target) {
-    set_target_address(isolate, target, write_barrier_mode, icache_flush_mode);
-  }
-}
-
-void RelocInfo::WipeOut(Isolate* isolate) {
-  if (IsEmbeddedObject(rmode_) || IsExternalReference(rmode_) ||
-      IsInternalReference(rmode_)) {
-    Memory::Address_at(pc_) = nullptr;
-  } else if (IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)) {
-    // Effectively write zero into the relocation.
-    Assembler::set_target_address_at(isolate, pc_, constant_pool_,
-                                     pc_ + sizeof(int32_t));
-  } else {
-    UNREACHABLE();
-  }
-}
-
-template <typename ObjectVisitor>
-void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) {
-  RelocInfo::Mode mode = rmode();
-  if (mode == RelocInfo::EMBEDDED_OBJECT) {
-    visitor->VisitEmbeddedPointer(host(), this);
-    Assembler::FlushICache(isolate, pc_, sizeof(Address));
-  } else if (RelocInfo::IsCodeTarget(mode)) {
-    visitor->VisitCodeTarget(host(), this);
-  } else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
-    visitor->VisitExternalReference(host(), this);
-  } else if (mode == RelocInfo::INTERNAL_REFERENCE) {
-    visitor->VisitInternalReference(host(), this);
-  } else if (IsRuntimeEntry(mode)) {
-    visitor->VisitRuntimeEntry(host(), this);
-  }
-}
-
-void Assembler::emit(uint32_t x) {
-  *reinterpret_cast<uint32_t*>(pc_) = x;
-  pc_ += sizeof(uint32_t);
-}
-
-
-void Assembler::emit_q(uint64_t x) {
-  *reinterpret_cast<uint64_t*>(pc_) = x;
-  pc_ += sizeof(uint64_t);
-}
-
-void Assembler::emit(Handle<HeapObject> handle) {
-  emit(reinterpret_cast<intptr_t>(handle.address()),
-       RelocInfo::EMBEDDED_OBJECT);
-}
-
-void Assembler::emit(uint32_t x, RelocInfo::Mode rmode) {
-  if (!RelocInfo::IsNone(rmode)) {
-    RecordRelocInfo(rmode);
-  }
-  emit(x);
-}
-
-void Assembler::emit(Handle<Code> code, RelocInfo::Mode rmode) {
-  emit(reinterpret_cast<intptr_t>(code.address()), rmode);
-}
-
-
-void Assembler::emit(const Immediate& x) {
-  if (x.rmode_ == RelocInfo::INTERNAL_REFERENCE) {
-    Label* label = reinterpret_cast<Label*>(x.immediate());
-    emit_code_relative_offset(label);
-    return;
-  }
-  if (!RelocInfo::IsNone(x.rmode_)) RecordRelocInfo(x.rmode_);
-  if (x.is_heap_object_request()) {
-    RequestHeapObject(x.heap_object_request());
-    emit(0);
-  } else {
-    emit(x.immediate());
-  }
-}
-
-
-void Assembler::emit_code_relative_offset(Label* label) {
-  if (label->is_bound()) {
-    int32_t pos;
-    pos = label->pos() + Code::kHeaderSize - kHeapObjectTag;
-    emit(pos);
-  } else {
-    emit_disp(label, Displacement::CODE_RELATIVE);
-  }
-}
-
-void Assembler::emit_b(Immediate x) {
-  DCHECK(x.is_int8() || x.is_uint8());
-  uint8_t value = static_cast<uint8_t>(x.immediate());
-  *pc_++ = value;
-}
-
-void Assembler::emit_w(const Immediate& x) {
-  DCHECK(RelocInfo::IsNone(x.rmode_));
-  uint16_t value = static_cast<uint16_t>(x.immediate());
-  reinterpret_cast<uint16_t*>(pc_)[0] = value;
-  pc_ += sizeof(uint16_t);
-}
-
-
-Address Assembler::target_address_at(Address pc, Address constant_pool) {
-  return pc + sizeof(int32_t) + *reinterpret_cast<int32_t*>(pc);
-}
-
-
-void Assembler::set_target_address_at(Isolate* isolate, Address pc,
-                                      Address constant_pool, Address target,
-                                      ICacheFlushMode icache_flush_mode) {
-  DCHECK_IMPLIES(isolate == nullptr, icache_flush_mode == SKIP_ICACHE_FLUSH);
-  int32_t* p = reinterpret_cast<int32_t*>(pc);
-  *p = target - (pc + sizeof(int32_t));
-  if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
-    Assembler::FlushICache(isolate, p, sizeof(int32_t));
-  }
-}
-
-Address Assembler::target_address_from_return_address(Address pc) {
-  return pc - kCallTargetAddressOffset;
-}
-
-void Assembler::deserialization_set_special_target_at(
-    Isolate* isolate, Address instruction_payload, Code* code, Address target) {
-  set_target_address_at(isolate, instruction_payload,
-                        code ? code->constant_pool() : nullptr, target);
-}
-
-Displacement Assembler::disp_at(Label* L) {
-  return Displacement(long_at(L->pos()));
-}
-
-
-void Assembler::disp_at_put(Label* L, Displacement disp) {
-  long_at_put(L->pos(), disp.data());
-}
-
-
-void Assembler::emit_disp(Label* L, Displacement::Type type) {
-  Displacement disp(L, type);
-  L->link_to(pc_offset());
-  emit(static_cast<int>(disp.data()));
-}
-
-
-void Assembler::emit_near_disp(Label* L) {
-  byte disp = 0x00;
-  if (L->is_near_linked()) {
-    int offset = L->near_link_pos() - pc_offset();
-    DCHECK(is_int8(offset));
-    disp = static_cast<byte>(offset & 0xFF);
-  }
-  L->link_to(pc_offset(), Label::kNear);
-  *pc_++ = disp;
-}
-
-
-void Assembler::deserialization_set_target_internal_reference_at(
-    Isolate* isolate, Address pc, Address target, RelocInfo::Mode mode) {
-  Memory::Address_at(pc) = target;
-}
-
-
-void Operand::set_sib(ScaleFactor scale, Register index, Register base) {
-  DCHECK_EQ(len_, 1);
-  DCHECK_EQ(scale & -4, 0);
-  // Use SIB with no index register only for base esp.
-  DCHECK(index != esp || base == esp);
-  buf_[1] = scale << 6 | index.code() << 3 | base.code();
-  len_ = 2;
-}
-
-
-void Operand::set_disp8(int8_t disp) {
-  DCHECK(len_ == 1 || len_ == 2);
-  *reinterpret_cast<int8_t*>(&buf_[len_++]) = disp;
-}
-
-
-Operand::Operand(Immediate imm) {
-  // [disp/r]
-  set_modrm(0, ebp);
-  set_dispr(imm.immediate(), imm.rmode_);
-}
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_IA32_ASSEMBLER_IA32_INL_H_
diff --git a/src/v8/src/ia32/assembler-ia32.cc b/src/v8/src/ia32/assembler-ia32.cc
deleted file mode 100644
index 38508c7..0000000
--- a/src/v8/src/ia32/assembler-ia32.cc
+++ /dev/null
@@ -1,3406 +0,0 @@
-// Copyright (c) 1994-2006 Sun Microsystems Inc.
-// 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.
-//
-// - Redistribution 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 Sun Microsystems or the names of 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.
-
-// The original source code covered by the above license above has been modified
-// significantly by Google Inc.
-// Copyright 2012 the V8 project authors. All rights reserved.
-
-#include "src/ia32/assembler-ia32.h"
-
-#include <cstring>
-
-#if V8_TARGET_ARCH_IA32
-
-#if V8_LIBC_MSVCRT
-#include <intrin.h>  // _xgetbv()
-#endif
-#if V8_OS_MACOSX
-#include <sys/sysctl.h>
-#endif
-
-#include "src/assembler-inl.h"
-#include "src/base/bits.h"
-#include "src/base/cpu.h"
-#include "src/code-stubs.h"
-#include "src/conversions-inl.h"
-#include "src/disassembler.h"
-#include "src/macro-assembler.h"
-#include "src/v8.h"
-
-namespace v8 {
-namespace internal {
-
-Immediate Immediate::EmbeddedNumber(double value) {
-  int32_t smi;
-  if (DoubleToSmiInteger(value, &smi)) return Immediate(Smi::FromInt(smi));
-  Immediate result(0, RelocInfo::EMBEDDED_OBJECT);
-  result.is_heap_object_request_ = true;
-  result.value_.heap_object_request = HeapObjectRequest(value);
-  return result;
-}
-
-Immediate Immediate::EmbeddedCode(CodeStub* stub) {
-  Immediate result(0, RelocInfo::CODE_TARGET);
-  result.is_heap_object_request_ = true;
-  result.value_.heap_object_request = HeapObjectRequest(stub);
-  return result;
-}
-
-// -----------------------------------------------------------------------------
-// Implementation of CpuFeatures
-
-namespace {
-
-#if !V8_LIBC_MSVCRT
-
-V8_INLINE uint64_t _xgetbv(unsigned int xcr) {
-  unsigned eax, edx;
-  // Check xgetbv; this uses a .byte sequence instead of the instruction
-  // directly because older assemblers do not include support for xgetbv and
-  // there is no easy way to conditionally compile based on the assembler
-  // used.
-  __asm__ volatile(".byte 0x0F, 0x01, 0xD0" : "=a"(eax), "=d"(edx) : "c"(xcr));
-  return static_cast<uint64_t>(eax) | (static_cast<uint64_t>(edx) << 32);
-}
-
-#define _XCR_XFEATURE_ENABLED_MASK 0
-
-#endif  // !V8_LIBC_MSVCRT
-
-
-bool OSHasAVXSupport() {
-#if V8_OS_MACOSX
-  // Mac OS X up to 10.9 has a bug where AVX transitions were indeed being
-  // caused by ISRs, so we detect that here and disable AVX in that case.
-  char buffer[128];
-  size_t buffer_size = arraysize(buffer);
-  int ctl_name[] = {CTL_KERN, KERN_OSRELEASE};
-  if (sysctl(ctl_name, 2, buffer, &buffer_size, nullptr, 0) != 0) {
-    V8_Fatal(__FILE__, __LINE__, "V8 failed to get kernel version");
-  }
-  // The buffer now contains a string of the form XX.YY.ZZ, where
-  // XX is the major kernel version component.
-  char* period_pos = strchr(buffer, '.');
-  DCHECK_NOT_NULL(period_pos);
-  *period_pos = '\0';
-  long kernel_version_major = strtol(buffer, nullptr, 10);  // NOLINT
-  if (kernel_version_major <= 13) return false;
-#endif  // V8_OS_MACOSX
-  // Check whether OS claims to support AVX.
-  uint64_t feature_mask = _xgetbv(_XCR_XFEATURE_ENABLED_MASK);
-  return (feature_mask & 0x6) == 0x6;
-}
-
-}  // namespace
-
-
-void CpuFeatures::ProbeImpl(bool cross_compile) {
-  base::CPU cpu;
-  CHECK(cpu.has_sse2());  // SSE2 support is mandatory.
-  CHECK(cpu.has_cmov());  // CMOV support is mandatory.
-
-  // Only use statically determined features for cross compile (snapshot).
-  if (cross_compile) return;
-
-  if (cpu.has_sse41() && FLAG_enable_sse4_1) supported_ |= 1u << SSE4_1;
-  if (cpu.has_ssse3() && FLAG_enable_ssse3) supported_ |= 1u << SSSE3;
-  if (cpu.has_sse3() && FLAG_enable_sse3) supported_ |= 1u << SSE3;
-  if (cpu.has_avx() && FLAG_enable_avx && cpu.has_osxsave() &&
-      OSHasAVXSupport()) {
-    supported_ |= 1u << AVX;
-  }
-  if (cpu.has_fma3() && FLAG_enable_fma3 && cpu.has_osxsave() &&
-      OSHasAVXSupport()) {
-    supported_ |= 1u << FMA3;
-  }
-  if (cpu.has_bmi1() && FLAG_enable_bmi1) supported_ |= 1u << BMI1;
-  if (cpu.has_bmi2() && FLAG_enable_bmi2) supported_ |= 1u << BMI2;
-  if (cpu.has_lzcnt() && FLAG_enable_lzcnt) supported_ |= 1u << LZCNT;
-  if (cpu.has_popcnt() && FLAG_enable_popcnt) supported_ |= 1u << POPCNT;
-  if (strcmp(FLAG_mcpu, "auto") == 0) {
-    if (cpu.is_atom()) supported_ |= 1u << ATOM;
-  } else if (strcmp(FLAG_mcpu, "atom") == 0) {
-    supported_ |= 1u << ATOM;
-  }
-}
-
-
-void CpuFeatures::PrintTarget() { }
-void CpuFeatures::PrintFeatures() {
-  printf(
-      "SSE3=%d SSSE3=%d SSE4_1=%d AVX=%d FMA3=%d BMI1=%d BMI2=%d LZCNT=%d "
-      "POPCNT=%d ATOM=%d\n",
-      CpuFeatures::IsSupported(SSE3), CpuFeatures::IsSupported(SSSE3),
-      CpuFeatures::IsSupported(SSE4_1), CpuFeatures::IsSupported(AVX),
-      CpuFeatures::IsSupported(FMA3), CpuFeatures::IsSupported(BMI1),
-      CpuFeatures::IsSupported(BMI2), CpuFeatures::IsSupported(LZCNT),
-      CpuFeatures::IsSupported(POPCNT), CpuFeatures::IsSupported(ATOM));
-}
-
-
-// -----------------------------------------------------------------------------
-// Implementation of Displacement
-
-void Displacement::init(Label* L, Type type) {
-  DCHECK(!L->is_bound());
-  int next = 0;
-  if (L->is_linked()) {
-    next = L->pos();
-    DCHECK_GT(next, 0);  // Displacements must be at positions > 0
-  }
-  // Ensure that we _never_ overflow the next field.
-  DCHECK(NextField::is_valid(Assembler::kMaximalBufferSize));
-  data_ = NextField::encode(next) | TypeField::encode(type);
-}
-
-
-// -----------------------------------------------------------------------------
-// Implementation of RelocInfo
-
-const int RelocInfo::kApplyMask =
-    RelocInfo::kCodeTargetMask | 1 << RelocInfo::RUNTIME_ENTRY |
-    1 << RelocInfo::INTERNAL_REFERENCE | 1 << RelocInfo::JS_TO_WASM_CALL;
-
-bool RelocInfo::IsCodedSpecially() {
-  // The deserializer needs to know whether a pointer is specially coded.  Being
-  // specially coded on IA32 means that it is a relative address, as used by
-  // branch instructions.  These are also the ones that need changing when a
-  // code object moves.
-  return (1 << rmode_) & kApplyMask;
-}
-
-
-bool RelocInfo::IsInConstantPool() {
-  return false;
-}
-
-Address RelocInfo::embedded_address() const { return Memory::Address_at(pc_); }
-
-uint32_t RelocInfo::embedded_size() const { return Memory::uint32_at(pc_); }
-
-void RelocInfo::set_embedded_address(Isolate* isolate, Address address,
-                                     ICacheFlushMode icache_flush_mode) {
-  Memory::Address_at(pc_) = address;
-  if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
-    Assembler::FlushICache(isolate, pc_, sizeof(Address));
-  }
-}
-
-void RelocInfo::set_embedded_size(Isolate* isolate, uint32_t size,
-                                  ICacheFlushMode icache_flush_mode) {
-  Memory::uint32_at(pc_) = size;
-  if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
-    Assembler::FlushICache(isolate, pc_, sizeof(uint32_t));
-  }
-}
-
-void RelocInfo::set_js_to_wasm_address(Isolate* isolate, Address address,
-                                       ICacheFlushMode icache_flush_mode) {
-  DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
-  Assembler::set_target_address_at(isolate, pc_, constant_pool_, address,
-                                   icache_flush_mode);
-}
-
-Address RelocInfo::js_to_wasm_address() const {
-  DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
-  return Assembler::target_address_at(pc_, constant_pool_);
-}
-
-// -----------------------------------------------------------------------------
-// Implementation of Operand
-
-Operand::Operand(Register base, int32_t disp, RelocInfo::Mode rmode) {
-  // [base + disp/r]
-  if (disp == 0 && RelocInfo::IsNone(rmode) && base != ebp) {
-    // [base]
-    set_modrm(0, base);
-    if (base == esp) set_sib(times_1, esp, base);
-  } else if (is_int8(disp) && RelocInfo::IsNone(rmode)) {
-    // [base + disp8]
-    set_modrm(1, base);
-    if (base == esp) set_sib(times_1, esp, base);
-    set_disp8(disp);
-  } else {
-    // [base + disp/r]
-    set_modrm(2, base);
-    if (base == esp) set_sib(times_1, esp, base);
-    set_dispr(disp, rmode);
-  }
-}
-
-
-Operand::Operand(Register base,
-                 Register index,
-                 ScaleFactor scale,
-                 int32_t disp,
-                 RelocInfo::Mode rmode) {
-  DCHECK(index != esp);  // illegal addressing mode
-  // [base + index*scale + disp/r]
-  if (disp == 0 && RelocInfo::IsNone(rmode) && base != ebp) {
-    // [base + index*scale]
-    set_modrm(0, esp);
-    set_sib(scale, index, base);
-  } else if (is_int8(disp) && RelocInfo::IsNone(rmode)) {
-    // [base + index*scale + disp8]
-    set_modrm(1, esp);
-    set_sib(scale, index, base);
-    set_disp8(disp);
-  } else {
-    // [base + index*scale + disp/r]
-    set_modrm(2, esp);
-    set_sib(scale, index, base);
-    set_dispr(disp, rmode);
-  }
-}
-
-
-Operand::Operand(Register index,
-                 ScaleFactor scale,
-                 int32_t disp,
-                 RelocInfo::Mode rmode) {
-  DCHECK(index != esp);  // illegal addressing mode
-  // [index*scale + disp/r]
-  set_modrm(0, esp);
-  set_sib(scale, index, ebp);
-  set_dispr(disp, rmode);
-}
-
-
-bool Operand::is_reg_only() const {
-  return (buf_[0] & 0xF8) == 0xC0;  // Addressing mode is register only.
-}
-
-
-Register Operand::reg() const {
-  DCHECK(is_reg_only());
-  return Register::from_code(buf_[0] & 0x07);
-}
-
-void Assembler::AllocateAndInstallRequestedHeapObjects(Isolate* isolate) {
-  for (auto& request : heap_object_requests_) {
-    Handle<HeapObject> object;
-    switch (request.kind()) {
-      case HeapObjectRequest::kHeapNumber:
-        object = isolate->factory()->NewHeapNumber(request.heap_number(),
-                                                   IMMUTABLE, TENURED);
-        break;
-      case HeapObjectRequest::kCodeStub:
-        request.code_stub()->set_isolate(isolate);
-        object = request.code_stub()->GetCode();
-        break;
-    }
-    Address pc = buffer_ + request.offset();
-    Memory::Object_Handle_at(pc) = object;
-  }
-}
-
-// -----------------------------------------------------------------------------
-// Implementation of Assembler.
-
-// Emit a single byte. Must always be inlined.
-#define EMIT(x)                                 \
-  *pc_++ = (x)
-
-Assembler::Assembler(IsolateData isolate_data, void* buffer, int buffer_size)
-    : AssemblerBase(isolate_data, buffer, buffer_size) {
-// Clear the buffer in debug mode unless it was provided by the
-// caller in which case we can't be sure it's okay to overwrite
-// existing code in it.
-#ifdef DEBUG
-  if (own_buffer_) {
-    memset(buffer_, 0xCC, buffer_size_);  // int3
-  }
-#endif
-
-  reloc_info_writer.Reposition(buffer_ + buffer_size_, pc_);
-}
-
-void Assembler::GetCode(Isolate* isolate, CodeDesc* desc) {
-  // Finalize code (at this point overflow() may be true, but the gap ensures
-  // that we are still not overlapping instructions and relocation info).
-  DCHECK(pc_ <= reloc_info_writer.pos());  // No overlap.
-
-  AllocateAndInstallRequestedHeapObjects(isolate);
-
-  // Set up code descriptor.
-  desc->buffer = buffer_;
-  desc->buffer_size = buffer_size_;
-  desc->instr_size = pc_offset();
-  desc->reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos();
-  desc->origin = this;
-  desc->constant_pool_size = 0;
-  desc->unwinding_info_size = 0;
-  desc->unwinding_info = nullptr;
-
-  // Collection stage
-  auto jump_opt = jump_optimization_info();
-  if (jump_opt && jump_opt->is_collecting()) {
-    auto& bitmap = jump_opt->farjmp_bitmap();
-    int num = static_cast<int>(farjmp_positions_.size());
-    if (num && bitmap.empty()) {
-      bool can_opt = false;
-
-      bitmap.resize((num + 31) / 32, 0);
-      for (int i = 0; i < num; i++) {
-        int disp_pos = farjmp_positions_[i];
-        int disp = long_at(disp_pos);
-        if (is_int8(disp)) {
-          bitmap[i / 32] |= 1 << (i & 31);
-          can_opt = true;
-        }
-      }
-      if (can_opt) {
-        jump_opt->set_optimizable();
-      }
-    }
-  }
-}
-
-
-void Assembler::Align(int m) {
-  DCHECK(base::bits::IsPowerOfTwo(m));
-  int mask = m - 1;
-  int addr = pc_offset();
-  Nop((m - (addr & mask)) & mask);
-}
-
-
-bool Assembler::IsNop(Address addr) {
-  Address a = addr;
-  while (*a == 0x66) a++;
-  if (*a == 0x90) return true;
-  if (a[0] == 0xF && a[1] == 0x1F) return true;
-  return false;
-}
-
-
-void Assembler::Nop(int bytes) {
-  EnsureSpace ensure_space(this);
-
-  // Multi byte nops from http://support.amd.com/us/Processor_TechDocs/40546.pdf
-  while (bytes > 0) {
-    switch (bytes) {
-      case 2:
-        EMIT(0x66);
-      case 1:
-        EMIT(0x90);
-        return;
-      case 3:
-        EMIT(0xF);
-        EMIT(0x1F);
-        EMIT(0);
-        return;
-      case 4:
-        EMIT(0xF);
-        EMIT(0x1F);
-        EMIT(0x40);
-        EMIT(0);
-        return;
-      case 6:
-        EMIT(0x66);
-      case 5:
-        EMIT(0xF);
-        EMIT(0x1F);
-        EMIT(0x44);
-        EMIT(0);
-        EMIT(0);
-        return;
-      case 7:
-        EMIT(0xF);
-        EMIT(0x1F);
-        EMIT(0x80);
-        EMIT(0);
-        EMIT(0);
-        EMIT(0);
-        EMIT(0);
-        return;
-      default:
-      case 11:
-        EMIT(0x66);
-        bytes--;
-      case 10:
-        EMIT(0x66);
-        bytes--;
-      case 9:
-        EMIT(0x66);
-        bytes--;
-      case 8:
-        EMIT(0xF);
-        EMIT(0x1F);
-        EMIT(0x84);
-        EMIT(0);
-        EMIT(0);
-        EMIT(0);
-        EMIT(0);
-        EMIT(0);
-        bytes -= 8;
-    }
-  }
-}
-
-
-void Assembler::CodeTargetAlign() {
-  Align(16);  // Preferred alignment of jump targets on ia32.
-}
-
-
-void Assembler::cpuid() {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0xA2);
-}
-
-
-void Assembler::pushad() {
-  EnsureSpace ensure_space(this);
-  EMIT(0x60);
-}
-
-
-void Assembler::popad() {
-  EnsureSpace ensure_space(this);
-  EMIT(0x61);
-}
-
-
-void Assembler::pushfd() {
-  EnsureSpace ensure_space(this);
-  EMIT(0x9C);
-}
-
-
-void Assembler::popfd() {
-  EnsureSpace ensure_space(this);
-  EMIT(0x9D);
-}
-
-
-void Assembler::push(const Immediate& x) {
-  EnsureSpace ensure_space(this);
-  if (x.is_int8()) {
-    EMIT(0x6A);
-    EMIT(x.immediate());
-  } else {
-    EMIT(0x68);
-    emit(x);
-  }
-}
-
-
-void Assembler::push_imm32(int32_t imm32) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x68);
-  emit(imm32);
-}
-
-
-void Assembler::push(Register src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x50 | src.code());
-}
-
-
-void Assembler::push(const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xFF);
-  emit_operand(esi, src);
-}
-
-
-void Assembler::pop(Register dst) {
-  DCHECK_NOT_NULL(reloc_info_writer.last_pc());
-  EnsureSpace ensure_space(this);
-  EMIT(0x58 | dst.code());
-}
-
-
-void Assembler::pop(const Operand& dst) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x8F);
-  emit_operand(eax, dst);
-}
-
-
-void Assembler::enter(const Immediate& size) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xC8);
-  emit_w(size);
-  EMIT(0);
-}
-
-
-void Assembler::leave() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xC9);
-}
-
-
-void Assembler::mov_b(Register dst, const Operand& src) {
-  CHECK(dst.is_byte_register());
-  EnsureSpace ensure_space(this);
-  EMIT(0x8A);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::mov_b(const Operand& dst, const Immediate& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xC6);
-  emit_operand(eax, dst);
-  EMIT(static_cast<int8_t>(src.immediate()));
-}
-
-
-void Assembler::mov_b(const Operand& dst, Register src) {
-  CHECK(src.is_byte_register());
-  EnsureSpace ensure_space(this);
-  EMIT(0x88);
-  emit_operand(src, dst);
-}
-
-
-void Assembler::mov_w(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x8B);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::mov_w(const Operand& dst, Register src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x89);
-  emit_operand(src, dst);
-}
-
-
-void Assembler::mov_w(const Operand& dst, const Immediate& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0xC7);
-  emit_operand(eax, dst);
-  EMIT(static_cast<int8_t>(src.immediate() & 0xFF));
-  EMIT(static_cast<int8_t>(src.immediate() >> 8));
-}
-
-
-void Assembler::mov(Register dst, int32_t imm32) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xB8 | dst.code());
-  emit(imm32);
-}
-
-
-void Assembler::mov(Register dst, const Immediate& x) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xB8 | dst.code());
-  emit(x);
-}
-
-void Assembler::mov(Register dst, Handle<HeapObject> handle) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xB8 | dst.code());
-  emit(handle);
-}
-
-
-void Assembler::mov(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x8B);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::mov(Register dst, Register src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x89);
-  EMIT(0xC0 | src.code() << 3 | dst.code());
-}
-
-
-void Assembler::mov(const Operand& dst, const Immediate& x) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xC7);
-  emit_operand(eax, dst);
-  emit(x);
-}
-
-void Assembler::mov(const Operand& dst, Handle<HeapObject> handle) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xC7);
-  emit_operand(eax, dst);
-  emit(handle);
-}
-
-
-void Assembler::mov(const Operand& dst, Register src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x89);
-  emit_operand(src, dst);
-}
-
-
-void Assembler::movsx_b(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0xBE);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::movsx_w(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0xBF);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::movzx_b(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0xB6);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::movzx_w(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0xB7);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::cmov(Condition cc, Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  // Opcode: 0f 40 + cc /r.
-  EMIT(0x0F);
-  EMIT(0x40 + cc);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::cld() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xFC);
-}
-
-
-void Assembler::rep_movs() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF3);
-  EMIT(0xA5);
-}
-
-
-void Assembler::rep_stos() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF3);
-  EMIT(0xAB);
-}
-
-
-void Assembler::stos() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xAB);
-}
-
-
-void Assembler::xchg(Register dst, Register src) {
-  EnsureSpace ensure_space(this);
-  if (src == eax || dst == eax) {  // Single-byte encoding.
-    EMIT(0x90 | (src == eax ? dst.code() : src.code()));
-  } else {
-    EMIT(0x87);
-    EMIT(0xC0 | src.code() << 3 | dst.code());
-  }
-}
-
-
-void Assembler::xchg(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x87);
-  emit_operand(dst, src);
-}
-
-void Assembler::xchg_b(Register reg, const Operand& op) {
-  DCHECK(reg.is_byte_register());
-  EnsureSpace ensure_space(this);
-  EMIT(0x86);
-  emit_operand(reg, op);
-}
-
-void Assembler::xchg_w(Register reg, const Operand& op) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x87);
-  emit_operand(reg, op);
-}
-
-void Assembler::lock() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF0);
-}
-
-void Assembler::cmpxchg(const Operand& dst, Register src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0xB1);
-  emit_operand(src, dst);
-}
-
-void Assembler::cmpxchg_b(const Operand& dst, Register src) {
-  DCHECK(src.is_byte_register());
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0xB0);
-  emit_operand(src, dst);
-}
-
-void Assembler::cmpxchg_w(const Operand& dst, Register src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0xB1);
-  emit_operand(src, dst);
-}
-
-void Assembler::lfence() {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0xAE);
-  EMIT(0xE8);
-}
-
-void Assembler::adc(Register dst, int32_t imm32) {
-  EnsureSpace ensure_space(this);
-  emit_arith(2, Operand(dst), Immediate(imm32));
-}
-
-
-void Assembler::adc(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x13);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::add(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x03);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::add(const Operand& dst, Register src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x01);
-  emit_operand(src, dst);
-}
-
-
-void Assembler::add(const Operand& dst, const Immediate& x) {
-  DCHECK_NOT_NULL(reloc_info_writer.last_pc());
-  EnsureSpace ensure_space(this);
-  emit_arith(0, dst, x);
-}
-
-
-void Assembler::and_(Register dst, int32_t imm32) {
-  and_(dst, Immediate(imm32));
-}
-
-
-void Assembler::and_(Register dst, const Immediate& x) {
-  EnsureSpace ensure_space(this);
-  emit_arith(4, Operand(dst), x);
-}
-
-
-void Assembler::and_(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x23);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::and_(const Operand& dst, const Immediate& x) {
-  EnsureSpace ensure_space(this);
-  emit_arith(4, dst, x);
-}
-
-
-void Assembler::and_(const Operand& dst, Register src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x21);
-  emit_operand(src, dst);
-}
-
-void Assembler::cmpb(const Operand& op, Immediate imm8) {
-  DCHECK(imm8.is_int8() || imm8.is_uint8());
-  EnsureSpace ensure_space(this);
-  if (op.is_reg(eax)) {
-    EMIT(0x3C);
-  } else {
-    EMIT(0x80);
-    emit_operand(edi, op);  // edi == 7
-  }
-  emit_b(imm8);
-}
-
-
-void Assembler::cmpb(const Operand& op, Register reg) {
-  CHECK(reg.is_byte_register());
-  EnsureSpace ensure_space(this);
-  EMIT(0x38);
-  emit_operand(reg, op);
-}
-
-
-void Assembler::cmpb(Register reg, const Operand& op) {
-  CHECK(reg.is_byte_register());
-  EnsureSpace ensure_space(this);
-  EMIT(0x3A);
-  emit_operand(reg, op);
-}
-
-
-void Assembler::cmpw(const Operand& op, Immediate imm16) {
-  DCHECK(imm16.is_int16() || imm16.is_uint16());
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x81);
-  emit_operand(edi, op);
-  emit_w(imm16);
-}
-
-void Assembler::cmpw(Register reg, const Operand& op) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x3B);
-  emit_operand(reg, op);
-}
-
-void Assembler::cmpw(const Operand& op, Register reg) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x39);
-  emit_operand(reg, op);
-}
-
-void Assembler::cmp(Register reg, int32_t imm32) {
-  EnsureSpace ensure_space(this);
-  emit_arith(7, Operand(reg), Immediate(imm32));
-}
-
-void Assembler::cmp(Register reg, Handle<HeapObject> handle) {
-  EnsureSpace ensure_space(this);
-  emit_arith(7, Operand(reg), Immediate(handle));
-}
-
-
-void Assembler::cmp(Register reg, const Operand& op) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x3B);
-  emit_operand(reg, op);
-}
-
-void Assembler::cmp(const Operand& op, Register reg) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x39);
-  emit_operand(reg, op);
-}
-
-void Assembler::cmp(const Operand& op, const Immediate& imm) {
-  EnsureSpace ensure_space(this);
-  emit_arith(7, op, imm);
-}
-
-void Assembler::cmp(const Operand& op, Handle<HeapObject> handle) {
-  EnsureSpace ensure_space(this);
-  emit_arith(7, op, Immediate(handle));
-}
-
-
-void Assembler::cmpb_al(const Operand& op) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x38);  // CMP r/m8, r8
-  emit_operand(eax, op);  // eax has same code as register al.
-}
-
-
-void Assembler::cmpw_ax(const Operand& op) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x39);  // CMP r/m16, r16
-  emit_operand(eax, op);  // eax has same code as register ax.
-}
-
-
-void Assembler::dec_b(Register dst) {
-  CHECK(dst.is_byte_register());
-  EnsureSpace ensure_space(this);
-  EMIT(0xFE);
-  EMIT(0xC8 | dst.code());
-}
-
-
-void Assembler::dec_b(const Operand& dst) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xFE);
-  emit_operand(ecx, dst);
-}
-
-
-void Assembler::dec(Register dst) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x48 | dst.code());
-}
-
-
-void Assembler::dec(const Operand& dst) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xFF);
-  emit_operand(ecx, dst);
-}
-
-
-void Assembler::cdq() {
-  EnsureSpace ensure_space(this);
-  EMIT(0x99);
-}
-
-
-void Assembler::idiv(const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF7);
-  emit_operand(edi, src);
-}
-
-
-void Assembler::div(const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF7);
-  emit_operand(esi, src);
-}
-
-
-void Assembler::imul(Register reg) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF7);
-  EMIT(0xE8 | reg.code());
-}
-
-
-void Assembler::imul(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0xAF);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::imul(Register dst, Register src, int32_t imm32) {
-  imul(dst, Operand(src), imm32);
-}
-
-
-void Assembler::imul(Register dst, const Operand& src, int32_t imm32) {
-  EnsureSpace ensure_space(this);
-  if (is_int8(imm32)) {
-    EMIT(0x6B);
-    emit_operand(dst, src);
-    EMIT(imm32);
-  } else {
-    EMIT(0x69);
-    emit_operand(dst, src);
-    emit(imm32);
-  }
-}
-
-
-void Assembler::inc(Register dst) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x40 | dst.code());
-}
-
-
-void Assembler::inc(const Operand& dst) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xFF);
-  emit_operand(eax, dst);
-}
-
-
-void Assembler::lea(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x8D);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::mul(Register src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF7);
-  EMIT(0xE0 | src.code());
-}
-
-
-void Assembler::neg(Register dst) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF7);
-  EMIT(0xD8 | dst.code());
-}
-
-
-void Assembler::neg(const Operand& dst) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF7);
-  emit_operand(ebx, dst);
-}
-
-
-void Assembler::not_(Register dst) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF7);
-  EMIT(0xD0 | dst.code());
-}
-
-
-void Assembler::not_(const Operand& dst) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF7);
-  emit_operand(edx, dst);
-}
-
-
-void Assembler::or_(Register dst, int32_t imm32) {
-  EnsureSpace ensure_space(this);
-  emit_arith(1, Operand(dst), Immediate(imm32));
-}
-
-
-void Assembler::or_(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0B);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::or_(const Operand& dst, const Immediate& x) {
-  EnsureSpace ensure_space(this);
-  emit_arith(1, dst, x);
-}
-
-
-void Assembler::or_(const Operand& dst, Register src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x09);
-  emit_operand(src, dst);
-}
-
-
-void Assembler::rcl(Register dst, uint8_t imm8) {
-  EnsureSpace ensure_space(this);
-  DCHECK(is_uint5(imm8));  // illegal shift count
-  if (imm8 == 1) {
-    EMIT(0xD1);
-    EMIT(0xD0 | dst.code());
-  } else {
-    EMIT(0xC1);
-    EMIT(0xD0 | dst.code());
-    EMIT(imm8);
-  }
-}
-
-
-void Assembler::rcr(Register dst, uint8_t imm8) {
-  EnsureSpace ensure_space(this);
-  DCHECK(is_uint5(imm8));  // illegal shift count
-  if (imm8 == 1) {
-    EMIT(0xD1);
-    EMIT(0xD8 | dst.code());
-  } else {
-    EMIT(0xC1);
-    EMIT(0xD8 | dst.code());
-    EMIT(imm8);
-  }
-}
-
-
-void Assembler::ror(const Operand& dst, uint8_t imm8) {
-  EnsureSpace ensure_space(this);
-  DCHECK(is_uint5(imm8));  // illegal shift count
-  if (imm8 == 1) {
-    EMIT(0xD1);
-    emit_operand(ecx, dst);
-  } else {
-    EMIT(0xC1);
-    emit_operand(ecx, dst);
-    EMIT(imm8);
-  }
-}
-
-
-void Assembler::ror_cl(const Operand& dst) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xD3);
-  emit_operand(ecx, dst);
-}
-
-
-void Assembler::sar(const Operand& dst, uint8_t imm8) {
-  EnsureSpace ensure_space(this);
-  DCHECK(is_uint5(imm8));  // illegal shift count
-  if (imm8 == 1) {
-    EMIT(0xD1);
-    emit_operand(edi, dst);
-  } else {
-    EMIT(0xC1);
-    emit_operand(edi, dst);
-    EMIT(imm8);
-  }
-}
-
-
-void Assembler::sar_cl(const Operand& dst) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xD3);
-  emit_operand(edi, dst);
-}
-
-void Assembler::sbb(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x1B);
-  emit_operand(dst, src);
-}
-
-void Assembler::shld(Register dst, Register src, uint8_t shift) {
-  DCHECK(is_uint5(shift));
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0xA4);
-  emit_operand(src, Operand(dst));
-  EMIT(shift);
-}
-
-void Assembler::shld_cl(Register dst, Register src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0xA5);
-  emit_operand(src, Operand(dst));
-}
-
-
-void Assembler::shl(const Operand& dst, uint8_t imm8) {
-  EnsureSpace ensure_space(this);
-  DCHECK(is_uint5(imm8));  // illegal shift count
-  if (imm8 == 1) {
-    EMIT(0xD1);
-    emit_operand(esp, dst);
-  } else {
-    EMIT(0xC1);
-    emit_operand(esp, dst);
-    EMIT(imm8);
-  }
-}
-
-
-void Assembler::shl_cl(const Operand& dst) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xD3);
-  emit_operand(esp, dst);
-}
-
-void Assembler::shr(const Operand& dst, uint8_t imm8) {
-  EnsureSpace ensure_space(this);
-  DCHECK(is_uint5(imm8));  // illegal shift count
-  if (imm8 == 1) {
-    EMIT(0xD1);
-    emit_operand(ebp, dst);
-  } else {
-    EMIT(0xC1);
-    emit_operand(ebp, dst);
-    EMIT(imm8);
-  }
-}
-
-
-void Assembler::shr_cl(const Operand& dst) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xD3);
-  emit_operand(ebp, dst);
-}
-
-void Assembler::shrd(Register dst, Register src, uint8_t shift) {
-  DCHECK(is_uint5(shift));
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0xAC);
-  emit_operand(dst, Operand(src));
-  EMIT(shift);
-}
-
-void Assembler::shrd_cl(const Operand& dst, Register src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0xAD);
-  emit_operand(src, dst);
-}
-
-void Assembler::sub(const Operand& dst, const Immediate& x) {
-  EnsureSpace ensure_space(this);
-  emit_arith(5, dst, x);
-}
-
-
-void Assembler::sub(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x2B);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::sub(const Operand& dst, Register src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x29);
-  emit_operand(src, dst);
-}
-
-
-void Assembler::test(Register reg, const Immediate& imm) {
-  if (imm.is_uint8()) {
-    test_b(reg, imm);
-    return;
-  }
-
-  EnsureSpace ensure_space(this);
-  // This is not using emit_arith because test doesn't support
-  // sign-extension of 8-bit operands.
-  if (reg == eax) {
-    EMIT(0xA9);
-  } else {
-    EMIT(0xF7);
-    EMIT(0xC0 | reg.code());
-  }
-  emit(imm);
-}
-
-
-void Assembler::test(Register reg, const Operand& op) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x85);
-  emit_operand(reg, op);
-}
-
-
-void Assembler::test_b(Register reg, const Operand& op) {
-  CHECK(reg.is_byte_register());
-  EnsureSpace ensure_space(this);
-  EMIT(0x84);
-  emit_operand(reg, op);
-}
-
-
-void Assembler::test(const Operand& op, const Immediate& imm) {
-  if (op.is_reg_only()) {
-    test(op.reg(), imm);
-    return;
-  }
-  if (imm.is_uint8()) {
-    return test_b(op, imm);
-  }
-  EnsureSpace ensure_space(this);
-  EMIT(0xF7);
-  emit_operand(eax, op);
-  emit(imm);
-}
-
-void Assembler::test_b(Register reg, Immediate imm8) {
-  DCHECK(imm8.is_uint8());
-  EnsureSpace ensure_space(this);
-  // Only use test against byte for registers that have a byte
-  // variant: eax, ebx, ecx, and edx.
-  if (reg == eax) {
-    EMIT(0xA8);
-    emit_b(imm8);
-  } else if (reg.is_byte_register()) {
-    emit_arith_b(0xF6, 0xC0, reg, static_cast<uint8_t>(imm8.immediate()));
-  } else {
-    EMIT(0x66);
-    EMIT(0xF7);
-    EMIT(0xC0 | reg.code());
-    emit_w(imm8);
-  }
-}
-
-void Assembler::test_b(const Operand& op, Immediate imm8) {
-  if (op.is_reg_only()) {
-    test_b(op.reg(), imm8);
-    return;
-  }
-  EnsureSpace ensure_space(this);
-  EMIT(0xF6);
-  emit_operand(eax, op);
-  emit_b(imm8);
-}
-
-void Assembler::test_w(Register reg, Immediate imm16) {
-  DCHECK(imm16.is_int16() || imm16.is_uint16());
-  EnsureSpace ensure_space(this);
-  if (reg == eax) {
-    EMIT(0xA9);
-    emit_w(imm16);
-  } else {
-    EMIT(0x66);
-    EMIT(0xF7);
-    EMIT(0xC0 | reg.code());
-    emit_w(imm16);
-  }
-}
-
-void Assembler::test_w(Register reg, const Operand& op) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x85);
-  emit_operand(reg, op);
-}
-
-void Assembler::test_w(const Operand& op, Immediate imm16) {
-  DCHECK(imm16.is_int16() || imm16.is_uint16());
-  if (op.is_reg_only()) {
-    test_w(op.reg(), imm16);
-    return;
-  }
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0xF7);
-  emit_operand(eax, op);
-  emit_w(imm16);
-}
-
-void Assembler::xor_(Register dst, int32_t imm32) {
-  EnsureSpace ensure_space(this);
-  emit_arith(6, Operand(dst), Immediate(imm32));
-}
-
-
-void Assembler::xor_(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x33);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::xor_(const Operand& dst, Register src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x31);
-  emit_operand(src, dst);
-}
-
-
-void Assembler::xor_(const Operand& dst, const Immediate& x) {
-  EnsureSpace ensure_space(this);
-  emit_arith(6, dst, x);
-}
-
-
-void Assembler::bt(const Operand& dst, Register src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0xA3);
-  emit_operand(src, dst);
-}
-
-
-void Assembler::bts(const Operand& dst, Register src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0xAB);
-  emit_operand(src, dst);
-}
-
-
-void Assembler::bsr(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0xBD);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::bsf(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0xBC);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::hlt() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF4);
-}
-
-
-void Assembler::int3() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xCC);
-}
-
-
-void Assembler::nop() {
-  EnsureSpace ensure_space(this);
-  EMIT(0x90);
-}
-
-
-void Assembler::ret(int imm16) {
-  EnsureSpace ensure_space(this);
-  DCHECK(is_uint16(imm16));
-  if (imm16 == 0) {
-    EMIT(0xC3);
-  } else {
-    EMIT(0xC2);
-    EMIT(imm16 & 0xFF);
-    EMIT((imm16 >> 8) & 0xFF);
-  }
-}
-
-
-void Assembler::ud2() {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0x0B);
-}
-
-
-// Labels refer to positions in the (to be) generated code.
-// There are bound, linked, and unused labels.
-//
-// Bound labels refer to known positions in the already
-// generated code. pos() is the position the label refers to.
-//
-// Linked labels refer to unknown positions in the code
-// to be generated; pos() is the position of the 32bit
-// Displacement of the last instruction using the label.
-
-void Assembler::print(const Label* L) {
-  if (L->is_unused()) {
-    PrintF("unused label\n");
-  } else if (L->is_bound()) {
-    PrintF("bound label to %d\n", L->pos());
-  } else if (L->is_linked()) {
-    Label l;
-    l.link_to(L->pos());
-    PrintF("unbound label");
-    while (l.is_linked()) {
-      Displacement disp = disp_at(&l);
-      PrintF("@ %d ", l.pos());
-      disp.print();
-      PrintF("\n");
-      disp.next(&l);
-    }
-  } else {
-    PrintF("label in inconsistent state (pos = %d)\n", L->pos_);
-  }
-}
-
-
-void Assembler::bind_to(Label* L, int pos) {
-  EnsureSpace ensure_space(this);
-  DCHECK(0 <= pos && pos <= pc_offset());  // must have a valid binding position
-  while (L->is_linked()) {
-    Displacement disp = disp_at(L);
-    int fixup_pos = L->pos();
-    if (disp.type() == Displacement::CODE_ABSOLUTE) {
-      long_at_put(fixup_pos, reinterpret_cast<int>(buffer_ + pos));
-      internal_reference_positions_.push_back(fixup_pos);
-    } else if (disp.type() == Displacement::CODE_RELATIVE) {
-      // Relative to Code* heap object pointer.
-      long_at_put(fixup_pos, pos + Code::kHeaderSize - kHeapObjectTag);
-    } else {
-      if (disp.type() == Displacement::UNCONDITIONAL_JUMP) {
-        DCHECK_EQ(byte_at(fixup_pos - 1), 0xE9);  // jmp expected
-      }
-      // Relative address, relative to point after address.
-      int imm32 = pos - (fixup_pos + sizeof(int32_t));
-      long_at_put(fixup_pos, imm32);
-    }
-    disp.next(L);
-  }
-  while (L->is_near_linked()) {
-    int fixup_pos = L->near_link_pos();
-    int offset_to_next =
-        static_cast<int>(*reinterpret_cast<int8_t*>(addr_at(fixup_pos)));
-    DCHECK_LE(offset_to_next, 0);
-    // Relative address, relative to point after address.
-    int disp = pos - fixup_pos - sizeof(int8_t);
-    CHECK(0 <= disp && disp <= 127);
-    set_byte_at(fixup_pos, disp);
-    if (offset_to_next < 0) {
-      L->link_to(fixup_pos + offset_to_next, Label::kNear);
-    } else {
-      L->UnuseNear();
-    }
-  }
-
-  // Optimization stage
-  auto jump_opt = jump_optimization_info();
-  if (jump_opt && jump_opt->is_optimizing()) {
-    auto it = label_farjmp_maps_.find(L);
-    if (it != label_farjmp_maps_.end()) {
-      auto& pos_vector = it->second;
-      for (auto fixup_pos : pos_vector) {
-        int disp = pos - (fixup_pos + sizeof(int8_t));
-        CHECK(is_int8(disp));
-        set_byte_at(fixup_pos, disp);
-      }
-      label_farjmp_maps_.erase(it);
-    }
-  }
-  L->bind_to(pos);
-}
-
-
-void Assembler::bind(Label* L) {
-  EnsureSpace ensure_space(this);
-  DCHECK(!L->is_bound());  // label can only be bound once
-  bind_to(L, pc_offset());
-}
-
-void Assembler::record_farjmp_position(Label* L, int pos) {
-  auto& pos_vector = label_farjmp_maps_[L];
-  pos_vector.push_back(pos);
-}
-
-bool Assembler::is_optimizable_farjmp(int idx) {
-  if (predictable_code_size()) return false;
-
-  auto jump_opt = jump_optimization_info();
-  CHECK(jump_opt->is_optimizing());
-
-  auto& bitmap = jump_opt->farjmp_bitmap();
-  CHECK(idx < static_cast<int>(bitmap.size() * 32));
-  return !!(bitmap[idx / 32] & (1 << (idx & 31)));
-}
-
-void Assembler::call(Label* L) {
-  EnsureSpace ensure_space(this);
-  if (L->is_bound()) {
-    const int long_size = 5;
-    int offs = L->pos() - pc_offset();
-    DCHECK_LE(offs, 0);
-    // 1110 1000 #32-bit disp.
-    EMIT(0xE8);
-    emit(offs - long_size);
-  } else {
-    // 1110 1000 #32-bit disp.
-    EMIT(0xE8);
-    emit_disp(L, Displacement::OTHER);
-  }
-}
-
-
-void Assembler::call(byte* entry, RelocInfo::Mode rmode) {
-  EnsureSpace ensure_space(this);
-  DCHECK(!RelocInfo::IsCodeTarget(rmode));
-  EMIT(0xE8);
-  if (RelocInfo::IsRuntimeEntry(rmode)) {
-    emit(reinterpret_cast<uint32_t>(entry), rmode);
-  } else {
-    emit(entry - (pc_ + sizeof(int32_t)), rmode);
-  }
-}
-
-void Assembler::wasm_call(Address entry, RelocInfo::Mode rmode) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xE8);
-  emit(reinterpret_cast<intptr_t>(entry), rmode);
-}
-
-int Assembler::CallSize(const Operand& adr) {
-  // Call size is 1 (opcode) + adr.len_ (operand).
-  return 1 + adr.len_;
-}
-
-
-void Assembler::call(const Operand& adr) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xFF);
-  emit_operand(edx, adr);
-}
-
-
-int Assembler::CallSize(Handle<Code> code, RelocInfo::Mode rmode) {
-  return 1 /* EMIT */ + sizeof(uint32_t) /* emit */;
-}
-
-void Assembler::call(Handle<Code> code, RelocInfo::Mode rmode) {
-  EnsureSpace ensure_space(this);
-  DCHECK(RelocInfo::IsCodeTarget(rmode));
-  EMIT(0xE8);
-  emit(code, rmode);
-}
-
-void Assembler::call(CodeStub* stub) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xE8);
-  emit(Immediate::EmbeddedCode(stub));
-}
-
-void Assembler::jmp(Label* L, Label::Distance distance) {
-  EnsureSpace ensure_space(this);
-  if (L->is_bound()) {
-    const int short_size = 2;
-    const int long_size  = 5;
-    int offs = L->pos() - pc_offset();
-    DCHECK_LE(offs, 0);
-    if (is_int8(offs - short_size)) {
-      // 1110 1011 #8-bit disp.
-      EMIT(0xEB);
-      EMIT((offs - short_size) & 0xFF);
-    } else {
-      // 1110 1001 #32-bit disp.
-      EMIT(0xE9);
-      emit(offs - long_size);
-    }
-  } else if (distance == Label::kNear) {
-    EMIT(0xEB);
-    emit_near_disp(L);
-  } else {
-    auto jump_opt = jump_optimization_info();
-    if (V8_UNLIKELY(jump_opt)) {
-      if (jump_opt->is_optimizing() && is_optimizable_farjmp(farjmp_num_++)) {
-        EMIT(0xEB);
-        record_farjmp_position(L, pc_offset());
-        EMIT(0);
-        return;
-      }
-      if (jump_opt->is_collecting()) {
-        farjmp_positions_.push_back(pc_offset() + 1);
-      }
-    }
-    // 1110 1001 #32-bit disp.
-    EMIT(0xE9);
-    emit_disp(L, Displacement::UNCONDITIONAL_JUMP);
-  }
-}
-
-void Assembler::jmp(byte* entry, RelocInfo::Mode rmode) {
-  EnsureSpace ensure_space(this);
-  DCHECK(!RelocInfo::IsCodeTarget(rmode));
-  EMIT(0xE9);
-  if (RelocInfo::IsRuntimeEntry(rmode)) {
-    emit(reinterpret_cast<uint32_t>(entry), rmode);
-  } else {
-    emit(entry - (pc_ + sizeof(int32_t)), rmode);
-  }
-}
-
-
-void Assembler::jmp(const Operand& adr) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xFF);
-  emit_operand(esp, adr);
-}
-
-
-void Assembler::jmp(Handle<Code> code, RelocInfo::Mode rmode) {
-  EnsureSpace ensure_space(this);
-  DCHECK(RelocInfo::IsCodeTarget(rmode));
-  EMIT(0xE9);
-  emit(code, rmode);
-}
-
-
-void Assembler::j(Condition cc, Label* L, Label::Distance distance) {
-  EnsureSpace ensure_space(this);
-  DCHECK(0 <= cc && static_cast<int>(cc) < 16);
-  if (L->is_bound()) {
-    const int short_size = 2;
-    const int long_size  = 6;
-    int offs = L->pos() - pc_offset();
-    DCHECK_LE(offs, 0);
-    if (is_int8(offs - short_size)) {
-      // 0111 tttn #8-bit disp
-      EMIT(0x70 | cc);
-      EMIT((offs - short_size) & 0xFF);
-    } else {
-      // 0000 1111 1000 tttn #32-bit disp
-      EMIT(0x0F);
-      EMIT(0x80 | cc);
-      emit(offs - long_size);
-    }
-  } else if (distance == Label::kNear) {
-    EMIT(0x70 | cc);
-    emit_near_disp(L);
-  } else {
-    auto jump_opt = jump_optimization_info();
-    if (V8_UNLIKELY(jump_opt)) {
-      if (jump_opt->is_optimizing() && is_optimizable_farjmp(farjmp_num_++)) {
-        // 0111 tttn #8-bit disp
-        EMIT(0x70 | cc);
-        record_farjmp_position(L, pc_offset());
-        EMIT(0);
-        return;
-      }
-      if (jump_opt->is_collecting()) {
-        farjmp_positions_.push_back(pc_offset() + 2);
-      }
-    }
-    // 0000 1111 1000 tttn #32-bit disp
-    // Note: could eliminate cond. jumps to this jump if condition
-    //       is the same however, seems to be rather unlikely case.
-    EMIT(0x0F);
-    EMIT(0x80 | cc);
-    emit_disp(L, Displacement::OTHER);
-  }
-}
-
-
-void Assembler::j(Condition cc, byte* entry, RelocInfo::Mode rmode) {
-  EnsureSpace ensure_space(this);
-  DCHECK((0 <= cc) && (static_cast<int>(cc) < 16));
-  // 0000 1111 1000 tttn #32-bit disp.
-  EMIT(0x0F);
-  EMIT(0x80 | cc);
-  if (RelocInfo::IsRuntimeEntry(rmode)) {
-    emit(reinterpret_cast<uint32_t>(entry), rmode);
-  } else {
-    emit(entry - (pc_ + sizeof(int32_t)), rmode);
-  }
-}
-
-
-void Assembler::j(Condition cc, Handle<Code> code, RelocInfo::Mode rmode) {
-  EnsureSpace ensure_space(this);
-  // 0000 1111 1000 tttn #32-bit disp
-  EMIT(0x0F);
-  EMIT(0x80 | cc);
-  emit(code, rmode);
-}
-
-
-// FPU instructions.
-
-void Assembler::fld(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xD9, 0xC0, i);
-}
-
-
-void Assembler::fstp(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xDD, 0xD8, i);
-}
-
-
-void Assembler::fld1() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xD9);
-  EMIT(0xE8);
-}
-
-
-void Assembler::fldpi() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xD9);
-  EMIT(0xEB);
-}
-
-
-void Assembler::fldz() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xD9);
-  EMIT(0xEE);
-}
-
-
-void Assembler::fldln2() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xD9);
-  EMIT(0xED);
-}
-
-
-void Assembler::fld_s(const Operand& adr) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xD9);
-  emit_operand(eax, adr);
-}
-
-
-void Assembler::fld_d(const Operand& adr) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xDD);
-  emit_operand(eax, adr);
-}
-
-
-void Assembler::fstp_s(const Operand& adr) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xD9);
-  emit_operand(ebx, adr);
-}
-
-
-void Assembler::fst_s(const Operand& adr) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xD9);
-  emit_operand(edx, adr);
-}
-
-
-void Assembler::fstp_d(const Operand& adr) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xDD);
-  emit_operand(ebx, adr);
-}
-
-
-void Assembler::fst_d(const Operand& adr) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xDD);
-  emit_operand(edx, adr);
-}
-
-
-void Assembler::fild_s(const Operand& adr) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xDB);
-  emit_operand(eax, adr);
-}
-
-
-void Assembler::fild_d(const Operand& adr) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xDF);
-  emit_operand(ebp, adr);
-}
-
-
-void Assembler::fistp_s(const Operand& adr) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xDB);
-  emit_operand(ebx, adr);
-}
-
-
-void Assembler::fisttp_s(const Operand& adr) {
-  DCHECK(IsEnabled(SSE3));
-  EnsureSpace ensure_space(this);
-  EMIT(0xDB);
-  emit_operand(ecx, adr);
-}
-
-
-void Assembler::fisttp_d(const Operand& adr) {
-  DCHECK(IsEnabled(SSE3));
-  EnsureSpace ensure_space(this);
-  EMIT(0xDD);
-  emit_operand(ecx, adr);
-}
-
-
-void Assembler::fist_s(const Operand& adr) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xDB);
-  emit_operand(edx, adr);
-}
-
-
-void Assembler::fistp_d(const Operand& adr) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xDF);
-  emit_operand(edi, adr);
-}
-
-
-void Assembler::fabs() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xD9);
-  EMIT(0xE1);
-}
-
-
-void Assembler::fchs() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xD9);
-  EMIT(0xE0);
-}
-
-
-void Assembler::fcos() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xD9);
-  EMIT(0xFF);
-}
-
-
-void Assembler::fsin() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xD9);
-  EMIT(0xFE);
-}
-
-
-void Assembler::fptan() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xD9);
-  EMIT(0xF2);
-}
-
-
-void Assembler::fyl2x() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xD9);
-  EMIT(0xF1);
-}
-
-
-void Assembler::f2xm1() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xD9);
-  EMIT(0xF0);
-}
-
-
-void Assembler::fscale() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xD9);
-  EMIT(0xFD);
-}
-
-
-void Assembler::fninit() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xDB);
-  EMIT(0xE3);
-}
-
-
-void Assembler::fadd(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xDC, 0xC0, i);
-}
-
-
-void Assembler::fadd_i(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xD8, 0xC0, i);
-}
-
-
-void Assembler::fsub(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xDC, 0xE8, i);
-}
-
-
-void Assembler::fsub_i(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xD8, 0xE0, i);
-}
-
-
-void Assembler::fisub_s(const Operand& adr) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xDA);
-  emit_operand(esp, adr);
-}
-
-
-void Assembler::fmul_i(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xD8, 0xC8, i);
-}
-
-
-void Assembler::fmul(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xDC, 0xC8, i);
-}
-
-
-void Assembler::fdiv(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xDC, 0xF8, i);
-}
-
-
-void Assembler::fdiv_i(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xD8, 0xF0, i);
-}
-
-
-void Assembler::faddp(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xDE, 0xC0, i);
-}
-
-
-void Assembler::fsubp(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xDE, 0xE8, i);
-}
-
-
-void Assembler::fsubrp(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xDE, 0xE0, i);
-}
-
-
-void Assembler::fmulp(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xDE, 0xC8, i);
-}
-
-
-void Assembler::fdivp(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xDE, 0xF8, i);
-}
-
-
-void Assembler::fprem() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xD9);
-  EMIT(0xF8);
-}
-
-
-void Assembler::fprem1() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xD9);
-  EMIT(0xF5);
-}
-
-
-void Assembler::fxch(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xD9, 0xC8, i);
-}
-
-
-void Assembler::fincstp() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xD9);
-  EMIT(0xF7);
-}
-
-
-void Assembler::ffree(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xDD, 0xC0, i);
-}
-
-
-void Assembler::ftst() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xD9);
-  EMIT(0xE4);
-}
-
-
-void Assembler::fucomp(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xDD, 0xE8, i);
-}
-
-
-void Assembler::fucompp() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xDA);
-  EMIT(0xE9);
-}
-
-
-void Assembler::fucomi(int i) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xDB);
-  EMIT(0xE8 + i);
-}
-
-
-void Assembler::fucomip() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xDF);
-  EMIT(0xE9);
-}
-
-
-void Assembler::fcompp() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xDE);
-  EMIT(0xD9);
-}
-
-
-void Assembler::fnstsw_ax() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xDF);
-  EMIT(0xE0);
-}
-
-
-void Assembler::fwait() {
-  EnsureSpace ensure_space(this);
-  EMIT(0x9B);
-}
-
-
-void Assembler::frndint() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xD9);
-  EMIT(0xFC);
-}
-
-
-void Assembler::fnclex() {
-  EnsureSpace ensure_space(this);
-  EMIT(0xDB);
-  EMIT(0xE2);
-}
-
-
-void Assembler::sahf() {
-  EnsureSpace ensure_space(this);
-  EMIT(0x9E);
-}
-
-
-void Assembler::setcc(Condition cc, Register reg) {
-  DCHECK(reg.is_byte_register());
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0x90 | cc);
-  EMIT(0xC0 | reg.code());
-}
-
-
-void Assembler::cvttss2si(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF3);
-  EMIT(0x0F);
-  EMIT(0x2C);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::cvttsd2si(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF2);
-  EMIT(0x0F);
-  EMIT(0x2C);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::cvtsd2si(Register dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF2);
-  EMIT(0x0F);
-  EMIT(0x2D);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::cvtsi2ss(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF3);
-  EMIT(0x0F);
-  EMIT(0x2A);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::cvtsi2sd(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF2);
-  EMIT(0x0F);
-  EMIT(0x2A);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::cvtss2sd(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF3);
-  EMIT(0x0F);
-  EMIT(0x5A);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::cvtsd2ss(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF2);
-  EMIT(0x0F);
-  EMIT(0x5A);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::cvtdq2ps(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0x5B);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::cvttps2dq(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF3);
-  EMIT(0x0F);
-  EMIT(0x5B);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::addsd(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF2);
-  EMIT(0x0F);
-  EMIT(0x58);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::mulsd(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF2);
-  EMIT(0x0F);
-  EMIT(0x59);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::subsd(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF2);
-  EMIT(0x0F);
-  EMIT(0x5C);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::divsd(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF2);
-  EMIT(0x0F);
-  EMIT(0x5E);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::xorpd(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x57);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::andps(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0x54);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::orps(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0x56);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::xorps(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0x57);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::addps(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0x58);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::subps(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0x5C);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::mulps(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0x59);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::divps(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0x5E);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::rcpps(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0x53);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::rsqrtps(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0x52);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::minps(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0x5D);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::maxps(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0x5F);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::cmpps(XMMRegister dst, const Operand& src, int8_t cmp) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0xC2);
-  emit_sse_operand(dst, src);
-  EMIT(cmp);
-}
-
-void Assembler::sqrtsd(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF2);
-  EMIT(0x0F);
-  EMIT(0x51);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::haddps(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF2);
-  EMIT(0x0F);
-  EMIT(0x7C);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::andpd(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x54);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::orpd(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x56);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::ucomisd(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x2E);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::roundss(XMMRegister dst, XMMRegister src, RoundingMode mode) {
-  DCHECK(IsEnabled(SSE4_1));
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x3A);
-  EMIT(0x0A);
-  emit_sse_operand(dst, src);
-  // Mask precision exeption.
-  EMIT(static_cast<byte>(mode) | 0x8);
-}
-
-
-void Assembler::roundsd(XMMRegister dst, XMMRegister src, RoundingMode mode) {
-  DCHECK(IsEnabled(SSE4_1));
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x3A);
-  EMIT(0x0B);
-  emit_sse_operand(dst, src);
-  // Mask precision exeption.
-  EMIT(static_cast<byte>(mode) | 0x8);
-}
-
-
-void Assembler::movmskpd(Register dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x50);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::movmskps(Register dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0x50);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::maxsd(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF2);
-  EMIT(0x0F);
-  EMIT(0x5F);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::minsd(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF2);
-  EMIT(0x0F);
-  EMIT(0x5D);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::cmpltsd(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF2);
-  EMIT(0x0F);
-  EMIT(0xC2);
-  emit_sse_operand(dst, src);
-  EMIT(1);  // LT == 1
-}
-
-
-void Assembler::movaps(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0x28);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::movups(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0x10);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::movups(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0x10);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::movups(const Operand& dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0x11);
-  emit_sse_operand(src, dst);
-}
-
-void Assembler::shufps(XMMRegister dst, XMMRegister src, byte imm8) {
-  DCHECK(is_uint8(imm8));
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0xC6);
-  emit_sse_operand(dst, src);
-  EMIT(imm8);
-}
-
-
-void Assembler::movdqa(const Operand& dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x7F);
-  emit_sse_operand(src, dst);
-}
-
-
-void Assembler::movdqa(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x6F);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::movdqu(const Operand& dst, XMMRegister src ) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF3);
-  EMIT(0x0F);
-  EMIT(0x7F);
-  emit_sse_operand(src, dst);
-}
-
-
-void Assembler::movdqu(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF3);
-  EMIT(0x0F);
-  EMIT(0x6F);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::prefetch(const Operand& src, int level) {
-  DCHECK(is_uint2(level));
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0x18);
-  // Emit hint number in Reg position of RegR/M.
-  XMMRegister code = XMMRegister::from_code(level);
-  emit_sse_operand(code, src);
-}
-
-
-void Assembler::movsd(const Operand& dst, XMMRegister src ) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF2);  // double
-  EMIT(0x0F);
-  EMIT(0x11);  // store
-  emit_sse_operand(src, dst);
-}
-
-
-void Assembler::movsd(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF2);  // double
-  EMIT(0x0F);
-  EMIT(0x10);  // load
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::movss(const Operand& dst, XMMRegister src ) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF3);  // float
-  EMIT(0x0F);
-  EMIT(0x11);  // store
-  emit_sse_operand(src, dst);
-}
-
-
-void Assembler::movss(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF3);  // float
-  EMIT(0x0F);
-  EMIT(0x10);  // load
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::movd(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x6E);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::movd(const Operand& dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x7E);
-  emit_sse_operand(src, dst);
-}
-
-
-void Assembler::extractps(Register dst, XMMRegister src, byte imm8) {
-  DCHECK(IsEnabled(SSE4_1));
-  DCHECK(is_uint8(imm8));
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x3A);
-  EMIT(0x17);
-  emit_sse_operand(src, dst);
-  EMIT(imm8);
-}
-
-void Assembler::ptest(XMMRegister dst, XMMRegister src) {
-  DCHECK(IsEnabled(SSE4_1));
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x38);
-  EMIT(0x17);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::psllw(XMMRegister reg, int8_t shift) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x71);
-  emit_sse_operand(esi, reg);  // esi == 6
-  EMIT(shift);
-}
-
-void Assembler::pslld(XMMRegister reg, int8_t shift) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x72);
-  emit_sse_operand(esi, reg);  // esi == 6
-  EMIT(shift);
-}
-
-void Assembler::psrlw(XMMRegister reg, int8_t shift) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x71);
-  emit_sse_operand(edx, reg);  // edx == 2
-  EMIT(shift);
-}
-
-void Assembler::psrld(XMMRegister reg, int8_t shift) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x72);
-  emit_sse_operand(edx, reg);  // edx == 2
-  EMIT(shift);
-}
-
-void Assembler::psraw(XMMRegister reg, int8_t shift) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x71);
-  emit_sse_operand(esp, reg);  // esp == 4
-  EMIT(shift);
-}
-
-void Assembler::psrad(XMMRegister reg, int8_t shift) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x72);
-  emit_sse_operand(esp, reg);  // esp == 4
-  EMIT(shift);
-}
-
-void Assembler::psllq(XMMRegister reg, int8_t shift) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x73);
-  emit_sse_operand(esi, reg);  // esi == 6
-  EMIT(shift);
-}
-
-
-void Assembler::psllq(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0xF3);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::psrlq(XMMRegister reg, int8_t shift) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x73);
-  emit_sse_operand(edx, reg);  // edx == 2
-  EMIT(shift);
-}
-
-
-void Assembler::psrlq(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0xD3);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::pshuflw(XMMRegister dst, const Operand& src, uint8_t shuffle) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF2);
-  EMIT(0x0F);
-  EMIT(0x70);
-  emit_sse_operand(dst, src);
-  EMIT(shuffle);
-}
-
-void Assembler::pshufd(XMMRegister dst, const Operand& src, uint8_t shuffle) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x70);
-  emit_sse_operand(dst, src);
-  EMIT(shuffle);
-}
-
-void Assembler::pextrb(const Operand& dst, XMMRegister src, int8_t offset) {
-  DCHECK(IsEnabled(SSE4_1));
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x3A);
-  EMIT(0x14);
-  emit_sse_operand(src, dst);
-  EMIT(offset);
-}
-
-void Assembler::pextrw(const Operand& dst, XMMRegister src, int8_t offset) {
-  DCHECK(IsEnabled(SSE4_1));
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x3A);
-  EMIT(0x15);
-  emit_sse_operand(src, dst);
-  EMIT(offset);
-}
-
-void Assembler::pextrd(const Operand& dst, XMMRegister src, int8_t offset) {
-  DCHECK(IsEnabled(SSE4_1));
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x3A);
-  EMIT(0x16);
-  emit_sse_operand(src, dst);
-  EMIT(offset);
-}
-
-void Assembler::insertps(XMMRegister dst, const Operand& src, int8_t offset) {
-  DCHECK(IsEnabled(SSE4_1));
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x3A);
-  EMIT(0x21);
-  emit_sse_operand(dst, src);
-  EMIT(offset);
-}
-
-void Assembler::pinsrb(XMMRegister dst, const Operand& src, int8_t offset) {
-  DCHECK(IsEnabled(SSE4_1));
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x3A);
-  EMIT(0x20);
-  emit_sse_operand(dst, src);
-  EMIT(offset);
-}
-
-void Assembler::pinsrw(XMMRegister dst, const Operand& src, int8_t offset) {
-  DCHECK(is_uint8(offset));
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0xC4);
-  emit_sse_operand(dst, src);
-  EMIT(offset);
-}
-
-void Assembler::pinsrd(XMMRegister dst, const Operand& src, int8_t offset) {
-  DCHECK(IsEnabled(SSE4_1));
-  EnsureSpace ensure_space(this);
-  EMIT(0x66);
-  EMIT(0x0F);
-  EMIT(0x3A);
-  EMIT(0x22);
-  emit_sse_operand(dst, src);
-  EMIT(offset);
-}
-
-
-void Assembler::addss(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF3);
-  EMIT(0x0F);
-  EMIT(0x58);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::subss(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF3);
-  EMIT(0x0F);
-  EMIT(0x5C);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::mulss(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF3);
-  EMIT(0x0F);
-  EMIT(0x59);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::divss(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF3);
-  EMIT(0x0F);
-  EMIT(0x5E);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::sqrtss(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF3);
-  EMIT(0x0F);
-  EMIT(0x51);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::ucomiss(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0x0F);
-  EMIT(0x2E);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::maxss(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF3);
-  EMIT(0x0F);
-  EMIT(0x5F);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::minss(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  EMIT(0xF3);
-  EMIT(0x0F);
-  EMIT(0x5D);
-  emit_sse_operand(dst, src);
-}
-
-
-// AVX instructions
-void Assembler::vfmasd(byte op, XMMRegister dst, XMMRegister src1,
-                       const Operand& src2) {
-  DCHECK(IsEnabled(FMA3));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(src1, kLIG, k66, k0F38, kW1);
-  EMIT(op);
-  emit_sse_operand(dst, src2);
-}
-
-
-void Assembler::vfmass(byte op, XMMRegister dst, XMMRegister src1,
-                       const Operand& src2) {
-  DCHECK(IsEnabled(FMA3));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(src1, kLIG, k66, k0F38, kW0);
-  EMIT(op);
-  emit_sse_operand(dst, src2);
-}
-
-
-void Assembler::vsd(byte op, XMMRegister dst, XMMRegister src1,
-                    const Operand& src2) {
-  vinstr(op, dst, src1, src2, kF2, k0F, kWIG);
-}
-
-
-void Assembler::vss(byte op, XMMRegister dst, XMMRegister src1,
-                    const Operand& src2) {
-  vinstr(op, dst, src1, src2, kF3, k0F, kWIG);
-}
-
-
-void Assembler::vps(byte op, XMMRegister dst, XMMRegister src1,
-                    const Operand& src2) {
-  vinstr(op, dst, src1, src2, kNone, k0F, kWIG);
-}
-
-
-void Assembler::vpd(byte op, XMMRegister dst, XMMRegister src1,
-                    const Operand& src2) {
-  vinstr(op, dst, src1, src2, k66, k0F, kWIG);
-}
-
-void Assembler::vcmpps(XMMRegister dst, XMMRegister src1, const Operand& src2,
-                       int8_t cmp) {
-  vps(0xC2, dst, src1, src2);
-  EMIT(cmp);
-}
-
-void Assembler::vshufps(XMMRegister dst, XMMRegister src1, const Operand& src2,
-                        byte imm8) {
-  DCHECK(is_uint8(imm8));
-  vps(0xC6, dst, src1, src2);
-  EMIT(imm8);
-}
-
-void Assembler::vpsllw(XMMRegister dst, XMMRegister src, int8_t imm8) {
-  XMMRegister iop = XMMRegister::from_code(6);
-  vinstr(0x71, iop, dst, Operand(src), k66, k0F, kWIG);
-  EMIT(imm8);
-}
-
-void Assembler::vpslld(XMMRegister dst, XMMRegister src, int8_t imm8) {
-  XMMRegister iop = XMMRegister::from_code(6);
-  vinstr(0x72, iop, dst, Operand(src), k66, k0F, kWIG);
-  EMIT(imm8);
-}
-
-void Assembler::vpsrlw(XMMRegister dst, XMMRegister src, int8_t imm8) {
-  XMMRegister iop = XMMRegister::from_code(2);
-  vinstr(0x71, iop, dst, Operand(src), k66, k0F, kWIG);
-  EMIT(imm8);
-}
-
-void Assembler::vpsrld(XMMRegister dst, XMMRegister src, int8_t imm8) {
-  XMMRegister iop = XMMRegister::from_code(2);
-  vinstr(0x72, iop, dst, Operand(src), k66, k0F, kWIG);
-  EMIT(imm8);
-}
-
-void Assembler::vpsraw(XMMRegister dst, XMMRegister src, int8_t imm8) {
-  XMMRegister iop = XMMRegister::from_code(4);
-  vinstr(0x71, iop, dst, Operand(src), k66, k0F, kWIG);
-  EMIT(imm8);
-}
-
-void Assembler::vpsrad(XMMRegister dst, XMMRegister src, int8_t imm8) {
-  XMMRegister iop = XMMRegister::from_code(4);
-  vinstr(0x72, iop, dst, Operand(src), k66, k0F, kWIG);
-  EMIT(imm8);
-}
-
-void Assembler::vpshuflw(XMMRegister dst, const Operand& src, uint8_t shuffle) {
-  vinstr(0x70, dst, xmm0, src, kF2, k0F, kWIG);
-  EMIT(shuffle);
-}
-
-void Assembler::vpshufd(XMMRegister dst, const Operand& src, uint8_t shuffle) {
-  vinstr(0x70, dst, xmm0, src, k66, k0F, kWIG);
-  EMIT(shuffle);
-}
-
-void Assembler::vpextrb(const Operand& dst, XMMRegister src, int8_t offset) {
-  vinstr(0x14, src, xmm0, dst, k66, k0F3A, kWIG);
-  EMIT(offset);
-}
-
-void Assembler::vpextrw(const Operand& dst, XMMRegister src, int8_t offset) {
-  vinstr(0x15, src, xmm0, dst, k66, k0F3A, kWIG);
-  EMIT(offset);
-}
-
-void Assembler::vpextrd(const Operand& dst, XMMRegister src, int8_t offset) {
-  vinstr(0x16, src, xmm0, dst, k66, k0F3A, kWIG);
-  EMIT(offset);
-}
-
-void Assembler::vinsertps(XMMRegister dst, XMMRegister src1,
-                          const Operand& src2, int8_t offset) {
-  vinstr(0x21, dst, src1, src2, k66, k0F3A, kWIG);
-  EMIT(offset);
-}
-
-void Assembler::vpinsrb(XMMRegister dst, XMMRegister src1, const Operand& src2,
-                        int8_t offset) {
-  vinstr(0x20, dst, src1, src2, k66, k0F3A, kWIG);
-  EMIT(offset);
-}
-
-void Assembler::vpinsrw(XMMRegister dst, XMMRegister src1, const Operand& src2,
-                        int8_t offset) {
-  vinstr(0xC4, dst, src1, src2, k66, k0F, kWIG);
-  EMIT(offset);
-}
-
-void Assembler::vpinsrd(XMMRegister dst, XMMRegister src1, const Operand& src2,
-                        int8_t offset) {
-  vinstr(0x22, dst, src1, src2, k66, k0F3A, kWIG);
-  EMIT(offset);
-}
-
-void Assembler::bmi1(byte op, Register reg, Register vreg, const Operand& rm) {
-  DCHECK(IsEnabled(BMI1));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(vreg, kLZ, kNone, k0F38, kW0);
-  EMIT(op);
-  emit_operand(reg, rm);
-}
-
-
-void Assembler::tzcnt(Register dst, const Operand& src) {
-  DCHECK(IsEnabled(BMI1));
-  EnsureSpace ensure_space(this);
-  EMIT(0xF3);
-  EMIT(0x0F);
-  EMIT(0xBC);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::lzcnt(Register dst, const Operand& src) {
-  DCHECK(IsEnabled(LZCNT));
-  EnsureSpace ensure_space(this);
-  EMIT(0xF3);
-  EMIT(0x0F);
-  EMIT(0xBD);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::popcnt(Register dst, const Operand& src) {
-  DCHECK(IsEnabled(POPCNT));
-  EnsureSpace ensure_space(this);
-  EMIT(0xF3);
-  EMIT(0x0F);
-  EMIT(0xB8);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::bmi2(SIMDPrefix pp, byte op, Register reg, Register vreg,
-                     const Operand& rm) {
-  DCHECK(IsEnabled(BMI2));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(vreg, kLZ, pp, k0F38, kW0);
-  EMIT(op);
-  emit_operand(reg, rm);
-}
-
-
-void Assembler::rorx(Register dst, const Operand& src, byte imm8) {
-  DCHECK(IsEnabled(BMI2));
-  DCHECK(is_uint8(imm8));
-  Register vreg = Register::from_code<0>();  // VEX.vvvv unused
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(vreg, kLZ, kF2, k0F3A, kW0);
-  EMIT(0xF0);
-  emit_operand(dst, src);
-  EMIT(imm8);
-}
-
-void Assembler::sse2_instr(XMMRegister dst, const Operand& src, byte prefix,
-                           byte escape, byte opcode) {
-  EnsureSpace ensure_space(this);
-  EMIT(prefix);
-  EMIT(escape);
-  EMIT(opcode);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::ssse3_instr(XMMRegister dst, const Operand& src, byte prefix,
-                            byte escape1, byte escape2, byte opcode) {
-  DCHECK(IsEnabled(SSSE3));
-  EnsureSpace ensure_space(this);
-  EMIT(prefix);
-  EMIT(escape1);
-  EMIT(escape2);
-  EMIT(opcode);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::sse4_instr(XMMRegister dst, const Operand& src, byte prefix,
-                           byte escape1, byte escape2, byte opcode) {
-  DCHECK(IsEnabled(SSE4_1));
-  EnsureSpace ensure_space(this);
-  EMIT(prefix);
-  EMIT(escape1);
-  EMIT(escape2);
-  EMIT(opcode);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::vinstr(byte op, XMMRegister dst, XMMRegister src1,
-                       const Operand& src2, SIMDPrefix pp, LeadingOpcode m,
-                       VexW w) {
-  DCHECK(IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(src1, kL128, pp, m, w);
-  EMIT(op);
-  emit_sse_operand(dst, src2);
-}
-
-void Assembler::emit_sse_operand(XMMRegister reg, const Operand& adr) {
-  Register ireg = Register::from_code(reg.code());
-  emit_operand(ireg, adr);
-}
-
-
-void Assembler::emit_sse_operand(XMMRegister dst, XMMRegister src) {
-  EMIT(0xC0 | dst.code() << 3 | src.code());
-}
-
-
-void Assembler::emit_sse_operand(Register dst, XMMRegister src) {
-  EMIT(0xC0 | dst.code() << 3 | src.code());
-}
-
-
-void Assembler::emit_sse_operand(XMMRegister dst, Register src) {
-  EMIT(0xC0 | (dst.code() << 3) | src.code());
-}
-
-
-void Assembler::emit_vex_prefix(XMMRegister vreg, VectorLength l, SIMDPrefix pp,
-                                LeadingOpcode mm, VexW w) {
-  if (mm != k0F || w != kW0) {
-    EMIT(0xC4);
-    // Change RXB from "110" to "111" to align with gdb disassembler.
-    EMIT(0xE0 | mm);
-    EMIT(w | ((~vreg.code() & 0xF) << 3) | l | pp);
-  } else {
-    EMIT(0xC5);
-    EMIT(((~vreg.code()) << 3) | l | pp);
-  }
-}
-
-
-void Assembler::emit_vex_prefix(Register vreg, VectorLength l, SIMDPrefix pp,
-                                LeadingOpcode mm, VexW w) {
-  XMMRegister ivreg = XMMRegister::from_code(vreg.code());
-  emit_vex_prefix(ivreg, l, pp, mm, w);
-}
-
-
-void Assembler::GrowBuffer() {
-  DCHECK(buffer_overflow());
-  if (!own_buffer_) FATAL("external code buffer is too small");
-
-  // Compute new buffer size.
-  CodeDesc desc;  // the new buffer
-  desc.buffer_size = 2 * buffer_size_;
-
-  // Some internal data structures overflow for very large buffers,
-  // they must ensure that kMaximalBufferSize is not too large.
-  if (desc.buffer_size > kMaximalBufferSize) {
-    V8::FatalProcessOutOfMemory("Assembler::GrowBuffer");
-  }
-
-  // Set up new buffer.
-  desc.buffer = NewArray<byte>(desc.buffer_size);
-  desc.origin = this;
-  desc.instr_size = pc_offset();
-  desc.reloc_size = (buffer_ + buffer_size_) - (reloc_info_writer.pos());
-
-  // Clear the buffer in debug mode. Use 'int3' instructions to make
-  // sure to get into problems if we ever run uninitialized code.
-#ifdef DEBUG
-  memset(desc.buffer, 0xCC, desc.buffer_size);
-#endif
-
-  // Copy the data.
-  int pc_delta = desc.buffer - buffer_;
-  int rc_delta = (desc.buffer + desc.buffer_size) - (buffer_ + buffer_size_);
-  MemMove(desc.buffer, buffer_, desc.instr_size);
-  MemMove(rc_delta + reloc_info_writer.pos(), reloc_info_writer.pos(),
-          desc.reloc_size);
-
-  // Switch buffers.
-  DeleteArray(buffer_);
-  buffer_ = desc.buffer;
-  buffer_size_ = desc.buffer_size;
-  pc_ += pc_delta;
-  reloc_info_writer.Reposition(reloc_info_writer.pos() + rc_delta,
-                               reloc_info_writer.last_pc() + pc_delta);
-
-  // Relocate internal references.
-  for (auto pos : internal_reference_positions_) {
-    int32_t* p = reinterpret_cast<int32_t*>(buffer_ + pos);
-    *p += pc_delta;
-  }
-
-  DCHECK(!buffer_overflow());
-}
-
-
-void Assembler::emit_arith_b(int op1, int op2, Register dst, int imm8) {
-  DCHECK(is_uint8(op1) && is_uint8(op2));  // wrong opcode
-  DCHECK(is_uint8(imm8));
-  DCHECK_EQ(op1 & 0x01, 0);  // should be 8bit operation
-  EMIT(op1);
-  EMIT(op2 | dst.code());
-  EMIT(imm8);
-}
-
-
-void Assembler::emit_arith(int sel, Operand dst, const Immediate& x) {
-  DCHECK((0 <= sel) && (sel <= 7));
-  Register ireg = Register::from_code(sel);
-  if (x.is_int8()) {
-    EMIT(0x83);  // using a sign-extended 8-bit immediate.
-    emit_operand(ireg, dst);
-    EMIT(x.immediate() & 0xFF);
-  } else if (dst.is_reg(eax)) {
-    EMIT((sel << 3) | 0x05);  // short form if the destination is eax.
-    emit(x);
-  } else {
-    EMIT(0x81);  // using a literal 32-bit immediate.
-    emit_operand(ireg, dst);
-    emit(x);
-  }
-}
-
-
-void Assembler::emit_operand(Register reg, const Operand& adr) {
-  const unsigned length = adr.len_;
-  DCHECK_GT(length, 0);
-
-  // Emit updated ModRM byte containing the given register.
-  pc_[0] = (adr.buf_[0] & ~0x38) | (reg.code() << 3);
-
-  // Emit the rest of the encoded operand.
-  for (unsigned i = 1; i < length; i++) pc_[i] = adr.buf_[i];
-  pc_ += length;
-
-  // Emit relocation information if necessary.
-  if (length >= sizeof(int32_t) && !RelocInfo::IsNone(adr.rmode_)) {
-    pc_ -= sizeof(int32_t);  // pc_ must be *at* disp32
-    RecordRelocInfo(adr.rmode_);
-    if (adr.rmode_ == RelocInfo::INTERNAL_REFERENCE) {  // Fixup for labels
-      emit_label(*reinterpret_cast<Label**>(pc_));
-    } else {
-      pc_ += sizeof(int32_t);
-    }
-  }
-}
-
-
-void Assembler::emit_label(Label* label) {
-  if (label->is_bound()) {
-    internal_reference_positions_.push_back(pc_offset());
-    emit(reinterpret_cast<uint32_t>(buffer_ + label->pos()));
-  } else {
-    emit_disp(label, Displacement::CODE_ABSOLUTE);
-  }
-}
-
-
-void Assembler::emit_farith(int b1, int b2, int i) {
-  DCHECK(is_uint8(b1) && is_uint8(b2));  // wrong opcode
-  DCHECK(0 <= i &&  i < 8);  // illegal stack offset
-  EMIT(b1);
-  EMIT(b2 + i);
-}
-
-
-void Assembler::db(uint8_t data) {
-  EnsureSpace ensure_space(this);
-  EMIT(data);
-}
-
-
-void Assembler::dd(uint32_t data) {
-  EnsureSpace ensure_space(this);
-  emit(data);
-}
-
-
-void Assembler::dq(uint64_t data) {
-  EnsureSpace ensure_space(this);
-  emit_q(data);
-}
-
-
-void Assembler::dd(Label* label) {
-  EnsureSpace ensure_space(this);
-  RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE);
-  emit_label(label);
-}
-
-
-void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
-  DCHECK(!RelocInfo::IsNone(rmode));
-  // Don't record external references unless the heap will be serialized.
-  if (rmode == RelocInfo::EXTERNAL_REFERENCE &&
-      !serializer_enabled() && !emit_debug_code()) {
-    return;
-  }
-  RelocInfo rinfo(pc_, rmode, data, nullptr);
-  reloc_info_writer.Write(&rinfo);
-}
-
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_IA32
diff --git a/src/v8/src/ia32/assembler-ia32.h b/src/v8/src/ia32/assembler-ia32.h
deleted file mode 100644
index d57e3be..0000000
--- a/src/v8/src/ia32/assembler-ia32.h
+++ /dev/null
@@ -1,1884 +0,0 @@
-// Copyright (c) 1994-2006 Sun Microsystems Inc.
-// 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.
-//
-// - Redistribution 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 Sun Microsystems or the names of 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.
-
-// The original source code covered by the above license above has been
-// modified significantly by Google Inc.
-// Copyright 2011 the V8 project authors. All rights reserved.
-
-// A light-weight IA32 Assembler.
-
-#ifndef V8_IA32_ASSEMBLER_IA32_H_
-#define V8_IA32_ASSEMBLER_IA32_H_
-
-#include <deque>
-
-#include "src/assembler.h"
-#include "src/ia32/sse-instr.h"
-#include "src/isolate.h"
-#include "src/utils.h"
-
-namespace v8 {
-namespace internal {
-
-#define GENERAL_REGISTERS(V) \
-  V(eax)                     \
-  V(ecx)                     \
-  V(edx)                     \
-  V(ebx)                     \
-  V(esp)                     \
-  V(ebp)                     \
-  V(esi)                     \
-  V(edi)
-
-#define ALLOCATABLE_GENERAL_REGISTERS(V) \
-  V(eax)                                 \
-  V(ecx)                                 \
-  V(edx)                                 \
-  V(ebx)                                 \
-  V(esi)                                 \
-  V(edi)
-
-#define DOUBLE_REGISTERS(V) \
-  V(xmm0)                   \
-  V(xmm1)                   \
-  V(xmm2)                   \
-  V(xmm3)                   \
-  V(xmm4)                   \
-  V(xmm5)                   \
-  V(xmm6)                   \
-  V(xmm7)
-
-#define FLOAT_REGISTERS DOUBLE_REGISTERS
-#define SIMD128_REGISTERS DOUBLE_REGISTERS
-
-#define ALLOCATABLE_DOUBLE_REGISTERS(V) \
-  V(xmm1)                               \
-  V(xmm2)                               \
-  V(xmm3)                               \
-  V(xmm4)                               \
-  V(xmm5)                               \
-  V(xmm6)                               \
-  V(xmm7)
-
-enum RegisterCode {
-#define REGISTER_CODE(R) kRegCode_##R,
-  GENERAL_REGISTERS(REGISTER_CODE)
-#undef REGISTER_CODE
-      kRegAfterLast
-};
-
-class Register : public RegisterBase<Register, kRegAfterLast> {
- public:
-  bool is_byte_register() const { return reg_code_ <= 3; }
-
- private:
-  friend class RegisterBase<Register, kRegAfterLast>;
-  explicit constexpr Register(int code) : RegisterBase(code) {}
-};
-
-static_assert(IS_TRIVIALLY_COPYABLE(Register) &&
-                  sizeof(Register) == sizeof(int),
-              "Register can efficiently be passed by value");
-
-#define DEFINE_REGISTER(R) \
-  constexpr Register R = Register::from_code<kRegCode_##R>();
-GENERAL_REGISTERS(DEFINE_REGISTER)
-#undef DEFINE_REGISTER
-constexpr Register no_reg = Register::no_reg();
-
-constexpr bool kPadArguments = false;
-constexpr bool kSimpleFPAliasing = true;
-constexpr bool kSimdMaskRegisters = false;
-
-enum DoubleCode {
-#define REGISTER_CODE(R) kDoubleCode_##R,
-  DOUBLE_REGISTERS(REGISTER_CODE)
-#undef REGISTER_CODE
-      kDoubleAfterLast
-};
-
-class XMMRegister : public RegisterBase<XMMRegister, kDoubleAfterLast> {
-  friend class RegisterBase<XMMRegister, kDoubleAfterLast>;
-  explicit constexpr XMMRegister(int code) : RegisterBase(code) {}
-};
-
-typedef XMMRegister FloatRegister;
-
-typedef XMMRegister DoubleRegister;
-
-typedef XMMRegister Simd128Register;
-
-#define DEFINE_REGISTER(R) \
-  constexpr DoubleRegister R = DoubleRegister::from_code<kDoubleCode_##R>();
-DOUBLE_REGISTERS(DEFINE_REGISTER)
-#undef DEFINE_REGISTER
-constexpr DoubleRegister no_double_reg = DoubleRegister::no_reg();
-
-// Note that the bit values must match those used in actual instruction encoding
-constexpr int kNumRegs = 8;
-
-// Caller-saved registers
-constexpr RegList kJSCallerSaved =
-    Register::ListOf<eax, ecx, edx,
-                     ebx,  // used as a caller-saved register in JavaScript code
-                     edi   // callee function
-                     >();
-
-constexpr int kNumJSCallerSaved = 5;
-
-// Number of registers for which space is reserved in safepoints.
-constexpr int kNumSafepointRegisters = 8;
-
-enum Condition {
-  // any value < 0 is considered no_condition
-  no_condition  = -1,
-
-  overflow      =  0,
-  no_overflow   =  1,
-  below         =  2,
-  above_equal   =  3,
-  equal         =  4,
-  not_equal     =  5,
-  below_equal   =  6,
-  above         =  7,
-  negative      =  8,
-  positive      =  9,
-  parity_even   = 10,
-  parity_odd    = 11,
-  less          = 12,
-  greater_equal = 13,
-  less_equal    = 14,
-  greater       = 15,
-
-  // aliases
-  carry         = below,
-  not_carry     = above_equal,
-  zero          = equal,
-  not_zero      = not_equal,
-  sign          = negative,
-  not_sign      = positive
-};
-
-
-// Returns the equivalent of !cc.
-// Negation of the default no_condition (-1) results in a non-default
-// no_condition value (-2). As long as tests for no_condition check
-// for condition < 0, this will work as expected.
-inline Condition NegateCondition(Condition cc) {
-  return static_cast<Condition>(cc ^ 1);
-}
-
-
-// Commute a condition such that {a cond b == b cond' a}.
-inline Condition CommuteCondition(Condition cc) {
-  switch (cc) {
-    case below:
-      return above;
-    case above:
-      return below;
-    case above_equal:
-      return below_equal;
-    case below_equal:
-      return above_equal;
-    case less:
-      return greater;
-    case greater:
-      return less;
-    case greater_equal:
-      return less_equal;
-    case less_equal:
-      return greater_equal;
-    default:
-      return cc;
-  }
-}
-
-
-enum RoundingMode {
-  kRoundToNearest = 0x0,
-  kRoundDown = 0x1,
-  kRoundUp = 0x2,
-  kRoundToZero = 0x3
-};
-
-// -----------------------------------------------------------------------------
-// Machine instruction Immediates
-
-class Immediate BASE_EMBEDDED {
- public:
-  inline explicit Immediate(int x) {
-    value_.immediate = x;
-    rmode_ = RelocInfo::NONE32;
-  }
-  inline explicit Immediate(const ExternalReference& ext) {
-    value_.immediate = reinterpret_cast<int32_t>(ext.address());
-    rmode_ = RelocInfo::EXTERNAL_REFERENCE;
-  }
-  inline explicit Immediate(Handle<HeapObject> handle) {
-    value_.immediate = reinterpret_cast<intptr_t>(handle.address());
-    rmode_ = RelocInfo::EMBEDDED_OBJECT;
-  }
-  inline explicit Immediate(Smi* value) {
-    value_.immediate = reinterpret_cast<intptr_t>(value);
-    rmode_ = RelocInfo::NONE32;
-  }
-  inline explicit Immediate(Address addr) {
-    value_.immediate = reinterpret_cast<int32_t>(addr);
-    rmode_ = RelocInfo::NONE32;
-  }
-  inline explicit Immediate(Address x, RelocInfo::Mode rmode) {
-    value_.immediate = reinterpret_cast<int32_t>(x);
-    rmode_ = rmode;
-  }
-
-  static Immediate EmbeddedNumber(double number);  // Smi or HeapNumber.
-  static Immediate EmbeddedCode(CodeStub* code);
-
-  static Immediate CodeRelativeOffset(Label* label) {
-    return Immediate(label);
-  }
-
-  bool is_heap_object_request() const {
-    DCHECK_IMPLIES(is_heap_object_request_,
-                   rmode_ == RelocInfo::EMBEDDED_OBJECT ||
-                       rmode_ == RelocInfo::CODE_TARGET);
-    return is_heap_object_request_;
-  }
-
-  HeapObjectRequest heap_object_request() const {
-    DCHECK(is_heap_object_request());
-    return value_.heap_object_request;
-  }
-
-  int immediate() const {
-    DCHECK(!is_heap_object_request());
-    return value_.immediate;
-  }
-
-  bool is_zero() const { return RelocInfo::IsNone(rmode_) && immediate() == 0; }
-  bool is_int8() const {
-    return RelocInfo::IsNone(rmode_) && i::is_int8(immediate());
-  }
-  bool is_uint8() const {
-    return RelocInfo::IsNone(rmode_) && i::is_uint8(immediate());
-  }
-  bool is_int16() const {
-    return RelocInfo::IsNone(rmode_) && i::is_int16(immediate());
-  }
-
-  bool is_uint16() const {
-    return RelocInfo::IsNone(rmode_) && i::is_uint16(immediate());
-  }
-
-  RelocInfo::Mode rmode() const { return rmode_; }
-
- private:
-  inline explicit Immediate(Label* value) {
-    value_.immediate = reinterpret_cast<int32_t>(value);
-    rmode_ = RelocInfo::INTERNAL_REFERENCE;
-  }
-
-  union Value {
-    Value() {}
-    HeapObjectRequest heap_object_request;
-    int immediate;
-  } value_;
-  bool is_heap_object_request_ = false;
-  RelocInfo::Mode rmode_;
-
-  friend class Operand;
-  friend class Assembler;
-  friend class MacroAssembler;
-};
-
-
-// -----------------------------------------------------------------------------
-// Machine instruction Operands
-
-enum ScaleFactor {
-  times_1 = 0,
-  times_2 = 1,
-  times_4 = 2,
-  times_8 = 3,
-  times_int_size = times_4,
-  times_half_pointer_size = times_2,
-  times_pointer_size = times_4,
-  times_twice_pointer_size = times_8
-};
-
-
-class Operand BASE_EMBEDDED {
- public:
-  // reg
-  INLINE(explicit Operand(Register reg)) { set_modrm(3, reg); }
-
-  // XMM reg
-  INLINE(explicit Operand(XMMRegister xmm_reg)) {
-    Register reg = Register::from_code(xmm_reg.code());
-    set_modrm(3, reg);
-  }
-
-  // [disp/r]
-  INLINE(explicit Operand(int32_t disp, RelocInfo::Mode rmode)) {
-    set_modrm(0, ebp);
-    set_dispr(disp, rmode);
-  }
-
-  // [disp/r]
-  INLINE(explicit Operand(Immediate imm));
-
-  // [base + disp/r]
-  explicit Operand(Register base, int32_t disp,
-                   RelocInfo::Mode rmode = RelocInfo::NONE32);
-
-  // [base + index*scale + disp/r]
-  explicit Operand(Register base,
-                   Register index,
-                   ScaleFactor scale,
-                   int32_t disp,
-                   RelocInfo::Mode rmode = RelocInfo::NONE32);
-
-  // [index*scale + disp/r]
-  explicit Operand(Register index,
-                   ScaleFactor scale,
-                   int32_t disp,
-                   RelocInfo::Mode rmode = RelocInfo::NONE32);
-
-  static Operand JumpTable(Register index, ScaleFactor scale, Label* table) {
-    return Operand(index, scale, reinterpret_cast<int32_t>(table),
-                   RelocInfo::INTERNAL_REFERENCE);
-  }
-
-  static Operand StaticVariable(const ExternalReference& ext) {
-    return Operand(reinterpret_cast<int32_t>(ext.address()),
-                   RelocInfo::EXTERNAL_REFERENCE);
-  }
-
-  static Operand StaticArray(Register index,
-                             ScaleFactor scale,
-                             const ExternalReference& arr) {
-    return Operand(index, scale, reinterpret_cast<int32_t>(arr.address()),
-                   RelocInfo::EXTERNAL_REFERENCE);
-  }
-
-  static Operand ForRegisterPlusImmediate(Register base, Immediate imm) {
-    return Operand(base, imm.value_.immediate, imm.rmode_);
-  }
-
-  // Returns true if this Operand is a wrapper for the specified register.
-  bool is_reg(Register reg) const { return is_reg(reg.code()); }
-  bool is_reg(XMMRegister reg) const { return is_reg(reg.code()); }
-
-  // Returns true if this Operand is a wrapper for one register.
-  bool is_reg_only() const;
-
-  // Asserts that this Operand is a wrapper for one register and returns the
-  // register.
-  Register reg() const;
-
- private:
-  // Set the ModRM byte without an encoded 'reg' register. The
-  // register is encoded later as part of the emit_operand operation.
-  inline void set_modrm(int mod, Register rm) {
-    DCHECK_EQ(mod & -4, 0);
-    buf_[0] = mod << 6 | rm.code();
-    len_ = 1;
-  }
-
-  inline void set_sib(ScaleFactor scale, Register index, Register base);
-  inline void set_disp8(int8_t disp);
-  inline void set_dispr(int32_t disp, RelocInfo::Mode rmode) {
-    DCHECK(len_ == 1 || len_ == 2);
-    int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]);
-    *p = disp;
-    len_ += sizeof(int32_t);
-    rmode_ = rmode;
-  }
-
-  inline bool is_reg(int reg_code) const {
-    return ((buf_[0] & 0xF8) == 0xC0)  // addressing mode is register only.
-           && ((buf_[0] & 0x07) == reg_code);  // register codes match.
-  }
-
-  byte buf_[6];
-  // The number of bytes in buf_.
-  unsigned int len_;
-  // Only valid if len_ > 4.
-  RelocInfo::Mode rmode_;
-
-  friend class Assembler;
-};
-
-
-// -----------------------------------------------------------------------------
-// A Displacement describes the 32bit immediate field of an instruction which
-// may be used together with a Label in order to refer to a yet unknown code
-// position. Displacements stored in the instruction stream are used to describe
-// the instruction and to chain a list of instructions using the same Label.
-// A Displacement contains 2 different fields:
-//
-// next field: position of next displacement in the chain (0 = end of list)
-// type field: instruction type
-//
-// A next value of null (0) indicates the end of a chain (note that there can
-// be no displacement at position zero, because there is always at least one
-// instruction byte before the displacement).
-//
-// Displacement _data field layout
-//
-// |31.....2|1......0|
-// [  next  |  type  |
-
-class Displacement BASE_EMBEDDED {
- public:
-  enum Type { UNCONDITIONAL_JUMP, CODE_RELATIVE, OTHER, CODE_ABSOLUTE };
-
-  int data() const { return data_; }
-  Type type() const { return TypeField::decode(data_); }
-  void next(Label* L) const {
-    int n = NextField::decode(data_);
-    n > 0 ? L->link_to(n) : L->Unuse();
-  }
-  void link_to(Label* L) { init(L, type()); }
-
-  explicit Displacement(int data) { data_ = data; }
-
-  Displacement(Label* L, Type type) { init(L, type); }
-
-  void print() {
-    PrintF("%s (%x) ", (type() == UNCONDITIONAL_JUMP ? "jmp" : "[other]"),
-                       NextField::decode(data_));
-  }
-
- private:
-  int data_;
-
-  class TypeField: public BitField<Type, 0, 2> {};
-  class NextField: public BitField<int,  2, 32-2> {};
-
-  void init(Label* L, Type type);
-};
-
-
-class Assembler : public AssemblerBase {
- private:
-  // We check before assembling an instruction that there is sufficient
-  // space to write an instruction and its relocation information.
-  // The relocation writer's position must be kGap bytes above the end of
-  // the generated instructions. This leaves enough space for the
-  // longest possible ia32 instruction, 15 bytes, and the longest possible
-  // relocation information encoding, RelocInfoWriter::kMaxLength == 16.
-  // (There is a 15 byte limit on ia32 instruction length that rules out some
-  // otherwise valid instructions.)
-  // This allows for a single, fast space check per instruction.
-  static constexpr int kGap = 32;
-
- public:
-  // Create an assembler. Instructions and relocation information are emitted
-  // into a buffer, with the instructions starting from the beginning and the
-  // relocation information starting from the end of the buffer. See CodeDesc
-  // for a detailed comment on the layout (globals.h).
-  //
-  // If the provided buffer is nullptr, the assembler allocates and grows its
-  // own buffer, and buffer_size determines the initial buffer size. The buffer
-  // is owned by the assembler and deallocated upon destruction of the
-  // assembler.
-  //
-  // If the provided buffer is not nullptr, the assembler uses the provided
-  // buffer for code generation and assumes its size to be buffer_size. If the
-  // buffer is too small, a fatal error occurs. No deallocation of the buffer is
-  // done upon destruction of the assembler.
-  Assembler(Isolate* isolate, void* buffer, int buffer_size)
-      : Assembler(IsolateData(isolate), buffer, buffer_size) {}
-  Assembler(IsolateData isolate_data, void* buffer, int buffer_size);
-  virtual ~Assembler() {}
-
-  // GetCode emits any pending (non-emitted) code and fills the descriptor
-  // desc. GetCode() is idempotent; it returns the same result if no other
-  // Assembler functions are invoked in between GetCode() calls.
-  void GetCode(Isolate* isolate, CodeDesc* desc);
-
-  // Read/Modify the code target in the branch/call instruction at pc.
-  // The isolate argument is unused (and may be nullptr) when skipping flushing.
-  inline static Address target_address_at(Address pc, Address constant_pool);
-  inline static void set_target_address_at(
-      Isolate* isolate, Address pc, Address constant_pool, Address target,
-      ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED);
-
-  // Return the code target address at a call site from the return address
-  // of that call in the instruction stream.
-  inline static Address target_address_from_return_address(Address pc);
-
-  // This sets the branch destination (which is in the instruction on x86).
-  // This is for calls and branches within generated code.
-  inline static void deserialization_set_special_target_at(
-      Isolate* isolate, Address instruction_payload, Code* code,
-      Address target);
-
-  // This sets the internal reference at the pc.
-  inline static void deserialization_set_target_internal_reference_at(
-      Isolate* isolate, Address pc, Address target,
-      RelocInfo::Mode mode = RelocInfo::INTERNAL_REFERENCE);
-
-  static constexpr int kSpecialTargetSize = kPointerSize;
-
-  // Distance between the address of the code target in the call instruction
-  // and the return address
-  static constexpr int kCallTargetAddressOffset = kPointerSize;
-
-  static constexpr int kCallInstructionLength = 5;
-
-  // One byte opcode for test al, 0xXX.
-  static constexpr byte kTestAlByte = 0xA8;
-  // One byte opcode for nop.
-  static constexpr byte kNopByte = 0x90;
-
-  // One byte opcode for a short unconditional jump.
-  static constexpr byte kJmpShortOpcode = 0xEB;
-  // One byte prefix for a short conditional jump.
-  static constexpr byte kJccShortPrefix = 0x70;
-  static constexpr byte kJncShortOpcode = kJccShortPrefix | not_carry;
-  static constexpr byte kJcShortOpcode = kJccShortPrefix | carry;
-  static constexpr byte kJnzShortOpcode = kJccShortPrefix | not_zero;
-  static constexpr byte kJzShortOpcode = kJccShortPrefix | zero;
-
-  // ---------------------------------------------------------------------------
-  // Code generation
-  //
-  // - function names correspond one-to-one to ia32 instruction mnemonics
-  // - unless specified otherwise, instructions operate on 32bit operands
-  // - instructions on 8bit (byte) operands/registers have a trailing '_b'
-  // - instructions on 16bit (word) operands/registers have a trailing '_w'
-  // - naming conflicts with C++ keywords are resolved via a trailing '_'
-
-  // NOTE ON INTERFACE: Currently, the interface is not very consistent
-  // in the sense that some operations (e.g. mov()) can be called in more
-  // the one way to generate the same instruction: The Register argument
-  // can in some cases be replaced with an Operand(Register) argument.
-  // This should be cleaned up and made more orthogonal. The questions
-  // is: should we always use Operands instead of Registers where an
-  // Operand is possible, or should we have a Register (overloaded) form
-  // instead? We must be careful to make sure that the selected instruction
-  // is obvious from the parameters to avoid hard-to-find code generation
-  // bugs.
-
-  // Insert the smallest number of nop instructions
-  // possible to align the pc offset to a multiple
-  // of m. m must be a power of 2.
-  void Align(int m);
-  // Insert the smallest number of zero bytes possible to align the pc offset
-  // to a mulitple of m. m must be a power of 2 (>= 2).
-  void DataAlign(int m);
-  void Nop(int bytes = 1);
-  // Aligns code to something that's optimal for a jump target for the platform.
-  void CodeTargetAlign();
-
-  // Stack
-  void pushad();
-  void popad();
-
-  void pushfd();
-  void popfd();
-
-  void push(const Immediate& x);
-  void push_imm32(int32_t imm32);
-  void push(Register src);
-  void push(const Operand& src);
-
-  void pop(Register dst);
-  void pop(const Operand& dst);
-
-  void enter(const Immediate& size);
-  void leave();
-
-  // Moves
-  void mov_b(Register dst, Register src) { mov_b(dst, Operand(src)); }
-  void mov_b(Register dst, const Operand& src);
-  void mov_b(Register dst, int8_t imm8) { mov_b(Operand(dst), imm8); }
-  void mov_b(const Operand& dst, int8_t src) { mov_b(dst, Immediate(src)); }
-  void mov_b(const Operand& dst, const Immediate& src);
-  void mov_b(const Operand& dst, Register src);
-
-  void mov_w(Register dst, const Operand& src);
-  void mov_w(const Operand& dst, int16_t src) { mov_w(dst, Immediate(src)); }
-  void mov_w(const Operand& dst, const Immediate& src);
-  void mov_w(const Operand& dst, Register src);
-
-  void mov(Register dst, int32_t imm32);
-  void mov(Register dst, const Immediate& x);
-  void mov(Register dst, Handle<HeapObject> handle);
-  void mov(Register dst, const Operand& src);
-  void mov(Register dst, Register src);
-  void mov(const Operand& dst, const Immediate& x);
-  void mov(const Operand& dst, Handle<HeapObject> handle);
-  void mov(const Operand& dst, Register src);
-
-  void movsx_b(Register dst, Register src) { movsx_b(dst, Operand(src)); }
-  void movsx_b(Register dst, const Operand& src);
-
-  void movsx_w(Register dst, Register src) { movsx_w(dst, Operand(src)); }
-  void movsx_w(Register dst, const Operand& src);
-
-  void movzx_b(Register dst, Register src) { movzx_b(dst, Operand(src)); }
-  void movzx_b(Register dst, const Operand& src);
-
-  void movzx_w(Register dst, Register src) { movzx_w(dst, Operand(src)); }
-  void movzx_w(Register dst, const Operand& src);
-
-  // Conditional moves
-  void cmov(Condition cc, Register dst, Register src) {
-    cmov(cc, dst, Operand(src));
-  }
-  void cmov(Condition cc, Register dst, const Operand& src);
-
-  // Flag management.
-  void cld();
-
-  // Repetitive string instructions.
-  void rep_movs();
-  void rep_stos();
-  void stos();
-
-  // Exchange
-  void xchg(Register dst, Register src);
-  void xchg(Register dst, const Operand& src);
-  void xchg_b(Register reg, const Operand& op);
-  void xchg_w(Register reg, const Operand& op);
-
-  // Lock prefix
-  void lock();
-
-  // CompareExchange
-  void cmpxchg(const Operand& dst, Register src);
-  void cmpxchg_b(const Operand& dst, Register src);
-  void cmpxchg_w(const Operand& dst, Register src);
-
-  // Memory Fence
-  void lfence();
-
-  // Arithmetics
-  void adc(Register dst, int32_t imm32);
-  void adc(Register dst, const Operand& src);
-
-  void add(Register dst, Register src) { add(dst, Operand(src)); }
-  void add(Register dst, const Operand& src);
-  void add(const Operand& dst, Register src);
-  void add(Register dst, const Immediate& imm) { add(Operand(dst), imm); }
-  void add(const Operand& dst, const Immediate& x);
-
-  void and_(Register dst, int32_t imm32);
-  void and_(Register dst, const Immediate& x);
-  void and_(Register dst, Register src) { and_(dst, Operand(src)); }
-  void and_(Register dst, const Operand& src);
-  void and_(const Operand& dst, Register src);
-  void and_(const Operand& dst, const Immediate& x);
-
-  void cmpb(Register reg, Immediate imm8) { cmpb(Operand(reg), imm8); }
-  void cmpb(const Operand& op, Immediate imm8);
-  void cmpb(Register reg, const Operand& op);
-  void cmpb(const Operand& op, Register reg);
-  void cmpb(Register dst, Register src) { cmpb(Operand(dst), src); }
-  void cmpb_al(const Operand& op);
-  void cmpw_ax(const Operand& op);
-  void cmpw(const Operand& dst, Immediate src);
-  void cmpw(Register dst, Immediate src) { cmpw(Operand(dst), src); }
-  void cmpw(Register dst, const Operand& src);
-  void cmpw(Register dst, Register src) { cmpw(Operand(dst), src); }
-  void cmpw(const Operand& dst, Register src);
-  void cmp(Register reg, int32_t imm32);
-  void cmp(Register reg, Handle<HeapObject> handle);
-  void cmp(Register reg0, Register reg1) { cmp(reg0, Operand(reg1)); }
-  void cmp(Register reg, const Operand& op);
-  void cmp(Register reg, const Immediate& imm) { cmp(Operand(reg), imm); }
-  void cmp(const Operand& op, Register reg);
-  void cmp(const Operand& op, const Immediate& imm);
-  void cmp(const Operand& op, Handle<HeapObject> handle);
-
-  void dec_b(Register dst);
-  void dec_b(const Operand& dst);
-
-  void dec(Register dst);
-  void dec(const Operand& dst);
-
-  void cdq();
-
-  void idiv(Register src) { idiv(Operand(src)); }
-  void idiv(const Operand& src);
-  void div(Register src) { div(Operand(src)); }
-  void div(const Operand& src);
-
-  // Signed multiply instructions.
-  void imul(Register src);                               // edx:eax = eax * src.
-  void imul(Register dst, Register src) { imul(dst, Operand(src)); }
-  void imul(Register dst, const Operand& src);           // dst = dst * src.
-  void imul(Register dst, Register src, int32_t imm32);  // dst = src * imm32.
-  void imul(Register dst, const Operand& src, int32_t imm32);
-
-  void inc(Register dst);
-  void inc(const Operand& dst);
-
-  void lea(Register dst, const Operand& src);
-
-  // Unsigned multiply instruction.
-  void mul(Register src);                                // edx:eax = eax * reg.
-
-  void neg(Register dst);
-  void neg(const Operand& dst);
-
-  void not_(Register dst);
-  void not_(const Operand& dst);
-
-  void or_(Register dst, int32_t imm32);
-  void or_(Register dst, Register src) { or_(dst, Operand(src)); }
-  void or_(Register dst, const Operand& src);
-  void or_(const Operand& dst, Register src);
-  void or_(Register dst, const Immediate& imm) { or_(Operand(dst), imm); }
-  void or_(const Operand& dst, const Immediate& x);
-
-  void rcl(Register dst, uint8_t imm8);
-  void rcr(Register dst, uint8_t imm8);
-
-  void ror(Register dst, uint8_t imm8) { ror(Operand(dst), imm8); }
-  void ror(const Operand& dst, uint8_t imm8);
-  void ror_cl(Register dst) { ror_cl(Operand(dst)); }
-  void ror_cl(const Operand& dst);
-
-  void sar(Register dst, uint8_t imm8) { sar(Operand(dst), imm8); }
-  void sar(const Operand& dst, uint8_t imm8);
-  void sar_cl(Register dst) { sar_cl(Operand(dst)); }
-  void sar_cl(const Operand& dst);
-
-  void sbb(Register dst, const Operand& src);
-
-  void shl(Register dst, uint8_t imm8) { shl(Operand(dst), imm8); }
-  void shl(const Operand& dst, uint8_t imm8);
-  void shl_cl(Register dst) { shl_cl(Operand(dst)); }
-  void shl_cl(const Operand& dst);
-  void shld(Register dst, Register src, uint8_t shift);
-  void shld_cl(Register dst, Register src);
-
-  void shr(Register dst, uint8_t imm8) { shr(Operand(dst), imm8); }
-  void shr(const Operand& dst, uint8_t imm8);
-  void shr_cl(Register dst) { shr_cl(Operand(dst)); }
-  void shr_cl(const Operand& dst);
-  void shrd(Register dst, Register src, uint8_t shift);
-  void shrd_cl(Register dst, Register src) { shrd_cl(Operand(dst), src); }
-  void shrd_cl(const Operand& dst, Register src);
-
-  void sub(Register dst, const Immediate& imm) { sub(Operand(dst), imm); }
-  void sub(const Operand& dst, const Immediate& x);
-  void sub(Register dst, Register src) { sub(dst, Operand(src)); }
-  void sub(Register dst, const Operand& src);
-  void sub(const Operand& dst, Register src);
-
-  void test(Register reg, const Immediate& imm);
-  void test(Register reg0, Register reg1) { test(reg0, Operand(reg1)); }
-  void test(Register reg, const Operand& op);
-  void test(const Operand& op, const Immediate& imm);
-  void test(const Operand& op, Register reg) { test(reg, op); }
-  void test_b(Register reg, const Operand& op);
-  void test_b(Register reg, Immediate imm8);
-  void test_b(const Operand& op, Immediate imm8);
-  void test_b(const Operand& op, Register reg) { test_b(reg, op); }
-  void test_b(Register dst, Register src) { test_b(dst, Operand(src)); }
-  void test_w(Register reg, const Operand& op);
-  void test_w(Register reg, Immediate imm16);
-  void test_w(const Operand& op, Immediate imm16);
-  void test_w(const Operand& op, Register reg) { test_w(reg, op); }
-  void test_w(Register dst, Register src) { test_w(dst, Operand(src)); }
-
-  void xor_(Register dst, int32_t imm32);
-  void xor_(Register dst, Register src) { xor_(dst, Operand(src)); }
-  void xor_(Register dst, const Operand& src);
-  void xor_(const Operand& dst, Register src);
-  void xor_(Register dst, const Immediate& imm) { xor_(Operand(dst), imm); }
-  void xor_(const Operand& dst, const Immediate& x);
-
-  // Bit operations.
-  void bt(const Operand& dst, Register src);
-  void bts(Register dst, Register src) { bts(Operand(dst), src); }
-  void bts(const Operand& dst, Register src);
-  void bsr(Register dst, Register src) { bsr(dst, Operand(src)); }
-  void bsr(Register dst, const Operand& src);
-  void bsf(Register dst, Register src) { bsf(dst, Operand(src)); }
-  void bsf(Register dst, const Operand& src);
-
-  // Miscellaneous
-  void hlt();
-  void int3();
-  void nop();
-  void ret(int imm16);
-  void ud2();
-
-  // Label operations & relative jumps (PPUM Appendix D)
-  //
-  // Takes a branch opcode (cc) and a label (L) and generates
-  // either a backward branch or a forward branch and links it
-  // to the label fixup chain. Usage:
-  //
-  // Label L;    // unbound label
-  // j(cc, &L);  // forward branch to unbound label
-  // bind(&L);   // bind label to the current pc
-  // j(cc, &L);  // backward branch to bound label
-  // bind(&L);   // illegal: a label may be bound only once
-  //
-  // Note: The same Label can be used for forward and backward branches
-  // but it may be bound only once.
-
-  void bind(Label* L);  // binds an unbound label L to the current code position
-
-  // Calls
-  void call(Label* L);
-  void call(byte* entry, RelocInfo::Mode rmode);
-  int CallSize(const Operand& adr);
-  void call(Register reg) { call(Operand(reg)); }
-  void call(const Operand& adr);
-  int CallSize(Handle<Code> code, RelocInfo::Mode mode);
-  void call(Handle<Code> code, RelocInfo::Mode rmode);
-  void call(CodeStub* stub);
-  void wasm_call(Address address, RelocInfo::Mode rmode);
-
-  // Jumps
-  // unconditional jump to L
-  void jmp(Label* L, Label::Distance distance = Label::kFar);
-  void jmp(byte* entry, RelocInfo::Mode rmode);
-  void jmp(Register reg) { jmp(Operand(reg)); }
-  void jmp(const Operand& adr);
-  void jmp(Handle<Code> code, RelocInfo::Mode rmode);
-
-  // Conditional jumps
-  void j(Condition cc,
-         Label* L,
-         Label::Distance distance = Label::kFar);
-  void j(Condition cc, byte* entry, RelocInfo::Mode rmode);
-  void j(Condition cc, Handle<Code> code,
-         RelocInfo::Mode rmode = RelocInfo::CODE_TARGET);
-
-  // Floating-point operations
-  void fld(int i);
-  void fstp(int i);
-
-  void fld1();
-  void fldz();
-  void fldpi();
-  void fldln2();
-
-  void fld_s(const Operand& adr);
-  void fld_d(const Operand& adr);
-
-  void fstp_s(const Operand& adr);
-  void fst_s(const Operand& adr);
-  void fstp_d(const Operand& adr);
-  void fst_d(const Operand& adr);
-
-  void fild_s(const Operand& adr);
-  void fild_d(const Operand& adr);
-
-  void fist_s(const Operand& adr);
-
-  void fistp_s(const Operand& adr);
-  void fistp_d(const Operand& adr);
-
-  // The fisttp instructions require SSE3.
-  void fisttp_s(const Operand& adr);
-  void fisttp_d(const Operand& adr);
-
-  void fabs();
-  void fchs();
-  void fcos();
-  void fsin();
-  void fptan();
-  void fyl2x();
-  void f2xm1();
-  void fscale();
-  void fninit();
-
-  void fadd(int i);
-  void fadd_i(int i);
-  void fsub(int i);
-  void fsub_i(int i);
-  void fmul(int i);
-  void fmul_i(int i);
-  void fdiv(int i);
-  void fdiv_i(int i);
-
-  void fisub_s(const Operand& adr);
-
-  void faddp(int i = 1);
-  void fsubp(int i = 1);
-  void fsubrp(int i = 1);
-  void fmulp(int i = 1);
-  void fdivp(int i = 1);
-  void fprem();
-  void fprem1();
-
-  void fxch(int i = 1);
-  void fincstp();
-  void ffree(int i = 0);
-
-  void ftst();
-  void fucomp(int i);
-  void fucompp();
-  void fucomi(int i);
-  void fucomip();
-  void fcompp();
-  void fnstsw_ax();
-  void fwait();
-  void fnclex();
-
-  void frndint();
-
-  void sahf();
-  void setcc(Condition cc, Register reg);
-
-  void cpuid();
-
-  // SSE instructions
-  void addss(XMMRegister dst, XMMRegister src) { addss(dst, Operand(src)); }
-  void addss(XMMRegister dst, const Operand& src);
-  void subss(XMMRegister dst, XMMRegister src) { subss(dst, Operand(src)); }
-  void subss(XMMRegister dst, const Operand& src);
-  void mulss(XMMRegister dst, XMMRegister src) { mulss(dst, Operand(src)); }
-  void mulss(XMMRegister dst, const Operand& src);
-  void divss(XMMRegister dst, XMMRegister src) { divss(dst, Operand(src)); }
-  void divss(XMMRegister dst, const Operand& src);
-  void sqrtss(XMMRegister dst, XMMRegister src) { sqrtss(dst, Operand(src)); }
-  void sqrtss(XMMRegister dst, const Operand& src);
-
-  void ucomiss(XMMRegister dst, XMMRegister src) { ucomiss(dst, Operand(src)); }
-  void ucomiss(XMMRegister dst, const Operand& src);
-  void movaps(XMMRegister dst, XMMRegister src);
-  void movups(XMMRegister dst, XMMRegister src);
-  void movups(XMMRegister dst, const Operand& src);
-  void movups(const Operand& dst, XMMRegister src);
-  void shufps(XMMRegister dst, XMMRegister src, byte imm8);
-
-  void maxss(XMMRegister dst, XMMRegister src) { maxss(dst, Operand(src)); }
-  void maxss(XMMRegister dst, const Operand& src);
-  void minss(XMMRegister dst, XMMRegister src) { minss(dst, Operand(src)); }
-  void minss(XMMRegister dst, const Operand& src);
-
-  void andps(XMMRegister dst, const Operand& src);
-  void andps(XMMRegister dst, XMMRegister src) { andps(dst, Operand(src)); }
-  void xorps(XMMRegister dst, const Operand& src);
-  void xorps(XMMRegister dst, XMMRegister src) { xorps(dst, Operand(src)); }
-  void orps(XMMRegister dst, const Operand& src);
-  void orps(XMMRegister dst, XMMRegister src) { orps(dst, Operand(src)); }
-
-  void addps(XMMRegister dst, const Operand& src);
-  void addps(XMMRegister dst, XMMRegister src) { addps(dst, Operand(src)); }
-  void subps(XMMRegister dst, const Operand& src);
-  void subps(XMMRegister dst, XMMRegister src) { subps(dst, Operand(src)); }
-  void mulps(XMMRegister dst, const Operand& src);
-  void mulps(XMMRegister dst, XMMRegister src) { mulps(dst, Operand(src)); }
-  void divps(XMMRegister dst, const Operand& src);
-  void divps(XMMRegister dst, XMMRegister src) { divps(dst, Operand(src)); }
-  void rcpps(XMMRegister dst, const Operand& src);
-  void rcpps(XMMRegister dst, XMMRegister src) { rcpps(dst, Operand(src)); }
-  void rsqrtps(XMMRegister dst, const Operand& src);
-  void rsqrtps(XMMRegister dst, XMMRegister src) { rsqrtps(dst, Operand(src)); }
-  void haddps(XMMRegister dst, const Operand& src);
-  void haddps(XMMRegister dst, XMMRegister src) { haddps(dst, Operand(src)); }
-
-  void minps(XMMRegister dst, const Operand& src);
-  void minps(XMMRegister dst, XMMRegister src) { minps(dst, Operand(src)); }
-  void maxps(XMMRegister dst, const Operand& src);
-  void maxps(XMMRegister dst, XMMRegister src) { maxps(dst, Operand(src)); }
-
-  void cmpps(XMMRegister dst, const Operand& src, int8_t cmp);
-#define SSE_CMP_P(instr, imm8)                       \
-  void instr##ps(XMMRegister dst, XMMRegister src) { \
-    cmpps(dst, Operand(src), imm8);                  \
-  }                                                  \
-  void instr##ps(XMMRegister dst, const Operand& src) { cmpps(dst, src, imm8); }
-
-  SSE_CMP_P(cmpeq, 0x0);
-  SSE_CMP_P(cmplt, 0x1);
-  SSE_CMP_P(cmple, 0x2);
-  SSE_CMP_P(cmpneq, 0x4);
-
-#undef SSE_CMP_P
-
-  // SSE2 instructions
-  void cvttss2si(Register dst, const Operand& src);
-  void cvttss2si(Register dst, XMMRegister src) {
-    cvttss2si(dst, Operand(src));
-  }
-  void cvttsd2si(Register dst, const Operand& src);
-  void cvttsd2si(Register dst, XMMRegister src) {
-    cvttsd2si(dst, Operand(src));
-  }
-  void cvtsd2si(Register dst, XMMRegister src);
-
-  void cvtsi2ss(XMMRegister dst, Register src) { cvtsi2ss(dst, Operand(src)); }
-  void cvtsi2ss(XMMRegister dst, const Operand& src);
-  void cvtsi2sd(XMMRegister dst, Register src) { cvtsi2sd(dst, Operand(src)); }
-  void cvtsi2sd(XMMRegister dst, const Operand& src);
-  void cvtss2sd(XMMRegister dst, const Operand& src);
-  void cvtss2sd(XMMRegister dst, XMMRegister src) {
-    cvtss2sd(dst, Operand(src));
-  }
-  void cvtsd2ss(XMMRegister dst, const Operand& src);
-  void cvtsd2ss(XMMRegister dst, XMMRegister src) {
-    cvtsd2ss(dst, Operand(src));
-  }
-  void cvtdq2ps(XMMRegister dst, XMMRegister src) {
-    cvtdq2ps(dst, Operand(src));
-  }
-  void cvtdq2ps(XMMRegister dst, const Operand& src);
-  void cvttps2dq(XMMRegister dst, XMMRegister src) {
-    cvttps2dq(dst, Operand(src));
-  }
-  void cvttps2dq(XMMRegister dst, const Operand& src);
-
-  void addsd(XMMRegister dst, XMMRegister src) { addsd(dst, Operand(src)); }
-  void addsd(XMMRegister dst, const Operand& src);
-  void subsd(XMMRegister dst, XMMRegister src) { subsd(dst, Operand(src)); }
-  void subsd(XMMRegister dst, const Operand& src);
-  void mulsd(XMMRegister dst, XMMRegister src) { mulsd(dst, Operand(src)); }
-  void mulsd(XMMRegister dst, const Operand& src);
-  void divsd(XMMRegister dst, XMMRegister src) { divsd(dst, Operand(src)); }
-  void divsd(XMMRegister dst, const Operand& src);
-  void xorpd(XMMRegister dst, XMMRegister src);
-  void sqrtsd(XMMRegister dst, XMMRegister src) { sqrtsd(dst, Operand(src)); }
-  void sqrtsd(XMMRegister dst, const Operand& src);
-
-  void andpd(XMMRegister dst, XMMRegister src);
-  void orpd(XMMRegister dst, XMMRegister src);
-
-  void ucomisd(XMMRegister dst, XMMRegister src) { ucomisd(dst, Operand(src)); }
-  void ucomisd(XMMRegister dst, const Operand& src);
-
-  void roundss(XMMRegister dst, XMMRegister src, RoundingMode mode);
-  void roundsd(XMMRegister dst, XMMRegister src, RoundingMode mode);
-
-  void movmskpd(Register dst, XMMRegister src);
-  void movmskps(Register dst, XMMRegister src);
-
-  void cmpltsd(XMMRegister dst, XMMRegister src);
-
-  void maxsd(XMMRegister dst, XMMRegister src) { maxsd(dst, Operand(src)); }
-  void maxsd(XMMRegister dst, const Operand& src);
-  void minsd(XMMRegister dst, XMMRegister src) { minsd(dst, Operand(src)); }
-  void minsd(XMMRegister dst, const Operand& src);
-
-  void movdqa(XMMRegister dst, const Operand& src);
-  void movdqa(const Operand& dst, XMMRegister src);
-  void movdqu(XMMRegister dst, const Operand& src);
-  void movdqu(const Operand& dst, XMMRegister src);
-  void movdq(bool aligned, XMMRegister dst, const Operand& src) {
-    if (aligned) {
-      movdqa(dst, src);
-    } else {
-      movdqu(dst, src);
-    }
-  }
-
-  void movd(XMMRegister dst, Register src) { movd(dst, Operand(src)); }
-  void movd(XMMRegister dst, const Operand& src);
-  void movd(Register dst, XMMRegister src) { movd(Operand(dst), src); }
-  void movd(const Operand& dst, XMMRegister src);
-  void movsd(XMMRegister dst, XMMRegister src) { movsd(dst, Operand(src)); }
-  void movsd(XMMRegister dst, const Operand& src);
-  void movsd(const Operand& dst, XMMRegister src);
-
-
-  void movss(XMMRegister dst, const Operand& src);
-  void movss(const Operand& dst, XMMRegister src);
-  void movss(XMMRegister dst, XMMRegister src) { movss(dst, Operand(src)); }
-  void extractps(Register dst, XMMRegister src, byte imm8);
-
-  void ptest(XMMRegister dst, XMMRegister src);
-
-  void psllw(XMMRegister reg, int8_t shift);
-  void pslld(XMMRegister reg, int8_t shift);
-  void psrlw(XMMRegister reg, int8_t shift);
-  void psrld(XMMRegister reg, int8_t shift);
-  void psraw(XMMRegister reg, int8_t shift);
-  void psrad(XMMRegister reg, int8_t shift);
-  void psllq(XMMRegister reg, int8_t shift);
-  void psllq(XMMRegister dst, XMMRegister src);
-  void psrlq(XMMRegister reg, int8_t shift);
-  void psrlq(XMMRegister dst, XMMRegister src);
-
-  void pshuflw(XMMRegister dst, XMMRegister src, uint8_t shuffle) {
-    pshuflw(dst, Operand(src), shuffle);
-  }
-  void pshuflw(XMMRegister dst, const Operand& src, uint8_t shuffle);
-  void pshufd(XMMRegister dst, XMMRegister src, uint8_t shuffle) {
-    pshufd(dst, Operand(src), shuffle);
-  }
-  void pshufd(XMMRegister dst, const Operand& src, uint8_t shuffle);
-
-  void pextrb(Register dst, XMMRegister src, int8_t offset) {
-    pextrb(Operand(dst), src, offset);
-  }
-  void pextrb(const Operand& dst, XMMRegister src, int8_t offset);
-  // Use SSE4_1 encoding for pextrw reg, xmm, imm8 for consistency
-  void pextrw(Register dst, XMMRegister src, int8_t offset) {
-    pextrw(Operand(dst), src, offset);
-  }
-  void pextrw(const Operand& dst, XMMRegister src, int8_t offset);
-  void pextrd(Register dst, XMMRegister src, int8_t offset) {
-    pextrd(Operand(dst), src, offset);
-  }
-  void pextrd(const Operand& dst, XMMRegister src, int8_t offset);
-
-  void insertps(XMMRegister dst, XMMRegister src, int8_t offset) {
-    insertps(dst, Operand(src), offset);
-  }
-  void insertps(XMMRegister dst, const Operand& src, int8_t offset);
-  void pinsrb(XMMRegister dst, Register src, int8_t offset) {
-    pinsrb(dst, Operand(src), offset);
-  }
-  void pinsrb(XMMRegister dst, const Operand& src, int8_t offset);
-  void pinsrw(XMMRegister dst, Register src, int8_t offset) {
-    pinsrw(dst, Operand(src), offset);
-  }
-  void pinsrw(XMMRegister dst, const Operand& src, int8_t offset);
-  void pinsrd(XMMRegister dst, Register src, int8_t offset) {
-    pinsrd(dst, Operand(src), offset);
-  }
-  void pinsrd(XMMRegister dst, const Operand& src, int8_t offset);
-
-  // AVX instructions
-  void vfmadd132sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmadd132sd(dst, src1, Operand(src2));
-  }
-  void vfmadd213sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmadd213sd(dst, src1, Operand(src2));
-  }
-  void vfmadd231sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmadd231sd(dst, src1, Operand(src2));
-  }
-  void vfmadd132sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmasd(0x99, dst, src1, src2);
-  }
-  void vfmadd213sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmasd(0xa9, dst, src1, src2);
-  }
-  void vfmadd231sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmasd(0xb9, dst, src1, src2);
-  }
-  void vfmsub132sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmsub132sd(dst, src1, Operand(src2));
-  }
-  void vfmsub213sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmsub213sd(dst, src1, Operand(src2));
-  }
-  void vfmsub231sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmsub231sd(dst, src1, Operand(src2));
-  }
-  void vfmsub132sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmasd(0x9b, dst, src1, src2);
-  }
-  void vfmsub213sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmasd(0xab, dst, src1, src2);
-  }
-  void vfmsub231sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmasd(0xbb, dst, src1, src2);
-  }
-  void vfnmadd132sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfnmadd132sd(dst, src1, Operand(src2));
-  }
-  void vfnmadd213sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfnmadd213sd(dst, src1, Operand(src2));
-  }
-  void vfnmadd231sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfnmadd231sd(dst, src1, Operand(src2));
-  }
-  void vfnmadd132sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmasd(0x9d, dst, src1, src2);
-  }
-  void vfnmadd213sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmasd(0xad, dst, src1, src2);
-  }
-  void vfnmadd231sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmasd(0xbd, dst, src1, src2);
-  }
-  void vfnmsub132sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfnmsub132sd(dst, src1, Operand(src2));
-  }
-  void vfnmsub213sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfnmsub213sd(dst, src1, Operand(src2));
-  }
-  void vfnmsub231sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfnmsub231sd(dst, src1, Operand(src2));
-  }
-  void vfnmsub132sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmasd(0x9f, dst, src1, src2);
-  }
-  void vfnmsub213sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmasd(0xaf, dst, src1, src2);
-  }
-  void vfnmsub231sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmasd(0xbf, dst, src1, src2);
-  }
-  void vfmasd(byte op, XMMRegister dst, XMMRegister src1, const Operand& src2);
-
-  void vfmadd132ss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmadd132ss(dst, src1, Operand(src2));
-  }
-  void vfmadd213ss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmadd213ss(dst, src1, Operand(src2));
-  }
-  void vfmadd231ss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmadd231ss(dst, src1, Operand(src2));
-  }
-  void vfmadd132ss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmass(0x99, dst, src1, src2);
-  }
-  void vfmadd213ss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmass(0xa9, dst, src1, src2);
-  }
-  void vfmadd231ss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmass(0xb9, dst, src1, src2);
-  }
-  void vfmsub132ss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmsub132ss(dst, src1, Operand(src2));
-  }
-  void vfmsub213ss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmsub213ss(dst, src1, Operand(src2));
-  }
-  void vfmsub231ss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmsub231ss(dst, src1, Operand(src2));
-  }
-  void vfmsub132ss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmass(0x9b, dst, src1, src2);
-  }
-  void vfmsub213ss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmass(0xab, dst, src1, src2);
-  }
-  void vfmsub231ss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmass(0xbb, dst, src1, src2);
-  }
-  void vfnmadd132ss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfnmadd132ss(dst, src1, Operand(src2));
-  }
-  void vfnmadd213ss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfnmadd213ss(dst, src1, Operand(src2));
-  }
-  void vfnmadd231ss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfnmadd231ss(dst, src1, Operand(src2));
-  }
-  void vfnmadd132ss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmass(0x9d, dst, src1, src2);
-  }
-  void vfnmadd213ss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmass(0xad, dst, src1, src2);
-  }
-  void vfnmadd231ss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmass(0xbd, dst, src1, src2);
-  }
-  void vfnmsub132ss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfnmsub132ss(dst, src1, Operand(src2));
-  }
-  void vfnmsub213ss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfnmsub213ss(dst, src1, Operand(src2));
-  }
-  void vfnmsub231ss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfnmsub231ss(dst, src1, Operand(src2));
-  }
-  void vfnmsub132ss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmass(0x9f, dst, src1, src2);
-  }
-  void vfnmsub213ss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmass(0xaf, dst, src1, src2);
-  }
-  void vfnmsub231ss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmass(0xbf, dst, src1, src2);
-  }
-  void vfmass(byte op, XMMRegister dst, XMMRegister src1, const Operand& src2);
-
-  void vaddsd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vaddsd(dst, src1, Operand(src2));
-  }
-  void vaddsd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vsd(0x58, dst, src1, src2);
-  }
-  void vsubsd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vsubsd(dst, src1, Operand(src2));
-  }
-  void vsubsd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vsd(0x5c, dst, src1, src2);
-  }
-  void vmulsd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vmulsd(dst, src1, Operand(src2));
-  }
-  void vmulsd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vsd(0x59, dst, src1, src2);
-  }
-  void vdivsd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vdivsd(dst, src1, Operand(src2));
-  }
-  void vdivsd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vsd(0x5e, dst, src1, src2);
-  }
-  void vmaxsd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vmaxsd(dst, src1, Operand(src2));
-  }
-  void vmaxsd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vsd(0x5f, dst, src1, src2);
-  }
-  void vminsd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vminsd(dst, src1, Operand(src2));
-  }
-  void vminsd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vsd(0x5d, dst, src1, src2);
-  }
-  void vsd(byte op, XMMRegister dst, XMMRegister src1, const Operand& src2);
-
-  void vaddss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vaddss(dst, src1, Operand(src2));
-  }
-  void vaddss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vss(0x58, dst, src1, src2);
-  }
-  void vsubss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vsubss(dst, src1, Operand(src2));
-  }
-  void vsubss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vss(0x5c, dst, src1, src2);
-  }
-  void vmulss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vmulss(dst, src1, Operand(src2));
-  }
-  void vmulss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vss(0x59, dst, src1, src2);
-  }
-  void vdivss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vdivss(dst, src1, Operand(src2));
-  }
-  void vdivss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vss(0x5e, dst, src1, src2);
-  }
-  void vmaxss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vmaxss(dst, src1, Operand(src2));
-  }
-  void vmaxss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vss(0x5f, dst, src1, src2);
-  }
-  void vminss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vminss(dst, src1, Operand(src2));
-  }
-  void vminss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vss(0x5d, dst, src1, src2);
-  }
-  void vss(byte op, XMMRegister dst, XMMRegister src1, const Operand& src2);
-
-  void vrcpps(XMMRegister dst, XMMRegister src) { vrcpps(dst, Operand(src)); }
-  void vrcpps(XMMRegister dst, const Operand& src) {
-    vinstr(0x53, dst, xmm0, src, kNone, k0F, kWIG);
-  }
-  void vrsqrtps(XMMRegister dst, XMMRegister src) {
-    vrsqrtps(dst, Operand(src));
-  }
-  void vrsqrtps(XMMRegister dst, const Operand& src) {
-    vinstr(0x52, dst, xmm0, src, kNone, k0F, kWIG);
-  }
-  void vmovaps(XMMRegister dst, XMMRegister src) {
-    vps(0x28, dst, xmm0, Operand(src));
-  }
-  void vshufps(XMMRegister dst, XMMRegister src1, XMMRegister src2, byte imm8) {
-    vshufps(dst, src1, Operand(src2), imm8);
-  }
-  void vshufps(XMMRegister dst, XMMRegister src1, const Operand& src2,
-               byte imm8);
-
-  void vpsllw(XMMRegister dst, XMMRegister src, int8_t imm8);
-  void vpslld(XMMRegister dst, XMMRegister src, int8_t imm8);
-  void vpsrlw(XMMRegister dst, XMMRegister src, int8_t imm8);
-  void vpsrld(XMMRegister dst, XMMRegister src, int8_t imm8);
-  void vpsraw(XMMRegister dst, XMMRegister src, int8_t imm8);
-  void vpsrad(XMMRegister dst, XMMRegister src, int8_t imm8);
-
-  void vpshuflw(XMMRegister dst, XMMRegister src, uint8_t shuffle) {
-    vpshuflw(dst, Operand(src), shuffle);
-  }
-  void vpshuflw(XMMRegister dst, const Operand& src, uint8_t shuffle);
-  void vpshufd(XMMRegister dst, XMMRegister src, uint8_t shuffle) {
-    vpshufd(dst, Operand(src), shuffle);
-  }
-  void vpshufd(XMMRegister dst, const Operand& src, uint8_t shuffle);
-
-  void vpextrb(Register dst, XMMRegister src, int8_t offset) {
-    vpextrb(Operand(dst), src, offset);
-  }
-  void vpextrb(const Operand& dst, XMMRegister src, int8_t offset);
-  void vpextrw(Register dst, XMMRegister src, int8_t offset) {
-    vpextrw(Operand(dst), src, offset);
-  }
-  void vpextrw(const Operand& dst, XMMRegister src, int8_t offset);
-  void vpextrd(Register dst, XMMRegister src, int8_t offset) {
-    vpextrd(Operand(dst), src, offset);
-  }
-  void vpextrd(const Operand& dst, XMMRegister src, int8_t offset);
-
-  void vinsertps(XMMRegister dst, XMMRegister src1, XMMRegister src2,
-                 int8_t offset) {
-    vinsertps(dst, src1, Operand(src2), offset);
-  }
-  void vinsertps(XMMRegister dst, XMMRegister src1, const Operand& src2,
-                 int8_t offset);
-  void vpinsrb(XMMRegister dst, XMMRegister src1, Register src2,
-               int8_t offset) {
-    vpinsrb(dst, src1, Operand(src2), offset);
-  }
-  void vpinsrb(XMMRegister dst, XMMRegister src1, const Operand& src2,
-               int8_t offset);
-  void vpinsrw(XMMRegister dst, XMMRegister src1, Register src2,
-               int8_t offset) {
-    vpinsrw(dst, src1, Operand(src2), offset);
-  }
-  void vpinsrw(XMMRegister dst, XMMRegister src1, const Operand& src2,
-               int8_t offset);
-  void vpinsrd(XMMRegister dst, XMMRegister src1, Register src2,
-               int8_t offset) {
-    vpinsrd(dst, src1, Operand(src2), offset);
-  }
-  void vpinsrd(XMMRegister dst, XMMRegister src1, const Operand& src2,
-               int8_t offset);
-
-  void vcvtdq2ps(XMMRegister dst, XMMRegister src) {
-    vcvtdq2ps(dst, Operand(src));
-  }
-  void vcvtdq2ps(XMMRegister dst, const Operand& src) {
-    vinstr(0x5B, dst, xmm0, src, kNone, k0F, kWIG);
-  }
-  void vcvttps2dq(XMMRegister dst, XMMRegister src) {
-    vcvttps2dq(dst, Operand(src));
-  }
-  void vcvttps2dq(XMMRegister dst, const Operand& src) {
-    vinstr(0x5B, dst, xmm0, src, kF3, k0F, kWIG);
-  }
-
-  void vmovdqu(XMMRegister dst, const Operand& src) {
-    vinstr(0x6F, dst, xmm0, src, kF3, k0F, kWIG);
-  }
-  void vmovdqu(const Operand& dst, XMMRegister src) {
-    vinstr(0x7F, src, xmm0, dst, kF3, k0F, kWIG);
-  }
-  void vmovd(XMMRegister dst, Register src) { vmovd(dst, Operand(src)); }
-  void vmovd(XMMRegister dst, const Operand& src) {
-    vinstr(0x6E, dst, xmm0, src, k66, k0F, kWIG);
-  }
-  void vmovd(Register dst, XMMRegister src) { movd(Operand(dst), src); }
-  void vmovd(const Operand& dst, XMMRegister src) {
-    vinstr(0x7E, src, xmm0, dst, k66, k0F, kWIG);
-  }
-
-  // BMI instruction
-  void andn(Register dst, Register src1, Register src2) {
-    andn(dst, src1, Operand(src2));
-  }
-  void andn(Register dst, Register src1, const Operand& src2) {
-    bmi1(0xf2, dst, src1, src2);
-  }
-  void bextr(Register dst, Register src1, Register src2) {
-    bextr(dst, Operand(src1), src2);
-  }
-  void bextr(Register dst, const Operand& src1, Register src2) {
-    bmi1(0xf7, dst, src2, src1);
-  }
-  void blsi(Register dst, Register src) { blsi(dst, Operand(src)); }
-  void blsi(Register dst, const Operand& src) { bmi1(0xf3, ebx, dst, src); }
-  void blsmsk(Register dst, Register src) { blsmsk(dst, Operand(src)); }
-  void blsmsk(Register dst, const Operand& src) { bmi1(0xf3, edx, dst, src); }
-  void blsr(Register dst, Register src) { blsr(dst, Operand(src)); }
-  void blsr(Register dst, const Operand& src) { bmi1(0xf3, ecx, dst, src); }
-  void tzcnt(Register dst, Register src) { tzcnt(dst, Operand(src)); }
-  void tzcnt(Register dst, const Operand& src);
-
-  void lzcnt(Register dst, Register src) { lzcnt(dst, Operand(src)); }
-  void lzcnt(Register dst, const Operand& src);
-
-  void popcnt(Register dst, Register src) { popcnt(dst, Operand(src)); }
-  void popcnt(Register dst, const Operand& src);
-
-  void bzhi(Register dst, Register src1, Register src2) {
-    bzhi(dst, Operand(src1), src2);
-  }
-  void bzhi(Register dst, const Operand& src1, Register src2) {
-    bmi2(kNone, 0xf5, dst, src2, src1);
-  }
-  void mulx(Register dst1, Register dst2, Register src) {
-    mulx(dst1, dst2, Operand(src));
-  }
-  void mulx(Register dst1, Register dst2, const Operand& src) {
-    bmi2(kF2, 0xf6, dst1, dst2, src);
-  }
-  void pdep(Register dst, Register src1, Register src2) {
-    pdep(dst, src1, Operand(src2));
-  }
-  void pdep(Register dst, Register src1, const Operand& src2) {
-    bmi2(kF2, 0xf5, dst, src1, src2);
-  }
-  void pext(Register dst, Register src1, Register src2) {
-    pext(dst, src1, Operand(src2));
-  }
-  void pext(Register dst, Register src1, const Operand& src2) {
-    bmi2(kF3, 0xf5, dst, src1, src2);
-  }
-  void sarx(Register dst, Register src1, Register src2) {
-    sarx(dst, Operand(src1), src2);
-  }
-  void sarx(Register dst, const Operand& src1, Register src2) {
-    bmi2(kF3, 0xf7, dst, src2, src1);
-  }
-  void shlx(Register dst, Register src1, Register src2) {
-    shlx(dst, Operand(src1), src2);
-  }
-  void shlx(Register dst, const Operand& src1, Register src2) {
-    bmi2(k66, 0xf7, dst, src2, src1);
-  }
-  void shrx(Register dst, Register src1, Register src2) {
-    shrx(dst, Operand(src1), src2);
-  }
-  void shrx(Register dst, const Operand& src1, Register src2) {
-    bmi2(kF2, 0xf7, dst, src2, src1);
-  }
-  void rorx(Register dst, Register src, byte imm8) {
-    rorx(dst, Operand(src), imm8);
-  }
-  void rorx(Register dst, const Operand& src, byte imm8);
-
-#define PACKED_OP_LIST(V) \
-  V(and, 0x54)            \
-  V(xor, 0x57)            \
-  V(add, 0x58)            \
-  V(mul, 0x59)            \
-  V(sub, 0x5c)            \
-  V(min, 0x5d)            \
-  V(div, 0x5e)            \
-  V(max, 0x5f)
-
-#define AVX_PACKED_OP_DECLARE(name, opcode)                                  \
-  void v##name##ps(XMMRegister dst, XMMRegister src1, XMMRegister src2) {    \
-    vps(opcode, dst, src1, Operand(src2));                                   \
-  }                                                                          \
-  void v##name##ps(XMMRegister dst, XMMRegister src1, const Operand& src2) { \
-    vps(opcode, dst, src1, src2);                                            \
-  }                                                                          \
-  void v##name##pd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {    \
-    vpd(opcode, dst, src1, Operand(src2));                                   \
-  }                                                                          \
-  void v##name##pd(XMMRegister dst, XMMRegister src1, const Operand& src2) { \
-    vpd(opcode, dst, src1, src2);                                            \
-  }
-
-  PACKED_OP_LIST(AVX_PACKED_OP_DECLARE);
-  void vps(byte op, XMMRegister dst, XMMRegister src1, XMMRegister src2);
-  void vps(byte op, XMMRegister dst, XMMRegister src1, const Operand& src2);
-  void vpd(byte op, XMMRegister dst, XMMRegister src1, XMMRegister src2);
-  void vpd(byte op, XMMRegister dst, XMMRegister src1, const Operand& src2);
-
-  void vcmpps(XMMRegister dst, XMMRegister src1, const Operand& src2,
-              int8_t cmp);
-#define AVX_CMP_P(instr, imm8)                                             \
-  void instr##ps(XMMRegister dst, XMMRegister src1, XMMRegister src2) {    \
-    vcmpps(dst, src1, Operand(src2), imm8);                                \
-  }                                                                        \
-  void instr##ps(XMMRegister dst, XMMRegister src1, const Operand& src2) { \
-    vcmpps(dst, src1, src2, imm8);                                         \
-  }
-
-  AVX_CMP_P(vcmpeq, 0x0);
-  AVX_CMP_P(vcmplt, 0x1);
-  AVX_CMP_P(vcmple, 0x2);
-  AVX_CMP_P(vcmpneq, 0x4);
-
-#undef AVX_CMP_P
-
-// Other SSE and AVX instructions
-#define DECLARE_SSE2_INSTRUCTION(instruction, prefix, escape, opcode) \
-  void instruction(XMMRegister dst, XMMRegister src) {                \
-    instruction(dst, Operand(src));                                   \
-  }                                                                   \
-  void instruction(XMMRegister dst, const Operand& src) {             \
-    sse2_instr(dst, src, 0x##prefix, 0x##escape, 0x##opcode);         \
-  }
-
-  SSE2_INSTRUCTION_LIST(DECLARE_SSE2_INSTRUCTION)
-#undef DECLARE_SSE2_INSTRUCTION
-
-#define DECLARE_SSE2_AVX_INSTRUCTION(instruction, prefix, escape, opcode)    \
-  void v##instruction(XMMRegister dst, XMMRegister src1, XMMRegister src2) { \
-    v##instruction(dst, src1, Operand(src2));                                \
-  }                                                                          \
-  void v##instruction(XMMRegister dst, XMMRegister src1,                     \
-                      const Operand& src2) {                                 \
-    vinstr(0x##opcode, dst, src1, src2, k##prefix, k##escape, kW0);          \
-  }
-
-  SSE2_INSTRUCTION_LIST(DECLARE_SSE2_AVX_INSTRUCTION)
-#undef DECLARE_SSE2_AVX_INSTRUCTION
-
-#define DECLARE_SSSE3_INSTRUCTION(instruction, prefix, escape1, escape2,     \
-                                  opcode)                                    \
-  void instruction(XMMRegister dst, XMMRegister src) {                       \
-    instruction(dst, Operand(src));                                          \
-  }                                                                          \
-  void instruction(XMMRegister dst, const Operand& src) {                    \
-    ssse3_instr(dst, src, 0x##prefix, 0x##escape1, 0x##escape2, 0x##opcode); \
-  }
-
-  SSSE3_INSTRUCTION_LIST(DECLARE_SSSE3_INSTRUCTION)
-#undef DECLARE_SSSE3_INSTRUCTION
-
-#define DECLARE_SSE4_INSTRUCTION(instruction, prefix, escape1, escape2,     \
-                                 opcode)                                    \
-  void instruction(XMMRegister dst, XMMRegister src) {                      \
-    instruction(dst, Operand(src));                                         \
-  }                                                                         \
-  void instruction(XMMRegister dst, const Operand& src) {                   \
-    sse4_instr(dst, src, 0x##prefix, 0x##escape1, 0x##escape2, 0x##opcode); \
-  }
-
-  SSE4_INSTRUCTION_LIST(DECLARE_SSE4_INSTRUCTION)
-#undef DECLARE_SSE4_INSTRUCTION
-
-#define DECLARE_SSE34_AVX_INSTRUCTION(instruction, prefix, escape1, escape2,  \
-                                      opcode)                                 \
-  void v##instruction(XMMRegister dst, XMMRegister src1, XMMRegister src2) {  \
-    v##instruction(dst, src1, Operand(src2));                                 \
-  }                                                                           \
-  void v##instruction(XMMRegister dst, XMMRegister src1,                      \
-                      const Operand& src2) {                                  \
-    vinstr(0x##opcode, dst, src1, src2, k##prefix, k##escape1##escape2, kW0); \
-  }
-
-  SSSE3_INSTRUCTION_LIST(DECLARE_SSE34_AVX_INSTRUCTION)
-  SSE4_INSTRUCTION_LIST(DECLARE_SSE34_AVX_INSTRUCTION)
-#undef DECLARE_SSE34_AVX_INSTRUCTION
-
-  // Prefetch src position into cache level.
-  // Level 1, 2 or 3 specifies CPU cache level. Level 0 specifies a
-  // non-temporal
-  void prefetch(const Operand& src, int level);
-  // TODO(lrn): Need SFENCE for movnt?
-
-  // Check the code size generated from label to here.
-  int SizeOfCodeGeneratedSince(Label* label) {
-    return pc_offset() - label->pos();
-  }
-
-  // Use --code-comments to enable.
-  void RecordComment(const char* msg);
-
-  // Record a deoptimization reason that can be used by a log or cpu profiler.
-  // Use --trace-deopt to enable.
-  void RecordDeoptReason(DeoptimizeReason reason, SourcePosition position,
-                         int id);
-
-  // Writes a single byte or word of data in the code stream.  Used for
-  // inline tables, e.g., jump-tables.
-  void db(uint8_t data);
-  void dd(uint32_t data);
-  void dq(uint64_t data);
-  void dp(uintptr_t data) { dd(data); }
-  void dd(Label* label);
-
-  // Check if there is less than kGap bytes available in the buffer.
-  // If this is the case, we need to grow the buffer before emitting
-  // an instruction or relocation information.
-  inline bool buffer_overflow() const {
-    return pc_ >= reloc_info_writer.pos() - kGap;
-  }
-
-  // Get the number of bytes available in the buffer.
-  inline int available_space() const { return reloc_info_writer.pos() - pc_; }
-
-  static bool IsNop(Address addr);
-
-  int relocation_writer_size() {
-    return (buffer_ + buffer_size_) - reloc_info_writer.pos();
-  }
-
-  // Avoid overflows for displacements etc.
-  static constexpr int kMaximalBufferSize = 512 * MB;
-
-  byte byte_at(int pos) { return buffer_[pos]; }
-  void set_byte_at(int pos, byte value) { buffer_[pos] = value; }
-
-  void PatchConstantPoolAccessInstruction(int pc_offset, int offset,
-                                          ConstantPoolEntry::Access access,
-                                          ConstantPoolEntry::Type type) {
-    // No embedded constant pool support.
-    UNREACHABLE();
-  }
-
- protected:
-  void emit_sse_operand(XMMRegister reg, const Operand& adr);
-  void emit_sse_operand(XMMRegister dst, XMMRegister src);
-  void emit_sse_operand(Register dst, XMMRegister src);
-  void emit_sse_operand(XMMRegister dst, Register src);
-
-  byte* addr_at(int pos) { return buffer_ + pos; }
-
-
- private:
-  uint32_t long_at(int pos)  {
-    return *reinterpret_cast<uint32_t*>(addr_at(pos));
-  }
-  void long_at_put(int pos, uint32_t x)  {
-    *reinterpret_cast<uint32_t*>(addr_at(pos)) = x;
-  }
-
-  // code emission
-  void GrowBuffer();
-  inline void emit(uint32_t x);
-  inline void emit(Handle<HeapObject> handle);
-  inline void emit(uint32_t x, RelocInfo::Mode rmode);
-  inline void emit(Handle<Code> code, RelocInfo::Mode rmode);
-  inline void emit(const Immediate& x);
-  inline void emit_b(Immediate x);
-  inline void emit_w(const Immediate& x);
-  inline void emit_q(uint64_t x);
-
-  // Emit the code-object-relative offset of the label's position
-  inline void emit_code_relative_offset(Label* label);
-
-  // instruction generation
-  void emit_arith_b(int op1, int op2, Register dst, int imm8);
-
-  // Emit a basic arithmetic instruction (i.e. first byte of the family is 0x81)
-  // with a given destination expression and an immediate operand.  It attempts
-  // to use the shortest encoding possible.
-  // sel specifies the /n in the modrm byte (see the Intel PRM).
-  void emit_arith(int sel, Operand dst, const Immediate& x);
-
-  void emit_operand(Register reg, const Operand& adr);
-
-  void emit_label(Label* label);
-
-  void emit_farith(int b1, int b2, int i);
-
-  // Emit vex prefix
-  enum SIMDPrefix { kNone = 0x0, k66 = 0x1, kF3 = 0x2, kF2 = 0x3 };
-  enum VectorLength { kL128 = 0x0, kL256 = 0x4, kLIG = kL128, kLZ = kL128 };
-  enum VexW { kW0 = 0x0, kW1 = 0x80, kWIG = kW0 };
-  enum LeadingOpcode { k0F = 0x1, k0F38 = 0x2, k0F3A = 0x3 };
-  inline void emit_vex_prefix(XMMRegister v, VectorLength l, SIMDPrefix pp,
-                              LeadingOpcode m, VexW w);
-  inline void emit_vex_prefix(Register v, VectorLength l, SIMDPrefix pp,
-                              LeadingOpcode m, VexW w);
-
-  // labels
-  void print(const Label* L);
-  void bind_to(Label* L, int pos);
-
-  // displacements
-  inline Displacement disp_at(Label* L);
-  inline void disp_at_put(Label* L, Displacement disp);
-  inline void emit_disp(Label* L, Displacement::Type type);
-  inline void emit_near_disp(Label* L);
-
-  void sse2_instr(XMMRegister dst, const Operand& src, byte prefix, byte escape,
-                  byte opcode);
-  void ssse3_instr(XMMRegister dst, const Operand& src, byte prefix,
-                   byte escape1, byte escape2, byte opcode);
-  void sse4_instr(XMMRegister dst, const Operand& src, byte prefix,
-                  byte escape1, byte escape2, byte opcode);
-  void vinstr(byte op, XMMRegister dst, XMMRegister src1, const Operand& src2,
-              SIMDPrefix pp, LeadingOpcode m, VexW w);
-  // Most BMI instructions are similar.
-  void bmi1(byte op, Register reg, Register vreg, const Operand& rm);
-  void bmi2(SIMDPrefix pp, byte op, Register reg, Register vreg,
-            const Operand& rm);
-
-  // record reloc info for current pc_
-  void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0);
-
-  // record the position of jmp/jcc instruction
-  void record_farjmp_position(Label* L, int pos);
-
-  bool is_optimizable_farjmp(int idx);
-
-  friend class EnsureSpace;
-
-  // Internal reference positions, required for (potential) patching in
-  // GrowBuffer(); contains only those internal references whose labels
-  // are already bound.
-  std::deque<int> internal_reference_positions_;
-
-  // code generation
-  RelocInfoWriter reloc_info_writer;
-
-  // The following functions help with avoiding allocations of embedded heap
-  // objects during the code assembly phase. {RequestHeapObject} records the
-  // need for a future heap number allocation or code stub generation. After
-  // code assembly, {AllocateAndInstallRequestedHeapObjects} will allocate these
-  // objects and place them where they are expected (determined by the pc offset
-  // associated with each request). That is, for each request, it will patch the
-  // dummy heap object handle that we emitted during code assembly with the
-  // actual heap object handle.
-  void RequestHeapObject(HeapObjectRequest request);
-  void AllocateAndInstallRequestedHeapObjects(Isolate* isolate);
-
-  std::forward_list<HeapObjectRequest> heap_object_requests_;
-
-  // Variables for this instance of assembler
-  int farjmp_num_ = 0;
-  std::deque<int> farjmp_positions_;
-  std::map<Label*, std::vector<int>> label_farjmp_maps_;
-};
-
-
-// Helper class that ensures that there is enough space for generating
-// instructions and relocation information.  The constructor makes
-// sure that there is enough space and (in debug mode) the destructor
-// checks that we did not generate too much.
-class EnsureSpace BASE_EMBEDDED {
- public:
-  explicit EnsureSpace(Assembler* assembler) : assembler_(assembler) {
-    if (assembler_->buffer_overflow()) assembler_->GrowBuffer();
-#ifdef DEBUG
-    space_before_ = assembler_->available_space();
-#endif
-  }
-
-#ifdef DEBUG
-  ~EnsureSpace() {
-    int bytes_generated = space_before_ - assembler_->available_space();
-    DCHECK(bytes_generated < assembler_->kGap);
-  }
-#endif
-
- private:
-  Assembler* assembler_;
-#ifdef DEBUG
-  int space_before_;
-#endif
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_IA32_ASSEMBLER_IA32_H_
diff --git a/src/v8/src/ia32/code-stubs-ia32.cc b/src/v8/src/ia32/code-stubs-ia32.cc
deleted file mode 100644
index 6975397..0000000
--- a/src/v8/src/ia32/code-stubs-ia32.cc
+++ /dev/null
@@ -1,1204 +0,0 @@
-// Copyright 2012 the V8 project 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 V8_TARGET_ARCH_IA32
-
-#include "src/api-arguments.h"
-#include "src/assembler-inl.h"
-#include "src/base/bits.h"
-#include "src/bootstrapper.h"
-#include "src/code-stubs.h"
-#include "src/frame-constants.h"
-#include "src/frames.h"
-#include "src/heap/heap-inl.h"
-#include "src/ic/ic.h"
-#include "src/ic/stub-cache.h"
-#include "src/isolate.h"
-#include "src/regexp/jsregexp.h"
-#include "src/regexp/regexp-macro-assembler.h"
-#include "src/runtime/runtime.h"
-
-namespace v8 {
-namespace internal {
-
-#define __ ACCESS_MASM(masm)
-
-void ArrayNArgumentsConstructorStub::Generate(MacroAssembler* masm) {
-  __ pop(ecx);
-  __ mov(MemOperand(esp, eax, times_4, 0), edi);
-  __ push(edi);
-  __ push(ebx);
-  __ push(ecx);
-  __ add(eax, Immediate(3));
-  __ TailCallRuntime(Runtime::kNewArray);
-}
-
-
-void DoubleToIStub::Generate(MacroAssembler* masm) {
-  Register final_result_reg = this->destination();
-
-  Label check_negative, process_64_bits, done;
-
-  // Account for return address and saved regs.
-  const int kArgumentOffset = 3 * kPointerSize;
-
-  MemOperand mantissa_operand(MemOperand(esp, kArgumentOffset));
-  MemOperand exponent_operand(
-      MemOperand(esp, kArgumentOffset + kDoubleSize / 2));
-
-  Register scratch1 = no_reg;
-  {
-    Register scratch_candidates[3] = { ebx, edx, edi };
-    for (int i = 0; i < 3; i++) {
-      scratch1 = scratch_candidates[i];
-      if (final_result_reg != scratch1) break;
-    }
-  }
-  // Since we must use ecx for shifts below, use some other register (eax)
-  // to calculate the result if ecx is the requested return register.
-  Register result_reg = final_result_reg == ecx ? eax : final_result_reg;
-  // Save ecx if it isn't the return register and therefore volatile, or if it
-  // is the return register, then save the temp register we use in its stead for
-  // the result.
-  Register save_reg = final_result_reg == ecx ? eax : ecx;
-  __ push(scratch1);
-  __ push(save_reg);
-
-  __ mov(scratch1, mantissa_operand);
-  if (CpuFeatures::IsSupported(SSE3)) {
-    CpuFeatureScope scope(masm, SSE3);
-    // Load x87 register with heap number.
-    __ fld_d(mantissa_operand);
-  }
-  __ mov(ecx, exponent_operand);
-
-  __ and_(ecx, HeapNumber::kExponentMask);
-  __ shr(ecx, HeapNumber::kExponentShift);
-  __ lea(result_reg, MemOperand(ecx, -HeapNumber::kExponentBias));
-  __ cmp(result_reg, Immediate(HeapNumber::kMantissaBits));
-  __ j(below, &process_64_bits);
-
-  // Result is entirely in lower 32-bits of mantissa
-  int delta = HeapNumber::kExponentBias + Double::kPhysicalSignificandSize;
-  if (CpuFeatures::IsSupported(SSE3)) {
-    __ fstp(0);
-  }
-  __ sub(ecx, Immediate(delta));
-  __ xor_(result_reg, result_reg);
-  __ cmp(ecx, Immediate(31));
-  __ j(above, &done);
-  __ shl_cl(scratch1);
-  __ jmp(&check_negative);
-
-  __ bind(&process_64_bits);
-  if (CpuFeatures::IsSupported(SSE3)) {
-    CpuFeatureScope scope(masm, SSE3);
-    // Reserve space for 64 bit answer.
-    __ sub(esp, Immediate(kDoubleSize));  // Nolint.
-    // Do conversion, which cannot fail because we checked the exponent.
-    __ fisttp_d(Operand(esp, 0));
-    __ mov(result_reg, Operand(esp, 0));  // Load low word of answer as result
-    __ add(esp, Immediate(kDoubleSize));
-    __ jmp(&done);
-  } else {
-    // Result must be extracted from shifted 32-bit mantissa
-    __ sub(ecx, Immediate(delta));
-    __ neg(ecx);
-    __ mov(result_reg, exponent_operand);
-    __ and_(result_reg,
-            Immediate(static_cast<uint32_t>(Double::kSignificandMask >> 32)));
-    __ add(result_reg,
-           Immediate(static_cast<uint32_t>(Double::kHiddenBit >> 32)));
-    __ shrd_cl(scratch1, result_reg);
-    __ shr_cl(result_reg);
-    __ test(ecx, Immediate(32));
-    __ cmov(not_equal, scratch1, result_reg);
-  }
-
-  // If the double was negative, negate the integer result.
-  __ bind(&check_negative);
-  __ mov(result_reg, scratch1);
-  __ neg(result_reg);
-  __ cmp(exponent_operand, Immediate(0));
-  __ cmov(greater, result_reg, scratch1);
-
-  // Restore registers
-  __ bind(&done);
-  if (final_result_reg != result_reg) {
-    DCHECK(final_result_reg == ecx);
-    __ mov(final_result_reg, result_reg);
-  }
-  __ pop(save_reg);
-  __ pop(scratch1);
-  __ ret(0);
-}
-
-
-void MathPowStub::Generate(MacroAssembler* masm) {
-  const Register exponent = MathPowTaggedDescriptor::exponent();
-  DCHECK(exponent == eax);
-  const Register scratch = ecx;
-  const XMMRegister double_result = xmm3;
-  const XMMRegister double_base = xmm2;
-  const XMMRegister double_exponent = xmm1;
-  const XMMRegister double_scratch = xmm4;
-
-  Label call_runtime, done, exponent_not_smi, int_exponent;
-
-  // Save 1 in double_result - we need this several times later on.
-  __ mov(scratch, Immediate(1));
-  __ Cvtsi2sd(double_result, scratch);
-
-  if (exponent_type() == TAGGED) {
-    __ JumpIfNotSmi(exponent, &exponent_not_smi, Label::kNear);
-    __ SmiUntag(exponent);
-    __ jmp(&int_exponent);
-
-    __ bind(&exponent_not_smi);
-    __ movsd(double_exponent,
-              FieldOperand(exponent, HeapNumber::kValueOffset));
-  }
-
-  if (exponent_type() != INTEGER) {
-    Label fast_power, try_arithmetic_simplification;
-    __ DoubleToI(exponent, double_exponent, double_scratch,
-                 TREAT_MINUS_ZERO_AS_ZERO, &try_arithmetic_simplification,
-                 &try_arithmetic_simplification,
-                 &try_arithmetic_simplification);
-    __ jmp(&int_exponent);
-
-    __ bind(&try_arithmetic_simplification);
-    // Skip to runtime if possibly NaN (indicated by the indefinite integer).
-    __ cvttsd2si(exponent, Operand(double_exponent));
-    __ cmp(exponent, Immediate(0x1));
-    __ j(overflow, &call_runtime);
-
-    // Using FPU instructions to calculate power.
-    Label fast_power_failed;
-    __ bind(&fast_power);
-    __ fnclex();  // Clear flags to catch exceptions later.
-    // Transfer (B)ase and (E)xponent onto the FPU register stack.
-    __ sub(esp, Immediate(kDoubleSize));
-    __ movsd(Operand(esp, 0), double_exponent);
-    __ fld_d(Operand(esp, 0));  // E
-    __ movsd(Operand(esp, 0), double_base);
-    __ fld_d(Operand(esp, 0));  // B, E
-
-    // Exponent is in st(1) and base is in st(0)
-    // B ^ E = (2^(E * log2(B)) - 1) + 1 = (2^X - 1) + 1 for X = E * log2(B)
-    // FYL2X calculates st(1) * log2(st(0))
-    __ fyl2x();    // X
-    __ fld(0);     // X, X
-    __ frndint();  // rnd(X), X
-    __ fsub(1);    // rnd(X), X-rnd(X)
-    __ fxch(1);    // X - rnd(X), rnd(X)
-    // F2XM1 calculates 2^st(0) - 1 for -1 < st(0) < 1
-    __ f2xm1();    // 2^(X-rnd(X)) - 1, rnd(X)
-    __ fld1();     // 1, 2^(X-rnd(X)) - 1, rnd(X)
-    __ faddp(1);   // 2^(X-rnd(X)), rnd(X)
-    // FSCALE calculates st(0) * 2^st(1)
-    __ fscale();   // 2^X, rnd(X)
-    __ fstp(1);    // 2^X
-    // Bail out to runtime in case of exceptions in the status word.
-    __ fnstsw_ax();
-    __ test_b(eax,
-              Immediate(0x5F));  // We check for all but precision exception.
-    __ j(not_zero, &fast_power_failed, Label::kNear);
-    __ fstp_d(Operand(esp, 0));
-    __ movsd(double_result, Operand(esp, 0));
-    __ add(esp, Immediate(kDoubleSize));
-    __ jmp(&done);
-
-    __ bind(&fast_power_failed);
-    __ fninit();
-    __ add(esp, Immediate(kDoubleSize));
-    __ jmp(&call_runtime);
-  }
-
-  // Calculate power with integer exponent.
-  __ bind(&int_exponent);
-  const XMMRegister double_scratch2 = double_exponent;
-  __ mov(scratch, exponent);  // Back up exponent.
-  __ movsd(double_scratch, double_base);  // Back up base.
-  __ movsd(double_scratch2, double_result);  // Load double_exponent with 1.
-
-  // Get absolute value of exponent.
-  Label no_neg, while_true, while_false;
-  __ test(scratch, scratch);
-  __ j(positive, &no_neg, Label::kNear);
-  __ neg(scratch);
-  __ bind(&no_neg);
-
-  __ j(zero, &while_false, Label::kNear);
-  __ shr(scratch, 1);
-  // Above condition means CF==0 && ZF==0.  This means that the
-  // bit that has been shifted out is 0 and the result is not 0.
-  __ j(above, &while_true, Label::kNear);
-  __ movsd(double_result, double_scratch);
-  __ j(zero, &while_false, Label::kNear);
-
-  __ bind(&while_true);
-  __ shr(scratch, 1);
-  __ mulsd(double_scratch, double_scratch);
-  __ j(above, &while_true, Label::kNear);
-  __ mulsd(double_result, double_scratch);
-  __ j(not_zero, &while_true);
-
-  __ bind(&while_false);
-  // scratch has the original value of the exponent - if the exponent is
-  // negative, return 1/result.
-  __ test(exponent, exponent);
-  __ j(positive, &done);
-  __ divsd(double_scratch2, double_result);
-  __ movsd(double_result, double_scratch2);
-  // Test whether result is zero.  Bail out to check for subnormal result.
-  // Due to subnormals, x^-y == (1/x)^y does not hold in all cases.
-  __ xorps(double_scratch2, double_scratch2);
-  __ ucomisd(double_scratch2, double_result);  // Result cannot be NaN.
-  // double_exponent aliased as double_scratch2 has already been overwritten
-  // and may not have contained the exponent value in the first place when the
-  // exponent is a smi.  We reset it with exponent value before bailing out.
-  __ j(not_equal, &done);
-  __ Cvtsi2sd(double_exponent, exponent);
-
-  // Returning or bailing out.
-  __ bind(&call_runtime);
-  {
-    AllowExternalCallThatCantCauseGC scope(masm);
-    __ PrepareCallCFunction(4, scratch);
-    __ movsd(Operand(esp, 0 * kDoubleSize), double_base);
-    __ movsd(Operand(esp, 1 * kDoubleSize), double_exponent);
-    __ CallCFunction(ExternalReference::power_double_double_function(isolate()),
-                     4);
-  }
-  // Return value is in st(0) on ia32.
-  // Store it into the (fixed) result register.
-  __ sub(esp, Immediate(kDoubleSize));
-  __ fstp_d(Operand(esp, 0));
-  __ movsd(double_result, Operand(esp, 0));
-  __ add(esp, Immediate(kDoubleSize));
-
-  __ bind(&done);
-  __ ret(0);
-}
-
-Movability CEntryStub::NeedsImmovableCode() { return kMovable; }
-
-void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) {
-  CEntryStub::GenerateAheadOfTime(isolate);
-  // It is important that the store buffer overflow stubs are generated first.
-  CommonArrayConstructorStub::GenerateStubsAheadOfTime(isolate);
-  StoreFastElementStub::GenerateAheadOfTime(isolate);
-}
-
-
-void CodeStub::GenerateFPStubs(Isolate* isolate) {
-  // Generate if not already in cache.
-  CEntryStub(isolate, 1, kSaveFPRegs).GetCode();
-}
-
-
-void CEntryStub::GenerateAheadOfTime(Isolate* isolate) {
-  CEntryStub stub(isolate, 1, kDontSaveFPRegs);
-  stub.GetCode();
-}
-
-
-void CEntryStub::Generate(MacroAssembler* masm) {
-  // eax: number of arguments including receiver
-  // ebx: pointer to C function  (C callee-saved)
-  // ebp: frame pointer  (restored after C call)
-  // esp: stack pointer  (restored after C call)
-  // esi: current context (C callee-saved)
-  // edi: JS function of the caller (C callee-saved)
-  //
-  // If argv_in_register():
-  // ecx: pointer to the first argument
-
-  ProfileEntryHookStub::MaybeCallEntryHook(masm);
-
-  // Reserve space on the stack for the three arguments passed to the call. If
-  // result size is greater than can be returned in registers, also reserve
-  // space for the hidden argument for the result location, and space for the
-  // result itself.
-  int arg_stack_space = 3;
-
-  // Enter the exit frame that transitions from JavaScript to C++.
-  if (argv_in_register()) {
-    DCHECK(!save_doubles());
-    DCHECK(!is_builtin_exit());
-    __ EnterApiExitFrame(arg_stack_space);
-
-    // Move argc and argv into the correct registers.
-    __ mov(esi, ecx);
-    __ mov(edi, eax);
-  } else {
-    __ EnterExitFrame(
-        arg_stack_space, save_doubles(),
-        is_builtin_exit() ? StackFrame::BUILTIN_EXIT : StackFrame::EXIT);
-  }
-
-  // ebx: pointer to C function  (C callee-saved)
-  // ebp: frame pointer  (restored after C call)
-  // esp: stack pointer  (restored after C call)
-  // edi: number of arguments including receiver  (C callee-saved)
-  // esi: pointer to the first argument (C callee-saved)
-
-  // Result returned in eax, or eax+edx if result size is 2.
-
-  // Check stack alignment.
-  if (FLAG_debug_code) {
-    __ CheckStackAlignment();
-  }
-  // Call C function.
-  __ mov(Operand(esp, 0 * kPointerSize), edi);  // argc.
-  __ mov(Operand(esp, 1 * kPointerSize), esi);  // argv.
-  __ mov(Operand(esp, 2 * kPointerSize),
-         Immediate(ExternalReference::isolate_address(isolate())));
-  __ call(ebx);
-
-  // Result is in eax or edx:eax - do not destroy these registers!
-
-  // Check result for exception sentinel.
-  Label exception_returned;
-  __ cmp(eax, isolate()->factory()->exception());
-  __ j(equal, &exception_returned);
-
-  // Check that there is no pending exception, otherwise we
-  // should have returned the exception sentinel.
-  if (FLAG_debug_code) {
-    __ push(edx);
-    __ mov(edx, Immediate(isolate()->factory()->the_hole_value()));
-    Label okay;
-    ExternalReference pending_exception_address(
-        IsolateAddressId::kPendingExceptionAddress, isolate());
-    __ cmp(edx, Operand::StaticVariable(pending_exception_address));
-    // Cannot use check here as it attempts to generate call into runtime.
-    __ j(equal, &okay, Label::kNear);
-    __ int3();
-    __ bind(&okay);
-    __ pop(edx);
-  }
-
-  // Exit the JavaScript to C++ exit frame.
-  __ LeaveExitFrame(save_doubles(), !argv_in_register());
-  __ ret(0);
-
-  // Handling of exception.
-  __ bind(&exception_returned);
-
-  ExternalReference pending_handler_context_address(
-      IsolateAddressId::kPendingHandlerContextAddress, isolate());
-  ExternalReference pending_handler_entrypoint_address(
-      IsolateAddressId::kPendingHandlerEntrypointAddress, isolate());
-  ExternalReference pending_handler_fp_address(
-      IsolateAddressId::kPendingHandlerFPAddress, isolate());
-  ExternalReference pending_handler_sp_address(
-      IsolateAddressId::kPendingHandlerSPAddress, isolate());
-
-  // Ask the runtime for help to determine the handler. This will set eax to
-  // contain the current pending exception, don't clobber it.
-  ExternalReference find_handler(Runtime::kUnwindAndFindExceptionHandler,
-                                 isolate());
-  {
-    FrameScope scope(masm, StackFrame::MANUAL);
-    __ PrepareCallCFunction(3, eax);
-    __ mov(Operand(esp, 0 * kPointerSize), Immediate(0));  // argc.
-    __ mov(Operand(esp, 1 * kPointerSize), Immediate(0));  // argv.
-    __ mov(Operand(esp, 2 * kPointerSize),
-           Immediate(ExternalReference::isolate_address(isolate())));
-    __ CallCFunction(find_handler, 3);
-  }
-
-  // Retrieve the handler context, SP and FP.
-  __ mov(esi, Operand::StaticVariable(pending_handler_context_address));
-  __ mov(esp, Operand::StaticVariable(pending_handler_sp_address));
-  __ mov(ebp, Operand::StaticVariable(pending_handler_fp_address));
-
-  // If the handler is a JS frame, restore the context to the frame. Note that
-  // the context will be set to (esi == 0) for non-JS frames.
-  Label skip;
-  __ test(esi, esi);
-  __ j(zero, &skip, Label::kNear);
-  __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), esi);
-  __ bind(&skip);
-
-  // Compute the handler entry address and jump to it.
-  __ mov(edi, Operand::StaticVariable(pending_handler_entrypoint_address));
-  __ jmp(edi);
-}
-
-
-void JSEntryStub::Generate(MacroAssembler* masm) {
-  Label invoke, handler_entry, exit;
-  Label not_outermost_js, not_outermost_js_2;
-
-  ProfileEntryHookStub::MaybeCallEntryHook(masm);
-
-  // Set up frame.
-  __ push(ebp);
-  __ mov(ebp, esp);
-
-  // Push marker in two places.
-  StackFrame::Type marker = type();
-  __ push(Immediate(StackFrame::TypeToMarker(marker)));  // marker
-  ExternalReference context_address(IsolateAddressId::kContextAddress,
-                                    isolate());
-  __ push(Operand::StaticVariable(context_address));  // context
-  // Save callee-saved registers (C calling conventions).
-  __ push(edi);
-  __ push(esi);
-  __ push(ebx);
-
-  // Save copies of the top frame descriptor on the stack.
-  ExternalReference c_entry_fp(IsolateAddressId::kCEntryFPAddress, isolate());
-  __ push(Operand::StaticVariable(c_entry_fp));
-
-  // If this is the outermost JS call, set js_entry_sp value.
-  ExternalReference js_entry_sp(IsolateAddressId::kJSEntrySPAddress, isolate());
-  __ cmp(Operand::StaticVariable(js_entry_sp), Immediate(0));
-  __ j(not_equal, &not_outermost_js, Label::kNear);
-  __ mov(Operand::StaticVariable(js_entry_sp), ebp);
-  __ push(Immediate(StackFrame::OUTERMOST_JSENTRY_FRAME));
-  __ jmp(&invoke, Label::kNear);
-  __ bind(&not_outermost_js);
-  __ push(Immediate(StackFrame::INNER_JSENTRY_FRAME));
-
-  // Jump to a faked try block that does the invoke, with a faked catch
-  // block that sets the pending exception.
-  __ jmp(&invoke);
-  __ bind(&handler_entry);
-  handler_offset_ = handler_entry.pos();
-  // Caught exception: Store result (exception) in the pending exception
-  // field in the JSEnv and return a failure sentinel.
-  ExternalReference pending_exception(
-      IsolateAddressId::kPendingExceptionAddress, isolate());
-  __ mov(Operand::StaticVariable(pending_exception), eax);
-  __ mov(eax, Immediate(isolate()->factory()->exception()));
-  __ jmp(&exit);
-
-  // Invoke: Link this frame into the handler chain.
-  __ bind(&invoke);
-  __ PushStackHandler();
-
-  // Invoke the function by calling through JS entry trampoline builtin and
-  // pop the faked function when we return. Notice that we cannot store a
-  // reference to the trampoline code directly in this stub, because the
-  // builtin stubs may not have been generated yet.
-  __ Call(EntryTrampoline(), RelocInfo::CODE_TARGET);
-
-  // Unlink this frame from the handler chain.
-  __ PopStackHandler();
-
-  __ bind(&exit);
-  // Check if the current stack frame is marked as the outermost JS frame.
-  __ pop(ebx);
-  __ cmp(ebx, Immediate(StackFrame::OUTERMOST_JSENTRY_FRAME));
-  __ j(not_equal, &not_outermost_js_2);
-  __ mov(Operand::StaticVariable(js_entry_sp), Immediate(0));
-  __ bind(&not_outermost_js_2);
-
-  // Restore the top frame descriptor from the stack.
-  __ pop(Operand::StaticVariable(
-      ExternalReference(IsolateAddressId::kCEntryFPAddress, isolate())));
-
-  // Restore callee-saved registers (C calling conventions).
-  __ pop(ebx);
-  __ pop(esi);
-  __ pop(edi);
-  __ add(esp, Immediate(2 * kPointerSize));  // remove markers
-
-  // Restore frame pointer and return.
-  __ pop(ebp);
-  __ ret(0);
-}
-
-void ProfileEntryHookStub::MaybeCallEntryHookDelayed(TurboAssembler* tasm,
-                                                     Zone* zone) {
-  if (tasm->isolate()->function_entry_hook() != nullptr) {
-    tasm->CallStubDelayed(new (zone) ProfileEntryHookStub(nullptr));
-  }
-}
-
-void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
-  if (masm->isolate()->function_entry_hook() != nullptr) {
-    ProfileEntryHookStub stub(masm->isolate());
-    masm->CallStub(&stub);
-  }
-}
-
-
-void ProfileEntryHookStub::Generate(MacroAssembler* masm) {
-  // Save volatile registers.
-  const int kNumSavedRegisters = 3;
-  __ push(eax);
-  __ push(ecx);
-  __ push(edx);
-
-  // Calculate and push the original stack pointer.
-  __ lea(eax, Operand(esp, (kNumSavedRegisters + 1) * kPointerSize));
-  __ push(eax);
-
-  // Retrieve our return address and use it to calculate the calling
-  // function's address.
-  __ mov(eax, Operand(esp, (kNumSavedRegisters + 1) * kPointerSize));
-  __ sub(eax, Immediate(Assembler::kCallInstructionLength));
-  __ push(eax);
-
-  // Call the entry hook.
-  DCHECK_NOT_NULL(isolate()->function_entry_hook());
-  __ call(FUNCTION_ADDR(isolate()->function_entry_hook()),
-          RelocInfo::RUNTIME_ENTRY);
-  __ add(esp, Immediate(2 * kPointerSize));
-
-  // Restore ecx.
-  __ pop(edx);
-  __ pop(ecx);
-  __ pop(eax);
-
-  __ ret(0);
-}
-
-
-template<class T>
-static void CreateArrayDispatch(MacroAssembler* masm,
-                                AllocationSiteOverrideMode mode) {
-  if (mode == DISABLE_ALLOCATION_SITES) {
-    T stub(masm->isolate(),
-           GetInitialFastElementsKind(),
-           mode);
-    __ TailCallStub(&stub);
-  } else if (mode == DONT_OVERRIDE) {
-    int last_index =
-        GetSequenceIndexFromFastElementsKind(TERMINAL_FAST_ELEMENTS_KIND);
-    for (int i = 0; i <= last_index; ++i) {
-      Label next;
-      ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
-      __ cmp(edx, kind);
-      __ j(not_equal, &next);
-      T stub(masm->isolate(), kind);
-      __ TailCallStub(&stub);
-      __ bind(&next);
-    }
-
-    // If we reached this point there is a problem.
-    __ Abort(AbortReason::kUnexpectedElementsKindInArrayConstructor);
-  } else {
-    UNREACHABLE();
-  }
-}
-
-
-static void CreateArrayDispatchOneArgument(MacroAssembler* masm,
-                                           AllocationSiteOverrideMode mode) {
-  // ebx - allocation site (if mode != DISABLE_ALLOCATION_SITES)
-  // edx - kind (if mode != DISABLE_ALLOCATION_SITES)
-  // eax - number of arguments
-  // edi - constructor?
-  // esp[0] - return address
-  // esp[4] - last argument
-  STATIC_ASSERT(PACKED_SMI_ELEMENTS == 0);
-  STATIC_ASSERT(HOLEY_SMI_ELEMENTS == 1);
-  STATIC_ASSERT(PACKED_ELEMENTS == 2);
-  STATIC_ASSERT(HOLEY_ELEMENTS == 3);
-  STATIC_ASSERT(PACKED_DOUBLE_ELEMENTS == 4);
-  STATIC_ASSERT(HOLEY_DOUBLE_ELEMENTS == 5);
-
-  if (mode == DISABLE_ALLOCATION_SITES) {
-    ElementsKind initial = GetInitialFastElementsKind();
-    ElementsKind holey_initial = GetHoleyElementsKind(initial);
-
-    ArraySingleArgumentConstructorStub stub_holey(masm->isolate(),
-                                                  holey_initial,
-                                                  DISABLE_ALLOCATION_SITES);
-    __ TailCallStub(&stub_holey);
-  } else if (mode == DONT_OVERRIDE) {
-    // is the low bit set? If so, we are holey and that is good.
-    Label normal_sequence;
-    __ test_b(edx, Immediate(1));
-    __ j(not_zero, &normal_sequence);
-
-    // We are going to create a holey array, but our kind is non-holey.
-    // Fix kind and retry.
-    __ inc(edx);
-
-    if (FLAG_debug_code) {
-      Handle<Map> allocation_site_map =
-          masm->isolate()->factory()->allocation_site_map();
-      __ cmp(FieldOperand(ebx, 0), Immediate(allocation_site_map));
-      __ Assert(equal, AbortReason::kExpectedAllocationSite);
-    }
-
-    // Save the resulting elements kind in type info. We can't just store r3
-    // in the AllocationSite::transition_info field because elements kind is
-    // restricted to a portion of the field...upper bits need to be left alone.
-    STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
-    __ add(
-        FieldOperand(ebx, AllocationSite::kTransitionInfoOrBoilerplateOffset),
-        Immediate(Smi::FromInt(kFastElementsKindPackedToHoley)));
-
-    __ bind(&normal_sequence);
-    int last_index =
-        GetSequenceIndexFromFastElementsKind(TERMINAL_FAST_ELEMENTS_KIND);
-    for (int i = 0; i <= last_index; ++i) {
-      Label next;
-      ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
-      __ cmp(edx, kind);
-      __ j(not_equal, &next);
-      ArraySingleArgumentConstructorStub stub(masm->isolate(), kind);
-      __ TailCallStub(&stub);
-      __ bind(&next);
-    }
-
-    // If we reached this point there is a problem.
-    __ Abort(AbortReason::kUnexpectedElementsKindInArrayConstructor);
-  } else {
-    UNREACHABLE();
-  }
-}
-
-
-template<class T>
-static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) {
-  int to_index =
-      GetSequenceIndexFromFastElementsKind(TERMINAL_FAST_ELEMENTS_KIND);
-  for (int i = 0; i <= to_index; ++i) {
-    ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
-    T stub(isolate, kind);
-    stub.GetCode();
-    if (AllocationSite::ShouldTrack(kind)) {
-      T stub1(isolate, kind, DISABLE_ALLOCATION_SITES);
-      stub1.GetCode();
-    }
-  }
-}
-
-void CommonArrayConstructorStub::GenerateStubsAheadOfTime(Isolate* isolate) {
-  ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>(
-      isolate);
-  ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>(
-      isolate);
-  ArrayNArgumentsConstructorStub stub(isolate);
-  stub.GetCode();
-
-  ElementsKind kinds[2] = {PACKED_ELEMENTS, HOLEY_ELEMENTS};
-  for (int i = 0; i < 2; i++) {
-    // For internal arrays we only need a few things
-    InternalArrayNoArgumentConstructorStub stubh1(isolate, kinds[i]);
-    stubh1.GetCode();
-    InternalArraySingleArgumentConstructorStub stubh2(isolate, kinds[i]);
-    stubh2.GetCode();
-  }
-}
-
-void ArrayConstructorStub::GenerateDispatchToArrayStub(
-    MacroAssembler* masm, AllocationSiteOverrideMode mode) {
-  Label not_zero_case, not_one_case;
-  __ test(eax, eax);
-  __ j(not_zero, &not_zero_case);
-  CreateArrayDispatch<ArrayNoArgumentConstructorStub>(masm, mode);
-
-  __ bind(&not_zero_case);
-  __ cmp(eax, 1);
-  __ j(greater, &not_one_case);
-  CreateArrayDispatchOneArgument(masm, mode);
-
-  __ bind(&not_one_case);
-  ArrayNArgumentsConstructorStub stub(masm->isolate());
-  __ TailCallStub(&stub);
-}
-
-void ArrayConstructorStub::Generate(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- eax : argc (only if argument_count() is ANY or MORE_THAN_ONE)
-  //  -- ebx : AllocationSite or undefined
-  //  -- edi : constructor
-  //  -- edx : Original constructor
-  //  -- esp[0] : return address
-  //  -- esp[4] : last argument
-  // -----------------------------------
-  if (FLAG_debug_code) {
-    // The array construct code is only set for the global and natives
-    // builtin Array functions which always have maps.
-
-    // Initial map for the builtin Array function should be a map.
-    __ mov(ecx, FieldOperand(edi, JSFunction::kPrototypeOrInitialMapOffset));
-    // Will both indicate a nullptr and a Smi.
-    __ test(ecx, Immediate(kSmiTagMask));
-    __ Assert(not_zero, AbortReason::kUnexpectedInitialMapForArrayFunction);
-    __ CmpObjectType(ecx, MAP_TYPE, ecx);
-    __ Assert(equal, AbortReason::kUnexpectedInitialMapForArrayFunction);
-
-    // We should either have undefined in ebx or a valid AllocationSite
-    __ AssertUndefinedOrAllocationSite(ebx);
-  }
-
-  Label subclassing;
-
-  // Enter the context of the Array function.
-  __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
-
-  __ cmp(edx, edi);
-  __ j(not_equal, &subclassing);
-
-  Label no_info;
-  // If the feedback vector is the undefined value call an array constructor
-  // that doesn't use AllocationSites.
-  __ cmp(ebx, isolate()->factory()->undefined_value());
-  __ j(equal, &no_info);
-
-  // Only look at the lower 16 bits of the transition info.
-  __ mov(edx,
-         FieldOperand(ebx, AllocationSite::kTransitionInfoOrBoilerplateOffset));
-  __ SmiUntag(edx);
-  STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
-  __ and_(edx, Immediate(AllocationSite::ElementsKindBits::kMask));
-  GenerateDispatchToArrayStub(masm, DONT_OVERRIDE);
-
-  __ bind(&no_info);
-  GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES);
-
-  // Subclassing.
-  __ bind(&subclassing);
-  __ mov(Operand(esp, eax, times_pointer_size, kPointerSize), edi);
-  __ add(eax, Immediate(3));
-  __ PopReturnAddressTo(ecx);
-  __ Push(edx);
-  __ Push(ebx);
-  __ PushReturnAddressFrom(ecx);
-  __ JumpToExternalReference(ExternalReference(Runtime::kNewArray, isolate()));
-}
-
-
-void InternalArrayConstructorStub::GenerateCase(
-    MacroAssembler* masm, ElementsKind kind) {
-  Label not_zero_case, not_one_case;
-  Label normal_sequence;
-
-  __ test(eax, eax);
-  __ j(not_zero, &not_zero_case);
-  InternalArrayNoArgumentConstructorStub stub0(isolate(), kind);
-  __ TailCallStub(&stub0);
-
-  __ bind(&not_zero_case);
-  __ cmp(eax, 1);
-  __ j(greater, &not_one_case);
-
-  if (IsFastPackedElementsKind(kind)) {
-    // We might need to create a holey array
-    // look at the first argument
-    __ mov(ecx, Operand(esp, kPointerSize));
-    __ test(ecx, ecx);
-    __ j(zero, &normal_sequence);
-
-    InternalArraySingleArgumentConstructorStub
-        stub1_holey(isolate(), GetHoleyElementsKind(kind));
-    __ TailCallStub(&stub1_holey);
-  }
-
-  __ bind(&normal_sequence);
-  InternalArraySingleArgumentConstructorStub stub1(isolate(), kind);
-  __ TailCallStub(&stub1);
-
-  __ bind(&not_one_case);
-  ArrayNArgumentsConstructorStub stubN(isolate());
-  __ TailCallStub(&stubN);
-}
-
-
-void InternalArrayConstructorStub::Generate(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- eax : argc
-  //  -- edi : constructor
-  //  -- esp[0] : return address
-  //  -- esp[4] : last argument
-  // -----------------------------------
-
-  if (FLAG_debug_code) {
-    // The array construct code is only set for the global and natives
-    // builtin Array functions which always have maps.
-
-    // Initial map for the builtin Array function should be a map.
-    __ mov(ecx, FieldOperand(edi, JSFunction::kPrototypeOrInitialMapOffset));
-    // Will both indicate a nullptr and a Smi.
-    __ test(ecx, Immediate(kSmiTagMask));
-    __ Assert(not_zero, AbortReason::kUnexpectedInitialMapForArrayFunction);
-    __ CmpObjectType(ecx, MAP_TYPE, ecx);
-    __ Assert(equal, AbortReason::kUnexpectedInitialMapForArrayFunction);
-  }
-
-  // Figure out the right elements kind
-  __ mov(ecx, FieldOperand(edi, JSFunction::kPrototypeOrInitialMapOffset));
-
-  // Load the map's "bit field 2" into |result|. We only need the first byte,
-  // but the following masking takes care of that anyway.
-  __ mov(ecx, FieldOperand(ecx, Map::kBitField2Offset));
-  // Retrieve elements_kind from bit field 2.
-  __ DecodeField<Map::ElementsKindBits>(ecx);
-
-  if (FLAG_debug_code) {
-    Label done;
-    __ cmp(ecx, Immediate(PACKED_ELEMENTS));
-    __ j(equal, &done);
-    __ cmp(ecx, Immediate(HOLEY_ELEMENTS));
-    __ Assert(
-        equal,
-        AbortReason::kInvalidElementsKindForInternalArrayOrInternalPackedArray);
-    __ bind(&done);
-  }
-
-  Label fast_elements_case;
-  __ cmp(ecx, Immediate(PACKED_ELEMENTS));
-  __ j(equal, &fast_elements_case);
-  GenerateCase(masm, HOLEY_ELEMENTS);
-
-  __ bind(&fast_elements_case);
-  GenerateCase(masm, PACKED_ELEMENTS);
-}
-
-// Generates an Operand for saving parameters after PrepareCallApiFunction.
-static Operand ApiParameterOperand(int index) {
-  return Operand(esp, index * kPointerSize);
-}
-
-
-// Prepares stack to put arguments (aligns and so on). Reserves
-// space for return value if needed (assumes the return value is a handle).
-// Arguments must be stored in ApiParameterOperand(0), ApiParameterOperand(1)
-// etc. Saves context (esi). If space was reserved for return value then
-// stores the pointer to the reserved slot into esi.
-static void PrepareCallApiFunction(MacroAssembler* masm, int argc) {
-  __ EnterApiExitFrame(argc);
-  if (__ emit_debug_code()) {
-    __ mov(esi, Immediate(bit_cast<int32_t>(kZapValue)));
-  }
-}
-
-
-// Calls an API function.  Allocates HandleScope, extracts returned value
-// from handle and propagates exceptions.  Clobbers ebx, edi and
-// caller-save registers.  Restores context.  On return removes
-// stack_space * kPointerSize (GCed).
-static void CallApiFunctionAndReturn(MacroAssembler* masm,
-                                     Register function_address,
-                                     ExternalReference thunk_ref,
-                                     Operand thunk_last_arg, int stack_space,
-                                     Operand* stack_space_operand,
-                                     Operand return_value_operand) {
-  Isolate* isolate = masm->isolate();
-
-  ExternalReference next_address =
-      ExternalReference::handle_scope_next_address(isolate);
-  ExternalReference limit_address =
-      ExternalReference::handle_scope_limit_address(isolate);
-  ExternalReference level_address =
-      ExternalReference::handle_scope_level_address(isolate);
-
-  DCHECK(edx == function_address);
-  // Allocate HandleScope in callee-save registers.
-  __ mov(ebx, Operand::StaticVariable(next_address));
-  __ mov(edi, Operand::StaticVariable(limit_address));
-  __ add(Operand::StaticVariable(level_address), Immediate(1));
-
-  if (FLAG_log_timer_events) {
-    FrameScope frame(masm, StackFrame::MANUAL);
-    __ PushSafepointRegisters();
-    __ PrepareCallCFunction(1, eax);
-    __ mov(Operand(esp, 0),
-           Immediate(ExternalReference::isolate_address(isolate)));
-    __ CallCFunction(ExternalReference::log_enter_external_function(isolate),
-                     1);
-    __ PopSafepointRegisters();
-  }
-
-
-  Label profiler_disabled;
-  Label end_profiler_check;
-  __ mov(eax, Immediate(ExternalReference::is_profiling_address(isolate)));
-  __ cmpb(Operand(eax, 0), Immediate(0));
-  __ j(zero, &profiler_disabled);
-
-  // Additional parameter is the address of the actual getter function.
-  __ mov(thunk_last_arg, function_address);
-  // Call the api function.
-  __ mov(eax, Immediate(thunk_ref));
-  __ call(eax);
-  __ jmp(&end_profiler_check);
-
-  __ bind(&profiler_disabled);
-  // Call the api function.
-  __ call(function_address);
-  __ bind(&end_profiler_check);
-
-  if (FLAG_log_timer_events) {
-    FrameScope frame(masm, StackFrame::MANUAL);
-    __ PushSafepointRegisters();
-    __ PrepareCallCFunction(1, eax);
-    __ mov(Operand(esp, 0),
-           Immediate(ExternalReference::isolate_address(isolate)));
-    __ CallCFunction(ExternalReference::log_leave_external_function(isolate),
-                     1);
-    __ PopSafepointRegisters();
-  }
-
-  Label prologue;
-  // Load the value from ReturnValue
-  __ mov(eax, return_value_operand);
-
-  Label promote_scheduled_exception;
-  Label delete_allocated_handles;
-  Label leave_exit_frame;
-
-  __ bind(&prologue);
-  // No more valid handles (the result handle was the last one). Restore
-  // previous handle scope.
-  __ mov(Operand::StaticVariable(next_address), ebx);
-  __ sub(Operand::StaticVariable(level_address), Immediate(1));
-  __ Assert(above_equal, AbortReason::kInvalidHandleScopeLevel);
-  __ cmp(edi, Operand::StaticVariable(limit_address));
-  __ j(not_equal, &delete_allocated_handles);
-
-  // Leave the API exit frame.
-  __ bind(&leave_exit_frame);
-  if (stack_space_operand != nullptr) {
-    __ mov(ebx, *stack_space_operand);
-  }
-  __ LeaveApiExitFrame();
-
-  // Check if the function scheduled an exception.
-  ExternalReference scheduled_exception_address =
-      ExternalReference::scheduled_exception_address(isolate);
-  __ cmp(Operand::StaticVariable(scheduled_exception_address),
-         Immediate(isolate->factory()->the_hole_value()));
-  __ j(not_equal, &promote_scheduled_exception);
-
-#if DEBUG
-  // Check if the function returned a valid JavaScript value.
-  Label ok;
-  Register return_value = eax;
-  Register map = ecx;
-
-  __ JumpIfSmi(return_value, &ok, Label::kNear);
-  __ mov(map, FieldOperand(return_value, HeapObject::kMapOffset));
-
-  __ CmpInstanceType(map, LAST_NAME_TYPE);
-  __ j(below_equal, &ok, Label::kNear);
-
-  __ CmpInstanceType(map, FIRST_JS_RECEIVER_TYPE);
-  __ j(above_equal, &ok, Label::kNear);
-
-  __ cmp(map, isolate->factory()->heap_number_map());
-  __ j(equal, &ok, Label::kNear);
-
-  __ cmp(return_value, isolate->factory()->undefined_value());
-  __ j(equal, &ok, Label::kNear);
-
-  __ cmp(return_value, isolate->factory()->true_value());
-  __ j(equal, &ok, Label::kNear);
-
-  __ cmp(return_value, isolate->factory()->false_value());
-  __ j(equal, &ok, Label::kNear);
-
-  __ cmp(return_value, isolate->factory()->null_value());
-  __ j(equal, &ok, Label::kNear);
-
-  __ Abort(AbortReason::kAPICallReturnedInvalidObject);
-
-  __ bind(&ok);
-#endif
-
-  if (stack_space_operand != nullptr) {
-    DCHECK_EQ(0, stack_space);
-    __ pop(ecx);
-    __ add(esp, ebx);
-    __ jmp(ecx);
-  } else {
-    __ ret(stack_space * kPointerSize);
-  }
-
-  // Re-throw by promoting a scheduled exception.
-  __ bind(&promote_scheduled_exception);
-  __ TailCallRuntime(Runtime::kPromoteScheduledException);
-
-  // HandleScope limit has changed. Delete allocated extensions.
-  ExternalReference delete_extensions =
-      ExternalReference::delete_handle_scope_extensions(isolate);
-  __ bind(&delete_allocated_handles);
-  __ mov(Operand::StaticVariable(limit_address), edi);
-  __ mov(edi, eax);
-  __ mov(Operand(esp, 0),
-         Immediate(ExternalReference::isolate_address(isolate)));
-  __ mov(eax, Immediate(delete_extensions));
-  __ call(eax);
-  __ mov(eax, edi);
-  __ jmp(&leave_exit_frame);
-}
-
-void CallApiCallbackStub::Generate(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- ebx                 : call_data
-  //  -- ecx                 : holder
-  //  -- edx                 : api_function_address
-  //  -- esi                 : context
-  //  --
-  //  -- esp[0]              : return address
-  //  -- esp[4]              : last argument
-  //  -- ...
-  //  -- esp[argc * 4]       : first argument
-  //  -- esp[(argc + 1) * 4] : receiver
-  // -----------------------------------
-
-  Register call_data = ebx;
-  Register holder = ecx;
-  Register api_function_address = edx;
-  Register return_address = eax;
-
-  typedef FunctionCallbackArguments FCA;
-
-  STATIC_ASSERT(FCA::kArgsLength == 6);
-  STATIC_ASSERT(FCA::kNewTargetIndex == 5);
-  STATIC_ASSERT(FCA::kDataIndex == 4);
-  STATIC_ASSERT(FCA::kReturnValueOffset == 3);
-  STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2);
-  STATIC_ASSERT(FCA::kIsolateIndex == 1);
-  STATIC_ASSERT(FCA::kHolderIndex == 0);
-
-  __ pop(return_address);
-
-  // new target
-  __ PushRoot(Heap::kUndefinedValueRootIndex);
-
-  // call data
-  __ push(call_data);
-
-  // return value
-  __ PushRoot(Heap::kUndefinedValueRootIndex);
-  // return value default
-  __ PushRoot(Heap::kUndefinedValueRootIndex);
-  // isolate
-  __ push(Immediate(ExternalReference::isolate_address(isolate())));
-  // holder
-  __ push(holder);
-
-  Register scratch = call_data;
-
-  __ mov(scratch, esp);
-
-  // push return address
-  __ push(return_address);
-
-  // API function gets reference to the v8::Arguments. If CPU profiler
-  // is enabled wrapper function will be called and we need to pass
-  // address of the callback as additional parameter, always allocate
-  // space for it.
-  const int kApiArgc = 1 + 1;
-
-  // Allocate the v8::Arguments structure in the arguments' space since
-  // it's not controlled by GC.
-  const int kApiStackSpace = 3;
-
-  PrepareCallApiFunction(masm, kApiArgc + kApiStackSpace);
-
-  // FunctionCallbackInfo::implicit_args_.
-  __ mov(ApiParameterOperand(2), scratch);
-  __ add(scratch, Immediate((argc() + FCA::kArgsLength - 1) * kPointerSize));
-  // FunctionCallbackInfo::values_.
-  __ mov(ApiParameterOperand(3), scratch);
-  // FunctionCallbackInfo::length_.
-  __ Move(ApiParameterOperand(4), Immediate(argc()));
-
-  // v8::InvocationCallback's argument.
-  __ lea(scratch, ApiParameterOperand(2));
-  __ mov(ApiParameterOperand(0), scratch);
-
-  ExternalReference thunk_ref =
-      ExternalReference::invoke_function_callback(masm->isolate());
-
-  // Stores return the first js argument
-  int return_value_offset = 2 + FCA::kReturnValueOffset;
-  Operand return_value_operand(ebp, return_value_offset * kPointerSize);
-  const int stack_space = argc() + FCA::kArgsLength + 1;
-  Operand* stack_space_operand = nullptr;
-  CallApiFunctionAndReturn(masm, api_function_address, thunk_ref,
-                           ApiParameterOperand(1), stack_space,
-                           stack_space_operand, return_value_operand);
-}
-
-
-void CallApiGetterStub::Generate(MacroAssembler* masm) {
-  // Build v8::PropertyCallbackInfo::args_ array on the stack and push property
-  // name below the exit frame to make GC aware of them.
-  STATIC_ASSERT(PropertyCallbackArguments::kShouldThrowOnErrorIndex == 0);
-  STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 1);
-  STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 2);
-  STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 3);
-  STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 4);
-  STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 5);
-  STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 6);
-  STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 7);
-
-  Register receiver = ApiGetterDescriptor::ReceiverRegister();
-  Register holder = ApiGetterDescriptor::HolderRegister();
-  Register callback = ApiGetterDescriptor::CallbackRegister();
-  Register scratch = ebx;
-  DCHECK(!AreAliased(receiver, holder, callback, scratch));
-
-  __ pop(scratch);  // Pop return address to extend the frame.
-  __ push(receiver);
-  __ push(FieldOperand(callback, AccessorInfo::kDataOffset));
-  __ PushRoot(Heap::kUndefinedValueRootIndex);  // ReturnValue
-  // ReturnValue default value
-  __ PushRoot(Heap::kUndefinedValueRootIndex);
-  __ push(Immediate(ExternalReference::isolate_address(isolate())));
-  __ push(holder);
-  __ push(Immediate(Smi::kZero));  // should_throw_on_error -> false
-  __ push(FieldOperand(callback, AccessorInfo::kNameOffset));
-  __ push(scratch);  // Restore return address.
-
-  // v8::PropertyCallbackInfo::args_ array and name handle.
-  const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1;
-
-  // Allocate v8::PropertyCallbackInfo object, arguments for callback and
-  // space for optional callback address parameter (in case CPU profiler is
-  // active) in non-GCed stack space.
-  const int kApiArgc = 3 + 1;
-
-  // Load address of v8::PropertyAccessorInfo::args_ array.
-  __ lea(scratch, Operand(esp, 2 * kPointerSize));
-
-  PrepareCallApiFunction(masm, kApiArgc);
-  // Create v8::PropertyCallbackInfo object on the stack and initialize
-  // it's args_ field.
-  Operand info_object = ApiParameterOperand(3);
-  __ mov(info_object, scratch);
-
-  // Name as handle.
-  __ sub(scratch, Immediate(kPointerSize));
-  __ mov(ApiParameterOperand(0), scratch);
-  // Arguments pointer.
-  __ lea(scratch, info_object);
-  __ mov(ApiParameterOperand(1), scratch);
-  // Reserve space for optional callback address parameter.
-  Operand thunk_last_arg = ApiParameterOperand(2);
-
-  ExternalReference thunk_ref =
-      ExternalReference::invoke_accessor_getter_callback(isolate());
-
-  __ mov(scratch, FieldOperand(callback, AccessorInfo::kJsGetterOffset));
-  Register function_address = edx;
-  __ mov(function_address,
-         FieldOperand(scratch, Foreign::kForeignAddressOffset));
-  // +3 is to skip prolog, return address and name handle.
-  Operand return_value_operand(
-      ebp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize);
-  CallApiFunctionAndReturn(masm, function_address, thunk_ref, thunk_last_arg,
-                           kStackUnwindSpace, nullptr, return_value_operand);
-}
-
-#undef __
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_IA32
diff --git a/src/v8/src/ia32/codegen-ia32.cc b/src/v8/src/ia32/codegen-ia32.cc
deleted file mode 100644
index 8bd6b5f..0000000
--- a/src/v8/src/ia32/codegen-ia32.cc
+++ /dev/null
@@ -1,464 +0,0 @@
-// Copyright 2012 the V8 project 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 V8_TARGET_ARCH_IA32
-
-#include "src/codegen.h"
-#include "src/factory-inl.h"
-#include "src/heap/heap.h"
-#include "src/macro-assembler.h"
-
-namespace v8 {
-namespace internal {
-
-#define __ masm.
-
-UnaryMathFunctionWithIsolate CreateSqrtFunction(Isolate* isolate) {
-  size_t allocated = 0;
-  byte* buffer = AllocatePage(isolate->heap()->GetRandomMmapAddr(), &allocated);
-  if (buffer == nullptr) return nullptr;
-
-  MacroAssembler masm(isolate, buffer, static_cast<int>(allocated),
-                      CodeObjectRequired::kNo);
-  // esp[1 * kPointerSize]: raw double input
-  // esp[0 * kPointerSize]: return address
-  // Move double input into registers.
-  {
-    __ movsd(xmm0, Operand(esp, 1 * kPointerSize));
-    __ sqrtsd(xmm0, xmm0);
-    __ movsd(Operand(esp, 1 * kPointerSize), xmm0);
-    // Load result into floating point register as return value.
-    __ fld_d(Operand(esp, 1 * kPointerSize));
-    __ Ret();
-  }
-
-  CodeDesc desc;
-  masm.GetCode(isolate, &desc);
-  DCHECK(!RelocInfo::RequiresRelocation(isolate, desc));
-
-  Assembler::FlushICache(isolate, buffer, allocated);
-  CHECK(SetPermissions(buffer, allocated, PageAllocator::kReadExecute));
-  return FUNCTION_CAST<UnaryMathFunctionWithIsolate>(buffer);
-}
-
-
-// Helper functions for CreateMemMoveFunction.
-#undef __
-#define __ ACCESS_MASM(masm)
-
-enum Direction { FORWARD, BACKWARD };
-enum Alignment { MOVE_ALIGNED, MOVE_UNALIGNED };
-
-// Expects registers:
-// esi - source, aligned if alignment == ALIGNED
-// edi - destination, always aligned
-// ecx - count (copy size in bytes)
-// edx - loop count (number of 64 byte chunks)
-void MemMoveEmitMainLoop(MacroAssembler* masm,
-                         Label* move_last_15,
-                         Direction direction,
-                         Alignment alignment) {
-  Register src = esi;
-  Register dst = edi;
-  Register count = ecx;
-  Register loop_count = edx;
-  Label loop, move_last_31, move_last_63;
-  __ cmp(loop_count, 0);
-  __ j(equal, &move_last_63);
-  __ bind(&loop);
-  // Main loop. Copy in 64 byte chunks.
-  if (direction == BACKWARD) __ sub(src, Immediate(0x40));
-  __ movdq(alignment == MOVE_ALIGNED, xmm0, Operand(src, 0x00));
-  __ movdq(alignment == MOVE_ALIGNED, xmm1, Operand(src, 0x10));
-  __ movdq(alignment == MOVE_ALIGNED, xmm2, Operand(src, 0x20));
-  __ movdq(alignment == MOVE_ALIGNED, xmm3, Operand(src, 0x30));
-  if (direction == FORWARD) __ add(src, Immediate(0x40));
-  if (direction == BACKWARD) __ sub(dst, Immediate(0x40));
-  __ movdqa(Operand(dst, 0x00), xmm0);
-  __ movdqa(Operand(dst, 0x10), xmm1);
-  __ movdqa(Operand(dst, 0x20), xmm2);
-  __ movdqa(Operand(dst, 0x30), xmm3);
-  if (direction == FORWARD) __ add(dst, Immediate(0x40));
-  __ dec(loop_count);
-  __ j(not_zero, &loop);
-  // At most 63 bytes left to copy.
-  __ bind(&move_last_63);
-  __ test(count, Immediate(0x20));
-  __ j(zero, &move_last_31);
-  if (direction == BACKWARD) __ sub(src, Immediate(0x20));
-  __ movdq(alignment == MOVE_ALIGNED, xmm0, Operand(src, 0x00));
-  __ movdq(alignment == MOVE_ALIGNED, xmm1, Operand(src, 0x10));
-  if (direction == FORWARD) __ add(src, Immediate(0x20));
-  if (direction == BACKWARD) __ sub(dst, Immediate(0x20));
-  __ movdqa(Operand(dst, 0x00), xmm0);
-  __ movdqa(Operand(dst, 0x10), xmm1);
-  if (direction == FORWARD) __ add(dst, Immediate(0x20));
-  // At most 31 bytes left to copy.
-  __ bind(&move_last_31);
-  __ test(count, Immediate(0x10));
-  __ j(zero, move_last_15);
-  if (direction == BACKWARD) __ sub(src, Immediate(0x10));
-  __ movdq(alignment == MOVE_ALIGNED, xmm0, Operand(src, 0));
-  if (direction == FORWARD) __ add(src, Immediate(0x10));
-  if (direction == BACKWARD) __ sub(dst, Immediate(0x10));
-  __ movdqa(Operand(dst, 0), xmm0);
-  if (direction == FORWARD) __ add(dst, Immediate(0x10));
-}
-
-
-void MemMoveEmitPopAndReturn(MacroAssembler* masm) {
-  __ pop(esi);
-  __ pop(edi);
-  __ ret(0);
-}
-
-
-#undef __
-#define __ masm.
-
-
-class LabelConverter {
- public:
-  explicit LabelConverter(byte* buffer) : buffer_(buffer) {}
-  int32_t address(Label* l) const {
-    return reinterpret_cast<int32_t>(buffer_) + l->pos();
-  }
- private:
-  byte* buffer_;
-};
-
-
-MemMoveFunction CreateMemMoveFunction(Isolate* isolate) {
-  size_t allocated = 0;
-  byte* buffer = AllocatePage(isolate->heap()->GetRandomMmapAddr(), &allocated);
-  if (buffer == nullptr) return nullptr;
-
-  MacroAssembler masm(isolate, buffer, static_cast<int>(allocated),
-                      CodeObjectRequired::kNo);
-  LabelConverter conv(buffer);
-
-  // Generated code is put into a fixed, unmovable buffer, and not into
-  // the V8 heap. We can't, and don't, refer to any relocatable addresses
-  // (e.g. the JavaScript nan-object).
-
-  // 32-bit C declaration function calls pass arguments on stack.
-
-  // Stack layout:
-  // esp[12]: Third argument, size.
-  // esp[8]: Second argument, source pointer.
-  // esp[4]: First argument, destination pointer.
-  // esp[0]: return address
-
-  const int kDestinationOffset = 1 * kPointerSize;
-  const int kSourceOffset = 2 * kPointerSize;
-  const int kSizeOffset = 3 * kPointerSize;
-
-  // When copying up to this many bytes, use special "small" handlers.
-  const size_t kSmallCopySize = 8;
-  // When copying up to this many bytes, use special "medium" handlers.
-  const size_t kMediumCopySize = 63;
-  // When non-overlapping region of src and dst is less than this,
-  // use a more careful implementation (slightly slower).
-  const size_t kMinMoveDistance = 16;
-  // Note that these values are dictated by the implementation below,
-  // do not just change them and hope things will work!
-
-  int stack_offset = 0;  // Update if we change the stack height.
-
-  Label backward, backward_much_overlap;
-  Label forward_much_overlap, small_size, medium_size, pop_and_return;
-  __ push(edi);
-  __ push(esi);
-  stack_offset += 2 * kPointerSize;
-  Register dst = edi;
-  Register src = esi;
-  Register count = ecx;
-  Register loop_count = edx;
-  __ mov(dst, Operand(esp, stack_offset + kDestinationOffset));
-  __ mov(src, Operand(esp, stack_offset + kSourceOffset));
-  __ mov(count, Operand(esp, stack_offset + kSizeOffset));
-
-  __ cmp(dst, src);
-  __ j(equal, &pop_and_return);
-
-  __ prefetch(Operand(src, 0), 1);
-  __ cmp(count, kSmallCopySize);
-  __ j(below_equal, &small_size);
-  __ cmp(count, kMediumCopySize);
-  __ j(below_equal, &medium_size);
-  __ cmp(dst, src);
-  __ j(above, &backward);
-
-  {
-    // |dst| is a lower address than |src|. Copy front-to-back.
-    Label unaligned_source, move_last_15, skip_last_move;
-    __ mov(eax, src);
-    __ sub(eax, dst);
-    __ cmp(eax, kMinMoveDistance);
-    __ j(below, &forward_much_overlap);
-    // Copy first 16 bytes.
-    __ movdqu(xmm0, Operand(src, 0));
-    __ movdqu(Operand(dst, 0), xmm0);
-    // Determine distance to alignment: 16 - (dst & 0xF).
-    __ mov(edx, dst);
-    __ and_(edx, 0xF);
-    __ neg(edx);
-    __ add(edx, Immediate(16));
-    __ add(dst, edx);
-    __ add(src, edx);
-    __ sub(count, edx);
-    // dst is now aligned. Main copy loop.
-    __ mov(loop_count, count);
-    __ shr(loop_count, 6);
-    // Check if src is also aligned.
-    __ test(src, Immediate(0xF));
-    __ j(not_zero, &unaligned_source);
-    // Copy loop for aligned source and destination.
-    MemMoveEmitMainLoop(&masm, &move_last_15, FORWARD, MOVE_ALIGNED);
-    // At most 15 bytes to copy. Copy 16 bytes at end of string.
-    __ bind(&move_last_15);
-    __ and_(count, 0xF);
-    __ j(zero, &skip_last_move, Label::kNear);
-    __ movdqu(xmm0, Operand(src, count, times_1, -0x10));
-    __ movdqu(Operand(dst, count, times_1, -0x10), xmm0);
-    __ bind(&skip_last_move);
-    MemMoveEmitPopAndReturn(&masm);
-
-    // Copy loop for unaligned source and aligned destination.
-    __ bind(&unaligned_source);
-    MemMoveEmitMainLoop(&masm, &move_last_15, FORWARD, MOVE_UNALIGNED);
-    __ jmp(&move_last_15);
-
-    // Less than kMinMoveDistance offset between dst and src.
-    Label loop_until_aligned, last_15_much_overlap;
-    __ bind(&loop_until_aligned);
-    __ mov_b(eax, Operand(src, 0));
-    __ inc(src);
-    __ mov_b(Operand(dst, 0), eax);
-    __ inc(dst);
-    __ dec(count);
-    __ bind(&forward_much_overlap);  // Entry point into this block.
-    __ test(dst, Immediate(0xF));
-    __ j(not_zero, &loop_until_aligned);
-    // dst is now aligned, src can't be. Main copy loop.
-    __ mov(loop_count, count);
-    __ shr(loop_count, 6);
-    MemMoveEmitMainLoop(&masm, &last_15_much_overlap,
-                        FORWARD, MOVE_UNALIGNED);
-    __ bind(&last_15_much_overlap);
-    __ and_(count, 0xF);
-    __ j(zero, &pop_and_return);
-    __ cmp(count, kSmallCopySize);
-    __ j(below_equal, &small_size);
-    __ jmp(&medium_size);
-  }
-
-  {
-    // |dst| is a higher address than |src|. Copy backwards.
-    Label unaligned_source, move_first_15, skip_last_move;
-    __ bind(&backward);
-    // |dst| and |src| always point to the end of what's left to copy.
-    __ add(dst, count);
-    __ add(src, count);
-    __ mov(eax, dst);
-    __ sub(eax, src);
-    __ cmp(eax, kMinMoveDistance);
-    __ j(below, &backward_much_overlap);
-    // Copy last 16 bytes.
-    __ movdqu(xmm0, Operand(src, -0x10));
-    __ movdqu(Operand(dst, -0x10), xmm0);
-    // Find distance to alignment: dst & 0xF
-    __ mov(edx, dst);
-    __ and_(edx, 0xF);
-    __ sub(dst, edx);
-    __ sub(src, edx);
-    __ sub(count, edx);
-    // dst is now aligned. Main copy loop.
-    __ mov(loop_count, count);
-    __ shr(loop_count, 6);
-    // Check if src is also aligned.
-    __ test(src, Immediate(0xF));
-    __ j(not_zero, &unaligned_source);
-    // Copy loop for aligned source and destination.
-    MemMoveEmitMainLoop(&masm, &move_first_15, BACKWARD, MOVE_ALIGNED);
-    // At most 15 bytes to copy. Copy 16 bytes at beginning of string.
-    __ bind(&move_first_15);
-    __ and_(count, 0xF);
-    __ j(zero, &skip_last_move, Label::kNear);
-    __ sub(src, count);
-    __ sub(dst, count);
-    __ movdqu(xmm0, Operand(src, 0));
-    __ movdqu(Operand(dst, 0), xmm0);
-    __ bind(&skip_last_move);
-    MemMoveEmitPopAndReturn(&masm);
-
-    // Copy loop for unaligned source and aligned destination.
-    __ bind(&unaligned_source);
-    MemMoveEmitMainLoop(&masm, &move_first_15, BACKWARD, MOVE_UNALIGNED);
-    __ jmp(&move_first_15);
-
-    // Less than kMinMoveDistance offset between dst and src.
-    Label loop_until_aligned, first_15_much_overlap;
-    __ bind(&loop_until_aligned);
-    __ dec(src);
-    __ dec(dst);
-    __ mov_b(eax, Operand(src, 0));
-    __ mov_b(Operand(dst, 0), eax);
-    __ dec(count);
-    __ bind(&backward_much_overlap);  // Entry point into this block.
-    __ test(dst, Immediate(0xF));
-    __ j(not_zero, &loop_until_aligned);
-    // dst is now aligned, src can't be. Main copy loop.
-    __ mov(loop_count, count);
-    __ shr(loop_count, 6);
-    MemMoveEmitMainLoop(&masm, &first_15_much_overlap,
-                        BACKWARD, MOVE_UNALIGNED);
-    __ bind(&first_15_much_overlap);
-    __ and_(count, 0xF);
-    __ j(zero, &pop_and_return);
-    // Small/medium handlers expect dst/src to point to the beginning.
-    __ sub(dst, count);
-    __ sub(src, count);
-    __ cmp(count, kSmallCopySize);
-    __ j(below_equal, &small_size);
-    __ jmp(&medium_size);
-  }
-  {
-    // Special handlers for 9 <= copy_size < 64. No assumptions about
-    // alignment or move distance, so all reads must be unaligned and
-    // must happen before any writes.
-    Label medium_handlers, f9_16, f17_32, f33_48, f49_63;
-
-    __ bind(&f9_16);
-    __ movsd(xmm0, Operand(src, 0));
-    __ movsd(xmm1, Operand(src, count, times_1, -8));
-    __ movsd(Operand(dst, 0), xmm0);
-    __ movsd(Operand(dst, count, times_1, -8), xmm1);
-    MemMoveEmitPopAndReturn(&masm);
-
-    __ bind(&f17_32);
-    __ movdqu(xmm0, Operand(src, 0));
-    __ movdqu(xmm1, Operand(src, count, times_1, -0x10));
-    __ movdqu(Operand(dst, 0x00), xmm0);
-    __ movdqu(Operand(dst, count, times_1, -0x10), xmm1);
-    MemMoveEmitPopAndReturn(&masm);
-
-    __ bind(&f33_48);
-    __ movdqu(xmm0, Operand(src, 0x00));
-    __ movdqu(xmm1, Operand(src, 0x10));
-    __ movdqu(xmm2, Operand(src, count, times_1, -0x10));
-    __ movdqu(Operand(dst, 0x00), xmm0);
-    __ movdqu(Operand(dst, 0x10), xmm1);
-    __ movdqu(Operand(dst, count, times_1, -0x10), xmm2);
-    MemMoveEmitPopAndReturn(&masm);
-
-    __ bind(&f49_63);
-    __ movdqu(xmm0, Operand(src, 0x00));
-    __ movdqu(xmm1, Operand(src, 0x10));
-    __ movdqu(xmm2, Operand(src, 0x20));
-    __ movdqu(xmm3, Operand(src, count, times_1, -0x10));
-    __ movdqu(Operand(dst, 0x00), xmm0);
-    __ movdqu(Operand(dst, 0x10), xmm1);
-    __ movdqu(Operand(dst, 0x20), xmm2);
-    __ movdqu(Operand(dst, count, times_1, -0x10), xmm3);
-    MemMoveEmitPopAndReturn(&masm);
-
-    __ bind(&medium_handlers);
-    __ dd(conv.address(&f9_16));
-    __ dd(conv.address(&f17_32));
-    __ dd(conv.address(&f33_48));
-    __ dd(conv.address(&f49_63));
-
-    __ bind(&medium_size);  // Entry point into this block.
-    __ mov(eax, count);
-    __ dec(eax);
-    __ shr(eax, 4);
-    if (FLAG_debug_code) {
-      Label ok;
-      __ cmp(eax, 3);
-      __ j(below_equal, &ok);
-      __ int3();
-      __ bind(&ok);
-    }
-    __ mov(eax, Operand(eax, times_4, conv.address(&medium_handlers)));
-    __ jmp(eax);
-  }
-  {
-    // Specialized copiers for copy_size <= 8 bytes.
-    Label small_handlers, f0, f1, f2, f3, f4, f5_8;
-    __ bind(&f0);
-    MemMoveEmitPopAndReturn(&masm);
-
-    __ bind(&f1);
-    __ mov_b(eax, Operand(src, 0));
-    __ mov_b(Operand(dst, 0), eax);
-    MemMoveEmitPopAndReturn(&masm);
-
-    __ bind(&f2);
-    __ mov_w(eax, Operand(src, 0));
-    __ mov_w(Operand(dst, 0), eax);
-    MemMoveEmitPopAndReturn(&masm);
-
-    __ bind(&f3);
-    __ mov_w(eax, Operand(src, 0));
-    __ mov_b(edx, Operand(src, 2));
-    __ mov_w(Operand(dst, 0), eax);
-    __ mov_b(Operand(dst, 2), edx);
-    MemMoveEmitPopAndReturn(&masm);
-
-    __ bind(&f4);
-    __ mov(eax, Operand(src, 0));
-    __ mov(Operand(dst, 0), eax);
-    MemMoveEmitPopAndReturn(&masm);
-
-    __ bind(&f5_8);
-    __ mov(eax, Operand(src, 0));
-    __ mov(edx, Operand(src, count, times_1, -4));
-    __ mov(Operand(dst, 0), eax);
-    __ mov(Operand(dst, count, times_1, -4), edx);
-    MemMoveEmitPopAndReturn(&masm);
-
-    __ bind(&small_handlers);
-    __ dd(conv.address(&f0));
-    __ dd(conv.address(&f1));
-    __ dd(conv.address(&f2));
-    __ dd(conv.address(&f3));
-    __ dd(conv.address(&f4));
-    __ dd(conv.address(&f5_8));
-    __ dd(conv.address(&f5_8));
-    __ dd(conv.address(&f5_8));
-    __ dd(conv.address(&f5_8));
-
-    __ bind(&small_size);  // Entry point into this block.
-    if (FLAG_debug_code) {
-      Label ok;
-      __ cmp(count, 8);
-      __ j(below_equal, &ok);
-      __ int3();
-      __ bind(&ok);
-    }
-    __ mov(eax, Operand(count, times_4, conv.address(&small_handlers)));
-    __ jmp(eax);
-  }
-
-  __ bind(&pop_and_return);
-  MemMoveEmitPopAndReturn(&masm);
-
-  CodeDesc desc;
-  masm.GetCode(isolate, &desc);
-  DCHECK(!RelocInfo::RequiresRelocation(isolate, desc));
-  Assembler::FlushICache(isolate, buffer, allocated);
-  CHECK(SetPermissions(buffer, allocated, PageAllocator::kReadExecute));
-  // TODO(jkummerow): It would be nice to register this code creation event
-  // with the PROFILE / GDBJIT system.
-  return FUNCTION_CAST<MemMoveFunction>(buffer);
-}
-
-
-#undef __
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_IA32
diff --git a/src/v8/src/ia32/cpu-ia32.cc b/src/v8/src/ia32/cpu-ia32.cc
deleted file mode 100644
index 8de6d1e..0000000
--- a/src/v8/src/ia32/cpu-ia32.cc
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// CPU specific code for ia32 independent of OS goes here.
-
-#ifdef __GNUC__
-#include "src/third_party/valgrind/valgrind.h"
-#endif
-
-#if V8_TARGET_ARCH_IA32
-
-#include "src/assembler.h"
-#include "src/macro-assembler.h"
-
-namespace v8 {
-namespace internal {
-
-void CpuFeatures::FlushICache(void* start, size_t size) {
-  // No need to flush the instruction cache on Intel. On Intel instruction
-  // cache flushing is only necessary when multiple cores running the same
-  // code simultaneously. V8 (and JavaScript) is single threaded and when code
-  // is patched on an intel CPU the core performing the patching will have its
-  // own instruction cache updated automatically.
-
-  // If flushing of the instruction cache becomes necessary Windows has the
-  // API function FlushInstructionCache.
-
-  // By default, valgrind only checks the stack for writes that might need to
-  // invalidate already cached translated code.  This leads to random
-  // instability when code patches or moves are sometimes unnoticed.  One
-  // solution is to run valgrind with --smc-check=all, but this comes at a big
-  // performance cost.  We can notify valgrind to invalidate its cache.
-#ifdef VALGRIND_DISCARD_TRANSLATIONS
-  unsigned res = VALGRIND_DISCARD_TRANSLATIONS(start, size);
-  USE(res);
-#endif
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_IA32
diff --git a/src/v8/src/ia32/deoptimizer-ia32.cc b/src/v8/src/ia32/deoptimizer-ia32.cc
deleted file mode 100644
index b072784..0000000
--- a/src/v8/src/ia32/deoptimizer-ia32.cc
+++ /dev/null
@@ -1,241 +0,0 @@
-// Copyright 2012 the V8 project 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 V8_TARGET_ARCH_IA32
-
-#include "src/assembler-inl.h"
-#include "src/deoptimizer.h"
-#include "src/frame-constants.h"
-#include "src/register-configuration.h"
-#include "src/safepoint-table.h"
-
-namespace v8 {
-namespace internal {
-
-const int Deoptimizer::table_entry_size_ = 10;
-
-#define __ masm()->
-
-void Deoptimizer::TableEntryGenerator::Generate() {
-  GeneratePrologue();
-
-  // Save all general purpose registers before messing with them.
-  const int kNumberOfRegisters = Register::kNumRegisters;
-
-  const int kDoubleRegsSize = kDoubleSize * XMMRegister::kNumRegisters;
-  __ sub(esp, Immediate(kDoubleRegsSize));
-  const RegisterConfiguration* config = RegisterConfiguration::Default();
-  for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
-    int code = config->GetAllocatableDoubleCode(i);
-    XMMRegister xmm_reg = XMMRegister::from_code(code);
-    int offset = code * kDoubleSize;
-    __ movsd(Operand(esp, offset), xmm_reg);
-  }
-
-  STATIC_ASSERT(kFloatSize == kPointerSize);
-  const int kFloatRegsSize = kFloatSize * XMMRegister::kNumRegisters;
-  __ sub(esp, Immediate(kFloatRegsSize));
-  for (int i = 0; i < config->num_allocatable_float_registers(); ++i) {
-    int code = config->GetAllocatableFloatCode(i);
-    XMMRegister xmm_reg = XMMRegister::from_code(code);
-    int offset = code * kFloatSize;
-    __ movss(Operand(esp, offset), xmm_reg);
-  }
-
-  __ pushad();
-
-  ExternalReference c_entry_fp_address(IsolateAddressId::kCEntryFPAddress,
-                                       isolate());
-  __ mov(Operand::StaticVariable(c_entry_fp_address), ebp);
-
-  const int kSavedRegistersAreaSize =
-      kNumberOfRegisters * kPointerSize + kDoubleRegsSize + kFloatRegsSize;
-
-  // Get the bailout id from the stack.
-  __ mov(ebx, Operand(esp, kSavedRegistersAreaSize));
-
-  // Get the address of the location in the code object
-  // and compute the fp-to-sp delta in register edx.
-  __ mov(ecx, Operand(esp, kSavedRegistersAreaSize + 1 * kPointerSize));
-  __ lea(edx, Operand(esp, kSavedRegistersAreaSize + 2 * kPointerSize));
-
-  __ sub(edx, ebp);
-  __ neg(edx);
-
-  // Allocate a new deoptimizer object.
-  __ PrepareCallCFunction(6, eax);
-  __ mov(eax, Immediate(0));
-  Label context_check;
-  __ mov(edi, Operand(ebp, CommonFrameConstants::kContextOrFrameTypeOffset));
-  __ JumpIfSmi(edi, &context_check);
-  __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
-  __ bind(&context_check);
-  __ mov(Operand(esp, 0 * kPointerSize), eax);  // Function.
-  __ mov(Operand(esp, 1 * kPointerSize), Immediate(type()));  // Bailout type.
-  __ mov(Operand(esp, 2 * kPointerSize), ebx);  // Bailout id.
-  __ mov(Operand(esp, 3 * kPointerSize), ecx);  // Code address or 0.
-  __ mov(Operand(esp, 4 * kPointerSize), edx);  // Fp-to-sp delta.
-  __ mov(Operand(esp, 5 * kPointerSize),
-         Immediate(ExternalReference::isolate_address(isolate())));
-  {
-    AllowExternalCallThatCantCauseGC scope(masm());
-    __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate()), 6);
-  }
-
-  // Preserve deoptimizer object in register eax and get the input
-  // frame descriptor pointer.
-  __ mov(ebx, Operand(eax, Deoptimizer::input_offset()));
-
-  // Fill in the input registers.
-  for (int i = kNumberOfRegisters - 1; i >= 0; i--) {
-    int offset = (i * kPointerSize) + FrameDescription::registers_offset();
-    __ pop(Operand(ebx, offset));
-  }
-
-  int float_regs_offset = FrameDescription::float_registers_offset();
-  // Fill in the float input registers.
-  for (int i = 0; i < XMMRegister::kNumRegisters; i++) {
-    int dst_offset = i * kFloatSize + float_regs_offset;
-    __ pop(Operand(ebx, dst_offset));
-  }
-
-  int double_regs_offset = FrameDescription::double_registers_offset();
-  // Fill in the double input registers.
-  for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
-    int code = config->GetAllocatableDoubleCode(i);
-    int dst_offset = code * kDoubleSize + double_regs_offset;
-    int src_offset = code * kDoubleSize;
-    __ movsd(xmm0, Operand(esp, src_offset));
-    __ movsd(Operand(ebx, dst_offset), xmm0);
-  }
-
-  // Clear FPU all exceptions.
-  // TODO(ulan): Find out why the TOP register is not zero here in some cases,
-  // and check that the generated code never deoptimizes with unbalanced stack.
-  __ fnclex();
-
-  // Remove the bailout id, return address and the double registers.
-  __ add(esp, Immediate(kDoubleRegsSize + 2 * kPointerSize));
-
-  // Compute a pointer to the unwinding limit in register ecx; that is
-  // the first stack slot not part of the input frame.
-  __ mov(ecx, Operand(ebx, FrameDescription::frame_size_offset()));
-  __ add(ecx, esp);
-
-  // Unwind the stack down to - but not including - the unwinding
-  // limit and copy the contents of the activation frame to the input
-  // frame description.
-  __ lea(edx, Operand(ebx, FrameDescription::frame_content_offset()));
-  Label pop_loop_header;
-  __ jmp(&pop_loop_header);
-  Label pop_loop;
-  __ bind(&pop_loop);
-  __ pop(Operand(edx, 0));
-  __ add(edx, Immediate(sizeof(uint32_t)));
-  __ bind(&pop_loop_header);
-  __ cmp(ecx, esp);
-  __ j(not_equal, &pop_loop);
-
-  // Compute the output frame in the deoptimizer.
-  __ push(eax);
-  __ PrepareCallCFunction(1, ebx);
-  __ mov(Operand(esp, 0 * kPointerSize), eax);
-  {
-    AllowExternalCallThatCantCauseGC scope(masm());
-    __ CallCFunction(
-        ExternalReference::compute_output_frames_function(isolate()), 1);
-  }
-  __ pop(eax);
-
-  __ mov(esp, Operand(eax, Deoptimizer::caller_frame_top_offset()));
-
-  // Replace the current (input) frame with the output frames.
-  Label outer_push_loop, inner_push_loop,
-      outer_loop_header, inner_loop_header;
-  // Outer loop state: eax = current FrameDescription**, edx = one past the
-  // last FrameDescription**.
-  __ mov(edx, Operand(eax, Deoptimizer::output_count_offset()));
-  __ mov(eax, Operand(eax, Deoptimizer::output_offset()));
-  __ lea(edx, Operand(eax, edx, times_4, 0));
-  __ jmp(&outer_loop_header);
-  __ bind(&outer_push_loop);
-  // Inner loop state: ebx = current FrameDescription*, ecx = loop index.
-  __ mov(ebx, Operand(eax, 0));
-  __ mov(ecx, Operand(ebx, FrameDescription::frame_size_offset()));
-  __ jmp(&inner_loop_header);
-  __ bind(&inner_push_loop);
-  __ sub(ecx, Immediate(sizeof(uint32_t)));
-  __ push(Operand(ebx, ecx, times_1, FrameDescription::frame_content_offset()));
-  __ bind(&inner_loop_header);
-  __ test(ecx, ecx);
-  __ j(not_zero, &inner_push_loop);
-  __ add(eax, Immediate(kPointerSize));
-  __ bind(&outer_loop_header);
-  __ cmp(eax, edx);
-  __ j(below, &outer_push_loop);
-
-  // In case of a failed STUB, we have to restore the XMM registers.
-  for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
-    int code = config->GetAllocatableDoubleCode(i);
-    XMMRegister xmm_reg = XMMRegister::from_code(code);
-    int src_offset = code * kDoubleSize + double_regs_offset;
-    __ movsd(xmm_reg, Operand(ebx, src_offset));
-  }
-
-  // Push pc and continuation from the last output frame.
-  __ push(Operand(ebx, FrameDescription::pc_offset()));
-  __ push(Operand(ebx, FrameDescription::continuation_offset()));
-
-  // Push the registers from the last output frame.
-  for (int i = 0; i < kNumberOfRegisters; i++) {
-    int offset = (i * kPointerSize) + FrameDescription::registers_offset();
-    __ push(Operand(ebx, offset));
-  }
-
-  // Restore the registers from the stack.
-  __ popad();
-
-  // Return to the continuation point.
-  __ ret(0);
-}
-
-
-void Deoptimizer::TableEntryGenerator::GeneratePrologue() {
-  // Create a sequence of deoptimization entries.
-  Label done;
-  for (int i = 0; i < count(); i++) {
-    int start = masm()->pc_offset();
-    USE(start);
-    __ push_imm32(i);
-    __ jmp(&done);
-    DCHECK(masm()->pc_offset() - start == table_entry_size_);
-  }
-  __ bind(&done);
-}
-
-bool Deoptimizer::PadTopOfStackRegister() { return false; }
-
-void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) {
-  SetFrameSlot(offset, value);
-}
-
-
-void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) {
-  SetFrameSlot(offset, value);
-}
-
-
-void FrameDescription::SetCallerConstantPool(unsigned offset, intptr_t value) {
-  // No embedded constant pool support.
-  UNREACHABLE();
-}
-
-
-#undef __
-
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_IA32
diff --git a/src/v8/src/ia32/disasm-ia32.cc b/src/v8/src/ia32/disasm-ia32.cc
deleted file mode 100644
index 6ce62e9..0000000
--- a/src/v8/src/ia32/disasm-ia32.cc
+++ /dev/null
@@ -1,2596 +0,0 @@
-// Copyright 2011 the V8 project 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 <assert.h>
-#include <stdarg.h>
-#include <stdio.h>
-
-#if V8_TARGET_ARCH_IA32
-
-#include "src/base/compiler-specific.h"
-#include "src/disasm.h"
-#include "src/ia32/sse-instr.h"
-
-namespace disasm {
-
-enum OperandOrder {
-  UNSET_OP_ORDER = 0,
-  REG_OPER_OP_ORDER,
-  OPER_REG_OP_ORDER
-};
-
-
-//------------------------------------------------------------------
-// Tables
-//------------------------------------------------------------------
-struct ByteMnemonic {
-  int b;  // -1 terminates, otherwise must be in range (0..255)
-  const char* mnem;
-  OperandOrder op_order_;
-};
-
-static const ByteMnemonic two_operands_instr[] = {
-    {0x01, "add", OPER_REG_OP_ORDER},  {0x03, "add", REG_OPER_OP_ORDER},
-    {0x09, "or", OPER_REG_OP_ORDER},   {0x0B, "or", REG_OPER_OP_ORDER},
-    {0x13, "adc", REG_OPER_OP_ORDER},  {0x1B, "sbb", REG_OPER_OP_ORDER},
-    {0x21, "and", OPER_REG_OP_ORDER},  {0x23, "and", REG_OPER_OP_ORDER},
-    {0x29, "sub", OPER_REG_OP_ORDER},  {0x2A, "subb", REG_OPER_OP_ORDER},
-    {0x2B, "sub", REG_OPER_OP_ORDER},  {0x31, "xor", OPER_REG_OP_ORDER},
-    {0x33, "xor", REG_OPER_OP_ORDER},  {0x38, "cmpb", OPER_REG_OP_ORDER},
-    {0x39, "cmp", OPER_REG_OP_ORDER},  {0x3A, "cmpb", REG_OPER_OP_ORDER},
-    {0x3B, "cmp", REG_OPER_OP_ORDER},  {0x84, "test_b", REG_OPER_OP_ORDER},
-    {0x85, "test", REG_OPER_OP_ORDER}, {0x86, "xchg_b", REG_OPER_OP_ORDER},
-    {0x87, "xchg", REG_OPER_OP_ORDER}, {0x8A, "mov_b", REG_OPER_OP_ORDER},
-    {0x8B, "mov", REG_OPER_OP_ORDER},  {0x8D, "lea", REG_OPER_OP_ORDER},
-    {-1, "", UNSET_OP_ORDER}};
-
-static const ByteMnemonic zero_operands_instr[] = {
-  {0xC3, "ret", UNSET_OP_ORDER},
-  {0xC9, "leave", UNSET_OP_ORDER},
-  {0x90, "nop", UNSET_OP_ORDER},
-  {0xF4, "hlt", UNSET_OP_ORDER},
-  {0xCC, "int3", UNSET_OP_ORDER},
-  {0x60, "pushad", UNSET_OP_ORDER},
-  {0x61, "popad", UNSET_OP_ORDER},
-  {0x9C, "pushfd", UNSET_OP_ORDER},
-  {0x9D, "popfd", UNSET_OP_ORDER},
-  {0x9E, "sahf", UNSET_OP_ORDER},
-  {0x99, "cdq", UNSET_OP_ORDER},
-  {0x9B, "fwait", UNSET_OP_ORDER},
-  {0xFC, "cld", UNSET_OP_ORDER},
-  {0xAB, "stos", UNSET_OP_ORDER},
-  {-1, "", UNSET_OP_ORDER}
-};
-
-
-static const ByteMnemonic call_jump_instr[] = {
-  {0xE8, "call", UNSET_OP_ORDER},
-  {0xE9, "jmp", UNSET_OP_ORDER},
-  {-1, "", UNSET_OP_ORDER}
-};
-
-
-static const ByteMnemonic short_immediate_instr[] = {
-  {0x05, "add", UNSET_OP_ORDER},
-  {0x0D, "or", UNSET_OP_ORDER},
-  {0x15, "adc", UNSET_OP_ORDER},
-  {0x25, "and", UNSET_OP_ORDER},
-  {0x2D, "sub", UNSET_OP_ORDER},
-  {0x35, "xor", UNSET_OP_ORDER},
-  {0x3D, "cmp", UNSET_OP_ORDER},
-  {-1, "", UNSET_OP_ORDER}
-};
-
-
-// Generally we don't want to generate these because they are subject to partial
-// register stalls.  They are included for completeness and because the cmp
-// variant is used by the RecordWrite stub.  Because it does not update the
-// register it is not subject to partial register stalls.
-static ByteMnemonic byte_immediate_instr[] = {{0x0C, "or", UNSET_OP_ORDER},
-                                              {0x24, "and", UNSET_OP_ORDER},
-                                              {0x34, "xor", UNSET_OP_ORDER},
-                                              {0x3C, "cmp", UNSET_OP_ORDER},
-                                              {-1, "", UNSET_OP_ORDER}};
-
-static const char* const jump_conditional_mnem[] = {
-  /*0*/ "jo", "jno", "jc", "jnc",
-  /*4*/ "jz", "jnz", "jna", "ja",
-  /*8*/ "js", "jns", "jpe", "jpo",
-  /*12*/ "jl", "jnl", "jng", "jg"
-};
-
-
-static const char* const set_conditional_mnem[] = {
-  /*0*/ "seto", "setno", "setc", "setnc",
-  /*4*/ "setz", "setnz", "setna", "seta",
-  /*8*/ "sets", "setns", "setpe", "setpo",
-  /*12*/ "setl", "setnl", "setng", "setg"
-};
-
-
-static const char* const conditional_move_mnem[] = {
-  /*0*/ "cmovo", "cmovno", "cmovc", "cmovnc",
-  /*4*/ "cmovz", "cmovnz", "cmovna", "cmova",
-  /*8*/ "cmovs", "cmovns", "cmovpe", "cmovpo",
-  /*12*/ "cmovl", "cmovnl", "cmovng", "cmovg"
-};
-
-
-enum InstructionType {
-  NO_INSTR,
-  ZERO_OPERANDS_INSTR,
-  TWO_OPERANDS_INSTR,
-  JUMP_CONDITIONAL_SHORT_INSTR,
-  REGISTER_INSTR,
-  MOVE_REG_INSTR,
-  CALL_JUMP_INSTR,
-  SHORT_IMMEDIATE_INSTR,
-  BYTE_IMMEDIATE_INSTR
-};
-
-
-struct InstructionDesc {
-  const char* mnem;
-  InstructionType type;
-  OperandOrder op_order_;
-};
-
-
-class InstructionTable {
- public:
-  InstructionTable();
-  const InstructionDesc& Get(byte x) const { return instructions_[x]; }
-  static InstructionTable* get_instance() {
-    static InstructionTable table;
-    return &table;
-  }
-
- private:
-  InstructionDesc instructions_[256];
-  void Clear();
-  void Init();
-  void CopyTable(const ByteMnemonic bm[], InstructionType type);
-  void SetTableRange(InstructionType type,
-                     byte start,
-                     byte end,
-                     const char* mnem);
-  void AddJumpConditionalShort();
-};
-
-
-InstructionTable::InstructionTable() {
-  Clear();
-  Init();
-}
-
-
-void InstructionTable::Clear() {
-  for (int i = 0; i < 256; i++) {
-    instructions_[i].mnem = "";
-    instructions_[i].type = NO_INSTR;
-    instructions_[i].op_order_ = UNSET_OP_ORDER;
-  }
-}
-
-
-void InstructionTable::Init() {
-  CopyTable(two_operands_instr, TWO_OPERANDS_INSTR);
-  CopyTable(zero_operands_instr, ZERO_OPERANDS_INSTR);
-  CopyTable(call_jump_instr, CALL_JUMP_INSTR);
-  CopyTable(short_immediate_instr, SHORT_IMMEDIATE_INSTR);
-  CopyTable(byte_immediate_instr, BYTE_IMMEDIATE_INSTR);
-  AddJumpConditionalShort();
-  SetTableRange(REGISTER_INSTR, 0x40, 0x47, "inc");
-  SetTableRange(REGISTER_INSTR, 0x48, 0x4F, "dec");
-  SetTableRange(REGISTER_INSTR, 0x50, 0x57, "push");
-  SetTableRange(REGISTER_INSTR, 0x58, 0x5F, "pop");
-  SetTableRange(REGISTER_INSTR, 0x91, 0x97, "xchg eax,");  // 0x90 is nop.
-  SetTableRange(MOVE_REG_INSTR, 0xB8, 0xBF, "mov");
-}
-
-
-void InstructionTable::CopyTable(const ByteMnemonic bm[],
-                                 InstructionType type) {
-  for (int i = 0; bm[i].b >= 0; i++) {
-    InstructionDesc* id = &instructions_[bm[i].b];
-    id->mnem = bm[i].mnem;
-    id->op_order_ = bm[i].op_order_;
-    DCHECK_EQ(NO_INSTR, id->type);  // Information not already entered.
-    id->type = type;
-  }
-}
-
-
-void InstructionTable::SetTableRange(InstructionType type,
-                                     byte start,
-                                     byte end,
-                                     const char* mnem) {
-  for (byte b = start; b <= end; b++) {
-    InstructionDesc* id = &instructions_[b];
-    DCHECK_EQ(NO_INSTR, id->type);  // Information not already entered.
-    id->mnem = mnem;
-    id->type = type;
-  }
-}
-
-
-void InstructionTable::AddJumpConditionalShort() {
-  for (byte b = 0x70; b <= 0x7F; b++) {
-    InstructionDesc* id = &instructions_[b];
-    DCHECK_EQ(NO_INSTR, id->type);  // Information not already entered.
-    id->mnem = jump_conditional_mnem[b & 0x0F];
-    id->type = JUMP_CONDITIONAL_SHORT_INSTR;
-  }
-}
-
-
-// The IA32 disassembler implementation.
-class DisassemblerIA32 {
- public:
-  DisassemblerIA32(const NameConverter& converter,
-                   bool abort_on_unimplemented = true)
-      : converter_(converter),
-        vex_byte0_(0),
-        vex_byte1_(0),
-        vex_byte2_(0),
-        instruction_table_(InstructionTable::get_instance()),
-        tmp_buffer_pos_(0),
-        abort_on_unimplemented_(abort_on_unimplemented) {
-    tmp_buffer_[0] = '\0';
-  }
-
-  virtual ~DisassemblerIA32() {}
-
-  // Writes one disassembled instruction into 'buffer' (0-terminated).
-  // Returns the length of the disassembled machine instruction in bytes.
-  int InstructionDecode(v8::internal::Vector<char> buffer, byte* instruction);
-
- private:
-  const NameConverter& converter_;
-  byte vex_byte0_;  // 0xC4 or 0xC5
-  byte vex_byte1_;
-  byte vex_byte2_;  // only for 3 bytes vex prefix
-  InstructionTable* instruction_table_;
-  v8::internal::EmbeddedVector<char, 128> tmp_buffer_;
-  unsigned int tmp_buffer_pos_;
-  bool abort_on_unimplemented_;
-
-  enum {
-    eax = 0,
-    ecx = 1,
-    edx = 2,
-    ebx = 3,
-    esp = 4,
-    ebp = 5,
-    esi = 6,
-    edi = 7
-  };
-
-
-  enum ShiftOpcodeExtension {
-    kROL = 0,
-    kROR = 1,
-    kRCL = 2,
-    kRCR = 3,
-    kSHL = 4,
-    KSHR = 5,
-    kSAR = 7
-  };
-
-  bool vex_128() {
-    DCHECK(vex_byte0_ == 0xC4 || vex_byte0_ == 0xC5);
-    byte checked = vex_byte0_ == 0xC4 ? vex_byte2_ : vex_byte1_;
-    return (checked & 4) == 0;
-  }
-
-  bool vex_none() {
-    DCHECK(vex_byte0_ == 0xC4 || vex_byte0_ == 0xC5);
-    byte checked = vex_byte0_ == 0xC4 ? vex_byte2_ : vex_byte1_;
-    return (checked & 3) == 0;
-  }
-
-  bool vex_66() {
-    DCHECK(vex_byte0_ == 0xC4 || vex_byte0_ == 0xC5);
-    byte checked = vex_byte0_ == 0xC4 ? vex_byte2_ : vex_byte1_;
-    return (checked & 3) == 1;
-  }
-
-  bool vex_f3() {
-    DCHECK(vex_byte0_ == 0xC4 || vex_byte0_ == 0xC5);
-    byte checked = vex_byte0_ == 0xC4 ? vex_byte2_ : vex_byte1_;
-    return (checked & 3) == 2;
-  }
-
-  bool vex_f2() {
-    DCHECK(vex_byte0_ == 0xC4 || vex_byte0_ == 0xC5);
-    byte checked = vex_byte0_ == 0xC4 ? vex_byte2_ : vex_byte1_;
-    return (checked & 3) == 3;
-  }
-
-  bool vex_w() {
-    if (vex_byte0_ == 0xC5) return false;
-    return (vex_byte2_ & 0x80) != 0;
-  }
-
-  bool vex_0f() {
-    if (vex_byte0_ == 0xC5) return true;
-    return (vex_byte1_ & 3) == 1;
-  }
-
-  bool vex_0f38() {
-    if (vex_byte0_ == 0xC5) return false;
-    return (vex_byte1_ & 3) == 2;
-  }
-
-  bool vex_0f3a() {
-    if (vex_byte0_ == 0xC5) return false;
-    return (vex_byte1_ & 3) == 3;
-  }
-
-  int vex_vreg() {
-    DCHECK(vex_byte0_ == 0xC4 || vex_byte0_ == 0xC5);
-    byte checked = vex_byte0_ == 0xC4 ? vex_byte2_ : vex_byte1_;
-    return ~(checked >> 3) & 0xF;
-  }
-
-  char float_size_code() { return "sd"[vex_w()]; }
-
-  const char* NameOfCPURegister(int reg) const {
-    return converter_.NameOfCPURegister(reg);
-  }
-
-
-  const char* NameOfByteCPURegister(int reg) const {
-    return converter_.NameOfByteCPURegister(reg);
-  }
-
-
-  const char* NameOfXMMRegister(int reg) const {
-    return converter_.NameOfXMMRegister(reg);
-  }
-
-
-  const char* NameOfAddress(byte* addr) const {
-    return converter_.NameOfAddress(addr);
-  }
-
-
-  // Disassembler helper functions.
-  static void get_modrm(byte data, int* mod, int* regop, int* rm) {
-    *mod = (data >> 6) & 3;
-    *regop = (data & 0x38) >> 3;
-    *rm = data & 7;
-  }
-
-
-  static void get_sib(byte data, int* scale, int* index, int* base) {
-    *scale = (data >> 6) & 3;
-    *index = (data >> 3) & 7;
-    *base = data & 7;
-  }
-
-  typedef const char* (DisassemblerIA32::*RegisterNameMapping)(int reg) const;
-
-  int PrintRightOperandHelper(byte* modrmp, RegisterNameMapping register_name);
-  int PrintRightOperand(byte* modrmp);
-  int PrintRightByteOperand(byte* modrmp);
-  int PrintRightXMMOperand(byte* modrmp);
-  int PrintOperands(const char* mnem, OperandOrder op_order, byte* data);
-  int PrintImmediateOp(byte* data);
-  int F7Instruction(byte* data);
-  int D1D3C1Instruction(byte* data);
-  int JumpShort(byte* data);
-  int JumpConditional(byte* data, const char* comment);
-  int JumpConditionalShort(byte* data, const char* comment);
-  int SetCC(byte* data);
-  int CMov(byte* data);
-  int FPUInstruction(byte* data);
-  int MemoryFPUInstruction(int escape_opcode, int regop, byte* modrm_start);
-  int RegisterFPUInstruction(int escape_opcode, byte modrm_byte);
-  int AVXInstruction(byte* data);
-  PRINTF_FORMAT(2, 3) void AppendToBuffer(const char* format, ...);
-
-  void UnimplementedInstruction() {
-    if (abort_on_unimplemented_) {
-      UNIMPLEMENTED();
-    } else {
-      AppendToBuffer("'Unimplemented Instruction'");
-    }
-  }
-};
-
-
-void DisassemblerIA32::AppendToBuffer(const char* format, ...) {
-  v8::internal::Vector<char> buf = tmp_buffer_ + tmp_buffer_pos_;
-  va_list args;
-  va_start(args, format);
-  int result = v8::internal::VSNPrintF(buf, format, args);
-  va_end(args);
-  tmp_buffer_pos_ += result;
-}
-
-int DisassemblerIA32::PrintRightOperandHelper(
-    byte* modrmp,
-    RegisterNameMapping direct_register_name) {
-  int mod, regop, rm;
-  get_modrm(*modrmp, &mod, &regop, &rm);
-  RegisterNameMapping register_name = (mod == 3) ? direct_register_name :
-      &DisassemblerIA32::NameOfCPURegister;
-  switch (mod) {
-    case 0:
-      if (rm == ebp) {
-        int32_t disp = *reinterpret_cast<int32_t*>(modrmp+1);
-        AppendToBuffer("[0x%x]", disp);
-        return 5;
-      } else if (rm == esp) {
-        byte sib = *(modrmp + 1);
-        int scale, index, base;
-        get_sib(sib, &scale, &index, &base);
-        if (index == esp && base == esp && scale == 0 /*times_1*/) {
-          AppendToBuffer("[%s]", (this->*register_name)(rm));
-          return 2;
-        } else if (base == ebp) {
-          int32_t disp = *reinterpret_cast<int32_t*>(modrmp + 2);
-          AppendToBuffer("[%s*%d%s0x%x]",
-                         (this->*register_name)(index),
-                         1 << scale,
-                         disp < 0 ? "-" : "+",
-                         disp < 0 ? -disp : disp);
-          return 6;
-        } else if (index != esp && base != ebp) {
-          // [base+index*scale]
-          AppendToBuffer("[%s+%s*%d]",
-                         (this->*register_name)(base),
-                         (this->*register_name)(index),
-                         1 << scale);
-          return 2;
-        } else {
-          UnimplementedInstruction();
-          return 1;
-        }
-      } else {
-        AppendToBuffer("[%s]", (this->*register_name)(rm));
-        return 1;
-      }
-      break;
-    case 1:  // fall through
-    case 2:
-      if (rm == esp) {
-        byte sib = *(modrmp + 1);
-        int scale, index, base;
-        get_sib(sib, &scale, &index, &base);
-        int disp = mod == 2 ? *reinterpret_cast<int32_t*>(modrmp + 2)
-                            : *reinterpret_cast<int8_t*>(modrmp + 2);
-        if (index == base && index == rm /*esp*/ && scale == 0 /*times_1*/) {
-          AppendToBuffer("[%s%s0x%x]",
-                         (this->*register_name)(rm),
-                         disp < 0 ? "-" : "+",
-                         disp < 0 ? -disp : disp);
-        } else {
-          AppendToBuffer("[%s+%s*%d%s0x%x]",
-                         (this->*register_name)(base),
-                         (this->*register_name)(index),
-                         1 << scale,
-                         disp < 0 ? "-" : "+",
-                         disp < 0 ? -disp : disp);
-        }
-        return mod == 2 ? 6 : 3;
-      } else {
-        // No sib.
-        int disp = mod == 2 ? *reinterpret_cast<int32_t*>(modrmp + 1)
-                            : *reinterpret_cast<int8_t*>(modrmp + 1);
-        AppendToBuffer("[%s%s0x%x]",
-                       (this->*register_name)(rm),
-                       disp < 0 ? "-" : "+",
-                       disp < 0 ? -disp : disp);
-        return mod == 2 ? 5 : 2;
-      }
-      break;
-    case 3:
-      AppendToBuffer("%s", (this->*register_name)(rm));
-      return 1;
-    default:
-      UnimplementedInstruction();
-      return 1;
-  }
-  UNREACHABLE();
-}
-
-
-int DisassemblerIA32::PrintRightOperand(byte* modrmp) {
-  return PrintRightOperandHelper(modrmp, &DisassemblerIA32::NameOfCPURegister);
-}
-
-
-int DisassemblerIA32::PrintRightByteOperand(byte* modrmp) {
-  return PrintRightOperandHelper(modrmp,
-                                 &DisassemblerIA32::NameOfByteCPURegister);
-}
-
-
-int DisassemblerIA32::PrintRightXMMOperand(byte* modrmp) {
-  return PrintRightOperandHelper(modrmp,
-                                 &DisassemblerIA32::NameOfXMMRegister);
-}
-
-
-// Returns number of bytes used including the current *data.
-// Writes instruction's mnemonic, left and right operands to 'tmp_buffer_'.
-int DisassemblerIA32::PrintOperands(const char* mnem,
-                                    OperandOrder op_order,
-                                    byte* data) {
-  byte modrm = *data;
-  int mod, regop, rm;
-  get_modrm(modrm, &mod, &regop, &rm);
-  int advance = 0;
-  switch (op_order) {
-    case REG_OPER_OP_ORDER: {
-      AppendToBuffer("%s %s,", mnem, NameOfCPURegister(regop));
-      advance = PrintRightOperand(data);
-      break;
-    }
-    case OPER_REG_OP_ORDER: {
-      AppendToBuffer("%s ", mnem);
-      advance = PrintRightOperand(data);
-      AppendToBuffer(",%s", NameOfCPURegister(regop));
-      break;
-    }
-    default:
-      UNREACHABLE();
-      break;
-  }
-  return advance;
-}
-
-
-// Returns number of bytes used by machine instruction, including *data byte.
-// Writes immediate instructions to 'tmp_buffer_'.
-int DisassemblerIA32::PrintImmediateOp(byte* data) {
-  bool sign_extension_bit = (*data & 0x02) != 0;
-  byte modrm = *(data+1);
-  int mod, regop, rm;
-  get_modrm(modrm, &mod, &regop, &rm);
-  const char* mnem = "Imm???";
-  switch (regop) {
-    case 0: mnem = "add"; break;
-    case 1: mnem = "or"; break;
-    case 2: mnem = "adc"; break;
-    case 4: mnem = "and"; break;
-    case 5: mnem = "sub"; break;
-    case 6: mnem = "xor"; break;
-    case 7: mnem = "cmp"; break;
-    default: UnimplementedInstruction();
-  }
-  AppendToBuffer("%s ", mnem);
-  int count = PrintRightOperand(data+1);
-  if (sign_extension_bit) {
-    AppendToBuffer(",0x%x", *(data + 1 + count));
-    return 1 + count + 1 /*int8*/;
-  } else {
-    AppendToBuffer(",0x%x", *reinterpret_cast<int32_t*>(data + 1 + count));
-    return 1 + count + 4 /*int32_t*/;
-  }
-}
-
-
-// Returns number of bytes used, including *data.
-int DisassemblerIA32::F7Instruction(byte* data) {
-  DCHECK_EQ(0xF7, *data);
-  byte modrm = *++data;
-  int mod, regop, rm;
-  get_modrm(modrm, &mod, &regop, &rm);
-  const char* mnem = nullptr;
-  switch (regop) {
-    case 0:
-      mnem = "test";
-      break;
-    case 2:
-      mnem = "not";
-      break;
-    case 3:
-      mnem = "neg";
-      break;
-    case 4:
-      mnem = "mul";
-      break;
-    case 5:
-      mnem = "imul";
-      break;
-    case 6:
-      mnem = "div";
-      break;
-    case 7:
-      mnem = "idiv";
-      break;
-    default:
-      UnimplementedInstruction();
-  }
-  AppendToBuffer("%s ", mnem);
-  int count = PrintRightOperand(data);
-  if (regop == 0) {
-    AppendToBuffer(",0x%x", *reinterpret_cast<int32_t*>(data + count));
-    count += 4;
-  }
-  return 1 + count;
-}
-
-
-int DisassemblerIA32::D1D3C1Instruction(byte* data) {
-  byte op = *data;
-  DCHECK(op == 0xD1 || op == 0xD3 || op == 0xC1);
-  byte modrm = *++data;
-  int mod, regop, rm;
-  get_modrm(modrm, &mod, &regop, &rm);
-  int imm8 = -1;
-  const char* mnem = nullptr;
-  switch (regop) {
-    case kROL:
-      mnem = "rol";
-      break;
-    case kROR:
-      mnem = "ror";
-      break;
-    case kRCL:
-      mnem = "rcl";
-      break;
-    case kRCR:
-      mnem = "rcr";
-      break;
-    case kSHL:
-      mnem = "shl";
-      break;
-    case KSHR:
-      mnem = "shr";
-      break;
-    case kSAR:
-      mnem = "sar";
-      break;
-    default:
-      UnimplementedInstruction();
-  }
-  AppendToBuffer("%s ", mnem);
-  int count = PrintRightOperand(data);
-  if (op == 0xD1) {
-    imm8 = 1;
-  } else if (op == 0xC1) {
-    imm8 = *(data + 1);
-    count++;
-  } else if (op == 0xD3) {
-    // Shift/rotate by cl.
-  }
-  if (imm8 >= 0) {
-    AppendToBuffer(",%d", imm8);
-  } else {
-    AppendToBuffer(",cl");
-  }
-  return 1 + count;
-}
-
-
-// Returns number of bytes used, including *data.
-int DisassemblerIA32::JumpShort(byte* data) {
-  DCHECK_EQ(0xEB, *data);
-  byte b = *(data+1);
-  byte* dest = data + static_cast<int8_t>(b) + 2;
-  AppendToBuffer("jmp %s", NameOfAddress(dest));
-  return 2;
-}
-
-
-// Returns number of bytes used, including *data.
-int DisassemblerIA32::JumpConditional(byte* data, const char* comment) {
-  DCHECK_EQ(0x0F, *data);
-  byte cond = *(data+1) & 0x0F;
-  byte* dest = data + *reinterpret_cast<int32_t*>(data+2) + 6;
-  const char* mnem = jump_conditional_mnem[cond];
-  AppendToBuffer("%s %s", mnem, NameOfAddress(dest));
-  if (comment != nullptr) {
-    AppendToBuffer(", %s", comment);
-  }
-  return 6;  // includes 0x0F
-}
-
-
-// Returns number of bytes used, including *data.
-int DisassemblerIA32::JumpConditionalShort(byte* data, const char* comment) {
-  byte cond = *data & 0x0F;
-  byte b = *(data+1);
-  byte* dest = data + static_cast<int8_t>(b) + 2;
-  const char* mnem = jump_conditional_mnem[cond];
-  AppendToBuffer("%s %s", mnem, NameOfAddress(dest));
-  if (comment != nullptr) {
-    AppendToBuffer(", %s", comment);
-  }
-  return 2;
-}
-
-
-// Returns number of bytes used, including *data.
-int DisassemblerIA32::SetCC(byte* data) {
-  DCHECK_EQ(0x0F, *data);
-  byte cond = *(data+1) & 0x0F;
-  const char* mnem = set_conditional_mnem[cond];
-  AppendToBuffer("%s ", mnem);
-  PrintRightByteOperand(data+2);
-  return 3;  // Includes 0x0F.
-}
-
-
-// Returns number of bytes used, including *data.
-int DisassemblerIA32::CMov(byte* data) {
-  DCHECK_EQ(0x0F, *data);
-  byte cond = *(data + 1) & 0x0F;
-  const char* mnem = conditional_move_mnem[cond];
-  int op_size = PrintOperands(mnem, REG_OPER_OP_ORDER, data + 2);
-  return 2 + op_size;  // includes 0x0F
-}
-
-const char* sf_str[4] = {"", "rl", "ra", "ll"};
-
-int DisassemblerIA32::AVXInstruction(byte* data) {
-  byte opcode = *data;
-  byte* current = data + 1;
-  if (vex_66() && vex_0f38()) {
-    int mod, regop, rm, vvvv = vex_vreg();
-    get_modrm(*current, &mod, &regop, &rm);
-    switch (opcode) {
-      case 0x99:
-        AppendToBuffer("vfmadd132s%c %s,%s,", float_size_code(),
-                       NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0xA9:
-        AppendToBuffer("vfmadd213s%c %s,%s,", float_size_code(),
-                       NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0xB9:
-        AppendToBuffer("vfmadd231s%c %s,%s,", float_size_code(),
-                       NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x9B:
-        AppendToBuffer("vfmsub132s%c %s,%s,", float_size_code(),
-                       NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0xAB:
-        AppendToBuffer("vfmsub213s%c %s,%s,", float_size_code(),
-                       NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0xBB:
-        AppendToBuffer("vfmsub231s%c %s,%s,", float_size_code(),
-                       NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x9D:
-        AppendToBuffer("vfnmadd132s%c %s,%s,", float_size_code(),
-                       NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0xAD:
-        AppendToBuffer("vfnmadd213s%c %s,%s,", float_size_code(),
-                       NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0xBD:
-        AppendToBuffer("vfnmadd231s%c %s,%s,", float_size_code(),
-                       NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x9F:
-        AppendToBuffer("vfnmsub132s%c %s,%s,", float_size_code(),
-                       NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0xAF:
-        AppendToBuffer("vfnmsub213s%c %s,%s,", float_size_code(),
-                       NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0xBF:
-        AppendToBuffer("vfnmsub231s%c %s,%s,", float_size_code(),
-                       NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0xF7:
-        AppendToBuffer("shlx %s,", NameOfCPURegister(regop));
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%s", NameOfCPURegister(vvvv));
-        break;
-#define DECLARE_SSE_AVX_DIS_CASE(instruction, notUsed1, notUsed2, notUsed3, \
-                                 opcode)                                    \
-  case 0x##opcode: {                                                        \
-    AppendToBuffer("v" #instruction " %s,%s,", NameOfXMMRegister(regop),    \
-                   NameOfXMMRegister(vvvv));                                \
-    current += PrintRightXMMOperand(current);                               \
-    break;                                                                  \
-  }
-
-        SSSE3_INSTRUCTION_LIST(DECLARE_SSE_AVX_DIS_CASE)
-        SSE4_INSTRUCTION_LIST(DECLARE_SSE_AVX_DIS_CASE)
-#undef DECLARE_SSE_AVX_DIS_CASE
-      default:
-        UnimplementedInstruction();
-    }
-  } else if (vex_66() && vex_0f3a()) {
-    int mod, regop, rm, vvvv = vex_vreg();
-    get_modrm(*current, &mod, &regop, &rm);
-    switch (opcode) {
-      case 0x14:
-        AppendToBuffer("vpextrb ");
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%s,%d", NameOfXMMRegister(regop),
-                       *reinterpret_cast<int8_t*>(current));
-        current++;
-        break;
-      case 0x15:
-        AppendToBuffer("vpextrw ");
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%s,%d", NameOfXMMRegister(regop),
-                       *reinterpret_cast<int8_t*>(current));
-        current++;
-        break;
-      case 0x16:
-        AppendToBuffer("vpextrd ");
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%s,%d", NameOfXMMRegister(regop),
-                       *reinterpret_cast<int8_t*>(current));
-        current++;
-        break;
-      case 0x20:
-        AppendToBuffer("vpinsrb %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%d", *reinterpret_cast<int8_t*>(current));
-        current++;
-        break;
-      case 0x21:
-        AppendToBuffer("vinsertps %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        AppendToBuffer(",%d", *reinterpret_cast<int8_t*>(current));
-        current++;
-        break;
-      case 0x22:
-        AppendToBuffer("vpinsrd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%d", *reinterpret_cast<int8_t*>(current));
-        current++;
-        break;
-      default:
-        UnimplementedInstruction();
-    }
-  } else if (vex_f2() && vex_0f()) {
-    int mod, regop, rm, vvvv = vex_vreg();
-    get_modrm(*current, &mod, &regop, &rm);
-    switch (opcode) {
-      case 0x58:
-        AppendToBuffer("vaddsd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x59:
-        AppendToBuffer("vmulsd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5C:
-        AppendToBuffer("vsubsd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5D:
-        AppendToBuffer("vminsd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5E:
-        AppendToBuffer("vdivsd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5F:
-        AppendToBuffer("vmaxsd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x70:
-        AppendToBuffer("vpshuflw %s,", NameOfXMMRegister(regop));
-        current += PrintRightXMMOperand(current);
-        AppendToBuffer(",%d", *reinterpret_cast<int8_t*>(current));
-        current++;
-        break;
-      default:
-        UnimplementedInstruction();
-    }
-  } else if (vex_f3() && vex_0f()) {
-    int mod, regop, rm, vvvv = vex_vreg();
-    get_modrm(*current, &mod, &regop, &rm);
-    switch (opcode) {
-      case 0x58:
-        AppendToBuffer("vaddss %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x59:
-        AppendToBuffer("vmulss %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5B:
-        AppendToBuffer("vcvttps2dq %s,", NameOfXMMRegister(regop));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5C:
-        AppendToBuffer("vsubss %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5D:
-        AppendToBuffer("vminss %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5E:
-        AppendToBuffer("vdivss %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5F:
-        AppendToBuffer("vmaxss %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x6f:
-        AppendToBuffer("vmovdqu %s,", NameOfXMMRegister(regop));
-        current += PrintRightOperand(current);
-        break;
-      case 0x7f:
-        AppendToBuffer("vmovdqu ");
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%s", NameOfXMMRegister(regop));
-        break;
-      default:
-        UnimplementedInstruction();
-    }
-  } else if (vex_none() && vex_0f38()) {
-    int mod, regop, rm, vvvv = vex_vreg();
-    get_modrm(*current, &mod, &regop, &rm);
-    const char* mnem = "?";
-    switch (opcode) {
-      case 0xF2:
-        AppendToBuffer("andn %s,%s,", NameOfCPURegister(regop),
-                       NameOfCPURegister(vvvv));
-        current += PrintRightOperand(current);
-        break;
-      case 0xF5:
-        AppendToBuffer("bzhi %s,", NameOfCPURegister(regop));
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%s", NameOfCPURegister(vvvv));
-        break;
-      case 0xF7:
-        AppendToBuffer("bextr %s,", NameOfCPURegister(regop));
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%s", NameOfCPURegister(vvvv));
-        break;
-      case 0xF3:
-        switch (regop) {
-          case 1:
-            mnem = "blsr";
-            break;
-          case 2:
-            mnem = "blsmsk";
-            break;
-          case 3:
-            mnem = "blsi";
-            break;
-          default:
-            UnimplementedInstruction();
-        }
-        AppendToBuffer("%s %s,", mnem, NameOfCPURegister(vvvv));
-        current += PrintRightOperand(current);
-        mnem = "?";
-        break;
-      default:
-        UnimplementedInstruction();
-    }
-  } else if (vex_f2() && vex_0f38()) {
-    int mod, regop, rm, vvvv = vex_vreg();
-    get_modrm(*current, &mod, &regop, &rm);
-    switch (opcode) {
-      case 0xF5:
-        AppendToBuffer("pdep %s,%s,", NameOfCPURegister(regop),
-                       NameOfCPURegister(vvvv));
-        current += PrintRightOperand(current);
-        break;
-      case 0xF6:
-        AppendToBuffer("mulx %s,%s,", NameOfCPURegister(regop),
-                       NameOfCPURegister(vvvv));
-        current += PrintRightOperand(current);
-        break;
-      case 0xF7:
-        AppendToBuffer("shrx %s,", NameOfCPURegister(regop));
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%s", NameOfCPURegister(vvvv));
-        break;
-      default:
-        UnimplementedInstruction();
-    }
-  } else if (vex_f3() && vex_0f38()) {
-    int mod, regop, rm, vvvv = vex_vreg();
-    get_modrm(*current, &mod, &regop, &rm);
-    switch (opcode) {
-      case 0xF5:
-        AppendToBuffer("pext %s,%s,", NameOfCPURegister(regop),
-                       NameOfCPURegister(vvvv));
-        current += PrintRightOperand(current);
-        break;
-      case 0xF7:
-        AppendToBuffer("sarx %s,", NameOfCPURegister(regop));
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%s", NameOfCPURegister(vvvv));
-        break;
-      default:
-        UnimplementedInstruction();
-    }
-  } else if (vex_f2() && vex_0f3a()) {
-    int mod, regop, rm;
-    get_modrm(*current, &mod, &regop, &rm);
-    switch (opcode) {
-      case 0xF0:
-        AppendToBuffer("rorx %s,", NameOfCPURegister(regop));
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%d", *current & 0x1F);
-        current += 1;
-        break;
-      default:
-        UnimplementedInstruction();
-    }
-  } else if (vex_none() && vex_0f()) {
-    int mod, regop, rm, vvvv = vex_vreg();
-    get_modrm(*current, &mod, &regop, &rm);
-    switch (opcode) {
-      case 0x28:
-        AppendToBuffer("vmovaps %s,", NameOfXMMRegister(regop));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x52:
-        AppendToBuffer("vrsqrtps %s,", NameOfXMMRegister(regop));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x53:
-        AppendToBuffer("vrcpps %s,", NameOfXMMRegister(regop));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x54:
-        AppendToBuffer("vandps %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x57:
-        AppendToBuffer("vxorps %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x58:
-        AppendToBuffer("vaddps %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x59:
-        AppendToBuffer("vmulps %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5B:
-        AppendToBuffer("vcvtdq2ps %s,", NameOfXMMRegister(regop));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5C:
-        AppendToBuffer("vsubps %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5D:
-        AppendToBuffer("vminps %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5E:
-        AppendToBuffer("vdivps %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5F:
-        AppendToBuffer("vmaxps %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0xC2: {
-        const char* const pseudo_op[] = {"eq",  "lt",  "le",  "unord",
-                                         "neq", "nlt", "nle", "ord"};
-        AppendToBuffer("vcmpps %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        AppendToBuffer(", (%s)", pseudo_op[*current]);
-        current++;
-        break;
-      }
-      case 0xC6:
-        AppendToBuffer("vshufps %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        AppendToBuffer(", %d", (*current) & 3);
-        current += 1;
-        break;
-      default:
-        UnimplementedInstruction();
-    }
-  } else if (vex_66() && vex_0f()) {
-    int mod, regop, rm, vvvv = vex_vreg();
-    get_modrm(*current, &mod, &regop, &rm);
-    switch (opcode) {
-      case 0x54:
-        AppendToBuffer("vandpd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x57:
-        AppendToBuffer("vxorpd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x58:
-        AppendToBuffer("vaddpd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x59:
-        AppendToBuffer("vmulpd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5C:
-        AppendToBuffer("vsubpd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5D:
-        AppendToBuffer("vminpd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5E:
-        AppendToBuffer("vdivpd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5F:
-        AppendToBuffer("vmaxpd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x6E:
-        AppendToBuffer("vmovd %s,", NameOfXMMRegister(regop));
-        current += PrintRightOperand(current);
-        break;
-      case 0x70:
-        AppendToBuffer("vpshufd %s,", NameOfXMMRegister(regop));
-        current += PrintRightXMMOperand(current);
-        AppendToBuffer(",%d", *reinterpret_cast<int8_t*>(current));
-        current++;
-        break;
-      case 0x71:
-        AppendToBuffer("vps%sw %s,%s", sf_str[regop / 2],
-                       NameOfXMMRegister(vvvv), NameOfXMMRegister(rm));
-        current++;
-        AppendToBuffer(",%u", *current++);
-        break;
-      case 0x72:
-        AppendToBuffer("vps%sd %s,%s", sf_str[regop / 2],
-                       NameOfXMMRegister(vvvv), NameOfXMMRegister(rm));
-        current++;
-        AppendToBuffer(",%u", *current++);
-        break;
-      case 0x7E:
-        AppendToBuffer("vmovd ");
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%s", NameOfXMMRegister(regop));
-        break;
-      case 0xC4:
-        AppendToBuffer("vpinsrw %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%d", *reinterpret_cast<int8_t*>(current));
-        current++;
-        break;
-#define DECLARE_SSE_AVX_DIS_CASE(instruction, notUsed1, notUsed2, opcode) \
-  case 0x##opcode: {                                                      \
-    AppendToBuffer("v" #instruction " %s,%s,", NameOfXMMRegister(regop),  \
-                   NameOfXMMRegister(vvvv));                              \
-    current += PrintRightXMMOperand(current);                             \
-    break;                                                                \
-  }
-
-        SSE2_INSTRUCTION_LIST(DECLARE_SSE_AVX_DIS_CASE)
-#undef DECLARE_SSE_AVX_DIS_CASE
-      default:
-        UnimplementedInstruction();
-    }
-  } else {
-    UnimplementedInstruction();
-  }
-
-  return static_cast<int>(current - data);
-}
-
-
-// Returns number of bytes used, including *data.
-int DisassemblerIA32::FPUInstruction(byte* data) {
-  byte escape_opcode = *data;
-  DCHECK_EQ(0xD8, escape_opcode & 0xF8);
-  byte modrm_byte = *(data+1);
-
-  if (modrm_byte >= 0xC0) {
-    return RegisterFPUInstruction(escape_opcode, modrm_byte);
-  } else {
-    return MemoryFPUInstruction(escape_opcode, modrm_byte, data+1);
-  }
-}
-
-int DisassemblerIA32::MemoryFPUInstruction(int escape_opcode,
-                                           int modrm_byte,
-                                           byte* modrm_start) {
-  const char* mnem = "?";
-  int regop = (modrm_byte >> 3) & 0x7;  // reg/op field of modrm byte.
-  switch (escape_opcode) {
-    case 0xD9: switch (regop) {
-        case 0: mnem = "fld_s"; break;
-        case 2: mnem = "fst_s"; break;
-        case 3: mnem = "fstp_s"; break;
-        case 7: mnem = "fstcw"; break;
-        default: UnimplementedInstruction();
-      }
-      break;
-
-    case 0xDB: switch (regop) {
-        case 0: mnem = "fild_s"; break;
-        case 1: mnem = "fisttp_s"; break;
-        case 2: mnem = "fist_s"; break;
-        case 3: mnem = "fistp_s"; break;
-        default: UnimplementedInstruction();
-      }
-      break;
-
-    case 0xDD: switch (regop) {
-        case 0: mnem = "fld_d"; break;
-        case 1: mnem = "fisttp_d"; break;
-        case 2: mnem = "fst_d"; break;
-        case 3: mnem = "fstp_d"; break;
-        default: UnimplementedInstruction();
-      }
-      break;
-
-    case 0xDF: switch (regop) {
-        case 5: mnem = "fild_d"; break;
-        case 7: mnem = "fistp_d"; break;
-        default: UnimplementedInstruction();
-      }
-      break;
-
-    default: UnimplementedInstruction();
-  }
-  AppendToBuffer("%s ", mnem);
-  int count = PrintRightOperand(modrm_start);
-  return count + 1;
-}
-
-int DisassemblerIA32::RegisterFPUInstruction(int escape_opcode,
-                                             byte modrm_byte) {
-  bool has_register = false;  // Is the FPU register encoded in modrm_byte?
-  const char* mnem = "?";
-
-  switch (escape_opcode) {
-    case 0xD8:
-      has_register = true;
-      switch (modrm_byte & 0xF8) {
-        case 0xC0: mnem = "fadd_i"; break;
-        case 0xE0: mnem = "fsub_i"; break;
-        case 0xC8: mnem = "fmul_i"; break;
-        case 0xF0: mnem = "fdiv_i"; break;
-        default: UnimplementedInstruction();
-      }
-      break;
-
-    case 0xD9:
-      switch (modrm_byte & 0xF8) {
-        case 0xC0:
-          mnem = "fld";
-          has_register = true;
-          break;
-        case 0xC8:
-          mnem = "fxch";
-          has_register = true;
-          break;
-        default:
-          switch (modrm_byte) {
-            case 0xE0: mnem = "fchs"; break;
-            case 0xE1: mnem = "fabs"; break;
-            case 0xE4: mnem = "ftst"; break;
-            case 0xE8: mnem = "fld1"; break;
-            case 0xEB: mnem = "fldpi"; break;
-            case 0xED: mnem = "fldln2"; break;
-            case 0xEE: mnem = "fldz"; break;
-            case 0xF0: mnem = "f2xm1"; break;
-            case 0xF1: mnem = "fyl2x"; break;
-            case 0xF4: mnem = "fxtract"; break;
-            case 0xF5: mnem = "fprem1"; break;
-            case 0xF7: mnem = "fincstp"; break;
-            case 0xF8: mnem = "fprem"; break;
-            case 0xFC: mnem = "frndint"; break;
-            case 0xFD: mnem = "fscale"; break;
-            case 0xFE: mnem = "fsin"; break;
-            case 0xFF: mnem = "fcos"; break;
-            default: UnimplementedInstruction();
-          }
-      }
-      break;
-
-    case 0xDA:
-      if (modrm_byte == 0xE9) {
-        mnem = "fucompp";
-      } else {
-        UnimplementedInstruction();
-      }
-      break;
-
-    case 0xDB:
-      if ((modrm_byte & 0xF8) == 0xE8) {
-        mnem = "fucomi";
-        has_register = true;
-      } else if (modrm_byte  == 0xE2) {
-        mnem = "fclex";
-      } else if (modrm_byte == 0xE3) {
-        mnem = "fninit";
-      } else {
-        UnimplementedInstruction();
-      }
-      break;
-
-    case 0xDC:
-      has_register = true;
-      switch (modrm_byte & 0xF8) {
-        case 0xC0: mnem = "fadd"; break;
-        case 0xE8: mnem = "fsub"; break;
-        case 0xC8: mnem = "fmul"; break;
-        case 0xF8: mnem = "fdiv"; break;
-        default: UnimplementedInstruction();
-      }
-      break;
-
-    case 0xDD:
-      has_register = true;
-      switch (modrm_byte & 0xF8) {
-        case 0xC0: mnem = "ffree"; break;
-        case 0xD0: mnem = "fst"; break;
-        case 0xD8: mnem = "fstp"; break;
-        default: UnimplementedInstruction();
-      }
-      break;
-
-    case 0xDE:
-      if (modrm_byte  == 0xD9) {
-        mnem = "fcompp";
-      } else {
-        has_register = true;
-        switch (modrm_byte & 0xF8) {
-          case 0xC0: mnem = "faddp"; break;
-          case 0xE8: mnem = "fsubp"; break;
-          case 0xC8: mnem = "fmulp"; break;
-          case 0xF8: mnem = "fdivp"; break;
-          default: UnimplementedInstruction();
-        }
-      }
-      break;
-
-    case 0xDF:
-      if (modrm_byte == 0xE0) {
-        mnem = "fnstsw_ax";
-      } else if ((modrm_byte & 0xF8) == 0xE8) {
-        mnem = "fucomip";
-        has_register = true;
-      }
-      break;
-
-    default: UnimplementedInstruction();
-  }
-
-  if (has_register) {
-    AppendToBuffer("%s st%d", mnem, modrm_byte & 0x7);
-  } else {
-    AppendToBuffer("%s", mnem);
-  }
-  return 2;
-}
-
-// Mnemonics for instructions 0xF0 byte.
-// Returns nullptr if the instruction is not handled here.
-static const char* F0Mnem(byte f0byte) {
-  switch (f0byte) {
-    case 0x0B:
-      return "ud2";
-    case 0x18:
-      return "prefetch";
-    case 0xA2:
-      return "cpuid";
-    case 0xBE:
-      return "movsx_b";
-    case 0xBF:
-      return "movsx_w";
-    case 0xB6:
-      return "movzx_b";
-    case 0xB7:
-      return "movzx_w";
-    case 0xAF:
-      return "imul";
-    case 0xA4:
-      return "shld";
-    case 0xA5:
-      return "shld";
-    case 0xAD:
-      return "shrd";
-    case 0xAC:
-      return "shrd";  // 3-operand version.
-    case 0xAB:
-      return "bts";
-    case 0xB0:
-      return "cmpxchg_b";
-    case 0xB1:
-      return "cmpxchg";
-    case 0xBC:
-      return "bsf";
-    case 0xBD:
-      return "bsr";
-    default:
-      return nullptr;
-  }
-}
-
-
-// Disassembled instruction '*instr' and writes it into 'out_buffer'.
-int DisassemblerIA32::InstructionDecode(v8::internal::Vector<char> out_buffer,
-                                        byte* instr) {
-  tmp_buffer_pos_ = 0;  // starting to write as position 0
-  byte* data = instr;
-  // Check for hints.
-  const char* branch_hint = nullptr;
-  // We use these two prefixes only with branch prediction
-  if (*data == 0x3E /*ds*/) {
-    branch_hint = "predicted taken";
-    data++;
-  } else if (*data == 0x2E /*cs*/) {
-    branch_hint = "predicted not taken";
-    data++;
-  } else if (*data == 0xC4 && *(data + 1) >= 0xC0) {
-    vex_byte0_ = *data;
-    vex_byte1_ = *(data + 1);
-    vex_byte2_ = *(data + 2);
-    data += 3;
-  } else if (*data == 0xC5 && *(data + 1) >= 0xC0) {
-    vex_byte0_ = *data;
-    vex_byte1_ = *(data + 1);
-    data += 2;
-  } else if (*data == 0xF0 /*lock*/) {
-    AppendToBuffer("lock ");
-    data++;
-  }
-
-  bool processed = true;  // Will be set to false if the current instruction
-                          // is not in 'instructions' table.
-  // Decode AVX instructions.
-  if (vex_byte0_ != 0) {
-    data += AVXInstruction(data);
-  } else {
-    const InstructionDesc& idesc = instruction_table_->Get(*data);
-    switch (idesc.type) {
-      case ZERO_OPERANDS_INSTR:
-        AppendToBuffer("%s", idesc.mnem);
-        data++;
-        break;
-
-      case TWO_OPERANDS_INSTR:
-        data++;
-        data += PrintOperands(idesc.mnem, idesc.op_order_, data);
-        break;
-
-      case JUMP_CONDITIONAL_SHORT_INSTR:
-        data += JumpConditionalShort(data, branch_hint);
-        break;
-
-      case REGISTER_INSTR:
-        AppendToBuffer("%s %s", idesc.mnem, NameOfCPURegister(*data & 0x07));
-        data++;
-        break;
-
-      case MOVE_REG_INSTR: {
-        byte* addr =
-            reinterpret_cast<byte*>(*reinterpret_cast<int32_t*>(data + 1));
-        AppendToBuffer("mov %s,%s", NameOfCPURegister(*data & 0x07),
-                       NameOfAddress(addr));
-        data += 5;
-        break;
-      }
-
-      case CALL_JUMP_INSTR: {
-        byte* addr = data + *reinterpret_cast<int32_t*>(data + 1) + 5;
-        AppendToBuffer("%s %s", idesc.mnem, NameOfAddress(addr));
-        data += 5;
-        break;
-      }
-
-      case SHORT_IMMEDIATE_INSTR: {
-        byte* addr =
-            reinterpret_cast<byte*>(*reinterpret_cast<int32_t*>(data + 1));
-        AppendToBuffer("%s eax,%s", idesc.mnem, NameOfAddress(addr));
-        data += 5;
-        break;
-      }
-
-      case BYTE_IMMEDIATE_INSTR: {
-        AppendToBuffer("%s al,0x%x", idesc.mnem, data[1]);
-        data += 2;
-        break;
-      }
-
-      case NO_INSTR:
-        processed = false;
-        break;
-
-      default:
-        UNIMPLEMENTED();  // This type is not implemented.
-    }
-  }
-  //----------------------------
-  if (!processed) {
-    switch (*data) {
-      case 0xC2:
-        AppendToBuffer("ret 0x%x", *reinterpret_cast<uint16_t*>(data+1));
-        data += 3;
-        break;
-
-      case 0x6B: {
-        data++;
-        data += PrintOperands("imul", REG_OPER_OP_ORDER, data);
-        AppendToBuffer(",%d", *data);
-        data++;
-      } break;
-
-      case 0x69: {
-        data++;
-        data += PrintOperands("imul", REG_OPER_OP_ORDER, data);
-        AppendToBuffer(",%d", *reinterpret_cast<int32_t*>(data));
-        data += 4;
-        }
-        break;
-
-      case 0xF6:
-        { data++;
-          int mod, regop, rm;
-          get_modrm(*data, &mod, &regop, &rm);
-          if (regop == eax) {
-            AppendToBuffer("test_b ");
-            data += PrintRightByteOperand(data);
-            int32_t imm = *data;
-            AppendToBuffer(",0x%x", imm);
-            data++;
-          } else {
-            UnimplementedInstruction();
-          }
-        }
-        break;
-
-      case 0x81:  // fall through
-      case 0x83:  // 0x81 with sign extension bit set
-        data += PrintImmediateOp(data);
-        break;
-
-      case 0x0F:
-        { byte f0byte = data[1];
-          const char* f0mnem = F0Mnem(f0byte);
-          if (f0byte == 0x18) {
-            data += 2;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            const char* suffix[] = {"nta", "1", "2", "3"};
-            AppendToBuffer("%s%s ", f0mnem, suffix[regop & 0x03]);
-            data += PrintRightOperand(data);
-          } else if (f0byte == 0x1F && data[2] == 0) {
-            AppendToBuffer("nop");  // 3 byte nop.
-            data += 3;
-          } else if (f0byte == 0x1F && data[2] == 0x40 && data[3] == 0) {
-            AppendToBuffer("nop");  // 4 byte nop.
-            data += 4;
-          } else if (f0byte == 0x1F && data[2] == 0x44 && data[3] == 0 &&
-                     data[4] == 0) {
-            AppendToBuffer("nop");  // 5 byte nop.
-            data += 5;
-          } else if (f0byte == 0x1F && data[2] == 0x80 && data[3] == 0 &&
-                     data[4] == 0 && data[5] == 0 && data[6] == 0) {
-            AppendToBuffer("nop");  // 7 byte nop.
-            data += 7;
-          } else if (f0byte == 0x1F && data[2] == 0x84 && data[3] == 0 &&
-                     data[4] == 0 && data[5] == 0 && data[6] == 0 &&
-                     data[7] == 0) {
-            AppendToBuffer("nop");  // 8 byte nop.
-            data += 8;
-          } else if (f0byte == 0x0B || f0byte == 0xA2 || f0byte == 0x31) {
-            AppendToBuffer("%s", f0mnem);
-            data += 2;
-          } else if (f0byte == 0x28) {
-            data += 2;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("movaps %s,%s",
-                           NameOfXMMRegister(regop),
-                           NameOfXMMRegister(rm));
-            data++;
-          } else if (f0byte == 0x10 || f0byte == 0x11) {
-            data += 2;
-            // movups xmm, xmm/m128
-            // movups xmm/m128, xmm
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("movups ");
-            if (f0byte == 0x11) {
-              data += PrintRightXMMOperand(data);
-              AppendToBuffer(",%s", NameOfXMMRegister(regop));
-            } else {
-              AppendToBuffer("%s,", NameOfXMMRegister(regop));
-              data += PrintRightXMMOperand(data);
-            }
-          } else if (f0byte == 0x2E) {
-            data += 2;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("ucomiss %s,", NameOfXMMRegister(regop));
-            data += PrintRightXMMOperand(data);
-          } else if (f0byte >= 0x52 && f0byte <= 0x5F) {
-            const char* const pseudo_op[] = {
-                "rsqrtps", "rcpps", "andps", "andnps",   "orps",
-                "xorps",   "addps", "mulps", "cvtps2pd", "cvtdq2ps",
-                "subps",   "minps", "divps", "maxps",
-            };
-
-            data += 2;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("%s %s,", pseudo_op[f0byte - 0x52],
-                           NameOfXMMRegister(regop));
-            data += PrintRightXMMOperand(data);
-          } else if (f0byte == 0x50) {
-            data += 2;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("movmskps %s,%s",
-                           NameOfCPURegister(regop),
-                           NameOfXMMRegister(rm));
-            data++;
-          } else if (f0byte == 0xC2) {
-            data += 2;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            const char* const pseudo_op[] = {"eq",  "lt",  "le",  "unord",
-                                             "neq", "nlt", "nle", "ord"};
-            AppendToBuffer("cmpps %s, ", NameOfXMMRegister(regop));
-            data += PrintRightXMMOperand(data);
-            AppendToBuffer(", (%s)", pseudo_op[*data]);
-            data++;
-          } else if (f0byte== 0xC6) {
-            // shufps xmm, xmm/m128, imm8
-            data += 2;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            int8_t imm8 = static_cast<int8_t>(data[1]);
-            AppendToBuffer("shufps %s,%s,%d",
-                            NameOfXMMRegister(rm),
-                            NameOfXMMRegister(regop),
-                            static_cast<int>(imm8));
-            data += 2;
-          } else if ((f0byte & 0xF0) == 0x80) {
-            data += JumpConditional(data, branch_hint);
-          } else if (f0byte == 0xBE || f0byte == 0xBF || f0byte == 0xB6 ||
-                     f0byte == 0xB7 || f0byte == 0xAF) {
-            data += 2;
-            data += PrintOperands(f0mnem, REG_OPER_OP_ORDER, data);
-          } else if ((f0byte & 0xF0) == 0x90) {
-            data += SetCC(data);
-          } else if ((f0byte & 0xF0) == 0x40) {
-            data += CMov(data);
-          } else if (f0byte == 0xA4 || f0byte == 0xAC) {
-            // shld, shrd
-            data += 2;
-            AppendToBuffer("%s ", f0mnem);
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            int8_t imm8 = static_cast<int8_t>(data[1]);
-            data += 2;
-            AppendToBuffer("%s,%s,%d", NameOfCPURegister(rm),
-                           NameOfCPURegister(regop), static_cast<int>(imm8));
-          } else if (f0byte == 0xAB || f0byte == 0xA5 || f0byte == 0xAD) {
-            // shrd_cl, shld_cl, bts
-            data += 2;
-            AppendToBuffer("%s ", f0mnem);
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            data += PrintRightOperand(data);
-            if (f0byte == 0xAB) {
-              AppendToBuffer(",%s", NameOfCPURegister(regop));
-            } else {
-              AppendToBuffer(",%s,cl", NameOfCPURegister(regop));
-            }
-          } else if (f0byte == 0xB0) {
-            // cmpxchg_b
-            data += 2;
-            AppendToBuffer("%s ", f0mnem);
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            data += PrintRightOperand(data);
-            AppendToBuffer(",%s", NameOfByteCPURegister(regop));
-          } else if (f0byte == 0xB1) {
-            // cmpxchg
-            data += 2;
-            data += PrintOperands(f0mnem, OPER_REG_OP_ORDER, data);
-          } else if (f0byte == 0xBC) {
-            data += 2;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("%s %s,", f0mnem, NameOfCPURegister(regop));
-            data += PrintRightOperand(data);
-          } else if (f0byte == 0xBD) {
-            data += 2;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("%s %s,", f0mnem, NameOfCPURegister(regop));
-            data += PrintRightOperand(data);
-          } else if (f0byte == 0xAE && (data[2] & 0xF8) == 0xE8) {
-            AppendToBuffer("lfence");
-            data += 3;
-          } else {
-            UnimplementedInstruction();
-          }
-        }
-        break;
-
-      case 0x8F:
-        { data++;
-          int mod, regop, rm;
-          get_modrm(*data, &mod, &regop, &rm);
-          if (regop == eax) {
-            AppendToBuffer("pop ");
-            data += PrintRightOperand(data);
-          }
-        }
-        break;
-
-      case 0xFF:
-        { data++;
-          int mod, regop, rm;
-          get_modrm(*data, &mod, &regop, &rm);
-          const char* mnem = nullptr;
-          switch (regop) {
-            case esi: mnem = "push"; break;
-            case eax: mnem = "inc"; break;
-            case ecx: mnem = "dec"; break;
-            case edx: mnem = "call"; break;
-            case esp: mnem = "jmp"; break;
-            default: mnem = "???";
-          }
-          AppendToBuffer("%s ", mnem);
-          data += PrintRightOperand(data);
-        }
-        break;
-
-      case 0xC7:  // imm32, fall through
-      case 0xC6:  // imm8
-        { bool is_byte = *data == 0xC6;
-          data++;
-          if (is_byte) {
-            AppendToBuffer("%s ", "mov_b");
-            data += PrintRightByteOperand(data);
-            int32_t imm = *data;
-            AppendToBuffer(",0x%x", imm);
-            data++;
-          } else {
-            AppendToBuffer("%s ", "mov");
-            data += PrintRightOperand(data);
-            int32_t imm = *reinterpret_cast<int32_t*>(data);
-            AppendToBuffer(",0x%x", imm);
-            data += 4;
-          }
-        }
-        break;
-
-      case 0x80:
-        { data++;
-          int mod, regop, rm;
-          get_modrm(*data, &mod, &regop, &rm);
-          const char* mnem = nullptr;
-          switch (regop) {
-            case 5:  mnem = "subb"; break;
-            case 7:  mnem = "cmpb"; break;
-            default: UnimplementedInstruction();
-          }
-          AppendToBuffer("%s ", mnem);
-          data += PrintRightByteOperand(data);
-          int32_t imm = *data;
-          AppendToBuffer(",0x%x", imm);
-          data++;
-        }
-        break;
-
-      case 0x88:  // 8bit, fall through
-      case 0x89:  // 32bit
-        { bool is_byte = *data == 0x88;
-          int mod, regop, rm;
-          data++;
-          get_modrm(*data, &mod, &regop, &rm);
-          if (is_byte) {
-            AppendToBuffer("%s ", "mov_b");
-            data += PrintRightByteOperand(data);
-            AppendToBuffer(",%s", NameOfByteCPURegister(regop));
-          } else {
-            AppendToBuffer("%s ", "mov");
-            data += PrintRightOperand(data);
-            AppendToBuffer(",%s", NameOfCPURegister(regop));
-          }
-        }
-        break;
-
-      case 0x66:  // prefix
-        while (*data == 0x66) data++;
-        if (*data == 0xF && data[1] == 0x1F) {
-          AppendToBuffer("nop");  // 0x66 prefix
-        } else if (*data == 0x39) {
-          data++;
-          data += PrintOperands("cmpw", OPER_REG_OP_ORDER, data);
-        } else if (*data == 0x3B) {
-          data++;
-          data += PrintOperands("cmpw", REG_OPER_OP_ORDER, data);
-        } else if (*data == 0x81) {
-          data++;
-          AppendToBuffer("cmpw ");
-          data += PrintRightOperand(data);
-          int imm = *reinterpret_cast<int16_t*>(data);
-          AppendToBuffer(",0x%x", imm);
-          data += 2;
-        } else if (*data == 0x87) {
-          data++;
-          int mod, regop, rm;
-          get_modrm(*data, &mod, &regop, &rm);
-          AppendToBuffer("xchg_w %s,", NameOfCPURegister(regop));
-          data += PrintRightOperand(data);
-        } else if (*data == 0x89) {
-          data++;
-          int mod, regop, rm;
-          get_modrm(*data, &mod, &regop, &rm);
-          AppendToBuffer("mov_w ");
-          data += PrintRightOperand(data);
-          AppendToBuffer(",%s", NameOfCPURegister(regop));
-        } else if (*data == 0x8B) {
-          data++;
-          data += PrintOperands("mov_w", REG_OPER_OP_ORDER, data);
-        } else if (*data == 0x90) {
-          AppendToBuffer("nop");  // 0x66 prefix
-        } else if (*data == 0xC7) {
-          data++;
-          AppendToBuffer("%s ", "mov_w");
-          data += PrintRightOperand(data);
-          int imm = *reinterpret_cast<int16_t*>(data);
-          AppendToBuffer(",0x%x", imm);
-          data += 2;
-        } else if (*data == 0xF7) {
-          data++;
-          AppendToBuffer("%s ", "test_w");
-          data += PrintRightOperand(data);
-          int imm = *reinterpret_cast<int16_t*>(data);
-          AppendToBuffer(",0x%x", imm);
-          data += 2;
-        } else if (*data == 0x0F) {
-          data++;
-          if (*data == 0x38) {
-            data++;
-            byte op = *data;
-            data++;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            switch (op) {
-              case 0x17:
-                AppendToBuffer("ptest %s,%s", NameOfXMMRegister(regop),
-                               NameOfXMMRegister(rm));
-                data++;
-                break;
-#define SSE34_DIS_CASE(instruction, notUsed1, notUsed2, notUsed3, opcode) \
-  case 0x##opcode: {                                                      \
-    AppendToBuffer(#instruction " %s,", NameOfXMMRegister(regop));        \
-    data += PrintRightXMMOperand(data);                                   \
-    break;                                                                \
-  }
-
-                SSSE3_INSTRUCTION_LIST(SSE34_DIS_CASE)
-                SSE4_INSTRUCTION_LIST(SSE34_DIS_CASE)
-#undef SSE34_DIS_CASE
-              default:
-                UnimplementedInstruction();
-            }
-          } else if (*data == 0x3A) {
-            data++;
-            if (*data == 0x0A) {
-              data++;
-              int mod, regop, rm;
-              get_modrm(*data, &mod, &regop, &rm);
-              int8_t imm8 = static_cast<int8_t>(data[1]);
-              AppendToBuffer("roundss %s,%s,%d", NameOfXMMRegister(regop),
-                             NameOfXMMRegister(rm), static_cast<int>(imm8));
-              data += 2;
-            } else if (*data == 0x0B) {
-              data++;
-              int mod, regop, rm;
-              get_modrm(*data, &mod, &regop, &rm);
-              int8_t imm8 = static_cast<int8_t>(data[1]);
-              AppendToBuffer("roundsd %s,%s,%d",
-                             NameOfXMMRegister(regop),
-                             NameOfXMMRegister(rm),
-                             static_cast<int>(imm8));
-              data += 2;
-            } else if (*data == 0x14) {
-              data++;
-              int mod, regop, rm;
-              get_modrm(*data, &mod, &regop, &rm);
-              AppendToBuffer("pextrb ");
-              data += PrintRightOperand(data);
-              AppendToBuffer(",%s,%d", NameOfXMMRegister(regop),
-                             *reinterpret_cast<int8_t*>(data));
-              data++;
-            } else if (*data == 0x15) {
-              data++;
-              int mod, regop, rm;
-              get_modrm(*data, &mod, &regop, &rm);
-              AppendToBuffer("pextrw ");
-              data += PrintRightOperand(data);
-              AppendToBuffer(",%s,%d", NameOfXMMRegister(regop),
-                             *reinterpret_cast<int8_t*>(data));
-              data++;
-            } else if (*data == 0x16) {
-              data++;
-              int mod, regop, rm;
-              get_modrm(*data, &mod, &regop, &rm);
-              AppendToBuffer("pextrd ");
-              data += PrintRightOperand(data);
-              AppendToBuffer(",%s,%d", NameOfXMMRegister(regop),
-                             *reinterpret_cast<int8_t*>(data));
-              data++;
-            } else if (*data == 0x17) {
-              data++;
-              int mod, regop, rm;
-              get_modrm(*data, &mod, &regop, &rm);
-              int8_t imm8 = static_cast<int8_t>(data[1]);
-              AppendToBuffer("extractps %s,%s,%d",
-                             NameOfCPURegister(rm),
-                             NameOfXMMRegister(regop),
-                             static_cast<int>(imm8));
-              data += 2;
-            } else if (*data == 0x20) {
-              data++;
-              int mod, regop, rm;
-              get_modrm(*data, &mod, &regop, &rm);
-              AppendToBuffer("pinsrb %s,", NameOfXMMRegister(regop));
-              data += PrintRightOperand(data);
-              AppendToBuffer(",%d", *reinterpret_cast<int8_t*>(data));
-              data++;
-            } else if (*data == 0x21) {
-              data++;
-              int mod, regop, rm;
-              get_modrm(*data, &mod, &regop, &rm);
-              AppendToBuffer("insertps %s,", NameOfXMMRegister(regop));
-              data += PrintRightXMMOperand(data);
-              AppendToBuffer(",%d", *reinterpret_cast<int8_t*>(data));
-              data++;
-            } else if (*data == 0x22) {
-              data++;
-              int mod, regop, rm;
-              get_modrm(*data, &mod, &regop, &rm);
-              AppendToBuffer("pinsrd %s,", NameOfXMMRegister(regop));
-              data += PrintRightOperand(data);
-              AppendToBuffer(",%d", *reinterpret_cast<int8_t*>(data));
-              data++;
-            } else {
-              UnimplementedInstruction();
-            }
-          } else if (*data == 0x2E || *data == 0x2F) {
-            const char* mnem = (*data == 0x2E) ? "ucomisd" : "comisd";
-            data++;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            if (mod == 0x3) {
-              AppendToBuffer("%s %s,%s", mnem,
-                             NameOfXMMRegister(regop),
-                             NameOfXMMRegister(rm));
-              data++;
-            } else {
-              AppendToBuffer("%s %s,", mnem, NameOfXMMRegister(regop));
-              data += PrintRightOperand(data);
-            }
-          } else if (*data == 0x50) {
-            data++;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("movmskpd %s,%s",
-                           NameOfCPURegister(regop),
-                           NameOfXMMRegister(rm));
-            data++;
-          } else if (*data == 0x54) {
-            data++;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("andpd %s,%s",
-                           NameOfXMMRegister(regop),
-                           NameOfXMMRegister(rm));
-            data++;
-          } else if (*data == 0x56) {
-            data++;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("orpd %s,%s",
-                           NameOfXMMRegister(regop),
-                           NameOfXMMRegister(rm));
-            data++;
-          } else if (*data == 0x57) {
-            data++;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("xorpd %s,%s",
-                           NameOfXMMRegister(regop),
-                           NameOfXMMRegister(rm));
-            data++;
-          } else if (*data == 0x6E) {
-            data++;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("movd %s,", NameOfXMMRegister(regop));
-            data += PrintRightOperand(data);
-          } else if (*data == 0x6F) {
-            data++;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("movdqa %s,", NameOfXMMRegister(regop));
-            data += PrintRightXMMOperand(data);
-          } else if (*data == 0x70) {
-            data++;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("pshufd %s,", NameOfXMMRegister(regop));
-            data += PrintRightXMMOperand(data);
-            AppendToBuffer(",%d", *reinterpret_cast<int8_t*>(data));
-            data++;
-          } else if (*data == 0x90) {
-            data++;
-            AppendToBuffer("nop");  // 2 byte nop.
-          } else if (*data == 0xF3) {
-            data++;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("psllq %s,%s",
-                           NameOfXMMRegister(regop),
-                           NameOfXMMRegister(rm));
-            data++;
-          } else if (*data == 0x71) {
-            data++;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            int8_t imm8 = static_cast<int8_t>(data[1]);
-            AppendToBuffer("ps%sw %s,%d", sf_str[regop / 2],
-                           NameOfXMMRegister(rm), static_cast<int>(imm8));
-            data += 2;
-          } else if (*data == 0x72) {
-            data++;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            int8_t imm8 = static_cast<int8_t>(data[1]);
-            AppendToBuffer("ps%sd %s,%d", sf_str[regop / 2],
-                           NameOfXMMRegister(rm), static_cast<int>(imm8));
-            data += 2;
-          } else if (*data == 0x73) {
-            data++;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            int8_t imm8 = static_cast<int8_t>(data[1]);
-            DCHECK(regop == esi || regop == edx);
-            AppendToBuffer("ps%sq %s,%d", sf_str[regop / 2],
-                           NameOfXMMRegister(rm), static_cast<int>(imm8));
-            data += 2;
-          } else if (*data == 0xD3) {
-            data++;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("psrlq %s,%s",
-                           NameOfXMMRegister(regop),
-                           NameOfXMMRegister(rm));
-            data++;
-          } else if (*data == 0x7F) {
-            AppendToBuffer("movdqa ");
-            data++;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            data += PrintRightXMMOperand(data);
-            AppendToBuffer(",%s", NameOfXMMRegister(regop));
-          } else if (*data == 0x7E) {
-            data++;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("movd ");
-            data += PrintRightOperand(data);
-            AppendToBuffer(",%s", NameOfXMMRegister(regop));
-          } else if (*data == 0xC4) {
-            data++;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("pinsrw %s,", NameOfXMMRegister(regop));
-            data += PrintRightOperand(data);
-            AppendToBuffer(",%d", *reinterpret_cast<int8_t*>(data));
-            data++;
-          } else if (*data == 0xE7) {
-            data++;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            if (mod == 3) {
-              // movntdq
-              UnimplementedInstruction();
-            } else {
-              UnimplementedInstruction();
-            }
-          } else if (*data == 0xB1) {
-            data++;
-            data += PrintOperands("cmpxchg_w", OPER_REG_OP_ORDER, data);
-          } else {
-            byte op = *data;
-            data++;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            switch (op) {
-#define SSE2_DIS_CASE(instruction, notUsed1, notUsed2, opcode)     \
-  case 0x##opcode: {                                               \
-    AppendToBuffer(#instruction " %s,", NameOfXMMRegister(regop)); \
-    data += PrintRightXMMOperand(data);                            \
-    break;                                                         \
-  }
-
-              SSE2_INSTRUCTION_LIST(SSE2_DIS_CASE)
-#undef SSE2_DIS_CASE
-              default:
-                UnimplementedInstruction();
-            }
-          }
-        } else {
-          UnimplementedInstruction();
-        }
-        break;
-
-      case 0xFE:
-        { data++;
-          int mod, regop, rm;
-          get_modrm(*data, &mod, &regop, &rm);
-          if (regop == ecx) {
-            AppendToBuffer("dec_b ");
-            data += PrintRightOperand(data);
-          } else {
-            UnimplementedInstruction();
-          }
-        }
-        break;
-
-      case 0x68:
-        AppendToBuffer("push 0x%x", *reinterpret_cast<int32_t*>(data+1));
-        data += 5;
-        break;
-
-      case 0x6A:
-        AppendToBuffer("push 0x%x", *reinterpret_cast<int8_t*>(data + 1));
-        data += 2;
-        break;
-
-      case 0xA8:
-        AppendToBuffer("test al,0x%x", *reinterpret_cast<uint8_t*>(data+1));
-        data += 2;
-        break;
-
-      case 0xA9:
-        AppendToBuffer("test eax,0x%x", *reinterpret_cast<int32_t*>(data+1));
-        data += 5;
-        break;
-
-      case 0xD1:  // fall through
-      case 0xD3:  // fall through
-      case 0xC1:
-        data += D1D3C1Instruction(data);
-        break;
-
-      case 0xD8:  // fall through
-      case 0xD9:  // fall through
-      case 0xDA:  // fall through
-      case 0xDB:  // fall through
-      case 0xDC:  // fall through
-      case 0xDD:  // fall through
-      case 0xDE:  // fall through
-      case 0xDF:
-        data += FPUInstruction(data);
-        break;
-
-      case 0xEB:
-        data += JumpShort(data);
-        break;
-
-      case 0xF2:
-        if (*(data+1) == 0x0F) {
-          byte b2 = *(data+2);
-          if (b2 == 0x11) {
-            AppendToBuffer("movsd ");
-            data += 3;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            data += PrintRightXMMOperand(data);
-            AppendToBuffer(",%s", NameOfXMMRegister(regop));
-          } else if (b2 == 0x10) {
-            data += 3;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("movsd %s,", NameOfXMMRegister(regop));
-            data += PrintRightXMMOperand(data);
-          } else  if (b2 == 0x5A) {
-            data += 3;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("cvtsd2ss %s,", NameOfXMMRegister(regop));
-            data += PrintRightXMMOperand(data);
-          } else if (b2 == 0x70) {
-            data += 3;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("pshuflw %s,", NameOfXMMRegister(regop));
-            data += PrintRightXMMOperand(data);
-            AppendToBuffer(",%d", *reinterpret_cast<int8_t*>(data));
-            data++;
-          } else {
-            const char* mnem = "?";
-            switch (b2) {
-              case 0x2A:
-                mnem = "cvtsi2sd";
-                break;
-              case 0x2C:
-                mnem = "cvttsd2si";
-                break;
-              case 0x2D:
-                mnem = "cvtsd2si";
-                break;
-              case 0x51:
-                mnem = "sqrtsd";
-                break;
-              case 0x58:
-                mnem = "addsd";
-                break;
-              case 0x59:
-                mnem = "mulsd";
-                break;
-              case 0x5C:
-                mnem = "subsd";
-                break;
-              case 0x5D:
-                mnem = "minsd";
-                break;
-              case 0x5E:
-                mnem = "divsd";
-                break;
-              case 0x5F:
-                mnem = "maxsd";
-                break;
-              case 0x7C:
-                mnem = "haddps";
-                break;
-            }
-            data += 3;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            if (b2 == 0x2A) {
-              AppendToBuffer("%s %s,", mnem, NameOfXMMRegister(regop));
-              data += PrintRightOperand(data);
-            } else if (b2 == 0x2C || b2 == 0x2D) {
-              AppendToBuffer("%s %s,", mnem, NameOfCPURegister(regop));
-              data += PrintRightXMMOperand(data);
-            } else if (b2 == 0xC2) {
-              // Intel manual 2A, Table 3-18.
-              const char* const pseudo_op[] = {
-                "cmpeqsd",
-                "cmpltsd",
-                "cmplesd",
-                "cmpunordsd",
-                "cmpneqsd",
-                "cmpnltsd",
-                "cmpnlesd",
-                "cmpordsd"
-              };
-              AppendToBuffer("%s %s,%s",
-                             pseudo_op[data[1]],
-                             NameOfXMMRegister(regop),
-                             NameOfXMMRegister(rm));
-              data += 2;
-            } else {
-              AppendToBuffer("%s %s,", mnem, NameOfXMMRegister(regop));
-              data += PrintRightXMMOperand(data);
-            }
-          }
-        } else {
-          UnimplementedInstruction();
-        }
-        break;
-
-      case 0xF3:
-        if (*(data+1) == 0x0F) {
-          byte b2 = *(data+2);
-          if (b2 == 0x11) {
-            AppendToBuffer("movss ");
-            data += 3;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            data += PrintRightXMMOperand(data);
-            AppendToBuffer(",%s", NameOfXMMRegister(regop));
-          } else if (b2 == 0x10) {
-            data += 3;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("movss %s,", NameOfXMMRegister(regop));
-            data += PrintRightXMMOperand(data);
-          } else if (b2 == 0x5A) {
-            data += 3;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("cvtss2sd %s,", NameOfXMMRegister(regop));
-            data += PrintRightXMMOperand(data);
-          } else if (b2 == 0x6F) {
-            data += 3;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("movdqu %s,", NameOfXMMRegister(regop));
-            data += PrintRightXMMOperand(data);
-          } else if (b2 == 0x7F) {
-            AppendToBuffer("movdqu ");
-            data += 3;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            data += PrintRightXMMOperand(data);
-            AppendToBuffer(",%s", NameOfXMMRegister(regop));
-          } else if (b2 == 0xB8) {
-            data += 3;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("popcnt %s,", NameOfCPURegister(regop));
-            data += PrintRightOperand(data);
-          } else if (b2 == 0xBC) {
-            data += 3;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("tzcnt %s,", NameOfCPURegister(regop));
-            data += PrintRightOperand(data);
-          } else if (b2 == 0xBD) {
-            data += 3;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            AppendToBuffer("lzcnt %s,", NameOfCPURegister(regop));
-            data += PrintRightOperand(data);
-          } else {
-            const char* mnem = "?";
-            switch (b2) {
-              case 0x2A:
-                mnem = "cvtsi2ss";
-                break;
-              case 0x2C:
-                mnem = "cvttss2si";
-                break;
-              case 0x2D:
-                mnem = "cvtss2si";
-                break;
-              case 0x51:
-                mnem = "sqrtss";
-                break;
-              case 0x58:
-                mnem = "addss";
-                break;
-              case 0x59:
-                mnem = "mulss";
-                break;
-              case 0x5B:
-                mnem = "cvttps2dq";
-                break;
-              case 0x5C:
-                mnem = "subss";
-                break;
-              case 0x5D:
-                mnem = "minss";
-                break;
-              case 0x5E:
-                mnem = "divss";
-                break;
-              case 0x5F:
-                mnem = "maxss";
-                break;
-            }
-            data += 3;
-            int mod, regop, rm;
-            get_modrm(*data, &mod, &regop, &rm);
-            if (b2 == 0x2A) {
-              AppendToBuffer("%s %s,", mnem, NameOfXMMRegister(regop));
-              data += PrintRightOperand(data);
-            } else if (b2 == 0x2C || b2 == 0x2D) {
-              AppendToBuffer("%s %s,", mnem, NameOfCPURegister(regop));
-              data += PrintRightXMMOperand(data);
-            } else if (b2 == 0xC2) {
-              // Intel manual 2A, Table 3-18.
-              const char* const pseudo_op[] = {
-                  "cmpeqss",  "cmpltss",  "cmpless",  "cmpunordss",
-                  "cmpneqss", "cmpnltss", "cmpnless", "cmpordss"};
-              AppendToBuffer("%s %s,%s", pseudo_op[data[1]],
-                             NameOfXMMRegister(regop), NameOfXMMRegister(rm));
-              data += 2;
-            } else {
-              AppendToBuffer("%s %s,", mnem, NameOfXMMRegister(regop));
-              data += PrintRightXMMOperand(data);
-            }
-          }
-        } else if (*(data+1) == 0xA5) {
-          data += 2;
-          AppendToBuffer("rep_movs");
-        } else if (*(data+1) == 0xAB) {
-          data += 2;
-          AppendToBuffer("rep_stos");
-        } else {
-          UnimplementedInstruction();
-        }
-        break;
-
-      case 0xF7:
-        data += F7Instruction(data);
-        break;
-
-      default:
-        UnimplementedInstruction();
-    }
-  }
-
-  if (tmp_buffer_pos_ < sizeof tmp_buffer_) {
-    tmp_buffer_[tmp_buffer_pos_] = '\0';
-  }
-
-  int instr_len = data - instr;
-  if (instr_len == 0) {
-    printf("%02x", *data);
-  }
-  DCHECK_GT(instr_len, 0);  // Ensure progress.
-
-  int outp = 0;
-  // Instruction bytes.
-  for (byte* bp = instr; bp < data; bp++) {
-    outp += v8::internal::SNPrintF(out_buffer + outp,
-                                   "%02x",
-                                   *bp);
-  }
-  for (int i = 6 - instr_len; i >= 0; i--) {
-    outp += v8::internal::SNPrintF(out_buffer + outp, "  ");
-  }
-
-  outp += v8::internal::SNPrintF(out_buffer + outp,
-                                 " %s",
-                                 tmp_buffer_.start());
-  return instr_len;
-}  // NOLINT (function is too long)
-
-
-//------------------------------------------------------------------------------
-
-
-static const char* const cpu_regs[8] = {
-  "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi"
-};
-
-
-static const char* const byte_cpu_regs[8] = {
-  "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh"
-};
-
-
-static const char* const xmm_regs[8] = {
-  "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7"
-};
-
-
-const char* NameConverter::NameOfAddress(byte* addr) const {
-  v8::internal::SNPrintF(tmp_buffer_, "%p", static_cast<void*>(addr));
-  return tmp_buffer_.start();
-}
-
-
-const char* NameConverter::NameOfConstant(byte* addr) const {
-  return NameOfAddress(addr);
-}
-
-
-const char* NameConverter::NameOfCPURegister(int reg) const {
-  if (0 <= reg && reg < 8) return cpu_regs[reg];
-  return "noreg";
-}
-
-
-const char* NameConverter::NameOfByteCPURegister(int reg) const {
-  if (0 <= reg && reg < 8) return byte_cpu_regs[reg];
-  return "noreg";
-}
-
-
-const char* NameConverter::NameOfXMMRegister(int reg) const {
-  if (0 <= reg && reg < 8) return xmm_regs[reg];
-  return "noxmmreg";
-}
-
-
-const char* NameConverter::NameInCode(byte* addr) const {
-  // IA32 does not embed debug strings at the moment.
-  UNREACHABLE();
-}
-
-
-//------------------------------------------------------------------------------
-
-Disassembler::Disassembler(const NameConverter& converter)
-    : converter_(converter) {}
-
-
-Disassembler::~Disassembler() {}
-
-
-int Disassembler::InstructionDecode(v8::internal::Vector<char> buffer,
-                                    byte* instruction) {
-  DisassemblerIA32 d(converter_, false /*do not crash if unimplemented*/);
-  return d.InstructionDecode(buffer, instruction);
-}
-
-
-// The IA-32 assembler does not currently use constant pools.
-int Disassembler::ConstantPoolSizeAt(byte* instruction) { return -1; }
-
-
-/*static*/ void Disassembler::Disassemble(FILE* f, byte* begin, byte* end) {
-  NameConverter converter;
-  Disassembler d(converter);
-  for (byte* pc = begin; pc < end;) {
-    v8::internal::EmbeddedVector<char, 128> buffer;
-    buffer[0] = '\0';
-    byte* prev_pc = pc;
-    pc += d.InstructionDecode(buffer, pc);
-    fprintf(f, "%p", static_cast<void*>(prev_pc));
-    fprintf(f, "    ");
-
-    for (byte* bp = prev_pc; bp < pc; bp++) {
-      fprintf(f, "%02x",  *bp);
-    }
-    for (int i = 6 - (pc - prev_pc); i >= 0; i--) {
-      fprintf(f, "  ");
-    }
-    fprintf(f, "  %s\n", buffer.start());
-  }
-}
-
-
-}  // namespace disasm
-
-#endif  // V8_TARGET_ARCH_IA32
diff --git a/src/v8/src/ia32/frame-constants-ia32.cc b/src/v8/src/ia32/frame-constants-ia32.cc
deleted file mode 100644
index 32c2caf..0000000
--- a/src/v8/src/ia32/frame-constants-ia32.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2006-2008 the V8 project 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 V8_TARGET_ARCH_IA32
-
-#include "src/assembler.h"
-#include "src/frame-constants.h"
-#include "src/ia32/assembler-ia32-inl.h"
-#include "src/ia32/assembler-ia32.h"
-
-#include "src/ia32/frame-constants-ia32.h"
-
-namespace v8 {
-namespace internal {
-
-Register JavaScriptFrame::fp_register() { return ebp; }
-Register JavaScriptFrame::context_register() { return esi; }
-Register JavaScriptFrame::constant_pool_pointer_register() { UNREACHABLE(); }
-
-int InterpreterFrameConstants::RegisterStackSlotCount(int register_count) {
-  return register_count;
-}
-
-int BuiltinContinuationFrameConstants::PaddingSlotCount(int register_count) {
-  USE(register_count);
-  return 0;
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_IA32
diff --git a/src/v8/src/ia32/frame-constants-ia32.h b/src/v8/src/ia32/frame-constants-ia32.h
deleted file mode 100644
index b745a19..0000000
--- a/src/v8/src/ia32/frame-constants-ia32.h
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_IA32_FRAMES_IA32_H_
-#define V8_IA32_FRAMES_IA32_H_
-
-namespace v8 {
-namespace internal {
-
-class EntryFrameConstants : public AllStatic {
- public:
-  static const int kCallerFPOffset = -6 * kPointerSize;
-
-  static const int kNewTargetArgOffset = +2 * kPointerSize;
-  static const int kFunctionArgOffset = +3 * kPointerSize;
-  static const int kReceiverArgOffset = +4 * kPointerSize;
-  static const int kArgcOffset = +5 * kPointerSize;
-  static const int kArgvOffset = +6 * kPointerSize;
-};
-
-class ExitFrameConstants : public TypedFrameConstants {
- public:
-  static const int kSPOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(0);
-  static const int kCodeOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(1);
-  DEFINE_TYPED_FRAME_SIZES(2);
-
-  static const int kCallerFPOffset = 0 * kPointerSize;
-  static const int kCallerPCOffset = +1 * kPointerSize;
-
-  // FP-relative displacement of the caller's SP.  It points just
-  // below the saved PC.
-  static const int kCallerSPDisplacement = +2 * kPointerSize;
-
-  static const int kConstantPoolOffset = 0;  // Not used
-};
-
-class JavaScriptFrameConstants : public AllStatic {
- public:
-  // FP-relative.
-  static const int kLocal0Offset = StandardFrameConstants::kExpressionsOffset;
-  static const int kLastParameterOffset = +2 * kPointerSize;
-  static const int kFunctionOffset = StandardFrameConstants::kFunctionOffset;
-
-  // Caller SP-relative.
-  static const int kParam0Offset = -2 * kPointerSize;
-  static const int kReceiverOffset = -1 * kPointerSize;
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_IA32_FRAMES_IA32_H_
diff --git a/src/v8/src/ia32/interface-descriptors-ia32.cc b/src/v8/src/ia32/interface-descriptors-ia32.cc
deleted file mode 100644
index 9edad9a..0000000
--- a/src/v8/src/ia32/interface-descriptors-ia32.cc
+++ /dev/null
@@ -1,355 +0,0 @@
-// Copyright 2012 the V8 project 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 V8_TARGET_ARCH_IA32
-
-#include "src/interface-descriptors.h"
-
-namespace v8 {
-namespace internal {
-
-const Register CallInterfaceDescriptor::ContextRegister() { return esi; }
-
-void CallInterfaceDescriptor::DefaultInitializePlatformSpecific(
-    CallInterfaceDescriptorData* data, int register_parameter_count) {
-  const Register default_stub_registers[] = {eax, ebx, ecx, edx, edi};
-  CHECK_LE(static_cast<size_t>(register_parameter_count),
-           arraysize(default_stub_registers));
-  data->InitializePlatformSpecific(register_parameter_count,
-                                   default_stub_registers);
-}
-
-void RecordWriteDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  static const Register default_stub_registers[] = {ebx, ecx, edx, edi,
-                                                    kReturnRegister0};
-
-  data->RestrictAllocatableRegisters(default_stub_registers,
-                                     arraysize(default_stub_registers));
-
-  CHECK_LE(static_cast<size_t>(kParameterCount),
-           arraysize(default_stub_registers));
-  data->InitializePlatformSpecific(kParameterCount, default_stub_registers);
-}
-
-const Register FastNewFunctionContextDescriptor::FunctionRegister() {
-  return edi;
-}
-const Register FastNewFunctionContextDescriptor::SlotsRegister() { return eax; }
-
-const Register LoadDescriptor::ReceiverRegister() { return edx; }
-const Register LoadDescriptor::NameRegister() { return ecx; }
-const Register LoadDescriptor::SlotRegister() { return eax; }
-
-const Register LoadWithVectorDescriptor::VectorRegister() { return ebx; }
-
-const Register StoreDescriptor::ReceiverRegister() { return edx; }
-const Register StoreDescriptor::NameRegister() { return ecx; }
-const Register StoreDescriptor::ValueRegister() { return eax; }
-const Register StoreDescriptor::SlotRegister() { return edi; }
-
-const Register StoreWithVectorDescriptor::VectorRegister() { return ebx; }
-
-const Register StoreTransitionDescriptor::SlotRegister() { return no_reg; }
-const Register StoreTransitionDescriptor::VectorRegister() { return ebx; }
-const Register StoreTransitionDescriptor::MapRegister() { return edi; }
-
-const Register ApiGetterDescriptor::HolderRegister() { return ecx; }
-const Register ApiGetterDescriptor::CallbackRegister() { return eax; }
-
-const Register MathPowTaggedDescriptor::exponent() { return eax; }
-
-const Register MathPowIntegerDescriptor::exponent() {
-  return MathPowTaggedDescriptor::exponent();
-}
-
-
-const Register GrowArrayElementsDescriptor::ObjectRegister() { return eax; }
-const Register GrowArrayElementsDescriptor::KeyRegister() { return ebx; }
-
-
-void FastNewClosureDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // SharedFunctionInfo, vector, slot index.
-  Register registers[] = {ebx, ecx, edx};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-// static
-const Register TypeConversionDescriptor::ArgumentRegister() { return eax; }
-
-void TypeofDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {ebx};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void CallFunctionDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {edi};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void CallTrampolineDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // eax : number of arguments
-  // edi : the target to call
-  Register registers[] = {edi, eax};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // eax : number of arguments (on the stack, not including receiver)
-  // edi : the target to call
-  // ebx : arguments list (FixedArray)
-  // ecx : arguments list length (untagged)
-  Register registers[] = {edi, eax, ebx, ecx};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallForwardVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // eax : number of arguments
-  // ecx : start index (to support rest parameters)
-  // edi : the target to call
-  Register registers[] = {edi, eax, ecx};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallWithSpreadDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // eax : number of arguments (on the stack, not including receiver)
-  // edi : the target to call
-  // ebx : the object to spread
-  Register registers[] = {edi, eax, ebx};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallWithArrayLikeDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // edi : the target to call
-  // ebx : the arguments list
-  Register registers[] = {edi, ebx};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // eax : number of arguments (on the stack, not including receiver)
-  // edi : the target to call
-  // edx : the new target
-  // ebx : arguments list (FixedArray)
-  // ecx : arguments list length (untagged)
-  Register registers[] = {edi, edx, eax, ebx, ecx};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructForwardVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // eax : number of arguments
-  // edx : the new target
-  // ecx : start index (to support rest parameters)
-  // edi : the target to call
-  Register registers[] = {edi, edx, eax, ecx};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructWithSpreadDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // eax : number of arguments (on the stack, not including receiver)
-  // edi : the target to call
-  // edx : the new target
-  // ebx : the object to spread
-  Register registers[] = {edi, edx, eax, ebx};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructWithArrayLikeDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // edi : the target to call
-  // edx : the new target
-  // ebx : the arguments list
-  Register registers[] = {edi, edx, ebx};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructStubDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // eax : number of arguments
-  // edx : the new target
-  // edi : the target to call
-  // ebx : allocation site or undefined
-  Register registers[] = {edi, edx, eax, ebx};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-
-void ConstructTrampolineDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // eax : number of arguments
-  // edx : the new target
-  // edi : the target to call
-  Register registers[] = {edi, edx, eax};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-
-void TransitionElementsKindDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {eax, ebx};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void AbortJSDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {edx};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void AllocateHeapNumberDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // register state
-  data->InitializePlatformSpecific(0, nullptr, nullptr);
-}
-
-void ArrayConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // kTarget, kNewTarget, kActualArgumentsCount, kAllocationSite
-  Register registers[] = {edi, edx, eax, ebx};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void ArrayNoArgumentConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // register state
-  // eax -- number of arguments
-  // edi -- function
-  // ebx -- allocation site with elements kind
-  Register registers[] = {edi, ebx, eax};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void ArraySingleArgumentConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // register state
-  // eax -- number of arguments
-  // edi -- function
-  // ebx -- allocation site with elements kind
-  Register registers[] = {edi, ebx, eax};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void ArrayNArgumentsConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // register state
-  // eax -- number of arguments
-  // edi -- function
-  // ebx -- allocation site with elements kind
-  Register registers[] = {edi, ebx, eax};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void CompareDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {edx, eax};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-
-void BinaryOpDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {edx, eax};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void StringAddDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {edx, eax};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void ArgumentAdaptorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      edi,  // JSFunction
-      edx,  // the new target
-      eax,  // actual number of arguments
-      ebx,  // expected number of arguments
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ApiCallbackDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      JavaScriptFrame::context_register(),  // callee context
-      ebx,                                  // call_data
-      ecx,                                  // holder
-      edx,                                  // api_function_address
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterDispatchDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      kInterpreterAccumulatorRegister, kInterpreterBytecodeOffsetRegister,
-      kInterpreterBytecodeArrayRegister, kInterpreterDispatchTableRegister};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterPushArgsThenCallDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      eax,  // argument count (not including receiver)
-      ebx,  // address of first argument
-      edi   // the target callable to be call
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterPushArgsThenConstructDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      eax,  // argument count (not including receiver)
-      edx,  // new target
-      edi,  // constructor
-      ebx,  // allocation site feedback
-      ecx,  // address of first argument
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterCEntryDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      eax,  // argument count (argc)
-      ecx,  // address of first argument (argv)
-      ebx   // the runtime function to call
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ResumeGeneratorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      eax,  // the value to pass to the generator
-      edx   // the JSGeneratorObject to resume
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void FrameDropperTrampolineDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      ebx,  // loaded new FP
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_IA32
diff --git a/src/v8/src/ia32/macro-assembler-ia32.cc b/src/v8/src/ia32/macro-assembler-ia32.cc
deleted file mode 100644
index ebc8b39..0000000
--- a/src/v8/src/ia32/macro-assembler-ia32.cc
+++ /dev/null
@@ -1,1602 +0,0 @@
-// Copyright 2012 the V8 project 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 V8_TARGET_ARCH_IA32
-
-#include "src/base/bits.h"
-#include "src/base/division-by-constant.h"
-#include "src/base/utils/random-number-generator.h"
-#include "src/bootstrapper.h"
-#include "src/callable.h"
-#include "src/code-stubs.h"
-#include "src/debug/debug.h"
-#include "src/external-reference-table.h"
-#include "src/frame-constants.h"
-#include "src/frames-inl.h"
-#include "src/runtime/runtime.h"
-
-#include "src/ia32/assembler-ia32-inl.h"
-#include "src/ia32/macro-assembler-ia32.h"
-
-namespace v8 {
-namespace internal {
-
-// -------------------------------------------------------------------------
-// MacroAssembler implementation.
-
-MacroAssembler::MacroAssembler(Isolate* isolate, void* buffer, int size,
-                               CodeObjectRequired create_code_object)
-    : TurboAssembler(isolate, buffer, size, create_code_object) {}
-
-TurboAssembler::TurboAssembler(Isolate* isolate, void* buffer, int buffer_size,
-                               CodeObjectRequired create_code_object)
-    : Assembler(isolate, buffer, buffer_size), isolate_(isolate) {
-  if (create_code_object == CodeObjectRequired::kYes) {
-    code_object_ =
-        Handle<HeapObject>::New(isolate->heap()->undefined_value(), isolate);
-  }
-}
-
-void MacroAssembler::LoadRoot(Register destination, Heap::RootListIndex index) {
-  if (isolate()->heap()->RootCanBeTreatedAsConstant(index)) {
-    Handle<Object> object = isolate()->heap()->root_handle(index);
-    if (object->IsHeapObject()) {
-      mov(destination, Handle<HeapObject>::cast(object));
-    } else {
-      mov(destination, Immediate(Smi::cast(*object)));
-    }
-    return;
-  }
-  ExternalReference roots_array_start =
-      ExternalReference::roots_array_start(isolate());
-  mov(destination, Immediate(index));
-  mov(destination, Operand::StaticArray(destination,
-                                        times_pointer_size,
-                                        roots_array_start));
-}
-
-
-void MacroAssembler::CompareRoot(Register with,
-                                 Register scratch,
-                                 Heap::RootListIndex index) {
-  ExternalReference roots_array_start =
-      ExternalReference::roots_array_start(isolate());
-  mov(scratch, Immediate(index));
-  cmp(with, Operand::StaticArray(scratch,
-                                times_pointer_size,
-                                roots_array_start));
-}
-
-
-void MacroAssembler::CompareRoot(Register with, Heap::RootListIndex index) {
-  DCHECK(isolate()->heap()->RootCanBeTreatedAsConstant(index));
-  Handle<Object> object = isolate()->heap()->root_handle(index);
-  if (object->IsHeapObject()) {
-    cmp(with, Handle<HeapObject>::cast(object));
-  } else {
-    cmp(with, Immediate(Smi::cast(*object)));
-  }
-}
-
-
-void MacroAssembler::CompareRoot(const Operand& with,
-                                 Heap::RootListIndex index) {
-  DCHECK(isolate()->heap()->RootCanBeTreatedAsConstant(index));
-  Handle<Object> object = isolate()->heap()->root_handle(index);
-  if (object->IsHeapObject()) {
-    cmp(with, Handle<HeapObject>::cast(object));
-  } else {
-    cmp(with, Immediate(Smi::cast(*object)));
-  }
-}
-
-void MacroAssembler::PushRoot(Heap::RootListIndex index) {
-  DCHECK(isolate()->heap()->RootCanBeTreatedAsConstant(index));
-  Handle<Object> object = isolate()->heap()->root_handle(index);
-  if (object->IsHeapObject()) {
-    Push(Handle<HeapObject>::cast(object));
-  } else {
-    Push(Smi::cast(*object));
-  }
-}
-
-static constexpr Register saved_regs[] = {eax, ecx, edx};
-
-static constexpr int kNumberOfSavedRegs = sizeof(saved_regs) / sizeof(Register);
-
-int TurboAssembler::RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode,
-                                                    Register exclusion1,
-                                                    Register exclusion2,
-                                                    Register exclusion3) const {
-  int bytes = 0;
-  for (int i = 0; i < kNumberOfSavedRegs; i++) {
-    Register reg = saved_regs[i];
-    if (reg != exclusion1 && reg != exclusion2 && reg != exclusion3) {
-      bytes += kPointerSize;
-    }
-  }
-
-  if (fp_mode == kSaveFPRegs) {
-    // Count all XMM registers except XMM0.
-    bytes += kDoubleSize * (XMMRegister::kNumRegisters - 1);
-  }
-
-  return bytes;
-}
-
-int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
-                                    Register exclusion2, Register exclusion3) {
-  // We don't allow a GC during a store buffer overflow so there is no need to
-  // store the registers in any particular way, but we do have to store and
-  // restore them.
-  int bytes = 0;
-  for (int i = 0; i < kNumberOfSavedRegs; i++) {
-    Register reg = saved_regs[i];
-    if (reg != exclusion1 && reg != exclusion2 && reg != exclusion3) {
-      push(reg);
-      bytes += kPointerSize;
-    }
-  }
-
-  if (fp_mode == kSaveFPRegs) {
-    // Save all XMM registers except XMM0.
-    int delta = kDoubleSize * (XMMRegister::kNumRegisters - 1);
-    sub(esp, Immediate(delta));
-    for (int i = XMMRegister::kNumRegisters - 1; i > 0; i--) {
-      XMMRegister reg = XMMRegister::from_code(i);
-      movsd(Operand(esp, (i - 1) * kDoubleSize), reg);
-    }
-    bytes += delta;
-  }
-
-  return bytes;
-}
-
-int TurboAssembler::PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
-                                   Register exclusion2, Register exclusion3) {
-  int bytes = 0;
-  if (fp_mode == kSaveFPRegs) {
-    // Restore all XMM registers except XMM0.
-    int delta = kDoubleSize * (XMMRegister::kNumRegisters - 1);
-    for (int i = XMMRegister::kNumRegisters - 1; i > 0; i--) {
-      XMMRegister reg = XMMRegister::from_code(i);
-      movsd(reg, Operand(esp, (i - 1) * kDoubleSize));
-    }
-    add(esp, Immediate(delta));
-    bytes += delta;
-  }
-
-  for (int i = kNumberOfSavedRegs - 1; i >= 0; i--) {
-    Register reg = saved_regs[i];
-    if (reg != exclusion1 && reg != exclusion2 && reg != exclusion3) {
-      pop(reg);
-      bytes += kPointerSize;
-    }
-  }
-
-  return bytes;
-}
-
-void TurboAssembler::SlowTruncateToIDelayed(Zone* zone, Register result_reg) {
-  CallStubDelayed(new (zone) DoubleToIStub(nullptr, result_reg));
-}
-
-void MacroAssembler::DoubleToI(Register result_reg, XMMRegister input_reg,
-                               XMMRegister scratch,
-                               MinusZeroMode minus_zero_mode,
-                               Label* lost_precision, Label* is_nan,
-                               Label* minus_zero, Label::Distance dst) {
-  DCHECK(input_reg != scratch);
-  cvttsd2si(result_reg, Operand(input_reg));
-  Cvtsi2sd(scratch, Operand(result_reg));
-  ucomisd(scratch, input_reg);
-  j(not_equal, lost_precision, dst);
-  j(parity_even, is_nan, dst);
-  if (minus_zero_mode == FAIL_ON_MINUS_ZERO) {
-    Label done;
-    // The integer converted back is equal to the original. We
-    // only have to test if we got -0 as an input.
-    test(result_reg, Operand(result_reg));
-    j(not_zero, &done, Label::kNear);
-    movmskpd(result_reg, input_reg);
-    // Bit 0 contains the sign of the double in input_reg.
-    // If input was positive, we are ok and return 0, otherwise
-    // jump to minus_zero.
-    and_(result_reg, 1);
-    j(not_zero, minus_zero, dst);
-    bind(&done);
-  }
-}
-
-void TurboAssembler::LoadUint32(XMMRegister dst, const Operand& src) {
-  Label done;
-  cmp(src, Immediate(0));
-  ExternalReference uint32_bias = ExternalReference::address_of_uint32_bias();
-  Cvtsi2sd(dst, src);
-  j(not_sign, &done, Label::kNear);
-  addsd(dst, Operand::StaticVariable(uint32_bias));
-  bind(&done);
-}
-
-void MacroAssembler::RecordWriteField(Register object, int offset,
-                                      Register value, Register dst,
-                                      SaveFPRegsMode save_fp,
-                                      RememberedSetAction remembered_set_action,
-                                      SmiCheck smi_check) {
-  // First, check if a write barrier is even needed. The tests below
-  // catch stores of Smis.
-  Label done;
-
-  // Skip barrier if writing a smi.
-  if (smi_check == INLINE_SMI_CHECK) {
-    JumpIfSmi(value, &done, Label::kNear);
-  }
-
-  // Although the object register is tagged, the offset is relative to the start
-  // of the object, so so offset must be a multiple of kPointerSize.
-  DCHECK(IsAligned(offset, kPointerSize));
-
-  lea(dst, FieldOperand(object, offset));
-  if (emit_debug_code()) {
-    Label ok;
-    test_b(dst, Immediate(kPointerSize - 1));
-    j(zero, &ok, Label::kNear);
-    int3();
-    bind(&ok);
-  }
-
-  RecordWrite(object, dst, value, save_fp, remembered_set_action,
-              OMIT_SMI_CHECK);
-
-  bind(&done);
-
-  // Clobber clobbered input registers when running with the debug-code flag
-  // turned on to provoke errors.
-  if (emit_debug_code()) {
-    mov(value, Immediate(bit_cast<int32_t>(kZapValue)));
-    mov(dst, Immediate(bit_cast<int32_t>(kZapValue)));
-  }
-}
-
-void TurboAssembler::SaveRegisters(RegList registers) {
-  DCHECK_GT(NumRegs(registers), 0);
-  for (int i = 0; i < Register::kNumRegisters; ++i) {
-    if ((registers >> i) & 1u) {
-      push(Register::from_code(i));
-    }
-  }
-}
-
-void TurboAssembler::RestoreRegisters(RegList registers) {
-  DCHECK_GT(NumRegs(registers), 0);
-  for (int i = Register::kNumRegisters - 1; i >= 0; --i) {
-    if ((registers >> i) & 1u) {
-      pop(Register::from_code(i));
-    }
-  }
-}
-
-void TurboAssembler::CallRecordWriteStub(
-    Register object, Register address,
-    RememberedSetAction remembered_set_action, SaveFPRegsMode fp_mode) {
-  // TODO(albertnetymk): For now we ignore remembered_set_action and fp_mode,
-  // i.e. always emit remember set and save FP registers in RecordWriteStub. If
-  // large performance regression is observed, we should use these values to
-  // avoid unnecessary work.
-
-  Callable const callable =
-      Builtins::CallableFor(isolate(), Builtins::kRecordWrite);
-  RegList registers = callable.descriptor().allocatable_registers();
-
-  SaveRegisters(registers);
-
-  Register object_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kObject));
-  Register slot_parameter(
-      callable.descriptor().GetRegisterParameter(RecordWriteDescriptor::kSlot));
-  Register isolate_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kIsolate));
-  Register remembered_set_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kRememberedSet));
-  Register fp_mode_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kFPMode));
-
-  push(object);
-  push(address);
-
-  pop(slot_parameter);
-  pop(object_parameter);
-
-  mov(isolate_parameter,
-      Immediate(ExternalReference::isolate_address(isolate())));
-  Move(remembered_set_parameter, Smi::FromEnum(remembered_set_action));
-  Move(fp_mode_parameter, Smi::FromEnum(fp_mode));
-  Call(callable.code(), RelocInfo::CODE_TARGET);
-
-  RestoreRegisters(registers);
-}
-
-void MacroAssembler::RecordWrite(Register object, Register address,
-                                 Register value, SaveFPRegsMode fp_mode,
-                                 RememberedSetAction remembered_set_action,
-                                 SmiCheck smi_check) {
-  DCHECK(object != value);
-  DCHECK(object != address);
-  DCHECK(value != address);
-  AssertNotSmi(object);
-
-  if (remembered_set_action == OMIT_REMEMBERED_SET &&
-      !FLAG_incremental_marking) {
-    return;
-  }
-
-  if (emit_debug_code()) {
-    Label ok;
-    cmp(value, Operand(address, 0));
-    j(equal, &ok, Label::kNear);
-    int3();
-    bind(&ok);
-  }
-
-  // First, check if a write barrier is even needed. The tests below
-  // catch stores of Smis and stores into young gen.
-  Label done;
-
-  if (smi_check == INLINE_SMI_CHECK) {
-    // Skip barrier if writing a smi.
-    JumpIfSmi(value, &done, Label::kNear);
-  }
-
-  CheckPageFlag(value,
-                value,  // Used as scratch.
-                MemoryChunk::kPointersToHereAreInterestingMask, zero, &done,
-                Label::kNear);
-  CheckPageFlag(object,
-                value,  // Used as scratch.
-                MemoryChunk::kPointersFromHereAreInterestingMask,
-                zero,
-                &done,
-                Label::kNear);
-
-  CallRecordWriteStub(object, address, remembered_set_action, fp_mode);
-
-  bind(&done);
-
-  // Count number of write barriers in generated code.
-  isolate()->counters()->write_barriers_static()->Increment();
-  IncrementCounter(isolate()->counters()->write_barriers_dynamic(), 1);
-
-  // Clobber clobbered registers when running with the debug-code flag
-  // turned on to provoke errors.
-  if (emit_debug_code()) {
-    mov(address, Immediate(bit_cast<int32_t>(kZapValue)));
-    mov(value, Immediate(bit_cast<int32_t>(kZapValue)));
-  }
-}
-
-void MacroAssembler::MaybeDropFrames() {
-  // Check whether we need to drop frames to restart a function on the stack.
-  ExternalReference restart_fp =
-      ExternalReference::debug_restart_fp_address(isolate());
-  mov(ebx, Operand::StaticVariable(restart_fp));
-  test(ebx, ebx);
-  j(not_zero, BUILTIN_CODE(isolate(), FrameDropperTrampoline),
-    RelocInfo::CODE_TARGET);
-}
-
-void TurboAssembler::Cvtsi2sd(XMMRegister dst, const Operand& src) {
-  xorps(dst, dst);
-  cvtsi2sd(dst, src);
-}
-
-void TurboAssembler::Cvtui2ss(XMMRegister dst, Register src, Register tmp) {
-  Label msb_set_src;
-  Label jmp_return;
-  test(src, src);
-  j(sign, &msb_set_src, Label::kNear);
-  cvtsi2ss(dst, src);
-  jmp(&jmp_return, Label::kNear);
-  bind(&msb_set_src);
-  mov(tmp, src);
-  shr(src, 1);
-  // Recover the least significant bit to avoid rounding errors.
-  and_(tmp, Immediate(1));
-  or_(src, tmp);
-  cvtsi2ss(dst, src);
-  addss(dst, dst);
-  bind(&jmp_return);
-}
-
-void TurboAssembler::ShlPair(Register high, Register low, uint8_t shift) {
-  if (shift >= 32) {
-    mov(high, low);
-    shl(high, shift - 32);
-    xor_(low, low);
-  } else {
-    shld(high, low, shift);
-    shl(low, shift);
-  }
-}
-
-void TurboAssembler::ShlPair_cl(Register high, Register low) {
-  shld_cl(high, low);
-  shl_cl(low);
-  Label done;
-  test(ecx, Immediate(0x20));
-  j(equal, &done, Label::kNear);
-  mov(high, low);
-  xor_(low, low);
-  bind(&done);
-}
-
-void TurboAssembler::ShrPair(Register high, Register low, uint8_t shift) {
-  if (shift >= 32) {
-    mov(low, high);
-    shr(low, shift - 32);
-    xor_(high, high);
-  } else {
-    shrd(high, low, shift);
-    shr(high, shift);
-  }
-}
-
-void TurboAssembler::ShrPair_cl(Register high, Register low) {
-  shrd_cl(low, high);
-  shr_cl(high);
-  Label done;
-  test(ecx, Immediate(0x20));
-  j(equal, &done, Label::kNear);
-  mov(low, high);
-  xor_(high, high);
-  bind(&done);
-}
-
-void TurboAssembler::SarPair(Register high, Register low, uint8_t shift) {
-  if (shift >= 32) {
-    mov(low, high);
-    sar(low, shift - 32);
-    sar(high, 31);
-  } else {
-    shrd(high, low, shift);
-    sar(high, shift);
-  }
-}
-
-void TurboAssembler::SarPair_cl(Register high, Register low) {
-  shrd_cl(low, high);
-  sar_cl(high);
-  Label done;
-  test(ecx, Immediate(0x20));
-  j(equal, &done, Label::kNear);
-  mov(low, high);
-  sar(high, 31);
-  bind(&done);
-}
-
-void MacroAssembler::CmpObjectType(Register heap_object,
-                                   InstanceType type,
-                                   Register map) {
-  mov(map, FieldOperand(heap_object, HeapObject::kMapOffset));
-  CmpInstanceType(map, type);
-}
-
-
-void MacroAssembler::CmpInstanceType(Register map, InstanceType type) {
-  cmpw(FieldOperand(map, Map::kInstanceTypeOffset), Immediate(type));
-}
-
-void MacroAssembler::AssertSmi(Register object) {
-  if (emit_debug_code()) {
-    test(object, Immediate(kSmiTagMask));
-    Check(equal, AbortReason::kOperandIsNotASmi);
-  }
-}
-
-void MacroAssembler::AssertFixedArray(Register object) {
-  if (emit_debug_code()) {
-    test(object, Immediate(kSmiTagMask));
-    Check(not_equal, AbortReason::kOperandIsASmiAndNotAFixedArray);
-    Push(object);
-    CmpObjectType(object, FIXED_ARRAY_TYPE, object);
-    Pop(object);
-    Check(equal, AbortReason::kOperandIsNotAFixedArray);
-  }
-}
-
-void MacroAssembler::AssertFunction(Register object) {
-  if (emit_debug_code()) {
-    test(object, Immediate(kSmiTagMask));
-    Check(not_equal, AbortReason::kOperandIsASmiAndNotAFunction);
-    Push(object);
-    CmpObjectType(object, JS_FUNCTION_TYPE, object);
-    Pop(object);
-    Check(equal, AbortReason::kOperandIsNotAFunction);
-  }
-}
-
-
-void MacroAssembler::AssertBoundFunction(Register object) {
-  if (emit_debug_code()) {
-    test(object, Immediate(kSmiTagMask));
-    Check(not_equal, AbortReason::kOperandIsASmiAndNotABoundFunction);
-    Push(object);
-    CmpObjectType(object, JS_BOUND_FUNCTION_TYPE, object);
-    Pop(object);
-    Check(equal, AbortReason::kOperandIsNotABoundFunction);
-  }
-}
-
-void MacroAssembler::AssertGeneratorObject(Register object) {
-  if (!emit_debug_code()) return;
-
-  test(object, Immediate(kSmiTagMask));
-  Check(not_equal, AbortReason::kOperandIsASmiAndNotAGeneratorObject);
-
-  {
-    Push(object);
-    Register map = object;
-
-    // Load map
-    mov(map, FieldOperand(object, HeapObject::kMapOffset));
-
-    Label do_check;
-    // Check if JSGeneratorObject
-    CmpInstanceType(map, JS_GENERATOR_OBJECT_TYPE);
-    j(equal, &do_check, Label::kNear);
-
-    // Check if JSAsyncGeneratorObject
-    CmpInstanceType(map, JS_ASYNC_GENERATOR_OBJECT_TYPE);
-
-    bind(&do_check);
-    Pop(object);
-  }
-
-  Check(equal, AbortReason::kOperandIsNotAGeneratorObject);
-}
-
-void MacroAssembler::AssertUndefinedOrAllocationSite(Register object) {
-  if (emit_debug_code()) {
-    Label done_checking;
-    AssertNotSmi(object);
-    cmp(object, isolate()->factory()->undefined_value());
-    j(equal, &done_checking);
-    cmp(FieldOperand(object, 0),
-        Immediate(isolate()->factory()->allocation_site_map()));
-    Assert(equal, AbortReason::kExpectedUndefinedOrCell);
-    bind(&done_checking);
-  }
-}
-
-
-void MacroAssembler::AssertNotSmi(Register object) {
-  if (emit_debug_code()) {
-    test(object, Immediate(kSmiTagMask));
-    Check(not_equal, AbortReason::kOperandIsASmi);
-  }
-}
-
-void TurboAssembler::StubPrologue(StackFrame::Type type) {
-  push(ebp);  // Caller's frame pointer.
-  mov(ebp, esp);
-  push(Immediate(StackFrame::TypeToMarker(type)));
-}
-
-void TurboAssembler::Prologue() {
-  push(ebp);  // Caller's frame pointer.
-  mov(ebp, esp);
-  push(esi);  // Callee's context.
-  push(edi);  // Callee's JS function.
-}
-
-void TurboAssembler::EnterFrame(StackFrame::Type type) {
-  push(ebp);
-  mov(ebp, esp);
-  push(Immediate(StackFrame::TypeToMarker(type)));
-  if (type == StackFrame::INTERNAL) {
-    push(Immediate(CodeObject()));
-  }
-  if (emit_debug_code()) {
-    cmp(Operand(esp, 0), Immediate(isolate()->factory()->undefined_value()));
-    Check(not_equal, AbortReason::kCodeObjectNotProperlyPatched);
-  }
-}
-
-void TurboAssembler::LeaveFrame(StackFrame::Type type) {
-  if (emit_debug_code()) {
-    cmp(Operand(ebp, CommonFrameConstants::kContextOrFrameTypeOffset),
-        Immediate(StackFrame::TypeToMarker(type)));
-    Check(equal, AbortReason::kStackFrameTypesMustMatch);
-  }
-  leave();
-}
-
-void MacroAssembler::EnterBuiltinFrame(Register context, Register target,
-                                       Register argc) {
-  Push(ebp);
-  Move(ebp, esp);
-  Push(context);
-  Push(target);
-  Push(argc);
-}
-
-void MacroAssembler::LeaveBuiltinFrame(Register context, Register target,
-                                       Register argc) {
-  Pop(argc);
-  Pop(target);
-  Pop(context);
-  leave();
-}
-
-void MacroAssembler::EnterExitFramePrologue(StackFrame::Type frame_type) {
-  DCHECK(frame_type == StackFrame::EXIT ||
-         frame_type == StackFrame::BUILTIN_EXIT);
-
-  // Set up the frame structure on the stack.
-  DCHECK_EQ(+2 * kPointerSize, ExitFrameConstants::kCallerSPDisplacement);
-  DCHECK_EQ(+1 * kPointerSize, ExitFrameConstants::kCallerPCOffset);
-  DCHECK_EQ(0 * kPointerSize, ExitFrameConstants::kCallerFPOffset);
-  push(ebp);
-  mov(ebp, esp);
-
-  // Reserve room for entry stack pointer and push the code object.
-  push(Immediate(StackFrame::TypeToMarker(frame_type)));
-  DCHECK_EQ(-2 * kPointerSize, ExitFrameConstants::kSPOffset);
-  push(Immediate(0));  // Saved entry sp, patched before call.
-  DCHECK_EQ(-3 * kPointerSize, ExitFrameConstants::kCodeOffset);
-  push(Immediate(CodeObject()));  // Accessed from ExitFrame::code_slot.
-
-  // Save the frame pointer and the context in top.
-  ExternalReference c_entry_fp_address(IsolateAddressId::kCEntryFPAddress,
-                                       isolate());
-  ExternalReference context_address(IsolateAddressId::kContextAddress,
-                                    isolate());
-  ExternalReference c_function_address(IsolateAddressId::kCFunctionAddress,
-                                       isolate());
-  mov(Operand::StaticVariable(c_entry_fp_address), ebp);
-  mov(Operand::StaticVariable(context_address), esi);
-  mov(Operand::StaticVariable(c_function_address), ebx);
-}
-
-
-void MacroAssembler::EnterExitFrameEpilogue(int argc, bool save_doubles) {
-  // Optionally save all XMM registers.
-  if (save_doubles) {
-    int space = XMMRegister::kNumRegisters * kDoubleSize + argc * kPointerSize;
-    sub(esp, Immediate(space));
-    const int offset = -ExitFrameConstants::kFixedFrameSizeFromFp;
-    for (int i = 0; i < XMMRegister::kNumRegisters; i++) {
-      XMMRegister reg = XMMRegister::from_code(i);
-      movsd(Operand(ebp, offset - ((i + 1) * kDoubleSize)), reg);
-    }
-  } else {
-    sub(esp, Immediate(argc * kPointerSize));
-  }
-
-  // Get the required frame alignment for the OS.
-  const int kFrameAlignment = base::OS::ActivationFrameAlignment();
-  if (kFrameAlignment > 0) {
-    DCHECK(base::bits::IsPowerOfTwo(kFrameAlignment));
-    and_(esp, -kFrameAlignment);
-  }
-
-  // Patch the saved entry sp.
-  mov(Operand(ebp, ExitFrameConstants::kSPOffset), esp);
-}
-
-void MacroAssembler::EnterExitFrame(int argc, bool save_doubles,
-                                    StackFrame::Type frame_type) {
-  EnterExitFramePrologue(frame_type);
-
-  // Set up argc and argv in callee-saved registers.
-  int offset = StandardFrameConstants::kCallerSPOffset - kPointerSize;
-  mov(edi, eax);
-  lea(esi, Operand(ebp, eax, times_4, offset));
-
-  // Reserve space for argc, argv and isolate.
-  EnterExitFrameEpilogue(argc, save_doubles);
-}
-
-
-void MacroAssembler::EnterApiExitFrame(int argc) {
-  EnterExitFramePrologue(StackFrame::EXIT);
-  EnterExitFrameEpilogue(argc, false);
-}
-
-
-void MacroAssembler::LeaveExitFrame(bool save_doubles, bool pop_arguments) {
-  // Optionally restore all XMM registers.
-  if (save_doubles) {
-    const int offset = -ExitFrameConstants::kFixedFrameSizeFromFp;
-    for (int i = 0; i < XMMRegister::kNumRegisters; i++) {
-      XMMRegister reg = XMMRegister::from_code(i);
-      movsd(reg, Operand(ebp, offset - ((i + 1) * kDoubleSize)));
-    }
-  }
-
-  if (pop_arguments) {
-    // Get the return address from the stack and restore the frame pointer.
-    mov(ecx, Operand(ebp, 1 * kPointerSize));
-    mov(ebp, Operand(ebp, 0 * kPointerSize));
-
-    // Pop the arguments and the receiver from the caller stack.
-    lea(esp, Operand(esi, 1 * kPointerSize));
-
-    // Push the return address to get ready to return.
-    push(ecx);
-  } else {
-    // Otherwise just leave the exit frame.
-    leave();
-  }
-
-  LeaveExitFrameEpilogue();
-}
-
-void MacroAssembler::LeaveExitFrameEpilogue() {
-  // Restore current context from top and clear it in debug mode.
-  ExternalReference context_address(IsolateAddressId::kContextAddress,
-                                    isolate());
-  mov(esi, Operand::StaticVariable(context_address));
-#ifdef DEBUG
-  mov(Operand::StaticVariable(context_address),
-      Immediate(Context::kInvalidContext));
-#endif
-
-  // Clear the top frame.
-  ExternalReference c_entry_fp_address(IsolateAddressId::kCEntryFPAddress,
-                                       isolate());
-  mov(Operand::StaticVariable(c_entry_fp_address), Immediate(0));
-}
-
-void MacroAssembler::LeaveApiExitFrame() {
-  mov(esp, ebp);
-  pop(ebp);
-
-  LeaveExitFrameEpilogue();
-}
-
-
-void MacroAssembler::PushStackHandler() {
-  // Adjust this code if not the case.
-  STATIC_ASSERT(StackHandlerConstants::kSize == 2 * kPointerSize);
-  STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
-
-  push(Immediate(0));  // Padding.
-
-  // Link the current handler as the next handler.
-  ExternalReference handler_address(IsolateAddressId::kHandlerAddress,
-                                    isolate());
-  push(Operand::StaticVariable(handler_address));
-
-  // Set this new handler as the current one.
-  mov(Operand::StaticVariable(handler_address), esp);
-}
-
-
-void MacroAssembler::PopStackHandler() {
-  STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
-  ExternalReference handler_address(IsolateAddressId::kHandlerAddress,
-                                    isolate());
-  pop(Operand::StaticVariable(handler_address));
-  add(esp, Immediate(StackHandlerConstants::kSize - kPointerSize));
-}
-
-
-void MacroAssembler::CallStub(CodeStub* stub) {
-  DCHECK(AllowThisStubCall(stub));  // Calls are not allowed in some stubs.
-  call(stub->GetCode(), RelocInfo::CODE_TARGET);
-}
-
-void TurboAssembler::CallStubDelayed(CodeStub* stub) {
-  DCHECK(AllowThisStubCall(stub));  // Calls are not allowed in some stubs.
-  call(stub);
-}
-
-void MacroAssembler::TailCallStub(CodeStub* stub) {
-  jmp(stub->GetCode(), RelocInfo::CODE_TARGET);
-}
-
-bool TurboAssembler::AllowThisStubCall(CodeStub* stub) {
-  return has_frame() || !stub->SometimesSetsUpAFrame();
-}
-
-void MacroAssembler::CallRuntime(const Runtime::Function* f,
-                                 int num_arguments,
-                                 SaveFPRegsMode save_doubles) {
-  // If the expected number of arguments of the runtime function is
-  // constant, we check that the actual number of arguments match the
-  // expectation.
-  CHECK(f->nargs < 0 || f->nargs == num_arguments);
-
-  // TODO(1236192): Most runtime routines don't need the number of
-  // arguments passed in because it is constant. At some point we
-  // should remove this need and make the runtime routine entry code
-  // smarter.
-  Move(eax, Immediate(num_arguments));
-  mov(ebx, Immediate(ExternalReference(f, isolate())));
-  CEntryStub ces(isolate(), 1, save_doubles);
-  CallStub(&ces);
-}
-
-void TurboAssembler::CallRuntimeDelayed(Zone* zone, Runtime::FunctionId fid,
-                                        SaveFPRegsMode save_doubles) {
-  const Runtime::Function* f = Runtime::FunctionForId(fid);
-  // TODO(1236192): Most runtime routines don't need the number of
-  // arguments passed in because it is constant. At some point we
-  // should remove this need and make the runtime routine entry code
-  // smarter.
-  Move(eax, Immediate(f->nargs));
-  mov(ebx, Immediate(ExternalReference(f, isolate())));
-  CallStubDelayed(new (zone) CEntryStub(nullptr, 1, save_doubles));
-}
-
-void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid) {
-  // ----------- S t a t e -------------
-  //  -- esp[0]                 : return address
-  //  -- esp[8]                 : argument num_arguments - 1
-  //  ...
-  //  -- esp[8 * num_arguments] : argument 0 (receiver)
-  //
-  //  For runtime functions with variable arguments:
-  //  -- eax                    : number of  arguments
-  // -----------------------------------
-
-  const Runtime::Function* function = Runtime::FunctionForId(fid);
-  DCHECK_EQ(1, function->result_size);
-  if (function->nargs >= 0) {
-    // TODO(1236192): Most runtime routines don't need the number of
-    // arguments passed in because it is constant. At some point we
-    // should remove this need and make the runtime routine entry code
-    // smarter.
-    mov(eax, Immediate(function->nargs));
-  }
-  JumpToExternalReference(ExternalReference(fid, isolate()));
-}
-
-void MacroAssembler::JumpToExternalReference(const ExternalReference& ext,
-                                             bool builtin_exit_frame) {
-  // Set the entry point and jump to the C entry runtime stub.
-  mov(ebx, Immediate(ext));
-  CEntryStub ces(isolate(), 1, kDontSaveFPRegs, kArgvOnStack,
-                 builtin_exit_frame);
-  jmp(ces.GetCode(), RelocInfo::CODE_TARGET);
-}
-
-void TurboAssembler::PrepareForTailCall(
-    const ParameterCount& callee_args_count, Register caller_args_count_reg,
-    Register scratch0, Register scratch1,
-    int number_of_temp_values_after_return_address) {
-#if DEBUG
-  if (callee_args_count.is_reg()) {
-    DCHECK(!AreAliased(callee_args_count.reg(), caller_args_count_reg, scratch0,
-                       scratch1));
-  } else {
-    DCHECK(!AreAliased(caller_args_count_reg, scratch0, scratch1));
-  }
-#endif
-
-  // Calculate the destination address where we will put the return address
-  // after we drop current frame.
-  Register new_sp_reg = scratch0;
-  if (callee_args_count.is_reg()) {
-    sub(caller_args_count_reg, callee_args_count.reg());
-    lea(new_sp_reg,
-        Operand(ebp, caller_args_count_reg, times_pointer_size,
-                StandardFrameConstants::kCallerPCOffset -
-                    number_of_temp_values_after_return_address * kPointerSize));
-  } else {
-    lea(new_sp_reg, Operand(ebp, caller_args_count_reg, times_pointer_size,
-                            StandardFrameConstants::kCallerPCOffset -
-                                (callee_args_count.immediate() +
-                                 number_of_temp_values_after_return_address) *
-                                    kPointerSize));
-  }
-
-  if (FLAG_debug_code) {
-    cmp(esp, new_sp_reg);
-    Check(below, AbortReason::kStackAccessBelowStackPointer);
-  }
-
-  // Copy return address from caller's frame to current frame's return address
-  // to avoid its trashing and let the following loop copy it to the right
-  // place.
-  Register tmp_reg = scratch1;
-  mov(tmp_reg, Operand(ebp, StandardFrameConstants::kCallerPCOffset));
-  mov(Operand(esp, number_of_temp_values_after_return_address * kPointerSize),
-      tmp_reg);
-
-  // Restore caller's frame pointer now as it could be overwritten by
-  // the copying loop.
-  mov(ebp, Operand(ebp, StandardFrameConstants::kCallerFPOffset));
-
-  // +2 here is to copy both receiver and return address.
-  Register count_reg = caller_args_count_reg;
-  if (callee_args_count.is_reg()) {
-    lea(count_reg, Operand(callee_args_count.reg(),
-                           2 + number_of_temp_values_after_return_address));
-  } else {
-    mov(count_reg, Immediate(callee_args_count.immediate() + 2 +
-                             number_of_temp_values_after_return_address));
-    // TODO(ishell): Unroll copying loop for small immediate values.
-  }
-
-  // Now copy callee arguments to the caller frame going backwards to avoid
-  // callee arguments corruption (source and destination areas could overlap).
-  Label loop, entry;
-  jmp(&entry, Label::kNear);
-  bind(&loop);
-  dec(count_reg);
-  mov(tmp_reg, Operand(esp, count_reg, times_pointer_size, 0));
-  mov(Operand(new_sp_reg, count_reg, times_pointer_size, 0), tmp_reg);
-  bind(&entry);
-  cmp(count_reg, Immediate(0));
-  j(not_equal, &loop, Label::kNear);
-
-  // Leave current frame.
-  mov(esp, new_sp_reg);
-}
-
-void MacroAssembler::InvokePrologue(const ParameterCount& expected,
-                                    const ParameterCount& actual, Label* done,
-                                    bool* definitely_mismatches,
-                                    InvokeFlag flag,
-                                    Label::Distance done_near) {
-  bool definitely_matches = false;
-  *definitely_mismatches = false;
-  Label invoke;
-  if (expected.is_immediate()) {
-    DCHECK(actual.is_immediate());
-    mov(eax, actual.immediate());
-    if (expected.immediate() == actual.immediate()) {
-      definitely_matches = true;
-    } else {
-      const int sentinel = SharedFunctionInfo::kDontAdaptArgumentsSentinel;
-      if (expected.immediate() == sentinel) {
-        // Don't worry about adapting arguments for builtins that
-        // don't want that done. Skip adaption code by making it look
-        // like we have a match between expected and actual number of
-        // arguments.
-        definitely_matches = true;
-      } else {
-        *definitely_mismatches = true;
-        mov(ebx, expected.immediate());
-      }
-    }
-  } else {
-    if (actual.is_immediate()) {
-      // Expected is in register, actual is immediate. This is the
-      // case when we invoke function values without going through the
-      // IC mechanism.
-      mov(eax, actual.immediate());
-      cmp(expected.reg(), actual.immediate());
-      j(equal, &invoke);
-      DCHECK(expected.reg() == ebx);
-    } else if (expected.reg() != actual.reg()) {
-      // Both expected and actual are in (different) registers. This
-      // is the case when we invoke functions using call and apply.
-      cmp(expected.reg(), actual.reg());
-      j(equal, &invoke);
-      DCHECK(actual.reg() == eax);
-      DCHECK(expected.reg() == ebx);
-    } else {
-      definitely_matches = true;
-      Move(eax, actual.reg());
-    }
-  }
-
-  if (!definitely_matches) {
-    Handle<Code> adaptor = BUILTIN_CODE(isolate(), ArgumentsAdaptorTrampoline);
-    if (flag == CALL_FUNCTION) {
-      call(adaptor, RelocInfo::CODE_TARGET);
-      if (!*definitely_mismatches) {
-        jmp(done, done_near);
-      }
-    } else {
-      jmp(adaptor, RelocInfo::CODE_TARGET);
-    }
-    bind(&invoke);
-  }
-}
-
-void MacroAssembler::CheckDebugHook(Register fun, Register new_target,
-                                    const ParameterCount& expected,
-                                    const ParameterCount& actual) {
-  Label skip_hook;
-  ExternalReference debug_hook_active =
-      ExternalReference::debug_hook_on_function_call_address(isolate());
-  cmpb(Operand::StaticVariable(debug_hook_active), Immediate(0));
-  j(equal, &skip_hook);
-  {
-    FrameScope frame(this,
-                     has_frame() ? StackFrame::NONE : StackFrame::INTERNAL);
-    if (expected.is_reg()) {
-      SmiTag(expected.reg());
-      Push(expected.reg());
-    }
-    if (actual.is_reg()) {
-      SmiTag(actual.reg());
-      Push(actual.reg());
-    }
-    if (new_target.is_valid()) {
-      Push(new_target);
-    }
-    Push(fun);
-    Push(fun);
-    CallRuntime(Runtime::kDebugOnFunctionCall);
-    Pop(fun);
-    if (new_target.is_valid()) {
-      Pop(new_target);
-    }
-    if (actual.is_reg()) {
-      Pop(actual.reg());
-      SmiUntag(actual.reg());
-    }
-    if (expected.is_reg()) {
-      Pop(expected.reg());
-      SmiUntag(expected.reg());
-    }
-  }
-  bind(&skip_hook);
-}
-
-void MacroAssembler::InvokeFunctionCode(Register function, Register new_target,
-                                        const ParameterCount& expected,
-                                        const ParameterCount& actual,
-                                        InvokeFlag flag) {
-  // You can't call a function without a valid frame.
-  DCHECK(flag == JUMP_FUNCTION || has_frame());
-  DCHECK(function == edi);
-  DCHECK_IMPLIES(new_target.is_valid(), new_target == edx);
-
-  // On function call, call into the debugger if necessary.
-  CheckDebugHook(function, new_target, expected, actual);
-
-  // Clear the new.target register if not given.
-  if (!new_target.is_valid()) {
-    mov(edx, isolate()->factory()->undefined_value());
-  }
-
-  Label done;
-  bool definitely_mismatches = false;
-  InvokePrologue(expected, actual, &done, &definitely_mismatches, flag,
-                 Label::kNear);
-  if (!definitely_mismatches) {
-    // We call indirectly through the code field in the function to
-    // allow recompilation to take effect without changing any of the
-    // call sites.
-    mov(ecx, FieldOperand(function, JSFunction::kCodeOffset));
-    add(ecx, Immediate(Code::kHeaderSize - kHeapObjectTag));
-    if (flag == CALL_FUNCTION) {
-      call(ecx);
-    } else {
-      DCHECK(flag == JUMP_FUNCTION);
-      jmp(ecx);
-    }
-    bind(&done);
-  }
-}
-
-void MacroAssembler::InvokeFunction(Register fun, Register new_target,
-                                    const ParameterCount& actual,
-                                    InvokeFlag flag) {
-  // You can't call a function without a valid frame.
-  DCHECK(flag == JUMP_FUNCTION || has_frame());
-
-  DCHECK(fun == edi);
-  mov(ebx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
-  mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
-  mov(ebx, FieldOperand(ebx, SharedFunctionInfo::kFormalParameterCountOffset));
-
-  ParameterCount expected(ebx);
-  InvokeFunctionCode(edi, new_target, expected, actual, flag);
-}
-
-void MacroAssembler::InvokeFunction(Register fun,
-                                    const ParameterCount& expected,
-                                    const ParameterCount& actual,
-                                    InvokeFlag flag) {
-  // You can't call a function without a valid frame.
-  DCHECK(flag == JUMP_FUNCTION || has_frame());
-
-  DCHECK(fun == edi);
-  mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
-
-  InvokeFunctionCode(edi, no_reg, expected, actual, flag);
-}
-
-void MacroAssembler::InvokeFunction(Handle<JSFunction> function,
-                                    const ParameterCount& expected,
-                                    const ParameterCount& actual,
-                                    InvokeFlag flag) {
-  Move(edi, function);
-  InvokeFunction(edi, expected, actual, flag);
-}
-
-void MacroAssembler::LoadGlobalProxy(Register dst) {
-  mov(dst, NativeContextOperand());
-  mov(dst, ContextOperand(dst, Context::GLOBAL_PROXY_INDEX));
-}
-
-void MacroAssembler::LoadGlobalFunction(int index, Register function) {
-  // Load the native context from the current context.
-  mov(function, NativeContextOperand());
-  // Load the function from the native context.
-  mov(function, ContextOperand(function, index));
-}
-
-int MacroAssembler::SafepointRegisterStackIndex(int reg_code) {
-  // The registers are pushed starting with the lowest encoding,
-  // which means that lowest encodings are furthest away from
-  // the stack pointer.
-  DCHECK(reg_code >= 0 && reg_code < kNumSafepointRegisters);
-  return kNumSafepointRegisters - reg_code - 1;
-}
-
-void TurboAssembler::Ret() { ret(0); }
-
-void TurboAssembler::Ret(int bytes_dropped, Register scratch) {
-  if (is_uint16(bytes_dropped)) {
-    ret(bytes_dropped);
-  } else {
-    pop(scratch);
-    add(esp, Immediate(bytes_dropped));
-    push(scratch);
-    ret(0);
-  }
-}
-
-
-void MacroAssembler::Drop(int stack_elements) {
-  if (stack_elements > 0) {
-    add(esp, Immediate(stack_elements * kPointerSize));
-  }
-}
-
-void TurboAssembler::Move(Register dst, Register src) {
-  if (dst != src) {
-    mov(dst, src);
-  }
-}
-
-void TurboAssembler::Move(Register dst, const Immediate& x) {
-  if (!x.is_heap_object_request() && x.is_zero() &&
-      RelocInfo::IsNone(x.rmode())) {
-    xor_(dst, dst);  // Shorter than mov of 32-bit immediate 0.
-  } else {
-    mov(dst, x);
-  }
-}
-
-void TurboAssembler::Move(const Operand& dst, const Immediate& x) {
-  mov(dst, x);
-}
-
-void TurboAssembler::Move(Register dst, Handle<HeapObject> object) {
-  mov(dst, object);
-}
-
-void TurboAssembler::Move(XMMRegister dst, uint32_t src) {
-  if (src == 0) {
-    pxor(dst, dst);
-  } else {
-    unsigned cnt = base::bits::CountPopulation(src);
-    unsigned nlz = base::bits::CountLeadingZeros32(src);
-    unsigned ntz = base::bits::CountTrailingZeros32(src);
-    if (nlz + cnt + ntz == 32) {
-      pcmpeqd(dst, dst);
-      if (ntz == 0) {
-        psrld(dst, 32 - cnt);
-      } else {
-        pslld(dst, 32 - cnt);
-        if (nlz != 0) psrld(dst, nlz);
-      }
-    } else {
-      push(eax);
-      mov(eax, Immediate(src));
-      movd(dst, Operand(eax));
-      pop(eax);
-    }
-  }
-}
-
-void TurboAssembler::Move(XMMRegister dst, uint64_t src) {
-  if (src == 0) {
-    pxor(dst, dst);
-  } else {
-    uint32_t lower = static_cast<uint32_t>(src);
-    uint32_t upper = static_cast<uint32_t>(src >> 32);
-    unsigned cnt = base::bits::CountPopulation(src);
-    unsigned nlz = base::bits::CountLeadingZeros64(src);
-    unsigned ntz = base::bits::CountTrailingZeros64(src);
-    if (nlz + cnt + ntz == 64) {
-      pcmpeqd(dst, dst);
-      if (ntz == 0) {
-        psrlq(dst, 64 - cnt);
-      } else {
-        psllq(dst, 64 - cnt);
-        if (nlz != 0) psrlq(dst, nlz);
-      }
-    } else if (lower == 0) {
-      Move(dst, upper);
-      psllq(dst, 32);
-    } else if (CpuFeatures::IsSupported(SSE4_1)) {
-      CpuFeatureScope scope(this, SSE4_1);
-      push(eax);
-      Move(eax, Immediate(lower));
-      movd(dst, Operand(eax));
-      Move(eax, Immediate(upper));
-      pinsrd(dst, Operand(eax), 1);
-      pop(eax);
-    } else {
-      push(Immediate(upper));
-      push(Immediate(lower));
-      movsd(dst, Operand(esp, 0));
-      add(esp, Immediate(kDoubleSize));
-    }
-  }
-}
-
-void TurboAssembler::Pshuflw(XMMRegister dst, const Operand& src,
-                             uint8_t shuffle) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vpshuflw(dst, src, shuffle);
-  } else {
-    pshuflw(dst, src, shuffle);
-  }
-}
-
-void TurboAssembler::Pshufd(XMMRegister dst, const Operand& src,
-                            uint8_t shuffle) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vpshufd(dst, src, shuffle);
-  } else {
-    pshufd(dst, src, shuffle);
-  }
-}
-
-void TurboAssembler::Psignb(XMMRegister dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vpsignb(dst, dst, src);
-    return;
-  }
-  if (CpuFeatures::IsSupported(SSSE3)) {
-    CpuFeatureScope sse_scope(this, SSSE3);
-    psignb(dst, src);
-    return;
-  }
-  UNREACHABLE();
-}
-
-void TurboAssembler::Psignw(XMMRegister dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vpsignw(dst, dst, src);
-    return;
-  }
-  if (CpuFeatures::IsSupported(SSSE3)) {
-    CpuFeatureScope sse_scope(this, SSSE3);
-    psignw(dst, src);
-    return;
-  }
-  UNREACHABLE();
-}
-
-void TurboAssembler::Psignd(XMMRegister dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vpsignd(dst, dst, src);
-    return;
-  }
-  if (CpuFeatures::IsSupported(SSSE3)) {
-    CpuFeatureScope sse_scope(this, SSSE3);
-    psignd(dst, src);
-    return;
-  }
-  UNREACHABLE();
-}
-
-void TurboAssembler::Pshufb(XMMRegister dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vpshufb(dst, dst, src);
-    return;
-  }
-  if (CpuFeatures::IsSupported(SSSE3)) {
-    CpuFeatureScope sse_scope(this, SSSE3);
-    pshufb(dst, src);
-    return;
-  }
-  UNREACHABLE();
-}
-
-void TurboAssembler::Pextrb(Register dst, XMMRegister src, int8_t imm8) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vpextrb(dst, src, imm8);
-    return;
-  }
-  if (CpuFeatures::IsSupported(SSE4_1)) {
-    CpuFeatureScope sse_scope(this, SSE4_1);
-    pextrb(dst, src, imm8);
-    return;
-  }
-  UNREACHABLE();
-}
-
-void TurboAssembler::Pextrw(Register dst, XMMRegister src, int8_t imm8) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vpextrw(dst, src, imm8);
-    return;
-  }
-  if (CpuFeatures::IsSupported(SSE4_1)) {
-    CpuFeatureScope sse_scope(this, SSE4_1);
-    pextrw(dst, src, imm8);
-    return;
-  }
-  UNREACHABLE();
-}
-
-void TurboAssembler::Pextrd(Register dst, XMMRegister src, int8_t imm8) {
-  if (imm8 == 0) {
-    Movd(dst, src);
-    return;
-  }
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vpextrd(dst, src, imm8);
-    return;
-  }
-  if (CpuFeatures::IsSupported(SSE4_1)) {
-    CpuFeatureScope sse_scope(this, SSE4_1);
-    pextrd(dst, src, imm8);
-    return;
-  }
-  DCHECK_LT(imm8, 4);
-  pshufd(xmm0, src, imm8);
-  movd(dst, xmm0);
-}
-
-void TurboAssembler::Pinsrd(XMMRegister dst, const Operand& src, int8_t imm8,
-                            bool is_64_bits) {
-  if (CpuFeatures::IsSupported(SSE4_1)) {
-    CpuFeatureScope sse_scope(this, SSE4_1);
-    pinsrd(dst, src, imm8);
-    return;
-  }
-  if (is_64_bits) {
-    movd(xmm0, src);
-    if (imm8 == 1) {
-      punpckldq(dst, xmm0);
-    } else {
-      DCHECK_EQ(0, imm8);
-      psrlq(dst, 32);
-      punpckldq(xmm0, dst);
-      movaps(dst, xmm0);
-    }
-  } else {
-    DCHECK_LT(imm8, 4);
-    push(eax);
-    mov(eax, src);
-    pinsrw(dst, eax, imm8 * 2);
-    shr(eax, 16);
-    pinsrw(dst, eax, imm8 * 2 + 1);
-    pop(eax);
-  }
-}
-
-void TurboAssembler::Lzcnt(Register dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(LZCNT)) {
-    CpuFeatureScope scope(this, LZCNT);
-    lzcnt(dst, src);
-    return;
-  }
-  Label not_zero_src;
-  bsr(dst, src);
-  j(not_zero, &not_zero_src, Label::kNear);
-  Move(dst, Immediate(63));  // 63^31 == 32
-  bind(&not_zero_src);
-  xor_(dst, Immediate(31));  // for x in [0..31], 31^x == 31-x.
-}
-
-void TurboAssembler::Tzcnt(Register dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(BMI1)) {
-    CpuFeatureScope scope(this, BMI1);
-    tzcnt(dst, src);
-    return;
-  }
-  Label not_zero_src;
-  bsf(dst, src);
-  j(not_zero, &not_zero_src, Label::kNear);
-  Move(dst, Immediate(32));  // The result of tzcnt is 32 if src = 0.
-  bind(&not_zero_src);
-}
-
-void TurboAssembler::Popcnt(Register dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(POPCNT)) {
-    CpuFeatureScope scope(this, POPCNT);
-    popcnt(dst, src);
-    return;
-  }
-  UNREACHABLE();
-}
-
-
-void MacroAssembler::IncrementCounter(StatsCounter* counter, int value) {
-  DCHECK_GT(value, 0);
-  if (FLAG_native_code_counters && counter->Enabled()) {
-    Operand operand = Operand::StaticVariable(ExternalReference(counter));
-    if (value == 1) {
-      inc(operand);
-    } else {
-      add(operand, Immediate(value));
-    }
-  }
-}
-
-
-void MacroAssembler::DecrementCounter(StatsCounter* counter, int value) {
-  DCHECK_GT(value, 0);
-  if (FLAG_native_code_counters && counter->Enabled()) {
-    Operand operand = Operand::StaticVariable(ExternalReference(counter));
-    if (value == 1) {
-      dec(operand);
-    } else {
-      sub(operand, Immediate(value));
-    }
-  }
-}
-
-void TurboAssembler::Assert(Condition cc, AbortReason reason) {
-  if (emit_debug_code()) Check(cc, reason);
-}
-
-void TurboAssembler::AssertUnreachable(AbortReason reason) {
-  if (emit_debug_code()) Abort(reason);
-}
-
-void TurboAssembler::Check(Condition cc, AbortReason reason) {
-  Label L;
-  j(cc, &L);
-  Abort(reason);
-  // will not return here
-  bind(&L);
-}
-
-void TurboAssembler::CheckStackAlignment() {
-  int frame_alignment = base::OS::ActivationFrameAlignment();
-  int frame_alignment_mask = frame_alignment - 1;
-  if (frame_alignment > kPointerSize) {
-    DCHECK(base::bits::IsPowerOfTwo(frame_alignment));
-    Label alignment_as_expected;
-    test(esp, Immediate(frame_alignment_mask));
-    j(zero, &alignment_as_expected);
-    // Abort if stack is not aligned.
-    int3();
-    bind(&alignment_as_expected);
-  }
-}
-
-void TurboAssembler::Abort(AbortReason reason) {
-#ifdef DEBUG
-  const char* msg = GetAbortReason(reason);
-  if (msg != nullptr) {
-    RecordComment("Abort message: ");
-    RecordComment(msg);
-  }
-
-  if (FLAG_trap_on_abort) {
-    int3();
-    return;
-  }
-#endif
-
-  Move(edx, Smi::FromInt(static_cast<int>(reason)));
-
-  // Disable stub call restrictions to always allow calls to abort.
-  if (!has_frame()) {
-    // We don't actually want to generate a pile of code for this, so just
-    // claim there is a stack frame, without generating one.
-    FrameScope scope(this, StackFrame::NONE);
-    Call(BUILTIN_CODE(isolate(), Abort), RelocInfo::CODE_TARGET);
-  } else {
-    Call(BUILTIN_CODE(isolate(), Abort), RelocInfo::CODE_TARGET);
-  }
-  // will not return here
-  int3();
-}
-
-
-void TurboAssembler::PrepareCallCFunction(int num_arguments, Register scratch) {
-  int frame_alignment = base::OS::ActivationFrameAlignment();
-  if (frame_alignment != 0) {
-    // Make stack end at alignment and make room for num_arguments words
-    // and the original value of esp.
-    mov(scratch, esp);
-    sub(esp, Immediate((num_arguments + 1) * kPointerSize));
-    DCHECK(base::bits::IsPowerOfTwo(frame_alignment));
-    and_(esp, -frame_alignment);
-    mov(Operand(esp, num_arguments * kPointerSize), scratch);
-  } else {
-    sub(esp, Immediate(num_arguments * kPointerSize));
-  }
-}
-
-void TurboAssembler::CallCFunction(ExternalReference function,
-                                   int num_arguments) {
-  // Trashing eax is ok as it will be the return value.
-  mov(eax, Immediate(function));
-  CallCFunction(eax, num_arguments);
-}
-
-void TurboAssembler::CallCFunction(Register function, int num_arguments) {
-  DCHECK_LE(num_arguments, kMaxCParameters);
-  DCHECK(has_frame());
-  // Check stack alignment.
-  if (emit_debug_code()) {
-    CheckStackAlignment();
-  }
-
-  call(function);
-  if (base::OS::ActivationFrameAlignment() != 0) {
-    mov(esp, Operand(esp, num_arguments * kPointerSize));
-  } else {
-    add(esp, Immediate(num_arguments * kPointerSize));
-  }
-}
-
-
-#ifdef DEBUG
-bool AreAliased(Register reg1,
-                Register reg2,
-                Register reg3,
-                Register reg4,
-                Register reg5,
-                Register reg6,
-                Register reg7,
-                Register reg8) {
-  int n_of_valid_regs = reg1.is_valid() + reg2.is_valid() +
-      reg3.is_valid() + reg4.is_valid() + reg5.is_valid() + reg6.is_valid() +
-      reg7.is_valid() + reg8.is_valid();
-
-  RegList regs = 0;
-  if (reg1.is_valid()) regs |= reg1.bit();
-  if (reg2.is_valid()) regs |= reg2.bit();
-  if (reg3.is_valid()) regs |= reg3.bit();
-  if (reg4.is_valid()) regs |= reg4.bit();
-  if (reg5.is_valid()) regs |= reg5.bit();
-  if (reg6.is_valid()) regs |= reg6.bit();
-  if (reg7.is_valid()) regs |= reg7.bit();
-  if (reg8.is_valid()) regs |= reg8.bit();
-  int n_of_non_aliasing_regs = NumRegs(regs);
-
-  return n_of_valid_regs != n_of_non_aliasing_regs;
-}
-#endif
-
-
-void TurboAssembler::CheckPageFlag(Register object, Register scratch, int mask,
-                                   Condition cc, Label* condition_met,
-                                   Label::Distance condition_met_distance) {
-  DCHECK(cc == zero || cc == not_zero);
-  if (scratch == object) {
-    and_(scratch, Immediate(~Page::kPageAlignmentMask));
-  } else {
-    mov(scratch, Immediate(~Page::kPageAlignmentMask));
-    and_(scratch, object);
-  }
-  if (mask < (1 << kBitsPerByte)) {
-    test_b(Operand(scratch, MemoryChunk::kFlagsOffset), Immediate(mask));
-  } else {
-    test(Operand(scratch, MemoryChunk::kFlagsOffset), Immediate(mask));
-  }
-  j(cc, condition_met, condition_met_distance);
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_IA32
diff --git a/src/v8/src/ia32/macro-assembler-ia32.h b/src/v8/src/ia32/macro-assembler-ia32.h
deleted file mode 100644
index 6242333..0000000
--- a/src/v8/src/ia32/macro-assembler-ia32.h
+++ /dev/null
@@ -1,666 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_IA32_MACRO_ASSEMBLER_IA32_H_
-#define V8_IA32_MACRO_ASSEMBLER_IA32_H_
-
-#include "src/assembler.h"
-#include "src/bailout-reason.h"
-#include "src/globals.h"
-#include "src/ia32/assembler-ia32.h"
-
-namespace v8 {
-namespace internal {
-
-// Give alias names to registers for calling conventions.
-constexpr Register kReturnRegister0 = eax;
-constexpr Register kReturnRegister1 = edx;
-constexpr Register kReturnRegister2 = edi;
-constexpr Register kJSFunctionRegister = edi;
-constexpr Register kContextRegister = esi;
-constexpr Register kAllocateSizeRegister = edx;
-constexpr Register kInterpreterAccumulatorRegister = eax;
-constexpr Register kInterpreterBytecodeOffsetRegister = ecx;
-constexpr Register kInterpreterBytecodeArrayRegister = edi;
-constexpr Register kInterpreterDispatchTableRegister = esi;
-constexpr Register kJavaScriptCallArgCountRegister = eax;
-constexpr Register kJavaScriptCallNewTargetRegister = edx;
-constexpr Register kRuntimeCallFunctionRegister = ebx;
-constexpr Register kRuntimeCallArgCountRegister = eax;
-
-// Convenience for platform-independent signatures.  We do not normally
-// distinguish memory operands from other operands on ia32.
-typedef Operand MemOperand;
-
-enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET };
-enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK };
-
-enum RegisterValueType { REGISTER_VALUE_IS_SMI, REGISTER_VALUE_IS_INT32 };
-
-#ifdef DEBUG
-bool AreAliased(Register reg1, Register reg2, Register reg3 = no_reg,
-                Register reg4 = no_reg, Register reg5 = no_reg,
-                Register reg6 = no_reg, Register reg7 = no_reg,
-                Register reg8 = no_reg);
-#endif
-
-class TurboAssembler : public Assembler {
- public:
-  TurboAssembler(Isolate* isolate, void* buffer, int buffer_size,
-                 CodeObjectRequired create_code_object);
-
-  void set_has_frame(bool value) { has_frame_ = value; }
-  bool has_frame() const { return has_frame_; }
-
-  Isolate* isolate() const { return isolate_; }
-
-  Handle<HeapObject> CodeObject() {
-    DCHECK(!code_object_.is_null());
-    return code_object_;
-  }
-
-  void CheckPageFlag(Register object, Register scratch, int mask, Condition cc,
-                     Label* condition_met,
-                     Label::Distance condition_met_distance = Label::kFar);
-
-  // Activation support.
-  void EnterFrame(StackFrame::Type type);
-  void EnterFrame(StackFrame::Type type, bool load_constant_pool_pointer_reg) {
-    // Out-of-line constant pool not implemented on ia32.
-    UNREACHABLE();
-  }
-  void LeaveFrame(StackFrame::Type type);
-
-  // Print a message to stdout and abort execution.
-  void Abort(AbortReason reason);
-
-  // Calls Abort(msg) if the condition cc is not satisfied.
-  // Use --debug_code to enable.
-  void Assert(Condition cc, AbortReason reason);
-
-  // Like Assert(), but without condition.
-  // Use --debug_code to enable.
-  void AssertUnreachable(AbortReason reason);
-
-  // Like Assert(), but always enabled.
-  void Check(Condition cc, AbortReason reason);
-
-  // Check that the stack is aligned.
-  void CheckStackAlignment();
-
-  // Nop, because ia32 does not have a root register.
-  void InitializeRootRegister() {}
-
-  // Move a constant into a destination using the most efficient encoding.
-  void Move(Register dst, const Immediate& x);
-
-  void Move(Register dst, Smi* source) { Move(dst, Immediate(source)); }
-
-  // Move if the registers are not identical.
-  void Move(Register target, Register source);
-
-  void Move(const Operand& dst, const Immediate& x);
-
-  // Move an immediate into an XMM register.
-  void Move(XMMRegister dst, uint32_t src);
-  void Move(XMMRegister dst, uint64_t src);
-  void Move(XMMRegister dst, float src) { Move(dst, bit_cast<uint32_t>(src)); }
-  void Move(XMMRegister dst, double src) { Move(dst, bit_cast<uint64_t>(src)); }
-
-  void Move(Register dst, Handle<HeapObject> handle);
-
-  void Call(Handle<Code> target, RelocInfo::Mode rmode) { call(target, rmode); }
-  void Call(Label* target) { call(target); }
-
-  void CallForDeoptimization(Address target, RelocInfo::Mode rmode) {
-    call(target, rmode);
-  }
-
-  inline bool AllowThisStubCall(CodeStub* stub);
-  void CallStubDelayed(CodeStub* stub);
-
-  void CallRuntimeDelayed(Zone* zone, Runtime::FunctionId fid,
-                          SaveFPRegsMode save_doubles = kDontSaveFPRegs);
-
-  // Jump the register contains a smi.
-  inline void JumpIfSmi(Register value, Label* smi_label,
-                        Label::Distance distance = Label::kFar) {
-    test(value, Immediate(kSmiTagMask));
-    j(zero, smi_label, distance);
-  }
-  // Jump if the operand is a smi.
-  inline void JumpIfSmi(Operand value, Label* smi_label,
-                        Label::Distance distance = Label::kFar) {
-    test(value, Immediate(kSmiTagMask));
-    j(zero, smi_label, distance);
-  }
-
-  void SmiUntag(Register reg) { sar(reg, kSmiTagSize); }
-
-  // Removes current frame and its arguments from the stack preserving the
-  // arguments and a return address pushed to the stack for the next call. Both
-  // |callee_args_count| and |caller_args_count_reg| do not include receiver.
-  // |callee_args_count| is not modified, |caller_args_count_reg| is trashed.
-  // |number_of_temp_values_after_return_address| specifies the number of words
-  // pushed to the stack after the return address. This is to allow "allocation"
-  // of scratch registers that this function requires by saving their values on
-  // the stack.
-  void PrepareForTailCall(const ParameterCount& callee_args_count,
-                          Register caller_args_count_reg, Register scratch0,
-                          Register scratch1,
-                          int number_of_temp_values_after_return_address);
-
-  // Before calling a C-function from generated code, align arguments on stack.
-  // After aligning the frame, arguments must be stored in esp[0], esp[4],
-  // etc., not pushed. The argument count assumes all arguments are word sized.
-  // Some compilers/platforms require the stack to be aligned when calling
-  // C++ code.
-  // Needs a scratch register to do some arithmetic. This register will be
-  // trashed.
-  void PrepareCallCFunction(int num_arguments, Register scratch);
-
-  // Calls a C function and cleans up the space for arguments allocated
-  // by PrepareCallCFunction. The called function is not allowed to trigger a
-  // garbage collection, since that might move the code and invalidate the
-  // return address (unless this is somehow accounted for by the called
-  // function).
-  void CallCFunction(ExternalReference function, int num_arguments);
-  void CallCFunction(Register function, int num_arguments);
-
-  void ShlPair(Register high, Register low, uint8_t imm8);
-  void ShlPair_cl(Register high, Register low);
-  void ShrPair(Register high, Register low, uint8_t imm8);
-  void ShrPair_cl(Register high, Register src);
-  void SarPair(Register high, Register low, uint8_t imm8);
-  void SarPair_cl(Register high, Register low);
-
-  // Generates function and stub prologue code.
-  void StubPrologue(StackFrame::Type type);
-  void Prologue();
-
-  void Lzcnt(Register dst, Register src) { Lzcnt(dst, Operand(src)); }
-  void Lzcnt(Register dst, const Operand& src);
-
-  void Tzcnt(Register dst, Register src) { Tzcnt(dst, Operand(src)); }
-  void Tzcnt(Register dst, const Operand& src);
-
-  void Popcnt(Register dst, Register src) { Popcnt(dst, Operand(src)); }
-  void Popcnt(Register dst, const Operand& src);
-
-  void Ret();
-
-  // Return and drop arguments from stack, where the number of arguments
-  // may be bigger than 2^16 - 1.  Requires a scratch register.
-  void Ret(int bytes_dropped, Register scratch);
-
-  void Pshuflw(XMMRegister dst, XMMRegister src, uint8_t shuffle) {
-    Pshuflw(dst, Operand(src), shuffle);
-  }
-  void Pshuflw(XMMRegister dst, const Operand& src, uint8_t shuffle);
-  void Pshufd(XMMRegister dst, XMMRegister src, uint8_t shuffle) {
-    Pshufd(dst, Operand(src), shuffle);
-  }
-  void Pshufd(XMMRegister dst, const Operand& src, uint8_t shuffle);
-
-// SSE/SSE2 instructions with AVX version.
-#define AVX_OP2_WITH_TYPE(macro_name, name, dst_type, src_type) \
-  void macro_name(dst_type dst, src_type src) {                 \
-    if (CpuFeatures::IsSupported(AVX)) {                        \
-      CpuFeatureScope scope(this, AVX);                         \
-      v##name(dst, src);                                        \
-    } else {                                                    \
-      name(dst, src);                                           \
-    }                                                           \
-  }
-
-  AVX_OP2_WITH_TYPE(Movdqu, movdqu, XMMRegister, const Operand&)
-  AVX_OP2_WITH_TYPE(Movdqu, movdqu, const Operand&, XMMRegister)
-  AVX_OP2_WITH_TYPE(Movd, movd, XMMRegister, Register)
-  AVX_OP2_WITH_TYPE(Movd, movd, XMMRegister, const Operand&)
-  AVX_OP2_WITH_TYPE(Movd, movd, Register, XMMRegister)
-  AVX_OP2_WITH_TYPE(Movd, movd, const Operand&, XMMRegister)
-
-#undef AVX_OP2_WITH_TYPE
-
-// Only use these macros when non-destructive source of AVX version is not
-// needed.
-#define AVX_OP3_WITH_TYPE(macro_name, name, dst_type, src_type) \
-  void macro_name(dst_type dst, src_type src) {                 \
-    if (CpuFeatures::IsSupported(AVX)) {                        \
-      CpuFeatureScope scope(this, AVX);                         \
-      v##name(dst, dst, src);                                   \
-    } else {                                                    \
-      name(dst, src);                                           \
-    }                                                           \
-  }
-#define AVX_OP3_XO(macro_name, name)                            \
-  AVX_OP3_WITH_TYPE(macro_name, name, XMMRegister, XMMRegister) \
-  AVX_OP3_WITH_TYPE(macro_name, name, XMMRegister, const Operand&)
-
-  AVX_OP3_XO(Pcmpeqd, pcmpeqd)
-  AVX_OP3_XO(Psubb, psubb)
-  AVX_OP3_XO(Psubw, psubw)
-  AVX_OP3_XO(Psubd, psubd)
-  AVX_OP3_XO(Pxor, pxor)
-
-#undef AVX_OP3_XO
-#undef AVX_OP3_WITH_TYPE
-
-  // Non-SSE2 instructions.
-  void Pshufb(XMMRegister dst, XMMRegister src) { Pshufb(dst, Operand(src)); }
-  void Pshufb(XMMRegister dst, const Operand& src);
-
-  void Psignb(XMMRegister dst, XMMRegister src) { Psignb(dst, Operand(src)); }
-  void Psignb(XMMRegister dst, const Operand& src);
-  void Psignw(XMMRegister dst, XMMRegister src) { Psignw(dst, Operand(src)); }
-  void Psignw(XMMRegister dst, const Operand& src);
-  void Psignd(XMMRegister dst, XMMRegister src) { Psignd(dst, Operand(src)); }
-  void Psignd(XMMRegister dst, const Operand& src);
-
-  void Pextrb(Register dst, XMMRegister src, int8_t imm8);
-  void Pextrw(Register dst, XMMRegister src, int8_t imm8);
-  void Pextrd(Register dst, XMMRegister src, int8_t imm8);
-  void Pinsrd(XMMRegister dst, Register src, int8_t imm8,
-              bool is_64_bits = false) {
-    Pinsrd(dst, Operand(src), imm8, is_64_bits);
-  }
-  void Pinsrd(XMMRegister dst, const Operand& src, int8_t imm8,
-              bool is_64_bits = false);
-
-  void LoadUint32(XMMRegister dst, Register src) {
-    LoadUint32(dst, Operand(src));
-  }
-  void LoadUint32(XMMRegister dst, const Operand& src);
-
-  // Expression support
-  // cvtsi2sd instruction only writes to the low 64-bit of dst register, which
-  // hinders register renaming and makes dependence chains longer. So we use
-  // xorps to clear the dst register before cvtsi2sd to solve this issue.
-  void Cvtsi2sd(XMMRegister dst, Register src) { Cvtsi2sd(dst, Operand(src)); }
-  void Cvtsi2sd(XMMRegister dst, const Operand& src);
-
-  void Cvtui2ss(XMMRegister dst, Register src, Register tmp);
-
-  void SlowTruncateToIDelayed(Zone* zone, Register result_reg);
-
-  void Push(Register src) { push(src); }
-  void Push(const Operand& src) { push(src); }
-  void Push(Immediate value) { push(value); }
-  void Push(Handle<HeapObject> handle) { push(Immediate(handle)); }
-  void Push(Smi* smi) { Push(Immediate(smi)); }
-
-  void SaveRegisters(RegList registers);
-  void RestoreRegisters(RegList registers);
-
-  void CallRecordWriteStub(Register object, Register address,
-                           RememberedSetAction remembered_set_action,
-                           SaveFPRegsMode fp_mode);
-
-  // Calculate how much stack space (in bytes) are required to store caller
-  // registers excluding those specified in the arguments.
-  int RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode,
-                                      Register exclusion1 = no_reg,
-                                      Register exclusion2 = no_reg,
-                                      Register exclusion3 = no_reg) const;
-
-  // PushCallerSaved and PopCallerSaved do not arrange the registers in any
-  // particular order so they are not useful for calls that can cause a GC.
-  // The caller can exclude up to 3 registers that do not need to be saved and
-  // restored.
-
-  // Push caller saved registers on the stack, and return the number of bytes
-  // stack pointer is adjusted.
-  int PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1 = no_reg,
-                      Register exclusion2 = no_reg,
-                      Register exclusion3 = no_reg);
-  // Restore caller saved registers from the stack, and return the number of
-  // bytes stack pointer is adjusted.
-  int PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1 = no_reg,
-                     Register exclusion2 = no_reg,
-                     Register exclusion3 = no_reg);
-
- private:
-  bool has_frame_ = false;
-  Isolate* const isolate_;
-  // This handle will be patched with the code object on installation.
-  Handle<HeapObject> code_object_;
-};
-
-// MacroAssembler implements a collection of frequently used macros.
-class MacroAssembler : public TurboAssembler {
- public:
-  MacroAssembler(Isolate* isolate, void* buffer, int size,
-                 CodeObjectRequired create_code_object);
-
-  // Load a register with a long value as efficiently as possible.
-  void Set(Register dst, int32_t x) {
-    if (x == 0) {
-      xor_(dst, dst);
-    } else {
-      mov(dst, Immediate(x));
-    }
-  }
-  void Set(const Operand& dst, int32_t x) { mov(dst, Immediate(x)); }
-
-  // Operations on roots in the root-array.
-  void LoadRoot(Register destination, Heap::RootListIndex index);
-  void CompareRoot(Register with, Register scratch, Heap::RootListIndex index);
-  // These methods can only be used with constant roots (i.e. non-writable
-  // and not in new space).
-  void CompareRoot(Register with, Heap::RootListIndex index);
-  void CompareRoot(const Operand& with, Heap::RootListIndex index);
-  void PushRoot(Heap::RootListIndex index);
-
-  // Compare the object in a register to a value and jump if they are equal.
-  void JumpIfRoot(Register with, Heap::RootListIndex index, Label* if_equal,
-                  Label::Distance if_equal_distance = Label::kFar) {
-    CompareRoot(with, index);
-    j(equal, if_equal, if_equal_distance);
-  }
-  void JumpIfRoot(const Operand& with, Heap::RootListIndex index,
-                  Label* if_equal,
-                  Label::Distance if_equal_distance = Label::kFar) {
-    CompareRoot(with, index);
-    j(equal, if_equal, if_equal_distance);
-  }
-
-  // Compare the object in a register to a value and jump if they are not equal.
-  void JumpIfNotRoot(Register with, Heap::RootListIndex index,
-                     Label* if_not_equal,
-                     Label::Distance if_not_equal_distance = Label::kFar) {
-    CompareRoot(with, index);
-    j(not_equal, if_not_equal, if_not_equal_distance);
-  }
-  void JumpIfNotRoot(const Operand& with, Heap::RootListIndex index,
-                     Label* if_not_equal,
-                     Label::Distance if_not_equal_distance = Label::kFar) {
-    CompareRoot(with, index);
-    j(not_equal, if_not_equal, if_not_equal_distance);
-  }
-
-  // ---------------------------------------------------------------------------
-  // GC Support
-  // Notify the garbage collector that we wrote a pointer into an object.
-  // |object| is the object being stored into, |value| is the object being
-  // stored.  value and scratch registers are clobbered by the operation.
-  // The offset is the offset from the start of the object, not the offset from
-  // the tagged HeapObject pointer.  For use with FieldOperand(reg, off).
-  void RecordWriteField(
-      Register object, int offset, Register value, Register scratch,
-      SaveFPRegsMode save_fp,
-      RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
-      SmiCheck smi_check = INLINE_SMI_CHECK);
-
-  // For page containing |object| mark region covering |address|
-  // dirty. |object| is the object being stored into, |value| is the
-  // object being stored. The address and value registers are clobbered by the
-  // operation. RecordWrite filters out smis so it does not update the
-  // write barrier if the value is a smi.
-  void RecordWrite(
-      Register object, Register address, Register value, SaveFPRegsMode save_fp,
-      RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
-      SmiCheck smi_check = INLINE_SMI_CHECK);
-
-  // Frame restart support
-  void MaybeDropFrames();
-
-  // Enter specific kind of exit frame. Expects the number of
-  // arguments in register eax and sets up the number of arguments in
-  // register edi and the pointer to the first argument in register
-  // esi.
-  void EnterExitFrame(int argc, bool save_doubles, StackFrame::Type frame_type);
-
-  void EnterApiExitFrame(int argc);
-
-  // Leave the current exit frame. Expects the return value in
-  // register eax:edx (untouched) and the pointer to the first
-  // argument in register esi (if pop_arguments == true).
-  void LeaveExitFrame(bool save_doubles, bool pop_arguments = true);
-
-  // Leave the current exit frame. Expects the return value in
-  // register eax (untouched).
-  void LeaveApiExitFrame();
-
-  // Load the global proxy from the current context.
-  void LoadGlobalProxy(Register dst);
-
-  // Load the global function with the given index.
-  void LoadGlobalFunction(int index, Register function);
-
-  // Push and pop the registers that can hold pointers.
-  void PushSafepointRegisters() { pushad(); }
-  void PopSafepointRegisters() { popad(); }
-
-  // ---------------------------------------------------------------------------
-  // JavaScript invokes
-
-
-  // Invoke the JavaScript function code by either calling or jumping.
-
-  void InvokeFunctionCode(Register function, Register new_target,
-                          const ParameterCount& expected,
-                          const ParameterCount& actual, InvokeFlag flag);
-
-  // On function call, call into the debugger if necessary.
-  void CheckDebugHook(Register fun, Register new_target,
-                      const ParameterCount& expected,
-                      const ParameterCount& actual);
-
-  // Invoke the JavaScript function in the given register. Changes the
-  // current context to the context in the function before invoking.
-  void InvokeFunction(Register function, Register new_target,
-                      const ParameterCount& actual, InvokeFlag flag);
-
-  void InvokeFunction(Register function, const ParameterCount& expected,
-                      const ParameterCount& actual, InvokeFlag flag);
-
-  void InvokeFunction(Handle<JSFunction> function,
-                      const ParameterCount& expected,
-                      const ParameterCount& actual, InvokeFlag flag);
-
-  // Compare object type for heap object.
-  // Incoming register is heap_object and outgoing register is map.
-  void CmpObjectType(Register heap_object, InstanceType type, Register map);
-
-  // Compare instance type for map.
-  void CmpInstanceType(Register map, InstanceType type);
-
-  void DoubleToI(Register result_reg, XMMRegister input_reg,
-                 XMMRegister scratch, MinusZeroMode minus_zero_mode,
-                 Label* lost_precision, Label* is_nan, Label* minus_zero,
-                 Label::Distance dst = Label::kFar);
-
-  // Smi tagging support.
-  void SmiTag(Register reg) {
-    STATIC_ASSERT(kSmiTag == 0);
-    STATIC_ASSERT(kSmiTagSize == 1);
-    add(reg, reg);
-  }
-
-  // Modifies the register even if it does not contain a Smi!
-  void UntagSmi(Register reg, Label* is_smi) {
-    STATIC_ASSERT(kSmiTagSize == 1);
-    sar(reg, kSmiTagSize);
-    STATIC_ASSERT(kSmiTag == 0);
-    j(not_carry, is_smi);
-  }
-
-  // Jump if register contain a non-smi.
-  inline void JumpIfNotSmi(Register value, Label* not_smi_label,
-                           Label::Distance distance = Label::kFar) {
-    test(value, Immediate(kSmiTagMask));
-    j(not_zero, not_smi_label, distance);
-  }
-  // Jump if the operand is not a smi.
-  inline void JumpIfNotSmi(Operand value, Label* smi_label,
-                           Label::Distance distance = Label::kFar) {
-    test(value, Immediate(kSmiTagMask));
-    j(not_zero, smi_label, distance);
-  }
-
-  template<typename Field>
-  void DecodeField(Register reg) {
-    static const int shift = Field::kShift;
-    static const int mask = Field::kMask >> Field::kShift;
-    if (shift != 0) {
-      sar(reg, shift);
-    }
-    and_(reg, Immediate(mask));
-  }
-
-  // Abort execution if argument is not a smi, enabled via --debug-code.
-  void AssertSmi(Register object);
-
-  // Abort execution if argument is a smi, enabled via --debug-code.
-  void AssertNotSmi(Register object);
-
-  // Abort execution if argument is not a FixedArray, enabled via --debug-code.
-  void AssertFixedArray(Register object);
-
-  // Abort execution if argument is not a JSFunction, enabled via --debug-code.
-  void AssertFunction(Register object);
-
-  // Abort execution if argument is not a JSBoundFunction,
-  // enabled via --debug-code.
-  void AssertBoundFunction(Register object);
-
-  // Abort execution if argument is not a JSGeneratorObject (or subclass),
-  // enabled via --debug-code.
-  void AssertGeneratorObject(Register object);
-
-  // Abort execution if argument is not undefined or an AllocationSite, enabled
-  // via --debug-code.
-  void AssertUndefinedOrAllocationSite(Register object);
-
-  // ---------------------------------------------------------------------------
-  // Exception handling
-
-  // Push a new stack handler and link it into stack handler chain.
-  void PushStackHandler();
-
-  // Unlink the stack handler on top of the stack from the stack handler chain.
-  void PopStackHandler();
-
-  // ---------------------------------------------------------------------------
-  // Runtime calls
-
-  // Call a code stub.  Generate the code if necessary.
-  void CallStub(CodeStub* stub);
-
-  // Tail call a code stub (jump).  Generate the code if necessary.
-  void TailCallStub(CodeStub* stub);
-
-  // Call a runtime routine.
-  void CallRuntime(const Runtime::Function* f, int num_arguments,
-                   SaveFPRegsMode save_doubles = kDontSaveFPRegs);
-
-  // Convenience function: Same as above, but takes the fid instead.
-  void CallRuntime(Runtime::FunctionId fid,
-                   SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
-    const Runtime::Function* function = Runtime::FunctionForId(fid);
-    CallRuntime(function, function->nargs, save_doubles);
-  }
-
-  // Convenience function: Same as above, but takes the fid instead.
-  void CallRuntime(Runtime::FunctionId fid, int num_arguments,
-                   SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
-    CallRuntime(Runtime::FunctionForId(fid), num_arguments, save_doubles);
-  }
-
-  // Convenience function: tail call a runtime routine (jump).
-  void TailCallRuntime(Runtime::FunctionId fid);
-
-  // Jump to a runtime routine.
-  void JumpToExternalReference(const ExternalReference& ext,
-                               bool builtin_exit_frame = false);
-
-  // ---------------------------------------------------------------------------
-  // Utilities
-
-  // Emit code to discard a non-negative number of pointer-sized elements
-  // from the stack, clobbering only the esp register.
-  void Drop(int element_count);
-
-  void Jump(Handle<Code> target, RelocInfo::Mode rmode) { jmp(target, rmode); }
-  void Pop(Register dst) { pop(dst); }
-  void Pop(const Operand& dst) { pop(dst); }
-  void PushReturnAddressFrom(Register src) { push(src); }
-  void PopReturnAddressTo(Register dst) { pop(dst); }
-
-  // ---------------------------------------------------------------------------
-  // StatsCounter support
-
-  void IncrementCounter(StatsCounter* counter, int value);
-  void DecrementCounter(StatsCounter* counter, int value);
-
-  static int SafepointRegisterStackIndex(Register reg) {
-    return SafepointRegisterStackIndex(reg.code());
-  }
-
-  void EnterBuiltinFrame(Register context, Register target, Register argc);
-  void LeaveBuiltinFrame(Register context, Register target, Register argc);
-
- private:
-  // Helper functions for generating invokes.
-  void InvokePrologue(const ParameterCount& expected,
-                      const ParameterCount& actual, Label* done,
-                      bool* definitely_mismatches, InvokeFlag flag,
-                      Label::Distance done_distance);
-
-  void EnterExitFramePrologue(StackFrame::Type frame_type);
-  void EnterExitFrameEpilogue(int argc, bool save_doubles);
-
-  void LeaveExitFrameEpilogue();
-
-  // Helper for implementing JumpIfNotInNewSpace and JumpIfInNewSpace.
-  void InNewSpace(Register object, Register scratch, Condition cc,
-                  Label* condition_met,
-                  Label::Distance condition_met_distance = Label::kFar);
-
-  // Compute memory operands for safepoint stack slots.
-  static int SafepointRegisterStackIndex(int reg_code);
-
-  // Needs access to SafepointRegisterStackIndex for compiled frame
-  // traversal.
-  friend class StandardFrame;
-};
-
-// -----------------------------------------------------------------------------
-// Static helper functions.
-
-// Generate an Operand for loading a field from an object.
-inline Operand FieldOperand(Register object, int offset) {
-  return Operand(object, offset - kHeapObjectTag);
-}
-
-// Generate an Operand for loading an indexed field from an object.
-inline Operand FieldOperand(Register object, Register index, ScaleFactor scale,
-                            int offset) {
-  return Operand(object, index, scale, offset - kHeapObjectTag);
-}
-
-inline Operand FixedArrayElementOperand(Register array, Register index_as_smi,
-                                        int additional_offset = 0) {
-  int offset = FixedArray::kHeaderSize + additional_offset * kPointerSize;
-  return FieldOperand(array, index_as_smi, times_half_pointer_size, offset);
-}
-
-inline Operand ContextOperand(Register context, int index) {
-  return Operand(context, Context::SlotOffset(index));
-}
-
-inline Operand ContextOperand(Register context, Register index) {
-  return Operand(context, index, times_pointer_size, Context::SlotOffset(0));
-}
-
-inline Operand NativeContextOperand() {
-  return ContextOperand(esi, Context::NATIVE_CONTEXT_INDEX);
-}
-
-#define ACCESS_MASM(masm) masm->
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_IA32_MACRO_ASSEMBLER_IA32_H_
diff --git a/src/v8/src/ia32/simulator-ia32.cc b/src/v8/src/ia32/simulator-ia32.cc
deleted file mode 100644
index d696e4b..0000000
--- a/src/v8/src/ia32/simulator-ia32.cc
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright 2008 the V8 project 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 "src/ia32/simulator-ia32.h"
-
-// Since there is no simulator for the ia32 architecture this file is empty.
diff --git a/src/v8/src/ia32/simulator-ia32.h b/src/v8/src/ia32/simulator-ia32.h
deleted file mode 100644
index a55c1fe..0000000
--- a/src/v8/src/ia32/simulator-ia32.h
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_IA32_SIMULATOR_IA32_H_
-#define V8_IA32_SIMULATOR_IA32_H_
-
-// Since there is no simulator for the ia32 architecture this file is empty.
-
-#endif  // V8_IA32_SIMULATOR_IA32_H_
diff --git a/src/v8/src/ia32/sse-instr.h b/src/v8/src/ia32/sse-instr.h
deleted file mode 100644
index 82cb0e2..0000000
--- a/src/v8/src/ia32/sse-instr.h
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_SSE_INSTR_H_
-#define V8_SSE_INSTR_H_
-
-#define SSE2_INSTRUCTION_LIST(V) \
-  V(paddb, 66, 0F, FC)           \
-  V(paddw, 66, 0F, FD)           \
-  V(paddd, 66, 0F, FE)           \
-  V(paddsb, 66, 0F, EC)          \
-  V(paddsw, 66, 0F, ED)          \
-  V(paddusb, 66, 0F, DC)         \
-  V(paddusw, 66, 0F, DD)         \
-  V(pand, 66, 0F, DB)            \
-  V(pcmpeqb, 66, 0F, 74)         \
-  V(pcmpeqw, 66, 0F, 75)         \
-  V(pcmpeqd, 66, 0F, 76)         \
-  V(pcmpgtb, 66, 0F, 64)         \
-  V(pcmpgtw, 66, 0F, 65)         \
-  V(pcmpgtd, 66, 0F, 66)         \
-  V(pmaxsw, 66, 0F, EE)          \
-  V(pmaxub, 66, 0F, DE)          \
-  V(pminsw, 66, 0F, EA)          \
-  V(pminub, 66, 0F, DA)          \
-  V(pmullw, 66, 0F, D5)          \
-  V(por, 66, 0F, EB)             \
-  V(psllw, 66, 0F, F1)           \
-  V(pslld, 66, 0F, F2)           \
-  V(psraw, 66, 0F, E1)           \
-  V(psrad, 66, 0F, E2)           \
-  V(psrlw, 66, 0F, D1)           \
-  V(psrld, 66, 0F, D2)           \
-  V(psubb, 66, 0F, F8)           \
-  V(psubw, 66, 0F, F9)           \
-  V(psubd, 66, 0F, FA)           \
-  V(psubsb, 66, 0F, E8)          \
-  V(psubsw, 66, 0F, E9)          \
-  V(psubusb, 66, 0F, D8)         \
-  V(psubusw, 66, 0F, D9)         \
-  V(punpckhdq, 66, 0F, 6A)       \
-  V(punpckldq, 66, 0F, 62)       \
-  V(pxor, 66, 0F, EF)
-
-#define SSSE3_INSTRUCTION_LIST(V) \
-  V(pshufb, 66, 0F, 38, 00)       \
-  V(psignb, 66, 0F, 38, 08)       \
-  V(psignw, 66, 0F, 38, 09)       \
-  V(psignd, 66, 0F, 38, 0A)
-
-#define SSE4_INSTRUCTION_LIST(V) \
-  V(pminsb, 66, 0F, 38, 38)      \
-  V(pminsd, 66, 0F, 38, 39)      \
-  V(pminuw, 66, 0F, 38, 3A)      \
-  V(pminud, 66, 0F, 38, 3B)      \
-  V(pmaxsb, 66, 0F, 38, 3C)      \
-  V(pmaxsd, 66, 0F, 38, 3D)      \
-  V(pmaxuw, 66, 0F, 38, 3E)      \
-  V(pmaxud, 66, 0F, 38, 3F)      \
-  V(pmulld, 66, 0F, 38, 40)
-
-#endif  // V8_SSE_INSTR_H_
diff --git a/src/v8/src/inspector/build/check_injected_script_source.py b/src/v8/src/inspector/build/check_injected_script_source.py
deleted file mode 100644
index 0f2509c..0000000
--- a/src/v8/src/inspector/build/check_injected_script_source.py
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2014 Google Inc. 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.
-#
-# Copied from blink:
-# WebKit/Source/devtools/scripts/check_injected_script_source.py
-#
-
-import re
-import sys
-import os
-
-
-def validate_injected_script(fileName):
-    f = open(fileName, "r")
-    lines = f.readlines()
-    f.close()
-
-    proto_functions = "|".join([
-        # Array.prototype.*
-        "concat", "every", "filter", "forEach", "indexOf", "join", "lastIndexOf", "map", "pop",
-        "push", "reduce", "reduceRight", "reverse", "shift", "slice", "some", "sort", "splice", "toLocaleString", "toString", "unshift",
-        # Function.prototype.*
-        "apply", "bind", "call", "isGenerator", "toSource",
-        # Object.prototype.*
-        "toString",
-    ])
-
-    global_functions = "|".join([
-        "eval", "uneval", "isFinite", "isNaN", "parseFloat", "parseInt", "decodeURI", "decodeURIComponent",
-        "encodeURI", "encodeURIComponent", "escape", "unescape", "Map", "Set"
-    ])
-
-    # Black list:
-    # - instanceof, since e.g. "obj instanceof Error" may throw if Error is overridden and is not a function
-    # - Object.prototype.toString()
-    # - Array.prototype.*
-    # - Function.prototype.*
-    # - Math.*
-    # - Global functions
-    black_list_call_regex = re.compile(r"\sinstanceof\s+\w*|\bMath\.\w+\(|(?<!InjectedScriptHost)\.(" + proto_functions + r")\(|[^\.]\b(" + global_functions + r")\(")
-
-    errors_found = False
-    for i, line in enumerate(lines):
-        if line.find("suppressBlacklist") != -1:
-            continue
-        for match in re.finditer(black_list_call_regex, line):
-            errors_found = True
-            print "ERROR: Black listed expression in %s at line %02d column %02d: %s" % (os.path.basename(fileName), i + 1, match.start(), match.group(0))
-
-    if not errors_found:
-        print "OK"
-
-
-def main(argv):
-    if len(argv) < 2:
-        print('ERROR: Usage: %s path/to/injected-script-source.js' % argv[0])
-        return 1
-
-    validate_injected_script(argv[1])
-
-if __name__ == '__main__':
-    sys.exit(main(sys.argv))
diff --git a/src/v8/src/inspector/build/closure-compiler.tar.gz.sha1 b/src/v8/src/inspector/build/closure-compiler.tar.gz.sha1
deleted file mode 100644
index 5366f51..0000000
--- a/src/v8/src/inspector/build/closure-compiler.tar.gz.sha1
+++ /dev/null
@@ -1 +0,0 @@
-69937d3c239ca63e4c9045718886ddd096ffc054
\ No newline at end of file
diff --git a/src/v8/src/inspector/build/compile-scripts.py b/src/v8/src/inspector/build/compile-scripts.py
deleted file mode 100755
index afcbce7..0000000
--- a/src/v8/src/inspector/build/compile-scripts.py
+++ /dev/null
@@ -1,150 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2016 the V8 project 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 os
-import os.path as path
-import generate_protocol_externs
-import re
-import subprocess
-import sys
-
-if len(sys.argv) == 2 and sys.argv[1] == '--help':
-  print("Usage: %s" % path.basename(sys.argv[0]))
-  sys.exit(0)
-
-java_required_major = 1
-java_required_minor = 7
-
-v8_inspector_path = path.dirname(path.dirname(path.abspath(__file__)))
-
-protocol_externs_file = path.join(v8_inspector_path, 'protocol_externs.js')
-injected_script_source_name = path.join(v8_inspector_path,
-  'injected-script-source.js')
-injected_script_externs_file = path.join(v8_inspector_path,
-  'injected_script_externs.js')
-
-generate_protocol_externs.generate_protocol_externs(protocol_externs_file,
-  path.join(v8_inspector_path, 'js_protocol.json'))
-
-error_warning_regex = re.compile(r'WARNING|ERROR')
-
-closure_compiler_jar = path.join(v8_inspector_path, 'build',
-  'closure-compiler', 'closure-compiler.jar')
-
-common_closure_args = [
-  '--checks_only',
-  '--warning_level', 'VERBOSE'
-]
-
-# Error reporting and checking.
-errors_found = False
-
-def popen(arguments):
-  return subprocess.Popen(arguments, stdout=subprocess.PIPE,
-    stderr=subprocess.STDOUT)
-
-def error_excepthook(exctype, value, traceback):
-  print 'ERROR:'
-  sys.__excepthook__(exctype, value, traceback)
-sys.excepthook = error_excepthook
-
-def has_errors(output):
-  return re.search(error_warning_regex, output) != None
-
-# Find java. Based on
-# http://stackoverflow.com/questions/377017/test-if-executable-exists-in-python.
-def which(program):
-  def is_exe(fpath):
-    return path.isfile(fpath) and os.access(fpath, os.X_OK)
-
-  fpath, fname = path.split(program)
-  if fpath:
-    if is_exe(program):
-      return program
-  else:
-    for part in os.environ['PATH'].split(os.pathsep):
-      part = part.strip('"')
-      exe_file = path.join(part, program)
-      if is_exe(exe_file):
-        return exe_file
-  return None
-
-def find_java():
-  exec_command = None
-  has_server_jvm = True
-  java_path = which('java')
-  if not java_path:
-    java_path = which('java.exe')
-
-  if not java_path:
-    print 'NOTE: No Java executable found in $PATH.'
-    sys.exit(0)
-
-  is_ok = False
-  java_version_out, _ = popen([java_path, '-version']).communicate()
-  java_build_regex = re.compile(r'^\w+ version "(\d+)\.(\d+)')
-  # pylint: disable=E1103
-  match = re.search(java_build_regex, java_version_out)
-  if match:
-    major = int(match.group(1))
-    minor = int(match.group(2))
-    is_ok = major >= java_required_major and minor >= java_required_minor
-  if is_ok:
-    exec_command = [java_path, '-Xms1024m', '-server',
-      '-XX:+TieredCompilation']
-    check_server_proc = popen(exec_command + ['-version'])
-    check_server_proc.communicate()
-    if check_server_proc.returncode != 0:
-      # Not all Java installs have server JVMs.
-      exec_command = exec_command.remove('-server')
-      has_server_jvm = False
-
-  if not is_ok:
-    print 'NOTE: Java executable version %d.%d or above not found in $PATH.' % (java_required_major, java_required_minor)
-    sys.exit(0)
-  print 'Java executable: %s%s' % (java_path, '' if has_server_jvm else ' (no server JVM)')
-  return exec_command
-
-java_exec = find_java()
-
-spawned_compiler_command = java_exec + [
-  '-jar',
-  closure_compiler_jar
-] + common_closure_args
-
-print 'Compiling injected-script-source.js...'
-
-command = spawned_compiler_command + [
-  '--externs', injected_script_externs_file,
-  '--externs', protocol_externs_file,
-  '--js', injected_script_source_name
-]
-
-injected_script_compile_proc = popen(command)
-
-print 'Validating injected-script-source.js...'
-injectedscript_check_script_path = path.join(v8_inspector_path, 'build',
-  'check_injected_script_source.py')
-validate_injected_script_proc = popen([sys.executable,
-  injectedscript_check_script_path, injected_script_source_name])
-
-print
-
-(injected_script_compile_out, _) = injected_script_compile_proc.communicate()
-print 'injected-script-source.js compilation output:%s' % os.linesep
-print injected_script_compile_out
-errors_found |= has_errors(injected_script_compile_out)
-
-(validate_injected_script_out, _) = validate_injected_script_proc.communicate()
-print 'Validate injected-script-source.js output:%s' % os.linesep
-print validate_injected_script_out if validate_injected_script_out else '<empty>'
-errors_found |= has_errors(validate_injected_script_out)
-
-os.remove(protocol_externs_file)
-
-if errors_found:
-  print 'ERRORS DETECTED'
-  sys.exit(1)
diff --git a/src/v8/src/inspector/build/generate_protocol_externs.py b/src/v8/src/inspector/build/generate_protocol_externs.py
deleted file mode 100755
index c2ba2c5..0000000
--- a/src/v8/src/inspector/build/generate_protocol_externs.py
+++ /dev/null
@@ -1,246 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2011 Google Inc. 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.
-
-import os
-import re
-import json
-
-type_traits = {
-    "any": "*",
-    "string": "string",
-    "integer": "number",
-    "number": "number",
-    "boolean": "boolean",
-    "array": "!Array.<*>",
-    "object": "!Object",
-}
-
-promisified_domains = {
-    "Accessibility",
-    "Animation",
-    "CSS",
-    "Emulation",
-    "Profiler"
-}
-
-ref_types = {}
-
-def full_qualified_type_id(domain_name, type_id):
-    if type_id.find(".") == -1:
-        return "%s.%s" % (domain_name, type_id)
-    return type_id
-
-
-def fix_camel_case(name):
-    prefix = ""
-    if name[0] == "-":
-        prefix = "Negative"
-        name = name[1:]
-    refined = re.sub(r'-(\w)', lambda pat: pat.group(1).upper(), name)
-    refined = to_title_case(refined)
-    return prefix + re.sub(r'(?i)HTML|XML|WML|API', lambda pat: pat.group(0).upper(), refined)
-
-
-def to_title_case(name):
-    return name[:1].upper() + name[1:]
-
-
-def generate_enum(name, json):
-    enum_members = []
-    for member in json["enum"]:
-        enum_members.append("    %s: \"%s\"" % (fix_camel_case(member), member))
-    return "\n/** @enum {string} */\n%s = {\n%s\n};\n" % (name, (",\n".join(enum_members)))
-
-
-def param_type(domain_name, param):
-    if "type" in param:
-        if param["type"] == "array":
-            items = param["items"]
-            return "!Array.<%s>" % param_type(domain_name, items)
-        else:
-            return type_traits[param["type"]]
-    if "$ref" in param:
-        type_id = full_qualified_type_id(domain_name, param["$ref"])
-        if type_id in ref_types:
-            return ref_types[type_id]
-        else:
-            print "Type not found: " + type_id
-            return "!! Type not found: " + type_id
-
-
-def load_schema(file, domains):
-    input_file = open(file, "r")
-    json_string = input_file.read()
-    parsed_json = json.loads(json_string)
-    domains.extend(parsed_json["domains"])
-
-
-def generate_protocol_externs(output_path, file1):
-    domains = []
-    load_schema(file1, domains)
-    output_file = open(output_path, "w")
-
-    output_file.write(
-"""
-var InspectorBackend = {}
-
-var Protocol = {};
-/** @typedef {string}*/
-Protocol.Error;
-""")
-
-    for domain in domains:
-        domain_name = domain["domain"]
-        if "types" in domain:
-            for type in domain["types"]:
-                type_id = full_qualified_type_id(domain_name, type["id"])
-                ref_types[type_id] = "%sAgent.%s" % (domain_name, type["id"])
-
-    for domain in domains:
-        domain_name = domain["domain"]
-        promisified = domain_name in promisified_domains
-
-        output_file.write("\n\n/**\n * @constructor\n*/\n")
-        output_file.write("Protocol.%sAgent = function(){};\n" % domain_name)
-
-        if "commands" in domain:
-            for command in domain["commands"]:
-                output_file.write("\n/**\n")
-                params = []
-                has_return_value = "returns" in command
-                explicit_parameters = promisified and has_return_value
-                if ("parameters" in command):
-                    for in_param in command["parameters"]:
-                        # All parameters are not optional in case of promisified domain with return value.
-                        if (not explicit_parameters and "optional" in in_param):
-                            params.append("opt_%s" % in_param["name"])
-                            output_file.write(" * @param {%s=} opt_%s\n" % (param_type(domain_name, in_param), in_param["name"]))
-                        else:
-                            params.append(in_param["name"])
-                            output_file.write(" * @param {%s} %s\n" % (param_type(domain_name, in_param), in_param["name"]))
-                returns = []
-                returns.append("?Protocol.Error")
-                if ("error" in command):
-                    returns.append("%s=" % param_type(domain_name, command["error"]))
-                if (has_return_value):
-                    for out_param in command["returns"]:
-                        if ("optional" in out_param):
-                            returns.append("%s=" % param_type(domain_name, out_param))
-                        else:
-                            returns.append("%s" % param_type(domain_name, out_param))
-                callback_return_type = "void="
-                if explicit_parameters:
-                    callback_return_type = "T"
-                elif promisified:
-                    callback_return_type = "T="
-                output_file.write(" * @param {function(%s):%s} opt_callback\n" % (", ".join(returns), callback_return_type))
-                if (promisified):
-                    output_file.write(" * @return {!Promise.<T>}\n")
-                    output_file.write(" * @template T\n")
-                params.append("opt_callback")
-
-                output_file.write(" */\n")
-                output_file.write("Protocol.%sAgent.prototype.%s = function(%s) {}\n" % (domain_name, command["name"], ", ".join(params)))
-                output_file.write("/** @param {function(%s):void=} opt_callback */\n" % ", ".join(returns))
-                output_file.write("Protocol.%sAgent.prototype.invoke_%s = function(obj, opt_callback) {}\n" % (domain_name, command["name"]))
-
-        output_file.write("\n\n\nvar %sAgent = function(){};\n" % domain_name)
-
-        if "types" in domain:
-            for type in domain["types"]:
-                if type["type"] == "object":
-                    typedef_args = []
-                    if "properties" in type:
-                        for property in type["properties"]:
-                            suffix = ""
-                            if ("optional" in property):
-                                suffix = "|undefined"
-                            if "enum" in property:
-                                enum_name = "%sAgent.%s%s" % (domain_name, type["id"], to_title_case(property["name"]))
-                                output_file.write(generate_enum(enum_name, property))
-                                typedef_args.append("%s:(%s%s)" % (property["name"], enum_name, suffix))
-                            else:
-                                typedef_args.append("%s:(%s%s)" % (property["name"], param_type(domain_name, property), suffix))
-                    if (typedef_args):
-                        output_file.write("\n/** @typedef {!{%s}} */\n%sAgent.%s;\n" % (", ".join(typedef_args), domain_name, type["id"]))
-                    else:
-                        output_file.write("\n/** @typedef {!Object} */\n%sAgent.%s;\n" % (domain_name, type["id"]))
-                elif type["type"] == "string" and "enum" in type:
-                    output_file.write(generate_enum("%sAgent.%s" % (domain_name, type["id"]), type))
-                elif type["type"] == "array":
-                    output_file.write("\n/** @typedef {!Array.<!%s>} */\n%sAgent.%s;\n" % (param_type(domain_name, type["items"]), domain_name, type["id"]))
-                else:
-                    output_file.write("\n/** @typedef {%s} */\n%sAgent.%s;\n" % (type_traits[type["type"]], domain_name, type["id"]))
-
-        output_file.write("/** @interface */\n")
-        output_file.write("%sAgent.Dispatcher = function() {};\n" % domain_name)
-        if "events" in domain:
-            for event in domain["events"]:
-                params = []
-                if ("parameters" in event):
-                    output_file.write("/**\n")
-                    for param in event["parameters"]:
-                        if ("optional" in param):
-                            params.append("opt_%s" % param["name"])
-                            output_file.write(" * @param {%s=} opt_%s\n" % (param_type(domain_name, param), param["name"]))
-                        else:
-                            params.append(param["name"])
-                            output_file.write(" * @param {%s} %s\n" % (param_type(domain_name, param), param["name"]))
-                    output_file.write(" */\n")
-                output_file.write("%sAgent.Dispatcher.prototype.%s = function(%s) {};\n" % (domain_name, event["name"], ", ".join(params)))
-
-    output_file.write("\n/** @constructor\n * @param {!Object.<string, !Object>} agentsMap\n */\n")
-    output_file.write("Protocol.Agents = function(agentsMap){this._agentsMap;};\n")
-    output_file.write("/**\n * @param {string} domain\n * @param {!Object} dispatcher\n */\n")
-    output_file.write("Protocol.Agents.prototype.registerDispatcher = function(domain, dispatcher){};\n")
-    for domain in domains:
-        domain_name = domain["domain"]
-        uppercase_length = 0
-        while uppercase_length < len(domain_name) and domain_name[uppercase_length].isupper():
-            uppercase_length += 1
-
-        output_file.write("/** @return {!Protocol.%sAgent}*/\n" % domain_name)
-        output_file.write("Protocol.Agents.prototype.%s = function(){};\n" % (domain_name[:uppercase_length].lower() + domain_name[uppercase_length:] + "Agent"))
-
-        output_file.write("/**\n * @param {!%sAgent.Dispatcher} dispatcher\n */\n" % domain_name)
-        output_file.write("Protocol.Agents.prototype.register%sDispatcher = function(dispatcher) {}\n" % domain_name)
-
-
-    output_file.close()
-
-if __name__ == "__main__":
-    import sys
-    import os.path
-    program_name = os.path.basename(__file__)
-    if len(sys.argv) < 4 or sys.argv[1] != "-o":
-        sys.stderr.write("Usage: %s -o OUTPUT_FILE INPUT_FILE\n" % program_name)
-        exit(1)
-    output_path = sys.argv[2]
-    input_path = sys.argv[3]
-    generate_protocol_externs(output_path, input_path)
diff --git a/src/v8/src/inspector/build/rjsmin.py b/src/v8/src/inspector/build/rjsmin.py
deleted file mode 100755
index 8357a6d..0000000
--- a/src/v8/src/inspector/build/rjsmin.py
+++ /dev/null
@@ -1,295 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2011 - 2013
-# Andr\xe9 Malo or his licensors, as applicable
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-r"""
-=====================
- Javascript Minifier
-=====================
-
-rJSmin is a javascript minifier written in python.
-
-The minifier is based on the semantics of `jsmin.c by Douglas Crockford`_\.
-
-The module is a re-implementation aiming for speed, so it can be used at
-runtime (rather than during a preprocessing step). Usually it produces the
-same results as the original ``jsmin.c``. It differs in the following ways:
-
-- there is no error detection: unterminated string, regex and comment
-  literals are treated as regular javascript code and minified as such.
-- Control characters inside string and regex literals are left untouched; they
-  are not converted to spaces (nor to \n)
-- Newline characters are not allowed inside string and regex literals, except
-  for line continuations in string literals (ECMA-5).
-- "return /regex/" is recognized correctly.
-- "+ +" and "- -" sequences are not collapsed to '++' or '--'
-- Newlines before ! operators are removed more sensibly
-- rJSmin does not handle streams, but only complete strings. (However, the
-  module provides a "streamy" interface).
-
-Since most parts of the logic are handled by the regex engine it's way
-faster than the original python port of ``jsmin.c`` by Baruch Even. The speed
-factor varies between about 6 and 55 depending on input and python version
-(it gets faster the more compressed the input already is). Compared to the
-speed-refactored python port by Dave St.Germain the performance gain is less
-dramatic but still between 1.2 and 7. See the docs/BENCHMARKS file for
-details.
-
-rjsmin.c is a reimplementation of rjsmin.py in C and speeds it up even more.
-
-Both python 2 and python 3 are supported.
-
-.. _jsmin.c by Douglas Crockford:
-   http://www.crockford.com/javascript/jsmin.c
-"""
-__author__ = "Andr\xe9 Malo"
-__author__ = getattr(__author__, 'decode', lambda x: __author__)('latin-1')
-__docformat__ = "restructuredtext en"
-__license__ = "Apache License, Version 2.0"
-__version__ = '1.0.7'
-__all__ = ['jsmin']
-
-import re as _re
-
-
-def _make_jsmin(python_only=False):
-    """
-    Generate JS minifier based on `jsmin.c by Douglas Crockford`_
-
-    .. _jsmin.c by Douglas Crockford:
-       http://www.crockford.com/javascript/jsmin.c
-
-    :Parameters:
-      `python_only` : ``bool``
-        Use only the python variant. If true, the c extension is not even
-        tried to be loaded.
-
-    :Return: Minifier
-    :Rtype: ``callable``
-    """
-    # pylint: disable = R0912, R0914, W0612
-    if not python_only:
-        try:
-            import _rjsmin
-        except ImportError:
-            pass
-        else:
-            return _rjsmin.jsmin
-    try:
-        xrange
-    except NameError:
-        xrange = range  # pylint: disable = W0622
-
-    space_chars = r'[\000-\011\013\014\016-\040]'
-
-    line_comment = r'(?://[^\r\n]*)'
-    space_comment = r'(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/)'
-    string1 = \
-        r'(?:\047[^\047\\\r\n]*(?:\\(?:[^\r\n]|\r?\n|\r)[^\047\\\r\n]*)*\047)'
-    string2 = r'(?:"[^"\\\r\n]*(?:\\(?:[^\r\n]|\r?\n|\r)[^"\\\r\n]*)*")'
-    strings = r'(?:%s|%s)' % (string1, string2)
-
-    charclass = r'(?:\[[^\\\]\r\n]*(?:\\[^\r\n][^\\\]\r\n]*)*\])'
-    nospecial = r'[^/\\\[\r\n]'
-    regex = r'(?:/(?![\r\n/*])%s*(?:(?:\\[^\r\n]|%s)%s*)*/)' % (
-        nospecial, charclass, nospecial)
-    space = r'(?:%s|%s)' % (space_chars, space_comment)
-    newline = r'(?:%s?[\r\n])' % line_comment
-
-    def fix_charclass(result):
-        """ Fixup string of chars to fit into a regex char class """
-        pos = result.find('-')
-        if pos >= 0:
-            result = r'%s%s-' % (result[:pos], result[pos + 1:])
-
-        def sequentize(string):
-            """
-            Notate consecutive characters as sequence
-
-            (1-4 instead of 1234)
-            """
-            first, last, result = None, None, []
-            for char in map(ord, string):
-                if last is None:
-                    first = last = char
-                elif last + 1 == char:
-                    last = char
-                else:
-                    result.append((first, last))
-                    first = last = char
-            if last is not None:
-                result.append((first, last))
-            return ''.join(['%s%s%s' % (
-                chr(first),
-                last > first + 1 and '-' or '',
-                last != first and chr(last) or '') for first, last in result])
-
-        return _re.sub(r'([\000-\040\047])',  # for better portability
-            lambda m: '\\%03o' % ord(m.group(1)), (sequentize(result)
-                .replace('\\', '\\\\')
-                .replace('[', '\\[')
-                .replace(']', '\\]')))
-
-    def id_literal_(what):
-        """ Make id_literal like char class """
-        match = _re.compile(what).match
-        result = ''.join([chr(c) for c in xrange(127) if not match(chr(c))])
-        return '[^%s]' % fix_charclass(result)
-
-    def not_id_literal_(keep):
-        """ Make negated id_literal like char class """
-        match = _re.compile(id_literal_(keep)).match
-        result = ''.join([chr(c) for c in xrange(127) if not match(chr(c))])
-        return r'[%s]' % fix_charclass(result)
-
-    not_id_literal = not_id_literal_(r'[a-zA-Z0-9_$]')
-    preregex1 = r'[(,=:\[!&|?{};\r\n]'
-    preregex2 = r'%(not_id_literal)sreturn' % locals()
-
-    id_literal = id_literal_(r'[a-zA-Z0-9_$]')
-    id_literal_open = id_literal_(r'[a-zA-Z0-9_${\[(!+-]')
-    id_literal_close = id_literal_(r'[a-zA-Z0-9_$}\])"\047+-]')
-
-    dull = r'[^\047"/\000-\040]'
-
-    space_sub = _re.compile((
-        r'(%(dull)s+)'
-        r'|(%(strings)s%(dull)s*)'
-        r'|(?<=%(preregex1)s)'
-            r'%(space)s*(?:%(newline)s%(space)s*)*'
-            r'(%(regex)s%(dull)s*)'
-        r'|(?<=%(preregex2)s)'
-            r'%(space)s*(?:%(newline)s%(space)s)*'
-            r'(%(regex)s%(dull)s*)'
-        r'|(?<=%(id_literal_close)s)'
-            r'%(space)s*(?:(%(newline)s)%(space)s*)+'
-            r'(?=%(id_literal_open)s)'
-        r'|(?<=%(id_literal)s)(%(space)s)+(?=%(id_literal)s)'
-        r'|(?<=\+)(%(space)s)+(?=\+)'
-        r'|(?<=-)(%(space)s)+(?=-)'
-        r'|%(space)s+'
-        r'|(?:%(newline)s%(space)s*)+') % locals()).sub
-    #print space_sub.__self__.pattern
-
-    def space_subber(match):
-        """ Substitution callback """
-        # pylint: disable = C0321, R0911
-        groups = match.groups()
-        if groups[0]:
-            return groups[0]
-        elif groups[1]:
-            return groups[1]
-        elif groups[2]:
-            return groups[2]
-        elif groups[3]:
-            return groups[3]
-        elif groups[4]:
-            return '\n'
-        elif groups[5] or groups[6] or groups[7]:
-            return ' '
-        else:
-            return ''
-
-    def jsmin(script):  # pylint: disable = W0621
-        r"""
-        Minify javascript based on `jsmin.c by Douglas Crockford`_\.
-
-        Instead of parsing the stream char by char, it uses a regular
-        expression approach which minifies the whole script with one big
-        substitution regex.
-
-        .. _jsmin.c by Douglas Crockford:
-           http://www.crockford.com/javascript/jsmin.c
-
-        :Parameters:
-          `script` : ``str``
-            Script to minify
-
-        :Return: Minified script
-        :Rtype: ``str``
-        """
-        return space_sub(space_subber, '\n%s\n' % script).strip()
-
-    return jsmin
-
-jsmin = _make_jsmin()
-
-
-def jsmin_for_posers(script):
-    r"""
-    Minify javascript based on `jsmin.c by Douglas Crockford`_\.
-
-    Instead of parsing the stream char by char, it uses a regular
-    expression approach which minifies the whole script with one big
-    substitution regex.
-
-    .. _jsmin.c by Douglas Crockford:
-       http://www.crockford.com/javascript/jsmin.c
-
-    :Warning: This function is the digest of a _make_jsmin() call. It just
-              utilizes the resulting regex. It's just for fun here and may
-              vanish any time. Use the `jsmin` function instead.
-
-    :Parameters:
-      `script` : ``str``
-        Script to minify
-
-    :Return: Minified script
-    :Rtype: ``str``
-    """
-    def subber(match):
-        """ Substitution callback """
-        groups = match.groups()
-        return (
-            groups[0] or
-            groups[1] or
-            groups[2] or
-            groups[3] or
-            (groups[4] and '\n') or
-            (groups[5] and ' ') or
-            (groups[6] and ' ') or
-            (groups[7] and ' ') or
-            '')
-
-    return _re.sub(
-        r'([^\047"/\000-\040]+)|((?:(?:\047[^\047\\\r\n]*(?:\\(?:[^\r\n]|\r?'
-        r'\n|\r)[^\047\\\r\n]*)*\047)|(?:"[^"\\\r\n]*(?:\\(?:[^\r\n]|\r?\n|'
-        r'\r)[^"\\\r\n]*)*"))[^\047"/\000-\040]*)|(?<=[(,=:\[!&|?{};\r\n])(?'
-        r':[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*'
-        r'(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*'
-        r'[^*]*\*+(?:[^/*][^*]*\*+)*/))*)*((?:/(?![\r\n/*])[^/\\\[\r\n]*(?:('
-        r'?:\\[^\r\n]|(?:\[[^\\\]\r\n]*(?:\\[^\r\n][^\\\]\r\n]*)*\]))[^/\\\['
-        r'\r\n]*)*/)[^\047"/\000-\040]*)|(?<=[\000-#%-,./:-@\[-^`{-~-]return'
-        r')(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/'
-        r'))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:'
-        r'/\*[^*]*\*+(?:[^/*][^*]*\*+)*/)))*((?:/(?![\r\n/*])[^/\\\[\r\n]*(?'
-        r':(?:\\[^\r\n]|(?:\[[^\\\]\r\n]*(?:\\[^\r\n][^\\\]\r\n]*)*\]))[^/'
-        r'\\\[\r\n]*)*/)[^\047"/\000-\040]*)|(?<=[^\000-!#%&(*,./:-@\[\\^`{|'
-        r'~])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)'
-        r'*/))*(?:((?:(?://[^\r\n]*)?[\r\n]))(?:[\000-\011\013\014\016-\040]'
-        r'|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)+(?=[^\000-\040"#%-\047)*,./'
-        r':-@\\-^`|-~])|(?<=[^\000-#%-,./:-@\[-^`{-~-])((?:[\000-\011\013\01'
-        r'4\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/)))+(?=[^\000-#%-,./:'
-        r'-@\[-^`{-~-])|(?<=\+)((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*'
-        r'\*+(?:[^/*][^*]*\*+)*/)))+(?=\+)|(?<=-)((?:[\000-\011\013\014\016-'
-        r'\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/)))+(?=-)|(?:[\000-\011\013'
-        r'\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))+|(?:(?:(?://[^'
-        r'\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^'
-        r'/*][^*]*\*+)*/))*)+', subber, '\n%s\n' % script).strip()
-
-
-if __name__ == '__main__':
-    import sys as _sys
-    _sys.stdout.write(jsmin(_sys.stdin.read()))
diff --git a/src/v8/src/inspector/build/xxd.py b/src/v8/src/inspector/build/xxd.py
deleted file mode 100644
index 5a63a7c..0000000
--- a/src/v8/src/inspector/build/xxd.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright 2016 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Represent a file as a C++ constant string.
-
-Usage:
-python xxd.py VAR SOURCE DEST
-"""
-
-
-import sys
-import rjsmin
-
-
-def main():
-    variable_name, input_filename, output_filename = sys.argv[1:]
-    with open(input_filename) as input_file:
-        input_text = input_file.read()
-    input_text = rjsmin.jsmin(input_text)
-    hex_values = ['0x{0:02x}'.format(ord(char)) for char in input_text]
-    const_declaration = 'const char %s[] = {\n%s\n};\n' % (
-        variable_name, ', '.join(hex_values))
-    with open(output_filename, 'w') as output_file:
-        output_file.write(const_declaration)
-
-if __name__ == '__main__':
-    sys.exit(main())
diff --git a/src/v8/src/inspector/injected-script-source.js b/src/v8/src/inspector/injected-script-source.js
deleted file mode 100644
index 0849d44..0000000
--- a/src/v8/src/inspector/injected-script-source.js
+++ /dev/null
@@ -1,1098 +0,0 @@
-/*
- * Copyright (C) 2007 Apple Inc.  All rights reserved.
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  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.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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.
- */
-
-"use strict";
-
-/**
- * @param {!InjectedScriptHostClass} InjectedScriptHost
- * @param {!Window|!WorkerGlobalScope} inspectedGlobalObject
- * @param {number} injectedScriptId
- * @suppress {uselessCode}
- */
-(function (InjectedScriptHost, inspectedGlobalObject, injectedScriptId) {
-
-/**
- * @param {!Array.<T>} array
- * @param {...} var_args
- * @template T
- */
-function push(array, var_args)
-{
-    for (var i = 1; i < arguments.length; ++i)
-        array[array.length] = arguments[i];
-}
-
-/**
- * @param {*} obj
- * @return {string}
- * @suppress {uselessCode}
- */
-function toString(obj)
-{
-    // We don't use String(obj) because String could be overridden.
-    // Also the ("" + obj) expression may throw.
-    try {
-        return "" + obj;
-    } catch (e) {
-        var name = InjectedScriptHost.internalConstructorName(obj) || InjectedScriptHost.subtype(obj) || (typeof obj);
-        return "#<" + name + ">";
-    }
-}
-
-/**
- * @param {*} obj
- * @return {string}
- */
-function toStringDescription(obj)
-{
-    if (typeof obj === "number" && obj === 0 && 1 / obj < 0)
-        return "-0"; // Negative zero.
-    return toString(obj);
-}
-
-/**
- * FireBug's array detection.
- * @param {*} obj
- * @return {boolean}
- */
-function isArrayLike(obj)
-{
-    if (typeof obj !== "object")
-        return false;
-    var splice = InjectedScriptHost.getProperty(obj, "splice");
-    if (typeof splice === "function") {
-        if (!InjectedScriptHost.objectHasOwnProperty(/** @type {!Object} */ (obj), "length"))
-            return false;
-        var len = InjectedScriptHost.getProperty(obj, "length");
-        // is len uint32?
-        return typeof len === "number" && len >>> 0 === len && (len > 0 || 1 / len > 0);
-    }
-    return false;
-}
-
-/**
- * @param {number} a
- * @param {number} b
- * @return {number}
- */
-function max(a, b)
-{
-    return a > b ? a : b;
-}
-
-/**
- * FIXME: Remove once ES6 is supported natively by JS compiler.
- * @param {*} obj
- * @return {boolean}
- */
-function isSymbol(obj)
-{
-    var type = typeof obj;
-    return (type === "symbol");
-}
-
-/**
- * DOM Attributes which have observable side effect on getter, in the form of
- *   {interfaceName1: {attributeName1: true,
- *                     attributeName2: true,
- *                     ...},
- *    interfaceName2: {...},
- *    ...}
- * @type {!Object<string, !Object<string, boolean>>}
- * @const
- */
-var domAttributesWithObservableSideEffectOnGet = {
-    Request: { body: true, __proto__: null },
-    Response: { body: true, __proto__: null },
-    __proto__: null
-}
-
-/**
- * @param {!Object} object
- * @param {string} attribute
- * @return {boolean}
- */
-function doesAttributeHaveObservableSideEffectOnGet(object, attribute)
-{
-    for (var interfaceName in domAttributesWithObservableSideEffectOnGet) {
-        var interfaceFunction = inspectedGlobalObject[interfaceName];
-        // Call to instanceOf looks safe after typeof check.
-        var isInstance = typeof interfaceFunction === "function" && /* suppressBlacklist */ object instanceof interfaceFunction;
-        if (isInstance)
-            return attribute in domAttributesWithObservableSideEffectOnGet[interfaceName];
-    }
-    return false;
-}
-
-/**
- * @constructor
- */
-var InjectedScript = function()
-{
-}
-InjectedScriptHost.nullifyPrototype(InjectedScript);
-
-/**
- * @type {!Object<string, boolean>}
- * @const
- */
-InjectedScript.primitiveTypes = {
-    "undefined": true,
-    "boolean": true,
-    "number": true,
-    "string": true,
-    __proto__: null
-}
-
-/**
- * @type {!Object<string, string>}
- * @const
- */
-InjectedScript.closureTypes = {
-    "local": "Local",
-    "closure": "Closure",
-    "catch": "Catch",
-    "block": "Block",
-    "script": "Script",
-    "with": "With Block",
-    "global": "Global",
-    "eval": "Eval",
-    "module": "Module",
-    __proto__: null
-};
-
-InjectedScript.prototype = {
-    /**
-     * @param {*} object
-     * @return {boolean}
-     */
-    isPrimitiveValue: function(object)
-    {
-        // FIXME(33716): typeof document.all is always 'undefined'.
-        return InjectedScript.primitiveTypes[typeof object] && !this._isHTMLAllCollection(object);
-    },
-
-    /**
-     * @param {*} object
-     * @return {boolean}
-     */
-    _shouldPassByValue: function(object)
-    {
-        return typeof object === "object" && InjectedScriptHost.subtype(object) === "internal#location";
-    },
-
-    /**
-     * @param {*} object
-     * @param {string} groupName
-     * @param {boolean} forceValueType
-     * @param {boolean} generatePreview
-     * @return {!RuntimeAgent.RemoteObject}
-     */
-    wrapObject: function(object, groupName, forceValueType, generatePreview)
-    {
-        return this._wrapObject(object, groupName, forceValueType, generatePreview);
-    },
-
-    /**
-     * @param {!Object} table
-     * @param {!Array.<string>|string|boolean} columns
-     * @return {!RuntimeAgent.RemoteObject}
-     */
-    wrapTable: function(table, columns)
-    {
-        var columnNames = null;
-        if (typeof columns === "string")
-            columns = [columns];
-        if (InjectedScriptHost.subtype(columns) === "array") {
-            columnNames = [];
-            InjectedScriptHost.nullifyPrototype(columnNames);
-            for (var i = 0; i < columns.length; ++i)
-                columnNames[i] = toString(columns[i]);
-        }
-        return this._wrapObject(table, "console", false, true, columnNames, true);
-    },
-
-    /**
-     * This method cannot throw.
-     * @param {*} object
-     * @param {string=} objectGroupName
-     * @param {boolean=} forceValueType
-     * @param {boolean=} generatePreview
-     * @param {?Array.<string>=} columnNames
-     * @param {boolean=} isTable
-     * @param {boolean=} doNotBind
-     * @param {*=} customObjectConfig
-     * @return {!RuntimeAgent.RemoteObject}
-     * @suppress {checkTypes}
-     */
-    _wrapObject: function(object, objectGroupName, forceValueType, generatePreview, columnNames, isTable, doNotBind, customObjectConfig)
-    {
-        try {
-            return new InjectedScript.RemoteObject(object, objectGroupName, doNotBind, forceValueType, generatePreview, columnNames, isTable, undefined, customObjectConfig);
-        } catch (e) {
-            try {
-                var description = injectedScript._describe(e);
-            } catch (ex) {
-                var description = "<failed to convert exception to string>";
-            }
-            return new InjectedScript.RemoteObject(description);
-        }
-    },
-
-    /**
-     * @param {!Object|symbol} object
-     * @param {string=} objectGroupName
-     * @return {string}
-     */
-    _bind: function(object, objectGroupName)
-    {
-        var id = InjectedScriptHost.bind(object, objectGroupName || "");
-        return "{\"injectedScriptId\":" + injectedScriptId + ",\"id\":" + id + "}";
-    },
-
-    /**
-     * @param {!Object} object
-     * @param {string} objectGroupName
-     * @param {boolean} ownProperties
-     * @param {boolean} accessorPropertiesOnly
-     * @param {boolean} generatePreview
-     * @return {!Array<!RuntimeAgent.PropertyDescriptor>|boolean}
-     */
-    getProperties: function(object, objectGroupName, ownProperties, accessorPropertiesOnly, generatePreview)
-    {
-        var subtype = this._subtype(object);
-        if (subtype === "internal#scope") {
-            // Internally, scope contains object with scope variables and additional information like type,
-            // we use additional information for preview and would like to report variables as scope
-            // properties.
-            object = object.object;
-        }
-
-        // Go over properties, wrap object values.
-        var descriptors = this._propertyDescriptors(object, addPropertyIfNeeded, ownProperties, accessorPropertiesOnly);
-        for (var i = 0; i < descriptors.length; ++i) {
-            var descriptor = descriptors[i];
-            if ("get" in descriptor)
-                descriptor.get = this._wrapObject(descriptor.get, objectGroupName);
-            if ("set" in descriptor)
-                descriptor.set = this._wrapObject(descriptor.set, objectGroupName);
-            if ("value" in descriptor)
-                descriptor.value = this._wrapObject(descriptor.value, objectGroupName, false, generatePreview);
-            if (!("configurable" in descriptor))
-                descriptor.configurable = false;
-            if (!("enumerable" in descriptor))
-                descriptor.enumerable = false;
-            if ("symbol" in descriptor)
-                descriptor.symbol = this._wrapObject(descriptor.symbol, objectGroupName);
-        }
-        return descriptors;
-
-        /**
-         * @param {!Array<!Object>} descriptors
-         * @param {!Object} descriptor
-         * @return {boolean}
-         */
-        function addPropertyIfNeeded(descriptors, descriptor) {
-            push(descriptors, descriptor);
-            return true;
-        }
-    },
-
-    /**
-     * @param {!Object} object
-     * @return {?Object}
-     */
-    _objectPrototype: function(object)
-    {
-        if (InjectedScriptHost.subtype(object) === "proxy")
-            return null;
-        try {
-            return InjectedScriptHost.getPrototypeOf(object);
-        } catch (e) {
-            return null;
-        }
-    },
-
-    /**
-     * @param {!Object} object
-     * @param {!function(!Array<!Object>, !Object)} addPropertyIfNeeded
-     * @param {boolean=} ownProperties
-     * @param {boolean=} accessorPropertiesOnly
-     * @param {?Array<string>=} propertyNamesOnly
-     * @return {!Array<!Object>}
-     */
-    _propertyDescriptors: function(object, addPropertyIfNeeded, ownProperties, accessorPropertiesOnly, propertyNamesOnly)
-    {
-        var descriptors = [];
-        InjectedScriptHost.nullifyPrototype(descriptors);
-        var propertyProcessed = { __proto__: null };
-        var subtype = InjectedScriptHost.subtype(object);
-
-        /**
-         * @param {!Object} o
-         * @param {!Array<string|number|symbol>=} properties
-         * @param {number=} objectLength
-         * @return {boolean}
-         */
-        function process(o, properties, objectLength)
-        {
-            // When properties is not provided, iterate over the object's indices.
-            var length = properties ? properties.length : objectLength;
-            for (var i = 0; i < length; ++i) {
-                var property = properties ? properties[i] : ("" + i);
-                if (propertyProcessed[property])
-                    continue;
-                propertyProcessed[property] = true;
-                var name;
-                if (isSymbol(property))
-                    name = /** @type {string} */ (injectedScript._describe(property));
-                else
-                    name = typeof property === "number" ? ("" + property) : /** @type {string} */(property);
-
-                if (subtype === "internal#scopeList" && name === "length")
-                    continue;
-
-                var descriptor;
-                try {
-                    var nativeAccessorDescriptor = InjectedScriptHost.nativeAccessorDescriptor(o, property);
-                    if (nativeAccessorDescriptor && !nativeAccessorDescriptor.isBuiltin) {
-                        descriptor = { __proto__: null };
-                        if (nativeAccessorDescriptor.hasGetter)
-                            descriptor.get = function nativeGetter() { return o[property]; };
-                        if (nativeAccessorDescriptor.hasSetter)
-                            descriptor.set = function nativeSetter(v) { o[property] = v; };
-                    } else {
-                        descriptor = InjectedScriptHost.getOwnPropertyDescriptor(o, property);
-                        if (descriptor) {
-                            InjectedScriptHost.nullifyPrototype(descriptor);
-                        }
-                    }
-                    var isAccessorProperty = descriptor && ("get" in descriptor || "set" in descriptor);
-                    if (accessorPropertiesOnly && !isAccessorProperty)
-                        continue;
-                    if (descriptor && "get" in descriptor && "set" in descriptor && name !== "__proto__" &&
-                            InjectedScriptHost.formatAccessorsAsProperties(object, descriptor.get) &&
-                            !doesAttributeHaveObservableSideEffectOnGet(object, name)) {
-                        descriptor.value = object[property];
-                        descriptor.isOwn = true;
-                        delete descriptor.get;
-                        delete descriptor.set;
-                    }
-                } catch (e) {
-                    if (accessorPropertiesOnly)
-                        continue;
-                    descriptor = { value: e, wasThrown: true, __proto__: null };
-                }
-
-                // Not all bindings provide proper descriptors. Fall back to the non-configurable, non-enumerable,
-                // non-writable property.
-                if (!descriptor) {
-                    try {
-                        descriptor = { value: o[property], writable: false, __proto__: null };
-                    } catch (e) {
-                        // Silent catch.
-                        continue;
-                    }
-                }
-
-                descriptor.name = name;
-                if (o === object)
-                    descriptor.isOwn = true;
-                if (isSymbol(property))
-                    descriptor.symbol = property;
-                if (!addPropertyIfNeeded(descriptors, descriptor))
-                    return false;
-            }
-            return true;
-        }
-
-        if (propertyNamesOnly) {
-            for (var i = 0; i < propertyNamesOnly.length; ++i) {
-                var name = propertyNamesOnly[i];
-                for (var o = object; this._isDefined(o); o = this._objectPrototype(/** @type {!Object} */ (o))) {
-                    o = /** @type {!Object} */ (o);
-                    if (InjectedScriptHost.objectHasOwnProperty(o, name)) {
-                        if (!process(o, [name]))
-                            return descriptors;
-                        break;
-                    }
-                    if (ownProperties)
-                        break;
-                }
-            }
-            return descriptors;
-        }
-
-        var skipGetOwnPropertyNames;
-        try {
-            skipGetOwnPropertyNames = subtype === "typedarray" && object.length > 500000;
-        } catch (e) {
-        }
-
-        for (var o = object; this._isDefined(o); o = this._objectPrototype(/** @type {!Object} */ (o))) {
-            o = /** @type {!Object} */ (o);
-            if (InjectedScriptHost.subtype(o) === "proxy")
-                continue;
-
-            var typedArrays = subtype === "arraybuffer" ? InjectedScriptHost.typedArrayProperties(o) || [] : [];
-            for (var i = 0; i < typedArrays.length; i += 2)
-                addPropertyIfNeeded(descriptors, { name: typedArrays[i], value: typedArrays[i + 1], isOwn: true, enumerable: false, configurable: false, __proto__: null });
-
-            try {
-                if (skipGetOwnPropertyNames && o === object) {
-                    if (!process(o, undefined, o.length))
-                        return descriptors;
-                } else {
-                    // First call Object.keys() to enforce ordering of the property descriptors.
-                    if (!process(o, InjectedScriptHost.keys(o)))
-                        return descriptors;
-                    if (!process(o, InjectedScriptHost.getOwnPropertyNames(o)))
-                        return descriptors;
-                }
-                if (!process(o, InjectedScriptHost.getOwnPropertySymbols(o)))
-                    return descriptors;
-
-                if (ownProperties) {
-                    var proto = this._objectPrototype(o);
-                    if (proto && !accessorPropertiesOnly) {
-                        var descriptor = { name: "__proto__", value: proto, writable: true, configurable: true, enumerable: false, isOwn: true, __proto__: null };
-                        if (!addPropertyIfNeeded(descriptors, descriptor))
-                            return descriptors;
-                    }
-                }
-            } catch (e) {
-            }
-
-            if (ownProperties)
-                break;
-        }
-        return descriptors;
-    },
-
-    /**
-     * @param {string|undefined} objectGroupName
-     * @param {*} jsonMLObject
-     * @throws {string} error message
-     */
-    _substituteObjectTagsInCustomPreview: function(objectGroupName, jsonMLObject)
-    {
-        var maxCustomPreviewRecursionDepth = 20;
-        this._customPreviewRecursionDepth = (this._customPreviewRecursionDepth || 0) + 1
-        try {
-            if (this._customPreviewRecursionDepth >= maxCustomPreviewRecursionDepth)
-                throw new Error("Too deep hierarchy of inlined custom previews");
-
-            if (!isArrayLike(jsonMLObject))
-                return;
-
-            if (jsonMLObject[0] === "object") {
-                var attributes = jsonMLObject[1];
-                var originObject = attributes["object"];
-                var config = attributes["config"];
-                if (typeof originObject === "undefined")
-                    throw new Error("Illegal format: obligatory attribute \"object\" isn't specified");
-
-                jsonMLObject[1] = this._wrapObject(originObject, objectGroupName, false, false, null, false, false, config);
-                return;
-            }
-
-            for (var i = 0; i < jsonMLObject.length; ++i)
-                this._substituteObjectTagsInCustomPreview(objectGroupName, jsonMLObject[i]);
-        } finally {
-            this._customPreviewRecursionDepth--;
-        }
-    },
-
-    /**
-     * @param {*} object
-     * @return {boolean}
-     */
-    _isDefined: function(object)
-    {
-        return !!object || this._isHTMLAllCollection(object);
-    },
-
-    /**
-     * @param {*} object
-     * @return {boolean}
-     */
-    _isHTMLAllCollection: function(object)
-    {
-        // document.all is reported as undefined, but we still want to process it.
-        return (typeof object === "undefined") && !!InjectedScriptHost.subtype(object);
-    },
-
-    /**
-     * @param {*} obj
-     * @return {?string}
-     */
-    _subtype: function(obj)
-    {
-        if (obj === null)
-            return "null";
-
-        if (this.isPrimitiveValue(obj))
-            return null;
-
-        var subtype = InjectedScriptHost.subtype(obj);
-        if (subtype)
-            return subtype;
-
-        if (isArrayLike(obj))
-            return "array";
-
-        // If owning frame has navigated to somewhere else window properties will be undefined.
-        return null;
-    },
-
-    /**
-     * @param {*} obj
-     * @return {?string}
-     */
-    _describe: function(obj)
-    {
-        if (this.isPrimitiveValue(obj))
-            return null;
-
-        var subtype = this._subtype(obj);
-
-        if (subtype === "regexp")
-            return toString(obj);
-
-        if (subtype === "date")
-            return toString(obj);
-
-        if (subtype === "node") {
-            var description = "";
-            var nodeName = InjectedScriptHost.getProperty(obj, "nodeName");
-            if (nodeName) {
-                description = nodeName.toLowerCase();
-            } else {
-                var constructor = InjectedScriptHost.getProperty(obj, "constructor");
-                if (constructor)
-                    description = (InjectedScriptHost.getProperty(constructor, "name") || "").toLowerCase();
-            }
-
-            var nodeType = InjectedScriptHost.getProperty(obj, "nodeType");
-            switch (nodeType) {
-            case 1 /* Node.ELEMENT_NODE */:
-                var id = InjectedScriptHost.getProperty(obj, "id");
-                description += id ? "#" + id : "";
-                var className = InjectedScriptHost.getProperty(obj, "className");
-                description += (className && typeof className === "string") ? "." + className.trim().replace(/\s+/g, ".") : "";
-                break;
-            case 10 /*Node.DOCUMENT_TYPE_NODE */:
-                description = "<!DOCTYPE " + description + ">";
-                break;
-            }
-            return description;
-        }
-
-        if (subtype === "proxy")
-            return "Proxy";
-
-        var className = InjectedScriptHost.internalConstructorName(obj);
-        if (subtype === "array" || subtype === "typedarray") {
-            if (typeof obj.length === "number")
-                return className + "(" + obj.length + ")";
-            return className;
-        }
-
-        if (subtype === "map" || subtype === "set" || subtype === "blob") {
-            if (typeof obj.size === "number")
-                return className + "(" + obj.size + ")";
-            return className;
-        }
-
-        if (subtype === "arraybuffer" || subtype === "dataview") {
-            if (typeof obj.byteLength === "number")
-                return className + "(" + obj.byteLength + ")";
-            return className;
-        }
-
-        if (typeof obj === "function")
-            return toString(obj);
-
-        if (isSymbol(obj)) {
-            try {
-                // It isn't safe, because Symbol.prototype.toString can be overriden.
-                return /* suppressBlacklist */ obj.toString() || "Symbol";
-            } catch (e) {
-                return "Symbol";
-            }
-        }
-
-        if (InjectedScriptHost.subtype(obj) === "error") {
-            try {
-                var stack = obj.stack;
-                var message = obj.message && obj.message.length ? ": " + obj.message : "";
-                var firstCallFrame = /^\s+at\s/m.exec(stack);
-                var stackMessageEnd = firstCallFrame ? firstCallFrame.index : -1;
-                if (stackMessageEnd !== -1) {
-                    var stackTrace = stack.substr(stackMessageEnd);
-                    return className + message + "\n" + stackTrace;
-                }
-                return className + message;
-            } catch(e) {
-            }
-        }
-
-        if (subtype === "internal#entry") {
-            if ("key" in obj)
-                return "{" + this._describeIncludingPrimitives(obj.key) + " => " + this._describeIncludingPrimitives(obj.value) + "}";
-            return this._describeIncludingPrimitives(obj.value);
-        }
-
-        if (subtype === "internal#scopeList")
-            return "Scopes[" + obj.length + "]";
-
-        if (subtype === "internal#scope")
-            return (InjectedScript.closureTypes[obj.type] || "Unknown") + (obj.name ? " (" + obj.name + ")" : "");
-
-        return className;
-    },
-
-    /**
-     * @param {*} value
-     * @return {string}
-     */
-    _describeIncludingPrimitives: function(value)
-    {
-        if (typeof value === "string")
-            return "\"" + value.replace(/\n/g, "\u21B5") + "\"";
-        if (value === null)
-            return "" + value;
-        return this.isPrimitiveValue(value) ? toStringDescription(value) : (this._describe(value) || "");
-    },
-
-    /**
-     * @param {boolean} enabled
-     */
-    setCustomObjectFormatterEnabled: function(enabled)
-    {
-        this._customObjectFormatterEnabled = enabled;
-    }
-}
-
-/**
- * @type {!InjectedScript}
- * @const
- */
-var injectedScript = new InjectedScript();
-
-/**
- * @constructor
- * @param {*} object
- * @param {string=} objectGroupName
- * @param {boolean=} doNotBind
- * @param {boolean=} forceValueType
- * @param {boolean=} generatePreview
- * @param {?Array.<string>=} columnNames
- * @param {boolean=} isTable
- * @param {boolean=} skipEntriesPreview
- * @param {*=} customObjectConfig
- */
-InjectedScript.RemoteObject = function(object, objectGroupName, doNotBind, forceValueType, generatePreview, columnNames, isTable, skipEntriesPreview, customObjectConfig)
-{
-    this.type = typeof object;
-    if (this.type === "undefined" && injectedScript._isHTMLAllCollection(object))
-        this.type = "object";
-
-    if (injectedScript.isPrimitiveValue(object) || object === null || forceValueType) {
-        // We don't send undefined values over JSON.
-        if (this.type !== "undefined")
-            this.value = object;
-
-        // Null object is object with 'null' subtype.
-        if (object === null)
-            this.subtype = "null";
-
-        // Provide user-friendly number values.
-        if (this.type === "number") {
-            this.description = toStringDescription(object);
-            switch (this.description) {
-            case "NaN":
-            case "Infinity":
-            case "-Infinity":
-            case "-0":
-                delete this.value;
-                this.unserializableValue = this.description;
-                break;
-            }
-        }
-
-        return;
-    }
-
-    if (injectedScript._shouldPassByValue(object)) {
-        this.value = object;
-        this.subtype = injectedScript._subtype(object);
-        this.description = injectedScript._describeIncludingPrimitives(object);
-        return;
-    }
-
-    object = /** @type {!Object} */ (object);
-
-    if (!doNotBind)
-        this.objectId = injectedScript._bind(object, objectGroupName);
-    var subtype = injectedScript._subtype(object);
-    if (subtype)
-        this.subtype = subtype;
-    var className = InjectedScriptHost.internalConstructorName(object);
-    if (className)
-        this.className = className;
-    this.description = injectedScript._describe(object);
-
-    if (generatePreview && this.type === "object") {
-        if (this.subtype === "proxy")
-            this.preview = this._generatePreview(InjectedScriptHost.proxyTargetValue(object), undefined, columnNames, isTable, skipEntriesPreview);
-        else if (this.subtype !== "node")
-            this.preview = this._generatePreview(object, undefined, columnNames, isTable, skipEntriesPreview);
-    }
-
-    if (injectedScript._customObjectFormatterEnabled) {
-        var customPreview = this._customPreview(object, objectGroupName, customObjectConfig);
-        if (customPreview)
-            this.customPreview = customPreview;
-    }
-}
-
-InjectedScript.RemoteObject.prototype = {
-
-    /**
-     * @param {*} object
-     * @param {string=} objectGroupName
-     * @param {*=} customObjectConfig
-     * @return {?RuntimeAgent.CustomPreview}
-     */
-    _customPreview: function(object, objectGroupName, customObjectConfig)
-    {
-        /**
-         * @param {!Error} error
-         */
-        function logError(error)
-        {
-            // We use user code to generate custom output for object, we can use user code for reporting error too.
-            Promise.resolve().then(/* suppressBlacklist */ inspectedGlobalObject.console.error.bind(inspectedGlobalObject.console, "Custom Formatter Failed: " + error.message));
-        }
-
-        /**
-         * @param {*} object
-         * @param {*=} customObjectConfig
-         * @return {*}
-         */
-        function wrap(object, customObjectConfig)
-        {
-            return injectedScript._wrapObject(object, objectGroupName, false, false, null, false, false, customObjectConfig);
-        }
-
-        try {
-            var formatters = inspectedGlobalObject["devtoolsFormatters"];
-            if (!formatters || !isArrayLike(formatters))
-                return null;
-
-            for (var i = 0; i < formatters.length; ++i) {
-                try {
-                    var formatted = formatters[i].header(object, customObjectConfig);
-                    if (!formatted)
-                        continue;
-
-                    var hasBody = formatters[i].hasBody(object, customObjectConfig);
-                    injectedScript._substituteObjectTagsInCustomPreview(objectGroupName, formatted);
-                    var formatterObjectId = injectedScript._bind(formatters[i], objectGroupName);
-                    var bindRemoteObjectFunctionId = injectedScript._bind(wrap, objectGroupName);
-                    var result = {header: JSON.stringify(formatted), hasBody: !!hasBody, formatterObjectId: formatterObjectId, bindRemoteObjectFunctionId: bindRemoteObjectFunctionId};
-                    if (customObjectConfig)
-                        result["configObjectId"] = injectedScript._bind(customObjectConfig, objectGroupName);
-                    return result;
-                } catch (e) {
-                    logError(e);
-                }
-            }
-        } catch (e) {
-            logError(e);
-        }
-        return null;
-    },
-
-    /**
-     * @return {!RuntimeAgent.ObjectPreview} preview
-     */
-    _createEmptyPreview: function()
-    {
-        var preview = {
-            type: /** @type {!RuntimeAgent.ObjectPreviewType.<string>} */ (this.type),
-            description: this.description || toStringDescription(this.value),
-            overflow: false,
-            properties: [],
-            __proto__: null
-        };
-        InjectedScriptHost.nullifyPrototype(preview.properties);
-        if (this.subtype)
-            preview.subtype = /** @type {!RuntimeAgent.ObjectPreviewSubtype.<string>} */ (this.subtype);
-        return preview;
-    },
-
-    /**
-     * @param {!Object} object
-     * @param {?Array.<string>=} firstLevelKeys
-     * @param {?Array.<string>=} secondLevelKeys
-     * @param {boolean=} isTable
-     * @param {boolean=} skipEntriesPreview
-     * @return {!RuntimeAgent.ObjectPreview} preview
-     */
-    _generatePreview: function(object, firstLevelKeys, secondLevelKeys, isTable, skipEntriesPreview)
-    {
-        var preview = this._createEmptyPreview();
-        var firstLevelKeysCount = firstLevelKeys ? firstLevelKeys.length : 0;
-        var propertiesThreshold = {
-            properties: isTable ? 1000 : max(5, firstLevelKeysCount),
-            indexes: isTable ? 1000 : max(100, firstLevelKeysCount),
-            __proto__: null
-        };
-        var subtype = this.subtype;
-        var primitiveString;
-
-        try {
-            var descriptors = [];
-            InjectedScriptHost.nullifyPrototype(descriptors);
-
-            // Add internal properties to preview.
-            var rawInternalProperties = InjectedScriptHost.getInternalProperties(object) || [];
-            var internalProperties = [];
-            InjectedScriptHost.nullifyPrototype(rawInternalProperties);
-            InjectedScriptHost.nullifyPrototype(internalProperties);
-            var entries = null;
-            for (var i = 0; i < rawInternalProperties.length; i += 2) {
-                if (rawInternalProperties[i] === "[[Entries]]") {
-                    entries = /** @type {!Array<*>} */(rawInternalProperties[i + 1]);
-                    continue;
-                }
-                if (rawInternalProperties[i] === "[[PrimitiveValue]]" && typeof rawInternalProperties[i + 1] === 'string')
-                    primitiveString = rawInternalProperties[i + 1];
-                var internalPropertyDescriptor = {
-                    name: rawInternalProperties[i],
-                    value: rawInternalProperties[i + 1],
-                    isOwn: true,
-                    enumerable: true,
-                    __proto__: null
-                };
-                push(descriptors, internalPropertyDescriptor);
-            }
-            var naturalDescriptors = injectedScript._propertyDescriptors(object, addPropertyIfNeeded, false /* ownProperties */, undefined /* accessorPropertiesOnly */, firstLevelKeys);
-            for (var i = 0; i < naturalDescriptors.length; i++)
-                push(descriptors, naturalDescriptors[i]);
-
-            this._appendPropertyPreviewDescriptors(preview, descriptors, secondLevelKeys, isTable);
-
-            if (subtype === "map" || subtype === "set" || subtype === "weakmap" || subtype === "weakset" || subtype === "iterator")
-                this._appendEntriesPreview(entries, preview, skipEntriesPreview);
-
-        } catch (e) {}
-
-        return preview;
-
-        /**
-         * @param {!Array<!Object>} descriptors
-         * @param {!Object} descriptor
-         * @return {boolean}
-         */
-        function addPropertyIfNeeded(descriptors, descriptor) {
-            if (descriptor.wasThrown)
-                return true;
-
-            // Ignore __proto__ property.
-            if (descriptor.name === "__proto__")
-                return true;
-
-            // Ignore length property of array.
-            if ((subtype === "array" || subtype === "typedarray") && descriptor.name === "length")
-                return true;
-
-            // Ignore size property of map, set.
-            if ((subtype === "map" || subtype === "set") && descriptor.name === "size")
-                return true;
-
-            // Ignore ArrayBuffer previews
-            if (subtype === 'arraybuffer' && (descriptor.name === "[[Int8Array]]" || descriptor.name === "[[Uint8Array]]" || descriptor.name === "[[Int16Array]]" || descriptor.name === "[[Int32Array]]"))
-                return true;
-
-            // Never preview prototype properties.
-            if (!descriptor.isOwn)
-                return true;
-
-            // Ignore computed properties unless they have getters.
-            if (!("value" in descriptor) && !descriptor.get)
-                return true;
-
-            // Ignore index properties when there is a primitive string.
-            if (primitiveString && primitiveString[descriptor.name] === descriptor.value)
-                return true;
-
-            if (toString(descriptor.name >>> 0) === descriptor.name)
-                propertiesThreshold.indexes--;
-            else
-                propertiesThreshold.properties--;
-
-            var canContinue = propertiesThreshold.indexes >= 0 && propertiesThreshold.properties >= 0;
-            if (!canContinue) {
-                preview.overflow = true;
-                return false;
-            }
-            push(descriptors, descriptor);
-            return true;
-        }
-    },
-
-    /**
-     * @param {!RuntimeAgent.ObjectPreview} preview
-     * @param {!Array.<*>|!Iterable.<*>} descriptors
-     * @param {?Array.<string>=} secondLevelKeys
-     * @param {boolean=} isTable
-     */
-    _appendPropertyPreviewDescriptors: function(preview, descriptors, secondLevelKeys, isTable)
-    {
-        for (var i = 0; i < descriptors.length; ++i) {
-            var descriptor = descriptors[i];
-            var name = descriptor.name;
-            var value = descriptor.value;
-            var type = typeof value;
-
-            // Special-case HTMLAll.
-            if (type === "undefined" && injectedScript._isHTMLAllCollection(value))
-                type = "object";
-
-            // Ignore computed properties unless they have getters.
-            if (descriptor.get && !("value" in descriptor)) {
-                push(preview.properties, { name: name, type: "accessor", __proto__: null });
-                continue;
-            }
-
-            // Render own properties.
-            if (value === null) {
-                push(preview.properties, { name: name, type: "object", subtype: "null", value: "null", __proto__: null });
-                continue;
-            }
-
-            var maxLength = 100;
-            if (InjectedScript.primitiveTypes[type]) {
-                if (type === "string" && value.length > maxLength)
-                    value = this._abbreviateString(value, maxLength, true);
-                push(preview.properties, { name: name, type: type, value: toStringDescription(value), __proto__: null });
-                continue;
-            }
-
-            var property = { name: name, type: type, __proto__: null };
-            var subtype = injectedScript._subtype(value);
-            if (subtype)
-                property.subtype = subtype;
-
-            if (secondLevelKeys === null || secondLevelKeys) {
-                var subPreview = this._generatePreview(value, secondLevelKeys || undefined, undefined, isTable);
-                property.valuePreview = subPreview;
-                if (subPreview.overflow)
-                    preview.overflow = true;
-            } else {
-                var description = "";
-                if (type !== "function")
-                    description = this._abbreviateString(/** @type {string} */ (injectedScript._describe(value)), maxLength, subtype === "regexp");
-                property.value = description;
-            }
-            push(preview.properties, property);
-        }
-    },
-
-    /**
-     * @param {?Array<*>} entries
-     * @param {!RuntimeAgent.ObjectPreview} preview
-     * @param {boolean=} skipEntriesPreview
-     */
-    _appendEntriesPreview: function(entries, preview, skipEntriesPreview)
-    {
-        if (!entries)
-            return;
-        if (skipEntriesPreview) {
-            if (entries.length)
-                preview.overflow = true;
-            return;
-        }
-        preview.entries = [];
-        InjectedScriptHost.nullifyPrototype(preview.entries);
-        var entriesThreshold = 5;
-        for (var i = 0; i < entries.length; ++i) {
-            if (preview.entries.length >= entriesThreshold) {
-                preview.overflow = true;
-                break;
-            }
-            var entry = entries[i];
-            InjectedScriptHost.nullifyPrototype(entry);
-            var previewEntry = {
-                value: generateValuePreview(entry.value),
-                __proto__: null
-            };
-            if ("key" in entry)
-                previewEntry.key = generateValuePreview(entry.key);
-            push(preview.entries, previewEntry);
-        }
-
-        /**
-         * @param {*} value
-         * @return {!RuntimeAgent.ObjectPreview}
-         */
-        function generateValuePreview(value)
-        {
-            var remoteObject = new InjectedScript.RemoteObject(value, undefined, true, undefined, true, undefined, undefined, true);
-            var valuePreview = remoteObject.preview || remoteObject._createEmptyPreview();
-            return valuePreview;
-        }
-    },
-
-    /**
-     * @param {string} string
-     * @param {number} maxLength
-     * @param {boolean=} middle
-     * @return {string}
-     */
-    _abbreviateString: function(string, maxLength, middle)
-    {
-        if (string.length <= maxLength)
-            return string;
-        if (middle) {
-            var leftHalf = maxLength >> 1;
-            var rightHalf = maxLength - leftHalf - 1;
-            return string.substr(0, leftHalf) + "\u2026" + string.substr(string.length - rightHalf, rightHalf);
-        }
-        return string.substr(0, maxLength) + "\u2026";
-    },
-
-    __proto__: null
-}
-
-return injectedScript;
-})
diff --git a/src/v8/src/inspector/injected_script_externs.js b/src/v8/src/inspector/injected_script_externs.js
deleted file mode 100644
index d293b85..0000000
--- a/src/v8/src/inspector/injected_script_externs.js
+++ /dev/null
@@ -1,122 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/** @interface */
-function InjectedScriptHostClass()
-{
-}
-
-/**
- * @param {*} obj
- */
-InjectedScriptHostClass.prototype.nullifyPrototype = function(obj) {}
-
-/**
- * @param {*} obj
- * @param {string} name
- * @return {*}
- */
-InjectedScriptHostClass.prototype.getProperty = function(obj, name) {}
-
-/**
- * @param {*} obj
- * @return {string}
- */
-InjectedScriptHostClass.prototype.internalConstructorName = function(obj) {}
-
-/**
- * @param {*} obj
- * @param {function()|undefined} func
- * @return {boolean}
- */
-InjectedScriptHostClass.prototype.formatAccessorsAsProperties = function(obj, func) {}
-
-/**
- * @param {*} obj
- * @return {string}
- */
-InjectedScriptHostClass.prototype.subtype = function(obj) {}
-
-/**
- * @param {*} obj
- * @return {boolean}
- */
-InjectedScriptHostClass.prototype.isTypedArray = function(obj) {}
-
-/**
- * @param {*} obj
- * @return {!Array.<*>}
- */
-InjectedScriptHostClass.prototype.getInternalProperties = function(obj) {}
-
-/**
- * @param {!Object} object
- * @param {string} propertyName
- * @return {boolean}
- */
-InjectedScriptHostClass.prototype.objectHasOwnProperty = function(object, propertyName) {}
-
-/**
- * @param {*} value
- * @param {string} groupName
- * @return {number}
- */
-InjectedScriptHostClass.prototype.bind = function(value, groupName) {}
-
-/**
- * @param {!Object} object
- * @return {!Object}
- */
-InjectedScriptHostClass.prototype.proxyTargetValue = function(object) {}
-
-/**
- * @param {!Object} obj
- * @return {!Array<string>}
- */
-InjectedScriptHostClass.prototype.keys = function(obj) {}
-
-/**
- * @param {!Object} obj
- * @return {Object}
- */
-InjectedScriptHostClass.prototype.getPrototypeOf = function(obj) {}
-
-/**
- * @param {!Object} obj
- * @param {string} prop
- * @return {Object}
- */
-InjectedScriptHostClass.prototype.getOwnPropertyDescriptor = function(obj, prop) {}
-
-/**
- * @param {!Object} obj
- * @return {!Array<string>}
- */
-InjectedScriptHostClass.prototype.getOwnPropertyNames = function(obj) {}
-
-/**
- * @param {!Object} obj
- * @return {!Array<symbol>}
- */
-InjectedScriptHostClass.prototype.getOwnPropertySymbols = function(obj) {}
-
-/**
- * @param {!Object} obj
- * @param {string|symbol} name
- * @return {{isBuiltin:boolean, hasGetter:boolean, hasSetter:boolean}|undefined}
- */
-InjectedScriptHostClass.prototype.nativeAccessorDescriptor = function(obj, name) {}
-
-/**
- * @param {!Object} arrayBuffer
- * @return {Array<Object>|undefined}
- */
-InjectedScriptHostClass.prototype.typedArrayProperties = function(arrayBuffer) {}
-
-/** @type {!InjectedScriptHostClass} */
-var InjectedScriptHost;
-/** @type {!Window} */
-var inspectedGlobalObject;
-/** @type {number} */
-var injectedScriptId;
diff --git a/src/v8/src/inspector/js_protocol-1.2.json b/src/v8/src/inspector/js_protocol-1.2.json
deleted file mode 100644
index aff6806..0000000
--- a/src/v8/src/inspector/js_protocol-1.2.json
+++ /dev/null
@@ -1,997 +0,0 @@
-{
-    "version": { "major": "1", "minor": "2" },
-    "domains": [
-    {
-        "domain": "Schema",
-        "description": "Provides information about the protocol schema.",
-        "types": [
-            {
-                "id": "Domain",
-                "type": "object",
-                "description": "Description of the protocol domain.",
-                "exported": true,
-                "properties": [
-                    { "name": "name", "type": "string", "description": "Domain name." },
-                    { "name": "version", "type": "string", "description": "Domain version." }
-                ]
-            }
-        ],
-        "commands": [
-            {
-                "name": "getDomains",
-                "description": "Returns supported domains.",
-                "handlers": ["browser", "renderer"],
-                "returns": [
-                    { "name": "domains", "type": "array", "items": { "$ref": "Domain" }, "description": "List of supported domains." }
-                ]
-            }
-        ]
-    },
-    {
-        "domain": "Runtime",
-        "description": "Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects. Evaluation results are returned as mirror object that expose object type, string representation and unique identifier that can be used for further object reference. Original objects are maintained in memory unless they are either explicitly released or are released along with the other objects in their object group.",
-        "types": [
-            {
-                "id": "ScriptId",
-                "type": "string",
-                "description": "Unique script identifier."
-            },
-            {
-                "id": "RemoteObjectId",
-                "type": "string",
-                "description": "Unique object identifier."
-            },
-            {
-                "id": "UnserializableValue",
-                "type": "string",
-                "enum": ["Infinity", "NaN", "-Infinity", "-0"],
-                "description": "Primitive value which cannot be JSON-stringified."
-            },
-            {
-                "id": "RemoteObject",
-                "type": "object",
-                "description": "Mirror object referencing original JavaScript object.",
-                "exported": true,
-                "properties": [
-                    { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean", "symbol"], "description": "Object type." },
-                    { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date", "map", "set", "iterator", "generator", "error", "proxy", "promise", "typedarray"], "description": "Object subtype hint. Specified for <code>object</code> type values only." },
-                    { "name": "className", "type": "string", "optional": true, "description": "Object class (constructor) name. Specified for <code>object</code> type values only." },
-                    { "name": "value", "type": "any", "optional": true, "description": "Remote object value in case of primitive values or JSON values (if it was requested)." },
-                    { "name": "unserializableValue", "$ref": "UnserializableValue", "optional": true, "description": "Primitive value which can not be JSON-stringified does not have <code>value</code>, but gets this property." },
-                    { "name": "description", "type": "string", "optional": true, "description": "String representation of the object." },
-                    { "name": "objectId", "$ref": "RemoteObjectId", "optional": true, "description": "Unique object identifier (for non-primitive values)." },
-                    { "name": "preview", "$ref": "ObjectPreview", "optional": true, "description": "Preview containing abbreviated property values. Specified for <code>object</code> type values only.", "experimental": true },
-                    { "name": "customPreview", "$ref": "CustomPreview", "optional": true, "experimental": true}
-                ]
-            },
-            {
-                "id": "CustomPreview",
-                "type": "object",
-                "experimental": true,
-                "properties": [
-                    { "name": "header", "type": "string"},
-                    { "name": "hasBody", "type": "boolean"},
-                    { "name": "formatterObjectId", "$ref": "RemoteObjectId"},
-                    { "name": "bindRemoteObjectFunctionId", "$ref": "RemoteObjectId" },
-                    { "name": "configObjectId", "$ref": "RemoteObjectId", "optional": true }
-                ]
-            },
-            {
-                "id": "ObjectPreview",
-                "type": "object",
-                "experimental": true,
-                "description": "Object containing abbreviated remote object value.",
-                "properties": [
-                    { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean", "symbol"], "description": "Object type." },
-                    { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date", "map", "set", "iterator", "generator", "error"], "description": "Object subtype hint. Specified for <code>object</code> type values only." },
-                    { "name": "description", "type": "string", "optional": true, "description": "String representation of the object." },
-                    { "name": "overflow", "type": "boolean", "description": "True iff some of the properties or entries of the original object did not fit." },
-                    { "name": "properties", "type": "array", "items": { "$ref": "PropertyPreview" }, "description": "List of the properties." },
-                    { "name": "entries", "type": "array", "items": { "$ref": "EntryPreview" }, "optional": true, "description": "List of the entries. Specified for <code>map</code> and <code>set</code> subtype values only." }
-                ]
-            },
-            {
-                "id": "PropertyPreview",
-                "type": "object",
-                "experimental": true,
-                "properties": [
-                    { "name": "name", "type": "string", "description": "Property name." },
-                    { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean", "symbol", "accessor"], "description": "Object type. Accessor means that the property itself is an accessor property." },
-                    { "name": "value", "type": "string", "optional": true, "description": "User-friendly property value string." },
-                    { "name": "valuePreview", "$ref": "ObjectPreview", "optional": true, "description": "Nested value preview." },
-                    { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date", "map", "set", "iterator", "generator", "error"], "description": "Object subtype hint. Specified for <code>object</code> type values only." }
-                ]
-            },
-            {
-                "id": "EntryPreview",
-                "type": "object",
-                "experimental": true,
-                "properties": [
-                    { "name": "key", "$ref": "ObjectPreview", "optional": true, "description": "Preview of the key. Specified for map-like collection entries." },
-                    { "name": "value", "$ref": "ObjectPreview", "description": "Preview of the value." }
-                ]
-            },
-            {
-                "id": "PropertyDescriptor",
-                "type": "object",
-                "description": "Object property descriptor.",
-                "properties": [
-                    { "name": "name", "type": "string", "description": "Property name or symbol description." },
-                    { "name": "value", "$ref": "RemoteObject", "optional": true, "description": "The value associated with the property." },
-                    { "name": "writable", "type": "boolean", "optional": true, "description": "True if the value associated with the property may be changed (data descriptors only)." },
-                    { "name": "get", "$ref": "RemoteObject", "optional": true, "description": "A function which serves as a getter for the property, or <code>undefined</code> if there is no getter (accessor descriptors only)." },
-                    { "name": "set", "$ref": "RemoteObject", "optional": true, "description": "A function which serves as a setter for the property, or <code>undefined</code> if there is no setter (accessor descriptors only)." },
-                    { "name": "configurable", "type": "boolean", "description": "True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object." },
-                    { "name": "enumerable", "type": "boolean", "description": "True if this property shows up during enumeration of the properties on the corresponding object." },
-                    { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." },
-                    { "name": "isOwn", "optional": true, "type": "boolean", "description": "True if the property is owned for the object." },
-                    { "name": "symbol", "$ref": "RemoteObject", "optional": true, "description": "Property symbol object, if the property is of the <code>symbol</code> type." }
-                ]
-            },
-            {
-                "id": "InternalPropertyDescriptor",
-                "type": "object",
-                "description": "Object internal property descriptor. This property isn't normally visible in JavaScript code.",
-                "properties": [
-                    { "name": "name", "type": "string", "description": "Conventional property name." },
-                    { "name": "value", "$ref": "RemoteObject", "optional": true, "description": "The value associated with the property." }
-                ]
-            },
-            {
-                "id": "CallArgument",
-                "type": "object",
-                "description": "Represents function call argument. Either remote object id <code>objectId</code>, primitive <code>value</code>, unserializable primitive value or neither of (for undefined) them should be specified.",
-                "properties": [
-                    { "name": "value", "type": "any", "optional": true, "description": "Primitive value." },
-                    { "name": "unserializableValue", "$ref": "UnserializableValue", "optional": true, "description": "Primitive value which can not be JSON-stringified." },
-                    { "name": "objectId", "$ref": "RemoteObjectId", "optional": true, "description": "Remote object handle." }
-                ]
-            },
-            {
-                "id": "ExecutionContextId",
-                "type": "integer",
-                "description": "Id of an execution context."
-            },
-            {
-                "id": "ExecutionContextDescription",
-                "type": "object",
-                "description": "Description of an isolated world.",
-                "properties": [
-                    { "name": "id", "$ref": "ExecutionContextId", "description": "Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed." },
-                    { "name": "origin", "type": "string", "description": "Execution context origin." },
-                    { "name": "name", "type": "string", "description": "Human readable name describing given context." },
-                    { "name": "auxData", "type": "object", "optional": true, "description": "Embedder-specific auxiliary data." }
-                ]
-            },
-            {
-                "id": "ExceptionDetails",
-                "type": "object",
-                "description": "Detailed information about exception (or error) that was thrown during script compilation or execution.",
-                "properties": [
-                    { "name": "exceptionId", "type": "integer", "description": "Exception id." },
-                    { "name": "text", "type": "string", "description": "Exception text, which should be used together with exception object when available." },
-                    { "name": "lineNumber", "type": "integer", "description": "Line number of the exception location (0-based)." },
-                    { "name": "columnNumber", "type": "integer", "description": "Column number of the exception location (0-based)." },
-                    { "name": "scriptId", "$ref": "ScriptId", "optional": true, "description": "Script ID of the exception location." },
-                    { "name": "url", "type": "string", "optional": true, "description": "URL of the exception location, to be used when the script was not reported." },
-                    { "name": "stackTrace", "$ref": "StackTrace", "optional": true, "description": "JavaScript stack trace if available." },
-                    { "name": "exception", "$ref": "RemoteObject", "optional": true, "description": "Exception object if available." },
-                    { "name": "executionContextId", "$ref": "ExecutionContextId", "optional": true, "description": "Identifier of the context where exception happened." }
-                ]
-            },
-            {
-                "id": "Timestamp",
-                "type": "number",
-                "description": "Number of milliseconds since epoch."
-            },
-            {
-                "id": "CallFrame",
-                "type": "object",
-                "description": "Stack entry for runtime errors and assertions.",
-                "properties": [
-                    { "name": "functionName", "type": "string", "description": "JavaScript function name." },
-                    { "name": "scriptId", "$ref": "ScriptId", "description": "JavaScript script id." },
-                    { "name": "url", "type": "string", "description": "JavaScript script name or url." },
-                    { "name": "lineNumber", "type": "integer", "description": "JavaScript script line number (0-based)." },
-                    { "name": "columnNumber", "type": "integer", "description": "JavaScript script column number (0-based)." }
-                ]
-            },
-            {
-                "id": "StackTrace",
-                "type": "object",
-                "description": "Call frames for assertions or error messages.",
-                "exported": true,
-                "properties": [
-                    { "name": "description", "type": "string", "optional": true, "description": "String label of this stack trace. For async traces this may be a name of the function that initiated the async call." },
-                    { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame" }, "description": "JavaScript function name." },
-                    { "name": "parent", "$ref": "StackTrace", "optional": true, "description": "Asynchronous JavaScript stack trace that preceded this stack, if available." }
-                ]
-            }
-        ],
-        "commands": [
-            {
-                "name": "evaluate",
-                "async": true,
-                "parameters": [
-                    { "name": "expression", "type": "string", "description": "Expression to evaluate." },
-                    { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." },
-                    { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Determines whether Command Line API should be available during the evaluation." },
-                    { "name": "silent", "type": "boolean", "optional": true, "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state." },
-                    { "name": "contextId", "$ref": "ExecutionContextId", "optional": true, "description": "Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page." },
-                    { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object that should be sent by value." },
-                    { "name": "generatePreview", "type": "boolean", "optional": true, "experimental": true, "description": "Whether preview should be generated for the result." },
-                    { "name": "userGesture", "type": "boolean", "optional": true, "experimental": true, "description": "Whether execution should be treated as initiated by user in the UI." },
-                    { "name": "awaitPromise", "type": "boolean", "optional":true, "description": "Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error." }
-                ],
-                "returns": [
-                    { "name": "result", "$ref": "RemoteObject", "description": "Evaluation result." },
-                    { "name": "exceptionDetails", "$ref": "ExceptionDetails", "optional": true, "description": "Exception details."}
-                ],
-                "description": "Evaluates expression on global object."
-            },
-            {
-                "name": "awaitPromise",
-                "async": true,
-                "parameters": [
-                    { "name": "promiseObjectId", "$ref": "RemoteObjectId", "description": "Identifier of the promise." },
-                    { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object that should be sent by value." },
-                    { "name": "generatePreview", "type": "boolean", "optional": true, "description": "Whether preview should be generated for the result." }
-                ],
-                "returns": [
-                    { "name": "result", "$ref": "RemoteObject", "description": "Promise result. Will contain rejected value if promise was rejected." },
-                    { "name": "exceptionDetails", "$ref": "ExceptionDetails", "optional": true, "description": "Exception details if stack strace is available."}
-                ],
-                "description": "Add handler to promise with given promise object id."
-            },
-            {
-                "name": "callFunctionOn",
-                "async": true,
-                "parameters": [
-                    { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to call function on." },
-                    { "name": "functionDeclaration", "type": "string", "description": "Declaration of the function to call." },
-                    { "name": "arguments", "type": "array", "items": { "$ref": "CallArgument", "description": "Call argument." }, "optional": true, "description": "Call arguments. All call arguments must belong to the same JavaScript world as the target object." },
-                    { "name": "silent", "type": "boolean", "optional": true, "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state." },
-                    { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object which should be sent by value." },
-                    { "name": "generatePreview", "type": "boolean", "optional": true, "experimental": true, "description": "Whether preview should be generated for the result." },
-                    { "name": "userGesture", "type": "boolean", "optional": true, "experimental": true, "description": "Whether execution should be treated as initiated by user in the UI." },
-                    { "name": "awaitPromise", "type": "boolean", "optional":true, "description": "Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error." }
-                ],
-                "returns": [
-                    { "name": "result", "$ref": "RemoteObject", "description": "Call result." },
-                    { "name": "exceptionDetails", "$ref": "ExceptionDetails", "optional": true, "description": "Exception details."}
-                ],
-                "description": "Calls function with given declaration on the given object. Object group of the result is inherited from the target object."
-            },
-            {
-                "name": "getProperties",
-                "parameters": [
-                    { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to return properties for." },
-                    { "name": "ownProperties", "optional": true, "type": "boolean", "description": "If true, returns properties belonging only to the element itself, not to its prototype chain." },
-                    { "name": "accessorPropertiesOnly", "optional": true, "type": "boolean", "description": "If true, returns accessor properties (with getter/setter) only; internal properties are not returned either.", "experimental": true },
-                    { "name": "generatePreview", "type": "boolean", "optional": true, "experimental": true, "description": "Whether preview should be generated for the results." }
-                ],
-                "returns": [
-                    { "name": "result", "type": "array", "items": { "$ref": "PropertyDescriptor" }, "description": "Object properties." },
-                    { "name": "internalProperties", "optional": true, "type": "array", "items": { "$ref": "InternalPropertyDescriptor" }, "description": "Internal object properties (only of the element itself)." },
-                    { "name": "exceptionDetails", "$ref": "ExceptionDetails", "optional": true, "description": "Exception details."}
-                ],
-                "description": "Returns properties of a given object. Object group of the result is inherited from the target object."
-            },
-            {
-                "name": "releaseObject",
-                "parameters": [
-                    { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to release." }
-                ],
-                "description": "Releases remote object with given id."
-            },
-            {
-                "name": "releaseObjectGroup",
-                "parameters": [
-                    { "name": "objectGroup", "type": "string", "description": "Symbolic object group name." }
-                ],
-                "description": "Releases all remote objects that belong to a given group."
-            },
-            {
-                "name": "runIfWaitingForDebugger",
-                "description": "Tells inspected instance to run if it was waiting for debugger to attach."
-            },
-            {
-                "name": "enable",
-                "description": "Enables reporting of execution contexts creation by means of <code>executionContextCreated</code> event. When the reporting gets enabled the event will be sent immediately for each existing execution context."
-            },
-            {
-                "name": "disable",
-                "description": "Disables reporting of execution contexts creation."
-            },
-            {
-                "name": "discardConsoleEntries",
-                "description": "Discards collected exceptions and console API calls."
-            },
-            {
-                "name": "setCustomObjectFormatterEnabled",
-                "parameters": [
-                    {
-                        "name": "enabled",
-                        "type": "boolean"
-                    }
-                ],
-                "experimental": true
-            },
-            {
-                "name": "compileScript",
-                "parameters": [
-                    { "name": "expression", "type": "string", "description": "Expression to compile." },
-                    { "name": "sourceURL", "type": "string", "description": "Source url to be set for the script." },
-                    { "name": "persistScript", "type": "boolean", "description": "Specifies whether the compiled script should be persisted." },
-                    { "name": "executionContextId", "$ref": "ExecutionContextId", "optional": true, "description": "Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page." }
-                ],
-                "returns": [
-                    { "name": "scriptId", "$ref": "ScriptId", "optional": true, "description": "Id of the script." },
-                    { "name": "exceptionDetails", "$ref": "ExceptionDetails", "optional": true, "description": "Exception details."}
-                ],
-                "description": "Compiles expression."
-            },
-            {
-                "name": "runScript",
-                "async": true,
-                "parameters": [
-                    { "name": "scriptId", "$ref": "ScriptId", "description": "Id of the script to run." },
-                    { "name": "executionContextId", "$ref": "ExecutionContextId", "optional": true, "description": "Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page." },
-                    { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." },
-                    { "name": "silent", "type": "boolean", "optional": true, "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state." },
-                    { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Determines whether Command Line API should be available during the evaluation." },
-                    { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object which should be sent by value." },
-                    { "name": "generatePreview", "type": "boolean", "optional": true, "description": "Whether preview should be generated for the result." },
-                    { "name": "awaitPromise", "type": "boolean", "optional": true, "description": "Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error." }
-                ],
-                "returns": [
-                    { "name": "result", "$ref": "RemoteObject", "description": "Run result." },
-                    { "name": "exceptionDetails", "$ref": "ExceptionDetails", "optional": true, "description": "Exception details."}
-                ],
-                "description": "Runs script with given id in a given context."
-            }
-        ],
-        "events": [
-            {
-                "name": "executionContextCreated",
-                "parameters": [
-                    { "name": "context", "$ref": "ExecutionContextDescription", "description": "A newly created execution contex." }
-                ],
-                "description": "Issued when new execution context is created."
-            },
-            {
-                "name": "executionContextDestroyed",
-                "parameters": [
-                    { "name": "executionContextId", "$ref": "ExecutionContextId", "description": "Id of the destroyed context" }
-                ],
-                "description": "Issued when execution context is destroyed."
-            },
-            {
-                "name": "executionContextsCleared",
-                "description": "Issued when all executionContexts were cleared in browser"
-            },
-            {
-                "name": "exceptionThrown",
-                "description": "Issued when exception was thrown and unhandled.",
-                "parameters": [
-                    { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp of the exception." },
-                    { "name": "exceptionDetails", "$ref": "ExceptionDetails" }
-                ]
-            },
-            {
-                "name": "exceptionRevoked",
-                "description": "Issued when unhandled exception was revoked.",
-                "parameters": [
-                    { "name": "reason", "type": "string", "description": "Reason describing why exception was revoked." },
-                    { "name": "exceptionId", "type": "integer", "description": "The id of revoked exception, as reported in <code>exceptionUnhandled</code>." }
-                ]
-            },
-            {
-                "name": "consoleAPICalled",
-                "description": "Issued when console API was called.",
-                "parameters": [
-                    { "name": "type", "type": "string", "enum": ["log", "debug", "info", "error", "warning", "dir", "dirxml", "table", "trace", "clear", "startGroup", "startGroupCollapsed", "endGroup", "assert", "profile", "profileEnd"], "description": "Type of the call." },
-                    { "name": "args", "type": "array", "items": { "$ref": "RemoteObject" }, "description": "Call arguments." },
-                    { "name": "executionContextId", "$ref": "ExecutionContextId", "description": "Identifier of the context where the call was made." },
-                    { "name": "timestamp", "$ref": "Timestamp", "description": "Call timestamp." },
-                    { "name": "stackTrace", "$ref": "StackTrace", "optional": true, "description": "Stack trace captured when the call was made." }
-                ]
-            },
-            {
-                "name": "inspectRequested",
-                "description": "Issued when object should be inspected (for example, as a result of inspect() command line API call).",
-                "parameters": [
-                    { "name": "object", "$ref": "RemoteObject" },
-                    { "name": "hints", "type": "object" }
-                ]
-            }
-        ]
-    },
-    {
-        "domain": "Debugger",
-        "description": "Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing breakpoints, stepping through execution, exploring stack traces, etc.",
-        "dependencies": ["Runtime"],
-        "types": [
-            {
-                "id": "BreakpointId",
-                "type": "string",
-                "description": "Breakpoint identifier."
-            },
-            {
-                "id": "CallFrameId",
-                "type": "string",
-                "description": "Call frame identifier."
-            },
-            {
-                "id": "Location",
-                "type": "object",
-                "properties": [
-                    { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Script identifier as reported in the <code>Debugger.scriptParsed</code>." },
-                    { "name": "lineNumber", "type": "integer", "description": "Line number in the script (0-based)." },
-                    { "name": "columnNumber", "type": "integer", "optional": true, "description": "Column number in the script (0-based)." }
-                ],
-                "description": "Location in the source code."
-            },
-            {
-                "id": "ScriptPosition",
-                "experimental": true,
-                "type": "object",
-                "properties": [
-                    { "name": "lineNumber", "type": "integer" },
-                    { "name": "columnNumber", "type": "integer" }
-                ],
-                "description": "Location in the source code."
-            },
-            {
-                "id": "CallFrame",
-                "type": "object",
-                "properties": [
-                    { "name": "callFrameId", "$ref": "CallFrameId", "description": "Call frame identifier. This identifier is only valid while the virtual machine is paused." },
-                    { "name": "functionName", "type": "string", "description": "Name of the JavaScript function called on this call frame." },
-                    { "name": "functionLocation", "$ref": "Location", "optional": true, "experimental": true, "description": "Location in the source code." },
-                    { "name": "location", "$ref": "Location", "description": "Location in the source code." },
-                    { "name": "scopeChain", "type": "array", "items": { "$ref": "Scope" }, "description": "Scope chain for this call frame." },
-                    { "name": "this", "$ref": "Runtime.RemoteObject", "description": "<code>this</code> object for this call frame." },
-                    { "name": "returnValue", "$ref": "Runtime.RemoteObject", "optional": true, "description": "The value being returned, if the function is at return point." }
-                ],
-                "description": "JavaScript call frame. Array of call frames form the call stack."
-            },
-            {
-                "id": "Scope",
-                "type": "object",
-                "properties": [
-                    { "name": "type", "type": "string", "enum": ["global", "local", "with", "closure", "catch", "block", "script"], "description": "Scope type." },
-                    { "name": "object", "$ref": "Runtime.RemoteObject", "description": "Object representing the scope. For <code>global</code> and <code>with</code> scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties." },
-                    { "name": "name", "type": "string", "optional": true },
-                    { "name": "startLocation", "$ref": "Location", "optional": true, "description": "Location in the source code where scope starts" },
-                    { "name": "endLocation", "$ref": "Location", "optional": true, "description": "Location in the source code where scope ends" }
-                ],
-                "description": "Scope description."
-            },
-            {
-                "id": "SearchMatch",
-                "type": "object",
-                "description": "Search match for resource.",
-                "exported": true,
-                "properties": [
-                    { "name": "lineNumber", "type": "number", "description": "Line number in resource content." },
-                    { "name": "lineContent", "type": "string", "description": "Line with match content." }
-                ],
-                "experimental": true
-            }
-        ],
-        "commands": [
-            {
-                "name": "enable",
-                "description": "Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received."
-            },
-            {
-                "name": "disable",
-                "description": "Disables debugger for given page."
-            },
-            {
-                "name": "setBreakpointsActive",
-                "parameters": [
-                    { "name": "active", "type": "boolean", "description": "New value for breakpoints active state." }
-                ],
-                "description": "Activates / deactivates all breakpoints on the page."
-            },
-            {
-                "name": "setSkipAllPauses",
-                "parameters": [
-                    { "name": "skip", "type": "boolean", "description": "New value for skip pauses state." }
-                ],
-                "description": "Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc)."
-            },
-            {
-                "name": "setBreakpointByUrl",
-                "parameters": [
-                    { "name": "lineNumber", "type": "integer", "description": "Line number to set breakpoint at." },
-                    { "name": "url", "type": "string", "optional": true, "description": "URL of the resources to set breakpoint on." },
-                    { "name": "urlRegex", "type": "string", "optional": true, "description": "Regex pattern for the URLs of the resources to set breakpoints on. Either <code>url</code> or <code>urlRegex</code> must be specified." },
-                    { "name": "columnNumber", "type": "integer", "optional": true, "description": "Offset in the line to set breakpoint at." },
-                    { "name": "condition", "type": "string", "optional": true, "description": "Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true." }
-                ],
-                "returns": [
-                    { "name": "breakpointId", "$ref": "BreakpointId", "description": "Id of the created breakpoint for further reference." },
-                    { "name": "locations", "type": "array", "items": { "$ref": "Location" }, "description": "List of the locations this breakpoint resolved into upon addition." }
-                ],
-                "description": "Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in <code>locations</code> property. Further matching script parsing will result in subsequent <code>breakpointResolved</code> events issued. This logical breakpoint will survive page reloads."
-            },
-            {
-                "name": "setBreakpoint",
-                "parameters": [
-                    { "name": "location", "$ref": "Location", "description": "Location to set breakpoint in." },
-                    { "name": "condition", "type": "string", "optional": true, "description": "Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true." }
-                ],
-                "returns": [
-                    { "name": "breakpointId", "$ref": "BreakpointId", "description": "Id of the created breakpoint for further reference." },
-                    { "name": "actualLocation", "$ref": "Location", "description": "Location this breakpoint resolved into." }
-                ],
-                "description": "Sets JavaScript breakpoint at a given location."
-            },
-            {
-                "name": "removeBreakpoint",
-                "parameters": [
-                    { "name": "breakpointId", "$ref": "BreakpointId" }
-                ],
-                "description": "Removes JavaScript breakpoint."
-            },
-            {
-                "name": "continueToLocation",
-                "parameters": [
-                    { "name": "location", "$ref": "Location", "description": "Location to continue to." }
-                ],
-                "description": "Continues execution until specific location is reached."
-            },
-            {
-                "name": "stepOver",
-                "description": "Steps over the statement."
-            },
-            {
-                "name": "stepInto",
-                "description": "Steps into the function call."
-            },
-            {
-                "name": "stepOut",
-                "description": "Steps out of the function call."
-            },
-            {
-                "name": "pause",
-                "description": "Stops on the next JavaScript statement."
-            },
-            {
-                "name": "resume",
-                "description": "Resumes JavaScript execution."
-            },
-            {
-                "name": "searchInContent",
-                "parameters": [
-                    { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Id of the script to search in." },
-                    { "name": "query", "type": "string", "description": "String to search for."  },
-                    { "name": "caseSensitive", "type": "boolean", "optional": true, "description": "If true, search is case sensitive." },
-                    { "name": "isRegex", "type": "boolean", "optional": true, "description": "If true, treats string parameter as regex." }
-                ],
-                "returns": [
-                    { "name": "result", "type": "array", "items": { "$ref": "SearchMatch" }, "description": "List of search matches." }
-                ],
-                "experimental": true,
-                "description": "Searches for given string in script content."
-            },
-            {
-                "name": "setScriptSource",
-                "parameters": [
-                    { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Id of the script to edit." },
-                    { "name": "scriptSource", "type": "string", "description": "New content of the script." },
-                    { "name": "dryRun", "type": "boolean", "optional": true, "description": " If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code." }
-                ],
-                "returns": [
-                    { "name": "callFrames", "type": "array", "optional": true, "items": { "$ref": "CallFrame" }, "description": "New stack trace in case editing has happened while VM was stopped." },
-                    { "name": "stackChanged", "type": "boolean", "optional": true, "description": "Whether current call stack  was modified after applying the changes." },
-                    { "name": "asyncStackTrace", "$ref": "Runtime.StackTrace", "optional": true, "description": "Async stack trace, if any." },
-                    { "name": "exceptionDetails", "optional": true, "$ref": "Runtime.ExceptionDetails", "description": "Exception details if any." }
-                ],
-                "description": "Edits JavaScript source live."
-            },
-            {
-                "name": "restartFrame",
-                "parameters": [
-                    { "name": "callFrameId", "$ref": "CallFrameId", "description": "Call frame identifier to evaluate on." }
-                ],
-                "returns": [
-                    { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame" }, "description": "New stack trace." },
-                    { "name": "asyncStackTrace", "$ref": "Runtime.StackTrace", "optional": true, "description": "Async stack trace, if any." }
-                ],
-                "description": "Restarts particular call frame from the beginning."
-            },
-            {
-                "name": "getScriptSource",
-                "parameters": [
-                    { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Id of the script to get source for." }
-                ],
-                "returns": [
-                    { "name": "scriptSource", "type": "string", "description": "Script source." }
-                ],
-                "description": "Returns source for the script with given id."
-            },
-            {
-                "name": "setPauseOnExceptions",
-                "parameters": [
-                    { "name": "state", "type": "string", "enum": ["none", "uncaught", "all"], "description": "Pause on exceptions mode." }
-                ],
-                "description": "Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is <code>none</code>."
-            },
-            {
-                "name": "evaluateOnCallFrame",
-                "parameters": [
-                    { "name": "callFrameId", "$ref": "CallFrameId", "description": "Call frame identifier to evaluate on." },
-                    { "name": "expression", "type": "string", "description": "Expression to evaluate." },
-                    { "name": "objectGroup", "type": "string", "optional": true, "description": "String object group name to put result into (allows rapid releasing resulting object handles using <code>releaseObjectGroup</code>)." },
-                    { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Specifies whether command line API should be available to the evaluated expression, defaults to false." },
-                    { "name": "silent", "type": "boolean", "optional": true, "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state." },
-                    { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object that should be sent by value." },
-                    { "name": "generatePreview", "type": "boolean", "optional": true, "experimental": true, "description": "Whether preview should be generated for the result." }
-                ],
-                "returns": [
-                    { "name": "result", "$ref": "Runtime.RemoteObject", "description": "Object wrapper for the evaluation result." },
-                    { "name": "exceptionDetails", "$ref": "Runtime.ExceptionDetails", "optional": true, "description": "Exception details."}
-                ],
-                "description": "Evaluates expression on a given call frame."
-            },
-            {
-                "name": "setVariableValue",
-                "parameters": [
-                    { "name": "scopeNumber", "type": "integer", "description": "0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually." },
-                    { "name": "variableName", "type": "string", "description": "Variable name." },
-                    { "name": "newValue", "$ref": "Runtime.CallArgument", "description": "New variable value." },
-                    { "name": "callFrameId", "$ref": "CallFrameId", "description": "Id of callframe that holds variable." }
-                ],
-                "description": "Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually."
-            },
-            {
-                "name": "setAsyncCallStackDepth",
-                "parameters": [
-                    { "name": "maxDepth", "type": "integer", "description": "Maximum depth of async call stacks. Setting to <code>0</code> will effectively disable collecting async call stacks (default)." }
-                ],
-                "description": "Enables or disables async call stacks tracking."
-            },
-            {
-                "name": "setBlackboxPatterns",
-                "parameters": [
-                    { "name": "patterns", "type": "array", "items": { "type": "string" }, "description": "Array of regexps that will be used to check script url for blackbox state." }
-                ],
-                "experimental": true,
-                "description": "Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful."
-            },
-            {
-                "name": "setBlackboxedRanges",
-                "parameters": [
-                    { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Id of the script." },
-                    { "name": "positions", "type": "array", "items": { "$ref": "ScriptPosition" } }
-                ],
-                "experimental": true,
-                "description": "Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted."
-            }
-        ],
-        "events": [
-            {
-                "name": "scriptParsed",
-                "parameters": [
-                    { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Identifier of the script parsed." },
-                    { "name": "url", "type": "string", "description": "URL or name of the script parsed (if any)." },
-                    { "name": "startLine", "type": "integer", "description": "Line offset of the script within the resource with given URL (for script tags)." },
-                    { "name": "startColumn", "type": "integer", "description": "Column offset of the script within the resource with given URL." },
-                    { "name": "endLine", "type": "integer", "description": "Last line of the script." },
-                    { "name": "endColumn", "type": "integer", "description": "Length of the last line of the script." },
-                    { "name": "executionContextId", "$ref": "Runtime.ExecutionContextId", "description": "Specifies script creation context." },
-                    { "name": "hash", "type": "string", "description": "Content hash of the script."},
-                    { "name": "executionContextAuxData", "type": "object", "optional": true, "description": "Embedder-specific auxiliary data." },
-                    { "name": "isLiveEdit", "type": "boolean", "optional": true, "description": "True, if this script is generated as a result of the live edit operation.", "experimental": true },
-                    { "name": "sourceMapURL", "type": "string", "optional": true, "description": "URL of source map associated with script (if any)." },
-                    { "name": "hasSourceURL", "type": "boolean", "optional": true, "description": "True, if this script has sourceURL.", "experimental": true }
-                ],
-                "description": "Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger."
-            },
-            {
-                "name": "scriptFailedToParse",
-                "parameters": [
-                    { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Identifier of the script parsed." },
-                    { "name": "url", "type": "string", "description": "URL or name of the script parsed (if any)." },
-                    { "name": "startLine", "type": "integer", "description": "Line offset of the script within the resource with given URL (for script tags)." },
-                    { "name": "startColumn", "type": "integer", "description": "Column offset of the script within the resource with given URL." },
-                    { "name": "endLine", "type": "integer", "description": "Last line of the script." },
-                    { "name": "endColumn", "type": "integer", "description": "Length of the last line of the script." },
-                    { "name": "executionContextId", "$ref": "Runtime.ExecutionContextId", "description": "Specifies script creation context." },
-                    { "name": "hash", "type": "string", "description": "Content hash of the script."},
-                    { "name": "executionContextAuxData", "type": "object", "optional": true, "description": "Embedder-specific auxiliary data." },
-                    { "name": "sourceMapURL", "type": "string", "optional": true, "description": "URL of source map associated with script (if any)." },
-                    { "name": "hasSourceURL", "type": "boolean", "optional": true, "description": "True, if this script has sourceURL.", "experimental": true }
-                ],
-                "description": "Fired when virtual machine fails to parse the script."
-            },
-            {
-                "name": "breakpointResolved",
-                "parameters": [
-                    { "name": "breakpointId", "$ref": "BreakpointId", "description": "Breakpoint unique identifier." },
-                    { "name": "location", "$ref": "Location", "description": "Actual breakpoint location." }
-                ],
-                "description": "Fired when breakpoint is resolved to an actual script and location."
-            },
-            {
-                "name": "paused",
-                "parameters": [
-                    { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame" }, "description": "Call stack the virtual machine stopped on." },
-                    { "name": "reason", "type": "string", "enum": [ "XHR", "DOM", "EventListener", "exception", "assert", "debugCommand", "promiseRejection", "other" ], "description": "Pause reason.", "exported": true },
-                    { "name": "data", "type": "object", "optional": true, "description": "Object containing break-specific auxiliary properties." },
-                    { "name": "hitBreakpoints", "type": "array", "optional": true, "items": { "type": "string" }, "description": "Hit breakpoints IDs" },
-                    { "name": "asyncStackTrace", "$ref": "Runtime.StackTrace", "optional": true, "description": "Async stack trace, if any." }
-                ],
-                "description": "Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria."
-            },
-            {
-                "name": "resumed",
-                "description": "Fired when the virtual machine resumed execution."
-            }
-        ]
-    },
-    {
-        "domain": "Console",
-        "description": "This domain is deprecated - use Runtime or Log instead.",
-        "dependencies": ["Runtime"],
-        "deprecated": true,
-        "types": [
-            {
-                "id": "ConsoleMessage",
-                "type": "object",
-                "description": "Console message.",
-                "properties": [
-                    { "name": "source", "type": "string", "enum": ["xml", "javascript", "network", "console-api", "storage", "appcache", "rendering", "security", "other", "deprecation", "worker"], "description": "Message source." },
-                    { "name": "level", "type": "string", "enum": ["log", "warning", "error", "debug", "info"], "description": "Message severity." },
-                    { "name": "text", "type": "string", "description": "Message text." },
-                    { "name": "url", "type": "string", "optional": true, "description": "URL of the message origin." },
-                    { "name": "line", "type": "integer", "optional": true, "description": "Line number in the resource that generated this message (1-based)." },
-                    { "name": "column", "type": "integer", "optional": true, "description": "Column number in the resource that generated this message (1-based)." }
-                ]
-            }
-        ],
-        "commands": [
-            {
-                "name": "enable",
-                "description": "Enables console domain, sends the messages collected so far to the client by means of the <code>messageAdded</code> notification."
-            },
-            {
-                "name": "disable",
-                "description": "Disables console domain, prevents further console messages from being reported to the client."
-            },
-            {
-                "name": "clearMessages",
-                "description": "Does nothing."
-            }
-        ],
-        "events": [
-            {
-                "name": "messageAdded",
-                "parameters": [
-                    { "name": "message", "$ref": "ConsoleMessage", "description": "Console message that has been added." }
-                ],
-                "description": "Issued when new console message is added."
-            }
-        ]
-    },
-    {
-        "domain": "Profiler",
-        "dependencies": ["Runtime", "Debugger"],
-        "types": [
-            {
-                "id": "ProfileNode",
-                "type": "object",
-                "description": "Profile node. Holds callsite information, execution statistics and child nodes.",
-                "properties": [
-                    { "name": "id", "type": "integer", "description": "Unique id of the node." },
-                    { "name": "callFrame", "$ref": "Runtime.CallFrame", "description": "Function location." },
-                    { "name": "hitCount", "type": "integer", "optional": true, "experimental": true, "description": "Number of samples where this node was on top of the call stack." },
-                    { "name": "children", "type": "array", "items": { "type": "integer" }, "optional": true, "description": "Child node ids." },
-                    { "name": "deoptReason", "type": "string", "optional": true, "description": "The reason of being not optimized. The function may be deoptimized or marked as don't optimize."},
-                    { "name": "positionTicks", "type": "array", "items": { "$ref": "PositionTickInfo" }, "optional": true, "experimental": true, "description": "An array of source position ticks." }
-                ]
-            },
-            {
-                "id": "Profile",
-                "type": "object",
-                "description": "Profile.",
-                "properties": [
-                    { "name": "nodes", "type": "array", "items": { "$ref": "ProfileNode" }, "description": "The list of profile nodes. First item is the root node." },
-                    { "name": "startTime", "type": "number", "description": "Profiling start timestamp in microseconds." },
-                    { "name": "endTime", "type": "number", "description": "Profiling end timestamp in microseconds." },
-                    { "name": "samples", "optional": true, "type": "array", "items": { "type": "integer" }, "description": "Ids of samples top nodes." },
-                    { "name": "timeDeltas", "optional": true, "type": "array", "items": { "type": "integer" }, "description": "Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime." }
-                ]
-            },
-            {
-                "id": "PositionTickInfo",
-                "type": "object",
-                "experimental": true,
-                "description": "Specifies a number of samples attributed to a certain source position.",
-                "properties": [
-                    { "name": "line", "type": "integer", "description": "Source line number (1-based)." },
-                    { "name": "ticks", "type": "integer", "description": "Number of samples attributed to the source line." }
-                ]
-            }
-        ],
-        "commands": [
-            {
-                "name": "enable"
-            },
-            {
-                "name": "disable"
-            },
-            {
-                "name": "setSamplingInterval",
-                "parameters": [
-                    { "name": "interval", "type": "integer", "description": "New sampling interval in microseconds." }
-                ],
-                "description": "Changes CPU profiler sampling interval. Must be called before CPU profiles recording started."
-            },
-            {
-                "name": "start"
-            },
-            {
-                "name": "stop",
-                "returns": [
-                    { "name": "profile", "$ref": "Profile", "description": "Recorded profile." }
-                ]
-            }
-        ],
-        "events": [
-            {
-                "name": "consoleProfileStarted",
-                "parameters": [
-                    { "name": "id", "type": "string" },
-                    { "name": "location", "$ref": "Debugger.Location", "description": "Location of console.profile()." },
-                    { "name": "title", "type": "string", "optional": true, "description": "Profile title passed as an argument to console.profile()." }
-                ],
-                "description": "Sent when new profile recodring is started using console.profile() call."
-            },
-            {
-                "name": "consoleProfileFinished",
-                "parameters": [
-                    { "name": "id", "type": "string" },
-                    { "name": "location", "$ref": "Debugger.Location", "description": "Location of console.profileEnd()." },
-                    { "name": "profile", "$ref": "Profile" },
-                    { "name": "title", "type": "string", "optional": true, "description": "Profile title passed as an argument to console.profile()." }
-                ]
-            }
-        ]
-    },
-    {
-        "domain": "HeapProfiler",
-        "dependencies": ["Runtime"],
-        "experimental": true,
-        "types": [
-            {
-                "id": "HeapSnapshotObjectId",
-                "type": "string",
-                "description": "Heap snapshot object id."
-            },
-            {
-                "id": "SamplingHeapProfileNode",
-                "type": "object",
-                "description": "Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes.",
-                "properties": [
-                    { "name": "callFrame", "$ref": "Runtime.CallFrame", "description": "Function location." },
-                    { "name": "selfSize", "type": "number", "description": "Allocations size in bytes for the node excluding children." },
-                    { "name": "children", "type": "array", "items": { "$ref": "SamplingHeapProfileNode" }, "description": "Child nodes." }
-                ]
-            },
-            {
-                "id": "SamplingHeapProfile",
-                "type": "object",
-                "description": "Profile.",
-                "properties": [
-                    { "name": "head", "$ref": "SamplingHeapProfileNode" }
-                ]
-            }
-        ],
-        "commands": [
-            {
-                "name": "enable"
-            },
-            {
-                "name": "disable"
-            },
-            {
-                "name": "startTrackingHeapObjects",
-                "parameters": [
-                    { "name": "trackAllocations", "type": "boolean", "optional": true }
-                ]
-            },
-            {
-                "name": "stopTrackingHeapObjects",
-                "parameters": [
-                    { "name": "reportProgress", "type": "boolean", "optional": true, "description": "If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped." }
-                ]
-            },
-            {
-                "name": "takeHeapSnapshot",
-                "parameters": [
-                    { "name": "reportProgress", "type": "boolean", "optional": true, "description": "If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken." }
-                ]
-            },
-            {
-                "name": "collectGarbage"
-            },
-            {
-                "name": "getObjectByHeapObjectId",
-                "parameters": [
-                    { "name": "objectId", "$ref": "HeapSnapshotObjectId" },
-                    { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." }
-                ],
-                "returns": [
-                    { "name": "result", "$ref": "Runtime.RemoteObject", "description": "Evaluation result." }
-                ]
-            },
-            {
-                "name": "addInspectedHeapObject",
-                "parameters": [
-                    { "name": "heapObjectId", "$ref": "HeapSnapshotObjectId", "description": "Heap snapshot object id to be accessible by means of $x command line API." }
-                ],
-                "description": "Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions)."
-            },
-            {
-                "name": "getHeapObjectId",
-                "parameters": [
-                    { "name": "objectId", "$ref": "Runtime.RemoteObjectId", "description": "Identifier of the object to get heap object id for." }
-                ],
-                "returns": [
-                    { "name": "heapSnapshotObjectId", "$ref": "HeapSnapshotObjectId", "description": "Id of the heap snapshot object corresponding to the passed remote object id." }
-                ]
-            },
-            {
-                "name": "startSampling",
-                "parameters": [
-                    { "name": "samplingInterval", "type": "number", "optional": true, "description": "Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes." }
-                ]
-            },
-            {
-                "name": "stopSampling",
-                "returns": [
-                    { "name": "profile", "$ref": "SamplingHeapProfile", "description": "Recorded sampling heap profile." }
-                ]
-            }
-        ],
-        "events": [
-            {
-                "name": "addHeapSnapshotChunk",
-                "parameters": [
-                    { "name": "chunk", "type": "string" }
-                ]
-            },
-            {
-                "name": "resetProfiles"
-            },
-            {
-                "name": "reportHeapSnapshotProgress",
-                "parameters": [
-                    { "name": "done", "type": "integer" },
-                    { "name": "total", "type": "integer" },
-                    { "name": "finished", "type": "boolean", "optional": true }
-                ]
-            },
-            {
-                "name": "lastSeenObjectId",
-                "description": "If heap objects tracking has been started then backend regulary sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.",
-                "parameters": [
-                    { "name": "lastSeenObjectId", "type": "integer" },
-                    { "name": "timestamp", "type": "number" }
-                ]
-            },
-            {
-                "name": "heapStatsUpdate",
-                "description": "If heap objects tracking has been started then backend may send update for one or more fragments",
-                "parameters": [
-                    { "name": "statsUpdate", "type": "array", "items": { "type": "integer" }, "description": "An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment."}
-                ]
-            }
-        ]
-    }]
-}
diff --git a/src/v8/src/inspector/js_protocol-1.3.json b/src/v8/src/inspector/js_protocol-1.3.json
deleted file mode 100644
index ea573d1..0000000
--- a/src/v8/src/inspector/js_protocol-1.3.json
+++ /dev/null
@@ -1,1205 +0,0 @@
-{
-    "version": { "major": "1", "minor": "3" },
-    "domains": [
-    {
-        "domain": "Schema",
-        "description": "This domain is deprecated.",
-        "deprecated": true,
-        "types": [
-            {
-                "id": "Domain",
-                "type": "object",
-                "description": "Description of the protocol domain.",
-                "properties": [
-                    { "name": "name", "type": "string", "description": "Domain name." },
-                    { "name": "version", "type": "string", "description": "Domain version." }
-                ]
-            }
-        ],
-        "commands": [
-            {
-                "name": "getDomains",
-                "description": "Returns supported domains.",
-                "handlers": ["browser", "renderer"],
-                "returns": [
-                    { "name": "domains", "type": "array", "items": { "$ref": "Domain" }, "description": "List of supported domains." }
-                ]
-            }
-        ]
-    },
-    {
-        "domain": "Runtime",
-        "description": "Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects. Evaluation results are returned as mirror object that expose object type, string representation and unique identifier that can be used for further object reference. Original objects are maintained in memory unless they are either explicitly released or are released along with the other objects in their object group.",
-        "types": [
-            {
-                "id": "ScriptId",
-                "type": "string",
-                "description": "Unique script identifier."
-            },
-            {
-                "id": "RemoteObjectId",
-                "type": "string",
-                "description": "Unique object identifier."
-            },
-            {
-                "id": "UnserializableValue",
-                "type": "string",
-                "enum": ["Infinity", "NaN", "-Infinity", "-0"],
-                "description": "Primitive value which cannot be JSON-stringified."
-            },
-            {
-                "id": "RemoteObject",
-                "type": "object",
-                "description": "Mirror object referencing original JavaScript object.",
-                "properties": [
-                    { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean", "symbol"], "description": "Object type." },
-                    { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date", "map", "set", "weakmap", "weakset", "iterator", "generator", "error", "proxy", "promise", "typedarray"], "description": "Object subtype hint. Specified for <code>object</code> type values only." },
-                    { "name": "className", "type": "string", "optional": true, "description": "Object class (constructor) name. Specified for <code>object</code> type values only." },
-                    { "name": "value", "type": "any", "optional": true, "description": "Remote object value in case of primitive values or JSON values (if it was requested)." },
-                    { "name": "unserializableValue", "$ref": "UnserializableValue", "optional": true, "description": "Primitive value which can not be JSON-stringified does not have <code>value</code>, but gets this property." },
-                    { "name": "description", "type": "string", "optional": true, "description": "String representation of the object." },
-                    { "name": "objectId", "$ref": "RemoteObjectId", "optional": true, "description": "Unique object identifier (for non-primitive values)." },
-                    { "name": "preview", "$ref": "ObjectPreview", "optional": true, "description": "Preview containing abbreviated property values. Specified for <code>object</code> type values only.", "experimental": true },
-                    { "name": "customPreview", "$ref": "CustomPreview", "optional": true, "experimental": true}
-                ]
-            },
-            {
-                "id": "CustomPreview",
-                "type": "object",
-                "experimental": true,
-                "properties": [
-                    { "name": "header", "type": "string"},
-                    { "name": "hasBody", "type": "boolean"},
-                    { "name": "formatterObjectId", "$ref": "RemoteObjectId"},
-                    { "name": "bindRemoteObjectFunctionId", "$ref": "RemoteObjectId" },
-                    { "name": "configObjectId", "$ref": "RemoteObjectId", "optional": true }
-                ]
-            },
-            {
-                "id": "ObjectPreview",
-                "type": "object",
-                "experimental": true,
-                "description": "Object containing abbreviated remote object value.",
-                "properties": [
-                    { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean", "symbol"], "description": "Object type." },
-                    { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date", "map", "set", "weakmap", "weakset", "iterator", "generator", "error"], "description": "Object subtype hint. Specified for <code>object</code> type values only." },
-                    { "name": "description", "type": "string", "optional": true, "description": "String representation of the object." },
-                    { "name": "overflow", "type": "boolean", "description": "True iff some of the properties or entries of the original object did not fit." },
-                    { "name": "properties", "type": "array", "items": { "$ref": "PropertyPreview" }, "description": "List of the properties." },
-                    { "name": "entries", "type": "array", "items": { "$ref": "EntryPreview" }, "optional": true, "description": "List of the entries. Specified for <code>map</code> and <code>set</code> subtype values only." }
-                ]
-            },
-            {
-                "id": "PropertyPreview",
-                "type": "object",
-                "experimental": true,
-                "properties": [
-                    { "name": "name", "type": "string", "description": "Property name." },
-                    { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean", "symbol", "accessor"], "description": "Object type. Accessor means that the property itself is an accessor property." },
-                    { "name": "value", "type": "string", "optional": true, "description": "User-friendly property value string." },
-                    { "name": "valuePreview", "$ref": "ObjectPreview", "optional": true, "description": "Nested value preview." },
-                    { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date", "map", "set", "weakmap", "weakset", "iterator", "generator", "error"], "description": "Object subtype hint. Specified for <code>object</code> type values only." }
-                ]
-            },
-            {
-                "id": "EntryPreview",
-                "type": "object",
-                "experimental": true,
-                "properties": [
-                    { "name": "key", "$ref": "ObjectPreview", "optional": true, "description": "Preview of the key. Specified for map-like collection entries." },
-                    { "name": "value", "$ref": "ObjectPreview", "description": "Preview of the value." }
-                ]
-            },
-            {
-                "id": "PropertyDescriptor",
-                "type": "object",
-                "description": "Object property descriptor.",
-                "properties": [
-                    { "name": "name", "type": "string", "description": "Property name or symbol description." },
-                    { "name": "value", "$ref": "RemoteObject", "optional": true, "description": "The value associated with the property." },
-                    { "name": "writable", "type": "boolean", "optional": true, "description": "True if the value associated with the property may be changed (data descriptors only)." },
-                    { "name": "get", "$ref": "RemoteObject", "optional": true, "description": "A function which serves as a getter for the property, or <code>undefined</code> if there is no getter (accessor descriptors only)." },
-                    { "name": "set", "$ref": "RemoteObject", "optional": true, "description": "A function which serves as a setter for the property, or <code>undefined</code> if there is no setter (accessor descriptors only)." },
-                    { "name": "configurable", "type": "boolean", "description": "True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object." },
-                    { "name": "enumerable", "type": "boolean", "description": "True if this property shows up during enumeration of the properties on the corresponding object." },
-                    { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." },
-                    { "name": "isOwn", "optional": true, "type": "boolean", "description": "True if the property is owned for the object." },
-                    { "name": "symbol", "$ref": "RemoteObject", "optional": true, "description": "Property symbol object, if the property is of the <code>symbol</code> type." }
-                ]
-            },
-            {
-                "id": "InternalPropertyDescriptor",
-                "type": "object",
-                "description": "Object internal property descriptor. This property isn't normally visible in JavaScript code.",
-                "properties": [
-                    { "name": "name", "type": "string", "description": "Conventional property name." },
-                    { "name": "value", "$ref": "RemoteObject", "optional": true, "description": "The value associated with the property." }
-                ]
-            },
-            {
-                "id": "CallArgument",
-                "type": "object",
-                "description": "Represents function call argument. Either remote object id <code>objectId</code>, primitive <code>value</code>, unserializable primitive value or neither of (for undefined) them should be specified.",
-                "properties": [
-                    { "name": "value", "type": "any", "optional": true, "description": "Primitive value or serializable javascript object." },
-                    { "name": "unserializableValue", "$ref": "UnserializableValue", "optional": true, "description": "Primitive value which can not be JSON-stringified." },
-                    { "name": "objectId", "$ref": "RemoteObjectId", "optional": true, "description": "Remote object handle." }
-                ]
-            },
-            {
-                "id": "ExecutionContextId",
-                "type": "integer",
-                "description": "Id of an execution context."
-            },
-            {
-                "id": "ExecutionContextDescription",
-                "type": "object",
-                "description": "Description of an isolated world.",
-                "properties": [
-                    { "name": "id", "$ref": "ExecutionContextId", "description": "Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed." },
-                    { "name": "origin", "type": "string", "description": "Execution context origin." },
-                    { "name": "name", "type": "string", "description": "Human readable name describing given context." },
-                    { "name": "auxData", "type": "object", "optional": true, "description": "Embedder-specific auxiliary data." }
-                ]
-            },
-            {
-                "id": "ExceptionDetails",
-                "type": "object",
-                "description": "Detailed information about exception (or error) that was thrown during script compilation or execution.",
-                "properties": [
-                    { "name": "exceptionId", "type": "integer", "description": "Exception id." },
-                    { "name": "text", "type": "string", "description": "Exception text, which should be used together with exception object when available." },
-                    { "name": "lineNumber", "type": "integer", "description": "Line number of the exception location (0-based)." },
-                    { "name": "columnNumber", "type": "integer", "description": "Column number of the exception location (0-based)." },
-                    { "name": "scriptId", "$ref": "ScriptId", "optional": true, "description": "Script ID of the exception location." },
-                    { "name": "url", "type": "string", "optional": true, "description": "URL of the exception location, to be used when the script was not reported." },
-                    { "name": "stackTrace", "$ref": "StackTrace", "optional": true, "description": "JavaScript stack trace if available." },
-                    { "name": "exception", "$ref": "RemoteObject", "optional": true, "description": "Exception object if available." },
-                    { "name": "executionContextId", "$ref": "ExecutionContextId", "optional": true, "description": "Identifier of the context where exception happened." }
-                ]
-            },
-            {
-                "id": "Timestamp",
-                "type": "number",
-                "description": "Number of milliseconds since epoch."
-            },
-            {
-                "id": "CallFrame",
-                "type": "object",
-                "description": "Stack entry for runtime errors and assertions.",
-                "properties": [
-                    { "name": "functionName", "type": "string", "description": "JavaScript function name." },
-                    { "name": "scriptId", "$ref": "ScriptId", "description": "JavaScript script id." },
-                    { "name": "url", "type": "string", "description": "JavaScript script name or url." },
-                    { "name": "lineNumber", "type": "integer", "description": "JavaScript script line number (0-based)." },
-                    { "name": "columnNumber", "type": "integer", "description": "JavaScript script column number (0-based)." }
-                ]
-            },
-            {
-                "id": "StackTrace",
-                "type": "object",
-                "description": "Call frames for assertions or error messages.",
-                "properties": [
-                    { "name": "description", "type": "string", "optional": true, "description": "String label of this stack trace. For async traces this may be a name of the function that initiated the async call." },
-                    { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame" }, "description": "JavaScript function name." },
-                    { "name": "parent", "$ref": "StackTrace", "optional": true, "description": "Asynchronous JavaScript stack trace that preceded this stack, if available." },
-                    { "name": "parentId", "$ref": "StackTraceId", "optional": true, "experimental": true, "description": "Asynchronous JavaScript stack trace that preceded this stack, if available." }
-                ]
-            },
-            {
-                "id": "UniqueDebuggerId",
-                "type": "string",
-                "description": "Unique identifier of current debugger.",
-                "experimental": true
-            },
-            {
-                "id": "StackTraceId",
-                "type": "object",
-                "description": "If <code>debuggerId</code> is set stack trace comes from another debugger and can be resolved there. This allows to track cross-debugger calls. See <code>Runtime.StackTrace</code> and <code>Debugger.paused</code> for usages.",
-                "properties": [
-                    { "name": "id", "type": "string" },
-                    { "name": "debuggerId", "$ref": "UniqueDebuggerId", "optional": true }
-                ],
-                "experimental": true
-            }
-        ],
-        "commands": [
-            {
-                "name": "evaluate",
-                "parameters": [
-                    { "name": "expression", "type": "string", "description": "Expression to evaluate." },
-                    { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." },
-                    { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Determines whether Command Line API should be available during the evaluation." },
-                    { "name": "silent", "type": "boolean", "optional": true, "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state." },
-                    { "name": "contextId", "$ref": "ExecutionContextId", "optional": true, "description": "Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page." },
-                    { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object that should be sent by value." },
-                    { "name": "generatePreview", "type": "boolean", "optional": true, "experimental": true, "description": "Whether preview should be generated for the result." },
-                    { "name": "userGesture", "type": "boolean", "optional": true, "description": "Whether execution should be treated as initiated by user in the UI." },
-                    { "name": "awaitPromise", "type": "boolean", "optional":true, "description": "Whether execution should <code>await</code> for resulting value and return once awaited promise is resolved." }
-                ],
-                "returns": [
-                    { "name": "result", "$ref": "RemoteObject", "description": "Evaluation result." },
-                    { "name": "exceptionDetails", "$ref": "ExceptionDetails", "optional": true, "description": "Exception details."}
-                ],
-                "description": "Evaluates expression on global object."
-            },
-            {
-                "name": "awaitPromise",
-                "parameters": [
-                    { "name": "promiseObjectId", "$ref": "RemoteObjectId", "description": "Identifier of the promise." },
-                    { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object that should be sent by value." },
-                    { "name": "generatePreview", "type": "boolean", "optional": true, "description": "Whether preview should be generated for the result." }
-                ],
-                "returns": [
-                    { "name": "result", "$ref": "RemoteObject", "description": "Promise result. Will contain rejected value if promise was rejected." },
-                    { "name": "exceptionDetails", "$ref": "ExceptionDetails", "optional": true, "description": "Exception details if stack strace is available."}
-                ],
-                "description": "Add handler to promise with given promise object id."
-            },
-            {
-                "name": "callFunctionOn",
-                "parameters": [
-                    { "name": "functionDeclaration", "type": "string", "description": "Declaration of the function to call." },
-                    { "name": "objectId", "$ref": "RemoteObjectId", "optional": true, "description": "Identifier of the object to call function on. Either objectId or executionContextId should be specified." },
-                    { "name": "arguments", "type": "array", "items": { "$ref": "CallArgument", "description": "Call argument." }, "optional": true, "description": "Call arguments. All call arguments must belong to the same JavaScript world as the target object." },
-                    { "name": "silent", "type": "boolean", "optional": true, "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state." },
-                    { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object which should be sent by value." },
-                    { "name": "generatePreview", "type": "boolean", "optional": true, "experimental": true, "description": "Whether preview should be generated for the result." },
-                    { "name": "userGesture", "type": "boolean", "optional": true, "description": "Whether execution should be treated as initiated by user in the UI." },
-                    { "name": "awaitPromise", "type": "boolean", "optional":true, "description": "Whether execution should <code>await</code> for resulting value and return once awaited promise is resolved." },
-                    { "name": "executionContextId", "$ref": "ExecutionContextId", "optional": true, "description": "Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified." },
-                    { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object." }
-                ],
-                "returns": [
-                    { "name": "result", "$ref": "RemoteObject", "description": "Call result." },
-                    { "name": "exceptionDetails", "$ref": "ExceptionDetails", "optional": true, "description": "Exception details."}
-                ],
-                "description": "Calls function with given declaration on the given object. Object group of the result is inherited from the target object."
-            },
-            {
-                "name": "getProperties",
-                "parameters": [
-                    { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to return properties for." },
-                    { "name": "ownProperties", "optional": true, "type": "boolean", "description": "If true, returns properties belonging only to the element itself, not to its prototype chain." },
-                    { "name": "accessorPropertiesOnly", "optional": true, "type": "boolean", "description": "If true, returns accessor properties (with getter/setter) only; internal properties are not returned either.", "experimental": true },
-                    { "name": "generatePreview", "type": "boolean", "optional": true, "experimental": true, "description": "Whether preview should be generated for the results." }
-                ],
-                "returns": [
-                    { "name": "result", "type": "array", "items": { "$ref": "PropertyDescriptor" }, "description": "Object properties." },
-                    { "name": "internalProperties", "optional": true, "type": "array", "items": { "$ref": "InternalPropertyDescriptor" }, "description": "Internal object properties (only of the element itself)." },
-                    { "name": "exceptionDetails", "$ref": "ExceptionDetails", "optional": true, "description": "Exception details."}
-                ],
-                "description": "Returns properties of a given object. Object group of the result is inherited from the target object."
-            },
-            {
-                "name": "releaseObject",
-                "parameters": [
-                    { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to release." }
-                ],
-                "description": "Releases remote object with given id."
-            },
-            {
-                "name": "releaseObjectGroup",
-                "parameters": [
-                    { "name": "objectGroup", "type": "string", "description": "Symbolic object group name." }
-                ],
-                "description": "Releases all remote objects that belong to a given group."
-            },
-            {
-                "name": "runIfWaitingForDebugger",
-                "description": "Tells inspected instance to run if it was waiting for debugger to attach."
-            },
-            {
-                "name": "enable",
-                "description": "Enables reporting of execution contexts creation by means of <code>executionContextCreated</code> event. When the reporting gets enabled the event will be sent immediately for each existing execution context."
-            },
-            {
-                "name": "disable",
-                "description": "Disables reporting of execution contexts creation."
-            },
-            {
-                "name": "discardConsoleEntries",
-                "description": "Discards collected exceptions and console API calls."
-            },
-            {
-                "name": "setCustomObjectFormatterEnabled",
-                "parameters": [
-                    {
-                        "name": "enabled",
-                        "type": "boolean"
-                    }
-                ],
-                "experimental": true
-            },
-            {
-                "name": "compileScript",
-                "parameters": [
-                    { "name": "expression", "type": "string", "description": "Expression to compile." },
-                    { "name": "sourceURL", "type": "string", "description": "Source url to be set for the script." },
-                    { "name": "persistScript", "type": "boolean", "description": "Specifies whether the compiled script should be persisted." },
-                    { "name": "executionContextId", "$ref": "ExecutionContextId", "optional": true, "description": "Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page." }
-                ],
-                "returns": [
-                    { "name": "scriptId", "$ref": "ScriptId", "optional": true, "description": "Id of the script." },
-                    { "name": "exceptionDetails", "$ref": "ExceptionDetails", "optional": true, "description": "Exception details."}
-                ],
-                "description": "Compiles expression."
-            },
-            {
-                "name": "runScript",
-                "parameters": [
-                    { "name": "scriptId", "$ref": "ScriptId", "description": "Id of the script to run." },
-                    { "name": "executionContextId", "$ref": "ExecutionContextId", "optional": true, "description": "Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page." },
-                    { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." },
-                    { "name": "silent", "type": "boolean", "optional": true, "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state." },
-                    { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Determines whether Command Line API should be available during the evaluation." },
-                    { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object which should be sent by value." },
-                    { "name": "generatePreview", "type": "boolean", "optional": true, "description": "Whether preview should be generated for the result." },
-                    { "name": "awaitPromise", "type": "boolean", "optional": true, "description": "Whether execution should <code>await</code> for resulting value and return once awaited promise is resolved." }
-                ],
-                "returns": [
-                    { "name": "result", "$ref": "RemoteObject", "description": "Run result." },
-                    { "name": "exceptionDetails", "$ref": "ExceptionDetails", "optional": true, "description": "Exception details."}
-                ],
-                "description": "Runs script with given id in a given context."
-            },
-            {
-                "name": "queryObjects",
-                "parameters": [
-                    { "name": "prototypeObjectId", "$ref": "RemoteObjectId", "description": "Identifier of the prototype to return objects for." }
-                ],
-                "returns": [
-                    { "name": "objects", "$ref": "RemoteObject", "description": "Array with objects." }
-                ]
-            },
-            {
-                "name": "globalLexicalScopeNames",
-                "parameters": [
-                    { "name": "executionContextId", "$ref": "ExecutionContextId", "optional": true, "description": "Specifies in which execution context to lookup global scope variables." }
-                ],
-                "returns": [
-                    { "name": "names", "type": "array", "items": { "type": "string" } }
-                ],
-                "description": "Returns all let, const and class variables from global scope."
-            }
-        ],
-        "events": [
-            {
-                "name": "executionContextCreated",
-                "parameters": [
-                    { "name": "context", "$ref": "ExecutionContextDescription", "description": "A newly created execution context." }
-                ],
-                "description": "Issued when new execution context is created."
-            },
-            {
-                "name": "executionContextDestroyed",
-                "parameters": [
-                    { "name": "executionContextId", "$ref": "ExecutionContextId", "description": "Id of the destroyed context" }
-                ],
-                "description": "Issued when execution context is destroyed."
-            },
-            {
-                "name": "executionContextsCleared",
-                "description": "Issued when all executionContexts were cleared in browser"
-            },
-            {
-                "name": "exceptionThrown",
-                "description": "Issued when exception was thrown and unhandled.",
-                "parameters": [
-                    { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp of the exception." },
-                    { "name": "exceptionDetails", "$ref": "ExceptionDetails" }
-                ]
-            },
-            {
-                "name": "exceptionRevoked",
-                "description": "Issued when unhandled exception was revoked.",
-                "parameters": [
-                    { "name": "reason", "type": "string", "description": "Reason describing why exception was revoked." },
-                    { "name": "exceptionId", "type": "integer", "description": "The id of revoked exception, as reported in <code>exceptionThrown</code>." }
-                ]
-            },
-            {
-                "name": "consoleAPICalled",
-                "description": "Issued when console API was called.",
-                "parameters": [
-                    { "name": "type", "type": "string", "enum": ["log", "debug", "info", "error", "warning", "dir", "dirxml", "table", "trace", "clear", "startGroup", "startGroupCollapsed", "endGroup", "assert", "profile", "profileEnd", "count", "timeEnd"], "description": "Type of the call." },
-                    { "name": "args", "type": "array", "items": { "$ref": "RemoteObject" }, "description": "Call arguments." },
-                    { "name": "executionContextId", "$ref": "ExecutionContextId", "description": "Identifier of the context where the call was made." },
-                    { "name": "timestamp", "$ref": "Timestamp", "description": "Call timestamp." },
-                    { "name": "stackTrace", "$ref": "StackTrace", "optional": true, "description": "Stack trace captured when the call was made." },
-                    { "name": "context", "type": "string", "optional": true, "experimental": true, "description": "Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context." }
-                ]
-            },
-            {
-                "name": "inspectRequested",
-                "description": "Issued when object should be inspected (for example, as a result of inspect() command line API call).",
-                "parameters": [
-                    { "name": "object", "$ref": "RemoteObject" },
-                    { "name": "hints", "type": "object" }
-                ]
-            }
-        ]
-    },
-    {
-        "domain": "Debugger",
-        "description": "Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing breakpoints, stepping through execution, exploring stack traces, etc.",
-        "dependencies": ["Runtime"],
-        "types": [
-            {
-                "id": "BreakpointId",
-                "type": "string",
-                "description": "Breakpoint identifier."
-            },
-            {
-                "id": "CallFrameId",
-                "type": "string",
-                "description": "Call frame identifier."
-            },
-            {
-                "id": "Location",
-                "type": "object",
-                "properties": [
-                    { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Script identifier as reported in the <code>Debugger.scriptParsed</code>." },
-                    { "name": "lineNumber", "type": "integer", "description": "Line number in the script (0-based)." },
-                    { "name": "columnNumber", "type": "integer", "optional": true, "description": "Column number in the script (0-based)." }
-                ],
-                "description": "Location in the source code."
-            },
-            {
-                "id": "ScriptPosition",
-                "experimental": true,
-                "type": "object",
-                "properties": [
-                    { "name": "lineNumber", "type": "integer" },
-                    { "name": "columnNumber", "type": "integer" }
-                ],
-                "description": "Location in the source code."
-            },
-            {
-                "id": "CallFrame",
-                "type": "object",
-                "properties": [
-                    { "name": "callFrameId", "$ref": "CallFrameId", "description": "Call frame identifier. This identifier is only valid while the virtual machine is paused." },
-                    { "name": "functionName", "type": "string", "description": "Name of the JavaScript function called on this call frame." },
-                    { "name": "functionLocation", "$ref": "Location", "optional": true, "description": "Location in the source code." },
-                    { "name": "location", "$ref": "Location", "description": "Location in the source code." },
-                    { "name": "url", "type": "string", "description": "JavaScript script name or url." },
-                    { "name": "scopeChain", "type": "array", "items": { "$ref": "Scope" }, "description": "Scope chain for this call frame." },
-                    { "name": "this", "$ref": "Runtime.RemoteObject", "description": "<code>this</code> object for this call frame." },
-                    { "name": "returnValue", "$ref": "Runtime.RemoteObject", "optional": true, "description": "The value being returned, if the function is at return point." }
-                ],
-                "description": "JavaScript call frame. Array of call frames form the call stack."
-            },
-            {
-                "id": "Scope",
-                "type": "object",
-                "properties": [
-                    { "name": "type", "type": "string", "enum": ["global", "local", "with", "closure", "catch", "block", "script", "eval", "module"], "description": "Scope type." },
-                    { "name": "object", "$ref": "Runtime.RemoteObject", "description": "Object representing the scope. For <code>global</code> and <code>with</code> scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties." },
-                    { "name": "name", "type": "string", "optional": true },
-                    { "name": "startLocation", "$ref": "Location", "optional": true, "description": "Location in the source code where scope starts" },
-                    { "name": "endLocation", "$ref": "Location", "optional": true, "description": "Location in the source code where scope ends" }
-                ],
-                "description": "Scope description."
-            },
-            {
-                "id": "SearchMatch",
-                "type": "object",
-                "description": "Search match for resource.",
-                "properties": [
-                    { "name": "lineNumber", "type": "number", "description": "Line number in resource content." },
-                    { "name": "lineContent", "type": "string", "description": "Line with match content." }
-                ]
-            },
-            {
-                "id": "BreakLocation",
-                "type": "object",
-                "properties": [
-                    { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Script identifier as reported in the <code>Debugger.scriptParsed</code>." },
-                    { "name": "lineNumber", "type": "integer", "description": "Line number in the script (0-based)." },
-                    { "name": "columnNumber", "type": "integer", "optional": true, "description": "Column number in the script (0-based)." },
-                    { "name": "type", "type": "string", "enum": [ "debuggerStatement", "call", "return" ], "optional": true }
-                ]
-            }
-        ],
-        "commands": [
-            {
-                "name": "enable",
-                "returns": [
-                    { "name": "debuggerId", "$ref": "Runtime.UniqueDebuggerId", "experimental": true, "description": "Unique identifier of the debugger." }
-                ],
-                "description": "Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received."
-            },
-            {
-                "name": "disable",
-                "description": "Disables debugger for given page."
-            },
-            {
-                "name": "setBreakpointsActive",
-                "parameters": [
-                    { "name": "active", "type": "boolean", "description": "New value for breakpoints active state." }
-                ],
-                "description": "Activates / deactivates all breakpoints on the page."
-            },
-            {
-                "name": "setSkipAllPauses",
-                "parameters": [
-                    { "name": "skip", "type": "boolean", "description": "New value for skip pauses state." }
-                ],
-                "description": "Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc)."
-            },
-            {
-                "name": "setBreakpointByUrl",
-                "parameters": [
-                    { "name": "lineNumber", "type": "integer", "description": "Line number to set breakpoint at." },
-                    { "name": "url", "type": "string", "optional": true, "description": "URL of the resources to set breakpoint on." },
-                    { "name": "urlRegex", "type": "string", "optional": true, "description": "Regex pattern for the URLs of the resources to set breakpoints on. Either <code>url</code> or <code>urlRegex</code> must be specified." },
-                    { "name": "scriptHash", "type": "string", "optional": true, "description": "Script hash of the resources to set breakpoint on." },
-                    { "name": "columnNumber", "type": "integer", "optional": true, "description": "Offset in the line to set breakpoint at." },
-                    { "name": "condition", "type": "string", "optional": true, "description": "Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true." }
-                ],
-                "returns": [
-                    { "name": "breakpointId", "$ref": "BreakpointId", "description": "Id of the created breakpoint for further reference." },
-                    { "name": "locations", "type": "array", "items": { "$ref": "Location" }, "description": "List of the locations this breakpoint resolved into upon addition." }
-                ],
-                "description": "Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in <code>locations</code> property. Further matching script parsing will result in subsequent <code>breakpointResolved</code> events issued. This logical breakpoint will survive page reloads."
-            },
-            {
-                "name": "setBreakpoint",
-                "parameters": [
-                    { "name": "location", "$ref": "Location", "description": "Location to set breakpoint in." },
-                    { "name": "condition", "type": "string", "optional": true, "description": "Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true." }
-                ],
-                "returns": [
-                    { "name": "breakpointId", "$ref": "BreakpointId", "description": "Id of the created breakpoint for further reference." },
-                    { "name": "actualLocation", "$ref": "Location", "description": "Location this breakpoint resolved into." }
-                ],
-                "description": "Sets JavaScript breakpoint at a given location."
-            },
-            {
-                "name": "removeBreakpoint",
-                "parameters": [
-                    { "name": "breakpointId", "$ref": "BreakpointId" }
-                ],
-                "description": "Removes JavaScript breakpoint."
-            },
-            {
-                "name": "getPossibleBreakpoints",
-                "parameters": [
-                    { "name": "start", "$ref": "Location", "description": "Start of range to search possible breakpoint locations in." },
-                    { "name": "end", "$ref": "Location", "optional": true, "description": "End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range." },
-                    { "name": "restrictToFunction", "type": "boolean", "optional": true, "description": "Only consider locations which are in the same (non-nested) function as start." }
-                ],
-                "returns": [
-                    { "name": "locations", "type": "array", "items": { "$ref": "BreakLocation" }, "description": "List of the possible breakpoint locations." }
-                ],
-                "description": "Returns possible locations for breakpoint. scriptId in start and end range locations should be the same."
-            },
-            {
-                "name": "continueToLocation",
-                "parameters": [
-                    { "name": "location", "$ref": "Location", "description": "Location to continue to." },
-                    { "name": "targetCallFrames", "type": "string", "enum": ["any", "current"], "optional": true }
-                ],
-                "description": "Continues execution until specific location is reached."
-            },
-            {
-                "name": "pauseOnAsyncCall",
-                "parameters": [
-                    { "name": "parentStackTraceId", "$ref": "Runtime.StackTraceId", "description": "Debugger will pause when async call with given stack trace is started." }
-                ],
-                "experimental": true
-            },
-            {
-                "name": "stepOver",
-                "description": "Steps over the statement."
-            },
-            {
-                "name": "stepInto",
-                "parameters": [
-                    { "name": "breakOnAsyncCall", "type": "boolean", "optional": true, "experimental": true, "description": "Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause." }
-                ],
-                "description": "Steps into the function call."
-            },
-            {
-                "name": "stepOut",
-                "description": "Steps out of the function call."
-            },
-            {
-                "name": "pause",
-                "description": "Stops on the next JavaScript statement."
-            },
-            {
-                "name": "scheduleStepIntoAsync",
-                "description": "This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called.",
-                "experimental": true
-            },
-            {
-                "name": "resume",
-                "description": "Resumes JavaScript execution."
-            },
-            {
-                "name": "getStackTrace",
-                "parameters": [
-                    { "name": "stackTraceId", "$ref": "Runtime.StackTraceId" }
-                ],
-                "returns": [
-                    { "name": "stackTrace", "$ref": "Runtime.StackTrace" }
-                ],
-                "description": "Returns stack trace with given <code>stackTraceId</code>.",
-                "experimental": true
-            },
-            {
-                "name": "searchInContent",
-                "parameters": [
-                    { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Id of the script to search in." },
-                    { "name": "query", "type": "string", "description": "String to search for."  },
-                    { "name": "caseSensitive", "type": "boolean", "optional": true, "description": "If true, search is case sensitive." },
-                    { "name": "isRegex", "type": "boolean", "optional": true, "description": "If true, treats string parameter as regex." }
-                ],
-                "returns": [
-                    { "name": "result", "type": "array", "items": { "$ref": "SearchMatch" }, "description": "List of search matches." }
-                ],
-                "description": "Searches for given string in script content."
-            },
-            {
-                "name": "setScriptSource",
-                "parameters": [
-                    { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Id of the script to edit." },
-                    { "name": "scriptSource", "type": "string", "description": "New content of the script." },
-                    { "name": "dryRun", "type": "boolean", "optional": true, "description": " If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code." }
-                ],
-                "returns": [
-                    { "name": "callFrames", "type": "array", "optional": true, "items": { "$ref": "CallFrame" }, "description": "New stack trace in case editing has happened while VM was stopped." },
-                    { "name": "stackChanged", "type": "boolean", "optional": true, "description": "Whether current call stack  was modified after applying the changes." },
-                    { "name": "asyncStackTrace", "$ref": "Runtime.StackTrace", "optional": true, "description": "Async stack trace, if any." },
-                    { "name": "asyncStackTraceId", "$ref": "Runtime.StackTraceId", "optional": true, "experimental": true, "description": "Async stack trace, if any." },
-                    { "name": "exceptionDetails", "optional": true, "$ref": "Runtime.ExceptionDetails", "description": "Exception details if any." }
-                ],
-                "description": "Edits JavaScript source live."
-            },
-            {
-                "name": "restartFrame",
-                "parameters": [
-                    { "name": "callFrameId", "$ref": "CallFrameId", "description": "Call frame identifier to evaluate on." }
-                ],
-                "returns": [
-                    { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame" }, "description": "New stack trace." },
-                    { "name": "asyncStackTrace", "$ref": "Runtime.StackTrace", "optional": true, "description": "Async stack trace, if any." },
-                    { "name": "asyncStackTraceId", "$ref": "Runtime.StackTraceId", "optional": true, "experimental": true, "description": "Async stack trace, if any." }
-                ],
-                "description": "Restarts particular call frame from the beginning."
-            },
-            {
-                "name": "getScriptSource",
-                "parameters": [
-                    { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Id of the script to get source for." }
-                ],
-                "returns": [
-                    { "name": "scriptSource", "type": "string", "description": "Script source." }
-                ],
-                "description": "Returns source for the script with given id."
-            },
-            {
-                "name": "setPauseOnExceptions",
-                "parameters": [
-                    { "name": "state", "type": "string", "enum": ["none", "uncaught", "all"], "description": "Pause on exceptions mode." }
-                ],
-                "description": "Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is <code>none</code>."
-            },
-            {
-                "name": "evaluateOnCallFrame",
-                "parameters": [
-                    { "name": "callFrameId", "$ref": "CallFrameId", "description": "Call frame identifier to evaluate on." },
-                    { "name": "expression", "type": "string", "description": "Expression to evaluate." },
-                    { "name": "objectGroup", "type": "string", "optional": true, "description": "String object group name to put result into (allows rapid releasing resulting object handles using <code>releaseObjectGroup</code>)." },
-                    { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Specifies whether command line API should be available to the evaluated expression, defaults to false." },
-                    { "name": "silent", "type": "boolean", "optional": true, "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state." },
-                    { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object that should be sent by value." },
-                    { "name": "generatePreview", "type": "boolean", "optional": true, "experimental": true, "description": "Whether preview should be generated for the result." },
-                    { "name": "throwOnSideEffect", "type": "boolean", "optional": true, "description": "Whether to throw an exception if side effect cannot be ruled out during evaluation." }
-                ],
-                "returns": [
-                    { "name": "result", "$ref": "Runtime.RemoteObject", "description": "Object wrapper for the evaluation result." },
-                    { "name": "exceptionDetails", "$ref": "Runtime.ExceptionDetails", "optional": true, "description": "Exception details."}
-                ],
-                "description": "Evaluates expression on a given call frame."
-            },
-            {
-                "name": "setVariableValue",
-                "parameters": [
-                    { "name": "scopeNumber", "type": "integer", "description": "0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually." },
-                    { "name": "variableName", "type": "string", "description": "Variable name." },
-                    { "name": "newValue", "$ref": "Runtime.CallArgument", "description": "New variable value." },
-                    { "name": "callFrameId", "$ref": "CallFrameId", "description": "Id of callframe that holds variable." }
-                ],
-                "description": "Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually."
-            },
-            {
-                "name": "setReturnValue",
-                "parameters": [
-                    { "name": "newValue", "$ref": "Runtime.CallArgument", "description": "New return value." }
-                ],
-                "experimental": true,
-                "description": "Changes return value in top frame. Available only at return break position."
-            },
-            {
-                "name": "setAsyncCallStackDepth",
-                "parameters": [
-                    { "name": "maxDepth", "type": "integer", "description": "Maximum depth of async call stacks. Setting to <code>0</code> will effectively disable collecting async call stacks (default)." }
-                ],
-                "description": "Enables or disables async call stacks tracking."
-            },
-            {
-                "name": "setBlackboxPatterns",
-                "parameters": [
-                    { "name": "patterns", "type": "array", "items": { "type": "string" }, "description": "Array of regexps that will be used to check script url for blackbox state." }
-                ],
-                "experimental": true,
-                "description": "Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful."
-            },
-            {
-                "name": "setBlackboxedRanges",
-                "parameters": [
-                    { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Id of the script." },
-                    { "name": "positions", "type": "array", "items": { "$ref": "ScriptPosition" } }
-                ],
-                "experimental": true,
-                "description": "Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted."
-            }
-        ],
-        "events": [
-            {
-                "name": "scriptParsed",
-                "parameters": [
-                    { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Identifier of the script parsed." },
-                    { "name": "url", "type": "string", "description": "URL or name of the script parsed (if any)." },
-                    { "name": "startLine", "type": "integer", "description": "Line offset of the script within the resource with given URL (for script tags)." },
-                    { "name": "startColumn", "type": "integer", "description": "Column offset of the script within the resource with given URL." },
-                    { "name": "endLine", "type": "integer", "description": "Last line of the script." },
-                    { "name": "endColumn", "type": "integer", "description": "Length of the last line of the script." },
-                    { "name": "executionContextId", "$ref": "Runtime.ExecutionContextId", "description": "Specifies script creation context." },
-                    { "name": "hash", "type": "string", "description": "Content hash of the script."},
-                    { "name": "executionContextAuxData", "type": "object", "optional": true, "description": "Embedder-specific auxiliary data." },
-                    { "name": "isLiveEdit", "type": "boolean", "optional": true, "description": "True, if this script is generated as a result of the live edit operation.", "experimental": true },
-                    { "name": "sourceMapURL", "type": "string", "optional": true, "description": "URL of source map associated with script (if any)." },
-                    { "name": "hasSourceURL", "type": "boolean", "optional": true, "description": "True, if this script has sourceURL." },
-                    { "name": "isModule", "type": "boolean", "optional": true, "description": "True, if this script is ES6 module." },
-                    { "name": "length", "type": "integer", "optional": true, "description": "This script length." },
-                    { "name": "stackTrace", "$ref": "Runtime.StackTrace", "optional": true, "description": "JavaScript top stack frame of where the script parsed event was triggered if available.", "experimental": true }
-                ],
-                "description": "Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger."
-            },
-            {
-                "name": "scriptFailedToParse",
-                "parameters": [
-                    { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Identifier of the script parsed." },
-                    { "name": "url", "type": "string", "description": "URL or name of the script parsed (if any)." },
-                    { "name": "startLine", "type": "integer", "description": "Line offset of the script within the resource with given URL (for script tags)." },
-                    { "name": "startColumn", "type": "integer", "description": "Column offset of the script within the resource with given URL." },
-                    { "name": "endLine", "type": "integer", "description": "Last line of the script." },
-                    { "name": "endColumn", "type": "integer", "description": "Length of the last line of the script." },
-                    { "name": "executionContextId", "$ref": "Runtime.ExecutionContextId", "description": "Specifies script creation context." },
-                    { "name": "hash", "type": "string", "description": "Content hash of the script."},
-                    { "name": "executionContextAuxData", "type": "object", "optional": true, "description": "Embedder-specific auxiliary data." },
-                    { "name": "sourceMapURL", "type": "string", "optional": true, "description": "URL of source map associated with script (if any)." },
-                    { "name": "hasSourceURL", "type": "boolean", "optional": true, "description": "True, if this script has sourceURL." },
-                    { "name": "isModule", "type": "boolean", "optional": true, "description": "True, if this script is ES6 module." },
-                    { "name": "length", "type": "integer", "optional": true, "description": "This script length." },
-                    { "name": "stackTrace", "$ref": "Runtime.StackTrace", "optional": true, "description": "JavaScript top stack frame of where the script parsed event was triggered if available.", "experimental": true }
-                ],
-                "description": "Fired when virtual machine fails to parse the script."
-            },
-            {
-                "name": "breakpointResolved",
-                "parameters": [
-                    { "name": "breakpointId", "$ref": "BreakpointId", "description": "Breakpoint unique identifier." },
-                    { "name": "location", "$ref": "Location", "description": "Actual breakpoint location." }
-                ],
-                "description": "Fired when breakpoint is resolved to an actual script and location."
-            },
-            {
-                "name": "paused",
-                "parameters": [
-                    { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame" }, "description": "Call stack the virtual machine stopped on." },
-                    { "name": "reason", "type": "string", "enum": [ "XHR", "DOM", "EventListener", "exception", "assert", "debugCommand", "promiseRejection", "OOM", "other", "ambiguous" ], "description": "Pause reason." },
-                    { "name": "data", "type": "object", "optional": true, "description": "Object containing break-specific auxiliary properties." },
-                    { "name": "hitBreakpoints", "type": "array", "optional": true, "items": { "type": "string" }, "description": "Hit breakpoints IDs" },
-                    { "name": "asyncStackTrace", "$ref": "Runtime.StackTrace", "optional": true, "description": "Async stack trace, if any." },
-                    { "name": "asyncStackTraceId", "$ref": "Runtime.StackTraceId", "optional": true, "experimental": true, "description": "Async stack trace, if any." },
-                    { "name": "asyncCallStackTraceId", "$ref": "Runtime.StackTraceId", "optional": true, "experimental": true, "description": "Just scheduled async call will have this stack trace as parent stack during async execution. This field is available only after <code>Debugger.stepInto</code> call with <code>breakOnAsynCall</code> flag." }
-                ],
-                "description": "Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria."
-            },
-            {
-                "name": "resumed",
-                "description": "Fired when the virtual machine resumed execution."
-            }
-        ]
-    },
-    {
-        "domain": "Console",
-        "description": "This domain is deprecated - use Runtime or Log instead.",
-        "dependencies": ["Runtime"],
-        "deprecated": true,
-        "types": [
-            {
-                "id": "ConsoleMessage",
-                "type": "object",
-                "description": "Console message.",
-                "properties": [
-                    { "name": "source", "type": "string", "enum": ["xml", "javascript", "network", "console-api", "storage", "appcache", "rendering", "security", "other", "deprecation", "worker"], "description": "Message source." },
-                    { "name": "level", "type": "string", "enum": ["log", "warning", "error", "debug", "info"], "description": "Message severity." },
-                    { "name": "text", "type": "string", "description": "Message text." },
-                    { "name": "url", "type": "string", "optional": true, "description": "URL of the message origin." },
-                    { "name": "line", "type": "integer", "optional": true, "description": "Line number in the resource that generated this message (1-based)." },
-                    { "name": "column", "type": "integer", "optional": true, "description": "Column number in the resource that generated this message (1-based)." }
-                ]
-            }
-        ],
-        "commands": [
-            {
-                "name": "enable",
-                "description": "Enables console domain, sends the messages collected so far to the client by means of the <code>messageAdded</code> notification."
-            },
-            {
-                "name": "disable",
-                "description": "Disables console domain, prevents further console messages from being reported to the client."
-            },
-            {
-                "name": "clearMessages",
-                "description": "Does nothing."
-            }
-        ],
-        "events": [
-            {
-                "name": "messageAdded",
-                "parameters": [
-                    { "name": "message", "$ref": "ConsoleMessage", "description": "Console message that has been added." }
-                ],
-                "description": "Issued when new console message is added."
-            }
-        ]
-    },
-    {
-        "domain": "Profiler",
-        "dependencies": ["Runtime", "Debugger"],
-        "types": [
-            {
-                "id": "ProfileNode",
-                "type": "object",
-                "description": "Profile node. Holds callsite information, execution statistics and child nodes.",
-                "properties": [
-                    { "name": "id", "type": "integer", "description": "Unique id of the node." },
-                    { "name": "callFrame", "$ref": "Runtime.CallFrame", "description": "Function location." },
-                    { "name": "hitCount", "type": "integer", "optional": true, "description": "Number of samples where this node was on top of the call stack." },
-                    { "name": "children", "type": "array", "items": { "type": "integer" }, "optional": true, "description": "Child node ids." },
-                    { "name": "deoptReason", "type": "string", "optional": true, "description": "The reason of being not optimized. The function may be deoptimized or marked as don't optimize."},
-                    { "name": "positionTicks", "type": "array", "items": { "$ref": "PositionTickInfo" }, "optional": true, "description": "An array of source position ticks." }
-                ]
-            },
-            {
-                "id": "Profile",
-                "type": "object",
-                "description": "Profile.",
-                "properties": [
-                    { "name": "nodes", "type": "array", "items": { "$ref": "ProfileNode" }, "description": "The list of profile nodes. First item is the root node." },
-                    { "name": "startTime", "type": "number", "description": "Profiling start timestamp in microseconds." },
-                    { "name": "endTime", "type": "number", "description": "Profiling end timestamp in microseconds." },
-                    { "name": "samples", "optional": true, "type": "array", "items": { "type": "integer" }, "description": "Ids of samples top nodes." },
-                    { "name": "timeDeltas", "optional": true, "type": "array", "items": { "type": "integer" }, "description": "Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime." }
-                ]
-            },
-            {
-                "id": "PositionTickInfo",
-                "type": "object",
-                "description": "Specifies a number of samples attributed to a certain source position.",
-                "properties": [
-                    { "name": "line", "type": "integer", "description": "Source line number (1-based)." },
-                    { "name": "ticks", "type": "integer", "description": "Number of samples attributed to the source line." }
-                ]
-            },
-            {   "id": "CoverageRange",
-                "type": "object",
-                "description": "Coverage data for a source range.",
-                "properties": [
-                    { "name": "startOffset", "type": "integer", "description": "JavaScript script source offset for the range start." },
-                    { "name": "endOffset", "type": "integer", "description": "JavaScript script source offset for the range end." },
-                    { "name": "count", "type": "integer", "description": "Collected execution count of the source range." }
-                ]
-            },
-            {   "id": "FunctionCoverage",
-                "type": "object",
-                "description": "Coverage data for a JavaScript function.",
-                "properties": [
-                    { "name": "functionName", "type": "string", "description": "JavaScript function name." },
-                    { "name": "ranges", "type": "array", "items": { "$ref": "CoverageRange" }, "description": "Source ranges inside the function with coverage data." },
-                    { "name": "isBlockCoverage", "type": "boolean", "description": "Whether coverage data for this function has block granularity." }
-                ]
-            },
-            {
-                "id": "ScriptCoverage",
-                "type": "object",
-                "description": "Coverage data for a JavaScript script.",
-                "properties": [
-                    { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "JavaScript script id." },
-                    { "name": "url", "type": "string", "description": "JavaScript script name or url." },
-                    { "name": "functions", "type": "array", "items": { "$ref": "FunctionCoverage" }, "description": "Functions contained in the script that has coverage data." }
-                ]
-            },
-            {   "id": "TypeObject",
-                "type": "object",
-                "description": "Describes a type collected during runtime.",
-                "properties": [
-                    { "name": "name", "type": "string", "description": "Name of a type collected with type profiling." }
-                ],
-                "experimental": true
-            },
-            {   "id": "TypeProfileEntry",
-                "type": "object",
-                "description": "Source offset and types for a parameter or return value.",
-                "properties": [
-                    { "name": "offset", "type": "integer", "description": "Source offset of the parameter or end of function for return values." },
-                    { "name": "types", "type": "array", "items": {"$ref": "TypeObject"}, "description": "The types for this parameter or return value."}
-                ],
-                "experimental": true
-            },
-            {
-                "id": "ScriptTypeProfile",
-                "type": "object",
-                "description": "Type profile data collected during runtime for a JavaScript script.",
-                "properties": [
-                    { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "JavaScript script id." },
-                    { "name": "url", "type": "string", "description": "JavaScript script name or url." },
-                    { "name": "entries", "type": "array", "items": { "$ref": "TypeProfileEntry" }, "description": "Type profile entries for parameters and return values of the functions in the script." }
-                ],
-                "experimental": true
-            }
-        ],
-        "commands": [
-            {
-                "name": "enable"
-            },
-            {
-                "name": "disable"
-            },
-            {
-                "name": "setSamplingInterval",
-                "parameters": [
-                    { "name": "interval", "type": "integer", "description": "New sampling interval in microseconds." }
-                ],
-                "description": "Changes CPU profiler sampling interval. Must be called before CPU profiles recording started."
-            },
-            {
-                "name": "start"
-            },
-            {
-                "name": "stop",
-                "returns": [
-                    { "name": "profile", "$ref": "Profile", "description": "Recorded profile." }
-                ]
-            },
-            {
-                "name": "startPreciseCoverage",
-                "parameters": [
-                    { "name": "callCount", "type": "boolean", "optional": true, "description": "Collect accurate call counts beyond simple 'covered' or 'not covered'." },
-                    { "name": "detailed", "type": "boolean", "optional": true, "description": "Collect block-based coverage." }
-                ],
-                "description": "Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters."
-            },
-            {
-                "name": "stopPreciseCoverage",
-                "description": "Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code."
-            },
-            {
-                "name": "takePreciseCoverage",
-                "returns": [
-                    { "name": "result", "type": "array", "items": { "$ref": "ScriptCoverage" }, "description": "Coverage data for the current isolate." }
-                ],
-                "description": "Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started."
-            },
-            {
-                "name": "getBestEffortCoverage",
-                "returns": [
-                    { "name": "result", "type": "array", "items": { "$ref": "ScriptCoverage" }, "description": "Coverage data for the current isolate." }
-                ],
-                "description": "Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection."
-            },
-            {
-                "name": "startTypeProfile",
-                "description": "Enable type profile.",
-                "experimental": true
-            },
-            {
-                "name": "stopTypeProfile",
-                "description": "Disable type profile. Disabling releases type profile data collected so far.",
-                "experimental": true
-            },
-            {
-                "name": "takeTypeProfile",
-                "returns": [
-                    { "name": "result", "type":  "array", "items": { "$ref": "ScriptTypeProfile" }, "description": "Type profile for all scripts since startTypeProfile() was turned on." }
-                ],
-                "description": "Collect type profile.",
-                "experimental": true
-            }
-        ],
-        "events": [
-            {
-                "name": "consoleProfileStarted",
-                "parameters": [
-                    { "name": "id", "type": "string" },
-                    { "name": "location", "$ref": "Debugger.Location", "description": "Location of console.profile()." },
-                    { "name": "title", "type": "string", "optional": true, "description": "Profile title passed as an argument to console.profile()." }
-                ],
-                "description": "Sent when new profile recording is started using console.profile() call."
-            },
-            {
-                "name": "consoleProfileFinished",
-                "parameters": [
-                    { "name": "id", "type": "string" },
-                    { "name": "location", "$ref": "Debugger.Location", "description": "Location of console.profileEnd()." },
-                    { "name": "profile", "$ref": "Profile" },
-                    { "name": "title", "type": "string", "optional": true, "description": "Profile title passed as an argument to console.profile()." }
-                ]
-            }
-        ]
-    },
-    {
-        "domain": "HeapProfiler",
-        "dependencies": ["Runtime"],
-        "experimental": true,
-        "types": [
-            {
-                "id": "HeapSnapshotObjectId",
-                "type": "string",
-                "description": "Heap snapshot object id."
-            },
-            {
-                "id": "SamplingHeapProfileNode",
-                "type": "object",
-                "description": "Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes.",
-                "properties": [
-                    { "name": "callFrame", "$ref": "Runtime.CallFrame", "description": "Function location." },
-                    { "name": "selfSize", "type": "number", "description": "Allocations size in bytes for the node excluding children." },
-                    { "name": "children", "type": "array", "items": { "$ref": "SamplingHeapProfileNode" }, "description": "Child nodes." }
-                ]
-            },
-            {
-                "id": "SamplingHeapProfile",
-                "type": "object",
-                "description": "Profile.",
-                "properties": [
-                    { "name": "head", "$ref": "SamplingHeapProfileNode" }
-                ]
-            }
-        ],
-        "commands": [
-            {
-                "name": "enable"
-            },
-            {
-                "name": "disable"
-            },
-            {
-                "name": "startTrackingHeapObjects",
-                "parameters": [
-                    { "name": "trackAllocations", "type": "boolean", "optional": true }
-                ]
-            },
-            {
-                "name": "stopTrackingHeapObjects",
-                "parameters": [
-                    { "name": "reportProgress", "type": "boolean", "optional": true, "description": "If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped." }
-                ]
-            },
-            {
-                "name": "takeHeapSnapshot",
-                "parameters": [
-                    { "name": "reportProgress", "type": "boolean", "optional": true, "description": "If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken." }
-                ]
-            },
-            {
-                "name": "collectGarbage"
-            },
-            {
-                "name": "getObjectByHeapObjectId",
-                "parameters": [
-                    { "name": "objectId", "$ref": "HeapSnapshotObjectId" },
-                    { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." }
-                ],
-                "returns": [
-                    { "name": "result", "$ref": "Runtime.RemoteObject", "description": "Evaluation result." }
-                ]
-            },
-            {
-                "name": "addInspectedHeapObject",
-                "parameters": [
-                    { "name": "heapObjectId", "$ref": "HeapSnapshotObjectId", "description": "Heap snapshot object id to be accessible by means of $x command line API." }
-                ],
-                "description": "Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions)."
-            },
-            {
-                "name": "getHeapObjectId",
-                "parameters": [
-                    { "name": "objectId", "$ref": "Runtime.RemoteObjectId", "description": "Identifier of the object to get heap object id for." }
-                ],
-                "returns": [
-                    { "name": "heapSnapshotObjectId", "$ref": "HeapSnapshotObjectId", "description": "Id of the heap snapshot object corresponding to the passed remote object id." }
-                ]
-            },
-            {
-                "name": "startSampling",
-                "parameters": [
-                    { "name": "samplingInterval", "type": "number", "optional": true, "description": "Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes." }
-                ]
-            },
-            {
-                "name": "stopSampling",
-                "returns": [
-                    { "name": "profile", "$ref": "SamplingHeapProfile", "description": "Recorded sampling heap profile." }
-                ]
-            },
-            {
-                "name": "getSamplingProfile",
-                "returns": [
-                    { "name": "profile", "$ref": "SamplingHeapProfile", "description": "Return the sampling profile being collected." }
-                ]
-            }
-        ],
-        "events": [
-            {
-                "name": "addHeapSnapshotChunk",
-                "parameters": [
-                    { "name": "chunk", "type": "string" }
-                ]
-            },
-            {
-                "name": "resetProfiles"
-            },
-            {
-                "name": "reportHeapSnapshotProgress",
-                "parameters": [
-                    { "name": "done", "type": "integer" },
-                    { "name": "total", "type": "integer" },
-                    { "name": "finished", "type": "boolean", "optional": true }
-                ]
-            },
-            {
-                "name": "lastSeenObjectId",
-                "description": "If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.",
-                "parameters": [
-                    { "name": "lastSeenObjectId", "type": "integer" },
-                    { "name": "timestamp", "type": "number" }
-                ]
-            },
-            {
-                "name": "heapStatsUpdate",
-                "description": "If heap objects tracking has been started then backend may send update for one or more fragments",
-                "parameters": [
-                    { "name": "statsUpdate", "type": "array", "items": { "type": "integer" }, "description": "An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment."}
-                ]
-            }
-        ]
-    }]
-}
diff --git a/src/v8/src/inspector/js_protocol.json b/src/v8/src/inspector/js_protocol.json
deleted file mode 100644
index a0f7fcd..0000000
--- a/src/v8/src/inspector/js_protocol.json
+++ /dev/null
@@ -1,2966 +0,0 @@
-{
-    "version": {
-        "major": "1",
-        "minor": "3"
-    },
-    "domains": [
-        {
-            "domain": "Console",
-            "description": "This domain is deprecated - use Runtime or Log instead.",
-            "deprecated": true,
-            "dependencies": [
-                "Runtime"
-            ],
-            "types": [
-                {
-                    "id": "ConsoleMessage",
-                    "description": "Console message.",
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "source",
-                            "description": "Message source.",
-                            "type": "string",
-                            "enum": [
-                                "xml",
-                                "javascript",
-                                "network",
-                                "console-api",
-                                "storage",
-                                "appcache",
-                                "rendering",
-                                "security",
-                                "other",
-                                "deprecation",
-                                "worker"
-                            ]
-                        },
-                        {
-                            "name": "level",
-                            "description": "Message severity.",
-                            "type": "string",
-                            "enum": [
-                                "log",
-                                "warning",
-                                "error",
-                                "debug",
-                                "info"
-                            ]
-                        },
-                        {
-                            "name": "text",
-                            "description": "Message text.",
-                            "type": "string"
-                        },
-                        {
-                            "name": "url",
-                            "description": "URL of the message origin.",
-                            "optional": true,
-                            "type": "string"
-                        },
-                        {
-                            "name": "line",
-                            "description": "Line number in the resource that generated this message (1-based).",
-                            "optional": true,
-                            "type": "integer"
-                        },
-                        {
-                            "name": "column",
-                            "description": "Column number in the resource that generated this message (1-based).",
-                            "optional": true,
-                            "type": "integer"
-                        }
-                    ]
-                }
-            ],
-            "commands": [
-                {
-                    "name": "clearMessages",
-                    "description": "Does nothing."
-                },
-                {
-                    "name": "disable",
-                    "description": "Disables console domain, prevents further console messages from being reported to the client."
-                },
-                {
-                    "name": "enable",
-                    "description": "Enables console domain, sends the messages collected so far to the client by means of the\n`messageAdded` notification."
-                }
-            ],
-            "events": [
-                {
-                    "name": "messageAdded",
-                    "description": "Issued when new console message is added.",
-                    "parameters": [
-                        {
-                            "name": "message",
-                            "description": "Console message that has been added.",
-                            "$ref": "ConsoleMessage"
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "domain": "Debugger",
-            "description": "Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing\nbreakpoints, stepping through execution, exploring stack traces, etc.",
-            "dependencies": [
-                "Runtime"
-            ],
-            "types": [
-                {
-                    "id": "BreakpointId",
-                    "description": "Breakpoint identifier.",
-                    "type": "string"
-                },
-                {
-                    "id": "CallFrameId",
-                    "description": "Call frame identifier.",
-                    "type": "string"
-                },
-                {
-                    "id": "Location",
-                    "description": "Location in the source code.",
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "scriptId",
-                            "description": "Script identifier as reported in the `Debugger.scriptParsed`.",
-                            "$ref": "Runtime.ScriptId"
-                        },
-                        {
-                            "name": "lineNumber",
-                            "description": "Line number in the script (0-based).",
-                            "type": "integer"
-                        },
-                        {
-                            "name": "columnNumber",
-                            "description": "Column number in the script (0-based).",
-                            "optional": true,
-                            "type": "integer"
-                        }
-                    ]
-                },
-                {
-                    "id": "ScriptPosition",
-                    "description": "Location in the source code.",
-                    "experimental": true,
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "lineNumber",
-                            "type": "integer"
-                        },
-                        {
-                            "name": "columnNumber",
-                            "type": "integer"
-                        }
-                    ]
-                },
-                {
-                    "id": "CallFrame",
-                    "description": "JavaScript call frame. Array of call frames form the call stack.",
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "callFrameId",
-                            "description": "Call frame identifier. This identifier is only valid while the virtual machine is paused.",
-                            "$ref": "CallFrameId"
-                        },
-                        {
-                            "name": "functionName",
-                            "description": "Name of the JavaScript function called on this call frame.",
-                            "type": "string"
-                        },
-                        {
-                            "name": "functionLocation",
-                            "description": "Location in the source code.",
-                            "optional": true,
-                            "$ref": "Location"
-                        },
-                        {
-                            "name": "location",
-                            "description": "Location in the source code.",
-                            "$ref": "Location"
-                        },
-                        {
-                            "name": "url",
-                            "description": "JavaScript script name or url.",
-                            "type": "string"
-                        },
-                        {
-                            "name": "scopeChain",
-                            "description": "Scope chain for this call frame.",
-                            "type": "array",
-                            "items": {
-                                "$ref": "Scope"
-                            }
-                        },
-                        {
-                            "name": "this",
-                            "description": "`this` object for this call frame.",
-                            "$ref": "Runtime.RemoteObject"
-                        },
-                        {
-                            "name": "returnValue",
-                            "description": "The value being returned, if the function is at return point.",
-                            "optional": true,
-                            "$ref": "Runtime.RemoteObject"
-                        }
-                    ]
-                },
-                {
-                    "id": "Scope",
-                    "description": "Scope description.",
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "type",
-                            "description": "Scope type.",
-                            "type": "string",
-                            "enum": [
-                                "global",
-                                "local",
-                                "with",
-                                "closure",
-                                "catch",
-                                "block",
-                                "script",
-                                "eval",
-                                "module"
-                            ]
-                        },
-                        {
-                            "name": "object",
-                            "description": "Object representing the scope. For `global` and `with` scopes it represents the actual\nobject; for the rest of the scopes, it is artificial transient object enumerating scope\nvariables as its properties.",
-                            "$ref": "Runtime.RemoteObject"
-                        },
-                        {
-                            "name": "name",
-                            "optional": true,
-                            "type": "string"
-                        },
-                        {
-                            "name": "startLocation",
-                            "description": "Location in the source code where scope starts",
-                            "optional": true,
-                            "$ref": "Location"
-                        },
-                        {
-                            "name": "endLocation",
-                            "description": "Location in the source code where scope ends",
-                            "optional": true,
-                            "$ref": "Location"
-                        }
-                    ]
-                },
-                {
-                    "id": "SearchMatch",
-                    "description": "Search match for resource.",
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "lineNumber",
-                            "description": "Line number in resource content.",
-                            "type": "number"
-                        },
-                        {
-                            "name": "lineContent",
-                            "description": "Line with match content.",
-                            "type": "string"
-                        }
-                    ]
-                },
-                {
-                    "id": "BreakLocation",
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "scriptId",
-                            "description": "Script identifier as reported in the `Debugger.scriptParsed`.",
-                            "$ref": "Runtime.ScriptId"
-                        },
-                        {
-                            "name": "lineNumber",
-                            "description": "Line number in the script (0-based).",
-                            "type": "integer"
-                        },
-                        {
-                            "name": "columnNumber",
-                            "description": "Column number in the script (0-based).",
-                            "optional": true,
-                            "type": "integer"
-                        },
-                        {
-                            "name": "type",
-                            "optional": true,
-                            "type": "string",
-                            "enum": [
-                                "debuggerStatement",
-                                "call",
-                                "return"
-                            ]
-                        }
-                    ]
-                }
-            ],
-            "commands": [
-                {
-                    "name": "continueToLocation",
-                    "description": "Continues execution until specific location is reached.",
-                    "parameters": [
-                        {
-                            "name": "location",
-                            "description": "Location to continue to.",
-                            "$ref": "Location"
-                        },
-                        {
-                            "name": "targetCallFrames",
-                            "optional": true,
-                            "type": "string",
-                            "enum": [
-                                "any",
-                                "current"
-                            ]
-                        }
-                    ]
-                },
-                {
-                    "name": "disable",
-                    "description": "Disables debugger for given page."
-                },
-                {
-                    "name": "enable",
-                    "description": "Enables debugger for the given page. Clients should not assume that the debugging has been\nenabled until the result for this command is received.",
-                    "returns": [
-                        {
-                            "name": "debuggerId",
-                            "description": "Unique identifier of the debugger.",
-                            "experimental": true,
-                            "$ref": "Runtime.UniqueDebuggerId"
-                        }
-                    ]
-                },
-                {
-                    "name": "evaluateOnCallFrame",
-                    "description": "Evaluates expression on a given call frame.",
-                    "parameters": [
-                        {
-                            "name": "callFrameId",
-                            "description": "Call frame identifier to evaluate on.",
-                            "$ref": "CallFrameId"
-                        },
-                        {
-                            "name": "expression",
-                            "description": "Expression to evaluate.",
-                            "type": "string"
-                        },
-                        {
-                            "name": "objectGroup",
-                            "description": "String object group name to put result into (allows rapid releasing resulting object handles\nusing `releaseObjectGroup`).",
-                            "optional": true,
-                            "type": "string"
-                        },
-                        {
-                            "name": "includeCommandLineAPI",
-                            "description": "Specifies whether command line API should be available to the evaluated expression, defaults\nto false.",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "silent",
-                            "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause\nexecution. Overrides `setPauseOnException` state.",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "returnByValue",
-                            "description": "Whether the result is expected to be a JSON object that should be sent by value.",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "generatePreview",
-                            "description": "Whether preview should be generated for the result.",
-                            "experimental": true,
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "throwOnSideEffect",
-                            "description": "Whether to throw an exception if side effect cannot be ruled out during evaluation.",
-                            "optional": true,
-                            "type": "boolean"
-                        }
-                    ],
-                    "returns": [
-                        {
-                            "name": "result",
-                            "description": "Object wrapper for the evaluation result.",
-                            "$ref": "Runtime.RemoteObject"
-                        },
-                        {
-                            "name": "exceptionDetails",
-                            "description": "Exception details.",
-                            "optional": true,
-                            "$ref": "Runtime.ExceptionDetails"
-                        }
-                    ]
-                },
-                {
-                    "name": "getPossibleBreakpoints",
-                    "description": "Returns possible locations for breakpoint. scriptId in start and end range locations should be\nthe same.",
-                    "parameters": [
-                        {
-                            "name": "start",
-                            "description": "Start of range to search possible breakpoint locations in.",
-                            "$ref": "Location"
-                        },
-                        {
-                            "name": "end",
-                            "description": "End of range to search possible breakpoint locations in (excluding). When not specified, end\nof scripts is used as end of range.",
-                            "optional": true,
-                            "$ref": "Location"
-                        },
-                        {
-                            "name": "restrictToFunction",
-                            "description": "Only consider locations which are in the same (non-nested) function as start.",
-                            "optional": true,
-                            "type": "boolean"
-                        }
-                    ],
-                    "returns": [
-                        {
-                            "name": "locations",
-                            "description": "List of the possible breakpoint locations.",
-                            "type": "array",
-                            "items": {
-                                "$ref": "BreakLocation"
-                            }
-                        }
-                    ]
-                },
-                {
-                    "name": "getScriptSource",
-                    "description": "Returns source for the script with given id.",
-                    "parameters": [
-                        {
-                            "name": "scriptId",
-                            "description": "Id of the script to get source for.",
-                            "$ref": "Runtime.ScriptId"
-                        }
-                    ],
-                    "returns": [
-                        {
-                            "name": "scriptSource",
-                            "description": "Script source.",
-                            "type": "string"
-                        }
-                    ]
-                },
-                {
-                    "name": "getStackTrace",
-                    "description": "Returns stack trace with given `stackTraceId`.",
-                    "experimental": true,
-                    "parameters": [
-                        {
-                            "name": "stackTraceId",
-                            "$ref": "Runtime.StackTraceId"
-                        }
-                    ],
-                    "returns": [
-                        {
-                            "name": "stackTrace",
-                            "$ref": "Runtime.StackTrace"
-                        }
-                    ]
-                },
-                {
-                    "name": "pause",
-                    "description": "Stops on the next JavaScript statement."
-                },
-                {
-                    "name": "pauseOnAsyncCall",
-                    "experimental": true,
-                    "parameters": [
-                        {
-                            "name": "parentStackTraceId",
-                            "description": "Debugger will pause when async call with given stack trace is started.",
-                            "$ref": "Runtime.StackTraceId"
-                        }
-                    ]
-                },
-                {
-                    "name": "removeBreakpoint",
-                    "description": "Removes JavaScript breakpoint.",
-                    "parameters": [
-                        {
-                            "name": "breakpointId",
-                            "$ref": "BreakpointId"
-                        }
-                    ]
-                },
-                {
-                    "name": "restartFrame",
-                    "description": "Restarts particular call frame from the beginning.",
-                    "parameters": [
-                        {
-                            "name": "callFrameId",
-                            "description": "Call frame identifier to evaluate on.",
-                            "$ref": "CallFrameId"
-                        }
-                    ],
-                    "returns": [
-                        {
-                            "name": "callFrames",
-                            "description": "New stack trace.",
-                            "type": "array",
-                            "items": {
-                                "$ref": "CallFrame"
-                            }
-                        },
-                        {
-                            "name": "asyncStackTrace",
-                            "description": "Async stack trace, if any.",
-                            "optional": true,
-                            "$ref": "Runtime.StackTrace"
-                        },
-                        {
-                            "name": "asyncStackTraceId",
-                            "description": "Async stack trace, if any.",
-                            "experimental": true,
-                            "optional": true,
-                            "$ref": "Runtime.StackTraceId"
-                        }
-                    ]
-                },
-                {
-                    "name": "resume",
-                    "description": "Resumes JavaScript execution."
-                },
-                {
-                    "name": "scheduleStepIntoAsync",
-                    "description": "This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and\nDebugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled\nbefore next pause. Returns success when async task is actually scheduled, returns error if no\ntask were scheduled or another scheduleStepIntoAsync was called.",
-                    "experimental": true
-                },
-                {
-                    "name": "searchInContent",
-                    "description": "Searches for given string in script content.",
-                    "parameters": [
-                        {
-                            "name": "scriptId",
-                            "description": "Id of the script to search in.",
-                            "$ref": "Runtime.ScriptId"
-                        },
-                        {
-                            "name": "query",
-                            "description": "String to search for.",
-                            "type": "string"
-                        },
-                        {
-                            "name": "caseSensitive",
-                            "description": "If true, search is case sensitive.",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "isRegex",
-                            "description": "If true, treats string parameter as regex.",
-                            "optional": true,
-                            "type": "boolean"
-                        }
-                    ],
-                    "returns": [
-                        {
-                            "name": "result",
-                            "description": "List of search matches.",
-                            "type": "array",
-                            "items": {
-                                "$ref": "SearchMatch"
-                            }
-                        }
-                    ]
-                },
-                {
-                    "name": "setAsyncCallStackDepth",
-                    "description": "Enables or disables async call stacks tracking.",
-                    "parameters": [
-                        {
-                            "name": "maxDepth",
-                            "description": "Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async\ncall stacks (default).",
-                            "type": "integer"
-                        }
-                    ]
-                },
-                {
-                    "name": "setBlackboxPatterns",
-                    "description": "Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in\nscripts with url matching one of the patterns. VM will try to leave blackboxed script by\nperforming 'step in' several times, finally resorting to 'step out' if unsuccessful.",
-                    "experimental": true,
-                    "parameters": [
-                        {
-                            "name": "patterns",
-                            "description": "Array of regexps that will be used to check script url for blackbox state.",
-                            "type": "array",
-                            "items": {
-                                "type": "string"
-                            }
-                        }
-                    ]
-                },
-                {
-                    "name": "setBlackboxedRanges",
-                    "description": "Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted\nscripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful.\nPositions array contains positions where blackbox state is changed. First interval isn't\nblackboxed. Array should be sorted.",
-                    "experimental": true,
-                    "parameters": [
-                        {
-                            "name": "scriptId",
-                            "description": "Id of the script.",
-                            "$ref": "Runtime.ScriptId"
-                        },
-                        {
-                            "name": "positions",
-                            "type": "array",
-                            "items": {
-                                "$ref": "ScriptPosition"
-                            }
-                        }
-                    ]
-                },
-                {
-                    "name": "setBreakpoint",
-                    "description": "Sets JavaScript breakpoint at a given location.",
-                    "parameters": [
-                        {
-                            "name": "location",
-                            "description": "Location to set breakpoint in.",
-                            "$ref": "Location"
-                        },
-                        {
-                            "name": "condition",
-                            "description": "Expression to use as a breakpoint condition. When specified, debugger will only stop on the\nbreakpoint if this expression evaluates to true.",
-                            "optional": true,
-                            "type": "string"
-                        }
-                    ],
-                    "returns": [
-                        {
-                            "name": "breakpointId",
-                            "description": "Id of the created breakpoint for further reference.",
-                            "$ref": "BreakpointId"
-                        },
-                        {
-                            "name": "actualLocation",
-                            "description": "Location this breakpoint resolved into.",
-                            "$ref": "Location"
-                        }
-                    ]
-                },
-                {
-                    "name": "setBreakpointByUrl",
-                    "description": "Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this\ncommand is issued, all existing parsed scripts will have breakpoints resolved and returned in\n`locations` property. Further matching script parsing will result in subsequent\n`breakpointResolved` events issued. This logical breakpoint will survive page reloads.",
-                    "parameters": [
-                        {
-                            "name": "lineNumber",
-                            "description": "Line number to set breakpoint at.",
-                            "type": "integer"
-                        },
-                        {
-                            "name": "url",
-                            "description": "URL of the resources to set breakpoint on.",
-                            "optional": true,
-                            "type": "string"
-                        },
-                        {
-                            "name": "urlRegex",
-                            "description": "Regex pattern for the URLs of the resources to set breakpoints on. Either `url` or\n`urlRegex` must be specified.",
-                            "optional": true,
-                            "type": "string"
-                        },
-                        {
-                            "name": "scriptHash",
-                            "description": "Script hash of the resources to set breakpoint on.",
-                            "optional": true,
-                            "type": "string"
-                        },
-                        {
-                            "name": "columnNumber",
-                            "description": "Offset in the line to set breakpoint at.",
-                            "optional": true,
-                            "type": "integer"
-                        },
-                        {
-                            "name": "condition",
-                            "description": "Expression to use as a breakpoint condition. When specified, debugger will only stop on the\nbreakpoint if this expression evaluates to true.",
-                            "optional": true,
-                            "type": "string"
-                        }
-                    ],
-                    "returns": [
-                        {
-                            "name": "breakpointId",
-                            "description": "Id of the created breakpoint for further reference.",
-                            "$ref": "BreakpointId"
-                        },
-                        {
-                            "name": "locations",
-                            "description": "List of the locations this breakpoint resolved into upon addition.",
-                            "type": "array",
-                            "items": {
-                                "$ref": "Location"
-                            }
-                        }
-                    ]
-                },
-                {
-                    "name": "setBreakpointsActive",
-                    "description": "Activates / deactivates all breakpoints on the page.",
-                    "parameters": [
-                        {
-                            "name": "active",
-                            "description": "New value for breakpoints active state.",
-                            "type": "boolean"
-                        }
-                    ]
-                },
-                {
-                    "name": "setPauseOnExceptions",
-                    "description": "Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or\nno exceptions. Initial pause on exceptions state is `none`.",
-                    "parameters": [
-                        {
-                            "name": "state",
-                            "description": "Pause on exceptions mode.",
-                            "type": "string",
-                            "enum": [
-                                "none",
-                                "uncaught",
-                                "all"
-                            ]
-                        }
-                    ]
-                },
-                {
-                    "name": "setReturnValue",
-                    "description": "Changes return value in top frame. Available only at return break position.",
-                    "experimental": true,
-                    "parameters": [
-                        {
-                            "name": "newValue",
-                            "description": "New return value.",
-                            "$ref": "Runtime.CallArgument"
-                        }
-                    ]
-                },
-                {
-                    "name": "setScriptSource",
-                    "description": "Edits JavaScript source live.",
-                    "parameters": [
-                        {
-                            "name": "scriptId",
-                            "description": "Id of the script to edit.",
-                            "$ref": "Runtime.ScriptId"
-                        },
-                        {
-                            "name": "scriptSource",
-                            "description": "New content of the script.",
-                            "type": "string"
-                        },
-                        {
-                            "name": "dryRun",
-                            "description": "If true the change will not actually be applied. Dry run may be used to get result\ndescription without actually modifying the code.",
-                            "optional": true,
-                            "type": "boolean"
-                        }
-                    ],
-                    "returns": [
-                        {
-                            "name": "callFrames",
-                            "description": "New stack trace in case editing has happened while VM was stopped.",
-                            "optional": true,
-                            "type": "array",
-                            "items": {
-                                "$ref": "CallFrame"
-                            }
-                        },
-                        {
-                            "name": "stackChanged",
-                            "description": "Whether current call stack  was modified after applying the changes.",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "asyncStackTrace",
-                            "description": "Async stack trace, if any.",
-                            "optional": true,
-                            "$ref": "Runtime.StackTrace"
-                        },
-                        {
-                            "name": "asyncStackTraceId",
-                            "description": "Async stack trace, if any.",
-                            "experimental": true,
-                            "optional": true,
-                            "$ref": "Runtime.StackTraceId"
-                        },
-                        {
-                            "name": "exceptionDetails",
-                            "description": "Exception details if any.",
-                            "optional": true,
-                            "$ref": "Runtime.ExceptionDetails"
-                        }
-                    ]
-                },
-                {
-                    "name": "setSkipAllPauses",
-                    "description": "Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).",
-                    "parameters": [
-                        {
-                            "name": "skip",
-                            "description": "New value for skip pauses state.",
-                            "type": "boolean"
-                        }
-                    ]
-                },
-                {
-                    "name": "setVariableValue",
-                    "description": "Changes value of variable in a callframe. Object-based scopes are not supported and must be\nmutated manually.",
-                    "parameters": [
-                        {
-                            "name": "scopeNumber",
-                            "description": "0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch'\nscope types are allowed. Other scopes could be manipulated manually.",
-                            "type": "integer"
-                        },
-                        {
-                            "name": "variableName",
-                            "description": "Variable name.",
-                            "type": "string"
-                        },
-                        {
-                            "name": "newValue",
-                            "description": "New variable value.",
-                            "$ref": "Runtime.CallArgument"
-                        },
-                        {
-                            "name": "callFrameId",
-                            "description": "Id of callframe that holds variable.",
-                            "$ref": "CallFrameId"
-                        }
-                    ]
-                },
-                {
-                    "name": "stepInto",
-                    "description": "Steps into the function call.",
-                    "parameters": [
-                        {
-                            "name": "breakOnAsyncCall",
-                            "description": "Debugger will issue additional Debugger.paused notification if any async task is scheduled\nbefore next pause.",
-                            "experimental": true,
-                            "optional": true,
-                            "type": "boolean"
-                        }
-                    ]
-                },
-                {
-                    "name": "stepOut",
-                    "description": "Steps out of the function call."
-                },
-                {
-                    "name": "stepOver",
-                    "description": "Steps over the statement."
-                }
-            ],
-            "events": [
-                {
-                    "name": "breakpointResolved",
-                    "description": "Fired when breakpoint is resolved to an actual script and location.",
-                    "parameters": [
-                        {
-                            "name": "breakpointId",
-                            "description": "Breakpoint unique identifier.",
-                            "$ref": "BreakpointId"
-                        },
-                        {
-                            "name": "location",
-                            "description": "Actual breakpoint location.",
-                            "$ref": "Location"
-                        }
-                    ]
-                },
-                {
-                    "name": "paused",
-                    "description": "Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.",
-                    "parameters": [
-                        {
-                            "name": "callFrames",
-                            "description": "Call stack the virtual machine stopped on.",
-                            "type": "array",
-                            "items": {
-                                "$ref": "CallFrame"
-                            }
-                        },
-                        {
-                            "name": "reason",
-                            "description": "Pause reason.",
-                            "type": "string",
-                            "enum": [
-                                "XHR",
-                                "DOM",
-                                "EventListener",
-                                "exception",
-                                "assert",
-                                "debugCommand",
-                                "promiseRejection",
-                                "OOM",
-                                "other",
-                                "ambiguous"
-                            ]
-                        },
-                        {
-                            "name": "data",
-                            "description": "Object containing break-specific auxiliary properties.",
-                            "optional": true,
-                            "type": "object"
-                        },
-                        {
-                            "name": "hitBreakpoints",
-                            "description": "Hit breakpoints IDs",
-                            "optional": true,
-                            "type": "array",
-                            "items": {
-                                "type": "string"
-                            }
-                        },
-                        {
-                            "name": "asyncStackTrace",
-                            "description": "Async stack trace, if any.",
-                            "optional": true,
-                            "$ref": "Runtime.StackTrace"
-                        },
-                        {
-                            "name": "asyncStackTraceId",
-                            "description": "Async stack trace, if any.",
-                            "experimental": true,
-                            "optional": true,
-                            "$ref": "Runtime.StackTraceId"
-                        },
-                        {
-                            "name": "asyncCallStackTraceId",
-                            "description": "Just scheduled async call will have this stack trace as parent stack during async execution.\nThis field is available only after `Debugger.stepInto` call with `breakOnAsynCall` flag.",
-                            "experimental": true,
-                            "optional": true,
-                            "$ref": "Runtime.StackTraceId"
-                        }
-                    ]
-                },
-                {
-                    "name": "resumed",
-                    "description": "Fired when the virtual machine resumed execution."
-                },
-                {
-                    "name": "scriptFailedToParse",
-                    "description": "Fired when virtual machine fails to parse the script.",
-                    "parameters": [
-                        {
-                            "name": "scriptId",
-                            "description": "Identifier of the script parsed.",
-                            "$ref": "Runtime.ScriptId"
-                        },
-                        {
-                            "name": "url",
-                            "description": "URL or name of the script parsed (if any).",
-                            "type": "string"
-                        },
-                        {
-                            "name": "startLine",
-                            "description": "Line offset of the script within the resource with given URL (for script tags).",
-                            "type": "integer"
-                        },
-                        {
-                            "name": "startColumn",
-                            "description": "Column offset of the script within the resource with given URL.",
-                            "type": "integer"
-                        },
-                        {
-                            "name": "endLine",
-                            "description": "Last line of the script.",
-                            "type": "integer"
-                        },
-                        {
-                            "name": "endColumn",
-                            "description": "Length of the last line of the script.",
-                            "type": "integer"
-                        },
-                        {
-                            "name": "executionContextId",
-                            "description": "Specifies script creation context.",
-                            "$ref": "Runtime.ExecutionContextId"
-                        },
-                        {
-                            "name": "hash",
-                            "description": "Content hash of the script.",
-                            "type": "string"
-                        },
-                        {
-                            "name": "executionContextAuxData",
-                            "description": "Embedder-specific auxiliary data.",
-                            "optional": true,
-                            "type": "object"
-                        },
-                        {
-                            "name": "sourceMapURL",
-                            "description": "URL of source map associated with script (if any).",
-                            "optional": true,
-                            "type": "string"
-                        },
-                        {
-                            "name": "hasSourceURL",
-                            "description": "True, if this script has sourceURL.",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "isModule",
-                            "description": "True, if this script is ES6 module.",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "length",
-                            "description": "This script length.",
-                            "optional": true,
-                            "type": "integer"
-                        },
-                        {
-                            "name": "stackTrace",
-                            "description": "JavaScript top stack frame of where the script parsed event was triggered if available.",
-                            "experimental": true,
-                            "optional": true,
-                            "$ref": "Runtime.StackTrace"
-                        }
-                    ]
-                },
-                {
-                    "name": "scriptParsed",
-                    "description": "Fired when virtual machine parses script. This event is also fired for all known and uncollected\nscripts upon enabling debugger.",
-                    "parameters": [
-                        {
-                            "name": "scriptId",
-                            "description": "Identifier of the script parsed.",
-                            "$ref": "Runtime.ScriptId"
-                        },
-                        {
-                            "name": "url",
-                            "description": "URL or name of the script parsed (if any).",
-                            "type": "string"
-                        },
-                        {
-                            "name": "startLine",
-                            "description": "Line offset of the script within the resource with given URL (for script tags).",
-                            "type": "integer"
-                        },
-                        {
-                            "name": "startColumn",
-                            "description": "Column offset of the script within the resource with given URL.",
-                            "type": "integer"
-                        },
-                        {
-                            "name": "endLine",
-                            "description": "Last line of the script.",
-                            "type": "integer"
-                        },
-                        {
-                            "name": "endColumn",
-                            "description": "Length of the last line of the script.",
-                            "type": "integer"
-                        },
-                        {
-                            "name": "executionContextId",
-                            "description": "Specifies script creation context.",
-                            "$ref": "Runtime.ExecutionContextId"
-                        },
-                        {
-                            "name": "hash",
-                            "description": "Content hash of the script.",
-                            "type": "string"
-                        },
-                        {
-                            "name": "executionContextAuxData",
-                            "description": "Embedder-specific auxiliary data.",
-                            "optional": true,
-                            "type": "object"
-                        },
-                        {
-                            "name": "isLiveEdit",
-                            "description": "True, if this script is generated as a result of the live edit operation.",
-                            "experimental": true,
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "sourceMapURL",
-                            "description": "URL of source map associated with script (if any).",
-                            "optional": true,
-                            "type": "string"
-                        },
-                        {
-                            "name": "hasSourceURL",
-                            "description": "True, if this script has sourceURL.",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "isModule",
-                            "description": "True, if this script is ES6 module.",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "length",
-                            "description": "This script length.",
-                            "optional": true,
-                            "type": "integer"
-                        },
-                        {
-                            "name": "stackTrace",
-                            "description": "JavaScript top stack frame of where the script parsed event was triggered if available.",
-                            "experimental": true,
-                            "optional": true,
-                            "$ref": "Runtime.StackTrace"
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "domain": "HeapProfiler",
-            "experimental": true,
-            "dependencies": [
-                "Runtime"
-            ],
-            "types": [
-                {
-                    "id": "HeapSnapshotObjectId",
-                    "description": "Heap snapshot object id.",
-                    "type": "string"
-                },
-                {
-                    "id": "SamplingHeapProfileNode",
-                    "description": "Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes.",
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "callFrame",
-                            "description": "Function location.",
-                            "$ref": "Runtime.CallFrame"
-                        },
-                        {
-                            "name": "selfSize",
-                            "description": "Allocations size in bytes for the node excluding children.",
-                            "type": "number"
-                        },
-                        {
-                            "name": "children",
-                            "description": "Child nodes.",
-                            "type": "array",
-                            "items": {
-                                "$ref": "SamplingHeapProfileNode"
-                            }
-                        }
-                    ]
-                },
-                {
-                    "id": "SamplingHeapProfile",
-                    "description": "Profile.",
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "head",
-                            "$ref": "SamplingHeapProfileNode"
-                        }
-                    ]
-                }
-            ],
-            "commands": [
-                {
-                    "name": "addInspectedHeapObject",
-                    "description": "Enables console to refer to the node with given id via $x (see Command Line API for more details\n$x functions).",
-                    "parameters": [
-                        {
-                            "name": "heapObjectId",
-                            "description": "Heap snapshot object id to be accessible by means of $x command line API.",
-                            "$ref": "HeapSnapshotObjectId"
-                        }
-                    ]
-                },
-                {
-                    "name": "collectGarbage"
-                },
-                {
-                    "name": "disable"
-                },
-                {
-                    "name": "enable"
-                },
-                {
-                    "name": "getHeapObjectId",
-                    "parameters": [
-                        {
-                            "name": "objectId",
-                            "description": "Identifier of the object to get heap object id for.",
-                            "$ref": "Runtime.RemoteObjectId"
-                        }
-                    ],
-                    "returns": [
-                        {
-                            "name": "heapSnapshotObjectId",
-                            "description": "Id of the heap snapshot object corresponding to the passed remote object id.",
-                            "$ref": "HeapSnapshotObjectId"
-                        }
-                    ]
-                },
-                {
-                    "name": "getObjectByHeapObjectId",
-                    "parameters": [
-                        {
-                            "name": "objectId",
-                            "$ref": "HeapSnapshotObjectId"
-                        },
-                        {
-                            "name": "objectGroup",
-                            "description": "Symbolic group name that can be used to release multiple objects.",
-                            "optional": true,
-                            "type": "string"
-                        }
-                    ],
-                    "returns": [
-                        {
-                            "name": "result",
-                            "description": "Evaluation result.",
-                            "$ref": "Runtime.RemoteObject"
-                        }
-                    ]
-                },
-                {
-                    "name": "getSamplingProfile",
-                    "returns": [
-                        {
-                            "name": "profile",
-                            "description": "Return the sampling profile being collected.",
-                            "$ref": "SamplingHeapProfile"
-                        }
-                    ]
-                },
-                {
-                    "name": "startSampling",
-                    "parameters": [
-                        {
-                            "name": "samplingInterval",
-                            "description": "Average sample interval in bytes. Poisson distribution is used for the intervals. The\ndefault value is 32768 bytes.",
-                            "optional": true,
-                            "type": "number"
-                        }
-                    ]
-                },
-                {
-                    "name": "startTrackingHeapObjects",
-                    "parameters": [
-                        {
-                            "name": "trackAllocations",
-                            "optional": true,
-                            "type": "boolean"
-                        }
-                    ]
-                },
-                {
-                    "name": "stopSampling",
-                    "returns": [
-                        {
-                            "name": "profile",
-                            "description": "Recorded sampling heap profile.",
-                            "$ref": "SamplingHeapProfile"
-                        }
-                    ]
-                },
-                {
-                    "name": "stopTrackingHeapObjects",
-                    "parameters": [
-                        {
-                            "name": "reportProgress",
-                            "description": "If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken\nwhen the tracking is stopped.",
-                            "optional": true,
-                            "type": "boolean"
-                        }
-                    ]
-                },
-                {
-                    "name": "takeHeapSnapshot",
-                    "parameters": [
-                        {
-                            "name": "reportProgress",
-                            "description": "If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken.",
-                            "optional": true,
-                            "type": "boolean"
-                        }
-                    ]
-                }
-            ],
-            "events": [
-                {
-                    "name": "addHeapSnapshotChunk",
-                    "parameters": [
-                        {
-                            "name": "chunk",
-                            "type": "string"
-                        }
-                    ]
-                },
-                {
-                    "name": "heapStatsUpdate",
-                    "description": "If heap objects tracking has been started then backend may send update for one or more fragments",
-                    "parameters": [
-                        {
-                            "name": "statsUpdate",
-                            "description": "An array of triplets. Each triplet describes a fragment. The first integer is the fragment\nindex, the second integer is a total count of objects for the fragment, the third integer is\na total size of the objects for the fragment.",
-                            "type": "array",
-                            "items": {
-                                "type": "integer"
-                            }
-                        }
-                    ]
-                },
-                {
-                    "name": "lastSeenObjectId",
-                    "description": "If heap objects tracking has been started then backend regularly sends a current value for last\nseen object id and corresponding timestamp. If the were changes in the heap since last event\nthen one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.",
-                    "parameters": [
-                        {
-                            "name": "lastSeenObjectId",
-                            "type": "integer"
-                        },
-                        {
-                            "name": "timestamp",
-                            "type": "number"
-                        }
-                    ]
-                },
-                {
-                    "name": "reportHeapSnapshotProgress",
-                    "parameters": [
-                        {
-                            "name": "done",
-                            "type": "integer"
-                        },
-                        {
-                            "name": "total",
-                            "type": "integer"
-                        },
-                        {
-                            "name": "finished",
-                            "optional": true,
-                            "type": "boolean"
-                        }
-                    ]
-                },
-                {
-                    "name": "resetProfiles"
-                }
-            ]
-        },
-        {
-            "domain": "Profiler",
-            "dependencies": [
-                "Runtime",
-                "Debugger"
-            ],
-            "types": [
-                {
-                    "id": "ProfileNode",
-                    "description": "Profile node. Holds callsite information, execution statistics and child nodes.",
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "id",
-                            "description": "Unique id of the node.",
-                            "type": "integer"
-                        },
-                        {
-                            "name": "callFrame",
-                            "description": "Function location.",
-                            "$ref": "Runtime.CallFrame"
-                        },
-                        {
-                            "name": "hitCount",
-                            "description": "Number of samples where this node was on top of the call stack.",
-                            "optional": true,
-                            "type": "integer"
-                        },
-                        {
-                            "name": "children",
-                            "description": "Child node ids.",
-                            "optional": true,
-                            "type": "array",
-                            "items": {
-                                "type": "integer"
-                            }
-                        },
-                        {
-                            "name": "deoptReason",
-                            "description": "The reason of being not optimized. The function may be deoptimized or marked as don't\noptimize.",
-                            "optional": true,
-                            "type": "string"
-                        },
-                        {
-                            "name": "positionTicks",
-                            "description": "An array of source position ticks.",
-                            "optional": true,
-                            "type": "array",
-                            "items": {
-                                "$ref": "PositionTickInfo"
-                            }
-                        }
-                    ]
-                },
-                {
-                    "id": "Profile",
-                    "description": "Profile.",
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "nodes",
-                            "description": "The list of profile nodes. First item is the root node.",
-                            "type": "array",
-                            "items": {
-                                "$ref": "ProfileNode"
-                            }
-                        },
-                        {
-                            "name": "startTime",
-                            "description": "Profiling start timestamp in microseconds.",
-                            "type": "number"
-                        },
-                        {
-                            "name": "endTime",
-                            "description": "Profiling end timestamp in microseconds.",
-                            "type": "number"
-                        },
-                        {
-                            "name": "samples",
-                            "description": "Ids of samples top nodes.",
-                            "optional": true,
-                            "type": "array",
-                            "items": {
-                                "type": "integer"
-                            }
-                        },
-                        {
-                            "name": "timeDeltas",
-                            "description": "Time intervals between adjacent samples in microseconds. The first delta is relative to the\nprofile startTime.",
-                            "optional": true,
-                            "type": "array",
-                            "items": {
-                                "type": "integer"
-                            }
-                        }
-                    ]
-                },
-                {
-                    "id": "PositionTickInfo",
-                    "description": "Specifies a number of samples attributed to a certain source position.",
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "line",
-                            "description": "Source line number (1-based).",
-                            "type": "integer"
-                        },
-                        {
-                            "name": "ticks",
-                            "description": "Number of samples attributed to the source line.",
-                            "type": "integer"
-                        }
-                    ]
-                },
-                {
-                    "id": "CoverageRange",
-                    "description": "Coverage data for a source range.",
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "startOffset",
-                            "description": "JavaScript script source offset for the range start.",
-                            "type": "integer"
-                        },
-                        {
-                            "name": "endOffset",
-                            "description": "JavaScript script source offset for the range end.",
-                            "type": "integer"
-                        },
-                        {
-                            "name": "count",
-                            "description": "Collected execution count of the source range.",
-                            "type": "integer"
-                        }
-                    ]
-                },
-                {
-                    "id": "FunctionCoverage",
-                    "description": "Coverage data for a JavaScript function.",
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "functionName",
-                            "description": "JavaScript function name.",
-                            "type": "string"
-                        },
-                        {
-                            "name": "ranges",
-                            "description": "Source ranges inside the function with coverage data.",
-                            "type": "array",
-                            "items": {
-                                "$ref": "CoverageRange"
-                            }
-                        },
-                        {
-                            "name": "isBlockCoverage",
-                            "description": "Whether coverage data for this function has block granularity.",
-                            "type": "boolean"
-                        }
-                    ]
-                },
-                {
-                    "id": "ScriptCoverage",
-                    "description": "Coverage data for a JavaScript script.",
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "scriptId",
-                            "description": "JavaScript script id.",
-                            "$ref": "Runtime.ScriptId"
-                        },
-                        {
-                            "name": "url",
-                            "description": "JavaScript script name or url.",
-                            "type": "string"
-                        },
-                        {
-                            "name": "functions",
-                            "description": "Functions contained in the script that has coverage data.",
-                            "type": "array",
-                            "items": {
-                                "$ref": "FunctionCoverage"
-                            }
-                        }
-                    ]
-                },
-                {
-                    "id": "TypeObject",
-                    "description": "Describes a type collected during runtime.",
-                    "experimental": true,
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "name",
-                            "description": "Name of a type collected with type profiling.",
-                            "type": "string"
-                        }
-                    ]
-                },
-                {
-                    "id": "TypeProfileEntry",
-                    "description": "Source offset and types for a parameter or return value.",
-                    "experimental": true,
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "offset",
-                            "description": "Source offset of the parameter or end of function for return values.",
-                            "type": "integer"
-                        },
-                        {
-                            "name": "types",
-                            "description": "The types for this parameter or return value.",
-                            "type": "array",
-                            "items": {
-                                "$ref": "TypeObject"
-                            }
-                        }
-                    ]
-                },
-                {
-                    "id": "ScriptTypeProfile",
-                    "description": "Type profile data collected during runtime for a JavaScript script.",
-                    "experimental": true,
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "scriptId",
-                            "description": "JavaScript script id.",
-                            "$ref": "Runtime.ScriptId"
-                        },
-                        {
-                            "name": "url",
-                            "description": "JavaScript script name or url.",
-                            "type": "string"
-                        },
-                        {
-                            "name": "entries",
-                            "description": "Type profile entries for parameters and return values of the functions in the script.",
-                            "type": "array",
-                            "items": {
-                                "$ref": "TypeProfileEntry"
-                            }
-                        }
-                    ]
-                }
-            ],
-            "commands": [
-                {
-                    "name": "disable"
-                },
-                {
-                    "name": "enable"
-                },
-                {
-                    "name": "getBestEffortCoverage",
-                    "description": "Collect coverage data for the current isolate. The coverage data may be incomplete due to\ngarbage collection.",
-                    "returns": [
-                        {
-                            "name": "result",
-                            "description": "Coverage data for the current isolate.",
-                            "type": "array",
-                            "items": {
-                                "$ref": "ScriptCoverage"
-                            }
-                        }
-                    ]
-                },
-                {
-                    "name": "setSamplingInterval",
-                    "description": "Changes CPU profiler sampling interval. Must be called before CPU profiles recording started.",
-                    "parameters": [
-                        {
-                            "name": "interval",
-                            "description": "New sampling interval in microseconds.",
-                            "type": "integer"
-                        }
-                    ]
-                },
-                {
-                    "name": "start"
-                },
-                {
-                    "name": "startPreciseCoverage",
-                    "description": "Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code\ncoverage may be incomplete. Enabling prevents running optimized code and resets execution\ncounters.",
-                    "parameters": [
-                        {
-                            "name": "callCount",
-                            "description": "Collect accurate call counts beyond simple 'covered' or 'not covered'.",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "detailed",
-                            "description": "Collect block-based coverage.",
-                            "optional": true,
-                            "type": "boolean"
-                        }
-                    ]
-                },
-                {
-                    "name": "startTypeProfile",
-                    "description": "Enable type profile.",
-                    "experimental": true
-                },
-                {
-                    "name": "stop",
-                    "returns": [
-                        {
-                            "name": "profile",
-                            "description": "Recorded profile.",
-                            "$ref": "Profile"
-                        }
-                    ]
-                },
-                {
-                    "name": "stopPreciseCoverage",
-                    "description": "Disable precise code coverage. Disabling releases unnecessary execution count records and allows\nexecuting optimized code."
-                },
-                {
-                    "name": "stopTypeProfile",
-                    "description": "Disable type profile. Disabling releases type profile data collected so far.",
-                    "experimental": true
-                },
-                {
-                    "name": "takePreciseCoverage",
-                    "description": "Collect coverage data for the current isolate, and resets execution counters. Precise code\ncoverage needs to have started.",
-                    "returns": [
-                        {
-                            "name": "result",
-                            "description": "Coverage data for the current isolate.",
-                            "type": "array",
-                            "items": {
-                                "$ref": "ScriptCoverage"
-                            }
-                        }
-                    ]
-                },
-                {
-                    "name": "takeTypeProfile",
-                    "description": "Collect type profile.",
-                    "experimental": true,
-                    "returns": [
-                        {
-                            "name": "result",
-                            "description": "Type profile for all scripts since startTypeProfile() was turned on.",
-                            "type": "array",
-                            "items": {
-                                "$ref": "ScriptTypeProfile"
-                            }
-                        }
-                    ]
-                }
-            ],
-            "events": [
-                {
-                    "name": "consoleProfileFinished",
-                    "parameters": [
-                        {
-                            "name": "id",
-                            "type": "string"
-                        },
-                        {
-                            "name": "location",
-                            "description": "Location of console.profileEnd().",
-                            "$ref": "Debugger.Location"
-                        },
-                        {
-                            "name": "profile",
-                            "$ref": "Profile"
-                        },
-                        {
-                            "name": "title",
-                            "description": "Profile title passed as an argument to console.profile().",
-                            "optional": true,
-                            "type": "string"
-                        }
-                    ]
-                },
-                {
-                    "name": "consoleProfileStarted",
-                    "description": "Sent when new profile recording is started using console.profile() call.",
-                    "parameters": [
-                        {
-                            "name": "id",
-                            "type": "string"
-                        },
-                        {
-                            "name": "location",
-                            "description": "Location of console.profile().",
-                            "$ref": "Debugger.Location"
-                        },
-                        {
-                            "name": "title",
-                            "description": "Profile title passed as an argument to console.profile().",
-                            "optional": true,
-                            "type": "string"
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "domain": "Runtime",
-            "description": "Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects.\nEvaluation results are returned as mirror object that expose object type, string representation\nand unique identifier that can be used for further object reference. Original objects are\nmaintained in memory unless they are either explicitly released or are released along with the\nother objects in their object group.",
-            "types": [
-                {
-                    "id": "ScriptId",
-                    "description": "Unique script identifier.",
-                    "type": "string"
-                },
-                {
-                    "id": "RemoteObjectId",
-                    "description": "Unique object identifier.",
-                    "type": "string"
-                },
-                {
-                    "id": "UnserializableValue",
-                    "description": "Primitive value which cannot be JSON-stringified.",
-                    "type": "string",
-                    "enum": [
-                        "Infinity",
-                        "NaN",
-                        "-Infinity",
-                        "-0"
-                    ]
-                },
-                {
-                    "id": "RemoteObject",
-                    "description": "Mirror object referencing original JavaScript object.",
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "type",
-                            "description": "Object type.",
-                            "type": "string",
-                            "enum": [
-                                "object",
-                                "function",
-                                "undefined",
-                                "string",
-                                "number",
-                                "boolean",
-                                "symbol"
-                            ]
-                        },
-                        {
-                            "name": "subtype",
-                            "description": "Object subtype hint. Specified for `object` type values only.",
-                            "optional": true,
-                            "type": "string",
-                            "enum": [
-                                "array",
-                                "null",
-                                "node",
-                                "regexp",
-                                "date",
-                                "map",
-                                "set",
-                                "weakmap",
-                                "weakset",
-                                "iterator",
-                                "generator",
-                                "error",
-                                "proxy",
-                                "promise",
-                                "typedarray"
-                            ]
-                        },
-                        {
-                            "name": "className",
-                            "description": "Object class (constructor) name. Specified for `object` type values only.",
-                            "optional": true,
-                            "type": "string"
-                        },
-                        {
-                            "name": "value",
-                            "description": "Remote object value in case of primitive values or JSON values (if it was requested).",
-                            "optional": true,
-                            "type": "any"
-                        },
-                        {
-                            "name": "unserializableValue",
-                            "description": "Primitive value which can not be JSON-stringified does not have `value`, but gets this\nproperty.",
-                            "optional": true,
-                            "$ref": "UnserializableValue"
-                        },
-                        {
-                            "name": "description",
-                            "description": "String representation of the object.",
-                            "optional": true,
-                            "type": "string"
-                        },
-                        {
-                            "name": "objectId",
-                            "description": "Unique object identifier (for non-primitive values).",
-                            "optional": true,
-                            "$ref": "RemoteObjectId"
-                        },
-                        {
-                            "name": "preview",
-                            "description": "Preview containing abbreviated property values. Specified for `object` type values only.",
-                            "experimental": true,
-                            "optional": true,
-                            "$ref": "ObjectPreview"
-                        },
-                        {
-                            "name": "customPreview",
-                            "experimental": true,
-                            "optional": true,
-                            "$ref": "CustomPreview"
-                        }
-                    ]
-                },
-                {
-                    "id": "CustomPreview",
-                    "experimental": true,
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "header",
-                            "type": "string"
-                        },
-                        {
-                            "name": "hasBody",
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "formatterObjectId",
-                            "$ref": "RemoteObjectId"
-                        },
-                        {
-                            "name": "bindRemoteObjectFunctionId",
-                            "$ref": "RemoteObjectId"
-                        },
-                        {
-                            "name": "configObjectId",
-                            "optional": true,
-                            "$ref": "RemoteObjectId"
-                        }
-                    ]
-                },
-                {
-                    "id": "ObjectPreview",
-                    "description": "Object containing abbreviated remote object value.",
-                    "experimental": true,
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "type",
-                            "description": "Object type.",
-                            "type": "string",
-                            "enum": [
-                                "object",
-                                "function",
-                                "undefined",
-                                "string",
-                                "number",
-                                "boolean",
-                                "symbol"
-                            ]
-                        },
-                        {
-                            "name": "subtype",
-                            "description": "Object subtype hint. Specified for `object` type values only.",
-                            "optional": true,
-                            "type": "string",
-                            "enum": [
-                                "array",
-                                "null",
-                                "node",
-                                "regexp",
-                                "date",
-                                "map",
-                                "set",
-                                "weakmap",
-                                "weakset",
-                                "iterator",
-                                "generator",
-                                "error"
-                            ]
-                        },
-                        {
-                            "name": "description",
-                            "description": "String representation of the object.",
-                            "optional": true,
-                            "type": "string"
-                        },
-                        {
-                            "name": "overflow",
-                            "description": "True iff some of the properties or entries of the original object did not fit.",
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "properties",
-                            "description": "List of the properties.",
-                            "type": "array",
-                            "items": {
-                                "$ref": "PropertyPreview"
-                            }
-                        },
-                        {
-                            "name": "entries",
-                            "description": "List of the entries. Specified for `map` and `set` subtype values only.",
-                            "optional": true,
-                            "type": "array",
-                            "items": {
-                                "$ref": "EntryPreview"
-                            }
-                        }
-                    ]
-                },
-                {
-                    "id": "PropertyPreview",
-                    "experimental": true,
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "name",
-                            "description": "Property name.",
-                            "type": "string"
-                        },
-                        {
-                            "name": "type",
-                            "description": "Object type. Accessor means that the property itself is an accessor property.",
-                            "type": "string",
-                            "enum": [
-                                "object",
-                                "function",
-                                "undefined",
-                                "string",
-                                "number",
-                                "boolean",
-                                "symbol",
-                                "accessor"
-                            ]
-                        },
-                        {
-                            "name": "value",
-                            "description": "User-friendly property value string.",
-                            "optional": true,
-                            "type": "string"
-                        },
-                        {
-                            "name": "valuePreview",
-                            "description": "Nested value preview.",
-                            "optional": true,
-                            "$ref": "ObjectPreview"
-                        },
-                        {
-                            "name": "subtype",
-                            "description": "Object subtype hint. Specified for `object` type values only.",
-                            "optional": true,
-                            "type": "string",
-                            "enum": [
-                                "array",
-                                "null",
-                                "node",
-                                "regexp",
-                                "date",
-                                "map",
-                                "set",
-                                "weakmap",
-                                "weakset",
-                                "iterator",
-                                "generator",
-                                "error"
-                            ]
-                        }
-                    ]
-                },
-                {
-                    "id": "EntryPreview",
-                    "experimental": true,
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "key",
-                            "description": "Preview of the key. Specified for map-like collection entries.",
-                            "optional": true,
-                            "$ref": "ObjectPreview"
-                        },
-                        {
-                            "name": "value",
-                            "description": "Preview of the value.",
-                            "$ref": "ObjectPreview"
-                        }
-                    ]
-                },
-                {
-                    "id": "PropertyDescriptor",
-                    "description": "Object property descriptor.",
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "name",
-                            "description": "Property name or symbol description.",
-                            "type": "string"
-                        },
-                        {
-                            "name": "value",
-                            "description": "The value associated with the property.",
-                            "optional": true,
-                            "$ref": "RemoteObject"
-                        },
-                        {
-                            "name": "writable",
-                            "description": "True if the value associated with the property may be changed (data descriptors only).",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "get",
-                            "description": "A function which serves as a getter for the property, or `undefined` if there is no getter\n(accessor descriptors only).",
-                            "optional": true,
-                            "$ref": "RemoteObject"
-                        },
-                        {
-                            "name": "set",
-                            "description": "A function which serves as a setter for the property, or `undefined` if there is no setter\n(accessor descriptors only).",
-                            "optional": true,
-                            "$ref": "RemoteObject"
-                        },
-                        {
-                            "name": "configurable",
-                            "description": "True if the type of this property descriptor may be changed and if the property may be\ndeleted from the corresponding object.",
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "enumerable",
-                            "description": "True if this property shows up during enumeration of the properties on the corresponding\nobject.",
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "wasThrown",
-                            "description": "True if the result was thrown during the evaluation.",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "isOwn",
-                            "description": "True if the property is owned for the object.",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "symbol",
-                            "description": "Property symbol object, if the property is of the `symbol` type.",
-                            "optional": true,
-                            "$ref": "RemoteObject"
-                        }
-                    ]
-                },
-                {
-                    "id": "InternalPropertyDescriptor",
-                    "description": "Object internal property descriptor. This property isn't normally visible in JavaScript code.",
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "name",
-                            "description": "Conventional property name.",
-                            "type": "string"
-                        },
-                        {
-                            "name": "value",
-                            "description": "The value associated with the property.",
-                            "optional": true,
-                            "$ref": "RemoteObject"
-                        }
-                    ]
-                },
-                {
-                    "id": "CallArgument",
-                    "description": "Represents function call argument. Either remote object id `objectId`, primitive `value`,\nunserializable primitive value or neither of (for undefined) them should be specified.",
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "value",
-                            "description": "Primitive value or serializable javascript object.",
-                            "optional": true,
-                            "type": "any"
-                        },
-                        {
-                            "name": "unserializableValue",
-                            "description": "Primitive value which can not be JSON-stringified.",
-                            "optional": true,
-                            "$ref": "UnserializableValue"
-                        },
-                        {
-                            "name": "objectId",
-                            "description": "Remote object handle.",
-                            "optional": true,
-                            "$ref": "RemoteObjectId"
-                        }
-                    ]
-                },
-                {
-                    "id": "ExecutionContextId",
-                    "description": "Id of an execution context.",
-                    "type": "integer"
-                },
-                {
-                    "id": "ExecutionContextDescription",
-                    "description": "Description of an isolated world.",
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "id",
-                            "description": "Unique id of the execution context. It can be used to specify in which execution context\nscript evaluation should be performed.",
-                            "$ref": "ExecutionContextId"
-                        },
-                        {
-                            "name": "origin",
-                            "description": "Execution context origin.",
-                            "type": "string"
-                        },
-                        {
-                            "name": "name",
-                            "description": "Human readable name describing given context.",
-                            "type": "string"
-                        },
-                        {
-                            "name": "auxData",
-                            "description": "Embedder-specific auxiliary data.",
-                            "optional": true,
-                            "type": "object"
-                        }
-                    ]
-                },
-                {
-                    "id": "ExceptionDetails",
-                    "description": "Detailed information about exception (or error) that was thrown during script compilation or\nexecution.",
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "exceptionId",
-                            "description": "Exception id.",
-                            "type": "integer"
-                        },
-                        {
-                            "name": "text",
-                            "description": "Exception text, which should be used together with exception object when available.",
-                            "type": "string"
-                        },
-                        {
-                            "name": "lineNumber",
-                            "description": "Line number of the exception location (0-based).",
-                            "type": "integer"
-                        },
-                        {
-                            "name": "columnNumber",
-                            "description": "Column number of the exception location (0-based).",
-                            "type": "integer"
-                        },
-                        {
-                            "name": "scriptId",
-                            "description": "Script ID of the exception location.",
-                            "optional": true,
-                            "$ref": "ScriptId"
-                        },
-                        {
-                            "name": "url",
-                            "description": "URL of the exception location, to be used when the script was not reported.",
-                            "optional": true,
-                            "type": "string"
-                        },
-                        {
-                            "name": "stackTrace",
-                            "description": "JavaScript stack trace if available.",
-                            "optional": true,
-                            "$ref": "StackTrace"
-                        },
-                        {
-                            "name": "exception",
-                            "description": "Exception object if available.",
-                            "optional": true,
-                            "$ref": "RemoteObject"
-                        },
-                        {
-                            "name": "executionContextId",
-                            "description": "Identifier of the context where exception happened.",
-                            "optional": true,
-                            "$ref": "ExecutionContextId"
-                        }
-                    ]
-                },
-                {
-                    "id": "Timestamp",
-                    "description": "Number of milliseconds since epoch.",
-                    "type": "number"
-                },
-                {
-                    "id": "CallFrame",
-                    "description": "Stack entry for runtime errors and assertions.",
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "functionName",
-                            "description": "JavaScript function name.",
-                            "type": "string"
-                        },
-                        {
-                            "name": "scriptId",
-                            "description": "JavaScript script id.",
-                            "$ref": "ScriptId"
-                        },
-                        {
-                            "name": "url",
-                            "description": "JavaScript script name or url.",
-                            "type": "string"
-                        },
-                        {
-                            "name": "lineNumber",
-                            "description": "JavaScript script line number (0-based).",
-                            "type": "integer"
-                        },
-                        {
-                            "name": "columnNumber",
-                            "description": "JavaScript script column number (0-based).",
-                            "type": "integer"
-                        }
-                    ]
-                },
-                {
-                    "id": "StackTrace",
-                    "description": "Call frames for assertions or error messages.",
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "description",
-                            "description": "String label of this stack trace. For async traces this may be a name of the function that\ninitiated the async call.",
-                            "optional": true,
-                            "type": "string"
-                        },
-                        {
-                            "name": "callFrames",
-                            "description": "JavaScript function name.",
-                            "type": "array",
-                            "items": {
-                                "$ref": "CallFrame"
-                            }
-                        },
-                        {
-                            "name": "parent",
-                            "description": "Asynchronous JavaScript stack trace that preceded this stack, if available.",
-                            "optional": true,
-                            "$ref": "StackTrace"
-                        },
-                        {
-                            "name": "parentId",
-                            "description": "Asynchronous JavaScript stack trace that preceded this stack, if available.",
-                            "experimental": true,
-                            "optional": true,
-                            "$ref": "StackTraceId"
-                        }
-                    ]
-                },
-                {
-                    "id": "UniqueDebuggerId",
-                    "description": "Unique identifier of current debugger.",
-                    "experimental": true,
-                    "type": "string"
-                },
-                {
-                    "id": "StackTraceId",
-                    "description": "If `debuggerId` is set stack trace comes from another debugger and can be resolved there. This\nallows to track cross-debugger calls. See `Runtime.StackTrace` and `Debugger.paused` for usages.",
-                    "experimental": true,
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "id",
-                            "type": "string"
-                        },
-                        {
-                            "name": "debuggerId",
-                            "optional": true,
-                            "$ref": "UniqueDebuggerId"
-                        }
-                    ]
-                }
-            ],
-            "commands": [
-                {
-                    "name": "awaitPromise",
-                    "description": "Add handler to promise with given promise object id.",
-                    "parameters": [
-                        {
-                            "name": "promiseObjectId",
-                            "description": "Identifier of the promise.",
-                            "$ref": "RemoteObjectId"
-                        },
-                        {
-                            "name": "returnByValue",
-                            "description": "Whether the result is expected to be a JSON object that should be sent by value.",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "generatePreview",
-                            "description": "Whether preview should be generated for the result.",
-                            "optional": true,
-                            "type": "boolean"
-                        }
-                    ],
-                    "returns": [
-                        {
-                            "name": "result",
-                            "description": "Promise result. Will contain rejected value if promise was rejected.",
-                            "$ref": "RemoteObject"
-                        },
-                        {
-                            "name": "exceptionDetails",
-                            "description": "Exception details if stack strace is available.",
-                            "optional": true,
-                            "$ref": "ExceptionDetails"
-                        }
-                    ]
-                },
-                {
-                    "name": "callFunctionOn",
-                    "description": "Calls function with given declaration on the given object. Object group of the result is\ninherited from the target object.",
-                    "parameters": [
-                        {
-                            "name": "functionDeclaration",
-                            "description": "Declaration of the function to call.",
-                            "type": "string"
-                        },
-                        {
-                            "name": "objectId",
-                            "description": "Identifier of the object to call function on. Either objectId or executionContextId should\nbe specified.",
-                            "optional": true,
-                            "$ref": "RemoteObjectId"
-                        },
-                        {
-                            "name": "arguments",
-                            "description": "Call arguments. All call arguments must belong to the same JavaScript world as the target\nobject.",
-                            "optional": true,
-                            "type": "array",
-                            "items": {
-                                "$ref": "CallArgument"
-                            }
-                        },
-                        {
-                            "name": "silent",
-                            "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause\nexecution. Overrides `setPauseOnException` state.",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "returnByValue",
-                            "description": "Whether the result is expected to be a JSON object which should be sent by value.",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "generatePreview",
-                            "description": "Whether preview should be generated for the result.",
-                            "experimental": true,
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "userGesture",
-                            "description": "Whether execution should be treated as initiated by user in the UI.",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "awaitPromise",
-                            "description": "Whether execution should `await` for resulting value and return once awaited promise is\nresolved.",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "executionContextId",
-                            "description": "Specifies execution context which global object will be used to call function on. Either\nexecutionContextId or objectId should be specified.",
-                            "optional": true,
-                            "$ref": "ExecutionContextId"
-                        },
-                        {
-                            "name": "objectGroup",
-                            "description": "Symbolic group name that can be used to release multiple objects. If objectGroup is not\nspecified and objectId is, objectGroup will be inherited from object.",
-                            "optional": true,
-                            "type": "string"
-                        }
-                    ],
-                    "returns": [
-                        {
-                            "name": "result",
-                            "description": "Call result.",
-                            "$ref": "RemoteObject"
-                        },
-                        {
-                            "name": "exceptionDetails",
-                            "description": "Exception details.",
-                            "optional": true,
-                            "$ref": "ExceptionDetails"
-                        }
-                    ]
-                },
-                {
-                    "name": "compileScript",
-                    "description": "Compiles expression.",
-                    "parameters": [
-                        {
-                            "name": "expression",
-                            "description": "Expression to compile.",
-                            "type": "string"
-                        },
-                        {
-                            "name": "sourceURL",
-                            "description": "Source url to be set for the script.",
-                            "type": "string"
-                        },
-                        {
-                            "name": "persistScript",
-                            "description": "Specifies whether the compiled script should be persisted.",
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "executionContextId",
-                            "description": "Specifies in which execution context to perform script run. If the parameter is omitted the\nevaluation will be performed in the context of the inspected page.",
-                            "optional": true,
-                            "$ref": "ExecutionContextId"
-                        }
-                    ],
-                    "returns": [
-                        {
-                            "name": "scriptId",
-                            "description": "Id of the script.",
-                            "optional": true,
-                            "$ref": "ScriptId"
-                        },
-                        {
-                            "name": "exceptionDetails",
-                            "description": "Exception details.",
-                            "optional": true,
-                            "$ref": "ExceptionDetails"
-                        }
-                    ]
-                },
-                {
-                    "name": "disable",
-                    "description": "Disables reporting of execution contexts creation."
-                },
-                {
-                    "name": "discardConsoleEntries",
-                    "description": "Discards collected exceptions and console API calls."
-                },
-                {
-                    "name": "enable",
-                    "description": "Enables reporting of execution contexts creation by means of `executionContextCreated` event.\nWhen the reporting gets enabled the event will be sent immediately for each existing execution\ncontext."
-                },
-                {
-                    "name": "evaluate",
-                    "description": "Evaluates expression on global object.",
-                    "parameters": [
-                        {
-                            "name": "expression",
-                            "description": "Expression to evaluate.",
-                            "type": "string"
-                        },
-                        {
-                            "name": "objectGroup",
-                            "description": "Symbolic group name that can be used to release multiple objects.",
-                            "optional": true,
-                            "type": "string"
-                        },
-                        {
-                            "name": "includeCommandLineAPI",
-                            "description": "Determines whether Command Line API should be available during the evaluation.",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "silent",
-                            "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause\nexecution. Overrides `setPauseOnException` state.",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "contextId",
-                            "description": "Specifies in which execution context to perform evaluation. If the parameter is omitted the\nevaluation will be performed in the context of the inspected page.",
-                            "optional": true,
-                            "$ref": "ExecutionContextId"
-                        },
-                        {
-                            "name": "returnByValue",
-                            "description": "Whether the result is expected to be a JSON object that should be sent by value.",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "generatePreview",
-                            "description": "Whether preview should be generated for the result.",
-                            "experimental": true,
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "userGesture",
-                            "description": "Whether execution should be treated as initiated by user in the UI.",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "awaitPromise",
-                            "description": "Whether execution should `await` for resulting value and return once awaited promise is\nresolved.",
-                            "optional": true,
-                            "type": "boolean"
-                        }
-                    ],
-                    "returns": [
-                        {
-                            "name": "result",
-                            "description": "Evaluation result.",
-                            "$ref": "RemoteObject"
-                        },
-                        {
-                            "name": "exceptionDetails",
-                            "description": "Exception details.",
-                            "optional": true,
-                            "$ref": "ExceptionDetails"
-                        }
-                    ]
-                },
-                {
-                    "name": "getProperties",
-                    "description": "Returns properties of a given object. Object group of the result is inherited from the target\nobject.",
-                    "parameters": [
-                        {
-                            "name": "objectId",
-                            "description": "Identifier of the object to return properties for.",
-                            "$ref": "RemoteObjectId"
-                        },
-                        {
-                            "name": "ownProperties",
-                            "description": "If true, returns properties belonging only to the element itself, not to its prototype\nchain.",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "accessorPropertiesOnly",
-                            "description": "If true, returns accessor properties (with getter/setter) only; internal properties are not\nreturned either.",
-                            "experimental": true,
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "generatePreview",
-                            "description": "Whether preview should be generated for the results.",
-                            "experimental": true,
-                            "optional": true,
-                            "type": "boolean"
-                        }
-                    ],
-                    "returns": [
-                        {
-                            "name": "result",
-                            "description": "Object properties.",
-                            "type": "array",
-                            "items": {
-                                "$ref": "PropertyDescriptor"
-                            }
-                        },
-                        {
-                            "name": "internalProperties",
-                            "description": "Internal object properties (only of the element itself).",
-                            "optional": true,
-                            "type": "array",
-                            "items": {
-                                "$ref": "InternalPropertyDescriptor"
-                            }
-                        },
-                        {
-                            "name": "exceptionDetails",
-                            "description": "Exception details.",
-                            "optional": true,
-                            "$ref": "ExceptionDetails"
-                        }
-                    ]
-                },
-                {
-                    "name": "globalLexicalScopeNames",
-                    "description": "Returns all let, const and class variables from global scope.",
-                    "parameters": [
-                        {
-                            "name": "executionContextId",
-                            "description": "Specifies in which execution context to lookup global scope variables.",
-                            "optional": true,
-                            "$ref": "ExecutionContextId"
-                        }
-                    ],
-                    "returns": [
-                        {
-                            "name": "names",
-                            "type": "array",
-                            "items": {
-                                "type": "string"
-                            }
-                        }
-                    ]
-                },
-                {
-                    "name": "queryObjects",
-                    "parameters": [
-                        {
-                            "name": "prototypeObjectId",
-                            "description": "Identifier of the prototype to return objects for.",
-                            "$ref": "RemoteObjectId"
-                        }
-                    ],
-                    "returns": [
-                        {
-                            "name": "objects",
-                            "description": "Array with objects.",
-                            "$ref": "RemoteObject"
-                        }
-                    ]
-                },
-                {
-                    "name": "releaseObject",
-                    "description": "Releases remote object with given id.",
-                    "parameters": [
-                        {
-                            "name": "objectId",
-                            "description": "Identifier of the object to release.",
-                            "$ref": "RemoteObjectId"
-                        }
-                    ]
-                },
-                {
-                    "name": "releaseObjectGroup",
-                    "description": "Releases all remote objects that belong to a given group.",
-                    "parameters": [
-                        {
-                            "name": "objectGroup",
-                            "description": "Symbolic object group name.",
-                            "type": "string"
-                        }
-                    ]
-                },
-                {
-                    "name": "runIfWaitingForDebugger",
-                    "description": "Tells inspected instance to run if it was waiting for debugger to attach."
-                },
-                {
-                    "name": "runScript",
-                    "description": "Runs script with given id in a given context.",
-                    "parameters": [
-                        {
-                            "name": "scriptId",
-                            "description": "Id of the script to run.",
-                            "$ref": "ScriptId"
-                        },
-                        {
-                            "name": "executionContextId",
-                            "description": "Specifies in which execution context to perform script run. If the parameter is omitted the\nevaluation will be performed in the context of the inspected page.",
-                            "optional": true,
-                            "$ref": "ExecutionContextId"
-                        },
-                        {
-                            "name": "objectGroup",
-                            "description": "Symbolic group name that can be used to release multiple objects.",
-                            "optional": true,
-                            "type": "string"
-                        },
-                        {
-                            "name": "silent",
-                            "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause\nexecution. Overrides `setPauseOnException` state.",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "includeCommandLineAPI",
-                            "description": "Determines whether Command Line API should be available during the evaluation.",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "returnByValue",
-                            "description": "Whether the result is expected to be a JSON object which should be sent by value.",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "generatePreview",
-                            "description": "Whether preview should be generated for the result.",
-                            "optional": true,
-                            "type": "boolean"
-                        },
-                        {
-                            "name": "awaitPromise",
-                            "description": "Whether execution should `await` for resulting value and return once awaited promise is\nresolved.",
-                            "optional": true,
-                            "type": "boolean"
-                        }
-                    ],
-                    "returns": [
-                        {
-                            "name": "result",
-                            "description": "Run result.",
-                            "$ref": "RemoteObject"
-                        },
-                        {
-                            "name": "exceptionDetails",
-                            "description": "Exception details.",
-                            "optional": true,
-                            "$ref": "ExceptionDetails"
-                        }
-                    ]
-                },
-                {
-                    "name": "setCustomObjectFormatterEnabled",
-                    "experimental": true,
-                    "parameters": [
-                        {
-                            "name": "enabled",
-                            "type": "boolean"
-                        }
-                    ]
-                }
-            ],
-            "events": [
-                {
-                    "name": "consoleAPICalled",
-                    "description": "Issued when console API was called.",
-                    "parameters": [
-                        {
-                            "name": "type",
-                            "description": "Type of the call.",
-                            "type": "string",
-                            "enum": [
-                                "log",
-                                "debug",
-                                "info",
-                                "error",
-                                "warning",
-                                "dir",
-                                "dirxml",
-                                "table",
-                                "trace",
-                                "clear",
-                                "startGroup",
-                                "startGroupCollapsed",
-                                "endGroup",
-                                "assert",
-                                "profile",
-                                "profileEnd",
-                                "count",
-                                "timeEnd"
-                            ]
-                        },
-                        {
-                            "name": "args",
-                            "description": "Call arguments.",
-                            "type": "array",
-                            "items": {
-                                "$ref": "RemoteObject"
-                            }
-                        },
-                        {
-                            "name": "executionContextId",
-                            "description": "Identifier of the context where the call was made.",
-                            "$ref": "ExecutionContextId"
-                        },
-                        {
-                            "name": "timestamp",
-                            "description": "Call timestamp.",
-                            "$ref": "Timestamp"
-                        },
-                        {
-                            "name": "stackTrace",
-                            "description": "Stack trace captured when the call was made.",
-                            "optional": true,
-                            "$ref": "StackTrace"
-                        },
-                        {
-                            "name": "context",
-                            "description": "Console context descriptor for calls on non-default console context (not console.*):\n'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call\non named context.",
-                            "experimental": true,
-                            "optional": true,
-                            "type": "string"
-                        }
-                    ]
-                },
-                {
-                    "name": "exceptionRevoked",
-                    "description": "Issued when unhandled exception was revoked.",
-                    "parameters": [
-                        {
-                            "name": "reason",
-                            "description": "Reason describing why exception was revoked.",
-                            "type": "string"
-                        },
-                        {
-                            "name": "exceptionId",
-                            "description": "The id of revoked exception, as reported in `exceptionThrown`.",
-                            "type": "integer"
-                        }
-                    ]
-                },
-                {
-                    "name": "exceptionThrown",
-                    "description": "Issued when exception was thrown and unhandled.",
-                    "parameters": [
-                        {
-                            "name": "timestamp",
-                            "description": "Timestamp of the exception.",
-                            "$ref": "Timestamp"
-                        },
-                        {
-                            "name": "exceptionDetails",
-                            "$ref": "ExceptionDetails"
-                        }
-                    ]
-                },
-                {
-                    "name": "executionContextCreated",
-                    "description": "Issued when new execution context is created.",
-                    "parameters": [
-                        {
-                            "name": "context",
-                            "description": "A newly created execution context.",
-                            "$ref": "ExecutionContextDescription"
-                        }
-                    ]
-                },
-                {
-                    "name": "executionContextDestroyed",
-                    "description": "Issued when execution context is destroyed.",
-                    "parameters": [
-                        {
-                            "name": "executionContextId",
-                            "description": "Id of the destroyed context",
-                            "$ref": "ExecutionContextId"
-                        }
-                    ]
-                },
-                {
-                    "name": "executionContextsCleared",
-                    "description": "Issued when all executionContexts were cleared in browser"
-                },
-                {
-                    "name": "inspectRequested",
-                    "description": "Issued when object should be inspected (for example, as a result of inspect() command line API\ncall).",
-                    "parameters": [
-                        {
-                            "name": "object",
-                            "$ref": "RemoteObject"
-                        },
-                        {
-                            "name": "hints",
-                            "type": "object"
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "domain": "Schema",
-            "description": "This domain is deprecated.",
-            "deprecated": true,
-            "types": [
-                {
-                    "id": "Domain",
-                    "description": "Description of the protocol domain.",
-                    "type": "object",
-                    "properties": [
-                        {
-                            "name": "name",
-                            "description": "Domain name.",
-                            "type": "string"
-                        },
-                        {
-                            "name": "version",
-                            "description": "Domain version.",
-                            "type": "string"
-                        }
-                    ]
-                }
-            ],
-            "commands": [
-                {
-                    "name": "getDomains",
-                    "description": "Returns supported domains.",
-                    "returns": [
-                        {
-                            "name": "domains",
-                            "description": "List of supported domains.",
-                            "type": "array",
-                            "items": {
-                                "$ref": "Domain"
-                            }
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}
\ No newline at end of file
diff --git a/src/v8/src/inspector/js_protocol.pdl b/src/v8/src/inspector/js_protocol.pdl
deleted file mode 100644
index 5a23199..0000000
--- a/src/v8/src/inspector/js_protocol.pdl
+++ /dev/null
@@ -1,1370 +0,0 @@
-# Copyright 2017 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.
-
-version
-  major 1
-  minor 3
-
-# This domain is deprecated - use Runtime or Log instead.
-deprecated domain Console
-  depends on Runtime
-
-  # Console message.
-  type ConsoleMessage extends object
-    properties
-      # Message source.
-      enum source
-        xml
-        javascript
-        network
-        console-api
-        storage
-        appcache
-        rendering
-        security
-        other
-        deprecation
-        worker
-      # Message severity.
-      enum level
-        log
-        warning
-        error
-        debug
-        info
-      # Message text.
-      string text
-      # URL of the message origin.
-      optional string url
-      # Line number in the resource that generated this message (1-based).
-      optional integer line
-      # Column number in the resource that generated this message (1-based).
-      optional integer column
-
-  # Does nothing.
-  command clearMessages
-
-  # Disables console domain, prevents further console messages from being reported to the client.
-  command disable
-
-  # Enables console domain, sends the messages collected so far to the client by means of the
-  # `messageAdded` notification.
-  command enable
-
-  # Issued when new console message is added.
-  event messageAdded
-    parameters
-      # Console message that has been added.
-      ConsoleMessage message
-
-# Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing
-# breakpoints, stepping through execution, exploring stack traces, etc.
-domain Debugger
-  depends on Runtime
-
-  # Breakpoint identifier.
-  type BreakpointId extends string
-
-  # Call frame identifier.
-  type CallFrameId extends string
-
-  # Location in the source code.
-  type Location extends object
-    properties
-      # Script identifier as reported in the `Debugger.scriptParsed`.
-      Runtime.ScriptId scriptId
-      # Line number in the script (0-based).
-      integer lineNumber
-      # Column number in the script (0-based).
-      optional integer columnNumber
-
-  # Location in the source code.
-  experimental type ScriptPosition extends object
-    properties
-      integer lineNumber
-      integer columnNumber
-
-  # JavaScript call frame. Array of call frames form the call stack.
-  type CallFrame extends object
-    properties
-      # Call frame identifier. This identifier is only valid while the virtual machine is paused.
-      CallFrameId callFrameId
-      # Name of the JavaScript function called on this call frame.
-      string functionName
-      # Location in the source code.
-      optional Location functionLocation
-      # Location in the source code.
-      Location location
-      # JavaScript script name or url.
-      string url
-      # Scope chain for this call frame.
-      array of Scope scopeChain
-      # `this` object for this call frame.
-      Runtime.RemoteObject this
-      # The value being returned, if the function is at return point.
-      optional Runtime.RemoteObject returnValue
-
-  # Scope description.
-  type Scope extends object
-    properties
-      # Scope type.
-      enum type
-        global
-        local
-        with
-        closure
-        catch
-        block
-        script
-        eval
-        module
-      # Object representing the scope. For `global` and `with` scopes it represents the actual
-      # object; for the rest of the scopes, it is artificial transient object enumerating scope
-      # variables as its properties.
-      Runtime.RemoteObject object
-      optional string name
-      # Location in the source code where scope starts
-      optional Location startLocation
-      # Location in the source code where scope ends
-      optional Location endLocation
-
-  # Search match for resource.
-  type SearchMatch extends object
-    properties
-      # Line number in resource content.
-      number lineNumber
-      # Line with match content.
-      string lineContent
-
-  type BreakLocation extends object
-    properties
-      # Script identifier as reported in the `Debugger.scriptParsed`.
-      Runtime.ScriptId scriptId
-      # Line number in the script (0-based).
-      integer lineNumber
-      # Column number in the script (0-based).
-      optional integer columnNumber
-      optional enum type
-        debuggerStatement
-        call
-        return
-
-  # Continues execution until specific location is reached.
-  command continueToLocation
-    parameters
-      # Location to continue to.
-      Location location
-      optional enum targetCallFrames
-        any
-        current
-
-  # Disables debugger for given page.
-  command disable
-
-  # Enables debugger for the given page. Clients should not assume that the debugging has been
-  # enabled until the result for this command is received.
-  command enable
-    returns
-      # Unique identifier of the debugger.
-      experimental Runtime.UniqueDebuggerId debuggerId
-
-  # Evaluates expression on a given call frame.
-  command evaluateOnCallFrame
-    parameters
-      # Call frame identifier to evaluate on.
-      CallFrameId callFrameId
-      # Expression to evaluate.
-      string expression
-      # String object group name to put result into (allows rapid releasing resulting object handles
-      # using `releaseObjectGroup`).
-      optional string objectGroup
-      # Specifies whether command line API should be available to the evaluated expression, defaults
-      # to false.
-      optional boolean includeCommandLineAPI
-      # In silent mode exceptions thrown during evaluation are not reported and do not pause
-      # execution. Overrides `setPauseOnException` state.
-      optional boolean silent
-      # Whether the result is expected to be a JSON object that should be sent by value.
-      optional boolean returnByValue
-      # Whether preview should be generated for the result.
-      experimental optional boolean generatePreview
-      # Whether to throw an exception if side effect cannot be ruled out during evaluation.
-      optional boolean throwOnSideEffect
-    returns
-      # Object wrapper for the evaluation result.
-      Runtime.RemoteObject result
-      # Exception details.
-      optional Runtime.ExceptionDetails exceptionDetails
-
-  # Returns possible locations for breakpoint. scriptId in start and end range locations should be
-  # the same.
-  command getPossibleBreakpoints
-    parameters
-      # Start of range to search possible breakpoint locations in.
-      Location start
-      # End of range to search possible breakpoint locations in (excluding). When not specified, end
-      # of scripts is used as end of range.
-      optional Location end
-      # Only consider locations which are in the same (non-nested) function as start.
-      optional boolean restrictToFunction
-    returns
-      # List of the possible breakpoint locations.
-      array of BreakLocation locations
-
-  # Returns source for the script with given id.
-  command getScriptSource
-    parameters
-      # Id of the script to get source for.
-      Runtime.ScriptId scriptId
-    returns
-      # Script source.
-      string scriptSource
-
-  # Returns stack trace with given `stackTraceId`.
-  experimental command getStackTrace
-    parameters
-      Runtime.StackTraceId stackTraceId
-    returns
-      Runtime.StackTrace stackTrace
-
-  # Stops on the next JavaScript statement.
-  command pause
-
-  experimental command pauseOnAsyncCall
-    parameters
-      # Debugger will pause when async call with given stack trace is started.
-      Runtime.StackTraceId parentStackTraceId
-
-  # Removes JavaScript breakpoint.
-  command removeBreakpoint
-    parameters
-      BreakpointId breakpointId
-
-  # Restarts particular call frame from the beginning.
-  command restartFrame
-    parameters
-      # Call frame identifier to evaluate on.
-      CallFrameId callFrameId
-    returns
-      # New stack trace.
-      array of CallFrame callFrames
-      # Async stack trace, if any.
-      optional Runtime.StackTrace asyncStackTrace
-      # Async stack trace, if any.
-      experimental optional Runtime.StackTraceId asyncStackTraceId
-
-  # Resumes JavaScript execution.
-  command resume
-
-  # This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and
-  # Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled
-  # before next pause. Returns success when async task is actually scheduled, returns error if no
-  # task were scheduled or another scheduleStepIntoAsync was called.
-  experimental command scheduleStepIntoAsync
-
-  # Searches for given string in script content.
-  command searchInContent
-    parameters
-      # Id of the script to search in.
-      Runtime.ScriptId scriptId
-      # String to search for.
-      string query
-      # If true, search is case sensitive.
-      optional boolean caseSensitive
-      # If true, treats string parameter as regex.
-      optional boolean isRegex
-    returns
-      # List of search matches.
-      array of SearchMatch result
-
-  # Enables or disables async call stacks tracking.
-  command setAsyncCallStackDepth
-    parameters
-      # Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async
-      # call stacks (default).
-      integer maxDepth
-
-  # Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in
-  # scripts with url matching one of the patterns. VM will try to leave blackboxed script by
-  # performing 'step in' several times, finally resorting to 'step out' if unsuccessful.
-  experimental command setBlackboxPatterns
-    parameters
-      # Array of regexps that will be used to check script url for blackbox state.
-      array of string patterns
-
-  # Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted
-  # scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful.
-  # Positions array contains positions where blackbox state is changed. First interval isn't
-  # blackboxed. Array should be sorted.
-  experimental command setBlackboxedRanges
-    parameters
-      # Id of the script.
-      Runtime.ScriptId scriptId
-      array of ScriptPosition positions
-
-  # Sets JavaScript breakpoint at a given location.
-  command setBreakpoint
-    parameters
-      # Location to set breakpoint in.
-      Location location
-      # Expression to use as a breakpoint condition. When specified, debugger will only stop on the
-      # breakpoint if this expression evaluates to true.
-      optional string condition
-    returns
-      # Id of the created breakpoint for further reference.
-      BreakpointId breakpointId
-      # Location this breakpoint resolved into.
-      Location actualLocation
-
-  # Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this
-  # command is issued, all existing parsed scripts will have breakpoints resolved and returned in
-  # `locations` property. Further matching script parsing will result in subsequent
-  # `breakpointResolved` events issued. This logical breakpoint will survive page reloads.
-  command setBreakpointByUrl
-    parameters
-      # Line number to set breakpoint at.
-      integer lineNumber
-      # URL of the resources to set breakpoint on.
-      optional string url
-      # Regex pattern for the URLs of the resources to set breakpoints on. Either `url` or
-      # `urlRegex` must be specified.
-      optional string urlRegex
-      # Script hash of the resources to set breakpoint on.
-      optional string scriptHash
-      # Offset in the line to set breakpoint at.
-      optional integer columnNumber
-      # Expression to use as a breakpoint condition. When specified, debugger will only stop on the
-      # breakpoint if this expression evaluates to true.
-      optional string condition
-    returns
-      # Id of the created breakpoint for further reference.
-      BreakpointId breakpointId
-      # List of the locations this breakpoint resolved into upon addition.
-      array of Location locations
-
-  # Activates / deactivates all breakpoints on the page.
-  command setBreakpointsActive
-    parameters
-      # New value for breakpoints active state.
-      boolean active
-
-  # Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or
-  # no exceptions. Initial pause on exceptions state is `none`.
-  command setPauseOnExceptions
-    parameters
-      # Pause on exceptions mode.
-      enum state
-        none
-        uncaught
-        all
-
-  # Changes return value in top frame. Available only at return break position.
-  experimental command setReturnValue
-    parameters
-      # New return value.
-      Runtime.CallArgument newValue
-
-  # Edits JavaScript source live.
-  command setScriptSource
-    parameters
-      # Id of the script to edit.
-      Runtime.ScriptId scriptId
-      # New content of the script.
-      string scriptSource
-      #  If true the change will not actually be applied. Dry run may be used to get result
-      # description without actually modifying the code.
-      optional boolean dryRun
-    returns
-      # New stack trace in case editing has happened while VM was stopped.
-      optional array of CallFrame callFrames
-      # Whether current call stack  was modified after applying the changes.
-      optional boolean stackChanged
-      # Async stack trace, if any.
-      optional Runtime.StackTrace asyncStackTrace
-      # Async stack trace, if any.
-      experimental optional Runtime.StackTraceId asyncStackTraceId
-      # Exception details if any.
-      optional Runtime.ExceptionDetails exceptionDetails
-
-  # Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).
-  command setSkipAllPauses
-    parameters
-      # New value for skip pauses state.
-      boolean skip
-
-  # Changes value of variable in a callframe. Object-based scopes are not supported and must be
-  # mutated manually.
-  command setVariableValue
-    parameters
-      # 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch'
-      # scope types are allowed. Other scopes could be manipulated manually.
-      integer scopeNumber
-      # Variable name.
-      string variableName
-      # New variable value.
-      Runtime.CallArgument newValue
-      # Id of callframe that holds variable.
-      CallFrameId callFrameId
-
-  # Steps into the function call.
-  command stepInto
-    parameters
-      # Debugger will issue additional Debugger.paused notification if any async task is scheduled
-      # before next pause.
-      experimental optional boolean breakOnAsyncCall
-
-  # Steps out of the function call.
-  command stepOut
-
-  # Steps over the statement.
-  command stepOver
-
-  # Fired when breakpoint is resolved to an actual script and location.
-  event breakpointResolved
-    parameters
-      # Breakpoint unique identifier.
-      BreakpointId breakpointId
-      # Actual breakpoint location.
-      Location location
-
-  # Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
-  event paused
-    parameters
-      # Call stack the virtual machine stopped on.
-      array of CallFrame callFrames
-      # Pause reason.
-      enum reason
-        XHR
-        DOM
-        EventListener
-        exception
-        assert
-        debugCommand
-        promiseRejection
-        OOM
-        other
-        ambiguous
-      # Object containing break-specific auxiliary properties.
-      optional object data
-      # Hit breakpoints IDs
-      optional array of string hitBreakpoints
-      # Async stack trace, if any.
-      optional Runtime.StackTrace asyncStackTrace
-      # Async stack trace, if any.
-      experimental optional Runtime.StackTraceId asyncStackTraceId
-      # Just scheduled async call will have this stack trace as parent stack during async execution.
-      # This field is available only after `Debugger.stepInto` call with `breakOnAsynCall` flag.
-      experimental optional Runtime.StackTraceId asyncCallStackTraceId
-
-  # Fired when the virtual machine resumed execution.
-  event resumed
-
-  # Fired when virtual machine fails to parse the script.
-  event scriptFailedToParse
-    parameters
-      # Identifier of the script parsed.
-      Runtime.ScriptId scriptId
-      # URL or name of the script parsed (if any).
-      string url
-      # Line offset of the script within the resource with given URL (for script tags).
-      integer startLine
-      # Column offset of the script within the resource with given URL.
-      integer startColumn
-      # Last line of the script.
-      integer endLine
-      # Length of the last line of the script.
-      integer endColumn
-      # Specifies script creation context.
-      Runtime.ExecutionContextId executionContextId
-      # Content hash of the script.
-      string hash
-      # Embedder-specific auxiliary data.
-      optional object executionContextAuxData
-      # URL of source map associated with script (if any).
-      optional string sourceMapURL
-      # True, if this script has sourceURL.
-      optional boolean hasSourceURL
-      # True, if this script is ES6 module.
-      optional boolean isModule
-      # This script length.
-      optional integer length
-      # JavaScript top stack frame of where the script parsed event was triggered if available.
-      experimental optional Runtime.StackTrace stackTrace
-
-  # Fired when virtual machine parses script. This event is also fired for all known and uncollected
-  # scripts upon enabling debugger.
-  event scriptParsed
-    parameters
-      # Identifier of the script parsed.
-      Runtime.ScriptId scriptId
-      # URL or name of the script parsed (if any).
-      string url
-      # Line offset of the script within the resource with given URL (for script tags).
-      integer startLine
-      # Column offset of the script within the resource with given URL.
-      integer startColumn
-      # Last line of the script.
-      integer endLine
-      # Length of the last line of the script.
-      integer endColumn
-      # Specifies script creation context.
-      Runtime.ExecutionContextId executionContextId
-      # Content hash of the script.
-      string hash
-      # Embedder-specific auxiliary data.
-      optional object executionContextAuxData
-      # True, if this script is generated as a result of the live edit operation.
-      experimental optional boolean isLiveEdit
-      # URL of source map associated with script (if any).
-      optional string sourceMapURL
-      # True, if this script has sourceURL.
-      optional boolean hasSourceURL
-      # True, if this script is ES6 module.
-      optional boolean isModule
-      # This script length.
-      optional integer length
-      # JavaScript top stack frame of where the script parsed event was triggered if available.
-      experimental optional Runtime.StackTrace stackTrace
-
-experimental domain HeapProfiler
-  depends on Runtime
-
-  # Heap snapshot object id.
-  type HeapSnapshotObjectId extends string
-
-  # Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes.
-  type SamplingHeapProfileNode extends object
-    properties
-      # Function location.
-      Runtime.CallFrame callFrame
-      # Allocations size in bytes for the node excluding children.
-      number selfSize
-      # Child nodes.
-      array of SamplingHeapProfileNode children
-
-  # Profile.
-  type SamplingHeapProfile extends object
-    properties
-      SamplingHeapProfileNode head
-
-  # Enables console to refer to the node with given id via $x (see Command Line API for more details
-  # $x functions).
-  command addInspectedHeapObject
-    parameters
-      # Heap snapshot object id to be accessible by means of $x command line API.
-      HeapSnapshotObjectId heapObjectId
-
-  command collectGarbage
-
-  command disable
-
-  command enable
-
-  command getHeapObjectId
-    parameters
-      # Identifier of the object to get heap object id for.
-      Runtime.RemoteObjectId objectId
-    returns
-      # Id of the heap snapshot object corresponding to the passed remote object id.
-      HeapSnapshotObjectId heapSnapshotObjectId
-
-  command getObjectByHeapObjectId
-    parameters
-      HeapSnapshotObjectId objectId
-      # Symbolic group name that can be used to release multiple objects.
-      optional string objectGroup
-    returns
-      # Evaluation result.
-      Runtime.RemoteObject result
-
-  command getSamplingProfile
-    returns
-      # Return the sampling profile being collected.
-      SamplingHeapProfile profile
-
-  command startSampling
-    parameters
-      # Average sample interval in bytes. Poisson distribution is used for the intervals. The
-      # default value is 32768 bytes.
-      optional number samplingInterval
-
-  command startTrackingHeapObjects
-    parameters
-      optional boolean trackAllocations
-
-  command stopSampling
-    returns
-      # Recorded sampling heap profile.
-      SamplingHeapProfile profile
-
-  command stopTrackingHeapObjects
-    parameters
-      # If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken
-      # when the tracking is stopped.
-      optional boolean reportProgress
-
-  command takeHeapSnapshot
-    parameters
-      # If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken.
-      optional boolean reportProgress
-
-  event addHeapSnapshotChunk
-    parameters
-      string chunk
-
-  # If heap objects tracking has been started then backend may send update for one or more fragments
-  event heapStatsUpdate
-    parameters
-      # An array of triplets. Each triplet describes a fragment. The first integer is the fragment
-      # index, the second integer is a total count of objects for the fragment, the third integer is
-      # a total size of the objects for the fragment.
-      array of integer statsUpdate
-
-  # If heap objects tracking has been started then backend regularly sends a current value for last
-  # seen object id and corresponding timestamp. If the were changes in the heap since last event
-  # then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
-  event lastSeenObjectId
-    parameters
-      integer lastSeenObjectId
-      number timestamp
-
-  event reportHeapSnapshotProgress
-    parameters
-      integer done
-      integer total
-      optional boolean finished
-
-  event resetProfiles
-
-domain Profiler
-  depends on Runtime
-  depends on Debugger
-
-  # Profile node. Holds callsite information, execution statistics and child nodes.
-  type ProfileNode extends object
-    properties
-      # Unique id of the node.
-      integer id
-      # Function location.
-      Runtime.CallFrame callFrame
-      # Number of samples where this node was on top of the call stack.
-      optional integer hitCount
-      # Child node ids.
-      optional array of integer children
-      # The reason of being not optimized. The function may be deoptimized or marked as don't
-      # optimize.
-      optional string deoptReason
-      # An array of source position ticks.
-      optional array of PositionTickInfo positionTicks
-
-  # Profile.
-  type Profile extends object
-    properties
-      # The list of profile nodes. First item is the root node.
-      array of ProfileNode nodes
-      # Profiling start timestamp in microseconds.
-      number startTime
-      # Profiling end timestamp in microseconds.
-      number endTime
-      # Ids of samples top nodes.
-      optional array of integer samples
-      # Time intervals between adjacent samples in microseconds. The first delta is relative to the
-      # profile startTime.
-      optional array of integer timeDeltas
-
-  # Specifies a number of samples attributed to a certain source position.
-  type PositionTickInfo extends object
-    properties
-      # Source line number (1-based).
-      integer line
-      # Number of samples attributed to the source line.
-      integer ticks
-
-  # Coverage data for a source range.
-  type CoverageRange extends object
-    properties
-      # JavaScript script source offset for the range start.
-      integer startOffset
-      # JavaScript script source offset for the range end.
-      integer endOffset
-      # Collected execution count of the source range.
-      integer count
-
-  # Coverage data for a JavaScript function.
-  type FunctionCoverage extends object
-    properties
-      # JavaScript function name.
-      string functionName
-      # Source ranges inside the function with coverage data.
-      array of CoverageRange ranges
-      # Whether coverage data for this function has block granularity.
-      boolean isBlockCoverage
-
-  # Coverage data for a JavaScript script.
-  type ScriptCoverage extends object
-    properties
-      # JavaScript script id.
-      Runtime.ScriptId scriptId
-      # JavaScript script name or url.
-      string url
-      # Functions contained in the script that has coverage data.
-      array of FunctionCoverage functions
-
-  # Describes a type collected during runtime.
-  experimental type TypeObject extends object
-    properties
-      # Name of a type collected with type profiling.
-      string name
-
-  # Source offset and types for a parameter or return value.
-  experimental type TypeProfileEntry extends object
-    properties
-      # Source offset of the parameter or end of function for return values.
-      integer offset
-      # The types for this parameter or return value.
-      array of TypeObject types
-
-  # Type profile data collected during runtime for a JavaScript script.
-  experimental type ScriptTypeProfile extends object
-    properties
-      # JavaScript script id.
-      Runtime.ScriptId scriptId
-      # JavaScript script name or url.
-      string url
-      # Type profile entries for parameters and return values of the functions in the script.
-      array of TypeProfileEntry entries
-
-  command disable
-
-  command enable
-
-  # Collect coverage data for the current isolate. The coverage data may be incomplete due to
-  # garbage collection.
-  command getBestEffortCoverage
-    returns
-      # Coverage data for the current isolate.
-      array of ScriptCoverage result
-
-  # Changes CPU profiler sampling interval. Must be called before CPU profiles recording started.
-  command setSamplingInterval
-    parameters
-      # New sampling interval in microseconds.
-      integer interval
-
-  command start
-
-  # Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code
-  # coverage may be incomplete. Enabling prevents running optimized code and resets execution
-  # counters.
-  command startPreciseCoverage
-    parameters
-      # Collect accurate call counts beyond simple 'covered' or 'not covered'.
-      optional boolean callCount
-      # Collect block-based coverage.
-      optional boolean detailed
-
-  # Enable type profile.
-  experimental command startTypeProfile
-
-  command stop
-    returns
-      # Recorded profile.
-      Profile profile
-
-  # Disable precise code coverage. Disabling releases unnecessary execution count records and allows
-  # executing optimized code.
-  command stopPreciseCoverage
-
-  # Disable type profile. Disabling releases type profile data collected so far.
-  experimental command stopTypeProfile
-
-  # Collect coverage data for the current isolate, and resets execution counters. Precise code
-  # coverage needs to have started.
-  command takePreciseCoverage
-    returns
-      # Coverage data for the current isolate.
-      array of ScriptCoverage result
-
-  # Collect type profile.
-  experimental command takeTypeProfile
-    returns
-      # Type profile for all scripts since startTypeProfile() was turned on.
-      array of ScriptTypeProfile result
-
-  event consoleProfileFinished
-    parameters
-      string id
-      # Location of console.profileEnd().
-      Debugger.Location location
-      Profile profile
-      # Profile title passed as an argument to console.profile().
-      optional string title
-
-  # Sent when new profile recording is started using console.profile() call.
-  event consoleProfileStarted
-    parameters
-      string id
-      # Location of console.profile().
-      Debugger.Location location
-      # Profile title passed as an argument to console.profile().
-      optional string title
-
-# Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects.
-# Evaluation results are returned as mirror object that expose object type, string representation
-# and unique identifier that can be used for further object reference. Original objects are
-# maintained in memory unless they are either explicitly released or are released along with the
-# other objects in their object group.
-domain Runtime
-
-  # Unique script identifier.
-  type ScriptId extends string
-
-  # Unique object identifier.
-  type RemoteObjectId extends string
-
-  # Primitive value which cannot be JSON-stringified.
-  type UnserializableValue extends string
-    enum
-      Infinity
-      NaN
-      -Infinity
-      -0
-
-  # Mirror object referencing original JavaScript object.
-  type RemoteObject extends object
-    properties
-      # Object type.
-      enum type
-        object
-        function
-        undefined
-        string
-        number
-        boolean
-        symbol
-      # Object subtype hint. Specified for `object` type values only.
-      optional enum subtype
-        array
-        null
-        node
-        regexp
-        date
-        map
-        set
-        weakmap
-        weakset
-        iterator
-        generator
-        error
-        proxy
-        promise
-        typedarray
-      # Object class (constructor) name. Specified for `object` type values only.
-      optional string className
-      # Remote object value in case of primitive values or JSON values (if it was requested).
-      optional any value
-      # Primitive value which can not be JSON-stringified does not have `value`, but gets this
-      # property.
-      optional UnserializableValue unserializableValue
-      # String representation of the object.
-      optional string description
-      # Unique object identifier (for non-primitive values).
-      optional RemoteObjectId objectId
-      # Preview containing abbreviated property values. Specified for `object` type values only.
-      experimental optional ObjectPreview preview
-      experimental optional CustomPreview customPreview
-
-  experimental type CustomPreview extends object
-    properties
-      string header
-      boolean hasBody
-      RemoteObjectId formatterObjectId
-      RemoteObjectId bindRemoteObjectFunctionId
-      optional RemoteObjectId configObjectId
-
-  # Object containing abbreviated remote object value.
-  experimental type ObjectPreview extends object
-    properties
-      # Object type.
-      enum type
-        object
-        function
-        undefined
-        string
-        number
-        boolean
-        symbol
-      # Object subtype hint. Specified for `object` type values only.
-      optional enum subtype
-        array
-        null
-        node
-        regexp
-        date
-        map
-        set
-        weakmap
-        weakset
-        iterator
-        generator
-        error
-      # String representation of the object.
-      optional string description
-      # True iff some of the properties or entries of the original object did not fit.
-      boolean overflow
-      # List of the properties.
-      array of PropertyPreview properties
-      # List of the entries. Specified for `map` and `set` subtype values only.
-      optional array of EntryPreview entries
-
-  experimental type PropertyPreview extends object
-    properties
-      # Property name.
-      string name
-      # Object type. Accessor means that the property itself is an accessor property.
-      enum type
-        object
-        function
-        undefined
-        string
-        number
-        boolean
-        symbol
-        accessor
-      # User-friendly property value string.
-      optional string value
-      # Nested value preview.
-      optional ObjectPreview valuePreview
-      # Object subtype hint. Specified for `object` type values only.
-      optional enum subtype
-        array
-        null
-        node
-        regexp
-        date
-        map
-        set
-        weakmap
-        weakset
-        iterator
-        generator
-        error
-
-  experimental type EntryPreview extends object
-    properties
-      # Preview of the key. Specified for map-like collection entries.
-      optional ObjectPreview key
-      # Preview of the value.
-      ObjectPreview value
-
-  # Object property descriptor.
-  type PropertyDescriptor extends object
-    properties
-      # Property name or symbol description.
-      string name
-      # The value associated with the property.
-      optional RemoteObject value
-      # True if the value associated with the property may be changed (data descriptors only).
-      optional boolean writable
-      # A function which serves as a getter for the property, or `undefined` if there is no getter
-      # (accessor descriptors only).
-      optional RemoteObject get
-      # A function which serves as a setter for the property, or `undefined` if there is no setter
-      # (accessor descriptors only).
-      optional RemoteObject set
-      # True if the type of this property descriptor may be changed and if the property may be
-      # deleted from the corresponding object.
-      boolean configurable
-      # True if this property shows up during enumeration of the properties on the corresponding
-      # object.
-      boolean enumerable
-      # True if the result was thrown during the evaluation.
-      optional boolean wasThrown
-      # True if the property is owned for the object.
-      optional boolean isOwn
-      # Property symbol object, if the property is of the `symbol` type.
-      optional RemoteObject symbol
-
-  # Object internal property descriptor. This property isn't normally visible in JavaScript code.
-  type InternalPropertyDescriptor extends object
-    properties
-      # Conventional property name.
-      string name
-      # The value associated with the property.
-      optional RemoteObject value
-
-  # Represents function call argument. Either remote object id `objectId`, primitive `value`,
-  # unserializable primitive value or neither of (for undefined) them should be specified.
-  type CallArgument extends object
-    properties
-      # Primitive value or serializable javascript object.
-      optional any value
-      # Primitive value which can not be JSON-stringified.
-      optional UnserializableValue unserializableValue
-      # Remote object handle.
-      optional RemoteObjectId objectId
-
-  # Id of an execution context.
-  type ExecutionContextId extends integer
-
-  # Description of an isolated world.
-  type ExecutionContextDescription extends object
-    properties
-      # Unique id of the execution context. It can be used to specify in which execution context
-      # script evaluation should be performed.
-      ExecutionContextId id
-      # Execution context origin.
-      string origin
-      # Human readable name describing given context.
-      string name
-      # Embedder-specific auxiliary data.
-      optional object auxData
-
-  # Detailed information about exception (or error) that was thrown during script compilation or
-  # execution.
-  type ExceptionDetails extends object
-    properties
-      # Exception id.
-      integer exceptionId
-      # Exception text, which should be used together with exception object when available.
-      string text
-      # Line number of the exception location (0-based).
-      integer lineNumber
-      # Column number of the exception location (0-based).
-      integer columnNumber
-      # Script ID of the exception location.
-      optional ScriptId scriptId
-      # URL of the exception location, to be used when the script was not reported.
-      optional string url
-      # JavaScript stack trace if available.
-      optional StackTrace stackTrace
-      # Exception object if available.
-      optional RemoteObject exception
-      # Identifier of the context where exception happened.
-      optional ExecutionContextId executionContextId
-
-  # Number of milliseconds since epoch.
-  type Timestamp extends number
-
-  # Stack entry for runtime errors and assertions.
-  type CallFrame extends object
-    properties
-      # JavaScript function name.
-      string functionName
-      # JavaScript script id.
-      ScriptId scriptId
-      # JavaScript script name or url.
-      string url
-      # JavaScript script line number (0-based).
-      integer lineNumber
-      # JavaScript script column number (0-based).
-      integer columnNumber
-
-  # Call frames for assertions or error messages.
-  type StackTrace extends object
-    properties
-      # String label of this stack trace. For async traces this may be a name of the function that
-      # initiated the async call.
-      optional string description
-      # JavaScript function name.
-      array of CallFrame callFrames
-      # Asynchronous JavaScript stack trace that preceded this stack, if available.
-      optional StackTrace parent
-      # Asynchronous JavaScript stack trace that preceded this stack, if available.
-      experimental optional StackTraceId parentId
-
-  # Unique identifier of current debugger.
-  experimental type UniqueDebuggerId extends string
-
-  # If `debuggerId` is set stack trace comes from another debugger and can be resolved there. This
-  # allows to track cross-debugger calls. See `Runtime.StackTrace` and `Debugger.paused` for usages.
-  experimental type StackTraceId extends object
-    properties
-      string id
-      optional UniqueDebuggerId debuggerId
-
-  # Add handler to promise with given promise object id.
-  command awaitPromise
-    parameters
-      # Identifier of the promise.
-      RemoteObjectId promiseObjectId
-      # Whether the result is expected to be a JSON object that should be sent by value.
-      optional boolean returnByValue
-      # Whether preview should be generated for the result.
-      optional boolean generatePreview
-    returns
-      # Promise result. Will contain rejected value if promise was rejected.
-      RemoteObject result
-      # Exception details if stack strace is available.
-      optional ExceptionDetails exceptionDetails
-
-  # Calls function with given declaration on the given object. Object group of the result is
-  # inherited from the target object.
-  command callFunctionOn
-    parameters
-      # Declaration of the function to call.
-      string functionDeclaration
-      # Identifier of the object to call function on. Either objectId or executionContextId should
-      # be specified.
-      optional RemoteObjectId objectId
-      # Call arguments. All call arguments must belong to the same JavaScript world as the target
-      # object.
-      optional array of CallArgument arguments
-      # In silent mode exceptions thrown during evaluation are not reported and do not pause
-      # execution. Overrides `setPauseOnException` state.
-      optional boolean silent
-      # Whether the result is expected to be a JSON object which should be sent by value.
-      optional boolean returnByValue
-      # Whether preview should be generated for the result.
-      experimental optional boolean generatePreview
-      # Whether execution should be treated as initiated by user in the UI.
-      optional boolean userGesture
-      # Whether execution should `await` for resulting value and return once awaited promise is
-      # resolved.
-      optional boolean awaitPromise
-      # Specifies execution context which global object will be used to call function on. Either
-      # executionContextId or objectId should be specified.
-      optional ExecutionContextId executionContextId
-      # Symbolic group name that can be used to release multiple objects. If objectGroup is not
-      # specified and objectId is, objectGroup will be inherited from object.
-      optional string objectGroup
-    returns
-      # Call result.
-      RemoteObject result
-      # Exception details.
-      optional ExceptionDetails exceptionDetails
-
-  # Compiles expression.
-  command compileScript
-    parameters
-      # Expression to compile.
-      string expression
-      # Source url to be set for the script.
-      string sourceURL
-      # Specifies whether the compiled script should be persisted.
-      boolean persistScript
-      # Specifies in which execution context to perform script run. If the parameter is omitted the
-      # evaluation will be performed in the context of the inspected page.
-      optional ExecutionContextId executionContextId
-    returns
-      # Id of the script.
-      optional ScriptId scriptId
-      # Exception details.
-      optional ExceptionDetails exceptionDetails
-
-  # Disables reporting of execution contexts creation.
-  command disable
-
-  # Discards collected exceptions and console API calls.
-  command discardConsoleEntries
-
-  # Enables reporting of execution contexts creation by means of `executionContextCreated` event.
-  # When the reporting gets enabled the event will be sent immediately for each existing execution
-  # context.
-  command enable
-
-  # Evaluates expression on global object.
-  command evaluate
-    parameters
-      # Expression to evaluate.
-      string expression
-      # Symbolic group name that can be used to release multiple objects.
-      optional string objectGroup
-      # Determines whether Command Line API should be available during the evaluation.
-      optional boolean includeCommandLineAPI
-      # In silent mode exceptions thrown during evaluation are not reported and do not pause
-      # execution. Overrides `setPauseOnException` state.
-      optional boolean silent
-      # Specifies in which execution context to perform evaluation. If the parameter is omitted the
-      # evaluation will be performed in the context of the inspected page.
-      optional ExecutionContextId contextId
-      # Whether the result is expected to be a JSON object that should be sent by value.
-      optional boolean returnByValue
-      # Whether preview should be generated for the result.
-      experimental optional boolean generatePreview
-      # Whether execution should be treated as initiated by user in the UI.
-      optional boolean userGesture
-      # Whether execution should `await` for resulting value and return once awaited promise is
-      # resolved.
-      optional boolean awaitPromise
-    returns
-      # Evaluation result.
-      RemoteObject result
-      # Exception details.
-      optional ExceptionDetails exceptionDetails
-
-  # Returns properties of a given object. Object group of the result is inherited from the target
-  # object.
-  command getProperties
-    parameters
-      # Identifier of the object to return properties for.
-      RemoteObjectId objectId
-      # If true, returns properties belonging only to the element itself, not to its prototype
-      # chain.
-      optional boolean ownProperties
-      # If true, returns accessor properties (with getter/setter) only; internal properties are not
-      # returned either.
-      experimental optional boolean accessorPropertiesOnly
-      # Whether preview should be generated for the results.
-      experimental optional boolean generatePreview
-    returns
-      # Object properties.
-      array of PropertyDescriptor result
-      # Internal object properties (only of the element itself).
-      optional array of InternalPropertyDescriptor internalProperties
-      # Exception details.
-      optional ExceptionDetails exceptionDetails
-
-  # Returns all let, const and class variables from global scope.
-  command globalLexicalScopeNames
-    parameters
-      # Specifies in which execution context to lookup global scope variables.
-      optional ExecutionContextId executionContextId
-    returns
-      array of string names
-
-  command queryObjects
-    parameters
-      # Identifier of the prototype to return objects for.
-      RemoteObjectId prototypeObjectId
-    returns
-      # Array with objects.
-      RemoteObject objects
-
-  # Releases remote object with given id.
-  command releaseObject
-    parameters
-      # Identifier of the object to release.
-      RemoteObjectId objectId
-
-  # Releases all remote objects that belong to a given group.
-  command releaseObjectGroup
-    parameters
-      # Symbolic object group name.
-      string objectGroup
-
-  # Tells inspected instance to run if it was waiting for debugger to attach.
-  command runIfWaitingForDebugger
-
-  # Runs script with given id in a given context.
-  command runScript
-    parameters
-      # Id of the script to run.
-      ScriptId scriptId
-      # Specifies in which execution context to perform script run. If the parameter is omitted the
-      # evaluation will be performed in the context of the inspected page.
-      optional ExecutionContextId executionContextId
-      # Symbolic group name that can be used to release multiple objects.
-      optional string objectGroup
-      # In silent mode exceptions thrown during evaluation are not reported and do not pause
-      # execution. Overrides `setPauseOnException` state.
-      optional boolean silent
-      # Determines whether Command Line API should be available during the evaluation.
-      optional boolean includeCommandLineAPI
-      # Whether the result is expected to be a JSON object which should be sent by value.
-      optional boolean returnByValue
-      # Whether preview should be generated for the result.
-      optional boolean generatePreview
-      # Whether execution should `await` for resulting value and return once awaited promise is
-      # resolved.
-      optional boolean awaitPromise
-    returns
-      # Run result.
-      RemoteObject result
-      # Exception details.
-      optional ExceptionDetails exceptionDetails
-
-  experimental command setCustomObjectFormatterEnabled
-    parameters
-      boolean enabled
-
-  # Issued when console API was called.
-  event consoleAPICalled
-    parameters
-      # Type of the call.
-      enum type
-        log
-        debug
-        info
-        error
-        warning
-        dir
-        dirxml
-        table
-        trace
-        clear
-        startGroup
-        startGroupCollapsed
-        endGroup
-        assert
-        profile
-        profileEnd
-        count
-        timeEnd
-      # Call arguments.
-      array of RemoteObject args
-      # Identifier of the context where the call was made.
-      ExecutionContextId executionContextId
-      # Call timestamp.
-      Timestamp timestamp
-      # Stack trace captured when the call was made.
-      optional StackTrace stackTrace
-      # Console context descriptor for calls on non-default console context (not console.*):
-      # 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call
-      # on named context.
-      experimental optional string context
-
-  # Issued when unhandled exception was revoked.
-  event exceptionRevoked
-    parameters
-      # Reason describing why exception was revoked.
-      string reason
-      # The id of revoked exception, as reported in `exceptionThrown`.
-      integer exceptionId
-
-  # Issued when exception was thrown and unhandled.
-  event exceptionThrown
-    parameters
-      # Timestamp of the exception.
-      Timestamp timestamp
-      ExceptionDetails exceptionDetails
-
-  # Issued when new execution context is created.
-  event executionContextCreated
-    parameters
-      # A newly created execution context.
-      ExecutionContextDescription context
-
-  # Issued when execution context is destroyed.
-  event executionContextDestroyed
-    parameters
-      # Id of the destroyed context
-      ExecutionContextId executionContextId
-
-  # Issued when all executionContexts were cleared in browser
-  event executionContextsCleared
-
-  # Issued when object should be inspected (for example, as a result of inspect() command line API
-  # call).
-  event inspectRequested
-    parameters
-      RemoteObject object
-      object hints
-
-# This domain is deprecated.
-deprecated domain Schema
-
-  # Description of the protocol domain.
-  type Domain extends object
-    properties
-      # Domain name.
-      string name
-      # Domain version.
-      string version
-
-  # Returns supported domains.
-  command getDomains
-    returns
-      # List of supported domains.
-      array of Domain domains
diff --git a/src/v8/src/inspector/v8-function-call.cc b/src/v8/src/inspector/v8-function-call.cc
deleted file mode 100644
index ebeb7a3..0000000
--- a/src/v8/src/inspector/v8-function-call.cc
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc. 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.
- */
-
-#include "src/inspector/v8-function-call.h"
-
-#include "src/inspector/inspected-context.h"
-#include "src/inspector/string-util.h"
-#include "src/inspector/v8-debugger.h"
-#include "src/inspector/v8-inspector-impl.h"
-
-#include "include/v8-inspector.h"
-
-namespace v8_inspector {
-
-V8FunctionCall::V8FunctionCall(V8InspectorImpl* inspector,
-                               v8::Local<v8::Context> context,
-                               v8::Local<v8::Value> value, const String16& name)
-    : m_inspector(inspector),
-      m_context(context),
-      m_name(toV8String(context->GetIsolate(), name)),
-      m_value(value) {}
-
-void V8FunctionCall::appendArgument(v8::Local<v8::Value> value) {
-  m_arguments.push_back(value);
-}
-
-void V8FunctionCall::appendArgument(const String16& argument) {
-  m_arguments.push_back(toV8String(m_context->GetIsolate(), argument));
-}
-
-void V8FunctionCall::appendArgument(int argument) {
-  m_arguments.push_back(v8::Number::New(m_context->GetIsolate(), argument));
-}
-
-void V8FunctionCall::appendArgument(bool argument) {
-  m_arguments.push_back(argument ? v8::True(m_context->GetIsolate())
-                                 : v8::False(m_context->GetIsolate()));
-}
-
-v8::Local<v8::Value> V8FunctionCall::call(bool& hadException,
-                                          bool reportExceptions) {
-  v8::TryCatch tryCatch(m_context->GetIsolate());
-  tryCatch.SetVerbose(reportExceptions);
-
-  v8::Local<v8::Value> result = callWithoutExceptionHandling();
-  hadException = tryCatch.HasCaught();
-  return result;
-}
-
-v8::Local<v8::Value> V8FunctionCall::callWithoutExceptionHandling() {
-  v8::Context::Scope contextScope(m_context);
-
-  v8::Local<v8::Object> thisObject = v8::Local<v8::Object>::Cast(m_value);
-  v8::Local<v8::Value> value;
-  if (!thisObject->Get(m_context, m_name).ToLocal(&value))
-    return v8::Local<v8::Value>();
-
-  DCHECK(value->IsFunction());
-
-  v8::Local<v8::Function> function = v8::Local<v8::Function>::Cast(value);
-  std::unique_ptr<v8::Local<v8::Value>[]> info(
-      new v8::Local<v8::Value>[m_arguments.size()]);
-  for (size_t i = 0; i < m_arguments.size(); ++i) {
-    info[i] = m_arguments[i];
-    DCHECK(!info[i].IsEmpty());
-  }
-
-  int contextGroupId = m_inspector->contextGroupId(m_context);
-  if (contextGroupId) {
-    m_inspector->client()->muteMetrics(contextGroupId);
-    m_inspector->muteExceptions(contextGroupId);
-  }
-  v8::MicrotasksScope microtasksScope(m_context->GetIsolate(),
-                                      v8::MicrotasksScope::kDoNotRunMicrotasks);
-  v8::Isolate::AllowJavascriptExecutionScope(m_context->GetIsolate());
-  v8::MaybeLocal<v8::Value> maybeResult = function->Call(
-      m_context, thisObject, static_cast<int>(m_arguments.size()), info.get());
-  if (contextGroupId) {
-    m_inspector->client()->unmuteMetrics(contextGroupId);
-    m_inspector->unmuteExceptions(contextGroupId);
-  }
-
-  v8::Local<v8::Value> result;
-  if (!maybeResult.ToLocal(&result)) return v8::Local<v8::Value>();
-  return result;
-}
-
-}  // namespace v8_inspector
diff --git a/src/v8/src/inspector/v8-function-call.h b/src/v8/src/inspector/v8-function-call.h
deleted file mode 100644
index 0337caa..0000000
--- a/src/v8/src/inspector/v8-function-call.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc. 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.
- */
-
-#ifndef V8_INSPECTOR_V8FUNCTIONCALL_H_
-#define V8_INSPECTOR_V8FUNCTIONCALL_H_
-
-#include "src/inspector/string-16.h"
-
-#include "include/v8.h"
-
-namespace v8_inspector {
-
-class V8InspectorImpl;
-
-class V8FunctionCall {
- public:
-  V8FunctionCall(V8InspectorImpl*, v8::Local<v8::Context>, v8::Local<v8::Value>,
-                 const String16& name);
-
-  void appendArgument(v8::Local<v8::Value>);
-  void appendArgument(const String16&);
-  void appendArgument(int);
-  void appendArgument(bool);
-
-  v8::Local<v8::Value> call(bool& hadException, bool reportExceptions = true);
-  v8::Local<v8::Value> callWithoutExceptionHandling();
-
- protected:
-  V8InspectorImpl* m_inspector;
-  v8::Local<v8::Context> m_context;
-  std::vector<v8::Local<v8::Value>> m_arguments;
-  v8::Local<v8::String> m_name;
-  v8::Local<v8::Value> m_value;
-};
-
-}  // namespace v8_inspector
-
-#endif  // V8_INSPECTOR_V8FUNCTIONCALL_H_
diff --git a/src/v8/src/inspector/v8-injected-script-host.cc b/src/v8/src/inspector/v8-injected-script-host.cc
deleted file mode 100644
index 1455cf6..0000000
--- a/src/v8/src/inspector/v8-injected-script-host.cc
+++ /dev/null
@@ -1,425 +0,0 @@
-// Copyright 2015 the V8 project 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 "src/inspector/v8-injected-script-host.h"
-
-#include "src/base/macros.h"
-#include "src/debug/debug-interface.h"
-#include "src/inspector/injected-script.h"
-#include "src/inspector/string-util.h"
-#include "src/inspector/v8-debugger.h"
-#include "src/inspector/v8-inspector-impl.h"
-#include "src/inspector/v8-internal-value-type.h"
-#include "src/inspector/v8-value-utils.h"
-
-#include "include/v8-inspector.h"
-
-namespace v8_inspector {
-
-namespace {
-
-void setFunctionProperty(v8::Local<v8::Context> context,
-                         v8::Local<v8::Object> obj, const char* name,
-                         v8::FunctionCallback callback,
-                         v8::Local<v8::External> external) {
-  v8::Local<v8::String> funcName =
-      toV8StringInternalized(context->GetIsolate(), name);
-  v8::Local<v8::Function> func;
-  if (!v8::Function::New(context, callback, external, 0,
-                         v8::ConstructorBehavior::kThrow)
-           .ToLocal(&func))
-    return;
-  func->SetName(funcName);
-  createDataProperty(context, obj, funcName, func);
-}
-
-V8InspectorImpl* unwrapInspector(
-    const v8::FunctionCallbackInfo<v8::Value>& info) {
-  DCHECK(!info.Data().IsEmpty());
-  DCHECK(info.Data()->IsExternal());
-  V8InspectorImpl* inspector =
-      static_cast<V8InspectorImpl*>(info.Data().As<v8::External>()->Value());
-  DCHECK(inspector);
-  return inspector;
-}
-
-template <typename TypedArray>
-void addTypedArrayProperty(std::vector<v8::Local<v8::Value>>* props,
-                           v8::Isolate* isolate,
-                           v8::Local<v8::ArrayBuffer> arraybuffer,
-                           String16 name, size_t length) {
-  props->push_back(toV8String(isolate, name));
-  props->push_back(TypedArray::New(arraybuffer, 0, length));
-}
-
-}  // namespace
-
-v8::Local<v8::Object> V8InjectedScriptHost::create(
-    v8::Local<v8::Context> context, V8InspectorImpl* inspector) {
-  v8::Isolate* isolate = inspector->isolate();
-  v8::Local<v8::Object> injectedScriptHost = v8::Object::New(isolate);
-  bool success = injectedScriptHost->SetPrototype(context, v8::Null(isolate))
-                     .FromMaybe(false);
-  DCHECK(success);
-  USE(success);
-  v8::Local<v8::External> debuggerExternal =
-      v8::External::New(isolate, inspector);
-  setFunctionProperty(context, injectedScriptHost, "nullifyPrototype",
-                      V8InjectedScriptHost::nullifyPrototypeCallback,
-                      debuggerExternal);
-  setFunctionProperty(context, injectedScriptHost, "getProperty",
-                      V8InjectedScriptHost::getPropertyCallback,
-                      debuggerExternal);
-  setFunctionProperty(context, injectedScriptHost, "internalConstructorName",
-                      V8InjectedScriptHost::internalConstructorNameCallback,
-                      debuggerExternal);
-  setFunctionProperty(
-      context, injectedScriptHost, "formatAccessorsAsProperties",
-      V8InjectedScriptHost::formatAccessorsAsProperties, debuggerExternal);
-  setFunctionProperty(context, injectedScriptHost, "subtype",
-                      V8InjectedScriptHost::subtypeCallback, debuggerExternal);
-  setFunctionProperty(context, injectedScriptHost, "getInternalProperties",
-                      V8InjectedScriptHost::getInternalPropertiesCallback,
-                      debuggerExternal);
-  setFunctionProperty(context, injectedScriptHost, "objectHasOwnProperty",
-                      V8InjectedScriptHost::objectHasOwnPropertyCallback,
-                      debuggerExternal);
-  setFunctionProperty(context, injectedScriptHost, "bind",
-                      V8InjectedScriptHost::bindCallback, debuggerExternal);
-  setFunctionProperty(context, injectedScriptHost, "proxyTargetValue",
-                      V8InjectedScriptHost::proxyTargetValueCallback,
-                      debuggerExternal);
-  setFunctionProperty(context, injectedScriptHost, "nativeAccessorDescriptor",
-                      V8InjectedScriptHost::nativeAccessorDescriptorCallback,
-                      debuggerExternal);
-  setFunctionProperty(context, injectedScriptHost, "typedArrayProperties",
-                      V8InjectedScriptHost::typedArrayPropertiesCallback,
-                      debuggerExternal);
-  createDataProperty(context, injectedScriptHost,
-                     toV8StringInternalized(isolate, "keys"),
-                     v8::debug::GetBuiltin(isolate, v8::debug::kObjectKeys));
-  createDataProperty(
-      context, injectedScriptHost,
-      toV8StringInternalized(isolate, "getPrototypeOf"),
-      v8::debug::GetBuiltin(isolate, v8::debug::kObjectGetPrototypeOf));
-  createDataProperty(
-      context, injectedScriptHost,
-      toV8StringInternalized(isolate, "getOwnPropertyDescriptor"),
-      v8::debug::GetBuiltin(isolate,
-                            v8::debug::kObjectGetOwnPropertyDescriptor));
-  createDataProperty(
-      context, injectedScriptHost,
-      toV8StringInternalized(isolate, "getOwnPropertyNames"),
-      v8::debug::GetBuiltin(isolate, v8::debug::kObjectGetOwnPropertyNames));
-  createDataProperty(
-      context, injectedScriptHost,
-      toV8StringInternalized(isolate, "getOwnPropertySymbols"),
-      v8::debug::GetBuiltin(isolate, v8::debug::kObjectGetOwnPropertySymbols));
-  return injectedScriptHost;
-}
-
-void V8InjectedScriptHost::nullifyPrototypeCallback(
-    const v8::FunctionCallbackInfo<v8::Value>& info) {
-  CHECK_EQ(1, info.Length());
-  DCHECK(info[0]->IsObject());
-  if (!info[0]->IsObject()) return;
-  v8::Isolate* isolate = info.GetIsolate();
-  info[0]
-      .As<v8::Object>()
-      ->SetPrototype(isolate->GetCurrentContext(), v8::Null(isolate))
-      .ToChecked();
-}
-
-void V8InjectedScriptHost::getPropertyCallback(
-    const v8::FunctionCallbackInfo<v8::Value>& info) {
-  CHECK(info.Length() == 2 && info[1]->IsString());
-  if (!info[0]->IsObject()) return;
-  v8::Isolate* isolate = info.GetIsolate();
-  v8::Local<v8::Context> context = isolate->GetCurrentContext();
-  v8::TryCatch tryCatch(isolate);
-  v8::Isolate::DisallowJavascriptExecutionScope throwJs(
-      isolate, v8::Isolate::DisallowJavascriptExecutionScope::THROW_ON_FAILURE);
-  v8::Local<v8::Value> property;
-  if (info[0]
-          .As<v8::Object>()
-          ->Get(context, v8::Local<v8::String>::Cast(info[1]))
-          .ToLocal(&property)) {
-    info.GetReturnValue().Set(property);
-  }
-}
-
-void V8InjectedScriptHost::internalConstructorNameCallback(
-    const v8::FunctionCallbackInfo<v8::Value>& info) {
-  if (info.Length() < 1 || !info[0]->IsObject()) return;
-
-  v8::Local<v8::Object> object = info[0].As<v8::Object>();
-  info.GetReturnValue().Set(object->GetConstructorName());
-}
-
-void V8InjectedScriptHost::formatAccessorsAsProperties(
-    const v8::FunctionCallbackInfo<v8::Value>& info) {
-  DCHECK_EQ(info.Length(), 2);
-  info.GetReturnValue().Set(false);
-  if (!info[1]->IsFunction()) return;
-  // Check that function is user-defined.
-  if (info[1].As<v8::Function>()->ScriptId() != v8::UnboundScript::kNoScriptId)
-    return;
-  info.GetReturnValue().Set(
-      unwrapInspector(info)->client()->formatAccessorsAsProperties(info[0]));
-}
-
-void V8InjectedScriptHost::subtypeCallback(
-    const v8::FunctionCallbackInfo<v8::Value>& info) {
-  if (info.Length() < 1) return;
-
-  v8::Isolate* isolate = info.GetIsolate();
-  v8::Local<v8::Value> value = info[0];
-  if (value->IsObject()) {
-    v8::Local<v8::Value> internalType = v8InternalValueTypeFrom(
-        isolate->GetCurrentContext(), v8::Local<v8::Object>::Cast(value));
-    if (internalType->IsString()) {
-      info.GetReturnValue().Set(internalType);
-      return;
-    }
-  }
-  if (value->IsArray() || value->IsArgumentsObject()) {
-    info.GetReturnValue().Set(toV8StringInternalized(isolate, "array"));
-    return;
-  }
-  if (value->IsTypedArray()) {
-    info.GetReturnValue().Set(toV8StringInternalized(isolate, "typedarray"));
-    return;
-  }
-  if (value->IsDate()) {
-    info.GetReturnValue().Set(toV8StringInternalized(isolate, "date"));
-    return;
-  }
-  if (value->IsRegExp()) {
-    info.GetReturnValue().Set(toV8StringInternalized(isolate, "regexp"));
-    return;
-  }
-  if (value->IsMap()) {
-    info.GetReturnValue().Set(toV8StringInternalized(isolate, "map"));
-    return;
-  }
-  if (value->IsWeakMap()) {
-    info.GetReturnValue().Set(toV8StringInternalized(isolate, "weakmap"));
-    return;
-  }
-  if (value->IsSet()) {
-    info.GetReturnValue().Set(toV8StringInternalized(isolate, "set"));
-    return;
-  }
-  if (value->IsWeakSet()) {
-    info.GetReturnValue().Set(toV8StringInternalized(isolate, "weakset"));
-    return;
-  }
-  if (value->IsMapIterator() || value->IsSetIterator()) {
-    info.GetReturnValue().Set(toV8StringInternalized(isolate, "iterator"));
-    return;
-  }
-  if (value->IsGeneratorObject()) {
-    info.GetReturnValue().Set(toV8StringInternalized(isolate, "generator"));
-    return;
-  }
-  if (value->IsNativeError()) {
-    info.GetReturnValue().Set(toV8StringInternalized(isolate, "error"));
-    return;
-  }
-  if (value->IsProxy()) {
-    info.GetReturnValue().Set(toV8StringInternalized(isolate, "proxy"));
-    return;
-  }
-  if (value->IsPromise()) {
-    info.GetReturnValue().Set(toV8StringInternalized(isolate, "promise"));
-    return;
-  }
-  if (value->IsArrayBuffer() || value->IsSharedArrayBuffer()) {
-    info.GetReturnValue().Set(toV8StringInternalized(isolate, "arraybuffer"));
-    return;
-  }
-  if (value->IsDataView()) {
-    info.GetReturnValue().Set(toV8StringInternalized(isolate, "dataview"));
-    return;
-  }
-  std::unique_ptr<StringBuffer> subtype =
-      unwrapInspector(info)->client()->valueSubtype(value);
-  if (subtype) {
-    info.GetReturnValue().Set(toV8String(isolate, subtype->string()));
-    return;
-  }
-}
-
-void V8InjectedScriptHost::getInternalPropertiesCallback(
-    const v8::FunctionCallbackInfo<v8::Value>& info) {
-  if (info.Length() < 1) return;
-
-  std::unordered_set<String16> allowedProperties;
-  if (info[0]->IsBooleanObject() || info[0]->IsNumberObject() ||
-      info[0]->IsStringObject() || info[0]->IsSymbolObject()) {
-    allowedProperties.insert(String16("[[PrimitiveValue]]"));
-  } else if (info[0]->IsPromise()) {
-    allowedProperties.insert(String16("[[PromiseStatus]]"));
-    allowedProperties.insert(String16("[[PromiseValue]]"));
-  } else if (info[0]->IsGeneratorObject()) {
-    allowedProperties.insert(String16("[[GeneratorStatus]]"));
-  } else if (info[0]->IsMap() || info[0]->IsWeakMap() || info[0]->IsSet() ||
-             info[0]->IsWeakSet() || info[0]->IsMapIterator() ||
-             info[0]->IsSetIterator()) {
-    allowedProperties.insert(String16("[[Entries]]"));
-  }
-  if (!allowedProperties.size()) return;
-
-  v8::Isolate* isolate = info.GetIsolate();
-  v8::Local<v8::Array> allProperties;
-  if (!unwrapInspector(info)
-           ->debugger()
-           ->internalProperties(isolate->GetCurrentContext(), info[0])
-           .ToLocal(&allProperties) ||
-      !allProperties->IsArray() || allProperties->Length() % 2 != 0)
-    return;
-
-  {
-    v8::Local<v8::Context> context = isolate->GetCurrentContext();
-    v8::TryCatch tryCatch(isolate);
-    v8::Isolate::DisallowJavascriptExecutionScope throwJs(
-        isolate,
-        v8::Isolate::DisallowJavascriptExecutionScope::THROW_ON_FAILURE);
-
-    v8::Local<v8::Array> properties = v8::Array::New(isolate);
-    if (tryCatch.HasCaught()) return;
-
-    uint32_t outputIndex = 0;
-    for (uint32_t i = 0; i < allProperties->Length(); i += 2) {
-      v8::Local<v8::Value> key;
-      if (!allProperties->Get(context, i).ToLocal(&key)) continue;
-      if (tryCatch.HasCaught()) {
-        tryCatch.Reset();
-        continue;
-      }
-      String16 keyString = toProtocolStringWithTypeCheck(key);
-      if (keyString.isEmpty() ||
-          allowedProperties.find(keyString) == allowedProperties.end())
-        continue;
-      v8::Local<v8::Value> value;
-      if (!allProperties->Get(context, i + 1).ToLocal(&value)) continue;
-      if (tryCatch.HasCaught()) {
-        tryCatch.Reset();
-        continue;
-      }
-      createDataProperty(context, properties, outputIndex++, key);
-      createDataProperty(context, properties, outputIndex++, value);
-    }
-    info.GetReturnValue().Set(properties);
-  }
-}
-
-void V8InjectedScriptHost::objectHasOwnPropertyCallback(
-    const v8::FunctionCallbackInfo<v8::Value>& info) {
-  if (info.Length() < 2 || !info[0]->IsObject() || !info[1]->IsString()) return;
-  bool result = info[0]
-                    .As<v8::Object>()
-                    ->HasOwnProperty(info.GetIsolate()->GetCurrentContext(),
-                                     v8::Local<v8::String>::Cast(info[1]))
-                    .FromMaybe(false);
-  info.GetReturnValue().Set(v8::Boolean::New(info.GetIsolate(), result));
-}
-
-void V8InjectedScriptHost::bindCallback(
-    const v8::FunctionCallbackInfo<v8::Value>& info) {
-  if (info.Length() < 2 || !info[1]->IsString()) return;
-  InjectedScript* injectedScript =
-      InjectedScript::fromInjectedScriptHost(info.GetIsolate(), info.Holder());
-  if (!injectedScript) return;
-
-  v8::Local<v8::Context> context = info.GetIsolate()->GetCurrentContext();
-  v8::Local<v8::String> v8groupName =
-      info[1]->ToString(context).ToLocalChecked();
-  String16 groupName = toProtocolStringWithTypeCheck(v8groupName);
-  int id = injectedScript->bindObject(info[0], groupName);
-  info.GetReturnValue().Set(id);
-}
-
-void V8InjectedScriptHost::proxyTargetValueCallback(
-    const v8::FunctionCallbackInfo<v8::Value>& info) {
-  if (info.Length() != 1 || !info[0]->IsProxy()) {
-    UNREACHABLE();
-    return;
-  }
-  v8::Local<v8::Value> target = info[0].As<v8::Proxy>();
-  while (target->IsProxy())
-    target = v8::Local<v8::Proxy>::Cast(target)->GetTarget();
-  info.GetReturnValue().Set(target);
-}
-
-void V8InjectedScriptHost::nativeAccessorDescriptorCallback(
-    const v8::FunctionCallbackInfo<v8::Value>& info) {
-  v8::Isolate* isolate = info.GetIsolate();
-  if (info.Length() != 2 || !info[0]->IsObject() || !info[1]->IsName()) {
-    info.GetReturnValue().Set(v8::Undefined(isolate));
-    return;
-  }
-  v8::Local<v8::Context> context = isolate->GetCurrentContext();
-  int flags = v8::debug::GetNativeAccessorDescriptor(
-      context, v8::Local<v8::Object>::Cast(info[0]),
-      v8::Local<v8::Name>::Cast(info[1]));
-  if (flags == static_cast<int>(v8::debug::NativeAccessorType::None)) {
-    info.GetReturnValue().Set(v8::Undefined(isolate));
-    return;
-  }
-
-  bool isBuiltin =
-      flags & static_cast<int>(v8::debug::NativeAccessorType::IsBuiltin);
-  bool hasGetter =
-      flags & static_cast<int>(v8::debug::NativeAccessorType::HasGetter);
-  bool hasSetter =
-      flags & static_cast<int>(v8::debug::NativeAccessorType::HasSetter);
-  v8::Local<v8::Object> result = v8::Object::New(isolate);
-  result->SetPrototype(context, v8::Null(isolate)).ToChecked();
-  createDataProperty(context, result, toV8String(isolate, "isBuiltin"),
-                     v8::Boolean::New(isolate, isBuiltin));
-  createDataProperty(context, result, toV8String(isolate, "hasGetter"),
-                     v8::Boolean::New(isolate, hasGetter));
-  createDataProperty(context, result, toV8String(isolate, "hasSetter"),
-                     v8::Boolean::New(isolate, hasSetter));
-  info.GetReturnValue().Set(result);
-}
-
-void V8InjectedScriptHost::typedArrayPropertiesCallback(
-    const v8::FunctionCallbackInfo<v8::Value>& info) {
-  v8::Isolate* isolate = info.GetIsolate();
-  if (info.Length() != 1 || !info[0]->IsArrayBuffer()) return;
-
-  v8::TryCatch tryCatch(isolate);
-  v8::Isolate::DisallowJavascriptExecutionScope throwJs(
-      isolate, v8::Isolate::DisallowJavascriptExecutionScope::THROW_ON_FAILURE);
-  v8::Local<v8::ArrayBuffer> arrayBuffer = info[0].As<v8::ArrayBuffer>();
-  size_t length = arrayBuffer->ByteLength();
-  if (length == 0) return;
-  std::vector<v8::Local<v8::Value>> arrays_vector;
-  addTypedArrayProperty<v8::Int8Array>(&arrays_vector, isolate, arrayBuffer,
-                                       "[[Int8Array]]", length);
-  addTypedArrayProperty<v8::Uint8Array>(&arrays_vector, isolate, arrayBuffer,
-                                        "[[Uint8Array]]", length);
-
-  if (length % 2 == 0) {
-    addTypedArrayProperty<v8::Int16Array>(&arrays_vector, isolate, arrayBuffer,
-                                          "[[Int16Array]]", length / 2);
-  }
-  if (length % 4 == 0) {
-    addTypedArrayProperty<v8::Int32Array>(&arrays_vector, isolate, arrayBuffer,
-                                          "[[Int32Array]]", length / 4);
-  }
-
-  if (tryCatch.HasCaught()) return;
-  v8::Local<v8::Context> context = isolate->GetCurrentContext();
-  v8::Local<v8::Array> arrays =
-      v8::Array::New(isolate, static_cast<uint32_t>(arrays_vector.size()));
-  for (uint32_t i = 0; i < static_cast<uint32_t>(arrays_vector.size()); i++)
-    createDataProperty(context, arrays, i, arrays_vector[i]);
-  if (tryCatch.HasCaught()) return;
-  info.GetReturnValue().Set(arrays);
-}
-
-}  // namespace v8_inspector
diff --git a/src/v8/src/inspector/v8-injected-script-host.h b/src/v8/src/inspector/v8-injected-script-host.h
deleted file mode 100644
index 18f9139..0000000
--- a/src/v8/src/inspector/v8-injected-script-host.h
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_INSPECTOR_V8INJECTEDSCRIPTHOST_H_
-#define V8_INSPECTOR_V8INJECTEDSCRIPTHOST_H_
-
-#include "include/v8.h"
-
-namespace v8_inspector {
-
-class V8InspectorImpl;
-
-// SECURITY NOTE: Although the InjectedScriptHost is intended for use solely by
-// the inspector,
-// a reference to the InjectedScriptHost may be leaked to the page being
-// inspected. Thus, the
-// InjectedScriptHost must never implemment methods that have more power over
-// the page than the
-// page already has itself (e.g. origin restriction bypasses).
-
-class V8InjectedScriptHost {
- public:
-  // We expect that debugger outlives any JS context and thus
-  // V8InjectedScriptHost (owned by JS)
-  // is destroyed before inspector.
-  static v8::Local<v8::Object> create(v8::Local<v8::Context>, V8InspectorImpl*);
-
- private:
-  static void nullifyPrototypeCallback(
-      const v8::FunctionCallbackInfo<v8::Value>&);
-  static void getPropertyCallback(const v8::FunctionCallbackInfo<v8::Value>&);
-  static void internalConstructorNameCallback(
-      const v8::FunctionCallbackInfo<v8::Value>&);
-  static void formatAccessorsAsProperties(
-      const v8::FunctionCallbackInfo<v8::Value>&);
-  static void subtypeCallback(const v8::FunctionCallbackInfo<v8::Value>&);
-  static void getInternalPropertiesCallback(
-      const v8::FunctionCallbackInfo<v8::Value>&);
-  static void objectHasOwnPropertyCallback(
-      const v8::FunctionCallbackInfo<v8::Value>&);
-  static void bindCallback(const v8::FunctionCallbackInfo<v8::Value>&);
-  static void proxyTargetValueCallback(
-      const v8::FunctionCallbackInfo<v8::Value>&);
-  static void nativeAccessorDescriptorCallback(
-      const v8::FunctionCallbackInfo<v8::Value>&);
-  static void typedArrayPropertiesCallback(
-      const v8::FunctionCallbackInfo<v8::Value>&);
-};
-
-}  // namespace v8_inspector
-
-#endif  // V8_INSPECTOR_V8INJECTEDSCRIPTHOST_H_
diff --git a/src/v8/src/inspector/v8-internal-value-type.cc b/src/v8/src/inspector/v8-internal-value-type.cc
deleted file mode 100644
index 54e839e..0000000
--- a/src/v8/src/inspector/v8-internal-value-type.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/inspector/v8-internal-value-type.h"
-
-#include "src/inspector/string-util.h"
-
-namespace v8_inspector {
-
-namespace {
-
-v8::Local<v8::Private> internalSubtypePrivate(v8::Isolate* isolate) {
-  return v8::Private::ForApi(
-      isolate,
-      toV8StringInternalized(isolate, "V8InternalType#internalSubtype"));
-}
-
-v8::Local<v8::String> subtypeForInternalType(v8::Isolate* isolate,
-                                             V8InternalValueType type) {
-  switch (type) {
-    case V8InternalValueType::kEntry:
-      return toV8StringInternalized(isolate, "internal#entry");
-    case V8InternalValueType::kLocation:
-      return toV8StringInternalized(isolate, "internal#location");
-    case V8InternalValueType::kScope:
-      return toV8StringInternalized(isolate, "internal#scope");
-    case V8InternalValueType::kScopeList:
-      return toV8StringInternalized(isolate, "internal#scopeList");
-  }
-  UNREACHABLE();
-}
-
-}  // namespace
-
-bool markAsInternal(v8::Local<v8::Context> context,
-                    v8::Local<v8::Object> object, V8InternalValueType type) {
-  v8::Isolate* isolate = context->GetIsolate();
-  v8::Local<v8::Private> privateValue = internalSubtypePrivate(isolate);
-  v8::Local<v8::String> subtype = subtypeForInternalType(isolate, type);
-  return object->SetPrivate(context, privateValue, subtype).FromMaybe(false);
-}
-
-bool markArrayEntriesAsInternal(v8::Local<v8::Context> context,
-                                v8::Local<v8::Array> array,
-                                V8InternalValueType type) {
-  v8::Isolate* isolate = context->GetIsolate();
-  v8::Local<v8::Private> privateValue = internalSubtypePrivate(isolate);
-  v8::Local<v8::String> subtype = subtypeForInternalType(isolate, type);
-  for (uint32_t i = 0; i < array->Length(); ++i) {
-    v8::Local<v8::Value> entry;
-    if (!array->Get(context, i).ToLocal(&entry) || !entry->IsObject())
-      return false;
-    if (!entry.As<v8::Object>()
-             ->SetPrivate(context, privateValue, subtype)
-             .FromMaybe(false))
-      return false;
-  }
-  return true;
-}
-
-v8::Local<v8::Value> v8InternalValueTypeFrom(v8::Local<v8::Context> context,
-                                             v8::Local<v8::Object> object) {
-  v8::Isolate* isolate = context->GetIsolate();
-  v8::Local<v8::Private> privateValue = internalSubtypePrivate(isolate);
-  if (!object->HasPrivate(context, privateValue).FromMaybe(false))
-    return v8::Null(isolate);
-  v8::Local<v8::Value> subtypeValue;
-  if (!object->GetPrivate(context, privateValue).ToLocal(&subtypeValue) ||
-      !subtypeValue->IsString())
-    return v8::Null(isolate);
-  return subtypeValue;
-}
-
-}  // namespace v8_inspector
diff --git a/src/v8/src/inspector/v8-internal-value-type.h b/src/v8/src/inspector/v8-internal-value-type.h
deleted file mode 100644
index e648a0d..0000000
--- a/src/v8/src/inspector/v8-internal-value-type.h
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_INSPECTOR_V8INTERNALVALUETYPE_H_
-#define V8_INSPECTOR_V8INTERNALVALUETYPE_H_
-
-#include "include/v8.h"
-
-namespace v8_inspector {
-
-enum class V8InternalValueType { kEntry, kLocation, kScope, kScopeList };
-
-bool markAsInternal(v8::Local<v8::Context>, v8::Local<v8::Object>,
-                    V8InternalValueType);
-bool markArrayEntriesAsInternal(v8::Local<v8::Context>, v8::Local<v8::Array>,
-                                V8InternalValueType);
-v8::Local<v8::Value> v8InternalValueTypeFrom(v8::Local<v8::Context>,
-                                             v8::Local<v8::Object>);
-
-}  // namespace v8_inspector
-
-#endif  // V8_INSPECTOR_V8INTERNALVALUETYPE_H_
diff --git a/src/v8/src/interpreter/setup-interpreter-internal.cc b/src/v8/src/interpreter/setup-interpreter-internal.cc
deleted file mode 100644
index 1bba104..0000000
--- a/src/v8/src/interpreter/setup-interpreter-internal.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright 2017 the V8 project 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 "src/interpreter/setup-interpreter.h"
-
-#include "src/handles-inl.h"
-#include "src/interpreter/bytecodes.h"
-#include "src/interpreter/interpreter-generator.h"
-#include "src/interpreter/interpreter.h"
-#include "src/objects-inl.h"
-
-namespace v8 {
-namespace internal {
-namespace interpreter {
-
-namespace {
-void PrintBuiltinSize(Bytecode bytecode, OperandScale operand_scale,
-                      Handle<Code> code) {
-  PrintF(stdout, "Ignition Handler, %s, %d\n",
-         Bytecodes::ToString(bytecode, operand_scale).c_str(),
-         code->instruction_size());
-}
-}  // namespace
-
-// static
-void SetupInterpreter::InstallBytecodeHandlers(Interpreter* interpreter) {
-  DCHECK(!interpreter->IsDispatchTableInitialized());
-  HandleScope scope(interpreter->isolate_);
-  // Canonicalize handles, so that we can share constant pool entries pointing
-  // to code targets without dereferencing their handles.
-  CanonicalHandleScope canonical(interpreter->isolate_);
-  Address* dispatch_table = interpreter->dispatch_table_;
-
-  // Generate bytecode handlers for all bytecodes and scales.
-  const OperandScale kOperandScales[] = {
-#define VALUE(Name, _) OperandScale::k##Name,
-      OPERAND_SCALE_LIST(VALUE)
-#undef VALUE
-  };
-
-  for (OperandScale operand_scale : kOperandScales) {
-#define GENERATE_CODE(Name, ...)                                \
-  InstallBytecodeHandler(interpreter->isolate_, dispatch_table, \
-                         Bytecode::k##Name, operand_scale);
-    BYTECODE_LIST(GENERATE_CODE)
-#undef GENERATE_CODE
-  }
-
-  // Fill unused entries will the illegal bytecode handler.
-  size_t illegal_index = Interpreter::GetDispatchTableIndex(
-      Bytecode::kIllegal, OperandScale::kSingle);
-  for (size_t index = 0; index < Interpreter::kDispatchTableSize; ++index) {
-    if (dispatch_table[index] == nullptr) {
-      dispatch_table[index] = dispatch_table[illegal_index];
-    }
-  }
-
-  // Generate the DeserializeLazy handlers, one for each operand scale.
-  Heap* heap = interpreter->isolate_->heap();
-  DCHECK_EQ(Smi::kZero, heap->deserialize_lazy_handler());
-  heap->SetDeserializeLazyHandler(*GenerateDeserializeLazyHandler(
-      interpreter->isolate_, OperandScale::kSingle));
-  DCHECK_EQ(Smi::kZero, heap->deserialize_lazy_handler_wide());
-  heap->SetDeserializeLazyHandlerWide(*GenerateDeserializeLazyHandler(
-      interpreter->isolate_, OperandScale::kDouble));
-  DCHECK_EQ(Smi::kZero, heap->deserialize_lazy_handler_extra_wide());
-  heap->SetDeserializeLazyHandlerExtraWide(*GenerateDeserializeLazyHandler(
-      interpreter->isolate_, OperandScale::kQuadruple));
-
-  // Initialization should have been successful.
-  DCHECK(interpreter->IsDispatchTableInitialized());
-}
-
-// static
-void SetupInterpreter::InstallBytecodeHandler(Isolate* isolate,
-                                              Address* dispatch_table,
-                                              Bytecode bytecode,
-                                              OperandScale operand_scale) {
-  if (!Bytecodes::BytecodeHasHandler(bytecode, operand_scale)) return;
-
-  size_t index = Interpreter::GetDispatchTableIndex(bytecode, operand_scale);
-  Handle<Code> code = GenerateBytecodeHandler(isolate, bytecode, operand_scale);
-  dispatch_table[index] = code->entry();
-
-  if (FLAG_print_builtin_size) PrintBuiltinSize(bytecode, operand_scale, code);
-}
-
-}  // namespace interpreter
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/interpreter/setup-interpreter.h b/src/v8/src/interpreter/setup-interpreter.h
deleted file mode 100644
index 19b03f7..0000000
--- a/src/v8/src/interpreter/setup-interpreter.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_INTERPRETER_SETUP_INTERPRETER_H_
-#define V8_INTERPRETER_SETUP_INTERPRETER_H_
-
-#include "src/interpreter/bytecode-operands.h"
-#include "src/interpreter/bytecodes.h"
-
-namespace v8 {
-namespace internal {
-namespace interpreter {
-
-class Interpreter;
-
-class SetupInterpreter {
- public:
-  static void InstallBytecodeHandlers(Interpreter* interpreter);
-
- private:
-  // Generates handler for given |bytecode| and |operand_scale|
-  // and installs it into the |dispatch_table|.
-  static void InstallBytecodeHandler(Isolate* isolate, Address* dispatch_table,
-                                     Bytecode bytecode,
-                                     OperandScale operand_scale);
-};
-
-}  // namespace interpreter
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_INTERPRETER_SETUP_INTERPRETER_H_
diff --git a/src/v8/src/js/array.js b/src/v8/src/js/array.js
deleted file mode 100644
index 7605fc1..0000000
--- a/src/v8/src/js/array.js
+++ /dev/null
@@ -1,1318 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-(function(global, utils, extrasUtils) {
-
-"use strict";
-
-%CheckIsBootstrapping();
-
-// -------------------------------------------------------------------
-// Imports
-
-var GetIterator;
-var GetMethod;
-var GlobalArray = global.Array;
-var InternalArray = utils.InternalArray;
-var MathMax = global.Math.max;
-var MathMin = global.Math.min;
-var ObjectHasOwnProperty = global.Object.prototype.hasOwnProperty;
-var ObjectToString = global.Object.prototype.toString;
-var iteratorSymbol = utils.ImportNow("iterator_symbol");
-var unscopablesSymbol = utils.ImportNow("unscopables_symbol");
-
-utils.Import(function(from) {
-  GetIterator = from.GetIterator;
-  GetMethod = from.GetMethod;
-});
-
-// -------------------------------------------------------------------
-
-macro IS_PROXY(arg)
-(%_IsJSProxy(arg))
-endmacro
-
-macro INVERT_NEG_ZERO(arg)
-((arg) + 0)
-endmacro
-
-function ArraySpeciesCreate(array, length) {
-  length = INVERT_NEG_ZERO(length);
-  var constructor = %ArraySpeciesConstructor(array);
-  return new constructor(length);
-}
-
-
-function KeySortCompare(a, b) {
-  return a - b;
-}
-
-function GetSortedArrayKeys(array, indices) {
-  if (IS_NUMBER(indices)) {
-    // It's an interval
-    var limit = indices;
-    var keys = new InternalArray();
-    for (var i = 0; i < limit; ++i) {
-      var e = array[i];
-      if (!IS_UNDEFINED(e) || i in array) {
-        keys.push(i);
-      }
-    }
-    return keys;
-  }
-  return InnerArraySort(indices, indices.length, KeySortCompare);
-}
-
-
-function SparseJoinWithSeparatorJS(array, keys, length, use_locale, separator) {
-  var keys_length = keys.length;
-  var elements = new InternalArray(keys_length * 2);
-  for (var i = 0; i < keys_length; i++) {
-    var key = keys[i];
-    elements[i * 2] = key;
-    elements[i * 2 + 1] = ConvertToString(use_locale, array[key]);
-  }
-  return %SparseJoinWithSeparator(elements, length, separator);
-}
-
-
-// Optimized for sparse arrays if separator is ''.
-function SparseJoin(array, keys, use_locale) {
-  var keys_length = keys.length;
-  var elements = new InternalArray(keys_length);
-  for (var i = 0; i < keys_length; i++) {
-    elements[i] = ConvertToString(use_locale, array[keys[i]]);
-  }
-  return %StringBuilderConcat(elements, keys_length, '');
-}
-
-
-function UseSparseVariant(array, length, is_array, touched) {
-  // Only use the sparse variant on arrays that are likely to be sparse and the
-  // number of elements touched in the operation is relatively small compared to
-  // the overall size of the array.
-  if (!is_array || length < 1000 || %HasComplexElements(array)) {
-    return false;
-  }
-  if (!%_IsSmi(length)) {
-    return true;
-  }
-  var elements_threshold = length >> 2;  // No more than 75% holes
-  var estimated_elements = %EstimateNumberOfElements(array);
-  return (estimated_elements < elements_threshold) &&
-    (touched > estimated_elements * 4);
-}
-
-function Stack() {
-  this.length = 0;
-  this.values = new InternalArray();
-}
-
-// Predeclare the instance variables on the prototype. Otherwise setting them in
-// the constructor will leak the instance through settings on Object.prototype.
-Stack.prototype.length = null;
-Stack.prototype.values = null;
-
-function StackPush(stack, value) {
-  stack.values[stack.length++] = value;
-}
-
-function StackPop(stack) {
-  stack.values[--stack.length] = null
-}
-
-function StackHas(stack, v) {
-  var length = stack.length;
-  var values = stack.values;
-  for (var i = 0; i < length; i++) {
-    if (values[i] === v) return true;
-  }
-  return false;
-}
-
-// Global list of arrays visited during toString, toLocaleString and
-// join invocations.
-var visited_arrays = new Stack();
-
-function DoJoin(array, length, is_array, separator, use_locale) {
-  if (UseSparseVariant(array, length, is_array, length)) {
-    %NormalizeElements(array);
-    var keys = GetSortedArrayKeys(array, %GetArrayKeys(array, length));
-    if (separator === '') {
-      if (keys.length === 0) return '';
-      return SparseJoin(array, keys, use_locale);
-    } else {
-      return SparseJoinWithSeparatorJS(
-          array, keys, length, use_locale, separator);
-    }
-  }
-
-  // Fast case for one-element arrays.
-  if (length === 1) {
-    return ConvertToString(use_locale, array[0]);
-  }
-
-  // Construct an array for the elements.
-  var elements = new InternalArray(length);
-  for (var i = 0; i < length; i++) {
-    elements[i] = ConvertToString(use_locale, array[i]);
-  }
-
-  if (separator === '') {
-    return %StringBuilderConcat(elements, length, '');
-  } else {
-    return %StringBuilderJoin(elements, length, separator);
-  }
-}
-
-function Join(array, length, separator, use_locale) {
-  if (length === 0) return '';
-
-  var is_array = IS_ARRAY(array);
-
-  if (is_array) {
-    // If the array is cyclic, return the empty string for already
-    // visited arrays.
-    if (StackHas(visited_arrays, array)) return '';
-    StackPush(visited_arrays, array);
-  }
-
-  // Attempt to convert the elements.
-  try {
-    return DoJoin(array, length, is_array, separator, use_locale);
-  } finally {
-    // Make sure to remove the last element of the visited array no
-    // matter what happens.
-    if (is_array) StackPop(visited_arrays);
-  }
-}
-
-
-function ConvertToString(use_locale, x) {
-  if (IS_NULL_OR_UNDEFINED(x)) return '';
-  return TO_STRING(use_locale ? x.toLocaleString() : x);
-}
-
-
-// This function implements the optimized splice implementation that can use
-// special array operations to handle sparse arrays in a sensible fashion.
-function SparseSlice(array, start_i, del_count, len, deleted_elements) {
-  // Move deleted elements to a new array (the return value from splice).
-  var indices = %GetArrayKeys(array, start_i + del_count);
-  if (IS_NUMBER(indices)) {
-    var limit = indices;
-    for (var i = start_i; i < limit; ++i) {
-      var current = array[i];
-      if (!IS_UNDEFINED(current) || i in array) {
-        %CreateDataProperty(deleted_elements, i - start_i, current);
-      }
-    }
-  } else {
-    var length = indices.length;
-    for (var k = 0; k < length; ++k) {
-      var key = indices[k];
-      if (key >= start_i) {
-        var current = array[key];
-        if (!IS_UNDEFINED(current) || key in array) {
-          %CreateDataProperty(deleted_elements, key - start_i, current);
-        }
-      }
-    }
-  }
-}
-
-
-// This function implements the optimized splice implementation that can use
-// special array operations to handle sparse arrays in a sensible fashion.
-function SparseMove(array, start_i, del_count, len, num_additional_args) {
-  // Bail out if no moving is necessary.
-  if (num_additional_args === del_count) return;
-  // Move data to new array.
-  var new_array = new InternalArray(
-      // Clamp array length to 2^32-1 to avoid early RangeError.
-      MathMin(len - del_count + num_additional_args, 0xffffffff));
-  var big_indices;
-  var indices = %GetArrayKeys(array, len);
-  if (IS_NUMBER(indices)) {
-    var limit = indices;
-    for (var i = 0; i < start_i && i < limit; ++i) {
-      var current = array[i];
-      if (!IS_UNDEFINED(current) || i in array) {
-        new_array[i] = current;
-      }
-    }
-    for (var i = start_i + del_count; i < limit; ++i) {
-      var current = array[i];
-      if (!IS_UNDEFINED(current) || i in array) {
-        new_array[i - del_count + num_additional_args] = current;
-      }
-    }
-  } else {
-    var length = indices.length;
-    for (var k = 0; k < length; ++k) {
-      var key = indices[k];
-      if (key < start_i) {
-        var current = array[key];
-        if (!IS_UNDEFINED(current) || key in array) {
-          new_array[key] = current;
-        }
-      } else if (key >= start_i + del_count) {
-        var current = array[key];
-        if (!IS_UNDEFINED(current) || key in array) {
-          var new_key = key - del_count + num_additional_args;
-          new_array[new_key] = current;
-          if (new_key > 0xfffffffe) {
-            big_indices = big_indices || new InternalArray();
-            big_indices.push(new_key);
-          }
-        }
-      }
-    }
-  }
-  // Move contents of new_array into this array
-  %MoveArrayContents(new_array, array);
-  // Add any moved values that aren't elements anymore.
-  if (!IS_UNDEFINED(big_indices)) {
-    var length = big_indices.length;
-    for (var i = 0; i < length; ++i) {
-      var key = big_indices[i];
-      array[key] = new_array[key];
-    }
-  }
-}
-
-
-// This is part of the old simple-minded splice.  We are using it either
-// because the receiver is not an array (so we have no choice) or because we
-// know we are not deleting or moving a lot of elements.
-function SimpleSlice(array, start_i, del_count, len, deleted_elements) {
-  for (var i = 0; i < del_count; i++) {
-    var index = start_i + i;
-    if (index in array) {
-      var current = array[index];
-      %CreateDataProperty(deleted_elements, i, current);
-    }
-  }
-}
-
-
-function SimpleMove(array, start_i, del_count, len, num_additional_args) {
-  if (num_additional_args !== del_count) {
-    // Move the existing elements after the elements to be deleted
-    // to the right position in the resulting array.
-    if (num_additional_args > del_count) {
-      for (var i = len - del_count; i > start_i; i--) {
-        var from_index = i + del_count - 1;
-        var to_index = i + num_additional_args - 1;
-        if (from_index in array) {
-          array[to_index] = array[from_index];
-        } else {
-          delete array[to_index];
-        }
-      }
-    } else {
-      for (var i = start_i; i < len - del_count; i++) {
-        var from_index = i + del_count;
-        var to_index = i + num_additional_args;
-        if (from_index in array) {
-          array[to_index] = array[from_index];
-        } else {
-          delete array[to_index];
-        }
-      }
-      for (var i = len; i > len - del_count + num_additional_args; i--) {
-        delete array[i - 1];
-      }
-    }
-  }
-}
-
-
-// -------------------------------------------------------------------
-
-var ArrayJoin;
-DEFINE_METHOD(
-  GlobalArray.prototype,
-  toString() {
-    var array;
-    var func;
-    if (IS_ARRAY(this)) {
-      func = this.join;
-      if (func === ArrayJoin) {
-        return Join(this, this.length, ',', false);
-      }
-      array = this;
-    } else {
-      array = TO_OBJECT(this);
-      func = array.join;
-    }
-    if (!IS_CALLABLE(func)) {
-      return %_Call(ObjectToString, array);
-    }
-    return %_Call(func, array);
-  }
-);
-
-function InnerArrayToLocaleString(array, length) {
-  return Join(array, TO_LENGTH(length), ',', true);
-}
-
-
-DEFINE_METHOD(
-  GlobalArray.prototype,
-  toLocaleString() {
-    var array = TO_OBJECT(this);
-    var arrayLen = array.length;
-    return InnerArrayToLocaleString(array, arrayLen);
-  }
-);
-
-
-function InnerArrayJoin(separator, array, length) {
-  if (IS_UNDEFINED(separator)) {
-    separator = ',';
-  } else {
-    separator = TO_STRING(separator);
-  }
-
-  // Fast case for one-element arrays.
-  if (length === 1) {
-    var e = array[0];
-    if (IS_NULL_OR_UNDEFINED(e)) return '';
-    return TO_STRING(e);
-  }
-
-  return Join(array, length, separator, false);
-}
-
-
-DEFINE_METHOD(
-  GlobalArray.prototype,
-  join(separator) {
-    var array = TO_OBJECT(this);
-    var length = TO_LENGTH(array.length);
-
-    return InnerArrayJoin(separator, array, length);
-  }
-);
-
-
-// Removes the last element from the array and returns it. See
-// ECMA-262, section 15.4.4.6.
-function ArrayPopFallback() {
-  var array = TO_OBJECT(this);
-  var n = TO_LENGTH(array.length);
-  if (n == 0) {
-    array.length = n;
-    return;
-  }
-
-  n--;
-  var value = array[n];
-  delete array[n];
-  array.length = n;
-  return value;
-}
-
-
-// Appends the arguments to the end of the array and returns the new
-// length of the array. See ECMA-262, section 15.4.4.7.
-function ArrayPushFallback() {
-  var array = TO_OBJECT(this);
-  var n = TO_LENGTH(array.length);
-  var m = arguments.length;
-
-  // Subtract n from kMaxSafeInteger rather than testing m + n >
-  // kMaxSafeInteger. n may already be kMaxSafeInteger. In that case adding
-  // e.g., 1 would not be safe.
-  if (m > kMaxSafeInteger - n) throw %make_type_error(kPushPastSafeLength, m, n);
-
-  for (var i = 0; i < m; i++) {
-    array[i+n] = arguments[i];
-  }
-
-  var new_length = n + m;
-  array.length = new_length;
-  return new_length;
-}
-
-
-// For implementing reverse() on large, sparse arrays.
-function SparseReverse(array, len) {
-  var keys = GetSortedArrayKeys(array, %GetArrayKeys(array, len));
-  var high_counter = keys.length - 1;
-  var low_counter = 0;
-  while (low_counter <= high_counter) {
-    var i = keys[low_counter];
-    var j = keys[high_counter];
-
-    var j_complement = len - j - 1;
-    var low, high;
-
-    if (j_complement <= i) {
-      high = j;
-      while (keys[--high_counter] == j) { }
-      low = j_complement;
-    }
-    if (j_complement >= i) {
-      low = i;
-      while (keys[++low_counter] == i) { }
-      high = len - i - 1;
-    }
-
-    var current_i = array[low];
-    if (!IS_UNDEFINED(current_i) || low in array) {
-      var current_j = array[high];
-      if (!IS_UNDEFINED(current_j) || high in array) {
-        array[low] = current_j;
-        array[high] = current_i;
-      } else {
-        array[high] = current_i;
-        delete array[low];
-      }
-    } else {
-      var current_j = array[high];
-      if (!IS_UNDEFINED(current_j) || high in array) {
-        array[low] = current_j;
-        delete array[high];
-      }
-    }
-  }
-}
-
-function PackedArrayReverse(array, len) {
-  var j = len - 1;
-  for (var i = 0; i < j; i++, j--) {
-    var current_i = array[i];
-    var current_j = array[j];
-    array[i] = current_j;
-    array[j] = current_i;
-  }
-  return array;
-}
-
-
-function GenericArrayReverse(array, len) {
-  var j = len - 1;
-  for (var i = 0; i < j; i++, j--) {
-    if (i in array) {
-      var current_i = array[i];
-      if (j in array) {
-        var current_j = array[j];
-        array[i] = current_j;
-        array[j] = current_i;
-      } else {
-        array[j] = current_i;
-        delete array[i];
-      }
-    } else {
-      if (j in array) {
-        var current_j = array[j];
-        array[i] = current_j;
-        delete array[j];
-      }
-    }
-  }
-  return array;
-}
-
-
-DEFINE_METHOD(
-  GlobalArray.prototype,
-  reverse() {
-    var array = TO_OBJECT(this);
-    var len = TO_LENGTH(array.length);
-    var isArray = IS_ARRAY(array);
-
-    if (UseSparseVariant(array, len, isArray, len)) {
-      %NormalizeElements(array);
-      SparseReverse(array, len);
-      return array;
-    } else if (isArray && %_HasFastPackedElements(array)) {
-      return PackedArrayReverse(array, len);
-    } else {
-      return GenericArrayReverse(array, len);
-    }
-  }
-);
-
-
-function ArrayShiftFallback() {
-  var array = TO_OBJECT(this);
-  var len = TO_LENGTH(array.length);
-
-  if (len === 0) {
-    array.length = 0;
-    return;
-  }
-
-  if (%object_is_sealed(array)) throw %make_type_error(kArrayFunctionsOnSealed);
-
-  var first = array[0];
-
-  if (UseSparseVariant(array, len, IS_ARRAY(array), len)) {
-    SparseMove(array, 0, 1, len, 0);
-  } else {
-    SimpleMove(array, 0, 1, len, 0);
-  }
-
-  array.length = len - 1;
-
-  return first;
-}
-
-
-function ArrayUnshiftFallback(arg1) {  // length == 1
-  var array = TO_OBJECT(this);
-  var len = TO_LENGTH(array.length);
-  var num_arguments = arguments.length;
-
-  if (len > 0 && UseSparseVariant(array, len, IS_ARRAY(array), len) &&
-      !%object_is_sealed(array)) {
-    SparseMove(array, 0, 0, len, num_arguments);
-  } else {
-    SimpleMove(array, 0, 0, len, num_arguments);
-  }
-
-  for (var i = 0; i < num_arguments; i++) {
-    array[i] = arguments[i];
-  }
-
-  var new_length = len + num_arguments;
-  array.length = new_length;
-  return new_length;
-}
-
-
-function ArraySliceFallback(start, end) {
-  var array = TO_OBJECT(this);
-  var len = TO_LENGTH(array.length);
-  var start_i = TO_INTEGER(start);
-  var end_i = len;
-
-  if (!IS_UNDEFINED(end)) end_i = TO_INTEGER(end);
-
-  if (start_i < 0) {
-    start_i += len;
-    if (start_i < 0) start_i = 0;
-  } else {
-    if (start_i > len) start_i = len;
-  }
-
-  if (end_i < 0) {
-    end_i += len;
-    if (end_i < 0) end_i = 0;
-  } else {
-    if (end_i > len) end_i = len;
-  }
-
-  var result = ArraySpeciesCreate(array, MathMax(end_i - start_i, 0));
-
-  if (end_i < start_i) return result;
-
-  if (UseSparseVariant(array, len, IS_ARRAY(array), end_i - start_i)) {
-    %NormalizeElements(array);
-    if (IS_ARRAY(result)) %NormalizeElements(result);
-    SparseSlice(array, start_i, end_i - start_i, len, result);
-  } else {
-    SimpleSlice(array, start_i, end_i - start_i, len, result);
-  }
-
-  result.length = end_i - start_i;
-
-  return result;
-}
-
-
-function ComputeSpliceStartIndex(start_i, len) {
-  if (start_i < 0) {
-    start_i += len;
-    return start_i < 0 ? 0 : start_i;
-  }
-
-  return start_i > len ? len : start_i;
-}
-
-
-function ComputeSpliceDeleteCount(delete_count, num_arguments, len, start_i) {
-  // SpiderMonkey, TraceMonkey and JSC treat the case where no delete count is
-  // given as a request to delete all the elements from the start.
-  // And it differs from the case of undefined delete count.
-  // This does not follow ECMA-262, but we do the same for
-  // compatibility.
-  var del_count = 0;
-  if (num_arguments == 1)
-    return len - start_i;
-
-  del_count = TO_INTEGER(delete_count);
-  if (del_count < 0)
-    return 0;
-
-  if (del_count > len - start_i)
-    return len - start_i;
-
-  return del_count;
-}
-
-
-function ArraySpliceFallback(start, delete_count) {
-  var num_arguments = arguments.length;
-  var array = TO_OBJECT(this);
-  var len = TO_LENGTH(array.length);
-  var start_i = ComputeSpliceStartIndex(TO_INTEGER(start), len);
-  var del_count = ComputeSpliceDeleteCount(delete_count, num_arguments, len,
-                                           start_i);
-  var deleted_elements = ArraySpeciesCreate(array, del_count);
-  deleted_elements.length = del_count;
-  var num_elements_to_add = num_arguments > 2 ? num_arguments - 2 : 0;
-
-  if (del_count != num_elements_to_add && %object_is_sealed(array)) {
-    throw %make_type_error(kArrayFunctionsOnSealed);
-  } else if (del_count > 0 && %object_is_frozen(array)) {
-    throw %make_type_error(kArrayFunctionsOnFrozen);
-  }
-
-  var changed_elements = del_count;
-  if (num_elements_to_add != del_count) {
-    // If the slice needs to do a actually move elements after the insertion
-    // point, then include those in the estimate of changed elements.
-    changed_elements += len - start_i - del_count;
-  }
-  if (UseSparseVariant(array, len, IS_ARRAY(array), changed_elements)) {
-    %NormalizeElements(array);
-    if (IS_ARRAY(deleted_elements)) %NormalizeElements(deleted_elements);
-    SparseSlice(array, start_i, del_count, len, deleted_elements);
-    SparseMove(array, start_i, del_count, len, num_elements_to_add);
-  } else {
-    SimpleSlice(array, start_i, del_count, len, deleted_elements);
-    SimpleMove(array, start_i, del_count, len, num_elements_to_add);
-  }
-
-  // Insert the arguments into the resulting array in
-  // place of the deleted elements.
-  var i = start_i;
-  var arguments_index = 2;
-  var arguments_length = arguments.length;
-  while (arguments_index < arguments_length) {
-    array[i++] = arguments[arguments_index++];
-  }
-  array.length = len - del_count + num_elements_to_add;
-
-  // Return the deleted elements.
-  return deleted_elements;
-}
-
-
-function InnerArraySort(array, length, comparefn) {
-  // In-place QuickSort algorithm.
-  // For short (length <= 10) arrays, insertion sort is used for efficiency.
-
-  if (!IS_CALLABLE(comparefn)) {
-    comparefn = function (x, y) {
-      if (x === y) return 0;
-      if (%_IsSmi(x) && %_IsSmi(y)) {
-        return %SmiLexicographicCompare(x, y);
-      }
-      x = TO_STRING(x);
-      y = TO_STRING(y);
-      if (x == y) return 0;
-      else return x < y ? -1 : 1;
-    };
-  }
-  function InsertionSort(a, from, to) {
-    for (var i = from + 1; i < to; i++) {
-      var element = a[i];
-      for (var j = i - 1; j >= from; j--) {
-        var tmp = a[j];
-        var order = comparefn(tmp, element);
-        if (order > 0) {
-          a[j + 1] = tmp;
-        } else {
-          break;
-        }
-      }
-      a[j + 1] = element;
-    }
-  };
-
-  function GetThirdIndex(a, from, to) {
-    var t_array = new InternalArray();
-    // Use both 'from' and 'to' to determine the pivot candidates.
-    var increment = 200 + ((to - from) & 15);
-    var j = 0;
-    from += 1;
-    to -= 1;
-    for (var i = from; i < to; i += increment) {
-      t_array[j] = [i, a[i]];
-      j++;
-    }
-    t_array.sort(function(a, b) {
-      return comparefn(a[1], b[1]);
-    });
-    var third_index = t_array[t_array.length >> 1][0];
-    return third_index;
-  }
-
-  function QuickSort(a, from, to) {
-    var third_index = 0;
-    while (true) {
-      // Insertion sort is faster for short arrays.
-      if (to - from <= 10) {
-        InsertionSort(a, from, to);
-        return;
-      }
-      if (to - from > 1000) {
-        third_index = GetThirdIndex(a, from, to);
-      } else {
-        third_index = from + ((to - from) >> 1);
-      }
-      // Find a pivot as the median of first, last and middle element.
-      var v0 = a[from];
-      var v1 = a[to - 1];
-      var v2 = a[third_index];
-      var c01 = comparefn(v0, v1);
-      if (c01 > 0) {
-        // v1 < v0, so swap them.
-        var tmp = v0;
-        v0 = v1;
-        v1 = tmp;
-      } // v0 <= v1.
-      var c02 = comparefn(v0, v2);
-      if (c02 >= 0) {
-        // v2 <= v0 <= v1.
-        var tmp = v0;
-        v0 = v2;
-        v2 = v1;
-        v1 = tmp;
-      } else {
-        // v0 <= v1 && v0 < v2
-        var c12 = comparefn(v1, v2);
-        if (c12 > 0) {
-          // v0 <= v2 < v1
-          var tmp = v1;
-          v1 = v2;
-          v2 = tmp;
-        }
-      }
-      // v0 <= v1 <= v2
-      a[from] = v0;
-      a[to - 1] = v2;
-      var pivot = v1;
-      var low_end = from + 1;   // Upper bound of elements lower than pivot.
-      var high_start = to - 1;  // Lower bound of elements greater than pivot.
-      a[third_index] = a[low_end];
-      a[low_end] = pivot;
-
-      // From low_end to i are elements equal to pivot.
-      // From i to high_start are elements that haven't been compared yet.
-      partition: for (var i = low_end + 1; i < high_start; i++) {
-        var element = a[i];
-        var order = comparefn(element, pivot);
-        if (order < 0) {
-          a[i] = a[low_end];
-          a[low_end] = element;
-          low_end++;
-        } else if (order > 0) {
-          do {
-            high_start--;
-            if (high_start == i) break partition;
-            var top_elem = a[high_start];
-            order = comparefn(top_elem, pivot);
-          } while (order > 0);
-          a[i] = a[high_start];
-          a[high_start] = element;
-          if (order < 0) {
-            element = a[i];
-            a[i] = a[low_end];
-            a[low_end] = element;
-            low_end++;
-          }
-        }
-      }
-      if (to - high_start < low_end - from) {
-        QuickSort(a, high_start, to);
-        to = low_end;
-      } else {
-        QuickSort(a, from, low_end);
-        from = high_start;
-      }
-    }
-  };
-
-  // Copy elements in the range 0..length from obj's prototype chain
-  // to obj itself, if obj has holes. Return one more than the maximal index
-  // of a prototype property.
-  function CopyFromPrototype(obj, length) {
-    var max = 0;
-    for (var proto = %object_get_prototype_of(obj); proto;
-         proto = %object_get_prototype_of(proto)) {
-      var indices = IS_PROXY(proto) ? length : %GetArrayKeys(proto, length);
-      if (IS_NUMBER(indices)) {
-        // It's an interval.
-        var proto_length = indices;
-        for (var i = 0; i < proto_length; i++) {
-          if (!HAS_OWN_PROPERTY(obj, i) && HAS_OWN_PROPERTY(proto, i)) {
-            obj[i] = proto[i];
-            if (i >= max) { max = i + 1; }
-          }
-        }
-      } else {
-        for (var i = 0; i < indices.length; i++) {
-          var index = indices[i];
-          if (!HAS_OWN_PROPERTY(obj, index) && HAS_OWN_PROPERTY(proto, index)) {
-            obj[index] = proto[index];
-            if (index >= max) { max = index + 1; }
-          }
-        }
-      }
-    }
-    return max;
-  };
-
-  // Set a value of "undefined" on all indices in the range from..to
-  // where a prototype of obj has an element. I.e., shadow all prototype
-  // elements in that range.
-  function ShadowPrototypeElements(obj, from, to) {
-    for (var proto = %object_get_prototype_of(obj); proto;
-         proto = %object_get_prototype_of(proto)) {
-      var indices = IS_PROXY(proto) ? to : %GetArrayKeys(proto, to);
-      if (IS_NUMBER(indices)) {
-        // It's an interval.
-        var proto_length = indices;
-        for (var i = from; i < proto_length; i++) {
-          if (HAS_OWN_PROPERTY(proto, i)) {
-            obj[i] = UNDEFINED;
-          }
-        }
-      } else {
-        for (var i = 0; i < indices.length; i++) {
-          var index = indices[i];
-          if (from <= index && HAS_OWN_PROPERTY(proto, index)) {
-            obj[index] = UNDEFINED;
-          }
-        }
-      }
-    }
-  };
-
-  function SafeRemoveArrayHoles(obj) {
-    // Copy defined elements from the end to fill in all holes and undefineds
-    // in the beginning of the array.  Write undefineds and holes at the end
-    // after loop is finished.
-    var first_undefined = 0;
-    var last_defined = length - 1;
-    var num_holes = 0;
-    while (first_undefined < last_defined) {
-      // Find first undefined element.
-      while (first_undefined < last_defined &&
-             !IS_UNDEFINED(obj[first_undefined])) {
-        first_undefined++;
-      }
-      // Maintain the invariant num_holes = the number of holes in the original
-      // array with indices <= first_undefined or > last_defined.
-      if (!HAS_OWN_PROPERTY(obj, first_undefined)) {
-        num_holes++;
-      }
-
-      // Find last defined element.
-      while (first_undefined < last_defined &&
-             IS_UNDEFINED(obj[last_defined])) {
-        if (!HAS_OWN_PROPERTY(obj, last_defined)) {
-          num_holes++;
-        }
-        last_defined--;
-      }
-      if (first_undefined < last_defined) {
-        // Fill in hole or undefined.
-        obj[first_undefined] = obj[last_defined];
-        obj[last_defined] = UNDEFINED;
-      }
-    }
-    // If there were any undefineds in the entire array, first_undefined
-    // points to one past the last defined element.  Make this true if
-    // there were no undefineds, as well, so that first_undefined == number
-    // of defined elements.
-    if (!IS_UNDEFINED(obj[first_undefined])) first_undefined++;
-    // Fill in the undefineds and the holes.  There may be a hole where
-    // an undefined should be and vice versa.
-    var i;
-    for (i = first_undefined; i < length - num_holes; i++) {
-      obj[i] = UNDEFINED;
-    }
-    for (i = length - num_holes; i < length; i++) {
-      // For compatibility with Webkit, do not expose elements in the prototype.
-      if (i in %object_get_prototype_of(obj)) {
-        obj[i] = UNDEFINED;
-      } else {
-        delete obj[i];
-      }
-    }
-
-    // Return the number of defined elements.
-    return first_undefined;
-  };
-
-  if (length < 2) return array;
-
-  var is_array = IS_ARRAY(array);
-  var max_prototype_element;
-  if (!is_array) {
-    // For compatibility with JSC, we also sort elements inherited from
-    // the prototype chain on non-Array objects.
-    // We do this by copying them to this object and sorting only
-    // own elements. This is not very efficient, but sorting with
-    // inherited elements happens very, very rarely, if at all.
-    // The specification allows "implementation dependent" behavior
-    // if an element on the prototype chain has an element that
-    // might interact with sorting.
-    max_prototype_element = CopyFromPrototype(array, length);
-  }
-
-  // %RemoveArrayHoles returns -1 if fast removal is not supported.
-  var num_non_undefined = %RemoveArrayHoles(array, length);
-
-  if (num_non_undefined == -1) {
-    // There were indexed accessors in the array.
-    // Move array holes and undefineds to the end using a Javascript function
-    // that is safe in the presence of accessors.
-    num_non_undefined = SafeRemoveArrayHoles(array);
-  }
-
-  QuickSort(array, 0, num_non_undefined);
-
-  if (!is_array && (num_non_undefined + 1 < max_prototype_element)) {
-    // For compatibility with JSC, we shadow any elements in the prototype
-    // chain that has become exposed by sort moving a hole to its position.
-    ShadowPrototypeElements(array, num_non_undefined, max_prototype_element);
-  }
-
-  return array;
-}
-
-
-DEFINE_METHOD(
-  GlobalArray.prototype,
-  sort(comparefn) {
-    if (!IS_UNDEFINED(comparefn) && !IS_CALLABLE(comparefn)) {
-      throw %make_type_error(kBadSortComparisonFunction, comparefn);
-    }
-
-    var array = TO_OBJECT(this);
-    var length = TO_LENGTH(array.length);
-    return InnerArraySort(array, length, comparefn);
-  }
-);
-
-DEFINE_METHOD_LEN(
-  GlobalArray.prototype,
-  lastIndexOf(element, index) {
-    var array = TO_OBJECT(this);
-    var length = TO_LENGTH(this.length);
-
-    if (length == 0) return -1;
-    if (arguments.length < 2) {
-      index = length - 1;
-    } else {
-      index = INVERT_NEG_ZERO(TO_INTEGER(index));
-      // If index is negative, index from end of the array.
-      if (index < 0) index += length;
-      // If index is still negative, do not search the array.
-      if (index < 0) return -1;
-      else if (index >= length) index = length - 1;
-    }
-    var min = 0;
-    var max = index;
-    if (UseSparseVariant(array, length, IS_ARRAY(array), index)) {
-      %NormalizeElements(array);
-      var indices = %GetArrayKeys(array, index + 1);
-      if (IS_NUMBER(indices)) {
-        // It's an interval.
-        max = indices;  // Capped by index already.
-        // Fall through to loop below.
-      } else {
-        if (indices.length == 0) return -1;
-        // Get all the keys in sorted order.
-        var sortedKeys = GetSortedArrayKeys(array, indices);
-        var i = sortedKeys.length - 1;
-        while (i >= 0) {
-          var key = sortedKeys[i];
-          if (array[key] === element) return key;
-          i--;
-        }
-        return -1;
-      }
-    }
-    // Lookup through the array.
-    if (!IS_UNDEFINED(element)) {
-      for (var i = max; i >= min; i--) {
-        if (array[i] === element) return i;
-      }
-      return -1;
-    }
-    for (var i = max; i >= min; i--) {
-      if (IS_UNDEFINED(array[i]) && i in array) {
-        return i;
-      }
-    }
-    return -1;
-  },
-  1  /* Set function length */
-);
-
-
-// ES#sec-array.prototype.copywithin
-// (Array.prototype.copyWithin ( target, start [ , end ] )
-DEFINE_METHOD_LEN(
-  GlobalArray.prototype,
-  copyWithin(target, start, end) {
-    var array = TO_OBJECT(this);
-    var length = TO_LENGTH(array.length);
-
-    target = TO_INTEGER(target);
-    var to;
-    if (target < 0) {
-      to = MathMax(length + target, 0);
-    } else {
-      to = MathMin(target, length);
-    }
-
-    start = TO_INTEGER(start);
-    var from;
-    if (start < 0) {
-      from = MathMax(length + start, 0);
-    } else {
-      from = MathMin(start, length);
-    }
-
-    end = IS_UNDEFINED(end) ? length : TO_INTEGER(end);
-    var final;
-    if (end < 0) {
-      final = MathMax(length + end, 0);
-    } else {
-      final = MathMin(end, length);
-    }
-
-    var count = MathMin(final - from, length - to);
-    var direction = 1;
-    if (from < to && to < (from + count)) {
-      direction = -1;
-      from = from + count - 1;
-      to = to + count - 1;
-    }
-
-    while (count > 0) {
-      if (from in array) {
-        array[to] = array[from];
-      } else {
-        delete array[to];
-      }
-      from = from + direction;
-      to = to + direction;
-      count--;
-    }
-
-    return array;
-  },
-  2  /* Set function length */
-);
-
-
-// ES6, draft 04-05-14, section 22.1.3.6
-DEFINE_METHOD_LEN(
-  GlobalArray.prototype,
-  fill(value, start, end) {
-    var array = TO_OBJECT(this);
-    var length = TO_LENGTH(array.length);
-
-    var i = IS_UNDEFINED(start) ? 0 : TO_INTEGER(start);
-    var end = IS_UNDEFINED(end) ? length : TO_INTEGER(end);
-
-    if (i < 0) {
-      i += length;
-      if (i < 0) i = 0;
-    } else {
-      if (i > length) i = length;
-    }
-
-    if (end < 0) {
-      end += length;
-      if (end < 0) end = 0;
-    } else {
-      if (end > length) end = length;
-    }
-
-    if ((end - i) > 0 && %object_is_frozen(array)) {
-      throw %make_type_error(kArrayFunctionsOnFrozen);
-    }
-
-    for (; i < end; i++)
-      array[i] = value;
-    return array;
-  },
-  1  /* Set function length */
-);
-
-
-// ES6, draft 10-14-14, section 22.1.2.1
-DEFINE_METHOD_LEN(
-  GlobalArray,
-  'from'(arrayLike, mapfn, receiver) {
-    var items = TO_OBJECT(arrayLike);
-    var mapping = !IS_UNDEFINED(mapfn);
-
-    if (mapping) {
-      if (!IS_CALLABLE(mapfn)) {
-        throw %make_type_error(kCalledNonCallable, mapfn);
-      }
-    }
-
-    var iterable = GetMethod(items, iteratorSymbol);
-    var k;
-    var result;
-    var mappedValue;
-    var nextValue;
-
-    if (!IS_UNDEFINED(iterable)) {
-      result = %IsConstructor(this) ? new this() : [];
-      k = 0;
-
-      for (nextValue of
-           { [iteratorSymbol]() { return GetIterator(items, iterable) } }) {
-        if (mapping) {
-          mappedValue = %_Call(mapfn, receiver, nextValue, k);
-        } else {
-          mappedValue = nextValue;
-        }
-        %CreateDataProperty(result, k, mappedValue);
-        k++;
-      }
-      result.length = k;
-      return result;
-    } else {
-      var len = TO_LENGTH(items.length);
-      result = %IsConstructor(this) ? new this(len) : new GlobalArray(len);
-
-      for (k = 0; k < len; ++k) {
-        nextValue = items[k];
-        if (mapping) {
-          mappedValue = %_Call(mapfn, receiver, nextValue, k);
-        } else {
-          mappedValue = nextValue;
-        }
-        %CreateDataProperty(result, k, mappedValue);
-      }
-
-      result.length = k;
-      return result;
-    }
-  },
-  1  /* Set function length. */
-);
-
-// ES6, draft 05-22-14, section 22.1.2.3
-DEFINE_METHOD(
-  GlobalArray,
-  of(...args) {
-    var length = args.length;
-    var constructor = this;
-    // TODO: Implement IsConstructor (ES6 section 7.2.5)
-    var array = %IsConstructor(constructor) ? new constructor(length) : [];
-    for (var i = 0; i < length; i++) {
-      %CreateDataProperty(array, i, args[i]);
-    }
-    array.length = length;
-    return array;
-  }
-);
-
-// -------------------------------------------------------------------
-
-// Set up unscopable properties on the Array.prototype object.
-var unscopables = {
-  __proto__: null,
-  copyWithin: true,
-  entries: true,
-  fill: true,
-  find: true,
-  findIndex: true,
-  includes: true,
-  keys: true,
-};
-
-%ToFastProperties(unscopables);
-
-%AddNamedProperty(GlobalArray.prototype, unscopablesSymbol, unscopables,
-                  DONT_ENUM | READ_ONLY);
-
-var ArrayIndexOf = GlobalArray.prototype.indexOf;
-var ArrayJoin = GlobalArray.prototype.join;
-var ArrayPop = GlobalArray.prototype.pop;
-var ArrayPush = GlobalArray.prototype.push;
-var ArraySlice = GlobalArray.prototype.slice;
-var ArrayShift = GlobalArray.prototype.shift;
-var ArraySort = GlobalArray.prototype.sort;
-var ArraySplice = GlobalArray.prototype.splice;
-var ArrayToString = GlobalArray.prototype.toString;
-var ArrayUnshift = GlobalArray.prototype.unshift;
-
-// Array prototype functions that return iterators. They are exposed to the
-// public API via Template::SetIntrinsicDataProperty().
-var ArrayEntries = GlobalArray.prototype.entries;
-var ArrayForEach = GlobalArray.prototype.forEach;
-var ArrayKeys = GlobalArray.prototype.keys;
-var ArrayValues = GlobalArray.prototype[iteratorSymbol];
-
-
-// The internal Array prototype doesn't need to be fancy, since it's never
-// exposed to user code.
-// Adding only the functions that are actually used.
-utils.SetUpLockedPrototype(InternalArray, GlobalArray(), [
-  "indexOf", ArrayIndexOf,
-  "join", ArrayJoin,
-  "pop", ArrayPop,
-  "push", ArrayPush,
-  "shift", ArrayShift,
-  "sort", ArraySort,
-  "splice", ArraySplice
-]);
-
-// V8 extras get a separate copy of InternalPackedArray. We give them the basic
-// manipulation methods.
-utils.SetUpLockedPrototype(extrasUtils.InternalPackedArray, GlobalArray(), [
-  "push", ArrayPush,
-  "pop", ArrayPop,
-  "shift", ArrayShift,
-  "unshift", ArrayUnshift,
-  "splice", ArraySplice,
-  "slice", ArraySlice
-]);
-
-// -------------------------------------------------------------------
-// Exports
-
-utils.Export(function(to) {
-  to.ArrayJoin = ArrayJoin;
-  to.ArrayPush = ArrayPush;
-  to.ArrayToString = ArrayToString;
-  to.ArrayValues = ArrayValues;
-  to.InnerArrayJoin = InnerArrayJoin;
-  to.InnerArraySort = InnerArraySort;
-  to.InnerArrayToLocaleString = InnerArrayToLocaleString;
-});
-
-%InstallToContext([
-  "array_entries_iterator", ArrayEntries,
-  "array_for_each_iterator", ArrayForEach,
-  "array_keys_iterator", ArrayKeys,
-  "array_values_iterator", ArrayValues,
-  // Fallback implementations of Array builtins.
-  "array_pop", ArrayPopFallback,
-  "array_push", ArrayPushFallback,
-  "array_shift", ArrayShiftFallback,
-  "array_splice", ArraySpliceFallback,
-  "array_slice", ArraySliceFallback,
-  "array_unshift", ArrayUnshiftFallback,
-]);
-
-});
diff --git a/src/v8/src/js/intl.js b/src/v8/src/js/intl.js
deleted file mode 100644
index 53fbe1f..0000000
--- a/src/v8/src/js/intl.js
+++ /dev/null
@@ -1,2213 +0,0 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// ECMAScript 402 API implementation.
-
-/**
- * Intl object is a single object that has some named properties,
- * all of which are constructors.
- */
-(function(global, utils) {
-
-"use strict";
-
-%CheckIsBootstrapping();
-
-// -------------------------------------------------------------------
-// Imports
-
-var ArrayJoin;
-var ArrayPush;
-var GlobalDate = global.Date;
-var GlobalIntl = global.Intl;
-var GlobalIntlDateTimeFormat = GlobalIntl.DateTimeFormat;
-var GlobalIntlNumberFormat = GlobalIntl.NumberFormat;
-var GlobalIntlCollator = GlobalIntl.Collator;
-var GlobalIntlPluralRules = utils.ImportNow("PluralRules");
-var GlobalIntlv8BreakIterator = GlobalIntl.v8BreakIterator;
-var GlobalNumber = global.Number;
-var GlobalRegExp = global.RegExp;
-var GlobalString = global.String;
-var IntlFallbackSymbol = utils.ImportNow("intl_fallback_symbol");
-var InternalArray = utils.InternalArray;
-var MathMax = global.Math.max;
-var ObjectHasOwnProperty = global.Object.prototype.hasOwnProperty;
-var ObjectKeys = global.Object.keys;
-var patternSymbol = utils.ImportNow("intl_pattern_symbol");
-var resolvedSymbol = utils.ImportNow("intl_resolved_symbol");
-var StringSubstr = GlobalString.prototype.substr;
-var StringSubstring = GlobalString.prototype.substring;
-
-utils.Import(function(from) {
-  ArrayJoin = from.ArrayJoin;
-  ArrayPush = from.ArrayPush;
-});
-
-// Utilities for definitions
-
-macro IS_OBJECT(arg)
-(typeof(arg) === 'object')
-endmacro
-
-macro NUMBER_IS_NAN(arg)
-(%IS_VAR(arg) !== arg)
-endmacro
-
-macro NUMBER_IS_FINITE(arg)
-(%_IsSmi(%IS_VAR(arg)) || ((arg == arg) && (arg != 1/0) && (arg != -1/0)))
-endmacro
-
-// To avoid ES2015 Function name inference.
-
-macro ANONYMOUS_FUNCTION(fn)
-(0, (fn))
-endmacro
-
-/**
- * Adds bound method to the prototype of the given object.
- */
-function AddBoundMethod(obj, methodName, implementation, length, typename,
-                        compat) {
-  %CheckIsBootstrapping();
-  var internalName = %CreatePrivateSymbol(methodName);
-
-  DEFINE_METHOD(
-    obj.prototype,
-    get [methodName]() {
-      var receiver = Unwrap(this, typename, obj, methodName, compat);
-      if (IS_UNDEFINED(receiver[internalName])) {
-        var boundMethod;
-        if (IS_UNDEFINED(length) || length === 2) {
-          boundMethod =
-            ANONYMOUS_FUNCTION((fst, snd) => implementation(receiver, fst, snd));
-        } else if (length === 1) {
-          boundMethod = ANONYMOUS_FUNCTION(fst => implementation(receiver, fst));
-        } else {
-          boundMethod = ANONYMOUS_FUNCTION((...args) => {
-            // DateTimeFormat.format needs to be 0 arg method, but can still
-            // receive an optional dateValue param. If one was provided, pass it
-            // along.
-            if (args.length > 0) {
-              return implementation(receiver, args[0]);
-            } else {
-              return implementation(receiver);
-            }
-          });
-        }
-        %SetNativeFlag(boundMethod);
-        receiver[internalName] = boundMethod;
-      }
-      return receiver[internalName];
-    }
-  );
-}
-
-function IntlConstruct(receiver, constructor, create, newTarget, args,
-                       compat) {
-  var locales = args[0];
-  var options = args[1];
-
-  var instance = create(locales, options);
-
-  if (compat && IS_UNDEFINED(newTarget) && receiver instanceof constructor) {
-    %object_define_property(receiver, IntlFallbackSymbol, { value: instance });
-    return receiver;
-  }
-
-  return instance;
-}
-
-
-
-function Unwrap(receiver, typename, constructor, method, compat) {
-  if (!%IsInitializedIntlObjectOfType(receiver, typename)) {
-    if (compat && receiver instanceof constructor) {
-      let fallback = receiver[IntlFallbackSymbol];
-      if (%IsInitializedIntlObjectOfType(fallback, typename)) {
-        return fallback;
-      }
-    }
-    throw %make_type_error(kIncompatibleMethodReceiver, method, receiver);
-  }
-  return receiver;
-}
-
-
-// -------------------------------------------------------------------
-
-/**
- * Caches available locales for each service.
- */
-var AVAILABLE_LOCALES = {
-  'collator': UNDEFINED,
-  'numberformat': UNDEFINED,
-  'dateformat': UNDEFINED,
-  'breakiterator': UNDEFINED,
-  'pluralrules': UNDEFINED,
-};
-
-/**
- * Caches default ICU locale.
- */
-var DEFAULT_ICU_LOCALE = UNDEFINED;
-
-function GetDefaultICULocaleJS(service) {
-  if (IS_UNDEFINED(DEFAULT_ICU_LOCALE)) {
-    DEFAULT_ICU_LOCALE = %GetDefaultICULocale();
-  }
-  // Check that this is a valid default for this service,
-  // otherwise fall back to "und"
-  // TODO(littledan,jshin): AvailableLocalesOf sometimes excludes locales
-  // which don't require tailoring, but work fine with root data. Look into
-  // exposing this fact in ICU or the way Chrome bundles data.
-  return (IS_UNDEFINED(service) ||
-          HAS_OWN_PROPERTY(getAvailableLocalesOf(service), DEFAULT_ICU_LOCALE))
-         ? DEFAULT_ICU_LOCALE : "und";
-}
-
-/**
- * Unicode extension regular expression.
- */
-var UNICODE_EXTENSION_RE = UNDEFINED;
-
-function GetUnicodeExtensionRE() {
-  if (IS_UNDEFINED(UNDEFINED)) {
-    UNICODE_EXTENSION_RE = new GlobalRegExp('-u(-[a-z0-9]{2,8})+', 'g');
-  }
-  return UNICODE_EXTENSION_RE;
-}
-
-/**
- * Matches any Unicode extension.
- */
-var ANY_EXTENSION_RE = UNDEFINED;
-
-function GetAnyExtensionRE() {
-  if (IS_UNDEFINED(ANY_EXTENSION_RE)) {
-    ANY_EXTENSION_RE = new GlobalRegExp('-[a-z0-9]{1}-.*', 'g');
-  }
-  return ANY_EXTENSION_RE;
-}
-
-/**
- * Replace quoted text (single quote, anything but the quote and quote again).
- */
-var QUOTED_STRING_RE = UNDEFINED;
-
-function GetQuotedStringRE() {
-  if (IS_UNDEFINED(QUOTED_STRING_RE)) {
-    QUOTED_STRING_RE = new GlobalRegExp("'[^']+'", 'g');
-  }
-  return QUOTED_STRING_RE;
-}
-
-/**
- * Matches valid service name.
- */
-var SERVICE_RE = UNDEFINED;
-
-function GetServiceRE() {
-  if (IS_UNDEFINED(SERVICE_RE)) {
-    SERVICE_RE =
-        new GlobalRegExp('^(' + %_Call(ArrayJoin, ObjectKeys(AVAILABLE_LOCALES), '|') + ')$');
-  }
-  return SERVICE_RE;
-}
-
-/**
- * Validates a language tag against bcp47 spec.
- * Actual value is assigned on first run.
- */
-var LANGUAGE_TAG_RE = UNDEFINED;
-
-function GetLanguageTagRE() {
-  if (IS_UNDEFINED(LANGUAGE_TAG_RE)) {
-    BuildLanguageTagREs();
-  }
-  return LANGUAGE_TAG_RE;
-}
-
-/**
- * Helps find duplicate variants in the language tag.
- */
-var LANGUAGE_VARIANT_RE = UNDEFINED;
-
-function GetLanguageVariantRE() {
-  if (IS_UNDEFINED(LANGUAGE_VARIANT_RE)) {
-    BuildLanguageTagREs();
-  }
-  return LANGUAGE_VARIANT_RE;
-}
-
-/**
- * Helps find duplicate singletons in the language tag.
- */
-var LANGUAGE_SINGLETON_RE = UNDEFINED;
-
-function GetLanguageSingletonRE() {
-  if (IS_UNDEFINED(LANGUAGE_SINGLETON_RE)) {
-    BuildLanguageTagREs();
-  }
-  return LANGUAGE_SINGLETON_RE;
-}
-
-/**
- * Matches valid IANA time zone names.
- */
-var TIMEZONE_NAME_CHECK_RE = UNDEFINED;
-
-function GetTimezoneNameCheckRE() {
-  if (IS_UNDEFINED(TIMEZONE_NAME_CHECK_RE)) {
-    TIMEZONE_NAME_CHECK_RE = new GlobalRegExp(
-        '^([A-Za-z]+)/([A-Za-z_-]+)((?:\/[A-Za-z_-]+)+)*$');
-  }
-  return TIMEZONE_NAME_CHECK_RE;
-}
-
-/**
- * Matches valid location parts of IANA time zone names.
- */
-var TIMEZONE_NAME_LOCATION_PART_RE = UNDEFINED;
-
-function GetTimezoneNameLocationPartRE() {
-  if (IS_UNDEFINED(TIMEZONE_NAME_LOCATION_PART_RE)) {
-    TIMEZONE_NAME_LOCATION_PART_RE =
-        new GlobalRegExp('^([A-Za-z]+)((?:[_-][A-Za-z]+)+)*$');
-  }
-  return TIMEZONE_NAME_LOCATION_PART_RE;
-}
-
-
-/**
- * Returns an intersection of locales and service supported locales.
- * Parameter locales is treated as a priority list.
- */
-function supportedLocalesOf(service, locales, options) {
-  if (IS_NULL(%regexp_internal_match(GetServiceRE(), service))) {
-    throw %make_error(kWrongServiceType, service);
-  }
-
-  // Provide defaults if matcher was not specified.
-  if (IS_UNDEFINED(options)) {
-    options = {__proto__: null};
-  } else {
-    options = TO_OBJECT(options);
-  }
-
-  var matcher = options.localeMatcher;
-  if (!IS_UNDEFINED(matcher)) {
-    matcher = TO_STRING(matcher);
-    if (matcher !== 'lookup' && matcher !== 'best fit') {
-      throw %make_range_error(kLocaleMatcher, matcher);
-    }
-  } else {
-    matcher = 'best fit';
-  }
-
-  var requestedLocales = initializeLocaleList(locales);
-
-  var availableLocales = getAvailableLocalesOf(service);
-
-  // Use either best fit or lookup algorithm to match locales.
-  if (matcher === 'best fit') {
-    return initializeLocaleList(bestFitSupportedLocalesOf(
-        requestedLocales, availableLocales));
-  }
-
-  return initializeLocaleList(lookupSupportedLocalesOf(
-      requestedLocales, availableLocales));
-}
-
-
-/**
- * Returns the subset of the provided BCP 47 language priority list for which
- * this service has a matching locale when using the BCP 47 Lookup algorithm.
- * Locales appear in the same order in the returned list as in the input list.
- */
-function lookupSupportedLocalesOf(requestedLocales, availableLocales) {
-  var matchedLocales = new InternalArray();
-  for (var i = 0; i < requestedLocales.length; ++i) {
-    // Remove -u- extension.
-    var locale = %RegExpInternalReplace(
-        GetUnicodeExtensionRE(), requestedLocales[i], '');
-    do {
-      if (!IS_UNDEFINED(availableLocales[locale])) {
-        // Push requested locale not the resolved one.
-        %_Call(ArrayPush, matchedLocales, requestedLocales[i]);
-        break;
-      }
-      // Truncate locale if possible, if not break.
-      var pos = %StringLastIndexOf(locale, '-');
-      if (pos === -1) {
-        break;
-      }
-      locale = %_Call(StringSubstring, locale, 0, pos);
-    } while (true);
-  }
-
-  return matchedLocales;
-}
-
-
-/**
- * Returns the subset of the provided BCP 47 language priority list for which
- * this service has a matching locale when using the implementation
- * dependent algorithm.
- * Locales appear in the same order in the returned list as in the input list.
- */
-function bestFitSupportedLocalesOf(requestedLocales, availableLocales) {
-  // TODO(cira): implement better best fit algorithm.
-  return lookupSupportedLocalesOf(requestedLocales, availableLocales);
-}
-
-
-/**
- * Returns a getOption function that extracts property value for given
- * options object. If property is missing it returns defaultValue. If value
- * is out of range for that property it throws RangeError.
- */
-function getGetOption(options, caller) {
-  if (IS_UNDEFINED(options)) throw %make_error(kDefaultOptionsMissing, caller);
-
-  var getOption = function getOption(property, type, values, defaultValue) {
-    if (!IS_UNDEFINED(options[property])) {
-      var value = options[property];
-      switch (type) {
-        case 'boolean':
-          value = TO_BOOLEAN(value);
-          break;
-        case 'string':
-          value = TO_STRING(value);
-          break;
-        case 'number':
-          value = TO_NUMBER(value);
-          break;
-        default:
-          throw %make_error(kWrongValueType);
-      }
-
-      if (!IS_UNDEFINED(values) && %ArrayIndexOf(values, value, 0) === -1) {
-        throw %make_range_error(kValueOutOfRange, value, caller, property);
-      }
-
-      return value;
-    }
-
-    return defaultValue;
-  }
-
-  return getOption;
-}
-
-
-/**
- * Ecma 402 9.2.5
- * TODO(jshin): relevantExtensionKeys and localeData need to be taken into
- * account per spec.
- * Compares a BCP 47 language priority list requestedLocales against the locales
- * in availableLocales and determines the best available language to meet the
- * request. Two algorithms are available to match the locales: the Lookup
- * algorithm described in RFC 4647 section 3.4, and an implementation dependent
- * best-fit algorithm. Independent of the locale matching algorithm, options
- * specified through Unicode locale extension sequences are negotiated
- * separately, taking the caller's relevant extension keys and locale data as
- * well as client-provided options into consideration. Returns an object with
- * a locale property whose value is the language tag of the selected locale,
- * and properties for each key in relevantExtensionKeys providing the selected
- * value for that key.
- */
-function resolveLocale(service, requestedLocales, options) {
-  requestedLocales = initializeLocaleList(requestedLocales);
-
-  var getOption = getGetOption(options, service);
-  var matcher = getOption('localeMatcher', 'string',
-                          ['lookup', 'best fit'], 'best fit');
-  var resolved;
-  if (matcher === 'lookup') {
-    resolved = lookupMatcher(service, requestedLocales);
-  } else {
-    resolved = bestFitMatcher(service, requestedLocales);
-  }
-
-  return resolved;
-}
-
-
-/**
- * Returns best matched supported locale and extension info using basic
- * lookup algorithm.
- */
-function lookupMatcher(service, requestedLocales) {
-  if (IS_NULL(%regexp_internal_match(GetServiceRE(), service))) {
-    throw %make_error(kWrongServiceType, service);
-  }
-
-  var availableLocales = getAvailableLocalesOf(service);
-
-  for (var i = 0; i < requestedLocales.length; ++i) {
-    // Remove all extensions.
-    var locale = %RegExpInternalReplace(
-        GetAnyExtensionRE(), requestedLocales[i], '');
-    do {
-      if (!IS_UNDEFINED(availableLocales[locale])) {
-        // Return the resolved locale and extension.
-        var extensionMatch = %regexp_internal_match(
-            GetUnicodeExtensionRE(), requestedLocales[i]);
-        var extension = IS_NULL(extensionMatch) ? '' : extensionMatch[0];
-        return {locale: locale, extension: extension, position: i};
-      }
-      // Truncate locale if possible.
-      var pos = %StringLastIndexOf(locale, '-');
-      if (pos === -1) {
-        break;
-      }
-      locale = %_Call(StringSubstring, locale, 0, pos);
-    } while (true);
-  }
-
-  // Didn't find a match, return default.
-  return {
-    locale: GetDefaultICULocaleJS(service),
-    extension: '',
-    position: -1
-  };
-}
-
-
-/**
- * Returns best matched supported locale and extension info using
- * implementation dependend algorithm.
- */
-function bestFitMatcher(service, requestedLocales) {
-  // TODO(cira): implement better best fit algorithm.
-  return lookupMatcher(service, requestedLocales);
-}
-
-
-/**
- * Parses Unicode extension into key - value map.
- * Returns empty object if the extension string is invalid.
- * We are not concerned with the validity of the values at this point.
- * 'attribute' in RFC 6047 is not supported. Keys without explicit
- * values are assigned UNDEFINED.
- * TODO(jshin): Fix the handling of 'attribute' (in RFC 6047, but none
- * has been defined so that it's not used) and boolean keys without
- * an explicit value.
- */
-function parseExtension(extension) {
-  var extensionSplit = %StringSplit(extension, '-', kMaxUint32);
-
-  // Assume ['', 'u', ...] input, but don't throw.
-  if (extensionSplit.length <= 2 ||
-      (extensionSplit[0] !== '' && extensionSplit[1] !== 'u')) {
-    return {__proto__: null};
-  }
-
-  // Key is {2}alphanum, value is {3,8}alphanum.
-  // Some keys may not have explicit values (booleans).
-  var extensionMap = {__proto__: null};
-  var key = UNDEFINED;
-  var value = UNDEFINED;
-  for (var i = 2; i < extensionSplit.length; ++i) {
-    var length = extensionSplit[i].length;
-    var element = extensionSplit[i];
-    if (length === 2) {
-      if (!IS_UNDEFINED(key)) {
-        if (!(key in extensionMap)) {
-          extensionMap[key] = value;
-        }
-        value = UNDEFINED;
-      }
-      key = element;
-    } else if (length >= 3 && length <= 8 && !IS_UNDEFINED(key)) {
-      if (IS_UNDEFINED(value)) {
-        value = element;
-      } else {
-        value = value + "-" + element;
-      }
-    } else {
-      // There is a value that's too long, or that doesn't have a key.
-      return {__proto__: null};
-    }
-  }
-  if (!IS_UNDEFINED(key) && !(key in extensionMap)) {
-    extensionMap[key] = value;
-  }
-
-  return extensionMap;
-}
-
-
-/**
- * Populates internalOptions object with boolean key-value pairs
- * from extensionMap and options.
- * Returns filtered extension (number and date format constructors use
- * Unicode extensions for passing parameters to ICU).
- * It's used for extension-option pairs only, e.g. kn-normalization, but not
- * for 'sensitivity' since it doesn't have extension equivalent.
- * Extensions like nu and ca don't have options equivalent, so we place
- * undefined in the map.property to denote that.
- */
-function setOptions(inOptions, extensionMap, keyValues, getOption, outOptions) {
-  var extension = '';
-
-  var updateExtension = function updateExtension(key, value) {
-    return '-' + key + '-' + TO_STRING(value);
-  }
-
-  var updateProperty = function updateProperty(property, type, value) {
-    if (type === 'boolean' && (typeof value === 'string')) {
-      value = (value === 'true') ? true : false;
-    }
-
-    if (!IS_UNDEFINED(property)) {
-      defineWEProperty(outOptions, property, value);
-    }
-  }
-
-  for (var key in keyValues) {
-    if (HAS_OWN_PROPERTY(keyValues, key)) {
-      var value = UNDEFINED;
-      var map = keyValues[key];
-      if (!IS_UNDEFINED(map.property)) {
-        // This may return true if user specifies numeric: 'false', since
-        // Boolean('nonempty') === true.
-        value = getOption(map.property, map.type, map.values);
-      }
-      if (!IS_UNDEFINED(value)) {
-        updateProperty(map.property, map.type, value);
-        extension += updateExtension(key, value);
-        continue;
-      }
-      // User options didn't have it, check Unicode extension.
-      // Here we want to convert strings 'true', 'false' into proper Boolean
-      // values (not a user error).
-      if (HAS_OWN_PROPERTY(extensionMap, key)) {
-        value = extensionMap[key];
-        if (!IS_UNDEFINED(value)) {
-          updateProperty(map.property, map.type, value);
-          extension += updateExtension(key, value);
-        } else if (map.type === 'boolean') {
-          // Boolean keys are allowed not to have values in Unicode extension.
-          // Those default to true.
-          updateProperty(map.property, map.type, true);
-          extension += updateExtension(key, true);
-        }
-      }
-    }
-  }
-
-  return extension === ''? '' : '-u' + extension;
-}
-
-
-/**
- * Given an array-like, outputs an Array with the numbered
- * properties copied over and defined
- * configurable: false, writable: false, enumerable: true.
- * When |expandable| is true, the result array can be expanded.
- */
-function freezeArray(input) {
-  var array = [];
-  var l = input.length;
-  for (var i = 0; i < l; i++) {
-    if (i in input) {
-      %object_define_property(array, i, {value: input[i],
-                                         configurable: false,
-                                         writable: false,
-                                         enumerable: true});
-    }
-  }
-
-  %object_define_property(array, 'length', {value: l, writable: false});
-  return array;
-}
-
-/* Make JS array[] out of InternalArray */
-function makeArray(input) {
-  var array = [];
-  %MoveArrayContents(input, array);
-  return array;
-}
-
-/**
- * Returns an Object that contains all of supported locales for a given
- * service.
- * In addition to the supported locales we add xx-ZZ locale for each xx-Yyyy-ZZ
- * that is supported. This is required by the spec.
- */
-function getAvailableLocalesOf(service) {
-  // Cache these, they don't ever change per service.
-  if (!IS_UNDEFINED(AVAILABLE_LOCALES[service])) {
-    return AVAILABLE_LOCALES[service];
-  }
-
-  var available = %AvailableLocalesOf(service);
-
-  for (var i in available) {
-    if (HAS_OWN_PROPERTY(available, i)) {
-      var parts = %regexp_internal_match(
-          /^([a-z]{2,3})-([A-Z][a-z]{3})-([A-Z]{2})$/, i);
-      if (!IS_NULL(parts)) {
-        // Build xx-ZZ. We don't care about the actual value,
-        // as long it's not undefined.
-        available[parts[1] + '-' + parts[3]] = null;
-      }
-    }
-  }
-
-  AVAILABLE_LOCALES[service] = available;
-
-  return available;
-}
-
-
-/**
- * Defines a property and sets writable and enumerable to true.
- * Configurable is false by default.
- */
-function defineWEProperty(object, property, value) {
-  %object_define_property(object, property,
-                          {value: value, writable: true, enumerable: true});
-}
-
-
-/**
- * Adds property to an object if the value is not undefined.
- * Sets configurable descriptor to false.
- */
-function addWEPropertyIfDefined(object, property, value) {
-  if (!IS_UNDEFINED(value)) {
-    defineWEProperty(object, property, value);
-  }
-}
-
-
-/**
- * Defines a property and sets writable, enumerable and configurable to true.
- */
-function defineWECProperty(object, property, value) {
-  %object_define_property(object, property, {value: value,
-                                             writable: true,
-                                             enumerable: true,
-                                             configurable: true});
-}
-
-
-/**
- * Adds property to an object if the value is not undefined.
- * Sets all descriptors to true.
- */
-function addWECPropertyIfDefined(object, property, value) {
-  if (!IS_UNDEFINED(value)) {
-    defineWECProperty(object, property, value);
-  }
-}
-
-
-/**
- * Returns titlecased word, aMeRricA -> America.
- */
-function toTitleCaseWord(word) {
-  return %StringToUpperCaseIntl(%_Call(StringSubstr, word, 0, 1)) +
-         %StringToLowerCaseIntl(%_Call(StringSubstr, word, 1));
-}
-
-/**
- * Returns titlecased location, bueNos_airES -> Buenos_Aires
- * or ho_cHi_minH -> Ho_Chi_Minh. It is locale-agnostic and only
- * deals with ASCII only characters.
- * 'of', 'au' and 'es' are special-cased and lowercased.
- */
-function toTitleCaseTimezoneLocation(location) {
-  var match = %regexp_internal_match(GetTimezoneNameLocationPartRE(), location)
-  if (IS_NULL(match)) throw %make_range_error(kExpectedLocation, location);
-
-  var result = toTitleCaseWord(match[1]);
-  if (!IS_UNDEFINED(match[2]) && 2 < match.length) {
-    // The first character is a separator, '_' or '-'.
-    // None of IANA zone names has both '_' and '-'.
-    var separator = %_Call(StringSubstring, match[2], 0, 1);
-    var parts = %StringSplit(match[2], separator, kMaxUint32);
-    for (var i = 1; i < parts.length; i++) {
-      var part = parts[i]
-      var lowercasedPart = %StringToLowerCaseIntl(part);
-      result = result + separator +
-          ((lowercasedPart !== 'es' &&
-            lowercasedPart !== 'of' && lowercasedPart !== 'au') ?
-          toTitleCaseWord(part) : lowercasedPart);
-    }
-  }
-  return result;
-}
-
-/**
- * Canonicalizes the language tag, or throws in case the tag is invalid.
- * ECMA 402 9.2.1 steps 7.c ii ~ v.
- */
-function canonicalizeLanguageTag(localeID) {
-  // null is typeof 'object' so we have to do extra check.
-  if ((!IS_STRING(localeID) && !IS_RECEIVER(localeID)) ||
-      IS_NULL(localeID)) {
-    throw %make_type_error(kLanguageID);
-  }
-
-  // Optimize for the most common case; a language code alone in
-  // the canonical form/lowercase (e.g. "en", "fil").
-  if (IS_STRING(localeID) &&
-      !IS_NULL(%regexp_internal_match(/^[a-z]{2,3}$/, localeID))) {
-    return localeID;
-  }
-
-  var localeString = TO_STRING(localeID);
-
-  if (isStructuallyValidLanguageTag(localeString) === false) {
-    throw %make_range_error(kInvalidLanguageTag, localeString);
-  }
-
-  // ECMA 402 6.2.3
-  var tag = %CanonicalizeLanguageTag(localeString);
-  // TODO(jshin): This should not happen because the structural validity
-  // is already checked. If that's the case, remove this.
-  if (tag === 'invalid-tag') {
-    throw %make_range_error(kInvalidLanguageTag, localeString);
-  }
-
-  return tag;
-}
-
-
-/**
- * Returns an InternalArray where all locales are canonicalized and duplicates
- * removed.
- * Throws on locales that are not well formed BCP47 tags.
- * ECMA 402 8.2.1 steps 1 (ECMA 402 9.2.1) and 2.
- */
-function canonicalizeLocaleList(locales) {
-  var seen = new InternalArray();
-  if (!IS_UNDEFINED(locales)) {
-    // We allow single string localeID.
-    if (typeof locales === 'string') {
-      %_Call(ArrayPush, seen, canonicalizeLanguageTag(locales));
-      return seen;
-    }
-
-    var o = TO_OBJECT(locales);
-    var len = TO_LENGTH(o.length);
-
-    for (var k = 0; k < len; k++) {
-      if (k in o) {
-        var value = o[k];
-
-        var tag = canonicalizeLanguageTag(value);
-
-        if (%ArrayIndexOf(seen, tag, 0) === -1) {
-          %_Call(ArrayPush, seen, tag);
-        }
-      }
-    }
-  }
-
-  return seen;
-}
-
-function initializeLocaleList(locales) {
-  return freezeArray(canonicalizeLocaleList(locales));
-}
-
-/**
- * Check the structural Validity of the language tag per ECMA 402 6.2.2:
- *   - Well-formed per RFC 5646 2.1
- *   - There are no duplicate variant subtags
- *   - There are no duplicate singletion (extension) subtags
- *
- * One extra-check is done (from RFC 5646 2.2.9): the tag is compared
- * against the list of grandfathered tags. However, subtags for
- * primary/extended language, script, region, variant are not checked
- * against the IANA language subtag registry.
- *
- * ICU is too permissible and lets invalid tags, like
- * hant-cmn-cn, through.
- *
- * Returns false if the language tag is invalid.
- */
-function isStructuallyValidLanguageTag(locale) {
-  // Check if it's well-formed, including grandfadered tags.
-  if (IS_NULL(%regexp_internal_match(GetLanguageTagRE(), locale))) {
-    return false;
-  }
-
-  locale = %StringToLowerCaseIntl(locale);
-
-  // Just return if it's a x- form. It's all private.
-  if (%StringIndexOf(locale, 'x-', 0) === 0) {
-    return true;
-  }
-
-  // Check if there are any duplicate variants or singletons (extensions).
-
-  // Remove private use section.
-  locale = %StringSplit(locale, '-x-', kMaxUint32)[0];
-
-  // Skip language since it can match variant regex, so we start from 1.
-  // We are matching i-klingon here, but that's ok, since i-klingon-klingon
-  // is not valid and would fail LANGUAGE_TAG_RE test.
-  var variants = new InternalArray();
-  var extensions = new InternalArray();
-  var parts = %StringSplit(locale, '-', kMaxUint32);
-  for (var i = 1; i < parts.length; i++) {
-    var value = parts[i];
-    if (!IS_NULL(%regexp_internal_match(GetLanguageVariantRE(), value)) &&
-        extensions.length === 0) {
-      if (%ArrayIndexOf(variants, value, 0) === -1) {
-        %_Call(ArrayPush, variants, value);
-      } else {
-        return false;
-      }
-    }
-
-    if (!IS_NULL(%regexp_internal_match(GetLanguageSingletonRE(), value))) {
-      if (%ArrayIndexOf(extensions, value, 0) === -1) {
-        %_Call(ArrayPush, extensions, value);
-      } else {
-        return false;
-      }
-    }
-  }
-
-  return true;
- }
-
-
-/**
- * Builds a regular expresion that validates the language tag
- * against bcp47 spec.
- * Uses http://tools.ietf.org/html/bcp47, section 2.1, ABNF.
- * Runs on load and initializes the global REs.
- */
-function BuildLanguageTagREs() {
-  var alpha = '[a-zA-Z]';
-  var digit = '[0-9]';
-  var alphanum = '(' + alpha + '|' + digit + ')';
-  var regular = '(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|' +
-                'zh-min|zh-min-nan|zh-xiang)';
-  var irregular = '(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|' +
-                  'i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|' +
-                  'i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)';
-  var grandfathered = '(' + irregular + '|' + regular + ')';
-  var privateUse = '(x(-' + alphanum + '{1,8})+)';
-
-  var singleton = '(' + digit + '|[A-WY-Za-wy-z])';
-  LANGUAGE_SINGLETON_RE = new GlobalRegExp('^' + singleton + '$', 'i');
-
-  var extension = '(' + singleton + '(-' + alphanum + '{2,8})+)';
-
-  var variant = '(' + alphanum + '{5,8}|(' + digit + alphanum + '{3}))';
-  LANGUAGE_VARIANT_RE = new GlobalRegExp('^' + variant + '$', 'i');
-
-  var region = '(' + alpha + '{2}|' + digit + '{3})';
-  var script = '(' + alpha + '{4})';
-  var extLang = '(' + alpha + '{3}(-' + alpha + '{3}){0,2})';
-  var language = '(' + alpha + '{2,3}(-' + extLang + ')?|' + alpha + '{4}|' +
-                 alpha + '{5,8})';
-  var langTag = language + '(-' + script + ')?(-' + region + ')?(-' +
-                variant + ')*(-' + extension + ')*(-' + privateUse + ')?';
-
-  var languageTag =
-      '^(' + langTag + '|' + privateUse + '|' + grandfathered + ')$';
-  LANGUAGE_TAG_RE = new GlobalRegExp(languageTag, 'i');
-}
-
-// ECMA 402 section 8.2.1
-DEFINE_METHOD(
-  GlobalIntl,
-  getCanonicalLocales(locales) {
-    return makeArray(canonicalizeLocaleList(locales));
-  }
-);
-
-/**
- * Initializes the given object so it's a valid Collator instance.
- * Useful for subclassing.
- */
-function CreateCollator(locales, options) {
-  if (IS_UNDEFINED(options)) {
-    options = {__proto__: null};
-  }
-
-  var getOption = getGetOption(options, 'collator');
-
-  var internalOptions = {__proto__: null};
-
-  defineWEProperty(internalOptions, 'usage', getOption(
-    'usage', 'string', ['sort', 'search'], 'sort'));
-
-  var sensitivity = getOption('sensitivity', 'string',
-                              ['base', 'accent', 'case', 'variant']);
-  if (IS_UNDEFINED(sensitivity) && internalOptions.usage === 'sort') {
-    sensitivity = 'variant';
-  }
-  defineWEProperty(internalOptions, 'sensitivity', sensitivity);
-
-  defineWEProperty(internalOptions, 'ignorePunctuation', getOption(
-    'ignorePunctuation', 'boolean', UNDEFINED, false));
-
-  var locale = resolveLocale('collator', locales, options);
-
-  // TODO(jshin): ICU now can take kb, kc, etc. Switch over to using ICU
-  // directly. See Collator::InitializeCollator and
-  // Collator::CreateICUCollator in src/objects/intl-objects.cc
-  // ICU can't take kb, kc... parameters through localeID, so we need to pass
-  // them as options.
-  // One exception is -co- which has to be part of the extension, but only for
-  // usage: sort, and its value can't be 'standard' or 'search'.
-  var extensionMap = parseExtension(locale.extension);
-
-  /**
-   * Map of Unicode extensions to option properties, and their values and types,
-   * for a collator.
-   */
-  var COLLATOR_KEY_MAP = {
-    'kn': {'property': 'numeric', 'type': 'boolean'},
-    'kf': {'property': 'caseFirst', 'type': 'string',
-           'values': ['false', 'lower', 'upper']}
-  };
-
-  setOptions(
-      options, extensionMap, COLLATOR_KEY_MAP, getOption, internalOptions);
-
-  var collation = 'default';
-  var extension = '';
-  if (HAS_OWN_PROPERTY(extensionMap, 'co') && internalOptions.usage === 'sort') {
-
-    /**
-     * Allowed -u-co- values. List taken from:
-     * http://unicode.org/repos/cldr/trunk/common/bcp47/collation.xml
-     */
-    var ALLOWED_CO_VALUES = [
-      'big5han', 'dict', 'direct', 'ducet', 'gb2312', 'phonebk', 'phonetic',
-      'pinyin', 'reformed', 'searchjl', 'stroke', 'trad', 'unihan', 'zhuyin'
-    ];
-
-    if (%ArrayIndexOf(ALLOWED_CO_VALUES, extensionMap.co, 0) !== -1) {
-      extension = '-u-co-' + extensionMap.co;
-      // ICU can't tell us what the collation is, so save user's input.
-      collation = extensionMap.co;
-    }
-  } else if (internalOptions.usage === 'search') {
-    extension = '-u-co-search';
-  }
-  defineWEProperty(internalOptions, 'collation', collation);
-
-  var requestedLocale = locale.locale + extension;
-
-  // We define all properties C++ code may produce, to prevent security
-  // problems. If malicious user decides to redefine Object.prototype.locale
-  // we can't just use plain x.locale = 'us' or in C++ Set("locale", "us").
-  // %object_define_properties will either succeed defining or throw an error.
-  var resolved = %object_define_properties({__proto__: null}, {
-    caseFirst: {writable: true},
-    collation: {value: internalOptions.collation, writable: true},
-    ignorePunctuation: {writable: true},
-    locale: {writable: true},
-    numeric: {writable: true},
-    requestedLocale: {value: requestedLocale, writable: true},
-    sensitivity: {writable: true},
-    strength: {writable: true},
-    usage: {value: internalOptions.usage, writable: true}
-  });
-
-  var collator = %CreateCollator(requestedLocale, internalOptions, resolved);
-
-  %MarkAsInitializedIntlObjectOfType(collator, 'collator');
-  collator[resolvedSymbol] = resolved;
-
-  return collator;
-}
-
-
-/**
- * Constructs Intl.Collator object given optional locales and options
- * parameters.
- *
- * @constructor
- */
-function CollatorConstructor() {
-  return IntlConstruct(this, GlobalIntlCollator, CreateCollator, new.target,
-                       arguments);
-}
-%SetCode(GlobalIntlCollator, CollatorConstructor);
-
-
-/**
- * Collator resolvedOptions method.
- */
-DEFINE_METHOD(
-  GlobalIntlCollator.prototype,
-  resolvedOptions() {
-    var coll = Unwrap(this, 'collator', GlobalIntlCollator, 'resolvedOptions',
-                      false);
-    return {
-      locale: coll[resolvedSymbol].locale,
-      usage: coll[resolvedSymbol].usage,
-      sensitivity: coll[resolvedSymbol].sensitivity,
-      ignorePunctuation: coll[resolvedSymbol].ignorePunctuation,
-      numeric: coll[resolvedSymbol].numeric,
-      caseFirst: coll[resolvedSymbol].caseFirst,
-      collation: coll[resolvedSymbol].collation
-    };
-  }
-);
-
-
-/**
- * Returns the subset of the given locale list for which this locale list
- * has a matching (possibly fallback) locale. Locales appear in the same
- * order in the returned list as in the input list.
- * Options are optional parameter.
- */
-DEFINE_METHOD(
-  GlobalIntlCollator,
-  supportedLocalesOf(locales) {
-    return supportedLocalesOf('collator', locales, arguments[1]);
-  }
-);
-
-
-/**
- * When the compare method is called with two arguments x and y, it returns a
- * Number other than NaN that represents the result of a locale-sensitive
- * String comparison of x with y.
- * The result is intended to order String values in the sort order specified
- * by the effective locale and collation options computed during construction
- * of this Collator object, and will be negative, zero, or positive, depending
- * on whether x comes before y in the sort order, the Strings are equal under
- * the sort order, or x comes after y in the sort order, respectively.
- */
-function compare(collator, x, y) {
-  return %InternalCompare(collator, TO_STRING(x), TO_STRING(y));
-};
-
-
-AddBoundMethod(GlobalIntlCollator, 'compare', compare, 2, 'collator', false);
-
-function PluralRulesConstructor() {
-  if (IS_UNDEFINED(new.target)) {
-    throw %make_type_error(kConstructorNotFunction, "PluralRules");
-  }
-
-  var locales = arguments[0];
-  var options = arguments[1];
-
-  if (IS_UNDEFINED(options)) {
-    options = {__proto__: null};
-  }
-
-  var getOption = getGetOption(options, 'pluralrules');
-
-  var locale = resolveLocale('pluralrules', locales, options);
-
-  var internalOptions = {__proto__: null};
-  defineWEProperty(internalOptions, 'type', getOption(
-    'type', 'string', ['cardinal', 'ordinal'], 'cardinal'));
-
-  SetNumberFormatDigitOptions(internalOptions, options, 0, 3);
-
-  var requestedLocale = locale.locale;
-  var resolved = %object_define_properties({__proto__: null}, {
-    type: {value: internalOptions.type, writable: true},
-    locale: {writable: true},
-    maximumFractionDigits: {writable: true},
-    minimumFractionDigits: {writable: true},
-    minimumIntegerDigits: {writable: true},
-    requestedLocale: {value: requestedLocale, writable: true},
-  });
-  if (HAS_OWN_PROPERTY(internalOptions, 'minimumSignificantDigits')) {
-    defineWEProperty(resolved, 'minimumSignificantDigits', UNDEFINED);
-  }
-  if (HAS_OWN_PROPERTY(internalOptions, 'maximumSignificantDigits')) {
-    defineWEProperty(resolved, 'maximumSignificantDigits', UNDEFINED);
-  }
-  defineWEProperty(resolved, 'pluralCategories', []);
-  var pluralRules = %CreatePluralRules(requestedLocale, internalOptions,
-                                       resolved);
-
-  %MarkAsInitializedIntlObjectOfType(pluralRules, 'pluralrules');
-  pluralRules[resolvedSymbol] = resolved;
-
-  return pluralRules;
-}
-%SetCode(GlobalIntlPluralRules, PluralRulesConstructor);
-
-DEFINE_METHOD(
-  GlobalIntlPluralRules.prototype,
-  resolvedOptions() {
-    if (!%IsInitializedIntlObjectOfType(this, 'pluralrules')) {
-      throw %make_type_error(kIncompatibleMethodReceiver,
-                             'Intl.PluralRules.prototype.resolvedOptions',
-                             this);
-    }
-
-    var result = {
-      locale: this[resolvedSymbol].locale,
-      type: this[resolvedSymbol].type,
-      minimumIntegerDigits: this[resolvedSymbol].minimumIntegerDigits,
-      minimumFractionDigits: this[resolvedSymbol].minimumFractionDigits,
-      maximumFractionDigits: this[resolvedSymbol].maximumFractionDigits,
-    };
-
-    if (HAS_OWN_PROPERTY(this[resolvedSymbol], 'minimumSignificantDigits')) {
-      defineWECProperty(result, 'minimumSignificantDigits',
-                        this[resolvedSymbol].minimumSignificantDigits);
-    }
-
-    if (HAS_OWN_PROPERTY(this[resolvedSymbol], 'maximumSignificantDigits')) {
-      defineWECProperty(result, 'maximumSignificantDigits',
-                        this[resolvedSymbol].maximumSignificantDigits);
-    }
-
-    defineWECProperty(result, 'pluralCategories',
-                      this[resolvedSymbol].pluralCategories);
-
-    return result;
-  }
-);
-
-DEFINE_METHOD(
-  GlobalIntlPluralRules,
-  supportedLocalesOf(locales) {
-    return supportedLocalesOf('pluralrules', locales, arguments[1]);
-  }
-);
-
-DEFINE_METHOD(
-  GlobalIntlPluralRules.prototype,
-  select(value) {
-    if (!%IsInitializedIntlObjectOfType(this, 'pluralrules')) {
-      throw %make_type_error(kIncompatibleMethodReceiver,
-                            'Intl.PluralRules.prototype.select',
-                            this);
-    }
-
-    return %PluralRulesSelect(this, TO_NUMBER(value) + 0);
-  }
-);
-
-/**
- * Verifies that the input is a well-formed ISO 4217 currency code.
- * Don't uppercase to test. It could convert invalid code into a valid one.
- * For example \u00DFP (Eszett+P) becomes SSP.
- */
-function isWellFormedCurrencyCode(currency) {
-  return typeof currency === "string" && currency.length === 3 &&
-      IS_NULL(%regexp_internal_match(/[^A-Za-z]/, currency));
-}
-
-
-function defaultNumberOption(value, min, max, fallback, property) {
-  if (!IS_UNDEFINED(value)) {
-    value = TO_NUMBER(value);
-    if (NUMBER_IS_NAN(value) || value < min || value > max) {
-      throw %make_range_error(kPropertyValueOutOfRange, property);
-    }
-    return %math_floor(value);
-  }
-
-  return fallback;
-}
-
-/**
- * Returns the valid digit count for a property, or throws RangeError on
- * a value out of the range.
- */
-function getNumberOption(options, property, min, max, fallback) {
-  var value = options[property];
-  return defaultNumberOption(value, min, max, fallback, property);
-}
-
-// ECMA 402 #sec-setnfdigitoptions
-// SetNumberFormatDigitOptions ( intlObj, options, mnfdDefault, mxfdDefault )
-function SetNumberFormatDigitOptions(internalOptions, options,
-                                     mnfdDefault, mxfdDefault) {
-  // Digit ranges.
-  var mnid = getNumberOption(options, 'minimumIntegerDigits', 1, 21, 1);
-  defineWEProperty(internalOptions, 'minimumIntegerDigits', mnid);
-
-  var mnfd = getNumberOption(options, 'minimumFractionDigits', 0, 20,
-                             mnfdDefault);
-  defineWEProperty(internalOptions, 'minimumFractionDigits', mnfd);
-
-  var mxfdActualDefault = MathMax(mnfd, mxfdDefault);
-
-  var mxfd = getNumberOption(options, 'maximumFractionDigits', mnfd, 20,
-                             mxfdActualDefault);
-
-  defineWEProperty(internalOptions, 'maximumFractionDigits', mxfd);
-
-  var mnsd = options['minimumSignificantDigits'];
-  var mxsd = options['maximumSignificantDigits'];
-  if (!IS_UNDEFINED(mnsd) || !IS_UNDEFINED(mxsd)) {
-    mnsd = defaultNumberOption(mnsd, 1, 21, 1, 'minimumSignificantDigits');
-    defineWEProperty(internalOptions, 'minimumSignificantDigits', mnsd);
-
-    mxsd = defaultNumberOption(mxsd, mnsd, 21, 21, 'maximumSignificantDigits');
-    defineWEProperty(internalOptions, 'maximumSignificantDigits', mxsd);
-  }
-}
-
-/**
- * Initializes the given object so it's a valid NumberFormat instance.
- * Useful for subclassing.
- */
-function CreateNumberFormat(locales, options) {
-  if (IS_UNDEFINED(options)) {
-    options = {__proto__: null};
-  }
-
-  var getOption = getGetOption(options, 'numberformat');
-
-  var locale = resolveLocale('numberformat', locales, options);
-
-  var internalOptions = {__proto__: null};
-  defineWEProperty(internalOptions, 'style', getOption(
-    'style', 'string', ['decimal', 'percent', 'currency'], 'decimal'));
-
-  var currency = getOption('currency', 'string');
-  if (!IS_UNDEFINED(currency) && !isWellFormedCurrencyCode(currency)) {
-    throw %make_range_error(kInvalidCurrencyCode, currency);
-  }
-
-  if (internalOptions.style === 'currency' && IS_UNDEFINED(currency)) {
-    throw %make_type_error(kCurrencyCode);
-  }
-
-  var mnfdDefault, mxfdDefault;
-
-  var currencyDisplay = getOption(
-      'currencyDisplay', 'string', ['code', 'symbol', 'name'], 'symbol');
-  if (internalOptions.style === 'currency') {
-    defineWEProperty(internalOptions, 'currency', %StringToUpperCaseIntl(currency));
-    defineWEProperty(internalOptions, 'currencyDisplay', currencyDisplay);
-
-    mnfdDefault = mxfdDefault = %CurrencyDigits(internalOptions.currency);
-  } else {
-    mnfdDefault = 0;
-    mxfdDefault = internalOptions.style === 'percent' ? 0 : 3;
-  }
-
-  SetNumberFormatDigitOptions(internalOptions, options, mnfdDefault,
-                              mxfdDefault);
-
-  // Grouping.
-  defineWEProperty(internalOptions, 'useGrouping', getOption(
-    'useGrouping', 'boolean', UNDEFINED, true));
-
-  // ICU prefers options to be passed using -u- extension key/values for
-  // number format, so we need to build that.
-  var extensionMap = parseExtension(locale.extension);
-
-  /**
-   * Map of Unicode extensions to option properties, and their values and types,
-   * for a number format.
-   */
-  var NUMBER_FORMAT_KEY_MAP = {
-    'nu': {'property': UNDEFINED, 'type': 'string'}
-  };
-
-  var extension = setOptions(options, extensionMap, NUMBER_FORMAT_KEY_MAP,
-                             getOption, internalOptions);
-
-  var requestedLocale = locale.locale + extension;
-  var resolved = %object_define_properties({__proto__: null}, {
-    currency: {writable: true},
-    currencyDisplay: {writable: true},
-    locale: {writable: true},
-    maximumFractionDigits: {writable: true},
-    minimumFractionDigits: {writable: true},
-    minimumIntegerDigits: {writable: true},
-    numberingSystem: {writable: true},
-    requestedLocale: {value: requestedLocale, writable: true},
-    style: {value: internalOptions.style, writable: true},
-    useGrouping: {writable: true}
-  });
-  if (HAS_OWN_PROPERTY(internalOptions, 'minimumSignificantDigits')) {
-    defineWEProperty(resolved, 'minimumSignificantDigits', UNDEFINED);
-  }
-  if (HAS_OWN_PROPERTY(internalOptions, 'maximumSignificantDigits')) {
-    defineWEProperty(resolved, 'maximumSignificantDigits', UNDEFINED);
-  }
-  var numberFormat = %CreateNumberFormat(requestedLocale, internalOptions,
-                                         resolved);
-
-  if (internalOptions.style === 'currency') {
-    %object_define_property(resolved, 'currencyDisplay',
-        {value: currencyDisplay, writable: true});
-  }
-
-  %MarkAsInitializedIntlObjectOfType(numberFormat, 'numberformat');
-  numberFormat[resolvedSymbol] = resolved;
-
-  return numberFormat;
-}
-
-
-/**
- * Constructs Intl.NumberFormat object given optional locales and options
- * parameters.
- *
- * @constructor
- */
-function NumberFormatConstructor() {
-  return IntlConstruct(this, GlobalIntlNumberFormat, CreateNumberFormat,
-                       new.target, arguments, true);
-}
-%SetCode(GlobalIntlNumberFormat, NumberFormatConstructor);
-
-
-/**
- * NumberFormat resolvedOptions method.
- */
-DEFINE_METHOD(
-  GlobalIntlNumberFormat.prototype,
-  resolvedOptions() {
-    var format = Unwrap(this, 'numberformat', GlobalIntlNumberFormat,
-                        'resolvedOptions', true);
-    var result = {
-      locale: format[resolvedSymbol].locale,
-      numberingSystem: format[resolvedSymbol].numberingSystem,
-      style: format[resolvedSymbol].style,
-      useGrouping: format[resolvedSymbol].useGrouping,
-      minimumIntegerDigits: format[resolvedSymbol].minimumIntegerDigits,
-      minimumFractionDigits: format[resolvedSymbol].minimumFractionDigits,
-      maximumFractionDigits: format[resolvedSymbol].maximumFractionDigits,
-    };
-
-    if (result.style === 'currency') {
-      defineWECProperty(result, 'currency', format[resolvedSymbol].currency);
-      defineWECProperty(result, 'currencyDisplay',
-                        format[resolvedSymbol].currencyDisplay);
-    }
-
-    if (HAS_OWN_PROPERTY(format[resolvedSymbol], 'minimumSignificantDigits')) {
-      defineWECProperty(result, 'minimumSignificantDigits',
-                        format[resolvedSymbol].minimumSignificantDigits);
-    }
-
-    if (HAS_OWN_PROPERTY(format[resolvedSymbol], 'maximumSignificantDigits')) {
-      defineWECProperty(result, 'maximumSignificantDigits',
-                        format[resolvedSymbol].maximumSignificantDigits);
-    }
-
-    return result;
-  }
-);
-
-
-/**
- * Returns the subset of the given locale list for which this locale list
- * has a matching (possibly fallback) locale. Locales appear in the same
- * order in the returned list as in the input list.
- * Options are optional parameter.
- */
-DEFINE_METHOD(
-  GlobalIntlNumberFormat,
-  supportedLocalesOf(locales) {
-    return supportedLocalesOf('numberformat', locales, arguments[1]);
-  }
-);
-
-
-/**
- * Returns a String value representing the result of calling ToNumber(value)
- * according to the effective locale and the formatting options of this
- * NumberFormat.
- */
-function formatNumber(formatter, value) {
-  // Spec treats -0 and +0 as 0.
-  var number = TO_NUMBER(value) + 0;
-
-  return %InternalNumberFormat(formatter, number);
-}
-
-
-AddBoundMethod(GlobalIntlNumberFormat, 'format', formatNumber, 1,
-               'numberformat', true);
-
-/**
- * Returns a string that matches LDML representation of the options object.
- */
-function toLDMLString(options) {
-  var getOption = getGetOption(options, 'dateformat');
-
-  var ldmlString = '';
-
-  var option = getOption('weekday', 'string', ['narrow', 'short', 'long']);
-  ldmlString += appendToLDMLString(
-      option, {narrow: 'EEEEE', short: 'EEE', long: 'EEEE'});
-
-  option = getOption('era', 'string', ['narrow', 'short', 'long']);
-  ldmlString += appendToLDMLString(
-      option, {narrow: 'GGGGG', short: 'GGG', long: 'GGGG'});
-
-  option = getOption('year', 'string', ['2-digit', 'numeric']);
-  ldmlString += appendToLDMLString(option, {'2-digit': 'yy', 'numeric': 'y'});
-
-  option = getOption('month', 'string',
-                     ['2-digit', 'numeric', 'narrow', 'short', 'long']);
-  ldmlString += appendToLDMLString(option, {'2-digit': 'MM', 'numeric': 'M',
-          'narrow': 'MMMMM', 'short': 'MMM', 'long': 'MMMM'});
-
-  option = getOption('day', 'string', ['2-digit', 'numeric']);
-  ldmlString += appendToLDMLString(
-      option, {'2-digit': 'dd', 'numeric': 'd'});
-
-  var hr12 = getOption('hour12', 'boolean');
-  option = getOption('hour', 'string', ['2-digit', 'numeric']);
-  if (IS_UNDEFINED(hr12)) {
-    ldmlString += appendToLDMLString(option, {'2-digit': 'jj', 'numeric': 'j'});
-  } else if (hr12 === true) {
-    ldmlString += appendToLDMLString(option, {'2-digit': 'hh', 'numeric': 'h'});
-  } else {
-    ldmlString += appendToLDMLString(option, {'2-digit': 'HH', 'numeric': 'H'});
-  }
-
-  option = getOption('minute', 'string', ['2-digit', 'numeric']);
-  ldmlString += appendToLDMLString(option, {'2-digit': 'mm', 'numeric': 'm'});
-
-  option = getOption('second', 'string', ['2-digit', 'numeric']);
-  ldmlString += appendToLDMLString(option, {'2-digit': 'ss', 'numeric': 's'});
-
-  option = getOption('timeZoneName', 'string', ['short', 'long']);
-  ldmlString += appendToLDMLString(option, {short: 'z', long: 'zzzz'});
-
-  return ldmlString;
-}
-
-
-/**
- * Returns either LDML equivalent of the current option or empty string.
- */
-function appendToLDMLString(option, pairs) {
-  if (!IS_UNDEFINED(option)) {
-    return pairs[option];
-  } else {
-    return '';
-  }
-}
-
-
-/**
- * Returns object that matches LDML representation of the date.
- */
-function fromLDMLString(ldmlString) {
-  // First remove '' quoted text, so we lose 'Uhr' strings.
-  ldmlString = %RegExpInternalReplace(GetQuotedStringRE(), ldmlString, '');
-
-  var options = {__proto__: null};
-  var match = %regexp_internal_match(/E{3,5}/, ldmlString);
-  options = appendToDateTimeObject(
-      options, 'weekday', match, {EEEEE: 'narrow', EEE: 'short', EEEE: 'long'});
-
-  match = %regexp_internal_match(/G{3,5}/, ldmlString);
-  options = appendToDateTimeObject(
-      options, 'era', match, {GGGGG: 'narrow', GGG: 'short', GGGG: 'long'});
-
-  match = %regexp_internal_match(/y{1,2}/, ldmlString);
-  options = appendToDateTimeObject(
-      options, 'year', match, {y: 'numeric', yy: '2-digit'});
-
-  match = %regexp_internal_match(/M{1,5}/, ldmlString);
-  options = appendToDateTimeObject(options, 'month', match, {MM: '2-digit',
-      M: 'numeric', MMMMM: 'narrow', MMM: 'short', MMMM: 'long'});
-
-  // Sometimes we get L instead of M for month - standalone name.
-  match = %regexp_internal_match(/L{1,5}/, ldmlString);
-  options = appendToDateTimeObject(options, 'month', match, {LL: '2-digit',
-      L: 'numeric', LLLLL: 'narrow', LLL: 'short', LLLL: 'long'});
-
-  match = %regexp_internal_match(/d{1,2}/, ldmlString);
-  options = appendToDateTimeObject(
-      options, 'day', match, {d: 'numeric', dd: '2-digit'});
-
-  match = %regexp_internal_match(/h{1,2}/, ldmlString);
-  if (match !== null) {
-    options['hour12'] = true;
-  }
-  options = appendToDateTimeObject(
-      options, 'hour', match, {h: 'numeric', hh: '2-digit'});
-
-  match = %regexp_internal_match(/H{1,2}/, ldmlString);
-  if (match !== null) {
-    options['hour12'] = false;
-  }
-  options = appendToDateTimeObject(
-      options, 'hour', match, {H: 'numeric', HH: '2-digit'});
-
-  match = %regexp_internal_match(/m{1,2}/, ldmlString);
-  options = appendToDateTimeObject(
-      options, 'minute', match, {m: 'numeric', mm: '2-digit'});
-
-  match = %regexp_internal_match(/s{1,2}/, ldmlString);
-  options = appendToDateTimeObject(
-      options, 'second', match, {s: 'numeric', ss: '2-digit'});
-
-  match = %regexp_internal_match(/z|zzzz/, ldmlString);
-  options = appendToDateTimeObject(
-      options, 'timeZoneName', match, {z: 'short', zzzz: 'long'});
-
-  return options;
-}
-
-
-function appendToDateTimeObject(options, option, match, pairs) {
-  if (IS_NULL(match)) {
-    if (!HAS_OWN_PROPERTY(options, option)) {
-      defineWEProperty(options, option, UNDEFINED);
-    }
-    return options;
-  }
-
-  var property = match[0];
-  defineWEProperty(options, option, pairs[property]);
-
-  return options;
-}
-
-
-/**
- * Returns options with at least default values in it.
- */
-function toDateTimeOptions(options, required, defaults) {
-  if (IS_UNDEFINED(options)) {
-    options = {__proto__: null};
-  } else {
-    options = TO_OBJECT(options);
-  }
-
-  options = %object_create(options);
-
-  var needsDefault = true;
-  if ((required === 'date' || required === 'any') &&
-      (!IS_UNDEFINED(options.weekday) || !IS_UNDEFINED(options.year) ||
-       !IS_UNDEFINED(options.month) || !IS_UNDEFINED(options.day))) {
-    needsDefault = false;
-  }
-
-  if ((required === 'time' || required === 'any') &&
-      (!IS_UNDEFINED(options.hour) || !IS_UNDEFINED(options.minute) ||
-       !IS_UNDEFINED(options.second))) {
-    needsDefault = false;
-  }
-
-  if (needsDefault && (defaults === 'date' || defaults === 'all')) {
-    %object_define_property(options, 'year', {value: 'numeric',
-                                              writable: true,
-                                              enumerable: true,
-                                              configurable: true});
-    %object_define_property(options, 'month', {value: 'numeric',
-                                               writable: true,
-                                               enumerable: true,
-                                               configurable: true});
-    %object_define_property(options, 'day', {value: 'numeric',
-                                             writable: true,
-                                             enumerable: true,
-                                             configurable: true});
-  }
-
-  if (needsDefault && (defaults === 'time' || defaults === 'all')) {
-    %object_define_property(options, 'hour', {value: 'numeric',
-                                              writable: true,
-                                              enumerable: true,
-                                              configurable: true});
-    %object_define_property(options, 'minute', {value: 'numeric',
-                                                writable: true,
-                                                enumerable: true,
-                                                configurable: true});
-    %object_define_property(options, 'second', {value: 'numeric',
-                                                writable: true,
-                                                enumerable: true,
-                                                configurable: true});
-  }
-
-  return options;
-}
-
-
-/**
- * Initializes the given object so it's a valid DateTimeFormat instance.
- * Useful for subclassing.
- */
-function CreateDateTimeFormat(locales, options) {
-  if (IS_UNDEFINED(options)) {
-    options = {__proto__: null};
-  }
-
-  var locale = resolveLocale('dateformat', locales, options);
-
-  options = toDateTimeOptions(options, 'any', 'date');
-
-  var getOption = getGetOption(options, 'dateformat');
-
-  // We implement only best fit algorithm, but still need to check
-  // if the formatMatcher values are in range.
-  var matcher = getOption('formatMatcher', 'string',
-                          ['basic', 'best fit'], 'best fit');
-
-  // Build LDML string for the skeleton that we pass to the formatter.
-  var ldmlString = toLDMLString(options);
-
-  // Filter out supported extension keys so we know what to put in resolved
-  // section later on.
-  // We need to pass calendar and number system to the method.
-  var tz = canonicalizeTimeZoneID(options.timeZone);
-
-  // ICU prefers options to be passed using -u- extension key/values, so
-  // we need to build that.
-  var internalOptions = {__proto__: null};
-  var extensionMap = parseExtension(locale.extension);
-
-  /**
-   * Map of Unicode extensions to option properties, and their values and types,
-   * for a date/time format.
-   */
-  var DATETIME_FORMAT_KEY_MAP = {
-    'ca': {'property': UNDEFINED, 'type': 'string'},
-    'nu': {'property': UNDEFINED, 'type': 'string'}
-  };
-
-  var extension = setOptions(options, extensionMap, DATETIME_FORMAT_KEY_MAP,
-                             getOption, internalOptions);
-
-  var requestedLocale = locale.locale + extension;
-  var resolved = %object_define_properties({__proto__: null}, {
-    calendar: {writable: true},
-    day: {writable: true},
-    era: {writable: true},
-    hour12: {writable: true},
-    hour: {writable: true},
-    locale: {writable: true},
-    minute: {writable: true},
-    month: {writable: true},
-    numberingSystem: {writable: true},
-    [patternSymbol]: {writable: true},
-    requestedLocale: {value: requestedLocale, writable: true},
-    second: {writable: true},
-    timeZone: {writable: true},
-    timeZoneName: {writable: true},
-    tz: {value: tz, writable: true},
-    weekday: {writable: true},
-    year: {writable: true}
-  });
-
-  var dateFormat = %CreateDateTimeFormat(
-    requestedLocale, {skeleton: ldmlString, timeZone: tz}, resolved);
-
-  if (resolved.timeZone === "Etc/Unknown") {
-    throw %make_range_error(kUnsupportedTimeZone, tz);
-  }
-
-  %MarkAsInitializedIntlObjectOfType(dateFormat, 'dateformat');
-  dateFormat[resolvedSymbol] = resolved;
-
-  return dateFormat;
-}
-
-
-/**
- * Constructs Intl.DateTimeFormat object given optional locales and options
- * parameters.
- *
- * @constructor
- */
-function DateTimeFormatConstructor() {
-  return IntlConstruct(this, GlobalIntlDateTimeFormat, CreateDateTimeFormat,
-                       new.target, arguments, true);
-}
-%SetCode(GlobalIntlDateTimeFormat, DateTimeFormatConstructor);
-
-
-/**
- * DateTimeFormat resolvedOptions method.
- */
-DEFINE_METHOD(
-  GlobalIntlDateTimeFormat.prototype,
-  resolvedOptions() {
-    var format = Unwrap(this, 'dateformat', GlobalIntlDateTimeFormat,
-                        'resolvedOptions', true);
-
-    /**
-     * Maps ICU calendar names to LDML/BCP47 types for key 'ca'.
-     * See typeMap section in third_party/icu/source/data/misc/keyTypeData.txt
-     * and
-     * http://www.unicode.org/repos/cldr/tags/latest/common/bcp47/calendar.xml
-     */
-    var ICU_CALENDAR_MAP = {
-      'gregorian': 'gregory',
-      'ethiopic-amete-alem': 'ethioaa'
-    };
-
-    var fromPattern = fromLDMLString(format[resolvedSymbol][patternSymbol]);
-    var userCalendar = ICU_CALENDAR_MAP[format[resolvedSymbol].calendar];
-    if (IS_UNDEFINED(userCalendar)) {
-      // No match means that ICU's legacy name is identical to LDML/BCP type.
-      userCalendar = format[resolvedSymbol].calendar;
-    }
-
-    var result = {
-      locale: format[resolvedSymbol].locale,
-      numberingSystem: format[resolvedSymbol].numberingSystem,
-      calendar: userCalendar,
-      timeZone: format[resolvedSymbol].timeZone
-    };
-
-    addWECPropertyIfDefined(result, 'timeZoneName', fromPattern.timeZoneName);
-    addWECPropertyIfDefined(result, 'era', fromPattern.era);
-    addWECPropertyIfDefined(result, 'year', fromPattern.year);
-    addWECPropertyIfDefined(result, 'month', fromPattern.month);
-    addWECPropertyIfDefined(result, 'day', fromPattern.day);
-    addWECPropertyIfDefined(result, 'weekday', fromPattern.weekday);
-    addWECPropertyIfDefined(result, 'hour12', fromPattern.hour12);
-    addWECPropertyIfDefined(result, 'hour', fromPattern.hour);
-    addWECPropertyIfDefined(result, 'minute', fromPattern.minute);
-    addWECPropertyIfDefined(result, 'second', fromPattern.second);
-
-    return result;
-  }
-);
-
-
-/**
- * Returns the subset of the given locale list for which this locale list
- * has a matching (possibly fallback) locale. Locales appear in the same
- * order in the returned list as in the input list.
- * Options are optional parameter.
- */
-DEFINE_METHOD(
-  GlobalIntlDateTimeFormat,
-  supportedLocalesOf(locales) {
-    return supportedLocalesOf('dateformat', locales, arguments[1]);
-  }
-);
-
-
-/**
- * Returns a String value representing the result of calling ToNumber(date)
- * according to the effective locale and the formatting options of this
- * DateTimeFormat.
- */
-function formatDate(formatter, dateValue) {
-  var dateMs;
-  if (IS_UNDEFINED(dateValue)) {
-    dateMs = %DateCurrentTime();
-  } else {
-    dateMs = TO_NUMBER(dateValue);
-  }
-
-  return %InternalDateFormat(formatter, dateMs);
-}
-
-DEFINE_METHOD(
-  GlobalIntlDateTimeFormat.prototype,
-  formatToParts(dateValue) {
-    REQUIRE_OBJECT_COERCIBLE(this, "Intl.DateTimeFormat.prototype.formatToParts");
-    if (!IS_OBJECT(this)) {
-      throw %make_type_error(kCalledOnNonObject, this);
-    }
-    if (!%IsInitializedIntlObjectOfType(this, 'dateformat')) {
-      throw %make_type_error(kIncompatibleMethodReceiver,
-                            'Intl.DateTimeFormat.prototype.formatToParts',
-                            this);
-    }
-    var dateMs;
-    if (IS_UNDEFINED(dateValue)) {
-      dateMs = %DateCurrentTime();
-    } else {
-      dateMs = TO_NUMBER(dateValue);
-    }
-
-    return %InternalDateFormatToParts(this, dateMs);
-  }
-);
-
-
-// Length is 1 as specified in ECMA 402 v2+
-AddBoundMethod(GlobalIntlDateTimeFormat, 'format', formatDate, 1, 'dateformat',
-               true);
-
-
-/**
- * Returns canonical Area/Location(/Location) name, or throws an exception
- * if the zone name is invalid IANA name.
- */
-function canonicalizeTimeZoneID(tzID) {
-  // Skip undefined zones.
-  if (IS_UNDEFINED(tzID)) {
-    return tzID;
-  }
-
-  // Convert zone name to string.
-  tzID = TO_STRING(tzID);
-
-  // Special case handling (UTC, GMT).
-  var upperID = %StringToUpperCaseIntl(tzID);
-  if (upperID === 'UTC' || upperID === 'GMT' ||
-      upperID === 'ETC/UTC' || upperID === 'ETC/GMT') {
-    return 'UTC';
-  }
-
-  // TODO(jshin): Add support for Etc/GMT[+-]([1-9]|1[0-2])
-
-  // We expect only _, '-' and / beside ASCII letters.
-  // All inputs should conform to Area/Location(/Location)* from now on.
-  var match = %regexp_internal_match(GetTimezoneNameCheckRE(), tzID);
-  if (IS_NULL(match)) throw %make_range_error(kExpectedTimezoneID, tzID);
-
-  var result = toTitleCaseTimezoneLocation(match[1]) + '/' +
-               toTitleCaseTimezoneLocation(match[2]);
-
-  if (!IS_UNDEFINED(match[3]) && 3 < match.length) {
-    var locations = %StringSplit(match[3], '/', kMaxUint32);
-    // The 1st element is empty. Starts with i=1.
-    for (var i = 1; i < locations.length; i++) {
-      result = result + '/' + toTitleCaseTimezoneLocation(locations[i]);
-    }
-  }
-
-  return result;
-}
-
-/**
- * Initializes the given object so it's a valid BreakIterator instance.
- * Useful for subclassing.
- */
-function CreateBreakIterator(locales, options) {
-  if (IS_UNDEFINED(options)) {
-    options = {__proto__: null};
-  }
-
-  var getOption = getGetOption(options, 'breakiterator');
-
-  var internalOptions = {__proto__: null};
-
-  defineWEProperty(internalOptions, 'type', getOption(
-    'type', 'string', ['character', 'word', 'sentence', 'line'], 'word'));
-
-  var locale = resolveLocale('breakiterator', locales, options);
-  var resolved = %object_define_properties({__proto__: null}, {
-    requestedLocale: {value: locale.locale, writable: true},
-    type: {value: internalOptions.type, writable: true},
-    locale: {writable: true}
-  });
-
-  var iterator = %CreateBreakIterator(locale.locale, internalOptions, resolved);
-
-  %MarkAsInitializedIntlObjectOfType(iterator, 'breakiterator');
-  iterator[resolvedSymbol] = resolved;
-
-  return iterator;
-}
-
-
-/**
- * Constructs Intl.v8BreakIterator object given optional locales and options
- * parameters.
- *
- * @constructor
- */
-function v8BreakIteratorConstructor() {
-  return IntlConstruct(this, GlobalIntlv8BreakIterator, CreateBreakIterator,
-                       new.target, arguments);
-}
-%SetCode(GlobalIntlv8BreakIterator, v8BreakIteratorConstructor);
-
-
-/**
- * BreakIterator resolvedOptions method.
- */
-DEFINE_METHOD(
-  GlobalIntlv8BreakIterator.prototype,
-  resolvedOptions() {
-    if (!IS_UNDEFINED(new.target)) {
-      throw %make_type_error(kOrdinaryFunctionCalledAsConstructor);
-    }
-
-    var segmenter = Unwrap(this, 'breakiterator', GlobalIntlv8BreakIterator,
-                           'resolvedOptions', false);
-
-    return {
-      locale: segmenter[resolvedSymbol].locale,
-      type: segmenter[resolvedSymbol].type
-    };
-  }
-);
-
-
-/**
- * Returns the subset of the given locale list for which this locale list
- * has a matching (possibly fallback) locale. Locales appear in the same
- * order in the returned list as in the input list.
- * Options are optional parameter.
- */
-DEFINE_METHOD(
-  GlobalIntlv8BreakIterator,
-  supportedLocalesOf(locales) {
-    if (!IS_UNDEFINED(new.target)) {
-      throw %make_type_error(kOrdinaryFunctionCalledAsConstructor);
-    }
-
-    return supportedLocalesOf('breakiterator', locales, arguments[1]);
-  }
-);
-
-
-/**
- * Adopts text to segment using the iterator. Old text, if present,
- * gets discarded.
- */
-function adoptText(iterator, text) {
-  %BreakIteratorAdoptText(iterator, TO_STRING(text));
-}
-
-
-/**
- * Returns index of the first break in the string and moves current pointer.
- */
-function first(iterator) {
-  return %BreakIteratorFirst(iterator);
-}
-
-
-/**
- * Returns the index of the next break and moves the pointer.
- */
-function next(iterator) {
-  return %BreakIteratorNext(iterator);
-}
-
-
-/**
- * Returns index of the current break.
- */
-function current(iterator) {
-  return %BreakIteratorCurrent(iterator);
-}
-
-
-/**
- * Returns type of the current break.
- */
-function breakType(iterator) {
-  return %BreakIteratorBreakType(iterator);
-}
-
-
-AddBoundMethod(GlobalIntlv8BreakIterator, 'adoptText', adoptText, 1,
-               'breakiterator');
-AddBoundMethod(GlobalIntlv8BreakIterator, 'first', first, 0, 'breakiterator');
-AddBoundMethod(GlobalIntlv8BreakIterator, 'next', next, 0, 'breakiterator');
-AddBoundMethod(GlobalIntlv8BreakIterator, 'current', current, 0,
-               'breakiterator');
-AddBoundMethod(GlobalIntlv8BreakIterator, 'breakType', breakType, 0,
-               'breakiterator');
-
-// Save references to Intl objects and methods we use, for added security.
-var savedObjects = {
-  'collator': GlobalIntlCollator,
-  'numberformat': GlobalIntlNumberFormat,
-  'dateformatall': GlobalIntlDateTimeFormat,
-  'dateformatdate': GlobalIntlDateTimeFormat,
-  'dateformattime': GlobalIntlDateTimeFormat
-};
-
-
-// Default (created with undefined locales and options parameters) collator,
-// number and date format instances. They'll be created as needed.
-var defaultObjects = {
-  'collator': UNDEFINED,
-  'numberformat': UNDEFINED,
-  'dateformatall': UNDEFINED,
-  'dateformatdate': UNDEFINED,
-  'dateformattime': UNDEFINED,
-};
-
-function clearDefaultObjects() {
-  defaultObjects['dateformatall'] = UNDEFINED;
-  defaultObjects['dateformatdate'] = UNDEFINED;
-  defaultObjects['dateformattime'] = UNDEFINED;
-}
-
-var date_cache_version = 0;
-
-function checkDateCacheCurrent() {
-  var new_date_cache_version = %DateCacheVersion();
-  if (new_date_cache_version == date_cache_version) {
-    return;
-  }
-  date_cache_version = new_date_cache_version;
-
-  clearDefaultObjects();
-}
-
-/**
- * Returns cached or newly created instance of a given service.
- * We cache only default instances (where no locales or options are provided).
- */
-function cachedOrNewService(service, locales, options, defaults) {
-  var useOptions = (IS_UNDEFINED(defaults)) ? options : defaults;
-  if (IS_UNDEFINED(locales) && IS_UNDEFINED(options)) {
-    checkDateCacheCurrent();
-    if (IS_UNDEFINED(defaultObjects[service])) {
-      defaultObjects[service] = new savedObjects[service](locales, useOptions);
-    }
-    return defaultObjects[service];
-  }
-  return new savedObjects[service](locales, useOptions);
-}
-
-function LocaleConvertCase(s, locales, isToUpper) {
-  // ECMA 402 section 13.1.2 steps 1 through 12.
-  var language;
-  // Optimize for the most common two cases. initializeLocaleList() can handle
-  // them as well, but it's rather slow accounting for over 60% of
-  // toLocale{U,L}Case() and about 40% of toLocale{U,L}Case("<locale>").
-  if (IS_UNDEFINED(locales)) {
-    language = GetDefaultICULocaleJS();
-  } else if (IS_STRING(locales)) {
-    language = canonicalizeLanguageTag(locales);
-  } else {
-    var locales = initializeLocaleList(locales);
-    language = locales.length > 0 ? locales[0] : GetDefaultICULocaleJS();
-  }
-
-  // StringSplit is slower than this.
-  var pos = %StringIndexOf(language, '-', 0);
-  if (pos !== -1) {
-    language = %_Call(StringSubstring, language, 0, pos);
-  }
-
-  return %StringLocaleConvertCase(s, isToUpper, language);
-}
-
-/**
- * Compares this and that, and returns less than 0, 0 or greater than 0 value.
- * Overrides the built-in method.
- */
-DEFINE_METHOD(
-  GlobalString.prototype,
-  localeCompare(that) {
-    if (IS_NULL_OR_UNDEFINED(this)) {
-      throw %make_type_error(kMethodInvokedOnNullOrUndefined);
-    }
-
-    var locales = arguments[1];
-    var options = arguments[2];
-    var collator = cachedOrNewService('collator', locales, options);
-    return compare(collator, this, that);
-  }
-);
-
-DEFINE_METHODS_LEN(
-  GlobalString.prototype,
-  {
-    toLocaleLowerCase(locales) {
-      REQUIRE_OBJECT_COERCIBLE(this, "String.prototype.toLocaleLowerCase");
-      return LocaleConvertCase(TO_STRING(this), locales, false);
-    }
-
-    toLocaleUpperCase(locales) {
-      REQUIRE_OBJECT_COERCIBLE(this, "String.prototype.toLocaleUpperCase");
-      return LocaleConvertCase(TO_STRING(this), locales, true);
-    }
-  },
-  0  /* Set function length of both methods. */
-);
-
-
-/**
- * Formats a Number object (this) using locale and options values.
- * If locale or options are omitted, defaults are used.
- */
-DEFINE_METHOD(
-  GlobalNumber.prototype,
-  toLocaleString() {
-    if (!(this instanceof GlobalNumber) && typeof(this) !== 'number') {
-      throw %make_type_error(kMethodInvokedOnWrongType, "Number");
-    }
-
-    var locales = arguments[0];
-    var options = arguments[1];
-    var numberFormat = cachedOrNewService('numberformat', locales, options);
-    return formatNumber(numberFormat, this);
-  }
-);
-
-
-/**
- * Returns actual formatted date or fails if date parameter is invalid.
- */
-function toLocaleDateTime(date, locales, options, required, defaults, service) {
-  if (!(date instanceof GlobalDate)) {
-    throw %make_type_error(kMethodInvokedOnWrongType, "Date");
-  }
-
-  var dateValue = TO_NUMBER(date);
-  if (NUMBER_IS_NAN(dateValue)) return 'Invalid Date';
-
-  var internalOptions = toDateTimeOptions(options, required, defaults);
-
-  var dateFormat =
-      cachedOrNewService(service, locales, options, internalOptions);
-
-  return formatDate(dateFormat, date);
-}
-
-
-/**
- * Formats a Date object (this) using locale and options values.
- * If locale or options are omitted, defaults are used - both date and time are
- * present in the output.
- */
-DEFINE_METHOD(
-  GlobalDate.prototype,
-  toLocaleString() {
-    var locales = arguments[0];
-    var options = arguments[1];
-    return toLocaleDateTime(
-        this, locales, options, 'any', 'all', 'dateformatall');
-  }
-);
-
-
-/**
- * Formats a Date object (this) using locale and options values.
- * If locale or options are omitted, defaults are used - only date is present
- * in the output.
- */
-DEFINE_METHOD(
-  GlobalDate.prototype,
-  toLocaleDateString() {
-    var locales = arguments[0];
-    var options = arguments[1];
-    return toLocaleDateTime(
-        this, locales, options, 'date', 'date', 'dateformatdate');
-  }
-);
-
-
-/**
- * Formats a Date object (this) using locale and options values.
- * If locale or options are omitted, defaults are used - only time is present
- * in the output.
- */
-DEFINE_METHOD(
-  GlobalDate.prototype,
-  toLocaleTimeString() {
-    var locales = arguments[0];
-    var options = arguments[1];
-    return toLocaleDateTime(
-        this, locales, options, 'time', 'time', 'dateformattime');
-  }
-);
-
-})
diff --git a/src/v8/src/js/macros.py b/src/v8/src/js/macros.py
deleted file mode 100644
index 75f01e3..0000000
--- a/src/v8/src/js/macros.py
+++ /dev/null
@@ -1,85 +0,0 @@
-# Copyright 2006-2009 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.
-
-# Dictionary that is passed as defines for js2c.py.
-# Used for defines that must be defined for all native JS files.
-
-define NONE        = 0;
-define READ_ONLY   = 1;
-define DONT_ENUM   = 2;
-define DONT_DELETE = 4;
-
-# 2^53 - 1
-define kMaxSafeInteger = 9007199254740991;
-
-# 2^32 - 1
-define kMaxUint32 = 4294967295;
-
-# Type query macros.
-#
-# Note: We have special support for typeof(foo) === 'bar' in the compiler.
-#       It will *not* generate a runtime typeof call for the most important
-#       values of 'bar'.
-macro IS_ARRAY(arg)             = (%_IsArray(arg));
-macro IS_FUNCTION(arg)          = (%IsFunction(arg));
-macro IS_NULL(arg)              = (arg === null);
-macro IS_NULL_OR_UNDEFINED(arg) = (arg == null);
-macro IS_NUMBER(arg)            = (typeof(arg) === 'number');
-macro IS_STRING(arg)            = (typeof(arg) === 'string');
-macro IS_SYMBOL(arg)            = (typeof(arg) === 'symbol');
-macro IS_UNDEFINED(arg)         = (arg === (void 0));
-macro IS_WEAKMAP(arg)           = (%_IsJSWeakMap(arg));
-macro IS_WEAKSET(arg)           = (%_IsJSWeakSet(arg));
-
-# Macro for ES queries of the type: "Type(O) is Object."
-macro IS_RECEIVER(arg) = (%_IsJSReceiver(arg));
-
-# Macro for ES queries of the type: "IsCallable(O)"
-macro IS_CALLABLE(arg) = (typeof(arg) === 'function');
-
-# Macro for ES RequireObjectCoercible
-# https://tc39.github.io/ecma262/#sec-requireobjectcoercible
-# Throws a TypeError of the form "[functionName] called on null or undefined".
-macro REQUIRE_OBJECT_COERCIBLE(arg, functionName) = if (IS_NULL(%IS_VAR(arg)) || IS_UNDEFINED(arg)) throw %make_type_error(kCalledOnNullOrUndefined, functionName);
-
-# Inline macros. Use %IS_VAR to make sure arg is evaluated only once.
-macro TO_BOOLEAN(arg) = (!!(arg));
-macro TO_INTEGER(arg) = (%_ToInteger(arg));
-macro TO_LENGTH(arg) = (%_ToLength(arg));
-macro TO_STRING(arg) = (%_ToString(arg));
-macro TO_NUMBER(arg) = (%_ToNumber(arg));
-macro TO_OBJECT(arg) = (%_ToObject(arg));
-macro HAS_OWN_PROPERTY(obj, key) = (%_Call(ObjectHasOwnProperty, obj, key));
-
-macro DEFINE_METHODS_LEN(obj, class_def, len) = %DefineMethodsInternal(obj, class class_def, len);
-macro DEFINE_METHOD_LEN(obj, method_def, len) = %DefineMethodsInternal(obj, class { method_def }, len);
-macro DEFINE_METHODS(obj, class_def) = DEFINE_METHODS_LEN(obj, class_def, -1);
-macro DEFINE_METHOD(obj, method_def) = DEFINE_METHOD_LEN(obj, method_def, -1);
-
-# Constants.  The compiler constant folds them.
-define INFINITY = (1/0);
-define UNDEFINED = (void 0);
diff --git a/src/v8/src/js/messages.js b/src/v8/src/js/messages.js
deleted file mode 100644
index aebd37a..0000000
--- a/src/v8/src/js/messages.js
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// -------------------------------------------------------------------
-
-(function(global, utils) {
-
-"use strict";
-
-%CheckIsBootstrapping();
-
-// -------------------------------------------------------------------
-// Imports
-
-var Script = utils.ImportNow("Script");
-
-// -------------------------------------------------------------------
-// Script
-
-/**
- * Get information on a specific source position.
- * Returns an object with the following following properties:
- *   script     : script object for the source
- *   line       : source line number
- *   column     : source column within the line
- *   position   : position within the source
- *   sourceText : a string containing the current line
- * @param {number} position The source position
- * @param {boolean} include_resource_offset Set to true to have the resource
- *     offset added to the location
- * @return If line is negative or not in the source null is returned.
- */
-function ScriptLocationFromPosition(position,
-                                    include_resource_offset) {
-  return %ScriptPositionInfo(this, position, !!include_resource_offset);
-}
-
-
-/**
- * If sourceURL comment is available returns sourceURL comment contents.
- * Otherwise, script name is returned. See
- * http://fbug.googlecode.com/svn/branches/firebug1.1/docs/ReleaseNotes_1.1.txt
- * and Source Map Revision 3 proposal for details on using //# sourceURL and
- * deprecated //@ sourceURL comment to identify scripts that don't have name.
- *
- * @return {?string} script name if present, value for //# sourceURL comment or
- * deprecated //@ sourceURL comment otherwise.
- */
-function ScriptNameOrSourceURL() {
-  // Keep in sync with Script::GetNameOrSourceURL.
-  if (this.source_url) return this.source_url;
-  return this.name;
-}
-
-
-utils.SetUpLockedPrototype(Script, [
-    "source",
-    "name",
-    "source_url",
-    "source_mapping_url",
-    "line_offset",
-    "column_offset"
-  ], [
-    "locationFromPosition", ScriptLocationFromPosition,
-    "nameOrSourceURL", ScriptNameOrSourceURL,
-  ]
-);
-
-});
diff --git a/src/v8/src/js/prologue.js b/src/v8/src/js/prologue.js
deleted file mode 100644
index 32f8266..0000000
--- a/src/v8/src/js/prologue.js
+++ /dev/null
@@ -1,215 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-(function(global, utils, extrasUtils) {
-
-"use strict";
-
-%CheckIsBootstrapping();
-
-// -----------------------------------------------------------------------
-// Utils
-
-var imports = UNDEFINED;
-var exports_container = %ExportFromRuntime({});
-
-// Export to other scripts.
-function Export(f) {
-  f(exports_container);
-}
-
-
-// Import from other scripts. The actual importing happens in PostNatives so
-// that we can import from scripts executed later. However, that means that
-// the import is not available until the very end. If the import needs to be
-// available immediately, use ImportNow.
-function Import(f) {
-  f.next = imports;
-  imports = f;
-}
-
-
-// Import immediately from exports of previous scripts. We need this for
-// functions called during bootstrapping. Hooking up imports in PostNatives
-// would be too late.
-function ImportNow(name) {
-  return exports_container[name];
-}
-
-
-function InstallConstants(object, constants) {
-  %CheckIsBootstrapping();
-  %OptimizeObjectForAddingMultipleProperties(object, constants.length >> 1);
-  var attributes = DONT_ENUM | DONT_DELETE | READ_ONLY;
-  for (var i = 0; i < constants.length; i += 2) {
-    var name = constants[i];
-    var k = constants[i + 1];
-    %AddNamedProperty(object, name, k, attributes);
-  }
-  %ToFastProperties(object);
-}
-
-
-// Prevents changes to the prototype of a built-in function.
-// The "prototype" property of the function object is made non-configurable,
-// and the prototype object is made non-extensible. The latter prevents
-// changing the __proto__ property.
-function SetUpLockedPrototype(
-    constructor, fields, methods) {
-  %CheckIsBootstrapping();
-  var prototype = constructor.prototype;
-  // Install functions first, because this function is used to initialize
-  // PropertyDescriptor itself.
-  var property_count = (methods.length >> 1) + (fields ? fields.length : 0);
-  if (property_count >= 4) {
-    %OptimizeObjectForAddingMultipleProperties(prototype, property_count);
-  }
-  if (fields) {
-    for (var i = 0; i < fields.length; i++) {
-      %AddNamedProperty(prototype, fields[i],
-                        UNDEFINED, DONT_ENUM | DONT_DELETE);
-    }
-  }
-  for (var i = 0; i < methods.length; i += 2) {
-    var key = methods[i];
-    var f = methods[i + 1];
-    %AddNamedProperty(prototype, key, f, DONT_ENUM | DONT_DELETE | READ_ONLY);
-    %SetNativeFlag(f);
-  }
-  %InternalSetPrototype(prototype, null);
-  %ToFastProperties(prototype);
-}
-
-
-// -----------------------------------------------------------------------
-// To be called by bootstrapper
-
-function PostNatives(utils) {
-  %CheckIsBootstrapping();
-
-  for ( ; !IS_UNDEFINED(imports); imports = imports.next) {
-    imports(exports_container);
-  }
-
-  exports_container = UNDEFINED;
-  utils.Export = UNDEFINED;
-  utils.Import = UNDEFINED;
-  utils.ImportNow = UNDEFINED;
-  utils.PostNatives = UNDEFINED;
-}
-
-// ----------------------------------------------------------------------------
-// Object
-
-var iteratorSymbol = ImportNow("iterator_symbol");
-
-// ES6 7.3.9
-function GetMethod(obj, p) {
-  var func = obj[p];
-  if (IS_NULL_OR_UNDEFINED(func)) return UNDEFINED;
-  if (IS_CALLABLE(func)) return func;
-  throw %make_type_error(kCalledNonCallable, typeof func);
-}
-
-// ----------------------------------------------------------------------------
-// Iterator related spec functions.
-
-// ES6 7.4.1 GetIterator(obj, method)
-function GetIterator(obj, method) {
-  if (IS_UNDEFINED(method)) {
-    method = obj[iteratorSymbol];
-  }
-  if (!IS_CALLABLE(method)) {
-    throw %make_type_error(kNotIterable, obj);
-  }
-  var iterator = %_Call(method, obj);
-  if (!IS_RECEIVER(iterator)) {
-    throw %make_type_error(kNotAnIterator, iterator);
-  }
-  return iterator;
-}
-
-
-exports_container.GetIterator = GetIterator;
-exports_container.GetMethod = GetMethod;
-
-
-// -----------------------------------------------------------------------
-
-%OptimizeObjectForAddingMultipleProperties(utils, 14);
-
-utils.Import = Import;
-utils.ImportNow = ImportNow;
-utils.Export = Export;
-utils.InstallConstants = InstallConstants;
-utils.SetUpLockedPrototype = SetUpLockedPrototype;
-utils.PostNatives = PostNatives;
-
-%ToFastProperties(utils);
-
-// -----------------------------------------------------------------------
-
-%OptimizeObjectForAddingMultipleProperties(extrasUtils, 11);
-
-extrasUtils.logStackTrace = function logStackTrace() {
-  %DebugTrace();
-};
-
-extrasUtils.log = function log() {
-  let message = '';
-  for (const arg of arguments) {
-    message += arg;
-  }
-
-  %GlobalPrint(message);
-};
-
-// Extras need the ability to store private state on their objects without
-// exposing it to the outside world.
-
-extrasUtils.createPrivateSymbol = function createPrivateSymbol(name) {
-  return %CreatePrivateSymbol(name);
-};
-
-// These functions are key for safe meta-programming:
-// http://wiki.ecmascript.org/doku.php?id=conventions:safe_meta_programming
-//
-// Technically they could all be derived from combinations of
-// Function.prototype.{bind,call,apply} but that introduces lots of layers of
-// indirection and slowness given how un-optimized bind is.
-
-extrasUtils.simpleBind = function simpleBind(func, thisArg) {
-  return function(...args) {
-    return %reflect_apply(func, thisArg, args);
-  };
-};
-
-extrasUtils.uncurryThis = function uncurryThis(func) {
-  return function(thisArg, ...args) {
-    return %reflect_apply(func, thisArg, args);
-  };
-};
-
-// We pass true to trigger the debugger's on exception handler.
-extrasUtils.rejectPromise = function rejectPromise(promise, reason) {
-  %promise_internal_reject(promise, reason, true);
-}
-
-extrasUtils.markPromiseAsHandled = function markPromiseAsHandled(promise) {
-  %PromiseMarkAsHandled(promise);
-};
-
-extrasUtils.promiseState = function promiseState(promise) {
-  return %PromiseStatus(promise);
-};
-
-// [[PromiseState]] values (for extrasUtils.promiseState())
-// These values should be kept in sync with PromiseStatus in globals.h
-extrasUtils.kPROMISE_PENDING = 0;
-extrasUtils.kPROMISE_FULFILLED = 1;
-extrasUtils.kPROMISE_REJECTED = 2;
-
-%ToFastProperties(extrasUtils);
-
-})
diff --git a/src/v8/src/js/spread.js b/src/v8/src/js/spread.js
deleted file mode 100644
index 0b56ca7..0000000
--- a/src/v8/src/js/spread.js
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-(function(global, utils) {
-
-"use strict";
-
-// -------------------------------------------------------------------
-// Imports
-var InternalArray = utils.InternalArray;
-
-// -------------------------------------------------------------------
-
-function SpreadArguments() {
-  var count = arguments.length;
-  var args = new InternalArray();
-
-  for (var i = 0; i < count; ++i) {
-    var array = arguments[i];
-    var length = array.length;
-    for (var j = 0; j < length; ++j) {
-      args.push(array[j]);
-    }
-  }
-
-  return args;
-}
-
-
-function SpreadIterable(collection) {
-  if (IS_NULL_OR_UNDEFINED(collection)) {
-    throw %make_type_error(kNotIterable, collection);
-  }
-
-  var args = new InternalArray();
-  for (var value of collection) {
-    args.push(value);
-  }
-  return args;
-}
-
-// ----------------------------------------------------------------------------
-// Exports
-
-%InstallToContext([
-  "spread_arguments", SpreadArguments,
-  "spread_iterable", SpreadIterable,
-]);
-
-})
diff --git a/src/v8/src/js/typedarray.js b/src/v8/src/js/typedarray.js
deleted file mode 100644
index 7fa638f..0000000
--- a/src/v8/src/js/typedarray.js
+++ /dev/null
@@ -1,427 +0,0 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-(function(global, utils) {
-
-"use strict";
-
-%CheckIsBootstrapping();
-
-// -------------------------------------------------------------------
-// Imports
-
-// array.js has to come before typedarray.js for this to work
-var ArrayToString = utils.ImportNow("ArrayToString");
-var GetIterator;
-var GetMethod;
-var GlobalArray = global.Array;
-var GlobalArrayBuffer = global.ArrayBuffer;
-var GlobalArrayBufferPrototype = GlobalArrayBuffer.prototype;
-var GlobalObject = global.Object;
-var InnerArrayJoin;
-var InnerArraySort;
-var InnerArrayToLocaleString;
-var InternalArray = utils.InternalArray;
-var MathMax = global.Math.max;
-var MathMin = global.Math.min;
-var iteratorSymbol = utils.ImportNow("iterator_symbol");
-var speciesSymbol = utils.ImportNow("species_symbol");
-var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
-
-macro TYPED_ARRAYS(FUNCTION)
-FUNCTION(Uint8Array, 1)
-FUNCTION(Int8Array, 1)
-FUNCTION(Uint16Array, 2)
-FUNCTION(Int16Array, 2)
-FUNCTION(Uint32Array, 4)
-FUNCTION(Int32Array, 4)
-FUNCTION(Float32Array, 4)
-FUNCTION(Float64Array, 8)
-FUNCTION(Uint8ClampedArray, 1)
-endmacro
-
-macro DECLARE_GLOBALS(NAME, SIZE)
-var GlobalNAME = global.NAME;
-endmacro
-
-TYPED_ARRAYS(DECLARE_GLOBALS)
-
-macro IS_ARRAYBUFFER(arg)
-(%_ClassOf(arg) === 'ArrayBuffer')
-endmacro
-
-macro IS_SHAREDARRAYBUFFER(arg)
-(%_ClassOf(arg) === 'SharedArrayBuffer')
-endmacro
-
-macro IS_TYPEDARRAY(arg)
-(%_IsTypedArray(arg))
-endmacro
-
-var GlobalTypedArray = %object_get_prototype_of(GlobalUint8Array);
-
-utils.Import(function(from) {
-  GetIterator = from.GetIterator;
-  GetMethod = from.GetMethod;
-  InnerArrayJoin = from.InnerArrayJoin;
-  InnerArraySort = from.InnerArraySort;
-  InnerArrayToLocaleString = from.InnerArrayToLocaleString;
-});
-
-// ES2015 7.3.20
-function SpeciesConstructor(object, defaultConstructor) {
-  var constructor = object.constructor;
-  if (IS_UNDEFINED(constructor)) {
-    return defaultConstructor;
-  }
-  if (!IS_RECEIVER(constructor)) {
-    throw %make_type_error(kConstructorNotReceiver);
-  }
-  var species = constructor[speciesSymbol];
-  if (IS_NULL_OR_UNDEFINED(species)) {
-    return defaultConstructor;
-  }
-  if (%IsConstructor(species)) {
-    return species;
-  }
-  throw %make_type_error(kSpeciesNotConstructor);
-}
-
-// --------------- Typed Arrays ---------------------
-
-// ES6 section 22.2.3.5.1 ValidateTypedArray ( O )
-function ValidateTypedArray(array, methodName) {
-  if (!IS_TYPEDARRAY(array)) throw %make_type_error(kNotTypedArray);
-
-  if (%_ArrayBufferViewWasNeutered(array))
-    throw %make_type_error(kDetachedOperation, methodName);
-}
-
-function TypedArrayDefaultConstructor(typedArray) {
-  switch (%_ClassOf(typedArray)) {
-macro TYPED_ARRAY_CONSTRUCTOR_CASE(NAME, ELEMENT_SIZE)
-    case "NAME":
-      return GlobalNAME;
-endmacro
-TYPED_ARRAYS(TYPED_ARRAY_CONSTRUCTOR_CASE)
-  }
-  // The TypeError should not be generated since all callers should
-  // have already called ValidateTypedArray.
-  throw %make_type_error(kIncompatibleMethodReceiver,
-                      "TypedArrayDefaultConstructor", this);
-}
-
-function TypedArrayCreate(constructor, arg0, arg1, arg2) {
-  if (IS_UNDEFINED(arg1)) {
-    var newTypedArray = new constructor(arg0);
-  } else {
-    var newTypedArray = new constructor(arg0, arg1, arg2);
-  }
-  ValidateTypedArray(newTypedArray, "TypedArrayCreate");
-  if (IS_NUMBER(arg0) && %_TypedArrayGetLength(newTypedArray) < arg0) {
-    throw %make_type_error(kTypedArrayTooShort);
-  }
-  return newTypedArray;
-}
-
-function TypedArraySpeciesCreate(exemplar, arg0, arg1, arg2) {
-  var defaultConstructor = TypedArrayDefaultConstructor(exemplar);
-  var constructor = SpeciesConstructor(exemplar, defaultConstructor);
-  return TypedArrayCreate(constructor, arg0, arg1, arg2);
-}
-
-macro TYPED_ARRAY_CONSTRUCTOR(NAME, ELEMENT_SIZE)
-function NAMEConstructByIterable(obj, iterable, iteratorFn) {
-  if (%IterableToListCanBeElided(iterable)) {
-    // This .length access is unobservable, because it being observable would
-    // mean that iteration has side effects, and we wouldn't reach this path.
-    %typed_array_construct_by_array_like(
-        obj, iterable, iterable.length, ELEMENT_SIZE);
-  } else {
-    var list = new InternalArray();
-    // Reading the Symbol.iterator property of iterable twice would be
-    // observable with getters, so instead, we call the function which
-    // was already looked up, and wrap it in another iterable. The
-    // __proto__ of the new iterable is set to null to avoid any chance
-    // of modifications to Object.prototype being observable here.
-    var iterator = %_Call(iteratorFn, iterable);
-    var newIterable = {
-      __proto__: null
-    };
-    // TODO(littledan): Computed properties don't work yet in nosnap.
-    // Rephrase when they do.
-    newIterable[iteratorSymbol] = function() { return iterator; }
-    for (var value of newIterable) {
-      list.push(value);
-    }
-    %typed_array_construct_by_array_like(obj, list, list.length, ELEMENT_SIZE);
-  }
-}
-
-// ES#sec-typedarray-typedarray TypedArray ( typedArray )
-function NAMEConstructByTypedArray(obj, typedArray) {
-  // TODO(littledan): Throw on detached typedArray
-  var srcData = %TypedArrayGetBuffer(typedArray);
-  var length = %_TypedArrayGetLength(typedArray);
-  var byteLength = %_ArrayBufferViewGetByteLength(typedArray);
-  var newByteLength = length * ELEMENT_SIZE;
-  %typed_array_construct_by_array_like(obj, typedArray, length, ELEMENT_SIZE);
-  // The spec requires that constructing a typed array using a SAB-backed typed
-  // array use the ArrayBuffer constructor, not the species constructor. See
-  // https://tc39.github.io/ecma262/#sec-typedarray-typedarray.
-  var bufferConstructor = IS_SHAREDARRAYBUFFER(srcData)
-                            ? GlobalArrayBuffer
-                            : SpeciesConstructor(srcData, GlobalArrayBuffer);
-  var prototype = bufferConstructor.prototype;
-  // TODO(littledan): Use the right prototype based on bufferConstructor's realm
-  if (IS_RECEIVER(prototype) && prototype !== GlobalArrayBufferPrototype) {
-    %InternalSetPrototype(%TypedArrayGetBuffer(obj), prototype);
-  }
-}
-
-function NAMEConstructor(arg1, arg2, arg3) {
-  if (!IS_UNDEFINED(new.target)) {
-    if (IS_ARRAYBUFFER(arg1) || IS_SHAREDARRAYBUFFER(arg1)) {
-      %typed_array_construct_by_array_buffer(
-          this, arg1, arg2, arg3, ELEMENT_SIZE);
-    } else if (IS_TYPEDARRAY(arg1)) {
-      NAMEConstructByTypedArray(this, arg1);
-    } else if (IS_RECEIVER(arg1)) {
-      var iteratorFn = arg1[iteratorSymbol];
-      if (IS_UNDEFINED(iteratorFn)) {
-        %typed_array_construct_by_array_like(
-            this, arg1, arg1.length, ELEMENT_SIZE);
-      } else {
-        NAMEConstructByIterable(this, arg1, iteratorFn);
-      }
-    } else {
-      %typed_array_construct_by_length(this, arg1, ELEMENT_SIZE);
-    }
-  } else {
-    throw %make_type_error(kConstructorNotFunction, "NAME")
-  }
-}
-
-function NAMESubArray(begin, end) {
-  var beginInt = TO_INTEGER(begin);
-  if (!IS_UNDEFINED(end)) {
-    var endInt = TO_INTEGER(end);
-    var srcLength = %_TypedArrayGetLength(this);
-  } else {
-    var srcLength = %_TypedArrayGetLength(this);
-    var endInt = srcLength;
-  }
-
-  if (beginInt < 0) {
-    beginInt = MathMax(0, srcLength + beginInt);
-  } else {
-    beginInt = MathMin(beginInt, srcLength);
-  }
-
-  if (endInt < 0) {
-    endInt = MathMax(0, srcLength + endInt);
-  } else {
-    endInt = MathMin(endInt, srcLength);
-  }
-
-  if (endInt < beginInt) {
-    endInt = beginInt;
-  }
-
-  var newLength = endInt - beginInt;
-  var beginByteOffset =
-      %_ArrayBufferViewGetByteOffset(this) + beginInt * ELEMENT_SIZE;
-  return TypedArraySpeciesCreate(this, %TypedArrayGetBuffer(this),
-                                 beginByteOffset, newLength);
-}
-endmacro
-
-TYPED_ARRAYS(TYPED_ARRAY_CONSTRUCTOR)
-
-DEFINE_METHOD(
-  GlobalTypedArray.prototype,
-  subarray(begin, end) {
-    switch (%_ClassOf(this)) {
-macro TYPED_ARRAY_SUBARRAY_CASE(NAME, ELEMENT_SIZE)
-      case "NAME":
-        return %_Call(NAMESubArray, this, begin, end);
-endmacro
-TYPED_ARRAYS(TYPED_ARRAY_SUBARRAY_CASE)
-    }
-    throw %make_type_error(kIncompatibleMethodReceiver,
-                        "get %TypedArray%.prototype.subarray", this);
-  }
-);
-
-
-// The following functions cannot be made efficient on sparse arrays while
-// preserving the semantics, since the calls to the receiver function can add
-// or delete elements from the array.
-function InnerTypedArrayFilter(f, receiver, array, length, result) {
-  var result_length = 0;
-  for (var i = 0; i < length; i++) {
-    if (i in array) {
-      var element = array[i];
-      if (%_Call(f, receiver, element, i, array)) {
-        %CreateDataProperty(result, result_length, element);
-        result_length++;
-      }
-    }
-  }
-  return result;
-}
-
-
-// ES6 draft 07-15-13, section 22.2.3.9
-DEFINE_METHOD_LEN(
-  GlobalTypedArray.prototype,
-  filter(f, thisArg) {
-    ValidateTypedArray(this, "%TypeArray%.prototype.filter");
-
-    var length = %_TypedArrayGetLength(this);
-    if (!IS_CALLABLE(f)) throw %make_type_error(kCalledNonCallable, f);
-    var result = new InternalArray();
-    InnerTypedArrayFilter(f, thisArg, this, length, result);
-    var captured = result.length;
-    var output = TypedArraySpeciesCreate(this, captured);
-    for (var i = 0; i < captured; i++) {
-      output[i] = result[i];
-    }
-    return output;
-  },
-  1  /* Set function length. */
-);
-
-// ES6 draft 05-18-15, section 22.2.3.25
-DEFINE_METHOD(
-  GlobalTypedArray.prototype,
-  sort(comparefn) {
-    ValidateTypedArray(this, "%TypedArray%.prototype.sort");
-
-    if (!IS_UNDEFINED(comparefn) && !IS_CALLABLE(comparefn)) {
-      throw %make_type_error(kBadSortComparisonFunction, comparefn);
-    }
-
-    var length = %_TypedArrayGetLength(this);
-
-    if (IS_UNDEFINED(comparefn)) {
-      return %TypedArraySortFast(this);
-    }
-
-    return InnerArraySort(this, length, comparefn);
-  }
-);
-
-
-// ES6 section 22.2.3.27
-DEFINE_METHOD(
-  GlobalTypedArray.prototype,
-  toLocaleString() {
-    ValidateTypedArray(this, "%TypedArray%.prototype.toLocaleString");
-
-    var length = %_TypedArrayGetLength(this);
-
-    return InnerArrayToLocaleString(this, length);
-  }
-);
-
-
-// ES6 section 22.2.3.14
-DEFINE_METHOD(
-  GlobalTypedArray.prototype,
-  join(separator) {
-    ValidateTypedArray(this, "%TypedArray%.prototype.join");
-
-    var length = %_TypedArrayGetLength(this);
-
-    return InnerArrayJoin(separator, this, length);
-  }
-);
-
-
-// ES6 draft 08-24-14, section 22.2.2.2
-DEFINE_METHOD(
-  GlobalTypedArray,
-  of() {
-    var length = arguments.length;
-    var array = TypedArrayCreate(this, length);
-    for (var i = 0; i < length; i++) {
-      array[i] = arguments[i];
-    }
-    return array;
-  }
-);
-
-
-// ES#sec-iterabletoarraylike Runtime Semantics: IterableToArrayLike( items )
-function IterableToArrayLike(items) {
-  var iterable = GetMethod(items, iteratorSymbol);
-  if (!IS_UNDEFINED(iterable)) {
-    var internal_array = new InternalArray();
-    var i = 0;
-    for (var value of
-         { [iteratorSymbol]() { return GetIterator(items, iterable) } }) {
-      internal_array[i] = value;
-      i++;
-    }
-    var array = [];
-    %MoveArrayContents(internal_array, array);
-    return array;
-  }
-  return TO_OBJECT(items);
-}
-
-
-// ES#sec-%typedarray%.from
-// %TypedArray%.from ( source [ , mapfn [ , thisArg ] ] )
-DEFINE_METHOD_LEN(
-  GlobalTypedArray,
-  'from'(source, mapfn, thisArg) {
-    if (!%IsConstructor(this)) throw %make_type_error(kNotConstructor, this);
-    var mapping;
-    if (!IS_UNDEFINED(mapfn)) {
-      if (!IS_CALLABLE(mapfn)) throw %make_type_error(kCalledNonCallable, this);
-      mapping = true;
-    } else {
-      mapping = false;
-    }
-    var arrayLike = IterableToArrayLike(source);
-    var length = TO_LENGTH(arrayLike.length);
-    var targetObject = TypedArrayCreate(this, length);
-    var value, mappedValue;
-    for (var i = 0; i < length; i++) {
-      value = arrayLike[i];
-      if (mapping) {
-        mappedValue = %_Call(mapfn, thisArg, value, i);
-      } else {
-        mappedValue = value;
-      }
-      targetObject[i] = mappedValue;
-    }
-    return targetObject;
-  },
-  1  /* Set function length. */
-);
-
-// TODO(bmeurer): Migrate this to a proper builtin.
-function TypedArrayConstructor() {
-  throw %make_type_error(kConstructAbstractClass, "TypedArray");
-}
-
-// -------------------------------------------------------------------
-
-%SetCode(GlobalTypedArray, TypedArrayConstructor);
-
-
-%AddNamedProperty(GlobalTypedArray.prototype, "toString", ArrayToString,
-                  DONT_ENUM);
-
-
-macro SETUP_TYPED_ARRAY(NAME, ELEMENT_SIZE)
-  %SetCode(GlobalNAME, NAMEConstructor);
-endmacro
-
-TYPED_ARRAYS(SETUP_TYPED_ARRAY)
-
-})
diff --git a/src/v8/src/libplatform/default-background-task-runner.cc b/src/v8/src/libplatform/default-background-task-runner.cc
deleted file mode 100644
index b556b6c..0000000
--- a/src/v8/src/libplatform/default-background-task-runner.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2017 the V8 project 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 "src/libplatform/default-background-task-runner.h"
-
-#include "src/base/platform/mutex.h"
-#include "src/libplatform/worker-thread.h"
-
-namespace v8 {
-namespace platform {
-
-DefaultBackgroundTaskRunner::DefaultBackgroundTaskRunner(
-    uint32_t thread_pool_size) {
-  for (uint32_t i = 0; i < thread_pool_size; ++i) {
-    thread_pool_.push_back(base::make_unique<WorkerThread>(&queue_));
-  }
-}
-
-DefaultBackgroundTaskRunner::~DefaultBackgroundTaskRunner() {
-  // This destructor is needed because we have unique_ptr to the WorkerThreads,
-  // und the {WorkerThread} class is forward declared in the header file.
-}
-
-void DefaultBackgroundTaskRunner::Terminate() {
-  base::LockGuard<base::Mutex> guard(&lock_);
-  terminated_ = true;
-  queue_.Terminate();
-  // Clearing the thread pool lets all worker threads join.
-  thread_pool_.clear();
-}
-
-void DefaultBackgroundTaskRunner::PostTask(std::unique_ptr<Task> task) {
-  base::LockGuard<base::Mutex> guard(&lock_);
-  if (terminated_) return;
-  queue_.Append(std::move(task));
-}
-
-void DefaultBackgroundTaskRunner::PostDelayedTask(std::unique_ptr<Task> task,
-                                                  double delay_in_seconds) {
-  base::LockGuard<base::Mutex> guard(&lock_);
-  if (terminated_) return;
-  // There is no use case for this function on a background thread at the
-  // moment, but it is still part of the interface.
-  UNIMPLEMENTED();
-}
-
-void DefaultBackgroundTaskRunner::PostIdleTask(std::unique_ptr<IdleTask> task) {
-  // There are no idle background tasks.
-  UNREACHABLE();
-}
-
-bool DefaultBackgroundTaskRunner::IdleTasksEnabled() {
-  // There are no idle background tasks.
-  return false;
-}
-
-}  // namespace platform
-}  // namespace v8
diff --git a/src/v8/src/libplatform/default-background-task-runner.h b/src/v8/src/libplatform/default-background-task-runner.h
deleted file mode 100644
index ce2f7ef..0000000
--- a/src/v8/src/libplatform/default-background-task-runner.h
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_LIBPLATFORM_DEFAULT_BACKGROUND_TASK_RUNNER_H_
-#define V8_LIBPLATFORM_DEFAULT_BACKGROUND_TASK_RUNNER_H_
-
-#include "include/v8-platform.h"
-#include "src/libplatform/task-queue.h"
-
-namespace v8 {
-namespace platform {
-
-class Thread;
-class WorkerThread;
-
-class V8_PLATFORM_EXPORT DefaultBackgroundTaskRunner
-    : public NON_EXPORTED_BASE(TaskRunner) {
- public:
-  DefaultBackgroundTaskRunner(uint32_t thread_pool_size);
-
-  ~DefaultBackgroundTaskRunner();
-
-  void Terminate();
-
-  // v8::TaskRunner implementation.
-  void PostTask(std::unique_ptr<Task> task) override;
-
-  void PostDelayedTask(std::unique_ptr<Task> task,
-                       double delay_in_seconds) override;
-
-  void PostIdleTask(std::unique_ptr<IdleTask> task) override;
-
-  bool IdleTasksEnabled() override;
-
- private:
-  bool terminated_ = false;
-  base::Mutex lock_;
-  TaskQueue queue_;
-  std::vector<std::unique_ptr<WorkerThread>> thread_pool_;
-};
-
-}  // namespace platform
-}  // namespace v8
-#endif  // V8_LIBPLATFORM_DEFAULT_BACKGROUND_TASK_RUNNER_H_
diff --git a/src/v8/src/mips/assembler-mips-inl.h b/src/v8/src/mips/assembler-mips-inl.h
deleted file mode 100644
index 803c16b..0000000
--- a/src/v8/src/mips/assembler-mips-inl.h
+++ /dev/null
@@ -1,373 +0,0 @@
-
-// Copyright (c) 1994-2006 Sun Microsystems Inc.
-// 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.
-//
-// - Redistribution 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 Sun Microsystems or the names of 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.
-
-// The original source code covered by the above license above has been
-// modified significantly by Google Inc.
-// Copyright 2012 the V8 project authors. All rights reserved.
-
-
-#ifndef V8_MIPS_ASSEMBLER_MIPS_INL_H_
-#define V8_MIPS_ASSEMBLER_MIPS_INL_H_
-
-#include "src/mips/assembler-mips.h"
-
-#include "src/assembler.h"
-#include "src/debug/debug.h"
-#include "src/objects-inl.h"
-
-namespace v8 {
-namespace internal {
-
-
-bool CpuFeatures::SupportsCrankshaft() { return IsSupported(FPU); }
-
-bool CpuFeatures::SupportsWasmSimd128() { return IsSupported(MIPS_SIMD); }
-
-// -----------------------------------------------------------------------------
-// Operand and MemOperand.
-
-bool Operand::is_reg() const {
-  return rm_.is_valid();
-}
-
-int32_t Operand::immediate() const {
-  DCHECK(!is_reg());
-  DCHECK(!IsHeapObjectRequest());
-  return value_.immediate;
-}
-
-// -----------------------------------------------------------------------------
-// RelocInfo.
-
-void RelocInfo::apply(intptr_t delta) {
-  if (IsInternalReference(rmode_) || IsInternalReferenceEncoded(rmode_)) {
-    // Absolute code pointer inside code object moves with the code object.
-    byte* p = reinterpret_cast<byte*>(pc_);
-    Assembler::RelocateInternalReference(rmode_, p, delta);
-  }
-}
-
-
-Address RelocInfo::target_address() {
-  DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) || IsWasmCall(rmode_));
-  return Assembler::target_address_at(pc_, constant_pool_);
-}
-
-Address RelocInfo::target_address_address() {
-  DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) || IsWasmCall(rmode_) ||
-         rmode_ == EMBEDDED_OBJECT || rmode_ == EXTERNAL_REFERENCE);
-  // Read the address of the word containing the target_address in an
-  // instruction stream.
-  // The only architecture-independent user of this function is the serializer.
-  // The serializer uses it to find out how many raw bytes of instruction to
-  // output before the next target.
-  // For an instruction like LUI/ORI where the target bits are mixed into the
-  // instruction bits, the size of the target will be zero, indicating that the
-  // serializer should not step forward in memory after a target is resolved
-  // and written. In this case the target_address_address function should
-  // return the end of the instructions to be patched, allowing the
-  // deserializer to deserialize the instructions as raw bytes and put them in
-  // place, ready to be patched with the target. After jump optimization,
-  // that is the address of the instruction that follows J/JAL/JR/JALR
-  // instruction.
-  if (IsMipsArchVariant(kMips32r6)) {
-    // On R6 we don't move to the end of the instructions to be patched, but one
-    // instruction before, because if these instructions are at the end of the
-    // code object it can cause errors in the deserializer.
-    return reinterpret_cast<Address>(
-        pc_ +
-        (Assembler::kInstructionsFor32BitConstant - 1) * Assembler::kInstrSize);
-  } else {
-    return reinterpret_cast<Address>(
-        pc_ + Assembler::kInstructionsFor32BitConstant * Assembler::kInstrSize);
-  }
-}
-
-
-Address RelocInfo::constant_pool_entry_address() {
-  UNREACHABLE();
-}
-
-
-int RelocInfo::target_address_size() {
-  return Assembler::kSpecialTargetSize;
-}
-
-Address Assembler::target_address_from_return_address(Address pc) {
-  return pc - kCallTargetAddressOffset;
-}
-
-void Assembler::deserialization_set_special_target_at(
-    Isolate* isolate, Address instruction_payload, Code* code, Address target) {
-  if (IsMipsArchVariant(kMips32r6)) {
-    // On R6 the address location is shifted by one instruction
-    set_target_address_at(
-        isolate,
-        instruction_payload - (kInstructionsFor32BitConstant - 1) * kInstrSize,
-        code ? code->constant_pool() : nullptr, target);
-  } else {
-    set_target_address_at(
-        isolate,
-        instruction_payload - kInstructionsFor32BitConstant * kInstrSize,
-        code ? code->constant_pool() : nullptr, target);
-  }
-}
-
-void Assembler::set_target_internal_reference_encoded_at(Address pc,
-                                                         Address target) {
-  Instr instr1 = Assembler::instr_at(pc + 0 * Assembler::kInstrSize);
-  Instr instr2 = Assembler::instr_at(pc + 1 * Assembler::kInstrSize);
-  DCHECK(Assembler::IsLui(instr1));
-  DCHECK(Assembler::IsOri(instr2) || Assembler::IsJicOrJialc(instr2));
-  instr1 &= ~kImm16Mask;
-  instr2 &= ~kImm16Mask;
-  int32_t imm = reinterpret_cast<int32_t>(target);
-  DCHECK_EQ(imm & 3, 0);
-  if (Assembler::IsJicOrJialc(instr2)) {
-    // Encoded internal references are lui/jic load of 32-bit absolute address.
-    uint32_t lui_offset_u, jic_offset_u;
-    Assembler::UnpackTargetAddressUnsigned(imm, lui_offset_u, jic_offset_u);
-
-    Assembler::instr_at_put(pc + 0 * Assembler::kInstrSize,
-                            instr1 | lui_offset_u);
-    Assembler::instr_at_put(pc + 1 * Assembler::kInstrSize,
-                            instr2 | jic_offset_u);
-  } else {
-    // Encoded internal references are lui/ori load of 32-bit absolute address.
-    Assembler::instr_at_put(pc + 0 * Assembler::kInstrSize,
-                            instr1 | ((imm >> kLuiShift) & kImm16Mask));
-    Assembler::instr_at_put(pc + 1 * Assembler::kInstrSize,
-                            instr2 | (imm & kImm16Mask));
-  }
-
-  // Currently used only by deserializer, and all code will be flushed
-  // after complete deserialization, no need to flush on each reference.
-}
-
-
-void Assembler::deserialization_set_target_internal_reference_at(
-    Isolate* isolate, Address pc, Address target, RelocInfo::Mode mode) {
-  if (mode == RelocInfo::INTERNAL_REFERENCE_ENCODED) {
-    DCHECK(IsLui(instr_at(pc)));
-    set_target_internal_reference_encoded_at(pc, target);
-  } else {
-    DCHECK(mode == RelocInfo::INTERNAL_REFERENCE);
-    Memory::Address_at(pc) = target;
-  }
-}
-
-HeapObject* RelocInfo::target_object() {
-  DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
-  return HeapObject::cast(reinterpret_cast<Object*>(
-      Assembler::target_address_at(pc_, constant_pool_)));
-}
-
-Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
-  DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
-  return Handle<HeapObject>(reinterpret_cast<HeapObject**>(
-      Assembler::target_address_at(pc_, constant_pool_)));
-}
-
-void RelocInfo::set_target_object(HeapObject* target,
-                                  WriteBarrierMode write_barrier_mode,
-                                  ICacheFlushMode icache_flush_mode) {
-  DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
-  Assembler::set_target_address_at(target->GetIsolate(), pc_, constant_pool_,
-                                   reinterpret_cast<Address>(target),
-                                   icache_flush_mode);
-  if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != nullptr) {
-    host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(
-        host(), this, HeapObject::cast(target));
-    host()->GetHeap()->RecordWriteIntoCode(host(), this, target);
-  }
-}
-
-
-Address RelocInfo::target_external_reference() {
-  DCHECK(rmode_ == EXTERNAL_REFERENCE);
-  return Assembler::target_address_at(pc_, constant_pool_);
-}
-
-
-Address RelocInfo::target_internal_reference() {
-  if (rmode_ == INTERNAL_REFERENCE) {
-    return Memory::Address_at(pc_);
-  } else {
-    // Encoded internal references are lui/ori or lui/jic load of 32-bit
-    // absolute address.
-    DCHECK(rmode_ == INTERNAL_REFERENCE_ENCODED);
-    Instr instr1 = Assembler::instr_at(pc_ + 0 * Assembler::kInstrSize);
-    Instr instr2 = Assembler::instr_at(pc_ + 1 * Assembler::kInstrSize);
-    DCHECK(Assembler::IsLui(instr1));
-    DCHECK(Assembler::IsOri(instr2) || Assembler::IsJicOrJialc(instr2));
-    if (Assembler::IsJicOrJialc(instr2)) {
-      return reinterpret_cast<Address>(
-          Assembler::CreateTargetAddress(instr1, instr2));
-    }
-    int32_t imm = (instr1 & static_cast<int32_t>(kImm16Mask)) << kLuiShift;
-    imm |= (instr2 & static_cast<int32_t>(kImm16Mask));
-    return reinterpret_cast<Address>(imm);
-  }
-}
-
-
-Address RelocInfo::target_internal_reference_address() {
-  DCHECK(rmode_ == INTERNAL_REFERENCE || rmode_ == INTERNAL_REFERENCE_ENCODED);
-  return reinterpret_cast<Address>(pc_);
-}
-
-
-Address RelocInfo::target_runtime_entry(Assembler* origin) {
-  DCHECK(IsRuntimeEntry(rmode_));
-  return target_address();
-}
-
-void RelocInfo::set_target_runtime_entry(Isolate* isolate, Address target,
-                                         WriteBarrierMode write_barrier_mode,
-                                         ICacheFlushMode icache_flush_mode) {
-  DCHECK(IsRuntimeEntry(rmode_));
-  if (target_address() != target)
-    set_target_address(isolate, target, write_barrier_mode, icache_flush_mode);
-}
-
-void RelocInfo::WipeOut(Isolate* isolate) {
-  DCHECK(IsEmbeddedObject(rmode_) || IsCodeTarget(rmode_) ||
-         IsRuntimeEntry(rmode_) || IsExternalReference(rmode_) ||
-         IsInternalReference(rmode_) || IsInternalReferenceEncoded(rmode_));
-  if (IsInternalReference(rmode_)) {
-    Memory::Address_at(pc_) = nullptr;
-  } else if (IsInternalReferenceEncoded(rmode_)) {
-    Assembler::set_target_internal_reference_encoded_at(pc_, nullptr);
-  } else {
-    Assembler::set_target_address_at(isolate, pc_, constant_pool_, nullptr);
-  }
-}
-
-template <typename ObjectVisitor>
-void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) {
-  RelocInfo::Mode mode = rmode();
-  if (mode == RelocInfo::EMBEDDED_OBJECT) {
-    visitor->VisitEmbeddedPointer(host(), this);
-  } else if (RelocInfo::IsCodeTarget(mode)) {
-    visitor->VisitCodeTarget(host(), this);
-  } else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
-    visitor->VisitExternalReference(host(), this);
-  } else if (mode == RelocInfo::INTERNAL_REFERENCE ||
-             mode == RelocInfo::INTERNAL_REFERENCE_ENCODED) {
-    visitor->VisitInternalReference(host(), this);
-  } else if (RelocInfo::IsRuntimeEntry(mode)) {
-    visitor->VisitRuntimeEntry(host(), this);
-  }
-}
-
-// -----------------------------------------------------------------------------
-// Assembler.
-
-
-void Assembler::CheckBuffer() {
-  if (buffer_space() <= kGap) {
-    GrowBuffer();
-  }
-}
-
-
-void Assembler::CheckTrampolinePoolQuick(int extra_instructions) {
-  if (pc_offset() >= next_buffer_check_ - extra_instructions * kInstrSize) {
-    CheckTrampolinePool();
-  }
-}
-
-
-void Assembler::CheckForEmitInForbiddenSlot() {
-  if (!is_buffer_growth_blocked()) {
-    CheckBuffer();
-  }
-  if (IsPrevInstrCompactBranch()) {
-    // Nop instruction to precede a CTI in forbidden slot:
-    Instr nop = SPECIAL | SLL;
-    *reinterpret_cast<Instr*>(pc_) = nop;
-    pc_ += kInstrSize;
-
-    ClearCompactBranchState();
-  }
-}
-
-
-void Assembler::EmitHelper(Instr x, CompactBranchType is_compact_branch) {
-  if (IsPrevInstrCompactBranch()) {
-    if (Instruction::IsForbiddenAfterBranchInstr(x)) {
-      // Nop instruction to precede a CTI in forbidden slot:
-      Instr nop = SPECIAL | SLL;
-      *reinterpret_cast<Instr*>(pc_) = nop;
-      pc_ += kInstrSize;
-    }
-    ClearCompactBranchState();
-  }
-  *reinterpret_cast<Instr*>(pc_) = x;
-  pc_ += kInstrSize;
-  if (is_compact_branch == CompactBranchType::COMPACT_BRANCH) {
-    EmittedCompactBranchInstruction();
-  }
-  CheckTrampolinePoolQuick();
-}
-
-template <>
-inline void Assembler::EmitHelper(uint8_t x);
-
-template <typename T>
-void Assembler::EmitHelper(T x) {
-  *reinterpret_cast<T*>(pc_) = x;
-  pc_ += sizeof(x);
-  CheckTrampolinePoolQuick();
-}
-
-template <>
-void Assembler::EmitHelper(uint8_t x) {
-  *reinterpret_cast<uint8_t*>(pc_) = x;
-  pc_ += sizeof(x);
-  if (reinterpret_cast<intptr_t>(pc_) % kInstrSize == 0) {
-    CheckTrampolinePoolQuick();
-  }
-}
-
-void Assembler::emit(Instr x, CompactBranchType is_compact_branch) {
-  if (!is_buffer_growth_blocked()) {
-    CheckBuffer();
-  }
-  EmitHelper(x, is_compact_branch);
-}
-
-EnsureSpace::EnsureSpace(Assembler* assembler) { assembler->CheckBuffer(); }
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_MIPS_ASSEMBLER_MIPS_INL_H_
diff --git a/src/v8/src/mips/assembler-mips.cc b/src/v8/src/mips/assembler-mips.cc
deleted file mode 100644
index bd54034..0000000
--- a/src/v8/src/mips/assembler-mips.cc
+++ /dev/null
@@ -1,3953 +0,0 @@
-// Copyright (c) 1994-2006 Sun Microsystems Inc.
-// 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.
-//
-// - Redistribution 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 Sun Microsystems or the names of 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.
-
-// The original source code covered by the above license above has been
-// modified significantly by Google Inc.
-// Copyright 2012 the V8 project authors. All rights reserved.
-
-#include "src/mips/assembler-mips.h"
-
-#if V8_TARGET_ARCH_MIPS
-
-#include "src/base/bits.h"
-#include "src/base/cpu.h"
-#include "src/code-stubs.h"
-#include "src/mips/assembler-mips-inl.h"
-
-namespace v8 {
-namespace internal {
-
-// Get the CPU features enabled by the build. For cross compilation the
-// preprocessor symbols CAN_USE_FPU_INSTRUCTIONS
-// can be defined to enable FPU instructions when building the
-// snapshot.
-static unsigned CpuFeaturesImpliedByCompiler() {
-  unsigned answer = 0;
-#ifdef CAN_USE_FPU_INSTRUCTIONS
-  answer |= 1u << FPU;
-#endif  // def CAN_USE_FPU_INSTRUCTIONS
-
-  // If the compiler is allowed to use FPU then we can use FPU too in our code
-  // generation even when generating snapshots.  This won't work for cross
-  // compilation.
-#if defined(__mips__) && defined(__mips_hard_float) && __mips_hard_float != 0
-  answer |= 1u << FPU;
-#endif
-
-  return answer;
-}
-
-
-void CpuFeatures::ProbeImpl(bool cross_compile) {
-  supported_ |= CpuFeaturesImpliedByCompiler();
-
-  // Only use statically determined features for cross compile (snapshot).
-  if (cross_compile) return;
-
-  // If the compiler is allowed to use fpu then we can use fpu too in our
-  // code generation.
-#ifndef __mips__
-  // For the simulator build, use FPU.
-  supported_ |= 1u << FPU;
-#if defined(_MIPS_ARCH_MIPS32R6)
-  // FP64 mode is implied on r6.
-  supported_ |= 1u << FP64FPU;
-#endif
-#if defined(FPU_MODE_FP64)
-  supported_ |= 1u << FP64FPU;
-#endif
-#else
-  // Probe for additional features at runtime.
-  base::CPU cpu;
-  if (cpu.has_fpu()) supported_ |= 1u << FPU;
-#if defined(FPU_MODE_FPXX)
-  if (cpu.is_fp64_mode()) supported_ |= 1u << FP64FPU;
-#elif defined(FPU_MODE_FP64)
-  supported_ |= 1u << FP64FPU;
-  if (cpu.has_msa()) supported_ |= 1u << MIPS_SIMD;
-#endif
-#if defined(_MIPS_ARCH_MIPS32RX)
-  if (cpu.architecture() == 6) {
-    supported_ |= 1u << MIPSr6;
-  } else if (cpu.architecture() == 2) {
-    supported_ |= 1u << MIPSr1;
-    supported_ |= 1u << MIPSr2;
-  } else {
-    supported_ |= 1u << MIPSr1;
-  }
-#endif
-#endif
-}
-
-
-void CpuFeatures::PrintTarget() { }
-void CpuFeatures::PrintFeatures() { }
-
-
-int ToNumber(Register reg) {
-  DCHECK(reg.is_valid());
-  const int kNumbers[] = {
-    0,    // zero_reg
-    1,    // at
-    2,    // v0
-    3,    // v1
-    4,    // a0
-    5,    // a1
-    6,    // a2
-    7,    // a3
-    8,    // t0
-    9,    // t1
-    10,   // t2
-    11,   // t3
-    12,   // t4
-    13,   // t5
-    14,   // t6
-    15,   // t7
-    16,   // s0
-    17,   // s1
-    18,   // s2
-    19,   // s3
-    20,   // s4
-    21,   // s5
-    22,   // s6
-    23,   // s7
-    24,   // t8
-    25,   // t9
-    26,   // k0
-    27,   // k1
-    28,   // gp
-    29,   // sp
-    30,   // fp
-    31,   // ra
-  };
-  return kNumbers[reg.code()];
-}
-
-
-Register ToRegister(int num) {
-  DCHECK(num >= 0 && num < kNumRegisters);
-  const Register kRegisters[] = {
-    zero_reg,
-    at,
-    v0, v1,
-    a0, a1, a2, a3,
-    t0, t1, t2, t3, t4, t5, t6, t7,
-    s0, s1, s2, s3, s4, s5, s6, s7,
-    t8, t9,
-    k0, k1,
-    gp,
-    sp,
-    fp,
-    ra
-  };
-  return kRegisters[num];
-}
-
-
-// -----------------------------------------------------------------------------
-// Implementation of RelocInfo.
-
-const int RelocInfo::kApplyMask = RelocInfo::kCodeTargetMask |
-                                  1 << RelocInfo::INTERNAL_REFERENCE |
-                                  1 << RelocInfo::INTERNAL_REFERENCE_ENCODED;
-
-
-bool RelocInfo::IsCodedSpecially() {
-  // The deserializer needs to know whether a pointer is specially coded.  Being
-  // specially coded on MIPS means that it is a lui/ori instruction, and that is
-  // always the case inside code objects.
-  return true;
-}
-
-
-bool RelocInfo::IsInConstantPool() {
-  return false;
-}
-
-Address RelocInfo::embedded_address() const {
-  return Assembler::target_address_at(pc_, constant_pool_);
-}
-
-uint32_t RelocInfo::embedded_size() const {
-  return reinterpret_cast<uint32_t>(
-      Assembler::target_address_at(pc_, constant_pool_));
-}
-
-void RelocInfo::set_embedded_address(Isolate* isolate, Address address,
-                                     ICacheFlushMode flush_mode) {
-  Assembler::set_target_address_at(isolate, pc_, constant_pool_, address,
-                                   flush_mode);
-}
-
-void RelocInfo::set_embedded_size(Isolate* isolate, uint32_t size,
-                                  ICacheFlushMode flush_mode) {
-  Assembler::set_target_address_at(isolate, pc_, constant_pool_,
-                                   reinterpret_cast<Address>(size), flush_mode);
-}
-
-void RelocInfo::set_js_to_wasm_address(Isolate* isolate, Address address,
-                                       ICacheFlushMode icache_flush_mode) {
-  DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
-  set_embedded_address(isolate, address, icache_flush_mode);
-}
-
-Address RelocInfo::js_to_wasm_address() const {
-  DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
-  return embedded_address();
-}
-
-// -----------------------------------------------------------------------------
-// Implementation of Operand and MemOperand.
-// See assembler-mips-inl.h for inlined constructors.
-
-Operand::Operand(Handle<HeapObject> handle)
-    : rm_(no_reg), rmode_(RelocInfo::EMBEDDED_OBJECT) {
-  value_.immediate = reinterpret_cast<intptr_t>(handle.address());
-}
-
-Operand Operand::EmbeddedNumber(double value) {
-  int32_t smi;
-  if (DoubleToSmiInteger(value, &smi)) return Operand(Smi::FromInt(smi));
-  Operand result(0, RelocInfo::EMBEDDED_OBJECT);
-  result.is_heap_object_request_ = true;
-  result.value_.heap_object_request = HeapObjectRequest(value);
-  return result;
-}
-
-Operand Operand::EmbeddedCode(CodeStub* stub) {
-  Operand result(0, RelocInfo::CODE_TARGET);
-  result.is_heap_object_request_ = true;
-  result.value_.heap_object_request = HeapObjectRequest(stub);
-  return result;
-}
-
-MemOperand::MemOperand(Register rm, int32_t offset) : Operand(rm) {
-  offset_ = offset;
-}
-
-
-MemOperand::MemOperand(Register rm, int32_t unit, int32_t multiplier,
-                       OffsetAddend offset_addend) : Operand(rm) {
-  offset_ = unit * multiplier + offset_addend;
-}
-
-void Assembler::AllocateAndInstallRequestedHeapObjects(Isolate* isolate) {
-  for (auto& request : heap_object_requests_) {
-    Handle<HeapObject> object;
-    switch (request.kind()) {
-      case HeapObjectRequest::kHeapNumber:
-        object = isolate->factory()->NewHeapNumber(request.heap_number(),
-                                                   IMMUTABLE, TENURED);
-        break;
-      case HeapObjectRequest::kCodeStub:
-        request.code_stub()->set_isolate(isolate);
-        object = request.code_stub()->GetCode();
-        break;
-    }
-    Address pc = buffer_ + request.offset();
-    set_target_value_at(isolate, pc,
-                        reinterpret_cast<uint32_t>(object.location()));
-  }
-}
-
-// -----------------------------------------------------------------------------
-// Specific instructions, constants, and masks.
-
-static const int kNegOffset = 0x00008000;
-// addiu(sp, sp, 4) aka Pop() operation or part of Pop(r)
-// operations as post-increment of sp.
-const Instr kPopInstruction = ADDIU | (sp.code() << kRsShift) |
-                              (sp.code() << kRtShift) |
-                              (kPointerSize & kImm16Mask);  // NOLINT
-// addiu(sp, sp, -4) part of Push(r) operation as pre-decrement of sp.
-const Instr kPushInstruction = ADDIU | (sp.code() << kRsShift) |
-                               (sp.code() << kRtShift) |
-                               (-kPointerSize & kImm16Mask);  // NOLINT
-// sw(r, MemOperand(sp, 0))
-const Instr kPushRegPattern =
-    SW | (sp.code() << kRsShift) | (0 & kImm16Mask);  // NOLINT
-//  lw(r, MemOperand(sp, 0))
-const Instr kPopRegPattern =
-    LW | (sp.code() << kRsShift) | (0 & kImm16Mask);  // NOLINT
-
-const Instr kLwRegFpOffsetPattern =
-    LW | (fp.code() << kRsShift) | (0 & kImm16Mask);  // NOLINT
-
-const Instr kSwRegFpOffsetPattern =
-    SW | (fp.code() << kRsShift) | (0 & kImm16Mask);  // NOLINT
-
-const Instr kLwRegFpNegOffsetPattern =
-    LW | (fp.code() << kRsShift) | (kNegOffset & kImm16Mask);  // NOLINT
-
-const Instr kSwRegFpNegOffsetPattern =
-    SW | (fp.code() << kRsShift) | (kNegOffset & kImm16Mask);  // NOLINT
-// A mask for the Rt register for push, pop, lw, sw instructions.
-const Instr kRtMask = kRtFieldMask;
-const Instr kLwSwInstrTypeMask = 0xFFE00000;
-const Instr kLwSwInstrArgumentMask  = ~kLwSwInstrTypeMask;
-const Instr kLwSwOffsetMask = kImm16Mask;
-
-Assembler::Assembler(IsolateData isolate_data, void* buffer, int buffer_size)
-    : AssemblerBase(isolate_data, buffer, buffer_size),
-      scratch_register_list_(at.bit()) {
-  reloc_info_writer.Reposition(buffer_ + buffer_size_, pc_);
-
-  last_trampoline_pool_end_ = 0;
-  no_trampoline_pool_before_ = 0;
-  trampoline_pool_blocked_nesting_ = 0;
-  // We leave space (16 * kTrampolineSlotsSize)
-  // for BlockTrampolinePoolScope buffer.
-  next_buffer_check_ = FLAG_force_long_branches
-      ? kMaxInt : kMaxBranchOffset - kTrampolineSlotsSize * 16;
-  internal_trampoline_exception_ = false;
-  last_bound_pos_ = 0;
-
-  trampoline_emitted_ = FLAG_force_long_branches;
-  unbound_labels_count_ = 0;
-  block_buffer_growth_ = false;
-}
-
-void Assembler::GetCode(Isolate* isolate, CodeDesc* desc) {
-  EmitForbiddenSlotInstruction();
-  DCHECK(pc_ <= reloc_info_writer.pos());  // No overlap.
-
-  AllocateAndInstallRequestedHeapObjects(isolate);
-
-  // Set up code descriptor.
-  desc->buffer = buffer_;
-  desc->buffer_size = buffer_size_;
-  desc->instr_size = pc_offset();
-  desc->reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos();
-  desc->origin = this;
-  desc->constant_pool_size = 0;
-  desc->unwinding_info_size = 0;
-  desc->unwinding_info = nullptr;
-}
-
-
-void Assembler::Align(int m) {
-  DCHECK(m >= 4 && base::bits::IsPowerOfTwo(m));
-  EmitForbiddenSlotInstruction();
-  while ((pc_offset() & (m - 1)) != 0) {
-    nop();
-  }
-}
-
-
-void Assembler::CodeTargetAlign() {
-  // No advantage to aligning branch/call targets to more than
-  // single instruction, that I am aware of.
-  Align(4);
-}
-
-
-Register Assembler::GetRtReg(Instr instr) {
-  return Register::from_code((instr & kRtFieldMask) >> kRtShift);
-}
-
-
-Register Assembler::GetRsReg(Instr instr) {
-  return Register::from_code((instr & kRsFieldMask) >> kRsShift);
-}
-
-
-Register Assembler::GetRdReg(Instr instr) {
-  return Register::from_code((instr & kRdFieldMask) >> kRdShift);
-}
-
-
-uint32_t Assembler::GetRt(Instr instr) {
-  return (instr & kRtFieldMask) >> kRtShift;
-}
-
-
-uint32_t Assembler::GetRtField(Instr instr) {
-  return instr & kRtFieldMask;
-}
-
-
-uint32_t Assembler::GetRs(Instr instr) {
-  return (instr & kRsFieldMask) >> kRsShift;
-}
-
-
-uint32_t Assembler::GetRsField(Instr instr) {
-  return instr & kRsFieldMask;
-}
-
-
-uint32_t Assembler::GetRd(Instr instr) {
-  return  (instr & kRdFieldMask) >> kRdShift;
-}
-
-
-uint32_t Assembler::GetRdField(Instr instr) {
-  return  instr & kRdFieldMask;
-}
-
-
-uint32_t Assembler::GetSa(Instr instr) {
-  return (instr & kSaFieldMask) >> kSaShift;
-}
-
-
-uint32_t Assembler::GetSaField(Instr instr) {
-  return instr & kSaFieldMask;
-}
-
-
-uint32_t Assembler::GetOpcodeField(Instr instr) {
-  return instr & kOpcodeMask;
-}
-
-
-uint32_t Assembler::GetFunction(Instr instr) {
-  return (instr & kFunctionFieldMask) >> kFunctionShift;
-}
-
-
-uint32_t Assembler::GetFunctionField(Instr instr) {
-  return instr & kFunctionFieldMask;
-}
-
-
-uint32_t Assembler::GetImmediate16(Instr instr) {
-  return instr & kImm16Mask;
-}
-
-
-uint32_t Assembler::GetLabelConst(Instr instr) {
-  return instr & ~kImm16Mask;
-}
-
-
-bool Assembler::IsPop(Instr instr) {
-  return (instr & ~kRtMask) == kPopRegPattern;
-}
-
-
-bool Assembler::IsPush(Instr instr) {
-  return (instr & ~kRtMask) == kPushRegPattern;
-}
-
-
-bool Assembler::IsSwRegFpOffset(Instr instr) {
-  return ((instr & kLwSwInstrTypeMask) == kSwRegFpOffsetPattern);
-}
-
-
-bool Assembler::IsLwRegFpOffset(Instr instr) {
-  return ((instr & kLwSwInstrTypeMask) == kLwRegFpOffsetPattern);
-}
-
-
-bool Assembler::IsSwRegFpNegOffset(Instr instr) {
-  return ((instr & (kLwSwInstrTypeMask | kNegOffset)) ==
-          kSwRegFpNegOffsetPattern);
-}
-
-
-bool Assembler::IsLwRegFpNegOffset(Instr instr) {
-  return ((instr & (kLwSwInstrTypeMask | kNegOffset)) ==
-          kLwRegFpNegOffsetPattern);
-}
-
-
-// Labels refer to positions in the (to be) generated code.
-// There are bound, linked, and unused labels.
-//
-// Bound labels refer to known positions in the already
-// generated code. pos() is the position the label refers to.
-//
-// Linked labels refer to unknown positions in the code
-// to be generated; pos() is the position of the last
-// instruction using the label.
-
-// The link chain is terminated by a value in the instruction of -1,
-// which is an otherwise illegal value (branch -1 is inf loop).
-// The instruction 16-bit offset field addresses 32-bit words, but in
-// code is conv to an 18-bit value addressing bytes, hence the -4 value.
-
-const int kEndOfChain = -4;
-// Determines the end of the Jump chain (a subset of the label link chain).
-const int kEndOfJumpChain = 0;
-
-bool Assembler::IsMsaBranch(Instr instr) {
-  uint32_t opcode = GetOpcodeField(instr);
-  uint32_t rs_field = GetRsField(instr);
-  if (opcode == COP1) {
-    switch (rs_field) {
-      case BZ_V:
-      case BZ_B:
-      case BZ_H:
-      case BZ_W:
-      case BZ_D:
-      case BNZ_V:
-      case BNZ_B:
-      case BNZ_H:
-      case BNZ_W:
-      case BNZ_D:
-        return true;
-      default:
-        return false;
-    }
-  } else {
-    return false;
-  }
-}
-
-bool Assembler::IsBranch(Instr instr) {
-  uint32_t opcode   = GetOpcodeField(instr);
-  uint32_t rt_field = GetRtField(instr);
-  uint32_t rs_field = GetRsField(instr);
-  // Checks if the instruction is a branch.
-  bool isBranch =
-      opcode == BEQ || opcode == BNE || opcode == BLEZ || opcode == BGTZ ||
-      opcode == BEQL || opcode == BNEL || opcode == BLEZL || opcode == BGTZL ||
-      (opcode == REGIMM && (rt_field == BLTZ || rt_field == BGEZ ||
-                            rt_field == BLTZAL || rt_field == BGEZAL)) ||
-      (opcode == COP1 && rs_field == BC1) ||  // Coprocessor branch.
-      (opcode == COP1 && rs_field == BC1EQZ) ||
-      (opcode == COP1 && rs_field == BC1NEZ) || IsMsaBranch(instr);
-  if (!isBranch && IsMipsArchVariant(kMips32r6)) {
-    // All the 3 variants of POP10 (BOVC, BEQC, BEQZALC) and
-    // POP30 (BNVC, BNEC, BNEZALC) are branch ops.
-    isBranch |= opcode == POP10 || opcode == POP30 || opcode == BC ||
-                opcode == BALC ||
-                (opcode == POP66 && rs_field != 0) ||  // BEQZC
-                (opcode == POP76 && rs_field != 0);    // BNEZC
-  }
-  return isBranch;
-}
-
-
-bool Assembler::IsBc(Instr instr) {
-  uint32_t opcode = GetOpcodeField(instr);
-  // Checks if the instruction is a BC or BALC.
-  return opcode == BC || opcode == BALC;
-}
-
-
-bool Assembler::IsBzc(Instr instr) {
-  uint32_t opcode = GetOpcodeField(instr);
-  // Checks if the instruction is BEQZC or BNEZC.
-  return (opcode == POP66 && GetRsField(instr) != 0) ||
-         (opcode == POP76 && GetRsField(instr) != 0);
-}
-
-
-bool Assembler::IsEmittedConstant(Instr instr) {
-  uint32_t label_constant = GetLabelConst(instr);
-  return label_constant == 0;  // Emitted label const in reg-exp engine.
-}
-
-
-bool Assembler::IsBeq(Instr instr) {
-  return GetOpcodeField(instr) == BEQ;
-}
-
-
-bool Assembler::IsBne(Instr instr) {
-  return GetOpcodeField(instr) == BNE;
-}
-
-
-bool Assembler::IsBeqzc(Instr instr) {
-  uint32_t opcode = GetOpcodeField(instr);
-  return opcode == POP66 && GetRsField(instr) != 0;
-}
-
-
-bool Assembler::IsBnezc(Instr instr) {
-  uint32_t opcode = GetOpcodeField(instr);
-  return opcode == POP76 && GetRsField(instr) != 0;
-}
-
-
-bool Assembler::IsBeqc(Instr instr) {
-  uint32_t opcode = GetOpcodeField(instr);
-  uint32_t rs = GetRsField(instr);
-  uint32_t rt = GetRtField(instr);
-  return opcode == POP10 && rs != 0 && rs < rt;  // && rt != 0
-}
-
-
-bool Assembler::IsBnec(Instr instr) {
-  uint32_t opcode = GetOpcodeField(instr);
-  uint32_t rs = GetRsField(instr);
-  uint32_t rt = GetRtField(instr);
-  return opcode == POP30 && rs != 0 && rs < rt;  // && rt != 0
-}
-
-bool Assembler::IsJicOrJialc(Instr instr) {
-  uint32_t opcode = GetOpcodeField(instr);
-  uint32_t rs = GetRsField(instr);
-  return (opcode == POP66 || opcode == POP76) && rs == 0;
-}
-
-bool Assembler::IsJump(Instr instr) {
-  uint32_t opcode   = GetOpcodeField(instr);
-  uint32_t rt_field = GetRtField(instr);
-  uint32_t rd_field = GetRdField(instr);
-  uint32_t function_field = GetFunctionField(instr);
-  // Checks if the instruction is a jump.
-  return opcode == J || opcode == JAL ||
-      (opcode == SPECIAL && rt_field == 0 &&
-      ((function_field == JALR) || (rd_field == 0 && (function_field == JR))));
-}
-
-bool Assembler::IsJ(Instr instr) {
-  uint32_t opcode = GetOpcodeField(instr);
-  // Checks if the instruction is a jump.
-  return opcode == J;
-}
-
-
-bool Assembler::IsJal(Instr instr) {
-  return GetOpcodeField(instr) == JAL;
-}
-
-
-bool Assembler::IsJr(Instr instr) {
-  if (!IsMipsArchVariant(kMips32r6))  {
-    return GetOpcodeField(instr) == SPECIAL && GetFunctionField(instr) == JR;
-  } else {
-    return GetOpcodeField(instr) == SPECIAL &&
-        GetRdField(instr) == 0  && GetFunctionField(instr) == JALR;
-  }
-}
-
-
-bool Assembler::IsJalr(Instr instr) {
-  return GetOpcodeField(instr) == SPECIAL &&
-         GetRdField(instr) != 0  && GetFunctionField(instr) == JALR;
-}
-
-
-bool Assembler::IsLui(Instr instr) {
-  uint32_t opcode = GetOpcodeField(instr);
-  // Checks if the instruction is a load upper immediate.
-  return opcode == LUI;
-}
-
-
-bool Assembler::IsOri(Instr instr) {
-  uint32_t opcode = GetOpcodeField(instr);
-  // Checks if the instruction is a load upper immediate.
-  return opcode == ORI;
-}
-
-
-bool Assembler::IsNop(Instr instr, unsigned int type) {
-  // See Assembler::nop(type).
-  DCHECK_LT(type, 32);
-  uint32_t opcode = GetOpcodeField(instr);
-  uint32_t function = GetFunctionField(instr);
-  uint32_t rt = GetRt(instr);
-  uint32_t rd = GetRd(instr);
-  uint32_t sa = GetSa(instr);
-
-  // Traditional mips nop == sll(zero_reg, zero_reg, 0)
-  // When marking non-zero type, use sll(zero_reg, at, type)
-  // to avoid use of mips ssnop and ehb special encodings
-  // of the sll instruction.
-
-  Register nop_rt_reg = (type == 0) ? zero_reg : at;
-  bool ret = (opcode == SPECIAL && function == SLL &&
-              rd == static_cast<uint32_t>(ToNumber(zero_reg)) &&
-              rt == static_cast<uint32_t>(ToNumber(nop_rt_reg)) &&
-              sa == type);
-
-  return ret;
-}
-
-
-int32_t Assembler::GetBranchOffset(Instr instr) {
-  DCHECK(IsBranch(instr));
-  return (static_cast<int16_t>(instr & kImm16Mask)) << 2;
-}
-
-
-bool Assembler::IsLw(Instr instr) {
-  return (static_cast<uint32_t>(instr & kOpcodeMask) == LW);
-}
-
-
-int16_t Assembler::GetLwOffset(Instr instr) {
-  DCHECK(IsLw(instr));
-  return ((instr & kImm16Mask));
-}
-
-
-Instr Assembler::SetLwOffset(Instr instr, int16_t offset) {
-  DCHECK(IsLw(instr));
-
-  // We actually create a new lw instruction based on the original one.
-  Instr temp_instr = LW | (instr & kRsFieldMask) | (instr & kRtFieldMask)
-      | (offset & kImm16Mask);
-
-  return temp_instr;
-}
-
-
-bool Assembler::IsSw(Instr instr) {
-  return (static_cast<uint32_t>(instr & kOpcodeMask) == SW);
-}
-
-
-Instr Assembler::SetSwOffset(Instr instr, int16_t offset) {
-  DCHECK(IsSw(instr));
-  return ((instr & ~kImm16Mask) | (offset & kImm16Mask));
-}
-
-
-bool Assembler::IsAddImmediate(Instr instr) {
-  return ((instr & kOpcodeMask) == ADDIU);
-}
-
-
-Instr Assembler::SetAddImmediateOffset(Instr instr, int16_t offset) {
-  DCHECK(IsAddImmediate(instr));
-  return ((instr & ~kImm16Mask) | (offset & kImm16Mask));
-}
-
-
-bool Assembler::IsAndImmediate(Instr instr) {
-  return GetOpcodeField(instr) == ANDI;
-}
-
-
-static Assembler::OffsetSize OffsetSizeInBits(Instr instr) {
-  if (IsMipsArchVariant(kMips32r6)) {
-    if (Assembler::IsBc(instr)) {
-      return Assembler::OffsetSize::kOffset26;
-    } else if (Assembler::IsBzc(instr)) {
-      return Assembler::OffsetSize::kOffset21;
-    }
-  }
-  return Assembler::OffsetSize::kOffset16;
-}
-
-
-static inline int32_t AddBranchOffset(int pos, Instr instr) {
-  int bits = OffsetSizeInBits(instr);
-  const int32_t mask = (1 << bits) - 1;
-  bits = 32 - bits;
-
-  // Do NOT change this to <<2. We rely on arithmetic shifts here, assuming
-  // the compiler uses arithmetic shifts for signed integers.
-  int32_t imm = ((instr & mask) << bits) >> (bits - 2);
-
-  if (imm == kEndOfChain) {
-    // EndOfChain sentinel is returned directly, not relative to pc or pos.
-    return kEndOfChain;
-  } else {
-    return pos + Assembler::kBranchPCOffset + imm;
-  }
-}
-
-uint32_t Assembler::CreateTargetAddress(Instr instr_lui, Instr instr_jic) {
-  DCHECK(IsLui(instr_lui) && IsJicOrJialc(instr_jic));
-  int16_t jic_offset = GetImmediate16(instr_jic);
-  int16_t lui_offset = GetImmediate16(instr_lui);
-
-  if (jic_offset < 0) {
-    lui_offset += kImm16Mask;
-  }
-  uint32_t lui_offset_u = (static_cast<uint32_t>(lui_offset)) << kLuiShift;
-  uint32_t jic_offset_u = static_cast<uint32_t>(jic_offset) & kImm16Mask;
-
-  return lui_offset_u | jic_offset_u;
-}
-
-// Use just lui and jic instructions. Insert lower part of the target address in
-// jic offset part. Since jic sign-extends offset and then add it with register,
-// before that addition, difference between upper part of the target address and
-// upper part of the sign-extended offset (0xFFFF or 0x0000), will be inserted
-// in jic register with lui instruction.
-void Assembler::UnpackTargetAddress(uint32_t address, int16_t& lui_offset,
-                                    int16_t& jic_offset) {
-  lui_offset = (address & kHiMask) >> kLuiShift;
-  jic_offset = address & kLoMask;
-
-  if (jic_offset < 0) {
-    lui_offset -= kImm16Mask;
-  }
-}
-
-void Assembler::UnpackTargetAddressUnsigned(uint32_t address,
-                                            uint32_t& lui_offset,
-                                            uint32_t& jic_offset) {
-  int16_t lui_offset16 = (address & kHiMask) >> kLuiShift;
-  int16_t jic_offset16 = address & kLoMask;
-
-  if (jic_offset16 < 0) {
-    lui_offset16 -= kImm16Mask;
-  }
-  lui_offset = static_cast<uint32_t>(lui_offset16) & kImm16Mask;
-  jic_offset = static_cast<uint32_t>(jic_offset16) & kImm16Mask;
-}
-
-int Assembler::target_at(int pos, bool is_internal) {
-  Instr instr = instr_at(pos);
-  if (is_internal) {
-    if (instr == 0) {
-      return kEndOfChain;
-    } else {
-      int32_t instr_address = reinterpret_cast<int32_t>(buffer_ + pos);
-      int delta = static_cast<int>(instr_address - instr);
-      DCHECK(pos > delta);
-      return pos - delta;
-    }
-  }
-  if ((instr & ~kImm16Mask) == 0) {
-    // Emitted label constant, not part of a branch.
-    if (instr == 0) {
-       return kEndOfChain;
-     } else {
-       int32_t imm18 =((instr & static_cast<int32_t>(kImm16Mask)) << 16) >> 14;
-       return (imm18 + pos);
-     }
-  }
-  // Check we have a branch or jump instruction.
-  DCHECK(IsBranch(instr) || IsLui(instr));
-  if (IsBranch(instr)) {
-    return AddBranchOffset(pos, instr);
-  } else {
-    Instr instr1 = instr_at(pos + 0 * Assembler::kInstrSize);
-    Instr instr2 = instr_at(pos + 1 * Assembler::kInstrSize);
-    DCHECK(IsOri(instr2) || IsJicOrJialc(instr2));
-    int32_t imm;
-    if (IsJicOrJialc(instr2)) {
-      imm = CreateTargetAddress(instr1, instr2);
-    } else {
-      imm = (instr1 & static_cast<int32_t>(kImm16Mask)) << kLuiShift;
-      imm |= (instr2 & static_cast<int32_t>(kImm16Mask));
-    }
-
-    if (imm == kEndOfJumpChain) {
-      // EndOfChain sentinel is returned directly, not relative to pc or pos.
-      return kEndOfChain;
-    } else {
-      uint32_t instr_address = reinterpret_cast<int32_t>(buffer_ + pos);
-      int32_t delta = instr_address - imm;
-      DCHECK(pos > delta);
-      return pos - delta;
-    }
-  }
-  return 0;
-}
-
-
-static inline Instr SetBranchOffset(int32_t pos, int32_t target_pos,
-                                    Instr instr) {
-  int32_t bits = OffsetSizeInBits(instr);
-  int32_t imm = target_pos - (pos + Assembler::kBranchPCOffset);
-  DCHECK_EQ(imm & 3, 0);
-  imm >>= 2;
-
-  const int32_t mask = (1 << bits) - 1;
-  instr &= ~mask;
-  DCHECK(is_intn(imm, bits));
-
-  return instr | (imm & mask);
-}
-
-
-void Assembler::target_at_put(int32_t pos, int32_t target_pos,
-                              bool is_internal) {
-  Instr instr = instr_at(pos);
-
-  if (is_internal) {
-    uint32_t imm = reinterpret_cast<uint32_t>(buffer_) + target_pos;
-    instr_at_put(pos, imm);
-    return;
-  }
-  if ((instr & ~kImm16Mask) == 0) {
-    DCHECK(target_pos == kEndOfChain || target_pos >= 0);
-    // Emitted label constant, not part of a branch.
-    // Make label relative to Code* of generated Code object.
-    instr_at_put(pos, target_pos + (Code::kHeaderSize - kHeapObjectTag));
-    return;
-  }
-
-  DCHECK(IsBranch(instr) || IsLui(instr));
-  if (IsBranch(instr)) {
-    instr = SetBranchOffset(pos, target_pos, instr);
-    instr_at_put(pos, instr);
-  } else {
-    Instr instr1 = instr_at(pos + 0 * Assembler::kInstrSize);
-    Instr instr2 = instr_at(pos + 1 * Assembler::kInstrSize);
-    DCHECK(IsOri(instr2) || IsJicOrJialc(instr2));
-    uint32_t imm = reinterpret_cast<uint32_t>(buffer_) + target_pos;
-    DCHECK_EQ(imm & 3, 0);
-    DCHECK(IsLui(instr1) && (IsJicOrJialc(instr2) || IsOri(instr2)));
-    instr1 &= ~kImm16Mask;
-    instr2 &= ~kImm16Mask;
-
-    if (IsJicOrJialc(instr2)) {
-      uint32_t lui_offset_u, jic_offset_u;
-      UnpackTargetAddressUnsigned(imm, lui_offset_u, jic_offset_u);
-      instr_at_put(pos + 0 * Assembler::kInstrSize, instr1 | lui_offset_u);
-      instr_at_put(pos + 1 * Assembler::kInstrSize, instr2 | jic_offset_u);
-    } else {
-      instr_at_put(pos + 0 * Assembler::kInstrSize,
-                   instr1 | ((imm & kHiMask) >> kLuiShift));
-      instr_at_put(pos + 1 * Assembler::kInstrSize,
-                   instr2 | (imm & kImm16Mask));
-    }
-  }
-}
-
-void Assembler::print(const Label* L) {
-  if (L->is_unused()) {
-    PrintF("unused label\n");
-  } else if (L->is_bound()) {
-    PrintF("bound label to %d\n", L->pos());
-  } else if (L->is_linked()) {
-    Label l;
-    l.link_to(L->pos());
-    PrintF("unbound label");
-    while (l.is_linked()) {
-      PrintF("@ %d ", l.pos());
-      Instr instr = instr_at(l.pos());
-      if ((instr & ~kImm16Mask) == 0) {
-        PrintF("value\n");
-      } else {
-        PrintF("%d\n", instr);
-      }
-      next(&l, is_internal_reference(&l));
-    }
-  } else {
-    PrintF("label in inconsistent state (pos = %d)\n", L->pos_);
-  }
-}
-
-
-void Assembler::bind_to(Label* L, int pos) {
-  DCHECK(0 <= pos && pos <= pc_offset());  // Must have valid binding position.
-  int32_t trampoline_pos = kInvalidSlotPos;
-  bool is_internal = false;
-  if (L->is_linked() && !trampoline_emitted_) {
-    unbound_labels_count_--;
-    if (!is_internal_reference(L)) {
-      next_buffer_check_ += kTrampolineSlotsSize;
-    }
-  }
-
-  while (L->is_linked()) {
-    int32_t fixup_pos = L->pos();
-    int32_t dist = pos - fixup_pos;
-    is_internal = is_internal_reference(L);
-    next(L, is_internal);  // Call next before overwriting link with target at
-                           // fixup_pos.
-    Instr instr = instr_at(fixup_pos);
-    if (is_internal) {
-      target_at_put(fixup_pos, pos, is_internal);
-    } else {
-      if (IsBranch(instr)) {
-        int branch_offset = BranchOffset(instr);
-        if (dist > branch_offset) {
-          if (trampoline_pos == kInvalidSlotPos) {
-            trampoline_pos = get_trampoline_entry(fixup_pos);
-            CHECK_NE(trampoline_pos, kInvalidSlotPos);
-          }
-          CHECK((trampoline_pos - fixup_pos) <= branch_offset);
-          target_at_put(fixup_pos, trampoline_pos, false);
-          fixup_pos = trampoline_pos;
-        }
-        target_at_put(fixup_pos, pos, false);
-      } else {
-        target_at_put(fixup_pos, pos, false);
-      }
-    }
-  }
-  L->bind_to(pos);
-
-  // Keep track of the last bound label so we don't eliminate any instructions
-  // before a bound label.
-  if (pos > last_bound_pos_)
-    last_bound_pos_ = pos;
-}
-
-
-void Assembler::bind(Label* L) {
-  DCHECK(!L->is_bound());  // Label can only be bound once.
-  bind_to(L, pc_offset());
-}
-
-
-void Assembler::next(Label* L, bool is_internal) {
-  DCHECK(L->is_linked());
-  int link = target_at(L->pos(), is_internal);
-  if (link == kEndOfChain) {
-    L->Unuse();
-  } else {
-    DCHECK_GE(link, 0);
-    L->link_to(link);
-  }
-}
-
-
-bool Assembler::is_near(Label* L) {
-  DCHECK(L->is_bound());
-  return pc_offset() - L->pos() < kMaxBranchOffset - 4 * kInstrSize;
-}
-
-
-bool Assembler::is_near(Label* L, OffsetSize bits) {
-  if (L == nullptr || !L->is_bound()) return true;
-  return pc_offset() - L->pos() < (1 << (bits + 2 - 1)) - 1 - 5 * kInstrSize;
-}
-
-
-bool Assembler::is_near_branch(Label* L) {
-  DCHECK(L->is_bound());
-  return IsMipsArchVariant(kMips32r6) ? is_near_r6(L) : is_near_pre_r6(L);
-}
-
-
-int Assembler::BranchOffset(Instr instr) {
-  // At pre-R6 and for other R6 branches the offset is 16 bits.
-  int bits = OffsetSize::kOffset16;
-
-  if (IsMipsArchVariant(kMips32r6)) {
-    uint32_t opcode = GetOpcodeField(instr);
-    switch (opcode) {
-      // Checks BC or BALC.
-      case BC:
-      case BALC:
-        bits = OffsetSize::kOffset26;
-        break;
-
-      // Checks BEQZC or BNEZC.
-      case POP66:
-      case POP76:
-        if (GetRsField(instr) != 0) bits = OffsetSize::kOffset21;
-        break;
-      default:
-        break;
-    }
-  }
-
-  return (1 << (bits + 2 - 1)) - 1;
-}
-
-
-// We have to use a temporary register for things that can be relocated even
-// if they can be encoded in the MIPS's 16 bits of immediate-offset instruction
-// space.  There is no guarantee that the relocated location can be similarly
-// encoded.
-bool Assembler::MustUseReg(RelocInfo::Mode rmode) {
-  return !RelocInfo::IsNone(rmode);
-}
-
-void Assembler::GenInstrRegister(Opcode opcode,
-                                 Register rs,
-                                 Register rt,
-                                 Register rd,
-                                 uint16_t sa,
-                                 SecondaryField func) {
-  DCHECK(rd.is_valid() && rs.is_valid() && rt.is_valid() && is_uint5(sa));
-  Instr instr = opcode | (rs.code() << kRsShift) | (rt.code() << kRtShift)
-      | (rd.code() << kRdShift) | (sa << kSaShift) | func;
-  emit(instr);
-}
-
-
-void Assembler::GenInstrRegister(Opcode opcode,
-                                 Register rs,
-                                 Register rt,
-                                 uint16_t msb,
-                                 uint16_t lsb,
-                                 SecondaryField func) {
-  DCHECK(rs.is_valid() && rt.is_valid() && is_uint5(msb) && is_uint5(lsb));
-  Instr instr = opcode | (rs.code() << kRsShift) | (rt.code() << kRtShift)
-      | (msb << kRdShift) | (lsb << kSaShift) | func;
-  emit(instr);
-}
-
-
-void Assembler::GenInstrRegister(Opcode opcode,
-                                 SecondaryField fmt,
-                                 FPURegister ft,
-                                 FPURegister fs,
-                                 FPURegister fd,
-                                 SecondaryField func) {
-  DCHECK(fd.is_valid() && fs.is_valid() && ft.is_valid());
-  Instr instr = opcode | fmt | (ft.code() << kFtShift) | (fs.code() << kFsShift)
-      | (fd.code() << kFdShift) | func;
-  emit(instr);
-}
-
-
-void Assembler::GenInstrRegister(Opcode opcode,
-                                 FPURegister fr,
-                                 FPURegister ft,
-                                 FPURegister fs,
-                                 FPURegister fd,
-                                 SecondaryField func) {
-  DCHECK(fd.is_valid() && fr.is_valid() && fs.is_valid() && ft.is_valid());
-  Instr instr = opcode | (fr.code() << kFrShift) | (ft.code() << kFtShift)
-      | (fs.code() << kFsShift) | (fd.code() << kFdShift) | func;
-  emit(instr);
-}
-
-
-void Assembler::GenInstrRegister(Opcode opcode,
-                                 SecondaryField fmt,
-                                 Register rt,
-                                 FPURegister fs,
-                                 FPURegister fd,
-                                 SecondaryField func) {
-  DCHECK(fd.is_valid() && fs.is_valid() && rt.is_valid());
-  Instr instr = opcode | fmt | (rt.code() << kRtShift)
-      | (fs.code() << kFsShift) | (fd.code() << kFdShift) | func;
-  emit(instr);
-}
-
-
-void Assembler::GenInstrRegister(Opcode opcode,
-                                 SecondaryField fmt,
-                                 Register rt,
-                                 FPUControlRegister fs,
-                                 SecondaryField func) {
-  DCHECK(fs.is_valid() && rt.is_valid());
-  Instr instr =
-      opcode | fmt | (rt.code() << kRtShift) | (fs.code() << kFsShift) | func;
-  emit(instr);
-}
-
-
-// Instructions with immediate value.
-// Registers are in the order of the instruction encoding, from left to right.
-void Assembler::GenInstrImmediate(Opcode opcode, Register rs, Register rt,
-                                  int32_t j,
-                                  CompactBranchType is_compact_branch) {
-  DCHECK(rs.is_valid() && rt.is_valid() && (is_int16(j) || is_uint16(j)));
-  Instr instr = opcode | (rs.code() << kRsShift) | (rt.code() << kRtShift)
-      | (j & kImm16Mask);
-  emit(instr, is_compact_branch);
-}
-
-void Assembler::GenInstrImmediate(Opcode opcode, Register base, Register rt,
-                                  int32_t offset9, int bit6,
-                                  SecondaryField func) {
-  DCHECK(base.is_valid() && rt.is_valid() && is_int9(offset9) &&
-         is_uint1(bit6));
-  Instr instr = opcode | (base.code() << kBaseShift) | (rt.code() << kRtShift) |
-                ((offset9 << kImm9Shift) & kImm9Mask) | bit6 << kBit6Shift |
-                func;
-  emit(instr);
-}
-
-void Assembler::GenInstrImmediate(Opcode opcode, Register rs, SecondaryField SF,
-                                  int32_t j,
-                                  CompactBranchType is_compact_branch) {
-  DCHECK(rs.is_valid() && (is_int16(j) || is_uint16(j)));
-  Instr instr = opcode | (rs.code() << kRsShift) | SF | (j & kImm16Mask);
-  emit(instr, is_compact_branch);
-}
-
-
-void Assembler::GenInstrImmediate(Opcode opcode, Register rs, FPURegister ft,
-                                  int32_t j,
-                                  CompactBranchType is_compact_branch) {
-  DCHECK(rs.is_valid() && ft.is_valid() && (is_int16(j) || is_uint16(j)));
-  Instr instr = opcode | (rs.code() << kRsShift) | (ft.code() << kFtShift)
-      | (j & kImm16Mask);
-  emit(instr, is_compact_branch);
-}
-
-
-void Assembler::GenInstrImmediate(Opcode opcode, Register rs, int32_t offset21,
-                                  CompactBranchType is_compact_branch) {
-  DCHECK(rs.is_valid() && (is_int21(offset21)));
-  Instr instr = opcode | (rs.code() << kRsShift) | (offset21 & kImm21Mask);
-  emit(instr, is_compact_branch);
-}
-
-
-void Assembler::GenInstrImmediate(Opcode opcode, Register rs,
-                                  uint32_t offset21) {
-  DCHECK(rs.is_valid() && (is_uint21(offset21)));
-  Instr instr = opcode | (rs.code() << kRsShift) | (offset21 & kImm21Mask);
-  emit(instr);
-}
-
-
-void Assembler::GenInstrImmediate(Opcode opcode, int32_t offset26,
-                                  CompactBranchType is_compact_branch) {
-  DCHECK(is_int26(offset26));
-  Instr instr = opcode | (offset26 & kImm26Mask);
-  emit(instr, is_compact_branch);
-}
-
-
-void Assembler::GenInstrJump(Opcode opcode,
-                             uint32_t address) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  DCHECK(is_uint26(address));
-  Instr instr = opcode | address;
-  emit(instr);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-// MSA instructions
-void Assembler::GenInstrMsaI8(SecondaryField operation, uint32_t imm8,
-                              MSARegister ws, MSARegister wd) {
-  DCHECK(IsMipsArchVariant(kMips32r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(ws.is_valid() && wd.is_valid() && is_uint8(imm8));
-  Instr instr = MSA | operation | ((imm8 & kImm8Mask) << kWtShift) |
-                (ws.code() << kWsShift) | (wd.code() << kWdShift);
-  emit(instr);
-}
-
-void Assembler::GenInstrMsaI5(SecondaryField operation, SecondaryField df,
-                              int32_t imm5, MSARegister ws, MSARegister wd) {
-  DCHECK(IsMipsArchVariant(kMips32r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(ws.is_valid() && wd.is_valid());
-  DCHECK((operation == MAXI_S) || (operation == MINI_S) ||
-                 (operation == CEQI) || (operation == CLTI_S) ||
-                 (operation == CLEI_S)
-             ? is_int5(imm5)
-             : is_uint5(imm5));
-  Instr instr = MSA | operation | df | ((imm5 & kImm5Mask) << kWtShift) |
-                (ws.code() << kWsShift) | (wd.code() << kWdShift);
-  emit(instr);
-}
-
-void Assembler::GenInstrMsaBit(SecondaryField operation, SecondaryField df,
-                               uint32_t m, MSARegister ws, MSARegister wd) {
-  DCHECK(IsMipsArchVariant(kMips32r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(ws.is_valid() && wd.is_valid() && is_valid_msa_df_m(df, m));
-  Instr instr = MSA | operation | df | (m << kWtShift) |
-                (ws.code() << kWsShift) | (wd.code() << kWdShift);
-  emit(instr);
-}
-
-void Assembler::GenInstrMsaI10(SecondaryField operation, SecondaryField df,
-                               int32_t imm10, MSARegister wd) {
-  DCHECK(IsMipsArchVariant(kMips32r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(wd.is_valid() && is_int10(imm10));
-  Instr instr = MSA | operation | df | ((imm10 & kImm10Mask) << kWsShift) |
-                (wd.code() << kWdShift);
-  emit(instr);
-}
-
-template <typename RegType>
-void Assembler::GenInstrMsa3R(SecondaryField operation, SecondaryField df,
-                              RegType t, MSARegister ws, MSARegister wd) {
-  DCHECK(IsMipsArchVariant(kMips32r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(t.is_valid() && ws.is_valid() && wd.is_valid());
-  Instr instr = MSA | operation | df | (t.code() << kWtShift) |
-                (ws.code() << kWsShift) | (wd.code() << kWdShift);
-  emit(instr);
-}
-
-template <typename DstType, typename SrcType>
-void Assembler::GenInstrMsaElm(SecondaryField operation, SecondaryField df,
-                               uint32_t n, SrcType src, DstType dst) {
-  DCHECK(IsMipsArchVariant(kMips32r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(src.is_valid() && dst.is_valid() && is_valid_msa_df_n(df, n));
-  Instr instr = MSA | operation | df | (n << kWtShift) |
-                (src.code() << kWsShift) | (dst.code() << kWdShift) |
-                MSA_ELM_MINOR;
-  emit(instr);
-}
-
-void Assembler::GenInstrMsa3RF(SecondaryField operation, uint32_t df,
-                               MSARegister wt, MSARegister ws, MSARegister wd) {
-  DCHECK(IsMipsArchVariant(kMips32r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(wt.is_valid() && ws.is_valid() && wd.is_valid());
-  DCHECK_LT(df, 2);
-  Instr instr = MSA | operation | (df << 21) | (wt.code() << kWtShift) |
-                (ws.code() << kWsShift) | (wd.code() << kWdShift);
-  emit(instr);
-}
-
-void Assembler::GenInstrMsaVec(SecondaryField operation, MSARegister wt,
-                               MSARegister ws, MSARegister wd) {
-  DCHECK(IsMipsArchVariant(kMips32r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(wt.is_valid() && ws.is_valid() && wd.is_valid());
-  Instr instr = MSA | operation | (wt.code() << kWtShift) |
-                (ws.code() << kWsShift) | (wd.code() << kWdShift) |
-                MSA_VEC_2R_2RF_MINOR;
-  emit(instr);
-}
-
-void Assembler::GenInstrMsaMI10(SecondaryField operation, int32_t s10,
-                                Register rs, MSARegister wd) {
-  DCHECK(IsMipsArchVariant(kMips32r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(rs.is_valid() && wd.is_valid() && is_int10(s10));
-  Instr instr = MSA | operation | ((s10 & kImm10Mask) << kWtShift) |
-                (rs.code() << kWsShift) | (wd.code() << kWdShift);
-  emit(instr);
-}
-
-void Assembler::GenInstrMsa2R(SecondaryField operation, SecondaryField df,
-                              MSARegister ws, MSARegister wd) {
-  DCHECK(IsMipsArchVariant(kMips32r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(ws.is_valid() && wd.is_valid());
-  Instr instr = MSA | MSA_2R_FORMAT | operation | df | (ws.code() << kWsShift) |
-                (wd.code() << kWdShift) | MSA_VEC_2R_2RF_MINOR;
-  emit(instr);
-}
-
-void Assembler::GenInstrMsa2RF(SecondaryField operation, SecondaryField df,
-                               MSARegister ws, MSARegister wd) {
-  DCHECK(IsMipsArchVariant(kMips32r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(ws.is_valid() && wd.is_valid());
-  Instr instr = MSA | MSA_2RF_FORMAT | operation | df |
-                (ws.code() << kWsShift) | (wd.code() << kWdShift) |
-                MSA_VEC_2R_2RF_MINOR;
-  emit(instr);
-}
-
-void Assembler::GenInstrMsaBranch(SecondaryField operation, MSARegister wt,
-                                  int32_t offset16) {
-  DCHECK(IsMipsArchVariant(kMips32r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(wt.is_valid() && is_int16(offset16));
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  Instr instr =
-      COP1 | operation | (wt.code() << kWtShift) | (offset16 & kImm16Mask);
-  emit(instr);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-// Returns the next free trampoline entry.
-int32_t Assembler::get_trampoline_entry(int32_t pos) {
-  int32_t trampoline_entry = kInvalidSlotPos;
-
-  if (!internal_trampoline_exception_) {
-    if (trampoline_.start() > pos) {
-     trampoline_entry = trampoline_.take_slot();
-    }
-
-    if (kInvalidSlotPos == trampoline_entry) {
-      internal_trampoline_exception_ = true;
-    }
-  }
-  return trampoline_entry;
-}
-
-
-uint32_t Assembler::jump_address(Label* L) {
-  int32_t target_pos;
-
-  if (L->is_bound()) {
-    target_pos = L->pos();
-  } else {
-    if (L->is_linked()) {
-      target_pos = L->pos();  // L's link.
-      L->link_to(pc_offset());
-    } else {
-      L->link_to(pc_offset());
-      return kEndOfJumpChain;
-    }
-  }
-
-  uint32_t imm = reinterpret_cast<uint32_t>(buffer_) + target_pos;
-  DCHECK_EQ(imm & 3, 0);
-
-  return imm;
-}
-
-
-int32_t Assembler::branch_offset_helper(Label* L, OffsetSize bits) {
-  int32_t target_pos;
-  int32_t pad = IsPrevInstrCompactBranch() ? kInstrSize : 0;
-
-  if (L->is_bound()) {
-    target_pos = L->pos();
-  } else {
-    if (L->is_linked()) {
-      target_pos = L->pos();
-      L->link_to(pc_offset() + pad);
-    } else {
-      L->link_to(pc_offset() + pad);
-      if (!trampoline_emitted_) {
-        unbound_labels_count_++;
-        next_buffer_check_ -= kTrampolineSlotsSize;
-      }
-      return kEndOfChain;
-    }
-  }
-
-  int32_t offset = target_pos - (pc_offset() + kBranchPCOffset + pad);
-  DCHECK(is_intn(offset, bits + 2));
-  DCHECK_EQ(offset & 3, 0);
-
-  return offset;
-}
-
-
-void Assembler::label_at_put(Label* L, int at_offset) {
-  int target_pos;
-  if (L->is_bound()) {
-    target_pos = L->pos();
-    instr_at_put(at_offset, target_pos + (Code::kHeaderSize - kHeapObjectTag));
-  } else {
-    if (L->is_linked()) {
-      target_pos = L->pos();  // L's link.
-      int32_t imm18 = target_pos - at_offset;
-      DCHECK_EQ(imm18 & 3, 0);
-      int32_t imm16 = imm18 >> 2;
-      DCHECK(is_int16(imm16));
-      instr_at_put(at_offset, (imm16 & kImm16Mask));
-    } else {
-      target_pos = kEndOfChain;
-      instr_at_put(at_offset, 0);
-      if (!trampoline_emitted_) {
-        unbound_labels_count_++;
-        next_buffer_check_ -= kTrampolineSlotsSize;
-      }
-    }
-    L->link_to(at_offset);
-  }
-}
-
-
-//------- Branch and jump instructions --------
-
-void Assembler::b(int16_t offset) {
-  beq(zero_reg, zero_reg, offset);
-}
-
-
-void Assembler::bal(int16_t offset) {
-  bgezal(zero_reg, offset);
-}
-
-
-void Assembler::bc(int32_t offset) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  GenInstrImmediate(BC, offset, CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::balc(int32_t offset) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  GenInstrImmediate(BALC, offset, CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::beq(Register rs, Register rt, int16_t offset) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  GenInstrImmediate(BEQ, rs, rt, offset);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-
-void Assembler::bgez(Register rs, int16_t offset) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  GenInstrImmediate(REGIMM, rs, BGEZ, offset);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-
-void Assembler::bgezc(Register rt, int16_t offset) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(rt != zero_reg);
-  GenInstrImmediate(BLEZL, rt, rt, offset, CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::bgeuc(Register rs, Register rt, int16_t offset) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(rs != zero_reg);
-  DCHECK(rt != zero_reg);
-  DCHECK(rs.code() != rt.code());
-  GenInstrImmediate(BLEZ, rs, rt, offset, CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::bgec(Register rs, Register rt, int16_t offset) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(rs != zero_reg);
-  DCHECK(rt != zero_reg);
-  DCHECK(rs.code() != rt.code());
-  GenInstrImmediate(BLEZL, rs, rt, offset, CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::bgezal(Register rs, int16_t offset) {
-  DCHECK(!IsMipsArchVariant(kMips32r6) || rs == zero_reg);
-  DCHECK(rs != ra);
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  GenInstrImmediate(REGIMM, rs, BGEZAL, offset);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-
-void Assembler::bgtz(Register rs, int16_t offset) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  GenInstrImmediate(BGTZ, rs, zero_reg, offset);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-
-void Assembler::bgtzc(Register rt, int16_t offset) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(rt != zero_reg);
-  GenInstrImmediate(BGTZL, zero_reg, rt, offset,
-                    CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::blez(Register rs, int16_t offset) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  GenInstrImmediate(BLEZ, rs, zero_reg, offset);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-
-void Assembler::blezc(Register rt, int16_t offset) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(rt != zero_reg);
-  GenInstrImmediate(BLEZL, zero_reg, rt, offset,
-                    CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::bltzc(Register rt, int16_t offset) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(rt != zero_reg);
-  GenInstrImmediate(BGTZL, rt, rt, offset, CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::bltuc(Register rs, Register rt, int16_t offset) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(rs != zero_reg);
-  DCHECK(rt != zero_reg);
-  DCHECK(rs.code() != rt.code());
-  GenInstrImmediate(BGTZ, rs, rt, offset, CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::bltc(Register rs, Register rt, int16_t offset) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(rs != zero_reg);
-  DCHECK(rt != zero_reg);
-  DCHECK(rs.code() != rt.code());
-  GenInstrImmediate(BGTZL, rs, rt, offset, CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::bltz(Register rs, int16_t offset) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  GenInstrImmediate(REGIMM, rs, BLTZ, offset);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-
-void Assembler::bltzal(Register rs, int16_t offset) {
-  DCHECK(!IsMipsArchVariant(kMips32r6) || rs == zero_reg);
-  DCHECK(rs != ra);
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  GenInstrImmediate(REGIMM, rs, BLTZAL, offset);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-
-void Assembler::bne(Register rs, Register rt, int16_t offset) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  GenInstrImmediate(BNE, rs, rt, offset);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-
-void Assembler::bovc(Register rs, Register rt, int16_t offset) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  if (rs.code() >= rt.code()) {
-    GenInstrImmediate(ADDI, rs, rt, offset, CompactBranchType::COMPACT_BRANCH);
-  } else {
-    GenInstrImmediate(ADDI, rt, rs, offset, CompactBranchType::COMPACT_BRANCH);
-  }
-}
-
-
-void Assembler::bnvc(Register rs, Register rt, int16_t offset) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  if (rs.code() >= rt.code()) {
-    GenInstrImmediate(DADDI, rs, rt, offset, CompactBranchType::COMPACT_BRANCH);
-  } else {
-    GenInstrImmediate(DADDI, rt, rs, offset, CompactBranchType::COMPACT_BRANCH);
-  }
-}
-
-
-void Assembler::blezalc(Register rt, int16_t offset) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(rt != zero_reg);
-  DCHECK(rt != ra);
-  GenInstrImmediate(BLEZ, zero_reg, rt, offset,
-                    CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::bgezalc(Register rt, int16_t offset) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(rt != zero_reg);
-  DCHECK(rt != ra);
-  GenInstrImmediate(BLEZ, rt, rt, offset, CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::bgezall(Register rs, int16_t offset) {
-  DCHECK(!IsMipsArchVariant(kMips32r6));
-  DCHECK(rs != zero_reg);
-  DCHECK(rs != ra);
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  GenInstrImmediate(REGIMM, rs, BGEZALL, offset);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-
-void Assembler::bltzalc(Register rt, int16_t offset) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(rt != zero_reg);
-  DCHECK(rt != ra);
-  GenInstrImmediate(BGTZ, rt, rt, offset, CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::bgtzalc(Register rt, int16_t offset) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(rt != zero_reg);
-  DCHECK(rt != ra);
-  GenInstrImmediate(BGTZ, zero_reg, rt, offset,
-                    CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::beqzalc(Register rt, int16_t offset) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(rt != zero_reg);
-  DCHECK(rt != ra);
-  GenInstrImmediate(ADDI, zero_reg, rt, offset,
-                    CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::bnezalc(Register rt, int16_t offset) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(rt != zero_reg);
-  DCHECK(rt != ra);
-  GenInstrImmediate(DADDI, zero_reg, rt, offset,
-                    CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::beqc(Register rs, Register rt, int16_t offset) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(rs.code() != rt.code() && rs.code() != 0 && rt.code() != 0);
-  if (rs.code() < rt.code()) {
-    GenInstrImmediate(ADDI, rs, rt, offset, CompactBranchType::COMPACT_BRANCH);
-  } else {
-    GenInstrImmediate(ADDI, rt, rs, offset, CompactBranchType::COMPACT_BRANCH);
-  }
-}
-
-
-void Assembler::beqzc(Register rs, int32_t offset) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(rs != zero_reg);
-  GenInstrImmediate(POP66, rs, offset, CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::bnec(Register rs, Register rt, int16_t offset) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(rs.code() != rt.code() && rs.code() != 0 && rt.code() != 0);
-  if (rs.code() < rt.code()) {
-    GenInstrImmediate(DADDI, rs, rt, offset, CompactBranchType::COMPACT_BRANCH);
-  } else {
-    GenInstrImmediate(DADDI, rt, rs, offset, CompactBranchType::COMPACT_BRANCH);
-  }
-}
-
-
-void Assembler::bnezc(Register rs, int32_t offset) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(rs != zero_reg);
-  GenInstrImmediate(POP76, rs, offset, CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::j(int32_t target) {
-#if DEBUG
-  // Get pc of delay slot.
-  uint32_t ipc = reinterpret_cast<uint32_t>(pc_ + 1 * kInstrSize);
-  bool in_range = ((ipc ^ static_cast<uint32_t>(target)) >>
-                   (kImm26Bits + kImmFieldShift)) == 0;
-  DCHECK(in_range && ((target & 3) == 0));
-#endif
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  GenInstrJump(J, (target >> 2) & kImm26Mask);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-
-void Assembler::jr(Register rs) {
-  if (!IsMipsArchVariant(kMips32r6)) {
-    BlockTrampolinePoolScope block_trampoline_pool(this);
-    GenInstrRegister(SPECIAL, rs, zero_reg, zero_reg, 0, JR);
-    BlockTrampolinePoolFor(1);  // For associated delay slot.
-  } else {
-    jalr(rs, zero_reg);
-  }
-}
-
-
-void Assembler::jal(int32_t target) {
-#ifdef DEBUG
-  // Get pc of delay slot.
-  uint32_t ipc = reinterpret_cast<uint32_t>(pc_ + 1 * kInstrSize);
-  bool in_range = ((ipc ^ static_cast<uint32_t>(target)) >>
-                   (kImm26Bits + kImmFieldShift)) == 0;
-  DCHECK(in_range && ((target & 3) == 0));
-#endif
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  GenInstrJump(JAL, (target >> 2) & kImm26Mask);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-
-void Assembler::jalr(Register rs, Register rd) {
-  DCHECK(rs.code() != rd.code());
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  GenInstrRegister(SPECIAL, rs, zero_reg, rd, 0, JALR);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-
-void Assembler::jic(Register rt, int16_t offset) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  GenInstrImmediate(POP66, zero_reg, rt, offset);
-}
-
-
-void Assembler::jialc(Register rt, int16_t offset) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  GenInstrImmediate(POP76, zero_reg, rt, offset);
-}
-
-
-// -------Data-processing-instructions---------
-
-// Arithmetic.
-
-void Assembler::addu(Register rd, Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, ADDU);
-}
-
-
-void Assembler::addiu(Register rd, Register rs, int32_t j) {
-  GenInstrImmediate(ADDIU, rs, rd, j);
-}
-
-
-void Assembler::subu(Register rd, Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, SUBU);
-}
-
-
-void Assembler::mul(Register rd, Register rs, Register rt) {
-  if (!IsMipsArchVariant(kMips32r6)) {
-    GenInstrRegister(SPECIAL2, rs, rt, rd, 0, MUL);
-  } else {
-    GenInstrRegister(SPECIAL, rs, rt, rd, MUL_OP, MUL_MUH);
-  }
-}
-
-
-void Assembler::mulu(Register rd, Register rs, Register rt) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(SPECIAL, rs, rt, rd, MUL_OP, MUL_MUH_U);
-}
-
-
-void Assembler::muh(Register rd, Register rs, Register rt) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(SPECIAL, rs, rt, rd, MUH_OP, MUL_MUH);
-}
-
-
-void Assembler::muhu(Register rd, Register rs, Register rt) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(SPECIAL, rs, rt, rd, MUH_OP, MUL_MUH_U);
-}
-
-
-void Assembler::mod(Register rd, Register rs, Register rt) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(SPECIAL, rs, rt, rd, MOD_OP, DIV_MOD);
-}
-
-
-void Assembler::modu(Register rd, Register rs, Register rt) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(SPECIAL, rs, rt, rd, MOD_OP, DIV_MOD_U);
-}
-
-
-void Assembler::mult(Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, zero_reg, 0, MULT);
-}
-
-
-void Assembler::multu(Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, zero_reg, 0, MULTU);
-}
-
-
-void Assembler::div(Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, zero_reg, 0, DIV);
-}
-
-
-void Assembler::div(Register rd, Register rs, Register rt) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(SPECIAL, rs, rt, rd, DIV_OP, DIV_MOD);
-}
-
-
-void Assembler::divu(Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, zero_reg, 0, DIVU);
-}
-
-
-void Assembler::divu(Register rd, Register rs, Register rt) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(SPECIAL, rs, rt, rd, DIV_OP, DIV_MOD_U);
-}
-
-
-// Logical.
-
-void Assembler::and_(Register rd, Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, AND);
-}
-
-
-void Assembler::andi(Register rt, Register rs, int32_t j) {
-  DCHECK(is_uint16(j));
-  GenInstrImmediate(ANDI, rs, rt, j);
-}
-
-
-void Assembler::or_(Register rd, Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, OR);
-}
-
-
-void Assembler::ori(Register rt, Register rs, int32_t j) {
-  DCHECK(is_uint16(j));
-  GenInstrImmediate(ORI, rs, rt, j);
-}
-
-
-void Assembler::xor_(Register rd, Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, XOR);
-}
-
-
-void Assembler::xori(Register rt, Register rs, int32_t j) {
-  DCHECK(is_uint16(j));
-  GenInstrImmediate(XORI, rs, rt, j);
-}
-
-
-void Assembler::nor(Register rd, Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, NOR);
-}
-
-
-// Shifts.
-void Assembler::sll(Register rd,
-                    Register rt,
-                    uint16_t sa,
-                    bool coming_from_nop) {
-  // Don't allow nop instructions in the form sll zero_reg, zero_reg to be
-  // generated using the sll instruction. They must be generated using
-  // nop(int/NopMarkerTypes).
-  DCHECK(coming_from_nop || !(rd == zero_reg && rt == zero_reg));
-  GenInstrRegister(SPECIAL, zero_reg, rt, rd, sa & 0x1F, SLL);
-}
-
-
-void Assembler::sllv(Register rd, Register rt, Register rs) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, SLLV);
-}
-
-
-void Assembler::srl(Register rd, Register rt, uint16_t sa) {
-  GenInstrRegister(SPECIAL, zero_reg, rt, rd, sa & 0x1F, SRL);
-}
-
-
-void Assembler::srlv(Register rd, Register rt, Register rs) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, SRLV);
-}
-
-
-void Assembler::sra(Register rd, Register rt, uint16_t sa) {
-  GenInstrRegister(SPECIAL, zero_reg, rt, rd, sa & 0x1F, SRA);
-}
-
-
-void Assembler::srav(Register rd, Register rt, Register rs) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, SRAV);
-}
-
-
-void Assembler::rotr(Register rd, Register rt, uint16_t sa) {
-  // Should be called via MacroAssembler::Ror.
-  DCHECK(rd.is_valid() && rt.is_valid() && is_uint5(sa));
-  DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
-  Instr instr = SPECIAL | (1 << kRsShift) | (rt.code() << kRtShift)
-      | (rd.code() << kRdShift) | (sa << kSaShift) | SRL;
-  emit(instr);
-}
-
-
-void Assembler::rotrv(Register rd, Register rt, Register rs) {
-  // Should be called via MacroAssembler::Ror.
-  DCHECK(rd.is_valid() && rt.is_valid() && rs.is_valid());
-  DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
-  Instr instr = SPECIAL | (rs.code() << kRsShift) | (rt.code() << kRtShift)
-     | (rd.code() << kRdShift) | (1 << kSaShift) | SRLV;
-  emit(instr);
-}
-
-
-void Assembler::lsa(Register rd, Register rt, Register rs, uint8_t sa) {
-  DCHECK(rd.is_valid() && rt.is_valid() && rs.is_valid());
-  DCHECK_LE(sa, 3);
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  Instr instr = SPECIAL | rs.code() << kRsShift | rt.code() << kRtShift |
-                rd.code() << kRdShift | sa << kSaShift | LSA;
-  emit(instr);
-}
-
-
-// ------------Memory-instructions-------------
-
-void Assembler::AdjustBaseAndOffset(MemOperand& src,
-                                    OffsetAccessType access_type,
-                                    int second_access_add_to_offset) {
-  // This method is used to adjust the base register and offset pair
-  // for a load/store when the offset doesn't fit into int16_t.
-  // It is assumed that 'base + offset' is sufficiently aligned for memory
-  // operands that are machine word in size or smaller. For doubleword-sized
-  // operands it's assumed that 'base' is a multiple of 8, while 'offset'
-  // may be a multiple of 4 (e.g. 4-byte-aligned long and double arguments
-  // and spilled variables on the stack accessed relative to the stack
-  // pointer register).
-  // We preserve the "alignment" of 'offset' by adjusting it by a multiple of 8.
-
-  bool doubleword_aligned = (src.offset() & (kDoubleSize - 1)) == 0;
-  bool two_accesses = static_cast<bool>(access_type) || !doubleword_aligned;
-  DCHECK_LE(second_access_add_to_offset, 7);  // Must be <= 7.
-
-  // is_int16 must be passed a signed value, hence the static cast below.
-  if (is_int16(src.offset()) &&
-      (!two_accesses || is_int16(static_cast<int32_t>(
-                            src.offset() + second_access_add_to_offset)))) {
-    // Nothing to do: 'offset' (and, if needed, 'offset + 4', or other specified
-    // value) fits into int16_t.
-    return;
-  }
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  DCHECK(src.rm() != scratch);  // Must not overwrite the register 'base'
-                                // while loading 'offset'.
-
-#ifdef DEBUG
-  // Remember the "(mis)alignment" of 'offset', it will be checked at the end.
-  uint32_t misalignment = src.offset() & (kDoubleSize - 1);
-#endif
-
-  // Do not load the whole 32-bit 'offset' if it can be represented as
-  // a sum of two 16-bit signed offsets. This can save an instruction or two.
-  // To simplify matters, only do this for a symmetric range of offsets from
-  // about -64KB to about +64KB, allowing further addition of 4 when accessing
-  // 64-bit variables with two 32-bit accesses.
-  constexpr int32_t kMinOffsetForSimpleAdjustment =
-      0x7FF8;  // Max int16_t that's a multiple of 8.
-  constexpr int32_t kMaxOffsetForSimpleAdjustment =
-      2 * kMinOffsetForSimpleAdjustment;
-  if (0 <= src.offset() && src.offset() <= kMaxOffsetForSimpleAdjustment) {
-    addiu(at, src.rm(), kMinOffsetForSimpleAdjustment);
-    src.offset_ -= kMinOffsetForSimpleAdjustment;
-  } else if (-kMaxOffsetForSimpleAdjustment <= src.offset() &&
-             src.offset() < 0) {
-    addiu(at, src.rm(), -kMinOffsetForSimpleAdjustment);
-    src.offset_ += kMinOffsetForSimpleAdjustment;
-  } else if (IsMipsArchVariant(kMips32r6)) {
-    // On r6 take advantage of the aui instruction, e.g.:
-    //   aui   at, base, offset_high
-    //   lw    reg_lo, offset_low(at)
-    //   lw    reg_hi, (offset_low+4)(at)
-    // or when offset_low+4 overflows int16_t:
-    //   aui   at, base, offset_high
-    //   addiu at, at, 8
-    //   lw    reg_lo, (offset_low-8)(at)
-    //   lw    reg_hi, (offset_low-4)(at)
-    int16_t offset_high = static_cast<uint16_t>(src.offset() >> 16);
-    int16_t offset_low = static_cast<uint16_t>(src.offset());
-    offset_high += (offset_low < 0)
-                       ? 1
-                       : 0;  // Account for offset sign extension in load/store.
-    aui(scratch, src.rm(), static_cast<uint16_t>(offset_high));
-    if (two_accesses && !is_int16(static_cast<int32_t>(
-                            offset_low + second_access_add_to_offset))) {
-      // Avoid overflow in the 16-bit offset of the load/store instruction when
-      // adding 4.
-      addiu(scratch, scratch, kDoubleSize);
-      offset_low -= kDoubleSize;
-    }
-    src.offset_ = offset_low;
-  } else {
-    // Do not load the whole 32-bit 'offset' if it can be represented as
-    // a sum of three 16-bit signed offsets. This can save an instruction.
-    // To simplify matters, only do this for a symmetric range of offsets from
-    // about -96KB to about +96KB, allowing further addition of 4 when accessing
-    // 64-bit variables with two 32-bit accesses.
-    constexpr int32_t kMinOffsetForMediumAdjustment =
-        2 * kMinOffsetForSimpleAdjustment;
-    constexpr int32_t kMaxOffsetForMediumAdjustment =
-        3 * kMinOffsetForSimpleAdjustment;
-    if (0 <= src.offset() && src.offset() <= kMaxOffsetForMediumAdjustment) {
-      addiu(scratch, src.rm(), kMinOffsetForMediumAdjustment / 2);
-      addiu(scratch, scratch, kMinOffsetForMediumAdjustment / 2);
-      src.offset_ -= kMinOffsetForMediumAdjustment;
-    } else if (-kMaxOffsetForMediumAdjustment <= src.offset() &&
-               src.offset() < 0) {
-      addiu(scratch, src.rm(), -kMinOffsetForMediumAdjustment / 2);
-      addiu(scratch, scratch, -kMinOffsetForMediumAdjustment / 2);
-      src.offset_ += kMinOffsetForMediumAdjustment;
-    } else {
-      // Now that all shorter options have been exhausted, load the full 32-bit
-      // offset.
-      int32_t loaded_offset = RoundDown(src.offset(), kDoubleSize);
-      lui(scratch, (loaded_offset >> kLuiShift) & kImm16Mask);
-      ori(scratch, scratch, loaded_offset & kImm16Mask);  // Load 32-bit offset.
-      addu(scratch, scratch, src.rm());
-      src.offset_ -= loaded_offset;
-    }
-  }
-  src.rm_ = scratch;
-
-  DCHECK(is_int16(src.offset()));
-  if (two_accesses) {
-    DCHECK(is_int16(
-        static_cast<int32_t>(src.offset() + second_access_add_to_offset)));
-  }
-  DCHECK(misalignment == (src.offset() & (kDoubleSize - 1)));
-}
-
-void Assembler::lb(Register rd, const MemOperand& rs) {
-  MemOperand source = rs;
-  AdjustBaseAndOffset(source);
-  GenInstrImmediate(LB, source.rm(), rd, source.offset());
-}
-
-
-void Assembler::lbu(Register rd, const MemOperand& rs) {
-  MemOperand source = rs;
-  AdjustBaseAndOffset(source);
-  GenInstrImmediate(LBU, source.rm(), rd, source.offset());
-}
-
-
-void Assembler::lh(Register rd, const MemOperand& rs) {
-  MemOperand source = rs;
-  AdjustBaseAndOffset(source);
-  GenInstrImmediate(LH, source.rm(), rd, source.offset());
-}
-
-
-void Assembler::lhu(Register rd, const MemOperand& rs) {
-  MemOperand source = rs;
-  AdjustBaseAndOffset(source);
-  GenInstrImmediate(LHU, source.rm(), rd, source.offset());
-}
-
-
-void Assembler::lw(Register rd, const MemOperand& rs) {
-  MemOperand source = rs;
-  AdjustBaseAndOffset(source);
-  GenInstrImmediate(LW, source.rm(), rd, source.offset());
-}
-
-
-void Assembler::lwl(Register rd, const MemOperand& rs) {
-  DCHECK(is_int16(rs.offset_));
-  DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) ||
-         IsMipsArchVariant(kMips32r2));
-  GenInstrImmediate(LWL, rs.rm(), rd, rs.offset_);
-}
-
-
-void Assembler::lwr(Register rd, const MemOperand& rs) {
-  DCHECK(is_int16(rs.offset_));
-  DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) ||
-         IsMipsArchVariant(kMips32r2));
-  GenInstrImmediate(LWR, rs.rm(), rd, rs.offset_);
-}
-
-
-void Assembler::sb(Register rd, const MemOperand& rs) {
-  MemOperand source = rs;
-  AdjustBaseAndOffset(source);
-  GenInstrImmediate(SB, source.rm(), rd, source.offset());
-}
-
-
-void Assembler::sh(Register rd, const MemOperand& rs) {
-  MemOperand source = rs;
-  AdjustBaseAndOffset(source);
-  GenInstrImmediate(SH, source.rm(), rd, source.offset());
-}
-
-
-void Assembler::sw(Register rd, const MemOperand& rs) {
-  MemOperand source = rs;
-  AdjustBaseAndOffset(source);
-  GenInstrImmediate(SW, source.rm(), rd, source.offset());
-}
-
-
-void Assembler::swl(Register rd, const MemOperand& rs) {
-  DCHECK(is_int16(rs.offset_));
-  DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) ||
-         IsMipsArchVariant(kMips32r2));
-  GenInstrImmediate(SWL, rs.rm(), rd, rs.offset_);
-}
-
-
-void Assembler::swr(Register rd, const MemOperand& rs) {
-  DCHECK(is_int16(rs.offset_));
-  DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) ||
-         IsMipsArchVariant(kMips32r2));
-  GenInstrImmediate(SWR, rs.rm(), rd, rs.offset_);
-}
-
-void Assembler::ll(Register rd, const MemOperand& rs) {
-  if (IsMipsArchVariant(kMips32r6)) {
-    DCHECK(is_int9(rs.offset_));
-    GenInstrImmediate(SPECIAL3, rs.rm(), rd, rs.offset_, 0, LL_R6);
-  } else {
-    DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) ||
-           IsMipsArchVariant(kMips32r2));
-    DCHECK(is_int16(rs.offset_));
-    GenInstrImmediate(LL, rs.rm(), rd, rs.offset_);
-  }
-}
-
-void Assembler::sc(Register rd, const MemOperand& rs) {
-  if (IsMipsArchVariant(kMips32r6)) {
-    DCHECK(is_int9(rs.offset_));
-    GenInstrImmediate(SPECIAL3, rs.rm(), rd, rs.offset_, 0, SC_R6);
-  } else {
-    DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) ||
-           IsMipsArchVariant(kMips32r2));
-    GenInstrImmediate(SC, rs.rm(), rd, rs.offset_);
-  }
-}
-
-void Assembler::lui(Register rd, int32_t j) {
-  DCHECK(is_uint16(j));
-  GenInstrImmediate(LUI, zero_reg, rd, j);
-}
-
-
-void Assembler::aui(Register rt, Register rs, int32_t j) {
-  // This instruction uses same opcode as 'lui'. The difference in encoding is
-  // 'lui' has zero reg. for rs field.
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(rs != zero_reg);
-  DCHECK(is_uint16(j));
-  GenInstrImmediate(LUI, rs, rt, j);
-}
-
-// ---------PC-Relative instructions-----------
-
-void Assembler::addiupc(Register rs, int32_t imm19) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(rs.is_valid() && is_int19(imm19));
-  uint32_t imm21 = ADDIUPC << kImm19Bits | (imm19 & kImm19Mask);
-  GenInstrImmediate(PCREL, rs, imm21);
-}
-
-
-void Assembler::lwpc(Register rs, int32_t offset19) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(rs.is_valid() && is_int19(offset19));
-  uint32_t imm21 = LWPC << kImm19Bits | (offset19 & kImm19Mask);
-  GenInstrImmediate(PCREL, rs, imm21);
-}
-
-
-void Assembler::auipc(Register rs, int16_t imm16) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(rs.is_valid());
-  uint32_t imm21 = AUIPC << kImm16Bits | (imm16 & kImm16Mask);
-  GenInstrImmediate(PCREL, rs, imm21);
-}
-
-
-void Assembler::aluipc(Register rs, int16_t imm16) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(rs.is_valid());
-  uint32_t imm21 = ALUIPC << kImm16Bits | (imm16 & kImm16Mask);
-  GenInstrImmediate(PCREL, rs, imm21);
-}
-
-
-// -------------Misc-instructions--------------
-
-// Break / Trap instructions.
-void Assembler::break_(uint32_t code, bool break_as_stop) {
-  DCHECK_EQ(code & ~0xFFFFF, 0);
-  // We need to invalidate breaks that could be stops as well because the
-  // simulator expects a char pointer after the stop instruction.
-  // See constants-mips.h for explanation.
-  DCHECK((break_as_stop &&
-          code <= kMaxStopCode &&
-          code > kMaxWatchpointCode) ||
-         (!break_as_stop &&
-          (code > kMaxStopCode ||
-           code <= kMaxWatchpointCode)));
-  Instr break_instr = SPECIAL | BREAK | (code << 6);
-  emit(break_instr);
-}
-
-
-void Assembler::stop(const char* msg, uint32_t code) {
-  DCHECK_GT(code, kMaxWatchpointCode);
-  DCHECK_LE(code, kMaxStopCode);
-#if V8_HOST_ARCH_MIPS
-  break_(0x54321);
-#else  // V8_HOST_ARCH_MIPS
-  break_(code, true);
-#endif
-}
-
-
-void Assembler::tge(Register rs, Register rt, uint16_t code) {
-  DCHECK(is_uint10(code));
-  Instr instr = SPECIAL | TGE | rs.code() << kRsShift
-      | rt.code() << kRtShift | code << 6;
-  emit(instr);
-}
-
-
-void Assembler::tgeu(Register rs, Register rt, uint16_t code) {
-  DCHECK(is_uint10(code));
-  Instr instr = SPECIAL | TGEU | rs.code() << kRsShift
-      | rt.code() << kRtShift | code << 6;
-  emit(instr);
-}
-
-
-void Assembler::tlt(Register rs, Register rt, uint16_t code) {
-  DCHECK(is_uint10(code));
-  Instr instr =
-      SPECIAL | TLT | rs.code() << kRsShift | rt.code() << kRtShift | code << 6;
-  emit(instr);
-}
-
-
-void Assembler::tltu(Register rs, Register rt, uint16_t code) {
-  DCHECK(is_uint10(code));
-  Instr instr =
-      SPECIAL | TLTU | rs.code() << kRsShift
-      | rt.code() << kRtShift | code << 6;
-  emit(instr);
-}
-
-
-void Assembler::teq(Register rs, Register rt, uint16_t code) {
-  DCHECK(is_uint10(code));
-  Instr instr =
-      SPECIAL | TEQ | rs.code() << kRsShift | rt.code() << kRtShift | code << 6;
-  emit(instr);
-}
-
-
-void Assembler::tne(Register rs, Register rt, uint16_t code) {
-  DCHECK(is_uint10(code));
-  Instr instr =
-      SPECIAL | TNE | rs.code() << kRsShift | rt.code() << kRtShift | code << 6;
-  emit(instr);
-}
-
-void Assembler::sync() {
-  Instr sync_instr = SPECIAL | SYNC;
-  emit(sync_instr);
-}
-
-// Move from HI/LO register.
-
-void Assembler::mfhi(Register rd) {
-  GenInstrRegister(SPECIAL, zero_reg, zero_reg, rd, 0, MFHI);
-}
-
-
-void Assembler::mflo(Register rd) {
-  GenInstrRegister(SPECIAL, zero_reg, zero_reg, rd, 0, MFLO);
-}
-
-
-// Set on less than instructions.
-void Assembler::slt(Register rd, Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, SLT);
-}
-
-
-void Assembler::sltu(Register rd, Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, SLTU);
-}
-
-
-void Assembler::slti(Register rt, Register rs, int32_t j) {
-  GenInstrImmediate(SLTI, rs, rt, j);
-}
-
-
-void Assembler::sltiu(Register rt, Register rs, int32_t j) {
-  GenInstrImmediate(SLTIU, rs, rt, j);
-}
-
-
-// Conditional move.
-void Assembler::movz(Register rd, Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, MOVZ);
-}
-
-
-void Assembler::movn(Register rd, Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, MOVN);
-}
-
-
-void Assembler::movt(Register rd, Register rs, uint16_t cc) {
-  Register rt = Register::from_code((cc & 0x0007) << 2 | 1);
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, MOVCI);
-}
-
-
-void Assembler::movf(Register rd, Register rs, uint16_t cc) {
-  Register rt = Register::from_code((cc & 0x0007) << 2 | 0);
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, MOVCI);
-}
-
-
-void Assembler::seleqz(Register rd, Register rs, Register rt) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, SELEQZ_S);
-}
-
-
-// Bit twiddling.
-void Assembler::clz(Register rd, Register rs) {
-  if (!IsMipsArchVariant(kMips32r6)) {
-    // Clz instr requires same GPR number in 'rd' and 'rt' fields.
-    GenInstrRegister(SPECIAL2, rs, rd, rd, 0, CLZ);
-  } else {
-    GenInstrRegister(SPECIAL, rs, zero_reg, rd, 1, CLZ_R6);
-  }
-}
-
-
-void Assembler::ins_(Register rt, Register rs, uint16_t pos, uint16_t size) {
-  // Should be called via MacroAssembler::Ins.
-  // Ins instr has 'rt' field as dest, and two uint5: msb, lsb.
-  DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(SPECIAL3, rs, rt, pos + size - 1, pos, INS);
-}
-
-
-void Assembler::ext_(Register rt, Register rs, uint16_t pos, uint16_t size) {
-  // Should be called via MacroAssembler::Ext.
-  // Ext instr has 'rt' field as dest, and two uint5: msb, lsb.
-  DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(SPECIAL3, rs, rt, size - 1, pos, EXT);
-}
-
-
-void Assembler::bitswap(Register rd, Register rt) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(SPECIAL3, zero_reg, rt, rd, 0, BSHFL);
-}
-
-
-void Assembler::pref(int32_t hint, const MemOperand& rs) {
-  DCHECK(!IsMipsArchVariant(kLoongson));
-  DCHECK(is_uint5(hint) && is_uint16(rs.offset_));
-  Instr instr = PREF | (rs.rm().code() << kRsShift) | (hint << kRtShift)
-      | (rs.offset_);
-  emit(instr);
-}
-
-
-void Assembler::align(Register rd, Register rs, Register rt, uint8_t bp) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(is_uint3(bp));
-  uint16_t sa = (ALIGN << kBp2Bits) | bp;
-  GenInstrRegister(SPECIAL3, rs, rt, rd, sa, BSHFL);
-}
-
-// Byte swap.
-void Assembler::wsbh(Register rd, Register rt) {
-  DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(SPECIAL3, zero_reg, rt, rd, WSBH, BSHFL);
-}
-
-void Assembler::seh(Register rd, Register rt) {
-  DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(SPECIAL3, zero_reg, rt, rd, SEH, BSHFL);
-}
-
-void Assembler::seb(Register rd, Register rt) {
-  DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(SPECIAL3, zero_reg, rt, rd, SEB, BSHFL);
-}
-
-// --------Coprocessor-instructions----------------
-
-// Load, store, move.
-void Assembler::lwc1(FPURegister fd, const MemOperand& src) {
-  MemOperand tmp = src;
-  AdjustBaseAndOffset(tmp);
-  GenInstrImmediate(LWC1, tmp.rm(), fd, tmp.offset());
-}
-
-
-void Assembler::swc1(FPURegister fd, const MemOperand& src) {
-  MemOperand tmp = src;
-  AdjustBaseAndOffset(tmp);
-  GenInstrImmediate(SWC1, tmp.rm(), fd, tmp.offset());
-}
-
-
-void Assembler::mtc1(Register rt, FPURegister fs) {
-  GenInstrRegister(COP1, MTC1, rt, fs, f0);
-}
-
-
-void Assembler::mthc1(Register rt, FPURegister fs) {
-  GenInstrRegister(COP1, MTHC1, rt, fs, f0);
-}
-
-
-void Assembler::mfc1(Register rt, FPURegister fs) {
-  GenInstrRegister(COP1, MFC1, rt, fs, f0);
-}
-
-
-void Assembler::mfhc1(Register rt, FPURegister fs) {
-  GenInstrRegister(COP1, MFHC1, rt, fs, f0);
-}
-
-
-void Assembler::ctc1(Register rt, FPUControlRegister fs) {
-  GenInstrRegister(COP1, CTC1, rt, fs);
-}
-
-
-void Assembler::cfc1(Register rt, FPUControlRegister fs) {
-  GenInstrRegister(COP1, CFC1, rt, fs);
-}
-
-
-void Assembler::DoubleAsTwoUInt32(double d, uint32_t* lo, uint32_t* hi) {
-  uint64_t i;
-  memcpy(&i, &d, 8);
-
-  *lo = i & 0xFFFFFFFF;
-  *hi = i >> 32;
-}
-
-
-void Assembler::movn_s(FPURegister fd, FPURegister fs, Register rt) {
-  DCHECK(!IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(COP1, S, rt, fs, fd, MOVN_C);
-}
-
-
-void Assembler::movn_d(FPURegister fd, FPURegister fs, Register rt) {
-  DCHECK(!IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(COP1, D, rt, fs, fd, MOVN_C);
-}
-
-
-void Assembler::sel(SecondaryField fmt, FPURegister fd, FPURegister fs,
-                    FPURegister ft) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK((fmt == D) || (fmt == S));
-
-  GenInstrRegister(COP1, fmt, ft, fs, fd, SEL);
-}
-
-
-void Assembler::sel_s(FPURegister fd, FPURegister fs, FPURegister ft) {
-  sel(S, fd, fs, ft);
-}
-
-
-void Assembler::sel_d(FPURegister fd, FPURegister fs, FPURegister ft) {
-  sel(D, fd, fs, ft);
-}
-
-
-void Assembler::seleqz(SecondaryField fmt, FPURegister fd, FPURegister fs,
-                       FPURegister ft) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK((fmt == D) || (fmt == S));
-  GenInstrRegister(COP1, fmt, ft, fs, fd, SELEQZ_C);
-}
-
-
-void Assembler::selnez(Register rd, Register rs, Register rt) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, SELNEZ_S);
-}
-
-
-void Assembler::selnez(SecondaryField fmt, FPURegister fd, FPURegister fs,
-                       FPURegister ft) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK((fmt == D) || (fmt == S));
-  GenInstrRegister(COP1, fmt, ft, fs, fd, SELNEZ_C);
-}
-
-
-void Assembler::seleqz_d(FPURegister fd, FPURegister fs, FPURegister ft) {
-  seleqz(D, fd, fs, ft);
-}
-
-
-void Assembler::seleqz_s(FPURegister fd, FPURegister fs, FPURegister ft) {
-  seleqz(S, fd, fs, ft);
-}
-
-
-void Assembler::selnez_d(FPURegister fd, FPURegister fs, FPURegister ft) {
-  selnez(D, fd, fs, ft);
-}
-
-
-void Assembler::selnez_s(FPURegister fd, FPURegister fs, FPURegister ft) {
-  selnez(S, fd, fs, ft);
-}
-
-
-void Assembler::movz_s(FPURegister fd, FPURegister fs, Register rt) {
-  DCHECK(!IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(COP1, S, rt, fs, fd, MOVZ_C);
-}
-
-
-void Assembler::movz_d(FPURegister fd, FPURegister fs, Register rt) {
-  DCHECK(!IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(COP1, D, rt, fs, fd, MOVZ_C);
-}
-
-
-void Assembler::movt_s(FPURegister fd, FPURegister fs, uint16_t cc) {
-  DCHECK(!IsMipsArchVariant(kMips32r6));
-  FPURegister ft = FPURegister::from_code((cc & 0x0007) << 2 | 1);
-  GenInstrRegister(COP1, S, ft, fs, fd, MOVF);
-}
-
-
-void Assembler::movt_d(FPURegister fd, FPURegister fs, uint16_t cc) {
-  DCHECK(!IsMipsArchVariant(kMips32r6));
-  FPURegister ft = FPURegister::from_code((cc & 0x0007) << 2 | 1);
-  GenInstrRegister(COP1, D, ft, fs, fd, MOVF);
-}
-
-
-void Assembler::movf_s(FPURegister fd, FPURegister fs, uint16_t cc) {
-  DCHECK(!IsMipsArchVariant(kMips32r6));
-  FPURegister ft = FPURegister::from_code((cc & 0x0007) << 2 | 0);
-  GenInstrRegister(COP1, S, ft, fs, fd, MOVF);
-}
-
-
-void Assembler::movf_d(FPURegister fd, FPURegister fs, uint16_t cc) {
-  DCHECK(!IsMipsArchVariant(kMips32r6));
-  FPURegister ft = FPURegister::from_code((cc & 0x0007) << 2 | 0);
-  GenInstrRegister(COP1, D, ft, fs, fd, MOVF);
-}
-
-
-// Arithmetic.
-
-void Assembler::add_s(FPURegister fd, FPURegister fs, FPURegister ft) {
-  GenInstrRegister(COP1, S, ft, fs, fd, ADD_S);
-}
-
-
-void Assembler::add_d(FPURegister fd, FPURegister fs, FPURegister ft) {
-  GenInstrRegister(COP1, D, ft, fs, fd, ADD_D);
-}
-
-
-void Assembler::sub_s(FPURegister fd, FPURegister fs, FPURegister ft) {
-  GenInstrRegister(COP1, S, ft, fs, fd, SUB_S);
-}
-
-
-void Assembler::sub_d(FPURegister fd, FPURegister fs, FPURegister ft) {
-  GenInstrRegister(COP1, D, ft, fs, fd, SUB_D);
-}
-
-
-void Assembler::mul_s(FPURegister fd, FPURegister fs, FPURegister ft) {
-  GenInstrRegister(COP1, S, ft, fs, fd, MUL_S);
-}
-
-
-void Assembler::mul_d(FPURegister fd, FPURegister fs, FPURegister ft) {
-  GenInstrRegister(COP1, D, ft, fs, fd, MUL_D);
-}
-
-void Assembler::madd_s(FPURegister fd, FPURegister fr, FPURegister fs,
-                       FPURegister ft) {
-  DCHECK(IsMipsArchVariant(kMips32r2));
-  GenInstrRegister(COP1X, fr, ft, fs, fd, MADD_S);
-}
-
-void Assembler::madd_d(FPURegister fd, FPURegister fr, FPURegister fs,
-    FPURegister ft) {
-  DCHECK(IsMipsArchVariant(kMips32r2));
-  GenInstrRegister(COP1X, fr, ft, fs, fd, MADD_D);
-}
-
-void Assembler::msub_s(FPURegister fd, FPURegister fr, FPURegister fs,
-                       FPURegister ft) {
-  DCHECK(IsMipsArchVariant(kMips32r2));
-  GenInstrRegister(COP1X, fr, ft, fs, fd, MSUB_S);
-}
-
-void Assembler::msub_d(FPURegister fd, FPURegister fr, FPURegister fs,
-                       FPURegister ft) {
-  DCHECK(IsMipsArchVariant(kMips32r2));
-  GenInstrRegister(COP1X, fr, ft, fs, fd, MSUB_D);
-}
-
-void Assembler::maddf_s(FPURegister fd, FPURegister fs, FPURegister ft) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(COP1, S, ft, fs, fd, MADDF_S);
-}
-
-void Assembler::maddf_d(FPURegister fd, FPURegister fs, FPURegister ft) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(COP1, D, ft, fs, fd, MADDF_D);
-}
-
-void Assembler::msubf_s(FPURegister fd, FPURegister fs, FPURegister ft) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(COP1, S, ft, fs, fd, MSUBF_S);
-}
-
-void Assembler::msubf_d(FPURegister fd, FPURegister fs, FPURegister ft) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(COP1, D, ft, fs, fd, MSUBF_D);
-}
-
-void Assembler::div_s(FPURegister fd, FPURegister fs, FPURegister ft) {
-  GenInstrRegister(COP1, S, ft, fs, fd, DIV_S);
-}
-
-
-void Assembler::div_d(FPURegister fd, FPURegister fs, FPURegister ft) {
-  GenInstrRegister(COP1, D, ft, fs, fd, DIV_D);
-}
-
-
-void Assembler::abs_s(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, S, f0, fs, fd, ABS_S);
-}
-
-
-void Assembler::abs_d(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, D, f0, fs, fd, ABS_D);
-}
-
-
-void Assembler::mov_d(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, D, f0, fs, fd, MOV_D);
-}
-
-
-void Assembler::mov_s(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, S, f0, fs, fd, MOV_S);
-}
-
-
-void Assembler::neg_s(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, S, f0, fs, fd, NEG_S);
-}
-
-
-void Assembler::neg_d(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, D, f0, fs, fd, NEG_D);
-}
-
-
-void Assembler::sqrt_s(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, S, f0, fs, fd, SQRT_S);
-}
-
-
-void Assembler::sqrt_d(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, D, f0, fs, fd, SQRT_D);
-}
-
-
-void Assembler::rsqrt_s(FPURegister fd, FPURegister fs) {
-  DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(COP1, S, f0, fs, fd, RSQRT_S);
-}
-
-
-void Assembler::rsqrt_d(FPURegister fd, FPURegister fs) {
-  DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(COP1, D, f0, fs, fd, RSQRT_D);
-}
-
-
-void Assembler::recip_d(FPURegister fd, FPURegister fs) {
-  DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(COP1, D, f0, fs, fd, RECIP_D);
-}
-
-
-void Assembler::recip_s(FPURegister fd, FPURegister fs) {
-  DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(COP1, S, f0, fs, fd, RECIP_S);
-}
-
-
-// Conversions.
-
-void Assembler::cvt_w_s(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, S, f0, fs, fd, CVT_W_S);
-}
-
-
-void Assembler::cvt_w_d(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, D, f0, fs, fd, CVT_W_D);
-}
-
-
-void Assembler::trunc_w_s(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, S, f0, fs, fd, TRUNC_W_S);
-}
-
-
-void Assembler::trunc_w_d(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, D, f0, fs, fd, TRUNC_W_D);
-}
-
-
-void Assembler::round_w_s(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, S, f0, fs, fd, ROUND_W_S);
-}
-
-
-void Assembler::round_w_d(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, D, f0, fs, fd, ROUND_W_D);
-}
-
-
-void Assembler::floor_w_s(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, S, f0, fs, fd, FLOOR_W_S);
-}
-
-
-void Assembler::floor_w_d(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, D, f0, fs, fd, FLOOR_W_D);
-}
-
-
-void Assembler::ceil_w_s(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, S, f0, fs, fd, CEIL_W_S);
-}
-
-
-void Assembler::ceil_w_d(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, D, f0, fs, fd, CEIL_W_D);
-}
-
-
-void Assembler::rint_s(FPURegister fd, FPURegister fs) { rint(S, fd, fs); }
-
-
-void Assembler::rint(SecondaryField fmt, FPURegister fd, FPURegister fs) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK((fmt == D) || (fmt == S));
-  GenInstrRegister(COP1, fmt, f0, fs, fd, RINT);
-}
-
-
-void Assembler::rint_d(FPURegister fd, FPURegister fs) { rint(D, fd, fs); }
-
-
-void Assembler::cvt_l_s(FPURegister fd, FPURegister fs) {
-  DCHECK((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) &&
-         IsFp64Mode());
-  GenInstrRegister(COP1, S, f0, fs, fd, CVT_L_S);
-}
-
-
-void Assembler::cvt_l_d(FPURegister fd, FPURegister fs) {
-  DCHECK((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) &&
-         IsFp64Mode());
-  GenInstrRegister(COP1, D, f0, fs, fd, CVT_L_D);
-}
-
-
-void Assembler::trunc_l_s(FPURegister fd, FPURegister fs) {
-  DCHECK((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) &&
-         IsFp64Mode());
-  GenInstrRegister(COP1, S, f0, fs, fd, TRUNC_L_S);
-}
-
-
-void Assembler::trunc_l_d(FPURegister fd, FPURegister fs) {
-  DCHECK((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) &&
-         IsFp64Mode());
-  GenInstrRegister(COP1, D, f0, fs, fd, TRUNC_L_D);
-}
-
-
-void Assembler::round_l_s(FPURegister fd, FPURegister fs) {
-  DCHECK((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) &&
-         IsFp64Mode());
-  GenInstrRegister(COP1, S, f0, fs, fd, ROUND_L_S);
-}
-
-
-void Assembler::round_l_d(FPURegister fd, FPURegister fs) {
-  DCHECK((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) &&
-         IsFp64Mode());
-  GenInstrRegister(COP1, D, f0, fs, fd, ROUND_L_D);
-}
-
-
-void Assembler::floor_l_s(FPURegister fd, FPURegister fs) {
-  DCHECK((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) &&
-         IsFp64Mode());
-  GenInstrRegister(COP1, S, f0, fs, fd, FLOOR_L_S);
-}
-
-
-void Assembler::floor_l_d(FPURegister fd, FPURegister fs) {
-  DCHECK((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) &&
-         IsFp64Mode());
-  GenInstrRegister(COP1, D, f0, fs, fd, FLOOR_L_D);
-}
-
-
-void Assembler::ceil_l_s(FPURegister fd, FPURegister fs) {
-  DCHECK((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) &&
-         IsFp64Mode());
-  GenInstrRegister(COP1, S, f0, fs, fd, CEIL_L_S);
-}
-
-
-void Assembler::ceil_l_d(FPURegister fd, FPURegister fs) {
-  DCHECK((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) &&
-         IsFp64Mode());
-  GenInstrRegister(COP1, D, f0, fs, fd, CEIL_L_D);
-}
-
-
-void Assembler::class_s(FPURegister fd, FPURegister fs) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(COP1, S, f0, fs, fd, CLASS_S);
-}
-
-
-void Assembler::class_d(FPURegister fd, FPURegister fs) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  GenInstrRegister(COP1, D, f0, fs, fd, CLASS_D);
-}
-
-
-void Assembler::min(SecondaryField fmt, FPURegister fd, FPURegister fs,
-                    FPURegister ft) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK((fmt == D) || (fmt == S));
-  GenInstrRegister(COP1, fmt, ft, fs, fd, MIN);
-}
-
-
-void Assembler::mina(SecondaryField fmt, FPURegister fd, FPURegister fs,
-                     FPURegister ft) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK((fmt == D) || (fmt == S));
-  GenInstrRegister(COP1, fmt, ft, fs, fd, MINA);
-}
-
-
-void Assembler::max(SecondaryField fmt, FPURegister fd, FPURegister fs,
-                    FPURegister ft) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK((fmt == D) || (fmt == S));
-  GenInstrRegister(COP1, fmt, ft, fs, fd, MAX);
-}
-
-
-void Assembler::maxa(SecondaryField fmt, FPURegister fd, FPURegister fs,
-                     FPURegister ft) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK((fmt == D) || (fmt == S));
-  GenInstrRegister(COP1, fmt, ft, fs, fd, MAXA);
-}
-
-
-void Assembler::min_s(FPURegister fd, FPURegister fs, FPURegister ft) {
-  min(S, fd, fs, ft);
-}
-
-
-void Assembler::min_d(FPURegister fd, FPURegister fs, FPURegister ft) {
-  min(D, fd, fs, ft);
-}
-
-
-void Assembler::max_s(FPURegister fd, FPURegister fs, FPURegister ft) {
-  max(S, fd, fs, ft);
-}
-
-
-void Assembler::max_d(FPURegister fd, FPURegister fs, FPURegister ft) {
-  max(D, fd, fs, ft);
-}
-
-
-void Assembler::mina_s(FPURegister fd, FPURegister fs, FPURegister ft) {
-  mina(S, fd, fs, ft);
-}
-
-
-void Assembler::mina_d(FPURegister fd, FPURegister fs, FPURegister ft) {
-  mina(D, fd, fs, ft);
-}
-
-
-void Assembler::maxa_s(FPURegister fd, FPURegister fs, FPURegister ft) {
-  maxa(S, fd, fs, ft);
-}
-
-
-void Assembler::maxa_d(FPURegister fd, FPURegister fs, FPURegister ft) {
-  maxa(D, fd, fs, ft);
-}
-
-
-void Assembler::cvt_s_w(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, W, f0, fs, fd, CVT_S_W);
-}
-
-
-void Assembler::cvt_s_l(FPURegister fd, FPURegister fs) {
-  DCHECK((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) &&
-         IsFp64Mode());
-  GenInstrRegister(COP1, L, f0, fs, fd, CVT_S_L);
-}
-
-
-void Assembler::cvt_s_d(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, D, f0, fs, fd, CVT_S_D);
-}
-
-
-void Assembler::cvt_d_w(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, W, f0, fs, fd, CVT_D_W);
-}
-
-
-void Assembler::cvt_d_l(FPURegister fd, FPURegister fs) {
-  DCHECK((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) &&
-         IsFp64Mode());
-  GenInstrRegister(COP1, L, f0, fs, fd, CVT_D_L);
-}
-
-
-void Assembler::cvt_d_s(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, S, f0, fs, fd, CVT_D_S);
-}
-
-
-// Conditions for >= MIPSr6.
-void Assembler::cmp(FPUCondition cond, SecondaryField fmt,
-    FPURegister fd, FPURegister fs, FPURegister ft) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK_EQ(fmt & ~(31 << kRsShift), 0);
-  Instr instr = COP1 | fmt | ft.code() << kFtShift |
-      fs.code() << kFsShift | fd.code() << kFdShift | (0 << 5) | cond;
-  emit(instr);
-}
-
-
-void Assembler::cmp_s(FPUCondition cond, FPURegister fd, FPURegister fs,
-                      FPURegister ft) {
-  cmp(cond, W, fd, fs, ft);
-}
-
-void Assembler::cmp_d(FPUCondition cond, FPURegister fd, FPURegister fs,
-                      FPURegister ft) {
-  cmp(cond, L, fd, fs, ft);
-}
-
-
-void Assembler::bc1eqz(int16_t offset, FPURegister ft) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  Instr instr = COP1 | BC1EQZ | ft.code() << kFtShift | (offset & kImm16Mask);
-  emit(instr);
-}
-
-
-void Assembler::bc1nez(int16_t offset, FPURegister ft) {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  Instr instr = COP1 | BC1NEZ | ft.code() << kFtShift | (offset & kImm16Mask);
-  emit(instr);
-}
-
-
-// Conditions for < MIPSr6.
-void Assembler::c(FPUCondition cond, SecondaryField fmt,
-    FPURegister fs, FPURegister ft, uint16_t cc) {
-  DCHECK(is_uint3(cc));
-  DCHECK(fmt == S || fmt == D);
-  DCHECK_EQ(fmt & ~(31 << kRsShift), 0);
-  Instr instr = COP1 | fmt | ft.code() << 16 | fs.code() << kFsShift
-      | cc << 8 | 3 << 4 | cond;
-  emit(instr);
-}
-
-
-void Assembler::c_s(FPUCondition cond, FPURegister fs, FPURegister ft,
-                    uint16_t cc) {
-  c(cond, S, fs, ft, cc);
-}
-
-
-void Assembler::c_d(FPUCondition cond, FPURegister fs, FPURegister ft,
-                    uint16_t cc) {
-  c(cond, D, fs, ft, cc);
-}
-
-
-void Assembler::fcmp(FPURegister src1, const double src2,
-      FPUCondition cond) {
-  DCHECK_EQ(src2, 0.0);
-  mtc1(zero_reg, f14);
-  cvt_d_w(f14, f14);
-  c(cond, D, src1, f14, 0);
-}
-
-
-void Assembler::bc1f(int16_t offset, uint16_t cc) {
-  DCHECK(is_uint3(cc));
-  Instr instr = COP1 | BC1 | cc << 18 | 0 << 16 | (offset & kImm16Mask);
-  emit(instr);
-}
-
-
-void Assembler::bc1t(int16_t offset, uint16_t cc) {
-  DCHECK(is_uint3(cc));
-  Instr instr = COP1 | BC1 | cc << 18 | 1 << 16 | (offset & kImm16Mask);
-  emit(instr);
-}
-
-// ---------- MSA instructions ------------
-#define MSA_BRANCH_LIST(V) \
-  V(bz_v, BZ_V)            \
-  V(bz_b, BZ_B)            \
-  V(bz_h, BZ_H)            \
-  V(bz_w, BZ_W)            \
-  V(bz_d, BZ_D)            \
-  V(bnz_v, BNZ_V)          \
-  V(bnz_b, BNZ_B)          \
-  V(bnz_h, BNZ_H)          \
-  V(bnz_w, BNZ_W)          \
-  V(bnz_d, BNZ_D)
-
-#define MSA_BRANCH(name, opcode)                         \
-  void Assembler::name(MSARegister wt, int16_t offset) { \
-    GenInstrMsaBranch(opcode, wt, offset);               \
-  }
-
-MSA_BRANCH_LIST(MSA_BRANCH)
-#undef MSA_BRANCH
-#undef MSA_BRANCH_LIST
-
-#define MSA_LD_ST_LIST(V) \
-  V(ld_b, LD_B)           \
-  V(ld_h, LD_H)           \
-  V(ld_w, LD_W)           \
-  V(ld_d, LD_D)           \
-  V(st_b, ST_B)           \
-  V(st_h, ST_H)           \
-  V(st_w, ST_W)           \
-  V(st_d, ST_D)
-
-#define MSA_LD_ST(name, opcode)                                  \
-  void Assembler::name(MSARegister wd, const MemOperand& rs) {   \
-    MemOperand source = rs;                                      \
-    AdjustBaseAndOffset(source);                                 \
-    if (is_int10(source.offset())) {                             \
-      GenInstrMsaMI10(opcode, source.offset(), source.rm(), wd); \
-    } else {                                                     \
-      UseScratchRegisterScope temps(this);                       \
-      Register scratch = temps.Acquire();                        \
-      DCHECK(rs.rm() != scratch);                                \
-      addiu(scratch, source.rm(), source.offset());              \
-      GenInstrMsaMI10(opcode, 0, scratch, wd);                   \
-    }                                                            \
-  }
-
-MSA_LD_ST_LIST(MSA_LD_ST)
-#undef MSA_LD_ST
-#undef MSA_BRANCH_LIST
-
-#define MSA_I10_LIST(V) \
-  V(ldi_b, I5_DF_b)     \
-  V(ldi_h, I5_DF_h)     \
-  V(ldi_w, I5_DF_w)     \
-  V(ldi_d, I5_DF_d)
-
-#define MSA_I10(name, format)                           \
-  void Assembler::name(MSARegister wd, int32_t imm10) { \
-    GenInstrMsaI10(LDI, format, imm10, wd);             \
-  }
-MSA_I10_LIST(MSA_I10)
-#undef MSA_I10
-#undef MSA_I10_LIST
-
-#define MSA_I5_LIST(V) \
-  V(addvi, ADDVI)      \
-  V(subvi, SUBVI)      \
-  V(maxi_s, MAXI_S)    \
-  V(maxi_u, MAXI_U)    \
-  V(mini_s, MINI_S)    \
-  V(mini_u, MINI_U)    \
-  V(ceqi, CEQI)        \
-  V(clti_s, CLTI_S)    \
-  V(clti_u, CLTI_U)    \
-  V(clei_s, CLEI_S)    \
-  V(clei_u, CLEI_U)
-
-#define MSA_I5_FORMAT(name, opcode, format)                       \
-  void Assembler::name##_##format(MSARegister wd, MSARegister ws, \
-                                  uint32_t imm5) {                \
-    GenInstrMsaI5(opcode, I5_DF_##format, imm5, ws, wd);          \
-  }
-
-#define MSA_I5(name, opcode)     \
-  MSA_I5_FORMAT(name, opcode, b) \
-  MSA_I5_FORMAT(name, opcode, h) \
-  MSA_I5_FORMAT(name, opcode, w) \
-  MSA_I5_FORMAT(name, opcode, d)
-
-MSA_I5_LIST(MSA_I5)
-#undef MSA_I5
-#undef MSA_I5_FORMAT
-#undef MSA_I5_LIST
-
-#define MSA_I8_LIST(V) \
-  V(andi_b, ANDI_B)    \
-  V(ori_b, ORI_B)      \
-  V(nori_b, NORI_B)    \
-  V(xori_b, XORI_B)    \
-  V(bmnzi_b, BMNZI_B)  \
-  V(bmzi_b, BMZI_B)    \
-  V(bseli_b, BSELI_B)  \
-  V(shf_b, SHF_B)      \
-  V(shf_h, SHF_H)      \
-  V(shf_w, SHF_W)
-
-#define MSA_I8(name, opcode)                                            \
-  void Assembler::name(MSARegister wd, MSARegister ws, uint32_t imm8) { \
-    GenInstrMsaI8(opcode, imm8, ws, wd);                                \
-  }
-
-MSA_I8_LIST(MSA_I8)
-#undef MSA_I8
-#undef MSA_I8_LIST
-
-#define MSA_VEC_LIST(V) \
-  V(and_v, AND_V)       \
-  V(or_v, OR_V)         \
-  V(nor_v, NOR_V)       \
-  V(xor_v, XOR_V)       \
-  V(bmnz_v, BMNZ_V)     \
-  V(bmz_v, BMZ_V)       \
-  V(bsel_v, BSEL_V)
-
-#define MSA_VEC(name, opcode)                                            \
-  void Assembler::name(MSARegister wd, MSARegister ws, MSARegister wt) { \
-    GenInstrMsaVec(opcode, wt, ws, wd);                                  \
-  }
-
-MSA_VEC_LIST(MSA_VEC)
-#undef MSA_VEC
-#undef MSA_VEC_LIST
-
-#define MSA_2R_LIST(V) \
-  V(pcnt, PCNT)        \
-  V(nloc, NLOC)        \
-  V(nlzc, NLZC)
-
-#define MSA_2R_FORMAT(name, opcode, format)                         \
-  void Assembler::name##_##format(MSARegister wd, MSARegister ws) { \
-    GenInstrMsa2R(opcode, MSA_2R_DF_##format, ws, wd);              \
-  }
-
-#define MSA_2R(name, opcode)     \
-  MSA_2R_FORMAT(name, opcode, b) \
-  MSA_2R_FORMAT(name, opcode, h) \
-  MSA_2R_FORMAT(name, opcode, w) \
-  MSA_2R_FORMAT(name, opcode, d)
-
-MSA_2R_LIST(MSA_2R)
-#undef MSA_2R
-#undef MSA_2R_FORMAT
-#undef MSA_2R_LIST
-
-#define MSA_FILL(format)                                              \
-  void Assembler::fill_##format(MSARegister wd, Register rs) {        \
-    DCHECK(IsMipsArchVariant(kMips32r6) && IsEnabled(MIPS_SIMD));     \
-    DCHECK(rs.is_valid() && wd.is_valid());                           \
-    Instr instr = MSA | MSA_2R_FORMAT | FILL | MSA_2R_DF_##format |   \
-                  (rs.code() << kWsShift) | (wd.code() << kWdShift) | \
-                  MSA_VEC_2R_2RF_MINOR;                               \
-    emit(instr);                                                      \
-  }
-
-MSA_FILL(b)
-MSA_FILL(h)
-MSA_FILL(w)
-#undef MSA_FILL
-
-#define MSA_2RF_LIST(V) \
-  V(fclass, FCLASS)     \
-  V(ftrunc_s, FTRUNC_S) \
-  V(ftrunc_u, FTRUNC_U) \
-  V(fsqrt, FSQRT)       \
-  V(frsqrt, FRSQRT)     \
-  V(frcp, FRCP)         \
-  V(frint, FRINT)       \
-  V(flog2, FLOG2)       \
-  V(fexupl, FEXUPL)     \
-  V(fexupr, FEXUPR)     \
-  V(ffql, FFQL)         \
-  V(ffqr, FFQR)         \
-  V(ftint_s, FTINT_S)   \
-  V(ftint_u, FTINT_U)   \
-  V(ffint_s, FFINT_S)   \
-  V(ffint_u, FFINT_U)
-
-#define MSA_2RF_FORMAT(name, opcode, format)                        \
-  void Assembler::name##_##format(MSARegister wd, MSARegister ws) { \
-    GenInstrMsa2RF(opcode, MSA_2RF_DF_##format, ws, wd);            \
-  }
-
-#define MSA_2RF(name, opcode)     \
-  MSA_2RF_FORMAT(name, opcode, w) \
-  MSA_2RF_FORMAT(name, opcode, d)
-
-MSA_2RF_LIST(MSA_2RF)
-#undef MSA_2RF
-#undef MSA_2RF_FORMAT
-#undef MSA_2RF_LIST
-
-#define MSA_3R_LIST(V)  \
-  V(sll, SLL_MSA)       \
-  V(sra, SRA_MSA)       \
-  V(srl, SRL_MSA)       \
-  V(bclr, BCLR)         \
-  V(bset, BSET)         \
-  V(bneg, BNEG)         \
-  V(binsl, BINSL)       \
-  V(binsr, BINSR)       \
-  V(addv, ADDV)         \
-  V(subv, SUBV)         \
-  V(max_s, MAX_S)       \
-  V(max_u, MAX_U)       \
-  V(min_s, MIN_S)       \
-  V(min_u, MIN_U)       \
-  V(max_a, MAX_A)       \
-  V(min_a, MIN_A)       \
-  V(ceq, CEQ)           \
-  V(clt_s, CLT_S)       \
-  V(clt_u, CLT_U)       \
-  V(cle_s, CLE_S)       \
-  V(cle_u, CLE_U)       \
-  V(add_a, ADD_A)       \
-  V(adds_a, ADDS_A)     \
-  V(adds_s, ADDS_S)     \
-  V(adds_u, ADDS_U)     \
-  V(ave_s, AVE_S)       \
-  V(ave_u, AVE_U)       \
-  V(aver_s, AVER_S)     \
-  V(aver_u, AVER_U)     \
-  V(subs_s, SUBS_S)     \
-  V(subs_u, SUBS_U)     \
-  V(subsus_u, SUBSUS_U) \
-  V(subsuu_s, SUBSUU_S) \
-  V(asub_s, ASUB_S)     \
-  V(asub_u, ASUB_U)     \
-  V(mulv, MULV)         \
-  V(maddv, MADDV)       \
-  V(msubv, MSUBV)       \
-  V(div_s, DIV_S_MSA)   \
-  V(div_u, DIV_U)       \
-  V(mod_s, MOD_S)       \
-  V(mod_u, MOD_U)       \
-  V(dotp_s, DOTP_S)     \
-  V(dotp_u, DOTP_U)     \
-  V(dpadd_s, DPADD_S)   \
-  V(dpadd_u, DPADD_U)   \
-  V(dpsub_s, DPSUB_S)   \
-  V(dpsub_u, DPSUB_U)   \
-  V(pckev, PCKEV)       \
-  V(pckod, PCKOD)       \
-  V(ilvl, ILVL)         \
-  V(ilvr, ILVR)         \
-  V(ilvev, ILVEV)       \
-  V(ilvod, ILVOD)       \
-  V(vshf, VSHF)         \
-  V(srar, SRAR)         \
-  V(srlr, SRLR)         \
-  V(hadd_s, HADD_S)     \
-  V(hadd_u, HADD_U)     \
-  V(hsub_s, HSUB_S)     \
-  V(hsub_u, HSUB_U)
-
-#define MSA_3R_FORMAT(name, opcode, format)                             \
-  void Assembler::name##_##format(MSARegister wd, MSARegister ws,       \
-                                  MSARegister wt) {                     \
-    GenInstrMsa3R<MSARegister>(opcode, MSA_3R_DF_##format, wt, ws, wd); \
-  }
-
-#define MSA_3R_FORMAT_SLD_SPLAT(name, opcode, format)                \
-  void Assembler::name##_##format(MSARegister wd, MSARegister ws,    \
-                                  Register rt) {                     \
-    GenInstrMsa3R<Register>(opcode, MSA_3R_DF_##format, rt, ws, wd); \
-  }
-
-#define MSA_3R(name, opcode)     \
-  MSA_3R_FORMAT(name, opcode, b) \
-  MSA_3R_FORMAT(name, opcode, h) \
-  MSA_3R_FORMAT(name, opcode, w) \
-  MSA_3R_FORMAT(name, opcode, d)
-
-#define MSA_3R_SLD_SPLAT(name, opcode)     \
-  MSA_3R_FORMAT_SLD_SPLAT(name, opcode, b) \
-  MSA_3R_FORMAT_SLD_SPLAT(name, opcode, h) \
-  MSA_3R_FORMAT_SLD_SPLAT(name, opcode, w) \
-  MSA_3R_FORMAT_SLD_SPLAT(name, opcode, d)
-
-MSA_3R_LIST(MSA_3R)
-MSA_3R_SLD_SPLAT(sld, SLD)
-MSA_3R_SLD_SPLAT(splat, SPLAT)
-
-#undef MSA_3R
-#undef MSA_3R_FORMAT
-#undef MSA_3R_FORMAT_SLD_SPLAT
-#undef MSA_3R_SLD_SPLAT
-#undef MSA_3R_LIST
-
-#define MSA_3RF_LIST1(V) \
-  V(fcaf, FCAF)          \
-  V(fcun, FCUN)          \
-  V(fceq, FCEQ)          \
-  V(fcueq, FCUEQ)        \
-  V(fclt, FCLT)          \
-  V(fcult, FCULT)        \
-  V(fcle, FCLE)          \
-  V(fcule, FCULE)        \
-  V(fsaf, FSAF)          \
-  V(fsun, FSUN)          \
-  V(fseq, FSEQ)          \
-  V(fsueq, FSUEQ)        \
-  V(fslt, FSLT)          \
-  V(fsult, FSULT)        \
-  V(fsle, FSLE)          \
-  V(fsule, FSULE)        \
-  V(fadd, FADD)          \
-  V(fsub, FSUB)          \
-  V(fmul, FMUL)          \
-  V(fdiv, FDIV)          \
-  V(fmadd, FMADD)        \
-  V(fmsub, FMSUB)        \
-  V(fexp2, FEXP2)        \
-  V(fmin, FMIN)          \
-  V(fmin_a, FMIN_A)      \
-  V(fmax, FMAX)          \
-  V(fmax_a, FMAX_A)      \
-  V(fcor, FCOR)          \
-  V(fcune, FCUNE)        \
-  V(fcne, FCNE)          \
-  V(fsor, FSOR)          \
-  V(fsune, FSUNE)        \
-  V(fsne, FSNE)
-
-#define MSA_3RF_LIST2(V) \
-  V(fexdo, FEXDO)        \
-  V(ftq, FTQ)            \
-  V(mul_q, MUL_Q)        \
-  V(madd_q, MADD_Q)      \
-  V(msub_q, MSUB_Q)      \
-  V(mulr_q, MULR_Q)      \
-  V(maddr_q, MADDR_Q)    \
-  V(msubr_q, MSUBR_Q)
-
-#define MSA_3RF_FORMAT(name, opcode, df, df_c)                \
-  void Assembler::name##_##df(MSARegister wd, MSARegister ws, \
-                              MSARegister wt) {               \
-    GenInstrMsa3RF(opcode, df_c, wt, ws, wd);                 \
-  }
-
-#define MSA_3RF_1(name, opcode)      \
-  MSA_3RF_FORMAT(name, opcode, w, 0) \
-  MSA_3RF_FORMAT(name, opcode, d, 1)
-
-#define MSA_3RF_2(name, opcode)      \
-  MSA_3RF_FORMAT(name, opcode, h, 0) \
-  MSA_3RF_FORMAT(name, opcode, w, 1)
-
-MSA_3RF_LIST1(MSA_3RF_1)
-MSA_3RF_LIST2(MSA_3RF_2)
-#undef MSA_3RF_1
-#undef MSA_3RF_2
-#undef MSA_3RF_FORMAT
-#undef MSA_3RF_LIST1
-#undef MSA_3RF_LIST2
-
-void Assembler::sldi_b(MSARegister wd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<MSARegister, MSARegister>(SLDI, ELM_DF_B, n, ws, wd);
-}
-
-void Assembler::sldi_h(MSARegister wd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<MSARegister, MSARegister>(SLDI, ELM_DF_H, n, ws, wd);
-}
-
-void Assembler::sldi_w(MSARegister wd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<MSARegister, MSARegister>(SLDI, ELM_DF_W, n, ws, wd);
-}
-
-void Assembler::sldi_d(MSARegister wd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<MSARegister, MSARegister>(SLDI, ELM_DF_D, n, ws, wd);
-}
-
-void Assembler::splati_b(MSARegister wd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<MSARegister, MSARegister>(SPLATI, ELM_DF_B, n, ws, wd);
-}
-
-void Assembler::splati_h(MSARegister wd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<MSARegister, MSARegister>(SPLATI, ELM_DF_H, n, ws, wd);
-}
-
-void Assembler::splati_w(MSARegister wd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<MSARegister, MSARegister>(SPLATI, ELM_DF_W, n, ws, wd);
-}
-
-void Assembler::splati_d(MSARegister wd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<MSARegister, MSARegister>(SPLATI, ELM_DF_D, n, ws, wd);
-}
-
-void Assembler::copy_s_b(Register rd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<Register, MSARegister>(COPY_S, ELM_DF_B, n, ws, rd);
-}
-
-void Assembler::copy_s_h(Register rd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<Register, MSARegister>(COPY_S, ELM_DF_H, n, ws, rd);
-}
-
-void Assembler::copy_s_w(Register rd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<Register, MSARegister>(COPY_S, ELM_DF_W, n, ws, rd);
-}
-
-void Assembler::copy_u_b(Register rd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<Register, MSARegister>(COPY_U, ELM_DF_B, n, ws, rd);
-}
-
-void Assembler::copy_u_h(Register rd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<Register, MSARegister>(COPY_U, ELM_DF_H, n, ws, rd);
-}
-
-void Assembler::copy_u_w(Register rd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<Register, MSARegister>(COPY_U, ELM_DF_W, n, ws, rd);
-}
-
-void Assembler::insert_b(MSARegister wd, uint32_t n, Register rs) {
-  GenInstrMsaElm<MSARegister, Register>(INSERT, ELM_DF_B, n, rs, wd);
-}
-
-void Assembler::insert_h(MSARegister wd, uint32_t n, Register rs) {
-  GenInstrMsaElm<MSARegister, Register>(INSERT, ELM_DF_H, n, rs, wd);
-}
-
-void Assembler::insert_w(MSARegister wd, uint32_t n, Register rs) {
-  GenInstrMsaElm<MSARegister, Register>(INSERT, ELM_DF_W, n, rs, wd);
-}
-
-void Assembler::insve_b(MSARegister wd, uint32_t n, MSARegister ws) {
-  GenInstrMsaElm<MSARegister, MSARegister>(INSVE, ELM_DF_B, n, ws, wd);
-}
-
-void Assembler::insve_h(MSARegister wd, uint32_t n, MSARegister ws) {
-  GenInstrMsaElm<MSARegister, MSARegister>(INSVE, ELM_DF_H, n, ws, wd);
-}
-
-void Assembler::insve_w(MSARegister wd, uint32_t n, MSARegister ws) {
-  GenInstrMsaElm<MSARegister, MSARegister>(INSVE, ELM_DF_W, n, ws, wd);
-}
-
-void Assembler::insve_d(MSARegister wd, uint32_t n, MSARegister ws) {
-  GenInstrMsaElm<MSARegister, MSARegister>(INSVE, ELM_DF_D, n, ws, wd);
-}
-
-void Assembler::move_v(MSARegister wd, MSARegister ws) {
-  DCHECK(IsMipsArchVariant(kMips32r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(ws.is_valid() && wd.is_valid());
-  Instr instr = MSA | MOVE_V | (ws.code() << kWsShift) |
-                (wd.code() << kWdShift) | MSA_ELM_MINOR;
-  emit(instr);
-}
-
-void Assembler::ctcmsa(MSAControlRegister cd, Register rs) {
-  DCHECK(IsMipsArchVariant(kMips32r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(cd.is_valid() && rs.is_valid());
-  Instr instr = MSA | CTCMSA | (rs.code() << kWsShift) |
-                (cd.code() << kWdShift) | MSA_ELM_MINOR;
-  emit(instr);
-}
-
-void Assembler::cfcmsa(Register rd, MSAControlRegister cs) {
-  DCHECK(IsMipsArchVariant(kMips32r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(rd.is_valid() && cs.is_valid());
-  Instr instr = MSA | CFCMSA | (cs.code() << kWsShift) |
-                (rd.code() << kWdShift) | MSA_ELM_MINOR;
-  emit(instr);
-}
-
-#define MSA_BIT_LIST(V) \
-  V(slli, SLLI)         \
-  V(srai, SRAI)         \
-  V(srli, SRLI)         \
-  V(bclri, BCLRI)       \
-  V(bseti, BSETI)       \
-  V(bnegi, BNEGI)       \
-  V(binsli, BINSLI)     \
-  V(binsri, BINSRI)     \
-  V(sat_s, SAT_S)       \
-  V(sat_u, SAT_U)       \
-  V(srari, SRARI)       \
-  V(srlri, SRLRI)
-
-#define MSA_BIT_FORMAT(name, opcode, format)                      \
-  void Assembler::name##_##format(MSARegister wd, MSARegister ws, \
-                                  uint32_t m) {                   \
-    GenInstrMsaBit(opcode, BIT_DF_##format, m, ws, wd);           \
-  }
-
-#define MSA_BIT(name, opcode)     \
-  MSA_BIT_FORMAT(name, opcode, b) \
-  MSA_BIT_FORMAT(name, opcode, h) \
-  MSA_BIT_FORMAT(name, opcode, w) \
-  MSA_BIT_FORMAT(name, opcode, d)
-
-MSA_BIT_LIST(MSA_BIT)
-#undef MSA_BIT
-#undef MSA_BIT_FORMAT
-#undef MSA_BIT_LIST
-
-int Assembler::RelocateInternalReference(RelocInfo::Mode rmode, byte* pc,
-                                         intptr_t pc_delta) {
-  Instr instr = instr_at(pc);
-
-  if (RelocInfo::IsInternalReference(rmode)) {
-    int32_t* p = reinterpret_cast<int32_t*>(pc);
-    if (*p == 0) {
-      return 0;  // Number of instructions patched.
-    }
-    *p += pc_delta;
-    return 1;  // Number of instructions patched.
-  } else {
-    DCHECK(RelocInfo::IsInternalReferenceEncoded(rmode));
-    if (IsLui(instr)) {
-      Instr instr1 = instr_at(pc + 0 * Assembler::kInstrSize);
-      Instr instr2 = instr_at(pc + 1 * Assembler::kInstrSize);
-      DCHECK(IsOri(instr2) || IsJicOrJialc(instr2));
-      int32_t imm;
-      if (IsJicOrJialc(instr2)) {
-        imm = CreateTargetAddress(instr1, instr2);
-      } else {
-        imm = (instr1 & static_cast<int32_t>(kImm16Mask)) << kLuiShift;
-        imm |= (instr2 & static_cast<int32_t>(kImm16Mask));
-      }
-
-      if (imm == kEndOfJumpChain) {
-        return 0;  // Number of instructions patched.
-      }
-      imm += pc_delta;
-      DCHECK_EQ(imm & 3, 0);
-      instr1 &= ~kImm16Mask;
-      instr2 &= ~kImm16Mask;
-
-      if (IsJicOrJialc(instr2)) {
-        uint32_t lui_offset_u, jic_offset_u;
-        Assembler::UnpackTargetAddressUnsigned(imm, lui_offset_u, jic_offset_u);
-        instr_at_put(pc + 0 * Assembler::kInstrSize, instr1 | lui_offset_u);
-        instr_at_put(pc + 1 * Assembler::kInstrSize, instr2 | jic_offset_u);
-      } else {
-        instr_at_put(pc + 0 * Assembler::kInstrSize,
-                     instr1 | ((imm >> kLuiShift) & kImm16Mask));
-        instr_at_put(pc + 1 * Assembler::kInstrSize,
-                     instr2 | (imm & kImm16Mask));
-      }
-      return 2;  // Number of instructions patched.
-    } else {
-      UNREACHABLE();
-    }
-  }
-}
-
-
-void Assembler::GrowBuffer() {
-  if (!own_buffer_) FATAL("external code buffer is too small");
-
-  // Compute new buffer size.
-  CodeDesc desc;  // the new buffer
-  if (buffer_size_ < 1 * MB) {
-    desc.buffer_size = 2*buffer_size_;
-  } else {
-    desc.buffer_size = buffer_size_ + 1*MB;
-  }
-
-  // Some internal data structures overflow for very large buffers,
-  // they must ensure that kMaximalBufferSize is not too large.
-  if (desc.buffer_size > kMaximalBufferSize) {
-    V8::FatalProcessOutOfMemory("Assembler::GrowBuffer");
-  }
-
-  // Set up new buffer.
-  desc.buffer = NewArray<byte>(desc.buffer_size);
-  desc.origin = this;
-
-  desc.instr_size = pc_offset();
-  desc.reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos();
-
-  // Copy the data.
-  int pc_delta = desc.buffer - buffer_;
-  int rc_delta = (desc.buffer + desc.buffer_size) - (buffer_ + buffer_size_);
-  MemMove(desc.buffer, buffer_, desc.instr_size);
-  MemMove(reloc_info_writer.pos() + rc_delta, reloc_info_writer.pos(),
-          desc.reloc_size);
-
-  // Switch buffers.
-  DeleteArray(buffer_);
-  buffer_ = desc.buffer;
-  buffer_size_ = desc.buffer_size;
-  pc_ += pc_delta;
-  reloc_info_writer.Reposition(reloc_info_writer.pos() + rc_delta,
-                               reloc_info_writer.last_pc() + pc_delta);
-
-  // Relocate runtime entries.
-  for (RelocIterator it(desc); !it.done(); it.next()) {
-    RelocInfo::Mode rmode = it.rinfo()->rmode();
-    if (rmode == RelocInfo::INTERNAL_REFERENCE_ENCODED ||
-        rmode == RelocInfo::INTERNAL_REFERENCE) {
-      byte* p = reinterpret_cast<byte*>(it.rinfo()->pc());
-      RelocateInternalReference(rmode, p, pc_delta);
-    }
-  }
-  DCHECK(!overflow());
-}
-
-
-void Assembler::db(uint8_t data) {
-  CheckForEmitInForbiddenSlot();
-  EmitHelper(data);
-}
-
-
-void Assembler::dd(uint32_t data) {
-  CheckForEmitInForbiddenSlot();
-  EmitHelper(data);
-}
-
-
-void Assembler::dq(uint64_t data) {
-  CheckForEmitInForbiddenSlot();
-  EmitHelper(data);
-}
-
-
-void Assembler::dd(Label* label) {
-  uint32_t data;
-  CheckForEmitInForbiddenSlot();
-  if (label->is_bound()) {
-    data = reinterpret_cast<uint32_t>(buffer_ + label->pos());
-  } else {
-    data = jump_address(label);
-    unbound_labels_count_++;
-    internal_reference_positions_.insert(label->pos());
-  }
-  RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE);
-  EmitHelper(data);
-}
-
-
-void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
-  // We do not try to reuse pool constants.
-  RelocInfo rinfo(pc_, rmode, data, nullptr);
-  if (!RelocInfo::IsNone(rinfo.rmode())) {
-    // Don't record external references unless the heap will be serialized.
-    if (rmode == RelocInfo::EXTERNAL_REFERENCE &&
-        !serializer_enabled() && !emit_debug_code()) {
-      return;
-    }
-    DCHECK_GE(buffer_space(), kMaxRelocSize);  // Too late to grow buffer here.
-    reloc_info_writer.Write(&rinfo);
-  }
-}
-
-
-void Assembler::BlockTrampolinePoolFor(int instructions) {
-  CheckTrampolinePoolQuick(instructions);
-  BlockTrampolinePoolBefore(pc_offset() + instructions * kInstrSize);
-}
-
-
-void Assembler::CheckTrampolinePool() {
-  // Some small sequences of instructions must not be broken up by the
-  // insertion of a trampoline pool; such sequences are protected by setting
-  // either trampoline_pool_blocked_nesting_ or no_trampoline_pool_before_,
-  // which are both checked here. Also, recursive calls to CheckTrampolinePool
-  // are blocked by trampoline_pool_blocked_nesting_.
-  if ((trampoline_pool_blocked_nesting_ > 0) ||
-      (pc_offset() < no_trampoline_pool_before_)) {
-    // Emission is currently blocked; make sure we try again as soon as
-    // possible.
-    if (trampoline_pool_blocked_nesting_ > 0) {
-      next_buffer_check_ = pc_offset() + kInstrSize;
-    } else {
-      next_buffer_check_ = no_trampoline_pool_before_;
-    }
-    return;
-  }
-
-  DCHECK(!trampoline_emitted_);
-  DCHECK_GE(unbound_labels_count_, 0);
-  if (unbound_labels_count_ > 0) {
-    // First we emit jump (2 instructions), then we emit trampoline pool.
-    { BlockTrampolinePoolScope block_trampoline_pool(this);
-      Label after_pool;
-      if (IsMipsArchVariant(kMips32r6)) {
-        bc(&after_pool);
-      } else {
-        b(&after_pool);
-        nop();
-      }
-
-      int pool_start = pc_offset();
-      if (IsMipsArchVariant(kMips32r6)) {
-        for (int i = 0; i < unbound_labels_count_; i++) {
-          uint32_t imm32;
-          imm32 = jump_address(&after_pool);
-          uint32_t lui_offset, jic_offset;
-          UnpackTargetAddressUnsigned(imm32, lui_offset, jic_offset);
-          {
-            BlockGrowBufferScope block_buf_growth(this);
-            // Buffer growth (and relocation) must be blocked for internal
-            // references until associated instructions are emitted and
-            // available to be patched.
-            RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE_ENCODED);
-            UseScratchRegisterScope temps(this);
-            Register scratch = temps.hasAvailable() ? temps.Acquire() : t8;
-            lui(scratch, lui_offset);
-            jic(scratch, jic_offset);
-          }
-          CheckBuffer();
-        }
-      } else {
-        for (int i = 0; i < unbound_labels_count_; i++) {
-          uint32_t imm32;
-          imm32 = jump_address(&after_pool);
-          UseScratchRegisterScope temps(this);
-          Register scratch = temps.hasAvailable() ? temps.Acquire() : t8;
-          {
-            BlockGrowBufferScope block_buf_growth(this);
-            // Buffer growth (and relocation) must be blocked for internal
-            // references until associated instructions are emitted and
-            // available to be patched.
-            RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE_ENCODED);
-            lui(scratch, (imm32 & kHiMask) >> kLuiShift);
-            ori(scratch, scratch, (imm32 & kImm16Mask));
-          }
-          CheckBuffer();
-          jr(scratch);
-          nop();
-        }
-      }
-      bind(&after_pool);
-      trampoline_ = Trampoline(pool_start, unbound_labels_count_);
-
-      trampoline_emitted_ = true;
-      // As we are only going to emit trampoline once, we need to prevent any
-      // further emission.
-      next_buffer_check_ = kMaxInt;
-    }
-  } else {
-    // Number of branches to unbound label at this point is zero, so we can
-    // move next buffer check to maximum.
-    next_buffer_check_ = pc_offset() +
-        kMaxBranchOffset - kTrampolineSlotsSize * 16;
-  }
-  return;
-}
-
-
-Address Assembler::target_address_at(Address pc) {
-  Instr instr1 = instr_at(pc);
-  Instr instr2 = instr_at(pc + kInstrSize);
-  // Interpret 2 instructions generated by li (lui/ori) or optimized pairs
-  // lui/jic, aui/jic or lui/jialc.
-  if (IsLui(instr1)) {
-    if (IsOri(instr2)) {
-      // Assemble the 32 bit value.
-      return reinterpret_cast<Address>((GetImmediate16(instr1) << kLuiShift) |
-                                       GetImmediate16(instr2));
-    } else if (IsJicOrJialc(instr2)) {
-      // Assemble the 32 bit value.
-      return reinterpret_cast<Address>(CreateTargetAddress(instr1, instr2));
-    }
-  }
-
-  // We should never get here, force a bad address if we do.
-  UNREACHABLE();
-}
-
-
-// MIPS and ia32 use opposite encoding for qNaN and sNaN, such that ia32
-// qNaN is a MIPS sNaN, and ia32 sNaN is MIPS qNaN. If running from a heap
-// snapshot generated on ia32, the resulting MIPS sNaN must be quieted.
-// OS::nan_value() returns a qNaN.
-void Assembler::QuietNaN(HeapObject* object) {
-  HeapNumber::cast(object)->set_value(std::numeric_limits<double>::quiet_NaN());
-}
-
-
-// On Mips, a target address is stored in a lui/ori instruction pair, each
-// of which load 16 bits of the 32-bit address to a register.
-// Patching the address must replace both instr, and flush the i-cache.
-// On r6, target address is stored in a lui/jic pair, and both instr have to be
-// patched.
-//
-// There is an optimization below, which emits a nop when the address
-// fits in just 16 bits. This is unlikely to help, and should be benchmarked,
-// and possibly removed.
-void Assembler::set_target_value_at(Isolate* isolate, Address pc,
-                                    uint32_t target,
-                                    ICacheFlushMode icache_flush_mode) {
-  DCHECK_IMPLIES(isolate == nullptr, icache_flush_mode == SKIP_ICACHE_FLUSH);
-
-  Instr instr2 = instr_at(pc + kInstrSize);
-  uint32_t rt_code = GetRtField(instr2);
-  uint32_t* p = reinterpret_cast<uint32_t*>(pc);
-
-#ifdef DEBUG
-  // Check we have the result from a li macro-instruction, using instr pair.
-  Instr instr1 = instr_at(pc);
-  DCHECK(IsLui(instr1) && (IsOri(instr2) || IsJicOrJialc(instr2)));
-#endif
-
-  if (IsJicOrJialc(instr2)) {
-    // Must use 2 instructions to insure patchable code => use lui and jic
-    uint32_t lui_offset, jic_offset;
-    Assembler::UnpackTargetAddressUnsigned(target, lui_offset, jic_offset);
-
-    *p &= ~kImm16Mask;
-    *(p + 1) &= ~kImm16Mask;
-
-    *p |= lui_offset;
-    *(p + 1) |= jic_offset;
-
-  } else {
-    // Must use 2 instructions to insure patchable code => just use lui and ori.
-    // lui rt, upper-16.
-    // ori rt rt, lower-16.
-    *p = LUI | rt_code | ((target & kHiMask) >> kLuiShift);
-    *(p + 1) = ORI | rt_code | (rt_code << 5) | (target & kImm16Mask);
-  }
-
-  if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
-    Assembler::FlushICache(isolate, pc, 2 * sizeof(int32_t));
-  }
-}
-
-UseScratchRegisterScope::UseScratchRegisterScope(Assembler* assembler)
-    : available_(assembler->GetScratchRegisterList()),
-      old_available_(*available_) {}
-
-UseScratchRegisterScope::~UseScratchRegisterScope() {
-  *available_ = old_available_;
-}
-
-Register UseScratchRegisterScope::Acquire() {
-  DCHECK_NOT_NULL(available_);
-  DCHECK_NE(*available_, 0);
-  int index = static_cast<int>(base::bits::CountTrailingZeros32(*available_));
-  *available_ &= ~(1UL << index);
-
-  return Register::from_code(index);
-}
-
-bool UseScratchRegisterScope::hasAvailable() const { return *available_ != 0; }
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_MIPS
diff --git a/src/v8/src/mips/assembler-mips.h b/src/v8/src/mips/assembler-mips.h
deleted file mode 100644
index 4c68e73..0000000
--- a/src/v8/src/mips/assembler-mips.h
+++ /dev/null
@@ -1,2238 +0,0 @@
-// Copyright (c) 1994-2006 Sun Microsystems Inc.
-// 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.
-//
-// - Redistribution 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 Sun Microsystems or the names of 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.
-
-// The original source code covered by the above license above has been
-// modified significantly by Google Inc.
-// Copyright 2012 the V8 project authors. All rights reserved.
-
-
-#ifndef V8_MIPS_ASSEMBLER_MIPS_H_
-#define V8_MIPS_ASSEMBLER_MIPS_H_
-
-#include <stdio.h>
-
-#include <set>
-
-#include "src/assembler.h"
-#include "src/mips/constants-mips.h"
-
-namespace v8 {
-namespace internal {
-
-// clang-format off
-#define GENERAL_REGISTERS(V)                              \
-  V(zero_reg)  V(at)  V(v0)  V(v1)  V(a0)  V(a1)  V(a2)  V(a3)  \
-  V(t0)  V(t1)  V(t2)  V(t3)  V(t4)  V(t5)  V(t6)  V(t7)  \
-  V(s0)  V(s1)  V(s2)  V(s3)  V(s4)  V(s5)  V(s6)  V(s7)  V(t8)  V(t9) \
-  V(k0)  V(k1)  V(gp)  V(sp)  V(fp)  V(ra)
-
-#define ALLOCATABLE_GENERAL_REGISTERS(V) \
-  V(a0)  V(a1)  V(a2)  V(a3) \
-  V(t0)  V(t1)  V(t2)  V(t3)  V(t4)  V(t5)  V(t6) V(s7) \
-  V(v0)  V(v1)
-
-#define DOUBLE_REGISTERS(V)                               \
-  V(f0)  V(f1)  V(f2)  V(f3)  V(f4)  V(f5)  V(f6)  V(f7)  \
-  V(f8)  V(f9)  V(f10) V(f11) V(f12) V(f13) V(f14) V(f15) \
-  V(f16) V(f17) V(f18) V(f19) V(f20) V(f21) V(f22) V(f23) \
-  V(f24) V(f25) V(f26) V(f27) V(f28) V(f29) V(f30) V(f31)
-
-#define FLOAT_REGISTERS DOUBLE_REGISTERS
-#define SIMD128_REGISTERS(V)                              \
-  V(w0)  V(w1)  V(w2)  V(w3)  V(w4)  V(w5)  V(w6)  V(w7)  \
-  V(w8)  V(w9)  V(w10) V(w11) V(w12) V(w13) V(w14) V(w15) \
-  V(w16) V(w17) V(w18) V(w19) V(w20) V(w21) V(w22) V(w23) \
-  V(w24) V(w25) V(w26) V(w27) V(w28) V(w29) V(w30) V(w31)
-
-#define ALLOCATABLE_DOUBLE_REGISTERS(V)                   \
-  V(f0)  V(f2)  V(f4)  V(f6)  V(f8)  V(f10) V(f12) V(f14) \
-  V(f16) V(f18) V(f20) V(f22) V(f24)
-// clang-format on
-
-// Register lists.
-// Note that the bit values must match those used in actual instruction
-// encoding.
-const int kNumRegs = 32;
-
-const RegList kJSCallerSaved = 1 << 2 |   // v0
-                               1 << 3 |   // v1
-                               1 << 4 |   // a0
-                               1 << 5 |   // a1
-                               1 << 6 |   // a2
-                               1 << 7 |   // a3
-                               1 << 8 |   // t0
-                               1 << 9 |   // t1
-                               1 << 10 |  // t2
-                               1 << 11 |  // t3
-                               1 << 12 |  // t4
-                               1 << 13 |  // t5
-                               1 << 14 |  // t6
-                               1 << 15;   // t7
-
-const int kNumJSCallerSaved = 14;
-
-// Callee-saved registers preserved when switching from C to JavaScript.
-const RegList kCalleeSaved = 1 << 16 |  // s0
-                             1 << 17 |  // s1
-                             1 << 18 |  // s2
-                             1 << 19 |  // s3
-                             1 << 20 |  // s4
-                             1 << 21 |  // s5
-                             1 << 22 |  // s6 (roots in Javascript code)
-                             1 << 23 |  // s7 (cp in Javascript code)
-                             1 << 30;   // fp/s8
-
-const int kNumCalleeSaved = 9;
-
-const RegList kCalleeSavedFPU = 1 << 20 |  // f20
-                                1 << 22 |  // f22
-                                1 << 24 |  // f24
-                                1 << 26 |  // f26
-                                1 << 28 |  // f28
-                                1 << 30;   // f30
-
-const int kNumCalleeSavedFPU = 6;
-
-const RegList kCallerSavedFPU = 1 << 0 |   // f0
-                                1 << 2 |   // f2
-                                1 << 4 |   // f4
-                                1 << 6 |   // f6
-                                1 << 8 |   // f8
-                                1 << 10 |  // f10
-                                1 << 12 |  // f12
-                                1 << 14 |  // f14
-                                1 << 16 |  // f16
-                                1 << 18;   // f18
-
-// Number of registers for which space is reserved in safepoints. Must be a
-// multiple of 8.
-const int kNumSafepointRegisters = 24;
-
-// Define the list of registers actually saved at safepoints.
-// Note that the number of saved registers may be smaller than the reserved
-// space, i.e. kNumSafepointSavedRegisters <= kNumSafepointRegisters.
-const RegList kSafepointSavedRegisters = kJSCallerSaved | kCalleeSaved;
-const int kNumSafepointSavedRegisters = kNumJSCallerSaved + kNumCalleeSaved;
-
-const int kUndefIndex = -1;
-// Map with indexes on stack that corresponds to codes of saved registers.
-const int kSafepointRegisterStackIndexMap[kNumRegs] = {kUndefIndex,  // zero_reg
-                                                       kUndefIndex,  // at
-                                                       0,            // v0
-                                                       1,            // v1
-                                                       2,            // a0
-                                                       3,            // a1
-                                                       4,            // a2
-                                                       5,            // a3
-                                                       6,            // t0
-                                                       7,            // t1
-                                                       8,            // t2
-                                                       9,            // t3
-                                                       10,           // t4
-                                                       11,           // t5
-                                                       12,           // t6
-                                                       13,           // t7
-                                                       14,           // s0
-                                                       15,           // s1
-                                                       16,           // s2
-                                                       17,           // s3
-                                                       18,           // s4
-                                                       19,           // s5
-                                                       20,           // s6
-                                                       21,           // s7
-                                                       kUndefIndex,  // t8
-                                                       kUndefIndex,  // t9
-                                                       kUndefIndex,  // k0
-                                                       kUndefIndex,  // k1
-                                                       kUndefIndex,  // gp
-                                                       kUndefIndex,  // sp
-                                                       22,           // fp
-                                                       kUndefIndex};
-
-// CPU Registers.
-//
-// 1) We would prefer to use an enum, but enum values are assignment-
-// compatible with int, which has caused code-generation bugs.
-//
-// 2) We would prefer to use a class instead of a struct but we don't like
-// the register initialization to depend on the particular initialization
-// order (which appears to be different on OS X, Linux, and Windows for the
-// installed versions of C++ we tried). Using a struct permits C-style
-// "initialization". Also, the Register objects cannot be const as this
-// forces initialization stubs in MSVC, making us dependent on initialization
-// order.
-//
-// 3) By not using an enum, we are possibly preventing the compiler from
-// doing certain constant folds, which may significantly reduce the
-// code generated for some assembly instructions (because they boil down
-// to a few constants). If this is a problem, we could change the code
-// such that we use an enum in optimized mode, and the struct in debug
-// mode. This way we get the compile-time error checking in debug mode
-// and best performance in optimized code.
-
-
-// -----------------------------------------------------------------------------
-// Implementation of Register and FPURegister.
-
-enum RegisterCode {
-#define REGISTER_CODE(R) kRegCode_##R,
-  GENERAL_REGISTERS(REGISTER_CODE)
-#undef REGISTER_CODE
-      kRegAfterLast
-};
-
-class Register : public RegisterBase<Register, kRegAfterLast> {
- public:
-#if defined(V8_TARGET_LITTLE_ENDIAN)
-  static constexpr int kMantissaOffset = 0;
-  static constexpr int kExponentOffset = 4;
-#elif defined(V8_TARGET_BIG_ENDIAN)
-  static constexpr int kMantissaOffset = 4;
-  static constexpr int kExponentOffset = 0;
-#else
-#error Unknown endianness
-#endif
-
- private:
-  friend class RegisterBase;
-  explicit constexpr Register(int code) : RegisterBase(code) {}
-};
-
-// s7: context register
-// s3: lithium scratch
-// s4: lithium scratch2
-#define DECLARE_REGISTER(R) \
-  constexpr Register R = Register::from_code<kRegCode_##R>();
-GENERAL_REGISTERS(DECLARE_REGISTER)
-#undef DECLARE_REGISTER
-constexpr Register no_reg = Register::no_reg();
-
-int ToNumber(Register reg);
-
-Register ToRegister(int num);
-
-constexpr bool kPadArguments = false;
-constexpr bool kSimpleFPAliasing = true;
-constexpr bool kSimdMaskRegisters = false;
-
-enum DoubleRegisterCode {
-#define REGISTER_CODE(R) kDoubleCode_##R,
-  DOUBLE_REGISTERS(REGISTER_CODE)
-#undef REGISTER_CODE
-      kDoubleAfterLast
-};
-
-// Coprocessor register.
-class FPURegister : public RegisterBase<FPURegister, kDoubleAfterLast> {
- public:
-  FPURegister low() const {
-    // Find low reg of a Double-reg pair, which is the reg itself.
-    DCHECK_EQ(code() % 2, 0);  // Specified Double reg must be even.
-    return FPURegister::from_code(code());
-  }
-  FPURegister high() const {
-    // Find high reg of a Doubel-reg pair, which is reg + 1.
-    DCHECK_EQ(code() % 2, 0);  // Specified Double reg must be even.
-    return FPURegister::from_code(code() + 1);
-  }
-
- private:
-  friend class RegisterBase;
-  explicit constexpr FPURegister(int code) : RegisterBase(code) {}
-};
-
-enum MSARegisterCode {
-#define REGISTER_CODE(R) kMsaCode_##R,
-  SIMD128_REGISTERS(REGISTER_CODE)
-#undef REGISTER_CODE
-      kMsaAfterLast
-};
-
-// MIPS SIMD (MSA) register
-class MSARegister : public RegisterBase<MSARegister, kMsaAfterLast> {
-  friend class RegisterBase;
-  explicit constexpr MSARegister(int code) : RegisterBase(code) {}
-};
-
-// A few double registers are reserved: one as a scratch register and one to
-// hold 0.0.
-//  f28: 0.0
-//  f30: scratch register.
-
-// V8 now supports the O32 ABI, and the FPU Registers are organized as 32
-// 32-bit registers, f0 through f31. When used as 'double' they are used
-// in pairs, starting with the even numbered register. So a double operation
-// on f0 really uses f0 and f1.
-// (Modern mips hardware also supports 32 64-bit registers, via setting
-// (priviledged) Status Register FR bit to 1. This is used by the N32 ABI,
-// but it is not in common use. Someday we will want to support this in v8.)
-
-// For O32 ABI, Floats and Doubles refer to same set of 32 32-bit registers.
-typedef FPURegister FloatRegister;
-
-typedef FPURegister DoubleRegister;
-
-#define DECLARE_DOUBLE_REGISTER(R) \
-  constexpr DoubleRegister R = DoubleRegister::from_code<kDoubleCode_##R>();
-DOUBLE_REGISTERS(DECLARE_DOUBLE_REGISTER)
-#undef DECLARE_DOUBLE_REGISTER
-
-constexpr DoubleRegister no_freg = DoubleRegister::no_reg();
-
-// SIMD registers.
-typedef MSARegister Simd128Register;
-
-#define DECLARE_SIMD128_REGISTER(R) \
-  constexpr Simd128Register R = Simd128Register::from_code<kMsaCode_##R>();
-SIMD128_REGISTERS(DECLARE_SIMD128_REGISTER)
-#undef DECLARE_SIMD128_REGISTER
-
-const Simd128Register no_msareg = Simd128Register::no_reg();
-
-// Register aliases.
-// cp is assumed to be a callee saved register.
-constexpr Register kRootRegister = s6;
-constexpr Register cp = s7;
-constexpr Register kLithiumScratchReg = s3;
-constexpr Register kLithiumScratchReg2 = s4;
-constexpr DoubleRegister kLithiumScratchDouble = f30;
-constexpr DoubleRegister kDoubleRegZero = f28;
-// Used on mips32r6 for compare operations.
-constexpr DoubleRegister kDoubleCompareReg = f26;
-// MSA zero and scratch regs must have the same numbers as FPU zero and scratch
-constexpr Simd128Register kSimd128RegZero = w28;
-constexpr Simd128Register kSimd128ScratchReg = w30;
-
-// FPU (coprocessor 1) control registers.
-// Currently only FCSR (#31) is implemented.
-struct FPUControlRegister {
-  bool is_valid() const { return reg_code == kFCSRRegister; }
-  bool is(FPUControlRegister creg) const { return reg_code == creg.reg_code; }
-  int code() const {
-    DCHECK(is_valid());
-    return reg_code;
-  }
-  int bit() const {
-    DCHECK(is_valid());
-    return 1 << reg_code;
-  }
-  void setcode(int f) {
-    reg_code = f;
-    DCHECK(is_valid());
-  }
-  // Unfortunately we can't make this private in a struct.
-  int reg_code;
-};
-
-constexpr FPUControlRegister no_fpucreg = {kInvalidFPUControlRegister};
-constexpr FPUControlRegister FCSR = {kFCSRRegister};
-
-// MSA control registers
-struct MSAControlRegister {
-  bool is_valid() const {
-    return (reg_code == kMSAIRRegister) || (reg_code == kMSACSRRegister);
-  }
-  bool is(MSAControlRegister creg) const { return reg_code == creg.reg_code; }
-  int code() const {
-    DCHECK(is_valid());
-    return reg_code;
-  }
-  int bit() const {
-    DCHECK(is_valid());
-    return 1 << reg_code;
-  }
-  void setcode(int f) {
-    reg_code = f;
-    DCHECK(is_valid());
-  }
-  // Unfortunately we can't make this private in a struct.
-  int reg_code;
-};
-
-constexpr MSAControlRegister no_msacreg = {kInvalidMSAControlRegister};
-constexpr MSAControlRegister MSAIR = {kMSAIRRegister};
-constexpr MSAControlRegister MSACSR = {kMSACSRRegister};
-
-// -----------------------------------------------------------------------------
-// Machine instruction Operands.
-
-// Class Operand represents a shifter operand in data processing instructions.
-class Operand BASE_EMBEDDED {
- public:
-  // Immediate.
-  INLINE(explicit Operand(int32_t immediate,
-                          RelocInfo::Mode rmode = RelocInfo::NONE32))
-      : rm_(no_reg), rmode_(rmode) {
-    value_.immediate = immediate;
-  }
-  INLINE(explicit Operand(const ExternalReference& f))
-      : rm_(no_reg), rmode_(RelocInfo::EXTERNAL_REFERENCE) {
-    value_.immediate = reinterpret_cast<int32_t>(f.address());
-  }
-  INLINE(explicit Operand(const char* s));
-  INLINE(explicit Operand(Object** opp));
-  INLINE(explicit Operand(Context** cpp));
-  explicit Operand(Handle<HeapObject> handle);
-  INLINE(explicit Operand(Smi* value))
-      : rm_(no_reg), rmode_(RelocInfo::NONE32) {
-    value_.immediate = reinterpret_cast<intptr_t>(value);
-  }
-
-  static Operand EmbeddedNumber(double number);  // Smi or HeapNumber.
-  static Operand EmbeddedCode(CodeStub* stub);
-
-  // Register.
-  INLINE(explicit Operand(Register rm)) : rm_(rm) {}
-
-  // Return true if this is a register operand.
-  INLINE(bool is_reg() const);
-
-  inline int32_t immediate() const;
-
-  bool IsImmediate() const { return !rm_.is_valid(); }
-
-  HeapObjectRequest heap_object_request() const {
-    DCHECK(IsHeapObjectRequest());
-    return value_.heap_object_request;
-  }
-
-  bool IsHeapObjectRequest() const {
-    DCHECK_IMPLIES(is_heap_object_request_, IsImmediate());
-    DCHECK_IMPLIES(is_heap_object_request_,
-                   rmode_ == RelocInfo::EMBEDDED_OBJECT ||
-                       rmode_ == RelocInfo::CODE_TARGET);
-    return is_heap_object_request_;
-  }
-
-  Register rm() const { return rm_; }
-
-  RelocInfo::Mode rmode() const { return rmode_; }
-
- private:
-  Register rm_;
-  union Value {
-    Value() {}
-    HeapObjectRequest heap_object_request;  // if is_heap_object_request_
-    int32_t immediate;                      // otherwise
-  } value_;                                 // valid if rm_ == no_reg
-  bool is_heap_object_request_ = false;
-  RelocInfo::Mode rmode_;
-
-  friend class Assembler;
-  // friend class MacroAssembler;
-};
-
-
-// On MIPS we have only one addressing mode with base_reg + offset.
-// Class MemOperand represents a memory operand in load and store instructions.
-class MemOperand : public Operand {
- public:
-  // Immediate value attached to offset.
-  enum OffsetAddend {
-    offset_minus_one = -1,
-    offset_zero = 0
-  };
-
-  explicit MemOperand(Register rn, int32_t offset = 0);
-  explicit MemOperand(Register rn, int32_t unit, int32_t multiplier,
-                      OffsetAddend offset_addend = offset_zero);
-  int32_t offset() const { return offset_; }
-
-  bool OffsetIsInt16Encodable() const {
-    return is_int16(offset_);
-  }
-
- private:
-  int32_t offset_;
-
-  friend class Assembler;
-};
-
-
-class Assembler : public AssemblerBase {
- public:
-  // Create an assembler. Instructions and relocation information are emitted
-  // into a buffer, with the instructions starting from the beginning and the
-  // relocation information starting from the end of the buffer. See CodeDesc
-  // for a detailed comment on the layout (globals.h).
-  //
-  // If the provided buffer is nullptr, the assembler allocates and grows its
-  // own buffer, and buffer_size determines the initial buffer size. The buffer
-  // is owned by the assembler and deallocated upon destruction of the
-  // assembler.
-  //
-  // If the provided buffer is not nullptr, the assembler uses the provided
-  // buffer for code generation and assumes its size to be buffer_size. If the
-  // buffer is too small, a fatal error occurs. No deallocation of the buffer is
-  // done upon destruction of the assembler.
-  Assembler(Isolate* isolate, void* buffer, int buffer_size)
-      : Assembler(IsolateData(isolate), buffer, buffer_size) {}
-  Assembler(IsolateData isolate_data, void* buffer, int buffer_size);
-  virtual ~Assembler() { }
-
-  // GetCode emits any pending (non-emitted) code and fills the descriptor
-  // desc. GetCode() is idempotent; it returns the same result if no other
-  // Assembler functions are invoked in between GetCode() calls.
-  void GetCode(Isolate* isolate, CodeDesc* desc);
-
-  // Label operations & relative jumps (PPUM Appendix D).
-  //
-  // Takes a branch opcode (cc) and a label (L) and generates
-  // either a backward branch or a forward branch and links it
-  // to the label fixup chain. Usage:
-  //
-  // Label L;    // unbound label
-  // j(cc, &L);  // forward branch to unbound label
-  // bind(&L);   // bind label to the current pc
-  // j(cc, &L);  // backward branch to bound label
-  // bind(&L);   // illegal: a label may be bound only once
-  //
-  // Note: The same Label can be used for forward and backward branches
-  // but it may be bound only once.
-  void bind(Label* L);  // Binds an unbound label L to current code position.
-
-  enum OffsetSize : int { kOffset26 = 26, kOffset21 = 21, kOffset16 = 16 };
-
-  // Determines if Label is bound and near enough so that branch instruction
-  // can be used to reach it, instead of jump instruction.
-  bool is_near(Label* L);
-  bool is_near(Label* L, OffsetSize bits);
-  bool is_near_branch(Label* L);
-  inline bool is_near_pre_r6(Label* L) {
-    DCHECK(!IsMipsArchVariant(kMips32r6));
-    return pc_offset() - L->pos() < kMaxBranchOffset - 4 * kInstrSize;
-  }
-  inline bool is_near_r6(Label* L) {
-    DCHECK(IsMipsArchVariant(kMips32r6));
-    return pc_offset() - L->pos() < kMaxCompactBranchOffset - 4 * kInstrSize;
-  }
-
-  int BranchOffset(Instr instr);
-
-  // Returns the branch offset to the given label from the current code
-  // position. Links the label to the current position if it is still unbound.
-  // Manages the jump elimination optimization if the second parameter is true.
-  int32_t branch_offset_helper(Label* L, OffsetSize bits);
-  inline int32_t branch_offset(Label* L) {
-    return branch_offset_helper(L, OffsetSize::kOffset16);
-  }
-  inline int32_t branch_offset21(Label* L) {
-    return branch_offset_helper(L, OffsetSize::kOffset21);
-  }
-  inline int32_t branch_offset26(Label* L) {
-    return branch_offset_helper(L, OffsetSize::kOffset26);
-  }
-  inline int32_t shifted_branch_offset(Label* L) {
-    return branch_offset(L) >> 2;
-  }
-  inline int32_t shifted_branch_offset21(Label* L) {
-    return branch_offset21(L) >> 2;
-  }
-  inline int32_t shifted_branch_offset26(Label* L) {
-    return branch_offset26(L) >> 2;
-  }
-  uint32_t jump_address(Label* L);
-
-  // Puts a labels target address at the given position.
-  // The high 8 bits are set to zero.
-  void label_at_put(Label* L, int at_offset);
-
-  // Read/Modify the code target address in the branch/call instruction at pc.
-  // The isolate argument is unused (and may be nullptr) when skipping flushing.
-  static Address target_address_at(Address pc);
-  INLINE(static void set_target_address_at)
-  (Isolate* isolate, Address pc, Address target,
-   ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED) {
-    set_target_value_at(isolate, pc, reinterpret_cast<uint32_t>(target),
-                        icache_flush_mode);
-  }
-  // On MIPS there is no Constant Pool so we skip that parameter.
-  INLINE(static Address target_address_at(Address pc, Address constant_pool)) {
-    return target_address_at(pc);
-  }
-  INLINE(static void set_target_address_at(
-      Isolate* isolate, Address pc, Address constant_pool, Address target,
-      ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED)) {
-    set_target_address_at(isolate, pc, target, icache_flush_mode);
-  }
-
-  static void set_target_value_at(
-      Isolate* isolate, Address pc, uint32_t target,
-      ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED);
-
-  // Return the code target address at a call site from the return address
-  // of that call in the instruction stream.
-  inline static Address target_address_from_return_address(Address pc);
-
-  static void QuietNaN(HeapObject* nan);
-
-  // This sets the branch destination (which gets loaded at the call address).
-  // This is for calls and branches within generated code.  The serializer
-  // has already deserialized the lui/ori instructions etc.
-  inline static void deserialization_set_special_target_at(
-      Isolate* isolate, Address instruction_payload, Code* code,
-      Address target);
-
-  // This sets the internal reference at the pc.
-  inline static void deserialization_set_target_internal_reference_at(
-      Isolate* isolate, Address pc, Address target,
-      RelocInfo::Mode mode = RelocInfo::INTERNAL_REFERENCE);
-
-  // Size of an instruction.
-  static constexpr int kInstrSize = sizeof(Instr);
-
-  // Difference between address of current opcode and target address offset.
-  static constexpr int kBranchPCOffset = 4;
-
-  // Here we are patching the address in the LUI/ORI instruction pair.
-  // These values are used in the serialization process and must be zero for
-  // MIPS platform, as Code, Embedded Object or External-reference pointers
-  // are split across two consecutive instructions and don't exist separately
-  // in the code, so the serializer should not step forwards in memory after
-  // a target is resolved and written.
-  static constexpr int kSpecialTargetSize = 0;
-
-  // Number of consecutive instructions used to store 32bit constant. This
-  // constant is used in RelocInfo::target_address_address() function to tell
-  // serializer address of the instruction that follows LUI/ORI instruction
-  // pair.
-  static constexpr int kInstructionsFor32BitConstant = 2;
-
-  // Distance between the instruction referring to the address of the call
-  // target and the return address.
-#ifdef _MIPS_ARCH_MIPS32R6
-  static constexpr int kCallTargetAddressOffset = 2 * kInstrSize;
-#else
-  static constexpr int kCallTargetAddressOffset = 4 * kInstrSize;
-#endif
-
-  // Difference between address of current opcode and value read from pc
-  // register.
-  static constexpr int kPcLoadDelta = 4;
-
-  // Max offset for instructions with 16-bit offset field
-  static constexpr int kMaxBranchOffset = (1 << (18 - 1)) - 1;
-
-  // Max offset for compact branch instructions with 26-bit offset field
-  static constexpr int kMaxCompactBranchOffset = (1 << (28 - 1)) - 1;
-
-#ifdef _MIPS_ARCH_MIPS32R6
-  static constexpr int kTrampolineSlotsSize = 2 * kInstrSize;
-#else
-  static constexpr int kTrampolineSlotsSize = 4 * kInstrSize;
-#endif
-
-  RegList* GetScratchRegisterList() { return &scratch_register_list_; }
-
-  // ---------------------------------------------------------------------------
-  // Code generation.
-
-  // Insert the smallest number of nop instructions
-  // possible to align the pc offset to a multiple
-  // of m. m must be a power of 2 (>= 4).
-  void Align(int m);
-  // Insert the smallest number of zero bytes possible to align the pc offset
-  // to a mulitple of m. m must be a power of 2 (>= 2).
-  void DataAlign(int m);
-  // Aligns code to something that's optimal for a jump target for the platform.
-  void CodeTargetAlign();
-
-  // Different nop operations are used by the code generator to detect certain
-  // states of the generated code.
-  enum NopMarkerTypes {
-    NON_MARKING_NOP = 0,
-    DEBUG_BREAK_NOP,
-    // IC markers.
-    PROPERTY_ACCESS_INLINED,
-    PROPERTY_ACCESS_INLINED_CONTEXT,
-    PROPERTY_ACCESS_INLINED_CONTEXT_DONT_DELETE,
-    // Helper values.
-    LAST_CODE_MARKER,
-    FIRST_IC_MARKER = PROPERTY_ACCESS_INLINED,
-    // Code aging
-    CODE_AGE_MARKER_NOP = 6,
-    CODE_AGE_SEQUENCE_NOP
-  };
-
-  // Type == 0 is the default non-marking nop. For mips this is a
-  // sll(zero_reg, zero_reg, 0). We use rt_reg == at for non-zero
-  // marking, to avoid conflict with ssnop and ehb instructions.
-  void nop(unsigned int type = 0) {
-    DCHECK_LT(type, 32);
-    Register nop_rt_reg = (type == 0) ? zero_reg : at;
-    sll(zero_reg, nop_rt_reg, type, true);
-  }
-
-
-  // --------Branch-and-jump-instructions----------
-  // We don't use likely variant of instructions.
-  void b(int16_t offset);
-  inline void b(Label* L) { b(shifted_branch_offset(L)); }
-  void bal(int16_t offset);
-  inline void bal(Label* L) { bal(shifted_branch_offset(L)); }
-  void bc(int32_t offset);
-  inline void bc(Label* L) { bc(shifted_branch_offset26(L)); }
-  void balc(int32_t offset);
-  inline void balc(Label* L) { balc(shifted_branch_offset26(L)); }
-
-  void beq(Register rs, Register rt, int16_t offset);
-  inline void beq(Register rs, Register rt, Label* L) {
-    beq(rs, rt, shifted_branch_offset(L));
-  }
-  void bgez(Register rs, int16_t offset);
-  void bgezc(Register rt, int16_t offset);
-  inline void bgezc(Register rt, Label* L) {
-    bgezc(rt, shifted_branch_offset(L));
-  }
-  void bgeuc(Register rs, Register rt, int16_t offset);
-  inline void bgeuc(Register rs, Register rt, Label* L) {
-    bgeuc(rs, rt, shifted_branch_offset(L));
-  }
-  void bgec(Register rs, Register rt, int16_t offset);
-  inline void bgec(Register rs, Register rt, Label* L) {
-    bgec(rs, rt, shifted_branch_offset(L));
-  }
-  void bgezal(Register rs, int16_t offset);
-  void bgezalc(Register rt, int16_t offset);
-  inline void bgezalc(Register rt, Label* L) {
-    bgezalc(rt, shifted_branch_offset(L));
-  }
-  void bgezall(Register rs, int16_t offset);
-  inline void bgezall(Register rs, Label* L) {
-    bgezall(rs, branch_offset(L) >> 2);
-  }
-  void bgtz(Register rs, int16_t offset);
-  void bgtzc(Register rt, int16_t offset);
-  inline void bgtzc(Register rt, Label* L) {
-    bgtzc(rt, shifted_branch_offset(L));
-  }
-  void blez(Register rs, int16_t offset);
-  void blezc(Register rt, int16_t offset);
-  inline void blezc(Register rt, Label* L) {
-    blezc(rt, shifted_branch_offset(L));
-  }
-  void bltz(Register rs, int16_t offset);
-  void bltzc(Register rt, int16_t offset);
-  inline void bltzc(Register rt, Label* L) {
-    bltzc(rt, shifted_branch_offset(L));
-  }
-  void bltuc(Register rs, Register rt, int16_t offset);
-  inline void bltuc(Register rs, Register rt, Label* L) {
-    bltuc(rs, rt, shifted_branch_offset(L));
-  }
-  void bltc(Register rs, Register rt, int16_t offset);
-  inline void bltc(Register rs, Register rt, Label* L) {
-    bltc(rs, rt, shifted_branch_offset(L));
-  }
-  void bltzal(Register rs, int16_t offset);
-  void blezalc(Register rt, int16_t offset);
-  inline void blezalc(Register rt, Label* L) {
-    blezalc(rt, shifted_branch_offset(L));
-  }
-  void bltzalc(Register rt, int16_t offset);
-  inline void bltzalc(Register rt, Label* L) {
-    bltzalc(rt, shifted_branch_offset(L));
-  }
-  void bgtzalc(Register rt, int16_t offset);
-  inline void bgtzalc(Register rt, Label* L) {
-    bgtzalc(rt, shifted_branch_offset(L));
-  }
-  void beqzalc(Register rt, int16_t offset);
-  inline void beqzalc(Register rt, Label* L) {
-    beqzalc(rt, shifted_branch_offset(L));
-  }
-  void beqc(Register rs, Register rt, int16_t offset);
-  inline void beqc(Register rs, Register rt, Label* L) {
-    beqc(rs, rt, shifted_branch_offset(L));
-  }
-  void beqzc(Register rs, int32_t offset);
-  inline void beqzc(Register rs, Label* L) {
-    beqzc(rs, shifted_branch_offset21(L));
-  }
-  void bnezalc(Register rt, int16_t offset);
-  inline void bnezalc(Register rt, Label* L) {
-    bnezalc(rt, shifted_branch_offset(L));
-  }
-  void bnec(Register rs, Register rt, int16_t offset);
-  inline void bnec(Register rs, Register rt, Label* L) {
-    bnec(rs, rt, shifted_branch_offset(L));
-  }
-  void bnezc(Register rt, int32_t offset);
-  inline void bnezc(Register rt, Label* L) {
-    bnezc(rt, shifted_branch_offset21(L));
-  }
-  void bne(Register rs, Register rt, int16_t offset);
-  inline void bne(Register rs, Register rt, Label* L) {
-    bne(rs, rt, shifted_branch_offset(L));
-  }
-  void bovc(Register rs, Register rt, int16_t offset);
-  inline void bovc(Register rs, Register rt, Label* L) {
-    bovc(rs, rt, shifted_branch_offset(L));
-  }
-  void bnvc(Register rs, Register rt, int16_t offset);
-  inline void bnvc(Register rs, Register rt, Label* L) {
-    bnvc(rs, rt, shifted_branch_offset(L));
-  }
-
-  // Never use the int16_t b(l)cond version with a branch offset
-  // instead of using the Label* version.
-
-  // Jump targets must be in the current 256 MB-aligned region. i.e. 28 bits.
-  void j(int32_t target);
-  void jal(int32_t target);
-  void jalr(Register rs, Register rd = ra);
-  void jr(Register target);
-  void jic(Register rt, int16_t offset);
-  void jialc(Register rt, int16_t offset);
-
-
-  // -------Data-processing-instructions---------
-
-  // Arithmetic.
-  void addu(Register rd, Register rs, Register rt);
-  void subu(Register rd, Register rs, Register rt);
-  void mult(Register rs, Register rt);
-  void multu(Register rs, Register rt);
-  void div(Register rs, Register rt);
-  void divu(Register rs, Register rt);
-  void div(Register rd, Register rs, Register rt);
-  void divu(Register rd, Register rs, Register rt);
-  void mod(Register rd, Register rs, Register rt);
-  void modu(Register rd, Register rs, Register rt);
-  void mul(Register rd, Register rs, Register rt);
-  void muh(Register rd, Register rs, Register rt);
-  void mulu(Register rd, Register rs, Register rt);
-  void muhu(Register rd, Register rs, Register rt);
-
-  void addiu(Register rd, Register rs, int32_t j);
-
-  // Logical.
-  void and_(Register rd, Register rs, Register rt);
-  void or_(Register rd, Register rs, Register rt);
-  void xor_(Register rd, Register rs, Register rt);
-  void nor(Register rd, Register rs, Register rt);
-
-  void andi(Register rd, Register rs, int32_t j);
-  void ori(Register rd, Register rs, int32_t j);
-  void xori(Register rd, Register rs, int32_t j);
-  void lui(Register rd, int32_t j);
-  void aui(Register rs, Register rt, int32_t j);
-
-  // Shifts.
-  // Please note: sll(zero_reg, zero_reg, x) instructions are reserved as nop
-  // and may cause problems in normal code. coming_from_nop makes sure this
-  // doesn't happen.
-  void sll(Register rd, Register rt, uint16_t sa, bool coming_from_nop = false);
-  void sllv(Register rd, Register rt, Register rs);
-  void srl(Register rd, Register rt, uint16_t sa);
-  void srlv(Register rd, Register rt, Register rs);
-  void sra(Register rt, Register rd, uint16_t sa);
-  void srav(Register rt, Register rd, Register rs);
-  void rotr(Register rd, Register rt, uint16_t sa);
-  void rotrv(Register rd, Register rt, Register rs);
-
-  // ------------Memory-instructions-------------
-
-  void lb(Register rd, const MemOperand& rs);
-  void lbu(Register rd, const MemOperand& rs);
-  void lh(Register rd, const MemOperand& rs);
-  void lhu(Register rd, const MemOperand& rs);
-  void lw(Register rd, const MemOperand& rs);
-  void lwl(Register rd, const MemOperand& rs);
-  void lwr(Register rd, const MemOperand& rs);
-  void sb(Register rd, const MemOperand& rs);
-  void sh(Register rd, const MemOperand& rs);
-  void sw(Register rd, const MemOperand& rs);
-  void swl(Register rd, const MemOperand& rs);
-  void swr(Register rd, const MemOperand& rs);
-
-  // ----------Atomic instructions--------------
-
-  void ll(Register rd, const MemOperand& rs);
-  void sc(Register rd, const MemOperand& rs);
-
-  // ---------PC-Relative-instructions-----------
-
-  void addiupc(Register rs, int32_t imm19);
-  void lwpc(Register rs, int32_t offset19);
-  void auipc(Register rs, int16_t imm16);
-  void aluipc(Register rs, int16_t imm16);
-
-
-  // ----------------Prefetch--------------------
-
-  void pref(int32_t hint, const MemOperand& rs);
-
-
-  // -------------Misc-instructions--------------
-
-  // Break / Trap instructions.
-  void break_(uint32_t code, bool break_as_stop = false);
-  void stop(const char* msg, uint32_t code = kMaxStopCode);
-  void tge(Register rs, Register rt, uint16_t code);
-  void tgeu(Register rs, Register rt, uint16_t code);
-  void tlt(Register rs, Register rt, uint16_t code);
-  void tltu(Register rs, Register rt, uint16_t code);
-  void teq(Register rs, Register rt, uint16_t code);
-  void tne(Register rs, Register rt, uint16_t code);
-
-  // Memory barrier instruction.
-  void sync();
-
-  // Move from HI/LO register.
-  void mfhi(Register rd);
-  void mflo(Register rd);
-
-  // Set on less than.
-  void slt(Register rd, Register rs, Register rt);
-  void sltu(Register rd, Register rs, Register rt);
-  void slti(Register rd, Register rs, int32_t j);
-  void sltiu(Register rd, Register rs, int32_t j);
-
-  // Conditional move.
-  void movz(Register rd, Register rs, Register rt);
-  void movn(Register rd, Register rs, Register rt);
-  void movt(Register rd, Register rs, uint16_t cc = 0);
-  void movf(Register rd, Register rs, uint16_t cc = 0);
-
-  void sel(SecondaryField fmt, FPURegister fd, FPURegister fs, FPURegister ft);
-  void sel_s(FPURegister fd, FPURegister fs, FPURegister ft);
-  void sel_d(FPURegister fd, FPURegister fs, FPURegister ft);
-  void seleqz(Register rd, Register rs, Register rt);
-  void seleqz(SecondaryField fmt, FPURegister fd, FPURegister fs,
-              FPURegister ft);
-  void selnez(Register rd, Register rs, Register rt);
-  void selnez(SecondaryField fmt, FPURegister fd, FPURegister fs,
-              FPURegister ft);
-  void seleqz_d(FPURegister fd, FPURegister fs, FPURegister ft);
-  void seleqz_s(FPURegister fd, FPURegister fs, FPURegister ft);
-  void selnez_d(FPURegister fd, FPURegister fs, FPURegister ft);
-  void selnez_s(FPURegister fd, FPURegister fs, FPURegister ft);
-
-  void movz_s(FPURegister fd, FPURegister fs, Register rt);
-  void movz_d(FPURegister fd, FPURegister fs, Register rt);
-  void movt_s(FPURegister fd, FPURegister fs, uint16_t cc = 0);
-  void movt_d(FPURegister fd, FPURegister fs, uint16_t cc = 0);
-  void movf_s(FPURegister fd, FPURegister fs, uint16_t cc = 0);
-  void movf_d(FPURegister fd, FPURegister fs, uint16_t cc = 0);
-  void movn_s(FPURegister fd, FPURegister fs, Register rt);
-  void movn_d(FPURegister fd, FPURegister fs, Register rt);
-  // Bit twiddling.
-  void clz(Register rd, Register rs);
-  void ins_(Register rt, Register rs, uint16_t pos, uint16_t size);
-  void ext_(Register rt, Register rs, uint16_t pos, uint16_t size);
-  void bitswap(Register rd, Register rt);
-  void align(Register rd, Register rs, Register rt, uint8_t bp);
-
-  void wsbh(Register rd, Register rt);
-  void seh(Register rd, Register rt);
-  void seb(Register rd, Register rt);
-
-  // --------Coprocessor-instructions----------------
-
-  // Load, store, and move.
-  void lwc1(FPURegister fd, const MemOperand& src);
-  void swc1(FPURegister fs, const MemOperand& dst);
-
-  void mtc1(Register rt, FPURegister fs);
-  void mthc1(Register rt, FPURegister fs);
-
-  void mfc1(Register rt, FPURegister fs);
-  void mfhc1(Register rt, FPURegister fs);
-
-  void ctc1(Register rt, FPUControlRegister fs);
-  void cfc1(Register rt, FPUControlRegister fs);
-
-  // Arithmetic.
-  void add_s(FPURegister fd, FPURegister fs, FPURegister ft);
-  void add_d(FPURegister fd, FPURegister fs, FPURegister ft);
-  void sub_s(FPURegister fd, FPURegister fs, FPURegister ft);
-  void sub_d(FPURegister fd, FPURegister fs, FPURegister ft);
-  void mul_s(FPURegister fd, FPURegister fs, FPURegister ft);
-  void mul_d(FPURegister fd, FPURegister fs, FPURegister ft);
-  void madd_s(FPURegister fd, FPURegister fr, FPURegister fs, FPURegister ft);
-  void madd_d(FPURegister fd, FPURegister fr, FPURegister fs, FPURegister ft);
-  void msub_s(FPURegister fd, FPURegister fr, FPURegister fs, FPURegister ft);
-  void msub_d(FPURegister fd, FPURegister fr, FPURegister fs, FPURegister ft);
-  void maddf_s(FPURegister fd, FPURegister fs, FPURegister ft);
-  void maddf_d(FPURegister fd, FPURegister fs, FPURegister ft);
-  void msubf_s(FPURegister fd, FPURegister fs, FPURegister ft);
-  void msubf_d(FPURegister fd, FPURegister fs, FPURegister ft);
-  void div_s(FPURegister fd, FPURegister fs, FPURegister ft);
-  void div_d(FPURegister fd, FPURegister fs, FPURegister ft);
-  void abs_s(FPURegister fd, FPURegister fs);
-  void abs_d(FPURegister fd, FPURegister fs);
-  void mov_d(FPURegister fd, FPURegister fs);
-  void mov_s(FPURegister fd, FPURegister fs);
-  void neg_s(FPURegister fd, FPURegister fs);
-  void neg_d(FPURegister fd, FPURegister fs);
-  void sqrt_s(FPURegister fd, FPURegister fs);
-  void sqrt_d(FPURegister fd, FPURegister fs);
-  void rsqrt_s(FPURegister fd, FPURegister fs);
-  void rsqrt_d(FPURegister fd, FPURegister fs);
-  void recip_d(FPURegister fd, FPURegister fs);
-  void recip_s(FPURegister fd, FPURegister fs);
-
-  // Conversion.
-  void cvt_w_s(FPURegister fd, FPURegister fs);
-  void cvt_w_d(FPURegister fd, FPURegister fs);
-  void trunc_w_s(FPURegister fd, FPURegister fs);
-  void trunc_w_d(FPURegister fd, FPURegister fs);
-  void round_w_s(FPURegister fd, FPURegister fs);
-  void round_w_d(FPURegister fd, FPURegister fs);
-  void floor_w_s(FPURegister fd, FPURegister fs);
-  void floor_w_d(FPURegister fd, FPURegister fs);
-  void ceil_w_s(FPURegister fd, FPURegister fs);
-  void ceil_w_d(FPURegister fd, FPURegister fs);
-  void rint_s(FPURegister fd, FPURegister fs);
-  void rint_d(FPURegister fd, FPURegister fs);
-  void rint(SecondaryField fmt, FPURegister fd, FPURegister fs);
-
-  void cvt_l_s(FPURegister fd, FPURegister fs);
-  void cvt_l_d(FPURegister fd, FPURegister fs);
-  void trunc_l_s(FPURegister fd, FPURegister fs);
-  void trunc_l_d(FPURegister fd, FPURegister fs);
-  void round_l_s(FPURegister fd, FPURegister fs);
-  void round_l_d(FPURegister fd, FPURegister fs);
-  void floor_l_s(FPURegister fd, FPURegister fs);
-  void floor_l_d(FPURegister fd, FPURegister fs);
-  void ceil_l_s(FPURegister fd, FPURegister fs);
-  void ceil_l_d(FPURegister fd, FPURegister fs);
-
-  void class_s(FPURegister fd, FPURegister fs);
-  void class_d(FPURegister fd, FPURegister fs);
-
-  void min(SecondaryField fmt, FPURegister fd, FPURegister fs, FPURegister ft);
-  void mina(SecondaryField fmt, FPURegister fd, FPURegister fs, FPURegister ft);
-  void max(SecondaryField fmt, FPURegister fd, FPURegister fs, FPURegister ft);
-  void maxa(SecondaryField fmt, FPURegister fd, FPURegister fs, FPURegister ft);
-  void min_s(FPURegister fd, FPURegister fs, FPURegister ft);
-  void min_d(FPURegister fd, FPURegister fs, FPURegister ft);
-  void max_s(FPURegister fd, FPURegister fs, FPURegister ft);
-  void max_d(FPURegister fd, FPURegister fs, FPURegister ft);
-  void mina_s(FPURegister fd, FPURegister fs, FPURegister ft);
-  void mina_d(FPURegister fd, FPURegister fs, FPURegister ft);
-  void maxa_s(FPURegister fd, FPURegister fs, FPURegister ft);
-  void maxa_d(FPURegister fd, FPURegister fs, FPURegister ft);
-
-  void cvt_s_w(FPURegister fd, FPURegister fs);
-  void cvt_s_l(FPURegister fd, FPURegister fs);
-  void cvt_s_d(FPURegister fd, FPURegister fs);
-
-  void cvt_d_w(FPURegister fd, FPURegister fs);
-  void cvt_d_l(FPURegister fd, FPURegister fs);
-  void cvt_d_s(FPURegister fd, FPURegister fs);
-
-  // Conditions and branches for MIPSr6.
-  void cmp(FPUCondition cond, SecondaryField fmt,
-         FPURegister fd, FPURegister ft, FPURegister fs);
-  void cmp_s(FPUCondition cond, FPURegister fd, FPURegister fs, FPURegister ft);
-  void cmp_d(FPUCondition cond, FPURegister fd, FPURegister fs, FPURegister ft);
-
-  void bc1eqz(int16_t offset, FPURegister ft);
-  inline void bc1eqz(Label* L, FPURegister ft) {
-    bc1eqz(shifted_branch_offset(L), ft);
-  }
-  void bc1nez(int16_t offset, FPURegister ft);
-  inline void bc1nez(Label* L, FPURegister ft) {
-    bc1nez(shifted_branch_offset(L), ft);
-  }
-
-  // Conditions and branches for non MIPSr6.
-  void c(FPUCondition cond, SecondaryField fmt,
-         FPURegister ft, FPURegister fs, uint16_t cc = 0);
-  void c_s(FPUCondition cond, FPURegister ft, FPURegister fs, uint16_t cc = 0);
-  void c_d(FPUCondition cond, FPURegister ft, FPURegister fs, uint16_t cc = 0);
-
-  void bc1f(int16_t offset, uint16_t cc = 0);
-  inline void bc1f(Label* L, uint16_t cc = 0) {
-    bc1f(shifted_branch_offset(L), cc);
-  }
-  void bc1t(int16_t offset, uint16_t cc = 0);
-  inline void bc1t(Label* L, uint16_t cc = 0) {
-    bc1t(shifted_branch_offset(L), cc);
-  }
-  void fcmp(FPURegister src1, const double src2, FPUCondition cond);
-
-  // MSA instructions
-  void bz_v(MSARegister wt, int16_t offset);
-  inline void bz_v(MSARegister wt, Label* L) {
-    bz_v(wt, shifted_branch_offset(L));
-  }
-  void bz_b(MSARegister wt, int16_t offset);
-  inline void bz_b(MSARegister wt, Label* L) {
-    bz_b(wt, shifted_branch_offset(L));
-  }
-  void bz_h(MSARegister wt, int16_t offset);
-  inline void bz_h(MSARegister wt, Label* L) {
-    bz_h(wt, shifted_branch_offset(L));
-  }
-  void bz_w(MSARegister wt, int16_t offset);
-  inline void bz_w(MSARegister wt, Label* L) {
-    bz_w(wt, shifted_branch_offset(L));
-  }
-  void bz_d(MSARegister wt, int16_t offset);
-  inline void bz_d(MSARegister wt, Label* L) {
-    bz_d(wt, shifted_branch_offset(L));
-  }
-  void bnz_v(MSARegister wt, int16_t offset);
-  inline void bnz_v(MSARegister wt, Label* L) {
-    bnz_v(wt, shifted_branch_offset(L));
-  }
-  void bnz_b(MSARegister wt, int16_t offset);
-  inline void bnz_b(MSARegister wt, Label* L) {
-    bnz_b(wt, shifted_branch_offset(L));
-  }
-  void bnz_h(MSARegister wt, int16_t offset);
-  inline void bnz_h(MSARegister wt, Label* L) {
-    bnz_h(wt, shifted_branch_offset(L));
-  }
-  void bnz_w(MSARegister wt, int16_t offset);
-  inline void bnz_w(MSARegister wt, Label* L) {
-    bnz_w(wt, shifted_branch_offset(L));
-  }
-  void bnz_d(MSARegister wt, int16_t offset);
-  inline void bnz_d(MSARegister wt, Label* L) {
-    bnz_d(wt, shifted_branch_offset(L));
-  }
-
-  void ld_b(MSARegister wd, const MemOperand& rs);
-  void ld_h(MSARegister wd, const MemOperand& rs);
-  void ld_w(MSARegister wd, const MemOperand& rs);
-  void ld_d(MSARegister wd, const MemOperand& rs);
-  void st_b(MSARegister wd, const MemOperand& rs);
-  void st_h(MSARegister wd, const MemOperand& rs);
-  void st_w(MSARegister wd, const MemOperand& rs);
-  void st_d(MSARegister wd, const MemOperand& rs);
-
-  void ldi_b(MSARegister wd, int32_t imm10);
-  void ldi_h(MSARegister wd, int32_t imm10);
-  void ldi_w(MSARegister wd, int32_t imm10);
-  void ldi_d(MSARegister wd, int32_t imm10);
-
-  void addvi_b(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void addvi_h(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void addvi_w(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void addvi_d(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void subvi_b(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void subvi_h(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void subvi_w(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void subvi_d(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void maxi_s_b(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void maxi_s_h(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void maxi_s_w(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void maxi_s_d(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void maxi_u_b(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void maxi_u_h(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void maxi_u_w(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void maxi_u_d(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void mini_s_b(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void mini_s_h(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void mini_s_w(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void mini_s_d(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void mini_u_b(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void mini_u_h(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void mini_u_w(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void mini_u_d(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void ceqi_b(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void ceqi_h(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void ceqi_w(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void ceqi_d(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clti_s_b(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clti_s_h(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clti_s_w(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clti_s_d(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clti_u_b(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clti_u_h(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clti_u_w(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clti_u_d(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clei_s_b(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clei_s_h(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clei_s_w(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clei_s_d(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clei_u_b(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clei_u_h(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clei_u_w(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clei_u_d(MSARegister wd, MSARegister ws, uint32_t imm5);
-
-  void andi_b(MSARegister wd, MSARegister ws, uint32_t imm8);
-  void ori_b(MSARegister wd, MSARegister ws, uint32_t imm8);
-  void nori_b(MSARegister wd, MSARegister ws, uint32_t imm8);
-  void xori_b(MSARegister wd, MSARegister ws, uint32_t imm8);
-  void bmnzi_b(MSARegister wd, MSARegister ws, uint32_t imm8);
-  void bmzi_b(MSARegister wd, MSARegister ws, uint32_t imm8);
-  void bseli_b(MSARegister wd, MSARegister ws, uint32_t imm8);
-  void shf_b(MSARegister wd, MSARegister ws, uint32_t imm8);
-  void shf_h(MSARegister wd, MSARegister ws, uint32_t imm8);
-  void shf_w(MSARegister wd, MSARegister ws, uint32_t imm8);
-
-  void and_v(MSARegister wd, MSARegister ws, MSARegister wt);
-  void or_v(MSARegister wd, MSARegister ws, MSARegister wt);
-  void nor_v(MSARegister wd, MSARegister ws, MSARegister wt);
-  void xor_v(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bmnz_v(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bmz_v(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bsel_v(MSARegister wd, MSARegister ws, MSARegister wt);
-
-  void fill_b(MSARegister wd, Register rs);
-  void fill_h(MSARegister wd, Register rs);
-  void fill_w(MSARegister wd, Register rs);
-  void pcnt_b(MSARegister wd, MSARegister ws);
-  void pcnt_h(MSARegister wd, MSARegister ws);
-  void pcnt_w(MSARegister wd, MSARegister ws);
-  void pcnt_d(MSARegister wd, MSARegister ws);
-  void nloc_b(MSARegister wd, MSARegister ws);
-  void nloc_h(MSARegister wd, MSARegister ws);
-  void nloc_w(MSARegister wd, MSARegister ws);
-  void nloc_d(MSARegister wd, MSARegister ws);
-  void nlzc_b(MSARegister wd, MSARegister ws);
-  void nlzc_h(MSARegister wd, MSARegister ws);
-  void nlzc_w(MSARegister wd, MSARegister ws);
-  void nlzc_d(MSARegister wd, MSARegister ws);
-
-  void fclass_w(MSARegister wd, MSARegister ws);
-  void fclass_d(MSARegister wd, MSARegister ws);
-  void ftrunc_s_w(MSARegister wd, MSARegister ws);
-  void ftrunc_s_d(MSARegister wd, MSARegister ws);
-  void ftrunc_u_w(MSARegister wd, MSARegister ws);
-  void ftrunc_u_d(MSARegister wd, MSARegister ws);
-  void fsqrt_w(MSARegister wd, MSARegister ws);
-  void fsqrt_d(MSARegister wd, MSARegister ws);
-  void frsqrt_w(MSARegister wd, MSARegister ws);
-  void frsqrt_d(MSARegister wd, MSARegister ws);
-  void frcp_w(MSARegister wd, MSARegister ws);
-  void frcp_d(MSARegister wd, MSARegister ws);
-  void frint_w(MSARegister wd, MSARegister ws);
-  void frint_d(MSARegister wd, MSARegister ws);
-  void flog2_w(MSARegister wd, MSARegister ws);
-  void flog2_d(MSARegister wd, MSARegister ws);
-  void fexupl_w(MSARegister wd, MSARegister ws);
-  void fexupl_d(MSARegister wd, MSARegister ws);
-  void fexupr_w(MSARegister wd, MSARegister ws);
-  void fexupr_d(MSARegister wd, MSARegister ws);
-  void ffql_w(MSARegister wd, MSARegister ws);
-  void ffql_d(MSARegister wd, MSARegister ws);
-  void ffqr_w(MSARegister wd, MSARegister ws);
-  void ffqr_d(MSARegister wd, MSARegister ws);
-  void ftint_s_w(MSARegister wd, MSARegister ws);
-  void ftint_s_d(MSARegister wd, MSARegister ws);
-  void ftint_u_w(MSARegister wd, MSARegister ws);
-  void ftint_u_d(MSARegister wd, MSARegister ws);
-  void ffint_s_w(MSARegister wd, MSARegister ws);
-  void ffint_s_d(MSARegister wd, MSARegister ws);
-  void ffint_u_w(MSARegister wd, MSARegister ws);
-  void ffint_u_d(MSARegister wd, MSARegister ws);
-
-  void sll_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void sll_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void sll_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void sll_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void sra_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void sra_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void sra_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void sra_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void srl_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void srl_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void srl_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void srl_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bclr_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bclr_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bclr_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bclr_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bset_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bset_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bset_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bset_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bneg_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bneg_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bneg_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bneg_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void binsl_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void binsl_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void binsl_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void binsl_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void binsr_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void binsr_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void binsr_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void binsr_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void addv_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void addv_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void addv_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void addv_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subv_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subv_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subv_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subv_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void max_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void max_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void max_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void max_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void max_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void max_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void max_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void max_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void min_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void min_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void min_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void min_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void min_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void min_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void min_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void min_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void max_a_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void max_a_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void max_a_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void max_a_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void min_a_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void min_a_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void min_a_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void min_a_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ceq_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ceq_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ceq_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ceq_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void clt_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void clt_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void clt_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void clt_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void clt_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void clt_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void clt_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void clt_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void cle_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void cle_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void cle_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void cle_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void cle_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void cle_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void cle_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void cle_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void add_a_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void add_a_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void add_a_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void add_a_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void adds_a_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void adds_a_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void adds_a_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void adds_a_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void adds_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void adds_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void adds_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void adds_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void adds_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void adds_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void adds_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void adds_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ave_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ave_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ave_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ave_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ave_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ave_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ave_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ave_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void aver_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void aver_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void aver_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void aver_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void aver_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void aver_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void aver_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void aver_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subs_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subs_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subs_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subs_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subs_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subs_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subs_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subs_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsus_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsus_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsus_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsus_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsus_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsus_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsus_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsus_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsuu_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsuu_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsuu_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsuu_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsuu_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsuu_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsuu_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsuu_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void asub_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void asub_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void asub_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void asub_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void asub_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void asub_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void asub_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void asub_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mulv_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mulv_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mulv_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mulv_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void maddv_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void maddv_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void maddv_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void maddv_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void msubv_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void msubv_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void msubv_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void msubv_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void div_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void div_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void div_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void div_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void div_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void div_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void div_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void div_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mod_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mod_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mod_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mod_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mod_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mod_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mod_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mod_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dotp_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dotp_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dotp_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dotp_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dotp_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dotp_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dotp_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dotp_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpadd_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpadd_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpadd_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpadd_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpadd_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpadd_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpadd_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpadd_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpsub_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpsub_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpsub_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpsub_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpsub_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpsub_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpsub_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpsub_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void sld_b(MSARegister wd, MSARegister ws, Register rt);
-  void sld_h(MSARegister wd, MSARegister ws, Register rt);
-  void sld_w(MSARegister wd, MSARegister ws, Register rt);
-  void sld_d(MSARegister wd, MSARegister ws, Register rt);
-  void splat_b(MSARegister wd, MSARegister ws, Register rt);
-  void splat_h(MSARegister wd, MSARegister ws, Register rt);
-  void splat_w(MSARegister wd, MSARegister ws, Register rt);
-  void splat_d(MSARegister wd, MSARegister ws, Register rt);
-  void pckev_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void pckev_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void pckev_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void pckev_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void pckod_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void pckod_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void pckod_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void pckod_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvl_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvl_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvl_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvl_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvr_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvr_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvr_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvr_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvev_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvev_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvev_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvev_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvod_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvod_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvod_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvod_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void vshf_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void vshf_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void vshf_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void vshf_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void srar_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void srar_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void srar_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void srar_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void srlr_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void srlr_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void srlr_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void srlr_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hadd_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hadd_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hadd_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hadd_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hadd_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hadd_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hadd_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hadd_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hsub_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hsub_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hsub_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hsub_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hsub_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hsub_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hsub_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hsub_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-
-  void fcaf_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcaf_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcun_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcun_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fceq_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fceq_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcueq_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcueq_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fclt_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fclt_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcult_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcult_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcle_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcle_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcule_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcule_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsaf_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsaf_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsun_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsun_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fseq_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fseq_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsueq_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsueq_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fslt_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fslt_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsult_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsult_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsle_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsle_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsule_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsule_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fadd_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fadd_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsub_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsub_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmul_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmul_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fdiv_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fdiv_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmadd_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmadd_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmsub_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmsub_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fexp2_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fexp2_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fexdo_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fexdo_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ftq_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ftq_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmin_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmin_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmin_a_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmin_a_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmax_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmax_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmax_a_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmax_a_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcor_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcor_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcune_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcune_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcne_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcne_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mul_q_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mul_q_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void madd_q_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void madd_q_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void msub_q_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void msub_q_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsor_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsor_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsune_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsune_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsne_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsne_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mulr_q_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mulr_q_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void maddr_q_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void maddr_q_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void msubr_q_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void msubr_q_w(MSARegister wd, MSARegister ws, MSARegister wt);
-
-  void sldi_b(MSARegister wd, MSARegister ws, uint32_t n);
-  void sldi_h(MSARegister wd, MSARegister ws, uint32_t n);
-  void sldi_w(MSARegister wd, MSARegister ws, uint32_t n);
-  void sldi_d(MSARegister wd, MSARegister ws, uint32_t n);
-  void splati_b(MSARegister wd, MSARegister ws, uint32_t n);
-  void splati_h(MSARegister wd, MSARegister ws, uint32_t n);
-  void splati_w(MSARegister wd, MSARegister ws, uint32_t n);
-  void splati_d(MSARegister wd, MSARegister ws, uint32_t n);
-  void copy_s_b(Register rd, MSARegister ws, uint32_t n);
-  void copy_s_h(Register rd, MSARegister ws, uint32_t n);
-  void copy_s_w(Register rd, MSARegister ws, uint32_t n);
-  void copy_u_b(Register rd, MSARegister ws, uint32_t n);
-  void copy_u_h(Register rd, MSARegister ws, uint32_t n);
-  void copy_u_w(Register rd, MSARegister ws, uint32_t n);
-  void insert_b(MSARegister wd, uint32_t n, Register rs);
-  void insert_h(MSARegister wd, uint32_t n, Register rs);
-  void insert_w(MSARegister wd, uint32_t n, Register rs);
-  void insve_b(MSARegister wd, uint32_t n, MSARegister ws);
-  void insve_h(MSARegister wd, uint32_t n, MSARegister ws);
-  void insve_w(MSARegister wd, uint32_t n, MSARegister ws);
-  void insve_d(MSARegister wd, uint32_t n, MSARegister ws);
-  void move_v(MSARegister wd, MSARegister ws);
-  void ctcmsa(MSAControlRegister cd, Register rs);
-  void cfcmsa(Register rd, MSAControlRegister cs);
-
-  void slli_b(MSARegister wd, MSARegister ws, uint32_t m);
-  void slli_h(MSARegister wd, MSARegister ws, uint32_t m);
-  void slli_w(MSARegister wd, MSARegister ws, uint32_t m);
-  void slli_d(MSARegister wd, MSARegister ws, uint32_t m);
-  void srai_b(MSARegister wd, MSARegister ws, uint32_t m);
-  void srai_h(MSARegister wd, MSARegister ws, uint32_t m);
-  void srai_w(MSARegister wd, MSARegister ws, uint32_t m);
-  void srai_d(MSARegister wd, MSARegister ws, uint32_t m);
-  void srli_b(MSARegister wd, MSARegister ws, uint32_t m);
-  void srli_h(MSARegister wd, MSARegister ws, uint32_t m);
-  void srli_w(MSARegister wd, MSARegister ws, uint32_t m);
-  void srli_d(MSARegister wd, MSARegister ws, uint32_t m);
-  void bclri_b(MSARegister wd, MSARegister ws, uint32_t m);
-  void bclri_h(MSARegister wd, MSARegister ws, uint32_t m);
-  void bclri_w(MSARegister wd, MSARegister ws, uint32_t m);
-  void bclri_d(MSARegister wd, MSARegister ws, uint32_t m);
-  void bseti_b(MSARegister wd, MSARegister ws, uint32_t m);
-  void bseti_h(MSARegister wd, MSARegister ws, uint32_t m);
-  void bseti_w(MSARegister wd, MSARegister ws, uint32_t m);
-  void bseti_d(MSARegister wd, MSARegister ws, uint32_t m);
-  void bnegi_b(MSARegister wd, MSARegister ws, uint32_t m);
-  void bnegi_h(MSARegister wd, MSARegister ws, uint32_t m);
-  void bnegi_w(MSARegister wd, MSARegister ws, uint32_t m);
-  void bnegi_d(MSARegister wd, MSARegister ws, uint32_t m);
-  void binsli_b(MSARegister wd, MSARegister ws, uint32_t m);
-  void binsli_h(MSARegister wd, MSARegister ws, uint32_t m);
-  void binsli_w(MSARegister wd, MSARegister ws, uint32_t m);
-  void binsli_d(MSARegister wd, MSARegister ws, uint32_t m);
-  void binsri_b(MSARegister wd, MSARegister ws, uint32_t m);
-  void binsri_h(MSARegister wd, MSARegister ws, uint32_t m);
-  void binsri_w(MSARegister wd, MSARegister ws, uint32_t m);
-  void binsri_d(MSARegister wd, MSARegister ws, uint32_t m);
-  void sat_s_b(MSARegister wd, MSARegister ws, uint32_t m);
-  void sat_s_h(MSARegister wd, MSARegister ws, uint32_t m);
-  void sat_s_w(MSARegister wd, MSARegister ws, uint32_t m);
-  void sat_s_d(MSARegister wd, MSARegister ws, uint32_t m);
-  void sat_u_b(MSARegister wd, MSARegister ws, uint32_t m);
-  void sat_u_h(MSARegister wd, MSARegister ws, uint32_t m);
-  void sat_u_w(MSARegister wd, MSARegister ws, uint32_t m);
-  void sat_u_d(MSARegister wd, MSARegister ws, uint32_t m);
-  void srari_b(MSARegister wd, MSARegister ws, uint32_t m);
-  void srari_h(MSARegister wd, MSARegister ws, uint32_t m);
-  void srari_w(MSARegister wd, MSARegister ws, uint32_t m);
-  void srari_d(MSARegister wd, MSARegister ws, uint32_t m);
-  void srlri_b(MSARegister wd, MSARegister ws, uint32_t m);
-  void srlri_h(MSARegister wd, MSARegister ws, uint32_t m);
-  void srlri_w(MSARegister wd, MSARegister ws, uint32_t m);
-  void srlri_d(MSARegister wd, MSARegister ws, uint32_t m);
-
-  // Check the code size generated from label to here.
-  int SizeOfCodeGeneratedSince(Label* label) {
-    return pc_offset() - label->pos();
-  }
-
-  // Check the number of instructions generated from label to here.
-  int InstructionsGeneratedSince(Label* label) {
-    return SizeOfCodeGeneratedSince(label) / kInstrSize;
-  }
-
-  // Class for scoping postponing the trampoline pool generation.
-  class BlockTrampolinePoolScope {
-   public:
-    explicit BlockTrampolinePoolScope(Assembler* assem) : assem_(assem) {
-      assem_->StartBlockTrampolinePool();
-    }
-    ~BlockTrampolinePoolScope() {
-      assem_->EndBlockTrampolinePool();
-    }
-
-   private:
-    Assembler* assem_;
-
-    DISALLOW_IMPLICIT_CONSTRUCTORS(BlockTrampolinePoolScope);
-  };
-
-  // Class for postponing the assembly buffer growth. Typically used for
-  // sequences of instructions that must be emitted as a unit, before
-  // buffer growth (and relocation) can occur.
-  // This blocking scope is not nestable.
-  class BlockGrowBufferScope {
-   public:
-    explicit BlockGrowBufferScope(Assembler* assem) : assem_(assem) {
-      assem_->StartBlockGrowBuffer();
-    }
-    ~BlockGrowBufferScope() {
-      assem_->EndBlockGrowBuffer();
-    }
-
-   private:
-    Assembler* assem_;
-
-    DISALLOW_IMPLICIT_CONSTRUCTORS(BlockGrowBufferScope);
-  };
-
-  // Record a comment relocation entry that can be used by a disassembler.
-  // Use --code-comments to enable.
-  void RecordComment(const char* msg);
-
-  // Record a deoptimization reason that can be used by a log or cpu profiler.
-  // Use --trace-deopt to enable.
-  void RecordDeoptReason(DeoptimizeReason reason, SourcePosition position,
-                         int id);
-
-  static int RelocateInternalReference(RelocInfo::Mode rmode, byte* pc,
-                                       intptr_t pc_delta);
-
-  // Writes a single byte or word of data in the code stream.  Used for
-  // inline tables, e.g., jump-tables.
-  void db(uint8_t data);
-  void dd(uint32_t data);
-  void dq(uint64_t data);
-  void dp(uintptr_t data) { dd(data); }
-  void dd(Label* label);
-
-  // Postpone the generation of the trampoline pool for the specified number of
-  // instructions.
-  void BlockTrampolinePoolFor(int instructions);
-
-  // Check if there is less than kGap bytes available in the buffer.
-  // If this is the case, we need to grow the buffer before emitting
-  // an instruction or relocation information.
-  inline bool overflow() const { return pc_ >= reloc_info_writer.pos() - kGap; }
-
-  // Get the number of bytes available in the buffer.
-  inline int available_space() const { return reloc_info_writer.pos() - pc_; }
-
-  // Read/patch instructions.
-  static Instr instr_at(byte* pc) { return *reinterpret_cast<Instr*>(pc); }
-  static void instr_at_put(byte* pc, Instr instr) {
-    *reinterpret_cast<Instr*>(pc) = instr;
-  }
-  Instr instr_at(int pos) { return *reinterpret_cast<Instr*>(buffer_ + pos); }
-  void instr_at_put(int pos, Instr instr) {
-    *reinterpret_cast<Instr*>(buffer_ + pos) = instr;
-  }
-
-  // Check if an instruction is a branch of some kind.
-  static bool IsBranch(Instr instr);
-  static bool IsMsaBranch(Instr instr);
-  static bool IsBc(Instr instr);
-  static bool IsBzc(Instr instr);
-  static bool IsBeq(Instr instr);
-  static bool IsBne(Instr instr);
-  static bool IsBeqzc(Instr instr);
-  static bool IsBnezc(Instr instr);
-  static bool IsBeqc(Instr instr);
-  static bool IsBnec(Instr instr);
-  static bool IsJicOrJialc(Instr instr);
-
-  static bool IsJump(Instr instr);
-  static bool IsJ(Instr instr);
-  static bool IsLui(Instr instr);
-  static bool IsOri(Instr instr);
-
-  static bool IsJal(Instr instr);
-  static bool IsJr(Instr instr);
-  static bool IsJalr(Instr instr);
-
-  static bool IsNop(Instr instr, unsigned int type);
-  static bool IsPop(Instr instr);
-  static bool IsPush(Instr instr);
-  static bool IsLwRegFpOffset(Instr instr);
-  static bool IsSwRegFpOffset(Instr instr);
-  static bool IsLwRegFpNegOffset(Instr instr);
-  static bool IsSwRegFpNegOffset(Instr instr);
-
-  static Register GetRtReg(Instr instr);
-  static Register GetRsReg(Instr instr);
-  static Register GetRdReg(Instr instr);
-
-  static uint32_t GetRt(Instr instr);
-  static uint32_t GetRtField(Instr instr);
-  static uint32_t GetRs(Instr instr);
-  static uint32_t GetRsField(Instr instr);
-  static uint32_t GetRd(Instr instr);
-  static uint32_t GetRdField(Instr instr);
-  static uint32_t GetSa(Instr instr);
-  static uint32_t GetSaField(Instr instr);
-  static uint32_t GetOpcodeField(Instr instr);
-  static uint32_t GetFunction(Instr instr);
-  static uint32_t GetFunctionField(Instr instr);
-  static uint32_t GetImmediate16(Instr instr);
-  static uint32_t GetLabelConst(Instr instr);
-
-  static int32_t GetBranchOffset(Instr instr);
-  static bool IsLw(Instr instr);
-  static int16_t GetLwOffset(Instr instr);
-  static int16_t GetJicOrJialcOffset(Instr instr);
-  static int16_t GetLuiOffset(Instr instr);
-  static Instr SetLwOffset(Instr instr, int16_t offset);
-
-  static bool IsSw(Instr instr);
-  static Instr SetSwOffset(Instr instr, int16_t offset);
-  static bool IsAddImmediate(Instr instr);
-  static Instr SetAddImmediateOffset(Instr instr, int16_t offset);
-  static uint32_t CreateTargetAddress(Instr instr_lui, Instr instr_jic);
-  static void UnpackTargetAddress(uint32_t address, int16_t& lui_offset,
-                                  int16_t& jic_offset);
-  static void UnpackTargetAddressUnsigned(uint32_t address,
-                                          uint32_t& lui_offset,
-                                          uint32_t& jic_offset);
-
-  static bool IsAndImmediate(Instr instr);
-  static bool IsEmittedConstant(Instr instr);
-
-  void CheckTrampolinePool();
-
-  void PatchConstantPoolAccessInstruction(int pc_offset, int offset,
-                                          ConstantPoolEntry::Access access,
-                                          ConstantPoolEntry::Type type) {
-    // No embedded constant pool support.
-    UNREACHABLE();
-  }
-
-  bool IsPrevInstrCompactBranch() { return prev_instr_compact_branch_; }
-  static bool IsCompactBranchSupported() {
-    return IsMipsArchVariant(kMips32r6);
-  }
-
-  inline int UnboundLabelsCount() { return unbound_labels_count_; }
-
- protected:
-  // Load Scaled Address instruction.
-  void lsa(Register rd, Register rt, Register rs, uint8_t sa);
-
-  // Readable constants for base and offset adjustment helper, these indicate if
-  // aside from offset, another value like offset + 4 should fit into int16.
-  enum class OffsetAccessType : bool {
-    SINGLE_ACCESS = false,
-    TWO_ACCESSES = true
-  };
-
-  // Helper function for memory load/store using base register and offset.
-  void AdjustBaseAndOffset(
-      MemOperand& src,
-      OffsetAccessType access_type = OffsetAccessType::SINGLE_ACCESS,
-      int second_access_add_to_offset = 4);
-
-  int32_t buffer_space() const { return reloc_info_writer.pos() - pc_; }
-
-  // Decode branch instruction at pos and return branch target pos.
-  int target_at(int pos, bool is_internal);
-
-  // Patch branch instruction at pos to branch to given branch target pos.
-  void target_at_put(int pos, int target_pos, bool is_internal);
-
-  // Say if we need to relocate with this mode.
-  bool MustUseReg(RelocInfo::Mode rmode);
-
-  // Record reloc info for current pc_.
-  void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0);
-
-  // Block the emission of the trampoline pool before pc_offset.
-  void BlockTrampolinePoolBefore(int pc_offset) {
-    if (no_trampoline_pool_before_ < pc_offset)
-      no_trampoline_pool_before_ = pc_offset;
-  }
-
-  void StartBlockTrampolinePool() {
-    trampoline_pool_blocked_nesting_++;
-  }
-
-  void EndBlockTrampolinePool() {
-    trampoline_pool_blocked_nesting_--;
-  }
-
-  bool is_trampoline_pool_blocked() const {
-    return trampoline_pool_blocked_nesting_ > 0;
-  }
-
-  bool has_exception() const {
-    return internal_trampoline_exception_;
-  }
-
-  void DoubleAsTwoUInt32(double d, uint32_t* lo, uint32_t* hi);
-
-  bool is_trampoline_emitted() const {
-    return trampoline_emitted_;
-  }
-
-  // Temporarily block automatic assembly buffer growth.
-  void StartBlockGrowBuffer() {
-    DCHECK(!block_buffer_growth_);
-    block_buffer_growth_ = true;
-  }
-
-  void EndBlockGrowBuffer() {
-    DCHECK(block_buffer_growth_);
-    block_buffer_growth_ = false;
-  }
-
-  bool is_buffer_growth_blocked() const {
-    return block_buffer_growth_;
-  }
-
-  void EmitForbiddenSlotInstruction() {
-    if (IsPrevInstrCompactBranch()) {
-      nop();
-    }
-  }
-
-  inline void CheckTrampolinePoolQuick(int extra_instructions = 0);
-
-  inline void CheckBuffer();
-
-  RegList scratch_register_list_;
-
- private:
-  // Avoid overflows for displacements etc.
-  static const int kMaximalBufferSize = 512 * MB;
-
-  inline static void set_target_internal_reference_encoded_at(Address pc,
-                                                              Address target);
-
-  // Buffer size and constant pool distance are checked together at regular
-  // intervals of kBufferCheckInterval emitted bytes.
-  static constexpr int kBufferCheckInterval = 1 * KB / 2;
-
-  // Code generation.
-  // The relocation writer's position is at least kGap bytes below the end of
-  // the generated instructions. This is so that multi-instruction sequences do
-  // not have to check for overflow. The same is true for writes of large
-  // relocation info entries.
-  static constexpr int kGap = 32;
-
-  // Repeated checking whether the trampoline pool should be emitted is rather
-  // expensive. By default we only check again once a number of instructions
-  // has been generated.
-  static constexpr int kCheckConstIntervalInst = 32;
-  static constexpr int kCheckConstInterval =
-      kCheckConstIntervalInst * kInstrSize;
-
-  int next_buffer_check_;  // pc offset of next buffer check.
-
-  // Emission of the trampoline pool may be blocked in some code sequences.
-  int trampoline_pool_blocked_nesting_;  // Block emission if this is not zero.
-  int no_trampoline_pool_before_;  // Block emission before this pc offset.
-
-  // Keep track of the last emitted pool to guarantee a maximal distance.
-  int last_trampoline_pool_end_;  // pc offset of the end of the last pool.
-
-  // Automatic growth of the assembly buffer may be blocked for some sequences.
-  bool block_buffer_growth_;  // Block growth when true.
-
-  // Relocation information generation.
-  // Each relocation is encoded as a variable size value.
-  static constexpr int kMaxRelocSize = RelocInfoWriter::kMaxSize;
-  RelocInfoWriter reloc_info_writer;
-
-  // The bound position, before this we cannot do instruction elimination.
-  int last_bound_pos_;
-
-  // Readable constants for compact branch handling in emit()
-  enum class CompactBranchType : bool { NO = false, COMPACT_BRANCH = true };
-
-  // Code emission.
-  void GrowBuffer();
-  inline void emit(Instr x,
-                   CompactBranchType is_compact_branch = CompactBranchType::NO);
-  inline void emit(uint64_t x);
-  inline void CheckForEmitInForbiddenSlot();
-  template <typename T>
-  inline void EmitHelper(T x);
-  inline void EmitHelper(Instr x, CompactBranchType is_compact_branch);
-
-  // Instruction generation.
-  // We have 3 different kind of encoding layout on MIPS.
-  // However due to many different types of objects encoded in the same fields
-  // we have quite a few aliases for each mode.
-  // Using the same structure to refer to Register and FPURegister would spare a
-  // few aliases, but mixing both does not look clean to me.
-  // Anyway we could surely implement this differently.
-
-  void GenInstrRegister(Opcode opcode, Register rs, Register rt, Register rd,
-                        uint16_t sa = 0, SecondaryField func = nullptrSF);
-
-  void GenInstrRegister(Opcode opcode,
-                        Register rs,
-                        Register rt,
-                        uint16_t msb,
-                        uint16_t lsb,
-                        SecondaryField func);
-
-  void GenInstrRegister(Opcode opcode, SecondaryField fmt, FPURegister ft,
-                        FPURegister fs, FPURegister fd,
-                        SecondaryField func = nullptrSF);
-
-  void GenInstrRegister(Opcode opcode, FPURegister fr, FPURegister ft,
-                        FPURegister fs, FPURegister fd,
-                        SecondaryField func = nullptrSF);
-
-  void GenInstrRegister(Opcode opcode, SecondaryField fmt, Register rt,
-                        FPURegister fs, FPURegister fd,
-                        SecondaryField func = nullptrSF);
-
-  void GenInstrRegister(Opcode opcode, SecondaryField fmt, Register rt,
-                        FPUControlRegister fs, SecondaryField func = nullptrSF);
-
-  void GenInstrImmediate(
-      Opcode opcode, Register rs, Register rt, int32_t j,
-      CompactBranchType is_compact_branch = CompactBranchType::NO);
-  void GenInstrImmediate(
-      Opcode opcode, Register rs, SecondaryField SF, int32_t j,
-      CompactBranchType is_compact_branch = CompactBranchType::NO);
-  void GenInstrImmediate(
-      Opcode opcode, Register r1, FPURegister r2, int32_t j,
-      CompactBranchType is_compact_branch = CompactBranchType::NO);
-  void GenInstrImmediate(Opcode opcode, Register base, Register rt,
-                         int32_t offset9, int bit6, SecondaryField func);
-  void GenInstrImmediate(
-      Opcode opcode, Register rs, int32_t offset21,
-      CompactBranchType is_compact_branch = CompactBranchType::NO);
-  void GenInstrImmediate(Opcode opcode, Register rs, uint32_t offset21);
-  void GenInstrImmediate(
-      Opcode opcode, int32_t offset26,
-      CompactBranchType is_compact_branch = CompactBranchType::NO);
-
-
-  void GenInstrJump(Opcode opcode,
-                     uint32_t address);
-
-  // MSA
-  void GenInstrMsaI8(SecondaryField operation, uint32_t imm8, MSARegister ws,
-                     MSARegister wd);
-
-  void GenInstrMsaI5(SecondaryField operation, SecondaryField df, int32_t imm5,
-                     MSARegister ws, MSARegister wd);
-
-  void GenInstrMsaBit(SecondaryField operation, SecondaryField df, uint32_t m,
-                      MSARegister ws, MSARegister wd);
-
-  void GenInstrMsaI10(SecondaryField operation, SecondaryField df,
-                      int32_t imm10, MSARegister wd);
-
-  template <typename RegType>
-  void GenInstrMsa3R(SecondaryField operation, SecondaryField df, RegType t,
-                     MSARegister ws, MSARegister wd);
-
-  template <typename DstType, typename SrcType>
-  void GenInstrMsaElm(SecondaryField operation, SecondaryField df, uint32_t n,
-                      SrcType src, DstType dst);
-
-  void GenInstrMsa3RF(SecondaryField operation, uint32_t df, MSARegister wt,
-                      MSARegister ws, MSARegister wd);
-
-  void GenInstrMsaVec(SecondaryField operation, MSARegister wt, MSARegister ws,
-                      MSARegister wd);
-
-  void GenInstrMsaMI10(SecondaryField operation, int32_t s10, Register rs,
-                       MSARegister wd);
-
-  void GenInstrMsa2R(SecondaryField operation, SecondaryField df,
-                     MSARegister ws, MSARegister wd);
-
-  void GenInstrMsa2RF(SecondaryField operation, SecondaryField df,
-                      MSARegister ws, MSARegister wd);
-
-  void GenInstrMsaBranch(SecondaryField operation, MSARegister wt,
-                         int32_t offset16);
-
-  inline bool is_valid_msa_df_m(SecondaryField bit_df, uint32_t m) {
-    switch (bit_df) {
-      case BIT_DF_b:
-        return is_uint3(m);
-      case BIT_DF_h:
-        return is_uint4(m);
-      case BIT_DF_w:
-        return is_uint5(m);
-      case BIT_DF_d:
-        return is_uint6(m);
-      default:
-        return false;
-    }
-  }
-
-  inline bool is_valid_msa_df_n(SecondaryField elm_df, uint32_t n) {
-    switch (elm_df) {
-      case ELM_DF_B:
-        return is_uint4(n);
-      case ELM_DF_H:
-        return is_uint3(n);
-      case ELM_DF_W:
-        return is_uint2(n);
-      case ELM_DF_D:
-        return is_uint1(n);
-      default:
-        return false;
-    }
-  }
-
-  // Labels.
-  void print(const Label* L);
-  void bind_to(Label* L, int pos);
-  void next(Label* L, bool is_internal);
-
-  // One trampoline consists of:
-  // - space for trampoline slots,
-  // - space for labels.
-  //
-  // Space for trampoline slots is equal to slot_count * 2 * kInstrSize.
-  // Space for trampoline slots precedes space for labels. Each label is of one
-  // instruction size, so total amount for labels is equal to
-  // label_count *  kInstrSize.
-  class Trampoline {
-   public:
-    Trampoline() {
-      start_ = 0;
-      next_slot_ = 0;
-      free_slot_count_ = 0;
-      end_ = 0;
-    }
-    Trampoline(int start, int slot_count) {
-      start_ = start;
-      next_slot_ = start;
-      free_slot_count_ = slot_count;
-      end_ = start + slot_count * kTrampolineSlotsSize;
-    }
-    int start() {
-      return start_;
-    }
-    int end() {
-      return end_;
-    }
-    int take_slot() {
-      int trampoline_slot = kInvalidSlotPos;
-      if (free_slot_count_ <= 0) {
-        // We have run out of space on trampolines.
-        // Make sure we fail in debug mode, so we become aware of each case
-        // when this happens.
-        DCHECK(0);
-        // Internal exception will be caught.
-      } else {
-        trampoline_slot = next_slot_;
-        free_slot_count_--;
-        next_slot_ += kTrampolineSlotsSize;
-      }
-      return trampoline_slot;
-    }
-
-   private:
-    int start_;
-    int end_;
-    int next_slot_;
-    int free_slot_count_;
-  };
-
-  int32_t get_trampoline_entry(int32_t pos);
-  int unbound_labels_count_;
-  // If trampoline is emitted, generated code is becoming large. As this is
-  // already a slow case which can possibly break our code generation for the
-  // extreme case, we use this information to trigger different mode of
-  // branch instruction generation, where we use jump instructions rather
-  // than regular branch instructions.
-  bool trampoline_emitted_;
-  static constexpr int kInvalidSlotPos = -1;
-
-  // Internal reference positions, required for unbounded internal reference
-  // labels.
-  std::set<int> internal_reference_positions_;
-  bool is_internal_reference(Label* L) {
-    return internal_reference_positions_.find(L->pos()) !=
-           internal_reference_positions_.end();
-  }
-
-  void EmittedCompactBranchInstruction() { prev_instr_compact_branch_ = true; }
-  void ClearCompactBranchState() { prev_instr_compact_branch_ = false; }
-  bool prev_instr_compact_branch_ = false;
-
-  Trampoline trampoline_;
-  bool internal_trampoline_exception_;
-
-  // The following functions help with avoiding allocations of embedded heap
-  // objects during the code assembly phase. {RequestHeapObject} records the
-  // need for a future heap number allocation or code stub generation. After
-  // code assembly, {AllocateAndInstallRequestedHeapObjects} will allocate these
-  // objects and place them where they are expected (determined by the pc offset
-  // associated with each request). That is, for each request, it will patch the
-  // dummy heap object handle that we emitted during code assembly with the
-  // actual heap object handle.
- protected:
-  // TODO(neis): Make private if its use can be moved out of TurboAssembler.
-  void RequestHeapObject(HeapObjectRequest request);
-
- private:
-  void AllocateAndInstallRequestedHeapObjects(Isolate* isolate);
-
-  std::forward_list<HeapObjectRequest> heap_object_requests_;
-
-  friend class RegExpMacroAssemblerMIPS;
-  friend class RelocInfo;
-  friend class BlockTrampolinePoolScope;
-  friend class EnsureSpace;
-};
-
-
-class EnsureSpace BASE_EMBEDDED {
- public:
-  explicit inline EnsureSpace(Assembler* assembler);
-};
-
-class UseScratchRegisterScope {
- public:
-  explicit UseScratchRegisterScope(Assembler* assembler);
-  ~UseScratchRegisterScope();
-
-  Register Acquire();
-  bool hasAvailable() const;
-
- private:
-  RegList* available_;
-  RegList old_available_;
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_ARM_ASSEMBLER_MIPS_H_
diff --git a/src/v8/src/mips/code-stubs-mips.cc b/src/v8/src/mips/code-stubs-mips.cc
deleted file mode 100644
index 7ae3451..0000000
--- a/src/v8/src/mips/code-stubs-mips.cc
+++ /dev/null
@@ -1,1304 +0,0 @@
-// Copyright 2012 the V8 project 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 V8_TARGET_ARCH_MIPS
-
-#include "src/api-arguments.h"
-#include "src/base/bits.h"
-#include "src/bootstrapper.h"
-#include "src/code-stubs.h"
-#include "src/frame-constants.h"
-#include "src/frames.h"
-#include "src/heap/heap-inl.h"
-#include "src/ic/ic.h"
-#include "src/ic/stub-cache.h"
-#include "src/isolate.h"
-#include "src/regexp/jsregexp.h"
-#include "src/regexp/regexp-macro-assembler.h"
-#include "src/runtime/runtime.h"
-
-#include "src/mips/code-stubs-mips.h"  // Cannot be the first include.
-
-namespace v8 {
-namespace internal {
-
-#define __ ACCESS_MASM(masm)
-
-void ArrayNArgumentsConstructorStub::Generate(MacroAssembler* masm) {
-  __ sll(t9, a0, kPointerSizeLog2);
-  __ Addu(t9, sp, t9);
-  __ sw(a1, MemOperand(t9, 0));
-  __ Push(a1);
-  __ Push(a2);
-  __ Addu(a0, a0, Operand(3));
-  __ TailCallRuntime(Runtime::kNewArray);
-}
-
-
-void DoubleToIStub::Generate(MacroAssembler* masm) {
-  Label out_of_range, only_low, negate, done;
-  Register result_reg = destination();
-
-  Register scratch = GetRegisterThatIsNotOneOf(result_reg);
-  Register scratch2 = GetRegisterThatIsNotOneOf(result_reg, scratch);
-  Register scratch3 = GetRegisterThatIsNotOneOf(result_reg, scratch, scratch2);
-  DoubleRegister double_scratch = kLithiumScratchDouble;
-
-  // Account for saved regs.
-  const int kArgumentOffset = 3 * kPointerSize;
-
-  __ Push(scratch, scratch2, scratch3);
-
-  // Load double input.
-  __ Ldc1(double_scratch, MemOperand(sp, kArgumentOffset));
-
-  // Clear cumulative exception flags and save the FCSR.
-  __ cfc1(scratch2, FCSR);
-  __ ctc1(zero_reg, FCSR);
-
-  // Try a conversion to a signed integer.
-  __ Trunc_w_d(double_scratch, double_scratch);
-  // Move the converted value into the result register.
-  __ mfc1(scratch3, double_scratch);
-
-  // Retrieve and restore the FCSR.
-  __ cfc1(scratch, FCSR);
-  __ ctc1(scratch2, FCSR);
-
-  // Check for overflow and NaNs.
-  __ And(
-      scratch, scratch,
-      kFCSROverflowFlagMask | kFCSRUnderflowFlagMask | kFCSRInvalidOpFlagMask);
-  // If we had no exceptions then set result_reg and we are done.
-  Label error;
-  __ Branch(&error, ne, scratch, Operand(zero_reg));
-  __ Move(result_reg, scratch3);
-  __ Branch(&done);
-  __ bind(&error);
-
-  // Load the double value and perform a manual truncation.
-  Register input_high = scratch2;
-  Register input_low = scratch3;
-
-  __ lw(input_low, MemOperand(sp, kArgumentOffset + Register::kMantissaOffset));
-  __ lw(input_high,
-        MemOperand(sp, kArgumentOffset + Register::kExponentOffset));
-
-  Label normal_exponent, restore_sign;
-  // Extract the biased exponent in result.
-  __ Ext(result_reg,
-         input_high,
-         HeapNumber::kExponentShift,
-         HeapNumber::kExponentBits);
-
-  // Check for Infinity and NaNs, which should return 0.
-  __ Subu(scratch, result_reg, HeapNumber::kExponentMask);
-  __ Movz(result_reg, zero_reg, scratch);
-  __ Branch(&done, eq, scratch, Operand(zero_reg));
-
-  // Express exponent as delta to (number of mantissa bits + 31).
-  __ Subu(result_reg,
-          result_reg,
-          Operand(HeapNumber::kExponentBias + HeapNumber::kMantissaBits + 31));
-
-  // If the delta is strictly positive, all bits would be shifted away,
-  // which means that we can return 0.
-  __ Branch(&normal_exponent, le, result_reg, Operand(zero_reg));
-  __ mov(result_reg, zero_reg);
-  __ Branch(&done);
-
-  __ bind(&normal_exponent);
-  const int kShiftBase = HeapNumber::kNonMantissaBitsInTopWord - 1;
-  // Calculate shift.
-  __ Addu(scratch, result_reg, Operand(kShiftBase + HeapNumber::kMantissaBits));
-
-  // Save the sign.
-  Register sign = result_reg;
-  result_reg = no_reg;
-  __ And(sign, input_high, Operand(HeapNumber::kSignMask));
-
-  // On ARM shifts > 31 bits are valid and will result in zero. On MIPS we need
-  // to check for this specific case.
-  Label high_shift_needed, high_shift_done;
-  __ Branch(&high_shift_needed, lt, scratch, Operand(32));
-  __ mov(input_high, zero_reg);
-  __ Branch(&high_shift_done);
-  __ bind(&high_shift_needed);
-
-  // Set the implicit 1 before the mantissa part in input_high.
-  __ Or(input_high,
-        input_high,
-        Operand(1 << HeapNumber::kMantissaBitsInTopWord));
-  // Shift the mantissa bits to the correct position.
-  // We don't need to clear non-mantissa bits as they will be shifted away.
-  // If they weren't, it would mean that the answer is in the 32bit range.
-  __ sllv(input_high, input_high, scratch);
-
-  __ bind(&high_shift_done);
-
-  // Replace the shifted bits with bits from the lower mantissa word.
-  Label pos_shift, shift_done;
-  __ li(at, 32);
-  __ subu(scratch, at, scratch);
-  __ Branch(&pos_shift, ge, scratch, Operand(zero_reg));
-
-  // Negate scratch.
-  __ Subu(scratch, zero_reg, scratch);
-  __ sllv(input_low, input_low, scratch);
-  __ Branch(&shift_done);
-
-  __ bind(&pos_shift);
-  __ srlv(input_low, input_low, scratch);
-
-  __ bind(&shift_done);
-  __ Or(input_high, input_high, Operand(input_low));
-  // Restore sign if necessary.
-  __ mov(scratch, sign);
-  result_reg = sign;
-  sign = no_reg;
-  __ Subu(result_reg, zero_reg, input_high);
-  __ Movz(result_reg, input_high, scratch);
-
-  __ bind(&done);
-
-  __ Pop(scratch, scratch2, scratch3);
-  __ Ret();
-}
-
-
-void MathPowStub::Generate(MacroAssembler* masm) {
-  const Register exponent = MathPowTaggedDescriptor::exponent();
-  DCHECK(exponent == a2);
-  const DoubleRegister double_base = f2;
-  const DoubleRegister double_exponent = f4;
-  const DoubleRegister double_result = f0;
-  const DoubleRegister double_scratch = f6;
-  const FPURegister single_scratch = f8;
-  const Register scratch = t5;
-  const Register scratch2 = t3;
-
-  Label call_runtime, done, int_exponent;
-  if (exponent_type() == TAGGED) {
-    // Base is already in double_base.
-    __ UntagAndJumpIfSmi(scratch, exponent, &int_exponent);
-
-    __ Ldc1(double_exponent,
-            FieldMemOperand(exponent, HeapNumber::kValueOffset));
-  }
-
-  if (exponent_type() != INTEGER) {
-    Label int_exponent_convert;
-    // Detect integer exponents stored as double.
-    __ EmitFPUTruncate(kRoundToMinusInf,
-                       scratch,
-                       double_exponent,
-                       at,
-                       double_scratch,
-                       scratch2,
-                       kCheckForInexactConversion);
-    // scratch2 == 0 means there was no conversion error.
-    __ Branch(&int_exponent_convert, eq, scratch2, Operand(zero_reg));
-
-    __ push(ra);
-    {
-      AllowExternalCallThatCantCauseGC scope(masm);
-      __ PrepareCallCFunction(0, 2, scratch2);
-      __ MovToFloatParameters(double_base, double_exponent);
-      __ CallCFunction(
-          ExternalReference::power_double_double_function(isolate()),
-          0, 2);
-    }
-    __ pop(ra);
-    __ MovFromFloatResult(double_result);
-    __ jmp(&done);
-
-    __ bind(&int_exponent_convert);
-  }
-
-  // Calculate power with integer exponent.
-  __ bind(&int_exponent);
-
-  // Get two copies of exponent in the registers scratch and exponent.
-  if (exponent_type() == INTEGER) {
-    __ mov(scratch, exponent);
-  } else {
-    // Exponent has previously been stored into scratch as untagged integer.
-    __ mov(exponent, scratch);
-  }
-
-  __ mov_d(double_scratch, double_base);  // Back up base.
-  __ Move(double_result, 1.0);
-
-  // Get absolute value of exponent.
-  Label positive_exponent, bail_out;
-  __ Branch(&positive_exponent, ge, scratch, Operand(zero_reg));
-  __ Subu(scratch, zero_reg, scratch);
-  // Check when Subu overflows and we get negative result
-  // (happens only when input is MIN_INT).
-  __ Branch(&bail_out, gt, zero_reg, Operand(scratch));
-  __ bind(&positive_exponent);
-  __ Assert(ge, AbortReason::kUnexpectedNegativeValue, scratch,
-            Operand(zero_reg));
-
-  Label while_true, no_carry, loop_end;
-  __ bind(&while_true);
-
-  __ And(scratch2, scratch, 1);
-
-  __ Branch(&no_carry, eq, scratch2, Operand(zero_reg));
-  __ mul_d(double_result, double_result, double_scratch);
-  __ bind(&no_carry);
-
-  __ sra(scratch, scratch, 1);
-
-  __ Branch(&loop_end, eq, scratch, Operand(zero_reg));
-  __ mul_d(double_scratch, double_scratch, double_scratch);
-
-  __ Branch(&while_true);
-
-  __ bind(&loop_end);
-
-  __ Branch(&done, ge, exponent, Operand(zero_reg));
-  __ Move(double_scratch, 1.0);
-  __ div_d(double_result, double_scratch, double_result);
-  // Test whether result is zero.  Bail out to check for subnormal result.
-  // Due to subnormals, x^-y == (1/x)^y does not hold in all cases.
-  __ BranchF(&done, nullptr, ne, double_result, kDoubleRegZero);
-
-  // double_exponent may not contain the exponent value if the input was a
-  // smi.  We set it with exponent value before bailing out.
-  __ bind(&bail_out);
-  __ mtc1(exponent, single_scratch);
-  __ cvt_d_w(double_exponent, single_scratch);
-
-  // Returning or bailing out.
-  __ push(ra);
-  {
-    AllowExternalCallThatCantCauseGC scope(masm);
-    __ PrepareCallCFunction(0, 2, scratch);
-    __ MovToFloatParameters(double_base, double_exponent);
-    __ CallCFunction(ExternalReference::power_double_double_function(isolate()),
-                     0, 2);
-  }
-  __ pop(ra);
-  __ MovFromFloatResult(double_result);
-
-  __ bind(&done);
-  __ Ret();
-}
-
-Movability CEntryStub::NeedsImmovableCode() { return kImmovable; }
-
-void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) {
-  CEntryStub::GenerateAheadOfTime(isolate);
-  CommonArrayConstructorStub::GenerateStubsAheadOfTime(isolate);
-  StoreFastElementStub::GenerateAheadOfTime(isolate);
-}
-
-
-void CodeStub::GenerateFPStubs(Isolate* isolate) {
-  // Generate if not already in cache.
-  SaveFPRegsMode mode = kSaveFPRegs;
-  CEntryStub(isolate, 1, mode).GetCode();
-}
-
-
-void CEntryStub::GenerateAheadOfTime(Isolate* isolate) {
-  CEntryStub stub(isolate, 1, kDontSaveFPRegs);
-  stub.GetCode();
-  CEntryStub save_doubles(isolate, 1, kSaveFPRegs);
-  save_doubles.GetCode();
-}
-
-
-void CEntryStub::Generate(MacroAssembler* masm) {
-  // Called from JavaScript; parameters are on stack as if calling JS function
-  // a0: number of arguments including receiver
-  // a1: pointer to builtin function
-  // fp: frame pointer    (restored after C call)
-  // sp: stack pointer    (restored as callee's sp after C call)
-  // cp: current context  (C callee-saved)
-  //
-  // If argv_in_register():
-  // a2: pointer to the first argument
-
-  ProfileEntryHookStub::MaybeCallEntryHook(masm);
-
-  if (argv_in_register()) {
-    // Move argv into the correct register.
-    __ mov(s1, a2);
-  } else {
-    // Compute the argv pointer in a callee-saved register.
-    __ Lsa(s1, sp, a0, kPointerSizeLog2);
-    __ Subu(s1, s1, kPointerSize);
-  }
-
-  // Enter the exit frame that transitions from JavaScript to C++.
-  FrameScope scope(masm, StackFrame::MANUAL);
-  __ EnterExitFrame(save_doubles(), 0, is_builtin_exit()
-                                           ? StackFrame::BUILTIN_EXIT
-                                           : StackFrame::EXIT);
-
-  // s0: number of arguments  including receiver (C callee-saved)
-  // s1: pointer to first argument (C callee-saved)
-  // s2: pointer to builtin function (C callee-saved)
-
-  // Prepare arguments for C routine.
-  // a0 = argc
-  __ mov(s0, a0);
-  __ mov(s2, a1);
-
-  // We are calling compiled C/C++ code. a0 and a1 hold our two arguments. We
-  // also need to reserve the 4 argument slots on the stack.
-
-  __ AssertStackIsAligned();
-
-  // a0 = argc, a1 = argv, a2 = isolate
-  __ li(a2, Operand(ExternalReference::isolate_address(isolate())));
-  __ mov(a1, s1);
-
-  // To let the GC traverse the return address of the exit frames, we need to
-  // know where the return address is. The CEntryStub is unmovable, so
-  // we can store the address on the stack to be able to find it again and
-  // we never have to restore it, because it will not change.
-  { Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm);
-    int kNumInstructionsToJump = 4;
-    Label find_ra;
-    // Adjust the value in ra to point to the correct return location, 2nd
-    // instruction past the real call into C code (the jalr(t9)), and push it.
-    // This is the return address of the exit frame.
-    if (kArchVariant >= kMips32r6) {
-      __ addiupc(ra, kNumInstructionsToJump + 1);
-    } else {
-      // This branch-and-link sequence is needed to find the current PC on mips
-      // before r6, saved to the ra register.
-      __ bal(&find_ra);  // bal exposes branch delay slot.
-      __ Addu(ra, ra, kNumInstructionsToJump * Instruction::kInstrSize);
-    }
-    __ bind(&find_ra);
-
-    // This spot was reserved in EnterExitFrame.
-    __ sw(ra, MemOperand(sp));
-    // Stack space reservation moved to the branch delay slot below.
-    // Stack is still aligned.
-
-    // Call the C routine.
-    __ mov(t9, s2);  // Function pointer to t9 to conform to ABI for PIC.
-    __ jalr(t9);
-    // Set up sp in the delay slot.
-    __ addiu(sp, sp, -kCArgsSlotsSize);
-    // Make sure the stored 'ra' points to this position.
-    DCHECK_EQ(kNumInstructionsToJump,
-              masm->InstructionsGeneratedSince(&find_ra));
-  }
-
-  // Result returned in v0 or v1:v0 - do not destroy these registers!
-
-  // Check result for exception sentinel.
-  Label exception_returned;
-  __ LoadRoot(t0, Heap::kExceptionRootIndex);
-  __ Branch(&exception_returned, eq, t0, Operand(v0));
-
-  // Check that there is no pending exception, otherwise we
-  // should have returned the exception sentinel.
-  if (FLAG_debug_code) {
-    Label okay;
-    ExternalReference pending_exception_address(
-        IsolateAddressId::kPendingExceptionAddress, isolate());
-    __ li(a2, Operand(pending_exception_address));
-    __ lw(a2, MemOperand(a2));
-    __ LoadRoot(t0, Heap::kTheHoleValueRootIndex);
-    // Cannot use check here as it attempts to generate call into runtime.
-    __ Branch(&okay, eq, t0, Operand(a2));
-    __ stop("Unexpected pending exception");
-    __ bind(&okay);
-  }
-
-  // Exit C frame and return.
-  // v0:v1: result
-  // sp: stack pointer
-  // fp: frame pointer
-  Register argc = argv_in_register()
-                      // We don't want to pop arguments so set argc to no_reg.
-                      ? no_reg
-                      // s0: still holds argc (callee-saved).
-                      : s0;
-  __ LeaveExitFrame(save_doubles(), argc, EMIT_RETURN);
-
-  // Handling of exception.
-  __ bind(&exception_returned);
-
-  ExternalReference pending_handler_context_address(
-      IsolateAddressId::kPendingHandlerContextAddress, isolate());
-  ExternalReference pending_handler_entrypoint_address(
-      IsolateAddressId::kPendingHandlerEntrypointAddress, isolate());
-  ExternalReference pending_handler_fp_address(
-      IsolateAddressId::kPendingHandlerFPAddress, isolate());
-  ExternalReference pending_handler_sp_address(
-      IsolateAddressId::kPendingHandlerSPAddress, isolate());
-
-  // Ask the runtime for help to determine the handler. This will set v0 to
-  // contain the current pending exception, don't clobber it.
-  ExternalReference find_handler(Runtime::kUnwindAndFindExceptionHandler,
-                                 isolate());
-  {
-    FrameScope scope(masm, StackFrame::MANUAL);
-    __ PrepareCallCFunction(3, 0, a0);
-    __ mov(a0, zero_reg);
-    __ mov(a1, zero_reg);
-    __ li(a2, Operand(ExternalReference::isolate_address(isolate())));
-    __ CallCFunction(find_handler, 3);
-  }
-
-  // Retrieve the handler context, SP and FP.
-  __ li(cp, Operand(pending_handler_context_address));
-  __ lw(cp, MemOperand(cp));
-  __ li(sp, Operand(pending_handler_sp_address));
-  __ lw(sp, MemOperand(sp));
-  __ li(fp, Operand(pending_handler_fp_address));
-  __ lw(fp, MemOperand(fp));
-
-  // If the handler is a JS frame, restore the context to the frame. Note that
-  // the context will be set to (cp == 0) for non-JS frames.
-  Label zero;
-  __ Branch(&zero, eq, cp, Operand(zero_reg));
-  __ sw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
-  __ bind(&zero);
-
-  // Compute the handler entry address and jump to it.
-  __ li(t9, Operand(pending_handler_entrypoint_address));
-  __ lw(t9, MemOperand(t9));
-  __ Jump(t9);
-}
-
-
-void JSEntryStub::Generate(MacroAssembler* masm) {
-  Label invoke, handler_entry, exit;
-  Isolate* isolate = masm->isolate();
-
-  // Registers:
-  // a0: entry address
-  // a1: function
-  // a2: receiver
-  // a3: argc
-  //
-  // Stack:
-  // 4 args slots
-  // args
-
-  ProfileEntryHookStub::MaybeCallEntryHook(masm);
-
-  // Save callee saved registers on the stack.
-  __ MultiPush(kCalleeSaved | ra.bit());
-
-  // Save callee-saved FPU registers.
-  __ MultiPushFPU(kCalleeSavedFPU);
-  // Set up the reserved register for 0.0.
-  __ Move(kDoubleRegZero, 0.0);
-
-
-  // Load argv in s0 register.
-  int offset_to_argv = (kNumCalleeSaved + 1) * kPointerSize;
-  offset_to_argv += kNumCalleeSavedFPU * kDoubleSize;
-
-  __ InitializeRootRegister();
-  __ lw(s0, MemOperand(sp, offset_to_argv + kCArgsSlotsSize));
-
-  // We build an EntryFrame.
-  __ li(t3, Operand(-1));  // Push a bad frame pointer to fail if it is used.
-  StackFrame::Type marker = type();
-  __ li(t2, Operand(StackFrame::TypeToMarker(marker)));
-  __ li(t1, Operand(StackFrame::TypeToMarker(marker)));
-  __ li(t0, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress,
-                                      isolate)));
-  __ lw(t0, MemOperand(t0));
-  __ Push(t3, t2, t1, t0);
-  // Set up frame pointer for the frame to be pushed.
-  __ addiu(fp, sp, -EntryFrameConstants::kCallerFPOffset);
-
-  // Registers:
-  // a0: entry_address
-  // a1: function
-  // a2: receiver_pointer
-  // a3: argc
-  // s0: argv
-  //
-  // Stack:
-  // caller fp          |
-  // function slot      | entry frame
-  // context slot       |
-  // bad fp (0xFF...F)  |
-  // callee saved registers + ra
-  // 4 args slots
-  // args
-
-  // If this is the outermost JS call, set js_entry_sp value.
-  Label non_outermost_js;
-  ExternalReference js_entry_sp(IsolateAddressId::kJSEntrySPAddress, isolate);
-  __ li(t1, Operand(ExternalReference(js_entry_sp)));
-  __ lw(t2, MemOperand(t1));
-  __ Branch(&non_outermost_js, ne, t2, Operand(zero_reg));
-  __ sw(fp, MemOperand(t1));
-  __ li(t0, Operand(StackFrame::OUTERMOST_JSENTRY_FRAME));
-  Label cont;
-  __ b(&cont);
-  __ nop();   // Branch delay slot nop.
-  __ bind(&non_outermost_js);
-  __ li(t0, Operand(StackFrame::INNER_JSENTRY_FRAME));
-  __ bind(&cont);
-  __ push(t0);
-
-  // Jump to a faked try block that does the invoke, with a faked catch
-  // block that sets the pending exception.
-  __ jmp(&invoke);
-  __ bind(&handler_entry);
-  handler_offset_ = handler_entry.pos();
-  // Caught exception: Store result (exception) in the pending exception
-  // field in the JSEnv and return a failure sentinel.  Coming in here the
-  // fp will be invalid because the PushStackHandler below sets it to 0 to
-  // signal the existence of the JSEntry frame.
-  __ li(t0, Operand(ExternalReference(
-                IsolateAddressId::kPendingExceptionAddress, isolate)));
-  __ sw(v0, MemOperand(t0));  // We come back from 'invoke'. result is in v0.
-  __ LoadRoot(v0, Heap::kExceptionRootIndex);
-  __ b(&exit);  // b exposes branch delay slot.
-  __ nop();   // Branch delay slot nop.
-
-  // Invoke: Link this frame into the handler chain.
-  __ bind(&invoke);
-  __ PushStackHandler();
-  // If an exception not caught by another handler occurs, this handler
-  // returns control to the code after the bal(&invoke) above, which
-  // restores all kCalleeSaved registers (including cp and fp) to their
-  // saved values before returning a failure to C.
-
-  // Invoke the function by calling through JS entry trampoline builtin.
-  // Notice that we cannot store a reference to the trampoline code directly in
-  // this stub, because runtime stubs are not traversed when doing GC.
-
-  // Registers:
-  // a0: entry_address
-  // a1: function
-  // a2: receiver_pointer
-  // a3: argc
-  // s0: argv
-  //
-  // Stack:
-  // handler frame
-  // entry frame
-  // callee saved registers + ra
-  // 4 args slots
-  // args
-  __ Call(EntryTrampoline(), RelocInfo::CODE_TARGET);
-
-  // Unlink this frame from the handler chain.
-  __ PopStackHandler();
-
-  __ bind(&exit);  // v0 holds result
-  // Check if the current stack frame is marked as the outermost JS frame.
-  Label non_outermost_js_2;
-  __ pop(t1);
-  __ Branch(&non_outermost_js_2, ne, t1,
-            Operand(StackFrame::OUTERMOST_JSENTRY_FRAME));
-  __ li(t1, Operand(ExternalReference(js_entry_sp)));
-  __ sw(zero_reg, MemOperand(t1));
-  __ bind(&non_outermost_js_2);
-
-  // Restore the top frame descriptors from the stack.
-  __ pop(t1);
-  __ li(t0, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress,
-                                      isolate)));
-  __ sw(t1, MemOperand(t0));
-
-  // Reset the stack to the callee saved registers.
-  __ addiu(sp, sp, -EntryFrameConstants::kCallerFPOffset);
-
-  // Restore callee-saved fpu registers.
-  __ MultiPopFPU(kCalleeSavedFPU);
-
-  // Restore callee saved registers from the stack.
-  __ MultiPop(kCalleeSaved | ra.bit());
-  // Return.
-  __ Jump(ra);
-}
-
-void DirectCEntryStub::Generate(MacroAssembler* masm) {
-  // Make place for arguments to fit C calling convention. Most of the callers
-  // of DirectCEntryStub::GenerateCall are using EnterExitFrame/LeaveExitFrame
-  // so they handle stack restoring and we don't have to do that here.
-  // Any caller of DirectCEntryStub::GenerateCall must take care of dropping
-  // kCArgsSlotsSize stack space after the call.
-  __ Subu(sp, sp, Operand(kCArgsSlotsSize));
-  // Place the return address on the stack, making the call
-  // GC safe. The RegExp backend also relies on this.
-  __ sw(ra, MemOperand(sp, kCArgsSlotsSize));
-  __ Call(t9);  // Call the C++ function.
-  __ lw(t9, MemOperand(sp, kCArgsSlotsSize));
-
-  if (FLAG_debug_code && FLAG_enable_slow_asserts) {
-    // In case of an error the return address may point to a memory area
-    // filled with kZapValue by the GC.
-    // Dereference the address and check for this.
-    __ lw(t0, MemOperand(t9));
-    __ Assert(ne, AbortReason::kReceivedInvalidReturnAddress, t0,
-              Operand(reinterpret_cast<uint32_t>(kZapValue)));
-  }
-  __ Jump(t9);
-}
-
-
-void DirectCEntryStub::GenerateCall(MacroAssembler* masm,
-                                    Register target) {
-  intptr_t loc =
-      reinterpret_cast<intptr_t>(GetCode().location());
-  __ Move(t9, target);
-  __ li(at, Operand(loc, RelocInfo::CODE_TARGET), CONSTANT_SIZE);
-  __ Call(at);
-}
-
-
-void ProfileEntryHookStub::MaybeCallEntryHookDelayed(TurboAssembler* tasm,
-                                                     Zone* zone) {
-  if (tasm->isolate()->function_entry_hook() != nullptr) {
-    tasm->push(ra);
-    tasm->CallStubDelayed(new (zone) ProfileEntryHookStub(nullptr));
-    tasm->pop(ra);
-  }
-}
-
-void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
-  if (masm->isolate()->function_entry_hook() != nullptr) {
-    ProfileEntryHookStub stub(masm->isolate());
-    __ push(ra);
-    __ CallStub(&stub);
-    __ pop(ra);
-  }
-}
-
-
-void ProfileEntryHookStub::Generate(MacroAssembler* masm) {
-  // The entry hook is a "push ra" instruction, followed by a call.
-  // Note: on MIPS "push" is 2 instruction
-  const int32_t kReturnAddressDistanceFromFunctionStart =
-      Assembler::kCallTargetAddressOffset + (2 * Assembler::kInstrSize);
-
-  // This should contain all kJSCallerSaved registers.
-  const RegList kSavedRegs =
-     kJSCallerSaved |  // Caller saved registers.
-     s5.bit();         // Saved stack pointer.
-
-  // We also save ra, so the count here is one higher than the mask indicates.
-  const int32_t kNumSavedRegs = kNumJSCallerSaved + 2;
-
-  // Save all caller-save registers as this may be called from anywhere.
-  __ MultiPush(kSavedRegs | ra.bit());
-
-  // Compute the function's address for the first argument.
-  __ Subu(a0, ra, Operand(kReturnAddressDistanceFromFunctionStart));
-
-  // The caller's return address is above the saved temporaries.
-  // Grab that for the second argument to the hook.
-  __ Addu(a1, sp, Operand(kNumSavedRegs * kPointerSize));
-
-  // Align the stack if necessary.
-  int frame_alignment = masm->ActivationFrameAlignment();
-  if (frame_alignment > kPointerSize) {
-    __ mov(s5, sp);
-    DCHECK(base::bits::IsPowerOfTwo(frame_alignment));
-    __ And(sp, sp, Operand(-frame_alignment));
-  }
-  __ Subu(sp, sp, kCArgsSlotsSize);
-#if defined(V8_HOST_ARCH_MIPS)
-  int32_t entry_hook =
-      reinterpret_cast<int32_t>(isolate()->function_entry_hook());
-  __ li(t9, Operand(entry_hook));
-#else
-  // Under the simulator we need to indirect the entry hook through a
-  // trampoline function at a known address.
-  // It additionally takes an isolate as a third parameter.
-  __ li(a2, Operand(ExternalReference::isolate_address(isolate())));
-
-  ApiFunction dispatcher(FUNCTION_ADDR(EntryHookTrampoline));
-  __ li(t9, Operand(ExternalReference(&dispatcher,
-                                      ExternalReference::BUILTIN_CALL,
-                                      isolate())));
-#endif
-  // Call C function through t9 to conform ABI for PIC.
-  __ Call(t9);
-
-  // Restore the stack pointer if needed.
-  if (frame_alignment > kPointerSize) {
-    __ mov(sp, s5);
-  } else {
-    __ Addu(sp, sp, kCArgsSlotsSize);
-  }
-
-  // Also pop ra to get Ret(0).
-  __ MultiPop(kSavedRegs | ra.bit());
-  __ Ret();
-}
-
-
-template<class T>
-static void CreateArrayDispatch(MacroAssembler* masm,
-                                AllocationSiteOverrideMode mode) {
-  if (mode == DISABLE_ALLOCATION_SITES) {
-    T stub(masm->isolate(), GetInitialFastElementsKind(), mode);
-    __ TailCallStub(&stub);
-  } else if (mode == DONT_OVERRIDE) {
-    int last_index =
-        GetSequenceIndexFromFastElementsKind(TERMINAL_FAST_ELEMENTS_KIND);
-    for (int i = 0; i <= last_index; ++i) {
-      ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
-      T stub(masm->isolate(), kind);
-      __ TailCallStub(&stub, eq, a3, Operand(kind));
-    }
-
-    // If we reached this point there is a problem.
-    __ Abort(AbortReason::kUnexpectedElementsKindInArrayConstructor);
-  } else {
-    UNREACHABLE();
-  }
-}
-
-
-static void CreateArrayDispatchOneArgument(MacroAssembler* masm,
-                                           AllocationSiteOverrideMode mode) {
-  // a2 - allocation site (if mode != DISABLE_ALLOCATION_SITES)
-  // a3 - kind (if mode != DISABLE_ALLOCATION_SITES)
-  // a0 - number of arguments
-  // a1 - constructor?
-  // sp[0] - last argument
-    STATIC_ASSERT(PACKED_SMI_ELEMENTS == 0);
-    STATIC_ASSERT(HOLEY_SMI_ELEMENTS == 1);
-    STATIC_ASSERT(PACKED_ELEMENTS == 2);
-    STATIC_ASSERT(HOLEY_ELEMENTS == 3);
-    STATIC_ASSERT(PACKED_DOUBLE_ELEMENTS == 4);
-    STATIC_ASSERT(HOLEY_DOUBLE_ELEMENTS == 5);
-
-  if (mode == DISABLE_ALLOCATION_SITES) {
-    ElementsKind initial = GetInitialFastElementsKind();
-    ElementsKind holey_initial = GetHoleyElementsKind(initial);
-
-    ArraySingleArgumentConstructorStub stub_holey(masm->isolate(),
-                                                  holey_initial,
-                                                  DISABLE_ALLOCATION_SITES);
-    __ TailCallStub(&stub_holey);
-  } else if (mode == DONT_OVERRIDE) {
-    // is the low bit set? If so, we are holey and that is good.
-    Label normal_sequence;
-    __ And(at, a3, Operand(1));
-    __ Branch(&normal_sequence, ne, at, Operand(zero_reg));
-
-    // We are going to create a holey array, but our kind is non-holey.
-    // Fix kind and retry (only if we have an allocation site in the slot).
-    __ Addu(a3, a3, Operand(1));
-
-    if (FLAG_debug_code) {
-      __ lw(t1, FieldMemOperand(a2, 0));
-      __ LoadRoot(at, Heap::kAllocationSiteMapRootIndex);
-      __ Assert(eq, AbortReason::kExpectedAllocationSite, t1, Operand(at));
-    }
-
-    // Save the resulting elements kind in type info. We can't just store a3
-    // in the AllocationSite::transition_info field because elements kind is
-    // restricted to a portion of the field...upper bits need to be left alone.
-    STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
-    __ lw(t0, FieldMemOperand(
-                  a2, AllocationSite::kTransitionInfoOrBoilerplateOffset));
-    __ Addu(t0, t0, Operand(Smi::FromInt(kFastElementsKindPackedToHoley)));
-    __ sw(t0, FieldMemOperand(
-                  a2, AllocationSite::kTransitionInfoOrBoilerplateOffset));
-
-    __ bind(&normal_sequence);
-    int last_index =
-        GetSequenceIndexFromFastElementsKind(TERMINAL_FAST_ELEMENTS_KIND);
-    for (int i = 0; i <= last_index; ++i) {
-      ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
-      ArraySingleArgumentConstructorStub stub(masm->isolate(), kind);
-      __ TailCallStub(&stub, eq, a3, Operand(kind));
-    }
-
-    // If we reached this point there is a problem.
-    __ Abort(AbortReason::kUnexpectedElementsKindInArrayConstructor);
-  } else {
-    UNREACHABLE();
-  }
-}
-
-
-template<class T>
-static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) {
-  int to_index =
-      GetSequenceIndexFromFastElementsKind(TERMINAL_FAST_ELEMENTS_KIND);
-  for (int i = 0; i <= to_index; ++i) {
-    ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
-    T stub(isolate, kind);
-    stub.GetCode();
-    if (AllocationSite::ShouldTrack(kind)) {
-      T stub1(isolate, kind, DISABLE_ALLOCATION_SITES);
-      stub1.GetCode();
-    }
-  }
-}
-
-void CommonArrayConstructorStub::GenerateStubsAheadOfTime(Isolate* isolate) {
-  ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>(
-      isolate);
-  ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>(
-      isolate);
-  ArrayNArgumentsConstructorStub stub(isolate);
-  stub.GetCode();
-  ElementsKind kinds[2] = {PACKED_ELEMENTS, HOLEY_ELEMENTS};
-  for (int i = 0; i < 2; i++) {
-    // For internal arrays we only need a few things.
-    InternalArrayNoArgumentConstructorStub stubh1(isolate, kinds[i]);
-    stubh1.GetCode();
-    InternalArraySingleArgumentConstructorStub stubh2(isolate, kinds[i]);
-    stubh2.GetCode();
-  }
-}
-
-
-void ArrayConstructorStub::GenerateDispatchToArrayStub(
-    MacroAssembler* masm,
-    AllocationSiteOverrideMode mode) {
-  Label not_zero_case, not_one_case;
-  __ And(at, a0, a0);
-  __ Branch(&not_zero_case, ne, at, Operand(zero_reg));
-  CreateArrayDispatch<ArrayNoArgumentConstructorStub>(masm, mode);
-
-  __ bind(&not_zero_case);
-  __ Branch(&not_one_case, gt, a0, Operand(1));
-  CreateArrayDispatchOneArgument(masm, mode);
-
-  __ bind(&not_one_case);
-  ArrayNArgumentsConstructorStub stub(masm->isolate());
-  __ TailCallStub(&stub);
-}
-
-
-void ArrayConstructorStub::Generate(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- a0 : argc (only if argument_count() is ANY or MORE_THAN_ONE)
-  //  -- a1 : constructor
-  //  -- a2 : AllocationSite or undefined
-  //  -- a3 : Original constructor
-  //  -- sp[0] : last argument
-  // -----------------------------------
-
-  if (FLAG_debug_code) {
-    // The array construct code is only set for the global and natives
-    // builtin Array functions which always have maps.
-
-    // Initial map for the builtin Array function should be a map.
-    __ lw(t0, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset));
-    // Will both indicate a nullptr and a Smi.
-    __ SmiTst(t0, at);
-    __ Assert(ne, AbortReason::kUnexpectedInitialMapForArrayFunction, at,
-              Operand(zero_reg));
-    __ GetObjectType(t0, t0, t1);
-    __ Assert(eq, AbortReason::kUnexpectedInitialMapForArrayFunction, t1,
-              Operand(MAP_TYPE));
-
-    // We should either have undefined in a2 or a valid AllocationSite
-    __ AssertUndefinedOrAllocationSite(a2, t0);
-  }
-
-  // Enter the context of the Array function.
-  __ lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset));
-
-  Label subclassing;
-  __ Branch(&subclassing, ne, a1, Operand(a3));
-
-  Label no_info;
-  // Get the elements kind and case on that.
-  __ LoadRoot(at, Heap::kUndefinedValueRootIndex);
-  __ Branch(&no_info, eq, a2, Operand(at));
-
-  __ lw(a3, FieldMemOperand(
-                a2, AllocationSite::kTransitionInfoOrBoilerplateOffset));
-  __ SmiUntag(a3);
-  STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
-  __ And(a3, a3, Operand(AllocationSite::ElementsKindBits::kMask));
-  GenerateDispatchToArrayStub(masm, DONT_OVERRIDE);
-
-  __ bind(&no_info);
-  GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES);
-
-  // Subclassing.
-  __ bind(&subclassing);
-  __ Lsa(at, sp, a0, kPointerSizeLog2);
-  __ sw(a1, MemOperand(at));
-  __ li(at, Operand(3));
-  __ addu(a0, a0, at);
-  __ Push(a3, a2);
-  __ JumpToExternalReference(ExternalReference(Runtime::kNewArray, isolate()));
-}
-
-
-void InternalArrayConstructorStub::GenerateCase(
-    MacroAssembler* masm, ElementsKind kind) {
-
-  InternalArrayNoArgumentConstructorStub stub0(isolate(), kind);
-  __ TailCallStub(&stub0, lo, a0, Operand(1));
-
-  ArrayNArgumentsConstructorStub stubN(isolate());
-  __ TailCallStub(&stubN, hi, a0, Operand(1));
-
-  if (IsFastPackedElementsKind(kind)) {
-    // We might need to create a holey array
-    // look at the first argument.
-    __ lw(at, MemOperand(sp, 0));
-
-    InternalArraySingleArgumentConstructorStub
-        stub1_holey(isolate(), GetHoleyElementsKind(kind));
-    __ TailCallStub(&stub1_holey, ne, at, Operand(zero_reg));
-  }
-
-  InternalArraySingleArgumentConstructorStub stub1(isolate(), kind);
-  __ TailCallStub(&stub1);
-}
-
-
-void InternalArrayConstructorStub::Generate(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- a0 : argc
-  //  -- a1 : constructor
-  //  -- sp[0] : return address
-  //  -- sp[4] : last argument
-  // -----------------------------------
-
-  if (FLAG_debug_code) {
-    // The array construct code is only set for the global and natives
-    // builtin Array functions which always have maps.
-
-    // Initial map for the builtin Array function should be a map.
-    __ lw(a3, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset));
-    // Will both indicate a nullptr and a Smi.
-    __ SmiTst(a3, at);
-    __ Assert(ne, AbortReason::kUnexpectedInitialMapForArrayFunction, at,
-              Operand(zero_reg));
-    __ GetObjectType(a3, a3, t0);
-    __ Assert(eq, AbortReason::kUnexpectedInitialMapForArrayFunction, t0,
-              Operand(MAP_TYPE));
-  }
-
-  // Figure out the right elements kind.
-  __ lw(a3, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset));
-
-  // Load the map's "bit field 2" into a3. We only need the first byte,
-  // but the following bit field extraction takes care of that anyway.
-  __ lbu(a3, FieldMemOperand(a3, Map::kBitField2Offset));
-  // Retrieve elements_kind from bit field 2.
-  __ DecodeField<Map::ElementsKindBits>(a3);
-
-  if (FLAG_debug_code) {
-    Label done;
-    __ Branch(&done, eq, a3, Operand(PACKED_ELEMENTS));
-    __ Assert(
-        eq,
-        AbortReason::kInvalidElementsKindForInternalArrayOrInternalPackedArray,
-        a3, Operand(HOLEY_ELEMENTS));
-    __ bind(&done);
-  }
-
-  Label fast_elements_case;
-  __ Branch(&fast_elements_case, eq, a3, Operand(PACKED_ELEMENTS));
-  GenerateCase(masm, HOLEY_ELEMENTS);
-
-  __ bind(&fast_elements_case);
-  GenerateCase(masm, PACKED_ELEMENTS);
-}
-
-static int AddressOffset(ExternalReference ref0, ExternalReference ref1) {
-  return ref0.address() - ref1.address();
-}
-
-
-// Calls an API function.  Allocates HandleScope, extracts returned value
-// from handle and propagates exceptions.  Restores context.  stack_space
-// - space to be unwound on exit (includes the call JS arguments space and
-// the additional space allocated for the fast call).
-static void CallApiFunctionAndReturn(MacroAssembler* masm,
-                                     Register function_address,
-                                     ExternalReference thunk_ref,
-                                     int stack_space,
-                                     int32_t stack_space_offset,
-                                     MemOperand return_value_operand) {
-  Isolate* isolate = masm->isolate();
-  ExternalReference next_address =
-      ExternalReference::handle_scope_next_address(isolate);
-  const int kNextOffset = 0;
-  const int kLimitOffset = AddressOffset(
-      ExternalReference::handle_scope_limit_address(isolate), next_address);
-  const int kLevelOffset = AddressOffset(
-      ExternalReference::handle_scope_level_address(isolate), next_address);
-
-  DCHECK(function_address == a1 || function_address == a2);
-
-  Label profiler_disabled;
-  Label end_profiler_check;
-  __ li(t9, Operand(ExternalReference::is_profiling_address(isolate)));
-  __ lb(t9, MemOperand(t9, 0));
-  __ Branch(&profiler_disabled, eq, t9, Operand(zero_reg));
-
-  // Additional parameter is the address of the actual callback.
-  __ li(t9, Operand(thunk_ref));
-  __ jmp(&end_profiler_check);
-
-  __ bind(&profiler_disabled);
-  __ mov(t9, function_address);
-  __ bind(&end_profiler_check);
-
-  // Allocate HandleScope in callee-save registers.
-  __ li(s3, Operand(next_address));
-  __ lw(s0, MemOperand(s3, kNextOffset));
-  __ lw(s1, MemOperand(s3, kLimitOffset));
-  __ lw(s2, MemOperand(s3, kLevelOffset));
-  __ Addu(s2, s2, Operand(1));
-  __ sw(s2, MemOperand(s3, kLevelOffset));
-
-  if (FLAG_log_timer_events) {
-    FrameScope frame(masm, StackFrame::MANUAL);
-    __ PushSafepointRegisters();
-    __ PrepareCallCFunction(1, a0);
-    __ li(a0, Operand(ExternalReference::isolate_address(isolate)));
-    __ CallCFunction(ExternalReference::log_enter_external_function(isolate),
-                     1);
-    __ PopSafepointRegisters();
-  }
-
-  // Native call returns to the DirectCEntry stub which redirects to the
-  // return address pushed on stack (could have moved after GC).
-  // DirectCEntry stub itself is generated early and never moves.
-  DirectCEntryStub stub(isolate);
-  stub.GenerateCall(masm, t9);
-
-  if (FLAG_log_timer_events) {
-    FrameScope frame(masm, StackFrame::MANUAL);
-    __ PushSafepointRegisters();
-    __ PrepareCallCFunction(1, a0);
-    __ li(a0, Operand(ExternalReference::isolate_address(isolate)));
-    __ CallCFunction(ExternalReference::log_leave_external_function(isolate),
-                     1);
-    __ PopSafepointRegisters();
-  }
-
-  Label promote_scheduled_exception;
-  Label delete_allocated_handles;
-  Label leave_exit_frame;
-  Label return_value_loaded;
-
-  // Load value from ReturnValue.
-  __ lw(v0, return_value_operand);
-  __ bind(&return_value_loaded);
-
-  // No more valid handles (the result handle was the last one). Restore
-  // previous handle scope.
-  __ sw(s0, MemOperand(s3, kNextOffset));
-  if (__ emit_debug_code()) {
-    __ lw(a1, MemOperand(s3, kLevelOffset));
-    __ Check(eq, AbortReason::kUnexpectedLevelAfterReturnFromApiCall, a1,
-             Operand(s2));
-  }
-  __ Subu(s2, s2, Operand(1));
-  __ sw(s2, MemOperand(s3, kLevelOffset));
-  __ lw(at, MemOperand(s3, kLimitOffset));
-  __ Branch(&delete_allocated_handles, ne, s1, Operand(at));
-
-  // Leave the API exit frame.
-  __ bind(&leave_exit_frame);
-
-  if (stack_space_offset != kInvalidStackOffset) {
-    // ExitFrame contains four MIPS argument slots after DirectCEntryStub call
-    // so this must be accounted for.
-    __ lw(s0, MemOperand(sp, stack_space_offset + kCArgsSlotsSize));
-  } else {
-    __ li(s0, Operand(stack_space));
-  }
-  __ LeaveExitFrame(false, s0, NO_EMIT_RETURN,
-                    stack_space_offset != kInvalidStackOffset);
-
-  // Check if the function scheduled an exception.
-  __ LoadRoot(t0, Heap::kTheHoleValueRootIndex);
-  __ li(at, Operand(ExternalReference::scheduled_exception_address(isolate)));
-  __ lw(t1, MemOperand(at));
-  __ Branch(&promote_scheduled_exception, ne, t0, Operand(t1));
-
-  __ Ret();
-
-  // Re-throw by promoting a scheduled exception.
-  __ bind(&promote_scheduled_exception);
-  __ TailCallRuntime(Runtime::kPromoteScheduledException);
-
-  // HandleScope limit has changed. Delete allocated extensions.
-  __ bind(&delete_allocated_handles);
-  __ sw(s1, MemOperand(s3, kLimitOffset));
-  __ mov(s0, v0);
-  __ mov(a0, v0);
-  __ PrepareCallCFunction(1, s1);
-  __ li(a0, Operand(ExternalReference::isolate_address(isolate)));
-  __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate),
-                   1);
-  __ mov(v0, s0);
-  __ jmp(&leave_exit_frame);
-}
-
-void CallApiCallbackStub::Generate(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- t0                  : call_data
-  //  -- a2                  : holder
-  //  -- a1                  : api_function_address
-  //  -- cp                  : context
-  //  --
-  //  -- sp[0]               : last argument
-  //  -- ...
-  //  -- sp[(argc - 1)* 4]   : first argument
-  //  -- sp[argc * 4]        : receiver
-  // -----------------------------------
-
-  Register call_data = t0;
-  Register holder = a2;
-  Register api_function_address = a1;
-
-  typedef FunctionCallbackArguments FCA;
-
-  STATIC_ASSERT(FCA::kArgsLength == 6);
-  STATIC_ASSERT(FCA::kNewTargetIndex == 5);
-  STATIC_ASSERT(FCA::kDataIndex == 4);
-  STATIC_ASSERT(FCA::kReturnValueOffset == 3);
-  STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2);
-  STATIC_ASSERT(FCA::kIsolateIndex == 1);
-  STATIC_ASSERT(FCA::kHolderIndex == 0);
-
-  // new target
-  __ PushRoot(Heap::kUndefinedValueRootIndex);
-
-  // call data.
-  __ Push(call_data);
-
-  Register scratch = call_data;
-  __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex);
-  // Push return value and default return value.
-  __ Push(scratch, scratch);
-  __ li(scratch, Operand(ExternalReference::isolate_address(masm->isolate())));
-  // Push isolate and holder.
-  __ Push(scratch, holder);
-
-  // Prepare arguments.
-  __ mov(scratch, sp);
-
-  // Allocate the v8::Arguments structure in the arguments' space since
-  // it's not controlled by GC.
-  const int kApiStackSpace = 3;
-
-  FrameScope frame_scope(masm, StackFrame::MANUAL);
-  __ EnterExitFrame(false, kApiStackSpace);
-
-  DCHECK(api_function_address != a0 && scratch != a0);
-  // a0 = FunctionCallbackInfo&
-  // Arguments is after the return address.
-  __ Addu(a0, sp, Operand(1 * kPointerSize));
-  // FunctionCallbackInfo::implicit_args_
-  __ sw(scratch, MemOperand(a0, 0 * kPointerSize));
-  // FunctionCallbackInfo::values_
-  __ Addu(at, scratch, Operand((FCA::kArgsLength - 1 + argc()) * kPointerSize));
-  __ sw(at, MemOperand(a0, 1 * kPointerSize));
-  // FunctionCallbackInfo::length_ = argc
-  __ li(at, Operand(argc()));
-  __ sw(at, MemOperand(a0, 2 * kPointerSize));
-
-  ExternalReference thunk_ref =
-      ExternalReference::invoke_function_callback(masm->isolate());
-
-  AllowExternalCallThatCantCauseGC scope(masm);
-  // Stores return the first js argument.
-  int return_value_offset = 2 + FCA::kReturnValueOffset;
-  MemOperand return_value_operand(fp, return_value_offset * kPointerSize);
-  const int stack_space = argc() + FCA::kArgsLength + 1;
-  // TODO(adamk): Why are we clobbering this immediately?
-  const int32_t stack_space_offset = kInvalidStackOffset;
-  CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space,
-                           stack_space_offset, return_value_operand);
-}
-
-
-void CallApiGetterStub::Generate(MacroAssembler* masm) {
-  // Build v8::PropertyCallbackInfo::args_ array on the stack and push property
-  // name below the exit frame to make GC aware of them.
-  STATIC_ASSERT(PropertyCallbackArguments::kShouldThrowOnErrorIndex == 0);
-  STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 1);
-  STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 2);
-  STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 3);
-  STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 4);
-  STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 5);
-  STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 6);
-  STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 7);
-
-  Register receiver = ApiGetterDescriptor::ReceiverRegister();
-  Register holder = ApiGetterDescriptor::HolderRegister();
-  Register callback = ApiGetterDescriptor::CallbackRegister();
-  Register scratch = t0;
-  DCHECK(!AreAliased(receiver, holder, callback, scratch));
-
-  Register api_function_address = a2;
-
-  // Here and below +1 is for name() pushed after the args_ array.
-  typedef PropertyCallbackArguments PCA;
-  __ Subu(sp, sp, (PCA::kArgsLength + 1) * kPointerSize);
-  __ sw(receiver, MemOperand(sp, (PCA::kThisIndex + 1) * kPointerSize));
-  __ lw(scratch, FieldMemOperand(callback, AccessorInfo::kDataOffset));
-  __ sw(scratch, MemOperand(sp, (PCA::kDataIndex + 1) * kPointerSize));
-  __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex);
-  __ sw(scratch, MemOperand(sp, (PCA::kReturnValueOffset + 1) * kPointerSize));
-  __ sw(scratch, MemOperand(sp, (PCA::kReturnValueDefaultValueIndex + 1) *
-                                    kPointerSize));
-  __ li(scratch, Operand(ExternalReference::isolate_address(isolate())));
-  __ sw(scratch, MemOperand(sp, (PCA::kIsolateIndex + 1) * kPointerSize));
-  __ sw(holder, MemOperand(sp, (PCA::kHolderIndex + 1) * kPointerSize));
-  // should_throw_on_error -> false
-  DCHECK_NULL(Smi::kZero);
-  __ sw(zero_reg,
-        MemOperand(sp, (PCA::kShouldThrowOnErrorIndex + 1) * kPointerSize));
-  __ lw(scratch, FieldMemOperand(callback, AccessorInfo::kNameOffset));
-  __ sw(scratch, MemOperand(sp, 0 * kPointerSize));
-
-  // v8::PropertyCallbackInfo::args_ array and name handle.
-  const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1;
-
-  // Load address of v8::PropertyAccessorInfo::args_ array and name handle.
-  __ mov(a0, sp);                              // a0 = Handle<Name>
-  __ Addu(a1, a0, Operand(1 * kPointerSize));  // a1 = v8::PCI::args_
-
-  const int kApiStackSpace = 1;
-  FrameScope frame_scope(masm, StackFrame::MANUAL);
-  __ EnterExitFrame(false, kApiStackSpace);
-
-  // Create v8::PropertyCallbackInfo object on the stack and initialize
-  // it's args_ field.
-  __ sw(a1, MemOperand(sp, 1 * kPointerSize));
-  __ Addu(a1, sp, Operand(1 * kPointerSize));  // a1 = v8::PropertyCallbackInfo&
-
-  ExternalReference thunk_ref =
-      ExternalReference::invoke_accessor_getter_callback(isolate());
-
-  __ lw(scratch, FieldMemOperand(callback, AccessorInfo::kJsGetterOffset));
-  __ lw(api_function_address,
-        FieldMemOperand(scratch, Foreign::kForeignAddressOffset));
-
-  // +3 is to skip prolog, return address and name handle.
-  MemOperand return_value_operand(
-      fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize);
-  CallApiFunctionAndReturn(masm, api_function_address, thunk_ref,
-                           kStackUnwindSpace, kInvalidStackOffset,
-                           return_value_operand);
-}
-
-#undef __
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_MIPS
diff --git a/src/v8/src/mips/code-stubs-mips.h b/src/v8/src/mips/code-stubs-mips.h
deleted file mode 100644
index 95a253c..0000000
--- a/src/v8/src/mips/code-stubs-mips.h
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_MIPS_CODE_STUBS_MIPS_H_
-#define V8_MIPS_CODE_STUBS_MIPS_H_
-
-namespace v8 {
-namespace internal {
-
-// Trampoline stub to call into native code. To call safely into native code
-// in the presence of compacting GC (which can move code objects) we need to
-// keep the code which called into native pinned in the memory. Currently the
-// simplest approach is to generate such stub early enough so it can never be
-// moved by GC
-class DirectCEntryStub: public PlatformCodeStub {
- public:
-  explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {}
-  void GenerateCall(MacroAssembler* masm, Register target);
-
- private:
-  Movability NeedsImmovableCode() override { return kImmovable; }
-
-  DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR();
-  DEFINE_PLATFORM_CODE_STUB(DirectCEntry, PlatformCodeStub);
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_MIPS_CODE_STUBS_MIPS_H_
diff --git a/src/v8/src/mips/codegen-mips.cc b/src/v8/src/mips/codegen-mips.cc
deleted file mode 100644
index c07422f..0000000
--- a/src/v8/src/mips/codegen-mips.cc
+++ /dev/null
@@ -1,584 +0,0 @@
-// Copyright 2012 the V8 project 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 V8_TARGET_ARCH_MIPS
-
-#include <memory>
-
-#include "src/codegen.h"
-#include "src/macro-assembler.h"
-#include "src/mips/simulator-mips.h"
-
-namespace v8 {
-namespace internal {
-
-#define __ masm.
-
-#if defined(V8_HOST_ARCH_MIPS)
-
-MemCopyUint8Function CreateMemCopyUint8Function(Isolate* isolate,
-                                                MemCopyUint8Function stub) {
-#if defined(USE_SIMULATOR) || defined(_MIPS_ARCH_MIPS32R6) || \
-    defined(_MIPS_ARCH_MIPS32RX)
-  return stub;
-#else
-  size_t allocated = 0;
-  byte* buffer = AllocatePage(isolate->heap()->GetRandomMmapAddr(), &allocated);
-  if (buffer == nullptr) return nullptr;
-
-  MacroAssembler masm(isolate, buffer, static_cast<int>(allocated),
-                      CodeObjectRequired::kNo);
-
-  // This code assumes that cache lines are 32 bytes and if the cache line is
-  // larger it will not work correctly.
-  {
-    Label lastb, unaligned, aligned, chkw,
-          loop16w, chk1w, wordCopy_loop, skip_pref, lastbloop,
-          leave, ua_chk16w, ua_loop16w, ua_skip_pref, ua_chkw,
-          ua_chk1w, ua_wordCopy_loop, ua_smallCopy, ua_smallCopy_loop;
-
-    // The size of each prefetch.
-    uint32_t pref_chunk = 32;
-    // The maximum size of a prefetch, it must not be less than pref_chunk.
-    // If the real size of a prefetch is greater than max_pref_size and
-    // the kPrefHintPrepareForStore hint is used, the code will not work
-    // correctly.
-    uint32_t max_pref_size = 128;
-    DCHECK(pref_chunk < max_pref_size);
-
-    // pref_limit is set based on the fact that we never use an offset
-    // greater then 5 on a store pref and that a single pref can
-    // never be larger then max_pref_size.
-    uint32_t pref_limit = (5 * pref_chunk) + max_pref_size;
-    int32_t pref_hint_load = kPrefHintLoadStreamed;
-    int32_t pref_hint_store = kPrefHintPrepareForStore;
-    uint32_t loadstore_chunk = 4;
-
-    // The initial prefetches may fetch bytes that are before the buffer being
-    // copied. Start copies with an offset of 4 so avoid this situation when
-    // using kPrefHintPrepareForStore.
-    DCHECK(pref_hint_store != kPrefHintPrepareForStore ||
-           pref_chunk * 4 >= max_pref_size);
-
-    // If the size is less than 8, go to lastb. Regardless of size,
-    // copy dst pointer to v0 for the retuen value.
-    __ slti(t2, a2, 2 * loadstore_chunk);
-    __ bne(t2, zero_reg, &lastb);
-    __ mov(v0, a0);  // In delay slot.
-
-    // If src and dst have different alignments, go to unaligned, if they
-    // have the same alignment (but are not actually aligned) do a partial
-    // load/store to make them aligned. If they are both already aligned
-    // we can start copying at aligned.
-    __ xor_(t8, a1, a0);
-    __ andi(t8, t8, loadstore_chunk - 1);  // t8 is a0/a1 word-displacement.
-    __ bne(t8, zero_reg, &unaligned);
-    __ subu(a3, zero_reg, a0);  // In delay slot.
-
-    __ andi(a3, a3, loadstore_chunk - 1);  // Copy a3 bytes to align a0/a1.
-    __ beq(a3, zero_reg, &aligned);  // Already aligned.
-    __ subu(a2, a2, a3);  // In delay slot. a2 is the remining bytes count.
-
-    if (kArchEndian == kLittle) {
-      __ lwr(t8, MemOperand(a1));
-      __ addu(a1, a1, a3);
-      __ swr(t8, MemOperand(a0));
-      __ addu(a0, a0, a3);
-    } else {
-      __ lwl(t8, MemOperand(a1));
-      __ addu(a1, a1, a3);
-      __ swl(t8, MemOperand(a0));
-      __ addu(a0, a0, a3);
-    }
-    // Now dst/src are both aligned to (word) aligned addresses. Set a2 to
-    // count how many bytes we have to copy after all the 64 byte chunks are
-    // copied and a3 to the dst pointer after all the 64 byte chunks have been
-    // copied. We will loop, incrementing a0 and a1 until a0 equals a3.
-    __ bind(&aligned);
-    __ andi(t8, a2, 0x3F);
-    __ beq(a2, t8, &chkw);  // Less than 64?
-    __ subu(a3, a2, t8);  // In delay slot.
-    __ addu(a3, a0, a3);  // Now a3 is the final dst after loop.
-
-    // When in the loop we prefetch with kPrefHintPrepareForStore hint,
-    // in this case the a0+x should be past the "t0-32" address. This means:
-    // for x=128 the last "safe" a0 address is "t0-160". Alternatively, for
-    // x=64 the last "safe" a0 address is "t0-96". In the current version we
-    // will use "pref hint, 128(a0)", so "t0-160" is the limit.
-    if (pref_hint_store == kPrefHintPrepareForStore) {
-      __ addu(t0, a0, a2);  // t0 is the "past the end" address.
-      __ Subu(t9, t0, pref_limit);  // t9 is the "last safe pref" address.
-    }
-
-    __ Pref(pref_hint_load, MemOperand(a1, 0 * pref_chunk));
-    __ Pref(pref_hint_load, MemOperand(a1, 1 * pref_chunk));
-    __ Pref(pref_hint_load, MemOperand(a1, 2 * pref_chunk));
-    __ Pref(pref_hint_load, MemOperand(a1, 3 * pref_chunk));
-
-    if (pref_hint_store != kPrefHintPrepareForStore) {
-      __ Pref(pref_hint_store, MemOperand(a0, 1 * pref_chunk));
-      __ Pref(pref_hint_store, MemOperand(a0, 2 * pref_chunk));
-      __ Pref(pref_hint_store, MemOperand(a0, 3 * pref_chunk));
-    }
-    __ bind(&loop16w);
-    __ lw(t0, MemOperand(a1));
-
-    if (pref_hint_store == kPrefHintPrepareForStore) {
-      __ sltu(v1, t9, a0);  // If a0 > t9, don't use next prefetch.
-      __ Branch(USE_DELAY_SLOT, &skip_pref, gt, v1, Operand(zero_reg));
-    }
-    __ lw(t1, MemOperand(a1, 1, loadstore_chunk));  // Maybe in delay slot.
-
-    __ Pref(pref_hint_store, MemOperand(a0, 4 * pref_chunk));
-    __ Pref(pref_hint_store, MemOperand(a0, 5 * pref_chunk));
-
-    __ bind(&skip_pref);
-    __ lw(t2, MemOperand(a1, 2, loadstore_chunk));
-    __ lw(t3, MemOperand(a1, 3, loadstore_chunk));
-    __ lw(t4, MemOperand(a1, 4, loadstore_chunk));
-    __ lw(t5, MemOperand(a1, 5, loadstore_chunk));
-    __ lw(t6, MemOperand(a1, 6, loadstore_chunk));
-    __ lw(t7, MemOperand(a1, 7, loadstore_chunk));
-    __ Pref(pref_hint_load, MemOperand(a1, 4 * pref_chunk));
-
-    __ sw(t0, MemOperand(a0));
-    __ sw(t1, MemOperand(a0, 1, loadstore_chunk));
-    __ sw(t2, MemOperand(a0, 2, loadstore_chunk));
-    __ sw(t3, MemOperand(a0, 3, loadstore_chunk));
-    __ sw(t4, MemOperand(a0, 4, loadstore_chunk));
-    __ sw(t5, MemOperand(a0, 5, loadstore_chunk));
-    __ sw(t6, MemOperand(a0, 6, loadstore_chunk));
-    __ sw(t7, MemOperand(a0, 7, loadstore_chunk));
-
-    __ lw(t0, MemOperand(a1, 8, loadstore_chunk));
-    __ lw(t1, MemOperand(a1, 9, loadstore_chunk));
-    __ lw(t2, MemOperand(a1, 10, loadstore_chunk));
-    __ lw(t3, MemOperand(a1, 11, loadstore_chunk));
-    __ lw(t4, MemOperand(a1, 12, loadstore_chunk));
-    __ lw(t5, MemOperand(a1, 13, loadstore_chunk));
-    __ lw(t6, MemOperand(a1, 14, loadstore_chunk));
-    __ lw(t7, MemOperand(a1, 15, loadstore_chunk));
-    __ Pref(pref_hint_load, MemOperand(a1, 5 * pref_chunk));
-
-    __ sw(t0, MemOperand(a0, 8, loadstore_chunk));
-    __ sw(t1, MemOperand(a0, 9, loadstore_chunk));
-    __ sw(t2, MemOperand(a0, 10, loadstore_chunk));
-    __ sw(t3, MemOperand(a0, 11, loadstore_chunk));
-    __ sw(t4, MemOperand(a0, 12, loadstore_chunk));
-    __ sw(t5, MemOperand(a0, 13, loadstore_chunk));
-    __ sw(t6, MemOperand(a0, 14, loadstore_chunk));
-    __ sw(t7, MemOperand(a0, 15, loadstore_chunk));
-    __ addiu(a0, a0, 16 * loadstore_chunk);
-    __ bne(a0, a3, &loop16w);
-    __ addiu(a1, a1, 16 * loadstore_chunk);  // In delay slot.
-    __ mov(a2, t8);
-
-    // Here we have src and dest word-aligned but less than 64-bytes to go.
-    // Check for a 32 bytes chunk and copy if there is one. Otherwise jump
-    // down to chk1w to handle the tail end of the copy.
-    __ bind(&chkw);
-    __ Pref(pref_hint_load, MemOperand(a1, 0 * pref_chunk));
-    __ andi(t8, a2, 0x1F);
-    __ beq(a2, t8, &chk1w);  // Less than 32?
-    __ nop();  // In delay slot.
-    __ lw(t0, MemOperand(a1));
-    __ lw(t1, MemOperand(a1, 1, loadstore_chunk));
-    __ lw(t2, MemOperand(a1, 2, loadstore_chunk));
-    __ lw(t3, MemOperand(a1, 3, loadstore_chunk));
-    __ lw(t4, MemOperand(a1, 4, loadstore_chunk));
-    __ lw(t5, MemOperand(a1, 5, loadstore_chunk));
-    __ lw(t6, MemOperand(a1, 6, loadstore_chunk));
-    __ lw(t7, MemOperand(a1, 7, loadstore_chunk));
-    __ addiu(a1, a1, 8 * loadstore_chunk);
-    __ sw(t0, MemOperand(a0));
-    __ sw(t1, MemOperand(a0, 1, loadstore_chunk));
-    __ sw(t2, MemOperand(a0, 2, loadstore_chunk));
-    __ sw(t3, MemOperand(a0, 3, loadstore_chunk));
-    __ sw(t4, MemOperand(a0, 4, loadstore_chunk));
-    __ sw(t5, MemOperand(a0, 5, loadstore_chunk));
-    __ sw(t6, MemOperand(a0, 6, loadstore_chunk));
-    __ sw(t7, MemOperand(a0, 7, loadstore_chunk));
-    __ addiu(a0, a0, 8 * loadstore_chunk);
-
-    // Here we have less than 32 bytes to copy. Set up for a loop to copy
-    // one word at a time. Set a2 to count how many bytes we have to copy
-    // after all the word chunks are copied and a3 to the dst pointer after
-    // all the word chunks have been copied. We will loop, incrementing a0
-    // and a1 until a0 equals a3.
-    __ bind(&chk1w);
-    __ andi(a2, t8, loadstore_chunk - 1);
-    __ beq(a2, t8, &lastb);
-    __ subu(a3, t8, a2);  // In delay slot.
-    __ addu(a3, a0, a3);
-
-    __ bind(&wordCopy_loop);
-    __ lw(t3, MemOperand(a1));
-    __ addiu(a0, a0, loadstore_chunk);
-    __ addiu(a1, a1, loadstore_chunk);
-    __ bne(a0, a3, &wordCopy_loop);
-    __ sw(t3, MemOperand(a0, -1, loadstore_chunk));  // In delay slot.
-
-    __ bind(&lastb);
-    __ Branch(&leave, le, a2, Operand(zero_reg));
-    __ addu(a3, a0, a2);
-
-    __ bind(&lastbloop);
-    __ lb(v1, MemOperand(a1));
-    __ addiu(a0, a0, 1);
-    __ addiu(a1, a1, 1);
-    __ bne(a0, a3, &lastbloop);
-    __ sb(v1, MemOperand(a0, -1));  // In delay slot.
-
-    __ bind(&leave);
-    __ jr(ra);
-    __ nop();
-
-    // Unaligned case. Only the dst gets aligned so we need to do partial
-    // loads of the source followed by normal stores to the dst (once we
-    // have aligned the destination).
-    __ bind(&unaligned);
-    __ andi(a3, a3, loadstore_chunk - 1);  // Copy a3 bytes to align a0/a1.
-    __ beq(a3, zero_reg, &ua_chk16w);
-    __ subu(a2, a2, a3);  // In delay slot.
-
-    if (kArchEndian == kLittle) {
-      __ lwr(v1, MemOperand(a1));
-      __ lwl(v1,
-             MemOperand(a1, 1, loadstore_chunk, MemOperand::offset_minus_one));
-      __ addu(a1, a1, a3);
-      __ swr(v1, MemOperand(a0));
-      __ addu(a0, a0, a3);
-    } else {
-      __ lwl(v1, MemOperand(a1));
-      __ lwr(v1,
-             MemOperand(a1, 1, loadstore_chunk, MemOperand::offset_minus_one));
-      __ addu(a1, a1, a3);
-      __ swl(v1, MemOperand(a0));
-      __ addu(a0, a0, a3);
-    }
-
-    // Now the dst (but not the source) is aligned. Set a2 to count how many
-    // bytes we have to copy after all the 64 byte chunks are copied and a3 to
-    // the dst pointer after all the 64 byte chunks have been copied. We will
-    // loop, incrementing a0 and a1 until a0 equals a3.
-    __ bind(&ua_chk16w);
-    __ andi(t8, a2, 0x3F);
-    __ beq(a2, t8, &ua_chkw);
-    __ subu(a3, a2, t8);  // In delay slot.
-    __ addu(a3, a0, a3);
-
-    if (pref_hint_store == kPrefHintPrepareForStore) {
-      __ addu(t0, a0, a2);
-      __ Subu(t9, t0, pref_limit);
-    }
-
-    __ Pref(pref_hint_load, MemOperand(a1, 0 * pref_chunk));
-    __ Pref(pref_hint_load, MemOperand(a1, 1 * pref_chunk));
-    __ Pref(pref_hint_load, MemOperand(a1, 2 * pref_chunk));
-
-    if (pref_hint_store != kPrefHintPrepareForStore) {
-      __ Pref(pref_hint_store, MemOperand(a0, 1 * pref_chunk));
-      __ Pref(pref_hint_store, MemOperand(a0, 2 * pref_chunk));
-      __ Pref(pref_hint_store, MemOperand(a0, 3 * pref_chunk));
-    }
-
-    __ bind(&ua_loop16w);
-    __ Pref(pref_hint_load, MemOperand(a1, 3 * pref_chunk));
-    if (kArchEndian == kLittle) {
-      __ lwr(t0, MemOperand(a1));
-      __ lwr(t1, MemOperand(a1, 1, loadstore_chunk));
-      __ lwr(t2, MemOperand(a1, 2, loadstore_chunk));
-
-      if (pref_hint_store == kPrefHintPrepareForStore) {
-        __ sltu(v1, t9, a0);
-        __ Branch(USE_DELAY_SLOT, &ua_skip_pref, gt, v1, Operand(zero_reg));
-      }
-      __ lwr(t3, MemOperand(a1, 3, loadstore_chunk));  // Maybe in delay slot.
-
-      __ Pref(pref_hint_store, MemOperand(a0, 4 * pref_chunk));
-      __ Pref(pref_hint_store, MemOperand(a0, 5 * pref_chunk));
-
-      __ bind(&ua_skip_pref);
-      __ lwr(t4, MemOperand(a1, 4, loadstore_chunk));
-      __ lwr(t5, MemOperand(a1, 5, loadstore_chunk));
-      __ lwr(t6, MemOperand(a1, 6, loadstore_chunk));
-      __ lwr(t7, MemOperand(a1, 7, loadstore_chunk));
-      __ lwl(t0,
-             MemOperand(a1, 1, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t1,
-             MemOperand(a1, 2, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t2,
-             MemOperand(a1, 3, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t3,
-             MemOperand(a1, 4, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t4,
-             MemOperand(a1, 5, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t5,
-             MemOperand(a1, 6, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t6,
-             MemOperand(a1, 7, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t7,
-             MemOperand(a1, 8, loadstore_chunk, MemOperand::offset_minus_one));
-    } else {
-      __ lwl(t0, MemOperand(a1));
-      __ lwl(t1, MemOperand(a1, 1, loadstore_chunk));
-      __ lwl(t2, MemOperand(a1, 2, loadstore_chunk));
-
-      if (pref_hint_store == kPrefHintPrepareForStore) {
-        __ sltu(v1, t9, a0);
-        __ Branch(USE_DELAY_SLOT, &ua_skip_pref, gt, v1, Operand(zero_reg));
-      }
-      __ lwl(t3, MemOperand(a1, 3, loadstore_chunk));  // Maybe in delay slot.
-
-      __ Pref(pref_hint_store, MemOperand(a0, 4 * pref_chunk));
-      __ Pref(pref_hint_store, MemOperand(a0, 5 * pref_chunk));
-
-      __ bind(&ua_skip_pref);
-      __ lwl(t4, MemOperand(a1, 4, loadstore_chunk));
-      __ lwl(t5, MemOperand(a1, 5, loadstore_chunk));
-      __ lwl(t6, MemOperand(a1, 6, loadstore_chunk));
-      __ lwl(t7, MemOperand(a1, 7, loadstore_chunk));
-      __ lwr(t0,
-             MemOperand(a1, 1, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t1,
-             MemOperand(a1, 2, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t2,
-             MemOperand(a1, 3, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t3,
-             MemOperand(a1, 4, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t4,
-             MemOperand(a1, 5, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t5,
-             MemOperand(a1, 6, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t6,
-             MemOperand(a1, 7, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t7,
-             MemOperand(a1, 8, loadstore_chunk, MemOperand::offset_minus_one));
-    }
-    __ Pref(pref_hint_load, MemOperand(a1, 4 * pref_chunk));
-    __ sw(t0, MemOperand(a0));
-    __ sw(t1, MemOperand(a0, 1, loadstore_chunk));
-    __ sw(t2, MemOperand(a0, 2, loadstore_chunk));
-    __ sw(t3, MemOperand(a0, 3, loadstore_chunk));
-    __ sw(t4, MemOperand(a0, 4, loadstore_chunk));
-    __ sw(t5, MemOperand(a0, 5, loadstore_chunk));
-    __ sw(t6, MemOperand(a0, 6, loadstore_chunk));
-    __ sw(t7, MemOperand(a0, 7, loadstore_chunk));
-    if (kArchEndian == kLittle) {
-      __ lwr(t0, MemOperand(a1, 8, loadstore_chunk));
-      __ lwr(t1, MemOperand(a1, 9, loadstore_chunk));
-      __ lwr(t2, MemOperand(a1, 10, loadstore_chunk));
-      __ lwr(t3, MemOperand(a1, 11, loadstore_chunk));
-      __ lwr(t4, MemOperand(a1, 12, loadstore_chunk));
-      __ lwr(t5, MemOperand(a1, 13, loadstore_chunk));
-      __ lwr(t6, MemOperand(a1, 14, loadstore_chunk));
-      __ lwr(t7, MemOperand(a1, 15, loadstore_chunk));
-      __ lwl(t0,
-             MemOperand(a1, 9, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t1,
-             MemOperand(a1, 10, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t2,
-             MemOperand(a1, 11, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t3,
-             MemOperand(a1, 12, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t4,
-             MemOperand(a1, 13, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t5,
-             MemOperand(a1, 14, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t6,
-             MemOperand(a1, 15, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t7,
-             MemOperand(a1, 16, loadstore_chunk, MemOperand::offset_minus_one));
-    } else {
-      __ lwl(t0, MemOperand(a1, 8, loadstore_chunk));
-      __ lwl(t1, MemOperand(a1, 9, loadstore_chunk));
-      __ lwl(t2, MemOperand(a1, 10, loadstore_chunk));
-      __ lwl(t3, MemOperand(a1, 11, loadstore_chunk));
-      __ lwl(t4, MemOperand(a1, 12, loadstore_chunk));
-      __ lwl(t5, MemOperand(a1, 13, loadstore_chunk));
-      __ lwl(t6, MemOperand(a1, 14, loadstore_chunk));
-      __ lwl(t7, MemOperand(a1, 15, loadstore_chunk));
-      __ lwr(t0,
-             MemOperand(a1, 9, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t1,
-             MemOperand(a1, 10, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t2,
-             MemOperand(a1, 11, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t3,
-             MemOperand(a1, 12, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t4,
-             MemOperand(a1, 13, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t5,
-             MemOperand(a1, 14, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t6,
-             MemOperand(a1, 15, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t7,
-             MemOperand(a1, 16, loadstore_chunk, MemOperand::offset_minus_one));
-    }
-    __ Pref(pref_hint_load, MemOperand(a1, 5 * pref_chunk));
-    __ sw(t0, MemOperand(a0, 8, loadstore_chunk));
-    __ sw(t1, MemOperand(a0, 9, loadstore_chunk));
-    __ sw(t2, MemOperand(a0, 10, loadstore_chunk));
-    __ sw(t3, MemOperand(a0, 11, loadstore_chunk));
-    __ sw(t4, MemOperand(a0, 12, loadstore_chunk));
-    __ sw(t5, MemOperand(a0, 13, loadstore_chunk));
-    __ sw(t6, MemOperand(a0, 14, loadstore_chunk));
-    __ sw(t7, MemOperand(a0, 15, loadstore_chunk));
-    __ addiu(a0, a0, 16 * loadstore_chunk);
-    __ bne(a0, a3, &ua_loop16w);
-    __ addiu(a1, a1, 16 * loadstore_chunk);  // In delay slot.
-    __ mov(a2, t8);
-
-    // Here less than 64-bytes. Check for
-    // a 32 byte chunk and copy if there is one. Otherwise jump down to
-    // ua_chk1w to handle the tail end of the copy.
-    __ bind(&ua_chkw);
-    __ Pref(pref_hint_load, MemOperand(a1));
-    __ andi(t8, a2, 0x1F);
-
-    __ beq(a2, t8, &ua_chk1w);
-    __ nop();  // In delay slot.
-    if (kArchEndian == kLittle) {
-      __ lwr(t0, MemOperand(a1));
-      __ lwr(t1, MemOperand(a1, 1, loadstore_chunk));
-      __ lwr(t2, MemOperand(a1, 2, loadstore_chunk));
-      __ lwr(t3, MemOperand(a1, 3, loadstore_chunk));
-      __ lwr(t4, MemOperand(a1, 4, loadstore_chunk));
-      __ lwr(t5, MemOperand(a1, 5, loadstore_chunk));
-      __ lwr(t6, MemOperand(a1, 6, loadstore_chunk));
-      __ lwr(t7, MemOperand(a1, 7, loadstore_chunk));
-      __ lwl(t0,
-             MemOperand(a1, 1, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t1,
-             MemOperand(a1, 2, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t2,
-             MemOperand(a1, 3, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t3,
-             MemOperand(a1, 4, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t4,
-             MemOperand(a1, 5, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t5,
-             MemOperand(a1, 6, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t6,
-             MemOperand(a1, 7, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t7,
-             MemOperand(a1, 8, loadstore_chunk, MemOperand::offset_minus_one));
-    } else {
-      __ lwl(t0, MemOperand(a1));
-      __ lwl(t1, MemOperand(a1, 1, loadstore_chunk));
-      __ lwl(t2, MemOperand(a1, 2, loadstore_chunk));
-      __ lwl(t3, MemOperand(a1, 3, loadstore_chunk));
-      __ lwl(t4, MemOperand(a1, 4, loadstore_chunk));
-      __ lwl(t5, MemOperand(a1, 5, loadstore_chunk));
-      __ lwl(t6, MemOperand(a1, 6, loadstore_chunk));
-      __ lwl(t7, MemOperand(a1, 7, loadstore_chunk));
-      __ lwr(t0,
-             MemOperand(a1, 1, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t1,
-             MemOperand(a1, 2, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t2,
-             MemOperand(a1, 3, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t3,
-             MemOperand(a1, 4, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t4,
-             MemOperand(a1, 5, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t5,
-             MemOperand(a1, 6, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t6,
-             MemOperand(a1, 7, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t7,
-             MemOperand(a1, 8, loadstore_chunk, MemOperand::offset_minus_one));
-    }
-    __ addiu(a1, a1, 8 * loadstore_chunk);
-    __ sw(t0, MemOperand(a0));
-    __ sw(t1, MemOperand(a0, 1, loadstore_chunk));
-    __ sw(t2, MemOperand(a0, 2, loadstore_chunk));
-    __ sw(t3, MemOperand(a0, 3, loadstore_chunk));
-    __ sw(t4, MemOperand(a0, 4, loadstore_chunk));
-    __ sw(t5, MemOperand(a0, 5, loadstore_chunk));
-    __ sw(t6, MemOperand(a0, 6, loadstore_chunk));
-    __ sw(t7, MemOperand(a0, 7, loadstore_chunk));
-    __ addiu(a0, a0, 8 * loadstore_chunk);
-
-    // Less than 32 bytes to copy. Set up for a loop to
-    // copy one word at a time.
-    __ bind(&ua_chk1w);
-    __ andi(a2, t8, loadstore_chunk - 1);
-    __ beq(a2, t8, &ua_smallCopy);
-    __ subu(a3, t8, a2);  // In delay slot.
-    __ addu(a3, a0, a3);
-
-    __ bind(&ua_wordCopy_loop);
-    if (kArchEndian == kLittle) {
-      __ lwr(v1, MemOperand(a1));
-      __ lwl(v1,
-             MemOperand(a1, 1, loadstore_chunk, MemOperand::offset_minus_one));
-    } else {
-      __ lwl(v1, MemOperand(a1));
-      __ lwr(v1,
-             MemOperand(a1, 1, loadstore_chunk, MemOperand::offset_minus_one));
-    }
-    __ addiu(a0, a0, loadstore_chunk);
-    __ addiu(a1, a1, loadstore_chunk);
-    __ bne(a0, a3, &ua_wordCopy_loop);
-    __ sw(v1, MemOperand(a0, -1, loadstore_chunk));  // In delay slot.
-
-    // Copy the last 8 bytes.
-    __ bind(&ua_smallCopy);
-    __ beq(a2, zero_reg, &leave);
-    __ addu(a3, a0, a2);  // In delay slot.
-
-    __ bind(&ua_smallCopy_loop);
-    __ lb(v1, MemOperand(a1));
-    __ addiu(a0, a0, 1);
-    __ addiu(a1, a1, 1);
-    __ bne(a0, a3, &ua_smallCopy_loop);
-    __ sb(v1, MemOperand(a0, -1));  // In delay slot.
-
-    __ jr(ra);
-    __ nop();
-  }
-  CodeDesc desc;
-  masm.GetCode(isolate, &desc);
-  DCHECK(!RelocInfo::RequiresRelocation(isolate, desc));
-
-  Assembler::FlushICache(isolate, buffer, allocated);
-  CHECK(SetPermissions(buffer, allocated, PageAllocator::kReadExecute));
-  return FUNCTION_CAST<MemCopyUint8Function>(buffer);
-#endif
-}
-#endif
-
-UnaryMathFunctionWithIsolate CreateSqrtFunction(Isolate* isolate) {
-#if defined(USE_SIMULATOR)
-  return nullptr;
-#else
-  size_t allocated = 0;
-  byte* buffer = AllocatePage(isolate->heap()->GetRandomMmapAddr(), &allocated);
-  if (buffer == nullptr) return nullptr;
-
-  MacroAssembler masm(isolate, buffer, static_cast<int>(allocated),
-                      CodeObjectRequired::kNo);
-
-  __ MovFromFloatParameter(f12);
-  __ sqrt_d(f0, f12);
-  __ MovToFloatResult(f0);
-  __ Ret();
-
-  CodeDesc desc;
-  masm.GetCode(isolate, &desc);
-  DCHECK(!RelocInfo::RequiresRelocation(isolate, desc));
-
-  Assembler::FlushICache(isolate, buffer, allocated);
-  CHECK(SetPermissions(buffer, allocated, PageAllocator::kReadExecute));
-  return FUNCTION_CAST<UnaryMathFunctionWithIsolate>(buffer);
-#endif
-}
-
-#undef __
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_MIPS
diff --git a/src/v8/src/mips/constants-mips.cc b/src/v8/src/mips/constants-mips.cc
deleted file mode 100644
index 1955d59..0000000
--- a/src/v8/src/mips/constants-mips.cc
+++ /dev/null
@@ -1,163 +0,0 @@
-// Copyright 2011 the V8 project 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 V8_TARGET_ARCH_MIPS
-
-#include "src/mips/constants-mips.h"
-
-namespace v8 {
-namespace internal {
-
-
-// -----------------------------------------------------------------------------
-// Registers.
-
-
-// These register names are defined in a way to match the native disassembler
-// formatting. See for example the command "objdump -d <binary file>".
-const char* Registers::names_[kNumSimuRegisters] = {
-  "zero_reg",
-  "at",
-  "v0", "v1",
-  "a0", "a1", "a2", "a3",
-  "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7",
-  "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
-  "t8", "t9",
-  "k0", "k1",
-  "gp",
-  "sp",
-  "fp",
-  "ra",
-  "LO", "HI",
-  "pc"
-};
-
-
-// List of alias names which can be used when referring to MIPS registers.
-const Registers::RegisterAlias Registers::aliases_[] = {
-    {0, "zero"},
-    {23, "cp"},
-    {30, "s8"},
-    {30, "s8_fp"},
-    {kInvalidRegister, nullptr}};
-
-const char* Registers::Name(int reg) {
-  const char* result;
-  if ((0 <= reg) && (reg < kNumSimuRegisters)) {
-    result = names_[reg];
-  } else {
-    result = "noreg";
-  }
-  return result;
-}
-
-
-int Registers::Number(const char* name) {
-  // Look through the canonical names.
-  for (int i = 0; i < kNumSimuRegisters; i++) {
-    if (strcmp(names_[i], name) == 0) {
-      return i;
-    }
-  }
-
-  // Look through the alias names.
-  int i = 0;
-  while (aliases_[i].reg != kInvalidRegister) {
-    if (strcmp(aliases_[i].name, name) == 0) {
-      return aliases_[i].reg;
-    }
-    i++;
-  }
-
-  // No register with the reguested name found.
-  return kInvalidRegister;
-}
-
-
-const char* FPURegisters::names_[kNumFPURegisters] = {
-  "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "f10", "f11",
-  "f12", "f13", "f14", "f15", "f16", "f17", "f18", "f19", "f20", "f21",
-  "f22", "f23", "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31"
-};
-
-
-// List of alias names which can be used when referring to MIPS registers.
-const FPURegisters::RegisterAlias FPURegisters::aliases_[] = {
-    {kInvalidRegister, nullptr}};
-
-const char* FPURegisters::Name(int creg) {
-  const char* result;
-  if ((0 <= creg) && (creg < kNumFPURegisters)) {
-    result = names_[creg];
-  } else {
-    result = "nocreg";
-  }
-  return result;
-}
-
-
-int FPURegisters::Number(const char* name) {
-  // Look through the canonical names.
-  for (int i = 0; i < kNumFPURegisters; i++) {
-    if (strcmp(names_[i], name) == 0) {
-      return i;
-    }
-  }
-
-  // Look through the alias names.
-  int i = 0;
-  while (aliases_[i].creg != kInvalidRegister) {
-    if (strcmp(aliases_[i].name, name) == 0) {
-      return aliases_[i].creg;
-    }
-    i++;
-  }
-
-  // No Cregister with the reguested name found.
-  return kInvalidFPURegister;
-}
-
-const char* MSARegisters::names_[kNumMSARegisters] = {
-    "w0",  "w1",  "w2",  "w3",  "w4",  "w5",  "w6",  "w7",  "w8",  "w9",  "w10",
-    "w11", "w12", "w13", "w14", "w15", "w16", "w17", "w18", "w19", "w20", "w21",
-    "w22", "w23", "w24", "w25", "w26", "w27", "w28", "w29", "w30", "w31"};
-
-const MSARegisters::RegisterAlias MSARegisters::aliases_[] = {
-    {kInvalidRegister, nullptr}};
-
-const char* MSARegisters::Name(int creg) {
-  const char* result;
-  if ((0 <= creg) && (creg < kNumMSARegisters)) {
-    result = names_[creg];
-  } else {
-    result = "nocreg";
-  }
-  return result;
-}
-
-int MSARegisters::Number(const char* name) {
-  // Look through the canonical names.
-  for (int i = 0; i < kNumMSARegisters; i++) {
-    if (strcmp(names_[i], name) == 0) {
-      return i;
-    }
-  }
-
-  // Look through the alias names.
-  int i = 0;
-  while (aliases_[i].creg != kInvalidRegister) {
-    if (strcmp(aliases_[i].name, name) == 0) {
-      return aliases_[i].creg;
-    }
-    i++;
-  }
-
-  // No Cregister with the reguested name found.
-  return kInvalidMSARegister;
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_MIPS
diff --git a/src/v8/src/mips/constants-mips.h b/src/v8/src/mips/constants-mips.h
deleted file mode 100644
index 565fcd9..0000000
--- a/src/v8/src/mips/constants-mips.h
+++ /dev/null
@@ -1,1934 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef  V8_MIPS_CONSTANTS_H_
-#define  V8_MIPS_CONSTANTS_H_
-#include "src/globals.h"
-// UNIMPLEMENTED_ macro for MIPS.
-#ifdef DEBUG
-#define UNIMPLEMENTED_MIPS()                                                  \
-  v8::internal::PrintF("%s, \tline %d: \tfunction %s not implemented. \n",    \
-                       __FILE__, __LINE__, __func__)
-#else
-#define UNIMPLEMENTED_MIPS()
-#endif
-
-#define UNSUPPORTED_MIPS() v8::internal::PrintF("Unsupported instruction.\n")
-
-enum ArchVariants {
-  kMips32r1 = v8::internal::MIPSr1,
-  kMips32r2 = v8::internal::MIPSr2,
-  kMips32r6 = v8::internal::MIPSr6,
-  kLoongson
-};
-
-#ifdef _MIPS_ARCH_MIPS32R2
-  static const ArchVariants kArchVariant = kMips32r2;
-#elif _MIPS_ARCH_MIPS32R6
-  static const ArchVariants kArchVariant = kMips32r6;
-#elif _MIPS_ARCH_LOONGSON
-// The loongson flag refers to the LOONGSON architectures based on MIPS-III,
-// which predates (and is a subset of) the mips32r2 and r1 architectures.
-  static const ArchVariants kArchVariant = kLoongson;
-#elif _MIPS_ARCH_MIPS32RX
-// This flags referred to compatibility mode that creates universal code that
-// can run on any MIPS32 architecture revision. The dynamically generated code
-// by v8 is specialized for the MIPS host detected in runtime probing.
-  static const ArchVariants kArchVariant = kMips32r1;
-#else
-  static const ArchVariants kArchVariant = kMips32r1;
-#endif
-
-enum Endianness {
-  kLittle,
-  kBig
-};
-
-#if defined(V8_TARGET_LITTLE_ENDIAN)
-  static const Endianness kArchEndian = kLittle;
-#elif defined(V8_TARGET_BIG_ENDIAN)
-  static const Endianness kArchEndian = kBig;
-#else
-#error Unknown endianness
-#endif
-
-enum FpuMode {
-  kFP32,
-  kFP64,
-  kFPXX
-};
-
-#if defined(FPU_MODE_FP32)
-  static const FpuMode kFpuMode = kFP32;
-#elif defined(FPU_MODE_FP64)
-  static const FpuMode kFpuMode = kFP64;
-#elif defined(FPU_MODE_FPXX)
-#if defined(_MIPS_ARCH_MIPS32R2) || defined(_MIPS_ARCH_MIPS32R6)
-static const FpuMode kFpuMode = kFPXX;
-#else
-#error "FPXX is supported only on Mips32R2 and Mips32R6"
-#endif
-#else
-static const FpuMode kFpuMode = kFP32;
-#endif
-
-#if(defined(__mips_hard_float) && __mips_hard_float != 0)
-// Use floating-point coprocessor instructions. This flag is raised when
-// -mhard-float is passed to the compiler.
-const bool IsMipsSoftFloatABI = false;
-#elif(defined(__mips_soft_float) && __mips_soft_float != 0)
-// This flag is raised when -msoft-float is passed to the compiler.
-// Although FPU is a base requirement for v8, soft-float ABI is used
-// on soft-float systems with FPU kernel emulation.
-const bool IsMipsSoftFloatABI = true;
-#else
-const bool IsMipsSoftFloatABI = true;
-#endif
-
-#if defined(V8_TARGET_LITTLE_ENDIAN)
-const uint32_t kHoleNanUpper32Offset = 4;
-const uint32_t kHoleNanLower32Offset = 0;
-#elif defined(V8_TARGET_BIG_ENDIAN)
-const uint32_t kHoleNanUpper32Offset = 0;
-const uint32_t kHoleNanLower32Offset = 4;
-#else
-#error Unknown endianness
-#endif
-
-#define IsFp64Mode() (kFpuMode == kFP64)
-#define IsFp32Mode() (kFpuMode == kFP32)
-#define IsFpxxMode() (kFpuMode == kFPXX)
-
-#ifndef _MIPS_ARCH_MIPS32RX
-#define IsMipsArchVariant(check) \
-  (kArchVariant == check)
-#else
-#define IsMipsArchVariant(check) \
-  (CpuFeatures::IsSupported(static_cast<CpuFeature>(check)))
-#endif
-
-#if defined(V8_TARGET_LITTLE_ENDIAN)
-const uint32_t kMipsLwrOffset = 0;
-const uint32_t kMipsLwlOffset = 3;
-const uint32_t kMipsSwrOffset = 0;
-const uint32_t kMipsSwlOffset = 3;
-#elif defined(V8_TARGET_BIG_ENDIAN)
-const uint32_t kMipsLwrOffset = 3;
-const uint32_t kMipsLwlOffset = 0;
-const uint32_t kMipsSwrOffset = 3;
-const uint32_t kMipsSwlOffset = 0;
-#else
-#error Unknown endianness
-#endif
-
-#ifndef __STDC_FORMAT_MACROS
-#define __STDC_FORMAT_MACROS
-#endif
-#include <inttypes.h>
-
-// Defines constants and accessor classes to assemble, disassemble and
-// simulate MIPS32 instructions.
-//
-// See: MIPS32 Architecture For Programmers
-//      Volume II: The MIPS32 Instruction Set
-// Try www.cs.cornell.edu/courses/cs3410/2008fa/MIPS_Vol2.pdf.
-
-namespace v8 {
-namespace internal {
-
-// -----------------------------------------------------------------------------
-// Registers and FPURegisters.
-
-// Number of general purpose registers.
-const int kNumRegisters = 32;
-const int kInvalidRegister = -1;
-
-// Number of registers with HI, LO, and pc.
-const int kNumSimuRegisters = 35;
-
-// In the simulator, the PC register is simulated as the 34th register.
-const int kPCRegister = 34;
-
-// Number coprocessor registers.
-const int kNumFPURegisters = 32;
-const int kInvalidFPURegister = -1;
-
-// Number of MSA registers
-const int kNumMSARegisters = 32;
-const int kInvalidMSARegister = -1;
-
-const int kInvalidMSAControlRegister = -1;
-const int kMSAIRRegister = 0;
-const int kMSACSRRegister = 1;
-const int kMSARegSize = 128;
-const int kMSALanesByte = kMSARegSize / 8;
-const int kMSALanesHalf = kMSARegSize / 16;
-const int kMSALanesWord = kMSARegSize / 32;
-const int kMSALanesDword = kMSARegSize / 64;
-
-// FPU (coprocessor 1) control registers. Currently only FCSR is implemented.
-const int kFCSRRegister = 31;
-const int kInvalidFPUControlRegister = -1;
-const uint32_t kFPUInvalidResult = static_cast<uint32_t>(1 << 31) - 1;
-const int32_t kFPUInvalidResultNegative = static_cast<int32_t>(1 << 31);
-const uint64_t kFPU64InvalidResult =
-    static_cast<uint64_t>(static_cast<uint64_t>(1) << 63) - 1;
-const int64_t kFPU64InvalidResultNegative =
-    static_cast<int64_t>(static_cast<uint64_t>(1) << 63);
-
-// FCSR constants.
-const uint32_t kFCSRInexactFlagBit = 2;
-const uint32_t kFCSRUnderflowFlagBit = 3;
-const uint32_t kFCSROverflowFlagBit = 4;
-const uint32_t kFCSRDivideByZeroFlagBit = 5;
-const uint32_t kFCSRInvalidOpFlagBit = 6;
-const uint32_t kFCSRNaN2008FlagBit = 18;
-
-const uint32_t kFCSRInexactFlagMask = 1 << kFCSRInexactFlagBit;
-const uint32_t kFCSRUnderflowFlagMask = 1 << kFCSRUnderflowFlagBit;
-const uint32_t kFCSROverflowFlagMask = 1 << kFCSROverflowFlagBit;
-const uint32_t kFCSRDivideByZeroFlagMask = 1 << kFCSRDivideByZeroFlagBit;
-const uint32_t kFCSRInvalidOpFlagMask = 1 << kFCSRInvalidOpFlagBit;
-const uint32_t kFCSRNaN2008FlagMask = 1 << kFCSRNaN2008FlagBit;
-
-const uint32_t kFCSRFlagMask =
-    kFCSRInexactFlagMask |
-    kFCSRUnderflowFlagMask |
-    kFCSROverflowFlagMask |
-    kFCSRDivideByZeroFlagMask |
-    kFCSRInvalidOpFlagMask;
-
-const uint32_t kFCSRExceptionFlagMask = kFCSRFlagMask ^ kFCSRInexactFlagMask;
-
-// 'pref' instruction hints
-const int32_t kPrefHintLoad = 0;
-const int32_t kPrefHintStore = 1;
-const int32_t kPrefHintLoadStreamed = 4;
-const int32_t kPrefHintStoreStreamed = 5;
-const int32_t kPrefHintLoadRetained = 6;
-const int32_t kPrefHintStoreRetained = 7;
-const int32_t kPrefHintWritebackInvalidate = 25;
-const int32_t kPrefHintPrepareForStore = 30;
-
-// Helper functions for converting between register numbers and names.
-class Registers {
- public:
-  // Return the name of the register.
-  static const char* Name(int reg);
-
-  // Lookup the register number for the name provided.
-  static int Number(const char* name);
-
-  struct RegisterAlias {
-    int reg;
-    const char* name;
-  };
-
-  static const int32_t kMaxValue = 0x7fffffff;
-  static const int32_t kMinValue = 0x80000000;
-
- private:
-  static const char* names_[kNumSimuRegisters];
-  static const RegisterAlias aliases_[];
-};
-
-// Helper functions for converting between register numbers and names.
-class FPURegisters {
- public:
-  // Return the name of the register.
-  static const char* Name(int reg);
-
-  // Lookup the register number for the name provided.
-  static int Number(const char* name);
-
-  struct RegisterAlias {
-    int creg;
-    const char* name;
-  };
-
- private:
-  static const char* names_[kNumFPURegisters];
-  static const RegisterAlias aliases_[];
-};
-
-// Helper functions for converting between register numbers and names.
-class MSARegisters {
- public:
-  // Return the name of the register.
-  static const char* Name(int reg);
-
-  // Lookup the register number for the name provided.
-  static int Number(const char* name);
-
-  struct RegisterAlias {
-    int creg;
-    const char* name;
-  };
-
- private:
-  static const char* names_[kNumMSARegisters];
-  static const RegisterAlias aliases_[];
-};
-
-// -----------------------------------------------------------------------------
-// Instructions encoding constants.
-
-// On MIPS all instructions are 32 bits.
-typedef int32_t Instr;
-
-// Special Software Interrupt codes when used in the presence of the MIPS
-// simulator.
-enum SoftwareInterruptCodes {
-  // Transition to C code.
-  call_rt_redirected = 0xfffff
-};
-
-// On MIPS Simulator breakpoints can have different codes:
-// - Breaks between 0 and kMaxWatchpointCode are treated as simple watchpoints,
-//   the simulator will run through them and print the registers.
-// - Breaks between kMaxWatchpointCode and kMaxStopCode are treated as stop()
-//   instructions (see Assembler::stop()).
-// - Breaks larger than kMaxStopCode are simple breaks, dropping you into the
-//   debugger.
-const uint32_t kMaxWatchpointCode = 31;
-const uint32_t kMaxStopCode = 127;
-STATIC_ASSERT(kMaxWatchpointCode < kMaxStopCode);
-
-
-// ----- Fields offset and length.
-const int kOpcodeShift   = 26;
-const int kOpcodeBits    = 6;
-const int kRsShift       = 21;
-const int kRsBits        = 5;
-const int kRtShift       = 16;
-const int kRtBits        = 5;
-const int kRdShift       = 11;
-const int kRdBits        = 5;
-const int kSaShift       = 6;
-const int kSaBits        = 5;
-const int kLsaSaBits = 2;
-const int kFunctionShift = 0;
-const int kFunctionBits  = 6;
-const int kLuiShift      = 16;
-const int kBp2Shift = 6;
-const int kBp2Bits = 2;
-const int kBaseShift = 21;
-const int kBaseBits = 5;
-const int kBit6Shift = 6;
-const int kBit6Bits = 1;
-
-const int kImm9Shift = 7;
-const int kImm9Bits = 9;
-const int kImm16Shift = 0;
-const int kImm16Bits  = 16;
-const int kImm18Shift = 0;
-const int kImm18Bits = 18;
-const int kImm19Shift = 0;
-const int kImm19Bits = 19;
-const int kImm21Shift = 0;
-const int kImm21Bits  = 21;
-const int kImm26Shift = 0;
-const int kImm26Bits  = 26;
-const int kImm28Shift = 0;
-const int kImm28Bits  = 28;
-const int kImm32Shift = 0;
-const int kImm32Bits  = 32;
-const int kMsaImm8Shift = 16;
-const int kMsaImm8Bits = 8;
-const int kMsaImm5Shift = 16;
-const int kMsaImm5Bits = 5;
-const int kMsaImm10Shift = 11;
-const int kMsaImm10Bits = 10;
-const int kMsaImmMI10Shift = 16;
-const int kMsaImmMI10Bits = 10;
-
-// In branches and jumps immediate fields point to words, not bytes,
-// and are therefore shifted by 2.
-const int kImmFieldShift = 2;
-
-const int kFrBits        = 5;
-const int kFrShift       = 21;
-const int kFsShift       = 11;
-const int kFsBits        = 5;
-const int kFtShift       = 16;
-const int kFtBits        = 5;
-const int kFdShift       = 6;
-const int kFdBits        = 5;
-const int kFCccShift     = 8;
-const int kFCccBits      = 3;
-const int kFBccShift     = 18;
-const int kFBccBits      = 3;
-const int kFBtrueShift   = 16;
-const int kFBtrueBits    = 1;
-const int kWtBits = 5;
-const int kWtShift = 16;
-const int kWsBits = 5;
-const int kWsShift = 11;
-const int kWdBits = 5;
-const int kWdShift = 6;
-
-// ----- Miscellaneous useful masks.
-// Instruction bit masks.
-const int kOpcodeMask = ((1 << kOpcodeBits) - 1) << kOpcodeShift;
-const int kImm9Mask = ((1 << kImm9Bits) - 1) << kImm9Shift;
-const int kImm16Mask = ((1 << kImm16Bits) - 1) << kImm16Shift;
-const int kImm18Mask = ((1 << kImm18Bits) - 1) << kImm18Shift;
-const int kImm19Mask = ((1 << kImm19Bits) - 1) << kImm19Shift;
-const int kImm21Mask = ((1 << kImm21Bits) - 1) << kImm21Shift;
-const int kImm26Mask = ((1 << kImm26Bits) - 1) << kImm26Shift;
-const int kImm28Mask = ((1 << kImm28Bits) - 1) << kImm28Shift;
-const int kImm5Mask = ((1 << 5) - 1);
-const int kImm8Mask = ((1 << 8) - 1);
-const int kImm10Mask = ((1 << 10) - 1);
-const int kMsaI5I10Mask = ((7U << 23) | ((1 << 6) - 1));
-const int kMsaI8Mask = ((3U << 24) | ((1 << 6) - 1));
-const int kMsaI5Mask = ((7U << 23) | ((1 << 6) - 1));
-const int kMsaMI10Mask = (15U << 2);
-const int kMsaBITMask = ((7U << 23) | ((1 << 6) - 1));
-const int kMsaELMMask = (15U << 22);
-const int kMsaLongerELMMask = kMsaELMMask | (63U << 16);
-const int kMsa3RMask = ((7U << 23) | ((1 << 6) - 1));
-const int kMsa3RFMask = ((15U << 22) | ((1 << 6) - 1));
-const int kMsaVECMask = (23U << 21);
-const int kMsa2RMask = (7U << 18);
-const int kMsa2RFMask = (15U << 17);
-const int kRsFieldMask = ((1 << kRsBits) - 1) << kRsShift;
-const int kRtFieldMask = ((1 << kRtBits) - 1) << kRtShift;
-const int kRdFieldMask = ((1 << kRdBits) - 1) << kRdShift;
-const int kSaFieldMask = ((1 << kSaBits) - 1) << kSaShift;
-const int kFunctionFieldMask = ((1 << kFunctionBits) - 1) << kFunctionShift;
-// Misc masks.
-const int kHiMask = 0xffff << 16;
-const int kLoMask = 0xffff;
-const int kSignMask = 0x80000000;
-const int kJumpAddrMask = (1 << (kImm26Bits + kImmFieldShift)) - 1;
-
-// ----- MIPS Opcodes and Function Fields.
-// We use this presentation to stay close to the table representation in
-// MIPS32 Architecture For Programmers, Volume II: The MIPS32 Instruction Set.
-enum Opcode : uint32_t {
-  SPECIAL = 0U << kOpcodeShift,
-  REGIMM = 1U << kOpcodeShift,
-
-  J = ((0U << 3) + 2) << kOpcodeShift,
-  JAL = ((0U << 3) + 3) << kOpcodeShift,
-  BEQ = ((0U << 3) + 4) << kOpcodeShift,
-  BNE = ((0U << 3) + 5) << kOpcodeShift,
-  BLEZ = ((0U << 3) + 6) << kOpcodeShift,
-  BGTZ = ((0U << 3) + 7) << kOpcodeShift,
-
-  ADDI = ((1U << 3) + 0) << kOpcodeShift,
-  ADDIU = ((1U << 3) + 1) << kOpcodeShift,
-  SLTI = ((1U << 3) + 2) << kOpcodeShift,
-  SLTIU = ((1U << 3) + 3) << kOpcodeShift,
-  ANDI = ((1U << 3) + 4) << kOpcodeShift,
-  ORI = ((1U << 3) + 5) << kOpcodeShift,
-  XORI = ((1U << 3) + 6) << kOpcodeShift,
-  LUI = ((1U << 3) + 7) << kOpcodeShift,  // LUI/AUI family.
-
-  BEQC = ((2U << 3) + 0) << kOpcodeShift,
-  COP1 = ((2U << 3) + 1) << kOpcodeShift,  // Coprocessor 1 class.
-  BEQL = ((2U << 3) + 4) << kOpcodeShift,
-  BNEL = ((2U << 3) + 5) << kOpcodeShift,
-  BLEZL = ((2U << 3) + 6) << kOpcodeShift,
-  BGTZL = ((2U << 3) + 7) << kOpcodeShift,
-
-  DADDI = ((3U << 3) + 0) << kOpcodeShift,  // This is also BNEC.
-  SPECIAL2 = ((3U << 3) + 4) << kOpcodeShift,
-  MSA = ((3U << 3) + 6) << kOpcodeShift,
-  SPECIAL3 = ((3U << 3) + 7) << kOpcodeShift,
-
-  LB = ((4U << 3) + 0) << kOpcodeShift,
-  LH = ((4U << 3) + 1) << kOpcodeShift,
-  LWL = ((4U << 3) + 2) << kOpcodeShift,
-  LW = ((4U << 3) + 3) << kOpcodeShift,
-  LBU = ((4U << 3) + 4) << kOpcodeShift,
-  LHU = ((4U << 3) + 5) << kOpcodeShift,
-  LWR = ((4U << 3) + 6) << kOpcodeShift,
-  SB = ((5U << 3) + 0) << kOpcodeShift,
-  SH = ((5U << 3) + 1) << kOpcodeShift,
-  SWL = ((5U << 3) + 2) << kOpcodeShift,
-  SW = ((5U << 3) + 3) << kOpcodeShift,
-  SWR = ((5U << 3) + 6) << kOpcodeShift,
-
-  LL = ((6U << 3) + 0) << kOpcodeShift,
-  LWC1 = ((6U << 3) + 1) << kOpcodeShift,
-  BC = ((6U << 3) + 2) << kOpcodeShift,
-  LDC1 = ((6U << 3) + 5) << kOpcodeShift,
-  POP66 = ((6U << 3) + 6) << kOpcodeShift,  // beqzc, jic
-
-  PREF = ((6U << 3) + 3) << kOpcodeShift,
-
-  SC = ((7U << 3) + 0) << kOpcodeShift,
-  SWC1 = ((7U << 3) + 1) << kOpcodeShift,
-  BALC = ((7U << 3) + 2) << kOpcodeShift,
-  PCREL = ((7U << 3) + 3) << kOpcodeShift,
-  SDC1 = ((7U << 3) + 5) << kOpcodeShift,
-  POP76 = ((7U << 3) + 6) << kOpcodeShift,  // bnezc, jialc
-
-  COP1X = ((1U << 4) + 3) << kOpcodeShift,
-
-  // New r6 instruction.
-  POP06 = BLEZ,   // bgeuc/bleuc, blezalc, bgezalc
-  POP07 = BGTZ,   // bltuc/bgtuc, bgtzalc, bltzalc
-  POP10 = ADDI,   // beqzalc, bovc, beqc
-  POP26 = BLEZL,  // bgezc, blezc, bgec/blec
-  POP27 = BGTZL,  // bgtzc, bltzc, bltc/bgtc
-  POP30 = DADDI,  // bnezalc, bnvc, bnec
-};
-
-enum SecondaryField : uint32_t {
-  // SPECIAL Encoding of Function Field.
-  SLL = ((0U << 3) + 0),
-  MOVCI = ((0U << 3) + 1),
-  SRL = ((0U << 3) + 2),
-  SRA = ((0U << 3) + 3),
-  SLLV = ((0U << 3) + 4),
-  LSA = ((0U << 3) + 5),
-  SRLV = ((0U << 3) + 6),
-  SRAV = ((0U << 3) + 7),
-
-  JR = ((1U << 3) + 0),
-  JALR = ((1U << 3) + 1),
-  MOVZ = ((1U << 3) + 2),
-  MOVN = ((1U << 3) + 3),
-  BREAK = ((1U << 3) + 5),
-  SYNC = ((1U << 3) + 7),
-
-  MFHI = ((2U << 3) + 0),
-  CLZ_R6 = ((2U << 3) + 0),
-  CLO_R6 = ((2U << 3) + 1),
-  MFLO = ((2U << 3) + 2),
-
-  MULT = ((3U << 3) + 0),
-  MULTU = ((3U << 3) + 1),
-  DIV = ((3U << 3) + 2),
-  DIVU = ((3U << 3) + 3),
-
-  ADD = ((4U << 3) + 0),
-  ADDU = ((4U << 3) + 1),
-  SUB = ((4U << 3) + 2),
-  SUBU = ((4U << 3) + 3),
-  AND = ((4U << 3) + 4),
-  OR = ((4U << 3) + 5),
-  XOR = ((4U << 3) + 6),
-  NOR = ((4U << 3) + 7),
-
-  SLT = ((5U << 3) + 2),
-  SLTU = ((5U << 3) + 3),
-
-  TGE = ((6U << 3) + 0),
-  TGEU = ((6U << 3) + 1),
-  TLT = ((6U << 3) + 2),
-  TLTU = ((6U << 3) + 3),
-  TEQ = ((6U << 3) + 4),
-  SELEQZ_S = ((6U << 3) + 5),
-  TNE = ((6U << 3) + 6),
-  SELNEZ_S = ((6U << 3) + 7),
-
-  // Multiply integers in r6.
-  MUL_MUH = ((3U << 3) + 0),    // MUL, MUH.
-  MUL_MUH_U = ((3U << 3) + 1),  // MUL_U, MUH_U.
-  RINT = ((3U << 3) + 2),
-
-  MUL_OP = ((0U << 3) + 2),
-  MUH_OP = ((0U << 3) + 3),
-  DIV_OP = ((0U << 3) + 2),
-  MOD_OP = ((0U << 3) + 3),
-
-  DIV_MOD = ((3U << 3) + 2),
-  DIV_MOD_U = ((3U << 3) + 3),
-
-  // SPECIAL2 Encoding of Function Field.
-  MUL = ((0U << 3) + 2),
-  CLZ = ((4U << 3) + 0),
-  CLO = ((4U << 3) + 1),
-
-  // SPECIAL3 Encoding of Function Field.
-  EXT = ((0U << 3) + 0),
-  INS = ((0U << 3) + 4),
-  BSHFL = ((4U << 3) + 0),
-  SC_R6 = ((4U << 3) + 6),
-  LL_R6 = ((6U << 3) + 6),
-
-  // SPECIAL3 Encoding of sa Field.
-  BITSWAP = ((0U << 3) + 0),
-  ALIGN = ((0U << 3) + 2),
-  WSBH = ((0U << 3) + 2),
-  SEB = ((2U << 3) + 0),
-  SEH = ((3U << 3) + 0),
-
-  // REGIMM  encoding of rt Field.
-  BLTZ = ((0U << 3) + 0) << 16,
-  BGEZ = ((0U << 3) + 1) << 16,
-  BLTZAL = ((2U << 3) + 0) << 16,
-  BGEZAL = ((2U << 3) + 1) << 16,
-  BGEZALL = ((2U << 3) + 3) << 16,
-
-  // COP1 Encoding of rs Field.
-  MFC1 = ((0U << 3) + 0) << 21,
-  CFC1 = ((0U << 3) + 2) << 21,
-  MFHC1 = ((0U << 3) + 3) << 21,
-  MTC1 = ((0U << 3) + 4) << 21,
-  CTC1 = ((0U << 3) + 6) << 21,
-  MTHC1 = ((0U << 3) + 7) << 21,
-  BC1 = ((1U << 3) + 0) << 21,
-  S = ((2U << 3) + 0) << 21,
-  D = ((2U << 3) + 1) << 21,
-  W = ((2U << 3) + 4) << 21,
-  L = ((2U << 3) + 5) << 21,
-  PS = ((2U << 3) + 6) << 21,
-  // COP1 Encoding of Function Field When rs=S.
-
-  ADD_S = ((0U << 3) + 0),
-  SUB_S = ((0U << 3) + 1),
-  MUL_S = ((0U << 3) + 2),
-  DIV_S = ((0U << 3) + 3),
-  ABS_S = ((0U << 3) + 5),
-  SQRT_S = ((0U << 3) + 4),
-  MOV_S = ((0U << 3) + 6),
-  NEG_S = ((0U << 3) + 7),
-  ROUND_L_S = ((1U << 3) + 0),
-  TRUNC_L_S = ((1U << 3) + 1),
-  CEIL_L_S = ((1U << 3) + 2),
-  FLOOR_L_S = ((1U << 3) + 3),
-  ROUND_W_S = ((1U << 3) + 4),
-  TRUNC_W_S = ((1U << 3) + 5),
-  CEIL_W_S = ((1U << 3) + 6),
-  FLOOR_W_S = ((1U << 3) + 7),
-  RECIP_S = ((2U << 3) + 5),
-  RSQRT_S = ((2U << 3) + 6),
-  MADDF_S = ((3U << 3) + 0),
-  MSUBF_S = ((3U << 3) + 1),
-  CLASS_S = ((3U << 3) + 3),
-  CVT_D_S = ((4U << 3) + 1),
-  CVT_W_S = ((4U << 3) + 4),
-  CVT_L_S = ((4U << 3) + 5),
-  CVT_PS_S = ((4U << 3) + 6),
-
-  // COP1 Encoding of Function Field When rs=D.
-  ADD_D = ((0U << 3) + 0),
-  SUB_D = ((0U << 3) + 1),
-  MUL_D = ((0U << 3) + 2),
-  DIV_D = ((0U << 3) + 3),
-  SQRT_D = ((0U << 3) + 4),
-  ABS_D = ((0U << 3) + 5),
-  MOV_D = ((0U << 3) + 6),
-  NEG_D = ((0U << 3) + 7),
-  ROUND_L_D = ((1U << 3) + 0),
-  TRUNC_L_D = ((1U << 3) + 1),
-  CEIL_L_D = ((1U << 3) + 2),
-  FLOOR_L_D = ((1U << 3) + 3),
-  ROUND_W_D = ((1U << 3) + 4),
-  TRUNC_W_D = ((1U << 3) + 5),
-  CEIL_W_D = ((1U << 3) + 6),
-  FLOOR_W_D = ((1U << 3) + 7),
-  RECIP_D = ((2U << 3) + 5),
-  RSQRT_D = ((2U << 3) + 6),
-  MADDF_D = ((3U << 3) + 0),
-  MSUBF_D = ((3U << 3) + 1),
-  CLASS_D = ((3U << 3) + 3),
-  MIN = ((3U << 3) + 4),
-  MINA = ((3U << 3) + 5),
-  MAX = ((3U << 3) + 6),
-  MAXA = ((3U << 3) + 7),
-  CVT_S_D = ((4U << 3) + 0),
-  CVT_W_D = ((4U << 3) + 4),
-  CVT_L_D = ((4U << 3) + 5),
-  C_F_D = ((6U << 3) + 0),
-  C_UN_D = ((6U << 3) + 1),
-  C_EQ_D = ((6U << 3) + 2),
-  C_UEQ_D = ((6U << 3) + 3),
-  C_OLT_D = ((6U << 3) + 4),
-  C_ULT_D = ((6U << 3) + 5),
-  C_OLE_D = ((6U << 3) + 6),
-  C_ULE_D = ((6U << 3) + 7),
-
-  // COP1 Encoding of Function Field When rs=W or L.
-  CVT_S_W = ((4U << 3) + 0),
-  CVT_D_W = ((4U << 3) + 1),
-  CVT_S_L = ((4U << 3) + 0),
-  CVT_D_L = ((4U << 3) + 1),
-  BC1EQZ = ((2U << 2) + 1) << 21,
-  BC1NEZ = ((3U << 2) + 1) << 21,
-  // COP1 CMP positive predicates Bit 5..4 = 00.
-  CMP_AF = ((0U << 3) + 0),
-  CMP_UN = ((0U << 3) + 1),
-  CMP_EQ = ((0U << 3) + 2),
-  CMP_UEQ = ((0U << 3) + 3),
-  CMP_LT = ((0U << 3) + 4),
-  CMP_ULT = ((0U << 3) + 5),
-  CMP_LE = ((0U << 3) + 6),
-  CMP_ULE = ((0U << 3) + 7),
-  CMP_SAF = ((1U << 3) + 0),
-  CMP_SUN = ((1U << 3) + 1),
-  CMP_SEQ = ((1U << 3) + 2),
-  CMP_SUEQ = ((1U << 3) + 3),
-  CMP_SSLT = ((1U << 3) + 4),
-  CMP_SSULT = ((1U << 3) + 5),
-  CMP_SLE = ((1U << 3) + 6),
-  CMP_SULE = ((1U << 3) + 7),
-  // COP1 CMP negative predicates Bit 5..4 = 01.
-  CMP_AT = ((2U << 3) + 0),  // Reserved, not implemented.
-  CMP_OR = ((2U << 3) + 1),
-  CMP_UNE = ((2U << 3) + 2),
-  CMP_NE = ((2U << 3) + 3),
-  CMP_UGE = ((2U << 3) + 4),  // Reserved, not implemented.
-  CMP_OGE = ((2U << 3) + 5),  // Reserved, not implemented.
-  CMP_UGT = ((2U << 3) + 6),  // Reserved, not implemented.
-  CMP_OGT = ((2U << 3) + 7),  // Reserved, not implemented.
-  CMP_SAT = ((3U << 3) + 0),  // Reserved, not implemented.
-  CMP_SOR = ((3U << 3) + 1),
-  CMP_SUNE = ((3U << 3) + 2),
-  CMP_SNE = ((3U << 3) + 3),
-  CMP_SUGE = ((3U << 3) + 4),  // Reserved, not implemented.
-  CMP_SOGE = ((3U << 3) + 5),  // Reserved, not implemented.
-  CMP_SUGT = ((3U << 3) + 6),  // Reserved, not implemented.
-  CMP_SOGT = ((3U << 3) + 7),  // Reserved, not implemented.
-
-  SEL = ((2U << 3) + 0),
-  MOVZ_C = ((2U << 3) + 2),
-  MOVN_C = ((2U << 3) + 3),
-  SELEQZ_C = ((2U << 3) + 4),  // COP1 on FPR registers.
-  MOVF = ((2U << 3) + 1),      // Function field for MOVT.fmt and MOVF.fmt
-  SELNEZ_C = ((2U << 3) + 7),  // COP1 on FPR registers.
-                               // COP1 Encoding of Function Field When rs=PS.
-
-  // COP1X Encoding of Function Field.
-  MADD_S = ((4U << 3) + 0),
-  MADD_D = ((4U << 3) + 1),
-  MSUB_S = ((5U << 3) + 0),
-  MSUB_D = ((5U << 3) + 1),
-
-  // PCREL Encoding of rt Field.
-  ADDIUPC = ((0U << 2) + 0),
-  LWPC = ((0U << 2) + 1),
-  AUIPC = ((3U << 3) + 6),
-  ALUIPC = ((3U << 3) + 7),
-
-  // POP66 Encoding of rs Field.
-  JIC = ((0U << 5) + 0),
-
-  // POP76 Encoding of rs Field.
-  JIALC = ((0U << 5) + 0),
-
-  // COP1 Encoding of rs Field for MSA Branch Instructions
-  BZ_V = (((1U << 3) + 3) << kRsShift),
-  BNZ_V = (((1U << 3) + 7) << kRsShift),
-  BZ_B = (((3U << 3) + 0) << kRsShift),
-  BZ_H = (((3U << 3) + 1) << kRsShift),
-  BZ_W = (((3U << 3) + 2) << kRsShift),
-  BZ_D = (((3U << 3) + 3) << kRsShift),
-  BNZ_B = (((3U << 3) + 4) << kRsShift),
-  BNZ_H = (((3U << 3) + 5) << kRsShift),
-  BNZ_W = (((3U << 3) + 6) << kRsShift),
-  BNZ_D = (((3U << 3) + 7) << kRsShift),
-
-  // MSA: Operation Field for MI10 Instruction Formats
-  MSA_LD = (8U << 2),
-  MSA_ST = (9U << 2),
-  LD_B = ((8U << 2) + 0),
-  LD_H = ((8U << 2) + 1),
-  LD_W = ((8U << 2) + 2),
-  LD_D = ((8U << 2) + 3),
-  ST_B = ((9U << 2) + 0),
-  ST_H = ((9U << 2) + 1),
-  ST_W = ((9U << 2) + 2),
-  ST_D = ((9U << 2) + 3),
-
-  // MSA: Operation Field for I5 Instruction Format
-  ADDVI = ((0U << 23) + 6),
-  SUBVI = ((1U << 23) + 6),
-  MAXI_S = ((2U << 23) + 6),
-  MAXI_U = ((3U << 23) + 6),
-  MINI_S = ((4U << 23) + 6),
-  MINI_U = ((5U << 23) + 6),
-  CEQI = ((0U << 23) + 7),
-  CLTI_S = ((2U << 23) + 7),
-  CLTI_U = ((3U << 23) + 7),
-  CLEI_S = ((4U << 23) + 7),
-  CLEI_U = ((5U << 23) + 7),
-  LDI = ((6U << 23) + 7),  // I10 instruction format
-  I5_DF_b = (0U << 21),
-  I5_DF_h = (1U << 21),
-  I5_DF_w = (2U << 21),
-  I5_DF_d = (3U << 21),
-
-  // MSA: Operation Field for I8 Instruction Format
-  ANDI_B = ((0U << 24) + 0),
-  ORI_B = ((1U << 24) + 0),
-  NORI_B = ((2U << 24) + 0),
-  XORI_B = ((3U << 24) + 0),
-  BMNZI_B = ((0U << 24) + 1),
-  BMZI_B = ((1U << 24) + 1),
-  BSELI_B = ((2U << 24) + 1),
-  SHF_B = ((0U << 24) + 2),
-  SHF_H = ((1U << 24) + 2),
-  SHF_W = ((2U << 24) + 2),
-
-  MSA_VEC_2R_2RF_MINOR = ((3U << 3) + 6),
-
-  // MSA: Operation Field for VEC Instruction Formats
-  AND_V = (((0U << 2) + 0) << 21),
-  OR_V = (((0U << 2) + 1) << 21),
-  NOR_V = (((0U << 2) + 2) << 21),
-  XOR_V = (((0U << 2) + 3) << 21),
-  BMNZ_V = (((1U << 2) + 0) << 21),
-  BMZ_V = (((1U << 2) + 1) << 21),
-  BSEL_V = (((1U << 2) + 2) << 21),
-
-  // MSA: Operation Field for 2R Instruction Formats
-  MSA_2R_FORMAT = (((6U << 2) + 0) << 21),
-  FILL = (0U << 18),
-  PCNT = (1U << 18),
-  NLOC = (2U << 18),
-  NLZC = (3U << 18),
-  MSA_2R_DF_b = (0U << 16),
-  MSA_2R_DF_h = (1U << 16),
-  MSA_2R_DF_w = (2U << 16),
-  MSA_2R_DF_d = (3U << 16),
-
-  // MSA: Operation Field for 2RF Instruction Formats
-  MSA_2RF_FORMAT = (((6U << 2) + 1) << 21),
-  FCLASS = (0U << 17),
-  FTRUNC_S = (1U << 17),
-  FTRUNC_U = (2U << 17),
-  FSQRT = (3U << 17),
-  FRSQRT = (4U << 17),
-  FRCP = (5U << 17),
-  FRINT = (6U << 17),
-  FLOG2 = (7U << 17),
-  FEXUPL = (8U << 17),
-  FEXUPR = (9U << 17),
-  FFQL = (10U << 17),
-  FFQR = (11U << 17),
-  FTINT_S = (12U << 17),
-  FTINT_U = (13U << 17),
-  FFINT_S = (14U << 17),
-  FFINT_U = (15U << 17),
-  MSA_2RF_DF_w = (0U << 16),
-  MSA_2RF_DF_d = (1U << 16),
-
-  // MSA: Operation Field for 3R Instruction Format
-  SLL_MSA = ((0U << 23) + 13),
-  SRA_MSA = ((1U << 23) + 13),
-  SRL_MSA = ((2U << 23) + 13),
-  BCLR = ((3U << 23) + 13),
-  BSET = ((4U << 23) + 13),
-  BNEG = ((5U << 23) + 13),
-  BINSL = ((6U << 23) + 13),
-  BINSR = ((7U << 23) + 13),
-  ADDV = ((0U << 23) + 14),
-  SUBV = ((1U << 23) + 14),
-  MAX_S = ((2U << 23) + 14),
-  MAX_U = ((3U << 23) + 14),
-  MIN_S = ((4U << 23) + 14),
-  MIN_U = ((5U << 23) + 14),
-  MAX_A = ((6U << 23) + 14),
-  MIN_A = ((7U << 23) + 14),
-  CEQ = ((0U << 23) + 15),
-  CLT_S = ((2U << 23) + 15),
-  CLT_U = ((3U << 23) + 15),
-  CLE_S = ((4U << 23) + 15),
-  CLE_U = ((5U << 23) + 15),
-  ADD_A = ((0U << 23) + 16),
-  ADDS_A = ((1U << 23) + 16),
-  ADDS_S = ((2U << 23) + 16),
-  ADDS_U = ((3U << 23) + 16),
-  AVE_S = ((4U << 23) + 16),
-  AVE_U = ((5U << 23) + 16),
-  AVER_S = ((6U << 23) + 16),
-  AVER_U = ((7U << 23) + 16),
-  SUBS_S = ((0U << 23) + 17),
-  SUBS_U = ((1U << 23) + 17),
-  SUBSUS_U = ((2U << 23) + 17),
-  SUBSUU_S = ((3U << 23) + 17),
-  ASUB_S = ((4U << 23) + 17),
-  ASUB_U = ((5U << 23) + 17),
-  MULV = ((0U << 23) + 18),
-  MADDV = ((1U << 23) + 18),
-  MSUBV = ((2U << 23) + 18),
-  DIV_S_MSA = ((4U << 23) + 18),
-  DIV_U = ((5U << 23) + 18),
-  MOD_S = ((6U << 23) + 18),
-  MOD_U = ((7U << 23) + 18),
-  DOTP_S = ((0U << 23) + 19),
-  DOTP_U = ((1U << 23) + 19),
-  DPADD_S = ((2U << 23) + 19),
-  DPADD_U = ((3U << 23) + 19),
-  DPSUB_S = ((4U << 23) + 19),
-  DPSUB_U = ((5U << 23) + 19),
-  SLD = ((0U << 23) + 20),
-  SPLAT = ((1U << 23) + 20),
-  PCKEV = ((2U << 23) + 20),
-  PCKOD = ((3U << 23) + 20),
-  ILVL = ((4U << 23) + 20),
-  ILVR = ((5U << 23) + 20),
-  ILVEV = ((6U << 23) + 20),
-  ILVOD = ((7U << 23) + 20),
-  VSHF = ((0U << 23) + 21),
-  SRAR = ((1U << 23) + 21),
-  SRLR = ((2U << 23) + 21),
-  HADD_S = ((4U << 23) + 21),
-  HADD_U = ((5U << 23) + 21),
-  HSUB_S = ((6U << 23) + 21),
-  HSUB_U = ((7U << 23) + 21),
-  MSA_3R_DF_b = (0U << 21),
-  MSA_3R_DF_h = (1U << 21),
-  MSA_3R_DF_w = (2U << 21),
-  MSA_3R_DF_d = (3U << 21),
-
-  // MSA: Operation Field for 3RF Instruction Format
-  FCAF = ((0U << 22) + 26),
-  FCUN = ((1U << 22) + 26),
-  FCEQ = ((2U << 22) + 26),
-  FCUEQ = ((3U << 22) + 26),
-  FCLT = ((4U << 22) + 26),
-  FCULT = ((5U << 22) + 26),
-  FCLE = ((6U << 22) + 26),
-  FCULE = ((7U << 22) + 26),
-  FSAF = ((8U << 22) + 26),
-  FSUN = ((9U << 22) + 26),
-  FSEQ = ((10U << 22) + 26),
-  FSUEQ = ((11U << 22) + 26),
-  FSLT = ((12U << 22) + 26),
-  FSULT = ((13U << 22) + 26),
-  FSLE = ((14U << 22) + 26),
-  FSULE = ((15U << 22) + 26),
-  FADD = ((0U << 22) + 27),
-  FSUB = ((1U << 22) + 27),
-  FMUL = ((2U << 22) + 27),
-  FDIV = ((3U << 22) + 27),
-  FMADD = ((4U << 22) + 27),
-  FMSUB = ((5U << 22) + 27),
-  FEXP2 = ((7U << 22) + 27),
-  FEXDO = ((8U << 22) + 27),
-  FTQ = ((10U << 22) + 27),
-  FMIN = ((12U << 22) + 27),
-  FMIN_A = ((13U << 22) + 27),
-  FMAX = ((14U << 22) + 27),
-  FMAX_A = ((15U << 22) + 27),
-  FCOR = ((1U << 22) + 28),
-  FCUNE = ((2U << 22) + 28),
-  FCNE = ((3U << 22) + 28),
-  MUL_Q = ((4U << 22) + 28),
-  MADD_Q = ((5U << 22) + 28),
-  MSUB_Q = ((6U << 22) + 28),
-  FSOR = ((9U << 22) + 28),
-  FSUNE = ((10U << 22) + 28),
-  FSNE = ((11U << 22) + 28),
-  MULR_Q = ((12U << 22) + 28),
-  MADDR_Q = ((13U << 22) + 28),
-  MSUBR_Q = ((14U << 22) + 28),
-
-  // MSA: Operation Field for ELM Instruction Format
-  MSA_ELM_MINOR = ((3U << 3) + 1),
-  SLDI = (0U << 22),
-  CTCMSA = ((0U << 22) | (62U << 16)),
-  SPLATI = (1U << 22),
-  CFCMSA = ((1U << 22) | (62U << 16)),
-  COPY_S = (2U << 22),
-  MOVE_V = ((2U << 22) | (62U << 16)),
-  COPY_U = (3U << 22),
-  INSERT = (4U << 22),
-  INSVE = (5U << 22),
-  ELM_DF_B = ((0U << 4) << 16),
-  ELM_DF_H = ((4U << 3) << 16),
-  ELM_DF_W = ((12U << 2) << 16),
-  ELM_DF_D = ((28U << 1) << 16),
-
-  // MSA: Operation Field for BIT Instruction Format
-  SLLI = ((0U << 23) + 9),
-  SRAI = ((1U << 23) + 9),
-  SRLI = ((2U << 23) + 9),
-  BCLRI = ((3U << 23) + 9),
-  BSETI = ((4U << 23) + 9),
-  BNEGI = ((5U << 23) + 9),
-  BINSLI = ((6U << 23) + 9),
-  BINSRI = ((7U << 23) + 9),
-  SAT_S = ((0U << 23) + 10),
-  SAT_U = ((1U << 23) + 10),
-  SRARI = ((2U << 23) + 10),
-  SRLRI = ((3U << 23) + 10),
-  BIT_DF_b = ((14U << 3) << 16),
-  BIT_DF_h = ((6U << 4) << 16),
-  BIT_DF_w = ((2U << 5) << 16),
-  BIT_DF_d = ((0U << 6) << 16),
-
-  nullptrSF = 0U
-};
-
-enum MSAMinorOpcode : uint32_t {
-  kMsaMinorUndefined = 0,
-  kMsaMinorI8,
-  kMsaMinorI5,
-  kMsaMinorI10,
-  kMsaMinorBIT,
-  kMsaMinor3R,
-  kMsaMinor3RF,
-  kMsaMinorELM,
-  kMsaMinorVEC,
-  kMsaMinor2R,
-  kMsaMinor2RF,
-  kMsaMinorMI10
-};
-
-// ----- Emulated conditions.
-// On MIPS we use this enum to abstract from conditional branch instructions.
-// The 'U' prefix is used to specify unsigned comparisons.
-// Opposite conditions must be paired as odd/even numbers
-// because 'NegateCondition' function flips LSB to negate condition.
-enum Condition {
-  // Any value < 0 is considered no_condition.
-  kNoCondition = -1,
-  overflow = 0,
-  no_overflow = 1,
-  Uless = 2,
-  Ugreater_equal = 3,
-  Uless_equal = 4,
-  Ugreater = 5,
-  equal = 6,
-  not_equal = 7,  // Unordered or Not Equal.
-  negative = 8,
-  positive = 9,
-  parity_even = 10,
-  parity_odd = 11,
-  less = 12,
-  greater_equal = 13,
-  less_equal = 14,
-  greater = 15,
-  ueq = 16,  // Unordered or Equal.
-  ogl = 17,  // Ordered and Not Equal.
-  cc_always = 18,
-
-  // Aliases.
-  carry = Uless,
-  not_carry = Ugreater_equal,
-  zero = equal,
-  eq = equal,
-  not_zero = not_equal,
-  ne = not_equal,
-  nz = not_equal,
-  sign = negative,
-  not_sign = positive,
-  mi = negative,
-  pl = positive,
-  hi = Ugreater,
-  ls = Uless_equal,
-  ge = greater_equal,
-  lt = less,
-  gt = greater,
-  le = less_equal,
-  hs = Ugreater_equal,
-  lo = Uless,
-  al = cc_always,
-  ult = Uless,
-  uge = Ugreater_equal,
-  ule = Uless_equal,
-  ugt = Ugreater,
-  cc_default = kNoCondition
-};
-
-
-// Returns the equivalent of !cc.
-// Negation of the default kNoCondition (-1) results in a non-default
-// no_condition value (-2). As long as tests for no_condition check
-// for condition < 0, this will work as expected.
-inline Condition NegateCondition(Condition cc) {
-  DCHECK(cc != cc_always);
-  return static_cast<Condition>(cc ^ 1);
-}
-
-
-inline Condition NegateFpuCondition(Condition cc) {
-  DCHECK(cc != cc_always);
-  switch (cc) {
-    case ult:
-      return ge;
-    case ugt:
-      return le;
-    case uge:
-      return lt;
-    case ule:
-      return gt;
-    case lt:
-      return uge;
-    case gt:
-      return ule;
-    case ge:
-      return ult;
-    case le:
-      return ugt;
-    case eq:
-      return ne;
-    case ne:
-      return eq;
-    case ueq:
-      return ogl;
-    case ogl:
-      return ueq;
-    default:
-      return cc;
-  }
-}
-
-enum MSABranchCondition {
-  all_not_zero = 0,   // Branch If All Elements Are Not Zero
-  one_elem_not_zero,  // Branch If At Least One Element of Any Format Is Not
-                      // Zero
-  one_elem_zero,      // Branch If At Least One Element Is Zero
-  all_zero            // Branch If All Elements of Any Format Are Zero
-};
-
-inline MSABranchCondition NegateMSABranchCondition(MSABranchCondition cond) {
-  switch (cond) {
-    case all_not_zero:
-      return one_elem_zero;
-    case one_elem_not_zero:
-      return all_zero;
-    case one_elem_zero:
-      return all_not_zero;
-    case all_zero:
-      return one_elem_not_zero;
-    default:
-      return cond;
-  }
-}
-
-enum MSABranchDF {
-  MSA_BRANCH_B = 0,
-  MSA_BRANCH_H,
-  MSA_BRANCH_W,
-  MSA_BRANCH_D,
-  MSA_BRANCH_V
-};
-
-// Commute a condition such that {a cond b == b cond' a}.
-inline Condition CommuteCondition(Condition cc) {
-  switch (cc) {
-    case Uless:
-      return Ugreater;
-    case Ugreater:
-      return Uless;
-    case Ugreater_equal:
-      return Uless_equal;
-    case Uless_equal:
-      return Ugreater_equal;
-    case less:
-      return greater;
-    case greater:
-      return less;
-    case greater_equal:
-      return less_equal;
-    case less_equal:
-      return greater_equal;
-    default:
-      return cc;
-  }
-}
-
-
-// ----- Coprocessor conditions.
-enum FPUCondition {
-  kNoFPUCondition = -1,
-
-  F = 0x00,    // False.
-  UN = 0x01,   // Unordered.
-  EQ = 0x02,   // Equal.
-  UEQ = 0x03,  // Unordered or Equal.
-  OLT = 0x04,  // Ordered or Less Than, on Mips release < 6.
-  LT = 0x04,   // Ordered or Less Than, on Mips release >= 6.
-  ULT = 0x05,  // Unordered or Less Than.
-  OLE = 0x06,  // Ordered or Less Than or Equal, on Mips release < 6.
-  LE = 0x06,   // Ordered or Less Than or Equal, on Mips release >= 6.
-  ULE = 0x07,  // Unordered or Less Than or Equal.
-
-  // Following constants are available on Mips release >= 6 only.
-  ORD = 0x11,  // Ordered, on Mips release >= 6.
-  UNE = 0x12,  // Not equal, on Mips release >= 6.
-  NE = 0x13,   // Ordered Greater Than or Less Than. on Mips >= 6 only.
-};
-
-
-// FPU rounding modes.
-enum FPURoundingMode {
-  RN = 0 << 0,  // Round to Nearest.
-  RZ = 1 << 0,  // Round towards zero.
-  RP = 2 << 0,  // Round towards Plus Infinity.
-  RM = 3 << 0,  // Round towards Minus Infinity.
-
-  // Aliases.
-  kRoundToNearest = RN,
-  kRoundToZero = RZ,
-  kRoundToPlusInf = RP,
-  kRoundToMinusInf = RM,
-
-  mode_round = RN,
-  mode_ceil = RP,
-  mode_floor = RM,
-  mode_trunc = RZ
-};
-
-const uint32_t kFPURoundingModeMask = 3 << 0;
-
-enum CheckForInexactConversion {
-  kCheckForInexactConversion,
-  kDontCheckForInexactConversion
-};
-
-enum class MaxMinKind : int { kMin = 0, kMax = 1 };
-
-// -----------------------------------------------------------------------------
-// Hints.
-
-// Branch hints are not used on the MIPS.  They are defined so that they can
-// appear in shared function signatures, but will be ignored in MIPS
-// implementations.
-enum Hint {
-  no_hint = 0
-};
-
-
-inline Hint NegateHint(Hint hint) {
-  return no_hint;
-}
-
-
-// -----------------------------------------------------------------------------
-// Specific instructions, constants, and masks.
-// These constants are declared in assembler-mips.cc, as they use named
-// registers and other constants.
-
-// addiu(sp, sp, 4) aka Pop() operation or part of Pop(r)
-// operations as post-increment of sp.
-extern const Instr kPopInstruction;
-// addiu(sp, sp, -4) part of Push(r) operation as pre-decrement of sp.
-extern const Instr kPushInstruction;
-// sw(r, MemOperand(sp, 0))
-extern const Instr kPushRegPattern;
-// lw(r, MemOperand(sp, 0))
-extern const Instr kPopRegPattern;
-extern const Instr kLwRegFpOffsetPattern;
-extern const Instr kSwRegFpOffsetPattern;
-extern const Instr kLwRegFpNegOffsetPattern;
-extern const Instr kSwRegFpNegOffsetPattern;
-// A mask for the Rt register for push, pop, lw, sw instructions.
-extern const Instr kRtMask;
-extern const Instr kLwSwInstrTypeMask;
-extern const Instr kLwSwInstrArgumentMask;
-extern const Instr kLwSwOffsetMask;
-
-// Break 0xfffff, reserved for redirected real time call.
-const Instr rtCallRedirInstr = SPECIAL | BREAK | call_rt_redirected << 6;
-// A nop instruction. (Encoding of sll 0 0 0).
-const Instr nopInstr = 0;
-
-static constexpr uint64_t OpcodeToBitNumber(Opcode opcode) {
-  return 1ULL << (static_cast<uint32_t>(opcode) >> kOpcodeShift);
-}
-
-class InstructionBase {
- public:
-  enum {
-    kInstrSize = 4,
-    kInstrSizeLog2 = 2,
-    // On MIPS PC cannot actually be directly accessed. We behave as if PC was
-    // always the value of the current instruction being executed.
-    kPCReadOffset = 0
-  };
-
-  // Instruction type.
-  enum Type { kRegisterType, kImmediateType, kJumpType, kUnsupported = -1 };
-
-  // Get the raw instruction bits.
-  inline Instr InstructionBits() const {
-    return *reinterpret_cast<const Instr*>(this);
-  }
-
-  // Set the raw instruction bits to value.
-  inline void SetInstructionBits(Instr value) {
-    *reinterpret_cast<Instr*>(this) = value;
-  }
-
-  // Read one particular bit out of the instruction bits.
-  inline int Bit(int nr) const {
-    return (InstructionBits() >> nr) & 1;
-  }
-
-  // Read a bit field out of the instruction bits.
-  inline int Bits(int hi, int lo) const {
-    return (InstructionBits() >> lo) & ((2U << (hi - lo)) - 1);
-  }
-
-
-  static constexpr uint64_t kOpcodeImmediateTypeMask =
-      OpcodeToBitNumber(REGIMM) | OpcodeToBitNumber(BEQ) |
-      OpcodeToBitNumber(BNE) | OpcodeToBitNumber(BLEZ) |
-      OpcodeToBitNumber(BGTZ) | OpcodeToBitNumber(ADDI) |
-      OpcodeToBitNumber(DADDI) | OpcodeToBitNumber(ADDIU) |
-      OpcodeToBitNumber(SLTI) | OpcodeToBitNumber(SLTIU) |
-      OpcodeToBitNumber(ANDI) | OpcodeToBitNumber(ORI) |
-      OpcodeToBitNumber(XORI) | OpcodeToBitNumber(LUI) |
-      OpcodeToBitNumber(BEQL) | OpcodeToBitNumber(BNEL) |
-      OpcodeToBitNumber(BLEZL) | OpcodeToBitNumber(BGTZL) |
-      OpcodeToBitNumber(POP66) | OpcodeToBitNumber(POP76) |
-      OpcodeToBitNumber(LB) | OpcodeToBitNumber(LH) | OpcodeToBitNumber(LWL) |
-      OpcodeToBitNumber(LW) | OpcodeToBitNumber(LBU) | OpcodeToBitNumber(LHU) |
-      OpcodeToBitNumber(LWR) | OpcodeToBitNumber(SB) | OpcodeToBitNumber(SH) |
-      OpcodeToBitNumber(SWL) | OpcodeToBitNumber(SW) | OpcodeToBitNumber(SWR) |
-      OpcodeToBitNumber(LWC1) | OpcodeToBitNumber(LDC1) |
-      OpcodeToBitNumber(SWC1) | OpcodeToBitNumber(SDC1) |
-      OpcodeToBitNumber(PCREL) | OpcodeToBitNumber(BC) |
-      OpcodeToBitNumber(BALC);
-
-#define FunctionFieldToBitNumber(function) (1ULL << function)
-
-  static const uint64_t kFunctionFieldRegisterTypeMask =
-      FunctionFieldToBitNumber(JR) | FunctionFieldToBitNumber(JALR) |
-      FunctionFieldToBitNumber(BREAK) | FunctionFieldToBitNumber(SLL) |
-      FunctionFieldToBitNumber(SRL) | FunctionFieldToBitNumber(SRA) |
-      FunctionFieldToBitNumber(SLLV) | FunctionFieldToBitNumber(SRLV) |
-      FunctionFieldToBitNumber(SRAV) | FunctionFieldToBitNumber(LSA) |
-      FunctionFieldToBitNumber(MFHI) | FunctionFieldToBitNumber(MFLO) |
-      FunctionFieldToBitNumber(MULT) | FunctionFieldToBitNumber(MULTU) |
-      FunctionFieldToBitNumber(DIV) | FunctionFieldToBitNumber(DIVU) |
-      FunctionFieldToBitNumber(ADD) | FunctionFieldToBitNumber(ADDU) |
-      FunctionFieldToBitNumber(SUB) | FunctionFieldToBitNumber(SUBU) |
-      FunctionFieldToBitNumber(AND) | FunctionFieldToBitNumber(OR) |
-      FunctionFieldToBitNumber(XOR) | FunctionFieldToBitNumber(NOR) |
-      FunctionFieldToBitNumber(SLT) | FunctionFieldToBitNumber(SLTU) |
-      FunctionFieldToBitNumber(TGE) | FunctionFieldToBitNumber(TGEU) |
-      FunctionFieldToBitNumber(TLT) | FunctionFieldToBitNumber(TLTU) |
-      FunctionFieldToBitNumber(TEQ) | FunctionFieldToBitNumber(TNE) |
-      FunctionFieldToBitNumber(MOVZ) | FunctionFieldToBitNumber(MOVN) |
-      FunctionFieldToBitNumber(MOVCI) | FunctionFieldToBitNumber(SELEQZ_S) |
-      FunctionFieldToBitNumber(SELNEZ_S) | FunctionFieldToBitNumber(SYNC);
-
-  // Accessors for the different named fields used in the MIPS encoding.
-  inline Opcode OpcodeValue() const {
-    return static_cast<Opcode>(
-        Bits(kOpcodeShift + kOpcodeBits - 1, kOpcodeShift));
-  }
-
-  inline int FunctionFieldRaw() const {
-    return InstructionBits() & kFunctionFieldMask;
-  }
-
-  // Return the fields at their original place in the instruction encoding.
-  inline Opcode OpcodeFieldRaw() const {
-    return static_cast<Opcode>(InstructionBits() & kOpcodeMask);
-  }
-
-  // Safe to call within InstructionType().
-  inline int RsFieldRawNoAssert() const {
-    return InstructionBits() & kRsFieldMask;
-  }
-
-  inline int SaFieldRaw() const { return InstructionBits() & kSaFieldMask; }
-
-  // Get the encoding type of the instruction.
-  inline Type InstructionType() const;
-
-  inline MSAMinorOpcode MSAMinorOpcodeField() const {
-    int op = this->FunctionFieldRaw();
-    switch (op) {
-      case 0:
-      case 1:
-      case 2:
-        return kMsaMinorI8;
-      case 6:
-        return kMsaMinorI5;
-      case 7:
-        return (((this->InstructionBits() & kMsaI5I10Mask) == LDI)
-                    ? kMsaMinorI10
-                    : kMsaMinorI5);
-      case 9:
-      case 10:
-        return kMsaMinorBIT;
-      case 13:
-      case 14:
-      case 15:
-      case 16:
-      case 17:
-      case 18:
-      case 19:
-      case 20:
-      case 21:
-        return kMsaMinor3R;
-      case 25:
-        return kMsaMinorELM;
-      case 26:
-      case 27:
-      case 28:
-        return kMsaMinor3RF;
-      case 30:
-        switch (this->RsFieldRawNoAssert()) {
-          case MSA_2R_FORMAT:
-            return kMsaMinor2R;
-          case MSA_2RF_FORMAT:
-            return kMsaMinor2RF;
-          default:
-            return kMsaMinorVEC;
-        }
-        break;
-      case 32:
-      case 33:
-      case 34:
-      case 35:
-      case 36:
-      case 37:
-      case 38:
-      case 39:
-        return kMsaMinorMI10;
-      default:
-        return kMsaMinorUndefined;
-    }
-  }
-
- protected:
-  InstructionBase() {}
-};
-
-template <class T>
-class InstructionGetters : public T {
- public:
-  inline int RsValue() const {
-    DCHECK(this->InstructionType() == InstructionBase::kRegisterType ||
-           this->InstructionType() == InstructionBase::kImmediateType);
-    return InstructionBase::Bits(kRsShift + kRsBits - 1, kRsShift);
-  }
-
-  inline int RtValue() const {
-    DCHECK(this->InstructionType() == InstructionBase::kRegisterType ||
-           this->InstructionType() == InstructionBase::kImmediateType);
-    return this->Bits(kRtShift + kRtBits - 1, kRtShift);
-  }
-
-  inline int RdValue() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kRegisterType);
-    return this->Bits(kRdShift + kRdBits - 1, kRdShift);
-  }
-
-  inline int BaseValue() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kImmediateType);
-    return this->Bits(kBaseShift + kBaseBits - 1, kBaseShift);
-  }
-
-  inline int SaValue() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kRegisterType);
-    return this->Bits(kSaShift + kSaBits - 1, kSaShift);
-  }
-
-  inline int LsaSaValue() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kRegisterType);
-    return this->Bits(kSaShift + kLsaSaBits - 1, kSaShift);
-  }
-
-  inline int FunctionValue() const {
-    DCHECK(this->InstructionType() == InstructionBase::kRegisterType ||
-           this->InstructionType() == InstructionBase::kImmediateType);
-    return this->Bits(kFunctionShift + kFunctionBits - 1, kFunctionShift);
-  }
-
-  inline int FdValue() const {
-    return this->Bits(kFdShift + kFdBits - 1, kFdShift);
-  }
-
-  inline int FsValue() const {
-    return this->Bits(kFsShift + kFsBits - 1, kFsShift);
-  }
-
-  inline int FtValue() const {
-    return this->Bits(kFtShift + kFtBits - 1, kFtShift);
-  }
-
-  inline int FrValue() const {
-    return this->Bits(kFrShift + kFrBits - 1, kFrShift);
-  }
-
-  inline int WdValue() const {
-    return this->Bits(kWdShift + kWdBits - 1, kWdShift);
-  }
-
-  inline int WsValue() const {
-    return this->Bits(kWsShift + kWsBits - 1, kWsShift);
-  }
-
-  inline int WtValue() const {
-    return this->Bits(kWtShift + kWtBits - 1, kWtShift);
-  }
-
-  inline int Bp2Value() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kRegisterType);
-    return this->Bits(kBp2Shift + kBp2Bits - 1, kBp2Shift);
-  }
-
-  // Float Compare condition code instruction bits.
-  inline int FCccValue() const {
-    return this->Bits(kFCccShift + kFCccBits - 1, kFCccShift);
-  }
-
-  // Float Branch condition code instruction bits.
-  inline int FBccValue() const {
-    return this->Bits(kFBccShift + kFBccBits - 1, kFBccShift);
-  }
-
-  // Float Branch true/false instruction bit.
-  inline int FBtrueValue() const {
-    return this->Bits(kFBtrueShift + kFBtrueBits - 1, kFBtrueShift);
-  }
-
-  // Return the fields at their original place in the instruction encoding.
-  inline Opcode OpcodeFieldRaw() const {
-    return static_cast<Opcode>(this->InstructionBits() & kOpcodeMask);
-  }
-
-  inline int RsFieldRaw() const {
-    DCHECK(this->InstructionType() == InstructionBase::kRegisterType ||
-           this->InstructionType() == InstructionBase::kImmediateType);
-    return this->InstructionBits() & kRsFieldMask;
-  }
-
-  inline int RtFieldRaw() const {
-    DCHECK(this->InstructionType() == InstructionBase::kRegisterType ||
-           this->InstructionType() == InstructionBase::kImmediateType);
-    return this->InstructionBits() & kRtFieldMask;
-  }
-
-  inline int RdFieldRaw() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kRegisterType);
-    return this->InstructionBits() & kRdFieldMask;
-  }
-
-  inline int SaFieldRaw() const {
-    return this->InstructionBits() & kSaFieldMask;
-  }
-
-  inline int FunctionFieldRaw() const {
-    return this->InstructionBits() & kFunctionFieldMask;
-  }
-
-  // Get the secondary field according to the opcode.
-  inline int SecondaryValue() const {
-    Opcode op = this->OpcodeFieldRaw();
-    switch (op) {
-      case SPECIAL:
-      case SPECIAL2:
-        return FunctionValue();
-      case COP1:
-        return RsValue();
-      case REGIMM:
-        return RtValue();
-      default:
-        return nullptrSF;
-    }
-  }
-
-  inline int32_t ImmValue(int bits) const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kImmediateType);
-    return this->Bits(bits - 1, 0);
-  }
-
-  inline int32_t Imm9Value() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kImmediateType);
-    return this->Bits(kImm9Shift + kImm9Bits - 1, kImm9Shift);
-  }
-
-  inline int32_t Imm16Value() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kImmediateType);
-    return this->Bits(kImm16Shift + kImm16Bits - 1, kImm16Shift);
-  }
-
-  inline int32_t Imm18Value() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kImmediateType);
-    return this->Bits(kImm18Shift + kImm18Bits - 1, kImm18Shift);
-  }
-
-  inline int32_t Imm19Value() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kImmediateType);
-    return this->Bits(kImm19Shift + kImm19Bits - 1, kImm19Shift);
-  }
-
-  inline int32_t Imm21Value() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kImmediateType);
-    return this->Bits(kImm21Shift + kImm21Bits - 1, kImm21Shift);
-  }
-
-  inline int32_t Imm26Value() const {
-    DCHECK((this->InstructionType() == InstructionBase::kJumpType) ||
-           (this->InstructionType() == InstructionBase::kImmediateType));
-    return this->Bits(kImm26Shift + kImm26Bits - 1, kImm26Shift);
-  }
-
-  inline int32_t MsaImm8Value() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kImmediateType);
-    return this->Bits(kMsaImm8Shift + kMsaImm8Bits - 1, kMsaImm8Shift);
-  }
-
-  inline int32_t MsaImm5Value() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kImmediateType);
-    return this->Bits(kMsaImm5Shift + kMsaImm5Bits - 1, kMsaImm5Shift);
-  }
-
-  inline int32_t MsaImm10Value() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kImmediateType);
-    return this->Bits(kMsaImm10Shift + kMsaImm10Bits - 1, kMsaImm10Shift);
-  }
-
-  inline int32_t MsaImmMI10Value() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kImmediateType);
-    return this->Bits(kMsaImmMI10Shift + kMsaImmMI10Bits - 1, kMsaImmMI10Shift);
-  }
-
-  inline int32_t MsaBitDf() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kImmediateType);
-    int32_t df_m = this->Bits(22, 16);
-    if (((df_m >> 6) & 1U) == 0) {
-      return 3;
-    } else if (((df_m >> 5) & 3U) == 2) {
-      return 2;
-    } else if (((df_m >> 4) & 7U) == 6) {
-      return 1;
-    } else if (((df_m >> 3) & 15U) == 14) {
-      return 0;
-    } else {
-      return -1;
-    }
-  }
-
-  inline int32_t MsaBitMValue() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kImmediateType);
-    return this->Bits(16 + this->MsaBitDf() + 3, 16);
-  }
-
-  inline int32_t MsaElmDf() const {
-    DCHECK(this->InstructionType() == InstructionBase::kRegisterType ||
-           this->InstructionType() == InstructionBase::kImmediateType);
-    int32_t df_n = this->Bits(21, 16);
-    if (((df_n >> 4) & 3U) == 0) {
-      return 0;
-    } else if (((df_n >> 3) & 7U) == 4) {
-      return 1;
-    } else if (((df_n >> 2) & 15U) == 12) {
-      return 2;
-    } else if (((df_n >> 1) & 31U) == 28) {
-      return 3;
-    } else {
-      return -1;
-    }
-  }
-
-  inline int32_t MsaElmNValue() const {
-    DCHECK(this->InstructionType() == InstructionBase::kRegisterType ||
-           this->InstructionType() == InstructionBase::kImmediateType);
-    return this->Bits(16 + 4 - this->MsaElmDf(), 16);
-  }
-
-  static bool IsForbiddenAfterBranchInstr(Instr instr);
-
-  // Say if the instruction should not be used in a branch delay slot or
-  // immediately after a compact branch.
-  inline bool IsForbiddenAfterBranch() const {
-    return IsForbiddenAfterBranchInstr(this->InstructionBits());
-  }
-
-  inline bool IsForbiddenInBranchDelay() const {
-    return IsForbiddenAfterBranch();
-  }
-
-  // Say if the instruction 'links'. e.g. jal, bal.
-  bool IsLinkingInstruction() const;
-  // Say if the instruction is a break or a trap.
-  bool IsTrap() const;
-
-  inline bool IsMSABranchInstr() const {
-    if (this->OpcodeFieldRaw() == COP1) {
-      switch (this->RsFieldRaw()) {
-        case BZ_V:
-        case BZ_B:
-        case BZ_H:
-        case BZ_W:
-        case BZ_D:
-        case BNZ_V:
-        case BNZ_B:
-        case BNZ_H:
-        case BNZ_W:
-        case BNZ_D:
-          return true;
-        default:
-          return false;
-      }
-    }
-    return false;
-  }
-
-  inline bool IsMSAInstr() const {
-    if (this->IsMSABranchInstr() || (this->OpcodeFieldRaw() == MSA))
-      return true;
-    return false;
-  }
-};
-
-class Instruction : public InstructionGetters<InstructionBase> {
- public:
-  // Instructions are read of out a code stream. The only way to get a
-  // reference to an instruction is to convert a pointer. There is no way
-  // to allocate or create instances of class Instruction.
-  // Use the At(pc) function to create references to Instruction.
-  static Instruction* At(byte* pc) {
-    return reinterpret_cast<Instruction*>(pc);
-  }
-
- private:
-  // We need to prevent the creation of instances of class Instruction.
-  DISALLOW_IMPLICIT_CONSTRUCTORS(Instruction);
-};
-
-
-// -----------------------------------------------------------------------------
-// MIPS assembly various constants.
-
-// C/C++ argument slots size.
-const int kCArgSlotCount = 4;
-const int kCArgsSlotsSize = kCArgSlotCount * Instruction::kInstrSize;
-const int kInvalidStackOffset = -1;
-// JS argument slots size.
-const int kJSArgsSlotsSize = 0 * Instruction::kInstrSize;
-// Assembly builtins argument slots size.
-const int kBArgsSlotsSize = 0 * Instruction::kInstrSize;
-
-const int kBranchReturnOffset = 2 * Instruction::kInstrSize;
-
-InstructionBase::Type InstructionBase::InstructionType() const {
-  switch (OpcodeFieldRaw()) {
-    case SPECIAL:
-      if (FunctionFieldToBitNumber(FunctionFieldRaw()) &
-          kFunctionFieldRegisterTypeMask) {
-        return kRegisterType;
-      }
-      return kUnsupported;
-    case SPECIAL2:
-      switch (FunctionFieldRaw()) {
-        case MUL:
-        case CLZ:
-          return kRegisterType;
-        default:
-          return kUnsupported;
-      }
-      break;
-    case SPECIAL3:
-      switch (FunctionFieldRaw()) {
-        case INS:
-        case EXT:
-          return kRegisterType;
-        case BSHFL: {
-          int sa = SaFieldRaw() >> kSaShift;
-          switch (sa) {
-            case BITSWAP:
-            case WSBH:
-            case SEB:
-            case SEH:
-              return kRegisterType;
-          }
-          sa >>= kBp2Bits;
-          switch (sa) {
-            case ALIGN:
-              return kRegisterType;
-            default:
-              return kUnsupported;
-          }
-        }
-        case LL_R6:
-        case SC_R6: {
-          DCHECK(IsMipsArchVariant(kMips32r6));
-          return kImmediateType;
-        }
-        default:
-          return kUnsupported;
-      }
-      break;
-    case COP1:  // Coprocessor instructions.
-      switch (RsFieldRawNoAssert()) {
-        case BC1:  // Branch on coprocessor condition.
-        case BC1EQZ:
-        case BC1NEZ:
-          return kImmediateType;
-        // MSA Branch instructions
-        case BZ_V:
-        case BNZ_V:
-        case BZ_B:
-        case BZ_H:
-        case BZ_W:
-        case BZ_D:
-        case BNZ_B:
-        case BNZ_H:
-        case BNZ_W:
-        case BNZ_D:
-          return kImmediateType;
-        default:
-          return kRegisterType;
-      }
-      break;
-    case COP1X:
-      return kRegisterType;
-
-    // 26 bits immediate type instructions. e.g.: j imm26.
-    case J:
-    case JAL:
-      return kJumpType;
-
-    case MSA:
-      switch (MSAMinorOpcodeField()) {
-        case kMsaMinor3R:
-        case kMsaMinor3RF:
-        case kMsaMinorVEC:
-        case kMsaMinor2R:
-        case kMsaMinor2RF:
-          return kRegisterType;
-        case kMsaMinorELM:
-          switch (InstructionBits() & kMsaLongerELMMask) {
-            case CFCMSA:
-            case CTCMSA:
-            case MOVE_V:
-              return kRegisterType;
-            default:
-              return kImmediateType;
-          }
-        default:
-          return kImmediateType;
-      }
-
-    default:
-        return kImmediateType;
-  }
-}
-
-#undef OpcodeToBitNumber
-#undef FunctionFieldToBitNumber
-
-// -----------------------------------------------------------------------------
-// Instructions.
-
-template <class P>
-bool InstructionGetters<P>::IsLinkingInstruction() const {
-  uint32_t op = this->OpcodeFieldRaw();
-  switch (op) {
-    case JAL:
-      return true;
-    case POP76:
-      if (this->RsFieldRawNoAssert() == JIALC)
-        return true;  // JIALC
-      else
-        return false;  // BNEZC
-    case REGIMM:
-      switch (this->RtFieldRaw()) {
-        case BGEZAL:
-        case BLTZAL:
-          return true;
-        default:
-          return false;
-      }
-    case SPECIAL:
-      switch (this->FunctionFieldRaw()) {
-        case JALR:
-          return true;
-        default:
-          return false;
-      }
-    default:
-      return false;
-  }
-}
-
-template <class P>
-bool InstructionGetters<P>::IsTrap() const {
-  if (this->OpcodeFieldRaw() != SPECIAL) {
-    return false;
-  } else {
-    switch (this->FunctionFieldRaw()) {
-      case BREAK:
-      case TGE:
-      case TGEU:
-      case TLT:
-      case TLTU:
-      case TEQ:
-      case TNE:
-        return true;
-      default:
-        return false;
-    }
-  }
-}
-
-// static
-template <class T>
-bool InstructionGetters<T>::IsForbiddenAfterBranchInstr(Instr instr) {
-  Opcode opcode = static_cast<Opcode>(instr & kOpcodeMask);
-  switch (opcode) {
-    case J:
-    case JAL:
-    case BEQ:
-    case BNE:
-    case BLEZ:  // POP06 bgeuc/bleuc, blezalc, bgezalc
-    case BGTZ:  // POP07 bltuc/bgtuc, bgtzalc, bltzalc
-    case BEQL:
-    case BNEL:
-    case BLEZL:  // POP26 bgezc, blezc, bgec/blec
-    case BGTZL:  // POP27 bgtzc, bltzc, bltc/bgtc
-    case BC:
-    case BALC:
-    case POP10:  // beqzalc, bovc, beqc
-    case POP30:  // bnezalc, bnvc, bnec
-    case POP66:  // beqzc, jic
-    case POP76:  // bnezc, jialc
-      return true;
-    case REGIMM:
-      switch (instr & kRtFieldMask) {
-        case BLTZ:
-        case BGEZ:
-        case BLTZAL:
-        case BGEZAL:
-          return true;
-        default:
-          return false;
-      }
-      break;
-    case SPECIAL:
-      switch (instr & kFunctionFieldMask) {
-        case JR:
-        case JALR:
-          return true;
-        default:
-          return false;
-      }
-      break;
-    case COP1:
-      switch (instr & kRsFieldMask) {
-        case BC1:
-        case BC1EQZ:
-        case BC1NEZ:
-        case BZ_V:
-        case BZ_B:
-        case BZ_H:
-        case BZ_W:
-        case BZ_D:
-        case BNZ_V:
-        case BNZ_B:
-        case BNZ_H:
-        case BNZ_W:
-        case BNZ_D:
-          return true;
-          break;
-        default:
-          return false;
-      }
-      break;
-    default:
-      return false;
-  }
-}
-}  // namespace internal
-}  // namespace v8
-
-#endif    // #ifndef V8_MIPS_CONSTANTS_H_
diff --git a/src/v8/src/mips/cpu-mips.cc b/src/v8/src/mips/cpu-mips.cc
deleted file mode 100644
index 7662a1d..0000000
--- a/src/v8/src/mips/cpu-mips.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// CPU specific code for arm independent of OS goes here.
-
-// Starboard implementation will use SbMemoryFlush().
-#if !defined(V8_OS_STARBOARD)
-#include <sys/syscall.h>
-#include <unistd.h>
-
-#ifdef __mips
-#include <asm/cachectl.h>
-#endif  // #ifdef __mips
-#endif  // !defined(V8_OS_STARBOARD)
-
-#if V8_TARGET_ARCH_MIPS
-
-#include "src/assembler.h"
-#include "src/macro-assembler.h"
-
-#include "src/simulator.h"  // For cache flushing.
-
-namespace v8 {
-namespace internal {
-
-
-void CpuFeatures::FlushICache(void* start, size_t size) {
-#if !defined(USE_SIMULATOR)
-  // Nothing to do, flushing no instructions.
-  if (size == 0) {
-    return;
-  }
-
-#if defined(ANDROID)
-  // Bionic cacheflush can typically run in userland, avoiding kernel call.
-  char *end = reinterpret_cast<char *>(start) + size;
-  cacheflush(
-    reinterpret_cast<intptr_t>(start), reinterpret_cast<intptr_t>(end), 0);
-#elif defined(V8_OS_STARBOARD)
-  // SbMemoryFlush uses BCACHE as argument for _flush_cache() call.
-  // This should not affect performance, since MIPS kernel only uses BCACHE,
-  // according to:
-  // https://elixir.bootlin.com/linux/latest/source/arch/mips/mm/cache.c#L74
-  SbMemoryFlush(start, size);
-#else  // ANDROID
-  int res;
-  // See http://www.linux-mips.org/wiki/Cacheflush_Syscall.
-  res = syscall(__NR_cacheflush, start, size, ICACHE);
-  if (res) {
-    V8_Fatal(__FILE__, __LINE__, "Failed to flush the instruction cache");
-  }
-#endif  // ANDROID
-#endif  // !USE_SIMULATOR.
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_MIPS
diff --git a/src/v8/src/mips/deoptimizer-mips.cc b/src/v8/src/mips/deoptimizer-mips.cc
deleted file mode 100644
index 0784404..0000000
--- a/src/v8/src/mips/deoptimizer-mips.cc
+++ /dev/null
@@ -1,335 +0,0 @@
-// Copyright 2011 the V8 project 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 "src/assembler-inl.h"
-#include "src/deoptimizer.h"
-#include "src/register-configuration.h"
-#include "src/safepoint-table.h"
-
-namespace v8 {
-namespace internal {
-
-
-#define __ masm()->
-
-
-// This code tries to be close to ia32 code so that any changes can be
-// easily ported.
-void Deoptimizer::TableEntryGenerator::Generate() {
-  GeneratePrologue();
-
-  // Unlike on ARM we don't save all the registers, just the useful ones.
-  // For the rest, there are gaps on the stack, so the offsets remain the same.
-  const int kNumberOfRegisters = Register::kNumRegisters;
-
-  RegList restored_regs = kJSCallerSaved | kCalleeSaved;
-  RegList saved_regs = restored_regs | sp.bit() | ra.bit();
-
-  const int kDoubleRegsSize = kDoubleSize * DoubleRegister::kNumRegisters;
-  const int kFloatRegsSize = kFloatSize * FloatRegister::kNumRegisters;
-
-  // Save all FPU registers before messing with them.
-  __ Subu(sp, sp, Operand(kDoubleRegsSize));
-  const RegisterConfiguration* config = RegisterConfiguration::Default();
-  for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
-    int code = config->GetAllocatableDoubleCode(i);
-    const DoubleRegister fpu_reg = DoubleRegister::from_code(code);
-    int offset = code * kDoubleSize;
-    __ Sdc1(fpu_reg, MemOperand(sp, offset));
-  }
-
-  __ Subu(sp, sp, Operand(kFloatRegsSize));
-  for (int i = 0; i < config->num_allocatable_float_registers(); ++i) {
-    int code = config->GetAllocatableFloatCode(i);
-    const FloatRegister fpu_reg = FloatRegister::from_code(code);
-    int offset = code * kFloatSize;
-    __ swc1(fpu_reg, MemOperand(sp, offset));
-  }
-
-  // Push saved_regs (needed to populate FrameDescription::registers_).
-  // Leave gaps for other registers.
-  __ Subu(sp, sp, kNumberOfRegisters * kPointerSize);
-  for (int16_t i = kNumberOfRegisters - 1; i >= 0; i--) {
-    if ((saved_regs & (1 << i)) != 0) {
-      __ sw(ToRegister(i), MemOperand(sp, kPointerSize * i));
-    }
-  }
-
-  __ li(a2, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress,
-                                      isolate())));
-  __ sw(fp, MemOperand(a2));
-
-  const int kSavedRegistersAreaSize =
-      (kNumberOfRegisters * kPointerSize) + kDoubleRegsSize + kFloatRegsSize;
-
-  // Get the bailout id from the stack.
-  __ lw(a2, MemOperand(sp, kSavedRegistersAreaSize));
-
-  // Get the address of the location in the code object (a3) (return
-  // address for lazy deoptimization) and compute the fp-to-sp delta in
-  // register t0.
-  __ mov(a3, ra);
-  // Correct one word for bailout id.
-  __ Addu(t0, sp, Operand(kSavedRegistersAreaSize + (1 * kPointerSize)));
-
-  __ Subu(t0, fp, t0);
-
-  // Allocate a new deoptimizer object.
-  __ PrepareCallCFunction(6, t1);
-  // Pass four arguments in a0 to a3 and fifth & sixth arguments on stack.
-  __ mov(a0, zero_reg);
-  Label context_check;
-  __ lw(a1, MemOperand(fp, CommonFrameConstants::kContextOrFrameTypeOffset));
-  __ JumpIfSmi(a1, &context_check);
-  __ lw(a0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
-  __ bind(&context_check);
-  __ li(a1, Operand(type()));  // Bailout type.
-  // a2: bailout id already loaded.
-  // a3: code address or 0 already loaded.
-  __ sw(t0, CFunctionArgumentOperand(5));  // Fp-to-sp delta.
-  __ li(t1, Operand(ExternalReference::isolate_address(isolate())));
-  __ sw(t1, CFunctionArgumentOperand(6));  // Isolate.
-  // Call Deoptimizer::New().
-  {
-    AllowExternalCallThatCantCauseGC scope(masm());
-    __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate()), 6);
-  }
-
-  // Preserve "deoptimizer" object in register v0 and get the input
-  // frame descriptor pointer to a1 (deoptimizer->input_);
-  // Move deopt-obj to a0 for call to Deoptimizer::ComputeOutputFrames() below.
-  __ mov(a0, v0);
-  __ lw(a1, MemOperand(v0, Deoptimizer::input_offset()));
-
-  // Copy core registers into FrameDescription::registers_[kNumRegisters].
-  DCHECK_EQ(Register::kNumRegisters, kNumberOfRegisters);
-  for (int i = 0; i < kNumberOfRegisters; i++) {
-    int offset = (i * kPointerSize) + FrameDescription::registers_offset();
-    if ((saved_regs & (1 << i)) != 0) {
-      __ lw(a2, MemOperand(sp, i * kPointerSize));
-      __ sw(a2, MemOperand(a1, offset));
-    } else if (FLAG_debug_code) {
-      __ li(a2, kDebugZapValue);
-      __ sw(a2, MemOperand(a1, offset));
-    }
-  }
-
-  int double_regs_offset = FrameDescription::double_registers_offset();
-  // Copy FPU registers to
-  // double_registers_[DoubleRegister::kNumAllocatableRegisters]
-  for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
-    int code = config->GetAllocatableDoubleCode(i);
-    int dst_offset = code * kDoubleSize + double_regs_offset;
-    int src_offset =
-        code * kDoubleSize + kNumberOfRegisters * kPointerSize + kFloatRegsSize;
-    __ Ldc1(f0, MemOperand(sp, src_offset));
-    __ Sdc1(f0, MemOperand(a1, dst_offset));
-  }
-
-  // Copy FPU registers to
-  // float_registers_[FloatRegister::kNumAllocatableRegisters]
-  int float_regs_offset = FrameDescription::float_registers_offset();
-  for (int i = 0; i < config->num_allocatable_float_registers(); ++i) {
-    int code = config->GetAllocatableFloatCode(i);
-    int dst_offset = code * kFloatSize + float_regs_offset;
-    int src_offset = code * kFloatSize + kNumberOfRegisters * kPointerSize;
-    __ lwc1(f0, MemOperand(sp, src_offset));
-    __ swc1(f0, MemOperand(a1, dst_offset));
-  }
-
-  // Remove the bailout id and the saved registers from the stack.
-  __ Addu(sp, sp, Operand(kSavedRegistersAreaSize + (1 * kPointerSize)));
-
-  // Compute a pointer to the unwinding limit in register a2; that is
-  // the first stack slot not part of the input frame.
-  __ lw(a2, MemOperand(a1, FrameDescription::frame_size_offset()));
-  __ Addu(a2, a2, sp);
-
-  // Unwind the stack down to - but not including - the unwinding
-  // limit and copy the contents of the activation frame to the input
-  // frame description.
-  __ Addu(a3, a1, Operand(FrameDescription::frame_content_offset()));
-  Label pop_loop;
-  Label pop_loop_header;
-  __ BranchShort(&pop_loop_header);
-  __ bind(&pop_loop);
-  __ pop(t0);
-  __ sw(t0, MemOperand(a3, 0));
-  __ addiu(a3, a3, sizeof(uint32_t));
-  __ bind(&pop_loop_header);
-  __ BranchShort(&pop_loop, ne, a2, Operand(sp));
-
-  // Compute the output frame in the deoptimizer.
-  __ push(a0);  // Preserve deoptimizer object across call.
-  // a0: deoptimizer object; a1: scratch.
-  __ PrepareCallCFunction(1, a1);
-  // Call Deoptimizer::ComputeOutputFrames().
-  {
-    AllowExternalCallThatCantCauseGC scope(masm());
-    __ CallCFunction(
-        ExternalReference::compute_output_frames_function(isolate()), 1);
-  }
-  __ pop(a0);  // Restore deoptimizer object (class Deoptimizer).
-
-  __ lw(sp, MemOperand(a0, Deoptimizer::caller_frame_top_offset()));
-
-  // Replace the current (input) frame with the output frames.
-  Label outer_push_loop, inner_push_loop,
-      outer_loop_header, inner_loop_header;
-  // Outer loop state: t0 = current "FrameDescription** output_",
-  // a1 = one past the last FrameDescription**.
-  __ lw(a1, MemOperand(a0, Deoptimizer::output_count_offset()));
-  __ lw(t0, MemOperand(a0, Deoptimizer::output_offset()));  // t0 is output_.
-  __ Lsa(a1, t0, a1, kPointerSizeLog2);
-  __ BranchShort(&outer_loop_header);
-  __ bind(&outer_push_loop);
-  // Inner loop state: a2 = current FrameDescription*, a3 = loop index.
-  __ lw(a2, MemOperand(t0, 0));  // output_[ix]
-  __ lw(a3, MemOperand(a2, FrameDescription::frame_size_offset()));
-  __ BranchShort(&inner_loop_header);
-  __ bind(&inner_push_loop);
-  __ Subu(a3, a3, Operand(sizeof(uint32_t)));
-  __ Addu(t2, a2, Operand(a3));
-  __ lw(t3, MemOperand(t2, FrameDescription::frame_content_offset()));
-  __ push(t3);
-  __ bind(&inner_loop_header);
-  __ BranchShort(&inner_push_loop, ne, a3, Operand(zero_reg));
-
-  __ Addu(t0, t0, Operand(kPointerSize));
-  __ bind(&outer_loop_header);
-  __ BranchShort(&outer_push_loop, lt, t0, Operand(a1));
-
-  __ lw(a1, MemOperand(a0, Deoptimizer::input_offset()));
-  for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
-    int code = config->GetAllocatableDoubleCode(i);
-    const DoubleRegister fpu_reg = DoubleRegister::from_code(code);
-    int src_offset = code * kDoubleSize + double_regs_offset;
-    __ Ldc1(fpu_reg, MemOperand(a1, src_offset));
-  }
-
-  // Push pc and continuation from the last output frame.
-  __ lw(t2, MemOperand(a2, FrameDescription::pc_offset()));
-  __ push(t2);
-  __ lw(t2, MemOperand(a2, FrameDescription::continuation_offset()));
-  __ push(t2);
-
-
-  // Technically restoring 'at' should work unless zero_reg is also restored
-  // but it's safer to check for this.
-  DCHECK(!(at.bit() & restored_regs));
-  // Restore the registers from the last output frame.
-  __ mov(at, a2);
-  for (int i = kNumberOfRegisters - 1; i >= 0; i--) {
-    int offset = (i * kPointerSize) + FrameDescription::registers_offset();
-    if ((restored_regs & (1 << i)) != 0) {
-      __ lw(ToRegister(i), MemOperand(at, offset));
-    }
-  }
-
-  __ InitializeRootRegister();
-
-  __ pop(at);  // Get continuation, leave pc on stack.
-  __ pop(ra);
-  __ Jump(at);
-  __ stop("Unreachable.");
-}
-
-
-// Maximum size of a table entry generated below.
-#ifdef _MIPS_ARCH_MIPS32R6
-const int Deoptimizer::table_entry_size_ = 2 * Assembler::kInstrSize;
-#else
-const int Deoptimizer::table_entry_size_ = 3 * Assembler::kInstrSize;
-#endif
-
-void Deoptimizer::TableEntryGenerator::GeneratePrologue() {
-  Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm());
-
-  // Create a sequence of deoptimization entries.
-  // Note that registers are still live when jumping to an entry.
-  Label table_start, done, trampoline_jump;
-  __ bind(&table_start);
-
-#ifdef _MIPS_ARCH_MIPS32R6
-  int kMaxEntriesBranchReach =
-      (1 << (kImm26Bits - 2)) / (table_entry_size_ / Assembler::kInstrSize);
-#else
-  int kMaxEntriesBranchReach = (1 << (kImm16Bits - 2))/
-     (table_entry_size_ /  Assembler::kInstrSize);
-#endif
-
-  if (count() <= kMaxEntriesBranchReach) {
-    // Common case.
-    for (int i = 0; i < count(); i++) {
-      Label start;
-      __ bind(&start);
-      DCHECK(is_int16(i));
-      if (IsMipsArchVariant(kMips32r6)) {
-        __ li(at, i);
-        __ BranchShort(PROTECT, &done);
-      } else {
-        __ BranchShort(USE_DELAY_SLOT, &done);  // Expose delay slot.
-        __ li(at, i);                           // In the delay slot.
-        __ nop();
-      }
-      DCHECK_EQ(table_entry_size_, masm()->SizeOfCodeGeneratedSince(&start));
-    }
-
-    DCHECK_EQ(masm()->SizeOfCodeGeneratedSince(&table_start),
-        count() * table_entry_size_);
-    __ bind(&done);
-    __ Push(at);
-  } else {
-    DCHECK(!IsMipsArchVariant(kMips32r6));
-    // Uncommon case, the branch cannot reach.
-    // Create mini trampoline to reach the end of the table
-    for (int i = 0, j = 0; i < count(); i++, j++) {
-      Label start;
-      __ bind(&start);
-      DCHECK(is_int16(i));
-      if (j >= kMaxEntriesBranchReach) {
-        j = 0;
-        __ li(at, i);
-        __ bind(&trampoline_jump);
-        trampoline_jump = Label();
-        __ BranchShort(USE_DELAY_SLOT, &trampoline_jump);
-        __ nop();
-      } else {
-        __ BranchShort(USE_DELAY_SLOT, &trampoline_jump);  // Expose delay slot.
-        __ li(at, i);                                      // In the delay slot.
-        __ nop();
-      }
-      DCHECK_EQ(table_entry_size_, masm()->SizeOfCodeGeneratedSince(&start));
-    }
-
-    DCHECK_EQ(masm()->SizeOfCodeGeneratedSince(&table_start),
-        count() * table_entry_size_);
-    __ bind(&trampoline_jump);
-    __ Push(at);
-  }
-}
-
-bool Deoptimizer::PadTopOfStackRegister() { return false; }
-
-void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) {
-  SetFrameSlot(offset, value);
-}
-
-
-void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) {
-  SetFrameSlot(offset, value);
-}
-
-
-void FrameDescription::SetCallerConstantPool(unsigned offset, intptr_t value) {
-  // No embedded constant pool support.
-  UNREACHABLE();
-}
-
-
-#undef __
-
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/mips/disasm-mips.cc b/src/v8/src/mips/disasm-mips.cc
deleted file mode 100644
index f27bdc9..0000000
--- a/src/v8/src/mips/disasm-mips.cc
+++ /dev/null
@@ -1,2792 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// A Disassembler object is used to disassemble a block of code instruction by
-// instruction. The default implementation of the NameConverter object can be
-// overriden to modify register names or to do symbol lookup on addresses.
-//
-// The example below will disassemble a block of code and print it to stdout.
-//
-//   NameConverter converter;
-//   Disassembler d(converter);
-//   for (byte* pc = begin; pc < end;) {
-//     v8::internal::EmbeddedVector<char, 256> buffer;
-//     byte* prev_pc = pc;
-//     pc += d.InstructionDecode(buffer, pc);
-//     printf("%p    %08x      %s\n",
-//            prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer);
-//   }
-//
-// The Disassembler class also has a convenience method to disassemble a block
-// of code into a FILE*, meaning that the above functionality could also be
-// achieved by just calling Disassembler::Disassemble(stdout, begin, end);
-
-#include <assert.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <string.h>
-
-#if V8_TARGET_ARCH_MIPS
-
-#include "src/base/platform/platform.h"
-#include "src/disasm.h"
-#include "src/macro-assembler.h"
-#include "src/mips/constants-mips.h"
-
-namespace v8 {
-namespace internal {
-
-//------------------------------------------------------------------------------
-
-// Decoder decodes and disassembles instructions into an output buffer.
-// It uses the converter to convert register names and call destinations into
-// more informative description.
-class Decoder {
- public:
-  Decoder(const disasm::NameConverter& converter,
-          v8::internal::Vector<char> out_buffer)
-    : converter_(converter),
-      out_buffer_(out_buffer),
-      out_buffer_pos_(0) {
-    out_buffer_[out_buffer_pos_] = '\0';
-  }
-
-  ~Decoder() {}
-
-  // Writes one disassembled instruction into 'buffer' (0-terminated).
-  // Returns the length of the disassembled machine instruction in bytes.
-  int InstructionDecode(byte* instruction);
-
- private:
-  // Bottleneck functions to print into the out_buffer.
-  void PrintChar(const char ch);
-  void Print(const char* str);
-
-  // Printing of common values.
-  void PrintRegister(int reg);
-  void PrintFPURegister(int freg);
-  void PrintMSARegister(int wreg);
-  void PrintFPUStatusRegister(int freg);
-  void PrintMSAControlRegister(int creg);
-  void PrintRs(Instruction* instr);
-  void PrintRt(Instruction* instr);
-  void PrintRd(Instruction* instr);
-  void PrintFs(Instruction* instr);
-  void PrintFt(Instruction* instr);
-  void PrintFd(Instruction* instr);
-  void PrintSa(Instruction* instr);
-  void PrintLsaSa(Instruction* instr);
-  void PrintSd(Instruction* instr);
-  void PrintSs1(Instruction* instr);
-  void PrintSs2(Instruction* instr);
-  void PrintBc(Instruction* instr);
-  void PrintCc(Instruction* instr);
-  void PrintBp2(Instruction* instr);
-  void PrintFunction(Instruction* instr);
-  void PrintSecondaryField(Instruction* instr);
-  void PrintUImm9(Instruction* instr);
-  void PrintSImm9(Instruction* instr);
-  void PrintUImm16(Instruction* instr);
-  void PrintSImm16(Instruction* instr);
-  void PrintXImm16(Instruction* instr);
-  void PrintPCImm16(Instruction* instr, int delta_pc, int n_bits);
-  void PrintXImm18(Instruction* instr);
-  void PrintSImm18(Instruction* instr);
-  void PrintXImm19(Instruction* instr);
-  void PrintSImm19(Instruction* instr);
-  void PrintXImm21(Instruction* instr);
-  void PrintSImm21(Instruction* instr);
-  void PrintPCImm21(Instruction* instr, int delta_pc, int n_bits);
-  void PrintXImm26(Instruction* instr);
-  void PrintSImm26(Instruction* instr);
-  void PrintPCImm26(Instruction* instr, int delta_pc, int n_bits);
-  void PrintPCImm26(Instruction* instr);
-  void PrintCode(Instruction* instr);   // For break and trap instructions.
-  void PrintFormat(Instruction* instr);  // For floating format postfix.
-  void PrintMsaDataFormat(Instruction* instr);
-  void PrintMsaXImm8(Instruction* instr);
-  void PrintMsaImm8(Instruction* instr);
-  void PrintMsaImm5(Instruction* instr);
-  void PrintMsaSImm5(Instruction* instr);
-  void PrintMsaSImm10(Instruction* instr, bool is_mi10 = false);
-  void PrintMsaImmBit(Instruction* instr);
-  void PrintMsaImmElm(Instruction* instr);
-  void PrintMsaCopy(Instruction* instr);
-  // Printing of instruction name.
-  void PrintInstructionName(Instruction* instr);
-
-  // Handle formatting of instructions and their options.
-  int FormatRegister(Instruction* instr, const char* option);
-  int FormatFPURegister(Instruction* instr, const char* option);
-  int FormatMSARegister(Instruction* instr, const char* option);
-  int FormatOption(Instruction* instr, const char* option);
-  void Format(Instruction* instr, const char* format);
-  void Unknown(Instruction* instr);
-
-
-  // Each of these functions decodes one particular instruction type.
-  bool DecodeTypeRegisterRsType(Instruction* instr);
-  void DecodeTypeRegisterSRsType(Instruction* instr);
-  void DecodeTypeRegisterDRsType(Instruction* instr);
-  void DecodeTypeRegisterLRsType(Instruction* instr);
-  void DecodeTypeRegisterWRsType(Instruction* instr);
-  void DecodeTypeRegisterSPECIAL(Instruction* instr);
-  void DecodeTypeRegisterSPECIAL2(Instruction* instr);
-  void DecodeTypeRegisterSPECIAL3(Instruction* instr);
-  void DecodeTypeRegister(Instruction* instr);
-  void DecodeTypeImmediate(Instruction* instr);
-  void DecodeTypeImmediateSPECIAL3(Instruction* instr);
-  void DecodeTypeJump(Instruction* instr);
-  void DecodeTypeMsaI8(Instruction* instr);
-  void DecodeTypeMsaI5(Instruction* instr);
-  void DecodeTypeMsaI10(Instruction* instr);
-  void DecodeTypeMsaELM(Instruction* instr);
-  void DecodeTypeMsaBIT(Instruction* instr);
-  void DecodeTypeMsaMI10(Instruction* instr);
-  void DecodeTypeMsa3R(Instruction* instr);
-  void DecodeTypeMsa3RF(Instruction* instr);
-  void DecodeTypeMsaVec(Instruction* instr);
-  void DecodeTypeMsa2R(Instruction* instr);
-  void DecodeTypeMsa2RF(Instruction* instr);
-
-  const disasm::NameConverter& converter_;
-  v8::internal::Vector<char> out_buffer_;
-  int out_buffer_pos_;
-
-  DISALLOW_COPY_AND_ASSIGN(Decoder);
-};
-
-
-// Support for assertions in the Decoder formatting functions.
-#define STRING_STARTS_WITH(string, compare_string) \
-  (strncmp(string, compare_string, strlen(compare_string)) == 0)
-
-
-// Append the ch to the output buffer.
-void Decoder::PrintChar(const char ch) {
-  out_buffer_[out_buffer_pos_++] = ch;
-}
-
-
-// Append the str to the output buffer.
-void Decoder::Print(const char* str) {
-  char cur = *str++;
-  while (cur != '\0' && (out_buffer_pos_ < (out_buffer_.length() - 1))) {
-    PrintChar(cur);
-    cur = *str++;
-  }
-  out_buffer_[out_buffer_pos_] = 0;
-}
-
-
-// Print the register name according to the active name converter.
-void Decoder::PrintRegister(int reg) {
-  Print(converter_.NameOfCPURegister(reg));
-}
-
-
-void Decoder::PrintRs(Instruction* instr) {
-  int reg = instr->RsValue();
-  PrintRegister(reg);
-}
-
-
-void Decoder::PrintRt(Instruction* instr) {
-  int reg = instr->RtValue();
-  PrintRegister(reg);
-}
-
-
-void Decoder::PrintRd(Instruction* instr) {
-  int reg = instr->RdValue();
-  PrintRegister(reg);
-}
-
-
-// Print the FPUregister name according to the active name converter.
-void Decoder::PrintFPURegister(int freg) {
-  Print(converter_.NameOfXMMRegister(freg));
-}
-
-void Decoder::PrintMSARegister(int wreg) { Print(MSARegisters::Name(wreg)); }
-
-void Decoder::PrintFPUStatusRegister(int freg) {
-  switch (freg) {
-    case kFCSRRegister:
-      Print("FCSR");
-      break;
-    default:
-      Print(converter_.NameOfXMMRegister(freg));
-  }
-}
-
-void Decoder::PrintMSAControlRegister(int creg) {
-  switch (creg) {
-    case kMSAIRRegister:
-      Print("MSAIR");
-      break;
-    case kMSACSRRegister:
-      Print("MSACSR");
-      break;
-    default:
-      Print("no_msacreg");
-  }
-}
-
-void Decoder::PrintFs(Instruction* instr) {
-  int freg = instr->RsValue();
-  PrintFPURegister(freg);
-}
-
-
-void Decoder::PrintFt(Instruction* instr) {
-  int freg = instr->RtValue();
-  PrintFPURegister(freg);
-}
-
-
-void Decoder::PrintFd(Instruction* instr) {
-  int freg = instr->RdValue();
-  PrintFPURegister(freg);
-}
-
-
-// Print the integer value of the sa field.
-void Decoder::PrintSa(Instruction* instr) {
-  int sa = instr->SaValue();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", sa);
-}
-
-
-// Print the integer value of the sa field of a lsa instruction.
-void Decoder::PrintLsaSa(Instruction* instr) {
-  int sa = instr->LsaSaValue() + 1;
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", sa);
-}
-
-
-// Print the integer value of the rd field, when it is not used as reg.
-void Decoder::PrintSd(Instruction* instr) {
-  int sd = instr->RdValue();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", sd);
-}
-
-
-// Print the integer value of the rd field, when used as 'ext' size.
-void Decoder::PrintSs1(Instruction* instr) {
-  int ss = instr->RdValue();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", ss + 1);
-}
-
-
-// Print the integer value of the rd field, when used as 'ins' size.
-void Decoder::PrintSs2(Instruction* instr) {
-  int ss = instr->RdValue();
-  int pos = instr->SaValue();
-  out_buffer_pos_ +=
-      SNPrintF(out_buffer_ + out_buffer_pos_, "%d", ss - pos + 1);
-}
-
-
-// Print the integer value of the cc field for the bc1t/f instructions.
-void Decoder::PrintBc(Instruction* instr) {
-  int cc = instr->FBccValue();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", cc);
-}
-
-
-// Print the integer value of the cc field for the FP compare instructions.
-void Decoder::PrintCc(Instruction* instr) {
-  int cc = instr->FCccValue();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "cc(%d)", cc);
-}
-
-
-void Decoder::PrintBp2(Instruction* instr) {
-  int bp2 = instr->Bp2Value();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", bp2);
-}
-
-// Print 9-bit unsigned immediate value.
-void Decoder::PrintUImm9(Instruction* instr) {
-  int32_t imm = instr->Imm9Value();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%u", imm);
-}
-
-// Print 9-bit signed immediate value.
-void Decoder::PrintSImm9(Instruction* instr) {
-  int32_t imm = ((instr->Imm9Value()) << 23) >> 23;
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", imm);
-}
-
-// Print 16-bit unsigned immediate value.
-void Decoder::PrintUImm16(Instruction* instr) {
-  int32_t imm = instr->Imm16Value();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%u", imm);
-}
-
-
-// Print 16-bit signed immediate value.
-void Decoder::PrintSImm16(Instruction* instr) {
-  int32_t imm = ((instr->Imm16Value()) << 16) >> 16;
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", imm);
-}
-
-
-// Print 16-bit hexa immediate value.
-void Decoder::PrintXImm16(Instruction* instr) {
-  int32_t imm = instr->Imm16Value();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "0x%x", imm);
-}
-
-
-// Print absoulte address for 16-bit offset or immediate value.
-// The absolute address is calculated according following expression:
-//      PC + delta_pc + (offset << n_bits)
-void Decoder::PrintPCImm16(Instruction* instr, int delta_pc, int n_bits) {
-  int16_t offset = instr->Imm16Value();
-  out_buffer_pos_ +=
-      SNPrintF(out_buffer_ + out_buffer_pos_, "%s",
-               converter_.NameOfAddress(reinterpret_cast<byte*>(instr) +
-                                        delta_pc + (offset << n_bits)));
-}
-
-
-// Print 18-bit signed immediate value.
-void Decoder::PrintSImm18(Instruction* instr) {
-  int32_t imm =
-      ((instr->Imm18Value()) << (32 - kImm18Bits)) >> (32 - kImm18Bits);
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", imm);
-}
-
-
-// Print 18-bit hexa immediate value.
-void Decoder::PrintXImm18(Instruction* instr) {
-  int32_t imm = instr->Imm18Value();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "0x%x", imm);
-}
-
-
-// Print 19-bit hexa immediate value.
-void Decoder::PrintXImm19(Instruction* instr) {
-  int32_t imm = instr->Imm19Value();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "0x%x", imm);
-}
-
-
-// Print 19-bit signed immediate value.
-void Decoder::PrintSImm19(Instruction* instr) {
-  int32_t imm19 = instr->Imm19Value();
-  // set sign
-  imm19 <<= (32 - kImm19Bits);
-  imm19 >>= (32 - kImm19Bits);
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", imm19);
-}
-
-
-// Print 21-bit immediate value.
-void Decoder::PrintXImm21(Instruction* instr) {
-  uint32_t imm = instr->Imm21Value();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "0x%x", imm);
-}
-
-
-// Print 21-bit signed immediate value.
-void Decoder::PrintSImm21(Instruction* instr) {
-  int32_t imm21 = instr->Imm21Value();
-  // set sign
-  imm21 <<= (32 - kImm21Bits);
-  imm21 >>= (32 - kImm21Bits);
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", imm21);
-}
-
-
-// Print absoulte address for 21-bit offset or immediate value.
-// The absolute address is calculated according following expression:
-//      PC + delta_pc + (offset << n_bits)
-void Decoder::PrintPCImm21(Instruction* instr, int delta_pc, int n_bits) {
-  int32_t imm21 = instr->Imm21Value();
-  // set sign
-  imm21 <<= (32 - kImm21Bits);
-  imm21 >>= (32 - kImm21Bits);
-  out_buffer_pos_ +=
-      SNPrintF(out_buffer_ + out_buffer_pos_, "%s",
-               converter_.NameOfAddress(reinterpret_cast<byte*>(instr) +
-                                        delta_pc + (imm21 << n_bits)));
-}
-
-
-// Print 26-bit hex immediate value.
-void Decoder::PrintXImm26(Instruction* instr) {
-  uint32_t target = static_cast<uint32_t>(instr->Imm26Value())
-                    << kImmFieldShift;
-  target = (reinterpret_cast<uint32_t>(instr) & ~0xFFFFFFF) | target;
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "0x%x", target);
-}
-
-
-// Print 26-bit signed immediate value.
-void Decoder::PrintSImm26(Instruction* instr) {
-  int32_t imm26 = instr->Imm26Value();
-  // set sign
-  imm26 <<= (32 - kImm26Bits);
-  imm26 >>= (32 - kImm26Bits);
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", imm26);
-}
-
-
-// Print absoulte address for 26-bit offset or immediate value.
-// The absolute address is calculated according following expression:
-//      PC + delta_pc + (offset << n_bits)
-void Decoder::PrintPCImm26(Instruction* instr, int delta_pc, int n_bits) {
-  int32_t imm26 = instr->Imm26Value();
-  // set sign
-  imm26 <<= (32 - kImm26Bits);
-  imm26 >>= (32 - kImm26Bits);
-  out_buffer_pos_ +=
-      SNPrintF(out_buffer_ + out_buffer_pos_, "%s",
-               converter_.NameOfAddress(reinterpret_cast<byte*>(instr) +
-                                        delta_pc + (imm26 << n_bits)));
-}
-
-
-// Print absoulte address for 26-bit offset or immediate value.
-// The absolute address is calculated according following expression:
-//      PC[GPRLEN-1 .. 28] || instr_index26 || 00
-void Decoder::PrintPCImm26(Instruction* instr) {
-  int32_t imm26 = instr->Imm26Value();
-  uint32_t pc_mask = ~0xFFFFFFF;
-  uint32_t pc = ((uint32_t)(instr + 1) & pc_mask) | (imm26 << 2);
-  out_buffer_pos_ +=
-      SNPrintF(out_buffer_ + out_buffer_pos_, "%s",
-               converter_.NameOfAddress((reinterpret_cast<byte*>(pc))));
-}
-
-
-// Print 26-bit immediate value.
-void Decoder::PrintCode(Instruction* instr) {
-  if (instr->OpcodeFieldRaw() != SPECIAL)
-    return;  // Not a break or trap instruction.
-  switch (instr->FunctionFieldRaw()) {
-    case BREAK: {
-      int32_t code = instr->Bits(25, 6);
-      out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                  "0x%05x (%d)", code, code);
-      break;
-                }
-    case TGE:
-    case TGEU:
-    case TLT:
-    case TLTU:
-    case TEQ:
-    case TNE: {
-      int32_t code = instr->Bits(15, 6);
-      out_buffer_pos_ +=
-          SNPrintF(out_buffer_ + out_buffer_pos_, "0x%03x", code);
-      break;
-    }
-    default:  // Not a break or trap instruction.
-    break;
-  }
-}
-
-void Decoder::PrintMsaXImm8(Instruction* instr) {
-  int32_t imm = instr->MsaImm8Value();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "0x%x", imm);
-}
-
-void Decoder::PrintMsaImm8(Instruction* instr) {
-  int32_t imm = instr->MsaImm8Value();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%u", imm);
-}
-
-void Decoder::PrintMsaImm5(Instruction* instr) {
-  int32_t imm = instr->MsaImm5Value();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%u", imm);
-}
-
-void Decoder::PrintMsaSImm5(Instruction* instr) {
-  int32_t imm = instr->MsaImm5Value();
-  imm <<= (32 - kMsaImm5Bits);
-  imm >>= (32 - kMsaImm5Bits);
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", imm);
-}
-
-void Decoder::PrintMsaSImm10(Instruction* instr, bool is_mi10) {
-  int32_t imm = is_mi10 ? instr->MsaImmMI10Value() : instr->MsaImm10Value();
-  imm <<= (32 - kMsaImm10Bits);
-  imm >>= (32 - kMsaImm10Bits);
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", imm);
-}
-
-void Decoder::PrintMsaImmBit(Instruction* instr) {
-  int32_t m = instr->MsaBitMValue();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%u", m);
-}
-
-void Decoder::PrintMsaImmElm(Instruction* instr) {
-  int32_t n = instr->MsaElmNValue();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%u", n);
-}
-
-void Decoder::PrintMsaCopy(Instruction* instr) {
-  int32_t rd = instr->WdValue();
-  int32_t ws = instr->WsValue();
-  int32_t n = instr->MsaElmNValue();
-  out_buffer_pos_ +=
-      SNPrintF(out_buffer_ + out_buffer_pos_, "%s, %s[%u]",
-               converter_.NameOfCPURegister(rd), MSARegisters::Name(ws), n);
-}
-
-void Decoder::PrintFormat(Instruction* instr) {
-  char formatLetter = ' ';
-  switch (instr->RsFieldRaw()) {
-    case S:
-      formatLetter = 's';
-      break;
-    case D:
-      formatLetter = 'd';
-      break;
-    case W:
-      formatLetter = 'w';
-      break;
-    case L:
-      formatLetter = 'l';
-      break;
-    default:
-      UNREACHABLE();
-      break;
-  }
-  PrintChar(formatLetter);
-}
-
-void Decoder::PrintMsaDataFormat(Instruction* instr) {
-  DCHECK(instr->IsMSAInstr());
-  char df = ' ';
-  if (instr->IsMSABranchInstr()) {
-    switch (instr->RsFieldRaw()) {
-      case BZ_V:
-      case BNZ_V:
-        df = 'v';
-        break;
-      case BZ_B:
-      case BNZ_B:
-        df = 'b';
-        break;
-      case BZ_H:
-      case BNZ_H:
-        df = 'h';
-        break;
-      case BZ_W:
-      case BNZ_W:
-        df = 'w';
-        break;
-      case BZ_D:
-      case BNZ_D:
-        df = 'd';
-        break;
-      default:
-        UNREACHABLE();
-        break;
-    }
-  } else {
-    char DF[] = {'b', 'h', 'w', 'd'};
-    switch (instr->MSAMinorOpcodeField()) {
-      case kMsaMinorI5:
-      case kMsaMinorI10:
-      case kMsaMinor3R:
-        df = DF[instr->Bits(22, 21)];
-        break;
-      case kMsaMinorMI10:
-        df = DF[instr->Bits(1, 0)];
-        break;
-      case kMsaMinorBIT:
-        df = DF[instr->MsaBitDf()];
-        break;
-      case kMsaMinorELM:
-        df = DF[instr->MsaElmDf()];
-        break;
-      case kMsaMinor3RF: {
-        uint32_t opcode = instr->InstructionBits() & kMsa3RFMask;
-        switch (opcode) {
-          case FEXDO:
-          case FTQ:
-          case MUL_Q:
-          case MADD_Q:
-          case MSUB_Q:
-          case MULR_Q:
-          case MADDR_Q:
-          case MSUBR_Q:
-            df = DF[1 + instr->Bit(21)];
-            break;
-          default:
-            df = DF[2 + instr->Bit(21)];
-            break;
-        }
-      } break;
-      case kMsaMinor2R:
-        df = DF[instr->Bits(17, 16)];
-        break;
-      case kMsaMinor2RF:
-        df = DF[2 + instr->Bit(16)];
-        break;
-      default:
-        UNREACHABLE();
-        break;
-    }
-  }
-
-  PrintChar(df);
-}
-
-// Printing of instruction name.
-void Decoder::PrintInstructionName(Instruction* instr) {
-}
-
-
-// Handle all register based formatting in this function to reduce the
-// complexity of FormatOption.
-int Decoder::FormatRegister(Instruction* instr, const char* format) {
-  DCHECK_EQ(format[0], 'r');
-  if (format[1] == 's') {  // 'rs: Rs register.
-    int reg = instr->RsValue();
-    PrintRegister(reg);
-    return 2;
-  } else if (format[1] == 't') {  // 'rt: rt register.
-    int reg = instr->RtValue();
-    PrintRegister(reg);
-    return 2;
-  } else if (format[1] == 'd') {  // 'rd: rd register.
-    int reg = instr->RdValue();
-    PrintRegister(reg);
-    return 2;
-  }
-  UNREACHABLE();
-}
-
-
-// Handle all FPUregister based formatting in this function to reduce the
-// complexity of FormatOption.
-int Decoder::FormatFPURegister(Instruction* instr, const char* format) {
-  DCHECK_EQ(format[0], 'f');
-  if ((CTC1 == instr->RsFieldRaw()) || (CFC1 == instr->RsFieldRaw())) {
-    if (format[1] == 's') {  // 'fs: fs register.
-      int reg = instr->FsValue();
-      PrintFPUStatusRegister(reg);
-      return 2;
-    } else if (format[1] == 't') {  // 'ft: ft register.
-      int reg = instr->FtValue();
-      PrintFPUStatusRegister(reg);
-      return 2;
-    } else if (format[1] == 'd') {  // 'fd: fd register.
-      int reg = instr->FdValue();
-      PrintFPUStatusRegister(reg);
-      return 2;
-    } else if (format[1] == 'r') {  // 'fr: fr register.
-      int reg = instr->FrValue();
-      PrintFPUStatusRegister(reg);
-      return 2;
-    }
-  } else {
-    if (format[1] == 's') {  // 'fs: fs register.
-      int reg = instr->FsValue();
-      PrintFPURegister(reg);
-      return 2;
-    } else if (format[1] == 't') {  // 'ft: ft register.
-      int reg = instr->FtValue();
-      PrintFPURegister(reg);
-      return 2;
-    } else if (format[1] == 'd') {  // 'fd: fd register.
-      int reg = instr->FdValue();
-      PrintFPURegister(reg);
-      return 2;
-    } else if (format[1] == 'r') {  // 'fr: fr register.
-      int reg = instr->FrValue();
-      PrintFPURegister(reg);
-      return 2;
-    }
-  }
-  UNREACHABLE();
-}
-
-// Handle all MSARegister based formatting in this function to reduce the
-// complexity of FormatOption.
-int Decoder::FormatMSARegister(Instruction* instr, const char* format) {
-  DCHECK_EQ(format[0], 'w');
-  if (format[1] == 's') {
-    int reg = instr->WsValue();
-    PrintMSARegister(reg);
-    return 2;
-  } else if (format[1] == 't') {
-    int reg = instr->WtValue();
-    PrintMSARegister(reg);
-    return 2;
-  } else if (format[1] == 'd') {
-    int reg = instr->WdValue();
-    PrintMSARegister(reg);
-    return 2;
-  }
-
-  UNREACHABLE();
-}
-
-// FormatOption takes a formatting string and interprets it based on
-// the current instructions. The format string points to the first
-// character of the option string (the option escape has already been
-// consumed by the caller.)  FormatOption returns the number of
-// characters that were consumed from the formatting string.
-int Decoder::FormatOption(Instruction* instr, const char* format) {
-  switch (format[0]) {
-    case 'c': {   // 'code for break or trap instructions.
-      DCHECK(STRING_STARTS_WITH(format, "code"));
-      PrintCode(instr);
-      return 4;
-    }
-    case 'i': {   // 'imm16u or 'imm26.
-      if (format[3] == '1') {
-        if (format[4] == '6') {
-          DCHECK(STRING_STARTS_WITH(format, "imm16"));
-          switch (format[5]) {
-            case 's':
-              DCHECK(STRING_STARTS_WITH(format, "imm16s"));
-              PrintSImm16(instr);
-              break;
-            case 'u':
-              DCHECK(STRING_STARTS_WITH(format, "imm16u"));
-              PrintSImm16(instr);
-              break;
-            case 'x':
-              DCHECK(STRING_STARTS_WITH(format, "imm16x"));
-              PrintXImm16(instr);
-              break;
-            case 'p': {  // The PC relative address.
-              DCHECK(STRING_STARTS_WITH(format, "imm16p"));
-              int delta_pc = 0;
-              int n_bits = 0;
-              switch (format[6]) {
-                case '4': {
-                  DCHECK(STRING_STARTS_WITH(format, "imm16p4"));
-                  delta_pc = 4;
-                  switch (format[8]) {
-                    case '2':
-                      DCHECK(STRING_STARTS_WITH(format, "imm16p4s2"));
-                      n_bits = 2;
-                      PrintPCImm16(instr, delta_pc, n_bits);
-                      return 9;
-                  }
-                }
-              }
-            }
-          }
-          return 6;
-        } else if (format[4] == '8') {
-          DCHECK(STRING_STARTS_WITH(format, "imm18"));
-          switch (format[5]) {
-            case 's':
-              DCHECK(STRING_STARTS_WITH(format, "imm18s"));
-              PrintSImm18(instr);
-              break;
-            case 'x':
-              DCHECK(STRING_STARTS_WITH(format, "imm18x"));
-              PrintXImm18(instr);
-              break;
-          }
-          return 6;
-        } else if (format[4] == '9') {
-          DCHECK(STRING_STARTS_WITH(format, "imm19"));
-          switch (format[5]) {
-            case 's':
-              DCHECK(STRING_STARTS_WITH(format, "imm19s"));
-              PrintSImm19(instr);
-              break;
-            case 'x':
-              DCHECK(STRING_STARTS_WITH(format, "imm19x"));
-              PrintXImm19(instr);
-              break;
-          }
-          return 6;
-        } else if (format[4] == '0' && format[5] == 's') {
-          DCHECK(STRING_STARTS_WITH(format, "imm10s"));
-          if (format[6] == '1') {
-            DCHECK(STRING_STARTS_WITH(format, "imm10s1"));
-            PrintMsaSImm10(instr, false);
-          } else if (format[6] == '2') {
-            DCHECK(STRING_STARTS_WITH(format, "imm10s2"));
-            PrintMsaSImm10(instr, true);
-          }
-          return 7;
-        }
-      } else if (format[3] == '2' && format[4] == '1') {
-        DCHECK(STRING_STARTS_WITH(format, "imm21"));
-        switch (format[5]) {
-          case 's':
-            DCHECK(STRING_STARTS_WITH(format, "imm21s"));
-            PrintSImm21(instr);
-            break;
-          case 'x':
-            DCHECK(STRING_STARTS_WITH(format, "imm21x"));
-            PrintXImm21(instr);
-            break;
-          case 'p': {  // The PC relative address.
-            DCHECK(STRING_STARTS_WITH(format, "imm21p"));
-            int delta_pc = 0;
-            int n_bits = 0;
-            switch (format[6]) {
-              case '4': {
-                DCHECK(STRING_STARTS_WITH(format, "imm21p4"));
-                delta_pc = 4;
-                switch (format[8]) {
-                  case '2':
-                    DCHECK(STRING_STARTS_WITH(format, "imm21p4s2"));
-                    n_bits = 2;
-                    PrintPCImm21(instr, delta_pc, n_bits);
-                    return 9;
-                }
-              }
-            }
-          }
-        }
-        return 6;
-      } else if (format[3] == '2' && format[4] == '6') {
-        DCHECK(STRING_STARTS_WITH(format, "imm26"));
-        switch (format[5]) {
-          case 's':
-            DCHECK(STRING_STARTS_WITH(format, "imm26s"));
-            PrintSImm26(instr);
-            break;
-          case 'x':
-            DCHECK(STRING_STARTS_WITH(format, "imm26x"));
-            PrintXImm26(instr);
-            break;
-          case 'p': {  // The PC relative address.
-            DCHECK(STRING_STARTS_WITH(format, "imm26p"));
-            int delta_pc = 0;
-            int n_bits = 0;
-            switch (format[6]) {
-              case '4': {
-                DCHECK(STRING_STARTS_WITH(format, "imm26p4"));
-                delta_pc = 4;
-                switch (format[8]) {
-                  case '2':
-                    DCHECK(STRING_STARTS_WITH(format, "imm26p4s2"));
-                    n_bits = 2;
-                    PrintPCImm26(instr, delta_pc, n_bits);
-                    return 9;
-                }
-              }
-            }
-          }
-          case 'j': {  // Absolute address for jump instructions.
-            DCHECK(STRING_STARTS_WITH(format, "imm26j"));
-            PrintPCImm26(instr);
-            break;
-          }
-        }
-        return 6;
-      } else if (format[3] == '5') {
-        DCHECK(STRING_STARTS_WITH(format, "imm5"));
-        if (format[4] == 'u') {
-          DCHECK(STRING_STARTS_WITH(format, "imm5u"));
-          PrintMsaImm5(instr);
-        } else if (format[4] == 's') {
-          DCHECK(STRING_STARTS_WITH(format, "imm5s"));
-          PrintMsaSImm5(instr);
-        }
-        return 5;
-      } else if (format[3] == '8') {
-        DCHECK(STRING_STARTS_WITH(format, "imm8"));
-        PrintMsaImm8(instr);
-        return 4;
-      } else if (format[3] == '9') {
-        DCHECK(STRING_STARTS_WITH(format, "imm9"));
-        if (format[4] == 'u') {
-          DCHECK(STRING_STARTS_WITH(format, "imm9u"));
-          PrintUImm9(instr);
-        } else if (format[4] == 's') {
-          DCHECK(STRING_STARTS_WITH(format, "imm9s"));
-          PrintSImm9(instr);
-        }
-        return 5;
-      } else if (format[3] == 'b') {
-        DCHECK(STRING_STARTS_WITH(format, "immb"));
-        PrintMsaImmBit(instr);
-        return 4;
-      } else if (format[3] == 'e') {
-        DCHECK(STRING_STARTS_WITH(format, "imme"));
-        PrintMsaImmElm(instr);
-        return 4;
-      }
-    }
-    case 'r': {   // 'r: registers.
-      return FormatRegister(instr, format);
-    }
-    case 'f': {   // 'f: FPUregisters.
-      return FormatFPURegister(instr, format);
-    }
-    case 'w': {  // 'w: MSA Register
-      return FormatMSARegister(instr, format);
-    }
-    case 's': {   // 'sa.
-      switch (format[1]) {
-        case 'a':
-          if (format[2] == '2') {
-            DCHECK(STRING_STARTS_WITH(format, "sa2"));  // 'sa2
-            PrintLsaSa(instr);
-            return 3;
-          } else {
-            DCHECK(STRING_STARTS_WITH(format, "sa"));
-            PrintSa(instr);
-            return 2;
-          }
-          break;
-        case 'd': {
-          DCHECK(STRING_STARTS_WITH(format, "sd"));
-          PrintSd(instr);
-          return 2;
-        }
-        case 's': {
-          if (format[2] == '1') {
-              DCHECK(STRING_STARTS_WITH(format, "ss1"));  /* ext size */
-              PrintSs1(instr);
-              return 3;
-          } else {
-              DCHECK(STRING_STARTS_WITH(format, "ss2"));  /* ins size */
-              PrintSs2(instr);
-              return 3;
-          }
-        }
-      }
-    }
-    case 'b': {
-      switch (format[1]) {
-        case 'c': {  // 'bc - Special for bc1 cc field.
-          DCHECK(STRING_STARTS_WITH(format, "bc"));
-          PrintBc(instr);
-          return 2;
-        }
-        case 'p': {
-          switch (format[2]) {
-            case '2': {  // 'bp2
-              DCHECK(STRING_STARTS_WITH(format, "bp2"));
-              PrintBp2(instr);
-              return 3;
-            }
-          }
-        }
-      }
-    }
-    case 'C': {   // 'Cc - Special for c.xx.d cc field.
-      DCHECK(STRING_STARTS_WITH(format, "Cc"));
-      PrintCc(instr);
-      return 2;
-    }
-    case 't':
-      if (instr->IsMSAInstr()) {
-        PrintMsaDataFormat(instr);
-      } else {
-        PrintFormat(instr);
-      }
-      return 1;
-  }
-  UNREACHABLE();
-}
-
-
-// Format takes a formatting string for a whole instruction and prints it into
-// the output buffer. All escaped options are handed to FormatOption to be
-// parsed further.
-void Decoder::Format(Instruction* instr, const char* format) {
-  char cur = *format++;
-  while ((cur != 0) && (out_buffer_pos_ < (out_buffer_.length() - 1))) {
-    if (cur == '\'') {  // Single quote is used as the formatting escape.
-      format += FormatOption(instr, format);
-    } else {
-      out_buffer_[out_buffer_pos_++] = cur;
-    }
-    cur = *format++;
-  }
-  out_buffer_[out_buffer_pos_]  = '\0';
-}
-
-
-// For currently unimplemented decodings the disassembler calls Unknown(instr)
-// which will just print "unknown" of the instruction bits.
-void Decoder::Unknown(Instruction* instr) {
-  Format(instr, "unknown");
-}
-
-
-bool Decoder::DecodeTypeRegisterRsType(Instruction* instr) {
-  switch (instr->FunctionFieldRaw()) {
-    case RINT:
-      Format(instr, "rint.'t    'fd, 'fs");
-      break;
-    case MIN:
-      Format(instr, "min.'t    'fd, 'fs, 'ft");
-      break;
-    case MAX:
-      Format(instr, "max.'t    'fd, 'fs, 'ft");
-      break;
-    case MINA:
-      Format(instr, "mina.'t   'fd, 'fs, 'ft");
-      break;
-    case MAXA:
-      Format(instr, "maxa.'t   'fd, 'fs, 'ft");
-      break;
-    case SEL:
-      Format(instr, "sel.'t      'fd, 'fs, 'ft");
-      break;
-    case SELEQZ_C:
-      Format(instr, "seleqz.'t    'fd, 'fs, 'ft");
-      break;
-    case SELNEZ_C:
-      Format(instr, "selnez.'t    'fd, 'fs, 'ft");
-      break;
-    case MOVZ_C:
-      Format(instr, "movz.'t    'fd, 'fs, 'rt");
-      break;
-    case MOVN_C:
-      Format(instr, "movn.'t    'fd, 'fs, 'rt");
-      break;
-    case MOVF:
-      if (instr->Bit(16)) {
-        Format(instr, "movt.'t    'fd, 'fs, 'Cc");
-      } else {
-        Format(instr, "movf.'t    'fd, 'fs, 'Cc");
-      }
-      break;
-    case ADD_D:
-      Format(instr, "add.'t   'fd, 'fs, 'ft");
-      break;
-    case SUB_D:
-      Format(instr, "sub.'t   'fd, 'fs, 'ft");
-      break;
-    case MUL_D:
-      Format(instr, "mul.'t   'fd, 'fs, 'ft");
-      break;
-    case DIV_D:
-      Format(instr, "div.'t   'fd, 'fs, 'ft");
-      break;
-    case ABS_D:
-      Format(instr, "abs.'t   'fd, 'fs");
-      break;
-    case MOV_D:
-      Format(instr, "mov.'t   'fd, 'fs");
-      break;
-    case NEG_D:
-      Format(instr, "neg.'t   'fd, 'fs");
-      break;
-    case SQRT_D:
-      Format(instr, "sqrt.'t  'fd, 'fs");
-      break;
-    case RECIP_D:
-      Format(instr, "recip.'t  'fd, 'fs");
-      break;
-    case RSQRT_D:
-      Format(instr, "rsqrt.'t  'fd, 'fs");
-      break;
-    case CVT_W_D:
-      Format(instr, "cvt.w.'t 'fd, 'fs");
-      break;
-    case CVT_L_D:
-      Format(instr, "cvt.l.'t 'fd, 'fs");
-      break;
-    case TRUNC_W_D:
-      Format(instr, "trunc.w.'t 'fd, 'fs");
-      break;
-    case TRUNC_L_D:
-      Format(instr, "trunc.l.'t 'fd, 'fs");
-      break;
-    case ROUND_W_D:
-      Format(instr, "round.w.'t 'fd, 'fs");
-      break;
-    case ROUND_L_D:
-      Format(instr, "round.l.'t 'fd, 'fs");
-      break;
-    case FLOOR_W_D:
-      Format(instr, "floor.w.'t 'fd, 'fs");
-      break;
-    case FLOOR_L_D:
-      Format(instr, "floor.l.'t 'fd, 'fs");
-      break;
-    case CEIL_W_D:
-      Format(instr, "ceil.w.'t 'fd, 'fs");
-      break;
-    case CLASS_D:
-      Format(instr, "class.'t 'fd, 'fs");
-      break;
-    case CEIL_L_D:
-      Format(instr, "ceil.l.'t 'fd, 'fs");
-      break;
-    case CVT_S_D:
-      Format(instr, "cvt.s.'t 'fd, 'fs");
-      break;
-    case C_F_D:
-      Format(instr, "c.f.'t   'fs, 'ft, 'Cc");
-      break;
-    case C_UN_D:
-      Format(instr, "c.un.'t  'fs, 'ft, 'Cc");
-      break;
-    case C_EQ_D:
-      Format(instr, "c.eq.'t  'fs, 'ft, 'Cc");
-      break;
-    case C_UEQ_D:
-      Format(instr, "c.ueq.'t 'fs, 'ft, 'Cc");
-      break;
-    case C_OLT_D:
-      Format(instr, "c.olt.'t 'fs, 'ft, 'Cc");
-      break;
-    case C_ULT_D:
-      Format(instr, "c.ult.'t 'fs, 'ft, 'Cc");
-      break;
-    case C_OLE_D:
-      Format(instr, "c.ole.'t 'fs, 'ft, 'Cc");
-      break;
-    case C_ULE_D:
-      Format(instr, "c.ule.'t 'fs, 'ft, 'Cc");
-      break;
-    default:
-      return false;
-  }
-  return true;
-}
-
-
-void Decoder::DecodeTypeRegisterSRsType(Instruction* instr) {
-  if (!DecodeTypeRegisterRsType(instr)) {
-    switch (instr->FunctionFieldRaw()) {
-      case CVT_D_S:
-        Format(instr, "cvt.d.'t 'fd, 'fs");
-        break;
-      case MADDF_S:
-        Format(instr, "maddf.s  'fd, 'fs, 'ft");
-        break;
-      case MSUBF_S:
-        Format(instr, "msubf.s  'fd, 'fs, 'ft");
-        break;
-      default:
-        Format(instr, "unknown.cop1.'t");
-        break;
-    }
-  }
-}
-
-
-void Decoder::DecodeTypeRegisterDRsType(Instruction* instr) {
-  if (!DecodeTypeRegisterRsType(instr)) {
-    switch (instr->FunctionFieldRaw()) {
-      case MADDF_D:
-        Format(instr, "maddf.d  'fd, 'fs, 'ft");
-        break;
-      case MSUBF_D:
-        Format(instr, "msubf.d  'fd, 'fs, 'ft");
-        break;
-      default:
-        Format(instr, "unknown.cop1.'t");
-        break;
-    }
-  }
-}
-
-
-void Decoder::DecodeTypeRegisterLRsType(Instruction* instr) {
-  switch (instr->FunctionFieldRaw()) {
-    case CVT_D_L:
-      Format(instr, "cvt.d.l 'fd, 'fs");
-      break;
-    case CVT_S_L:
-      Format(instr, "cvt.s.l 'fd, 'fs");
-      break;
-    case CMP_AF:
-      Format(instr, "cmp.af.d  'fd,  'fs, 'ft");
-      break;
-    case CMP_UN:
-      Format(instr, "cmp.un.d  'fd,  'fs, 'ft");
-      break;
-    case CMP_EQ:
-      Format(instr, "cmp.eq.d  'fd,  'fs, 'ft");
-      break;
-    case CMP_UEQ:
-      Format(instr, "cmp.ueq.d  'fd,  'fs, 'ft");
-      break;
-    case CMP_LT:
-      Format(instr, "cmp.lt.d  'fd,  'fs, 'ft");
-      break;
-    case CMP_ULT:
-      Format(instr, "cmp.ult.d  'fd,  'fs, 'ft");
-      break;
-    case CMP_LE:
-      Format(instr, "cmp.le.d  'fd,  'fs, 'ft");
-      break;
-    case CMP_ULE:
-      Format(instr, "cmp.ule.d  'fd,  'fs, 'ft");
-      break;
-    case CMP_OR:
-      Format(instr, "cmp.or.d  'fd,  'fs, 'ft");
-      break;
-    case CMP_UNE:
-      Format(instr, "cmp.une.d  'fd,  'fs, 'ft");
-      break;
-    case CMP_NE:
-      Format(instr, "cmp.ne.d  'fd,  'fs, 'ft");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-void Decoder::DecodeTypeRegisterWRsType(Instruction* instr) {
-  switch (instr->FunctionValue()) {
-    case CVT_S_W:  // Convert word to float (single).
-      Format(instr, "cvt.s.w 'fd, 'fs");
-      break;
-    case CVT_D_W:  // Convert word to double.
-      Format(instr, "cvt.d.w 'fd, 'fs");
-      break;
-    case CMP_AF:
-      Format(instr, "cmp.af.s    'fd, 'fs, 'ft");
-      break;
-    case CMP_UN:
-      Format(instr, "cmp.un.s    'fd, 'fs, 'ft");
-      break;
-    case CMP_EQ:
-      Format(instr, "cmp.eq.s    'fd, 'fs, 'ft");
-      break;
-    case CMP_UEQ:
-      Format(instr, "cmp.ueq.s   'fd, 'fs, 'ft");
-      break;
-    case CMP_LT:
-      Format(instr, "cmp.lt.s    'fd, 'fs, 'ft");
-      break;
-    case CMP_ULT:
-      Format(instr, "cmp.ult.s   'fd, 'fs, 'ft");
-      break;
-    case CMP_LE:
-      Format(instr, "cmp.le.s    'fd, 'fs, 'ft");
-      break;
-    case CMP_ULE:
-      Format(instr, "cmp.ule.s   'fd, 'fs, 'ft");
-      break;
-    case CMP_OR:
-      Format(instr, "cmp.or.s    'fd, 'fs, 'ft");
-      break;
-    case CMP_UNE:
-      Format(instr, "cmp.une.s   'fd, 'fs, 'ft");
-      break;
-    case CMP_NE:
-      Format(instr, "cmp.ne.s    'fd, 'fs, 'ft");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-void Decoder::DecodeTypeRegisterSPECIAL(Instruction* instr) {
-  switch (instr->FunctionFieldRaw()) {
-    case JR:
-      Format(instr, "jr      'rs");
-      break;
-    case JALR:
-      Format(instr, "jalr    'rs, 'rd");
-      break;
-    case SLL:
-      if (0x0 == static_cast<int>(instr->InstructionBits()))
-        Format(instr, "nop");
-      else
-        Format(instr, "sll     'rd, 'rt, 'sa");
-      break;
-    case SRL:
-      if (instr->RsValue() == 0) {
-        Format(instr, "srl     'rd, 'rt, 'sa");
-      } else {
-        if (IsMipsArchVariant(kMips32r2)) {
-          Format(instr, "rotr    'rd, 'rt, 'sa");
-        } else {
-          Unknown(instr);
-        }
-      }
-      break;
-    case SRA:
-      Format(instr, "sra     'rd, 'rt, 'sa");
-      break;
-    case SLLV:
-      Format(instr, "sllv    'rd, 'rt, 'rs");
-      break;
-    case SRLV:
-      if (instr->SaValue() == 0) {
-        Format(instr, "srlv    'rd, 'rt, 'rs");
-      } else {
-        if (IsMipsArchVariant(kMips32r2)) {
-          Format(instr, "rotrv   'rd, 'rt, 'rs");
-        } else {
-          Unknown(instr);
-        }
-      }
-      break;
-    case SRAV:
-      Format(instr, "srav    'rd, 'rt, 'rs");
-      break;
-    case LSA:
-      Format(instr, "lsa     'rd, 'rt, 'rs, 'sa2");
-      break;
-    case MFHI:
-      if (instr->Bits(25, 16) == 0) {
-        Format(instr, "mfhi    'rd");
-      } else {
-        if ((instr->FunctionFieldRaw() == CLZ_R6) && (instr->FdValue() == 1)) {
-          Format(instr, "clz     'rd, 'rs");
-        } else if ((instr->FunctionFieldRaw() == CLO_R6) &&
-                   (instr->FdValue() == 1)) {
-          Format(instr, "clo     'rd, 'rs");
-        }
-      }
-      break;
-    case MFLO:
-      Format(instr, "mflo    'rd");
-      break;
-    case MULT:  // @Mips32r6 == MUL_MUH.
-      if (!IsMipsArchVariant(kMips32r6)) {
-        Format(instr, "mult    'rs, 'rt");
-      } else {
-        if (instr->SaValue() == MUL_OP) {
-          Format(instr, "mul    'rd, 'rs, 'rt");
-        } else {
-          Format(instr, "muh    'rd, 'rs, 'rt");
-        }
-      }
-      break;
-    case MULTU:  // @Mips32r6 == MUL_MUH_U.
-      if (!IsMipsArchVariant(kMips32r6)) {
-        Format(instr, "multu   'rs, 'rt");
-      } else {
-        if (instr->SaValue() == MUL_OP) {
-          Format(instr, "mulu   'rd, 'rs, 'rt");
-        } else {
-          Format(instr, "muhu   'rd, 'rs, 'rt");
-        }
-      }
-      break;
-    case DIV:  // @Mips32r6 == DIV_MOD.
-      if (!IsMipsArchVariant(kMips32r6)) {
-        Format(instr, "div     'rs, 'rt");
-      } else {
-        if (instr->SaValue() == DIV_OP) {
-          Format(instr, "div    'rd, 'rs, 'rt");
-        } else {
-          Format(instr, "mod    'rd, 'rs, 'rt");
-        }
-      }
-      break;
-    case DIVU:  // @Mips32r6 == DIV_MOD_U.
-      if (!IsMipsArchVariant(kMips32r6)) {
-        Format(instr, "divu    'rs, 'rt");
-      } else {
-        if (instr->SaValue() == DIV_OP) {
-          Format(instr, "divu   'rd, 'rs, 'rt");
-        } else {
-          Format(instr, "modu   'rd, 'rs, 'rt");
-        }
-      }
-      break;
-    case ADD:
-      Format(instr, "add     'rd, 'rs, 'rt");
-      break;
-    case ADDU:
-      Format(instr, "addu    'rd, 'rs, 'rt");
-      break;
-    case SUB:
-      Format(instr, "sub     'rd, 'rs, 'rt");
-      break;
-    case SUBU:
-      Format(instr, "subu    'rd, 'rs, 'rt");
-      break;
-    case AND:
-      Format(instr, "and     'rd, 'rs, 'rt");
-      break;
-    case OR:
-      if (0 == instr->RsValue()) {
-        Format(instr, "mov     'rd, 'rt");
-      } else if (0 == instr->RtValue()) {
-        Format(instr, "mov     'rd, 'rs");
-      } else {
-        Format(instr, "or      'rd, 'rs, 'rt");
-      }
-      break;
-    case XOR:
-      Format(instr, "xor     'rd, 'rs, 'rt");
-      break;
-    case NOR:
-      Format(instr, "nor     'rd, 'rs, 'rt");
-      break;
-    case SLT:
-      Format(instr, "slt     'rd, 'rs, 'rt");
-      break;
-    case SLTU:
-      Format(instr, "sltu    'rd, 'rs, 'rt");
-      break;
-    case BREAK:
-      Format(instr, "break, code: 'code");
-      break;
-    case TGE:
-      Format(instr, "tge     'rs, 'rt, code: 'code");
-      break;
-    case TGEU:
-      Format(instr, "tgeu    'rs, 'rt, code: 'code");
-      break;
-    case TLT:
-      Format(instr, "tlt     'rs, 'rt, code: 'code");
-      break;
-    case TLTU:
-      Format(instr, "tltu    'rs, 'rt, code: 'code");
-      break;
-    case TEQ:
-      Format(instr, "teq     'rs, 'rt, code: 'code");
-      break;
-    case TNE:
-      Format(instr, "tne     'rs, 'rt, code: 'code");
-      break;
-    case SYNC:
-      Format(instr, "sync");
-      break;
-    case MOVZ:
-      Format(instr, "movz    'rd, 'rs, 'rt");
-      break;
-    case MOVN:
-      Format(instr, "movn    'rd, 'rs, 'rt");
-      break;
-    case MOVCI:
-      if (instr->Bit(16)) {
-        Format(instr, "movt    'rd, 'rs, 'bc");
-      } else {
-        Format(instr, "movf    'rd, 'rs, 'bc");
-      }
-      break;
-    case SELEQZ_S:
-      Format(instr, "seleqz    'rd, 'rs, 'rt");
-      break;
-    case SELNEZ_S:
-      Format(instr, "selnez    'rd, 'rs, 'rt");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-void Decoder::DecodeTypeRegisterSPECIAL2(Instruction* instr) {
-  switch (instr->FunctionFieldRaw()) {
-    case MUL:
-      Format(instr, "mul     'rd, 'rs, 'rt");
-      break;
-    case CLZ:
-      if (!IsMipsArchVariant(kMips32r6)) {
-        Format(instr, "clz     'rd, 'rs");
-      }
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-void Decoder::DecodeTypeRegisterSPECIAL3(Instruction* instr) {
-  switch (instr->FunctionFieldRaw()) {
-    case INS: {
-      if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) {
-        Format(instr, "ins     'rt, 'rs, 'sa, 'ss2");
-      } else {
-        Unknown(instr);
-      }
-      break;
-    }
-    case EXT: {
-      if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) {
-        Format(instr, "ext     'rt, 'rs, 'sa, 'ss1");
-      } else {
-        Unknown(instr);
-      }
-      break;
-    }
-    case BSHFL: {
-      int sa = instr->SaFieldRaw() >> kSaShift;
-      switch (sa) {
-        case BITSWAP: {
-          if (IsMipsArchVariant(kMips32r6)) {
-            Format(instr, "bitswap 'rd, 'rt");
-          } else {
-            Unknown(instr);
-          }
-          break;
-        }
-        case SEB: {
-          if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) {
-            Format(instr, "seb     'rd, 'rt");
-          } else {
-            Unknown(instr);
-          }
-          break;
-        }
-        case SEH: {
-          if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) {
-            Format(instr, "seh     'rd, 'rt");
-          } else {
-            Unknown(instr);
-          }
-          break;
-        }
-        case WSBH: {
-          if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) {
-            Format(instr, "wsbh    'rd, 'rt");
-          } else {
-            Unknown(instr);
-          }
-          break;
-        }
-        default: {
-          sa >>= kBp2Bits;
-          switch (sa) {
-            case ALIGN: {
-              if (IsMipsArchVariant(kMips32r6)) {
-                Format(instr, "align  'rd, 'rs, 'rt, 'bp2");
-              } else {
-                Unknown(instr);
-              }
-              break;
-            }
-            default:
-              UNREACHABLE();
-              break;
-          }
-        }
-      }
-      break;
-    }
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-void Decoder::DecodeTypeRegister(Instruction* instr) {
-  switch (instr->OpcodeFieldRaw()) {
-    case COP1:    // Coprocessor instructions.
-      switch (instr->RsFieldRaw()) {
-        case BC1:   // bc1 handled in DecodeTypeImmediate.
-          UNREACHABLE();
-          break;
-        case MFC1:
-          Format(instr, "mfc1    'rt, 'fs");
-          break;
-        case MFHC1:
-          Format(instr, "mfhc1   'rt, 'fs");
-          break;
-        case MTC1:
-          Format(instr, "mtc1    'rt, 'fs");
-          break;
-        // These are called "fs" too, although they are not FPU registers.
-        case CTC1:
-          Format(instr, "ctc1    'rt, 'fs");
-          break;
-        case CFC1:
-          Format(instr, "cfc1    'rt, 'fs");
-          break;
-        case MTHC1:
-          Format(instr, "mthc1   'rt, 'fs");
-          break;
-        case S:
-          DecodeTypeRegisterSRsType(instr);
-          break;
-        case D:
-          DecodeTypeRegisterDRsType(instr);
-          break;
-        case L:
-          DecodeTypeRegisterLRsType(instr);
-          break;
-        case W:
-          DecodeTypeRegisterWRsType(instr);
-          break;
-        case PS:
-          UNIMPLEMENTED_MIPS();
-          break;
-        default:
-          UNREACHABLE();
-      }
-      break;
-    case COP1X:
-      switch (instr->FunctionFieldRaw()) {
-        case MADD_S:
-          Format(instr, "madd.s  'fd, 'fr, 'fs, 'ft");
-          break;
-        case MADD_D:
-          Format(instr, "madd.d  'fd, 'fr, 'fs, 'ft");
-          break;
-        case MSUB_S:
-          Format(instr, "msub.s  'fd, 'fr, 'fs, 'ft");
-          break;
-        case MSUB_D:
-          Format(instr, "msub.d  'fd, 'fr, 'fs, 'ft");
-          break;
-        default:
-          UNREACHABLE();
-      }
-      break;
-    case SPECIAL:
-      DecodeTypeRegisterSPECIAL(instr);
-      break;
-    case SPECIAL2:
-      DecodeTypeRegisterSPECIAL2(instr);
-      break;
-    case SPECIAL3:
-      DecodeTypeRegisterSPECIAL3(instr);
-      break;
-    case MSA:
-      switch (instr->MSAMinorOpcodeField()) {
-        case kMsaMinor3R:
-          DecodeTypeMsa3R(instr);
-          break;
-        case kMsaMinor3RF:
-          DecodeTypeMsa3RF(instr);
-          break;
-        case kMsaMinorVEC:
-          DecodeTypeMsaVec(instr);
-          break;
-        case kMsaMinor2R:
-          DecodeTypeMsa2R(instr);
-          break;
-        case kMsaMinor2RF:
-          DecodeTypeMsa2RF(instr);
-          break;
-        case kMsaMinorELM:
-          DecodeTypeMsaELM(instr);
-          break;
-        default:
-          UNREACHABLE();
-      }
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Decoder::DecodeTypeImmediateSPECIAL3(Instruction* instr) {
-  switch (instr->FunctionFieldRaw()) {
-    case LL_R6: {
-      if (IsMipsArchVariant(kMips32r6)) {
-        Format(instr, "ll     'rt, 'imm9s('rs)");
-      } else {
-        Unknown(instr);
-      }
-      break;
-    }
-    case SC_R6: {
-      if (IsMipsArchVariant(kMips32r6)) {
-        Format(instr, "sc     'rt, 'imm9s('rs)");
-      } else {
-        Unknown(instr);
-      }
-      break;
-    }
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Decoder::DecodeTypeImmediate(Instruction* instr) {
-  switch (instr->OpcodeFieldRaw()) {
-    case COP1:
-      switch (instr->RsFieldRaw()) {
-        case BC1:
-          if (instr->FBtrueValue()) {
-            Format(instr, "bc1t    'bc, 'imm16u -> 'imm16p4s2");
-          } else {
-            Format(instr, "bc1f    'bc, 'imm16u -> 'imm16p4s2");
-          }
-          break;
-        case BC1EQZ:
-          Format(instr, "bc1eqz    'ft, 'imm16u -> 'imm16p4s2");
-          break;
-        case BC1NEZ:
-          Format(instr, "bc1nez    'ft, 'imm16u -> 'imm16p4s2");
-          break;
-        case BZ_V:
-        case BZ_B:
-        case BZ_H:
-        case BZ_W:
-        case BZ_D:
-          Format(instr, "bz.'t  'wt, 'imm16s -> 'imm16p4s2");
-          break;
-        case BNZ_V:
-        case BNZ_B:
-        case BNZ_H:
-        case BNZ_W:
-        case BNZ_D:
-          Format(instr, "bnz.'t  'wt, 'imm16s -> 'imm16p4s2");
-          break;
-        default:
-          UNREACHABLE();
-      }
-
-      break;  // Case COP1.
-    // ------------- REGIMM class.
-    case REGIMM:
-      switch (instr->RtFieldRaw()) {
-        case BLTZ:
-          Format(instr, "bltz    'rs, 'imm16u -> 'imm16p4s2");
-          break;
-        case BLTZAL:
-          Format(instr, "bltzal  'rs, 'imm16u -> 'imm16p4s2");
-          break;
-        case BGEZ:
-          Format(instr, "bgez    'rs, 'imm16u -> 'imm16p4s2");
-          break;
-        case BGEZAL: {
-          if (instr->RsValue() == 0)
-            Format(instr, "bal     'imm16s -> 'imm16p4s2");
-          else
-            Format(instr, "bgezal  'rs, 'imm16u -> 'imm16p4s2");
-          break;
-        }
-        case BGEZALL:
-          Format(instr, "bgezall 'rs, 'imm16u -> 'imm16p4s2");
-          break;
-        default:
-          UNREACHABLE();
-      }
-    break;  // Case REGIMM.
-    // ------------- Branch instructions.
-    case BEQ:
-      Format(instr, "beq     'rs, 'rt, 'imm16u -> 'imm16p4s2");
-      break;
-    case BC:
-      Format(instr, "bc      'imm26s -> 'imm26p4s2");
-      break;
-    case BALC:
-      Format(instr, "balc    'imm26s -> 'imm26p4s2");
-      break;
-    case BNE:
-      Format(instr, "bne     'rs, 'rt, 'imm16u -> 'imm16p4s2");
-      break;
-    case BLEZ:
-      if ((instr->RtValue() == 0) && (instr->RsValue() != 0)) {
-        Format(instr, "blez    'rs, 'imm16u -> 'imm16p4s2");
-      } else if ((instr->RtValue() != instr->RsValue()) &&
-                 (instr->RsValue() != 0) && (instr->RtValue() != 0)) {
-        Format(instr, "bgeuc   'rs, 'rt, 'imm16u -> 'imm16p4s2");
-      } else if ((instr->RtValue() == instr->RsValue()) &&
-                 (instr->RtValue() != 0)) {
-        Format(instr, "bgezalc 'rs, 'imm16u -> 'imm16p4s2");
-      } else if ((instr->RsValue() == 0) && (instr->RtValue() != 0)) {
-        Format(instr, "blezalc 'rt, 'imm16u -> 'imm16p4s2");
-      } else {
-        UNREACHABLE();
-      }
-      break;
-    case BGTZ:
-      if ((instr->RtValue() == 0) && (instr->RsValue() != 0)) {
-        Format(instr, "bgtz    'rs, 'imm16u -> 'imm16p4s2");
-      } else if ((instr->RtValue() != instr->RsValue()) &&
-                 (instr->RsValue() != 0) && (instr->RtValue() != 0)) {
-        Format(instr, "bltuc   'rs, 'rt, 'imm16u -> 'imm16p4s2");
-      } else if ((instr->RtValue() == instr->RsValue()) &&
-                 (instr->RtValue() != 0)) {
-        Format(instr, "bltzalc 'rt, 'imm16u -> 'imm16p4s2");
-      } else if ((instr->RsValue() == 0) && (instr->RtValue() != 0)) {
-        Format(instr, "bgtzalc 'rt, 'imm16u -> 'imm16p4s2");
-      } else {
-        UNREACHABLE();
-      }
-      break;
-    case BLEZL:
-      if ((instr->RtValue() == instr->RsValue()) && (instr->RtValue() != 0)) {
-        Format(instr, "bgezc    'rt, 'imm16u -> 'imm16p4s2");
-      } else if ((instr->RtValue() != instr->RsValue()) &&
-                 (instr->RsValue() != 0) && (instr->RtValue() != 0)) {
-        Format(instr, "bgec     'rs, 'rt, 'imm16u -> 'imm16p4s2");
-      } else if ((instr->RsValue() == 0) && (instr->RtValue() != 0)) {
-        Format(instr, "blezc    'rt, 'imm16u -> 'imm16p4s2");
-      } else {
-        UNREACHABLE();
-      }
-      break;
-    case BGTZL:
-      if ((instr->RtValue() == instr->RsValue()) && (instr->RtValue() != 0)) {
-        Format(instr, "bltzc    'rt, 'imm16u -> 'imm16p4s2");
-      } else if ((instr->RtValue() != instr->RsValue()) &&
-                 (instr->RsValue() != 0) && (instr->RtValue() != 0)) {
-        Format(instr, "bltc    'rs, 'rt, 'imm16u -> 'imm16p4s2");
-      } else if ((instr->RsValue() == 0) && (instr->RtValue() != 0)) {
-        Format(instr, "bgtzc    'rt, 'imm16u -> 'imm16p4s2");
-      } else {
-        UNREACHABLE();
-      }
-      break;
-    case POP66:
-      if (instr->RsValue() == JIC) {
-        Format(instr, "jic     'rt, 'imm16s");
-      } else {
-        Format(instr, "beqzc   'rs, 'imm21s -> 'imm21p4s2");
-      }
-      break;
-    case POP76:
-      if (instr->RsValue() == JIALC) {
-        Format(instr, "jialc   'rt, 'imm16s");
-      } else {
-        Format(instr, "bnezc   'rs, 'imm21s -> 'imm21p4s2");
-      }
-      break;
-    // ------------- Arithmetic instructions.
-    case ADDI:
-      if (!IsMipsArchVariant(kMips32r6)) {
-        Format(instr, "addi    'rt, 'rs, 'imm16s");
-      } else {
-        int rs_reg = instr->RsValue();
-        int rt_reg = instr->RtValue();
-        // Check if BOVC, BEQZALC or BEQC instruction.
-        if (rs_reg >= rt_reg) {
-          Format(instr, "bovc  'rs, 'rt, 'imm16s -> 'imm16p4s2");
-        } else {
-          DCHECK_GT(rt_reg, 0);
-          if (rs_reg == 0) {
-            Format(instr, "beqzalc 'rt, 'imm16s -> 'imm16p4s2");
-          } else {
-            Format(instr, "beqc    'rs, 'rt, 'imm16s -> 'imm16p4s2");
-          }
-        }
-      }
-      break;
-    case DADDI:
-      if (IsMipsArchVariant(kMips32r6)) {
-        int rs_reg = instr->RsValue();
-        int rt_reg = instr->RtValue();
-        // Check if BNVC, BNEZALC or BNEC instruction.
-        if (rs_reg >= rt_reg) {
-          Format(instr, "bnvc  'rs, 'rt, 'imm16s -> 'imm16p4s2");
-        } else {
-          DCHECK_GT(rt_reg, 0);
-          if (rs_reg == 0) {
-            Format(instr, "bnezalc 'rt, 'imm16s -> 'imm16p4s2");
-          } else {
-            Format(instr, "bnec  'rs, 'rt, 'imm16s -> 'imm16p4s2");
-          }
-        }
-      }
-      break;
-    case ADDIU:
-      Format(instr, "addiu   'rt, 'rs, 'imm16s");
-      break;
-    case SLTI:
-      Format(instr, "slti    'rt, 'rs, 'imm16s");
-      break;
-    case SLTIU:
-      Format(instr, "sltiu   'rt, 'rs, 'imm16u");
-      break;
-    case ANDI:
-      Format(instr, "andi    'rt, 'rs, 'imm16x");
-      break;
-    case ORI:
-      Format(instr, "ori     'rt, 'rs, 'imm16x");
-      break;
-    case XORI:
-      Format(instr, "xori    'rt, 'rs, 'imm16x");
-      break;
-    case LUI:
-      if (!IsMipsArchVariant(kMips32r6)) {
-        Format(instr, "lui     'rt, 'imm16x");
-      } else {
-        if (instr->RsValue() != 0) {
-          Format(instr, "aui     'rt, 'rs, 'imm16x");
-        } else {
-          Format(instr, "lui     'rt, 'imm16x");
-        }
-      }
-      break;
-    // ------------- Memory instructions.
-    case LB:
-      Format(instr, "lb      'rt, 'imm16s('rs)");
-      break;
-    case LH:
-      Format(instr, "lh      'rt, 'imm16s('rs)");
-      break;
-    case LWL:
-      Format(instr, "lwl     'rt, 'imm16s('rs)");
-      break;
-    case LW:
-      Format(instr, "lw      'rt, 'imm16s('rs)");
-      break;
-    case LBU:
-      Format(instr, "lbu     'rt, 'imm16s('rs)");
-      break;
-    case LHU:
-      Format(instr, "lhu     'rt, 'imm16s('rs)");
-      break;
-    case LWR:
-      Format(instr, "lwr     'rt, 'imm16s('rs)");
-      break;
-    case PREF:
-      Format(instr, "pref    'rt, 'imm16s('rs)");
-      break;
-    case SB:
-      Format(instr, "sb      'rt, 'imm16s('rs)");
-      break;
-    case SH:
-      Format(instr, "sh      'rt, 'imm16s('rs)");
-      break;
-    case SWL:
-      Format(instr, "swl     'rt, 'imm16s('rs)");
-      break;
-    case SW:
-      Format(instr, "sw      'rt, 'imm16s('rs)");
-      break;
-    case SWR:
-      Format(instr, "swr     'rt, 'imm16s('rs)");
-      break;
-    case LL:
-      if (IsMipsArchVariant(kMips32r6)) {
-        Unknown(instr);
-      } else {
-        Format(instr, "ll     'rt, 'imm16s('rs)");
-      }
-      break;
-    case SC:
-      if (IsMipsArchVariant(kMips32r6)) {
-        Unknown(instr);
-      } else {
-        Format(instr, "sc     'rt, 'imm16s('rs)");
-      }
-      break;
-    case LWC1:
-      Format(instr, "lwc1    'ft, 'imm16s('rs)");
-      break;
-    case LDC1:
-      Format(instr, "ldc1    'ft, 'imm16s('rs)");
-      break;
-    case SWC1:
-      Format(instr, "swc1    'ft, 'imm16s('rs)");
-      break;
-    case SDC1:
-      Format(instr, "sdc1    'ft, 'imm16s('rs)");
-      break;
-    case PCREL: {
-      int32_t imm21 = instr->Imm21Value();
-      // rt field: 5-bits checking
-      uint8_t rt = (imm21 >> kImm16Bits);
-      switch (rt) {
-        case ALUIPC:
-          Format(instr, "aluipc  'rs, 'imm16s");
-          break;
-        case AUIPC:
-          Format(instr, "auipc   'rs, 'imm16s");
-          break;
-        default: {
-          // rt field: checking of the most significant 2-bits
-          rt = (imm21 >> kImm19Bits);
-          switch (rt) {
-            case LWPC:
-              Format(instr, "lwpc    'rs, 'imm19s");
-              break;
-            case ADDIUPC:
-              Format(instr, "addiupc 'rs, 'imm19s");
-              break;
-            default:
-              UNREACHABLE();
-              break;
-          }
-        }
-      }
-      break;
-    }
-    case SPECIAL3:
-      DecodeTypeImmediateSPECIAL3(instr);
-      break;
-    case MSA:
-      switch (instr->MSAMinorOpcodeField()) {
-        case kMsaMinorI8:
-          DecodeTypeMsaI8(instr);
-          break;
-        case kMsaMinorI5:
-          DecodeTypeMsaI5(instr);
-          break;
-        case kMsaMinorI10:
-          DecodeTypeMsaI10(instr);
-          break;
-        case kMsaMinorELM:
-          DecodeTypeMsaELM(instr);
-          break;
-        case kMsaMinorBIT:
-          DecodeTypeMsaBIT(instr);
-          break;
-        case kMsaMinorMI10:
-          DecodeTypeMsaMI10(instr);
-          break;
-        default:
-          UNREACHABLE();
-          break;
-      }
-      break;
-    default:
-      printf("a 0x%x \n", instr->OpcodeFieldRaw());
-      UNREACHABLE();
-      break;
-  }
-}
-
-
-void Decoder::DecodeTypeJump(Instruction* instr) {
-  switch (instr->OpcodeFieldRaw()) {
-    case J:
-      Format(instr, "j       'imm26x -> 'imm26j");
-      break;
-    case JAL:
-      Format(instr, "jal     'imm26x -> 'imm26j");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Decoder::DecodeTypeMsaI8(Instruction* instr) {
-  uint32_t opcode = instr->InstructionBits() & kMsaI8Mask;
-
-  switch (opcode) {
-    case ANDI_B:
-      Format(instr, "andi.b  'wd, 'ws, 'imm8");
-      break;
-    case ORI_B:
-      Format(instr, "ori.b  'wd, 'ws, 'imm8");
-      break;
-    case NORI_B:
-      Format(instr, "nori.b  'wd, 'ws, 'imm8");
-      break;
-    case XORI_B:
-      Format(instr, "xori.b  'wd, 'ws, 'imm8");
-      break;
-    case BMNZI_B:
-      Format(instr, "bmnzi.b  'wd, 'ws, 'imm8");
-      break;
-    case BMZI_B:
-      Format(instr, "bmzi.b  'wd, 'ws, 'imm8");
-      break;
-    case BSELI_B:
-      Format(instr, "bseli.b  'wd, 'ws, 'imm8");
-      break;
-    case SHF_B:
-      Format(instr, "shf.b  'wd, 'ws, 'imm8");
-      break;
-    case SHF_H:
-      Format(instr, "shf.h  'wd, 'ws, 'imm8");
-      break;
-    case SHF_W:
-      Format(instr, "shf.w  'wd, 'ws, 'imm8");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Decoder::DecodeTypeMsaI5(Instruction* instr) {
-  uint32_t opcode = instr->InstructionBits() & kMsaI5Mask;
-
-  switch (opcode) {
-    case ADDVI:
-      Format(instr, "addvi.'t  'wd, 'ws, 'imm5u");
-      break;
-    case SUBVI:
-      Format(instr, "subvi.'t  'wd, 'ws, 'imm5u");
-      break;
-    case MAXI_S:
-      Format(instr, "maxi_s.'t  'wd, 'ws, 'imm5s");
-      break;
-    case MAXI_U:
-      Format(instr, "maxi_u.'t  'wd, 'ws, 'imm5u");
-      break;
-    case MINI_S:
-      Format(instr, "mini_s.'t  'wd, 'ws, 'imm5s");
-      break;
-    case MINI_U:
-      Format(instr, "mini_u.'t  'wd, 'ws, 'imm5u");
-      break;
-    case CEQI:
-      Format(instr, "ceqi.'t  'wd, 'ws, 'imm5s");
-      break;
-    case CLTI_S:
-      Format(instr, "clti_s.'t  'wd, 'ws, 'imm5s");
-      break;
-    case CLTI_U:
-      Format(instr, "clti_u.'t  'wd, 'ws, 'imm5u");
-      break;
-    case CLEI_S:
-      Format(instr, "clei_s.'t  'wd, 'ws, 'imm5s");
-      break;
-    case CLEI_U:
-      Format(instr, "clei_u.'t  'wd, 'ws, 'imm5u");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Decoder::DecodeTypeMsaI10(Instruction* instr) {
-  uint32_t opcode = instr->InstructionBits() & kMsaI5Mask;
-  if (opcode == LDI) {
-    Format(instr, "ldi.'t  'wd, 'imm10s1");
-  } else {
-    UNREACHABLE();
-  }
-}
-
-void Decoder::DecodeTypeMsaELM(Instruction* instr) {
-  uint32_t opcode = instr->InstructionBits() & kMsaELMMask;
-  switch (opcode) {
-    case SLDI:
-      if (instr->Bits(21, 16) == 0x3E) {
-        Format(instr, "ctcmsa  ");
-        PrintMSAControlRegister(instr->WdValue());
-        Print(", ");
-        PrintRegister(instr->WsValue());
-      } else {
-        Format(instr, "sldi.'t  'wd, 'ws['imme]");
-      }
-      break;
-    case SPLATI:
-      if (instr->Bits(21, 16) == 0x3E) {
-        Format(instr, "cfcmsa  ");
-        PrintRegister(instr->WdValue());
-        Print(", ");
-        PrintMSAControlRegister(instr->WsValue());
-      } else {
-        Format(instr, "splati.'t  'wd, 'ws['imme]");
-      }
-      break;
-    case COPY_S:
-      if (instr->Bits(21, 16) == 0x3E) {
-        Format(instr, "move.v  'wd, 'ws");
-      } else {
-        Format(instr, "copy_s.'t  ");
-        PrintMsaCopy(instr);
-      }
-      break;
-    case COPY_U:
-      Format(instr, "copy_u.'t  ");
-      PrintMsaCopy(instr);
-      break;
-    case INSERT:
-      Format(instr, "insert.'t  'wd['imme], ");
-      PrintRegister(instr->WsValue());
-      break;
-    case INSVE:
-      Format(instr, "insve.'t  'wd['imme], 'ws[0]");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Decoder::DecodeTypeMsaBIT(Instruction* instr) {
-  uint32_t opcode = instr->InstructionBits() & kMsaBITMask;
-
-  switch (opcode) {
-    case SLLI:
-      Format(instr, "slli.'t  'wd, 'ws, 'immb");
-      break;
-    case SRAI:
-      Format(instr, "srai.'t  'wd, 'ws, 'immb");
-      break;
-    case SRLI:
-      Format(instr, "srli.'t  'wd, 'ws, 'immb");
-      break;
-    case BCLRI:
-      Format(instr, "bclri.'t  'wd, 'ws, 'immb");
-      break;
-    case BSETI:
-      Format(instr, "bseti.'t  'wd, 'ws, 'immb");
-      break;
-    case BNEGI:
-      Format(instr, "bnegi.'t  'wd, 'ws, 'immb");
-      break;
-    case BINSLI:
-      Format(instr, "binsli.'t  'wd, 'ws, 'immb");
-      break;
-    case BINSRI:
-      Format(instr, "binsri.'t  'wd, 'ws, 'immb");
-      break;
-    case SAT_S:
-      Format(instr, "sat_s.'t  'wd, 'ws, 'immb");
-      break;
-    case SAT_U:
-      Format(instr, "sat_u.'t  'wd, 'ws, 'immb");
-      break;
-    case SRARI:
-      Format(instr, "srari.'t  'wd, 'ws, 'immb");
-      break;
-    case SRLRI:
-      Format(instr, "srlri.'t  'wd, 'ws, 'immb");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Decoder::DecodeTypeMsaMI10(Instruction* instr) {
-  uint32_t opcode = instr->InstructionBits() & kMsaMI10Mask;
-  if (opcode == MSA_LD) {
-    Format(instr, "ld.'t  'wd, 'imm10s2(");
-    PrintRegister(instr->WsValue());
-    Print(")");
-  } else if (opcode == MSA_ST) {
-    Format(instr, "st.'t  'wd, 'imm10s2(");
-    PrintRegister(instr->WsValue());
-    Print(")");
-  } else {
-    UNREACHABLE();
-  }
-}
-
-void Decoder::DecodeTypeMsa3R(Instruction* instr) {
-  uint32_t opcode = instr->InstructionBits() & kMsa3RMask;
-  switch (opcode) {
-    case SLL_MSA:
-      Format(instr, "sll.'t  'wd, 'ws, 'wt");
-      break;
-    case SRA_MSA:
-      Format(instr, "sra.'t  'wd, 'ws, 'wt");
-      break;
-    case SRL_MSA:
-      Format(instr, "srl.'t  'wd, 'ws, 'wt");
-      break;
-    case BCLR:
-      Format(instr, "bclr.'t  'wd, 'ws, 'wt");
-      break;
-    case BSET:
-      Format(instr, "bset.'t  'wd, 'ws, 'wt");
-      break;
-    case BNEG:
-      Format(instr, "bneg.'t  'wd, 'ws, 'wt");
-      break;
-    case BINSL:
-      Format(instr, "binsl.'t  'wd, 'ws, 'wt");
-      break;
-    case BINSR:
-      Format(instr, "binsr.'t  'wd, 'ws, 'wt");
-      break;
-    case ADDV:
-      Format(instr, "addv.'t  'wd, 'ws, 'wt");
-      break;
-    case SUBV:
-      Format(instr, "subv.'t  'wd, 'ws, 'wt");
-      break;
-    case MAX_S:
-      Format(instr, "max_s.'t  'wd, 'ws, 'wt");
-      break;
-    case MAX_U:
-      Format(instr, "max_u.'t  'wd, 'ws, 'wt");
-      break;
-    case MIN_S:
-      Format(instr, "min_s.'t  'wd, 'ws, 'wt");
-      break;
-    case MIN_U:
-      Format(instr, "min_u.'t  'wd, 'ws, 'wt");
-      break;
-    case MAX_A:
-      Format(instr, "max_a.'t  'wd, 'ws, 'wt");
-      break;
-    case MIN_A:
-      Format(instr, "min_a.'t  'wd, 'ws, 'wt");
-      break;
-    case CEQ:
-      Format(instr, "ceq.'t  'wd, 'ws, 'wt");
-      break;
-    case CLT_S:
-      Format(instr, "clt_s.'t  'wd, 'ws, 'wt");
-      break;
-    case CLT_U:
-      Format(instr, "clt_u.'t  'wd, 'ws, 'wt");
-      break;
-    case CLE_S:
-      Format(instr, "cle_s.'t  'wd, 'ws, 'wt");
-      break;
-    case CLE_U:
-      Format(instr, "cle_u.'t  'wd, 'ws, 'wt");
-      break;
-    case ADD_A:
-      Format(instr, "add_a.'t  'wd, 'ws, 'wt");
-      break;
-    case ADDS_A:
-      Format(instr, "adds_a.'t  'wd, 'ws, 'wt");
-      break;
-    case ADDS_S:
-      Format(instr, "adds_s.'t  'wd, 'ws, 'wt");
-      break;
-    case ADDS_U:
-      Format(instr, "adds_u.'t  'wd, 'ws, 'wt");
-      break;
-    case AVE_S:
-      Format(instr, "ave_s.'t  'wd, 'ws, 'wt");
-      break;
-    case AVE_U:
-      Format(instr, "ave_u.'t  'wd, 'ws, 'wt");
-      break;
-    case AVER_S:
-      Format(instr, "aver_s.'t  'wd, 'ws, 'wt");
-      break;
-    case AVER_U:
-      Format(instr, "aver_u.'t  'wd, 'ws, 'wt");
-      break;
-    case SUBS_S:
-      Format(instr, "subs_s.'t  'wd, 'ws, 'wt");
-      break;
-    case SUBS_U:
-      Format(instr, "subs_u.'t  'wd, 'ws, 'wt");
-      break;
-    case SUBSUS_U:
-      Format(instr, "subsus_u.'t  'wd, 'ws, 'wt");
-      break;
-    case SUBSUU_S:
-      Format(instr, "subsuu_s.'t  'wd, 'ws, 'wt");
-      break;
-    case ASUB_S:
-      Format(instr, "asub_s.'t  'wd, 'ws, 'wt");
-      break;
-    case ASUB_U:
-      Format(instr, "asub_u.'t  'wd, 'ws, 'wt");
-      break;
-    case MULV:
-      Format(instr, "mulv.'t  'wd, 'ws, 'wt");
-      break;
-    case MADDV:
-      Format(instr, "maddv.'t  'wd, 'ws, 'wt");
-      break;
-    case MSUBV:
-      Format(instr, "msubv.'t  'wd, 'ws, 'wt");
-      break;
-    case DIV_S_MSA:
-      Format(instr, "div_s.'t  'wd, 'ws, 'wt");
-      break;
-    case DIV_U:
-      Format(instr, "div_u.'t  'wd, 'ws, 'wt");
-      break;
-    case MOD_S:
-      Format(instr, "mod_s.'t  'wd, 'ws, 'wt");
-      break;
-    case MOD_U:
-      Format(instr, "mod_u.'t  'wd, 'ws, 'wt");
-      break;
-    case DOTP_S:
-      Format(instr, "dotp_s.'t  'wd, 'ws, 'wt");
-      break;
-    case DOTP_U:
-      Format(instr, "dotp_u.'t  'wd, 'ws, 'wt");
-      break;
-    case DPADD_S:
-      Format(instr, "dpadd_s.'t  'wd, 'ws, 'wt");
-      break;
-    case DPADD_U:
-      Format(instr, "dpadd_u.'t  'wd, 'ws, 'wt");
-      break;
-    case DPSUB_S:
-      Format(instr, "dpsub_s.'t  'wd, 'ws, 'wt");
-      break;
-    case DPSUB_U:
-      Format(instr, "dpsub_u.'t  'wd, 'ws, 'wt");
-      break;
-    case SLD:
-      Format(instr, "sld.'t  'wd, 'ws['rt]");
-      break;
-    case SPLAT:
-      Format(instr, "splat.'t  'wd, 'ws['rt]");
-      break;
-    case PCKEV:
-      Format(instr, "pckev.'t  'wd, 'ws, 'wt");
-      break;
-    case PCKOD:
-      Format(instr, "pckod.'t  'wd, 'ws, 'wt");
-      break;
-    case ILVL:
-      Format(instr, "ilvl.'t  'wd, 'ws, 'wt");
-      break;
-    case ILVR:
-      Format(instr, "ilvr.'t  'wd, 'ws, 'wt");
-      break;
-    case ILVEV:
-      Format(instr, "ilvev.'t  'wd, 'ws, 'wt");
-      break;
-    case ILVOD:
-      Format(instr, "ilvod.'t  'wd, 'ws, 'wt");
-      break;
-    case VSHF:
-      Format(instr, "vshf.'t  'wd, 'ws, 'wt");
-      break;
-    case SRAR:
-      Format(instr, "srar.'t  'wd, 'ws, 'wt");
-      break;
-    case SRLR:
-      Format(instr, "srlr.'t  'wd, 'ws, 'wt");
-      break;
-    case HADD_S:
-      Format(instr, "hadd_s.'t  'wd, 'ws, 'wt");
-      break;
-    case HADD_U:
-      Format(instr, "hadd_u.'t  'wd, 'ws, 'wt");
-      break;
-    case HSUB_S:
-      Format(instr, "hsub_s.'t  'wd, 'ws, 'wt");
-      break;
-    case HSUB_U:
-      Format(instr, "hsub_u.'t  'wd, 'ws, 'wt");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Decoder::DecodeTypeMsa3RF(Instruction* instr) {
-  uint32_t opcode = instr->InstructionBits() & kMsa3RFMask;
-  switch (opcode) {
-    case FCAF:
-      Format(instr, "fcaf.'t  'wd, 'ws, 'wt");
-      break;
-    case FCUN:
-      Format(instr, "fcun.'t  'wd, 'ws, 'wt");
-      break;
-    case FCEQ:
-      Format(instr, "fceq.'t  'wd, 'ws, 'wt");
-      break;
-    case FCUEQ:
-      Format(instr, "fcueq.'t  'wd, 'ws, 'wt");
-      break;
-    case FCLT:
-      Format(instr, "fclt.'t  'wd, 'ws, 'wt");
-      break;
-    case FCULT:
-      Format(instr, "fcult.'t  'wd, 'ws, 'wt");
-      break;
-    case FCLE:
-      Format(instr, "fcle.'t  'wd, 'ws, 'wt");
-      break;
-    case FCULE:
-      Format(instr, "fcule.'t  'wd, 'ws, 'wt");
-      break;
-    case FSAF:
-      Format(instr, "fsaf.'t  'wd, 'ws, 'wt");
-      break;
-    case FSUN:
-      Format(instr, "fsun.'t  'wd, 'ws, 'wt");
-      break;
-    case FSEQ:
-      Format(instr, "fseq.'t  'wd, 'ws, 'wt");
-      break;
-    case FSUEQ:
-      Format(instr, "fsueq.'t  'wd, 'ws, 'wt");
-      break;
-    case FSLT:
-      Format(instr, "fslt.'t  'wd, 'ws, 'wt");
-      break;
-    case FSULT:
-      Format(instr, "fsult.'t  'wd, 'ws, 'wt");
-      break;
-    case FSLE:
-      Format(instr, "fsle.'t  'wd, 'ws, 'wt");
-      break;
-    case FSULE:
-      Format(instr, "fsule.'t  'wd, 'ws, 'wt");
-      break;
-    case FADD:
-      Format(instr, "fadd.'t  'wd, 'ws, 'wt");
-      break;
-    case FSUB:
-      Format(instr, "fsub.'t  'wd, 'ws, 'wt");
-      break;
-    case FMUL:
-      Format(instr, "fmul.'t  'wd, 'ws, 'wt");
-      break;
-    case FDIV:
-      Format(instr, "fdiv.'t  'wd, 'ws, 'wt");
-      break;
-    case FMADD:
-      Format(instr, "fmadd.'t  'wd, 'ws, 'wt");
-      break;
-    case FMSUB:
-      Format(instr, "fmsub.'t  'wd, 'ws, 'wt");
-      break;
-    case FEXP2:
-      Format(instr, "fexp2.'t  'wd, 'ws, 'wt");
-      break;
-    case FEXDO:
-      Format(instr, "fexdo.'t  'wd, 'ws, 'wt");
-      break;
-    case FTQ:
-      Format(instr, "ftq.'t  'wd, 'ws, 'wt");
-      break;
-    case FMIN:
-      Format(instr, "fmin.'t  'wd, 'ws, 'wt");
-      break;
-    case FMIN_A:
-      Format(instr, "fmin_a.'t  'wd, 'ws, 'wt");
-      break;
-    case FMAX:
-      Format(instr, "fmax.'t  'wd, 'ws, 'wt");
-      break;
-    case FMAX_A:
-      Format(instr, "fmax_a.'t  'wd, 'ws, 'wt");
-      break;
-    case FCOR:
-      Format(instr, "fcor.'t  'wd, 'ws, 'wt");
-      break;
-    case FCUNE:
-      Format(instr, "fcune.'t  'wd, 'ws, 'wt");
-      break;
-    case FCNE:
-      Format(instr, "fcne.'t  'wd, 'ws, 'wt");
-      break;
-    case MUL_Q:
-      Format(instr, "mul_q.'t  'wd, 'ws, 'wt");
-      break;
-    case MADD_Q:
-      Format(instr, "madd_q.'t  'wd, 'ws, 'wt");
-      break;
-    case MSUB_Q:
-      Format(instr, "msub_q.'t  'wd, 'ws, 'wt");
-      break;
-    case FSOR:
-      Format(instr, "fsor.'t  'wd, 'ws, 'wt");
-      break;
-    case FSUNE:
-      Format(instr, "fsune.'t  'wd, 'ws, 'wt");
-      break;
-    case FSNE:
-      Format(instr, "fsne.'t  'wd, 'ws, 'wt");
-      break;
-    case MULR_Q:
-      Format(instr, "mulr_q.'t  'wd, 'ws, 'wt");
-      break;
-    case MADDR_Q:
-      Format(instr, "maddr_q.'t  'wd, 'ws, 'wt");
-      break;
-    case MSUBR_Q:
-      Format(instr, "msubr_q.'t  'wd, 'ws, 'wt");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Decoder::DecodeTypeMsaVec(Instruction* instr) {
-  uint32_t opcode = instr->InstructionBits() & kMsaVECMask;
-  switch (opcode) {
-    case AND_V:
-      Format(instr, "and.v  'wd, 'ws, 'wt");
-      break;
-    case OR_V:
-      Format(instr, "or.v  'wd, 'ws, 'wt");
-      break;
-    case NOR_V:
-      Format(instr, "nor.v  'wd, 'ws, 'wt");
-      break;
-    case XOR_V:
-      Format(instr, "xor.v  'wd, 'ws, 'wt");
-      break;
-    case BMNZ_V:
-      Format(instr, "bmnz.v  'wd, 'ws, 'wt");
-      break;
-    case BMZ_V:
-      Format(instr, "bmz.v  'wd, 'ws, 'wt");
-      break;
-    case BSEL_V:
-      Format(instr, "bsel.v  'wd, 'ws, 'wt");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Decoder::DecodeTypeMsa2R(Instruction* instr) {
-  uint32_t opcode = instr->InstructionBits() & kMsa2RMask;
-  switch (opcode) {
-    case FILL: {
-      Format(instr, "fill.'t  'wd, ");
-      PrintRegister(instr->WsValue());  // rs value is in ws field
-    } break;
-    case PCNT:
-      Format(instr, "pcnt.'t  'wd, 'ws");
-      break;
-    case NLOC:
-      Format(instr, "nloc.'t  'wd, 'ws");
-      break;
-    case NLZC:
-      Format(instr, "nlzc.'t  'wd, 'ws");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Decoder::DecodeTypeMsa2RF(Instruction* instr) {
-  uint32_t opcode = instr->InstructionBits() & kMsa2RFMask;
-  switch (opcode) {
-    case FCLASS:
-      Format(instr, "fclass.'t  'wd, 'ws");
-      break;
-    case FTRUNC_S:
-      Format(instr, "ftrunc_s.'t  'wd, 'ws");
-      break;
-    case FTRUNC_U:
-      Format(instr, "ftrunc_u.'t  'wd, 'ws");
-      break;
-    case FSQRT:
-      Format(instr, "fsqrt.'t  'wd, 'ws");
-      break;
-    case FRSQRT:
-      Format(instr, "frsqrt.'t  'wd, 'ws");
-      break;
-    case FRCP:
-      Format(instr, "frcp.'t  'wd, 'ws");
-      break;
-    case FRINT:
-      Format(instr, "frint.'t  'wd, 'ws");
-      break;
-    case FLOG2:
-      Format(instr, "flog2.'t  'wd, 'ws");
-      break;
-    case FEXUPL:
-      Format(instr, "fexupl.'t  'wd, 'ws");
-      break;
-    case FEXUPR:
-      Format(instr, "fexupr.'t  'wd, 'ws");
-      break;
-    case FFQL:
-      Format(instr, "ffql.'t  'wd, 'ws");
-      break;
-    case FFQR:
-      Format(instr, "ffqr.'t  'wd, 'ws");
-      break;
-    case FTINT_S:
-      Format(instr, "ftint_s.'t  'wd, 'ws");
-      break;
-    case FTINT_U:
-      Format(instr, "ftint_u.'t  'wd, 'ws");
-      break;
-    case FFINT_S:
-      Format(instr, "ffint_s.'t  'wd, 'ws");
-      break;
-    case FFINT_U:
-      Format(instr, "ffint_u.'t  'wd, 'ws");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-// Disassemble the instruction at *instr_ptr into the output buffer.
-int Decoder::InstructionDecode(byte* instr_ptr) {
-  Instruction* instr = Instruction::At(instr_ptr);
-  // Print raw instruction bytes.
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                   "%08x       ",
-                                   instr->InstructionBits());
-  switch (instr->InstructionType()) {
-    case Instruction::kRegisterType: {
-      DecodeTypeRegister(instr);
-      break;
-    }
-    case Instruction::kImmediateType: {
-      DecodeTypeImmediate(instr);
-      break;
-    }
-    case Instruction::kJumpType: {
-      DecodeTypeJump(instr);
-      break;
-    }
-    default: {
-      Format(instr, "UNSUPPORTED");
-      UNSUPPORTED_MIPS();
-    }
-  }
-  return Instruction::kInstrSize;
-}
-
-
-}  // namespace internal
-}  // namespace v8
-
-
-//------------------------------------------------------------------------------
-
-namespace disasm {
-
-const char* NameConverter::NameOfAddress(byte* addr) const {
-  v8::internal::SNPrintF(tmp_buffer_, "%p", static_cast<void*>(addr));
-  return tmp_buffer_.start();
-}
-
-
-const char* NameConverter::NameOfConstant(byte* addr) const {
-  return NameOfAddress(addr);
-}
-
-
-const char* NameConverter::NameOfCPURegister(int reg) const {
-  return v8::internal::Registers::Name(reg);
-}
-
-
-const char* NameConverter::NameOfXMMRegister(int reg) const {
-  return v8::internal::FPURegisters::Name(reg);
-}
-
-
-const char* NameConverter::NameOfByteCPURegister(int reg) const {
-  UNREACHABLE();  // MIPS does not have the concept of a byte register.
-  return "nobytereg";
-}
-
-
-const char* NameConverter::NameInCode(byte* addr) const {
-  // The default name converter is called for unknown code. So we will not try
-  // to access any memory.
-  return "";
-}
-
-
-//------------------------------------------------------------------------------
-
-Disassembler::Disassembler(const NameConverter& converter)
-    : converter_(converter) {}
-
-
-Disassembler::~Disassembler() {}
-
-
-int Disassembler::InstructionDecode(v8::internal::Vector<char> buffer,
-                                    byte* instruction) {
-  v8::internal::Decoder d(converter_, buffer);
-  return d.InstructionDecode(instruction);
-}
-
-
-// The MIPS assembler does not currently use constant pools.
-int Disassembler::ConstantPoolSizeAt(byte* instruction) {
-  return -1;
-}
-
-
-void Disassembler::Disassemble(FILE* f, byte* begin, byte* end) {
-  NameConverter converter;
-  Disassembler d(converter);
-  for (byte* pc = begin; pc < end;) {
-    v8::internal::EmbeddedVector<char, 128> buffer;
-    buffer[0] = '\0';
-    byte* prev_pc = pc;
-    pc += d.InstructionDecode(buffer, pc);
-    v8::internal::PrintF(f, "%p    %08x      %s\n", static_cast<void*>(prev_pc),
-                         *reinterpret_cast<int32_t*>(prev_pc), buffer.start());
-  }
-}
-
-
-#undef UNSUPPORTED
-
-}  // namespace disasm
-
-#endif  // V8_TARGET_ARCH_MIPS
diff --git a/src/v8/src/mips/frame-constants-mips.cc b/src/v8/src/mips/frame-constants-mips.cc
deleted file mode 100644
index fde4306..0000000
--- a/src/v8/src/mips/frame-constants-mips.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2011 the V8 project 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 V8_TARGET_ARCH_MIPS
-
-#include "src/assembler.h"
-#include "src/frame-constants.h"
-#include "src/mips/assembler-mips-inl.h"
-#include "src/mips/assembler-mips.h"
-
-#include "src/mips/frame-constants-mips.h"
-
-namespace v8 {
-namespace internal {
-
-Register JavaScriptFrame::fp_register() { return v8::internal::fp; }
-Register JavaScriptFrame::context_register() { return cp; }
-Register JavaScriptFrame::constant_pool_pointer_register() { UNREACHABLE(); }
-
-int InterpreterFrameConstants::RegisterStackSlotCount(int register_count) {
-  return register_count;
-}
-
-int BuiltinContinuationFrameConstants::PaddingSlotCount(int register_count) {
-  USE(register_count);
-  return 0;
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_MIPS
diff --git a/src/v8/src/mips/frame-constants-mips.h b/src/v8/src/mips/frame-constants-mips.h
deleted file mode 100644
index 3444537..0000000
--- a/src/v8/src/mips/frame-constants-mips.h
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_MIPS_FRAMES_MIPS_H_
-#define V8_MIPS_FRAMES_MIPS_H_
-
-namespace v8 {
-namespace internal {
-
-class EntryFrameConstants : public AllStatic {
- public:
-  static const int kCallerFPOffset =
-      -(StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize);
-};
-
-class ExitFrameConstants : public TypedFrameConstants {
- public:
-  static const int kSPOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(0);
-  static const int kCodeOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(1);
-  DEFINE_TYPED_FRAME_SIZES(2);
-
-  // The caller fields are below the frame pointer on the stack.
-  static const int kCallerFPOffset = +0 * kPointerSize;
-  // The calling JS function is between FP and PC.
-  static const int kCallerPCOffset = +1 * kPointerSize;
-
-  // MIPS-specific: a pointer to the old sp to avoid unnecessary calculations.
-  static const int kCallerSPOffset = +2 * kPointerSize;
-
-  // FP-relative displacement of the caller's SP.
-  static const int kCallerSPDisplacement = +2 * kPointerSize;
-
-  static const int kConstantPoolOffset = 0;  // Not used.
-};
-
-class JavaScriptFrameConstants : public AllStatic {
- public:
-  // FP-relative.
-  static const int kLocal0Offset = StandardFrameConstants::kExpressionsOffset;
-  static const int kLastParameterOffset = +2 * kPointerSize;
-  static const int kFunctionOffset = StandardFrameConstants::kFunctionOffset;
-
-  // Caller SP-relative.
-  static const int kParam0Offset = -2 * kPointerSize;
-  static const int kReceiverOffset = -1 * kPointerSize;
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif
diff --git a/src/v8/src/mips/interface-descriptors-mips.cc b/src/v8/src/mips/interface-descriptors-mips.cc
deleted file mode 100644
index 795fdc4..0000000
--- a/src/v8/src/mips/interface-descriptors-mips.cc
+++ /dev/null
@@ -1,350 +0,0 @@
-// Copyright 2012 the V8 project 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 V8_TARGET_ARCH_MIPS
-
-#include "src/interface-descriptors.h"
-
-namespace v8 {
-namespace internal {
-
-const Register CallInterfaceDescriptor::ContextRegister() { return cp; }
-
-void CallInterfaceDescriptor::DefaultInitializePlatformSpecific(
-    CallInterfaceDescriptorData* data, int register_parameter_count) {
-  const Register default_stub_registers[] = {a0, a1, a2, a3, t0};
-  CHECK_LE(static_cast<size_t>(register_parameter_count),
-           arraysize(default_stub_registers));
-  data->InitializePlatformSpecific(register_parameter_count,
-                                   default_stub_registers);
-}
-
-void RecordWriteDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  const Register default_stub_registers[] = {a0, a1, a2, a3, kReturnRegister0};
-
-  data->RestrictAllocatableRegisters(default_stub_registers,
-                                     arraysize(default_stub_registers));
-
-  CHECK_LE(static_cast<size_t>(kParameterCount),
-           arraysize(default_stub_registers));
-  data->InitializePlatformSpecific(kParameterCount, default_stub_registers);
-}
-
-const Register FastNewFunctionContextDescriptor::FunctionRegister() {
-  return a1;
-}
-const Register FastNewFunctionContextDescriptor::SlotsRegister() { return a0; }
-
-const Register LoadDescriptor::ReceiverRegister() { return a1; }
-const Register LoadDescriptor::NameRegister() { return a2; }
-const Register LoadDescriptor::SlotRegister() { return a0; }
-
-const Register LoadWithVectorDescriptor::VectorRegister() { return a3; }
-
-const Register StoreDescriptor::ReceiverRegister() { return a1; }
-const Register StoreDescriptor::NameRegister() { return a2; }
-const Register StoreDescriptor::ValueRegister() { return a0; }
-const Register StoreDescriptor::SlotRegister() { return t0; }
-
-const Register StoreWithVectorDescriptor::VectorRegister() { return a3; }
-
-const Register StoreTransitionDescriptor::SlotRegister() { return t0; }
-const Register StoreTransitionDescriptor::VectorRegister() { return a3; }
-const Register StoreTransitionDescriptor::MapRegister() { return t1; }
-
-const Register ApiGetterDescriptor::HolderRegister() { return a0; }
-const Register ApiGetterDescriptor::CallbackRegister() { return a3; }
-
-const Register MathPowTaggedDescriptor::exponent() { return a2; }
-
-const Register MathPowIntegerDescriptor::exponent() {
-  return MathPowTaggedDescriptor::exponent();
-}
-
-
-const Register GrowArrayElementsDescriptor::ObjectRegister() { return a0; }
-const Register GrowArrayElementsDescriptor::KeyRegister() { return a3; }
-
-
-void FastNewClosureDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {a1, a2, a3};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-// static
-const Register TypeConversionDescriptor::ArgumentRegister() { return a0; }
-
-void TypeofDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {a3};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void CallFunctionDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {a1};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void CallTrampolineDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // a1: target
-  // a0: number of arguments
-  Register registers[] = {a1, a0};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // a0 : number of arguments (on the stack, not including receiver)
-  // a1 : the target to call
-  // a2 : arguments list (FixedArray)
-  // t0 : arguments list length (untagged)
-  Register registers[] = {a1, a0, a2, t0};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallForwardVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // a1: the target to call
-  // a0: number of arguments
-  // a2: start index (to support rest parameters)
-  Register registers[] = {a1, a0, a2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallWithSpreadDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // a0 : number of arguments (on the stack, not including receiver)
-  // a1 : the target to call
-  // a2 : the object to spread
-  Register registers[] = {a1, a0, a2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallWithArrayLikeDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // a1 : the target to call
-  // a2 : the arguments list
-  Register registers[] = {a1, a2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // a0 : number of arguments (on the stack, not including receiver)
-  // a1 : the target to call
-  // a3 : the new target
-  // a2 : arguments list (FixedArray)
-  // t0 : arguments list length (untagged)
-  Register registers[] = {a1, a3, a0, a2, t0};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructForwardVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // a1: the target to call
-  // a3: new target
-  // a0: number of arguments
-  // a2: start index (to support rest parameters)
-  Register registers[] = {a1, a3, a0, a2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructWithSpreadDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // a0 : number of arguments (on the stack, not including receiver)
-  // a1 : the target to call
-  // a3 : the new target
-  // a2 : the object to spread
-  Register registers[] = {a1, a3, a0, a2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructWithArrayLikeDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // a1 : the target to call
-  // a3 : the new target
-  // a2 : the arguments list
-  Register registers[] = {a1, a3, a2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructStubDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // a1: target
-  // a3: new target
-  // a0: number of arguments
-  // a2: allocation site or undefined
-  Register registers[] = {a1, a3, a0, a2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-
-void ConstructTrampolineDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // a1: target
-  // a3: new target
-  // a0: number of arguments
-  Register registers[] = {a1, a3, a0};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-
-void TransitionElementsKindDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {a0, a1};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void AbortJSDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {a0};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void AllocateHeapNumberDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // register state
-  data->InitializePlatformSpecific(0, nullptr, nullptr);
-}
-
-void ArrayConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // kTarget, kNewTarget, kActualArgumentsCount, kAllocationSite
-  Register registers[] = {a1, a3, a0, a2};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void ArrayNoArgumentConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // register state
-  // a0 -- number of arguments
-  // a1 -- function
-  // a2 -- allocation site with elements kind
-  Register registers[] = {a1, a2, a0};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void ArraySingleArgumentConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // register state
-  // a0 -- number of arguments
-  // a1 -- function
-  // a2 -- allocation site with elements kind
-  Register registers[] = {a1, a2, a0};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void ArrayNArgumentsConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // stack param count needs (constructor pointer, and single argument)
-  Register registers[] = {a1, a2, a0};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CompareDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {a1, a0};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-
-void BinaryOpDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {a1, a0};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void StringAddDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {a1, a0};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void ArgumentAdaptorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      a1,  // JSFunction
-      a3,  // the new target
-      a0,  // actual number of arguments
-      a2,  // expected number of arguments
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ApiCallbackDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      JavaScriptFrame::context_register(),  // callee context
-      t0,                                   // call_data
-      a2,                                   // holder
-      a1,                                   // api_function_address
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterDispatchDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      kInterpreterAccumulatorRegister, kInterpreterBytecodeOffsetRegister,
-      kInterpreterBytecodeArrayRegister, kInterpreterDispatchTableRegister};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterPushArgsThenCallDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      a0,  // argument count (not including receiver)
-      a2,  // address of first argument
-      a1   // the target callable to be call
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterPushArgsThenConstructDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      a0,  // argument count (not including receiver)
-      a3,  // new target
-      a1,  // constructor to call
-      a2,  // allocation site feedback if available, undefined otherwise.
-      t4   // address of the first argument
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterCEntryDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      a0,  // argument count (argc)
-      a2,  // address of first argument (argv)
-      a1   // the runtime function to call
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ResumeGeneratorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      v0,  // the value to pass to the generator
-      a1   // the JSGeneratorObject to resume
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void FrameDropperTrampolineDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      a1,  // loaded new FP
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_MIPS
diff --git a/src/v8/src/mips/macro-assembler-mips.cc b/src/v8/src/mips/macro-assembler-mips.cc
deleted file mode 100644
index 5c89467..0000000
--- a/src/v8/src/mips/macro-assembler-mips.cc
+++ /dev/null
@@ -1,5280 +0,0 @@
-// Copyright 2012 the V8 project 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 <limits.h>  // For LONG_MIN, LONG_MAX.
-
-#if V8_TARGET_ARCH_MIPS
-
-#include "src/base/bits.h"
-#include "src/base/division-by-constant.h"
-#include "src/bootstrapper.h"
-#include "src/callable.h"
-#include "src/code-stubs.h"
-#include "src/debug/debug.h"
-#include "src/external-reference-table.h"
-#include "src/frames-inl.h"
-#include "src/mips/assembler-mips-inl.h"
-#include "src/mips/macro-assembler-mips.h"
-#include "src/register-configuration.h"
-#include "src/runtime/runtime.h"
-
-namespace v8 {
-namespace internal {
-
-MacroAssembler::MacroAssembler(Isolate* isolate, void* buffer, int size,
-                               CodeObjectRequired create_code_object)
-    : TurboAssembler(isolate, buffer, size, create_code_object) {}
-
-TurboAssembler::TurboAssembler(Isolate* isolate, void* buffer, int buffer_size,
-                               CodeObjectRequired create_code_object)
-    : Assembler(isolate, buffer, buffer_size),
-      isolate_(isolate),
-      has_double_zero_reg_set_(false) {
-  if (create_code_object == CodeObjectRequired::kYes) {
-    code_object_ =
-        Handle<HeapObject>::New(isolate->heap()->undefined_value(), isolate);
-  }
-}
-
-int TurboAssembler::RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode,
-                                                    Register exclusion1,
-                                                    Register exclusion2,
-                                                    Register exclusion3) const {
-  int bytes = 0;
-  RegList exclusions = 0;
-  if (exclusion1 != no_reg) {
-    exclusions |= exclusion1.bit();
-    if (exclusion2 != no_reg) {
-      exclusions |= exclusion2.bit();
-      if (exclusion3 != no_reg) {
-        exclusions |= exclusion3.bit();
-      }
-    }
-  }
-
-  RegList list = kJSCallerSaved & ~exclusions;
-  bytes += NumRegs(list) * kPointerSize;
-
-  if (fp_mode == kSaveFPRegs) {
-    bytes += NumRegs(kCallerSavedFPU) * kDoubleSize;
-  }
-
-  return bytes;
-}
-
-int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
-                                    Register exclusion2, Register exclusion3) {
-  int bytes = 0;
-  RegList exclusions = 0;
-  if (exclusion1 != no_reg) {
-    exclusions |= exclusion1.bit();
-    if (exclusion2 != no_reg) {
-      exclusions |= exclusion2.bit();
-      if (exclusion3 != no_reg) {
-        exclusions |= exclusion3.bit();
-      }
-    }
-  }
-
-  RegList list = kJSCallerSaved & ~exclusions;
-  MultiPush(list);
-  bytes += NumRegs(list) * kPointerSize;
-
-  if (fp_mode == kSaveFPRegs) {
-    MultiPushFPU(kCallerSavedFPU);
-    bytes += NumRegs(kCallerSavedFPU) * kDoubleSize;
-  }
-
-  return bytes;
-}
-
-int TurboAssembler::PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
-                                   Register exclusion2, Register exclusion3) {
-  int bytes = 0;
-  if (fp_mode == kSaveFPRegs) {
-    MultiPopFPU(kCallerSavedFPU);
-    bytes += NumRegs(kCallerSavedFPU) * kDoubleSize;
-  }
-
-  RegList exclusions = 0;
-  if (exclusion1 != no_reg) {
-    exclusions |= exclusion1.bit();
-    if (exclusion2 != no_reg) {
-      exclusions |= exclusion2.bit();
-      if (exclusion3 != no_reg) {
-        exclusions |= exclusion3.bit();
-      }
-    }
-  }
-
-  RegList list = kJSCallerSaved & ~exclusions;
-  MultiPop(list);
-  bytes += NumRegs(list) * kPointerSize;
-
-  return bytes;
-}
-
-void TurboAssembler::LoadRoot(Register destination, Heap::RootListIndex index) {
-  lw(destination, MemOperand(s6, index << kPointerSizeLog2));
-}
-
-void TurboAssembler::LoadRoot(Register destination, Heap::RootListIndex index,
-                              Condition cond, Register src1,
-                              const Operand& src2) {
-  Branch(2, NegateCondition(cond), src1, src2);
-  lw(destination, MemOperand(s6, index << kPointerSizeLog2));
-}
-
-
-void TurboAssembler::PushCommonFrame(Register marker_reg) {
-  if (marker_reg.is_valid()) {
-    Push(ra, fp, marker_reg);
-    Addu(fp, sp, Operand(kPointerSize));
-  } else {
-    Push(ra, fp);
-    mov(fp, sp);
-  }
-}
-
-void TurboAssembler::PushStandardFrame(Register function_reg) {
-  int offset = -StandardFrameConstants::kContextOffset;
-  if (function_reg.is_valid()) {
-    Push(ra, fp, cp, function_reg);
-    offset += kPointerSize;
-  } else {
-    Push(ra, fp, cp);
-  }
-  Addu(fp, sp, Operand(offset));
-}
-
-// Push and pop all registers that can hold pointers.
-void MacroAssembler::PushSafepointRegisters() {
-  // Safepoints expect a block of kNumSafepointRegisters values on the
-  // stack, so adjust the stack for unsaved registers.
-  const int num_unsaved = kNumSafepointRegisters - kNumSafepointSavedRegisters;
-  DCHECK_GE(num_unsaved, 0);
-  if (num_unsaved > 0) {
-    Subu(sp, sp, Operand(num_unsaved * kPointerSize));
-  }
-  MultiPush(kSafepointSavedRegisters);
-}
-
-
-void MacroAssembler::PopSafepointRegisters() {
-  const int num_unsaved = kNumSafepointRegisters - kNumSafepointSavedRegisters;
-  MultiPop(kSafepointSavedRegisters);
-  if (num_unsaved > 0) {
-    Addu(sp, sp, Operand(num_unsaved * kPointerSize));
-  }
-}
-
-int MacroAssembler::SafepointRegisterStackIndex(int reg_code) {
-  // The registers are pushed starting with the highest encoding,
-  // which means that lowest encodings are closest to the stack pointer.
-  return kSafepointRegisterStackIndexMap[reg_code];
-}
-
-
-// Clobbers object, dst, value, and ra, if (ra_status == kRAHasBeenSaved)
-// The register 'object' contains a heap object pointer.  The heap object
-// tag is shifted away.
-void MacroAssembler::RecordWriteField(Register object, int offset,
-                                      Register value, Register dst,
-                                      RAStatus ra_status,
-                                      SaveFPRegsMode save_fp,
-                                      RememberedSetAction remembered_set_action,
-                                      SmiCheck smi_check) {
-  DCHECK(!AreAliased(value, dst, t8, object));
-  // First, check if a write barrier is even needed. The tests below
-  // catch stores of Smis.
-  Label done;
-
-  // Skip barrier if writing a smi.
-  if (smi_check == INLINE_SMI_CHECK) {
-    JumpIfSmi(value, &done);
-  }
-
-  // Although the object register is tagged, the offset is relative to the start
-  // of the object, so so offset must be a multiple of kPointerSize.
-  DCHECK(IsAligned(offset, kPointerSize));
-
-  Addu(dst, object, Operand(offset - kHeapObjectTag));
-  if (emit_debug_code()) {
-    Label ok;
-    And(t8, dst, Operand(kPointerSize - 1));
-    Branch(&ok, eq, t8, Operand(zero_reg));
-    stop("Unaligned cell in write barrier");
-    bind(&ok);
-  }
-
-  RecordWrite(object, dst, value, ra_status, save_fp, remembered_set_action,
-              OMIT_SMI_CHECK);
-
-  bind(&done);
-
-  // Clobber clobbered input registers when running with the debug-code flag
-  // turned on to provoke errors.
-  if (emit_debug_code()) {
-    li(value, Operand(bit_cast<int32_t>(kZapValue + 4)));
-    li(dst, Operand(bit_cast<int32_t>(kZapValue + 8)));
-  }
-}
-
-void TurboAssembler::SaveRegisters(RegList registers) {
-  DCHECK_GT(NumRegs(registers), 0);
-  RegList regs = 0;
-  for (int i = 0; i < Register::kNumRegisters; ++i) {
-    if ((registers >> i) & 1u) {
-      regs |= Register::from_code(i).bit();
-    }
-  }
-  MultiPush(regs);
-}
-
-void TurboAssembler::RestoreRegisters(RegList registers) {
-  DCHECK_GT(NumRegs(registers), 0);
-  RegList regs = 0;
-  for (int i = 0; i < Register::kNumRegisters; ++i) {
-    if ((registers >> i) & 1u) {
-      regs |= Register::from_code(i).bit();
-    }
-  }
-  MultiPop(regs);
-}
-
-void TurboAssembler::CallRecordWriteStub(
-    Register object, Register address,
-    RememberedSetAction remembered_set_action, SaveFPRegsMode fp_mode) {
-  // TODO(albertnetymk): For now we ignore remembered_set_action and fp_mode,
-  // i.e. always emit remember set and save FP registers in RecordWriteStub. If
-  // large performance regression is observed, we should use these values to
-  // avoid unnecessary work.
-
-  Callable const callable =
-      Builtins::CallableFor(isolate(), Builtins::kRecordWrite);
-  RegList registers = callable.descriptor().allocatable_registers();
-
-  SaveRegisters(registers);
-  Register object_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kObject));
-  Register slot_parameter(
-      callable.descriptor().GetRegisterParameter(RecordWriteDescriptor::kSlot));
-  Register isolate_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kIsolate));
-  Register remembered_set_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kRememberedSet));
-  Register fp_mode_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kFPMode));
-
-  Push(object);
-  Push(address);
-
-  Pop(slot_parameter);
-  Pop(object_parameter);
-
-  li(isolate_parameter, Operand(ExternalReference::isolate_address(isolate())));
-  Move(remembered_set_parameter, Smi::FromEnum(remembered_set_action));
-  Move(fp_mode_parameter, Smi::FromEnum(fp_mode));
-  Call(callable.code(), RelocInfo::CODE_TARGET);
-
-  RestoreRegisters(registers);
-}
-
-// Clobbers object, address, value, and ra, if (ra_status == kRAHasBeenSaved)
-// The register 'object' contains a heap object pointer.  The heap object
-// tag is shifted away.
-void MacroAssembler::RecordWrite(Register object, Register address,
-                                 Register value, RAStatus ra_status,
-                                 SaveFPRegsMode fp_mode,
-                                 RememberedSetAction remembered_set_action,
-                                 SmiCheck smi_check) {
-  DCHECK(!AreAliased(object, address, value, t8));
-  DCHECK(!AreAliased(object, address, value, t9));
-
-  if (emit_debug_code()) {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    lw(scratch, MemOperand(address));
-    Assert(eq, AbortReason::kWrongAddressOrValuePassedToRecordWrite, scratch,
-           Operand(value));
-  }
-
-  if (remembered_set_action == OMIT_REMEMBERED_SET &&
-      !FLAG_incremental_marking) {
-    return;
-  }
-
-  // First, check if a write barrier is even needed. The tests below
-  // catch stores of smis and stores into the young generation.
-  Label done;
-
-  if (smi_check == INLINE_SMI_CHECK) {
-    DCHECK_EQ(0, kSmiTag);
-    JumpIfSmi(value, &done);
-  }
-
-  CheckPageFlag(value,
-                value,  // Used as scratch.
-                MemoryChunk::kPointersToHereAreInterestingMask, eq, &done);
-  CheckPageFlag(object,
-                value,  // Used as scratch.
-                MemoryChunk::kPointersFromHereAreInterestingMask,
-                eq,
-                &done);
-
-  // Record the actual write.
-  if (ra_status == kRAHasNotBeenSaved) {
-    push(ra);
-  }
-  CallRecordWriteStub(object, address, remembered_set_action, fp_mode);
-  if (ra_status == kRAHasNotBeenSaved) {
-    pop(ra);
-  }
-
-  bind(&done);
-
-  {
-    // Count number of write barriers in generated code.
-    isolate()->counters()->write_barriers_static()->Increment();
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    IncrementCounter(isolate()->counters()->write_barriers_dynamic(), 1,
-                     scratch, value);
-  }
-
-  // Clobber clobbered registers when running with the debug-code flag
-  // turned on to provoke errors.
-  if (emit_debug_code()) {
-    li(address, Operand(bit_cast<int32_t>(kZapValue + 12)));
-    li(value, Operand(bit_cast<int32_t>(kZapValue + 16)));
-  }
-}
-
-// ---------------------------------------------------------------------------
-// Instruction macros.
-
-void TurboAssembler::Addu(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    addu(rd, rs, rt.rm());
-  } else {
-    if (is_int16(rt.immediate()) && !MustUseReg(rt.rmode())) {
-      addiu(rd, rs, rt.immediate());
-    } else {
-      // li handles the relocation.
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      DCHECK(rs != scratch);
-      li(scratch, rt);
-      addu(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Subu(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    subu(rd, rs, rt.rm());
-  } else {
-    if (is_int16(-rt.immediate()) && !MustUseReg(rt.rmode())) {
-      addiu(rd, rs, -rt.immediate());  // No subiu instr, use addiu(x, y, -imm).
-    } else if (!(-rt.immediate() & kHiMask) &&
-               !MustUseReg(rt.rmode())) {  // Use load
-      // -imm and addu for cases where loading -imm generates one instruction.
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      DCHECK(rs != scratch);
-      li(scratch, -rt.immediate());
-      addu(rd, rs, scratch);
-    } else {
-      // li handles the relocation.
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      DCHECK(rs != scratch);
-      li(scratch, rt);
-      subu(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Mul(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    if (IsMipsArchVariant(kLoongson)) {
-      mult(rs, rt.rm());
-      mflo(rd);
-    } else {
-      mul(rd, rs, rt.rm());
-    }
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    if (IsMipsArchVariant(kLoongson)) {
-      mult(rs, scratch);
-      mflo(rd);
-    } else {
-      mul(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Mul(Register rd_hi, Register rd_lo, Register rs,
-                         const Operand& rt) {
-  if (rt.is_reg()) {
-    if (!IsMipsArchVariant(kMips32r6)) {
-      mult(rs, rt.rm());
-      mflo(rd_lo);
-      mfhi(rd_hi);
-    } else {
-      if (rd_lo == rs) {
-        DCHECK(rd_hi != rs);
-        DCHECK(rd_hi != rt.rm() && rd_lo != rt.rm());
-        muh(rd_hi, rs, rt.rm());
-        mul(rd_lo, rs, rt.rm());
-      } else {
-        DCHECK(rd_hi != rt.rm() && rd_lo != rt.rm());
-        mul(rd_lo, rs, rt.rm());
-        muh(rd_hi, rs, rt.rm());
-      }
-    }
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    if (!IsMipsArchVariant(kMips32r6)) {
-      mult(rs, scratch);
-      mflo(rd_lo);
-      mfhi(rd_hi);
-    } else {
-      if (rd_lo == rs) {
-        DCHECK(rd_hi != rs);
-        DCHECK(rd_hi != scratch && rd_lo != scratch);
-        muh(rd_hi, rs, scratch);
-        mul(rd_lo, rs, scratch);
-      } else {
-        DCHECK(rd_hi != scratch && rd_lo != scratch);
-        mul(rd_lo, rs, scratch);
-        muh(rd_hi, rs, scratch);
-      }
-    }
-  }
-}
-
-void TurboAssembler::Mulu(Register rd_hi, Register rd_lo, Register rs,
-                          const Operand& rt) {
-  Register reg = no_reg;
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  if (rt.is_reg()) {
-    reg = rt.rm();
-  } else {
-    DCHECK(rs != scratch);
-    reg = scratch;
-    li(reg, rt);
-  }
-
-  if (!IsMipsArchVariant(kMips32r6)) {
-    multu(rs, reg);
-    mflo(rd_lo);
-    mfhi(rd_hi);
-  } else {
-    if (rd_lo == rs) {
-      DCHECK(rd_hi != rs);
-      DCHECK(rd_hi != reg && rd_lo != reg);
-      muhu(rd_hi, rs, reg);
-      mulu(rd_lo, rs, reg);
-    } else {
-      DCHECK(rd_hi != reg && rd_lo != reg);
-      mulu(rd_lo, rs, reg);
-      muhu(rd_hi, rs, reg);
-    }
-  }
-}
-
-void TurboAssembler::Mulh(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    if (!IsMipsArchVariant(kMips32r6)) {
-      mult(rs, rt.rm());
-      mfhi(rd);
-    } else {
-      muh(rd, rs, rt.rm());
-    }
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    if (!IsMipsArchVariant(kMips32r6)) {
-      mult(rs, scratch);
-      mfhi(rd);
-    } else {
-      muh(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Mult(Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    mult(rs, rt.rm());
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    mult(rs, scratch);
-  }
-}
-
-void TurboAssembler::Mulhu(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    if (!IsMipsArchVariant(kMips32r6)) {
-      multu(rs, rt.rm());
-      mfhi(rd);
-    } else {
-      muhu(rd, rs, rt.rm());
-    }
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    if (!IsMipsArchVariant(kMips32r6)) {
-      multu(rs, scratch);
-      mfhi(rd);
-    } else {
-      muhu(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Multu(Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    multu(rs, rt.rm());
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    multu(rs, scratch);
-  }
-}
-
-void TurboAssembler::Div(Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    div(rs, rt.rm());
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    div(rs, scratch);
-  }
-}
-
-void TurboAssembler::Div(Register rem, Register res, Register rs,
-                         const Operand& rt) {
-  if (rt.is_reg()) {
-    if (!IsMipsArchVariant(kMips32r6)) {
-      div(rs, rt.rm());
-      mflo(res);
-      mfhi(rem);
-    } else {
-      div(res, rs, rt.rm());
-      mod(rem, rs, rt.rm());
-    }
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    if (!IsMipsArchVariant(kMips32r6)) {
-      div(rs, scratch);
-      mflo(res);
-      mfhi(rem);
-    } else {
-      div(res, rs, scratch);
-      mod(rem, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Div(Register res, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    if (!IsMipsArchVariant(kMips32r6)) {
-      div(rs, rt.rm());
-      mflo(res);
-    } else {
-      div(res, rs, rt.rm());
-    }
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    if (!IsMipsArchVariant(kMips32r6)) {
-      div(rs, scratch);
-      mflo(res);
-    } else {
-      div(res, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Mod(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    if (!IsMipsArchVariant(kMips32r6)) {
-      div(rs, rt.rm());
-      mfhi(rd);
-    } else {
-      mod(rd, rs, rt.rm());
-    }
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    if (!IsMipsArchVariant(kMips32r6)) {
-      div(rs, scratch);
-      mfhi(rd);
-    } else {
-      mod(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Modu(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    if (!IsMipsArchVariant(kMips32r6)) {
-      divu(rs, rt.rm());
-      mfhi(rd);
-    } else {
-      modu(rd, rs, rt.rm());
-    }
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    if (!IsMipsArchVariant(kMips32r6)) {
-      divu(rs, scratch);
-      mfhi(rd);
-    } else {
-      modu(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Divu(Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    divu(rs, rt.rm());
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    divu(rs, scratch);
-  }
-}
-
-void TurboAssembler::Divu(Register res, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    if (!IsMipsArchVariant(kMips32r6)) {
-      divu(rs, rt.rm());
-      mflo(res);
-    } else {
-      divu(res, rs, rt.rm());
-    }
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    if (!IsMipsArchVariant(kMips32r6)) {
-      divu(rs, scratch);
-      mflo(res);
-    } else {
-      divu(res, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::And(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    and_(rd, rs, rt.rm());
-  } else {
-    if (is_uint16(rt.immediate()) && !MustUseReg(rt.rmode())) {
-      andi(rd, rs, rt.immediate());
-    } else {
-      // li handles the relocation.
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      DCHECK(rs != scratch);
-      li(scratch, rt);
-      and_(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Or(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    or_(rd, rs, rt.rm());
-  } else {
-    if (is_uint16(rt.immediate()) && !MustUseReg(rt.rmode())) {
-      ori(rd, rs, rt.immediate());
-    } else {
-      // li handles the relocation.
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      DCHECK(rs != scratch);
-      li(scratch, rt);
-      or_(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Xor(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    xor_(rd, rs, rt.rm());
-  } else {
-    if (is_uint16(rt.immediate()) && !MustUseReg(rt.rmode())) {
-      xori(rd, rs, rt.immediate());
-    } else {
-      // li handles the relocation.
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      DCHECK(rs != scratch);
-      li(scratch, rt);
-      xor_(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Nor(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    nor(rd, rs, rt.rm());
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    nor(rd, rs, scratch);
-  }
-}
-
-void TurboAssembler::Neg(Register rs, const Operand& rt) {
-  subu(rs, zero_reg, rt.rm());
-}
-
-void TurboAssembler::Slt(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    slt(rd, rs, rt.rm());
-  } else {
-    if (is_int16(rt.immediate()) && !MustUseReg(rt.rmode())) {
-      slti(rd, rs, rt.immediate());
-    } else {
-      // li handles the relocation.
-      UseScratchRegisterScope temps(this);
-      Register scratch = rd == at ? t8 : temps.Acquire();
-      DCHECK(rs != scratch);
-      li(scratch, rt);
-      slt(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Sltu(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    sltu(rd, rs, rt.rm());
-  } else {
-    const uint32_t int16_min = std::numeric_limits<int16_t>::min();
-    if (is_uint15(rt.immediate()) && !MustUseReg(rt.rmode())) {
-      // Imm range is: [0, 32767].
-      sltiu(rd, rs, rt.immediate());
-    } else if (is_uint15(rt.immediate() - int16_min) &&
-               !MustUseReg(rt.rmode())) {
-      // Imm range is: [max_unsigned-32767,max_unsigned].
-      sltiu(rd, rs, static_cast<uint16_t>(rt.immediate()));
-    } else {
-      // li handles the relocation.
-      UseScratchRegisterScope temps(this);
-      Register scratch = rd == at ? t8 : temps.Acquire();
-      DCHECK(rs != scratch);
-      li(scratch, rt);
-      sltu(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Ror(Register rd, Register rs, const Operand& rt) {
-  if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) {
-    if (rt.is_reg()) {
-      rotrv(rd, rs, rt.rm());
-    } else {
-      rotr(rd, rs, rt.immediate() & 0x1F);
-    }
-  } else {
-    if (rt.is_reg()) {
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.hasAvailable() ? temps.Acquire() : t8;
-      subu(scratch, zero_reg, rt.rm());
-      sllv(scratch, rs, scratch);
-      srlv(rd, rs, rt.rm());
-      or_(rd, rd, scratch);
-    } else {
-      if (rt.immediate() == 0) {
-        srl(rd, rs, 0);
-      } else {
-        UseScratchRegisterScope temps(this);
-        Register scratch = temps.Acquire();
-        srl(scratch, rs, rt.immediate() & 0x1F);
-        sll(rd, rs, (0x20 - (rt.immediate() & 0x1F)) & 0x1F);
-        or_(rd, rd, scratch);
-      }
-    }
-  }
-}
-
-
-void MacroAssembler::Pref(int32_t hint, const MemOperand& rs) {
-  if (IsMipsArchVariant(kLoongson)) {
-    lw(zero_reg, rs);
-  } else {
-    pref(hint, rs);
-  }
-}
-
-void TurboAssembler::Lsa(Register rd, Register rt, Register rs, uint8_t sa,
-                         Register scratch) {
-  DCHECK(sa >= 1 && sa <= 31);
-  if (IsMipsArchVariant(kMips32r6) && sa <= 4) {
-    lsa(rd, rt, rs, sa - 1);
-  } else {
-    Register tmp = rd == rt ? scratch : rd;
-    DCHECK(tmp != rt);
-    sll(tmp, rs, sa);
-    Addu(rd, rt, tmp);
-  }
-}
-
-void TurboAssembler::Bovc(Register rs, Register rt, Label* L) {
-  if (is_trampoline_emitted()) {
-    Label skip;
-    bnvc(rs, rt, &skip);
-    BranchLong(L, PROTECT);
-    bind(&skip);
-  } else {
-    bovc(rs, rt, L);
-  }
-}
-
-void TurboAssembler::Bnvc(Register rs, Register rt, Label* L) {
-  if (is_trampoline_emitted()) {
-    Label skip;
-    bovc(rs, rt, &skip);
-    BranchLong(L, PROTECT);
-    bind(&skip);
-  } else {
-    bnvc(rs, rt, L);
-  }
-}
-
-// ------------Pseudo-instructions-------------
-
-// Word Swap Byte
-void TurboAssembler::ByteSwapSigned(Register dest, Register src,
-                                    int operand_size) {
-  DCHECK(operand_size == 1 || operand_size == 2 || operand_size == 4);
-
-  if (operand_size == 2) {
-    Seh(src, src);
-  } else if (operand_size == 1) {
-    Seb(src, src);
-  }
-  // No need to do any preparation if operand_size is 4
-
-  if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) {
-    wsbh(dest, src);
-    rotr(dest, dest, 16);
-  } else if (IsMipsArchVariant(kMips32r1) || IsMipsArchVariant(kLoongson)) {
-    Register tmp = t0;
-    Register tmp2 = t1;
-
-    andi(tmp2, src, 0xFF);
-    sll(tmp2, tmp2, 24);
-    or_(tmp, zero_reg, tmp2);
-
-    andi(tmp2, src, 0xFF00);
-    sll(tmp2, tmp2, 8);
-    or_(tmp, tmp, tmp2);
-
-    srl(src, src, 8);
-    andi(tmp2, src, 0xFF00);
-    or_(tmp, tmp, tmp2);
-
-    srl(src, src, 16);
-    andi(tmp2, src, 0xFF);
-    or_(tmp, tmp, tmp2);
-
-    or_(dest, tmp, zero_reg);
-  }
-}
-
-void TurboAssembler::ByteSwapUnsigned(Register dest, Register src,
-                                      int operand_size) {
-  DCHECK(operand_size == 1 || operand_size == 2);
-
-  if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) {
-    if (operand_size == 1) {
-      andi(src, src, 0xFF);
-    } else {
-      andi(src, src, 0xFFFF);
-    }
-    // No need to do any preparation if operand_size is 4
-
-    wsbh(dest, src);
-    rotr(dest, dest, 16);
-  } else if (IsMipsArchVariant(kMips32r1) || IsMipsArchVariant(kLoongson)) {
-    if (operand_size == 1) {
-      sll(src, src, 24);
-    } else {
-      Register tmp = t0;
-
-      andi(tmp, src, 0xFF00);
-      sll(src, src, 24);
-      sll(tmp, tmp, 8);
-      or_(dest, tmp, src);
-    }
-  }
-}
-
-void TurboAssembler::Ulw(Register rd, const MemOperand& rs) {
-  DCHECK(rd != at);
-  DCHECK(rs.rm() != at);
-  if (IsMipsArchVariant(kMips32r6)) {
-    lw(rd, rs);
-  } else {
-    DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r1) ||
-           IsMipsArchVariant(kLoongson));
-    DCHECK(kMipsLwrOffset <= 3 && kMipsLwlOffset <= 3);
-    MemOperand source = rs;
-    // Adjust offset for two accesses and check if offset + 3 fits into int16_t.
-    AdjustBaseAndOffset(source, OffsetAccessType::TWO_ACCESSES, 3);
-    if (rd != source.rm()) {
-      lwr(rd, MemOperand(source.rm(), source.offset() + kMipsLwrOffset));
-      lwl(rd, MemOperand(source.rm(), source.offset() + kMipsLwlOffset));
-    } else {
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      lwr(scratch, MemOperand(rs.rm(), rs.offset() + kMipsLwrOffset));
-      lwl(scratch, MemOperand(rs.rm(), rs.offset() + kMipsLwlOffset));
-      mov(rd, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Usw(Register rd, const MemOperand& rs) {
-  DCHECK(rd != at);
-  DCHECK(rs.rm() != at);
-  DCHECK(rd != rs.rm());
-  if (IsMipsArchVariant(kMips32r6)) {
-    sw(rd, rs);
-  } else {
-    DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r1) ||
-           IsMipsArchVariant(kLoongson));
-    DCHECK(kMipsSwrOffset <= 3 && kMipsSwlOffset <= 3);
-    MemOperand source = rs;
-    // Adjust offset for two accesses and check if offset + 3 fits into int16_t.
-    AdjustBaseAndOffset(source, OffsetAccessType::TWO_ACCESSES, 3);
-    swr(rd, MemOperand(source.rm(), source.offset() + kMipsSwrOffset));
-    swl(rd, MemOperand(source.rm(), source.offset() + kMipsSwlOffset));
-  }
-}
-
-void TurboAssembler::Ulh(Register rd, const MemOperand& rs) {
-  DCHECK(rd != at);
-  DCHECK(rs.rm() != at);
-  if (IsMipsArchVariant(kMips32r6)) {
-    lh(rd, rs);
-  } else {
-    DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r1) ||
-           IsMipsArchVariant(kLoongson));
-    MemOperand source = rs;
-    // Adjust offset for two accesses and check if offset + 1 fits into int16_t.
-    AdjustBaseAndOffset(source, OffsetAccessType::TWO_ACCESSES, 1);
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    if (source.rm() == scratch) {
-#if defined(V8_TARGET_LITTLE_ENDIAN)
-      lb(rd, MemOperand(source.rm(), source.offset() + 1));
-      lbu(scratch, source);
-#elif defined(V8_TARGET_BIG_ENDIAN)
-      lb(rd, source);
-      lbu(scratch, MemOperand(source.rm(), source.offset() + 1));
-#endif
-    } else {
-#if defined(V8_TARGET_LITTLE_ENDIAN)
-      lbu(scratch, source);
-      lb(rd, MemOperand(source.rm(), source.offset() + 1));
-#elif defined(V8_TARGET_BIG_ENDIAN)
-      lbu(scratch, MemOperand(source.rm(), source.offset() + 1));
-      lb(rd, source);
-#endif
-    }
-    sll(rd, rd, 8);
-    or_(rd, rd, scratch);
-  }
-}
-
-void TurboAssembler::Ulhu(Register rd, const MemOperand& rs) {
-  DCHECK(rd != at);
-  DCHECK(rs.rm() != at);
-  if (IsMipsArchVariant(kMips32r6)) {
-    lhu(rd, rs);
-  } else {
-    DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r1) ||
-           IsMipsArchVariant(kLoongson));
-    MemOperand source = rs;
-    // Adjust offset for two accesses and check if offset + 1 fits into int16_t.
-    AdjustBaseAndOffset(source, OffsetAccessType::TWO_ACCESSES, 1);
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    if (source.rm() == scratch) {
-#if defined(V8_TARGET_LITTLE_ENDIAN)
-      lbu(rd, MemOperand(source.rm(), source.offset() + 1));
-      lbu(scratch, source);
-#elif defined(V8_TARGET_BIG_ENDIAN)
-      lbu(rd, source);
-      lbu(scratch, MemOperand(source.rm(), source.offset() + 1));
-#endif
-    } else {
-#if defined(V8_TARGET_LITTLE_ENDIAN)
-      lbu(scratch, source);
-      lbu(rd, MemOperand(source.rm(), source.offset() + 1));
-#elif defined(V8_TARGET_BIG_ENDIAN)
-      lbu(scratch, MemOperand(source.rm(), source.offset() + 1));
-      lbu(rd, source);
-#endif
-    }
-    sll(rd, rd, 8);
-    or_(rd, rd, scratch);
-  }
-}
-
-void TurboAssembler::Ush(Register rd, const MemOperand& rs, Register scratch) {
-  DCHECK(rd != at);
-  DCHECK(rs.rm() != at);
-  DCHECK(rs.rm() != scratch);
-  DCHECK(scratch != at);
-  if (IsMipsArchVariant(kMips32r6)) {
-    sh(rd, rs);
-  } else {
-    DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r1) ||
-           IsMipsArchVariant(kLoongson));
-    MemOperand source = rs;
-    // Adjust offset for two accesses and check if offset + 1 fits into int16_t.
-    AdjustBaseAndOffset(source, OffsetAccessType::TWO_ACCESSES, 1);
-
-    if (scratch != rd) {
-      mov(scratch, rd);
-    }
-
-#if defined(V8_TARGET_LITTLE_ENDIAN)
-    sb(scratch, source);
-    srl(scratch, scratch, 8);
-    sb(scratch, MemOperand(source.rm(), source.offset() + 1));
-#elif defined(V8_TARGET_BIG_ENDIAN)
-    sb(scratch, MemOperand(source.rm(), source.offset() + 1));
-    srl(scratch, scratch, 8);
-    sb(scratch, source);
-#endif
-  }
-}
-
-void TurboAssembler::Ulwc1(FPURegister fd, const MemOperand& rs,
-                           Register scratch) {
-  if (IsMipsArchVariant(kMips32r6)) {
-    lwc1(fd, rs);
-  } else {
-    DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r1) ||
-           IsMipsArchVariant(kLoongson));
-    Ulw(scratch, rs);
-    mtc1(scratch, fd);
-  }
-}
-
-void TurboAssembler::Uswc1(FPURegister fd, const MemOperand& rs,
-                           Register scratch) {
-  if (IsMipsArchVariant(kMips32r6)) {
-    swc1(fd, rs);
-  } else {
-    DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r1) ||
-           IsMipsArchVariant(kLoongson));
-    mfc1(scratch, fd);
-    Usw(scratch, rs);
-  }
-}
-
-void TurboAssembler::Uldc1(FPURegister fd, const MemOperand& rs,
-                           Register scratch) {
-  DCHECK(scratch != at);
-  if (IsMipsArchVariant(kMips32r6)) {
-    Ldc1(fd, rs);
-  } else {
-    DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r1) ||
-           IsMipsArchVariant(kLoongson));
-    Ulw(scratch, MemOperand(rs.rm(), rs.offset() + Register::kMantissaOffset));
-    mtc1(scratch, fd);
-    Ulw(scratch, MemOperand(rs.rm(), rs.offset() + Register::kExponentOffset));
-    Mthc1(scratch, fd);
-  }
-}
-
-void TurboAssembler::Usdc1(FPURegister fd, const MemOperand& rs,
-                           Register scratch) {
-  DCHECK(scratch != at);
-  if (IsMipsArchVariant(kMips32r6)) {
-    Sdc1(fd, rs);
-  } else {
-    DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r1) ||
-           IsMipsArchVariant(kLoongson));
-    mfc1(scratch, fd);
-    Usw(scratch, MemOperand(rs.rm(), rs.offset() + Register::kMantissaOffset));
-    Mfhc1(scratch, fd);
-    Usw(scratch, MemOperand(rs.rm(), rs.offset() + Register::kExponentOffset));
-  }
-}
-
-void TurboAssembler::Ldc1(FPURegister fd, const MemOperand& src) {
-  // Workaround for non-8-byte alignment of HeapNumber, convert 64-bit
-  // load to two 32-bit loads.
-  DCHECK(Register::kMantissaOffset <= 4 && Register::kExponentOffset <= 4);
-  MemOperand tmp = src;
-  AdjustBaseAndOffset(tmp, OffsetAccessType::TWO_ACCESSES);
-  lwc1(fd, MemOperand(tmp.rm(), tmp.offset() + Register::kMantissaOffset));
-  if (IsFp32Mode()) {  // fp32 mode.
-    FPURegister nextfpreg = FPURegister::from_code(fd.code() + 1);
-    lwc1(nextfpreg,
-         MemOperand(tmp.rm(), tmp.offset() + Register::kExponentOffset));
-  } else {
-    DCHECK(IsFp64Mode() || IsFpxxMode());
-    // Currently we support FPXX and FP64 on Mips32r2 and Mips32r6
-    DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(src.rm() != scratch);
-    lw(scratch, MemOperand(tmp.rm(), tmp.offset() + Register::kExponentOffset));
-    Mthc1(scratch, fd);
-  }
-}
-
-void TurboAssembler::Sdc1(FPURegister fd, const MemOperand& src) {
-  // Workaround for non-8-byte alignment of HeapNumber, convert 64-bit
-  // store to two 32-bit stores.
-  DCHECK(Register::kMantissaOffset <= 4 && Register::kExponentOffset <= 4);
-  MemOperand tmp = src;
-  AdjustBaseAndOffset(tmp, OffsetAccessType::TWO_ACCESSES);
-  swc1(fd, MemOperand(tmp.rm(), tmp.offset() + Register::kMantissaOffset));
-  if (IsFp32Mode()) {  // fp32 mode.
-    FPURegister nextfpreg = FPURegister::from_code(fd.code() + 1);
-    swc1(nextfpreg,
-         MemOperand(tmp.rm(), tmp.offset() + Register::kExponentOffset));
-  } else {
-    DCHECK(IsFp64Mode() || IsFpxxMode());
-    // Currently we support FPXX and FP64 on Mips32r2 and Mips32r6
-    DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
-    DCHECK(src.rm() != t8);
-    Mfhc1(t8, fd);
-    sw(t8, MemOperand(tmp.rm(), tmp.offset() + Register::kExponentOffset));
-  }
-}
-
-void TurboAssembler::Ll(Register rd, const MemOperand& rs) {
-  bool is_one_instruction = IsMipsArchVariant(kMips32r6)
-                                ? is_int9(rs.offset())
-                                : is_int16(rs.offset());
-  if (is_one_instruction) {
-    ll(rd, rs);
-  } else {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    li(scratch, rs.offset());
-    addu(scratch, scratch, rs.rm());
-    ll(rd, MemOperand(scratch, 0));
-  }
-}
-
-void TurboAssembler::Sc(Register rd, const MemOperand& rs) {
-  bool is_one_instruction = IsMipsArchVariant(kMips32r6)
-                                ? is_int9(rs.offset())
-                                : is_int16(rs.offset());
-  if (is_one_instruction) {
-    sc(rd, rs);
-  } else {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    li(scratch, rs.offset());
-    addu(scratch, scratch, rs.rm());
-    sc(rd, MemOperand(scratch, 0));
-  }
-}
-
-void TurboAssembler::li(Register dst, Handle<HeapObject> value, LiFlags mode) {
-  li(dst, Operand(value), mode);
-}
-
-void TurboAssembler::li(Register rd, Operand j, LiFlags mode) {
-  DCHECK(!j.is_reg());
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  if (!MustUseReg(j.rmode()) && mode == OPTIMIZE_SIZE) {
-    // Normal load of an immediate value which does not need Relocation Info.
-    if (is_int16(j.immediate())) {
-      addiu(rd, zero_reg, j.immediate());
-    } else if (!(j.immediate() & kHiMask)) {
-      ori(rd, zero_reg, j.immediate());
-    } else {
-      lui(rd, (j.immediate() >> kLuiShift) & kImm16Mask);
-      if (j.immediate() & kImm16Mask) {
-        ori(rd, rd, (j.immediate() & kImm16Mask));
-      }
-    }
-  } else {
-    int32_t immediate;
-    if (j.IsHeapObjectRequest()) {
-      RequestHeapObject(j.heap_object_request());
-      immediate = 0;
-    } else {
-      immediate = j.immediate();
-    }
-
-    if (MustUseReg(j.rmode())) {
-      RecordRelocInfo(j.rmode(), immediate);
-    }
-    // We always need the same number of instructions as we may need to patch
-    // this code to load another value which may need 2 instructions to load.
-
-    lui(rd, (immediate >> kLuiShift) & kImm16Mask);
-    ori(rd, rd, (immediate & kImm16Mask));
-  }
-}
-
-void TurboAssembler::MultiPush(RegList regs) {
-  int16_t num_to_push = base::bits::CountPopulation(regs);
-  int16_t stack_offset = num_to_push * kPointerSize;
-
-  Subu(sp, sp, Operand(stack_offset));
-  for (int16_t i = kNumRegisters - 1; i >= 0; i--) {
-    if ((regs & (1 << i)) != 0) {
-      stack_offset -= kPointerSize;
-      sw(ToRegister(i), MemOperand(sp, stack_offset));
-    }
-  }
-}
-
-
-void TurboAssembler::MultiPop(RegList regs) {
-  int16_t stack_offset = 0;
-
-  for (int16_t i = 0; i < kNumRegisters; i++) {
-    if ((regs & (1 << i)) != 0) {
-      lw(ToRegister(i), MemOperand(sp, stack_offset));
-      stack_offset += kPointerSize;
-    }
-  }
-  addiu(sp, sp, stack_offset);
-}
-
-
-void TurboAssembler::MultiPushFPU(RegList regs) {
-  int16_t num_to_push = base::bits::CountPopulation(regs);
-  int16_t stack_offset = num_to_push * kDoubleSize;
-
-  Subu(sp, sp, Operand(stack_offset));
-  for (int16_t i = kNumRegisters - 1; i >= 0; i--) {
-    if ((regs & (1 << i)) != 0) {
-      stack_offset -= kDoubleSize;
-      Sdc1(FPURegister::from_code(i), MemOperand(sp, stack_offset));
-    }
-  }
-}
-
-
-void TurboAssembler::MultiPopFPU(RegList regs) {
-  int16_t stack_offset = 0;
-
-  for (int16_t i = 0; i < kNumRegisters; i++) {
-    if ((regs & (1 << i)) != 0) {
-      Ldc1(FPURegister::from_code(i), MemOperand(sp, stack_offset));
-      stack_offset += kDoubleSize;
-    }
-  }
-  addiu(sp, sp, stack_offset);
-}
-
-
-void TurboAssembler::AddPair(Register dst_low, Register dst_high,
-                             Register left_low, Register left_high,
-                             Register right_low, Register right_high) {
-  Register kScratchReg = s3;
-  if (left_low == right_low) {
-    // Special case for left = right and the sum potentially overwriting both
-    // left and right.
-    Slt(kScratchReg, left_low, zero_reg);
-    Addu(dst_low, left_low, right_low);
-  } else {
-    Addu(dst_low, left_low, right_low);
-    // If the sum overwrites right, left remains unchanged, otherwise right
-    // remains unchanged.
-    Sltu(kScratchReg, dst_low, (dst_low == right_low) ? left_low : right_low);
-  }
-  Addu(dst_high, left_high, right_high);
-  Addu(dst_high, dst_high, kScratchReg);
-}
-
-void TurboAssembler::SubPair(Register dst_low, Register dst_high,
-                             Register left_low, Register left_high,
-                             Register right_low, Register right_high) {
-  Register kScratchReg = s3;
-  Sltu(kScratchReg, left_low, right_low);
-  Subu(dst_low, left_low, right_low);
-  Subu(dst_high, left_high, right_high);
-  Subu(dst_high, dst_high, kScratchReg);
-}
-
-void TurboAssembler::ShlPair(Register dst_low, Register dst_high,
-                             Register src_low, Register src_high,
-                             Register shift) {
-  Label done;
-  Register kScratchReg = s3;
-  Register kScratchReg2 = s4;
-  And(shift, shift, 0x3F);
-  sllv(dst_low, src_low, shift);
-  Nor(kScratchReg2, zero_reg, shift);
-  srl(kScratchReg, src_low, 1);
-  srlv(kScratchReg, kScratchReg, kScratchReg2);
-  sllv(dst_high, src_high, shift);
-  Or(dst_high, dst_high, kScratchReg);
-  And(kScratchReg, shift, 32);
-  if (IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r6)) {
-    Branch(&done, eq, kScratchReg, Operand(zero_reg));
-    mov(dst_high, dst_low);
-    mov(dst_low, zero_reg);
-  } else {
-    movn(dst_high, dst_low, kScratchReg);
-    movn(dst_low, zero_reg, kScratchReg);
-  }
-  bind(&done);
-}
-
-void TurboAssembler::ShlPair(Register dst_low, Register dst_high,
-                             Register src_low, Register src_high,
-                             uint32_t shift) {
-  Register kScratchReg = s3;
-  shift = shift & 0x3F;
-  if (shift == 0) {
-    mov(dst_low, src_low);
-    mov(dst_high, src_high);
-  } else if (shift < 32) {
-    if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) {
-      srl(dst_high, src_low, 32 - shift);
-      Ins(dst_high, src_high, shift, 32 - shift);
-      sll(dst_low, src_low, shift);
-    } else {
-      sll(dst_high, src_high, shift);
-      sll(dst_low, src_low, shift);
-      srl(kScratchReg, src_low, 32 - shift);
-      Or(dst_high, dst_high, kScratchReg);
-    }
-  } else if (shift == 32) {
-    mov(dst_low, zero_reg);
-    mov(dst_high, src_low);
-  } else {
-    shift = shift - 32;
-    mov(dst_low, zero_reg);
-    sll(dst_high, src_low, shift);
-  }
-}
-
-void TurboAssembler::ShrPair(Register dst_low, Register dst_high,
-                             Register src_low, Register src_high,
-                             Register shift) {
-  Label done;
-  Register kScratchReg = s3;
-  Register kScratchReg2 = s4;
-  And(shift, shift, 0x3F);
-  srlv(dst_high, src_high, shift);
-  Nor(kScratchReg2, zero_reg, shift);
-  sll(kScratchReg, src_high, 1);
-  sllv(kScratchReg, kScratchReg, kScratchReg2);
-  srlv(dst_low, src_low, shift);
-  Or(dst_low, dst_low, kScratchReg);
-  And(kScratchReg, shift, 32);
-  if (IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r6)) {
-    Branch(&done, eq, kScratchReg, Operand(zero_reg));
-    mov(dst_low, dst_high);
-    mov(dst_high, zero_reg);
-  } else {
-    movn(dst_low, dst_high, kScratchReg);
-    movn(dst_high, zero_reg, kScratchReg);
-  }
-  bind(&done);
-}
-
-void TurboAssembler::ShrPair(Register dst_low, Register dst_high,
-                             Register src_low, Register src_high,
-                             uint32_t shift) {
-  Register kScratchReg = s3;
-  shift = shift & 0x3F;
-  if (shift == 0) {
-    mov(dst_low, src_low);
-    mov(dst_high, src_high);
-  } else if (shift < 32) {
-    if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) {
-      srl(dst_low, src_low, shift);
-      Ins(dst_low, src_high, 32 - shift, shift);
-      srl(dst_high, src_high, shift);
-    } else {
-      srl(dst_high, src_high, shift);
-      srl(dst_low, src_low, shift);
-      shift = 32 - shift;
-      sll(kScratchReg, src_high, shift);
-      Or(dst_low, dst_low, kScratchReg);
-    }
-  } else if (shift == 32) {
-    mov(dst_high, zero_reg);
-    mov(dst_low, src_high);
-  } else {
-    shift = shift - 32;
-    mov(dst_high, zero_reg);
-    srl(dst_low, src_high, shift);
-  }
-}
-
-void TurboAssembler::SarPair(Register dst_low, Register dst_high,
-                             Register src_low, Register src_high,
-                             Register shift) {
-  Label done;
-  Register kScratchReg = s3;
-  Register kScratchReg2 = s4;
-  And(shift, shift, 0x3F);
-  srav(dst_high, src_high, shift);
-  Nor(kScratchReg2, zero_reg, shift);
-  sll(kScratchReg, src_high, 1);
-  sllv(kScratchReg, kScratchReg, kScratchReg2);
-  srlv(dst_low, src_low, shift);
-  Or(dst_low, dst_low, kScratchReg);
-  And(kScratchReg, shift, 32);
-  Branch(&done, eq, kScratchReg, Operand(zero_reg));
-  mov(dst_low, dst_high);
-  sra(dst_high, dst_high, 31);
-  bind(&done);
-}
-
-void TurboAssembler::SarPair(Register dst_low, Register dst_high,
-                             Register src_low, Register src_high,
-                             uint32_t shift) {
-  Register kScratchReg = s3;
-  shift = shift & 0x3F;
-  if (shift == 0) {
-    mov(dst_low, src_low);
-    mov(dst_high, src_high);
-  } else if (shift < 32) {
-    if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) {
-      srl(dst_low, src_low, shift);
-      Ins(dst_low, src_high, 32 - shift, shift);
-      sra(dst_high, src_high, shift);
-    } else {
-      sra(dst_high, src_high, shift);
-      srl(dst_low, src_low, shift);
-      shift = 32 - shift;
-      sll(kScratchReg, src_high, shift);
-      Or(dst_low, dst_low, kScratchReg);
-    }
-  } else if (shift == 32) {
-    sra(dst_high, src_high, 31);
-    mov(dst_low, src_high);
-  } else {
-    shift = shift - 32;
-    sra(dst_high, src_high, 31);
-    sra(dst_low, src_high, shift);
-  }
-}
-
-void TurboAssembler::Ext(Register rt, Register rs, uint16_t pos,
-                         uint16_t size) {
-  DCHECK_LT(pos, 32);
-  DCHECK_LT(pos + size, 33);
-
-  if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) {
-    ext_(rt, rs, pos, size);
-  } else {
-    // Move rs to rt and shift it left then right to get the
-    // desired bitfield on the right side and zeroes on the left.
-    int shift_left = 32 - (pos + size);
-    sll(rt, rs, shift_left);  // Acts as a move if shift_left == 0.
-
-    int shift_right = 32 - size;
-    if (shift_right > 0) {
-      srl(rt, rt, shift_right);
-    }
-  }
-}
-
-void TurboAssembler::Ins(Register rt, Register rs, uint16_t pos,
-                         uint16_t size) {
-  DCHECK_LT(pos, 32);
-  DCHECK_LE(pos + size, 32);
-  DCHECK_NE(size, 0);
-
-  if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) {
-    ins_(rt, rs, pos, size);
-  } else {
-    DCHECK(rt != t8 && rs != t8);
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    Subu(scratch, zero_reg, Operand(1));
-    srl(scratch, scratch, 32 - size);
-    and_(t8, rs, scratch);
-    sll(t8, t8, pos);
-    sll(scratch, scratch, pos);
-    nor(scratch, scratch, zero_reg);
-    and_(scratch, rt, scratch);
-    or_(rt, t8, scratch);
-  }
-}
-
-void TurboAssembler::ExtractBits(Register dest, Register source, Register pos,
-                                 int size, bool sign_extend) {
-  srav(dest, source, pos);
-  Ext(dest, dest, 0, size);
-  if (size == 8) {
-    if (sign_extend) {
-      Seb(dest, dest);
-    }
-  } else if (size == 16) {
-    if (sign_extend) {
-      Seh(dest, dest);
-    }
-  } else {
-    UNREACHABLE();
-  }
-}
-
-void TurboAssembler::InsertBits(Register dest, Register source, Register pos,
-                                int size) {
-  Ror(dest, dest, pos);
-  Ins(dest, source, 0, size);
-  {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    Subu(scratch, pos, Operand(32));
-    Neg(scratch, Operand(scratch));
-    Ror(dest, dest, scratch);
-  }
-}
-
-void TurboAssembler::Seb(Register rd, Register rt) {
-  if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) {
-    seb(rd, rt);
-  } else {
-    DCHECK(IsMipsArchVariant(kMips32r1) || IsMipsArchVariant(kLoongson));
-    sll(rd, rt, 24);
-    sra(rd, rd, 24);
-  }
-}
-
-void TurboAssembler::Seh(Register rd, Register rt) {
-  if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) {
-    seh(rd, rt);
-  } else {
-    DCHECK(IsMipsArchVariant(kMips32r1) || IsMipsArchVariant(kLoongson));
-    sll(rd, rt, 16);
-    sra(rd, rd, 16);
-  }
-}
-
-void TurboAssembler::Neg_s(FPURegister fd, FPURegister fs) {
-  if (IsMipsArchVariant(kMips32r6)) {
-    // r6 neg_s changes the sign for NaN-like operands as well.
-    neg_s(fd, fs);
-  } else {
-    DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r1) ||
-           IsMipsArchVariant(kLoongson));
-    Label is_nan, done;
-    Register scratch1 = t8;
-    Register scratch2 = t9;
-    BranchF32(nullptr, &is_nan, eq, fs, fs);
-    Branch(USE_DELAY_SLOT, &done);
-    // For NaN input, neg_s will return the same NaN value,
-    // while the sign has to be changed separately.
-    neg_s(fd, fs);  // In delay slot.
-    bind(&is_nan);
-    mfc1(scratch1, fs);
-    li(scratch2, kBinary32SignMask);
-    Xor(scratch1, scratch1, scratch2);
-    mtc1(scratch1, fd);
-    bind(&done);
-  }
-}
-
-void TurboAssembler::Neg_d(FPURegister fd, FPURegister fs) {
-  if (IsMipsArchVariant(kMips32r6)) {
-    // r6 neg_d changes the sign for NaN-like operands as well.
-    neg_d(fd, fs);
-  } else {
-    DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r1) ||
-           IsMipsArchVariant(kLoongson));
-    Label is_nan, done;
-    Register scratch1 = t8;
-    Register scratch2 = t9;
-    BranchF64(nullptr, &is_nan, eq, fs, fs);
-    Branch(USE_DELAY_SLOT, &done);
-    // For NaN input, neg_d will return the same NaN value,
-    // while the sign has to be changed separately.
-    neg_d(fd, fs);  // In delay slot.
-    bind(&is_nan);
-    Mfhc1(scratch1, fs);
-    li(scratch2, HeapNumber::kSignMask);
-    Xor(scratch1, scratch1, scratch2);
-    Mthc1(scratch1, fd);
-    bind(&done);
-  }
-}
-
-void TurboAssembler::Cvt_d_uw(FPURegister fd, Register rs,
-                              FPURegister scratch) {
-  // In FP64Mode we do conversion from long.
-  if (IsFp64Mode()) {
-    mtc1(rs, scratch);
-    Mthc1(zero_reg, scratch);
-    cvt_d_l(fd, scratch);
-  } else {
-    // Convert rs to a FP value in fd.
-    DCHECK(fd != scratch);
-    DCHECK(rs != at);
-
-    Label msb_clear, conversion_done;
-    // For a value which is < 2^31, regard it as a signed positve word.
-    Branch(&msb_clear, ge, rs, Operand(zero_reg), USE_DELAY_SLOT);
-    mtc1(rs, fd);
-    {
-      UseScratchRegisterScope temps(this);
-      Register scratch1 = temps.Acquire();
-      li(scratch1, 0x41F00000);  // FP value: 2^32.
-
-      // For unsigned inputs > 2^31, we convert to double as a signed int32,
-      // then add 2^32 to move it back to unsigned value in range 2^31..2^31-1.
-      mtc1(zero_reg, scratch);
-      Mthc1(scratch1, scratch);
-    }
-
-    cvt_d_w(fd, fd);
-
-    Branch(USE_DELAY_SLOT, &conversion_done);
-    add_d(fd, fd, scratch);
-
-    bind(&msb_clear);
-    cvt_d_w(fd, fd);
-
-    bind(&conversion_done);
-  }
-}
-
-void TurboAssembler::Trunc_uw_d(FPURegister fd, FPURegister fs,
-                                FPURegister scratch) {
-  Trunc_uw_d(fs, t8, scratch);
-  mtc1(t8, fd);
-}
-
-void TurboAssembler::Trunc_uw_s(FPURegister fd, FPURegister fs,
-                                FPURegister scratch) {
-  Trunc_uw_s(fs, t8, scratch);
-  mtc1(t8, fd);
-}
-
-void TurboAssembler::Trunc_w_d(FPURegister fd, FPURegister fs) {
-  if (IsMipsArchVariant(kLoongson) && fd == fs) {
-    Mfhc1(t8, fs);
-    trunc_w_d(fd, fs);
-    Mthc1(t8, fs);
-  } else {
-    trunc_w_d(fd, fs);
-  }
-}
-
-void TurboAssembler::Round_w_d(FPURegister fd, FPURegister fs) {
-  if (IsMipsArchVariant(kLoongson) && fd == fs) {
-    Mfhc1(t8, fs);
-    round_w_d(fd, fs);
-    Mthc1(t8, fs);
-  } else {
-    round_w_d(fd, fs);
-  }
-}
-
-void TurboAssembler::Floor_w_d(FPURegister fd, FPURegister fs) {
-  if (IsMipsArchVariant(kLoongson) && fd == fs) {
-    Mfhc1(t8, fs);
-    floor_w_d(fd, fs);
-    Mthc1(t8, fs);
-  } else {
-    floor_w_d(fd, fs);
-  }
-}
-
-void TurboAssembler::Ceil_w_d(FPURegister fd, FPURegister fs) {
-  if (IsMipsArchVariant(kLoongson) && fd == fs) {
-    Mfhc1(t8, fs);
-    ceil_w_d(fd, fs);
-    Mthc1(t8, fs);
-  } else {
-    ceil_w_d(fd, fs);
-  }
-}
-
-void TurboAssembler::Trunc_uw_d(FPURegister fd, Register rs,
-                                FPURegister scratch) {
-  DCHECK(fd != scratch);
-  DCHECK(rs != at);
-
-  {
-    // Load 2^31 into scratch as its float representation.
-    UseScratchRegisterScope temps(this);
-    Register scratch1 = temps.Acquire();
-    li(scratch1, 0x41E00000);
-    mtc1(zero_reg, scratch);
-    Mthc1(scratch1, scratch);
-  }
-  // Test if scratch > fd.
-  // If fd < 2^31 we can convert it normally.
-  Label simple_convert;
-  BranchF(&simple_convert, nullptr, lt, fd, scratch);
-
-  // First we subtract 2^31 from fd, then trunc it to rs
-  // and add 2^31 to rs.
-  sub_d(scratch, fd, scratch);
-  trunc_w_d(scratch, scratch);
-  mfc1(rs, scratch);
-  Or(rs, rs, 1 << 31);
-
-  Label done;
-  Branch(&done);
-  // Simple conversion.
-  bind(&simple_convert);
-  trunc_w_d(scratch, fd);
-  mfc1(rs, scratch);
-
-  bind(&done);
-}
-
-void TurboAssembler::Trunc_uw_s(FPURegister fd, Register rs,
-                                FPURegister scratch) {
-  DCHECK(fd != scratch);
-  DCHECK(rs != at);
-
-  {
-    // Load 2^31 into scratch as its float representation.
-    UseScratchRegisterScope temps(this);
-    Register scratch1 = temps.Acquire();
-    li(scratch1, 0x4F000000);
-    mtc1(scratch1, scratch);
-  }
-  // Test if scratch > fd.
-  // If fd < 2^31 we can convert it normally.
-  Label simple_convert;
-  BranchF32(&simple_convert, nullptr, lt, fd, scratch);
-
-  // First we subtract 2^31 from fd, then trunc it to rs
-  // and add 2^31 to rs.
-  sub_s(scratch, fd, scratch);
-  trunc_w_s(scratch, scratch);
-  mfc1(rs, scratch);
-  Or(rs, rs, 1 << 31);
-
-  Label done;
-  Branch(&done);
-  // Simple conversion.
-  bind(&simple_convert);
-  trunc_w_s(scratch, fd);
-  mfc1(rs, scratch);
-
-  bind(&done);
-}
-
-void TurboAssembler::Mthc1(Register rt, FPURegister fs) {
-  if (IsFp32Mode()) {
-    mtc1(rt, fs.high());
-  } else {
-    DCHECK(IsFp64Mode() || IsFpxxMode());
-    DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
-    mthc1(rt, fs);
-  }
-}
-
-void TurboAssembler::Mfhc1(Register rt, FPURegister fs) {
-  if (IsFp32Mode()) {
-    mfc1(rt, fs.high());
-  } else {
-    DCHECK(IsFp64Mode() || IsFpxxMode());
-    DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
-    mfhc1(rt, fs);
-  }
-}
-
-void TurboAssembler::Madd_s(FPURegister fd, FPURegister fr, FPURegister fs,
-                            FPURegister ft, FPURegister scratch) {
-  if (IsMipsArchVariant(kMips32r2)) {
-    madd_s(fd, fr, fs, ft);
-  } else {
-    DCHECK(fr != scratch && fs != scratch && ft != scratch);
-    mul_s(scratch, fs, ft);
-    add_s(fd, fr, scratch);
-  }
-}
-
-void TurboAssembler::Madd_d(FPURegister fd, FPURegister fr, FPURegister fs,
-                            FPURegister ft, FPURegister scratch) {
-  if (IsMipsArchVariant(kMips32r2)) {
-    madd_d(fd, fr, fs, ft);
-  } else {
-    DCHECK(fr != scratch && fs != scratch && ft != scratch);
-    mul_d(scratch, fs, ft);
-    add_d(fd, fr, scratch);
-  }
-}
-
-void TurboAssembler::Msub_s(FPURegister fd, FPURegister fr, FPURegister fs,
-                            FPURegister ft, FPURegister scratch) {
-  if (IsMipsArchVariant(kMips32r2)) {
-    msub_s(fd, fr, fs, ft);
-  } else {
-    DCHECK(fr != scratch && fs != scratch && ft != scratch);
-    mul_s(scratch, fs, ft);
-    sub_s(fd, scratch, fr);
-  }
-}
-
-void TurboAssembler::Msub_d(FPURegister fd, FPURegister fr, FPURegister fs,
-                            FPURegister ft, FPURegister scratch) {
-  if (IsMipsArchVariant(kMips32r2)) {
-    msub_d(fd, fr, fs, ft);
-  } else {
-    DCHECK(fr != scratch && fs != scratch && ft != scratch);
-    mul_d(scratch, fs, ft);
-    sub_d(fd, scratch, fr);
-  }
-}
-
-void TurboAssembler::BranchFCommon(SecondaryField sizeField, Label* target,
-                                   Label* nan, Condition cond, FPURegister cmp1,
-                                   FPURegister cmp2, BranchDelaySlot bd) {
-  {
-    BlockTrampolinePoolScope block_trampoline_pool(this);
-    if (cond == al) {
-      Branch(bd, target);
-      return;
-    }
-
-    if (IsMipsArchVariant(kMips32r6)) {
-      sizeField = sizeField == D ? L : W;
-    }
-    DCHECK(nan || target);
-    // Check for unordered (NaN) cases.
-    if (nan) {
-      bool long_branch =
-          nan->is_bound() ? !is_near(nan) : is_trampoline_emitted();
-      if (!IsMipsArchVariant(kMips32r6)) {
-        if (long_branch) {
-          Label skip;
-          c(UN, sizeField, cmp1, cmp2);
-          bc1f(&skip);
-          nop();
-          BranchLong(nan, bd);
-          bind(&skip);
-        } else {
-          c(UN, sizeField, cmp1, cmp2);
-          bc1t(nan);
-          if (bd == PROTECT) {
-            nop();
-          }
-        }
-      } else {
-        // Use kDoubleCompareReg for comparison result. It has to be unavailable
-        // to lithium register allocator.
-        DCHECK(cmp1 != kDoubleCompareReg && cmp2 != kDoubleCompareReg);
-        if (long_branch) {
-          Label skip;
-          cmp(UN, sizeField, kDoubleCompareReg, cmp1, cmp2);
-          bc1eqz(&skip, kDoubleCompareReg);
-          nop();
-          BranchLong(nan, bd);
-          bind(&skip);
-        } else {
-          cmp(UN, sizeField, kDoubleCompareReg, cmp1, cmp2);
-          bc1nez(nan, kDoubleCompareReg);
-          if (bd == PROTECT) {
-            nop();
-          }
-        }
-      }
-    }
-
-    if (target) {
-      bool long_branch =
-          target->is_bound() ? !is_near(target) : is_trampoline_emitted();
-      if (long_branch) {
-        Label skip;
-        Condition neg_cond = NegateFpuCondition(cond);
-        BranchShortF(sizeField, &skip, neg_cond, cmp1, cmp2, bd);
-        BranchLong(target, bd);
-        bind(&skip);
-      } else {
-        BranchShortF(sizeField, target, cond, cmp1, cmp2, bd);
-      }
-    }
-  }
-}
-
-void TurboAssembler::BranchShortF(SecondaryField sizeField, Label* target,
-                                  Condition cc, FPURegister cmp1,
-                                  FPURegister cmp2, BranchDelaySlot bd) {
-  if (!IsMipsArchVariant(kMips32r6)) {
-    BlockTrampolinePoolScope block_trampoline_pool(this);
-    if (target) {
-      // Here NaN cases were either handled by this function or are assumed to
-      // have been handled by the caller.
-      switch (cc) {
-        case lt:
-          c(OLT, sizeField, cmp1, cmp2);
-          bc1t(target);
-          break;
-        case ult:
-          c(ULT, sizeField, cmp1, cmp2);
-          bc1t(target);
-          break;
-        case gt:
-          c(ULE, sizeField, cmp1, cmp2);
-          bc1f(target);
-          break;
-        case ugt:
-          c(OLE, sizeField, cmp1, cmp2);
-          bc1f(target);
-          break;
-        case ge:
-          c(ULT, sizeField, cmp1, cmp2);
-          bc1f(target);
-          break;
-        case uge:
-          c(OLT, sizeField, cmp1, cmp2);
-          bc1f(target);
-          break;
-        case le:
-          c(OLE, sizeField, cmp1, cmp2);
-          bc1t(target);
-          break;
-        case ule:
-          c(ULE, sizeField, cmp1, cmp2);
-          bc1t(target);
-          break;
-        case eq:
-          c(EQ, sizeField, cmp1, cmp2);
-          bc1t(target);
-          break;
-        case ueq:
-          c(UEQ, sizeField, cmp1, cmp2);
-          bc1t(target);
-          break;
-        case ne:  // Unordered or not equal.
-          c(EQ, sizeField, cmp1, cmp2);
-          bc1f(target);
-          break;
-        case ogl:
-          c(UEQ, sizeField, cmp1, cmp2);
-          bc1f(target);
-          break;
-        default:
-          CHECK(0);
-      }
-    }
-  } else {
-    BlockTrampolinePoolScope block_trampoline_pool(this);
-    if (target) {
-      // Here NaN cases were either handled by this function or are assumed to
-      // have been handled by the caller.
-      // Unsigned conditions are treated as their signed counterpart.
-      // Use kDoubleCompareReg for comparison result, it is
-      // valid in fp64 (FR = 1) mode which is implied for mips32r6.
-      DCHECK(cmp1 != kDoubleCompareReg && cmp2 != kDoubleCompareReg);
-      switch (cc) {
-        case lt:
-          cmp(OLT, sizeField, kDoubleCompareReg, cmp1, cmp2);
-          bc1nez(target, kDoubleCompareReg);
-          break;
-        case ult:
-          cmp(ULT, sizeField, kDoubleCompareReg, cmp1, cmp2);
-          bc1nez(target, kDoubleCompareReg);
-          break;
-        case gt:
-          cmp(ULE, sizeField, kDoubleCompareReg, cmp1, cmp2);
-          bc1eqz(target, kDoubleCompareReg);
-          break;
-        case ugt:
-          cmp(OLE, sizeField, kDoubleCompareReg, cmp1, cmp2);
-          bc1eqz(target, kDoubleCompareReg);
-          break;
-        case ge:
-          cmp(ULT, sizeField, kDoubleCompareReg, cmp1, cmp2);
-          bc1eqz(target, kDoubleCompareReg);
-          break;
-        case uge:
-          cmp(OLT, sizeField, kDoubleCompareReg, cmp1, cmp2);
-          bc1eqz(target, kDoubleCompareReg);
-          break;
-        case le:
-          cmp(OLE, sizeField, kDoubleCompareReg, cmp1, cmp2);
-          bc1nez(target, kDoubleCompareReg);
-          break;
-        case ule:
-          cmp(ULE, sizeField, kDoubleCompareReg, cmp1, cmp2);
-          bc1nez(target, kDoubleCompareReg);
-          break;
-        case eq:
-          cmp(EQ, sizeField, kDoubleCompareReg, cmp1, cmp2);
-          bc1nez(target, kDoubleCompareReg);
-          break;
-        case ueq:
-          cmp(UEQ, sizeField, kDoubleCompareReg, cmp1, cmp2);
-          bc1nez(target, kDoubleCompareReg);
-          break;
-        case ne:
-          cmp(EQ, sizeField, kDoubleCompareReg, cmp1, cmp2);
-          bc1eqz(target, kDoubleCompareReg);
-          break;
-        case ogl:
-          cmp(UEQ, sizeField, kDoubleCompareReg, cmp1, cmp2);
-          bc1eqz(target, kDoubleCompareReg);
-          break;
-        default:
-          CHECK(0);
-      }
-    }
-  }
-  if (bd == PROTECT) {
-    nop();
-  }
-}
-
-void TurboAssembler::BranchMSA(Label* target, MSABranchDF df,
-                               MSABranchCondition cond, MSARegister wt,
-                               BranchDelaySlot bd) {
-  {
-    BlockTrampolinePoolScope block_trampoline_pool(this);
-
-    if (target) {
-      bool long_branch =
-          target->is_bound() ? !is_near(target) : is_trampoline_emitted();
-      if (long_branch) {
-        Label skip;
-        MSABranchCondition neg_cond = NegateMSABranchCondition(cond);
-        BranchShortMSA(df, &skip, neg_cond, wt, bd);
-        BranchLong(target, bd);
-        bind(&skip);
-      } else {
-        BranchShortMSA(df, target, cond, wt, bd);
-      }
-    }
-  }
-}
-
-void TurboAssembler::BranchShortMSA(MSABranchDF df, Label* target,
-                                    MSABranchCondition cond, MSARegister wt,
-                                    BranchDelaySlot bd) {
-  if (IsMipsArchVariant(kMips32r6)) {
-    BlockTrampolinePoolScope block_trampoline_pool(this);
-    if (target) {
-      switch (cond) {
-        case all_not_zero:
-          switch (df) {
-            case MSA_BRANCH_D:
-              bnz_d(wt, target);
-              break;
-            case MSA_BRANCH_W:
-              bnz_w(wt, target);
-              break;
-            case MSA_BRANCH_H:
-              bnz_h(wt, target);
-              break;
-            case MSA_BRANCH_B:
-            default:
-              bnz_b(wt, target);
-          }
-          break;
-        case one_elem_not_zero:
-          bnz_v(wt, target);
-          break;
-        case one_elem_zero:
-          switch (df) {
-            case MSA_BRANCH_D:
-              bz_d(wt, target);
-              break;
-            case MSA_BRANCH_W:
-              bz_w(wt, target);
-              break;
-            case MSA_BRANCH_H:
-              bz_h(wt, target);
-              break;
-            case MSA_BRANCH_B:
-            default:
-              bz_b(wt, target);
-          }
-          break;
-        case all_zero:
-          bz_v(wt, target);
-          break;
-        default:
-          UNREACHABLE();
-      }
-    }
-  }
-  if (bd == PROTECT) {
-    nop();
-  }
-}
-
-void TurboAssembler::FmoveLow(FPURegister dst, Register src_low) {
-  if (IsFp32Mode()) {
-    mtc1(src_low, dst);
-  } else {
-    DCHECK(IsFp64Mode() || IsFpxxMode());
-    DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(src_low != scratch);
-    mfhc1(scratch, dst);
-    mtc1(src_low, dst);
-    mthc1(scratch, dst);
-  }
-}
-
-void TurboAssembler::Move(FPURegister dst, float imm) {
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  li(scratch, Operand(bit_cast<int32_t>(imm)));
-  mtc1(scratch, dst);
-}
-
-void TurboAssembler::Move(FPURegister dst, double imm) {
-  int64_t imm_bits = bit_cast<int64_t>(imm);
-  // Handle special values first.
-  if (imm_bits == bit_cast<int64_t>(0.0) && has_double_zero_reg_set_) {
-    mov_d(dst, kDoubleRegZero);
-  } else if (imm_bits == bit_cast<int64_t>(-0.0) && has_double_zero_reg_set_) {
-    Neg_d(dst, kDoubleRegZero);
-  } else {
-    uint32_t lo, hi;
-    DoubleAsTwoUInt32(imm, &lo, &hi);
-    // Move the low part of the double into the lower of the corresponding FPU
-    // register of FPU register pair.
-    if (lo != 0) {
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      li(scratch, Operand(lo));
-      mtc1(scratch, dst);
-    } else {
-      mtc1(zero_reg, dst);
-    }
-    // Move the high part of the double into the higher of the corresponding FPU
-    // register of FPU register pair.
-    if (hi != 0) {
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      li(scratch, Operand(hi));
-      Mthc1(scratch, dst);
-    } else {
-      Mthc1(zero_reg, dst);
-    }
-    if (dst == kDoubleRegZero) has_double_zero_reg_set_ = true;
-  }
-}
-
-void TurboAssembler::Movz(Register rd, Register rs, Register rt) {
-  if (IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r6)) {
-    Label done;
-    Branch(&done, ne, rt, Operand(zero_reg));
-    mov(rd, rs);
-    bind(&done);
-  } else {
-    movz(rd, rs, rt);
-  }
-}
-
-void TurboAssembler::Movn(Register rd, Register rs, Register rt) {
-  if (IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r6)) {
-    Label done;
-    Branch(&done, eq, rt, Operand(zero_reg));
-    mov(rd, rs);
-    bind(&done);
-  } else {
-    movn(rd, rs, rt);
-  }
-}
-
-void TurboAssembler::Movt(Register rd, Register rs, uint16_t cc) {
-  if (IsMipsArchVariant(kLoongson)) {
-    // Tests an FP condition code and then conditionally move rs to rd.
-    // We do not currently use any FPU cc bit other than bit 0.
-    DCHECK_EQ(cc, 0);
-    DCHECK(rs != t8 && rd != t8);
-    Label done;
-    Register scratch = t8;
-    // For testing purposes we need to fetch content of the FCSR register and
-    // than test its cc (floating point condition code) bit (for cc = 0, it is
-    // 24. bit of the FCSR).
-    cfc1(scratch, FCSR);
-    // For the MIPS I, II and III architectures, the contents of scratch is
-    // UNPREDICTABLE for the instruction immediately following CFC1.
-    nop();
-    srl(scratch, scratch, 16);
-    andi(scratch, scratch, 0x0080);
-    Branch(&done, eq, scratch, Operand(zero_reg));
-    mov(rd, rs);
-    bind(&done);
-  } else {
-    movt(rd, rs, cc);
-  }
-}
-
-void TurboAssembler::Movf(Register rd, Register rs, uint16_t cc) {
-  if (IsMipsArchVariant(kLoongson)) {
-    // Tests an FP condition code and then conditionally move rs to rd.
-    // We do not currently use any FPU cc bit other than bit 0.
-    DCHECK_EQ(cc, 0);
-    DCHECK(rs != t8 && rd != t8);
-    Label done;
-    Register scratch = t8;
-    // For testing purposes we need to fetch content of the FCSR register and
-    // than test its cc (floating point condition code) bit (for cc = 0, it is
-    // 24. bit of the FCSR).
-    cfc1(scratch, FCSR);
-    // For the MIPS I, II and III architectures, the contents of scratch is
-    // UNPREDICTABLE for the instruction immediately following CFC1.
-    nop();
-    srl(scratch, scratch, 16);
-    andi(scratch, scratch, 0x0080);
-    Branch(&done, ne, scratch, Operand(zero_reg));
-    mov(rd, rs);
-    bind(&done);
-  } else {
-    movf(rd, rs, cc);
-  }
-}
-
-void TurboAssembler::Clz(Register rd, Register rs) {
-  if (IsMipsArchVariant(kLoongson)) {
-    DCHECK(rd != t8 && rd != t9 && rs != t8 && rs != t9);
-    Register mask = t8;
-    Register scratch = t9;
-    Label loop, end;
-    {
-      UseScratchRegisterScope temps(this);
-      Register scratch1 = temps.Acquire();
-      mov(scratch1, rs);
-      mov(rd, zero_reg);
-      lui(mask, 0x8000);
-      bind(&loop);
-      and_(scratch, scratch1, mask);
-    }
-    Branch(&end, ne, scratch, Operand(zero_reg));
-    addiu(rd, rd, 1);
-    Branch(&loop, ne, mask, Operand(zero_reg), USE_DELAY_SLOT);
-    srl(mask, mask, 1);
-    bind(&end);
-  } else {
-    clz(rd, rs);
-  }
-}
-
-
-void MacroAssembler::EmitFPUTruncate(FPURoundingMode rounding_mode,
-                                     Register result,
-                                     DoubleRegister double_input,
-                                     Register scratch,
-                                     DoubleRegister double_scratch,
-                                     Register except_flag,
-                                     CheckForInexactConversion check_inexact) {
-  DCHECK(result != scratch);
-  DCHECK(double_input != double_scratch);
-  DCHECK(except_flag != scratch);
-
-  Label done;
-
-  // Clear the except flag (0 = no exception)
-  mov(except_flag, zero_reg);
-
-  // Test for values that can be exactly represented as a signed 32-bit integer.
-  cvt_w_d(double_scratch, double_input);
-  mfc1(result, double_scratch);
-  cvt_d_w(double_scratch, double_scratch);
-  BranchF(&done, nullptr, eq, double_input, double_scratch);
-
-  int32_t except_mask = kFCSRFlagMask;  // Assume interested in all exceptions.
-
-  if (check_inexact == kDontCheckForInexactConversion) {
-    // Ignore inexact exceptions.
-    except_mask &= ~kFCSRInexactFlagMask;
-  }
-
-  // Save FCSR.
-  cfc1(scratch, FCSR);
-  // Disable FPU exceptions.
-  ctc1(zero_reg, FCSR);
-
-  // Do operation based on rounding mode.
-  switch (rounding_mode) {
-    case kRoundToNearest:
-      Round_w_d(double_scratch, double_input);
-      break;
-    case kRoundToZero:
-      Trunc_w_d(double_scratch, double_input);
-      break;
-    case kRoundToPlusInf:
-      Ceil_w_d(double_scratch, double_input);
-      break;
-    case kRoundToMinusInf:
-      Floor_w_d(double_scratch, double_input);
-      break;
-  }  // End of switch-statement.
-
-  // Retrieve FCSR.
-  cfc1(except_flag, FCSR);
-  // Restore FCSR.
-  ctc1(scratch, FCSR);
-  // Move the converted value into the result register.
-  mfc1(result, double_scratch);
-
-  // Check for fpu exceptions.
-  And(except_flag, except_flag, Operand(except_mask));
-
-  bind(&done);
-}
-
-void TurboAssembler::TryInlineTruncateDoubleToI(Register result,
-                                                DoubleRegister double_input,
-                                                Label* done) {
-  DoubleRegister single_scratch = kLithiumScratchDouble.low();
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  Register scratch2 = t9;
-
-  // Clear cumulative exception flags and save the FCSR.
-  cfc1(scratch2, FCSR);
-  ctc1(zero_reg, FCSR);
-  // Try a conversion to a signed integer.
-  trunc_w_d(single_scratch, double_input);
-  mfc1(result, single_scratch);
-  // Retrieve and restore the FCSR.
-  cfc1(scratch, FCSR);
-  ctc1(scratch2, FCSR);
-  // Check for overflow and NaNs.
-  And(scratch,
-      scratch,
-      kFCSROverflowFlagMask | kFCSRUnderflowFlagMask | kFCSRInvalidOpFlagMask);
-  // If we had no exceptions we are done.
-  Branch(done, eq, scratch, Operand(zero_reg));
-}
-
-void TurboAssembler::TruncateDoubleToIDelayed(Zone* zone, Register result,
-                                              DoubleRegister double_input) {
-  Label done;
-
-  TryInlineTruncateDoubleToI(result, double_input, &done);
-
-  // If we fell through then inline version didn't succeed - call stub instead.
-  push(ra);
-  Subu(sp, sp, Operand(kDoubleSize));  // Put input on stack.
-  Sdc1(double_input, MemOperand(sp, 0));
-
-  CallStubDelayed(new (zone) DoubleToIStub(nullptr, result));
-
-  Addu(sp, sp, Operand(kDoubleSize));
-  pop(ra);
-
-  bind(&done);
-}
-
-// Emulated condtional branches do not emit a nop in the branch delay slot.
-//
-// BRANCH_ARGS_CHECK checks that conditional jump arguments are correct.
-#define BRANCH_ARGS_CHECK(cond, rs, rt)                                  \
-  DCHECK((cond == cc_always && rs == zero_reg && rt.rm() == zero_reg) || \
-         (cond != cc_always && (rs != zero_reg || rt.rm() != zero_reg)))
-
-void TurboAssembler::Branch(int32_t offset, BranchDelaySlot bdslot) {
-  DCHECK(IsMipsArchVariant(kMips32r6) ? is_int26(offset) : is_int16(offset));
-  BranchShort(offset, bdslot);
-}
-
-void TurboAssembler::Branch(int32_t offset, Condition cond, Register rs,
-                            const Operand& rt, BranchDelaySlot bdslot) {
-  bool is_near = BranchShortCheck(offset, nullptr, cond, rs, rt, bdslot);
-  DCHECK(is_near);
-  USE(is_near);
-}
-
-void TurboAssembler::Branch(Label* L, BranchDelaySlot bdslot) {
-  if (L->is_bound()) {
-    if (is_near_branch(L)) {
-      BranchShort(L, bdslot);
-    } else {
-      BranchLong(L, bdslot);
-    }
-  } else {
-    if (is_trampoline_emitted()) {
-      BranchLong(L, bdslot);
-    } else {
-      BranchShort(L, bdslot);
-    }
-  }
-}
-
-void TurboAssembler::Branch(Label* L, Condition cond, Register rs,
-                            const Operand& rt, BranchDelaySlot bdslot) {
-  if (L->is_bound()) {
-    if (!BranchShortCheck(0, L, cond, rs, rt, bdslot)) {
-      if (cond != cc_always) {
-        Label skip;
-        Condition neg_cond = NegateCondition(cond);
-        BranchShort(&skip, neg_cond, rs, rt);
-        BranchLong(L, bdslot);
-        bind(&skip);
-      } else {
-        BranchLong(L, bdslot);
-      }
-    }
-  } else {
-    if (is_trampoline_emitted()) {
-      if (cond != cc_always) {
-        Label skip;
-        Condition neg_cond = NegateCondition(cond);
-        BranchShort(&skip, neg_cond, rs, rt);
-        BranchLong(L, bdslot);
-        bind(&skip);
-      } else {
-        BranchLong(L, bdslot);
-      }
-    } else {
-      BranchShort(L, cond, rs, rt, bdslot);
-    }
-  }
-}
-
-void TurboAssembler::Branch(Label* L, Condition cond, Register rs,
-                            Heap::RootListIndex index, BranchDelaySlot bdslot) {
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  LoadRoot(scratch, index);
-  Branch(L, cond, rs, Operand(scratch), bdslot);
-}
-
-void TurboAssembler::BranchShortHelper(int16_t offset, Label* L,
-                                       BranchDelaySlot bdslot) {
-  DCHECK(L == nullptr || offset == 0);
-  offset = GetOffset(offset, L, OffsetSize::kOffset16);
-  b(offset);
-
-  // Emit a nop in the branch delay slot if required.
-  if (bdslot == PROTECT)
-    nop();
-}
-
-void TurboAssembler::BranchShortHelperR6(int32_t offset, Label* L) {
-  DCHECK(L == nullptr || offset == 0);
-  offset = GetOffset(offset, L, OffsetSize::kOffset26);
-  bc(offset);
-}
-
-void TurboAssembler::BranchShort(int32_t offset, BranchDelaySlot bdslot) {
-  if (IsMipsArchVariant(kMips32r6) && bdslot == PROTECT) {
-    DCHECK(is_int26(offset));
-    BranchShortHelperR6(offset, nullptr);
-  } else {
-    DCHECK(is_int16(offset));
-    BranchShortHelper(offset, nullptr, bdslot);
-  }
-}
-
-void TurboAssembler::BranchShort(Label* L, BranchDelaySlot bdslot) {
-  if (IsMipsArchVariant(kMips32r6) && bdslot == PROTECT) {
-    BranchShortHelperR6(0, L);
-  } else {
-    BranchShortHelper(0, L, bdslot);
-  }
-}
-
-
-static inline bool IsZero(const Operand& rt) {
-  if (rt.is_reg()) {
-    return rt.rm() == zero_reg;
-  } else {
-    return rt.immediate() == 0;
-  }
-}
-
-int32_t TurboAssembler::GetOffset(int32_t offset, Label* L, OffsetSize bits) {
-  if (L) {
-    offset = branch_offset_helper(L, bits) >> 2;
-  } else {
-    DCHECK(is_intn(offset, bits));
-  }
-  return offset;
-}
-
-Register TurboAssembler::GetRtAsRegisterHelper(const Operand& rt,
-                                               Register scratch) {
-  Register r2 = no_reg;
-  if (rt.is_reg()) {
-    r2 = rt.rm();
-  } else {
-    r2 = scratch;
-    li(r2, rt);
-  }
-
-  return r2;
-}
-
-bool TurboAssembler::CalculateOffset(Label* L, int32_t& offset,
-                                     OffsetSize bits) {
-  if (!is_near(L, bits)) return false;
-  offset = GetOffset(offset, L, bits);
-  return true;
-}
-
-bool TurboAssembler::CalculateOffset(Label* L, int32_t& offset, OffsetSize bits,
-                                     Register& scratch, const Operand& rt) {
-  if (!is_near(L, bits)) return false;
-  scratch = GetRtAsRegisterHelper(rt, scratch);
-  offset = GetOffset(offset, L, bits);
-  return true;
-}
-
-bool TurboAssembler::BranchShortHelperR6(int32_t offset, Label* L,
-                                         Condition cond, Register rs,
-                                         const Operand& rt) {
-  DCHECK(L == nullptr || offset == 0);
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.hasAvailable() ? temps.Acquire() : t8;
-
-  // Be careful to always use shifted_branch_offset only just before the
-  // branch instruction, as the location will be remember for patching the
-  // target.
-  {
-    BlockTrampolinePoolScope block_trampoline_pool(this);
-    switch (cond) {
-      case cc_always:
-        if (!CalculateOffset(L, offset, OffsetSize::kOffset26)) return false;
-        bc(offset);
-        break;
-      case eq:
-        if (rt.is_reg() && rs.code() == rt.rm().code()) {
-          // Pre R6 beq is used here to make the code patchable. Otherwise bc
-          // should be used which has no condition field so is not patchable.
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          beq(rs, scratch, offset);
-          nop();
-        } else if (IsZero(rt)) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset21)) return false;
-          beqzc(rs, offset);
-        } else {
-          // We don't want any other register but scratch clobbered.
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          beqc(rs, scratch, offset);
-        }
-        break;
-      case ne:
-        if (rt.is_reg() && rs.code() == rt.rm().code()) {
-          // Pre R6 bne is used here to make the code patchable. Otherwise we
-          // should not generate any instruction.
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          bne(rs, scratch, offset);
-          nop();
-        } else if (IsZero(rt)) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset21)) return false;
-          bnezc(rs, offset);
-        } else {
-          // We don't want any other register but scratch clobbered.
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          bnec(rs, scratch, offset);
-        }
-        break;
-
-      // Signed comparison.
-      case greater:
-        // rs > rt
-        if (rt.is_reg() && rs.code() == rt.rm().code()) {
-          break;  // No code needs to be emitted.
-        } else if (rs == zero_reg) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          bltzc(scratch, offset);
-        } else if (IsZero(rt)) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16)) return false;
-          bgtzc(rs, offset);
-        } else {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          DCHECK(rs != scratch);
-          bltc(scratch, rs, offset);
-        }
-        break;
-      case greater_equal:
-        // rs >= rt
-        if (rt.is_reg() && rs.code() == rt.rm().code()) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset26)) return false;
-          bc(offset);
-        } else if (rs == zero_reg) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          blezc(scratch, offset);
-        } else if (IsZero(rt)) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16)) return false;
-          bgezc(rs, offset);
-        } else {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          DCHECK(rs != scratch);
-          bgec(rs, scratch, offset);
-        }
-        break;
-      case less:
-        // rs < rt
-        if (rt.is_reg() && rs.code() == rt.rm().code()) {
-          break;  // No code needs to be emitted.
-        } else if (rs == zero_reg) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          bgtzc(scratch, offset);
-        } else if (IsZero(rt)) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16)) return false;
-          bltzc(rs, offset);
-        } else {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          DCHECK(rs != scratch);
-          bltc(rs, scratch, offset);
-        }
-        break;
-      case less_equal:
-        // rs <= rt
-        if (rt.is_reg() && rs.code() == rt.rm().code()) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset26)) return false;
-          bc(offset);
-        } else if (rs == zero_reg) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          bgezc(scratch, offset);
-        } else if (IsZero(rt)) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16)) return false;
-          blezc(rs, offset);
-        } else {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          DCHECK(rs != scratch);
-          bgec(scratch, rs, offset);
-        }
-        break;
-
-      // Unsigned comparison.
-      case Ugreater:
-        // rs > rt
-        if (rt.is_reg() && rs.code() == rt.rm().code()) {
-          break;  // No code needs to be emitted.
-        } else if (rs == zero_reg) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset21, scratch, rt))
-            return false;
-          bnezc(scratch, offset);
-        } else if (IsZero(rt)) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset21)) return false;
-          bnezc(rs, offset);
-        } else {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          DCHECK(rs != scratch);
-          bltuc(scratch, rs, offset);
-        }
-        break;
-      case Ugreater_equal:
-        // rs >= rt
-        if (rt.is_reg() && rs.code() == rt.rm().code()) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset26)) return false;
-          bc(offset);
-        } else if (rs == zero_reg) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset21, scratch, rt))
-            return false;
-          beqzc(scratch, offset);
-        } else if (IsZero(rt)) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset26)) return false;
-          bc(offset);
-        } else {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          DCHECK(rs != scratch);
-          bgeuc(rs, scratch, offset);
-        }
-        break;
-      case Uless:
-        // rs < rt
-        if (rt.is_reg() && rs.code() == rt.rm().code()) {
-          break;  // No code needs to be emitted.
-        } else if (rs == zero_reg) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset21, scratch, rt))
-            return false;
-          bnezc(scratch, offset);
-        } else if (IsZero(rt)) {
-          break;  // No code needs to be emitted.
-        } else {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          DCHECK(rs != scratch);
-          bltuc(rs, scratch, offset);
-        }
-        break;
-      case Uless_equal:
-        // rs <= rt
-        if (rt.is_reg() && rs.code() == rt.rm().code()) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset26)) return false;
-          bc(offset);
-        } else if (rs == zero_reg) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset26, scratch, rt))
-            return false;
-          bc(offset);
-        } else if (IsZero(rt)) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset21)) return false;
-          beqzc(rs, offset);
-        } else {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          DCHECK(rs != scratch);
-          bgeuc(scratch, rs, offset);
-        }
-        break;
-      default:
-        UNREACHABLE();
-    }
-  }
-  CheckTrampolinePoolQuick(1);
-  return true;
-}
-
-bool TurboAssembler::BranchShortHelper(int16_t offset, Label* L, Condition cond,
-                                       Register rs, const Operand& rt,
-                                       BranchDelaySlot bdslot) {
-  DCHECK(L == nullptr || offset == 0);
-  if (!is_near(L, OffsetSize::kOffset16)) return false;
-
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.hasAvailable() ? temps.Acquire() : t8;
-  int32_t offset32;
-
-  // Be careful to always use shifted_branch_offset only just before the
-  // branch instruction, as the location will be remember for patching the
-  // target.
-  {
-    BlockTrampolinePoolScope block_trampoline_pool(this);
-    switch (cond) {
-      case cc_always:
-        offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-        b(offset32);
-        break;
-      case eq:
-        if (IsZero(rt)) {
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          beq(rs, zero_reg, offset32);
-        } else {
-          // We don't want any other register but scratch clobbered.
-          scratch = GetRtAsRegisterHelper(rt, scratch);
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          beq(rs, scratch, offset32);
-        }
-        break;
-      case ne:
-        if (IsZero(rt)) {
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          bne(rs, zero_reg, offset32);
-        } else {
-          // We don't want any other register but scratch clobbered.
-          scratch = GetRtAsRegisterHelper(rt, scratch);
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          bne(rs, scratch, offset32);
-        }
-        break;
-
-      // Signed comparison.
-      case greater:
-        if (IsZero(rt)) {
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          bgtz(rs, offset32);
-        } else {
-          Slt(scratch, GetRtAsRegisterHelper(rt, scratch), rs);
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          bne(scratch, zero_reg, offset32);
-        }
-        break;
-      case greater_equal:
-        if (IsZero(rt)) {
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          bgez(rs, offset32);
-        } else {
-          Slt(scratch, rs, rt);
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          beq(scratch, zero_reg, offset32);
-        }
-        break;
-      case less:
-        if (IsZero(rt)) {
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          bltz(rs, offset32);
-        } else {
-          Slt(scratch, rs, rt);
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          bne(scratch, zero_reg, offset32);
-        }
-        break;
-      case less_equal:
-        if (IsZero(rt)) {
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          blez(rs, offset32);
-        } else {
-          Slt(scratch, GetRtAsRegisterHelper(rt, scratch), rs);
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          beq(scratch, zero_reg, offset32);
-        }
-        break;
-
-      // Unsigned comparison.
-      case Ugreater:
-        if (IsZero(rt)) {
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          bne(rs, zero_reg, offset32);
-        } else {
-          Sltu(scratch, GetRtAsRegisterHelper(rt, scratch), rs);
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          bne(scratch, zero_reg, offset32);
-        }
-        break;
-      case Ugreater_equal:
-        if (IsZero(rt)) {
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          b(offset32);
-        } else {
-          Sltu(scratch, rs, rt);
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          beq(scratch, zero_reg, offset32);
-        }
-        break;
-      case Uless:
-        if (IsZero(rt)) {
-          return true;  // No code needs to be emitted.
-        } else {
-          Sltu(scratch, rs, rt);
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          bne(scratch, zero_reg, offset32);
-        }
-        break;
-      case Uless_equal:
-        if (IsZero(rt)) {
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          beq(rs, zero_reg, offset32);
-        } else {
-          Sltu(scratch, GetRtAsRegisterHelper(rt, scratch), rs);
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          beq(scratch, zero_reg, offset32);
-        }
-        break;
-      default:
-        UNREACHABLE();
-    }
-  }
-  // Emit a nop in the branch delay slot if required.
-  if (bdslot == PROTECT)
-    nop();
-
-  return true;
-}
-
-bool TurboAssembler::BranchShortCheck(int32_t offset, Label* L, Condition cond,
-                                      Register rs, const Operand& rt,
-                                      BranchDelaySlot bdslot) {
-  BRANCH_ARGS_CHECK(cond, rs, rt);
-  if (!L) {
-    if (IsMipsArchVariant(kMips32r6) && bdslot == PROTECT) {
-      DCHECK(is_int26(offset));
-      return BranchShortHelperR6(offset, nullptr, cond, rs, rt);
-    } else {
-      DCHECK(is_int16(offset));
-      return BranchShortHelper(offset, nullptr, cond, rs, rt, bdslot);
-    }
-  } else {
-    DCHECK_EQ(offset, 0);
-    if (IsMipsArchVariant(kMips32r6) && bdslot == PROTECT) {
-      return BranchShortHelperR6(0, L, cond, rs, rt);
-    } else {
-      return BranchShortHelper(0, L, cond, rs, rt, bdslot);
-    }
-  }
-  return false;
-}
-
-void TurboAssembler::BranchShort(int32_t offset, Condition cond, Register rs,
-                                 const Operand& rt, BranchDelaySlot bdslot) {
-  BranchShortCheck(offset, nullptr, cond, rs, rt, bdslot);
-}
-
-void TurboAssembler::BranchShort(Label* L, Condition cond, Register rs,
-                                 const Operand& rt, BranchDelaySlot bdslot) {
-  BranchShortCheck(0, L, cond, rs, rt, bdslot);
-}
-
-void TurboAssembler::BranchAndLink(int32_t offset, BranchDelaySlot bdslot) {
-  BranchAndLinkShort(offset, bdslot);
-}
-
-void TurboAssembler::BranchAndLink(int32_t offset, Condition cond, Register rs,
-                                   const Operand& rt, BranchDelaySlot bdslot) {
-  bool is_near = BranchAndLinkShortCheck(offset, nullptr, cond, rs, rt, bdslot);
-  DCHECK(is_near);
-  USE(is_near);
-}
-
-void TurboAssembler::BranchAndLink(Label* L, BranchDelaySlot bdslot) {
-  if (L->is_bound()) {
-    if (is_near_branch(L)) {
-      BranchAndLinkShort(L, bdslot);
-    } else {
-      BranchAndLinkLong(L, bdslot);
-    }
-  } else {
-    if (is_trampoline_emitted()) {
-      BranchAndLinkLong(L, bdslot);
-    } else {
-      BranchAndLinkShort(L, bdslot);
-    }
-  }
-}
-
-void TurboAssembler::BranchAndLink(Label* L, Condition cond, Register rs,
-                                   const Operand& rt, BranchDelaySlot bdslot) {
-  if (L->is_bound()) {
-    if (!BranchAndLinkShortCheck(0, L, cond, rs, rt, bdslot)) {
-      Label skip;
-      Condition neg_cond = NegateCondition(cond);
-      BranchShort(&skip, neg_cond, rs, rt);
-      BranchAndLinkLong(L, bdslot);
-      bind(&skip);
-    }
-  } else {
-    if (is_trampoline_emitted()) {
-      Label skip;
-      Condition neg_cond = NegateCondition(cond);
-      BranchShort(&skip, neg_cond, rs, rt);
-      BranchAndLinkLong(L, bdslot);
-      bind(&skip);
-    } else {
-      BranchAndLinkShortCheck(0, L, cond, rs, rt, bdslot);
-    }
-  }
-}
-
-void TurboAssembler::BranchAndLinkShortHelper(int16_t offset, Label* L,
-                                              BranchDelaySlot bdslot) {
-  DCHECK(L == nullptr || offset == 0);
-  offset = GetOffset(offset, L, OffsetSize::kOffset16);
-  bal(offset);
-
-  // Emit a nop in the branch delay slot if required.
-  if (bdslot == PROTECT)
-    nop();
-}
-
-void TurboAssembler::BranchAndLinkShortHelperR6(int32_t offset, Label* L) {
-  DCHECK(L == nullptr || offset == 0);
-  offset = GetOffset(offset, L, OffsetSize::kOffset26);
-  balc(offset);
-}
-
-void TurboAssembler::BranchAndLinkShort(int32_t offset,
-                                        BranchDelaySlot bdslot) {
-  if (IsMipsArchVariant(kMips32r6) && bdslot == PROTECT) {
-    DCHECK(is_int26(offset));
-    BranchAndLinkShortHelperR6(offset, nullptr);
-  } else {
-    DCHECK(is_int16(offset));
-    BranchAndLinkShortHelper(offset, nullptr, bdslot);
-  }
-}
-
-void TurboAssembler::BranchAndLinkShort(Label* L, BranchDelaySlot bdslot) {
-  if (IsMipsArchVariant(kMips32r6) && bdslot == PROTECT) {
-    BranchAndLinkShortHelperR6(0, L);
-  } else {
-    BranchAndLinkShortHelper(0, L, bdslot);
-  }
-}
-
-bool TurboAssembler::BranchAndLinkShortHelperR6(int32_t offset, Label* L,
-                                                Condition cond, Register rs,
-                                                const Operand& rt) {
-  DCHECK(L == nullptr || offset == 0);
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.hasAvailable() ? temps.Acquire() : t8;
-  OffsetSize bits = OffsetSize::kOffset16;
-
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  DCHECK((cond == cc_always && is_int26(offset)) || is_int16(offset));
-  switch (cond) {
-    case cc_always:
-      if (!CalculateOffset(L, offset, OffsetSize::kOffset26)) return false;
-      balc(offset);
-      break;
-    case eq:
-      if (!is_near(L, bits)) return false;
-      Subu(scratch, rs, rt);
-      offset = GetOffset(offset, L, bits);
-      beqzalc(scratch, offset);
-      break;
-    case ne:
-      if (!is_near(L, bits)) return false;
-      Subu(scratch, rs, rt);
-      offset = GetOffset(offset, L, bits);
-      bnezalc(scratch, offset);
-      break;
-
-    // Signed comparison.
-    case greater:
-      // rs > rt
-      if (rs.code() == rt.rm().code()) {
-        break;  // No code needs to be emitted.
-      } else if (rs == zero_reg) {
-        if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-          return false;
-        bltzalc(scratch, offset);
-      } else if (IsZero(rt)) {
-        if (!CalculateOffset(L, offset, OffsetSize::kOffset16)) return false;
-        bgtzalc(rs, offset);
-      } else {
-        if (!is_near(L, bits)) return false;
-        Slt(scratch, GetRtAsRegisterHelper(rt, scratch), rs);
-        offset = GetOffset(offset, L, bits);
-        bnezalc(scratch, offset);
-      }
-      break;
-    case greater_equal:
-      // rs >= rt
-      if (rs.code() == rt.rm().code()) {
-        if (!CalculateOffset(L, offset, OffsetSize::kOffset26)) return false;
-        balc(offset);
-      } else if (rs == zero_reg) {
-        if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-          return false;
-        blezalc(scratch, offset);
-      } else if (IsZero(rt)) {
-        if (!CalculateOffset(L, offset, OffsetSize::kOffset16)) return false;
-        bgezalc(rs, offset);
-      } else {
-        if (!is_near(L, bits)) return false;
-        Slt(scratch, rs, rt);
-        offset = GetOffset(offset, L, bits);
-        beqzalc(scratch, offset);
-      }
-      break;
-    case less:
-      // rs < rt
-      if (rs.code() == rt.rm().code()) {
-        break;  // No code needs to be emitted.
-      } else if (rs == zero_reg) {
-        if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-          return false;
-        bgtzalc(scratch, offset);
-      } else if (IsZero(rt)) {
-        if (!CalculateOffset(L, offset, OffsetSize::kOffset16)) return false;
-        bltzalc(rs, offset);
-      } else {
-        if (!is_near(L, bits)) return false;
-        Slt(scratch, rs, rt);
-        offset = GetOffset(offset, L, bits);
-        bnezalc(scratch, offset);
-      }
-      break;
-    case less_equal:
-      // rs <= r2
-      if (rs.code() == rt.rm().code()) {
-        if (!CalculateOffset(L, offset, OffsetSize::kOffset26)) return false;
-        balc(offset);
-      } else if (rs == zero_reg) {
-        if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-          return false;
-        bgezalc(scratch, offset);
-      } else if (IsZero(rt)) {
-        if (!CalculateOffset(L, offset, OffsetSize::kOffset16)) return false;
-        blezalc(rs, offset);
-      } else {
-        if (!is_near(L, bits)) return false;
-        Slt(scratch, GetRtAsRegisterHelper(rt, scratch), rs);
-        offset = GetOffset(offset, L, bits);
-        beqzalc(scratch, offset);
-      }
-      break;
-
-
-    // Unsigned comparison.
-    case Ugreater:
-      // rs > r2
-      if (!is_near(L, bits)) return false;
-      Sltu(scratch, GetRtAsRegisterHelper(rt, scratch), rs);
-      offset = GetOffset(offset, L, bits);
-      bnezalc(scratch, offset);
-      break;
-    case Ugreater_equal:
-      // rs >= r2
-      if (!is_near(L, bits)) return false;
-      Sltu(scratch, rs, rt);
-      offset = GetOffset(offset, L, bits);
-      beqzalc(scratch, offset);
-      break;
-    case Uless:
-      // rs < r2
-      if (!is_near(L, bits)) return false;
-      Sltu(scratch, rs, rt);
-      offset = GetOffset(offset, L, bits);
-      bnezalc(scratch, offset);
-      break;
-    case Uless_equal:
-      // rs <= r2
-      if (!is_near(L, bits)) return false;
-      Sltu(scratch, GetRtAsRegisterHelper(rt, scratch), rs);
-      offset = GetOffset(offset, L, bits);
-      beqzalc(scratch, offset);
-      break;
-    default:
-      UNREACHABLE();
-  }
-  return true;
-}
-
-// Pre r6 we need to use a bgezal or bltzal, but they can't be used directly
-// with the slt instructions. We could use sub or add instead but we would miss
-// overflow cases, so we keep slt and add an intermediate third instruction.
-bool TurboAssembler::BranchAndLinkShortHelper(int16_t offset, Label* L,
-                                              Condition cond, Register rs,
-                                              const Operand& rt,
-                                              BranchDelaySlot bdslot) {
-  DCHECK(L == nullptr || offset == 0);
-  if (!is_near(L, OffsetSize::kOffset16)) return false;
-
-  Register scratch = t8;
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-
-  switch (cond) {
-    case cc_always:
-      offset = GetOffset(offset, L, OffsetSize::kOffset16);
-      bal(offset);
-      break;
-    case eq:
-      bne(rs, GetRtAsRegisterHelper(rt, scratch), 2);
-      nop();
-      offset = GetOffset(offset, L, OffsetSize::kOffset16);
-      bal(offset);
-      break;
-    case ne:
-      beq(rs, GetRtAsRegisterHelper(rt, scratch), 2);
-      nop();
-      offset = GetOffset(offset, L, OffsetSize::kOffset16);
-      bal(offset);
-      break;
-
-    // Signed comparison.
-    case greater:
-      Slt(scratch, GetRtAsRegisterHelper(rt, scratch), rs);
-      addiu(scratch, scratch, -1);
-      offset = GetOffset(offset, L, OffsetSize::kOffset16);
-      bgezal(scratch, offset);
-      break;
-    case greater_equal:
-      Slt(scratch, rs, rt);
-      addiu(scratch, scratch, -1);
-      offset = GetOffset(offset, L, OffsetSize::kOffset16);
-      bltzal(scratch, offset);
-      break;
-    case less:
-      Slt(scratch, rs, rt);
-      addiu(scratch, scratch, -1);
-      offset = GetOffset(offset, L, OffsetSize::kOffset16);
-      bgezal(scratch, offset);
-      break;
-    case less_equal:
-      Slt(scratch, GetRtAsRegisterHelper(rt, scratch), rs);
-      addiu(scratch, scratch, -1);
-      offset = GetOffset(offset, L, OffsetSize::kOffset16);
-      bltzal(scratch, offset);
-      break;
-
-    // Unsigned comparison.
-    case Ugreater:
-      Sltu(scratch, GetRtAsRegisterHelper(rt, scratch), rs);
-      addiu(scratch, scratch, -1);
-      offset = GetOffset(offset, L, OffsetSize::kOffset16);
-      bgezal(scratch, offset);
-      break;
-    case Ugreater_equal:
-      Sltu(scratch, rs, rt);
-      addiu(scratch, scratch, -1);
-      offset = GetOffset(offset, L, OffsetSize::kOffset16);
-      bltzal(scratch, offset);
-      break;
-    case Uless:
-      Sltu(scratch, rs, rt);
-      addiu(scratch, scratch, -1);
-      offset = GetOffset(offset, L, OffsetSize::kOffset16);
-      bgezal(scratch, offset);
-      break;
-    case Uless_equal:
-      Sltu(scratch, GetRtAsRegisterHelper(rt, scratch), rs);
-      addiu(scratch, scratch, -1);
-      offset = GetOffset(offset, L, OffsetSize::kOffset16);
-      bltzal(scratch, offset);
-      break;
-
-    default:
-      UNREACHABLE();
-  }
-
-  // Emit a nop in the branch delay slot if required.
-  if (bdslot == PROTECT)
-    nop();
-
-  return true;
-}
-
-bool TurboAssembler::BranchAndLinkShortCheck(int32_t offset, Label* L,
-                                             Condition cond, Register rs,
-                                             const Operand& rt,
-                                             BranchDelaySlot bdslot) {
-  BRANCH_ARGS_CHECK(cond, rs, rt);
-
-  if (!L) {
-    if (IsMipsArchVariant(kMips32r6) && bdslot == PROTECT) {
-      DCHECK(is_int26(offset));
-      return BranchAndLinkShortHelperR6(offset, nullptr, cond, rs, rt);
-    } else {
-      DCHECK(is_int16(offset));
-      return BranchAndLinkShortHelper(offset, nullptr, cond, rs, rt, bdslot);
-    }
-  } else {
-    DCHECK_EQ(offset, 0);
-    if (IsMipsArchVariant(kMips32r6) && bdslot == PROTECT) {
-      return BranchAndLinkShortHelperR6(0, L, cond, rs, rt);
-    } else {
-      return BranchAndLinkShortHelper(0, L, cond, rs, rt, bdslot);
-    }
-  }
-  return false;
-}
-
-void TurboAssembler::Jump(Register target, int16_t offset, Condition cond,
-                          Register rs, const Operand& rt, BranchDelaySlot bd) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  DCHECK(is_int16(offset));
-  if (IsMipsArchVariant(kMips32r6) && bd == PROTECT) {
-    if (cond == cc_always) {
-      jic(target, offset);
-    } else {
-      BRANCH_ARGS_CHECK(cond, rs, rt);
-      Branch(2, NegateCondition(cond), rs, rt);
-      jic(target, offset);
-    }
-  } else {
-    if (offset != 0) {
-      Addu(target, target, offset);
-    }
-    if (cond == cc_always) {
-      jr(target);
-    } else {
-      BRANCH_ARGS_CHECK(cond, rs, rt);
-      Branch(2, NegateCondition(cond), rs, rt);
-      jr(target);
-    }
-    // Emit a nop in the branch delay slot if required.
-    if (bd == PROTECT) nop();
-  }
-}
-
-void TurboAssembler::Jump(Register target, Register base, int16_t offset,
-                          Condition cond, Register rs, const Operand& rt,
-                          BranchDelaySlot bd) {
-  DCHECK(is_int16(offset));
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  if (IsMipsArchVariant(kMips32r6) && bd == PROTECT) {
-    if (cond == cc_always) {
-      jic(base, offset);
-    } else {
-      BRANCH_ARGS_CHECK(cond, rs, rt);
-      Branch(2, NegateCondition(cond), rs, rt);
-      jic(base, offset);
-    }
-  } else {
-    if (offset != 0) {
-      Addu(target, base, offset);
-    } else {  // Call through target
-      if (target != base) mov(target, base);
-    }
-    if (cond == cc_always) {
-      jr(target);
-    } else {
-      BRANCH_ARGS_CHECK(cond, rs, rt);
-      Branch(2, NegateCondition(cond), rs, rt);
-      jr(target);
-    }
-    // Emit a nop in the branch delay slot if required.
-    if (bd == PROTECT) nop();
-  }
-}
-
-void TurboAssembler::Jump(Register target, const Operand& offset,
-                          Condition cond, Register rs, const Operand& rt,
-                          BranchDelaySlot bd) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  if (IsMipsArchVariant(kMips32r6) && bd == PROTECT &&
-      !is_int16(offset.immediate())) {
-    uint32_t aui_offset, jic_offset;
-    Assembler::UnpackTargetAddressUnsigned(offset.immediate(), aui_offset,
-                                           jic_offset);
-    RecordRelocInfo(RelocInfo::EXTERNAL_REFERENCE, offset.immediate());
-    aui(target, target, aui_offset);
-    if (cond == cc_always) {
-      jic(target, jic_offset);
-    } else {
-      BRANCH_ARGS_CHECK(cond, rs, rt);
-      Branch(2, NegateCondition(cond), rs, rt);
-      jic(target, jic_offset);
-    }
-  } else {
-    if (offset.immediate() != 0) {
-      Addu(target, target, offset);
-    }
-    if (cond == cc_always) {
-      jr(target);
-    } else {
-      BRANCH_ARGS_CHECK(cond, rs, rt);
-      Branch(2, NegateCondition(cond), rs, rt);
-      jr(target);
-    }
-    // Emit a nop in the branch delay slot if required.
-    if (bd == PROTECT) nop();
-  }
-}
-
-void TurboAssembler::Jump(intptr_t target, RelocInfo::Mode rmode,
-                          Condition cond, Register rs, const Operand& rt,
-                          BranchDelaySlot bd) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  Label skip;
-  if (cond != cc_always) {
-    Branch(USE_DELAY_SLOT, &skip, NegateCondition(cond), rs, rt);
-  }
-  // The first instruction of 'li' may be placed in the delay slot.
-  // This is not an issue, t9 is expected to be clobbered anyway.
-  if (IsMipsArchVariant(kMips32r6) && bd == PROTECT) {
-    uint32_t lui_offset, jic_offset;
-    UnpackTargetAddressUnsigned(target, lui_offset, jic_offset);
-    DCHECK(MustUseReg(rmode));
-    RecordRelocInfo(rmode, target);
-    lui(t9, lui_offset);
-    Jump(t9, jic_offset, al, zero_reg, Operand(zero_reg), bd);
-  } else {
-    li(t9, Operand(target, rmode));
-    Jump(t9, 0, al, zero_reg, Operand(zero_reg), bd);
-  }
-  bind(&skip);
-}
-
-void TurboAssembler::Jump(Address target, RelocInfo::Mode rmode, Condition cond,
-                          Register rs, const Operand& rt, BranchDelaySlot bd) {
-  DCHECK(!RelocInfo::IsCodeTarget(rmode));
-  Jump(reinterpret_cast<intptr_t>(target), rmode, cond, rs, rt, bd);
-}
-
-void TurboAssembler::Jump(Handle<Code> code, RelocInfo::Mode rmode,
-                          Condition cond, Register rs, const Operand& rt,
-                          BranchDelaySlot bd) {
-  DCHECK(RelocInfo::IsCodeTarget(rmode));
-  Jump(reinterpret_cast<intptr_t>(code.address()), rmode, cond, rs, rt, bd);
-}
-
-int TurboAssembler::CallSize(Register target, int16_t offset, Condition cond,
-                             Register rs, const Operand& rt,
-                             BranchDelaySlot bd) {
-  int size = 0;
-
-  if (cond == cc_always) {
-    size += 1;
-  } else {
-    size += 3;
-  }
-
-  if (bd == PROTECT && !IsMipsArchVariant(kMips32r6)) size += 1;
-
-  if (!IsMipsArchVariant(kMips32r6) && offset != 0) {
-    size += 1;
-  }
-
-  return size * kInstrSize;
-}
-
-
-// Note: To call gcc-compiled C code on mips, you must call through t9.
-void TurboAssembler::Call(Register target, int16_t offset, Condition cond,
-                          Register rs, const Operand& rt, BranchDelaySlot bd) {
-  DCHECK(is_int16(offset));
-#ifdef DEBUG
-  int size = IsPrevInstrCompactBranch() ? kInstrSize : 0;
-#endif
-
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  Label start;
-  bind(&start);
-  if (IsMipsArchVariant(kMips32r6) && bd == PROTECT) {
-    if (cond == cc_always) {
-      jialc(target, offset);
-    } else {
-      BRANCH_ARGS_CHECK(cond, rs, rt);
-      Branch(2, NegateCondition(cond), rs, rt);
-      jialc(target, offset);
-    }
-  } else {
-    if (offset != 0) {
-      Addu(target, target, offset);
-    }
-    if (cond == cc_always) {
-      jalr(target);
-    } else {
-      BRANCH_ARGS_CHECK(cond, rs, rt);
-      Branch(2, NegateCondition(cond), rs, rt);
-      jalr(target);
-    }
-    // Emit a nop in the branch delay slot if required.
-    if (bd == PROTECT) nop();
-  }
-
-#ifdef DEBUG
-  DCHECK_EQ(size + CallSize(target, offset, cond, rs, rt, bd),
-            SizeOfCodeGeneratedSince(&start));
-#endif
-}
-
-// Note: To call gcc-compiled C code on mips, you must call through t9.
-void TurboAssembler::Call(Register target, Register base, int16_t offset,
-                          Condition cond, Register rs, const Operand& rt,
-                          BranchDelaySlot bd) {
-  DCHECK(is_uint16(offset));
-#ifdef DEBUG
-  int size = IsPrevInstrCompactBranch() ? kInstrSize : 0;
-#endif
-
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  Label start;
-  bind(&start);
-  if (IsMipsArchVariant(kMips32r6) && bd == PROTECT) {
-    if (cond == cc_always) {
-      jialc(base, offset);
-    } else {
-      BRANCH_ARGS_CHECK(cond, rs, rt);
-      Branch(2, NegateCondition(cond), rs, rt);
-      jialc(base, offset);
-    }
-  } else {
-    if (offset != 0) {
-      Addu(target, base, offset);
-    } else {  // Call through target
-      if (target != base) mov(target, base);
-    }
-    if (cond == cc_always) {
-      jalr(target);
-    } else {
-      BRANCH_ARGS_CHECK(cond, rs, rt);
-      Branch(2, NegateCondition(cond), rs, rt);
-      jalr(target);
-    }
-    // Emit a nop in the branch delay slot if required.
-    if (bd == PROTECT) nop();
-  }
-
-#ifdef DEBUG
-  DCHECK_EQ(size + CallSize(target, offset, cond, rs, rt, bd),
-            SizeOfCodeGeneratedSince(&start));
-#endif
-}
-
-int TurboAssembler::CallSize(Address target, RelocInfo::Mode rmode,
-                             Condition cond, Register rs, const Operand& rt,
-                             BranchDelaySlot bd) {
-  int size = CallSize(t9, 0, cond, rs, rt, bd);
-  if (IsMipsArchVariant(kMips32r6) && bd == PROTECT && cond == cc_always)
-    return size + 1 * kInstrSize;
-  else
-    return size + 2 * kInstrSize;
-}
-
-void TurboAssembler::Call(Address target, RelocInfo::Mode rmode, Condition cond,
-                          Register rs, const Operand& rt, BranchDelaySlot bd) {
-  CheckBuffer();
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  Label start;
-  bind(&start);
-  int32_t target_int = reinterpret_cast<int32_t>(target);
-  if (IsMipsArchVariant(kMips32r6) && bd == PROTECT && cond == cc_always) {
-    uint32_t lui_offset, jialc_offset;
-    UnpackTargetAddressUnsigned(target_int, lui_offset, jialc_offset);
-    if (MustUseReg(rmode)) {
-      RecordRelocInfo(rmode, target_int);
-    }
-    lui(t9, lui_offset);
-    Call(t9, jialc_offset, cond, rs, rt, bd);
-  } else {
-    li(t9, Operand(target_int, rmode), CONSTANT_SIZE);
-    Call(t9, 0, cond, rs, rt, bd);
-  }
-  DCHECK_EQ(CallSize(target, rmode, cond, rs, rt, bd),
-            SizeOfCodeGeneratedSince(&start));
-}
-
-int TurboAssembler::CallSize(Handle<Code> code, RelocInfo::Mode rmode,
-                             Condition cond, Register rs, const Operand& rt,
-                             BranchDelaySlot bd) {
-  AllowDeferredHandleDereference using_raw_address;
-  return CallSize(code.address(), rmode, cond, rs, rt, bd);
-}
-
-void TurboAssembler::Call(Handle<Code> code, RelocInfo::Mode rmode,
-                          Condition cond, Register rs, const Operand& rt,
-                          BranchDelaySlot bd) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  Label start;
-  bind(&start);
-  DCHECK(RelocInfo::IsCodeTarget(rmode));
-  AllowDeferredHandleDereference embedding_raw_address;
-  Call(code.address(), rmode, cond, rs, rt, bd);
-  DCHECK_EQ(CallSize(code, rmode, cond, rs, rt, bd),
-            SizeOfCodeGeneratedSince(&start));
-}
-
-void TurboAssembler::Ret(Condition cond, Register rs, const Operand& rt,
-                         BranchDelaySlot bd) {
-  Jump(ra, 0, cond, rs, rt, bd);
-}
-
-void TurboAssembler::BranchLong(Label* L, BranchDelaySlot bdslot) {
-  if (IsMipsArchVariant(kMips32r6) && bdslot == PROTECT &&
-      (!L->is_bound() || is_near_r6(L))) {
-    BranchShortHelperR6(0, L);
-  } else {
-    BlockTrampolinePoolScope block_trampoline_pool(this);
-    uint32_t imm32;
-    imm32 = jump_address(L);
-    if (IsMipsArchVariant(kMips32r6) && bdslot == PROTECT) {
-      uint32_t lui_offset, jic_offset;
-      UnpackTargetAddressUnsigned(imm32, lui_offset, jic_offset);
-      {
-        BlockGrowBufferScope block_buf_growth(this);
-        // Buffer growth (and relocation) must be blocked for internal
-        // references until associated instructions are emitted and
-        // available to be patched.
-        RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE_ENCODED);
-        UseScratchRegisterScope temps(this);
-        Register scratch = temps.hasAvailable() ? temps.Acquire() : t8;
-        lui(scratch, lui_offset);
-        jic(scratch, jic_offset);
-      }
-      CheckBuffer();
-    } else {
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.hasAvailable() ? temps.Acquire() : t8;
-      {
-        BlockGrowBufferScope block_buf_growth(this);
-        // Buffer growth (and relocation) must be blocked for internal
-        // references until associated instructions are emitted and
-        // available to be patched.
-        RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE_ENCODED);
-        lui(scratch, (imm32 & kHiMask) >> kLuiShift);
-        ori(scratch, scratch, (imm32 & kImm16Mask));
-      }
-      CheckBuffer();
-      jr(scratch);
-      // Emit a nop in the branch delay slot if required.
-      if (bdslot == PROTECT) nop();
-    }
-  }
-}
-
-void TurboAssembler::BranchAndLinkLong(Label* L, BranchDelaySlot bdslot) {
-  if (IsMipsArchVariant(kMips32r6) && bdslot == PROTECT &&
-      (!L->is_bound() || is_near_r6(L))) {
-    BranchAndLinkShortHelperR6(0, L);
-  } else {
-    BlockTrampolinePoolScope block_trampoline_pool(this);
-    uint32_t imm32;
-    imm32 = jump_address(L);
-    if (IsMipsArchVariant(kMips32r6) && bdslot == PROTECT) {
-      uint32_t lui_offset, jialc_offset;
-      UnpackTargetAddressUnsigned(imm32, lui_offset, jialc_offset);
-      {
-        BlockGrowBufferScope block_buf_growth(this);
-        // Buffer growth (and relocation) must be blocked for internal
-        // references until associated instructions are emitted and
-        // available to be patched.
-        RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE_ENCODED);
-        UseScratchRegisterScope temps(this);
-        Register scratch = temps.hasAvailable() ? temps.Acquire() : t8;
-        lui(scratch, lui_offset);
-        jialc(scratch, jialc_offset);
-      }
-      CheckBuffer();
-    } else {
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.hasAvailable() ? temps.Acquire() : t8;
-      {
-        BlockGrowBufferScope block_buf_growth(this);
-        // Buffer growth (and relocation) must be blocked for internal
-        // references until associated instructions are emitted and
-        // available to be patched.
-        RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE_ENCODED);
-        lui(scratch, (imm32 & kHiMask) >> kLuiShift);
-        ori(scratch, scratch, (imm32 & kImm16Mask));
-      }
-      CheckBuffer();
-      jalr(scratch);
-      // Emit a nop in the branch delay slot if required.
-      if (bdslot == PROTECT) nop();
-    }
-  }
-}
-
-void TurboAssembler::DropAndRet(int drop) {
-  DCHECK(is_int16(drop * kPointerSize));
-  Ret(USE_DELAY_SLOT);
-  addiu(sp, sp, drop * kPointerSize);
-}
-
-void TurboAssembler::DropAndRet(int drop, Condition cond, Register r1,
-                                const Operand& r2) {
-  // Both Drop and Ret need to be conditional.
-  Label skip;
-  if (cond != cc_always) {
-    Branch(&skip, NegateCondition(cond), r1, r2);
-  }
-
-  Drop(drop);
-  Ret();
-
-  if (cond != cc_always) {
-    bind(&skip);
-  }
-}
-
-void TurboAssembler::Drop(int count, Condition cond, Register reg,
-                          const Operand& op) {
-  if (count <= 0) {
-    return;
-  }
-
-  Label skip;
-
-  if (cond != al) {
-     Branch(&skip, NegateCondition(cond), reg, op);
-  }
-
-  Addu(sp, sp, Operand(count * kPointerSize));
-
-  if (cond != al) {
-    bind(&skip);
-  }
-}
-
-
-
-void MacroAssembler::Swap(Register reg1,
-                          Register reg2,
-                          Register scratch) {
-  if (scratch == no_reg) {
-    Xor(reg1, reg1, Operand(reg2));
-    Xor(reg2, reg2, Operand(reg1));
-    Xor(reg1, reg1, Operand(reg2));
-  } else {
-    mov(scratch, reg1);
-    mov(reg1, reg2);
-    mov(reg2, scratch);
-  }
-}
-
-void TurboAssembler::Call(Label* target) { BranchAndLink(target); }
-
-void TurboAssembler::Push(Handle<HeapObject> handle) {
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  li(scratch, Operand(handle));
-  push(scratch);
-}
-
-void TurboAssembler::Push(Smi* smi) {
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  li(scratch, Operand(smi));
-  push(scratch);
-}
-
-void MacroAssembler::MaybeDropFrames() {
-  // Check whether we need to drop frames to restart a function on the stack.
-  ExternalReference restart_fp =
-      ExternalReference::debug_restart_fp_address(isolate());
-  li(a1, Operand(restart_fp));
-  lw(a1, MemOperand(a1));
-  Jump(BUILTIN_CODE(isolate(), FrameDropperTrampoline), RelocInfo::CODE_TARGET,
-       ne, a1, Operand(zero_reg));
-}
-
-// ---------------------------------------------------------------------------
-// Exception handling.
-
-void MacroAssembler::PushStackHandler() {
-  // Adjust this code if not the case.
-  STATIC_ASSERT(StackHandlerConstants::kSize == 2 * kPointerSize);
-  STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize);
-
-  Push(Smi::kZero);  // Padding.
-
-  // Link the current handler as the next handler.
-  li(t2,
-     Operand(ExternalReference(IsolateAddressId::kHandlerAddress, isolate())));
-  lw(t1, MemOperand(t2));
-  push(t1);
-
-  // Set this new handler as the current one.
-  sw(sp, MemOperand(t2));
-}
-
-
-void MacroAssembler::PopStackHandler() {
-  STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
-  pop(a1);
-  Addu(sp, sp, Operand(StackHandlerConstants::kSize - kPointerSize));
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  li(scratch,
-     Operand(ExternalReference(IsolateAddressId::kHandlerAddress, isolate())));
-  sw(a1, MemOperand(scratch));
-}
-
-void TurboAssembler::FPUCanonicalizeNaN(const DoubleRegister dst,
-                                        const DoubleRegister src) {
-  sub_d(dst, src, kDoubleRegZero);
-}
-
-void TurboAssembler::MovFromFloatResult(DoubleRegister dst) {
-  if (IsMipsSoftFloatABI) {
-    if (kArchEndian == kLittle) {
-      Move(dst, v0, v1);
-    } else {
-      Move(dst, v1, v0);
-    }
-  } else {
-    Move(dst, f0);  // Reg f0 is o32 ABI FP return value.
-  }
-}
-
-void TurboAssembler::MovFromFloatParameter(DoubleRegister dst) {
-  if (IsMipsSoftFloatABI) {
-    if (kArchEndian == kLittle) {
-      Move(dst, a0, a1);
-    } else {
-      Move(dst, a1, a0);
-    }
-  } else {
-    Move(dst, f12);  // Reg f12 is o32 ABI FP first argument value.
-  }
-}
-
-void TurboAssembler::MovToFloatParameter(DoubleRegister src) {
-  if (!IsMipsSoftFloatABI) {
-    Move(f12, src);
-  } else {
-    if (kArchEndian == kLittle) {
-      Move(a0, a1, src);
-    } else {
-      Move(a1, a0, src);
-    }
-  }
-}
-
-void TurboAssembler::MovToFloatResult(DoubleRegister src) {
-  if (!IsMipsSoftFloatABI) {
-    Move(f0, src);
-  } else {
-    if (kArchEndian == kLittle) {
-      Move(v0, v1, src);
-    } else {
-      Move(v1, v0, src);
-    }
-  }
-}
-
-void TurboAssembler::MovToFloatParameters(DoubleRegister src1,
-                                          DoubleRegister src2) {
-  if (!IsMipsSoftFloatABI) {
-    if (src2 == f12) {
-      DCHECK(src1 != f14);
-      Move(f14, src2);
-      Move(f12, src1);
-    } else {
-      Move(f12, src1);
-      Move(f14, src2);
-    }
-  } else {
-    if (kArchEndian == kLittle) {
-      Move(a0, a1, src1);
-      Move(a2, a3, src2);
-    } else {
-      Move(a1, a0, src1);
-      Move(a3, a2, src2);
-    }
-  }
-}
-
-
-// -----------------------------------------------------------------------------
-// JavaScript invokes.
-
-void TurboAssembler::PrepareForTailCall(const ParameterCount& callee_args_count,
-                                        Register caller_args_count_reg,
-                                        Register scratch0, Register scratch1) {
-#if DEBUG
-  if (callee_args_count.is_reg()) {
-    DCHECK(!AreAliased(callee_args_count.reg(), caller_args_count_reg, scratch0,
-                       scratch1));
-  } else {
-    DCHECK(!AreAliased(caller_args_count_reg, scratch0, scratch1));
-  }
-#endif
-
-  // Calculate the end of destination area where we will put the arguments
-  // after we drop current frame. We add kPointerSize to count the receiver
-  // argument which is not included into formal parameters count.
-  Register dst_reg = scratch0;
-  Lsa(dst_reg, fp, caller_args_count_reg, kPointerSizeLog2);
-  Addu(dst_reg, dst_reg,
-       Operand(StandardFrameConstants::kCallerSPOffset + kPointerSize));
-
-  Register src_reg = caller_args_count_reg;
-  // Calculate the end of source area. +kPointerSize is for the receiver.
-  if (callee_args_count.is_reg()) {
-    Lsa(src_reg, sp, callee_args_count.reg(), kPointerSizeLog2);
-    Addu(src_reg, src_reg, Operand(kPointerSize));
-  } else {
-    Addu(src_reg, sp,
-         Operand((callee_args_count.immediate() + 1) * kPointerSize));
-  }
-
-  if (FLAG_debug_code) {
-    Check(lo, AbortReason::kStackAccessBelowStackPointer, src_reg,
-          Operand(dst_reg));
-  }
-
-  // Restore caller's frame pointer and return address now as they will be
-  // overwritten by the copying loop.
-  lw(ra, MemOperand(fp, StandardFrameConstants::kCallerPCOffset));
-  lw(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
-
-  // Now copy callee arguments to the caller frame going backwards to avoid
-  // callee arguments corruption (source and destination areas could overlap).
-
-  // Both src_reg and dst_reg are pointing to the word after the one to copy,
-  // so they must be pre-decremented in the loop.
-  Register tmp_reg = scratch1;
-  Label loop, entry;
-  Branch(&entry);
-  bind(&loop);
-  Subu(src_reg, src_reg, Operand(kPointerSize));
-  Subu(dst_reg, dst_reg, Operand(kPointerSize));
-  lw(tmp_reg, MemOperand(src_reg));
-  sw(tmp_reg, MemOperand(dst_reg));
-  bind(&entry);
-  Branch(&loop, ne, sp, Operand(src_reg));
-
-  // Leave current frame.
-  mov(sp, dst_reg);
-}
-
-void MacroAssembler::InvokePrologue(const ParameterCount& expected,
-                                    const ParameterCount& actual, Label* done,
-                                    bool* definitely_mismatches,
-                                    InvokeFlag flag) {
-  bool definitely_matches = false;
-  *definitely_mismatches = false;
-  Label regular_invoke;
-
-  // Check whether the expected and actual arguments count match. If not,
-  // setup registers according to contract with ArgumentsAdaptorTrampoline:
-  //  a0: actual arguments count
-  //  a1: function (passed through to callee)
-  //  a2: expected arguments count
-
-  // The code below is made a lot easier because the calling code already sets
-  // up actual and expected registers according to the contract if values are
-  // passed in registers.
-  DCHECK(actual.is_immediate() || actual.reg() == a0);
-  DCHECK(expected.is_immediate() || expected.reg() == a2);
-
-  if (expected.is_immediate()) {
-    DCHECK(actual.is_immediate());
-    li(a0, Operand(actual.immediate()));
-    if (expected.immediate() == actual.immediate()) {
-      definitely_matches = true;
-    } else {
-      const int sentinel = SharedFunctionInfo::kDontAdaptArgumentsSentinel;
-      if (expected.immediate() == sentinel) {
-        // Don't worry about adapting arguments for builtins that
-        // don't want that done. Skip adaption code by making it look
-        // like we have a match between expected and actual number of
-        // arguments.
-        definitely_matches = true;
-      } else {
-        *definitely_mismatches = true;
-        li(a2, Operand(expected.immediate()));
-      }
-    }
-  } else if (actual.is_immediate()) {
-    li(a0, Operand(actual.immediate()));
-    Branch(&regular_invoke, eq, expected.reg(), Operand(a0));
-  } else {
-    Branch(&regular_invoke, eq, expected.reg(), Operand(actual.reg()));
-  }
-
-  if (!definitely_matches) {
-    Handle<Code> adaptor = BUILTIN_CODE(isolate(), ArgumentsAdaptorTrampoline);
-    if (flag == CALL_FUNCTION) {
-      Call(adaptor);
-      if (!*definitely_mismatches) {
-        Branch(done);
-      }
-    } else {
-      Jump(adaptor, RelocInfo::CODE_TARGET);
-    }
-    bind(&regular_invoke);
-  }
-}
-
-void MacroAssembler::CheckDebugHook(Register fun, Register new_target,
-                                    const ParameterCount& expected,
-                                    const ParameterCount& actual) {
-  Label skip_hook;
-  ExternalReference debug_hook_active =
-      ExternalReference::debug_hook_on_function_call_address(isolate());
-  li(t0, Operand(debug_hook_active));
-  lb(t0, MemOperand(t0));
-  Branch(&skip_hook, eq, t0, Operand(zero_reg));
-  {
-    FrameScope frame(this,
-                     has_frame() ? StackFrame::NONE : StackFrame::INTERNAL);
-    if (expected.is_reg()) {
-      SmiTag(expected.reg());
-      Push(expected.reg());
-    }
-    if (actual.is_reg()) {
-      SmiTag(actual.reg());
-      Push(actual.reg());
-    }
-    if (new_target.is_valid()) {
-      Push(new_target);
-    }
-    Push(fun);
-    Push(fun);
-    CallRuntime(Runtime::kDebugOnFunctionCall);
-    Pop(fun);
-    if (new_target.is_valid()) {
-      Pop(new_target);
-    }
-    if (actual.is_reg()) {
-      Pop(actual.reg());
-      SmiUntag(actual.reg());
-    }
-    if (expected.is_reg()) {
-      Pop(expected.reg());
-      SmiUntag(expected.reg());
-    }
-  }
-  bind(&skip_hook);
-}
-
-void MacroAssembler::InvokeFunctionCode(Register function, Register new_target,
-                                        const ParameterCount& expected,
-                                        const ParameterCount& actual,
-                                        InvokeFlag flag) {
-  // You can't call a function without a valid frame.
-  DCHECK(flag == JUMP_FUNCTION || has_frame());
-  DCHECK(function == a1);
-  DCHECK_IMPLIES(new_target.is_valid(), new_target == a3);
-
-  // On function call, call into the debugger if necessary.
-  CheckDebugHook(function, new_target, expected, actual);
-
-  // Clear the new.target register if not given.
-  if (!new_target.is_valid()) {
-    LoadRoot(a3, Heap::kUndefinedValueRootIndex);
-  }
-
-  Label done;
-  bool definitely_mismatches = false;
-  InvokePrologue(expected, actual, &done, &definitely_mismatches, flag);
-  if (!definitely_mismatches) {
-    // We call indirectly through the code field in the function to
-    // allow recompilation to take effect without changing any of the
-    // call sites.
-    Register code = t0;
-    lw(code, FieldMemOperand(function, JSFunction::kCodeOffset));
-    if (flag == CALL_FUNCTION) {
-      Call(code, Code::kHeaderSize - kHeapObjectTag);
-    } else {
-      DCHECK(flag == JUMP_FUNCTION);
-      Jump(code, Code::kHeaderSize - kHeapObjectTag);
-    }
-    // Continue here if InvokePrologue does handle the invocation due to
-    // mismatched parameter counts.
-    bind(&done);
-  }
-}
-
-void MacroAssembler::InvokeFunction(Register function, Register new_target,
-                                    const ParameterCount& actual,
-                                    InvokeFlag flag) {
-  // You can't call a function without a valid frame.
-  DCHECK(flag == JUMP_FUNCTION || has_frame());
-
-  // Contract with called JS functions requires that function is passed in a1.
-  DCHECK(function == a1);
-  Register expected_reg = a2;
-  Register temp_reg = t0;
-
-  lw(temp_reg, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
-  lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset));
-  lw(expected_reg,
-     FieldMemOperand(temp_reg,
-                     SharedFunctionInfo::kFormalParameterCountOffset));
-
-  ParameterCount expected(expected_reg);
-  InvokeFunctionCode(function, new_target, expected, actual, flag);
-}
-
-void MacroAssembler::InvokeFunction(Register function,
-                                    const ParameterCount& expected,
-                                    const ParameterCount& actual,
-                                    InvokeFlag flag) {
-  // You can't call a function without a valid frame.
-  DCHECK(flag == JUMP_FUNCTION || has_frame());
-
-  // Contract with called JS functions requires that function is passed in a1.
-  DCHECK(function == a1);
-
-  // Get the function and setup the context.
-  lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset));
-
-  InvokeFunctionCode(a1, no_reg, expected, actual, flag);
-}
-
-void MacroAssembler::InvokeFunction(Handle<JSFunction> function,
-                                    const ParameterCount& expected,
-                                    const ParameterCount& actual,
-                                    InvokeFlag flag) {
-  li(a1, function);
-  InvokeFunction(a1, expected, actual, flag);
-}
-
-
-// ---------------------------------------------------------------------------
-// Support functions.
-
-void MacroAssembler::GetObjectType(Register object,
-                                   Register map,
-                                   Register type_reg) {
-  lw(map, FieldMemOperand(object, HeapObject::kMapOffset));
-  lhu(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset));
-}
-
-
-// -----------------------------------------------------------------------------
-// Runtime calls.
-
-void MacroAssembler::CallStub(CodeStub* stub,
-                              Condition cond,
-                              Register r1,
-                              const Operand& r2,
-                              BranchDelaySlot bd) {
-  DCHECK(AllowThisStubCall(stub));  // Stub calls are not allowed in some stubs.
-  Call(stub->GetCode(), RelocInfo::CODE_TARGET, cond, r1, r2, bd);
-}
-
-void TurboAssembler::CallStubDelayed(CodeStub* stub, Condition cond,
-                                     Register r1, const Operand& r2,
-                                     BranchDelaySlot bd) {
-  DCHECK(AllowThisStubCall(stub));  // Stub calls are not allowed in some stubs.
-
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  li(scratch, Operand::EmbeddedCode(stub));
-  Call(scratch);
-}
-
-void MacroAssembler::TailCallStub(CodeStub* stub,
-                                  Condition cond,
-                                  Register r1,
-                                  const Operand& r2,
-                                  BranchDelaySlot bd) {
-  Jump(stub->GetCode(), RelocInfo::CODE_TARGET, cond, r1, r2, bd);
-}
-
-bool TurboAssembler::AllowThisStubCall(CodeStub* stub) {
-  return has_frame() || !stub->SometimesSetsUpAFrame();
-}
-
-static inline void BranchOvfHelper(TurboAssembler* tasm, Register overflow_dst,
-                                   Label* overflow_label,
-                                   Label* no_overflow_label) {
-  DCHECK(overflow_label || no_overflow_label);
-  if (!overflow_label) {
-    DCHECK(no_overflow_label);
-    tasm->Branch(no_overflow_label, ge, overflow_dst, Operand(zero_reg));
-  } else {
-    tasm->Branch(overflow_label, lt, overflow_dst, Operand(zero_reg));
-    if (no_overflow_label) tasm->Branch(no_overflow_label);
-  }
-}
-
-void TurboAssembler::AddBranchOvf(Register dst, Register left,
-                                  const Operand& right, Label* overflow_label,
-                                  Label* no_overflow_label, Register scratch) {
-  if (right.is_reg()) {
-    AddBranchOvf(dst, left, right.rm(), overflow_label, no_overflow_label,
-                 scratch);
-  } else {
-    if (IsMipsArchVariant(kMips32r6)) {
-      Register right_reg = t9;
-      DCHECK(left != right_reg);
-      li(right_reg, Operand(right));
-      AddBranchOvf(dst, left, right_reg, overflow_label, no_overflow_label);
-    } else {
-      Register overflow_dst = t9;
-      DCHECK(dst != scratch);
-      DCHECK(dst != overflow_dst);
-      DCHECK(scratch != overflow_dst);
-      DCHECK(left != overflow_dst);
-      if (dst == left) {
-        mov(scratch, left);                  // Preserve left.
-        Addu(dst, left, right.immediate());  // Left is overwritten.
-        xor_(scratch, dst, scratch);         // Original left.
-        // Load right since xori takes uint16 as immediate.
-        Addu(overflow_dst, zero_reg, right);
-        xor_(overflow_dst, dst, overflow_dst);
-        and_(overflow_dst, overflow_dst, scratch);
-      } else {
-        Addu(dst, left, right.immediate());
-        xor_(overflow_dst, dst, left);
-        // Load right since xori takes uint16 as immediate.
-        Addu(scratch, zero_reg, right);
-        xor_(scratch, dst, scratch);
-        and_(overflow_dst, scratch, overflow_dst);
-      }
-      BranchOvfHelper(this, overflow_dst, overflow_label, no_overflow_label);
-    }
-  }
-}
-
-void TurboAssembler::AddBranchOvf(Register dst, Register left, Register right,
-                                  Label* overflow_label,
-                                  Label* no_overflow_label, Register scratch) {
-  if (IsMipsArchVariant(kMips32r6)) {
-    if (!overflow_label) {
-      DCHECK(no_overflow_label);
-      DCHECK(dst != scratch);
-      Register left_reg = left == dst ? scratch : left;
-      Register right_reg = right == dst ? t9 : right;
-      DCHECK(dst != left_reg);
-      DCHECK(dst != right_reg);
-      Move(left_reg, left);
-      Move(right_reg, right);
-      addu(dst, left, right);
-      Bnvc(left_reg, right_reg, no_overflow_label);
-    } else {
-      Bovc(left, right, overflow_label);
-      addu(dst, left, right);
-      if (no_overflow_label) bc(no_overflow_label);
-    }
-  } else {
-    Register overflow_dst = t9;
-    DCHECK(dst != scratch);
-    DCHECK(dst != overflow_dst);
-    DCHECK(scratch != overflow_dst);
-    DCHECK(left != overflow_dst);
-    DCHECK(right != overflow_dst);
-    DCHECK(left != scratch);
-    DCHECK(right != scratch);
-
-    if (left == right && dst == left) {
-      mov(overflow_dst, right);
-      right = overflow_dst;
-    }
-
-    if (dst == left) {
-      mov(scratch, left);           // Preserve left.
-      addu(dst, left, right);       // Left is overwritten.
-      xor_(scratch, dst, scratch);  // Original left.
-      xor_(overflow_dst, dst, right);
-      and_(overflow_dst, overflow_dst, scratch);
-    } else if (dst == right) {
-      mov(scratch, right);          // Preserve right.
-      addu(dst, left, right);       // Right is overwritten.
-      xor_(scratch, dst, scratch);  // Original right.
-      xor_(overflow_dst, dst, left);
-      and_(overflow_dst, overflow_dst, scratch);
-    } else {
-      addu(dst, left, right);
-      xor_(overflow_dst, dst, left);
-      xor_(scratch, dst, right);
-      and_(overflow_dst, scratch, overflow_dst);
-    }
-    BranchOvfHelper(this, overflow_dst, overflow_label, no_overflow_label);
-  }
-}
-
-void TurboAssembler::SubBranchOvf(Register dst, Register left,
-                                  const Operand& right, Label* overflow_label,
-                                  Label* no_overflow_label, Register scratch) {
-  DCHECK(overflow_label || no_overflow_label);
-  if (right.is_reg()) {
-    SubBranchOvf(dst, left, right.rm(), overflow_label, no_overflow_label,
-                 scratch);
-  } else {
-    Register overflow_dst = t9;
-    DCHECK(dst != scratch);
-    DCHECK(dst != overflow_dst);
-    DCHECK(scratch != overflow_dst);
-    DCHECK(left != overflow_dst);
-    DCHECK(left != scratch);
-    if (dst == left) {
-      mov(scratch, left);                      // Preserve left.
-      Subu(dst, left, right.immediate());      // Left is overwritten.
-      // Load right since xori takes uint16 as immediate.
-      Addu(overflow_dst, zero_reg, right);
-      xor_(overflow_dst, scratch, overflow_dst);  // scratch is original left.
-      xor_(scratch, dst, scratch);                // scratch is original left.
-      and_(overflow_dst, scratch, overflow_dst);
-    } else {
-      Subu(dst, left, right);
-      xor_(overflow_dst, dst, left);
-      // Load right since xori takes uint16 as immediate.
-      Addu(scratch, zero_reg, right);
-      xor_(scratch, left, scratch);
-      and_(overflow_dst, scratch, overflow_dst);
-    }
-    BranchOvfHelper(this, overflow_dst, overflow_label, no_overflow_label);
-  }
-}
-
-void TurboAssembler::SubBranchOvf(Register dst, Register left, Register right,
-                                  Label* overflow_label,
-                                  Label* no_overflow_label, Register scratch) {
-  DCHECK(overflow_label || no_overflow_label);
-  Register overflow_dst = t9;
-  DCHECK(dst != scratch);
-  DCHECK(dst != overflow_dst);
-  DCHECK(scratch != overflow_dst);
-  DCHECK(overflow_dst != left);
-  DCHECK(overflow_dst != right);
-  DCHECK(scratch != left);
-  DCHECK(scratch != right);
-
-  // This happens with some crankshaft code. Since Subu works fine if
-  // left == right, let's not make that restriction here.
-  if (left == right) {
-    mov(dst, zero_reg);
-    if (no_overflow_label) {
-      Branch(no_overflow_label);
-    }
-  }
-
-  if (dst == left) {
-    mov(scratch, left);  // Preserve left.
-    subu(dst, left, right);  // Left is overwritten.
-    xor_(overflow_dst, dst, scratch);  // scratch is original left.
-    xor_(scratch, scratch, right);  // scratch is original left.
-    and_(overflow_dst, scratch, overflow_dst);
-  } else if (dst == right) {
-    mov(scratch, right);  // Preserve right.
-    subu(dst, left, right);  // Right is overwritten.
-    xor_(overflow_dst, dst, left);
-    xor_(scratch, left, scratch);  // Original right.
-    and_(overflow_dst, scratch, overflow_dst);
-  } else {
-    subu(dst, left, right);
-    xor_(overflow_dst, dst, left);
-    xor_(scratch, left, right);
-    and_(overflow_dst, scratch, overflow_dst);
-  }
-  BranchOvfHelper(this, overflow_dst, overflow_label, no_overflow_label);
-}
-
-static inline void BranchOvfHelperMult(TurboAssembler* tasm,
-                                       Register overflow_dst,
-                                       Label* overflow_label,
-                                       Label* no_overflow_label) {
-  DCHECK(overflow_label || no_overflow_label);
-  if (!overflow_label) {
-    DCHECK(no_overflow_label);
-    tasm->Branch(no_overflow_label, eq, overflow_dst, Operand(zero_reg));
-  } else {
-    tasm->Branch(overflow_label, ne, overflow_dst, Operand(zero_reg));
-    if (no_overflow_label) tasm->Branch(no_overflow_label);
-  }
-}
-
-void TurboAssembler::MulBranchOvf(Register dst, Register left,
-                                  const Operand& right, Label* overflow_label,
-                                  Label* no_overflow_label, Register scratch) {
-  DCHECK(overflow_label || no_overflow_label);
-  if (right.is_reg()) {
-    MulBranchOvf(dst, left, right.rm(), overflow_label, no_overflow_label,
-                 scratch);
-  } else {
-    Register overflow_dst = t9;
-    DCHECK(dst != scratch);
-    DCHECK(dst != overflow_dst);
-    DCHECK(scratch != overflow_dst);
-    DCHECK(left != overflow_dst);
-    DCHECK(left != scratch);
-
-    Mul(overflow_dst, dst, left, right.immediate());
-    sra(scratch, dst, 31);
-    xor_(overflow_dst, overflow_dst, scratch);
-
-    BranchOvfHelperMult(this, overflow_dst, overflow_label, no_overflow_label);
-  }
-}
-
-void TurboAssembler::MulBranchOvf(Register dst, Register left, Register right,
-                                  Label* overflow_label,
-                                  Label* no_overflow_label, Register scratch) {
-  DCHECK(overflow_label || no_overflow_label);
-  Register overflow_dst = t9;
-  DCHECK(dst != scratch);
-  DCHECK(dst != overflow_dst);
-  DCHECK(scratch != overflow_dst);
-  DCHECK(overflow_dst != left);
-  DCHECK(overflow_dst != right);
-  DCHECK(scratch != left);
-  DCHECK(scratch != right);
-
-  if (IsMipsArchVariant(kMips32r6) && dst == right) {
-    mov(scratch, right);
-    Mul(overflow_dst, dst, left, scratch);
-    sra(scratch, dst, 31);
-    xor_(overflow_dst, overflow_dst, scratch);
-  } else {
-    Mul(overflow_dst, dst, left, right);
-    sra(scratch, dst, 31);
-    xor_(overflow_dst, overflow_dst, scratch);
-  }
-
-  BranchOvfHelperMult(this, overflow_dst, overflow_label, no_overflow_label);
-}
-
-void TurboAssembler::CallRuntimeDelayed(Zone* zone, Runtime::FunctionId fid,
-                                        SaveFPRegsMode save_doubles,
-                                        BranchDelaySlot bd) {
-  const Runtime::Function* f = Runtime::FunctionForId(fid);
-  // TODO(1236192): Most runtime routines don't need the number of
-  // arguments passed in because it is constant. At some point we
-  // should remove this need and make the runtime routine entry code
-  // smarter.
-  PrepareCEntryArgs(f->nargs);
-  PrepareCEntryFunction(ExternalReference(f, isolate()));
-  CallStubDelayed(new (zone) CEntryStub(nullptr, 1, save_doubles));
-}
-
-void MacroAssembler::CallRuntime(const Runtime::Function* f, int num_arguments,
-                                 SaveFPRegsMode save_doubles,
-                                 BranchDelaySlot bd) {
-  // All parameters are on the stack. v0 has the return value after call.
-
-  // If the expected number of arguments of the runtime function is
-  // constant, we check that the actual number of arguments match the
-  // expectation.
-  CHECK(f->nargs < 0 || f->nargs == num_arguments);
-
-  // TODO(1236192): Most runtime routines don't need the number of
-  // arguments passed in because it is constant. At some point we
-  // should remove this need and make the runtime routine entry code
-  // smarter.
-  PrepareCEntryArgs(num_arguments);
-  PrepareCEntryFunction(ExternalReference(f, isolate()));
-  CEntryStub stub(isolate(), 1, save_doubles);
-  CallStub(&stub, al, zero_reg, Operand(zero_reg), bd);
-}
-
-void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid) {
-  const Runtime::Function* function = Runtime::FunctionForId(fid);
-  DCHECK_EQ(1, function->result_size);
-  if (function->nargs >= 0) {
-    PrepareCEntryArgs(function->nargs);
-  }
-  JumpToExternalReference(ExternalReference(fid, isolate()));
-}
-
-void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin,
-                                             BranchDelaySlot bd,
-                                             bool builtin_exit_frame) {
-  PrepareCEntryFunction(builtin);
-  CEntryStub stub(isolate(), 1, kDontSaveFPRegs, kArgvOnStack,
-                  builtin_exit_frame);
-  Jump(stub.GetCode(),
-       RelocInfo::CODE_TARGET,
-       al,
-       zero_reg,
-       Operand(zero_reg),
-       bd);
-}
-
-void MacroAssembler::IncrementCounter(StatsCounter* counter, int value,
-                                      Register scratch1, Register scratch2) {
-  DCHECK_GT(value, 0);
-  if (FLAG_native_code_counters && counter->Enabled()) {
-    li(scratch2, Operand(ExternalReference(counter)));
-    lw(scratch1, MemOperand(scratch2));
-    Addu(scratch1, scratch1, Operand(value));
-    sw(scratch1, MemOperand(scratch2));
-  }
-}
-
-
-void MacroAssembler::DecrementCounter(StatsCounter* counter, int value,
-                                      Register scratch1, Register scratch2) {
-  DCHECK_GT(value, 0);
-  if (FLAG_native_code_counters && counter->Enabled()) {
-    li(scratch2, Operand(ExternalReference(counter)));
-    lw(scratch1, MemOperand(scratch2));
-    Subu(scratch1, scratch1, Operand(value));
-    sw(scratch1, MemOperand(scratch2));
-  }
-}
-
-
-// -----------------------------------------------------------------------------
-// Debugging.
-
-void TurboAssembler::Assert(Condition cc, AbortReason reason, Register rs,
-                            Operand rt) {
-  if (emit_debug_code())
-    Check(cc, reason, rs, rt);
-}
-
-void TurboAssembler::Check(Condition cc, AbortReason reason, Register rs,
-                           Operand rt) {
-  Label L;
-  Branch(&L, cc, rs, rt);
-  Abort(reason);
-  // Will not return here.
-  bind(&L);
-}
-
-void TurboAssembler::Abort(AbortReason reason) {
-  Label abort_start;
-  bind(&abort_start);
-#ifdef DEBUG
-  const char* msg = GetAbortReason(reason);
-  if (msg != nullptr) {
-    RecordComment("Abort message: ");
-    RecordComment(msg);
-  }
-
-  if (FLAG_trap_on_abort) {
-    stop(msg);
-    return;
-  }
-#endif
-
-  Move(a0, Smi::FromInt(static_cast<int>(reason)));
-
-  // Disable stub call restrictions to always allow calls to abort.
-  if (!has_frame_) {
-    // We don't actually want to generate a pile of code for this, so just
-    // claim there is a stack frame, without generating one.
-    FrameScope scope(this, StackFrame::NONE);
-    Call(BUILTIN_CODE(isolate(), Abort), RelocInfo::CODE_TARGET);
-  } else {
-    Call(BUILTIN_CODE(isolate(), Abort), RelocInfo::CODE_TARGET);
-  }
-  // Will not return here.
-  if (is_trampoline_pool_blocked()) {
-    // If the calling code cares about the exact number of
-    // instructions generated, we insert padding here to keep the size
-    // of the Abort macro constant.
-    // Currently in debug mode with debug_code enabled the number of
-    // generated instructions is 10, so we use this as a maximum value.
-    static const int kExpectedAbortInstructions = 10;
-    int abort_instructions = InstructionsGeneratedSince(&abort_start);
-    DCHECK_LE(abort_instructions, kExpectedAbortInstructions);
-    while (abort_instructions++ < kExpectedAbortInstructions) {
-      nop();
-    }
-  }
-}
-
-void MacroAssembler::LoadNativeContextSlot(int index, Register dst) {
-  lw(dst, NativeContextMemOperand());
-  lw(dst, ContextMemOperand(dst, index));
-}
-
-void TurboAssembler::StubPrologue(StackFrame::Type type) {
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  li(scratch, Operand(StackFrame::TypeToMarker(type)));
-  PushCommonFrame(scratch);
-}
-
-void TurboAssembler::Prologue() { PushStandardFrame(a1); }
-
-void TurboAssembler::EnterFrame(StackFrame::Type type) {
-  int stack_offset, fp_offset;
-  if (type == StackFrame::INTERNAL) {
-    stack_offset = -4 * kPointerSize;
-    fp_offset = 2 * kPointerSize;
-  } else {
-    stack_offset = -3 * kPointerSize;
-    fp_offset = 1 * kPointerSize;
-  }
-  addiu(sp, sp, stack_offset);
-  stack_offset = -stack_offset - kPointerSize;
-  sw(ra, MemOperand(sp, stack_offset));
-  stack_offset -= kPointerSize;
-  sw(fp, MemOperand(sp, stack_offset));
-  stack_offset -= kPointerSize;
-  li(t9, Operand(StackFrame::TypeToMarker(type)));
-  sw(t9, MemOperand(sp, stack_offset));
-  if (type == StackFrame::INTERNAL) {
-    DCHECK_EQ(stack_offset, kPointerSize);
-    li(t9, Operand(CodeObject()));
-    sw(t9, MemOperand(sp, 0));
-  } else {
-    DCHECK_EQ(stack_offset, 0);
-  }
-  // Adjust FP to point to saved FP.
-  Addu(fp, sp, Operand(fp_offset));
-}
-
-void TurboAssembler::LeaveFrame(StackFrame::Type type) {
-  addiu(sp, fp, 2 * kPointerSize);
-  lw(ra, MemOperand(fp, 1 * kPointerSize));
-  lw(fp, MemOperand(fp, 0 * kPointerSize));
-}
-
-void MacroAssembler::EnterBuiltinFrame(Register context, Register target,
-                                       Register argc) {
-  Push(ra, fp);
-  Move(fp, sp);
-  Push(context, target, argc);
-}
-
-void MacroAssembler::LeaveBuiltinFrame(Register context, Register target,
-                                       Register argc) {
-  Pop(context, target, argc);
-  Pop(ra, fp);
-}
-
-void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space,
-                                    StackFrame::Type frame_type) {
-  DCHECK(frame_type == StackFrame::EXIT ||
-         frame_type == StackFrame::BUILTIN_EXIT);
-
-  // Set up the frame structure on the stack.
-  STATIC_ASSERT(2 * kPointerSize == ExitFrameConstants::kCallerSPDisplacement);
-  STATIC_ASSERT(1 * kPointerSize == ExitFrameConstants::kCallerPCOffset);
-  STATIC_ASSERT(0 * kPointerSize == ExitFrameConstants::kCallerFPOffset);
-
-  // This is how the stack will look:
-  // fp + 2 (==kCallerSPDisplacement) - old stack's end
-  // [fp + 1 (==kCallerPCOffset)] - saved old ra
-  // [fp + 0 (==kCallerFPOffset)] - saved old fp
-  // [fp - 1 StackFrame::EXIT Smi
-  // [fp - 2 (==kSPOffset)] - sp of the called function
-  // [fp - 3 (==kCodeOffset)] - CodeObject
-  // fp - (2 + stack_space + alignment) == sp == [fp - kSPOffset] - top of the
-  //   new stack (will contain saved ra)
-
-  // Save registers and reserve room for saved entry sp and code object.
-  addiu(sp, sp, -2 * kPointerSize - ExitFrameConstants::kFixedFrameSizeFromFp);
-  sw(ra, MemOperand(sp, 4 * kPointerSize));
-  sw(fp, MemOperand(sp, 3 * kPointerSize));
-  {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    li(scratch, Operand(StackFrame::TypeToMarker(frame_type)));
-    sw(scratch, MemOperand(sp, 2 * kPointerSize));
-  }
-  // Set up new frame pointer.
-  addiu(fp, sp, ExitFrameConstants::kFixedFrameSizeFromFp);
-
-  if (emit_debug_code()) {
-    sw(zero_reg, MemOperand(fp, ExitFrameConstants::kSPOffset));
-  }
-
-  // Accessed from ExitFrame::code_slot.
-  li(t8, Operand(CodeObject()), CONSTANT_SIZE);
-  sw(t8, MemOperand(fp, ExitFrameConstants::kCodeOffset));
-
-  // Save the frame pointer and the context in top.
-  li(t8,
-     Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, isolate())));
-  sw(fp, MemOperand(t8));
-  li(t8,
-     Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate())));
-  sw(cp, MemOperand(t8));
-
-  const int frame_alignment = MacroAssembler::ActivationFrameAlignment();
-  if (save_doubles) {
-    // The stack  must be align to 0 modulo 8 for stores with sdc1.
-    DCHECK_EQ(kDoubleSize, frame_alignment);
-    if (frame_alignment > 0) {
-      DCHECK(base::bits::IsPowerOfTwo(frame_alignment));
-      And(sp, sp, Operand(-frame_alignment));  // Align stack.
-    }
-    int space = FPURegister::kNumRegisters * kDoubleSize;
-    Subu(sp, sp, Operand(space));
-    // Remember: we only need to save every 2nd double FPU value.
-    for (int i = 0; i < FPURegister::kNumRegisters; i += 2) {
-      FPURegister reg = FPURegister::from_code(i);
-      Sdc1(reg, MemOperand(sp, i * kDoubleSize));
-    }
-  }
-
-  // Reserve place for the return address, stack space and an optional slot
-  // (used by the DirectCEntryStub to hold the return value if a struct is
-  // returned) and align the frame preparing for calling the runtime function.
-  DCHECK_GE(stack_space, 0);
-  Subu(sp, sp, Operand((stack_space + 2) * kPointerSize));
-  if (frame_alignment > 0) {
-    DCHECK(base::bits::IsPowerOfTwo(frame_alignment));
-    And(sp, sp, Operand(-frame_alignment));  // Align stack.
-  }
-
-  // Set the exit frame sp value to point just before the return address
-  // location.
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  addiu(scratch, sp, kPointerSize);
-  sw(scratch, MemOperand(fp, ExitFrameConstants::kSPOffset));
-}
-
-void MacroAssembler::LeaveExitFrame(bool save_doubles, Register argument_count,
-                                    bool do_return,
-                                    bool argument_count_is_length) {
-  // Optionally restore all double registers.
-  if (save_doubles) {
-    // Remember: we only need to restore every 2nd double FPU value.
-    lw(t8, MemOperand(fp, ExitFrameConstants::kSPOffset));
-    for (int i = 0; i < FPURegister::kNumRegisters; i += 2) {
-      FPURegister reg = FPURegister::from_code(i);
-      Ldc1(reg, MemOperand(t8, i * kDoubleSize + kPointerSize));
-    }
-  }
-
-  // Clear top frame.
-  li(t8,
-     Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, isolate())));
-  sw(zero_reg, MemOperand(t8));
-
-  // Restore current context from top and clear it in debug mode.
-  li(t8,
-     Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate())));
-  lw(cp, MemOperand(t8));
-
-#ifdef DEBUG
-  li(t8,
-     Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate())));
-  sw(a3, MemOperand(t8));
-#endif
-
-  // Pop the arguments, restore registers, and return.
-  mov(sp, fp);  // Respect ABI stack constraint.
-  lw(fp, MemOperand(sp, ExitFrameConstants::kCallerFPOffset));
-  lw(ra, MemOperand(sp, ExitFrameConstants::kCallerPCOffset));
-
-  if (argument_count.is_valid()) {
-    if (argument_count_is_length) {
-      addu(sp, sp, argument_count);
-    } else {
-      Lsa(sp, sp, argument_count, kPointerSizeLog2, t8);
-    }
-  }
-
-  if (do_return) {
-    Ret(USE_DELAY_SLOT);
-    // If returning, the instruction in the delay slot will be the addiu below.
-  }
-  addiu(sp, sp, 8);
-}
-
-int TurboAssembler::ActivationFrameAlignment() {
-#if V8_HOST_ARCH_MIPS
-  // Running on the real platform. Use the alignment as mandated by the local
-  // environment.
-  // Note: This will break if we ever start generating snapshots on one Mips
-  // platform for another Mips platform with a different alignment.
-  return base::OS::ActivationFrameAlignment();
-#else  // V8_HOST_ARCH_MIPS
-  // If we are using the simulator then we should always align to the expected
-  // alignment. As the simulator is used to generate snapshots we do not know
-  // if the target platform will need alignment, so this is controlled from a
-  // flag.
-  return FLAG_sim_stack_alignment;
-#endif  // V8_HOST_ARCH_MIPS
-}
-
-
-void MacroAssembler::AssertStackIsAligned() {
-  if (emit_debug_code()) {
-      const int frame_alignment = ActivationFrameAlignment();
-      const int frame_alignment_mask = frame_alignment - 1;
-
-      if (frame_alignment > kPointerSize) {
-        Label alignment_as_expected;
-        DCHECK(base::bits::IsPowerOfTwo(frame_alignment));
-        UseScratchRegisterScope temps(this);
-        Register scratch = temps.Acquire();
-        andi(scratch, sp, frame_alignment_mask);
-        Branch(&alignment_as_expected, eq, scratch, Operand(zero_reg));
-        // Don't use Check here, as it will call Runtime_Abort re-entering here.
-        stop("Unexpected stack alignment");
-        bind(&alignment_as_expected);
-      }
-    }
-}
-
-void MacroAssembler::UntagAndJumpIfSmi(Register dst,
-                                       Register src,
-                                       Label* smi_case) {
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  JumpIfSmi(src, smi_case, scratch, USE_DELAY_SLOT);
-  SmiUntag(dst, src);
-}
-
-void TurboAssembler::JumpIfSmi(Register value, Label* smi_label,
-                               Register scratch, BranchDelaySlot bd) {
-  DCHECK_EQ(0, kSmiTag);
-  andi(scratch, value, kSmiTagMask);
-  Branch(bd, smi_label, eq, scratch, Operand(zero_reg));
-}
-
-void MacroAssembler::JumpIfNotSmi(Register value,
-                                  Label* not_smi_label,
-                                  Register scratch,
-                                  BranchDelaySlot bd) {
-  DCHECK_EQ(0, kSmiTag);
-  andi(scratch, value, kSmiTagMask);
-  Branch(bd, not_smi_label, ne, scratch, Operand(zero_reg));
-}
-
-
-void MacroAssembler::JumpIfEitherSmi(Register reg1,
-                                     Register reg2,
-                                     Label* on_either_smi) {
-  STATIC_ASSERT(kSmiTag == 0);
-  DCHECK_EQ(1, kSmiTagMask);
-  // Both Smi tags must be 1 (not Smi).
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  and_(scratch, reg1, reg2);
-  JumpIfSmi(scratch, on_either_smi);
-}
-
-void MacroAssembler::AssertNotSmi(Register object) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    andi(scratch, object, kSmiTagMask);
-    Check(ne, AbortReason::kOperandIsASmi, scratch, Operand(zero_reg));
-  }
-}
-
-
-void MacroAssembler::AssertSmi(Register object) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    andi(scratch, object, kSmiTagMask);
-    Check(eq, AbortReason::kOperandIsASmi, scratch, Operand(zero_reg));
-  }
-}
-
-void MacroAssembler::AssertFixedArray(Register object) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    SmiTst(object, t8);
-    Check(ne, AbortReason::kOperandIsASmiAndNotAFixedArray, t8,
-          Operand(zero_reg));
-    GetObjectType(object, t8, t8);
-    Check(eq, AbortReason::kOperandIsNotAFixedArray, t8,
-          Operand(FIXED_ARRAY_TYPE));
-  }
-}
-
-void MacroAssembler::AssertFunction(Register object) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    SmiTst(object, t8);
-    Check(ne, AbortReason::kOperandIsASmiAndNotAFunction, t8,
-          Operand(zero_reg));
-    GetObjectType(object, t8, t8);
-    Check(eq, AbortReason::kOperandIsNotAFunction, t8,
-          Operand(JS_FUNCTION_TYPE));
-  }
-}
-
-
-void MacroAssembler::AssertBoundFunction(Register object) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    SmiTst(object, t8);
-    Check(ne, AbortReason::kOperandIsASmiAndNotABoundFunction, t8,
-          Operand(zero_reg));
-    GetObjectType(object, t8, t8);
-    Check(eq, AbortReason::kOperandIsNotABoundFunction, t8,
-          Operand(JS_BOUND_FUNCTION_TYPE));
-  }
-}
-
-void MacroAssembler::AssertGeneratorObject(Register object) {
-  if (!emit_debug_code()) return;
-  STATIC_ASSERT(kSmiTag == 0);
-  SmiTst(object, t8);
-  Check(ne, AbortReason::kOperandIsASmiAndNotAGeneratorObject, t8,
-        Operand(zero_reg));
-
-  GetObjectType(object, t8, t8);
-
-  Label done;
-
-  // Check if JSGeneratorObject
-  Branch(&done, eq, t8, Operand(JS_GENERATOR_OBJECT_TYPE));
-
-  // Check if JSAsyncGeneratorObject
-  Branch(&done, eq, t8, Operand(JS_ASYNC_GENERATOR_OBJECT_TYPE));
-
-  Abort(AbortReason::kOperandIsNotAGeneratorObject);
-
-  bind(&done);
-}
-
-void MacroAssembler::AssertUndefinedOrAllocationSite(Register object,
-                                                     Register scratch) {
-  if (emit_debug_code()) {
-    Label done_checking;
-    AssertNotSmi(object);
-    LoadRoot(scratch, Heap::kUndefinedValueRootIndex);
-    Branch(&done_checking, eq, object, Operand(scratch));
-    lw(t8, FieldMemOperand(object, HeapObject::kMapOffset));
-    LoadRoot(scratch, Heap::kAllocationSiteMapRootIndex);
-    Assert(eq, AbortReason::kExpectedUndefinedOrCell, t8, Operand(scratch));
-    bind(&done_checking);
-  }
-}
-
-
-void TurboAssembler::Float32Max(FPURegister dst, FPURegister src1,
-                                FPURegister src2, Label* out_of_line) {
-  if (src1 == src2) {
-    Move_s(dst, src1);
-    return;
-  }
-
-  // Check if one of operands is NaN.
-  BranchF32(nullptr, out_of_line, eq, src1, src2);
-
-  if (IsMipsArchVariant(kMips32r6)) {
-    max_s(dst, src1, src2);
-  } else {
-    Label return_left, return_right, done;
-
-    BranchF32(&return_right, nullptr, lt, src1, src2);
-    BranchF32(&return_left, nullptr, lt, src2, src1);
-
-    // Operands are equal, but check for +/-0.
-    mfc1(t8, src1);
-    Branch(&return_left, eq, t8, Operand(zero_reg));
-    Branch(&return_right);
-
-    bind(&return_right);
-    if (src2 != dst) {
-      Move_s(dst, src2);
-    }
-    Branch(&done);
-
-    bind(&return_left);
-    if (src1 != dst) {
-      Move_s(dst, src1);
-    }
-
-    bind(&done);
-  }
-}
-
-void TurboAssembler::Float32MaxOutOfLine(FPURegister dst, FPURegister src1,
-                                         FPURegister src2) {
-  add_s(dst, src1, src2);
-}
-
-void TurboAssembler::Float32Min(FPURegister dst, FPURegister src1,
-                                FPURegister src2, Label* out_of_line) {
-  if (src1 == src2) {
-    Move_s(dst, src1);
-    return;
-  }
-
-  // Check if one of operands is NaN.
-  BranchF32(nullptr, out_of_line, eq, src1, src2);
-
-  if (IsMipsArchVariant(kMips32r6)) {
-    min_s(dst, src1, src2);
-  } else {
-    Label return_left, return_right, done;
-
-    BranchF32(&return_left, nullptr, lt, src1, src2);
-    BranchF32(&return_right, nullptr, lt, src2, src1);
-
-    // Left equals right => check for -0.
-    mfc1(t8, src1);
-    Branch(&return_right, eq, t8, Operand(zero_reg));
-    Branch(&return_left);
-
-    bind(&return_right);
-    if (src2 != dst) {
-      Move_s(dst, src2);
-    }
-    Branch(&done);
-
-    bind(&return_left);
-    if (src1 != dst) {
-      Move_s(dst, src1);
-    }
-
-    bind(&done);
-  }
-}
-
-void TurboAssembler::Float32MinOutOfLine(FPURegister dst, FPURegister src1,
-                                         FPURegister src2) {
-  add_s(dst, src1, src2);
-}
-
-void TurboAssembler::Float64Max(DoubleRegister dst, DoubleRegister src1,
-                                DoubleRegister src2, Label* out_of_line) {
-  if (src1 == src2) {
-    Move_d(dst, src1);
-    return;
-  }
-
-  // Check if one of operands is NaN.
-  BranchF64(nullptr, out_of_line, eq, src1, src2);
-
-  if (IsMipsArchVariant(kMips32r6)) {
-    max_d(dst, src1, src2);
-  } else {
-    Label return_left, return_right, done;
-
-    BranchF64(&return_right, nullptr, lt, src1, src2);
-    BranchF64(&return_left, nullptr, lt, src2, src1);
-
-    // Left equals right => check for -0.
-    Mfhc1(t8, src1);
-    Branch(&return_left, eq, t8, Operand(zero_reg));
-    Branch(&return_right);
-
-    bind(&return_right);
-    if (src2 != dst) {
-      Move_d(dst, src2);
-    }
-    Branch(&done);
-
-    bind(&return_left);
-    if (src1 != dst) {
-      Move_d(dst, src1);
-    }
-
-    bind(&done);
-  }
-}
-
-void TurboAssembler::Float64MaxOutOfLine(DoubleRegister dst,
-                                         DoubleRegister src1,
-                                         DoubleRegister src2) {
-  add_d(dst, src1, src2);
-}
-
-void TurboAssembler::Float64Min(DoubleRegister dst, DoubleRegister src1,
-                                DoubleRegister src2, Label* out_of_line) {
-  if (src1 == src2) {
-    Move_d(dst, src1);
-    return;
-  }
-
-  // Check if one of operands is NaN.
-  BranchF64(nullptr, out_of_line, eq, src1, src2);
-
-  if (IsMipsArchVariant(kMips32r6)) {
-    min_d(dst, src1, src2);
-  } else {
-    Label return_left, return_right, done;
-
-    BranchF64(&return_left, nullptr, lt, src1, src2);
-    BranchF64(&return_right, nullptr, lt, src2, src1);
-
-    // Left equals right => check for -0.
-    Mfhc1(t8, src1);
-    Branch(&return_right, eq, t8, Operand(zero_reg));
-    Branch(&return_left);
-
-    bind(&return_right);
-    if (src2 != dst) {
-      Move_d(dst, src2);
-    }
-    Branch(&done);
-
-    bind(&return_left);
-    if (src1 != dst) {
-      Move_d(dst, src1);
-    }
-
-    bind(&done);
-  }
-}
-
-void TurboAssembler::Float64MinOutOfLine(DoubleRegister dst,
-                                         DoubleRegister src1,
-                                         DoubleRegister src2) {
-  add_d(dst, src1, src2);
-}
-
-static const int kRegisterPassedArguments = 4;
-
-int TurboAssembler::CalculateStackPassedWords(int num_reg_arguments,
-                                              int num_double_arguments) {
-  int stack_passed_words = 0;
-  num_reg_arguments += 2 * num_double_arguments;
-
-  // Up to four simple arguments are passed in registers a0..a3.
-  if (num_reg_arguments > kRegisterPassedArguments) {
-    stack_passed_words += num_reg_arguments - kRegisterPassedArguments;
-  }
-  stack_passed_words += kCArgSlotCount;
-  return stack_passed_words;
-}
-
-void TurboAssembler::PrepareCallCFunction(int num_reg_arguments,
-                                          int num_double_arguments,
-                                          Register scratch) {
-  int frame_alignment = ActivationFrameAlignment();
-
-  // Up to four simple arguments are passed in registers a0..a3.
-  // Those four arguments must have reserved argument slots on the stack for
-  // mips, even though those argument slots are not normally used.
-  // Remaining arguments are pushed on the stack, above (higher address than)
-  // the argument slots.
-  int stack_passed_arguments = CalculateStackPassedWords(
-      num_reg_arguments, num_double_arguments);
-  if (frame_alignment > kPointerSize) {
-    // Make stack end at alignment and make room for num_arguments - 4 words
-    // and the original value of sp.
-    mov(scratch, sp);
-    Subu(sp, sp, Operand((stack_passed_arguments + 1) * kPointerSize));
-    DCHECK(base::bits::IsPowerOfTwo(frame_alignment));
-    And(sp, sp, Operand(-frame_alignment));
-    sw(scratch, MemOperand(sp, stack_passed_arguments * kPointerSize));
-  } else {
-    Subu(sp, sp, Operand(stack_passed_arguments * kPointerSize));
-  }
-}
-
-void TurboAssembler::PrepareCallCFunction(int num_reg_arguments,
-                                          Register scratch) {
-  PrepareCallCFunction(num_reg_arguments, 0, scratch);
-}
-
-void TurboAssembler::CallCFunction(ExternalReference function,
-                                   int num_reg_arguments,
-                                   int num_double_arguments) {
-  // Linux/MIPS convention demands that register t9 contains
-  // the address of the function being call in case of
-  // Position independent code
-  li(t9, Operand(function));
-  CallCFunctionHelper(t9, 0, num_reg_arguments, num_double_arguments);
-}
-
-void TurboAssembler::CallCFunction(Register function, int num_reg_arguments,
-                                   int num_double_arguments) {
-  CallCFunctionHelper(function, 0, num_reg_arguments, num_double_arguments);
-}
-
-void TurboAssembler::CallCFunction(ExternalReference function,
-                                   int num_arguments) {
-  CallCFunction(function, num_arguments, 0);
-}
-
-void TurboAssembler::CallCFunction(Register function, int num_arguments) {
-  CallCFunction(function, num_arguments, 0);
-}
-
-void TurboAssembler::CallCFunctionHelper(Register function_base,
-                                         int16_t function_offset,
-                                         int num_reg_arguments,
-                                         int num_double_arguments) {
-  DCHECK_LE(num_reg_arguments + num_double_arguments, kMaxCParameters);
-  DCHECK(has_frame());
-  // Make sure that the stack is aligned before calling a C function unless
-  // running in the simulator. The simulator has its own alignment check which
-  // provides more information.
-  // The argument stots are presumed to have been set up by
-  // PrepareCallCFunction. The C function must be called via t9, for mips ABI.
-
-#if V8_HOST_ARCH_MIPS
-  if (emit_debug_code()) {
-    int frame_alignment = base::OS::ActivationFrameAlignment();
-    int frame_alignment_mask = frame_alignment - 1;
-    if (frame_alignment > kPointerSize) {
-      DCHECK(base::bits::IsPowerOfTwo(frame_alignment));
-      Label alignment_as_expected;
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      And(scratch, sp, Operand(frame_alignment_mask));
-      Branch(&alignment_as_expected, eq, scratch, Operand(zero_reg));
-      // Don't use Check here, as it will call Runtime_Abort possibly
-      // re-entering here.
-      stop("Unexpected alignment in CallCFunction");
-      bind(&alignment_as_expected);
-    }
-  }
-#endif  // V8_HOST_ARCH_MIPS
-
-  // Just call directly. The function called cannot cause a GC, or
-  // allow preemption, so the return address in the link register
-  // stays correct.
-
-  if (function_base != t9) {
-    mov(t9, function_base);
-    function_base = t9;
-  }
-
-  if (function_offset != 0) {
-    addiu(t9, t9, function_offset);
-    function_offset = 0;
-  }
-
-  Call(function_base, function_offset);
-
-  int stack_passed_arguments = CalculateStackPassedWords(
-      num_reg_arguments, num_double_arguments);
-
-  if (base::OS::ActivationFrameAlignment() > kPointerSize) {
-    lw(sp, MemOperand(sp, stack_passed_arguments * kPointerSize));
-  } else {
-    Addu(sp, sp, Operand(stack_passed_arguments * kPointerSize));
-  }
-}
-
-
-#undef BRANCH_ARGS_CHECK
-
-void TurboAssembler::CheckPageFlag(Register object, Register scratch, int mask,
-                                   Condition cc, Label* condition_met) {
-  And(scratch, object, Operand(~Page::kPageAlignmentMask));
-  lw(scratch, MemOperand(scratch, MemoryChunk::kFlagsOffset));
-  And(scratch, scratch, Operand(mask));
-  Branch(condition_met, cc, scratch, Operand(zero_reg));
-}
-
-Register GetRegisterThatIsNotOneOf(Register reg1,
-                                   Register reg2,
-                                   Register reg3,
-                                   Register reg4,
-                                   Register reg5,
-                                   Register reg6) {
-  RegList regs = 0;
-  if (reg1.is_valid()) regs |= reg1.bit();
-  if (reg2.is_valid()) regs |= reg2.bit();
-  if (reg3.is_valid()) regs |= reg3.bit();
-  if (reg4.is_valid()) regs |= reg4.bit();
-  if (reg5.is_valid()) regs |= reg5.bit();
-  if (reg6.is_valid()) regs |= reg6.bit();
-
-  const RegisterConfiguration* config = RegisterConfiguration::Default();
-  for (int i = 0; i < config->num_allocatable_general_registers(); ++i) {
-    int code = config->GetAllocatableGeneralCode(i);
-    Register candidate = Register::from_code(code);
-    if (regs & candidate.bit()) continue;
-    return candidate;
-  }
-  UNREACHABLE();
-}
-
-bool AreAliased(Register reg1, Register reg2, Register reg3, Register reg4,
-                Register reg5, Register reg6, Register reg7, Register reg8,
-                Register reg9, Register reg10) {
-  int n_of_valid_regs = reg1.is_valid() + reg2.is_valid() + reg3.is_valid() +
-                        reg4.is_valid() + reg5.is_valid() + reg6.is_valid() +
-                        reg7.is_valid() + reg8.is_valid() + reg9.is_valid() +
-                        reg10.is_valid();
-
-  RegList regs = 0;
-  if (reg1.is_valid()) regs |= reg1.bit();
-  if (reg2.is_valid()) regs |= reg2.bit();
-  if (reg3.is_valid()) regs |= reg3.bit();
-  if (reg4.is_valid()) regs |= reg4.bit();
-  if (reg5.is_valid()) regs |= reg5.bit();
-  if (reg6.is_valid()) regs |= reg6.bit();
-  if (reg7.is_valid()) regs |= reg7.bit();
-  if (reg8.is_valid()) regs |= reg8.bit();
-  if (reg9.is_valid()) regs |= reg9.bit();
-  if (reg10.is_valid()) regs |= reg10.bit();
-  int n_of_non_aliasing_regs = NumRegs(regs);
-
-  return n_of_valid_regs != n_of_non_aliasing_regs;
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_MIPS
diff --git a/src/v8/src/mips/macro-assembler-mips.h b/src/v8/src/mips/macro-assembler-mips.h
deleted file mode 100644
index 8c70eb5..0000000
--- a/src/v8/src/mips/macro-assembler-mips.h
+++ /dev/null
@@ -1,1209 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_MIPS_MACRO_ASSEMBLER_MIPS_H_
-#define V8_MIPS_MACRO_ASSEMBLER_MIPS_H_
-
-#include "src/assembler.h"
-#include "src/globals.h"
-#include "src/mips/assembler-mips.h"
-
-namespace v8 {
-namespace internal {
-
-// Give alias names to registers for calling conventions.
-constexpr Register kReturnRegister0 = v0;
-constexpr Register kReturnRegister1 = v1;
-constexpr Register kReturnRegister2 = a0;
-constexpr Register kJSFunctionRegister = a1;
-constexpr Register kContextRegister = s7;
-constexpr Register kAllocateSizeRegister = a0;
-constexpr Register kInterpreterAccumulatorRegister = v0;
-constexpr Register kInterpreterBytecodeOffsetRegister = t4;
-constexpr Register kInterpreterBytecodeArrayRegister = t5;
-constexpr Register kInterpreterDispatchTableRegister = t6;
-constexpr Register kJavaScriptCallArgCountRegister = a0;
-constexpr Register kJavaScriptCallNewTargetRegister = a3;
-constexpr Register kRuntimeCallFunctionRegister = a1;
-constexpr Register kRuntimeCallArgCountRegister = a0;
-
-// Forward declaration.
-class JumpTarget;
-
-// Reserved Register Usage Summary.
-//
-// Registers t8, t9, and at are reserved for use by the MacroAssembler.
-//
-// The programmer should know that the MacroAssembler may clobber these three,
-// but won't touch other registers except in special cases.
-//
-// Per the MIPS ABI, register t9 must be used for indirect function call
-// via 'jalr t9' or 'jr t9' instructions. This is relied upon by gcc when
-// trying to update gp register for position-independent-code. Whenever
-// MIPS generated code calls C code, it must be via t9 register.
-
-
-// Flags used for LeaveExitFrame function.
-enum LeaveExitFrameMode {
-  EMIT_RETURN = true,
-  NO_EMIT_RETURN = false
-};
-
-// Flags used for AllocateHeapNumber
-enum TaggingMode {
-  // Tag the result.
-  TAG_RESULT,
-  // Don't tag
-  DONT_TAG_RESULT
-};
-
-// Allow programmer to use Branch Delay Slot of Branches, Jumps, Calls.
-enum BranchDelaySlot {
-  USE_DELAY_SLOT,
-  PROTECT
-};
-
-// Flags used for the li macro-assembler function.
-enum LiFlags {
-  // If the constant value can be represented in just 16 bits, then
-  // optimize the li to use a single instruction, rather than lui/ori pair.
-  OPTIMIZE_SIZE = 0,
-  // Always use 2 instructions (lui/ori pair), even if the constant could
-  // be loaded with just one, so that this value is patchable later.
-  CONSTANT_SIZE = 1
-};
-
-
-enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET };
-enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK };
-enum RAStatus { kRAHasNotBeenSaved, kRAHasBeenSaved };
-
-Register GetRegisterThatIsNotOneOf(Register reg1,
-                                   Register reg2 = no_reg,
-                                   Register reg3 = no_reg,
-                                   Register reg4 = no_reg,
-                                   Register reg5 = no_reg,
-                                   Register reg6 = no_reg);
-
-bool AreAliased(Register reg1, Register reg2, Register reg3 = no_reg,
-                Register reg4 = no_reg, Register reg5 = no_reg,
-                Register reg6 = no_reg, Register reg7 = no_reg,
-                Register reg8 = no_reg, Register reg9 = no_reg,
-                Register reg10 = no_reg);
-
-
-// -----------------------------------------------------------------------------
-// Static helper functions.
-
-inline MemOperand ContextMemOperand(Register context, int index) {
-  return MemOperand(context, Context::SlotOffset(index));
-}
-
-
-inline MemOperand NativeContextMemOperand() {
-  return ContextMemOperand(cp, Context::NATIVE_CONTEXT_INDEX);
-}
-
-
-// Generate a MemOperand for loading a field from an object.
-inline MemOperand FieldMemOperand(Register object, int offset) {
-  return MemOperand(object, offset - kHeapObjectTag);
-}
-
-
-// Generate a MemOperand for storing arguments 5..N on the stack
-// when calling CallCFunction().
-inline MemOperand CFunctionArgumentOperand(int index) {
-  DCHECK_GT(index, kCArgSlotCount);
-  // Argument 5 takes the slot just past the four Arg-slots.
-  int offset = (index - 5) * kPointerSize + kCArgsSlotsSize;
-  return MemOperand(sp, offset);
-}
-
-class TurboAssembler : public Assembler {
- public:
-  TurboAssembler(Isolate* isolate, void* buffer, int buffer_size,
-                 CodeObjectRequired create_code_object);
-
-  void set_has_frame(bool value) { has_frame_ = value; }
-  bool has_frame() const { return has_frame_; }
-
-  Isolate* isolate() const { return isolate_; }
-
-  Handle<HeapObject> CodeObject() {
-    DCHECK(!code_object_.is_null());
-    return code_object_;
-  }
-
-  // Activation support.
-  void EnterFrame(StackFrame::Type type);
-  void EnterFrame(StackFrame::Type type, bool load_constant_pool_pointer_reg) {
-    // Out-of-line constant pool not implemented on mips.
-    UNREACHABLE();
-  }
-  void LeaveFrame(StackFrame::Type type);
-
-  // Generates function and stub prologue code.
-  void StubPrologue(StackFrame::Type type);
-  void Prologue();
-
-  void InitializeRootRegister() {
-    ExternalReference roots_array_start =
-        ExternalReference::roots_array_start(isolate());
-    li(kRootRegister, Operand(roots_array_start));
-  }
-
-  // Jump unconditionally to given label.
-  // We NEED a nop in the branch delay slot, as it used by v8, for example in
-  // CodeGenerator::ProcessDeferred().
-  // Currently the branch delay slot is filled by the MacroAssembler.
-  // Use rather b(Label) for code generation.
-  void jmp(Label* L) { Branch(L); }
-
-  // -------------------------------------------------------------------------
-  // Debugging.
-
-  // Calls Abort(msg) if the condition cc is not satisfied.
-  // Use --debug_code to enable.
-  void Assert(Condition cc, AbortReason reason, Register rs, Operand rt);
-
-  // Like Assert(), but always enabled.
-  void Check(Condition cc, AbortReason reason, Register rs, Operand rt);
-
-  // Print a message to stdout and abort execution.
-  void Abort(AbortReason msg);
-
-  inline bool AllowThisStubCall(CodeStub* stub);
-
-  // Arguments macros.
-#define COND_TYPED_ARGS Condition cond, Register r1, const Operand& r2
-#define COND_ARGS cond, r1, r2
-
-  // Cases when relocation is not needed.
-#define DECLARE_NORELOC_PROTOTYPE(Name, target_type) \
-  void Name(target_type target, BranchDelaySlot bd = PROTECT); \
-  inline void Name(BranchDelaySlot bd, target_type target) { \
-    Name(target, bd); \
-  } \
-  void Name(target_type target, \
-            COND_TYPED_ARGS, \
-            BranchDelaySlot bd = PROTECT); \
-  inline void Name(BranchDelaySlot bd, \
-                   target_type target, \
-                   COND_TYPED_ARGS) { \
-    Name(target, COND_ARGS, bd); \
-  }
-
-#define DECLARE_BRANCH_PROTOTYPES(Name)   \
-  DECLARE_NORELOC_PROTOTYPE(Name, Label*) \
-  DECLARE_NORELOC_PROTOTYPE(Name, int32_t)
-
-  DECLARE_BRANCH_PROTOTYPES(Branch)
-  DECLARE_BRANCH_PROTOTYPES(BranchAndLink)
-  DECLARE_BRANCH_PROTOTYPES(BranchShort)
-
-#undef DECLARE_BRANCH_PROTOTYPES
-#undef COND_TYPED_ARGS
-#undef COND_ARGS
-
-  // Wrapper functions for the different cmp/branch types.
-  inline void BranchF32(Label* target, Label* nan, Condition cc,
-                        FPURegister cmp1, FPURegister cmp2,
-                        BranchDelaySlot bd = PROTECT) {
-    BranchFCommon(S, target, nan, cc, cmp1, cmp2, bd);
-  }
-
-  inline void BranchF64(Label* target, Label* nan, Condition cc,
-                        FPURegister cmp1, FPURegister cmp2,
-                        BranchDelaySlot bd = PROTECT) {
-    BranchFCommon(D, target, nan, cc, cmp1, cmp2, bd);
-  }
-
-  // Alternate (inline) version for better readability with USE_DELAY_SLOT.
-  inline void BranchF64(BranchDelaySlot bd, Label* target, Label* nan,
-                        Condition cc, FPURegister cmp1, FPURegister cmp2) {
-    BranchF64(target, nan, cc, cmp1, cmp2, bd);
-  }
-
-  inline void BranchF32(BranchDelaySlot bd, Label* target, Label* nan,
-                        Condition cc, FPURegister cmp1, FPURegister cmp2) {
-    BranchF32(target, nan, cc, cmp1, cmp2, bd);
-  }
-
-  void BranchMSA(Label* target, MSABranchDF df, MSABranchCondition cond,
-                 MSARegister wt, BranchDelaySlot bd = PROTECT);
-
-  void Branch(Label* L, Condition cond, Register rs, Heap::RootListIndex index,
-              BranchDelaySlot bdslot = PROTECT);
-
-  // Load int32 in the rd register.
-  void li(Register rd, Operand j, LiFlags mode = OPTIMIZE_SIZE);
-  inline void li(Register rd, int32_t j, LiFlags mode = OPTIMIZE_SIZE) {
-    li(rd, Operand(j), mode);
-  }
-  void li(Register dst, Handle<HeapObject> value, LiFlags mode = OPTIMIZE_SIZE);
-
-  // Jump, Call, and Ret pseudo instructions implementing inter-working.
-#define COND_ARGS Condition cond = al, Register rs = zero_reg, \
-  const Operand& rt = Operand(zero_reg), BranchDelaySlot bd = PROTECT
-
-  void Jump(Register target, int16_t offset = 0, COND_ARGS);
-  void Jump(Register target, Register base, int16_t offset = 0, COND_ARGS);
-  void Jump(Register target, const Operand& offset, COND_ARGS);
-  void Jump(intptr_t target, RelocInfo::Mode rmode, COND_ARGS);
-  void Jump(Address target, RelocInfo::Mode rmode, COND_ARGS);
-  void Jump(Handle<Code> code, RelocInfo::Mode rmode, COND_ARGS);
-  static int CallSize(Register target, int16_t offset = 0, COND_ARGS);
-  void Call(Register target, int16_t offset = 0, COND_ARGS);
-  void Call(Register target, Register base, int16_t offset = 0, COND_ARGS);
-  static int CallSize(Address target, RelocInfo::Mode rmode, COND_ARGS);
-  void Call(Address target, RelocInfo::Mode rmode, COND_ARGS);
-  int CallSize(Handle<Code> code,
-               RelocInfo::Mode rmode = RelocInfo::CODE_TARGET,
-               COND_ARGS);
-  void Call(Handle<Code> code,
-            RelocInfo::Mode rmode = RelocInfo::CODE_TARGET,
-            COND_ARGS);
-  void Call(Label* target);
-
-  void CallForDeoptimization(Address target, RelocInfo::Mode rmode) {
-    Call(target, rmode);
-  }
-
-  void Ret(COND_ARGS);
-  inline void Ret(BranchDelaySlot bd, Condition cond = al,
-    Register rs = zero_reg, const Operand& rt = Operand(zero_reg)) {
-    Ret(cond, rs, rt, bd);
-  }
-
-  // Emit code to discard a non-negative number of pointer-sized elements
-  // from the stack, clobbering only the sp register.
-  void Drop(int count,
-            Condition cond = cc_always,
-            Register reg = no_reg,
-            const Operand& op = Operand(no_reg));
-
-  // Trivial case of DropAndRet that utilizes the delay slot and only emits
-  // 2 instructions.
-  void DropAndRet(int drop);
-
-  void DropAndRet(int drop,
-                  Condition cond,
-                  Register reg,
-                  const Operand& op);
-
-  void push(Register src) {
-    Addu(sp, sp, Operand(-kPointerSize));
-    sw(src, MemOperand(sp, 0));
-  }
-
-  void Push(Register src) { push(src); }
-  void Push(Handle<HeapObject> handle);
-  void Push(Smi* smi);
-
-  // Push two registers. Pushes leftmost register first (to highest address).
-  void Push(Register src1, Register src2) {
-    Subu(sp, sp, Operand(2 * kPointerSize));
-    sw(src1, MemOperand(sp, 1 * kPointerSize));
-    sw(src2, MemOperand(sp, 0 * kPointerSize));
-  }
-
-  // Push three registers. Pushes leftmost register first (to highest address).
-  void Push(Register src1, Register src2, Register src3) {
-    Subu(sp, sp, Operand(3 * kPointerSize));
-    sw(src1, MemOperand(sp, 2 * kPointerSize));
-    sw(src2, MemOperand(sp, 1 * kPointerSize));
-    sw(src3, MemOperand(sp, 0 * kPointerSize));
-  }
-
-  // Push four registers. Pushes leftmost register first (to highest address).
-  void Push(Register src1, Register src2, Register src3, Register src4) {
-    Subu(sp, sp, Operand(4 * kPointerSize));
-    sw(src1, MemOperand(sp, 3 * kPointerSize));
-    sw(src2, MemOperand(sp, 2 * kPointerSize));
-    sw(src3, MemOperand(sp, 1 * kPointerSize));
-    sw(src4, MemOperand(sp, 0 * kPointerSize));
-  }
-
-  // Push five registers. Pushes leftmost register first (to highest address).
-  void Push(Register src1, Register src2, Register src3, Register src4,
-            Register src5) {
-    Subu(sp, sp, Operand(5 * kPointerSize));
-    sw(src1, MemOperand(sp, 4 * kPointerSize));
-    sw(src2, MemOperand(sp, 3 * kPointerSize));
-    sw(src3, MemOperand(sp, 2 * kPointerSize));
-    sw(src4, MemOperand(sp, 1 * kPointerSize));
-    sw(src5, MemOperand(sp, 0 * kPointerSize));
-  }
-
-  void Push(Register src, Condition cond, Register tst1, Register tst2) {
-    // Since we don't have conditional execution we use a Branch.
-    Branch(3, cond, tst1, Operand(tst2));
-    Subu(sp, sp, Operand(kPointerSize));
-    sw(src, MemOperand(sp, 0));
-  }
-
-  void SaveRegisters(RegList registers);
-  void RestoreRegisters(RegList registers);
-
-  void CallRecordWriteStub(Register object, Register address,
-                           RememberedSetAction remembered_set_action,
-                           SaveFPRegsMode fp_mode);
-
-  // Push multiple registers on the stack.
-  // Registers are saved in numerical order, with higher numbered registers
-  // saved in higher memory addresses.
-  void MultiPush(RegList regs);
-  void MultiPushFPU(RegList regs);
-
-  // Calculate how much stack space (in bytes) are required to store caller
-  // registers excluding those specified in the arguments.
-  int RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode,
-                                      Register exclusion1 = no_reg,
-                                      Register exclusion2 = no_reg,
-                                      Register exclusion3 = no_reg) const;
-
-  // Push caller saved registers on the stack, and return the number of bytes
-  // stack pointer is adjusted.
-  int PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1 = no_reg,
-                      Register exclusion2 = no_reg,
-                      Register exclusion3 = no_reg);
-  // Restore caller saved registers from the stack, and return the number of
-  // bytes stack pointer is adjusted.
-  int PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1 = no_reg,
-                     Register exclusion2 = no_reg,
-                     Register exclusion3 = no_reg);
-
-  void pop(Register dst) {
-    lw(dst, MemOperand(sp, 0));
-    Addu(sp, sp, Operand(kPointerSize));
-  }
-
-  void Pop(Register dst) { pop(dst); }
-
-  // Pop two registers. Pops rightmost register first (from lower address).
-  void Pop(Register src1, Register src2) {
-    DCHECK(src1 != src2);
-    lw(src2, MemOperand(sp, 0 * kPointerSize));
-    lw(src1, MemOperand(sp, 1 * kPointerSize));
-    Addu(sp, sp, 2 * kPointerSize);
-  }
-
-  // Pop three registers. Pops rightmost register first (from lower address).
-  void Pop(Register src1, Register src2, Register src3) {
-    lw(src3, MemOperand(sp, 0 * kPointerSize));
-    lw(src2, MemOperand(sp, 1 * kPointerSize));
-    lw(src1, MemOperand(sp, 2 * kPointerSize));
-    Addu(sp, sp, 3 * kPointerSize);
-  }
-
-  void Pop(uint32_t count = 1) { Addu(sp, sp, Operand(count * kPointerSize)); }
-
-  // Pops multiple values from the stack and load them in the
-  // registers specified in regs. Pop order is the opposite as in MultiPush.
-  void MultiPop(RegList regs);
-  void MultiPopFPU(RegList regs);
-
-  // Load Scaled Address instructions. Parameter sa (shift argument) must be
-  // between [1, 31] (inclusive). On pre-r6 architectures the scratch register
-  // may be clobbered.
-  void Lsa(Register rd, Register rs, Register rt, uint8_t sa,
-           Register scratch = at);
-
-#define DEFINE_INSTRUCTION(instr)                          \
-  void instr(Register rd, Register rs, const Operand& rt); \
-  void instr(Register rd, Register rs, Register rt) {      \
-    instr(rd, rs, Operand(rt));                            \
-  }                                                        \
-  void instr(Register rs, Register rt, int32_t j) { instr(rs, rt, Operand(j)); }
-
-#define DEFINE_INSTRUCTION2(instr)                                 \
-  void instr(Register rs, const Operand& rt);                      \
-  void instr(Register rs, Register rt) { instr(rs, Operand(rt)); } \
-  void instr(Register rs, int32_t j) { instr(rs, Operand(j)); }
-
-#define DEFINE_INSTRUCTION3(instr)                                             \
-  void instr(Register rd_hi, Register rd_lo, Register rs, const Operand& rt);  \
-  void instr(Register rd_hi, Register rd_lo, Register rs, Register rt) {       \
-    instr(rd_hi, rd_lo, rs, Operand(rt));                                      \
-  }                                                                            \
-  void instr(Register rd_hi, Register rd_lo, Register rs, int32_t j) {         \
-    instr(rd_hi, rd_lo, rs, Operand(j));                                       \
-  }
-
-  DEFINE_INSTRUCTION(Addu);
-  DEFINE_INSTRUCTION(Subu);
-  DEFINE_INSTRUCTION(Mul);
-  DEFINE_INSTRUCTION(Div);
-  DEFINE_INSTRUCTION(Divu);
-  DEFINE_INSTRUCTION(Mod);
-  DEFINE_INSTRUCTION(Modu);
-  DEFINE_INSTRUCTION(Mulh);
-  DEFINE_INSTRUCTION2(Mult);
-  DEFINE_INSTRUCTION(Mulhu);
-  DEFINE_INSTRUCTION2(Multu);
-  DEFINE_INSTRUCTION2(Div);
-  DEFINE_INSTRUCTION2(Divu);
-
-  DEFINE_INSTRUCTION3(Div);
-  DEFINE_INSTRUCTION3(Mul);
-  DEFINE_INSTRUCTION3(Mulu);
-
-  DEFINE_INSTRUCTION(And);
-  DEFINE_INSTRUCTION(Or);
-  DEFINE_INSTRUCTION(Xor);
-  DEFINE_INSTRUCTION(Nor);
-  DEFINE_INSTRUCTION2(Neg);
-
-  DEFINE_INSTRUCTION(Slt);
-  DEFINE_INSTRUCTION(Sltu);
-
-  // MIPS32 R2 instruction macro.
-  DEFINE_INSTRUCTION(Ror);
-
-#undef DEFINE_INSTRUCTION
-#undef DEFINE_INSTRUCTION2
-#undef DEFINE_INSTRUCTION3
-
-  void SmiUntag(Register reg) { sra(reg, reg, kSmiTagSize); }
-
-  void SmiUntag(Register dst, Register src) { sra(dst, src, kSmiTagSize); }
-
-  // Removes current frame and its arguments from the stack preserving
-  // the arguments and a return address pushed to the stack for the next call.
-  // Both |callee_args_count| and |caller_args_count_reg| do not include
-  // receiver. |callee_args_count| is not modified, |caller_args_count_reg|
-  // is trashed.
-  void PrepareForTailCall(const ParameterCount& callee_args_count,
-                          Register caller_args_count_reg, Register scratch0,
-                          Register scratch1);
-
-  int CalculateStackPassedWords(int num_reg_arguments,
-                                int num_double_arguments);
-
-  // Before calling a C-function from generated code, align arguments on stack
-  // and add space for the four mips argument slots.
-  // After aligning the frame, non-register arguments must be stored on the
-  // stack, after the argument-slots using helper: CFunctionArgumentOperand().
-  // The argument count assumes all arguments are word sized.
-  // Some compilers/platforms require the stack to be aligned when calling
-  // C++ code.
-  // Needs a scratch register to do some arithmetic. This register will be
-  // trashed.
-  void PrepareCallCFunction(int num_reg_arguments, int num_double_registers,
-                            Register scratch);
-  void PrepareCallCFunction(int num_reg_arguments, Register scratch);
-
-  // Arguments 1-4 are placed in registers a0 through a3 respectively.
-  // Arguments 5..n are stored to stack using following:
-  //  sw(t0, CFunctionArgumentOperand(5));
-
-  // Calls a C function and cleans up the space for arguments allocated
-  // by PrepareCallCFunction. The called function is not allowed to trigger a
-  // garbage collection, since that might move the code and invalidate the
-  // return address (unless this is somehow accounted for by the called
-  // function).
-  void CallCFunction(ExternalReference function, int num_arguments);
-  void CallCFunction(Register function, int num_arguments);
-  void CallCFunction(ExternalReference function, int num_reg_arguments,
-                     int num_double_arguments);
-  void CallCFunction(Register function, int num_reg_arguments,
-                     int num_double_arguments);
-  void MovFromFloatResult(DoubleRegister dst);
-  void MovFromFloatParameter(DoubleRegister dst);
-
-  // There are two ways of passing double arguments on MIPS, depending on
-  // whether soft or hard floating point ABI is used. These functions
-  // abstract parameter passing for the three different ways we call
-  // C functions from generated code.
-  void MovToFloatParameter(DoubleRegister src);
-  void MovToFloatParameters(DoubleRegister src1, DoubleRegister src2);
-  void MovToFloatResult(DoubleRegister src);
-
-  // See comments at the beginning of CEntryStub::Generate.
-  inline void PrepareCEntryArgs(int num_args) { li(a0, num_args); }
-  inline void PrepareCEntryFunction(const ExternalReference& ref) {
-    li(a1, Operand(ref));
-  }
-
-  void CheckPageFlag(Register object, Register scratch, int mask, Condition cc,
-                     Label* condition_met);
-
-  void CallStubDelayed(CodeStub* stub, COND_ARGS);
-#undef COND_ARGS
-
-  void CallRuntimeDelayed(Zone* zone, Runtime::FunctionId fid,
-                          SaveFPRegsMode save_doubles = kDontSaveFPRegs,
-                          BranchDelaySlot bd = PROTECT);
-
-  // Performs a truncating conversion of a floating point number as used by
-  // the JS bitwise operations. See ECMA-262 9.5: ToInt32. Goes to 'done' if it
-  // succeeds, otherwise falls through if result is saturated. On return
-  // 'result' either holds answer, or is clobbered on fall through.
-  //
-  // Only public for the test code in test-code-stubs-arm.cc.
-  void TryInlineTruncateDoubleToI(Register result, DoubleRegister input,
-                                  Label* done);
-
-  // Performs a truncating conversion of a floating point number as used by
-  // the JS bitwise operations. See ECMA-262 9.5: ToInt32.
-  // Exits with 'result' holding the answer.
-  void TruncateDoubleToIDelayed(Zone* zone, Register result,
-                                DoubleRegister double_input);
-
-  // Conditional move.
-  void Movz(Register rd, Register rs, Register rt);
-  void Movn(Register rd, Register rs, Register rt);
-  void Movt(Register rd, Register rs, uint16_t cc = 0);
-  void Movf(Register rd, Register rs, uint16_t cc = 0);
-
-  void Clz(Register rd, Register rs);
-
-  // Int64Lowering instructions
-  void AddPair(Register dst_low, Register dst_high, Register left_low,
-               Register left_high, Register right_low, Register right_high);
-
-  void SubPair(Register dst_low, Register dst_high, Register left_low,
-               Register left_high, Register right_low, Register right_high);
-
-  void ShlPair(Register dst_low, Register dst_high, Register src_low,
-               Register src_high, Register shift);
-
-  void ShlPair(Register dst_low, Register dst_high, Register src_low,
-               Register src_high, uint32_t shift);
-
-  void ShrPair(Register dst_low, Register dst_high, Register src_low,
-               Register src_high, Register shift);
-
-  void ShrPair(Register dst_low, Register dst_high, Register src_low,
-               Register src_high, uint32_t shift);
-
-  void SarPair(Register dst_low, Register dst_high, Register src_low,
-               Register src_high, Register shift);
-
-  void SarPair(Register dst_low, Register dst_high, Register src_low,
-               Register src_high, uint32_t shift);
-
-  // MIPS32 R2 instruction macro.
-  void Ins(Register rt, Register rs, uint16_t pos, uint16_t size);
-  void Ext(Register rt, Register rs, uint16_t pos, uint16_t size);
-  void ExtractBits(Register dest, Register source, Register pos, int size,
-                   bool sign_extend = false);
-  void InsertBits(Register dest, Register source, Register pos, int size);
-
-  void Seb(Register rd, Register rt);
-  void Seh(Register rd, Register rt);
-  void Neg_s(FPURegister fd, FPURegister fs);
-  void Neg_d(FPURegister fd, FPURegister fs);
-
-  // MIPS32 R6 instruction macros.
-  void Bovc(Register rt, Register rs, Label* L);
-  void Bnvc(Register rt, Register rs, Label* L);
-
-  // Convert single to unsigned word.
-  void Trunc_uw_s(FPURegister fd, FPURegister fs, FPURegister scratch);
-  void Trunc_uw_s(FPURegister fd, Register rs, FPURegister scratch);
-
-  void Trunc_w_d(FPURegister fd, FPURegister fs);
-  void Round_w_d(FPURegister fd, FPURegister fs);
-  void Floor_w_d(FPURegister fd, FPURegister fs);
-  void Ceil_w_d(FPURegister fd, FPURegister fs);
-
-  // FP32 mode: Move the general purpose register into
-  // the high part of the double-register pair.
-  // FP64 mode: Move the general-purpose register into
-  // the higher 32 bits of the 64-bit coprocessor register,
-  // while leaving the low bits unchanged.
-  void Mthc1(Register rt, FPURegister fs);
-
-  // FP32 mode: move the high part of the double-register pair into
-  // general purpose register.
-  // FP64 mode: Move the higher 32 bits of the 64-bit coprocessor register into
-  // general-purpose register.
-  void Mfhc1(Register rt, FPURegister fs);
-
-  void Madd_s(FPURegister fd, FPURegister fr, FPURegister fs, FPURegister ft,
-              FPURegister scratch);
-  void Madd_d(FPURegister fd, FPURegister fr, FPURegister fs, FPURegister ft,
-              FPURegister scratch);
-  void Msub_s(FPURegister fd, FPURegister fr, FPURegister fs, FPURegister ft,
-              FPURegister scratch);
-  void Msub_d(FPURegister fd, FPURegister fr, FPURegister fs, FPURegister ft,
-              FPURegister scratch);
-
-  // Change endianness
-  void ByteSwapSigned(Register dest, Register src, int operand_size);
-  void ByteSwapUnsigned(Register dest, Register src, int operand_size);
-
-  void Ulh(Register rd, const MemOperand& rs);
-  void Ulhu(Register rd, const MemOperand& rs);
-  void Ush(Register rd, const MemOperand& rs, Register scratch);
-
-  void Ulw(Register rd, const MemOperand& rs);
-  void Usw(Register rd, const MemOperand& rs);
-
-  void Ulwc1(FPURegister fd, const MemOperand& rs, Register scratch);
-  void Uswc1(FPURegister fd, const MemOperand& rs, Register scratch);
-
-  void Uldc1(FPURegister fd, const MemOperand& rs, Register scratch);
-  void Usdc1(FPURegister fd, const MemOperand& rs, Register scratch);
-
-  void Ldc1(FPURegister fd, const MemOperand& src);
-  void Sdc1(FPURegister fs, const MemOperand& dst);
-
-  void Ll(Register rd, const MemOperand& rs);
-  void Sc(Register rd, const MemOperand& rs);
-
-  // Perform a floating-point min or max operation with the
-  // (IEEE-754-compatible) semantics of MIPS32's Release 6 MIN.fmt/MAX.fmt.
-  // Some cases, typically NaNs or +/-0.0, are expected to be rare and are
-  // handled in out-of-line code. The specific behaviour depends on supported
-  // instructions.
-  //
-  // These functions assume (and assert) that src1!=src2. It is permitted
-  // for the result to alias either input register.
-  void Float32Max(FPURegister dst, FPURegister src1, FPURegister src2,
-                  Label* out_of_line);
-  void Float32Min(FPURegister dst, FPURegister src1, FPURegister src2,
-                  Label* out_of_line);
-  void Float64Max(DoubleRegister dst, DoubleRegister src1, DoubleRegister src2,
-                  Label* out_of_line);
-  void Float64Min(DoubleRegister dst, DoubleRegister src1, DoubleRegister src2,
-                  Label* out_of_line);
-
-  // Generate out-of-line cases for the macros above.
-  void Float32MaxOutOfLine(FPURegister dst, FPURegister src1, FPURegister src2);
-  void Float32MinOutOfLine(FPURegister dst, FPURegister src1, FPURegister src2);
-  void Float64MaxOutOfLine(DoubleRegister dst, DoubleRegister src1,
-                           DoubleRegister src2);
-  void Float64MinOutOfLine(DoubleRegister dst, DoubleRegister src1,
-                           DoubleRegister src2);
-
-  bool IsDoubleZeroRegSet() { return has_double_zero_reg_set_; }
-
-  void mov(Register rd, Register rt) { or_(rd, rt, zero_reg); }
-
-  inline void Move(Register dst, Handle<HeapObject> handle) { li(dst, handle); }
-  inline void Move(Register dst, Smi* smi) { li(dst, Operand(smi)); }
-
-  inline void Move(Register dst, Register src) {
-    if (dst != src) {
-      mov(dst, src);
-    }
-  }
-
-  inline void Move_d(FPURegister dst, FPURegister src) {
-    if (dst != src) {
-      mov_d(dst, src);
-    }
-  }
-
-  inline void Move_s(FPURegister dst, FPURegister src) {
-    if (dst != src) {
-      mov_s(dst, src);
-    }
-  }
-
-  inline void Move(FPURegister dst, FPURegister src) { Move_d(dst, src); }
-
-  inline void Move(Register dst_low, Register dst_high, FPURegister src) {
-    mfc1(dst_low, src);
-    Mfhc1(dst_high, src);
-  }
-
-  inline void FmoveHigh(Register dst_high, FPURegister src) {
-    Mfhc1(dst_high, src);
-  }
-
-  inline void FmoveHigh(FPURegister dst, Register src_high) {
-    Mthc1(src_high, dst);
-  }
-
-  inline void FmoveLow(Register dst_low, FPURegister src) {
-    mfc1(dst_low, src);
-  }
-
-  void FmoveLow(FPURegister dst, Register src_low);
-
-  inline void Move(FPURegister dst, Register src_low, Register src_high) {
-    mtc1(src_low, dst);
-    Mthc1(src_high, dst);
-  }
-
-  void Move(FPURegister dst, float imm);
-  void Move(FPURegister dst, double imm);
-
-  // -------------------------------------------------------------------------
-  // Overflow handling functions.
-  // Usage: first call the appropriate arithmetic function, then call one of the
-  // jump functions with the overflow_dst register as the second parameter.
-
-  inline void AddBranchOvf(Register dst, Register left, const Operand& right,
-                           Label* overflow_label, Register scratch = at) {
-    AddBranchOvf(dst, left, right, overflow_label, nullptr, scratch);
-  }
-
-  inline void AddBranchNoOvf(Register dst, Register left, const Operand& right,
-                             Label* no_overflow_label, Register scratch = at) {
-    AddBranchOvf(dst, left, right, nullptr, no_overflow_label, scratch);
-  }
-
-  void AddBranchOvf(Register dst, Register left, const Operand& right,
-                    Label* overflow_label, Label* no_overflow_label,
-                    Register scratch = at);
-
-  void AddBranchOvf(Register dst, Register left, Register right,
-                    Label* overflow_label, Label* no_overflow_label,
-                    Register scratch = at);
-
-  inline void SubBranchOvf(Register dst, Register left, const Operand& right,
-                           Label* overflow_label, Register scratch = at) {
-    SubBranchOvf(dst, left, right, overflow_label, nullptr, scratch);
-  }
-
-  inline void SubBranchNoOvf(Register dst, Register left, const Operand& right,
-                             Label* no_overflow_label, Register scratch = at) {
-    SubBranchOvf(dst, left, right, nullptr, no_overflow_label, scratch);
-  }
-
-  void SubBranchOvf(Register dst, Register left, const Operand& right,
-                    Label* overflow_label, Label* no_overflow_label,
-                    Register scratch = at);
-
-  void SubBranchOvf(Register dst, Register left, Register right,
-                    Label* overflow_label, Label* no_overflow_label,
-                    Register scratch = at);
-
-  inline void MulBranchOvf(Register dst, Register left, const Operand& right,
-                           Label* overflow_label, Register scratch = at) {
-    MulBranchOvf(dst, left, right, overflow_label, nullptr, scratch);
-  }
-
-  inline void MulBranchNoOvf(Register dst, Register left, const Operand& right,
-                             Label* no_overflow_label, Register scratch = at) {
-    MulBranchOvf(dst, left, right, nullptr, no_overflow_label, scratch);
-  }
-
-  void MulBranchOvf(Register dst, Register left, const Operand& right,
-                    Label* overflow_label, Label* no_overflow_label,
-                    Register scratch = at);
-
-  void MulBranchOvf(Register dst, Register left, Register right,
-                    Label* overflow_label, Label* no_overflow_label,
-                    Register scratch = at);
-
-// Number of instructions needed for calculation of switch table entry address
-#ifdef _MIPS_ARCH_MIPS32R6
-  static constexpr int kSwitchTablePrologueSize = 5;
-#else
-  static constexpr int kSwitchTablePrologueSize = 10;
-#endif
-  // GetLabelFunction must be lambda '[](size_t index) -> Label*' or a
-  // functor/function with 'Label *func(size_t index)' declaration.
-  template <typename Func>
-  void GenerateSwitchTable(Register index, size_t case_count,
-                           Func GetLabelFunction);
-
-  // Load an object from the root table.
-  void LoadRoot(Register destination, Heap::RootListIndex index);
-  void LoadRoot(Register destination, Heap::RootListIndex index, Condition cond,
-                Register src1, const Operand& src2);
-
-  // If the value is a NaN, canonicalize the value else, do nothing.
-  void FPUCanonicalizeNaN(const DoubleRegister dst, const DoubleRegister src);
-
-  // ---------------------------------------------------------------------------
-  // FPU macros. These do not handle special cases like NaN or +- inf.
-
-  // Convert unsigned word to double.
-  void Cvt_d_uw(FPURegister fd, Register rs, FPURegister scratch);
-
-  // Convert double to unsigned word.
-  void Trunc_uw_d(FPURegister fd, FPURegister fs, FPURegister scratch);
-  void Trunc_uw_d(FPURegister fd, Register rs, FPURegister scratch);
-
-  // Jump the register contains a smi.
-  void JumpIfSmi(Register value, Label* smi_label, Register scratch = at,
-                 BranchDelaySlot bd = PROTECT);
-
-  // Push a standard frame, consisting of ra, fp, context and JS function.
-  void PushStandardFrame(Register function_reg);
-
-  // Get the actual activation frame alignment for target environment.
-  static int ActivationFrameAlignment();
-
-  // Alias functions for backward compatibility.
-  inline void BranchF(Label* target, Label* nan, Condition cc, FPURegister cmp1,
-                      FPURegister cmp2, BranchDelaySlot bd = PROTECT) {
-    BranchF64(target, nan, cc, cmp1, cmp2, bd);
-  }
-
-  inline void BranchF(BranchDelaySlot bd, Label* target, Label* nan,
-                      Condition cc, FPURegister cmp1, FPURegister cmp2) {
-    BranchF64(bd, target, nan, cc, cmp1, cmp2);
-  }
-
- protected:
-  void BranchLong(Label* L, BranchDelaySlot bdslot);
-
-  inline Register GetRtAsRegisterHelper(const Operand& rt, Register scratch);
-
-  inline int32_t GetOffset(int32_t offset, Label* L, OffsetSize bits);
-
- private:
-  bool has_frame_ = false;
-  Isolate* const isolate_;
-  // This handle will be patched with the code object on installation.
-  Handle<HeapObject> code_object_;
-  bool has_double_zero_reg_set_;
-
-  void CallCFunctionHelper(Register function_base, int16_t function_offset,
-                           int num_reg_arguments, int num_double_arguments);
-
-  // Common implementation of BranchF functions for the different formats.
-  void BranchFCommon(SecondaryField sizeField, Label* target, Label* nan,
-                     Condition cc, FPURegister cmp1, FPURegister cmp2,
-                     BranchDelaySlot bd = PROTECT);
-
-  void BranchShortF(SecondaryField sizeField, Label* target, Condition cc,
-                    FPURegister cmp1, FPURegister cmp2,
-                    BranchDelaySlot bd = PROTECT);
-
-  void BranchShortMSA(MSABranchDF df, Label* target, MSABranchCondition cond,
-                      MSARegister wt, BranchDelaySlot bd = PROTECT);
-
-  bool CalculateOffset(Label* L, int32_t& offset, OffsetSize bits);
-  bool CalculateOffset(Label* L, int32_t& offset, OffsetSize bits,
-                       Register& scratch, const Operand& rt);
-
-  void BranchShortHelperR6(int32_t offset, Label* L);
-  void BranchShortHelper(int16_t offset, Label* L, BranchDelaySlot bdslot);
-  bool BranchShortHelperR6(int32_t offset, Label* L, Condition cond,
-                           Register rs, const Operand& rt);
-  bool BranchShortHelper(int16_t offset, Label* L, Condition cond, Register rs,
-                         const Operand& rt, BranchDelaySlot bdslot);
-  bool BranchShortCheck(int32_t offset, Label* L, Condition cond, Register rs,
-                        const Operand& rt, BranchDelaySlot bdslot);
-
-  void BranchAndLinkShortHelperR6(int32_t offset, Label* L);
-  void BranchAndLinkShortHelper(int16_t offset, Label* L,
-                                BranchDelaySlot bdslot);
-  void BranchAndLinkShort(int32_t offset, BranchDelaySlot bdslot = PROTECT);
-  void BranchAndLinkShort(Label* L, BranchDelaySlot bdslot = PROTECT);
-  bool BranchAndLinkShortHelperR6(int32_t offset, Label* L, Condition cond,
-                                  Register rs, const Operand& rt);
-  bool BranchAndLinkShortHelper(int16_t offset, Label* L, Condition cond,
-                                Register rs, const Operand& rt,
-                                BranchDelaySlot bdslot);
-  bool BranchAndLinkShortCheck(int32_t offset, Label* L, Condition cond,
-                               Register rs, const Operand& rt,
-                               BranchDelaySlot bdslot);
-  void BranchAndLinkLong(Label* L, BranchDelaySlot bdslot);
-
-  // Push a fixed frame, consisting of ra, fp.
-  void PushCommonFrame(Register marker_reg = no_reg);
-};
-
-// MacroAssembler implements a collection of frequently used macros.
-class MacroAssembler : public TurboAssembler {
- public:
-  MacroAssembler(Isolate* isolate, void* buffer, int size,
-                 CodeObjectRequired create_code_object);
-
-  // Swap two registers.  If the scratch register is omitted then a slightly
-  // less efficient form using xor instead of mov is emitted.
-  void Swap(Register reg1, Register reg2, Register scratch = no_reg);
-
-  void PushRoot(Heap::RootListIndex index) {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    LoadRoot(scratch, index);
-    Push(scratch);
-  }
-
-  // Compare the object in a register to a value and jump if they are equal.
-  void JumpIfRoot(Register with, Heap::RootListIndex index, Label* if_equal) {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    LoadRoot(scratch, index);
-    Branch(if_equal, eq, with, Operand(scratch));
-  }
-
-  // Compare the object in a register to a value and jump if they are not equal.
-  void JumpIfNotRoot(Register with, Heap::RootListIndex index,
-                     Label* if_not_equal) {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    LoadRoot(scratch, index);
-    Branch(if_not_equal, ne, with, Operand(scratch));
-  }
-
-  // ---------------------------------------------------------------------------
-  // GC Support
-
-  // Notify the garbage collector that we wrote a pointer into an object.
-  // |object| is the object being stored into, |value| is the object being
-  // stored.  value and scratch registers are clobbered by the operation.
-  // The offset is the offset from the start of the object, not the offset from
-  // the tagged HeapObject pointer.  For use with FieldOperand(reg, off).
-  void RecordWriteField(
-      Register object, int offset, Register value, Register scratch,
-      RAStatus ra_status, SaveFPRegsMode save_fp,
-      RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
-      SmiCheck smi_check = INLINE_SMI_CHECK);
-
-  // For a given |object| notify the garbage collector that the slot |address|
-  // has been written.  |value| is the object being stored. The value and
-  // address registers are clobbered by the operation.
-  void RecordWrite(
-      Register object, Register address, Register value, RAStatus ra_status,
-      SaveFPRegsMode save_fp,
-      RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
-      SmiCheck smi_check = INLINE_SMI_CHECK);
-
-  void Pref(int32_t hint, const MemOperand& rs);
-
-  // Push and pop the registers that can hold pointers, as defined by the
-  // RegList constant kSafepointSavedRegisters.
-  void PushSafepointRegisters();
-  void PopSafepointRegisters();
-
-  // Truncates a double using a specific rounding mode, and writes the value
-  // to the result register.
-  // The except_flag will contain any exceptions caused by the instruction.
-  // If check_inexact is kDontCheckForInexactConversion, then the inexact
-  // exception is masked.
-  void EmitFPUTruncate(
-      FPURoundingMode rounding_mode, Register result,
-      DoubleRegister double_input, Register scratch,
-      DoubleRegister double_scratch, Register except_flag,
-      CheckForInexactConversion check_inexact = kDontCheckForInexactConversion);
-
-  // Enter exit frame.
-  // argc - argument count to be dropped by LeaveExitFrame.
-  // save_doubles - saves FPU registers on stack, currently disabled.
-  // stack_space - extra stack space.
-  void EnterExitFrame(bool save_doubles, int stack_space = 0,
-                      StackFrame::Type frame_type = StackFrame::EXIT);
-
-  // Leave the current exit frame.
-  void LeaveExitFrame(bool save_doubles, Register arg_count,
-                      bool do_return = NO_EMIT_RETURN,
-                      bool argument_count_is_length = false);
-
-  // Make sure the stack is aligned. Only emits code in debug mode.
-  void AssertStackIsAligned();
-
-  // Load the global proxy from the current context.
-  void LoadGlobalProxy(Register dst) {
-    LoadNativeContextSlot(Context::GLOBAL_PROXY_INDEX, dst);
-  }
-
-  void LoadNativeContextSlot(int index, Register dst);
-
-  // -------------------------------------------------------------------------
-  // JavaScript invokes.
-
-  // Invoke the JavaScript function code by either calling or jumping.
-  void InvokeFunctionCode(Register function, Register new_target,
-                          const ParameterCount& expected,
-                          const ParameterCount& actual, InvokeFlag flag);
-
-  // On function call, call into the debugger if necessary.
-  void CheckDebugHook(Register fun, Register new_target,
-                      const ParameterCount& expected,
-                      const ParameterCount& actual);
-
-  // Invoke the JavaScript function in the given register. Changes the
-  // current context to the context in the function before invoking.
-  void InvokeFunction(Register function, Register new_target,
-                      const ParameterCount& actual, InvokeFlag flag);
-
-  void InvokeFunction(Register function, const ParameterCount& expected,
-                      const ParameterCount& actual, InvokeFlag flag);
-
-  void InvokeFunction(Handle<JSFunction> function,
-                      const ParameterCount& expected,
-                      const ParameterCount& actual, InvokeFlag flag);
-
-  // Frame restart support.
-  void MaybeDropFrames();
-
-  // Exception handling.
-
-  // Push a new stack handler and link into stack handler chain.
-  void PushStackHandler();
-
-  // Unlink the stack handler on top of the stack from the stack handler chain.
-  // Must preserve the result register.
-  void PopStackHandler();
-
-  // -------------------------------------------------------------------------
-  // Support functions.
-
-  void GetObjectType(Register function,
-                     Register map,
-                     Register type_reg);
-
-  // -------------------------------------------------------------------------
-  // Runtime calls.
-
-#define COND_ARGS Condition cond = al, Register rs = zero_reg, \
-const Operand& rt = Operand(zero_reg), BranchDelaySlot bd = PROTECT
-
-  // Call a code stub.
-  void CallStub(CodeStub* stub,
-                COND_ARGS);
-
-  // Tail call a code stub (jump).
-  void TailCallStub(CodeStub* stub, COND_ARGS);
-
-#undef COND_ARGS
-
-  // Call a runtime routine.
-  void CallRuntime(const Runtime::Function* f, int num_arguments,
-                   SaveFPRegsMode save_doubles = kDontSaveFPRegs,
-                   BranchDelaySlot bd = PROTECT);
-
-  // Convenience function: Same as above, but takes the fid instead.
-  void CallRuntime(Runtime::FunctionId fid,
-                   SaveFPRegsMode save_doubles = kDontSaveFPRegs,
-                   BranchDelaySlot bd = PROTECT) {
-    const Runtime::Function* function = Runtime::FunctionForId(fid);
-    CallRuntime(function, function->nargs, save_doubles, bd);
-  }
-
-  // Convenience function: Same as above, but takes the fid instead.
-  void CallRuntime(Runtime::FunctionId id, int num_arguments,
-                   SaveFPRegsMode save_doubles = kDontSaveFPRegs,
-                   BranchDelaySlot bd = PROTECT) {
-    CallRuntime(Runtime::FunctionForId(id), num_arguments, save_doubles, bd);
-  }
-
-  // Convenience function: tail call a runtime routine (jump).
-  void TailCallRuntime(Runtime::FunctionId fid);
-
-  // Jump to the builtin routine.
-  void JumpToExternalReference(const ExternalReference& builtin,
-                               BranchDelaySlot bd = PROTECT,
-                               bool builtin_exit_frame = false);
-
-  // -------------------------------------------------------------------------
-  // StatsCounter support.
-
-  void IncrementCounter(StatsCounter* counter, int value,
-                        Register scratch1, Register scratch2);
-  void DecrementCounter(StatsCounter* counter, int value,
-                        Register scratch1, Register scratch2);
-
-  // -------------------------------------------------------------------------
-  // Smi utilities.
-
-  void SmiTag(Register reg) {
-    Addu(reg, reg, reg);
-  }
-
-  void SmiTag(Register dst, Register src) { Addu(dst, src, src); }
-
-  // Test if the register contains a smi.
-  inline void SmiTst(Register value, Register scratch) {
-    And(scratch, value, Operand(kSmiTagMask));
-  }
-
-  // Untag the source value into destination and jump if source is a smi.
-  // Souce and destination can be the same register.
-  void UntagAndJumpIfSmi(Register dst, Register src, Label* smi_case);
-
-  // Jump if the register contains a non-smi.
-  void JumpIfNotSmi(Register value,
-                    Label* not_smi_label,
-                    Register scratch = at,
-                    BranchDelaySlot bd = PROTECT);
-
-  // Jump if either of the registers contain a smi.
-  void JumpIfEitherSmi(Register reg1, Register reg2, Label* on_either_smi);
-
-  // Abort execution if argument is a smi, enabled via --debug-code.
-  void AssertNotSmi(Register object);
-  void AssertSmi(Register object);
-
-  // Abort execution if argument is not a FixedArray, enabled via --debug-code.
-  void AssertFixedArray(Register object);
-
-  // Abort execution if argument is not a JSFunction, enabled via --debug-code.
-  void AssertFunction(Register object);
-
-  // Abort execution if argument is not a JSBoundFunction,
-  // enabled via --debug-code.
-  void AssertBoundFunction(Register object);
-
-  // Abort execution if argument is not a JSGeneratorObject (or subclass),
-  // enabled via --debug-code.
-  void AssertGeneratorObject(Register object);
-
-  // Abort execution if argument is not undefined or an AllocationSite, enabled
-  // via --debug-code.
-  void AssertUndefinedOrAllocationSite(Register object, Register scratch);
-
-  template<typename Field>
-  void DecodeField(Register dst, Register src) {
-    Ext(dst, src, Field::kShift, Field::kSize);
-  }
-
-  template<typename Field>
-  void DecodeField(Register reg) {
-    DecodeField<Field>(reg, reg);
-  }
-
-  void EnterBuiltinFrame(Register context, Register target, Register argc);
-  void LeaveBuiltinFrame(Register context, Register target, Register argc);
-
-
- private:
-  // Helper functions for generating invokes.
-  void InvokePrologue(const ParameterCount& expected,
-                      const ParameterCount& actual, Label* done,
-                      bool* definitely_mismatches, InvokeFlag flag);
-
-  // Compute memory operands for safepoint stack slots.
-  static int SafepointRegisterStackIndex(int reg_code);
-
-  // Needs access to SafepointRegisterStackIndex for compiled frame
-  // traversal.
-  friend class StandardFrame;
-};
-
-template <typename Func>
-void TurboAssembler::GenerateSwitchTable(Register index, size_t case_count,
-                                         Func GetLabelFunction) {
-  Label here;
-  BlockTrampolinePoolFor(case_count + kSwitchTablePrologueSize);
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  if (kArchVariant >= kMips32r6) {
-    addiupc(scratch, 5);
-    Lsa(scratch, scratch, index, kPointerSizeLog2);
-    lw(scratch, MemOperand(scratch));
-  } else {
-    push(ra);
-    bal(&here);
-    sll(scratch, index, kPointerSizeLog2);  // Branch delay slot.
-    bind(&here);
-    addu(scratch, scratch, ra);
-    pop(ra);
-    lw(scratch, MemOperand(scratch, 6 * v8::internal::Assembler::kInstrSize));
-  }
-  jr(scratch);
-  nop();  // Branch delay slot nop.
-  for (size_t index = 0; index < case_count; ++index) {
-    dd(GetLabelFunction(index));
-  }
-}
-
-#define ACCESS_MASM(masm) masm->
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_
diff --git a/src/v8/src/mips/simulator-mips.cc b/src/v8/src/mips/simulator-mips.cc
deleted file mode 100644
index 4994418..0000000
--- a/src/v8/src/mips/simulator-mips.cc
+++ /dev/null
@@ -1,7134 +0,0 @@
-// Copyright 2011 the V8 project 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 <limits.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <cmath>
-
-#if V8_TARGET_ARCH_MIPS
-
-#include "src/assembler-inl.h"
-#include "src/base/bits.h"
-#include "src/codegen.h"
-#include "src/disasm.h"
-#include "src/macro-assembler.h"
-#include "src/mips/constants-mips.h"
-#include "src/mips/simulator-mips.h"
-#include "src/ostreams.h"
-#include "src/runtime/runtime-utils.h"
-
-
-// Only build the simulator if not compiling for real MIPS hardware.
-#if defined(USE_SIMULATOR)
-
-namespace v8 {
-namespace internal {
-
-// Utils functions.
-bool HaveSameSign(int32_t a, int32_t b) {
-  return ((a ^ b) >= 0);
-}
-
-
-uint32_t get_fcsr_condition_bit(uint32_t cc) {
-  if (cc == 0) {
-    return 23;
-  } else {
-    return 24 + cc;
-  }
-}
-
-
-// This macro provides a platform independent use of sscanf. The reason for
-// SScanF not being implemented in a platform independent was through
-// ::v8::internal::OS in the same way as SNPrintF is that the Windows C Run-Time
-// Library does not provide vsscanf.
-#define SScanF sscanf  // NOLINT
-
-// The MipsDebugger class is used by the simulator while debugging simulated
-// code.
-class MipsDebugger {
- public:
-  explicit MipsDebugger(Simulator* sim) : sim_(sim) { }
-
-  void Stop(Instruction* instr);
-  void Debug();
-  // Print all registers with a nice formatting.
-  void PrintAllRegs();
-  void PrintAllRegsIncludingFPU();
-
- private:
-  // We set the breakpoint code to 0xFFFFF to easily recognize it.
-  static const Instr kBreakpointInstr = SPECIAL | BREAK | 0xFFFFF << 6;
-  static const Instr kNopInstr =  0x0;
-
-  Simulator* sim_;
-
-  int32_t GetRegisterValue(int regnum);
-  int32_t GetFPURegisterValue32(int regnum);
-  int64_t GetFPURegisterValue64(int regnum);
-  float GetFPURegisterValueFloat(int regnum);
-  double GetFPURegisterValueDouble(int regnum);
-  bool GetValue(const char* desc, int32_t* value);
-  bool GetValue(const char* desc, int64_t* value);
-
-  // Set or delete a breakpoint. Returns true if successful.
-  bool SetBreakpoint(Instruction* breakpc);
-  bool DeleteBreakpoint(Instruction* breakpc);
-
-  // Undo and redo all breakpoints. This is needed to bracket disassembly and
-  // execution to skip past breakpoints when run from the debugger.
-  void UndoBreakpoints();
-  void RedoBreakpoints();
-};
-
-
-#define UNSUPPORTED() printf("Sim: Unsupported instruction.\n");
-
-
-void MipsDebugger::Stop(Instruction* instr) {
-  // Get the stop code.
-  uint32_t code = instr->Bits(25, 6);
-  PrintF("Simulator hit (%u)\n", code);
-  Debug();
-}
-
-
-int32_t MipsDebugger::GetRegisterValue(int regnum) {
-  if (regnum == kNumSimuRegisters) {
-    return sim_->get_pc();
-  } else {
-    return sim_->get_register(regnum);
-  }
-}
-
-
-int32_t MipsDebugger::GetFPURegisterValue32(int regnum) {
-  if (regnum == kNumFPURegisters) {
-    return sim_->get_pc();
-  } else {
-    return sim_->get_fpu_register_word(regnum);
-  }
-}
-
-
-int64_t MipsDebugger::GetFPURegisterValue64(int regnum) {
-  if (regnum == kNumFPURegisters) {
-    return sim_->get_pc();
-  } else {
-    return sim_->get_fpu_register(regnum);
-  }
-}
-
-
-float MipsDebugger::GetFPURegisterValueFloat(int regnum) {
-  if (regnum == kNumFPURegisters) {
-    return sim_->get_pc();
-  } else {
-    return sim_->get_fpu_register_float(regnum);
-  }
-}
-
-
-double MipsDebugger::GetFPURegisterValueDouble(int regnum) {
-  if (regnum == kNumFPURegisters) {
-    return sim_->get_pc();
-  } else {
-    return sim_->get_fpu_register_double(regnum);
-  }
-}
-
-
-bool MipsDebugger::GetValue(const char* desc, int32_t* value) {
-  int regnum = Registers::Number(desc);
-  int fpuregnum = FPURegisters::Number(desc);
-
-  if (regnum != kInvalidRegister) {
-    *value = GetRegisterValue(regnum);
-    return true;
-  } else if (fpuregnum != kInvalidFPURegister) {
-    *value = GetFPURegisterValue32(fpuregnum);
-    return true;
-  } else if (strncmp(desc, "0x", 2) == 0) {
-    return SScanF(desc, "%x", reinterpret_cast<uint32_t*>(value)) == 1;
-  } else {
-    return SScanF(desc, "%i", value) == 1;
-  }
-  return false;
-}
-
-
-bool MipsDebugger::GetValue(const char* desc, int64_t* value) {
-  int regnum = Registers::Number(desc);
-  int fpuregnum = FPURegisters::Number(desc);
-
-  if (regnum != kInvalidRegister) {
-    *value = GetRegisterValue(regnum);
-    return true;
-  } else if (fpuregnum != kInvalidFPURegister) {
-    *value = GetFPURegisterValue64(fpuregnum);
-    return true;
-  } else if (strncmp(desc, "0x", 2) == 0) {
-    return SScanF(desc + 2, "%" SCNx64,
-                  reinterpret_cast<uint64_t*>(value)) == 1;
-  } else {
-    return SScanF(desc, "%" SCNu64, reinterpret_cast<uint64_t*>(value)) == 1;
-  }
-  return false;
-}
-
-
-bool MipsDebugger::SetBreakpoint(Instruction* breakpc) {
-  // Check if a breakpoint can be set. If not return without any side-effects.
-  if (sim_->break_pc_ != nullptr) {
-    return false;
-  }
-
-  // Set the breakpoint.
-  sim_->break_pc_ = breakpc;
-  sim_->break_instr_ = breakpc->InstructionBits();
-  // Not setting the breakpoint instruction in the code itself. It will be set
-  // when the debugger shell continues.
-  return true;
-}
-
-
-bool MipsDebugger::DeleteBreakpoint(Instruction* breakpc) {
-  if (sim_->break_pc_ != nullptr) {
-    sim_->break_pc_->SetInstructionBits(sim_->break_instr_);
-  }
-
-  sim_->break_pc_ = nullptr;
-  sim_->break_instr_ = 0;
-  return true;
-}
-
-
-void MipsDebugger::UndoBreakpoints() {
-  if (sim_->break_pc_ != nullptr) {
-    sim_->break_pc_->SetInstructionBits(sim_->break_instr_);
-  }
-}
-
-
-void MipsDebugger::RedoBreakpoints() {
-  if (sim_->break_pc_ != nullptr) {
-    sim_->break_pc_->SetInstructionBits(kBreakpointInstr);
-  }
-}
-
-
-void MipsDebugger::PrintAllRegs() {
-#define REG_INFO(n) Registers::Name(n), GetRegisterValue(n), GetRegisterValue(n)
-
-  PrintF("\n");
-  // at, v0, a0.
-  PrintF("%3s: 0x%08x %10d\t%3s: 0x%08x %10d\t%3s: 0x%08x %10d\n",
-         REG_INFO(1), REG_INFO(2), REG_INFO(4));
-  // v1, a1.
-  PrintF("%26s\t%3s: 0x%08x %10d\t%3s: 0x%08x %10d\n",
-         "", REG_INFO(3), REG_INFO(5));
-  // a2.
-  PrintF("%26s\t%26s\t%3s: 0x%08x %10d\n", "", "", REG_INFO(6));
-  // a3.
-  PrintF("%26s\t%26s\t%3s: 0x%08x %10d\n", "", "", REG_INFO(7));
-  PrintF("\n");
-  // t0-t7, s0-s7
-  for (int i = 0; i < 8; i++) {
-    PrintF("%3s: 0x%08x %10d\t%3s: 0x%08x %10d\n",
-           REG_INFO(8+i), REG_INFO(16+i));
-  }
-  PrintF("\n");
-  // t8, k0, LO.
-  PrintF("%3s: 0x%08x %10d\t%3s: 0x%08x %10d\t%3s: 0x%08x %10d\n",
-         REG_INFO(24), REG_INFO(26), REG_INFO(32));
-  // t9, k1, HI.
-  PrintF("%3s: 0x%08x %10d\t%3s: 0x%08x %10d\t%3s: 0x%08x %10d\n",
-         REG_INFO(25), REG_INFO(27), REG_INFO(33));
-  // sp, fp, gp.
-  PrintF("%3s: 0x%08x %10d\t%3s: 0x%08x %10d\t%3s: 0x%08x %10d\n",
-         REG_INFO(29), REG_INFO(30), REG_INFO(28));
-  // pc.
-  PrintF("%3s: 0x%08x %10d\t%3s: 0x%08x %10d\n",
-         REG_INFO(31), REG_INFO(34));
-
-#undef REG_INFO
-#undef FPU_REG_INFO
-}
-
-
-void MipsDebugger::PrintAllRegsIncludingFPU() {
-#define FPU_REG_INFO32(n) FPURegisters::Name(n), FPURegisters::Name(n+1), \
-        GetFPURegisterValue32(n+1), \
-        GetFPURegisterValue32(n), \
-        GetFPURegisterValueDouble(n)
-
-#define FPU_REG_INFO64(n) FPURegisters::Name(n), \
-        GetFPURegisterValue64(n), \
-        GetFPURegisterValueDouble(n)
-
-  PrintAllRegs();
-
-  PrintF("\n\n");
-  // f0, f1, f2, ... f31.
-  // This must be a compile-time switch,
-  // compiler will throw out warnings otherwise.
-  if (kFpuMode == kFP64) {
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(0) );
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(1) );
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(2) );
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(3) );
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(4) );
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(5) );
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(6) );
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(7) );
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(8) );
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(9) );
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(10));
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(11));
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(12));
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(13));
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(14));
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(15));
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(16));
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(17));
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(18));
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(19));
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(20));
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(21));
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(22));
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(23));
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(24));
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(25));
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(26));
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(27));
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(28));
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(29));
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(30));
-    PrintF("%3s: 0x%016llx %16.4e\n", FPU_REG_INFO64(31));
-  } else {
-    PrintF("%3s,%3s: 0x%08x%08x %16.4e\n", FPU_REG_INFO32(0) );
-    PrintF("%3s,%3s: 0x%08x%08x %16.4e\n", FPU_REG_INFO32(2) );
-    PrintF("%3s,%3s: 0x%08x%08x %16.4e\n", FPU_REG_INFO32(4) );
-    PrintF("%3s,%3s: 0x%08x%08x %16.4e\n", FPU_REG_INFO32(6) );
-    PrintF("%3s,%3s: 0x%08x%08x %16.4e\n", FPU_REG_INFO32(8) );
-    PrintF("%3s,%3s: 0x%08x%08x %16.4e\n", FPU_REG_INFO32(10));
-    PrintF("%3s,%3s: 0x%08x%08x %16.4e\n", FPU_REG_INFO32(12));
-    PrintF("%3s,%3s: 0x%08x%08x %16.4e\n", FPU_REG_INFO32(14));
-    PrintF("%3s,%3s: 0x%08x%08x %16.4e\n", FPU_REG_INFO32(16));
-    PrintF("%3s,%3s: 0x%08x%08x %16.4e\n", FPU_REG_INFO32(18));
-    PrintF("%3s,%3s: 0x%08x%08x %16.4e\n", FPU_REG_INFO32(20));
-    PrintF("%3s,%3s: 0x%08x%08x %16.4e\n", FPU_REG_INFO32(22));
-    PrintF("%3s,%3s: 0x%08x%08x %16.4e\n", FPU_REG_INFO32(24));
-    PrintF("%3s,%3s: 0x%08x%08x %16.4e\n", FPU_REG_INFO32(26));
-    PrintF("%3s,%3s: 0x%08x%08x %16.4e\n", FPU_REG_INFO32(28));
-    PrintF("%3s,%3s: 0x%08x%08x %16.4e\n", FPU_REG_INFO32(30));
-  }
-
-#undef REG_INFO
-#undef FPU_REG_INFO32
-#undef FPU_REG_INFO64
-}
-
-
-void MipsDebugger::Debug() {
-  intptr_t last_pc = -1;
-  bool done = false;
-
-#define COMMAND_SIZE 63
-#define ARG_SIZE 255
-
-#define STR(a) #a
-#define XSTR(a) STR(a)
-
-  char cmd[COMMAND_SIZE + 1];
-  char arg1[ARG_SIZE + 1];
-  char arg2[ARG_SIZE + 1];
-  char* argv[3] = { cmd, arg1, arg2 };
-
-  // Make sure to have a proper terminating character if reaching the limit.
-  cmd[COMMAND_SIZE] = 0;
-  arg1[ARG_SIZE] = 0;
-  arg2[ARG_SIZE] = 0;
-
-  // Undo all set breakpoints while running in the debugger shell. This will
-  // make them invisible to all commands.
-  UndoBreakpoints();
-
-  while (!done && (sim_->get_pc() != Simulator::end_sim_pc)) {
-    if (last_pc != sim_->get_pc()) {
-      disasm::NameConverter converter;
-      disasm::Disassembler dasm(converter);
-      // Use a reasonably large buffer.
-      v8::internal::EmbeddedVector<char, 256> buffer;
-      dasm.InstructionDecode(buffer,
-                             reinterpret_cast<byte*>(sim_->get_pc()));
-      PrintF("  0x%08x  %s\n", sim_->get_pc(), buffer.start());
-      last_pc = sim_->get_pc();
-    }
-    char* line = ReadLine("sim> ");
-    if (line == nullptr) {
-      break;
-    } else {
-      char* last_input = sim_->last_debugger_input();
-      if (strcmp(line, "\n") == 0 && last_input != nullptr) {
-        line = last_input;
-      } else {
-        // Ownership is transferred to sim_;
-        sim_->set_last_debugger_input(line);
-      }
-      // Use sscanf to parse the individual parts of the command line. At the
-      // moment no command expects more than two parameters.
-      int argc = SScanF(line,
-                        "%" XSTR(COMMAND_SIZE) "s "
-                        "%" XSTR(ARG_SIZE) "s "
-                        "%" XSTR(ARG_SIZE) "s",
-                        cmd, arg1, arg2);
-      if ((strcmp(cmd, "si") == 0) || (strcmp(cmd, "stepi") == 0)) {
-        Instruction* instr = reinterpret_cast<Instruction*>(sim_->get_pc());
-        if (!(instr->IsTrap()) ||
-            instr->InstructionBits() == rtCallRedirInstr) {
-          sim_->InstructionDecode(
-              reinterpret_cast<Instruction*>(sim_->get_pc()));
-        } else {
-          // Allow si to jump over generated breakpoints.
-          PrintF("/!\\ Jumping over generated breakpoint.\n");
-          sim_->set_pc(sim_->get_pc() + Instruction::kInstrSize);
-        }
-      } else if ((strcmp(cmd, "c") == 0) || (strcmp(cmd, "cont") == 0)) {
-        // Execute the one instruction we broke at with breakpoints disabled.
-        sim_->InstructionDecode(reinterpret_cast<Instruction*>(sim_->get_pc()));
-        // Leave the debugger shell.
-        done = true;
-      } else if ((strcmp(cmd, "p") == 0) || (strcmp(cmd, "print") == 0)) {
-        if (argc == 2) {
-          if (strcmp(arg1, "all") == 0) {
-            PrintAllRegs();
-          } else if (strcmp(arg1, "allf") == 0) {
-            PrintAllRegsIncludingFPU();
-          } else {
-            int regnum = Registers::Number(arg1);
-            int fpuregnum = FPURegisters::Number(arg1);
-
-            if (regnum != kInvalidRegister) {
-              int32_t value;
-              value = GetRegisterValue(regnum);
-              PrintF("%s: 0x%08x %d \n", arg1, value, value);
-            } else if (fpuregnum != kInvalidFPURegister) {
-              if (IsFp64Mode()) {
-                int64_t value;
-                double dvalue;
-                value = GetFPURegisterValue64(fpuregnum);
-                dvalue = GetFPURegisterValueDouble(fpuregnum);
-                PrintF("%3s: 0x%016llx %16.4e\n",
-                       FPURegisters::Name(fpuregnum), value, dvalue);
-              } else {
-                if (fpuregnum % 2 == 1) {
-                  int32_t value;
-                  float fvalue;
-                  value = GetFPURegisterValue32(fpuregnum);
-                  fvalue = GetFPURegisterValueFloat(fpuregnum);
-                  PrintF("%s: 0x%08x %11.4e\n", arg1, value, fvalue);
-                } else {
-                  double dfvalue;
-                  int32_t lvalue1 = GetFPURegisterValue32(fpuregnum);
-                  int32_t lvalue2 = GetFPURegisterValue32(fpuregnum + 1);
-                  dfvalue = GetFPURegisterValueDouble(fpuregnum);
-                  PrintF("%3s,%3s: 0x%08x%08x %16.4e\n",
-                         FPURegisters::Name(fpuregnum+1),
-                         FPURegisters::Name(fpuregnum),
-                         lvalue1,
-                         lvalue2,
-                         dfvalue);
-                }
-              }
-            } else {
-              PrintF("%s unrecognized\n", arg1);
-            }
-          }
-        } else {
-          if (argc == 3) {
-            if (strcmp(arg2, "single") == 0) {
-              int32_t value;
-              float fvalue;
-              int fpuregnum = FPURegisters::Number(arg1);
-
-              if (fpuregnum != kInvalidFPURegister) {
-                value = GetFPURegisterValue32(fpuregnum);
-                fvalue = GetFPURegisterValueFloat(fpuregnum);
-                PrintF("%s: 0x%08x %11.4e\n", arg1, value, fvalue);
-              } else {
-                PrintF("%s unrecognized\n", arg1);
-              }
-            } else {
-              PrintF("print <fpu register> single\n");
-            }
-          } else {
-            PrintF("print <register> or print <fpu register> single\n");
-          }
-        }
-      } else if ((strcmp(cmd, "po") == 0)
-                 || (strcmp(cmd, "printobject") == 0)) {
-        if (argc == 2) {
-          int32_t value;
-          OFStream os(stdout);
-          if (GetValue(arg1, &value)) {
-            Object* obj = reinterpret_cast<Object*>(value);
-            os << arg1 << ": \n";
-#ifdef DEBUG
-            obj->Print(os);
-            os << "\n";
-#else
-            os << Brief(obj) << "\n";
-#endif
-          } else {
-            os << arg1 << " unrecognized\n";
-          }
-        } else {
-          PrintF("printobject <value>\n");
-        }
-      } else if (strcmp(cmd, "stack") == 0 || strcmp(cmd, "mem") == 0) {
-        int32_t* cur = nullptr;
-        int32_t* end = nullptr;
-        int next_arg = 1;
-
-        if (strcmp(cmd, "stack") == 0) {
-          cur = reinterpret_cast<int32_t*>(sim_->get_register(Simulator::sp));
-        } else {  // Command "mem".
-          int32_t value;
-          if (!GetValue(arg1, &value)) {
-            PrintF("%s unrecognized\n", arg1);
-            continue;
-          }
-          cur = reinterpret_cast<int32_t*>(value);
-          next_arg++;
-        }
-
-        // TODO(palfia): optimize this.
-        if (IsFp64Mode()) {
-          int64_t words;
-          if (argc == next_arg) {
-            words = 10;
-          } else {
-            if (!GetValue(argv[next_arg], &words)) {
-              words = 10;
-            }
-          }
-          end = cur + words;
-        } else {
-          int32_t words;
-          if (argc == next_arg) {
-            words = 10;
-          } else {
-            if (!GetValue(argv[next_arg], &words)) {
-              words = 10;
-            }
-          }
-          end = cur + words;
-        }
-
-        while (cur < end) {
-          PrintF("  0x%08" PRIxPTR ":  0x%08x %10d",
-                 reinterpret_cast<intptr_t>(cur), *cur, *cur);
-          HeapObject* obj = reinterpret_cast<HeapObject*>(*cur);
-          int value = *cur;
-          Heap* current_heap = sim_->isolate_->heap();
-          if (((value & 1) == 0) ||
-              current_heap->ContainsSlow(obj->address())) {
-            PrintF(" (");
-            if ((value & 1) == 0) {
-              PrintF("smi %d", value / 2);
-            } else {
-              obj->ShortPrint();
-            }
-            PrintF(")");
-          }
-          PrintF("\n");
-          cur++;
-        }
-
-      } else if ((strcmp(cmd, "disasm") == 0) ||
-                 (strcmp(cmd, "dpc") == 0) ||
-                 (strcmp(cmd, "di") == 0)) {
-        disasm::NameConverter converter;
-        disasm::Disassembler dasm(converter);
-        // Use a reasonably large buffer.
-        v8::internal::EmbeddedVector<char, 256> buffer;
-
-        byte* cur = nullptr;
-        byte* end = nullptr;
-
-        if (argc == 1) {
-          cur = reinterpret_cast<byte*>(sim_->get_pc());
-          end = cur + (10 * Instruction::kInstrSize);
-        } else if (argc == 2) {
-          int regnum = Registers::Number(arg1);
-          if (regnum != kInvalidRegister || strncmp(arg1, "0x", 2) == 0) {
-            // The argument is an address or a register name.
-            int32_t value;
-            if (GetValue(arg1, &value)) {
-              cur = reinterpret_cast<byte*>(value);
-              // Disassemble 10 instructions at <arg1>.
-              end = cur + (10 * Instruction::kInstrSize);
-            }
-          } else {
-            // The argument is the number of instructions.
-            int32_t value;
-            if (GetValue(arg1, &value)) {
-              cur = reinterpret_cast<byte*>(sim_->get_pc());
-              // Disassemble <arg1> instructions.
-              end = cur + (value * Instruction::kInstrSize);
-            }
-          }
-        } else {
-          int32_t value1;
-          int32_t value2;
-          if (GetValue(arg1, &value1) && GetValue(arg2, &value2)) {
-            cur = reinterpret_cast<byte*>(value1);
-            end = cur + (value2 * Instruction::kInstrSize);
-          }
-        }
-
-        while (cur < end) {
-          dasm.InstructionDecode(buffer, cur);
-          PrintF("  0x%08" PRIxPTR "  %s\n", reinterpret_cast<intptr_t>(cur),
-                 buffer.start());
-          cur += Instruction::kInstrSize;
-        }
-      } else if (strcmp(cmd, "gdb") == 0) {
-        PrintF("relinquishing control to gdb\n");
-        v8::base::OS::DebugBreak();
-        PrintF("regaining control from gdb\n");
-      } else if (strcmp(cmd, "break") == 0) {
-        if (argc == 2) {
-          int32_t value;
-          if (GetValue(arg1, &value)) {
-            if (!SetBreakpoint(reinterpret_cast<Instruction*>(value))) {
-              PrintF("setting breakpoint failed\n");
-            }
-          } else {
-            PrintF("%s unrecognized\n", arg1);
-          }
-        } else {
-          PrintF("break <address>\n");
-        }
-      } else if (strcmp(cmd, "del") == 0) {
-        if (!DeleteBreakpoint(nullptr)) {
-          PrintF("deleting breakpoint failed\n");
-        }
-      } else if (strcmp(cmd, "flags") == 0) {
-        PrintF("No flags on MIPS !\n");
-      } else if (strcmp(cmd, "stop") == 0) {
-        int32_t value;
-        intptr_t stop_pc = sim_->get_pc() -
-            2 * Instruction::kInstrSize;
-        Instruction* stop_instr = reinterpret_cast<Instruction*>(stop_pc);
-        Instruction* msg_address =
-          reinterpret_cast<Instruction*>(stop_pc +
-              Instruction::kInstrSize);
-        if ((argc == 2) && (strcmp(arg1, "unstop") == 0)) {
-          // Remove the current stop.
-          if (sim_->IsStopInstruction(stop_instr)) {
-            stop_instr->SetInstructionBits(kNopInstr);
-            msg_address->SetInstructionBits(kNopInstr);
-          } else {
-            PrintF("Not at debugger stop.\n");
-          }
-        } else if (argc == 3) {
-          // Print information about all/the specified breakpoint(s).
-          if (strcmp(arg1, "info") == 0) {
-            if (strcmp(arg2, "all") == 0) {
-              PrintF("Stop information:\n");
-              for (uint32_t i = kMaxWatchpointCode + 1;
-                   i <= kMaxStopCode;
-                   i++) {
-                sim_->PrintStopInfo(i);
-              }
-            } else if (GetValue(arg2, &value)) {
-              sim_->PrintStopInfo(value);
-            } else {
-              PrintF("Unrecognized argument.\n");
-            }
-          } else if (strcmp(arg1, "enable") == 0) {
-            // Enable all/the specified breakpoint(s).
-            if (strcmp(arg2, "all") == 0) {
-              for (uint32_t i = kMaxWatchpointCode + 1;
-                   i <= kMaxStopCode;
-                   i++) {
-                sim_->EnableStop(i);
-              }
-            } else if (GetValue(arg2, &value)) {
-              sim_->EnableStop(value);
-            } else {
-              PrintF("Unrecognized argument.\n");
-            }
-          } else if (strcmp(arg1, "disable") == 0) {
-            // Disable all/the specified breakpoint(s).
-            if (strcmp(arg2, "all") == 0) {
-              for (uint32_t i = kMaxWatchpointCode + 1;
-                   i <= kMaxStopCode;
-                   i++) {
-                sim_->DisableStop(i);
-              }
-            } else if (GetValue(arg2, &value)) {
-              sim_->DisableStop(value);
-            } else {
-              PrintF("Unrecognized argument.\n");
-            }
-          }
-        } else {
-          PrintF("Wrong usage. Use help command for more information.\n");
-        }
-      } else if ((strcmp(cmd, "stat") == 0) || (strcmp(cmd, "st") == 0)) {
-        // Print registers and disassemble.
-        PrintAllRegs();
-        PrintF("\n");
-
-        disasm::NameConverter converter;
-        disasm::Disassembler dasm(converter);
-        // Use a reasonably large buffer.
-        v8::internal::EmbeddedVector<char, 256> buffer;
-
-        byte* cur = nullptr;
-        byte* end = nullptr;
-
-        if (argc == 1) {
-          cur = reinterpret_cast<byte*>(sim_->get_pc());
-          end = cur + (10 * Instruction::kInstrSize);
-        } else if (argc == 2) {
-          int32_t value;
-          if (GetValue(arg1, &value)) {
-            cur = reinterpret_cast<byte*>(value);
-            // no length parameter passed, assume 10 instructions
-            end = cur + (10 * Instruction::kInstrSize);
-          }
-        } else {
-          int32_t value1;
-          int32_t value2;
-          if (GetValue(arg1, &value1) && GetValue(arg2, &value2)) {
-            cur = reinterpret_cast<byte*>(value1);
-            end = cur + (value2 * Instruction::kInstrSize);
-          }
-        }
-
-        while (cur < end) {
-          dasm.InstructionDecode(buffer, cur);
-          PrintF("  0x%08" PRIxPTR "  %s\n", reinterpret_cast<intptr_t>(cur),
-                 buffer.start());
-          cur += Instruction::kInstrSize;
-        }
-      } else if ((strcmp(cmd, "h") == 0) || (strcmp(cmd, "help") == 0)) {
-        PrintF("cont\n");
-        PrintF("  continue execution (alias 'c')\n");
-        PrintF("stepi\n");
-        PrintF("  step one instruction (alias 'si')\n");
-        PrintF("print <register>\n");
-        PrintF("  print register content (alias 'p')\n");
-        PrintF("  use register name 'all' to print all registers\n");
-        PrintF("printobject <register>\n");
-        PrintF("  print an object from a register (alias 'po')\n");
-        PrintF("stack [<words>]\n");
-        PrintF("  dump stack content, default dump 10 words)\n");
-        PrintF("mem <address> [<words>]\n");
-        PrintF("  dump memory content, default dump 10 words)\n");
-        PrintF("flags\n");
-        PrintF("  print flags\n");
-        PrintF("disasm [<instructions>]\n");
-        PrintF("disasm [<address/register>]\n");
-        PrintF("disasm [[<address/register>] <instructions>]\n");
-        PrintF("  disassemble code, default is 10 instructions\n");
-        PrintF("  from pc (alias 'di')\n");
-        PrintF("gdb\n");
-        PrintF("  enter gdb\n");
-        PrintF("break <address>\n");
-        PrintF("  set a break point on the address\n");
-        PrintF("del\n");
-        PrintF("  delete the breakpoint\n");
-        PrintF("stop feature:\n");
-        PrintF("  Description:\n");
-        PrintF("    Stops are debug instructions inserted by\n");
-        PrintF("    the Assembler::stop() function.\n");
-        PrintF("    When hitting a stop, the Simulator will\n");
-        PrintF("    stop and and give control to the Debugger.\n");
-        PrintF("    All stop codes are watched:\n");
-        PrintF("    - They can be enabled / disabled: the Simulator\n");
-        PrintF("       will / won't stop when hitting them.\n");
-        PrintF("    - The Simulator keeps track of how many times they \n");
-        PrintF("      are met. (See the info command.) Going over a\n");
-        PrintF("      disabled stop still increases its counter. \n");
-        PrintF("  Commands:\n");
-        PrintF("    stop info all/<code> : print infos about number <code>\n");
-        PrintF("      or all stop(s).\n");
-        PrintF("    stop enable/disable all/<code> : enables / disables\n");
-        PrintF("      all or number <code> stop(s)\n");
-        PrintF("    stop unstop\n");
-        PrintF("      ignore the stop instruction at the current location\n");
-        PrintF("      from now on\n");
-      } else {
-        PrintF("Unknown command: %s\n", cmd);
-      }
-    }
-  }
-
-  // Add all the breakpoints back to stop execution and enter the debugger
-  // shell when hit.
-  RedoBreakpoints();
-
-#undef COMMAND_SIZE
-#undef ARG_SIZE
-
-#undef STR
-#undef XSTR
-}
-
-
-static bool ICacheMatch(void* one, void* two) {
-  DCHECK_EQ(reinterpret_cast<intptr_t>(one) & CachePage::kPageMask, 0);
-  DCHECK_EQ(reinterpret_cast<intptr_t>(two) & CachePage::kPageMask, 0);
-  return one == two;
-}
-
-
-static uint32_t ICacheHash(void* key) {
-  return static_cast<uint32_t>(reinterpret_cast<uintptr_t>(key)) >> 2;
-}
-
-
-static bool AllOnOnePage(uintptr_t start, int size) {
-  intptr_t start_page = (start & ~CachePage::kPageMask);
-  intptr_t end_page = ((start + size) & ~CachePage::kPageMask);
-  return start_page == end_page;
-}
-
-
-void Simulator::set_last_debugger_input(char* input) {
-  DeleteArray(last_debugger_input_);
-  last_debugger_input_ = input;
-}
-
-void Simulator::SetRedirectInstruction(Instruction* instruction) {
-  instruction->SetInstructionBits(rtCallRedirInstr);
-}
-
-void Simulator::FlushICache(base::CustomMatcherHashMap* i_cache,
-                            void* start_addr, size_t size) {
-  intptr_t start = reinterpret_cast<intptr_t>(start_addr);
-  int intra_line = (start & CachePage::kLineMask);
-  start -= intra_line;
-  size += intra_line;
-  size = ((size - 1) | CachePage::kLineMask) + 1;
-  int offset = (start & CachePage::kPageMask);
-  while (!AllOnOnePage(start, size - 1)) {
-    int bytes_to_flush = CachePage::kPageSize - offset;
-    FlushOnePage(i_cache, start, bytes_to_flush);
-    start += bytes_to_flush;
-    size -= bytes_to_flush;
-    DCHECK_EQ(0, start & CachePage::kPageMask);
-    offset = 0;
-  }
-  if (size != 0) {
-    FlushOnePage(i_cache, start, size);
-  }
-}
-
-CachePage* Simulator::GetCachePage(base::CustomMatcherHashMap* i_cache,
-                                   void* page) {
-  base::CustomMatcherHashMap::Entry* entry =
-      i_cache->LookupOrInsert(page, ICacheHash(page));
-  if (entry->value == nullptr) {
-    CachePage* new_page = new CachePage();
-    entry->value = new_page;
-  }
-  return reinterpret_cast<CachePage*>(entry->value);
-}
-
-
-// Flush from start up to and not including start + size.
-void Simulator::FlushOnePage(base::CustomMatcherHashMap* i_cache,
-                             intptr_t start, int size) {
-  DCHECK_LE(size, CachePage::kPageSize);
-  DCHECK(AllOnOnePage(start, size - 1));
-  DCHECK_EQ(start & CachePage::kLineMask, 0);
-  DCHECK_EQ(size & CachePage::kLineMask, 0);
-  void* page = reinterpret_cast<void*>(start & (~CachePage::kPageMask));
-  int offset = (start & CachePage::kPageMask);
-  CachePage* cache_page = GetCachePage(i_cache, page);
-  char* valid_bytemap = cache_page->ValidityByte(offset);
-  memset(valid_bytemap, CachePage::LINE_INVALID, size >> CachePage::kLineShift);
-}
-
-void Simulator::CheckICache(base::CustomMatcherHashMap* i_cache,
-                            Instruction* instr) {
-  intptr_t address = reinterpret_cast<intptr_t>(instr);
-  void* page = reinterpret_cast<void*>(address & (~CachePage::kPageMask));
-  void* line = reinterpret_cast<void*>(address & (~CachePage::kLineMask));
-  int offset = (address & CachePage::kPageMask);
-  CachePage* cache_page = GetCachePage(i_cache, page);
-  char* cache_valid_byte = cache_page->ValidityByte(offset);
-  bool cache_hit = (*cache_valid_byte == CachePage::LINE_VALID);
-  char* cached_line = cache_page->CachedData(offset & ~CachePage::kLineMask);
-  if (cache_hit) {
-    // Check that the data in memory matches the contents of the I-cache.
-    CHECK_EQ(0, memcmp(reinterpret_cast<void*>(instr),
-                       cache_page->CachedData(offset),
-                       Instruction::kInstrSize));
-  } else {
-    // Cache miss.  Load memory into the cache.
-    memcpy(cached_line, line, CachePage::kLineLength);
-    *cache_valid_byte = CachePage::LINE_VALID;
-  }
-}
-
-
-Simulator::Simulator(Isolate* isolate) : isolate_(isolate) {
-  i_cache_ = isolate_->simulator_i_cache();
-  if (i_cache_ == nullptr) {
-    i_cache_ = new base::CustomMatcherHashMap(&ICacheMatch);
-    isolate_->set_simulator_i_cache(i_cache_);
-  }
-  // Set up simulator support first. Some of this information is needed to
-  // setup the architecture state.
-  stack_ = reinterpret_cast<char*>(malloc(stack_size_));
-  pc_modified_ = false;
-  icount_ = 0;
-  break_count_ = 0;
-  break_pc_ = nullptr;
-  break_instr_ = 0;
-
-  // Set up architecture state.
-  // All registers are initialized to zero to start with.
-  for (int i = 0; i < kNumSimuRegisters; i++) {
-    registers_[i] = 0;
-  }
-  for (int i = 0; i < kNumFPURegisters; i++) {
-    FPUregisters_[2 * i] = 0;
-    FPUregisters_[2 * i + 1] = 0;  // upper part for MSA ASE
-  }
-  if (IsMipsArchVariant(kMips32r6)) {
-    FCSR_ = kFCSRNaN2008FlagMask;
-    MSACSR_ = 0;
-  } else {
-    DCHECK(IsMipsArchVariant(kMips32r1) || IsMipsArchVariant(kMips32r2));
-    FCSR_ = 0;
-  }
-
-  // The sp is initialized to point to the bottom (high address) of the
-  // allocated stack area. To be safe in potential stack underflows we leave
-  // some buffer below.
-  registers_[sp] = reinterpret_cast<int32_t>(stack_) + stack_size_ - 64;
-  // The ra and pc are initialized to a known bad value that will cause an
-  // access violation if the simulator ever tries to execute it.
-  registers_[pc] = bad_ra;
-  registers_[ra] = bad_ra;
-  last_debugger_input_ = nullptr;
-}
-
-
-Simulator::~Simulator() { free(stack_); }
-
-
-// Get the active Simulator for the current thread.
-Simulator* Simulator::current(Isolate* isolate) {
-  v8::internal::Isolate::PerIsolateThreadData* isolate_data =
-       isolate->FindOrAllocatePerThreadDataForThisThread();
-  DCHECK_NOT_NULL(isolate_data);
-  DCHECK_NOT_NULL(isolate_data);
-
-  Simulator* sim = isolate_data->simulator();
-  if (sim == nullptr) {
-    // TODO(146): delete the simulator object when a thread/isolate goes away.
-    sim = new Simulator(isolate);
-    isolate_data->set_simulator(sim);
-  }
-  return sim;
-}
-
-
-// Sets the register in the architecture state. It will also deal with updating
-// Simulator internal state for special registers such as PC.
-void Simulator::set_register(int reg, int32_t value) {
-  DCHECK((reg >= 0) && (reg < kNumSimuRegisters));
-  if (reg == pc) {
-    pc_modified_ = true;
-  }
-
-  // Zero register always holds 0.
-  registers_[reg] = (reg == 0) ? 0 : value;
-}
-
-
-void Simulator::set_dw_register(int reg, const int* dbl) {
-  DCHECK((reg >= 0) && (reg < kNumSimuRegisters));
-  registers_[reg] = dbl[0];
-  registers_[reg + 1] = dbl[1];
-}
-
-
-void Simulator::set_fpu_register(int fpureg, int64_t value) {
-  DCHECK(IsFp64Mode());
-  DCHECK((fpureg >= 0) && (fpureg < kNumFPURegisters));
-  FPUregisters_[fpureg * 2] = value;
-}
-
-
-void Simulator::set_fpu_register_word(int fpureg, int32_t value) {
-  // Set ONLY lower 32-bits, leaving upper bits untouched.
-  // TODO(plind): big endian issue.
-  DCHECK((fpureg >= 0) && (fpureg < kNumFPURegisters));
-  int32_t* pword = reinterpret_cast<int32_t*>(&FPUregisters_[fpureg * 2]);
-  *pword = value;
-}
-
-
-void Simulator::set_fpu_register_hi_word(int fpureg, int32_t value) {
-  // Set ONLY upper 32-bits, leaving lower bits untouched.
-  // TODO(plind): big endian issue.
-  DCHECK((fpureg >= 0) && (fpureg < kNumFPURegisters));
-  int32_t* phiword =
-      (reinterpret_cast<int32_t*>(&FPUregisters_[fpureg * 2])) + 1;
-  *phiword = value;
-}
-
-
-void Simulator::set_fpu_register_float(int fpureg, float value) {
-  DCHECK((fpureg >= 0) && (fpureg < kNumFPURegisters));
-  *bit_cast<float*>(&FPUregisters_[fpureg * 2]) = value;
-}
-
-
-void Simulator::set_fpu_register_double(int fpureg, double value) {
-  if (IsFp64Mode()) {
-    DCHECK((fpureg >= 0) && (fpureg < kNumFPURegisters));
-    *bit_cast<double*>(&FPUregisters_[fpureg * 2]) = value;
-  } else {
-    DCHECK((fpureg >= 0) && (fpureg < kNumFPURegisters) && ((fpureg % 2) == 0));
-    int64_t i64 = bit_cast<int64_t>(value);
-    set_fpu_register_word(fpureg, i64 & 0xFFFFFFFF);
-    set_fpu_register_word(fpureg + 1, i64 >> 32);
-  }
-}
-
-
-// Get the register from the architecture state. This function does handle
-// the special case of accessing the PC register.
-int32_t Simulator::get_register(int reg) const {
-  DCHECK((reg >= 0) && (reg < kNumSimuRegisters));
-  if (reg == 0)
-    return 0;
-  else
-    return registers_[reg] + ((reg == pc) ? Instruction::kPCReadOffset : 0);
-}
-
-
-double Simulator::get_double_from_register_pair(int reg) {
-  // TODO(plind): bad ABI stuff, refactor or remove.
-  DCHECK((reg >= 0) && (reg < kNumSimuRegisters) && ((reg % 2) == 0));
-
-  double dm_val = 0.0;
-  // Read the bits from the unsigned integer register_[] array
-  // into the double precision floating point value and return it.
-  char buffer[2 * sizeof(registers_[0])];
-  memcpy(buffer, &registers_[reg], 2 * sizeof(registers_[0]));
-  memcpy(&dm_val, buffer, 2 * sizeof(registers_[0]));
-  return(dm_val);
-}
-
-
-int64_t Simulator::get_fpu_register(int fpureg) const {
-  if (IsFp64Mode()) {
-    DCHECK((fpureg >= 0) && (fpureg < kNumFPURegisters));
-    return FPUregisters_[fpureg * 2];
-  } else {
-    DCHECK((fpureg >= 0) && (fpureg < kNumFPURegisters) && ((fpureg % 2) == 0));
-    uint64_t i64;
-    i64 = static_cast<uint32_t>(get_fpu_register_word(fpureg));
-    i64 |= static_cast<uint64_t>(get_fpu_register_word(fpureg + 1)) << 32;
-    return static_cast<int64_t>(i64);
-  }
-}
-
-
-int32_t Simulator::get_fpu_register_word(int fpureg) const {
-  DCHECK((fpureg >= 0) && (fpureg < kNumFPURegisters));
-  return static_cast<int32_t>(FPUregisters_[fpureg * 2] & 0xFFFFFFFF);
-}
-
-
-int32_t Simulator::get_fpu_register_signed_word(int fpureg) const {
-  DCHECK((fpureg >= 0) && (fpureg < kNumFPURegisters));
-  return static_cast<int32_t>(FPUregisters_[fpureg * 2] & 0xFFFFFFFF);
-}
-
-
-int32_t Simulator::get_fpu_register_hi_word(int fpureg) const {
-  DCHECK((fpureg >= 0) && (fpureg < kNumFPURegisters));
-  return static_cast<int32_t>((FPUregisters_[fpureg * 2] >> 32) & 0xFFFFFFFF);
-}
-
-
-float Simulator::get_fpu_register_float(int fpureg) const {
-  DCHECK((fpureg >= 0) && (fpureg < kNumFPURegisters));
-  return *bit_cast<float*>(const_cast<int64_t*>(&FPUregisters_[fpureg * 2]));
-}
-
-
-double Simulator::get_fpu_register_double(int fpureg) const {
-  if (IsFp64Mode()) {
-    DCHECK((fpureg >= 0) && (fpureg < kNumFPURegisters));
-    return *bit_cast<double*>(&FPUregisters_[fpureg * 2]);
-  } else {
-    DCHECK((fpureg >= 0) && (fpureg < kNumFPURegisters) && ((fpureg % 2) == 0));
-    int64_t i64;
-    i64 = static_cast<uint32_t>(get_fpu_register_word(fpureg));
-    i64 |= static_cast<uint64_t>(get_fpu_register_word(fpureg + 1)) << 32;
-    return bit_cast<double>(i64);
-  }
-}
-
-template <typename T>
-void Simulator::get_msa_register(int wreg, T* value) {
-  DCHECK((wreg >= 0) && (wreg < kNumMSARegisters));
-  memcpy(value, FPUregisters_ + wreg * 2, kSimd128Size);
-}
-
-template <typename T>
-void Simulator::set_msa_register(int wreg, const T* value) {
-  DCHECK((wreg >= 0) && (wreg < kNumMSARegisters));
-  memcpy(FPUregisters_ + wreg * 2, value, kSimd128Size);
-}
-
-// Runtime FP routines take up to two double arguments and zero
-// or one integer arguments. All are constructed here,
-// from a0-a3 or f12 and f14.
-void Simulator::GetFpArgs(double* x, double* y, int32_t* z) {
-  if (!IsMipsSoftFloatABI) {
-    *x = get_fpu_register_double(12);
-    *y = get_fpu_register_double(14);
-    *z = get_register(a2);
-  } else {
-    // TODO(plind): bad ABI stuff, refactor or remove.
-    // We use a char buffer to get around the strict-aliasing rules which
-    // otherwise allow the compiler to optimize away the copy.
-    char buffer[sizeof(*x)];
-    int32_t* reg_buffer = reinterpret_cast<int32_t*>(buffer);
-
-    // Registers a0 and a1 -> x.
-    reg_buffer[0] = get_register(a0);
-    reg_buffer[1] = get_register(a1);
-    memcpy(x, buffer, sizeof(buffer));
-    // Registers a2 and a3 -> y.
-    reg_buffer[0] = get_register(a2);
-    reg_buffer[1] = get_register(a3);
-    memcpy(y, buffer, sizeof(buffer));
-    // Register 2 -> z.
-    reg_buffer[0] = get_register(a2);
-    memcpy(z, buffer, sizeof(*z));
-  }
-}
-
-
-// The return value is either in v0/v1 or f0.
-void Simulator::SetFpResult(const double& result) {
-  if (!IsMipsSoftFloatABI) {
-    set_fpu_register_double(0, result);
-  } else {
-    char buffer[2 * sizeof(registers_[0])];
-    int32_t* reg_buffer = reinterpret_cast<int32_t*>(buffer);
-    memcpy(buffer, &result, sizeof(buffer));
-    // Copy result to v0 and v1.
-    set_register(v0, reg_buffer[0]);
-    set_register(v1, reg_buffer[1]);
-  }
-}
-
-
-// Helper functions for setting and testing the FCSR register's bits.
-void Simulator::set_fcsr_bit(uint32_t cc, bool value) {
-  if (value) {
-    FCSR_ |= (1 << cc);
-  } else {
-    FCSR_ &= ~(1 << cc);
-  }
-}
-
-
-bool Simulator::test_fcsr_bit(uint32_t cc) {
-  return FCSR_ & (1 << cc);
-}
-
-
-void Simulator::set_fcsr_rounding_mode(FPURoundingMode mode) {
-  FCSR_ |= mode & kFPURoundingModeMask;
-}
-
-void Simulator::set_msacsr_rounding_mode(FPURoundingMode mode) {
-  MSACSR_ |= mode & kFPURoundingModeMask;
-}
-
-unsigned int Simulator::get_fcsr_rounding_mode() {
-  return FCSR_ & kFPURoundingModeMask;
-}
-
-unsigned int Simulator::get_msacsr_rounding_mode() {
-  return MSACSR_ & kFPURoundingModeMask;
-}
-
-void Simulator::set_fpu_register_word_invalid_result(float original,
-                                                     float rounded) {
-  if (FCSR_ & kFCSRNaN2008FlagMask) {
-    double max_int32 = std::numeric_limits<int32_t>::max();
-    double min_int32 = std::numeric_limits<int32_t>::min();
-    if (std::isnan(original)) {
-      set_fpu_register_word(fd_reg(), 0);
-    } else if (rounded > max_int32) {
-      set_fpu_register_word(fd_reg(), kFPUInvalidResult);
-    } else if (rounded < min_int32) {
-      set_fpu_register_word(fd_reg(), kFPUInvalidResultNegative);
-    } else {
-      UNREACHABLE();
-    }
-  } else {
-    set_fpu_register_word(fd_reg(), kFPUInvalidResult);
-  }
-}
-
-
-void Simulator::set_fpu_register_invalid_result(float original, float rounded) {
-  if (FCSR_ & kFCSRNaN2008FlagMask) {
-    double max_int32 = std::numeric_limits<int32_t>::max();
-    double min_int32 = std::numeric_limits<int32_t>::min();
-    if (std::isnan(original)) {
-      set_fpu_register(fd_reg(), 0);
-    } else if (rounded > max_int32) {
-      set_fpu_register(fd_reg(), kFPUInvalidResult);
-    } else if (rounded < min_int32) {
-      set_fpu_register(fd_reg(), kFPUInvalidResultNegative);
-    } else {
-      UNREACHABLE();
-    }
-  } else {
-    set_fpu_register(fd_reg(), kFPUInvalidResult);
-  }
-}
-
-
-void Simulator::set_fpu_register_invalid_result64(float original,
-                                                  float rounded) {
-  if (FCSR_ & kFCSRNaN2008FlagMask) {
-    // The value of INT64_MAX (2^63-1) can't be represented as double exactly,
-    // loading the most accurate representation into max_int64, which is 2^63.
-    double max_int64 = std::numeric_limits<int64_t>::max();
-    double min_int64 = std::numeric_limits<int64_t>::min();
-    if (std::isnan(original)) {
-      set_fpu_register(fd_reg(), 0);
-    } else if (rounded >= max_int64) {
-      set_fpu_register(fd_reg(), kFPU64InvalidResult);
-    } else if (rounded < min_int64) {
-      set_fpu_register(fd_reg(), kFPU64InvalidResultNegative);
-    } else {
-      UNREACHABLE();
-    }
-  } else {
-    set_fpu_register(fd_reg(), kFPU64InvalidResult);
-  }
-}
-
-
-void Simulator::set_fpu_register_word_invalid_result(double original,
-                                                     double rounded) {
-  if (FCSR_ & kFCSRNaN2008FlagMask) {
-    double max_int32 = std::numeric_limits<int32_t>::max();
-    double min_int32 = std::numeric_limits<int32_t>::min();
-    if (std::isnan(original)) {
-      set_fpu_register_word(fd_reg(), 0);
-    } else if (rounded > max_int32) {
-      set_fpu_register_word(fd_reg(), kFPUInvalidResult);
-    } else if (rounded < min_int32) {
-      set_fpu_register_word(fd_reg(), kFPUInvalidResultNegative);
-    } else {
-      UNREACHABLE();
-    }
-  } else {
-    set_fpu_register_word(fd_reg(), kFPUInvalidResult);
-  }
-}
-
-
-void Simulator::set_fpu_register_invalid_result(double original,
-                                                double rounded) {
-  if (FCSR_ & kFCSRNaN2008FlagMask) {
-    double max_int32 = std::numeric_limits<int32_t>::max();
-    double min_int32 = std::numeric_limits<int32_t>::min();
-    if (std::isnan(original)) {
-      set_fpu_register(fd_reg(), 0);
-    } else if (rounded > max_int32) {
-      set_fpu_register(fd_reg(), kFPUInvalidResult);
-    } else if (rounded < min_int32) {
-      set_fpu_register(fd_reg(), kFPUInvalidResultNegative);
-    } else {
-      UNREACHABLE();
-    }
-  } else {
-    set_fpu_register(fd_reg(), kFPUInvalidResult);
-  }
-}
-
-
-void Simulator::set_fpu_register_invalid_result64(double original,
-                                                  double rounded) {
-  if (FCSR_ & kFCSRNaN2008FlagMask) {
-    // The value of INT64_MAX (2^63-1) can't be represented as double exactly,
-    // loading the most accurate representation into max_int64, which is 2^63.
-    double max_int64 = std::numeric_limits<int64_t>::max();
-    double min_int64 = std::numeric_limits<int64_t>::min();
-    if (std::isnan(original)) {
-      set_fpu_register(fd_reg(), 0);
-    } else if (rounded >= max_int64) {
-      set_fpu_register(fd_reg(), kFPU64InvalidResult);
-    } else if (rounded < min_int64) {
-      set_fpu_register(fd_reg(), kFPU64InvalidResultNegative);
-    } else {
-      UNREACHABLE();
-    }
-  } else {
-    set_fpu_register(fd_reg(), kFPU64InvalidResult);
-  }
-}
-
-
-// Sets the rounding error codes in FCSR based on the result of the rounding.
-// Returns true if the operation was invalid.
-bool Simulator::set_fcsr_round_error(double original, double rounded) {
-  bool ret = false;
-  double max_int32 = std::numeric_limits<int32_t>::max();
-  double min_int32 = std::numeric_limits<int32_t>::min();
-
-  if (!std::isfinite(original) || !std::isfinite(rounded)) {
-    set_fcsr_bit(kFCSRInvalidOpFlagBit, true);
-    ret = true;
-  }
-
-  if (original != rounded) {
-    set_fcsr_bit(kFCSRInexactFlagBit, true);
-  }
-
-  if (rounded < DBL_MIN && rounded > -DBL_MIN && rounded != 0) {
-    set_fcsr_bit(kFCSRUnderflowFlagBit, true);
-    ret = true;
-  }
-
-  if (rounded > max_int32 || rounded < min_int32) {
-    set_fcsr_bit(kFCSROverflowFlagBit, true);
-    // The reference is not really clear but it seems this is required:
-    set_fcsr_bit(kFCSRInvalidOpFlagBit, true);
-    ret = true;
-  }
-
-  return ret;
-}
-
-
-// Sets the rounding error codes in FCSR based on the result of the rounding.
-// Returns true if the operation was invalid.
-bool Simulator::set_fcsr_round64_error(double original, double rounded) {
-  bool ret = false;
-  // The value of INT64_MAX (2^63-1) can't be represented as double exactly,
-  // loading the most accurate representation into max_int64, which is 2^63.
-  double max_int64 = std::numeric_limits<int64_t>::max();
-  double min_int64 = std::numeric_limits<int64_t>::min();
-
-  if (!std::isfinite(original) || !std::isfinite(rounded)) {
-    set_fcsr_bit(kFCSRInvalidOpFlagBit, true);
-    ret = true;
-  }
-
-  if (original != rounded) {
-    set_fcsr_bit(kFCSRInexactFlagBit, true);
-  }
-
-  if (rounded < DBL_MIN && rounded > -DBL_MIN && rounded != 0) {
-    set_fcsr_bit(kFCSRUnderflowFlagBit, true);
-    ret = true;
-  }
-
-  if (rounded >= max_int64 || rounded < min_int64) {
-    set_fcsr_bit(kFCSROverflowFlagBit, true);
-    // The reference is not really clear but it seems this is required:
-    set_fcsr_bit(kFCSRInvalidOpFlagBit, true);
-    ret = true;
-  }
-
-  return ret;
-}
-
-
-// Sets the rounding error codes in FCSR based on the result of the rounding.
-// Returns true if the operation was invalid.
-bool Simulator::set_fcsr_round_error(float original, float rounded) {
-  bool ret = false;
-  double max_int32 = std::numeric_limits<int32_t>::max();
-  double min_int32 = std::numeric_limits<int32_t>::min();
-
-  if (!std::isfinite(original) || !std::isfinite(rounded)) {
-    set_fcsr_bit(kFCSRInvalidOpFlagBit, true);
-    ret = true;
-  }
-
-  if (original != rounded) {
-    set_fcsr_bit(kFCSRInexactFlagBit, true);
-  }
-
-  if (rounded < FLT_MIN && rounded > -FLT_MIN && rounded != 0) {
-    set_fcsr_bit(kFCSRUnderflowFlagBit, true);
-    ret = true;
-  }
-
-  if (rounded > max_int32 || rounded < min_int32) {
-    set_fcsr_bit(kFCSROverflowFlagBit, true);
-    // The reference is not really clear but it seems this is required:
-    set_fcsr_bit(kFCSRInvalidOpFlagBit, true);
-    ret = true;
-  }
-
-  return ret;
-}
-
-
-// Sets the rounding error codes in FCSR based on the result of the rounding.
-// Returns true if the operation was invalid.
-bool Simulator::set_fcsr_round64_error(float original, float rounded) {
-  bool ret = false;
-  // The value of INT64_MAX (2^63-1) can't be represented as double exactly,
-  // loading the most accurate representation into max_int64, which is 2^63.
-  double max_int64 = std::numeric_limits<int64_t>::max();
-  double min_int64 = std::numeric_limits<int64_t>::min();
-
-  if (!std::isfinite(original) || !std::isfinite(rounded)) {
-    set_fcsr_bit(kFCSRInvalidOpFlagBit, true);
-    ret = true;
-  }
-
-  if (original != rounded) {
-    set_fcsr_bit(kFCSRInexactFlagBit, true);
-  }
-
-  if (rounded < FLT_MIN && rounded > -FLT_MIN && rounded != 0) {
-    set_fcsr_bit(kFCSRUnderflowFlagBit, true);
-    ret = true;
-  }
-
-  if (rounded >= max_int64 || rounded < min_int64) {
-    set_fcsr_bit(kFCSROverflowFlagBit, true);
-    // The reference is not really clear but it seems this is required:
-    set_fcsr_bit(kFCSRInvalidOpFlagBit, true);
-    ret = true;
-  }
-
-  return ret;
-}
-
-
-void Simulator::round_according_to_fcsr(double toRound, double& rounded,
-                                        int32_t& rounded_int, double fs) {
-  // 0 RN (round to nearest): Round a result to the nearest
-  // representable value; if the result is exactly halfway between
-  // two representable values, round to zero. Behave like round_w_d.
-
-  // 1 RZ (round toward zero): Round a result to the closest
-  // representable value whose absolute value is less than or
-  // equal to the infinitely accurate result. Behave like trunc_w_d.
-
-  // 2 RP (round up, or toward  infinity): Round a result to the
-  // next representable value up. Behave like ceil_w_d.
-
-  // 3 RD (round down, or toward −infinity): Round a result to
-  // the next representable value down. Behave like floor_w_d.
-  switch (get_fcsr_rounding_mode()) {
-    case kRoundToNearest:
-      rounded = std::floor(fs + 0.5);
-      rounded_int = static_cast<int32_t>(rounded);
-      if ((rounded_int & 1) != 0 && rounded_int - fs == 0.5) {
-        // If the number is halfway between two integers,
-        // round to the even one.
-        rounded_int--;
-        rounded -= 1.;
-      }
-      break;
-    case kRoundToZero:
-      rounded = trunc(fs);
-      rounded_int = static_cast<int32_t>(rounded);
-      break;
-    case kRoundToPlusInf:
-      rounded = std::ceil(fs);
-      rounded_int = static_cast<int32_t>(rounded);
-      break;
-    case kRoundToMinusInf:
-      rounded = std::floor(fs);
-      rounded_int = static_cast<int32_t>(rounded);
-      break;
-  }
-}
-
-
-void Simulator::round_according_to_fcsr(float toRound, float& rounded,
-                                        int32_t& rounded_int, float fs) {
-  // 0 RN (round to nearest): Round a result to the nearest
-  // representable value; if the result is exactly halfway between
-  // two representable values, round to zero. Behave like round_w_d.
-
-  // 1 RZ (round toward zero): Round a result to the closest
-  // representable value whose absolute value is less than or
-  // equal to the infinitely accurate result. Behave like trunc_w_d.
-
-  // 2 RP (round up, or toward  infinity): Round a result to the
-  // next representable value up. Behave like ceil_w_d.
-
-  // 3 RD (round down, or toward −infinity): Round a result to
-  // the next representable value down. Behave like floor_w_d.
-  switch (get_fcsr_rounding_mode()) {
-    case kRoundToNearest:
-      rounded = std::floor(fs + 0.5);
-      rounded_int = static_cast<int32_t>(rounded);
-      if ((rounded_int & 1) != 0 && rounded_int - fs == 0.5) {
-        // If the number is halfway between two integers,
-        // round to the even one.
-        rounded_int--;
-        rounded -= 1.f;
-      }
-      break;
-    case kRoundToZero:
-      rounded = trunc(fs);
-      rounded_int = static_cast<int32_t>(rounded);
-      break;
-    case kRoundToPlusInf:
-      rounded = std::ceil(fs);
-      rounded_int = static_cast<int32_t>(rounded);
-      break;
-    case kRoundToMinusInf:
-      rounded = std::floor(fs);
-      rounded_int = static_cast<int32_t>(rounded);
-      break;
-  }
-}
-
-template <typename T_fp, typename T_int>
-void Simulator::round_according_to_msacsr(T_fp toRound, T_fp& rounded,
-                                          T_int& rounded_int) {
-  // 0 RN (round to nearest): Round a result to the nearest
-  // representable value; if the result is exactly halfway between
-  // two representable values, round to zero. Behave like round_w_d.
-
-  // 1 RZ (round toward zero): Round a result to the closest
-  // representable value whose absolute value is less than or
-  // equal to the infinitely accurate result. Behave like trunc_w_d.
-
-  // 2 RP (round up, or toward  infinity): Round a result to the
-  // next representable value up. Behave like ceil_w_d.
-
-  // 3 RD (round down, or toward −infinity): Round a result to
-  // the next representable value down. Behave like floor_w_d.
-  switch (get_msacsr_rounding_mode()) {
-    case kRoundToNearest:
-      rounded = std::floor(toRound + 0.5);
-      rounded_int = static_cast<T_int>(rounded);
-      if ((rounded_int & 1) != 0 && rounded_int - toRound == 0.5) {
-        // If the number is halfway between two integers,
-        // round to the even one.
-        rounded_int--;
-        rounded -= 1;
-      }
-      break;
-    case kRoundToZero:
-      rounded = trunc(toRound);
-      rounded_int = static_cast<T_int>(rounded);
-      break;
-    case kRoundToPlusInf:
-      rounded = std::ceil(toRound);
-      rounded_int = static_cast<T_int>(rounded);
-      break;
-    case kRoundToMinusInf:
-      rounded = std::floor(toRound);
-      rounded_int = static_cast<T_int>(rounded);
-      break;
-  }
-}
-
-void Simulator::round64_according_to_fcsr(double toRound, double& rounded,
-                                          int64_t& rounded_int, double fs) {
-  // 0 RN (round to nearest): Round a result to the nearest
-  // representable value; if the result is exactly halfway between
-  // two representable values, round to zero. Behave like round_w_d.
-
-  // 1 RZ (round toward zero): Round a result to the closest
-  // representable value whose absolute value is less than or.
-  // equal to the infinitely accurate result. Behave like trunc_w_d.
-
-  // 2 RP (round up, or toward +infinity): Round a result to the
-  // next representable value up. Behave like ceil_w_d.
-
-  // 3 RN (round down, or toward −infinity): Round a result to
-  // the next representable value down. Behave like floor_w_d.
-  switch (FCSR_ & 3) {
-    case kRoundToNearest:
-      rounded = std::floor(fs + 0.5);
-      rounded_int = static_cast<int64_t>(rounded);
-      if ((rounded_int & 1) != 0 && rounded_int - fs == 0.5) {
-        // If the number is halfway between two integers,
-        // round to the even one.
-        rounded_int--;
-        rounded -= 1.;
-      }
-      break;
-    case kRoundToZero:
-      rounded = trunc(fs);
-      rounded_int = static_cast<int64_t>(rounded);
-      break;
-    case kRoundToPlusInf:
-      rounded = std::ceil(fs);
-      rounded_int = static_cast<int64_t>(rounded);
-      break;
-    case kRoundToMinusInf:
-      rounded = std::floor(fs);
-      rounded_int = static_cast<int64_t>(rounded);
-      break;
-  }
-}
-
-
-void Simulator::round64_according_to_fcsr(float toRound, float& rounded,
-                                          int64_t& rounded_int, float fs) {
-  // 0 RN (round to nearest): Round a result to the nearest
-  // representable value; if the result is exactly halfway between
-  // two representable values, round to zero. Behave like round_w_d.
-
-  // 1 RZ (round toward zero): Round a result to the closest
-  // representable value whose absolute value is less than or.
-  // equal to the infinitely accurate result. Behave like trunc_w_d.
-
-  // 2 RP (round up, or toward +infinity): Round a result to the
-  // next representable value up. Behave like ceil_w_d.
-
-  // 3 RN (round down, or toward −infinity): Round a result to
-  // the next representable value down. Behave like floor_w_d.
-  switch (FCSR_ & 3) {
-    case kRoundToNearest:
-      rounded = std::floor(fs + 0.5);
-      rounded_int = static_cast<int64_t>(rounded);
-      if ((rounded_int & 1) != 0 && rounded_int - fs == 0.5) {
-        // If the number is halfway between two integers,
-        // round to the even one.
-        rounded_int--;
-        rounded -= 1.f;
-      }
-      break;
-    case kRoundToZero:
-      rounded = trunc(fs);
-      rounded_int = static_cast<int64_t>(rounded);
-      break;
-    case kRoundToPlusInf:
-      rounded = std::ceil(fs);
-      rounded_int = static_cast<int64_t>(rounded);
-      break;
-    case kRoundToMinusInf:
-      rounded = std::floor(fs);
-      rounded_int = static_cast<int64_t>(rounded);
-      break;
-  }
-}
-
-
-// Raw access to the PC register.
-void Simulator::set_pc(int32_t value) {
-  pc_modified_ = true;
-  registers_[pc] = value;
-}
-
-
-bool Simulator::has_bad_pc() const {
-  return ((registers_[pc] == bad_ra) || (registers_[pc] == end_sim_pc));
-}
-
-
-// Raw access to the PC register without the special adjustment when reading.
-int32_t Simulator::get_pc() const {
-  return registers_[pc];
-}
-
-
-// The MIPS cannot do unaligned reads and writes.  On some MIPS platforms an
-// interrupt is caused.  On others it does a funky rotation thing.  For now we
-// simply disallow unaligned reads, but at some point we may want to move to
-// emulating the rotate behaviour.  Note that simulator runs have the runtime
-// system running directly on the host system and only generated code is
-// executed in the simulator.  Since the host is typically IA32 we will not
-// get the correct MIPS-like behaviour on unaligned accesses.
-
-void Simulator::TraceRegWr(int32_t value, TraceType t) {
-  if (::v8::internal::FLAG_trace_sim) {
-    union {
-      int32_t fmt_int32;
-      float fmt_float;
-    } v;
-    v.fmt_int32 = value;
-
-    switch (t) {
-      case WORD:
-        SNPrintF(trace_buf_, "%08" PRIx32 "    (%" PRIu64 ")    int32:%" PRId32
-                             " uint32:%" PRIu32,
-                 value, icount_, value, value);
-        break;
-      case FLOAT:
-        SNPrintF(trace_buf_, "%08" PRIx32 "    (%" PRIu64 ")    flt:%e",
-                 v.fmt_int32, icount_, v.fmt_float);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  }
-}
-
-void Simulator::TraceRegWr(int64_t value, TraceType t) {
-  if (::v8::internal::FLAG_trace_sim) {
-    union {
-      int64_t fmt_int64;
-      double fmt_double;
-    } v;
-    v.fmt_int64 = value;
-
-    switch (t) {
-      case DWORD:
-        SNPrintF(trace_buf_, "%016" PRIx64 "    (%" PRIu64 ")    int64:%" PRId64
-                             " uint64:%" PRIu64,
-                 value, icount_, value, value);
-        break;
-      case DOUBLE:
-        SNPrintF(trace_buf_, "%016" PRIx64 "    (%" PRIu64 ")    dbl:%e",
-                 v.fmt_int64, icount_, v.fmt_double);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  }
-}
-
-template <typename T>
-void Simulator::TraceMSARegWr(T* value, TraceType t) {
-  if (::v8::internal::FLAG_trace_sim) {
-    union {
-      uint8_t b[16];
-      uint16_t h[8];
-      uint32_t w[4];
-      uint64_t d[2];
-      float f[4];
-      double df[2];
-    } v;
-    memcpy(v.b, value, kSimd128Size);
-    switch (t) {
-      case BYTE:
-        SNPrintF(trace_buf_,
-                 "LO: %016" PRIx64 "  HI: %016" PRIx64 "    (%" PRIu64 ")",
-                 v.d[0], v.d[1], icount_);
-        break;
-      case HALF:
-        SNPrintF(trace_buf_,
-                 "LO: %016" PRIx64 "  HI: %016" PRIx64 "    (%" PRIu64 ")",
-                 v.d[0], v.d[1], icount_);
-        break;
-      case WORD:
-        SNPrintF(trace_buf_,
-                 "LO: %016" PRIx64 "  HI: %016" PRIx64 "    (%" PRIu64
-                 ")    int32[0..3]:%" PRId32 "  %" PRId32 "  %" PRId32
-                 "  %" PRId32,
-                 v.d[0], v.d[1], icount_, v.w[0], v.w[1], v.w[2], v.w[3]);
-        break;
-      case DWORD:
-        SNPrintF(trace_buf_,
-                 "LO: %016" PRIx64 "  HI: %016" PRIx64 "    (%" PRIu64 ")",
-                 v.d[0], v.d[1], icount_);
-        break;
-      case FLOAT:
-        SNPrintF(trace_buf_,
-                 "LO: %016" PRIx64 "  HI: %016" PRIx64 "    (%" PRIu64
-                 ")    flt[0..3]:%e  %e  %e  %e",
-                 v.d[0], v.d[1], icount_, v.f[0], v.f[1], v.f[2], v.f[3]);
-        break;
-      case DOUBLE:
-        SNPrintF(trace_buf_,
-                 "LO: %016" PRIx64 "  HI: %016" PRIx64 "    (%" PRIu64
-                 ")    dbl[0..1]:%e  %e",
-                 v.d[0], v.d[1], icount_, v.df[0], v.df[1]);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  }
-}
-
-template <typename T>
-void Simulator::TraceMSARegWr(T* value) {
-  if (::v8::internal::FLAG_trace_sim) {
-    union {
-      uint8_t b[kMSALanesByte];
-      uint16_t h[kMSALanesHalf];
-      uint32_t w[kMSALanesWord];
-      uint64_t d[kMSALanesDword];
-      float f[kMSALanesWord];
-      double df[kMSALanesDword];
-    } v;
-    memcpy(v.b, value, kMSALanesByte);
-
-    if (std::is_same<T, int32_t>::value) {
-      SNPrintF(trace_buf_,
-               "LO: %016" PRIx64 "  HI: %016" PRIx64 "    (%" PRIu64
-               ")    int32[0..3]:%" PRId32 "  %" PRId32 "  %" PRId32
-               "  %" PRId32,
-               v.d[0], v.d[1], icount_, v.w[0], v.w[1], v.w[2], v.w[3]);
-    } else if (std::is_same<T, float>::value) {
-      SNPrintF(trace_buf_,
-               "LO: %016" PRIx64 "  HI: %016" PRIx64 "    (%" PRIu64
-               ")    flt[0..3]:%e  %e  %e  %e",
-               v.d[0], v.d[1], icount_, v.f[0], v.f[1], v.f[2], v.f[3]);
-    } else if (std::is_same<T, double>::value) {
-      SNPrintF(trace_buf_,
-               "LO: %016" PRIx64 "  HI: %016" PRIx64 "    (%" PRIu64
-               ")    dbl[0..1]:%e  %e",
-               v.d[0], v.d[1], icount_, v.df[0], v.df[1]);
-    } else {
-      SNPrintF(trace_buf_,
-               "LO: %016" PRIx64 "  HI: %016" PRIx64 "    (%" PRIu64 ")",
-               v.d[0], v.d[1], icount_);
-    }
-  }
-}
-
-// TODO(plind): consider making icount_ printing a flag option.
-void Simulator::TraceMemRd(int32_t addr, int32_t value, TraceType t) {
-  if (::v8::internal::FLAG_trace_sim) {
-    union {
-      int32_t fmt_int32;
-      float fmt_float;
-    } v;
-    v.fmt_int32 = value;
-
-    switch (t) {
-      case WORD:
-        SNPrintF(trace_buf_, "%08" PRIx32 " <-- [%08" PRIx32 "]    (%" PRIu64
-                             ")    int32:%" PRId32 " uint32:%" PRIu32,
-                 value, addr, icount_, value, value);
-        break;
-      case FLOAT:
-        SNPrintF(trace_buf_,
-                 "%08" PRIx32 " <-- [%08" PRIx32 "]    (%" PRIu64 ")    flt:%e",
-                 v.fmt_int32, addr, icount_, v.fmt_float);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  }
-}
-
-
-void Simulator::TraceMemWr(int32_t addr, int32_t value, TraceType t) {
-  if (::v8::internal::FLAG_trace_sim) {
-    switch (t) {
-      case BYTE:
-        SNPrintF(trace_buf_,
-                 "      %02" PRIx8 " --> [%08" PRIx32 "]    (%" PRIu64 ")",
-                 static_cast<uint8_t>(value), addr, icount_);
-        break;
-      case HALF:
-        SNPrintF(trace_buf_,
-                 "    %04" PRIx16 " --> [%08" PRIx32 "]    (%" PRIu64 ")",
-                 static_cast<uint16_t>(value), addr, icount_);
-        break;
-      case WORD:
-        SNPrintF(trace_buf_,
-                 "%08" PRIx32 " --> [%08" PRIx32 "]    (%" PRIu64 ")", value,
-                 addr, icount_);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  }
-}
-
-template <typename T>
-void Simulator::TraceMemRd(int32_t addr, T value) {
-  if (::v8::internal::FLAG_trace_sim) {
-    switch (sizeof(T)) {
-      case 1:
-        SNPrintF(trace_buf_,
-                 "%08" PRIx8 " <-- [%08" PRIx32 "]    (%" PRIu64
-                 ")    int8:%" PRId8 " uint8:%" PRIu8,
-                 static_cast<uint8_t>(value), addr, icount_,
-                 static_cast<int8_t>(value), static_cast<uint8_t>(value));
-        break;
-      case 2:
-        SNPrintF(trace_buf_,
-                 "%08" PRIx16 " <-- [%08" PRIx32 "]    (%" PRIu64
-                 ")    int16:%" PRId16 " uint16:%" PRIu16,
-                 static_cast<uint16_t>(value), addr, icount_,
-                 static_cast<int16_t>(value), static_cast<uint16_t>(value));
-        break;
-      case 4:
-        SNPrintF(trace_buf_,
-                 "%08" PRIx32 " <-- [%08" PRIx32 "]    (%" PRIu64
-                 ")    int32:%" PRId32 " uint32:%" PRIu32,
-                 static_cast<uint32_t>(value), addr, icount_,
-                 static_cast<int32_t>(value), static_cast<uint32_t>(value));
-        break;
-      case 8:
-        SNPrintF(trace_buf_,
-                 "%08" PRIx64 " <-- [%08" PRIx32 "]    (%" PRIu64
-                 ")    int64:%" PRId64 " uint64:%" PRIu64,
-                 static_cast<uint64_t>(value), addr, icount_,
-                 static_cast<int64_t>(value), static_cast<uint64_t>(value));
-        break;
-      default:
-        UNREACHABLE();
-    }
-  }
-}
-
-template <typename T>
-void Simulator::TraceMemWr(int32_t addr, T value) {
-  if (::v8::internal::FLAG_trace_sim) {
-    switch (sizeof(T)) {
-      case 1:
-        SNPrintF(trace_buf_,
-                 "      %02" PRIx8 " --> [%08" PRIx32 "]    (%" PRIu64 ")",
-                 static_cast<uint8_t>(value), addr, icount_);
-        break;
-      case 2:
-        SNPrintF(trace_buf_,
-                 "    %04" PRIx16 " --> [%08" PRIx32 "]    (%" PRIu64 ")",
-                 static_cast<uint16_t>(value), addr, icount_);
-        break;
-      case 4:
-        SNPrintF(trace_buf_,
-                 "%08" PRIx32 " --> [%08" PRIx32 "]    (%" PRIu64 ")",
-                 static_cast<uint32_t>(value), addr, icount_);
-        break;
-      case 8:
-        SNPrintF(trace_buf_,
-                 "%16" PRIx64 " --> [%08" PRIx32 "]    (%" PRIu64 ")",
-                 static_cast<uint64_t>(value), addr, icount_);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  }
-}
-
-void Simulator::TraceMemRd(int32_t addr, int64_t value, TraceType t) {
-  if (::v8::internal::FLAG_trace_sim) {
-    union {
-      int64_t fmt_int64;
-      int32_t fmt_int32[2];
-      float fmt_float[2];
-      double fmt_double;
-    } v;
-    v.fmt_int64 = value;
-
-    switch (t) {
-      case DWORD:
-        SNPrintF(trace_buf_, "%016" PRIx64 " <-- [%08" PRIx32 "]    (%" PRIu64
-                             ")    int64:%" PRId64 " uint64:%" PRIu64,
-                 v.fmt_int64, addr, icount_, v.fmt_int64, v.fmt_int64);
-        break;
-      case DOUBLE:
-        SNPrintF(trace_buf_, "%016" PRIx64 " <-- [%08" PRIx32 "]    (%" PRIu64
-                             ")    dbl:%e",
-                 v.fmt_int64, addr, icount_, v.fmt_double);
-        break;
-      case FLOAT_DOUBLE:
-        SNPrintF(trace_buf_, "%08" PRIx32 " <-- [%08" PRIx32 "]    (%" PRIu64
-                             ")    flt:%e dbl:%e",
-                 v.fmt_int32[1], addr, icount_, v.fmt_float[1], v.fmt_double);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  }
-}
-
-void Simulator::TraceMemWr(int32_t addr, int64_t value, TraceType t) {
-  if (::v8::internal::FLAG_trace_sim) {
-    switch (t) {
-      case DWORD:
-        SNPrintF(trace_buf_,
-                 "%016" PRIx64 " --> [%08" PRIx32 "]    (%" PRIu64 ")", value,
-                 addr, icount_);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  }
-}
-
-int Simulator::ReadW(int32_t addr, Instruction* instr, TraceType t) {
-  if (addr >=0 && addr < 0x400) {
-    // This has to be a nullptr-dereference, drop into debugger.
-    PrintF("Memory read from bad address: 0x%08x, pc=0x%08" PRIxPTR "\n", addr,
-           reinterpret_cast<intptr_t>(instr));
-    MipsDebugger dbg(this);
-    dbg.Debug();
-  }
-  if ((addr & kPointerAlignmentMask) == 0 || IsMipsArchVariant(kMips32r6)) {
-    intptr_t* ptr = reinterpret_cast<intptr_t*>(addr);
-    switch (t) {
-      case WORD:
-        TraceMemRd(addr, static_cast<int32_t>(*ptr), t);
-        break;
-      case FLOAT:
-        // This TraceType is allowed but tracing for this value will be omitted.
-        break;
-      default:
-        UNREACHABLE();
-    }
-    return *ptr;
-  }
-  PrintF("Unaligned read at 0x%08x, pc=0x%08" V8PRIxPTR "\n",
-         addr,
-         reinterpret_cast<intptr_t>(instr));
-  MipsDebugger dbg(this);
-  dbg.Debug();
-  return 0;
-}
-
-void Simulator::WriteW(int32_t addr, int value, Instruction* instr) {
-  if (addr >= 0 && addr < 0x400) {
-    // This has to be a nullptr-dereference, drop into debugger.
-    PrintF("Memory write to bad address: 0x%08x, pc=0x%08" PRIxPTR "\n", addr,
-           reinterpret_cast<intptr_t>(instr));
-    MipsDebugger dbg(this);
-    dbg.Debug();
-  }
-  if ((addr & kPointerAlignmentMask) == 0 || IsMipsArchVariant(kMips32r6)) {
-    intptr_t* ptr = reinterpret_cast<intptr_t*>(addr);
-    TraceMemWr(addr, value, WORD);
-    *ptr = value;
-    return;
-  }
-  PrintF("Unaligned write at 0x%08x, pc=0x%08" V8PRIxPTR "\n",
-         addr,
-         reinterpret_cast<intptr_t>(instr));
-  MipsDebugger dbg(this);
-  dbg.Debug();
-}
-
-double Simulator::ReadD(int32_t addr, Instruction* instr) {
-  if ((addr & kDoubleAlignmentMask) == 0 || IsMipsArchVariant(kMips32r6)) {
-    double* ptr = reinterpret_cast<double*>(addr);
-    return *ptr;
-  }
-  PrintF("Unaligned (double) read at 0x%08x, pc=0x%08" V8PRIxPTR "\n",
-         addr,
-         reinterpret_cast<intptr_t>(instr));
-  base::OS::Abort();
-  return 0;
-}
-
-
-void Simulator::WriteD(int32_t addr, double value, Instruction* instr) {
-  if ((addr & kDoubleAlignmentMask) == 0 || IsMipsArchVariant(kMips32r6)) {
-    double* ptr = reinterpret_cast<double*>(addr);
-    *ptr = value;
-    return;
-  }
-  PrintF("Unaligned (double) write at 0x%08x, pc=0x%08" V8PRIxPTR "\n",
-         addr,
-         reinterpret_cast<intptr_t>(instr));
-  base::OS::Abort();
-}
-
-
-uint16_t Simulator::ReadHU(int32_t addr, Instruction* instr) {
-  if ((addr & 1) == 0 || IsMipsArchVariant(kMips32r6)) {
-    uint16_t* ptr = reinterpret_cast<uint16_t*>(addr);
-    TraceMemRd(addr, static_cast<int32_t>(*ptr));
-    return *ptr;
-  }
-  PrintF("Unaligned unsigned halfword read at 0x%08x, pc=0x%08" V8PRIxPTR "\n",
-         addr,
-         reinterpret_cast<intptr_t>(instr));
-  base::OS::Abort();
-  return 0;
-}
-
-
-int16_t Simulator::ReadH(int32_t addr, Instruction* instr) {
-  if ((addr & 1) == 0 || IsMipsArchVariant(kMips32r6)) {
-    int16_t* ptr = reinterpret_cast<int16_t*>(addr);
-    TraceMemRd(addr, static_cast<int32_t>(*ptr));
-    return *ptr;
-  }
-  PrintF("Unaligned signed halfword read at 0x%08x, pc=0x%08" V8PRIxPTR "\n",
-         addr,
-         reinterpret_cast<intptr_t>(instr));
-  base::OS::Abort();
-  return 0;
-}
-
-
-void Simulator::WriteH(int32_t addr, uint16_t value, Instruction* instr) {
-  if ((addr & 1) == 0 || IsMipsArchVariant(kMips32r6)) {
-    uint16_t* ptr = reinterpret_cast<uint16_t*>(addr);
-    TraceMemWr(addr, value, HALF);
-    *ptr = value;
-    return;
-  }
-  PrintF("Unaligned unsigned halfword write at 0x%08x, pc=0x%08" V8PRIxPTR "\n",
-         addr,
-         reinterpret_cast<intptr_t>(instr));
-  base::OS::Abort();
-}
-
-
-void Simulator::WriteH(int32_t addr, int16_t value, Instruction* instr) {
-  if ((addr & 1) == 0 || IsMipsArchVariant(kMips32r6)) {
-    int16_t* ptr = reinterpret_cast<int16_t*>(addr);
-    TraceMemWr(addr, value, HALF);
-    *ptr = value;
-    return;
-  }
-  PrintF("Unaligned halfword write at 0x%08x, pc=0x%08" V8PRIxPTR "\n",
-         addr,
-         reinterpret_cast<intptr_t>(instr));
-  base::OS::Abort();
-}
-
-
-uint32_t Simulator::ReadBU(int32_t addr) {
-  uint8_t* ptr = reinterpret_cast<uint8_t*>(addr);
-  TraceMemRd(addr, static_cast<int32_t>(*ptr));
-  return *ptr & 0xFF;
-}
-
-
-int32_t Simulator::ReadB(int32_t addr) {
-  int8_t* ptr = reinterpret_cast<int8_t*>(addr);
-  TraceMemRd(addr, static_cast<int32_t>(*ptr));
-  return *ptr;
-}
-
-
-void Simulator::WriteB(int32_t addr, uint8_t value) {
-  uint8_t* ptr = reinterpret_cast<uint8_t*>(addr);
-  TraceMemWr(addr, value, BYTE);
-  *ptr = value;
-}
-
-
-void Simulator::WriteB(int32_t addr, int8_t value) {
-  int8_t* ptr = reinterpret_cast<int8_t*>(addr);
-  TraceMemWr(addr, value, BYTE);
-  *ptr = value;
-}
-
-template <typename T>
-T Simulator::ReadMem(int32_t addr, Instruction* instr) {
-  int alignment_mask = (1 << sizeof(T)) - 1;
-  if ((addr & alignment_mask) == 0 || IsMipsArchVariant(kMips32r6)) {
-    T* ptr = reinterpret_cast<T*>(addr);
-    TraceMemRd(addr, *ptr);
-    return *ptr;
-  }
-  PrintF("Unaligned read of type sizeof(%d) at 0x%08x, pc=0x%08" V8PRIxPTR "\n",
-         sizeof(T), addr, reinterpret_cast<intptr_t>(instr));
-  base::OS::Abort();
-  return 0;
-}
-
-template <typename T>
-void Simulator::WriteMem(int32_t addr, T value, Instruction* instr) {
-  int alignment_mask = (1 << sizeof(T)) - 1;
-  if ((addr & alignment_mask) == 0 || IsMipsArchVariant(kMips32r6)) {
-    T* ptr = reinterpret_cast<T*>(addr);
-    *ptr = value;
-    TraceMemWr(addr, value);
-    return;
-  }
-  PrintF("Unaligned write of type sizeof(%d) at 0x%08x, pc=0x%08" V8PRIxPTR
-         "\n",
-         sizeof(T), addr, reinterpret_cast<intptr_t>(instr));
-  base::OS::Abort();
-}
-
-// Returns the limit of the stack area to enable checking for stack overflows.
-uintptr_t Simulator::StackLimit(uintptr_t c_limit) const {
-  // The simulator uses a separate JS stack. If we have exhausted the C stack,
-  // we also drop down the JS limit to reflect the exhaustion on the JS stack.
-  if (GetCurrentStackPosition() < c_limit) {
-    return reinterpret_cast<uintptr_t>(get_sp());
-  }
-
-  // Otherwise the limit is the JS stack. Leave a safety margin of 1024 bytes
-  // to prevent overrunning the stack when pushing values.
-  return reinterpret_cast<uintptr_t>(stack_) + 1024;
-}
-
-
-// Unsupported instructions use Format to print an error and stop execution.
-void Simulator::Format(Instruction* instr, const char* format) {
-  PrintF("Simulator found unsupported instruction:\n 0x%08" PRIxPTR ": %s\n",
-         reinterpret_cast<intptr_t>(instr), format);
-  UNIMPLEMENTED_MIPS();
-}
-
-
-// Calls into the V8 runtime are based on this very simple interface.
-// Note: To be able to return two values from some calls the code in runtime.cc
-// uses the ObjectPair which is essentially two 32-bit values stuffed into a
-// 64-bit value. With the code below we assume that all runtime calls return
-// 64 bits of result. If they don't, the v1 result register contains a bogus
-// value, which is fine because it is caller-saved.
-typedef int64_t (*SimulatorRuntimeCall)(int32_t arg0, int32_t arg1,
-                                        int32_t arg2, int32_t arg3,
-                                        int32_t arg4, int32_t arg5,
-                                        int32_t arg6, int32_t arg7,
-                                        int32_t arg8);
-
-// These prototypes handle the four types of FP calls.
-typedef int64_t (*SimulatorRuntimeCompareCall)(double darg0, double darg1);
-typedef double (*SimulatorRuntimeFPFPCall)(double darg0, double darg1);
-typedef double (*SimulatorRuntimeFPCall)(double darg0);
-typedef double (*SimulatorRuntimeFPIntCall)(double darg0, int32_t arg0);
-
-// This signature supports direct call in to API function native callback
-// (refer to InvocationCallback in v8.h).
-typedef void (*SimulatorRuntimeDirectApiCall)(int32_t arg0);
-typedef void (*SimulatorRuntimeProfilingApiCall)(int32_t arg0, void* arg1);
-
-// This signature supports direct call to accessor getter callback.
-typedef void (*SimulatorRuntimeDirectGetterCall)(int32_t arg0, int32_t arg1);
-typedef void (*SimulatorRuntimeProfilingGetterCall)(
-    int32_t arg0, int32_t arg1, void* arg2);
-
-// Software interrupt instructions are used by the simulator to call into the
-// C-based V8 runtime. They are also used for debugging with simulator.
-void Simulator::SoftwareInterrupt() {
-  // There are several instructions that could get us here,
-  // the break_ instruction, or several variants of traps. All
-  // Are "SPECIAL" class opcode, and are distinuished by function.
-  int32_t func = instr_.FunctionFieldRaw();
-  uint32_t code = (func == BREAK) ? instr_.Bits(25, 6) : -1;
-
-  // We first check if we met a call_rt_redirected.
-  if (instr_.InstructionBits() == rtCallRedirInstr) {
-    Redirection* redirection = Redirection::FromInstruction(instr_.instr());
-    int32_t arg0 = get_register(a0);
-    int32_t arg1 = get_register(a1);
-    int32_t arg2 = get_register(a2);
-    int32_t arg3 = get_register(a3);
-
-    int32_t* stack_pointer = reinterpret_cast<int32_t*>(get_register(sp));
-    // Args 4 and 5 are on the stack after the reserved space for args 0..3.
-    int32_t arg4 = stack_pointer[4];
-    int32_t arg5 = stack_pointer[5];
-    int32_t arg6 = stack_pointer[6];
-    int32_t arg7 = stack_pointer[7];
-    int32_t arg8 = stack_pointer[8];
-    STATIC_ASSERT(kMaxCParameters == 9);
-
-    bool fp_call =
-         (redirection->type() == ExternalReference::BUILTIN_FP_FP_CALL) ||
-         (redirection->type() == ExternalReference::BUILTIN_COMPARE_CALL) ||
-         (redirection->type() == ExternalReference::BUILTIN_FP_CALL) ||
-         (redirection->type() == ExternalReference::BUILTIN_FP_INT_CALL);
-
-    if (!IsMipsSoftFloatABI) {
-      // With the hard floating point calling convention, double
-      // arguments are passed in FPU registers. Fetch the arguments
-      // from there and call the builtin using soft floating point
-      // convention.
-      switch (redirection->type()) {
-      case ExternalReference::BUILTIN_FP_FP_CALL:
-      case ExternalReference::BUILTIN_COMPARE_CALL:
-        if (IsFp64Mode()) {
-          arg0 = get_fpu_register_word(f12);
-          arg1 = get_fpu_register_hi_word(f12);
-          arg2 = get_fpu_register_word(f14);
-          arg3 = get_fpu_register_hi_word(f14);
-        } else {
-          arg0 = get_fpu_register_word(f12);
-          arg1 = get_fpu_register_word(f13);
-          arg2 = get_fpu_register_word(f14);
-          arg3 = get_fpu_register_word(f15);
-        }
-        break;
-      case ExternalReference::BUILTIN_FP_CALL:
-        if (IsFp64Mode()) {
-          arg0 = get_fpu_register_word(f12);
-          arg1 = get_fpu_register_hi_word(f12);
-        } else {
-          arg0 = get_fpu_register_word(f12);
-          arg1 = get_fpu_register_word(f13);
-        }
-        break;
-      case ExternalReference::BUILTIN_FP_INT_CALL:
-        if (IsFp64Mode()) {
-          arg0 = get_fpu_register_word(f12);
-          arg1 = get_fpu_register_hi_word(f12);
-        } else {
-          arg0 = get_fpu_register_word(f12);
-          arg1 = get_fpu_register_word(f13);
-        }
-        arg2 = get_register(a2);
-        break;
-      default:
-        break;
-      }
-    }
-
-    // This is dodgy but it works because the C entry stubs are never moved.
-    // See comment in codegen-arm.cc and bug 1242173.
-    int32_t saved_ra = get_register(ra);
-
-    intptr_t external =
-          reinterpret_cast<intptr_t>(redirection->external_function());
-
-    // Based on CpuFeatures::IsSupported(FPU), Mips will use either hardware
-    // FPU, or gcc soft-float routines. Hardware FPU is simulated in this
-    // simulator. Soft-float has additional abstraction of ExternalReference,
-    // to support serialization.
-    if (fp_call) {
-      double dval0, dval1;  // one or two double parameters
-      int32_t ival;         // zero or one integer parameters
-      int64_t iresult = 0;  // integer return value
-      double dresult = 0;   // double return value
-      GetFpArgs(&dval0, &dval1, &ival);
-      SimulatorRuntimeCall generic_target =
-          reinterpret_cast<SimulatorRuntimeCall>(external);
-      if (::v8::internal::FLAG_trace_sim) {
-        switch (redirection->type()) {
-          case ExternalReference::BUILTIN_FP_FP_CALL:
-          case ExternalReference::BUILTIN_COMPARE_CALL:
-            PrintF("Call to host function at %p with args %f, %f",
-                   static_cast<void*>(FUNCTION_ADDR(generic_target)), dval0,
-                   dval1);
-            break;
-          case ExternalReference::BUILTIN_FP_CALL:
-            PrintF("Call to host function at %p with arg %f",
-                   static_cast<void*>(FUNCTION_ADDR(generic_target)), dval0);
-            break;
-          case ExternalReference::BUILTIN_FP_INT_CALL:
-            PrintF("Call to host function at %p with args %f, %d",
-                   static_cast<void*>(FUNCTION_ADDR(generic_target)), dval0,
-                   ival);
-            break;
-          default:
-            UNREACHABLE();
-            break;
-        }
-      }
-      switch (redirection->type()) {
-      case ExternalReference::BUILTIN_COMPARE_CALL: {
-        SimulatorRuntimeCompareCall target =
-          reinterpret_cast<SimulatorRuntimeCompareCall>(external);
-        iresult = target(dval0, dval1);
-        set_register(v0, static_cast<int32_t>(iresult));
-        set_register(v1, static_cast<int32_t>(iresult >> 32));
-        break;
-      }
-      case ExternalReference::BUILTIN_FP_FP_CALL: {
-        SimulatorRuntimeFPFPCall target =
-          reinterpret_cast<SimulatorRuntimeFPFPCall>(external);
-        dresult = target(dval0, dval1);
-        SetFpResult(dresult);
-        break;
-      }
-      case ExternalReference::BUILTIN_FP_CALL: {
-        SimulatorRuntimeFPCall target =
-          reinterpret_cast<SimulatorRuntimeFPCall>(external);
-        dresult = target(dval0);
-        SetFpResult(dresult);
-        break;
-      }
-      case ExternalReference::BUILTIN_FP_INT_CALL: {
-        SimulatorRuntimeFPIntCall target =
-          reinterpret_cast<SimulatorRuntimeFPIntCall>(external);
-        dresult = target(dval0, ival);
-        SetFpResult(dresult);
-        break;
-      }
-      default:
-        UNREACHABLE();
-        break;
-      }
-      if (::v8::internal::FLAG_trace_sim) {
-        switch (redirection->type()) {
-        case ExternalReference::BUILTIN_COMPARE_CALL:
-          PrintF("Returned %08x\n", static_cast<int32_t>(iresult));
-          break;
-        case ExternalReference::BUILTIN_FP_FP_CALL:
-        case ExternalReference::BUILTIN_FP_CALL:
-        case ExternalReference::BUILTIN_FP_INT_CALL:
-          PrintF("Returned %f\n", dresult);
-          break;
-        default:
-          UNREACHABLE();
-          break;
-        }
-      }
-    } else if (redirection->type() == ExternalReference::DIRECT_API_CALL) {
-      if (::v8::internal::FLAG_trace_sim) {
-        PrintF("Call to host function at %p args %08x\n",
-            reinterpret_cast<void*>(external), arg0);
-      }
-      SimulatorRuntimeDirectApiCall target =
-          reinterpret_cast<SimulatorRuntimeDirectApiCall>(external);
-      target(arg0);
-    } else if (
-        redirection->type() == ExternalReference::PROFILING_API_CALL) {
-      if (::v8::internal::FLAG_trace_sim) {
-        PrintF("Call to host function at %p args %08x %08x\n",
-            reinterpret_cast<void*>(external), arg0, arg1);
-      }
-      SimulatorRuntimeProfilingApiCall target =
-          reinterpret_cast<SimulatorRuntimeProfilingApiCall>(external);
-      target(arg0, Redirection::ReverseRedirection(arg1));
-    } else if (
-        redirection->type() == ExternalReference::DIRECT_GETTER_CALL) {
-      if (::v8::internal::FLAG_trace_sim) {
-        PrintF("Call to host function at %p args %08x %08x\n",
-            reinterpret_cast<void*>(external), arg0, arg1);
-      }
-      SimulatorRuntimeDirectGetterCall target =
-          reinterpret_cast<SimulatorRuntimeDirectGetterCall>(external);
-      target(arg0, arg1);
-    } else if (
-        redirection->type() == ExternalReference::PROFILING_GETTER_CALL) {
-      if (::v8::internal::FLAG_trace_sim) {
-        PrintF("Call to host function at %p args %08x %08x %08x\n",
-            reinterpret_cast<void*>(external), arg0, arg1, arg2);
-      }
-      SimulatorRuntimeProfilingGetterCall target =
-          reinterpret_cast<SimulatorRuntimeProfilingGetterCall>(external);
-      target(arg0, arg1, Redirection::ReverseRedirection(arg2));
-    } else {
-      DCHECK(redirection->type() == ExternalReference::BUILTIN_CALL ||
-             redirection->type() == ExternalReference::BUILTIN_CALL_PAIR);
-      SimulatorRuntimeCall target =
-                  reinterpret_cast<SimulatorRuntimeCall>(external);
-      if (::v8::internal::FLAG_trace_sim) {
-        PrintF(
-            "Call to host function at %p "
-            "args %08x, %08x, %08x, %08x, %08x, %08x, %08x, %08x, %08x\n",
-            static_cast<void*>(FUNCTION_ADDR(target)), arg0, arg1, arg2, arg3,
-            arg4, arg5, arg6, arg7, arg8);
-      }
-      int64_t result =
-          target(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
-      set_register(v0, static_cast<int32_t>(result));
-      set_register(v1, static_cast<int32_t>(result >> 32));
-    }
-    if (::v8::internal::FLAG_trace_sim) {
-      PrintF("Returned %08x : %08x\n", get_register(v1), get_register(v0));
-    }
-    set_register(ra, saved_ra);
-    set_pc(get_register(ra));
-
-  } else if (func == BREAK && code <= kMaxStopCode) {
-    if (IsWatchpoint(code)) {
-      PrintWatchpoint(code);
-    } else {
-      IncreaseStopCounter(code);
-      HandleStop(code, instr_.instr());
-    }
-  } else {
-    // All remaining break_ codes, and all traps are handled here.
-    MipsDebugger dbg(this);
-    dbg.Debug();
-  }
-}
-
-
-// Stop helper functions.
-bool Simulator::IsWatchpoint(uint32_t code) {
-  return (code <= kMaxWatchpointCode);
-}
-
-
-void Simulator::PrintWatchpoint(uint32_t code) {
-  MipsDebugger dbg(this);
-  ++break_count_;
-  PrintF("\n---- break %d marker: %3d  (instr count: %" PRIu64
-         ") ----------"
-         "----------------------------------",
-         code, break_count_, icount_);
-  dbg.PrintAllRegs();  // Print registers and continue running.
-}
-
-
-void Simulator::HandleStop(uint32_t code, Instruction* instr) {
-  // Stop if it is enabled, otherwise go on jumping over the stop
-  // and the message address.
-  if (IsEnabledStop(code)) {
-    MipsDebugger dbg(this);
-    dbg.Stop(instr);
-  }
-}
-
-
-bool Simulator::IsStopInstruction(Instruction* instr) {
-  int32_t func = instr->FunctionFieldRaw();
-  uint32_t code = static_cast<uint32_t>(instr->Bits(25, 6));
-  return (func == BREAK) && code > kMaxWatchpointCode && code <= kMaxStopCode;
-}
-
-
-bool Simulator::IsEnabledStop(uint32_t code) {
-  DCHECK_LE(code, kMaxStopCode);
-  DCHECK_GT(code, kMaxWatchpointCode);
-  return !(watched_stops_[code].count & kStopDisabledBit);
-}
-
-
-void Simulator::EnableStop(uint32_t code) {
-  if (!IsEnabledStop(code)) {
-    watched_stops_[code].count &= ~kStopDisabledBit;
-  }
-}
-
-
-void Simulator::DisableStop(uint32_t code) {
-  if (IsEnabledStop(code)) {
-    watched_stops_[code].count |= kStopDisabledBit;
-  }
-}
-
-
-void Simulator::IncreaseStopCounter(uint32_t code) {
-  DCHECK_LE(code, kMaxStopCode);
-  if ((watched_stops_[code].count & ~(1 << 31)) == 0x7FFFFFFF) {
-    PrintF("Stop counter for code %i has overflowed.\n"
-           "Enabling this code and reseting the counter to 0.\n", code);
-    watched_stops_[code].count = 0;
-    EnableStop(code);
-  } else {
-    watched_stops_[code].count++;
-  }
-}
-
-
-// Print a stop status.
-void Simulator::PrintStopInfo(uint32_t code) {
-  if (code <= kMaxWatchpointCode) {
-    PrintF("That is a watchpoint, not a stop.\n");
-    return;
-  } else if (code > kMaxStopCode) {
-    PrintF("Code too large, only %u stops can be used\n", kMaxStopCode + 1);
-    return;
-  }
-  const char* state = IsEnabledStop(code) ? "Enabled" : "Disabled";
-  int32_t count = watched_stops_[code].count & ~kStopDisabledBit;
-  // Don't print the state of unused breakpoints.
-  if (count != 0) {
-    if (watched_stops_[code].desc) {
-      PrintF("stop %i - 0x%x: \t%s, \tcounter = %i, \t%s\n",
-             code, code, state, count, watched_stops_[code].desc);
-    } else {
-      PrintF("stop %i - 0x%x: \t%s, \tcounter = %i\n",
-             code, code, state, count);
-    }
-  }
-}
-
-
-void Simulator::SignalException(Exception e) {
-  V8_Fatal(__FILE__, __LINE__, "Error: Exception %i raised.",
-           static_cast<int>(e));
-}
-
-// Min/Max template functions for Double and Single arguments.
-
-template <typename T>
-static T FPAbs(T a);
-
-template <>
-double FPAbs<double>(double a) {
-  return fabs(a);
-}
-
-template <>
-float FPAbs<float>(float a) {
-  return fabsf(a);
-}
-
-template <typename T>
-static bool FPUProcessNaNsAndZeros(T a, T b, MaxMinKind kind, T& result) {
-  if (std::isnan(a) && std::isnan(b)) {
-    result = a;
-  } else if (std::isnan(a)) {
-    result = b;
-  } else if (std::isnan(b)) {
-    result = a;
-  } else if (b == a) {
-    // Handle -0.0 == 0.0 case.
-    // std::signbit() returns int 0 or 1 so subtracting MaxMinKind::kMax
-    // negates the result.
-    result = std::signbit(b) - static_cast<int>(kind) ? b : a;
-  } else {
-    return false;
-  }
-  return true;
-}
-
-template <typename T>
-static T FPUMin(T a, T b) {
-  T result;
-  if (FPUProcessNaNsAndZeros(a, b, MaxMinKind::kMin, result)) {
-    return result;
-  } else {
-    return b < a ? b : a;
-  }
-}
-
-template <typename T>
-static T FPUMax(T a, T b) {
-  T result;
-  if (FPUProcessNaNsAndZeros(a, b, MaxMinKind::kMax, result)) {
-    return result;
-  } else {
-    return b > a ? b : a;
-  }
-}
-
-template <typename T>
-static T FPUMinA(T a, T b) {
-  T result;
-  if (!FPUProcessNaNsAndZeros(a, b, MaxMinKind::kMin, result)) {
-    if (FPAbs(a) < FPAbs(b)) {
-      result = a;
-    } else if (FPAbs(b) < FPAbs(a)) {
-      result = b;
-    } else {
-      result = a < b ? a : b;
-    }
-  }
-  return result;
-}
-
-template <typename T>
-static T FPUMaxA(T a, T b) {
-  T result;
-  if (!FPUProcessNaNsAndZeros(a, b, MaxMinKind::kMin, result)) {
-    if (FPAbs(a) > FPAbs(b)) {
-      result = a;
-    } else if (FPAbs(b) > FPAbs(a)) {
-      result = b;
-    } else {
-      result = a > b ? a : b;
-    }
-  }
-  return result;
-}
-
-enum class KeepSign : bool { no = false, yes };
-
-template <typename T, typename std::enable_if<std::is_floating_point<T>::value,
-                                              int>::type = 0>
-T FPUCanonalizeNaNArg(T result, T arg, KeepSign keepSign = KeepSign::no) {
-  DCHECK(std::isnan(arg));
-  T qNaN = std::numeric_limits<T>::quiet_NaN();
-  if (keepSign == KeepSign::yes) {
-    return std::copysign(qNaN, result);
-  }
-  return qNaN;
-}
-
-template <typename T>
-T FPUCanonalizeNaNArgs(T result, KeepSign keepSign, T first) {
-  if (std::isnan(first)) {
-    return FPUCanonalizeNaNArg(result, first, keepSign);
-  }
-  return result;
-}
-
-template <typename T, typename... Args>
-T FPUCanonalizeNaNArgs(T result, KeepSign keepSign, T first, Args... args) {
-  if (std::isnan(first)) {
-    return FPUCanonalizeNaNArg(result, first, keepSign);
-  }
-  return FPUCanonalizeNaNArgs(result, keepSign, args...);
-}
-
-template <typename Func, typename T, typename... Args>
-T FPUCanonalizeOperation(Func f, T first, Args... args) {
-  return FPUCanonalizeOperation(f, KeepSign::no, first, args...);
-}
-
-template <typename Func, typename T, typename... Args>
-T FPUCanonalizeOperation(Func f, KeepSign keepSign, T first, Args... args) {
-  T result = f(first, args...);
-  if (std::isnan(result)) {
-    result = FPUCanonalizeNaNArgs(result, keepSign, first, args...);
-  }
-  return result;
-}
-
-// Handle execution based on instruction types.
-
-void Simulator::DecodeTypeRegisterDRsType() {
-  double ft, fs, fd;
-  uint32_t cc, fcsr_cc;
-  int64_t i64;
-  fs = get_fpu_register_double(fs_reg());
-  ft = (instr_.FunctionFieldRaw() != MOVF) ? get_fpu_register_double(ft_reg())
-                                           : 0.0;
-  fd = get_fpu_register_double(fd_reg());
-  int64_t ft_int = bit_cast<int64_t>(ft);
-  int64_t fd_int = bit_cast<int64_t>(fd);
-  cc = instr_.FCccValue();
-  fcsr_cc = get_fcsr_condition_bit(cc);
-  switch (instr_.FunctionFieldRaw()) {
-    case RINT: {
-      DCHECK(IsMipsArchVariant(kMips32r6));
-      double result, temp, temp_result;
-      double upper = std::ceil(fs);
-      double lower = std::floor(fs);
-      switch (get_fcsr_rounding_mode()) {
-        case kRoundToNearest:
-          if (upper - fs < fs - lower) {
-            result = upper;
-          } else if (upper - fs > fs - lower) {
-            result = lower;
-          } else {
-            temp_result = upper / 2;
-            double reminder = modf(temp_result, &temp);
-            if (reminder == 0) {
-              result = upper;
-            } else {
-              result = lower;
-            }
-          }
-          break;
-        case kRoundToZero:
-          result = (fs > 0 ? lower : upper);
-          break;
-        case kRoundToPlusInf:
-          result = upper;
-          break;
-        case kRoundToMinusInf:
-          result = lower;
-          break;
-      }
-      SetFPUDoubleResult(fd_reg(), result);
-      if (result != fs) {
-        set_fcsr_bit(kFCSRInexactFlagBit, true);
-      }
-      break;
-    }
-    case SEL:
-      DCHECK(IsMipsArchVariant(kMips32r6));
-      SetFPUDoubleResult(fd_reg(), (fd_int & 0x1) == 0 ? fs : ft);
-      break;
-    case SELEQZ_C:
-      DCHECK(IsMipsArchVariant(kMips32r6));
-      SetFPUDoubleResult(fd_reg(), (ft_int & 0x1) == 0 ? fs : 0.0);
-      break;
-    case SELNEZ_C:
-      DCHECK(IsMipsArchVariant(kMips32r6));
-      SetFPUDoubleResult(fd_reg(), (ft_int & 0x1) != 0 ? fs : 0.0);
-      break;
-    case MOVZ_C: {
-      DCHECK(IsMipsArchVariant(kMips32r2));
-      if (rt() == 0) {
-        SetFPUDoubleResult(fd_reg(), fs);
-      }
-      break;
-    }
-    case MOVN_C: {
-      DCHECK(IsMipsArchVariant(kMips32r2));
-      int32_t rt_reg = instr_.RtValue();
-      int32_t rt = get_register(rt_reg);
-      if (rt != 0) {
-        SetFPUDoubleResult(fd_reg(), fs);
-      }
-      break;
-    }
-    case MOVF: {
-      // Same function field for MOVT.D and MOVF.D
-      uint32_t ft_cc = (ft_reg() >> 2) & 0x7;
-      ft_cc = get_fcsr_condition_bit(ft_cc);
-      if (instr_.Bit(16)) {  // Read Tf bit.
-        // MOVT.D
-        if (test_fcsr_bit(ft_cc)) SetFPUDoubleResult(fd_reg(), fs);
-      } else {
-        // MOVF.D
-        if (!test_fcsr_bit(ft_cc)) SetFPUDoubleResult(fd_reg(), fs);
-      }
-      break;
-    }
-    case MIN:
-      DCHECK(IsMipsArchVariant(kMips32r6));
-      SetFPUDoubleResult(fd_reg(), FPUMin(ft, fs));
-      break;
-    case MAX:
-      DCHECK(IsMipsArchVariant(kMips32r6));
-      SetFPUDoubleResult(fd_reg(), FPUMax(ft, fs));
-      break;
-    case MINA:
-      DCHECK(IsMipsArchVariant(kMips32r6));
-      SetFPUDoubleResult(fd_reg(), FPUMinA(ft, fs));
-      break;
-    case MAXA:
-      DCHECK(IsMipsArchVariant(kMips32r6));
-      SetFPUDoubleResult(fd_reg(), FPUMaxA(ft, fs));
-      break;
-    case ADD_D:
-      SetFPUDoubleResult(
-          fd_reg(),
-          FPUCanonalizeOperation(
-              [](double lhs, double rhs) { return lhs + rhs; }, fs, ft));
-      break;
-    case SUB_D:
-      SetFPUDoubleResult(
-          fd_reg(),
-          FPUCanonalizeOperation(
-              [](double lhs, double rhs) { return lhs - rhs; }, fs, ft));
-      break;
-    case MADDF_D:
-      DCHECK(IsMipsArchVariant(kMips32r6));
-      SetFPUDoubleResult(fd_reg(), std::fma(fs, ft, fd));
-      break;
-    case MSUBF_D:
-      DCHECK(IsMipsArchVariant(kMips32r6));
-      SetFPUDoubleResult(fd_reg(), std::fma(-fs, ft, fd));
-      break;
-    case MUL_D:
-      SetFPUDoubleResult(
-          fd_reg(),
-          FPUCanonalizeOperation(
-              [](double lhs, double rhs) { return lhs * rhs; }, fs, ft));
-      break;
-    case DIV_D:
-      SetFPUDoubleResult(
-          fd_reg(),
-          FPUCanonalizeOperation(
-              [](double lhs, double rhs) { return lhs / rhs; }, fs, ft));
-      break;
-    case ABS_D:
-      SetFPUDoubleResult(
-          fd_reg(),
-          FPUCanonalizeOperation([](double fs) { return FPAbs(fs); }, fs));
-      break;
-    case MOV_D:
-      SetFPUDoubleResult(fd_reg(), fs);
-      break;
-    case NEG_D:
-      SetFPUDoubleResult(fd_reg(),
-                         FPUCanonalizeOperation([](double src) { return -src; },
-                                                KeepSign::yes, fs));
-      break;
-    case SQRT_D:
-      SetFPUDoubleResult(
-          fd_reg(),
-          FPUCanonalizeOperation([](double fs) { return std::sqrt(fs); }, fs));
-      break;
-    case RSQRT_D:
-      SetFPUDoubleResult(
-          fd_reg(), FPUCanonalizeOperation(
-                        [](double fs) { return 1.0 / std::sqrt(fs); }, fs));
-      break;
-    case RECIP_D:
-      SetFPUDoubleResult(fd_reg(), FPUCanonalizeOperation(
-                                       [](double fs) { return 1.0 / fs; }, fs));
-      break;
-    case C_UN_D:
-      set_fcsr_bit(fcsr_cc, std::isnan(fs) || std::isnan(ft));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case C_EQ_D:
-      set_fcsr_bit(fcsr_cc, (fs == ft));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case C_UEQ_D:
-      set_fcsr_bit(fcsr_cc, (fs == ft) || (std::isnan(fs) || std::isnan(ft)));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case C_OLT_D:
-      set_fcsr_bit(fcsr_cc, (fs < ft));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case C_ULT_D:
-      set_fcsr_bit(fcsr_cc, (fs < ft) || (std::isnan(fs) || std::isnan(ft)));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case C_OLE_D:
-      set_fcsr_bit(fcsr_cc, (fs <= ft));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case C_ULE_D:
-      set_fcsr_bit(fcsr_cc, (fs <= ft) || (std::isnan(fs) || std::isnan(ft)));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case CVT_W_D: {  // Convert double to word.
-      double rounded;
-      int32_t result;
-      round_according_to_fcsr(fs, rounded, result, fs);
-      SetFPUWordResult(fd_reg(), result);
-      if (set_fcsr_round_error(fs, rounded)) {
-        set_fpu_register_word_invalid_result(fs, rounded);
-      }
-    } break;
-    case ROUND_W_D:  // Round double to word (round half to even).
-    {
-      double rounded = std::floor(fs + 0.5);
-      int32_t result = static_cast<int32_t>(rounded);
-      if ((result & 1) != 0 && result - fs == 0.5) {
-        // If the number is halfway between two integers,
-        // round to the even one.
-        result--;
-      }
-      SetFPUWordResult(fd_reg(), result);
-      if (set_fcsr_round_error(fs, rounded)) {
-        set_fpu_register_word_invalid_result(fs, rounded);
-      }
-    } break;
-    case TRUNC_W_D:  // Truncate double to word (round towards 0).
-    {
-      double rounded = trunc(fs);
-      int32_t result = static_cast<int32_t>(rounded);
-      SetFPUWordResult(fd_reg(), result);
-      if (set_fcsr_round_error(fs, rounded)) {
-        set_fpu_register_word_invalid_result(fs, rounded);
-      }
-    } break;
-    case FLOOR_W_D:  // Round double to word towards negative infinity.
-    {
-      double rounded = std::floor(fs);
-      int32_t result = static_cast<int32_t>(rounded);
-      SetFPUWordResult(fd_reg(), result);
-      if (set_fcsr_round_error(fs, rounded)) {
-        set_fpu_register_word_invalid_result(fs, rounded);
-      }
-    } break;
-    case CEIL_W_D:  // Round double to word towards positive infinity.
-    {
-      double rounded = std::ceil(fs);
-      int32_t result = static_cast<int32_t>(rounded);
-      SetFPUWordResult(fd_reg(), result);
-      if (set_fcsr_round_error(fs, rounded)) {
-        set_fpu_register_word_invalid_result(fs, rounded);
-      }
-    } break;
-    case CVT_S_D:  // Convert double to float (single).
-      SetFPUFloatResult(fd_reg(), static_cast<float>(fs));
-      break;
-    case CVT_L_D: {  // Mips32r2: Truncate double to 64-bit long-word.
-      if (IsFp64Mode()) {
-        int64_t result;
-        double rounded;
-        round64_according_to_fcsr(fs, rounded, result, fs);
-        SetFPUResult(fd_reg(), result);
-        if (set_fcsr_round64_error(fs, rounded)) {
-          set_fpu_register_invalid_result64(fs, rounded);
-        }
-      } else {
-        UNSUPPORTED();
-      }
-      break;
-      break;
-    }
-    case TRUNC_L_D: {  // Mips32r2 instruction.
-      DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
-      double rounded = trunc(fs);
-      i64 = static_cast<int64_t>(rounded);
-      if (IsFp64Mode()) {
-        SetFPUResult(fd_reg(), i64);
-        if (set_fcsr_round64_error(fs, rounded)) {
-          set_fpu_register_invalid_result64(fs, rounded);
-        }
-      } else {
-        UNSUPPORTED();
-      }
-      break;
-    }
-    case ROUND_L_D: {  // Mips32r2 instruction.
-      DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
-      double rounded = std::floor(fs + 0.5);
-      int64_t result = static_cast<int64_t>(rounded);
-      if ((result & 1) != 0 && result - fs == 0.5) {
-        // If the number is halfway between two integers,
-        // round to the even one.
-        result--;
-      }
-      int64_t i64 = static_cast<int64_t>(result);
-      if (IsFp64Mode()) {
-        SetFPUResult(fd_reg(), i64);
-        if (set_fcsr_round64_error(fs, rounded)) {
-          set_fpu_register_invalid_result64(fs, rounded);
-        }
-      } else {
-        UNSUPPORTED();
-      }
-      break;
-    }
-    case FLOOR_L_D: {  // Mips32r2 instruction.
-      DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
-      double rounded = std::floor(fs);
-      int64_t i64 = static_cast<int64_t>(rounded);
-      if (IsFp64Mode()) {
-        SetFPUResult(fd_reg(), i64);
-        if (set_fcsr_round64_error(fs, rounded)) {
-          set_fpu_register_invalid_result64(fs, rounded);
-        }
-      } else {
-        UNSUPPORTED();
-      }
-      break;
-    }
-    case CEIL_L_D: {  // Mips32r2 instruction.
-      DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
-      double rounded = std::ceil(fs);
-      int64_t i64 = static_cast<int64_t>(rounded);
-      if (IsFp64Mode()) {
-        SetFPUResult(fd_reg(), i64);
-        if (set_fcsr_round64_error(fs, rounded)) {
-          set_fpu_register_invalid_result64(fs, rounded);
-        }
-      } else {
-        UNSUPPORTED();
-      }
-      break;
-    }
-    case CLASS_D: {  // Mips32r6 instruction
-      // Convert double input to uint64_t for easier bit manipulation
-      uint64_t classed = bit_cast<uint64_t>(fs);
-
-      // Extracting sign, exponent and mantissa from the input double
-      uint32_t sign = (classed >> 63) & 1;
-      uint32_t exponent = (classed >> 52) & 0x00000000000007FF;
-      uint64_t mantissa = classed & 0x000FFFFFFFFFFFFF;
-      uint64_t result;
-      double dResult;
-
-      // Setting flags if input double is negative infinity,
-      // positive infinity, negative zero or positive zero
-      bool negInf = (classed == 0xFFF0000000000000);
-      bool posInf = (classed == 0x7FF0000000000000);
-      bool negZero = (classed == 0x8000000000000000);
-      bool posZero = (classed == 0x0000000000000000);
-
-      bool signalingNan;
-      bool quietNan;
-      bool negSubnorm;
-      bool posSubnorm;
-      bool negNorm;
-      bool posNorm;
-
-      // Setting flags if double is NaN
-      signalingNan = false;
-      quietNan = false;
-      if (!negInf && !posInf && exponent == 0x7FF) {
-        quietNan = ((mantissa & 0x0008000000000000) != 0) &&
-                   ((mantissa & (0x0008000000000000 - 1)) == 0);
-        signalingNan = !quietNan;
-      }
-
-      // Setting flags if double is subnormal number
-      posSubnorm = false;
-      negSubnorm = false;
-      if ((exponent == 0) && (mantissa != 0)) {
-        DCHECK(sign == 0 || sign == 1);
-        posSubnorm = (sign == 0);
-        negSubnorm = (sign == 1);
-      }
-
-      // Setting flags if double is normal number
-      posNorm = false;
-      negNorm = false;
-      if (!posSubnorm && !negSubnorm && !posInf && !negInf && !signalingNan &&
-          !quietNan && !negZero && !posZero) {
-        DCHECK(sign == 0 || sign == 1);
-        posNorm = (sign == 0);
-        negNorm = (sign == 1);
-      }
-
-      // Calculating result according to description of CLASS.D instruction
-      result = (posZero << 9) | (posSubnorm << 8) | (posNorm << 7) |
-               (posInf << 6) | (negZero << 5) | (negSubnorm << 4) |
-               (negNorm << 3) | (negInf << 2) | (quietNan << 1) | signalingNan;
-
-      DCHECK_NE(result, 0);
-
-      dResult = bit_cast<double>(result);
-      SetFPUDoubleResult(fd_reg(), dResult);
-
-      break;
-    }
-    case C_F_D: {
-      set_fcsr_bit(fcsr_cc, false);
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    }
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-void Simulator::DecodeTypeRegisterWRsType() {
-  float fs = get_fpu_register_float(fs_reg());
-  float ft = get_fpu_register_float(ft_reg());
-  int32_t alu_out = 0x12345678;
-  switch (instr_.FunctionFieldRaw()) {
-    case CVT_S_W:  // Convert word to float (single).
-      alu_out = get_fpu_register_signed_word(fs_reg());
-      SetFPUFloatResult(fd_reg(), static_cast<float>(alu_out));
-      break;
-    case CVT_D_W:  // Convert word to double.
-      alu_out = get_fpu_register_signed_word(fs_reg());
-      SetFPUDoubleResult(fd_reg(), static_cast<double>(alu_out));
-      break;
-    case CMP_AF:
-      SetFPUWordResult(fd_reg(), 0);
-      break;
-    case CMP_UN:
-      if (std::isnan(fs) || std::isnan(ft)) {
-        SetFPUWordResult(fd_reg(), -1);
-      } else {
-        SetFPUWordResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_EQ:
-      if (fs == ft) {
-        SetFPUWordResult(fd_reg(), -1);
-      } else {
-        SetFPUWordResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_UEQ:
-      if ((fs == ft) || (std::isnan(fs) || std::isnan(ft))) {
-        SetFPUWordResult(fd_reg(), -1);
-      } else {
-        SetFPUWordResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_LT:
-      if (fs < ft) {
-        SetFPUWordResult(fd_reg(), -1);
-      } else {
-        SetFPUWordResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_ULT:
-      if ((fs < ft) || (std::isnan(fs) || std::isnan(ft))) {
-        SetFPUWordResult(fd_reg(), -1);
-      } else {
-        SetFPUWordResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_LE:
-      if (fs <= ft) {
-        SetFPUWordResult(fd_reg(), -1);
-      } else {
-        SetFPUWordResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_ULE:
-      if ((fs <= ft) || (std::isnan(fs) || std::isnan(ft))) {
-        SetFPUWordResult(fd_reg(), -1);
-      } else {
-        SetFPUWordResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_OR:
-      if (!std::isnan(fs) && !std::isnan(ft)) {
-        SetFPUWordResult(fd_reg(), -1);
-      } else {
-        SetFPUWordResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_UNE:
-      if ((fs != ft) || (std::isnan(fs) || std::isnan(ft))) {
-        SetFPUWordResult(fd_reg(), -1);
-      } else {
-        SetFPUWordResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_NE:
-      if (fs != ft) {
-        SetFPUWordResult(fd_reg(), -1);
-      } else {
-        SetFPUWordResult(fd_reg(), 0);
-      }
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-void Simulator::DecodeTypeRegisterSRsType() {
-  float fs, ft, fd;
-  fs = get_fpu_register_float(fs_reg());
-  ft = get_fpu_register_float(ft_reg());
-  fd = get_fpu_register_float(fd_reg());
-  int32_t ft_int = bit_cast<int32_t>(ft);
-  int32_t fd_int = bit_cast<int32_t>(fd);
-  uint32_t cc, fcsr_cc;
-  cc = instr_.FCccValue();
-  fcsr_cc = get_fcsr_condition_bit(cc);
-  switch (instr_.FunctionFieldRaw()) {
-    case RINT: {
-      DCHECK(IsMipsArchVariant(kMips32r6));
-      float result, temp_result;
-      double temp;
-      float upper = std::ceil(fs);
-      float lower = std::floor(fs);
-      switch (get_fcsr_rounding_mode()) {
-        case kRoundToNearest:
-          if (upper - fs < fs - lower) {
-            result = upper;
-          } else if (upper - fs > fs - lower) {
-            result = lower;
-          } else {
-            temp_result = upper / 2;
-            float reminder = modf(temp_result, &temp);
-            if (reminder == 0) {
-              result = upper;
-            } else {
-              result = lower;
-            }
-          }
-          break;
-        case kRoundToZero:
-          result = (fs > 0 ? lower : upper);
-          break;
-        case kRoundToPlusInf:
-          result = upper;
-          break;
-        case kRoundToMinusInf:
-          result = lower;
-          break;
-      }
-      SetFPUFloatResult(fd_reg(), result);
-      if (result != fs) {
-        set_fcsr_bit(kFCSRInexactFlagBit, true);
-      }
-      break;
-    }
-    case ADD_S:
-      SetFPUFloatResult(
-          fd_reg(),
-          FPUCanonalizeOperation([](float lhs, float rhs) { return lhs + rhs; },
-                                 fs, ft));
-      break;
-    case SUB_S:
-      SetFPUFloatResult(
-          fd_reg(),
-          FPUCanonalizeOperation([](float lhs, float rhs) { return lhs - rhs; },
-                                 fs, ft));
-      break;
-    case MADDF_S:
-      DCHECK(IsMipsArchVariant(kMips32r6));
-      SetFPUFloatResult(fd_reg(), std::fma(fs, ft, fd));
-      break;
-    case MSUBF_S:
-      DCHECK(IsMipsArchVariant(kMips32r6));
-      SetFPUFloatResult(fd_reg(), std::fma(-fs, ft, fd));
-      break;
-    case MUL_S:
-      SetFPUFloatResult(
-          fd_reg(),
-          FPUCanonalizeOperation([](float lhs, float rhs) { return lhs * rhs; },
-                                 fs, ft));
-      break;
-    case DIV_S:
-      SetFPUFloatResult(
-          fd_reg(),
-          FPUCanonalizeOperation([](float lhs, float rhs) { return lhs / rhs; },
-                                 fs, ft));
-      break;
-    case ABS_S:
-      SetFPUFloatResult(fd_reg(), FPUCanonalizeOperation(
-                                      [](float fs) { return FPAbs(fs); }, fs));
-      break;
-    case MOV_S:
-      SetFPUFloatResult(fd_reg(), fs);
-      break;
-    case NEG_S:
-      SetFPUFloatResult(fd_reg(),
-                        FPUCanonalizeOperation([](float src) { return -src; },
-                                               KeepSign::yes, fs));
-      break;
-    case SQRT_S:
-      SetFPUFloatResult(
-          fd_reg(),
-          FPUCanonalizeOperation([](float src) { return std::sqrt(src); }, fs));
-      break;
-    case RSQRT_S:
-      SetFPUFloatResult(
-          fd_reg(), FPUCanonalizeOperation(
-                        [](float src) { return 1.0 / std::sqrt(src); }, fs));
-      break;
-    case RECIP_S:
-      SetFPUFloatResult(fd_reg(), FPUCanonalizeOperation(
-                                      [](float src) { return 1.0 / src; }, fs));
-      break;
-    case C_F_D:
-      set_fcsr_bit(fcsr_cc, false);
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case C_UN_D:
-      set_fcsr_bit(fcsr_cc, std::isnan(fs) || std::isnan(ft));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case C_EQ_D:
-      set_fcsr_bit(fcsr_cc, (fs == ft));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case C_UEQ_D:
-      set_fcsr_bit(fcsr_cc, (fs == ft) || (std::isnan(fs) || std::isnan(ft)));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case C_OLT_D:
-      set_fcsr_bit(fcsr_cc, (fs < ft));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case C_ULT_D:
-      set_fcsr_bit(fcsr_cc, (fs < ft) || (std::isnan(fs) || std::isnan(ft)));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case C_OLE_D:
-      set_fcsr_bit(fcsr_cc, (fs <= ft));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case C_ULE_D:
-      set_fcsr_bit(fcsr_cc, (fs <= ft) || (std::isnan(fs) || std::isnan(ft)));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case CVT_D_S:
-      SetFPUDoubleResult(fd_reg(), static_cast<double>(fs));
-      break;
-    case SEL:
-      DCHECK(IsMipsArchVariant(kMips32r6));
-      SetFPUFloatResult(fd_reg(), (fd_int & 0x1) == 0 ? fs : ft);
-      break;
-    case CLASS_S: {  // Mips32r6 instruction
-      // Convert float input to uint32_t for easier bit manipulation
-      float fs = get_fpu_register_float(fs_reg());
-      uint32_t classed = bit_cast<uint32_t>(fs);
-
-      // Extracting sign, exponent and mantissa from the input float
-      uint32_t sign = (classed >> 31) & 1;
-      uint32_t exponent = (classed >> 23) & 0x000000FF;
-      uint32_t mantissa = classed & 0x007FFFFF;
-      uint32_t result;
-      float fResult;
-
-      // Setting flags if input float is negative infinity,
-      // positive infinity, negative zero or positive zero
-      bool negInf = (classed == 0xFF800000);
-      bool posInf = (classed == 0x7F800000);
-      bool negZero = (classed == 0x80000000);
-      bool posZero = (classed == 0x00000000);
-
-      bool signalingNan;
-      bool quietNan;
-      bool negSubnorm;
-      bool posSubnorm;
-      bool negNorm;
-      bool posNorm;
-
-      // Setting flags if float is NaN
-      signalingNan = false;
-      quietNan = false;
-      if (!negInf && !posInf && (exponent == 0xFF)) {
-        quietNan = ((mantissa & 0x00200000) == 0) &&
-                   ((mantissa & (0x00200000 - 1)) == 0);
-        signalingNan = !quietNan;
-      }
-
-      // Setting flags if float is subnormal number
-      posSubnorm = false;
-      negSubnorm = false;
-      if ((exponent == 0) && (mantissa != 0)) {
-        DCHECK(sign == 0 || sign == 1);
-        posSubnorm = (sign == 0);
-        negSubnorm = (sign == 1);
-      }
-
-      // Setting flags if float is normal number
-      posNorm = false;
-      negNorm = false;
-      if (!posSubnorm && !negSubnorm && !posInf && !negInf && !signalingNan &&
-          !quietNan && !negZero && !posZero) {
-        DCHECK(sign == 0 || sign == 1);
-        posNorm = (sign == 0);
-        negNorm = (sign == 1);
-      }
-
-      // Calculating result according to description of CLASS.S instruction
-      result = (posZero << 9) | (posSubnorm << 8) | (posNorm << 7) |
-               (posInf << 6) | (negZero << 5) | (negSubnorm << 4) |
-               (negNorm << 3) | (negInf << 2) | (quietNan << 1) | signalingNan;
-
-      DCHECK_NE(result, 0);
-
-      fResult = bit_cast<float>(result);
-      SetFPUFloatResult(fd_reg(), fResult);
-
-      break;
-    }
-    case SELEQZ_C:
-      DCHECK(IsMipsArchVariant(kMips32r6));
-      SetFPUFloatResult(
-          fd_reg(),
-          (ft_int & 0x1) == 0 ? get_fpu_register_float(fs_reg()) : 0.0);
-      break;
-    case SELNEZ_C:
-      DCHECK(IsMipsArchVariant(kMips32r6));
-      SetFPUFloatResult(
-          fd_reg(),
-          (ft_int & 0x1) != 0 ? get_fpu_register_float(fs_reg()) : 0.0);
-      break;
-    case MOVZ_C: {
-      DCHECK(IsMipsArchVariant(kMips32r2));
-      if (rt() == 0) {
-        SetFPUFloatResult(fd_reg(), fs);
-      }
-      break;
-    }
-    case MOVN_C: {
-      DCHECK(IsMipsArchVariant(kMips32r2));
-      if (rt() != 0) {
-        SetFPUFloatResult(fd_reg(), fs);
-      }
-      break;
-    }
-    case MOVF: {
-      // Same function field for MOVT.D and MOVF.D
-      uint32_t ft_cc = (ft_reg() >> 2) & 0x7;
-      ft_cc = get_fcsr_condition_bit(ft_cc);
-
-      if (instr_.Bit(16)) {  // Read Tf bit.
-        // MOVT.D
-        if (test_fcsr_bit(ft_cc)) SetFPUFloatResult(fd_reg(), fs);
-      } else {
-        // MOVF.D
-        if (!test_fcsr_bit(ft_cc)) SetFPUFloatResult(fd_reg(), fs);
-      }
-      break;
-    }
-    case TRUNC_W_S: {  // Truncate single to word (round towards 0).
-      float rounded = trunc(fs);
-      int32_t result = static_cast<int32_t>(rounded);
-      SetFPUWordResult(fd_reg(), result);
-      if (set_fcsr_round_error(fs, rounded)) {
-        set_fpu_register_word_invalid_result(fs, rounded);
-      }
-    } break;
-    case TRUNC_L_S: {  // Mips32r2 instruction.
-      DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
-      float rounded = trunc(fs);
-      int64_t i64 = static_cast<int64_t>(rounded);
-      if (IsFp64Mode()) {
-        SetFPUResult(fd_reg(), i64);
-        if (set_fcsr_round64_error(fs, rounded)) {
-          set_fpu_register_invalid_result64(fs, rounded);
-        }
-      } else {
-        UNSUPPORTED();
-      }
-      break;
-    }
-    case FLOOR_W_S:  // Round double to word towards negative infinity.
-    {
-      float rounded = std::floor(fs);
-      int32_t result = static_cast<int32_t>(rounded);
-      SetFPUWordResult(fd_reg(), result);
-      if (set_fcsr_round_error(fs, rounded)) {
-        set_fpu_register_word_invalid_result(fs, rounded);
-      }
-    } break;
-    case FLOOR_L_S: {  // Mips32r2 instruction.
-      DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
-      float rounded = std::floor(fs);
-      int64_t i64 = static_cast<int64_t>(rounded);
-      if (IsFp64Mode()) {
-        SetFPUResult(fd_reg(), i64);
-        if (set_fcsr_round64_error(fs, rounded)) {
-          set_fpu_register_invalid_result64(fs, rounded);
-        }
-      } else {
-        UNSUPPORTED();
-      }
-      break;
-    }
-    case ROUND_W_S: {
-      float rounded = std::floor(fs + 0.5);
-      int32_t result = static_cast<int32_t>(rounded);
-      if ((result & 1) != 0 && result - fs == 0.5) {
-        // If the number is halfway between two integers,
-        // round to the even one.
-        result--;
-      }
-      SetFPUWordResult(fd_reg(), result);
-      if (set_fcsr_round_error(fs, rounded)) {
-        set_fpu_register_word_invalid_result(fs, rounded);
-      }
-      break;
-    }
-    case ROUND_L_S: {  // Mips32r2 instruction.
-      DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
-      float rounded = std::floor(fs + 0.5);
-      int64_t result = static_cast<int64_t>(rounded);
-      if ((result & 1) != 0 && result - fs == 0.5) {
-        // If the number is halfway between two integers,
-        // round to the even one.
-        result--;
-      }
-      int64_t i64 = static_cast<int64_t>(result);
-      if (IsFp64Mode()) {
-        SetFPUResult(fd_reg(), i64);
-        if (set_fcsr_round64_error(fs, rounded)) {
-          set_fpu_register_invalid_result64(fs, rounded);
-        }
-      } else {
-        UNSUPPORTED();
-      }
-      break;
-    }
-    case CEIL_W_S:  // Round double to word towards positive infinity.
-    {
-      float rounded = std::ceil(fs);
-      int32_t result = static_cast<int32_t>(rounded);
-      SetFPUWordResult(fd_reg(), result);
-      if (set_fcsr_round_error(fs, rounded)) {
-        set_fpu_register_word_invalid_result(fs, rounded);
-      }
-    } break;
-    case CEIL_L_S: {  // Mips32r2 instruction.
-      DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6));
-      float rounded = std::ceil(fs);
-      int64_t i64 = static_cast<int64_t>(rounded);
-      if (IsFp64Mode()) {
-        SetFPUResult(fd_reg(), i64);
-        if (set_fcsr_round64_error(fs, rounded)) {
-          set_fpu_register_invalid_result64(fs, rounded);
-        }
-      } else {
-        UNSUPPORTED();
-      }
-      break;
-    }
-    case MIN:
-      DCHECK(IsMipsArchVariant(kMips32r6));
-      SetFPUFloatResult(fd_reg(), FPUMin(ft, fs));
-      break;
-    case MAX:
-      DCHECK(IsMipsArchVariant(kMips32r6));
-      SetFPUFloatResult(fd_reg(), FPUMax(ft, fs));
-      break;
-    case MINA:
-      DCHECK(IsMipsArchVariant(kMips32r6));
-      SetFPUFloatResult(fd_reg(), FPUMinA(ft, fs));
-      break;
-    case MAXA:
-      DCHECK(IsMipsArchVariant(kMips32r6));
-      SetFPUFloatResult(fd_reg(), FPUMaxA(ft, fs));
-      break;
-    case CVT_L_S: {
-      if (IsFp64Mode()) {
-        int64_t result;
-        float rounded;
-        round64_according_to_fcsr(fs, rounded, result, fs);
-        SetFPUResult(fd_reg(), result);
-        if (set_fcsr_round64_error(fs, rounded)) {
-          set_fpu_register_invalid_result64(fs, rounded);
-        }
-      } else {
-        UNSUPPORTED();
-      }
-      break;
-    }
-    case CVT_W_S: {
-      float rounded;
-      int32_t result;
-      round_according_to_fcsr(fs, rounded, result, fs);
-      SetFPUWordResult(fd_reg(), result);
-      if (set_fcsr_round_error(fs, rounded)) {
-        set_fpu_register_word_invalid_result(fs, rounded);
-      }
-      break;
-    }
-    default:
-      // CVT_W_S CVT_L_S  ROUND_W_S ROUND_L_S FLOOR_W_S FLOOR_L_S
-      // CEIL_W_S CEIL_L_S CVT_PS_S are unimplemented.
-      UNREACHABLE();
-  }
-}
-
-
-void Simulator::DecodeTypeRegisterLRsType() {
-  double fs = get_fpu_register_double(fs_reg());
-  double ft = get_fpu_register_double(ft_reg());
-  switch (instr_.FunctionFieldRaw()) {
-    case CVT_D_L:  // Mips32r2 instruction.
-      // Watch the signs here, we want 2 32-bit vals
-      // to make a sign-64.
-      int64_t i64;
-      if (IsFp64Mode()) {
-        i64 = get_fpu_register(fs_reg());
-      } else {
-        i64 = static_cast<uint32_t>(get_fpu_register_word(fs_reg()));
-        i64 |= static_cast<int64_t>(get_fpu_register_word(fs_reg() + 1)) << 32;
-      }
-      SetFPUDoubleResult(fd_reg(), static_cast<double>(i64));
-      break;
-    case CVT_S_L:
-      if (IsFp64Mode()) {
-        i64 = get_fpu_register(fs_reg());
-      } else {
-        i64 = static_cast<uint32_t>(get_fpu_register_word(fs_reg()));
-        i64 |= static_cast<int64_t>(get_fpu_register_word(fs_reg() + 1)) << 32;
-      }
-      SetFPUFloatResult(fd_reg(), static_cast<float>(i64));
-      break;
-    case CMP_AF:  // Mips64r6 CMP.D instructions.
-      SetFPUResult(fd_reg(), 0);
-      break;
-    case CMP_UN:
-      if (std::isnan(fs) || std::isnan(ft)) {
-        SetFPUResult(fd_reg(), -1);
-      } else {
-        SetFPUResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_EQ:
-      if (fs == ft) {
-        SetFPUResult(fd_reg(), -1);
-      } else {
-        SetFPUResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_UEQ:
-      if ((fs == ft) || (std::isnan(fs) || std::isnan(ft))) {
-        SetFPUResult(fd_reg(), -1);
-      } else {
-        SetFPUResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_LT:
-      if (fs < ft) {
-        SetFPUResult(fd_reg(), -1);
-      } else {
-        SetFPUResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_ULT:
-      if ((fs < ft) || (std::isnan(fs) || std::isnan(ft))) {
-        SetFPUResult(fd_reg(), -1);
-      } else {
-        SetFPUResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_LE:
-      if (fs <= ft) {
-        SetFPUResult(fd_reg(), -1);
-      } else {
-        SetFPUResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_ULE:
-      if ((fs <= ft) || (std::isnan(fs) || std::isnan(ft))) {
-        SetFPUResult(fd_reg(), -1);
-      } else {
-        SetFPUResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_OR:
-      if (!std::isnan(fs) && !std::isnan(ft)) {
-        SetFPUResult(fd_reg(), -1);
-      } else {
-        SetFPUResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_UNE:
-      if ((fs != ft) || (std::isnan(fs) || std::isnan(ft))) {
-        SetFPUResult(fd_reg(), -1);
-      } else {
-        SetFPUResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_NE:
-      if (fs != ft && (!std::isnan(fs) && !std::isnan(ft))) {
-        SetFPUResult(fd_reg(), -1);
-      } else {
-        SetFPUResult(fd_reg(), 0);
-      }
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-void Simulator::DecodeTypeRegisterCOP1() {
-  switch (instr_.RsFieldRaw()) {
-    case CFC1:
-      // At the moment only FCSR is supported.
-      DCHECK_EQ(fs_reg(), kFCSRRegister);
-      SetResult(rt_reg(), FCSR_);
-      break;
-    case MFC1:
-      SetResult(rt_reg(), get_fpu_register_word(fs_reg()));
-      break;
-    case MFHC1:
-      if (IsFp64Mode()) {
-        SetResult(rt_reg(), get_fpu_register_hi_word(fs_reg()));
-      } else {
-        SetResult(rt_reg(), get_fpu_register_word(fs_reg() + 1));
-      }
-      break;
-    case CTC1: {
-      // At the moment only FCSR is supported.
-      DCHECK_EQ(fs_reg(), kFCSRRegister);
-      int32_t reg = registers_[rt_reg()];
-      if (IsMipsArchVariant(kMips32r6)) {
-        FCSR_ = reg | kFCSRNaN2008FlagMask;
-      } else {
-        DCHECK(IsMipsArchVariant(kMips32r1) || IsMipsArchVariant(kMips32r2));
-        FCSR_ = reg & ~kFCSRNaN2008FlagMask;
-      }
-      TraceRegWr(static_cast<int32_t>(FCSR_));
-      break;
-    }
-    case MTC1:
-      // Hardware writes upper 32-bits to zero on mtc1.
-      set_fpu_register_hi_word(fs_reg(), 0);
-      set_fpu_register_word(fs_reg(), registers_[rt_reg()]);
-      TraceRegWr(get_fpu_register_word(fs_reg()), FLOAT);
-      break;
-    case MTHC1:
-      if (IsFp64Mode()) {
-        set_fpu_register_hi_word(fs_reg(), registers_[rt_reg()]);
-        TraceRegWr(get_fpu_register(fs_reg()), DOUBLE);
-      } else {
-        set_fpu_register_word(fs_reg() + 1, registers_[rt_reg()]);
-        if (fs_reg() % 2) {
-          TraceRegWr(get_fpu_register_word(fs_reg() + 1), FLOAT);
-        } else {
-          TraceRegWr(get_fpu_register(fs_reg()), DOUBLE);
-        }
-      }
-      break;
-    case S: {
-      DecodeTypeRegisterSRsType();
-      break;
-    }
-    case D:
-      DecodeTypeRegisterDRsType();
-      break;
-    case W:
-      DecodeTypeRegisterWRsType();
-      break;
-    case L:
-      DecodeTypeRegisterLRsType();
-      break;
-    case PS:
-      // Not implemented.
-      UNREACHABLE();
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-void Simulator::DecodeTypeRegisterCOP1X() {
-  switch (instr_.FunctionFieldRaw()) {
-    case MADD_S: {
-      DCHECK(IsMipsArchVariant(kMips32r2));
-      float fr, ft, fs;
-      fr = get_fpu_register_float(fr_reg());
-      fs = get_fpu_register_float(fs_reg());
-      ft = get_fpu_register_float(ft_reg());
-      SetFPUFloatResult(fd_reg(), fs * ft + fr);
-      break;
-    }
-    case MSUB_S: {
-      DCHECK(IsMipsArchVariant(kMips32r2));
-      float fr, ft, fs;
-      fr = get_fpu_register_float(fr_reg());
-      fs = get_fpu_register_float(fs_reg());
-      ft = get_fpu_register_float(ft_reg());
-      SetFPUFloatResult(fd_reg(), fs * ft - fr);
-      break;
-    }
-    case MADD_D: {
-      DCHECK(IsMipsArchVariant(kMips32r2));
-      double fr, ft, fs;
-      fr = get_fpu_register_double(fr_reg());
-      fs = get_fpu_register_double(fs_reg());
-      ft = get_fpu_register_double(ft_reg());
-      SetFPUDoubleResult(fd_reg(), fs * ft + fr);
-      break;
-    }
-    case MSUB_D: {
-      DCHECK(IsMipsArchVariant(kMips32r2));
-      double fr, ft, fs;
-      fr = get_fpu_register_double(fr_reg());
-      fs = get_fpu_register_double(fs_reg());
-      ft = get_fpu_register_double(ft_reg());
-      SetFPUDoubleResult(fd_reg(), fs * ft - fr);
-      break;
-    }
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-void Simulator::DecodeTypeRegisterSPECIAL() {
-  int64_t alu_out = 0x12345678;
-  int64_t i64hilo = 0;
-  uint64_t u64hilo = 0;
-  bool do_interrupt = false;
-
-  switch (instr_.FunctionFieldRaw()) {
-    case SELEQZ_S:
-      DCHECK(IsMipsArchVariant(kMips32r6));
-      SetResult(rd_reg(), rt() == 0 ? rs() : 0);
-      break;
-    case SELNEZ_S:
-      DCHECK(IsMipsArchVariant(kMips32r6));
-      SetResult(rd_reg(), rt() != 0 ? rs() : 0);
-      break;
-    case JR: {
-      int32_t next_pc = rs();
-      int32_t current_pc = get_pc();
-      Instruction* branch_delay_instr =
-          reinterpret_cast<Instruction*>(current_pc + Instruction::kInstrSize);
-      BranchDelayInstructionDecode(branch_delay_instr);
-      set_pc(next_pc);
-      pc_modified_ = true;
-      break;
-    }
-    case JALR: {
-      int32_t next_pc = rs();
-      int32_t return_addr_reg = rd_reg();
-      int32_t current_pc = get_pc();
-      Instruction* branch_delay_instr =
-          reinterpret_cast<Instruction*>(current_pc + Instruction::kInstrSize);
-      BranchDelayInstructionDecode(branch_delay_instr);
-      set_register(return_addr_reg, current_pc + 2 * Instruction::kInstrSize);
-      set_pc(next_pc);
-      pc_modified_ = true;
-      break;
-    }
-    case SLL:
-      alu_out = rt() << sa();
-      SetResult(rd_reg(), static_cast<int32_t>(alu_out));
-      break;
-    case SRL:
-      if (rs_reg() == 0) {
-        // Regular logical right shift of a word by a fixed number of
-        // bits instruction. RS field is always equal to 0.
-        alu_out = rt_u() >> sa();
-      } else {
-        // Logical right-rotate of a word by a fixed number of bits. This
-        // is special case of SRL instruction, added in MIPS32 Release 2.
-        // RS field is equal to 00001.
-        alu_out = base::bits::RotateRight32(rt_u(), sa());
-      }
-      SetResult(rd_reg(), static_cast<int32_t>(alu_out));
-      break;
-    case SRA:
-      alu_out = rt() >> sa();
-      SetResult(rd_reg(), static_cast<int32_t>(alu_out));
-      break;
-    case SLLV:
-      alu_out = rt() << rs();
-      SetResult(rd_reg(), static_cast<int32_t>(alu_out));
-      break;
-    case SRLV:
-      if (sa() == 0) {
-        // Regular logical right-shift of a word by a variable number of
-        // bits instruction. SA field is always equal to 0.
-        alu_out = rt_u() >> rs();
-      } else {
-        // Logical right-rotate of a word by a variable number of bits.
-        // This is special case od SRLV instruction, added in MIPS32
-        // Release 2. SA field is equal to 00001.
-        alu_out = base::bits::RotateRight32(rt_u(), rs_u());
-      }
-      SetResult(rd_reg(), static_cast<int32_t>(alu_out));
-      break;
-    case SRAV:
-      SetResult(rd_reg(), rt() >> rs());
-      break;
-    case LSA: {
-      DCHECK(IsMipsArchVariant(kMips32r6));
-      int8_t sa = lsa_sa() + 1;
-      int32_t _rt = rt();
-      int32_t _rs = rs();
-      int32_t res = _rs << sa;
-      res += _rt;
-      DCHECK_EQ(res, (rs() << (lsa_sa() + 1)) + rt());
-      SetResult(rd_reg(), (rs() << (lsa_sa() + 1)) + rt());
-      break;
-    }
-    case MFHI:  // MFHI == CLZ on R6.
-      if (!IsMipsArchVariant(kMips32r6)) {
-        DCHECK_EQ(sa(), 0);
-        alu_out = get_register(HI);
-      } else {
-        // MIPS spec: If no bits were set in GPR rs, the result written to
-        // GPR rd is 32.
-        DCHECK_EQ(sa(), 1);
-        alu_out = base::bits::CountLeadingZeros32(rs_u());
-      }
-      SetResult(rd_reg(), static_cast<int32_t>(alu_out));
-      break;
-    case MFLO:
-      alu_out = get_register(LO);
-      SetResult(rd_reg(), static_cast<int32_t>(alu_out));
-      break;
-    // Instructions using HI and LO registers.
-    case MULT:
-      i64hilo = static_cast<int64_t>(rs()) * static_cast<int64_t>(rt());
-      if (!IsMipsArchVariant(kMips32r6)) {
-        set_register(LO, static_cast<int32_t>(i64hilo & 0xFFFFFFFF));
-        set_register(HI, static_cast<int32_t>(i64hilo >> 32));
-      } else {
-        switch (sa()) {
-          case MUL_OP:
-            SetResult(rd_reg(), static_cast<int32_t>(i64hilo & 0xFFFFFFFF));
-            break;
-          case MUH_OP:
-            SetResult(rd_reg(), static_cast<int32_t>(i64hilo >> 32));
-            break;
-          default:
-            UNIMPLEMENTED_MIPS();
-            break;
-        }
-      }
-      break;
-    case MULTU:
-      u64hilo = static_cast<uint64_t>(rs_u()) * static_cast<uint64_t>(rt_u());
-      if (!IsMipsArchVariant(kMips32r6)) {
-        set_register(LO, static_cast<int32_t>(u64hilo & 0xFFFFFFFF));
-        set_register(HI, static_cast<int32_t>(u64hilo >> 32));
-      } else {
-        switch (sa()) {
-          case MUL_OP:
-            SetResult(rd_reg(), static_cast<int32_t>(u64hilo & 0xFFFFFFFF));
-            break;
-          case MUH_OP:
-            SetResult(rd_reg(), static_cast<int32_t>(u64hilo >> 32));
-            break;
-          default:
-            UNIMPLEMENTED_MIPS();
-            break;
-        }
-      }
-      break;
-    case DIV:
-      if (IsMipsArchVariant(kMips32r6)) {
-        switch (sa()) {
-          case DIV_OP:
-            if (rs() == INT_MIN && rt() == -1) {
-              SetResult(rd_reg(), INT_MIN);
-            } else if (rt() != 0) {
-              SetResult(rd_reg(), rs() / rt());
-            }
-            break;
-          case MOD_OP:
-            if (rs() == INT_MIN && rt() == -1) {
-              SetResult(rd_reg(), 0);
-            } else if (rt() != 0) {
-              SetResult(rd_reg(), rs() % rt());
-            }
-            break;
-          default:
-            UNIMPLEMENTED_MIPS();
-            break;
-        }
-      } else {
-        // Divide by zero and overflow was not checked in the
-        // configuration step - div and divu do not raise exceptions. On
-        // division by 0 the result will be UNPREDICTABLE. On overflow
-        // (INT_MIN/-1), return INT_MIN which is what the hardware does.
-        if (rs() == INT_MIN && rt() == -1) {
-          set_register(LO, INT_MIN);
-          set_register(HI, 0);
-        } else if (rt() != 0) {
-          set_register(LO, rs() / rt());
-          set_register(HI, rs() % rt());
-        }
-      }
-      break;
-    case DIVU:
-      if (IsMipsArchVariant(kMips32r6)) {
-        switch (sa()) {
-          case DIV_OP:
-            if (rt_u() != 0) {
-              SetResult(rd_reg(), rs_u() / rt_u());
-            }
-            break;
-          case MOD_OP:
-            if (rt_u() != 0) {
-              SetResult(rd_reg(), rs_u() % rt_u());
-            }
-            break;
-          default:
-            UNIMPLEMENTED_MIPS();
-            break;
-        }
-      } else {
-        if (rt_u() != 0) {
-          set_register(LO, rs_u() / rt_u());
-          set_register(HI, rs_u() % rt_u());
-        }
-      }
-      break;
-    case ADD:
-      if (HaveSameSign(rs(), rt())) {
-        if (rs() > 0) {
-          if (rs() <= (Registers::kMaxValue - rt())) {
-            SignalException(kIntegerOverflow);
-          }
-        } else if (rs() < 0) {
-          if (rs() >= (Registers::kMinValue - rt())) {
-            SignalException(kIntegerUnderflow);
-          }
-        }
-      }
-      SetResult(rd_reg(), rs() + rt());
-      break;
-    case ADDU:
-      SetResult(rd_reg(), rs() + rt());
-      break;
-    case SUB:
-      if (!HaveSameSign(rs(), rt())) {
-        if (rs() > 0) {
-          if (rs() <= (Registers::kMaxValue + rt())) {
-            SignalException(kIntegerOverflow);
-          }
-        } else if (rs() < 0) {
-          if (rs() >= (Registers::kMinValue + rt())) {
-            SignalException(kIntegerUnderflow);
-          }
-        }
-      }
-      SetResult(rd_reg(), rs() - rt());
-      break;
-    case SUBU:
-      SetResult(rd_reg(), rs() - rt());
-      break;
-    case AND:
-      SetResult(rd_reg(), rs() & rt());
-      break;
-    case OR:
-      SetResult(rd_reg(), rs() | rt());
-      break;
-    case XOR:
-      SetResult(rd_reg(), rs() ^ rt());
-      break;
-    case NOR:
-      SetResult(rd_reg(), ~(rs() | rt()));
-      break;
-    case SLT:
-      SetResult(rd_reg(), rs() < rt() ? 1 : 0);
-      break;
-    case SLTU:
-      SetResult(rd_reg(), rs_u() < rt_u() ? 1 : 0);
-      break;
-    // Break and trap instructions.
-    case BREAK:
-      do_interrupt = true;
-      break;
-    case TGE:
-      do_interrupt = rs() >= rt();
-      break;
-    case TGEU:
-      do_interrupt = rs_u() >= rt_u();
-      break;
-    case TLT:
-      do_interrupt = rs() < rt();
-      break;
-    case TLTU:
-      do_interrupt = rs_u() < rt_u();
-      break;
-    case TEQ:
-      do_interrupt = rs() == rt();
-      break;
-    case TNE:
-      do_interrupt = rs() != rt();
-      break;
-    case SYNC:
-      // TODO(palfia): Ignore sync instruction for now.
-      break;
-    // Conditional moves.
-    case MOVN:
-      if (rt()) {
-        SetResult(rd_reg(), rs());
-      }
-      break;
-    case MOVCI: {
-      uint32_t cc = instr_.FBccValue();
-      uint32_t fcsr_cc = get_fcsr_condition_bit(cc);
-      if (instr_.Bit(16)) {  // Read Tf bit.
-        if (test_fcsr_bit(fcsr_cc)) set_register(rd_reg(), rs());
-      } else {
-        if (!test_fcsr_bit(fcsr_cc)) set_register(rd_reg(), rs());
-      }
-      break;
-    }
-    case MOVZ:
-      if (!rt()) {
-        SetResult(rd_reg(), rs());
-      }
-      break;
-    default:
-      UNREACHABLE();
-  }
-  if (do_interrupt) {
-    SoftwareInterrupt();
-  }
-}
-
-
-void Simulator::DecodeTypeRegisterSPECIAL2() {
-  int32_t alu_out;
-  switch (instr_.FunctionFieldRaw()) {
-    case MUL:
-      // Only the lower 32 bits are kept.
-      alu_out = rs_u() * rt_u();
-      // HI and LO are UNPREDICTABLE after the operation.
-      set_register(LO, Unpredictable);
-      set_register(HI, Unpredictable);
-      break;
-    case CLZ:
-      // MIPS32 spec: If no bits were set in GPR rs, the result written to
-      // GPR rd is 32.
-      alu_out = base::bits::CountLeadingZeros32(rs_u());
-      break;
-    default:
-      alu_out = 0x12345678;
-      UNREACHABLE();
-  }
-  SetResult(rd_reg(), alu_out);
-}
-
-
-void Simulator::DecodeTypeRegisterSPECIAL3() {
-  int32_t alu_out;
-  switch (instr_.FunctionFieldRaw()) {
-    case INS: {  // Mips32r2 instruction.
-      // Interpret rd field as 5-bit msb of insert.
-      uint16_t msb = rd_reg();
-      // Interpret sa field as 5-bit lsb of insert.
-      uint16_t lsb = sa();
-      uint16_t size = msb - lsb + 1;
-      uint32_t mask;
-      if (size < 32) {
-        mask = (1 << size) - 1;
-      } else {
-        mask = std::numeric_limits<uint32_t>::max();
-      }
-      alu_out = (rt_u() & ~(mask << lsb)) | ((rs_u() & mask) << lsb);
-      // Ins instr leaves result in Rt, rather than Rd.
-      SetResult(rt_reg(), alu_out);
-      break;
-    }
-    case EXT: {  // Mips32r2 instruction.
-      // Interpret rd field as 5-bit msb of extract.
-      uint16_t msb = rd_reg();
-      // Interpret sa field as 5-bit lsb of extract.
-      uint16_t lsb = sa();
-      uint16_t size = msb + 1;
-      uint32_t mask;
-      if (size < 32) {
-        mask = (1 << size) - 1;
-      } else {
-        mask = std::numeric_limits<uint32_t>::max();
-      }
-      alu_out = (rs_u() & (mask << lsb)) >> lsb;
-      SetResult(rt_reg(), alu_out);
-      break;
-    }
-    case BSHFL: {
-      int sa = instr_.SaFieldRaw() >> kSaShift;
-      switch (sa) {
-        case BITSWAP: {
-          uint32_t input = static_cast<uint32_t>(rt());
-          uint32_t output = 0;
-          uint8_t i_byte, o_byte;
-
-          // Reverse the bit in byte for each individual byte
-          for (int i = 0; i < 4; i++) {
-            output = output >> 8;
-            i_byte = input & 0xFF;
-
-            // Fast way to reverse bits in byte
-            // Devised by Sean Anderson, July 13, 2001
-            o_byte = static_cast<uint8_t>(((i_byte * 0x0802LU & 0x22110LU) |
-                                           (i_byte * 0x8020LU & 0x88440LU)) *
-                                              0x10101LU >>
-                                          16);
-
-            output = output | (static_cast<uint32_t>(o_byte << 24));
-            input = input >> 8;
-          }
-
-          alu_out = static_cast<int32_t>(output);
-          break;
-        }
-        case SEB: {
-          uint8_t input = static_cast<uint8_t>(rt());
-          uint32_t output = input;
-          uint32_t mask = 0x00000080;
-
-          // Extending sign
-          if (mask & input) {
-            output |= 0xFFFFFF00;
-          }
-
-          alu_out = static_cast<int32_t>(output);
-          break;
-        }
-        case SEH: {
-          uint16_t input = static_cast<uint16_t>(rt());
-          uint32_t output = input;
-          uint32_t mask = 0x00008000;
-
-          // Extending sign
-          if (mask & input) {
-            output |= 0xFFFF0000;
-          }
-
-          alu_out = static_cast<int32_t>(output);
-          break;
-        }
-        case WSBH: {
-          uint32_t input = static_cast<uint32_t>(rt());
-          uint32_t output = 0;
-
-          uint32_t mask = 0xFF000000;
-          for (int i = 0; i < 4; i++) {
-            uint32_t tmp = mask & input;
-            if (i % 2 == 0) {
-              tmp = tmp >> 8;
-            } else {
-              tmp = tmp << 8;
-            }
-            output = output | tmp;
-            mask = mask >> 8;
-          }
-
-          alu_out = static_cast<int32_t>(output);
-          break;
-        }
-        default: {
-          const uint8_t bp = instr_.Bp2Value();
-          sa >>= kBp2Bits;
-          switch (sa) {
-            case ALIGN: {
-              if (bp == 0) {
-                alu_out = static_cast<int32_t>(rt());
-              } else {
-                uint32_t rt_hi = rt() << (8 * bp);
-                uint32_t rs_lo = rs() >> (8 * (4 - bp));
-                alu_out = static_cast<int32_t>(rt_hi | rs_lo);
-              }
-              break;
-            }
-            default:
-              alu_out = 0x12345678;
-              UNREACHABLE();
-              break;
-          }
-        }
-      }
-      SetResult(rd_reg(), alu_out);
-      break;
-    }
-    default:
-      UNREACHABLE();
-  }
-}
-
-int Simulator::DecodeMsaDataFormat() {
-  int df = -1;
-  if (instr_.IsMSABranchInstr()) {
-    switch (instr_.RsFieldRaw()) {
-      case BZ_V:
-      case BNZ_V:
-        df = MSA_VECT;
-        break;
-      case BZ_B:
-      case BNZ_B:
-        df = MSA_BYTE;
-        break;
-      case BZ_H:
-      case BNZ_H:
-        df = MSA_HALF;
-        break;
-      case BZ_W:
-      case BNZ_W:
-        df = MSA_WORD;
-        break;
-      case BZ_D:
-      case BNZ_D:
-        df = MSA_DWORD;
-        break;
-      default:
-        UNREACHABLE();
-        break;
-    }
-  } else {
-    int DF[] = {MSA_BYTE, MSA_HALF, MSA_WORD, MSA_DWORD};
-    switch (instr_.MSAMinorOpcodeField()) {
-      case kMsaMinorI5:
-      case kMsaMinorI10:
-      case kMsaMinor3R:
-        df = DF[instr_.Bits(22, 21)];
-        break;
-      case kMsaMinorMI10:
-        df = DF[instr_.Bits(1, 0)];
-        break;
-      case kMsaMinorBIT:
-        df = DF[instr_.MsaBitDf()];
-        break;
-      case kMsaMinorELM:
-        df = DF[instr_.MsaElmDf()];
-        break;
-      case kMsaMinor3RF: {
-        uint32_t opcode = instr_.InstructionBits() & kMsa3RFMask;
-        switch (opcode) {
-          case FEXDO:
-          case FTQ:
-          case MUL_Q:
-          case MADD_Q:
-          case MSUB_Q:
-          case MULR_Q:
-          case MADDR_Q:
-          case MSUBR_Q:
-            df = DF[1 + instr_.Bit(21)];
-            break;
-          default:
-            df = DF[2 + instr_.Bit(21)];
-            break;
-        }
-      } break;
-      case kMsaMinor2R:
-        df = DF[instr_.Bits(17, 16)];
-        break;
-      case kMsaMinor2RF:
-        df = DF[2 + instr_.Bit(16)];
-        break;
-      default:
-        UNREACHABLE();
-        break;
-    }
-  }
-  return df;
-}
-
-void Simulator::DecodeTypeMsaI8() {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(CpuFeatures::IsSupported(MIPS_SIMD));
-  uint32_t opcode = instr_.InstructionBits() & kMsaI8Mask;
-  int8_t i8 = instr_.MsaImm8Value();
-  msa_reg_t ws, wd;
-
-  switch (opcode) {
-    case ANDI_B:
-      get_msa_register(instr_.WsValue(), ws.b);
-      for (int i = 0; i < kMSALanesByte; i++) {
-        wd.b[i] = ws.b[i] & i8;
-      }
-      set_msa_register(instr_.WdValue(), wd.b);
-      TraceMSARegWr(wd.b);
-      break;
-    case ORI_B:
-      get_msa_register(instr_.WsValue(), ws.b);
-      for (int i = 0; i < kMSALanesByte; i++) {
-        wd.b[i] = ws.b[i] | i8;
-      }
-      set_msa_register(instr_.WdValue(), wd.b);
-      TraceMSARegWr(wd.b);
-      break;
-    case NORI_B:
-      get_msa_register(instr_.WsValue(), ws.b);
-      for (int i = 0; i < kMSALanesByte; i++) {
-        wd.b[i] = ~(ws.b[i] | i8);
-      }
-      set_msa_register(instr_.WdValue(), wd.b);
-      TraceMSARegWr(wd.b);
-      break;
-    case XORI_B:
-      get_msa_register(instr_.WsValue(), ws.b);
-      for (int i = 0; i < kMSALanesByte; i++) {
-        wd.b[i] = ws.b[i] ^ i8;
-      }
-      set_msa_register(instr_.WdValue(), wd.b);
-      TraceMSARegWr(wd.b);
-      break;
-    case BMNZI_B:
-      get_msa_register(instr_.WsValue(), ws.b);
-      get_msa_register(instr_.WdValue(), wd.b);
-      for (int i = 0; i < kMSALanesByte; i++) {
-        wd.b[i] = (ws.b[i] & i8) | (wd.b[i] & ~i8);
-      }
-      set_msa_register(instr_.WdValue(), wd.b);
-      TraceMSARegWr(wd.b);
-      break;
-    case BMZI_B:
-      get_msa_register(instr_.WsValue(), ws.b);
-      get_msa_register(instr_.WdValue(), wd.b);
-      for (int i = 0; i < kMSALanesByte; i++) {
-        wd.b[i] = (ws.b[i] & ~i8) | (wd.b[i] & i8);
-      }
-      set_msa_register(instr_.WdValue(), wd.b);
-      TraceMSARegWr(wd.b);
-      break;
-    case BSELI_B:
-      get_msa_register(instr_.WsValue(), ws.b);
-      get_msa_register(instr_.WdValue(), wd.b);
-      for (int i = 0; i < kMSALanesByte; i++) {
-        wd.b[i] = (ws.b[i] & ~wd.b[i]) | (wd.b[i] & i8);
-      }
-      set_msa_register(instr_.WdValue(), wd.b);
-      TraceMSARegWr(wd.b);
-      break;
-    case SHF_B:
-      get_msa_register(instr_.WsValue(), ws.b);
-      for (int i = 0; i < kMSALanesByte; i++) {
-        int j = i % 4;
-        int k = (i8 >> (2 * j)) & 0x3;
-        wd.b[i] = ws.b[i - j + k];
-      }
-      set_msa_register(instr_.WdValue(), wd.b);
-      TraceMSARegWr(wd.b);
-      break;
-    case SHF_H:
-      get_msa_register(instr_.WsValue(), ws.h);
-      for (int i = 0; i < kMSALanesHalf; i++) {
-        int j = i % 4;
-        int k = (i8 >> (2 * j)) & 0x3;
-        wd.h[i] = ws.h[i - j + k];
-      }
-      set_msa_register(instr_.WdValue(), wd.h);
-      TraceMSARegWr(wd.h);
-      break;
-    case SHF_W:
-      get_msa_register(instr_.WsValue(), ws.w);
-      for (int i = 0; i < kMSALanesWord; i++) {
-        int j = (i8 >> (2 * i)) & 0x3;
-        wd.w[i] = ws.w[j];
-      }
-      set_msa_register(instr_.WdValue(), wd.w);
-      TraceMSARegWr(wd.w);
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-template <typename T>
-T Simulator::MsaI5InstrHelper(uint32_t opcode, T ws, int32_t i5) {
-  T res;
-  uint32_t ui5 = i5 & 0x1Fu;
-  uint64_t ws_u64 = static_cast<uint64_t>(ws);
-  uint64_t ui5_u64 = static_cast<uint64_t>(ui5);
-
-  switch (opcode) {
-    case ADDVI:
-      res = static_cast<T>(ws + ui5);
-      break;
-    case SUBVI:
-      res = static_cast<T>(ws - ui5);
-      break;
-    case MAXI_S:
-      res = static_cast<T>(Max(ws, static_cast<T>(i5)));
-      break;
-    case MINI_S:
-      res = static_cast<T>(Min(ws, static_cast<T>(i5)));
-      break;
-    case MAXI_U:
-      res = static_cast<T>(Max(ws_u64, ui5_u64));
-      break;
-    case MINI_U:
-      res = static_cast<T>(Min(ws_u64, ui5_u64));
-      break;
-    case CEQI:
-      res = static_cast<T>(!Compare(ws, static_cast<T>(i5)) ? -1ull : 0ull);
-      break;
-    case CLTI_S:
-      res = static_cast<T>((Compare(ws, static_cast<T>(i5)) == -1) ? -1ull
-                                                                   : 0ull);
-      break;
-    case CLTI_U:
-      res = static_cast<T>((Compare(ws_u64, ui5_u64) == -1) ? -1ull : 0ull);
-      break;
-    case CLEI_S:
-      res =
-          static_cast<T>((Compare(ws, static_cast<T>(i5)) != 1) ? -1ull : 0ull);
-      break;
-    case CLEI_U:
-      res = static_cast<T>((Compare(ws_u64, ui5_u64) != 1) ? -1ull : 0ull);
-      break;
-    default:
-      UNREACHABLE();
-  }
-  return res;
-}
-
-void Simulator::DecodeTypeMsaI5() {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(CpuFeatures::IsSupported(MIPS_SIMD));
-  uint32_t opcode = instr_.InstructionBits() & kMsaI5Mask;
-  msa_reg_t ws, wd;
-
-  // sign extend 5bit value to int32_t
-  int32_t i5 = static_cast<int32_t>(instr_.MsaImm5Value() << 27) >> 27;
-
-#define MSA_I5_DF(elem, num_of_lanes)                      \
-  get_msa_register(instr_.WsValue(), ws.elem);             \
-  for (int i = 0; i < num_of_lanes; i++) {                 \
-    wd.elem[i] = MsaI5InstrHelper(opcode, ws.elem[i], i5); \
-  }                                                        \
-  set_msa_register(instr_.WdValue(), wd.elem);             \
-  TraceMSARegWr(wd.elem)
-
-  switch (DecodeMsaDataFormat()) {
-    case MSA_BYTE:
-      MSA_I5_DF(b, kMSALanesByte);
-      break;
-    case MSA_HALF:
-      MSA_I5_DF(h, kMSALanesHalf);
-      break;
-    case MSA_WORD:
-      MSA_I5_DF(w, kMSALanesWord);
-      break;
-    case MSA_DWORD:
-      MSA_I5_DF(d, kMSALanesDword);
-      break;
-    default:
-      UNREACHABLE();
-  }
-#undef MSA_I5_DF
-}
-
-void Simulator::DecodeTypeMsaI10() {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(CpuFeatures::IsSupported(MIPS_SIMD));
-  uint32_t opcode = instr_.InstructionBits() & kMsaI5Mask;
-  int64_t s10 = (static_cast<int64_t>(instr_.MsaImm10Value()) << 54) >> 54;
-  msa_reg_t wd;
-
-#define MSA_I10_DF(elem, num_of_lanes, T)      \
-  for (int i = 0; i < num_of_lanes; ++i) {     \
-    wd.elem[i] = static_cast<T>(s10);          \
-  }                                            \
-  set_msa_register(instr_.WdValue(), wd.elem); \
-  TraceMSARegWr(wd.elem)
-
-  if (opcode == LDI) {
-    switch (DecodeMsaDataFormat()) {
-      case MSA_BYTE:
-        MSA_I10_DF(b, kMSALanesByte, int8_t);
-        break;
-      case MSA_HALF:
-        MSA_I10_DF(h, kMSALanesHalf, int16_t);
-        break;
-      case MSA_WORD:
-        MSA_I10_DF(w, kMSALanesWord, int32_t);
-        break;
-      case MSA_DWORD:
-        MSA_I10_DF(d, kMSALanesDword, int64_t);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  } else {
-    UNREACHABLE();
-  }
-#undef MSA_I10_DF
-}
-
-void Simulator::DecodeTypeMsaELM() {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(CpuFeatures::IsSupported(MIPS_SIMD));
-  uint32_t opcode = instr_.InstructionBits() & kMsaLongerELMMask;
-  int32_t n = instr_.MsaElmNValue();
-  int32_t alu_out;
-  switch (opcode) {
-    case CTCMSA:
-      DCHECK_EQ(sa(), kMSACSRRegister);
-      MSACSR_ = bit_cast<uint32_t>(registers_[rd_reg()]);
-      TraceRegWr(static_cast<int32_t>(MSACSR_));
-      break;
-    case CFCMSA:
-      DCHECK_EQ(rd_reg(), kMSACSRRegister);
-      SetResult(sa(), bit_cast<int32_t>(MSACSR_));
-      break;
-    case MOVE_V: {
-      msa_reg_t ws;
-      get_msa_register(ws_reg(), &ws);
-      set_msa_register(wd_reg(), &ws);
-      TraceMSARegWr(&ws);
-    } break;
-    default:
-      opcode &= kMsaELMMask;
-      switch (opcode) {
-        case COPY_S:
-        case COPY_U: {
-          msa_reg_t ws;
-          switch (DecodeMsaDataFormat()) {
-            case MSA_BYTE: {
-              DCHECK_LT(n, kMSALanesByte);
-              get_msa_register(instr_.WsValue(), ws.b);
-              alu_out = static_cast<int32_t>(ws.b[n]);
-              SetResult(wd_reg(),
-                        (opcode == COPY_U) ? alu_out & 0xFFu : alu_out);
-              break;
-            }
-            case MSA_HALF: {
-              DCHECK_LT(n, kMSALanesHalf);
-              get_msa_register(instr_.WsValue(), ws.h);
-              alu_out = static_cast<int32_t>(ws.h[n]);
-              SetResult(wd_reg(),
-                        (opcode == COPY_U) ? alu_out & 0xFFFFu : alu_out);
-              break;
-            }
-            case MSA_WORD: {
-              DCHECK_LT(n, kMSALanesWord);
-              get_msa_register(instr_.WsValue(), ws.w);
-              alu_out = static_cast<int32_t>(ws.w[n]);
-              SetResult(wd_reg(), alu_out);
-              break;
-            }
-            default:
-              UNREACHABLE();
-          }
-        } break;
-        case INSERT: {
-          msa_reg_t wd;
-          switch (DecodeMsaDataFormat()) {
-            case MSA_BYTE: {
-              DCHECK_LT(n, kMSALanesByte);
-              int32_t rs = get_register(instr_.WsValue());
-              get_msa_register(instr_.WdValue(), wd.b);
-              wd.b[n] = rs & 0xFFu;
-              set_msa_register(instr_.WdValue(), wd.b);
-              TraceMSARegWr(wd.b);
-              break;
-            }
-            case MSA_HALF: {
-              DCHECK_LT(n, kMSALanesHalf);
-              int32_t rs = get_register(instr_.WsValue());
-              get_msa_register(instr_.WdValue(), wd.h);
-              wd.h[n] = rs & 0xFFFFu;
-              set_msa_register(instr_.WdValue(), wd.h);
-              TraceMSARegWr(wd.h);
-              break;
-            }
-            case MSA_WORD: {
-              DCHECK_LT(n, kMSALanesWord);
-              int32_t rs = get_register(instr_.WsValue());
-              get_msa_register(instr_.WdValue(), wd.w);
-              wd.w[n] = rs;
-              set_msa_register(instr_.WdValue(), wd.w);
-              TraceMSARegWr(wd.w);
-              break;
-            }
-            default:
-              UNREACHABLE();
-          }
-        } break;
-        case SLDI: {
-          uint8_t v[32];
-          msa_reg_t ws;
-          msa_reg_t wd;
-          get_msa_register(ws_reg(), &ws);
-          get_msa_register(wd_reg(), &wd);
-#define SLDI_DF(s, k)                \
-  for (unsigned i = 0; i < s; i++) { \
-    v[i] = ws.b[s * k + i];          \
-    v[i + s] = wd.b[s * k + i];      \
-  }                                  \
-  for (unsigned i = 0; i < s; i++) { \
-    wd.b[s * k + i] = v[i + n];      \
-  }
-          switch (DecodeMsaDataFormat()) {
-            case MSA_BYTE:
-              DCHECK(n < kMSALanesByte);
-              SLDI_DF(kMSARegSize / sizeof(int8_t) / kBitsPerByte, 0)
-              break;
-            case MSA_HALF:
-              DCHECK(n < kMSALanesHalf);
-              for (int k = 0; k < 2; ++k) {
-                SLDI_DF(kMSARegSize / sizeof(int16_t) / kBitsPerByte, k)
-              }
-              break;
-            case MSA_WORD:
-              DCHECK(n < kMSALanesWord);
-              for (int k = 0; k < 4; ++k) {
-                SLDI_DF(kMSARegSize / sizeof(int32_t) / kBitsPerByte, k)
-              }
-              break;
-            case MSA_DWORD:
-              DCHECK(n < kMSALanesDword);
-              for (int k = 0; k < 8; ++k) {
-                SLDI_DF(kMSARegSize / sizeof(int64_t) / kBitsPerByte, k)
-              }
-              break;
-            default:
-              UNREACHABLE();
-          }
-          set_msa_register(wd_reg(), &wd);
-          TraceMSARegWr(&wd);
-        } break;
-#undef SLDI_DF
-        case SPLATI:
-        case INSVE:
-          UNIMPLEMENTED();
-          break;
-        default:
-          UNREACHABLE();
-      }
-      break;
-  }
-}
-
-template <typename T>
-T Simulator::MsaBitInstrHelper(uint32_t opcode, T wd, T ws, int32_t m) {
-  typedef typename std::make_unsigned<T>::type uT;
-  T res;
-  switch (opcode) {
-    case SLLI:
-      res = static_cast<T>(ws << m);
-      break;
-    case SRAI:
-      res = static_cast<T>(ArithmeticShiftRight(ws, m));
-      break;
-    case SRLI:
-      res = static_cast<T>(static_cast<uT>(ws) >> m);
-      break;
-    case BCLRI:
-      res = static_cast<T>(static_cast<T>(~(1ull << m)) & ws);
-      break;
-    case BSETI:
-      res = static_cast<T>(static_cast<T>(1ull << m) | ws);
-      break;
-    case BNEGI:
-      res = static_cast<T>(static_cast<T>(1ull << m) ^ ws);
-      break;
-    case BINSLI: {
-      int elem_size = 8 * sizeof(T);
-      int bits = m + 1;
-      if (bits == elem_size) {
-        res = static_cast<T>(ws);
-      } else {
-        uint64_t mask = ((1ull << bits) - 1) << (elem_size - bits);
-        res = static_cast<T>((static_cast<T>(mask) & ws) |
-                             (static_cast<T>(~mask) & wd));
-      }
-    } break;
-    case BINSRI: {
-      int elem_size = 8 * sizeof(T);
-      int bits = m + 1;
-      if (bits == elem_size) {
-        res = static_cast<T>(ws);
-      } else {
-        uint64_t mask = (1ull << bits) - 1;
-        res = static_cast<T>((static_cast<T>(mask) & ws) |
-                             (static_cast<T>(~mask) & wd));
-      }
-    } break;
-    case SAT_S: {
-#define M_MAX_INT(x) static_cast<int64_t>((1LL << ((x)-1)) - 1)
-#define M_MIN_INT(x) static_cast<int64_t>(-(1LL << ((x)-1)))
-      int shift = 64 - 8 * sizeof(T);
-      int64_t ws_i64 = (static_cast<int64_t>(ws) << shift) >> shift;
-      res = static_cast<T>(ws_i64 < M_MIN_INT(m + 1)
-                               ? M_MIN_INT(m + 1)
-                               : ws_i64 > M_MAX_INT(m + 1) ? M_MAX_INT(m + 1)
-                                                           : ws_i64);
-#undef M_MAX_INT
-#undef M_MIN_INT
-    } break;
-    case SAT_U: {
-#define M_MAX_UINT(x) static_cast<uint64_t>(-1ULL >> (64 - (x)))
-      uint64_t mask = static_cast<uint64_t>(-1ULL >> (64 - 8 * sizeof(T)));
-      uint64_t ws_u64 = static_cast<uint64_t>(ws) & mask;
-      res = static_cast<T>(ws_u64 < M_MAX_UINT(m + 1) ? ws_u64
-                                                      : M_MAX_UINT(m + 1));
-#undef M_MAX_UINT
-    } break;
-    case SRARI:
-      if (!m) {
-        res = static_cast<T>(ws);
-      } else {
-        res = static_cast<T>(ArithmeticShiftRight(ws, m)) +
-              static_cast<T>((ws >> (m - 1)) & 0x1);
-      }
-      break;
-    case SRLRI:
-      if (!m) {
-        res = static_cast<T>(ws);
-      } else {
-        res = static_cast<T>(static_cast<uT>(ws) >> m) +
-              static_cast<T>((ws >> (m - 1)) & 0x1);
-      }
-      break;
-    default:
-      UNREACHABLE();
-  }
-  return res;
-}
-
-void Simulator::DecodeTypeMsaBIT() {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(CpuFeatures::IsSupported(MIPS_SIMD));
-  uint32_t opcode = instr_.InstructionBits() & kMsaBITMask;
-  int32_t m = instr_.MsaBitMValue();
-  msa_reg_t wd, ws;
-
-#define MSA_BIT_DF(elem, num_of_lanes)                                 \
-  get_msa_register(instr_.WsValue(), ws.elem);                         \
-  if (opcode == BINSLI || opcode == BINSRI) {                          \
-    get_msa_register(instr_.WdValue(), wd.elem);                       \
-  }                                                                    \
-  for (int i = 0; i < num_of_lanes; i++) {                             \
-    wd.elem[i] = MsaBitInstrHelper(opcode, wd.elem[i], ws.elem[i], m); \
-  }                                                                    \
-  set_msa_register(instr_.WdValue(), wd.elem);                         \
-  TraceMSARegWr(wd.elem)
-
-  switch (DecodeMsaDataFormat()) {
-    case MSA_BYTE:
-      DCHECK(m < kMSARegSize / kMSALanesByte);
-      MSA_BIT_DF(b, kMSALanesByte);
-      break;
-    case MSA_HALF:
-      DCHECK(m < kMSARegSize / kMSALanesHalf);
-      MSA_BIT_DF(h, kMSALanesHalf);
-      break;
-    case MSA_WORD:
-      DCHECK(m < kMSARegSize / kMSALanesWord);
-      MSA_BIT_DF(w, kMSALanesWord);
-      break;
-    case MSA_DWORD:
-      DCHECK(m < kMSARegSize / kMSALanesDword);
-      MSA_BIT_DF(d, kMSALanesDword);
-      break;
-    default:
-      UNREACHABLE();
-  }
-#undef MSA_BIT_DF
-}
-
-void Simulator::DecodeTypeMsaMI10() {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(CpuFeatures::IsSupported(MIPS_SIMD));
-  uint32_t opcode = instr_.InstructionBits() & kMsaMI10Mask;
-  int32_t s10 = (static_cast<int32_t>(instr_.MsaImmMI10Value()) << 22) >> 22;
-  int32_t rs = get_register(instr_.WsValue());
-  int32_t addr;
-  msa_reg_t wd;
-
-#define MSA_MI10_LOAD(elem, num_of_lanes, T)       \
-  for (int i = 0; i < num_of_lanes; ++i) {         \
-    addr = rs + (s10 + i) * sizeof(T);             \
-    wd.elem[i] = ReadMem<T>(addr, instr_.instr()); \
-  }                                                \
-  set_msa_register(instr_.WdValue(), wd.elem);
-
-#define MSA_MI10_STORE(elem, num_of_lanes, T)      \
-  get_msa_register(instr_.WdValue(), wd.elem);     \
-  for (int i = 0; i < num_of_lanes; ++i) {         \
-    addr = rs + (s10 + i) * sizeof(T);             \
-    WriteMem<T>(addr, wd.elem[i], instr_.instr()); \
-  }
-
-  if (opcode == MSA_LD) {
-    switch (DecodeMsaDataFormat()) {
-      case MSA_BYTE:
-        MSA_MI10_LOAD(b, kMSALanesByte, int8_t);
-        break;
-      case MSA_HALF:
-        MSA_MI10_LOAD(h, kMSALanesHalf, int16_t);
-        break;
-      case MSA_WORD:
-        MSA_MI10_LOAD(w, kMSALanesWord, int32_t);
-        break;
-      case MSA_DWORD:
-        MSA_MI10_LOAD(d, kMSALanesDword, int64_t);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  } else if (opcode == MSA_ST) {
-    switch (DecodeMsaDataFormat()) {
-      case MSA_BYTE:
-        MSA_MI10_STORE(b, kMSALanesByte, int8_t);
-        break;
-      case MSA_HALF:
-        MSA_MI10_STORE(h, kMSALanesHalf, int16_t);
-        break;
-      case MSA_WORD:
-        MSA_MI10_STORE(w, kMSALanesWord, int32_t);
-        break;
-      case MSA_DWORD:
-        MSA_MI10_STORE(d, kMSALanesDword, int64_t);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  } else {
-    UNREACHABLE();
-  }
-
-#undef MSA_MI10_LOAD
-#undef MSA_MI10_STORE
-}
-
-template <typename T>
-T Simulator::Msa3RInstrHelper(uint32_t opcode, T wd, T ws, T wt) {
-  typedef typename std::make_unsigned<T>::type uT;
-  T res;
-  T wt_modulo = wt % (sizeof(T) * 8);
-  switch (opcode) {
-    case SLL_MSA:
-      res = static_cast<T>(ws << wt_modulo);
-      break;
-    case SRA_MSA:
-      res = static_cast<T>(ArithmeticShiftRight(ws, wt_modulo));
-      break;
-    case SRL_MSA:
-      res = static_cast<T>(static_cast<uT>(ws) >> wt_modulo);
-      break;
-    case BCLR:
-      res = static_cast<T>(static_cast<T>(~(1ull << wt_modulo)) & ws);
-      break;
-    case BSET:
-      res = static_cast<T>(static_cast<T>(1ull << wt_modulo) | ws);
-      break;
-    case BNEG:
-      res = static_cast<T>(static_cast<T>(1ull << wt_modulo) ^ ws);
-      break;
-    case BINSL: {
-      int elem_size = 8 * sizeof(T);
-      int bits = wt_modulo + 1;
-      if (bits == elem_size) {
-        res = static_cast<T>(ws);
-      } else {
-        uint64_t mask = ((1ull << bits) - 1) << (elem_size - bits);
-        res = static_cast<T>((static_cast<T>(mask) & ws) |
-                             (static_cast<T>(~mask) & wd));
-      }
-    } break;
-    case BINSR: {
-      int elem_size = 8 * sizeof(T);
-      int bits = wt_modulo + 1;
-      if (bits == elem_size) {
-        res = static_cast<T>(ws);
-      } else {
-        uint64_t mask = (1ull << bits) - 1;
-        res = static_cast<T>((static_cast<T>(mask) & ws) |
-                             (static_cast<T>(~mask) & wd));
-      }
-    } break;
-    case ADDV:
-      res = ws + wt;
-      break;
-    case SUBV:
-      res = ws - wt;
-      break;
-    case MAX_S:
-      res = Max(ws, wt);
-      break;
-    case MAX_U:
-      res = static_cast<T>(Max(static_cast<uT>(ws), static_cast<uT>(wt)));
-      break;
-    case MIN_S:
-      res = Min(ws, wt);
-      break;
-    case MIN_U:
-      res = static_cast<T>(Min(static_cast<uT>(ws), static_cast<uT>(wt)));
-      break;
-    case MAX_A:
-      // We use negative abs in order to avoid problems
-      // with corner case for MIN_INT
-      res = Nabs(ws) < Nabs(wt) ? ws : wt;
-      break;
-    case MIN_A:
-      // We use negative abs in order to avoid problems
-      // with corner case for MIN_INT
-      res = Nabs(ws) > Nabs(wt) ? ws : wt;
-      break;
-    case CEQ:
-      res = static_cast<T>(!Compare(ws, wt) ? -1ull : 0ull);
-      break;
-    case CLT_S:
-      res = static_cast<T>((Compare(ws, wt) == -1) ? -1ull : 0ull);
-      break;
-    case CLT_U:
-      res = static_cast<T>(
-          (Compare(static_cast<uT>(ws), static_cast<uT>(wt)) == -1) ? -1ull
-                                                                    : 0ull);
-      break;
-    case CLE_S:
-      res = static_cast<T>((Compare(ws, wt) != 1) ? -1ull : 0ull);
-      break;
-    case CLE_U:
-      res = static_cast<T>(
-          (Compare(static_cast<uT>(ws), static_cast<uT>(wt)) != 1) ? -1ull
-                                                                   : 0ull);
-      break;
-    case ADD_A:
-      res = static_cast<T>(Abs(ws) + Abs(wt));
-      break;
-    case ADDS_A: {
-      T ws_nabs = Nabs(ws);
-      T wt_nabs = Nabs(wt);
-      if (ws_nabs < -std::numeric_limits<T>::max() - wt_nabs) {
-        res = std::numeric_limits<T>::max();
-      } else {
-        res = -(ws_nabs + wt_nabs);
-      }
-    } break;
-    case ADDS_S:
-      res = SaturateAdd(ws, wt);
-      break;
-    case ADDS_U: {
-      uT ws_u = static_cast<uT>(ws);
-      uT wt_u = static_cast<uT>(wt);
-      res = static_cast<T>(SaturateAdd(ws_u, wt_u));
-    } break;
-    case AVE_S:
-      res = static_cast<T>((wt & ws) + ((wt ^ ws) >> 1));
-      break;
-    case AVE_U: {
-      uT ws_u = static_cast<uT>(ws);
-      uT wt_u = static_cast<uT>(wt);
-      res = static_cast<T>((wt_u & ws_u) + ((wt_u ^ ws_u) >> 1));
-    } break;
-    case AVER_S:
-      res = static_cast<T>((wt | ws) - ((wt ^ ws) >> 1));
-      break;
-    case AVER_U: {
-      uT ws_u = static_cast<uT>(ws);
-      uT wt_u = static_cast<uT>(wt);
-      res = static_cast<T>((wt_u | ws_u) - ((wt_u ^ ws_u) >> 1));
-    } break;
-    case SUBS_S:
-      res = SaturateSub(ws, wt);
-      break;
-    case SUBS_U: {
-      uT ws_u = static_cast<uT>(ws);
-      uT wt_u = static_cast<uT>(wt);
-      res = static_cast<T>(SaturateSub(ws_u, wt_u));
-    } break;
-    case SUBSUS_U: {
-      uT wsu = static_cast<uT>(ws);
-      if (wt > 0) {
-        uT wtu = static_cast<uT>(wt);
-        if (wtu > wsu) {
-          res = 0;
-        } else {
-          res = static_cast<T>(wsu - wtu);
-        }
-      } else {
-        if (wsu > std::numeric_limits<uT>::max() + wt) {
-          res = static_cast<T>(std::numeric_limits<uT>::max());
-        } else {
-          res = static_cast<T>(wsu - wt);
-        }
-      }
-    } break;
-    case SUBSUU_S: {
-      uT wsu = static_cast<uT>(ws);
-      uT wtu = static_cast<uT>(wt);
-      uT wdu;
-      if (wsu > wtu) {
-        wdu = wsu - wtu;
-        if (wdu > std::numeric_limits<T>::max()) {
-          res = std::numeric_limits<T>::max();
-        } else {
-          res = static_cast<T>(wdu);
-        }
-      } else {
-        wdu = wtu - wsu;
-        CHECK(-std::numeric_limits<T>::max() ==
-              std::numeric_limits<T>::min() + 1);
-        if (wdu <= std::numeric_limits<T>::max()) {
-          res = -static_cast<T>(wdu);
-        } else {
-          res = std::numeric_limits<T>::min();
-        }
-      }
-    } break;
-    case ASUB_S:
-      res = static_cast<T>(Abs(ws - wt));
-      break;
-    case ASUB_U: {
-      uT wsu = static_cast<uT>(ws);
-      uT wtu = static_cast<uT>(wt);
-      res = static_cast<T>(wsu > wtu ? wsu - wtu : wtu - wsu);
-    } break;
-    case MULV:
-      res = ws * wt;
-      break;
-    case MADDV:
-      res = wd + ws * wt;
-      break;
-    case MSUBV:
-      res = wd - ws * wt;
-      break;
-    case DIV_S_MSA:
-      res = wt != 0 ? ws / wt : static_cast<T>(Unpredictable);
-      break;
-    case DIV_U:
-      res = wt != 0 ? static_cast<T>(static_cast<uT>(ws) / static_cast<uT>(wt))
-                    : static_cast<T>(Unpredictable);
-      break;
-    case MOD_S:
-      res = wt != 0 ? ws % wt : static_cast<T>(Unpredictable);
-      break;
-    case MOD_U:
-      res = wt != 0 ? static_cast<T>(static_cast<uT>(ws) % static_cast<uT>(wt))
-                    : static_cast<T>(Unpredictable);
-      break;
-    case DOTP_S:
-    case DOTP_U:
-    case DPADD_S:
-    case DPADD_U:
-    case DPSUB_S:
-    case DPSUB_U:
-    case SLD:
-    case SPLAT:
-      UNIMPLEMENTED();
-      break;
-    case SRAR: {
-      int bit = wt_modulo == 0 ? 0 : (ws >> (wt_modulo - 1)) & 1;
-      res = static_cast<T>(ArithmeticShiftRight(ws, wt_modulo) + bit);
-    } break;
-    case SRLR: {
-      uT wsu = static_cast<uT>(ws);
-      int bit = wt_modulo == 0 ? 0 : (wsu >> (wt_modulo - 1)) & 1;
-      res = static_cast<T>((wsu >> wt_modulo) + bit);
-    } break;
-    default:
-      UNREACHABLE();
-  }
-  return res;
-}
-
-template <typename T_int, typename T_reg>
-void Msa3RInstrHelper_shuffle(const uint32_t opcode, T_reg ws, T_reg wt,
-                              T_reg wd, const int i, const int num_of_lanes) {
-  T_int *ws_p, *wt_p, *wd_p;
-  ws_p = reinterpret_cast<T_int*>(ws);
-  wt_p = reinterpret_cast<T_int*>(wt);
-  wd_p = reinterpret_cast<T_int*>(wd);
-  switch (opcode) {
-    case PCKEV:
-      wd_p[i] = wt_p[2 * i];
-      wd_p[i + num_of_lanes / 2] = ws_p[2 * i];
-      break;
-    case PCKOD:
-      wd_p[i] = wt_p[2 * i + 1];
-      wd_p[i + num_of_lanes / 2] = ws_p[2 * i + 1];
-      break;
-    case ILVL:
-      wd_p[2 * i] = wt_p[i + num_of_lanes / 2];
-      wd_p[2 * i + 1] = ws_p[i + num_of_lanes / 2];
-      break;
-    case ILVR:
-      wd_p[2 * i] = wt_p[i];
-      wd_p[2 * i + 1] = ws_p[i];
-      break;
-    case ILVEV:
-      wd_p[2 * i] = wt_p[2 * i];
-      wd_p[2 * i + 1] = ws_p[2 * i];
-      break;
-    case ILVOD:
-      wd_p[2 * i] = wt_p[2 * i + 1];
-      wd_p[2 * i + 1] = ws_p[2 * i + 1];
-      break;
-    case VSHF: {
-      const int mask_not_valid = 0xC0;
-      const int mask_6_bits = 0x3F;
-      if ((wd_p[i] & mask_not_valid)) {
-        wd_p[i] = 0;
-      } else {
-        int k = (wd_p[i] & mask_6_bits) % (num_of_lanes * 2);
-        wd_p[i] = k >= num_of_lanes ? ws_p[k - num_of_lanes] : wt_p[k];
-      }
-    } break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-template <typename T_int, typename T_smaller_int, typename T_reg>
-void Msa3RInstrHelper_horizontal(const uint32_t opcode, T_reg ws, T_reg wt,
-                                 T_reg wd, const int i,
-                                 const int num_of_lanes) {
-  typedef typename std::make_unsigned<T_int>::type T_uint;
-  typedef typename std::make_unsigned<T_smaller_int>::type T_smaller_uint;
-  T_int* wd_p;
-  T_smaller_int *ws_p, *wt_p;
-  ws_p = reinterpret_cast<T_smaller_int*>(ws);
-  wt_p = reinterpret_cast<T_smaller_int*>(wt);
-  wd_p = reinterpret_cast<T_int*>(wd);
-  T_uint* wd_pu;
-  T_smaller_uint *ws_pu, *wt_pu;
-  ws_pu = reinterpret_cast<T_smaller_uint*>(ws);
-  wt_pu = reinterpret_cast<T_smaller_uint*>(wt);
-  wd_pu = reinterpret_cast<T_uint*>(wd);
-  switch (opcode) {
-    case HADD_S:
-      wd_p[i] =
-          static_cast<T_int>(ws_p[2 * i + 1]) + static_cast<T_int>(wt_p[2 * i]);
-      break;
-    case HADD_U:
-      wd_pu[i] = static_cast<T_uint>(ws_pu[2 * i + 1]) +
-                 static_cast<T_uint>(wt_pu[2 * i]);
-      break;
-    case HSUB_S:
-      wd_p[i] =
-          static_cast<T_int>(ws_p[2 * i + 1]) - static_cast<T_int>(wt_p[2 * i]);
-      break;
-    case HSUB_U:
-      wd_pu[i] = static_cast<T_uint>(ws_pu[2 * i + 1]) -
-                 static_cast<T_uint>(wt_pu[2 * i]);
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Simulator::DecodeTypeMsa3R() {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(CpuFeatures::IsSupported(MIPS_SIMD));
-  uint32_t opcode = instr_.InstructionBits() & kMsa3RMask;
-  msa_reg_t ws, wd, wt;
-  get_msa_register(ws_reg(), &ws);
-  get_msa_register(wt_reg(), &wt);
-  get_msa_register(wd_reg(), &wd);
-  switch (opcode) {
-    case HADD_S:
-    case HADD_U:
-    case HSUB_S:
-    case HSUB_U:
-#define HORIZONTAL_ARITHMETIC_DF(num_of_lanes, int_type, lesser_int_type) \
-  for (int i = 0; i < num_of_lanes; ++i) {                                \
-    Msa3RInstrHelper_horizontal<int_type, lesser_int_type>(               \
-        opcode, &ws, &wt, &wd, i, num_of_lanes);                          \
-  }
-      switch (DecodeMsaDataFormat()) {
-        case MSA_HALF:
-          HORIZONTAL_ARITHMETIC_DF(kMSALanesHalf, int16_t, int8_t);
-          break;
-        case MSA_WORD:
-          HORIZONTAL_ARITHMETIC_DF(kMSALanesWord, int32_t, int16_t);
-          break;
-        case MSA_DWORD:
-          HORIZONTAL_ARITHMETIC_DF(kMSALanesDword, int64_t, int32_t);
-          break;
-        default:
-          UNREACHABLE();
-      }
-      break;
-#undef HORIZONTAL_ARITHMETIC_DF
-    case VSHF:
-#define VSHF_DF(num_of_lanes, int_type)                          \
-  for (int i = 0; i < num_of_lanes; ++i) {                       \
-    Msa3RInstrHelper_shuffle<int_type>(opcode, &ws, &wt, &wd, i, \
-                                       num_of_lanes);            \
-  }
-      switch (DecodeMsaDataFormat()) {
-        case MSA_BYTE:
-          VSHF_DF(kMSALanesByte, int8_t);
-          break;
-        case MSA_HALF:
-          VSHF_DF(kMSALanesHalf, int16_t);
-          break;
-        case MSA_WORD:
-          VSHF_DF(kMSALanesWord, int32_t);
-          break;
-        case MSA_DWORD:
-          VSHF_DF(kMSALanesDword, int64_t);
-          break;
-        default:
-          UNREACHABLE();
-      }
-#undef VSHF_DF
-      break;
-    case PCKEV:
-    case PCKOD:
-    case ILVL:
-    case ILVR:
-    case ILVEV:
-    case ILVOD:
-#define INTERLEAVE_PACK_DF(num_of_lanes, int_type)               \
-  for (int i = 0; i < num_of_lanes / 2; ++i) {                   \
-    Msa3RInstrHelper_shuffle<int_type>(opcode, &ws, &wt, &wd, i, \
-                                       num_of_lanes);            \
-  }
-      switch (DecodeMsaDataFormat()) {
-        case MSA_BYTE:
-          INTERLEAVE_PACK_DF(kMSALanesByte, int8_t);
-          break;
-        case MSA_HALF:
-          INTERLEAVE_PACK_DF(kMSALanesHalf, int16_t);
-          break;
-        case MSA_WORD:
-          INTERLEAVE_PACK_DF(kMSALanesWord, int32_t);
-          break;
-        case MSA_DWORD:
-          INTERLEAVE_PACK_DF(kMSALanesDword, int64_t);
-          break;
-        default:
-          UNREACHABLE();
-      }
-      break;
-#undef INTERLEAVE_PACK_DF
-    default:
-#define MSA_3R_DF(elem, num_of_lanes)                                          \
-  for (int i = 0; i < num_of_lanes; i++) {                                     \
-    wd.elem[i] = Msa3RInstrHelper(opcode, wd.elem[i], ws.elem[i], wt.elem[i]); \
-  }
-
-      switch (DecodeMsaDataFormat()) {
-        case MSA_BYTE:
-          MSA_3R_DF(b, kMSALanesByte);
-          break;
-        case MSA_HALF:
-          MSA_3R_DF(h, kMSALanesHalf);
-          break;
-        case MSA_WORD:
-          MSA_3R_DF(w, kMSALanesWord);
-          break;
-        case MSA_DWORD:
-          MSA_3R_DF(d, kMSALanesDword);
-          break;
-        default:
-          UNREACHABLE();
-      }
-#undef MSA_3R_DF
-      break;
-  }
-  set_msa_register(wd_reg(), &wd);
-  TraceMSARegWr(&wd);
-}
-
-template <typename T_int, typename T_fp, typename T_reg>
-void Msa3RFInstrHelper(uint32_t opcode, T_reg ws, T_reg wt, T_reg& wd) {
-  const T_int all_ones = static_cast<T_int>(-1);
-  const T_fp s_element = *reinterpret_cast<T_fp*>(&ws);
-  const T_fp t_element = *reinterpret_cast<T_fp*>(&wt);
-  switch (opcode) {
-    case FCUN: {
-      if (std::isnan(s_element) || std::isnan(t_element)) {
-        wd = all_ones;
-      } else {
-        wd = 0;
-      }
-    } break;
-    case FCEQ: {
-      if (s_element != t_element || std::isnan(s_element) ||
-          std::isnan(t_element)) {
-        wd = 0;
-      } else {
-        wd = all_ones;
-      }
-    } break;
-    case FCUEQ: {
-      if (s_element == t_element || std::isnan(s_element) ||
-          std::isnan(t_element)) {
-        wd = all_ones;
-      } else {
-        wd = 0;
-      }
-    } break;
-    case FCLT: {
-      if (s_element >= t_element || std::isnan(s_element) ||
-          std::isnan(t_element)) {
-        wd = 0;
-      } else {
-        wd = all_ones;
-      }
-    } break;
-    case FCULT: {
-      if (s_element < t_element || std::isnan(s_element) ||
-          std::isnan(t_element)) {
-        wd = all_ones;
-      } else {
-        wd = 0;
-      }
-    } break;
-    case FCLE: {
-      if (s_element > t_element || std::isnan(s_element) ||
-          std::isnan(t_element)) {
-        wd = 0;
-      } else {
-        wd = all_ones;
-      }
-    } break;
-    case FCULE: {
-      if (s_element <= t_element || std::isnan(s_element) ||
-          std::isnan(t_element)) {
-        wd = all_ones;
-      } else {
-        wd = 0;
-      }
-    } break;
-    case FCOR: {
-      if (std::isnan(s_element) || std::isnan(t_element)) {
-        wd = 0;
-      } else {
-        wd = all_ones;
-      }
-    } break;
-    case FCUNE: {
-      if (s_element != t_element || std::isnan(s_element) ||
-          std::isnan(t_element)) {
-        wd = all_ones;
-      } else {
-        wd = 0;
-      }
-    } break;
-    case FCNE: {
-      if (s_element == t_element || std::isnan(s_element) ||
-          std::isnan(t_element)) {
-        wd = 0;
-      } else {
-        wd = all_ones;
-      }
-    } break;
-    case FADD:
-      wd = bit_cast<T_int>(s_element + t_element);
-      break;
-    case FSUB:
-      wd = bit_cast<T_int>(s_element - t_element);
-      break;
-    case FMUL:
-      wd = bit_cast<T_int>(s_element * t_element);
-      break;
-    case FDIV: {
-      if (t_element == 0) {
-        wd = bit_cast<T_int>(std::numeric_limits<T_fp>::quiet_NaN());
-      } else {
-        wd = bit_cast<T_int>(s_element / t_element);
-      }
-    } break;
-    case FMADD:
-      wd = bit_cast<T_int>(
-          std::fma(s_element, t_element, *reinterpret_cast<T_fp*>(&wd)));
-      break;
-    case FMSUB:
-      wd = bit_cast<T_int>(
-          std::fma(s_element, -t_element, *reinterpret_cast<T_fp*>(&wd)));
-      break;
-    case FEXP2:
-      wd = bit_cast<T_int>(std::ldexp(s_element, static_cast<int>(wt)));
-      break;
-    case FMIN:
-      wd = bit_cast<T_int>(std::min(s_element, t_element));
-      break;
-    case FMAX:
-      wd = bit_cast<T_int>(std::max(s_element, t_element));
-      break;
-    case FMIN_A: {
-      wd = bit_cast<T_int>(
-          std::fabs(s_element) < std::fabs(t_element) ? s_element : t_element);
-    } break;
-    case FMAX_A: {
-      wd = bit_cast<T_int>(
-          std::fabs(s_element) > std::fabs(t_element) ? s_element : t_element);
-    } break;
-    case FSOR:
-    case FSUNE:
-    case FSNE:
-    case FSAF:
-    case FSUN:
-    case FSEQ:
-    case FSUEQ:
-    case FSLT:
-    case FSULT:
-    case FSLE:
-    case FSULE:
-      UNIMPLEMENTED();
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-template <typename T_int, typename T_int_dbl, typename T_reg>
-void Msa3RFInstrHelper2(uint32_t opcode, T_reg ws, T_reg wt, T_reg& wd) {
-  // typedef typename std::make_unsigned<T_int>::type T_uint;
-  typedef typename std::make_unsigned<T_int_dbl>::type T_uint_dbl;
-  const T_int max_int = std::numeric_limits<T_int>::max();
-  const T_int min_int = std::numeric_limits<T_int>::min();
-  const int shift = kBitsPerByte * sizeof(T_int) - 1;
-  const T_int_dbl reg_s = ws;
-  const T_int_dbl reg_t = wt;
-  T_int_dbl product, result;
-  product = reg_s * reg_t;
-  switch (opcode) {
-    case MUL_Q: {
-      const T_int_dbl min_fix_dbl =
-          bit_cast<T_uint_dbl>(std::numeric_limits<T_int_dbl>::min()) >> 1U;
-      const T_int_dbl max_fix_dbl = std::numeric_limits<T_int_dbl>::max() >> 1U;
-      if (product == min_fix_dbl) {
-        product = max_fix_dbl;
-      }
-      wd = static_cast<T_int>(product >> shift);
-    } break;
-    case MADD_Q: {
-      result = (product + (static_cast<T_int_dbl>(wd) << shift)) >> shift;
-      wd = static_cast<T_int>(
-          result > max_int ? max_int : result < min_int ? min_int : result);
-    } break;
-    case MSUB_Q: {
-      result = (-product + (static_cast<T_int_dbl>(wd) << shift)) >> shift;
-      wd = static_cast<T_int>(
-          result > max_int ? max_int : result < min_int ? min_int : result);
-    } break;
-    case MULR_Q: {
-      const T_int_dbl min_fix_dbl =
-          bit_cast<T_uint_dbl>(std::numeric_limits<T_int_dbl>::min()) >> 1U;
-      const T_int_dbl max_fix_dbl = std::numeric_limits<T_int_dbl>::max() >> 1U;
-      if (product == min_fix_dbl) {
-        wd = static_cast<T_int>(max_fix_dbl >> shift);
-        break;
-      }
-      wd = static_cast<T_int>((product + (1 << (shift - 1))) >> shift);
-    } break;
-    case MADDR_Q: {
-      result = (product + (static_cast<T_int_dbl>(wd) << shift) +
-                (1 << (shift - 1))) >>
-               shift;
-      wd = static_cast<T_int>(
-          result > max_int ? max_int : result < min_int ? min_int : result);
-    } break;
-    case MSUBR_Q: {
-      result = (-product + (static_cast<T_int_dbl>(wd) << shift) +
-                (1 << (shift - 1))) >>
-               shift;
-      wd = static_cast<T_int>(
-          result > max_int ? max_int : result < min_int ? min_int : result);
-    } break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Simulator::DecodeTypeMsa3RF() {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(CpuFeatures::IsSupported(MIPS_SIMD));
-  uint32_t opcode = instr_.InstructionBits() & kMsa3RFMask;
-  msa_reg_t wd, ws, wt;
-  if (opcode != FCAF) {
-    get_msa_register(ws_reg(), &ws);
-    get_msa_register(wt_reg(), &wt);
-  }
-  switch (opcode) {
-    case FCAF:
-      wd.d[0] = 0;
-      wd.d[1] = 0;
-      break;
-    case FEXDO:
-#define PACK_FLOAT16(sign, exp, frac) \
-  static_cast<uint16_t>(((sign) << 15) + ((exp) << 10) + (frac))
-#define FEXDO_DF(source, dst)                                        \
-  do {                                                               \
-    element = source;                                                \
-    aSign = element >> 31;                                           \
-    aExp = element >> 23 & 0xFF;                                     \
-    aFrac = element & 0x007FFFFF;                                    \
-    if (aExp == 0xFF) {                                              \
-      if (aFrac) {                                                   \
-        /* Input is a NaN */                                         \
-        dst = 0x7DFFU;                                               \
-        break;                                                       \
-      }                                                              \
-      /* Infinity */                                                 \
-      dst = PACK_FLOAT16(aSign, 0x1F, 0);                            \
-      break;                                                         \
-    } else if (aExp == 0 && aFrac == 0) {                            \
-      dst = PACK_FLOAT16(aSign, 0, 0);                               \
-      break;                                                         \
-    } else {                                                         \
-      int maxexp = 29;                                               \
-      uint32_t mask;                                                 \
-      uint32_t increment;                                            \
-      bool rounding_bumps_exp;                                       \
-      aFrac |= 0x00800000;                                           \
-      aExp -= 0x71;                                                  \
-      if (aExp < 1) {                                                \
-        /* Will be denormal in halfprec */                           \
-        mask = 0x00FFFFFF;                                           \
-        if (aExp >= -11) {                                           \
-          mask >>= 11 + aExp;                                        \
-        }                                                            \
-      } else {                                                       \
-        /* Normal number in halfprec */                              \
-        mask = 0x00001FFF;                                           \
-      }                                                              \
-      switch (MSACSR_ & 3) {                                         \
-        case kRoundToNearest:                                        \
-          increment = (mask + 1) >> 1;                               \
-          if ((aFrac & mask) == increment) {                         \
-            increment = aFrac & (increment << 1);                    \
-          }                                                          \
-          break;                                                     \
-        case kRoundToPlusInf:                                        \
-          increment = aSign ? 0 : mask;                              \
-          break;                                                     \
-        case kRoundToMinusInf:                                       \
-          increment = aSign ? mask : 0;                              \
-          break;                                                     \
-        case kRoundToZero:                                           \
-          increment = 0;                                             \
-          break;                                                     \
-      }                                                              \
-      rounding_bumps_exp = (aFrac + increment >= 0x01000000);        \
-      if (aExp > maxexp || (aExp == maxexp && rounding_bumps_exp)) { \
-        dst = PACK_FLOAT16(aSign, 0x1F, 0);                          \
-        break;                                                       \
-      }                                                              \
-      aFrac += increment;                                            \
-      if (rounding_bumps_exp) {                                      \
-        aFrac >>= 1;                                                 \
-        aExp++;                                                      \
-      }                                                              \
-      if (aExp < -10) {                                              \
-        dst = PACK_FLOAT16(aSign, 0, 0);                             \
-        break;                                                       \
-      }                                                              \
-      if (aExp < 0) {                                                \
-        aFrac >>= -aExp;                                             \
-        aExp = 0;                                                    \
-      }                                                              \
-      dst = PACK_FLOAT16(aSign, aExp, aFrac >> 13);                  \
-    }                                                                \
-  } while (0);
-      switch (DecodeMsaDataFormat()) {
-        case MSA_HALF:
-          for (int i = 0; i < kMSALanesWord; i++) {
-            uint_fast32_t element;
-            uint_fast32_t aSign, aFrac;
-            int_fast32_t aExp;
-            FEXDO_DF(ws.uw[i], wd.uh[i + kMSALanesHalf / 2])
-            FEXDO_DF(wt.uw[i], wd.uh[i])
-          }
-          break;
-        case MSA_WORD:
-          for (int i = 0; i < kMSALanesDword; i++) {
-            wd.w[i + kMSALanesWord / 2] = bit_cast<int32_t>(
-                static_cast<float>(bit_cast<double>(ws.d[i])));
-            wd.w[i] = bit_cast<int32_t>(
-                static_cast<float>(bit_cast<double>(wt.d[i])));
-          }
-          break;
-        default:
-          UNREACHABLE();
-      }
-      break;
-#undef PACK_FLOAT16
-#undef FEXDO_DF
-    case FTQ:
-#define FTQ_DF(source, dst, fp_type, int_type)                 \
-  element = bit_cast<fp_type>(source) *                        \
-            (1U << (sizeof(int_type) * kBitsPerByte - 1));     \
-  if (element > std::numeric_limits<int_type>::max()) {        \
-    dst = std::numeric_limits<int_type>::max();                \
-  } else if (element < std::numeric_limits<int_type>::min()) { \
-    dst = std::numeric_limits<int_type>::min();                \
-  } else if (std::isnan(element)) {                            \
-    dst = 0;                                                   \
-  } else {                                                     \
-    int_type fixed_point;                                      \
-    round_according_to_msacsr(element, element, fixed_point);  \
-    dst = fixed_point;                                         \
-  }
-
-      switch (DecodeMsaDataFormat()) {
-        case MSA_HALF:
-          for (int i = 0; i < kMSALanesWord; i++) {
-            float element;
-            FTQ_DF(ws.w[i], wd.h[i + kMSALanesHalf / 2], float, int16_t)
-            FTQ_DF(wt.w[i], wd.h[i], float, int16_t)
-          }
-          break;
-        case MSA_WORD:
-          double element;
-          for (int i = 0; i < kMSALanesDword; i++) {
-            FTQ_DF(ws.d[i], wd.w[i + kMSALanesWord / 2], double, int32_t)
-            FTQ_DF(wt.d[i], wd.w[i], double, int32_t)
-          }
-          break;
-        default:
-          UNREACHABLE();
-      }
-      break;
-#undef FTQ_DF
-#define MSA_3RF_DF(T1, T2, Lanes, ws, wt, wd)      \
-  for (int i = 0; i < Lanes; i++) {                \
-    Msa3RFInstrHelper<T1, T2>(opcode, ws, wt, wd); \
-  }
-#define MSA_3RF_DF2(T1, T2, Lanes, ws, wt, wd)      \
-  for (int i = 0; i < Lanes; i++) {                 \
-    Msa3RFInstrHelper2<T1, T2>(opcode, ws, wt, wd); \
-  }
-    case MADD_Q:
-    case MSUB_Q:
-    case MADDR_Q:
-    case MSUBR_Q:
-      get_msa_register(wd_reg(), &wd);  // fall-through
-    case MUL_Q:
-    case MULR_Q:
-      switch (DecodeMsaDataFormat()) {
-        case MSA_HALF:
-          MSA_3RF_DF2(int16_t, int32_t, kMSALanesHalf, ws.h[i], wt.h[i],
-                      wd.h[i])
-          break;
-        case MSA_WORD:
-          MSA_3RF_DF2(int32_t, int64_t, kMSALanesWord, ws.w[i], wt.w[i],
-                      wd.w[i])
-          break;
-        default:
-          UNREACHABLE();
-      }
-      break;
-    default:
-      if (opcode == FMADD || opcode == FMSUB) {
-        get_msa_register(wd_reg(), &wd);
-      }
-      switch (DecodeMsaDataFormat()) {
-        case MSA_WORD:
-          MSA_3RF_DF(int32_t, float, kMSALanesWord, ws.w[i], wt.w[i], wd.w[i])
-          break;
-        case MSA_DWORD:
-          MSA_3RF_DF(int64_t, double, kMSALanesDword, ws.d[i], wt.d[i], wd.d[i])
-          break;
-        default:
-          UNREACHABLE();
-      }
-      break;
-#undef MSA_3RF_DF
-#undef MSA_3RF_DF2
-  }
-  set_msa_register(wd_reg(), &wd);
-  TraceMSARegWr(&wd);
-}
-
-void Simulator::DecodeTypeMsaVec() {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(CpuFeatures::IsSupported(MIPS_SIMD));
-  uint32_t opcode = instr_.InstructionBits() & kMsaVECMask;
-  msa_reg_t wd, ws, wt;
-
-  get_msa_register(instr_.WsValue(), ws.w);
-  get_msa_register(instr_.WtValue(), wt.w);
-  if (opcode == BMNZ_V || opcode == BMZ_V || opcode == BSEL_V) {
-    get_msa_register(instr_.WdValue(), wd.w);
-  }
-
-  for (int i = 0; i < kMSALanesWord; i++) {
-    switch (opcode) {
-      case AND_V:
-        wd.w[i] = ws.w[i] & wt.w[i];
-        break;
-      case OR_V:
-        wd.w[i] = ws.w[i] | wt.w[i];
-        break;
-      case NOR_V:
-        wd.w[i] = ~(ws.w[i] | wt.w[i]);
-        break;
-      case XOR_V:
-        wd.w[i] = ws.w[i] ^ wt.w[i];
-        break;
-      case BMNZ_V:
-        wd.w[i] = (wt.w[i] & ws.w[i]) | (~wt.w[i] & wd.w[i]);
-        break;
-      case BMZ_V:
-        wd.w[i] = (~wt.w[i] & ws.w[i]) | (wt.w[i] & wd.w[i]);
-        break;
-      case BSEL_V:
-        wd.w[i] = (~wd.w[i] & ws.w[i]) | (wd.w[i] & wt.w[i]);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  }
-  set_msa_register(instr_.WdValue(), wd.w);
-  TraceMSARegWr(wd.d);
-}
-
-void Simulator::DecodeTypeMsa2R() {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(CpuFeatures::IsSupported(MIPS_SIMD));
-  uint32_t opcode = instr_.InstructionBits() & kMsa2RMask;
-  msa_reg_t wd, ws;
-  switch (opcode) {
-    case FILL:
-      switch (DecodeMsaDataFormat()) {
-        case MSA_BYTE: {
-          int32_t rs = get_register(instr_.WsValue());
-          for (int i = 0; i < kMSALanesByte; i++) {
-            wd.b[i] = rs & 0xFFu;
-          }
-          set_msa_register(instr_.WdValue(), wd.b);
-          TraceMSARegWr(wd.b);
-          break;
-        }
-        case MSA_HALF: {
-          int32_t rs = get_register(instr_.WsValue());
-          for (int i = 0; i < kMSALanesHalf; i++) {
-            wd.h[i] = rs & 0xFFFFu;
-          }
-          set_msa_register(instr_.WdValue(), wd.h);
-          TraceMSARegWr(wd.h);
-          break;
-        }
-        case MSA_WORD: {
-          int32_t rs = get_register(instr_.WsValue());
-          for (int i = 0; i < kMSALanesWord; i++) {
-            wd.w[i] = rs;
-          }
-          set_msa_register(instr_.WdValue(), wd.w);
-          TraceMSARegWr(wd.w);
-          break;
-        }
-        default:
-          UNREACHABLE();
-      }
-      break;
-    case PCNT:
-#define PCNT_DF(elem, num_of_lanes)                       \
-  get_msa_register(instr_.WsValue(), ws.elem);            \
-  for (int i = 0; i < num_of_lanes; i++) {                \
-    uint64_t u64elem = static_cast<uint64_t>(ws.elem[i]); \
-    wd.elem[i] = base::bits::CountPopulation(u64elem);    \
-  }                                                       \
-  set_msa_register(instr_.WdValue(), wd.elem);            \
-  TraceMSARegWr(wd.elem)
-
-      switch (DecodeMsaDataFormat()) {
-        case MSA_BYTE:
-          PCNT_DF(ub, kMSALanesByte);
-          break;
-        case MSA_HALF:
-          PCNT_DF(uh, kMSALanesHalf);
-          break;
-        case MSA_WORD:
-          PCNT_DF(uw, kMSALanesWord);
-          break;
-        case MSA_DWORD:
-          PCNT_DF(ud, kMSALanesDword);
-          break;
-        default:
-          UNREACHABLE();
-      }
-#undef PCNT_DF
-      break;
-    case NLOC:
-#define NLOC_DF(elem, num_of_lanes)                                         \
-  get_msa_register(instr_.WsValue(), ws.elem);                              \
-  for (int i = 0; i < num_of_lanes; i++) {                                  \
-    const uint64_t mask = (num_of_lanes == kMSALanesDword)                  \
-                              ? UINT64_MAX                                  \
-                              : (1ULL << (kMSARegSize / num_of_lanes)) - 1; \
-    uint64_t u64elem = static_cast<uint64_t>(~ws.elem[i]) & mask;           \
-    wd.elem[i] = base::bits::CountLeadingZeros64(u64elem) -                 \
-                 (64 - kMSARegSize / num_of_lanes);                         \
-  }                                                                         \
-  set_msa_register(instr_.WdValue(), wd.elem);                              \
-  TraceMSARegWr(wd.elem)
-
-      switch (DecodeMsaDataFormat()) {
-        case MSA_BYTE:
-          NLOC_DF(ub, kMSALanesByte);
-          break;
-        case MSA_HALF:
-          NLOC_DF(uh, kMSALanesHalf);
-          break;
-        case MSA_WORD:
-          NLOC_DF(uw, kMSALanesWord);
-          break;
-        case MSA_DWORD:
-          NLOC_DF(ud, kMSALanesDword);
-          break;
-        default:
-          UNREACHABLE();
-      }
-#undef NLOC_DF
-      break;
-    case NLZC:
-#define NLZC_DF(elem, num_of_lanes)                         \
-  get_msa_register(instr_.WsValue(), ws.elem);              \
-  for (int i = 0; i < num_of_lanes; i++) {                  \
-    uint64_t u64elem = static_cast<uint64_t>(ws.elem[i]);   \
-    wd.elem[i] = base::bits::CountLeadingZeros64(u64elem) - \
-                 (64 - kMSARegSize / num_of_lanes);         \
-  }                                                         \
-  set_msa_register(instr_.WdValue(), wd.elem);              \
-  TraceMSARegWr(wd.elem)
-
-      switch (DecodeMsaDataFormat()) {
-        case MSA_BYTE:
-          NLZC_DF(ub, kMSALanesByte);
-          break;
-        case MSA_HALF:
-          NLZC_DF(uh, kMSALanesHalf);
-          break;
-        case MSA_WORD:
-          NLZC_DF(uw, kMSALanesWord);
-          break;
-        case MSA_DWORD:
-          NLZC_DF(ud, kMSALanesDword);
-          break;
-        default:
-          UNREACHABLE();
-      }
-#undef NLZC_DF
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-#define BIT(n) (0x1LL << n)
-#define QUIET_BIT_S(nan) (bit_cast<int32_t>(nan) & BIT(22))
-#define QUIET_BIT_D(nan) (bit_cast<int64_t>(nan) & BIT(51))
-static inline bool isSnan(float fp) { return !QUIET_BIT_S(fp); }
-static inline bool isSnan(double fp) { return !QUIET_BIT_D(fp); }
-#undef QUIET_BIT_S
-#undef QUIET_BIT_D
-
-template <typename T_int, typename T_fp, typename T_src, typename T_dst>
-T_int Msa2RFInstrHelper(uint32_t opcode, T_src src, T_dst& dst,
-                        Simulator* sim) {
-  typedef typename std::make_unsigned<T_int>::type T_uint;
-  switch (opcode) {
-    case FCLASS: {
-#define SNAN_BIT BIT(0)
-#define QNAN_BIT BIT(1)
-#define NEG_INFINITY_BIT BIT(2)
-#define NEG_NORMAL_BIT BIT(3)
-#define NEG_SUBNORMAL_BIT BIT(4)
-#define NEG_ZERO_BIT BIT(5)
-#define POS_INFINITY_BIT BIT(6)
-#define POS_NORMAL_BIT BIT(7)
-#define POS_SUBNORMAL_BIT BIT(8)
-#define POS_ZERO_BIT BIT(9)
-      T_fp element = *reinterpret_cast<T_fp*>(&src);
-      switch (std::fpclassify(element)) {
-        case FP_INFINITE:
-          if (std::signbit(element)) {
-            dst = NEG_INFINITY_BIT;
-          } else {
-            dst = POS_INFINITY_BIT;
-          }
-          break;
-        case FP_NAN:
-          if (isSnan(element)) {
-            dst = SNAN_BIT;
-          } else {
-            dst = QNAN_BIT;
-          }
-          break;
-        case FP_NORMAL:
-          if (std::signbit(element)) {
-            dst = NEG_NORMAL_BIT;
-          } else {
-            dst = POS_NORMAL_BIT;
-          }
-          break;
-        case FP_SUBNORMAL:
-          if (std::signbit(element)) {
-            dst = NEG_SUBNORMAL_BIT;
-          } else {
-            dst = POS_SUBNORMAL_BIT;
-          }
-          break;
-        case FP_ZERO:
-          if (std::signbit(element)) {
-            dst = NEG_ZERO_BIT;
-          } else {
-            dst = POS_ZERO_BIT;
-          }
-          break;
-        default:
-          UNREACHABLE();
-      }
-      break;
-    }
-#undef BIT
-#undef SNAN_BIT
-#undef QNAN_BIT
-#undef NEG_INFINITY_BIT
-#undef NEG_NORMAL_BIT
-#undef NEG_SUBNORMAL_BIT
-#undef NEG_ZERO_BIT
-#undef POS_INFINITY_BIT
-#undef POS_NORMAL_BIT
-#undef POS_SUBNORMAL_BIT
-#undef POS_ZERO_BIT
-    case FTRUNC_S: {
-      T_fp element = bit_cast<T_fp>(src);
-      const T_int max_int = std::numeric_limits<T_int>::max();
-      const T_int min_int = std::numeric_limits<T_int>::min();
-      if (std::isnan(element)) {
-        dst = 0;
-      } else if (element >= max_int || element <= min_int) {
-        dst = element >= max_int ? max_int : min_int;
-      } else {
-        dst = static_cast<T_int>(std::trunc(element));
-      }
-      break;
-    }
-    case FTRUNC_U: {
-      T_fp element = bit_cast<T_fp>(src);
-      const T_uint max_int = std::numeric_limits<T_uint>::max();
-      if (std::isnan(element)) {
-        dst = 0;
-      } else if (element >= max_int || element <= 0) {
-        dst = element >= max_int ? max_int : 0;
-      } else {
-        dst = static_cast<T_uint>(std::trunc(element));
-      }
-      break;
-    }
-    case FSQRT: {
-      T_fp element = bit_cast<T_fp>(src);
-      if (element < 0 || std::isnan(element)) {
-        dst = bit_cast<T_int>(std::numeric_limits<T_fp>::quiet_NaN());
-      } else {
-        dst = bit_cast<T_int>(std::sqrt(element));
-      }
-      break;
-    }
-    case FRSQRT: {
-      T_fp element = bit_cast<T_fp>(src);
-      if (element < 0 || std::isnan(element)) {
-        dst = bit_cast<T_int>(std::numeric_limits<T_fp>::quiet_NaN());
-      } else {
-        dst = bit_cast<T_int>(1 / std::sqrt(element));
-      }
-      break;
-    }
-    case FRCP: {
-      T_fp element = bit_cast<T_fp>(src);
-      if (std::isnan(element)) {
-        dst = bit_cast<T_int>(std::numeric_limits<T_fp>::quiet_NaN());
-      } else {
-        dst = bit_cast<T_int>(1 / element);
-      }
-      break;
-    }
-    case FRINT: {
-      T_fp element = bit_cast<T_fp>(src);
-      if (std::isnan(element)) {
-        dst = bit_cast<T_int>(std::numeric_limits<T_fp>::quiet_NaN());
-      } else {
-        T_int dummy;
-        sim->round_according_to_msacsr<T_fp, T_int>(element, element, dummy);
-        dst = bit_cast<T_int>(element);
-      }
-      break;
-    }
-    case FLOG2: {
-      T_fp element = bit_cast<T_fp>(src);
-      switch (std::fpclassify(element)) {
-        case FP_NORMAL:
-        case FP_SUBNORMAL:
-          dst = bit_cast<T_int>(std::logb(element));
-          break;
-        case FP_ZERO:
-          dst = bit_cast<T_int>(-std::numeric_limits<T_fp>::infinity());
-          break;
-        case FP_NAN:
-          dst = bit_cast<T_int>(std::numeric_limits<T_fp>::quiet_NaN());
-          break;
-        case FP_INFINITE:
-          if (element < 0) {
-            dst = bit_cast<T_int>(std::numeric_limits<T_fp>::quiet_NaN());
-          } else {
-            dst = bit_cast<T_int>(std::numeric_limits<T_fp>::infinity());
-          }
-          break;
-        default:
-          UNREACHABLE();
-      }
-      break;
-    }
-    case FTINT_S: {
-      T_fp element = bit_cast<T_fp>(src);
-      const T_int max_int = std::numeric_limits<T_int>::max();
-      const T_int min_int = std::numeric_limits<T_int>::min();
-      if (std::isnan(element)) {
-        dst = 0;
-      } else if (element < min_int || element > max_int) {
-        dst = element > max_int ? max_int : min_int;
-      } else {
-        sim->round_according_to_msacsr<T_fp, T_int>(element, element, dst);
-      }
-      break;
-    }
-    case FTINT_U: {
-      T_fp element = bit_cast<T_fp>(src);
-      const T_uint max_uint = std::numeric_limits<T_uint>::max();
-      if (std::isnan(element)) {
-        dst = 0;
-      } else if (element < 0 || element > max_uint) {
-        dst = element > max_uint ? max_uint : 0;
-      } else {
-        T_uint res;
-        sim->round_according_to_msacsr<T_fp, T_uint>(element, element, res);
-        dst = *reinterpret_cast<T_int*>(&res);
-      }
-      break;
-    }
-    case FFINT_S:
-      dst = bit_cast<T_int>(static_cast<T_fp>(src));
-      break;
-    case FFINT_U:
-      typedef typename std::make_unsigned<T_src>::type uT_src;
-      dst = bit_cast<T_int>(static_cast<T_fp>(bit_cast<uT_src>(src)));
-      break;
-    default:
-      UNREACHABLE();
-  }
-  return 0;
-}
-
-template <typename T_int, typename T_fp, typename T_reg>
-T_int Msa2RFInstrHelper2(uint32_t opcode, T_reg ws, int i) {
-  switch (opcode) {
-#define EXTRACT_FLOAT16_SIGN(fp16) (fp16 >> 15)
-#define EXTRACT_FLOAT16_EXP(fp16) (fp16 >> 10 & 0x1F)
-#define EXTRACT_FLOAT16_FRAC(fp16) (fp16 & 0x3FF)
-#define PACK_FLOAT32(sign, exp, frac) \
-  static_cast<uint32_t>(((sign) << 31) + ((exp) << 23) + (frac))
-#define FEXUP_DF(src_index)                                                   \
-  uint_fast16_t element = ws.uh[src_index];                                   \
-  uint_fast32_t aSign, aFrac;                                                 \
-  int_fast32_t aExp;                                                          \
-  aSign = EXTRACT_FLOAT16_SIGN(element);                                      \
-  aExp = EXTRACT_FLOAT16_EXP(element);                                        \
-  aFrac = EXTRACT_FLOAT16_FRAC(element);                                      \
-  if (V8_LIKELY(aExp && aExp != 0x1F)) {                                      \
-    return PACK_FLOAT32(aSign, aExp + 0x70, aFrac << 13);                     \
-  } else if (aExp == 0x1F) {                                                  \
-    if (aFrac) {                                                              \
-      return bit_cast<int32_t>(std::numeric_limits<float>::quiet_NaN());      \
-    } else {                                                                  \
-      return bit_cast<uint32_t>(std::numeric_limits<float>::infinity()) |     \
-             static_cast<uint32_t>(aSign) << 31;                              \
-    }                                                                         \
-  } else {                                                                    \
-    if (aFrac == 0) {                                                         \
-      return PACK_FLOAT32(aSign, 0, 0);                                       \
-    } else {                                                                  \
-      int_fast16_t shiftCount =                                               \
-          base::bits::CountLeadingZeros32(static_cast<uint32_t>(aFrac)) - 21; \
-      aFrac <<= shiftCount;                                                   \
-      aExp = -shiftCount;                                                     \
-      return PACK_FLOAT32(aSign, aExp + 0x70, aFrac << 13);                   \
-    }                                                                         \
-  }
-    case FEXUPL:
-      if (std::is_same<int32_t, T_int>::value) {
-        FEXUP_DF(i + kMSALanesWord)
-      } else {
-        return bit_cast<int64_t>(
-            static_cast<double>(bit_cast<float>(ws.w[i + kMSALanesDword])));
-      }
-    case FEXUPR:
-      if (std::is_same<int32_t, T_int>::value) {
-        FEXUP_DF(i)
-      } else {
-        return bit_cast<int64_t>(static_cast<double>(bit_cast<float>(ws.w[i])));
-      }
-    case FFQL: {
-      if (std::is_same<int32_t, T_int>::value) {
-        return bit_cast<int32_t>(static_cast<float>(ws.h[i + kMSALanesWord]) /
-                                 (1U << 15));
-      } else {
-        return bit_cast<int64_t>(static_cast<double>(ws.w[i + kMSALanesDword]) /
-                                 (1U << 31));
-      }
-      break;
-    }
-    case FFQR: {
-      if (std::is_same<int32_t, T_int>::value) {
-        return bit_cast<int32_t>(static_cast<float>(ws.h[i]) / (1U << 15));
-      } else {
-        return bit_cast<int64_t>(static_cast<double>(ws.w[i]) / (1U << 31));
-      }
-      break;
-      default:
-        UNREACHABLE();
-    }
-  }
-#undef EXTRACT_FLOAT16_SIGN
-#undef EXTRACT_FLOAT16_EXP
-#undef EXTRACT_FLOAT16_FRAC
-#undef PACK_FLOAT32
-#undef FEXUP_DF
-}
-
-void Simulator::DecodeTypeMsa2RF() {
-  DCHECK(IsMipsArchVariant(kMips32r6));
-  DCHECK(CpuFeatures::IsSupported(MIPS_SIMD));
-  uint32_t opcode = instr_.InstructionBits() & kMsa2RFMask;
-  msa_reg_t wd, ws;
-  get_msa_register(ws_reg(), &ws);
-  if (opcode == FEXUPL || opcode == FEXUPR || opcode == FFQL ||
-      opcode == FFQR) {
-    switch (DecodeMsaDataFormat()) {
-      case MSA_WORD:
-        for (int i = 0; i < kMSALanesWord; i++) {
-          wd.w[i] = Msa2RFInstrHelper2<int32_t, float>(opcode, ws, i);
-        }
-        break;
-      case MSA_DWORD:
-        for (int i = 0; i < kMSALanesDword; i++) {
-          wd.d[i] = Msa2RFInstrHelper2<int64_t, double>(opcode, ws, i);
-        }
-        break;
-      default:
-        UNREACHABLE();
-    }
-  } else {
-    switch (DecodeMsaDataFormat()) {
-      case MSA_WORD:
-        for (int i = 0; i < kMSALanesWord; i++) {
-          Msa2RFInstrHelper<int32_t, float>(opcode, ws.w[i], wd.w[i], this);
-        }
-        break;
-      case MSA_DWORD:
-        for (int i = 0; i < kMSALanesDword; i++) {
-          Msa2RFInstrHelper<int64_t, double>(opcode, ws.d[i], wd.d[i], this);
-        }
-        break;
-      default:
-        UNREACHABLE();
-    }
-  }
-  set_msa_register(wd_reg(), &wd);
-  TraceMSARegWr(&wd);
-}
-
-void Simulator::DecodeTypeRegister() {
-  // ---------- Execution.
-  switch (instr_.OpcodeFieldRaw()) {
-    case COP1:
-      DecodeTypeRegisterCOP1();
-      break;
-    case COP1X:
-      DecodeTypeRegisterCOP1X();
-      break;
-    case SPECIAL:
-      DecodeTypeRegisterSPECIAL();
-      break;
-    case SPECIAL2:
-      DecodeTypeRegisterSPECIAL2();
-      break;
-    case SPECIAL3:
-      DecodeTypeRegisterSPECIAL3();
-      break;
-    case MSA:
-      switch (instr_.MSAMinorOpcodeField()) {
-        case kMsaMinor3R:
-          DecodeTypeMsa3R();
-          break;
-        case kMsaMinor3RF:
-          DecodeTypeMsa3RF();
-          break;
-        case kMsaMinorVEC:
-          DecodeTypeMsaVec();
-          break;
-        case kMsaMinor2R:
-          DecodeTypeMsa2R();
-          break;
-        case kMsaMinor2RF:
-          DecodeTypeMsa2RF();
-          break;
-        case kMsaMinorELM:
-          DecodeTypeMsaELM();
-          break;
-        default:
-          UNREACHABLE();
-      }
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-// Type 2: instructions using a 16, 21 or 26 bits immediate. (e.g. beq, beqc).
-void Simulator::DecodeTypeImmediate() {
-  // Instruction fields.
-  Opcode op = instr_.OpcodeFieldRaw();
-  int32_t rs_reg = instr_.RsValue();
-  int32_t rs = get_register(instr_.RsValue());
-  uint32_t rs_u = static_cast<uint32_t>(rs);
-  int32_t rt_reg = instr_.RtValue();  // Destination register.
-  int32_t rt = get_register(rt_reg);
-  int16_t imm16 = instr_.Imm16Value();
-
-  int32_t ft_reg = instr_.FtValue();  // Destination register.
-
-  // Zero extended immediate.
-  uint32_t oe_imm16 = 0xFFFF & imm16;
-  // Sign extended immediate.
-  int32_t se_imm16 = imm16;
-
-  // Next pc.
-  int32_t next_pc = bad_ra;
-
-  // Used for conditional branch instructions.
-  bool execute_branch_delay_instruction = false;
-
-  // Used for arithmetic instructions.
-  int32_t alu_out = 0;
-
-  // Used for memory instructions.
-  int32_t addr = 0x0;
-
-  // Branch instructions common part.
-  auto BranchAndLinkHelper =
-      [this, &next_pc, &execute_branch_delay_instruction](bool do_branch) {
-        execute_branch_delay_instruction = true;
-        int32_t current_pc = get_pc();
-        if (do_branch) {
-          int16_t imm16 = this->instr_.Imm16Value();
-          next_pc = current_pc + (imm16 << 2) + Instruction::kInstrSize;
-          set_register(31, current_pc + 2 * Instruction::kInstrSize);
-        } else {
-          next_pc = current_pc + 2 * Instruction::kInstrSize;
-        }
-      };
-
-  auto BranchHelper = [this, &next_pc,
-                       &execute_branch_delay_instruction](bool do_branch) {
-    execute_branch_delay_instruction = true;
-    int32_t current_pc = get_pc();
-    if (do_branch) {
-      int16_t imm16 = this->instr_.Imm16Value();
-      next_pc = current_pc + (imm16 << 2) + Instruction::kInstrSize;
-    } else {
-      next_pc = current_pc + 2 * Instruction::kInstrSize;
-    }
-  };
-
-  auto BranchHelper_MSA = [this, &next_pc, imm16,
-                           &execute_branch_delay_instruction](bool do_branch) {
-    execute_branch_delay_instruction = true;
-    int32_t current_pc = get_pc();
-    const int32_t bitsIn16Int = sizeof(int16_t) * kBitsPerByte;
-    if (do_branch) {
-      if (FLAG_debug_code) {
-        int16_t bits = imm16 & 0xFC;
-        if (imm16 >= 0) {
-          CHECK_EQ(bits, 0);
-        } else {
-          CHECK_EQ(bits ^ 0xFC, 0);
-        }
-      }
-      // jump range :[pc + kInstrSize - 512 * kInstrSize,
-      //              pc + kInstrSize + 511 * kInstrSize]
-      int16_t offset = static_cast<int16_t>(imm16 << (bitsIn16Int - 10)) >>
-                       (bitsIn16Int - 12);
-      next_pc = current_pc + offset + Instruction::kInstrSize;
-    } else {
-      next_pc = current_pc + 2 * Instruction::kInstrSize;
-    }
-  };
-
-  auto BranchAndLinkCompactHelper = [this, &next_pc](bool do_branch, int bits) {
-    int32_t current_pc = get_pc();
-    CheckForbiddenSlot(current_pc);
-    if (do_branch) {
-      int32_t imm = this->instr_.ImmValue(bits);
-      imm <<= 32 - bits;
-      imm >>= 32 - bits;
-      next_pc = current_pc + (imm << 2) + Instruction::kInstrSize;
-      set_register(31, current_pc + Instruction::kInstrSize);
-    }
-  };
-
-  auto BranchCompactHelper = [this, &next_pc](bool do_branch, int bits) {
-    int32_t current_pc = get_pc();
-    CheckForbiddenSlot(current_pc);
-    if (do_branch) {
-      int32_t imm = this->instr_.ImmValue(bits);
-      imm <<= 32 - bits;
-      imm >>= 32 - bits;
-      next_pc = get_pc() + (imm << 2) + Instruction::kInstrSize;
-    }
-  };
-
-  switch (op) {
-    // ------------- COP1. Coprocessor instructions.
-    case COP1:
-      switch (instr_.RsFieldRaw()) {
-        case BC1: {  // Branch on coprocessor condition.
-          // Floating point.
-          uint32_t cc = instr_.FBccValue();
-          uint32_t fcsr_cc = get_fcsr_condition_bit(cc);
-          uint32_t cc_value = test_fcsr_bit(fcsr_cc);
-          bool do_branch = (instr_.FBtrueValue()) ? cc_value : !cc_value;
-          BranchHelper(do_branch);
-          break;
-        }
-        case BC1EQZ:
-          BranchHelper(!(get_fpu_register(ft_reg) & 0x1));
-          break;
-        case BC1NEZ:
-          BranchHelper(get_fpu_register(ft_reg) & 0x1);
-          break;
-        case BZ_V: {
-          msa_reg_t wt;
-          get_msa_register(wt_reg(), &wt);
-          BranchHelper_MSA(wt.d[0] == 0 && wt.d[1] == 0);
-        } break;
-#define BZ_DF(witdh, lanes)          \
-  {                                  \
-    msa_reg_t wt;                    \
-    get_msa_register(wt_reg(), &wt); \
-    int i;                           \
-    for (i = 0; i < lanes; ++i) {    \
-      if (wt.witdh[i] == 0) {        \
-        break;                       \
-      }                              \
-    }                                \
-    BranchHelper_MSA(i != lanes);    \
-  }
-        case BZ_B:
-          BZ_DF(b, kMSALanesByte)
-          break;
-        case BZ_H:
-          BZ_DF(h, kMSALanesHalf)
-          break;
-        case BZ_W:
-          BZ_DF(w, kMSALanesWord)
-          break;
-        case BZ_D:
-          BZ_DF(d, kMSALanesDword)
-          break;
-#undef BZ_DF
-        case BNZ_V: {
-          msa_reg_t wt;
-          get_msa_register(wt_reg(), &wt);
-          BranchHelper_MSA(wt.d[0] != 0 || wt.d[1] != 0);
-        } break;
-#define BNZ_DF(witdh, lanes)         \
-  {                                  \
-    msa_reg_t wt;                    \
-    get_msa_register(wt_reg(), &wt); \
-    int i;                           \
-    for (i = 0; i < lanes; ++i) {    \
-      if (wt.witdh[i] == 0) {        \
-        break;                       \
-      }                              \
-    }                                \
-    BranchHelper_MSA(i == lanes);    \
-  }
-        case BNZ_B:
-          BNZ_DF(b, kMSALanesByte)
-          break;
-        case BNZ_H:
-          BNZ_DF(h, kMSALanesHalf)
-          break;
-        case BNZ_W:
-          BNZ_DF(w, kMSALanesWord)
-          break;
-        case BNZ_D:
-          BNZ_DF(d, kMSALanesDword)
-          break;
-#undef BNZ_DF
-        default:
-          UNREACHABLE();
-      }
-      break;
-    // ------------- REGIMM class.
-    case REGIMM:
-      switch (instr_.RtFieldRaw()) {
-        case BLTZ:
-          BranchHelper(rs < 0);
-          break;
-        case BGEZ:
-          BranchHelper(rs >= 0);
-          break;
-        case BLTZAL:
-          BranchAndLinkHelper(rs < 0);
-          break;
-        case BGEZAL:
-          BranchAndLinkHelper(rs >= 0);
-          break;
-        default:
-          UNREACHABLE();
-      }
-      break;  // case REGIMM.
-    // ------------- Branch instructions.
-    // When comparing to zero, the encoding of rt field is always 0, so we don't
-    // need to replace rt with zero.
-    case BEQ:
-      BranchHelper(rs == rt);
-      break;
-    case BNE:
-      BranchHelper(rs != rt);
-      break;
-    case POP06:  // BLEZALC, BGEZALC, BGEUC, BLEZ (pre-r6)
-      if (IsMipsArchVariant(kMips32r6)) {
-        if (rt_reg != 0) {
-          if (rs_reg == 0) {  // BLEZALC
-            BranchAndLinkCompactHelper(rt <= 0, 16);
-          } else {
-            if (rs_reg == rt_reg) {  // BGEZALC
-              BranchAndLinkCompactHelper(rt >= 0, 16);
-            } else {  // BGEUC
-              BranchCompactHelper(
-                  static_cast<uint32_t>(rs) >= static_cast<uint32_t>(rt), 16);
-            }
-          }
-        } else {  // BLEZ
-          BranchHelper(rs <= 0);
-        }
-      } else {  // BLEZ
-        BranchHelper(rs <= 0);
-      }
-      break;
-    case POP07:  // BGTZALC, BLTZALC, BLTUC, BGTZ (pre-r6)
-      if (IsMipsArchVariant(kMips32r6)) {
-        if (rt_reg != 0) {
-          if (rs_reg == 0) {  // BGTZALC
-            BranchAndLinkCompactHelper(rt > 0, 16);
-          } else {
-            if (rt_reg == rs_reg) {  // BLTZALC
-              BranchAndLinkCompactHelper(rt < 0, 16);
-            } else {  // BLTUC
-              BranchCompactHelper(
-                  static_cast<uint32_t>(rs) < static_cast<uint32_t>(rt), 16);
-            }
-          }
-        } else {  // BGTZ
-          BranchHelper(rs > 0);
-        }
-      } else {  // BGTZ
-        BranchHelper(rs > 0);
-      }
-      break;
-    case POP26:  // BLEZC, BGEZC, BGEC/BLEC / BLEZL (pre-r6)
-      if (IsMipsArchVariant(kMips32r6)) {
-        if (rt_reg != 0) {
-          if (rs_reg == 0) {  // BLEZC
-            BranchCompactHelper(rt <= 0, 16);
-          } else {
-            if (rs_reg == rt_reg) {  // BGEZC
-              BranchCompactHelper(rt >= 0, 16);
-            } else {  // BGEC/BLEC
-              BranchCompactHelper(rs >= rt, 16);
-            }
-          }
-        }
-      } else {  // BLEZL
-        BranchAndLinkHelper(rs <= 0);
-      }
-      break;
-    case POP27:  // BGTZC, BLTZC, BLTC/BGTC / BGTZL (pre-r6)
-      if (IsMipsArchVariant(kMips32r6)) {
-        if (rt_reg != 0) {
-          if (rs_reg == 0) {  // BGTZC
-            BranchCompactHelper(rt > 0, 16);
-          } else {
-            if (rs_reg == rt_reg) {  // BLTZC
-              BranchCompactHelper(rt < 0, 16);
-            } else {  // BLTC/BGTC
-              BranchCompactHelper(rs < rt, 16);
-            }
-          }
-        }
-      } else {  // BGTZL
-        BranchAndLinkHelper(rs > 0);
-      }
-      break;
-    case POP66:           // BEQZC, JIC
-      if (rs_reg != 0) {  // BEQZC
-        BranchCompactHelper(rs == 0, 21);
-      } else {  // JIC
-        next_pc = rt + imm16;
-      }
-      break;
-    case POP76:           // BNEZC, JIALC
-      if (rs_reg != 0) {  // BNEZC
-        BranchCompactHelper(rs != 0, 21);
-      } else {  // JIALC
-        set_register(31, get_pc() + Instruction::kInstrSize);
-        next_pc = rt + imm16;
-      }
-      break;
-    case BC:
-      BranchCompactHelper(true, 26);
-      break;
-    case BALC:
-      BranchAndLinkCompactHelper(true, 26);
-      break;
-    case POP10:  // BOVC, BEQZALC, BEQC / ADDI (pre-r6)
-      if (IsMipsArchVariant(kMips32r6)) {
-        if (rs_reg >= rt_reg) {  // BOVC
-          if (HaveSameSign(rs, rt)) {
-            if (rs > 0) {
-              BranchCompactHelper(rs > Registers::kMaxValue - rt, 16);
-            } else if (rs < 0) {
-              BranchCompactHelper(rs < Registers::kMinValue - rt, 16);
-            }
-          }
-        } else {
-          if (rs_reg == 0) {  // BEQZALC
-            BranchAndLinkCompactHelper(rt == 0, 16);
-          } else {  // BEQC
-            BranchCompactHelper(rt == rs, 16);
-          }
-        }
-      } else {  // ADDI
-        if (HaveSameSign(rs, se_imm16)) {
-          if (rs > 0) {
-            if (rs <= Registers::kMaxValue - se_imm16) {
-              SignalException(kIntegerOverflow);
-            }
-          } else if (rs < 0) {
-            if (rs >= Registers::kMinValue - se_imm16) {
-              SignalException(kIntegerUnderflow);
-            }
-          }
-        }
-        SetResult(rt_reg, rs + se_imm16);
-      }
-      break;
-    case POP30:  // BNVC, BNEZALC, BNEC / DADDI (pre-r6)
-      if (IsMipsArchVariant(kMips32r6)) {
-        if (rs_reg >= rt_reg) {  // BNVC
-          if (!HaveSameSign(rs, rt) || rs == 0 || rt == 0) {
-            BranchCompactHelper(true, 16);
-          } else {
-            if (rs > 0) {
-              BranchCompactHelper(rs <= Registers::kMaxValue - rt, 16);
-            } else if (rs < 0) {
-              BranchCompactHelper(rs >= Registers::kMinValue - rt, 16);
-            }
-          }
-        } else {
-          if (rs_reg == 0) {  // BNEZALC
-            BranchAndLinkCompactHelper(rt != 0, 16);
-          } else {  // BNEC
-            BranchCompactHelper(rt != rs, 16);
-          }
-        }
-      }
-      break;
-    // ------------- Arithmetic instructions.
-    case ADDIU:
-      SetResult(rt_reg, rs + se_imm16);
-      break;
-    case SLTI:
-      SetResult(rt_reg, rs < se_imm16 ? 1 : 0);
-      break;
-    case SLTIU:
-      SetResult(rt_reg, rs_u < static_cast<uint32_t>(se_imm16) ? 1 : 0);
-      break;
-    case ANDI:
-      SetResult(rt_reg, rs & oe_imm16);
-      break;
-    case ORI:
-      SetResult(rt_reg, rs | oe_imm16);
-      break;
-    case XORI:
-      SetResult(rt_reg, rs ^ oe_imm16);
-      break;
-    case LUI:
-      if (rs_reg != 0) {
-        // AUI
-        DCHECK(IsMipsArchVariant(kMips32r6));
-        SetResult(rt_reg, rs + (se_imm16 << 16));
-      } else {
-        // LUI
-        SetResult(rt_reg, oe_imm16 << 16);
-      }
-      break;
-    // ------------- Memory instructions.
-    case LB:
-      set_register(rt_reg, ReadB(rs + se_imm16));
-      break;
-    case LH:
-      set_register(rt_reg, ReadH(rs + se_imm16, instr_.instr()));
-      break;
-    case LWL: {
-      // al_offset is offset of the effective address within an aligned word.
-      uint8_t al_offset = (rs + se_imm16) & kPointerAlignmentMask;
-      uint8_t byte_shift = kPointerAlignmentMask - al_offset;
-      uint32_t mask = (1 << byte_shift * 8) - 1;
-      addr = rs + se_imm16 - al_offset;
-      alu_out = ReadW(addr, instr_.instr());
-      alu_out <<= byte_shift * 8;
-      alu_out |= rt & mask;
-      set_register(rt_reg, alu_out);
-      break;
-    }
-    case LW:
-      set_register(rt_reg, ReadW(rs + se_imm16, instr_.instr()));
-      break;
-    case LBU:
-      set_register(rt_reg, ReadBU(rs + se_imm16));
-      break;
-    case LHU:
-      set_register(rt_reg, ReadHU(rs + se_imm16, instr_.instr()));
-      break;
-    case LWR: {
-      // al_offset is offset of the effective address within an aligned word.
-      uint8_t al_offset = (rs + se_imm16) & kPointerAlignmentMask;
-      uint8_t byte_shift = kPointerAlignmentMask - al_offset;
-      uint32_t mask = al_offset ? (~0 << (byte_shift + 1) * 8) : 0;
-      addr = rs + se_imm16 - al_offset;
-      alu_out = ReadW(addr, instr_.instr());
-      alu_out = static_cast<uint32_t> (alu_out) >> al_offset * 8;
-      alu_out |= rt & mask;
-      set_register(rt_reg, alu_out);
-      break;
-    }
-    case SB:
-      WriteB(rs + se_imm16, static_cast<int8_t>(rt));
-      break;
-    case SH:
-      WriteH(rs + se_imm16, static_cast<uint16_t>(rt), instr_.instr());
-      break;
-    case SWL: {
-      uint8_t al_offset = (rs + se_imm16) & kPointerAlignmentMask;
-      uint8_t byte_shift = kPointerAlignmentMask - al_offset;
-      uint32_t mask = byte_shift ? (~0 << (al_offset + 1) * 8) : 0;
-      addr = rs + se_imm16 - al_offset;
-      // Value to be written in memory.
-      uint32_t mem_value = ReadW(addr, instr_.instr()) & mask;
-      mem_value |= static_cast<uint32_t>(rt) >> byte_shift * 8;
-      WriteW(addr, mem_value, instr_.instr());
-      break;
-    }
-    case SW:
-      WriteW(rs + se_imm16, rt, instr_.instr());
-      break;
-    case SWR: {
-      uint8_t al_offset = (rs + se_imm16) & kPointerAlignmentMask;
-      uint32_t mask = (1 << al_offset * 8) - 1;
-      addr = rs + se_imm16 - al_offset;
-      uint32_t mem_value = ReadW(addr, instr_.instr());
-      mem_value = (rt << al_offset * 8) | (mem_value & mask);
-      WriteW(addr, mem_value, instr_.instr());
-      break;
-    }
-    case LL: {
-      // LL/SC sequence cannot be simulated properly
-      DCHECK(!IsMipsArchVariant(kMips32r6));
-      set_register(rt_reg, ReadW(rs + se_imm16, instr_.instr()));
-      break;
-    }
-    case SC: {
-      // LL/SC sequence cannot be simulated properly
-      DCHECK(!IsMipsArchVariant(kMips32r6));
-      WriteW(rs + se_imm16, rt, instr_.instr());
-      set_register(rt_reg, 1);
-      break;
-    }
-    case LWC1:
-      set_fpu_register_hi_word(ft_reg, 0);
-      set_fpu_register_word(ft_reg,
-                            ReadW(rs + se_imm16, instr_.instr(), FLOAT));
-      if (ft_reg % 2) {
-        TraceMemRd(rs + se_imm16, get_fpu_register(ft_reg - 1), FLOAT_DOUBLE);
-      } else {
-        TraceMemRd(rs + se_imm16, get_fpu_register_word(ft_reg), FLOAT);
-      }
-      break;
-    case LDC1:
-      set_fpu_register_double(ft_reg, ReadD(rs + se_imm16, instr_.instr()));
-      TraceMemRd(rs + se_imm16, get_fpu_register(ft_reg), DOUBLE);
-      break;
-    case SWC1:
-      WriteW(rs + se_imm16, get_fpu_register_word(ft_reg), instr_.instr());
-      TraceMemWr(rs + se_imm16, get_fpu_register_word(ft_reg));
-      break;
-    case SDC1:
-      WriteD(rs + se_imm16, get_fpu_register_double(ft_reg), instr_.instr());
-      TraceMemWr(rs + se_imm16, get_fpu_register(ft_reg));
-      break;
-    // ------------- PC-Relative instructions.
-    case PCREL: {
-      // rt field: checking 5-bits.
-      int32_t imm21 = instr_.Imm21Value();
-      int32_t current_pc = get_pc();
-      uint8_t rt = (imm21 >> kImm16Bits);
-      switch (rt) {
-        case ALUIPC:
-          addr = current_pc + (se_imm16 << 16);
-          alu_out = static_cast<int64_t>(~0x0FFFF) & addr;
-          break;
-        case AUIPC:
-          alu_out = current_pc + (se_imm16 << 16);
-          break;
-        default: {
-          int32_t imm19 = instr_.Imm19Value();
-          // rt field: checking the most significant 2-bits.
-          rt = (imm21 >> kImm19Bits);
-          switch (rt) {
-            case LWPC: {
-              // Set sign.
-              imm19 <<= (kOpcodeBits + kRsBits + 2);
-              imm19 >>= (kOpcodeBits + kRsBits + 2);
-              addr = current_pc + (imm19 << 2);
-              uint32_t* ptr = reinterpret_cast<uint32_t*>(addr);
-              alu_out = *ptr;
-              break;
-            }
-            case ADDIUPC: {
-              int32_t se_imm19 = imm19 | ((imm19 & 0x40000) ? 0xFFF80000 : 0);
-              alu_out = current_pc + (se_imm19 << 2);
-              break;
-            }
-            default:
-              UNREACHABLE();
-              break;
-          }
-        }
-      }
-      SetResult(rs_reg, alu_out);
-      break;
-    }
-    case SPECIAL3: {
-      switch (instr_.FunctionFieldRaw()) {
-        case LL_R6: {
-          // LL/SC sequence cannot be simulated properly
-          DCHECK(IsMipsArchVariant(kMips32r6));
-          int32_t base = get_register(instr_.BaseValue());
-          int32_t offset9 = instr_.Imm9Value();
-          set_register(rt_reg, ReadW(base + offset9, instr_.instr()));
-          break;
-        }
-        case SC_R6: {
-          // LL/SC sequence cannot be simulated properly
-          DCHECK(IsMipsArchVariant(kMips32r6));
-          int32_t base = get_register(instr_.BaseValue());
-          int32_t offset9 = instr_.Imm9Value();
-          WriteW(base + offset9, rt, instr_.instr());
-          set_register(rt_reg, 1);
-          break;
-        }
-        default:
-          UNREACHABLE();
-      }
-      break;
-    }
-    case MSA:
-      switch (instr_.MSAMinorOpcodeField()) {
-        case kMsaMinorI8:
-          DecodeTypeMsaI8();
-          break;
-        case kMsaMinorI5:
-          DecodeTypeMsaI5();
-          break;
-        case kMsaMinorI10:
-          DecodeTypeMsaI10();
-          break;
-        case kMsaMinorELM:
-          DecodeTypeMsaELM();
-          break;
-        case kMsaMinorBIT:
-          DecodeTypeMsaBIT();
-          break;
-        case kMsaMinorMI10:
-          DecodeTypeMsaMI10();
-          break;
-        default:
-          UNREACHABLE();
-          break;
-      }
-      break;
-    default:
-      UNREACHABLE();
-  }
-
-  if (execute_branch_delay_instruction) {
-    // Execute branch delay slot
-    // We don't check for end_sim_pc. First it should not be met as the current
-    // pc is valid. Secondly a jump should always execute its branch delay slot.
-    Instruction* branch_delay_instr =
-        reinterpret_cast<Instruction*>(get_pc() + Instruction::kInstrSize);
-    BranchDelayInstructionDecode(branch_delay_instr);
-  }
-
-  // If needed update pc after the branch delay execution.
-  if (next_pc != bad_ra) {
-    set_pc(next_pc);
-  }
-}
-
-
-// Type 3: instructions using a 26 bytes immediate. (e.g. j, jal).
-void Simulator::DecodeTypeJump() {
-  SimInstruction simInstr = instr_;
-  // Get current pc.
-  int32_t current_pc = get_pc();
-  // Get unchanged bits of pc.
-  int32_t pc_high_bits = current_pc & 0xF0000000;
-  // Next pc.
-
-  int32_t next_pc = pc_high_bits | (simInstr.Imm26Value() << 2);
-
-  // Execute branch delay slot.
-  // We don't check for end_sim_pc. First it should not be met as the current pc
-  // is valid. Secondly a jump should always execute its branch delay slot.
-  Instruction* branch_delay_instr =
-      reinterpret_cast<Instruction*>(current_pc + Instruction::kInstrSize);
-  BranchDelayInstructionDecode(branch_delay_instr);
-
-  // Update pc and ra if necessary.
-  // Do this after the branch delay execution.
-  if (simInstr.IsLinkingInstruction()) {
-    set_register(31, current_pc + 2 * Instruction::kInstrSize);
-  }
-  set_pc(next_pc);
-  pc_modified_ = true;
-}
-
-
-// Executes the current instruction.
-void Simulator::InstructionDecode(Instruction* instr) {
-  if (v8::internal::FLAG_check_icache) {
-    CheckICache(isolate_->simulator_i_cache(), instr);
-  }
-  pc_modified_ = false;
-  v8::internal::EmbeddedVector<char, 256> buffer;
-  if (::v8::internal::FLAG_trace_sim) {
-    SNPrintF(trace_buf_, "%s", "");
-    disasm::NameConverter converter;
-    disasm::Disassembler dasm(converter);
-    dasm.InstructionDecode(buffer, reinterpret_cast<byte*>(instr));
-  }
-
-  instr_ = instr;
-  switch (instr_.InstructionType()) {
-    case Instruction::kRegisterType:
-      DecodeTypeRegister();
-      break;
-    case Instruction::kImmediateType:
-      DecodeTypeImmediate();
-      break;
-    case Instruction::kJumpType:
-      DecodeTypeJump();
-      break;
-    default:
-      UNSUPPORTED();
-  }
-  if (::v8::internal::FLAG_trace_sim) {
-    PrintF("  0x%08" PRIxPTR "  %-44s   %s\n",
-           reinterpret_cast<intptr_t>(instr), buffer.start(),
-           trace_buf_.start());
-  }
-  if (!pc_modified_) {
-    set_register(pc, reinterpret_cast<int32_t>(instr) +
-                 Instruction::kInstrSize);
-  }
-}
-
-
-
-void Simulator::Execute() {
-  // Get the PC to simulate. Cannot use the accessor here as we need the
-  // raw PC value and not the one used as input to arithmetic instructions.
-  int program_counter = get_pc();
-  if (::v8::internal::FLAG_stop_sim_at == 0) {
-    // Fast version of the dispatch loop without checking whether the simulator
-    // should be stopping at a particular executed instruction.
-    while (program_counter != end_sim_pc) {
-      Instruction* instr = reinterpret_cast<Instruction*>(program_counter);
-      icount_++;
-      InstructionDecode(instr);
-      program_counter = get_pc();
-    }
-  } else {
-    // FLAG_stop_sim_at is at the non-default value. Stop in the debugger when
-    // we reach the particular instruction count.
-    while (program_counter != end_sim_pc) {
-      Instruction* instr = reinterpret_cast<Instruction*>(program_counter);
-      icount_++;
-      if (icount_ == static_cast<uint64_t>(::v8::internal::FLAG_stop_sim_at)) {
-        MipsDebugger dbg(this);
-        dbg.Debug();
-      } else {
-        InstructionDecode(instr);
-      }
-      program_counter = get_pc();
-    }
-  }
-}
-
-
-void Simulator::CallInternal(byte* entry) {
-  // Adjust JS-based stack limit to C-based stack limit.
-  isolate_->stack_guard()->AdjustStackLimitForSimulator();
-
-  // Prepare to execute the code at entry.
-  set_register(pc, reinterpret_cast<int32_t>(entry));
-  // Put down marker for end of simulation. The simulator will stop simulation
-  // when the PC reaches this value. By saving the "end simulation" value into
-  // the LR the simulation stops when returning to this call point.
-  set_register(ra, end_sim_pc);
-
-  // Remember the values of callee-saved registers.
-  // The code below assumes that r9 is not used as sb (static base) in
-  // simulator code and therefore is regarded as a callee-saved register.
-  int32_t s0_val = get_register(s0);
-  int32_t s1_val = get_register(s1);
-  int32_t s2_val = get_register(s2);
-  int32_t s3_val = get_register(s3);
-  int32_t s4_val = get_register(s4);
-  int32_t s5_val = get_register(s5);
-  int32_t s6_val = get_register(s6);
-  int32_t s7_val = get_register(s7);
-  int32_t gp_val = get_register(gp);
-  int32_t sp_val = get_register(sp);
-  int32_t fp_val = get_register(fp);
-
-  // Set up the callee-saved registers with a known value. To be able to check
-  // that they are preserved properly across JS execution.
-  int32_t callee_saved_value = static_cast<int32_t>(icount_);
-  set_register(s0, callee_saved_value);
-  set_register(s1, callee_saved_value);
-  set_register(s2, callee_saved_value);
-  set_register(s3, callee_saved_value);
-  set_register(s4, callee_saved_value);
-  set_register(s5, callee_saved_value);
-  set_register(s6, callee_saved_value);
-  set_register(s7, callee_saved_value);
-  set_register(gp, callee_saved_value);
-  set_register(fp, callee_saved_value);
-
-  // Start the simulation.
-  Execute();
-
-  // Check that the callee-saved registers have been preserved.
-  CHECK_EQ(callee_saved_value, get_register(s0));
-  CHECK_EQ(callee_saved_value, get_register(s1));
-  CHECK_EQ(callee_saved_value, get_register(s2));
-  CHECK_EQ(callee_saved_value, get_register(s3));
-  CHECK_EQ(callee_saved_value, get_register(s4));
-  CHECK_EQ(callee_saved_value, get_register(s5));
-  CHECK_EQ(callee_saved_value, get_register(s6));
-  CHECK_EQ(callee_saved_value, get_register(s7));
-  CHECK_EQ(callee_saved_value, get_register(gp));
-  CHECK_EQ(callee_saved_value, get_register(fp));
-
-  // Restore callee-saved registers with the original value.
-  set_register(s0, s0_val);
-  set_register(s1, s1_val);
-  set_register(s2, s2_val);
-  set_register(s3, s3_val);
-  set_register(s4, s4_val);
-  set_register(s5, s5_val);
-  set_register(s6, s6_val);
-  set_register(s7, s7_val);
-  set_register(gp, gp_val);
-  set_register(sp, sp_val);
-  set_register(fp, fp_val);
-}
-
-intptr_t Simulator::CallImpl(byte* entry, int argument_count,
-                             const intptr_t* arguments) {
-  // Set up arguments.
-
-  // First four arguments passed in registers.
-  int reg_arg_count = std::min(4, argument_count);
-  if (reg_arg_count > 0) set_register(a0, arguments[0]);
-  if (reg_arg_count > 1) set_register(a1, arguments[1]);
-  if (reg_arg_count > 2) set_register(a2, arguments[2]);
-  if (reg_arg_count > 3) set_register(a3, arguments[3]);
-
-  // Remaining arguments passed on stack.
-  int original_stack = get_register(sp);
-  // Compute position of stack on entry to generated code.
-  int entry_stack = (original_stack - (argument_count - 4) * sizeof(int32_t)
-                                    - kCArgsSlotsSize);
-  if (base::OS::ActivationFrameAlignment() != 0) {
-    entry_stack &= -base::OS::ActivationFrameAlignment();
-  }
-  // Store remaining arguments on stack, from low to high memory.
-  intptr_t* stack_argument = reinterpret_cast<intptr_t*>(entry_stack);
-  memcpy(stack_argument + kCArgSlotCount, arguments + reg_arg_count,
-         (argument_count - reg_arg_count) * sizeof(*arguments));
-  set_register(sp, entry_stack);
-
-  CallInternal(entry);
-
-  // Pop stack passed arguments.
-  CHECK_EQ(entry_stack, get_register(sp));
-  set_register(sp, original_stack);
-
-  return get_register(v0);
-}
-
-
-double Simulator::CallFP(byte* entry, double d0, double d1) {
-  if (!IsMipsSoftFloatABI) {
-    set_fpu_register_double(f12, d0);
-    set_fpu_register_double(f14, d1);
-  } else {
-    int buffer[2];
-    DCHECK(sizeof(buffer[0]) * 2 == sizeof(d0));
-    memcpy(buffer, &d0, sizeof(d0));
-    set_dw_register(a0, buffer);
-    memcpy(buffer, &d1, sizeof(d1));
-    set_dw_register(a2, buffer);
-  }
-  CallInternal(entry);
-  if (!IsMipsSoftFloatABI) {
-    return get_fpu_register_double(f0);
-  } else {
-    return get_double_from_register_pair(v0);
-  }
-}
-
-
-uintptr_t Simulator::PushAddress(uintptr_t address) {
-  int new_sp = get_register(sp) - sizeof(uintptr_t);
-  uintptr_t* stack_slot = reinterpret_cast<uintptr_t*>(new_sp);
-  *stack_slot = address;
-  set_register(sp, new_sp);
-  return new_sp;
-}
-
-
-uintptr_t Simulator::PopAddress() {
-  int current_sp = get_register(sp);
-  uintptr_t* stack_slot = reinterpret_cast<uintptr_t*>(current_sp);
-  uintptr_t address = *stack_slot;
-  set_register(sp, current_sp + sizeof(uintptr_t));
-  return address;
-}
-
-
-#undef UNSUPPORTED
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // USE_SIMULATOR
-
-#endif  // V8_TARGET_ARCH_MIPS
diff --git a/src/v8/src/mips/simulator-mips.h b/src/v8/src/mips/simulator-mips.h
deleted file mode 100644
index 0c417be..0000000
--- a/src/v8/src/mips/simulator-mips.h
+++ /dev/null
@@ -1,568 +0,0 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Declares a Simulator for MIPS instructions if we are not generating a native
-// MIPS binary. This Simulator allows us to run and debug MIPS code generation
-// on regular desktop machines.
-// V8 calls into generated code via the GeneratedCode wrapper,
-// which will start execution in the Simulator or forwards to the real entry
-// on a MIPS HW platform.
-
-#ifndef V8_MIPS_SIMULATOR_MIPS_H_
-#define V8_MIPS_SIMULATOR_MIPS_H_
-
-#include "src/allocation.h"
-#include "src/mips/constants-mips.h"
-
-#if defined(USE_SIMULATOR)
-// Running with a simulator.
-
-#include "src/assembler.h"
-#include "src/base/hashmap.h"
-#include "src/simulator-base.h"
-
-namespace v8 {
-namespace internal {
-
-// -----------------------------------------------------------------------------
-// Utility functions
-
-class CachePage {
- public:
-  static const int LINE_VALID = 0;
-  static const int LINE_INVALID = 1;
-
-  static const int kPageShift = 12;
-  static const int kPageSize = 1 << kPageShift;
-  static const int kPageMask = kPageSize - 1;
-  static const int kLineShift = 2;  // The cache line is only 4 bytes right now.
-  static const int kLineLength = 1 << kLineShift;
-  static const int kLineMask = kLineLength - 1;
-
-  CachePage() {
-    memset(&validity_map_, LINE_INVALID, sizeof(validity_map_));
-  }
-
-  char* ValidityByte(int offset) {
-    return &validity_map_[offset >> kLineShift];
-  }
-
-  char* CachedData(int offset) {
-    return &data_[offset];
-  }
-
- private:
-  char data_[kPageSize];   // The cached data.
-  static const int kValidityMapSize = kPageSize >> kLineShift;
-  char validity_map_[kValidityMapSize];  // One byte per line.
-};
-
-class SimInstructionBase : public InstructionBase {
- public:
-  Type InstructionType() const { return type_; }
-  inline Instruction* instr() const { return instr_; }
-  inline int32_t operand() const { return operand_; }
-
- protected:
-  SimInstructionBase() : operand_(-1), instr_(nullptr), type_(kUnsupported) {}
-  explicit SimInstructionBase(Instruction* instr) {}
-
-  int32_t operand_;
-  Instruction* instr_;
-  Type type_;
-
- private:
-  DISALLOW_ASSIGN(SimInstructionBase);
-};
-
-class SimInstruction : public InstructionGetters<SimInstructionBase> {
- public:
-  SimInstruction() {}
-
-  explicit SimInstruction(Instruction* instr) { *this = instr; }
-
-  SimInstruction& operator=(Instruction* instr) {
-    operand_ = *reinterpret_cast<const int32_t*>(instr);
-    instr_ = instr;
-    type_ = InstructionBase::InstructionType();
-    DCHECK(reinterpret_cast<void*>(&operand_) == this);
-    return *this;
-  }
-};
-
-class Simulator : public SimulatorBase {
- public:
-  friend class MipsDebugger;
-
-  // Registers are declared in order. See SMRL chapter 2.
-  enum Register {
-    no_reg = -1,
-    zero_reg = 0,
-    at,
-    v0, v1,
-    a0, a1, a2, a3,
-    t0, t1, t2, t3, t4, t5, t6, t7,
-    s0, s1, s2, s3, s4, s5, s6, s7,
-    t8, t9,
-    k0, k1,
-    gp,
-    sp,
-    s8,
-    ra,
-    // LO, HI, and pc.
-    LO,
-    HI,
-    pc,   // pc must be the last register.
-    kNumSimuRegisters,
-    // aliases
-    fp = s8
-  };
-
-  // Coprocessor registers.
-  // Generated code will always use doubles. So we will only use even registers.
-  enum FPURegister {
-    f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11,
-    f12, f13, f14, f15,   // f12 and f14 are arguments FPURegisters.
-    f16, f17, f18, f19, f20, f21, f22, f23, f24, f25,
-    f26, f27, f28, f29, f30, f31,
-    kNumFPURegisters
-  };
-
-  // MSA registers
-  enum MSARegister {
-    w0,
-    w1,
-    w2,
-    w3,
-    w4,
-    w5,
-    w6,
-    w7,
-    w8,
-    w9,
-    w10,
-    w11,
-    w12,
-    w13,
-    w14,
-    w15,
-    w16,
-    w17,
-    w18,
-    w19,
-    w20,
-    w21,
-    w22,
-    w23,
-    w24,
-    w25,
-    w26,
-    w27,
-    w28,
-    w29,
-    w30,
-    w31,
-    kNumMSARegisters
-  };
-
-  explicit Simulator(Isolate* isolate);
-  ~Simulator();
-
-  // The currently executing Simulator instance. Potentially there can be one
-  // for each native thread.
-  V8_EXPORT_PRIVATE static Simulator* current(v8::internal::Isolate* isolate);
-
-  // Accessors for register state. Reading the pc value adheres to the MIPS
-  // architecture specification and is off by a 8 from the currently executing
-  // instruction.
-  void set_register(int reg, int32_t value);
-  void set_dw_register(int dreg, const int* dbl);
-  int32_t get_register(int reg) const;
-  double get_double_from_register_pair(int reg);
-  // Same for FPURegisters.
-  void set_fpu_register(int fpureg, int64_t value);
-  void set_fpu_register_word(int fpureg, int32_t value);
-  void set_fpu_register_hi_word(int fpureg, int32_t value);
-  void set_fpu_register_float(int fpureg, float value);
-  void set_fpu_register_double(int fpureg, double value);
-  void set_fpu_register_invalid_result64(float original, float rounded);
-  void set_fpu_register_invalid_result(float original, float rounded);
-  void set_fpu_register_word_invalid_result(float original, float rounded);
-  void set_fpu_register_invalid_result64(double original, double rounded);
-  void set_fpu_register_invalid_result(double original, double rounded);
-  void set_fpu_register_word_invalid_result(double original, double rounded);
-  int64_t get_fpu_register(int fpureg) const;
-  int32_t get_fpu_register_word(int fpureg) const;
-  int32_t get_fpu_register_signed_word(int fpureg) const;
-  int32_t get_fpu_register_hi_word(int fpureg) const;
-  float get_fpu_register_float(int fpureg) const;
-  double get_fpu_register_double(int fpureg) const;
-  template <typename T>
-  void get_msa_register(int wreg, T* value);
-  template <typename T>
-  void set_msa_register(int wreg, const T* value);
-  void set_fcsr_bit(uint32_t cc, bool value);
-  bool test_fcsr_bit(uint32_t cc);
-  void set_fcsr_rounding_mode(FPURoundingMode mode);
-  void set_msacsr_rounding_mode(FPURoundingMode mode);
-  unsigned int get_fcsr_rounding_mode();
-  unsigned int get_msacsr_rounding_mode();
-  bool set_fcsr_round_error(double original, double rounded);
-  bool set_fcsr_round_error(float original, float rounded);
-  bool set_fcsr_round64_error(double original, double rounded);
-  bool set_fcsr_round64_error(float original, float rounded);
-  void round_according_to_fcsr(double toRound, double& rounded,
-                               int32_t& rounded_int, double fs);
-  void round_according_to_fcsr(float toRound, float& rounded,
-                               int32_t& rounded_int, float fs);
-  template <typename Tfp, typename Tint>
-  void round_according_to_msacsr(Tfp toRound, Tfp& rounded, Tint& rounded_int);
-  void round64_according_to_fcsr(double toRound, double& rounded,
-                                 int64_t& rounded_int, double fs);
-  void round64_according_to_fcsr(float toRound, float& rounded,
-                                 int64_t& rounded_int, float fs);
-  // Special case of set_register and get_register to access the raw PC value.
-  void set_pc(int32_t value);
-  int32_t get_pc() const;
-
-  Address get_sp() const {
-    return reinterpret_cast<Address>(static_cast<intptr_t>(get_register(sp)));
-  }
-
-  // Accessor to the internal simulator stack area.
-  uintptr_t StackLimit(uintptr_t c_limit) const;
-
-  // Executes MIPS instructions until the PC reaches end_sim_pc.
-  void Execute();
-
-  template <typename Return, typename... Args>
-  Return Call(byte* entry, Args... args) {
-    return VariadicCall<Return>(this, &Simulator::CallImpl, entry, args...);
-  }
-
-  // Alternative: call a 2-argument double function.
-  double CallFP(byte* entry, double d0, double d1);
-
-  // Push an address onto the JS stack.
-  uintptr_t PushAddress(uintptr_t address);
-
-  // Pop an address from the JS stack.
-  uintptr_t PopAddress();
-
-  // Debugger input.
-  void set_last_debugger_input(char* input);
-  char* last_debugger_input() { return last_debugger_input_; }
-
-  // Redirection support.
-  static void SetRedirectInstruction(Instruction* instruction);
-
-  // ICache checking.
-  static void FlushICache(base::CustomMatcherHashMap* i_cache, void* start,
-                          size_t size);
-
-  // Returns true if pc register contains one of the 'special_values' defined
-  // below (bad_ra, end_sim_pc).
-  bool has_bad_pc() const;
-
- private:
-  enum special_values {
-    // Known bad pc value to ensure that the simulator does not execute
-    // without being properly setup.
-    bad_ra = -1,
-    // A pc value used to signal the simulator to stop execution.  Generally
-    // the ra is set to this value on transition from native C code to
-    // simulated execution, so that the simulator can "return" to the native
-    // C code.
-    end_sim_pc = -2,
-    // Unpredictable value.
-    Unpredictable = 0xbadbeaf
-  };
-
-  V8_EXPORT_PRIVATE intptr_t CallImpl(byte* entry, int argument_count,
-                                      const intptr_t* arguments);
-
-  // Unsupported instructions use Format to print an error and stop execution.
-  void Format(Instruction* instr, const char* format);
-
-  // Helpers for data value tracing.
-  enum TraceType { BYTE, HALF, WORD, DWORD, FLOAT, DOUBLE, FLOAT_DOUBLE };
-
-  // MSA Data Format
-  enum MSADataFormat { MSA_VECT = 0, MSA_BYTE, MSA_HALF, MSA_WORD, MSA_DWORD };
-  typedef union {
-    int8_t b[kMSALanesByte];
-    uint8_t ub[kMSALanesByte];
-    int16_t h[kMSALanesHalf];
-    uint16_t uh[kMSALanesHalf];
-    int32_t w[kMSALanesWord];
-    uint32_t uw[kMSALanesWord];
-    int64_t d[kMSALanesDword];
-    uint64_t ud[kMSALanesDword];
-  } msa_reg_t;
-
-  // Read and write memory.
-  inline uint32_t ReadBU(int32_t addr);
-  inline int32_t ReadB(int32_t addr);
-  inline void WriteB(int32_t addr, uint8_t value);
-  inline void WriteB(int32_t addr, int8_t value);
-
-  inline uint16_t ReadHU(int32_t addr, Instruction* instr);
-  inline int16_t ReadH(int32_t addr, Instruction* instr);
-  // Note: Overloaded on the sign of the value.
-  inline void WriteH(int32_t addr, uint16_t value, Instruction* instr);
-  inline void WriteH(int32_t addr, int16_t value, Instruction* instr);
-
-  inline int ReadW(int32_t addr, Instruction* instr, TraceType t = WORD);
-  inline void WriteW(int32_t addr, int value, Instruction* instr);
-
-  inline double ReadD(int32_t addr, Instruction* instr);
-  inline void WriteD(int32_t addr, double value, Instruction* instr);
-
-  template <typename T>
-  T ReadMem(int32_t addr, Instruction* instr);
-
-  template <typename T>
-  void WriteMem(int32_t addr, T value, Instruction* instr);
-
-  void TraceRegWr(int32_t value, TraceType t = WORD);
-  void TraceRegWr(int64_t value, TraceType t = DWORD);
-  template <typename T>
-  void TraceMSARegWr(T* value, TraceType t);
-  template <typename T>
-  void TraceMSARegWr(T* value);
-  void TraceMemWr(int32_t addr, int32_t value, TraceType t = WORD);
-  void TraceMemRd(int32_t addr, int32_t value, TraceType t = WORD);
-  void TraceMemWr(int32_t addr, int64_t value, TraceType t = DWORD);
-  void TraceMemRd(int32_t addr, int64_t value, TraceType t = DWORD);
-  template <typename T>
-  void TraceMemRd(int32_t addr, T value);
-  template <typename T>
-  void TraceMemWr(int32_t addr, T value);
-  EmbeddedVector<char, 128> trace_buf_;
-
-  // Operations depending on endianness.
-  // Get Double Higher / Lower word.
-  inline int32_t GetDoubleHIW(double* addr);
-  inline int32_t GetDoubleLOW(double* addr);
-  // Set Double Higher / Lower word.
-  inline int32_t SetDoubleHIW(double* addr);
-  inline int32_t SetDoubleLOW(double* addr);
-
-  SimInstruction instr_;
-
-  // Executing is handled based on the instruction type.
-  void DecodeTypeRegister();
-
-  // Functions called from DecodeTypeRegister.
-  void DecodeTypeRegisterCOP1();
-
-  void DecodeTypeRegisterCOP1X();
-
-  void DecodeTypeRegisterSPECIAL();
-
-  void DecodeTypeRegisterSPECIAL2();
-
-  void DecodeTypeRegisterSPECIAL3();
-
-  // Called from DecodeTypeRegisterCOP1.
-  void DecodeTypeRegisterSRsType();
-
-  void DecodeTypeRegisterDRsType();
-
-  void DecodeTypeRegisterWRsType();
-
-  void DecodeTypeRegisterLRsType();
-
-  int DecodeMsaDataFormat();
-  void DecodeTypeMsaI8();
-  void DecodeTypeMsaI5();
-  void DecodeTypeMsaI10();
-  void DecodeTypeMsaELM();
-  void DecodeTypeMsaBIT();
-  void DecodeTypeMsaMI10();
-  void DecodeTypeMsa3R();
-  void DecodeTypeMsa3RF();
-  void DecodeTypeMsaVec();
-  void DecodeTypeMsa2R();
-  void DecodeTypeMsa2RF();
-  template <typename T>
-  T MsaI5InstrHelper(uint32_t opcode, T ws, int32_t i5);
-  template <typename T>
-  T MsaBitInstrHelper(uint32_t opcode, T wd, T ws, int32_t m);
-  template <typename T>
-  T Msa3RInstrHelper(uint32_t opcode, T wd, T ws, T wt);
-
-  inline int32_t rs_reg() const { return instr_.RsValue(); }
-  inline int32_t rs() const { return get_register(rs_reg()); }
-  inline uint32_t rs_u() const {
-    return static_cast<uint32_t>(get_register(rs_reg()));
-  }
-  inline int32_t rt_reg() const { return instr_.RtValue(); }
-  inline int32_t rt() const { return get_register(rt_reg()); }
-  inline uint32_t rt_u() const {
-    return static_cast<uint32_t>(get_register(rt_reg()));
-  }
-  inline int32_t rd_reg() const { return instr_.RdValue(); }
-  inline int32_t fr_reg() const { return instr_.FrValue(); }
-  inline int32_t fs_reg() const { return instr_.FsValue(); }
-  inline int32_t ft_reg() const { return instr_.FtValue(); }
-  inline int32_t fd_reg() const { return instr_.FdValue(); }
-  inline int32_t sa() const { return instr_.SaValue(); }
-  inline int32_t lsa_sa() const { return instr_.LsaSaValue(); }
-  inline int32_t ws_reg() const { return instr_.WsValue(); }
-  inline int32_t wt_reg() const { return instr_.WtValue(); }
-  inline int32_t wd_reg() const { return instr_.WdValue(); }
-
-  inline void SetResult(int32_t rd_reg, int32_t alu_out) {
-    set_register(rd_reg, alu_out);
-    TraceRegWr(alu_out);
-  }
-
-  inline void SetFPUWordResult(int32_t fd_reg, int32_t alu_out) {
-    set_fpu_register_word(fd_reg, alu_out);
-    TraceRegWr(get_fpu_register_word(fd_reg));
-  }
-
-  inline void SetFPUResult(int32_t fd_reg, int64_t alu_out) {
-    set_fpu_register(fd_reg, alu_out);
-    TraceRegWr(get_fpu_register(fd_reg));
-  }
-
-  inline void SetFPUFloatResult(int32_t fd_reg, float alu_out) {
-    set_fpu_register_float(fd_reg, alu_out);
-    TraceRegWr(get_fpu_register_word(fd_reg), FLOAT);
-  }
-
-  inline void SetFPUDoubleResult(int32_t fd_reg, double alu_out) {
-    set_fpu_register_double(fd_reg, alu_out);
-    TraceRegWr(get_fpu_register(fd_reg), DOUBLE);
-  }
-
-  void DecodeTypeImmediate();
-  void DecodeTypeJump();
-
-  // Used for breakpoints and traps.
-  void SoftwareInterrupt();
-
-  // Compact branch guard.
-  void CheckForbiddenSlot(int32_t current_pc) {
-    Instruction* instr_after_compact_branch =
-        reinterpret_cast<Instruction*>(current_pc + Instruction::kInstrSize);
-    if (instr_after_compact_branch->IsForbiddenAfterBranch()) {
-      V8_Fatal(__FILE__, __LINE__,
-               "Error: Unexpected instruction 0x%08x immediately after a "
-               "compact branch instruction.",
-               *reinterpret_cast<uint32_t*>(instr_after_compact_branch));
-    }
-  }
-
-  // Stop helper functions.
-  bool IsWatchpoint(uint32_t code);
-  void PrintWatchpoint(uint32_t code);
-  void HandleStop(uint32_t code, Instruction* instr);
-  bool IsStopInstruction(Instruction* instr);
-  bool IsEnabledStop(uint32_t code);
-  void EnableStop(uint32_t code);
-  void DisableStop(uint32_t code);
-  void IncreaseStopCounter(uint32_t code);
-  void PrintStopInfo(uint32_t code);
-
-
-  // Executes one instruction.
-  void InstructionDecode(Instruction* instr);
-  // Execute one instruction placed in a branch delay slot.
-  void BranchDelayInstructionDecode(Instruction* instr) {
-    if (instr->InstructionBits() == nopInstr) {
-      // Short-cut generic nop instructions. They are always valid and they
-      // never change the simulator state.
-      return;
-    }
-
-    if (instr->IsForbiddenInBranchDelay()) {
-      V8_Fatal(__FILE__, __LINE__,
-               "Eror:Unexpected %i opcode in a branch delay slot.",
-               instr->OpcodeValue());
-    }
-    InstructionDecode(instr);
-    SNPrintF(trace_buf_, " ");
-  }
-
-  // ICache.
-  static void CheckICache(base::CustomMatcherHashMap* i_cache,
-                          Instruction* instr);
-  static void FlushOnePage(base::CustomMatcherHashMap* i_cache, intptr_t start,
-                           int size);
-  static CachePage* GetCachePage(base::CustomMatcherHashMap* i_cache,
-                                 void* page);
-
-  enum Exception {
-    none,
-    kIntegerOverflow,
-    kIntegerUnderflow,
-    kDivideByZero,
-    kNumExceptions
-  };
-
-  // Exceptions.
-  void SignalException(Exception e);
-
-  // Handle arguments and return value for runtime FP functions.
-  void GetFpArgs(double* x, double* y, int32_t* z);
-  void SetFpResult(const double& result);
-
-  void CallInternal(byte* entry);
-
-  // Architecture state.
-  // Registers.
-  int32_t registers_[kNumSimuRegisters];
-  // Coprocessor Registers.
-  // Note: FP32 mode uses only the lower 32-bit part of each element,
-  // the upper 32-bit is unpredictable.
-  // Note: FPUregisters_[] array is increased to 64 * 8B = 32 * 16B in
-  // order to support MSA registers
-  int64_t FPUregisters_[kNumFPURegisters * 2];
-  // FPU control register.
-  uint32_t FCSR_;
-  // MSA control register.
-  uint32_t MSACSR_;
-
-  // Simulator support.
-  // Allocate 1MB for stack.
-  static const size_t stack_size_ = 1 * 1024*1024;
-  char* stack_;
-  bool pc_modified_;
-  uint64_t icount_;
-  int break_count_;
-
-  // Debugger input.
-  char* last_debugger_input_;
-
-  // Icache simulation.
-  base::CustomMatcherHashMap* i_cache_;
-
-  v8::internal::Isolate* isolate_;
-
-  // Registered breakpoints.
-  Instruction* break_pc_;
-  Instr break_instr_;
-
-  // Stop is disabled if bit 31 is set.
-  static const uint32_t kStopDisabledBit = 1 << 31;
-
-  // A stop is enabled, meaning the simulator will stop when meeting the
-  // instruction, if bit 31 of watched_stops_[code].count is unset.
-  // The value watched_stops_[code].count & ~(1 << 31) indicates how many times
-  // the breakpoint was hit or gone through.
-  struct StopCountAndDesc {
-    uint32_t count;
-    char* desc;
-  };
-  StopCountAndDesc watched_stops_[kMaxStopCode + 1];
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // defined(USE_SIMULATOR)
-#endif  // V8_MIPS_SIMULATOR_MIPS_H_
diff --git a/src/v8/src/mips64/assembler-mips64-inl.h b/src/v8/src/mips64/assembler-mips64-inl.h
deleted file mode 100644
index ded3da2..0000000
--- a/src/v8/src/mips64/assembler-mips64-inl.h
+++ /dev/null
@@ -1,346 +0,0 @@
-
-// Copyright (c) 1994-2006 Sun Microsystems Inc.
-// 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.
-//
-// - Redistribution 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 Sun Microsystems or the names of 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.
-
-// The original source code covered by the above license above has been
-// modified significantly by Google Inc.
-// Copyright 2012 the V8 project authors. All rights reserved.
-
-
-#ifndef V8_MIPS_ASSEMBLER_MIPS_INL_H_
-#define V8_MIPS_ASSEMBLER_MIPS_INL_H_
-
-#include "src/mips64/assembler-mips64.h"
-
-#include "src/assembler.h"
-#include "src/debug/debug.h"
-#include "src/objects-inl.h"
-
-namespace v8 {
-namespace internal {
-
-
-bool CpuFeatures::SupportsCrankshaft() { return IsSupported(FPU); }
-
-bool CpuFeatures::SupportsWasmSimd128() { return IsSupported(MIPS_SIMD); }
-
-// -----------------------------------------------------------------------------
-// Operand and MemOperand.
-
-bool Operand::is_reg() const {
-  return rm_.is_valid();
-}
-
-int64_t Operand::immediate() const {
-  DCHECK(!is_reg());
-  DCHECK(!IsHeapObjectRequest());
-  return value_.immediate;
-}
-
-// -----------------------------------------------------------------------------
-// RelocInfo.
-
-void RelocInfo::apply(intptr_t delta) {
-  if (IsInternalReference(rmode_) || IsInternalReferenceEncoded(rmode_)) {
-    // Absolute code pointer inside code object moves with the code object.
-    byte* p = reinterpret_cast<byte*>(pc_);
-    Assembler::RelocateInternalReference(rmode_, p, delta);
-  }
-}
-
-
-Address RelocInfo::target_address() {
-  DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) || IsWasmCall(rmode_));
-  return Assembler::target_address_at(pc_, constant_pool_);
-}
-
-Address RelocInfo::target_address_address() {
-  DCHECK(IsCodeTarget(rmode_) ||
-         IsRuntimeEntry(rmode_) ||
-         rmode_ == EMBEDDED_OBJECT ||
-         rmode_ == EXTERNAL_REFERENCE);
-  // Read the address of the word containing the target_address in an
-  // instruction stream.
-  // The only architecture-independent user of this function is the serializer.
-  // The serializer uses it to find out how many raw bytes of instruction to
-  // output before the next target.
-  // For an instruction like LUI/ORI where the target bits are mixed into the
-  // instruction bits, the size of the target will be zero, indicating that the
-  // serializer should not step forward in memory after a target is resolved
-  // and written. In this case the target_address_address function should
-  // return the end of the instructions to be patched, allowing the
-  // deserializer to deserialize the instructions as raw bytes and put them in
-  // place, ready to be patched with the target. After jump optimization,
-  // that is the address of the instruction that follows J/JAL/JR/JALR
-  // instruction.
-  // return reinterpret_cast<Address>(
-  //  pc_ + Assembler::kInstructionsFor32BitConstant * Assembler::kInstrSize);
-  return reinterpret_cast<Address>(
-    pc_ + Assembler::kInstructionsFor64BitConstant * Assembler::kInstrSize);
-}
-
-
-Address RelocInfo::constant_pool_entry_address() {
-  UNREACHABLE();
-}
-
-
-int RelocInfo::target_address_size() {
-  return Assembler::kSpecialTargetSize;
-}
-
-Address Assembler::target_address_from_return_address(Address pc) {
-  return pc - kCallTargetAddressOffset;
-}
-
-void Assembler::deserialization_set_special_target_at(
-    Isolate* isolate, Address instruction_payload, Code* code, Address target) {
-  set_target_address_at(
-      isolate, instruction_payload - kInstructionsFor64BitConstant * kInstrSize,
-      code ? code->constant_pool() : nullptr, target);
-}
-
-void Assembler::set_target_internal_reference_encoded_at(Address pc,
-                                                         Address target) {
-  // Encoded internal references are j/jal instructions.
-  Instr instr = Assembler::instr_at(pc + 0 * Assembler::kInstrSize);
-
-  uint64_t imm28 =
-      (reinterpret_cast<uint64_t>(target) & static_cast<uint64_t>(kImm28Mask));
-
-  instr &= ~kImm26Mask;
-  uint64_t imm26 = imm28 >> 2;
-  DCHECK(is_uint26(imm26));
-
-  instr_at_put(pc, instr | (imm26 & kImm26Mask));
-  // Currently used only by deserializer, and all code will be flushed
-  // after complete deserialization, no need to flush on each reference.
-}
-
-
-void Assembler::deserialization_set_target_internal_reference_at(
-    Isolate* isolate, Address pc, Address target, RelocInfo::Mode mode) {
-  if (mode == RelocInfo::INTERNAL_REFERENCE_ENCODED) {
-    DCHECK(IsJ(instr_at(pc)));
-    set_target_internal_reference_encoded_at(pc, target);
-  } else {
-    DCHECK(mode == RelocInfo::INTERNAL_REFERENCE);
-    Memory::Address_at(pc) = target;
-  }
-}
-
-HeapObject* RelocInfo::target_object() {
-  DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
-  return HeapObject::cast(reinterpret_cast<Object*>(
-      Assembler::target_address_at(pc_, constant_pool_)));
-}
-
-Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
-  DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
-  return Handle<HeapObject>(reinterpret_cast<HeapObject**>(
-      Assembler::target_address_at(pc_, constant_pool_)));
-}
-
-void RelocInfo::set_target_object(HeapObject* target,
-                                  WriteBarrierMode write_barrier_mode,
-                                  ICacheFlushMode icache_flush_mode) {
-  DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
-  Assembler::set_target_address_at(target->GetIsolate(), pc_, constant_pool_,
-                                   reinterpret_cast<Address>(target),
-                                   icache_flush_mode);
-  if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != nullptr &&
-      target->IsHeapObject()) {
-    host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(
-        host(), this, HeapObject::cast(target));
-    host()->GetHeap()->RecordWriteIntoCode(host(), this, target);
-  }
-}
-
-
-Address RelocInfo::target_external_reference() {
-  DCHECK(rmode_ == EXTERNAL_REFERENCE);
-  return Assembler::target_address_at(pc_, constant_pool_);
-}
-
-
-Address RelocInfo::target_internal_reference() {
-  if (rmode_ == INTERNAL_REFERENCE) {
-    return Memory::Address_at(pc_);
-  } else {
-    // Encoded internal references are j/jal instructions.
-    DCHECK(rmode_ == INTERNAL_REFERENCE_ENCODED);
-    Instr instr = Assembler::instr_at(pc_ + 0 * Assembler::kInstrSize);
-    instr &= kImm26Mask;
-    uint64_t imm28 = instr << 2;
-    uint64_t segment =
-        (reinterpret_cast<uint64_t>(pc_) & ~static_cast<uint64_t>(kImm28Mask));
-    return reinterpret_cast<Address>(segment | imm28);
-  }
-}
-
-
-Address RelocInfo::target_internal_reference_address() {
-  DCHECK(rmode_ == INTERNAL_REFERENCE || rmode_ == INTERNAL_REFERENCE_ENCODED);
-  return reinterpret_cast<Address>(pc_);
-}
-
-
-Address RelocInfo::target_runtime_entry(Assembler* origin) {
-  DCHECK(IsRuntimeEntry(rmode_));
-  return target_address();
-}
-
-void RelocInfo::set_target_runtime_entry(Isolate* isolate, Address target,
-                                         WriteBarrierMode write_barrier_mode,
-                                         ICacheFlushMode icache_flush_mode) {
-  DCHECK(IsRuntimeEntry(rmode_));
-  if (target_address() != target)
-    set_target_address(isolate, target, write_barrier_mode, icache_flush_mode);
-}
-
-void RelocInfo::WipeOut(Isolate* isolate) {
-  DCHECK(IsEmbeddedObject(rmode_) || IsCodeTarget(rmode_) ||
-         IsRuntimeEntry(rmode_) || IsExternalReference(rmode_) ||
-         IsInternalReference(rmode_) || IsInternalReferenceEncoded(rmode_));
-  if (IsInternalReference(rmode_)) {
-    Memory::Address_at(pc_) = nullptr;
-  } else if (IsInternalReferenceEncoded(rmode_)) {
-    Assembler::set_target_internal_reference_encoded_at(pc_, nullptr);
-  } else {
-    Assembler::set_target_address_at(isolate, pc_, constant_pool_, nullptr);
-  }
-}
-
-template <typename ObjectVisitor>
-void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) {
-  RelocInfo::Mode mode = rmode();
-  if (mode == RelocInfo::EMBEDDED_OBJECT) {
-    visitor->VisitEmbeddedPointer(host(), this);
-  } else if (RelocInfo::IsCodeTarget(mode)) {
-    visitor->VisitCodeTarget(host(), this);
-  } else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
-    visitor->VisitExternalReference(host(), this);
-  } else if (mode == RelocInfo::INTERNAL_REFERENCE ||
-             mode == RelocInfo::INTERNAL_REFERENCE_ENCODED) {
-    visitor->VisitInternalReference(host(), this);
-  } else if (RelocInfo::IsRuntimeEntry(mode)) {
-    visitor->VisitRuntimeEntry(host(), this);
-  }
-}
-
-// -----------------------------------------------------------------------------
-// Assembler.
-
-
-void Assembler::CheckBuffer() {
-  if (buffer_space() <= kGap) {
-    GrowBuffer();
-  }
-}
-
-
-void Assembler::CheckTrampolinePoolQuick(int extra_instructions) {
-  if (pc_offset() >= next_buffer_check_ - extra_instructions * kInstrSize) {
-    CheckTrampolinePool();
-  }
-}
-
-
-void Assembler::CheckForEmitInForbiddenSlot() {
-  if (!is_buffer_growth_blocked()) {
-    CheckBuffer();
-  }
-  if (IsPrevInstrCompactBranch()) {
-    // Nop instruction to precede a CTI in forbidden slot:
-    Instr nop = SPECIAL | SLL;
-    *reinterpret_cast<Instr*>(pc_) = nop;
-    pc_ += kInstrSize;
-
-    ClearCompactBranchState();
-  }
-}
-
-
-void Assembler::EmitHelper(Instr x, CompactBranchType is_compact_branch) {
-  if (IsPrevInstrCompactBranch()) {
-    if (Instruction::IsForbiddenAfterBranchInstr(x)) {
-      // Nop instruction to precede a CTI in forbidden slot:
-      Instr nop = SPECIAL | SLL;
-      *reinterpret_cast<Instr*>(pc_) = nop;
-      pc_ += kInstrSize;
-    }
-    ClearCompactBranchState();
-  }
-  *reinterpret_cast<Instr*>(pc_) = x;
-  pc_ += kInstrSize;
-  if (is_compact_branch == CompactBranchType::COMPACT_BRANCH) {
-    EmittedCompactBranchInstruction();
-  }
-  CheckTrampolinePoolQuick();
-}
-
-template <>
-inline void Assembler::EmitHelper(uint8_t x);
-
-template <typename T>
-void Assembler::EmitHelper(T x) {
-  *reinterpret_cast<T*>(pc_) = x;
-  pc_ += sizeof(x);
-  CheckTrampolinePoolQuick();
-}
-
-template <>
-void Assembler::EmitHelper(uint8_t x) {
-  *reinterpret_cast<uint8_t*>(pc_) = x;
-  pc_ += sizeof(x);
-  if (reinterpret_cast<intptr_t>(pc_) % kInstrSize == 0) {
-    CheckTrampolinePoolQuick();
-  }
-}
-
-void Assembler::emit(Instr x, CompactBranchType is_compact_branch) {
-  if (!is_buffer_growth_blocked()) {
-    CheckBuffer();
-  }
-  EmitHelper(x, is_compact_branch);
-}
-
-
-void Assembler::emit(uint64_t data) {
-  CheckForEmitInForbiddenSlot();
-  EmitHelper(data);
-}
-
-EnsureSpace::EnsureSpace(Assembler* assembler) { assembler->CheckBuffer(); }
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_MIPS_ASSEMBLER_MIPS_INL_H_
diff --git a/src/v8/src/mips64/assembler-mips64.cc b/src/v8/src/mips64/assembler-mips64.cc
deleted file mode 100644
index a056f66..0000000
--- a/src/v8/src/mips64/assembler-mips64.cc
+++ /dev/null
@@ -1,4278 +0,0 @@
-// Copyright (c) 1994-2006 Sun Microsystems Inc.
-// 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.
-//
-// - Redistribution 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 Sun Microsystems or the names of 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.
-
-// The original source code covered by the above license above has been
-// modified significantly by Google Inc.
-// Copyright 2012 the V8 project authors. All rights reserved.
-
-#include "src/mips64/assembler-mips64.h"
-
-#if V8_TARGET_ARCH_MIPS64
-
-#include "src/base/cpu.h"
-#include "src/code-stubs.h"
-#include "src/mips64/assembler-mips64-inl.h"
-
-namespace v8 {
-namespace internal {
-
-
-// Get the CPU features enabled by the build. For cross compilation the
-// preprocessor symbols CAN_USE_FPU_INSTRUCTIONS
-// can be defined to enable FPU instructions when building the
-// snapshot.
-static unsigned CpuFeaturesImpliedByCompiler() {
-  unsigned answer = 0;
-#ifdef CAN_USE_FPU_INSTRUCTIONS
-  answer |= 1u << FPU;
-#endif  // def CAN_USE_FPU_INSTRUCTIONS
-
-  // If the compiler is allowed to use FPU then we can use FPU too in our code
-  // generation even when generating snapshots.  This won't work for cross
-  // compilation.
-#if defined(__mips__) && defined(__mips_hard_float) && __mips_hard_float != 0
-  answer |= 1u << FPU;
-#endif
-
-  return answer;
-}
-
-
-void CpuFeatures::ProbeImpl(bool cross_compile) {
-  supported_ |= CpuFeaturesImpliedByCompiler();
-
-  // Only use statically determined features for cross compile (snapshot).
-  if (cross_compile) return;
-
-  // If the compiler is allowed to use fpu then we can use fpu too in our
-  // code generation.
-#ifndef __mips__
-  // For the simulator build, use FPU.
-  supported_ |= 1u << FPU;
-#else
-  // Probe for additional features at runtime.
-  base::CPU cpu;
-  if (cpu.has_fpu()) supported_ |= 1u << FPU;
-  if (cpu.has_msa()) supported_ |= 1u << MIPS_SIMD;
-#endif
-}
-
-
-void CpuFeatures::PrintTarget() { }
-void CpuFeatures::PrintFeatures() { }
-
-
-int ToNumber(Register reg) {
-  DCHECK(reg.is_valid());
-  const int kNumbers[] = {
-    0,    // zero_reg
-    1,    // at
-    2,    // v0
-    3,    // v1
-    4,    // a0
-    5,    // a1
-    6,    // a2
-    7,    // a3
-    8,    // a4
-    9,    // a5
-    10,   // a6
-    11,   // a7
-    12,   // t0
-    13,   // t1
-    14,   // t2
-    15,   // t3
-    16,   // s0
-    17,   // s1
-    18,   // s2
-    19,   // s3
-    20,   // s4
-    21,   // s5
-    22,   // s6
-    23,   // s7
-    24,   // t8
-    25,   // t9
-    26,   // k0
-    27,   // k1
-    28,   // gp
-    29,   // sp
-    30,   // fp
-    31,   // ra
-  };
-  return kNumbers[reg.code()];
-}
-
-
-Register ToRegister(int num) {
-  DCHECK(num >= 0 && num < kNumRegisters);
-  const Register kRegisters[] = {
-    zero_reg,
-    at,
-    v0, v1,
-    a0, a1, a2, a3, a4, a5, a6, a7,
-    t0, t1, t2, t3,
-    s0, s1, s2, s3, s4, s5, s6, s7,
-    t8, t9,
-    k0, k1,
-    gp,
-    sp,
-    fp,
-    ra
-  };
-  return kRegisters[num];
-}
-
-
-// -----------------------------------------------------------------------------
-// Implementation of RelocInfo.
-
-const int RelocInfo::kApplyMask = RelocInfo::kCodeTargetMask |
-                                  1 << RelocInfo::INTERNAL_REFERENCE |
-                                  1 << RelocInfo::INTERNAL_REFERENCE_ENCODED;
-
-
-bool RelocInfo::IsCodedSpecially() {
-  // The deserializer needs to know whether a pointer is specially coded.  Being
-  // specially coded on MIPS means that it is a lui/ori instruction, and that is
-  // always the case inside code objects.
-  return true;
-}
-
-
-bool RelocInfo::IsInConstantPool() {
-  return false;
-}
-
-Address RelocInfo::embedded_address() const {
-  return Assembler::target_address_at(pc_, constant_pool_);
-}
-
-uint32_t RelocInfo::embedded_size() const {
-  return static_cast<uint32_t>(reinterpret_cast<intptr_t>(
-      (Assembler::target_address_at(pc_, constant_pool_))));
-}
-
-void RelocInfo::set_embedded_address(Isolate* isolate, Address address,
-                                     ICacheFlushMode flush_mode) {
-  Assembler::set_target_address_at(isolate, pc_, constant_pool_, address,
-                                   flush_mode);
-}
-
-void RelocInfo::set_embedded_size(Isolate* isolate, uint32_t size,
-                                  ICacheFlushMode flush_mode) {
-  Assembler::set_target_address_at(isolate, pc_, constant_pool_,
-                                   reinterpret_cast<Address>(size), flush_mode);
-}
-
-void RelocInfo::set_js_to_wasm_address(Isolate* isolate, Address address,
-                                       ICacheFlushMode icache_flush_mode) {
-  DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
-  set_embedded_address(isolate, address, icache_flush_mode);
-}
-
-Address RelocInfo::js_to_wasm_address() const {
-  DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
-  return embedded_address();
-}
-
-// -----------------------------------------------------------------------------
-// Implementation of Operand and MemOperand.
-// See assembler-mips-inl.h for inlined constructors.
-
-Operand::Operand(Handle<HeapObject> handle)
-    : rm_(no_reg), rmode_(RelocInfo::EMBEDDED_OBJECT) {
-  value_.immediate = reinterpret_cast<intptr_t>(handle.address());
-}
-
-Operand Operand::EmbeddedNumber(double value) {
-  int32_t smi;
-  if (DoubleToSmiInteger(value, &smi)) return Operand(Smi::FromInt(smi));
-  Operand result(0, RelocInfo::EMBEDDED_OBJECT);
-  result.is_heap_object_request_ = true;
-  result.value_.heap_object_request = HeapObjectRequest(value);
-  return result;
-}
-
-Operand Operand::EmbeddedCode(CodeStub* stub) {
-  Operand result(0, RelocInfo::CODE_TARGET);
-  result.is_heap_object_request_ = true;
-  result.value_.heap_object_request = HeapObjectRequest(stub);
-  return result;
-}
-
-MemOperand::MemOperand(Register rm, int32_t offset) : Operand(rm) {
-  offset_ = offset;
-}
-
-
-MemOperand::MemOperand(Register rm, int32_t unit, int32_t multiplier,
-                       OffsetAddend offset_addend)
-    : Operand(rm) {
-  offset_ = unit * multiplier + offset_addend;
-}
-
-void Assembler::AllocateAndInstallRequestedHeapObjects(Isolate* isolate) {
-  for (auto& request : heap_object_requests_) {
-    Handle<HeapObject> object;
-    switch (request.kind()) {
-      case HeapObjectRequest::kHeapNumber:
-        object = isolate->factory()->NewHeapNumber(request.heap_number(),
-                                                   IMMUTABLE, TENURED);
-        break;
-      case HeapObjectRequest::kCodeStub:
-        request.code_stub()->set_isolate(isolate);
-        object = request.code_stub()->GetCode();
-        break;
-    }
-    Address pc = buffer_ + request.offset();
-    set_target_value_at(isolate, pc,
-                        reinterpret_cast<uint64_t>(object.location()));
-  }
-}
-
-// -----------------------------------------------------------------------------
-// Specific instructions, constants, and masks.
-
-// daddiu(sp, sp, 8) aka Pop() operation or part of Pop(r)
-// operations as post-increment of sp.
-const Instr kPopInstruction = DADDIU | (sp.code() << kRsShift) |
-                              (sp.code() << kRtShift) |
-                              (kPointerSize & kImm16Mask);  // NOLINT
-// daddiu(sp, sp, -8) part of Push(r) operation as pre-decrement of sp.
-const Instr kPushInstruction = DADDIU | (sp.code() << kRsShift) |
-                               (sp.code() << kRtShift) |
-                               (-kPointerSize & kImm16Mask);  // NOLINT
-// Sd(r, MemOperand(sp, 0))
-const Instr kPushRegPattern =
-    SD | (sp.code() << kRsShift) | (0 & kImm16Mask);  // NOLINT
-//  Ld(r, MemOperand(sp, 0))
-const Instr kPopRegPattern =
-    LD | (sp.code() << kRsShift) | (0 & kImm16Mask);  // NOLINT
-
-const Instr kLwRegFpOffsetPattern =
-    LW | (fp.code() << kRsShift) | (0 & kImm16Mask);  // NOLINT
-
-const Instr kSwRegFpOffsetPattern =
-    SW | (fp.code() << kRsShift) | (0 & kImm16Mask);  // NOLINT
-
-const Instr kLwRegFpNegOffsetPattern =
-    LW | (fp.code() << kRsShift) | (kNegOffset & kImm16Mask);  // NOLINT
-
-const Instr kSwRegFpNegOffsetPattern =
-    SW | (fp.code() << kRsShift) | (kNegOffset & kImm16Mask);  // NOLINT
-// A mask for the Rt register for push, pop, lw, sw instructions.
-const Instr kRtMask = kRtFieldMask;
-const Instr kLwSwInstrTypeMask = 0xFFE00000;
-const Instr kLwSwInstrArgumentMask  = ~kLwSwInstrTypeMask;
-const Instr kLwSwOffsetMask = kImm16Mask;
-
-Assembler::Assembler(IsolateData isolate_data, void* buffer, int buffer_size)
-    : AssemblerBase(isolate_data, buffer, buffer_size),
-      scratch_register_list_(at.bit()) {
-  reloc_info_writer.Reposition(buffer_ + buffer_size_, pc_);
-
-  last_trampoline_pool_end_ = 0;
-  no_trampoline_pool_before_ = 0;
-  trampoline_pool_blocked_nesting_ = 0;
-  // We leave space (16 * kTrampolineSlotsSize)
-  // for BlockTrampolinePoolScope buffer.
-  next_buffer_check_ = FLAG_force_long_branches
-      ? kMaxInt : kMaxBranchOffset - kTrampolineSlotsSize * 16;
-  internal_trampoline_exception_ = false;
-  last_bound_pos_ = 0;
-
-  trampoline_emitted_ = FLAG_force_long_branches;
-  unbound_labels_count_ = 0;
-  block_buffer_growth_ = false;
-}
-
-void Assembler::GetCode(Isolate* isolate, CodeDesc* desc) {
-  EmitForbiddenSlotInstruction();
-  DCHECK(pc_ <= reloc_info_writer.pos());  // No overlap.
-
-  AllocateAndInstallRequestedHeapObjects(isolate);
-
-  // Set up code descriptor.
-  desc->buffer = buffer_;
-  desc->buffer_size = buffer_size_;
-  desc->instr_size = pc_offset();
-  desc->reloc_size =
-      static_cast<int>((buffer_ + buffer_size_) - reloc_info_writer.pos());
-  desc->origin = this;
-  desc->constant_pool_size = 0;
-  desc->unwinding_info_size = 0;
-  desc->unwinding_info = nullptr;
-}
-
-
-void Assembler::Align(int m) {
-  DCHECK(m >= 4 && base::bits::IsPowerOfTwo(m));
-  EmitForbiddenSlotInstruction();
-  while ((pc_offset() & (m - 1)) != 0) {
-    nop();
-  }
-}
-
-
-void Assembler::CodeTargetAlign() {
-  // No advantage to aligning branch/call targets to more than
-  // single instruction, that I am aware of.
-  Align(4);
-}
-
-
-Register Assembler::GetRtReg(Instr instr) {
-  return Register::from_code((instr & kRtFieldMask) >> kRtShift);
-}
-
-
-Register Assembler::GetRsReg(Instr instr) {
-  return Register::from_code((instr & kRsFieldMask) >> kRsShift);
-}
-
-
-Register Assembler::GetRdReg(Instr instr) {
-  return Register::from_code((instr & kRdFieldMask) >> kRdShift);
-}
-
-
-uint32_t Assembler::GetRt(Instr instr) {
-  return (instr & kRtFieldMask) >> kRtShift;
-}
-
-
-uint32_t Assembler::GetRtField(Instr instr) {
-  return instr & kRtFieldMask;
-}
-
-
-uint32_t Assembler::GetRs(Instr instr) {
-  return (instr & kRsFieldMask) >> kRsShift;
-}
-
-
-uint32_t Assembler::GetRsField(Instr instr) {
-  return instr & kRsFieldMask;
-}
-
-
-uint32_t Assembler::GetRd(Instr instr) {
-  return  (instr & kRdFieldMask) >> kRdShift;
-}
-
-
-uint32_t Assembler::GetRdField(Instr instr) {
-  return  instr & kRdFieldMask;
-}
-
-
-uint32_t Assembler::GetSa(Instr instr) {
-  return (instr & kSaFieldMask) >> kSaShift;
-}
-
-
-uint32_t Assembler::GetSaField(Instr instr) {
-  return instr & kSaFieldMask;
-}
-
-
-uint32_t Assembler::GetOpcodeField(Instr instr) {
-  return instr & kOpcodeMask;
-}
-
-
-uint32_t Assembler::GetFunction(Instr instr) {
-  return (instr & kFunctionFieldMask) >> kFunctionShift;
-}
-
-
-uint32_t Assembler::GetFunctionField(Instr instr) {
-  return instr & kFunctionFieldMask;
-}
-
-
-uint32_t Assembler::GetImmediate16(Instr instr) {
-  return instr & kImm16Mask;
-}
-
-
-uint32_t Assembler::GetLabelConst(Instr instr) {
-  return instr & ~kImm16Mask;
-}
-
-
-bool Assembler::IsPop(Instr instr) {
-  return (instr & ~kRtMask) == kPopRegPattern;
-}
-
-
-bool Assembler::IsPush(Instr instr) {
-  return (instr & ~kRtMask) == kPushRegPattern;
-}
-
-
-bool Assembler::IsSwRegFpOffset(Instr instr) {
-  return ((instr & kLwSwInstrTypeMask) == kSwRegFpOffsetPattern);
-}
-
-
-bool Assembler::IsLwRegFpOffset(Instr instr) {
-  return ((instr & kLwSwInstrTypeMask) == kLwRegFpOffsetPattern);
-}
-
-
-bool Assembler::IsSwRegFpNegOffset(Instr instr) {
-  return ((instr & (kLwSwInstrTypeMask | kNegOffset)) ==
-          kSwRegFpNegOffsetPattern);
-}
-
-
-bool Assembler::IsLwRegFpNegOffset(Instr instr) {
-  return ((instr & (kLwSwInstrTypeMask | kNegOffset)) ==
-          kLwRegFpNegOffsetPattern);
-}
-
-
-// Labels refer to positions in the (to be) generated code.
-// There are bound, linked, and unused labels.
-//
-// Bound labels refer to known positions in the already
-// generated code. pos() is the position the label refers to.
-//
-// Linked labels refer to unknown positions in the code
-// to be generated; pos() is the position of the last
-// instruction using the label.
-
-// The link chain is terminated by a value in the instruction of -1,
-// which is an otherwise illegal value (branch -1 is inf loop).
-// The instruction 16-bit offset field addresses 32-bit words, but in
-// code is conv to an 18-bit value addressing bytes, hence the -4 value.
-
-const int kEndOfChain = -4;
-// Determines the end of the Jump chain (a subset of the label link chain).
-const int kEndOfJumpChain = 0;
-
-bool Assembler::IsMsaBranch(Instr instr) {
-  uint32_t opcode = GetOpcodeField(instr);
-  uint32_t rs_field = GetRsField(instr);
-  if (opcode == COP1) {
-    switch (rs_field) {
-      case BZ_V:
-      case BZ_B:
-      case BZ_H:
-      case BZ_W:
-      case BZ_D:
-      case BNZ_V:
-      case BNZ_B:
-      case BNZ_H:
-      case BNZ_W:
-      case BNZ_D:
-        return true;
-      default:
-        return false;
-    }
-  } else {
-    return false;
-  }
-}
-
-bool Assembler::IsBranch(Instr instr) {
-  uint32_t opcode   = GetOpcodeField(instr);
-  uint32_t rt_field = GetRtField(instr);
-  uint32_t rs_field = GetRsField(instr);
-  // Checks if the instruction is a branch.
-  bool isBranch =
-      opcode == BEQ || opcode == BNE || opcode == BLEZ || opcode == BGTZ ||
-      opcode == BEQL || opcode == BNEL || opcode == BLEZL || opcode == BGTZL ||
-      (opcode == REGIMM && (rt_field == BLTZ || rt_field == BGEZ ||
-                            rt_field == BLTZAL || rt_field == BGEZAL)) ||
-      (opcode == COP1 && rs_field == BC1) ||  // Coprocessor branch.
-      (opcode == COP1 && rs_field == BC1EQZ) ||
-      (opcode == COP1 && rs_field == BC1NEZ) || IsMsaBranch(instr);
-  if (!isBranch && kArchVariant == kMips64r6) {
-    // All the 3 variants of POP10 (BOVC, BEQC, BEQZALC) and
-    // POP30 (BNVC, BNEC, BNEZALC) are branch ops.
-    isBranch |= opcode == POP10 || opcode == POP30 || opcode == BC ||
-                opcode == BALC ||
-                (opcode == POP66 && rs_field != 0) ||  // BEQZC
-                (opcode == POP76 && rs_field != 0);    // BNEZC
-  }
-  return isBranch;
-}
-
-
-bool Assembler::IsBc(Instr instr) {
-  uint32_t opcode = GetOpcodeField(instr);
-  // Checks if the instruction is a BC or BALC.
-  return opcode == BC || opcode == BALC;
-}
-
-
-bool Assembler::IsBzc(Instr instr) {
-  uint32_t opcode = GetOpcodeField(instr);
-  // Checks if the instruction is BEQZC or BNEZC.
-  return (opcode == POP66 && GetRsField(instr) != 0) ||
-         (opcode == POP76 && GetRsField(instr) != 0);
-}
-
-
-bool Assembler::IsEmittedConstant(Instr instr) {
-  uint32_t label_constant = GetLabelConst(instr);
-  return label_constant == 0;  // Emitted label const in reg-exp engine.
-}
-
-
-bool Assembler::IsBeq(Instr instr) {
-  return GetOpcodeField(instr) == BEQ;
-}
-
-
-bool Assembler::IsBne(Instr instr) {
-  return GetOpcodeField(instr) == BNE;
-}
-
-
-bool Assembler::IsBeqzc(Instr instr) {
-  uint32_t opcode = GetOpcodeField(instr);
-  return opcode == POP66 && GetRsField(instr) != 0;
-}
-
-
-bool Assembler::IsBnezc(Instr instr) {
-  uint32_t opcode = GetOpcodeField(instr);
-  return opcode == POP76 && GetRsField(instr) != 0;
-}
-
-
-bool Assembler::IsBeqc(Instr instr) {
-  uint32_t opcode = GetOpcodeField(instr);
-  uint32_t rs = GetRsField(instr);
-  uint32_t rt = GetRtField(instr);
-  return opcode == POP10 && rs != 0 && rs < rt;  // && rt != 0
-}
-
-
-bool Assembler::IsBnec(Instr instr) {
-  uint32_t opcode = GetOpcodeField(instr);
-  uint32_t rs = GetRsField(instr);
-  uint32_t rt = GetRtField(instr);
-  return opcode == POP30 && rs != 0 && rs < rt;  // && rt != 0
-}
-
-
-bool Assembler::IsJump(Instr instr) {
-  uint32_t opcode   = GetOpcodeField(instr);
-  uint32_t rt_field = GetRtField(instr);
-  uint32_t rd_field = GetRdField(instr);
-  uint32_t function_field = GetFunctionField(instr);
-  // Checks if the instruction is a jump.
-  return opcode == J || opcode == JAL ||
-      (opcode == SPECIAL && rt_field == 0 &&
-      ((function_field == JALR) || (rd_field == 0 && (function_field == JR))));
-}
-
-
-bool Assembler::IsJ(Instr instr) {
-  uint32_t opcode = GetOpcodeField(instr);
-  // Checks if the instruction is a jump.
-  return opcode == J;
-}
-
-
-bool Assembler::IsJal(Instr instr) {
-  return GetOpcodeField(instr) == JAL;
-}
-
-
-bool Assembler::IsJr(Instr instr) {
-  return GetOpcodeField(instr) == SPECIAL && GetFunctionField(instr) == JR;
-}
-
-
-bool Assembler::IsJalr(Instr instr) {
-  return GetOpcodeField(instr) == SPECIAL && GetFunctionField(instr) == JALR;
-}
-
-
-bool Assembler::IsLui(Instr instr) {
-  uint32_t opcode = GetOpcodeField(instr);
-  // Checks if the instruction is a load upper immediate.
-  return opcode == LUI;
-}
-
-
-bool Assembler::IsOri(Instr instr) {
-  uint32_t opcode = GetOpcodeField(instr);
-  // Checks if the instruction is a load upper immediate.
-  return opcode == ORI;
-}
-
-
-bool Assembler::IsNop(Instr instr, unsigned int type) {
-  // See Assembler::nop(type).
-  DCHECK_LT(type, 32);
-  uint32_t opcode = GetOpcodeField(instr);
-  uint32_t function = GetFunctionField(instr);
-  uint32_t rt = GetRt(instr);
-  uint32_t rd = GetRd(instr);
-  uint32_t sa = GetSa(instr);
-
-  // Traditional mips nop == sll(zero_reg, zero_reg, 0)
-  // When marking non-zero type, use sll(zero_reg, at, type)
-  // to avoid use of mips ssnop and ehb special encodings
-  // of the sll instruction.
-
-  Register nop_rt_reg = (type == 0) ? zero_reg : at;
-  bool ret = (opcode == SPECIAL && function == SLL &&
-              rd == static_cast<uint32_t>(ToNumber(zero_reg)) &&
-              rt == static_cast<uint32_t>(ToNumber(nop_rt_reg)) &&
-              sa == type);
-
-  return ret;
-}
-
-
-int32_t Assembler::GetBranchOffset(Instr instr) {
-  DCHECK(IsBranch(instr));
-  return (static_cast<int16_t>(instr & kImm16Mask)) << 2;
-}
-
-
-bool Assembler::IsLw(Instr instr) {
-  return (static_cast<uint32_t>(instr & kOpcodeMask) == LW);
-}
-
-
-int16_t Assembler::GetLwOffset(Instr instr) {
-  DCHECK(IsLw(instr));
-  return ((instr & kImm16Mask));
-}
-
-
-Instr Assembler::SetLwOffset(Instr instr, int16_t offset) {
-  DCHECK(IsLw(instr));
-
-  // We actually create a new lw instruction based on the original one.
-  Instr temp_instr = LW | (instr & kRsFieldMask) | (instr & kRtFieldMask)
-      | (offset & kImm16Mask);
-
-  return temp_instr;
-}
-
-
-bool Assembler::IsSw(Instr instr) {
-  return (static_cast<uint32_t>(instr & kOpcodeMask) == SW);
-}
-
-
-Instr Assembler::SetSwOffset(Instr instr, int16_t offset) {
-  DCHECK(IsSw(instr));
-  return ((instr & ~kImm16Mask) | (offset & kImm16Mask));
-}
-
-
-bool Assembler::IsAddImmediate(Instr instr) {
-  return ((instr & kOpcodeMask) == ADDIU || (instr & kOpcodeMask) == DADDIU);
-}
-
-
-Instr Assembler::SetAddImmediateOffset(Instr instr, int16_t offset) {
-  DCHECK(IsAddImmediate(instr));
-  return ((instr & ~kImm16Mask) | (offset & kImm16Mask));
-}
-
-
-bool Assembler::IsAndImmediate(Instr instr) {
-  return GetOpcodeField(instr) == ANDI;
-}
-
-
-static Assembler::OffsetSize OffsetSizeInBits(Instr instr) {
-  if (kArchVariant == kMips64r6) {
-    if (Assembler::IsBc(instr)) {
-      return Assembler::OffsetSize::kOffset26;
-    } else if (Assembler::IsBzc(instr)) {
-      return Assembler::OffsetSize::kOffset21;
-    }
-  }
-  return Assembler::OffsetSize::kOffset16;
-}
-
-
-static inline int32_t AddBranchOffset(int pos, Instr instr) {
-  int bits = OffsetSizeInBits(instr);
-  const int32_t mask = (1 << bits) - 1;
-  bits = 32 - bits;
-
-  // Do NOT change this to <<2. We rely on arithmetic shifts here, assuming
-  // the compiler uses arithmetic shifts for signed integers.
-  int32_t imm = ((instr & mask) << bits) >> (bits - 2);
-
-  if (imm == kEndOfChain) {
-    // EndOfChain sentinel is returned directly, not relative to pc or pos.
-    return kEndOfChain;
-  } else {
-    return pos + Assembler::kBranchPCOffset + imm;
-  }
-}
-
-
-int Assembler::target_at(int pos, bool is_internal) {
-  if (is_internal) {
-    int64_t* p = reinterpret_cast<int64_t*>(buffer_ + pos);
-    int64_t address = *p;
-    if (address == kEndOfJumpChain) {
-      return kEndOfChain;
-    } else {
-      int64_t instr_address = reinterpret_cast<int64_t>(p);
-      DCHECK(instr_address - address < INT_MAX);
-      int delta = static_cast<int>(instr_address - address);
-      DCHECK(pos > delta);
-      return pos - delta;
-    }
-  }
-  Instr instr = instr_at(pos);
-  if ((instr & ~kImm16Mask) == 0) {
-    // Emitted label constant, not part of a branch.
-    if (instr == 0) {
-       return kEndOfChain;
-     } else {
-       int32_t imm18 =((instr & static_cast<int32_t>(kImm16Mask)) << 16) >> 14;
-       return (imm18 + pos);
-     }
-  }
-  // Check we have a branch or jump instruction.
-  DCHECK(IsBranch(instr) || IsJ(instr) || IsJal(instr) || IsLui(instr));
-  // Do NOT change this to <<2. We rely on arithmetic shifts here, assuming
-  // the compiler uses arithmetic shifts for signed integers.
-  if (IsBranch(instr)) {
-    return AddBranchOffset(pos, instr);
-  } else if (IsLui(instr)) {
-    Instr instr_lui = instr_at(pos + 0 * Assembler::kInstrSize);
-    Instr instr_ori = instr_at(pos + 1 * Assembler::kInstrSize);
-    Instr instr_ori2 = instr_at(pos + 3 * Assembler::kInstrSize);
-    DCHECK(IsOri(instr_ori));
-    DCHECK(IsOri(instr_ori2));
-
-    // TODO(plind) create named constants for shift values.
-    int64_t imm = static_cast<int64_t>(instr_lui & kImm16Mask) << 48;
-    imm |= static_cast<int64_t>(instr_ori & kImm16Mask) << 32;
-    imm |= static_cast<int64_t>(instr_ori2 & kImm16Mask) << 16;
-    // Sign extend address;
-    imm >>= 16;
-
-    if (imm == kEndOfJumpChain) {
-      // EndOfChain sentinel is returned directly, not relative to pc or pos.
-      return kEndOfChain;
-    } else {
-      uint64_t instr_address = reinterpret_cast<int64_t>(buffer_ + pos);
-      DCHECK(instr_address - imm < INT_MAX);
-      int delta = static_cast<int>(instr_address - imm);
-      DCHECK(pos > delta);
-      return pos - delta;
-    }
-  } else {
-    DCHECK(IsJ(instr) || IsJal(instr));
-    int32_t imm28 = (instr & static_cast<int32_t>(kImm26Mask)) << 2;
-    if (imm28 == kEndOfJumpChain) {
-      // EndOfChain sentinel is returned directly, not relative to pc or pos.
-      return kEndOfChain;
-    } else {
-      // Sign extend 28-bit offset.
-      int32_t delta = static_cast<int32_t>((imm28 << 4) >> 4);
-      return pos + delta;
-    }
-  }
-}
-
-
-static inline Instr SetBranchOffset(int32_t pos, int32_t target_pos,
-                                    Instr instr) {
-  int32_t bits = OffsetSizeInBits(instr);
-  int32_t imm = target_pos - (pos + Assembler::kBranchPCOffset);
-  DCHECK_EQ(imm & 3, 0);
-  imm >>= 2;
-
-  const int32_t mask = (1 << bits) - 1;
-  instr &= ~mask;
-  DCHECK(is_intn(imm, bits));
-
-  return instr | (imm & mask);
-}
-
-
-void Assembler::target_at_put(int pos, int target_pos, bool is_internal) {
-  if (is_internal) {
-    uint64_t imm = reinterpret_cast<uint64_t>(buffer_) + target_pos;
-    *reinterpret_cast<uint64_t*>(buffer_ + pos) = imm;
-    return;
-  }
-  Instr instr = instr_at(pos);
-  if ((instr & ~kImm16Mask) == 0) {
-    DCHECK(target_pos == kEndOfChain || target_pos >= 0);
-    // Emitted label constant, not part of a branch.
-    // Make label relative to Code* of generated Code object.
-    instr_at_put(pos, target_pos + (Code::kHeaderSize - kHeapObjectTag));
-    return;
-  }
-
-  if (IsBranch(instr)) {
-    instr = SetBranchOffset(pos, target_pos, instr);
-    instr_at_put(pos, instr);
-  } else if (IsLui(instr)) {
-    Instr instr_lui = instr_at(pos + 0 * Assembler::kInstrSize);
-    Instr instr_ori = instr_at(pos + 1 * Assembler::kInstrSize);
-    Instr instr_ori2 = instr_at(pos + 3 * Assembler::kInstrSize);
-    DCHECK(IsOri(instr_ori));
-    DCHECK(IsOri(instr_ori2));
-
-    uint64_t imm = reinterpret_cast<uint64_t>(buffer_) + target_pos;
-    DCHECK_EQ(imm & 3, 0);
-
-    instr_lui &= ~kImm16Mask;
-    instr_ori &= ~kImm16Mask;
-    instr_ori2 &= ~kImm16Mask;
-
-    instr_at_put(pos + 0 * Assembler::kInstrSize,
-                 instr_lui | ((imm >> 32) & kImm16Mask));
-    instr_at_put(pos + 1 * Assembler::kInstrSize,
-                 instr_ori | ((imm >> 16) & kImm16Mask));
-    instr_at_put(pos + 3 * Assembler::kInstrSize,
-                 instr_ori2 | (imm & kImm16Mask));
-  } else if (IsJ(instr) || IsJal(instr)) {
-    int32_t imm28 = target_pos - pos;
-    DCHECK_EQ(imm28 & 3, 0);
-
-    uint32_t imm26 = static_cast<uint32_t>(imm28 >> 2);
-    DCHECK(is_uint26(imm26));
-    // Place 26-bit signed offset with markings.
-    // When code is committed it will be resolved to j/jal.
-    int32_t mark = IsJ(instr) ? kJRawMark : kJalRawMark;
-    instr_at_put(pos, mark | (imm26 & kImm26Mask));
-  } else {
-    int32_t imm28 = target_pos - pos;
-    DCHECK_EQ(imm28 & 3, 0);
-
-    uint32_t imm26 = static_cast<uint32_t>(imm28 >> 2);
-    DCHECK(is_uint26(imm26));
-    // Place raw 26-bit signed offset.
-    // When code is committed it will be resolved to j/jal.
-    instr &= ~kImm26Mask;
-    instr_at_put(pos, instr | (imm26 & kImm26Mask));
-  }
-}
-
-void Assembler::print(const Label* L) {
-  if (L->is_unused()) {
-    PrintF("unused label\n");
-  } else if (L->is_bound()) {
-    PrintF("bound label to %d\n", L->pos());
-  } else if (L->is_linked()) {
-    Label l;
-    l.link_to(L->pos());
-    PrintF("unbound label");
-    while (l.is_linked()) {
-      PrintF("@ %d ", l.pos());
-      Instr instr = instr_at(l.pos());
-      if ((instr & ~kImm16Mask) == 0) {
-        PrintF("value\n");
-      } else {
-        PrintF("%d\n", instr);
-      }
-      next(&l, is_internal_reference(&l));
-    }
-  } else {
-    PrintF("label in inconsistent state (pos = %d)\n", L->pos_);
-  }
-}
-
-
-void Assembler::bind_to(Label* L, int pos) {
-  DCHECK(0 <= pos && pos <= pc_offset());  // Must have valid binding position.
-  int trampoline_pos = kInvalidSlotPos;
-  bool is_internal = false;
-  if (L->is_linked() && !trampoline_emitted_) {
-    unbound_labels_count_--;
-    if (!is_internal_reference(L)) {
-      next_buffer_check_ += kTrampolineSlotsSize;
-    }
-  }
-
-  while (L->is_linked()) {
-    int fixup_pos = L->pos();
-    int dist = pos - fixup_pos;
-    is_internal = is_internal_reference(L);
-    next(L, is_internal);  // Call next before overwriting link with target at
-                           // fixup_pos.
-    Instr instr = instr_at(fixup_pos);
-    if (is_internal) {
-      target_at_put(fixup_pos, pos, is_internal);
-    } else {
-      if (IsBranch(instr)) {
-        int branch_offset = BranchOffset(instr);
-        if (dist > branch_offset) {
-          if (trampoline_pos == kInvalidSlotPos) {
-            trampoline_pos = get_trampoline_entry(fixup_pos);
-            CHECK_NE(trampoline_pos, kInvalidSlotPos);
-          }
-          CHECK((trampoline_pos - fixup_pos) <= branch_offset);
-          target_at_put(fixup_pos, trampoline_pos, false);
-          fixup_pos = trampoline_pos;
-        }
-        target_at_put(fixup_pos, pos, false);
-      } else {
-        DCHECK(IsJ(instr) || IsJal(instr) || IsLui(instr) ||
-               IsEmittedConstant(instr));
-        target_at_put(fixup_pos, pos, false);
-      }
-    }
-  }
-  L->bind_to(pos);
-
-  // Keep track of the last bound label so we don't eliminate any instructions
-  // before a bound label.
-  if (pos > last_bound_pos_)
-    last_bound_pos_ = pos;
-}
-
-
-void Assembler::bind(Label* L) {
-  DCHECK(!L->is_bound());  // Label can only be bound once.
-  bind_to(L, pc_offset());
-}
-
-
-void Assembler::next(Label* L, bool is_internal) {
-  DCHECK(L->is_linked());
-  int link = target_at(L->pos(), is_internal);
-  if (link == kEndOfChain) {
-    L->Unuse();
-  } else {
-    DCHECK_GE(link, 0);
-    L->link_to(link);
-  }
-}
-
-
-bool Assembler::is_near(Label* L) {
-  DCHECK(L->is_bound());
-  return pc_offset() - L->pos() < kMaxBranchOffset - 4 * kInstrSize;
-}
-
-
-bool Assembler::is_near(Label* L, OffsetSize bits) {
-  if (L == nullptr || !L->is_bound()) return true;
-  return ((pc_offset() - L->pos()) <
-          (1 << (bits + 2 - 1)) - 1 - 5 * kInstrSize);
-}
-
-
-bool Assembler::is_near_branch(Label* L) {
-  DCHECK(L->is_bound());
-  return kArchVariant == kMips64r6 ? is_near_r6(L) : is_near_pre_r6(L);
-}
-
-
-int Assembler::BranchOffset(Instr instr) {
-  // At pre-R6 and for other R6 branches the offset is 16 bits.
-  int bits = OffsetSize::kOffset16;
-
-  if (kArchVariant == kMips64r6) {
-    uint32_t opcode = GetOpcodeField(instr);
-    switch (opcode) {
-      // Checks BC or BALC.
-      case BC:
-      case BALC:
-        bits = OffsetSize::kOffset26;
-        break;
-
-      // Checks BEQZC or BNEZC.
-      case POP66:
-      case POP76:
-        if (GetRsField(instr) != 0) bits = OffsetSize::kOffset21;
-        break;
-      default:
-        break;
-    }
-  }
-
-  return (1 << (bits + 2 - 1)) - 1;
-}
-
-
-// We have to use a temporary register for things that can be relocated even
-// if they can be encoded in the MIPS's 16 bits of immediate-offset instruction
-// space.  There is no guarantee that the relocated location can be similarly
-// encoded.
-bool Assembler::MustUseReg(RelocInfo::Mode rmode) {
-  return !RelocInfo::IsNone(rmode);
-}
-
-void Assembler::GenInstrRegister(Opcode opcode,
-                                 Register rs,
-                                 Register rt,
-                                 Register rd,
-                                 uint16_t sa,
-                                 SecondaryField func) {
-  DCHECK(rd.is_valid() && rs.is_valid() && rt.is_valid() && is_uint5(sa));
-  Instr instr = opcode | (rs.code() << kRsShift) | (rt.code() << kRtShift)
-      | (rd.code() << kRdShift) | (sa << kSaShift) | func;
-  emit(instr);
-}
-
-
-void Assembler::GenInstrRegister(Opcode opcode,
-                                 Register rs,
-                                 Register rt,
-                                 uint16_t msb,
-                                 uint16_t lsb,
-                                 SecondaryField func) {
-  DCHECK(rs.is_valid() && rt.is_valid() && is_uint5(msb) && is_uint5(lsb));
-  Instr instr = opcode | (rs.code() << kRsShift) | (rt.code() << kRtShift)
-      | (msb << kRdShift) | (lsb << kSaShift) | func;
-  emit(instr);
-}
-
-
-void Assembler::GenInstrRegister(Opcode opcode,
-                                 SecondaryField fmt,
-                                 FPURegister ft,
-                                 FPURegister fs,
-                                 FPURegister fd,
-                                 SecondaryField func) {
-  DCHECK(fd.is_valid() && fs.is_valid() && ft.is_valid());
-  Instr instr = opcode | fmt | (ft.code() << kFtShift) | (fs.code() << kFsShift)
-      | (fd.code() << kFdShift) | func;
-  emit(instr);
-}
-
-
-void Assembler::GenInstrRegister(Opcode opcode,
-                                 FPURegister fr,
-                                 FPURegister ft,
-                                 FPURegister fs,
-                                 FPURegister fd,
-                                 SecondaryField func) {
-  DCHECK(fd.is_valid() && fr.is_valid() && fs.is_valid() && ft.is_valid());
-  Instr instr = opcode | (fr.code() << kFrShift) | (ft.code() << kFtShift)
-      | (fs.code() << kFsShift) | (fd.code() << kFdShift) | func;
-  emit(instr);
-}
-
-
-void Assembler::GenInstrRegister(Opcode opcode,
-                                 SecondaryField fmt,
-                                 Register rt,
-                                 FPURegister fs,
-                                 FPURegister fd,
-                                 SecondaryField func) {
-  DCHECK(fd.is_valid() && fs.is_valid() && rt.is_valid());
-  Instr instr = opcode | fmt | (rt.code() << kRtShift)
-      | (fs.code() << kFsShift) | (fd.code() << kFdShift) | func;
-  emit(instr);
-}
-
-
-void Assembler::GenInstrRegister(Opcode opcode,
-                                 SecondaryField fmt,
-                                 Register rt,
-                                 FPUControlRegister fs,
-                                 SecondaryField func) {
-  DCHECK(fs.is_valid() && rt.is_valid());
-  Instr instr =
-      opcode | fmt | (rt.code() << kRtShift) | (fs.code() << kFsShift) | func;
-  emit(instr);
-}
-
-
-// Instructions with immediate value.
-// Registers are in the order of the instruction encoding, from left to right.
-void Assembler::GenInstrImmediate(Opcode opcode, Register rs, Register rt,
-                                  int32_t j,
-                                  CompactBranchType is_compact_branch) {
-  DCHECK(rs.is_valid() && rt.is_valid() && (is_int16(j) || is_uint16(j)));
-  Instr instr = opcode | (rs.code() << kRsShift) | (rt.code() << kRtShift)
-      | (j & kImm16Mask);
-  emit(instr, is_compact_branch);
-}
-
-void Assembler::GenInstrImmediate(Opcode opcode, Register base, Register rt,
-                                  int32_t offset9, int bit6,
-                                  SecondaryField func) {
-  DCHECK(base.is_valid() && rt.is_valid() && is_int9(offset9) &&
-         is_uint1(bit6));
-  Instr instr = opcode | (base.code() << kBaseShift) | (rt.code() << kRtShift) |
-                ((offset9 << kImm9Shift) & kImm9Mask) | bit6 << kBit6Shift |
-                func;
-  emit(instr);
-}
-
-void Assembler::GenInstrImmediate(Opcode opcode, Register rs, SecondaryField SF,
-                                  int32_t j,
-                                  CompactBranchType is_compact_branch) {
-  DCHECK(rs.is_valid() && (is_int16(j) || is_uint16(j)));
-  Instr instr = opcode | (rs.code() << kRsShift) | SF | (j & kImm16Mask);
-  emit(instr, is_compact_branch);
-}
-
-
-void Assembler::GenInstrImmediate(Opcode opcode, Register rs, FPURegister ft,
-                                  int32_t j,
-                                  CompactBranchType is_compact_branch) {
-  DCHECK(rs.is_valid() && ft.is_valid() && (is_int16(j) || is_uint16(j)));
-  Instr instr = opcode | (rs.code() << kRsShift) | (ft.code() << kFtShift)
-      | (j & kImm16Mask);
-  emit(instr, is_compact_branch);
-}
-
-
-void Assembler::GenInstrImmediate(Opcode opcode, Register rs, int32_t offset21,
-                                  CompactBranchType is_compact_branch) {
-  DCHECK(rs.is_valid() && (is_int21(offset21)));
-  Instr instr = opcode | (rs.code() << kRsShift) | (offset21 & kImm21Mask);
-  emit(instr, is_compact_branch);
-}
-
-
-void Assembler::GenInstrImmediate(Opcode opcode, Register rs,
-                                  uint32_t offset21) {
-  DCHECK(rs.is_valid() && (is_uint21(offset21)));
-  Instr instr = opcode | (rs.code() << kRsShift) | (offset21 & kImm21Mask);
-  emit(instr);
-}
-
-
-void Assembler::GenInstrImmediate(Opcode opcode, int32_t offset26,
-                                  CompactBranchType is_compact_branch) {
-  DCHECK(is_int26(offset26));
-  Instr instr = opcode | (offset26 & kImm26Mask);
-  emit(instr, is_compact_branch);
-}
-
-
-void Assembler::GenInstrJump(Opcode opcode,
-                             uint32_t address) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  DCHECK(is_uint26(address));
-  Instr instr = opcode | address;
-  emit(instr);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-// MSA instructions
-void Assembler::GenInstrMsaI8(SecondaryField operation, uint32_t imm8,
-                              MSARegister ws, MSARegister wd) {
-  DCHECK((kArchVariant == kMips64r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(ws.is_valid() && wd.is_valid() && is_uint8(imm8));
-  Instr instr = MSA | operation | ((imm8 & kImm8Mask) << kWtShift) |
-                (ws.code() << kWsShift) | (wd.code() << kWdShift);
-  emit(instr);
-}
-
-void Assembler::GenInstrMsaI5(SecondaryField operation, SecondaryField df,
-                              int32_t imm5, MSARegister ws, MSARegister wd) {
-  DCHECK((kArchVariant == kMips64r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(ws.is_valid() && wd.is_valid());
-  DCHECK((operation == MAXI_S) || (operation == MINI_S) ||
-                 (operation == CEQI) || (operation == CLTI_S) ||
-                 (operation == CLEI_S)
-             ? is_int5(imm5)
-             : is_uint5(imm5));
-  Instr instr = MSA | operation | df | ((imm5 & kImm5Mask) << kWtShift) |
-                (ws.code() << kWsShift) | (wd.code() << kWdShift);
-  emit(instr);
-}
-
-void Assembler::GenInstrMsaBit(SecondaryField operation, SecondaryField df,
-                               uint32_t m, MSARegister ws, MSARegister wd) {
-  DCHECK((kArchVariant == kMips64r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(ws.is_valid() && wd.is_valid() && is_valid_msa_df_m(df, m));
-  Instr instr = MSA | operation | df | (m << kWtShift) |
-                (ws.code() << kWsShift) | (wd.code() << kWdShift);
-  emit(instr);
-}
-
-void Assembler::GenInstrMsaI10(SecondaryField operation, SecondaryField df,
-                               int32_t imm10, MSARegister wd) {
-  DCHECK((kArchVariant == kMips64r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(wd.is_valid() && is_int10(imm10));
-  Instr instr = MSA | operation | df | ((imm10 & kImm10Mask) << kWsShift) |
-                (wd.code() << kWdShift);
-  emit(instr);
-}
-
-template <typename RegType>
-void Assembler::GenInstrMsa3R(SecondaryField operation, SecondaryField df,
-                              RegType t, MSARegister ws, MSARegister wd) {
-  DCHECK((kArchVariant == kMips64r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(t.is_valid() && ws.is_valid() && wd.is_valid());
-  Instr instr = MSA | operation | df | (t.code() << kWtShift) |
-                (ws.code() << kWsShift) | (wd.code() << kWdShift);
-  emit(instr);
-}
-
-template <typename DstType, typename SrcType>
-void Assembler::GenInstrMsaElm(SecondaryField operation, SecondaryField df,
-                               uint32_t n, SrcType src, DstType dst) {
-  DCHECK((kArchVariant == kMips64r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(src.is_valid() && dst.is_valid() && is_valid_msa_df_n(df, n));
-  Instr instr = MSA | operation | df | (n << kWtShift) |
-                (src.code() << kWsShift) | (dst.code() << kWdShift) |
-                MSA_ELM_MINOR;
-  emit(instr);
-}
-
-void Assembler::GenInstrMsa3RF(SecondaryField operation, uint32_t df,
-                               MSARegister wt, MSARegister ws, MSARegister wd) {
-  DCHECK((kArchVariant == kMips64r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(wt.is_valid() && ws.is_valid() && wd.is_valid());
-  DCHECK_LT(df, 2);
-  Instr instr = MSA | operation | (df << 21) | (wt.code() << kWtShift) |
-                (ws.code() << kWsShift) | (wd.code() << kWdShift);
-  emit(instr);
-}
-
-void Assembler::GenInstrMsaVec(SecondaryField operation, MSARegister wt,
-                               MSARegister ws, MSARegister wd) {
-  DCHECK((kArchVariant == kMips64r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(wt.is_valid() && ws.is_valid() && wd.is_valid());
-  Instr instr = MSA | operation | (wt.code() << kWtShift) |
-                (ws.code() << kWsShift) | (wd.code() << kWdShift) |
-                MSA_VEC_2R_2RF_MINOR;
-  emit(instr);
-}
-
-void Assembler::GenInstrMsaMI10(SecondaryField operation, int32_t s10,
-                                Register rs, MSARegister wd) {
-  DCHECK((kArchVariant == kMips64r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(rs.is_valid() && wd.is_valid() && is_int10(s10));
-  Instr instr = MSA | operation | ((s10 & kImm10Mask) << kWtShift) |
-                (rs.code() << kWsShift) | (wd.code() << kWdShift);
-  emit(instr);
-}
-
-void Assembler::GenInstrMsa2R(SecondaryField operation, SecondaryField df,
-                              MSARegister ws, MSARegister wd) {
-  DCHECK((kArchVariant == kMips64r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(ws.is_valid() && wd.is_valid());
-  Instr instr = MSA | MSA_2R_FORMAT | operation | df | (ws.code() << kWsShift) |
-                (wd.code() << kWdShift) | MSA_VEC_2R_2RF_MINOR;
-  emit(instr);
-}
-
-void Assembler::GenInstrMsa2RF(SecondaryField operation, SecondaryField df,
-                               MSARegister ws, MSARegister wd) {
-  DCHECK((kArchVariant == kMips64r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(ws.is_valid() && wd.is_valid());
-  Instr instr = MSA | MSA_2RF_FORMAT | operation | df |
-                (ws.code() << kWsShift) | (wd.code() << kWdShift) |
-                MSA_VEC_2R_2RF_MINOR;
-  emit(instr);
-}
-
-void Assembler::GenInstrMsaBranch(SecondaryField operation, MSARegister wt,
-                                  int32_t offset16) {
-  DCHECK((kArchVariant == kMips64r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(wt.is_valid() && is_int16(offset16));
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  Instr instr =
-      COP1 | operation | (wt.code() << kWtShift) | (offset16 & kImm16Mask);
-  emit(instr);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-// Returns the next free trampoline entry.
-int32_t Assembler::get_trampoline_entry(int32_t pos) {
-  int32_t trampoline_entry = kInvalidSlotPos;
-  if (!internal_trampoline_exception_) {
-    if (trampoline_.start() > pos) {
-     trampoline_entry = trampoline_.take_slot();
-    }
-
-    if (kInvalidSlotPos == trampoline_entry) {
-      internal_trampoline_exception_ = true;
-    }
-  }
-  return trampoline_entry;
-}
-
-
-uint64_t Assembler::jump_address(Label* L) {
-  int64_t target_pos;
-  if (L->is_bound()) {
-    target_pos = L->pos();
-  } else {
-    if (L->is_linked()) {
-      target_pos = L->pos();  // L's link.
-      L->link_to(pc_offset());
-    } else {
-      L->link_to(pc_offset());
-      return kEndOfJumpChain;
-    }
-  }
-  uint64_t imm = reinterpret_cast<uint64_t>(buffer_) + target_pos;
-  DCHECK_EQ(imm & 3, 0);
-
-  return imm;
-}
-
-
-uint64_t Assembler::jump_offset(Label* L) {
-  int64_t target_pos;
-  int32_t pad = IsPrevInstrCompactBranch() ? kInstrSize : 0;
-
-  if (L->is_bound()) {
-    target_pos = L->pos();
-  } else {
-    if (L->is_linked()) {
-      target_pos = L->pos();  // L's link.
-      L->link_to(pc_offset() + pad);
-    } else {
-      L->link_to(pc_offset() + pad);
-      return kEndOfJumpChain;
-    }
-  }
-  int64_t imm = target_pos - (pc_offset() + pad);
-  DCHECK_EQ(imm & 3, 0);
-
-  return static_cast<uint64_t>(imm);
-}
-
-
-int32_t Assembler::branch_offset_helper(Label* L, OffsetSize bits) {
-  int32_t target_pos;
-  int32_t pad = IsPrevInstrCompactBranch() ? kInstrSize : 0;
-
-  if (L->is_bound()) {
-    target_pos = L->pos();
-  } else {
-    if (L->is_linked()) {
-      target_pos = L->pos();
-      L->link_to(pc_offset() + pad);
-    } else {
-      L->link_to(pc_offset() + pad);
-      if (!trampoline_emitted_) {
-        unbound_labels_count_++;
-        next_buffer_check_ -= kTrampolineSlotsSize;
-      }
-      return kEndOfChain;
-    }
-  }
-
-  int32_t offset = target_pos - (pc_offset() + kBranchPCOffset + pad);
-  DCHECK(is_intn(offset, bits + 2));
-  DCHECK_EQ(offset & 3, 0);
-
-  return offset;
-}
-
-
-void Assembler::label_at_put(Label* L, int at_offset) {
-  int target_pos;
-  if (L->is_bound()) {
-    target_pos = L->pos();
-    instr_at_put(at_offset, target_pos + (Code::kHeaderSize - kHeapObjectTag));
-  } else {
-    if (L->is_linked()) {
-      target_pos = L->pos();  // L's link.
-      int32_t imm18 = target_pos - at_offset;
-      DCHECK_EQ(imm18 & 3, 0);
-      int32_t imm16 = imm18 >> 2;
-      DCHECK(is_int16(imm16));
-      instr_at_put(at_offset, (imm16 & kImm16Mask));
-    } else {
-      target_pos = kEndOfChain;
-      instr_at_put(at_offset, 0);
-      if (!trampoline_emitted_) {
-        unbound_labels_count_++;
-        next_buffer_check_ -= kTrampolineSlotsSize;
-      }
-    }
-    L->link_to(at_offset);
-  }
-}
-
-
-//------- Branch and jump instructions --------
-
-void Assembler::b(int16_t offset) {
-  beq(zero_reg, zero_reg, offset);
-}
-
-
-void Assembler::bal(int16_t offset) {
-  bgezal(zero_reg, offset);
-}
-
-
-void Assembler::bc(int32_t offset) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrImmediate(BC, offset, CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::balc(int32_t offset) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrImmediate(BALC, offset, CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::beq(Register rs, Register rt, int16_t offset) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  GenInstrImmediate(BEQ, rs, rt, offset);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-
-void Assembler::bgez(Register rs, int16_t offset) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  GenInstrImmediate(REGIMM, rs, BGEZ, offset);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-
-void Assembler::bgezc(Register rt, int16_t offset) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(rt != zero_reg);
-  GenInstrImmediate(BLEZL, rt, rt, offset, CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::bgeuc(Register rs, Register rt, int16_t offset) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(rs != zero_reg);
-  DCHECK(rt != zero_reg);
-  DCHECK(rs.code() != rt.code());
-  GenInstrImmediate(BLEZ, rs, rt, offset, CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::bgec(Register rs, Register rt, int16_t offset) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(rs != zero_reg);
-  DCHECK(rt != zero_reg);
-  DCHECK(rs.code() != rt.code());
-  GenInstrImmediate(BLEZL, rs, rt, offset, CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::bgezal(Register rs, int16_t offset) {
-  DCHECK(kArchVariant != kMips64r6 || rs == zero_reg);
-  DCHECK(rs != ra);
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  GenInstrImmediate(REGIMM, rs, BGEZAL, offset);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-
-void Assembler::bgtz(Register rs, int16_t offset) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  GenInstrImmediate(BGTZ, rs, zero_reg, offset);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-
-void Assembler::bgtzc(Register rt, int16_t offset) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(rt != zero_reg);
-  GenInstrImmediate(BGTZL, zero_reg, rt, offset,
-                    CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::blez(Register rs, int16_t offset) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  GenInstrImmediate(BLEZ, rs, zero_reg, offset);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-
-void Assembler::blezc(Register rt, int16_t offset) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(rt != zero_reg);
-  GenInstrImmediate(BLEZL, zero_reg, rt, offset,
-                    CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::bltzc(Register rt, int16_t offset) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(rt != zero_reg);
-  GenInstrImmediate(BGTZL, rt, rt, offset, CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::bltuc(Register rs, Register rt, int16_t offset) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(rs != zero_reg);
-  DCHECK(rt != zero_reg);
-  DCHECK(rs.code() != rt.code());
-  GenInstrImmediate(BGTZ, rs, rt, offset, CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::bltc(Register rs, Register rt, int16_t offset) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(rs != zero_reg);
-  DCHECK(rt != zero_reg);
-  DCHECK(rs.code() != rt.code());
-  GenInstrImmediate(BGTZL, rs, rt, offset, CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::bltz(Register rs, int16_t offset) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  GenInstrImmediate(REGIMM, rs, BLTZ, offset);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-
-void Assembler::bltzal(Register rs, int16_t offset) {
-  DCHECK(kArchVariant != kMips64r6 || rs == zero_reg);
-  DCHECK(rs != ra);
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  GenInstrImmediate(REGIMM, rs, BLTZAL, offset);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-
-void Assembler::bne(Register rs, Register rt, int16_t offset) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  GenInstrImmediate(BNE, rs, rt, offset);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-
-void Assembler::bovc(Register rs, Register rt, int16_t offset) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  if (rs.code() >= rt.code()) {
-    GenInstrImmediate(ADDI, rs, rt, offset, CompactBranchType::COMPACT_BRANCH);
-  } else {
-    GenInstrImmediate(ADDI, rt, rs, offset, CompactBranchType::COMPACT_BRANCH);
-  }
-}
-
-
-void Assembler::bnvc(Register rs, Register rt, int16_t offset) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  if (rs.code() >= rt.code()) {
-    GenInstrImmediate(DADDI, rs, rt, offset, CompactBranchType::COMPACT_BRANCH);
-  } else {
-    GenInstrImmediate(DADDI, rt, rs, offset, CompactBranchType::COMPACT_BRANCH);
-  }
-}
-
-
-void Assembler::blezalc(Register rt, int16_t offset) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(rt != zero_reg);
-  DCHECK(rt != ra);
-  GenInstrImmediate(BLEZ, zero_reg, rt, offset,
-                    CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::bgezalc(Register rt, int16_t offset) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(rt != zero_reg);
-  DCHECK(rt != ra);
-  GenInstrImmediate(BLEZ, rt, rt, offset, CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::bgezall(Register rs, int16_t offset) {
-  DCHECK_NE(kArchVariant, kMips64r6);
-  DCHECK(rs != zero_reg);
-  DCHECK(rs != ra);
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  GenInstrImmediate(REGIMM, rs, BGEZALL, offset);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-
-void Assembler::bltzalc(Register rt, int16_t offset) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(rt != zero_reg);
-  DCHECK(rt != ra);
-  GenInstrImmediate(BGTZ, rt, rt, offset, CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::bgtzalc(Register rt, int16_t offset) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(rt != zero_reg);
-  DCHECK(rt != ra);
-  GenInstrImmediate(BGTZ, zero_reg, rt, offset,
-                    CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::beqzalc(Register rt, int16_t offset) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(rt != zero_reg);
-  DCHECK(rt != ra);
-  GenInstrImmediate(ADDI, zero_reg, rt, offset,
-                    CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::bnezalc(Register rt, int16_t offset) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(rt != zero_reg);
-  DCHECK(rt != ra);
-  GenInstrImmediate(DADDI, zero_reg, rt, offset,
-                    CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::beqc(Register rs, Register rt, int16_t offset) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(rs.code() != rt.code() && rs.code() != 0 && rt.code() != 0);
-  if (rs.code() < rt.code()) {
-    GenInstrImmediate(ADDI, rs, rt, offset, CompactBranchType::COMPACT_BRANCH);
-  } else {
-    GenInstrImmediate(ADDI, rt, rs, offset, CompactBranchType::COMPACT_BRANCH);
-  }
-}
-
-
-void Assembler::beqzc(Register rs, int32_t offset) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(rs != zero_reg);
-  GenInstrImmediate(POP66, rs, offset, CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::bnec(Register rs, Register rt, int16_t offset) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(rs.code() != rt.code() && rs.code() != 0 && rt.code() != 0);
-  if (rs.code() < rt.code()) {
-    GenInstrImmediate(DADDI, rs, rt, offset, CompactBranchType::COMPACT_BRANCH);
-  } else {
-    GenInstrImmediate(DADDI, rt, rs, offset, CompactBranchType::COMPACT_BRANCH);
-  }
-}
-
-
-void Assembler::bnezc(Register rs, int32_t offset) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(rs != zero_reg);
-  GenInstrImmediate(POP76, rs, offset, CompactBranchType::COMPACT_BRANCH);
-}
-
-
-void Assembler::j(int64_t target) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  GenInstrJump(J, static_cast<uint32_t>(target >> 2) & kImm26Mask);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-
-void Assembler::j(Label* target) {
-  uint64_t imm = jump_offset(target);
-  if (target->is_bound()) {
-    BlockTrampolinePoolScope block_trampoline_pool(this);
-    GenInstrJump(static_cast<Opcode>(kJRawMark),
-                 static_cast<uint32_t>(imm >> 2) & kImm26Mask);
-    BlockTrampolinePoolFor(1);  // For associated delay slot.
-  } else {
-    j(imm);
-  }
-}
-
-
-void Assembler::jal(Label* target) {
-  uint64_t imm = jump_offset(target);
-  if (target->is_bound()) {
-    BlockTrampolinePoolScope block_trampoline_pool(this);
-    GenInstrJump(static_cast<Opcode>(kJalRawMark),
-                 static_cast<uint32_t>(imm >> 2) & kImm26Mask);
-    BlockTrampolinePoolFor(1);  // For associated delay slot.
-  } else {
-    jal(imm);
-  }
-}
-
-
-void Assembler::jr(Register rs) {
-  if (kArchVariant != kMips64r6) {
-    BlockTrampolinePoolScope block_trampoline_pool(this);
-    GenInstrRegister(SPECIAL, rs, zero_reg, zero_reg, 0, JR);
-    BlockTrampolinePoolFor(1);  // For associated delay slot.
-  } else {
-    jalr(rs, zero_reg);
-  }
-}
-
-
-void Assembler::jal(int64_t target) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  GenInstrJump(JAL, static_cast<uint32_t>(target >> 2) & kImm26Mask);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-
-void Assembler::jalr(Register rs, Register rd) {
-  DCHECK(rs.code() != rd.code());
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  GenInstrRegister(SPECIAL, rs, zero_reg, rd, 0, JALR);
-  BlockTrampolinePoolFor(1);  // For associated delay slot.
-}
-
-
-void Assembler::jic(Register rt, int16_t offset) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrImmediate(POP66, zero_reg, rt, offset);
-}
-
-
-void Assembler::jialc(Register rt, int16_t offset) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrImmediate(POP76, zero_reg, rt, offset);
-}
-
-
-// -------Data-processing-instructions---------
-
-// Arithmetic.
-
-void Assembler::addu(Register rd, Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, ADDU);
-}
-
-
-void Assembler::addiu(Register rd, Register rs, int32_t j) {
-  GenInstrImmediate(ADDIU, rs, rd, j);
-}
-
-
-void Assembler::subu(Register rd, Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, SUBU);
-}
-
-
-void Assembler::mul(Register rd, Register rs, Register rt) {
-  if (kArchVariant == kMips64r6) {
-      GenInstrRegister(SPECIAL, rs, rt, rd, MUL_OP, MUL_MUH);
-  } else {
-      GenInstrRegister(SPECIAL2, rs, rt, rd, 0, MUL);
-  }
-}
-
-
-void Assembler::muh(Register rd, Register rs, Register rt) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrRegister(SPECIAL, rs, rt, rd, MUH_OP, MUL_MUH);
-}
-
-
-void Assembler::mulu(Register rd, Register rs, Register rt) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrRegister(SPECIAL, rs, rt, rd, MUL_OP, MUL_MUH_U);
-}
-
-
-void Assembler::muhu(Register rd, Register rs, Register rt) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrRegister(SPECIAL, rs, rt, rd, MUH_OP, MUL_MUH_U);
-}
-
-
-void Assembler::dmul(Register rd, Register rs, Register rt) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrRegister(SPECIAL, rs, rt, rd, MUL_OP, D_MUL_MUH);
-}
-
-
-void Assembler::dmuh(Register rd, Register rs, Register rt) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrRegister(SPECIAL, rs, rt, rd, MUH_OP, D_MUL_MUH);
-}
-
-
-void Assembler::dmulu(Register rd, Register rs, Register rt) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrRegister(SPECIAL, rs, rt, rd, MUL_OP, D_MUL_MUH_U);
-}
-
-
-void Assembler::dmuhu(Register rd, Register rs, Register rt) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrRegister(SPECIAL, rs, rt, rd, MUH_OP, D_MUL_MUH_U);
-}
-
-
-void Assembler::mult(Register rs, Register rt) {
-  DCHECK_NE(kArchVariant, kMips64r6);
-  GenInstrRegister(SPECIAL, rs, rt, zero_reg, 0, MULT);
-}
-
-
-void Assembler::multu(Register rs, Register rt) {
-  DCHECK_NE(kArchVariant, kMips64r6);
-  GenInstrRegister(SPECIAL, rs, rt, zero_reg, 0, MULTU);
-}
-
-
-void Assembler::daddiu(Register rd, Register rs, int32_t j) {
-  GenInstrImmediate(DADDIU, rs, rd, j);
-}
-
-
-void Assembler::div(Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, zero_reg, 0, DIV);
-}
-
-
-void Assembler::div(Register rd, Register rs, Register rt) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrRegister(SPECIAL, rs, rt, rd, DIV_OP, DIV_MOD);
-}
-
-
-void Assembler::mod(Register rd, Register rs, Register rt) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrRegister(SPECIAL, rs, rt, rd, MOD_OP, DIV_MOD);
-}
-
-
-void Assembler::divu(Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, zero_reg, 0, DIVU);
-}
-
-
-void Assembler::divu(Register rd, Register rs, Register rt) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrRegister(SPECIAL, rs, rt, rd, DIV_OP, DIV_MOD_U);
-}
-
-
-void Assembler::modu(Register rd, Register rs, Register rt) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrRegister(SPECIAL, rs, rt, rd, MOD_OP, DIV_MOD_U);
-}
-
-
-void Assembler::daddu(Register rd, Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, DADDU);
-}
-
-
-void Assembler::dsubu(Register rd, Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, DSUBU);
-}
-
-
-void Assembler::dmult(Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, zero_reg, 0, DMULT);
-}
-
-
-void Assembler::dmultu(Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, zero_reg, 0, DMULTU);
-}
-
-
-void Assembler::ddiv(Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, zero_reg, 0, DDIV);
-}
-
-
-void Assembler::ddiv(Register rd, Register rs, Register rt) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrRegister(SPECIAL, rs, rt, rd, DIV_OP, D_DIV_MOD);
-}
-
-
-void Assembler::dmod(Register rd, Register rs, Register rt) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrRegister(SPECIAL, rs, rt, rd, MOD_OP, D_DIV_MOD);
-}
-
-
-void Assembler::ddivu(Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, zero_reg, 0, DDIVU);
-}
-
-
-void Assembler::ddivu(Register rd, Register rs, Register rt) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrRegister(SPECIAL, rs, rt, rd, DIV_OP, D_DIV_MOD_U);
-}
-
-
-void Assembler::dmodu(Register rd, Register rs, Register rt) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrRegister(SPECIAL, rs, rt, rd, MOD_OP, D_DIV_MOD_U);
-}
-
-
-// Logical.
-
-void Assembler::and_(Register rd, Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, AND);
-}
-
-
-void Assembler::andi(Register rt, Register rs, int32_t j) {
-  DCHECK(is_uint16(j));
-  GenInstrImmediate(ANDI, rs, rt, j);
-}
-
-
-void Assembler::or_(Register rd, Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, OR);
-}
-
-
-void Assembler::ori(Register rt, Register rs, int32_t j) {
-  DCHECK(is_uint16(j));
-  GenInstrImmediate(ORI, rs, rt, j);
-}
-
-
-void Assembler::xor_(Register rd, Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, XOR);
-}
-
-
-void Assembler::xori(Register rt, Register rs, int32_t j) {
-  DCHECK(is_uint16(j));
-  GenInstrImmediate(XORI, rs, rt, j);
-}
-
-
-void Assembler::nor(Register rd, Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, NOR);
-}
-
-
-// Shifts.
-void Assembler::sll(Register rd,
-                    Register rt,
-                    uint16_t sa,
-                    bool coming_from_nop) {
-  // Don't allow nop instructions in the form sll zero_reg, zero_reg to be
-  // generated using the sll instruction. They must be generated using
-  // nop(int/NopMarkerTypes).
-  DCHECK(coming_from_nop || (rd != zero_reg && rt != zero_reg));
-  GenInstrRegister(SPECIAL, zero_reg, rt, rd, sa & 0x1F, SLL);
-}
-
-
-void Assembler::sllv(Register rd, Register rt, Register rs) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, SLLV);
-}
-
-
-void Assembler::srl(Register rd, Register rt, uint16_t sa) {
-  GenInstrRegister(SPECIAL, zero_reg, rt, rd, sa & 0x1F, SRL);
-}
-
-
-void Assembler::srlv(Register rd, Register rt, Register rs) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, SRLV);
-}
-
-
-void Assembler::sra(Register rd, Register rt, uint16_t sa) {
-  GenInstrRegister(SPECIAL, zero_reg, rt, rd, sa & 0x1F, SRA);
-}
-
-
-void Assembler::srav(Register rd, Register rt, Register rs) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, SRAV);
-}
-
-
-void Assembler::rotr(Register rd, Register rt, uint16_t sa) {
-  // Should be called via MacroAssembler::Ror.
-  DCHECK(rd.is_valid() && rt.is_valid() && is_uint5(sa));
-  DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
-  Instr instr = SPECIAL | (1 << kRsShift) | (rt.code() << kRtShift)
-      | (rd.code() << kRdShift) | (sa << kSaShift) | SRL;
-  emit(instr);
-}
-
-
-void Assembler::rotrv(Register rd, Register rt, Register rs) {
-  // Should be called via MacroAssembler::Ror.
-  DCHECK(rd.is_valid() && rt.is_valid() && rs.is_valid());
-  DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
-  Instr instr = SPECIAL | (rs.code() << kRsShift) | (rt.code() << kRtShift)
-     | (rd.code() << kRdShift) | (1 << kSaShift) | SRLV;
-  emit(instr);
-}
-
-
-void Assembler::dsll(Register rd, Register rt, uint16_t sa) {
-  GenInstrRegister(SPECIAL, zero_reg, rt, rd, sa & 0x1F, DSLL);
-}
-
-
-void Assembler::dsllv(Register rd, Register rt, Register rs) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, DSLLV);
-}
-
-
-void Assembler::dsrl(Register rd, Register rt, uint16_t sa) {
-  GenInstrRegister(SPECIAL, zero_reg, rt, rd, sa & 0x1F, DSRL);
-}
-
-
-void Assembler::dsrlv(Register rd, Register rt, Register rs) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, DSRLV);
-}
-
-
-void Assembler::drotr(Register rd, Register rt, uint16_t sa) {
-  DCHECK(rd.is_valid() && rt.is_valid() && is_uint5(sa));
-  Instr instr = SPECIAL | (1 << kRsShift) | (rt.code() << kRtShift)
-      | (rd.code() << kRdShift) | (sa << kSaShift) | DSRL;
-  emit(instr);
-}
-
-void Assembler::drotr32(Register rd, Register rt, uint16_t sa) {
-  DCHECK(rd.is_valid() && rt.is_valid() && is_uint5(sa));
-  Instr instr = SPECIAL | (1 << kRsShift) | (rt.code() << kRtShift) |
-                (rd.code() << kRdShift) | (sa << kSaShift) | DSRL32;
-  emit(instr);
-}
-
-void Assembler::drotrv(Register rd, Register rt, Register rs) {
-  DCHECK(rd.is_valid() && rt.is_valid() && rs.is_valid() );
-  Instr instr = SPECIAL | (rs.code() << kRsShift) | (rt.code() << kRtShift)
-      | (rd.code() << kRdShift) | (1 << kSaShift) | DSRLV;
-  emit(instr);
-}
-
-
-void Assembler::dsra(Register rd, Register rt, uint16_t sa) {
-  GenInstrRegister(SPECIAL, zero_reg, rt, rd, sa & 0x1F, DSRA);
-}
-
-
-void Assembler::dsrav(Register rd, Register rt, Register rs) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, DSRAV);
-}
-
-
-void Assembler::dsll32(Register rd, Register rt, uint16_t sa) {
-  GenInstrRegister(SPECIAL, zero_reg, rt, rd, sa & 0x1F, DSLL32);
-}
-
-
-void Assembler::dsrl32(Register rd, Register rt, uint16_t sa) {
-  GenInstrRegister(SPECIAL, zero_reg, rt, rd, sa & 0x1F, DSRL32);
-}
-
-
-void Assembler::dsra32(Register rd, Register rt, uint16_t sa) {
-  GenInstrRegister(SPECIAL, zero_reg, rt, rd, sa & 0x1F, DSRA32);
-}
-
-
-void Assembler::lsa(Register rd, Register rt, Register rs, uint8_t sa) {
-  DCHECK(rd.is_valid() && rt.is_valid() && rs.is_valid());
-  DCHECK_LE(sa, 3);
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  Instr instr = SPECIAL | rs.code() << kRsShift | rt.code() << kRtShift |
-                rd.code() << kRdShift | sa << kSaShift | LSA;
-  emit(instr);
-}
-
-
-void Assembler::dlsa(Register rd, Register rt, Register rs, uint8_t sa) {
-  DCHECK(rd.is_valid() && rt.is_valid() && rs.is_valid());
-  DCHECK_LE(sa, 3);
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  Instr instr = SPECIAL | rs.code() << kRsShift | rt.code() << kRtShift |
-                rd.code() << kRdShift | sa << kSaShift | DLSA;
-  emit(instr);
-}
-
-
-// ------------Memory-instructions-------------
-
-void Assembler::AdjustBaseAndOffset(MemOperand& src,
-                                    OffsetAccessType access_type,
-                                    int second_access_add_to_offset) {
-  // This method is used to adjust the base register and offset pair
-  // for a load/store when the offset doesn't fit into int16_t.
-  // It is assumed that 'base + offset' is sufficiently aligned for memory
-  // operands that are machine word in size or smaller. For doubleword-sized
-  // operands it's assumed that 'base' is a multiple of 8, while 'offset'
-  // may be a multiple of 4 (e.g. 4-byte-aligned long and double arguments
-  // and spilled variables on the stack accessed relative to the stack
-  // pointer register).
-  // We preserve the "alignment" of 'offset' by adjusting it by a multiple of 8.
-
-  bool doubleword_aligned = (src.offset() & (kDoubleSize - 1)) == 0;
-  bool two_accesses = static_cast<bool>(access_type) || !doubleword_aligned;
-  DCHECK_LE(second_access_add_to_offset, 7);  // Must be <= 7.
-
-  // is_int16 must be passed a signed value, hence the static cast below.
-  if (is_int16(src.offset()) &&
-      (!two_accesses || is_int16(static_cast<int32_t>(
-                            src.offset() + second_access_add_to_offset)))) {
-    // Nothing to do: 'offset' (and, if needed, 'offset + 4', or other specified
-    // value) fits into int16_t.
-    return;
-  }
-
-  DCHECK(src.rm() !=
-         at);  // Must not overwrite the register 'base' while loading 'offset'.
-
-#ifdef DEBUG
-  // Remember the "(mis)alignment" of 'offset', it will be checked at the end.
-  uint32_t misalignment = src.offset() & (kDoubleSize - 1);
-#endif
-
-  // Do not load the whole 32-bit 'offset' if it can be represented as
-  // a sum of two 16-bit signed offsets. This can save an instruction or two.
-  // To simplify matters, only do this for a symmetric range of offsets from
-  // about -64KB to about +64KB, allowing further addition of 4 when accessing
-  // 64-bit variables with two 32-bit accesses.
-  constexpr int32_t kMinOffsetForSimpleAdjustment =
-      0x7FF8;  // Max int16_t that's a multiple of 8.
-  constexpr int32_t kMaxOffsetForSimpleAdjustment =
-      2 * kMinOffsetForSimpleAdjustment;
-
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  if (0 <= src.offset() && src.offset() <= kMaxOffsetForSimpleAdjustment) {
-    daddiu(scratch, src.rm(), kMinOffsetForSimpleAdjustment);
-    src.offset_ -= kMinOffsetForSimpleAdjustment;
-  } else if (-kMaxOffsetForSimpleAdjustment <= src.offset() &&
-             src.offset() < 0) {
-    daddiu(scratch, src.rm(), -kMinOffsetForSimpleAdjustment);
-    src.offset_ += kMinOffsetForSimpleAdjustment;
-  } else if (kArchVariant == kMips64r6) {
-    // On r6 take advantage of the daui instruction, e.g.:
-    //    daui   at, base, offset_high
-    //   [dahi   at, 1]                       // When `offset` is close to +2GB.
-    //    lw     reg_lo, offset_low(at)
-    //   [lw     reg_hi, (offset_low+4)(at)]  // If misaligned 64-bit load.
-    // or when offset_low+4 overflows int16_t:
-    //    daui   at, base, offset_high
-    //    daddiu at, at, 8
-    //    lw     reg_lo, (offset_low-8)(at)
-    //    lw     reg_hi, (offset_low-4)(at)
-    int16_t offset_low = static_cast<uint16_t>(src.offset());
-    int32_t offset_low32 = offset_low;
-    int16_t offset_high = static_cast<uint16_t>(src.offset() >> 16);
-    bool increment_hi16 = offset_low < 0;
-    bool overflow_hi16 = false;
-
-    if (increment_hi16) {
-      offset_high++;
-      overflow_hi16 = (offset_high == -32768);
-    }
-    daui(scratch, src.rm(), static_cast<uint16_t>(offset_high));
-
-    if (overflow_hi16) {
-      dahi(scratch, 1);
-    }
-
-    if (two_accesses && !is_int16(static_cast<int32_t>(
-                            offset_low32 + second_access_add_to_offset))) {
-      // Avoid overflow in the 16-bit offset of the load/store instruction when
-      // adding 4.
-      daddiu(scratch, scratch, kDoubleSize);
-      offset_low32 -= kDoubleSize;
-    }
-
-    src.offset_ = offset_low32;
-  } else {
-    // Do not load the whole 32-bit 'offset' if it can be represented as
-    // a sum of three 16-bit signed offsets. This can save an instruction.
-    // To simplify matters, only do this for a symmetric range of offsets from
-    // about -96KB to about +96KB, allowing further addition of 4 when accessing
-    // 64-bit variables with two 32-bit accesses.
-    constexpr int32_t kMinOffsetForMediumAdjustment =
-        2 * kMinOffsetForSimpleAdjustment;
-    constexpr int32_t kMaxOffsetForMediumAdjustment =
-        3 * kMinOffsetForSimpleAdjustment;
-    if (0 <= src.offset() && src.offset() <= kMaxOffsetForMediumAdjustment) {
-      daddiu(scratch, src.rm(), kMinOffsetForMediumAdjustment / 2);
-      daddiu(scratch, scratch, kMinOffsetForMediumAdjustment / 2);
-      src.offset_ -= kMinOffsetForMediumAdjustment;
-    } else if (-kMaxOffsetForMediumAdjustment <= src.offset() &&
-               src.offset() < 0) {
-      daddiu(scratch, src.rm(), -kMinOffsetForMediumAdjustment / 2);
-      daddiu(scratch, scratch, -kMinOffsetForMediumAdjustment / 2);
-      src.offset_ += kMinOffsetForMediumAdjustment;
-    } else {
-      // Now that all shorter options have been exhausted, load the full 32-bit
-      // offset.
-      int32_t loaded_offset = RoundDown(src.offset(), kDoubleSize);
-      lui(scratch, (loaded_offset >> kLuiShift) & kImm16Mask);
-      ori(scratch, scratch, loaded_offset & kImm16Mask);  // Load 32-bit offset.
-      daddu(scratch, scratch, src.rm());
-      src.offset_ -= loaded_offset;
-    }
-  }
-  src.rm_ = scratch;
-
-  DCHECK(is_int16(src.offset()));
-  if (two_accesses) {
-    DCHECK(is_int16(
-        static_cast<int32_t>(src.offset() + second_access_add_to_offset)));
-  }
-  DCHECK(misalignment == (src.offset() & (kDoubleSize - 1)));
-}
-
-void Assembler::lb(Register rd, const MemOperand& rs) {
-  GenInstrImmediate(LB, rs.rm(), rd, rs.offset_);
-}
-
-
-void Assembler::lbu(Register rd, const MemOperand& rs) {
-  GenInstrImmediate(LBU, rs.rm(), rd, rs.offset_);
-}
-
-
-void Assembler::lh(Register rd, const MemOperand& rs) {
-  GenInstrImmediate(LH, rs.rm(), rd, rs.offset_);
-}
-
-
-void Assembler::lhu(Register rd, const MemOperand& rs) {
-  GenInstrImmediate(LHU, rs.rm(), rd, rs.offset_);
-}
-
-
-void Assembler::lw(Register rd, const MemOperand& rs) {
-  GenInstrImmediate(LW, rs.rm(), rd, rs.offset_);
-}
-
-
-void Assembler::lwu(Register rd, const MemOperand& rs) {
-  GenInstrImmediate(LWU, rs.rm(), rd, rs.offset_);
-}
-
-
-void Assembler::lwl(Register rd, const MemOperand& rs) {
-  DCHECK(is_int16(rs.offset_));
-  DCHECK_EQ(kArchVariant, kMips64r2);
-  GenInstrImmediate(LWL, rs.rm(), rd, rs.offset_);
-}
-
-
-void Assembler::lwr(Register rd, const MemOperand& rs) {
-  DCHECK(is_int16(rs.offset_));
-  DCHECK_EQ(kArchVariant, kMips64r2);
-  GenInstrImmediate(LWR, rs.rm(), rd, rs.offset_);
-}
-
-
-void Assembler::sb(Register rd, const MemOperand& rs) {
-  GenInstrImmediate(SB, rs.rm(), rd, rs.offset_);
-}
-
-
-void Assembler::sh(Register rd, const MemOperand& rs) {
-  GenInstrImmediate(SH, rs.rm(), rd, rs.offset_);
-}
-
-
-void Assembler::sw(Register rd, const MemOperand& rs) {
-  GenInstrImmediate(SW, rs.rm(), rd, rs.offset_);
-}
-
-
-void Assembler::swl(Register rd, const MemOperand& rs) {
-  DCHECK(is_int16(rs.offset_));
-  DCHECK_EQ(kArchVariant, kMips64r2);
-  GenInstrImmediate(SWL, rs.rm(), rd, rs.offset_);
-}
-
-
-void Assembler::swr(Register rd, const MemOperand& rs) {
-  DCHECK(is_int16(rs.offset_));
-  DCHECK_EQ(kArchVariant, kMips64r2);
-  GenInstrImmediate(SWR, rs.rm(), rd, rs.offset_);
-}
-
-void Assembler::ll(Register rd, const MemOperand& rs) {
-  if (kArchVariant == kMips64r6) {
-    DCHECK(is_int9(rs.offset_));
-    GenInstrImmediate(SPECIAL3, rs.rm(), rd, rs.offset_, 0, LL_R6);
-  } else {
-    DCHECK_EQ(kArchVariant, kMips64r2);
-    DCHECK(is_int16(rs.offset_));
-    GenInstrImmediate(LL, rs.rm(), rd, rs.offset_);
-  }
-}
-
-void Assembler::lld(Register rd, const MemOperand& rs) {
-  if (kArchVariant == kMips64r6) {
-    DCHECK(is_int9(rs.offset_));
-    GenInstrImmediate(SPECIAL3, rs.rm(), rd, rs.offset_, 0, LLD_R6);
-  } else {
-    DCHECK_EQ(kArchVariant, kMips64r2);
-    DCHECK(is_int16(rs.offset_));
-    GenInstrImmediate(LLD, rs.rm(), rd, rs.offset_);
-  }
-}
-
-void Assembler::sc(Register rd, const MemOperand& rs) {
-  if (kArchVariant == kMips64r6) {
-    DCHECK(is_int9(rs.offset_));
-    GenInstrImmediate(SPECIAL3, rs.rm(), rd, rs.offset_, 0, SC_R6);
-  } else {
-    DCHECK_EQ(kArchVariant, kMips64r2);
-    GenInstrImmediate(SC, rs.rm(), rd, rs.offset_);
-  }
-}
-
-void Assembler::scd(Register rd, const MemOperand& rs) {
-  if (kArchVariant == kMips64r6) {
-    DCHECK(is_int9(rs.offset_));
-    GenInstrImmediate(SPECIAL3, rs.rm(), rd, rs.offset_, 0, SCD_R6);
-  } else {
-    DCHECK_EQ(kArchVariant, kMips64r2);
-    GenInstrImmediate(SCD, rs.rm(), rd, rs.offset_);
-  }
-}
-
-void Assembler::lui(Register rd, int32_t j) {
-  DCHECK(is_uint16(j));
-  GenInstrImmediate(LUI, zero_reg, rd, j);
-}
-
-
-void Assembler::aui(Register rt, Register rs, int32_t j) {
-  // This instruction uses same opcode as 'lui'. The difference in encoding is
-  // 'lui' has zero reg. for rs field.
-  DCHECK(is_uint16(j));
-  GenInstrImmediate(LUI, rs, rt, j);
-}
-
-
-void Assembler::daui(Register rt, Register rs, int32_t j) {
-  DCHECK(is_uint16(j));
-  DCHECK(rs != zero_reg);
-  GenInstrImmediate(DAUI, rs, rt, j);
-}
-
-
-void Assembler::dahi(Register rs, int32_t j) {
-  DCHECK(is_uint16(j));
-  GenInstrImmediate(REGIMM, rs, DAHI, j);
-}
-
-
-void Assembler::dati(Register rs, int32_t j) {
-  DCHECK(is_uint16(j));
-  GenInstrImmediate(REGIMM, rs, DATI, j);
-}
-
-
-void Assembler::ldl(Register rd, const MemOperand& rs) {
-  DCHECK(is_int16(rs.offset_));
-  DCHECK_EQ(kArchVariant, kMips64r2);
-  GenInstrImmediate(LDL, rs.rm(), rd, rs.offset_);
-}
-
-
-void Assembler::ldr(Register rd, const MemOperand& rs) {
-  DCHECK(is_int16(rs.offset_));
-  DCHECK_EQ(kArchVariant, kMips64r2);
-  GenInstrImmediate(LDR, rs.rm(), rd, rs.offset_);
-}
-
-
-void Assembler::sdl(Register rd, const MemOperand& rs) {
-  DCHECK(is_int16(rs.offset_));
-  DCHECK_EQ(kArchVariant, kMips64r2);
-  GenInstrImmediate(SDL, rs.rm(), rd, rs.offset_);
-}
-
-
-void Assembler::sdr(Register rd, const MemOperand& rs) {
-  DCHECK(is_int16(rs.offset_));
-  DCHECK_EQ(kArchVariant, kMips64r2);
-  GenInstrImmediate(SDR, rs.rm(), rd, rs.offset_);
-}
-
-
-void Assembler::ld(Register rd, const MemOperand& rs) {
-  GenInstrImmediate(LD, rs.rm(), rd, rs.offset_);
-}
-
-
-void Assembler::sd(Register rd, const MemOperand& rs) {
-  GenInstrImmediate(SD, rs.rm(), rd, rs.offset_);
-}
-
-
-// ---------PC-Relative instructions-----------
-
-void Assembler::addiupc(Register rs, int32_t imm19) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(rs.is_valid() && is_int19(imm19));
-  uint32_t imm21 = ADDIUPC << kImm19Bits | (imm19 & kImm19Mask);
-  GenInstrImmediate(PCREL, rs, imm21);
-}
-
-
-void Assembler::lwpc(Register rs, int32_t offset19) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(rs.is_valid() && is_int19(offset19));
-  uint32_t imm21 = LWPC << kImm19Bits | (offset19 & kImm19Mask);
-  GenInstrImmediate(PCREL, rs, imm21);
-}
-
-
-void Assembler::lwupc(Register rs, int32_t offset19) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(rs.is_valid() && is_int19(offset19));
-  uint32_t imm21 = LWUPC << kImm19Bits | (offset19 & kImm19Mask);
-  GenInstrImmediate(PCREL, rs, imm21);
-}
-
-
-void Assembler::ldpc(Register rs, int32_t offset18) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(rs.is_valid() && is_int18(offset18));
-  uint32_t imm21 = LDPC << kImm18Bits | (offset18 & kImm18Mask);
-  GenInstrImmediate(PCREL, rs, imm21);
-}
-
-
-void Assembler::auipc(Register rs, int16_t imm16) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(rs.is_valid());
-  uint32_t imm21 = AUIPC << kImm16Bits | (imm16 & kImm16Mask);
-  GenInstrImmediate(PCREL, rs, imm21);
-}
-
-
-void Assembler::aluipc(Register rs, int16_t imm16) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(rs.is_valid());
-  uint32_t imm21 = ALUIPC << kImm16Bits | (imm16 & kImm16Mask);
-  GenInstrImmediate(PCREL, rs, imm21);
-}
-
-
-// -------------Misc-instructions--------------
-
-// Break / Trap instructions.
-void Assembler::break_(uint32_t code, bool break_as_stop) {
-  DCHECK_EQ(code & ~0xFFFFF, 0);
-  // We need to invalidate breaks that could be stops as well because the
-  // simulator expects a char pointer after the stop instruction.
-  // See constants-mips.h for explanation.
-  DCHECK((break_as_stop &&
-          code <= kMaxStopCode &&
-          code > kMaxWatchpointCode) ||
-         (!break_as_stop &&
-          (code > kMaxStopCode ||
-           code <= kMaxWatchpointCode)));
-  Instr break_instr = SPECIAL | BREAK | (code << 6);
-  emit(break_instr);
-}
-
-
-void Assembler::stop(const char* msg, uint32_t code) {
-  DCHECK_GT(code, kMaxWatchpointCode);
-  DCHECK_LE(code, kMaxStopCode);
-#if defined(V8_HOST_ARCH_MIPS) || defined(V8_HOST_ARCH_MIPS64)
-  break_(0x54321);
-#else  // V8_HOST_ARCH_MIPS
-  break_(code, true);
-#endif
-}
-
-
-void Assembler::tge(Register rs, Register rt, uint16_t code) {
-  DCHECK(is_uint10(code));
-  Instr instr = SPECIAL | TGE | rs.code() << kRsShift
-      | rt.code() << kRtShift | code << 6;
-  emit(instr);
-}
-
-
-void Assembler::tgeu(Register rs, Register rt, uint16_t code) {
-  DCHECK(is_uint10(code));
-  Instr instr = SPECIAL | TGEU | rs.code() << kRsShift
-      | rt.code() << kRtShift | code << 6;
-  emit(instr);
-}
-
-
-void Assembler::tlt(Register rs, Register rt, uint16_t code) {
-  DCHECK(is_uint10(code));
-  Instr instr =
-      SPECIAL | TLT | rs.code() << kRsShift | rt.code() << kRtShift | code << 6;
-  emit(instr);
-}
-
-
-void Assembler::tltu(Register rs, Register rt, uint16_t code) {
-  DCHECK(is_uint10(code));
-  Instr instr =
-      SPECIAL | TLTU | rs.code() << kRsShift
-      | rt.code() << kRtShift | code << 6;
-  emit(instr);
-}
-
-
-void Assembler::teq(Register rs, Register rt, uint16_t code) {
-  DCHECK(is_uint10(code));
-  Instr instr =
-      SPECIAL | TEQ | rs.code() << kRsShift | rt.code() << kRtShift | code << 6;
-  emit(instr);
-}
-
-
-void Assembler::tne(Register rs, Register rt, uint16_t code) {
-  DCHECK(is_uint10(code));
-  Instr instr =
-      SPECIAL | TNE | rs.code() << kRsShift | rt.code() << kRtShift | code << 6;
-  emit(instr);
-}
-
-void Assembler::sync() {
-  Instr sync_instr = SPECIAL | SYNC;
-  emit(sync_instr);
-}
-
-// Move from HI/LO register.
-
-void Assembler::mfhi(Register rd) {
-  GenInstrRegister(SPECIAL, zero_reg, zero_reg, rd, 0, MFHI);
-}
-
-
-void Assembler::mflo(Register rd) {
-  GenInstrRegister(SPECIAL, zero_reg, zero_reg, rd, 0, MFLO);
-}
-
-
-// Set on less than instructions.
-void Assembler::slt(Register rd, Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, SLT);
-}
-
-
-void Assembler::sltu(Register rd, Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, SLTU);
-}
-
-
-void Assembler::slti(Register rt, Register rs, int32_t j) {
-  GenInstrImmediate(SLTI, rs, rt, j);
-}
-
-
-void Assembler::sltiu(Register rt, Register rs, int32_t j) {
-  GenInstrImmediate(SLTIU, rs, rt, j);
-}
-
-
-// Conditional move.
-void Assembler::movz(Register rd, Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, MOVZ);
-}
-
-
-void Assembler::movn(Register rd, Register rs, Register rt) {
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, MOVN);
-}
-
-
-void Assembler::movt(Register rd, Register rs, uint16_t cc) {
-  Register rt = Register::from_code((cc & 0x0007) << 2 | 1);
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, MOVCI);
-}
-
-
-void Assembler::movf(Register rd, Register rs, uint16_t cc) {
-  Register rt = Register::from_code((cc & 0x0007) << 2 | 0);
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, MOVCI);
-}
-
-
-void Assembler::min_s(FPURegister fd, FPURegister fs, FPURegister ft) {
-  min(S, fd, fs, ft);
-}
-
-
-void Assembler::min_d(FPURegister fd, FPURegister fs, FPURegister ft) {
-  min(D, fd, fs, ft);
-}
-
-
-void Assembler::max_s(FPURegister fd, FPURegister fs, FPURegister ft) {
-  max(S, fd, fs, ft);
-}
-
-
-void Assembler::max_d(FPURegister fd, FPURegister fs, FPURegister ft) {
-  max(D, fd, fs, ft);
-}
-
-
-void Assembler::mina_s(FPURegister fd, FPURegister fs, FPURegister ft) {
-  mina(S, fd, fs, ft);
-}
-
-
-void Assembler::mina_d(FPURegister fd, FPURegister fs, FPURegister ft) {
-  mina(D, fd, fs, ft);
-}
-
-
-void Assembler::maxa_s(FPURegister fd, FPURegister fs, FPURegister ft) {
-  maxa(S, fd, fs, ft);
-}
-
-
-void Assembler::maxa_d(FPURegister fd, FPURegister fs, FPURegister ft) {
-  maxa(D, fd, fs, ft);
-}
-
-
-void Assembler::max(SecondaryField fmt, FPURegister fd, FPURegister fs,
-                    FPURegister ft) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK((fmt == D) || (fmt == S));
-  GenInstrRegister(COP1, fmt, ft, fs, fd, MAX);
-}
-
-
-void Assembler::min(SecondaryField fmt, FPURegister fd, FPURegister fs,
-                    FPURegister ft) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK((fmt == D) || (fmt == S));
-  GenInstrRegister(COP1, fmt, ft, fs, fd, MIN);
-}
-
-
-// GPR.
-void Assembler::seleqz(Register rd, Register rs, Register rt) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, SELEQZ_S);
-}
-
-
-// GPR.
-void Assembler::selnez(Register rd, Register rs, Register rt) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrRegister(SPECIAL, rs, rt, rd, 0, SELNEZ_S);
-}
-
-
-// Bit twiddling.
-void Assembler::clz(Register rd, Register rs) {
-  if (kArchVariant != kMips64r6) {
-    // clz instr requires same GPR number in 'rd' and 'rt' fields.
-    GenInstrRegister(SPECIAL2, rs, rd, rd, 0, CLZ);
-  } else {
-    GenInstrRegister(SPECIAL, rs, zero_reg, rd, 1, CLZ_R6);
-  }
-}
-
-
-void Assembler::dclz(Register rd, Register rs) {
-  if (kArchVariant != kMips64r6) {
-    // dclz instr requires same GPR number in 'rd' and 'rt' fields.
-    GenInstrRegister(SPECIAL2, rs, rd, rd, 0, DCLZ);
-  } else {
-    GenInstrRegister(SPECIAL, rs, zero_reg, rd, 1, DCLZ_R6);
-  }
-}
-
-
-void Assembler::ins_(Register rt, Register rs, uint16_t pos, uint16_t size) {
-  // Should be called via MacroAssembler::Ins.
-  // ins instr has 'rt' field as dest, and two uint5: msb, lsb.
-  DCHECK((kArchVariant == kMips64r2) || (kArchVariant == kMips64r6));
-  GenInstrRegister(SPECIAL3, rs, rt, pos + size - 1, pos, INS);
-}
-
-
-void Assembler::dins_(Register rt, Register rs, uint16_t pos, uint16_t size) {
-  // Should be called via MacroAssembler::Dins.
-  // dins instr has 'rt' field as dest, and two uint5: msb, lsb.
-  DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
-  GenInstrRegister(SPECIAL3, rs, rt, pos + size - 1, pos, DINS);
-}
-
-void Assembler::dinsm_(Register rt, Register rs, uint16_t pos, uint16_t size) {
-  // Should be called via MacroAssembler::Dins.
-  // dinsm instr has 'rt' field as dest, and two uint5: msbminus32, lsb.
-  DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
-  GenInstrRegister(SPECIAL3, rs, rt, pos + size - 1 - 32, pos, DINSM);
-}
-
-void Assembler::dinsu_(Register rt, Register rs, uint16_t pos, uint16_t size) {
-  // Should be called via MacroAssembler::Dins.
-  // dinsu instr has 'rt' field as dest, and two uint5: msbminus32, lsbminus32.
-  DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
-  GenInstrRegister(SPECIAL3, rs, rt, pos + size - 1 - 32, pos - 32, DINSU);
-}
-
-void Assembler::ext_(Register rt, Register rs, uint16_t pos, uint16_t size) {
-  // Should be called via MacroAssembler::Ext.
-  // ext instr has 'rt' field as dest, and two uint5: msbd, lsb.
-  DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
-  GenInstrRegister(SPECIAL3, rs, rt, size - 1, pos, EXT);
-}
-
-
-void Assembler::dext_(Register rt, Register rs, uint16_t pos, uint16_t size) {
-  // Should be called via MacroAssembler::Dext.
-  // dext instr has 'rt' field as dest, and two uint5: msbd, lsb.
-  DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
-  GenInstrRegister(SPECIAL3, rs, rt, size - 1, pos, DEXT);
-}
-
-void Assembler::dextm_(Register rt, Register rs, uint16_t pos, uint16_t size) {
-  // Should be called via MacroAssembler::Dextm.
-  // dextm instr has 'rt' field as dest, and two uint5: msbdminus32, lsb.
-  DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
-  GenInstrRegister(SPECIAL3, rs, rt, size - 1 - 32, pos, DEXTM);
-}
-
-void Assembler::dextu_(Register rt, Register rs, uint16_t pos, uint16_t size) {
-  // Should be called via MacroAssembler::Dextu.
-  // dextu instr has 'rt' field as dest, and two uint5: msbd, lsbminus32.
-  DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
-  GenInstrRegister(SPECIAL3, rs, rt, size - 1, pos - 32, DEXTU);
-}
-
-
-void Assembler::bitswap(Register rd, Register rt) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrRegister(SPECIAL3, zero_reg, rt, rd, 0, BSHFL);
-}
-
-
-void Assembler::dbitswap(Register rd, Register rt) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrRegister(SPECIAL3, zero_reg, rt, rd, 0, DBSHFL);
-}
-
-
-void Assembler::pref(int32_t hint, const MemOperand& rs) {
-  DCHECK(is_uint5(hint) && is_uint16(rs.offset_));
-  Instr instr = PREF | (rs.rm().code() << kRsShift) | (hint << kRtShift)
-      | (rs.offset_);
-  emit(instr);
-}
-
-
-void Assembler::align(Register rd, Register rs, Register rt, uint8_t bp) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(is_uint3(bp));
-  uint16_t sa = (ALIGN << kBp2Bits) | bp;
-  GenInstrRegister(SPECIAL3, rs, rt, rd, sa, BSHFL);
-}
-
-
-void Assembler::dalign(Register rd, Register rs, Register rt, uint8_t bp) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(is_uint3(bp));
-  uint16_t sa = (DALIGN << kBp3Bits) | bp;
-  GenInstrRegister(SPECIAL3, rs, rt, rd, sa, DBSHFL);
-}
-
-void Assembler::wsbh(Register rd, Register rt) {
-  DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
-  GenInstrRegister(SPECIAL3, zero_reg, rt, rd, WSBH, BSHFL);
-}
-
-void Assembler::dsbh(Register rd, Register rt) {
-  DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
-  GenInstrRegister(SPECIAL3, zero_reg, rt, rd, DSBH, DBSHFL);
-}
-
-void Assembler::dshd(Register rd, Register rt) {
-  DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
-  GenInstrRegister(SPECIAL3, zero_reg, rt, rd, DSHD, DBSHFL);
-}
-
-void Assembler::seh(Register rd, Register rt) {
-  DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
-  GenInstrRegister(SPECIAL3, zero_reg, rt, rd, SEH, BSHFL);
-}
-
-void Assembler::seb(Register rd, Register rt) {
-  DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
-  GenInstrRegister(SPECIAL3, zero_reg, rt, rd, SEB, BSHFL);
-}
-
-// --------Coprocessor-instructions----------------
-
-// Load, store, move.
-void Assembler::lwc1(FPURegister fd, const MemOperand& src) {
-  GenInstrImmediate(LWC1, src.rm(), fd, src.offset_);
-}
-
-
-void Assembler::ldc1(FPURegister fd, const MemOperand& src) {
-  GenInstrImmediate(LDC1, src.rm(), fd, src.offset_);
-}
-
-void Assembler::swc1(FPURegister fs, const MemOperand& src) {
-  GenInstrImmediate(SWC1, src.rm(), fs, src.offset_);
-}
-
-void Assembler::sdc1(FPURegister fs, const MemOperand& src) {
-  GenInstrImmediate(SDC1, src.rm(), fs, src.offset_);
-}
-
-
-void Assembler::mtc1(Register rt, FPURegister fs) {
-  GenInstrRegister(COP1, MTC1, rt, fs, f0);
-}
-
-
-void Assembler::mthc1(Register rt, FPURegister fs) {
-  GenInstrRegister(COP1, MTHC1, rt, fs, f0);
-}
-
-
-void Assembler::dmtc1(Register rt, FPURegister fs) {
-  GenInstrRegister(COP1, DMTC1, rt, fs, f0);
-}
-
-
-void Assembler::mfc1(Register rt, FPURegister fs) {
-  GenInstrRegister(COP1, MFC1, rt, fs, f0);
-}
-
-
-void Assembler::mfhc1(Register rt, FPURegister fs) {
-  GenInstrRegister(COP1, MFHC1, rt, fs, f0);
-}
-
-
-void Assembler::dmfc1(Register rt, FPURegister fs) {
-  GenInstrRegister(COP1, DMFC1, rt, fs, f0);
-}
-
-
-void Assembler::ctc1(Register rt, FPUControlRegister fs) {
-  GenInstrRegister(COP1, CTC1, rt, fs);
-}
-
-
-void Assembler::cfc1(Register rt, FPUControlRegister fs) {
-  GenInstrRegister(COP1, CFC1, rt, fs);
-}
-
-
-void Assembler::DoubleAsTwoUInt32(double d, uint32_t* lo, uint32_t* hi) {
-  uint64_t i;
-  memcpy(&i, &d, 8);
-
-  *lo = i & 0xFFFFFFFF;
-  *hi = i >> 32;
-}
-
-
-void Assembler::sel(SecondaryField fmt, FPURegister fd, FPURegister fs,
-                    FPURegister ft) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK((fmt == D) || (fmt == S));
-
-  GenInstrRegister(COP1, fmt, ft, fs, fd, SEL);
-}
-
-
-void Assembler::sel_s(FPURegister fd, FPURegister fs, FPURegister ft) {
-  sel(S, fd, fs, ft);
-}
-
-
-void Assembler::sel_d(FPURegister fd, FPURegister fs, FPURegister ft) {
-  sel(D, fd, fs, ft);
-}
-
-
-// FPR.
-void Assembler::seleqz(SecondaryField fmt, FPURegister fd, FPURegister fs,
-                       FPURegister ft) {
-  DCHECK((fmt == D) || (fmt == S));
-  GenInstrRegister(COP1, fmt, ft, fs, fd, SELEQZ_C);
-}
-
-
-void Assembler::seleqz_d(FPURegister fd, FPURegister fs, FPURegister ft) {
-  seleqz(D, fd, fs, ft);
-}
-
-
-void Assembler::seleqz_s(FPURegister fd, FPURegister fs, FPURegister ft) {
-  seleqz(S, fd, fs, ft);
-}
-
-
-void Assembler::selnez_d(FPURegister fd, FPURegister fs, FPURegister ft) {
-  selnez(D, fd, fs, ft);
-}
-
-
-void Assembler::selnez_s(FPURegister fd, FPURegister fs, FPURegister ft) {
-  selnez(S, fd, fs, ft);
-}
-
-
-void Assembler::movz_s(FPURegister fd, FPURegister fs, Register rt) {
-  DCHECK_EQ(kArchVariant, kMips64r2);
-  GenInstrRegister(COP1, S, rt, fs, fd, MOVZ_C);
-}
-
-
-void Assembler::movz_d(FPURegister fd, FPURegister fs, Register rt) {
-  DCHECK_EQ(kArchVariant, kMips64r2);
-  GenInstrRegister(COP1, D, rt, fs, fd, MOVZ_C);
-}
-
-
-void Assembler::movt_s(FPURegister fd, FPURegister fs, uint16_t cc) {
-  DCHECK_EQ(kArchVariant, kMips64r2);
-  FPURegister ft = FPURegister::from_code((cc & 0x0007) << 2 | 1);
-  GenInstrRegister(COP1, S, ft, fs, fd, MOVF);
-}
-
-
-void Assembler::movt_d(FPURegister fd, FPURegister fs, uint16_t cc) {
-  DCHECK_EQ(kArchVariant, kMips64r2);
-  FPURegister ft = FPURegister::from_code((cc & 0x0007) << 2 | 1);
-  GenInstrRegister(COP1, D, ft, fs, fd, MOVF);
-}
-
-
-void Assembler::movf_s(FPURegister fd, FPURegister fs, uint16_t cc) {
-  DCHECK_EQ(kArchVariant, kMips64r2);
-  FPURegister ft = FPURegister::from_code((cc & 0x0007) << 2 | 0);
-  GenInstrRegister(COP1, S, ft, fs, fd, MOVF);
-}
-
-
-void Assembler::movf_d(FPURegister fd, FPURegister fs, uint16_t cc) {
-  DCHECK_EQ(kArchVariant, kMips64r2);
-  FPURegister ft = FPURegister::from_code((cc & 0x0007) << 2 | 0);
-  GenInstrRegister(COP1, D, ft, fs, fd, MOVF);
-}
-
-
-void Assembler::movn_s(FPURegister fd, FPURegister fs, Register rt) {
-  DCHECK_EQ(kArchVariant, kMips64r2);
-  GenInstrRegister(COP1, S, rt, fs, fd, MOVN_C);
-}
-
-
-void Assembler::movn_d(FPURegister fd, FPURegister fs, Register rt) {
-  DCHECK_EQ(kArchVariant, kMips64r2);
-  GenInstrRegister(COP1, D, rt, fs, fd, MOVN_C);
-}
-
-
-// FPR.
-void Assembler::selnez(SecondaryField fmt, FPURegister fd, FPURegister fs,
-                       FPURegister ft) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK((fmt == D) || (fmt == S));
-  GenInstrRegister(COP1, fmt, ft, fs, fd, SELNEZ_C);
-}
-
-
-// Arithmetic.
-
-void Assembler::add_s(FPURegister fd, FPURegister fs, FPURegister ft) {
-  GenInstrRegister(COP1, S, ft, fs, fd, ADD_D);
-}
-
-
-void Assembler::add_d(FPURegister fd, FPURegister fs, FPURegister ft) {
-  GenInstrRegister(COP1, D, ft, fs, fd, ADD_D);
-}
-
-
-void Assembler::sub_s(FPURegister fd, FPURegister fs, FPURegister ft) {
-  GenInstrRegister(COP1, S, ft, fs, fd, SUB_D);
-}
-
-
-void Assembler::sub_d(FPURegister fd, FPURegister fs, FPURegister ft) {
-  GenInstrRegister(COP1, D, ft, fs, fd, SUB_D);
-}
-
-
-void Assembler::mul_s(FPURegister fd, FPURegister fs, FPURegister ft) {
-  GenInstrRegister(COP1, S, ft, fs, fd, MUL_D);
-}
-
-
-void Assembler::mul_d(FPURegister fd, FPURegister fs, FPURegister ft) {
-  GenInstrRegister(COP1, D, ft, fs, fd, MUL_D);
-}
-
-void Assembler::madd_s(FPURegister fd, FPURegister fr, FPURegister fs,
-                       FPURegister ft) {
-  // On Loongson 3A (MIPS64R2), MADD.S instruction is actually fused MADD.S and
-  // this causes failure in some of the tests. Since this optimization is rarely
-  // used, and not used at all on MIPS64R6, this isntruction is removed.
-  UNREACHABLE();
-}
-
-void Assembler::madd_d(FPURegister fd, FPURegister fr, FPURegister fs,
-    FPURegister ft) {
-  // On Loongson 3A (MIPS64R2), MADD.D instruction is actually fused MADD.D and
-  // this causes failure in some of the tests. Since this optimization is rarely
-  // used, and not used at all on MIPS64R6, this isntruction is removed.
-  UNREACHABLE();
-}
-
-void Assembler::msub_s(FPURegister fd, FPURegister fr, FPURegister fs,
-                       FPURegister ft) {
-  // See explanation for instruction madd_s.
-  UNREACHABLE();
-}
-
-void Assembler::msub_d(FPURegister fd, FPURegister fr, FPURegister fs,
-                       FPURegister ft) {
-  // See explanation for instruction madd_d.
-  UNREACHABLE();
-}
-
-void Assembler::maddf_s(FPURegister fd, FPURegister fs, FPURegister ft) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrRegister(COP1, S, ft, fs, fd, MADDF_S);
-}
-
-void Assembler::maddf_d(FPURegister fd, FPURegister fs, FPURegister ft) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrRegister(COP1, D, ft, fs, fd, MADDF_D);
-}
-
-void Assembler::msubf_s(FPURegister fd, FPURegister fs, FPURegister ft) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrRegister(COP1, S, ft, fs, fd, MSUBF_S);
-}
-
-void Assembler::msubf_d(FPURegister fd, FPURegister fs, FPURegister ft) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrRegister(COP1, D, ft, fs, fd, MSUBF_D);
-}
-
-void Assembler::div_s(FPURegister fd, FPURegister fs, FPURegister ft) {
-  GenInstrRegister(COP1, S, ft, fs, fd, DIV_D);
-}
-
-
-void Assembler::div_d(FPURegister fd, FPURegister fs, FPURegister ft) {
-  GenInstrRegister(COP1, D, ft, fs, fd, DIV_D);
-}
-
-
-void Assembler::abs_s(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, S, f0, fs, fd, ABS_D);
-}
-
-
-void Assembler::abs_d(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, D, f0, fs, fd, ABS_D);
-}
-
-
-void Assembler::mov_d(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, D, f0, fs, fd, MOV_D);
-}
-
-
-void Assembler::mov_s(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, S, f0, fs, fd, MOV_S);
-}
-
-
-void Assembler::neg_s(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, S, f0, fs, fd, NEG_D);
-}
-
-
-void Assembler::neg_d(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, D, f0, fs, fd, NEG_D);
-}
-
-
-void Assembler::sqrt_s(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, S, f0, fs, fd, SQRT_D);
-}
-
-
-void Assembler::sqrt_d(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, D, f0, fs, fd, SQRT_D);
-}
-
-
-void Assembler::rsqrt_s(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, S, f0, fs, fd, RSQRT_S);
-}
-
-
-void Assembler::rsqrt_d(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, D, f0, fs, fd, RSQRT_D);
-}
-
-
-void Assembler::recip_d(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, D, f0, fs, fd, RECIP_D);
-}
-
-
-void Assembler::recip_s(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, S, f0, fs, fd, RECIP_S);
-}
-
-
-// Conversions.
-void Assembler::cvt_w_s(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, S, f0, fs, fd, CVT_W_S);
-}
-
-
-void Assembler::cvt_w_d(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, D, f0, fs, fd, CVT_W_D);
-}
-
-
-void Assembler::trunc_w_s(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, S, f0, fs, fd, TRUNC_W_S);
-}
-
-
-void Assembler::trunc_w_d(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, D, f0, fs, fd, TRUNC_W_D);
-}
-
-
-void Assembler::round_w_s(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, S, f0, fs, fd, ROUND_W_S);
-}
-
-
-void Assembler::round_w_d(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, D, f0, fs, fd, ROUND_W_D);
-}
-
-
-void Assembler::floor_w_s(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, S, f0, fs, fd, FLOOR_W_S);
-}
-
-
-void Assembler::floor_w_d(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, D, f0, fs, fd, FLOOR_W_D);
-}
-
-
-void Assembler::ceil_w_s(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, S, f0, fs, fd, CEIL_W_S);
-}
-
-
-void Assembler::ceil_w_d(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, D, f0, fs, fd, CEIL_W_D);
-}
-
-
-void Assembler::rint_s(FPURegister fd, FPURegister fs) { rint(S, fd, fs); }
-
-
-void Assembler::rint_d(FPURegister fd, FPURegister fs) { rint(D, fd, fs); }
-
-
-void Assembler::rint(SecondaryField fmt, FPURegister fd, FPURegister fs) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrRegister(COP1, fmt, f0, fs, fd, RINT);
-}
-
-
-void Assembler::cvt_l_s(FPURegister fd, FPURegister fs) {
-  DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
-  GenInstrRegister(COP1, S, f0, fs, fd, CVT_L_S);
-}
-
-
-void Assembler::cvt_l_d(FPURegister fd, FPURegister fs) {
-  DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
-  GenInstrRegister(COP1, D, f0, fs, fd, CVT_L_D);
-}
-
-
-void Assembler::trunc_l_s(FPURegister fd, FPURegister fs) {
-  DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
-  GenInstrRegister(COP1, S, f0, fs, fd, TRUNC_L_S);
-}
-
-
-void Assembler::trunc_l_d(FPURegister fd, FPURegister fs) {
-  DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
-  GenInstrRegister(COP1, D, f0, fs, fd, TRUNC_L_D);
-}
-
-
-void Assembler::round_l_s(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, S, f0, fs, fd, ROUND_L_S);
-}
-
-
-void Assembler::round_l_d(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, D, f0, fs, fd, ROUND_L_D);
-}
-
-
-void Assembler::floor_l_s(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, S, f0, fs, fd, FLOOR_L_S);
-}
-
-
-void Assembler::floor_l_d(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, D, f0, fs, fd, FLOOR_L_D);
-}
-
-
-void Assembler::ceil_l_s(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, S, f0, fs, fd, CEIL_L_S);
-}
-
-
-void Assembler::ceil_l_d(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, D, f0, fs, fd, CEIL_L_D);
-}
-
-
-void Assembler::class_s(FPURegister fd, FPURegister fs) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrRegister(COP1, S, f0, fs, fd, CLASS_S);
-}
-
-
-void Assembler::class_d(FPURegister fd, FPURegister fs) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  GenInstrRegister(COP1, D, f0, fs, fd, CLASS_D);
-}
-
-
-void Assembler::mina(SecondaryField fmt, FPURegister fd, FPURegister fs,
-                     FPURegister ft) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK((fmt == D) || (fmt == S));
-  GenInstrRegister(COP1, fmt, ft, fs, fd, MINA);
-}
-
-
-void Assembler::maxa(SecondaryField fmt, FPURegister fd, FPURegister fs,
-                     FPURegister ft) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK((fmt == D) || (fmt == S));
-  GenInstrRegister(COP1, fmt, ft, fs, fd, MAXA);
-}
-
-
-void Assembler::cvt_s_w(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, W, f0, fs, fd, CVT_S_W);
-}
-
-
-void Assembler::cvt_s_l(FPURegister fd, FPURegister fs) {
-  DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
-  GenInstrRegister(COP1, L, f0, fs, fd, CVT_S_L);
-}
-
-
-void Assembler::cvt_s_d(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, D, f0, fs, fd, CVT_S_D);
-}
-
-
-void Assembler::cvt_d_w(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, W, f0, fs, fd, CVT_D_W);
-}
-
-
-void Assembler::cvt_d_l(FPURegister fd, FPURegister fs) {
-  DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
-  GenInstrRegister(COP1, L, f0, fs, fd, CVT_D_L);
-}
-
-
-void Assembler::cvt_d_s(FPURegister fd, FPURegister fs) {
-  GenInstrRegister(COP1, S, f0, fs, fd, CVT_D_S);
-}
-
-
-// Conditions for >= MIPSr6.
-void Assembler::cmp(FPUCondition cond, SecondaryField fmt,
-    FPURegister fd, FPURegister fs, FPURegister ft) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK_EQ(fmt & ~(31 << kRsShift), 0);
-  Instr instr = COP1 | fmt | ft.code() << kFtShift |
-      fs.code() << kFsShift | fd.code() << kFdShift | (0 << 5) | cond;
-  emit(instr);
-}
-
-
-void Assembler::cmp_s(FPUCondition cond, FPURegister fd, FPURegister fs,
-                      FPURegister ft) {
-  cmp(cond, W, fd, fs, ft);
-}
-
-void Assembler::cmp_d(FPUCondition cond, FPURegister fd, FPURegister fs,
-                      FPURegister ft) {
-  cmp(cond, L, fd, fs, ft);
-}
-
-
-void Assembler::bc1eqz(int16_t offset, FPURegister ft) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  Instr instr = COP1 | BC1EQZ | ft.code() << kFtShift | (offset & kImm16Mask);
-  emit(instr);
-}
-
-
-void Assembler::bc1nez(int16_t offset, FPURegister ft) {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  Instr instr = COP1 | BC1NEZ | ft.code() << kFtShift | (offset & kImm16Mask);
-  emit(instr);
-}
-
-
-// Conditions for < MIPSr6.
-void Assembler::c(FPUCondition cond, SecondaryField fmt,
-    FPURegister fs, FPURegister ft, uint16_t cc) {
-  DCHECK_NE(kArchVariant, kMips64r6);
-  DCHECK(is_uint3(cc));
-  DCHECK(fmt == S || fmt == D);
-  DCHECK_EQ(fmt & ~(31 << kRsShift), 0);
-  Instr instr = COP1 | fmt | ft.code() << kFtShift | fs.code() << kFsShift
-      | cc << 8 | 3 << 4 | cond;
-  emit(instr);
-}
-
-
-void Assembler::c_s(FPUCondition cond, FPURegister fs, FPURegister ft,
-                    uint16_t cc) {
-  c(cond, S, fs, ft, cc);
-}
-
-
-void Assembler::c_d(FPUCondition cond, FPURegister fs, FPURegister ft,
-                    uint16_t cc) {
-  c(cond, D, fs, ft, cc);
-}
-
-
-void Assembler::fcmp(FPURegister src1, const double src2,
-      FPUCondition cond) {
-  DCHECK_EQ(src2, 0.0);
-  mtc1(zero_reg, f14);
-  cvt_d_w(f14, f14);
-  c(cond, D, src1, f14, 0);
-}
-
-
-void Assembler::bc1f(int16_t offset, uint16_t cc) {
-  DCHECK(is_uint3(cc));
-  Instr instr = COP1 | BC1 | cc << 18 | 0 << 16 | (offset & kImm16Mask);
-  emit(instr);
-}
-
-
-void Assembler::bc1t(int16_t offset, uint16_t cc) {
-  DCHECK(is_uint3(cc));
-  Instr instr = COP1 | BC1 | cc << 18 | 1 << 16 | (offset & kImm16Mask);
-  emit(instr);
-}
-
-// ---------- MSA instructions ------------
-#define MSA_BRANCH_LIST(V) \
-  V(bz_v, BZ_V)            \
-  V(bz_b, BZ_B)            \
-  V(bz_h, BZ_H)            \
-  V(bz_w, BZ_W)            \
-  V(bz_d, BZ_D)            \
-  V(bnz_v, BNZ_V)          \
-  V(bnz_b, BNZ_B)          \
-  V(bnz_h, BNZ_H)          \
-  V(bnz_w, BNZ_W)          \
-  V(bnz_d, BNZ_D)
-
-#define MSA_BRANCH(name, opcode)                         \
-  void Assembler::name(MSARegister wt, int16_t offset) { \
-    GenInstrMsaBranch(opcode, wt, offset);               \
-  }
-
-MSA_BRANCH_LIST(MSA_BRANCH)
-#undef MSA_BRANCH
-#undef MSA_BRANCH_LIST
-
-#define MSA_LD_ST_LIST(V) \
-  V(ld_b, LD_B)           \
-  V(ld_h, LD_H)           \
-  V(ld_w, LD_W)           \
-  V(ld_d, LD_D)           \
-  V(st_b, ST_B)           \
-  V(st_h, ST_H)           \
-  V(st_w, ST_W)           \
-  V(st_d, ST_D)
-
-#define MSA_LD_ST(name, opcode)                                  \
-  void Assembler::name(MSARegister wd, const MemOperand& rs) {   \
-    MemOperand source = rs;                                      \
-    AdjustBaseAndOffset(source);                                 \
-    if (is_int10(source.offset())) {                             \
-      GenInstrMsaMI10(opcode, source.offset(), source.rm(), wd); \
-    } else {                                                     \
-      UseScratchRegisterScope temps(this);                       \
-      Register scratch = temps.Acquire();                        \
-      DCHECK(rs.rm() != scratch);                                \
-      daddiu(scratch, source.rm(), source.offset());             \
-      GenInstrMsaMI10(opcode, 0, scratch, wd);                   \
-    }                                                            \
-  }
-
-MSA_LD_ST_LIST(MSA_LD_ST)
-#undef MSA_LD_ST
-#undef MSA_BRANCH_LIST
-
-#define MSA_I10_LIST(V) \
-  V(ldi_b, I5_DF_b)     \
-  V(ldi_h, I5_DF_h)     \
-  V(ldi_w, I5_DF_w)     \
-  V(ldi_d, I5_DF_d)
-
-#define MSA_I10(name, format)                           \
-  void Assembler::name(MSARegister wd, int32_t imm10) { \
-    GenInstrMsaI10(LDI, format, imm10, wd);             \
-  }
-MSA_I10_LIST(MSA_I10)
-#undef MSA_I10
-#undef MSA_I10_LIST
-
-#define MSA_I5_LIST(V) \
-  V(addvi, ADDVI)      \
-  V(subvi, SUBVI)      \
-  V(maxi_s, MAXI_S)    \
-  V(maxi_u, MAXI_U)    \
-  V(mini_s, MINI_S)    \
-  V(mini_u, MINI_U)    \
-  V(ceqi, CEQI)        \
-  V(clti_s, CLTI_S)    \
-  V(clti_u, CLTI_U)    \
-  V(clei_s, CLEI_S)    \
-  V(clei_u, CLEI_U)
-
-#define MSA_I5_FORMAT(name, opcode, format)                       \
-  void Assembler::name##_##format(MSARegister wd, MSARegister ws, \
-                                  uint32_t imm5) {                \
-    GenInstrMsaI5(opcode, I5_DF_##format, imm5, ws, wd);          \
-  }
-
-#define MSA_I5(name, opcode)     \
-  MSA_I5_FORMAT(name, opcode, b) \
-  MSA_I5_FORMAT(name, opcode, h) \
-  MSA_I5_FORMAT(name, opcode, w) \
-  MSA_I5_FORMAT(name, opcode, d)
-
-MSA_I5_LIST(MSA_I5)
-#undef MSA_I5
-#undef MSA_I5_FORMAT
-#undef MSA_I5_LIST
-
-#define MSA_I8_LIST(V) \
-  V(andi_b, ANDI_B)    \
-  V(ori_b, ORI_B)      \
-  V(nori_b, NORI_B)    \
-  V(xori_b, XORI_B)    \
-  V(bmnzi_b, BMNZI_B)  \
-  V(bmzi_b, BMZI_B)    \
-  V(bseli_b, BSELI_B)  \
-  V(shf_b, SHF_B)      \
-  V(shf_h, SHF_H)      \
-  V(shf_w, SHF_W)
-
-#define MSA_I8(name, opcode)                                            \
-  void Assembler::name(MSARegister wd, MSARegister ws, uint32_t imm8) { \
-    GenInstrMsaI8(opcode, imm8, ws, wd);                                \
-  }
-
-MSA_I8_LIST(MSA_I8)
-#undef MSA_I8
-#undef MSA_I8_LIST
-
-#define MSA_VEC_LIST(V) \
-  V(and_v, AND_V)       \
-  V(or_v, OR_V)         \
-  V(nor_v, NOR_V)       \
-  V(xor_v, XOR_V)       \
-  V(bmnz_v, BMNZ_V)     \
-  V(bmz_v, BMZ_V)       \
-  V(bsel_v, BSEL_V)
-
-#define MSA_VEC(name, opcode)                                            \
-  void Assembler::name(MSARegister wd, MSARegister ws, MSARegister wt) { \
-    GenInstrMsaVec(opcode, wt, ws, wd);                                  \
-  }
-
-MSA_VEC_LIST(MSA_VEC)
-#undef MSA_VEC
-#undef MSA_VEC_LIST
-
-#define MSA_2R_LIST(V) \
-  V(pcnt, PCNT)        \
-  V(nloc, NLOC)        \
-  V(nlzc, NLZC)
-
-#define MSA_2R_FORMAT(name, opcode, format)                         \
-  void Assembler::name##_##format(MSARegister wd, MSARegister ws) { \
-    GenInstrMsa2R(opcode, MSA_2R_DF_##format, ws, wd);              \
-  }
-
-#define MSA_2R(name, opcode)     \
-  MSA_2R_FORMAT(name, opcode, b) \
-  MSA_2R_FORMAT(name, opcode, h) \
-  MSA_2R_FORMAT(name, opcode, w) \
-  MSA_2R_FORMAT(name, opcode, d)
-
-MSA_2R_LIST(MSA_2R)
-#undef MSA_2R
-#undef MSA_2R_FORMAT
-#undef MSA_2R_LIST
-
-#define MSA_FILL(format)                                              \
-  void Assembler::fill_##format(MSARegister wd, Register rs) {        \
-    DCHECK((kArchVariant == kMips64r6) && IsEnabled(MIPS_SIMD));      \
-    DCHECK(rs.is_valid() && wd.is_valid());                           \
-    Instr instr = MSA | MSA_2R_FORMAT | FILL | MSA_2R_DF_##format |   \
-                  (rs.code() << kWsShift) | (wd.code() << kWdShift) | \
-                  MSA_VEC_2R_2RF_MINOR;                               \
-    emit(instr);                                                      \
-  }
-
-MSA_FILL(b)
-MSA_FILL(h)
-MSA_FILL(w)
-MSA_FILL(d)
-#undef MSA_FILL
-
-#define MSA_2RF_LIST(V) \
-  V(fclass, FCLASS)     \
-  V(ftrunc_s, FTRUNC_S) \
-  V(ftrunc_u, FTRUNC_U) \
-  V(fsqrt, FSQRT)       \
-  V(frsqrt, FRSQRT)     \
-  V(frcp, FRCP)         \
-  V(frint, FRINT)       \
-  V(flog2, FLOG2)       \
-  V(fexupl, FEXUPL)     \
-  V(fexupr, FEXUPR)     \
-  V(ffql, FFQL)         \
-  V(ffqr, FFQR)         \
-  V(ftint_s, FTINT_S)   \
-  V(ftint_u, FTINT_U)   \
-  V(ffint_s, FFINT_S)   \
-  V(ffint_u, FFINT_U)
-
-#define MSA_2RF_FORMAT(name, opcode, format)                        \
-  void Assembler::name##_##format(MSARegister wd, MSARegister ws) { \
-    GenInstrMsa2RF(opcode, MSA_2RF_DF_##format, ws, wd);            \
-  }
-
-#define MSA_2RF(name, opcode)     \
-  MSA_2RF_FORMAT(name, opcode, w) \
-  MSA_2RF_FORMAT(name, opcode, d)
-
-MSA_2RF_LIST(MSA_2RF)
-#undef MSA_2RF
-#undef MSA_2RF_FORMAT
-#undef MSA_2RF_LIST
-
-#define MSA_3R_LIST(V)  \
-  V(sll, SLL_MSA)       \
-  V(sra, SRA_MSA)       \
-  V(srl, SRL_MSA)       \
-  V(bclr, BCLR)         \
-  V(bset, BSET)         \
-  V(bneg, BNEG)         \
-  V(binsl, BINSL)       \
-  V(binsr, BINSR)       \
-  V(addv, ADDV)         \
-  V(subv, SUBV)         \
-  V(max_s, MAX_S)       \
-  V(max_u, MAX_U)       \
-  V(min_s, MIN_S)       \
-  V(min_u, MIN_U)       \
-  V(max_a, MAX_A)       \
-  V(min_a, MIN_A)       \
-  V(ceq, CEQ)           \
-  V(clt_s, CLT_S)       \
-  V(clt_u, CLT_U)       \
-  V(cle_s, CLE_S)       \
-  V(cle_u, CLE_U)       \
-  V(add_a, ADD_A)       \
-  V(adds_a, ADDS_A)     \
-  V(adds_s, ADDS_S)     \
-  V(adds_u, ADDS_U)     \
-  V(ave_s, AVE_S)       \
-  V(ave_u, AVE_U)       \
-  V(aver_s, AVER_S)     \
-  V(aver_u, AVER_U)     \
-  V(subs_s, SUBS_S)     \
-  V(subs_u, SUBS_U)     \
-  V(subsus_u, SUBSUS_U) \
-  V(subsuu_s, SUBSUU_S) \
-  V(asub_s, ASUB_S)     \
-  V(asub_u, ASUB_U)     \
-  V(mulv, MULV)         \
-  V(maddv, MADDV)       \
-  V(msubv, MSUBV)       \
-  V(div_s, DIV_S_MSA)   \
-  V(div_u, DIV_U)       \
-  V(mod_s, MOD_S)       \
-  V(mod_u, MOD_U)       \
-  V(dotp_s, DOTP_S)     \
-  V(dotp_u, DOTP_U)     \
-  V(dpadd_s, DPADD_S)   \
-  V(dpadd_u, DPADD_U)   \
-  V(dpsub_s, DPSUB_S)   \
-  V(dpsub_u, DPSUB_U)   \
-  V(pckev, PCKEV)       \
-  V(pckod, PCKOD)       \
-  V(ilvl, ILVL)         \
-  V(ilvr, ILVR)         \
-  V(ilvev, ILVEV)       \
-  V(ilvod, ILVOD)       \
-  V(vshf, VSHF)         \
-  V(srar, SRAR)         \
-  V(srlr, SRLR)         \
-  V(hadd_s, HADD_S)     \
-  V(hadd_u, HADD_U)     \
-  V(hsub_s, HSUB_S)     \
-  V(hsub_u, HSUB_U)
-
-#define MSA_3R_FORMAT(name, opcode, format)                             \
-  void Assembler::name##_##format(MSARegister wd, MSARegister ws,       \
-                                  MSARegister wt) {                     \
-    GenInstrMsa3R<MSARegister>(opcode, MSA_3R_DF_##format, wt, ws, wd); \
-  }
-
-#define MSA_3R_FORMAT_SLD_SPLAT(name, opcode, format)                \
-  void Assembler::name##_##format(MSARegister wd, MSARegister ws,    \
-                                  Register rt) {                     \
-    GenInstrMsa3R<Register>(opcode, MSA_3R_DF_##format, rt, ws, wd); \
-  }
-
-#define MSA_3R(name, opcode)     \
-  MSA_3R_FORMAT(name, opcode, b) \
-  MSA_3R_FORMAT(name, opcode, h) \
-  MSA_3R_FORMAT(name, opcode, w) \
-  MSA_3R_FORMAT(name, opcode, d)
-
-#define MSA_3R_SLD_SPLAT(name, opcode)     \
-  MSA_3R_FORMAT_SLD_SPLAT(name, opcode, b) \
-  MSA_3R_FORMAT_SLD_SPLAT(name, opcode, h) \
-  MSA_3R_FORMAT_SLD_SPLAT(name, opcode, w) \
-  MSA_3R_FORMAT_SLD_SPLAT(name, opcode, d)
-
-MSA_3R_LIST(MSA_3R)
-MSA_3R_SLD_SPLAT(sld, SLD)
-MSA_3R_SLD_SPLAT(splat, SPLAT)
-
-#undef MSA_3R
-#undef MSA_3R_FORMAT
-#undef MSA_3R_FORMAT_SLD_SPLAT
-#undef MSA_3R_SLD_SPLAT
-#undef MSA_3R_LIST
-
-#define MSA_3RF_LIST1(V) \
-  V(fcaf, FCAF)          \
-  V(fcun, FCUN)          \
-  V(fceq, FCEQ)          \
-  V(fcueq, FCUEQ)        \
-  V(fclt, FCLT)          \
-  V(fcult, FCULT)        \
-  V(fcle, FCLE)          \
-  V(fcule, FCULE)        \
-  V(fsaf, FSAF)          \
-  V(fsun, FSUN)          \
-  V(fseq, FSEQ)          \
-  V(fsueq, FSUEQ)        \
-  V(fslt, FSLT)          \
-  V(fsult, FSULT)        \
-  V(fsle, FSLE)          \
-  V(fsule, FSULE)        \
-  V(fadd, FADD)          \
-  V(fsub, FSUB)          \
-  V(fmul, FMUL)          \
-  V(fdiv, FDIV)          \
-  V(fmadd, FMADD)        \
-  V(fmsub, FMSUB)        \
-  V(fexp2, FEXP2)        \
-  V(fmin, FMIN)          \
-  V(fmin_a, FMIN_A)      \
-  V(fmax, FMAX)          \
-  V(fmax_a, FMAX_A)      \
-  V(fcor, FCOR)          \
-  V(fcune, FCUNE)        \
-  V(fcne, FCNE)          \
-  V(fsor, FSOR)          \
-  V(fsune, FSUNE)        \
-  V(fsne, FSNE)
-
-#define MSA_3RF_LIST2(V) \
-  V(fexdo, FEXDO)        \
-  V(ftq, FTQ)            \
-  V(mul_q, MUL_Q)        \
-  V(madd_q, MADD_Q)      \
-  V(msub_q, MSUB_Q)      \
-  V(mulr_q, MULR_Q)      \
-  V(maddr_q, MADDR_Q)    \
-  V(msubr_q, MSUBR_Q)
-
-#define MSA_3RF_FORMAT(name, opcode, df, df_c)                \
-  void Assembler::name##_##df(MSARegister wd, MSARegister ws, \
-                              MSARegister wt) {               \
-    GenInstrMsa3RF(opcode, df_c, wt, ws, wd);                 \
-  }
-
-#define MSA_3RF_1(name, opcode)      \
-  MSA_3RF_FORMAT(name, opcode, w, 0) \
-  MSA_3RF_FORMAT(name, opcode, d, 1)
-
-#define MSA_3RF_2(name, opcode)      \
-  MSA_3RF_FORMAT(name, opcode, h, 0) \
-  MSA_3RF_FORMAT(name, opcode, w, 1)
-
-MSA_3RF_LIST1(MSA_3RF_1)
-MSA_3RF_LIST2(MSA_3RF_2)
-#undef MSA_3RF_1
-#undef MSA_3RF_2
-#undef MSA_3RF_FORMAT
-#undef MSA_3RF_LIST1
-#undef MSA_3RF_LIST2
-
-void Assembler::sldi_b(MSARegister wd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<MSARegister, MSARegister>(SLDI, ELM_DF_B, n, ws, wd);
-}
-
-void Assembler::sldi_h(MSARegister wd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<MSARegister, MSARegister>(SLDI, ELM_DF_H, n, ws, wd);
-}
-
-void Assembler::sldi_w(MSARegister wd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<MSARegister, MSARegister>(SLDI, ELM_DF_W, n, ws, wd);
-}
-
-void Assembler::sldi_d(MSARegister wd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<MSARegister, MSARegister>(SLDI, ELM_DF_D, n, ws, wd);
-}
-
-void Assembler::splati_b(MSARegister wd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<MSARegister, MSARegister>(SPLATI, ELM_DF_B, n, ws, wd);
-}
-
-void Assembler::splati_h(MSARegister wd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<MSARegister, MSARegister>(SPLATI, ELM_DF_H, n, ws, wd);
-}
-
-void Assembler::splati_w(MSARegister wd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<MSARegister, MSARegister>(SPLATI, ELM_DF_W, n, ws, wd);
-}
-
-void Assembler::splati_d(MSARegister wd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<MSARegister, MSARegister>(SPLATI, ELM_DF_D, n, ws, wd);
-}
-
-void Assembler::copy_s_b(Register rd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<Register, MSARegister>(COPY_S, ELM_DF_B, n, ws, rd);
-}
-
-void Assembler::copy_s_h(Register rd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<Register, MSARegister>(COPY_S, ELM_DF_H, n, ws, rd);
-}
-
-void Assembler::copy_s_w(Register rd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<Register, MSARegister>(COPY_S, ELM_DF_W, n, ws, rd);
-}
-
-void Assembler::copy_s_d(Register rd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<Register, MSARegister>(COPY_S, ELM_DF_D, n, ws, rd);
-}
-
-void Assembler::copy_u_b(Register rd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<Register, MSARegister>(COPY_U, ELM_DF_B, n, ws, rd);
-}
-
-void Assembler::copy_u_h(Register rd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<Register, MSARegister>(COPY_U, ELM_DF_H, n, ws, rd);
-}
-
-void Assembler::copy_u_w(Register rd, MSARegister ws, uint32_t n) {
-  GenInstrMsaElm<Register, MSARegister>(COPY_U, ELM_DF_W, n, ws, rd);
-}
-
-void Assembler::insert_b(MSARegister wd, uint32_t n, Register rs) {
-  GenInstrMsaElm<MSARegister, Register>(INSERT, ELM_DF_B, n, rs, wd);
-}
-
-void Assembler::insert_h(MSARegister wd, uint32_t n, Register rs) {
-  GenInstrMsaElm<MSARegister, Register>(INSERT, ELM_DF_H, n, rs, wd);
-}
-
-void Assembler::insert_w(MSARegister wd, uint32_t n, Register rs) {
-  GenInstrMsaElm<MSARegister, Register>(INSERT, ELM_DF_W, n, rs, wd);
-}
-
-void Assembler::insert_d(MSARegister wd, uint32_t n, Register rs) {
-  GenInstrMsaElm<MSARegister, Register>(INSERT, ELM_DF_D, n, rs, wd);
-}
-
-void Assembler::insve_b(MSARegister wd, uint32_t n, MSARegister ws) {
-  GenInstrMsaElm<MSARegister, MSARegister>(INSVE, ELM_DF_B, n, ws, wd);
-}
-
-void Assembler::insve_h(MSARegister wd, uint32_t n, MSARegister ws) {
-  GenInstrMsaElm<MSARegister, MSARegister>(INSVE, ELM_DF_H, n, ws, wd);
-}
-
-void Assembler::insve_w(MSARegister wd, uint32_t n, MSARegister ws) {
-  GenInstrMsaElm<MSARegister, MSARegister>(INSVE, ELM_DF_W, n, ws, wd);
-}
-
-void Assembler::insve_d(MSARegister wd, uint32_t n, MSARegister ws) {
-  GenInstrMsaElm<MSARegister, MSARegister>(INSVE, ELM_DF_D, n, ws, wd);
-}
-
-void Assembler::move_v(MSARegister wd, MSARegister ws) {
-  DCHECK((kArchVariant == kMips64r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(ws.is_valid() && wd.is_valid());
-  Instr instr = MSA | MOVE_V | (ws.code() << kWsShift) |
-                (wd.code() << kWdShift) | MSA_ELM_MINOR;
-  emit(instr);
-}
-
-void Assembler::ctcmsa(MSAControlRegister cd, Register rs) {
-  DCHECK((kArchVariant == kMips64r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(cd.is_valid() && rs.is_valid());
-  Instr instr = MSA | CTCMSA | (rs.code() << kWsShift) |
-                (cd.code() << kWdShift) | MSA_ELM_MINOR;
-  emit(instr);
-}
-
-void Assembler::cfcmsa(Register rd, MSAControlRegister cs) {
-  DCHECK((kArchVariant == kMips64r6) && IsEnabled(MIPS_SIMD));
-  DCHECK(rd.is_valid() && cs.is_valid());
-  Instr instr = MSA | CFCMSA | (cs.code() << kWsShift) |
-                (rd.code() << kWdShift) | MSA_ELM_MINOR;
-  emit(instr);
-}
-
-#define MSA_BIT_LIST(V) \
-  V(slli, SLLI)         \
-  V(srai, SRAI)         \
-  V(srli, SRLI)         \
-  V(bclri, BCLRI)       \
-  V(bseti, BSETI)       \
-  V(bnegi, BNEGI)       \
-  V(binsli, BINSLI)     \
-  V(binsri, BINSRI)     \
-  V(sat_s, SAT_S)       \
-  V(sat_u, SAT_U)       \
-  V(srari, SRARI)       \
-  V(srlri, SRLRI)
-
-#define MSA_BIT_FORMAT(name, opcode, format)                      \
-  void Assembler::name##_##format(MSARegister wd, MSARegister ws, \
-                                  uint32_t m) {                   \
-    GenInstrMsaBit(opcode, BIT_DF_##format, m, ws, wd);           \
-  }
-
-#define MSA_BIT(name, opcode)     \
-  MSA_BIT_FORMAT(name, opcode, b) \
-  MSA_BIT_FORMAT(name, opcode, h) \
-  MSA_BIT_FORMAT(name, opcode, w) \
-  MSA_BIT_FORMAT(name, opcode, d)
-
-MSA_BIT_LIST(MSA_BIT)
-#undef MSA_BIT
-#undef MSA_BIT_FORMAT
-#undef MSA_BIT_LIST
-
-int Assembler::RelocateInternalReference(RelocInfo::Mode rmode, byte* pc,
-                                         intptr_t pc_delta) {
-  if (RelocInfo::IsInternalReference(rmode)) {
-    int64_t* p = reinterpret_cast<int64_t*>(pc);
-    if (*p == kEndOfJumpChain) {
-      return 0;  // Number of instructions patched.
-    }
-    *p += pc_delta;
-    return 2;  // Number of instructions patched.
-  }
-  Instr instr = instr_at(pc);
-  DCHECK(RelocInfo::IsInternalReferenceEncoded(rmode));
-  if (IsLui(instr)) {
-    Instr instr_lui = instr_at(pc + 0 * Assembler::kInstrSize);
-    Instr instr_ori = instr_at(pc + 1 * Assembler::kInstrSize);
-    Instr instr_ori2 = instr_at(pc + 3 * Assembler::kInstrSize);
-    DCHECK(IsOri(instr_ori));
-    DCHECK(IsOri(instr_ori2));
-    // TODO(plind): symbolic names for the shifts.
-    int64_t imm = (instr_lui & static_cast<int64_t>(kImm16Mask)) << 48;
-    imm |= (instr_ori & static_cast<int64_t>(kImm16Mask)) << 32;
-    imm |= (instr_ori2 & static_cast<int64_t>(kImm16Mask)) << 16;
-    // Sign extend address.
-    imm >>= 16;
-
-    if (imm == kEndOfJumpChain) {
-      return 0;  // Number of instructions patched.
-    }
-    imm += pc_delta;
-    DCHECK_EQ(imm & 3, 0);
-
-    instr_lui &= ~kImm16Mask;
-    instr_ori &= ~kImm16Mask;
-    instr_ori2 &= ~kImm16Mask;
-
-    instr_at_put(pc + 0 * Assembler::kInstrSize,
-                 instr_lui | ((imm >> 32) & kImm16Mask));
-    instr_at_put(pc + 1 * Assembler::kInstrSize,
-                 instr_ori | (imm >> 16 & kImm16Mask));
-    instr_at_put(pc + 3 * Assembler::kInstrSize,
-                 instr_ori2 | (imm & kImm16Mask));
-    return 4;  // Number of instructions patched.
-  } else if (IsJ(instr) || IsJal(instr)) {
-    // Regular j/jal relocation.
-    uint32_t imm28 = (instr & static_cast<int32_t>(kImm26Mask)) << 2;
-    imm28 += pc_delta;
-    imm28 &= kImm28Mask;
-    instr &= ~kImm26Mask;
-    DCHECK_EQ(imm28 & 3, 0);
-    uint32_t imm26 = static_cast<uint32_t>(imm28 >> 2);
-    instr_at_put(pc, instr | (imm26 & kImm26Mask));
-    return 1;  // Number of instructions patched.
-  } else {
-    DCHECK(((instr & kJumpRawMask) == kJRawMark) ||
-           ((instr & kJumpRawMask) == kJalRawMark));
-    // Unbox raw offset and emit j/jal.
-    int32_t imm28 = (instr & static_cast<int32_t>(kImm26Mask)) << 2;
-    // Sign extend 28-bit offset to 32-bit.
-    imm28 = (imm28 << 4) >> 4;
-    uint64_t target =
-        static_cast<int64_t>(imm28) + reinterpret_cast<uint64_t>(pc);
-    target &= kImm28Mask;
-    DCHECK_EQ(imm28 & 3, 0);
-    uint32_t imm26 = static_cast<uint32_t>(target >> 2);
-    // Check markings whether to emit j or jal.
-    uint32_t unbox = (instr & kJRawMark) ? J : JAL;
-    instr_at_put(pc, unbox | (imm26 & kImm26Mask));
-    return 1;  // Number of instructions patched.
-  }
-}
-
-
-void Assembler::GrowBuffer() {
-  if (!own_buffer_) FATAL("external code buffer is too small");
-
-  // Compute new buffer size.
-  CodeDesc desc;  // the new buffer
-  if (buffer_size_ < 1 * MB) {
-    desc.buffer_size = 2*buffer_size_;
-  } else {
-    desc.buffer_size = buffer_size_ + 1*MB;
-  }
-
-  // Some internal data structures overflow for very large buffers,
-  // they must ensure that kMaximalBufferSize is not too large.
-  if (desc.buffer_size > kMaximalBufferSize) {
-    V8::FatalProcessOutOfMemory("Assembler::GrowBuffer");
-  }
-
-  // Set up new buffer.
-  desc.buffer = NewArray<byte>(desc.buffer_size);
-  desc.origin = this;
-
-  desc.instr_size = pc_offset();
-  desc.reloc_size =
-      static_cast<int>((buffer_ + buffer_size_) - reloc_info_writer.pos());
-
-  // Copy the data.
-  intptr_t pc_delta = desc.buffer - buffer_;
-  intptr_t rc_delta = (desc.buffer + desc.buffer_size) -
-      (buffer_ + buffer_size_);
-  MemMove(desc.buffer, buffer_, desc.instr_size);
-  MemMove(reloc_info_writer.pos() + rc_delta,
-              reloc_info_writer.pos(), desc.reloc_size);
-
-  // Switch buffers.
-  DeleteArray(buffer_);
-  buffer_ = desc.buffer;
-  buffer_size_ = desc.buffer_size;
-  pc_ += pc_delta;
-  reloc_info_writer.Reposition(reloc_info_writer.pos() + rc_delta,
-                               reloc_info_writer.last_pc() + pc_delta);
-
-  // Relocate runtime entries.
-  for (RelocIterator it(desc); !it.done(); it.next()) {
-    RelocInfo::Mode rmode = it.rinfo()->rmode();
-    if (rmode == RelocInfo::INTERNAL_REFERENCE) {
-      byte* p = reinterpret_cast<byte*>(it.rinfo()->pc());
-      RelocateInternalReference(rmode, p, pc_delta);
-    }
-  }
-  DCHECK(!overflow());
-}
-
-
-void Assembler::db(uint8_t data) {
-  CheckForEmitInForbiddenSlot();
-  EmitHelper(data);
-}
-
-
-void Assembler::dd(uint32_t data) {
-  CheckForEmitInForbiddenSlot();
-  EmitHelper(data);
-}
-
-
-void Assembler::dq(uint64_t data) {
-  CheckForEmitInForbiddenSlot();
-  EmitHelper(data);
-}
-
-
-void Assembler::dd(Label* label) {
-  uint64_t data;
-  CheckForEmitInForbiddenSlot();
-  if (label->is_bound()) {
-    data = reinterpret_cast<uint64_t>(buffer_ + label->pos());
-  } else {
-    data = jump_address(label);
-    unbound_labels_count_++;
-    internal_reference_positions_.insert(label->pos());
-  }
-  RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE);
-  EmitHelper(data);
-}
-
-
-void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
-  // We do not try to reuse pool constants.
-  RelocInfo rinfo(pc_, rmode, data, nullptr);
-  if (!RelocInfo::IsNone(rinfo.rmode())) {
-    // Don't record external references unless the heap will be serialized.
-    if (rmode == RelocInfo::EXTERNAL_REFERENCE &&
-        !serializer_enabled() && !emit_debug_code()) {
-      return;
-    }
-    DCHECK_GE(buffer_space(), kMaxRelocSize);  // Too late to grow buffer here.
-    reloc_info_writer.Write(&rinfo);
-  }
-}
-
-
-void Assembler::BlockTrampolinePoolFor(int instructions) {
-  CheckTrampolinePoolQuick(instructions);
-  BlockTrampolinePoolBefore(pc_offset() + instructions * kInstrSize);
-}
-
-
-void Assembler::CheckTrampolinePool() {
-  // Some small sequences of instructions must not be broken up by the
-  // insertion of a trampoline pool; such sequences are protected by setting
-  // either trampoline_pool_blocked_nesting_ or no_trampoline_pool_before_,
-  // which are both checked here. Also, recursive calls to CheckTrampolinePool
-  // are blocked by trampoline_pool_blocked_nesting_.
-  if ((trampoline_pool_blocked_nesting_ > 0) ||
-      (pc_offset() < no_trampoline_pool_before_)) {
-    // Emission is currently blocked; make sure we try again as soon as
-    // possible.
-    if (trampoline_pool_blocked_nesting_ > 0) {
-      next_buffer_check_ = pc_offset() + kInstrSize;
-    } else {
-      next_buffer_check_ = no_trampoline_pool_before_;
-    }
-    return;
-  }
-
-  DCHECK(!trampoline_emitted_);
-  DCHECK_GE(unbound_labels_count_, 0);
-  if (unbound_labels_count_ > 0) {
-    // First we emit jump (2 instructions), then we emit trampoline pool.
-    { BlockTrampolinePoolScope block_trampoline_pool(this);
-      Label after_pool;
-      if (kArchVariant == kMips64r6) {
-        bc(&after_pool);
-      } else {
-        b(&after_pool);
-      }
-      nop();
-
-      int pool_start = pc_offset();
-      for (int i = 0; i < unbound_labels_count_; i++) {
-        { BlockGrowBufferScope block_buf_growth(this);
-          // Buffer growth (and relocation) must be blocked for internal
-          // references until associated instructions are emitted and available
-          // to be patched.
-          RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE_ENCODED);
-          j(&after_pool);
-        }
-        nop();
-      }
-      bind(&after_pool);
-      trampoline_ = Trampoline(pool_start, unbound_labels_count_);
-
-      trampoline_emitted_ = true;
-      // As we are only going to emit trampoline once, we need to prevent any
-      // further emission.
-      next_buffer_check_ = kMaxInt;
-    }
-  } else {
-    // Number of branches to unbound label at this point is zero, so we can
-    // move next buffer check to maximum.
-    next_buffer_check_ = pc_offset() +
-        kMaxBranchOffset - kTrampolineSlotsSize * 16;
-  }
-  return;
-}
-
-
-Address Assembler::target_address_at(Address pc) {
-  Instr instr0 = instr_at(pc);
-  Instr instr1 = instr_at(pc + 1 * kInstrSize);
-  Instr instr3 = instr_at(pc + 3 * kInstrSize);
-
-  // Interpret 4 instructions for address generated by li: See listing in
-  // Assembler::set_target_address_at() just below.
-  if ((GetOpcodeField(instr0) == LUI) && (GetOpcodeField(instr1) == ORI) &&
-      (GetOpcodeField(instr3) == ORI)) {
-    // Assemble the 48 bit value.
-     int64_t addr  = static_cast<int64_t>(
-          ((uint64_t)(GetImmediate16(instr0)) << 32) |
-          ((uint64_t)(GetImmediate16(instr1)) << 16) |
-          ((uint64_t)(GetImmediate16(instr3))));
-
-    // Sign extend to get canonical address.
-    addr = (addr << 16) >> 16;
-    return reinterpret_cast<Address>(addr);
-  }
-  // We should never get here, force a bad address if we do.
-  UNREACHABLE();
-}
-
-
-// MIPS and ia32 use opposite encoding for qNaN and sNaN, such that ia32
-// qNaN is a MIPS sNaN, and ia32 sNaN is MIPS qNaN. If running from a heap
-// snapshot generated on ia32, the resulting MIPS sNaN must be quieted.
-// OS::nan_value() returns a qNaN.
-void Assembler::QuietNaN(HeapObject* object) {
-  HeapNumber::cast(object)->set_value(std::numeric_limits<double>::quiet_NaN());
-}
-
-
-// On Mips64, a target address is stored in a 4-instruction sequence:
-//    0: lui(rd, (j.imm64_ >> 32) & kImm16Mask);
-//    1: ori(rd, rd, (j.imm64_ >> 16) & kImm16Mask);
-//    2: dsll(rd, rd, 16);
-//    3: ori(rd, rd, j.imm32_ & kImm16Mask);
-//
-// Patching the address must replace all the lui & ori instructions,
-// and flush the i-cache.
-//
-// There is an optimization below, which emits a nop when the address
-// fits in just 16 bits. This is unlikely to help, and should be benchmarked,
-// and possibly removed.
-void Assembler::set_target_value_at(Isolate* isolate, Address pc,
-                                    uint64_t target,
-                                    ICacheFlushMode icache_flush_mode) {
-  // There is an optimization where only 4 instructions are used to load address
-  // in code on MIP64 because only 48-bits of address is effectively used.
-  // It relies on fact the upper [63:48] bits are not used for virtual address
-  // translation and they have to be set according to value of bit 47 in order
-  // get canonical address.
-  Instr instr1 = instr_at(pc + kInstrSize);
-  uint32_t rt_code = GetRt(instr1);
-  uint32_t* p = reinterpret_cast<uint32_t*>(pc);
-
-#ifdef DEBUG
-  // Check we have the result from a li macro-instruction.
-  Instr instr0 = instr_at(pc);
-  Instr instr3 = instr_at(pc + kInstrSize * 3);
-  DCHECK((GetOpcodeField(instr0) == LUI && GetOpcodeField(instr1) == ORI &&
-          GetOpcodeField(instr3) == ORI));
-#endif
-
-  // Must use 4 instructions to insure patchable code.
-  // lui rt, upper-16.
-  // ori rt, rt, lower-16.
-  // dsll rt, rt, 16.
-  // ori rt rt, lower-16.
-  *p = LUI | (rt_code << kRtShift) | ((target >> 32) & kImm16Mask);
-  *(p + 1) = ORI | (rt_code << kRtShift) | (rt_code << kRsShift) |
-             ((target >> 16) & kImm16Mask);
-  *(p + 3) = ORI | (rt_code << kRsShift) | (rt_code << kRtShift) |
-             (target & kImm16Mask);
-
-  if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
-    Assembler::FlushICache(isolate, pc, 4 * Assembler::kInstrSize);
-  }
-}
-
-UseScratchRegisterScope::UseScratchRegisterScope(Assembler* assembler)
-    : available_(assembler->GetScratchRegisterList()),
-      old_available_(*available_) {}
-
-UseScratchRegisterScope::~UseScratchRegisterScope() {
-  *available_ = old_available_;
-}
-
-Register UseScratchRegisterScope::Acquire() {
-  DCHECK_NOT_NULL(available_);
-  DCHECK_NE(*available_, 0);
-  int index = static_cast<int>(base::bits::CountTrailingZeros32(*available_));
-  *available_ &= ~(1UL << index);
-
-  return Register::from_code(index);
-}
-
-bool UseScratchRegisterScope::hasAvailable() const { return *available_ != 0; }
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_MIPS64
diff --git a/src/v8/src/mips64/assembler-mips64.h b/src/v8/src/mips64/assembler-mips64.h
deleted file mode 100644
index 3530c7e..0000000
--- a/src/v8/src/mips64/assembler-mips64.h
+++ /dev/null
@@ -1,2303 +0,0 @@
-// Copyright (c) 1994-2006 Sun Microsystems Inc.
-// 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.
-//
-// - Redistribution 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 Sun Microsystems or the names of 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.
-
-// The original source code covered by the above license above has been
-// modified significantly by Google Inc.
-// Copyright 2012 the V8 project authors. All rights reserved.
-
-
-#ifndef V8_MIPS_ASSEMBLER_MIPS_H_
-#define V8_MIPS_ASSEMBLER_MIPS_H_
-
-#include <stdio.h>
-
-#include <set>
-
-#include "src/assembler.h"
-#include "src/mips64/constants-mips64.h"
-
-namespace v8 {
-namespace internal {
-
-// clang-format off
-#define GENERAL_REGISTERS(V)                              \
-  V(zero_reg)  V(at)  V(v0)  V(v1)  V(a0)  V(a1)  V(a2)  V(a3)  \
-  V(a4)  V(a5)  V(a6)  V(a7)  V(t0)  V(t1)  V(t2)  V(t3)  \
-  V(s0)  V(s1)  V(s2)  V(s3)  V(s4)  V(s5)  V(s6)  V(s7)  V(t8)  V(t9) \
-  V(k0)  V(k1)  V(gp)  V(sp)  V(fp)  V(ra)
-
-#define ALLOCATABLE_GENERAL_REGISTERS(V) \
-  V(a0)  V(a1)  V(a2)  V(a3) \
-  V(a4)  V(a5)  V(a6)  V(a7)  V(t0)  V(t1)  V(t2) V(s7) \
-  V(v0)  V(v1)
-
-#define DOUBLE_REGISTERS(V)                               \
-  V(f0)  V(f1)  V(f2)  V(f3)  V(f4)  V(f5)  V(f6)  V(f7)  \
-  V(f8)  V(f9)  V(f10) V(f11) V(f12) V(f13) V(f14) V(f15) \
-  V(f16) V(f17) V(f18) V(f19) V(f20) V(f21) V(f22) V(f23) \
-  V(f24) V(f25) V(f26) V(f27) V(f28) V(f29) V(f30) V(f31)
-
-#define FLOAT_REGISTERS DOUBLE_REGISTERS
-#define SIMD128_REGISTERS(V)                              \
-  V(w0)  V(w1)  V(w2)  V(w3)  V(w4)  V(w5)  V(w6)  V(w7)  \
-  V(w8)  V(w9)  V(w10) V(w11) V(w12) V(w13) V(w14) V(w15) \
-  V(w16) V(w17) V(w18) V(w19) V(w20) V(w21) V(w22) V(w23) \
-  V(w24) V(w25) V(w26) V(w27) V(w28) V(w29) V(w30) V(w31)
-
-#define ALLOCATABLE_DOUBLE_REGISTERS(V)                   \
-  V(f0)  V(f2)  V(f4)  V(f6)  V(f8)  V(f10) V(f12) V(f14) \
-  V(f16) V(f18) V(f20) V(f22) V(f24) V(f26)
-// clang-format on
-
-// Note that the bit values must match those used in actual instruction
-// encoding.
-const int kNumRegs = 32;
-
-const RegList kJSCallerSaved = 1 << 2 |   // v0
-                               1 << 3 |   // v1
-                               1 << 4 |   // a0
-                               1 << 5 |   // a1
-                               1 << 6 |   // a2
-                               1 << 7 |   // a3
-                               1 << 8 |   // a4
-                               1 << 9 |   // a5
-                               1 << 10 |  // a6
-                               1 << 11 |  // a7
-                               1 << 12 |  // t0
-                               1 << 13 |  // t1
-                               1 << 14 |  // t2
-                               1 << 15;   // t3
-
-const int kNumJSCallerSaved = 14;
-
-// Callee-saved registers preserved when switching from C to JavaScript.
-const RegList kCalleeSaved = 1 << 16 |  // s0
-                             1 << 17 |  // s1
-                             1 << 18 |  // s2
-                             1 << 19 |  // s3
-                             1 << 20 |  // s4
-                             1 << 21 |  // s5
-                             1 << 22 |  // s6 (roots in Javascript code)
-                             1 << 23 |  // s7 (cp in Javascript code)
-                             1 << 30;   // fp/s8
-
-const int kNumCalleeSaved = 9;
-
-const RegList kCalleeSavedFPU = 1 << 20 |  // f20
-                                1 << 22 |  // f22
-                                1 << 24 |  // f24
-                                1 << 26 |  // f26
-                                1 << 28 |  // f28
-                                1 << 30;   // f30
-
-const int kNumCalleeSavedFPU = 6;
-
-const RegList kCallerSavedFPU = 1 << 0 |   // f0
-                                1 << 2 |   // f2
-                                1 << 4 |   // f4
-                                1 << 6 |   // f6
-                                1 << 8 |   // f8
-                                1 << 10 |  // f10
-                                1 << 12 |  // f12
-                                1 << 14 |  // f14
-                                1 << 16 |  // f16
-                                1 << 18;   // f18
-
-// Number of registers for which space is reserved in safepoints. Must be a
-// multiple of 8.
-const int kNumSafepointRegisters = 24;
-
-// Define the list of registers actually saved at safepoints.
-// Note that the number of saved registers may be smaller than the reserved
-// space, i.e. kNumSafepointSavedRegisters <= kNumSafepointRegisters.
-const RegList kSafepointSavedRegisters = kJSCallerSaved | kCalleeSaved;
-const int kNumSafepointSavedRegisters = kNumJSCallerSaved + kNumCalleeSaved;
-
-const int kUndefIndex = -1;
-// Map with indexes on stack that corresponds to codes of saved registers.
-const int kSafepointRegisterStackIndexMap[kNumRegs] = {kUndefIndex,  // zero_reg
-                                                       kUndefIndex,  // at
-                                                       0,            // v0
-                                                       1,            // v1
-                                                       2,            // a0
-                                                       3,            // a1
-                                                       4,            // a2
-                                                       5,            // a3
-                                                       6,            // a4
-                                                       7,            // a5
-                                                       8,            // a6
-                                                       9,            // a7
-                                                       10,           // t0
-                                                       11,           // t1
-                                                       12,           // t2
-                                                       13,           // t3
-                                                       14,           // s0
-                                                       15,           // s1
-                                                       16,           // s2
-                                                       17,           // s3
-                                                       18,           // s4
-                                                       19,           // s5
-                                                       20,           // s6
-                                                       21,           // s7
-                                                       kUndefIndex,  // t8
-                                                       kUndefIndex,  // t9
-                                                       kUndefIndex,  // k0
-                                                       kUndefIndex,  // k1
-                                                       kUndefIndex,  // gp
-                                                       kUndefIndex,  // sp
-                                                       22,           // fp
-                                                       kUndefIndex};
-
-// CPU Registers.
-//
-// 1) We would prefer to use an enum, but enum values are assignment-
-// compatible with int, which has caused code-generation bugs.
-//
-// 2) We would prefer to use a class instead of a struct but we don't like
-// the register initialization to depend on the particular initialization
-// order (which appears to be different on OS X, Linux, and Windows for the
-// installed versions of C++ we tried). Using a struct permits C-style
-// "initialization". Also, the Register objects cannot be const as this
-// forces initialization stubs in MSVC, making us dependent on initialization
-// order.
-//
-// 3) By not using an enum, we are possibly preventing the compiler from
-// doing certain constant folds, which may significantly reduce the
-// code generated for some assembly instructions (because they boil down
-// to a few constants). If this is a problem, we could change the code
-// such that we use an enum in optimized mode, and the struct in debug
-// mode. This way we get the compile-time error checking in debug mode
-// and best performance in optimized code.
-
-
-// -----------------------------------------------------------------------------
-// Implementation of Register and FPURegister.
-
-enum RegisterCode {
-#define REGISTER_CODE(R) kRegCode_##R,
-  GENERAL_REGISTERS(REGISTER_CODE)
-#undef REGISTER_CODE
-      kRegAfterLast
-};
-
-class Register : public RegisterBase<Register, kRegAfterLast> {
- public:
-#if defined(V8_TARGET_LITTLE_ENDIAN)
-  static constexpr int kMantissaOffset = 0;
-  static constexpr int kExponentOffset = 4;
-#elif defined(V8_TARGET_BIG_ENDIAN)
-  static constexpr int kMantissaOffset = 4;
-  static constexpr int kExponentOffset = 0;
-#else
-#error Unknown endianness
-#endif
-
- private:
-  friend class RegisterBase;
-  explicit constexpr Register(int code) : RegisterBase(code) {}
-};
-
-// s7: context register
-// s3: lithium scratch
-// s4: lithium scratch2
-#define DECLARE_REGISTER(R) \
-  constexpr Register R = Register::from_code<kRegCode_##R>();
-GENERAL_REGISTERS(DECLARE_REGISTER)
-#undef DECLARE_REGISTER
-
-constexpr Register no_reg = Register::no_reg();
-
-int ToNumber(Register reg);
-
-Register ToRegister(int num);
-
-constexpr bool kPadArguments = false;
-constexpr bool kSimpleFPAliasing = true;
-constexpr bool kSimdMaskRegisters = false;
-
-enum DoubleRegisterCode {
-#define REGISTER_CODE(R) kDoubleCode_##R,
-  DOUBLE_REGISTERS(REGISTER_CODE)
-#undef REGISTER_CODE
-      kDoubleAfterLast
-};
-
-// Coprocessor register.
-class FPURegister : public RegisterBase<FPURegister, kDoubleAfterLast> {
- public:
-  // TODO(plind): Warning, inconsistent numbering here. kNumFPURegisters refers
-  // to number of 32-bit FPU regs, but kNumAllocatableRegisters refers to
-  // number of Double regs (64-bit regs, or FPU-reg-pairs).
-
-  FPURegister low() const {
-    // TODO(plind): Create DCHECK for FR=0 mode. This usage suspect for FR=1.
-    // Find low reg of a Double-reg pair, which is the reg itself.
-    DCHECK_EQ(code() % 2, 0);  // Specified Double reg must be even.
-    return FPURegister::from_code(code());
-  }
-  FPURegister high() const {
-    // TODO(plind): Create DCHECK for FR=0 mode. This usage illegal in FR=1.
-    // Find high reg of a Doubel-reg pair, which is reg + 1.
-    DCHECK_EQ(code() % 2, 0);  // Specified Double reg must be even.
-    return FPURegister::from_code(code() + 1);
-  }
-
- private:
-  friend class RegisterBase;
-  explicit constexpr FPURegister(int code) : RegisterBase(code) {}
-};
-
-enum MSARegisterCode {
-#define REGISTER_CODE(R) kMsaCode_##R,
-  SIMD128_REGISTERS(REGISTER_CODE)
-#undef REGISTER_CODE
-      kMsaAfterLast
-};
-
-// MIPS SIMD (MSA) register
-class MSARegister : public RegisterBase<MSARegister, kMsaAfterLast> {
-  friend class RegisterBase;
-  explicit constexpr MSARegister(int code) : RegisterBase(code) {}
-};
-
-// A few double registers are reserved: one as a scratch register and one to
-// hold 0.0.
-//  f28: 0.0
-//  f30: scratch register.
-
-// V8 now supports the O32 ABI, and the FPU Registers are organized as 32
-// 32-bit registers, f0 through f31. When used as 'double' they are used
-// in pairs, starting with the even numbered register. So a double operation
-// on f0 really uses f0 and f1.
-// (Modern mips hardware also supports 32 64-bit registers, via setting
-// (privileged) Status Register FR bit to 1. This is used by the N32 ABI,
-// but it is not in common use. Someday we will want to support this in v8.)
-
-// For O32 ABI, Floats and Doubles refer to same set of 32 32-bit registers.
-typedef FPURegister FloatRegister;
-
-typedef FPURegister DoubleRegister;
-
-#define DECLARE_DOUBLE_REGISTER(R) \
-  constexpr DoubleRegister R = DoubleRegister::from_code<kDoubleCode_##R>();
-DOUBLE_REGISTERS(DECLARE_DOUBLE_REGISTER)
-#undef DECLARE_DOUBLE_REGISTER
-
-constexpr DoubleRegister no_freg = DoubleRegister::no_reg();
-
-// SIMD registers.
-typedef MSARegister Simd128Register;
-
-#define DECLARE_SIMD128_REGISTER(R) \
-  constexpr Simd128Register R = Simd128Register::from_code<kMsaCode_##R>();
-SIMD128_REGISTERS(DECLARE_SIMD128_REGISTER)
-#undef DECLARE_SIMD128_REGISTER
-
-const Simd128Register no_msareg = Simd128Register::no_reg();
-
-// Register aliases.
-// cp is assumed to be a callee saved register.
-constexpr Register kRootRegister = s6;
-constexpr Register cp = s7;
-constexpr Register kLithiumScratchReg = s3;
-constexpr Register kLithiumScratchReg2 = s4;
-constexpr DoubleRegister kLithiumScratchDouble = f30;
-constexpr DoubleRegister kDoubleRegZero = f28;
-// Used on mips64r6 for compare operations.
-// We use the last non-callee saved odd register for N64 ABI
-constexpr DoubleRegister kDoubleCompareReg = f23;
-// MSA zero and scratch regs must have the same numbers as FPU zero and scratch
-constexpr Simd128Register kSimd128RegZero = w28;
-constexpr Simd128Register kSimd128ScratchReg = w30;
-
-// FPU (coprocessor 1) control registers.
-// Currently only FCSR (#31) is implemented.
-struct FPUControlRegister {
-  bool is_valid() const { return reg_code == kFCSRRegister; }
-  bool is(FPUControlRegister creg) const { return reg_code == creg.reg_code; }
-  int code() const {
-    DCHECK(is_valid());
-    return reg_code;
-  }
-  int bit() const {
-    DCHECK(is_valid());
-    return 1 << reg_code;
-  }
-  void setcode(int f) {
-    reg_code = f;
-    DCHECK(is_valid());
-  }
-  // Unfortunately we can't make this private in a struct.
-  int reg_code;
-};
-
-constexpr FPUControlRegister no_fpucreg = {kInvalidFPUControlRegister};
-constexpr FPUControlRegister FCSR = {kFCSRRegister};
-
-// MSA control registers
-struct MSAControlRegister {
-  bool is_valid() const {
-    return (reg_code == kMSAIRRegister) || (reg_code == kMSACSRRegister);
-  }
-  bool is(MSAControlRegister creg) const { return reg_code == creg.reg_code; }
-  int code() const {
-    DCHECK(is_valid());
-    return reg_code;
-  }
-  int bit() const {
-    DCHECK(is_valid());
-    return 1 << reg_code;
-  }
-  void setcode(int f) {
-    reg_code = f;
-    DCHECK(is_valid());
-  }
-  // Unfortunately we can't make this private in a struct.
-  int reg_code;
-};
-
-constexpr MSAControlRegister no_msacreg = {kInvalidMSAControlRegister};
-constexpr MSAControlRegister MSAIR = {kMSAIRRegister};
-constexpr MSAControlRegister MSACSR = {kMSACSRRegister};
-
-// -----------------------------------------------------------------------------
-// Machine instruction Operands.
-constexpr int kSmiShift = kSmiTagSize + kSmiShiftSize;
-constexpr uint64_t kSmiShiftMask = (1UL << kSmiShift) - 1;
-// Class Operand represents a shifter operand in data processing instructions.
-class Operand BASE_EMBEDDED {
- public:
-  // Immediate.
-  INLINE(explicit Operand(int64_t immediate,
-                          RelocInfo::Mode rmode = RelocInfo::NONE64))
-      : rm_(no_reg), rmode_(rmode) {
-    value_.immediate = immediate;
-  }
-  INLINE(explicit Operand(const ExternalReference& f))
-      : rm_(no_reg), rmode_(RelocInfo::EXTERNAL_REFERENCE) {
-    value_.immediate = reinterpret_cast<int64_t>(f.address());
-  }
-  INLINE(explicit Operand(const char* s));
-  INLINE(explicit Operand(Object** opp));
-  INLINE(explicit Operand(Context** cpp));
-  explicit Operand(Handle<HeapObject> handle);
-  INLINE(explicit Operand(Smi* value))
-      : rm_(no_reg), rmode_(RelocInfo::NONE32) {
-    value_.immediate = reinterpret_cast<intptr_t>(value);
-  }
-
-  static Operand EmbeddedNumber(double number);  // Smi or HeapNumber.
-  static Operand EmbeddedCode(CodeStub* stub);
-
-  // Register.
-  INLINE(explicit Operand(Register rm)) : rm_(rm) {}
-
-  // Return true if this is a register operand.
-  INLINE(bool is_reg() const);
-
-  inline int64_t immediate() const;
-
-  bool IsImmediate() const { return !rm_.is_valid(); }
-
-  HeapObjectRequest heap_object_request() const {
-    DCHECK(IsHeapObjectRequest());
-    return value_.heap_object_request;
-  }
-
-  bool IsHeapObjectRequest() const {
-    DCHECK_IMPLIES(is_heap_object_request_, IsImmediate());
-    DCHECK_IMPLIES(is_heap_object_request_,
-                   rmode_ == RelocInfo::EMBEDDED_OBJECT ||
-                       rmode_ == RelocInfo::CODE_TARGET);
-    return is_heap_object_request_;
-  }
-
-  Register rm() const { return rm_; }
-
-  RelocInfo::Mode rmode() const { return rmode_; }
-
- private:
-  Register rm_;
-  union Value {
-    Value() {}
-    HeapObjectRequest heap_object_request;  // if is_heap_object_request_
-    int64_t immediate;                      // otherwise
-  } value_;                                 // valid if rm_ == no_reg
-  bool is_heap_object_request_ = false;
-  RelocInfo::Mode rmode_;
-
-  friend class Assembler;
-  friend class MacroAssembler;
-};
-
-
-// On MIPS we have only one addressing mode with base_reg + offset.
-// Class MemOperand represents a memory operand in load and store instructions.
-class MemOperand : public Operand {
- public:
-  // Immediate value attached to offset.
-  enum OffsetAddend {
-    offset_minus_one = -1,
-    offset_zero = 0
-  };
-
-  explicit MemOperand(Register rn, int32_t offset = 0);
-  explicit MemOperand(Register rn, int32_t unit, int32_t multiplier,
-                      OffsetAddend offset_addend = offset_zero);
-  int32_t offset() const { return offset_; }
-
-  bool OffsetIsInt16Encodable() const {
-    return is_int16(offset_);
-  }
-
- private:
-  int32_t offset_;
-
-  friend class Assembler;
-};
-
-
-class Assembler : public AssemblerBase {
- public:
-  // Create an assembler. Instructions and relocation information are emitted
-  // into a buffer, with the instructions starting from the beginning and the
-  // relocation information starting from the end of the buffer. See CodeDesc
-  // for a detailed comment on the layout (globals.h).
-  //
-  // If the provided buffer is nullptr, the assembler allocates and grows its
-  // own buffer, and buffer_size determines the initial buffer size. The buffer
-  // is owned by the assembler and deallocated upon destruction of the
-  // assembler.
-  //
-  // If the provided buffer is not nullptr, the assembler uses the provided
-  // buffer for code generation and assumes its size to be buffer_size. If the
-  // buffer is too small, a fatal error occurs. No deallocation of the buffer is
-  // done upon destruction of the assembler.
-  Assembler(Isolate* isolate, void* buffer, int buffer_size)
-      : Assembler(IsolateData(isolate), buffer, buffer_size) {}
-  Assembler(IsolateData isolate_data, void* buffer, int buffer_size);
-  virtual ~Assembler() { }
-
-  // GetCode emits any pending (non-emitted) code and fills the descriptor
-  // desc. GetCode() is idempotent; it returns the same result if no other
-  // Assembler functions are invoked in between GetCode() calls.
-  void GetCode(Isolate* isolate, CodeDesc* desc);
-
-  // Label operations & relative jumps (PPUM Appendix D).
-  //
-  // Takes a branch opcode (cc) and a label (L) and generates
-  // either a backward branch or a forward branch and links it
-  // to the label fixup chain. Usage:
-  //
-  // Label L;    // unbound label
-  // j(cc, &L);  // forward branch to unbound label
-  // bind(&L);   // bind label to the current pc
-  // j(cc, &L);  // backward branch to bound label
-  // bind(&L);   // illegal: a label may be bound only once
-  //
-  // Note: The same Label can be used for forward and backward branches
-  // but it may be bound only once.
-  void bind(Label* L);  // Binds an unbound label L to current code position.
-
-  enum OffsetSize : int { kOffset26 = 26, kOffset21 = 21, kOffset16 = 16 };
-
-  // Determines if Label is bound and near enough so that branch instruction
-  // can be used to reach it, instead of jump instruction.
-  bool is_near(Label* L);
-  bool is_near(Label* L, OffsetSize bits);
-  bool is_near_branch(Label* L);
-  inline bool is_near_pre_r6(Label* L) {
-    DCHECK(!(kArchVariant == kMips64r6));
-    return pc_offset() - L->pos() < kMaxBranchOffset - 4 * kInstrSize;
-  }
-  inline bool is_near_r6(Label* L) {
-    DCHECK_EQ(kArchVariant, kMips64r6);
-    return pc_offset() - L->pos() < kMaxCompactBranchOffset - 4 * kInstrSize;
-  }
-
-  int BranchOffset(Instr instr);
-
-  // Returns the branch offset to the given label from the current code
-  // position. Links the label to the current position if it is still unbound.
-  // Manages the jump elimination optimization if the second parameter is true.
-  int32_t branch_offset_helper(Label* L, OffsetSize bits);
-  inline int32_t branch_offset(Label* L) {
-    return branch_offset_helper(L, OffsetSize::kOffset16);
-  }
-  inline int32_t branch_offset21(Label* L) {
-    return branch_offset_helper(L, OffsetSize::kOffset21);
-  }
-  inline int32_t branch_offset26(Label* L) {
-    return branch_offset_helper(L, OffsetSize::kOffset26);
-  }
-  inline int32_t shifted_branch_offset(Label* L) {
-    return branch_offset(L) >> 2;
-  }
-  inline int32_t shifted_branch_offset21(Label* L) {
-    return branch_offset21(L) >> 2;
-  }
-  inline int32_t shifted_branch_offset26(Label* L) {
-    return branch_offset26(L) >> 2;
-  }
-  uint64_t jump_address(Label* L);
-  uint64_t jump_offset(Label* L);
-
-  // Puts a labels target address at the given position.
-  // The high 8 bits are set to zero.
-  void label_at_put(Label* L, int at_offset);
-
-  // Read/Modify the code target address in the branch/call instruction at pc.
-  // The isolate argument is unused (and may be nullptr) when skipping flushing.
-  static Address target_address_at(Address pc);
-  INLINE(static void set_target_address_at(
-      Isolate* isolate, Address pc, Address target,
-      ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED)) {
-    set_target_value_at(isolate, pc, reinterpret_cast<uint64_t>(target),
-                        icache_flush_mode);
-  }
-  // On MIPS there is no Constant Pool so we skip that parameter.
-  INLINE(static Address target_address_at(Address pc, Address constant_pool)) {
-    return target_address_at(pc);
-  }
-  INLINE(static void set_target_address_at(
-      Isolate* isolate, Address pc, Address constant_pool, Address target,
-      ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED)) {
-    set_target_address_at(isolate, pc, target, icache_flush_mode);
-  }
-
-  static void set_target_value_at(
-      Isolate* isolate, Address pc, uint64_t target,
-      ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED);
-
-  // Return the code target address at a call site from the return address
-  // of that call in the instruction stream.
-  inline static Address target_address_from_return_address(Address pc);
-
-  static void JumpLabelToJumpRegister(Address pc);
-
-  static void QuietNaN(HeapObject* nan);
-
-  // This sets the branch destination (which gets loaded at the call address).
-  // This is for calls and branches within generated code.  The serializer
-  // has already deserialized the lui/ori instructions etc.
-  inline static void deserialization_set_special_target_at(
-      Isolate* isolate, Address instruction_payload, Code* code,
-      Address target);
-
-  // This sets the internal reference at the pc.
-  inline static void deserialization_set_target_internal_reference_at(
-      Isolate* isolate, Address pc, Address target,
-      RelocInfo::Mode mode = RelocInfo::INTERNAL_REFERENCE);
-
-  // Size of an instruction.
-  static constexpr int kInstrSize = sizeof(Instr);
-
-  // Difference between address of current opcode and target address offset.
-  static constexpr int kBranchPCOffset = 4;
-
-  // Here we are patching the address in the LUI/ORI instruction pair.
-  // These values are used in the serialization process and must be zero for
-  // MIPS platform, as Code, Embedded Object or External-reference pointers
-  // are split across two consecutive instructions and don't exist separately
-  // in the code, so the serializer should not step forwards in memory after
-  // a target is resolved and written.
-  static constexpr int kSpecialTargetSize = 0;
-
-  // Number of consecutive instructions used to store 32bit/64bit constant.
-  // This constant was used in RelocInfo::target_address_address() function
-  // to tell serializer address of the instruction that follows
-  // LUI/ORI instruction pair.
-  static constexpr int kInstructionsFor32BitConstant = 2;
-  static constexpr int kInstructionsFor64BitConstant = 4;
-
-  // Distance between the instruction referring to the address of the call
-  // target and the return address.
-#ifdef _MIPS_ARCH_MIPS64R6
-  static constexpr int kCallTargetAddressOffset = 5 * kInstrSize;
-#else
-  static constexpr int kCallTargetAddressOffset = 6 * kInstrSize;
-#endif
-
-  // Difference between address of current opcode and value read from pc
-  // register.
-  static constexpr int kPcLoadDelta = 4;
-
-  // Max offset for instructions with 16-bit offset field
-  static constexpr int kMaxBranchOffset = (1 << (18 - 1)) - 1;
-
-  // Max offset for compact branch instructions with 26-bit offset field
-  static constexpr int kMaxCompactBranchOffset = (1 << (28 - 1)) - 1;
-
-  static constexpr int kTrampolineSlotsSize = 2 * kInstrSize;
-
-  RegList* GetScratchRegisterList() { return &scratch_register_list_; }
-
-  // ---------------------------------------------------------------------------
-  // Code generation.
-
-  // Insert the smallest number of nop instructions
-  // possible to align the pc offset to a multiple
-  // of m. m must be a power of 2 (>= 4).
-  void Align(int m);
-  // Insert the smallest number of zero bytes possible to align the pc offset
-  // to a mulitple of m. m must be a power of 2 (>= 2).
-  void DataAlign(int m);
-  // Aligns code to something that's optimal for a jump target for the platform.
-  void CodeTargetAlign();
-
-  // Different nop operations are used by the code generator to detect certain
-  // states of the generated code.
-  enum NopMarkerTypes {
-    NON_MARKING_NOP = 0,
-    DEBUG_BREAK_NOP,
-    // IC markers.
-    PROPERTY_ACCESS_INLINED,
-    PROPERTY_ACCESS_INLINED_CONTEXT,
-    PROPERTY_ACCESS_INLINED_CONTEXT_DONT_DELETE,
-    // Helper values.
-    LAST_CODE_MARKER,
-    FIRST_IC_MARKER = PROPERTY_ACCESS_INLINED,
-    // Code aging
-    CODE_AGE_MARKER_NOP = 6,
-    CODE_AGE_SEQUENCE_NOP
-  };
-
-  // Type == 0 is the default non-marking nop. For mips this is a
-  // sll(zero_reg, zero_reg, 0). We use rt_reg == at for non-zero
-  // marking, to avoid conflict with ssnop and ehb instructions.
-  void nop(unsigned int type = 0) {
-    DCHECK_LT(type, 32);
-    Register nop_rt_reg = (type == 0) ? zero_reg : at;
-    sll(zero_reg, nop_rt_reg, type, true);
-  }
-
-
-  // --------Branch-and-jump-instructions----------
-  // We don't use likely variant of instructions.
-  void b(int16_t offset);
-  inline void b(Label* L) { b(shifted_branch_offset(L)); }
-  void bal(int16_t offset);
-  inline void bal(Label* L) { bal(shifted_branch_offset(L)); }
-  void bc(int32_t offset);
-  inline void bc(Label* L) { bc(shifted_branch_offset26(L)); }
-  void balc(int32_t offset);
-  inline void balc(Label* L) { balc(shifted_branch_offset26(L)); }
-
-  void beq(Register rs, Register rt, int16_t offset);
-  inline void beq(Register rs, Register rt, Label* L) {
-    beq(rs, rt, shifted_branch_offset(L));
-  }
-  void bgez(Register rs, int16_t offset);
-  void bgezc(Register rt, int16_t offset);
-  inline void bgezc(Register rt, Label* L) {
-    bgezc(rt, shifted_branch_offset(L));
-  }
-  void bgeuc(Register rs, Register rt, int16_t offset);
-  inline void bgeuc(Register rs, Register rt, Label* L) {
-    bgeuc(rs, rt, shifted_branch_offset(L));
-  }
-  void bgec(Register rs, Register rt, int16_t offset);
-  inline void bgec(Register rs, Register rt, Label* L) {
-    bgec(rs, rt, shifted_branch_offset(L));
-  }
-  void bgezal(Register rs, int16_t offset);
-  void bgezalc(Register rt, int16_t offset);
-  inline void bgezalc(Register rt, Label* L) {
-    bgezalc(rt, shifted_branch_offset(L));
-  }
-  void bgezall(Register rs, int16_t offset);
-  inline void bgezall(Register rs, Label* L) {
-    bgezall(rs, branch_offset(L) >> 2);
-  }
-  void bgtz(Register rs, int16_t offset);
-  void bgtzc(Register rt, int16_t offset);
-  inline void bgtzc(Register rt, Label* L) {
-    bgtzc(rt, shifted_branch_offset(L));
-  }
-  void blez(Register rs, int16_t offset);
-  void blezc(Register rt, int16_t offset);
-  inline void blezc(Register rt, Label* L) {
-    blezc(rt, shifted_branch_offset(L));
-  }
-  void bltz(Register rs, int16_t offset);
-  void bltzc(Register rt, int16_t offset);
-  inline void bltzc(Register rt, Label* L) {
-    bltzc(rt, shifted_branch_offset(L));
-  }
-  void bltuc(Register rs, Register rt, int16_t offset);
-  inline void bltuc(Register rs, Register rt, Label* L) {
-    bltuc(rs, rt, shifted_branch_offset(L));
-  }
-  void bltc(Register rs, Register rt, int16_t offset);
-  inline void bltc(Register rs, Register rt, Label* L) {
-    bltc(rs, rt, shifted_branch_offset(L));
-  }
-  void bltzal(Register rs, int16_t offset);
-  void blezalc(Register rt, int16_t offset);
-  inline void blezalc(Register rt, Label* L) {
-    blezalc(rt, shifted_branch_offset(L));
-  }
-  void bltzalc(Register rt, int16_t offset);
-  inline void bltzalc(Register rt, Label* L) {
-    bltzalc(rt, shifted_branch_offset(L));
-  }
-  void bgtzalc(Register rt, int16_t offset);
-  inline void bgtzalc(Register rt, Label* L) {
-    bgtzalc(rt, shifted_branch_offset(L));
-  }
-  void beqzalc(Register rt, int16_t offset);
-  inline void beqzalc(Register rt, Label* L) {
-    beqzalc(rt, shifted_branch_offset(L));
-  }
-  void beqc(Register rs, Register rt, int16_t offset);
-  inline void beqc(Register rs, Register rt, Label* L) {
-    beqc(rs, rt, shifted_branch_offset(L));
-  }
-  void beqzc(Register rs, int32_t offset);
-  inline void beqzc(Register rs, Label* L) {
-    beqzc(rs, shifted_branch_offset21(L));
-  }
-  void bnezalc(Register rt, int16_t offset);
-  inline void bnezalc(Register rt, Label* L) {
-    bnezalc(rt, shifted_branch_offset(L));
-  }
-  void bnec(Register rs, Register rt, int16_t offset);
-  inline void bnec(Register rs, Register rt, Label* L) {
-    bnec(rs, rt, shifted_branch_offset(L));
-  }
-  void bnezc(Register rt, int32_t offset);
-  inline void bnezc(Register rt, Label* L) {
-    bnezc(rt, shifted_branch_offset21(L));
-  }
-  void bne(Register rs, Register rt, int16_t offset);
-  inline void bne(Register rs, Register rt, Label* L) {
-    bne(rs, rt, shifted_branch_offset(L));
-  }
-  void bovc(Register rs, Register rt, int16_t offset);
-  inline void bovc(Register rs, Register rt, Label* L) {
-    bovc(rs, rt, shifted_branch_offset(L));
-  }
-  void bnvc(Register rs, Register rt, int16_t offset);
-  inline void bnvc(Register rs, Register rt, Label* L) {
-    bnvc(rs, rt, shifted_branch_offset(L));
-  }
-
-  // Never use the int16_t b(l)cond version with a branch offset
-  // instead of using the Label* version.
-
-  // Jump targets must be in the current 256 MB-aligned region. i.e. 28 bits.
-  void j(int64_t target);
-  void jal(int64_t target);
-  void j(Label* target);
-  void jal(Label* target);
-  void jalr(Register rs, Register rd = ra);
-  void jr(Register target);
-  void jic(Register rt, int16_t offset);
-  void jialc(Register rt, int16_t offset);
-
-
-  // -------Data-processing-instructions---------
-
-  // Arithmetic.
-  void addu(Register rd, Register rs, Register rt);
-  void subu(Register rd, Register rs, Register rt);
-
-  void div(Register rs, Register rt);
-  void divu(Register rs, Register rt);
-  void ddiv(Register rs, Register rt);
-  void ddivu(Register rs, Register rt);
-  void div(Register rd, Register rs, Register rt);
-  void divu(Register rd, Register rs, Register rt);
-  void ddiv(Register rd, Register rs, Register rt);
-  void ddivu(Register rd, Register rs, Register rt);
-  void mod(Register rd, Register rs, Register rt);
-  void modu(Register rd, Register rs, Register rt);
-  void dmod(Register rd, Register rs, Register rt);
-  void dmodu(Register rd, Register rs, Register rt);
-
-  void mul(Register rd, Register rs, Register rt);
-  void muh(Register rd, Register rs, Register rt);
-  void mulu(Register rd, Register rs, Register rt);
-  void muhu(Register rd, Register rs, Register rt);
-  void mult(Register rs, Register rt);
-  void multu(Register rs, Register rt);
-  void dmul(Register rd, Register rs, Register rt);
-  void dmuh(Register rd, Register rs, Register rt);
-  void dmulu(Register rd, Register rs, Register rt);
-  void dmuhu(Register rd, Register rs, Register rt);
-  void daddu(Register rd, Register rs, Register rt);
-  void dsubu(Register rd, Register rs, Register rt);
-  void dmult(Register rs, Register rt);
-  void dmultu(Register rs, Register rt);
-
-  void addiu(Register rd, Register rs, int32_t j);
-  void daddiu(Register rd, Register rs, int32_t j);
-
-  // Logical.
-  void and_(Register rd, Register rs, Register rt);
-  void or_(Register rd, Register rs, Register rt);
-  void xor_(Register rd, Register rs, Register rt);
-  void nor(Register rd, Register rs, Register rt);
-
-  void andi(Register rd, Register rs, int32_t j);
-  void ori(Register rd, Register rs, int32_t j);
-  void xori(Register rd, Register rs, int32_t j);
-  void lui(Register rd, int32_t j);
-  void aui(Register rt, Register rs, int32_t j);
-  void daui(Register rt, Register rs, int32_t j);
-  void dahi(Register rs, int32_t j);
-  void dati(Register rs, int32_t j);
-
-  // Shifts.
-  // Please note: sll(zero_reg, zero_reg, x) instructions are reserved as nop
-  // and may cause problems in normal code. coming_from_nop makes sure this
-  // doesn't happen.
-  void sll(Register rd, Register rt, uint16_t sa, bool coming_from_nop = false);
-  void sllv(Register rd, Register rt, Register rs);
-  void srl(Register rd, Register rt, uint16_t sa);
-  void srlv(Register rd, Register rt, Register rs);
-  void sra(Register rt, Register rd, uint16_t sa);
-  void srav(Register rt, Register rd, Register rs);
-  void rotr(Register rd, Register rt, uint16_t sa);
-  void rotrv(Register rd, Register rt, Register rs);
-  void dsll(Register rd, Register rt, uint16_t sa);
-  void dsllv(Register rd, Register rt, Register rs);
-  void dsrl(Register rd, Register rt, uint16_t sa);
-  void dsrlv(Register rd, Register rt, Register rs);
-  void drotr(Register rd, Register rt, uint16_t sa);
-  void drotr32(Register rd, Register rt, uint16_t sa);
-  void drotrv(Register rd, Register rt, Register rs);
-  void dsra(Register rt, Register rd, uint16_t sa);
-  void dsrav(Register rd, Register rt, Register rs);
-  void dsll32(Register rt, Register rd, uint16_t sa);
-  void dsrl32(Register rt, Register rd, uint16_t sa);
-  void dsra32(Register rt, Register rd, uint16_t sa);
-
-  // ------------Memory-instructions-------------
-
-  void lb(Register rd, const MemOperand& rs);
-  void lbu(Register rd, const MemOperand& rs);
-  void lh(Register rd, const MemOperand& rs);
-  void lhu(Register rd, const MemOperand& rs);
-  void lw(Register rd, const MemOperand& rs);
-  void lwu(Register rd, const MemOperand& rs);
-  void lwl(Register rd, const MemOperand& rs);
-  void lwr(Register rd, const MemOperand& rs);
-  void sb(Register rd, const MemOperand& rs);
-  void sh(Register rd, const MemOperand& rs);
-  void sw(Register rd, const MemOperand& rs);
-  void swl(Register rd, const MemOperand& rs);
-  void swr(Register rd, const MemOperand& rs);
-  void ldl(Register rd, const MemOperand& rs);
-  void ldr(Register rd, const MemOperand& rs);
-  void sdl(Register rd, const MemOperand& rs);
-  void sdr(Register rd, const MemOperand& rs);
-  void ld(Register rd, const MemOperand& rs);
-  void sd(Register rd, const MemOperand& rs);
-
-  // ----------Atomic instructions--------------
-
-  void ll(Register rd, const MemOperand& rs);
-  void sc(Register rd, const MemOperand& rs);
-  void lld(Register rd, const MemOperand& rs);
-  void scd(Register rd, const MemOperand& rs);
-
-  // ---------PC-Relative-instructions-----------
-
-  void addiupc(Register rs, int32_t imm19);
-  void lwpc(Register rs, int32_t offset19);
-  void lwupc(Register rs, int32_t offset19);
-  void ldpc(Register rs, int32_t offset18);
-  void auipc(Register rs, int16_t imm16);
-  void aluipc(Register rs, int16_t imm16);
-
-
-  // ----------------Prefetch--------------------
-
-  void pref(int32_t hint, const MemOperand& rs);
-
-
-  // -------------Misc-instructions--------------
-
-  // Break / Trap instructions.
-  void break_(uint32_t code, bool break_as_stop = false);
-  void stop(const char* msg, uint32_t code = kMaxStopCode);
-  void tge(Register rs, Register rt, uint16_t code);
-  void tgeu(Register rs, Register rt, uint16_t code);
-  void tlt(Register rs, Register rt, uint16_t code);
-  void tltu(Register rs, Register rt, uint16_t code);
-  void teq(Register rs, Register rt, uint16_t code);
-  void tne(Register rs, Register rt, uint16_t code);
-
-  // Memory barrier instruction.
-  void sync();
-
-  // Move from HI/LO register.
-  void mfhi(Register rd);
-  void mflo(Register rd);
-
-  // Set on less than.
-  void slt(Register rd, Register rs, Register rt);
-  void sltu(Register rd, Register rs, Register rt);
-  void slti(Register rd, Register rs, int32_t j);
-  void sltiu(Register rd, Register rs, int32_t j);
-
-  // Conditional move.
-  void movz(Register rd, Register rs, Register rt);
-  void movn(Register rd, Register rs, Register rt);
-  void movt(Register rd, Register rs, uint16_t cc = 0);
-  void movf(Register rd, Register rs, uint16_t cc = 0);
-
-  void sel(SecondaryField fmt, FPURegister fd, FPURegister fs, FPURegister ft);
-  void sel_s(FPURegister fd, FPURegister fs, FPURegister ft);
-  void sel_d(FPURegister fd, FPURegister fs, FPURegister ft);
-  void seleqz(Register rd, Register rs, Register rt);
-  void seleqz(SecondaryField fmt, FPURegister fd, FPURegister fs,
-              FPURegister ft);
-  void selnez(Register rs, Register rt, Register rd);
-  void selnez(SecondaryField fmt, FPURegister fd, FPURegister fs,
-              FPURegister ft);
-  void seleqz_d(FPURegister fd, FPURegister fs, FPURegister ft);
-  void seleqz_s(FPURegister fd, FPURegister fs, FPURegister ft);
-  void selnez_d(FPURegister fd, FPURegister fs, FPURegister ft);
-  void selnez_s(FPURegister fd, FPURegister fs, FPURegister ft);
-
-  void movz_s(FPURegister fd, FPURegister fs, Register rt);
-  void movz_d(FPURegister fd, FPURegister fs, Register rt);
-  void movt_s(FPURegister fd, FPURegister fs, uint16_t cc = 0);
-  void movt_d(FPURegister fd, FPURegister fs, uint16_t cc = 0);
-  void movf_s(FPURegister fd, FPURegister fs, uint16_t cc = 0);
-  void movf_d(FPURegister fd, FPURegister fs, uint16_t cc = 0);
-  void movn_s(FPURegister fd, FPURegister fs, Register rt);
-  void movn_d(FPURegister fd, FPURegister fs, Register rt);
-  // Bit twiddling.
-  void clz(Register rd, Register rs);
-  void dclz(Register rd, Register rs);
-  void ins_(Register rt, Register rs, uint16_t pos, uint16_t size);
-  void ext_(Register rt, Register rs, uint16_t pos, uint16_t size);
-  void dext_(Register rt, Register rs, uint16_t pos, uint16_t size);
-  void dextm_(Register rt, Register rs, uint16_t pos, uint16_t size);
-  void dextu_(Register rt, Register rs, uint16_t pos, uint16_t size);
-  void dins_(Register rt, Register rs, uint16_t pos, uint16_t size);
-  void dinsm_(Register rt, Register rs, uint16_t pos, uint16_t size);
-  void dinsu_(Register rt, Register rs, uint16_t pos, uint16_t size);
-  void bitswap(Register rd, Register rt);
-  void dbitswap(Register rd, Register rt);
-  void align(Register rd, Register rs, Register rt, uint8_t bp);
-  void dalign(Register rd, Register rs, Register rt, uint8_t bp);
-
-  void wsbh(Register rd, Register rt);
-  void dsbh(Register rd, Register rt);
-  void dshd(Register rd, Register rt);
-  void seh(Register rd, Register rt);
-  void seb(Register rd, Register rt);
-
-  // --------Coprocessor-instructions----------------
-
-  // Load, store, and move.
-  void lwc1(FPURegister fd, const MemOperand& src);
-  void ldc1(FPURegister fd, const MemOperand& src);
-
-  void swc1(FPURegister fs, const MemOperand& dst);
-  void sdc1(FPURegister fs, const MemOperand& dst);
-
-  void mtc1(Register rt, FPURegister fs);
-  void mthc1(Register rt, FPURegister fs);
-  void dmtc1(Register rt, FPURegister fs);
-
-  void mfc1(Register rt, FPURegister fs);
-  void mfhc1(Register rt, FPURegister fs);
-  void dmfc1(Register rt, FPURegister fs);
-
-  void ctc1(Register rt, FPUControlRegister fs);
-  void cfc1(Register rt, FPUControlRegister fs);
-
-  // Arithmetic.
-  void add_s(FPURegister fd, FPURegister fs, FPURegister ft);
-  void add_d(FPURegister fd, FPURegister fs, FPURegister ft);
-  void sub_s(FPURegister fd, FPURegister fs, FPURegister ft);
-  void sub_d(FPURegister fd, FPURegister fs, FPURegister ft);
-  void mul_s(FPURegister fd, FPURegister fs, FPURegister ft);
-  void mul_d(FPURegister fd, FPURegister fs, FPURegister ft);
-  void madd_s(FPURegister fd, FPURegister fr, FPURegister fs, FPURegister ft);
-  void madd_d(FPURegister fd, FPURegister fr, FPURegister fs, FPURegister ft);
-  void msub_s(FPURegister fd, FPURegister fr, FPURegister fs, FPURegister ft);
-  void msub_d(FPURegister fd, FPURegister fr, FPURegister fs, FPURegister ft);
-  void maddf_s(FPURegister fd, FPURegister fs, FPURegister ft);
-  void maddf_d(FPURegister fd, FPURegister fs, FPURegister ft);
-  void msubf_s(FPURegister fd, FPURegister fs, FPURegister ft);
-  void msubf_d(FPURegister fd, FPURegister fs, FPURegister ft);
-  void div_s(FPURegister fd, FPURegister fs, FPURegister ft);
-  void div_d(FPURegister fd, FPURegister fs, FPURegister ft);
-  void abs_s(FPURegister fd, FPURegister fs);
-  void abs_d(FPURegister fd, FPURegister fs);
-  void mov_d(FPURegister fd, FPURegister fs);
-  void mov_s(FPURegister fd, FPURegister fs);
-  void neg_s(FPURegister fd, FPURegister fs);
-  void neg_d(FPURegister fd, FPURegister fs);
-  void sqrt_s(FPURegister fd, FPURegister fs);
-  void sqrt_d(FPURegister fd, FPURegister fs);
-  void rsqrt_s(FPURegister fd, FPURegister fs);
-  void rsqrt_d(FPURegister fd, FPURegister fs);
-  void recip_d(FPURegister fd, FPURegister fs);
-  void recip_s(FPURegister fd, FPURegister fs);
-
-  // Conversion.
-  void cvt_w_s(FPURegister fd, FPURegister fs);
-  void cvt_w_d(FPURegister fd, FPURegister fs);
-  void trunc_w_s(FPURegister fd, FPURegister fs);
-  void trunc_w_d(FPURegister fd, FPURegister fs);
-  void round_w_s(FPURegister fd, FPURegister fs);
-  void round_w_d(FPURegister fd, FPURegister fs);
-  void floor_w_s(FPURegister fd, FPURegister fs);
-  void floor_w_d(FPURegister fd, FPURegister fs);
-  void ceil_w_s(FPURegister fd, FPURegister fs);
-  void ceil_w_d(FPURegister fd, FPURegister fs);
-  void rint_s(FPURegister fd, FPURegister fs);
-  void rint_d(FPURegister fd, FPURegister fs);
-  void rint(SecondaryField fmt, FPURegister fd, FPURegister fs);
-
-
-  void cvt_l_s(FPURegister fd, FPURegister fs);
-  void cvt_l_d(FPURegister fd, FPURegister fs);
-  void trunc_l_s(FPURegister fd, FPURegister fs);
-  void trunc_l_d(FPURegister fd, FPURegister fs);
-  void round_l_s(FPURegister fd, FPURegister fs);
-  void round_l_d(FPURegister fd, FPURegister fs);
-  void floor_l_s(FPURegister fd, FPURegister fs);
-  void floor_l_d(FPURegister fd, FPURegister fs);
-  void ceil_l_s(FPURegister fd, FPURegister fs);
-  void ceil_l_d(FPURegister fd, FPURegister fs);
-
-  void class_s(FPURegister fd, FPURegister fs);
-  void class_d(FPURegister fd, FPURegister fs);
-
-  void min(SecondaryField fmt, FPURegister fd, FPURegister fs, FPURegister ft);
-  void mina(SecondaryField fmt, FPURegister fd, FPURegister fs, FPURegister ft);
-  void max(SecondaryField fmt, FPURegister fd, FPURegister fs, FPURegister ft);
-  void maxa(SecondaryField fmt, FPURegister fd, FPURegister fs, FPURegister ft);
-  void min_s(FPURegister fd, FPURegister fs, FPURegister ft);
-  void min_d(FPURegister fd, FPURegister fs, FPURegister ft);
-  void max_s(FPURegister fd, FPURegister fs, FPURegister ft);
-  void max_d(FPURegister fd, FPURegister fs, FPURegister ft);
-  void mina_s(FPURegister fd, FPURegister fs, FPURegister ft);
-  void mina_d(FPURegister fd, FPURegister fs, FPURegister ft);
-  void maxa_s(FPURegister fd, FPURegister fs, FPURegister ft);
-  void maxa_d(FPURegister fd, FPURegister fs, FPURegister ft);
-
-  void cvt_s_w(FPURegister fd, FPURegister fs);
-  void cvt_s_l(FPURegister fd, FPURegister fs);
-  void cvt_s_d(FPURegister fd, FPURegister fs);
-
-  void cvt_d_w(FPURegister fd, FPURegister fs);
-  void cvt_d_l(FPURegister fd, FPURegister fs);
-  void cvt_d_s(FPURegister fd, FPURegister fs);
-
-  // Conditions and branches for MIPSr6.
-  void cmp(FPUCondition cond, SecondaryField fmt,
-         FPURegister fd, FPURegister ft, FPURegister fs);
-  void cmp_s(FPUCondition cond, FPURegister fd, FPURegister fs, FPURegister ft);
-  void cmp_d(FPUCondition cond, FPURegister fd, FPURegister fs, FPURegister ft);
-
-  void bc1eqz(int16_t offset, FPURegister ft);
-  inline void bc1eqz(Label* L, FPURegister ft) {
-    bc1eqz(shifted_branch_offset(L), ft);
-  }
-  void bc1nez(int16_t offset, FPURegister ft);
-  inline void bc1nez(Label* L, FPURegister ft) {
-    bc1nez(shifted_branch_offset(L), ft);
-  }
-
-  // Conditions and branches for non MIPSr6.
-  void c(FPUCondition cond, SecondaryField fmt,
-         FPURegister ft, FPURegister fs, uint16_t cc = 0);
-  void c_s(FPUCondition cond, FPURegister ft, FPURegister fs, uint16_t cc = 0);
-  void c_d(FPUCondition cond, FPURegister ft, FPURegister fs, uint16_t cc = 0);
-
-  void bc1f(int16_t offset, uint16_t cc = 0);
-  inline void bc1f(Label* L, uint16_t cc = 0) {
-    bc1f(shifted_branch_offset(L), cc);
-  }
-  void bc1t(int16_t offset, uint16_t cc = 0);
-  inline void bc1t(Label* L, uint16_t cc = 0) {
-    bc1t(shifted_branch_offset(L), cc);
-  }
-  void fcmp(FPURegister src1, const double src2, FPUCondition cond);
-
-  // MSA instructions
-  void bz_v(MSARegister wt, int16_t offset);
-  inline void bz_v(MSARegister wt, Label* L) {
-    bz_v(wt, shifted_branch_offset(L));
-  }
-  void bz_b(MSARegister wt, int16_t offset);
-  inline void bz_b(MSARegister wt, Label* L) {
-    bz_b(wt, shifted_branch_offset(L));
-  }
-  void bz_h(MSARegister wt, int16_t offset);
-  inline void bz_h(MSARegister wt, Label* L) {
-    bz_h(wt, shifted_branch_offset(L));
-  }
-  void bz_w(MSARegister wt, int16_t offset);
-  inline void bz_w(MSARegister wt, Label* L) {
-    bz_w(wt, shifted_branch_offset(L));
-  }
-  void bz_d(MSARegister wt, int16_t offset);
-  inline void bz_d(MSARegister wt, Label* L) {
-    bz_d(wt, shifted_branch_offset(L));
-  }
-  void bnz_v(MSARegister wt, int16_t offset);
-  inline void bnz_v(MSARegister wt, Label* L) {
-    bnz_v(wt, shifted_branch_offset(L));
-  }
-  void bnz_b(MSARegister wt, int16_t offset);
-  inline void bnz_b(MSARegister wt, Label* L) {
-    bnz_b(wt, shifted_branch_offset(L));
-  }
-  void bnz_h(MSARegister wt, int16_t offset);
-  inline void bnz_h(MSARegister wt, Label* L) {
-    bnz_h(wt, shifted_branch_offset(L));
-  }
-  void bnz_w(MSARegister wt, int16_t offset);
-  inline void bnz_w(MSARegister wt, Label* L) {
-    bnz_w(wt, shifted_branch_offset(L));
-  }
-  void bnz_d(MSARegister wt, int16_t offset);
-  inline void bnz_d(MSARegister wt, Label* L) {
-    bnz_d(wt, shifted_branch_offset(L));
-  }
-
-  void ld_b(MSARegister wd, const MemOperand& rs);
-  void ld_h(MSARegister wd, const MemOperand& rs);
-  void ld_w(MSARegister wd, const MemOperand& rs);
-  void ld_d(MSARegister wd, const MemOperand& rs);
-  void st_b(MSARegister wd, const MemOperand& rs);
-  void st_h(MSARegister wd, const MemOperand& rs);
-  void st_w(MSARegister wd, const MemOperand& rs);
-  void st_d(MSARegister wd, const MemOperand& rs);
-
-  void ldi_b(MSARegister wd, int32_t imm10);
-  void ldi_h(MSARegister wd, int32_t imm10);
-  void ldi_w(MSARegister wd, int32_t imm10);
-  void ldi_d(MSARegister wd, int32_t imm10);
-
-  void addvi_b(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void addvi_h(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void addvi_w(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void addvi_d(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void subvi_b(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void subvi_h(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void subvi_w(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void subvi_d(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void maxi_s_b(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void maxi_s_h(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void maxi_s_w(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void maxi_s_d(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void maxi_u_b(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void maxi_u_h(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void maxi_u_w(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void maxi_u_d(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void mini_s_b(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void mini_s_h(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void mini_s_w(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void mini_s_d(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void mini_u_b(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void mini_u_h(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void mini_u_w(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void mini_u_d(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void ceqi_b(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void ceqi_h(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void ceqi_w(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void ceqi_d(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clti_s_b(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clti_s_h(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clti_s_w(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clti_s_d(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clti_u_b(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clti_u_h(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clti_u_w(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clti_u_d(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clei_s_b(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clei_s_h(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clei_s_w(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clei_s_d(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clei_u_b(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clei_u_h(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clei_u_w(MSARegister wd, MSARegister ws, uint32_t imm5);
-  void clei_u_d(MSARegister wd, MSARegister ws, uint32_t imm5);
-
-  void andi_b(MSARegister wd, MSARegister ws, uint32_t imm8);
-  void ori_b(MSARegister wd, MSARegister ws, uint32_t imm8);
-  void nori_b(MSARegister wd, MSARegister ws, uint32_t imm8);
-  void xori_b(MSARegister wd, MSARegister ws, uint32_t imm8);
-  void bmnzi_b(MSARegister wd, MSARegister ws, uint32_t imm8);
-  void bmzi_b(MSARegister wd, MSARegister ws, uint32_t imm8);
-  void bseli_b(MSARegister wd, MSARegister ws, uint32_t imm8);
-  void shf_b(MSARegister wd, MSARegister ws, uint32_t imm8);
-  void shf_h(MSARegister wd, MSARegister ws, uint32_t imm8);
-  void shf_w(MSARegister wd, MSARegister ws, uint32_t imm8);
-
-  void and_v(MSARegister wd, MSARegister ws, MSARegister wt);
-  void or_v(MSARegister wd, MSARegister ws, MSARegister wt);
-  void nor_v(MSARegister wd, MSARegister ws, MSARegister wt);
-  void xor_v(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bmnz_v(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bmz_v(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bsel_v(MSARegister wd, MSARegister ws, MSARegister wt);
-
-  void fill_b(MSARegister wd, Register rs);
-  void fill_h(MSARegister wd, Register rs);
-  void fill_w(MSARegister wd, Register rs);
-  void fill_d(MSARegister wd, Register rs);
-  void pcnt_b(MSARegister wd, MSARegister ws);
-  void pcnt_h(MSARegister wd, MSARegister ws);
-  void pcnt_w(MSARegister wd, MSARegister ws);
-  void pcnt_d(MSARegister wd, MSARegister ws);
-  void nloc_b(MSARegister wd, MSARegister ws);
-  void nloc_h(MSARegister wd, MSARegister ws);
-  void nloc_w(MSARegister wd, MSARegister ws);
-  void nloc_d(MSARegister wd, MSARegister ws);
-  void nlzc_b(MSARegister wd, MSARegister ws);
-  void nlzc_h(MSARegister wd, MSARegister ws);
-  void nlzc_w(MSARegister wd, MSARegister ws);
-  void nlzc_d(MSARegister wd, MSARegister ws);
-
-  void fclass_w(MSARegister wd, MSARegister ws);
-  void fclass_d(MSARegister wd, MSARegister ws);
-  void ftrunc_s_w(MSARegister wd, MSARegister ws);
-  void ftrunc_s_d(MSARegister wd, MSARegister ws);
-  void ftrunc_u_w(MSARegister wd, MSARegister ws);
-  void ftrunc_u_d(MSARegister wd, MSARegister ws);
-  void fsqrt_w(MSARegister wd, MSARegister ws);
-  void fsqrt_d(MSARegister wd, MSARegister ws);
-  void frsqrt_w(MSARegister wd, MSARegister ws);
-  void frsqrt_d(MSARegister wd, MSARegister ws);
-  void frcp_w(MSARegister wd, MSARegister ws);
-  void frcp_d(MSARegister wd, MSARegister ws);
-  void frint_w(MSARegister wd, MSARegister ws);
-  void frint_d(MSARegister wd, MSARegister ws);
-  void flog2_w(MSARegister wd, MSARegister ws);
-  void flog2_d(MSARegister wd, MSARegister ws);
-  void fexupl_w(MSARegister wd, MSARegister ws);
-  void fexupl_d(MSARegister wd, MSARegister ws);
-  void fexupr_w(MSARegister wd, MSARegister ws);
-  void fexupr_d(MSARegister wd, MSARegister ws);
-  void ffql_w(MSARegister wd, MSARegister ws);
-  void ffql_d(MSARegister wd, MSARegister ws);
-  void ffqr_w(MSARegister wd, MSARegister ws);
-  void ffqr_d(MSARegister wd, MSARegister ws);
-  void ftint_s_w(MSARegister wd, MSARegister ws);
-  void ftint_s_d(MSARegister wd, MSARegister ws);
-  void ftint_u_w(MSARegister wd, MSARegister ws);
-  void ftint_u_d(MSARegister wd, MSARegister ws);
-  void ffint_s_w(MSARegister wd, MSARegister ws);
-  void ffint_s_d(MSARegister wd, MSARegister ws);
-  void ffint_u_w(MSARegister wd, MSARegister ws);
-  void ffint_u_d(MSARegister wd, MSARegister ws);
-
-  void sll_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void sll_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void sll_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void sll_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void sra_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void sra_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void sra_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void sra_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void srl_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void srl_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void srl_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void srl_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bclr_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bclr_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bclr_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bclr_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bset_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bset_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bset_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bset_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bneg_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bneg_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bneg_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void bneg_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void binsl_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void binsl_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void binsl_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void binsl_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void binsr_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void binsr_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void binsr_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void binsr_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void addv_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void addv_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void addv_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void addv_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subv_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subv_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subv_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subv_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void max_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void max_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void max_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void max_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void max_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void max_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void max_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void max_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void min_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void min_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void min_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void min_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void min_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void min_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void min_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void min_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void max_a_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void max_a_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void max_a_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void max_a_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void min_a_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void min_a_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void min_a_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void min_a_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ceq_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ceq_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ceq_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ceq_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void clt_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void clt_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void clt_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void clt_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void clt_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void clt_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void clt_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void clt_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void cle_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void cle_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void cle_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void cle_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void cle_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void cle_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void cle_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void cle_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void add_a_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void add_a_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void add_a_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void add_a_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void adds_a_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void adds_a_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void adds_a_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void adds_a_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void adds_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void adds_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void adds_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void adds_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void adds_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void adds_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void adds_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void adds_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ave_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ave_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ave_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ave_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ave_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ave_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ave_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ave_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void aver_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void aver_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void aver_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void aver_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void aver_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void aver_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void aver_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void aver_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subs_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subs_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subs_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subs_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subs_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subs_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subs_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subs_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsus_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsus_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsus_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsus_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsus_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsus_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsus_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsus_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsuu_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsuu_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsuu_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsuu_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsuu_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsuu_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsuu_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void subsuu_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void asub_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void asub_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void asub_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void asub_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void asub_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void asub_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void asub_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void asub_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mulv_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mulv_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mulv_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mulv_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void maddv_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void maddv_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void maddv_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void maddv_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void msubv_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void msubv_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void msubv_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void msubv_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void div_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void div_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void div_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void div_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void div_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void div_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void div_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void div_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mod_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mod_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mod_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mod_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mod_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mod_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mod_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mod_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dotp_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dotp_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dotp_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dotp_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dotp_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dotp_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dotp_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dotp_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpadd_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpadd_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpadd_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpadd_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpadd_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpadd_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpadd_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpadd_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpsub_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpsub_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpsub_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpsub_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpsub_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpsub_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpsub_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void dpsub_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void sld_b(MSARegister wd, MSARegister ws, Register rt);
-  void sld_h(MSARegister wd, MSARegister ws, Register rt);
-  void sld_w(MSARegister wd, MSARegister ws, Register rt);
-  void sld_d(MSARegister wd, MSARegister ws, Register rt);
-  void splat_b(MSARegister wd, MSARegister ws, Register rt);
-  void splat_h(MSARegister wd, MSARegister ws, Register rt);
-  void splat_w(MSARegister wd, MSARegister ws, Register rt);
-  void splat_d(MSARegister wd, MSARegister ws, Register rt);
-  void pckev_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void pckev_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void pckev_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void pckev_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void pckod_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void pckod_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void pckod_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void pckod_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvl_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvl_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvl_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvl_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvr_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvr_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvr_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvr_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvev_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvev_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvev_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvev_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvod_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvod_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvod_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ilvod_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void vshf_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void vshf_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void vshf_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void vshf_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void srar_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void srar_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void srar_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void srar_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void srlr_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void srlr_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void srlr_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void srlr_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hadd_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hadd_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hadd_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hadd_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hadd_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hadd_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hadd_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hadd_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hsub_s_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hsub_s_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hsub_s_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hsub_s_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hsub_u_b(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hsub_u_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hsub_u_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void hsub_u_d(MSARegister wd, MSARegister ws, MSARegister wt);
-
-  void fcaf_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcaf_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcun_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcun_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fceq_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fceq_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcueq_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcueq_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fclt_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fclt_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcult_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcult_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcle_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcle_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcule_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcule_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsaf_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsaf_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsun_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsun_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fseq_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fseq_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsueq_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsueq_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fslt_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fslt_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsult_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsult_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsle_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsle_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsule_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsule_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fadd_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fadd_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsub_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsub_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmul_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmul_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fdiv_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fdiv_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmadd_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmadd_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmsub_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmsub_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fexp2_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fexp2_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fexdo_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fexdo_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ftq_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void ftq_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmin_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmin_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmin_a_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmin_a_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmax_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmax_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmax_a_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fmax_a_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcor_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcor_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcune_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcune_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcne_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fcne_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mul_q_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mul_q_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void madd_q_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void madd_q_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void msub_q_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void msub_q_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsor_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsor_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsune_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsune_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsne_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void fsne_d(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mulr_q_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void mulr_q_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void maddr_q_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void maddr_q_w(MSARegister wd, MSARegister ws, MSARegister wt);
-  void msubr_q_h(MSARegister wd, MSARegister ws, MSARegister wt);
-  void msubr_q_w(MSARegister wd, MSARegister ws, MSARegister wt);
-
-  void sldi_b(MSARegister wd, MSARegister ws, uint32_t n);
-  void sldi_h(MSARegister wd, MSARegister ws, uint32_t n);
-  void sldi_w(MSARegister wd, MSARegister ws, uint32_t n);
-  void sldi_d(MSARegister wd, MSARegister ws, uint32_t n);
-  void splati_b(MSARegister wd, MSARegister ws, uint32_t n);
-  void splati_h(MSARegister wd, MSARegister ws, uint32_t n);
-  void splati_w(MSARegister wd, MSARegister ws, uint32_t n);
-  void splati_d(MSARegister wd, MSARegister ws, uint32_t n);
-  void copy_s_b(Register rd, MSARegister ws, uint32_t n);
-  void copy_s_h(Register rd, MSARegister ws, uint32_t n);
-  void copy_s_w(Register rd, MSARegister ws, uint32_t n);
-  void copy_s_d(Register rd, MSARegister ws, uint32_t n);
-  void copy_u_b(Register rd, MSARegister ws, uint32_t n);
-  void copy_u_h(Register rd, MSARegister ws, uint32_t n);
-  void copy_u_w(Register rd, MSARegister ws, uint32_t n);
-  void insert_b(MSARegister wd, uint32_t n, Register rs);
-  void insert_h(MSARegister wd, uint32_t n, Register rs);
-  void insert_w(MSARegister wd, uint32_t n, Register rs);
-  void insert_d(MSARegister wd, uint32_t n, Register rs);
-  void insve_b(MSARegister wd, uint32_t n, MSARegister ws);
-  void insve_h(MSARegister wd, uint32_t n, MSARegister ws);
-  void insve_w(MSARegister wd, uint32_t n, MSARegister ws);
-  void insve_d(MSARegister wd, uint32_t n, MSARegister ws);
-  void move_v(MSARegister wd, MSARegister ws);
-  void ctcmsa(MSAControlRegister cd, Register rs);
-  void cfcmsa(Register rd, MSAControlRegister cs);
-
-  void slli_b(MSARegister wd, MSARegister ws, uint32_t m);
-  void slli_h(MSARegister wd, MSARegister ws, uint32_t m);
-  void slli_w(MSARegister wd, MSARegister ws, uint32_t m);
-  void slli_d(MSARegister wd, MSARegister ws, uint32_t m);
-  void srai_b(MSARegister wd, MSARegister ws, uint32_t m);
-  void srai_h(MSARegister wd, MSARegister ws, uint32_t m);
-  void srai_w(MSARegister wd, MSARegister ws, uint32_t m);
-  void srai_d(MSARegister wd, MSARegister ws, uint32_t m);
-  void srli_b(MSARegister wd, MSARegister ws, uint32_t m);
-  void srli_h(MSARegister wd, MSARegister ws, uint32_t m);
-  void srli_w(MSARegister wd, MSARegister ws, uint32_t m);
-  void srli_d(MSARegister wd, MSARegister ws, uint32_t m);
-  void bclri_b(MSARegister wd, MSARegister ws, uint32_t m);
-  void bclri_h(MSARegister wd, MSARegister ws, uint32_t m);
-  void bclri_w(MSARegister wd, MSARegister ws, uint32_t m);
-  void bclri_d(MSARegister wd, MSARegister ws, uint32_t m);
-  void bseti_b(MSARegister wd, MSARegister ws, uint32_t m);
-  void bseti_h(MSARegister wd, MSARegister ws, uint32_t m);
-  void bseti_w(MSARegister wd, MSARegister ws, uint32_t m);
-  void bseti_d(MSARegister wd, MSARegister ws, uint32_t m);
-  void bnegi_b(MSARegister wd, MSARegister ws, uint32_t m);
-  void bnegi_h(MSARegister wd, MSARegister ws, uint32_t m);
-  void bnegi_w(MSARegister wd, MSARegister ws, uint32_t m);
-  void bnegi_d(MSARegister wd, MSARegister ws, uint32_t m);
-  void binsli_b(MSARegister wd, MSARegister ws, uint32_t m);
-  void binsli_h(MSARegister wd, MSARegister ws, uint32_t m);
-  void binsli_w(MSARegister wd, MSARegister ws, uint32_t m);
-  void binsli_d(MSARegister wd, MSARegister ws, uint32_t m);
-  void binsri_b(MSARegister wd, MSARegister ws, uint32_t m);
-  void binsri_h(MSARegister wd, MSARegister ws, uint32_t m);
-  void binsri_w(MSARegister wd, MSARegister ws, uint32_t m);
-  void binsri_d(MSARegister wd, MSARegister ws, uint32_t m);
-  void sat_s_b(MSARegister wd, MSARegister ws, uint32_t m);
-  void sat_s_h(MSARegister wd, MSARegister ws, uint32_t m);
-  void sat_s_w(MSARegister wd, MSARegister ws, uint32_t m);
-  void sat_s_d(MSARegister wd, MSARegister ws, uint32_t m);
-  void sat_u_b(MSARegister wd, MSARegister ws, uint32_t m);
-  void sat_u_h(MSARegister wd, MSARegister ws, uint32_t m);
-  void sat_u_w(MSARegister wd, MSARegister ws, uint32_t m);
-  void sat_u_d(MSARegister wd, MSARegister ws, uint32_t m);
-  void srari_b(MSARegister wd, MSARegister ws, uint32_t m);
-  void srari_h(MSARegister wd, MSARegister ws, uint32_t m);
-  void srari_w(MSARegister wd, MSARegister ws, uint32_t m);
-  void srari_d(MSARegister wd, MSARegister ws, uint32_t m);
-  void srlri_b(MSARegister wd, MSARegister ws, uint32_t m);
-  void srlri_h(MSARegister wd, MSARegister ws, uint32_t m);
-  void srlri_w(MSARegister wd, MSARegister ws, uint32_t m);
-  void srlri_d(MSARegister wd, MSARegister ws, uint32_t m);
-
-  // Check the code size generated from label to here.
-  int SizeOfCodeGeneratedSince(Label* label) {
-    return pc_offset() - label->pos();
-  }
-
-  // Check the number of instructions generated from label to here.
-  int InstructionsGeneratedSince(Label* label) {
-    return SizeOfCodeGeneratedSince(label) / kInstrSize;
-  }
-
-  // Class for scoping postponing the trampoline pool generation.
-  class BlockTrampolinePoolScope {
-   public:
-    explicit BlockTrampolinePoolScope(Assembler* assem) : assem_(assem) {
-      assem_->StartBlockTrampolinePool();
-    }
-    ~BlockTrampolinePoolScope() {
-      assem_->EndBlockTrampolinePool();
-    }
-
-   private:
-    Assembler* assem_;
-
-    DISALLOW_IMPLICIT_CONSTRUCTORS(BlockTrampolinePoolScope);
-  };
-
-  // Class for postponing the assembly buffer growth. Typically used for
-  // sequences of instructions that must be emitted as a unit, before
-  // buffer growth (and relocation) can occur.
-  // This blocking scope is not nestable.
-  class BlockGrowBufferScope {
-   public:
-    explicit BlockGrowBufferScope(Assembler* assem) : assem_(assem) {
-      assem_->StartBlockGrowBuffer();
-    }
-    ~BlockGrowBufferScope() {
-      assem_->EndBlockGrowBuffer();
-    }
-
-   private:
-    Assembler* assem_;
-
-    DISALLOW_IMPLICIT_CONSTRUCTORS(BlockGrowBufferScope);
-  };
-
-  // Record a comment relocation entry that can be used by a disassembler.
-  // Use --code-comments to enable.
-  void RecordComment(const char* msg);
-
-  // Record a deoptimization reason that can be used by a log or cpu profiler.
-  // Use --trace-deopt to enable.
-  void RecordDeoptReason(DeoptimizeReason reason, SourcePosition position,
-                         int id);
-
-  static int RelocateInternalReference(RelocInfo::Mode rmode, byte* pc,
-                                       intptr_t pc_delta);
-
-  // Writes a single byte or word of data in the code stream.  Used for
-  // inline tables, e.g., jump-tables.
-  void db(uint8_t data);
-  void dd(uint32_t data);
-  void dq(uint64_t data);
-  void dp(uintptr_t data) { dq(data); }
-  void dd(Label* label);
-
-  // Postpone the generation of the trampoline pool for the specified number of
-  // instructions.
-  void BlockTrampolinePoolFor(int instructions);
-
-  // Check if there is less than kGap bytes available in the buffer.
-  // If this is the case, we need to grow the buffer before emitting
-  // an instruction or relocation information.
-  inline bool overflow() const { return pc_ >= reloc_info_writer.pos() - kGap; }
-
-  // Get the number of bytes available in the buffer.
-  inline intptr_t available_space() const {
-    return reloc_info_writer.pos() - pc_;
-  }
-
-  // Read/patch instructions.
-  static Instr instr_at(byte* pc) { return *reinterpret_cast<Instr*>(pc); }
-  static void instr_at_put(byte* pc, Instr instr) {
-    *reinterpret_cast<Instr*>(pc) = instr;
-  }
-  Instr instr_at(int pos) { return *reinterpret_cast<Instr*>(buffer_ + pos); }
-  void instr_at_put(int pos, Instr instr) {
-    *reinterpret_cast<Instr*>(buffer_ + pos) = instr;
-  }
-
-  // Check if an instruction is a branch of some kind.
-  static bool IsBranch(Instr instr);
-  static bool IsMsaBranch(Instr instr);
-  static bool IsBc(Instr instr);
-  static bool IsBzc(Instr instr);
-
-  static bool IsBeq(Instr instr);
-  static bool IsBne(Instr instr);
-  static bool IsBeqzc(Instr instr);
-  static bool IsBnezc(Instr instr);
-  static bool IsBeqc(Instr instr);
-  static bool IsBnec(Instr instr);
-
-
-  static bool IsJump(Instr instr);
-  static bool IsJ(Instr instr);
-  static bool IsLui(Instr instr);
-  static bool IsOri(Instr instr);
-
-  static bool IsJal(Instr instr);
-  static bool IsJr(Instr instr);
-  static bool IsJalr(Instr instr);
-
-  static bool IsNop(Instr instr, unsigned int type);
-  static bool IsPop(Instr instr);
-  static bool IsPush(Instr instr);
-  static bool IsLwRegFpOffset(Instr instr);
-  static bool IsSwRegFpOffset(Instr instr);
-  static bool IsLwRegFpNegOffset(Instr instr);
-  static bool IsSwRegFpNegOffset(Instr instr);
-
-  static Register GetRtReg(Instr instr);
-  static Register GetRsReg(Instr instr);
-  static Register GetRdReg(Instr instr);
-
-  static uint32_t GetRt(Instr instr);
-  static uint32_t GetRtField(Instr instr);
-  static uint32_t GetRs(Instr instr);
-  static uint32_t GetRsField(Instr instr);
-  static uint32_t GetRd(Instr instr);
-  static uint32_t GetRdField(Instr instr);
-  static uint32_t GetSa(Instr instr);
-  static uint32_t GetSaField(Instr instr);
-  static uint32_t GetOpcodeField(Instr instr);
-  static uint32_t GetFunction(Instr instr);
-  static uint32_t GetFunctionField(Instr instr);
-  static uint32_t GetImmediate16(Instr instr);
-  static uint32_t GetLabelConst(Instr instr);
-
-  static int32_t GetBranchOffset(Instr instr);
-  static bool IsLw(Instr instr);
-  static int16_t GetLwOffset(Instr instr);
-  static Instr SetLwOffset(Instr instr, int16_t offset);
-
-  static bool IsSw(Instr instr);
-  static Instr SetSwOffset(Instr instr, int16_t offset);
-  static bool IsAddImmediate(Instr instr);
-  static Instr SetAddImmediateOffset(Instr instr, int16_t offset);
-
-  static bool IsAndImmediate(Instr instr);
-  static bool IsEmittedConstant(Instr instr);
-
-  void CheckTrampolinePool();
-
-  void PatchConstantPoolAccessInstruction(int pc_offset, int offset,
-                                          ConstantPoolEntry::Access access,
-                                          ConstantPoolEntry::Type type) {
-    // No embedded constant pool support.
-    UNREACHABLE();
-  }
-
-  bool IsPrevInstrCompactBranch() { return prev_instr_compact_branch_; }
-  static bool IsCompactBranchSupported() { return kArchVariant == kMips64r6; }
-
-  inline int UnboundLabelsCount() { return unbound_labels_count_; }
-
- protected:
-  // Load Scaled Address instructions.
-  void lsa(Register rd, Register rt, Register rs, uint8_t sa);
-  void dlsa(Register rd, Register rt, Register rs, uint8_t sa);
-
-  // Readable constants for base and offset adjustment helper, these indicate if
-  // aside from offset, another value like offset + 4 should fit into int16.
-  enum class OffsetAccessType : bool {
-    SINGLE_ACCESS = false,
-    TWO_ACCESSES = true
-  };
-
-  // Helper function for memory load/store using base register and offset.
-  void AdjustBaseAndOffset(
-      MemOperand& src,
-      OffsetAccessType access_type = OffsetAccessType::SINGLE_ACCESS,
-      int second_access_add_to_offset = 4);
-
-  inline static void set_target_internal_reference_encoded_at(Address pc,
-                                                              Address target);
-
-  int64_t buffer_space() const { return reloc_info_writer.pos() - pc_; }
-
-  // Decode branch instruction at pos and return branch target pos.
-  int target_at(int pos, bool is_internal);
-
-  // Patch branch instruction at pos to branch to given branch target pos.
-  void target_at_put(int pos, int target_pos, bool is_internal);
-
-  // Say if we need to relocate with this mode.
-  bool MustUseReg(RelocInfo::Mode rmode);
-
-  // Record reloc info for current pc_.
-  void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0);
-
-  // Block the emission of the trampoline pool before pc_offset.
-  void BlockTrampolinePoolBefore(int pc_offset) {
-    if (no_trampoline_pool_before_ < pc_offset)
-      no_trampoline_pool_before_ = pc_offset;
-  }
-
-  void StartBlockTrampolinePool() {
-    trampoline_pool_blocked_nesting_++;
-  }
-
-  void EndBlockTrampolinePool() {
-    trampoline_pool_blocked_nesting_--;
-  }
-
-  bool is_trampoline_pool_blocked() const {
-    return trampoline_pool_blocked_nesting_ > 0;
-  }
-
-  bool has_exception() const {
-    return internal_trampoline_exception_;
-  }
-
-  void DoubleAsTwoUInt32(double d, uint32_t* lo, uint32_t* hi);
-
-  bool is_trampoline_emitted() const {
-    return trampoline_emitted_;
-  }
-
-  // Temporarily block automatic assembly buffer growth.
-  void StartBlockGrowBuffer() {
-    DCHECK(!block_buffer_growth_);
-    block_buffer_growth_ = true;
-  }
-
-  void EndBlockGrowBuffer() {
-    DCHECK(block_buffer_growth_);
-    block_buffer_growth_ = false;
-  }
-
-  bool is_buffer_growth_blocked() const {
-    return block_buffer_growth_;
-  }
-
-  void EmitForbiddenSlotInstruction() {
-    if (IsPrevInstrCompactBranch()) {
-      nop();
-    }
-  }
-
-  inline void CheckTrampolinePoolQuick(int extra_instructions = 0);
-
- private:
-  // Avoid overflows for displacements etc.
-  static const int kMaximalBufferSize = 512 * MB;
-
-  // Buffer size and constant pool distance are checked together at regular
-  // intervals of kBufferCheckInterval emitted bytes.
-  static constexpr int kBufferCheckInterval = 1 * KB / 2;
-
-  // Code generation.
-  // The relocation writer's position is at least kGap bytes below the end of
-  // the generated instructions. This is so that multi-instruction sequences do
-  // not have to check for overflow. The same is true for writes of large
-  // relocation info entries.
-  static constexpr int kGap = 128;
-
-  // Repeated checking whether the trampoline pool should be emitted is rather
-  // expensive. By default we only check again once a number of instructions
-  // has been generated.
-  static constexpr int kCheckConstIntervalInst = 32;
-  static constexpr int kCheckConstInterval =
-      kCheckConstIntervalInst * kInstrSize;
-
-  int next_buffer_check_;  // pc offset of next buffer check.
-
-  // Emission of the trampoline pool may be blocked in some code sequences.
-  int trampoline_pool_blocked_nesting_;  // Block emission if this is not zero.
-  int no_trampoline_pool_before_;  // Block emission before this pc offset.
-
-  // Keep track of the last emitted pool to guarantee a maximal distance.
-  int last_trampoline_pool_end_;  // pc offset of the end of the last pool.
-
-  // Automatic growth of the assembly buffer may be blocked for some sequences.
-  bool block_buffer_growth_;  // Block growth when true.
-
-  // Relocation information generation.
-  // Each relocation is encoded as a variable size value.
-  static constexpr int kMaxRelocSize = RelocInfoWriter::kMaxSize;
-  RelocInfoWriter reloc_info_writer;
-
-  // The bound position, before this we cannot do instruction elimination.
-  int last_bound_pos_;
-
-  // Readable constants for compact branch handling in emit()
-  enum class CompactBranchType : bool { NO = false, COMPACT_BRANCH = true };
-
-  // Code emission.
-  inline void CheckBuffer();
-  void GrowBuffer();
-  inline void emit(Instr x,
-                   CompactBranchType is_compact_branch = CompactBranchType::NO);
-  inline void emit(uint64_t x);
-  inline void CheckForEmitInForbiddenSlot();
-  template <typename T>
-  inline void EmitHelper(T x);
-  inline void EmitHelper(Instr x, CompactBranchType is_compact_branch);
-
-  // Instruction generation.
-  // We have 3 different kind of encoding layout on MIPS.
-  // However due to many different types of objects encoded in the same fields
-  // we have quite a few aliases for each mode.
-  // Using the same structure to refer to Register and FPURegister would spare a
-  // few aliases, but mixing both does not look clean to me.
-  // Anyway we could surely implement this differently.
-
-  void GenInstrRegister(Opcode opcode, Register rs, Register rt, Register rd,
-                        uint16_t sa = 0, SecondaryField func = nullptrSF);
-
-  void GenInstrRegister(Opcode opcode,
-                        Register rs,
-                        Register rt,
-                        uint16_t msb,
-                        uint16_t lsb,
-                        SecondaryField func);
-
-  void GenInstrRegister(Opcode opcode, SecondaryField fmt, FPURegister ft,
-                        FPURegister fs, FPURegister fd,
-                        SecondaryField func = nullptrSF);
-
-  void GenInstrRegister(Opcode opcode, FPURegister fr, FPURegister ft,
-                        FPURegister fs, FPURegister fd,
-                        SecondaryField func = nullptrSF);
-
-  void GenInstrRegister(Opcode opcode, SecondaryField fmt, Register rt,
-                        FPURegister fs, FPURegister fd,
-                        SecondaryField func = nullptrSF);
-
-  void GenInstrRegister(Opcode opcode, SecondaryField fmt, Register rt,
-                        FPUControlRegister fs, SecondaryField func = nullptrSF);
-
-  void GenInstrImmediate(
-      Opcode opcode, Register rs, Register rt, int32_t j,
-      CompactBranchType is_compact_branch = CompactBranchType::NO);
-  void GenInstrImmediate(
-      Opcode opcode, Register rs, SecondaryField SF, int32_t j,
-      CompactBranchType is_compact_branch = CompactBranchType::NO);
-  void GenInstrImmediate(
-      Opcode opcode, Register r1, FPURegister r2, int32_t j,
-      CompactBranchType is_compact_branch = CompactBranchType::NO);
-  void GenInstrImmediate(Opcode opcode, Register base, Register rt,
-                         int32_t offset9, int bit6, SecondaryField func);
-  void GenInstrImmediate(
-      Opcode opcode, Register rs, int32_t offset21,
-      CompactBranchType is_compact_branch = CompactBranchType::NO);
-  void GenInstrImmediate(Opcode opcode, Register rs, uint32_t offset21);
-  void GenInstrImmediate(
-      Opcode opcode, int32_t offset26,
-      CompactBranchType is_compact_branch = CompactBranchType::NO);
-
-  void GenInstrJump(Opcode opcode,
-                     uint32_t address);
-
-  // MSA
-  void GenInstrMsaI8(SecondaryField operation, uint32_t imm8, MSARegister ws,
-                     MSARegister wd);
-
-  void GenInstrMsaI5(SecondaryField operation, SecondaryField df, int32_t imm5,
-                     MSARegister ws, MSARegister wd);
-
-  void GenInstrMsaBit(SecondaryField operation, SecondaryField df, uint32_t m,
-                      MSARegister ws, MSARegister wd);
-
-  void GenInstrMsaI10(SecondaryField operation, SecondaryField df,
-                      int32_t imm10, MSARegister wd);
-
-  template <typename RegType>
-  void GenInstrMsa3R(SecondaryField operation, SecondaryField df, RegType t,
-                     MSARegister ws, MSARegister wd);
-
-  template <typename DstType, typename SrcType>
-  void GenInstrMsaElm(SecondaryField operation, SecondaryField df, uint32_t n,
-                      SrcType src, DstType dst);
-
-  void GenInstrMsa3RF(SecondaryField operation, uint32_t df, MSARegister wt,
-                      MSARegister ws, MSARegister wd);
-
-  void GenInstrMsaVec(SecondaryField operation, MSARegister wt, MSARegister ws,
-                      MSARegister wd);
-
-  void GenInstrMsaMI10(SecondaryField operation, int32_t s10, Register rs,
-                       MSARegister wd);
-
-  void GenInstrMsa2R(SecondaryField operation, SecondaryField df,
-                     MSARegister ws, MSARegister wd);
-
-  void GenInstrMsa2RF(SecondaryField operation, SecondaryField df,
-                      MSARegister ws, MSARegister wd);
-
-  void GenInstrMsaBranch(SecondaryField operation, MSARegister wt,
-                         int32_t offset16);
-
-  inline bool is_valid_msa_df_m(SecondaryField bit_df, uint32_t m) {
-    switch (bit_df) {
-      case BIT_DF_b:
-        return is_uint3(m);
-      case BIT_DF_h:
-        return is_uint4(m);
-      case BIT_DF_w:
-        return is_uint5(m);
-      case BIT_DF_d:
-        return is_uint6(m);
-      default:
-        return false;
-    }
-  }
-
-  inline bool is_valid_msa_df_n(SecondaryField elm_df, uint32_t n) {
-    switch (elm_df) {
-      case ELM_DF_B:
-        return is_uint4(n);
-      case ELM_DF_H:
-        return is_uint3(n);
-      case ELM_DF_W:
-        return is_uint2(n);
-      case ELM_DF_D:
-        return is_uint1(n);
-      default:
-        return false;
-    }
-  }
-
-  // Labels.
-  void print(const Label* L);
-  void bind_to(Label* L, int pos);
-  void next(Label* L, bool is_internal);
-
-  // One trampoline consists of:
-  // - space for trampoline slots,
-  // - space for labels.
-  //
-  // Space for trampoline slots is equal to slot_count * 2 * kInstrSize.
-  // Space for trampoline slots precedes space for labels. Each label is of one
-  // instruction size, so total amount for labels is equal to
-  // label_count *  kInstrSize.
-  class Trampoline {
-   public:
-    Trampoline() {
-      start_ = 0;
-      next_slot_ = 0;
-      free_slot_count_ = 0;
-      end_ = 0;
-    }
-    Trampoline(int start, int slot_count) {
-      start_ = start;
-      next_slot_ = start;
-      free_slot_count_ = slot_count;
-      end_ = start + slot_count * kTrampolineSlotsSize;
-    }
-    int start() {
-      return start_;
-    }
-    int end() {
-      return end_;
-    }
-    int take_slot() {
-      int trampoline_slot = kInvalidSlotPos;
-      if (free_slot_count_ <= 0) {
-        // We have run out of space on trampolines.
-        // Make sure we fail in debug mode, so we become aware of each case
-        // when this happens.
-        DCHECK(0);
-        // Internal exception will be caught.
-      } else {
-        trampoline_slot = next_slot_;
-        free_slot_count_--;
-        next_slot_ += kTrampolineSlotsSize;
-      }
-      return trampoline_slot;
-    }
-
-   private:
-    int start_;
-    int end_;
-    int next_slot_;
-    int free_slot_count_;
-  };
-
-  int32_t get_trampoline_entry(int32_t pos);
-  int unbound_labels_count_;
-  // After trampoline is emitted, long branches are used in generated code for
-  // the forward branches whose target offsets could be beyond reach of branch
-  // instruction. We use this information to trigger different mode of
-  // branch instruction generation, where we use jump instructions rather
-  // than regular branch instructions.
-  bool trampoline_emitted_;
-  static constexpr int kInvalidSlotPos = -1;
-
-  // Internal reference positions, required for unbounded internal reference
-  // labels.
-  std::set<int64_t> internal_reference_positions_;
-  bool is_internal_reference(Label* L) {
-    return internal_reference_positions_.find(L->pos()) !=
-           internal_reference_positions_.end();
-  }
-
-  void EmittedCompactBranchInstruction() { prev_instr_compact_branch_ = true; }
-  void ClearCompactBranchState() { prev_instr_compact_branch_ = false; }
-  bool prev_instr_compact_branch_ = false;
-
-  Trampoline trampoline_;
-  bool internal_trampoline_exception_;
-
-  RegList scratch_register_list_;
-
-  // The following functions help with avoiding allocations of embedded heap
-  // objects during the code assembly phase. {RequestHeapObject} records the
-  // need for a future heap number allocation or code stub generation. After
-  // code assembly, {AllocateAndInstallRequestedHeapObjects} will allocate these
-  // objects and place them where they are expected (determined by the pc offset
-  // associated with each request). That is, for each request, it will patch the
-  // dummy heap object handle that we emitted during code assembly with the
-  // actual heap object handle.
- protected:
-  // TODO(neis): Make private if its use can be moved out of TurboAssembler.
-  void RequestHeapObject(HeapObjectRequest request);
-
- private:
-  void AllocateAndInstallRequestedHeapObjects(Isolate* isolate);
-
-  std::forward_list<HeapObjectRequest> heap_object_requests_;
-
-  friend class RegExpMacroAssemblerMIPS;
-  friend class RelocInfo;
-  friend class BlockTrampolinePoolScope;
-  friend class EnsureSpace;
-};
-
-
-class EnsureSpace BASE_EMBEDDED {
- public:
-  explicit inline EnsureSpace(Assembler* assembler);
-};
-
-class UseScratchRegisterScope {
- public:
-  explicit UseScratchRegisterScope(Assembler* assembler);
-  ~UseScratchRegisterScope();
-
-  Register Acquire();
-  bool hasAvailable() const;
-
- private:
-  RegList* available_;
-  RegList old_available_;
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_ARM_ASSEMBLER_MIPS_H_
diff --git a/src/v8/src/mips64/code-stubs-mips64.cc b/src/v8/src/mips64/code-stubs-mips64.cc
deleted file mode 100644
index f807588..0000000
--- a/src/v8/src/mips64/code-stubs-mips64.cc
+++ /dev/null
@@ -1,1308 +0,0 @@
-// Copyright 2012 the V8 project 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 V8_TARGET_ARCH_MIPS64
-
-#include "src/api-arguments.h"
-#include "src/bootstrapper.h"
-#include "src/code-stubs.h"
-#include "src/frame-constants.h"
-#include "src/frames.h"
-#include "src/heap/heap-inl.h"
-#include "src/ic/ic.h"
-#include "src/ic/stub-cache.h"
-#include "src/isolate.h"
-#include "src/regexp/jsregexp.h"
-#include "src/regexp/regexp-macro-assembler.h"
-#include "src/runtime/runtime.h"
-
-#include "src/mips64/code-stubs-mips64.h"  // Cannot be the first include.
-
-namespace v8 {
-namespace internal {
-
-#define __ ACCESS_MASM(masm)
-
-void ArrayNArgumentsConstructorStub::Generate(MacroAssembler* masm) {
-  __ dsll(t9, a0, kPointerSizeLog2);
-  __ Daddu(t9, sp, t9);
-  __ Sd(a1, MemOperand(t9, 0));
-  __ Push(a1);
-  __ Push(a2);
-  __ Daddu(a0, a0, 3);
-  __ TailCallRuntime(Runtime::kNewArray);
-}
-
-
-void DoubleToIStub::Generate(MacroAssembler* masm) {
-  Label out_of_range, only_low, negate, done;
-  Register result_reg = destination();
-
-  Register scratch = GetRegisterThatIsNotOneOf(result_reg);
-  Register scratch2 = GetRegisterThatIsNotOneOf(result_reg, scratch);
-  Register scratch3 = GetRegisterThatIsNotOneOf(result_reg, scratch, scratch2);
-  DoubleRegister double_scratch = kLithiumScratchDouble;
-
-  // Account for saved regs.
-  const int kArgumentOffset = 3 * kPointerSize;
-
-  __ Push(scratch, scratch2, scratch3);
-
-  // Load double input.
-  __ Ldc1(double_scratch, MemOperand(sp, kArgumentOffset));
-
-  // Clear cumulative exception flags and save the FCSR.
-  __ cfc1(scratch2, FCSR);
-  __ ctc1(zero_reg, FCSR);
-
-  // Try a conversion to a signed integer.
-  __ Trunc_w_d(double_scratch, double_scratch);
-  // Move the converted value into the result register.
-  __ mfc1(scratch3, double_scratch);
-
-  // Retrieve and restore the FCSR.
-  __ cfc1(scratch, FCSR);
-  __ ctc1(scratch2, FCSR);
-
-  // Check for overflow and NaNs.
-  __ And(
-      scratch, scratch,
-      kFCSROverflowFlagMask | kFCSRUnderflowFlagMask | kFCSRInvalidOpFlagMask);
-  // If we had no exceptions then set result_reg and we are done.
-  Label error;
-  __ Branch(&error, ne, scratch, Operand(zero_reg));
-  __ Move(result_reg, scratch3);
-  __ Branch(&done);
-  __ bind(&error);
-
-  // Load the double value and perform a manual truncation.
-  Register input_high = scratch2;
-  Register input_low = scratch3;
-
-  __ Lw(input_low, MemOperand(sp, kArgumentOffset + Register::kMantissaOffset));
-  __ Lw(input_high,
-        MemOperand(sp, kArgumentOffset + Register::kExponentOffset));
-
-  Label normal_exponent, restore_sign;
-  // Extract the biased exponent in result.
-  __ Ext(result_reg,
-         input_high,
-         HeapNumber::kExponentShift,
-         HeapNumber::kExponentBits);
-
-  // Check for Infinity and NaNs, which should return 0.
-  __ Subu(scratch, result_reg, HeapNumber::kExponentMask);
-  __ Movz(result_reg, zero_reg, scratch);
-  __ Branch(&done, eq, scratch, Operand(zero_reg));
-
-  // Express exponent as delta to (number of mantissa bits + 31).
-  __ Subu(result_reg,
-          result_reg,
-          Operand(HeapNumber::kExponentBias + HeapNumber::kMantissaBits + 31));
-
-  // If the delta is strictly positive, all bits would be shifted away,
-  // which means that we can return 0.
-  __ Branch(&normal_exponent, le, result_reg, Operand(zero_reg));
-  __ mov(result_reg, zero_reg);
-  __ Branch(&done);
-
-  __ bind(&normal_exponent);
-  const int kShiftBase = HeapNumber::kNonMantissaBitsInTopWord - 1;
-  // Calculate shift.
-  __ Addu(scratch, result_reg, Operand(kShiftBase + HeapNumber::kMantissaBits));
-
-  // Save the sign.
-  Register sign = result_reg;
-  result_reg = no_reg;
-  __ And(sign, input_high, Operand(HeapNumber::kSignMask));
-
-  // On ARM shifts > 31 bits are valid and will result in zero. On MIPS we need
-  // to check for this specific case.
-  Label high_shift_needed, high_shift_done;
-  __ Branch(&high_shift_needed, lt, scratch, Operand(32));
-  __ mov(input_high, zero_reg);
-  __ Branch(&high_shift_done);
-  __ bind(&high_shift_needed);
-
-  // Set the implicit 1 before the mantissa part in input_high.
-  __ Or(input_high,
-        input_high,
-        Operand(1 << HeapNumber::kMantissaBitsInTopWord));
-  // Shift the mantissa bits to the correct position.
-  // We don't need to clear non-mantissa bits as they will be shifted away.
-  // If they weren't, it would mean that the answer is in the 32bit range.
-  __ sllv(input_high, input_high, scratch);
-
-  __ bind(&high_shift_done);
-
-  // Replace the shifted bits with bits from the lower mantissa word.
-  Label pos_shift, shift_done;
-  __ li(at, 32);
-  __ subu(scratch, at, scratch);
-  __ Branch(&pos_shift, ge, scratch, Operand(zero_reg));
-
-  // Negate scratch.
-  __ Subu(scratch, zero_reg, scratch);
-  __ sllv(input_low, input_low, scratch);
-  __ Branch(&shift_done);
-
-  __ bind(&pos_shift);
-  __ srlv(input_low, input_low, scratch);
-
-  __ bind(&shift_done);
-  __ Or(input_high, input_high, Operand(input_low));
-  // Restore sign if necessary.
-  __ mov(scratch, sign);
-  result_reg = sign;
-  sign = no_reg;
-  __ Subu(result_reg, zero_reg, input_high);
-  __ Movz(result_reg, input_high, scratch);
-
-  __ bind(&done);
-
-  __ Pop(scratch, scratch2, scratch3);
-  __ Ret();
-}
-
-
-void MathPowStub::Generate(MacroAssembler* masm) {
-  const Register exponent = MathPowTaggedDescriptor::exponent();
-  DCHECK(exponent == a2);
-  const DoubleRegister double_base = f2;
-  const DoubleRegister double_exponent = f4;
-  const DoubleRegister double_result = f0;
-  const DoubleRegister double_scratch = f6;
-  const FPURegister single_scratch = f8;
-  const Register scratch = t1;
-  const Register scratch2 = a7;
-
-  Label call_runtime, done, int_exponent;
-  if (exponent_type() == TAGGED) {
-    // Base is already in double_base.
-    __ UntagAndJumpIfSmi(scratch, exponent, &int_exponent);
-
-    __ Ldc1(double_exponent,
-            FieldMemOperand(exponent, HeapNumber::kValueOffset));
-  }
-
-  if (exponent_type() != INTEGER) {
-    Label int_exponent_convert;
-    // Detect integer exponents stored as double.
-    __ EmitFPUTruncate(kRoundToMinusInf,
-                       scratch,
-                       double_exponent,
-                       at,
-                       double_scratch,
-                       scratch2,
-                       kCheckForInexactConversion);
-    // scratch2 == 0 means there was no conversion error.
-    __ Branch(&int_exponent_convert, eq, scratch2, Operand(zero_reg));
-
-    __ push(ra);
-    {
-      AllowExternalCallThatCantCauseGC scope(masm);
-      __ PrepareCallCFunction(0, 2, scratch2);
-      __ MovToFloatParameters(double_base, double_exponent);
-      __ CallCFunction(
-          ExternalReference::power_double_double_function(isolate()),
-          0, 2);
-    }
-    __ pop(ra);
-    __ MovFromFloatResult(double_result);
-    __ jmp(&done);
-
-    __ bind(&int_exponent_convert);
-  }
-
-  // Calculate power with integer exponent.
-  __ bind(&int_exponent);
-
-  // Get two copies of exponent in the registers scratch and exponent.
-  if (exponent_type() == INTEGER) {
-    __ mov(scratch, exponent);
-  } else {
-    // Exponent has previously been stored into scratch as untagged integer.
-    __ mov(exponent, scratch);
-  }
-
-  __ mov_d(double_scratch, double_base);  // Back up base.
-  __ Move(double_result, 1.0);
-
-  // Get absolute value of exponent.
-  Label positive_exponent, bail_out;
-  __ Branch(&positive_exponent, ge, scratch, Operand(zero_reg));
-  __ Dsubu(scratch, zero_reg, scratch);
-  // Check when Dsubu overflows and we get negative result
-  // (happens only when input is MIN_INT).
-  __ Branch(&bail_out, gt, zero_reg, Operand(scratch));
-  __ bind(&positive_exponent);
-  __ Assert(ge, AbortReason::kUnexpectedNegativeValue, scratch,
-            Operand(zero_reg));
-
-  Label while_true, no_carry, loop_end;
-  __ bind(&while_true);
-
-  __ And(scratch2, scratch, 1);
-
-  __ Branch(&no_carry, eq, scratch2, Operand(zero_reg));
-  __ mul_d(double_result, double_result, double_scratch);
-  __ bind(&no_carry);
-
-  __ dsra(scratch, scratch, 1);
-
-  __ Branch(&loop_end, eq, scratch, Operand(zero_reg));
-  __ mul_d(double_scratch, double_scratch, double_scratch);
-
-  __ Branch(&while_true);
-
-  __ bind(&loop_end);
-
-  __ Branch(&done, ge, exponent, Operand(zero_reg));
-  __ Move(double_scratch, 1.0);
-  __ div_d(double_result, double_scratch, double_result);
-  // Test whether result is zero.  Bail out to check for subnormal result.
-  // Due to subnormals, x^-y == (1/x)^y does not hold in all cases.
-  __ BranchF(&done, nullptr, ne, double_result, kDoubleRegZero);
-
-  // double_exponent may not contain the exponent value if the input was a
-  // smi.  We set it with exponent value before bailing out.
-  __ bind(&bail_out);
-  __ mtc1(exponent, single_scratch);
-  __ cvt_d_w(double_exponent, single_scratch);
-
-  // Returning or bailing out.
-  __ push(ra);
-  {
-    AllowExternalCallThatCantCauseGC scope(masm);
-    __ PrepareCallCFunction(0, 2, scratch);
-    __ MovToFloatParameters(double_base, double_exponent);
-    __ CallCFunction(ExternalReference::power_double_double_function(isolate()),
-                     0, 2);
-  }
-  __ pop(ra);
-  __ MovFromFloatResult(double_result);
-
-  __ bind(&done);
-  __ Ret();
-}
-
-Movability CEntryStub::NeedsImmovableCode() { return kImmovable; }
-
-void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) {
-  CEntryStub::GenerateAheadOfTime(isolate);
-  CommonArrayConstructorStub::GenerateStubsAheadOfTime(isolate);
-  StoreFastElementStub::GenerateAheadOfTime(isolate);
-}
-
-
-void CodeStub::GenerateFPStubs(Isolate* isolate) {
-  // Generate if not already in cache.
-  SaveFPRegsMode mode = kSaveFPRegs;
-  CEntryStub(isolate, 1, mode).GetCode();
-}
-
-
-void CEntryStub::GenerateAheadOfTime(Isolate* isolate) {
-  CEntryStub stub(isolate, 1, kDontSaveFPRegs);
-  stub.GetCode();
-  CEntryStub save_doubles(isolate, 1, kSaveFPRegs);
-  save_doubles.GetCode();
-}
-
-
-void CEntryStub::Generate(MacroAssembler* masm) {
-  // Called from JavaScript; parameters are on stack as if calling JS function
-  // a0: number of arguments including receiver
-  // a1: pointer to builtin function
-  // fp: frame pointer    (restored after C call)
-  // sp: stack pointer    (restored as callee's sp after C call)
-  // cp: current context  (C callee-saved)
-  //
-  // If argv_in_register():
-  // a2: pointer to the first argument
-
-  ProfileEntryHookStub::MaybeCallEntryHook(masm);
-
-  if (argv_in_register()) {
-    // Move argv into the correct register.
-    __ mov(s1, a2);
-  } else {
-    // Compute the argv pointer in a callee-saved register.
-    __ Dlsa(s1, sp, a0, kPointerSizeLog2);
-    __ Dsubu(s1, s1, kPointerSize);
-  }
-
-  // Enter the exit frame that transitions from JavaScript to C++.
-  FrameScope scope(masm, StackFrame::MANUAL);
-  __ EnterExitFrame(save_doubles(), 0, is_builtin_exit()
-                                           ? StackFrame::BUILTIN_EXIT
-                                           : StackFrame::EXIT);
-
-  // s0: number of arguments  including receiver (C callee-saved)
-  // s1: pointer to first argument (C callee-saved)
-  // s2: pointer to builtin function (C callee-saved)
-
-  // Prepare arguments for C routine.
-  // a0 = argc
-  __ mov(s0, a0);
-  __ mov(s2, a1);
-
-  // We are calling compiled C/C++ code. a0 and a1 hold our two arguments. We
-  // also need to reserve the 4 argument slots on the stack.
-
-  __ AssertStackIsAligned();
-
-  // a0 = argc, a1 = argv, a2 = isolate
-  __ li(a2, Operand(ExternalReference::isolate_address(isolate())));
-  __ mov(a1, s1);
-
-  // To let the GC traverse the return address of the exit frames, we need to
-  // know where the return address is. The CEntryStub is unmovable, so
-  // we can store the address on the stack to be able to find it again and
-  // we never have to restore it, because it will not change.
-  { Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm);
-    int kNumInstructionsToJump = 4;
-    Label find_ra;
-    // Adjust the value in ra to point to the correct return location, 2nd
-    // instruction past the real call into C code (the jalr(t9)), and push it.
-    // This is the return address of the exit frame.
-    if (kArchVariant >= kMips64r6) {
-      __ addiupc(ra, kNumInstructionsToJump + 1);
-    } else {
-      // This branch-and-link sequence is needed to find the current PC on mips
-      // before r6, saved to the ra register.
-      __ bal(&find_ra);  // bal exposes branch delay slot.
-      __ Daddu(ra, ra, kNumInstructionsToJump * Instruction::kInstrSize);
-    }
-    __ bind(&find_ra);
-
-    // This spot was reserved in EnterExitFrame.
-    __ Sd(ra, MemOperand(sp));
-    // Stack space reservation moved to the branch delay slot below.
-    // Stack is still aligned.
-
-    // Call the C routine.
-    __ mov(t9, s2);  // Function pointer to t9 to conform to ABI for PIC.
-    __ jalr(t9);
-    // Set up sp in the delay slot.
-    __ daddiu(sp, sp, -kCArgsSlotsSize);
-    // Make sure the stored 'ra' points to this position.
-    DCHECK_EQ(kNumInstructionsToJump,
-              masm->InstructionsGeneratedSince(&find_ra));
-  }
-
-  // Result returned in v0 or v1:v0 - do not destroy these registers!
-
-  // Check result for exception sentinel.
-  Label exception_returned;
-  __ LoadRoot(a4, Heap::kExceptionRootIndex);
-  __ Branch(&exception_returned, eq, a4, Operand(v0));
-
-  // Check that there is no pending exception, otherwise we
-  // should have returned the exception sentinel.
-  if (FLAG_debug_code) {
-    Label okay;
-    ExternalReference pending_exception_address(
-        IsolateAddressId::kPendingExceptionAddress, isolate());
-    __ li(a2, Operand(pending_exception_address));
-    __ Ld(a2, MemOperand(a2));
-    __ LoadRoot(a4, Heap::kTheHoleValueRootIndex);
-    // Cannot use check here as it attempts to generate call into runtime.
-    __ Branch(&okay, eq, a4, Operand(a2));
-    __ stop("Unexpected pending exception");
-    __ bind(&okay);
-  }
-
-  // Exit C frame and return.
-  // v0:v1: result
-  // sp: stack pointer
-  // fp: frame pointer
-  Register argc = argv_in_register()
-                      // We don't want to pop arguments so set argc to no_reg.
-                      ? no_reg
-                      // s0: still holds argc (callee-saved).
-                      : s0;
-  __ LeaveExitFrame(save_doubles(), argc, EMIT_RETURN);
-
-  // Handling of exception.
-  __ bind(&exception_returned);
-
-  ExternalReference pending_handler_context_address(
-      IsolateAddressId::kPendingHandlerContextAddress, isolate());
-  ExternalReference pending_handler_entrypoint_address(
-      IsolateAddressId::kPendingHandlerEntrypointAddress, isolate());
-  ExternalReference pending_handler_fp_address(
-      IsolateAddressId::kPendingHandlerFPAddress, isolate());
-  ExternalReference pending_handler_sp_address(
-      IsolateAddressId::kPendingHandlerSPAddress, isolate());
-
-  // Ask the runtime for help to determine the handler. This will set v0 to
-  // contain the current pending exception, don't clobber it.
-  ExternalReference find_handler(Runtime::kUnwindAndFindExceptionHandler,
-                                 isolate());
-  {
-    FrameScope scope(masm, StackFrame::MANUAL);
-    __ PrepareCallCFunction(3, 0, a0);
-    __ mov(a0, zero_reg);
-    __ mov(a1, zero_reg);
-    __ li(a2, Operand(ExternalReference::isolate_address(isolate())));
-    __ CallCFunction(find_handler, 3);
-  }
-
-  // Retrieve the handler context, SP and FP.
-  __ li(cp, Operand(pending_handler_context_address));
-  __ Ld(cp, MemOperand(cp));
-  __ li(sp, Operand(pending_handler_sp_address));
-  __ Ld(sp, MemOperand(sp));
-  __ li(fp, Operand(pending_handler_fp_address));
-  __ Ld(fp, MemOperand(fp));
-
-  // If the handler is a JS frame, restore the context to the frame. Note that
-  // the context will be set to (cp == 0) for non-JS frames.
-  Label zero;
-  __ Branch(&zero, eq, cp, Operand(zero_reg));
-  __ Sd(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
-  __ bind(&zero);
-
-  // Compute the handler entry address and jump to it.
-  __ li(t9, Operand(pending_handler_entrypoint_address));
-  __ Ld(t9, MemOperand(t9));
-  __ Jump(t9);
-}
-
-
-void JSEntryStub::Generate(MacroAssembler* masm) {
-  Label invoke, handler_entry, exit;
-  Isolate* isolate = masm->isolate();
-
-  // TODO(plind): unify the ABI description here.
-  // Registers:
-  // a0: entry address
-  // a1: function
-  // a2: receiver
-  // a3: argc
-  // a4 (a4): on mips64
-
-  // Stack:
-  // 0 arg slots on mips64 (4 args slots on mips)
-  // args -- in a4/a4 on mips64, on stack on mips
-
-  ProfileEntryHookStub::MaybeCallEntryHook(masm);
-
-  // Save callee saved registers on the stack.
-  __ MultiPush(kCalleeSaved | ra.bit());
-
-  // Save callee-saved FPU registers.
-  __ MultiPushFPU(kCalleeSavedFPU);
-  // Set up the reserved register for 0.0.
-  __ Move(kDoubleRegZero, 0.0);
-
-  // Load argv in s0 register.
-  __ mov(s0, a4);  // 5th parameter in mips64 a4 (a4) register.
-
-  __ InitializeRootRegister();
-
-  // We build an EntryFrame.
-  __ li(a7, Operand(-1));  // Push a bad frame pointer to fail if it is used.
-  StackFrame::Type marker = type();
-  __ li(a6, Operand(StackFrame::TypeToMarker(marker)));
-  __ li(a5, Operand(StackFrame::TypeToMarker(marker)));
-  ExternalReference c_entry_fp(IsolateAddressId::kCEntryFPAddress, isolate);
-  __ li(a4, Operand(c_entry_fp));
-  __ Ld(a4, MemOperand(a4));
-  __ Push(a7, a6, a5, a4);
-  // Set up frame pointer for the frame to be pushed.
-  __ daddiu(fp, sp, -EntryFrameConstants::kCallerFPOffset);
-
-  // Registers:
-  // a0: entry_address
-  // a1: function
-  // a2: receiver_pointer
-  // a3: argc
-  // s0: argv
-  //
-  // Stack:
-  // caller fp          |
-  // function slot      | entry frame
-  // context slot       |
-  // bad fp (0xFF...F)  |
-  // callee saved registers + ra
-  // [ O32: 4 args slots]
-  // args
-
-  // If this is the outermost JS call, set js_entry_sp value.
-  Label non_outermost_js;
-  ExternalReference js_entry_sp(IsolateAddressId::kJSEntrySPAddress, isolate);
-  __ li(a5, Operand(ExternalReference(js_entry_sp)));
-  __ Ld(a6, MemOperand(a5));
-  __ Branch(&non_outermost_js, ne, a6, Operand(zero_reg));
-  __ Sd(fp, MemOperand(a5));
-  __ li(a4, Operand(StackFrame::OUTERMOST_JSENTRY_FRAME));
-  Label cont;
-  __ b(&cont);
-  __ nop();   // Branch delay slot nop.
-  __ bind(&non_outermost_js);
-  __ li(a4, Operand(StackFrame::INNER_JSENTRY_FRAME));
-  __ bind(&cont);
-  __ push(a4);
-
-  // Jump to a faked try block that does the invoke, with a faked catch
-  // block that sets the pending exception.
-  __ jmp(&invoke);
-  __ bind(&handler_entry);
-  handler_offset_ = handler_entry.pos();
-  // Caught exception: Store result (exception) in the pending exception
-  // field in the JSEnv and return a failure sentinel.  Coming in here the
-  // fp will be invalid because the PushStackHandler below sets it to 0 to
-  // signal the existence of the JSEntry frame.
-  __ li(a4, Operand(ExternalReference(
-                IsolateAddressId::kPendingExceptionAddress, isolate)));
-  __ Sd(v0, MemOperand(a4));  // We come back from 'invoke'. result is in v0.
-  __ LoadRoot(v0, Heap::kExceptionRootIndex);
-  __ b(&exit);  // b exposes branch delay slot.
-  __ nop();   // Branch delay slot nop.
-
-  // Invoke: Link this frame into the handler chain.
-  __ bind(&invoke);
-  __ PushStackHandler();
-  // If an exception not caught by another handler occurs, this handler
-  // returns control to the code after the bal(&invoke) above, which
-  // restores all kCalleeSaved registers (including cp and fp) to their
-  // saved values before returning a failure to C.
-
-  // Invoke the function by calling through JS entry trampoline builtin.
-  // Notice that we cannot store a reference to the trampoline code directly in
-  // this stub, because runtime stubs are not traversed when doing GC.
-
-  // Registers:
-  // a0: entry_address
-  // a1: function
-  // a2: receiver_pointer
-  // a3: argc
-  // s0: argv
-  //
-  // Stack:
-  // handler frame
-  // entry frame
-  // callee saved registers + ra
-  // [ O32: 4 args slots]
-  // args
-  __ Call(EntryTrampoline(), RelocInfo::CODE_TARGET);
-
-  // Unlink this frame from the handler chain.
-  __ PopStackHandler();
-
-  __ bind(&exit);  // v0 holds result
-  // Check if the current stack frame is marked as the outermost JS frame.
-  Label non_outermost_js_2;
-  __ pop(a5);
-  __ Branch(&non_outermost_js_2, ne, a5,
-            Operand(StackFrame::OUTERMOST_JSENTRY_FRAME));
-  __ li(a5, Operand(ExternalReference(js_entry_sp)));
-  __ Sd(zero_reg, MemOperand(a5));
-  __ bind(&non_outermost_js_2);
-
-  // Restore the top frame descriptors from the stack.
-  __ pop(a5);
-  __ li(a4, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress,
-                                      isolate)));
-  __ Sd(a5, MemOperand(a4));
-
-  // Reset the stack to the callee saved registers.
-  __ daddiu(sp, sp, -EntryFrameConstants::kCallerFPOffset);
-
-  // Restore callee-saved fpu registers.
-  __ MultiPopFPU(kCalleeSavedFPU);
-
-  // Restore callee saved registers from the stack.
-  __ MultiPop(kCalleeSaved | ra.bit());
-  // Return.
-  __ Jump(ra);
-}
-
-void DirectCEntryStub::Generate(MacroAssembler* masm) {
-  // Make place for arguments to fit C calling convention. Most of the callers
-  // of DirectCEntryStub::GenerateCall are using EnterExitFrame/LeaveExitFrame
-  // so they handle stack restoring and we don't have to do that here.
-  // Any caller of DirectCEntryStub::GenerateCall must take care of dropping
-  // kCArgsSlotsSize stack space after the call.
-  __ daddiu(sp, sp, -kCArgsSlotsSize);
-  // Place the return address on the stack, making the call
-  // GC safe. The RegExp backend also relies on this.
-  __ Sd(ra, MemOperand(sp, kCArgsSlotsSize));
-  __ Call(t9);  // Call the C++ function.
-  __ Ld(t9, MemOperand(sp, kCArgsSlotsSize));
-
-  if (FLAG_debug_code && FLAG_enable_slow_asserts) {
-    // In case of an error the return address may point to a memory area
-    // filled with kZapValue by the GC.
-    // Dereference the address and check for this.
-    __ Uld(a4, MemOperand(t9));
-    __ Assert(ne, AbortReason::kReceivedInvalidReturnAddress, a4,
-              Operand(reinterpret_cast<uint64_t>(kZapValue)));
-  }
-  __ Jump(t9);
-}
-
-
-void DirectCEntryStub::GenerateCall(MacroAssembler* masm,
-                                    Register target) {
-  intptr_t loc =
-      reinterpret_cast<intptr_t>(GetCode().location());
-  __ Move(t9, target);
-  __ li(at, Operand(loc, RelocInfo::CODE_TARGET), CONSTANT_SIZE);
-  __ Call(at);
-}
-
-
-void ProfileEntryHookStub::MaybeCallEntryHookDelayed(TurboAssembler* tasm,
-                                                     Zone* zone) {
-  if (tasm->isolate()->function_entry_hook() != nullptr) {
-    tasm->push(ra);
-    tasm->CallStubDelayed(new (zone) ProfileEntryHookStub(nullptr));
-    tasm->pop(ra);
-  }
-}
-
-void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
-  if (masm->isolate()->function_entry_hook() != nullptr) {
-    ProfileEntryHookStub stub(masm->isolate());
-    __ push(ra);
-    __ CallStub(&stub);
-    __ pop(ra);
-  }
-}
-
-
-void ProfileEntryHookStub::Generate(MacroAssembler* masm) {
-  // The entry hook is a "push ra" instruction, followed by a call.
-  // Note: on MIPS "push" is 2 instruction
-  const int32_t kReturnAddressDistanceFromFunctionStart =
-      Assembler::kCallTargetAddressOffset + (2 * Assembler::kInstrSize);
-
-  // This should contain all kJSCallerSaved registers.
-  const RegList kSavedRegs =
-     kJSCallerSaved |  // Caller saved registers.
-     s5.bit();         // Saved stack pointer.
-
-  // We also save ra, so the count here is one higher than the mask indicates.
-  const int32_t kNumSavedRegs = kNumJSCallerSaved + 2;
-
-  // Save all caller-save registers as this may be called from anywhere.
-  __ MultiPush(kSavedRegs | ra.bit());
-
-  // Compute the function's address for the first argument.
-  __ Dsubu(a0, ra, Operand(kReturnAddressDistanceFromFunctionStart));
-
-  // The caller's return address is above the saved temporaries.
-  // Grab that for the second argument to the hook.
-  __ Daddu(a1, sp, Operand(kNumSavedRegs * kPointerSize));
-
-  // Align the stack if necessary.
-  int frame_alignment = masm->ActivationFrameAlignment();
-  if (frame_alignment > kPointerSize) {
-    __ mov(s5, sp);
-    DCHECK(base::bits::IsPowerOfTwo(frame_alignment));
-    __ And(sp, sp, Operand(-frame_alignment));
-  }
-
-  __ Dsubu(sp, sp, kCArgsSlotsSize);
-#if defined(V8_HOST_ARCH_MIPS) || defined(V8_HOST_ARCH_MIPS64)
-  int64_t entry_hook =
-      reinterpret_cast<int64_t>(isolate()->function_entry_hook());
-  __ li(t9, Operand(entry_hook));
-#else
-  // Under the simulator we need to indirect the entry hook through a
-  // trampoline function at a known address.
-  // It additionally takes an isolate as a third parameter.
-  __ li(a2, Operand(ExternalReference::isolate_address(isolate())));
-
-  ApiFunction dispatcher(FUNCTION_ADDR(EntryHookTrampoline));
-  __ li(t9, Operand(ExternalReference(&dispatcher,
-                                      ExternalReference::BUILTIN_CALL,
-                                      isolate())));
-#endif
-  // Call C function through t9 to conform ABI for PIC.
-  __ Call(t9);
-
-  // Restore the stack pointer if needed.
-  if (frame_alignment > kPointerSize) {
-    __ mov(sp, s5);
-  } else {
-    __ Daddu(sp, sp, kCArgsSlotsSize);
-  }
-
-  // Also pop ra to get Ret(0).
-  __ MultiPop(kSavedRegs | ra.bit());
-  __ Ret();
-}
-
-
-template<class T>
-static void CreateArrayDispatch(MacroAssembler* masm,
-                                AllocationSiteOverrideMode mode) {
-  if (mode == DISABLE_ALLOCATION_SITES) {
-    T stub(masm->isolate(), GetInitialFastElementsKind(), mode);
-    __ TailCallStub(&stub);
-  } else if (mode == DONT_OVERRIDE) {
-    int last_index =
-        GetSequenceIndexFromFastElementsKind(TERMINAL_FAST_ELEMENTS_KIND);
-    for (int i = 0; i <= last_index; ++i) {
-      ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
-      T stub(masm->isolate(), kind);
-      __ TailCallStub(&stub, eq, a3, Operand(kind));
-    }
-
-    // If we reached this point there is a problem.
-    __ Abort(AbortReason::kUnexpectedElementsKindInArrayConstructor);
-  } else {
-    UNREACHABLE();
-  }
-}
-
-
-static void CreateArrayDispatchOneArgument(MacroAssembler* masm,
-                                           AllocationSiteOverrideMode mode) {
-  // a2 - allocation site (if mode != DISABLE_ALLOCATION_SITES)
-  // a3 - kind (if mode != DISABLE_ALLOCATION_SITES)
-  // a0 - number of arguments
-  // a1 - constructor?
-  // sp[0] - last argument
-    STATIC_ASSERT(PACKED_SMI_ELEMENTS == 0);
-    STATIC_ASSERT(HOLEY_SMI_ELEMENTS == 1);
-    STATIC_ASSERT(PACKED_ELEMENTS == 2);
-    STATIC_ASSERT(HOLEY_ELEMENTS == 3);
-    STATIC_ASSERT(PACKED_DOUBLE_ELEMENTS == 4);
-    STATIC_ASSERT(HOLEY_DOUBLE_ELEMENTS == 5);
-
-  if (mode == DISABLE_ALLOCATION_SITES) {
-    ElementsKind initial = GetInitialFastElementsKind();
-    ElementsKind holey_initial = GetHoleyElementsKind(initial);
-
-    ArraySingleArgumentConstructorStub stub_holey(masm->isolate(),
-                                                  holey_initial,
-                                                  DISABLE_ALLOCATION_SITES);
-    __ TailCallStub(&stub_holey);
-  } else if (mode == DONT_OVERRIDE) {
-    // is the low bit set? If so, we are holey and that is good.
-    Label normal_sequence;
-    __ And(at, a3, Operand(1));
-    __ Branch(&normal_sequence, ne, at, Operand(zero_reg));
-
-    // We are going to create a holey array, but our kind is non-holey.
-    // Fix kind and retry (only if we have an allocation site in the slot).
-    __ Daddu(a3, a3, Operand(1));
-
-    if (FLAG_debug_code) {
-      __ Ld(a5, FieldMemOperand(a2, 0));
-      __ LoadRoot(at, Heap::kAllocationSiteMapRootIndex);
-      __ Assert(eq, AbortReason::kExpectedAllocationSite, a5, Operand(at));
-    }
-
-    // Save the resulting elements kind in type info. We can't just store a3
-    // in the AllocationSite::transition_info field because elements kind is
-    // restricted to a portion of the field...upper bits need to be left alone.
-    STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
-    __ Ld(a4, FieldMemOperand(
-                  a2, AllocationSite::kTransitionInfoOrBoilerplateOffset));
-    __ Daddu(a4, a4, Operand(Smi::FromInt(kFastElementsKindPackedToHoley)));
-    __ Sd(a4, FieldMemOperand(
-                  a2, AllocationSite::kTransitionInfoOrBoilerplateOffset));
-
-    __ bind(&normal_sequence);
-    int last_index =
-        GetSequenceIndexFromFastElementsKind(TERMINAL_FAST_ELEMENTS_KIND);
-    for (int i = 0; i <= last_index; ++i) {
-      ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
-      ArraySingleArgumentConstructorStub stub(masm->isolate(), kind);
-      __ TailCallStub(&stub, eq, a3, Operand(kind));
-    }
-
-    // If we reached this point there is a problem.
-    __ Abort(AbortReason::kUnexpectedElementsKindInArrayConstructor);
-  } else {
-    UNREACHABLE();
-  }
-}
-
-
-template<class T>
-static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) {
-  int to_index =
-      GetSequenceIndexFromFastElementsKind(TERMINAL_FAST_ELEMENTS_KIND);
-  for (int i = 0; i <= to_index; ++i) {
-    ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
-    T stub(isolate, kind);
-    stub.GetCode();
-    if (AllocationSite::ShouldTrack(kind)) {
-      T stub1(isolate, kind, DISABLE_ALLOCATION_SITES);
-      stub1.GetCode();
-    }
-  }
-}
-
-void CommonArrayConstructorStub::GenerateStubsAheadOfTime(Isolate* isolate) {
-  ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>(
-      isolate);
-  ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>(
-      isolate);
-  ArrayNArgumentsConstructorStub stub(isolate);
-  stub.GetCode();
-  ElementsKind kinds[2] = {PACKED_ELEMENTS, HOLEY_ELEMENTS};
-  for (int i = 0; i < 2; i++) {
-    // For internal arrays we only need a few things.
-    InternalArrayNoArgumentConstructorStub stubh1(isolate, kinds[i]);
-    stubh1.GetCode();
-    InternalArraySingleArgumentConstructorStub stubh2(isolate, kinds[i]);
-    stubh2.GetCode();
-  }
-}
-
-
-void ArrayConstructorStub::GenerateDispatchToArrayStub(
-    MacroAssembler* masm,
-    AllocationSiteOverrideMode mode) {
-  Label not_zero_case, not_one_case;
-  __ And(at, a0, a0);
-  __ Branch(&not_zero_case, ne, at, Operand(zero_reg));
-  CreateArrayDispatch<ArrayNoArgumentConstructorStub>(masm, mode);
-
-  __ bind(&not_zero_case);
-  __ Branch(&not_one_case, gt, a0, Operand(1));
-  CreateArrayDispatchOneArgument(masm, mode);
-
-  __ bind(&not_one_case);
-  ArrayNArgumentsConstructorStub stub(masm->isolate());
-  __ TailCallStub(&stub);
-}
-
-
-void ArrayConstructorStub::Generate(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- a0 : argc (only if argument_count() == ANY)
-  //  -- a1 : constructor
-  //  -- a2 : AllocationSite or undefined
-  //  -- a3 : new target
-  //  -- sp[0] : last argument
-  // -----------------------------------
-
-  if (FLAG_debug_code) {
-    // The array construct code is only set for the global and natives
-    // builtin Array functions which always have maps.
-
-    // Initial map for the builtin Array function should be a map.
-    __ Ld(a4, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset));
-    // Will both indicate a nullptr and a Smi.
-    __ SmiTst(a4, at);
-    __ Assert(ne, AbortReason::kUnexpectedInitialMapForArrayFunction, at,
-              Operand(zero_reg));
-    __ GetObjectType(a4, a4, a5);
-    __ Assert(eq, AbortReason::kUnexpectedInitialMapForArrayFunction, a5,
-              Operand(MAP_TYPE));
-
-    // We should either have undefined in a2 or a valid AllocationSite
-    __ AssertUndefinedOrAllocationSite(a2, a4);
-  }
-
-  // Enter the context of the Array function.
-  __ Ld(cp, FieldMemOperand(a1, JSFunction::kContextOffset));
-
-  Label subclassing;
-  __ Branch(&subclassing, ne, a1, Operand(a3));
-
-  Label no_info;
-  // Get the elements kind and case on that.
-  __ LoadRoot(at, Heap::kUndefinedValueRootIndex);
-  __ Branch(&no_info, eq, a2, Operand(at));
-
-  __ Ld(a3, FieldMemOperand(
-                a2, AllocationSite::kTransitionInfoOrBoilerplateOffset));
-  __ SmiUntag(a3);
-  STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
-  __ And(a3, a3, Operand(AllocationSite::ElementsKindBits::kMask));
-  GenerateDispatchToArrayStub(masm, DONT_OVERRIDE);
-
-  __ bind(&no_info);
-  GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES);
-
-  // Subclassing.
-  __ bind(&subclassing);
-  __ Dlsa(at, sp, a0, kPointerSizeLog2);
-  __ Sd(a1, MemOperand(at));
-  __ li(at, Operand(3));
-  __ Daddu(a0, a0, at);
-  __ Push(a3, a2);
-  __ JumpToExternalReference(ExternalReference(Runtime::kNewArray, isolate()));
-}
-
-
-void InternalArrayConstructorStub::GenerateCase(
-    MacroAssembler* masm, ElementsKind kind) {
-
-  InternalArrayNoArgumentConstructorStub stub0(isolate(), kind);
-  __ TailCallStub(&stub0, lo, a0, Operand(1));
-
-  ArrayNArgumentsConstructorStub stubN(isolate());
-  __ TailCallStub(&stubN, hi, a0, Operand(1));
-
-  if (IsFastPackedElementsKind(kind)) {
-    // We might need to create a holey array
-    // look at the first argument.
-    __ Ld(at, MemOperand(sp, 0));
-
-    InternalArraySingleArgumentConstructorStub
-        stub1_holey(isolate(), GetHoleyElementsKind(kind));
-    __ TailCallStub(&stub1_holey, ne, at, Operand(zero_reg));
-  }
-
-  InternalArraySingleArgumentConstructorStub stub1(isolate(), kind);
-  __ TailCallStub(&stub1);
-}
-
-
-void InternalArrayConstructorStub::Generate(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- a0 : argc
-  //  -- a1 : constructor
-  //  -- sp[0] : return address
-  //  -- sp[4] : last argument
-  // -----------------------------------
-
-  if (FLAG_debug_code) {
-    // The array construct code is only set for the global and natives
-    // builtin Array functions which always have maps.
-
-    // Initial map for the builtin Array function should be a map.
-    __ Ld(a3, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset));
-    // Will both indicate a nullptr and a Smi.
-    __ SmiTst(a3, at);
-    __ Assert(ne, AbortReason::kUnexpectedInitialMapForArrayFunction, at,
-              Operand(zero_reg));
-    __ GetObjectType(a3, a3, a4);
-    __ Assert(eq, AbortReason::kUnexpectedInitialMapForArrayFunction, a4,
-              Operand(MAP_TYPE));
-  }
-
-  // Figure out the right elements kind.
-  __ Ld(a3, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset));
-
-  // Load the map's "bit field 2" into a3. We only need the first byte,
-  // but the following bit field extraction takes care of that anyway.
-  __ Lbu(a3, FieldMemOperand(a3, Map::kBitField2Offset));
-  // Retrieve elements_kind from bit field 2.
-  __ DecodeField<Map::ElementsKindBits>(a3);
-
-  if (FLAG_debug_code) {
-    Label done;
-    __ Branch(&done, eq, a3, Operand(PACKED_ELEMENTS));
-    __ Assert(
-        eq,
-        AbortReason::kInvalidElementsKindForInternalArrayOrInternalPackedArray,
-        a3, Operand(HOLEY_ELEMENTS));
-    __ bind(&done);
-  }
-
-  Label fast_elements_case;
-  __ Branch(&fast_elements_case, eq, a3, Operand(PACKED_ELEMENTS));
-  GenerateCase(masm, HOLEY_ELEMENTS);
-
-  __ bind(&fast_elements_case);
-  GenerateCase(masm, PACKED_ELEMENTS);
-}
-
-static int AddressOffset(ExternalReference ref0, ExternalReference ref1) {
-  int64_t offset = (ref0.address() - ref1.address());
-  DCHECK(static_cast<int>(offset) == offset);
-  return static_cast<int>(offset);
-}
-
-
-// Calls an API function.  Allocates HandleScope, extracts returned value
-// from handle and propagates exceptions.  Restores context.  stack_space
-// - space to be unwound on exit (includes the call JS arguments space and
-// the additional space allocated for the fast call).
-static void CallApiFunctionAndReturn(MacroAssembler* masm,
-                                     Register function_address,
-                                     ExternalReference thunk_ref,
-                                     int stack_space,
-                                     int32_t stack_space_offset,
-                                     MemOperand return_value_operand) {
-  Isolate* isolate = masm->isolate();
-  ExternalReference next_address =
-      ExternalReference::handle_scope_next_address(isolate);
-  const int kNextOffset = 0;
-  const int kLimitOffset = AddressOffset(
-      ExternalReference::handle_scope_limit_address(isolate), next_address);
-  const int kLevelOffset = AddressOffset(
-      ExternalReference::handle_scope_level_address(isolate), next_address);
-
-  DCHECK(function_address == a1 || function_address == a2);
-
-  Label profiler_disabled;
-  Label end_profiler_check;
-  __ li(t9, Operand(ExternalReference::is_profiling_address(isolate)));
-  __ Lb(t9, MemOperand(t9, 0));
-  __ Branch(&profiler_disabled, eq, t9, Operand(zero_reg));
-
-  // Additional parameter is the address of the actual callback.
-  __ li(t9, Operand(thunk_ref));
-  __ jmp(&end_profiler_check);
-
-  __ bind(&profiler_disabled);
-  __ mov(t9, function_address);
-  __ bind(&end_profiler_check);
-
-  // Allocate HandleScope in callee-save registers.
-  __ li(s3, Operand(next_address));
-  __ Ld(s0, MemOperand(s3, kNextOffset));
-  __ Ld(s1, MemOperand(s3, kLimitOffset));
-  __ Lw(s2, MemOperand(s3, kLevelOffset));
-  __ Addu(s2, s2, Operand(1));
-  __ Sw(s2, MemOperand(s3, kLevelOffset));
-
-  if (FLAG_log_timer_events) {
-    FrameScope frame(masm, StackFrame::MANUAL);
-    __ PushSafepointRegisters();
-    __ PrepareCallCFunction(1, a0);
-    __ li(a0, Operand(ExternalReference::isolate_address(isolate)));
-    __ CallCFunction(ExternalReference::log_enter_external_function(isolate),
-                     1);
-    __ PopSafepointRegisters();
-  }
-
-  // Native call returns to the DirectCEntry stub which redirects to the
-  // return address pushed on stack (could have moved after GC).
-  // DirectCEntry stub itself is generated early and never moves.
-  DirectCEntryStub stub(isolate);
-  stub.GenerateCall(masm, t9);
-
-  if (FLAG_log_timer_events) {
-    FrameScope frame(masm, StackFrame::MANUAL);
-    __ PushSafepointRegisters();
-    __ PrepareCallCFunction(1, a0);
-    __ li(a0, Operand(ExternalReference::isolate_address(isolate)));
-    __ CallCFunction(ExternalReference::log_leave_external_function(isolate),
-                     1);
-    __ PopSafepointRegisters();
-  }
-
-  Label promote_scheduled_exception;
-  Label delete_allocated_handles;
-  Label leave_exit_frame;
-  Label return_value_loaded;
-
-  // Load value from ReturnValue.
-  __ Ld(v0, return_value_operand);
-  __ bind(&return_value_loaded);
-
-  // No more valid handles (the result handle was the last one). Restore
-  // previous handle scope.
-  __ Sd(s0, MemOperand(s3, kNextOffset));
-  if (__ emit_debug_code()) {
-    __ Lw(a1, MemOperand(s3, kLevelOffset));
-    __ Check(eq, AbortReason::kUnexpectedLevelAfterReturnFromApiCall, a1,
-             Operand(s2));
-  }
-  __ Subu(s2, s2, Operand(1));
-  __ Sw(s2, MemOperand(s3, kLevelOffset));
-  __ Ld(at, MemOperand(s3, kLimitOffset));
-  __ Branch(&delete_allocated_handles, ne, s1, Operand(at));
-
-  // Leave the API exit frame.
-  __ bind(&leave_exit_frame);
-
-  if (stack_space_offset != kInvalidStackOffset) {
-    DCHECK_EQ(kCArgsSlotsSize, 0);
-    __ Ld(s0, MemOperand(sp, stack_space_offset));
-  } else {
-    __ li(s0, Operand(stack_space));
-  }
-  __ LeaveExitFrame(false, s0, NO_EMIT_RETURN,
-                    stack_space_offset != kInvalidStackOffset);
-
-  // Check if the function scheduled an exception.
-  __ LoadRoot(a4, Heap::kTheHoleValueRootIndex);
-  __ li(at, Operand(ExternalReference::scheduled_exception_address(isolate)));
-  __ Ld(a5, MemOperand(at));
-  __ Branch(&promote_scheduled_exception, ne, a4, Operand(a5));
-
-  __ Ret();
-
-  // Re-throw by promoting a scheduled exception.
-  __ bind(&promote_scheduled_exception);
-  __ TailCallRuntime(Runtime::kPromoteScheduledException);
-
-  // HandleScope limit has changed. Delete allocated extensions.
-  __ bind(&delete_allocated_handles);
-  __ Sd(s1, MemOperand(s3, kLimitOffset));
-  __ mov(s0, v0);
-  __ mov(a0, v0);
-  __ PrepareCallCFunction(1, s1);
-  __ li(a0, Operand(ExternalReference::isolate_address(isolate)));
-  __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate),
-                   1);
-  __ mov(v0, s0);
-  __ jmp(&leave_exit_frame);
-}
-
-void CallApiCallbackStub::Generate(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- a4                  : call_data
-  //  -- a2                  : holder
-  //  -- a1                  : api_function_address
-  //  -- cp                  : context
-  //  --
-  //  -- sp[0]               : last argument
-  //  -- ...
-  //  -- sp[(argc - 1) * 8]  : first argument
-  //  -- sp[argc * 8]        : receiver
-  // -----------------------------------
-
-  Register call_data = a4;
-  Register holder = a2;
-  Register api_function_address = a1;
-
-  typedef FunctionCallbackArguments FCA;
-
-  STATIC_ASSERT(FCA::kArgsLength == 6);
-  STATIC_ASSERT(FCA::kNewTargetIndex == 5);
-  STATIC_ASSERT(FCA::kDataIndex == 4);
-  STATIC_ASSERT(FCA::kReturnValueOffset == 3);
-  STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2);
-  STATIC_ASSERT(FCA::kIsolateIndex == 1);
-  STATIC_ASSERT(FCA::kHolderIndex == 0);
-
-  // new target
-  __ PushRoot(Heap::kUndefinedValueRootIndex);
-
-  // call data.
-  __ Push(call_data);
-
-  Register scratch = call_data;
-  __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex);
-  // Push return value and default return value.
-  __ Push(scratch, scratch);
-  __ li(scratch, Operand(ExternalReference::isolate_address(masm->isolate())));
-  // Push isolate and holder.
-  __ Push(scratch, holder);
-
-  // Prepare arguments.
-  __ mov(scratch, sp);
-
-  // Allocate the v8::Arguments structure in the arguments' space since
-  // it's not controlled by GC.
-  const int kApiStackSpace = 3;
-
-  FrameScope frame_scope(masm, StackFrame::MANUAL);
-  __ EnterExitFrame(false, kApiStackSpace);
-
-  DCHECK(api_function_address != a0 && scratch != a0);
-  // a0 = FunctionCallbackInfo&
-  // Arguments is after the return address.
-  __ Daddu(a0, sp, Operand(1 * kPointerSize));
-  // FunctionCallbackInfo::implicit_args_
-  __ Sd(scratch, MemOperand(a0, 0 * kPointerSize));
-  // FunctionCallbackInfo::values_
-  __ Daddu(at, scratch,
-           Operand((FCA::kArgsLength - 1 + argc()) * kPointerSize));
-  __ Sd(at, MemOperand(a0, 1 * kPointerSize));
-  // FunctionCallbackInfo::length_ = argc
-  // Stored as int field, 32-bit integers within struct on stack always left
-  // justified by n64 ABI.
-  __ li(at, Operand(argc()));
-  __ Sw(at, MemOperand(a0, 2 * kPointerSize));
-
-  ExternalReference thunk_ref =
-      ExternalReference::invoke_function_callback(masm->isolate());
-
-  AllowExternalCallThatCantCauseGC scope(masm);
-  // Stores return the first js argument.
-  int return_value_offset = 2 + FCA::kReturnValueOffset;
-  MemOperand return_value_operand(fp, return_value_offset * kPointerSize);
-  const int stack_space = argc() + FCA::kArgsLength + 1;
-  // TODO(adamk): Why are we clobbering this immediately?
-  const int32_t stack_space_offset = kInvalidStackOffset;
-  CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space,
-                           stack_space_offset, return_value_operand);
-}
-
-
-void CallApiGetterStub::Generate(MacroAssembler* masm) {
-  // Build v8::PropertyCallbackInfo::args_ array on the stack and push property
-  // name below the exit frame to make GC aware of them.
-  STATIC_ASSERT(PropertyCallbackArguments::kShouldThrowOnErrorIndex == 0);
-  STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 1);
-  STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 2);
-  STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 3);
-  STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 4);
-  STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 5);
-  STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 6);
-  STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 7);
-
-  Register receiver = ApiGetterDescriptor::ReceiverRegister();
-  Register holder = ApiGetterDescriptor::HolderRegister();
-  Register callback = ApiGetterDescriptor::CallbackRegister();
-  Register scratch = a4;
-  DCHECK(!AreAliased(receiver, holder, callback, scratch));
-
-  Register api_function_address = a2;
-
-  // Here and below +1 is for name() pushed after the args_ array.
-  typedef PropertyCallbackArguments PCA;
-  __ Dsubu(sp, sp, (PCA::kArgsLength + 1) * kPointerSize);
-  __ Sd(receiver, MemOperand(sp, (PCA::kThisIndex + 1) * kPointerSize));
-  __ Ld(scratch, FieldMemOperand(callback, AccessorInfo::kDataOffset));
-  __ Sd(scratch, MemOperand(sp, (PCA::kDataIndex + 1) * kPointerSize));
-  __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex);
-  __ Sd(scratch, MemOperand(sp, (PCA::kReturnValueOffset + 1) * kPointerSize));
-  __ Sd(scratch, MemOperand(sp, (PCA::kReturnValueDefaultValueIndex + 1) *
-                                    kPointerSize));
-  __ li(scratch, Operand(ExternalReference::isolate_address(isolate())));
-  __ Sd(scratch, MemOperand(sp, (PCA::kIsolateIndex + 1) * kPointerSize));
-  __ Sd(holder, MemOperand(sp, (PCA::kHolderIndex + 1) * kPointerSize));
-  // should_throw_on_error -> false
-  DCHECK_NULL(Smi::kZero);
-  __ Sd(zero_reg,
-        MemOperand(sp, (PCA::kShouldThrowOnErrorIndex + 1) * kPointerSize));
-  __ Ld(scratch, FieldMemOperand(callback, AccessorInfo::kNameOffset));
-  __ Sd(scratch, MemOperand(sp, 0 * kPointerSize));
-
-  // v8::PropertyCallbackInfo::args_ array and name handle.
-  const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1;
-
-  // Load address of v8::PropertyAccessorInfo::args_ array and name handle.
-  __ mov(a0, sp);                               // a0 = Handle<Name>
-  __ Daddu(a1, a0, Operand(1 * kPointerSize));  // a1 = v8::PCI::args_
-
-  const int kApiStackSpace = 1;
-  FrameScope frame_scope(masm, StackFrame::MANUAL);
-  __ EnterExitFrame(false, kApiStackSpace);
-
-  // Create v8::PropertyCallbackInfo object on the stack and initialize
-  // it's args_ field.
-  __ Sd(a1, MemOperand(sp, 1 * kPointerSize));
-  __ Daddu(a1, sp, Operand(1 * kPointerSize));
-  // a1 = v8::PropertyCallbackInfo&
-
-  ExternalReference thunk_ref =
-      ExternalReference::invoke_accessor_getter_callback(isolate());
-
-  __ Ld(scratch, FieldMemOperand(callback, AccessorInfo::kJsGetterOffset));
-  __ Ld(api_function_address,
-        FieldMemOperand(scratch, Foreign::kForeignAddressOffset));
-
-  // +3 is to skip prolog, return address and name handle.
-  MemOperand return_value_operand(
-      fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize);
-  CallApiFunctionAndReturn(masm, api_function_address, thunk_ref,
-                           kStackUnwindSpace, kInvalidStackOffset,
-                           return_value_operand);
-}
-
-#undef __
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_MIPS64
diff --git a/src/v8/src/mips64/code-stubs-mips64.h b/src/v8/src/mips64/code-stubs-mips64.h
deleted file mode 100644
index 0513611..0000000
--- a/src/v8/src/mips64/code-stubs-mips64.h
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_MIPS_CODE_STUBS_MIPS64_H_
-#define V8_MIPS_CODE_STUBS_MIPS64_H_
-
-namespace v8 {
-namespace internal {
-
-// Trampoline stub to call into native code. To call safely into native code
-// in the presence of compacting GC (which can move code objects) we need to
-// keep the code which called into native pinned in the memory. Currently the
-// simplest approach is to generate such stub early enough so it can never be
-// moved by GC.
-class DirectCEntryStub : public PlatformCodeStub {
- public:
-  explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {}
-  void GenerateCall(MacroAssembler* masm, Register target);
-
- private:
-  Movability NeedsImmovableCode() override { return kImmovable; }
-
-  DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR();
-  DEFINE_PLATFORM_CODE_STUB(DirectCEntry, PlatformCodeStub);
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_MIPS_CODE_STUBS_MIPS64_H_
diff --git a/src/v8/src/mips64/codegen-mips64.cc b/src/v8/src/mips64/codegen-mips64.cc
deleted file mode 100644
index 3be5e50..0000000
--- a/src/v8/src/mips64/codegen-mips64.cc
+++ /dev/null
@@ -1,585 +0,0 @@
-// Copyright 2012 the V8 project 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 V8_TARGET_ARCH_MIPS64
-
-#include <memory>
-
-#include "src/codegen.h"
-#include "src/macro-assembler.h"
-#include "src/mips64/simulator-mips64.h"
-
-namespace v8 {
-namespace internal {
-
-#define __ masm.
-
-#if defined(V8_HOST_ARCH_MIPS)
-
-MemCopyUint8Function CreateMemCopyUint8Function(Isolate* isolate,
-                                                MemCopyUint8Function stub) {
-#if defined(USE_SIMULATOR)
-  return stub;
-#else
-
-  size_t allocated = 0;
-  byte* buffer = AllocatePage(isolate->heap()->GetRandomMmapAddr(), &allocated);
-  if (buffer == nullptr) return stub;
-
-  MacroAssembler masm(isolate, buffer, static_cast<int>(allocated),
-                      CodeObjectRequired::kNo);
-
-  // This code assumes that cache lines are 32 bytes and if the cache line is
-  // larger it will not work correctly.
-  {
-    Label lastb, unaligned, aligned, chkw,
-          loop16w, chk1w, wordCopy_loop, skip_pref, lastbloop,
-          leave, ua_chk16w, ua_loop16w, ua_skip_pref, ua_chkw,
-          ua_chk1w, ua_wordCopy_loop, ua_smallCopy, ua_smallCopy_loop;
-
-    // The size of each prefetch.
-    uint32_t pref_chunk = 32;
-    // The maximum size of a prefetch, it must not be less than pref_chunk.
-    // If the real size of a prefetch is greater than max_pref_size and
-    // the kPrefHintPrepareForStore hint is used, the code will not work
-    // correctly.
-    uint32_t max_pref_size = 128;
-    DCHECK(pref_chunk < max_pref_size);
-
-    // pref_limit is set based on the fact that we never use an offset
-    // greater then 5 on a store pref and that a single pref can
-    // never be larger then max_pref_size.
-    uint32_t pref_limit = (5 * pref_chunk) + max_pref_size;
-    int32_t pref_hint_load = kPrefHintLoadStreamed;
-    int32_t pref_hint_store = kPrefHintPrepareForStore;
-    uint32_t loadstore_chunk = 4;
-
-    // The initial prefetches may fetch bytes that are before the buffer being
-    // copied. Start copies with an offset of 4 so avoid this situation when
-    // using kPrefHintPrepareForStore.
-    DCHECK(pref_hint_store != kPrefHintPrepareForStore ||
-           pref_chunk * 4 >= max_pref_size);
-    // If the size is less than 8, go to lastb. Regardless of size,
-    // copy dst pointer to v0 for the retuen value.
-    __ slti(a6, a2, 2 * loadstore_chunk);
-    __ bne(a6, zero_reg, &lastb);
-    __ mov(v0, a0);  // In delay slot.
-
-    // If src and dst have different alignments, go to unaligned, if they
-    // have the same alignment (but are not actually aligned) do a partial
-    // load/store to make them aligned. If they are both already aligned
-    // we can start copying at aligned.
-    __ xor_(t8, a1, a0);
-    __ andi(t8, t8, loadstore_chunk - 1);  // t8 is a0/a1 word-displacement.
-    __ bne(t8, zero_reg, &unaligned);
-    __ subu(a3, zero_reg, a0);  // In delay slot.
-
-    __ andi(a3, a3, loadstore_chunk - 1);  // Copy a3 bytes to align a0/a1.
-    __ beq(a3, zero_reg, &aligned);  // Already aligned.
-    __ subu(a2, a2, a3);  // In delay slot. a2 is the remining bytes count.
-
-    if (kArchEndian == kLittle) {
-      __ lwr(t8, MemOperand(a1));
-      __ addu(a1, a1, a3);
-      __ swr(t8, MemOperand(a0));
-      __ addu(a0, a0, a3);
-    } else {
-      __ lwl(t8, MemOperand(a1));
-      __ addu(a1, a1, a3);
-      __ swl(t8, MemOperand(a0));
-      __ addu(a0, a0, a3);
-    }
-
-    // Now dst/src are both aligned to (word) aligned addresses. Set a2 to
-    // count how many bytes we have to copy after all the 64 byte chunks are
-    // copied and a3 to the dst pointer after all the 64 byte chunks have been
-    // copied. We will loop, incrementing a0 and a1 until a0 equals a3.
-    __ bind(&aligned);
-    __ andi(t8, a2, 0x3F);
-    __ beq(a2, t8, &chkw);  // Less than 64?
-    __ subu(a3, a2, t8);  // In delay slot.
-    __ addu(a3, a0, a3);  // Now a3 is the final dst after loop.
-
-    // When in the loop we prefetch with kPrefHintPrepareForStore hint,
-    // in this case the a0+x should be past the "a4-32" address. This means:
-    // for x=128 the last "safe" a0 address is "a4-160". Alternatively, for
-    // x=64 the last "safe" a0 address is "a4-96". In the current version we
-    // will use "pref hint, 128(a0)", so "a4-160" is the limit.
-    if (pref_hint_store == kPrefHintPrepareForStore) {
-      __ addu(a4, a0, a2);  // a4 is the "past the end" address.
-      __ Subu(t9, a4, pref_limit);  // t9 is the "last safe pref" address.
-    }
-
-    __ Pref(pref_hint_load, MemOperand(a1, 0 * pref_chunk));
-    __ Pref(pref_hint_load, MemOperand(a1, 1 * pref_chunk));
-    __ Pref(pref_hint_load, MemOperand(a1, 2 * pref_chunk));
-    __ Pref(pref_hint_load, MemOperand(a1, 3 * pref_chunk));
-
-    if (pref_hint_store != kPrefHintPrepareForStore) {
-      __ Pref(pref_hint_store, MemOperand(a0, 1 * pref_chunk));
-      __ Pref(pref_hint_store, MemOperand(a0, 2 * pref_chunk));
-      __ Pref(pref_hint_store, MemOperand(a0, 3 * pref_chunk));
-    }
-    __ bind(&loop16w);
-    __ Lw(a4, MemOperand(a1));
-
-    if (pref_hint_store == kPrefHintPrepareForStore) {
-      __ sltu(v1, t9, a0);  // If a0 > t9, don't use next prefetch.
-      __ Branch(USE_DELAY_SLOT, &skip_pref, gt, v1, Operand(zero_reg));
-    }
-    __ Lw(a5, MemOperand(a1, 1, loadstore_chunk));  // Maybe in delay slot.
-
-    __ Pref(pref_hint_store, MemOperand(a0, 4 * pref_chunk));
-    __ Pref(pref_hint_store, MemOperand(a0, 5 * pref_chunk));
-
-    __ bind(&skip_pref);
-    __ Lw(a6, MemOperand(a1, 2, loadstore_chunk));
-    __ Lw(a7, MemOperand(a1, 3, loadstore_chunk));
-    __ Lw(t0, MemOperand(a1, 4, loadstore_chunk));
-    __ Lw(t1, MemOperand(a1, 5, loadstore_chunk));
-    __ Lw(t2, MemOperand(a1, 6, loadstore_chunk));
-    __ Lw(t3, MemOperand(a1, 7, loadstore_chunk));
-    __ Pref(pref_hint_load, MemOperand(a1, 4 * pref_chunk));
-
-    __ Sw(a4, MemOperand(a0));
-    __ Sw(a5, MemOperand(a0, 1, loadstore_chunk));
-    __ Sw(a6, MemOperand(a0, 2, loadstore_chunk));
-    __ Sw(a7, MemOperand(a0, 3, loadstore_chunk));
-    __ Sw(t0, MemOperand(a0, 4, loadstore_chunk));
-    __ Sw(t1, MemOperand(a0, 5, loadstore_chunk));
-    __ Sw(t2, MemOperand(a0, 6, loadstore_chunk));
-    __ Sw(t3, MemOperand(a0, 7, loadstore_chunk));
-
-    __ Lw(a4, MemOperand(a1, 8, loadstore_chunk));
-    __ Lw(a5, MemOperand(a1, 9, loadstore_chunk));
-    __ Lw(a6, MemOperand(a1, 10, loadstore_chunk));
-    __ Lw(a7, MemOperand(a1, 11, loadstore_chunk));
-    __ Lw(t0, MemOperand(a1, 12, loadstore_chunk));
-    __ Lw(t1, MemOperand(a1, 13, loadstore_chunk));
-    __ Lw(t2, MemOperand(a1, 14, loadstore_chunk));
-    __ Lw(t3, MemOperand(a1, 15, loadstore_chunk));
-    __ Pref(pref_hint_load, MemOperand(a1, 5 * pref_chunk));
-
-    __ Sw(a4, MemOperand(a0, 8, loadstore_chunk));
-    __ Sw(a5, MemOperand(a0, 9, loadstore_chunk));
-    __ Sw(a6, MemOperand(a0, 10, loadstore_chunk));
-    __ Sw(a7, MemOperand(a0, 11, loadstore_chunk));
-    __ Sw(t0, MemOperand(a0, 12, loadstore_chunk));
-    __ Sw(t1, MemOperand(a0, 13, loadstore_chunk));
-    __ Sw(t2, MemOperand(a0, 14, loadstore_chunk));
-    __ Sw(t3, MemOperand(a0, 15, loadstore_chunk));
-    __ addiu(a0, a0, 16 * loadstore_chunk);
-    __ bne(a0, a3, &loop16w);
-    __ addiu(a1, a1, 16 * loadstore_chunk);  // In delay slot.
-    __ mov(a2, t8);
-
-    // Here we have src and dest word-aligned but less than 64-bytes to go.
-    // Check for a 32 bytes chunk and copy if there is one. Otherwise jump
-    // down to chk1w to handle the tail end of the copy.
-    __ bind(&chkw);
-    __ Pref(pref_hint_load, MemOperand(a1, 0 * pref_chunk));
-    __ andi(t8, a2, 0x1F);
-    __ beq(a2, t8, &chk1w);  // Less than 32?
-    __ nop();  // In delay slot.
-    __ Lw(a4, MemOperand(a1));
-    __ Lw(a5, MemOperand(a1, 1, loadstore_chunk));
-    __ Lw(a6, MemOperand(a1, 2, loadstore_chunk));
-    __ Lw(a7, MemOperand(a1, 3, loadstore_chunk));
-    __ Lw(t0, MemOperand(a1, 4, loadstore_chunk));
-    __ Lw(t1, MemOperand(a1, 5, loadstore_chunk));
-    __ Lw(t2, MemOperand(a1, 6, loadstore_chunk));
-    __ Lw(t3, MemOperand(a1, 7, loadstore_chunk));
-    __ addiu(a1, a1, 8 * loadstore_chunk);
-    __ Sw(a4, MemOperand(a0));
-    __ Sw(a5, MemOperand(a0, 1, loadstore_chunk));
-    __ Sw(a6, MemOperand(a0, 2, loadstore_chunk));
-    __ Sw(a7, MemOperand(a0, 3, loadstore_chunk));
-    __ Sw(t0, MemOperand(a0, 4, loadstore_chunk));
-    __ Sw(t1, MemOperand(a0, 5, loadstore_chunk));
-    __ Sw(t2, MemOperand(a0, 6, loadstore_chunk));
-    __ Sw(t3, MemOperand(a0, 7, loadstore_chunk));
-    __ addiu(a0, a0, 8 * loadstore_chunk);
-
-    // Here we have less than 32 bytes to copy. Set up for a loop to copy
-    // one word at a time. Set a2 to count how many bytes we have to copy
-    // after all the word chunks are copied and a3 to the dst pointer after
-    // all the word chunks have been copied. We will loop, incrementing a0
-    // and a1 until a0 equals a3.
-    __ bind(&chk1w);
-    __ andi(a2, t8, loadstore_chunk - 1);
-    __ beq(a2, t8, &lastb);
-    __ subu(a3, t8, a2);  // In delay slot.
-    __ addu(a3, a0, a3);
-
-    __ bind(&wordCopy_loop);
-    __ Lw(a7, MemOperand(a1));
-    __ addiu(a0, a0, loadstore_chunk);
-    __ addiu(a1, a1, loadstore_chunk);
-    __ bne(a0, a3, &wordCopy_loop);
-    __ Sw(a7, MemOperand(a0, -1, loadstore_chunk));  // In delay slot.
-
-    __ bind(&lastb);
-    __ Branch(&leave, le, a2, Operand(zero_reg));
-    __ addu(a3, a0, a2);
-
-    __ bind(&lastbloop);
-    __ Lb(v1, MemOperand(a1));
-    __ addiu(a0, a0, 1);
-    __ addiu(a1, a1, 1);
-    __ bne(a0, a3, &lastbloop);
-    __ Sb(v1, MemOperand(a0, -1));  // In delay slot.
-
-    __ bind(&leave);
-    __ jr(ra);
-    __ nop();
-
-    // Unaligned case. Only the dst gets aligned so we need to do partial
-    // loads of the source followed by normal stores to the dst (once we
-    // have aligned the destination).
-    __ bind(&unaligned);
-    __ andi(a3, a3, loadstore_chunk - 1);  // Copy a3 bytes to align a0/a1.
-    __ beq(a3, zero_reg, &ua_chk16w);
-    __ subu(a2, a2, a3);  // In delay slot.
-
-    if (kArchEndian == kLittle) {
-      __ lwr(v1, MemOperand(a1));
-      __ lwl(v1,
-             MemOperand(a1, 1, loadstore_chunk, MemOperand::offset_minus_one));
-      __ addu(a1, a1, a3);
-      __ swr(v1, MemOperand(a0));
-      __ addu(a0, a0, a3);
-    } else {
-      __ lwl(v1, MemOperand(a1));
-      __ lwr(v1,
-             MemOperand(a1, 1, loadstore_chunk, MemOperand::offset_minus_one));
-      __ addu(a1, a1, a3);
-      __ swl(v1, MemOperand(a0));
-      __ addu(a0, a0, a3);
-    }
-
-    // Now the dst (but not the source) is aligned. Set a2 to count how many
-    // bytes we have to copy after all the 64 byte chunks are copied and a3 to
-    // the dst pointer after all the 64 byte chunks have been copied. We will
-    // loop, incrementing a0 and a1 until a0 equals a3.
-    __ bind(&ua_chk16w);
-    __ andi(t8, a2, 0x3F);
-    __ beq(a2, t8, &ua_chkw);
-    __ subu(a3, a2, t8);  // In delay slot.
-    __ addu(a3, a0, a3);
-
-    if (pref_hint_store == kPrefHintPrepareForStore) {
-      __ addu(a4, a0, a2);
-      __ Subu(t9, a4, pref_limit);
-    }
-
-    __ Pref(pref_hint_load, MemOperand(a1, 0 * pref_chunk));
-    __ Pref(pref_hint_load, MemOperand(a1, 1 * pref_chunk));
-    __ Pref(pref_hint_load, MemOperand(a1, 2 * pref_chunk));
-
-    if (pref_hint_store != kPrefHintPrepareForStore) {
-      __ Pref(pref_hint_store, MemOperand(a0, 1 * pref_chunk));
-      __ Pref(pref_hint_store, MemOperand(a0, 2 * pref_chunk));
-      __ Pref(pref_hint_store, MemOperand(a0, 3 * pref_chunk));
-    }
-
-    __ bind(&ua_loop16w);
-    if (kArchEndian == kLittle) {
-      __ Pref(pref_hint_load, MemOperand(a1, 3 * pref_chunk));
-      __ lwr(a4, MemOperand(a1));
-      __ lwr(a5, MemOperand(a1, 1, loadstore_chunk));
-      __ lwr(a6, MemOperand(a1, 2, loadstore_chunk));
-
-      if (pref_hint_store == kPrefHintPrepareForStore) {
-        __ sltu(v1, t9, a0);
-        __ Branch(USE_DELAY_SLOT, &ua_skip_pref, gt, v1, Operand(zero_reg));
-      }
-      __ lwr(a7, MemOperand(a1, 3, loadstore_chunk));  // Maybe in delay slot.
-
-      __ Pref(pref_hint_store, MemOperand(a0, 4 * pref_chunk));
-      __ Pref(pref_hint_store, MemOperand(a0, 5 * pref_chunk));
-
-      __ bind(&ua_skip_pref);
-      __ lwr(t0, MemOperand(a1, 4, loadstore_chunk));
-      __ lwr(t1, MemOperand(a1, 5, loadstore_chunk));
-      __ lwr(t2, MemOperand(a1, 6, loadstore_chunk));
-      __ lwr(t3, MemOperand(a1, 7, loadstore_chunk));
-      __ lwl(a4,
-             MemOperand(a1, 1, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(a5,
-             MemOperand(a1, 2, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(a6,
-             MemOperand(a1, 3, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(a7,
-             MemOperand(a1, 4, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t0,
-             MemOperand(a1, 5, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t1,
-             MemOperand(a1, 6, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t2,
-             MemOperand(a1, 7, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t3,
-             MemOperand(a1, 8, loadstore_chunk, MemOperand::offset_minus_one));
-    } else {
-      __ Pref(pref_hint_load, MemOperand(a1, 3 * pref_chunk));
-      __ lwl(a4, MemOperand(a1));
-      __ lwl(a5, MemOperand(a1, 1, loadstore_chunk));
-      __ lwl(a6, MemOperand(a1, 2, loadstore_chunk));
-
-      if (pref_hint_store == kPrefHintPrepareForStore) {
-        __ sltu(v1, t9, a0);
-        __ Branch(USE_DELAY_SLOT, &ua_skip_pref, gt, v1, Operand(zero_reg));
-      }
-      __ lwl(a7, MemOperand(a1, 3, loadstore_chunk));  // Maybe in delay slot.
-
-      __ Pref(pref_hint_store, MemOperand(a0, 4 * pref_chunk));
-      __ Pref(pref_hint_store, MemOperand(a0, 5 * pref_chunk));
-
-      __ bind(&ua_skip_pref);
-      __ lwl(t0, MemOperand(a1, 4, loadstore_chunk));
-      __ lwl(t1, MemOperand(a1, 5, loadstore_chunk));
-      __ lwl(t2, MemOperand(a1, 6, loadstore_chunk));
-      __ lwl(t3, MemOperand(a1, 7, loadstore_chunk));
-      __ lwr(a4,
-             MemOperand(a1, 1, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(a5,
-             MemOperand(a1, 2, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(a6,
-             MemOperand(a1, 3, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(a7,
-             MemOperand(a1, 4, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t0,
-             MemOperand(a1, 5, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t1,
-             MemOperand(a1, 6, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t2,
-             MemOperand(a1, 7, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t3,
-             MemOperand(a1, 8, loadstore_chunk, MemOperand::offset_minus_one));
-    }
-    __ Pref(pref_hint_load, MemOperand(a1, 4 * pref_chunk));
-    __ Sw(a4, MemOperand(a0));
-    __ Sw(a5, MemOperand(a0, 1, loadstore_chunk));
-    __ Sw(a6, MemOperand(a0, 2, loadstore_chunk));
-    __ Sw(a7, MemOperand(a0, 3, loadstore_chunk));
-    __ Sw(t0, MemOperand(a0, 4, loadstore_chunk));
-    __ Sw(t1, MemOperand(a0, 5, loadstore_chunk));
-    __ Sw(t2, MemOperand(a0, 6, loadstore_chunk));
-    __ Sw(t3, MemOperand(a0, 7, loadstore_chunk));
-    if (kArchEndian == kLittle) {
-      __ lwr(a4, MemOperand(a1, 8, loadstore_chunk));
-      __ lwr(a5, MemOperand(a1, 9, loadstore_chunk));
-      __ lwr(a6, MemOperand(a1, 10, loadstore_chunk));
-      __ lwr(a7, MemOperand(a1, 11, loadstore_chunk));
-      __ lwr(t0, MemOperand(a1, 12, loadstore_chunk));
-      __ lwr(t1, MemOperand(a1, 13, loadstore_chunk));
-      __ lwr(t2, MemOperand(a1, 14, loadstore_chunk));
-      __ lwr(t3, MemOperand(a1, 15, loadstore_chunk));
-      __ lwl(a4,
-             MemOperand(a1, 9, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(a5,
-             MemOperand(a1, 10, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(a6,
-             MemOperand(a1, 11, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(a7,
-             MemOperand(a1, 12, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t0,
-             MemOperand(a1, 13, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t1,
-             MemOperand(a1, 14, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t2,
-             MemOperand(a1, 15, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t3,
-             MemOperand(a1, 16, loadstore_chunk, MemOperand::offset_minus_one));
-    } else {
-      __ lwl(a4, MemOperand(a1, 8, loadstore_chunk));
-      __ lwl(a5, MemOperand(a1, 9, loadstore_chunk));
-      __ lwl(a6, MemOperand(a1, 10, loadstore_chunk));
-      __ lwl(a7, MemOperand(a1, 11, loadstore_chunk));
-      __ lwl(t0, MemOperand(a1, 12, loadstore_chunk));
-      __ lwl(t1, MemOperand(a1, 13, loadstore_chunk));
-      __ lwl(t2, MemOperand(a1, 14, loadstore_chunk));
-      __ lwl(t3, MemOperand(a1, 15, loadstore_chunk));
-      __ lwr(a4,
-             MemOperand(a1, 9, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(a5,
-             MemOperand(a1, 10, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(a6,
-             MemOperand(a1, 11, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(a7,
-             MemOperand(a1, 12, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t0,
-             MemOperand(a1, 13, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t1,
-             MemOperand(a1, 14, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t2,
-             MemOperand(a1, 15, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t3,
-             MemOperand(a1, 16, loadstore_chunk, MemOperand::offset_minus_one));
-    }
-    __ Pref(pref_hint_load, MemOperand(a1, 5 * pref_chunk));
-    __ Sw(a4, MemOperand(a0, 8, loadstore_chunk));
-    __ Sw(a5, MemOperand(a0, 9, loadstore_chunk));
-    __ Sw(a6, MemOperand(a0, 10, loadstore_chunk));
-    __ Sw(a7, MemOperand(a0, 11, loadstore_chunk));
-    __ Sw(t0, MemOperand(a0, 12, loadstore_chunk));
-    __ Sw(t1, MemOperand(a0, 13, loadstore_chunk));
-    __ Sw(t2, MemOperand(a0, 14, loadstore_chunk));
-    __ Sw(t3, MemOperand(a0, 15, loadstore_chunk));
-    __ addiu(a0, a0, 16 * loadstore_chunk);
-    __ bne(a0, a3, &ua_loop16w);
-    __ addiu(a1, a1, 16 * loadstore_chunk);  // In delay slot.
-    __ mov(a2, t8);
-
-    // Here less than 64-bytes. Check for
-    // a 32 byte chunk and copy if there is one. Otherwise jump down to
-    // ua_chk1w to handle the tail end of the copy.
-    __ bind(&ua_chkw);
-    __ Pref(pref_hint_load, MemOperand(a1));
-    __ andi(t8, a2, 0x1F);
-
-    __ beq(a2, t8, &ua_chk1w);
-    __ nop();  // In delay slot.
-    if (kArchEndian == kLittle) {
-      __ lwr(a4, MemOperand(a1));
-      __ lwr(a5, MemOperand(a1, 1, loadstore_chunk));
-      __ lwr(a6, MemOperand(a1, 2, loadstore_chunk));
-      __ lwr(a7, MemOperand(a1, 3, loadstore_chunk));
-      __ lwr(t0, MemOperand(a1, 4, loadstore_chunk));
-      __ lwr(t1, MemOperand(a1, 5, loadstore_chunk));
-      __ lwr(t2, MemOperand(a1, 6, loadstore_chunk));
-      __ lwr(t3, MemOperand(a1, 7, loadstore_chunk));
-      __ lwl(a4,
-             MemOperand(a1, 1, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(a5,
-             MemOperand(a1, 2, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(a6,
-             MemOperand(a1, 3, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(a7,
-             MemOperand(a1, 4, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t0,
-             MemOperand(a1, 5, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t1,
-             MemOperand(a1, 6, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t2,
-             MemOperand(a1, 7, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwl(t3,
-             MemOperand(a1, 8, loadstore_chunk, MemOperand::offset_minus_one));
-    } else {
-      __ lwl(a4, MemOperand(a1));
-      __ lwl(a5, MemOperand(a1, 1, loadstore_chunk));
-      __ lwl(a6, MemOperand(a1, 2, loadstore_chunk));
-      __ lwl(a7, MemOperand(a1, 3, loadstore_chunk));
-      __ lwl(t0, MemOperand(a1, 4, loadstore_chunk));
-      __ lwl(t1, MemOperand(a1, 5, loadstore_chunk));
-      __ lwl(t2, MemOperand(a1, 6, loadstore_chunk));
-      __ lwl(t3, MemOperand(a1, 7, loadstore_chunk));
-      __ lwr(a4,
-             MemOperand(a1, 1, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(a5,
-             MemOperand(a1, 2, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(a6,
-             MemOperand(a1, 3, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(a7,
-             MemOperand(a1, 4, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t0,
-             MemOperand(a1, 5, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t1,
-             MemOperand(a1, 6, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t2,
-             MemOperand(a1, 7, loadstore_chunk, MemOperand::offset_minus_one));
-      __ lwr(t3,
-             MemOperand(a1, 8, loadstore_chunk, MemOperand::offset_minus_one));
-    }
-    __ addiu(a1, a1, 8 * loadstore_chunk);
-    __ Sw(a4, MemOperand(a0));
-    __ Sw(a5, MemOperand(a0, 1, loadstore_chunk));
-    __ Sw(a6, MemOperand(a0, 2, loadstore_chunk));
-    __ Sw(a7, MemOperand(a0, 3, loadstore_chunk));
-    __ Sw(t0, MemOperand(a0, 4, loadstore_chunk));
-    __ Sw(t1, MemOperand(a0, 5, loadstore_chunk));
-    __ Sw(t2, MemOperand(a0, 6, loadstore_chunk));
-    __ Sw(t3, MemOperand(a0, 7, loadstore_chunk));
-    __ addiu(a0, a0, 8 * loadstore_chunk);
-
-    // Less than 32 bytes to copy. Set up for a loop to
-    // copy one word at a time.
-    __ bind(&ua_chk1w);
-    __ andi(a2, t8, loadstore_chunk - 1);
-    __ beq(a2, t8, &ua_smallCopy);
-    __ subu(a3, t8, a2);  // In delay slot.
-    __ addu(a3, a0, a3);
-
-    __ bind(&ua_wordCopy_loop);
-    if (kArchEndian == kLittle) {
-      __ lwr(v1, MemOperand(a1));
-      __ lwl(v1,
-             MemOperand(a1, 1, loadstore_chunk, MemOperand::offset_minus_one));
-    } else {
-      __ lwl(v1, MemOperand(a1));
-      __ lwr(v1,
-             MemOperand(a1, 1, loadstore_chunk, MemOperand::offset_minus_one));
-    }
-    __ addiu(a0, a0, loadstore_chunk);
-    __ addiu(a1, a1, loadstore_chunk);
-    __ bne(a0, a3, &ua_wordCopy_loop);
-    __ Sw(v1, MemOperand(a0, -1, loadstore_chunk));  // In delay slot.
-
-    // Copy the last 8 bytes.
-    __ bind(&ua_smallCopy);
-    __ beq(a2, zero_reg, &leave);
-    __ addu(a3, a0, a2);  // In delay slot.
-
-    __ bind(&ua_smallCopy_loop);
-    __ Lb(v1, MemOperand(a1));
-    __ addiu(a0, a0, 1);
-    __ addiu(a1, a1, 1);
-    __ bne(a0, a3, &ua_smallCopy_loop);
-    __ Sb(v1, MemOperand(a0, -1));  // In delay slot.
-
-    __ jr(ra);
-    __ nop();
-  }
-  CodeDesc desc;
-  masm.GetCode(isolte, &desc);
-  DCHECK(!RelocInfo::RequiresRelocation(isolate, desc));
-
-  Assembler::FlushICache(isolate, buffer, allocated);
-  CHECK(SetPermissions(buffer, allocated, PageAllocator::kReadExecute));
-  return FUNCTION_CAST<MemCopyUint8Function>(buffer);
-#endif
-}
-#endif
-
-UnaryMathFunctionWithIsolate CreateSqrtFunction(Isolate* isolate) {
-#if defined(USE_SIMULATOR)
-  return nullptr;
-#else
-  size_t allocated = 0;
-  byte* buffer = AllocatePage(isolate->heap()->GetRandomMmapAddr(), &allocated);
-  if (buffer == nullptr) return nullptr;
-
-  MacroAssembler masm(isolate, buffer, static_cast<int>(allocated),
-                      CodeObjectRequired::kNo);
-
-  __ MovFromFloatParameter(f12);
-  __ sqrt_d(f0, f12);
-  __ MovToFloatResult(f0);
-  __ Ret();
-
-  CodeDesc desc;
-  masm.GetCode(isolate, &desc);
-  DCHECK(!RelocInfo::RequiresRelocation(isolate, desc));
-
-  Assembler::FlushICache(isolate, buffer, allocated);
-  CHECK(SetPermissions(buffer, allocated, PageAllocator::kReadExecute));
-  return FUNCTION_CAST<UnaryMathFunctionWithIsolate>(buffer);
-#endif
-}
-
-#undef __
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_MIPS64
diff --git a/src/v8/src/mips64/constants-mips64.cc b/src/v8/src/mips64/constants-mips64.cc
deleted file mode 100644
index c087753..0000000
--- a/src/v8/src/mips64/constants-mips64.cc
+++ /dev/null
@@ -1,163 +0,0 @@
-// Copyright 2011 the V8 project 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 V8_TARGET_ARCH_MIPS64
-
-#include "src/mips64/constants-mips64.h"
-
-namespace v8 {
-namespace internal {
-
-
-// -----------------------------------------------------------------------------
-// Registers.
-
-
-// These register names are defined in a way to match the native disassembler
-// formatting. See for example the command "objdump -d <binary file>".
-const char* Registers::names_[kNumSimuRegisters] = {
-  "zero_reg",
-  "at",
-  "v0", "v1",
-  "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7",
-  "t0", "t1", "t2", "t3",
-  "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
-  "t8", "t9",
-  "k0", "k1",
-  "gp",
-  "sp",
-  "fp",
-  "ra",
-  "LO", "HI",
-  "pc"
-};
-
-
-// List of alias names which can be used when referring to MIPS registers.
-const Registers::RegisterAlias Registers::aliases_[] = {
-    {0, "zero"},
-    {23, "cp"},
-    {30, "s8"},
-    {30, "s8_fp"},
-    {kInvalidRegister, nullptr}};
-
-const char* Registers::Name(int reg) {
-  const char* result;
-  if ((0 <= reg) && (reg < kNumSimuRegisters)) {
-    result = names_[reg];
-  } else {
-    result = "noreg";
-  }
-  return result;
-}
-
-
-int Registers::Number(const char* name) {
-  // Look through the canonical names.
-  for (int i = 0; i < kNumSimuRegisters; i++) {
-    if (strcmp(names_[i], name) == 0) {
-      return i;
-    }
-  }
-
-  // Look through the alias names.
-  int i = 0;
-  while (aliases_[i].reg != kInvalidRegister) {
-    if (strcmp(aliases_[i].name, name) == 0) {
-      return aliases_[i].reg;
-    }
-    i++;
-  }
-
-  // No register with the reguested name found.
-  return kInvalidRegister;
-}
-
-
-const char* FPURegisters::names_[kNumFPURegisters] = {
-  "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "f10", "f11",
-  "f12", "f13", "f14", "f15", "f16", "f17", "f18", "f19", "f20", "f21",
-  "f22", "f23", "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31"
-};
-
-
-// List of alias names which can be used when referring to MIPS registers.
-const FPURegisters::RegisterAlias FPURegisters::aliases_[] = {
-    {kInvalidRegister, nullptr}};
-
-const char* FPURegisters::Name(int creg) {
-  const char* result;
-  if ((0 <= creg) && (creg < kNumFPURegisters)) {
-    result = names_[creg];
-  } else {
-    result = "nocreg";
-  }
-  return result;
-}
-
-
-int FPURegisters::Number(const char* name) {
-  // Look through the canonical names.
-  for (int i = 0; i < kNumFPURegisters; i++) {
-    if (strcmp(names_[i], name) == 0) {
-      return i;
-    }
-  }
-
-  // Look through the alias names.
-  int i = 0;
-  while (aliases_[i].creg != kInvalidRegister) {
-    if (strcmp(aliases_[i].name, name) == 0) {
-      return aliases_[i].creg;
-    }
-    i++;
-  }
-
-  // No Cregister with the reguested name found.
-  return kInvalidFPURegister;
-}
-
-const char* MSARegisters::names_[kNumMSARegisters] = {
-    "w0",  "w1",  "w2",  "w3",  "w4",  "w5",  "w6",  "w7",  "w8",  "w9",  "w10",
-    "w11", "w12", "w13", "w14", "w15", "w16", "w17", "w18", "w19", "w20", "w21",
-    "w22", "w23", "w24", "w25", "w26", "w27", "w28", "w29", "w30", "w31"};
-
-const MSARegisters::RegisterAlias MSARegisters::aliases_[] = {
-    {kInvalidRegister, nullptr}};
-
-const char* MSARegisters::Name(int creg) {
-  const char* result;
-  if ((0 <= creg) && (creg < kNumMSARegisters)) {
-    result = names_[creg];
-  } else {
-    result = "nocreg";
-  }
-  return result;
-}
-
-int MSARegisters::Number(const char* name) {
-  // Look through the canonical names.
-  for (int i = 0; i < kNumMSARegisters; i++) {
-    if (strcmp(names_[i], name) == 0) {
-      return i;
-    }
-  }
-
-  // Look through the alias names.
-  int i = 0;
-  while (aliases_[i].creg != kInvalidRegister) {
-    if (strcmp(aliases_[i].name, name) == 0) {
-      return aliases_[i].creg;
-    }
-    i++;
-  }
-
-  // No Cregister with the reguested name found.
-  return kInvalidMSARegister;
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_MIPS64
diff --git a/src/v8/src/mips64/constants-mips64.h b/src/v8/src/mips64/constants-mips64.h
deleted file mode 100644
index 0c107d1..0000000
--- a/src/v8/src/mips64/constants-mips64.h
+++ /dev/null
@@ -1,2016 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef  V8_MIPS_CONSTANTS_H_
-#define  V8_MIPS_CONSTANTS_H_
-
-#include "src/base/logging.h"
-#include "src/base/macros.h"
-#include "src/globals.h"
-
-// UNIMPLEMENTED_ macro for MIPS.
-#ifdef DEBUG
-#define UNIMPLEMENTED_MIPS()                                                  \
-  v8::internal::PrintF("%s, \tline %d: \tfunction %s not implemented. \n",    \
-                       __FILE__, __LINE__, __func__)
-#else
-#define UNIMPLEMENTED_MIPS()
-#endif
-
-#define UNSUPPORTED_MIPS() v8::internal::PrintF("Unsupported instruction.\n")
-
-enum ArchVariants {
-  kMips64r2,
-  kMips64r6
-};
-
-
-#ifdef _MIPS_ARCH_MIPS64R2
-  static const ArchVariants kArchVariant = kMips64r2;
-#elif  _MIPS_ARCH_MIPS64R6
-  static const ArchVariants kArchVariant = kMips64r6;
-#else
-  static const ArchVariants kArchVariant = kMips64r2;
-#endif
-
-
-  enum Endianness { kLittle, kBig };
-
-#if defined(V8_TARGET_LITTLE_ENDIAN)
-  static const Endianness kArchEndian = kLittle;
-#elif defined(V8_TARGET_BIG_ENDIAN)
-  static const Endianness kArchEndian = kBig;
-#else
-#error Unknown endianness
-#endif
-
-
-// TODO(plind): consider renaming these ...
-#if(defined(__mips_hard_float) && __mips_hard_float != 0)
-// Use floating-point coprocessor instructions. This flag is raised when
-// -mhard-float is passed to the compiler.
-const bool IsMipsSoftFloatABI = false;
-#elif(defined(__mips_soft_float) && __mips_soft_float != 0)
-// This flag is raised when -msoft-float is passed to the compiler.
-// Although FPU is a base requirement for v8, soft-float ABI is used
-// on soft-float systems with FPU kernel emulation.
-const bool IsMipsSoftFloatABI = true;
-#else
-const bool IsMipsSoftFloatABI = true;
-#endif
-
-#if defined(V8_TARGET_LITTLE_ENDIAN)
-const uint32_t kMipsLwrOffset = 0;
-const uint32_t kMipsLwlOffset = 3;
-const uint32_t kMipsSwrOffset = 0;
-const uint32_t kMipsSwlOffset = 3;
-const uint32_t kMipsLdrOffset = 0;
-const uint32_t kMipsLdlOffset = 7;
-const uint32_t kMipsSdrOffset = 0;
-const uint32_t kMipsSdlOffset = 7;
-#elif defined(V8_TARGET_BIG_ENDIAN)
-const uint32_t kMipsLwrOffset = 3;
-const uint32_t kMipsLwlOffset = 0;
-const uint32_t kMipsSwrOffset = 3;
-const uint32_t kMipsSwlOffset = 0;
-const uint32_t kMipsLdrOffset = 7;
-const uint32_t kMipsLdlOffset = 0;
-const uint32_t kMipsSdrOffset = 7;
-const uint32_t kMipsSdlOffset = 0;
-#else
-#error Unknown endianness
-#endif
-
-#ifndef __STDC_FORMAT_MACROS
-#define __STDC_FORMAT_MACROS
-#endif
-#include <inttypes.h>
-
-
-// Defines constants and accessor classes to assemble, disassemble and
-// simulate MIPS32 instructions.
-//
-// See: MIPS32 Architecture For Programmers
-//      Volume II: The MIPS32 Instruction Set
-// Try www.cs.cornell.edu/courses/cs3410/2008fa/MIPS_Vol2.pdf.
-
-namespace v8 {
-namespace internal {
-
-// -----------------------------------------------------------------------------
-// Registers and FPURegisters.
-
-// Number of general purpose registers.
-const int kNumRegisters = 32;
-const int kInvalidRegister = -1;
-
-// Number of registers with HI, LO, and pc.
-const int kNumSimuRegisters = 35;
-
-// In the simulator, the PC register is simulated as the 34th register.
-const int kPCRegister = 34;
-
-// Number coprocessor registers.
-const int kNumFPURegisters = 32;
-const int kInvalidFPURegister = -1;
-
-// Number of MSA registers
-const int kNumMSARegisters = 32;
-const int kInvalidMSARegister = -1;
-
-const int kInvalidMSAControlRegister = -1;
-const int kMSAIRRegister = 0;
-const int kMSACSRRegister = 1;
-const int kMSARegSize = 128;
-const int kMSALanesByte = kMSARegSize / 8;
-const int kMSALanesHalf = kMSARegSize / 16;
-const int kMSALanesWord = kMSARegSize / 32;
-const int kMSALanesDword = kMSARegSize / 64;
-
-// FPU (coprocessor 1) control registers. Currently only FCSR is implemented.
-const int kFCSRRegister = 31;
-const int kInvalidFPUControlRegister = -1;
-const uint32_t kFPUInvalidResult = static_cast<uint32_t>(1 << 31) - 1;
-const int32_t kFPUInvalidResultNegative = static_cast<int32_t>(1 << 31);
-const uint64_t kFPU64InvalidResult =
-    static_cast<uint64_t>(static_cast<uint64_t>(1) << 63) - 1;
-const int64_t kFPU64InvalidResultNegative =
-    static_cast<int64_t>(static_cast<uint64_t>(1) << 63);
-
-// FCSR constants.
-const uint32_t kFCSRInexactFlagBit = 2;
-const uint32_t kFCSRUnderflowFlagBit = 3;
-const uint32_t kFCSROverflowFlagBit = 4;
-const uint32_t kFCSRDivideByZeroFlagBit = 5;
-const uint32_t kFCSRInvalidOpFlagBit = 6;
-const uint32_t kFCSRNaN2008FlagBit = 18;
-
-const uint32_t kFCSRInexactFlagMask = 1 << kFCSRInexactFlagBit;
-const uint32_t kFCSRUnderflowFlagMask = 1 << kFCSRUnderflowFlagBit;
-const uint32_t kFCSROverflowFlagMask = 1 << kFCSROverflowFlagBit;
-const uint32_t kFCSRDivideByZeroFlagMask = 1 << kFCSRDivideByZeroFlagBit;
-const uint32_t kFCSRInvalidOpFlagMask = 1 << kFCSRInvalidOpFlagBit;
-const uint32_t kFCSRNaN2008FlagMask = 1 << kFCSRNaN2008FlagBit;
-
-const uint32_t kFCSRFlagMask =
-    kFCSRInexactFlagMask |
-    kFCSRUnderflowFlagMask |
-    kFCSROverflowFlagMask |
-    kFCSRDivideByZeroFlagMask |
-    kFCSRInvalidOpFlagMask;
-
-const uint32_t kFCSRExceptionFlagMask = kFCSRFlagMask ^ kFCSRInexactFlagMask;
-
-// 'pref' instruction hints
-const int32_t kPrefHintLoad = 0;
-const int32_t kPrefHintStore = 1;
-const int32_t kPrefHintLoadStreamed = 4;
-const int32_t kPrefHintStoreStreamed = 5;
-const int32_t kPrefHintLoadRetained = 6;
-const int32_t kPrefHintStoreRetained = 7;
-const int32_t kPrefHintWritebackInvalidate = 25;
-const int32_t kPrefHintPrepareForStore = 30;
-
-// Helper functions for converting between register numbers and names.
-class Registers {
- public:
-  // Return the name of the register.
-  static const char* Name(int reg);
-
-  // Lookup the register number for the name provided.
-  static int Number(const char* name);
-
-  struct RegisterAlias {
-    int reg;
-    const char* name;
-  };
-
-  static const int64_t kMaxValue = 0x7fffffffffffffffl;
-  static const int64_t kMinValue = 0x8000000000000000l;
-
- private:
-  static const char* names_[kNumSimuRegisters];
-  static const RegisterAlias aliases_[];
-};
-
-// Helper functions for converting between register numbers and names.
-class FPURegisters {
- public:
-  // Return the name of the register.
-  static const char* Name(int reg);
-
-  // Lookup the register number for the name provided.
-  static int Number(const char* name);
-
-  struct RegisterAlias {
-    int creg;
-    const char* name;
-  };
-
- private:
-  static const char* names_[kNumFPURegisters];
-  static const RegisterAlias aliases_[];
-};
-
-// Helper functions for converting between register numbers and names.
-class MSARegisters {
- public:
-  // Return the name of the register.
-  static const char* Name(int reg);
-
-  // Lookup the register number for the name provided.
-  static int Number(const char* name);
-
-  struct RegisterAlias {
-    int creg;
-    const char* name;
-  };
-
- private:
-  static const char* names_[kNumMSARegisters];
-  static const RegisterAlias aliases_[];
-};
-
-// -----------------------------------------------------------------------------
-// Instructions encoding constants.
-
-// On MIPS all instructions are 32 bits.
-typedef int32_t Instr;
-
-// Special Software Interrupt codes when used in the presence of the MIPS
-// simulator.
-enum SoftwareInterruptCodes {
-  // Transition to C code.
-  call_rt_redirected = 0xfffff
-};
-
-// On MIPS Simulator breakpoints can have different codes:
-// - Breaks between 0 and kMaxWatchpointCode are treated as simple watchpoints,
-//   the simulator will run through them and print the registers.
-// - Breaks between kMaxWatchpointCode and kMaxStopCode are treated as stop()
-//   instructions (see Assembler::stop()).
-// - Breaks larger than kMaxStopCode are simple breaks, dropping you into the
-//   debugger.
-const uint32_t kMaxWatchpointCode = 31;
-const uint32_t kMaxStopCode = 127;
-STATIC_ASSERT(kMaxWatchpointCode < kMaxStopCode);
-
-
-// ----- Fields offset and length.
-const int kOpcodeShift   = 26;
-const int kOpcodeBits    = 6;
-const int kRsShift       = 21;
-const int kRsBits        = 5;
-const int kRtShift       = 16;
-const int kRtBits        = 5;
-const int kRdShift       = 11;
-const int kRdBits        = 5;
-const int kSaShift       = 6;
-const int kSaBits        = 5;
-const int kLsaSaBits = 2;
-const int kFunctionShift = 0;
-const int kFunctionBits  = 6;
-const int kLuiShift      = 16;
-const int kBp2Shift = 6;
-const int kBp2Bits = 2;
-const int kBp3Shift = 6;
-const int kBp3Bits = 3;
-const int kBaseShift = 21;
-const int kBaseBits = 5;
-const int kBit6Shift = 6;
-const int kBit6Bits = 1;
-
-const int kImm9Shift = 7;
-const int kImm9Bits = 9;
-const int kImm16Shift = 0;
-const int kImm16Bits = 16;
-const int kImm18Shift = 0;
-const int kImm18Bits = 18;
-const int kImm19Shift = 0;
-const int kImm19Bits = 19;
-const int kImm21Shift = 0;
-const int kImm21Bits = 21;
-const int kImm26Shift = 0;
-const int kImm26Bits = 26;
-const int kImm28Shift = 0;
-const int kImm28Bits = 28;
-const int kImm32Shift = 0;
-const int kImm32Bits = 32;
-const int kMsaImm8Shift = 16;
-const int kMsaImm8Bits = 8;
-const int kMsaImm5Shift = 16;
-const int kMsaImm5Bits = 5;
-const int kMsaImm10Shift = 11;
-const int kMsaImm10Bits = 10;
-const int kMsaImmMI10Shift = 16;
-const int kMsaImmMI10Bits = 10;
-
-// In branches and jumps immediate fields point to words, not bytes,
-// and are therefore shifted by 2.
-const int kImmFieldShift = 2;
-
-const int kFrBits        = 5;
-const int kFrShift       = 21;
-const int kFsShift       = 11;
-const int kFsBits        = 5;
-const int kFtShift       = 16;
-const int kFtBits        = 5;
-const int kFdShift       = 6;
-const int kFdBits        = 5;
-const int kFCccShift     = 8;
-const int kFCccBits      = 3;
-const int kFBccShift     = 18;
-const int kFBccBits      = 3;
-const int kFBtrueShift   = 16;
-const int kFBtrueBits    = 1;
-const int kWtBits = 5;
-const int kWtShift = 16;
-const int kWsBits = 5;
-const int kWsShift = 11;
-const int kWdBits = 5;
-const int kWdShift = 6;
-
-// ----- Miscellaneous useful masks.
-// Instruction bit masks.
-const int kOpcodeMask = ((1 << kOpcodeBits) - 1) << kOpcodeShift;
-const int kImm9Mask = ((1 << kImm9Bits) - 1) << kImm9Shift;
-const int kImm16Mask = ((1 << kImm16Bits) - 1) << kImm16Shift;
-const int kImm18Mask = ((1 << kImm18Bits) - 1) << kImm18Shift;
-const int kImm19Mask = ((1 << kImm19Bits) - 1) << kImm19Shift;
-const int kImm21Mask = ((1 << kImm21Bits) - 1) << kImm21Shift;
-const int kImm26Mask = ((1 << kImm26Bits) - 1) << kImm26Shift;
-const int kImm28Mask = ((1 << kImm28Bits) - 1) << kImm28Shift;
-const int kImm5Mask = ((1 << 5) - 1);
-const int kImm8Mask = ((1 << 8) - 1);
-const int kImm10Mask = ((1 << 10) - 1);
-const int kMsaI5I10Mask = ((7U << 23) | ((1 << 6) - 1));
-const int kMsaI8Mask = ((3U << 24) | ((1 << 6) - 1));
-const int kMsaI5Mask = ((7U << 23) | ((1 << 6) - 1));
-const int kMsaMI10Mask = (15U << 2);
-const int kMsaBITMask = ((7U << 23) | ((1 << 6) - 1));
-const int kMsaELMMask = (15U << 22);
-const int kMsaLongerELMMask = kMsaELMMask | (63U << 16);
-const int kMsa3RMask = ((7U << 23) | ((1 << 6) - 1));
-const int kMsa3RFMask = ((15U << 22) | ((1 << 6) - 1));
-const int kMsaVECMask = (23U << 21);
-const int kMsa2RMask = (7U << 18);
-const int kMsa2RFMask = (15U << 17);
-const int kRsFieldMask = ((1 << kRsBits) - 1) << kRsShift;
-const int kRtFieldMask = ((1 << kRtBits) - 1) << kRtShift;
-const int kRdFieldMask = ((1 << kRdBits) - 1) << kRdShift;
-const int kSaFieldMask = ((1 << kSaBits) - 1) << kSaShift;
-const int kFunctionFieldMask = ((1 << kFunctionBits) - 1) << kFunctionShift;
-// Misc masks.
-const int kHiMaskOf32 = 0xffff << 16;  // Only to be used with 32-bit values
-const int kLoMaskOf32 = 0xffff;
-const int kSignMaskOf32 = 0x80000000;  // Only to be used with 32-bit values
-const int kJumpAddrMask = (1 << (kImm26Bits + kImmFieldShift)) - 1;
-const int64_t kTop16MaskOf64 = (int64_t)0xffff << 48;
-const int64_t kHigher16MaskOf64 = (int64_t)0xffff << 32;
-const int64_t kUpper16MaskOf64 = (int64_t)0xffff << 16;
-const int32_t kJalRawMark = 0x00000000;
-const int32_t kJRawMark = 0xf0000000;
-const int32_t kJumpRawMask = 0xf0000000;
-
-// ----- MIPS Opcodes and Function Fields.
-// We use this presentation to stay close to the table representation in
-// MIPS32 Architecture For Programmers, Volume II: The MIPS32 Instruction Set.
-enum Opcode : uint32_t {
-  SPECIAL = 0U << kOpcodeShift,
-  REGIMM = 1U << kOpcodeShift,
-
-  J = ((0U << 3) + 2) << kOpcodeShift,
-  JAL = ((0U << 3) + 3) << kOpcodeShift,
-  BEQ = ((0U << 3) + 4) << kOpcodeShift,
-  BNE = ((0U << 3) + 5) << kOpcodeShift,
-  BLEZ = ((0U << 3) + 6) << kOpcodeShift,
-  BGTZ = ((0U << 3) + 7) << kOpcodeShift,
-
-  ADDI = ((1U << 3) + 0) << kOpcodeShift,
-  ADDIU = ((1U << 3) + 1) << kOpcodeShift,
-  SLTI = ((1U << 3) + 2) << kOpcodeShift,
-  SLTIU = ((1U << 3) + 3) << kOpcodeShift,
-  ANDI = ((1U << 3) + 4) << kOpcodeShift,
-  ORI = ((1U << 3) + 5) << kOpcodeShift,
-  XORI = ((1U << 3) + 6) << kOpcodeShift,
-  LUI = ((1U << 3) + 7) << kOpcodeShift,  // LUI/AUI family.
-  DAUI = ((3U << 3) + 5) << kOpcodeShift,
-
-  BEQC = ((2U << 3) + 0) << kOpcodeShift,
-  COP1 = ((2U << 3) + 1) << kOpcodeShift,  // Coprocessor 1 class.
-  BEQL = ((2U << 3) + 4) << kOpcodeShift,
-  BNEL = ((2U << 3) + 5) << kOpcodeShift,
-  BLEZL = ((2U << 3) + 6) << kOpcodeShift,
-  BGTZL = ((2U << 3) + 7) << kOpcodeShift,
-
-  DADDI = ((3U << 3) + 0) << kOpcodeShift,  // This is also BNEC.
-  DADDIU = ((3U << 3) + 1) << kOpcodeShift,
-  LDL = ((3U << 3) + 2) << kOpcodeShift,
-  LDR = ((3U << 3) + 3) << kOpcodeShift,
-  SPECIAL2 = ((3U << 3) + 4) << kOpcodeShift,
-  MSA = ((3U << 3) + 6) << kOpcodeShift,
-  SPECIAL3 = ((3U << 3) + 7) << kOpcodeShift,
-
-  LB = ((4U << 3) + 0) << kOpcodeShift,
-  LH = ((4U << 3) + 1) << kOpcodeShift,
-  LWL = ((4U << 3) + 2) << kOpcodeShift,
-  LW = ((4U << 3) + 3) << kOpcodeShift,
-  LBU = ((4U << 3) + 4) << kOpcodeShift,
-  LHU = ((4U << 3) + 5) << kOpcodeShift,
-  LWR = ((4U << 3) + 6) << kOpcodeShift,
-  LWU = ((4U << 3) + 7) << kOpcodeShift,
-
-  SB = ((5U << 3) + 0) << kOpcodeShift,
-  SH = ((5U << 3) + 1) << kOpcodeShift,
-  SWL = ((5U << 3) + 2) << kOpcodeShift,
-  SW = ((5U << 3) + 3) << kOpcodeShift,
-  SDL = ((5U << 3) + 4) << kOpcodeShift,
-  SDR = ((5U << 3) + 5) << kOpcodeShift,
-  SWR = ((5U << 3) + 6) << kOpcodeShift,
-
-  LL = ((6U << 3) + 0) << kOpcodeShift,
-  LWC1 = ((6U << 3) + 1) << kOpcodeShift,
-  BC = ((6U << 3) + 2) << kOpcodeShift,
-  LLD = ((6U << 3) + 4) << kOpcodeShift,
-  LDC1 = ((6U << 3) + 5) << kOpcodeShift,
-  POP66 = ((6U << 3) + 6) << kOpcodeShift,
-  LD = ((6U << 3) + 7) << kOpcodeShift,
-
-  PREF = ((6U << 3) + 3) << kOpcodeShift,
-
-  SC = ((7U << 3) + 0) << kOpcodeShift,
-  SWC1 = ((7U << 3) + 1) << kOpcodeShift,
-  BALC = ((7U << 3) + 2) << kOpcodeShift,
-  PCREL = ((7U << 3) + 3) << kOpcodeShift,
-  SCD = ((7U << 3) + 4) << kOpcodeShift,
-  SDC1 = ((7U << 3) + 5) << kOpcodeShift,
-  POP76 = ((7U << 3) + 6) << kOpcodeShift,
-  SD = ((7U << 3) + 7) << kOpcodeShift,
-
-  COP1X = ((1U << 4) + 3) << kOpcodeShift,
-
-  // New r6 instruction.
-  POP06 = BLEZ,   // bgeuc/bleuc, blezalc, bgezalc
-  POP07 = BGTZ,   // bltuc/bgtuc, bgtzalc, bltzalc
-  POP10 = ADDI,   // beqzalc, bovc, beqc
-  POP26 = BLEZL,  // bgezc, blezc, bgec/blec
-  POP27 = BGTZL,  // bgtzc, bltzc, bltc/bgtc
-  POP30 = DADDI,  // bnezalc, bnvc, bnec
-};
-
-enum SecondaryField : uint32_t {
-  // SPECIAL Encoding of Function Field.
-  SLL = ((0U << 3) + 0),
-  MOVCI = ((0U << 3) + 1),
-  SRL = ((0U << 3) + 2),
-  SRA = ((0U << 3) + 3),
-  SLLV = ((0U << 3) + 4),
-  LSA = ((0U << 3) + 5),
-  SRLV = ((0U << 3) + 6),
-  SRAV = ((0U << 3) + 7),
-
-  JR = ((1U << 3) + 0),
-  JALR = ((1U << 3) + 1),
-  MOVZ = ((1U << 3) + 2),
-  MOVN = ((1U << 3) + 3),
-  BREAK = ((1U << 3) + 5),
-  SYNC = ((1U << 3) + 7),
-
-  MFHI = ((2U << 3) + 0),
-  CLZ_R6 = ((2U << 3) + 0),
-  CLO_R6 = ((2U << 3) + 1),
-  MFLO = ((2U << 3) + 2),
-  DCLZ_R6 = ((2U << 3) + 2),
-  DCLO_R6 = ((2U << 3) + 3),
-  DSLLV = ((2U << 3) + 4),
-  DLSA = ((2U << 3) + 5),
-  DSRLV = ((2U << 3) + 6),
-  DSRAV = ((2U << 3) + 7),
-
-  MULT = ((3U << 3) + 0),
-  MULTU = ((3U << 3) + 1),
-  DIV = ((3U << 3) + 2),
-  DIVU = ((3U << 3) + 3),
-  DMULT = ((3U << 3) + 4),
-  DMULTU = ((3U << 3) + 5),
-  DDIV = ((3U << 3) + 6),
-  DDIVU = ((3U << 3) + 7),
-
-  ADD = ((4U << 3) + 0),
-  ADDU = ((4U << 3) + 1),
-  SUB = ((4U << 3) + 2),
-  SUBU = ((4U << 3) + 3),
-  AND = ((4U << 3) + 4),
-  OR = ((4U << 3) + 5),
-  XOR = ((4U << 3) + 6),
-  NOR = ((4U << 3) + 7),
-
-  SLT = ((5U << 3) + 2),
-  SLTU = ((5U << 3) + 3),
-  DADD = ((5U << 3) + 4),
-  DADDU = ((5U << 3) + 5),
-  DSUB = ((5U << 3) + 6),
-  DSUBU = ((5U << 3) + 7),
-
-  TGE = ((6U << 3) + 0),
-  TGEU = ((6U << 3) + 1),
-  TLT = ((6U << 3) + 2),
-  TLTU = ((6U << 3) + 3),
-  TEQ = ((6U << 3) + 4),
-  SELEQZ_S = ((6U << 3) + 5),
-  TNE = ((6U << 3) + 6),
-  SELNEZ_S = ((6U << 3) + 7),
-
-  DSLL = ((7U << 3) + 0),
-  DSRL = ((7U << 3) + 2),
-  DSRA = ((7U << 3) + 3),
-  DSLL32 = ((7U << 3) + 4),
-  DSRL32 = ((7U << 3) + 6),
-  DSRA32 = ((7U << 3) + 7),
-
-  // Multiply integers in r6.
-  MUL_MUH = ((3U << 3) + 0),      // MUL, MUH.
-  MUL_MUH_U = ((3U << 3) + 1),    // MUL_U, MUH_U.
-  D_MUL_MUH = ((7U << 2) + 0),    // DMUL, DMUH.
-  D_MUL_MUH_U = ((7U << 2) + 1),  // DMUL_U, DMUH_U.
-  RINT = ((3U << 3) + 2),
-
-  MUL_OP = ((0U << 3) + 2),
-  MUH_OP = ((0U << 3) + 3),
-  DIV_OP = ((0U << 3) + 2),
-  MOD_OP = ((0U << 3) + 3),
-
-  DIV_MOD = ((3U << 3) + 2),
-  DIV_MOD_U = ((3U << 3) + 3),
-  D_DIV_MOD = ((3U << 3) + 6),
-  D_DIV_MOD_U = ((3U << 3) + 7),
-
-  // drotr in special4?
-
-  // SPECIAL2 Encoding of Function Field.
-  MUL = ((0U << 3) + 2),
-  CLZ = ((4U << 3) + 0),
-  CLO = ((4U << 3) + 1),
-  DCLZ = ((4U << 3) + 4),
-  DCLO = ((4U << 3) + 5),
-
-  // SPECIAL3 Encoding of Function Field.
-  EXT = ((0U << 3) + 0),
-  DEXTM = ((0U << 3) + 1),
-  DEXTU = ((0U << 3) + 2),
-  DEXT = ((0U << 3) + 3),
-  INS = ((0U << 3) + 4),
-  DINSM = ((0U << 3) + 5),
-  DINSU = ((0U << 3) + 6),
-  DINS = ((0U << 3) + 7),
-
-  BSHFL = ((4U << 3) + 0),
-  DBSHFL = ((4U << 3) + 4),
-  SC_R6 = ((4U << 3) + 6),
-  SCD_R6 = ((4U << 3) + 7),
-  LL_R6 = ((6U << 3) + 6),
-  LLD_R6 = ((6U << 3) + 7),
-
-  // SPECIAL3 Encoding of sa Field.
-  BITSWAP = ((0U << 3) + 0),
-  ALIGN = ((0U << 3) + 2),
-  WSBH = ((0U << 3) + 2),
-  SEB = ((2U << 3) + 0),
-  SEH = ((3U << 3) + 0),
-
-  DBITSWAP = ((0U << 3) + 0),
-  DALIGN = ((0U << 3) + 1),
-  DBITSWAP_SA = ((0U << 3) + 0) << kSaShift,
-  DSBH = ((0U << 3) + 2),
-  DSHD = ((0U << 3) + 5),
-
-  // REGIMM  encoding of rt Field.
-  BLTZ = ((0U << 3) + 0) << 16,
-  BGEZ = ((0U << 3) + 1) << 16,
-  BLTZAL = ((2U << 3) + 0) << 16,
-  BGEZAL = ((2U << 3) + 1) << 16,
-  BGEZALL = ((2U << 3) + 3) << 16,
-  DAHI = ((0U << 3) + 6) << 16,
-  DATI = ((3U << 3) + 6) << 16,
-
-  // COP1 Encoding of rs Field.
-  MFC1 = ((0U << 3) + 0) << 21,
-  DMFC1 = ((0U << 3) + 1) << 21,
-  CFC1 = ((0U << 3) + 2) << 21,
-  MFHC1 = ((0U << 3) + 3) << 21,
-  MTC1 = ((0U << 3) + 4) << 21,
-  DMTC1 = ((0U << 3) + 5) << 21,
-  CTC1 = ((0U << 3) + 6) << 21,
-  MTHC1 = ((0U << 3) + 7) << 21,
-  BC1 = ((1U << 3) + 0) << 21,
-  S = ((2U << 3) + 0) << 21,
-  D = ((2U << 3) + 1) << 21,
-  W = ((2U << 3) + 4) << 21,
-  L = ((2U << 3) + 5) << 21,
-  PS = ((2U << 3) + 6) << 21,
-  // COP1 Encoding of Function Field When rs=S.
-
-  ADD_S = ((0U << 3) + 0),
-  SUB_S = ((0U << 3) + 1),
-  MUL_S = ((0U << 3) + 2),
-  DIV_S = ((0U << 3) + 3),
-  ABS_S = ((0U << 3) + 5),
-  SQRT_S = ((0U << 3) + 4),
-  MOV_S = ((0U << 3) + 6),
-  NEG_S = ((0U << 3) + 7),
-  ROUND_L_S = ((1U << 3) + 0),
-  TRUNC_L_S = ((1U << 3) + 1),
-  CEIL_L_S = ((1U << 3) + 2),
-  FLOOR_L_S = ((1U << 3) + 3),
-  ROUND_W_S = ((1U << 3) + 4),
-  TRUNC_W_S = ((1U << 3) + 5),
-  CEIL_W_S = ((1U << 3) + 6),
-  FLOOR_W_S = ((1U << 3) + 7),
-  RECIP_S = ((2U << 3) + 5),
-  RSQRT_S = ((2U << 3) + 6),
-  MADDF_S = ((3U << 3) + 0),
-  MSUBF_S = ((3U << 3) + 1),
-  CLASS_S = ((3U << 3) + 3),
-  CVT_D_S = ((4U << 3) + 1),
-  CVT_W_S = ((4U << 3) + 4),
-  CVT_L_S = ((4U << 3) + 5),
-  CVT_PS_S = ((4U << 3) + 6),
-  // COP1 Encoding of Function Field When rs=D.
-  ADD_D = ((0U << 3) + 0),
-  SUB_D = ((0U << 3) + 1),
-  MUL_D = ((0U << 3) + 2),
-  DIV_D = ((0U << 3) + 3),
-  SQRT_D = ((0U << 3) + 4),
-  ABS_D = ((0U << 3) + 5),
-  MOV_D = ((0U << 3) + 6),
-  NEG_D = ((0U << 3) + 7),
-  ROUND_L_D = ((1U << 3) + 0),
-  TRUNC_L_D = ((1U << 3) + 1),
-  CEIL_L_D = ((1U << 3) + 2),
-  FLOOR_L_D = ((1U << 3) + 3),
-  ROUND_W_D = ((1U << 3) + 4),
-  TRUNC_W_D = ((1U << 3) + 5),
-  CEIL_W_D = ((1U << 3) + 6),
-  FLOOR_W_D = ((1U << 3) + 7),
-  RECIP_D = ((2U << 3) + 5),
-  RSQRT_D = ((2U << 3) + 6),
-  MADDF_D = ((3U << 3) + 0),
-  MSUBF_D = ((3U << 3) + 1),
-  CLASS_D = ((3U << 3) + 3),
-  MIN = ((3U << 3) + 4),
-  MINA = ((3U << 3) + 5),
-  MAX = ((3U << 3) + 6),
-  MAXA = ((3U << 3) + 7),
-  CVT_S_D = ((4U << 3) + 0),
-  CVT_W_D = ((4U << 3) + 4),
-  CVT_L_D = ((4U << 3) + 5),
-  C_F_D = ((6U << 3) + 0),
-  C_UN_D = ((6U << 3) + 1),
-  C_EQ_D = ((6U << 3) + 2),
-  C_UEQ_D = ((6U << 3) + 3),
-  C_OLT_D = ((6U << 3) + 4),
-  C_ULT_D = ((6U << 3) + 5),
-  C_OLE_D = ((6U << 3) + 6),
-  C_ULE_D = ((6U << 3) + 7),
-
-  // COP1 Encoding of Function Field When rs=W or L.
-  CVT_S_W = ((4U << 3) + 0),
-  CVT_D_W = ((4U << 3) + 1),
-  CVT_S_L = ((4U << 3) + 0),
-  CVT_D_L = ((4U << 3) + 1),
-  BC1EQZ = ((2U << 2) + 1) << 21,
-  BC1NEZ = ((3U << 2) + 1) << 21,
-  // COP1 CMP positive predicates Bit 5..4 = 00.
-  CMP_AF = ((0U << 3) + 0),
-  CMP_UN = ((0U << 3) + 1),
-  CMP_EQ = ((0U << 3) + 2),
-  CMP_UEQ = ((0U << 3) + 3),
-  CMP_LT = ((0U << 3) + 4),
-  CMP_ULT = ((0U << 3) + 5),
-  CMP_LE = ((0U << 3) + 6),
-  CMP_ULE = ((0U << 3) + 7),
-  CMP_SAF = ((1U << 3) + 0),
-  CMP_SUN = ((1U << 3) + 1),
-  CMP_SEQ = ((1U << 3) + 2),
-  CMP_SUEQ = ((1U << 3) + 3),
-  CMP_SSLT = ((1U << 3) + 4),
-  CMP_SSULT = ((1U << 3) + 5),
-  CMP_SLE = ((1U << 3) + 6),
-  CMP_SULE = ((1U << 3) + 7),
-  // COP1 CMP negative predicates Bit 5..4 = 01.
-  CMP_AT = ((2U << 3) + 0),  // Reserved, not implemented.
-  CMP_OR = ((2U << 3) + 1),
-  CMP_UNE = ((2U << 3) + 2),
-  CMP_NE = ((2U << 3) + 3),
-  CMP_UGE = ((2U << 3) + 4),  // Reserved, not implemented.
-  CMP_OGE = ((2U << 3) + 5),  // Reserved, not implemented.
-  CMP_UGT = ((2U << 3) + 6),  // Reserved, not implemented.
-  CMP_OGT = ((2U << 3) + 7),  // Reserved, not implemented.
-  CMP_SAT = ((3U << 3) + 0),  // Reserved, not implemented.
-  CMP_SOR = ((3U << 3) + 1),
-  CMP_SUNE = ((3U << 3) + 2),
-  CMP_SNE = ((3U << 3) + 3),
-  CMP_SUGE = ((3U << 3) + 4),  // Reserved, not implemented.
-  CMP_SOGE = ((3U << 3) + 5),  // Reserved, not implemented.
-  CMP_SUGT = ((3U << 3) + 6),  // Reserved, not implemented.
-  CMP_SOGT = ((3U << 3) + 7),  // Reserved, not implemented.
-
-  SEL = ((2U << 3) + 0),
-  MOVF = ((2U << 3) + 1),      // Function field for MOVT.fmt and MOVF.fmt
-  MOVZ_C = ((2U << 3) + 2),    // COP1 on FPR registers.
-  MOVN_C = ((2U << 3) + 3),    // COP1 on FPR registers.
-  SELEQZ_C = ((2U << 3) + 4),  // COP1 on FPR registers.
-  SELNEZ_C = ((2U << 3) + 7),  // COP1 on FPR registers.
-
-  // COP1 Encoding of Function Field When rs=PS.
-
-  // COP1X Encoding of Function Field.
-  MADD_S = ((4U << 3) + 0),
-  MADD_D = ((4U << 3) + 1),
-  MSUB_S = ((5U << 3) + 0),
-  MSUB_D = ((5U << 3) + 1),
-
-  // PCREL Encoding of rt Field.
-  ADDIUPC = ((0U << 2) + 0),
-  LWPC = ((0U << 2) + 1),
-  LWUPC = ((0U << 2) + 2),
-  LDPC = ((0U << 3) + 6),
-  // reserved ((1U << 3) + 6),
-  AUIPC = ((3U << 3) + 6),
-  ALUIPC = ((3U << 3) + 7),
-
-  // POP66 Encoding of rs Field.
-  JIC = ((0U << 5) + 0),
-
-  // POP76 Encoding of rs Field.
-  JIALC = ((0U << 5) + 0),
-
-  // COP1 Encoding of rs Field for MSA Branch Instructions
-  BZ_V = (((1U << 3) + 3) << kRsShift),
-  BNZ_V = (((1U << 3) + 7) << kRsShift),
-  BZ_B = (((3U << 3) + 0) << kRsShift),
-  BZ_H = (((3U << 3) + 1) << kRsShift),
-  BZ_W = (((3U << 3) + 2) << kRsShift),
-  BZ_D = (((3U << 3) + 3) << kRsShift),
-  BNZ_B = (((3U << 3) + 4) << kRsShift),
-  BNZ_H = (((3U << 3) + 5) << kRsShift),
-  BNZ_W = (((3U << 3) + 6) << kRsShift),
-  BNZ_D = (((3U << 3) + 7) << kRsShift),
-
-  // MSA: Operation Field for MI10 Instruction Formats
-  MSA_LD = (8U << 2),
-  MSA_ST = (9U << 2),
-  LD_B = ((8U << 2) + 0),
-  LD_H = ((8U << 2) + 1),
-  LD_W = ((8U << 2) + 2),
-  LD_D = ((8U << 2) + 3),
-  ST_B = ((9U << 2) + 0),
-  ST_H = ((9U << 2) + 1),
-  ST_W = ((9U << 2) + 2),
-  ST_D = ((9U << 2) + 3),
-
-  // MSA: Operation Field for I5 Instruction Format
-  ADDVI = ((0U << 23) + 6),
-  SUBVI = ((1U << 23) + 6),
-  MAXI_S = ((2U << 23) + 6),
-  MAXI_U = ((3U << 23) + 6),
-  MINI_S = ((4U << 23) + 6),
-  MINI_U = ((5U << 23) + 6),
-  CEQI = ((0U << 23) + 7),
-  CLTI_S = ((2U << 23) + 7),
-  CLTI_U = ((3U << 23) + 7),
-  CLEI_S = ((4U << 23) + 7),
-  CLEI_U = ((5U << 23) + 7),
-  LDI = ((6U << 23) + 7),  // I10 instruction format
-  I5_DF_b = (0U << 21),
-  I5_DF_h = (1U << 21),
-  I5_DF_w = (2U << 21),
-  I5_DF_d = (3U << 21),
-
-  // MSA: Operation Field for I8 Instruction Format
-  ANDI_B = ((0U << 24) + 0),
-  ORI_B = ((1U << 24) + 0),
-  NORI_B = ((2U << 24) + 0),
-  XORI_B = ((3U << 24) + 0),
-  BMNZI_B = ((0U << 24) + 1),
-  BMZI_B = ((1U << 24) + 1),
-  BSELI_B = ((2U << 24) + 1),
-  SHF_B = ((0U << 24) + 2),
-  SHF_H = ((1U << 24) + 2),
-  SHF_W = ((2U << 24) + 2),
-
-  MSA_VEC_2R_2RF_MINOR = ((3U << 3) + 6),
-
-  // MSA: Operation Field for VEC Instruction Formats
-  AND_V = (((0U << 2) + 0) << 21),
-  OR_V = (((0U << 2) + 1) << 21),
-  NOR_V = (((0U << 2) + 2) << 21),
-  XOR_V = (((0U << 2) + 3) << 21),
-  BMNZ_V = (((1U << 2) + 0) << 21),
-  BMZ_V = (((1U << 2) + 1) << 21),
-  BSEL_V = (((1U << 2) + 2) << 21),
-
-  // MSA: Operation Field for 2R Instruction Formats
-  MSA_2R_FORMAT = (((6U << 2) + 0) << 21),
-  FILL = (0U << 18),
-  PCNT = (1U << 18),
-  NLOC = (2U << 18),
-  NLZC = (3U << 18),
-  MSA_2R_DF_b = (0U << 16),
-  MSA_2R_DF_h = (1U << 16),
-  MSA_2R_DF_w = (2U << 16),
-  MSA_2R_DF_d = (3U << 16),
-
-  // MSA: Operation Field for 2RF Instruction Formats
-  MSA_2RF_FORMAT = (((6U << 2) + 1) << 21),
-  FCLASS = (0U << 17),
-  FTRUNC_S = (1U << 17),
-  FTRUNC_U = (2U << 17),
-  FSQRT = (3U << 17),
-  FRSQRT = (4U << 17),
-  FRCP = (5U << 17),
-  FRINT = (6U << 17),
-  FLOG2 = (7U << 17),
-  FEXUPL = (8U << 17),
-  FEXUPR = (9U << 17),
-  FFQL = (10U << 17),
-  FFQR = (11U << 17),
-  FTINT_S = (12U << 17),
-  FTINT_U = (13U << 17),
-  FFINT_S = (14U << 17),
-  FFINT_U = (15U << 17),
-  MSA_2RF_DF_w = (0U << 16),
-  MSA_2RF_DF_d = (1U << 16),
-
-  // MSA: Operation Field for 3R Instruction Format
-  SLL_MSA = ((0U << 23) + 13),
-  SRA_MSA = ((1U << 23) + 13),
-  SRL_MSA = ((2U << 23) + 13),
-  BCLR = ((3U << 23) + 13),
-  BSET = ((4U << 23) + 13),
-  BNEG = ((5U << 23) + 13),
-  BINSL = ((6U << 23) + 13),
-  BINSR = ((7U << 23) + 13),
-  ADDV = ((0U << 23) + 14),
-  SUBV = ((1U << 23) + 14),
-  MAX_S = ((2U << 23) + 14),
-  MAX_U = ((3U << 23) + 14),
-  MIN_S = ((4U << 23) + 14),
-  MIN_U = ((5U << 23) + 14),
-  MAX_A = ((6U << 23) + 14),
-  MIN_A = ((7U << 23) + 14),
-  CEQ = ((0U << 23) + 15),
-  CLT_S = ((2U << 23) + 15),
-  CLT_U = ((3U << 23) + 15),
-  CLE_S = ((4U << 23) + 15),
-  CLE_U = ((5U << 23) + 15),
-  ADD_A = ((0U << 23) + 16),
-  ADDS_A = ((1U << 23) + 16),
-  ADDS_S = ((2U << 23) + 16),
-  ADDS_U = ((3U << 23) + 16),
-  AVE_S = ((4U << 23) + 16),
-  AVE_U = ((5U << 23) + 16),
-  AVER_S = ((6U << 23) + 16),
-  AVER_U = ((7U << 23) + 16),
-  SUBS_S = ((0U << 23) + 17),
-  SUBS_U = ((1U << 23) + 17),
-  SUBSUS_U = ((2U << 23) + 17),
-  SUBSUU_S = ((3U << 23) + 17),
-  ASUB_S = ((4U << 23) + 17),
-  ASUB_U = ((5U << 23) + 17),
-  MULV = ((0U << 23) + 18),
-  MADDV = ((1U << 23) + 18),
-  MSUBV = ((2U << 23) + 18),
-  DIV_S_MSA = ((4U << 23) + 18),
-  DIV_U = ((5U << 23) + 18),
-  MOD_S = ((6U << 23) + 18),
-  MOD_U = ((7U << 23) + 18),
-  DOTP_S = ((0U << 23) + 19),
-  DOTP_U = ((1U << 23) + 19),
-  DPADD_S = ((2U << 23) + 19),
-  DPADD_U = ((3U << 23) + 19),
-  DPSUB_S = ((4U << 23) + 19),
-  DPSUB_U = ((5U << 23) + 19),
-  SLD = ((0U << 23) + 20),
-  SPLAT = ((1U << 23) + 20),
-  PCKEV = ((2U << 23) + 20),
-  PCKOD = ((3U << 23) + 20),
-  ILVL = ((4U << 23) + 20),
-  ILVR = ((5U << 23) + 20),
-  ILVEV = ((6U << 23) + 20),
-  ILVOD = ((7U << 23) + 20),
-  VSHF = ((0U << 23) + 21),
-  SRAR = ((1U << 23) + 21),
-  SRLR = ((2U << 23) + 21),
-  HADD_S = ((4U << 23) + 21),
-  HADD_U = ((5U << 23) + 21),
-  HSUB_S = ((6U << 23) + 21),
-  HSUB_U = ((7U << 23) + 21),
-  MSA_3R_DF_b = (0U << 21),
-  MSA_3R_DF_h = (1U << 21),
-  MSA_3R_DF_w = (2U << 21),
-  MSA_3R_DF_d = (3U << 21),
-
-  // MSA: Operation Field for 3RF Instruction Format
-  FCAF = ((0U << 22) + 26),
-  FCUN = ((1U << 22) + 26),
-  FCEQ = ((2U << 22) + 26),
-  FCUEQ = ((3U << 22) + 26),
-  FCLT = ((4U << 22) + 26),
-  FCULT = ((5U << 22) + 26),
-  FCLE = ((6U << 22) + 26),
-  FCULE = ((7U << 22) + 26),
-  FSAF = ((8U << 22) + 26),
-  FSUN = ((9U << 22) + 26),
-  FSEQ = ((10U << 22) + 26),
-  FSUEQ = ((11U << 22) + 26),
-  FSLT = ((12U << 22) + 26),
-  FSULT = ((13U << 22) + 26),
-  FSLE = ((14U << 22) + 26),
-  FSULE = ((15U << 22) + 26),
-  FADD = ((0U << 22) + 27),
-  FSUB = ((1U << 22) + 27),
-  FMUL = ((2U << 22) + 27),
-  FDIV = ((3U << 22) + 27),
-  FMADD = ((4U << 22) + 27),
-  FMSUB = ((5U << 22) + 27),
-  FEXP2 = ((7U << 22) + 27),
-  FEXDO = ((8U << 22) + 27),
-  FTQ = ((10U << 22) + 27),
-  FMIN = ((12U << 22) + 27),
-  FMIN_A = ((13U << 22) + 27),
-  FMAX = ((14U << 22) + 27),
-  FMAX_A = ((15U << 22) + 27),
-  FCOR = ((1U << 22) + 28),
-  FCUNE = ((2U << 22) + 28),
-  FCNE = ((3U << 22) + 28),
-  MUL_Q = ((4U << 22) + 28),
-  MADD_Q = ((5U << 22) + 28),
-  MSUB_Q = ((6U << 22) + 28),
-  FSOR = ((9U << 22) + 28),
-  FSUNE = ((10U << 22) + 28),
-  FSNE = ((11U << 22) + 28),
-  MULR_Q = ((12U << 22) + 28),
-  MADDR_Q = ((13U << 22) + 28),
-  MSUBR_Q = ((14U << 22) + 28),
-
-  // MSA: Operation Field for ELM Instruction Format
-  MSA_ELM_MINOR = ((3U << 3) + 1),
-  SLDI = (0U << 22),
-  CTCMSA = ((0U << 22) | (62U << 16)),
-  SPLATI = (1U << 22),
-  CFCMSA = ((1U << 22) | (62U << 16)),
-  COPY_S = (2U << 22),
-  MOVE_V = ((2U << 22) | (62U << 16)),
-  COPY_U = (3U << 22),
-  INSERT = (4U << 22),
-  INSVE = (5U << 22),
-  ELM_DF_B = ((0U << 4) << 16),
-  ELM_DF_H = ((4U << 3) << 16),
-  ELM_DF_W = ((12U << 2) << 16),
-  ELM_DF_D = ((28U << 1) << 16),
-
-  // MSA: Operation Field for BIT Instruction Format
-  SLLI = ((0U << 23) + 9),
-  SRAI = ((1U << 23) + 9),
-  SRLI = ((2U << 23) + 9),
-  BCLRI = ((3U << 23) + 9),
-  BSETI = ((4U << 23) + 9),
-  BNEGI = ((5U << 23) + 9),
-  BINSLI = ((6U << 23) + 9),
-  BINSRI = ((7U << 23) + 9),
-  SAT_S = ((0U << 23) + 10),
-  SAT_U = ((1U << 23) + 10),
-  SRARI = ((2U << 23) + 10),
-  SRLRI = ((3U << 23) + 10),
-  BIT_DF_b = ((14U << 3) << 16),
-  BIT_DF_h = ((6U << 4) << 16),
-  BIT_DF_w = ((2U << 5) << 16),
-  BIT_DF_d = ((0U << 6) << 16),
-
-  nullptrSF = 0U
-};
-
-enum MSAMinorOpcode : uint32_t {
-  kMsaMinorUndefined = 0,
-  kMsaMinorI8,
-  kMsaMinorI5,
-  kMsaMinorI10,
-  kMsaMinorBIT,
-  kMsaMinor3R,
-  kMsaMinor3RF,
-  kMsaMinorELM,
-  kMsaMinorVEC,
-  kMsaMinor2R,
-  kMsaMinor2RF,
-  kMsaMinorMI10
-};
-
-// ----- Emulated conditions.
-// On MIPS we use this enum to abstract from conditional branch instructions.
-// The 'U' prefix is used to specify unsigned comparisons.
-// Opposite conditions must be paired as odd/even numbers
-// because 'NegateCondition' function flips LSB to negate condition.
-enum Condition {
-  // Any value < 0 is considered no_condition.
-  kNoCondition = -1,
-  overflow = 0,
-  no_overflow = 1,
-  Uless = 2,
-  Ugreater_equal = 3,
-  Uless_equal = 4,
-  Ugreater = 5,
-  equal = 6,
-  not_equal = 7,  // Unordered or Not Equal.
-  negative = 8,
-  positive = 9,
-  parity_even = 10,
-  parity_odd = 11,
-  less = 12,
-  greater_equal = 13,
-  less_equal = 14,
-  greater = 15,
-  ueq = 16,  // Unordered or Equal.
-  ogl = 17,  // Ordered and Not Equal.
-  cc_always = 18,
-
-  // Aliases.
-  carry = Uless,
-  not_carry = Ugreater_equal,
-  zero = equal,
-  eq = equal,
-  not_zero = not_equal,
-  ne = not_equal,
-  nz = not_equal,
-  sign = negative,
-  not_sign = positive,
-  mi = negative,
-  pl = positive,
-  hi = Ugreater,
-  ls = Uless_equal,
-  ge = greater_equal,
-  lt = less,
-  gt = greater,
-  le = less_equal,
-  hs = Ugreater_equal,
-  lo = Uless,
-  al = cc_always,
-  ult = Uless,
-  uge = Ugreater_equal,
-  ule = Uless_equal,
-  ugt = Ugreater,
-  cc_default = kNoCondition
-};
-
-
-// Returns the equivalent of !cc.
-// Negation of the default kNoCondition (-1) results in a non-default
-// no_condition value (-2). As long as tests for no_condition check
-// for condition < 0, this will work as expected.
-inline Condition NegateCondition(Condition cc) {
-  DCHECK(cc != cc_always);
-  return static_cast<Condition>(cc ^ 1);
-}
-
-
-inline Condition NegateFpuCondition(Condition cc) {
-  DCHECK(cc != cc_always);
-  switch (cc) {
-    case ult:
-      return ge;
-    case ugt:
-      return le;
-    case uge:
-      return lt;
-    case ule:
-      return gt;
-    case lt:
-      return uge;
-    case gt:
-      return ule;
-    case ge:
-      return ult;
-    case le:
-      return ugt;
-    case eq:
-      return ne;
-    case ne:
-      return eq;
-    case ueq:
-      return ogl;
-    case ogl:
-      return ueq;
-    default:
-      return cc;
-  }
-}
-
-enum MSABranchCondition {
-  all_not_zero = 0,   // Branch If All Elements Are Not Zero
-  one_elem_not_zero,  // Branch If At Least One Element of Any Format Is Not
-                      // Zero
-  one_elem_zero,      // Branch If At Least One Element Is Zero
-  all_zero            // Branch If All Elements of Any Format Are Zero
-};
-
-inline MSABranchCondition NegateMSABranchCondition(MSABranchCondition cond) {
-  switch (cond) {
-    case all_not_zero:
-      return one_elem_zero;
-    case one_elem_not_zero:
-      return all_zero;
-    case one_elem_zero:
-      return all_not_zero;
-    case all_zero:
-      return one_elem_not_zero;
-    default:
-      return cond;
-  }
-}
-
-enum MSABranchDF {
-  MSA_BRANCH_B = 0,
-  MSA_BRANCH_H,
-  MSA_BRANCH_W,
-  MSA_BRANCH_D,
-  MSA_BRANCH_V
-};
-
-// Commute a condition such that {a cond b == b cond' a}.
-inline Condition CommuteCondition(Condition cc) {
-  switch (cc) {
-    case Uless:
-      return Ugreater;
-    case Ugreater:
-      return Uless;
-    case Ugreater_equal:
-      return Uless_equal;
-    case Uless_equal:
-      return Ugreater_equal;
-    case less:
-      return greater;
-    case greater:
-      return less;
-    case greater_equal:
-      return less_equal;
-    case less_equal:
-      return greater_equal;
-    default:
-      return cc;
-  }
-}
-
-
-// ----- Coprocessor conditions.
-enum FPUCondition {
-  kNoFPUCondition = -1,
-
-  F = 0x00,    // False.
-  UN = 0x01,   // Unordered.
-  EQ = 0x02,   // Equal.
-  UEQ = 0x03,  // Unordered or Equal.
-  OLT = 0x04,  // Ordered or Less Than, on Mips release < 6.
-  LT = 0x04,   // Ordered or Less Than, on Mips release >= 6.
-  ULT = 0x05,  // Unordered or Less Than.
-  OLE = 0x06,  // Ordered or Less Than or Equal, on Mips release < 6.
-  LE = 0x06,   // Ordered or Less Than or Equal, on Mips release >= 6.
-  ULE = 0x07,  // Unordered or Less Than or Equal.
-
-  // Following constants are available on Mips release >= 6 only.
-  ORD = 0x11,  // Ordered, on Mips release >= 6.
-  UNE = 0x12,  // Not equal, on Mips release >= 6.
-  NE = 0x13,   // Ordered Greater Than or Less Than. on Mips >= 6 only.
-};
-
-
-// FPU rounding modes.
-enum FPURoundingMode {
-  RN = 0 << 0,  // Round to Nearest.
-  RZ = 1 << 0,  // Round towards zero.
-  RP = 2 << 0,  // Round towards Plus Infinity.
-  RM = 3 << 0,  // Round towards Minus Infinity.
-
-  // Aliases.
-  kRoundToNearest = RN,
-  kRoundToZero = RZ,
-  kRoundToPlusInf = RP,
-  kRoundToMinusInf = RM,
-
-  mode_round = RN,
-  mode_ceil = RP,
-  mode_floor = RM,
-  mode_trunc = RZ
-};
-
-const uint32_t kFPURoundingModeMask = 3 << 0;
-
-enum CheckForInexactConversion {
-  kCheckForInexactConversion,
-  kDontCheckForInexactConversion
-};
-
-enum class MaxMinKind : int { kMin = 0, kMax = 1 };
-
-// -----------------------------------------------------------------------------
-// Hints.
-
-// Branch hints are not used on the MIPS.  They are defined so that they can
-// appear in shared function signatures, but will be ignored in MIPS
-// implementations.
-enum Hint {
-  no_hint = 0
-};
-
-
-inline Hint NegateHint(Hint hint) {
-  return no_hint;
-}
-
-
-// -----------------------------------------------------------------------------
-// Specific instructions, constants, and masks.
-// These constants are declared in assembler-mips.cc, as they use named
-// registers and other constants.
-
-// addiu(sp, sp, 4) aka Pop() operation or part of Pop(r)
-// operations as post-increment of sp.
-extern const Instr kPopInstruction;
-// addiu(sp, sp, -4) part of Push(r) operation as pre-decrement of sp.
-extern const Instr kPushInstruction;
-// Sw(r, MemOperand(sp, 0))
-extern const Instr kPushRegPattern;
-// Lw(r, MemOperand(sp, 0))
-extern const Instr kPopRegPattern;
-extern const Instr kLwRegFpOffsetPattern;
-extern const Instr kSwRegFpOffsetPattern;
-extern const Instr kLwRegFpNegOffsetPattern;
-extern const Instr kSwRegFpNegOffsetPattern;
-// A mask for the Rt register for push, pop, lw, sw instructions.
-extern const Instr kRtMask;
-extern const Instr kLwSwInstrTypeMask;
-extern const Instr kLwSwInstrArgumentMask;
-extern const Instr kLwSwOffsetMask;
-
-// Break 0xfffff, reserved for redirected real time call.
-const Instr rtCallRedirInstr = SPECIAL | BREAK | call_rt_redirected << 6;
-// A nop instruction. (Encoding of sll 0 0 0).
-const Instr nopInstr = 0;
-
-static constexpr uint64_t OpcodeToBitNumber(Opcode opcode) {
-  return 1ULL << (static_cast<uint32_t>(opcode) >> kOpcodeShift);
-}
-
-class InstructionBase {
- public:
-  enum {
-    kInstrSize = 4,
-    kInstrSizeLog2 = 2,
-    // On MIPS PC cannot actually be directly accessed. We behave as if PC was
-    // always the value of the current instruction being executed.
-    kPCReadOffset = 0
-  };
-
-  // Instruction type.
-  enum Type { kRegisterType, kImmediateType, kJumpType, kUnsupported = -1 };
-
-  // Get the raw instruction bits.
-  inline Instr InstructionBits() const {
-    return *reinterpret_cast<const Instr*>(this);
-  }
-
-  // Set the raw instruction bits to value.
-  inline void SetInstructionBits(Instr value) {
-    *reinterpret_cast<Instr*>(this) = value;
-  }
-
-  // Read one particular bit out of the instruction bits.
-  inline int Bit(int nr) const {
-    return (InstructionBits() >> nr) & 1;
-  }
-
-  // Read a bit field out of the instruction bits.
-  inline int Bits(int hi, int lo) const {
-    return (InstructionBits() >> lo) & ((2U << (hi - lo)) - 1);
-  }
-
-  static constexpr uint64_t kOpcodeImmediateTypeMask =
-      OpcodeToBitNumber(REGIMM) | OpcodeToBitNumber(BEQ) |
-      OpcodeToBitNumber(BNE) | OpcodeToBitNumber(BLEZ) |
-      OpcodeToBitNumber(BGTZ) | OpcodeToBitNumber(ADDI) |
-      OpcodeToBitNumber(DADDI) | OpcodeToBitNumber(ADDIU) |
-      OpcodeToBitNumber(DADDIU) | OpcodeToBitNumber(SLTI) |
-      OpcodeToBitNumber(SLTIU) | OpcodeToBitNumber(ANDI) |
-      OpcodeToBitNumber(ORI) | OpcodeToBitNumber(XORI) |
-      OpcodeToBitNumber(LUI) | OpcodeToBitNumber(BEQL) |
-      OpcodeToBitNumber(BNEL) | OpcodeToBitNumber(BLEZL) |
-      OpcodeToBitNumber(BGTZL) | OpcodeToBitNumber(POP66) |
-      OpcodeToBitNumber(POP76) | OpcodeToBitNumber(LB) | OpcodeToBitNumber(LH) |
-      OpcodeToBitNumber(LWL) | OpcodeToBitNumber(LW) | OpcodeToBitNumber(LWU) |
-      OpcodeToBitNumber(LD) | OpcodeToBitNumber(LBU) | OpcodeToBitNumber(LHU) |
-      OpcodeToBitNumber(LDL) | OpcodeToBitNumber(LDR) | OpcodeToBitNumber(LWR) |
-      OpcodeToBitNumber(SDL) | OpcodeToBitNumber(SB) | OpcodeToBitNumber(SH) |
-      OpcodeToBitNumber(SWL) | OpcodeToBitNumber(SW) | OpcodeToBitNumber(SD) |
-      OpcodeToBitNumber(SWR) | OpcodeToBitNumber(SDR) |
-      OpcodeToBitNumber(LWC1) | OpcodeToBitNumber(LDC1) |
-      OpcodeToBitNumber(SWC1) | OpcodeToBitNumber(SDC1) |
-      OpcodeToBitNumber(PCREL) | OpcodeToBitNumber(DAUI) |
-      OpcodeToBitNumber(BC) | OpcodeToBitNumber(BALC);
-
-#define FunctionFieldToBitNumber(function) (1ULL << function)
-
-  // On r6, DCLZ_R6 aliases to existing MFLO.
-  static const uint64_t kFunctionFieldRegisterTypeMask =
-      FunctionFieldToBitNumber(JR) | FunctionFieldToBitNumber(JALR) |
-      FunctionFieldToBitNumber(BREAK) | FunctionFieldToBitNumber(SLL) |
-      FunctionFieldToBitNumber(DSLL) | FunctionFieldToBitNumber(DSLL32) |
-      FunctionFieldToBitNumber(SRL) | FunctionFieldToBitNumber(DSRL) |
-      FunctionFieldToBitNumber(DSRL32) | FunctionFieldToBitNumber(SRA) |
-      FunctionFieldToBitNumber(DSRA) | FunctionFieldToBitNumber(DSRA32) |
-      FunctionFieldToBitNumber(SLLV) | FunctionFieldToBitNumber(DSLLV) |
-      FunctionFieldToBitNumber(SRLV) | FunctionFieldToBitNumber(DSRLV) |
-      FunctionFieldToBitNumber(SRAV) | FunctionFieldToBitNumber(DSRAV) |
-      FunctionFieldToBitNumber(LSA) | FunctionFieldToBitNumber(DLSA) |
-      FunctionFieldToBitNumber(MFHI) | FunctionFieldToBitNumber(MFLO) |
-      FunctionFieldToBitNumber(MULT) | FunctionFieldToBitNumber(DMULT) |
-      FunctionFieldToBitNumber(MULTU) | FunctionFieldToBitNumber(DMULTU) |
-      FunctionFieldToBitNumber(DIV) | FunctionFieldToBitNumber(DDIV) |
-      FunctionFieldToBitNumber(DIVU) | FunctionFieldToBitNumber(DDIVU) |
-      FunctionFieldToBitNumber(ADD) | FunctionFieldToBitNumber(DADD) |
-      FunctionFieldToBitNumber(ADDU) | FunctionFieldToBitNumber(DADDU) |
-      FunctionFieldToBitNumber(SUB) | FunctionFieldToBitNumber(DSUB) |
-      FunctionFieldToBitNumber(SUBU) | FunctionFieldToBitNumber(DSUBU) |
-      FunctionFieldToBitNumber(AND) | FunctionFieldToBitNumber(OR) |
-      FunctionFieldToBitNumber(XOR) | FunctionFieldToBitNumber(NOR) |
-      FunctionFieldToBitNumber(SLT) | FunctionFieldToBitNumber(SLTU) |
-      FunctionFieldToBitNumber(TGE) | FunctionFieldToBitNumber(TGEU) |
-      FunctionFieldToBitNumber(TLT) | FunctionFieldToBitNumber(TLTU) |
-      FunctionFieldToBitNumber(TEQ) | FunctionFieldToBitNumber(TNE) |
-      FunctionFieldToBitNumber(MOVZ) | FunctionFieldToBitNumber(MOVN) |
-      FunctionFieldToBitNumber(MOVCI) | FunctionFieldToBitNumber(SELEQZ_S) |
-      FunctionFieldToBitNumber(SELNEZ_S) | FunctionFieldToBitNumber(SYNC);
-
-
-  // Accessors for the different named fields used in the MIPS encoding.
-  inline Opcode OpcodeValue() const {
-    return static_cast<Opcode>(
-        Bits(kOpcodeShift + kOpcodeBits - 1, kOpcodeShift));
-  }
-
-  inline int FunctionFieldRaw() const {
-    return InstructionBits() & kFunctionFieldMask;
-  }
-
-  // Return the fields at their original place in the instruction encoding.
-  inline Opcode OpcodeFieldRaw() const {
-    return static_cast<Opcode>(InstructionBits() & kOpcodeMask);
-  }
-
-  // Safe to call within InstructionType().
-  inline int RsFieldRawNoAssert() const {
-    return InstructionBits() & kRsFieldMask;
-  }
-
-  inline int SaFieldRaw() const { return InstructionBits() & kSaFieldMask; }
-
-  // Get the encoding type of the instruction.
-  inline Type InstructionType() const;
-
-  inline MSAMinorOpcode MSAMinorOpcodeField() const {
-    int op = this->FunctionFieldRaw();
-    switch (op) {
-      case 0:
-      case 1:
-      case 2:
-        return kMsaMinorI8;
-      case 6:
-        return kMsaMinorI5;
-      case 7:
-        return (((this->InstructionBits() & kMsaI5I10Mask) == LDI)
-                    ? kMsaMinorI10
-                    : kMsaMinorI5);
-      case 9:
-      case 10:
-        return kMsaMinorBIT;
-      case 13:
-      case 14:
-      case 15:
-      case 16:
-      case 17:
-      case 18:
-      case 19:
-      case 20:
-      case 21:
-        return kMsaMinor3R;
-      case 25:
-        return kMsaMinorELM;
-      case 26:
-      case 27:
-      case 28:
-        return kMsaMinor3RF;
-      case 30:
-        switch (this->RsFieldRawNoAssert()) {
-          case MSA_2R_FORMAT:
-            return kMsaMinor2R;
-          case MSA_2RF_FORMAT:
-            return kMsaMinor2RF;
-          default:
-            return kMsaMinorVEC;
-        }
-        break;
-      case 32:
-      case 33:
-      case 34:
-      case 35:
-      case 36:
-      case 37:
-      case 38:
-      case 39:
-        return kMsaMinorMI10;
-      default:
-        return kMsaMinorUndefined;
-    }
-  }
-
- protected:
-  InstructionBase() {}
-};
-
-template <class T>
-class InstructionGetters : public T {
- public:
-  inline int RsValue() const {
-    DCHECK(this->InstructionType() == InstructionBase::kRegisterType ||
-           this->InstructionType() == InstructionBase::kImmediateType);
-    return this->Bits(kRsShift + kRsBits - 1, kRsShift);
-  }
-
-  inline int RtValue() const {
-    DCHECK(this->InstructionType() == InstructionBase::kRegisterType ||
-           this->InstructionType() == InstructionBase::kImmediateType);
-    return this->Bits(kRtShift + kRtBits - 1, kRtShift);
-  }
-
-  inline int RdValue() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kRegisterType);
-    return this->Bits(kRdShift + kRdBits - 1, kRdShift);
-  }
-
-  inline int BaseValue() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kImmediateType);
-    return this->Bits(kBaseShift + kBaseBits - 1, kBaseShift);
-  }
-
-  inline int SaValue() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kRegisterType);
-    return this->Bits(kSaShift + kSaBits - 1, kSaShift);
-  }
-
-  inline int LsaSaValue() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kRegisterType);
-    return this->Bits(kSaShift + kLsaSaBits - 1, kSaShift);
-  }
-
-  inline int FunctionValue() const {
-    DCHECK(this->InstructionType() == InstructionBase::kRegisterType ||
-           this->InstructionType() == InstructionBase::kImmediateType);
-    return this->Bits(kFunctionShift + kFunctionBits - 1, kFunctionShift);
-  }
-
-  inline int FdValue() const {
-    return this->Bits(kFdShift + kFdBits - 1, kFdShift);
-  }
-
-  inline int FsValue() const {
-    return this->Bits(kFsShift + kFsBits - 1, kFsShift);
-  }
-
-  inline int FtValue() const {
-    return this->Bits(kFtShift + kFtBits - 1, kFtShift);
-  }
-
-  inline int FrValue() const {
-    return this->Bits(kFrShift + kFrBits - 1, kFrShift);
-  }
-
-  inline int WdValue() const {
-    return this->Bits(kWdShift + kWdBits - 1, kWdShift);
-  }
-
-  inline int WsValue() const {
-    return this->Bits(kWsShift + kWsBits - 1, kWsShift);
-  }
-
-  inline int WtValue() const {
-    return this->Bits(kWtShift + kWtBits - 1, kWtShift);
-  }
-
-  inline int Bp2Value() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kRegisterType);
-    return this->Bits(kBp2Shift + kBp2Bits - 1, kBp2Shift);
-  }
-
-  inline int Bp3Value() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kRegisterType);
-    return this->Bits(kBp3Shift + kBp3Bits - 1, kBp3Shift);
-  }
-
-  // Float Compare condition code instruction bits.
-  inline int FCccValue() const {
-    return this->Bits(kFCccShift + kFCccBits - 1, kFCccShift);
-  }
-
-  // Float Branch condition code instruction bits.
-  inline int FBccValue() const {
-    return this->Bits(kFBccShift + kFBccBits - 1, kFBccShift);
-  }
-
-  // Float Branch true/false instruction bit.
-  inline int FBtrueValue() const {
-    return this->Bits(kFBtrueShift + kFBtrueBits - 1, kFBtrueShift);
-  }
-
-  // Return the fields at their original place in the instruction encoding.
-  inline Opcode OpcodeFieldRaw() const {
-    return static_cast<Opcode>(this->InstructionBits() & kOpcodeMask);
-  }
-
-  inline int RsFieldRaw() const {
-    DCHECK(this->InstructionType() == InstructionBase::kRegisterType ||
-           this->InstructionType() == InstructionBase::kImmediateType);
-    return this->InstructionBits() & kRsFieldMask;
-  }
-
-  // Same as above function, but safe to call within InstructionType().
-  inline int RsFieldRawNoAssert() const {
-    return this->InstructionBits() & kRsFieldMask;
-  }
-
-  inline int RtFieldRaw() const {
-    DCHECK(this->InstructionType() == InstructionBase::kRegisterType ||
-           this->InstructionType() == InstructionBase::kImmediateType);
-    return this->InstructionBits() & kRtFieldMask;
-  }
-
-  inline int RdFieldRaw() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kRegisterType);
-    return this->InstructionBits() & kRdFieldMask;
-  }
-
-  inline int SaFieldRaw() const {
-    return this->InstructionBits() & kSaFieldMask;
-  }
-
-  inline int FunctionFieldRaw() const {
-    return this->InstructionBits() & kFunctionFieldMask;
-  }
-
-  // Get the secondary field according to the opcode.
-  inline int SecondaryValue() const {
-    Opcode op = this->OpcodeFieldRaw();
-    switch (op) {
-      case SPECIAL:
-      case SPECIAL2:
-        return FunctionValue();
-      case COP1:
-        return RsValue();
-      case REGIMM:
-        return RtValue();
-      default:
-        return nullptrSF;
-    }
-  }
-
-  inline int32_t ImmValue(int bits) const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kImmediateType);
-    return this->Bits(bits - 1, 0);
-  }
-
-  inline int32_t Imm9Value() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kImmediateType);
-    return this->Bits(kImm9Shift + kImm9Bits - 1, kImm9Shift);
-  }
-
-  inline int32_t Imm16Value() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kImmediateType);
-    return this->Bits(kImm16Shift + kImm16Bits - 1, kImm16Shift);
-  }
-
-  inline int32_t Imm18Value() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kImmediateType);
-    return this->Bits(kImm18Shift + kImm18Bits - 1, kImm18Shift);
-  }
-
-  inline int32_t Imm19Value() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kImmediateType);
-    return this->Bits(kImm19Shift + kImm19Bits - 1, kImm19Shift);
-  }
-
-  inline int32_t Imm21Value() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kImmediateType);
-    return this->Bits(kImm21Shift + kImm21Bits - 1, kImm21Shift);
-  }
-
-  inline int32_t Imm26Value() const {
-    DCHECK((this->InstructionType() == InstructionBase::kJumpType) ||
-           (this->InstructionType() == InstructionBase::kImmediateType));
-    return this->Bits(kImm26Shift + kImm26Bits - 1, kImm26Shift);
-  }
-
-  inline int32_t MsaImm8Value() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kImmediateType);
-    return this->Bits(kMsaImm8Shift + kMsaImm8Bits - 1, kMsaImm8Shift);
-  }
-
-  inline int32_t MsaImm5Value() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kImmediateType);
-    return this->Bits(kMsaImm5Shift + kMsaImm5Bits - 1, kMsaImm5Shift);
-  }
-
-  inline int32_t MsaImm10Value() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kImmediateType);
-    return this->Bits(kMsaImm10Shift + kMsaImm10Bits - 1, kMsaImm10Shift);
-  }
-
-  inline int32_t MsaImmMI10Value() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kImmediateType);
-    return this->Bits(kMsaImmMI10Shift + kMsaImmMI10Bits - 1, kMsaImmMI10Shift);
-  }
-
-  inline int32_t MsaBitDf() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kImmediateType);
-    int32_t df_m = this->Bits(22, 16);
-    if (((df_m >> 6) & 1U) == 0) {
-      return 3;
-    } else if (((df_m >> 5) & 3U) == 2) {
-      return 2;
-    } else if (((df_m >> 4) & 7U) == 6) {
-      return 1;
-    } else if (((df_m >> 3) & 15U) == 14) {
-      return 0;
-    } else {
-      return -1;
-    }
-  }
-
-  inline int32_t MsaBitMValue() const {
-    DCHECK_EQ(this->InstructionType(), InstructionBase::kImmediateType);
-    return this->Bits(16 + this->MsaBitDf() + 3, 16);
-  }
-
-  inline int32_t MsaElmDf() const {
-    DCHECK(this->InstructionType() == InstructionBase::kRegisterType ||
-           this->InstructionType() == InstructionBase::kImmediateType);
-    int32_t df_n = this->Bits(21, 16);
-    if (((df_n >> 4) & 3U) == 0) {
-      return 0;
-    } else if (((df_n >> 3) & 7U) == 4) {
-      return 1;
-    } else if (((df_n >> 2) & 15U) == 12) {
-      return 2;
-    } else if (((df_n >> 1) & 31U) == 28) {
-      return 3;
-    } else {
-      return -1;
-    }
-  }
-
-  inline int32_t MsaElmNValue() const {
-    DCHECK(this->InstructionType() == InstructionBase::kRegisterType ||
-           this->InstructionType() == InstructionBase::kImmediateType);
-    return this->Bits(16 + 4 - this->MsaElmDf(), 16);
-  }
-
-  static bool IsForbiddenAfterBranchInstr(Instr instr);
-
-  // Say if the instruction should not be used in a branch delay slot or
-  // immediately after a compact branch.
-  inline bool IsForbiddenAfterBranch() const {
-    return IsForbiddenAfterBranchInstr(this->InstructionBits());
-  }
-
-  inline bool IsForbiddenInBranchDelay() const {
-    return IsForbiddenAfterBranch();
-  }
-
-  // Say if the instruction 'links'. e.g. jal, bal.
-  bool IsLinkingInstruction() const;
-  // Say if the instruction is a break or a trap.
-  bool IsTrap() const;
-
-  inline bool IsMSABranchInstr() const {
-    if (this->OpcodeFieldRaw() == COP1) {
-      switch (this->RsFieldRaw()) {
-        case BZ_V:
-        case BZ_B:
-        case BZ_H:
-        case BZ_W:
-        case BZ_D:
-        case BNZ_V:
-        case BNZ_B:
-        case BNZ_H:
-        case BNZ_W:
-        case BNZ_D:
-          return true;
-        default:
-          return false;
-      }
-    }
-    return false;
-  }
-
-  inline bool IsMSAInstr() const {
-    if (this->IsMSABranchInstr() || (this->OpcodeFieldRaw() == MSA))
-      return true;
-    return false;
-  }
-};
-
-class Instruction : public InstructionGetters<InstructionBase> {
- public:
-  // Instructions are read of out a code stream. The only way to get a
-  // reference to an instruction is to convert a pointer. There is no way
-  // to allocate or create instances of class Instruction.
-  // Use the At(pc) function to create references to Instruction.
-  static Instruction* At(byte* pc) {
-    return reinterpret_cast<Instruction*>(pc);
-  }
-
- private:
-  // We need to prevent the creation of instances of class Instruction.
-  DISALLOW_IMPLICIT_CONSTRUCTORS(Instruction);
-};
-
-
-// -----------------------------------------------------------------------------
-// MIPS assembly various constants.
-
-// C/C++ argument slots size.
-const int kCArgSlotCount = 0;
-
-// TODO(plind): below should be based on kPointerSize
-// TODO(plind): find all usages and remove the needless instructions for n64.
-const int kCArgsSlotsSize = kCArgSlotCount * Instruction::kInstrSize * 2;
-
-const int kInvalidStackOffset = -1;
-const int kBranchReturnOffset = 2 * Instruction::kInstrSize;
-
-static const int kNegOffset = 0x00008000;
-
-InstructionBase::Type InstructionBase::InstructionType() const {
-  switch (OpcodeFieldRaw()) {
-    case SPECIAL:
-      if (FunctionFieldToBitNumber(FunctionFieldRaw()) &
-          kFunctionFieldRegisterTypeMask) {
-        return kRegisterType;
-      }
-      return kUnsupported;
-    case SPECIAL2:
-      switch (FunctionFieldRaw()) {
-        case MUL:
-        case CLZ:
-        case DCLZ:
-          return kRegisterType;
-        default:
-          return kUnsupported;
-      }
-      break;
-    case SPECIAL3:
-      switch (FunctionFieldRaw()) {
-        case INS:
-        case DINS:
-        case DINSM:
-        case DINSU:
-        case EXT:
-        case DEXT:
-        case DEXTM:
-        case DEXTU:
-          return kRegisterType;
-        case BSHFL: {
-          int sa = SaFieldRaw() >> kSaShift;
-          switch (sa) {
-            case BITSWAP:
-            case WSBH:
-            case SEB:
-            case SEH:
-              return kRegisterType;
-          }
-          sa >>= kBp2Bits;
-          switch (sa) {
-            case ALIGN:
-              return kRegisterType;
-            default:
-              return kUnsupported;
-          }
-        }
-        case LL_R6:
-        case LLD_R6:
-        case SC_R6:
-        case SCD_R6: {
-          DCHECK_EQ(kArchVariant, kMips64r6);
-          return kImmediateType;
-        }
-        case DBSHFL: {
-          int sa = SaFieldRaw() >> kSaShift;
-          switch (sa) {
-            case DBITSWAP:
-            case DSBH:
-            case DSHD:
-              return kRegisterType;
-          }
-          sa = SaFieldRaw() >> kSaShift;
-          sa >>= kBp3Bits;
-          switch (sa) {
-            case DALIGN:
-              return kRegisterType;
-            default:
-              return kUnsupported;
-          }
-        }
-        default:
-          return kUnsupported;
-      }
-      break;
-    case COP1:  // Coprocessor instructions.
-      switch (RsFieldRawNoAssert()) {
-        case BC1:  // Branch on coprocessor condition.
-        case BC1EQZ:
-        case BC1NEZ:
-          return kImmediateType;
-        // MSA Branch instructions
-        case BZ_V:
-        case BNZ_V:
-        case BZ_B:
-        case BZ_H:
-        case BZ_W:
-        case BZ_D:
-        case BNZ_B:
-        case BNZ_H:
-        case BNZ_W:
-        case BNZ_D:
-          return kImmediateType;
-        default:
-          return kRegisterType;
-      }
-      break;
-    case COP1X:
-      return kRegisterType;
-
-    // 26 bits immediate type instructions. e.g.: j imm26.
-    case J:
-    case JAL:
-      return kJumpType;
-
-    case MSA:
-      switch (MSAMinorOpcodeField()) {
-        case kMsaMinor3R:
-        case kMsaMinor3RF:
-        case kMsaMinorVEC:
-        case kMsaMinor2R:
-        case kMsaMinor2RF:
-          return kRegisterType;
-        case kMsaMinorELM:
-          switch (InstructionBits() & kMsaLongerELMMask) {
-            case CFCMSA:
-            case CTCMSA:
-            case MOVE_V:
-              return kRegisterType;
-            default:
-              return kImmediateType;
-          }
-        default:
-          return kImmediateType;
-      }
-
-    default:
-      return kImmediateType;
-  }
-  return kUnsupported;
-}
-#undef OpcodeToBitNumber
-#undef FunctionFieldToBitNumber
-
-// -----------------------------------------------------------------------------
-// Instructions.
-
-template <class P>
-bool InstructionGetters<P>::IsLinkingInstruction() const {
-  switch (OpcodeFieldRaw()) {
-    case JAL:
-      return true;
-    case POP76:
-      if (RsFieldRawNoAssert() == JIALC)
-        return true;  // JIALC
-      else
-        return false;  // BNEZC
-    case REGIMM:
-      switch (RtFieldRaw()) {
-        case BGEZAL:
-        case BLTZAL:
-          return true;
-        default:
-          return false;
-      }
-    case SPECIAL:
-      switch (FunctionFieldRaw()) {
-        case JALR:
-          return true;
-        default:
-          return false;
-      }
-    default:
-      return false;
-  }
-}
-
-template <class P>
-bool InstructionGetters<P>::IsTrap() const {
-  if (OpcodeFieldRaw() != SPECIAL) {
-    return false;
-  } else {
-    switch (FunctionFieldRaw()) {
-      case BREAK:
-      case TGE:
-      case TGEU:
-      case TLT:
-      case TLTU:
-      case TEQ:
-      case TNE:
-        return true;
-      default:
-        return false;
-    }
-  }
-}
-
-// static
-template <class T>
-bool InstructionGetters<T>::IsForbiddenAfterBranchInstr(Instr instr) {
-  Opcode opcode = static_cast<Opcode>(instr & kOpcodeMask);
-  switch (opcode) {
-    case J:
-    case JAL:
-    case BEQ:
-    case BNE:
-    case BLEZ:  // POP06 bgeuc/bleuc, blezalc, bgezalc
-    case BGTZ:  // POP07 bltuc/bgtuc, bgtzalc, bltzalc
-    case BEQL:
-    case BNEL:
-    case BLEZL:  // POP26 bgezc, blezc, bgec/blec
-    case BGTZL:  // POP27 bgtzc, bltzc, bltc/bgtc
-    case BC:
-    case BALC:
-    case POP10:  // beqzalc, bovc, beqc
-    case POP30:  // bnezalc, bnvc, bnec
-    case POP66:  // beqzc, jic
-    case POP76:  // bnezc, jialc
-      return true;
-    case REGIMM:
-      switch (instr & kRtFieldMask) {
-        case BLTZ:
-        case BGEZ:
-        case BLTZAL:
-        case BGEZAL:
-          return true;
-        default:
-          return false;
-      }
-      break;
-    case SPECIAL:
-      switch (instr & kFunctionFieldMask) {
-        case JR:
-        case JALR:
-          return true;
-        default:
-          return false;
-      }
-      break;
-    case COP1:
-      switch (instr & kRsFieldMask) {
-        case BC1:
-        case BC1EQZ:
-        case BC1NEZ:
-        case BZ_V:
-        case BZ_B:
-        case BZ_H:
-        case BZ_W:
-        case BZ_D:
-        case BNZ_V:
-        case BNZ_B:
-        case BNZ_H:
-        case BNZ_W:
-        case BNZ_D:
-          return true;
-          break;
-        default:
-          return false;
-      }
-      break;
-    default:
-      return false;
-  }
-}
-}  // namespace internal
-}  // namespace v8
-
-#endif    // #ifndef V8_MIPS_CONSTANTS_H_
diff --git a/src/v8/src/mips64/cpu-mips64.cc b/src/v8/src/mips64/cpu-mips64.cc
deleted file mode 100644
index ab9cf69..0000000
--- a/src/v8/src/mips64/cpu-mips64.cc
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// CPU specific code for arm independent of OS goes here.
-
-#include <sys/syscall.h>
-#include <unistd.h>
-
-#ifdef __mips
-#include <asm/cachectl.h>
-#endif  // #ifdef __mips
-
-#if V8_TARGET_ARCH_MIPS64
-
-#include "src/assembler.h"
-#include "src/macro-assembler.h"
-
-#include "src/simulator.h"  // For cache flushing.
-
-namespace v8 {
-namespace internal {
-
-
-void CpuFeatures::FlushICache(void* start, size_t size) {
-#if !defined(USE_SIMULATOR)
-  // Nothing to do, flushing no instructions.
-  if (size == 0) {
-    return;
-  }
-
-#if defined(ANDROID) && !defined(__LP64__)
-  // Bionic cacheflush can typically run in userland, avoiding kernel call.
-  char *end = reinterpret_cast<char *>(start) + size;
-  cacheflush(
-    reinterpret_cast<intptr_t>(start), reinterpret_cast<intptr_t>(end), 0);
-#else  // ANDROID
-  long res;  // NOLINT(runtime/int)
-  // See http://www.linux-mips.org/wiki/Cacheflush_Syscall.
-  res = syscall(__NR_cacheflush, start, size, ICACHE);
-  if (res) {
-    V8_Fatal(__FILE__, __LINE__, "Failed to flush the instruction cache");
-  }
-#endif  // ANDROID
-#endif  // !USE_SIMULATOR.
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_MIPS64
diff --git a/src/v8/src/mips64/deoptimizer-mips64.cc b/src/v8/src/mips64/deoptimizer-mips64.cc
deleted file mode 100644
index 506143f..0000000
--- a/src/v8/src/mips64/deoptimizer-mips64.cc
+++ /dev/null
@@ -1,333 +0,0 @@
-// Copyright 2011 the V8 project 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 "src/assembler-inl.h"
-#include "src/deoptimizer.h"
-#include "src/register-configuration.h"
-#include "src/safepoint-table.h"
-
-namespace v8 {
-namespace internal {
-
-#define __ masm()->
-
-
-// This code tries to be close to ia32 code so that any changes can be
-// easily ported.
-void Deoptimizer::TableEntryGenerator::Generate() {
-  GeneratePrologue();
-
-  // Unlike on ARM we don't save all the registers, just the useful ones.
-  // For the rest, there are gaps on the stack, so the offsets remain the same.
-  const int kNumberOfRegisters = Register::kNumRegisters;
-
-  RegList restored_regs = kJSCallerSaved | kCalleeSaved;
-  RegList saved_regs = restored_regs | sp.bit() | ra.bit();
-
-  const int kDoubleRegsSize = kDoubleSize * DoubleRegister::kNumRegisters;
-  const int kFloatRegsSize = kFloatSize * FloatRegister::kNumRegisters;
-
-  // Save all double FPU registers before messing with them.
-  __ Dsubu(sp, sp, Operand(kDoubleRegsSize));
-  const RegisterConfiguration* config = RegisterConfiguration::Default();
-  for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
-    int code = config->GetAllocatableDoubleCode(i);
-    const DoubleRegister fpu_reg = DoubleRegister::from_code(code);
-    int offset = code * kDoubleSize;
-    __ Sdc1(fpu_reg, MemOperand(sp, offset));
-  }
-
-  // Save all float FPU registers before messing with them.
-  __ Dsubu(sp, sp, Operand(kFloatRegsSize));
-  for (int i = 0; i < config->num_allocatable_float_registers(); ++i) {
-    int code = config->GetAllocatableFloatCode(i);
-    const FloatRegister fpu_reg = FloatRegister::from_code(code);
-    int offset = code * kFloatSize;
-    __ Swc1(fpu_reg, MemOperand(sp, offset));
-  }
-
-  // Push saved_regs (needed to populate FrameDescription::registers_).
-  // Leave gaps for other registers.
-  __ Dsubu(sp, sp, kNumberOfRegisters * kPointerSize);
-  for (int16_t i = kNumberOfRegisters - 1; i >= 0; i--) {
-    if ((saved_regs & (1 << i)) != 0) {
-      __ Sd(ToRegister(i), MemOperand(sp, kPointerSize * i));
-    }
-  }
-
-  __ li(a2, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress,
-                                      isolate())));
-  __ Sd(fp, MemOperand(a2));
-
-  const int kSavedRegistersAreaSize =
-      (kNumberOfRegisters * kPointerSize) + kDoubleRegsSize + kFloatRegsSize;
-
-  // Get the bailout id from the stack.
-  __ Ld(a2, MemOperand(sp, kSavedRegistersAreaSize));
-
-  // Get the address of the location in the code object (a3) (return
-  // address for lazy deoptimization) and compute the fp-to-sp delta in
-  // register a4.
-  __ mov(a3, ra);
-  // Correct one word for bailout id.
-  __ Daddu(a4, sp, Operand(kSavedRegistersAreaSize + (1 * kPointerSize)));
-
-  __ Dsubu(a4, fp, a4);
-
-  // Allocate a new deoptimizer object.
-  __ PrepareCallCFunction(6, a5);
-  // Pass six arguments, according to n64 ABI.
-  __ mov(a0, zero_reg);
-  Label context_check;
-  __ Ld(a1, MemOperand(fp, CommonFrameConstants::kContextOrFrameTypeOffset));
-  __ JumpIfSmi(a1, &context_check);
-  __ Ld(a0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
-  __ bind(&context_check);
-  __ li(a1, Operand(type()));  // Bailout type.
-  // a2: bailout id already loaded.
-  // a3: code address or 0 already loaded.
-  // a4: already has fp-to-sp delta.
-  __ li(a5, Operand(ExternalReference::isolate_address(isolate())));
-
-  // Call Deoptimizer::New().
-  {
-    AllowExternalCallThatCantCauseGC scope(masm());
-    __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate()), 6);
-  }
-
-  // Preserve "deoptimizer" object in register v0 and get the input
-  // frame descriptor pointer to a1 (deoptimizer->input_);
-  // Move deopt-obj to a0 for call to Deoptimizer::ComputeOutputFrames() below.
-  __ mov(a0, v0);
-  __ Ld(a1, MemOperand(v0, Deoptimizer::input_offset()));
-
-  // Copy core registers into FrameDescription::registers_[kNumRegisters].
-  DCHECK_EQ(Register::kNumRegisters, kNumberOfRegisters);
-  for (int i = 0; i < kNumberOfRegisters; i++) {
-    int offset = (i * kPointerSize) + FrameDescription::registers_offset();
-    if ((saved_regs & (1 << i)) != 0) {
-      __ Ld(a2, MemOperand(sp, i * kPointerSize));
-      __ Sd(a2, MemOperand(a1, offset));
-    } else if (FLAG_debug_code) {
-      __ li(a2, kDebugZapValue);
-      __ Sd(a2, MemOperand(a1, offset));
-    }
-  }
-
-  int double_regs_offset = FrameDescription::double_registers_offset();
-  // Copy FPU registers to
-  // double_registers_[DoubleRegister::kNumAllocatableRegisters]
-  for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
-    int code = config->GetAllocatableDoubleCode(i);
-    int dst_offset = code * kDoubleSize + double_regs_offset;
-    int src_offset =
-        code * kDoubleSize + kNumberOfRegisters * kPointerSize + kFloatRegsSize;
-    __ Ldc1(f0, MemOperand(sp, src_offset));
-    __ Sdc1(f0, MemOperand(a1, dst_offset));
-  }
-
-  int float_regs_offset = FrameDescription::float_registers_offset();
-  // Copy FPU registers to
-  // float_registers_[FloatRegister::kNumAllocatableRegisters]
-  for (int i = 0; i < config->num_allocatable_float_registers(); ++i) {
-    int code = config->GetAllocatableFloatCode(i);
-    int dst_offset = code * kFloatSize + float_regs_offset;
-    int src_offset = code * kFloatSize + kNumberOfRegisters * kPointerSize;
-    __ Lwc1(f0, MemOperand(sp, src_offset));
-    __ Swc1(f0, MemOperand(a1, dst_offset));
-  }
-
-  // Remove the bailout id and the saved registers from the stack.
-  __ Daddu(sp, sp, Operand(kSavedRegistersAreaSize + (1 * kPointerSize)));
-
-  // Compute a pointer to the unwinding limit in register a2; that is
-  // the first stack slot not part of the input frame.
-  __ Ld(a2, MemOperand(a1, FrameDescription::frame_size_offset()));
-  __ Daddu(a2, a2, sp);
-
-  // Unwind the stack down to - but not including - the unwinding
-  // limit and copy the contents of the activation frame to the input
-  // frame description.
-  __ Daddu(a3, a1, Operand(FrameDescription::frame_content_offset()));
-  Label pop_loop;
-  Label pop_loop_header;
-  __ BranchShort(&pop_loop_header);
-  __ bind(&pop_loop);
-  __ pop(a4);
-  __ Sd(a4, MemOperand(a3, 0));
-  __ daddiu(a3, a3, sizeof(uint64_t));
-  __ bind(&pop_loop_header);
-  __ BranchShort(&pop_loop, ne, a2, Operand(sp));
-  // Compute the output frame in the deoptimizer.
-  __ push(a0);  // Preserve deoptimizer object across call.
-  // a0: deoptimizer object; a1: scratch.
-  __ PrepareCallCFunction(1, a1);
-  // Call Deoptimizer::ComputeOutputFrames().
-  {
-    AllowExternalCallThatCantCauseGC scope(masm());
-    __ CallCFunction(
-        ExternalReference::compute_output_frames_function(isolate()), 1);
-  }
-  __ pop(a0);  // Restore deoptimizer object (class Deoptimizer).
-
-  __ Ld(sp, MemOperand(a0, Deoptimizer::caller_frame_top_offset()));
-
-  // Replace the current (input) frame with the output frames.
-  Label outer_push_loop, inner_push_loop,
-      outer_loop_header, inner_loop_header;
-  // Outer loop state: a4 = current "FrameDescription** output_",
-  // a1 = one past the last FrameDescription**.
-  __ Lw(a1, MemOperand(a0, Deoptimizer::output_count_offset()));
-  __ Ld(a4, MemOperand(a0, Deoptimizer::output_offset()));  // a4 is output_.
-  __ Dlsa(a1, a4, a1, kPointerSizeLog2);
-  __ BranchShort(&outer_loop_header);
-  __ bind(&outer_push_loop);
-  // Inner loop state: a2 = current FrameDescription*, a3 = loop index.
-  __ Ld(a2, MemOperand(a4, 0));  // output_[ix]
-  __ Ld(a3, MemOperand(a2, FrameDescription::frame_size_offset()));
-  __ BranchShort(&inner_loop_header);
-  __ bind(&inner_push_loop);
-  __ Dsubu(a3, a3, Operand(sizeof(uint64_t)));
-  __ Daddu(a6, a2, Operand(a3));
-  __ Ld(a7, MemOperand(a6, FrameDescription::frame_content_offset()));
-  __ push(a7);
-  __ bind(&inner_loop_header);
-  __ BranchShort(&inner_push_loop, ne, a3, Operand(zero_reg));
-
-  __ Daddu(a4, a4, Operand(kPointerSize));
-  __ bind(&outer_loop_header);
-  __ BranchShort(&outer_push_loop, lt, a4, Operand(a1));
-
-  __ Ld(a1, MemOperand(a0, Deoptimizer::input_offset()));
-  for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
-    int code = config->GetAllocatableDoubleCode(i);
-    const DoubleRegister fpu_reg = DoubleRegister::from_code(code);
-    int src_offset = code * kDoubleSize + double_regs_offset;
-    __ Ldc1(fpu_reg, MemOperand(a1, src_offset));
-  }
-
-  // Push pc and continuation from the last output frame.
-  __ Ld(a6, MemOperand(a2, FrameDescription::pc_offset()));
-  __ push(a6);
-  __ Ld(a6, MemOperand(a2, FrameDescription::continuation_offset()));
-  __ push(a6);
-
-  // Technically restoring 'at' should work unless zero_reg is also restored
-  // but it's safer to check for this.
-  DCHECK(!(at.bit() & restored_regs));
-  // Restore the registers from the last output frame.
-  __ mov(at, a2);
-  for (int i = kNumberOfRegisters - 1; i >= 0; i--) {
-    int offset = (i * kPointerSize) + FrameDescription::registers_offset();
-    if ((restored_regs & (1 << i)) != 0) {
-      __ Ld(ToRegister(i), MemOperand(at, offset));
-    }
-  }
-
-  __ InitializeRootRegister();
-
-  __ pop(at);  // Get continuation, leave pc on stack.
-  __ pop(ra);
-  __ Jump(at);
-  __ stop("Unreachable.");
-}
-
-
-// Maximum size of a table entry generated below.
-#ifdef _MIPS_ARCH_MIPS64R6
-const int Deoptimizer::table_entry_size_ = 2 * Assembler::kInstrSize;
-#else
-const int Deoptimizer::table_entry_size_ = 3 * Assembler::kInstrSize;
-#endif
-
-void Deoptimizer::TableEntryGenerator::GeneratePrologue() {
-  Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm());
-
-  // Create a sequence of deoptimization entries.
-  // Note that registers are still live when jumping to an entry.
-  Label table_start, done, trampoline_jump;
-  __ bind(&table_start);
-#ifdef _MIPS_ARCH_MIPS64R6
-  int kMaxEntriesBranchReach =
-      (1 << (kImm26Bits - 2)) / (table_entry_size_ / Assembler::kInstrSize);
-#else
-  int kMaxEntriesBranchReach =
-      (1 << (kImm16Bits - 2)) / (table_entry_size_ / Assembler::kInstrSize);
-#endif
-
-  if (count() <= kMaxEntriesBranchReach) {
-    // Common case.
-    for (int i = 0; i < count(); i++) {
-      Label start;
-      __ bind(&start);
-      DCHECK(is_int16(i));
-      if (kArchVariant == kMips64r6) {
-        __ li(at, i);
-        __ BranchShort(PROTECT, &done);
-      } else {
-        __ BranchShort(USE_DELAY_SLOT, &done);  // Expose delay slot.
-        __ li(at, i);                           // In the delay slot.
-        __ nop();
-      }
-
-      DCHECK_EQ(table_entry_size_, masm()->SizeOfCodeGeneratedSince(&start));
-    }
-
-    DCHECK_EQ(masm()->SizeOfCodeGeneratedSince(&table_start),
-              count() * table_entry_size_);
-    __ bind(&done);
-    __ Push(at);
-  } else {
-    DCHECK_NE(kArchVariant, kMips64r6);
-    // Uncommon case, the branch cannot reach.
-    // Create mini trampoline to reach the end of the table
-    for (int i = 0, j = 0; i < count(); i++, j++) {
-      Label start;
-      __ bind(&start);
-      DCHECK(is_int16(i));
-      if (j >= kMaxEntriesBranchReach) {
-        j = 0;
-        __ li(at, i);
-        __ bind(&trampoline_jump);
-        trampoline_jump = Label();
-        __ BranchShort(USE_DELAY_SLOT, &trampoline_jump);
-        __ nop();
-      } else {
-        __ BranchShort(USE_DELAY_SLOT, &trampoline_jump);  // Expose delay slot.
-        __ li(at, i);                                      // In the delay slot.
-        __ nop();
-      }
-      DCHECK_EQ(table_entry_size_, masm()->SizeOfCodeGeneratedSince(&start));
-    }
-
-    DCHECK_EQ(masm()->SizeOfCodeGeneratedSince(&table_start),
-              count() * table_entry_size_);
-    __ bind(&trampoline_jump);
-    __ Push(at);
-  }
-}
-
-bool Deoptimizer::PadTopOfStackRegister() { return false; }
-
-void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) {
-  SetFrameSlot(offset, value);
-}
-
-
-void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) {
-  SetFrameSlot(offset, value);
-}
-
-
-void FrameDescription::SetCallerConstantPool(unsigned offset, intptr_t value) {
-  // No embedded constant pool support.
-  UNREACHABLE();
-}
-
-
-#undef __
-
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/mips64/disasm-mips64.cc b/src/v8/src/mips64/disasm-mips64.cc
deleted file mode 100644
index d53b47d..0000000
--- a/src/v8/src/mips64/disasm-mips64.cc
+++ /dev/null
@@ -1,3111 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// A Disassembler object is used to disassemble a block of code instruction by
-// instruction. The default implementation of the NameConverter object can be
-// overriden to modify register names or to do symbol lookup on addresses.
-//
-// The example below will disassemble a block of code and print it to stdout.
-//
-//   NameConverter converter;
-//   Disassembler d(converter);
-//   for (byte* pc = begin; pc < end;) {
-//     v8::internal::EmbeddedVector<char, 256> buffer;
-//     byte* prev_pc = pc;
-//     pc += d.InstructionDecode(buffer, pc);
-//     printf("%p    %08x      %s\n",
-//            prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer);
-//   }
-//
-// The Disassembler class also has a convenience method to disassemble a block
-// of code into a FILE*, meaning that the above functionality could also be
-// achieved by just calling Disassembler::Disassemble(stdout, begin, end);
-
-
-#include <assert.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <string.h>
-
-#if V8_TARGET_ARCH_MIPS64
-
-#include "src/base/platform/platform.h"
-#include "src/disasm.h"
-#include "src/macro-assembler.h"
-#include "src/mips64/constants-mips64.h"
-
-namespace v8 {
-namespace internal {
-
-//------------------------------------------------------------------------------
-
-// Decoder decodes and disassembles instructions into an output buffer.
-// It uses the converter to convert register names and call destinations into
-// more informative description.
-class Decoder {
- public:
-  Decoder(const disasm::NameConverter& converter,
-          v8::internal::Vector<char> out_buffer)
-    : converter_(converter),
-      out_buffer_(out_buffer),
-      out_buffer_pos_(0) {
-    out_buffer_[out_buffer_pos_] = '\0';
-  }
-
-  ~Decoder() {}
-
-  // Writes one disassembled instruction into 'buffer' (0-terminated).
-  // Returns the length of the disassembled machine instruction in bytes.
-  int InstructionDecode(byte* instruction);
-
- private:
-  // Bottleneck functions to print into the out_buffer.
-  void PrintChar(const char ch);
-  void Print(const char* str);
-
-  // Printing of common values.
-  void PrintRegister(int reg);
-  void PrintFPURegister(int freg);
-  void PrintMSARegister(int wreg);
-  void PrintFPUStatusRegister(int freg);
-  void PrintMSAControlRegister(int creg);
-  void PrintRs(Instruction* instr);
-  void PrintRt(Instruction* instr);
-  void PrintRd(Instruction* instr);
-  void PrintFs(Instruction* instr);
-  void PrintFt(Instruction* instr);
-  void PrintFd(Instruction* instr);
-  void PrintSa(Instruction* instr);
-  void PrintLsaSa(Instruction* instr);
-  void PrintSd(Instruction* instr);
-  void PrintSs1(Instruction* instr);
-  void PrintSs2(Instruction* instr);
-  void PrintSs3(Instruction* instr);
-  void PrintSs4(Instruction* instr);
-  void PrintSs5(Instruction* instr);
-  void PrintBc(Instruction* instr);
-  void PrintCc(Instruction* instr);
-  void PrintFunction(Instruction* instr);
-  void PrintSecondaryField(Instruction* instr);
-  void PrintUImm9(Instruction* instr);
-  void PrintSImm9(Instruction* instr);
-  void PrintUImm16(Instruction* instr);
-  void PrintSImm16(Instruction* instr);
-  void PrintXImm16(Instruction* instr);
-  void PrintPCImm16(Instruction* instr, int delta_pc, int n_bits);
-  void PrintXImm18(Instruction* instr);
-  void PrintSImm18(Instruction* instr);
-  void PrintXImm19(Instruction* instr);
-  void PrintSImm19(Instruction* instr);
-  void PrintXImm21(Instruction* instr);
-  void PrintSImm21(Instruction* instr);
-  void PrintPCImm21(Instruction* instr, int delta_pc, int n_bits);
-  void PrintXImm26(Instruction* instr);
-  void PrintSImm26(Instruction* instr);
-  void PrintPCImm26(Instruction* instr, int delta_pc, int n_bits);
-  void PrintPCImm26(Instruction* instr);
-  void PrintCode(Instruction* instr);   // For break and trap instructions.
-  void PrintFormat(Instruction* instr);  // For floating format postfix.
-  void PrintBp2(Instruction* instr);
-  void PrintBp3(Instruction* instr);
-  void PrintMsaDataFormat(Instruction* instr);
-  void PrintMsaXImm8(Instruction* instr);
-  void PrintMsaImm8(Instruction* instr);
-  void PrintMsaImm5(Instruction* instr);
-  void PrintMsaSImm5(Instruction* instr);
-  void PrintMsaSImm10(Instruction* instr, bool is_mi10 = false);
-  void PrintMsaImmBit(Instruction* instr);
-  void PrintMsaImmElm(Instruction* instr);
-  void PrintMsaCopy(Instruction* instr);
-  // Printing of instruction name.
-  void PrintInstructionName(Instruction* instr);
-
-  // Handle formatting of instructions and their options.
-  int FormatRegister(Instruction* instr, const char* option);
-  int FormatFPURegister(Instruction* instr, const char* option);
-  int FormatMSARegister(Instruction* instr, const char* option);
-  int FormatOption(Instruction* instr, const char* option);
-  void Format(Instruction* instr, const char* format);
-  void Unknown(Instruction* instr);
-  int DecodeBreakInstr(Instruction* instr);
-
-  // Each of these functions decodes one particular instruction type.
-  bool DecodeTypeRegisterRsType(Instruction* instr);
-  void DecodeTypeRegisterSRsType(Instruction* instr);
-  void DecodeTypeRegisterDRsType(Instruction* instr);
-  void DecodeTypeRegisterLRsType(Instruction* instr);
-  void DecodeTypeRegisterWRsType(Instruction* instr);
-  void DecodeTypeRegisterSPECIAL(Instruction* instr);
-  void DecodeTypeRegisterSPECIAL2(Instruction* instr);
-  void DecodeTypeRegisterSPECIAL3(Instruction* instr);
-  void DecodeTypeRegisterCOP1(Instruction* instr);
-  void DecodeTypeRegisterCOP1X(Instruction* instr);
-  int DecodeTypeRegister(Instruction* instr);
-
-  void DecodeTypeImmediateCOP1(Instruction* instr);
-  void DecodeTypeImmediateREGIMM(Instruction* instr);
-  void DecodeTypeImmediateSPECIAL3(Instruction* instr);
-  void DecodeTypeImmediate(Instruction* instr);
-
-  void DecodeTypeJump(Instruction* instr);
-
-  void DecodeTypeMsaI8(Instruction* instr);
-  void DecodeTypeMsaI5(Instruction* instr);
-  void DecodeTypeMsaI10(Instruction* instr);
-  void DecodeTypeMsaELM(Instruction* instr);
-  void DecodeTypeMsaBIT(Instruction* instr);
-  void DecodeTypeMsaMI10(Instruction* instr);
-  void DecodeTypeMsa3R(Instruction* instr);
-  void DecodeTypeMsa3RF(Instruction* instr);
-  void DecodeTypeMsaVec(Instruction* instr);
-  void DecodeTypeMsa2R(Instruction* instr);
-  void DecodeTypeMsa2RF(Instruction* instr);
-
-  const disasm::NameConverter& converter_;
-  v8::internal::Vector<char> out_buffer_;
-  int out_buffer_pos_;
-
-  DISALLOW_COPY_AND_ASSIGN(Decoder);
-};
-
-
-// Support for assertions in the Decoder formatting functions.
-#define STRING_STARTS_WITH(string, compare_string) \
-  (strncmp(string, compare_string, strlen(compare_string)) == 0)
-
-
-// Append the ch to the output buffer.
-void Decoder::PrintChar(const char ch) {
-  out_buffer_[out_buffer_pos_++] = ch;
-}
-
-
-// Append the str to the output buffer.
-void Decoder::Print(const char* str) {
-  char cur = *str++;
-  while (cur != '\0' && (out_buffer_pos_ < (out_buffer_.length() - 1))) {
-    PrintChar(cur);
-    cur = *str++;
-  }
-  out_buffer_[out_buffer_pos_] = 0;
-}
-
-
-// Print the register name according to the active name converter.
-void Decoder::PrintRegister(int reg) {
-  Print(converter_.NameOfCPURegister(reg));
-}
-
-
-void Decoder::PrintRs(Instruction* instr) {
-  int reg = instr->RsValue();
-  PrintRegister(reg);
-}
-
-
-void Decoder::PrintRt(Instruction* instr) {
-  int reg = instr->RtValue();
-  PrintRegister(reg);
-}
-
-
-void Decoder::PrintRd(Instruction* instr) {
-  int reg = instr->RdValue();
-  PrintRegister(reg);
-}
-
-
-// Print the FPUregister name according to the active name converter.
-void Decoder::PrintFPURegister(int freg) {
-  Print(converter_.NameOfXMMRegister(freg));
-}
-
-void Decoder::PrintMSARegister(int wreg) { Print(MSARegisters::Name(wreg)); }
-
-void Decoder::PrintFPUStatusRegister(int freg) {
-  switch (freg) {
-    case kFCSRRegister:
-      Print("FCSR");
-      break;
-    default:
-      Print(converter_.NameOfXMMRegister(freg));
-  }
-}
-
-void Decoder::PrintMSAControlRegister(int creg) {
-  switch (creg) {
-    case kMSAIRRegister:
-      Print("MSAIR");
-      break;
-    case kMSACSRRegister:
-      Print("MSACSR");
-      break;
-    default:
-      Print("no_msacreg");
-  }
-}
-
-void Decoder::PrintFs(Instruction* instr) {
-  int freg = instr->RsValue();
-  PrintFPURegister(freg);
-}
-
-
-void Decoder::PrintFt(Instruction* instr) {
-  int freg = instr->RtValue();
-  PrintFPURegister(freg);
-}
-
-
-void Decoder::PrintFd(Instruction* instr) {
-  int freg = instr->RdValue();
-  PrintFPURegister(freg);
-}
-
-
-// Print the integer value of the sa field.
-void Decoder::PrintSa(Instruction* instr) {
-  int sa = instr->SaValue();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", sa);
-}
-
-
-// Print the integer value of the sa field of a lsa instruction.
-void Decoder::PrintLsaSa(Instruction* instr) {
-  int sa = instr->LsaSaValue() + 1;
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", sa);
-}
-
-
-// Print the integer value of the rd field, when it is not used as reg.
-void Decoder::PrintSd(Instruction* instr) {
-  int sd = instr->RdValue();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", sd);
-}
-
-// Print the integer value of ext/dext/dextu size from the msbd field.
-void Decoder::PrintSs1(Instruction* instr) {
-  int msbd = instr->RdValue();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", msbd + 1);
-}
-
-// Print the integer value of ins/dins/dinsu size from the msb and lsb fields
-// (for dinsu it is msbminus32 and lsbminus32 fields).
-void Decoder::PrintSs2(Instruction* instr) {
-  int msb = instr->RdValue();
-  int lsb = instr->SaValue();
-  out_buffer_pos_ +=
-      SNPrintF(out_buffer_ + out_buffer_pos_, "%d", msb - lsb + 1);
-}
-
-// Print the integer value of dextm size from the msbdminus32 field.
-void Decoder::PrintSs3(Instruction* instr) {
-  int msbdminus32 = instr->RdValue();
-  out_buffer_pos_ +=
-      SNPrintF(out_buffer_ + out_buffer_pos_, "%d", msbdminus32 + 32 + 1);
-}
-
-// Print the integer value of dinsm size from the msbminus32 and lsb fields.
-void Decoder::PrintSs4(Instruction* instr) {
-  int msbminus32 = instr->RdValue();
-  int lsb = instr->SaValue();
-  out_buffer_pos_ +=
-      SNPrintF(out_buffer_ + out_buffer_pos_, "%d", msbminus32 + 32 - lsb + 1);
-}
-
-// Print the integer value of dextu/dinsu pos from the lsbminus32 field.
-void Decoder::PrintSs5(Instruction* instr) {
-  int lsbminus32 = instr->SaValue();
-  out_buffer_pos_ +=
-      SNPrintF(out_buffer_ + out_buffer_pos_, "%d", lsbminus32 + 32);
-}
-
-
-// Print the integer value of the cc field for the bc1t/f instructions.
-void Decoder::PrintBc(Instruction* instr) {
-  int cc = instr->FBccValue();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", cc);
-}
-
-
-// Print the integer value of the cc field for the FP compare instructions.
-void Decoder::PrintCc(Instruction* instr) {
-  int cc = instr->FCccValue();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "cc(%d)", cc);
-}
-
-// Print 9-bit unsigned immediate value.
-void Decoder::PrintUImm9(Instruction* instr) {
-  int32_t imm = instr->Imm9Value();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%u", imm);
-}
-
-// Print 9-bit signed immediate value.
-void Decoder::PrintSImm9(Instruction* instr) {
-  int32_t imm = ((instr->Imm9Value()) << 23) >> 23;
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", imm);
-}
-
-// Print 16-bit unsigned immediate value.
-void Decoder::PrintUImm16(Instruction* instr) {
-  int32_t imm = instr->Imm16Value();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%u", imm);
-}
-
-
-// Print 16-bit signed immediate value.
-void Decoder::PrintSImm16(Instruction* instr) {
-  int32_t imm =
-      ((instr->Imm16Value()) << (32 - kImm16Bits)) >> (32 - kImm16Bits);
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", imm);
-}
-
-
-// Print 16-bit hexa immediate value.
-void Decoder::PrintXImm16(Instruction* instr) {
-  int32_t imm = instr->Imm16Value();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "0x%x", imm);
-}
-
-
-// Print absoulte address for 16-bit offset or immediate value.
-// The absolute address is calculated according following expression:
-//      PC + delta_pc + (offset << n_bits)
-void Decoder::PrintPCImm16(Instruction* instr, int delta_pc, int n_bits) {
-  int16_t offset = instr->Imm16Value();
-  out_buffer_pos_ +=
-      SNPrintF(out_buffer_ + out_buffer_pos_, "%s",
-               converter_.NameOfAddress(reinterpret_cast<byte*>(instr) +
-                                        delta_pc + (offset << n_bits)));
-}
-
-
-// Print 18-bit signed immediate value.
-void Decoder::PrintSImm18(Instruction* instr) {
-  int32_t imm =
-      ((instr->Imm18Value()) << (32 - kImm18Bits)) >> (32 - kImm18Bits);
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", imm);
-}
-
-
-// Print 18-bit hexa immediate value.
-void Decoder::PrintXImm18(Instruction* instr) {
-  int32_t imm = instr->Imm18Value();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "0x%x", imm);
-}
-
-
-// Print 19-bit hexa immediate value.
-void Decoder::PrintXImm19(Instruction* instr) {
-  int32_t imm = instr->Imm19Value();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "0x%x", imm);
-}
-
-
-// Print 19-bit signed immediate value.
-void Decoder::PrintSImm19(Instruction* instr) {
-  int32_t imm19 = instr->Imm19Value();
-  // set sign
-  imm19 <<= (32 - kImm19Bits);
-  imm19 >>= (32 - kImm19Bits);
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", imm19);
-}
-
-
-// Print 21-bit immediate value.
-void Decoder::PrintXImm21(Instruction* instr) {
-  uint32_t imm = instr->Imm21Value();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "0x%x", imm);
-}
-
-
-// Print 21-bit signed immediate value.
-void Decoder::PrintSImm21(Instruction* instr) {
-  int32_t imm21 = instr->Imm21Value();
-  // set sign
-  imm21 <<= (32 - kImm21Bits);
-  imm21 >>= (32 - kImm21Bits);
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", imm21);
-}
-
-
-// Print absoulte address for 21-bit offset or immediate value.
-// The absolute address is calculated according following expression:
-//      PC + delta_pc + (offset << n_bits)
-void Decoder::PrintPCImm21(Instruction* instr, int delta_pc, int n_bits) {
-  int32_t imm21 = instr->Imm21Value();
-  // set sign
-  imm21 <<= (32 - kImm21Bits);
-  imm21 >>= (32 - kImm21Bits);
-  out_buffer_pos_ +=
-      SNPrintF(out_buffer_ + out_buffer_pos_, "%s",
-               converter_.NameOfAddress(reinterpret_cast<byte*>(instr) +
-                                        delta_pc + (imm21 << n_bits)));
-}
-
-
-// Print 26-bit hex immediate value.
-void Decoder::PrintXImm26(Instruction* instr) {
-  uint64_t target = static_cast<uint64_t>(instr->Imm26Value())
-                    << kImmFieldShift;
-  target = (reinterpret_cast<uint64_t>(instr) & ~0xFFFFFFF) | target;
-  out_buffer_pos_ +=
-      SNPrintF(out_buffer_ + out_buffer_pos_, "0x%" PRIx64, target);
-}
-
-
-// Print 26-bit signed immediate value.
-void Decoder::PrintSImm26(Instruction* instr) {
-  int32_t imm26 = instr->Imm26Value();
-  // set sign
-  imm26 <<= (32 - kImm26Bits);
-  imm26 >>= (32 - kImm26Bits);
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", imm26);
-}
-
-
-// Print absoulte address for 26-bit offset or immediate value.
-// The absolute address is calculated according following expression:
-//      PC + delta_pc + (offset << n_bits)
-void Decoder::PrintPCImm26(Instruction* instr, int delta_pc, int n_bits) {
-  int32_t imm26 = instr->Imm26Value();
-  // set sign
-  imm26 <<= (32 - kImm26Bits);
-  imm26 >>= (32 - kImm26Bits);
-  out_buffer_pos_ +=
-      SNPrintF(out_buffer_ + out_buffer_pos_, "%s",
-               converter_.NameOfAddress(reinterpret_cast<byte*>(instr) +
-                                        delta_pc + (imm26 << n_bits)));
-}
-
-
-// Print absoulte address for 26-bit offset or immediate value.
-// The absolute address is calculated according following expression:
-//      PC[GPRLEN-1 .. 28] || instr_index26 || 00
-void Decoder::PrintPCImm26(Instruction* instr) {
-  int32_t imm26 = instr->Imm26Value();
-  uint64_t pc_mask = ~0xFFFFFFF;
-  uint64_t pc = ((uint64_t)(instr + 1) & pc_mask) | (imm26 << 2);
-  out_buffer_pos_ +=
-      SNPrintF(out_buffer_ + out_buffer_pos_, "%s",
-               converter_.NameOfAddress((reinterpret_cast<byte*>(pc))));
-}
-
-
-void Decoder::PrintBp2(Instruction* instr) {
-  int bp2 = instr->Bp2Value();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", bp2);
-}
-
-
-void Decoder::PrintBp3(Instruction* instr) {
-  int bp3 = instr->Bp3Value();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", bp3);
-}
-
-
-// Print 26-bit immediate value.
-void Decoder::PrintCode(Instruction* instr) {
-  if (instr->OpcodeFieldRaw() != SPECIAL)
-    return;  // Not a break or trap instruction.
-  switch (instr->FunctionFieldRaw()) {
-    case BREAK: {
-      int32_t code = instr->Bits(25, 6);
-      out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                                  "0x%05x (%d)", code, code);
-      break;
-                }
-    case TGE:
-    case TGEU:
-    case TLT:
-    case TLTU:
-    case TEQ:
-    case TNE: {
-      int32_t code = instr->Bits(15, 6);
-      out_buffer_pos_ +=
-          SNPrintF(out_buffer_ + out_buffer_pos_, "0x%03x", code);
-      break;
-    }
-    default:  // Not a break or trap instruction.
-    break;
-  }
-}
-
-void Decoder::PrintMsaXImm8(Instruction* instr) {
-  int32_t imm = instr->MsaImm8Value();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "0x%x", imm);
-}
-
-void Decoder::PrintMsaImm8(Instruction* instr) {
-  int32_t imm = instr->MsaImm8Value();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%u", imm);
-}
-
-void Decoder::PrintMsaImm5(Instruction* instr) {
-  int32_t imm = instr->MsaImm5Value();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%u", imm);
-}
-
-void Decoder::PrintMsaSImm5(Instruction* instr) {
-  int32_t imm = instr->MsaImm5Value();
-  imm <<= (32 - kMsaImm5Bits);
-  imm >>= (32 - kMsaImm5Bits);
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", imm);
-}
-
-void Decoder::PrintMsaSImm10(Instruction* instr, bool is_mi10) {
-  int32_t imm = is_mi10 ? instr->MsaImmMI10Value() : instr->MsaImm10Value();
-  imm <<= (32 - kMsaImm10Bits);
-  imm >>= (32 - kMsaImm10Bits);
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", imm);
-}
-
-void Decoder::PrintMsaImmBit(Instruction* instr) {
-  int32_t m = instr->MsaBitMValue();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%u", m);
-}
-
-void Decoder::PrintMsaImmElm(Instruction* instr) {
-  int32_t n = instr->MsaElmNValue();
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%u", n);
-}
-
-void Decoder::PrintMsaCopy(Instruction* instr) {
-  int32_t rd = instr->WdValue();
-  int32_t ws = instr->WsValue();
-  int32_t n = instr->MsaElmNValue();
-  out_buffer_pos_ +=
-      SNPrintF(out_buffer_ + out_buffer_pos_, "%s, %s[%u]",
-               converter_.NameOfCPURegister(rd), MSARegisters::Name(ws), n);
-}
-
-void Decoder::PrintFormat(Instruction* instr) {
-  char formatLetter = ' ';
-  switch (instr->RsFieldRaw()) {
-    case S:
-      formatLetter = 's';
-      break;
-    case D:
-      formatLetter = 'd';
-      break;
-    case W:
-      formatLetter = 'w';
-      break;
-    case L:
-      formatLetter = 'l';
-      break;
-    default:
-      UNREACHABLE();
-      break;
-  }
-  PrintChar(formatLetter);
-}
-
-void Decoder::PrintMsaDataFormat(Instruction* instr) {
-  DCHECK(instr->IsMSAInstr());
-  char df = ' ';
-  if (instr->IsMSABranchInstr()) {
-    switch (instr->RsFieldRaw()) {
-      case BZ_V:
-      case BNZ_V:
-        df = 'v';
-        break;
-      case BZ_B:
-      case BNZ_B:
-        df = 'b';
-        break;
-      case BZ_H:
-      case BNZ_H:
-        df = 'h';
-        break;
-      case BZ_W:
-      case BNZ_W:
-        df = 'w';
-        break;
-      case BZ_D:
-      case BNZ_D:
-        df = 'd';
-        break;
-      default:
-        UNREACHABLE();
-        break;
-    }
-  } else {
-    char DF[] = {'b', 'h', 'w', 'd'};
-    switch (instr->MSAMinorOpcodeField()) {
-      case kMsaMinorI5:
-      case kMsaMinorI10:
-      case kMsaMinor3R:
-        df = DF[instr->Bits(22, 21)];
-        break;
-      case kMsaMinorMI10:
-        df = DF[instr->Bits(1, 0)];
-        break;
-      case kMsaMinorBIT:
-        df = DF[instr->MsaBitDf()];
-        break;
-      case kMsaMinorELM:
-        df = DF[instr->MsaElmDf()];
-        break;
-      case kMsaMinor3RF: {
-        uint32_t opcode = instr->InstructionBits() & kMsa3RFMask;
-        switch (opcode) {
-          case FEXDO:
-          case FTQ:
-          case MUL_Q:
-          case MADD_Q:
-          case MSUB_Q:
-          case MULR_Q:
-          case MADDR_Q:
-          case MSUBR_Q:
-            df = DF[1 + instr->Bit(21)];
-            break;
-          default:
-            df = DF[2 + instr->Bit(21)];
-            break;
-        }
-      } break;
-      case kMsaMinor2R:
-        df = DF[instr->Bits(17, 16)];
-        break;
-      case kMsaMinor2RF:
-        df = DF[2 + instr->Bit(16)];
-        break;
-      default:
-        UNREACHABLE();
-        break;
-    }
-  }
-
-  PrintChar(df);
-}
-
-// Printing of instruction name.
-void Decoder::PrintInstructionName(Instruction* instr) {
-}
-
-
-// Handle all register based formatting in this function to reduce the
-// complexity of FormatOption.
-int Decoder::FormatRegister(Instruction* instr, const char* format) {
-  DCHECK_EQ(format[0], 'r');
-  if (format[1] == 's') {  // 'rs: Rs register.
-    int reg = instr->RsValue();
-    PrintRegister(reg);
-    return 2;
-  } else if (format[1] == 't') {  // 'rt: rt register.
-    int reg = instr->RtValue();
-    PrintRegister(reg);
-    return 2;
-  } else if (format[1] == 'd') {  // 'rd: rd register.
-    int reg = instr->RdValue();
-    PrintRegister(reg);
-    return 2;
-  }
-  UNREACHABLE();
-}
-
-
-// Handle all FPUregister based formatting in this function to reduce the
-// complexity of FormatOption.
-int Decoder::FormatFPURegister(Instruction* instr, const char* format) {
-  DCHECK_EQ(format[0], 'f');
-  if ((CTC1 == instr->RsFieldRaw()) || (CFC1 == instr->RsFieldRaw())) {
-    if (format[1] == 's') {  // 'fs: fs register.
-      int reg = instr->FsValue();
-      PrintFPUStatusRegister(reg);
-      return 2;
-    } else if (format[1] == 't') {  // 'ft: ft register.
-      int reg = instr->FtValue();
-      PrintFPUStatusRegister(reg);
-      return 2;
-    } else if (format[1] == 'd') {  // 'fd: fd register.
-      int reg = instr->FdValue();
-      PrintFPUStatusRegister(reg);
-      return 2;
-    } else if (format[1] == 'r') {  // 'fr: fr register.
-      int reg = instr->FrValue();
-      PrintFPUStatusRegister(reg);
-      return 2;
-    }
-  } else {
-    if (format[1] == 's') {  // 'fs: fs register.
-      int reg = instr->FsValue();
-      PrintFPURegister(reg);
-      return 2;
-    } else if (format[1] == 't') {  // 'ft: ft register.
-      int reg = instr->FtValue();
-      PrintFPURegister(reg);
-      return 2;
-    } else if (format[1] == 'd') {  // 'fd: fd register.
-      int reg = instr->FdValue();
-      PrintFPURegister(reg);
-      return 2;
-    } else if (format[1] == 'r') {  // 'fr: fr register.
-      int reg = instr->FrValue();
-      PrintFPURegister(reg);
-      return 2;
-    }
-  }
-  UNREACHABLE();
-}
-
-// Handle all MSARegister based formatting in this function to reduce the
-// complexity of FormatOption.
-int Decoder::FormatMSARegister(Instruction* instr, const char* format) {
-  DCHECK_EQ(format[0], 'w');
-  if (format[1] == 's') {
-    int reg = instr->WsValue();
-    PrintMSARegister(reg);
-    return 2;
-  } else if (format[1] == 't') {
-    int reg = instr->WtValue();
-    PrintMSARegister(reg);
-    return 2;
-  } else if (format[1] == 'd') {
-    int reg = instr->WdValue();
-    PrintMSARegister(reg);
-    return 2;
-  }
-
-  UNREACHABLE();
-}
-
-// FormatOption takes a formatting string and interprets it based on
-// the current instructions. The format string points to the first
-// character of the option string (the option escape has already been
-// consumed by the caller.)  FormatOption returns the number of
-// characters that were consumed from the formatting string.
-int Decoder::FormatOption(Instruction* instr, const char* format) {
-  switch (format[0]) {
-    case 'c': {   // 'code for break or trap instructions.
-      DCHECK(STRING_STARTS_WITH(format, "code"));
-      PrintCode(instr);
-      return 4;
-    }
-    case 'i': {   // 'imm16u or 'imm26.
-      if (format[3] == '1') {
-        if (format[4] == '6') {
-          DCHECK(STRING_STARTS_WITH(format, "imm16"));
-          switch (format[5]) {
-            case 's':
-              DCHECK(STRING_STARTS_WITH(format, "imm16s"));
-              PrintSImm16(instr);
-              break;
-            case 'u':
-              DCHECK(STRING_STARTS_WITH(format, "imm16u"));
-              PrintSImm16(instr);
-              break;
-            case 'x':
-              DCHECK(STRING_STARTS_WITH(format, "imm16x"));
-              PrintXImm16(instr);
-              break;
-            case 'p': {  // The PC relative address.
-              DCHECK(STRING_STARTS_WITH(format, "imm16p"));
-              int delta_pc = 0;
-              int n_bits = 0;
-              switch (format[6]) {
-                case '4': {
-                  DCHECK(STRING_STARTS_WITH(format, "imm16p4"));
-                  delta_pc = 4;
-                  switch (format[8]) {
-                    case '2':
-                      DCHECK(STRING_STARTS_WITH(format, "imm16p4s2"));
-                      n_bits = 2;
-                      PrintPCImm16(instr, delta_pc, n_bits);
-                      return 9;
-                  }
-                }
-              }
-            }
-          }
-          return 6;
-        } else if (format[4] == '8') {
-          DCHECK(STRING_STARTS_WITH(format, "imm18"));
-          switch (format[5]) {
-            case 's':
-              DCHECK(STRING_STARTS_WITH(format, "imm18s"));
-              PrintSImm18(instr);
-              break;
-            case 'x':
-              DCHECK(STRING_STARTS_WITH(format, "imm18x"));
-              PrintXImm18(instr);
-              break;
-          }
-          return 6;
-        } else if (format[4] == '9') {
-          DCHECK(STRING_STARTS_WITH(format, "imm19"));
-          switch (format[5]) {
-            case 's':
-              DCHECK(STRING_STARTS_WITH(format, "imm19s"));
-              PrintSImm19(instr);
-              break;
-            case 'x':
-              DCHECK(STRING_STARTS_WITH(format, "imm19x"));
-              PrintXImm19(instr);
-              break;
-          }
-          return 6;
-        } else if (format[4] == '0' && format[5] == 's') {
-          DCHECK(STRING_STARTS_WITH(format, "imm10s"));
-          if (format[6] == '1') {
-            DCHECK(STRING_STARTS_WITH(format, "imm10s1"));
-            PrintMsaSImm10(instr, false);
-          } else if (format[6] == '2') {
-            DCHECK(STRING_STARTS_WITH(format, "imm10s2"));
-            PrintMsaSImm10(instr, true);
-          }
-          return 7;
-        }
-      } else if (format[3] == '2' && format[4] == '1') {
-        DCHECK(STRING_STARTS_WITH(format, "imm21"));
-        switch (format[5]) {
-          case 's':
-            DCHECK(STRING_STARTS_WITH(format, "imm21s"));
-            PrintSImm21(instr);
-            break;
-          case 'x':
-            DCHECK(STRING_STARTS_WITH(format, "imm21x"));
-            PrintXImm21(instr);
-            break;
-          case 'p': {  // The PC relative address.
-            DCHECK(STRING_STARTS_WITH(format, "imm21p"));
-            int delta_pc = 0;
-            int n_bits = 0;
-            switch (format[6]) {
-              case '4': {
-                DCHECK(STRING_STARTS_WITH(format, "imm21p4"));
-                delta_pc = 4;
-                switch (format[8]) {
-                  case '2':
-                    DCHECK(STRING_STARTS_WITH(format, "imm21p4s2"));
-                    n_bits = 2;
-                    PrintPCImm21(instr, delta_pc, n_bits);
-                    return 9;
-                }
-              }
-            }
-          }
-        }
-        return 6;
-      } else if (format[3] == '2' && format[4] == '6') {
-        DCHECK(STRING_STARTS_WITH(format, "imm26"));
-        switch (format[5]) {
-          case 's':
-            DCHECK(STRING_STARTS_WITH(format, "imm26s"));
-            PrintSImm26(instr);
-            break;
-          case 'x':
-            DCHECK(STRING_STARTS_WITH(format, "imm26x"));
-            PrintXImm26(instr);
-            break;
-          case 'p': {  // The PC relative address.
-            DCHECK(STRING_STARTS_WITH(format, "imm26p"));
-            int delta_pc = 0;
-            int n_bits = 0;
-            switch (format[6]) {
-              case '4': {
-                DCHECK(STRING_STARTS_WITH(format, "imm26p4"));
-                delta_pc = 4;
-                switch (format[8]) {
-                  case '2':
-                    DCHECK(STRING_STARTS_WITH(format, "imm26p4s2"));
-                    n_bits = 2;
-                    PrintPCImm26(instr, delta_pc, n_bits);
-                    return 9;
-                }
-              }
-            }
-          }
-          case 'j': {  // Absolute address for jump instructions.
-            DCHECK(STRING_STARTS_WITH(format, "imm26j"));
-            PrintPCImm26(instr);
-            break;
-          }
-        }
-        return 6;
-      } else if (format[3] == '5') {
-        DCHECK(STRING_STARTS_WITH(format, "imm5"));
-        if (format[4] == 'u') {
-          DCHECK(STRING_STARTS_WITH(format, "imm5u"));
-          PrintMsaImm5(instr);
-        } else if (format[4] == 's') {
-          DCHECK(STRING_STARTS_WITH(format, "imm5s"));
-          PrintMsaSImm5(instr);
-        }
-        return 5;
-      } else if (format[3] == '8') {
-        DCHECK(STRING_STARTS_WITH(format, "imm8"));
-        PrintMsaImm8(instr);
-        return 4;
-      } else if (format[3] == '9') {
-        DCHECK(STRING_STARTS_WITH(format, "imm9"));
-        if (format[4] == 'u') {
-          DCHECK(STRING_STARTS_WITH(format, "imm9u"));
-          PrintUImm9(instr);
-        } else if (format[4] == 's') {
-          DCHECK(STRING_STARTS_WITH(format, "imm9s"));
-          PrintSImm9(instr);
-        }
-        return 5;
-      } else if (format[3] == 'b') {
-        DCHECK(STRING_STARTS_WITH(format, "immb"));
-        PrintMsaImmBit(instr);
-        return 4;
-      } else if (format[3] == 'e') {
-        DCHECK(STRING_STARTS_WITH(format, "imme"));
-        PrintMsaImmElm(instr);
-        return 4;
-      }
-    }
-    case 'r': {   // 'r: registers.
-      return FormatRegister(instr, format);
-    }
-    case 'f': {   // 'f: FPUregisters.
-      return FormatFPURegister(instr, format);
-    }
-    case 'w': {  // 'w: MSA Register
-      return FormatMSARegister(instr, format);
-    }
-    case 's': {   // 'sa.
-      switch (format[1]) {
-        case 'a':
-          if (format[2] == '2') {
-            DCHECK(STRING_STARTS_WITH(format, "sa2"));  // 'sa2
-            PrintLsaSa(instr);
-            return 3;
-          } else {
-            DCHECK(STRING_STARTS_WITH(format, "sa"));
-            PrintSa(instr);
-            return 2;
-          }
-          break;
-        case 'd': {
-          DCHECK(STRING_STARTS_WITH(format, "sd"));
-          PrintSd(instr);
-          return 2;
-        }
-        case 's': {
-          if (format[2] == '1') {
-            DCHECK(STRING_STARTS_WITH(format, "ss1"));  // ext, dext, dextu size
-            PrintSs1(instr);
-          } else if (format[2] == '2') {
-            DCHECK(STRING_STARTS_WITH(format, "ss2"));  // ins, dins, dinsu size
-            PrintSs2(instr);
-          } else if (format[2] == '3') {
-            DCHECK(STRING_STARTS_WITH(format, "ss3"));  // dextm size
-            PrintSs3(instr);
-          } else if (format[2] == '4') {
-            DCHECK(STRING_STARTS_WITH(format, "ss4"));  // dinsm size
-            PrintSs4(instr);
-          } else {
-            DCHECK(STRING_STARTS_WITH(format, "ss5"));  // dextu, dinsu pos
-            PrintSs5(instr);
-          }
-          return 3;
-        }
-      }
-    }
-    case 'b': {
-      switch (format[1]) {
-        case 'c': {  // 'bc - Special for bc1 cc field.
-          DCHECK(STRING_STARTS_WITH(format, "bc"));
-          PrintBc(instr);
-          return 2;
-        }
-        case 'p': {
-          switch (format[2]) {
-            case '2': {  // 'bp2
-              DCHECK(STRING_STARTS_WITH(format, "bp2"));
-              PrintBp2(instr);
-              return 3;
-            }
-            case '3': {  // 'bp3
-              DCHECK(STRING_STARTS_WITH(format, "bp3"));
-              PrintBp3(instr);
-              return 3;
-            }
-          }
-        }
-      }
-    }
-    case 'C': {   // 'Cc - Special for c.xx.d cc field.
-      DCHECK(STRING_STARTS_WITH(format, "Cc"));
-      PrintCc(instr);
-      return 2;
-    }
-    case 't':
-      if (instr->IsMSAInstr()) {
-        PrintMsaDataFormat(instr);
-      } else {
-        PrintFormat(instr);
-      }
-      return 1;
-  }
-  UNREACHABLE();
-}
-
-
-// Format takes a formatting string for a whole instruction and prints it into
-// the output buffer. All escaped options are handed to FormatOption to be
-// parsed further.
-void Decoder::Format(Instruction* instr, const char* format) {
-  char cur = *format++;
-  while ((cur != 0) && (out_buffer_pos_ < (out_buffer_.length() - 1))) {
-    if (cur == '\'') {  // Single quote is used as the formatting escape.
-      format += FormatOption(instr, format);
-    } else {
-      out_buffer_[out_buffer_pos_++] = cur;
-    }
-    cur = *format++;
-  }
-  out_buffer_[out_buffer_pos_]  = '\0';
-}
-
-
-// For currently unimplemented decodings the disassembler calls Unknown(instr)
-// which will just print "unknown" of the instruction bits.
-void Decoder::Unknown(Instruction* instr) {
-  Format(instr, "unknown");
-}
-
-
-int Decoder::DecodeBreakInstr(Instruction* instr) {
-  // This is already known to be BREAK instr, just extract the code.
-  if (instr->Bits(25, 6) == static_cast<int>(kMaxStopCode)) {
-    // This is stop(msg).
-    Format(instr, "break, code: 'code");
-    out_buffer_pos_ += SNPrintF(
-        out_buffer_ + out_buffer_pos_, "\n%p       %08" PRIx64,
-        static_cast<void*>(
-            reinterpret_cast<int32_t*>(instr + Instruction::kInstrSize)),
-        reinterpret_cast<uint64_t>(
-            *reinterpret_cast<char**>(instr + Instruction::kInstrSize)));
-    // Size 3: the break_ instr, plus embedded 64-bit char pointer.
-    return 3 * Instruction::kInstrSize;
-  } else {
-    Format(instr, "break, code: 'code");
-    return Instruction::kInstrSize;
-  }
-}
-
-
-bool Decoder::DecodeTypeRegisterRsType(Instruction* instr) {
-  switch (instr->FunctionFieldRaw()) {
-    case RINT:
-      Format(instr, "rint.'t    'fd, 'fs");
-      break;
-    case SEL:
-      Format(instr, "sel.'t      'fd, 'fs, 'ft");
-      break;
-    case SELEQZ_C:
-      Format(instr, "seleqz.'t    'fd, 'fs, 'ft");
-      break;
-    case SELNEZ_C:
-      Format(instr, "selnez.'t    'fd, 'fs, 'ft");
-      break;
-    case MOVZ_C:
-      Format(instr, "movz.'t    'fd, 'fs, 'rt");
-      break;
-    case MOVN_C:
-      Format(instr, "movn.'t    'fd, 'fs, 'rt");
-      break;
-    case MOVF:
-      if (instr->Bit(16)) {
-        Format(instr, "movt.'t    'fd, 'fs, 'Cc");
-      } else {
-        Format(instr, "movf.'t    'fd, 'fs, 'Cc");
-      }
-      break;
-    case MIN:
-      Format(instr, "min.'t    'fd, 'fs, 'ft");
-      break;
-    case MAX:
-      Format(instr, "max.'t    'fd, 'fs, 'ft");
-      break;
-    case MINA:
-      Format(instr, "mina.'t   'fd, 'fs, 'ft");
-      break;
-    case MAXA:
-      Format(instr, "maxa.'t   'fd, 'fs, 'ft");
-      break;
-    case ADD_D:
-      Format(instr, "add.'t   'fd, 'fs, 'ft");
-      break;
-    case SUB_D:
-      Format(instr, "sub.'t   'fd, 'fs, 'ft");
-      break;
-    case MUL_D:
-      Format(instr, "mul.'t   'fd, 'fs, 'ft");
-      break;
-    case DIV_D:
-      Format(instr, "div.'t   'fd, 'fs, 'ft");
-      break;
-    case ABS_D:
-      Format(instr, "abs.'t   'fd, 'fs");
-      break;
-    case MOV_D:
-      Format(instr, "mov.'t   'fd, 'fs");
-      break;
-    case NEG_D:
-      Format(instr, "neg.'t   'fd, 'fs");
-      break;
-    case SQRT_D:
-      Format(instr, "sqrt.'t  'fd, 'fs");
-      break;
-    case RECIP_D:
-      Format(instr, "recip.'t  'fd, 'fs");
-      break;
-    case RSQRT_D:
-      Format(instr, "rsqrt.'t  'fd, 'fs");
-      break;
-    case CVT_W_D:
-      Format(instr, "cvt.w.'t 'fd, 'fs");
-      break;
-    case CVT_L_D:
-      Format(instr, "cvt.l.'t 'fd, 'fs");
-      break;
-    case TRUNC_W_D:
-      Format(instr, "trunc.w.'t 'fd, 'fs");
-      break;
-    case TRUNC_L_D:
-      Format(instr, "trunc.l.'t 'fd, 'fs");
-      break;
-    case ROUND_W_D:
-      Format(instr, "round.w.'t 'fd, 'fs");
-      break;
-    case ROUND_L_D:
-      Format(instr, "round.l.'t 'fd, 'fs");
-      break;
-    case FLOOR_W_D:
-      Format(instr, "floor.w.'t 'fd, 'fs");
-      break;
-    case FLOOR_L_D:
-      Format(instr, "floor.l.'t 'fd, 'fs");
-      break;
-    case CEIL_W_D:
-      Format(instr, "ceil.w.'t 'fd, 'fs");
-      break;
-    case CEIL_L_D:
-      Format(instr, "ceil.l.'t 'fd, 'fs");
-      break;
-    case CLASS_D:
-      Format(instr, "class.'t 'fd, 'fs");
-      break;
-    case CVT_S_D:
-      Format(instr, "cvt.s.'t 'fd, 'fs");
-      break;
-    case C_F_D:
-      Format(instr, "c.f.'t   'fs, 'ft, 'Cc");
-      break;
-    case C_UN_D:
-      Format(instr, "c.un.'t  'fs, 'ft, 'Cc");
-      break;
-    case C_EQ_D:
-      Format(instr, "c.eq.'t  'fs, 'ft, 'Cc");
-      break;
-    case C_UEQ_D:
-      Format(instr, "c.ueq.'t 'fs, 'ft, 'Cc");
-      break;
-    case C_OLT_D:
-      Format(instr, "c.olt.'t 'fs, 'ft, 'Cc");
-      break;
-    case C_ULT_D:
-      Format(instr, "c.ult.'t 'fs, 'ft, 'Cc");
-      break;
-    case C_OLE_D:
-      Format(instr, "c.ole.'t 'fs, 'ft, 'Cc");
-      break;
-    case C_ULE_D:
-      Format(instr, "c.ule.'t 'fs, 'ft, 'Cc");
-      break;
-    default:
-      return false;
-  }
-  return true;
-}
-
-
-void Decoder::DecodeTypeRegisterSRsType(Instruction* instr) {
-  if (!DecodeTypeRegisterRsType(instr)) {
-    switch (instr->FunctionFieldRaw()) {
-      case CVT_D_S:
-        Format(instr, "cvt.d.'t 'fd, 'fs");
-        break;
-      case MADDF_S:
-        Format(instr, "maddf.s  'fd, 'fs, 'ft");
-        break;
-      case MSUBF_S:
-        Format(instr, "msubf.s  'fd, 'fs, 'ft");
-        break;
-      default:
-        Format(instr, "unknown.cop1.'t");
-        break;
-    }
-  }
-}
-
-
-void Decoder::DecodeTypeRegisterDRsType(Instruction* instr) {
-  if (!DecodeTypeRegisterRsType(instr)) {
-    switch (instr->FunctionFieldRaw()) {
-      case MADDF_D:
-        Format(instr, "maddf.d  'fd, 'fs, 'ft");
-        break;
-      case MSUBF_D:
-        Format(instr, "msubf.d  'fd, 'fs, 'ft");
-        break;
-      default:
-        Format(instr, "unknown.cop1.'t");
-        break;
-    }
-  }
-}
-
-
-void Decoder::DecodeTypeRegisterLRsType(Instruction* instr) {
-  switch (instr->FunctionFieldRaw()) {
-    case CVT_D_L:
-      Format(instr, "cvt.d.l 'fd, 'fs");
-      break;
-    case CVT_S_L:
-      Format(instr, "cvt.s.l 'fd, 'fs");
-      break;
-    case CMP_AF:
-      Format(instr, "cmp.af.d  'fd,  'fs, 'ft");
-      break;
-    case CMP_UN:
-      Format(instr, "cmp.un.d  'fd,  'fs, 'ft");
-      break;
-    case CMP_EQ:
-      Format(instr, "cmp.eq.d  'fd,  'fs, 'ft");
-      break;
-    case CMP_UEQ:
-      Format(instr, "cmp.ueq.d  'fd,  'fs, 'ft");
-      break;
-    case CMP_LT:
-      Format(instr, "cmp.lt.d  'fd,  'fs, 'ft");
-      break;
-    case CMP_ULT:
-      Format(instr, "cmp.ult.d  'fd,  'fs, 'ft");
-      break;
-    case CMP_LE:
-      Format(instr, "cmp.le.d  'fd,  'fs, 'ft");
-      break;
-    case CMP_ULE:
-      Format(instr, "cmp.ule.d  'fd,  'fs, 'ft");
-      break;
-    case CMP_OR:
-      Format(instr, "cmp.or.d  'fd,  'fs, 'ft");
-      break;
-    case CMP_UNE:
-      Format(instr, "cmp.une.d  'fd,  'fs, 'ft");
-      break;
-    case CMP_NE:
-      Format(instr, "cmp.ne.d  'fd,  'fs, 'ft");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-void Decoder::DecodeTypeRegisterWRsType(Instruction* instr) {
-  switch (instr->FunctionValue()) {
-    case CVT_S_W:  // Convert word to float (single).
-      Format(instr, "cvt.s.w 'fd, 'fs");
-      break;
-    case CVT_D_W:  // Convert word to double.
-      Format(instr, "cvt.d.w 'fd, 'fs");
-      break;
-    case CMP_AF:
-      Format(instr, "cmp.af.s    'fd, 'fs, 'ft");
-      break;
-    case CMP_UN:
-      Format(instr, "cmp.un.s    'fd, 'fs, 'ft");
-      break;
-    case CMP_EQ:
-      Format(instr, "cmp.eq.s    'fd, 'fs, 'ft");
-      break;
-    case CMP_UEQ:
-      Format(instr, "cmp.ueq.s   'fd, 'fs, 'ft");
-      break;
-    case CMP_LT:
-      Format(instr, "cmp.lt.s    'fd, 'fs, 'ft");
-      break;
-    case CMP_ULT:
-      Format(instr, "cmp.ult.s   'fd, 'fs, 'ft");
-      break;
-    case CMP_LE:
-      Format(instr, "cmp.le.s    'fd, 'fs, 'ft");
-      break;
-    case CMP_ULE:
-      Format(instr, "cmp.ule.s   'fd, 'fs, 'ft");
-      break;
-    case CMP_OR:
-      Format(instr, "cmp.or.s    'fd, 'fs, 'ft");
-      break;
-    case CMP_UNE:
-      Format(instr, "cmp.une.s   'fd, 'fs, 'ft");
-      break;
-    case CMP_NE:
-      Format(instr, "cmp.ne.s    'fd, 'fs, 'ft");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-void Decoder::DecodeTypeRegisterCOP1(Instruction* instr) {
-  switch (instr->RsFieldRaw()) {
-    case MFC1:
-      Format(instr, "mfc1    'rt, 'fs");
-      break;
-    case DMFC1:
-      Format(instr, "dmfc1    'rt, 'fs");
-      break;
-    case MFHC1:
-      Format(instr, "mfhc1   'rt, 'fs");
-      break;
-    case MTC1:
-      Format(instr, "mtc1    'rt, 'fs");
-      break;
-    case DMTC1:
-      Format(instr, "dmtc1    'rt, 'fs");
-      break;
-    // These are called "fs" too, although they are not FPU registers.
-    case CTC1:
-      Format(instr, "ctc1    'rt, 'fs");
-      break;
-    case CFC1:
-      Format(instr, "cfc1    'rt, 'fs");
-      break;
-    case MTHC1:
-      Format(instr, "mthc1   'rt, 'fs");
-      break;
-    case S:
-      DecodeTypeRegisterSRsType(instr);
-      break;
-    case D:
-      DecodeTypeRegisterDRsType(instr);
-      break;
-    case W:
-      DecodeTypeRegisterWRsType(instr);
-      break;
-    case L:
-      DecodeTypeRegisterLRsType(instr);
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-void Decoder::DecodeTypeRegisterCOP1X(Instruction* instr) {
-  switch (instr->FunctionFieldRaw()) {
-    case MADD_S:
-      Format(instr, "madd.s  'fd, 'fr, 'fs, 'ft");
-      break;
-    case MADD_D:
-      Format(instr, "madd.d  'fd, 'fr, 'fs, 'ft");
-      break;
-    case MSUB_S:
-      Format(instr, "msub.s  'fd, 'fr, 'fs, 'ft");
-      break;
-    case MSUB_D:
-      Format(instr, "msub.d  'fd, 'fr, 'fs, 'ft");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-void Decoder::DecodeTypeRegisterSPECIAL(Instruction* instr) {
-  switch (instr->FunctionFieldRaw()) {
-    case JR:
-      Format(instr, "jr      'rs");
-      break;
-    case JALR:
-      Format(instr, "jalr    'rs, 'rd");
-      break;
-    case SLL:
-      if (0x0 == static_cast<int>(instr->InstructionBits()))
-        Format(instr, "nop");
-      else
-        Format(instr, "sll     'rd, 'rt, 'sa");
-      break;
-    case DSLL:
-      Format(instr, "dsll    'rd, 'rt, 'sa");
-      break;
-    case D_MUL_MUH:  // Equals to DMUL.
-      if (kArchVariant != kMips64r6) {
-        Format(instr, "dmult   'rs, 'rt");
-      } else {
-        if (instr->SaValue() == MUL_OP) {
-          Format(instr, "dmul   'rd, 'rs, 'rt");
-        } else {
-          Format(instr, "dmuh   'rd, 'rs, 'rt");
-        }
-      }
-      break;
-    case DSLL32:
-      Format(instr, "dsll32  'rd, 'rt, 'sa");
-      break;
-    case SRL:
-      if (instr->RsValue() == 0) {
-        Format(instr, "srl     'rd, 'rt, 'sa");
-      } else {
-        Format(instr, "rotr    'rd, 'rt, 'sa");
-      }
-      break;
-    case DSRL:
-      if (instr->RsValue() == 0) {
-        Format(instr, "dsrl    'rd, 'rt, 'sa");
-      } else {
-        Format(instr, "drotr   'rd, 'rt, 'sa");
-      }
-      break;
-    case DSRL32:
-      if (instr->RsValue() == 0) {
-        Format(instr, "dsrl32  'rd, 'rt, 'sa");
-      } else {
-        Format(instr, "drotr32 'rd, 'rt, 'sa");
-      }
-      break;
-    case SRA:
-      Format(instr, "sra     'rd, 'rt, 'sa");
-      break;
-    case DSRA:
-      Format(instr, "dsra    'rd, 'rt, 'sa");
-      break;
-    case DSRA32:
-      Format(instr, "dsra32  'rd, 'rt, 'sa");
-      break;
-    case SLLV:
-      Format(instr, "sllv    'rd, 'rt, 'rs");
-      break;
-    case DSLLV:
-      Format(instr, "dsllv   'rd, 'rt, 'rs");
-      break;
-    case SRLV:
-      if (instr->SaValue() == 0) {
-        Format(instr, "srlv    'rd, 'rt, 'rs");
-      } else {
-        Format(instr, "rotrv   'rd, 'rt, 'rs");
-      }
-      break;
-    case DSRLV:
-      if (instr->SaValue() == 0) {
-        Format(instr, "dsrlv   'rd, 'rt, 'rs");
-      } else {
-        Format(instr, "drotrv  'rd, 'rt, 'rs");
-      }
-      break;
-    case SRAV:
-      Format(instr, "srav    'rd, 'rt, 'rs");
-      break;
-    case DSRAV:
-      Format(instr, "dsrav   'rd, 'rt, 'rs");
-      break;
-    case LSA:
-      Format(instr, "lsa     'rd, 'rt, 'rs, 'sa2");
-      break;
-    case DLSA:
-      Format(instr, "dlsa    'rd, 'rt, 'rs, 'sa2");
-      break;
-    case MFHI:
-      if (instr->Bits(25, 16) == 0) {
-        Format(instr, "mfhi    'rd");
-      } else {
-        if ((instr->FunctionFieldRaw() == CLZ_R6) && (instr->FdValue() == 1)) {
-          Format(instr, "clz     'rd, 'rs");
-        } else if ((instr->FunctionFieldRaw() == CLO_R6) &&
-                   (instr->FdValue() == 1)) {
-          Format(instr, "clo     'rd, 'rs");
-        }
-      }
-      break;
-    case MFLO:
-      if (instr->Bits(25, 16) == 0) {
-        Format(instr, "mflo    'rd");
-      } else {
-        if ((instr->FunctionFieldRaw() == DCLZ_R6) && (instr->FdValue() == 1)) {
-          Format(instr, "dclz    'rd, 'rs");
-        } else if ((instr->FunctionFieldRaw() == DCLO_R6) &&
-                   (instr->FdValue() == 1)) {
-          Format(instr, "dclo     'rd, 'rs");
-        }
-      }
-      break;
-    case D_MUL_MUH_U:  // Equals to DMULTU.
-      if (kArchVariant != kMips64r6) {
-        Format(instr, "dmultu  'rs, 'rt");
-      } else {
-        if (instr->SaValue() == MUL_OP) {
-          Format(instr, "dmulu  'rd, 'rs, 'rt");
-        } else {
-          Format(instr, "dmuhu  'rd, 'rs, 'rt");
-        }
-      }
-      break;
-    case MULT:  // @Mips64r6 == MUL_MUH.
-      if (kArchVariant != kMips64r6) {
-        Format(instr, "mult    'rs, 'rt");
-      } else {
-        if (instr->SaValue() == MUL_OP) {
-          Format(instr, "mul    'rd, 'rs, 'rt");
-        } else {
-          Format(instr, "muh    'rd, 'rs, 'rt");
-        }
-      }
-      break;
-    case MULTU:  // @Mips64r6 == MUL_MUH_U.
-      if (kArchVariant != kMips64r6) {
-        Format(instr, "multu   'rs, 'rt");
-      } else {
-        if (instr->SaValue() == MUL_OP) {
-          Format(instr, "mulu   'rd, 'rs, 'rt");
-        } else {
-          Format(instr, "muhu   'rd, 'rs, 'rt");
-        }
-      }
-
-      break;
-    case DIV:  // @Mips64r6 == DIV_MOD.
-      if (kArchVariant != kMips64r6) {
-        Format(instr, "div     'rs, 'rt");
-      } else {
-        if (instr->SaValue() == DIV_OP) {
-          Format(instr, "div    'rd, 'rs, 'rt");
-        } else {
-          Format(instr, "mod    'rd, 'rs, 'rt");
-        }
-      }
-      break;
-    case DDIV:  // @Mips64r6 == D_DIV_MOD.
-      if (kArchVariant != kMips64r6) {
-        Format(instr, "ddiv    'rs, 'rt");
-      } else {
-        if (instr->SaValue() == DIV_OP) {
-          Format(instr, "ddiv   'rd, 'rs, 'rt");
-        } else {
-          Format(instr, "dmod   'rd, 'rs, 'rt");
-        }
-      }
-      break;
-    case DIVU:  // @Mips64r6 == DIV_MOD_U.
-      if (kArchVariant != kMips64r6) {
-        Format(instr, "divu    'rs, 'rt");
-      } else {
-        if (instr->SaValue() == DIV_OP) {
-          Format(instr, "divu   'rd, 'rs, 'rt");
-        } else {
-          Format(instr, "modu   'rd, 'rs, 'rt");
-        }
-      }
-      break;
-    case DDIVU:  // @Mips64r6 == D_DIV_MOD_U.
-      if (kArchVariant != kMips64r6) {
-        Format(instr, "ddivu   'rs, 'rt");
-      } else {
-        if (instr->SaValue() == DIV_OP) {
-          Format(instr, "ddivu  'rd, 'rs, 'rt");
-        } else {
-          Format(instr, "dmodu  'rd, 'rs, 'rt");
-        }
-      }
-      break;
-    case ADD:
-      Format(instr, "add     'rd, 'rs, 'rt");
-      break;
-    case DADD:
-      Format(instr, "dadd    'rd, 'rs, 'rt");
-      break;
-    case ADDU:
-      Format(instr, "addu    'rd, 'rs, 'rt");
-      break;
-    case DADDU:
-      Format(instr, "daddu   'rd, 'rs, 'rt");
-      break;
-    case SUB:
-      Format(instr, "sub     'rd, 'rs, 'rt");
-      break;
-    case DSUB:
-      Format(instr, "dsub    'rd, 'rs, 'rt");
-      break;
-    case SUBU:
-      Format(instr, "subu    'rd, 'rs, 'rt");
-      break;
-    case DSUBU:
-      Format(instr, "dsubu   'rd, 'rs, 'rt");
-      break;
-    case AND:
-      Format(instr, "and     'rd, 'rs, 'rt");
-      break;
-    case OR:
-      if (0 == instr->RsValue()) {
-        Format(instr, "mov     'rd, 'rt");
-      } else if (0 == instr->RtValue()) {
-        Format(instr, "mov     'rd, 'rs");
-      } else {
-        Format(instr, "or      'rd, 'rs, 'rt");
-      }
-      break;
-    case XOR:
-      Format(instr, "xor     'rd, 'rs, 'rt");
-      break;
-    case NOR:
-      Format(instr, "nor     'rd, 'rs, 'rt");
-      break;
-    case SLT:
-      Format(instr, "slt     'rd, 'rs, 'rt");
-      break;
-    case SLTU:
-      Format(instr, "sltu    'rd, 'rs, 'rt");
-      break;
-    case TGE:
-      Format(instr, "tge     'rs, 'rt, code: 'code");
-      break;
-    case TGEU:
-      Format(instr, "tgeu    'rs, 'rt, code: 'code");
-      break;
-    case TLT:
-      Format(instr, "tlt     'rs, 'rt, code: 'code");
-      break;
-    case TLTU:
-      Format(instr, "tltu    'rs, 'rt, code: 'code");
-      break;
-    case TEQ:
-      Format(instr, "teq     'rs, 'rt, code: 'code");
-      break;
-    case TNE:
-      Format(instr, "tne     'rs, 'rt, code: 'code");
-      break;
-    case SYNC:
-      Format(instr, "sync");
-      break;
-    case MOVZ:
-      Format(instr, "movz    'rd, 'rs, 'rt");
-      break;
-    case MOVN:
-      Format(instr, "movn    'rd, 'rs, 'rt");
-      break;
-    case MOVCI:
-      if (instr->Bit(16)) {
-        Format(instr, "movt    'rd, 'rs, 'bc");
-      } else {
-        Format(instr, "movf    'rd, 'rs, 'bc");
-      }
-      break;
-    case SELEQZ_S:
-      Format(instr, "seleqz    'rd, 'rs, 'rt");
-      break;
-    case SELNEZ_S:
-      Format(instr, "selnez    'rd, 'rs, 'rt");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-void Decoder::DecodeTypeRegisterSPECIAL2(Instruction* instr) {
-  switch (instr->FunctionFieldRaw()) {
-    case MUL:
-      Format(instr, "mul     'rd, 'rs, 'rt");
-      break;
-    case CLZ:
-      if (kArchVariant != kMips64r6) {
-        Format(instr, "clz     'rd, 'rs");
-      }
-      break;
-    case DCLZ:
-      if (kArchVariant != kMips64r6) {
-        Format(instr, "dclz    'rd, 'rs");
-      }
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-void Decoder::DecodeTypeRegisterSPECIAL3(Instruction* instr) {
-  switch (instr->FunctionFieldRaw()) {
-    case EXT: {
-      Format(instr, "ext     'rt, 'rs, 'sa, 'ss1");
-      break;
-    }
-    case DEXT: {
-      Format(instr, "dext    'rt, 'rs, 'sa, 'ss1");
-      break;
-    }
-    case DEXTM: {
-      Format(instr, "dextm   'rt, 'rs, 'sa, 'ss3");
-      break;
-    }
-    case DEXTU: {
-      Format(instr, "dextu   'rt, 'rs, 'ss5, 'ss1");
-      break;
-    }
-    case INS: {
-      Format(instr, "ins     'rt, 'rs, 'sa, 'ss2");
-      break;
-    }
-    case DINS: {
-      Format(instr, "dins    'rt, 'rs, 'sa, 'ss2");
-      break;
-    }
-    case DINSM: {
-      Format(instr, "dinsm   'rt, 'rs, 'sa, 'ss4");
-      break;
-    }
-    case DINSU: {
-      Format(instr, "dinsu   'rt, 'rs, 'ss5, 'ss2");
-      break;
-    }
-    case BSHFL: {
-      int sa = instr->SaFieldRaw() >> kSaShift;
-      switch (sa) {
-        case BITSWAP: {
-          Format(instr, "bitswap 'rd, 'rt");
-          break;
-        }
-        case SEB: {
-          Format(instr, "seb     'rd, 'rt");
-          break;
-        }
-        case SEH: {
-          Format(instr, "seh     'rd, 'rt");
-          break;
-        }
-        case WSBH: {
-          Format(instr, "wsbh    'rd, 'rt");
-          break;
-        }
-        default: {
-          sa >>= kBp2Bits;
-          switch (sa) {
-            case ALIGN: {
-              Format(instr, "align  'rd, 'rs, 'rt, 'bp2");
-              break;
-            }
-            default:
-              UNREACHABLE();
-              break;
-          }
-          break;
-        }
-      }
-      break;
-    }
-    case DBSHFL: {
-      int sa = instr->SaFieldRaw() >> kSaShift;
-      switch (sa) {
-        case DBITSWAP: {
-          switch (instr->SaFieldRaw() >> kSaShift) {
-            case DBITSWAP_SA:
-              Format(instr, "dbitswap 'rd, 'rt");
-              break;
-            default:
-              UNREACHABLE();
-              break;
-          }
-          break;
-        }
-        case DSBH: {
-          Format(instr, "dsbh    'rd, 'rt");
-          break;
-        }
-        case DSHD: {
-          Format(instr, "dshd    'rd, 'rt");
-          break;
-        }
-        default: {
-          sa >>= kBp3Bits;
-          switch (sa) {
-            case DALIGN: {
-              Format(instr, "dalign  'rd, 'rs, 'rt, 'bp3");
-              break;
-            }
-            default:
-              UNREACHABLE();
-              break;
-          }
-          break;
-        }
-      }
-      break;
-    }
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-int Decoder::DecodeTypeRegister(Instruction* instr) {
-  switch (instr->OpcodeFieldRaw()) {
-    case COP1:  // Coprocessor instructions.
-      DecodeTypeRegisterCOP1(instr);
-      break;
-    case COP1X:
-      DecodeTypeRegisterCOP1X(instr);
-      break;
-    case SPECIAL:
-      switch (instr->FunctionFieldRaw()) {
-        case BREAK:
-          return DecodeBreakInstr(instr);
-        default:
-          DecodeTypeRegisterSPECIAL(instr);
-          break;
-      }
-      break;
-    case SPECIAL2:
-      DecodeTypeRegisterSPECIAL2(instr);
-      break;
-    case SPECIAL3:
-      DecodeTypeRegisterSPECIAL3(instr);
-      break;
-    case MSA:
-      switch (instr->MSAMinorOpcodeField()) {
-        case kMsaMinor3R:
-          DecodeTypeMsa3R(instr);
-          break;
-        case kMsaMinor3RF:
-          DecodeTypeMsa3RF(instr);
-          break;
-        case kMsaMinorVEC:
-          DecodeTypeMsaVec(instr);
-          break;
-        case kMsaMinor2R:
-          DecodeTypeMsa2R(instr);
-          break;
-        case kMsaMinor2RF:
-          DecodeTypeMsa2RF(instr);
-          break;
-        case kMsaMinorELM:
-          DecodeTypeMsaELM(instr);
-          break;
-        default:
-          UNREACHABLE();
-      }
-      break;
-    default:
-      UNREACHABLE();
-  }
-  return Instruction::kInstrSize;
-}
-
-
-void Decoder::DecodeTypeImmediateCOP1(Instruction* instr) {
-  switch (instr->RsFieldRaw()) {
-    case BC1:
-      if (instr->FBtrueValue()) {
-        Format(instr, "bc1t    'bc, 'imm16u -> 'imm16p4s2");
-      } else {
-        Format(instr, "bc1f    'bc, 'imm16u -> 'imm16p4s2");
-      }
-      break;
-    case BC1EQZ:
-      Format(instr, "bc1eqz    'ft, 'imm16u -> 'imm16p4s2");
-      break;
-    case BC1NEZ:
-      Format(instr, "bc1nez    'ft, 'imm16u -> 'imm16p4s2");
-      break;
-    case BZ_V:
-    case BZ_B:
-    case BZ_H:
-    case BZ_W:
-    case BZ_D:
-      Format(instr, "bz.'t  'wt, 'imm16s -> 'imm16p4s2");
-      break;
-    case BNZ_V:
-    case BNZ_B:
-    case BNZ_H:
-    case BNZ_W:
-    case BNZ_D:
-      Format(instr, "bnz.'t  'wt, 'imm16s -> 'imm16p4s2");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-void Decoder::DecodeTypeImmediateREGIMM(Instruction* instr) {
-  switch (instr->RtFieldRaw()) {
-    case BLTZ:
-      Format(instr, "bltz    'rs, 'imm16u -> 'imm16p4s2");
-      break;
-    case BLTZAL:
-      Format(instr, "bltzal  'rs, 'imm16u -> 'imm16p4s2");
-      break;
-    case BGEZ:
-      Format(instr, "bgez    'rs, 'imm16u -> 'imm16p4s2");
-      break;
-    case BGEZAL: {
-      if (instr->RsValue() == 0)
-        Format(instr, "bal     'imm16s -> 'imm16p4s2");
-      else
-        Format(instr, "bgezal  'rs, 'imm16u -> 'imm16p4s2");
-      break;
-    }
-    case BGEZALL:
-      Format(instr, "bgezall 'rs, 'imm16u -> 'imm16p4s2");
-      break;
-    case DAHI:
-      Format(instr, "dahi    'rs, 'imm16x");
-      break;
-    case DATI:
-      Format(instr, "dati    'rs, 'imm16x");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Decoder::DecodeTypeImmediateSPECIAL3(Instruction* instr) {
-  switch (instr->FunctionFieldRaw()) {
-    case LL_R6: {
-      if (kArchVariant == kMips64r6) {
-        Format(instr, "ll     'rt, 'imm9s('rs)");
-      } else {
-        Unknown(instr);
-      }
-      break;
-    }
-    case LLD_R6: {
-      if (kArchVariant == kMips64r6) {
-        Format(instr, "lld     'rt, 'imm9s('rs)");
-      } else {
-        Unknown(instr);
-      }
-      break;
-    }
-    case SC_R6: {
-      if (kArchVariant == kMips64r6) {
-        Format(instr, "sc     'rt, 'imm9s('rs)");
-      } else {
-        Unknown(instr);
-      }
-      break;
-    }
-    case SCD_R6: {
-      if (kArchVariant == kMips64r6) {
-        Format(instr, "scd     'rt, 'imm9s('rs)");
-      } else {
-        Unknown(instr);
-      }
-      break;
-    }
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Decoder::DecodeTypeImmediate(Instruction* instr) {
-  switch (instr->OpcodeFieldRaw()) {
-    case COP1:
-      DecodeTypeImmediateCOP1(instr);
-      break;  // Case COP1.
-    // ------------- REGIMM class.
-    case REGIMM:
-      DecodeTypeImmediateREGIMM(instr);
-      break;  // Case REGIMM.
-    // ------------- Branch instructions.
-    case BEQ:
-      Format(instr, "beq     'rs, 'rt, 'imm16u -> 'imm16p4s2");
-      break;
-    case BC:
-      Format(instr, "bc      'imm26s -> 'imm26p4s2");
-      break;
-    case BALC:
-      Format(instr, "balc    'imm26s -> 'imm26p4s2");
-      break;
-    case BNE:
-      Format(instr, "bne     'rs, 'rt, 'imm16u -> 'imm16p4s2");
-      break;
-    case BLEZ:
-      if ((instr->RtValue() == 0) && (instr->RsValue() != 0)) {
-        Format(instr, "blez    'rs, 'imm16u -> 'imm16p4s2");
-      } else if ((instr->RtValue() != instr->RsValue()) &&
-                 (instr->RsValue() != 0) && (instr->RtValue() != 0)) {
-        Format(instr, "bgeuc   'rs, 'rt, 'imm16u -> 'imm16p4s2");
-      } else if ((instr->RtValue() == instr->RsValue()) &&
-                 (instr->RtValue() != 0)) {
-        Format(instr, "bgezalc 'rs, 'imm16u -> 'imm16p4s2");
-      } else if ((instr->RsValue() == 0) && (instr->RtValue() != 0)) {
-        Format(instr, "blezalc 'rt, 'imm16u -> 'imm16p4s2");
-      } else {
-        UNREACHABLE();
-      }
-      break;
-    case BGTZ:
-      if ((instr->RtValue() == 0) && (instr->RsValue() != 0)) {
-        Format(instr, "bgtz    'rs, 'imm16u -> 'imm16p4s2");
-      } else if ((instr->RtValue() != instr->RsValue()) &&
-                 (instr->RsValue() != 0) && (instr->RtValue() != 0)) {
-        Format(instr, "bltuc   'rs, 'rt, 'imm16u -> 'imm16p4s2");
-      } else if ((instr->RtValue() == instr->RsValue()) &&
-                 (instr->RtValue() != 0)) {
-        Format(instr, "bltzalc 'rt, 'imm16u -> 'imm16p4s2");
-      } else if ((instr->RsValue() == 0) && (instr->RtValue() != 0)) {
-        Format(instr, "bgtzalc 'rt, 'imm16u -> 'imm16p4s2");
-      } else {
-        UNREACHABLE();
-      }
-      break;
-    case BLEZL:
-      if ((instr->RtValue() == instr->RsValue()) && (instr->RtValue() != 0)) {
-        Format(instr, "bgezc    'rt, 'imm16u -> 'imm16p4s2");
-      } else if ((instr->RtValue() != instr->RsValue()) &&
-                 (instr->RsValue() != 0) && (instr->RtValue() != 0)) {
-        Format(instr, "bgec     'rs, 'rt, 'imm16u -> 'imm16p4s2");
-      } else if ((instr->RsValue() == 0) && (instr->RtValue() != 0)) {
-        Format(instr, "blezc    'rt, 'imm16u -> 'imm16p4s2");
-      } else {
-        UNREACHABLE();
-      }
-      break;
-    case BGTZL:
-      if ((instr->RtValue() == instr->RsValue()) && (instr->RtValue() != 0)) {
-        Format(instr, "bltzc    'rt, 'imm16u -> 'imm16p4s2");
-      } else if ((instr->RtValue() != instr->RsValue()) &&
-                 (instr->RsValue() != 0) && (instr->RtValue() != 0)) {
-        Format(instr, "bltc    'rs, 'rt, 'imm16u -> 'imm16p4s2");
-      } else if ((instr->RsValue() == 0) && (instr->RtValue() != 0)) {
-        Format(instr, "bgtzc    'rt, 'imm16u -> 'imm16p4s2");
-      } else {
-        UNREACHABLE();
-      }
-      break;
-    case POP66:
-      if (instr->RsValue() == JIC) {
-        Format(instr, "jic     'rt, 'imm16s");
-      } else {
-        Format(instr, "beqzc   'rs, 'imm21s -> 'imm21p4s2");
-      }
-      break;
-    case POP76:
-      if (instr->RsValue() == JIALC) {
-        Format(instr, "jialc   'rt, 'imm16s");
-      } else {
-        Format(instr, "bnezc   'rs, 'imm21s -> 'imm21p4s2");
-      }
-      break;
-    // ------------- Arithmetic instructions.
-    case ADDI:
-      if (kArchVariant != kMips64r6) {
-        Format(instr, "addi    'rt, 'rs, 'imm16s");
-      } else {
-        int rs_reg = instr->RsValue();
-        int rt_reg = instr->RtValue();
-        // Check if BOVC, BEQZALC or BEQC instruction.
-        if (rs_reg >= rt_reg) {
-          Format(instr, "bovc  'rs, 'rt, 'imm16s -> 'imm16p4s2");
-        } else {
-          DCHECK_GT(rt_reg, 0);
-          if (rs_reg == 0) {
-            Format(instr, "beqzalc 'rt, 'imm16s -> 'imm16p4s2");
-          } else {
-            Format(instr, "beqc    'rs, 'rt, 'imm16s -> 'imm16p4s2");
-          }
-        }
-      }
-      break;
-    case DADDI:
-      if (kArchVariant != kMips64r6) {
-        Format(instr, "daddi   'rt, 'rs, 'imm16s");
-      } else {
-        int rs_reg = instr->RsValue();
-        int rt_reg = instr->RtValue();
-        // Check if BNVC, BNEZALC or BNEC instruction.
-        if (rs_reg >= rt_reg) {
-          Format(instr, "bnvc  'rs, 'rt, 'imm16s -> 'imm16p4s2");
-        } else {
-          DCHECK_GT(rt_reg, 0);
-          if (rs_reg == 0) {
-            Format(instr, "bnezalc 'rt, 'imm16s -> 'imm16p4s2");
-          } else {
-            Format(instr, "bnec  'rs, 'rt, 'imm16s -> 'imm16p4s2");
-          }
-        }
-      }
-      break;
-    case ADDIU:
-      Format(instr, "addiu   'rt, 'rs, 'imm16s");
-      break;
-    case DADDIU:
-      Format(instr, "daddiu  'rt, 'rs, 'imm16s");
-      break;
-    case SLTI:
-      Format(instr, "slti    'rt, 'rs, 'imm16s");
-      break;
-    case SLTIU:
-      Format(instr, "sltiu   'rt, 'rs, 'imm16u");
-      break;
-    case ANDI:
-      Format(instr, "andi    'rt, 'rs, 'imm16x");
-      break;
-    case ORI:
-      Format(instr, "ori     'rt, 'rs, 'imm16x");
-      break;
-    case XORI:
-      Format(instr, "xori    'rt, 'rs, 'imm16x");
-      break;
-    case LUI:
-      if (kArchVariant != kMips64r6) {
-        Format(instr, "lui     'rt, 'imm16x");
-      } else {
-        if (instr->RsValue() != 0) {
-          Format(instr, "aui     'rt, 'rs, 'imm16x");
-        } else {
-          Format(instr, "lui     'rt, 'imm16x");
-        }
-      }
-      break;
-    case DAUI:
-      Format(instr, "daui    'rt, 'rs, 'imm16x");
-      break;
-    // ------------- Memory instructions.
-    case LB:
-      Format(instr, "lb      'rt, 'imm16s('rs)");
-      break;
-    case LH:
-      Format(instr, "lh      'rt, 'imm16s('rs)");
-      break;
-    case LWL:
-      Format(instr, "lwl     'rt, 'imm16s('rs)");
-      break;
-    case LDL:
-      Format(instr, "ldl     'rt, 'imm16s('rs)");
-      break;
-    case LW:
-      Format(instr, "lw      'rt, 'imm16s('rs)");
-      break;
-    case LWU:
-      Format(instr, "lwu     'rt, 'imm16s('rs)");
-      break;
-    case LD:
-      Format(instr, "ld      'rt, 'imm16s('rs)");
-      break;
-    case LBU:
-      Format(instr, "lbu     'rt, 'imm16s('rs)");
-      break;
-    case LHU:
-      Format(instr, "lhu     'rt, 'imm16s('rs)");
-      break;
-    case LWR:
-      Format(instr, "lwr     'rt, 'imm16s('rs)");
-      break;
-    case LDR:
-      Format(instr, "ldr     'rt, 'imm16s('rs)");
-      break;
-    case PREF:
-      Format(instr, "pref    'rt, 'imm16s('rs)");
-      break;
-    case SB:
-      Format(instr, "sb      'rt, 'imm16s('rs)");
-      break;
-    case SH:
-      Format(instr, "sh      'rt, 'imm16s('rs)");
-      break;
-    case SWL:
-      Format(instr, "swl     'rt, 'imm16s('rs)");
-      break;
-    case SW:
-      Format(instr, "sw      'rt, 'imm16s('rs)");
-      break;
-    case SD:
-      Format(instr, "sd      'rt, 'imm16s('rs)");
-      break;
-    case SWR:
-      Format(instr, "swr     'rt, 'imm16s('rs)");
-      break;
-    case SDR:
-      Format(instr, "sdr     'rt, 'imm16s('rs)");
-      break;
-    case SDL:
-      Format(instr, "sdl     'rt, 'imm16s('rs)");
-      break;
-    case LL:
-      if (kArchVariant == kMips64r6) {
-        Unknown(instr);
-      } else {
-        Format(instr, "ll     'rt, 'imm16s('rs)");
-      }
-      break;
-    case LLD:
-      if (kArchVariant == kMips64r6) {
-        Unknown(instr);
-      } else {
-        Format(instr, "lld     'rt, 'imm16s('rs)");
-      }
-      break;
-    case SC:
-      if (kArchVariant == kMips64r6) {
-        Unknown(instr);
-      } else {
-        Format(instr, "sc     'rt, 'imm16s('rs)");
-      }
-      break;
-    case SCD:
-      if (kArchVariant == kMips64r6) {
-        Unknown(instr);
-      } else {
-        Format(instr, "scd     'rt, 'imm16s('rs)");
-      }
-      break;
-    case LWC1:
-      Format(instr, "lwc1    'ft, 'imm16s('rs)");
-      break;
-    case LDC1:
-      Format(instr, "ldc1    'ft, 'imm16s('rs)");
-      break;
-    case SWC1:
-      Format(instr, "swc1    'ft, 'imm16s('rs)");
-      break;
-    case SDC1:
-      Format(instr, "sdc1    'ft, 'imm16s('rs)");
-      break;
-    case PCREL: {
-      int32_t imm21 = instr->Imm21Value();
-      // rt field: 5-bits checking
-      uint8_t rt = (imm21 >> kImm16Bits);
-      switch (rt) {
-        case ALUIPC:
-          Format(instr, "aluipc  'rs, 'imm16s");
-          break;
-        case AUIPC:
-          Format(instr, "auipc   'rs, 'imm16s");
-          break;
-        default: {
-          // rt field: checking of the most significant 3-bits
-          rt = (imm21 >> kImm18Bits);
-          switch (rt) {
-            case LDPC:
-              Format(instr, "ldpc    'rs, 'imm18s");
-              break;
-            default: {
-              // rt field: checking of the most significant 2-bits
-              rt = (imm21 >> kImm19Bits);
-              switch (rt) {
-                case LWUPC:
-                  Format(instr, "lwupc   'rs, 'imm19s");
-                  break;
-                case LWPC:
-                  Format(instr, "lwpc    'rs, 'imm19s");
-                  break;
-                case ADDIUPC:
-                  Format(instr, "addiupc 'rs, 'imm19s");
-                  break;
-                default:
-                  UNREACHABLE();
-                  break;
-              }
-              break;
-            }
-          }
-          break;
-        }
-      }
-      break;
-    }
-    case SPECIAL3:
-      DecodeTypeImmediateSPECIAL3(instr);
-      break;
-    case MSA:
-      switch (instr->MSAMinorOpcodeField()) {
-        case kMsaMinorI8:
-          DecodeTypeMsaI8(instr);
-          break;
-        case kMsaMinorI5:
-          DecodeTypeMsaI5(instr);
-          break;
-        case kMsaMinorI10:
-          DecodeTypeMsaI10(instr);
-          break;
-        case kMsaMinorELM:
-          DecodeTypeMsaELM(instr);
-          break;
-        case kMsaMinorBIT:
-          DecodeTypeMsaBIT(instr);
-          break;
-        case kMsaMinorMI10:
-          DecodeTypeMsaMI10(instr);
-          break;
-        default:
-          UNREACHABLE();
-          break;
-      }
-      break;
-    default:
-      printf("a 0x%x \n", instr->OpcodeFieldRaw());
-      UNREACHABLE();
-      break;
-  }
-}
-
-
-void Decoder::DecodeTypeJump(Instruction* instr) {
-  switch (instr->OpcodeFieldRaw()) {
-    case J:
-      Format(instr, "j       'imm26x -> 'imm26j");
-      break;
-    case JAL:
-      Format(instr, "jal     'imm26x -> 'imm26j");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Decoder::DecodeTypeMsaI8(Instruction* instr) {
-  uint32_t opcode = instr->InstructionBits() & kMsaI8Mask;
-
-  switch (opcode) {
-    case ANDI_B:
-      Format(instr, "andi.b  'wd, 'ws, 'imm8");
-      break;
-    case ORI_B:
-      Format(instr, "ori.b  'wd, 'ws, 'imm8");
-      break;
-    case NORI_B:
-      Format(instr, "nori.b  'wd, 'ws, 'imm8");
-      break;
-    case XORI_B:
-      Format(instr, "xori.b  'wd, 'ws, 'imm8");
-      break;
-    case BMNZI_B:
-      Format(instr, "bmnzi.b  'wd, 'ws, 'imm8");
-      break;
-    case BMZI_B:
-      Format(instr, "bmzi.b  'wd, 'ws, 'imm8");
-      break;
-    case BSELI_B:
-      Format(instr, "bseli.b  'wd, 'ws, 'imm8");
-      break;
-    case SHF_B:
-      Format(instr, "shf.b  'wd, 'ws, 'imm8");
-      break;
-    case SHF_H:
-      Format(instr, "shf.h  'wd, 'ws, 'imm8");
-      break;
-    case SHF_W:
-      Format(instr, "shf.w  'wd, 'ws, 'imm8");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Decoder::DecodeTypeMsaI5(Instruction* instr) {
-  uint32_t opcode = instr->InstructionBits() & kMsaI5Mask;
-
-  switch (opcode) {
-    case ADDVI:
-      Format(instr, "addvi.'t  'wd, 'ws, 'imm5u");
-      break;
-    case SUBVI:
-      Format(instr, "subvi.'t  'wd, 'ws, 'imm5u");
-      break;
-    case MAXI_S:
-      Format(instr, "maxi_s.'t  'wd, 'ws, 'imm5s");
-      break;
-    case MAXI_U:
-      Format(instr, "maxi_u.'t  'wd, 'ws, 'imm5u");
-      break;
-    case MINI_S:
-      Format(instr, "mini_s.'t  'wd, 'ws, 'imm5s");
-      break;
-    case MINI_U:
-      Format(instr, "mini_u.'t  'wd, 'ws, 'imm5u");
-      break;
-    case CEQI:
-      Format(instr, "ceqi.'t  'wd, 'ws, 'imm5s");
-      break;
-    case CLTI_S:
-      Format(instr, "clti_s.'t  'wd, 'ws, 'imm5s");
-      break;
-    case CLTI_U:
-      Format(instr, "clti_u.'t  'wd, 'ws, 'imm5u");
-      break;
-    case CLEI_S:
-      Format(instr, "clei_s.'t  'wd, 'ws, 'imm5s");
-      break;
-    case CLEI_U:
-      Format(instr, "clei_u.'t  'wd, 'ws, 'imm5u");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Decoder::DecodeTypeMsaI10(Instruction* instr) {
-  uint32_t opcode = instr->InstructionBits() & kMsaI5Mask;
-  if (opcode == LDI) {
-    Format(instr, "ldi.'t  'wd, 'imm10s1");
-  } else {
-    UNREACHABLE();
-  }
-}
-
-void Decoder::DecodeTypeMsaELM(Instruction* instr) {
-  uint32_t opcode = instr->InstructionBits() & kMsaELMMask;
-  switch (opcode) {
-    case SLDI:
-      if (instr->Bits(21, 16) == 0x3E) {
-        Format(instr, "ctcmsa  ");
-        PrintMSAControlRegister(instr->WdValue());
-        Print(", ");
-        PrintRegister(instr->WsValue());
-      } else {
-        Format(instr, "sldi.'t  'wd, 'ws['imme]");
-      }
-      break;
-    case SPLATI:
-      if (instr->Bits(21, 16) == 0x3E) {
-        Format(instr, "cfcmsa  ");
-        PrintRegister(instr->WdValue());
-        Print(", ");
-        PrintMSAControlRegister(instr->WsValue());
-      } else {
-        Format(instr, "splati.'t  'wd, 'ws['imme]");
-      }
-      break;
-    case COPY_S:
-      if (instr->Bits(21, 16) == 0x3E) {
-        Format(instr, "move.v  'wd, 'ws");
-      } else {
-        Format(instr, "copy_s.'t  ");
-        PrintMsaCopy(instr);
-      }
-      break;
-    case COPY_U:
-      Format(instr, "copy_u.'t  ");
-      PrintMsaCopy(instr);
-      break;
-    case INSERT:
-      Format(instr, "insert.'t  'wd['imme], ");
-      PrintRegister(instr->WsValue());
-      break;
-    case INSVE:
-      Format(instr, "insve.'t  'wd['imme], 'ws[0]");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Decoder::DecodeTypeMsaBIT(Instruction* instr) {
-  uint32_t opcode = instr->InstructionBits() & kMsaBITMask;
-
-  switch (opcode) {
-    case SLLI:
-      Format(instr, "slli.'t  'wd, 'ws, 'immb");
-      break;
-    case SRAI:
-      Format(instr, "srai.'t  'wd, 'ws, 'immb");
-      break;
-    case SRLI:
-      Format(instr, "srli.'t  'wd, 'ws, 'immb");
-      break;
-    case BCLRI:
-      Format(instr, "bclri.'t  'wd, 'ws, 'immb");
-      break;
-    case BSETI:
-      Format(instr, "bseti.'t  'wd, 'ws, 'immb");
-      break;
-    case BNEGI:
-      Format(instr, "bnegi.'t  'wd, 'ws, 'immb");
-      break;
-    case BINSLI:
-      Format(instr, "binsli.'t  'wd, 'ws, 'immb");
-      break;
-    case BINSRI:
-      Format(instr, "binsri.'t  'wd, 'ws, 'immb");
-      break;
-    case SAT_S:
-      Format(instr, "sat_s.'t  'wd, 'ws, 'immb");
-      break;
-    case SAT_U:
-      Format(instr, "sat_u.'t  'wd, 'ws, 'immb");
-      break;
-    case SRARI:
-      Format(instr, "srari.'t  'wd, 'ws, 'immb");
-      break;
-    case SRLRI:
-      Format(instr, "srlri.'t  'wd, 'ws, 'immb");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Decoder::DecodeTypeMsaMI10(Instruction* instr) {
-  uint32_t opcode = instr->InstructionBits() & kMsaMI10Mask;
-  if (opcode == MSA_LD) {
-    Format(instr, "ld.'t  'wd, 'imm10s2(");
-    PrintRegister(instr->WsValue());
-    Print(")");
-  } else if (opcode == MSA_ST) {
-    Format(instr, "st.'t  'wd, 'imm10s2(");
-    PrintRegister(instr->WsValue());
-    Print(")");
-  } else {
-    UNREACHABLE();
-  }
-}
-
-void Decoder::DecodeTypeMsa3R(Instruction* instr) {
-  uint32_t opcode = instr->InstructionBits() & kMsa3RMask;
-  switch (opcode) {
-    case SLL_MSA:
-      Format(instr, "sll.'t  'wd, 'ws, 'wt");
-      break;
-    case SRA_MSA:
-      Format(instr, "sra.'t  'wd, 'ws, 'wt");
-      break;
-    case SRL_MSA:
-      Format(instr, "srl.'t  'wd, 'ws, 'wt");
-      break;
-    case BCLR:
-      Format(instr, "bclr.'t  'wd, 'ws, 'wt");
-      break;
-    case BSET:
-      Format(instr, "bset.'t  'wd, 'ws, 'wt");
-      break;
-    case BNEG:
-      Format(instr, "bneg.'t  'wd, 'ws, 'wt");
-      break;
-    case BINSL:
-      Format(instr, "binsl.'t  'wd, 'ws, 'wt");
-      break;
-    case BINSR:
-      Format(instr, "binsr.'t  'wd, 'ws, 'wt");
-      break;
-    case ADDV:
-      Format(instr, "addv.'t  'wd, 'ws, 'wt");
-      break;
-    case SUBV:
-      Format(instr, "subv.'t  'wd, 'ws, 'wt");
-      break;
-    case MAX_S:
-      Format(instr, "max_s.'t  'wd, 'ws, 'wt");
-      break;
-    case MAX_U:
-      Format(instr, "max_u.'t  'wd, 'ws, 'wt");
-      break;
-    case MIN_S:
-      Format(instr, "min_s.'t  'wd, 'ws, 'wt");
-      break;
-    case MIN_U:
-      Format(instr, "min_u.'t  'wd, 'ws, 'wt");
-      break;
-    case MAX_A:
-      Format(instr, "max_a.'t  'wd, 'ws, 'wt");
-      break;
-    case MIN_A:
-      Format(instr, "min_a.'t  'wd, 'ws, 'wt");
-      break;
-    case CEQ:
-      Format(instr, "ceq.'t  'wd, 'ws, 'wt");
-      break;
-    case CLT_S:
-      Format(instr, "clt_s.'t  'wd, 'ws, 'wt");
-      break;
-    case CLT_U:
-      Format(instr, "clt_u.'t  'wd, 'ws, 'wt");
-      break;
-    case CLE_S:
-      Format(instr, "cle_s.'t  'wd, 'ws, 'wt");
-      break;
-    case CLE_U:
-      Format(instr, "cle_u.'t  'wd, 'ws, 'wt");
-      break;
-    case ADD_A:
-      Format(instr, "add_a.'t  'wd, 'ws, 'wt");
-      break;
-    case ADDS_A:
-      Format(instr, "adds_a.'t  'wd, 'ws, 'wt");
-      break;
-    case ADDS_S:
-      Format(instr, "adds_s.'t  'wd, 'ws, 'wt");
-      break;
-    case ADDS_U:
-      Format(instr, "adds_u.'t  'wd, 'ws, 'wt");
-      break;
-    case AVE_S:
-      Format(instr, "ave_s.'t  'wd, 'ws, 'wt");
-      break;
-    case AVE_U:
-      Format(instr, "ave_u.'t  'wd, 'ws, 'wt");
-      break;
-    case AVER_S:
-      Format(instr, "aver_s.'t  'wd, 'ws, 'wt");
-      break;
-    case AVER_U:
-      Format(instr, "aver_u.'t  'wd, 'ws, 'wt");
-      break;
-    case SUBS_S:
-      Format(instr, "subs_s.'t  'wd, 'ws, 'wt");
-      break;
-    case SUBS_U:
-      Format(instr, "subs_u.'t  'wd, 'ws, 'wt");
-      break;
-    case SUBSUS_U:
-      Format(instr, "subsus_u.'t  'wd, 'ws, 'wt");
-      break;
-    case SUBSUU_S:
-      Format(instr, "subsuu_s.'t  'wd, 'ws, 'wt");
-      break;
-    case ASUB_S:
-      Format(instr, "asub_s.'t  'wd, 'ws, 'wt");
-      break;
-    case ASUB_U:
-      Format(instr, "asub_u.'t  'wd, 'ws, 'wt");
-      break;
-    case MULV:
-      Format(instr, "mulv.'t  'wd, 'ws, 'wt");
-      break;
-    case MADDV:
-      Format(instr, "maddv.'t  'wd, 'ws, 'wt");
-      break;
-    case MSUBV:
-      Format(instr, "msubv.'t  'wd, 'ws, 'wt");
-      break;
-    case DIV_S_MSA:
-      Format(instr, "div_s.'t  'wd, 'ws, 'wt");
-      break;
-    case DIV_U:
-      Format(instr, "div_u.'t  'wd, 'ws, 'wt");
-      break;
-    case MOD_S:
-      Format(instr, "mod_s.'t  'wd, 'ws, 'wt");
-      break;
-    case MOD_U:
-      Format(instr, "mod_u.'t  'wd, 'ws, 'wt");
-      break;
-    case DOTP_S:
-      Format(instr, "dotp_s.'t  'wd, 'ws, 'wt");
-      break;
-    case DOTP_U:
-      Format(instr, "dotp_u.'t  'wd, 'ws, 'wt");
-      break;
-    case DPADD_S:
-      Format(instr, "dpadd_s.'t  'wd, 'ws, 'wt");
-      break;
-    case DPADD_U:
-      Format(instr, "dpadd_u.'t  'wd, 'ws, 'wt");
-      break;
-    case DPSUB_S:
-      Format(instr, "dpsub_s.'t  'wd, 'ws, 'wt");
-      break;
-    case DPSUB_U:
-      Format(instr, "dpsub_u.'t  'wd, 'ws, 'wt");
-      break;
-    case SLD:
-      Format(instr, "sld.'t  'wd, 'ws['rt]");
-      break;
-    case SPLAT:
-      Format(instr, "splat.'t  'wd, 'ws['rt]");
-      break;
-    case PCKEV:
-      Format(instr, "pckev.'t  'wd, 'ws, 'wt");
-      break;
-    case PCKOD:
-      Format(instr, "pckod.'t  'wd, 'ws, 'wt");
-      break;
-    case ILVL:
-      Format(instr, "ilvl.'t  'wd, 'ws, 'wt");
-      break;
-    case ILVR:
-      Format(instr, "ilvr.'t  'wd, 'ws, 'wt");
-      break;
-    case ILVEV:
-      Format(instr, "ilvev.'t  'wd, 'ws, 'wt");
-      break;
-    case ILVOD:
-      Format(instr, "ilvod.'t  'wd, 'ws, 'wt");
-      break;
-    case VSHF:
-      Format(instr, "vshf.'t  'wd, 'ws, 'wt");
-      break;
-    case SRAR:
-      Format(instr, "srar.'t  'wd, 'ws, 'wt");
-      break;
-    case SRLR:
-      Format(instr, "srlr.'t  'wd, 'ws, 'wt");
-      break;
-    case HADD_S:
-      Format(instr, "hadd_s.'t  'wd, 'ws, 'wt");
-      break;
-    case HADD_U:
-      Format(instr, "hadd_u.'t  'wd, 'ws, 'wt");
-      break;
-    case HSUB_S:
-      Format(instr, "hsub_s.'t  'wd, 'ws, 'wt");
-      break;
-    case HSUB_U:
-      Format(instr, "hsub_u.'t  'wd, 'ws, 'wt");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Decoder::DecodeTypeMsa3RF(Instruction* instr) {
-  uint32_t opcode = instr->InstructionBits() & kMsa3RFMask;
-  switch (opcode) {
-    case FCAF:
-      Format(instr, "fcaf.'t  'wd, 'ws, 'wt");
-      break;
-    case FCUN:
-      Format(instr, "fcun.'t  'wd, 'ws, 'wt");
-      break;
-    case FCEQ:
-      Format(instr, "fceq.'t  'wd, 'ws, 'wt");
-      break;
-    case FCUEQ:
-      Format(instr, "fcueq.'t  'wd, 'ws, 'wt");
-      break;
-    case FCLT:
-      Format(instr, "fclt.'t  'wd, 'ws, 'wt");
-      break;
-    case FCULT:
-      Format(instr, "fcult.'t  'wd, 'ws, 'wt");
-      break;
-    case FCLE:
-      Format(instr, "fcle.'t  'wd, 'ws, 'wt");
-      break;
-    case FCULE:
-      Format(instr, "fcule.'t  'wd, 'ws, 'wt");
-      break;
-    case FSAF:
-      Format(instr, "fsaf.'t  'wd, 'ws, 'wt");
-      break;
-    case FSUN:
-      Format(instr, "fsun.'t  'wd, 'ws, 'wt");
-      break;
-    case FSEQ:
-      Format(instr, "fseq.'t  'wd, 'ws, 'wt");
-      break;
-    case FSUEQ:
-      Format(instr, "fsueq.'t  'wd, 'ws, 'wt");
-      break;
-    case FSLT:
-      Format(instr, "fslt.'t  'wd, 'ws, 'wt");
-      break;
-    case FSULT:
-      Format(instr, "fsult.'t  'wd, 'ws, 'wt");
-      break;
-    case FSLE:
-      Format(instr, "fsle.'t  'wd, 'ws, 'wt");
-      break;
-    case FSULE:
-      Format(instr, "fsule.'t  'wd, 'ws, 'wt");
-      break;
-    case FADD:
-      Format(instr, "fadd.'t  'wd, 'ws, 'wt");
-      break;
-    case FSUB:
-      Format(instr, "fsub.'t  'wd, 'ws, 'wt");
-      break;
-    case FMUL:
-      Format(instr, "fmul.'t  'wd, 'ws, 'wt");
-      break;
-    case FDIV:
-      Format(instr, "fdiv.'t  'wd, 'ws, 'wt");
-      break;
-    case FMADD:
-      Format(instr, "fmadd.'t  'wd, 'ws, 'wt");
-      break;
-    case FMSUB:
-      Format(instr, "fmsub.'t  'wd, 'ws, 'wt");
-      break;
-    case FEXP2:
-      Format(instr, "fexp2.'t  'wd, 'ws, 'wt");
-      break;
-    case FEXDO:
-      Format(instr, "fexdo.'t  'wd, 'ws, 'wt");
-      break;
-    case FTQ:
-      Format(instr, "ftq.'t  'wd, 'ws, 'wt");
-      break;
-    case FMIN:
-      Format(instr, "fmin.'t  'wd, 'ws, 'wt");
-      break;
-    case FMIN_A:
-      Format(instr, "fmin_a.'t  'wd, 'ws, 'wt");
-      break;
-    case FMAX:
-      Format(instr, "fmax.'t  'wd, 'ws, 'wt");
-      break;
-    case FMAX_A:
-      Format(instr, "fmax_a.'t  'wd, 'ws, 'wt");
-      break;
-    case FCOR:
-      Format(instr, "fcor.'t  'wd, 'ws, 'wt");
-      break;
-    case FCUNE:
-      Format(instr, "fcune.'t  'wd, 'ws, 'wt");
-      break;
-    case FCNE:
-      Format(instr, "fcne.'t  'wd, 'ws, 'wt");
-      break;
-    case MUL_Q:
-      Format(instr, "mul_q.'t  'wd, 'ws, 'wt");
-      break;
-    case MADD_Q:
-      Format(instr, "madd_q.'t  'wd, 'ws, 'wt");
-      break;
-    case MSUB_Q:
-      Format(instr, "msub_q.'t  'wd, 'ws, 'wt");
-      break;
-    case FSOR:
-      Format(instr, "fsor.'t  'wd, 'ws, 'wt");
-      break;
-    case FSUNE:
-      Format(instr, "fsune.'t  'wd, 'ws, 'wt");
-      break;
-    case FSNE:
-      Format(instr, "fsne.'t  'wd, 'ws, 'wt");
-      break;
-    case MULR_Q:
-      Format(instr, "mulr_q.'t  'wd, 'ws, 'wt");
-      break;
-    case MADDR_Q:
-      Format(instr, "maddr_q.'t  'wd, 'ws, 'wt");
-      break;
-    case MSUBR_Q:
-      Format(instr, "msubr_q.'t  'wd, 'ws, 'wt");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Decoder::DecodeTypeMsaVec(Instruction* instr) {
-  uint32_t opcode = instr->InstructionBits() & kMsaVECMask;
-  switch (opcode) {
-    case AND_V:
-      Format(instr, "and.v  'wd, 'ws, 'wt");
-      break;
-    case OR_V:
-      Format(instr, "or.v  'wd, 'ws, 'wt");
-      break;
-    case NOR_V:
-      Format(instr, "nor.v  'wd, 'ws, 'wt");
-      break;
-    case XOR_V:
-      Format(instr, "xor.v  'wd, 'ws, 'wt");
-      break;
-    case BMNZ_V:
-      Format(instr, "bmnz.v  'wd, 'ws, 'wt");
-      break;
-    case BMZ_V:
-      Format(instr, "bmz.v  'wd, 'ws, 'wt");
-      break;
-    case BSEL_V:
-      Format(instr, "bsel.v  'wd, 'ws, 'wt");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Decoder::DecodeTypeMsa2R(Instruction* instr) {
-  uint32_t opcode = instr->InstructionBits() & kMsa2RMask;
-  switch (opcode) {
-    case FILL: {
-      Format(instr, "fill.'t  'wd, ");
-      PrintRegister(instr->WsValue());  // rs value is in ws field
-    } break;
-    case PCNT:
-      Format(instr, "pcnt.'t  'wd, 'ws");
-      break;
-    case NLOC:
-      Format(instr, "nloc.'t  'wd, 'ws");
-      break;
-    case NLZC:
-      Format(instr, "nlzc.'t  'wd, 'ws");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Decoder::DecodeTypeMsa2RF(Instruction* instr) {
-  uint32_t opcode = instr->InstructionBits() & kMsa2RFMask;
-  switch (opcode) {
-    case FCLASS:
-      Format(instr, "fclass.'t  'wd, 'ws");
-      break;
-    case FTRUNC_S:
-      Format(instr, "ftrunc_s.'t  'wd, 'ws");
-      break;
-    case FTRUNC_U:
-      Format(instr, "ftrunc_u.'t  'wd, 'ws");
-      break;
-    case FSQRT:
-      Format(instr, "fsqrt.'t  'wd, 'ws");
-      break;
-    case FRSQRT:
-      Format(instr, "frsqrt.'t  'wd, 'ws");
-      break;
-    case FRCP:
-      Format(instr, "frcp.'t  'wd, 'ws");
-      break;
-    case FRINT:
-      Format(instr, "frint.'t  'wd, 'ws");
-      break;
-    case FLOG2:
-      Format(instr, "flog2.'t  'wd, 'ws");
-      break;
-    case FEXUPL:
-      Format(instr, "fexupl.'t  'wd, 'ws");
-      break;
-    case FEXUPR:
-      Format(instr, "fexupr.'t  'wd, 'ws");
-      break;
-    case FFQL:
-      Format(instr, "ffql.'t  'wd, 'ws");
-      break;
-    case FFQR:
-      Format(instr, "ffqr.'t  'wd, 'ws");
-      break;
-    case FTINT_S:
-      Format(instr, "ftint_s.'t  'wd, 'ws");
-      break;
-    case FTINT_U:
-      Format(instr, "ftint_u.'t  'wd, 'ws");
-      break;
-    case FFINT_S:
-      Format(instr, "ffint_s.'t  'wd, 'ws");
-      break;
-    case FFINT_U:
-      Format(instr, "ffint_u.'t  'wd, 'ws");
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-// Disassemble the instruction at *instr_ptr into the output buffer.
-// All instructions are one word long, except for the simulator
-// pseudo-instruction stop(msg). For that one special case, we return
-// size larger than one kInstrSize.
-int Decoder::InstructionDecode(byte* instr_ptr) {
-  Instruction* instr = Instruction::At(instr_ptr);
-  // Print raw instruction bytes.
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
-                              "%08x       ",
-                              instr->InstructionBits());
-  switch (instr->InstructionType()) {
-    case Instruction::kRegisterType: {
-      return DecodeTypeRegister(instr);
-    }
-    case Instruction::kImmediateType: {
-      DecodeTypeImmediate(instr);
-      break;
-    }
-    case Instruction::kJumpType: {
-      DecodeTypeJump(instr);
-      break;
-    }
-    default: {
-      Format(instr, "UNSUPPORTED");
-      UNSUPPORTED_MIPS();
-    }
-  }
-  return Instruction::kInstrSize;
-}
-
-
-}  // namespace internal
-}  // namespace v8
-
-
-//------------------------------------------------------------------------------
-
-namespace disasm {
-
-const char* NameConverter::NameOfAddress(byte* addr) const {
-  v8::internal::SNPrintF(tmp_buffer_, "%p", static_cast<void*>(addr));
-  return tmp_buffer_.start();
-}
-
-
-const char* NameConverter::NameOfConstant(byte* addr) const {
-  return NameOfAddress(addr);
-}
-
-
-const char* NameConverter::NameOfCPURegister(int reg) const {
-  return v8::internal::Registers::Name(reg);
-}
-
-
-const char* NameConverter::NameOfXMMRegister(int reg) const {
-  return v8::internal::FPURegisters::Name(reg);
-}
-
-
-const char* NameConverter::NameOfByteCPURegister(int reg) const {
-  UNREACHABLE();  // MIPS does not have the concept of a byte register.
-  return "nobytereg";
-}
-
-
-const char* NameConverter::NameInCode(byte* addr) const {
-  // The default name converter is called for unknown code. So we will not try
-  // to access any memory.
-  return "";
-}
-
-
-//------------------------------------------------------------------------------
-
-Disassembler::Disassembler(const NameConverter& converter)
-    : converter_(converter) {}
-
-
-Disassembler::~Disassembler() {}
-
-
-int Disassembler::InstructionDecode(v8::internal::Vector<char> buffer,
-                                    byte* instruction) {
-  v8::internal::Decoder d(converter_, buffer);
-  return d.InstructionDecode(instruction);
-}
-
-
-// The MIPS assembler does not currently use constant pools.
-int Disassembler::ConstantPoolSizeAt(byte* instruction) {
-  return -1;
-}
-
-
-void Disassembler::Disassemble(FILE* f, byte* begin, byte* end) {
-  NameConverter converter;
-  Disassembler d(converter);
-  for (byte* pc = begin; pc < end;) {
-    v8::internal::EmbeddedVector<char, 128> buffer;
-    buffer[0] = '\0';
-    byte* prev_pc = pc;
-    pc += d.InstructionDecode(buffer, pc);
-    v8::internal::PrintF(f, "%p    %08x      %s\n", static_cast<void*>(prev_pc),
-                         *reinterpret_cast<int32_t*>(prev_pc), buffer.start());
-  }
-}
-
-
-#undef UNSUPPORTED
-
-}  // namespace disasm
-
-#endif  // V8_TARGET_ARCH_MIPS64
diff --git a/src/v8/src/mips64/frame-constants-mips64.cc b/src/v8/src/mips64/frame-constants-mips64.cc
deleted file mode 100644
index 5a19a0c..0000000
--- a/src/v8/src/mips64/frame-constants-mips64.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2011 the V8 project 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 V8_TARGET_ARCH_MIPS64
-
-#include "src/assembler.h"
-#include "src/frame-constants.h"
-#include "src/mips64/assembler-mips64-inl.h"
-#include "src/mips64/assembler-mips64.h"
-
-#include "src/mips64/frame-constants-mips64.h"
-
-namespace v8 {
-namespace internal {
-
-Register JavaScriptFrame::fp_register() { return v8::internal::fp; }
-Register JavaScriptFrame::context_register() { return cp; }
-Register JavaScriptFrame::constant_pool_pointer_register() { UNREACHABLE(); }
-
-int InterpreterFrameConstants::RegisterStackSlotCount(int register_count) {
-  return register_count;
-}
-
-int BuiltinContinuationFrameConstants::PaddingSlotCount(int register_count) {
-  USE(register_count);
-  return 0;
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_MIPS64
diff --git a/src/v8/src/mips64/frame-constants-mips64.h b/src/v8/src/mips64/frame-constants-mips64.h
deleted file mode 100644
index 3444537..0000000
--- a/src/v8/src/mips64/frame-constants-mips64.h
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_MIPS_FRAMES_MIPS_H_
-#define V8_MIPS_FRAMES_MIPS_H_
-
-namespace v8 {
-namespace internal {
-
-class EntryFrameConstants : public AllStatic {
- public:
-  static const int kCallerFPOffset =
-      -(StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize);
-};
-
-class ExitFrameConstants : public TypedFrameConstants {
- public:
-  static const int kSPOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(0);
-  static const int kCodeOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(1);
-  DEFINE_TYPED_FRAME_SIZES(2);
-
-  // The caller fields are below the frame pointer on the stack.
-  static const int kCallerFPOffset = +0 * kPointerSize;
-  // The calling JS function is between FP and PC.
-  static const int kCallerPCOffset = +1 * kPointerSize;
-
-  // MIPS-specific: a pointer to the old sp to avoid unnecessary calculations.
-  static const int kCallerSPOffset = +2 * kPointerSize;
-
-  // FP-relative displacement of the caller's SP.
-  static const int kCallerSPDisplacement = +2 * kPointerSize;
-
-  static const int kConstantPoolOffset = 0;  // Not used.
-};
-
-class JavaScriptFrameConstants : public AllStatic {
- public:
-  // FP-relative.
-  static const int kLocal0Offset = StandardFrameConstants::kExpressionsOffset;
-  static const int kLastParameterOffset = +2 * kPointerSize;
-  static const int kFunctionOffset = StandardFrameConstants::kFunctionOffset;
-
-  // Caller SP-relative.
-  static const int kParam0Offset = -2 * kPointerSize;
-  static const int kReceiverOffset = -1 * kPointerSize;
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif
diff --git a/src/v8/src/mips64/interface-descriptors-mips64.cc b/src/v8/src/mips64/interface-descriptors-mips64.cc
deleted file mode 100644
index 8bc04a0..0000000
--- a/src/v8/src/mips64/interface-descriptors-mips64.cc
+++ /dev/null
@@ -1,350 +0,0 @@
-// Copyright 2012 the V8 project 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 V8_TARGET_ARCH_MIPS64
-
-#include "src/interface-descriptors.h"
-
-namespace v8 {
-namespace internal {
-
-const Register CallInterfaceDescriptor::ContextRegister() { return cp; }
-
-void CallInterfaceDescriptor::DefaultInitializePlatformSpecific(
-    CallInterfaceDescriptorData* data, int register_parameter_count) {
-  const Register default_stub_registers[] = {a0, a1, a2, a3, a4};
-  CHECK_LE(static_cast<size_t>(register_parameter_count),
-           arraysize(default_stub_registers));
-  data->InitializePlatformSpecific(register_parameter_count,
-                                   default_stub_registers);
-}
-
-void RecordWriteDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  const Register default_stub_registers[] = {a0, a1, a2, a3, kReturnRegister0};
-
-  data->RestrictAllocatableRegisters(default_stub_registers,
-                                     arraysize(default_stub_registers));
-
-  CHECK_LE(static_cast<size_t>(kParameterCount),
-           arraysize(default_stub_registers));
-  data->InitializePlatformSpecific(kParameterCount, default_stub_registers);
-}
-
-const Register FastNewFunctionContextDescriptor::FunctionRegister() {
-  return a1;
-}
-const Register FastNewFunctionContextDescriptor::SlotsRegister() { return a0; }
-
-const Register LoadDescriptor::ReceiverRegister() { return a1; }
-const Register LoadDescriptor::NameRegister() { return a2; }
-const Register LoadDescriptor::SlotRegister() { return a0; }
-
-const Register LoadWithVectorDescriptor::VectorRegister() { return a3; }
-
-const Register StoreDescriptor::ReceiverRegister() { return a1; }
-const Register StoreDescriptor::NameRegister() { return a2; }
-const Register StoreDescriptor::ValueRegister() { return a0; }
-const Register StoreDescriptor::SlotRegister() { return a4; }
-
-const Register StoreWithVectorDescriptor::VectorRegister() { return a3; }
-
-const Register StoreTransitionDescriptor::SlotRegister() { return a4; }
-const Register StoreTransitionDescriptor::VectorRegister() { return a3; }
-const Register StoreTransitionDescriptor::MapRegister() { return a5; }
-
-const Register ApiGetterDescriptor::HolderRegister() { return a0; }
-const Register ApiGetterDescriptor::CallbackRegister() { return a3; }
-
-const Register MathPowTaggedDescriptor::exponent() { return a2; }
-
-const Register MathPowIntegerDescriptor::exponent() {
-  return MathPowTaggedDescriptor::exponent();
-}
-
-
-const Register GrowArrayElementsDescriptor::ObjectRegister() { return a0; }
-const Register GrowArrayElementsDescriptor::KeyRegister() { return a3; }
-
-
-void FastNewClosureDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {a1, a2, a3};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-// static
-const Register TypeConversionDescriptor::ArgumentRegister() { return a0; }
-
-void TypeofDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {a3};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void CallFunctionDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {a1};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void CallTrampolineDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // a1: target
-  // a0: number of arguments
-  Register registers[] = {a1, a0};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // a0 : number of arguments (on the stack, not including receiver)
-  // a1 : the target to call
-  // a2 : arguments list (FixedArray)
-  // a4 : arguments list length (untagged)
-  Register registers[] = {a1, a0, a2, a4};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallForwardVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // a1: the target to call
-  // a0: number of arguments
-  // a2: start index (to support rest parameters)
-  Register registers[] = {a1, a0, a2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallWithSpreadDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // a0 : number of arguments (on the stack, not including receiver)
-  // a1 : the target to call
-  // a2 : the object to spread
-  Register registers[] = {a1, a0, a2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallWithArrayLikeDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // a1 : the target to call
-  // a2 : the arguments list
-  Register registers[] = {a1, a2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // a0 : number of arguments (on the stack, not including receiver)
-  // a1 : the target to call
-  // a3 : the new target
-  // a2 : arguments list (FixedArray)
-  // a4 : arguments list length (untagged)
-  Register registers[] = {a1, a3, a0, a2, a4};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructForwardVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // a1: the target to call
-  // a3: new target
-  // a0: number of arguments
-  // a2: start index (to support rest parameters)
-  Register registers[] = {a1, a3, a0, a2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructWithSpreadDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // a0 : number of arguments (on the stack, not including receiver)
-  // a1 : the target to call
-  // a3 : the new target
-  // a2 : the object to spread
-  Register registers[] = {a1, a3, a0, a2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructWithArrayLikeDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // a1 : the target to call
-  // a3 : the new target
-  // a2 : the arguments list
-  Register registers[] = {a1, a3, a2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructStubDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // a1: target
-  // a3: new target
-  // a0: number of arguments
-  // a2: allocation site or undefined
-  Register registers[] = {a1, a3, a0, a2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-
-void ConstructTrampolineDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // a1: target
-  // a3: new target
-  // a0: number of arguments
-  Register registers[] = {a1, a3, a0};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-
-void TransitionElementsKindDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {a0, a1};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void AbortJSDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {a0};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void AllocateHeapNumberDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // register state
-  data->InitializePlatformSpecific(0, nullptr, nullptr);
-}
-
-void ArrayConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // kTarget, kNewTarget, kActualArgumentsCount, kAllocationSite
-  Register registers[] = {a1, a3, a0, a2};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void ArrayNoArgumentConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // register state
-  // a0 -- number of arguments
-  // a1 -- function
-  // a2 -- allocation site with elements kind
-  Register registers[] = {a1, a2, a0};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void ArraySingleArgumentConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // register state
-  // a0 -- number of arguments
-  // a1 -- function
-  // a2 -- allocation site with elements kind
-  Register registers[] = {a1, a2, a0};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void ArrayNArgumentsConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // stack param count needs (constructor pointer, and single argument)
-  Register registers[] = {a1, a2, a0};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CompareDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {a1, a0};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-
-void BinaryOpDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {a1, a0};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void StringAddDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {a1, a0};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void ArgumentAdaptorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      a1,  // JSFunction
-      a3,  // the new target
-      a0,  // actual number of arguments
-      a2,  // expected number of arguments
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ApiCallbackDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      JavaScriptFrame::context_register(),  // callee context
-      a4,                                   // call_data
-      a2,                                   // holder
-      a1,                                   // api_function_address
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterDispatchDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      kInterpreterAccumulatorRegister, kInterpreterBytecodeOffsetRegister,
-      kInterpreterBytecodeArrayRegister, kInterpreterDispatchTableRegister};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterPushArgsThenCallDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      a0,  // argument count (not including receiver)
-      a2,  // address of first argument
-      a1   // the target callable to be call
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterPushArgsThenConstructDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      a0,  // argument count (not including receiver)
-      a3,  // new target
-      a1,  // constructor to call
-      a2,  // allocation site feedback if available, undefined otherwise.
-      a4   // address of the first argument
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterCEntryDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      a0,  // argument count (argc)
-      a2,  // address of first argument (argv)
-      a1   // the runtime function to call
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ResumeGeneratorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      v0,  // the value to pass to the generator
-      a1   // the JSGeneratorObject to resume
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void FrameDropperTrampolineDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      a1,  // loaded new FP
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_MIPS64
diff --git a/src/v8/src/mips64/macro-assembler-mips64.cc b/src/v8/src/mips64/macro-assembler-mips64.cc
deleted file mode 100644
index 841f466..0000000
--- a/src/v8/src/mips64/macro-assembler-mips64.cc
+++ /dev/null
@@ -1,5549 +0,0 @@
-// Copyright 2012 the V8 project 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 <limits.h>  // For LONG_MIN, LONG_MAX.
-
-#if V8_TARGET_ARCH_MIPS64
-
-#include "src/base/bits.h"
-#include "src/base/division-by-constant.h"
-#include "src/bootstrapper.h"
-#include "src/callable.h"
-#include "src/code-stubs.h"
-#include "src/debug/debug.h"
-#include "src/external-reference-table.h"
-#include "src/frames-inl.h"
-#include "src/mips64/assembler-mips64-inl.h"
-#include "src/mips64/macro-assembler-mips64.h"
-#include "src/register-configuration.h"
-#include "src/runtime/runtime.h"
-
-namespace v8 {
-namespace internal {
-
-MacroAssembler::MacroAssembler(Isolate* isolate, void* buffer, int size,
-                               CodeObjectRequired create_code_object)
-    : TurboAssembler(isolate, buffer, size, create_code_object) {}
-
-TurboAssembler::TurboAssembler(Isolate* isolate, void* buffer, int buffer_size,
-                               CodeObjectRequired create_code_object)
-    : Assembler(isolate, buffer, buffer_size),
-      isolate_(isolate),
-      has_double_zero_reg_set_(false) {
-  if (create_code_object == CodeObjectRequired::kYes) {
-    code_object_ =
-        Handle<HeapObject>::New(isolate->heap()->undefined_value(), isolate);
-  }
-}
-
-int TurboAssembler::RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode,
-                                                    Register exclusion1,
-                                                    Register exclusion2,
-                                                    Register exclusion3) const {
-  int bytes = 0;
-  RegList exclusions = 0;
-  if (exclusion1 != no_reg) {
-    exclusions |= exclusion1.bit();
-    if (exclusion2 != no_reg) {
-      exclusions |= exclusion2.bit();
-      if (exclusion3 != no_reg) {
-        exclusions |= exclusion3.bit();
-      }
-    }
-  }
-
-  RegList list = kJSCallerSaved & ~exclusions;
-  bytes += NumRegs(list) * kPointerSize;
-
-  if (fp_mode == kSaveFPRegs) {
-    bytes += NumRegs(kCallerSavedFPU) * kDoubleSize;
-  }
-
-  return bytes;
-}
-
-int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
-                                    Register exclusion2, Register exclusion3) {
-  int bytes = 0;
-  RegList exclusions = 0;
-  if (exclusion1 != no_reg) {
-    exclusions |= exclusion1.bit();
-    if (exclusion2 != no_reg) {
-      exclusions |= exclusion2.bit();
-      if (exclusion3 != no_reg) {
-        exclusions |= exclusion3.bit();
-      }
-    }
-  }
-
-  RegList list = kJSCallerSaved & ~exclusions;
-  MultiPush(list);
-  bytes += NumRegs(list) * kPointerSize;
-
-  if (fp_mode == kSaveFPRegs) {
-    MultiPushFPU(kCallerSavedFPU);
-    bytes += NumRegs(kCallerSavedFPU) * kDoubleSize;
-  }
-
-  return bytes;
-}
-
-int TurboAssembler::PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
-                                   Register exclusion2, Register exclusion3) {
-  int bytes = 0;
-  if (fp_mode == kSaveFPRegs) {
-    MultiPopFPU(kCallerSavedFPU);
-    bytes += NumRegs(kCallerSavedFPU) * kDoubleSize;
-  }
-
-  RegList exclusions = 0;
-  if (exclusion1 != no_reg) {
-    exclusions |= exclusion1.bit();
-    if (exclusion2 != no_reg) {
-      exclusions |= exclusion2.bit();
-      if (exclusion3 != no_reg) {
-        exclusions |= exclusion3.bit();
-      }
-    }
-  }
-
-  RegList list = kJSCallerSaved & ~exclusions;
-  MultiPop(list);
-  bytes += NumRegs(list) * kPointerSize;
-
-  return bytes;
-}
-
-void TurboAssembler::LoadRoot(Register destination, Heap::RootListIndex index) {
-  Ld(destination, MemOperand(s6, index << kPointerSizeLog2));
-}
-
-void TurboAssembler::LoadRoot(Register destination, Heap::RootListIndex index,
-                              Condition cond, Register src1,
-                              const Operand& src2) {
-  Branch(2, NegateCondition(cond), src1, src2);
-  Ld(destination, MemOperand(s6, index << kPointerSizeLog2));
-}
-
-
-void TurboAssembler::PushCommonFrame(Register marker_reg) {
-  if (marker_reg.is_valid()) {
-    Push(ra, fp, marker_reg);
-    Daddu(fp, sp, Operand(kPointerSize));
-  } else {
-    Push(ra, fp);
-    mov(fp, sp);
-  }
-}
-
-void TurboAssembler::PushStandardFrame(Register function_reg) {
-  int offset = -StandardFrameConstants::kContextOffset;
-  if (function_reg.is_valid()) {
-    Push(ra, fp, cp, function_reg);
-    offset += kPointerSize;
-  } else {
-    Push(ra, fp, cp);
-  }
-  Daddu(fp, sp, Operand(offset));
-}
-
-// Push and pop all registers that can hold pointers.
-void MacroAssembler::PushSafepointRegisters() {
-  // Safepoints expect a block of kNumSafepointRegisters values on the
-  // stack, so adjust the stack for unsaved registers.
-  const int num_unsaved = kNumSafepointRegisters - kNumSafepointSavedRegisters;
-  DCHECK_GE(num_unsaved, 0);
-  if (num_unsaved > 0) {
-    Dsubu(sp, sp, Operand(num_unsaved * kPointerSize));
-  }
-  MultiPush(kSafepointSavedRegisters);
-}
-
-
-void MacroAssembler::PopSafepointRegisters() {
-  const int num_unsaved = kNumSafepointRegisters - kNumSafepointSavedRegisters;
-  MultiPop(kSafepointSavedRegisters);
-  if (num_unsaved > 0) {
-    Daddu(sp, sp, Operand(num_unsaved * kPointerSize));
-  }
-}
-
-int MacroAssembler::SafepointRegisterStackIndex(int reg_code) {
-  // The registers are pushed starting with the highest encoding,
-  // which means that lowest encodings are closest to the stack pointer.
-  return kSafepointRegisterStackIndexMap[reg_code];
-}
-
-
-// Clobbers object, dst, value, and ra, if (ra_status == kRAHasBeenSaved)
-// The register 'object' contains a heap object pointer.  The heap object
-// tag is shifted away.
-void MacroAssembler::RecordWriteField(Register object, int offset,
-                                      Register value, Register dst,
-                                      RAStatus ra_status,
-                                      SaveFPRegsMode save_fp,
-                                      RememberedSetAction remembered_set_action,
-                                      SmiCheck smi_check) {
-  DCHECK(!AreAliased(value, dst, t8, object));
-  // First, check if a write barrier is even needed. The tests below
-  // catch stores of Smis.
-  Label done;
-
-  // Skip barrier if writing a smi.
-  if (smi_check == INLINE_SMI_CHECK) {
-    JumpIfSmi(value, &done);
-  }
-
-  // Although the object register is tagged, the offset is relative to the start
-  // of the object, so so offset must be a multiple of kPointerSize.
-  DCHECK(IsAligned(offset, kPointerSize));
-
-  Daddu(dst, object, Operand(offset - kHeapObjectTag));
-  if (emit_debug_code()) {
-    Label ok;
-    And(t8, dst, Operand(kPointerSize - 1));
-    Branch(&ok, eq, t8, Operand(zero_reg));
-    stop("Unaligned cell in write barrier");
-    bind(&ok);
-  }
-
-  RecordWrite(object, dst, value, ra_status, save_fp, remembered_set_action,
-              OMIT_SMI_CHECK);
-
-  bind(&done);
-
-  // Clobber clobbered input registers when running with the debug-code flag
-  // turned on to provoke errors.
-  if (emit_debug_code()) {
-    li(value, Operand(bit_cast<int64_t>(kZapValue + 4)));
-    li(dst, Operand(bit_cast<int64_t>(kZapValue + 8)));
-  }
-}
-
-void TurboAssembler::SaveRegisters(RegList registers) {
-  DCHECK_GT(NumRegs(registers), 0);
-  RegList regs = 0;
-  for (int i = 0; i < Register::kNumRegisters; ++i) {
-    if ((registers >> i) & 1u) {
-      regs |= Register::from_code(i).bit();
-    }
-  }
-  MultiPush(regs);
-}
-
-void TurboAssembler::RestoreRegisters(RegList registers) {
-  DCHECK_GT(NumRegs(registers), 0);
-  RegList regs = 0;
-  for (int i = 0; i < Register::kNumRegisters; ++i) {
-    if ((registers >> i) & 1u) {
-      regs |= Register::from_code(i).bit();
-    }
-  }
-  MultiPop(regs);
-}
-
-void TurboAssembler::CallRecordWriteStub(
-    Register object, Register address,
-    RememberedSetAction remembered_set_action, SaveFPRegsMode fp_mode) {
-  // TODO(albertnetymk): For now we ignore remembered_set_action and fp_mode,
-  // i.e. always emit remember set and save FP registers in RecordWriteStub. If
-  // large performance regression is observed, we should use these values to
-  // avoid unnecessary work.
-
-  Callable const callable =
-      Builtins::CallableFor(isolate(), Builtins::kRecordWrite);
-  RegList registers = callable.descriptor().allocatable_registers();
-
-  SaveRegisters(registers);
-  Register object_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kObject));
-  Register slot_parameter(
-      callable.descriptor().GetRegisterParameter(RecordWriteDescriptor::kSlot));
-  Register isolate_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kIsolate));
-  Register remembered_set_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kRememberedSet));
-  Register fp_mode_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kFPMode));
-
-  Push(object);
-  Push(address);
-
-  Pop(slot_parameter);
-  Pop(object_parameter);
-
-  li(isolate_parameter, Operand(ExternalReference::isolate_address(isolate())));
-  Move(remembered_set_parameter, Smi::FromEnum(remembered_set_action));
-  Move(fp_mode_parameter, Smi::FromEnum(fp_mode));
-  Call(callable.code(), RelocInfo::CODE_TARGET);
-
-  RestoreRegisters(registers);
-}
-
-// Clobbers object, address, value, and ra, if (ra_status == kRAHasBeenSaved)
-// The register 'object' contains a heap object pointer.  The heap object
-// tag is shifted away.
-void MacroAssembler::RecordWrite(Register object, Register address,
-                                 Register value, RAStatus ra_status,
-                                 SaveFPRegsMode fp_mode,
-                                 RememberedSetAction remembered_set_action,
-                                 SmiCheck smi_check) {
-  DCHECK(!AreAliased(object, address, value, t8));
-  DCHECK(!AreAliased(object, address, value, t9));
-
-  if (emit_debug_code()) {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    Ld(scratch, MemOperand(address));
-    Assert(eq, AbortReason::kWrongAddressOrValuePassedToRecordWrite, scratch,
-           Operand(value));
-  }
-
-  if (remembered_set_action == OMIT_REMEMBERED_SET &&
-      !FLAG_incremental_marking) {
-    return;
-  }
-
-  // First, check if a write barrier is even needed. The tests below
-  // catch stores of smis and stores into the young generation.
-  Label done;
-
-  if (smi_check == INLINE_SMI_CHECK) {
-    DCHECK_EQ(0, kSmiTag);
-    JumpIfSmi(value, &done);
-  }
-
-  CheckPageFlag(value,
-                value,  // Used as scratch.
-                MemoryChunk::kPointersToHereAreInterestingMask, eq, &done);
-  CheckPageFlag(object,
-                value,  // Used as scratch.
-                MemoryChunk::kPointersFromHereAreInterestingMask,
-                eq,
-                &done);
-
-  // Record the actual write.
-  if (ra_status == kRAHasNotBeenSaved) {
-    push(ra);
-  }
-  CallRecordWriteStub(object, address, remembered_set_action, fp_mode);
-  if (ra_status == kRAHasNotBeenSaved) {
-    pop(ra);
-  }
-
-  bind(&done);
-
-  {
-    // Count number of write barriers in generated code.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    isolate()->counters()->write_barriers_static()->Increment();
-    IncrementCounter(isolate()->counters()->write_barriers_dynamic(), 1,
-                     scratch, value);
-  }
-
-  // Clobber clobbered registers when running with the debug-code flag
-  // turned on to provoke errors.
-  if (emit_debug_code()) {
-    li(address, Operand(bit_cast<int64_t>(kZapValue + 12)));
-    li(value, Operand(bit_cast<int64_t>(kZapValue + 16)));
-  }
-}
-
-// ---------------------------------------------------------------------------
-// Instruction macros.
-
-void TurboAssembler::Addu(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    addu(rd, rs, rt.rm());
-  } else {
-    if (is_int16(rt.immediate()) && !MustUseReg(rt.rmode())) {
-      addiu(rd, rs, static_cast<int32_t>(rt.immediate()));
-    } else {
-      // li handles the relocation.
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      DCHECK(rs != scratch);
-      li(scratch, rt);
-      addu(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Daddu(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    daddu(rd, rs, rt.rm());
-  } else {
-    if (is_int16(rt.immediate()) && !MustUseReg(rt.rmode())) {
-      daddiu(rd, rs, static_cast<int32_t>(rt.immediate()));
-    } else {
-      // li handles the relocation.
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      DCHECK(rs != scratch);
-      li(scratch, rt);
-      daddu(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Subu(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    subu(rd, rs, rt.rm());
-  } else {
-    DCHECK(is_int32(rt.immediate()));
-    if (is_int16(-rt.immediate()) && !MustUseReg(rt.rmode())) {
-      addiu(rd, rs,
-            static_cast<int32_t>(
-                -rt.immediate()));  // No subiu instr, use addiu(x, y, -imm).
-    } else {
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      DCHECK(rs != scratch);
-      if (-rt.immediate() >> 16 == 0 && !MustUseReg(rt.rmode())) {
-        // Use load -imm and addu when loading -imm generates one instruction.
-        li(scratch, -rt.immediate());
-        addu(rd, rs, scratch);
-      } else {
-        // li handles the relocation.
-        li(scratch, rt);
-        subu(rd, rs, scratch);
-      }
-    }
-  }
-}
-
-void TurboAssembler::Dsubu(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    dsubu(rd, rs, rt.rm());
-  } else if (is_int16(-rt.immediate()) && !MustUseReg(rt.rmode())) {
-    daddiu(rd, rs,
-           static_cast<int32_t>(
-               -rt.immediate()));  // No dsubiu instr, use daddiu(x, y, -imm).
-  } else {
-    DCHECK(rs != at);
-    int li_count = InstrCountForLi64Bit(rt.immediate());
-    int li_neg_count = InstrCountForLi64Bit(-rt.immediate());
-    if (li_neg_count < li_count && !MustUseReg(rt.rmode())) {
-      // Use load -imm and daddu when loading -imm generates one instruction.
-      DCHECK(rt.immediate() != std::numeric_limits<int32_t>::min());
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      li(scratch, Operand(-rt.immediate()));
-      Daddu(rd, rs, scratch);
-    } else {
-      // li handles the relocation.
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      li(scratch, rt);
-      dsubu(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Mul(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    mul(rd, rs, rt.rm());
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    mul(rd, rs, scratch);
-  }
-}
-
-void TurboAssembler::Mulh(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    if (kArchVariant != kMips64r6) {
-      mult(rs, rt.rm());
-      mfhi(rd);
-    } else {
-      muh(rd, rs, rt.rm());
-    }
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    if (kArchVariant != kMips64r6) {
-      mult(rs, scratch);
-      mfhi(rd);
-    } else {
-      muh(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Mulhu(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    if (kArchVariant != kMips64r6) {
-      multu(rs, rt.rm());
-      mfhi(rd);
-    } else {
-      muhu(rd, rs, rt.rm());
-    }
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    if (kArchVariant != kMips64r6) {
-      multu(rs, scratch);
-      mfhi(rd);
-    } else {
-      muhu(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Dmul(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    if (kArchVariant == kMips64r6) {
-      dmul(rd, rs, rt.rm());
-    } else {
-      dmult(rs, rt.rm());
-      mflo(rd);
-    }
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    if (kArchVariant == kMips64r6) {
-      dmul(rd, rs, scratch);
-    } else {
-      dmult(rs, scratch);
-      mflo(rd);
-    }
-  }
-}
-
-void TurboAssembler::Dmulh(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    if (kArchVariant == kMips64r6) {
-      dmuh(rd, rs, rt.rm());
-    } else {
-      dmult(rs, rt.rm());
-      mfhi(rd);
-    }
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    if (kArchVariant == kMips64r6) {
-      dmuh(rd, rs, scratch);
-    } else {
-      dmult(rs, scratch);
-      mfhi(rd);
-    }
-  }
-}
-
-void TurboAssembler::Mult(Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    mult(rs, rt.rm());
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    mult(rs, scratch);
-  }
-}
-
-void TurboAssembler::Dmult(Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    dmult(rs, rt.rm());
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    dmult(rs, scratch);
-  }
-}
-
-void TurboAssembler::Multu(Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    multu(rs, rt.rm());
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    multu(rs, scratch);
-  }
-}
-
-void TurboAssembler::Dmultu(Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    dmultu(rs, rt.rm());
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    dmultu(rs, scratch);
-  }
-}
-
-void TurboAssembler::Div(Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    div(rs, rt.rm());
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    div(rs, scratch);
-  }
-}
-
-void TurboAssembler::Div(Register res, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    if (kArchVariant != kMips64r6) {
-      div(rs, rt.rm());
-      mflo(res);
-    } else {
-      div(res, rs, rt.rm());
-    }
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    if (kArchVariant != kMips64r6) {
-      div(rs, scratch);
-      mflo(res);
-    } else {
-      div(res, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Mod(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    if (kArchVariant != kMips64r6) {
-      div(rs, rt.rm());
-      mfhi(rd);
-    } else {
-      mod(rd, rs, rt.rm());
-    }
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    if (kArchVariant != kMips64r6) {
-      div(rs, scratch);
-      mfhi(rd);
-    } else {
-      mod(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Modu(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    if (kArchVariant != kMips64r6) {
-      divu(rs, rt.rm());
-      mfhi(rd);
-    } else {
-      modu(rd, rs, rt.rm());
-    }
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    if (kArchVariant != kMips64r6) {
-      divu(rs, scratch);
-      mfhi(rd);
-    } else {
-      modu(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Ddiv(Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    ddiv(rs, rt.rm());
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    ddiv(rs, scratch);
-  }
-}
-
-void TurboAssembler::Ddiv(Register rd, Register rs, const Operand& rt) {
-  if (kArchVariant != kMips64r6) {
-    if (rt.is_reg()) {
-      ddiv(rs, rt.rm());
-      mflo(rd);
-    } else {
-      // li handles the relocation.
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      DCHECK(rs != scratch);
-      li(scratch, rt);
-      ddiv(rs, scratch);
-      mflo(rd);
-    }
-  } else {
-    if (rt.is_reg()) {
-      ddiv(rd, rs, rt.rm());
-    } else {
-      // li handles the relocation.
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      DCHECK(rs != scratch);
-      li(scratch, rt);
-      ddiv(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Divu(Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    divu(rs, rt.rm());
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    divu(rs, scratch);
-  }
-}
-
-void TurboAssembler::Divu(Register res, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    if (kArchVariant != kMips64r6) {
-      divu(rs, rt.rm());
-      mflo(res);
-    } else {
-      divu(res, rs, rt.rm());
-    }
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    if (kArchVariant != kMips64r6) {
-      divu(rs, scratch);
-      mflo(res);
-    } else {
-      divu(res, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Ddivu(Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    ddivu(rs, rt.rm());
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    ddivu(rs, scratch);
-  }
-}
-
-void TurboAssembler::Ddivu(Register res, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    if (kArchVariant != kMips64r6) {
-      ddivu(rs, rt.rm());
-      mflo(res);
-    } else {
-      ddivu(res, rs, rt.rm());
-    }
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    if (kArchVariant != kMips64r6) {
-      ddivu(rs, scratch);
-      mflo(res);
-    } else {
-      ddivu(res, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Dmod(Register rd, Register rs, const Operand& rt) {
-  if (kArchVariant != kMips64r6) {
-    if (rt.is_reg()) {
-      ddiv(rs, rt.rm());
-      mfhi(rd);
-    } else {
-      // li handles the relocation.
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      DCHECK(rs != scratch);
-      li(scratch, rt);
-      ddiv(rs, scratch);
-      mfhi(rd);
-    }
-  } else {
-    if (rt.is_reg()) {
-      dmod(rd, rs, rt.rm());
-    } else {
-      // li handles the relocation.
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      DCHECK(rs != scratch);
-      li(scratch, rt);
-      dmod(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Dmodu(Register rd, Register rs, const Operand& rt) {
-  if (kArchVariant != kMips64r6) {
-    if (rt.is_reg()) {
-      ddivu(rs, rt.rm());
-      mfhi(rd);
-    } else {
-      // li handles the relocation.
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      DCHECK(rs != scratch);
-      li(scratch, rt);
-      ddivu(rs, scratch);
-      mfhi(rd);
-    }
-  } else {
-    if (rt.is_reg()) {
-      dmodu(rd, rs, rt.rm());
-    } else {
-      // li handles the relocation.
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      DCHECK(rs != scratch);
-      li(scratch, rt);
-      dmodu(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::And(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    and_(rd, rs, rt.rm());
-  } else {
-    if (is_uint16(rt.immediate()) && !MustUseReg(rt.rmode())) {
-      andi(rd, rs, static_cast<int32_t>(rt.immediate()));
-    } else {
-      // li handles the relocation.
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      DCHECK(rs != scratch);
-      li(scratch, rt);
-      and_(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Or(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    or_(rd, rs, rt.rm());
-  } else {
-    if (is_uint16(rt.immediate()) && !MustUseReg(rt.rmode())) {
-      ori(rd, rs, static_cast<int32_t>(rt.immediate()));
-    } else {
-      // li handles the relocation.
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      DCHECK(rs != scratch);
-      li(scratch, rt);
-      or_(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Xor(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    xor_(rd, rs, rt.rm());
-  } else {
-    if (is_uint16(rt.immediate()) && !MustUseReg(rt.rmode())) {
-      xori(rd, rs, static_cast<int32_t>(rt.immediate()));
-    } else {
-      // li handles the relocation.
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      DCHECK(rs != scratch);
-      li(scratch, rt);
-      xor_(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Nor(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    nor(rd, rs, rt.rm());
-  } else {
-    // li handles the relocation.
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    DCHECK(rs != scratch);
-    li(scratch, rt);
-    nor(rd, rs, scratch);
-  }
-}
-
-void TurboAssembler::Neg(Register rs, const Operand& rt) {
-  dsubu(rs, zero_reg, rt.rm());
-}
-
-void TurboAssembler::Slt(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    slt(rd, rs, rt.rm());
-  } else {
-    if (is_int16(rt.immediate()) && !MustUseReg(rt.rmode())) {
-      slti(rd, rs, static_cast<int32_t>(rt.immediate()));
-    } else {
-      // li handles the relocation.
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.hasAvailable() ? temps.Acquire() : t8;
-      DCHECK(rs != scratch);
-      li(scratch, rt);
-      slt(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Sltu(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    sltu(rd, rs, rt.rm());
-  } else {
-    const uint64_t int16_min = std::numeric_limits<int16_t>::min();
-    if (is_uint15(rt.immediate()) && !MustUseReg(rt.rmode())) {
-      // Imm range is: [0, 32767].
-      sltiu(rd, rs, static_cast<int32_t>(rt.immediate()));
-    } else if (is_uint15(rt.immediate() - int16_min) &&
-               !MustUseReg(rt.rmode())) {
-      // Imm range is: [max_unsigned-32767,max_unsigned].
-      sltiu(rd, rs, static_cast<uint16_t>(rt.immediate()));
-    } else {
-      // li handles the relocation.
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.hasAvailable() ? temps.Acquire() : t8;
-      DCHECK(rs != scratch);
-      li(scratch, rt);
-      sltu(rd, rs, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Ror(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    rotrv(rd, rs, rt.rm());
-  } else {
-    int64_t ror_value = rt.immediate() % 32;
-    if (ror_value < 0) {
-      ror_value += 32;
-    }
-    rotr(rd, rs, ror_value);
-  }
-}
-
-void TurboAssembler::Dror(Register rd, Register rs, const Operand& rt) {
-  if (rt.is_reg()) {
-    drotrv(rd, rs, rt.rm());
-  } else {
-    int64_t dror_value = rt.immediate() % 64;
-    if (dror_value < 0) dror_value += 64;
-    if (dror_value <= 31) {
-      drotr(rd, rs, dror_value);
-    } else {
-      drotr32(rd, rs, dror_value - 32);
-    }
-  }
-}
-
-
-void MacroAssembler::Pref(int32_t hint, const MemOperand& rs) {
-    pref(hint, rs);
-}
-
-void TurboAssembler::Lsa(Register rd, Register rt, Register rs, uint8_t sa,
-                         Register scratch) {
-  DCHECK(sa >= 1 && sa <= 31);
-  if (kArchVariant == kMips64r6 && sa <= 4) {
-    lsa(rd, rt, rs, sa - 1);
-  } else {
-    Register tmp = rd == rt ? scratch : rd;
-    DCHECK(tmp != rt);
-    sll(tmp, rs, sa);
-    Addu(rd, rt, tmp);
-  }
-}
-
-void TurboAssembler::Dlsa(Register rd, Register rt, Register rs, uint8_t sa,
-                          Register scratch) {
-  DCHECK(sa >= 1 && sa <= 31);
-  if (kArchVariant == kMips64r6 && sa <= 4) {
-    dlsa(rd, rt, rs, sa - 1);
-  } else {
-    Register tmp = rd == rt ? scratch : rd;
-    DCHECK(tmp != rt);
-    dsll(tmp, rs, sa);
-    Daddu(rd, rt, tmp);
-  }
-}
-
-void TurboAssembler::Bovc(Register rs, Register rt, Label* L) {
-  if (is_trampoline_emitted()) {
-    Label skip;
-    bnvc(rs, rt, &skip);
-    BranchLong(L, PROTECT);
-    bind(&skip);
-  } else {
-    bovc(rs, rt, L);
-  }
-}
-
-void TurboAssembler::Bnvc(Register rs, Register rt, Label* L) {
-  if (is_trampoline_emitted()) {
-    Label skip;
-    bovc(rs, rt, &skip);
-    BranchLong(L, PROTECT);
-    bind(&skip);
-  } else {
-    bnvc(rs, rt, L);
-  }
-}
-
-// ------------Pseudo-instructions-------------
-
-// Change endianness
-void TurboAssembler::ByteSwapSigned(Register dest, Register src,
-                                    int operand_size) {
-  DCHECK(operand_size == 1 || operand_size == 2 || operand_size == 4 ||
-         operand_size == 8);
-  DCHECK(kArchVariant == kMips64r6 || kArchVariant == kMips64r2);
-  if (operand_size == 1) {
-    seb(src, src);
-    sll(src, src, 0);
-    dsbh(dest, src);
-    dshd(dest, dest);
-  } else if (operand_size == 2) {
-    seh(src, src);
-    sll(src, src, 0);
-    dsbh(dest, src);
-    dshd(dest, dest);
-  } else if (operand_size == 4) {
-    sll(src, src, 0);
-    dsbh(dest, src);
-    dshd(dest, dest);
-  } else {
-    dsbh(dest, src);
-    dshd(dest, dest);
-  }
-}
-
-void TurboAssembler::ByteSwapUnsigned(Register dest, Register src,
-                                      int operand_size) {
-  DCHECK(operand_size == 1 || operand_size == 2 || operand_size == 4);
-  if (operand_size == 1) {
-    andi(src, src, 0xFF);
-    dsbh(dest, src);
-    dshd(dest, dest);
-  } else if (operand_size == 2) {
-    andi(src, src, 0xFFFF);
-    dsbh(dest, src);
-    dshd(dest, dest);
-  } else {
-    dsll32(src, src, 0);
-    dsrl32(src, src, 0);
-    dsbh(dest, src);
-    dshd(dest, dest);
-  }
-}
-
-void TurboAssembler::Ulw(Register rd, const MemOperand& rs) {
-  DCHECK(rd != at);
-  DCHECK(rs.rm() != at);
-  if (kArchVariant == kMips64r6) {
-    Lw(rd, rs);
-  } else {
-    DCHECK_EQ(kArchVariant, kMips64r2);
-    DCHECK(kMipsLwrOffset <= 3 && kMipsLwlOffset <= 3);
-    MemOperand source = rs;
-    // Adjust offset for two accesses and check if offset + 3 fits into int16_t.
-    AdjustBaseAndOffset(source, OffsetAccessType::TWO_ACCESSES, 3);
-    if (rd != source.rm()) {
-      lwr(rd, MemOperand(source.rm(), source.offset() + kMipsLwrOffset));
-      lwl(rd, MemOperand(source.rm(), source.offset() + kMipsLwlOffset));
-    } else {
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      lwr(scratch, MemOperand(rs.rm(), rs.offset() + kMipsLwrOffset));
-      lwl(scratch, MemOperand(rs.rm(), rs.offset() + kMipsLwlOffset));
-      mov(rd, scratch);
-    }
-  }
-}
-
-void TurboAssembler::Ulwu(Register rd, const MemOperand& rs) {
-  if (kArchVariant == kMips64r6) {
-    Lwu(rd, rs);
-  } else {
-    DCHECK_EQ(kArchVariant, kMips64r2);
-    Ulw(rd, rs);
-    Dext(rd, rd, 0, 32);
-  }
-}
-
-void TurboAssembler::Usw(Register rd, const MemOperand& rs) {
-  DCHECK(rd != at);
-  DCHECK(rs.rm() != at);
-  DCHECK(rd != rs.rm());
-  if (kArchVariant == kMips64r6) {
-    Sw(rd, rs);
-  } else {
-    DCHECK_EQ(kArchVariant, kMips64r2);
-    DCHECK(kMipsSwrOffset <= 3 && kMipsSwlOffset <= 3);
-    MemOperand source = rs;
-    // Adjust offset for two accesses and check if offset + 3 fits into int16_t.
-    AdjustBaseAndOffset(source, OffsetAccessType::TWO_ACCESSES, 3);
-    swr(rd, MemOperand(source.rm(), source.offset() + kMipsSwrOffset));
-    swl(rd, MemOperand(source.rm(), source.offset() + kMipsSwlOffset));
-  }
-}
-
-void TurboAssembler::Ulh(Register rd, const MemOperand& rs) {
-  DCHECK(rd != at);
-  DCHECK(rs.rm() != at);
-  if (kArchVariant == kMips64r6) {
-    Lh(rd, rs);
-  } else {
-    DCHECK_EQ(kArchVariant, kMips64r2);
-    MemOperand source = rs;
-    // Adjust offset for two accesses and check if offset + 1 fits into int16_t.
-    AdjustBaseAndOffset(source, OffsetAccessType::TWO_ACCESSES, 1);
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    if (source.rm() == scratch) {
-#if defined(V8_TARGET_LITTLE_ENDIAN)
-      Lb(rd, MemOperand(source.rm(), source.offset() + 1));
-      Lbu(scratch, source);
-#elif defined(V8_TARGET_BIG_ENDIAN)
-      Lb(rd, source);
-      Lbu(scratch, MemOperand(source.rm(), source.offset() + 1));
-#endif
-    } else {
-#if defined(V8_TARGET_LITTLE_ENDIAN)
-      Lbu(scratch, source);
-      Lb(rd, MemOperand(source.rm(), source.offset() + 1));
-#elif defined(V8_TARGET_BIG_ENDIAN)
-      Lbu(scratch, MemOperand(source.rm(), source.offset() + 1));
-      Lb(rd, source);
-#endif
-    }
-    dsll(rd, rd, 8);
-    or_(rd, rd, scratch);
-  }
-}
-
-void TurboAssembler::Ulhu(Register rd, const MemOperand& rs) {
-  DCHECK(rd != at);
-  DCHECK(rs.rm() != at);
-  if (kArchVariant == kMips64r6) {
-    Lhu(rd, rs);
-  } else {
-    DCHECK_EQ(kArchVariant, kMips64r2);
-    MemOperand source = rs;
-    // Adjust offset for two accesses and check if offset + 1 fits into int16_t.
-    AdjustBaseAndOffset(source, OffsetAccessType::TWO_ACCESSES, 1);
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    if (source.rm() == scratch) {
-#if defined(V8_TARGET_LITTLE_ENDIAN)
-      Lbu(rd, MemOperand(source.rm(), source.offset() + 1));
-      Lbu(scratch, source);
-#elif defined(V8_TARGET_BIG_ENDIAN)
-      Lbu(rd, source);
-      Lbu(scratch, MemOperand(source.rm(), source.offset() + 1));
-#endif
-    } else {
-#if defined(V8_TARGET_LITTLE_ENDIAN)
-      Lbu(scratch, source);
-      Lbu(rd, MemOperand(source.rm(), source.offset() + 1));
-#elif defined(V8_TARGET_BIG_ENDIAN)
-      Lbu(scratch, MemOperand(source.rm(), source.offset() + 1));
-      Lbu(rd, source);
-#endif
-    }
-    dsll(rd, rd, 8);
-    or_(rd, rd, scratch);
-  }
-}
-
-void TurboAssembler::Ush(Register rd, const MemOperand& rs, Register scratch) {
-  DCHECK(rd != at);
-  DCHECK(rs.rm() != at);
-  DCHECK(rs.rm() != scratch);
-  DCHECK(scratch != at);
-  if (kArchVariant == kMips64r6) {
-    Sh(rd, rs);
-  } else {
-    DCHECK_EQ(kArchVariant, kMips64r2);
-    MemOperand source = rs;
-    // Adjust offset for two accesses and check if offset + 1 fits into int16_t.
-    AdjustBaseAndOffset(source, OffsetAccessType::TWO_ACCESSES, 1);
-
-    if (scratch != rd) {
-      mov(scratch, rd);
-    }
-
-#if defined(V8_TARGET_LITTLE_ENDIAN)
-    Sb(scratch, source);
-    srl(scratch, scratch, 8);
-    Sb(scratch, MemOperand(source.rm(), source.offset() + 1));
-#elif defined(V8_TARGET_BIG_ENDIAN)
-    Sb(scratch, MemOperand(source.rm(), source.offset() + 1));
-    srl(scratch, scratch, 8);
-    Sb(scratch, source);
-#endif
-  }
-}
-
-void TurboAssembler::Uld(Register rd, const MemOperand& rs) {
-  DCHECK(rd != at);
-  DCHECK(rs.rm() != at);
-  if (kArchVariant == kMips64r6) {
-    Ld(rd, rs);
-  } else {
-    DCHECK_EQ(kArchVariant, kMips64r2);
-    DCHECK(kMipsLdrOffset <= 7 && kMipsLdlOffset <= 7);
-    MemOperand source = rs;
-    // Adjust offset for two accesses and check if offset + 7 fits into int16_t.
-    AdjustBaseAndOffset(source, OffsetAccessType::TWO_ACCESSES, 7);
-    if (rd != source.rm()) {
-      ldr(rd, MemOperand(source.rm(), source.offset() + kMipsLdrOffset));
-      ldl(rd, MemOperand(source.rm(), source.offset() + kMipsLdlOffset));
-    } else {
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      ldr(scratch, MemOperand(rs.rm(), rs.offset() + kMipsLdrOffset));
-      ldl(scratch, MemOperand(rs.rm(), rs.offset() + kMipsLdlOffset));
-      mov(rd, scratch);
-    }
-  }
-}
-
-
-// Load consequent 32-bit word pair in 64-bit reg. and put first word in low
-// bits,
-// second word in high bits.
-void MacroAssembler::LoadWordPair(Register rd, const MemOperand& rs,
-                                  Register scratch) {
-  Lwu(rd, rs);
-  Lw(scratch, MemOperand(rs.rm(), rs.offset() + kPointerSize / 2));
-  dsll32(scratch, scratch, 0);
-  Daddu(rd, rd, scratch);
-}
-
-void TurboAssembler::Usd(Register rd, const MemOperand& rs) {
-  DCHECK(rd != at);
-  DCHECK(rs.rm() != at);
-  if (kArchVariant == kMips64r6) {
-    Sd(rd, rs);
-  } else {
-    DCHECK_EQ(kArchVariant, kMips64r2);
-    DCHECK(kMipsSdrOffset <= 7 && kMipsSdlOffset <= 7);
-    MemOperand source = rs;
-    // Adjust offset for two accesses and check if offset + 7 fits into int16_t.
-    AdjustBaseAndOffset(source, OffsetAccessType::TWO_ACCESSES, 7);
-    sdr(rd, MemOperand(source.rm(), source.offset() + kMipsSdrOffset));
-    sdl(rd, MemOperand(source.rm(), source.offset() + kMipsSdlOffset));
-  }
-}
-
-
-// Do 64-bit store as two consequent 32-bit stores to unaligned address.
-void MacroAssembler::StoreWordPair(Register rd, const MemOperand& rs,
-                                   Register scratch) {
-  Sw(rd, rs);
-  dsrl32(scratch, rd, 0);
-  Sw(scratch, MemOperand(rs.rm(), rs.offset() + kPointerSize / 2));
-}
-
-void TurboAssembler::Ulwc1(FPURegister fd, const MemOperand& rs,
-                           Register scratch) {
-  if (kArchVariant == kMips64r6) {
-    Lwc1(fd, rs);
-  } else {
-    DCHECK_EQ(kArchVariant, kMips64r2);
-    Ulw(scratch, rs);
-    mtc1(scratch, fd);
-  }
-}
-
-void TurboAssembler::Uswc1(FPURegister fd, const MemOperand& rs,
-                           Register scratch) {
-  if (kArchVariant == kMips64r6) {
-    Swc1(fd, rs);
-  } else {
-    DCHECK_EQ(kArchVariant, kMips64r2);
-    mfc1(scratch, fd);
-    Usw(scratch, rs);
-  }
-}
-
-void TurboAssembler::Uldc1(FPURegister fd, const MemOperand& rs,
-                           Register scratch) {
-  DCHECK(scratch != at);
-  if (kArchVariant == kMips64r6) {
-    Ldc1(fd, rs);
-  } else {
-    DCHECK_EQ(kArchVariant, kMips64r2);
-    Uld(scratch, rs);
-    dmtc1(scratch, fd);
-  }
-}
-
-void TurboAssembler::Usdc1(FPURegister fd, const MemOperand& rs,
-                           Register scratch) {
-  DCHECK(scratch != at);
-  if (kArchVariant == kMips64r6) {
-    Sdc1(fd, rs);
-  } else {
-    DCHECK_EQ(kArchVariant, kMips64r2);
-    dmfc1(scratch, fd);
-    Usd(scratch, rs);
-  }
-}
-
-void TurboAssembler::Lb(Register rd, const MemOperand& rs) {
-  MemOperand source = rs;
-  AdjustBaseAndOffset(source);
-  lb(rd, source);
-}
-
-void TurboAssembler::Lbu(Register rd, const MemOperand& rs) {
-  MemOperand source = rs;
-  AdjustBaseAndOffset(source);
-  lbu(rd, source);
-}
-
-void TurboAssembler::Sb(Register rd, const MemOperand& rs) {
-  MemOperand source = rs;
-  AdjustBaseAndOffset(source);
-  sb(rd, source);
-}
-
-void TurboAssembler::Lh(Register rd, const MemOperand& rs) {
-  MemOperand source = rs;
-  AdjustBaseAndOffset(source);
-  lh(rd, source);
-}
-
-void TurboAssembler::Lhu(Register rd, const MemOperand& rs) {
-  MemOperand source = rs;
-  AdjustBaseAndOffset(source);
-  lhu(rd, source);
-}
-
-void TurboAssembler::Sh(Register rd, const MemOperand& rs) {
-  MemOperand source = rs;
-  AdjustBaseAndOffset(source);
-  sh(rd, source);
-}
-
-void TurboAssembler::Lw(Register rd, const MemOperand& rs) {
-  MemOperand source = rs;
-  AdjustBaseAndOffset(source);
-  lw(rd, source);
-}
-
-void TurboAssembler::Lwu(Register rd, const MemOperand& rs) {
-  MemOperand source = rs;
-  AdjustBaseAndOffset(source);
-  lwu(rd, source);
-}
-
-void TurboAssembler::Sw(Register rd, const MemOperand& rs) {
-  MemOperand source = rs;
-  AdjustBaseAndOffset(source);
-  sw(rd, source);
-}
-
-void TurboAssembler::Ld(Register rd, const MemOperand& rs) {
-  MemOperand source = rs;
-  AdjustBaseAndOffset(source);
-  ld(rd, source);
-}
-
-void TurboAssembler::Sd(Register rd, const MemOperand& rs) {
-  MemOperand source = rs;
-  AdjustBaseAndOffset(source);
-  sd(rd, source);
-}
-
-void TurboAssembler::Lwc1(FPURegister fd, const MemOperand& src) {
-  MemOperand tmp = src;
-  AdjustBaseAndOffset(tmp);
-  lwc1(fd, tmp);
-}
-
-void TurboAssembler::Swc1(FPURegister fs, const MemOperand& src) {
-  MemOperand tmp = src;
-  AdjustBaseAndOffset(tmp);
-  swc1(fs, tmp);
-}
-
-void TurboAssembler::Ldc1(FPURegister fd, const MemOperand& src) {
-  MemOperand tmp = src;
-  AdjustBaseAndOffset(tmp);
-  ldc1(fd, tmp);
-}
-
-void TurboAssembler::Sdc1(FPURegister fs, const MemOperand& src) {
-  MemOperand tmp = src;
-  AdjustBaseAndOffset(tmp);
-  sdc1(fs, tmp);
-}
-
-void TurboAssembler::Ll(Register rd, const MemOperand& rs) {
-  bool is_one_instruction = (kArchVariant == kMips64r6) ? is_int9(rs.offset())
-                                                        : is_int16(rs.offset());
-  if (is_one_instruction) {
-    ll(rd, rs);
-  } else {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    li(scratch, rs.offset());
-    daddu(scratch, scratch, rs.rm());
-    ll(rd, MemOperand(scratch, 0));
-  }
-}
-
-void TurboAssembler::Lld(Register rd, const MemOperand& rs) {
-  bool is_one_instruction = (kArchVariant == kMips64r6) ? is_int9(rs.offset())
-                                                        : is_int16(rs.offset());
-  if (is_one_instruction) {
-    lld(rd, rs);
-  } else {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    li(scratch, rs.offset());
-    daddu(scratch, scratch, rs.rm());
-    lld(rd, MemOperand(scratch, 0));
-  }
-}
-
-void TurboAssembler::Sc(Register rd, const MemOperand& rs) {
-  bool is_one_instruction = (kArchVariant == kMips64r6) ? is_int9(rs.offset())
-                                                        : is_int16(rs.offset());
-  if (is_one_instruction) {
-    sc(rd, rs);
-  } else {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    li(scratch, rs.offset());
-    daddu(scratch, scratch, rs.rm());
-    sc(rd, MemOperand(scratch, 0));
-  }
-}
-
-void TurboAssembler::Scd(Register rd, const MemOperand& rs) {
-  bool is_one_instruction = (kArchVariant == kMips64r6) ? is_int9(rs.offset())
-                                                        : is_int16(rs.offset());
-  if (is_one_instruction) {
-    scd(rd, rs);
-  } else {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    li(scratch, rs.offset());
-    daddu(scratch, scratch, rs.rm());
-    scd(rd, MemOperand(scratch, 0));
-  }
-}
-
-void TurboAssembler::li(Register dst, Handle<HeapObject> value, LiFlags mode) {
-  li(dst, Operand(value), mode);
-}
-
-static inline int InstrCountForLiLower32Bit(int64_t value) {
-  if (!is_int16(static_cast<int32_t>(value)) && (value & kUpper16MaskOf64) &&
-      (value & kImm16Mask)) {
-    return 2;
-  } else {
-    return 1;
-  }
-}
-
-void TurboAssembler::LiLower32BitHelper(Register rd, Operand j) {
-  if (is_int16(static_cast<int32_t>(j.immediate()))) {
-    daddiu(rd, zero_reg, (j.immediate() & kImm16Mask));
-  } else if (!(j.immediate() & kUpper16MaskOf64)) {
-    ori(rd, zero_reg, j.immediate() & kImm16Mask);
-  } else {
-    lui(rd, j.immediate() >> kLuiShift & kImm16Mask);
-    if (j.immediate() & kImm16Mask) {
-      ori(rd, rd, j.immediate() & kImm16Mask);
-    }
-  }
-}
-
-static inline int InstrCountForLoadReplicatedConst32(int64_t value) {
-  uint32_t x = static_cast<uint32_t>(value);
-  uint32_t y = static_cast<uint32_t>(value >> 32);
-
-  if (x == y) {
-    return (is_uint16(x) || is_int16(x) || (x & kImm16Mask) == 0) ? 2 : 3;
-  }
-
-  return INT_MAX;
-}
-
-int TurboAssembler::InstrCountForLi64Bit(int64_t value) {
-  if (is_int32(value)) {
-    return InstrCountForLiLower32Bit(value);
-  } else {
-    int bit31 = value >> 31 & 0x1;
-    if ((value & kUpper16MaskOf64) == 0 && is_int16(value >> 32) &&
-        kArchVariant == kMips64r6) {
-      return 2;
-    } else if ((value & (kHigher16MaskOf64 | kUpper16MaskOf64)) == 0 &&
-               kArchVariant == kMips64r6) {
-      return 2;
-    } else if ((value & kImm16Mask) == 0 && is_int16((value >> 32) + bit31) &&
-               kArchVariant == kMips64r6) {
-      return 2;
-    } else if ((value & kImm16Mask) == 0 &&
-               ((value >> 31) & 0x1FFFF) == ((0x20000 - bit31) & 0x1FFFF) &&
-               kArchVariant == kMips64r6) {
-      return 2;
-    } else if (is_int16(static_cast<int32_t>(value)) &&
-               is_int16((value >> 32) + bit31) && kArchVariant == kMips64r6) {
-      return 2;
-    } else if (is_int16(static_cast<int32_t>(value)) &&
-               ((value >> 31) & 0x1FFFF) == ((0x20000 - bit31) & 0x1FFFF) &&
-               kArchVariant == kMips64r6) {
-      return 2;
-    } else if (base::bits::IsPowerOfTwo(value + 1) ||
-               value == std::numeric_limits<int64_t>::max()) {
-      return 2;
-    } else {
-      int shift_cnt = base::bits::CountTrailingZeros64(value);
-      int rep32_count = InstrCountForLoadReplicatedConst32(value);
-      int64_t tmp = value >> shift_cnt;
-      if (is_uint16(tmp)) {
-        return 2;
-      } else if (is_int16(tmp)) {
-        return 2;
-      } else if (rep32_count < 3) {
-        return 2;
-      } else if (is_int32(tmp)) {
-        return 3;
-      } else {
-        shift_cnt = 16 + base::bits::CountTrailingZeros64(value >> 16);
-        tmp = value >> shift_cnt;
-        if (is_uint16(tmp)) {
-          return 3;
-        } else if (is_int16(tmp)) {
-          return 3;
-        } else if (rep32_count < 4) {
-          return 3;
-        } else if (kArchVariant == kMips64r6) {
-          int64_t imm = value;
-          int count = InstrCountForLiLower32Bit(imm);
-          imm = (imm >> 32) + bit31;
-          if (imm & kImm16Mask) {
-            count++;
-          }
-          imm = (imm >> 16) + (imm >> 15 & 0x1);
-          if (imm & kImm16Mask) {
-            count++;
-          }
-          return count;
-        } else {
-          if (is_int48(value)) {
-            int64_t k = value >> 16;
-            int count = InstrCountForLiLower32Bit(k) + 1;
-            if (value & kImm16Mask) {
-              count++;
-            }
-            return count;
-          } else {
-            int64_t k = value >> 32;
-            int count = InstrCountForLiLower32Bit(k);
-            if ((value >> 16) & kImm16Mask) {
-              count += 3;
-              if (value & kImm16Mask) {
-                count++;
-              }
-            } else {
-              count++;
-              if (value & kImm16Mask) {
-                count++;
-              }
-            }
-            return count;
-          }
-        }
-      }
-    }
-  }
-  UNREACHABLE();
-  return INT_MAX;
-}
-
-// All changes to if...else conditions here must be added to
-// InstrCountForLi64Bit as well.
-void TurboAssembler::li_optimized(Register rd, Operand j, LiFlags mode) {
-  DCHECK(!j.is_reg());
-  DCHECK(!MustUseReg(j.rmode()));
-  DCHECK(mode == OPTIMIZE_SIZE);
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  // Normal load of an immediate value which does not need Relocation Info.
-  if (is_int32(j.immediate())) {
-    LiLower32BitHelper(rd, j);
-  } else {
-    int bit31 = j.immediate() >> 31 & 0x1;
-    if ((j.immediate() & kUpper16MaskOf64) == 0 &&
-        is_int16(j.immediate() >> 32) && kArchVariant == kMips64r6) {
-      // 64-bit value which consists of an unsigned 16-bit value in its
-      // least significant 32-bits, and a signed 16-bit value in its
-      // most significant 32-bits.
-      ori(rd, zero_reg, j.immediate() & kImm16Mask);
-      dahi(rd, j.immediate() >> 32 & kImm16Mask);
-    } else if ((j.immediate() & (kHigher16MaskOf64 | kUpper16MaskOf64)) == 0 &&
-               kArchVariant == kMips64r6) {
-      // 64-bit value which consists of an unsigned 16-bit value in its
-      // least significant 48-bits, and a signed 16-bit value in its
-      // most significant 16-bits.
-      ori(rd, zero_reg, j.immediate() & kImm16Mask);
-      dati(rd, j.immediate() >> 48 & kImm16Mask);
-    } else if ((j.immediate() & kImm16Mask) == 0 &&
-               is_int16((j.immediate() >> 32) + bit31) &&
-               kArchVariant == kMips64r6) {
-      // 16 LSBs (Least Significant Bits) all set to zero.
-      // 48 MSBs (Most Significant Bits) hold a signed 32-bit value.
-      lui(rd, j.immediate() >> kLuiShift & kImm16Mask);
-      dahi(rd, ((j.immediate() >> 32) + bit31) & kImm16Mask);
-    } else if ((j.immediate() & kImm16Mask) == 0 &&
-               ((j.immediate() >> 31) & 0x1FFFF) ==
-                   ((0x20000 - bit31) & 0x1FFFF) &&
-               kArchVariant == kMips64r6) {
-      // 16 LSBs all set to zero.
-      // 48 MSBs hold a signed value which can't be represented by signed
-      // 32-bit number, and the middle 16 bits are all zero, or all one.
-      lui(rd, j.immediate() >> kLuiShift & kImm16Mask);
-      dati(rd, ((j.immediate() >> 48) + bit31) & kImm16Mask);
-    } else if (is_int16(static_cast<int32_t>(j.immediate())) &&
-               is_int16((j.immediate() >> 32) + bit31) &&
-               kArchVariant == kMips64r6) {
-      // 32 LSBs contain a signed 16-bit number.
-      // 32 MSBs contain a signed 16-bit number.
-      daddiu(rd, zero_reg, j.immediate() & kImm16Mask);
-      dahi(rd, ((j.immediate() >> 32) + bit31) & kImm16Mask);
-    } else if (is_int16(static_cast<int32_t>(j.immediate())) &&
-               ((j.immediate() >> 31) & 0x1FFFF) ==
-                   ((0x20000 - bit31) & 0x1FFFF) &&
-               kArchVariant == kMips64r6) {
-      // 48 LSBs contain an unsigned 16-bit number.
-      // 16 MSBs contain a signed 16-bit number.
-      daddiu(rd, zero_reg, j.immediate() & kImm16Mask);
-      dati(rd, ((j.immediate() >> 48) + bit31) & kImm16Mask);
-    } else if (base::bits::IsPowerOfTwo(j.immediate() + 1) ||
-               j.immediate() == std::numeric_limits<int64_t>::max()) {
-      // 64-bit values which have their "n" LSBs set to one, and their
-      // "64-n" MSBs set to zero. "n" must meet the restrictions 0 < n < 64.
-      int shift_cnt = 64 - base::bits::CountTrailingZeros64(j.immediate() + 1);
-      daddiu(rd, zero_reg, -1);
-      if (shift_cnt < 32) {
-        dsrl(rd, rd, shift_cnt);
-      } else {
-        dsrl32(rd, rd, shift_cnt & 31);
-      }
-    } else {
-      int shift_cnt = base::bits::CountTrailingZeros64(j.immediate());
-      int rep32_count = InstrCountForLoadReplicatedConst32(j.immediate());
-      int64_t tmp = j.immediate() >> shift_cnt;
-      if (is_uint16(tmp)) {
-        // Value can be computed by loading a 16-bit unsigned value, and
-        // then shifting left.
-        ori(rd, zero_reg, tmp & kImm16Mask);
-        if (shift_cnt < 32) {
-          dsll(rd, rd, shift_cnt);
-        } else {
-          dsll32(rd, rd, shift_cnt & 31);
-        }
-      } else if (is_int16(tmp)) {
-        // Value can be computed by loading a 16-bit signed value, and
-        // then shifting left.
-        daddiu(rd, zero_reg, static_cast<int32_t>(tmp));
-        if (shift_cnt < 32) {
-          dsll(rd, rd, shift_cnt);
-        } else {
-          dsll32(rd, rd, shift_cnt & 31);
-        }
-      } else if (rep32_count < 3) {
-        // Value being loaded has 32 LSBs equal to the 32 MSBs, and the
-        // value loaded into the 32 LSBs can be loaded with a single
-        // MIPS instruction.
-        LiLower32BitHelper(rd, j);
-        Dins(rd, rd, 32, 32);
-      } else if (is_int32(tmp)) {
-        // Loads with 3 instructions.
-        // Value can be computed by loading a 32-bit signed value, and
-        // then shifting left.
-        lui(rd, tmp >> kLuiShift & kImm16Mask);
-        ori(rd, rd, tmp & kImm16Mask);
-        if (shift_cnt < 32) {
-          dsll(rd, rd, shift_cnt);
-        } else {
-          dsll32(rd, rd, shift_cnt & 31);
-        }
-      } else {
-        shift_cnt = 16 + base::bits::CountTrailingZeros64(j.immediate() >> 16);
-        tmp = j.immediate() >> shift_cnt;
-        if (is_uint16(tmp)) {
-          // Value can be computed by loading a 16-bit unsigned value,
-          // shifting left, and "or"ing in another 16-bit unsigned value.
-          ori(rd, zero_reg, tmp & kImm16Mask);
-          if (shift_cnt < 32) {
-            dsll(rd, rd, shift_cnt);
-          } else {
-            dsll32(rd, rd, shift_cnt & 31);
-          }
-          ori(rd, rd, j.immediate() & kImm16Mask);
-        } else if (is_int16(tmp)) {
-          // Value can be computed by loading a 16-bit signed value,
-          // shifting left, and "or"ing in a 16-bit unsigned value.
-          daddiu(rd, zero_reg, static_cast<int32_t>(tmp));
-          if (shift_cnt < 32) {
-            dsll(rd, rd, shift_cnt);
-          } else {
-            dsll32(rd, rd, shift_cnt & 31);
-          }
-          ori(rd, rd, j.immediate() & kImm16Mask);
-        } else if (rep32_count < 4) {
-          // Value being loaded has 32 LSBs equal to the 32 MSBs, and the
-          // value in the 32 LSBs requires 2 MIPS instructions to load.
-          LiLower32BitHelper(rd, j);
-          Dins(rd, rd, 32, 32);
-        } else if (kArchVariant == kMips64r6) {
-          // Loads with 3-4 instructions.
-          // Catch-all case to get any other 64-bit values which aren't
-          // handled by special cases above.
-          int64_t imm = j.immediate();
-          LiLower32BitHelper(rd, j);
-          imm = (imm >> 32) + bit31;
-          if (imm & kImm16Mask) {
-            dahi(rd, imm & kImm16Mask);
-          }
-          imm = (imm >> 16) + (imm >> 15 & 0x1);
-          if (imm & kImm16Mask) {
-            dati(rd, imm & kImm16Mask);
-          }
-        } else {
-          if (is_int48(j.immediate())) {
-            Operand k = Operand(j.immediate() >> 16);
-            LiLower32BitHelper(rd, k);
-            dsll(rd, rd, 16);
-            if (j.immediate() & kImm16Mask) {
-              ori(rd, rd, j.immediate() & kImm16Mask);
-            }
-          } else {
-            Operand k = Operand(j.immediate() >> 32);
-            LiLower32BitHelper(rd, k);
-            if ((j.immediate() >> 16) & kImm16Mask) {
-              dsll(rd, rd, 16);
-              ori(rd, rd, (j.immediate() >> 16) & kImm16Mask);
-              dsll(rd, rd, 16);
-              if (j.immediate() & kImm16Mask) {
-                ori(rd, rd, j.immediate() & kImm16Mask);
-              }
-            } else {
-              dsll32(rd, rd, 0);
-              if (j.immediate() & kImm16Mask) {
-                ori(rd, rd, j.immediate() & kImm16Mask);
-              }
-            }
-          }
-        }
-      }
-    }
-  }
-}
-
-void TurboAssembler::li(Register rd, Operand j, LiFlags mode) {
-  DCHECK(!j.is_reg());
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  if (!MustUseReg(j.rmode()) && mode == OPTIMIZE_SIZE) {
-    int li_count = InstrCountForLi64Bit(j.immediate());
-    int li_neg_count = InstrCountForLi64Bit(-j.immediate());
-    int li_not_count = InstrCountForLi64Bit(~j.immediate());
-    // Loading -MIN_INT64 could cause problems, but loading MIN_INT64 takes only
-    // two instructions so no need to check for this.
-    if (li_neg_count <= li_not_count && li_neg_count < li_count - 1) {
-      DCHECK(j.immediate() != std::numeric_limits<int64_t>::min());
-      li_optimized(rd, Operand(-j.immediate()), mode);
-      Dsubu(rd, zero_reg, rd);
-    } else if (li_neg_count > li_not_count && li_not_count < li_count - 1) {
-      DCHECK(j.immediate() != std::numeric_limits<int64_t>::min());
-      li_optimized(rd, Operand(~j.immediate()), mode);
-      nor(rd, rd, rd);
-    } else {
-      li_optimized(rd, j, mode);
-    }
-  } else if (MustUseReg(j.rmode())) {
-    int64_t immediate;
-    if (j.IsHeapObjectRequest()) {
-      RequestHeapObject(j.heap_object_request());
-      immediate = 0;
-    } else {
-      immediate = j.immediate();
-    }
-
-    RecordRelocInfo(j.rmode(), immediate);
-    lui(rd, (immediate >> 32) & kImm16Mask);
-    ori(rd, rd, (immediate >> 16) & kImm16Mask);
-    dsll(rd, rd, 16);
-    ori(rd, rd, immediate & kImm16Mask);
-  } else if (mode == ADDRESS_LOAD)  {
-    // We always need the same number of instructions as we may need to patch
-    // this code to load another value which may need all 4 instructions.
-    lui(rd, (j.immediate() >> 32) & kImm16Mask);
-    ori(rd, rd, (j.immediate() >> 16) & kImm16Mask);
-    dsll(rd, rd, 16);
-    ori(rd, rd, j.immediate() & kImm16Mask);
-  } else {  // mode == CONSTANT_SIZE - always emit the same instruction
-            // sequence.
-    if (kArchVariant == kMips64r6) {
-      int64_t imm = j.immediate();
-      lui(rd, imm >> kLuiShift & kImm16Mask);
-      ori(rd, rd, (imm & kImm16Mask));
-      imm = (imm >> 32) + ((imm >> 31) & 0x1);
-      dahi(rd, imm & kImm16Mask & kImm16Mask);
-      imm = (imm >> 16) + ((imm >> 15) & 0x1);
-      dati(rd, imm & kImm16Mask & kImm16Mask);
-    } else {
-      lui(rd, (j.immediate() >> 48) & kImm16Mask);
-      ori(rd, rd, (j.immediate() >> 32) & kImm16Mask);
-      dsll(rd, rd, 16);
-      ori(rd, rd, (j.immediate() >> 16) & kImm16Mask);
-      dsll(rd, rd, 16);
-      ori(rd, rd, j.immediate() & kImm16Mask);
-    }
-  }
-}
-
-void TurboAssembler::MultiPush(RegList regs) {
-  int16_t num_to_push = base::bits::CountPopulation(regs);
-  int16_t stack_offset = num_to_push * kPointerSize;
-
-  Dsubu(sp, sp, Operand(stack_offset));
-  for (int16_t i = kNumRegisters - 1; i >= 0; i--) {
-    if ((regs & (1 << i)) != 0) {
-      stack_offset -= kPointerSize;
-      Sd(ToRegister(i), MemOperand(sp, stack_offset));
-    }
-  }
-}
-
-
-void TurboAssembler::MultiPop(RegList regs) {
-  int16_t stack_offset = 0;
-
-  for (int16_t i = 0; i < kNumRegisters; i++) {
-    if ((regs & (1 << i)) != 0) {
-      Ld(ToRegister(i), MemOperand(sp, stack_offset));
-      stack_offset += kPointerSize;
-    }
-  }
-  daddiu(sp, sp, stack_offset);
-}
-
-
-void TurboAssembler::MultiPushFPU(RegList regs) {
-  int16_t num_to_push = base::bits::CountPopulation(regs);
-  int16_t stack_offset = num_to_push * kDoubleSize;
-
-  Dsubu(sp, sp, Operand(stack_offset));
-  for (int16_t i = kNumRegisters - 1; i >= 0; i--) {
-    if ((regs & (1 << i)) != 0) {
-      stack_offset -= kDoubleSize;
-      Sdc1(FPURegister::from_code(i), MemOperand(sp, stack_offset));
-    }
-  }
-}
-
-
-void TurboAssembler::MultiPopFPU(RegList regs) {
-  int16_t stack_offset = 0;
-
-  for (int16_t i = 0; i < kNumRegisters; i++) {
-    if ((regs & (1 << i)) != 0) {
-      Ldc1(FPURegister::from_code(i), MemOperand(sp, stack_offset));
-      stack_offset += kDoubleSize;
-    }
-  }
-  daddiu(sp, sp, stack_offset);
-}
-
-
-void TurboAssembler::Ext(Register rt, Register rs, uint16_t pos,
-                         uint16_t size) {
-  DCHECK_LT(pos, 32);
-  DCHECK_LT(pos + size, 33);
-  ext_(rt, rs, pos, size);
-}
-
-void TurboAssembler::Dext(Register rt, Register rs, uint16_t pos,
-                          uint16_t size) {
-  DCHECK(pos < 64 && 0 < size && size <= 64 && 0 < pos + size &&
-         pos + size <= 64);
-  if (size > 32) {
-    dextm_(rt, rs, pos, size);
-  } else if (pos >= 32) {
-    dextu_(rt, rs, pos, size);
-  } else {
-    dext_(rt, rs, pos, size);
-  }
-}
-
-void TurboAssembler::Ins(Register rt, Register rs, uint16_t pos,
-                         uint16_t size) {
-  DCHECK_LT(pos, 32);
-  DCHECK_LE(pos + size, 32);
-  DCHECK_NE(size, 0);
-  ins_(rt, rs, pos, size);
-}
-
-void TurboAssembler::Dins(Register rt, Register rs, uint16_t pos,
-                          uint16_t size) {
-  DCHECK(pos < 64 && 0 < size && size <= 64 && 0 < pos + size &&
-         pos + size <= 64);
-  if (pos + size <= 32) {
-    dins_(rt, rs, pos, size);
-  } else if (pos < 32) {
-    dinsm_(rt, rs, pos, size);
-  } else {
-    dinsu_(rt, rs, pos, size);
-  }
-}
-
-void TurboAssembler::ExtractBits(Register dest, Register source, Register pos,
-                                 int size, bool sign_extend) {
-  srav(dest, source, pos);
-  Dext(dest, dest, 0, size);
-  if (sign_extend) {
-    switch (size) {
-      case 8:
-        seb(dest, dest);
-        break;
-      case 16:
-        seh(dest, dest);
-        break;
-      case 32:
-        // sign-extend word
-        sll(dest, dest, 0);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  }
-}
-
-void TurboAssembler::InsertBits(Register dest, Register source, Register pos,
-                                int size) {
-  Ror(dest, dest, pos);
-  Dins(dest, source, 0, size);
-  {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    Dsubu(scratch, pos, Operand(64));
-    Neg(scratch, Operand(scratch));
-    Ror(dest, dest, scratch);
-  }
-}
-
-void TurboAssembler::Neg_s(FPURegister fd, FPURegister fs) {
-  if (kArchVariant == kMips64r6) {
-    // r6 neg_s changes the sign for NaN-like operands as well.
-    neg_s(fd, fs);
-  } else {
-    DCHECK_EQ(kArchVariant, kMips64r2);
-    Label is_nan, done;
-    Register scratch1 = t8;
-    Register scratch2 = t9;
-    BranchF32(nullptr, &is_nan, eq, fs, fs);
-    Branch(USE_DELAY_SLOT, &done);
-    // For NaN input, neg_s will return the same NaN value,
-    // while the sign has to be changed separately.
-    neg_s(fd, fs);  // In delay slot.
-    bind(&is_nan);
-    mfc1(scratch1, fs);
-    li(scratch2, kBinary32SignMask);
-    Xor(scratch1, scratch1, scratch2);
-    mtc1(scratch1, fd);
-    bind(&done);
-  }
-}
-
-void TurboAssembler::Neg_d(FPURegister fd, FPURegister fs) {
-  if (kArchVariant == kMips64r6) {
-    // r6 neg_d changes the sign for NaN-like operands as well.
-    neg_d(fd, fs);
-  } else {
-    DCHECK_EQ(kArchVariant, kMips64r2);
-    Label is_nan, done;
-    Register scratch1 = t8;
-    Register scratch2 = t9;
-    BranchF64(nullptr, &is_nan, eq, fs, fs);
-    Branch(USE_DELAY_SLOT, &done);
-    // For NaN input, neg_d will return the same NaN value,
-    // while the sign has to be changed separately.
-    neg_d(fd, fs);  // In delay slot.
-    bind(&is_nan);
-    dmfc1(scratch1, fs);
-    li(scratch2, Double::kSignMask);
-    Xor(scratch1, scratch1, scratch2);
-    dmtc1(scratch1, fd);
-    bind(&done);
-  }
-}
-
-void TurboAssembler::Cvt_d_uw(FPURegister fd, FPURegister fs) {
-  // Move the data from fs to t8.
-  mfc1(t8, fs);
-  Cvt_d_uw(fd, t8);
-}
-
-void TurboAssembler::Cvt_d_uw(FPURegister fd, Register rs) {
-  // Convert rs to a FP value in fd.
-  DCHECK(rs != t9);
-  DCHECK(rs != at);
-
-  // Zero extend int32 in rs.
-  Dext(t9, rs, 0, 32);
-  dmtc1(t9, fd);
-  cvt_d_l(fd, fd);
-}
-
-void TurboAssembler::Cvt_d_ul(FPURegister fd, FPURegister fs) {
-  // Move the data from fs to t8.
-  dmfc1(t8, fs);
-  Cvt_d_ul(fd, t8);
-}
-
-void TurboAssembler::Cvt_d_ul(FPURegister fd, Register rs) {
-  // Convert rs to a FP value in fd.
-
-  DCHECK(rs != t9);
-  DCHECK(rs != at);
-
-  Label msb_clear, conversion_done;
-
-  Branch(&msb_clear, ge, rs, Operand(zero_reg));
-
-  // Rs >= 2^63
-  andi(t9, rs, 1);
-  dsrl(rs, rs, 1);
-  or_(t9, t9, rs);
-  dmtc1(t9, fd);
-  cvt_d_l(fd, fd);
-  Branch(USE_DELAY_SLOT, &conversion_done);
-  add_d(fd, fd, fd);  // In delay slot.
-
-  bind(&msb_clear);
-  // Rs < 2^63, we can do simple conversion.
-  dmtc1(rs, fd);
-  cvt_d_l(fd, fd);
-
-  bind(&conversion_done);
-}
-
-void TurboAssembler::Cvt_s_uw(FPURegister fd, FPURegister fs) {
-  // Move the data from fs to t8.
-  mfc1(t8, fs);
-  Cvt_s_uw(fd, t8);
-}
-
-void TurboAssembler::Cvt_s_uw(FPURegister fd, Register rs) {
-  // Convert rs to a FP value in fd.
-  DCHECK(rs != t9);
-  DCHECK(rs != at);
-
-  // Zero extend int32 in rs.
-  Dext(t9, rs, 0, 32);
-  dmtc1(t9, fd);
-  cvt_s_l(fd, fd);
-}
-
-void TurboAssembler::Cvt_s_ul(FPURegister fd, FPURegister fs) {
-  // Move the data from fs to t8.
-  dmfc1(t8, fs);
-  Cvt_s_ul(fd, t8);
-}
-
-void TurboAssembler::Cvt_s_ul(FPURegister fd, Register rs) {
-  // Convert rs to a FP value in fd.
-
-  DCHECK(rs != t9);
-  DCHECK(rs != at);
-
-  Label positive, conversion_done;
-
-  Branch(&positive, ge, rs, Operand(zero_reg));
-
-  // Rs >= 2^31.
-  andi(t9, rs, 1);
-  dsrl(rs, rs, 1);
-  or_(t9, t9, rs);
-  dmtc1(t9, fd);
-  cvt_s_l(fd, fd);
-  Branch(USE_DELAY_SLOT, &conversion_done);
-  add_s(fd, fd, fd);  // In delay slot.
-
-  bind(&positive);
-  // Rs < 2^31, we can do simple conversion.
-  dmtc1(rs, fd);
-  cvt_s_l(fd, fd);
-
-  bind(&conversion_done);
-}
-
-
-void MacroAssembler::Round_l_d(FPURegister fd, FPURegister fs) {
-  round_l_d(fd, fs);
-}
-
-
-void MacroAssembler::Floor_l_d(FPURegister fd, FPURegister fs) {
-  floor_l_d(fd, fs);
-}
-
-
-void MacroAssembler::Ceil_l_d(FPURegister fd, FPURegister fs) {
-  ceil_l_d(fd, fs);
-}
-
-
-void MacroAssembler::Trunc_l_d(FPURegister fd, FPURegister fs) {
-  trunc_l_d(fd, fs);
-}
-
-
-void MacroAssembler::Trunc_l_ud(FPURegister fd,
-                                FPURegister fs,
-                                FPURegister scratch) {
-  // Load to GPR.
-  dmfc1(t8, fs);
-  // Reset sign bit.
-  {
-    UseScratchRegisterScope temps(this);
-    Register scratch1 = temps.Acquire();
-    li(scratch1, 0x7FFFFFFFFFFFFFFF);
-    and_(t8, t8, scratch1);
-  }
-  dmtc1(t8, fs);
-  trunc_l_d(fd, fs);
-}
-
-void TurboAssembler::Trunc_uw_d(FPURegister fd, FPURegister fs,
-                                FPURegister scratch) {
-  Trunc_uw_d(fs, t8, scratch);
-  mtc1(t8, fd);
-}
-
-void TurboAssembler::Trunc_uw_s(FPURegister fd, FPURegister fs,
-                                FPURegister scratch) {
-  Trunc_uw_s(fs, t8, scratch);
-  mtc1(t8, fd);
-}
-
-void TurboAssembler::Trunc_ul_d(FPURegister fd, FPURegister fs,
-                                FPURegister scratch, Register result) {
-  Trunc_ul_d(fs, t8, scratch, result);
-  dmtc1(t8, fd);
-}
-
-void TurboAssembler::Trunc_ul_s(FPURegister fd, FPURegister fs,
-                                FPURegister scratch, Register result) {
-  Trunc_ul_s(fs, t8, scratch, result);
-  dmtc1(t8, fd);
-}
-
-
-void MacroAssembler::Trunc_w_d(FPURegister fd, FPURegister fs) {
-  trunc_w_d(fd, fs);
-}
-
-
-void MacroAssembler::Round_w_d(FPURegister fd, FPURegister fs) {
-  round_w_d(fd, fs);
-}
-
-
-void MacroAssembler::Floor_w_d(FPURegister fd, FPURegister fs) {
-  floor_w_d(fd, fs);
-}
-
-
-void MacroAssembler::Ceil_w_d(FPURegister fd, FPURegister fs) {
-  ceil_w_d(fd, fs);
-}
-
-void TurboAssembler::Trunc_uw_d(FPURegister fd, Register rs,
-                                FPURegister scratch) {
-  DCHECK(fd != scratch);
-  DCHECK(rs != at);
-
-  {
-    // Load 2^31 into scratch as its float representation.
-    UseScratchRegisterScope temps(this);
-    Register scratch1 = temps.Acquire();
-    li(scratch1, 0x41E00000);
-    mtc1(zero_reg, scratch);
-    mthc1(scratch1, scratch);
-  }
-  // Test if scratch > fd.
-  // If fd < 2^31 we can convert it normally.
-  Label simple_convert;
-  BranchF(&simple_convert, nullptr, lt, fd, scratch);
-
-  // First we subtract 2^31 from fd, then trunc it to rs
-  // and add 2^31 to rs.
-  sub_d(scratch, fd, scratch);
-  trunc_w_d(scratch, scratch);
-  mfc1(rs, scratch);
-  Or(rs, rs, 1 << 31);
-
-  Label done;
-  Branch(&done);
-  // Simple conversion.
-  bind(&simple_convert);
-  trunc_w_d(scratch, fd);
-  mfc1(rs, scratch);
-
-  bind(&done);
-}
-
-void TurboAssembler::Trunc_uw_s(FPURegister fd, Register rs,
-                                FPURegister scratch) {
-  DCHECK(fd != scratch);
-  DCHECK(rs != at);
-
-  {
-    // Load 2^31 into scratch as its float representation.
-    UseScratchRegisterScope temps(this);
-    Register scratch1 = temps.Acquire();
-    li(scratch1, 0x4F000000);
-    mtc1(scratch1, scratch);
-  }
-  // Test if scratch > fd.
-  // If fd < 2^31 we can convert it normally.
-  Label simple_convert;
-  BranchF32(&simple_convert, nullptr, lt, fd, scratch);
-
-  // First we subtract 2^31 from fd, then trunc it to rs
-  // and add 2^31 to rs.
-  sub_s(scratch, fd, scratch);
-  trunc_w_s(scratch, scratch);
-  mfc1(rs, scratch);
-  Or(rs, rs, 1 << 31);
-
-  Label done;
-  Branch(&done);
-  // Simple conversion.
-  bind(&simple_convert);
-  trunc_w_s(scratch, fd);
-  mfc1(rs, scratch);
-
-  bind(&done);
-}
-
-void TurboAssembler::Trunc_ul_d(FPURegister fd, Register rs,
-                                FPURegister scratch, Register result) {
-  DCHECK(fd != scratch);
-  DCHECK(!AreAliased(rs, result, at));
-
-  Label simple_convert, done, fail;
-  if (result.is_valid()) {
-    mov(result, zero_reg);
-    Move(scratch, -1.0);
-    // If fd =< -1 or unordered, then the conversion fails.
-    BranchF(&fail, &fail, le, fd, scratch);
-  }
-
-  // Load 2^63 into scratch as its double representation.
-  li(at, 0x43E0000000000000);
-  dmtc1(at, scratch);
-
-  // Test if scratch > fd.
-  // If fd < 2^63 we can convert it normally.
-  BranchF(&simple_convert, nullptr, lt, fd, scratch);
-
-  // First we subtract 2^63 from fd, then trunc it to rs
-  // and add 2^63 to rs.
-  sub_d(scratch, fd, scratch);
-  trunc_l_d(scratch, scratch);
-  dmfc1(rs, scratch);
-  Or(rs, rs, Operand(1UL << 63));
-  Branch(&done);
-
-  // Simple conversion.
-  bind(&simple_convert);
-  trunc_l_d(scratch, fd);
-  dmfc1(rs, scratch);
-
-  bind(&done);
-  if (result.is_valid()) {
-    // Conversion is failed if the result is negative.
-    {
-      UseScratchRegisterScope temps(this);
-      Register scratch1 = temps.Acquire();
-      addiu(scratch1, zero_reg, -1);
-      dsrl(scratch1, scratch1, 1);  // Load 2^62.
-      dmfc1(result, scratch);
-      xor_(result, result, scratch1);
-    }
-    Slt(result, zero_reg, result);
-  }
-
-  bind(&fail);
-}
-
-void TurboAssembler::Trunc_ul_s(FPURegister fd, Register rs,
-                                FPURegister scratch, Register result) {
-  DCHECK(fd != scratch);
-  DCHECK(!AreAliased(rs, result, at));
-
-  Label simple_convert, done, fail;
-  if (result.is_valid()) {
-    mov(result, zero_reg);
-    Move(scratch, -1.0f);
-    // If fd =< -1 or unordered, then the conversion fails.
-    BranchF32(&fail, &fail, le, fd, scratch);
-  }
-
-  {
-    // Load 2^63 into scratch as its float representation.
-    UseScratchRegisterScope temps(this);
-    Register scratch1 = temps.Acquire();
-    li(scratch1, 0x5F000000);
-    mtc1(scratch1, scratch);
-  }
-
-  // Test if scratch > fd.
-  // If fd < 2^63 we can convert it normally.
-  BranchF32(&simple_convert, nullptr, lt, fd, scratch);
-
-  // First we subtract 2^63 from fd, then trunc it to rs
-  // and add 2^63 to rs.
-  sub_s(scratch, fd, scratch);
-  trunc_l_s(scratch, scratch);
-  dmfc1(rs, scratch);
-  Or(rs, rs, Operand(1UL << 63));
-  Branch(&done);
-
-  // Simple conversion.
-  bind(&simple_convert);
-  trunc_l_s(scratch, fd);
-  dmfc1(rs, scratch);
-
-  bind(&done);
-  if (result.is_valid()) {
-    // Conversion is failed if the result is negative or unordered.
-    {
-      UseScratchRegisterScope temps(this);
-      Register scratch1 = temps.Acquire();
-      addiu(scratch1, zero_reg, -1);
-      dsrl(scratch1, scratch1, 1);  // Load 2^62.
-      dmfc1(result, scratch);
-      xor_(result, result, scratch1);
-    }
-    Slt(result, zero_reg, result);
-  }
-
-  bind(&fail);
-}
-
-void MacroAssembler::Madd_s(FPURegister fd, FPURegister fr, FPURegister fs,
-                            FPURegister ft, FPURegister scratch) {
-  DCHECK(fr != scratch && fs != scratch && ft != scratch);
-  mul_s(scratch, fs, ft);
-  add_s(fd, fr, scratch);
-}
-
-void MacroAssembler::Madd_d(FPURegister fd, FPURegister fr, FPURegister fs,
-    FPURegister ft, FPURegister scratch) {
-  DCHECK(fr != scratch && fs != scratch && ft != scratch);
-  mul_d(scratch, fs, ft);
-  add_d(fd, fr, scratch);
-}
-
-void MacroAssembler::Msub_s(FPURegister fd, FPURegister fr, FPURegister fs,
-                            FPURegister ft, FPURegister scratch) {
-  DCHECK(fr != scratch && fs != scratch && ft != scratch);
-  mul_s(scratch, fs, ft);
-  sub_s(fd, scratch, fr);
-}
-
-void MacroAssembler::Msub_d(FPURegister fd, FPURegister fr, FPURegister fs,
-                            FPURegister ft, FPURegister scratch) {
-  DCHECK(fr != scratch && fs != scratch && ft != scratch);
-  mul_d(scratch, fs, ft);
-  sub_d(fd, scratch, fr);
-}
-
-void TurboAssembler::BranchFCommon(SecondaryField sizeField, Label* target,
-                                   Label* nan, Condition cond, FPURegister cmp1,
-                                   FPURegister cmp2, BranchDelaySlot bd) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  if (cond == al) {
-    Branch(bd, target);
-    return;
-  }
-
-  if (kArchVariant == kMips64r6) {
-    sizeField = sizeField == D ? L : W;
-  }
-
-  DCHECK(nan || target);
-  // Check for unordered (NaN) cases.
-  if (nan) {
-    bool long_branch =
-        nan->is_bound() ? !is_near(nan) : is_trampoline_emitted();
-    if (kArchVariant != kMips64r6) {
-      if (long_branch) {
-        Label skip;
-        c(UN, sizeField, cmp1, cmp2);
-        bc1f(&skip);
-        nop();
-        BranchLong(nan, bd);
-        bind(&skip);
-      } else {
-        c(UN, sizeField, cmp1, cmp2);
-        bc1t(nan);
-        if (bd == PROTECT) {
-          nop();
-        }
-      }
-    } else {
-      // Use kDoubleCompareReg for comparison result. It has to be unavailable
-      // to lithium
-      // register allocator.
-      DCHECK(cmp1 != kDoubleCompareReg && cmp2 != kDoubleCompareReg);
-      if (long_branch) {
-        Label skip;
-        cmp(UN, sizeField, kDoubleCompareReg, cmp1, cmp2);
-        bc1eqz(&skip, kDoubleCompareReg);
-        nop();
-        BranchLong(nan, bd);
-        bind(&skip);
-      } else {
-        cmp(UN, sizeField, kDoubleCompareReg, cmp1, cmp2);
-        bc1nez(nan, kDoubleCompareReg);
-        if (bd == PROTECT) {
-          nop();
-        }
-      }
-    }
-  }
-
-  if (target) {
-    bool long_branch =
-        target->is_bound() ? !is_near(target) : is_trampoline_emitted();
-    if (long_branch) {
-      Label skip;
-      Condition neg_cond = NegateFpuCondition(cond);
-      BranchShortF(sizeField, &skip, neg_cond, cmp1, cmp2, bd);
-      BranchLong(target, bd);
-      bind(&skip);
-    } else {
-      BranchShortF(sizeField, target, cond, cmp1, cmp2, bd);
-    }
-  }
-}
-
-void TurboAssembler::BranchShortF(SecondaryField sizeField, Label* target,
-                                  Condition cc, FPURegister cmp1,
-                                  FPURegister cmp2, BranchDelaySlot bd) {
-  if (kArchVariant != kMips64r6) {
-    BlockTrampolinePoolScope block_trampoline_pool(this);
-    if (target) {
-      // Here NaN cases were either handled by this function or are assumed to
-      // have been handled by the caller.
-      switch (cc) {
-        case lt:
-          c(OLT, sizeField, cmp1, cmp2);
-          bc1t(target);
-          break;
-        case ult:
-          c(ULT, sizeField, cmp1, cmp2);
-          bc1t(target);
-          break;
-        case gt:
-          c(ULE, sizeField, cmp1, cmp2);
-          bc1f(target);
-          break;
-        case ugt:
-          c(OLE, sizeField, cmp1, cmp2);
-          bc1f(target);
-          break;
-        case ge:
-          c(ULT, sizeField, cmp1, cmp2);
-          bc1f(target);
-          break;
-        case uge:
-          c(OLT, sizeField, cmp1, cmp2);
-          bc1f(target);
-          break;
-        case le:
-          c(OLE, sizeField, cmp1, cmp2);
-          bc1t(target);
-          break;
-        case ule:
-          c(ULE, sizeField, cmp1, cmp2);
-          bc1t(target);
-          break;
-        case eq:
-          c(EQ, sizeField, cmp1, cmp2);
-          bc1t(target);
-          break;
-        case ueq:
-          c(UEQ, sizeField, cmp1, cmp2);
-          bc1t(target);
-          break;
-        case ne:  // Unordered or not equal.
-          c(EQ, sizeField, cmp1, cmp2);
-          bc1f(target);
-          break;
-        case ogl:
-          c(UEQ, sizeField, cmp1, cmp2);
-          bc1f(target);
-          break;
-        default:
-          CHECK(0);
-      }
-    }
-  } else {
-    BlockTrampolinePoolScope block_trampoline_pool(this);
-    if (target) {
-      // Here NaN cases were either handled by this function or are assumed to
-      // have been handled by the caller.
-      // Unsigned conditions are treated as their signed counterpart.
-      // Use kDoubleCompareReg for comparison result, it is valid in fp64 (FR =
-      // 1) mode.
-      DCHECK(cmp1 != kDoubleCompareReg && cmp2 != kDoubleCompareReg);
-      switch (cc) {
-        case lt:
-          cmp(OLT, sizeField, kDoubleCompareReg, cmp1, cmp2);
-          bc1nez(target, kDoubleCompareReg);
-          break;
-        case ult:
-          cmp(ULT, sizeField, kDoubleCompareReg, cmp1, cmp2);
-          bc1nez(target, kDoubleCompareReg);
-          break;
-        case gt:
-          cmp(ULE, sizeField, kDoubleCompareReg, cmp1, cmp2);
-          bc1eqz(target, kDoubleCompareReg);
-          break;
-        case ugt:
-          cmp(OLE, sizeField, kDoubleCompareReg, cmp1, cmp2);
-          bc1eqz(target, kDoubleCompareReg);
-          break;
-        case ge:
-          cmp(ULT, sizeField, kDoubleCompareReg, cmp1, cmp2);
-          bc1eqz(target, kDoubleCompareReg);
-          break;
-        case uge:
-          cmp(OLT, sizeField, kDoubleCompareReg, cmp1, cmp2);
-          bc1eqz(target, kDoubleCompareReg);
-          break;
-        case le:
-          cmp(OLE, sizeField, kDoubleCompareReg, cmp1, cmp2);
-          bc1nez(target, kDoubleCompareReg);
-          break;
-        case ule:
-          cmp(ULE, sizeField, kDoubleCompareReg, cmp1, cmp2);
-          bc1nez(target, kDoubleCompareReg);
-          break;
-        case eq:
-          cmp(EQ, sizeField, kDoubleCompareReg, cmp1, cmp2);
-          bc1nez(target, kDoubleCompareReg);
-          break;
-        case ueq:
-          cmp(UEQ, sizeField, kDoubleCompareReg, cmp1, cmp2);
-          bc1nez(target, kDoubleCompareReg);
-          break;
-        case ne:
-          cmp(EQ, sizeField, kDoubleCompareReg, cmp1, cmp2);
-          bc1eqz(target, kDoubleCompareReg);
-          break;
-        case ogl:
-          cmp(UEQ, sizeField, kDoubleCompareReg, cmp1, cmp2);
-          bc1eqz(target, kDoubleCompareReg);
-          break;
-        default:
-          CHECK(0);
-      }
-    }
-  }
-
-  if (bd == PROTECT) {
-    nop();
-  }
-}
-
-void TurboAssembler::BranchMSA(Label* target, MSABranchDF df,
-                               MSABranchCondition cond, MSARegister wt,
-                               BranchDelaySlot bd) {
-  {
-    BlockTrampolinePoolScope block_trampoline_pool(this);
-
-    if (target) {
-      bool long_branch =
-          target->is_bound() ? !is_near(target) : is_trampoline_emitted();
-      if (long_branch) {
-        Label skip;
-        MSABranchCondition neg_cond = NegateMSABranchCondition(cond);
-        BranchShortMSA(df, &skip, neg_cond, wt, bd);
-        BranchLong(target, bd);
-        bind(&skip);
-      } else {
-        BranchShortMSA(df, target, cond, wt, bd);
-      }
-    }
-  }
-}
-
-void TurboAssembler::BranchShortMSA(MSABranchDF df, Label* target,
-                                    MSABranchCondition cond, MSARegister wt,
-                                    BranchDelaySlot bd) {
-  if (kArchVariant == kMips64r6) {
-    BlockTrampolinePoolScope block_trampoline_pool(this);
-    if (target) {
-      switch (cond) {
-        case all_not_zero:
-          switch (df) {
-            case MSA_BRANCH_D:
-              bnz_d(wt, target);
-              break;
-            case MSA_BRANCH_W:
-              bnz_w(wt, target);
-              break;
-            case MSA_BRANCH_H:
-              bnz_h(wt, target);
-              break;
-            case MSA_BRANCH_B:
-            default:
-              bnz_b(wt, target);
-          }
-          break;
-        case one_elem_not_zero:
-          bnz_v(wt, target);
-          break;
-        case one_elem_zero:
-          switch (df) {
-            case MSA_BRANCH_D:
-              bz_d(wt, target);
-              break;
-            case MSA_BRANCH_W:
-              bz_w(wt, target);
-              break;
-            case MSA_BRANCH_H:
-              bz_h(wt, target);
-              break;
-            case MSA_BRANCH_B:
-            default:
-              bz_b(wt, target);
-          }
-          break;
-        case all_zero:
-          bz_v(wt, target);
-          break;
-        default:
-          UNREACHABLE();
-      }
-    }
-  }
-  if (bd == PROTECT) {
-    nop();
-  }
-}
-
-void TurboAssembler::FmoveLow(FPURegister dst, Register src_low) {
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  DCHECK(src_low != scratch);
-  mfhc1(scratch, dst);
-  mtc1(src_low, dst);
-  mthc1(scratch, dst);
-}
-
-void TurboAssembler::Move(FPURegister dst, float imm) {
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  li(scratch, Operand(bit_cast<int32_t>(imm)));
-  mtc1(scratch, dst);
-}
-
-void TurboAssembler::Move(FPURegister dst, double imm) {
-  int64_t imm_bits = bit_cast<int64_t>(imm);
-  // Handle special values first.
-  if (imm_bits == bit_cast<int64_t>(0.0) && has_double_zero_reg_set_) {
-    mov_d(dst, kDoubleRegZero);
-  } else if (imm_bits == bit_cast<int64_t>(-0.0) && has_double_zero_reg_set_) {
-    Neg_d(dst, kDoubleRegZero);
-  } else {
-    uint32_t lo, hi;
-    DoubleAsTwoUInt32(imm, &lo, &hi);
-    // Move the low part of the double into the lower bits of the corresponding
-    // FPU register.
-    if (lo != 0) {
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      li(scratch, lo);
-      mtc1(scratch, dst);
-    } else {
-      mtc1(zero_reg, dst);
-    }
-    // Move the high part of the double into the high bits of the corresponding
-    // FPU register.
-    if (hi != 0) {
-      UseScratchRegisterScope temps(this);
-      Register scratch = temps.Acquire();
-      li(scratch, hi);
-      mthc1(scratch, dst);
-    } else {
-      mthc1(zero_reg, dst);
-    }
-    if (dst == kDoubleRegZero) has_double_zero_reg_set_ = true;
-  }
-}
-
-void TurboAssembler::Movz(Register rd, Register rs, Register rt) {
-  if (kArchVariant == kMips64r6) {
-    Label done;
-    Branch(&done, ne, rt, Operand(zero_reg));
-    mov(rd, rs);
-    bind(&done);
-  } else {
-    movz(rd, rs, rt);
-  }
-}
-
-void TurboAssembler::Movn(Register rd, Register rs, Register rt) {
-  if (kArchVariant == kMips64r6) {
-    Label done;
-    Branch(&done, eq, rt, Operand(zero_reg));
-    mov(rd, rs);
-    bind(&done);
-  } else {
-    movn(rd, rs, rt);
-  }
-}
-
-void TurboAssembler::Movt(Register rd, Register rs, uint16_t cc) {
-  movt(rd, rs, cc);
-}
-
-void TurboAssembler::Movf(Register rd, Register rs, uint16_t cc) {
-  movf(rd, rs, cc);
-}
-
-void TurboAssembler::Clz(Register rd, Register rs) { clz(rd, rs); }
-
-void MacroAssembler::EmitFPUTruncate(FPURoundingMode rounding_mode,
-                                     Register result,
-                                     DoubleRegister double_input,
-                                     Register scratch,
-                                     DoubleRegister double_scratch,
-                                     Register except_flag,
-                                     CheckForInexactConversion check_inexact) {
-  DCHECK(result != scratch);
-  DCHECK(double_input != double_scratch);
-  DCHECK(except_flag != scratch);
-
-  Label done;
-
-  // Clear the except flag (0 = no exception)
-  mov(except_flag, zero_reg);
-
-  // Test for values that can be exactly represented as a signed 32-bit integer.
-  cvt_w_d(double_scratch, double_input);
-  mfc1(result, double_scratch);
-  cvt_d_w(double_scratch, double_scratch);
-  BranchF(&done, nullptr, eq, double_input, double_scratch);
-
-  int32_t except_mask = kFCSRFlagMask;  // Assume interested in all exceptions.
-
-  if (check_inexact == kDontCheckForInexactConversion) {
-    // Ignore inexact exceptions.
-    except_mask &= ~kFCSRInexactFlagMask;
-  }
-
-  // Save FCSR.
-  cfc1(scratch, FCSR);
-  // Disable FPU exceptions.
-  ctc1(zero_reg, FCSR);
-
-  // Do operation based on rounding mode.
-  switch (rounding_mode) {
-    case kRoundToNearest:
-      Round_w_d(double_scratch, double_input);
-      break;
-    case kRoundToZero:
-      Trunc_w_d(double_scratch, double_input);
-      break;
-    case kRoundToPlusInf:
-      Ceil_w_d(double_scratch, double_input);
-      break;
-    case kRoundToMinusInf:
-      Floor_w_d(double_scratch, double_input);
-      break;
-  }  // End of switch-statement.
-
-  // Retrieve FCSR.
-  cfc1(except_flag, FCSR);
-  // Restore FCSR.
-  ctc1(scratch, FCSR);
-  // Move the converted value into the result register.
-  mfc1(result, double_scratch);
-
-  // Check for fpu exceptions.
-  And(except_flag, except_flag, Operand(except_mask));
-
-  bind(&done);
-}
-
-void TurboAssembler::TryInlineTruncateDoubleToI(Register result,
-                                                DoubleRegister double_input,
-                                                Label* done) {
-  DoubleRegister single_scratch = kLithiumScratchDouble.low();
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  Register scratch2 = t9;
-
-  // Clear cumulative exception flags and save the FCSR.
-  cfc1(scratch2, FCSR);
-  ctc1(zero_reg, FCSR);
-  // Try a conversion to a signed integer.
-  trunc_w_d(single_scratch, double_input);
-  mfc1(result, single_scratch);
-  // Retrieve and restore the FCSR.
-  cfc1(scratch, FCSR);
-  ctc1(scratch2, FCSR);
-  // Check for overflow and NaNs.
-  And(scratch,
-      scratch,
-      kFCSROverflowFlagMask | kFCSRUnderflowFlagMask | kFCSRInvalidOpFlagMask);
-  // If we had no exceptions we are done.
-  Branch(done, eq, scratch, Operand(zero_reg));
-}
-
-void TurboAssembler::TruncateDoubleToIDelayed(Zone* zone, Register result,
-                                              DoubleRegister double_input) {
-  Label done;
-
-  TryInlineTruncateDoubleToI(result, double_input, &done);
-
-  // If we fell through then inline version didn't succeed - call stub instead.
-  push(ra);
-  Dsubu(sp, sp, Operand(kDoubleSize));  // Put input on stack.
-  Sdc1(double_input, MemOperand(sp, 0));
-
-  CallStubDelayed(new (zone) DoubleToIStub(nullptr, result));
-
-  Daddu(sp, sp, Operand(kDoubleSize));
-  pop(ra);
-
-  bind(&done);
-}
-
-// Emulated condtional branches do not emit a nop in the branch delay slot.
-//
-// BRANCH_ARGS_CHECK checks that conditional jump arguments are correct.
-#define BRANCH_ARGS_CHECK(cond, rs, rt)                                  \
-  DCHECK((cond == cc_always && rs == zero_reg && rt.rm() == zero_reg) || \
-         (cond != cc_always && (rs != zero_reg || rt.rm() != zero_reg)))
-
-void TurboAssembler::Branch(int32_t offset, BranchDelaySlot bdslot) {
-  DCHECK_EQ(kArchVariant, kMips64r6 ? is_int26(offset) : is_int16(offset));
-  BranchShort(offset, bdslot);
-}
-
-void TurboAssembler::Branch(int32_t offset, Condition cond, Register rs,
-                            const Operand& rt, BranchDelaySlot bdslot) {
-  bool is_near = BranchShortCheck(offset, nullptr, cond, rs, rt, bdslot);
-  DCHECK(is_near);
-  USE(is_near);
-}
-
-void TurboAssembler::Branch(Label* L, BranchDelaySlot bdslot) {
-  if (L->is_bound()) {
-    if (is_near_branch(L)) {
-      BranchShort(L, bdslot);
-    } else {
-      BranchLong(L, bdslot);
-    }
-  } else {
-    if (is_trampoline_emitted()) {
-      BranchLong(L, bdslot);
-    } else {
-      BranchShort(L, bdslot);
-    }
-  }
-}
-
-void TurboAssembler::Branch(Label* L, Condition cond, Register rs,
-                            const Operand& rt, BranchDelaySlot bdslot) {
-  if (L->is_bound()) {
-    if (!BranchShortCheck(0, L, cond, rs, rt, bdslot)) {
-      if (cond != cc_always) {
-        Label skip;
-        Condition neg_cond = NegateCondition(cond);
-        BranchShort(&skip, neg_cond, rs, rt);
-        BranchLong(L, bdslot);
-        bind(&skip);
-      } else {
-        BranchLong(L, bdslot);
-      }
-    }
-  } else {
-    if (is_trampoline_emitted()) {
-      if (cond != cc_always) {
-        Label skip;
-        Condition neg_cond = NegateCondition(cond);
-        BranchShort(&skip, neg_cond, rs, rt);
-        BranchLong(L, bdslot);
-        bind(&skip);
-      } else {
-        BranchLong(L, bdslot);
-      }
-    } else {
-      BranchShort(L, cond, rs, rt, bdslot);
-    }
-  }
-}
-
-void TurboAssembler::Branch(Label* L, Condition cond, Register rs,
-                            Heap::RootListIndex index, BranchDelaySlot bdslot) {
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  LoadRoot(scratch, index);
-  Branch(L, cond, rs, Operand(scratch), bdslot);
-}
-
-void TurboAssembler::BranchShortHelper(int16_t offset, Label* L,
-                                       BranchDelaySlot bdslot) {
-  DCHECK(L == nullptr || offset == 0);
-  offset = GetOffset(offset, L, OffsetSize::kOffset16);
-  b(offset);
-
-  // Emit a nop in the branch delay slot if required.
-  if (bdslot == PROTECT)
-    nop();
-}
-
-void TurboAssembler::BranchShortHelperR6(int32_t offset, Label* L) {
-  DCHECK(L == nullptr || offset == 0);
-  offset = GetOffset(offset, L, OffsetSize::kOffset26);
-  bc(offset);
-}
-
-void TurboAssembler::BranchShort(int32_t offset, BranchDelaySlot bdslot) {
-  if (kArchVariant == kMips64r6 && bdslot == PROTECT) {
-    DCHECK(is_int26(offset));
-    BranchShortHelperR6(offset, nullptr);
-  } else {
-    DCHECK(is_int16(offset));
-    BranchShortHelper(offset, nullptr, bdslot);
-  }
-}
-
-void TurboAssembler::BranchShort(Label* L, BranchDelaySlot bdslot) {
-  if (kArchVariant == kMips64r6 && bdslot == PROTECT) {
-    BranchShortHelperR6(0, L);
-  } else {
-    BranchShortHelper(0, L, bdslot);
-  }
-}
-
-
-static inline bool IsZero(const Operand& rt) {
-  if (rt.is_reg()) {
-    return rt.rm() == zero_reg;
-  } else {
-    return rt.immediate() == 0;
-  }
-}
-
-int32_t TurboAssembler::GetOffset(int32_t offset, Label* L, OffsetSize bits) {
-  if (L) {
-    offset = branch_offset_helper(L, bits) >> 2;
-  } else {
-    DCHECK(is_intn(offset, bits));
-  }
-  return offset;
-}
-
-Register TurboAssembler::GetRtAsRegisterHelper(const Operand& rt,
-                                               Register scratch) {
-  Register r2 = no_reg;
-  if (rt.is_reg()) {
-    r2 = rt.rm();
-  } else {
-    r2 = scratch;
-    li(r2, rt);
-  }
-
-  return r2;
-}
-
-bool TurboAssembler::CalculateOffset(Label* L, int32_t& offset,
-                                     OffsetSize bits) {
-  if (!is_near(L, bits)) return false;
-  offset = GetOffset(offset, L, bits);
-  return true;
-}
-
-bool TurboAssembler::CalculateOffset(Label* L, int32_t& offset, OffsetSize bits,
-                                     Register& scratch, const Operand& rt) {
-  if (!is_near(L, bits)) return false;
-  scratch = GetRtAsRegisterHelper(rt, scratch);
-  offset = GetOffset(offset, L, bits);
-  return true;
-}
-
-bool TurboAssembler::BranchShortHelperR6(int32_t offset, Label* L,
-                                         Condition cond, Register rs,
-                                         const Operand& rt) {
-  DCHECK(L == nullptr || offset == 0);
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.hasAvailable() ? temps.Acquire() : t8;
-
-  // Be careful to always use shifted_branch_offset only just before the
-  // branch instruction, as the location will be remember for patching the
-  // target.
-  {
-    BlockTrampolinePoolScope block_trampoline_pool(this);
-    switch (cond) {
-      case cc_always:
-        if (!CalculateOffset(L, offset, OffsetSize::kOffset26)) return false;
-        bc(offset);
-        break;
-      case eq:
-        if (rt.is_reg() && rs.code() == rt.rm().code()) {
-          // Pre R6 beq is used here to make the code patchable. Otherwise bc
-          // should be used which has no condition field so is not patchable.
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          beq(rs, scratch, offset);
-          nop();
-        } else if (IsZero(rt)) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset21)) return false;
-          beqzc(rs, offset);
-        } else {
-          // We don't want any other register but scratch clobbered.
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          beqc(rs, scratch, offset);
-        }
-        break;
-      case ne:
-        if (rt.is_reg() && rs.code() == rt.rm().code()) {
-          // Pre R6 bne is used here to make the code patchable. Otherwise we
-          // should not generate any instruction.
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          bne(rs, scratch, offset);
-          nop();
-        } else if (IsZero(rt)) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset21)) return false;
-          bnezc(rs, offset);
-        } else {
-          // We don't want any other register but scratch clobbered.
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          bnec(rs, scratch, offset);
-        }
-        break;
-
-      // Signed comparison.
-      case greater:
-        // rs > rt
-        if (rt.is_reg() && rs.code() == rt.rm().code()) {
-          break;  // No code needs to be emitted.
-        } else if (rs == zero_reg) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          bltzc(scratch, offset);
-        } else if (IsZero(rt)) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16)) return false;
-          bgtzc(rs, offset);
-        } else {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          DCHECK(rs != scratch);
-          bltc(scratch, rs, offset);
-        }
-        break;
-      case greater_equal:
-        // rs >= rt
-        if (rt.is_reg() && rs.code() == rt.rm().code()) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset26)) return false;
-          bc(offset);
-        } else if (rs == zero_reg) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          blezc(scratch, offset);
-        } else if (IsZero(rt)) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16)) return false;
-          bgezc(rs, offset);
-        } else {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          DCHECK(rs != scratch);
-          bgec(rs, scratch, offset);
-        }
-        break;
-      case less:
-        // rs < rt
-        if (rt.is_reg() && rs.code() == rt.rm().code()) {
-          break;  // No code needs to be emitted.
-        } else if (rs == zero_reg) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          bgtzc(scratch, offset);
-        } else if (IsZero(rt)) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16)) return false;
-          bltzc(rs, offset);
-        } else {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          DCHECK(rs != scratch);
-          bltc(rs, scratch, offset);
-        }
-        break;
-      case less_equal:
-        // rs <= rt
-        if (rt.is_reg() && rs.code() == rt.rm().code()) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset26)) return false;
-          bc(offset);
-        } else if (rs == zero_reg) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          bgezc(scratch, offset);
-        } else if (IsZero(rt)) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16)) return false;
-          blezc(rs, offset);
-        } else {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          DCHECK(rs != scratch);
-          bgec(scratch, rs, offset);
-        }
-        break;
-
-      // Unsigned comparison.
-      case Ugreater:
-        // rs > rt
-        if (rt.is_reg() && rs.code() == rt.rm().code()) {
-          break;  // No code needs to be emitted.
-        } else if (rs == zero_reg) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset21, scratch, rt))
-            return false;
-          bnezc(scratch, offset);
-        } else if (IsZero(rt)) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset21)) return false;
-          bnezc(rs, offset);
-        } else {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          DCHECK(rs != scratch);
-          bltuc(scratch, rs, offset);
-        }
-        break;
-      case Ugreater_equal:
-        // rs >= rt
-        if (rt.is_reg() && rs.code() == rt.rm().code()) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset26)) return false;
-          bc(offset);
-        } else if (rs == zero_reg) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset21, scratch, rt))
-            return false;
-          beqzc(scratch, offset);
-        } else if (IsZero(rt)) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset26)) return false;
-          bc(offset);
-        } else {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          DCHECK(rs != scratch);
-          bgeuc(rs, scratch, offset);
-        }
-        break;
-      case Uless:
-        // rs < rt
-        if (rt.is_reg() && rs.code() == rt.rm().code()) {
-          break;  // No code needs to be emitted.
-        } else if (rs == zero_reg) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset21, scratch, rt))
-            return false;
-          bnezc(scratch, offset);
-        } else if (IsZero(rt)) {
-          break;  // No code needs to be emitted.
-        } else {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          DCHECK(rs != scratch);
-          bltuc(rs, scratch, offset);
-        }
-        break;
-      case Uless_equal:
-        // rs <= rt
-        if (rt.is_reg() && rs.code() == rt.rm().code()) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset26)) return false;
-          bc(offset);
-        } else if (rs == zero_reg) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset26, scratch, rt))
-            return false;
-          bc(offset);
-        } else if (IsZero(rt)) {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset21)) return false;
-          beqzc(rs, offset);
-        } else {
-          if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-            return false;
-          DCHECK(rs != scratch);
-          bgeuc(scratch, rs, offset);
-        }
-        break;
-      default:
-        UNREACHABLE();
-    }
-  }
-  CheckTrampolinePoolQuick(1);
-  return true;
-}
-
-bool TurboAssembler::BranchShortHelper(int16_t offset, Label* L, Condition cond,
-                                       Register rs, const Operand& rt,
-                                       BranchDelaySlot bdslot) {
-  DCHECK(L == nullptr || offset == 0);
-  if (!is_near(L, OffsetSize::kOffset16)) return false;
-
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.hasAvailable() ? temps.Acquire() : t8;
-  int32_t offset32;
-
-  // Be careful to always use shifted_branch_offset only just before the
-  // branch instruction, as the location will be remember for patching the
-  // target.
-  {
-    BlockTrampolinePoolScope block_trampoline_pool(this);
-    switch (cond) {
-      case cc_always:
-        offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-        b(offset32);
-        break;
-      case eq:
-        if (IsZero(rt)) {
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          beq(rs, zero_reg, offset32);
-        } else {
-          // We don't want any other register but scratch clobbered.
-          scratch = GetRtAsRegisterHelper(rt, scratch);
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          beq(rs, scratch, offset32);
-        }
-        break;
-      case ne:
-        if (IsZero(rt)) {
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          bne(rs, zero_reg, offset32);
-        } else {
-          // We don't want any other register but scratch clobbered.
-          scratch = GetRtAsRegisterHelper(rt, scratch);
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          bne(rs, scratch, offset32);
-        }
-        break;
-
-      // Signed comparison.
-      case greater:
-        if (IsZero(rt)) {
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          bgtz(rs, offset32);
-        } else {
-          Slt(scratch, GetRtAsRegisterHelper(rt, scratch), rs);
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          bne(scratch, zero_reg, offset32);
-        }
-        break;
-      case greater_equal:
-        if (IsZero(rt)) {
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          bgez(rs, offset32);
-        } else {
-          Slt(scratch, rs, rt);
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          beq(scratch, zero_reg, offset32);
-        }
-        break;
-      case less:
-        if (IsZero(rt)) {
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          bltz(rs, offset32);
-        } else {
-          Slt(scratch, rs, rt);
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          bne(scratch, zero_reg, offset32);
-        }
-        break;
-      case less_equal:
-        if (IsZero(rt)) {
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          blez(rs, offset32);
-        } else {
-          Slt(scratch, GetRtAsRegisterHelper(rt, scratch), rs);
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          beq(scratch, zero_reg, offset32);
-        }
-        break;
-
-      // Unsigned comparison.
-      case Ugreater:
-        if (IsZero(rt)) {
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          bne(rs, zero_reg, offset32);
-        } else {
-          Sltu(scratch, GetRtAsRegisterHelper(rt, scratch), rs);
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          bne(scratch, zero_reg, offset32);
-        }
-        break;
-      case Ugreater_equal:
-        if (IsZero(rt)) {
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          b(offset32);
-        } else {
-          Sltu(scratch, rs, rt);
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          beq(scratch, zero_reg, offset32);
-        }
-        break;
-      case Uless:
-        if (IsZero(rt)) {
-          return true;  // No code needs to be emitted.
-        } else {
-          Sltu(scratch, rs, rt);
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          bne(scratch, zero_reg, offset32);
-        }
-        break;
-      case Uless_equal:
-        if (IsZero(rt)) {
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          beq(rs, zero_reg, offset32);
-        } else {
-          Sltu(scratch, GetRtAsRegisterHelper(rt, scratch), rs);
-          offset32 = GetOffset(offset, L, OffsetSize::kOffset16);
-          beq(scratch, zero_reg, offset32);
-        }
-        break;
-      default:
-        UNREACHABLE();
-    }
-  }
-
-  // Emit a nop in the branch delay slot if required.
-  if (bdslot == PROTECT)
-    nop();
-
-  return true;
-}
-
-bool TurboAssembler::BranchShortCheck(int32_t offset, Label* L, Condition cond,
-                                      Register rs, const Operand& rt,
-                                      BranchDelaySlot bdslot) {
-  BRANCH_ARGS_CHECK(cond, rs, rt);
-
-  if (!L) {
-    if (kArchVariant == kMips64r6 && bdslot == PROTECT) {
-      DCHECK(is_int26(offset));
-      return BranchShortHelperR6(offset, nullptr, cond, rs, rt);
-    } else {
-      DCHECK(is_int16(offset));
-      return BranchShortHelper(offset, nullptr, cond, rs, rt, bdslot);
-    }
-  } else {
-    DCHECK_EQ(offset, 0);
-    if (kArchVariant == kMips64r6 && bdslot == PROTECT) {
-      return BranchShortHelperR6(0, L, cond, rs, rt);
-    } else {
-      return BranchShortHelper(0, L, cond, rs, rt, bdslot);
-    }
-  }
-  return false;
-}
-
-void TurboAssembler::BranchShort(int32_t offset, Condition cond, Register rs,
-                                 const Operand& rt, BranchDelaySlot bdslot) {
-  BranchShortCheck(offset, nullptr, cond, rs, rt, bdslot);
-}
-
-void TurboAssembler::BranchShort(Label* L, Condition cond, Register rs,
-                                 const Operand& rt, BranchDelaySlot bdslot) {
-  BranchShortCheck(0, L, cond, rs, rt, bdslot);
-}
-
-void TurboAssembler::BranchAndLink(int32_t offset, BranchDelaySlot bdslot) {
-  BranchAndLinkShort(offset, bdslot);
-}
-
-void TurboAssembler::BranchAndLink(int32_t offset, Condition cond, Register rs,
-                                   const Operand& rt, BranchDelaySlot bdslot) {
-  bool is_near = BranchAndLinkShortCheck(offset, nullptr, cond, rs, rt, bdslot);
-  DCHECK(is_near);
-  USE(is_near);
-}
-
-void TurboAssembler::BranchAndLink(Label* L, BranchDelaySlot bdslot) {
-  if (L->is_bound()) {
-    if (is_near_branch(L)) {
-      BranchAndLinkShort(L, bdslot);
-    } else {
-      BranchAndLinkLong(L, bdslot);
-    }
-  } else {
-    if (is_trampoline_emitted()) {
-      BranchAndLinkLong(L, bdslot);
-    } else {
-      BranchAndLinkShort(L, bdslot);
-    }
-  }
-}
-
-void TurboAssembler::BranchAndLink(Label* L, Condition cond, Register rs,
-                                   const Operand& rt, BranchDelaySlot bdslot) {
-  if (L->is_bound()) {
-    if (!BranchAndLinkShortCheck(0, L, cond, rs, rt, bdslot)) {
-      Label skip;
-      Condition neg_cond = NegateCondition(cond);
-      BranchShort(&skip, neg_cond, rs, rt);
-      BranchAndLinkLong(L, bdslot);
-      bind(&skip);
-    }
-  } else {
-    if (is_trampoline_emitted()) {
-      Label skip;
-      Condition neg_cond = NegateCondition(cond);
-      BranchShort(&skip, neg_cond, rs, rt);
-      BranchAndLinkLong(L, bdslot);
-      bind(&skip);
-    } else {
-      BranchAndLinkShortCheck(0, L, cond, rs, rt, bdslot);
-    }
-  }
-}
-
-void TurboAssembler::BranchAndLinkShortHelper(int16_t offset, Label* L,
-                                              BranchDelaySlot bdslot) {
-  DCHECK(L == nullptr || offset == 0);
-  offset = GetOffset(offset, L, OffsetSize::kOffset16);
-  bal(offset);
-
-  // Emit a nop in the branch delay slot if required.
-  if (bdslot == PROTECT)
-    nop();
-}
-
-void TurboAssembler::BranchAndLinkShortHelperR6(int32_t offset, Label* L) {
-  DCHECK(L == nullptr || offset == 0);
-  offset = GetOffset(offset, L, OffsetSize::kOffset26);
-  balc(offset);
-}
-
-void TurboAssembler::BranchAndLinkShort(int32_t offset,
-                                        BranchDelaySlot bdslot) {
-  if (kArchVariant == kMips64r6 && bdslot == PROTECT) {
-    DCHECK(is_int26(offset));
-    BranchAndLinkShortHelperR6(offset, nullptr);
-  } else {
-    DCHECK(is_int16(offset));
-    BranchAndLinkShortHelper(offset, nullptr, bdslot);
-  }
-}
-
-void TurboAssembler::BranchAndLinkShort(Label* L, BranchDelaySlot bdslot) {
-  if (kArchVariant == kMips64r6 && bdslot == PROTECT) {
-    BranchAndLinkShortHelperR6(0, L);
-  } else {
-    BranchAndLinkShortHelper(0, L, bdslot);
-  }
-}
-
-bool TurboAssembler::BranchAndLinkShortHelperR6(int32_t offset, Label* L,
-                                                Condition cond, Register rs,
-                                                const Operand& rt) {
-  DCHECK(L == nullptr || offset == 0);
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.hasAvailable() ? temps.Acquire() : t8;
-  OffsetSize bits = OffsetSize::kOffset16;
-
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  DCHECK((cond == cc_always && is_int26(offset)) || is_int16(offset));
-  switch (cond) {
-    case cc_always:
-      if (!CalculateOffset(L, offset, OffsetSize::kOffset26)) return false;
-      balc(offset);
-      break;
-    case eq:
-      if (!is_near(L, bits)) return false;
-      Subu(scratch, rs, rt);
-      offset = GetOffset(offset, L, bits);
-      beqzalc(scratch, offset);
-      break;
-    case ne:
-      if (!is_near(L, bits)) return false;
-      Subu(scratch, rs, rt);
-      offset = GetOffset(offset, L, bits);
-      bnezalc(scratch, offset);
-      break;
-
-    // Signed comparison.
-    case greater:
-      // rs > rt
-      if (rs.code() == rt.rm().code()) {
-        break;  // No code needs to be emitted.
-      } else if (rs == zero_reg) {
-        if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-          return false;
-        bltzalc(scratch, offset);
-      } else if (IsZero(rt)) {
-        if (!CalculateOffset(L, offset, OffsetSize::kOffset16)) return false;
-        bgtzalc(rs, offset);
-      } else {
-        if (!is_near(L, bits)) return false;
-        Slt(scratch, GetRtAsRegisterHelper(rt, scratch), rs);
-        offset = GetOffset(offset, L, bits);
-        bnezalc(scratch, offset);
-      }
-      break;
-    case greater_equal:
-      // rs >= rt
-      if (rs.code() == rt.rm().code()) {
-        if (!CalculateOffset(L, offset, OffsetSize::kOffset26)) return false;
-        balc(offset);
-      } else if (rs == zero_reg) {
-        if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-          return false;
-        blezalc(scratch, offset);
-      } else if (IsZero(rt)) {
-        if (!CalculateOffset(L, offset, OffsetSize::kOffset16)) return false;
-        bgezalc(rs, offset);
-      } else {
-        if (!is_near(L, bits)) return false;
-        Slt(scratch, rs, rt);
-        offset = GetOffset(offset, L, bits);
-        beqzalc(scratch, offset);
-      }
-      break;
-    case less:
-      // rs < rt
-      if (rs.code() == rt.rm().code()) {
-        break;  // No code needs to be emitted.
-      } else if (rs == zero_reg) {
-        if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-          return false;
-        bgtzalc(scratch, offset);
-      } else if (IsZero(rt)) {
-        if (!CalculateOffset(L, offset, OffsetSize::kOffset16)) return false;
-        bltzalc(rs, offset);
-      } else {
-        if (!is_near(L, bits)) return false;
-        Slt(scratch, rs, rt);
-        offset = GetOffset(offset, L, bits);
-        bnezalc(scratch, offset);
-      }
-      break;
-    case less_equal:
-      // rs <= r2
-      if (rs.code() == rt.rm().code()) {
-        if (!CalculateOffset(L, offset, OffsetSize::kOffset26)) return false;
-        balc(offset);
-      } else if (rs == zero_reg) {
-        if (!CalculateOffset(L, offset, OffsetSize::kOffset16, scratch, rt))
-          return false;
-        bgezalc(scratch, offset);
-      } else if (IsZero(rt)) {
-        if (!CalculateOffset(L, offset, OffsetSize::kOffset16)) return false;
-        blezalc(rs, offset);
-      } else {
-        if (!is_near(L, bits)) return false;
-        Slt(scratch, GetRtAsRegisterHelper(rt, scratch), rs);
-        offset = GetOffset(offset, L, bits);
-        beqzalc(scratch, offset);
-      }
-      break;
-
-
-    // Unsigned comparison.
-    case Ugreater:
-      // rs > r2
-      if (!is_near(L, bits)) return false;
-      Sltu(scratch, GetRtAsRegisterHelper(rt, scratch), rs);
-      offset = GetOffset(offset, L, bits);
-      bnezalc(scratch, offset);
-      break;
-    case Ugreater_equal:
-      // rs >= r2
-      if (!is_near(L, bits)) return false;
-      Sltu(scratch, rs, rt);
-      offset = GetOffset(offset, L, bits);
-      beqzalc(scratch, offset);
-      break;
-    case Uless:
-      // rs < r2
-      if (!is_near(L, bits)) return false;
-      Sltu(scratch, rs, rt);
-      offset = GetOffset(offset, L, bits);
-      bnezalc(scratch, offset);
-      break;
-    case Uless_equal:
-      // rs <= r2
-      if (!is_near(L, bits)) return false;
-      Sltu(scratch, GetRtAsRegisterHelper(rt, scratch), rs);
-      offset = GetOffset(offset, L, bits);
-      beqzalc(scratch, offset);
-      break;
-    default:
-      UNREACHABLE();
-  }
-  return true;
-}
-
-// Pre r6 we need to use a bgezal or bltzal, but they can't be used directly
-// with the slt instructions. We could use sub or add instead but we would miss
-// overflow cases, so we keep slt and add an intermediate third instruction.
-bool TurboAssembler::BranchAndLinkShortHelper(int16_t offset, Label* L,
-                                              Condition cond, Register rs,
-                                              const Operand& rt,
-                                              BranchDelaySlot bdslot) {
-  DCHECK(L == nullptr || offset == 0);
-  if (!is_near(L, OffsetSize::kOffset16)) return false;
-
-  Register scratch = t8;
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-
-  switch (cond) {
-    case cc_always:
-      offset = GetOffset(offset, L, OffsetSize::kOffset16);
-      bal(offset);
-      break;
-    case eq:
-      bne(rs, GetRtAsRegisterHelper(rt, scratch), 2);
-      nop();
-      offset = GetOffset(offset, L, OffsetSize::kOffset16);
-      bal(offset);
-      break;
-    case ne:
-      beq(rs, GetRtAsRegisterHelper(rt, scratch), 2);
-      nop();
-      offset = GetOffset(offset, L, OffsetSize::kOffset16);
-      bal(offset);
-      break;
-
-    // Signed comparison.
-    case greater:
-      Slt(scratch, GetRtAsRegisterHelper(rt, scratch), rs);
-      addiu(scratch, scratch, -1);
-      offset = GetOffset(offset, L, OffsetSize::kOffset16);
-      bgezal(scratch, offset);
-      break;
-    case greater_equal:
-      Slt(scratch, rs, rt);
-      addiu(scratch, scratch, -1);
-      offset = GetOffset(offset, L, OffsetSize::kOffset16);
-      bltzal(scratch, offset);
-      break;
-    case less:
-      Slt(scratch, rs, rt);
-      addiu(scratch, scratch, -1);
-      offset = GetOffset(offset, L, OffsetSize::kOffset16);
-      bgezal(scratch, offset);
-      break;
-    case less_equal:
-      Slt(scratch, GetRtAsRegisterHelper(rt, scratch), rs);
-      addiu(scratch, scratch, -1);
-      offset = GetOffset(offset, L, OffsetSize::kOffset16);
-      bltzal(scratch, offset);
-      break;
-
-    // Unsigned comparison.
-    case Ugreater:
-      Sltu(scratch, GetRtAsRegisterHelper(rt, scratch), rs);
-      addiu(scratch, scratch, -1);
-      offset = GetOffset(offset, L, OffsetSize::kOffset16);
-      bgezal(scratch, offset);
-      break;
-    case Ugreater_equal:
-      Sltu(scratch, rs, rt);
-      addiu(scratch, scratch, -1);
-      offset = GetOffset(offset, L, OffsetSize::kOffset16);
-      bltzal(scratch, offset);
-      break;
-    case Uless:
-      Sltu(scratch, rs, rt);
-      addiu(scratch, scratch, -1);
-      offset = GetOffset(offset, L, OffsetSize::kOffset16);
-      bgezal(scratch, offset);
-      break;
-    case Uless_equal:
-      Sltu(scratch, GetRtAsRegisterHelper(rt, scratch), rs);
-      addiu(scratch, scratch, -1);
-      offset = GetOffset(offset, L, OffsetSize::kOffset16);
-      bltzal(scratch, offset);
-      break;
-
-    default:
-      UNREACHABLE();
-  }
-
-  // Emit a nop in the branch delay slot if required.
-  if (bdslot == PROTECT)
-    nop();
-
-  return true;
-}
-
-bool TurboAssembler::BranchAndLinkShortCheck(int32_t offset, Label* L,
-                                             Condition cond, Register rs,
-                                             const Operand& rt,
-                                             BranchDelaySlot bdslot) {
-  BRANCH_ARGS_CHECK(cond, rs, rt);
-
-  if (!L) {
-    if (kArchVariant == kMips64r6 && bdslot == PROTECT) {
-      DCHECK(is_int26(offset));
-      return BranchAndLinkShortHelperR6(offset, nullptr, cond, rs, rt);
-    } else {
-      DCHECK(is_int16(offset));
-      return BranchAndLinkShortHelper(offset, nullptr, cond, rs, rt, bdslot);
-    }
-  } else {
-    DCHECK_EQ(offset, 0);
-    if (kArchVariant == kMips64r6 && bdslot == PROTECT) {
-      return BranchAndLinkShortHelperR6(0, L, cond, rs, rt);
-    } else {
-      return BranchAndLinkShortHelper(0, L, cond, rs, rt, bdslot);
-    }
-  }
-  return false;
-}
-
-void TurboAssembler::Jump(Register target, Condition cond, Register rs,
-                          const Operand& rt, BranchDelaySlot bd) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  if (kArchVariant == kMips64r6 && bd == PROTECT) {
-    if (cond == cc_always) {
-      jic(target, 0);
-    } else {
-      BRANCH_ARGS_CHECK(cond, rs, rt);
-      Branch(2, NegateCondition(cond), rs, rt);
-      jic(target, 0);
-    }
-  } else {
-    if (cond == cc_always) {
-      jr(target);
-    } else {
-      BRANCH_ARGS_CHECK(cond, rs, rt);
-      Branch(2, NegateCondition(cond), rs, rt);
-      jr(target);
-    }
-    // Emit a nop in the branch delay slot if required.
-    if (bd == PROTECT) nop();
-  }
-}
-
-void TurboAssembler::Jump(intptr_t target, RelocInfo::Mode rmode,
-                          Condition cond, Register rs, const Operand& rt,
-                          BranchDelaySlot bd) {
-  Label skip;
-  if (cond != cc_always) {
-    Branch(USE_DELAY_SLOT, &skip, NegateCondition(cond), rs, rt);
-  }
-  // The first instruction of 'li' may be placed in the delay slot.
-  // This is not an issue, t9 is expected to be clobbered anyway.
-  li(t9, Operand(target, rmode));
-  Jump(t9, al, zero_reg, Operand(zero_reg), bd);
-  bind(&skip);
-}
-
-void TurboAssembler::Jump(Address target, RelocInfo::Mode rmode, Condition cond,
-                          Register rs, const Operand& rt, BranchDelaySlot bd) {
-  DCHECK(!RelocInfo::IsCodeTarget(rmode));
-  Jump(reinterpret_cast<intptr_t>(target), rmode, cond, rs, rt, bd);
-}
-
-void TurboAssembler::Jump(Handle<Code> code, RelocInfo::Mode rmode,
-                          Condition cond, Register rs, const Operand& rt,
-                          BranchDelaySlot bd) {
-  DCHECK(RelocInfo::IsCodeTarget(rmode));
-  Jump(reinterpret_cast<intptr_t>(code.address()), rmode, cond, rs, rt, bd);
-}
-
-int TurboAssembler::CallSize(Register target, Condition cond, Register rs,
-                             const Operand& rt, BranchDelaySlot bd) {
-  int size = 0;
-
-  if (cond == cc_always) {
-    size += 1;
-  } else {
-    size += 3;
-  }
-
-  if (bd == PROTECT && kArchVariant != kMips64r6) size += 1;
-
-  return size * kInstrSize;
-}
-
-
-// Note: To call gcc-compiled C code on mips, you must call through t9.
-void TurboAssembler::Call(Register target, Condition cond, Register rs,
-                          const Operand& rt, BranchDelaySlot bd) {
-#ifdef DEBUG
-  int size = IsPrevInstrCompactBranch() ? kInstrSize : 0;
-#endif
-
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  Label start;
-  bind(&start);
-  if (kArchVariant == kMips64r6 && bd == PROTECT) {
-    if (cond == cc_always) {
-      jialc(target, 0);
-    } else {
-      BRANCH_ARGS_CHECK(cond, rs, rt);
-      Branch(2, NegateCondition(cond), rs, rt);
-      jialc(target, 0);
-    }
-  } else {
-    if (cond == cc_always) {
-      jalr(target);
-    } else {
-      BRANCH_ARGS_CHECK(cond, rs, rt);
-      Branch(2, NegateCondition(cond), rs, rt);
-      jalr(target);
-    }
-    // Emit a nop in the branch delay slot if required.
-    if (bd == PROTECT) nop();
-  }
-
-#ifdef DEBUG
-  DCHECK_EQ(size + CallSize(target, cond, rs, rt, bd),
-            SizeOfCodeGeneratedSince(&start));
-#endif
-}
-
-int TurboAssembler::CallSize(Address target, RelocInfo::Mode rmode,
-                             Condition cond, Register rs, const Operand& rt,
-                             BranchDelaySlot bd) {
-  int size = CallSize(t9, cond, rs, rt, bd);
-  return size + 4 * kInstrSize;
-}
-
-void TurboAssembler::Call(Address target, RelocInfo::Mode rmode, Condition cond,
-                          Register rs, const Operand& rt, BranchDelaySlot bd) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  Label start;
-  bind(&start);
-  int64_t target_int = reinterpret_cast<int64_t>(target);
-  li(t9, Operand(target_int, rmode), ADDRESS_LOAD);
-  Call(t9, cond, rs, rt, bd);
-  DCHECK_EQ(CallSize(target, rmode, cond, rs, rt, bd),
-            SizeOfCodeGeneratedSince(&start));
-}
-
-int TurboAssembler::CallSize(Handle<Code> code, RelocInfo::Mode rmode,
-                             Condition cond, Register rs, const Operand& rt,
-                             BranchDelaySlot bd) {
-  return CallSize(code.address(), rmode, cond, rs, rt, bd);
-}
-
-void TurboAssembler::Call(Handle<Code> code, RelocInfo::Mode rmode,
-                          Condition cond, Register rs, const Operand& rt,
-                          BranchDelaySlot bd) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  Label start;
-  bind(&start);
-  DCHECK(RelocInfo::IsCodeTarget(rmode));
-  Call(code.address(), rmode, cond, rs, rt, bd);
-  DCHECK_EQ(CallSize(code, rmode, cond, rs, rt, bd),
-            SizeOfCodeGeneratedSince(&start));
-}
-
-void TurboAssembler::Ret(Condition cond, Register rs, const Operand& rt,
-                         BranchDelaySlot bd) {
-  Jump(ra, cond, rs, rt, bd);
-}
-
-void TurboAssembler::BranchLong(Label* L, BranchDelaySlot bdslot) {
-  if (kArchVariant == kMips64r6 && bdslot == PROTECT &&
-      (!L->is_bound() || is_near_r6(L))) {
-    BranchShortHelperR6(0, L);
-  } else {
-    EmitForbiddenSlotInstruction();
-    BlockTrampolinePoolScope block_trampoline_pool(this);
-    {
-      BlockGrowBufferScope block_buf_growth(this);
-      // Buffer growth (and relocation) must be blocked for internal references
-      // until associated instructions are emitted and available to be patched.
-      RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE_ENCODED);
-      j(L);
-    }
-    // Emit a nop in the branch delay slot if required.
-    if (bdslot == PROTECT) nop();
-  }
-}
-
-void TurboAssembler::BranchAndLinkLong(Label* L, BranchDelaySlot bdslot) {
-  if (kArchVariant == kMips64r6 && bdslot == PROTECT &&
-      (!L->is_bound() || is_near_r6(L))) {
-    BranchAndLinkShortHelperR6(0, L);
-  } else {
-    EmitForbiddenSlotInstruction();
-    BlockTrampolinePoolScope block_trampoline_pool(this);
-    {
-      BlockGrowBufferScope block_buf_growth(this);
-      // Buffer growth (and relocation) must be blocked for internal references
-      // until associated instructions are emitted and available to be patched.
-      RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE_ENCODED);
-      jal(L);
-    }
-    // Emit a nop in the branch delay slot if required.
-    if (bdslot == PROTECT) nop();
-  }
-}
-
-void TurboAssembler::DropAndRet(int drop) {
-  DCHECK(is_int16(drop * kPointerSize));
-  Ret(USE_DELAY_SLOT);
-  daddiu(sp, sp, drop * kPointerSize);
-}
-
-void TurboAssembler::DropAndRet(int drop, Condition cond, Register r1,
-                                const Operand& r2) {
-  // Both Drop and Ret need to be conditional.
-  Label skip;
-  if (cond != cc_always) {
-    Branch(&skip, NegateCondition(cond), r1, r2);
-  }
-
-  Drop(drop);
-  Ret();
-
-  if (cond != cc_always) {
-    bind(&skip);
-  }
-}
-
-void TurboAssembler::Drop(int count, Condition cond, Register reg,
-                          const Operand& op) {
-  if (count <= 0) {
-    return;
-  }
-
-  Label skip;
-
-  if (cond != al) {
-     Branch(&skip, NegateCondition(cond), reg, op);
-  }
-
-  Daddu(sp, sp, Operand(count * kPointerSize));
-
-  if (cond != al) {
-    bind(&skip);
-  }
-}
-
-
-
-void MacroAssembler::Swap(Register reg1,
-                          Register reg2,
-                          Register scratch) {
-  if (scratch == no_reg) {
-    Xor(reg1, reg1, Operand(reg2));
-    Xor(reg2, reg2, Operand(reg1));
-    Xor(reg1, reg1, Operand(reg2));
-  } else {
-    mov(scratch, reg1);
-    mov(reg1, reg2);
-    mov(reg2, scratch);
-  }
-}
-
-void TurboAssembler::Call(Label* target) { BranchAndLink(target); }
-
-void TurboAssembler::Push(Smi* smi) {
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  li(scratch, Operand(smi));
-  push(scratch);
-}
-
-void TurboAssembler::Push(Handle<HeapObject> handle) {
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  li(scratch, Operand(handle));
-  push(scratch);
-}
-
-void MacroAssembler::MaybeDropFrames() {
-  // Check whether we need to drop frames to restart a function on the stack.
-  ExternalReference restart_fp =
-      ExternalReference::debug_restart_fp_address(isolate());
-  li(a1, Operand(restart_fp));
-  Ld(a1, MemOperand(a1));
-  Jump(BUILTIN_CODE(isolate(), FrameDropperTrampoline), RelocInfo::CODE_TARGET,
-       ne, a1, Operand(zero_reg));
-}
-
-// ---------------------------------------------------------------------------
-// Exception handling.
-
-void MacroAssembler::PushStackHandler() {
-  // Adjust this code if not the case.
-  STATIC_ASSERT(StackHandlerConstants::kSize == 2 * kPointerSize);
-  STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize);
-
-  Push(Smi::kZero);  // Padding.
-
-  // Link the current handler as the next handler.
-  li(a6,
-     Operand(ExternalReference(IsolateAddressId::kHandlerAddress, isolate())));
-  Ld(a5, MemOperand(a6));
-  push(a5);
-
-  // Set this new handler as the current one.
-  Sd(sp, MemOperand(a6));
-}
-
-
-void MacroAssembler::PopStackHandler() {
-  STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
-  pop(a1);
-  Daddu(sp, sp, Operand(static_cast<int64_t>(StackHandlerConstants::kSize -
-                                             kPointerSize)));
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  li(scratch,
-     Operand(ExternalReference(IsolateAddressId::kHandlerAddress, isolate())));
-  Sd(a1, MemOperand(scratch));
-}
-
-void TurboAssembler::FPUCanonicalizeNaN(const DoubleRegister dst,
-                                        const DoubleRegister src) {
-  sub_d(dst, src, kDoubleRegZero);
-}
-
-void TurboAssembler::MovFromFloatResult(const DoubleRegister dst) {
-  if (IsMipsSoftFloatABI) {
-    if (kArchEndian == kLittle) {
-      Move(dst, v0, v1);
-    } else {
-      Move(dst, v1, v0);
-    }
-  } else {
-    Move(dst, f0);  // Reg f0 is o32 ABI FP return value.
-  }
-}
-
-void TurboAssembler::MovFromFloatParameter(const DoubleRegister dst) {
-  if (IsMipsSoftFloatABI) {
-    if (kArchEndian == kLittle) {
-      Move(dst, a0, a1);
-    } else {
-      Move(dst, a1, a0);
-    }
-  } else {
-    Move(dst, f12);  // Reg f12 is n64 ABI FP first argument value.
-  }
-}
-
-void TurboAssembler::MovToFloatParameter(DoubleRegister src) {
-  if (!IsMipsSoftFloatABI) {
-    Move(f12, src);
-  } else {
-    if (kArchEndian == kLittle) {
-      Move(a0, a1, src);
-    } else {
-      Move(a1, a0, src);
-    }
-  }
-}
-
-void TurboAssembler::MovToFloatResult(DoubleRegister src) {
-  if (!IsMipsSoftFloatABI) {
-    Move(f0, src);
-  } else {
-    if (kArchEndian == kLittle) {
-      Move(v0, v1, src);
-    } else {
-      Move(v1, v0, src);
-    }
-  }
-}
-
-void TurboAssembler::MovToFloatParameters(DoubleRegister src1,
-                                          DoubleRegister src2) {
-  if (!IsMipsSoftFloatABI) {
-    const DoubleRegister fparg2 = f13;
-    if (src2 == f12) {
-      DCHECK(src1 != fparg2);
-      Move(fparg2, src2);
-      Move(f12, src1);
-    } else {
-      Move(f12, src1);
-      Move(fparg2, src2);
-    }
-  } else {
-    if (kArchEndian == kLittle) {
-      Move(a0, a1, src1);
-      Move(a2, a3, src2);
-    } else {
-      Move(a1, a0, src1);
-      Move(a3, a2, src2);
-    }
-  }
-}
-
-
-// -----------------------------------------------------------------------------
-// JavaScript invokes.
-
-void TurboAssembler::PrepareForTailCall(const ParameterCount& callee_args_count,
-                                        Register caller_args_count_reg,
-                                        Register scratch0, Register scratch1) {
-#if DEBUG
-  if (callee_args_count.is_reg()) {
-    DCHECK(!AreAliased(callee_args_count.reg(), caller_args_count_reg, scratch0,
-                       scratch1));
-  } else {
-    DCHECK(!AreAliased(caller_args_count_reg, scratch0, scratch1));
-  }
-#endif
-
-  // Calculate the end of destination area where we will put the arguments
-  // after we drop current frame. We add kPointerSize to count the receiver
-  // argument which is not included into formal parameters count.
-  Register dst_reg = scratch0;
-  Dlsa(dst_reg, fp, caller_args_count_reg, kPointerSizeLog2);
-  Daddu(dst_reg, dst_reg,
-        Operand(StandardFrameConstants::kCallerSPOffset + kPointerSize));
-
-  Register src_reg = caller_args_count_reg;
-  // Calculate the end of source area. +kPointerSize is for the receiver.
-  if (callee_args_count.is_reg()) {
-    Dlsa(src_reg, sp, callee_args_count.reg(), kPointerSizeLog2);
-    Daddu(src_reg, src_reg, Operand(kPointerSize));
-  } else {
-    Daddu(src_reg, sp,
-          Operand((callee_args_count.immediate() + 1) * kPointerSize));
-  }
-
-  if (FLAG_debug_code) {
-    Check(lo, AbortReason::kStackAccessBelowStackPointer, src_reg,
-          Operand(dst_reg));
-  }
-
-  // Restore caller's frame pointer and return address now as they will be
-  // overwritten by the copying loop.
-  Ld(ra, MemOperand(fp, StandardFrameConstants::kCallerPCOffset));
-  Ld(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
-
-  // Now copy callee arguments to the caller frame going backwards to avoid
-  // callee arguments corruption (source and destination areas could overlap).
-
-  // Both src_reg and dst_reg are pointing to the word after the one to copy,
-  // so they must be pre-decremented in the loop.
-  Register tmp_reg = scratch1;
-  Label loop, entry;
-  Branch(&entry);
-  bind(&loop);
-  Dsubu(src_reg, src_reg, Operand(kPointerSize));
-  Dsubu(dst_reg, dst_reg, Operand(kPointerSize));
-  Ld(tmp_reg, MemOperand(src_reg));
-  Sd(tmp_reg, MemOperand(dst_reg));
-  bind(&entry);
-  Branch(&loop, ne, sp, Operand(src_reg));
-
-  // Leave current frame.
-  mov(sp, dst_reg);
-}
-
-void MacroAssembler::InvokePrologue(const ParameterCount& expected,
-                                    const ParameterCount& actual, Label* done,
-                                    bool* definitely_mismatches,
-                                    InvokeFlag flag) {
-  bool definitely_matches = false;
-  *definitely_mismatches = false;
-  Label regular_invoke;
-
-  // Check whether the expected and actual arguments count match. If not,
-  // setup registers according to contract with ArgumentsAdaptorTrampoline:
-  //  a0: actual arguments count
-  //  a1: function (passed through to callee)
-  //  a2: expected arguments count
-
-  // The code below is made a lot easier because the calling code already sets
-  // up actual and expected registers according to the contract if values are
-  // passed in registers.
-  DCHECK(actual.is_immediate() || actual.reg() == a0);
-  DCHECK(expected.is_immediate() || expected.reg() == a2);
-
-  if (expected.is_immediate()) {
-    DCHECK(actual.is_immediate());
-    li(a0, Operand(actual.immediate()));
-    if (expected.immediate() == actual.immediate()) {
-      definitely_matches = true;
-    } else {
-      const int sentinel = SharedFunctionInfo::kDontAdaptArgumentsSentinel;
-      if (expected.immediate() == sentinel) {
-        // Don't worry about adapting arguments for builtins that
-        // don't want that done. Skip adaption code by making it look
-        // like we have a match between expected and actual number of
-        // arguments.
-        definitely_matches = true;
-      } else {
-        *definitely_mismatches = true;
-        li(a2, Operand(expected.immediate()));
-      }
-    }
-  } else if (actual.is_immediate()) {
-    li(a0, Operand(actual.immediate()));
-    Branch(&regular_invoke, eq, expected.reg(), Operand(a0));
-  } else {
-    Branch(&regular_invoke, eq, expected.reg(), Operand(actual.reg()));
-  }
-
-  if (!definitely_matches) {
-    Handle<Code> adaptor = BUILTIN_CODE(isolate(), ArgumentsAdaptorTrampoline);
-    if (flag == CALL_FUNCTION) {
-      Call(adaptor);
-      if (!*definitely_mismatches) {
-        Branch(done);
-      }
-    } else {
-      Jump(adaptor, RelocInfo::CODE_TARGET);
-    }
-    bind(&regular_invoke);
-  }
-}
-
-void MacroAssembler::CheckDebugHook(Register fun, Register new_target,
-                                    const ParameterCount& expected,
-                                    const ParameterCount& actual) {
-  Label skip_hook;
-  ExternalReference debug_hook_active =
-      ExternalReference::debug_hook_on_function_call_address(isolate());
-  li(t0, Operand(debug_hook_active));
-  Lb(t0, MemOperand(t0));
-  Branch(&skip_hook, eq, t0, Operand(zero_reg));
-  {
-    FrameScope frame(this,
-                     has_frame() ? StackFrame::NONE : StackFrame::INTERNAL);
-    if (expected.is_reg()) {
-      SmiTag(expected.reg());
-      Push(expected.reg());
-    }
-    if (actual.is_reg()) {
-      SmiTag(actual.reg());
-      Push(actual.reg());
-    }
-    if (new_target.is_valid()) {
-      Push(new_target);
-    }
-    Push(fun);
-    Push(fun);
-    CallRuntime(Runtime::kDebugOnFunctionCall);
-    Pop(fun);
-    if (new_target.is_valid()) {
-      Pop(new_target);
-    }
-    if (actual.is_reg()) {
-      Pop(actual.reg());
-      SmiUntag(actual.reg());
-    }
-    if (expected.is_reg()) {
-      Pop(expected.reg());
-      SmiUntag(expected.reg());
-    }
-  }
-  bind(&skip_hook);
-}
-
-void MacroAssembler::InvokeFunctionCode(Register function, Register new_target,
-                                        const ParameterCount& expected,
-                                        const ParameterCount& actual,
-                                        InvokeFlag flag) {
-  // You can't call a function without a valid frame.
-  DCHECK(flag == JUMP_FUNCTION || has_frame());
-  DCHECK(function == a1);
-  DCHECK_IMPLIES(new_target.is_valid(), new_target == a3);
-
-  // On function call, call into the debugger if necessary.
-  CheckDebugHook(function, new_target, expected, actual);
-
-  // Clear the new.target register if not given.
-  if (!new_target.is_valid()) {
-    LoadRoot(a3, Heap::kUndefinedValueRootIndex);
-  }
-
-  Label done;
-  bool definitely_mismatches = false;
-  InvokePrologue(expected, actual, &done, &definitely_mismatches, flag);
-  if (!definitely_mismatches) {
-    // We call indirectly through the code field in the function to
-    // allow recompilation to take effect without changing any of the
-    // call sites.
-    Register code = t0;
-    Ld(code, FieldMemOperand(function, JSFunction::kCodeOffset));
-    if (flag == CALL_FUNCTION) {
-      Daddu(code, code, Operand(Code::kHeaderSize - kHeapObjectTag));
-      Call(code);
-    } else {
-      DCHECK(flag == JUMP_FUNCTION);
-      Daddu(code, code, Operand(Code::kHeaderSize - kHeapObjectTag));
-      Jump(code);
-    }
-    // Continue here if InvokePrologue does handle the invocation due to
-    // mismatched parameter counts.
-    bind(&done);
-  }
-}
-
-void MacroAssembler::InvokeFunction(Register function, Register new_target,
-                                    const ParameterCount& actual,
-                                    InvokeFlag flag) {
-  // You can't call a function without a valid frame.
-  DCHECK(flag == JUMP_FUNCTION || has_frame());
-
-  // Contract with called JS functions requires that function is passed in a1.
-  DCHECK(function == a1);
-  Register expected_reg = a2;
-  Register temp_reg = t0;
-  Ld(temp_reg, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
-  Ld(cp, FieldMemOperand(a1, JSFunction::kContextOffset));
-  // The argument count is stored as int32_t on 64-bit platforms.
-  // TODO(plind): Smi on 32-bit platforms.
-  Lw(expected_reg,
-     FieldMemOperand(temp_reg,
-                     SharedFunctionInfo::kFormalParameterCountOffset));
-  ParameterCount expected(expected_reg);
-  InvokeFunctionCode(a1, new_target, expected, actual, flag);
-}
-
-void MacroAssembler::InvokeFunction(Register function,
-                                    const ParameterCount& expected,
-                                    const ParameterCount& actual,
-                                    InvokeFlag flag) {
-  // You can't call a function without a valid frame.
-  DCHECK(flag == JUMP_FUNCTION || has_frame());
-
-  // Contract with called JS functions requires that function is passed in a1.
-  DCHECK(function == a1);
-
-  // Get the function and setup the context.
-  Ld(cp, FieldMemOperand(a1, JSFunction::kContextOffset));
-
-  InvokeFunctionCode(a1, no_reg, expected, actual, flag);
-}
-
-void MacroAssembler::InvokeFunction(Handle<JSFunction> function,
-                                    const ParameterCount& expected,
-                                    const ParameterCount& actual,
-                                    InvokeFlag flag) {
-  li(a1, function);
-  InvokeFunction(a1, expected, actual, flag);
-}
-
-
-// ---------------------------------------------------------------------------
-// Support functions.
-
-void MacroAssembler::GetObjectType(Register object,
-                                   Register map,
-                                   Register type_reg) {
-  Ld(map, FieldMemOperand(object, HeapObject::kMapOffset));
-  Lhu(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset));
-}
-
-
-// -----------------------------------------------------------------------------
-// Runtime calls.
-
-void MacroAssembler::CallStub(CodeStub* stub,
-                              Condition cond,
-                              Register r1,
-                              const Operand& r2,
-                              BranchDelaySlot bd) {
-  DCHECK(AllowThisStubCall(stub));  // Stub calls are not allowed in some stubs.
-  Call(stub->GetCode(), RelocInfo::CODE_TARGET, cond, r1, r2, bd);
-}
-
-void TurboAssembler::CallStubDelayed(CodeStub* stub, Condition cond,
-                                     Register r1, const Operand& r2,
-                                     BranchDelaySlot bd) {
-  DCHECK(AllowThisStubCall(stub));  // Stub calls are not allowed in some stubs.
-
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  li(scratch, Operand::EmbeddedCode(stub));
-  Call(scratch);
-}
-
-void MacroAssembler::TailCallStub(CodeStub* stub,
-                                  Condition cond,
-                                  Register r1,
-                                  const Operand& r2,
-                                  BranchDelaySlot bd) {
-  Jump(stub->GetCode(), RelocInfo::CODE_TARGET, cond, r1, r2, bd);
-}
-
-bool TurboAssembler::AllowThisStubCall(CodeStub* stub) {
-  return has_frame() || !stub->SometimesSetsUpAFrame();
-}
-
-static inline void BranchOvfHelper(TurboAssembler* tasm, Register overflow_dst,
-                                   Label* overflow_label,
-                                   Label* no_overflow_label) {
-  DCHECK(overflow_label || no_overflow_label);
-  if (!overflow_label) {
-    DCHECK(no_overflow_label);
-    tasm->Branch(no_overflow_label, ge, overflow_dst, Operand(zero_reg));
-  } else {
-    tasm->Branch(overflow_label, lt, overflow_dst, Operand(zero_reg));
-    if (no_overflow_label) tasm->Branch(no_overflow_label);
-  }
-}
-
-void TurboAssembler::DaddBranchOvf(Register dst, Register left,
-                                   const Operand& right, Label* overflow_label,
-                                   Label* no_overflow_label, Register scratch) {
-  if (right.is_reg()) {
-    DaddBranchOvf(dst, left, right.rm(), overflow_label, no_overflow_label,
-                  scratch);
-  } else {
-    Register overflow_dst = t9;
-    DCHECK(dst != scratch);
-    DCHECK(dst != overflow_dst);
-    DCHECK(scratch != overflow_dst);
-    DCHECK(left != overflow_dst);
-    li(overflow_dst, right);  // Load right.
-    if (dst == left) {
-      mov(scratch, left);              // Preserve left.
-      Daddu(dst, left, overflow_dst);  // Left is overwritten.
-      xor_(scratch, dst, scratch);     // Original left.
-      xor_(overflow_dst, dst, overflow_dst);
-      and_(overflow_dst, overflow_dst, scratch);
-    } else {
-      Daddu(dst, left, overflow_dst);
-      xor_(scratch, dst, overflow_dst);
-      xor_(overflow_dst, dst, left);
-      and_(overflow_dst, scratch, overflow_dst);
-    }
-    BranchOvfHelper(this, overflow_dst, overflow_label, no_overflow_label);
-  }
-}
-
-void TurboAssembler::DaddBranchOvf(Register dst, Register left, Register right,
-                                   Label* overflow_label,
-                                   Label* no_overflow_label, Register scratch) {
-  Register overflow_dst = t9;
-  DCHECK(dst != scratch);
-  DCHECK(dst != overflow_dst);
-  DCHECK(scratch != overflow_dst);
-  DCHECK(left != overflow_dst);
-  DCHECK(right != overflow_dst);
-  DCHECK(left != scratch);
-  DCHECK(right != scratch);
-
-  if (left == right && dst == left) {
-    mov(overflow_dst, right);
-    right = overflow_dst;
-  }
-
-  if (dst == left) {
-    mov(scratch, left);           // Preserve left.
-    daddu(dst, left, right);      // Left is overwritten.
-    xor_(scratch, dst, scratch);  // Original left.
-    xor_(overflow_dst, dst, right);
-    and_(overflow_dst, overflow_dst, scratch);
-  } else if (dst == right) {
-    mov(scratch, right);          // Preserve right.
-    daddu(dst, left, right);      // Right is overwritten.
-    xor_(scratch, dst, scratch);  // Original right.
-    xor_(overflow_dst, dst, left);
-    and_(overflow_dst, overflow_dst, scratch);
-  } else {
-    daddu(dst, left, right);
-    xor_(overflow_dst, dst, left);
-    xor_(scratch, dst, right);
-    and_(overflow_dst, scratch, overflow_dst);
-  }
-  BranchOvfHelper(this, overflow_dst, overflow_label, no_overflow_label);
-}
-
-void TurboAssembler::DsubBranchOvf(Register dst, Register left,
-                                   const Operand& right, Label* overflow_label,
-                                   Label* no_overflow_label, Register scratch) {
-  DCHECK(overflow_label || no_overflow_label);
-  if (right.is_reg()) {
-    DsubBranchOvf(dst, left, right.rm(), overflow_label, no_overflow_label,
-                  scratch);
-  } else {
-    Register overflow_dst = t9;
-    DCHECK(dst != scratch);
-    DCHECK(dst != overflow_dst);
-    DCHECK(scratch != overflow_dst);
-    DCHECK(left != overflow_dst);
-    DCHECK(left != scratch);
-    li(overflow_dst, right);  // Load right.
-    if (dst == left) {
-      mov(scratch, left);                         // Preserve left.
-      Dsubu(dst, left, overflow_dst);             // Left is overwritten.
-      xor_(overflow_dst, scratch, overflow_dst);  // scratch is original left.
-      xor_(scratch, dst, scratch);                // scratch is original left.
-      and_(overflow_dst, scratch, overflow_dst);
-    } else {
-      Dsubu(dst, left, overflow_dst);
-      xor_(scratch, left, overflow_dst);
-      xor_(overflow_dst, dst, left);
-      and_(overflow_dst, scratch, overflow_dst);
-    }
-    BranchOvfHelper(this, overflow_dst, overflow_label, no_overflow_label);
-  }
-}
-
-void TurboAssembler::DsubBranchOvf(Register dst, Register left, Register right,
-                                   Label* overflow_label,
-                                   Label* no_overflow_label, Register scratch) {
-  DCHECK(overflow_label || no_overflow_label);
-  Register overflow_dst = t9;
-  DCHECK(dst != scratch);
-  DCHECK(dst != overflow_dst);
-  DCHECK(scratch != overflow_dst);
-  DCHECK(overflow_dst != left);
-  DCHECK(overflow_dst != right);
-  DCHECK(scratch != left);
-  DCHECK(scratch != right);
-
-  // This happens with some crankshaft code. Since Subu works fine if
-  // left == right, let's not make that restriction here.
-  if (left == right) {
-    mov(dst, zero_reg);
-    if (no_overflow_label) {
-      Branch(no_overflow_label);
-    }
-  }
-
-  if (dst == left) {
-    mov(scratch, left);                // Preserve left.
-    dsubu(dst, left, right);           // Left is overwritten.
-    xor_(overflow_dst, dst, scratch);  // scratch is original left.
-    xor_(scratch, scratch, right);     // scratch is original left.
-    and_(overflow_dst, scratch, overflow_dst);
-  } else if (dst == right) {
-    mov(scratch, right);      // Preserve right.
-    dsubu(dst, left, right);  // Right is overwritten.
-    xor_(overflow_dst, dst, left);
-    xor_(scratch, left, scratch);  // Original right.
-    and_(overflow_dst, scratch, overflow_dst);
-  } else {
-    dsubu(dst, left, right);
-    xor_(overflow_dst, dst, left);
-    xor_(scratch, left, right);
-    and_(overflow_dst, scratch, overflow_dst);
-  }
-  BranchOvfHelper(this, overflow_dst, overflow_label, no_overflow_label);
-}
-
-static inline void BranchOvfHelperMult(TurboAssembler* tasm,
-                                       Register overflow_dst,
-                                       Label* overflow_label,
-                                       Label* no_overflow_label) {
-  DCHECK(overflow_label || no_overflow_label);
-  if (!overflow_label) {
-    DCHECK(no_overflow_label);
-    tasm->Branch(no_overflow_label, eq, overflow_dst, Operand(zero_reg));
-  } else {
-    tasm->Branch(overflow_label, ne, overflow_dst, Operand(zero_reg));
-    if (no_overflow_label) tasm->Branch(no_overflow_label);
-  }
-}
-
-void TurboAssembler::MulBranchOvf(Register dst, Register left,
-                                  const Operand& right, Label* overflow_label,
-                                  Label* no_overflow_label, Register scratch) {
-  DCHECK(overflow_label || no_overflow_label);
-  if (right.is_reg()) {
-    MulBranchOvf(dst, left, right.rm(), overflow_label, no_overflow_label,
-                 scratch);
-  } else {
-    Register overflow_dst = t9;
-    DCHECK(dst != scratch);
-    DCHECK(dst != overflow_dst);
-    DCHECK(scratch != overflow_dst);
-    DCHECK(left != overflow_dst);
-    DCHECK(left != scratch);
-
-    if (dst == left) {
-      Mul(scratch, left, static_cast<int32_t>(right.immediate()));
-      Mulh(overflow_dst, left, static_cast<int32_t>(right.immediate()));
-      mov(dst, scratch);
-    } else {
-      Mul(dst, left, static_cast<int32_t>(right.immediate()));
-      Mulh(overflow_dst, left, static_cast<int32_t>(right.immediate()));
-    }
-
-    dsra32(scratch, dst, 0);
-    xor_(overflow_dst, overflow_dst, scratch);
-
-    BranchOvfHelperMult(this, overflow_dst, overflow_label, no_overflow_label);
-  }
-}
-
-void TurboAssembler::MulBranchOvf(Register dst, Register left, Register right,
-                                  Label* overflow_label,
-                                  Label* no_overflow_label, Register scratch) {
-  DCHECK(overflow_label || no_overflow_label);
-  Register overflow_dst = t9;
-  DCHECK(dst != scratch);
-  DCHECK(dst != overflow_dst);
-  DCHECK(scratch != overflow_dst);
-  DCHECK(overflow_dst != left);
-  DCHECK(overflow_dst != right);
-  DCHECK(scratch != left);
-  DCHECK(scratch != right);
-
-  if (dst == left || dst == right) {
-    Mul(scratch, left, right);
-    Mulh(overflow_dst, left, right);
-    mov(dst, scratch);
-  } else {
-    Mul(dst, left, right);
-    Mulh(overflow_dst, left, right);
-  }
-
-  dsra32(scratch, dst, 0);
-  xor_(overflow_dst, overflow_dst, scratch);
-
-  BranchOvfHelperMult(this, overflow_dst, overflow_label, no_overflow_label);
-}
-
-void TurboAssembler::CallRuntimeDelayed(Zone* zone, Runtime::FunctionId fid,
-                                        SaveFPRegsMode save_doubles,
-                                        BranchDelaySlot bd) {
-  const Runtime::Function* f = Runtime::FunctionForId(fid);
-  // TODO(1236192): Most runtime routines don't need the number of
-  // arguments passed in because it is constant. At some point we
-  // should remove this need and make the runtime routine entry code
-  // smarter.
-  PrepareCEntryArgs(f->nargs);
-  PrepareCEntryFunction(ExternalReference(f, isolate()));
-  CallStubDelayed(new (zone) CEntryStub(nullptr, 1, save_doubles));
-}
-
-void MacroAssembler::CallRuntime(const Runtime::Function* f, int num_arguments,
-                                 SaveFPRegsMode save_doubles,
-                                 BranchDelaySlot bd) {
-  // All parameters are on the stack. v0 has the return value after call.
-
-  // If the expected number of arguments of the runtime function is
-  // constant, we check that the actual number of arguments match the
-  // expectation.
-  CHECK(f->nargs < 0 || f->nargs == num_arguments);
-
-  // TODO(1236192): Most runtime routines don't need the number of
-  // arguments passed in because it is constant. At some point we
-  // should remove this need and make the runtime routine entry code
-  // smarter.
-  PrepareCEntryArgs(num_arguments);
-  PrepareCEntryFunction(ExternalReference(f, isolate()));
-  CEntryStub stub(isolate(), 1, save_doubles);
-  CallStub(&stub, al, zero_reg, Operand(zero_reg), bd);
-}
-
-void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid) {
-  const Runtime::Function* function = Runtime::FunctionForId(fid);
-  DCHECK_EQ(1, function->result_size);
-  if (function->nargs >= 0) {
-    PrepareCEntryArgs(function->nargs);
-  }
-  JumpToExternalReference(ExternalReference(fid, isolate()));
-}
-
-void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin,
-                                             BranchDelaySlot bd,
-                                             bool builtin_exit_frame) {
-  PrepareCEntryFunction(builtin);
-  CEntryStub stub(isolate(), 1, kDontSaveFPRegs, kArgvOnStack,
-                  builtin_exit_frame);
-  Jump(stub.GetCode(),
-       RelocInfo::CODE_TARGET,
-       al,
-       zero_reg,
-       Operand(zero_reg),
-       bd);
-}
-
-void MacroAssembler::IncrementCounter(StatsCounter* counter, int value,
-                                      Register scratch1, Register scratch2) {
-  DCHECK_GT(value, 0);
-  if (FLAG_native_code_counters && counter->Enabled()) {
-    li(scratch2, Operand(ExternalReference(counter)));
-    Lw(scratch1, MemOperand(scratch2));
-    Addu(scratch1, scratch1, Operand(value));
-    Sw(scratch1, MemOperand(scratch2));
-  }
-}
-
-
-void MacroAssembler::DecrementCounter(StatsCounter* counter, int value,
-                                      Register scratch1, Register scratch2) {
-  DCHECK_GT(value, 0);
-  if (FLAG_native_code_counters && counter->Enabled()) {
-    li(scratch2, Operand(ExternalReference(counter)));
-    Lw(scratch1, MemOperand(scratch2));
-    Subu(scratch1, scratch1, Operand(value));
-    Sw(scratch1, MemOperand(scratch2));
-  }
-}
-
-
-// -----------------------------------------------------------------------------
-// Debugging.
-
-void TurboAssembler::Assert(Condition cc, AbortReason reason, Register rs,
-                            Operand rt) {
-  if (emit_debug_code())
-    Check(cc, reason, rs, rt);
-}
-
-void TurboAssembler::Check(Condition cc, AbortReason reason, Register rs,
-                           Operand rt) {
-  Label L;
-  Branch(&L, cc, rs, rt);
-  Abort(reason);
-  // Will not return here.
-  bind(&L);
-}
-
-void TurboAssembler::Abort(AbortReason reason) {
-  Label abort_start;
-  bind(&abort_start);
-#ifdef DEBUG
-  const char* msg = GetAbortReason(reason);
-  if (msg != nullptr) {
-    RecordComment("Abort message: ");
-    RecordComment(msg);
-  }
-
-  if (FLAG_trap_on_abort) {
-    stop(msg);
-    return;
-  }
-#endif
-
-  Move(a0, Smi::FromInt(static_cast<int>(reason)));
-
-  // Disable stub call restrictions to always allow calls to abort.
-  if (!has_frame()) {
-    // We don't actually want to generate a pile of code for this, so just
-    // claim there is a stack frame, without generating one.
-    FrameScope scope(this, StackFrame::NONE);
-    Call(BUILTIN_CODE(isolate(), Abort), RelocInfo::CODE_TARGET);
-  } else {
-    Call(BUILTIN_CODE(isolate(), Abort), RelocInfo::CODE_TARGET);
-  }
-  // Will not return here.
-  if (is_trampoline_pool_blocked()) {
-    // If the calling code cares about the exact number of
-    // instructions generated, we insert padding here to keep the size
-    // of the Abort macro constant.
-    // Currently in debug mode with debug_code enabled the number of
-    // generated instructions is 10, so we use this as a maximum value.
-    static const int kExpectedAbortInstructions = 10;
-    int abort_instructions = InstructionsGeneratedSince(&abort_start);
-    DCHECK_LE(abort_instructions, kExpectedAbortInstructions);
-    while (abort_instructions++ < kExpectedAbortInstructions) {
-      nop();
-    }
-  }
-}
-
-void MacroAssembler::LoadNativeContextSlot(int index, Register dst) {
-  Ld(dst, NativeContextMemOperand());
-  Ld(dst, ContextMemOperand(dst, index));
-}
-
-
-void TurboAssembler::StubPrologue(StackFrame::Type type) {
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  li(scratch, Operand(StackFrame::TypeToMarker(type)));
-  PushCommonFrame(scratch);
-}
-
-void TurboAssembler::Prologue() { PushStandardFrame(a1); }
-
-void TurboAssembler::EnterFrame(StackFrame::Type type) {
-  int stack_offset, fp_offset;
-  if (type == StackFrame::INTERNAL) {
-    stack_offset = -4 * kPointerSize;
-    fp_offset = 2 * kPointerSize;
-  } else {
-    stack_offset = -3 * kPointerSize;
-    fp_offset = 1 * kPointerSize;
-  }
-  daddiu(sp, sp, stack_offset);
-  stack_offset = -stack_offset - kPointerSize;
-  Sd(ra, MemOperand(sp, stack_offset));
-  stack_offset -= kPointerSize;
-  Sd(fp, MemOperand(sp, stack_offset));
-  stack_offset -= kPointerSize;
-  li(t9, Operand(StackFrame::TypeToMarker(type)));
-  Sd(t9, MemOperand(sp, stack_offset));
-  if (type == StackFrame::INTERNAL) {
-    DCHECK_EQ(stack_offset, kPointerSize);
-    li(t9, Operand(CodeObject()));
-    Sd(t9, MemOperand(sp, 0));
-  } else {
-    DCHECK_EQ(stack_offset, 0);
-  }
-  // Adjust FP to point to saved FP.
-  Daddu(fp, sp, Operand(fp_offset));
-}
-
-void TurboAssembler::LeaveFrame(StackFrame::Type type) {
-  daddiu(sp, fp, 2 * kPointerSize);
-  Ld(ra, MemOperand(fp, 1 * kPointerSize));
-  Ld(fp, MemOperand(fp, 0 * kPointerSize));
-}
-
-void MacroAssembler::EnterBuiltinFrame(Register context, Register target,
-                                       Register argc) {
-  Push(ra, fp);
-  Move(fp, sp);
-  Push(context, target, argc);
-}
-
-void MacroAssembler::LeaveBuiltinFrame(Register context, Register target,
-                                       Register argc) {
-  Pop(context, target, argc);
-  Pop(ra, fp);
-}
-
-void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space,
-                                    StackFrame::Type frame_type) {
-  DCHECK(frame_type == StackFrame::EXIT ||
-         frame_type == StackFrame::BUILTIN_EXIT);
-
-  // Set up the frame structure on the stack.
-  STATIC_ASSERT(2 * kPointerSize == ExitFrameConstants::kCallerSPDisplacement);
-  STATIC_ASSERT(1 * kPointerSize == ExitFrameConstants::kCallerPCOffset);
-  STATIC_ASSERT(0 * kPointerSize == ExitFrameConstants::kCallerFPOffset);
-
-  // This is how the stack will look:
-  // fp + 2 (==kCallerSPDisplacement) - old stack's end
-  // [fp + 1 (==kCallerPCOffset)] - saved old ra
-  // [fp + 0 (==kCallerFPOffset)] - saved old fp
-  // [fp - 1 StackFrame::EXIT Smi
-  // [fp - 2 (==kSPOffset)] - sp of the called function
-  // [fp - 3 (==kCodeOffset)] - CodeObject
-  // fp - (2 + stack_space + alignment) == sp == [fp - kSPOffset] - top of the
-  //   new stack (will contain saved ra)
-
-  // Save registers and reserve room for saved entry sp and code object.
-  daddiu(sp, sp, -2 * kPointerSize - ExitFrameConstants::kFixedFrameSizeFromFp);
-  Sd(ra, MemOperand(sp, 4 * kPointerSize));
-  Sd(fp, MemOperand(sp, 3 * kPointerSize));
-  {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    li(scratch, Operand(StackFrame::TypeToMarker(frame_type)));
-    Sd(scratch, MemOperand(sp, 2 * kPointerSize));
-  }
-  // Set up new frame pointer.
-  daddiu(fp, sp, ExitFrameConstants::kFixedFrameSizeFromFp);
-
-  if (emit_debug_code()) {
-    Sd(zero_reg, MemOperand(fp, ExitFrameConstants::kSPOffset));
-  }
-
-  // Accessed from ExitFrame::code_slot.
-  li(t8, Operand(CodeObject()), CONSTANT_SIZE);
-  Sd(t8, MemOperand(fp, ExitFrameConstants::kCodeOffset));
-
-  // Save the frame pointer and the context in top.
-  li(t8,
-     Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, isolate())));
-  Sd(fp, MemOperand(t8));
-  li(t8,
-     Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate())));
-  Sd(cp, MemOperand(t8));
-
-  const int frame_alignment = MacroAssembler::ActivationFrameAlignment();
-  if (save_doubles) {
-    // The stack is already aligned to 0 modulo 8 for stores with sdc1.
-    int kNumOfSavedRegisters = FPURegister::kNumRegisters / 2;
-    int space = kNumOfSavedRegisters * kDoubleSize;
-    Dsubu(sp, sp, Operand(space));
-    // Remember: we only need to save every 2nd double FPU value.
-    for (int i = 0; i < kNumOfSavedRegisters; i++) {
-      FPURegister reg = FPURegister::from_code(2 * i);
-      Sdc1(reg, MemOperand(sp, i * kDoubleSize));
-    }
-  }
-
-  // Reserve place for the return address, stack space and an optional slot
-  // (used by the DirectCEntryStub to hold the return value if a struct is
-  // returned) and align the frame preparing for calling the runtime function.
-  DCHECK_GE(stack_space, 0);
-  Dsubu(sp, sp, Operand((stack_space + 2) * kPointerSize));
-  if (frame_alignment > 0) {
-    DCHECK(base::bits::IsPowerOfTwo(frame_alignment));
-    And(sp, sp, Operand(-frame_alignment));  // Align stack.
-  }
-
-  // Set the exit frame sp value to point just before the return address
-  // location.
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  daddiu(scratch, sp, kPointerSize);
-  Sd(scratch, MemOperand(fp, ExitFrameConstants::kSPOffset));
-}
-
-void MacroAssembler::LeaveExitFrame(bool save_doubles, Register argument_count,
-                                    bool do_return,
-                                    bool argument_count_is_length) {
-  // Optionally restore all double registers.
-  if (save_doubles) {
-    // Remember: we only need to restore every 2nd double FPU value.
-    int kNumOfSavedRegisters = FPURegister::kNumRegisters / 2;
-    Dsubu(t8, fp, Operand(ExitFrameConstants::kFixedFrameSizeFromFp +
-                          kNumOfSavedRegisters * kDoubleSize));
-    for (int i = 0; i < kNumOfSavedRegisters; i++) {
-      FPURegister reg = FPURegister::from_code(2 * i);
-      Ldc1(reg, MemOperand(t8, i * kDoubleSize));
-    }
-  }
-
-  // Clear top frame.
-  li(t8,
-     Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress, isolate())));
-  Sd(zero_reg, MemOperand(t8));
-
-  // Restore current context from top and clear it in debug mode.
-  li(t8,
-     Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate())));
-  Ld(cp, MemOperand(t8));
-
-#ifdef DEBUG
-  li(t8,
-     Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate())));
-  Sd(a3, MemOperand(t8));
-#endif
-
-  // Pop the arguments, restore registers, and return.
-  mov(sp, fp);  // Respect ABI stack constraint.
-  Ld(fp, MemOperand(sp, ExitFrameConstants::kCallerFPOffset));
-  Ld(ra, MemOperand(sp, ExitFrameConstants::kCallerPCOffset));
-
-  if (argument_count.is_valid()) {
-    if (argument_count_is_length) {
-      daddu(sp, sp, argument_count);
-    } else {
-      Dlsa(sp, sp, argument_count, kPointerSizeLog2, t8);
-    }
-  }
-
-  if (do_return) {
-    Ret(USE_DELAY_SLOT);
-    // If returning, the instruction in the delay slot will be the addiu below.
-  }
-  daddiu(sp, sp, 2 * kPointerSize);
-}
-
-int TurboAssembler::ActivationFrameAlignment() {
-#if V8_HOST_ARCH_MIPS || V8_HOST_ARCH_MIPS64
-  // Running on the real platform. Use the alignment as mandated by the local
-  // environment.
-  // Note: This will break if we ever start generating snapshots on one Mips
-  // platform for another Mips platform with a different alignment.
-  return base::OS::ActivationFrameAlignment();
-#else  // V8_HOST_ARCH_MIPS
-  // If we are using the simulator then we should always align to the expected
-  // alignment. As the simulator is used to generate snapshots we do not know
-  // if the target platform will need alignment, so this is controlled from a
-  // flag.
-  return FLAG_sim_stack_alignment;
-#endif  // V8_HOST_ARCH_MIPS
-}
-
-
-void MacroAssembler::AssertStackIsAligned() {
-  if (emit_debug_code()) {
-      const int frame_alignment = ActivationFrameAlignment();
-      const int frame_alignment_mask = frame_alignment - 1;
-
-      if (frame_alignment > kPointerSize) {
-        Label alignment_as_expected;
-        DCHECK(base::bits::IsPowerOfTwo(frame_alignment));
-        {
-          UseScratchRegisterScope temps(this);
-          Register scratch = temps.Acquire();
-          andi(scratch, sp, frame_alignment_mask);
-          Branch(&alignment_as_expected, eq, scratch, Operand(zero_reg));
-        }
-        // Don't use Check here, as it will call Runtime_Abort re-entering here.
-        stop("Unexpected stack alignment");
-        bind(&alignment_as_expected);
-      }
-    }
-}
-
-void MacroAssembler::SmiLoadUntag(Register dst, MemOperand src) {
-  if (SmiValuesAre32Bits()) {
-    Lw(dst, UntagSmiMemOperand(src.rm(), src.offset()));
-  } else {
-    Lw(dst, src);
-    SmiUntag(dst);
-  }
-}
-
-void MacroAssembler::UntagAndJumpIfSmi(Register dst,
-                                       Register src,
-                                       Label* smi_case) {
-  // DCHECK(dst!=src);
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  JumpIfSmi(src, smi_case, scratch, USE_DELAY_SLOT);
-  SmiUntag(dst, src);
-}
-
-void TurboAssembler::JumpIfSmi(Register value, Label* smi_label,
-                               Register scratch, BranchDelaySlot bd) {
-  DCHECK_EQ(0, kSmiTag);
-  andi(scratch, value, kSmiTagMask);
-  Branch(bd, smi_label, eq, scratch, Operand(zero_reg));
-}
-
-void MacroAssembler::JumpIfNotSmi(Register value,
-                                  Label* not_smi_label,
-                                  Register scratch,
-                                  BranchDelaySlot bd) {
-  DCHECK_EQ(0, kSmiTag);
-  andi(scratch, value, kSmiTagMask);
-  Branch(bd, not_smi_label, ne, scratch, Operand(zero_reg));
-}
-
-
-void MacroAssembler::JumpIfEitherSmi(Register reg1,
-                                     Register reg2,
-                                     Label* on_either_smi) {
-  STATIC_ASSERT(kSmiTag == 0);
-  // TODO(plind): Find some better to fix this assert issue.
-#if defined(__APPLE__)
-  DCHECK_EQ(1, kSmiTagMask);
-#else
-  DCHECK_EQ((int64_t)1, kSmiTagMask);
-#endif
-  // Both Smi tags must be 1 (not Smi).
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  and_(scratch, reg1, reg2);
-  JumpIfSmi(scratch, on_either_smi);
-}
-
-void MacroAssembler::AssertNotSmi(Register object) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    andi(scratch, object, kSmiTagMask);
-    Check(ne, AbortReason::kOperandIsASmi, scratch, Operand(zero_reg));
-  }
-}
-
-
-void MacroAssembler::AssertSmi(Register object) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    andi(scratch, object, kSmiTagMask);
-    Check(eq, AbortReason::kOperandIsASmi, scratch, Operand(zero_reg));
-  }
-}
-
-void MacroAssembler::AssertFixedArray(Register object) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    SmiTst(object, t8);
-    Check(ne, AbortReason::kOperandIsASmiAndNotAFixedArray, t8,
-          Operand(zero_reg));
-    GetObjectType(object, t8, t8);
-    Check(eq, AbortReason::kOperandIsNotAFixedArray, t8,
-          Operand(FIXED_ARRAY_TYPE));
-  }
-}
-
-void MacroAssembler::AssertFunction(Register object) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    SmiTst(object, t8);
-    Check(ne, AbortReason::kOperandIsASmiAndNotAFunction, t8,
-          Operand(zero_reg));
-    GetObjectType(object, t8, t8);
-    Check(eq, AbortReason::kOperandIsNotAFunction, t8,
-          Operand(JS_FUNCTION_TYPE));
-  }
-}
-
-
-void MacroAssembler::AssertBoundFunction(Register object) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    SmiTst(object, t8);
-    Check(ne, AbortReason::kOperandIsASmiAndNotABoundFunction, t8,
-          Operand(zero_reg));
-    GetObjectType(object, t8, t8);
-    Check(eq, AbortReason::kOperandIsNotABoundFunction, t8,
-          Operand(JS_BOUND_FUNCTION_TYPE));
-  }
-}
-
-void MacroAssembler::AssertGeneratorObject(Register object) {
-  if (!emit_debug_code()) return;
-  STATIC_ASSERT(kSmiTag == 0);
-  SmiTst(object, t8);
-  Check(ne, AbortReason::kOperandIsASmiAndNotAGeneratorObject, t8,
-        Operand(zero_reg));
-
-  GetObjectType(object, t8, t8);
-
-  Label done;
-
-  // Check if JSGeneratorObject
-  Branch(&done, eq, t8, Operand(JS_GENERATOR_OBJECT_TYPE));
-
-  // Check if JSAsyncGeneratorObject
-  Branch(&done, eq, t8, Operand(JS_ASYNC_GENERATOR_OBJECT_TYPE));
-
-  Abort(AbortReason::kOperandIsNotAGeneratorObject);
-
-  bind(&done);
-}
-
-void MacroAssembler::AssertUndefinedOrAllocationSite(Register object,
-                                                     Register scratch) {
-  if (emit_debug_code()) {
-    Label done_checking;
-    AssertNotSmi(object);
-    LoadRoot(scratch, Heap::kUndefinedValueRootIndex);
-    Branch(&done_checking, eq, object, Operand(scratch));
-    Ld(t8, FieldMemOperand(object, HeapObject::kMapOffset));
-    LoadRoot(scratch, Heap::kAllocationSiteMapRootIndex);
-    Assert(eq, AbortReason::kExpectedUndefinedOrCell, t8, Operand(scratch));
-    bind(&done_checking);
-  }
-}
-
-
-void TurboAssembler::Float32Max(FPURegister dst, FPURegister src1,
-                                FPURegister src2, Label* out_of_line) {
-  if (src1 == src2) {
-    Move_s(dst, src1);
-    return;
-  }
-
-  // Check if one of operands is NaN.
-  BranchF32(nullptr, out_of_line, eq, src1, src2);
-
-  if (kArchVariant >= kMips64r6) {
-    max_s(dst, src1, src2);
-  } else {
-    Label return_left, return_right, done;
-
-    BranchF32(&return_right, nullptr, lt, src1, src2);
-    BranchF32(&return_left, nullptr, lt, src2, src1);
-
-    // Operands are equal, but check for +/-0.
-    mfc1(t8, src1);
-    dsll32(t8, t8, 0);
-    Branch(&return_left, eq, t8, Operand(zero_reg));
-    Branch(&return_right);
-
-    bind(&return_right);
-    if (src2 != dst) {
-      Move_s(dst, src2);
-    }
-    Branch(&done);
-
-    bind(&return_left);
-    if (src1 != dst) {
-      Move_s(dst, src1);
-    }
-
-    bind(&done);
-  }
-}
-
-void TurboAssembler::Float32MaxOutOfLine(FPURegister dst, FPURegister src1,
-                                         FPURegister src2) {
-  add_s(dst, src1, src2);
-}
-
-void TurboAssembler::Float32Min(FPURegister dst, FPURegister src1,
-                                FPURegister src2, Label* out_of_line) {
-  if (src1 == src2) {
-    Move_s(dst, src1);
-    return;
-  }
-
-  // Check if one of operands is NaN.
-  BranchF32(nullptr, out_of_line, eq, src1, src2);
-
-  if (kArchVariant >= kMips64r6) {
-    min_s(dst, src1, src2);
-  } else {
-    Label return_left, return_right, done;
-
-    BranchF32(&return_left, nullptr, lt, src1, src2);
-    BranchF32(&return_right, nullptr, lt, src2, src1);
-
-    // Left equals right => check for -0.
-    mfc1(t8, src1);
-    dsll32(t8, t8, 0);
-    Branch(&return_right, eq, t8, Operand(zero_reg));
-    Branch(&return_left);
-
-    bind(&return_right);
-    if (src2 != dst) {
-      Move_s(dst, src2);
-    }
-    Branch(&done);
-
-    bind(&return_left);
-    if (src1 != dst) {
-      Move_s(dst, src1);
-    }
-
-    bind(&done);
-  }
-}
-
-void TurboAssembler::Float32MinOutOfLine(FPURegister dst, FPURegister src1,
-                                         FPURegister src2) {
-  add_s(dst, src1, src2);
-}
-
-void TurboAssembler::Float64Max(FPURegister dst, FPURegister src1,
-                                FPURegister src2, Label* out_of_line) {
-  if (src1 == src2) {
-    Move_d(dst, src1);
-    return;
-  }
-
-  // Check if one of operands is NaN.
-  BranchF64(nullptr, out_of_line, eq, src1, src2);
-
-  if (kArchVariant >= kMips64r6) {
-    max_d(dst, src1, src2);
-  } else {
-    Label return_left, return_right, done;
-
-    BranchF64(&return_right, nullptr, lt, src1, src2);
-    BranchF64(&return_left, nullptr, lt, src2, src1);
-
-    // Left equals right => check for -0.
-    dmfc1(t8, src1);
-    Branch(&return_left, eq, t8, Operand(zero_reg));
-    Branch(&return_right);
-
-    bind(&return_right);
-    if (src2 != dst) {
-      Move_d(dst, src2);
-    }
-    Branch(&done);
-
-    bind(&return_left);
-    if (src1 != dst) {
-      Move_d(dst, src1);
-    }
-
-    bind(&done);
-  }
-}
-
-void TurboAssembler::Float64MaxOutOfLine(FPURegister dst, FPURegister src1,
-                                         FPURegister src2) {
-  add_d(dst, src1, src2);
-}
-
-void TurboAssembler::Float64Min(FPURegister dst, FPURegister src1,
-                                FPURegister src2, Label* out_of_line) {
-  if (src1 == src2) {
-    Move_d(dst, src1);
-    return;
-  }
-
-  // Check if one of operands is NaN.
-  BranchF64(nullptr, out_of_line, eq, src1, src2);
-
-  if (kArchVariant >= kMips64r6) {
-    min_d(dst, src1, src2);
-  } else {
-    Label return_left, return_right, done;
-
-    BranchF64(&return_left, nullptr, lt, src1, src2);
-    BranchF64(&return_right, nullptr, lt, src2, src1);
-
-    // Left equals right => check for -0.
-    dmfc1(t8, src1);
-    Branch(&return_right, eq, t8, Operand(zero_reg));
-    Branch(&return_left);
-
-    bind(&return_right);
-    if (src2 != dst) {
-      Move_d(dst, src2);
-    }
-    Branch(&done);
-
-    bind(&return_left);
-    if (src1 != dst) {
-      Move_d(dst, src1);
-    }
-
-    bind(&done);
-  }
-}
-
-void TurboAssembler::Float64MinOutOfLine(FPURegister dst, FPURegister src1,
-                                         FPURegister src2) {
-  add_d(dst, src1, src2);
-}
-
-static const int kRegisterPassedArguments = 8;
-
-int TurboAssembler::CalculateStackPassedWords(int num_reg_arguments,
-                                              int num_double_arguments) {
-  int stack_passed_words = 0;
-  num_reg_arguments += 2 * num_double_arguments;
-
-  // O32: Up to four simple arguments are passed in registers a0..a3.
-  // N64: Up to eight simple arguments are passed in registers a0..a7.
-  if (num_reg_arguments > kRegisterPassedArguments) {
-    stack_passed_words += num_reg_arguments - kRegisterPassedArguments;
-  }
-  stack_passed_words += kCArgSlotCount;
-  return stack_passed_words;
-}
-
-void TurboAssembler::PrepareCallCFunction(int num_reg_arguments,
-                                          int num_double_arguments,
-                                          Register scratch) {
-  int frame_alignment = ActivationFrameAlignment();
-
-  // n64: Up to eight simple arguments in a0..a3, a4..a7, No argument slots.
-  // O32: Up to four simple arguments are passed in registers a0..a3.
-  // Those four arguments must have reserved argument slots on the stack for
-  // mips, even though those argument slots are not normally used.
-  // Both ABIs: Remaining arguments are pushed on the stack, above (higher
-  // address than) the (O32) argument slots. (arg slot calculation handled by
-  // CalculateStackPassedWords()).
-  int stack_passed_arguments = CalculateStackPassedWords(
-      num_reg_arguments, num_double_arguments);
-  if (frame_alignment > kPointerSize) {
-    // Make stack end at alignment and make room for num_arguments - 4 words
-    // and the original value of sp.
-    mov(scratch, sp);
-    Dsubu(sp, sp, Operand((stack_passed_arguments + 1) * kPointerSize));
-    DCHECK(base::bits::IsPowerOfTwo(frame_alignment));
-    And(sp, sp, Operand(-frame_alignment));
-    Sd(scratch, MemOperand(sp, stack_passed_arguments * kPointerSize));
-  } else {
-    Dsubu(sp, sp, Operand(stack_passed_arguments * kPointerSize));
-  }
-}
-
-void TurboAssembler::PrepareCallCFunction(int num_reg_arguments,
-                                          Register scratch) {
-  PrepareCallCFunction(num_reg_arguments, 0, scratch);
-}
-
-void TurboAssembler::CallCFunction(ExternalReference function,
-                                   int num_reg_arguments,
-                                   int num_double_arguments) {
-  li(t9, Operand(function));
-  CallCFunctionHelper(t9, num_reg_arguments, num_double_arguments);
-}
-
-void TurboAssembler::CallCFunction(Register function, int num_reg_arguments,
-                                   int num_double_arguments) {
-  CallCFunctionHelper(function, num_reg_arguments, num_double_arguments);
-}
-
-void TurboAssembler::CallCFunction(ExternalReference function,
-                                   int num_arguments) {
-  CallCFunction(function, num_arguments, 0);
-}
-
-void TurboAssembler::CallCFunction(Register function, int num_arguments) {
-  CallCFunction(function, num_arguments, 0);
-}
-
-void TurboAssembler::CallCFunctionHelper(Register function,
-                                         int num_reg_arguments,
-                                         int num_double_arguments) {
-  DCHECK_LE(num_reg_arguments + num_double_arguments, kMaxCParameters);
-  DCHECK(has_frame());
-  // Make sure that the stack is aligned before calling a C function unless
-  // running in the simulator. The simulator has its own alignment check which
-  // provides more information.
-  // The argument stots are presumed to have been set up by
-  // PrepareCallCFunction. The C function must be called via t9, for mips ABI.
-
-#if V8_HOST_ARCH_MIPS || V8_HOST_ARCH_MIPS64
-  if (emit_debug_code()) {
-    int frame_alignment = base::OS::ActivationFrameAlignment();
-    int frame_alignment_mask = frame_alignment - 1;
-    if (frame_alignment > kPointerSize) {
-      DCHECK(base::bits::IsPowerOfTwo(frame_alignment));
-      Label alignment_as_expected;
-      {
-        UseScratchRegisterScope temps(this);
-        Register scratch = temps.Acquire();
-        And(scratch, sp, Operand(frame_alignment_mask));
-        Branch(&alignment_as_expected, eq, scratch, Operand(zero_reg));
-      }
-      // Don't use Check here, as it will call Runtime_Abort possibly
-      // re-entering here.
-      stop("Unexpected alignment in CallCFunction");
-      bind(&alignment_as_expected);
-    }
-  }
-#endif  // V8_HOST_ARCH_MIPS
-
-  // Just call directly. The function called cannot cause a GC, or
-  // allow preemption, so the return address in the link register
-  // stays correct.
-
-  if (function != t9) {
-    mov(t9, function);
-    function = t9;
-  }
-
-  Call(function);
-
-  int stack_passed_arguments = CalculateStackPassedWords(
-      num_reg_arguments, num_double_arguments);
-
-  if (base::OS::ActivationFrameAlignment() > kPointerSize) {
-    Ld(sp, MemOperand(sp, stack_passed_arguments * kPointerSize));
-  } else {
-    Daddu(sp, sp, Operand(stack_passed_arguments * kPointerSize));
-  }
-}
-
-
-#undef BRANCH_ARGS_CHECK
-
-void TurboAssembler::CheckPageFlag(Register object, Register scratch, int mask,
-                                   Condition cc, Label* condition_met) {
-  And(scratch, object, Operand(~Page::kPageAlignmentMask));
-  Ld(scratch, MemOperand(scratch, MemoryChunk::kFlagsOffset));
-  And(scratch, scratch, Operand(mask));
-  Branch(condition_met, cc, scratch, Operand(zero_reg));
-}
-
-
-Register GetRegisterThatIsNotOneOf(Register reg1,
-                                   Register reg2,
-                                   Register reg3,
-                                   Register reg4,
-                                   Register reg5,
-                                   Register reg6) {
-  RegList regs = 0;
-  if (reg1.is_valid()) regs |= reg1.bit();
-  if (reg2.is_valid()) regs |= reg2.bit();
-  if (reg3.is_valid()) regs |= reg3.bit();
-  if (reg4.is_valid()) regs |= reg4.bit();
-  if (reg5.is_valid()) regs |= reg5.bit();
-  if (reg6.is_valid()) regs |= reg6.bit();
-
-  const RegisterConfiguration* config = RegisterConfiguration::Default();
-  for (int i = 0; i < config->num_allocatable_general_registers(); ++i) {
-    int code = config->GetAllocatableGeneralCode(i);
-    Register candidate = Register::from_code(code);
-    if (regs & candidate.bit()) continue;
-    return candidate;
-  }
-  UNREACHABLE();
-}
-
-bool AreAliased(Register reg1, Register reg2, Register reg3, Register reg4,
-                Register reg5, Register reg6, Register reg7, Register reg8,
-                Register reg9, Register reg10) {
-  int n_of_valid_regs = reg1.is_valid() + reg2.is_valid() + reg3.is_valid() +
-                        reg4.is_valid() + reg5.is_valid() + reg6.is_valid() +
-                        reg7.is_valid() + reg8.is_valid() + reg9.is_valid() +
-                        reg10.is_valid();
-
-  RegList regs = 0;
-  if (reg1.is_valid()) regs |= reg1.bit();
-  if (reg2.is_valid()) regs |= reg2.bit();
-  if (reg3.is_valid()) regs |= reg3.bit();
-  if (reg4.is_valid()) regs |= reg4.bit();
-  if (reg5.is_valid()) regs |= reg5.bit();
-  if (reg6.is_valid()) regs |= reg6.bit();
-  if (reg7.is_valid()) regs |= reg7.bit();
-  if (reg8.is_valid()) regs |= reg8.bit();
-  if (reg9.is_valid()) regs |= reg9.bit();
-  if (reg10.is_valid()) regs |= reg10.bit();
-  int n_of_non_aliasing_regs = NumRegs(regs);
-
-  return n_of_valid_regs != n_of_non_aliasing_regs;
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_MIPS64
diff --git a/src/v8/src/mips64/macro-assembler-mips64.h b/src/v8/src/mips64/macro-assembler-mips64.h
deleted file mode 100644
index f89682d..0000000
--- a/src/v8/src/mips64/macro-assembler-mips64.h
+++ /dev/null
@@ -1,1304 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_MIPS_MACRO_ASSEMBLER_MIPS_H_
-#define V8_MIPS_MACRO_ASSEMBLER_MIPS_H_
-
-#include "src/assembler.h"
-#include "src/globals.h"
-#include "src/mips64/assembler-mips64.h"
-
-namespace v8 {
-namespace internal {
-
-// Give alias names to registers for calling conventions.
-constexpr Register kReturnRegister0 = v0;
-constexpr Register kReturnRegister1 = v1;
-constexpr Register kReturnRegister2 = a0;
-constexpr Register kJSFunctionRegister = a1;
-constexpr Register kContextRegister = s7;
-constexpr Register kAllocateSizeRegister = a0;
-constexpr Register kInterpreterAccumulatorRegister = v0;
-constexpr Register kInterpreterBytecodeOffsetRegister = t0;
-constexpr Register kInterpreterBytecodeArrayRegister = t1;
-constexpr Register kInterpreterDispatchTableRegister = t2;
-constexpr Register kJavaScriptCallArgCountRegister = a0;
-constexpr Register kJavaScriptCallNewTargetRegister = a3;
-constexpr Register kRuntimeCallFunctionRegister = a1;
-constexpr Register kRuntimeCallArgCountRegister = a0;
-
-// Forward declaration.
-class JumpTarget;
-
-// Reserved Register Usage Summary.
-//
-// Registers t8, t9, and at are reserved for use by the MacroAssembler.
-//
-// The programmer should know that the MacroAssembler may clobber these three,
-// but won't touch other registers except in special cases.
-//
-// Per the MIPS ABI, register t9 must be used for indirect function call
-// via 'jalr t9' or 'jr t9' instructions. This is relied upon by gcc when
-// trying to update gp register for position-independent-code. Whenever
-// MIPS generated code calls C code, it must be via t9 register.
-
-
-// Flags used for LeaveExitFrame function.
-enum LeaveExitFrameMode {
-  EMIT_RETURN = true,
-  NO_EMIT_RETURN = false
-};
-
-// Flags used for AllocateHeapNumber
-enum TaggingMode {
-  // Tag the result.
-  TAG_RESULT,
-  // Don't tag
-  DONT_TAG_RESULT
-};
-
-// Allow programmer to use Branch Delay Slot of Branches, Jumps, Calls.
-enum BranchDelaySlot {
-  USE_DELAY_SLOT,
-  PROTECT
-};
-
-// Flags used for the li macro-assembler function.
-enum LiFlags {
-  // If the constant value can be represented in just 16 bits, then
-  // optimize the li to use a single instruction, rather than lui/ori/dsll
-  // sequence. A number of other optimizations that emits less than
-  // maximum number of instructions exists.
-  OPTIMIZE_SIZE = 0,
-  // Always use 6 instructions (lui/ori/dsll sequence) for release 2 or 4
-  // instructions for release 6 (lui/ori/dahi/dati), even if the constant
-  // could be loaded with just one, so that this value is patchable later.
-  CONSTANT_SIZE = 1,
-  // For address loads only 4 instruction are required. Used to mark
-  // constant load that will be used as address without relocation
-  // information. It ensures predictable code size, so specific sites
-  // in code are patchable.
-  ADDRESS_LOAD = 2
-};
-
-enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET };
-enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK };
-enum RAStatus { kRAHasNotBeenSaved, kRAHasBeenSaved };
-
-Register GetRegisterThatIsNotOneOf(Register reg1,
-                                   Register reg2 = no_reg,
-                                   Register reg3 = no_reg,
-                                   Register reg4 = no_reg,
-                                   Register reg5 = no_reg,
-                                   Register reg6 = no_reg);
-
-bool AreAliased(Register reg1, Register reg2, Register reg3 = no_reg,
-                Register reg4 = no_reg, Register reg5 = no_reg,
-                Register reg6 = no_reg, Register reg7 = no_reg,
-                Register reg8 = no_reg, Register reg9 = no_reg,
-                Register reg10 = no_reg);
-
-
-// -----------------------------------------------------------------------------
-// Static helper functions.
-
-#if defined(V8_TARGET_LITTLE_ENDIAN)
-#define SmiWordOffset(offset) (offset + kPointerSize / 2)
-#else
-#define SmiWordOffset(offset) offset
-#endif
-
-
-inline MemOperand ContextMemOperand(Register context, int index) {
-  return MemOperand(context, Context::SlotOffset(index));
-}
-
-
-inline MemOperand NativeContextMemOperand() {
-  return ContextMemOperand(cp, Context::NATIVE_CONTEXT_INDEX);
-}
-
-
-// Generate a MemOperand for loading a field from an object.
-inline MemOperand FieldMemOperand(Register object, int offset) {
-  return MemOperand(object, offset - kHeapObjectTag);
-}
-
-
-inline MemOperand UntagSmiMemOperand(Register rm, int offset) {
-  // Assumes that Smis are shifted by 32 bits.
-  STATIC_ASSERT(kSmiShift == 32);
-  return MemOperand(rm, SmiWordOffset(offset));
-}
-
-
-inline MemOperand UntagSmiFieldMemOperand(Register rm, int offset) {
-  return UntagSmiMemOperand(rm, offset - kHeapObjectTag);
-}
-
-
-// Generate a MemOperand for storing arguments 5..N on the stack
-// when calling CallCFunction().
-// TODO(plind): Currently ONLY used for O32. Should be fixed for
-//              n64, and used in RegExp code, and other places
-//              with more than 8 arguments.
-inline MemOperand CFunctionArgumentOperand(int index) {
-  DCHECK_GT(index, kCArgSlotCount);
-  // Argument 5 takes the slot just past the four Arg-slots.
-  int offset = (index - 5) * kPointerSize + kCArgsSlotsSize;
-  return MemOperand(sp, offset);
-}
-
-class TurboAssembler : public Assembler {
- public:
-  TurboAssembler(Isolate* isolate, void* buffer, int buffer_size,
-                 CodeObjectRequired create_code_object);
-
-  void set_has_frame(bool value) { has_frame_ = value; }
-  bool has_frame() const { return has_frame_; }
-
-  Isolate* isolate() const { return isolate_; }
-
-  Handle<HeapObject> CodeObject() {
-    DCHECK(!code_object_.is_null());
-    return code_object_;
-  }
-
-  // Activation support.
-  void EnterFrame(StackFrame::Type type);
-  void EnterFrame(StackFrame::Type type, bool load_constant_pool_pointer_reg) {
-    // Out-of-line constant pool not implemented on mips.
-    UNREACHABLE();
-  }
-  void LeaveFrame(StackFrame::Type type);
-
-  // Generates function and stub prologue code.
-  void StubPrologue(StackFrame::Type type);
-  void Prologue();
-
-  void InitializeRootRegister() {
-    ExternalReference roots_array_start =
-        ExternalReference::roots_array_start(isolate());
-    li(kRootRegister, Operand(roots_array_start));
-  }
-
-  // Jump unconditionally to given label.
-  // We NEED a nop in the branch delay slot, as it used by v8, for example in
-  // CodeGenerator::ProcessDeferred().
-  // Currently the branch delay slot is filled by the MacroAssembler.
-  // Use rather b(Label) for code generation.
-  void jmp(Label* L) { Branch(L); }
-
-  // -------------------------------------------------------------------------
-  // Debugging.
-
-  // Calls Abort(msg) if the condition cc is not satisfied.
-  // Use --debug_code to enable.
-  void Assert(Condition cc, AbortReason reason, Register rs, Operand rt);
-
-  // Like Assert(), but always enabled.
-  void Check(Condition cc, AbortReason reason, Register rs, Operand rt);
-
-  // Print a message to stdout and abort execution.
-  void Abort(AbortReason msg);
-
-  inline bool AllowThisStubCall(CodeStub* stub);
-
-  // Arguments macros.
-#define COND_TYPED_ARGS Condition cond, Register r1, const Operand& r2
-#define COND_ARGS cond, r1, r2
-
-  // Cases when relocation is not needed.
-#define DECLARE_NORELOC_PROTOTYPE(Name, target_type) \
-  void Name(target_type target, BranchDelaySlot bd = PROTECT); \
-  inline void Name(BranchDelaySlot bd, target_type target) { \
-    Name(target, bd); \
-  } \
-  void Name(target_type target, \
-            COND_TYPED_ARGS, \
-            BranchDelaySlot bd = PROTECT); \
-  inline void Name(BranchDelaySlot bd, \
-                   target_type target, \
-                   COND_TYPED_ARGS) { \
-    Name(target, COND_ARGS, bd); \
-  }
-
-#define DECLARE_BRANCH_PROTOTYPES(Name)   \
-  DECLARE_NORELOC_PROTOTYPE(Name, Label*) \
-  DECLARE_NORELOC_PROTOTYPE(Name, int32_t)
-
-  DECLARE_BRANCH_PROTOTYPES(Branch)
-  DECLARE_BRANCH_PROTOTYPES(BranchAndLink)
-  DECLARE_BRANCH_PROTOTYPES(BranchShort)
-
-#undef DECLARE_BRANCH_PROTOTYPES
-#undef COND_TYPED_ARGS
-#undef COND_ARGS
-
-  // Wrapper functions for the different cmp/branch types.
-  inline void BranchF32(Label* target, Label* nan, Condition cc,
-                        FPURegister cmp1, FPURegister cmp2,
-                        BranchDelaySlot bd = PROTECT) {
-    BranchFCommon(S, target, nan, cc, cmp1, cmp2, bd);
-  }
-
-  inline void BranchF64(Label* target, Label* nan, Condition cc,
-                        FPURegister cmp1, FPURegister cmp2,
-                        BranchDelaySlot bd = PROTECT) {
-    BranchFCommon(D, target, nan, cc, cmp1, cmp2, bd);
-  }
-
-  // Alternate (inline) version for better readability with USE_DELAY_SLOT.
-  inline void BranchF64(BranchDelaySlot bd, Label* target, Label* nan,
-                        Condition cc, FPURegister cmp1, FPURegister cmp2) {
-    BranchF64(target, nan, cc, cmp1, cmp2, bd);
-  }
-
-  inline void BranchF32(BranchDelaySlot bd, Label* target, Label* nan,
-                        Condition cc, FPURegister cmp1, FPURegister cmp2) {
-    BranchF32(target, nan, cc, cmp1, cmp2, bd);
-  }
-
-  // Alias functions for backward compatibility.
-  inline void BranchF(Label* target, Label* nan, Condition cc, FPURegister cmp1,
-                      FPURegister cmp2, BranchDelaySlot bd = PROTECT) {
-    BranchF64(target, nan, cc, cmp1, cmp2, bd);
-  }
-
-  inline void BranchF(BranchDelaySlot bd, Label* target, Label* nan,
-                      Condition cc, FPURegister cmp1, FPURegister cmp2) {
-    BranchF64(bd, target, nan, cc, cmp1, cmp2);
-  }
-
-  void BranchMSA(Label* target, MSABranchDF df, MSABranchCondition cond,
-                 MSARegister wt, BranchDelaySlot bd = PROTECT);
-
-  void Branch(Label* L, Condition cond, Register rs, Heap::RootListIndex index,
-              BranchDelaySlot bdslot = PROTECT);
-
-  static int InstrCountForLi64Bit(int64_t value);
-  inline void LiLower32BitHelper(Register rd, Operand j);
-  void li_optimized(Register rd, Operand j, LiFlags mode = OPTIMIZE_SIZE);
-  // Load int32 in the rd register.
-  void li(Register rd, Operand j, LiFlags mode = OPTIMIZE_SIZE);
-  inline void li(Register rd, int64_t j, LiFlags mode = OPTIMIZE_SIZE) {
-    li(rd, Operand(j), mode);
-  }
-  void li(Register dst, Handle<HeapObject> value, LiFlags mode = OPTIMIZE_SIZE);
-
-  // Jump, Call, and Ret pseudo instructions implementing inter-working.
-#define COND_ARGS Condition cond = al, Register rs = zero_reg, \
-  const Operand& rt = Operand(zero_reg), BranchDelaySlot bd = PROTECT
-
-  void Jump(Register target, COND_ARGS);
-  void Jump(intptr_t target, RelocInfo::Mode rmode, COND_ARGS);
-  void Jump(Address target, RelocInfo::Mode rmode, COND_ARGS);
-  void Jump(Handle<Code> code, RelocInfo::Mode rmode, COND_ARGS);
-  static int CallSize(Register target, COND_ARGS);
-  void Call(Register target, COND_ARGS);
-  static int CallSize(Address target, RelocInfo::Mode rmode, COND_ARGS);
-  void Call(Address target, RelocInfo::Mode rmode, COND_ARGS);
-  int CallSize(Handle<Code> code,
-               RelocInfo::Mode rmode = RelocInfo::CODE_TARGET,
-               COND_ARGS);
-  void Call(Handle<Code> code,
-            RelocInfo::Mode rmode = RelocInfo::CODE_TARGET,
-            COND_ARGS);
-  void Call(Label* target);
-
-  void CallForDeoptimization(Address target, RelocInfo::Mode rmode) {
-    Call(target, rmode);
-  }
-
-  void Ret(COND_ARGS);
-  inline void Ret(BranchDelaySlot bd, Condition cond = al,
-    Register rs = zero_reg, const Operand& rt = Operand(zero_reg)) {
-    Ret(cond, rs, rt, bd);
-  }
-
-  // Emit code to discard a non-negative number of pointer-sized elements
-  // from the stack, clobbering only the sp register.
-  void Drop(int count,
-            Condition cond = cc_always,
-            Register reg = no_reg,
-            const Operand& op = Operand(no_reg));
-
-  // Trivial case of DropAndRet that utilizes the delay slot and only emits
-  // 2 instructions.
-  void DropAndRet(int drop);
-
-  void DropAndRet(int drop,
-                  Condition cond,
-                  Register reg,
-                  const Operand& op);
-
-  void Ld(Register rd, const MemOperand& rs);
-  void Sd(Register rd, const MemOperand& rs);
-
-  void push(Register src) {
-    Daddu(sp, sp, Operand(-kPointerSize));
-    Sd(src, MemOperand(sp, 0));
-  }
-  void Push(Register src) { push(src); }
-  void Push(Handle<HeapObject> handle);
-  void Push(Smi* smi);
-
-  // Push two registers. Pushes leftmost register first (to highest address).
-  void Push(Register src1, Register src2) {
-    Dsubu(sp, sp, Operand(2 * kPointerSize));
-    Sd(src1, MemOperand(sp, 1 * kPointerSize));
-    Sd(src2, MemOperand(sp, 0 * kPointerSize));
-  }
-
-  // Push three registers. Pushes leftmost register first (to highest address).
-  void Push(Register src1, Register src2, Register src3) {
-    Dsubu(sp, sp, Operand(3 * kPointerSize));
-    Sd(src1, MemOperand(sp, 2 * kPointerSize));
-    Sd(src2, MemOperand(sp, 1 * kPointerSize));
-    Sd(src3, MemOperand(sp, 0 * kPointerSize));
-  }
-
-  // Push four registers. Pushes leftmost register first (to highest address).
-  void Push(Register src1, Register src2, Register src3, Register src4) {
-    Dsubu(sp, sp, Operand(4 * kPointerSize));
-    Sd(src1, MemOperand(sp, 3 * kPointerSize));
-    Sd(src2, MemOperand(sp, 2 * kPointerSize));
-    Sd(src3, MemOperand(sp, 1 * kPointerSize));
-    Sd(src4, MemOperand(sp, 0 * kPointerSize));
-  }
-
-  // Push five registers. Pushes leftmost register first (to highest address).
-  void Push(Register src1, Register src2, Register src3, Register src4,
-            Register src5) {
-    Dsubu(sp, sp, Operand(5 * kPointerSize));
-    Sd(src1, MemOperand(sp, 4 * kPointerSize));
-    Sd(src2, MemOperand(sp, 3 * kPointerSize));
-    Sd(src3, MemOperand(sp, 2 * kPointerSize));
-    Sd(src4, MemOperand(sp, 1 * kPointerSize));
-    Sd(src5, MemOperand(sp, 0 * kPointerSize));
-  }
-
-  void Push(Register src, Condition cond, Register tst1, Register tst2) {
-    // Since we don't have conditional execution we use a Branch.
-    Branch(3, cond, tst1, Operand(tst2));
-    Dsubu(sp, sp, Operand(kPointerSize));
-    Sd(src, MemOperand(sp, 0));
-  }
-
-  void SaveRegisters(RegList registers);
-  void RestoreRegisters(RegList registers);
-
-  void CallRecordWriteStub(Register object, Register address,
-                           RememberedSetAction remembered_set_action,
-                           SaveFPRegsMode fp_mode);
-
-  // Push multiple registers on the stack.
-  // Registers are saved in numerical order, with higher numbered registers
-  // saved in higher memory addresses.
-  void MultiPush(RegList regs);
-  void MultiPushFPU(RegList regs);
-
-  // Calculate how much stack space (in bytes) are required to store caller
-  // registers excluding those specified in the arguments.
-  int RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode,
-                                      Register exclusion1 = no_reg,
-                                      Register exclusion2 = no_reg,
-                                      Register exclusion3 = no_reg) const;
-
-  // Push caller saved registers on the stack, and return the number of bytes
-  // stack pointer is adjusted.
-  int PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1 = no_reg,
-                      Register exclusion2 = no_reg,
-                      Register exclusion3 = no_reg);
-  // Restore caller saved registers from the stack, and return the number of
-  // bytes stack pointer is adjusted.
-  int PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1 = no_reg,
-                     Register exclusion2 = no_reg,
-                     Register exclusion3 = no_reg);
-
-  void pop(Register dst) {
-    Ld(dst, MemOperand(sp, 0));
-    Daddu(sp, sp, Operand(kPointerSize));
-  }
-  void Pop(Register dst) { pop(dst); }
-
-  // Pop two registers. Pops rightmost register first (from lower address).
-  void Pop(Register src1, Register src2) {
-    DCHECK(src1 != src2);
-    Ld(src2, MemOperand(sp, 0 * kPointerSize));
-    Ld(src1, MemOperand(sp, 1 * kPointerSize));
-    Daddu(sp, sp, 2 * kPointerSize);
-  }
-
-  // Pop three registers. Pops rightmost register first (from lower address).
-  void Pop(Register src1, Register src2, Register src3) {
-    Ld(src3, MemOperand(sp, 0 * kPointerSize));
-    Ld(src2, MemOperand(sp, 1 * kPointerSize));
-    Ld(src1, MemOperand(sp, 2 * kPointerSize));
-    Daddu(sp, sp, 3 * kPointerSize);
-  }
-
-  void Pop(uint32_t count = 1) { Daddu(sp, sp, Operand(count * kPointerSize)); }
-
-  // Pops multiple values from the stack and load them in the
-  // registers specified in regs. Pop order is the opposite as in MultiPush.
-  void MultiPop(RegList regs);
-  void MultiPopFPU(RegList regs);
-
-#define DEFINE_INSTRUCTION(instr)                          \
-  void instr(Register rd, Register rs, const Operand& rt); \
-  void instr(Register rd, Register rs, Register rt) {      \
-    instr(rd, rs, Operand(rt));                            \
-  }                                                        \
-  void instr(Register rs, Register rt, int32_t j) { instr(rs, rt, Operand(j)); }
-
-#define DEFINE_INSTRUCTION2(instr)                                 \
-  void instr(Register rs, const Operand& rt);                      \
-  void instr(Register rs, Register rt) { instr(rs, Operand(rt)); } \
-  void instr(Register rs, int32_t j) { instr(rs, Operand(j)); }
-
-  DEFINE_INSTRUCTION(Addu);
-  DEFINE_INSTRUCTION(Daddu);
-  DEFINE_INSTRUCTION(Div);
-  DEFINE_INSTRUCTION(Divu);
-  DEFINE_INSTRUCTION(Ddivu);
-  DEFINE_INSTRUCTION(Mod);
-  DEFINE_INSTRUCTION(Modu);
-  DEFINE_INSTRUCTION(Ddiv);
-  DEFINE_INSTRUCTION(Subu);
-  DEFINE_INSTRUCTION(Dsubu);
-  DEFINE_INSTRUCTION(Dmod);
-  DEFINE_INSTRUCTION(Dmodu);
-  DEFINE_INSTRUCTION(Mul);
-  DEFINE_INSTRUCTION(Mulh);
-  DEFINE_INSTRUCTION(Mulhu);
-  DEFINE_INSTRUCTION(Dmul);
-  DEFINE_INSTRUCTION(Dmulh);
-  DEFINE_INSTRUCTION2(Mult);
-  DEFINE_INSTRUCTION2(Dmult);
-  DEFINE_INSTRUCTION2(Multu);
-  DEFINE_INSTRUCTION2(Dmultu);
-  DEFINE_INSTRUCTION2(Div);
-  DEFINE_INSTRUCTION2(Ddiv);
-  DEFINE_INSTRUCTION2(Divu);
-  DEFINE_INSTRUCTION2(Ddivu);
-
-  DEFINE_INSTRUCTION(And);
-  DEFINE_INSTRUCTION(Or);
-  DEFINE_INSTRUCTION(Xor);
-  DEFINE_INSTRUCTION(Nor);
-  DEFINE_INSTRUCTION2(Neg);
-
-  DEFINE_INSTRUCTION(Slt);
-  DEFINE_INSTRUCTION(Sltu);
-
-  // MIPS32 R2 instruction macro.
-  DEFINE_INSTRUCTION(Ror);
-  DEFINE_INSTRUCTION(Dror);
-
-#undef DEFINE_INSTRUCTION
-#undef DEFINE_INSTRUCTION2
-#undef DEFINE_INSTRUCTION3
-
-  void SmiUntag(Register dst, Register src) {
-    if (SmiValuesAre32Bits()) {
-      STATIC_ASSERT(kSmiShift == 32);
-      dsra32(dst, src, 0);
-    } else {
-      sra(dst, src, kSmiTagSize);
-    }
-  }
-
-  void SmiUntag(Register reg) { SmiUntag(reg, reg); }
-
-  // Removes current frame and its arguments from the stack preserving
-  // the arguments and a return address pushed to the stack for the next call.
-  // Both |callee_args_count| and |caller_args_count_reg| do not include
-  // receiver. |callee_args_count| is not modified, |caller_args_count_reg|
-  // is trashed.
-  void PrepareForTailCall(const ParameterCount& callee_args_count,
-                          Register caller_args_count_reg, Register scratch0,
-                          Register scratch1);
-
-  int CalculateStackPassedWords(int num_reg_arguments,
-                                int num_double_arguments);
-
-  // Before calling a C-function from generated code, align arguments on stack
-  // and add space for the four mips argument slots.
-  // After aligning the frame, non-register arguments must be stored on the
-  // stack, after the argument-slots using helper: CFunctionArgumentOperand().
-  // The argument count assumes all arguments are word sized.
-  // Some compilers/platforms require the stack to be aligned when calling
-  // C++ code.
-  // Needs a scratch register to do some arithmetic. This register will be
-  // trashed.
-  void PrepareCallCFunction(int num_reg_arguments, int num_double_registers,
-                            Register scratch);
-  void PrepareCallCFunction(int num_reg_arguments, Register scratch);
-
-  // Arguments 1-4 are placed in registers a0 through a3 respectively.
-  // Arguments 5..n are stored to stack using following:
-  //  Sw(a4, CFunctionArgumentOperand(5));
-
-  // Calls a C function and cleans up the space for arguments allocated
-  // by PrepareCallCFunction. The called function is not allowed to trigger a
-  // garbage collection, since that might move the code and invalidate the
-  // return address (unless this is somehow accounted for by the called
-  // function).
-  void CallCFunction(ExternalReference function, int num_arguments);
-  void CallCFunction(Register function, int num_arguments);
-  void CallCFunction(ExternalReference function, int num_reg_arguments,
-                     int num_double_arguments);
-  void CallCFunction(Register function, int num_reg_arguments,
-                     int num_double_arguments);
-  void MovFromFloatResult(DoubleRegister dst);
-  void MovFromFloatParameter(DoubleRegister dst);
-
-  // There are two ways of passing double arguments on MIPS, depending on
-  // whether soft or hard floating point ABI is used. These functions
-  // abstract parameter passing for the three different ways we call
-  // C functions from generated code.
-  void MovToFloatParameter(DoubleRegister src);
-  void MovToFloatParameters(DoubleRegister src1, DoubleRegister src2);
-  void MovToFloatResult(DoubleRegister src);
-
-  // See comments at the beginning of CEntryStub::Generate.
-  inline void PrepareCEntryArgs(int num_args) { li(a0, num_args); }
-  inline void PrepareCEntryFunction(const ExternalReference& ref) {
-    li(a1, Operand(ref));
-  }
-
-  void CheckPageFlag(Register object, Register scratch, int mask, Condition cc,
-                     Label* condition_met);
-
-  void CallStubDelayed(CodeStub* stub, COND_ARGS);
-#undef COND_ARGS
-
-  void CallRuntimeDelayed(Zone* zone, Runtime::FunctionId fid,
-                          SaveFPRegsMode save_doubles = kDontSaveFPRegs,
-                          BranchDelaySlot bd = PROTECT);
-
-  // Performs a truncating conversion of a floating point number as used by
-  // the JS bitwise operations. See ECMA-262 9.5: ToInt32. Goes to 'done' if it
-  // succeeds, otherwise falls through if result is saturated. On return
-  // 'result' either holds answer, or is clobbered on fall through.
-  //
-  // Only public for the test code in test-code-stubs-arm.cc.
-  void TryInlineTruncateDoubleToI(Register result, DoubleRegister input,
-                                  Label* done);
-
-  // Performs a truncating conversion of a floating point number as used by
-  // the JS bitwise operations. See ECMA-262 9.5: ToInt32.
-  // Exits with 'result' holding the answer.
-  void TruncateDoubleToIDelayed(Zone* zone, Register result,
-                                DoubleRegister double_input);
-
-  // Conditional move.
-  void Movz(Register rd, Register rs, Register rt);
-  void Movn(Register rd, Register rs, Register rt);
-  void Movt(Register rd, Register rs, uint16_t cc = 0);
-  void Movf(Register rd, Register rs, uint16_t cc = 0);
-
-  void Clz(Register rd, Register rs);
-
-  // MIPS64 R2 instruction macro.
-  void Ext(Register rt, Register rs, uint16_t pos, uint16_t size);
-  void Dext(Register rt, Register rs, uint16_t pos, uint16_t size);
-  void Ins(Register rt, Register rs, uint16_t pos, uint16_t size);
-  void Dins(Register rt, Register rs, uint16_t pos, uint16_t size);
-  void ExtractBits(Register dest, Register source, Register pos, int size,
-                   bool sign_extend = false);
-  void InsertBits(Register dest, Register source, Register pos, int size);
-  void Neg_s(FPURegister fd, FPURegister fs);
-  void Neg_d(FPURegister fd, FPURegister fs);
-
-  // MIPS64 R6 instruction macros.
-  void Bovc(Register rt, Register rs, Label* L);
-  void Bnvc(Register rt, Register rs, Label* L);
-
-  // Convert single to unsigned word.
-  void Trunc_uw_s(FPURegister fd, FPURegister fs, FPURegister scratch);
-  void Trunc_uw_s(FPURegister fd, Register rs, FPURegister scratch);
-
-  // Change endianness
-  void ByteSwapSigned(Register dest, Register src, int operand_size);
-  void ByteSwapUnsigned(Register dest, Register src, int operand_size);
-
-  void Ulh(Register rd, const MemOperand& rs);
-  void Ulhu(Register rd, const MemOperand& rs);
-  void Ush(Register rd, const MemOperand& rs, Register scratch);
-
-  void Ulw(Register rd, const MemOperand& rs);
-  void Ulwu(Register rd, const MemOperand& rs);
-  void Usw(Register rd, const MemOperand& rs);
-
-  void Uld(Register rd, const MemOperand& rs);
-  void Usd(Register rd, const MemOperand& rs);
-
-  void Ulwc1(FPURegister fd, const MemOperand& rs, Register scratch);
-  void Uswc1(FPURegister fd, const MemOperand& rs, Register scratch);
-
-  void Uldc1(FPURegister fd, const MemOperand& rs, Register scratch);
-  void Usdc1(FPURegister fd, const MemOperand& rs, Register scratch);
-
-  void Lb(Register rd, const MemOperand& rs);
-  void Lbu(Register rd, const MemOperand& rs);
-  void Sb(Register rd, const MemOperand& rs);
-
-  void Lh(Register rd, const MemOperand& rs);
-  void Lhu(Register rd, const MemOperand& rs);
-  void Sh(Register rd, const MemOperand& rs);
-
-  void Lw(Register rd, const MemOperand& rs);
-  void Lwu(Register rd, const MemOperand& rs);
-  void Sw(Register rd, const MemOperand& rs);
-
-  void Lwc1(FPURegister fd, const MemOperand& src);
-  void Swc1(FPURegister fs, const MemOperand& dst);
-
-  void Ldc1(FPURegister fd, const MemOperand& src);
-  void Sdc1(FPURegister fs, const MemOperand& dst);
-
-  void Ll(Register rd, const MemOperand& rs);
-  void Sc(Register rd, const MemOperand& rs);
-
-  void Lld(Register rd, const MemOperand& rs);
-  void Scd(Register rd, const MemOperand& rs);
-
-  // Perform a floating-point min or max operation with the
-  // (IEEE-754-compatible) semantics of MIPS32's Release 6 MIN.fmt/MAX.fmt.
-  // Some cases, typically NaNs or +/-0.0, are expected to be rare and are
-  // handled in out-of-line code. The specific behaviour depends on supported
-  // instructions.
-  //
-  // These functions assume (and assert) that src1!=src2. It is permitted
-  // for the result to alias either input register.
-  void Float32Max(FPURegister dst, FPURegister src1, FPURegister src2,
-                  Label* out_of_line);
-  void Float32Min(FPURegister dst, FPURegister src1, FPURegister src2,
-                  Label* out_of_line);
-  void Float64Max(FPURegister dst, FPURegister src1, FPURegister src2,
-                  Label* out_of_line);
-  void Float64Min(FPURegister dst, FPURegister src1, FPURegister src2,
-                  Label* out_of_line);
-
-  // Generate out-of-line cases for the macros above.
-  void Float32MaxOutOfLine(FPURegister dst, FPURegister src1, FPURegister src2);
-  void Float32MinOutOfLine(FPURegister dst, FPURegister src1, FPURegister src2);
-  void Float64MaxOutOfLine(FPURegister dst, FPURegister src1, FPURegister src2);
-  void Float64MinOutOfLine(FPURegister dst, FPURegister src1, FPURegister src2);
-
-  bool IsDoubleZeroRegSet() { return has_double_zero_reg_set_; }
-
-  void mov(Register rd, Register rt) { or_(rd, rt, zero_reg); }
-
-  inline void Move(Register dst, Handle<HeapObject> handle) { li(dst, handle); }
-  inline void Move(Register dst, Smi* smi) { li(dst, Operand(smi)); }
-
-  inline void Move(Register dst, Register src) {
-    if (dst != src) {
-      mov(dst, src);
-    }
-  }
-
-  inline void Move(FPURegister dst, FPURegister src) { Move_d(dst, src); }
-
-  inline void Move(Register dst_low, Register dst_high, FPURegister src) {
-    mfc1(dst_low, src);
-    mfhc1(dst_high, src);
-  }
-
-  inline void Move(Register dst, FPURegister src) { dmfc1(dst, src); }
-
-  inline void Move(FPURegister dst, Register src) { dmtc1(src, dst); }
-
-  inline void FmoveHigh(Register dst_high, FPURegister src) {
-    mfhc1(dst_high, src);
-  }
-
-  inline void FmoveHigh(FPURegister dst, Register src_high) {
-    mthc1(src_high, dst);
-  }
-
-  inline void FmoveLow(Register dst_low, FPURegister src) {
-    mfc1(dst_low, src);
-  }
-
-  void FmoveLow(FPURegister dst, Register src_low);
-
-  inline void Move(FPURegister dst, Register src_low, Register src_high) {
-    mtc1(src_low, dst);
-    mthc1(src_high, dst);
-  }
-
-  inline void Move_d(FPURegister dst, FPURegister src) {
-    if (dst != src) {
-      mov_d(dst, src);
-    }
-  }
-
-  inline void Move_s(FPURegister dst, FPURegister src) {
-    if (dst != src) {
-      mov_s(dst, src);
-    }
-  }
-
-  void Move(FPURegister dst, float imm);
-  void Move(FPURegister dst, double imm);
-
-  inline void MulBranchOvf(Register dst, Register left, const Operand& right,
-                           Label* overflow_label, Register scratch = at) {
-    MulBranchOvf(dst, left, right, overflow_label, nullptr, scratch);
-  }
-
-  inline void MulBranchNoOvf(Register dst, Register left, const Operand& right,
-                             Label* no_overflow_label, Register scratch = at) {
-    MulBranchOvf(dst, left, right, nullptr, no_overflow_label, scratch);
-  }
-
-  void MulBranchOvf(Register dst, Register left, const Operand& right,
-                    Label* overflow_label, Label* no_overflow_label,
-                    Register scratch = at);
-
-  void MulBranchOvf(Register dst, Register left, Register right,
-                    Label* overflow_label, Label* no_overflow_label,
-                    Register scratch = at);
-
-  inline void DaddBranchOvf(Register dst, Register left, const Operand& right,
-                            Label* overflow_label, Register scratch = at) {
-    DaddBranchOvf(dst, left, right, overflow_label, nullptr, scratch);
-  }
-
-  inline void DaddBranchNoOvf(Register dst, Register left, const Operand& right,
-                              Label* no_overflow_label, Register scratch = at) {
-    DaddBranchOvf(dst, left, right, nullptr, no_overflow_label, scratch);
-  }
-
-  void DaddBranchOvf(Register dst, Register left, const Operand& right,
-                     Label* overflow_label, Label* no_overflow_label,
-                     Register scratch = at);
-
-  void DaddBranchOvf(Register dst, Register left, Register right,
-                     Label* overflow_label, Label* no_overflow_label,
-                     Register scratch = at);
-
-  inline void DsubBranchOvf(Register dst, Register left, const Operand& right,
-                            Label* overflow_label, Register scratch = at) {
-    DsubBranchOvf(dst, left, right, overflow_label, nullptr, scratch);
-  }
-
-  inline void DsubBranchNoOvf(Register dst, Register left, const Operand& right,
-                              Label* no_overflow_label, Register scratch = at) {
-    DsubBranchOvf(dst, left, right, nullptr, no_overflow_label, scratch);
-  }
-
-  void DsubBranchOvf(Register dst, Register left, const Operand& right,
-                     Label* overflow_label, Label* no_overflow_label,
-                     Register scratch = at);
-
-  void DsubBranchOvf(Register dst, Register left, Register right,
-                     Label* overflow_label, Label* no_overflow_label,
-                     Register scratch = at);
-
-// Number of instructions needed for calculation of switch table entry address
-#ifdef _MIPS_ARCH_MIPS64R6
-  static const int kSwitchTablePrologueSize = 6;
-#else
-  static const int kSwitchTablePrologueSize = 11;
-#endif
-
-  // GetLabelFunction must be lambda '[](size_t index) -> Label*' or a
-  // functor/function with 'Label *func(size_t index)' declaration.
-  template <typename Func>
-  void GenerateSwitchTable(Register index, size_t case_count,
-                           Func GetLabelFunction);
-
-  // Load an object from the root table.
-  void LoadRoot(Register destination, Heap::RootListIndex index);
-  void LoadRoot(Register destination, Heap::RootListIndex index, Condition cond,
-                Register src1, const Operand& src2);
-
-  // If the value is a NaN, canonicalize the value else, do nothing.
-  void FPUCanonicalizeNaN(const DoubleRegister dst, const DoubleRegister src);
-
-  // ---------------------------------------------------------------------------
-  // FPU macros. These do not handle special cases like NaN or +- inf.
-
-  // Convert unsigned word to double.
-  void Cvt_d_uw(FPURegister fd, FPURegister fs);
-  void Cvt_d_uw(FPURegister fd, Register rs);
-
-  // Convert unsigned long to double.
-  void Cvt_d_ul(FPURegister fd, FPURegister fs);
-  void Cvt_d_ul(FPURegister fd, Register rs);
-
-  // Convert unsigned word to float.
-  void Cvt_s_uw(FPURegister fd, FPURegister fs);
-  void Cvt_s_uw(FPURegister fd, Register rs);
-
-  // Convert unsigned long to float.
-  void Cvt_s_ul(FPURegister fd, FPURegister fs);
-  void Cvt_s_ul(FPURegister fd, Register rs);
-
-  // Convert double to unsigned word.
-  void Trunc_uw_d(FPURegister fd, FPURegister fs, FPURegister scratch);
-  void Trunc_uw_d(FPURegister fd, Register rs, FPURegister scratch);
-
-  // Convert double to unsigned long.
-  void Trunc_ul_d(FPURegister fd, FPURegister fs, FPURegister scratch,
-                  Register result = no_reg);
-  void Trunc_ul_d(FPURegister fd, Register rs, FPURegister scratch,
-                  Register result = no_reg);
-
-  // Convert single to unsigned long.
-  void Trunc_ul_s(FPURegister fd, FPURegister fs, FPURegister scratch,
-                  Register result = no_reg);
-  void Trunc_ul_s(FPURegister fd, Register rs, FPURegister scratch,
-                  Register result = no_reg);
-
-  // Jump the register contains a smi.
-  void JumpIfSmi(Register value, Label* smi_label, Register scratch = at,
-                 BranchDelaySlot bd = PROTECT);
-
-  // Push a standard frame, consisting of ra, fp, context and JS function.
-  void PushStandardFrame(Register function_reg);
-
-  // Get the actual activation frame alignment for target environment.
-  static int ActivationFrameAlignment();
-
-  // Load Scaled Address instructions. Parameter sa (shift argument) must be
-  // between [1, 31] (inclusive). On pre-r6 architectures the scratch register
-  // may be clobbered.
-  void Lsa(Register rd, Register rs, Register rt, uint8_t sa,
-           Register scratch = at);
-  void Dlsa(Register rd, Register rs, Register rt, uint8_t sa,
-            Register scratch = at);
-
- protected:
-  inline Register GetRtAsRegisterHelper(const Operand& rt, Register scratch);
-  inline int32_t GetOffset(int32_t offset, Label* L, OffsetSize bits);
-
- private:
-  bool has_frame_ = false;
-  Isolate* const isolate_;
-  // This handle will be patched with the code object on installation.
-  Handle<HeapObject> code_object_;
-  bool has_double_zero_reg_set_;
-
-  void BranchShortMSA(MSABranchDF df, Label* target, MSABranchCondition cond,
-                      MSARegister wt, BranchDelaySlot bd = PROTECT);
-
-  void CallCFunctionHelper(Register function, int num_reg_arguments,
-                           int num_double_arguments);
-
-  bool CalculateOffset(Label* L, int32_t& offset, OffsetSize bits);
-  bool CalculateOffset(Label* L, int32_t& offset, OffsetSize bits,
-                       Register& scratch, const Operand& rt);
-
-  // Common implementation of BranchF functions for the different formats.
-  void BranchFCommon(SecondaryField sizeField, Label* target, Label* nan,
-                     Condition cc, FPURegister cmp1, FPURegister cmp2,
-                     BranchDelaySlot bd = PROTECT);
-
-  void BranchShortF(SecondaryField sizeField, Label* target, Condition cc,
-                    FPURegister cmp1, FPURegister cmp2,
-                    BranchDelaySlot bd = PROTECT);
-
-  void BranchShortHelperR6(int32_t offset, Label* L);
-  void BranchShortHelper(int16_t offset, Label* L, BranchDelaySlot bdslot);
-  bool BranchShortHelperR6(int32_t offset, Label* L, Condition cond,
-                           Register rs, const Operand& rt);
-  bool BranchShortHelper(int16_t offset, Label* L, Condition cond, Register rs,
-                         const Operand& rt, BranchDelaySlot bdslot);
-  bool BranchShortCheck(int32_t offset, Label* L, Condition cond, Register rs,
-                        const Operand& rt, BranchDelaySlot bdslot);
-
-  void BranchAndLinkShortHelperR6(int32_t offset, Label* L);
-  void BranchAndLinkShortHelper(int16_t offset, Label* L,
-                                BranchDelaySlot bdslot);
-  void BranchAndLinkShort(int32_t offset, BranchDelaySlot bdslot = PROTECT);
-  void BranchAndLinkShort(Label* L, BranchDelaySlot bdslot = PROTECT);
-  bool BranchAndLinkShortHelperR6(int32_t offset, Label* L, Condition cond,
-                                  Register rs, const Operand& rt);
-  bool BranchAndLinkShortHelper(int16_t offset, Label* L, Condition cond,
-                                Register rs, const Operand& rt,
-                                BranchDelaySlot bdslot);
-  bool BranchAndLinkShortCheck(int32_t offset, Label* L, Condition cond,
-                               Register rs, const Operand& rt,
-                               BranchDelaySlot bdslot);
-  void BranchLong(Label* L, BranchDelaySlot bdslot);
-  void BranchAndLinkLong(Label* L, BranchDelaySlot bdslot);
-
-  // Push a fixed frame, consisting of ra, fp.
-  void PushCommonFrame(Register marker_reg = no_reg);
-};
-
-// MacroAssembler implements a collection of frequently used macros.
-class MacroAssembler : public TurboAssembler {
- public:
-  MacroAssembler(Isolate* isolate, void* buffer, int size,
-                 CodeObjectRequired create_code_object);
-
-  bool IsNear(Label* L, Condition cond, int rs_reg);
-
-  // Swap two registers.  If the scratch register is omitted then a slightly
-  // less efficient form using xor instead of mov is emitted.
-  void Swap(Register reg1, Register reg2, Register scratch = no_reg);
-
-  void PushRoot(Heap::RootListIndex index) {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    LoadRoot(scratch, index);
-    Push(scratch);
-  }
-
-  // Compare the object in a register to a value and jump if they are equal.
-  void JumpIfRoot(Register with, Heap::RootListIndex index, Label* if_equal) {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    LoadRoot(scratch, index);
-    Branch(if_equal, eq, with, Operand(scratch));
-  }
-
-  // Compare the object in a register to a value and jump if they are not equal.
-  void JumpIfNotRoot(Register with, Heap::RootListIndex index,
-                     Label* if_not_equal) {
-    UseScratchRegisterScope temps(this);
-    Register scratch = temps.Acquire();
-    LoadRoot(scratch, index);
-    Branch(if_not_equal, ne, with, Operand(scratch));
-  }
-
-  // ---------------------------------------------------------------------------
-  // GC Support
-
-  // Notify the garbage collector that we wrote a pointer into an object.
-  // |object| is the object being stored into, |value| is the object being
-  // stored.  value and scratch registers are clobbered by the operation.
-  // The offset is the offset from the start of the object, not the offset from
-  // the tagged HeapObject pointer.  For use with FieldOperand(reg, off).
-  void RecordWriteField(
-      Register object, int offset, Register value, Register scratch,
-      RAStatus ra_status, SaveFPRegsMode save_fp,
-      RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
-      SmiCheck smi_check = INLINE_SMI_CHECK);
-
-  // For a given |object| notify the garbage collector that the slot |address|
-  // has been written.  |value| is the object being stored. The value and
-  // address registers are clobbered by the operation.
-  void RecordWrite(
-      Register object, Register address, Register value, RAStatus ra_status,
-      SaveFPRegsMode save_fp,
-      RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
-      SmiCheck smi_check = INLINE_SMI_CHECK);
-
-  void Pref(int32_t hint, const MemOperand& rs);
-
-  // ---------------------------------------------------------------------------
-  // Pseudo-instructions.
-
-  void LoadWordPair(Register rd, const MemOperand& rs, Register scratch = at);
-  void StoreWordPair(Register rd, const MemOperand& rs, Register scratch = at);
-
-  // Push and pop the registers that can hold pointers, as defined by the
-  // RegList constant kSafepointSavedRegisters.
-  void PushSafepointRegisters();
-  void PopSafepointRegisters();
-
-  // Convert double to unsigned long.
-  void Trunc_l_ud(FPURegister fd, FPURegister fs, FPURegister scratch);
-
-  void Trunc_l_d(FPURegister fd, FPURegister fs);
-  void Round_l_d(FPURegister fd, FPURegister fs);
-  void Floor_l_d(FPURegister fd, FPURegister fs);
-  void Ceil_l_d(FPURegister fd, FPURegister fs);
-
-  void Trunc_w_d(FPURegister fd, FPURegister fs);
-  void Round_w_d(FPURegister fd, FPURegister fs);
-  void Floor_w_d(FPURegister fd, FPURegister fs);
-  void Ceil_w_d(FPURegister fd, FPURegister fs);
-
-  void Madd_s(FPURegister fd, FPURegister fr, FPURegister fs, FPURegister ft,
-              FPURegister scratch);
-  void Madd_d(FPURegister fd, FPURegister fr, FPURegister fs, FPURegister ft,
-              FPURegister scratch);
-  void Msub_s(FPURegister fd, FPURegister fr, FPURegister fs, FPURegister ft,
-              FPURegister scratch);
-  void Msub_d(FPURegister fd, FPURegister fr, FPURegister fs, FPURegister ft,
-              FPURegister scratch);
-
-  void BranchShortMSA(MSABranchDF df, Label* target, MSABranchCondition cond,
-                      MSARegister wt, BranchDelaySlot bd = PROTECT);
-
-  // Truncates a double using a specific rounding mode, and writes the value
-  // to the result register.
-  // The except_flag will contain any exceptions caused by the instruction.
-  // If check_inexact is kDontCheckForInexactConversion, then the inexact
-  // exception is masked.
-  void EmitFPUTruncate(
-      FPURoundingMode rounding_mode, Register result,
-      DoubleRegister double_input, Register scratch,
-      DoubleRegister double_scratch, Register except_flag,
-      CheckForInexactConversion check_inexact = kDontCheckForInexactConversion);
-
-  // Enter exit frame.
-  // argc - argument count to be dropped by LeaveExitFrame.
-  // save_doubles - saves FPU registers on stack, currently disabled.
-  // stack_space - extra stack space.
-  void EnterExitFrame(bool save_doubles, int stack_space = 0,
-                      StackFrame::Type frame_type = StackFrame::EXIT);
-
-  // Leave the current exit frame.
-  void LeaveExitFrame(bool save_doubles, Register arg_count,
-                      bool do_return = NO_EMIT_RETURN,
-                      bool argument_count_is_length = false);
-
-  // Make sure the stack is aligned. Only emits code in debug mode.
-  void AssertStackIsAligned();
-
-  // Load the global proxy from the current context.
-  void LoadGlobalProxy(Register dst) {
-    LoadNativeContextSlot(Context::GLOBAL_PROXY_INDEX, dst);
-  }
-
-  void LoadNativeContextSlot(int index, Register dst);
-
-  // Load the initial map from the global function. The registers
-  // function and map can be the same, function is then overwritten.
-  void LoadGlobalFunctionInitialMap(Register function,
-                                    Register map,
-                                    Register scratch);
-
-  // -------------------------------------------------------------------------
-  // JavaScript invokes.
-
-  // Invoke the JavaScript function code by either calling or jumping.
-  void InvokeFunctionCode(Register function, Register new_target,
-                          const ParameterCount& expected,
-                          const ParameterCount& actual, InvokeFlag flag);
-
-  // On function call, call into the debugger if necessary.
-  void CheckDebugHook(Register fun, Register new_target,
-                      const ParameterCount& expected,
-                      const ParameterCount& actual);
-
-  // Invoke the JavaScript function in the given register. Changes the
-  // current context to the context in the function before invoking.
-  void InvokeFunction(Register function, Register new_target,
-                      const ParameterCount& actual, InvokeFlag flag);
-
-  void InvokeFunction(Register function, const ParameterCount& expected,
-                      const ParameterCount& actual, InvokeFlag flag);
-
-  void InvokeFunction(Handle<JSFunction> function,
-                      const ParameterCount& expected,
-                      const ParameterCount& actual, InvokeFlag flag);
-
-  // Frame restart support.
-  void MaybeDropFrames();
-
-  // Exception handling.
-
-  // Push a new stack handler and link into stack handler chain.
-  void PushStackHandler();
-
-  // Unlink the stack handler on top of the stack from the stack handler chain.
-  // Must preserve the result register.
-  void PopStackHandler();
-
-  // -------------------------------------------------------------------------
-  // Support functions.
-
-  void GetObjectType(Register function,
-                     Register map,
-                     Register type_reg);
-
-  // -------------------------------------------------------------------------
-  // Runtime calls.
-
-#define COND_ARGS Condition cond = al, Register rs = zero_reg, \
-const Operand& rt = Operand(zero_reg), BranchDelaySlot bd = PROTECT
-
-  // Call a code stub.
-  void CallStub(CodeStub* stub, COND_ARGS);
-
-  // Tail call a code stub (jump).
-  void TailCallStub(CodeStub* stub, COND_ARGS);
-
-#undef COND_ARGS
-
-  // Call a runtime routine.
-  void CallRuntime(const Runtime::Function* f, int num_arguments,
-                   SaveFPRegsMode save_doubles = kDontSaveFPRegs,
-                   BranchDelaySlot bd = PROTECT);
-
-  // Convenience function: Same as above, but takes the fid instead.
-  void CallRuntime(Runtime::FunctionId fid,
-                   SaveFPRegsMode save_doubles = kDontSaveFPRegs,
-                   BranchDelaySlot bd = PROTECT) {
-    const Runtime::Function* function = Runtime::FunctionForId(fid);
-    CallRuntime(function, function->nargs, save_doubles, bd);
-  }
-
-  // Convenience function: Same as above, but takes the fid instead.
-  void CallRuntime(Runtime::FunctionId fid, int num_arguments,
-                   SaveFPRegsMode save_doubles = kDontSaveFPRegs,
-                   BranchDelaySlot bd = PROTECT) {
-    CallRuntime(Runtime::FunctionForId(fid), num_arguments, save_doubles, bd);
-  }
-
-  // Convenience function: tail call a runtime routine (jump).
-  void TailCallRuntime(Runtime::FunctionId fid);
-
-  // Jump to the builtin routine.
-  void JumpToExternalReference(const ExternalReference& builtin,
-                               BranchDelaySlot bd = PROTECT,
-                               bool builtin_exit_frame = false);
-
-  // -------------------------------------------------------------------------
-  // StatsCounter support.
-
-  void IncrementCounter(StatsCounter* counter, int value,
-                        Register scratch1, Register scratch2);
-  void DecrementCounter(StatsCounter* counter, int value,
-                        Register scratch1, Register scratch2);
-
-  // -------------------------------------------------------------------------
-  // Smi utilities.
-
-  void SmiTag(Register dst, Register src) {
-    STATIC_ASSERT(kSmiTag == 0);
-    if (SmiValuesAre32Bits()) {
-      STATIC_ASSERT(kSmiShift == 32);
-      dsll32(dst, src, 0);
-    } else {
-      Addu(dst, src, src);
-    }
-  }
-
-  void SmiTag(Register reg) {
-    SmiTag(reg, reg);
-  }
-
-  // Left-shifted from int32 equivalent of Smi.
-  void SmiScale(Register dst, Register src, int scale) {
-    if (SmiValuesAre32Bits()) {
-      // The int portion is upper 32-bits of 64-bit word.
-      dsra(dst, src, kSmiShift - scale);
-    } else {
-      DCHECK_GE(scale, kSmiTagSize);
-      sll(dst, src, scale - kSmiTagSize);
-    }
-  }
-
-  // Combine load with untagging or scaling.
-  void SmiLoadUntag(Register dst, MemOperand src);
-
-  // Test if the register contains a smi.
-  inline void SmiTst(Register value, Register scratch) {
-    And(scratch, value, Operand(kSmiTagMask));
-  }
-  // Untag the source value into destination and jump if source is a smi.
-  // Source and destination can be the same register.
-  void UntagAndJumpIfSmi(Register dst, Register src, Label* smi_case);
-
-  // Jump if the register contains a non-smi.
-  void JumpIfNotSmi(Register value,
-                    Label* not_smi_label,
-                    Register scratch = at,
-                    BranchDelaySlot bd = PROTECT);
-
-  // Jump if either of the registers contain a smi.
-  void JumpIfEitherSmi(Register reg1, Register reg2, Label* on_either_smi);
-
-  // Abort execution if argument is a smi, enabled via --debug-code.
-  void AssertNotSmi(Register object);
-  void AssertSmi(Register object);
-
-  // Abort execution if argument is not a FixedArray, enabled via --debug-code.
-  void AssertFixedArray(Register object);
-
-  // Abort execution if argument is not a JSFunction, enabled via --debug-code.
-  void AssertFunction(Register object);
-
-  // Abort execution if argument is not a JSBoundFunction,
-  // enabled via --debug-code.
-  void AssertBoundFunction(Register object);
-
-  // Abort execution if argument is not a JSGeneratorObject (or subclass),
-  // enabled via --debug-code.
-  void AssertGeneratorObject(Register object);
-
-  // Abort execution if argument is not undefined or an AllocationSite, enabled
-  // via --debug-code.
-  void AssertUndefinedOrAllocationSite(Register object, Register scratch);
-
-  template<typename Field>
-  void DecodeField(Register dst, Register src) {
-    Ext(dst, src, Field::kShift, Field::kSize);
-  }
-
-  template<typename Field>
-  void DecodeField(Register reg) {
-    DecodeField<Field>(reg, reg);
-  }
-
-  void EnterBuiltinFrame(Register context, Register target, Register argc);
-  void LeaveBuiltinFrame(Register context, Register target, Register argc);
-
- private:
-  // Helper functions for generating invokes.
-  void InvokePrologue(const ParameterCount& expected,
-                      const ParameterCount& actual, Label* done,
-                      bool* definitely_mismatches, InvokeFlag flag);
-
-  // Compute memory operands for safepoint stack slots.
-  static int SafepointRegisterStackIndex(int reg_code);
-
-  // Needs access to SafepointRegisterStackIndex for compiled frame
-  // traversal.
-  friend class StandardFrame;
-};
-
-template <typename Func>
-void TurboAssembler::GenerateSwitchTable(Register index, size_t case_count,
-                                         Func GetLabelFunction) {
-  // Ensure that dd-ed labels following this instruction use 8 bytes aligned
-  // addresses.
-  BlockTrampolinePoolFor(static_cast<int>(case_count) * 2 +
-                         kSwitchTablePrologueSize);
-  UseScratchRegisterScope temps(this);
-  Register scratch = temps.Acquire();
-  if (kArchVariant >= kMips64r6) {
-    // Opposite of Align(8) as we have odd number of instructions in this case.
-    if ((pc_offset() & 7) == 0) {
-      nop();
-    }
-    addiupc(scratch, 5);
-    Dlsa(scratch, scratch, index, kPointerSizeLog2);
-    Ld(scratch, MemOperand(scratch));
-  } else {
-    Label here;
-    Align(8);
-    push(ra);
-    bal(&here);
-    dsll(scratch, index, kPointerSizeLog2);  // Branch delay slot.
-    bind(&here);
-    daddu(scratch, scratch, ra);
-    pop(ra);
-    Ld(scratch, MemOperand(scratch, 6 * v8::internal::Assembler::kInstrSize));
-  }
-  jr(scratch);
-  nop();  // Branch delay slot nop.
-  for (size_t index = 0; index < case_count; ++index) {
-    dd(GetLabelFunction(index));
-  }
-}
-
-#define ACCESS_MASM(masm) masm->
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_
diff --git a/src/v8/src/mips64/simulator-mips64.cc b/src/v8/src/mips64/simulator-mips64.cc
deleted file mode 100644
index ebb8a76..0000000
--- a/src/v8/src/mips64/simulator-mips64.cc
+++ /dev/null
@@ -1,7497 +0,0 @@
-// Copyright 2011 the V8 project 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 <limits.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <cmath>
-
-#if V8_TARGET_ARCH_MIPS64
-
-#include "src/assembler-inl.h"
-#include "src/base/bits.h"
-#include "src/codegen.h"
-#include "src/disasm.h"
-#include "src/macro-assembler.h"
-#include "src/mips64/constants-mips64.h"
-#include "src/mips64/simulator-mips64.h"
-#include "src/ostreams.h"
-#include "src/runtime/runtime-utils.h"
-
-// Only build the simulator if not compiling for real MIPS hardware.
-#if defined(USE_SIMULATOR)
-
-namespace v8 {
-namespace internal {
-
-// Util functions.
-inline bool HaveSameSign(int64_t a, int64_t b) { return ((a ^ b) >= 0); }
-
-uint32_t get_fcsr_condition_bit(uint32_t cc) {
-  if (cc == 0) {
-    return 23;
-  } else {
-    return 24 + cc;
-  }
-}
-
-
-static int64_t MultiplyHighSigned(int64_t u, int64_t v) {
-  uint64_t u0, v0, w0;
-  int64_t u1, v1, w1, w2, t;
-
-  u0 = u & 0xFFFFFFFFL;
-  u1 = u >> 32;
-  v0 = v & 0xFFFFFFFFL;
-  v1 = v >> 32;
-
-  w0 = u0 * v0;
-  t = u1 * v0 + (w0 >> 32);
-  w1 = t & 0xFFFFFFFFL;
-  w2 = t >> 32;
-  w1 = u0 * v1 + w1;
-
-  return u1 * v1 + w2 + (w1 >> 32);
-}
-
-
-// This macro provides a platform independent use of sscanf. The reason for
-// SScanF not being implemented in a platform independent was through
-// ::v8::internal::OS in the same way as SNPrintF is that the Windows C Run-Time
-// Library does not provide vsscanf.
-#define SScanF sscanf  // NOLINT
-
-// The MipsDebugger class is used by the simulator while debugging simulated
-// code.
-class MipsDebugger {
- public:
-  explicit MipsDebugger(Simulator* sim) : sim_(sim) { }
-
-  void Stop(Instruction* instr);
-  void Debug();
-  // Print all registers with a nice formatting.
-  void PrintAllRegs();
-  void PrintAllRegsIncludingFPU();
-
- private:
-  // We set the breakpoint code to 0xFFFFF to easily recognize it.
-  static const Instr kBreakpointInstr = SPECIAL | BREAK | 0xFFFFF << 6;
-  static const Instr kNopInstr =  0x0;
-
-  Simulator* sim_;
-
-  int64_t GetRegisterValue(int regnum);
-  int64_t GetFPURegisterValue(int regnum);
-  float GetFPURegisterValueFloat(int regnum);
-  double GetFPURegisterValueDouble(int regnum);
-  bool GetValue(const char* desc, int64_t* value);
-
-  // Set or delete a breakpoint. Returns true if successful.
-  bool SetBreakpoint(Instruction* breakpc);
-  bool DeleteBreakpoint(Instruction* breakpc);
-
-  // Undo and redo all breakpoints. This is needed to bracket disassembly and
-  // execution to skip past breakpoints when run from the debugger.
-  void UndoBreakpoints();
-  void RedoBreakpoints();
-};
-
-inline void UNSUPPORTED() { printf("Sim: Unsupported instruction.\n"); }
-
-void MipsDebugger::Stop(Instruction* instr) {
-  // Get the stop code.
-  uint32_t code = instr->Bits(25, 6);
-  PrintF("Simulator hit (%u)\n", code);
-  Debug();
-}
-
-int64_t MipsDebugger::GetRegisterValue(int regnum) {
-  if (regnum == kNumSimuRegisters) {
-    return sim_->get_pc();
-  } else {
-    return sim_->get_register(regnum);
-  }
-}
-
-
-int64_t MipsDebugger::GetFPURegisterValue(int regnum) {
-  if (regnum == kNumFPURegisters) {
-    return sim_->get_pc();
-  } else {
-    return sim_->get_fpu_register(regnum);
-  }
-}
-
-
-float MipsDebugger::GetFPURegisterValueFloat(int regnum) {
-  if (regnum == kNumFPURegisters) {
-    return sim_->get_pc();
-  } else {
-    return sim_->get_fpu_register_float(regnum);
-  }
-}
-
-
-double MipsDebugger::GetFPURegisterValueDouble(int regnum) {
-  if (regnum == kNumFPURegisters) {
-    return sim_->get_pc();
-  } else {
-    return sim_->get_fpu_register_double(regnum);
-  }
-}
-
-
-bool MipsDebugger::GetValue(const char* desc, int64_t* value) {
-  int regnum = Registers::Number(desc);
-  int fpuregnum = FPURegisters::Number(desc);
-
-  if (regnum != kInvalidRegister) {
-    *value = GetRegisterValue(regnum);
-    return true;
-  } else if (fpuregnum != kInvalidFPURegister) {
-    *value = GetFPURegisterValue(fpuregnum);
-    return true;
-  } else if (strncmp(desc, "0x", 2) == 0) {
-    return SScanF(desc + 2, "%" SCNx64,
-                  reinterpret_cast<uint64_t*>(value)) == 1;
-  } else {
-    return SScanF(desc, "%" SCNu64, reinterpret_cast<uint64_t*>(value)) == 1;
-  }
-  return false;
-}
-
-
-bool MipsDebugger::SetBreakpoint(Instruction* breakpc) {
-  // Check if a breakpoint can be set. If not return without any side-effects.
-  if (sim_->break_pc_ != nullptr) {
-    return false;
-  }
-
-  // Set the breakpoint.
-  sim_->break_pc_ = breakpc;
-  sim_->break_instr_ = breakpc->InstructionBits();
-  // Not setting the breakpoint instruction in the code itself. It will be set
-  // when the debugger shell continues.
-  return true;
-}
-
-
-bool MipsDebugger::DeleteBreakpoint(Instruction* breakpc) {
-  if (sim_->break_pc_ != nullptr) {
-    sim_->break_pc_->SetInstructionBits(sim_->break_instr_);
-  }
-
-  sim_->break_pc_ = nullptr;
-  sim_->break_instr_ = 0;
-  return true;
-}
-
-
-void MipsDebugger::UndoBreakpoints() {
-  if (sim_->break_pc_ != nullptr) {
-    sim_->break_pc_->SetInstructionBits(sim_->break_instr_);
-  }
-}
-
-
-void MipsDebugger::RedoBreakpoints() {
-  if (sim_->break_pc_ != nullptr) {
-    sim_->break_pc_->SetInstructionBits(kBreakpointInstr);
-  }
-}
-
-
-void MipsDebugger::PrintAllRegs() {
-#define REG_INFO(n) Registers::Name(n), GetRegisterValue(n), GetRegisterValue(n)
-
-  PrintF("\n");
-  // at, v0, a0.
-  PrintF("%3s: 0x%016" PRIx64 " %14" PRId64 "\t%3s: 0x%016" PRIx64 " %14" PRId64
-         "\t%3s: 0x%016" PRIx64 " %14" PRId64 "\n",
-         REG_INFO(1), REG_INFO(2), REG_INFO(4));
-  // v1, a1.
-  PrintF("%34s\t%3s: 0x%016" PRIx64 "  %14" PRId64 " \t%3s: 0x%016" PRIx64
-         "  %14" PRId64 " \n",
-         "", REG_INFO(3), REG_INFO(5));
-  // a2.
-  PrintF("%34s\t%34s\t%3s: 0x%016" PRIx64 "  %14" PRId64 " \n", "", "",
-         REG_INFO(6));
-  // a3.
-  PrintF("%34s\t%34s\t%3s: 0x%016" PRIx64 "  %14" PRId64 " \n", "", "",
-         REG_INFO(7));
-  PrintF("\n");
-  // a4-t3, s0-s7
-  for (int i = 0; i < 8; i++) {
-    PrintF("%3s: 0x%016" PRIx64 "  %14" PRId64 " \t%3s: 0x%016" PRIx64
-           "  %14" PRId64 " \n",
-           REG_INFO(8 + i), REG_INFO(16 + i));
-  }
-  PrintF("\n");
-  // t8, k0, LO.
-  PrintF("%3s: 0x%016" PRIx64 "  %14" PRId64 " \t%3s: 0x%016" PRIx64
-         "  %14" PRId64 " \t%3s: 0x%016" PRIx64 "  %14" PRId64 " \n",
-         REG_INFO(24), REG_INFO(26), REG_INFO(32));
-  // t9, k1, HI.
-  PrintF("%3s: 0x%016" PRIx64 "  %14" PRId64 " \t%3s: 0x%016" PRIx64
-         "  %14" PRId64 " \t%3s: 0x%016" PRIx64 "  %14" PRId64 " \n",
-         REG_INFO(25), REG_INFO(27), REG_INFO(33));
-  // sp, fp, gp.
-  PrintF("%3s: 0x%016" PRIx64 "  %14" PRId64 " \t%3s: 0x%016" PRIx64
-         "  %14" PRId64 " \t%3s: 0x%016" PRIx64 "  %14" PRId64 " \n",
-         REG_INFO(29), REG_INFO(30), REG_INFO(28));
-  // pc.
-  PrintF("%3s: 0x%016" PRIx64 "  %14" PRId64 " \t%3s: 0x%016" PRIx64
-         "  %14" PRId64 " \n",
-         REG_INFO(31), REG_INFO(34));
-
-#undef REG_INFO
-#undef FPU_REG_INFO
-}
-
-
-void MipsDebugger::PrintAllRegsIncludingFPU() {
-#define FPU_REG_INFO(n) FPURegisters::Name(n), \
-        GetFPURegisterValue(n), \
-        GetFPURegisterValueDouble(n)
-
-  PrintAllRegs();
-
-  PrintF("\n\n");
-  // f0, f1, f2, ... f31.
-  // TODO(plind): consider printing 2 columns for space efficiency.
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(0));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(1));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(2));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(3));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(4));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(5));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(6));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(7));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(8));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(9));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(10));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(11));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(12));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(13));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(14));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(15));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(16));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(17));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(18));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(19));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(20));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(21));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(22));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(23));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(24));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(25));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(26));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(27));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(28));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(29));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(30));
-  PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n", FPU_REG_INFO(31));
-
-#undef REG_INFO
-#undef FPU_REG_INFO
-}
-
-
-void MipsDebugger::Debug() {
-  intptr_t last_pc = -1;
-  bool done = false;
-
-#define COMMAND_SIZE 63
-#define ARG_SIZE 255
-
-#define STR(a) #a
-#define XSTR(a) STR(a)
-
-  char cmd[COMMAND_SIZE + 1];
-  char arg1[ARG_SIZE + 1];
-  char arg2[ARG_SIZE + 1];
-  char* argv[3] = { cmd, arg1, arg2 };
-
-  // Make sure to have a proper terminating character if reaching the limit.
-  cmd[COMMAND_SIZE] = 0;
-  arg1[ARG_SIZE] = 0;
-  arg2[ARG_SIZE] = 0;
-
-  // Undo all set breakpoints while running in the debugger shell. This will
-  // make them invisible to all commands.
-  UndoBreakpoints();
-
-  while (!done && (sim_->get_pc() != Simulator::end_sim_pc)) {
-    if (last_pc != sim_->get_pc()) {
-      disasm::NameConverter converter;
-      disasm::Disassembler dasm(converter);
-      // Use a reasonably large buffer.
-      v8::internal::EmbeddedVector<char, 256> buffer;
-      dasm.InstructionDecode(buffer,
-                             reinterpret_cast<byte*>(sim_->get_pc()));
-      PrintF("  0x%016" PRIx64 "   %s\n", sim_->get_pc(), buffer.start());
-      last_pc = sim_->get_pc();
-    }
-    char* line = ReadLine("sim> ");
-    if (line == nullptr) {
-      break;
-    } else {
-      char* last_input = sim_->last_debugger_input();
-      if (strcmp(line, "\n") == 0 && last_input != nullptr) {
-        line = last_input;
-      } else {
-        // Ownership is transferred to sim_;
-        sim_->set_last_debugger_input(line);
-      }
-      // Use sscanf to parse the individual parts of the command line. At the
-      // moment no command expects more than two parameters.
-      int argc = SScanF(line,
-                        "%" XSTR(COMMAND_SIZE) "s "
-                        "%" XSTR(ARG_SIZE) "s "
-                        "%" XSTR(ARG_SIZE) "s",
-                        cmd, arg1, arg2);
-      if ((strcmp(cmd, "si") == 0) || (strcmp(cmd, "stepi") == 0)) {
-        Instruction* instr = reinterpret_cast<Instruction*>(sim_->get_pc());
-        if (!(instr->IsTrap()) ||
-            instr->InstructionBits() == rtCallRedirInstr) {
-          sim_->InstructionDecode(
-              reinterpret_cast<Instruction*>(sim_->get_pc()));
-        } else {
-          // Allow si to jump over generated breakpoints.
-          PrintF("/!\\ Jumping over generated breakpoint.\n");
-          sim_->set_pc(sim_->get_pc() + Instruction::kInstrSize);
-        }
-      } else if ((strcmp(cmd, "c") == 0) || (strcmp(cmd, "cont") == 0)) {
-        // Execute the one instruction we broke at with breakpoints disabled.
-        sim_->InstructionDecode(reinterpret_cast<Instruction*>(sim_->get_pc()));
-        // Leave the debugger shell.
-        done = true;
-      } else if ((strcmp(cmd, "p") == 0) || (strcmp(cmd, "print") == 0)) {
-        if (argc == 2) {
-          int64_t value;
-          double dvalue;
-          if (strcmp(arg1, "all") == 0) {
-            PrintAllRegs();
-          } else if (strcmp(arg1, "allf") == 0) {
-            PrintAllRegsIncludingFPU();
-          } else {
-            int regnum = Registers::Number(arg1);
-            int fpuregnum = FPURegisters::Number(arg1);
-
-            if (regnum != kInvalidRegister) {
-              value = GetRegisterValue(regnum);
-              PrintF("%s: 0x%08" PRIx64 "  %" PRId64 "  \n", arg1, value,
-                     value);
-            } else if (fpuregnum != kInvalidFPURegister) {
-              value = GetFPURegisterValue(fpuregnum);
-              dvalue = GetFPURegisterValueDouble(fpuregnum);
-              PrintF("%3s: 0x%016" PRIx64 "  %16.4e\n",
-                     FPURegisters::Name(fpuregnum), value, dvalue);
-            } else {
-              PrintF("%s unrecognized\n", arg1);
-            }
-          }
-        } else {
-          if (argc == 3) {
-            if (strcmp(arg2, "single") == 0) {
-              int64_t value;
-              float fvalue;
-              int fpuregnum = FPURegisters::Number(arg1);
-
-              if (fpuregnum != kInvalidFPURegister) {
-                value = GetFPURegisterValue(fpuregnum);
-                value &= 0xFFFFFFFFUL;
-                fvalue = GetFPURegisterValueFloat(fpuregnum);
-                PrintF("%s: 0x%08" PRIx64 "  %11.4e\n", arg1, value, fvalue);
-              } else {
-                PrintF("%s unrecognized\n", arg1);
-              }
-            } else {
-              PrintF("print <fpu register> single\n");
-            }
-          } else {
-            PrintF("print <register> or print <fpu register> single\n");
-          }
-        }
-      } else if ((strcmp(cmd, "po") == 0)
-                 || (strcmp(cmd, "printobject") == 0)) {
-        if (argc == 2) {
-          int64_t value;
-          OFStream os(stdout);
-          if (GetValue(arg1, &value)) {
-            Object* obj = reinterpret_cast<Object*>(value);
-            os << arg1 << ": \n";
-#ifdef DEBUG
-            obj->Print(os);
-            os << "\n";
-#else
-            os << Brief(obj) << "\n";
-#endif
-          } else {
-            os << arg1 << " unrecognized\n";
-          }
-        } else {
-          PrintF("printobject <value>\n");
-        }
-      } else if (strcmp(cmd, "stack") == 0 || strcmp(cmd, "mem") == 0) {
-        int64_t* cur = nullptr;
-        int64_t* end = nullptr;
-        int next_arg = 1;
-
-        if (strcmp(cmd, "stack") == 0) {
-          cur = reinterpret_cast<int64_t*>(sim_->get_register(Simulator::sp));
-        } else {  // Command "mem".
-          int64_t value;
-          if (!GetValue(arg1, &value)) {
-            PrintF("%s unrecognized\n", arg1);
-            continue;
-          }
-          cur = reinterpret_cast<int64_t*>(value);
-          next_arg++;
-        }
-
-        int64_t words;
-        if (argc == next_arg) {
-          words = 10;
-        } else {
-          if (!GetValue(argv[next_arg], &words)) {
-            words = 10;
-          }
-        }
-        end = cur + words;
-
-        while (cur < end) {
-          PrintF("  0x%012" PRIxPTR " :  0x%016" PRIx64 "  %14" PRId64 " ",
-                 reinterpret_cast<intptr_t>(cur), *cur, *cur);
-          HeapObject* obj = reinterpret_cast<HeapObject*>(*cur);
-          int64_t value = *cur;
-          Heap* current_heap = sim_->isolate_->heap();
-          if (((value & 1) == 0) ||
-              current_heap->ContainsSlow(obj->address())) {
-            PrintF(" (");
-            if ((value & 1) == 0) {
-              PrintF("smi %d", static_cast<int>(value >> 32));
-            } else {
-              obj->ShortPrint();
-            }
-            PrintF(")");
-          }
-          PrintF("\n");
-          cur++;
-        }
-
-      } else if ((strcmp(cmd, "disasm") == 0) ||
-                 (strcmp(cmd, "dpc") == 0) ||
-                 (strcmp(cmd, "di") == 0)) {
-        disasm::NameConverter converter;
-        disasm::Disassembler dasm(converter);
-        // Use a reasonably large buffer.
-        v8::internal::EmbeddedVector<char, 256> buffer;
-
-        byte* cur = nullptr;
-        byte* end = nullptr;
-
-        if (argc == 1) {
-          cur = reinterpret_cast<byte*>(sim_->get_pc());
-          end = cur + (10 * Instruction::kInstrSize);
-        } else if (argc == 2) {
-          int regnum = Registers::Number(arg1);
-          if (regnum != kInvalidRegister || strncmp(arg1, "0x", 2) == 0) {
-            // The argument is an address or a register name.
-            int64_t value;
-            if (GetValue(arg1, &value)) {
-              cur = reinterpret_cast<byte*>(value);
-              // Disassemble 10 instructions at <arg1>.
-              end = cur + (10 * Instruction::kInstrSize);
-            }
-          } else {
-            // The argument is the number of instructions.
-            int64_t value;
-            if (GetValue(arg1, &value)) {
-              cur = reinterpret_cast<byte*>(sim_->get_pc());
-              // Disassemble <arg1> instructions.
-              end = cur + (value * Instruction::kInstrSize);
-            }
-          }
-        } else {
-          int64_t value1;
-          int64_t value2;
-          if (GetValue(arg1, &value1) && GetValue(arg2, &value2)) {
-            cur = reinterpret_cast<byte*>(value1);
-            end = cur + (value2 * Instruction::kInstrSize);
-          }
-        }
-
-        while (cur < end) {
-          dasm.InstructionDecode(buffer, cur);
-          PrintF("  0x%08" PRIxPTR "   %s\n", reinterpret_cast<intptr_t>(cur),
-                 buffer.start());
-          cur += Instruction::kInstrSize;
-        }
-      } else if (strcmp(cmd, "gdb") == 0) {
-        PrintF("relinquishing control to gdb\n");
-        v8::base::OS::DebugBreak();
-        PrintF("regaining control from gdb\n");
-      } else if (strcmp(cmd, "break") == 0) {
-        if (argc == 2) {
-          int64_t value;
-          if (GetValue(arg1, &value)) {
-            if (!SetBreakpoint(reinterpret_cast<Instruction*>(value))) {
-              PrintF("setting breakpoint failed\n");
-            }
-          } else {
-            PrintF("%s unrecognized\n", arg1);
-          }
-        } else {
-          PrintF("break <address>\n");
-        }
-      } else if (strcmp(cmd, "del") == 0) {
-        if (!DeleteBreakpoint(nullptr)) {
-          PrintF("deleting breakpoint failed\n");
-        }
-      } else if (strcmp(cmd, "flags") == 0) {
-        PrintF("No flags on MIPS !\n");
-      } else if (strcmp(cmd, "stop") == 0) {
-        int64_t value;
-        intptr_t stop_pc = sim_->get_pc() -
-            2 * Instruction::kInstrSize;
-        Instruction* stop_instr = reinterpret_cast<Instruction*>(stop_pc);
-        Instruction* msg_address =
-          reinterpret_cast<Instruction*>(stop_pc +
-              Instruction::kInstrSize);
-        if ((argc == 2) && (strcmp(arg1, "unstop") == 0)) {
-          // Remove the current stop.
-          if (sim_->IsStopInstruction(stop_instr)) {
-            stop_instr->SetInstructionBits(kNopInstr);
-            msg_address->SetInstructionBits(kNopInstr);
-          } else {
-            PrintF("Not at debugger stop.\n");
-          }
-        } else if (argc == 3) {
-          // Print information about all/the specified breakpoint(s).
-          if (strcmp(arg1, "info") == 0) {
-            if (strcmp(arg2, "all") == 0) {
-              PrintF("Stop information:\n");
-              for (uint32_t i = kMaxWatchpointCode + 1;
-                   i <= kMaxStopCode;
-                   i++) {
-                sim_->PrintStopInfo(i);
-              }
-            } else if (GetValue(arg2, &value)) {
-              sim_->PrintStopInfo(value);
-            } else {
-              PrintF("Unrecognized argument.\n");
-            }
-          } else if (strcmp(arg1, "enable") == 0) {
-            // Enable all/the specified breakpoint(s).
-            if (strcmp(arg2, "all") == 0) {
-              for (uint32_t i = kMaxWatchpointCode + 1;
-                   i <= kMaxStopCode;
-                   i++) {
-                sim_->EnableStop(i);
-              }
-            } else if (GetValue(arg2, &value)) {
-              sim_->EnableStop(value);
-            } else {
-              PrintF("Unrecognized argument.\n");
-            }
-          } else if (strcmp(arg1, "disable") == 0) {
-            // Disable all/the specified breakpoint(s).
-            if (strcmp(arg2, "all") == 0) {
-              for (uint32_t i = kMaxWatchpointCode + 1;
-                   i <= kMaxStopCode;
-                   i++) {
-                sim_->DisableStop(i);
-              }
-            } else if (GetValue(arg2, &value)) {
-              sim_->DisableStop(value);
-            } else {
-              PrintF("Unrecognized argument.\n");
-            }
-          }
-        } else {
-          PrintF("Wrong usage. Use help command for more information.\n");
-        }
-      } else if ((strcmp(cmd, "stat") == 0) || (strcmp(cmd, "st") == 0)) {
-        // Print registers and disassemble.
-        PrintAllRegs();
-        PrintF("\n");
-
-        disasm::NameConverter converter;
-        disasm::Disassembler dasm(converter);
-        // Use a reasonably large buffer.
-        v8::internal::EmbeddedVector<char, 256> buffer;
-
-        byte* cur = nullptr;
-        byte* end = nullptr;
-
-        if (argc == 1) {
-          cur = reinterpret_cast<byte*>(sim_->get_pc());
-          end = cur + (10 * Instruction::kInstrSize);
-        } else if (argc == 2) {
-          int64_t value;
-          if (GetValue(arg1, &value)) {
-            cur = reinterpret_cast<byte*>(value);
-            // no length parameter passed, assume 10 instructions
-            end = cur + (10 * Instruction::kInstrSize);
-          }
-        } else {
-          int64_t value1;
-          int64_t value2;
-          if (GetValue(arg1, &value1) && GetValue(arg2, &value2)) {
-            cur = reinterpret_cast<byte*>(value1);
-            end = cur + (value2 * Instruction::kInstrSize);
-          }
-        }
-
-        while (cur < end) {
-          dasm.InstructionDecode(buffer, cur);
-          PrintF("  0x%08" PRIxPTR "   %s\n", reinterpret_cast<intptr_t>(cur),
-                 buffer.start());
-          cur += Instruction::kInstrSize;
-        }
-      } else if ((strcmp(cmd, "h") == 0) || (strcmp(cmd, "help") == 0)) {
-        PrintF("cont\n");
-        PrintF("  continue execution (alias 'c')\n");
-        PrintF("stepi\n");
-        PrintF("  step one instruction (alias 'si')\n");
-        PrintF("print <register>\n");
-        PrintF("  print register content (alias 'p')\n");
-        PrintF("  use register name 'all' to print all registers\n");
-        PrintF("printobject <register>\n");
-        PrintF("  print an object from a register (alias 'po')\n");
-        PrintF("stack [<words>]\n");
-        PrintF("  dump stack content, default dump 10 words)\n");
-        PrintF("mem <address> [<words>]\n");
-        PrintF("  dump memory content, default dump 10 words)\n");
-        PrintF("flags\n");
-        PrintF("  print flags\n");
-        PrintF("disasm [<instructions>]\n");
-        PrintF("disasm [<address/register>]\n");
-        PrintF("disasm [[<address/register>] <instructions>]\n");
-        PrintF("  disassemble code, default is 10 instructions\n");
-        PrintF("  from pc (alias 'di')\n");
-        PrintF("gdb\n");
-        PrintF("  enter gdb\n");
-        PrintF("break <address>\n");
-        PrintF("  set a break point on the address\n");
-        PrintF("del\n");
-        PrintF("  delete the breakpoint\n");
-        PrintF("stop feature:\n");
-        PrintF("  Description:\n");
-        PrintF("    Stops are debug instructions inserted by\n");
-        PrintF("    the Assembler::stop() function.\n");
-        PrintF("    When hitting a stop, the Simulator will\n");
-        PrintF("    stop and and give control to the Debugger.\n");
-        PrintF("    All stop codes are watched:\n");
-        PrintF("    - They can be enabled / disabled: the Simulator\n");
-        PrintF("       will / won't stop when hitting them.\n");
-        PrintF("    - The Simulator keeps track of how many times they \n");
-        PrintF("      are met. (See the info command.) Going over a\n");
-        PrintF("      disabled stop still increases its counter. \n");
-        PrintF("  Commands:\n");
-        PrintF("    stop info all/<code> : print infos about number <code>\n");
-        PrintF("      or all stop(s).\n");
-        PrintF("    stop enable/disable all/<code> : enables / disables\n");
-        PrintF("      all or number <code> stop(s)\n");
-        PrintF("    stop unstop\n");
-        PrintF("      ignore the stop instruction at the current location\n");
-        PrintF("      from now on\n");
-      } else {
-        PrintF("Unknown command: %s\n", cmd);
-      }
-    }
-  }
-
-  // Add all the breakpoints back to stop execution and enter the debugger
-  // shell when hit.
-  RedoBreakpoints();
-
-#undef COMMAND_SIZE
-#undef ARG_SIZE
-
-#undef STR
-#undef XSTR
-}
-
-
-static bool ICacheMatch(void* one, void* two) {
-  DCHECK_EQ(reinterpret_cast<intptr_t>(one) & CachePage::kPageMask, 0);
-  DCHECK_EQ(reinterpret_cast<intptr_t>(two) & CachePage::kPageMask, 0);
-  return one == two;
-}
-
-
-static uint32_t ICacheHash(void* key) {
-  return static_cast<uint32_t>(reinterpret_cast<uintptr_t>(key)) >> 2;
-}
-
-
-static bool AllOnOnePage(uintptr_t start, size_t size) {
-  intptr_t start_page = (start & ~CachePage::kPageMask);
-  intptr_t end_page = ((start + size) & ~CachePage::kPageMask);
-  return start_page == end_page;
-}
-
-
-void Simulator::set_last_debugger_input(char* input) {
-  DeleteArray(last_debugger_input_);
-  last_debugger_input_ = input;
-}
-
-void Simulator::SetRedirectInstruction(Instruction* instruction) {
-  instruction->SetInstructionBits(rtCallRedirInstr);
-}
-
-void Simulator::FlushICache(base::CustomMatcherHashMap* i_cache,
-                            void* start_addr, size_t size) {
-  int64_t start = reinterpret_cast<int64_t>(start_addr);
-  int64_t intra_line = (start & CachePage::kLineMask);
-  start -= intra_line;
-  size += intra_line;
-  size = ((size - 1) | CachePage::kLineMask) + 1;
-  int offset = (start & CachePage::kPageMask);
-  while (!AllOnOnePage(start, size - 1)) {
-    int bytes_to_flush = CachePage::kPageSize - offset;
-    FlushOnePage(i_cache, start, bytes_to_flush);
-    start += bytes_to_flush;
-    size -= bytes_to_flush;
-    DCHECK_EQ((int64_t)0, start & CachePage::kPageMask);
-    offset = 0;
-  }
-  if (size != 0) {
-    FlushOnePage(i_cache, start, size);
-  }
-}
-
-CachePage* Simulator::GetCachePage(base::CustomMatcherHashMap* i_cache,
-                                   void* page) {
-  base::HashMap::Entry* entry = i_cache->LookupOrInsert(page, ICacheHash(page));
-  if (entry->value == nullptr) {
-    CachePage* new_page = new CachePage();
-    entry->value = new_page;
-  }
-  return reinterpret_cast<CachePage*>(entry->value);
-}
-
-
-// Flush from start up to and not including start + size.
-void Simulator::FlushOnePage(base::CustomMatcherHashMap* i_cache,
-                             intptr_t start, size_t size) {
-  DCHECK_LE(size, CachePage::kPageSize);
-  DCHECK(AllOnOnePage(start, size - 1));
-  DCHECK_EQ(start & CachePage::kLineMask, 0);
-  DCHECK_EQ(size & CachePage::kLineMask, 0);
-  void* page = reinterpret_cast<void*>(start & (~CachePage::kPageMask));
-  int offset = (start & CachePage::kPageMask);
-  CachePage* cache_page = GetCachePage(i_cache, page);
-  char* valid_bytemap = cache_page->ValidityByte(offset);
-  memset(valid_bytemap, CachePage::LINE_INVALID, size >> CachePage::kLineShift);
-}
-
-void Simulator::CheckICache(base::CustomMatcherHashMap* i_cache,
-                            Instruction* instr) {
-  int64_t address = reinterpret_cast<int64_t>(instr);
-  void* page = reinterpret_cast<void*>(address & (~CachePage::kPageMask));
-  void* line = reinterpret_cast<void*>(address & (~CachePage::kLineMask));
-  int offset = (address & CachePage::kPageMask);
-  CachePage* cache_page = GetCachePage(i_cache, page);
-  char* cache_valid_byte = cache_page->ValidityByte(offset);
-  bool cache_hit = (*cache_valid_byte == CachePage::LINE_VALID);
-  char* cached_line = cache_page->CachedData(offset & ~CachePage::kLineMask);
-  if (cache_hit) {
-    // Check that the data in memory matches the contents of the I-cache.
-    CHECK_EQ(0, memcmp(reinterpret_cast<void*>(instr),
-                       cache_page->CachedData(offset),
-                       Instruction::kInstrSize));
-  } else {
-    // Cache miss.  Load memory into the cache.
-    memcpy(cached_line, line, CachePage::kLineLength);
-    *cache_valid_byte = CachePage::LINE_VALID;
-  }
-}
-
-
-Simulator::Simulator(Isolate* isolate) : isolate_(isolate) {
-  i_cache_ = isolate_->simulator_i_cache();
-  if (i_cache_ == nullptr) {
-    i_cache_ = new base::CustomMatcherHashMap(&ICacheMatch);
-    isolate_->set_simulator_i_cache(i_cache_);
-  }
-  // Set up simulator support first. Some of this information is needed to
-  // setup the architecture state.
-  stack_size_ = FLAG_sim_stack_size * KB;
-  stack_ = reinterpret_cast<char*>(malloc(stack_size_));
-  pc_modified_ = false;
-  icount_ = 0;
-  break_count_ = 0;
-  break_pc_ = nullptr;
-  break_instr_ = 0;
-
-  // Set up architecture state.
-  // All registers are initialized to zero to start with.
-  for (int i = 0; i < kNumSimuRegisters; i++) {
-    registers_[i] = 0;
-  }
-  for (int i = 0; i < kNumFPURegisters; i++) {
-    FPUregisters_[2 * i] = 0;
-    FPUregisters_[2 * i + 1] = 0;  // upper part for MSA ASE
-  }
-
-  if (kArchVariant == kMips64r6) {
-    FCSR_ = kFCSRNaN2008FlagMask;
-    MSACSR_ = 0;
-  } else {
-    FCSR_ = 0;
-  }
-
-  // The sp is initialized to point to the bottom (high address) of the
-  // allocated stack area. To be safe in potential stack underflows we leave
-  // some buffer below.
-  registers_[sp] = reinterpret_cast<int64_t>(stack_) + stack_size_ - 64;
-  // The ra and pc are initialized to a known bad value that will cause an
-  // access violation if the simulator ever tries to execute it.
-  registers_[pc] = bad_ra;
-  registers_[ra] = bad_ra;
-
-  last_debugger_input_ = nullptr;
-}
-
-
-Simulator::~Simulator() { free(stack_); }
-
-
-// Get the active Simulator for the current thread.
-Simulator* Simulator::current(Isolate* isolate) {
-  v8::internal::Isolate::PerIsolateThreadData* isolate_data =
-       isolate->FindOrAllocatePerThreadDataForThisThread();
-  DCHECK_NOT_NULL(isolate_data);
-  DCHECK_NOT_NULL(isolate_data);
-
-  Simulator* sim = isolate_data->simulator();
-  if (sim == nullptr) {
-    // TODO(146): delete the simulator object when a thread/isolate goes away.
-    sim = new Simulator(isolate);
-    isolate_data->set_simulator(sim);
-  }
-  return sim;
-}
-
-
-// Sets the register in the architecture state. It will also deal with updating
-// Simulator internal state for special registers such as PC.
-void Simulator::set_register(int reg, int64_t value) {
-  DCHECK((reg >= 0) && (reg < kNumSimuRegisters));
-  if (reg == pc) {
-    pc_modified_ = true;
-  }
-
-  // Zero register always holds 0.
-  registers_[reg] = (reg == 0) ? 0 : value;
-}
-
-
-void Simulator::set_dw_register(int reg, const int* dbl) {
-  DCHECK((reg >= 0) && (reg < kNumSimuRegisters));
-  registers_[reg] = dbl[1];
-  registers_[reg] = registers_[reg] << 32;
-  registers_[reg] += dbl[0];
-}
-
-
-void Simulator::set_fpu_register(int fpureg, int64_t value) {
-  DCHECK((fpureg >= 0) && (fpureg < kNumFPURegisters));
-  FPUregisters_[fpureg * 2] = value;
-}
-
-
-void Simulator::set_fpu_register_word(int fpureg, int32_t value) {
-  // Set ONLY lower 32-bits, leaving upper bits untouched.
-  DCHECK((fpureg >= 0) && (fpureg < kNumFPURegisters));
-  int32_t* pword;
-  if (kArchEndian == kLittle) {
-    pword = reinterpret_cast<int32_t*>(&FPUregisters_[fpureg * 2]);
-  } else {
-    pword = reinterpret_cast<int32_t*>(&FPUregisters_[fpureg * 2]) + 1;
-  }
-  *pword = value;
-}
-
-
-void Simulator::set_fpu_register_hi_word(int fpureg, int32_t value) {
-  // Set ONLY upper 32-bits, leaving lower bits untouched.
-  DCHECK((fpureg >= 0) && (fpureg < kNumFPURegisters));
-  int32_t* phiword;
-  if (kArchEndian == kLittle) {
-    phiword = (reinterpret_cast<int32_t*>(&FPUregisters_[fpureg * 2])) + 1;
-  } else {
-    phiword = reinterpret_cast<int32_t*>(&FPUregisters_[fpureg * 2]);
-  }
-  *phiword = value;
-}
-
-
-void Simulator::set_fpu_register_float(int fpureg, float value) {
-  DCHECK((fpureg >= 0) && (fpureg < kNumFPURegisters));
-  *bit_cast<float*>(&FPUregisters_[fpureg * 2]) = value;
-}
-
-
-void Simulator::set_fpu_register_double(int fpureg, double value) {
-  DCHECK((fpureg >= 0) && (fpureg < kNumFPURegisters));
-  *bit_cast<double*>(&FPUregisters_[fpureg * 2]) = value;
-}
-
-
-// Get the register from the architecture state. This function does handle
-// the special case of accessing the PC register.
-int64_t Simulator::get_register(int reg) const {
-  DCHECK((reg >= 0) && (reg < kNumSimuRegisters));
-  if (reg == 0)
-    return 0;
-  else
-    return registers_[reg] + ((reg == pc) ? Instruction::kPCReadOffset : 0);
-}
-
-
-double Simulator::get_double_from_register_pair(int reg) {
-  // TODO(plind): bad ABI stuff, refactor or remove.
-  DCHECK((reg >= 0) && (reg < kNumSimuRegisters) && ((reg % 2) == 0));
-
-  double dm_val = 0.0;
-  // Read the bits from the unsigned integer register_[] array
-  // into the double precision floating point value and return it.
-  char buffer[sizeof(registers_[0])];
-  memcpy(buffer, &registers_[reg], sizeof(registers_[0]));
-  memcpy(&dm_val, buffer, sizeof(registers_[0]));
-  return(dm_val);
-}
-
-
-int64_t Simulator::get_fpu_register(int fpureg) const {
-  DCHECK((fpureg >= 0) && (fpureg < kNumFPURegisters));
-  return FPUregisters_[fpureg * 2];
-}
-
-
-int32_t Simulator::get_fpu_register_word(int fpureg) const {
-  DCHECK((fpureg >= 0) && (fpureg < kNumFPURegisters));
-  return static_cast<int32_t>(FPUregisters_[fpureg * 2] & 0xFFFFFFFF);
-}
-
-
-int32_t Simulator::get_fpu_register_signed_word(int fpureg) const {
-  DCHECK((fpureg >= 0) && (fpureg < kNumFPURegisters));
-  return static_cast<int32_t>(FPUregisters_[fpureg * 2] & 0xFFFFFFFF);
-}
-
-
-int32_t Simulator::get_fpu_register_hi_word(int fpureg) const {
-  DCHECK((fpureg >= 0) && (fpureg < kNumFPURegisters));
-  return static_cast<int32_t>((FPUregisters_[fpureg * 2] >> 32) & 0xFFFFFFFF);
-}
-
-
-float Simulator::get_fpu_register_float(int fpureg) const {
-  DCHECK((fpureg >= 0) && (fpureg < kNumFPURegisters));
-  return *bit_cast<float*>(const_cast<int64_t*>(&FPUregisters_[fpureg * 2]));
-}
-
-
-double Simulator::get_fpu_register_double(int fpureg) const {
-  DCHECK((fpureg >= 0) && (fpureg < kNumFPURegisters));
-  return *bit_cast<double*>(&FPUregisters_[fpureg * 2]);
-}
-
-template <typename T>
-void Simulator::get_msa_register(int wreg, T* value) {
-  DCHECK((wreg >= 0) && (wreg < kNumMSARegisters));
-  memcpy(value, FPUregisters_ + wreg * 2, kSimd128Size);
-}
-
-template <typename T>
-void Simulator::set_msa_register(int wreg, const T* value) {
-  DCHECK((wreg >= 0) && (wreg < kNumMSARegisters));
-  memcpy(FPUregisters_ + wreg * 2, value, kSimd128Size);
-}
-
-// Runtime FP routines take up to two double arguments and zero
-// or one integer arguments. All are constructed here,
-// from a0-a3 or f12 and f13 (n64), or f14 (O32).
-void Simulator::GetFpArgs(double* x, double* y, int32_t* z) {
-  if (!IsMipsSoftFloatABI) {
-    const int fparg2 = 13;
-    *x = get_fpu_register_double(12);
-    *y = get_fpu_register_double(fparg2);
-    *z = static_cast<int32_t>(get_register(a2));
-  } else {
-  // TODO(plind): bad ABI stuff, refactor or remove.
-    // We use a char buffer to get around the strict-aliasing rules which
-    // otherwise allow the compiler to optimize away the copy.
-    char buffer[sizeof(*x)];
-    int32_t* reg_buffer = reinterpret_cast<int32_t*>(buffer);
-
-    // Registers a0 and a1 -> x.
-    reg_buffer[0] = get_register(a0);
-    reg_buffer[1] = get_register(a1);
-    memcpy(x, buffer, sizeof(buffer));
-    // Registers a2 and a3 -> y.
-    reg_buffer[0] = get_register(a2);
-    reg_buffer[1] = get_register(a3);
-    memcpy(y, buffer, sizeof(buffer));
-    // Register 2 -> z.
-    reg_buffer[0] = get_register(a2);
-    memcpy(z, buffer, sizeof(*z));
-  }
-}
-
-
-// The return value is either in v0/v1 or f0.
-void Simulator::SetFpResult(const double& result) {
-  if (!IsMipsSoftFloatABI) {
-    set_fpu_register_double(0, result);
-  } else {
-    char buffer[2 * sizeof(registers_[0])];
-    int64_t* reg_buffer = reinterpret_cast<int64_t*>(buffer);
-    memcpy(buffer, &result, sizeof(buffer));
-    // Copy result to v0 and v1.
-    set_register(v0, reg_buffer[0]);
-    set_register(v1, reg_buffer[1]);
-  }
-}
-
-
-// Helper functions for setting and testing the FCSR register's bits.
-void Simulator::set_fcsr_bit(uint32_t cc, bool value) {
-  if (value) {
-    FCSR_ |= (1 << cc);
-  } else {
-    FCSR_ &= ~(1 << cc);
-  }
-}
-
-
-bool Simulator::test_fcsr_bit(uint32_t cc) {
-  return FCSR_ & (1 << cc);
-}
-
-
-void Simulator::set_fcsr_rounding_mode(FPURoundingMode mode) {
-  FCSR_ |= mode & kFPURoundingModeMask;
-}
-
-void Simulator::set_msacsr_rounding_mode(FPURoundingMode mode) {
-  MSACSR_ |= mode & kFPURoundingModeMask;
-}
-
-unsigned int Simulator::get_fcsr_rounding_mode() {
-  return FCSR_ & kFPURoundingModeMask;
-}
-
-unsigned int Simulator::get_msacsr_rounding_mode() {
-  return MSACSR_ & kFPURoundingModeMask;
-}
-
-// Sets the rounding error codes in FCSR based on the result of the rounding.
-// Returns true if the operation was invalid.
-bool Simulator::set_fcsr_round_error(double original, double rounded) {
-  bool ret = false;
-  double max_int32 = std::numeric_limits<int32_t>::max();
-  double min_int32 = std::numeric_limits<int32_t>::min();
-
-  if (!std::isfinite(original) || !std::isfinite(rounded)) {
-    set_fcsr_bit(kFCSRInvalidOpFlagBit, true);
-    ret = true;
-  }
-
-  if (original != rounded) {
-    set_fcsr_bit(kFCSRInexactFlagBit, true);
-  }
-
-  if (rounded < DBL_MIN && rounded > -DBL_MIN && rounded != 0) {
-    set_fcsr_bit(kFCSRUnderflowFlagBit, true);
-    ret = true;
-  }
-
-  if (rounded > max_int32 || rounded < min_int32) {
-    set_fcsr_bit(kFCSROverflowFlagBit, true);
-    // The reference is not really clear but it seems this is required:
-    set_fcsr_bit(kFCSRInvalidOpFlagBit, true);
-    ret = true;
-  }
-
-  return ret;
-}
-
-
-// Sets the rounding error codes in FCSR based on the result of the rounding.
-// Returns true if the operation was invalid.
-bool Simulator::set_fcsr_round64_error(double original, double rounded) {
-  bool ret = false;
-  // The value of INT64_MAX (2^63-1) can't be represented as double exactly,
-  // loading the most accurate representation into max_int64, which is 2^63.
-  double max_int64 = std::numeric_limits<int64_t>::max();
-  double min_int64 = std::numeric_limits<int64_t>::min();
-
-  if (!std::isfinite(original) || !std::isfinite(rounded)) {
-    set_fcsr_bit(kFCSRInvalidOpFlagBit, true);
-    ret = true;
-  }
-
-  if (original != rounded) {
-    set_fcsr_bit(kFCSRInexactFlagBit, true);
-  }
-
-  if (rounded < DBL_MIN && rounded > -DBL_MIN && rounded != 0) {
-    set_fcsr_bit(kFCSRUnderflowFlagBit, true);
-    ret = true;
-  }
-
-  if (rounded >= max_int64 || rounded < min_int64) {
-    set_fcsr_bit(kFCSROverflowFlagBit, true);
-    // The reference is not really clear but it seems this is required:
-    set_fcsr_bit(kFCSRInvalidOpFlagBit, true);
-    ret = true;
-  }
-
-  return ret;
-}
-
-
-// Sets the rounding error codes in FCSR based on the result of the rounding.
-// Returns true if the operation was invalid.
-bool Simulator::set_fcsr_round_error(float original, float rounded) {
-  bool ret = false;
-  double max_int32 = std::numeric_limits<int32_t>::max();
-  double min_int32 = std::numeric_limits<int32_t>::min();
-
-  if (!std::isfinite(original) || !std::isfinite(rounded)) {
-    set_fcsr_bit(kFCSRInvalidOpFlagBit, true);
-    ret = true;
-  }
-
-  if (original != rounded) {
-    set_fcsr_bit(kFCSRInexactFlagBit, true);
-  }
-
-  if (rounded < FLT_MIN && rounded > -FLT_MIN && rounded != 0) {
-    set_fcsr_bit(kFCSRUnderflowFlagBit, true);
-    ret = true;
-  }
-
-  if (rounded > max_int32 || rounded < min_int32) {
-    set_fcsr_bit(kFCSROverflowFlagBit, true);
-    // The reference is not really clear but it seems this is required:
-    set_fcsr_bit(kFCSRInvalidOpFlagBit, true);
-    ret = true;
-  }
-
-  return ret;
-}
-
-void Simulator::set_fpu_register_word_invalid_result(float original,
-                                                     float rounded) {
-  if (FCSR_ & kFCSRNaN2008FlagMask) {
-    double max_int32 = std::numeric_limits<int32_t>::max();
-    double min_int32 = std::numeric_limits<int32_t>::min();
-    if (std::isnan(original)) {
-      set_fpu_register_word(fd_reg(), 0);
-    } else if (rounded > max_int32) {
-      set_fpu_register_word(fd_reg(), kFPUInvalidResult);
-    } else if (rounded < min_int32) {
-      set_fpu_register_word(fd_reg(), kFPUInvalidResultNegative);
-    } else {
-      UNREACHABLE();
-    }
-  } else {
-    set_fpu_register_word(fd_reg(), kFPUInvalidResult);
-  }
-}
-
-
-void Simulator::set_fpu_register_invalid_result(float original, float rounded) {
-  if (FCSR_ & kFCSRNaN2008FlagMask) {
-    double max_int32 = std::numeric_limits<int32_t>::max();
-    double min_int32 = std::numeric_limits<int32_t>::min();
-    if (std::isnan(original)) {
-      set_fpu_register(fd_reg(), 0);
-    } else if (rounded > max_int32) {
-      set_fpu_register(fd_reg(), kFPUInvalidResult);
-    } else if (rounded < min_int32) {
-      set_fpu_register(fd_reg(), kFPUInvalidResultNegative);
-    } else {
-      UNREACHABLE();
-    }
-  } else {
-    set_fpu_register(fd_reg(), kFPUInvalidResult);
-  }
-}
-
-
-void Simulator::set_fpu_register_invalid_result64(float original,
-                                                  float rounded) {
-  if (FCSR_ & kFCSRNaN2008FlagMask) {
-    // The value of INT64_MAX (2^63-1) can't be represented as double exactly,
-    // loading the most accurate representation into max_int64, which is 2^63.
-    double max_int64 = std::numeric_limits<int64_t>::max();
-    double min_int64 = std::numeric_limits<int64_t>::min();
-    if (std::isnan(original)) {
-      set_fpu_register(fd_reg(), 0);
-    } else if (rounded >= max_int64) {
-      set_fpu_register(fd_reg(), kFPU64InvalidResult);
-    } else if (rounded < min_int64) {
-      set_fpu_register(fd_reg(), kFPU64InvalidResultNegative);
-    } else {
-      UNREACHABLE();
-    }
-  } else {
-    set_fpu_register(fd_reg(), kFPU64InvalidResult);
-  }
-}
-
-
-void Simulator::set_fpu_register_word_invalid_result(double original,
-                                                     double rounded) {
-  if (FCSR_ & kFCSRNaN2008FlagMask) {
-    double max_int32 = std::numeric_limits<int32_t>::max();
-    double min_int32 = std::numeric_limits<int32_t>::min();
-    if (std::isnan(original)) {
-      set_fpu_register_word(fd_reg(), 0);
-    } else if (rounded > max_int32) {
-      set_fpu_register_word(fd_reg(), kFPUInvalidResult);
-    } else if (rounded < min_int32) {
-      set_fpu_register_word(fd_reg(), kFPUInvalidResultNegative);
-    } else {
-      UNREACHABLE();
-    }
-  } else {
-    set_fpu_register_word(fd_reg(), kFPUInvalidResult);
-  }
-}
-
-
-void Simulator::set_fpu_register_invalid_result(double original,
-                                                double rounded) {
-  if (FCSR_ & kFCSRNaN2008FlagMask) {
-    double max_int32 = std::numeric_limits<int32_t>::max();
-    double min_int32 = std::numeric_limits<int32_t>::min();
-    if (std::isnan(original)) {
-      set_fpu_register(fd_reg(), 0);
-    } else if (rounded > max_int32) {
-      set_fpu_register(fd_reg(), kFPUInvalidResult);
-    } else if (rounded < min_int32) {
-      set_fpu_register(fd_reg(), kFPUInvalidResultNegative);
-    } else {
-      UNREACHABLE();
-    }
-  } else {
-    set_fpu_register(fd_reg(), kFPUInvalidResult);
-  }
-}
-
-
-void Simulator::set_fpu_register_invalid_result64(double original,
-                                                  double rounded) {
-  if (FCSR_ & kFCSRNaN2008FlagMask) {
-    // The value of INT64_MAX (2^63-1) can't be represented as double exactly,
-    // loading the most accurate representation into max_int64, which is 2^63.
-    double max_int64 = std::numeric_limits<int64_t>::max();
-    double min_int64 = std::numeric_limits<int64_t>::min();
-    if (std::isnan(original)) {
-      set_fpu_register(fd_reg(), 0);
-    } else if (rounded >= max_int64) {
-      set_fpu_register(fd_reg(), kFPU64InvalidResult);
-    } else if (rounded < min_int64) {
-      set_fpu_register(fd_reg(), kFPU64InvalidResultNegative);
-    } else {
-      UNREACHABLE();
-    }
-  } else {
-    set_fpu_register(fd_reg(), kFPU64InvalidResult);
-  }
-}
-
-
-// Sets the rounding error codes in FCSR based on the result of the rounding.
-// Returns true if the operation was invalid.
-bool Simulator::set_fcsr_round64_error(float original, float rounded) {
-  bool ret = false;
-  // The value of INT64_MAX (2^63-1) can't be represented as double exactly,
-  // loading the most accurate representation into max_int64, which is 2^63.
-  double max_int64 = std::numeric_limits<int64_t>::max();
-  double min_int64 = std::numeric_limits<int64_t>::min();
-
-  if (!std::isfinite(original) || !std::isfinite(rounded)) {
-    set_fcsr_bit(kFCSRInvalidOpFlagBit, true);
-    ret = true;
-  }
-
-  if (original != rounded) {
-    set_fcsr_bit(kFCSRInexactFlagBit, true);
-  }
-
-  if (rounded < FLT_MIN && rounded > -FLT_MIN && rounded != 0) {
-    set_fcsr_bit(kFCSRUnderflowFlagBit, true);
-    ret = true;
-  }
-
-  if (rounded >= max_int64 || rounded < min_int64) {
-    set_fcsr_bit(kFCSROverflowFlagBit, true);
-    // The reference is not really clear but it seems this is required:
-    set_fcsr_bit(kFCSRInvalidOpFlagBit, true);
-    ret = true;
-  }
-
-  return ret;
-}
-
-
-// For cvt instructions only
-void Simulator::round_according_to_fcsr(double toRound, double& rounded,
-                                        int32_t& rounded_int, double fs) {
-  // 0 RN (round to nearest): Round a result to the nearest
-  // representable value; if the result is exactly halfway between
-  // two representable values, round to zero. Behave like round_w_d.
-
-  // 1 RZ (round toward zero): Round a result to the closest
-  // representable value whose absolute value is less than or
-  // equal to the infinitely accurate result. Behave like trunc_w_d.
-
-  // 2 RP (round up, or toward +infinity): Round a result to the
-  // next representable value up. Behave like ceil_w_d.
-
-  // 3 RN (round down, or toward −infinity): Round a result to
-  // the next representable value down. Behave like floor_w_d.
-  switch (FCSR_ & 3) {
-    case kRoundToNearest:
-      rounded = std::floor(fs + 0.5);
-      rounded_int = static_cast<int32_t>(rounded);
-      if ((rounded_int & 1) != 0 && rounded_int - fs == 0.5) {
-        // If the number is halfway between two integers,
-        // round to the even one.
-        rounded_int--;
-        rounded -= 1.;
-      }
-      break;
-    case kRoundToZero:
-      rounded = trunc(fs);
-      rounded_int = static_cast<int32_t>(rounded);
-      break;
-    case kRoundToPlusInf:
-      rounded = std::ceil(fs);
-      rounded_int = static_cast<int32_t>(rounded);
-      break;
-    case kRoundToMinusInf:
-      rounded = std::floor(fs);
-      rounded_int = static_cast<int32_t>(rounded);
-      break;
-  }
-}
-
-
-void Simulator::round64_according_to_fcsr(double toRound, double& rounded,
-                                          int64_t& rounded_int, double fs) {
-  // 0 RN (round to nearest): Round a result to the nearest
-  // representable value; if the result is exactly halfway between
-  // two representable values, round to zero. Behave like round_w_d.
-
-  // 1 RZ (round toward zero): Round a result to the closest
-  // representable value whose absolute value is less than or.
-  // equal to the infinitely accurate result. Behave like trunc_w_d.
-
-  // 2 RP (round up, or toward +infinity): Round a result to the
-  // next representable value up. Behave like ceil_w_d.
-
-  // 3 RN (round down, or toward −infinity): Round a result to
-  // the next representable value down. Behave like floor_w_d.
-  switch (FCSR_ & 3) {
-    case kRoundToNearest:
-      rounded = std::floor(fs + 0.5);
-      rounded_int = static_cast<int64_t>(rounded);
-      if ((rounded_int & 1) != 0 && rounded_int - fs == 0.5) {
-        // If the number is halfway between two integers,
-        // round to the even one.
-        rounded_int--;
-        rounded -= 1.;
-      }
-      break;
-    case kRoundToZero:
-      rounded = trunc(fs);
-      rounded_int = static_cast<int64_t>(rounded);
-      break;
-    case kRoundToPlusInf:
-      rounded = std::ceil(fs);
-      rounded_int = static_cast<int64_t>(rounded);
-      break;
-    case kRoundToMinusInf:
-      rounded = std::floor(fs);
-      rounded_int = static_cast<int64_t>(rounded);
-      break;
-  }
-}
-
-
-// for cvt instructions only
-void Simulator::round_according_to_fcsr(float toRound, float& rounded,
-                                        int32_t& rounded_int, float fs) {
-  // 0 RN (round to nearest): Round a result to the nearest
-  // representable value; if the result is exactly halfway between
-  // two representable values, round to zero. Behave like round_w_d.
-
-  // 1 RZ (round toward zero): Round a result to the closest
-  // representable value whose absolute value is less than or
-  // equal to the infinitely accurate result. Behave like trunc_w_d.
-
-  // 2 RP (round up, or toward +infinity): Round a result to the
-  // next representable value up. Behave like ceil_w_d.
-
-  // 3 RN (round down, or toward −infinity): Round a result to
-  // the next representable value down. Behave like floor_w_d.
-  switch (FCSR_ & 3) {
-    case kRoundToNearest:
-      rounded = std::floor(fs + 0.5);
-      rounded_int = static_cast<int32_t>(rounded);
-      if ((rounded_int & 1) != 0 && rounded_int - fs == 0.5) {
-        // If the number is halfway between two integers,
-        // round to the even one.
-        rounded_int--;
-        rounded -= 1.f;
-      }
-      break;
-    case kRoundToZero:
-      rounded = trunc(fs);
-      rounded_int = static_cast<int32_t>(rounded);
-      break;
-    case kRoundToPlusInf:
-      rounded = std::ceil(fs);
-      rounded_int = static_cast<int32_t>(rounded);
-      break;
-    case kRoundToMinusInf:
-      rounded = std::floor(fs);
-      rounded_int = static_cast<int32_t>(rounded);
-      break;
-  }
-}
-
-
-void Simulator::round64_according_to_fcsr(float toRound, float& rounded,
-                                          int64_t& rounded_int, float fs) {
-  // 0 RN (round to nearest): Round a result to the nearest
-  // representable value; if the result is exactly halfway between
-  // two representable values, round to zero. Behave like round_w_d.
-
-  // 1 RZ (round toward zero): Round a result to the closest
-  // representable value whose absolute value is less than or.
-  // equal to the infinitely accurate result. Behave like trunc_w_d.
-
-  // 2 RP (round up, or toward +infinity): Round a result to the
-  // next representable value up. Behave like ceil_w_d.
-
-  // 3 RN (round down, or toward −infinity): Round a result to
-  // the next representable value down. Behave like floor_w_d.
-  switch (FCSR_ & 3) {
-    case kRoundToNearest:
-      rounded = std::floor(fs + 0.5);
-      rounded_int = static_cast<int64_t>(rounded);
-      if ((rounded_int & 1) != 0 && rounded_int - fs == 0.5) {
-        // If the number is halfway between two integers,
-        // round to the even one.
-        rounded_int--;
-        rounded -= 1.f;
-      }
-      break;
-    case kRoundToZero:
-      rounded = trunc(fs);
-      rounded_int = static_cast<int64_t>(rounded);
-      break;
-    case kRoundToPlusInf:
-      rounded = std::ceil(fs);
-      rounded_int = static_cast<int64_t>(rounded);
-      break;
-    case kRoundToMinusInf:
-      rounded = std::floor(fs);
-      rounded_int = static_cast<int64_t>(rounded);
-      break;
-  }
-}
-
-template <typename T_fp, typename T_int>
-void Simulator::round_according_to_msacsr(T_fp toRound, T_fp& rounded,
-                                          T_int& rounded_int) {
-  // 0 RN (round to nearest): Round a result to the nearest
-  // representable value; if the result is exactly halfway between
-  // two representable values, round to zero. Behave like round_w_d.
-
-  // 1 RZ (round toward zero): Round a result to the closest
-  // representable value whose absolute value is less than or
-  // equal to the infinitely accurate result. Behave like trunc_w_d.
-
-  // 2 RP (round up, or toward +infinity): Round a result to the
-  // next representable value up. Behave like ceil_w_d.
-
-  // 3 RN (round down, or toward −infinity): Round a result to
-  // the next representable value down. Behave like floor_w_d.
-  switch (get_msacsr_rounding_mode()) {
-    case kRoundToNearest:
-      rounded = std::floor(toRound + 0.5);
-      rounded_int = static_cast<T_int>(rounded);
-      if ((rounded_int & 1) != 0 && rounded_int - toRound == 0.5) {
-        // If the number is halfway between two integers,
-        // round to the even one.
-        rounded_int--;
-        rounded -= 1.;
-      }
-      break;
-    case kRoundToZero:
-      rounded = trunc(toRound);
-      rounded_int = static_cast<T_int>(rounded);
-      break;
-    case kRoundToPlusInf:
-      rounded = std::ceil(toRound);
-      rounded_int = static_cast<T_int>(rounded);
-      break;
-    case kRoundToMinusInf:
-      rounded = std::floor(toRound);
-      rounded_int = static_cast<T_int>(rounded);
-      break;
-  }
-}
-
-// Raw access to the PC register.
-void Simulator::set_pc(int64_t value) {
-  pc_modified_ = true;
-  registers_[pc] = value;
-}
-
-
-bool Simulator::has_bad_pc() const {
-  return ((registers_[pc] == bad_ra) || (registers_[pc] == end_sim_pc));
-}
-
-
-// Raw access to the PC register without the special adjustment when reading.
-int64_t Simulator::get_pc() const {
-  return registers_[pc];
-}
-
-
-// The MIPS cannot do unaligned reads and writes.  On some MIPS platforms an
-// interrupt is caused.  On others it does a funky rotation thing.  For now we
-// simply disallow unaligned reads, but at some point we may want to move to
-// emulating the rotate behaviour.  Note that simulator runs have the runtime
-// system running directly on the host system and only generated code is
-// executed in the simulator.  Since the host is typically IA32 we will not
-// get the correct MIPS-like behaviour on unaligned accesses.
-
-// TODO(plind): refactor this messy debug code when we do unaligned access.
-void Simulator::DieOrDebug() {
-  if ((1)) {  // Flag for this was removed.
-    MipsDebugger dbg(this);
-    dbg.Debug();
-  } else {
-    base::OS::Abort();
-  }
-}
-
-void Simulator::TraceRegWr(int64_t value, TraceType t) {
-  if (::v8::internal::FLAG_trace_sim) {
-    union {
-      int64_t fmt_int64;
-      int32_t fmt_int32[2];
-      float fmt_float[2];
-      double fmt_double;
-    } v;
-    v.fmt_int64 = value;
-
-    switch (t) {
-      case WORD:
-        SNPrintF(trace_buf_, "%016" PRIx64 "    (%" PRId64 ")    int32:%" PRId32
-                             " uint32:%" PRIu32,
-                 v.fmt_int64, icount_, v.fmt_int32[0], v.fmt_int32[0]);
-        break;
-      case DWORD:
-        SNPrintF(trace_buf_, "%016" PRIx64 "    (%" PRId64 ")    int64:%" PRId64
-                             " uint64:%" PRIu64,
-                 value, icount_, value, value);
-        break;
-      case FLOAT:
-        SNPrintF(trace_buf_, "%016" PRIx64 "    (%" PRId64 ")    flt:%e",
-                 v.fmt_int64, icount_, v.fmt_float[0]);
-        break;
-      case DOUBLE:
-        SNPrintF(trace_buf_, "%016" PRIx64 "    (%" PRId64 ")    dbl:%e",
-                 v.fmt_int64, icount_, v.fmt_double);
-        break;
-      case FLOAT_DOUBLE:
-        SNPrintF(trace_buf_, "%016" PRIx64 "    (%" PRId64 ")    flt:%e dbl:%e",
-                 v.fmt_int64, icount_, v.fmt_float[0], v.fmt_double);
-        break;
-      case WORD_DWORD:
-        SNPrintF(trace_buf_,
-                 "%016" PRIx64 "    (%" PRId64 ")    int32:%" PRId32
-                 " uint32:%" PRIu32 " int64:%" PRId64 " uint64:%" PRIu64,
-                 v.fmt_int64, icount_, v.fmt_int32[0], v.fmt_int32[0],
-                 v.fmt_int64, v.fmt_int64);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  }
-}
-
-template <typename T>
-void Simulator::TraceMSARegWr(T* value, TraceType t) {
-  if (::v8::internal::FLAG_trace_sim) {
-    union {
-      uint8_t b[16];
-      uint16_t h[8];
-      uint32_t w[4];
-      uint64_t d[2];
-      float f[4];
-      double df[2];
-    } v;
-    memcpy(v.b, value, kSimd128Size);
-    switch (t) {
-      case BYTE:
-        SNPrintF(trace_buf_,
-                 "LO: %016" PRIx64 "  HI: %016" PRIx64 "    (%" PRIu64 ")",
-                 v.d[0], v.d[1], icount_);
-        break;
-      case HALF:
-        SNPrintF(trace_buf_,
-                 "LO: %016" PRIx64 "  HI: %016" PRIx64 "    (%" PRIu64 ")",
-                 v.d[0], v.d[1], icount_);
-        break;
-      case WORD:
-        SNPrintF(trace_buf_,
-                 "LO: %016" PRIx64 "  HI: %016" PRIx64 "    (%" PRIu64
-                 ")    int32[0..3]:%" PRId32 "  %" PRId32 "  %" PRId32
-                 "  %" PRId32,
-                 v.d[0], v.d[1], icount_, v.w[0], v.w[1], v.w[2], v.w[3]);
-        break;
-      case DWORD:
-        SNPrintF(trace_buf_,
-                 "LO: %016" PRIx64 "  HI: %016" PRIx64 "    (%" PRIu64 ")",
-                 v.d[0], v.d[1], icount_);
-        break;
-      case FLOAT:
-        SNPrintF(trace_buf_,
-                 "LO: %016" PRIx64 "  HI: %016" PRIx64 "    (%" PRIu64
-                 ")    flt[0..3]:%e  %e  %e  %e",
-                 v.d[0], v.d[1], icount_, v.f[0], v.f[1], v.f[2], v.f[3]);
-        break;
-      case DOUBLE:
-        SNPrintF(trace_buf_,
-                 "LO: %016" PRIx64 "  HI: %016" PRIx64 "    (%" PRIu64
-                 ")    dbl[0..1]:%e  %e",
-                 v.d[0], v.d[1], icount_, v.df[0], v.df[1]);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  }
-}
-
-template <typename T>
-void Simulator::TraceMSARegWr(T* value) {
-  if (::v8::internal::FLAG_trace_sim) {
-    union {
-      uint8_t b[kMSALanesByte];
-      uint16_t h[kMSALanesHalf];
-      uint32_t w[kMSALanesWord];
-      uint64_t d[kMSALanesDword];
-      float f[kMSALanesWord];
-      double df[kMSALanesDword];
-    } v;
-    memcpy(v.b, value, kMSALanesByte);
-
-    if (std::is_same<T, int32_t>::value) {
-      SNPrintF(trace_buf_,
-               "LO: %016" PRIx64 "  HI: %016" PRIx64 "    (%" PRIu64
-               ")    int32[0..3]:%" PRId32 "  %" PRId32 "  %" PRId32
-               "  %" PRId32,
-               v.d[0], v.d[1], icount_, v.w[0], v.w[1], v.w[2], v.w[3]);
-    } else if (std::is_same<T, float>::value) {
-      SNPrintF(trace_buf_,
-               "LO: %016" PRIx64 "  HI: %016" PRIx64 "    (%" PRIu64
-               ")    flt[0..3]:%e  %e  %e  %e",
-               v.d[0], v.d[1], icount_, v.f[0], v.f[1], v.f[2], v.f[3]);
-    } else if (std::is_same<T, double>::value) {
-      SNPrintF(trace_buf_,
-               "LO: %016" PRIx64 "  HI: %016" PRIx64 "    (%" PRIu64
-               ")    dbl[0..1]:%e  %e",
-               v.d[0], v.d[1], icount_, v.df[0], v.df[1]);
-    } else {
-      SNPrintF(trace_buf_,
-               "LO: %016" PRIx64 "  HI: %016" PRIx64 "    (%" PRIu64 ")",
-               v.d[0], v.d[1], icount_);
-    }
-  }
-}
-
-// TODO(plind): consider making icount_ printing a flag option.
-void Simulator::TraceMemRd(int64_t addr, int64_t value, TraceType t) {
-  if (::v8::internal::FLAG_trace_sim) {
-    union {
-      int64_t fmt_int64;
-      int32_t fmt_int32[2];
-      float fmt_float[2];
-      double fmt_double;
-    } v;
-    v.fmt_int64 = value;
-
-    switch (t) {
-      case WORD:
-        SNPrintF(trace_buf_, "%016" PRIx64 "  <-- [%016" PRIx64 "]    (%" PRId64
-                             ")    int32:%" PRId32 " uint32:%" PRIu32,
-                 v.fmt_int64, addr, icount_, v.fmt_int32[0], v.fmt_int32[0]);
-        break;
-      case DWORD:
-        SNPrintF(trace_buf_, "%016" PRIx64 "  <-- [%016" PRIx64 "]    (%" PRId64
-                             ")    int64:%" PRId64 " uint64:%" PRIu64,
-                 value, addr, icount_, value, value);
-        break;
-      case FLOAT:
-        SNPrintF(trace_buf_, "%016" PRIx64 "  <-- [%016" PRIx64 "]    (%" PRId64
-                             ")    flt:%e",
-                 v.fmt_int64, addr, icount_, v.fmt_float[0]);
-        break;
-      case DOUBLE:
-        SNPrintF(trace_buf_, "%016" PRIx64 "  <-- [%016" PRIx64 "]    (%" PRId64
-                             ")    dbl:%e",
-                 v.fmt_int64, addr, icount_, v.fmt_double);
-        break;
-      case FLOAT_DOUBLE:
-        SNPrintF(trace_buf_, "%016" PRIx64 "  <-- [%016" PRIx64 "]    (%" PRId64
-                             ")    flt:%e dbl:%e",
-                 v.fmt_int64, addr, icount_, v.fmt_float[0], v.fmt_double);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  }
-}
-
-
-void Simulator::TraceMemWr(int64_t addr, int64_t value, TraceType t) {
-  if (::v8::internal::FLAG_trace_sim) {
-    switch (t) {
-      case BYTE:
-        SNPrintF(trace_buf_, "               %02" PRIx8 " --> [%016" PRIx64
-                             "]    (%" PRId64 ")",
-                 static_cast<uint8_t>(value), addr, icount_);
-        break;
-      case HALF:
-        SNPrintF(trace_buf_, "            %04" PRIx16 " --> [%016" PRIx64
-                             "]    (%" PRId64 ")",
-                 static_cast<uint16_t>(value), addr, icount_);
-        break;
-      case WORD:
-        SNPrintF(trace_buf_,
-                 "        %08" PRIx32 " --> [%016" PRIx64 "]    (%" PRId64 ")",
-                 static_cast<uint32_t>(value), addr, icount_);
-        break;
-      case DWORD:
-        SNPrintF(trace_buf_,
-                 "%016" PRIx64 "  --> [%016" PRIx64 "]    (%" PRId64 " )",
-                 value, addr, icount_);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  }
-}
-
-template <typename T>
-void Simulator::TraceMemRd(int64_t addr, T value) {
-  if (::v8::internal::FLAG_trace_sim) {
-    switch (sizeof(T)) {
-      case 1:
-        SNPrintF(trace_buf_,
-                 "%08" PRIx8 " <-- [%08" PRIx64 "]    (%" PRIu64
-                 ")    int8:%" PRId8 " uint8:%" PRIu8,
-                 static_cast<uint8_t>(value), addr, icount_,
-                 static_cast<int8_t>(value), static_cast<uint8_t>(value));
-        break;
-      case 2:
-        SNPrintF(trace_buf_,
-                 "%08" PRIx16 " <-- [%08" PRIx64 "]    (%" PRIu64
-                 ")    int16:%" PRId16 " uint16:%" PRIu16,
-                 static_cast<uint16_t>(value), addr, icount_,
-                 static_cast<int16_t>(value), static_cast<uint16_t>(value));
-        break;
-      case 4:
-        SNPrintF(trace_buf_,
-                 "%08" PRIx32 " <-- [%08" PRIx64 "]    (%" PRIu64
-                 ")    int32:%" PRId32 " uint32:%" PRIu32,
-                 static_cast<uint32_t>(value), addr, icount_,
-                 static_cast<int32_t>(value), static_cast<uint32_t>(value));
-        break;
-      case 8:
-        SNPrintF(trace_buf_,
-                 "%08" PRIx64 " <-- [%08" PRIx64 "]    (%" PRIu64
-                 ")    int64:%" PRId64 " uint64:%" PRIu64,
-                 static_cast<uint64_t>(value), addr, icount_,
-                 static_cast<int64_t>(value), static_cast<uint64_t>(value));
-        break;
-      default:
-        UNREACHABLE();
-    }
-  }
-}
-
-template <typename T>
-void Simulator::TraceMemWr(int64_t addr, T value) {
-  if (::v8::internal::FLAG_trace_sim) {
-    switch (sizeof(T)) {
-      case 1:
-        SNPrintF(trace_buf_,
-                 "      %02" PRIx8 " --> [%08" PRIx64 "]    (%" PRIu64 ")",
-                 static_cast<uint8_t>(value), addr, icount_);
-        break;
-      case 2:
-        SNPrintF(trace_buf_,
-                 "    %04" PRIx16 " --> [%08" PRIx64 "]    (%" PRIu64 ")",
-                 static_cast<uint16_t>(value), addr, icount_);
-        break;
-      case 4:
-        SNPrintF(trace_buf_,
-                 "%08" PRIx32 " --> [%08" PRIx64 "]    (%" PRIu64 ")",
-                 static_cast<uint32_t>(value), addr, icount_);
-        break;
-      case 8:
-        SNPrintF(trace_buf_,
-                 "%16" PRIx64 " --> [%08" PRIx64 "]    (%" PRIu64 ")",
-                 static_cast<uint64_t>(value), addr, icount_);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  }
-}
-
-// TODO(plind): sign-extend and zero-extend not implmented properly
-// on all the ReadXX functions, I don't think re-interpret cast does it.
-int32_t Simulator::ReadW(int64_t addr, Instruction* instr, TraceType t) {
-  if (addr >=0 && addr < 0x400) {
-    // This has to be a nullptr-dereference, drop into debugger.
-    PrintF("Memory read from bad address: 0x%08" PRIx64 " , pc=0x%08" PRIxPTR
-           " \n",
-           addr, reinterpret_cast<intptr_t>(instr));
-    DieOrDebug();
-  }
-  if ((addr & 0x3) == 0 || kArchVariant == kMips64r6) {
-    int32_t* ptr = reinterpret_cast<int32_t*>(addr);
-    TraceMemRd(addr, static_cast<int64_t>(*ptr), t);
-    return *ptr;
-  }
-  PrintF("Unaligned read at 0x%08" PRIx64 " , pc=0x%08" V8PRIxPTR "\n", addr,
-         reinterpret_cast<intptr_t>(instr));
-  DieOrDebug();
-  return 0;
-}
-
-
-uint32_t Simulator::ReadWU(int64_t addr, Instruction* instr) {
-  if (addr >=0 && addr < 0x400) {
-    // This has to be a nullptr-dereference, drop into debugger.
-    PrintF("Memory read from bad address: 0x%08" PRIx64 " , pc=0x%08" PRIxPTR
-           " \n",
-           addr, reinterpret_cast<intptr_t>(instr));
-    DieOrDebug();
-  }
-  if ((addr & 0x3) == 0 || kArchVariant == kMips64r6) {
-    uint32_t* ptr = reinterpret_cast<uint32_t*>(addr);
-    TraceMemRd(addr, static_cast<int64_t>(*ptr), WORD);
-    return *ptr;
-  }
-  PrintF("Unaligned read at 0x%08" PRIx64 " , pc=0x%08" V8PRIxPTR "\n", addr,
-         reinterpret_cast<intptr_t>(instr));
-  DieOrDebug();
-  return 0;
-}
-
-
-void Simulator::WriteW(int64_t addr, int32_t value, Instruction* instr) {
-  if (addr >= 0 && addr < 0x400) {
-    // This has to be a nullptr-dereference, drop into debugger.
-    PrintF("Memory write to bad address: 0x%08" PRIx64 " , pc=0x%08" PRIxPTR
-           " \n",
-           addr, reinterpret_cast<intptr_t>(instr));
-    DieOrDebug();
-  }
-  if ((addr & 0x3) == 0 || kArchVariant == kMips64r6) {
-    TraceMemWr(addr, value, WORD);
-    int* ptr = reinterpret_cast<int*>(addr);
-    *ptr = value;
-    return;
-  }
-  PrintF("Unaligned write at 0x%08" PRIx64 " , pc=0x%08" V8PRIxPTR "\n", addr,
-         reinterpret_cast<intptr_t>(instr));
-  DieOrDebug();
-}
-
-
-int64_t Simulator::Read2W(int64_t addr, Instruction* instr) {
-  if (addr >=0 && addr < 0x400) {
-    // This has to be a nullptr-dereference, drop into debugger.
-    PrintF("Memory read from bad address: 0x%08" PRIx64 " , pc=0x%08" PRIxPTR
-           " \n",
-           addr, reinterpret_cast<intptr_t>(instr));
-    DieOrDebug();
-  }
-  if ((addr & kPointerAlignmentMask) == 0 || kArchVariant == kMips64r6) {
-    int64_t* ptr = reinterpret_cast<int64_t*>(addr);
-    TraceMemRd(addr, *ptr);
-    return *ptr;
-  }
-  PrintF("Unaligned read at 0x%08" PRIx64 " , pc=0x%08" V8PRIxPTR "\n", addr,
-         reinterpret_cast<intptr_t>(instr));
-  DieOrDebug();
-  return 0;
-}
-
-
-void Simulator::Write2W(int64_t addr, int64_t value, Instruction* instr) {
-  if (addr >= 0 && addr < 0x400) {
-    // This has to be a nullptr-dereference, drop into debugger.
-    PrintF("Memory write to bad address: 0x%08" PRIx64 " , pc=0x%08" PRIxPTR
-           "\n",
-           addr, reinterpret_cast<intptr_t>(instr));
-    DieOrDebug();
-  }
-  if ((addr & kPointerAlignmentMask) == 0 || kArchVariant == kMips64r6) {
-    TraceMemWr(addr, value, DWORD);
-    int64_t* ptr = reinterpret_cast<int64_t*>(addr);
-    *ptr = value;
-    return;
-  }
-  PrintF("Unaligned write at 0x%08" PRIx64 " , pc=0x%08" V8PRIxPTR "\n", addr,
-         reinterpret_cast<intptr_t>(instr));
-  DieOrDebug();
-}
-
-
-double Simulator::ReadD(int64_t addr, Instruction* instr) {
-  if ((addr & kDoubleAlignmentMask) == 0 || kArchVariant == kMips64r6) {
-    double* ptr = reinterpret_cast<double*>(addr);
-    return *ptr;
-  }
-  PrintF("Unaligned (double) read at 0x%08" PRIx64 " , pc=0x%08" V8PRIxPTR "\n",
-         addr, reinterpret_cast<intptr_t>(instr));
-  base::OS::Abort();
-  return 0;
-}
-
-
-void Simulator::WriteD(int64_t addr, double value, Instruction* instr) {
-  if ((addr & kDoubleAlignmentMask) == 0 || kArchVariant == kMips64r6) {
-    double* ptr = reinterpret_cast<double*>(addr);
-    *ptr = value;
-    return;
-  }
-  PrintF("Unaligned (double) write at 0x%08" PRIx64 " , pc=0x%08" V8PRIxPTR
-         "\n",
-         addr, reinterpret_cast<intptr_t>(instr));
-  DieOrDebug();
-}
-
-
-uint16_t Simulator::ReadHU(int64_t addr, Instruction* instr) {
-  if ((addr & 1) == 0 || kArchVariant == kMips64r6) {
-    uint16_t* ptr = reinterpret_cast<uint16_t*>(addr);
-    TraceMemRd(addr, static_cast<int64_t>(*ptr));
-    return *ptr;
-  }
-  PrintF("Unaligned unsigned halfword read at 0x%08" PRIx64
-         " , pc=0x%08" V8PRIxPTR "\n",
-         addr, reinterpret_cast<intptr_t>(instr));
-  DieOrDebug();
-  return 0;
-}
-
-
-int16_t Simulator::ReadH(int64_t addr, Instruction* instr) {
-  if ((addr & 1) == 0 || kArchVariant == kMips64r6) {
-    int16_t* ptr = reinterpret_cast<int16_t*>(addr);
-    TraceMemRd(addr, static_cast<int64_t>(*ptr));
-    return *ptr;
-  }
-  PrintF("Unaligned signed halfword read at 0x%08" PRIx64
-         " , pc=0x%08" V8PRIxPTR "\n",
-         addr, reinterpret_cast<intptr_t>(instr));
-  DieOrDebug();
-  return 0;
-}
-
-
-void Simulator::WriteH(int64_t addr, uint16_t value, Instruction* instr) {
-  if ((addr & 1) == 0 || kArchVariant == kMips64r6) {
-    TraceMemWr(addr, value, HALF);
-    uint16_t* ptr = reinterpret_cast<uint16_t*>(addr);
-    *ptr = value;
-    return;
-  }
-  PrintF("Unaligned unsigned halfword write at 0x%08" PRIx64
-         " , pc=0x%08" V8PRIxPTR "\n",
-         addr, reinterpret_cast<intptr_t>(instr));
-  DieOrDebug();
-}
-
-
-void Simulator::WriteH(int64_t addr, int16_t value, Instruction* instr) {
-  if ((addr & 1) == 0 || kArchVariant == kMips64r6) {
-    TraceMemWr(addr, value, HALF);
-    int16_t* ptr = reinterpret_cast<int16_t*>(addr);
-    *ptr = value;
-    return;
-  }
-  PrintF("Unaligned halfword write at 0x%08" PRIx64 " , pc=0x%08" V8PRIxPTR
-         "\n",
-         addr, reinterpret_cast<intptr_t>(instr));
-  DieOrDebug();
-}
-
-
-uint32_t Simulator::ReadBU(int64_t addr) {
-  uint8_t* ptr = reinterpret_cast<uint8_t*>(addr);
-  TraceMemRd(addr, static_cast<int64_t>(*ptr));
-  return *ptr & 0xFF;
-}
-
-
-int32_t Simulator::ReadB(int64_t addr) {
-  int8_t* ptr = reinterpret_cast<int8_t*>(addr);
-  TraceMemRd(addr, static_cast<int64_t>(*ptr));
-  return *ptr;
-}
-
-
-void Simulator::WriteB(int64_t addr, uint8_t value) {
-  TraceMemWr(addr, value, BYTE);
-  uint8_t* ptr = reinterpret_cast<uint8_t*>(addr);
-  *ptr = value;
-}
-
-
-void Simulator::WriteB(int64_t addr, int8_t value) {
-  TraceMemWr(addr, value, BYTE);
-  int8_t* ptr = reinterpret_cast<int8_t*>(addr);
-  *ptr = value;
-}
-
-template <typename T>
-T Simulator::ReadMem(int64_t addr, Instruction* instr) {
-  int alignment_mask = (1 << sizeof(T)) - 1;
-  if ((addr & alignment_mask) == 0 || kArchVariant == kMips64r6) {
-    T* ptr = reinterpret_cast<T*>(addr);
-    TraceMemRd(addr, *ptr);
-    return *ptr;
-  }
-  PrintF("Unaligned read of type sizeof(%ld) at 0x%08lx, pc=0x%08" V8PRIxPTR
-         "\n",
-         sizeof(T), addr, reinterpret_cast<intptr_t>(instr));
-  base::OS::Abort();
-  return 0;
-}
-
-template <typename T>
-void Simulator::WriteMem(int64_t addr, T value, Instruction* instr) {
-  int alignment_mask = (1 << sizeof(T)) - 1;
-  if ((addr & alignment_mask) == 0 || kArchVariant == kMips64r6) {
-    T* ptr = reinterpret_cast<T*>(addr);
-    *ptr = value;
-    TraceMemWr(addr, value);
-    return;
-  }
-  PrintF("Unaligned write of type sizeof(%ld) at 0x%08lx, pc=0x%08" V8PRIxPTR
-         "\n",
-         sizeof(T), addr, reinterpret_cast<intptr_t>(instr));
-  base::OS::Abort();
-}
-
-// Returns the limit of the stack area to enable checking for stack overflows.
-uintptr_t Simulator::StackLimit(uintptr_t c_limit) const {
-  // The simulator uses a separate JS stack. If we have exhausted the C stack,
-  // we also drop down the JS limit to reflect the exhaustion on the JS stack.
-  if (GetCurrentStackPosition() < c_limit) {
-    return reinterpret_cast<uintptr_t>(get_sp());
-  }
-
-  // Otherwise the limit is the JS stack. Leave a safety margin of 1024 bytes
-  // to prevent overrunning the stack when pushing values.
-  return reinterpret_cast<uintptr_t>(stack_) + 1024;
-}
-
-
-// Unsupported instructions use Format to print an error and stop execution.
-void Simulator::Format(Instruction* instr, const char* format) {
-  PrintF("Simulator found unsupported instruction:\n 0x%08" PRIxPTR " : %s\n",
-         reinterpret_cast<intptr_t>(instr), format);
-  UNIMPLEMENTED_MIPS();
-}
-
-
-// Calls into the V8 runtime are based on this very simple interface.
-// Note: To be able to return two values from some calls the code in runtime.cc
-// uses the ObjectPair which is essentially two 32-bit values stuffed into a
-// 64-bit value. With the code below we assume that all runtime calls return
-// 64 bits of result. If they don't, the v1 result register contains a bogus
-// value, which is fine because it is caller-saved.
-
-typedef ObjectPair (*SimulatorRuntimeCall)(int64_t arg0, int64_t arg1,
-                                           int64_t arg2, int64_t arg3,
-                                           int64_t arg4, int64_t arg5,
-                                           int64_t arg6, int64_t arg7,
-                                           int64_t arg8);
-
-// These prototypes handle the four types of FP calls.
-typedef int64_t (*SimulatorRuntimeCompareCall)(double darg0, double darg1);
-typedef double (*SimulatorRuntimeFPFPCall)(double darg0, double darg1);
-typedef double (*SimulatorRuntimeFPCall)(double darg0);
-typedef double (*SimulatorRuntimeFPIntCall)(double darg0, int32_t arg0);
-
-// This signature supports direct call in to API function native callback
-// (refer to InvocationCallback in v8.h).
-typedef void (*SimulatorRuntimeDirectApiCall)(int64_t arg0);
-typedef void (*SimulatorRuntimeProfilingApiCall)(int64_t arg0, void* arg1);
-
-// This signature supports direct call to accessor getter callback.
-typedef void (*SimulatorRuntimeDirectGetterCall)(int64_t arg0, int64_t arg1);
-typedef void (*SimulatorRuntimeProfilingGetterCall)(
-    int64_t arg0, int64_t arg1, void* arg2);
-
-// Software interrupt instructions are used by the simulator to call into the
-// C-based V8 runtime. They are also used for debugging with simulator.
-void Simulator::SoftwareInterrupt() {
-  // There are several instructions that could get us here,
-  // the break_ instruction, or several variants of traps. All
-  // Are "SPECIAL" class opcode, and are distinuished by function.
-  int32_t func = instr_.FunctionFieldRaw();
-  uint32_t code = (func == BREAK) ? instr_.Bits(25, 6) : -1;
-  // We first check if we met a call_rt_redirected.
-  if (instr_.InstructionBits() == rtCallRedirInstr) {
-    Redirection* redirection = Redirection::FromInstruction(instr_.instr());
-
-    int64_t* stack_pointer = reinterpret_cast<int64_t*>(get_register(sp));
-
-    int64_t arg0 = get_register(a0);
-    int64_t arg1 = get_register(a1);
-    int64_t arg2 = get_register(a2);
-    int64_t arg3 = get_register(a3);
-    int64_t arg4 = get_register(a4);
-    int64_t arg5 = get_register(a5);
-    int64_t arg6 = get_register(a6);
-    int64_t arg7 = get_register(a7);
-    int64_t arg8 = stack_pointer[0];
-    STATIC_ASSERT(kMaxCParameters == 9);
-
-    bool fp_call =
-         (redirection->type() == ExternalReference::BUILTIN_FP_FP_CALL) ||
-         (redirection->type() == ExternalReference::BUILTIN_COMPARE_CALL) ||
-         (redirection->type() == ExternalReference::BUILTIN_FP_CALL) ||
-         (redirection->type() == ExternalReference::BUILTIN_FP_INT_CALL);
-
-    if (!IsMipsSoftFloatABI) {
-      // With the hard floating point calling convention, double
-      // arguments are passed in FPU registers. Fetch the arguments
-      // from there and call the builtin using soft floating point
-      // convention.
-      switch (redirection->type()) {
-      case ExternalReference::BUILTIN_FP_FP_CALL:
-      case ExternalReference::BUILTIN_COMPARE_CALL:
-        arg0 = get_fpu_register(f12);
-        arg1 = get_fpu_register(f13);
-        arg2 = get_fpu_register(f14);
-        arg3 = get_fpu_register(f15);
-        break;
-      case ExternalReference::BUILTIN_FP_CALL:
-        arg0 = get_fpu_register(f12);
-        arg1 = get_fpu_register(f13);
-        break;
-      case ExternalReference::BUILTIN_FP_INT_CALL:
-        arg0 = get_fpu_register(f12);
-        arg1 = get_fpu_register(f13);
-        arg2 = get_register(a2);
-        break;
-      default:
-        break;
-      }
-    }
-
-    // This is dodgy but it works because the C entry stubs are never moved.
-    // See comment in codegen-arm.cc and bug 1242173.
-    int64_t saved_ra = get_register(ra);
-
-    intptr_t external =
-          reinterpret_cast<intptr_t>(redirection->external_function());
-
-    // Based on CpuFeatures::IsSupported(FPU), Mips will use either hardware
-    // FPU, or gcc soft-float routines. Hardware FPU is simulated in this
-    // simulator. Soft-float has additional abstraction of ExternalReference,
-    // to support serialization.
-    if (fp_call) {
-      double dval0, dval1;  // one or two double parameters
-      int32_t ival;         // zero or one integer parameters
-      int64_t iresult = 0;  // integer return value
-      double dresult = 0;   // double return value
-      GetFpArgs(&dval0, &dval1, &ival);
-      SimulatorRuntimeCall generic_target =
-          reinterpret_cast<SimulatorRuntimeCall>(external);
-      if (::v8::internal::FLAG_trace_sim) {
-        switch (redirection->type()) {
-          case ExternalReference::BUILTIN_FP_FP_CALL:
-          case ExternalReference::BUILTIN_COMPARE_CALL:
-            PrintF("Call to host function at %p with args %f, %f",
-                   static_cast<void*>(FUNCTION_ADDR(generic_target)), dval0,
-                   dval1);
-            break;
-          case ExternalReference::BUILTIN_FP_CALL:
-            PrintF("Call to host function at %p with arg %f",
-                   static_cast<void*>(FUNCTION_ADDR(generic_target)), dval0);
-            break;
-          case ExternalReference::BUILTIN_FP_INT_CALL:
-            PrintF("Call to host function at %p with args %f, %d",
-                   static_cast<void*>(FUNCTION_ADDR(generic_target)), dval0,
-                   ival);
-            break;
-          default:
-            UNREACHABLE();
-            break;
-        }
-      }
-      switch (redirection->type()) {
-      case ExternalReference::BUILTIN_COMPARE_CALL: {
-        SimulatorRuntimeCompareCall target =
-          reinterpret_cast<SimulatorRuntimeCompareCall>(external);
-        iresult = target(dval0, dval1);
-        set_register(v0, static_cast<int64_t>(iresult));
-      //  set_register(v1, static_cast<int64_t>(iresult >> 32));
-        break;
-      }
-      case ExternalReference::BUILTIN_FP_FP_CALL: {
-        SimulatorRuntimeFPFPCall target =
-          reinterpret_cast<SimulatorRuntimeFPFPCall>(external);
-        dresult = target(dval0, dval1);
-        SetFpResult(dresult);
-        break;
-      }
-      case ExternalReference::BUILTIN_FP_CALL: {
-        SimulatorRuntimeFPCall target =
-          reinterpret_cast<SimulatorRuntimeFPCall>(external);
-        dresult = target(dval0);
-        SetFpResult(dresult);
-        break;
-      }
-      case ExternalReference::BUILTIN_FP_INT_CALL: {
-        SimulatorRuntimeFPIntCall target =
-          reinterpret_cast<SimulatorRuntimeFPIntCall>(external);
-        dresult = target(dval0, ival);
-        SetFpResult(dresult);
-        break;
-      }
-      default:
-        UNREACHABLE();
-        break;
-      }
-      if (::v8::internal::FLAG_trace_sim) {
-        switch (redirection->type()) {
-        case ExternalReference::BUILTIN_COMPARE_CALL:
-          PrintF("Returned %08x\n", static_cast<int32_t>(iresult));
-          break;
-        case ExternalReference::BUILTIN_FP_FP_CALL:
-        case ExternalReference::BUILTIN_FP_CALL:
-        case ExternalReference::BUILTIN_FP_INT_CALL:
-          PrintF("Returned %f\n", dresult);
-          break;
-        default:
-          UNREACHABLE();
-          break;
-        }
-      }
-    } else if (redirection->type() == ExternalReference::DIRECT_API_CALL) {
-      if (::v8::internal::FLAG_trace_sim) {
-        PrintF("Call to host function at %p args %08" PRIx64 " \n",
-               reinterpret_cast<void*>(external), arg0);
-      }
-      SimulatorRuntimeDirectApiCall target =
-          reinterpret_cast<SimulatorRuntimeDirectApiCall>(external);
-      target(arg0);
-    } else if (
-        redirection->type() == ExternalReference::PROFILING_API_CALL) {
-      if (::v8::internal::FLAG_trace_sim) {
-        PrintF("Call to host function at %p args %08" PRIx64 "  %08" PRIx64
-               " \n",
-               reinterpret_cast<void*>(external), arg0, arg1);
-      }
-      SimulatorRuntimeProfilingApiCall target =
-          reinterpret_cast<SimulatorRuntimeProfilingApiCall>(external);
-      target(arg0, Redirection::ReverseRedirection(arg1));
-    } else if (
-        redirection->type() == ExternalReference::DIRECT_GETTER_CALL) {
-      if (::v8::internal::FLAG_trace_sim) {
-        PrintF("Call to host function at %p args %08" PRIx64 "  %08" PRIx64
-               " \n",
-               reinterpret_cast<void*>(external), arg0, arg1);
-      }
-      SimulatorRuntimeDirectGetterCall target =
-          reinterpret_cast<SimulatorRuntimeDirectGetterCall>(external);
-      target(arg0, arg1);
-    } else if (
-        redirection->type() == ExternalReference::PROFILING_GETTER_CALL) {
-      if (::v8::internal::FLAG_trace_sim) {
-        PrintF("Call to host function at %p args %08" PRIx64 "  %08" PRIx64
-               "  %08" PRIx64 " \n",
-               reinterpret_cast<void*>(external), arg0, arg1, arg2);
-      }
-      SimulatorRuntimeProfilingGetterCall target =
-          reinterpret_cast<SimulatorRuntimeProfilingGetterCall>(external);
-      target(arg0, arg1, Redirection::ReverseRedirection(arg2));
-    } else {
-      DCHECK(redirection->type() == ExternalReference::BUILTIN_CALL ||
-             redirection->type() == ExternalReference::BUILTIN_CALL_PAIR);
-      SimulatorRuntimeCall target =
-                  reinterpret_cast<SimulatorRuntimeCall>(external);
-      if (::v8::internal::FLAG_trace_sim) {
-        PrintF(
-            "Call to host function at %p "
-            "args %08" PRIx64 " , %08" PRIx64 " , %08" PRIx64 " , %08" PRIx64
-            " , %08" PRIx64 " , %08" PRIx64 " , %08" PRIx64 " , %08" PRIx64
-            " , %08" PRIx64 " \n",
-            static_cast<void*>(FUNCTION_ADDR(target)), arg0, arg1, arg2, arg3,
-            arg4, arg5, arg6, arg7, arg8);
-      }
-      ObjectPair result =
-          target(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
-      set_register(v0, (int64_t)(result.x));
-      set_register(v1, (int64_t)(result.y));
-    }
-     if (::v8::internal::FLAG_trace_sim) {
-       PrintF("Returned %08" PRIx64 "  : %08" PRIx64 " \n", get_register(v1),
-              get_register(v0));
-    }
-    set_register(ra, saved_ra);
-    set_pc(get_register(ra));
-
-  } else if (func == BREAK && code <= kMaxStopCode) {
-    if (IsWatchpoint(code)) {
-      PrintWatchpoint(code);
-    } else {
-      IncreaseStopCounter(code);
-      HandleStop(code, instr_.instr());
-    }
-  } else {
-    // All remaining break_ codes, and all traps are handled here.
-    MipsDebugger dbg(this);
-    dbg.Debug();
-  }
-}
-
-
-// Stop helper functions.
-bool Simulator::IsWatchpoint(uint64_t code) {
-  return (code <= kMaxWatchpointCode);
-}
-
-
-void Simulator::PrintWatchpoint(uint64_t code) {
-  MipsDebugger dbg(this);
-  ++break_count_;
-  PrintF("\n---- break %" PRId64 "  marker: %3d  (instr count: %8" PRId64
-         " ) ----------"
-         "----------------------------------",
-         code, break_count_, icount_);
-  dbg.PrintAllRegs();  // Print registers and continue running.
-}
-
-
-void Simulator::HandleStop(uint64_t code, Instruction* instr) {
-  // Stop if it is enabled, otherwise go on jumping over the stop
-  // and the message address.
-  if (IsEnabledStop(code)) {
-    MipsDebugger dbg(this);
-    dbg.Stop(instr);
-  }
-}
-
-
-bool Simulator::IsStopInstruction(Instruction* instr) {
-  int32_t func = instr->FunctionFieldRaw();
-  uint32_t code = static_cast<uint32_t>(instr->Bits(25, 6));
-  return (func == BREAK) && code > kMaxWatchpointCode && code <= kMaxStopCode;
-}
-
-
-bool Simulator::IsEnabledStop(uint64_t code) {
-  DCHECK_LE(code, kMaxStopCode);
-  DCHECK_GT(code, kMaxWatchpointCode);
-  return !(watched_stops_[code].count & kStopDisabledBit);
-}
-
-
-void Simulator::EnableStop(uint64_t code) {
-  if (!IsEnabledStop(code)) {
-    watched_stops_[code].count &= ~kStopDisabledBit;
-  }
-}
-
-
-void Simulator::DisableStop(uint64_t code) {
-  if (IsEnabledStop(code)) {
-    watched_stops_[code].count |= kStopDisabledBit;
-  }
-}
-
-
-void Simulator::IncreaseStopCounter(uint64_t code) {
-  DCHECK_LE(code, kMaxStopCode);
-  if ((watched_stops_[code].count & ~(1 << 31)) == 0x7FFFFFFF) {
-    PrintF("Stop counter for code %" PRId64
-           "  has overflowed.\n"
-           "Enabling this code and reseting the counter to 0.\n",
-           code);
-    watched_stops_[code].count = 0;
-    EnableStop(code);
-  } else {
-    watched_stops_[code].count++;
-  }
-}
-
-
-// Print a stop status.
-void Simulator::PrintStopInfo(uint64_t code) {
-  if (code <= kMaxWatchpointCode) {
-    PrintF("That is a watchpoint, not a stop.\n");
-    return;
-  } else if (code > kMaxStopCode) {
-    PrintF("Code too large, only %u stops can be used\n", kMaxStopCode + 1);
-    return;
-  }
-  const char* state = IsEnabledStop(code) ? "Enabled" : "Disabled";
-  int32_t count = watched_stops_[code].count & ~kStopDisabledBit;
-  // Don't print the state of unused breakpoints.
-  if (count != 0) {
-    if (watched_stops_[code].desc) {
-      PrintF("stop %" PRId64 "  - 0x%" PRIx64 " : \t%s, \tcounter = %i, \t%s\n",
-             code, code, state, count, watched_stops_[code].desc);
-    } else {
-      PrintF("stop %" PRId64 "  - 0x%" PRIx64 " : \t%s, \tcounter = %i\n", code,
-             code, state, count);
-    }
-  }
-}
-
-
-void Simulator::SignalException(Exception e) {
-  V8_Fatal(__FILE__, __LINE__, "Error: Exception %i raised.",
-           static_cast<int>(e));
-}
-
-// Min/Max template functions for Double and Single arguments.
-
-template <typename T>
-static T FPAbs(T a);
-
-template <>
-double FPAbs<double>(double a) {
-  return fabs(a);
-}
-
-template <>
-float FPAbs<float>(float a) {
-  return fabsf(a);
-}
-
-template <typename T>
-static bool FPUProcessNaNsAndZeros(T a, T b, MaxMinKind kind, T& result) {
-  if (std::isnan(a) && std::isnan(b)) {
-    result = a;
-  } else if (std::isnan(a)) {
-    result = b;
-  } else if (std::isnan(b)) {
-    result = a;
-  } else if (b == a) {
-    // Handle -0.0 == 0.0 case.
-    // std::signbit() returns int 0 or 1 so subtracting MaxMinKind::kMax
-    // negates the result.
-    result = std::signbit(b) - static_cast<int>(kind) ? b : a;
-  } else {
-    return false;
-  }
-  return true;
-}
-
-template <typename T>
-static T FPUMin(T a, T b) {
-  T result;
-  if (FPUProcessNaNsAndZeros(a, b, MaxMinKind::kMin, result)) {
-    return result;
-  } else {
-    return b < a ? b : a;
-  }
-}
-
-template <typename T>
-static T FPUMax(T a, T b) {
-  T result;
-  if (FPUProcessNaNsAndZeros(a, b, MaxMinKind::kMax, result)) {
-    return result;
-  } else {
-    return b > a ? b : a;
-  }
-}
-
-template <typename T>
-static T FPUMinA(T a, T b) {
-  T result;
-  if (!FPUProcessNaNsAndZeros(a, b, MaxMinKind::kMin, result)) {
-    if (FPAbs(a) < FPAbs(b)) {
-      result = a;
-    } else if (FPAbs(b) < FPAbs(a)) {
-      result = b;
-    } else {
-      result = a < b ? a : b;
-    }
-  }
-  return result;
-}
-
-template <typename T>
-static T FPUMaxA(T a, T b) {
-  T result;
-  if (!FPUProcessNaNsAndZeros(a, b, MaxMinKind::kMin, result)) {
-    if (FPAbs(a) > FPAbs(b)) {
-      result = a;
-    } else if (FPAbs(b) > FPAbs(a)) {
-      result = b;
-    } else {
-      result = a > b ? a : b;
-    }
-  }
-  return result;
-}
-
-enum class KeepSign : bool { no = false, yes };
-
-template <typename T, typename std::enable_if<std::is_floating_point<T>::value,
-                                              int>::type = 0>
-T FPUCanonalizeNaNArg(T result, T arg, KeepSign keepSign = KeepSign::no) {
-  DCHECK(std::isnan(arg));
-  T qNaN = std::numeric_limits<T>::quiet_NaN();
-  if (keepSign == KeepSign::yes) {
-    return std::copysign(qNaN, result);
-  }
-  return qNaN;
-}
-
-template <typename T>
-T FPUCanonalizeNaNArgs(T result, KeepSign keepSign, T first) {
-  if (std::isnan(first)) {
-    return FPUCanonalizeNaNArg(result, first, keepSign);
-  }
-  return result;
-}
-
-template <typename T, typename... Args>
-T FPUCanonalizeNaNArgs(T result, KeepSign keepSign, T first, Args... args) {
-  if (std::isnan(first)) {
-    return FPUCanonalizeNaNArg(result, first, keepSign);
-  }
-  return FPUCanonalizeNaNArgs(result, keepSign, args...);
-}
-
-template <typename Func, typename T, typename... Args>
-T FPUCanonalizeOperation(Func f, T first, Args... args) {
-  return FPUCanonalizeOperation(f, KeepSign::no, first, args...);
-}
-
-template <typename Func, typename T, typename... Args>
-T FPUCanonalizeOperation(Func f, KeepSign keepSign, T first, Args... args) {
-  T result = f(first, args...);
-  if (std::isnan(result)) {
-    result = FPUCanonalizeNaNArgs(result, keepSign, first, args...);
-  }
-  return result;
-}
-
-// Handle execution based on instruction types.
-
-void Simulator::DecodeTypeRegisterSRsType() {
-  float fs, ft, fd;
-  fs = get_fpu_register_float(fs_reg());
-  ft = get_fpu_register_float(ft_reg());
-  fd = get_fpu_register_float(fd_reg());
-  int32_t ft_int = bit_cast<int32_t>(ft);
-  int32_t fd_int = bit_cast<int32_t>(fd);
-  uint32_t cc, fcsr_cc;
-  cc = instr_.FCccValue();
-  fcsr_cc = get_fcsr_condition_bit(cc);
-  switch (instr_.FunctionFieldRaw()) {
-    case RINT: {
-      DCHECK_EQ(kArchVariant, kMips64r6);
-      float result, temp_result;
-      double temp;
-      float upper = std::ceil(fs);
-      float lower = std::floor(fs);
-      switch (get_fcsr_rounding_mode()) {
-        case kRoundToNearest:
-          if (upper - fs < fs - lower) {
-            result = upper;
-          } else if (upper - fs > fs - lower) {
-            result = lower;
-          } else {
-            temp_result = upper / 2;
-            float reminder = modf(temp_result, &temp);
-            if (reminder == 0) {
-              result = upper;
-            } else {
-              result = lower;
-            }
-          }
-          break;
-        case kRoundToZero:
-          result = (fs > 0 ? lower : upper);
-          break;
-        case kRoundToPlusInf:
-          result = upper;
-          break;
-        case kRoundToMinusInf:
-          result = lower;
-          break;
-      }
-      SetFPUFloatResult(fd_reg(), result);
-      if (result != fs) {
-        set_fcsr_bit(kFCSRInexactFlagBit, true);
-      }
-      break;
-    }
-    case ADD_S:
-      SetFPUFloatResult(
-          fd_reg(),
-          FPUCanonalizeOperation([](float lhs, float rhs) { return lhs + rhs; },
-                                 fs, ft));
-      break;
-    case SUB_S:
-      SetFPUFloatResult(
-          fd_reg(),
-          FPUCanonalizeOperation([](float lhs, float rhs) { return lhs - rhs; },
-                                 fs, ft));
-      break;
-    case MADDF_S:
-      DCHECK_EQ(kArchVariant, kMips64r6);
-      SetFPUFloatResult(fd_reg(), std::fma(fs, ft, fd));
-      break;
-    case MSUBF_S:
-      DCHECK_EQ(kArchVariant, kMips64r6);
-      SetFPUFloatResult(fd_reg(), std::fma(-fs, ft, fd));
-      break;
-    case MUL_S:
-      SetFPUFloatResult(
-          fd_reg(),
-          FPUCanonalizeOperation([](float lhs, float rhs) { return lhs * rhs; },
-                                 fs, ft));
-      break;
-    case DIV_S:
-      SetFPUFloatResult(
-          fd_reg(),
-          FPUCanonalizeOperation([](float lhs, float rhs) { return lhs / rhs; },
-                                 fs, ft));
-      break;
-    case ABS_S:
-      SetFPUFloatResult(fd_reg(), FPUCanonalizeOperation(
-                                      [](float fs) { return FPAbs(fs); }, fs));
-      break;
-    case MOV_S:
-      SetFPUFloatResult(fd_reg(), fs);
-      break;
-    case NEG_S:
-      SetFPUFloatResult(fd_reg(),
-                        FPUCanonalizeOperation([](float src) { return -src; },
-                                               KeepSign::yes, fs));
-      break;
-    case SQRT_S:
-      SetFPUFloatResult(
-          fd_reg(),
-          FPUCanonalizeOperation([](float src) { return std::sqrt(src); }, fs));
-      break;
-    case RSQRT_S:
-      SetFPUFloatResult(
-          fd_reg(), FPUCanonalizeOperation(
-                        [](float src) { return 1.0 / std::sqrt(src); }, fs));
-      break;
-    case RECIP_S:
-      SetFPUFloatResult(fd_reg(), FPUCanonalizeOperation(
-                                      [](float src) { return 1.0 / src; }, fs));
-      break;
-    case C_F_D:
-      set_fcsr_bit(fcsr_cc, false);
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case C_UN_D:
-      set_fcsr_bit(fcsr_cc, std::isnan(fs) || std::isnan(ft));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case C_EQ_D:
-      set_fcsr_bit(fcsr_cc, (fs == ft));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case C_UEQ_D:
-      set_fcsr_bit(fcsr_cc, (fs == ft) || (std::isnan(fs) || std::isnan(ft)));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case C_OLT_D:
-      set_fcsr_bit(fcsr_cc, (fs < ft));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case C_ULT_D:
-      set_fcsr_bit(fcsr_cc, (fs < ft) || (std::isnan(fs) || std::isnan(ft)));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case C_OLE_D:
-      set_fcsr_bit(fcsr_cc, (fs <= ft));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case C_ULE_D:
-      set_fcsr_bit(fcsr_cc, (fs <= ft) || (std::isnan(fs) || std::isnan(ft)));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case CVT_D_S:
-      SetFPUDoubleResult(fd_reg(), static_cast<double>(fs));
-      break;
-    case CLASS_S: {  // Mips64r6 instruction
-      // Convert float input to uint32_t for easier bit manipulation
-      uint32_t classed = bit_cast<uint32_t>(fs);
-
-      // Extracting sign, exponent and mantissa from the input float
-      uint32_t sign = (classed >> 31) & 1;
-      uint32_t exponent = (classed >> 23) & 0x000000FF;
-      uint32_t mantissa = classed & 0x007FFFFF;
-      uint32_t result;
-      float fResult;
-
-      // Setting flags if input float is negative infinity,
-      // positive infinity, negative zero or positive zero
-      bool negInf = (classed == 0xFF800000);
-      bool posInf = (classed == 0x7F800000);
-      bool negZero = (classed == 0x80000000);
-      bool posZero = (classed == 0x00000000);
-
-      bool signalingNan;
-      bool quietNan;
-      bool negSubnorm;
-      bool posSubnorm;
-      bool negNorm;
-      bool posNorm;
-
-      // Setting flags if float is NaN
-      signalingNan = false;
-      quietNan = false;
-      if (!negInf && !posInf && (exponent == 0xFF)) {
-        quietNan = ((mantissa & 0x00200000) == 0) &&
-                   ((mantissa & (0x00200000 - 1)) == 0);
-        signalingNan = !quietNan;
-      }
-
-      // Setting flags if float is subnormal number
-      posSubnorm = false;
-      negSubnorm = false;
-      if ((exponent == 0) && (mantissa != 0)) {
-        DCHECK(sign == 0 || sign == 1);
-        posSubnorm = (sign == 0);
-        negSubnorm = (sign == 1);
-      }
-
-      // Setting flags if float is normal number
-      posNorm = false;
-      negNorm = false;
-      if (!posSubnorm && !negSubnorm && !posInf && !negInf && !signalingNan &&
-          !quietNan && !negZero && !posZero) {
-        DCHECK(sign == 0 || sign == 1);
-        posNorm = (sign == 0);
-        negNorm = (sign == 1);
-      }
-
-      // Calculating result according to description of CLASS.S instruction
-      result = (posZero << 9) | (posSubnorm << 8) | (posNorm << 7) |
-               (posInf << 6) | (negZero << 5) | (negSubnorm << 4) |
-               (negNorm << 3) | (negInf << 2) | (quietNan << 1) | signalingNan;
-
-      DCHECK_NE(result, 0);
-
-      fResult = bit_cast<float>(result);
-      SetFPUFloatResult(fd_reg(), fResult);
-      break;
-    }
-    case CVT_L_S: {
-      float rounded;
-      int64_t result;
-      round64_according_to_fcsr(fs, rounded, result, fs);
-      SetFPUResult(fd_reg(), result);
-      if (set_fcsr_round64_error(fs, rounded)) {
-        set_fpu_register_invalid_result64(fs, rounded);
-      }
-      break;
-    }
-    case CVT_W_S: {
-      float rounded;
-      int32_t result;
-      round_according_to_fcsr(fs, rounded, result, fs);
-      SetFPUWordResult(fd_reg(), result);
-      if (set_fcsr_round_error(fs, rounded)) {
-        set_fpu_register_word_invalid_result(fs, rounded);
-      }
-      break;
-    }
-    case TRUNC_W_S: {  // Truncate single to word (round towards 0).
-      float rounded = trunc(fs);
-      int32_t result = static_cast<int32_t>(rounded);
-      SetFPUWordResult(fd_reg(), result);
-      if (set_fcsr_round_error(fs, rounded)) {
-        set_fpu_register_word_invalid_result(fs, rounded);
-      }
-    } break;
-    case TRUNC_L_S: {  // Mips64r2 instruction.
-      float rounded = trunc(fs);
-      int64_t result = static_cast<int64_t>(rounded);
-      SetFPUResult(fd_reg(), result);
-      if (set_fcsr_round64_error(fs, rounded)) {
-        set_fpu_register_invalid_result64(fs, rounded);
-      }
-      break;
-    }
-    case ROUND_W_S: {
-      float rounded = std::floor(fs + 0.5);
-      int32_t result = static_cast<int32_t>(rounded);
-      if ((result & 1) != 0 && result - fs == 0.5) {
-        // If the number is halfway between two integers,
-        // round to the even one.
-        result--;
-      }
-      SetFPUWordResult(fd_reg(), result);
-      if (set_fcsr_round_error(fs, rounded)) {
-        set_fpu_register_word_invalid_result(fs, rounded);
-      }
-      break;
-    }
-    case ROUND_L_S: {  // Mips64r2 instruction.
-      float rounded = std::floor(fs + 0.5);
-      int64_t result = static_cast<int64_t>(rounded);
-      if ((result & 1) != 0 && result - fs == 0.5) {
-        // If the number is halfway between two integers,
-        // round to the even one.
-        result--;
-      }
-      int64_t i64 = static_cast<int64_t>(result);
-      SetFPUResult(fd_reg(), i64);
-      if (set_fcsr_round64_error(fs, rounded)) {
-        set_fpu_register_invalid_result64(fs, rounded);
-      }
-      break;
-    }
-    case FLOOR_L_S: {  // Mips64r2 instruction.
-      float rounded = floor(fs);
-      int64_t result = static_cast<int64_t>(rounded);
-      SetFPUResult(fd_reg(), result);
-      if (set_fcsr_round64_error(fs, rounded)) {
-        set_fpu_register_invalid_result64(fs, rounded);
-      }
-      break;
-    }
-    case FLOOR_W_S:  // Round double to word towards negative infinity.
-    {
-      float rounded = std::floor(fs);
-      int32_t result = static_cast<int32_t>(rounded);
-      SetFPUWordResult(fd_reg(), result);
-      if (set_fcsr_round_error(fs, rounded)) {
-        set_fpu_register_word_invalid_result(fs, rounded);
-      }
-    } break;
-    case CEIL_W_S:  // Round double to word towards positive infinity.
-    {
-      float rounded = std::ceil(fs);
-      int32_t result = static_cast<int32_t>(rounded);
-      SetFPUWordResult(fd_reg(), result);
-      if (set_fcsr_round_error(fs, rounded)) {
-        set_fpu_register_invalid_result(fs, rounded);
-      }
-    } break;
-    case CEIL_L_S: {  // Mips64r2 instruction.
-      float rounded = ceil(fs);
-      int64_t result = static_cast<int64_t>(rounded);
-      SetFPUResult(fd_reg(), result);
-      if (set_fcsr_round64_error(fs, rounded)) {
-        set_fpu_register_invalid_result64(fs, rounded);
-      }
-      break;
-    }
-    case MINA:
-      DCHECK_EQ(kArchVariant, kMips64r6);
-      SetFPUFloatResult(fd_reg(), FPUMinA(ft, fs));
-      break;
-    case MAXA:
-      DCHECK_EQ(kArchVariant, kMips64r6);
-      SetFPUFloatResult(fd_reg(), FPUMaxA(ft, fs));
-      break;
-    case MIN:
-      DCHECK_EQ(kArchVariant, kMips64r6);
-      SetFPUFloatResult(fd_reg(), FPUMin(ft, fs));
-      break;
-    case MAX:
-      DCHECK_EQ(kArchVariant, kMips64r6);
-      SetFPUFloatResult(fd_reg(), FPUMax(ft, fs));
-      break;
-    case SEL:
-      DCHECK_EQ(kArchVariant, kMips64r6);
-      SetFPUFloatResult(fd_reg(), (fd_int & 0x1) == 0 ? fs : ft);
-      break;
-    case SELEQZ_C:
-      DCHECK_EQ(kArchVariant, kMips64r6);
-      SetFPUFloatResult(
-          fd_reg(),
-          (ft_int & 0x1) == 0 ? get_fpu_register_float(fs_reg()) : 0.0);
-      break;
-    case SELNEZ_C:
-      DCHECK_EQ(kArchVariant, kMips64r6);
-      SetFPUFloatResult(
-          fd_reg(),
-          (ft_int & 0x1) != 0 ? get_fpu_register_float(fs_reg()) : 0.0);
-      break;
-    case MOVZ_C: {
-      DCHECK_EQ(kArchVariant, kMips64r2);
-      if (rt() == 0) {
-        SetFPUFloatResult(fd_reg(), fs);
-      }
-      break;
-    }
-    case MOVN_C: {
-      DCHECK_EQ(kArchVariant, kMips64r2);
-      if (rt() != 0) {
-        SetFPUFloatResult(fd_reg(), fs);
-      }
-      break;
-    }
-    case MOVF: {
-      // Same function field for MOVT.D and MOVF.D
-      uint32_t ft_cc = (ft_reg() >> 2) & 0x7;
-      ft_cc = get_fcsr_condition_bit(ft_cc);
-
-      if (instr_.Bit(16)) {  // Read Tf bit.
-        // MOVT.D
-        if (test_fcsr_bit(ft_cc)) SetFPUFloatResult(fd_reg(), fs);
-      } else {
-        // MOVF.D
-        if (!test_fcsr_bit(ft_cc)) SetFPUFloatResult(fd_reg(), fs);
-      }
-      break;
-    }
-    default:
-      // TRUNC_W_S ROUND_W_S ROUND_L_S FLOOR_W_S FLOOR_L_S
-      // CEIL_W_S CEIL_L_S CVT_PS_S are unimplemented.
-      UNREACHABLE();
-  }
-}
-
-
-void Simulator::DecodeTypeRegisterDRsType() {
-  double ft, fs, fd;
-  uint32_t cc, fcsr_cc;
-  fs = get_fpu_register_double(fs_reg());
-  ft = (instr_.FunctionFieldRaw() != MOVF) ? get_fpu_register_double(ft_reg())
-                                           : 0.0;
-  fd = get_fpu_register_double(fd_reg());
-  cc = instr_.FCccValue();
-  fcsr_cc = get_fcsr_condition_bit(cc);
-  int64_t ft_int = bit_cast<int64_t>(ft);
-  int64_t fd_int = bit_cast<int64_t>(fd);
-  switch (instr_.FunctionFieldRaw()) {
-    case RINT: {
-      DCHECK_EQ(kArchVariant, kMips64r6);
-      double result, temp, temp_result;
-      double upper = std::ceil(fs);
-      double lower = std::floor(fs);
-      switch (get_fcsr_rounding_mode()) {
-        case kRoundToNearest:
-          if (upper - fs < fs - lower) {
-            result = upper;
-          } else if (upper - fs > fs - lower) {
-            result = lower;
-          } else {
-            temp_result = upper / 2;
-            double reminder = modf(temp_result, &temp);
-            if (reminder == 0) {
-              result = upper;
-            } else {
-              result = lower;
-            }
-          }
-          break;
-        case kRoundToZero:
-          result = (fs > 0 ? lower : upper);
-          break;
-        case kRoundToPlusInf:
-          result = upper;
-          break;
-        case kRoundToMinusInf:
-          result = lower;
-          break;
-      }
-      SetFPUDoubleResult(fd_reg(), result);
-      if (result != fs) {
-        set_fcsr_bit(kFCSRInexactFlagBit, true);
-      }
-      break;
-    }
-    case SEL:
-      DCHECK_EQ(kArchVariant, kMips64r6);
-      SetFPUDoubleResult(fd_reg(), (fd_int & 0x1) == 0 ? fs : ft);
-      break;
-    case SELEQZ_C:
-      DCHECK_EQ(kArchVariant, kMips64r6);
-      SetFPUDoubleResult(fd_reg(), (ft_int & 0x1) == 0 ? fs : 0.0);
-      break;
-    case SELNEZ_C:
-      DCHECK_EQ(kArchVariant, kMips64r6);
-      SetFPUDoubleResult(fd_reg(), (ft_int & 0x1) != 0 ? fs : 0.0);
-      break;
-    case MOVZ_C: {
-      DCHECK_EQ(kArchVariant, kMips64r2);
-      if (rt() == 0) {
-        SetFPUDoubleResult(fd_reg(), fs);
-      }
-      break;
-    }
-    case MOVN_C: {
-      DCHECK_EQ(kArchVariant, kMips64r2);
-      if (rt() != 0) {
-        SetFPUDoubleResult(fd_reg(), fs);
-      }
-      break;
-    }
-    case MOVF: {
-      // Same function field for MOVT.D and MOVF.D
-      uint32_t ft_cc = (ft_reg() >> 2) & 0x7;
-      ft_cc = get_fcsr_condition_bit(ft_cc);
-      if (instr_.Bit(16)) {  // Read Tf bit.
-        // MOVT.D
-        if (test_fcsr_bit(ft_cc)) SetFPUDoubleResult(fd_reg(), fs);
-      } else {
-        // MOVF.D
-        if (!test_fcsr_bit(ft_cc)) SetFPUDoubleResult(fd_reg(), fs);
-      }
-      break;
-    }
-    case MINA:
-      DCHECK_EQ(kArchVariant, kMips64r6);
-      SetFPUDoubleResult(fd_reg(), FPUMinA(ft, fs));
-      break;
-    case MAXA:
-      DCHECK_EQ(kArchVariant, kMips64r6);
-      SetFPUDoubleResult(fd_reg(), FPUMaxA(ft, fs));
-      break;
-    case MIN:
-      DCHECK_EQ(kArchVariant, kMips64r6);
-      SetFPUDoubleResult(fd_reg(), FPUMin(ft, fs));
-      break;
-    case MAX:
-      DCHECK_EQ(kArchVariant, kMips64r6);
-      SetFPUDoubleResult(fd_reg(), FPUMax(ft, fs));
-      break;
-    case ADD_D:
-      SetFPUDoubleResult(
-          fd_reg(),
-          FPUCanonalizeOperation(
-              [](double lhs, double rhs) { return lhs + rhs; }, fs, ft));
-      break;
-    case SUB_D:
-      SetFPUDoubleResult(
-          fd_reg(),
-          FPUCanonalizeOperation(
-              [](double lhs, double rhs) { return lhs - rhs; }, fs, ft));
-      break;
-    case MADDF_D:
-      DCHECK_EQ(kArchVariant, kMips64r6);
-      SetFPUDoubleResult(fd_reg(), std::fma(fs, ft, fd));
-      break;
-    case MSUBF_D:
-      DCHECK_EQ(kArchVariant, kMips64r6);
-      SetFPUDoubleResult(fd_reg(), std::fma(-fs, ft, fd));
-      break;
-    case MUL_D:
-      SetFPUDoubleResult(
-          fd_reg(),
-          FPUCanonalizeOperation(
-              [](double lhs, double rhs) { return lhs * rhs; }, fs, ft));
-      break;
-    case DIV_D:
-      SetFPUDoubleResult(
-          fd_reg(),
-          FPUCanonalizeOperation(
-              [](double lhs, double rhs) { return lhs / rhs; }, fs, ft));
-      break;
-    case ABS_D:
-      SetFPUDoubleResult(
-          fd_reg(),
-          FPUCanonalizeOperation([](double fs) { return FPAbs(fs); }, fs));
-      break;
-    case MOV_D:
-      SetFPUDoubleResult(fd_reg(), fs);
-      break;
-    case NEG_D:
-      SetFPUDoubleResult(fd_reg(),
-                         FPUCanonalizeOperation([](double src) { return -src; },
-                                                KeepSign::yes, fs));
-      break;
-    case SQRT_D:
-      SetFPUDoubleResult(
-          fd_reg(),
-          FPUCanonalizeOperation([](double fs) { return std::sqrt(fs); }, fs));
-      break;
-    case RSQRT_D:
-      SetFPUDoubleResult(
-          fd_reg(), FPUCanonalizeOperation(
-                        [](double fs) { return 1.0 / std::sqrt(fs); }, fs));
-      break;
-    case RECIP_D:
-      SetFPUDoubleResult(fd_reg(), FPUCanonalizeOperation(
-                                       [](double fs) { return 1.0 / fs; }, fs));
-      break;
-    case C_UN_D:
-      set_fcsr_bit(fcsr_cc, std::isnan(fs) || std::isnan(ft));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case C_EQ_D:
-      set_fcsr_bit(fcsr_cc, (fs == ft));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case C_UEQ_D:
-      set_fcsr_bit(fcsr_cc, (fs == ft) || (std::isnan(fs) || std::isnan(ft)));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case C_OLT_D:
-      set_fcsr_bit(fcsr_cc, (fs < ft));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case C_ULT_D:
-      set_fcsr_bit(fcsr_cc, (fs < ft) || (std::isnan(fs) || std::isnan(ft)));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case C_OLE_D:
-      set_fcsr_bit(fcsr_cc, (fs <= ft));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case C_ULE_D:
-      set_fcsr_bit(fcsr_cc, (fs <= ft) || (std::isnan(fs) || std::isnan(ft)));
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    case CVT_W_D: {  // Convert double to word.
-      double rounded;
-      int32_t result;
-      round_according_to_fcsr(fs, rounded, result, fs);
-      SetFPUWordResult(fd_reg(), result);
-      if (set_fcsr_round_error(fs, rounded)) {
-        set_fpu_register_word_invalid_result(fs, rounded);
-      }
-      break;
-    }
-    case ROUND_W_D:  // Round double to word (round half to even).
-    {
-      double rounded = std::floor(fs + 0.5);
-      int32_t result = static_cast<int32_t>(rounded);
-      if ((result & 1) != 0 && result - fs == 0.5) {
-        // If the number is halfway between two integers,
-        // round to the even one.
-        result--;
-      }
-      SetFPUWordResult(fd_reg(), result);
-      if (set_fcsr_round_error(fs, rounded)) {
-        set_fpu_register_invalid_result(fs, rounded);
-      }
-    } break;
-    case TRUNC_W_D:  // Truncate double to word (round towards 0).
-    {
-      double rounded = trunc(fs);
-      int32_t result = static_cast<int32_t>(rounded);
-      SetFPUWordResult(fd_reg(), result);
-      if (set_fcsr_round_error(fs, rounded)) {
-        set_fpu_register_invalid_result(fs, rounded);
-      }
-    } break;
-    case FLOOR_W_D:  // Round double to word towards negative infinity.
-    {
-      double rounded = std::floor(fs);
-      int32_t result = static_cast<int32_t>(rounded);
-      SetFPUWordResult(fd_reg(), result);
-      if (set_fcsr_round_error(fs, rounded)) {
-        set_fpu_register_invalid_result(fs, rounded);
-      }
-    } break;
-    case CEIL_W_D:  // Round double to word towards positive infinity.
-    {
-      double rounded = std::ceil(fs);
-      int32_t result = static_cast<int32_t>(rounded);
-      SetFPUWordResult2(fd_reg(), result);
-      if (set_fcsr_round_error(fs, rounded)) {
-        set_fpu_register_invalid_result(fs, rounded);
-      }
-    } break;
-    case CVT_S_D:  // Convert double to float (single).
-      SetFPUFloatResult(fd_reg(), static_cast<float>(fs));
-      break;
-    case CVT_L_D: {  // Mips64r2: Truncate double to 64-bit long-word.
-      double rounded;
-      int64_t result;
-      round64_according_to_fcsr(fs, rounded, result, fs);
-      SetFPUResult(fd_reg(), result);
-      if (set_fcsr_round64_error(fs, rounded)) {
-        set_fpu_register_invalid_result64(fs, rounded);
-      }
-      break;
-    }
-    case ROUND_L_D: {  // Mips64r2 instruction.
-      double rounded = std::floor(fs + 0.5);
-      int64_t result = static_cast<int64_t>(rounded);
-      if ((result & 1) != 0 && result - fs == 0.5) {
-        // If the number is halfway between two integers,
-        // round to the even one.
-        result--;
-      }
-      int64_t i64 = static_cast<int64_t>(result);
-      SetFPUResult(fd_reg(), i64);
-      if (set_fcsr_round64_error(fs, rounded)) {
-        set_fpu_register_invalid_result64(fs, rounded);
-      }
-      break;
-    }
-    case TRUNC_L_D: {  // Mips64r2 instruction.
-      double rounded = trunc(fs);
-      int64_t result = static_cast<int64_t>(rounded);
-      SetFPUResult(fd_reg(), result);
-      if (set_fcsr_round64_error(fs, rounded)) {
-        set_fpu_register_invalid_result64(fs, rounded);
-      }
-      break;
-    }
-    case FLOOR_L_D: {  // Mips64r2 instruction.
-      double rounded = floor(fs);
-      int64_t result = static_cast<int64_t>(rounded);
-      SetFPUResult(fd_reg(), result);
-      if (set_fcsr_round64_error(fs, rounded)) {
-        set_fpu_register_invalid_result64(fs, rounded);
-      }
-      break;
-    }
-    case CEIL_L_D: {  // Mips64r2 instruction.
-      double rounded = ceil(fs);
-      int64_t result = static_cast<int64_t>(rounded);
-      SetFPUResult(fd_reg(), result);
-      if (set_fcsr_round64_error(fs, rounded)) {
-        set_fpu_register_invalid_result64(fs, rounded);
-      }
-      break;
-    }
-    case CLASS_D: {  // Mips64r6 instruction
-      // Convert double input to uint64_t for easier bit manipulation
-      uint64_t classed = bit_cast<uint64_t>(fs);
-
-      // Extracting sign, exponent and mantissa from the input double
-      uint32_t sign = (classed >> 63) & 1;
-      uint32_t exponent = (classed >> 52) & 0x00000000000007FF;
-      uint64_t mantissa = classed & 0x000FFFFFFFFFFFFF;
-      uint64_t result;
-      double dResult;
-
-      // Setting flags if input double is negative infinity,
-      // positive infinity, negative zero or positive zero
-      bool negInf = (classed == 0xFFF0000000000000);
-      bool posInf = (classed == 0x7FF0000000000000);
-      bool negZero = (classed == 0x8000000000000000);
-      bool posZero = (classed == 0x0000000000000000);
-
-      bool signalingNan;
-      bool quietNan;
-      bool negSubnorm;
-      bool posSubnorm;
-      bool negNorm;
-      bool posNorm;
-
-      // Setting flags if double is NaN
-      signalingNan = false;
-      quietNan = false;
-      if (!negInf && !posInf && exponent == 0x7FF) {
-        quietNan = ((mantissa & 0x0008000000000000) != 0) &&
-                   ((mantissa & (0x0008000000000000 - 1)) == 0);
-        signalingNan = !quietNan;
-      }
-
-      // Setting flags if double is subnormal number
-      posSubnorm = false;
-      negSubnorm = false;
-      if ((exponent == 0) && (mantissa != 0)) {
-        DCHECK(sign == 0 || sign == 1);
-        posSubnorm = (sign == 0);
-        negSubnorm = (sign == 1);
-      }
-
-      // Setting flags if double is normal number
-      posNorm = false;
-      negNorm = false;
-      if (!posSubnorm && !negSubnorm && !posInf && !negInf && !signalingNan &&
-          !quietNan && !negZero && !posZero) {
-        DCHECK(sign == 0 || sign == 1);
-        posNorm = (sign == 0);
-        negNorm = (sign == 1);
-      }
-
-      // Calculating result according to description of CLASS.D instruction
-      result = (posZero << 9) | (posSubnorm << 8) | (posNorm << 7) |
-               (posInf << 6) | (negZero << 5) | (negSubnorm << 4) |
-               (negNorm << 3) | (negInf << 2) | (quietNan << 1) | signalingNan;
-
-      DCHECK_NE(result, 0);
-
-      dResult = bit_cast<double>(result);
-      SetFPUDoubleResult(fd_reg(), dResult);
-      break;
-    }
-    case C_F_D: {
-      set_fcsr_bit(fcsr_cc, false);
-      TraceRegWr(test_fcsr_bit(fcsr_cc));
-      break;
-    }
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-void Simulator::DecodeTypeRegisterWRsType() {
-  float fs = get_fpu_register_float(fs_reg());
-  float ft = get_fpu_register_float(ft_reg());
-  int64_t alu_out = 0x12345678;
-  switch (instr_.FunctionFieldRaw()) {
-    case CVT_S_W:  // Convert word to float (single).
-      alu_out = get_fpu_register_signed_word(fs_reg());
-      SetFPUFloatResult(fd_reg(), static_cast<float>(alu_out));
-      break;
-    case CVT_D_W:  // Convert word to double.
-      alu_out = get_fpu_register_signed_word(fs_reg());
-      SetFPUDoubleResult(fd_reg(), static_cast<double>(alu_out));
-      break;
-    case CMP_AF:
-      SetFPUWordResult2(fd_reg(), 0);
-      break;
-    case CMP_UN:
-      if (std::isnan(fs) || std::isnan(ft)) {
-        SetFPUWordResult2(fd_reg(), -1);
-      } else {
-        SetFPUWordResult2(fd_reg(), 0);
-      }
-      break;
-    case CMP_EQ:
-      if (fs == ft) {
-        SetFPUWordResult2(fd_reg(), -1);
-      } else {
-        SetFPUWordResult2(fd_reg(), 0);
-      }
-      break;
-    case CMP_UEQ:
-      if ((fs == ft) || (std::isnan(fs) || std::isnan(ft))) {
-        SetFPUWordResult2(fd_reg(), -1);
-      } else {
-        SetFPUWordResult2(fd_reg(), 0);
-      }
-      break;
-    case CMP_LT:
-      if (fs < ft) {
-        SetFPUWordResult2(fd_reg(), -1);
-      } else {
-        SetFPUWordResult2(fd_reg(), 0);
-      }
-      break;
-    case CMP_ULT:
-      if ((fs < ft) || (std::isnan(fs) || std::isnan(ft))) {
-        SetFPUWordResult2(fd_reg(), -1);
-      } else {
-        SetFPUWordResult2(fd_reg(), 0);
-      }
-      break;
-    case CMP_LE:
-      if (fs <= ft) {
-        SetFPUWordResult2(fd_reg(), -1);
-      } else {
-        SetFPUWordResult2(fd_reg(), 0);
-      }
-      break;
-    case CMP_ULE:
-      if ((fs <= ft) || (std::isnan(fs) || std::isnan(ft))) {
-        SetFPUWordResult2(fd_reg(), -1);
-      } else {
-        SetFPUWordResult2(fd_reg(), 0);
-      }
-      break;
-    case CMP_OR:
-      if (!std::isnan(fs) && !std::isnan(ft)) {
-        SetFPUWordResult2(fd_reg(), -1);
-      } else {
-        SetFPUWordResult2(fd_reg(), 0);
-      }
-      break;
-    case CMP_UNE:
-      if ((fs != ft) || (std::isnan(fs) || std::isnan(ft))) {
-        SetFPUWordResult2(fd_reg(), -1);
-      } else {
-        SetFPUWordResult2(fd_reg(), 0);
-      }
-      break;
-    case CMP_NE:
-      if (fs != ft) {
-        SetFPUWordResult2(fd_reg(), -1);
-      } else {
-        SetFPUWordResult2(fd_reg(), 0);
-      }
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-void Simulator::DecodeTypeRegisterLRsType() {
-  double fs = get_fpu_register_double(fs_reg());
-  double ft = get_fpu_register_double(ft_reg());
-  int64_t i64;
-  switch (instr_.FunctionFieldRaw()) {
-    case CVT_D_L:  // Mips32r2 instruction.
-      i64 = get_fpu_register(fs_reg());
-      SetFPUDoubleResult(fd_reg(), static_cast<double>(i64));
-      break;
-    case CVT_S_L:
-      i64 = get_fpu_register(fs_reg());
-      SetFPUFloatResult(fd_reg(), static_cast<float>(i64));
-      break;
-    case CMP_AF:
-      SetFPUResult(fd_reg(), 0);
-      break;
-    case CMP_UN:
-      if (std::isnan(fs) || std::isnan(ft)) {
-        SetFPUResult(fd_reg(), -1);
-      } else {
-        SetFPUResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_EQ:
-      if (fs == ft) {
-        SetFPUResult(fd_reg(), -1);
-      } else {
-        SetFPUResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_UEQ:
-      if ((fs == ft) || (std::isnan(fs) || std::isnan(ft))) {
-        SetFPUResult(fd_reg(), -1);
-      } else {
-        SetFPUResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_LT:
-      if (fs < ft) {
-        SetFPUResult(fd_reg(), -1);
-      } else {
-        SetFPUResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_ULT:
-      if ((fs < ft) || (std::isnan(fs) || std::isnan(ft))) {
-        SetFPUResult(fd_reg(), -1);
-      } else {
-        SetFPUResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_LE:
-      if (fs <= ft) {
-        SetFPUResult(fd_reg(), -1);
-      } else {
-        SetFPUResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_ULE:
-      if ((fs <= ft) || (std::isnan(fs) || std::isnan(ft))) {
-        SetFPUResult(fd_reg(), -1);
-      } else {
-        SetFPUResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_OR:
-      if (!std::isnan(fs) && !std::isnan(ft)) {
-        SetFPUResult(fd_reg(), -1);
-      } else {
-        SetFPUResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_UNE:
-      if ((fs != ft) || (std::isnan(fs) || std::isnan(ft))) {
-        SetFPUResult(fd_reg(), -1);
-      } else {
-        SetFPUResult(fd_reg(), 0);
-      }
-      break;
-    case CMP_NE:
-      if (fs != ft && (!std::isnan(fs) && !std::isnan(ft))) {
-        SetFPUResult(fd_reg(), -1);
-      } else {
-        SetFPUResult(fd_reg(), 0);
-      }
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-void Simulator::DecodeTypeRegisterCOP1() {
-  switch (instr_.RsFieldRaw()) {
-    case BC1:  // Branch on coprocessor condition.
-    case BC1EQZ:
-    case BC1NEZ:
-      UNREACHABLE();
-      break;
-    case CFC1:
-      // At the moment only FCSR is supported.
-      DCHECK_EQ(fs_reg(), kFCSRRegister);
-      SetResult(rt_reg(), FCSR_);
-      break;
-    case MFC1:
-      set_register(rt_reg(),
-                   static_cast<int64_t>(get_fpu_register_word(fs_reg())));
-      TraceRegWr(get_register(rt_reg()), WORD_DWORD);
-      break;
-    case DMFC1:
-      SetResult(rt_reg(), get_fpu_register(fs_reg()));
-      break;
-    case MFHC1:
-      SetResult(rt_reg(), get_fpu_register_hi_word(fs_reg()));
-      break;
-    case CTC1: {
-      // At the moment only FCSR is supported.
-      DCHECK_EQ(fs_reg(), kFCSRRegister);
-      uint32_t reg = static_cast<uint32_t>(rt());
-      if (kArchVariant == kMips64r6) {
-        FCSR_ = reg | kFCSRNaN2008FlagMask;
-      } else {
-        DCHECK_EQ(kArchVariant, kMips64r2);
-        FCSR_ = reg & ~kFCSRNaN2008FlagMask;
-      }
-      TraceRegWr(FCSR_);
-      break;
-    }
-    case MTC1:
-      // Hardware writes upper 32-bits to zero on mtc1.
-      set_fpu_register_hi_word(fs_reg(), 0);
-      set_fpu_register_word(fs_reg(), static_cast<int32_t>(rt()));
-      TraceRegWr(get_fpu_register(fs_reg()), FLOAT_DOUBLE);
-      break;
-    case DMTC1:
-      SetFPUResult2(fs_reg(), rt());
-      break;
-    case MTHC1:
-      set_fpu_register_hi_word(fs_reg(), static_cast<int32_t>(rt()));
-      TraceRegWr(get_fpu_register(fs_reg()), DOUBLE);
-      break;
-    case S:
-      DecodeTypeRegisterSRsType();
-      break;
-    case D:
-      DecodeTypeRegisterDRsType();
-      break;
-    case W:
-      DecodeTypeRegisterWRsType();
-      break;
-    case L:
-      DecodeTypeRegisterLRsType();
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-void Simulator::DecodeTypeRegisterCOP1X() {
-  switch (instr_.FunctionFieldRaw()) {
-    case MADD_S: {
-      DCHECK_EQ(kArchVariant, kMips64r2);
-      float fr, ft, fs;
-      fr = get_fpu_register_float(fr_reg());
-      fs = get_fpu_register_float(fs_reg());
-      ft = get_fpu_register_float(ft_reg());
-      SetFPUFloatResult(fd_reg(), fs * ft + fr);
-      break;
-    }
-    case MSUB_S: {
-      DCHECK_EQ(kArchVariant, kMips64r2);
-      float fr, ft, fs;
-      fr = get_fpu_register_float(fr_reg());
-      fs = get_fpu_register_float(fs_reg());
-      ft = get_fpu_register_float(ft_reg());
-      SetFPUFloatResult(fd_reg(), fs * ft - fr);
-      break;
-    }
-    case MADD_D: {
-      DCHECK_EQ(kArchVariant, kMips64r2);
-      double fr, ft, fs;
-      fr = get_fpu_register_double(fr_reg());
-      fs = get_fpu_register_double(fs_reg());
-      ft = get_fpu_register_double(ft_reg());
-      SetFPUDoubleResult(fd_reg(), fs * ft + fr);
-      break;
-    }
-    case MSUB_D: {
-      DCHECK_EQ(kArchVariant, kMips64r2);
-      double fr, ft, fs;
-      fr = get_fpu_register_double(fr_reg());
-      fs = get_fpu_register_double(fs_reg());
-      ft = get_fpu_register_double(ft_reg());
-      SetFPUDoubleResult(fd_reg(), fs * ft - fr);
-      break;
-    }
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-void Simulator::DecodeTypeRegisterSPECIAL() {
-  int64_t i64hilo;
-  uint64_t u64hilo;
-  int64_t alu_out;
-  bool do_interrupt = false;
-
-  switch (instr_.FunctionFieldRaw()) {
-    case SELEQZ_S:
-      DCHECK_EQ(kArchVariant, kMips64r6);
-      SetResult(rd_reg(), rt() == 0 ? rs() : 0);
-      break;
-    case SELNEZ_S:
-      DCHECK_EQ(kArchVariant, kMips64r6);
-      SetResult(rd_reg(), rt() != 0 ? rs() : 0);
-      break;
-    case JR: {
-      int64_t next_pc = rs();
-      int64_t current_pc = get_pc();
-      Instruction* branch_delay_instr =
-          reinterpret_cast<Instruction*>(current_pc + Instruction::kInstrSize);
-      BranchDelayInstructionDecode(branch_delay_instr);
-      set_pc(next_pc);
-      pc_modified_ = true;
-      break;
-    }
-    case JALR: {
-      int64_t next_pc = rs();
-      int64_t current_pc = get_pc();
-      int32_t return_addr_reg = rd_reg();
-      Instruction* branch_delay_instr =
-          reinterpret_cast<Instruction*>(current_pc + Instruction::kInstrSize);
-      BranchDelayInstructionDecode(branch_delay_instr);
-      set_register(return_addr_reg, current_pc + 2 * Instruction::kInstrSize);
-      set_pc(next_pc);
-      pc_modified_ = true;
-      break;
-    }
-    case SLL:
-      SetResult(rd_reg(), static_cast<int32_t>(rt()) << sa());
-      break;
-    case DSLL:
-      SetResult(rd_reg(), rt() << sa());
-      break;
-    case DSLL32:
-      SetResult(rd_reg(), rt() << sa() << 32);
-      break;
-    case SRL:
-      if (rs_reg() == 0) {
-        // Regular logical right shift of a word by a fixed number of
-        // bits instruction. RS field is always equal to 0.
-        // Sign-extend the 32-bit result.
-        alu_out = static_cast<int32_t>(static_cast<uint32_t>(rt_u()) >> sa());
-      } else if (rs_reg() == 1) {
-        // Logical right-rotate of a word by a fixed number of bits. This
-        // is special case of SRL instruction, added in MIPS32 Release 2.
-        // RS field is equal to 00001.
-        alu_out = static_cast<int32_t>(
-            base::bits::RotateRight32(static_cast<const uint32_t>(rt_u()),
-                                      static_cast<const uint32_t>(sa())));
-      } else {
-        UNREACHABLE();
-      }
-      SetResult(rd_reg(), alu_out);
-      break;
-    case DSRL:
-      if (rs_reg() == 0) {
-        // Regular logical right shift of a word by a fixed number of
-        // bits instruction. RS field is always equal to 0.
-        // Sign-extend the 64-bit result.
-        alu_out = static_cast<int64_t>(rt_u() >> sa());
-      } else if (rs_reg() == 1) {
-        // Logical right-rotate of a word by a fixed number of bits. This
-        // is special case of SRL instruction, added in MIPS32 Release 2.
-        // RS field is equal to 00001.
-        alu_out = static_cast<int64_t>(base::bits::RotateRight64(rt_u(), sa()));
-      } else {
-        UNREACHABLE();
-      }
-      SetResult(rd_reg(), alu_out);
-      break;
-    case DSRL32:
-      if (rs_reg() == 0) {
-        // Regular logical right shift of a word by a fixed number of
-        // bits instruction. RS field is always equal to 0.
-        // Sign-extend the 64-bit result.
-        alu_out = static_cast<int64_t>(rt_u() >> sa() >> 32);
-      } else if (rs_reg() == 1) {
-        // Logical right-rotate of a word by a fixed number of bits. This
-        // is special case of SRL instruction, added in MIPS32 Release 2.
-        // RS field is equal to 00001.
-        alu_out =
-            static_cast<int64_t>(base::bits::RotateRight64(rt_u(), sa() + 32));
-      } else {
-        UNREACHABLE();
-      }
-      SetResult(rd_reg(), alu_out);
-      break;
-    case SRA:
-      SetResult(rd_reg(), (int32_t)rt() >> sa());
-      break;
-    case DSRA:
-      SetResult(rd_reg(), rt() >> sa());
-      break;
-    case DSRA32:
-      SetResult(rd_reg(), rt() >> sa() >> 32);
-      break;
-    case SLLV:
-      SetResult(rd_reg(), (int32_t)rt() << rs());
-      break;
-    case DSLLV:
-      SetResult(rd_reg(), rt() << rs());
-      break;
-    case SRLV:
-      if (sa() == 0) {
-        // Regular logical right-shift of a word by a variable number of
-        // bits instruction. SA field is always equal to 0.
-        alu_out = static_cast<int32_t>((uint32_t)rt_u() >> rs());
-      } else {
-        // Logical right-rotate of a word by a variable number of bits.
-        // This is special case od SRLV instruction, added in MIPS32
-        // Release 2. SA field is equal to 00001.
-        alu_out = static_cast<int32_t>(
-            base::bits::RotateRight32(static_cast<const uint32_t>(rt_u()),
-                                      static_cast<const uint32_t>(rs_u())));
-      }
-      SetResult(rd_reg(), alu_out);
-      break;
-    case DSRLV:
-      if (sa() == 0) {
-        // Regular logical right-shift of a word by a variable number of
-        // bits instruction. SA field is always equal to 0.
-        alu_out = static_cast<int64_t>(rt_u() >> rs());
-      } else {
-        // Logical right-rotate of a word by a variable number of bits.
-        // This is special case od SRLV instruction, added in MIPS32
-        // Release 2. SA field is equal to 00001.
-        alu_out =
-            static_cast<int64_t>(base::bits::RotateRight64(rt_u(), rs_u()));
-      }
-      SetResult(rd_reg(), alu_out);
-      break;
-    case SRAV:
-      SetResult(rd_reg(), (int32_t)rt() >> rs());
-      break;
-    case DSRAV:
-      SetResult(rd_reg(), rt() >> rs());
-      break;
-    case LSA: {
-      DCHECK_EQ(kArchVariant, kMips64r6);
-      int8_t sa = lsa_sa() + 1;
-      int32_t _rt = static_cast<int32_t>(rt());
-      int32_t _rs = static_cast<int32_t>(rs());
-      int32_t res = _rs << sa;
-      res += _rt;
-      SetResult(rd_reg(), static_cast<int64_t>(res));
-      break;
-    }
-    case DLSA:
-      DCHECK_EQ(kArchVariant, kMips64r6);
-      SetResult(rd_reg(), (rs() << (lsa_sa() + 1)) + rt());
-      break;
-    case MFHI:  // MFHI == CLZ on R6.
-      if (kArchVariant != kMips64r6) {
-        DCHECK_EQ(sa(), 0);
-        alu_out = get_register(HI);
-      } else {
-        // MIPS spec: If no bits were set in GPR rs(), the result written to
-        // GPR rd() is 32.
-        DCHECK_EQ(sa(), 1);
-        alu_out = base::bits::CountLeadingZeros32(static_cast<int32_t>(rs_u()));
-      }
-      SetResult(rd_reg(), alu_out);
-      break;
-    case MFLO:  // MFLO == DCLZ on R6.
-      if (kArchVariant != kMips64r6) {
-        DCHECK_EQ(sa(), 0);
-        alu_out = get_register(LO);
-      } else {
-        // MIPS spec: If no bits were set in GPR rs(), the result written to
-        // GPR rd() is 64.
-        DCHECK_EQ(sa(), 1);
-        alu_out = base::bits::CountLeadingZeros64(static_cast<int64_t>(rs_u()));
-      }
-      SetResult(rd_reg(), alu_out);
-      break;
-    // Instructions using HI and LO registers.
-    case MULT: {  // MULT == D_MUL_MUH.
-      int32_t rs_lo = static_cast<int32_t>(rs());
-      int32_t rt_lo = static_cast<int32_t>(rt());
-      i64hilo = static_cast<int64_t>(rs_lo) * static_cast<int64_t>(rt_lo);
-      if (kArchVariant != kMips64r6) {
-        set_register(LO, static_cast<int32_t>(i64hilo & 0xFFFFFFFF));
-        set_register(HI, static_cast<int32_t>(i64hilo >> 32));
-      } else {
-        switch (sa()) {
-          case MUL_OP:
-            SetResult(rd_reg(), static_cast<int32_t>(i64hilo & 0xFFFFFFFF));
-            break;
-          case MUH_OP:
-            SetResult(rd_reg(), static_cast<int32_t>(i64hilo >> 32));
-            break;
-          default:
-            UNIMPLEMENTED_MIPS();
-            break;
-        }
-      }
-      break;
-    }
-    case MULTU:
-      u64hilo = static_cast<uint64_t>(rs_u() & 0xFFFFFFFF) *
-                static_cast<uint64_t>(rt_u() & 0xFFFFFFFF);
-      if (kArchVariant != kMips64r6) {
-        set_register(LO, static_cast<int32_t>(u64hilo & 0xFFFFFFFF));
-        set_register(HI, static_cast<int32_t>(u64hilo >> 32));
-      } else {
-        switch (sa()) {
-          case MUL_OP:
-            SetResult(rd_reg(), static_cast<int32_t>(u64hilo & 0xFFFFFFFF));
-            break;
-          case MUH_OP:
-            SetResult(rd_reg(), static_cast<int32_t>(u64hilo >> 32));
-            break;
-          default:
-            UNIMPLEMENTED_MIPS();
-            break;
-        }
-      }
-      break;
-    case DMULT:  // DMULT == D_MUL_MUH.
-      if (kArchVariant != kMips64r6) {
-        set_register(LO, rs() * rt());
-        set_register(HI, MultiplyHighSigned(rs(), rt()));
-      } else {
-        switch (sa()) {
-          case MUL_OP:
-            SetResult(rd_reg(), rs() * rt());
-            break;
-          case MUH_OP:
-            SetResult(rd_reg(), MultiplyHighSigned(rs(), rt()));
-            break;
-          default:
-            UNIMPLEMENTED_MIPS();
-            break;
-        }
-      }
-      break;
-    case DMULTU:
-      UNIMPLEMENTED_MIPS();
-      break;
-    case DIV:
-    case DDIV: {
-      const int64_t int_min_value =
-          instr_.FunctionFieldRaw() == DIV ? INT_MIN : LONG_MIN;
-      switch (kArchVariant) {
-        case kMips64r2:
-          // Divide by zero and overflow was not checked in the
-          // configuration step - div and divu do not raise exceptions. On
-          // division by 0 the result will be UNPREDICTABLE. On overflow
-          // (INT_MIN/-1), return INT_MIN which is what the hardware does.
-          if (rs() == int_min_value && rt() == -1) {
-            set_register(LO, int_min_value);
-            set_register(HI, 0);
-          } else if (rt() != 0) {
-            set_register(LO, rs() / rt());
-            set_register(HI, rs() % rt());
-          }
-          break;
-        case kMips64r6:
-          switch (sa()) {
-            case DIV_OP:
-              if (rs() == int_min_value && rt() == -1) {
-                SetResult(rd_reg(), int_min_value);
-              } else if (rt() != 0) {
-                SetResult(rd_reg(), rs() / rt());
-              }
-              break;
-            case MOD_OP:
-              if (rs() == int_min_value && rt() == -1) {
-                SetResult(rd_reg(), 0);
-              } else if (rt() != 0) {
-                SetResult(rd_reg(), rs() % rt());
-              }
-              break;
-            default:
-              UNIMPLEMENTED_MIPS();
-              break;
-          }
-          break;
-        default:
-          break;
-      }
-      break;
-    }
-    case DIVU:
-      switch (kArchVariant) {
-        case kMips64r6: {
-          uint32_t rt_u_32 = static_cast<uint32_t>(rt_u());
-          uint32_t rs_u_32 = static_cast<uint32_t>(rs_u());
-          switch (sa()) {
-            case DIV_OP:
-              if (rt_u_32 != 0) {
-                SetResult(rd_reg(), rs_u_32 / rt_u_32);
-              }
-              break;
-            case MOD_OP:
-              if (rt_u() != 0) {
-                SetResult(rd_reg(), rs_u_32 % rt_u_32);
-              }
-              break;
-            default:
-              UNIMPLEMENTED_MIPS();
-              break;
-          }
-        } break;
-        default: {
-          if (rt_u() != 0) {
-            uint32_t rt_u_32 = static_cast<uint32_t>(rt_u());
-            uint32_t rs_u_32 = static_cast<uint32_t>(rs_u());
-            set_register(LO, rs_u_32 / rt_u_32);
-            set_register(HI, rs_u_32 % rt_u_32);
-          }
-        }
-      }
-      break;
-    case DDIVU:
-      switch (kArchVariant) {
-        case kMips64r6: {
-          switch (instr_.SaValue()) {
-            case DIV_OP:
-              if (rt_u() != 0) {
-                SetResult(rd_reg(), rs_u() / rt_u());
-              }
-              break;
-            case MOD_OP:
-              if (rt_u() != 0) {
-                SetResult(rd_reg(), rs_u() % rt_u());
-              }
-              break;
-            default:
-              UNIMPLEMENTED_MIPS();
-              break;
-          }
-        } break;
-        default: {
-          if (rt_u() != 0) {
-            set_register(LO, rs_u() / rt_u());
-            set_register(HI, rs_u() % rt_u());
-          }
-        }
-      }
-      break;
-    case ADD:
-    case DADD:
-      if (HaveSameSign(rs(), rt())) {
-        if (rs() > 0) {
-          if (rs() > (Registers::kMaxValue - rt())) {
-            SignalException(kIntegerOverflow);
-          }
-        } else if (rs() < 0) {
-          if (rs() < (Registers::kMinValue - rt())) {
-            SignalException(kIntegerUnderflow);
-          }
-        }
-      }
-      SetResult(rd_reg(), rs() + rt());
-      break;
-    case ADDU: {
-      int32_t alu32_out = static_cast<int32_t>(rs() + rt());
-      // Sign-extend result of 32bit operation into 64bit register.
-      SetResult(rd_reg(), static_cast<int64_t>(alu32_out));
-      break;
-    }
-    case DADDU:
-      SetResult(rd_reg(), rs() + rt());
-      break;
-    case SUB:
-    case DSUB:
-      if (!HaveSameSign(rs(), rt())) {
-        if (rs() > 0) {
-          if (rs() > (Registers::kMaxValue + rt())) {
-            SignalException(kIntegerOverflow);
-          }
-        } else if (rs() < 0) {
-          if (rs() < (Registers::kMinValue + rt())) {
-            SignalException(kIntegerUnderflow);
-          }
-        }
-      }
-      SetResult(rd_reg(), rs() - rt());
-      break;
-    case SUBU: {
-      int32_t alu32_out = static_cast<int32_t>(rs() - rt());
-      // Sign-extend result of 32bit operation into 64bit register.
-      SetResult(rd_reg(), static_cast<int64_t>(alu32_out));
-      break;
-    }
-    case DSUBU:
-      SetResult(rd_reg(), rs() - rt());
-      break;
-    case AND:
-      SetResult(rd_reg(), rs() & rt());
-      break;
-    case OR:
-      SetResult(rd_reg(), rs() | rt());
-      break;
-    case XOR:
-      SetResult(rd_reg(), rs() ^ rt());
-      break;
-    case NOR:
-      SetResult(rd_reg(), ~(rs() | rt()));
-      break;
-    case SLT:
-      SetResult(rd_reg(), rs() < rt() ? 1 : 0);
-      break;
-    case SLTU:
-      SetResult(rd_reg(), rs_u() < rt_u() ? 1 : 0);
-      break;
-    // Break and trap instructions.
-    case BREAK:
-      do_interrupt = true;
-      break;
-    case TGE:
-      do_interrupt = rs() >= rt();
-      break;
-    case TGEU:
-      do_interrupt = rs_u() >= rt_u();
-      break;
-    case TLT:
-      do_interrupt = rs() < rt();
-      break;
-    case TLTU:
-      do_interrupt = rs_u() < rt_u();
-      break;
-    case TEQ:
-      do_interrupt = rs() == rt();
-      break;
-    case TNE:
-      do_interrupt = rs() != rt();
-      break;
-    case SYNC:
-      // TODO(palfia): Ignore sync instruction for now.
-      break;
-    // Conditional moves.
-    case MOVN:
-      if (rt()) {
-        SetResult(rd_reg(), rs());
-      }
-      break;
-    case MOVCI: {
-      uint32_t cc = instr_.FBccValue();
-      uint32_t fcsr_cc = get_fcsr_condition_bit(cc);
-      if (instr_.Bit(16)) {  // Read Tf bit.
-        if (test_fcsr_bit(fcsr_cc)) SetResult(rd_reg(), rs());
-      } else {
-        if (!test_fcsr_bit(fcsr_cc)) SetResult(rd_reg(), rs());
-      }
-      break;
-    }
-    case MOVZ:
-      if (!rt()) {
-        SetResult(rd_reg(), rs());
-      }
-      break;
-    default:
-      UNREACHABLE();
-  }
-  if (do_interrupt) {
-    SoftwareInterrupt();
-  }
-}
-
-
-void Simulator::DecodeTypeRegisterSPECIAL2() {
-  int64_t alu_out;
-  switch (instr_.FunctionFieldRaw()) {
-    case MUL:
-      alu_out = static_cast<int32_t>(rs_u()) * static_cast<int32_t>(rt_u());
-      SetResult(rd_reg(), alu_out);
-      // HI and LO are UNPREDICTABLE after the operation.
-      set_register(LO, Unpredictable);
-      set_register(HI, Unpredictable);
-      break;
-    case CLZ:
-      // MIPS32 spec: If no bits were set in GPR rs(), the result written to
-      // GPR rd is 32.
-      alu_out = base::bits::CountLeadingZeros32(static_cast<uint32_t>(rs_u()));
-      SetResult(rd_reg(), alu_out);
-      break;
-    case DCLZ:
-      // MIPS64 spec: If no bits were set in GPR rs(), the result written to
-      // GPR rd is 64.
-      alu_out = base::bits::CountLeadingZeros64(static_cast<uint64_t>(rs_u()));
-      SetResult(rd_reg(), alu_out);
-      break;
-    default:
-      alu_out = 0x12345678;
-      UNREACHABLE();
-  }
-}
-
-
-void Simulator::DecodeTypeRegisterSPECIAL3() {
-  int64_t alu_out;
-  switch (instr_.FunctionFieldRaw()) {
-    case EXT: {  // Mips32r2 instruction.
-      // Interpret rd field as 5-bit msbd of extract.
-      uint16_t msbd = rd_reg();
-      // Interpret sa field as 5-bit lsb of extract.
-      uint16_t lsb = sa();
-      uint16_t size = msbd + 1;
-      uint64_t mask = (1ULL << size) - 1;
-      alu_out = static_cast<int32_t>((rs_u() & (mask << lsb)) >> lsb);
-      SetResult(rt_reg(), alu_out);
-      break;
-    }
-    case DEXT: {  // Mips64r2 instruction.
-      // Interpret rd field as 5-bit msbd of extract.
-      uint16_t msbd = rd_reg();
-      // Interpret sa field as 5-bit lsb of extract.
-      uint16_t lsb = sa();
-      uint16_t size = msbd + 1;
-      uint64_t mask = (size == 64) ? UINT64_MAX : (1ULL << size) - 1;
-      alu_out = static_cast<int64_t>((rs_u() & (mask << lsb)) >> lsb);
-      SetResult(rt_reg(), alu_out);
-      break;
-    }
-    case DEXTM: {
-      // Interpret rd field as 5-bit msbdminus32 of extract.
-      uint16_t msbdminus32 = rd_reg();
-      // Interpret sa field as 5-bit lsb of extract.
-      uint16_t lsb = sa();
-      uint16_t size = msbdminus32 + 1 + 32;
-      uint64_t mask = (size == 64) ? UINT64_MAX : (1ULL << size) - 1;
-      alu_out = static_cast<int64_t>((rs_u() & (mask << lsb)) >> lsb);
-      SetResult(rt_reg(), alu_out);
-      break;
-    }
-    case DEXTU: {
-      // Interpret rd field as 5-bit msbd of extract.
-      uint16_t msbd = rd_reg();
-      // Interpret sa field as 5-bit lsbminus32 of extract and add 32 to get
-      // lsb.
-      uint16_t lsb = sa() + 32;
-      uint16_t size = msbd + 1;
-      uint64_t mask = (size == 64) ? UINT64_MAX : (1ULL << size) - 1;
-      alu_out = static_cast<int64_t>((rs_u() & (mask << lsb)) >> lsb);
-      SetResult(rt_reg(), alu_out);
-      break;
-    }
-    case INS: {  // Mips32r2 instruction.
-      // Interpret rd field as 5-bit msb of insert.
-      uint16_t msb = rd_reg();
-      // Interpret sa field as 5-bit lsb of insert.
-      uint16_t lsb = sa();
-      uint16_t size = msb - lsb + 1;
-      uint64_t mask = (1ULL << size) - 1;
-      alu_out = static_cast<int32_t>((rt_u() & ~(mask << lsb)) |
-                                     ((rs_u() & mask) << lsb));
-      SetResult(rt_reg(), alu_out);
-      break;
-    }
-    case DINS: {  // Mips64r2 instruction.
-      // Interpret rd field as 5-bit msb of insert.
-      uint16_t msb = rd_reg();
-      // Interpret sa field as 5-bit lsb of insert.
-      uint16_t lsb = sa();
-      uint16_t size = msb - lsb + 1;
-      uint64_t mask = (1ULL << size) - 1;
-      alu_out = (rt_u() & ~(mask << lsb)) | ((rs_u() & mask) << lsb);
-      SetResult(rt_reg(), alu_out);
-      break;
-    }
-    case DINSM: {  // Mips64r2 instruction.
-      // Interpret rd field as 5-bit msbminus32 of insert.
-      uint16_t msbminus32 = rd_reg();
-      // Interpret sa field as 5-bit lsb of insert.
-      uint16_t lsb = sa();
-      uint16_t size = msbminus32 + 32 - lsb + 1;
-      uint64_t mask;
-      if (size < 64)
-        mask = (1ULL << size) - 1;
-      else
-        mask = std::numeric_limits<uint64_t>::max();
-      alu_out = (rt_u() & ~(mask << lsb)) | ((rs_u() & mask) << lsb);
-      SetResult(rt_reg(), alu_out);
-      break;
-    }
-    case DINSU: {  // Mips64r2 instruction.
-      // Interpret rd field as 5-bit msbminus32 of insert.
-      uint16_t msbminus32 = rd_reg();
-      // Interpret rd field as 5-bit lsbminus32 of insert.
-      uint16_t lsbminus32 = sa();
-      uint16_t lsb = lsbminus32 + 32;
-      uint16_t size = msbminus32 + 32 - lsb + 1;
-      uint64_t mask = (1ULL << size) - 1;
-      alu_out = (rt_u() & ~(mask << lsb)) | ((rs_u() & mask) << lsb);
-      SetResult(rt_reg(), alu_out);
-      break;
-    }
-    case BSHFL: {
-      int32_t sa = instr_.SaFieldRaw() >> kSaShift;
-      switch (sa) {
-        case BITSWAP: {
-          uint32_t input = static_cast<uint32_t>(rt());
-          uint32_t output = 0;
-          uint8_t i_byte, o_byte;
-
-          // Reverse the bit in byte for each individual byte
-          for (int i = 0; i < 4; i++) {
-            output = output >> 8;
-            i_byte = input & 0xFF;
-
-            // Fast way to reverse bits in byte
-            // Devised by Sean Anderson, July 13, 2001
-            o_byte = static_cast<uint8_t>(((i_byte * 0x0802LU & 0x22110LU) |
-                                           (i_byte * 0x8020LU & 0x88440LU)) *
-                                              0x10101LU >>
-                                          16);
-
-            output = output | (static_cast<uint32_t>(o_byte << 24));
-            input = input >> 8;
-          }
-
-          alu_out = static_cast<int64_t>(static_cast<int32_t>(output));
-          break;
-        }
-        case SEB: {
-          uint8_t input = static_cast<uint8_t>(rt());
-          uint32_t output = input;
-          uint32_t mask = 0x00000080;
-
-          // Extending sign
-          if (mask & input) {
-            output |= 0xFFFFFF00;
-          }
-
-          alu_out = static_cast<int32_t>(output);
-          break;
-        }
-        case SEH: {
-          uint16_t input = static_cast<uint16_t>(rt());
-          uint32_t output = input;
-          uint32_t mask = 0x00008000;
-
-          // Extending sign
-          if (mask & input) {
-            output |= 0xFFFF0000;
-          }
-
-          alu_out = static_cast<int32_t>(output);
-          break;
-        }
-        case WSBH: {
-          uint32_t input = static_cast<uint32_t>(rt());
-          uint64_t output = 0;
-
-          uint32_t mask = 0xFF000000;
-          for (int i = 0; i < 4; i++) {
-            uint32_t tmp = mask & input;
-            if (i % 2 == 0) {
-              tmp = tmp >> 8;
-            } else {
-              tmp = tmp << 8;
-            }
-            output = output | tmp;
-            mask = mask >> 8;
-          }
-          mask = 0x80000000;
-
-          // Extending sign
-          if (mask & output) {
-            output |= 0xFFFFFFFF00000000;
-          }
-
-          alu_out = static_cast<int64_t>(output);
-          break;
-        }
-        default: {
-          const uint8_t bp2 = instr_.Bp2Value();
-          sa >>= kBp2Bits;
-          switch (sa) {
-            case ALIGN: {
-              if (bp2 == 0) {
-                alu_out = static_cast<int32_t>(rt());
-              } else {
-                uint64_t rt_hi = rt() << (8 * bp2);
-                uint64_t rs_lo = rs() >> (8 * (4 - bp2));
-                alu_out = static_cast<int32_t>(rt_hi | rs_lo);
-              }
-              break;
-            }
-            default:
-              alu_out = 0x12345678;
-              UNREACHABLE();
-              break;
-          }
-          break;
-        }
-      }
-      SetResult(rd_reg(), alu_out);
-      break;
-    }
-    case DBSHFL: {
-      int32_t sa = instr_.SaFieldRaw() >> kSaShift;
-      switch (sa) {
-        case DBITSWAP: {
-          switch (sa) {
-            case DBITSWAP_SA: {  // Mips64r6
-              uint64_t input = static_cast<uint64_t>(rt());
-              uint64_t output = 0;
-              uint8_t i_byte, o_byte;
-
-              // Reverse the bit in byte for each individual byte
-              for (int i = 0; i < 8; i++) {
-                output = output >> 8;
-                i_byte = input & 0xFF;
-
-                // Fast way to reverse bits in byte
-                // Devised by Sean Anderson, July 13, 2001
-                o_byte =
-                    static_cast<uint8_t>(((i_byte * 0x0802LU & 0x22110LU) |
-                                          (i_byte * 0x8020LU & 0x88440LU)) *
-                                             0x10101LU >>
-                                         16);
-
-                output = output | ((static_cast<uint64_t>(o_byte) << 56));
-                input = input >> 8;
-              }
-
-              alu_out = static_cast<int64_t>(output);
-              break;
-            }
-          }
-          break;
-        }
-        case DSBH: {
-          uint64_t input = static_cast<uint64_t>(rt());
-          uint64_t output = 0;
-
-          uint64_t mask = 0xFF00000000000000;
-          for (int i = 0; i < 8; i++) {
-            uint64_t tmp = mask & input;
-            if (i % 2 == 0)
-              tmp = tmp >> 8;
-            else
-              tmp = tmp << 8;
-
-            output = output | tmp;
-            mask = mask >> 8;
-          }
-
-          alu_out = static_cast<int64_t>(output);
-          break;
-        }
-        case DSHD: {
-          uint64_t input = static_cast<uint64_t>(rt());
-          uint64_t output = 0;
-
-          uint64_t mask = 0xFFFF000000000000;
-          for (int i = 0; i < 4; i++) {
-            uint64_t tmp = mask & input;
-            if (i == 0)
-              tmp = tmp >> 48;
-            else if (i == 1)
-              tmp = tmp >> 16;
-            else if (i == 2)
-              tmp = tmp << 16;
-            else
-              tmp = tmp << 48;
-            output = output | tmp;
-            mask = mask >> 16;
-          }
-
-          alu_out = static_cast<int64_t>(output);
-          break;
-        }
-        default: {
-          const uint8_t bp3 = instr_.Bp3Value();
-          sa >>= kBp3Bits;
-          switch (sa) {
-            case DALIGN: {
-              if (bp3 == 0) {
-                alu_out = static_cast<int64_t>(rt());
-              } else {
-                uint64_t rt_hi = rt() << (8 * bp3);
-                uint64_t rs_lo = rs() >> (8 * (8 - bp3));
-                alu_out = static_cast<int64_t>(rt_hi | rs_lo);
-              }
-              break;
-            }
-            default:
-              alu_out = 0x12345678;
-              UNREACHABLE();
-              break;
-          }
-          break;
-        }
-      }
-      SetResult(rd_reg(), alu_out);
-      break;
-    }
-    default:
-      UNREACHABLE();
-  }
-}
-
-int Simulator::DecodeMsaDataFormat() {
-  int df = -1;
-  if (instr_.IsMSABranchInstr()) {
-    switch (instr_.RsFieldRaw()) {
-      case BZ_V:
-      case BNZ_V:
-        df = MSA_VECT;
-        break;
-      case BZ_B:
-      case BNZ_B:
-        df = MSA_BYTE;
-        break;
-      case BZ_H:
-      case BNZ_H:
-        df = MSA_HALF;
-        break;
-      case BZ_W:
-      case BNZ_W:
-        df = MSA_WORD;
-        break;
-      case BZ_D:
-      case BNZ_D:
-        df = MSA_DWORD;
-        break;
-      default:
-        UNREACHABLE();
-        break;
-    }
-  } else {
-    int DF[] = {MSA_BYTE, MSA_HALF, MSA_WORD, MSA_DWORD};
-    switch (instr_.MSAMinorOpcodeField()) {
-      case kMsaMinorI5:
-      case kMsaMinorI10:
-      case kMsaMinor3R:
-        df = DF[instr_.Bits(22, 21)];
-        break;
-      case kMsaMinorMI10:
-        df = DF[instr_.Bits(1, 0)];
-        break;
-      case kMsaMinorBIT:
-        df = DF[instr_.MsaBitDf()];
-        break;
-      case kMsaMinorELM:
-        df = DF[instr_.MsaElmDf()];
-        break;
-      case kMsaMinor3RF: {
-        uint32_t opcode = instr_.InstructionBits() & kMsa3RFMask;
-        switch (opcode) {
-          case FEXDO:
-          case FTQ:
-          case MUL_Q:
-          case MADD_Q:
-          case MSUB_Q:
-          case MULR_Q:
-          case MADDR_Q:
-          case MSUBR_Q:
-            df = DF[1 + instr_.Bit(21)];
-            break;
-          default:
-            df = DF[2 + instr_.Bit(21)];
-            break;
-        }
-      } break;
-      case kMsaMinor2R:
-        df = DF[instr_.Bits(17, 16)];
-        break;
-      case kMsaMinor2RF:
-        df = DF[2 + instr_.Bit(16)];
-        break;
-      default:
-        UNREACHABLE();
-        break;
-    }
-  }
-  return df;
-}
-
-void Simulator::DecodeTypeMsaI8() {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(CpuFeatures::IsSupported(MIPS_SIMD));
-  uint32_t opcode = instr_.InstructionBits() & kMsaI8Mask;
-  int8_t i8 = instr_.MsaImm8Value();
-  msa_reg_t ws, wd;
-
-  switch (opcode) {
-    case ANDI_B:
-      get_msa_register(instr_.WsValue(), ws.b);
-      for (int i = 0; i < kMSALanesByte; i++) {
-        wd.b[i] = ws.b[i] & i8;
-      }
-      set_msa_register(instr_.WdValue(), wd.b);
-      TraceMSARegWr(wd.b);
-      break;
-    case ORI_B:
-      get_msa_register(instr_.WsValue(), ws.b);
-      for (int i = 0; i < kMSALanesByte; i++) {
-        wd.b[i] = ws.b[i] | i8;
-      }
-      set_msa_register(instr_.WdValue(), wd.b);
-      TraceMSARegWr(wd.b);
-      break;
-    case NORI_B:
-      get_msa_register(instr_.WsValue(), ws.b);
-      for (int i = 0; i < kMSALanesByte; i++) {
-        wd.b[i] = ~(ws.b[i] | i8);
-      }
-      set_msa_register(instr_.WdValue(), wd.b);
-      TraceMSARegWr(wd.b);
-      break;
-    case XORI_B:
-      get_msa_register(instr_.WsValue(), ws.b);
-      for (int i = 0; i < kMSALanesByte; i++) {
-        wd.b[i] = ws.b[i] ^ i8;
-      }
-      set_msa_register(instr_.WdValue(), wd.b);
-      TraceMSARegWr(wd.b);
-      break;
-    case BMNZI_B:
-      get_msa_register(instr_.WsValue(), ws.b);
-      get_msa_register(instr_.WdValue(), wd.b);
-      for (int i = 0; i < kMSALanesByte; i++) {
-        wd.b[i] = (ws.b[i] & i8) | (wd.b[i] & ~i8);
-      }
-      set_msa_register(instr_.WdValue(), wd.b);
-      TraceMSARegWr(wd.b);
-      break;
-    case BMZI_B:
-      get_msa_register(instr_.WsValue(), ws.b);
-      get_msa_register(instr_.WdValue(), wd.b);
-      for (int i = 0; i < kMSALanesByte; i++) {
-        wd.b[i] = (ws.b[i] & ~i8) | (wd.b[i] & i8);
-      }
-      set_msa_register(instr_.WdValue(), wd.b);
-      TraceMSARegWr(wd.b);
-      break;
-    case BSELI_B:
-      get_msa_register(instr_.WsValue(), ws.b);
-      get_msa_register(instr_.WdValue(), wd.b);
-      for (int i = 0; i < kMSALanesByte; i++) {
-        wd.b[i] = (ws.b[i] & ~wd.b[i]) | (wd.b[i] & i8);
-      }
-      set_msa_register(instr_.WdValue(), wd.b);
-      TraceMSARegWr(wd.b);
-      break;
-    case SHF_B:
-      get_msa_register(instr_.WsValue(), ws.b);
-      for (int i = 0; i < kMSALanesByte; i++) {
-        int j = i % 4;
-        int k = (i8 >> (2 * j)) & 0x3;
-        wd.b[i] = ws.b[i - j + k];
-      }
-      set_msa_register(instr_.WdValue(), wd.b);
-      TraceMSARegWr(wd.b);
-      break;
-    case SHF_H:
-      get_msa_register(instr_.WsValue(), ws.h);
-      for (int i = 0; i < kMSALanesHalf; i++) {
-        int j = i % 4;
-        int k = (i8 >> (2 * j)) & 0x3;
-        wd.h[i] = ws.h[i - j + k];
-      }
-      set_msa_register(instr_.WdValue(), wd.h);
-      TraceMSARegWr(wd.h);
-      break;
-    case SHF_W:
-      get_msa_register(instr_.WsValue(), ws.w);
-      for (int i = 0; i < kMSALanesWord; i++) {
-        int j = (i8 >> (2 * i)) & 0x3;
-        wd.w[i] = ws.w[j];
-      }
-      set_msa_register(instr_.WdValue(), wd.w);
-      TraceMSARegWr(wd.w);
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-template <typename T>
-T Simulator::MsaI5InstrHelper(uint32_t opcode, T ws, int32_t i5) {
-  T res;
-  uint32_t ui5 = i5 & 0x1Fu;
-  uint64_t ws_u64 = static_cast<uint64_t>(ws);
-  uint64_t ui5_u64 = static_cast<uint64_t>(ui5);
-
-  switch (opcode) {
-    case ADDVI:
-      res = static_cast<T>(ws + ui5);
-      break;
-    case SUBVI:
-      res = static_cast<T>(ws - ui5);
-      break;
-    case MAXI_S:
-      res = static_cast<T>(Max(ws, static_cast<T>(i5)));
-      break;
-    case MINI_S:
-      res = static_cast<T>(Min(ws, static_cast<T>(i5)));
-      break;
-    case MAXI_U:
-      res = static_cast<T>(Max(ws_u64, ui5_u64));
-      break;
-    case MINI_U:
-      res = static_cast<T>(Min(ws_u64, ui5_u64));
-      break;
-    case CEQI:
-      res = static_cast<T>(!Compare(ws, static_cast<T>(i5)) ? -1ull : 0ull);
-      break;
-    case CLTI_S:
-      res = static_cast<T>((Compare(ws, static_cast<T>(i5)) == -1) ? -1ull
-                                                                   : 0ull);
-      break;
-    case CLTI_U:
-      res = static_cast<T>((Compare(ws_u64, ui5_u64) == -1) ? -1ull : 0ull);
-      break;
-    case CLEI_S:
-      res =
-          static_cast<T>((Compare(ws, static_cast<T>(i5)) != 1) ? -1ull : 0ull);
-      break;
-    case CLEI_U:
-      res = static_cast<T>((Compare(ws_u64, ui5_u64) != 1) ? -1ull : 0ull);
-      break;
-    default:
-      UNREACHABLE();
-  }
-  return res;
-}
-
-void Simulator::DecodeTypeMsaI5() {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(CpuFeatures::IsSupported(MIPS_SIMD));
-  uint32_t opcode = instr_.InstructionBits() & kMsaI5Mask;
-  msa_reg_t ws, wd;
-
-  // sign extend 5bit value to int32_t
-  int32_t i5 = static_cast<int32_t>(instr_.MsaImm5Value() << 27) >> 27;
-
-#define MSA_I5_DF(elem, num_of_lanes)                      \
-  get_msa_register(instr_.WsValue(), ws.elem);             \
-  for (int i = 0; i < num_of_lanes; i++) {                 \
-    wd.elem[i] = MsaI5InstrHelper(opcode, ws.elem[i], i5); \
-  }                                                        \
-  set_msa_register(instr_.WdValue(), wd.elem);             \
-  TraceMSARegWr(wd.elem)
-
-  switch (DecodeMsaDataFormat()) {
-    case MSA_BYTE:
-      MSA_I5_DF(b, kMSALanesByte);
-      break;
-    case MSA_HALF:
-      MSA_I5_DF(h, kMSALanesHalf);
-      break;
-    case MSA_WORD:
-      MSA_I5_DF(w, kMSALanesWord);
-      break;
-    case MSA_DWORD:
-      MSA_I5_DF(d, kMSALanesDword);
-      break;
-    default:
-      UNREACHABLE();
-  }
-#undef MSA_I5_DF
-}
-
-void Simulator::DecodeTypeMsaI10() {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(CpuFeatures::IsSupported(MIPS_SIMD));
-  uint32_t opcode = instr_.InstructionBits() & kMsaI5Mask;
-  int64_t s10 = (static_cast<int64_t>(instr_.MsaImm10Value()) << 54) >> 54;
-  msa_reg_t wd;
-
-#define MSA_I10_DF(elem, num_of_lanes, T)      \
-  for (int i = 0; i < num_of_lanes; ++i) {     \
-    wd.elem[i] = static_cast<T>(s10);          \
-  }                                            \
-  set_msa_register(instr_.WdValue(), wd.elem); \
-  TraceMSARegWr(wd.elem)
-
-  if (opcode == LDI) {
-    switch (DecodeMsaDataFormat()) {
-      case MSA_BYTE:
-        MSA_I10_DF(b, kMSALanesByte, int8_t);
-        break;
-      case MSA_HALF:
-        MSA_I10_DF(h, kMSALanesHalf, int16_t);
-        break;
-      case MSA_WORD:
-        MSA_I10_DF(w, kMSALanesWord, int32_t);
-        break;
-      case MSA_DWORD:
-        MSA_I10_DF(d, kMSALanesDword, int64_t);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  } else {
-    UNREACHABLE();
-  }
-#undef MSA_I10_DF
-}
-
-void Simulator::DecodeTypeMsaELM() {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(CpuFeatures::IsSupported(MIPS_SIMD));
-  uint32_t opcode = instr_.InstructionBits() & kMsaLongerELMMask;
-  int32_t n = instr_.MsaElmNValue();
-  int64_t alu_out;
-  switch (opcode) {
-    case CTCMSA:
-      DCHECK_EQ(sa(), kMSACSRRegister);
-      MSACSR_ = bit_cast<uint32_t>(
-          static_cast<int32_t>(registers_[rd_reg()] & kMaxUInt32));
-      TraceRegWr(static_cast<int32_t>(MSACSR_));
-      break;
-    case CFCMSA:
-      DCHECK_EQ(rd_reg(), kMSACSRRegister);
-      SetResult(sa(), static_cast<int64_t>(bit_cast<int32_t>(MSACSR_)));
-      break;
-    case MOVE_V: {
-      msa_reg_t ws;
-      get_msa_register(ws_reg(), &ws);
-      set_msa_register(wd_reg(), &ws);
-      TraceMSARegWr(&ws);
-    } break;
-    default:
-      opcode &= kMsaELMMask;
-      switch (opcode) {
-        case COPY_S:
-        case COPY_U: {
-          msa_reg_t ws;
-          switch (DecodeMsaDataFormat()) {
-            case MSA_BYTE:
-              DCHECK_LT(n, kMSALanesByte);
-              get_msa_register(instr_.WsValue(), ws.b);
-              alu_out = static_cast<int32_t>(ws.b[n]);
-              SetResult(wd_reg(),
-                        (opcode == COPY_U) ? alu_out & 0xFFu : alu_out);
-              break;
-            case MSA_HALF:
-              DCHECK_LT(n, kMSALanesHalf);
-              get_msa_register(instr_.WsValue(), ws.h);
-              alu_out = static_cast<int32_t>(ws.h[n]);
-              SetResult(wd_reg(),
-                        (opcode == COPY_U) ? alu_out & 0xFFFFu : alu_out);
-              break;
-            case MSA_WORD:
-              DCHECK_LT(n, kMSALanesWord);
-              get_msa_register(instr_.WsValue(), ws.w);
-              alu_out = static_cast<int32_t>(ws.w[n]);
-              SetResult(wd_reg(),
-                        (opcode == COPY_U) ? alu_out & 0xFFFFFFFFu : alu_out);
-              break;
-            case MSA_DWORD:
-              DCHECK_LT(n, kMSALanesDword);
-              get_msa_register(instr_.WsValue(), ws.d);
-              alu_out = static_cast<int64_t>(ws.d[n]);
-              SetResult(wd_reg(), alu_out);
-              break;
-            default:
-              UNREACHABLE();
-          }
-        } break;
-        case INSERT: {
-          msa_reg_t wd;
-          switch (DecodeMsaDataFormat()) {
-            case MSA_BYTE: {
-              DCHECK_LT(n, kMSALanesByte);
-              int64_t rs = get_register(instr_.WsValue());
-              get_msa_register(instr_.WdValue(), wd.b);
-              wd.b[n] = rs & 0xFFu;
-              set_msa_register(instr_.WdValue(), wd.b);
-              TraceMSARegWr(wd.b);
-              break;
-            }
-            case MSA_HALF: {
-              DCHECK_LT(n, kMSALanesHalf);
-              int64_t rs = get_register(instr_.WsValue());
-              get_msa_register(instr_.WdValue(), wd.h);
-              wd.h[n] = rs & 0xFFFFu;
-              set_msa_register(instr_.WdValue(), wd.h);
-              TraceMSARegWr(wd.h);
-              break;
-            }
-            case MSA_WORD: {
-              DCHECK_LT(n, kMSALanesWord);
-              int64_t rs = get_register(instr_.WsValue());
-              get_msa_register(instr_.WdValue(), wd.w);
-              wd.w[n] = rs & 0xFFFFFFFFu;
-              set_msa_register(instr_.WdValue(), wd.w);
-              TraceMSARegWr(wd.w);
-              break;
-            }
-            case MSA_DWORD: {
-              DCHECK_LT(n, kMSALanesDword);
-              int64_t rs = get_register(instr_.WsValue());
-              get_msa_register(instr_.WdValue(), wd.d);
-              wd.d[n] = rs;
-              set_msa_register(instr_.WdValue(), wd.d);
-              TraceMSARegWr(wd.d);
-              break;
-            }
-            default:
-              UNREACHABLE();
-          }
-        } break;
-        case SLDI: {
-          uint8_t v[32];
-          msa_reg_t ws;
-          msa_reg_t wd;
-          get_msa_register(ws_reg(), &ws);
-          get_msa_register(wd_reg(), &wd);
-#define SLDI_DF(s, k)                \
-  for (unsigned i = 0; i < s; i++) { \
-    v[i] = ws.b[s * k + i];          \
-    v[i + s] = wd.b[s * k + i];      \
-  }                                  \
-  for (unsigned i = 0; i < s; i++) { \
-    wd.b[s * k + i] = v[i + n];      \
-  }
-          switch (DecodeMsaDataFormat()) {
-            case MSA_BYTE:
-              DCHECK(n < kMSALanesByte);
-              SLDI_DF(kMSARegSize / sizeof(int8_t) / kBitsPerByte, 0)
-              break;
-            case MSA_HALF:
-              DCHECK(n < kMSALanesHalf);
-              for (int k = 0; k < 2; ++k) {
-                SLDI_DF(kMSARegSize / sizeof(int16_t) / kBitsPerByte, k)
-              }
-              break;
-            case MSA_WORD:
-              DCHECK(n < kMSALanesWord);
-              for (int k = 0; k < 4; ++k) {
-                SLDI_DF(kMSARegSize / sizeof(int32_t) / kBitsPerByte, k)
-              }
-              break;
-            case MSA_DWORD:
-              DCHECK(n < kMSALanesDword);
-              for (int k = 0; k < 8; ++k) {
-                SLDI_DF(kMSARegSize / sizeof(int64_t) / kBitsPerByte, k)
-              }
-              break;
-            default:
-              UNREACHABLE();
-          }
-          set_msa_register(wd_reg(), &wd);
-          TraceMSARegWr(&wd);
-        } break;
-#undef SLDI_DF
-        case SPLATI:
-        case INSVE:
-          UNIMPLEMENTED();
-          break;
-        default:
-          UNREACHABLE();
-      }
-      break;
-  }
-}
-
-template <typename T>
-T Simulator::MsaBitInstrHelper(uint32_t opcode, T wd, T ws, int32_t m) {
-  typedef typename std::make_unsigned<T>::type uT;
-  T res;
-  switch (opcode) {
-    case SLLI:
-      res = static_cast<T>(ws << m);
-      break;
-    case SRAI:
-      res = static_cast<T>(ArithmeticShiftRight(ws, m));
-      break;
-    case SRLI:
-      res = static_cast<T>(static_cast<uT>(ws) >> m);
-      break;
-    case BCLRI:
-      res = static_cast<T>(static_cast<T>(~(1ull << m)) & ws);
-      break;
-    case BSETI:
-      res = static_cast<T>(static_cast<T>(1ull << m) | ws);
-      break;
-    case BNEGI:
-      res = static_cast<T>(static_cast<T>(1ull << m) ^ ws);
-      break;
-    case BINSLI: {
-      int elem_size = 8 * sizeof(T);
-      int bits = m + 1;
-      if (bits == elem_size) {
-        res = static_cast<T>(ws);
-      } else {
-        uint64_t mask = ((1ull << bits) - 1) << (elem_size - bits);
-        res = static_cast<T>((static_cast<T>(mask) & ws) |
-                             (static_cast<T>(~mask) & wd));
-      }
-    } break;
-    case BINSRI: {
-      int elem_size = 8 * sizeof(T);
-      int bits = m + 1;
-      if (bits == elem_size) {
-        res = static_cast<T>(ws);
-      } else {
-        uint64_t mask = (1ull << bits) - 1;
-        res = static_cast<T>((static_cast<T>(mask) & ws) |
-                             (static_cast<T>(~mask) & wd));
-      }
-    } break;
-    case SAT_S: {
-#define M_MAX_INT(x) static_cast<int64_t>((1LL << ((x)-1)) - 1)
-#define M_MIN_INT(x) static_cast<int64_t>(-(1LL << ((x)-1)))
-      int shift = 64 - 8 * sizeof(T);
-      int64_t ws_i64 = (static_cast<int64_t>(ws) << shift) >> shift;
-      res = static_cast<T>(ws_i64 < M_MIN_INT(m + 1)
-                               ? M_MIN_INT(m + 1)
-                               : ws_i64 > M_MAX_INT(m + 1) ? M_MAX_INT(m + 1)
-                                                           : ws_i64);
-#undef M_MAX_INT
-#undef M_MIN_INT
-    } break;
-    case SAT_U: {
-#define M_MAX_UINT(x) static_cast<uint64_t>(-1ULL >> (64 - (x)))
-      uint64_t mask = static_cast<uint64_t>(-1ULL >> (64 - 8 * sizeof(T)));
-      uint64_t ws_u64 = static_cast<uint64_t>(ws) & mask;
-      res = static_cast<T>(ws_u64 < M_MAX_UINT(m + 1) ? ws_u64
-                                                      : M_MAX_UINT(m + 1));
-#undef M_MAX_UINT
-    } break;
-    case SRARI:
-      if (!m) {
-        res = static_cast<T>(ws);
-      } else {
-        res = static_cast<T>(ArithmeticShiftRight(ws, m)) +
-              static_cast<T>((ws >> (m - 1)) & 0x1);
-      }
-      break;
-    case SRLRI:
-      if (!m) {
-        res = static_cast<T>(ws);
-      } else {
-        res = static_cast<T>(static_cast<uT>(ws) >> m) +
-              static_cast<T>((ws >> (m - 1)) & 0x1);
-      }
-      break;
-    default:
-      UNREACHABLE();
-  }
-  return res;
-}
-
-void Simulator::DecodeTypeMsaBIT() {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(CpuFeatures::IsSupported(MIPS_SIMD));
-  uint32_t opcode = instr_.InstructionBits() & kMsaBITMask;
-  int32_t m = instr_.MsaBitMValue();
-  msa_reg_t wd, ws;
-
-#define MSA_BIT_DF(elem, num_of_lanes)                                 \
-  get_msa_register(instr_.WsValue(), ws.elem);                         \
-  if (opcode == BINSLI || opcode == BINSRI) {                          \
-    get_msa_register(instr_.WdValue(), wd.elem);                       \
-  }                                                                    \
-  for (int i = 0; i < num_of_lanes; i++) {                             \
-    wd.elem[i] = MsaBitInstrHelper(opcode, wd.elem[i], ws.elem[i], m); \
-  }                                                                    \
-  set_msa_register(instr_.WdValue(), wd.elem);                         \
-  TraceMSARegWr(wd.elem)
-
-  switch (DecodeMsaDataFormat()) {
-    case MSA_BYTE:
-      DCHECK(m < kMSARegSize / kMSALanesByte);
-      MSA_BIT_DF(b, kMSALanesByte);
-      break;
-    case MSA_HALF:
-      DCHECK(m < kMSARegSize / kMSALanesHalf);
-      MSA_BIT_DF(h, kMSALanesHalf);
-      break;
-    case MSA_WORD:
-      DCHECK(m < kMSARegSize / kMSALanesWord);
-      MSA_BIT_DF(w, kMSALanesWord);
-      break;
-    case MSA_DWORD:
-      DCHECK(m < kMSARegSize / kMSALanesDword);
-      MSA_BIT_DF(d, kMSALanesDword);
-      break;
-    default:
-      UNREACHABLE();
-  }
-#undef MSA_BIT_DF
-}
-
-void Simulator::DecodeTypeMsaMI10() {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(CpuFeatures::IsSupported(MIPS_SIMD));
-  uint32_t opcode = instr_.InstructionBits() & kMsaMI10Mask;
-  int64_t s10 = (static_cast<int64_t>(instr_.MsaImmMI10Value()) << 54) >> 54;
-  int64_t rs = get_register(instr_.WsValue());
-  int64_t addr;
-  msa_reg_t wd;
-
-#define MSA_MI10_LOAD(elem, num_of_lanes, T)       \
-  for (int i = 0; i < num_of_lanes; ++i) {         \
-    addr = rs + (s10 + i) * sizeof(T);             \
-    wd.elem[i] = ReadMem<T>(addr, instr_.instr()); \
-  }                                                \
-  set_msa_register(instr_.WdValue(), wd.elem);
-
-#define MSA_MI10_STORE(elem, num_of_lanes, T)      \
-  get_msa_register(instr_.WdValue(), wd.elem);     \
-  for (int i = 0; i < num_of_lanes; ++i) {         \
-    addr = rs + (s10 + i) * sizeof(T);             \
-    WriteMem<T>(addr, wd.elem[i], instr_.instr()); \
-  }
-
-  if (opcode == MSA_LD) {
-    switch (DecodeMsaDataFormat()) {
-      case MSA_BYTE:
-        MSA_MI10_LOAD(b, kMSALanesByte, int8_t);
-        break;
-      case MSA_HALF:
-        MSA_MI10_LOAD(h, kMSALanesHalf, int16_t);
-        break;
-      case MSA_WORD:
-        MSA_MI10_LOAD(w, kMSALanesWord, int32_t);
-        break;
-      case MSA_DWORD:
-        MSA_MI10_LOAD(d, kMSALanesDword, int64_t);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  } else if (opcode == MSA_ST) {
-    switch (DecodeMsaDataFormat()) {
-      case MSA_BYTE:
-        MSA_MI10_STORE(b, kMSALanesByte, int8_t);
-        break;
-      case MSA_HALF:
-        MSA_MI10_STORE(h, kMSALanesHalf, int16_t);
-        break;
-      case MSA_WORD:
-        MSA_MI10_STORE(w, kMSALanesWord, int32_t);
-        break;
-      case MSA_DWORD:
-        MSA_MI10_STORE(d, kMSALanesDword, int64_t);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  } else {
-    UNREACHABLE();
-  }
-
-#undef MSA_MI10_LOAD
-#undef MSA_MI10_STORE
-}
-
-template <typename T>
-T Simulator::Msa3RInstrHelper(uint32_t opcode, T wd, T ws, T wt) {
-  typedef typename std::make_unsigned<T>::type uT;
-  T res;
-  int wt_modulo = wt % (sizeof(T) * 8);
-  switch (opcode) {
-    case SLL_MSA:
-      res = static_cast<T>(ws << wt_modulo);
-      break;
-    case SRA_MSA:
-      res = static_cast<T>(ArithmeticShiftRight(ws, wt_modulo));
-      break;
-    case SRL_MSA:
-      res = static_cast<T>(static_cast<uT>(ws) >> wt_modulo);
-      break;
-    case BCLR:
-      res = static_cast<T>(static_cast<T>(~(1ull << wt_modulo)) & ws);
-      break;
-    case BSET:
-      res = static_cast<T>(static_cast<T>(1ull << wt_modulo) | ws);
-      break;
-    case BNEG:
-      res = static_cast<T>(static_cast<T>(1ull << wt_modulo) ^ ws);
-      break;
-    case BINSL: {
-      int elem_size = 8 * sizeof(T);
-      int bits = wt_modulo + 1;
-      if (bits == elem_size) {
-        res = static_cast<T>(ws);
-      } else {
-        uint64_t mask = ((1ull << bits) - 1) << (elem_size - bits);
-        res = static_cast<T>((static_cast<T>(mask) & ws) |
-                             (static_cast<T>(~mask) & wd));
-      }
-    } break;
-    case BINSR: {
-      int elem_size = 8 * sizeof(T);
-      int bits = wt_modulo + 1;
-      if (bits == elem_size) {
-        res = static_cast<T>(ws);
-      } else {
-        uint64_t mask = (1ull << bits) - 1;
-        res = static_cast<T>((static_cast<T>(mask) & ws) |
-                             (static_cast<T>(~mask) & wd));
-      }
-    } break;
-    case ADDV:
-      res = ws + wt;
-      break;
-    case SUBV:
-      res = ws - wt;
-      break;
-    case MAX_S:
-      res = Max(ws, wt);
-      break;
-    case MAX_U:
-      res = static_cast<T>(Max(static_cast<uT>(ws), static_cast<uT>(wt)));
-      break;
-    case MIN_S:
-      res = Min(ws, wt);
-      break;
-    case MIN_U:
-      res = static_cast<T>(Min(static_cast<uT>(ws), static_cast<uT>(wt)));
-      break;
-    case MAX_A:
-      // We use negative abs in order to avoid problems
-      // with corner case for MIN_INT
-      res = Nabs(ws) < Nabs(wt) ? ws : wt;
-      break;
-    case MIN_A:
-      // We use negative abs in order to avoid problems
-      // with corner case for MIN_INT
-      res = Nabs(ws) > Nabs(wt) ? ws : wt;
-      break;
-    case CEQ:
-      res = static_cast<T>(!Compare(ws, wt) ? -1ull : 0ull);
-      break;
-    case CLT_S:
-      res = static_cast<T>((Compare(ws, wt) == -1) ? -1ull : 0ull);
-      break;
-    case CLT_U:
-      res = static_cast<T>(
-          (Compare(static_cast<uT>(ws), static_cast<uT>(wt)) == -1) ? -1ull
-                                                                    : 0ull);
-      break;
-    case CLE_S:
-      res = static_cast<T>((Compare(ws, wt) != 1) ? -1ull : 0ull);
-      break;
-    case CLE_U:
-      res = static_cast<T>(
-          (Compare(static_cast<uT>(ws), static_cast<uT>(wt)) != 1) ? -1ull
-                                                                   : 0ull);
-      break;
-    case ADD_A:
-      res = static_cast<T>(Abs(ws) + Abs(wt));
-      break;
-    case ADDS_A: {
-      T ws_nabs = Nabs(ws);
-      T wt_nabs = Nabs(wt);
-      if (ws_nabs < -std::numeric_limits<T>::max() - wt_nabs) {
-        res = std::numeric_limits<T>::max();
-      } else {
-        res = -(ws_nabs + wt_nabs);
-      }
-    } break;
-    case ADDS_S:
-      res = SaturateAdd(ws, wt);
-      break;
-    case ADDS_U: {
-      uT ws_u = static_cast<uT>(ws);
-      uT wt_u = static_cast<uT>(wt);
-      res = static_cast<T>(SaturateAdd(ws_u, wt_u));
-    } break;
-    case AVE_S:
-      res = static_cast<T>((wt & ws) + ((wt ^ ws) >> 1));
-      break;
-    case AVE_U: {
-      uT ws_u = static_cast<uT>(ws);
-      uT wt_u = static_cast<uT>(wt);
-      res = static_cast<T>((wt_u & ws_u) + ((wt_u ^ ws_u) >> 1));
-    } break;
-    case AVER_S:
-      res = static_cast<T>((wt | ws) - ((wt ^ ws) >> 1));
-      break;
-    case AVER_U: {
-      uT ws_u = static_cast<uT>(ws);
-      uT wt_u = static_cast<uT>(wt);
-      res = static_cast<T>((wt_u | ws_u) - ((wt_u ^ ws_u) >> 1));
-    } break;
-    case SUBS_S:
-      res = SaturateSub(ws, wt);
-      break;
-    case SUBS_U: {
-      uT ws_u = static_cast<uT>(ws);
-      uT wt_u = static_cast<uT>(wt);
-      res = static_cast<T>(SaturateSub(ws_u, wt_u));
-    } break;
-    case SUBSUS_U: {
-      uT wsu = static_cast<uT>(ws);
-      if (wt > 0) {
-        uT wtu = static_cast<uT>(wt);
-        if (wtu > wsu) {
-          res = 0;
-        } else {
-          res = static_cast<T>(wsu - wtu);
-        }
-      } else {
-        if (wsu > std::numeric_limits<uT>::max() + wt) {
-          res = static_cast<T>(std::numeric_limits<uT>::max());
-        } else {
-          res = static_cast<T>(wsu - wt);
-        }
-      }
-    } break;
-    case SUBSUU_S: {
-      uT wsu = static_cast<uT>(ws);
-      uT wtu = static_cast<uT>(wt);
-      uT wdu;
-      if (wsu > wtu) {
-        wdu = wsu - wtu;
-        if (wdu > std::numeric_limits<T>::max()) {
-          res = std::numeric_limits<T>::max();
-        } else {
-          res = static_cast<T>(wdu);
-        }
-      } else {
-        wdu = wtu - wsu;
-        CHECK(-std::numeric_limits<T>::max() ==
-              std::numeric_limits<T>::min() + 1);
-        if (wdu <= std::numeric_limits<T>::max()) {
-          res = -static_cast<T>(wdu);
-        } else {
-          res = std::numeric_limits<T>::min();
-        }
-      }
-    } break;
-    case ASUB_S:
-      res = static_cast<T>(Abs(ws - wt));
-      break;
-    case ASUB_U: {
-      uT wsu = static_cast<uT>(ws);
-      uT wtu = static_cast<uT>(wt);
-      res = static_cast<T>(wsu > wtu ? wsu - wtu : wtu - wsu);
-    } break;
-    case MULV:
-      res = ws * wt;
-      break;
-    case MADDV:
-      res = wd + ws * wt;
-      break;
-    case MSUBV:
-      res = wd - ws * wt;
-      break;
-    case DIV_S_MSA:
-      res = wt != 0 ? ws / wt : static_cast<T>(Unpredictable);
-      break;
-    case DIV_U:
-      res = wt != 0 ? static_cast<T>(static_cast<uT>(ws) / static_cast<uT>(wt))
-                    : static_cast<T>(Unpredictable);
-      break;
-    case MOD_S:
-      res = wt != 0 ? ws % wt : static_cast<T>(Unpredictable);
-      break;
-    case MOD_U:
-      res = wt != 0 ? static_cast<T>(static_cast<uT>(ws) % static_cast<uT>(wt))
-                    : static_cast<T>(Unpredictable);
-      break;
-    case DOTP_S:
-    case DOTP_U:
-    case DPADD_S:
-    case DPADD_U:
-    case DPSUB_S:
-    case DPSUB_U:
-    case SLD:
-    case SPLAT:
-      UNIMPLEMENTED();
-      break;
-    case SRAR: {
-      int bit = wt_modulo == 0 ? 0 : (ws >> (wt_modulo - 1)) & 1;
-      res = static_cast<T>(ArithmeticShiftRight(ws, wt_modulo) + bit);
-    } break;
-    case SRLR: {
-      uT wsu = static_cast<uT>(ws);
-      int bit = wt_modulo == 0 ? 0 : (wsu >> (wt_modulo - 1)) & 1;
-      res = static_cast<T>((wsu >> wt_modulo) + bit);
-    } break;
-    default:
-      UNREACHABLE();
-  }
-  return res;
-}
-template <typename T_int, typename T_reg>
-void Msa3RInstrHelper_shuffle(const uint32_t opcode, T_reg ws, T_reg wt,
-                              T_reg wd, const int i, const int num_of_lanes) {
-  T_int *ws_p, *wt_p, *wd_p;
-  ws_p = reinterpret_cast<T_int*>(ws);
-  wt_p = reinterpret_cast<T_int*>(wt);
-  wd_p = reinterpret_cast<T_int*>(wd);
-  switch (opcode) {
-    case PCKEV:
-      wd_p[i] = wt_p[2 * i];
-      wd_p[i + num_of_lanes / 2] = ws_p[2 * i];
-      break;
-    case PCKOD:
-      wd_p[i] = wt_p[2 * i + 1];
-      wd_p[i + num_of_lanes / 2] = ws_p[2 * i + 1];
-      break;
-    case ILVL:
-      wd_p[2 * i] = wt_p[i + num_of_lanes / 2];
-      wd_p[2 * i + 1] = ws_p[i + num_of_lanes / 2];
-      break;
-    case ILVR:
-      wd_p[2 * i] = wt_p[i];
-      wd_p[2 * i + 1] = ws_p[i];
-      break;
-    case ILVEV:
-      wd_p[2 * i] = wt_p[2 * i];
-      wd_p[2 * i + 1] = ws_p[2 * i];
-      break;
-    case ILVOD:
-      wd_p[2 * i] = wt_p[2 * i + 1];
-      wd_p[2 * i + 1] = ws_p[2 * i + 1];
-      break;
-    case VSHF: {
-      const int mask_not_valid = 0xC0;
-      const int mask_6_bits = 0x3F;
-      if ((wd_p[i] & mask_not_valid)) {
-        wd_p[i] = 0;
-      } else {
-        int k = (wd_p[i] & mask_6_bits) % (num_of_lanes * 2);
-        wd_p[i] = k >= num_of_lanes ? ws_p[k - num_of_lanes] : wt_p[k];
-      }
-    } break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-template <typename T_int, typename T_smaller_int, typename T_reg>
-void Msa3RInstrHelper_horizontal(const uint32_t opcode, T_reg ws, T_reg wt,
-                                 T_reg wd, const int i,
-                                 const int num_of_lanes) {
-  typedef typename std::make_unsigned<T_int>::type T_uint;
-  typedef typename std::make_unsigned<T_smaller_int>::type T_smaller_uint;
-  T_int* wd_p;
-  T_smaller_int *ws_p, *wt_p;
-  ws_p = reinterpret_cast<T_smaller_int*>(ws);
-  wt_p = reinterpret_cast<T_smaller_int*>(wt);
-  wd_p = reinterpret_cast<T_int*>(wd);
-  T_uint* wd_pu;
-  T_smaller_uint *ws_pu, *wt_pu;
-  ws_pu = reinterpret_cast<T_smaller_uint*>(ws);
-  wt_pu = reinterpret_cast<T_smaller_uint*>(wt);
-  wd_pu = reinterpret_cast<T_uint*>(wd);
-  switch (opcode) {
-    case HADD_S:
-      wd_p[i] =
-          static_cast<T_int>(ws_p[2 * i + 1]) + static_cast<T_int>(wt_p[2 * i]);
-      break;
-    case HADD_U:
-      wd_pu[i] = static_cast<T_uint>(ws_pu[2 * i + 1]) +
-                 static_cast<T_uint>(wt_pu[2 * i]);
-      break;
-    case HSUB_S:
-      wd_p[i] =
-          static_cast<T_int>(ws_p[2 * i + 1]) - static_cast<T_int>(wt_p[2 * i]);
-      break;
-    case HSUB_U:
-      wd_pu[i] = static_cast<T_uint>(ws_pu[2 * i + 1]) -
-                 static_cast<T_uint>(wt_pu[2 * i]);
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Simulator::DecodeTypeMsa3R() {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(CpuFeatures::IsSupported(MIPS_SIMD));
-  uint32_t opcode = instr_.InstructionBits() & kMsa3RMask;
-  msa_reg_t ws, wd, wt;
-  get_msa_register(ws_reg(), &ws);
-  get_msa_register(wt_reg(), &wt);
-  get_msa_register(wd_reg(), &wd);
-  switch (opcode) {
-    case HADD_S:
-    case HADD_U:
-    case HSUB_S:
-    case HSUB_U:
-#define HORIZONTAL_ARITHMETIC_DF(num_of_lanes, int_type, lesser_int_type) \
-  for (int i = 0; i < num_of_lanes; ++i) {                                \
-    Msa3RInstrHelper_horizontal<int_type, lesser_int_type>(               \
-        opcode, &ws, &wt, &wd, i, num_of_lanes);                          \
-  }
-      switch (DecodeMsaDataFormat()) {
-        case MSA_HALF:
-          HORIZONTAL_ARITHMETIC_DF(kMSALanesHalf, int16_t, int8_t);
-          break;
-        case MSA_WORD:
-          HORIZONTAL_ARITHMETIC_DF(kMSALanesWord, int32_t, int16_t);
-          break;
-        case MSA_DWORD:
-          HORIZONTAL_ARITHMETIC_DF(kMSALanesDword, int64_t, int32_t);
-          break;
-        default:
-          UNREACHABLE();
-      }
-      break;
-#undef HORIZONTAL_ARITHMETIC_DF
-    case VSHF:
-#define VSHF_DF(num_of_lanes, int_type)                          \
-  for (int i = 0; i < num_of_lanes; ++i) {                       \
-    Msa3RInstrHelper_shuffle<int_type>(opcode, &ws, &wt, &wd, i, \
-                                       num_of_lanes);            \
-  }
-      switch (DecodeMsaDataFormat()) {
-        case MSA_BYTE:
-          VSHF_DF(kMSALanesByte, int8_t);
-          break;
-        case MSA_HALF:
-          VSHF_DF(kMSALanesHalf, int16_t);
-          break;
-        case MSA_WORD:
-          VSHF_DF(kMSALanesWord, int32_t);
-          break;
-        case MSA_DWORD:
-          VSHF_DF(kMSALanesDword, int64_t);
-          break;
-        default:
-          UNREACHABLE();
-      }
-#undef VSHF_DF
-      break;
-    case PCKEV:
-    case PCKOD:
-    case ILVL:
-    case ILVR:
-    case ILVEV:
-    case ILVOD:
-#define INTERLEAVE_PACK_DF(num_of_lanes, int_type)               \
-  for (int i = 0; i < num_of_lanes / 2; ++i) {                   \
-    Msa3RInstrHelper_shuffle<int_type>(opcode, &ws, &wt, &wd, i, \
-                                       num_of_lanes);            \
-  }
-      switch (DecodeMsaDataFormat()) {
-        case MSA_BYTE:
-          INTERLEAVE_PACK_DF(kMSALanesByte, int8_t);
-          break;
-        case MSA_HALF:
-          INTERLEAVE_PACK_DF(kMSALanesHalf, int16_t);
-          break;
-        case MSA_WORD:
-          INTERLEAVE_PACK_DF(kMSALanesWord, int32_t);
-          break;
-        case MSA_DWORD:
-          INTERLEAVE_PACK_DF(kMSALanesDword, int64_t);
-          break;
-        default:
-          UNREACHABLE();
-      }
-      break;
-#undef INTERLEAVE_PACK_DF
-    default:
-#define MSA_3R_DF(elem, num_of_lanes)                                          \
-  for (int i = 0; i < num_of_lanes; i++) {                                     \
-    wd.elem[i] = Msa3RInstrHelper(opcode, wd.elem[i], ws.elem[i], wt.elem[i]); \
-  }
-
-      switch (DecodeMsaDataFormat()) {
-        case MSA_BYTE:
-          MSA_3R_DF(b, kMSALanesByte);
-          break;
-        case MSA_HALF:
-          MSA_3R_DF(h, kMSALanesHalf);
-          break;
-        case MSA_WORD:
-          MSA_3R_DF(w, kMSALanesWord);
-          break;
-        case MSA_DWORD:
-          MSA_3R_DF(d, kMSALanesDword);
-          break;
-        default:
-          UNREACHABLE();
-      }
-#undef MSA_3R_DF
-      break;
-  }
-  set_msa_register(wd_reg(), &wd);
-  TraceMSARegWr(&wd);
-}
-
-template <typename T_int, typename T_fp, typename T_reg>
-void Msa3RFInstrHelper(uint32_t opcode, T_reg ws, T_reg wt, T_reg& wd) {
-  const T_int all_ones = static_cast<T_int>(-1);
-  const T_fp s_element = *reinterpret_cast<T_fp*>(&ws);
-  const T_fp t_element = *reinterpret_cast<T_fp*>(&wt);
-  switch (opcode) {
-    case FCUN: {
-      if (std::isnan(s_element) || std::isnan(t_element)) {
-        wd = all_ones;
-      } else {
-        wd = 0;
-      }
-    } break;
-    case FCEQ: {
-      if (s_element != t_element || std::isnan(s_element) ||
-          std::isnan(t_element)) {
-        wd = 0;
-      } else {
-        wd = all_ones;
-      }
-    } break;
-    case FCUEQ: {
-      if (s_element == t_element || std::isnan(s_element) ||
-          std::isnan(t_element)) {
-        wd = all_ones;
-      } else {
-        wd = 0;
-      }
-    } break;
-    case FCLT: {
-      if (s_element >= t_element || std::isnan(s_element) ||
-          std::isnan(t_element)) {
-        wd = 0;
-      } else {
-        wd = all_ones;
-      }
-    } break;
-    case FCULT: {
-      if (s_element < t_element || std::isnan(s_element) ||
-          std::isnan(t_element)) {
-        wd = all_ones;
-      } else {
-        wd = 0;
-      }
-    } break;
-    case FCLE: {
-      if (s_element > t_element || std::isnan(s_element) ||
-          std::isnan(t_element)) {
-        wd = 0;
-      } else {
-        wd = all_ones;
-      }
-    } break;
-    case FCULE: {
-      if (s_element <= t_element || std::isnan(s_element) ||
-          std::isnan(t_element)) {
-        wd = all_ones;
-      } else {
-        wd = 0;
-      }
-    } break;
-    case FCOR: {
-      if (std::isnan(s_element) || std::isnan(t_element)) {
-        wd = 0;
-      } else {
-        wd = all_ones;
-      }
-    } break;
-    case FCUNE: {
-      if (s_element != t_element || std::isnan(s_element) ||
-          std::isnan(t_element)) {
-        wd = all_ones;
-      } else {
-        wd = 0;
-      }
-    } break;
-    case FCNE: {
-      if (s_element == t_element || std::isnan(s_element) ||
-          std::isnan(t_element)) {
-        wd = 0;
-      } else {
-        wd = all_ones;
-      }
-    } break;
-    case FADD:
-      wd = bit_cast<T_int>(s_element + t_element);
-      break;
-    case FSUB:
-      wd = bit_cast<T_int>(s_element - t_element);
-      break;
-    case FMUL:
-      wd = bit_cast<T_int>(s_element * t_element);
-      break;
-    case FDIV: {
-      if (t_element == 0) {
-        wd = bit_cast<T_int>(std::numeric_limits<T_fp>::quiet_NaN());
-      } else {
-        wd = bit_cast<T_int>(s_element / t_element);
-      }
-    } break;
-    case FMADD:
-      wd = bit_cast<T_int>(
-          std::fma(s_element, t_element, *reinterpret_cast<T_fp*>(&wd)));
-      break;
-    case FMSUB:
-      wd = bit_cast<T_int>(
-          std::fma(-s_element, t_element, *reinterpret_cast<T_fp*>(&wd)));
-      break;
-    case FEXP2:
-      wd = bit_cast<T_int>(std::ldexp(s_element, static_cast<int>(wt)));
-      break;
-    case FMIN:
-      wd = bit_cast<T_int>(std::min(s_element, t_element));
-      break;
-    case FMAX:
-      wd = bit_cast<T_int>(std::max(s_element, t_element));
-      break;
-    case FMIN_A: {
-      wd = bit_cast<T_int>(
-          std::fabs(s_element) < std::fabs(t_element) ? s_element : t_element);
-    } break;
-    case FMAX_A: {
-      wd = bit_cast<T_int>(
-          std::fabs(s_element) > std::fabs(t_element) ? s_element : t_element);
-    } break;
-    case FSOR:
-    case FSUNE:
-    case FSNE:
-    case FSAF:
-    case FSUN:
-    case FSEQ:
-    case FSUEQ:
-    case FSLT:
-    case FSULT:
-    case FSLE:
-    case FSULE:
-      UNIMPLEMENTED();
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-template <typename T_int, typename T_int_dbl, typename T_reg>
-void Msa3RFInstrHelper2(uint32_t opcode, T_reg ws, T_reg wt, T_reg& wd) {
-  // typedef typename std::make_unsigned<T_int>::type T_uint;
-  typedef typename std::make_unsigned<T_int_dbl>::type T_uint_dbl;
-  const T_int max_int = std::numeric_limits<T_int>::max();
-  const T_int min_int = std::numeric_limits<T_int>::min();
-  const int shift = kBitsPerByte * sizeof(T_int) - 1;
-  const T_int_dbl reg_s = ws;
-  const T_int_dbl reg_t = wt;
-  T_int_dbl product, result;
-  product = reg_s * reg_t;
-  switch (opcode) {
-    case MUL_Q: {
-      const T_int_dbl min_fix_dbl =
-          bit_cast<T_uint_dbl>(std::numeric_limits<T_int_dbl>::min()) >> 1U;
-      const T_int_dbl max_fix_dbl = std::numeric_limits<T_int_dbl>::max() >> 1U;
-      if (product == min_fix_dbl) {
-        product = max_fix_dbl;
-      }
-      wd = static_cast<T_int>(product >> shift);
-    } break;
-    case MADD_Q: {
-      result = (product + (static_cast<T_int_dbl>(wd) << shift)) >> shift;
-      wd = static_cast<T_int>(
-          result > max_int ? max_int : result < min_int ? min_int : result);
-    } break;
-    case MSUB_Q: {
-      result = (-product + (static_cast<T_int_dbl>(wd) << shift)) >> shift;
-      wd = static_cast<T_int>(
-          result > max_int ? max_int : result < min_int ? min_int : result);
-    } break;
-    case MULR_Q: {
-      const T_int_dbl min_fix_dbl =
-          bit_cast<T_uint_dbl>(std::numeric_limits<T_int_dbl>::min()) >> 1U;
-      const T_int_dbl max_fix_dbl = std::numeric_limits<T_int_dbl>::max() >> 1U;
-      if (product == min_fix_dbl) {
-        wd = static_cast<T_int>(max_fix_dbl >> shift);
-        break;
-      }
-      wd = static_cast<T_int>((product + (1 << (shift - 1))) >> shift);
-    } break;
-    case MADDR_Q: {
-      result = (product + (static_cast<T_int_dbl>(wd) << shift) +
-                (1 << (shift - 1))) >>
-               shift;
-      wd = static_cast<T_int>(
-          result > max_int ? max_int : result < min_int ? min_int : result);
-    } break;
-    case MSUBR_Q: {
-      result = (-product + (static_cast<T_int_dbl>(wd) << shift) +
-                (1 << (shift - 1))) >>
-               shift;
-      wd = static_cast<T_int>(
-          result > max_int ? max_int : result < min_int ? min_int : result);
-    } break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-void Simulator::DecodeTypeMsa3RF() {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(CpuFeatures::IsSupported(MIPS_SIMD));
-  uint32_t opcode = instr_.InstructionBits() & kMsa3RFMask;
-  msa_reg_t wd, ws, wt;
-  if (opcode != FCAF) {
-    get_msa_register(ws_reg(), &ws);
-    get_msa_register(wt_reg(), &wt);
-  }
-  switch (opcode) {
-    case FCAF:
-      wd.d[0] = 0;
-      wd.d[1] = 0;
-      break;
-    case FEXDO:
-#define PACK_FLOAT16(sign, exp, frac) \
-  static_cast<uint16_t>(((sign) << 15) + ((exp) << 10) + (frac))
-#define FEXDO_DF(source, dst)                                        \
-  do {                                                               \
-    element = source;                                                \
-    aSign = element >> 31;                                           \
-    aExp = element >> 23 & 0xFF;                                     \
-    aFrac = element & 0x007FFFFF;                                    \
-    if (aExp == 0xFF) {                                              \
-      if (aFrac) {                                                   \
-        /* Input is a NaN */                                         \
-        dst = 0x7DFFU;                                               \
-        break;                                                       \
-      }                                                              \
-      /* Infinity */                                                 \
-      dst = PACK_FLOAT16(aSign, 0x1F, 0);                            \
-      break;                                                         \
-    } else if (aExp == 0 && aFrac == 0) {                            \
-      dst = PACK_FLOAT16(aSign, 0, 0);                               \
-      break;                                                         \
-    } else {                                                         \
-      int maxexp = 29;                                               \
-      uint32_t mask;                                                 \
-      uint32_t increment;                                            \
-      bool rounding_bumps_exp;                                       \
-      aFrac |= 0x00800000;                                           \
-      aExp -= 0x71;                                                  \
-      if (aExp < 1) {                                                \
-        /* Will be denormal in halfprec */                           \
-        mask = 0x00FFFFFF;                                           \
-        if (aExp >= -11) {                                           \
-          mask >>= 11 + aExp;                                        \
-        }                                                            \
-      } else {                                                       \
-        /* Normal number in halfprec */                              \
-        mask = 0x00001FFF;                                           \
-      }                                                              \
-      switch (MSACSR_ & 3) {                                         \
-        case kRoundToNearest:                                        \
-          increment = (mask + 1) >> 1;                               \
-          if ((aFrac & mask) == increment) {                         \
-            increment = aFrac & (increment << 1);                    \
-          }                                                          \
-          break;                                                     \
-        case kRoundToPlusInf:                                        \
-          increment = aSign ? 0 : mask;                              \
-          break;                                                     \
-        case kRoundToMinusInf:                                       \
-          increment = aSign ? mask : 0;                              \
-          break;                                                     \
-        case kRoundToZero:                                           \
-          increment = 0;                                             \
-          break;                                                     \
-      }                                                              \
-      rounding_bumps_exp = (aFrac + increment >= 0x01000000);        \
-      if (aExp > maxexp || (aExp == maxexp && rounding_bumps_exp)) { \
-        dst = PACK_FLOAT16(aSign, 0x1F, 0);                          \
-        break;                                                       \
-      }                                                              \
-      aFrac += increment;                                            \
-      if (rounding_bumps_exp) {                                      \
-        aFrac >>= 1;                                                 \
-        aExp++;                                                      \
-      }                                                              \
-      if (aExp < -10) {                                              \
-        dst = PACK_FLOAT16(aSign, 0, 0);                             \
-        break;                                                       \
-      }                                                              \
-      if (aExp < 0) {                                                \
-        aFrac >>= -aExp;                                             \
-        aExp = 0;                                                    \
-      }                                                              \
-      dst = PACK_FLOAT16(aSign, aExp, aFrac >> 13);                  \
-    }                                                                \
-  } while (0);
-      switch (DecodeMsaDataFormat()) {
-        case MSA_HALF:
-          for (int i = 0; i < kMSALanesWord; i++) {
-            uint_fast32_t element;
-            uint_fast32_t aSign, aFrac;
-            int_fast32_t aExp;
-            FEXDO_DF(ws.uw[i], wd.uh[i + kMSALanesHalf / 2])
-            FEXDO_DF(wt.uw[i], wd.uh[i])
-          }
-          break;
-        case MSA_WORD:
-          for (int i = 0; i < kMSALanesDword; i++) {
-            wd.w[i + kMSALanesWord / 2] = bit_cast<int32_t>(
-                static_cast<float>(bit_cast<double>(ws.d[i])));
-            wd.w[i] = bit_cast<int32_t>(
-                static_cast<float>(bit_cast<double>(wt.d[i])));
-          }
-          break;
-        default:
-          UNREACHABLE();
-      }
-      break;
-#undef PACK_FLOAT16
-#undef FEXDO_DF
-    case FTQ:
-#define FTQ_DF(source, dst, fp_type, int_type)                 \
-  element = bit_cast<fp_type>(source) *                        \
-            (1U << (sizeof(int_type) * kBitsPerByte - 1));     \
-  if (element > std::numeric_limits<int_type>::max()) {        \
-    dst = std::numeric_limits<int_type>::max();                \
-  } else if (element < std::numeric_limits<int_type>::min()) { \
-    dst = std::numeric_limits<int_type>::min();                \
-  } else if (std::isnan(element)) {                            \
-    dst = 0;                                                   \
-  } else {                                                     \
-    int_type fixed_point;                                      \
-    round_according_to_msacsr(element, element, fixed_point);  \
-    dst = fixed_point;                                         \
-  }
-
-      switch (DecodeMsaDataFormat()) {
-        case MSA_HALF:
-          for (int i = 0; i < kMSALanesWord; i++) {
-            float element;
-            FTQ_DF(ws.w[i], wd.h[i + kMSALanesHalf / 2], float, int16_t)
-            FTQ_DF(wt.w[i], wd.h[i], float, int16_t)
-          }
-          break;
-        case MSA_WORD:
-          double element;
-          for (int i = 0; i < kMSALanesDword; i++) {
-            FTQ_DF(ws.d[i], wd.w[i + kMSALanesWord / 2], double, int32_t)
-            FTQ_DF(wt.d[i], wd.w[i], double, int32_t)
-          }
-          break;
-        default:
-          UNREACHABLE();
-      }
-      break;
-#undef FTQ_DF
-#define MSA_3RF_DF(T1, T2, Lanes, ws, wt, wd)      \
-  for (int i = 0; i < Lanes; i++) {                \
-    Msa3RFInstrHelper<T1, T2>(opcode, ws, wt, wd); \
-  }
-#define MSA_3RF_DF2(T1, T2, Lanes, ws, wt, wd)      \
-  for (int i = 0; i < Lanes; i++) {                 \
-    Msa3RFInstrHelper2<T1, T2>(opcode, ws, wt, wd); \
-  }
-    case MADD_Q:
-    case MSUB_Q:
-    case MADDR_Q:
-    case MSUBR_Q:
-      get_msa_register(wd_reg(), &wd);  // fall-through
-    case MUL_Q:
-    case MULR_Q:
-      switch (DecodeMsaDataFormat()) {
-        case MSA_HALF:
-          MSA_3RF_DF2(int16_t, int32_t, kMSALanesHalf, ws.h[i], wt.h[i],
-                      wd.h[i])
-          break;
-        case MSA_WORD:
-          MSA_3RF_DF2(int32_t, int64_t, kMSALanesWord, ws.w[i], wt.w[i],
-                      wd.w[i])
-          break;
-        default:
-          UNREACHABLE();
-      }
-      break;
-    default:
-      if (opcode == FMADD || opcode == FMSUB) {
-        get_msa_register(wd_reg(), &wd);
-      }
-      switch (DecodeMsaDataFormat()) {
-        case MSA_WORD:
-          MSA_3RF_DF(int32_t, float, kMSALanesWord, ws.w[i], wt.w[i], wd.w[i])
-          break;
-        case MSA_DWORD:
-          MSA_3RF_DF(int64_t, double, kMSALanesDword, ws.d[i], wt.d[i], wd.d[i])
-          break;
-        default:
-          UNREACHABLE();
-      }
-      break;
-#undef MSA_3RF_DF
-#undef MSA_3RF_DF2
-  }
-  set_msa_register(wd_reg(), &wd);
-  TraceMSARegWr(&wd);
-}
-
-void Simulator::DecodeTypeMsaVec() {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(CpuFeatures::IsSupported(MIPS_SIMD));
-  uint32_t opcode = instr_.InstructionBits() & kMsaVECMask;
-  msa_reg_t wd, ws, wt;
-
-  get_msa_register(instr_.WsValue(), ws.d);
-  get_msa_register(instr_.WtValue(), wt.d);
-  if (opcode == BMNZ_V || opcode == BMZ_V || opcode == BSEL_V) {
-    get_msa_register(instr_.WdValue(), wd.d);
-  }
-
-  for (int i = 0; i < kMSALanesDword; i++) {
-    switch (opcode) {
-      case AND_V:
-        wd.d[i] = ws.d[i] & wt.d[i];
-        break;
-      case OR_V:
-        wd.d[i] = ws.d[i] | wt.d[i];
-        break;
-      case NOR_V:
-        wd.d[i] = ~(ws.d[i] | wt.d[i]);
-        break;
-      case XOR_V:
-        wd.d[i] = ws.d[i] ^ wt.d[i];
-        break;
-      case BMNZ_V:
-        wd.d[i] = (wt.d[i] & ws.d[i]) | (~wt.d[i] & wd.d[i]);
-        break;
-      case BMZ_V:
-        wd.d[i] = (~wt.d[i] & ws.d[i]) | (wt.d[i] & wd.d[i]);
-        break;
-      case BSEL_V:
-        wd.d[i] = (~wd.d[i] & ws.d[i]) | (wd.d[i] & wt.d[i]);
-        break;
-      default:
-        UNREACHABLE();
-    }
-  }
-  set_msa_register(instr_.WdValue(), wd.d);
-  TraceMSARegWr(wd.d);
-}
-
-void Simulator::DecodeTypeMsa2R() {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(CpuFeatures::IsSupported(MIPS_SIMD));
-  uint32_t opcode = instr_.InstructionBits() & kMsa2RMask;
-  msa_reg_t wd, ws;
-  switch (opcode) {
-    case FILL:
-      switch (DecodeMsaDataFormat()) {
-        case MSA_BYTE: {
-          int64_t rs = get_register(instr_.WsValue());
-          for (int i = 0; i < kMSALanesByte; i++) {
-            wd.b[i] = rs & 0xFFu;
-          }
-          set_msa_register(instr_.WdValue(), wd.b);
-          TraceMSARegWr(wd.b);
-          break;
-        }
-        case MSA_HALF: {
-          int64_t rs = get_register(instr_.WsValue());
-          for (int i = 0; i < kMSALanesHalf; i++) {
-            wd.h[i] = rs & 0xFFFFu;
-          }
-          set_msa_register(instr_.WdValue(), wd.h);
-          TraceMSARegWr(wd.h);
-          break;
-        }
-        case MSA_WORD: {
-          int64_t rs = get_register(instr_.WsValue());
-          for (int i = 0; i < kMSALanesWord; i++) {
-            wd.w[i] = rs & 0xFFFFFFFFu;
-          }
-          set_msa_register(instr_.WdValue(), wd.w);
-          TraceMSARegWr(wd.w);
-          break;
-        }
-        case MSA_DWORD: {
-          int64_t rs = get_register(instr_.WsValue());
-          wd.d[0] = wd.d[1] = rs;
-          set_msa_register(instr_.WdValue(), wd.d);
-          TraceMSARegWr(wd.d);
-          break;
-        }
-        default:
-          UNREACHABLE();
-      }
-      break;
-    case PCNT:
-#define PCNT_DF(elem, num_of_lanes)                       \
-  get_msa_register(instr_.WsValue(), ws.elem);            \
-  for (int i = 0; i < num_of_lanes; i++) {                \
-    uint64_t u64elem = static_cast<uint64_t>(ws.elem[i]); \
-    wd.elem[i] = base::bits::CountPopulation(u64elem);    \
-  }                                                       \
-  set_msa_register(instr_.WdValue(), wd.elem);            \
-  TraceMSARegWr(wd.elem)
-
-      switch (DecodeMsaDataFormat()) {
-        case MSA_BYTE:
-          PCNT_DF(ub, kMSALanesByte);
-          break;
-        case MSA_HALF:
-          PCNT_DF(uh, kMSALanesHalf);
-          break;
-        case MSA_WORD:
-          PCNT_DF(uw, kMSALanesWord);
-          break;
-        case MSA_DWORD:
-          PCNT_DF(ud, kMSALanesDword);
-          break;
-        default:
-          UNREACHABLE();
-      }
-#undef PCNT_DF
-      break;
-    case NLOC:
-#define NLOC_DF(elem, num_of_lanes)                                         \
-  get_msa_register(instr_.WsValue(), ws.elem);                              \
-  for (int i = 0; i < num_of_lanes; i++) {                                  \
-    const uint64_t mask = (num_of_lanes == kMSALanesDword)                  \
-                              ? UINT64_MAX                                  \
-                              : (1ULL << (kMSARegSize / num_of_lanes)) - 1; \
-    uint64_t u64elem = static_cast<uint64_t>(~ws.elem[i]) & mask;           \
-    wd.elem[i] = base::bits::CountLeadingZeros64(u64elem) -                 \
-                 (64 - kMSARegSize / num_of_lanes);                         \
-  }                                                                         \
-  set_msa_register(instr_.WdValue(), wd.elem);                              \
-  TraceMSARegWr(wd.elem)
-
-      switch (DecodeMsaDataFormat()) {
-        case MSA_BYTE:
-          NLOC_DF(ub, kMSALanesByte);
-          break;
-        case MSA_HALF:
-          NLOC_DF(uh, kMSALanesHalf);
-          break;
-        case MSA_WORD:
-          NLOC_DF(uw, kMSALanesWord);
-          break;
-        case MSA_DWORD:
-          NLOC_DF(ud, kMSALanesDword);
-          break;
-        default:
-          UNREACHABLE();
-      }
-#undef NLOC_DF
-      break;
-    case NLZC:
-#define NLZC_DF(elem, num_of_lanes)                         \
-  get_msa_register(instr_.WsValue(), ws.elem);              \
-  for (int i = 0; i < num_of_lanes; i++) {                  \
-    uint64_t u64elem = static_cast<uint64_t>(ws.elem[i]);   \
-    wd.elem[i] = base::bits::CountLeadingZeros64(u64elem) - \
-                 (64 - kMSARegSize / num_of_lanes);         \
-  }                                                         \
-  set_msa_register(instr_.WdValue(), wd.elem);              \
-  TraceMSARegWr(wd.elem)
-
-      switch (DecodeMsaDataFormat()) {
-        case MSA_BYTE:
-          NLZC_DF(ub, kMSALanesByte);
-          break;
-        case MSA_HALF:
-          NLZC_DF(uh, kMSALanesHalf);
-          break;
-        case MSA_WORD:
-          NLZC_DF(uw, kMSALanesWord);
-          break;
-        case MSA_DWORD:
-          NLZC_DF(ud, kMSALanesDword);
-          break;
-        default:
-          UNREACHABLE();
-      }
-#undef NLZC_DF
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-#define BIT(n) (0x1LL << n)
-#define QUIET_BIT_S(nan) (bit_cast<int32_t>(nan) & BIT(22))
-#define QUIET_BIT_D(nan) (bit_cast<int64_t>(nan) & BIT(51))
-static inline bool isSnan(float fp) { return !QUIET_BIT_S(fp); }
-static inline bool isSnan(double fp) { return !QUIET_BIT_D(fp); }
-#undef QUIET_BIT_S
-#undef QUIET_BIT_D
-
-template <typename T_int, typename T_fp, typename T_src, typename T_dst>
-T_int Msa2RFInstrHelper(uint32_t opcode, T_src src, T_dst& dst,
-                        Simulator* sim) {
-  typedef typename std::make_unsigned<T_int>::type T_uint;
-  switch (opcode) {
-    case FCLASS: {
-#define SNAN_BIT BIT(0)
-#define QNAN_BIT BIT(1)
-#define NEG_INFINITY_BIT BIT(2)
-#define NEG_NORMAL_BIT BIT(3)
-#define NEG_SUBNORMAL_BIT BIT(4)
-#define NEG_ZERO_BIT BIT(5)
-#define POS_INFINITY_BIT BIT(6)
-#define POS_NORMAL_BIT BIT(7)
-#define POS_SUBNORMAL_BIT BIT(8)
-#define POS_ZERO_BIT BIT(9)
-      T_fp element = *reinterpret_cast<T_fp*>(&src);
-      switch (std::fpclassify(element)) {
-        case FP_INFINITE:
-          if (std::signbit(element)) {
-            dst = NEG_INFINITY_BIT;
-          } else {
-            dst = POS_INFINITY_BIT;
-          }
-          break;
-        case FP_NAN:
-          if (isSnan(element)) {
-            dst = SNAN_BIT;
-          } else {
-            dst = QNAN_BIT;
-          }
-          break;
-        case FP_NORMAL:
-          if (std::signbit(element)) {
-            dst = NEG_NORMAL_BIT;
-          } else {
-            dst = POS_NORMAL_BIT;
-          }
-          break;
-        case FP_SUBNORMAL:
-          if (std::signbit(element)) {
-            dst = NEG_SUBNORMAL_BIT;
-          } else {
-            dst = POS_SUBNORMAL_BIT;
-          }
-          break;
-        case FP_ZERO:
-          if (std::signbit(element)) {
-            dst = NEG_ZERO_BIT;
-          } else {
-            dst = POS_ZERO_BIT;
-          }
-          break;
-        default:
-          UNREACHABLE();
-      }
-      break;
-    }
-#undef BIT
-#undef SNAN_BIT
-#undef QNAN_BIT
-#undef NEG_INFINITY_BIT
-#undef NEG_NORMAL_BIT
-#undef NEG_SUBNORMAL_BIT
-#undef NEG_ZERO_BIT
-#undef POS_INFINITY_BIT
-#undef POS_NORMAL_BIT
-#undef POS_SUBNORMAL_BIT
-#undef POS_ZERO_BIT
-    case FTRUNC_S: {
-      T_fp element = bit_cast<T_fp>(src);
-      const T_int max_int = std::numeric_limits<T_int>::max();
-      const T_int min_int = std::numeric_limits<T_int>::min();
-      if (std::isnan(element)) {
-        dst = 0;
-      } else if (element >= max_int || element <= min_int) {
-        dst = element >= max_int ? max_int : min_int;
-      } else {
-        dst = static_cast<T_int>(std::trunc(element));
-      }
-      break;
-    }
-    case FTRUNC_U: {
-      T_fp element = bit_cast<T_fp>(src);
-      const T_uint max_int = std::numeric_limits<T_uint>::max();
-      if (std::isnan(element)) {
-        dst = 0;
-      } else if (element >= max_int || element <= 0) {
-        dst = element >= max_int ? max_int : 0;
-      } else {
-        dst = static_cast<T_uint>(std::trunc(element));
-      }
-      break;
-    }
-    case FSQRT: {
-      T_fp element = bit_cast<T_fp>(src);
-      if (element < 0 || std::isnan(element)) {
-        dst = bit_cast<T_int>(std::numeric_limits<T_fp>::quiet_NaN());
-      } else {
-        dst = bit_cast<T_int>(std::sqrt(element));
-      }
-      break;
-    }
-    case FRSQRT: {
-      T_fp element = bit_cast<T_fp>(src);
-      if (element < 0 || std::isnan(element)) {
-        dst = bit_cast<T_int>(std::numeric_limits<T_fp>::quiet_NaN());
-      } else {
-        dst = bit_cast<T_int>(1 / std::sqrt(element));
-      }
-      break;
-    }
-    case FRCP: {
-      T_fp element = bit_cast<T_fp>(src);
-      if (std::isnan(element)) {
-        dst = bit_cast<T_int>(std::numeric_limits<T_fp>::quiet_NaN());
-      } else {
-        dst = bit_cast<T_int>(1 / element);
-      }
-      break;
-    }
-    case FRINT: {
-      T_fp element = bit_cast<T_fp>(src);
-      if (std::isnan(element)) {
-        dst = bit_cast<T_int>(std::numeric_limits<T_fp>::quiet_NaN());
-      } else {
-        T_int dummy;
-        sim->round_according_to_msacsr<T_fp, T_int>(element, element, dummy);
-        dst = bit_cast<T_int>(element);
-      }
-      break;
-    }
-    case FLOG2: {
-      T_fp element = bit_cast<T_fp>(src);
-      switch (std::fpclassify(element)) {
-        case FP_NORMAL:
-        case FP_SUBNORMAL:
-          dst = bit_cast<T_int>(std::logb(element));
-          break;
-        case FP_ZERO:
-          dst = bit_cast<T_int>(-std::numeric_limits<T_fp>::infinity());
-          break;
-        case FP_NAN:
-          dst = bit_cast<T_int>(std::numeric_limits<T_fp>::quiet_NaN());
-          break;
-        case FP_INFINITE:
-          if (element < 0) {
-            dst = bit_cast<T_int>(std::numeric_limits<T_fp>::quiet_NaN());
-          } else {
-            dst = bit_cast<T_int>(std::numeric_limits<T_fp>::infinity());
-          }
-          break;
-        default:
-          UNREACHABLE();
-      }
-      break;
-    }
-    case FTINT_S: {
-      T_fp element = bit_cast<T_fp>(src);
-      const T_int max_int = std::numeric_limits<T_int>::max();
-      const T_int min_int = std::numeric_limits<T_int>::min();
-      if (std::isnan(element)) {
-        dst = 0;
-      } else if (element < min_int || element > max_int) {
-        dst = element > max_int ? max_int : min_int;
-      } else {
-        sim->round_according_to_msacsr<T_fp, T_int>(element, element, dst);
-      }
-      break;
-    }
-    case FTINT_U: {
-      T_fp element = bit_cast<T_fp>(src);
-      const T_uint max_uint = std::numeric_limits<T_uint>::max();
-      if (std::isnan(element)) {
-        dst = 0;
-      } else if (element < 0 || element > max_uint) {
-        dst = element > max_uint ? max_uint : 0;
-      } else {
-        T_uint res;
-        sim->round_according_to_msacsr<T_fp, T_uint>(element, element, res);
-        dst = *reinterpret_cast<T_int*>(&res);
-      }
-      break;
-    }
-    case FFINT_S:
-      dst = bit_cast<T_int>(static_cast<T_fp>(src));
-      break;
-    case FFINT_U:
-      typedef typename std::make_unsigned<T_src>::type uT_src;
-      dst = bit_cast<T_int>(static_cast<T_fp>(bit_cast<uT_src>(src)));
-      break;
-    default:
-      UNREACHABLE();
-  }
-  return 0;
-}
-
-template <typename T_int, typename T_fp, typename T_reg>
-T_int Msa2RFInstrHelper2(uint32_t opcode, T_reg ws, int i) {
-  switch (opcode) {
-#define EXTRACT_FLOAT16_SIGN(fp16) (fp16 >> 15)
-#define EXTRACT_FLOAT16_EXP(fp16) (fp16 >> 10 & 0x1F)
-#define EXTRACT_FLOAT16_FRAC(fp16) (fp16 & 0x3FF)
-#define PACK_FLOAT32(sign, exp, frac) \
-  static_cast<uint32_t>(((sign) << 31) + ((exp) << 23) + (frac))
-#define FEXUP_DF(src_index)                                                   \
-  uint_fast16_t element = ws.uh[src_index];                                   \
-  uint_fast32_t aSign, aFrac;                                                 \
-  int_fast32_t aExp;                                                          \
-  aSign = EXTRACT_FLOAT16_SIGN(element);                                      \
-  aExp = EXTRACT_FLOAT16_EXP(element);                                        \
-  aFrac = EXTRACT_FLOAT16_FRAC(element);                                      \
-  if (V8_LIKELY(aExp && aExp != 0x1F)) {                                      \
-    return PACK_FLOAT32(aSign, aExp + 0x70, aFrac << 13);                     \
-  } else if (aExp == 0x1F) {                                                  \
-    if (aFrac) {                                                              \
-      return bit_cast<int32_t>(std::numeric_limits<float>::quiet_NaN());      \
-    } else {                                                                  \
-      return bit_cast<uint32_t>(std::numeric_limits<float>::infinity()) |     \
-             static_cast<uint32_t>(aSign) << 31;                              \
-    }                                                                         \
-  } else {                                                                    \
-    if (aFrac == 0) {                                                         \
-      return PACK_FLOAT32(aSign, 0, 0);                                       \
-    } else {                                                                  \
-      int_fast16_t shiftCount =                                               \
-          base::bits::CountLeadingZeros32(static_cast<uint32_t>(aFrac)) - 21; \
-      aFrac <<= shiftCount;                                                   \
-      aExp = -shiftCount;                                                     \
-      return PACK_FLOAT32(aSign, aExp + 0x70, aFrac << 13);                   \
-    }                                                                         \
-  }
-    case FEXUPL:
-      if (std::is_same<int32_t, T_int>::value) {
-        FEXUP_DF(i + kMSALanesWord)
-      } else {
-        return bit_cast<int64_t>(
-            static_cast<double>(bit_cast<float>(ws.w[i + kMSALanesDword])));
-      }
-    case FEXUPR:
-      if (std::is_same<int32_t, T_int>::value) {
-        FEXUP_DF(i)
-      } else {
-        return bit_cast<int64_t>(static_cast<double>(bit_cast<float>(ws.w[i])));
-      }
-    case FFQL: {
-      if (std::is_same<int32_t, T_int>::value) {
-        return bit_cast<int32_t>(static_cast<float>(ws.h[i + kMSALanesWord]) /
-                                 (1U << 15));
-      } else {
-        return bit_cast<int64_t>(static_cast<double>(ws.w[i + kMSALanesDword]) /
-                                 (1U << 31));
-      }
-      break;
-    }
-    case FFQR: {
-      if (std::is_same<int32_t, T_int>::value) {
-        return bit_cast<int32_t>(static_cast<float>(ws.h[i]) / (1U << 15));
-      } else {
-        return bit_cast<int64_t>(static_cast<double>(ws.w[i]) / (1U << 31));
-      }
-      break;
-      default:
-        UNREACHABLE();
-    }
-  }
-#undef EXTRACT_FLOAT16_SIGN
-#undef EXTRACT_FLOAT16_EXP
-#undef EXTRACT_FLOAT16_FRAC
-#undef PACK_FLOAT32
-#undef FEXUP_DF
-}
-
-void Simulator::DecodeTypeMsa2RF() {
-  DCHECK_EQ(kArchVariant, kMips64r6);
-  DCHECK(CpuFeatures::IsSupported(MIPS_SIMD));
-  uint32_t opcode = instr_.InstructionBits() & kMsa2RFMask;
-  msa_reg_t wd, ws;
-  get_msa_register(ws_reg(), &ws);
-  if (opcode == FEXUPL || opcode == FEXUPR || opcode == FFQL ||
-      opcode == FFQR) {
-    switch (DecodeMsaDataFormat()) {
-      case MSA_WORD:
-        for (int i = 0; i < kMSALanesWord; i++) {
-          wd.w[i] = Msa2RFInstrHelper2<int32_t, float>(opcode, ws, i);
-        }
-        break;
-      case MSA_DWORD:
-        for (int i = 0; i < kMSALanesDword; i++) {
-          wd.d[i] = Msa2RFInstrHelper2<int64_t, double>(opcode, ws, i);
-        }
-        break;
-      default:
-        UNREACHABLE();
-    }
-  } else {
-    switch (DecodeMsaDataFormat()) {
-      case MSA_WORD:
-        for (int i = 0; i < kMSALanesWord; i++) {
-          Msa2RFInstrHelper<int32_t, float>(opcode, ws.w[i], wd.w[i], this);
-        }
-        break;
-      case MSA_DWORD:
-        for (int i = 0; i < kMSALanesDword; i++) {
-          Msa2RFInstrHelper<int64_t, double>(opcode, ws.d[i], wd.d[i], this);
-        }
-        break;
-      default:
-        UNREACHABLE();
-    }
-  }
-  set_msa_register(wd_reg(), &wd);
-  TraceMSARegWr(&wd);
-}
-
-void Simulator::DecodeTypeRegister() {
-  // ---------- Execution.
-  switch (instr_.OpcodeFieldRaw()) {
-    case COP1:
-      DecodeTypeRegisterCOP1();
-      break;
-    case COP1X:
-      DecodeTypeRegisterCOP1X();
-      break;
-    case SPECIAL:
-      DecodeTypeRegisterSPECIAL();
-      break;
-    case SPECIAL2:
-      DecodeTypeRegisterSPECIAL2();
-      break;
-    case SPECIAL3:
-      DecodeTypeRegisterSPECIAL3();
-      break;
-    case MSA:
-      switch (instr_.MSAMinorOpcodeField()) {
-        case kMsaMinor3R:
-          DecodeTypeMsa3R();
-          break;
-        case kMsaMinor3RF:
-          DecodeTypeMsa3RF();
-          break;
-        case kMsaMinorVEC:
-          DecodeTypeMsaVec();
-          break;
-        case kMsaMinor2R:
-          DecodeTypeMsa2R();
-          break;
-        case kMsaMinor2RF:
-          DecodeTypeMsa2RF();
-          break;
-        case kMsaMinorELM:
-          DecodeTypeMsaELM();
-          break;
-        default:
-          UNREACHABLE();
-      }
-      break;
-    // Unimplemented opcodes raised an error in the configuration step before,
-    // so we can use the default here to set the destination register in common
-    // cases.
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-// Type 2: instructions using a 16, 21 or 26 bits immediate. (e.g. beq, beqc).
-void Simulator::DecodeTypeImmediate() {
-  // Instruction fields.
-  Opcode op = instr_.OpcodeFieldRaw();
-  int32_t rs_reg = instr_.RsValue();
-  int64_t rs = get_register(instr_.RsValue());
-  uint64_t rs_u = static_cast<uint64_t>(rs);
-  int32_t rt_reg = instr_.RtValue();  // Destination register.
-  int64_t rt = get_register(rt_reg);
-  int16_t imm16 = instr_.Imm16Value();
-  int32_t imm18 = instr_.Imm18Value();
-
-  int32_t ft_reg = instr_.FtValue();  // Destination register.
-
-  // Zero extended immediate.
-  uint64_t oe_imm16 = 0xFFFF & imm16;
-  // Sign extended immediate.
-  int64_t se_imm16 = imm16;
-  int64_t se_imm18 = imm18 | ((imm18 & 0x20000) ? 0xFFFFFFFFFFFC0000 : 0);
-
-  // Next pc.
-  int64_t next_pc = bad_ra;
-
-  // Used for conditional branch instructions.
-  bool execute_branch_delay_instruction = false;
-
-  // Used for arithmetic instructions.
-  int64_t alu_out = 0;
-
-  // Used for memory instructions.
-  int64_t addr = 0x0;
-  // Alignment for 32-bit integers used in LWL, LWR, etc.
-  const int kInt32AlignmentMask = sizeof(uint32_t) - 1;
-  // Alignment for 64-bit integers used in LDL, LDR, etc.
-  const int kInt64AlignmentMask = sizeof(uint64_t) - 1;
-
-  // Branch instructions common part.
-  auto BranchAndLinkHelper =
-      [this, &next_pc, &execute_branch_delay_instruction](bool do_branch) {
-        execute_branch_delay_instruction = true;
-        int64_t current_pc = get_pc();
-        if (do_branch) {
-          int16_t imm16 = instr_.Imm16Value();
-          next_pc = current_pc + (imm16 << 2) + Instruction::kInstrSize;
-          set_register(31, current_pc + 2 * Instruction::kInstrSize);
-        } else {
-          next_pc = current_pc + 2 * Instruction::kInstrSize;
-        }
-      };
-
-  auto BranchHelper = [this, &next_pc,
-                       &execute_branch_delay_instruction](bool do_branch) {
-    execute_branch_delay_instruction = true;
-    int64_t current_pc = get_pc();
-    if (do_branch) {
-      int16_t imm16 = instr_.Imm16Value();
-      next_pc = current_pc + (imm16 << 2) + Instruction::kInstrSize;
-    } else {
-      next_pc = current_pc + 2 * Instruction::kInstrSize;
-    }
-  };
-
-  auto BranchHelper_MSA = [this, &next_pc, imm16,
-                           &execute_branch_delay_instruction](bool do_branch) {
-    execute_branch_delay_instruction = true;
-    int64_t current_pc = get_pc();
-    const int32_t bitsIn16Int = sizeof(int16_t) * kBitsPerByte;
-    if (do_branch) {
-      if (FLAG_debug_code) {
-        int16_t bits = imm16 & 0xFC;
-        if (imm16 >= 0) {
-          CHECK_EQ(bits, 0);
-        } else {
-          CHECK_EQ(bits ^ 0xFC, 0);
-        }
-      }
-      // jump range :[pc + kInstrSize - 512 * kInstrSize,
-      //              pc + kInstrSize + 511 * kInstrSize]
-      int16_t offset = static_cast<int16_t>(imm16 << (bitsIn16Int - 10)) >>
-                       (bitsIn16Int - 12);
-      next_pc = current_pc + offset + Instruction::kInstrSize;
-    } else {
-      next_pc = current_pc + 2 * Instruction::kInstrSize;
-    }
-  };
-
-  auto BranchAndLinkCompactHelper = [this, &next_pc](bool do_branch, int bits) {
-    int64_t current_pc = get_pc();
-    CheckForbiddenSlot(current_pc);
-    if (do_branch) {
-      int32_t imm = instr_.ImmValue(bits);
-      imm <<= 32 - bits;
-      imm >>= 32 - bits;
-      next_pc = current_pc + (imm << 2) + Instruction::kInstrSize;
-      set_register(31, current_pc + Instruction::kInstrSize);
-    }
-  };
-
-  auto BranchCompactHelper = [this, &next_pc](bool do_branch, int bits) {
-    int64_t current_pc = get_pc();
-    CheckForbiddenSlot(current_pc);
-    if (do_branch) {
-      int32_t imm = instr_.ImmValue(bits);
-      imm <<= 32 - bits;
-      imm >>= 32 - bits;
-      next_pc = get_pc() + (imm << 2) + Instruction::kInstrSize;
-    }
-  };
-
-  switch (op) {
-    // ------------- COP1. Coprocessor instructions.
-    case COP1:
-      switch (instr_.RsFieldRaw()) {
-        case BC1: {  // Branch on coprocessor condition.
-          uint32_t cc = instr_.FBccValue();
-          uint32_t fcsr_cc = get_fcsr_condition_bit(cc);
-          uint32_t cc_value = test_fcsr_bit(fcsr_cc);
-          bool do_branch = (instr_.FBtrueValue()) ? cc_value : !cc_value;
-          BranchHelper(do_branch);
-          break;
-        }
-        case BC1EQZ:
-          BranchHelper(!(get_fpu_register(ft_reg) & 0x1));
-          break;
-        case BC1NEZ:
-          BranchHelper(get_fpu_register(ft_reg) & 0x1);
-          break;
-        case BZ_V: {
-          msa_reg_t wt;
-          get_msa_register(wt_reg(), &wt);
-          BranchHelper_MSA(wt.d[0] == 0 && wt.d[1] == 0);
-        } break;
-#define BZ_DF(witdh, lanes)          \
-  {                                  \
-    msa_reg_t wt;                    \
-    get_msa_register(wt_reg(), &wt); \
-    int i;                           \
-    for (i = 0; i < lanes; ++i) {    \
-      if (wt.witdh[i] == 0) {        \
-        break;                       \
-      }                              \
-    }                                \
-    BranchHelper_MSA(i != lanes);    \
-  }
-        case BZ_B:
-          BZ_DF(b, kMSALanesByte)
-          break;
-        case BZ_H:
-          BZ_DF(h, kMSALanesHalf)
-          break;
-        case BZ_W:
-          BZ_DF(w, kMSALanesWord)
-          break;
-        case BZ_D:
-          BZ_DF(d, kMSALanesDword)
-          break;
-#undef BZ_DF
-        case BNZ_V: {
-          msa_reg_t wt;
-          get_msa_register(wt_reg(), &wt);
-          BranchHelper_MSA(wt.d[0] != 0 || wt.d[1] != 0);
-        } break;
-#define BNZ_DF(witdh, lanes)         \
-  {                                  \
-    msa_reg_t wt;                    \
-    get_msa_register(wt_reg(), &wt); \
-    int i;                           \
-    for (i = 0; i < lanes; ++i) {    \
-      if (wt.witdh[i] == 0) {        \
-        break;                       \
-      }                              \
-    }                                \
-    BranchHelper_MSA(i == lanes);    \
-  }
-        case BNZ_B:
-          BNZ_DF(b, kMSALanesByte)
-          break;
-        case BNZ_H:
-          BNZ_DF(h, kMSALanesHalf)
-          break;
-        case BNZ_W:
-          BNZ_DF(w, kMSALanesWord)
-          break;
-        case BNZ_D:
-          BNZ_DF(d, kMSALanesDword)
-          break;
-#undef BNZ_DF
-        default:
-          UNREACHABLE();
-      }
-      break;
-    // ------------- REGIMM class.
-    case REGIMM:
-      switch (instr_.RtFieldRaw()) {
-        case BLTZ:
-          BranchHelper(rs < 0);
-          break;
-        case BGEZ:
-          BranchHelper(rs >= 0);
-          break;
-        case BLTZAL:
-          BranchAndLinkHelper(rs < 0);
-          break;
-        case BGEZAL:
-          BranchAndLinkHelper(rs >= 0);
-          break;
-        case DAHI:
-          SetResult(rs_reg, rs + (se_imm16 << 32));
-          break;
-        case DATI:
-          SetResult(rs_reg, rs + (se_imm16 << 48));
-          break;
-        default:
-          UNREACHABLE();
-      }
-      break;  // case REGIMM.
-    // ------------- Branch instructions.
-    // When comparing to zero, the encoding of rt field is always 0, so we don't
-    // need to replace rt with zero.
-    case BEQ:
-      BranchHelper(rs == rt);
-      break;
-    case BNE:
-      BranchHelper(rs != rt);
-      break;
-    case POP06:  // BLEZALC, BGEZALC, BGEUC, BLEZ (pre-r6)
-      if (kArchVariant == kMips64r6) {
-        if (rt_reg != 0) {
-          if (rs_reg == 0) {  // BLEZALC
-            BranchAndLinkCompactHelper(rt <= 0, 16);
-          } else {
-            if (rs_reg == rt_reg) {  // BGEZALC
-              BranchAndLinkCompactHelper(rt >= 0, 16);
-            } else {  // BGEUC
-              BranchCompactHelper(
-                  static_cast<uint64_t>(rs) >= static_cast<uint64_t>(rt), 16);
-            }
-          }
-        } else {  // BLEZ
-          BranchHelper(rs <= 0);
-        }
-      } else {  // BLEZ
-        BranchHelper(rs <= 0);
-      }
-      break;
-    case POP07:  // BGTZALC, BLTZALC, BLTUC, BGTZ (pre-r6)
-      if (kArchVariant == kMips64r6) {
-        if (rt_reg != 0) {
-          if (rs_reg == 0) {  // BGTZALC
-            BranchAndLinkCompactHelper(rt > 0, 16);
-          } else {
-            if (rt_reg == rs_reg) {  // BLTZALC
-              BranchAndLinkCompactHelper(rt < 0, 16);
-            } else {  // BLTUC
-              BranchCompactHelper(
-                  static_cast<uint64_t>(rs) < static_cast<uint64_t>(rt), 16);
-            }
-          }
-        } else {  // BGTZ
-          BranchHelper(rs > 0);
-        }
-      } else {  // BGTZ
-        BranchHelper(rs > 0);
-      }
-      break;
-    case POP26:  // BLEZC, BGEZC, BGEC/BLEC / BLEZL (pre-r6)
-      if (kArchVariant == kMips64r6) {
-        if (rt_reg != 0) {
-          if (rs_reg == 0) {  // BLEZC
-            BranchCompactHelper(rt <= 0, 16);
-          } else {
-            if (rs_reg == rt_reg) {  // BGEZC
-              BranchCompactHelper(rt >= 0, 16);
-            } else {  // BGEC/BLEC
-              BranchCompactHelper(rs >= rt, 16);
-            }
-          }
-        }
-      } else {  // BLEZL
-        BranchAndLinkHelper(rs <= 0);
-      }
-      break;
-    case POP27:  // BGTZC, BLTZC, BLTC/BGTC / BGTZL (pre-r6)
-      if (kArchVariant == kMips64r6) {
-        if (rt_reg != 0) {
-          if (rs_reg == 0) {  // BGTZC
-            BranchCompactHelper(rt > 0, 16);
-          } else {
-            if (rs_reg == rt_reg) {  // BLTZC
-              BranchCompactHelper(rt < 0, 16);
-            } else {  // BLTC/BGTC
-              BranchCompactHelper(rs < rt, 16);
-            }
-          }
-        }
-      } else {  // BGTZL
-        BranchAndLinkHelper(rs > 0);
-      }
-      break;
-    case POP66:           // BEQZC, JIC
-      if (rs_reg != 0) {  // BEQZC
-        BranchCompactHelper(rs == 0, 21);
-      } else {  // JIC
-        next_pc = rt + imm16;
-      }
-      break;
-    case POP76:           // BNEZC, JIALC
-      if (rs_reg != 0) {  // BNEZC
-        BranchCompactHelper(rs != 0, 21);
-      } else {  // JIALC
-        int64_t current_pc = get_pc();
-        set_register(31, current_pc + Instruction::kInstrSize);
-        next_pc = rt + imm16;
-      }
-      break;
-    case BC:
-      BranchCompactHelper(true, 26);
-      break;
-    case BALC:
-      BranchAndLinkCompactHelper(true, 26);
-      break;
-    case POP10:  // BOVC, BEQZALC, BEQC / ADDI (pre-r6)
-      if (kArchVariant == kMips64r6) {
-        if (rs_reg >= rt_reg) {  // BOVC
-          bool condition = !is_int32(rs) || !is_int32(rt) || !is_int32(rs + rt);
-          BranchCompactHelper(condition, 16);
-        } else {
-          if (rs_reg == 0) {  // BEQZALC
-            BranchAndLinkCompactHelper(rt == 0, 16);
-          } else {  // BEQC
-            BranchCompactHelper(rt == rs, 16);
-          }
-        }
-      } else {  // ADDI
-        if (HaveSameSign(rs, se_imm16)) {
-          if (rs > 0) {
-            if (rs <= Registers::kMaxValue - se_imm16) {
-              SignalException(kIntegerOverflow);
-            }
-          } else if (rs < 0) {
-            if (rs >= Registers::kMinValue - se_imm16) {
-              SignalException(kIntegerUnderflow);
-            }
-          }
-        }
-        SetResult(rt_reg, rs + se_imm16);
-      }
-      break;
-    case POP30:  // BNVC, BNEZALC, BNEC / DADDI (pre-r6)
-      if (kArchVariant == kMips64r6) {
-        if (rs_reg >= rt_reg) {  // BNVC
-          bool condition = is_int32(rs) && is_int32(rt) && is_int32(rs + rt);
-          BranchCompactHelper(condition, 16);
-        } else {
-          if (rs_reg == 0) {  // BNEZALC
-            BranchAndLinkCompactHelper(rt != 0, 16);
-          } else {  // BNEC
-            BranchCompactHelper(rt != rs, 16);
-          }
-        }
-      }
-      break;
-    // ------------- Arithmetic instructions.
-    case ADDIU: {
-      int32_t alu32_out = static_cast<int32_t>(rs + se_imm16);
-      // Sign-extend result of 32bit operation into 64bit register.
-      SetResult(rt_reg, static_cast<int64_t>(alu32_out));
-      break;
-    }
-    case DADDIU:
-      SetResult(rt_reg, rs + se_imm16);
-      break;
-    case SLTI:
-      SetResult(rt_reg, rs < se_imm16 ? 1 : 0);
-      break;
-    case SLTIU:
-      SetResult(rt_reg, rs_u < static_cast<uint64_t>(se_imm16) ? 1 : 0);
-      break;
-    case ANDI:
-      SetResult(rt_reg, rs & oe_imm16);
-      break;
-    case ORI:
-      SetResult(rt_reg, rs | oe_imm16);
-      break;
-    case XORI:
-      SetResult(rt_reg, rs ^ oe_imm16);
-      break;
-    case LUI:
-      if (rs_reg != 0) {
-        // AUI instruction.
-        DCHECK_EQ(kArchVariant, kMips64r6);
-        int32_t alu32_out = static_cast<int32_t>(rs + (se_imm16 << 16));
-        SetResult(rt_reg, static_cast<int64_t>(alu32_out));
-      } else {
-        // LUI instruction.
-        int32_t alu32_out = static_cast<int32_t>(oe_imm16 << 16);
-        // Sign-extend result of 32bit operation into 64bit register.
-        SetResult(rt_reg, static_cast<int64_t>(alu32_out));
-      }
-      break;
-    case DAUI:
-      DCHECK_EQ(kArchVariant, kMips64r6);
-      DCHECK_NE(rs_reg, 0);
-      SetResult(rt_reg, rs + (se_imm16 << 16));
-      break;
-    // ------------- Memory instructions.
-    case LB:
-      set_register(rt_reg, ReadB(rs + se_imm16));
-      break;
-    case LH:
-      set_register(rt_reg, ReadH(rs + se_imm16, instr_.instr()));
-      break;
-    case LWL: {
-      // al_offset is offset of the effective address within an aligned word.
-      uint8_t al_offset = (rs + se_imm16) & kInt32AlignmentMask;
-      uint8_t byte_shift = kInt32AlignmentMask - al_offset;
-      uint32_t mask = (1 << byte_shift * 8) - 1;
-      addr = rs + se_imm16 - al_offset;
-      int32_t val = ReadW(addr, instr_.instr());
-      val <<= byte_shift * 8;
-      val |= rt & mask;
-      set_register(rt_reg, static_cast<int64_t>(val));
-      break;
-    }
-    case LW:
-      set_register(rt_reg, ReadW(rs + se_imm16, instr_.instr()));
-      break;
-    case LWU:
-      set_register(rt_reg, ReadWU(rs + se_imm16, instr_.instr()));
-      break;
-    case LD:
-      set_register(rt_reg, Read2W(rs + se_imm16, instr_.instr()));
-      break;
-    case LBU:
-      set_register(rt_reg, ReadBU(rs + se_imm16));
-      break;
-    case LHU:
-      set_register(rt_reg, ReadHU(rs + se_imm16, instr_.instr()));
-      break;
-    case LWR: {
-      // al_offset is offset of the effective address within an aligned word.
-      uint8_t al_offset = (rs + se_imm16) & kInt32AlignmentMask;
-      uint8_t byte_shift = kInt32AlignmentMask - al_offset;
-      uint32_t mask = al_offset ? (~0 << (byte_shift + 1) * 8) : 0;
-      addr = rs + se_imm16 - al_offset;
-      alu_out = ReadW(addr, instr_.instr());
-      alu_out = static_cast<uint32_t> (alu_out) >> al_offset * 8;
-      alu_out |= rt & mask;
-      set_register(rt_reg, alu_out);
-      break;
-    }
-    case LDL: {
-      // al_offset is offset of the effective address within an aligned word.
-      uint8_t al_offset = (rs + se_imm16) & kInt64AlignmentMask;
-      uint8_t byte_shift = kInt64AlignmentMask - al_offset;
-      uint64_t mask = (1UL << byte_shift * 8) - 1;
-      addr = rs + se_imm16 - al_offset;
-      alu_out = Read2W(addr, instr_.instr());
-      alu_out <<= byte_shift * 8;
-      alu_out |= rt & mask;
-      set_register(rt_reg, alu_out);
-      break;
-    }
-    case LDR: {
-      // al_offset is offset of the effective address within an aligned word.
-      uint8_t al_offset = (rs + se_imm16) & kInt64AlignmentMask;
-      uint8_t byte_shift = kInt64AlignmentMask - al_offset;
-      uint64_t mask = al_offset ? (~0UL << (byte_shift + 1) * 8) : 0UL;
-      addr = rs + se_imm16 - al_offset;
-      alu_out = Read2W(addr, instr_.instr());
-      alu_out = alu_out >> al_offset * 8;
-      alu_out |= rt & mask;
-      set_register(rt_reg, alu_out);
-      break;
-    }
-    case SB:
-      WriteB(rs + se_imm16, static_cast<int8_t>(rt));
-      break;
-    case SH:
-      WriteH(rs + se_imm16, static_cast<uint16_t>(rt), instr_.instr());
-      break;
-    case SWL: {
-      uint8_t al_offset = (rs + se_imm16) & kInt32AlignmentMask;
-      uint8_t byte_shift = kInt32AlignmentMask - al_offset;
-      uint32_t mask = byte_shift ? (~0 << (al_offset + 1) * 8) : 0;
-      addr = rs + se_imm16 - al_offset;
-      uint64_t mem_value = ReadW(addr, instr_.instr()) & mask;
-      mem_value |= static_cast<uint32_t>(rt) >> byte_shift * 8;
-      WriteW(addr, static_cast<int32_t>(mem_value), instr_.instr());
-      break;
-    }
-    case SW:
-      WriteW(rs + se_imm16, static_cast<int32_t>(rt), instr_.instr());
-      break;
-    case SD:
-      Write2W(rs + se_imm16, rt, instr_.instr());
-      break;
-    case SWR: {
-      uint8_t al_offset = (rs + se_imm16) & kInt32AlignmentMask;
-      uint32_t mask = (1 << al_offset * 8) - 1;
-      addr = rs + se_imm16 - al_offset;
-      uint64_t mem_value = ReadW(addr, instr_.instr());
-      mem_value = (rt << al_offset * 8) | (mem_value & mask);
-      WriteW(addr, static_cast<int32_t>(mem_value), instr_.instr());
-      break;
-    }
-    case SDL: {
-      uint8_t al_offset = (rs + se_imm16) & kInt64AlignmentMask;
-      uint8_t byte_shift = kInt64AlignmentMask - al_offset;
-      uint64_t mask = byte_shift ? (~0UL << (al_offset + 1) * 8) : 0;
-      addr = rs + se_imm16 - al_offset;
-      uint64_t mem_value = Read2W(addr, instr_.instr()) & mask;
-      mem_value |= static_cast<uint64_t>(rt) >> byte_shift * 8;
-      Write2W(addr, mem_value, instr_.instr());
-      break;
-    }
-    case SDR: {
-      uint8_t al_offset = (rs + se_imm16) & kInt64AlignmentMask;
-      uint64_t mask = (1UL << al_offset * 8) - 1;
-      addr = rs + se_imm16 - al_offset;
-      uint64_t mem_value = Read2W(addr, instr_.instr());
-      mem_value = (rt << al_offset * 8) | (mem_value & mask);
-      Write2W(addr, mem_value, instr_.instr());
-      break;
-    }
-    case LL: {
-      // LL/SC sequence cannot be simulated properly
-      DCHECK_EQ(kArchVariant, kMips64r2);
-      set_register(rt_reg, ReadW(rs + se_imm16, instr_.instr()));
-      break;
-    }
-    case SC: {
-      // LL/SC sequence cannot be simulated properly
-      DCHECK_EQ(kArchVariant, kMips64r2);
-      WriteW(rs + se_imm16, static_cast<int32_t>(rt), instr_.instr());
-      set_register(rt_reg, 1);
-      break;
-    }
-    case LLD: {
-      // LL/SC sequence cannot be simulated properly
-      DCHECK_EQ(kArchVariant, kMips64r2);
-      set_register(rt_reg, ReadD(rs + se_imm16, instr_.instr()));
-      break;
-    }
-    case SCD: {
-      // LL/SC sequence cannot be simulated properly
-      DCHECK_EQ(kArchVariant, kMips64r2);
-      WriteD(rs + se_imm16, rt, instr_.instr());
-      set_register(rt_reg, 1);
-      break;
-    }
-    case LWC1:
-      set_fpu_register(ft_reg, kFPUInvalidResult);  // Trash upper 32 bits.
-      set_fpu_register_word(ft_reg,
-                            ReadW(rs + se_imm16, instr_.instr(), FLOAT_DOUBLE));
-      break;
-    case LDC1:
-      set_fpu_register_double(ft_reg, ReadD(rs + se_imm16, instr_.instr()));
-      TraceMemRd(addr, get_fpu_register(ft_reg), DOUBLE);
-      break;
-    case SWC1: {
-      int32_t alu_out_32 = static_cast<int32_t>(get_fpu_register(ft_reg));
-      WriteW(rs + se_imm16, alu_out_32, instr_.instr());
-      break;
-    }
-    case SDC1:
-      WriteD(rs + se_imm16, get_fpu_register_double(ft_reg), instr_.instr());
-      TraceMemWr(rs + se_imm16, get_fpu_register(ft_reg), DWORD);
-      break;
-    // ------------- PC-Relative instructions.
-    case PCREL: {
-      // rt field: checking 5-bits.
-      int32_t imm21 = instr_.Imm21Value();
-      int64_t current_pc = get_pc();
-      uint8_t rt = (imm21 >> kImm16Bits);
-      switch (rt) {
-        case ALUIPC:
-          addr = current_pc + (se_imm16 << 16);
-          alu_out = static_cast<int64_t>(~0x0FFFF) & addr;
-          break;
-        case AUIPC:
-          alu_out = current_pc + (se_imm16 << 16);
-          break;
-        default: {
-          int32_t imm19 = instr_.Imm19Value();
-          // rt field: checking the most significant 3-bits.
-          rt = (imm21 >> kImm18Bits);
-          switch (rt) {
-            case LDPC:
-              addr =
-                  (current_pc & static_cast<int64_t>(~0x7)) + (se_imm18 << 3);
-              alu_out = Read2W(addr, instr_.instr());
-              break;
-            default: {
-              // rt field: checking the most significant 2-bits.
-              rt = (imm21 >> kImm19Bits);
-              switch (rt) {
-                case LWUPC: {
-                  // Set sign.
-                  imm19 <<= (kOpcodeBits + kRsBits + 2);
-                  imm19 >>= (kOpcodeBits + kRsBits + 2);
-                  addr = current_pc + (imm19 << 2);
-                  uint32_t* ptr = reinterpret_cast<uint32_t*>(addr);
-                  alu_out = *ptr;
-                  break;
-                }
-                case LWPC: {
-                  // Set sign.
-                  imm19 <<= (kOpcodeBits + kRsBits + 2);
-                  imm19 >>= (kOpcodeBits + kRsBits + 2);
-                  addr = current_pc + (imm19 << 2);
-                  int32_t* ptr = reinterpret_cast<int32_t*>(addr);
-                  alu_out = *ptr;
-                  break;
-                }
-                case ADDIUPC: {
-                  int64_t se_imm19 =
-                      imm19 | ((imm19 & 0x40000) ? 0xFFFFFFFFFFF80000 : 0);
-                  alu_out = current_pc + (se_imm19 << 2);
-                  break;
-                }
-                default:
-                  UNREACHABLE();
-                  break;
-              }
-              break;
-            }
-          }
-          break;
-        }
-      }
-      SetResult(rs_reg, alu_out);
-      break;
-    }
-    case SPECIAL3: {
-      switch (instr_.FunctionFieldRaw()) {
-        case LL_R6: {
-          // LL/SC sequence cannot be simulated properly
-          DCHECK_EQ(kArchVariant, kMips64r6);
-          int64_t base = get_register(instr_.BaseValue());
-          int32_t offset9 = instr_.Imm9Value();
-          set_register(rt_reg, ReadW(base + offset9, instr_.instr()));
-          break;
-        }
-        case LLD_R6: {
-          // LL/SC sequence cannot be simulated properly
-          DCHECK_EQ(kArchVariant, kMips64r6);
-          int64_t base = get_register(instr_.BaseValue());
-          int32_t offset9 = instr_.Imm9Value();
-          set_register(rt_reg, ReadD(base + offset9, instr_.instr()));
-          break;
-        }
-        case SC_R6: {
-          // LL/SC sequence cannot be simulated properly
-          DCHECK_EQ(kArchVariant, kMips64r6);
-          int64_t base = get_register(instr_.BaseValue());
-          int32_t offset9 = instr_.Imm9Value();
-          WriteW(base + offset9, static_cast<int32_t>(rt), instr_.instr());
-          set_register(rt_reg, 1);
-          break;
-        }
-        case SCD_R6: {
-          // LL/SC sequence cannot be simulated properly
-          DCHECK_EQ(kArchVariant, kMips64r6);
-          int64_t base = get_register(instr_.BaseValue());
-          int32_t offset9 = instr_.Imm9Value();
-          WriteD(base + offset9, rt, instr_.instr());
-          set_register(rt_reg, 1);
-          break;
-        }
-        default:
-          UNREACHABLE();
-      }
-      break;
-    }
-
-    case MSA:
-      switch (instr_.MSAMinorOpcodeField()) {
-        case kMsaMinorI8:
-          DecodeTypeMsaI8();
-          break;
-        case kMsaMinorI5:
-          DecodeTypeMsaI5();
-          break;
-        case kMsaMinorI10:
-          DecodeTypeMsaI10();
-          break;
-        case kMsaMinorELM:
-          DecodeTypeMsaELM();
-          break;
-        case kMsaMinorBIT:
-          DecodeTypeMsaBIT();
-          break;
-        case kMsaMinorMI10:
-          DecodeTypeMsaMI10();
-          break;
-        default:
-          UNREACHABLE();
-          break;
-      }
-      break;
-    default:
-      UNREACHABLE();
-  }
-
-  if (execute_branch_delay_instruction) {
-    // Execute branch delay slot
-    // We don't check for end_sim_pc. First it should not be met as the current
-    // pc is valid. Secondly a jump should always execute its branch delay slot.
-    Instruction* branch_delay_instr =
-        reinterpret_cast<Instruction*>(get_pc() + Instruction::kInstrSize);
-    BranchDelayInstructionDecode(branch_delay_instr);
-  }
-
-  // If needed update pc after the branch delay execution.
-  if (next_pc != bad_ra) {
-    set_pc(next_pc);
-  }
-}
-
-
-// Type 3: instructions using a 26 bytes immediate. (e.g. j, jal).
-void Simulator::DecodeTypeJump() {
-  SimInstruction simInstr = instr_;
-  // Get current pc.
-  int64_t current_pc = get_pc();
-  // Get unchanged bits of pc.
-  int64_t pc_high_bits = current_pc & 0xFFFFFFFFF0000000;
-  // Next pc.
-  int64_t next_pc = pc_high_bits | (simInstr.Imm26Value() << 2);
-
-  // Execute branch delay slot.
-  // We don't check for end_sim_pc. First it should not be met as the current pc
-  // is valid. Secondly a jump should always execute its branch delay slot.
-  Instruction* branch_delay_instr =
-      reinterpret_cast<Instruction*>(current_pc + Instruction::kInstrSize);
-  BranchDelayInstructionDecode(branch_delay_instr);
-
-  // Update pc and ra if necessary.
-  // Do this after the branch delay execution.
-  if (simInstr.IsLinkingInstruction()) {
-    set_register(31, current_pc + 2 * Instruction::kInstrSize);
-  }
-  set_pc(next_pc);
-  pc_modified_ = true;
-}
-
-
-// Executes the current instruction.
-void Simulator::InstructionDecode(Instruction* instr) {
-  if (v8::internal::FLAG_check_icache) {
-    CheckICache(isolate_->simulator_i_cache(), instr);
-  }
-  pc_modified_ = false;
-
-  v8::internal::EmbeddedVector<char, 256> buffer;
-
-  if (::v8::internal::FLAG_trace_sim) {
-    SNPrintF(trace_buf_, " ");
-    disasm::NameConverter converter;
-    disasm::Disassembler dasm(converter);
-    // Use a reasonably large buffer.
-    dasm.InstructionDecode(buffer, reinterpret_cast<byte*>(instr));
-  }
-
-  instr_ = instr;
-  switch (instr_.InstructionType()) {
-    case Instruction::kRegisterType:
-      DecodeTypeRegister();
-      break;
-    case Instruction::kImmediateType:
-      DecodeTypeImmediate();
-      break;
-    case Instruction::kJumpType:
-      DecodeTypeJump();
-      break;
-    default:
-      UNSUPPORTED();
-  }
-
-  if (::v8::internal::FLAG_trace_sim) {
-    PrintF("  0x%08" PRIxPTR "   %-44s   %s\n",
-           reinterpret_cast<intptr_t>(instr), buffer.start(),
-           trace_buf_.start());
-  }
-
-  if (!pc_modified_) {
-    set_register(pc, reinterpret_cast<int64_t>(instr) +
-                 Instruction::kInstrSize);
-  }
-}
-
-
-
-void Simulator::Execute() {
-  // Get the PC to simulate. Cannot use the accessor here as we need the
-  // raw PC value and not the one used as input to arithmetic instructions.
-  int64_t program_counter = get_pc();
-  if (::v8::internal::FLAG_stop_sim_at == 0) {
-    // Fast version of the dispatch loop without checking whether the simulator
-    // should be stopping at a particular executed instruction.
-    while (program_counter != end_sim_pc) {
-      Instruction* instr = reinterpret_cast<Instruction*>(program_counter);
-      icount_++;
-      InstructionDecode(instr);
-      program_counter = get_pc();
-    }
-  } else {
-    // FLAG_stop_sim_at is at the non-default value. Stop in the debugger when
-    // we reach the particular instruction count.
-    while (program_counter != end_sim_pc) {
-      Instruction* instr = reinterpret_cast<Instruction*>(program_counter);
-      icount_++;
-      if (icount_ == static_cast<int64_t>(::v8::internal::FLAG_stop_sim_at)) {
-        MipsDebugger dbg(this);
-        dbg.Debug();
-      } else {
-        InstructionDecode(instr);
-      }
-      program_counter = get_pc();
-    }
-  }
-}
-
-
-void Simulator::CallInternal(byte* entry) {
-  // Adjust JS-based stack limit to C-based stack limit.
-  isolate_->stack_guard()->AdjustStackLimitForSimulator();
-
-  // Prepare to execute the code at entry.
-  set_register(pc, reinterpret_cast<int64_t>(entry));
-  // Put down marker for end of simulation. The simulator will stop simulation
-  // when the PC reaches this value. By saving the "end simulation" value into
-  // the LR the simulation stops when returning to this call point.
-  set_register(ra, end_sim_pc);
-
-  // Remember the values of callee-saved registers.
-  // The code below assumes that r9 is not used as sb (static base) in
-  // simulator code and therefore is regarded as a callee-saved register.
-  int64_t s0_val = get_register(s0);
-  int64_t s1_val = get_register(s1);
-  int64_t s2_val = get_register(s2);
-  int64_t s3_val = get_register(s3);
-  int64_t s4_val = get_register(s4);
-  int64_t s5_val = get_register(s5);
-  int64_t s6_val = get_register(s6);
-  int64_t s7_val = get_register(s7);
-  int64_t gp_val = get_register(gp);
-  int64_t sp_val = get_register(sp);
-  int64_t fp_val = get_register(fp);
-
-  // Set up the callee-saved registers with a known value. To be able to check
-  // that they are preserved properly across JS execution.
-  int64_t callee_saved_value = icount_;
-  set_register(s0, callee_saved_value);
-  set_register(s1, callee_saved_value);
-  set_register(s2, callee_saved_value);
-  set_register(s3, callee_saved_value);
-  set_register(s4, callee_saved_value);
-  set_register(s5, callee_saved_value);
-  set_register(s6, callee_saved_value);
-  set_register(s7, callee_saved_value);
-  set_register(gp, callee_saved_value);
-  set_register(fp, callee_saved_value);
-
-  // Start the simulation.
-  Execute();
-
-  // Check that the callee-saved registers have been preserved.
-  CHECK_EQ(callee_saved_value, get_register(s0));
-  CHECK_EQ(callee_saved_value, get_register(s1));
-  CHECK_EQ(callee_saved_value, get_register(s2));
-  CHECK_EQ(callee_saved_value, get_register(s3));
-  CHECK_EQ(callee_saved_value, get_register(s4));
-  CHECK_EQ(callee_saved_value, get_register(s5));
-  CHECK_EQ(callee_saved_value, get_register(s6));
-  CHECK_EQ(callee_saved_value, get_register(s7));
-  CHECK_EQ(callee_saved_value, get_register(gp));
-  CHECK_EQ(callee_saved_value, get_register(fp));
-
-  // Restore callee-saved registers with the original value.
-  set_register(s0, s0_val);
-  set_register(s1, s1_val);
-  set_register(s2, s2_val);
-  set_register(s3, s3_val);
-  set_register(s4, s4_val);
-  set_register(s5, s5_val);
-  set_register(s6, s6_val);
-  set_register(s7, s7_val);
-  set_register(gp, gp_val);
-  set_register(sp, sp_val);
-  set_register(fp, fp_val);
-}
-
-intptr_t Simulator::CallImpl(byte* entry, int argument_count,
-                             const intptr_t* arguments) {
-  constexpr int kRegisterPassedArguments = 8;
-  // Set up arguments.
-
-  // First four arguments passed in registers in both ABI's.
-  int reg_arg_count = std::min(kRegisterPassedArguments, argument_count);
-  if (reg_arg_count > 0) set_register(a0, arguments[0]);
-  if (reg_arg_count > 1) set_register(a1, arguments[1]);
-  if (reg_arg_count > 2) set_register(a2, arguments[2]);
-  if (reg_arg_count > 2) set_register(a3, arguments[3]);
-
-  // Up to eight arguments passed in registers in N64 ABI.
-  // TODO(plind): N64 ABI calls these regs a4 - a7. Clarify this.
-  if (reg_arg_count > 4) set_register(a4, arguments[4]);
-  if (reg_arg_count > 5) set_register(a5, arguments[5]);
-  if (reg_arg_count > 6) set_register(a6, arguments[6]);
-  if (reg_arg_count > 7) set_register(a7, arguments[7]);
-
-  // Remaining arguments passed on stack.
-  int64_t original_stack = get_register(sp);
-  // Compute position of stack on entry to generated code.
-  int stack_args_count = argument_count - reg_arg_count;
-  int stack_args_size = stack_args_count * sizeof(*arguments) + kCArgsSlotsSize;
-  int64_t entry_stack = original_stack - stack_args_size;
-
-  if (base::OS::ActivationFrameAlignment() != 0) {
-    entry_stack &= -base::OS::ActivationFrameAlignment();
-  }
-  // Store remaining arguments on stack, from low to high memory.
-  intptr_t* stack_argument = reinterpret_cast<intptr_t*>(entry_stack);
-  memcpy(stack_argument + kCArgSlotCount, arguments + reg_arg_count,
-         stack_args_count * sizeof(*arguments));
-  set_register(sp, entry_stack);
-
-  CallInternal(entry);
-
-  // Pop stack passed arguments.
-  CHECK_EQ(entry_stack, get_register(sp));
-  set_register(sp, original_stack);
-
-  return get_register(v0);
-}
-
-
-double Simulator::CallFP(byte* entry, double d0, double d1) {
-  if (!IsMipsSoftFloatABI) {
-    const FPURegister fparg2 = f13;
-    set_fpu_register_double(f12, d0);
-    set_fpu_register_double(fparg2, d1);
-  } else {
-    int buffer[2];
-    DCHECK(sizeof(buffer[0]) * 2 == sizeof(d0));
-    memcpy(buffer, &d0, sizeof(d0));
-    set_dw_register(a0, buffer);
-    memcpy(buffer, &d1, sizeof(d1));
-    set_dw_register(a2, buffer);
-  }
-  CallInternal(entry);
-  if (!IsMipsSoftFloatABI) {
-    return get_fpu_register_double(f0);
-  } else {
-    return get_double_from_register_pair(v0);
-  }
-}
-
-
-uintptr_t Simulator::PushAddress(uintptr_t address) {
-  int64_t new_sp = get_register(sp) - sizeof(uintptr_t);
-  uintptr_t* stack_slot = reinterpret_cast<uintptr_t*>(new_sp);
-  *stack_slot = address;
-  set_register(sp, new_sp);
-  return new_sp;
-}
-
-
-uintptr_t Simulator::PopAddress() {
-  int64_t current_sp = get_register(sp);
-  uintptr_t* stack_slot = reinterpret_cast<uintptr_t*>(current_sp);
-  uintptr_t address = *stack_slot;
-  set_register(sp, current_sp + sizeof(uintptr_t));
-  return address;
-}
-
-
-#undef UNSUPPORTED
-}  // namespace internal
-}  // namespace v8
-
-#endif  // USE_SIMULATOR
-
-#endif  // V8_TARGET_ARCH_MIPS64
diff --git a/src/v8/src/mips64/simulator-mips64.h b/src/v8/src/mips64/simulator-mips64.h
deleted file mode 100644
index c429223..0000000
--- a/src/v8/src/mips64/simulator-mips64.h
+++ /dev/null
@@ -1,589 +0,0 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Declares a Simulator for MIPS instructions if we are not generating a native
-// MIPS binary. This Simulator allows us to run and debug MIPS code generation
-// on regular desktop machines.
-// V8 calls into generated code via the GeneratedCode wrapper,
-// which will start execution in the Simulator or forwards to the real entry
-// on a MIPS HW platform.
-
-#ifndef V8_MIPS_SIMULATOR_MIPS_H_
-#define V8_MIPS_SIMULATOR_MIPS_H_
-
-#include "src/allocation.h"
-#include "src/mips64/constants-mips64.h"
-
-#if defined(USE_SIMULATOR)
-// Running with a simulator.
-
-#include "src/assembler.h"
-#include "src/base/hashmap.h"
-#include "src/simulator-base.h"
-
-namespace v8 {
-namespace internal {
-
-// -----------------------------------------------------------------------------
-// Utility functions
-
-class CachePage {
- public:
-  static const int LINE_VALID = 0;
-  static const int LINE_INVALID = 1;
-
-  static const int kPageShift = 12;
-  static const int kPageSize = 1 << kPageShift;
-  static const int kPageMask = kPageSize - 1;
-  static const int kLineShift = 2;  // The cache line is only 4 bytes right now.
-  static const int kLineLength = 1 << kLineShift;
-  static const int kLineMask = kLineLength - 1;
-
-  CachePage() {
-    memset(&validity_map_, LINE_INVALID, sizeof(validity_map_));
-  }
-
-  char* ValidityByte(int offset) {
-    return &validity_map_[offset >> kLineShift];
-  }
-
-  char* CachedData(int offset) {
-    return &data_[offset];
-  }
-
- private:
-  char data_[kPageSize];   // The cached data.
-  static const int kValidityMapSize = kPageSize >> kLineShift;
-  char validity_map_[kValidityMapSize];  // One byte per line.
-};
-
-class SimInstructionBase : public InstructionBase {
- public:
-  Type InstructionType() const { return type_; }
-  inline Instruction* instr() const { return instr_; }
-  inline int32_t operand() const { return operand_; }
-
- protected:
-  SimInstructionBase() : operand_(-1), instr_(nullptr), type_(kUnsupported) {}
-  explicit SimInstructionBase(Instruction* instr) {}
-
-  int32_t operand_;
-  Instruction* instr_;
-  Type type_;
-
- private:
-  DISALLOW_ASSIGN(SimInstructionBase);
-};
-
-class SimInstruction : public InstructionGetters<SimInstructionBase> {
- public:
-  SimInstruction() {}
-
-  explicit SimInstruction(Instruction* instr) { *this = instr; }
-
-  SimInstruction& operator=(Instruction* instr) {
-    operand_ = *reinterpret_cast<const int32_t*>(instr);
-    instr_ = instr;
-    type_ = InstructionBase::InstructionType();
-    DCHECK(reinterpret_cast<void*>(&operand_) == this);
-    return *this;
-  }
-};
-
-class Simulator : public SimulatorBase {
- public:
-  friend class MipsDebugger;
-
-  // Registers are declared in order. See SMRL chapter 2.
-  enum Register {
-    no_reg = -1,
-    zero_reg = 0,
-    at,
-    v0, v1,
-    a0, a1, a2, a3, a4, a5, a6, a7,
-    t0, t1, t2, t3,
-    s0, s1, s2, s3, s4, s5, s6, s7,
-    t8, t9,
-    k0, k1,
-    gp,
-    sp,
-    s8,
-    ra,
-    // LO, HI, and pc.
-    LO,
-    HI,
-    pc,   // pc must be the last register.
-    kNumSimuRegisters,
-    // aliases
-    fp = s8
-  };
-
-  // Coprocessor registers.
-  // Generated code will always use doubles. So we will only use even registers.
-  enum FPURegister {
-    f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11,
-    f12, f13, f14, f15,   // f12 and f14 are arguments FPURegisters.
-    f16, f17, f18, f19, f20, f21, f22, f23, f24, f25,
-    f26, f27, f28, f29, f30, f31,
-    kNumFPURegisters
-  };
-
-  // MSA registers
-  enum MSARegister {
-    w0,
-    w1,
-    w2,
-    w3,
-    w4,
-    w5,
-    w6,
-    w7,
-    w8,
-    w9,
-    w10,
-    w11,
-    w12,
-    w13,
-    w14,
-    w15,
-    w16,
-    w17,
-    w18,
-    w19,
-    w20,
-    w21,
-    w22,
-    w23,
-    w24,
-    w25,
-    w26,
-    w27,
-    w28,
-    w29,
-    w30,
-    w31,
-    kNumMSARegisters
-  };
-
-  explicit Simulator(Isolate* isolate);
-  ~Simulator();
-
-  // The currently executing Simulator instance. Potentially there can be one
-  // for each native thread.
-  V8_EXPORT_PRIVATE static Simulator* current(v8::internal::Isolate* isolate);
-
-  // Accessors for register state. Reading the pc value adheres to the MIPS
-  // architecture specification and is off by a 8 from the currently executing
-  // instruction.
-  void set_register(int reg, int64_t value);
-  void set_register_word(int reg, int32_t value);
-  void set_dw_register(int dreg, const int* dbl);
-  int64_t get_register(int reg) const;
-  double get_double_from_register_pair(int reg);
-  // Same for FPURegisters.
-  void set_fpu_register(int fpureg, int64_t value);
-  void set_fpu_register_word(int fpureg, int32_t value);
-  void set_fpu_register_hi_word(int fpureg, int32_t value);
-  void set_fpu_register_float(int fpureg, float value);
-  void set_fpu_register_double(int fpureg, double value);
-  void set_fpu_register_invalid_result64(float original, float rounded);
-  void set_fpu_register_invalid_result(float original, float rounded);
-  void set_fpu_register_word_invalid_result(float original, float rounded);
-  void set_fpu_register_invalid_result64(double original, double rounded);
-  void set_fpu_register_invalid_result(double original, double rounded);
-  void set_fpu_register_word_invalid_result(double original, double rounded);
-  int64_t get_fpu_register(int fpureg) const;
-  int32_t get_fpu_register_word(int fpureg) const;
-  int32_t get_fpu_register_signed_word(int fpureg) const;
-  int32_t get_fpu_register_hi_word(int fpureg) const;
-  float get_fpu_register_float(int fpureg) const;
-  double get_fpu_register_double(int fpureg) const;
-  template <typename T>
-  void get_msa_register(int wreg, T* value);
-  template <typename T>
-  void set_msa_register(int wreg, const T* value);
-  void set_fcsr_bit(uint32_t cc, bool value);
-  bool test_fcsr_bit(uint32_t cc);
-  bool set_fcsr_round_error(double original, double rounded);
-  bool set_fcsr_round64_error(double original, double rounded);
-  bool set_fcsr_round_error(float original, float rounded);
-  bool set_fcsr_round64_error(float original, float rounded);
-  void round_according_to_fcsr(double toRound, double& rounded,
-                               int32_t& rounded_int, double fs);
-  void round64_according_to_fcsr(double toRound, double& rounded,
-                                 int64_t& rounded_int, double fs);
-  void round_according_to_fcsr(float toRound, float& rounded,
-                               int32_t& rounded_int, float fs);
-  void round64_according_to_fcsr(float toRound, float& rounded,
-                                 int64_t& rounded_int, float fs);
-  template <typename T_fp, typename T_int>
-  void round_according_to_msacsr(T_fp toRound, T_fp& rounded,
-                                 T_int& rounded_int);
-  void set_fcsr_rounding_mode(FPURoundingMode mode);
-  void set_msacsr_rounding_mode(FPURoundingMode mode);
-  unsigned int get_fcsr_rounding_mode();
-  unsigned int get_msacsr_rounding_mode();
-  // Special case of set_register and get_register to access the raw PC value.
-  void set_pc(int64_t value);
-  int64_t get_pc() const;
-
-  Address get_sp() const {
-    return reinterpret_cast<Address>(static_cast<intptr_t>(get_register(sp)));
-  }
-
-  // Accessor to the internal simulator stack area.
-  uintptr_t StackLimit(uintptr_t c_limit) const;
-
-  // Executes MIPS instructions until the PC reaches end_sim_pc.
-  void Execute();
-
-  template <typename Return, typename... Args>
-  Return Call(byte* entry, Args... args) {
-    return VariadicCall<Return>(this, &Simulator::CallImpl, entry, args...);
-  }
-
-  // Alternative: call a 2-argument double function.
-  double CallFP(byte* entry, double d0, double d1);
-
-  // Push an address onto the JS stack.
-  uintptr_t PushAddress(uintptr_t address);
-
-  // Pop an address from the JS stack.
-  uintptr_t PopAddress();
-
-  // Debugger input.
-  void set_last_debugger_input(char* input);
-  char* last_debugger_input() { return last_debugger_input_; }
-
-  // Redirection support.
-  static void SetRedirectInstruction(Instruction* instruction);
-
-  // ICache checking.
-  static void FlushICache(base::CustomMatcherHashMap* i_cache, void* start,
-                          size_t size);
-
-  // Returns true if pc register contains one of the 'special_values' defined
-  // below (bad_ra, end_sim_pc).
-  bool has_bad_pc() const;
-
- private:
-  enum special_values {
-    // Known bad pc value to ensure that the simulator does not execute
-    // without being properly setup.
-    bad_ra = -1,
-    // A pc value used to signal the simulator to stop execution.  Generally
-    // the ra is set to this value on transition from native C code to
-    // simulated execution, so that the simulator can "return" to the native
-    // C code.
-    end_sim_pc = -2,
-    // Unpredictable value.
-    Unpredictable = 0xbadbeaf
-  };
-
-  V8_EXPORT_PRIVATE intptr_t CallImpl(byte* entry, int argument_count,
-                                      const intptr_t* arguments);
-
-  // Unsupported instructions use Format to print an error and stop execution.
-  void Format(Instruction* instr, const char* format);
-
-  // Helpers for data value tracing.
-  enum TraceType {
-    BYTE,
-    HALF,
-    WORD,
-    DWORD,
-    FLOAT,
-    DOUBLE,
-    FLOAT_DOUBLE,
-    WORD_DWORD
-  };
-
-  // MSA Data Format
-  enum MSADataFormat { MSA_VECT = 0, MSA_BYTE, MSA_HALF, MSA_WORD, MSA_DWORD };
-  typedef union {
-    int8_t b[kMSALanesByte];
-    uint8_t ub[kMSALanesByte];
-    int16_t h[kMSALanesHalf];
-    uint16_t uh[kMSALanesHalf];
-    int32_t w[kMSALanesWord];
-    uint32_t uw[kMSALanesWord];
-    int64_t d[kMSALanesDword];
-    uint64_t ud[kMSALanesDword];
-  } msa_reg_t;
-
-  // Read and write memory.
-  inline uint32_t ReadBU(int64_t addr);
-  inline int32_t ReadB(int64_t addr);
-  inline void WriteB(int64_t addr, uint8_t value);
-  inline void WriteB(int64_t addr, int8_t value);
-
-  inline uint16_t ReadHU(int64_t addr, Instruction* instr);
-  inline int16_t ReadH(int64_t addr, Instruction* instr);
-  // Note: Overloaded on the sign of the value.
-  inline void WriteH(int64_t addr, uint16_t value, Instruction* instr);
-  inline void WriteH(int64_t addr, int16_t value, Instruction* instr);
-
-  inline uint32_t ReadWU(int64_t addr, Instruction* instr);
-  inline int32_t ReadW(int64_t addr, Instruction* instr, TraceType t = WORD);
-  inline void WriteW(int64_t addr, int32_t value, Instruction* instr);
-  inline int64_t Read2W(int64_t addr, Instruction* instr);
-  inline void Write2W(int64_t addr, int64_t value, Instruction* instr);
-
-  inline double ReadD(int64_t addr, Instruction* instr);
-  inline void WriteD(int64_t addr, double value, Instruction* instr);
-
-  template <typename T>
-  T ReadMem(int64_t addr, Instruction* instr);
-  template <typename T>
-  void WriteMem(int64_t addr, T value, Instruction* instr);
-
-  // Helper for debugging memory access.
-  inline void DieOrDebug();
-
-  void TraceRegWr(int64_t value, TraceType t = DWORD);
-  template <typename T>
-  void TraceMSARegWr(T* value, TraceType t);
-  template <typename T>
-  void TraceMSARegWr(T* value);
-  void TraceMemWr(int64_t addr, int64_t value, TraceType t);
-  void TraceMemRd(int64_t addr, int64_t value, TraceType t = DWORD);
-  template <typename T>
-  void TraceMemRd(int64_t addr, T value);
-  template <typename T>
-  void TraceMemWr(int64_t addr, T value);
-
-  // Operations depending on endianness.
-  // Get Double Higher / Lower word.
-  inline int32_t GetDoubleHIW(double* addr);
-  inline int32_t GetDoubleLOW(double* addr);
-  // Set Double Higher / Lower word.
-  inline int32_t SetDoubleHIW(double* addr);
-  inline int32_t SetDoubleLOW(double* addr);
-
-  SimInstruction instr_;
-
-  // functions called from DecodeTypeRegister.
-  void DecodeTypeRegisterCOP1();
-
-  void DecodeTypeRegisterCOP1X();
-
-  void DecodeTypeRegisterSPECIAL();
-
-
-  void DecodeTypeRegisterSPECIAL2();
-
-  void DecodeTypeRegisterSPECIAL3();
-
-  void DecodeTypeRegisterSRsType();
-
-  void DecodeTypeRegisterDRsType();
-
-  void DecodeTypeRegisterWRsType();
-
-  void DecodeTypeRegisterLRsType();
-
-  int DecodeMsaDataFormat();
-  void DecodeTypeMsaI8();
-  void DecodeTypeMsaI5();
-  void DecodeTypeMsaI10();
-  void DecodeTypeMsaELM();
-  void DecodeTypeMsaBIT();
-  void DecodeTypeMsaMI10();
-  void DecodeTypeMsa3R();
-  void DecodeTypeMsa3RF();
-  void DecodeTypeMsaVec();
-  void DecodeTypeMsa2R();
-  void DecodeTypeMsa2RF();
-  template <typename T>
-  T MsaI5InstrHelper(uint32_t opcode, T ws, int32_t i5);
-  template <typename T>
-  T MsaBitInstrHelper(uint32_t opcode, T wd, T ws, int32_t m);
-  template <typename T>
-  T Msa3RInstrHelper(uint32_t opcode, T wd, T ws, T wt);
-
-  // Executing is handled based on the instruction type.
-  void DecodeTypeRegister();
-
-  inline int32_t rs_reg() const { return instr_.RsValue(); }
-  inline int64_t rs() const { return get_register(rs_reg()); }
-  inline uint64_t rs_u() const {
-    return static_cast<uint64_t>(get_register(rs_reg()));
-  }
-  inline int32_t rt_reg() const { return instr_.RtValue(); }
-  inline int64_t rt() const { return get_register(rt_reg()); }
-  inline uint64_t rt_u() const {
-    return static_cast<uint64_t>(get_register(rt_reg()));
-  }
-  inline int32_t rd_reg() const { return instr_.RdValue(); }
-  inline int32_t fr_reg() const { return instr_.FrValue(); }
-  inline int32_t fs_reg() const { return instr_.FsValue(); }
-  inline int32_t ft_reg() const { return instr_.FtValue(); }
-  inline int32_t fd_reg() const { return instr_.FdValue(); }
-  inline int32_t sa() const { return instr_.SaValue(); }
-  inline int32_t lsa_sa() const { return instr_.LsaSaValue(); }
-  inline int32_t ws_reg() const { return instr_.WsValue(); }
-  inline int32_t wt_reg() const { return instr_.WtValue(); }
-  inline int32_t wd_reg() const { return instr_.WdValue(); }
-
-  inline void SetResult(const int32_t rd_reg, const int64_t alu_out) {
-    set_register(rd_reg, alu_out);
-    TraceRegWr(alu_out);
-  }
-
-  inline void SetFPUWordResult(int32_t fd_reg, int32_t alu_out) {
-    set_fpu_register_word(fd_reg, alu_out);
-    TraceRegWr(get_fpu_register(fd_reg), WORD);
-  }
-
-  inline void SetFPUWordResult2(int32_t fd_reg, int32_t alu_out) {
-    set_fpu_register_word(fd_reg, alu_out);
-    TraceRegWr(get_fpu_register(fd_reg));
-  }
-
-  inline void SetFPUResult(int32_t fd_reg, int64_t alu_out) {
-    set_fpu_register(fd_reg, alu_out);
-    TraceRegWr(get_fpu_register(fd_reg));
-  }
-
-  inline void SetFPUResult2(int32_t fd_reg, int64_t alu_out) {
-    set_fpu_register(fd_reg, alu_out);
-    TraceRegWr(get_fpu_register(fd_reg), DOUBLE);
-  }
-
-  inline void SetFPUFloatResult(int32_t fd_reg, float alu_out) {
-    set_fpu_register_float(fd_reg, alu_out);
-    TraceRegWr(get_fpu_register(fd_reg), FLOAT);
-  }
-
-  inline void SetFPUDoubleResult(int32_t fd_reg, double alu_out) {
-    set_fpu_register_double(fd_reg, alu_out);
-    TraceRegWr(get_fpu_register(fd_reg), DOUBLE);
-  }
-
-  void DecodeTypeImmediate();
-  void DecodeTypeJump();
-
-  // Used for breakpoints and traps.
-  void SoftwareInterrupt();
-
-  // Compact branch guard.
-  void CheckForbiddenSlot(int64_t current_pc) {
-    Instruction* instr_after_compact_branch =
-        reinterpret_cast<Instruction*>(current_pc + Instruction::kInstrSize);
-    if (instr_after_compact_branch->IsForbiddenAfterBranch()) {
-      V8_Fatal(__FILE__, __LINE__,
-               "Error: Unexpected instruction 0x%08x immediately after a "
-               "compact branch instruction.",
-               *reinterpret_cast<uint32_t*>(instr_after_compact_branch));
-    }
-  }
-
-  // Stop helper functions.
-  bool IsWatchpoint(uint64_t code);
-  void PrintWatchpoint(uint64_t code);
-  void HandleStop(uint64_t code, Instruction* instr);
-  bool IsStopInstruction(Instruction* instr);
-  bool IsEnabledStop(uint64_t code);
-  void EnableStop(uint64_t code);
-  void DisableStop(uint64_t code);
-  void IncreaseStopCounter(uint64_t code);
-  void PrintStopInfo(uint64_t code);
-
-
-  // Executes one instruction.
-  void InstructionDecode(Instruction* instr);
-  // Execute one instruction placed in a branch delay slot.
-  void BranchDelayInstructionDecode(Instruction* instr) {
-    if (instr->InstructionBits() == nopInstr) {
-      // Short-cut generic nop instructions. They are always valid and they
-      // never change the simulator state.
-      return;
-    }
-
-    if (instr->IsForbiddenAfterBranch()) {
-      V8_Fatal(__FILE__, __LINE__,
-               "Eror:Unexpected %i opcode in a branch delay slot.",
-               instr->OpcodeValue());
-    }
-    InstructionDecode(instr);
-    SNPrintF(trace_buf_, " ");
-  }
-
-  // ICache.
-  static void CheckICache(base::CustomMatcherHashMap* i_cache,
-                          Instruction* instr);
-  static void FlushOnePage(base::CustomMatcherHashMap* i_cache, intptr_t start,
-                           size_t size);
-  static CachePage* GetCachePage(base::CustomMatcherHashMap* i_cache,
-                                 void* page);
-
-  enum Exception {
-    none,
-    kIntegerOverflow,
-    kIntegerUnderflow,
-    kDivideByZero,
-    kNumExceptions
-  };
-
-  // Exceptions.
-  void SignalException(Exception e);
-
-  // Handle arguments and return value for runtime FP functions.
-  void GetFpArgs(double* x, double* y, int32_t* z);
-  void SetFpResult(const double& result);
-
-  void CallInternal(byte* entry);
-
-  // Architecture state.
-  // Registers.
-  int64_t registers_[kNumSimuRegisters];
-  // Coprocessor Registers.
-  // Note: FPUregisters_[] array is increased to 64 * 8B = 32 * 16B in
-  // order to support MSA registers
-  int64_t FPUregisters_[kNumFPURegisters * 2];
-  // FPU control register.
-  uint32_t FCSR_;
-  // MSA control register.
-  uint32_t MSACSR_;
-
-  // Simulator support.
-  // Allocate 1MB for stack.
-  size_t stack_size_;
-  char* stack_;
-  bool pc_modified_;
-  int64_t icount_;
-  int break_count_;
-  EmbeddedVector<char, 128> trace_buf_;
-
-  // Debugger input.
-  char* last_debugger_input_;
-
-  // Icache simulation.
-  base::CustomMatcherHashMap* i_cache_;
-
-  v8::internal::Isolate* isolate_;
-
-  // Registered breakpoints.
-  Instruction* break_pc_;
-  Instr break_instr_;
-
-  // Stop is disabled if bit 31 is set.
-  static const uint32_t kStopDisabledBit = 1 << 31;
-
-  // A stop is enabled, meaning the simulator will stop when meeting the
-  // instruction, if bit 31 of watched_stops_[code].count is unset.
-  // The value watched_stops_[code].count & ~(1 << 31) indicates how many times
-  // the breakpoint was hit or gone through.
-  struct StopCountAndDesc {
-    uint32_t count;
-    char* desc;
-  };
-  StopCountAndDesc watched_stops_[kMaxStopCode + 1];
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // defined(USE_SIMULATOR)
-#endif  // V8_MIPS_SIMULATOR_MIPS_H_
diff --git a/src/v8/src/parsing/background-parsing-task.cc b/src/v8/src/parsing/background-parsing-task.cc
deleted file mode 100644
index cb81156..0000000
--- a/src/v8/src/parsing/background-parsing-task.cc
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/parsing/background-parsing-task.h"
-
-#include "src/counters.h"
-#include "src/objects-inl.h"
-#include "src/parsing/parser.h"
-#include "src/parsing/scanner-character-streams.h"
-#include "src/vm-state-inl.h"
-
-namespace v8 {
-namespace internal {
-
-void StreamedSource::Release() {
-  parser.reset();
-  info.reset();
-}
-
-BackgroundParsingTask::BackgroundParsingTask(
-    StreamedSource* source, ScriptCompiler::CompileOptions options,
-    int stack_size, Isolate* isolate)
-    : source_(source),
-      stack_size_(stack_size),
-      script_data_(nullptr),
-      timer_(isolate->counters()->compile_script_on_background()) {
-  // We don't set the context to the CompilationInfo yet, because the background
-  // thread cannot do anything with it anyway. We set it just before compilation
-  // on the foreground thread.
-  DCHECK(options == ScriptCompiler::kProduceParserCache ||
-         options == ScriptCompiler::kProduceCodeCache ||
-         options == ScriptCompiler::kProduceFullCodeCache ||
-         options == ScriptCompiler::kNoCompileOptions ||
-         options == ScriptCompiler::kEagerCompile);
-
-  VMState<PARSER> state(isolate);
-
-  // Prepare the data for the internalization phase and compilation phase, which
-  // will happen in the main thread after parsing.
-  ParseInfo* info = new ParseInfo(isolate->allocator());
-  info->InitFromIsolate(isolate);
-  if (V8_UNLIKELY(FLAG_runtime_stats)) {
-    info->set_runtime_call_stats(new (info->zone()) RuntimeCallStats());
-  } else {
-    info->set_runtime_call_stats(nullptr);
-  }
-  info->set_toplevel();
-  std::unique_ptr<Utf16CharacterStream> stream(
-      ScannerStream::For(source->source_stream.get(), source->encoding,
-                         info->runtime_call_stats()));
-  info->set_character_stream(std::move(stream));
-  info->set_unicode_cache(&source_->unicode_cache);
-  info->set_compile_options(options);
-  info->set_allow_lazy_parsing();
-  if (V8_UNLIKELY(info->block_coverage_enabled())) {
-    info->AllocateSourceRangeMap();
-  }
-  info->set_cached_data(&script_data_);
-  LanguageMode language_mode = construct_language_mode(FLAG_use_strict);
-  info->set_language_mode(
-      stricter_language_mode(info->language_mode(), language_mode));
-
-  source->info.reset(info);
-  allocator_ = isolate->allocator();
-
-  // Parser needs to stay alive for finalizing the parsing on the main
-  // thread.
-  source_->parser.reset(new Parser(source_->info.get()));
-  source_->parser->DeserializeScopeChain(source_->info.get(),
-                                         MaybeHandle<ScopeInfo>());
-}
-
-void BackgroundParsingTask::Run() {
-  TimedHistogramScope timer(timer_);
-  DisallowHeapAllocation no_allocation;
-  DisallowHandleAllocation no_handles;
-  DisallowHandleDereference no_deref;
-
-  source_->info->set_on_background_thread(true);
-
-  // Reset the stack limit of the parser to reflect correctly that we're on a
-  // background thread.
-  uintptr_t old_stack_limit = source_->info->stack_limit();
-  uintptr_t stack_limit = GetCurrentStackPosition() - stack_size_ * KB;
-  source_->info->set_stack_limit(stack_limit);
-  source_->parser->set_stack_limit(stack_limit);
-
-  source_->parser->ParseOnBackground(source_->info.get());
-  if (FLAG_background_compile && source_->info->literal() != nullptr) {
-    // Parsing has succeeded, compile.
-    source_->outer_function_job = Compiler::CompileTopLevelOnBackgroundThread(
-        source_->info.get(), allocator_, &source_->inner_function_jobs);
-  }
-
-  if (script_data_ != nullptr) {
-    source_->cached_data.reset(new ScriptCompiler::CachedData(
-        script_data_->data(), script_data_->length(),
-        ScriptCompiler::CachedData::BufferOwned));
-    script_data_->ReleaseDataOwnership();
-    delete script_data_;
-    script_data_ = nullptr;
-  }
-
-  source_->info->EmitBackgroundParseStatisticsOnBackgroundThread();
-
-  source_->info->set_on_background_thread(false);
-  source_->info->set_stack_limit(old_stack_limit);
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/parsing/background-parsing-task.h b/src/v8/src/parsing/background-parsing-task.h
deleted file mode 100644
index eb3ed61..0000000
--- a/src/v8/src/parsing/background-parsing-task.h
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_PARSING_BACKGROUND_PARSING_TASK_H_
-#define V8_PARSING_BACKGROUND_PARSING_TASK_H_
-
-#include <memory>
-
-#include "include/v8.h"
-#include "src/base/platform/platform.h"
-#include "src/base/platform/semaphore.h"
-#include "src/compiler.h"
-#include "src/parsing/parse-info.h"
-#include "src/unicode-cache.h"
-
-namespace v8 {
-namespace internal {
-
-class Parser;
-class ScriptData;
-class TimedHistogram;
-
-// Internal representation of v8::ScriptCompiler::StreamedSource. Contains all
-// data which needs to be transmitted between threads for background parsing,
-// finalizing it on the main thread, and compiling on the main thread.
-struct StreamedSource {
-  StreamedSource(ScriptCompiler::ExternalSourceStream* source_stream,
-                 ScriptCompiler::StreamedSource::Encoding encoding)
-      : source_stream(source_stream), encoding(encoding) {}
-
-  void Release();
-
-  // Internal implementation of v8::ScriptCompiler::StreamedSource.
-  std::unique_ptr<ScriptCompiler::ExternalSourceStream> source_stream;
-  ScriptCompiler::StreamedSource::Encoding encoding;
-  std::unique_ptr<ScriptCompiler::CachedData> cached_data;
-
-  // Data needed for parsing, and data needed to to be passed between thread
-  // between parsing and compilation. These need to be initialized before the
-  // compilation starts.
-  UnicodeCache unicode_cache;
-  std::unique_ptr<ParseInfo> info;
-  std::unique_ptr<Parser> parser;
-
-  // Data needed for finalizing compilation after background compilation.
-  std::unique_ptr<CompilationJob> outer_function_job;
-  CompilationJobList inner_function_jobs;
-
-  // Prevent copying.
-  StreamedSource(const StreamedSource&) = delete;
-  StreamedSource& operator=(const StreamedSource&) = delete;
-};
-
-class BackgroundParsingTask : public ScriptCompiler::ScriptStreamingTask {
- public:
-  BackgroundParsingTask(StreamedSource* source,
-                        ScriptCompiler::CompileOptions options, int stack_size,
-                        Isolate* isolate);
-
-  virtual void Run();
-
- private:
-  StreamedSource* source_;  // Not owned.
-  int stack_size_;
-  ScriptData* script_data_;
-  AccountingAllocator* allocator_;
-  TimedHistogram* timer_;
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_PARSING_BACKGROUND_PARSING_TASK_H_
diff --git a/src/v8/src/parsing/duplicate-finder.h b/src/v8/src/parsing/duplicate-finder.h
deleted file mode 100644
index a4981c1..0000000
--- a/src/v8/src/parsing/duplicate-finder.h
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_PARSING_DUPLICATE_FINDER_H_
-#define V8_PARSING_DUPLICATE_FINDER_H_
-
-#include <set>
-
-namespace v8 {
-namespace internal {
-
-class Scanner;
-
-// DuplicateFinder : Helper class to discover duplicate symbols.
-//
-// Allocate a DuplicateFinder for each set of symbols you want to check
-// for duplicates and then pass this instance into
-// Scanner::IsDuplicateSymbol(..).
-//
-// This class only holds the data; all actual logic is in
-// Scanner::IsDuplicateSymbol.
-class DuplicateFinder {
- public:
-  DuplicateFinder() {}
-
- private:
-  friend class Scanner;
-
-  std::set<const void*> known_symbols_;
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_PARSING_DUPLICATE_FINDER_H_
diff --git a/src/v8/src/parsing/expression-classifier.h b/src/v8/src/parsing/expression-classifier.h
deleted file mode 100644
index 709d573..0000000
--- a/src/v8/src/parsing/expression-classifier.h
+++ /dev/null
@@ -1,436 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_PARSING_EXPRESSION_CLASSIFIER_H
-#define V8_PARSING_EXPRESSION_CLASSIFIER_H
-
-#include "src/messages.h"
-#include "src/parsing/scanner.h"
-
-namespace v8 {
-namespace internal {
-
-class DuplicateFinder;
-
-#define ERROR_CODES(T)                       \
-  T(ExpressionProduction, 0)                 \
-  T(FormalParameterInitializerProduction, 1) \
-  T(BindingPatternProduction, 2)             \
-  T(AssignmentPatternProduction, 3)          \
-  T(DistinctFormalParametersProduction, 4)   \
-  T(StrictModeFormalParametersProduction, 5) \
-  T(ArrowFormalParametersProduction, 6)      \
-  T(LetPatternProduction, 7)                 \
-  T(AsyncArrowFormalParametersProduction, 8)
-
-// Expression classifiers serve two purposes:
-//
-// 1) They keep track of error messages that are pending (and other
-//    related information), waiting for the parser to decide whether
-//    the parsed expression is a pattern or not.
-// 2) They keep track of expressions that may need to be rewritten, if
-//    the parser decides that they are not patterns.  (A different
-//    mechanism implements the rewriting of patterns.)
-//
-// Expression classifiers are used by the parser in a stack fashion.
-// Each new classifier is pushed on top of the stack.  This happens
-// automatically by the class's constructor.  While on top of the
-// stack, the classifier records pending error messages and tracks the
-// pending non-patterns of the expression that is being parsed.
-//
-// At the end of its life, a classifier is either "accumulated" to the
-// one that is below it on the stack, or is "discarded".  The former
-// is achieved by calling the method Accumulate.  The latter is
-// achieved automatically by the destructor, but it can happen earlier
-// by calling the method Discard.  Both actions result in removing the
-// classifier from the parser's stack.
-
-template <typename Types>
-class ExpressionClassifier {
- public:
-  enum ErrorKind : unsigned {
-#define DEFINE_ERROR_KIND(NAME, CODE) k##NAME = CODE,
-    ERROR_CODES(DEFINE_ERROR_KIND)
-#undef DEFINE_ERROR_KIND
-    kUnusedError = 15  // Larger than error codes; should fit in 4 bits
-  };
-
-  struct Error {
-    V8_INLINE Error()
-        : location(Scanner::Location::invalid()),
-          message(MessageTemplate::kNone),
-          kind(kUnusedError),
-          type(kSyntaxError),
-          arg(nullptr) {}
-    V8_INLINE explicit Error(Scanner::Location loc,
-                             MessageTemplate::Template msg, ErrorKind k,
-                             const char* a = nullptr,
-                             ParseErrorType t = kSyntaxError)
-        : location(loc), message(msg), kind(k), type(t), arg(a) {}
-
-    Scanner::Location location;
-    MessageTemplate::Template message : 26;
-    unsigned kind : 4;
-    ParseErrorType type : 2;
-    const char* arg;
-  };
-
-  // clang-format off
-  enum TargetProduction : unsigned {
-#define DEFINE_PRODUCTION(NAME, CODE) NAME = 1 << CODE,
-    ERROR_CODES(DEFINE_PRODUCTION)
-#undef DEFINE_PRODUCTION
-
-#define DEFINE_ALL_PRODUCTIONS(NAME, CODE) NAME |
-    AllProductions = ERROR_CODES(DEFINE_ALL_PRODUCTIONS) /* | */ 0
-#undef DEFINE_ALL_PRODUCTIONS
-  };
-  // clang-format on
-
-  enum FunctionProperties : unsigned {
-    NonSimpleParameter = 1 << 0
-  };
-
-  explicit ExpressionClassifier(typename Types::Base* base,
-                                DuplicateFinder* duplicate_finder = nullptr)
-      : base_(base),
-        previous_(base->classifier_),
-        zone_(base->impl()->zone()),
-        reported_errors_(base->impl()->GetReportedErrorList()),
-        duplicate_finder_(duplicate_finder),
-        invalid_productions_(0),
-        function_properties_(0) {
-    base->classifier_ = this;
-    reported_errors_begin_ = reported_errors_end_ = reported_errors_->length();
-  }
-
-  V8_INLINE ~ExpressionClassifier() {
-    Discard();
-    if (base_->classifier_ == this) base_->classifier_ = previous_;
-  }
-
-  V8_INLINE bool is_valid(unsigned productions) const {
-    return (invalid_productions_ & productions) == 0;
-  }
-
-  V8_INLINE DuplicateFinder* duplicate_finder() const {
-    return duplicate_finder_;
-  }
-
-  V8_INLINE bool is_valid_expression() const {
-    return is_valid(ExpressionProduction);
-  }
-
-  V8_INLINE bool is_valid_formal_parameter_initializer() const {
-    return is_valid(FormalParameterInitializerProduction);
-  }
-
-  V8_INLINE bool is_valid_binding_pattern() const {
-    return is_valid(BindingPatternProduction);
-  }
-
-  V8_INLINE bool is_valid_assignment_pattern() const {
-    return is_valid(AssignmentPatternProduction);
-  }
-
-  V8_INLINE bool is_valid_arrow_formal_parameters() const {
-    return is_valid(ArrowFormalParametersProduction);
-  }
-
-  V8_INLINE bool is_valid_formal_parameter_list_without_duplicates() const {
-    return is_valid(DistinctFormalParametersProduction);
-  }
-
-  // Note: callers should also check
-  // is_valid_formal_parameter_list_without_duplicates().
-  V8_INLINE bool is_valid_strict_mode_formal_parameters() const {
-    return is_valid(StrictModeFormalParametersProduction);
-  }
-
-  V8_INLINE bool is_valid_let_pattern() const {
-    return is_valid(LetPatternProduction);
-  }
-
-  bool is_valid_async_arrow_formal_parameters() const {
-    return is_valid(AsyncArrowFormalParametersProduction);
-  }
-
-  V8_INLINE const Error& expression_error() const {
-    return reported_error(kExpressionProduction);
-  }
-
-  V8_INLINE const Error& formal_parameter_initializer_error() const {
-    return reported_error(kFormalParameterInitializerProduction);
-  }
-
-  V8_INLINE const Error& binding_pattern_error() const {
-    return reported_error(kBindingPatternProduction);
-  }
-
-  V8_INLINE const Error& assignment_pattern_error() const {
-    return reported_error(kAssignmentPatternProduction);
-  }
-
-  V8_INLINE const Error& arrow_formal_parameters_error() const {
-    return reported_error(kArrowFormalParametersProduction);
-  }
-
-  V8_INLINE const Error& duplicate_formal_parameter_error() const {
-    return reported_error(kDistinctFormalParametersProduction);
-  }
-
-  V8_INLINE const Error& strict_mode_formal_parameter_error() const {
-    return reported_error(kStrictModeFormalParametersProduction);
-  }
-
-  V8_INLINE const Error& let_pattern_error() const {
-    return reported_error(kLetPatternProduction);
-  }
-
-  V8_INLINE const Error& async_arrow_formal_parameters_error() const {
-    return reported_error(kAsyncArrowFormalParametersProduction);
-  }
-
-  V8_INLINE bool is_simple_parameter_list() const {
-    return !(function_properties_ & NonSimpleParameter);
-  }
-
-  V8_INLINE void RecordNonSimpleParameter() {
-    function_properties_ |= NonSimpleParameter;
-  }
-
-  void RecordExpressionError(const Scanner::Location& loc,
-                             MessageTemplate::Template message,
-                             const char* arg = nullptr) {
-    if (!is_valid_expression()) return;
-    invalid_productions_ |= ExpressionProduction;
-    Add(Error(loc, message, kExpressionProduction, arg));
-  }
-
-  void RecordExpressionError(const Scanner::Location& loc,
-                             MessageTemplate::Template message,
-                             ParseErrorType type, const char* arg = nullptr) {
-    if (!is_valid_expression()) return;
-    invalid_productions_ |= ExpressionProduction;
-    Add(Error(loc, message, kExpressionProduction, arg, type));
-  }
-
-  void RecordFormalParameterInitializerError(const Scanner::Location& loc,
-                                             MessageTemplate::Template message,
-                                             const char* arg = nullptr) {
-    if (!is_valid_formal_parameter_initializer()) return;
-    invalid_productions_ |= FormalParameterInitializerProduction;
-    Add(Error(loc, message, kFormalParameterInitializerProduction, arg));
-  }
-
-  void RecordBindingPatternError(const Scanner::Location& loc,
-                                 MessageTemplate::Template message,
-                                 const char* arg = nullptr) {
-    if (!is_valid_binding_pattern()) return;
-    invalid_productions_ |= BindingPatternProduction;
-    Add(Error(loc, message, kBindingPatternProduction, arg));
-  }
-
-  void RecordAssignmentPatternError(const Scanner::Location& loc,
-                                    MessageTemplate::Template message,
-                                    const char* arg = nullptr) {
-    if (!is_valid_assignment_pattern()) return;
-    invalid_productions_ |= AssignmentPatternProduction;
-    Add(Error(loc, message, kAssignmentPatternProduction, arg));
-  }
-
-  void RecordPatternError(const Scanner::Location& loc,
-                          MessageTemplate::Template message,
-                          const char* arg = nullptr) {
-    RecordBindingPatternError(loc, message, arg);
-    RecordAssignmentPatternError(loc, message, arg);
-  }
-
-  void RecordArrowFormalParametersError(const Scanner::Location& loc,
-                                        MessageTemplate::Template message,
-                                        const char* arg = nullptr) {
-    if (!is_valid_arrow_formal_parameters()) return;
-    invalid_productions_ |= ArrowFormalParametersProduction;
-    Add(Error(loc, message, kArrowFormalParametersProduction, arg));
-  }
-
-  void RecordAsyncArrowFormalParametersError(const Scanner::Location& loc,
-                                             MessageTemplate::Template message,
-                                             const char* arg = nullptr) {
-    if (!is_valid_async_arrow_formal_parameters()) return;
-    invalid_productions_ |= AsyncArrowFormalParametersProduction;
-    Add(Error(loc, message, kAsyncArrowFormalParametersProduction, arg));
-  }
-
-  void RecordDuplicateFormalParameterError(const Scanner::Location& loc) {
-    if (!is_valid_formal_parameter_list_without_duplicates()) return;
-    invalid_productions_ |= DistinctFormalParametersProduction;
-    Add(Error(loc, MessageTemplate::kParamDupe,
-              kDistinctFormalParametersProduction));
-  }
-
-  // Record a binding that would be invalid in strict mode.  Confusingly this
-  // is not the same as StrictFormalParameterList, which simply forbids
-  // duplicate bindings.
-  void RecordStrictModeFormalParameterError(const Scanner::Location& loc,
-                                            MessageTemplate::Template message,
-                                            const char* arg = nullptr) {
-    if (!is_valid_strict_mode_formal_parameters()) return;
-    invalid_productions_ |= StrictModeFormalParametersProduction;
-    Add(Error(loc, message, kStrictModeFormalParametersProduction, arg));
-  }
-
-  void RecordLetPatternError(const Scanner::Location& loc,
-                             MessageTemplate::Template message,
-                             const char* arg = nullptr) {
-    if (!is_valid_let_pattern()) return;
-    invalid_productions_ |= LetPatternProduction;
-    Add(Error(loc, message, kLetPatternProduction, arg));
-  }
-
-  void Accumulate(ExpressionClassifier* inner, unsigned productions) {
-    DCHECK_EQ(inner->reported_errors_, reported_errors_);
-    DCHECK_EQ(inner->reported_errors_begin_, reported_errors_end_);
-    DCHECK_EQ(inner->reported_errors_end_, reported_errors_->length());
-    // Propagate errors from inner, but don't overwrite already recorded
-    // errors.
-    unsigned non_arrow_inner_invalid_productions =
-        inner->invalid_productions_ & ~ArrowFormalParametersProduction;
-    if (non_arrow_inner_invalid_productions) {
-      unsigned errors = non_arrow_inner_invalid_productions & productions &
-                        ~invalid_productions_;
-      // The result will continue to be a valid arrow formal parameters if the
-      // inner expression is a valid binding pattern.
-      bool copy_BP_to_AFP = false;
-      if (productions & ArrowFormalParametersProduction &&
-          is_valid_arrow_formal_parameters()) {
-        // Also copy function properties if expecting an arrow function
-        // parameter.
-        function_properties_ |= inner->function_properties_;
-        if (!inner->is_valid_binding_pattern()) {
-          copy_BP_to_AFP = true;
-          invalid_productions_ |= ArrowFormalParametersProduction;
-        }
-      }
-      // Traverse the list of errors reported by the inner classifier
-      // to copy what's necessary.
-      if (errors != 0 || copy_BP_to_AFP) {
-        invalid_productions_ |= errors;
-        int binding_pattern_index = inner->reported_errors_end_;
-        for (int i = inner->reported_errors_begin_;
-             i < inner->reported_errors_end_; i++) {
-          int k = reported_errors_->at(i).kind;
-          if (errors & (1 << k)) Copy(i);
-          // Check if it's a BP error that has to be copied to an AFP error.
-          if (k == kBindingPatternProduction && copy_BP_to_AFP) {
-            if (reported_errors_end_ <= i) {
-              // If the BP error itself has not already been copied,
-              // copy it now and change it to an AFP error.
-              Copy(i);
-              reported_errors_->at(reported_errors_end_-1).kind =
-                  kArrowFormalParametersProduction;
-            } else {
-              // Otherwise, if the BP error was already copied, keep its
-              // position and wait until the end of the traversal.
-              DCHECK_EQ(reported_errors_end_, i+1);
-              binding_pattern_index = i;
-            }
-          }
-        }
-        // Do we still have to copy the BP error to an AFP error?
-        if (binding_pattern_index < inner->reported_errors_end_) {
-          // If there's still unused space in the list of the inner
-          // classifier, copy it there, otherwise add it to the end
-          // of the list.
-          if (reported_errors_end_ < inner->reported_errors_end_)
-            Copy(binding_pattern_index);
-          else
-            Add(reported_errors_->at(binding_pattern_index));
-          reported_errors_->at(reported_errors_end_-1).kind =
-              kArrowFormalParametersProduction;
-        }
-      }
-    }
-    reported_errors_->Rewind(reported_errors_end_);
-    inner->reported_errors_begin_ = inner->reported_errors_end_ =
-        reported_errors_end_;
-  }
-
-  V8_INLINE void Discard() {
-    if (reported_errors_end_ == reported_errors_->length()) {
-      reported_errors_->Rewind(reported_errors_begin_);
-      reported_errors_end_ = reported_errors_begin_;
-    }
-    DCHECK_EQ(reported_errors_begin_, reported_errors_end_);
-  }
-
-  ExpressionClassifier* previous() const { return previous_; }
-
- private:
-  V8_INLINE const Error& reported_error(ErrorKind kind) const {
-    if (invalid_productions_ & (1 << kind)) {
-      for (int i = reported_errors_begin_; i < reported_errors_end_; i++) {
-        if (reported_errors_->at(i).kind == kind)
-          return reported_errors_->at(i);
-      }
-      UNREACHABLE();
-    }
-    // We should only be looking for an error when we know that one has
-    // been reported.  But we're not...  So this is to make sure we have
-    // the same behaviour.
-    UNREACHABLE();
-
-    // Make MSVC happy by returning an error from this inaccessible path.
-    static Error none;
-    return none;
-  }
-
-  // Adds e to the end of the list of reported errors for this classifier.
-  // It is expected that this classifier is the last one in the stack.
-  V8_INLINE void Add(const Error& e) {
-    DCHECK_EQ(reported_errors_end_, reported_errors_->length());
-    reported_errors_->Add(e, zone_);
-    reported_errors_end_++;
-  }
-
-  // Copies the error at position i of the list of reported errors, so that
-  // it becomes the last error reported for this classifier.  Position i
-  // could be either after the existing errors of this classifier (i.e.,
-  // in an inner classifier) or it could be an existing error (in case a
-  // copy is needed).
-  V8_INLINE void Copy(int i) {
-    DCHECK_LT(i, reported_errors_->length());
-    if (reported_errors_end_ != i)
-      reported_errors_->at(reported_errors_end_) = reported_errors_->at(i);
-    reported_errors_end_++;
-  }
-
-  typename Types::Base* base_;
-  ExpressionClassifier* previous_;
-  Zone* zone_;
-  ZoneList<Error>* reported_errors_;
-  DuplicateFinder* duplicate_finder_;
-  unsigned invalid_productions_ : 14;
-  unsigned function_properties_ : 2;
-  // The uint16_t for reported_errors_begin_ and reported_errors_end_ will
-  // not be enough in the case of a long series of expressions using nested
-  // classifiers, e.g., a long sequence of assignments, as in:
-  // literals with spreads, as in:
-  // var N=65536; eval("var x;" + "x=".repeat(N) + "42");
-  // This should not be a problem, as such things currently fail with a
-  // stack overflow while parsing.
-  uint16_t reported_errors_begin_;
-  uint16_t reported_errors_end_;
-
-  DISALLOW_COPY_AND_ASSIGN(ExpressionClassifier);
-};
-
-
-#undef ERROR_CODES
-
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_PARSING_EXPRESSION_CLASSIFIER_H
diff --git a/src/v8/src/parsing/pattern-rewriter.cc b/src/v8/src/parsing/pattern-rewriter.cc
deleted file mode 100644
index daa126d..0000000
--- a/src/v8/src/parsing/pattern-rewriter.cc
+++ /dev/null
@@ -1,788 +0,0 @@
-// Copyright 2015 the V8 project 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 "src/ast/ast.h"
-#include "src/messages.h"
-#include "src/objects-inl.h"
-#include "src/parsing/expression-scope-reparenter.h"
-#include "src/parsing/parser.h"
-
-namespace v8 {
-
-namespace internal {
-
-class PatternRewriter final : public AstVisitor<PatternRewriter> {
- public:
-  // Limit the allowed number of local variables in a function. The hard limit
-  // is that offsets computed by FullCodeGenerator::StackOperand and similar
-  // functions are ints, and they should not overflow. In addition, accessing
-  // local variables creates user-controlled constants in the generated code,
-  // and we don't want too much user-controlled memory inside the code (this was
-  // the reason why this limit was introduced in the first place; see
-  // https://codereview.chromium.org/7003030/ ).
-  static const int kMaxNumFunctionLocals = 4194303;  // 2^22-1
-
-  typedef Parser::DeclarationDescriptor DeclarationDescriptor;
-
-  static void DeclareAndInitializeVariables(
-      Parser* parser, Block* block,
-      const DeclarationDescriptor* declaration_descriptor,
-      const Parser::DeclarationParsingResult::Declaration* declaration,
-      ZoneList<const AstRawString*>* names, bool* ok);
-
-  static void RewriteDestructuringAssignment(Parser* parser,
-                                             RewritableExpression* to_rewrite,
-                                             Scope* scope);
-
- private:
-  enum PatternContext { BINDING, ASSIGNMENT, ASSIGNMENT_ELEMENT };
-
-  class AssignmentElementScope {
-   public:
-    explicit AssignmentElementScope(PatternRewriter* rewriter)
-        : rewriter_(rewriter), context_(rewriter->context()) {
-      if (context_ == ASSIGNMENT) rewriter->context_ = ASSIGNMENT_ELEMENT;
-    }
-    ~AssignmentElementScope() { rewriter_->context_ = context_; }
-
-   private:
-    PatternRewriter* const rewriter_;
-    const PatternContext context_;
-  };
-
-  PatternRewriter(Scope* scope, Parser* parser, PatternContext context)
-      : scope_(scope),
-        parser_(parser),
-        context_(context),
-        initializer_position_(kNoSourcePosition),
-        value_beg_position_(kNoSourcePosition),
-        block_(nullptr),
-        descriptor_(nullptr),
-        names_(nullptr),
-        current_value_(nullptr),
-        recursion_level_(0),
-        ok_(nullptr) {}
-
-#define DECLARE_VISIT(type) void Visit##type(v8::internal::type* node);
-  // Visiting functions for AST nodes make this an AstVisitor.
-  AST_NODE_LIST(DECLARE_VISIT)
-#undef DECLARE_VISIT
-
-  PatternContext context() const { return context_; }
-
-  void RecurseIntoSubpattern(AstNode* pattern, Expression* value) {
-    Expression* old_value = current_value_;
-    current_value_ = value;
-    recursion_level_++;
-    Visit(pattern);
-    recursion_level_--;
-    current_value_ = old_value;
-  }
-
-  void VisitObjectLiteral(ObjectLiteral* node, Variable** temp_var);
-  void VisitArrayLiteral(ArrayLiteral* node, Variable** temp_var);
-
-  bool IsBindingContext() const { return context_ == BINDING; }
-  bool IsAssignmentContext() const {
-    return context_ == ASSIGNMENT || context_ == ASSIGNMENT_ELEMENT;
-  }
-  bool IsSubPattern() const { return recursion_level_ > 1; }
-
-  bool DeclaresParameterContainingSloppyEval() const;
-  void RewriteParameterScopes(Expression* expr);
-
-  Variable* CreateTempVar(Expression* value = nullptr);
-
-  AstNodeFactory* factory() const { return parser_->factory(); }
-  AstValueFactory* ast_value_factory() const {
-    return parser_->ast_value_factory();
-  }
-  Zone* zone() const { return parser_->zone(); }
-  Scope* scope() const { return scope_; }
-
-  Scope* const scope_;
-  Parser* const parser_;
-  PatternContext context_;
-  int initializer_position_;
-  int value_beg_position_;
-  Block* block_;
-  const DeclarationDescriptor* descriptor_;
-  ZoneList<const AstRawString*>* names_;
-  Expression* current_value_;
-  int recursion_level_;
-  bool* ok_;
-
-  DEFINE_AST_VISITOR_MEMBERS_WITHOUT_STACKOVERFLOW()
-};
-
-void Parser::DeclareAndInitializeVariables(
-    Block* block, const DeclarationDescriptor* declaration_descriptor,
-    const DeclarationParsingResult::Declaration* declaration,
-    ZoneList<const AstRawString*>* names, bool* ok) {
-  PatternRewriter::DeclareAndInitializeVariables(
-      this, block, declaration_descriptor, declaration, names, ok);
-}
-
-void Parser::RewriteDestructuringAssignment(RewritableExpression* to_rewrite) {
-  PatternRewriter::RewriteDestructuringAssignment(this, to_rewrite, scope());
-}
-
-Expression* Parser::RewriteDestructuringAssignment(Assignment* assignment) {
-  DCHECK_NOT_NULL(assignment);
-  DCHECK_EQ(Token::ASSIGN, assignment->op());
-  auto to_rewrite = factory()->NewRewritableExpression(assignment, scope());
-  RewriteDestructuringAssignment(to_rewrite);
-  return to_rewrite->expression();
-}
-
-void PatternRewriter::DeclareAndInitializeVariables(
-    Parser* parser, Block* block,
-    const DeclarationDescriptor* declaration_descriptor,
-    const Parser::DeclarationParsingResult::Declaration* declaration,
-    ZoneList<const AstRawString*>* names, bool* ok) {
-  DCHECK(block->ignore_completion_value());
-
-  PatternRewriter rewriter(declaration_descriptor->scope, parser, BINDING);
-  rewriter.initializer_position_ = declaration->initializer_position;
-  rewriter.value_beg_position_ = declaration->value_beg_position;
-  rewriter.block_ = block;
-  rewriter.descriptor_ = declaration_descriptor;
-  rewriter.names_ = names;
-  rewriter.ok_ = ok;
-
-  rewriter.RecurseIntoSubpattern(declaration->pattern,
-                                 declaration->initializer);
-}
-
-void PatternRewriter::RewriteDestructuringAssignment(
-    Parser* parser, RewritableExpression* to_rewrite, Scope* scope) {
-  DCHECK(!scope->HasBeenRemoved());
-  DCHECK(!to_rewrite->is_rewritten());
-
-  PatternRewriter rewriter(scope, parser, ASSIGNMENT);
-  rewriter.RecurseIntoSubpattern(to_rewrite, nullptr);
-}
-
-void PatternRewriter::VisitVariableProxy(VariableProxy* pattern) {
-  Expression* value = current_value_;
-
-  if (IsAssignmentContext()) {
-    // In an assignment context, simply perform the assignment
-    Assignment* assignment = factory()->NewAssignment(
-        Token::ASSIGN, pattern, value, pattern->position());
-    block_->statements()->Add(
-        factory()->NewExpressionStatement(assignment, pattern->position()),
-        zone());
-    return;
-  }
-
-  DCHECK_NOT_NULL(block_);
-  DCHECK_NOT_NULL(descriptor_);
-  DCHECK_NOT_NULL(ok_);
-
-  descriptor_->scope->RemoveUnresolved(pattern);
-
-  // Declare variable.
-  // Note that we *always* must treat the initial value via a separate init
-  // assignment for variables and constants because the value must be assigned
-  // when the variable is encountered in the source. But the variable/constant
-  // is declared (and set to 'undefined') upon entering the function within
-  // which the variable or constant is declared. Only function variables have
-  // an initial value in the declaration (because they are initialized upon
-  // entering the function).
-  const AstRawString* name = pattern->raw_name();
-  VariableProxy* proxy =
-      factory()->NewVariableProxy(name, NORMAL_VARIABLE, pattern->position());
-  Declaration* declaration;
-  if (descriptor_->mode == VAR && !descriptor_->scope->is_declaration_scope()) {
-    DCHECK(descriptor_->scope->is_block_scope() ||
-           descriptor_->scope->is_with_scope());
-    declaration = factory()->NewNestedVariableDeclaration(
-        proxy, descriptor_->scope, descriptor_->declaration_pos);
-  } else {
-    declaration =
-        factory()->NewVariableDeclaration(proxy, descriptor_->declaration_pos);
-  }
-
-  // When an extra declaration scope needs to be inserted to account for
-  // a sloppy eval in a default parameter or function body, the parameter
-  // needs to be declared in the function's scope, not in the varblock
-  // scope which will be used for the initializer expression.
-  Scope* outer_function_scope = nullptr;
-  if (DeclaresParameterContainingSloppyEval()) {
-    outer_function_scope = descriptor_->scope->outer_scope();
-  }
-  Variable* var = parser_->Declare(
-      declaration, descriptor_->declaration_kind, descriptor_->mode,
-      Variable::DefaultInitializationFlag(descriptor_->mode), ok_,
-      outer_function_scope);
-  if (!*ok_) return;
-  DCHECK_NOT_NULL(var);
-  DCHECK(proxy->is_resolved());
-  DCHECK_NE(initializer_position_, kNoSourcePosition);
-  var->set_initializer_position(initializer_position_);
-
-  Scope* declaration_scope =
-      outer_function_scope != nullptr
-          ? outer_function_scope
-          : (IsLexicalVariableMode(descriptor_->mode)
-                 ? descriptor_->scope
-                 : descriptor_->scope->GetDeclarationScope());
-  if (declaration_scope->num_var() > kMaxNumFunctionLocals) {
-    parser_->ReportMessage(MessageTemplate::kTooManyVariables);
-    *ok_ = false;
-    return;
-  }
-  if (names_) {
-    names_->Add(name, zone());
-  }
-
-  // If there's no initializer, we're done.
-  if (value == nullptr) return;
-
-  Scope* var_init_scope = descriptor_->scope;
-  Parser::MarkLoopVariableAsAssigned(var_init_scope, proxy->var(),
-                                     descriptor_->declaration_kind);
-
-  // A declaration of the form:
-  //
-  //    var v = x;
-  //
-  // is syntactic sugar for:
-  //
-  //    var v; v = x;
-  //
-  // In particular, we need to re-lookup 'v' as it may be a different
-  // 'v' than the 'v' in the declaration (e.g., if we are inside a
-  // 'with' statement or 'catch' block). Global var declarations
-  // also need special treatment.
-
-  // For 'let' and 'const' declared variables the initialization always
-  // assigns to the declared variable.
-  // But for var declarations we need to do a new lookup.
-  if (descriptor_->mode == VAR) {
-    proxy = var_init_scope->NewUnresolved(factory(), name);
-  } else {
-    DCHECK_NOT_NULL(proxy);
-    DCHECK_NOT_NULL(proxy->var());
-  }
-  // Add break location for destructured sub-pattern.
-  int pos = value_beg_position_;
-  if (pos == kNoSourcePosition) {
-    pos = IsSubPattern() ? pattern->position() : value->position();
-  }
-  Assignment* assignment =
-      factory()->NewAssignment(Token::INIT, proxy, value, pos);
-  block_->statements()->Add(factory()->NewExpressionStatement(assignment, pos),
-                            zone());
-}
-
-Variable* PatternRewriter::CreateTempVar(Expression* value) {
-  auto temp = scope()->NewTemporary(ast_value_factory()->empty_string());
-  if (value != nullptr) {
-    auto assignment = factory()->NewAssignment(
-        Token::ASSIGN, factory()->NewVariableProxy(temp), value,
-        kNoSourcePosition);
-
-    block_->statements()->Add(
-        factory()->NewExpressionStatement(assignment, kNoSourcePosition),
-        zone());
-  }
-  return temp;
-}
-
-void PatternRewriter::VisitRewritableExpression(RewritableExpression* node) {
-  if (!node->expression()->IsAssignment()) {
-    // RewritableExpressions are also used for desugaring Spread, which is
-    // orthogonal to PatternRewriter; just visit the underlying expression.
-    DCHECK_EQ(AstNode::kArrayLiteral, node->expression()->node_type());
-    return Visit(node->expression());
-  } else if (context() != ASSIGNMENT) {
-    // This is not a destructuring assignment. Mark the node as rewritten to
-    // prevent redundant rewriting and visit the underlying expression.
-    DCHECK(!node->is_rewritten());
-    node->set_rewritten();
-    return Visit(node->expression());
-  }
-
-  DCHECK(!node->is_rewritten());
-  DCHECK_EQ(ASSIGNMENT, context());
-  Assignment* assign = node->expression()->AsAssignment();
-  DCHECK_NOT_NULL(assign);
-  DCHECK_EQ(Token::ASSIGN, assign->op());
-
-  int pos = assign->position();
-  Block* old_block = block_;
-  block_ = factory()->NewBlock(8, true);
-  Variable* temp = nullptr;
-  Expression* pattern = assign->target();
-  Expression* old_value = current_value_;
-  current_value_ = assign->value();
-  if (pattern->IsObjectLiteral()) {
-    VisitObjectLiteral(pattern->AsObjectLiteral(), &temp);
-  } else {
-    DCHECK(pattern->IsArrayLiteral());
-    VisitArrayLiteral(pattern->AsArrayLiteral(), &temp);
-  }
-  DCHECK_NOT_NULL(temp);
-  current_value_ = old_value;
-  Expression* expr = factory()->NewDoExpression(block_, temp, pos);
-  node->Rewrite(expr);
-  block_ = old_block;
-  if (block_) {
-    block_->statements()->Add(factory()->NewExpressionStatement(expr, pos),
-                              zone());
-  }
-}
-
-bool PatternRewriter::DeclaresParameterContainingSloppyEval() const {
-  // Need to check for a binding context to make sure we have a descriptor.
-  if (IsBindingContext() &&
-      // Only relevant for parameters.
-      descriptor_->declaration_kind == DeclarationDescriptor::PARAMETER &&
-      // And only when scope is a block scope;
-      // without eval, it is a function scope.
-      scope()->is_block_scope()) {
-    DCHECK(scope()->is_declaration_scope());
-    DCHECK(scope()->AsDeclarationScope()->calls_sloppy_eval());
-    DCHECK(scope()->outer_scope()->is_function_scope());
-    return true;
-  }
-
-  return false;
-}
-
-// When an extra declaration scope needs to be inserted to account for
-// a sloppy eval in a default parameter or function body, the expressions
-// needs to be in that new inner scope which was added after initial
-// parsing.
-void PatternRewriter::RewriteParameterScopes(Expression* expr) {
-  if (DeclaresParameterContainingSloppyEval()) {
-    ReparentExpressionScope(parser_->stack_limit(), expr, scope());
-  }
-}
-
-void PatternRewriter::VisitObjectLiteral(ObjectLiteral* pattern,
-                                         Variable** temp_var) {
-  auto temp = *temp_var = CreateTempVar(current_value_);
-
-  ZoneList<Expression*>* rest_runtime_callargs = nullptr;
-  if (pattern->has_rest_property()) {
-    // non_rest_properties_count = pattern->properties()->length - 1;
-    // args_length = 1 + non_rest_properties_count because we need to
-    // pass temp as well to the runtime function.
-    int args_length = pattern->properties()->length();
-    rest_runtime_callargs =
-        new (zone()) ZoneList<Expression*>(args_length, zone());
-    rest_runtime_callargs->Add(factory()->NewVariableProxy(temp), zone());
-  }
-
-  block_->statements()->Add(parser_->BuildAssertIsCoercible(temp, pattern),
-                            zone());
-
-  for (ObjectLiteralProperty* property : *pattern->properties()) {
-    Expression* value;
-
-    if (property->kind() == ObjectLiteralProperty::Kind::SPREAD) {
-      // var { y, [x++]: a, ...c } = temp
-      //     becomes
-      // var y = temp.y;
-      // var temp1 = %ToName(x++);
-      // var a = temp[temp1];
-      // var c;
-      // c = %CopyDataPropertiesWithExcludedProperties(temp, "y", temp1);
-      value = factory()->NewCallRuntime(
-          Runtime::kCopyDataPropertiesWithExcludedProperties,
-          rest_runtime_callargs, kNoSourcePosition);
-    } else {
-      Expression* key = property->key();
-
-      if (!key->IsLiteral()) {
-        // Computed property names contain expressions which might require
-        // scope rewriting.
-        RewriteParameterScopes(key);
-      }
-
-      if (pattern->has_rest_property()) {
-        Expression* excluded_property = key;
-
-        if (property->is_computed_name()) {
-          DCHECK(!key->IsPropertyName() || !key->IsNumberLiteral());
-          auto args = new (zone()) ZoneList<Expression*>(1, zone());
-          args->Add(key, zone());
-          auto to_name_key = CreateTempVar(factory()->NewCallRuntime(
-              Runtime::kToName, args, kNoSourcePosition));
-          key = factory()->NewVariableProxy(to_name_key);
-          excluded_property = factory()->NewVariableProxy(to_name_key);
-        } else {
-          DCHECK(key->IsPropertyName() || key->IsNumberLiteral());
-        }
-
-        DCHECK_NOT_NULL(rest_runtime_callargs);
-        rest_runtime_callargs->Add(excluded_property, zone());
-      }
-
-      value = factory()->NewProperty(factory()->NewVariableProxy(temp), key,
-                                     kNoSourcePosition);
-    }
-
-    AssignmentElementScope element_scope(this);
-    RecurseIntoSubpattern(property->value(), value);
-  }
-}
-
-void PatternRewriter::VisitObjectLiteral(ObjectLiteral* node) {
-  Variable* temp_var = nullptr;
-  VisitObjectLiteral(node, &temp_var);
-}
-
-void PatternRewriter::VisitArrayLiteral(ArrayLiteral* node,
-                                        Variable** temp_var) {
-  DCHECK(block_->ignore_completion_value());
-
-  auto temp = *temp_var = CreateTempVar(current_value_);
-  auto iterator = CreateTempVar(factory()->NewGetIterator(
-      factory()->NewVariableProxy(temp), current_value_, IteratorType::kNormal,
-      current_value_->position()));
-  auto next = CreateTempVar(factory()->NewProperty(
-      factory()->NewVariableProxy(iterator),
-      factory()->NewStringLiteral(ast_value_factory()->next_string(),
-                                  kNoSourcePosition),
-      kNoSourcePosition));
-  auto done =
-      CreateTempVar(factory()->NewBooleanLiteral(false, kNoSourcePosition));
-  auto result = CreateTempVar();
-  auto v = CreateTempVar();
-  auto completion = CreateTempVar();
-  auto nopos = kNoSourcePosition;
-
-  // For the purpose of iterator finalization, we temporarily set block_ to a
-  // new block.  In the main body of this function, we write to block_ (both
-  // explicitly and implicitly via recursion).  At the end of the function, we
-  // wrap this new block in a try-finally statement, restore block_ to its
-  // original value, and add the try-finally statement to block_.
-  auto target = block_;
-  block_ = factory()->NewBlock(8, true);
-
-  Spread* spread = nullptr;
-  for (Expression* value : *node->values()) {
-    if (value->IsSpread()) {
-      spread = value->AsSpread();
-      break;
-    }
-
-    // if (!done) {
-    //   done = true;  // If .next, .done or .value throws, don't close.
-    //   result = IteratorNext(iterator);
-    //   if (result.done) {
-    //     v = undefined;
-    //   } else {
-    //     v = result.value;
-    //     done = false;
-    //   }
-    // }
-    Statement* if_not_done;
-    {
-      auto result_done = factory()->NewProperty(
-          factory()->NewVariableProxy(result),
-          factory()->NewStringLiteral(ast_value_factory()->done_string(),
-                                      kNoSourcePosition),
-          kNoSourcePosition);
-
-      auto assign_undefined = factory()->NewAssignment(
-          Token::ASSIGN, factory()->NewVariableProxy(v),
-          factory()->NewUndefinedLiteral(kNoSourcePosition), kNoSourcePosition);
-
-      auto assign_value = factory()->NewAssignment(
-          Token::ASSIGN, factory()->NewVariableProxy(v),
-          factory()->NewProperty(
-              factory()->NewVariableProxy(result),
-              factory()->NewStringLiteral(ast_value_factory()->value_string(),
-                                          kNoSourcePosition),
-              kNoSourcePosition),
-          kNoSourcePosition);
-
-      auto unset_done = factory()->NewAssignment(
-          Token::ASSIGN, factory()->NewVariableProxy(done),
-          factory()->NewBooleanLiteral(false, kNoSourcePosition),
-          kNoSourcePosition);
-
-      auto inner_else = factory()->NewBlock(2, true);
-      inner_else->statements()->Add(
-          factory()->NewExpressionStatement(assign_value, nopos), zone());
-      inner_else->statements()->Add(
-          factory()->NewExpressionStatement(unset_done, nopos), zone());
-
-      auto inner_if = factory()->NewIfStatement(
-          result_done,
-          factory()->NewExpressionStatement(assign_undefined, nopos),
-          inner_else, nopos);
-
-      auto next_block = factory()->NewBlock(3, true);
-      next_block->statements()->Add(
-          factory()->NewExpressionStatement(
-              factory()->NewAssignment(
-                  Token::ASSIGN, factory()->NewVariableProxy(done),
-                  factory()->NewBooleanLiteral(true, nopos), nopos),
-              nopos),
-          zone());
-      next_block->statements()->Add(
-          factory()->NewExpressionStatement(
-              parser_->BuildIteratorNextResult(
-                  factory()->NewVariableProxy(iterator),
-                  factory()->NewVariableProxy(next), result,
-                  IteratorType::kNormal, kNoSourcePosition),
-              kNoSourcePosition),
-          zone());
-      next_block->statements()->Add(inner_if, zone());
-
-      if_not_done = factory()->NewIfStatement(
-          factory()->NewUnaryOperation(
-              Token::NOT, factory()->NewVariableProxy(done), kNoSourcePosition),
-          next_block, factory()->NewEmptyStatement(kNoSourcePosition),
-          kNoSourcePosition);
-    }
-    block_->statements()->Add(if_not_done, zone());
-
-    if (!value->IsTheHoleLiteral()) {
-      {
-        // completion = kAbruptCompletion;
-        Expression* proxy = factory()->NewVariableProxy(completion);
-        Expression* assignment = factory()->NewAssignment(
-            Token::ASSIGN, proxy,
-            factory()->NewSmiLiteral(Parser::kAbruptCompletion, nopos), nopos);
-        block_->statements()->Add(
-            factory()->NewExpressionStatement(assignment, nopos), zone());
-      }
-
-      {
-        AssignmentElementScope element_scope(this);
-        RecurseIntoSubpattern(value, factory()->NewVariableProxy(v));
-      }
-
-      {
-        // completion = kNormalCompletion;
-        Expression* proxy = factory()->NewVariableProxy(completion);
-        Expression* assignment = factory()->NewAssignment(
-            Token::ASSIGN, proxy,
-            factory()->NewSmiLiteral(Parser::kNormalCompletion, nopos), nopos);
-        block_->statements()->Add(
-            factory()->NewExpressionStatement(assignment, nopos), zone());
-      }
-    }
-  }
-
-  if (spread != nullptr) {
-    // A spread can only occur as the last component.  It is not handled by
-    // RecurseIntoSubpattern above.
-
-    // let array = [];
-    // while (!done) {
-    //   done = true;  // If .next, .done or .value throws, don't close.
-    //   result = IteratorNext(iterator);
-    //   if (!result.done) {
-    //     %AppendElement(array, result.value);
-    //     done = false;
-    //   }
-    // }
-
-    // let array = [];
-    Variable* array;
-    {
-      auto empty_exprs = new (zone()) ZoneList<Expression*>(0, zone());
-      array = CreateTempVar(
-          factory()->NewArrayLiteral(empty_exprs, kNoSourcePosition));
-    }
-
-    // done = true;
-    Statement* set_done = factory()->NewExpressionStatement(
-        factory()->NewAssignment(
-            Token::ASSIGN, factory()->NewVariableProxy(done),
-            factory()->NewBooleanLiteral(true, nopos), nopos),
-        nopos);
-
-    // result = IteratorNext(iterator);
-    Statement* get_next = factory()->NewExpressionStatement(
-        parser_->BuildIteratorNextResult(factory()->NewVariableProxy(iterator),
-                                         factory()->NewVariableProxy(next),
-                                         result, IteratorType::kNormal, nopos),
-        nopos);
-
-    // %AppendElement(array, result.value);
-    Statement* append_element;
-    {
-      auto args = new (zone()) ZoneList<Expression*>(2, zone());
-      args->Add(factory()->NewVariableProxy(array), zone());
-      args->Add(factory()->NewProperty(
-                    factory()->NewVariableProxy(result),
-                    factory()->NewStringLiteral(
-                        ast_value_factory()->value_string(), nopos),
-                    nopos),
-                zone());
-      append_element = factory()->NewExpressionStatement(
-          factory()->NewCallRuntime(Runtime::kAppendElement, args, nopos),
-          nopos);
-    }
-
-    // done = false;
-    Statement* unset_done = factory()->NewExpressionStatement(
-        factory()->NewAssignment(
-            Token::ASSIGN, factory()->NewVariableProxy(done),
-            factory()->NewBooleanLiteral(false, nopos), nopos),
-        nopos);
-
-    // if (!result.done) { #append_element; #unset_done }
-    Statement* maybe_append_and_unset_done;
-    {
-      Expression* result_done =
-          factory()->NewProperty(factory()->NewVariableProxy(result),
-                                 factory()->NewStringLiteral(
-                                     ast_value_factory()->done_string(), nopos),
-                                 nopos);
-
-      Block* then = factory()->NewBlock(2, true);
-      then->statements()->Add(append_element, zone());
-      then->statements()->Add(unset_done, zone());
-
-      maybe_append_and_unset_done = factory()->NewIfStatement(
-          factory()->NewUnaryOperation(Token::NOT, result_done, nopos), then,
-          factory()->NewEmptyStatement(nopos), nopos);
-    }
-
-    // while (!done) {
-    //   #set_done;
-    //   #get_next;
-    //   #maybe_append_and_unset_done;
-    // }
-    WhileStatement* loop = factory()->NewWhileStatement(nullptr, nopos);
-    {
-      Expression* condition = factory()->NewUnaryOperation(
-          Token::NOT, factory()->NewVariableProxy(done), nopos);
-      Block* body = factory()->NewBlock(3, true);
-      body->statements()->Add(set_done, zone());
-      body->statements()->Add(get_next, zone());
-      body->statements()->Add(maybe_append_and_unset_done, zone());
-      loop->Initialize(condition, body);
-    }
-
-    block_->statements()->Add(loop, zone());
-    RecurseIntoSubpattern(spread->expression(),
-                          factory()->NewVariableProxy(array));
-  }
-
-  Expression* closing_condition = factory()->NewUnaryOperation(
-      Token::NOT, factory()->NewVariableProxy(done), nopos);
-
-  parser_->FinalizeIteratorUse(completion, closing_condition, iterator, block_,
-                               target, IteratorType::kNormal);
-  block_ = target;
-}
-
-void PatternRewriter::VisitArrayLiteral(ArrayLiteral* node) {
-  Variable* temp_var = nullptr;
-  VisitArrayLiteral(node, &temp_var);
-}
-
-void PatternRewriter::VisitAssignment(Assignment* node) {
-  // let {<pattern> = <init>} = <value>
-  //   becomes
-  // temp = <value>;
-  // <pattern> = temp === undefined ? <init> : temp;
-  DCHECK_EQ(Token::ASSIGN, node->op());
-
-  // Rewriting of Assignment nodes for destructuring assignment
-  // is handled in VisitRewritableExpression().
-  DCHECK_NE(ASSIGNMENT, context());
-
-  auto initializer = node->value();
-  auto value = initializer;
-  auto temp = CreateTempVar(current_value_);
-
-  Expression* is_undefined = factory()->NewCompareOperation(
-      Token::EQ_STRICT, factory()->NewVariableProxy(temp),
-      factory()->NewUndefinedLiteral(kNoSourcePosition), kNoSourcePosition);
-  value = factory()->NewConditional(is_undefined, initializer,
-                                    factory()->NewVariableProxy(temp),
-                                    kNoSourcePosition);
-
-  // Initializer may have been parsed in the wrong scope.
-  RewriteParameterScopes(initializer);
-
-  RecurseIntoSubpattern(node->target(), value);
-}
-
-
-// =============== AssignmentPattern only ==================
-
-void PatternRewriter::VisitProperty(v8::internal::Property* node) {
-  DCHECK(IsAssignmentContext());
-  auto value = current_value_;
-
-  Assignment* assignment =
-      factory()->NewAssignment(Token::ASSIGN, node, value, node->position());
-
-  block_->statements()->Add(
-      factory()->NewExpressionStatement(assignment, kNoSourcePosition), zone());
-}
-
-
-// =============== UNREACHABLE =============================
-
-#define NOT_A_PATTERN(Node) \
-  void PatternRewriter::Visit##Node(v8::internal::Node*) { UNREACHABLE(); }
-
-NOT_A_PATTERN(BinaryOperation)
-NOT_A_PATTERN(NaryOperation)
-NOT_A_PATTERN(Block)
-NOT_A_PATTERN(BreakStatement)
-NOT_A_PATTERN(Call)
-NOT_A_PATTERN(CallNew)
-NOT_A_PATTERN(CallRuntime)
-NOT_A_PATTERN(ClassLiteral)
-NOT_A_PATTERN(CompareOperation)
-NOT_A_PATTERN(CompoundAssignment)
-NOT_A_PATTERN(Conditional)
-NOT_A_PATTERN(ContinueStatement)
-NOT_A_PATTERN(CountOperation)
-NOT_A_PATTERN(DebuggerStatement)
-NOT_A_PATTERN(DoExpression)
-NOT_A_PATTERN(DoWhileStatement)
-NOT_A_PATTERN(EmptyStatement)
-NOT_A_PATTERN(EmptyParentheses)
-NOT_A_PATTERN(ExpressionStatement)
-NOT_A_PATTERN(ForInStatement)
-NOT_A_PATTERN(ForOfStatement)
-NOT_A_PATTERN(ForStatement)
-NOT_A_PATTERN(FunctionDeclaration)
-NOT_A_PATTERN(FunctionLiteral)
-NOT_A_PATTERN(GetIterator)
-NOT_A_PATTERN(GetTemplateObject)
-NOT_A_PATTERN(IfStatement)
-NOT_A_PATTERN(ImportCallExpression)
-NOT_A_PATTERN(Literal)
-NOT_A_PATTERN(NativeFunctionLiteral)
-NOT_A_PATTERN(RegExpLiteral)
-NOT_A_PATTERN(ResolvedProperty)
-NOT_A_PATTERN(ReturnStatement)
-NOT_A_PATTERN(SloppyBlockFunctionStatement)
-NOT_A_PATTERN(Spread)
-NOT_A_PATTERN(SuperPropertyReference)
-NOT_A_PATTERN(SuperCallReference)
-NOT_A_PATTERN(SwitchStatement)
-NOT_A_PATTERN(ThisFunction)
-NOT_A_PATTERN(Throw)
-NOT_A_PATTERN(TryCatchStatement)
-NOT_A_PATTERN(TryFinallyStatement)
-NOT_A_PATTERN(UnaryOperation)
-NOT_A_PATTERN(VariableDeclaration)
-NOT_A_PATTERN(WhileStatement)
-NOT_A_PATTERN(WithStatement)
-NOT_A_PATTERN(Yield)
-NOT_A_PATTERN(YieldStar)
-NOT_A_PATTERN(Await)
-NOT_A_PATTERN(InitializeClassFieldsStatement)
-
-#undef NOT_A_PATTERN
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/parsing/preparse-data-format.h b/src/v8/src/parsing/preparse-data-format.h
deleted file mode 100644
index 2f317ce..0000000
--- a/src/v8/src/parsing/preparse-data-format.h
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_PARSING_PREPARSE_DATA_FORMAT_H_
-#define V8_PARSING_PREPARSE_DATA_FORMAT_H_
-
-namespace v8 {
-namespace internal {
-
-// Generic and general data used by preparse data recorders and readers.
-
-struct PreparseDataConstants {
- public:
-  // Layout and constants of the preparse data exchange format.
-  static const unsigned kMagicNumber = 0xBadDead;
-  static const unsigned kCurrentVersion = 17;
-
-  static const int kMagicOffset = 0;
-  static const int kVersionOffset = 1;
-  static const int kFunctionsSizeOffset = 2;
-  static const int kSizeOffset = 3;
-  static const int kHeaderSize = 4;
-
-  static const unsigned char kNumberTerminator = 0x80u;
-};
-
-
-}  // namespace internal
-}  // namespace v8.
-
-#endif  // V8_PARSING_PREPARSE_DATA_FORMAT_H_
diff --git a/src/v8/src/parsing/preparsed-scope-data.cc b/src/v8/src/parsing/preparsed-scope-data.cc
deleted file mode 100644
index 786be3f..0000000
--- a/src/v8/src/parsing/preparsed-scope-data.cc
+++ /dev/null
@@ -1,636 +0,0 @@
-// Copyright 2017 the V8 project 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 "src/parsing/preparsed-scope-data.h"
-
-#include "src/ast/scopes.h"
-#include "src/ast/variables.h"
-#include "src/handles.h"
-#include "src/objects-inl.h"
-#include "src/objects/shared-function-info.h"
-#include "src/parsing/preparser.h"
-
-namespace v8 {
-namespace internal {
-
-namespace {
-
-class ScopeCallsSloppyEvalField : public BitField<bool, 0, 1> {};
-class InnerScopeCallsEvalField
-    : public BitField<bool, ScopeCallsSloppyEvalField::kNext, 1> {};
-
-class VariableMaybeAssignedField : public BitField8<bool, 0, 1> {};
-class VariableContextAllocatedField
-    : public BitField8<bool, VariableMaybeAssignedField::kNext, 1> {};
-
-const int kMagicValue = 0xC0DE0DE;
-
-#ifdef DEBUG
-const size_t kUint32Size = 5;
-const size_t kUint8Size = 2;
-const size_t kQuarterMarker = 0;
-#else
-const size_t kUint32Size = 4;
-const size_t kUint8Size = 1;
-#endif
-
-const int kPlaceholderSize = kUint32Size;
-const int kSkippableFunctionDataSize = 4 * kUint32Size + 1 * kUint8Size;
-
-class LanguageField : public BitField8<LanguageMode, 0, 1> {};
-class UsesSuperField : public BitField8<bool, LanguageField::kNext, 1> {};
-STATIC_ASSERT(LanguageModeSize <= LanguageField::kNumValues);
-
-}  // namespace
-
-/*
-
-  Internal data format for the backing store of ProducedPreparsedScopeData and
-  PreParsedScopeData::scope_data (on the heap):
-
-  (Skippable function data:)
-  ------------------------------------
-  | scope_data_start                 |
-  ------------------------------------
-  | data for inner function 1        |
-  | ...                              |
-  ------------------------------------
-  | data for inner function n        |
-  | ...                              |
-  ------------------------------------
-  (Scope allocation data:)             << scope_data_start points here
-  ------------------------------------
-  magic value
-  ------------------------------------
-  scope positions
-  ------------------------------------
-  | scope type << only in debug      |
-  | eval                             |
-  | ----------------------           |
-  | | data for variables |           |
-  | | ...                |           |
-  | ----------------------           |
-  ------------------------------------
-  ------------------------------------
-  | data for inner scope 1           | << but not for function scopes
-  | ...                              |
-  ------------------------------------
-  ...
-  ------------------------------------
-  | data for inner scope m           |
-  | ...                              |
-  ------------------------------------
-
-  PreParsedScopeData::child_data is an array of PreParsedScopeData objects, one
-  for each skippable inner function.
-
-  ConsumedPreParsedScopeData wraps a PreParsedScopeData and reads data from it.
-
- */
-
-void ProducedPreParsedScopeData::ByteData::WriteUint32(uint32_t data) {
-#ifdef DEBUG
-  // Save expected item size in debug mode.
-  backing_store_.push_back(kUint32Size);
-#endif
-  const uint8_t* d = reinterpret_cast<uint8_t*>(&data);
-  for (int i = 0; i < 4; ++i) {
-    backing_store_.push_back(*d++);
-  }
-  free_quarters_in_last_byte_ = 0;
-}
-
-void ProducedPreParsedScopeData::ByteData::OverwriteFirstUint32(uint32_t data) {
-  auto it = backing_store_.begin();
-#ifdef DEBUG
-  // Check that that position already holds an item of the expected size.
-  DCHECK_GE(backing_store_.size(), kUint32Size);
-  DCHECK_EQ(*it, kUint32Size);
-  ++it;
-#endif
-  const uint8_t* d = reinterpret_cast<uint8_t*>(&data);
-  for (size_t i = 0; i < 4; ++i) {
-    *it++ = *d++;
-  }
-}
-
-void ProducedPreParsedScopeData::ByteData::WriteUint8(uint8_t data) {
-#ifdef DEBUG
-  // Save expected item size in debug mode.
-  backing_store_.push_back(kUint8Size);
-#endif
-  backing_store_.push_back(data);
-  free_quarters_in_last_byte_ = 0;
-}
-
-void ProducedPreParsedScopeData::ByteData::WriteQuarter(uint8_t data) {
-  DCHECK_LE(data, 3);
-  if (free_quarters_in_last_byte_ == 0) {
-#ifdef DEBUG
-    // Save a marker in debug mode.
-    backing_store_.push_back(kQuarterMarker);
-#endif
-    backing_store_.push_back(0);
-    free_quarters_in_last_byte_ = 3;
-  } else {
-    --free_quarters_in_last_byte_;
-  }
-
-  uint8_t shift_amount = free_quarters_in_last_byte_ * 2;
-  DCHECK_EQ(backing_store_.back() & (3 << shift_amount), 0);
-  backing_store_.back() |= (data << shift_amount);
-}
-
-Handle<PodArray<uint8_t>> ProducedPreParsedScopeData::ByteData::Serialize(
-    Isolate* isolate) {
-  Handle<PodArray<uint8_t>> array = PodArray<uint8_t>::New(
-      isolate, static_cast<int>(backing_store_.size()), TENURED);
-
-  DisallowHeapAllocation no_gc;
-  PodArray<uint8_t>* raw_array = *array;
-
-  int i = 0;
-  for (uint8_t item : backing_store_) {
-    raw_array->set(i++, item);
-  }
-  return array;
-}
-
-ProducedPreParsedScopeData::ProducedPreParsedScopeData(
-    Zone* zone, ProducedPreParsedScopeData* parent)
-    : parent_(parent),
-      byte_data_(new (zone) ByteData(zone)),
-      data_for_inner_functions_(zone),
-      bailed_out_(false) {
-  if (parent != nullptr) {
-    parent->data_for_inner_functions_.push_back(this);
-  }
-  // Reserve space for scope_data_start, written later:
-  byte_data_->WriteUint32(0);
-}
-
-// Create a ProducedPreParsedScopeData which is just a proxy for a previous
-// produced PreParsedScopeData.
-ProducedPreParsedScopeData::ProducedPreParsedScopeData(
-    Handle<PreParsedScopeData> data, Zone* zone)
-    : parent_(nullptr),
-      byte_data_(nullptr),
-      data_for_inner_functions_(zone),
-      bailed_out_(false),
-      previously_produced_preparsed_scope_data_(data) {}
-
-ProducedPreParsedScopeData::DataGatheringScope::DataGatheringScope(
-    DeclarationScope* function_scope, PreParser* preparser)
-    : function_scope_(function_scope),
-      preparser_(preparser),
-      produced_preparsed_scope_data_(nullptr) {
-  if (FLAG_preparser_scope_analysis) {
-    ProducedPreParsedScopeData* parent =
-        preparser->produced_preparsed_scope_data();
-    Zone* main_zone = preparser->main_zone();
-    produced_preparsed_scope_data_ =
-        new (main_zone) ProducedPreParsedScopeData(main_zone, parent);
-    preparser->set_produced_preparsed_scope_data(
-        produced_preparsed_scope_data_);
-    function_scope->set_produced_preparsed_scope_data(
-        produced_preparsed_scope_data_);
-  }
-}
-
-ProducedPreParsedScopeData::DataGatheringScope::~DataGatheringScope() {
-  if (FLAG_preparser_scope_analysis) {
-    preparser_->set_produced_preparsed_scope_data(
-        produced_preparsed_scope_data_->parent_);
-  }
-}
-
-void ProducedPreParsedScopeData::DataGatheringScope::MarkFunctionAsSkippable(
-    int end_position, int num_inner_functions) {
-  DCHECK(FLAG_preparser_scope_analysis);
-  DCHECK_NOT_NULL(produced_preparsed_scope_data_);
-  DCHECK_NOT_NULL(produced_preparsed_scope_data_->parent_);
-  produced_preparsed_scope_data_->parent_->AddSkippableFunction(
-      function_scope_->start_position(), end_position,
-      function_scope_->num_parameters(), num_inner_functions,
-      function_scope_->language_mode(), function_scope_->NeedsHomeObject());
-}
-
-void ProducedPreParsedScopeData::AddSkippableFunction(
-    int start_position, int end_position, int num_parameters,
-    int num_inner_functions, LanguageMode language_mode,
-    bool uses_super_property) {
-  DCHECK(FLAG_preparser_scope_analysis);
-  DCHECK(previously_produced_preparsed_scope_data_.is_null());
-
-  if (bailed_out_) {
-    return;
-  }
-
-  byte_data_->WriteUint32(start_position);
-  byte_data_->WriteUint32(end_position);
-  byte_data_->WriteUint32(num_parameters);
-  byte_data_->WriteUint32(num_inner_functions);
-
-  uint8_t language_and_super = LanguageField::encode(language_mode) |
-                               UsesSuperField::encode(uses_super_property);
-
-  byte_data_->WriteQuarter(language_and_super);
-}
-
-void ProducedPreParsedScopeData::SaveScopeAllocationData(
-    DeclarationScope* scope) {
-  DCHECK(FLAG_preparser_scope_analysis);
-  DCHECK(previously_produced_preparsed_scope_data_.is_null());
-  // The data contains a uint32 (reserved space for scope_data_start) and
-  // function data items, kSkippableFunctionDataSize each.
-  DCHECK_GE(byte_data_->size(), kPlaceholderSize);
-  DCHECK_LE(byte_data_->size(), std::numeric_limits<uint32_t>::max());
-  DCHECK_EQ(byte_data_->size() % kSkippableFunctionDataSize, kPlaceholderSize);
-
-  if (bailed_out_) {
-    return;
-  }
-
-  uint32_t scope_data_start = static_cast<uint32_t>(byte_data_->size());
-
-  // If there are no skippable inner functions, we don't need to save anything.
-  if (scope_data_start == kPlaceholderSize) {
-    return;
-  }
-
-  byte_data_->OverwriteFirstUint32(scope_data_start);
-
-  // For a data integrity check, write a value between data about skipped inner
-  // funcs and data about variables.
-  byte_data_->WriteUint32(kMagicValue);
-  byte_data_->WriteUint32(scope->start_position());
-  byte_data_->WriteUint32(scope->end_position());
-
-  SaveDataForScope(scope);
-}
-
-bool ProducedPreParsedScopeData::ContainsInnerFunctions() const {
-  return byte_data_->size() > kPlaceholderSize;
-}
-
-MaybeHandle<PreParsedScopeData> ProducedPreParsedScopeData::Serialize(
-    Isolate* isolate) {
-  if (!previously_produced_preparsed_scope_data_.is_null()) {
-    DCHECK(!bailed_out_);
-    DCHECK_EQ(data_for_inner_functions_.size(), 0);
-    return previously_produced_preparsed_scope_data_;
-  }
-  if (bailed_out_) {
-    return MaybeHandle<PreParsedScopeData>();
-  }
-
-  DCHECK(!ThisOrParentBailedOut());
-
-  if (byte_data_->size() <= kPlaceholderSize) {
-    // The data contains only the placeholder.
-    return MaybeHandle<PreParsedScopeData>();
-  }
-
-  Handle<PreParsedScopeData> data = isolate->factory()->NewPreParsedScopeData();
-
-  Handle<PodArray<uint8_t>> scope_data_array = byte_data_->Serialize(isolate);
-  data->set_scope_data(*scope_data_array);
-
-  int child_data_length = static_cast<int>(data_for_inner_functions_.size());
-  if (child_data_length == 0) {
-    data->set_child_data(*(isolate->factory()->empty_fixed_array()));
-  } else {
-    Handle<FixedArray> child_array =
-        isolate->factory()->NewFixedArray(child_data_length, TENURED);
-    int i = 0;
-    for (const auto& item : data_for_inner_functions_) {
-      MaybeHandle<PreParsedScopeData> maybe_child_data =
-          item->Serialize(isolate);
-      if (maybe_child_data.is_null()) {
-        child_array->set(i++, *(isolate->factory()->null_value()));
-      } else {
-        Handle<PreParsedScopeData> child_data =
-            maybe_child_data.ToHandleChecked();
-        child_array->set(i++, *child_data);
-      }
-    }
-    data->set_child_data(*child_array);
-  }
-
-  return data;
-}
-
-bool ProducedPreParsedScopeData::ScopeNeedsData(Scope* scope) {
-  if (scope->scope_type() == ScopeType::FUNCTION_SCOPE) {
-    // Default constructors don't need data (they cannot contain inner functions
-    // defined by the user). Other functions do.
-    return !IsDefaultConstructor(scope->AsDeclarationScope()->function_kind());
-  }
-  if (!scope->is_hidden()) {
-    for (Variable* var : *scope->locals()) {
-      if (IsDeclaredVariableMode(var->mode())) {
-        return true;
-      }
-    }
-  }
-  for (Scope* inner = scope->inner_scope(); inner != nullptr;
-       inner = inner->sibling()) {
-    if (ScopeNeedsData(inner)) {
-      return true;
-    }
-  }
-  return false;
-}
-
-bool ProducedPreParsedScopeData::ScopeIsSkippableFunctionScope(Scope* scope) {
-  // Lazy non-arrow function scopes are skippable. Lazy functions are exactly
-  // those Scopes which have their own ProducedPreParsedScopeData object. This
-  // logic ensures that the scope allocation data is consistent with the
-  // skippable function data (both agree on where the lazy function boundaries
-  // are).
-  if (scope->scope_type() != ScopeType::FUNCTION_SCOPE) {
-    return false;
-  }
-  DeclarationScope* declaration_scope = scope->AsDeclarationScope();
-  return !declaration_scope->is_arrow_scope() &&
-         declaration_scope->produced_preparsed_scope_data() != nullptr;
-}
-
-void ProducedPreParsedScopeData::SaveDataForScope(Scope* scope) {
-  DCHECK_NE(scope->end_position(), kNoSourcePosition);
-
-  if (!ScopeNeedsData(scope)) {
-    return;
-  }
-
-#ifdef DEBUG
-  byte_data_->WriteUint8(scope->scope_type());
-#endif
-
-  uint8_t eval =
-      ScopeCallsSloppyEvalField::encode(
-          scope->is_declaration_scope() &&
-          scope->AsDeclarationScope()->calls_sloppy_eval()) |
-      InnerScopeCallsEvalField::encode(scope->inner_scope_calls_eval());
-  byte_data_->WriteUint8(eval);
-
-  if (scope->scope_type() == ScopeType::FUNCTION_SCOPE) {
-    Variable* function = scope->AsDeclarationScope()->function_var();
-    if (function != nullptr) {
-      SaveDataForVariable(function);
-    }
-  }
-
-  for (Variable* var : *scope->locals()) {
-    if (IsDeclaredVariableMode(var->mode())) {
-      SaveDataForVariable(var);
-    }
-  }
-
-  SaveDataForInnerScopes(scope);
-}
-
-void ProducedPreParsedScopeData::SaveDataForVariable(Variable* var) {
-#ifdef DEBUG
-  // Store the variable name in debug mode; this way we can check that we
-  // restore data to the correct variable.
-  const AstRawString* name = var->raw_name();
-  byte_data_->WriteUint32(name->length());
-  for (int i = 0; i < name->length(); ++i) {
-    byte_data_->WriteUint8(name->raw_data()[i]);
-  }
-#endif
-  byte variable_data = VariableMaybeAssignedField::encode(
-                           var->maybe_assigned() == kMaybeAssigned) |
-                       VariableContextAllocatedField::encode(
-                           var->has_forced_context_allocation());
-  byte_data_->WriteQuarter(variable_data);
-}
-
-void ProducedPreParsedScopeData::SaveDataForInnerScopes(Scope* scope) {
-  // Inner scopes are stored in the reverse order, but we'd like to write the
-  // data in the logical order. There might be many inner scopes, so we don't
-  // want to recurse here.
-  std::vector<Scope*> scopes;
-  for (Scope* inner = scope->inner_scope(); inner != nullptr;
-       inner = inner->sibling()) {
-    if (ScopeIsSkippableFunctionScope(inner)) {
-      // Don't save data about function scopes, since they'll have their own
-      // ProducedPreParsedScopeData where their data is saved.
-      DCHECK_NOT_NULL(
-          inner->AsDeclarationScope()->produced_preparsed_scope_data());
-      continue;
-    }
-    scopes.push_back(inner);
-  }
-  for (auto it = scopes.rbegin(); it != scopes.rend(); ++it) {
-    SaveDataForScope(*it);
-  }
-}
-
-ConsumedPreParsedScopeData::ByteData::ReadingScope::ReadingScope(
-    ConsumedPreParsedScopeData* parent)
-    : ReadingScope(parent->scope_data_.get(), parent->data_->scope_data()) {}
-
-int32_t ConsumedPreParsedScopeData::ByteData::ReadUint32() {
-  DCHECK_NOT_NULL(data_);
-  DCHECK_GE(RemainingBytes(), kUint32Size);
-#ifdef DEBUG
-  // Check that there indeed is an integer following.
-  DCHECK_EQ(data_->get(index_++), kUint32Size);
-#endif
-  int32_t result = 0;
-  byte* p = reinterpret_cast<byte*>(&result);
-  for (int i = 0; i < 4; ++i) {
-    *p++ = data_->get(index_++);
-  }
-  stored_quarters_ = 0;
-  return result;
-}
-
-uint8_t ConsumedPreParsedScopeData::ByteData::ReadUint8() {
-  DCHECK_NOT_NULL(data_);
-  DCHECK_GE(RemainingBytes(), kUint8Size);
-#ifdef DEBUG
-  // Check that there indeed is a byte following.
-  DCHECK_EQ(data_->get(index_++), kUint8Size);
-#endif
-  stored_quarters_ = 0;
-  return data_->get(index_++);
-}
-
-uint8_t ConsumedPreParsedScopeData::ByteData::ReadQuarter() {
-  DCHECK_NOT_NULL(data_);
-  if (stored_quarters_ == 0) {
-    DCHECK_GE(RemainingBytes(), kUint8Size);
-#ifdef DEBUG
-    // Check that there indeed are quarters following.
-    DCHECK_EQ(data_->get(index_++), kQuarterMarker);
-#endif
-    stored_byte_ = data_->get(index_++);
-    stored_quarters_ = 4;
-  }
-  // Read the first 2 bits from stored_byte_.
-  uint8_t result = (stored_byte_ >> 6) & 3;
-  DCHECK_LE(result, 3);
-  --stored_quarters_;
-  stored_byte_ <<= 2;
-  return result;
-}
-
-ConsumedPreParsedScopeData::ConsumedPreParsedScopeData()
-    : scope_data_(new ByteData()), child_index_(0) {}
-
-ConsumedPreParsedScopeData::~ConsumedPreParsedScopeData() {}
-
-void ConsumedPreParsedScopeData::SetData(Handle<PreParsedScopeData> data) {
-  DCHECK(data->IsPreParsedScopeData());
-  data_ = data;
-#ifdef DEBUG
-  ByteData::ReadingScope reading_scope(this);
-  int scope_data_start = scope_data_->ReadUint32();
-  scope_data_->SetPosition(scope_data_start);
-  DCHECK_EQ(scope_data_->ReadUint32(), kMagicValue);
-#endif
-  // The first data item is scope_data_start. Skip over it.
-  scope_data_->SetPosition(kPlaceholderSize);
-}
-
-ProducedPreParsedScopeData*
-ConsumedPreParsedScopeData::GetDataForSkippableFunction(
-    Zone* zone, int start_position, int* end_position, int* num_parameters,
-    int* num_inner_functions, bool* uses_super_property,
-    LanguageMode* language_mode) {
-  // The skippable function *must* be the next function in the data. Use the
-  // start position as a sanity check.
-  ByteData::ReadingScope reading_scope(this);
-  CHECK_GE(scope_data_->RemainingBytes(), kSkippableFunctionDataSize);
-  int start_position_from_data = scope_data_->ReadUint32();
-  CHECK_EQ(start_position, start_position_from_data);
-
-  *end_position = scope_data_->ReadUint32();
-  DCHECK_GT(*end_position, start_position);
-  *num_parameters = scope_data_->ReadUint32();
-  *num_inner_functions = scope_data_->ReadUint32();
-
-  uint8_t language_and_super = scope_data_->ReadQuarter();
-  *language_mode = LanguageMode(LanguageField::decode(language_and_super));
-  *uses_super_property = UsesSuperField::decode(language_and_super);
-
-  // Retrieve the corresponding PreParsedScopeData and associate it to the
-  // skipped function. If the skipped functions contains inner functions, those
-  // can be skipped when the skipped function is eagerly parsed.
-  FixedArray* children = data_->child_data();
-  CHECK_GT(children->length(), child_index_);
-  Object* child_data = children->get(child_index_++);
-  if (!child_data->IsPreParsedScopeData()) {
-    return nullptr;
-  }
-  Handle<PreParsedScopeData> child_data_handle(
-      PreParsedScopeData::cast(child_data));
-  return new (zone) ProducedPreParsedScopeData(child_data_handle, zone);
-}
-
-void ConsumedPreParsedScopeData::RestoreScopeAllocationData(
-    DeclarationScope* scope) {
-  DCHECK(FLAG_preparser_scope_analysis);
-  DCHECK_EQ(scope->scope_type(), ScopeType::FUNCTION_SCOPE);
-  DCHECK(!data_.is_null());
-
-  ByteData::ReadingScope reading_scope(this);
-
-  int magic_value_from_data = scope_data_->ReadUint32();
-  // Check that we've consumed all inner function data.
-  CHECK_EQ(magic_value_from_data, kMagicValue);
-
-  int start_position_from_data = scope_data_->ReadUint32();
-  int end_position_from_data = scope_data_->ReadUint32();
-  CHECK_EQ(start_position_from_data, scope->start_position());
-  CHECK_EQ(end_position_from_data, scope->end_position());
-
-  RestoreData(scope);
-
-  // Check that we consumed all scope data.
-  DCHECK_EQ(scope_data_->RemainingBytes(), 0);
-}
-
-void ConsumedPreParsedScopeData::RestoreData(Scope* scope) {
-  if (scope->is_declaration_scope() &&
-      scope->AsDeclarationScope()->is_skipped_function()) {
-    return;
-  }
-
-  // It's possible that scope is not present in the data at all (since PreParser
-  // doesn't create the corresponding scope). In this case, the Scope won't
-  // contain any variables for which we need the data.
-  if (!ProducedPreParsedScopeData::ScopeNeedsData(scope)) {
-    return;
-  }
-
-  if (scope_data_->RemainingBytes() < kUint8Size) {
-    // Temporary debugging code for detecting inconsistent data. Write debug
-    // information on the stack, then crash.
-    data_->GetIsolate()->PushStackTraceAndDie(0xC0DEFEE, nullptr, nullptr,
-                                              0xC0DEFEE);
-  }
-
-  // scope_type is stored only in debug mode.
-  CHECK_GE(scope_data_->RemainingBytes(), kUint8Size);
-  DCHECK_EQ(scope_data_->ReadUint8(), scope->scope_type());
-
-  uint32_t eval = scope_data_->ReadUint8();
-  if (ScopeCallsSloppyEvalField::decode(eval)) {
-    scope->RecordEvalCall();
-  }
-  if (InnerScopeCallsEvalField::decode(eval)) {
-    scope->RecordInnerScopeEvalCall();
-  }
-
-  if (scope->scope_type() == ScopeType::FUNCTION_SCOPE) {
-    Variable* function = scope->AsDeclarationScope()->function_var();
-    if (function != nullptr) {
-      RestoreDataForVariable(function);
-    }
-  }
-
-  for (Variable* var : *scope->locals()) {
-    if (IsDeclaredVariableMode(var->mode())) {
-      RestoreDataForVariable(var);
-    }
-  }
-
-  RestoreDataForInnerScopes(scope);
-}
-
-void ConsumedPreParsedScopeData::RestoreDataForVariable(Variable* var) {
-#ifdef DEBUG
-  const AstRawString* name = var->raw_name();
-  DCHECK_EQ(scope_data_->ReadUint32(), static_cast<uint32_t>(name->length()));
-  for (int i = 0; i < name->length(); ++i) {
-    DCHECK_EQ(scope_data_->ReadUint8(), name->raw_data()[i]);
-  }
-#endif
-  uint8_t variable_data = scope_data_->ReadQuarter();
-  if (VariableMaybeAssignedField::decode(variable_data)) {
-    var->set_maybe_assigned();
-  }
-  if (VariableContextAllocatedField::decode(variable_data)) {
-    var->set_is_used();
-    var->ForceContextAllocation();
-  }
-}
-
-void ConsumedPreParsedScopeData::RestoreDataForInnerScopes(Scope* scope) {
-  std::vector<Scope*> scopes;
-  for (Scope* inner = scope->inner_scope(); inner != nullptr;
-       inner = inner->sibling()) {
-    scopes.push_back(inner);
-  }
-  for (auto it = scopes.rbegin(); it != scopes.rend(); ++it) {
-    RestoreData(*it);
-  }
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/parsing/preparsed-scope-data.h b/src/v8/src/parsing/preparsed-scope-data.h
deleted file mode 100644
index b621f06..0000000
--- a/src/v8/src/parsing/preparsed-scope-data.h
+++ /dev/null
@@ -1,258 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_PARSING_PREPARSED_SCOPE_DATA_H_
-#define V8_PARSING_PREPARSED_SCOPE_DATA_H_
-
-#include <set>
-#include <unordered_map>
-#include <vector>
-
-#include "src/globals.h"
-#include "src/handles.h"
-#include "src/objects/shared-function-info.h"
-#include "src/parsing/preparse-data.h"
-#include "src/zone/zone-chunk-list.h"
-
-namespace v8 {
-namespace internal {
-
-template <typename T>
-class Handle;
-
-class PreParser;
-class PreParsedScopeData;
-
-/*
-
-  Skipping inner functions.
-
-  Consider the following code:
-  (function eager_outer() {
-    function lazy_inner() {
-      let a;
-      function skip_me() { a; }
-    }
-
-    return lazy_inner;
-  })();
-
-  ... lazy_inner(); ...
-
-  When parsing the code the first time, eager_outer is parsed and lazy_inner
-  (and everything inside it) is preparsed. When lazy_inner is called, we don't
-  want to parse or preparse skip_me again. Instead, we want to skip over it,
-  since it has already been preparsed once.
-
-  In order to be able to do this, we need to store the information needed for
-  allocating the variables in lazy_inner when we preparse it, and then later do
-  scope allocation based on that data.
-
-  We need the following data for each scope in lazy_inner's scope tree:
-  For each Variable:
-  - is_used
-  - maybe_assigned
-  - has_forced_context_allocation
-
-  For each Scope:
-  - inner_scope_calls_eval_.
-
-  ProducedPreParsedScopeData implements storing the above mentioned data and
-  ConsumedPreParsedScopeData implements restoring it (= setting the context
-  allocation status of the variables in a Scope (and its subscopes) based on the
-  data).
-
- */
-
-class ProducedPreParsedScopeData : public ZoneObject {
- public:
-  class ByteData : public ZoneObject {
-   public:
-    explicit ByteData(Zone* zone)
-        : backing_store_(zone), free_quarters_in_last_byte_(0) {}
-
-    void WriteUint32(uint32_t data);
-    void WriteUint8(uint8_t data);
-    void WriteQuarter(uint8_t data);
-
-    // For overwriting previously written data at position 0.
-    void OverwriteFirstUint32(uint32_t data);
-
-    Handle<PodArray<uint8_t>> Serialize(Isolate* isolate);
-
-    size_t size() const { return backing_store_.size(); }
-
-   private:
-    ZoneChunkList<uint8_t> backing_store_;
-    uint8_t free_quarters_in_last_byte_;
-  };
-
-  // Create a ProducedPreParsedScopeData object which will collect data as we
-  // parse.
-  ProducedPreParsedScopeData(Zone* zone, ProducedPreParsedScopeData* parent);
-
-  // Create a ProducedPreParsedScopeData which is just a proxy for a previous
-  // produced PreParsedScopeData.
-  ProducedPreParsedScopeData(Handle<PreParsedScopeData> data, Zone* zone);
-
-  ProducedPreParsedScopeData* parent() const { return parent_; }
-
-  // For gathering the inner function data and splitting it up according to the
-  // laziness boundaries. Each lazy function gets its own
-  // ProducedPreParsedScopeData, and so do all lazy functions inside it.
-  class DataGatheringScope {
-   public:
-    DataGatheringScope(DeclarationScope* function_scope, PreParser* preparser);
-    ~DataGatheringScope();
-
-    void MarkFunctionAsSkippable(int end_position, int num_inner_functions);
-
-   private:
-    DeclarationScope* function_scope_;
-    PreParser* preparser_;
-    ProducedPreParsedScopeData* produced_preparsed_scope_data_;
-
-    DISALLOW_COPY_AND_ASSIGN(DataGatheringScope);
-  };
-
-  // Saves the information needed for allocating the Scope's (and its
-  // subscopes') variables.
-  void SaveScopeAllocationData(DeclarationScope* scope);
-
-  // In some cases, PreParser cannot produce the same Scope structure as
-  // Parser. If it happens, we're unable to produce the data that would enable
-  // skipping the inner functions of that function.
-  void Bailout() {
-    bailed_out_ = true;
-
-    // We don't need to call Bailout on existing / future children: the only way
-    // to try to retrieve their data is through calling Serialize on the parent,
-    // and if the parent is bailed out, it won't call Serialize on its children.
-  }
-
-  bool bailed_out() const { return bailed_out_; }
-
-#ifdef DEBUG
-  bool ThisOrParentBailedOut() const {
-    if (bailed_out_) {
-      return true;
-    }
-    if (parent_ == nullptr) {
-      return false;
-    }
-    return parent_->ThisOrParentBailedOut();
-  }
-#endif  // DEBUG
-
-  bool ContainsInnerFunctions() const;
-
-  // If there is data (if the Scope contains skippable inner functions), move
-  // the data into the heap and return a Handle to it; otherwise return a null
-  // MaybeHandle.
-  MaybeHandle<PreParsedScopeData> Serialize(Isolate* isolate);
-
-  static bool ScopeNeedsData(Scope* scope);
-  static bool ScopeIsSkippableFunctionScope(Scope* scope);
-
- private:
-  void AddSkippableFunction(int start_position, int end_position,
-                            int num_parameters, int num_inner_functions,
-                            LanguageMode language_mode,
-                            bool uses_super_property);
-
-  void SaveDataForScope(Scope* scope);
-  void SaveDataForVariable(Variable* var);
-  void SaveDataForInnerScopes(Scope* scope);
-
-  ProducedPreParsedScopeData* parent_;
-
-  ByteData* byte_data_;
-  ZoneChunkList<ProducedPreParsedScopeData*> data_for_inner_functions_;
-
-  // Whether we've given up producing the data for this function.
-  bool bailed_out_;
-
-  // ProducedPreParsedScopeData can also mask a Handle<PreParsedScopeData>
-  // which was produced already earlier. This happens for deeper lazy functions.
-  Handle<PreParsedScopeData> previously_produced_preparsed_scope_data_;
-
-  DISALLOW_COPY_AND_ASSIGN(ProducedPreParsedScopeData);
-};
-
-class ConsumedPreParsedScopeData {
- public:
-  class ByteData {
-   public:
-    ByteData()
-        : data_(nullptr), index_(0), stored_quarters_(0), stored_byte_(0) {}
-
-    // Reading from the ByteData is only allowed when a ReadingScope is on the
-    // stack. This ensures that we have a DisallowHeapAllocation in place
-    // whenever ByteData holds a raw pointer into the heap.
-    class ReadingScope {
-     public:
-      ReadingScope(ByteData* consumed_data, PodArray<uint8_t>* data)
-          : consumed_data_(consumed_data) {
-        consumed_data->data_ = data;
-      }
-      explicit ReadingScope(ConsumedPreParsedScopeData* parent);
-      ~ReadingScope() { consumed_data_->data_ = nullptr; }
-
-     private:
-      ByteData* consumed_data_;
-      DisallowHeapAllocation no_gc;
-    };
-
-    void SetPosition(int position) { index_ = position; }
-
-    int32_t ReadUint32();
-    uint8_t ReadUint8();
-    uint8_t ReadQuarter();
-
-    size_t RemainingBytes() const {
-      DCHECK_NOT_NULL(data_);
-      return data_->length() - index_;
-    }
-
-    // private:
-    PodArray<uint8_t>* data_;
-    int index_;
-    uint8_t stored_quarters_;
-    uint8_t stored_byte_;
-  };
-
-  ConsumedPreParsedScopeData();
-  ~ConsumedPreParsedScopeData();
-
-  void SetData(Handle<PreParsedScopeData> data);
-
-  bool HasData() const { return !data_.is_null(); }
-
-  ProducedPreParsedScopeData* GetDataForSkippableFunction(
-      Zone* zone, int start_position, int* end_position, int* num_parameters,
-      int* num_inner_functions, bool* uses_super_property,
-      LanguageMode* language_mode);
-
-  // Restores the information needed for allocating the Scope's (and its
-  // subscopes') variables.
-  void RestoreScopeAllocationData(DeclarationScope* scope);
-
- private:
-  void RestoreData(Scope* scope);
-  void RestoreDataForVariable(Variable* var);
-  void RestoreDataForInnerScopes(Scope* scope);
-
-  Handle<PreParsedScopeData> data_;
-  std::unique_ptr<ByteData> scope_data_;
-  // When consuming the data, these indexes point to the data we're going to
-  // consume next.
-  int child_index_;
-
-  DISALLOW_COPY_AND_ASSIGN(ConsumedPreParsedScopeData);
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_PARSING_PREPARSED_SCOPE_DATA_H_
diff --git a/src/v8/src/ppc/assembler-ppc-inl.h b/src/v8/src/ppc/assembler-ppc-inl.h
deleted file mode 100644
index 451a1af..0000000
--- a/src/v8/src/ppc/assembler-ppc-inl.h
+++ /dev/null
@@ -1,505 +0,0 @@
-// Copyright (c) 1994-2006 Sun Microsystems Inc.
-// 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.
-//
-// - Redistribution 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 Sun Microsystems or the names of 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.
-
-// The original source code covered by the above license above has been modified
-// significantly by Google Inc.
-// Copyright 2014 the V8 project authors. All rights reserved.
-
-#ifndef V8_PPC_ASSEMBLER_PPC_INL_H_
-#define V8_PPC_ASSEMBLER_PPC_INL_H_
-
-#include "src/ppc/assembler-ppc.h"
-
-#include "src/assembler.h"
-#include "src/debug/debug.h"
-#include "src/objects-inl.h"
-
-namespace v8 {
-namespace internal {
-
-
-bool CpuFeatures::SupportsCrankshaft() { return true; }
-
-bool CpuFeatures::SupportsWasmSimd128() { return false; }
-
-void RelocInfo::apply(intptr_t delta) {
-  // absolute code pointer inside code object moves with the code object.
-  if (IsInternalReference(rmode_)) {
-    // Jump table entry
-    Address target = Memory::Address_at(pc_);
-    Memory::Address_at(pc_) = target + delta;
-  } else {
-    // mov sequence
-    DCHECK(IsInternalReferenceEncoded(rmode_));
-    Address target = Assembler::target_address_at(pc_, constant_pool_);
-    Assembler::set_target_address_at(nullptr, pc_, constant_pool_,
-                                     target + delta, SKIP_ICACHE_FLUSH);
-  }
-}
-
-
-Address RelocInfo::target_internal_reference() {
-  if (IsInternalReference(rmode_)) {
-    // Jump table entry
-    return Memory::Address_at(pc_);
-  } else {
-    // mov sequence
-    DCHECK(IsInternalReferenceEncoded(rmode_));
-    return Assembler::target_address_at(pc_, constant_pool_);
-  }
-}
-
-
-Address RelocInfo::target_internal_reference_address() {
-  DCHECK(IsInternalReference(rmode_) || IsInternalReferenceEncoded(rmode_));
-  return reinterpret_cast<Address>(pc_);
-}
-
-
-Address RelocInfo::target_address() {
-  DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) || IsWasmCall(rmode_));
-  return Assembler::target_address_at(pc_, constant_pool_);
-}
-
-Address RelocInfo::target_address_address() {
-  DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) || IsWasmCall(rmode_) ||
-         rmode_ == EMBEDDED_OBJECT || rmode_ == EXTERNAL_REFERENCE);
-
-  if (FLAG_enable_embedded_constant_pool &&
-      Assembler::IsConstantPoolLoadStart(pc_)) {
-    // We return the PC for embedded constant pool since this function is used
-    // by the serializer and expects the address to reside within the code
-    // object.
-    return reinterpret_cast<Address>(pc_);
-  }
-
-  // Read the address of the word containing the target_address in an
-  // instruction stream.
-  // The only architecture-independent user of this function is the serializer.
-  // The serializer uses it to find out how many raw bytes of instruction to
-  // output before the next target.
-  // For an instruction like LIS/ORI where the target bits are mixed into the
-  // instruction bits, the size of the target will be zero, indicating that the
-  // serializer should not step forward in memory after a target is resolved
-  // and written.
-  return reinterpret_cast<Address>(pc_);
-}
-
-
-Address RelocInfo::constant_pool_entry_address() {
-  if (FLAG_enable_embedded_constant_pool) {
-    DCHECK(constant_pool_);
-    ConstantPoolEntry::Access access;
-    if (Assembler::IsConstantPoolLoadStart(pc_, &access))
-      return Assembler::target_constant_pool_address_at(
-          pc_, constant_pool_, access, ConstantPoolEntry::INTPTR);
-  }
-  UNREACHABLE();
-}
-
-
-int RelocInfo::target_address_size() { return Assembler::kSpecialTargetSize; }
-
-Address Assembler::target_address_from_return_address(Address pc) {
-// Returns the address of the call target from the return address that will
-// be returned to after a call.
-// Call sequence is :
-//  mov   ip, @ call address
-//  mtlr  ip
-//  blrl
-//                      @ return address
-  int len;
-  ConstantPoolEntry::Access access;
-  if (FLAG_enable_embedded_constant_pool &&
-      IsConstantPoolLoadEnd(pc - 3 * kInstrSize, &access)) {
-    len = (access == ConstantPoolEntry::OVERFLOWED) ? 2 : 1;
-  } else {
-    len = kMovInstructionsNoConstantPool;
-  }
-  return pc - (len + 2) * kInstrSize;
-}
-
-
-Address Assembler::return_address_from_call_start(Address pc) {
-  int len;
-  ConstantPoolEntry::Access access;
-  if (FLAG_enable_embedded_constant_pool &&
-      IsConstantPoolLoadStart(pc, &access)) {
-    len = (access == ConstantPoolEntry::OVERFLOWED) ? 2 : 1;
-  } else {
-    len = kMovInstructionsNoConstantPool;
-  }
-  return pc + (len + 2) * kInstrSize;
-}
-
-HeapObject* RelocInfo::target_object() {
-  DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
-  return HeapObject::cast(reinterpret_cast<Object*>(
-      Assembler::target_address_at(pc_, constant_pool_)));
-}
-
-Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
-  DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
-  return Handle<HeapObject>(reinterpret_cast<HeapObject**>(
-      Assembler::target_address_at(pc_, constant_pool_)));
-}
-
-void RelocInfo::set_target_object(HeapObject* target,
-                                  WriteBarrierMode write_barrier_mode,
-                                  ICacheFlushMode icache_flush_mode) {
-  DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
-  Assembler::set_target_address_at(target->GetIsolate(), pc_, constant_pool_,
-                                   reinterpret_cast<Address>(target),
-                                   icache_flush_mode);
-  if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != nullptr) {
-    host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(host(), this,
-                                                                  target);
-    host()->GetHeap()->RecordWriteIntoCode(host(), this, target);
-  }
-}
-
-
-Address RelocInfo::target_external_reference() {
-  DCHECK(rmode_ == EXTERNAL_REFERENCE);
-  return Assembler::target_address_at(pc_, constant_pool_);
-}
-
-
-Address RelocInfo::target_runtime_entry(Assembler* origin) {
-  DCHECK(IsRuntimeEntry(rmode_));
-  return target_address();
-}
-
-void RelocInfo::set_target_runtime_entry(Isolate* isolate, Address target,
-                                         WriteBarrierMode write_barrier_mode,
-                                         ICacheFlushMode icache_flush_mode) {
-  DCHECK(IsRuntimeEntry(rmode_));
-  if (target_address() != target)
-    set_target_address(isolate, target, write_barrier_mode, icache_flush_mode);
-}
-
-void RelocInfo::WipeOut(Isolate* isolate) {
-  DCHECK(IsEmbeddedObject(rmode_) || IsCodeTarget(rmode_) ||
-         IsRuntimeEntry(rmode_) || IsExternalReference(rmode_) ||
-         IsInternalReference(rmode_) || IsInternalReferenceEncoded(rmode_));
-  if (IsInternalReference(rmode_)) {
-    // Jump table entry
-    Memory::Address_at(pc_) = nullptr;
-  } else if (IsInternalReferenceEncoded(rmode_)) {
-    // mov sequence
-    // Currently used only by deserializer, no need to flush.
-    Assembler::set_target_address_at(isolate, pc_, constant_pool_, nullptr,
-                                     SKIP_ICACHE_FLUSH);
-  } else {
-    Assembler::set_target_address_at(isolate, pc_, constant_pool_, nullptr);
-  }
-}
-
-template <typename ObjectVisitor>
-void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) {
-  RelocInfo::Mode mode = rmode();
-  if (mode == RelocInfo::EMBEDDED_OBJECT) {
-    visitor->VisitEmbeddedPointer(host(), this);
-  } else if (RelocInfo::IsCodeTarget(mode)) {
-    visitor->VisitCodeTarget(host(), this);
-  } else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
-    visitor->VisitExternalReference(host(), this);
-  } else if (mode == RelocInfo::INTERNAL_REFERENCE ||
-             mode == RelocInfo::INTERNAL_REFERENCE_ENCODED) {
-    visitor->VisitInternalReference(host(), this);
-  } else if (IsRuntimeEntry(mode)) {
-    visitor->VisitRuntimeEntry(host(), this);
-  }
-}
-
-Operand::Operand(Register rm) : rm_(rm), rmode_(kRelocInfo_NONEPTR) {}
-
-void Assembler::UntrackBranch() {
-  DCHECK(!trampoline_emitted_);
-  DCHECK_GT(tracked_branch_count_, 0);
-  int count = --tracked_branch_count_;
-  if (count == 0) {
-    // Reset
-    next_trampoline_check_ = kMaxInt;
-  } else {
-    next_trampoline_check_ += kTrampolineSlotsSize;
-  }
-}
-
-// Fetch the 32bit value from the FIXED_SEQUENCE lis/ori
-Address Assembler::target_address_at(Address pc, Address constant_pool) {
-  if (FLAG_enable_embedded_constant_pool && constant_pool) {
-    ConstantPoolEntry::Access access;
-    if (IsConstantPoolLoadStart(pc, &access))
-      return Memory::Address_at(target_constant_pool_address_at(
-          pc, constant_pool, access, ConstantPoolEntry::INTPTR));
-  }
-
-  Instr instr1 = instr_at(pc);
-  Instr instr2 = instr_at(pc + kInstrSize);
-  // Interpret 2 instructions generated by lis/ori
-  if (IsLis(instr1) && IsOri(instr2)) {
-#if V8_TARGET_ARCH_PPC64
-    Instr instr4 = instr_at(pc + (3 * kInstrSize));
-    Instr instr5 = instr_at(pc + (4 * kInstrSize));
-    // Assemble the 64 bit value.
-    uint64_t hi = (static_cast<uint32_t>((instr1 & kImm16Mask) << 16) |
-                   static_cast<uint32_t>(instr2 & kImm16Mask));
-    uint64_t lo = (static_cast<uint32_t>((instr4 & kImm16Mask) << 16) |
-                   static_cast<uint32_t>(instr5 & kImm16Mask));
-    return reinterpret_cast<Address>((hi << 32) | lo);
-#else
-    // Assemble the 32 bit value.
-    return reinterpret_cast<Address>(((instr1 & kImm16Mask) << 16) |
-                                     (instr2 & kImm16Mask));
-#endif
-  }
-
-  UNREACHABLE();
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-const uint32_t kLoadIntptrOpcode = LD;
-#else
-const uint32_t kLoadIntptrOpcode = LWZ;
-#endif
-
-// Constant pool load sequence detection:
-// 1) REGULAR access:
-//    load <dst>, kConstantPoolRegister + <offset>
-//
-// 2) OVERFLOWED access:
-//    addis <scratch>, kConstantPoolRegister, <offset_high>
-//    load <dst>, <scratch> + <offset_low>
-bool Assembler::IsConstantPoolLoadStart(Address pc,
-                                        ConstantPoolEntry::Access* access) {
-  Instr instr = instr_at(pc);
-  uint32_t opcode = instr & kOpcodeMask;
-  if (GetRA(instr) != kConstantPoolRegister) return false;
-  bool overflowed = (opcode == ADDIS);
-#ifdef DEBUG
-  if (overflowed) {
-    opcode = instr_at(pc + kInstrSize) & kOpcodeMask;
-  }
-  DCHECK(opcode == kLoadIntptrOpcode || opcode == LFD);
-#endif
-  if (access) {
-    *access = (overflowed ? ConstantPoolEntry::OVERFLOWED
-                          : ConstantPoolEntry::REGULAR);
-  }
-  return true;
-}
-
-
-bool Assembler::IsConstantPoolLoadEnd(Address pc,
-                                      ConstantPoolEntry::Access* access) {
-  Instr instr = instr_at(pc);
-  uint32_t opcode = instr & kOpcodeMask;
-  bool overflowed = false;
-  if (!(opcode == kLoadIntptrOpcode || opcode == LFD)) return false;
-  if (GetRA(instr) != kConstantPoolRegister) {
-    instr = instr_at(pc - kInstrSize);
-    opcode = instr & kOpcodeMask;
-    if ((opcode != ADDIS) || GetRA(instr) != kConstantPoolRegister) {
-      return false;
-    }
-    overflowed = true;
-  }
-  if (access) {
-    *access = (overflowed ? ConstantPoolEntry::OVERFLOWED
-                          : ConstantPoolEntry::REGULAR);
-  }
-  return true;
-}
-
-
-int Assembler::GetConstantPoolOffset(Address pc,
-                                     ConstantPoolEntry::Access access,
-                                     ConstantPoolEntry::Type type) {
-  bool overflowed = (access == ConstantPoolEntry::OVERFLOWED);
-#ifdef DEBUG
-  ConstantPoolEntry::Access access_check =
-      static_cast<ConstantPoolEntry::Access>(-1);
-  DCHECK(IsConstantPoolLoadStart(pc, &access_check));
-  DCHECK(access_check == access);
-#endif
-  int offset;
-  if (overflowed) {
-    offset = (instr_at(pc) & kImm16Mask) << 16;
-    offset += SIGN_EXT_IMM16(instr_at(pc + kInstrSize) & kImm16Mask);
-    DCHECK(!is_int16(offset));
-  } else {
-    offset = SIGN_EXT_IMM16((instr_at(pc) & kImm16Mask));
-  }
-  return offset;
-}
-
-
-void Assembler::PatchConstantPoolAccessInstruction(
-    int pc_offset, int offset, ConstantPoolEntry::Access access,
-    ConstantPoolEntry::Type type) {
-  Address pc = buffer_ + pc_offset;
-  bool overflowed = (access == ConstantPoolEntry::OVERFLOWED);
-  CHECK(overflowed != is_int16(offset));
-#ifdef DEBUG
-  ConstantPoolEntry::Access access_check =
-      static_cast<ConstantPoolEntry::Access>(-1);
-  DCHECK(IsConstantPoolLoadStart(pc, &access_check));
-  DCHECK(access_check == access);
-#endif
-  if (overflowed) {
-    int hi_word = static_cast<int>(offset >> 16);
-    int lo_word = static_cast<int>(offset & 0xffff);
-    if (lo_word & 0x8000) hi_word++;
-
-    Instr instr1 = instr_at(pc);
-    Instr instr2 = instr_at(pc + kInstrSize);
-    instr1 &= ~kImm16Mask;
-    instr1 |= (hi_word & kImm16Mask);
-    instr2 &= ~kImm16Mask;
-    instr2 |= (lo_word & kImm16Mask);
-    instr_at_put(pc, instr1);
-    instr_at_put(pc + kInstrSize, instr2);
-  } else {
-    Instr instr = instr_at(pc);
-    instr &= ~kImm16Mask;
-    instr |= (offset & kImm16Mask);
-    instr_at_put(pc, instr);
-  }
-}
-
-
-Address Assembler::target_constant_pool_address_at(
-    Address pc, Address constant_pool, ConstantPoolEntry::Access access,
-    ConstantPoolEntry::Type type) {
-  Address addr = constant_pool;
-  DCHECK(addr);
-  addr += GetConstantPoolOffset(pc, access, type);
-  return addr;
-}
-
-
-// This sets the branch destination (which gets loaded at the call address).
-// This is for calls and branches within generated code.  The serializer
-// has already deserialized the mov instructions etc.
-// There is a FIXED_SEQUENCE assumption here
-void Assembler::deserialization_set_special_target_at(
-    Isolate* isolate, Address instruction_payload, Code* code, Address target) {
-  set_target_address_at(isolate, instruction_payload,
-                        code ? code->constant_pool() : nullptr, target);
-}
-
-
-void Assembler::deserialization_set_target_internal_reference_at(
-    Isolate* isolate, Address pc, Address target, RelocInfo::Mode mode) {
-  if (RelocInfo::IsInternalReferenceEncoded(mode)) {
-    set_target_address_at(isolate, pc, nullptr, target, SKIP_ICACHE_FLUSH);
-  } else {
-    Memory::Address_at(pc) = target;
-  }
-}
-
-
-// This code assumes the FIXED_SEQUENCE of lis/ori
-void Assembler::set_target_address_at(Isolate* isolate, Address pc,
-                                      Address constant_pool, Address target,
-                                      ICacheFlushMode icache_flush_mode) {
-  DCHECK_IMPLIES(isolate == nullptr, icache_flush_mode == SKIP_ICACHE_FLUSH);
-
-  if (FLAG_enable_embedded_constant_pool && constant_pool) {
-    ConstantPoolEntry::Access access;
-    if (IsConstantPoolLoadStart(pc, &access)) {
-      Memory::Address_at(target_constant_pool_address_at(
-          pc, constant_pool, access, ConstantPoolEntry::INTPTR)) = target;
-      return;
-    }
-  }
-
-  Instr instr1 = instr_at(pc);
-  Instr instr2 = instr_at(pc + kInstrSize);
-  // Interpret 2 instructions generated by lis/ori
-  if (IsLis(instr1) && IsOri(instr2)) {
-#if V8_TARGET_ARCH_PPC64
-    Instr instr4 = instr_at(pc + (3 * kInstrSize));
-    Instr instr5 = instr_at(pc + (4 * kInstrSize));
-    // Needs to be fixed up when mov changes to handle 64-bit values.
-    uint32_t* p = reinterpret_cast<uint32_t*>(pc);
-    uintptr_t itarget = reinterpret_cast<uintptr_t>(target);
-
-    instr5 &= ~kImm16Mask;
-    instr5 |= itarget & kImm16Mask;
-    itarget = itarget >> 16;
-
-    instr4 &= ~kImm16Mask;
-    instr4 |= itarget & kImm16Mask;
-    itarget = itarget >> 16;
-
-    instr2 &= ~kImm16Mask;
-    instr2 |= itarget & kImm16Mask;
-    itarget = itarget >> 16;
-
-    instr1 &= ~kImm16Mask;
-    instr1 |= itarget & kImm16Mask;
-    itarget = itarget >> 16;
-
-    *p = instr1;
-    *(p + 1) = instr2;
-    *(p + 3) = instr4;
-    *(p + 4) = instr5;
-    if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
-      Assembler::FlushICache(isolate, p, 5 * kInstrSize);
-    }
-#else
-    uint32_t* p = reinterpret_cast<uint32_t*>(pc);
-    uint32_t itarget = reinterpret_cast<uint32_t>(target);
-    int lo_word = itarget & kImm16Mask;
-    int hi_word = itarget >> 16;
-    instr1 &= ~kImm16Mask;
-    instr1 |= hi_word;
-    instr2 &= ~kImm16Mask;
-    instr2 |= lo_word;
-
-    *p = instr1;
-    *(p + 1) = instr2;
-    if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
-      Assembler::FlushICache(isolate, p, 2 * kInstrSize);
-    }
-#endif
-    return;
-  }
-  UNREACHABLE();
-}
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_PPC_ASSEMBLER_PPC_INL_H_
diff --git a/src/v8/src/ppc/assembler-ppc.cc b/src/v8/src/ppc/assembler-ppc.cc
deleted file mode 100644
index 90b18b0..0000000
--- a/src/v8/src/ppc/assembler-ppc.cc
+++ /dev/null
@@ -1,2160 +0,0 @@
-// Copyright (c) 1994-2006 Sun Microsystems Inc.
-// 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.
-//
-// - Redistribution 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 Sun Microsystems or the names of 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.
-
-// The original source code covered by the above license above has been
-// modified significantly by Google Inc.
-// Copyright 2014 the V8 project authors. All rights reserved.
-
-#include "src/ppc/assembler-ppc.h"
-
-#if V8_TARGET_ARCH_PPC
-
-#include "src/base/bits.h"
-#include "src/base/cpu.h"
-#include "src/code-stubs.h"
-#include "src/macro-assembler.h"
-#include "src/ppc/assembler-ppc-inl.h"
-
-namespace v8 {
-namespace internal {
-
-// Get the CPU features enabled by the build.
-static unsigned CpuFeaturesImpliedByCompiler() {
-  unsigned answer = 0;
-  return answer;
-}
-
-
-void CpuFeatures::ProbeImpl(bool cross_compile) {
-  supported_ |= CpuFeaturesImpliedByCompiler();
-  icache_line_size_ = 128;
-
-  // Only use statically determined features for cross compile (snapshot).
-  if (cross_compile) return;
-
-// Detect whether frim instruction is supported (POWER5+)
-// For now we will just check for processors we know do not
-// support it
-#ifndef USE_SIMULATOR
-  // Probe for additional features at runtime.
-  base::CPU cpu;
-  if (cpu.part() == base::CPU::PPC_POWER9) {
-    supported_ |= (1u << MODULO);
-  }
-#if V8_TARGET_ARCH_PPC64
-  if (cpu.part() == base::CPU::PPC_POWER8) {
-    supported_ |= (1u << FPR_GPR_MOV);
-  }
-#endif
-  if (cpu.part() == base::CPU::PPC_POWER6 ||
-      cpu.part() == base::CPU::PPC_POWER7 ||
-      cpu.part() == base::CPU::PPC_POWER8) {
-    supported_ |= (1u << LWSYNC);
-  }
-  if (cpu.part() == base::CPU::PPC_POWER7 ||
-      cpu.part() == base::CPU::PPC_POWER8) {
-    supported_ |= (1u << ISELECT);
-    supported_ |= (1u << VSX);
-  }
-#if V8_OS_LINUX
-  if (!(cpu.part() == base::CPU::PPC_G5 || cpu.part() == base::CPU::PPC_G4)) {
-    // Assume support
-    supported_ |= (1u << FPU);
-  }
-  if (cpu.icache_line_size() != base::CPU::UNKNOWN_CACHE_LINE_SIZE) {
-    icache_line_size_ = cpu.icache_line_size();
-  }
-#elif V8_OS_AIX
-  // Assume support FP support and default cache line size
-  supported_ |= (1u << FPU);
-#endif
-#else  // Simulator
-  supported_ |= (1u << FPU);
-  supported_ |= (1u << LWSYNC);
-  supported_ |= (1u << ISELECT);
-  supported_ |= (1u << VSX);
-  supported_ |= (1u << MODULO);
-#if V8_TARGET_ARCH_PPC64
-  supported_ |= (1u << FPR_GPR_MOV);
-#endif
-#endif
-}
-
-
-void CpuFeatures::PrintTarget() {
-  const char* ppc_arch = nullptr;
-
-#if V8_TARGET_ARCH_PPC64
-  ppc_arch = "ppc64";
-#else
-  ppc_arch = "ppc";
-#endif
-
-  printf("target %s\n", ppc_arch);
-}
-
-
-void CpuFeatures::PrintFeatures() {
-  printf("FPU=%d\n", CpuFeatures::IsSupported(FPU));
-}
-
-
-Register ToRegister(int num) {
-  DCHECK(num >= 0 && num < kNumRegisters);
-  const Register kRegisters[] = {r0,  sp,  r2,  r3,  r4,  r5,  r6,  r7,
-                                 r8,  r9,  r10, r11, ip,  r13, r14, r15,
-                                 r16, r17, r18, r19, r20, r21, r22, r23,
-                                 r24, r25, r26, r27, r28, r29, r30, fp};
-  return kRegisters[num];
-}
-
-
-// -----------------------------------------------------------------------------
-// Implementation of RelocInfo
-
-const int RelocInfo::kApplyMask = 1 << RelocInfo::INTERNAL_REFERENCE |
-                                  1 << RelocInfo::INTERNAL_REFERENCE_ENCODED;
-
-
-bool RelocInfo::IsCodedSpecially() {
-  // The deserializer needs to know whether a pointer is specially
-  // coded.  Being specially coded on PPC means that it is a lis/ori
-  // instruction sequence or is a constant pool entry, and these are
-  // always the case inside code objects.
-  return true;
-}
-
-
-bool RelocInfo::IsInConstantPool() {
-  if (FLAG_enable_embedded_constant_pool && constant_pool_ != nullptr) {
-    return (constant_pool_ && Assembler::IsConstantPoolLoadStart(pc_));
-  }
-  return false;
-}
-
-Address RelocInfo::embedded_address() const {
-  return Assembler::target_address_at(pc_, constant_pool_);
-}
-
-uint32_t RelocInfo::embedded_size() const {
-  return static_cast<uint32_t>(reinterpret_cast<intptr_t>(
-      Assembler::target_address_at(pc_, constant_pool_)));
-}
-
-void RelocInfo::set_embedded_address(Isolate* isolate, Address address,
-                                     ICacheFlushMode flush_mode) {
-  Assembler::set_target_address_at(isolate, pc_, constant_pool_, address,
-                                   flush_mode);
-}
-
-void RelocInfo::set_embedded_size(Isolate* isolate, uint32_t size,
-                                  ICacheFlushMode flush_mode) {
-  Assembler::set_target_address_at(isolate, pc_, constant_pool_,
-                                   reinterpret_cast<Address>(size), flush_mode);
-}
-
-void RelocInfo::set_js_to_wasm_address(Isolate* isolate, Address address,
-                                       ICacheFlushMode icache_flush_mode) {
-  DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
-  set_embedded_address(isolate, address, icache_flush_mode);
-}
-
-Address RelocInfo::js_to_wasm_address() const {
-  DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
-  return embedded_address();
-}
-
-// -----------------------------------------------------------------------------
-// Implementation of Operand and MemOperand
-// See assembler-ppc-inl.h for inlined constructors
-
-Operand::Operand(Handle<HeapObject> handle) {
-  rm_ = no_reg;
-  value_.immediate = reinterpret_cast<intptr_t>(handle.address());
-  rmode_ = RelocInfo::EMBEDDED_OBJECT;
-}
-
-Operand Operand::EmbeddedNumber(double value) {
-  int32_t smi;
-  if (DoubleToSmiInteger(value, &smi)) return Operand(Smi::FromInt(smi));
-  Operand result(0, RelocInfo::EMBEDDED_OBJECT);
-  result.is_heap_object_request_ = true;
-  result.value_.heap_object_request = HeapObjectRequest(value);
-  return result;
-}
-
-Operand Operand::EmbeddedCode(CodeStub* stub) {
-  Operand result(0, RelocInfo::CODE_TARGET);
-  result.is_heap_object_request_ = true;
-  result.value_.heap_object_request = HeapObjectRequest(stub);
-  return result;
-}
-
-MemOperand::MemOperand(Register rn, int32_t offset)
-    : ra_(rn), offset_(offset), rb_(no_reg) {}
-
-MemOperand::MemOperand(Register ra, Register rb)
-    : ra_(ra), offset_(0), rb_(rb) {}
-
-void Assembler::AllocateAndInstallRequestedHeapObjects(Isolate* isolate) {
-  for (auto& request : heap_object_requests_) {
-    Handle<HeapObject> object;
-    switch (request.kind()) {
-      case HeapObjectRequest::kHeapNumber:
-        object = isolate->factory()->NewHeapNumber(request.heap_number(),
-                                                   IMMUTABLE, TENURED);
-        break;
-      case HeapObjectRequest::kCodeStub:
-        request.code_stub()->set_isolate(isolate);
-        object = request.code_stub()->GetCode();
-        break;
-    }
-    Address pc = buffer_ + request.offset();
-    Address constant_pool = nullptr;
-    set_target_address_at(nullptr, pc, constant_pool,
-                          reinterpret_cast<Address>(object.location()),
-                          SKIP_ICACHE_FLUSH);
-  }
-}
-
-// -----------------------------------------------------------------------------
-// Specific instructions, constants, and masks.
-
-Assembler::Assembler(IsolateData isolate_data, void* buffer, int buffer_size)
-    : AssemblerBase(isolate_data, buffer, buffer_size),
-      constant_pool_builder_(kLoadPtrMaxReachBits, kLoadDoubleMaxReachBits) {
-  reloc_info_writer.Reposition(buffer_ + buffer_size_, pc_);
-
-  no_trampoline_pool_before_ = 0;
-  trampoline_pool_blocked_nesting_ = 0;
-  constant_pool_entry_sharing_blocked_nesting_ = 0;
-  next_trampoline_check_ = kMaxInt;
-  internal_trampoline_exception_ = false;
-  last_bound_pos_ = 0;
-  optimizable_cmpi_pos_ = -1;
-  trampoline_emitted_ = FLAG_force_long_branches;
-  tracked_branch_count_ = 0;
-  relocations_.reserve(128);
-}
-
-void Assembler::GetCode(Isolate* isolate, CodeDesc* desc) {
-  // Emit constant pool if necessary.
-  int constant_pool_offset = EmitConstantPool();
-
-  EmitRelocations();
-  AllocateAndInstallRequestedHeapObjects(isolate);
-
-  // Set up code descriptor.
-  desc->buffer = buffer_;
-  desc->buffer_size = buffer_size_;
-  desc->instr_size = pc_offset();
-  desc->reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos();
-  desc->constant_pool_size =
-      (constant_pool_offset ? desc->instr_size - constant_pool_offset : 0);
-  desc->origin = this;
-  desc->unwinding_info_size = 0;
-  desc->unwinding_info = nullptr;
-}
-
-
-void Assembler::Align(int m) {
-  DCHECK(m >= 4 && base::bits::IsPowerOfTwo(m));
-  DCHECK_EQ(pc_offset() & (kInstrSize - 1), 0);
-  while ((pc_offset() & (m - 1)) != 0) {
-    nop();
-  }
-}
-
-
-void Assembler::CodeTargetAlign() { Align(8); }
-
-
-Condition Assembler::GetCondition(Instr instr) {
-  switch (instr & kCondMask) {
-    case BT:
-      return eq;
-    case BF:
-      return ne;
-    default:
-      UNIMPLEMENTED();
-  }
-  return al;
-}
-
-
-bool Assembler::IsLis(Instr instr) {
-  return ((instr & kOpcodeMask) == ADDIS) && GetRA(instr) == r0;
-}
-
-
-bool Assembler::IsLi(Instr instr) {
-  return ((instr & kOpcodeMask) == ADDI) && GetRA(instr) == r0;
-}
-
-
-bool Assembler::IsAddic(Instr instr) { return (instr & kOpcodeMask) == ADDIC; }
-
-
-bool Assembler::IsOri(Instr instr) { return (instr & kOpcodeMask) == ORI; }
-
-
-bool Assembler::IsBranch(Instr instr) { return ((instr & kOpcodeMask) == BCX); }
-
-
-Register Assembler::GetRA(Instr instr) {
-  return Register::from_code(Instruction::RAValue(instr));
-}
-
-
-Register Assembler::GetRB(Instr instr) {
-  return Register::from_code(Instruction::RBValue(instr));
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-// This code assumes a FIXED_SEQUENCE for 64bit loads (lis/ori)
-bool Assembler::Is64BitLoadIntoR12(Instr instr1, Instr instr2, Instr instr3,
-                                   Instr instr4, Instr instr5) {
-  // Check the instructions are indeed a five part load (into r12)
-  // 3d800000       lis     r12, 0
-  // 618c0000       ori     r12, r12, 0
-  // 798c07c6       rldicr  r12, r12, 32, 31
-  // 658c00c3       oris    r12, r12, 195
-  // 618ccd40       ori     r12, r12, 52544
-  return (((instr1 >> 16) == 0x3D80) && ((instr2 >> 16) == 0x618C) &&
-          (instr3 == 0x798C07C6) && ((instr4 >> 16) == 0x658C) &&
-          ((instr5 >> 16) == 0x618C));
-}
-#else
-// This code assumes a FIXED_SEQUENCE for 32bit loads (lis/ori)
-bool Assembler::Is32BitLoadIntoR12(Instr instr1, Instr instr2) {
-  // Check the instruction is indeed a two part load (into r12)
-  // 3d802553       lis     r12, 9555
-  // 618c5000       ori   r12, r12, 20480
-  return (((instr1 >> 16) == 0x3D80) && ((instr2 >> 16) == 0x618C));
-}
-#endif
-
-
-bool Assembler::IsCmpRegister(Instr instr) {
-  return (((instr & kOpcodeMask) == EXT2) &&
-          ((EXT2 | (instr & kExt2OpcodeMask)) == CMP));
-}
-
-
-bool Assembler::IsRlwinm(Instr instr) {
-  return ((instr & kOpcodeMask) == RLWINMX);
-}
-
-
-bool Assembler::IsAndi(Instr instr) { return ((instr & kOpcodeMask) == ANDIx); }
-
-
-#if V8_TARGET_ARCH_PPC64
-bool Assembler::IsRldicl(Instr instr) {
-  return (((instr & kOpcodeMask) == EXT5) &&
-          ((EXT5 | (instr & kExt5OpcodeMask)) == RLDICL));
-}
-#endif
-
-
-bool Assembler::IsCmpImmediate(Instr instr) {
-  return ((instr & kOpcodeMask) == CMPI);
-}
-
-
-bool Assembler::IsCrSet(Instr instr) {
-  return (((instr & kOpcodeMask) == EXT1) &&
-          ((EXT1 | (instr & kExt1OpcodeMask)) == CREQV));
-}
-
-
-Register Assembler::GetCmpImmediateRegister(Instr instr) {
-  DCHECK(IsCmpImmediate(instr));
-  return GetRA(instr);
-}
-
-
-int Assembler::GetCmpImmediateRawImmediate(Instr instr) {
-  DCHECK(IsCmpImmediate(instr));
-  return instr & kOff16Mask;
-}
-
-
-// Labels refer to positions in the (to be) generated code.
-// There are bound, linked, and unused labels.
-//
-// Bound labels refer to known positions in the already
-// generated code. pos() is the position the label refers to.
-//
-// Linked labels refer to unknown positions in the code
-// to be generated; pos() is the position of the last
-// instruction using the label.
-
-
-// The link chain is terminated by a negative code position (must be aligned)
-const int kEndOfChain = -4;
-
-
-// Dummy opcodes for unbound label mov instructions or jump table entries.
-enum {
-  kUnboundMovLabelOffsetOpcode = 0 << 26,
-  kUnboundAddLabelOffsetOpcode = 1 << 26,
-  kUnboundMovLabelAddrOpcode = 2 << 26,
-  kUnboundJumpTableEntryOpcode = 3 << 26
-};
-
-
-int Assembler::target_at(int pos) {
-  Instr instr = instr_at(pos);
-  // check which type of branch this is 16 or 26 bit offset
-  uint32_t opcode = instr & kOpcodeMask;
-  int link;
-  switch (opcode) {
-    case BX:
-      link = SIGN_EXT_IMM26(instr & kImm26Mask);
-      link &= ~(kAAMask | kLKMask);  // discard AA|LK bits if present
-      break;
-    case BCX:
-      link = SIGN_EXT_IMM16((instr & kImm16Mask));
-      link &= ~(kAAMask | kLKMask);  // discard AA|LK bits if present
-      break;
-    case kUnboundMovLabelOffsetOpcode:
-    case kUnboundAddLabelOffsetOpcode:
-    case kUnboundMovLabelAddrOpcode:
-    case kUnboundJumpTableEntryOpcode:
-      link = SIGN_EXT_IMM26(instr & kImm26Mask);
-      link <<= 2;
-      break;
-    default:
-      DCHECK(false);
-      return -1;
-  }
-
-  if (link == 0) return kEndOfChain;
-  return pos + link;
-}
-
-
-void Assembler::target_at_put(int pos, int target_pos, bool* is_branch) {
-  Instr instr = instr_at(pos);
-  uint32_t opcode = instr & kOpcodeMask;
-
-  if (is_branch != nullptr) {
-    *is_branch = (opcode == BX || opcode == BCX);
-  }
-
-  switch (opcode) {
-    case BX: {
-      int imm26 = target_pos - pos;
-      CHECK(is_int26(imm26) && (imm26 & (kAAMask | kLKMask)) == 0);
-      if (imm26 == kInstrSize && !(instr & kLKMask)) {
-        // Branch to next instr without link.
-        instr = ORI;  // nop: ori, 0,0,0
-      } else {
-        instr &= ((~kImm26Mask) | kAAMask | kLKMask);
-        instr |= (imm26 & kImm26Mask);
-      }
-      instr_at_put(pos, instr);
-      break;
-    }
-    case BCX: {
-      int imm16 = target_pos - pos;
-      CHECK(is_int16(imm16) && (imm16 & (kAAMask | kLKMask)) == 0);
-      if (imm16 == kInstrSize && !(instr & kLKMask)) {
-        // Branch to next instr without link.
-        instr = ORI;  // nop: ori, 0,0,0
-      } else {
-        instr &= ((~kImm16Mask) | kAAMask | kLKMask);
-        instr |= (imm16 & kImm16Mask);
-      }
-      instr_at_put(pos, instr);
-      break;
-    }
-    case kUnboundMovLabelOffsetOpcode: {
-      // Load the position of the label relative to the generated code object
-      // pointer in a register.
-      Register dst = Register::from_code(instr_at(pos + kInstrSize));
-      int32_t offset = target_pos + (Code::kHeaderSize - kHeapObjectTag);
-      PatchingAssembler patcher(isolate_data(),
-                                reinterpret_cast<byte*>(buffer_ + pos), 2);
-      patcher.bitwise_mov32(dst, offset);
-      break;
-    }
-    case kUnboundAddLabelOffsetOpcode: {
-      // dst = base + position + immediate
-      Instr operands = instr_at(pos + kInstrSize);
-      Register dst = Register::from_code((operands >> 21) & 0x1F);
-      Register base = Register::from_code((operands >> 16) & 0x1F);
-      int32_t offset = target_pos + SIGN_EXT_IMM16(operands & kImm16Mask);
-      PatchingAssembler patcher(isolate_data(),
-                                reinterpret_cast<byte*>(buffer_ + pos), 2);
-      patcher.bitwise_add32(dst, base, offset);
-      break;
-    }
-    case kUnboundMovLabelAddrOpcode: {
-      // Load the address of the label in a register.
-      Register dst = Register::from_code(instr_at(pos + kInstrSize));
-      PatchingAssembler patcher(isolate_data(),
-                                reinterpret_cast<byte*>(buffer_ + pos),
-                                kMovInstructionsNoConstantPool);
-      // Keep internal references relative until EmitRelocations.
-      patcher.bitwise_mov(dst, target_pos);
-      break;
-    }
-    case kUnboundJumpTableEntryOpcode: {
-      PatchingAssembler patcher(isolate_data(),
-                                reinterpret_cast<byte*>(buffer_ + pos),
-                                kPointerSize / kInstrSize);
-      // Keep internal references relative until EmitRelocations.
-      patcher.dp(target_pos);
-      break;
-    }
-    default:
-      DCHECK(false);
-      break;
-  }
-}
-
-
-int Assembler::max_reach_from(int pos) {
-  Instr instr = instr_at(pos);
-  uint32_t opcode = instr & kOpcodeMask;
-
-  // check which type of branch this is 16 or 26 bit offset
-  switch (opcode) {
-    case BX:
-      return 26;
-    case BCX:
-      return 16;
-    case kUnboundMovLabelOffsetOpcode:
-    case kUnboundAddLabelOffsetOpcode:
-    case kUnboundMovLabelAddrOpcode:
-    case kUnboundJumpTableEntryOpcode:
-      return 0;  // no limit on reach
-  }
-
-  DCHECK(false);
-  return 0;
-}
-
-
-void Assembler::bind_to(Label* L, int pos) {
-  DCHECK(0 <= pos && pos <= pc_offset());  // must have a valid binding position
-  int32_t trampoline_pos = kInvalidSlotPos;
-  bool is_branch = false;
-  while (L->is_linked()) {
-    int fixup_pos = L->pos();
-    int32_t offset = pos - fixup_pos;
-    int maxReach = max_reach_from(fixup_pos);
-    next(L);  // call next before overwriting link with target at fixup_pos
-    if (maxReach && is_intn(offset, maxReach) == false) {
-      if (trampoline_pos == kInvalidSlotPos) {
-        trampoline_pos = get_trampoline_entry();
-        CHECK_NE(trampoline_pos, kInvalidSlotPos);
-        target_at_put(trampoline_pos, pos);
-      }
-      target_at_put(fixup_pos, trampoline_pos);
-    } else {
-      target_at_put(fixup_pos, pos, &is_branch);
-    }
-  }
-  L->bind_to(pos);
-
-  if (!trampoline_emitted_ && is_branch) {
-    UntrackBranch();
-  }
-
-  // Keep track of the last bound label so we don't eliminate any instructions
-  // before a bound label.
-  if (pos > last_bound_pos_) last_bound_pos_ = pos;
-}
-
-
-void Assembler::bind(Label* L) {
-  DCHECK(!L->is_bound());  // label can only be bound once
-  bind_to(L, pc_offset());
-}
-
-
-void Assembler::next(Label* L) {
-  DCHECK(L->is_linked());
-  int link = target_at(L->pos());
-  if (link == kEndOfChain) {
-    L->Unuse();
-  } else {
-    DCHECK_GE(link, 0);
-    L->link_to(link);
-  }
-}
-
-
-bool Assembler::is_near(Label* L, Condition cond) {
-  DCHECK(L->is_bound());
-  if (L->is_bound() == false) return false;
-
-  int maxReach = ((cond == al) ? 26 : 16);
-  int offset = L->pos() - pc_offset();
-
-  return is_intn(offset, maxReach);
-}
-
-
-void Assembler::a_form(Instr instr, DoubleRegister frt, DoubleRegister fra,
-                       DoubleRegister frb, RCBit r) {
-  emit(instr | frt.code() * B21 | fra.code() * B16 | frb.code() * B11 | r);
-}
-
-
-void Assembler::d_form(Instr instr, Register rt, Register ra,
-                       const intptr_t val, bool signed_disp) {
-  if (signed_disp) {
-    if (!is_int16(val)) {
-      PrintF("val = %" V8PRIdPTR ", 0x%" V8PRIxPTR "\n", val, val);
-    }
-    CHECK(is_int16(val));
-  } else {
-    if (!is_uint16(val)) {
-      PrintF("val = %" V8PRIdPTR ", 0x%" V8PRIxPTR
-             ", is_unsigned_imm16(val)=%d, kImm16Mask=0x%x\n",
-             val, val, is_uint16(val), kImm16Mask);
-    }
-    CHECK(is_uint16(val));
-  }
-  emit(instr | rt.code() * B21 | ra.code() * B16 | (kImm16Mask & val));
-}
-
-void Assembler::xo_form(Instr instr, Register rt, Register ra, Register rb,
-                        OEBit o, RCBit r) {
-  emit(instr | rt.code() * B21 | ra.code() * B16 | rb.code() * B11 | o | r);
-}
-
-void Assembler::md_form(Instr instr, Register ra, Register rs, int shift,
-                        int maskbit, RCBit r) {
-  int sh0_4 = shift & 0x1F;
-  int sh5 = (shift >> 5) & 0x1;
-  int m0_4 = maskbit & 0x1F;
-  int m5 = (maskbit >> 5) & 0x1;
-
-  emit(instr | rs.code() * B21 | ra.code() * B16 | sh0_4 * B11 | m0_4 * B6 |
-       m5 * B5 | sh5 * B1 | r);
-}
-
-
-void Assembler::mds_form(Instr instr, Register ra, Register rs, Register rb,
-                         int maskbit, RCBit r) {
-  int m0_4 = maskbit & 0x1F;
-  int m5 = (maskbit >> 5) & 0x1;
-
-  emit(instr | rs.code() * B21 | ra.code() * B16 | rb.code() * B11 | m0_4 * B6 |
-       m5 * B5 | r);
-}
-
-
-// Returns the next free trampoline entry.
-int32_t Assembler::get_trampoline_entry() {
-  int32_t trampoline_entry = kInvalidSlotPos;
-
-  if (!internal_trampoline_exception_) {
-    trampoline_entry = trampoline_.take_slot();
-
-    if (kInvalidSlotPos == trampoline_entry) {
-      internal_trampoline_exception_ = true;
-    }
-  }
-  return trampoline_entry;
-}
-
-
-int Assembler::link(Label* L) {
-  int position;
-  if (L->is_bound()) {
-    position = L->pos();
-  } else {
-    if (L->is_linked()) {
-      position = L->pos();  // L's link
-    } else {
-      // was: target_pos = kEndOfChain;
-      // However, using self to mark the first reference
-      // should avoid most instances of branch offset overflow.  See
-      // target_at() for where this is converted back to kEndOfChain.
-      position = pc_offset();
-    }
-    L->link_to(pc_offset());
-  }
-
-  return position;
-}
-
-
-// Branch instructions.
-
-
-void Assembler::bclr(BOfield bo, int condition_bit, LKBit lk) {
-  emit(EXT1 | bo | condition_bit * B16 | BCLRX | lk);
-}
-
-
-void Assembler::bcctr(BOfield bo, int condition_bit, LKBit lk) {
-  emit(EXT1 | bo | condition_bit * B16 | BCCTRX | lk);
-}
-
-
-// Pseudo op - branch to link register
-void Assembler::blr() { bclr(BA, 0, LeaveLK); }
-
-
-// Pseudo op - branch to count register -- used for "jump"
-void Assembler::bctr() { bcctr(BA, 0, LeaveLK); }
-
-
-void Assembler::bctrl() { bcctr(BA, 0, SetLK); }
-
-
-void Assembler::bc(int branch_offset, BOfield bo, int condition_bit, LKBit lk) {
-  int imm16 = branch_offset;
-  CHECK(is_int16(imm16) && (imm16 & (kAAMask | kLKMask)) == 0);
-  emit(BCX | bo | condition_bit * B16 | (imm16 & kImm16Mask) | lk);
-}
-
-
-void Assembler::b(int branch_offset, LKBit lk) {
-  int imm26 = branch_offset;
-  CHECK(is_int26(imm26) && (imm26 & (kAAMask | kLKMask)) == 0);
-  emit(BX | (imm26 & kImm26Mask) | lk);
-}
-
-
-void Assembler::xori(Register dst, Register src, const Operand& imm) {
-  d_form(XORI, src, dst, imm.immediate(), false);
-}
-
-
-void Assembler::xoris(Register ra, Register rs, const Operand& imm) {
-  d_form(XORIS, rs, ra, imm.immediate(), false);
-}
-
-
-void Assembler::rlwinm(Register ra, Register rs, int sh, int mb, int me,
-                       RCBit rc) {
-  sh &= 0x1F;
-  mb &= 0x1F;
-  me &= 0x1F;
-  emit(RLWINMX | rs.code() * B21 | ra.code() * B16 | sh * B11 | mb * B6 |
-       me << 1 | rc);
-}
-
-
-void Assembler::rlwnm(Register ra, Register rs, Register rb, int mb, int me,
-                      RCBit rc) {
-  mb &= 0x1F;
-  me &= 0x1F;
-  emit(RLWNMX | rs.code() * B21 | ra.code() * B16 | rb.code() * B11 | mb * B6 |
-       me << 1 | rc);
-}
-
-
-void Assembler::rlwimi(Register ra, Register rs, int sh, int mb, int me,
-                       RCBit rc) {
-  sh &= 0x1F;
-  mb &= 0x1F;
-  me &= 0x1F;
-  emit(RLWIMIX | rs.code() * B21 | ra.code() * B16 | sh * B11 | mb * B6 |
-       me << 1 | rc);
-}
-
-
-void Assembler::slwi(Register dst, Register src, const Operand& val, RCBit rc) {
-  DCHECK((32 > val.immediate()) && (val.immediate() >= 0));
-  rlwinm(dst, src, val.immediate(), 0, 31 - val.immediate(), rc);
-}
-
-
-void Assembler::srwi(Register dst, Register src, const Operand& val, RCBit rc) {
-  DCHECK((32 > val.immediate()) && (val.immediate() >= 0));
-  rlwinm(dst, src, 32 - val.immediate(), val.immediate(), 31, rc);
-}
-
-
-void Assembler::clrrwi(Register dst, Register src, const Operand& val,
-                       RCBit rc) {
-  DCHECK((32 > val.immediate()) && (val.immediate() >= 0));
-  rlwinm(dst, src, 0, 0, 31 - val.immediate(), rc);
-}
-
-
-void Assembler::clrlwi(Register dst, Register src, const Operand& val,
-                       RCBit rc) {
-  DCHECK((32 > val.immediate()) && (val.immediate() >= 0));
-  rlwinm(dst, src, 0, val.immediate(), 31, rc);
-}
-
-
-void Assembler::rotlw(Register ra, Register rs, Register rb, RCBit r) {
-  rlwnm(ra, rs, rb, 0, 31, r);
-}
-
-
-void Assembler::rotlwi(Register ra, Register rs, int sh, RCBit r) {
-  rlwinm(ra, rs, sh, 0, 31, r);
-}
-
-
-void Assembler::rotrwi(Register ra, Register rs, int sh, RCBit r) {
-  rlwinm(ra, rs, 32 - sh, 0, 31, r);
-}
-
-
-void Assembler::subi(Register dst, Register src, const Operand& imm) {
-  addi(dst, src, Operand(-(imm.immediate())));
-}
-
-void Assembler::addc(Register dst, Register src1, Register src2, OEBit o,
-                     RCBit r) {
-  xo_form(EXT2 | ADDCX, dst, src1, src2, o, r);
-}
-
-void Assembler::adde(Register dst, Register src1, Register src2, OEBit o,
-                     RCBit r) {
-  xo_form(EXT2 | ADDEX, dst, src1, src2, o, r);
-}
-
-void Assembler::addze(Register dst, Register src1, OEBit o, RCBit r) {
-  // a special xo_form
-  emit(EXT2 | ADDZEX | dst.code() * B21 | src1.code() * B16 | o | r);
-}
-
-
-void Assembler::sub(Register dst, Register src1, Register src2, OEBit o,
-                    RCBit r) {
-  xo_form(EXT2 | SUBFX, dst, src2, src1, o, r);
-}
-
-void Assembler::subc(Register dst, Register src1, Register src2, OEBit o,
-                     RCBit r) {
-  xo_form(EXT2 | SUBFCX, dst, src2, src1, o, r);
-}
-
-void Assembler::sube(Register dst, Register src1, Register src2, OEBit o,
-                     RCBit r) {
-  xo_form(EXT2 | SUBFEX, dst, src2, src1, o, r);
-}
-
-void Assembler::subfic(Register dst, Register src, const Operand& imm) {
-  d_form(SUBFIC, dst, src, imm.immediate(), true);
-}
-
-
-void Assembler::add(Register dst, Register src1, Register src2, OEBit o,
-                    RCBit r) {
-  xo_form(EXT2 | ADDX, dst, src1, src2, o, r);
-}
-
-
-// Multiply low word
-void Assembler::mullw(Register dst, Register src1, Register src2, OEBit o,
-                      RCBit r) {
-  xo_form(EXT2 | MULLW, dst, src1, src2, o, r);
-}
-
-
-// Multiply hi word
-void Assembler::mulhw(Register dst, Register src1, Register src2, RCBit r) {
-  xo_form(EXT2 | MULHWX, dst, src1, src2, LeaveOE, r);
-}
-
-
-// Multiply hi word unsigned
-void Assembler::mulhwu(Register dst, Register src1, Register src2, RCBit r) {
-  xo_form(EXT2 | MULHWUX, dst, src1, src2, LeaveOE, r);
-}
-
-
-// Divide word
-void Assembler::divw(Register dst, Register src1, Register src2, OEBit o,
-                     RCBit r) {
-  xo_form(EXT2 | DIVW, dst, src1, src2, o, r);
-}
-
-
-// Divide word unsigned
-void Assembler::divwu(Register dst, Register src1, Register src2, OEBit o,
-                      RCBit r) {
-  xo_form(EXT2 | DIVWU, dst, src1, src2, o, r);
-}
-
-
-void Assembler::addi(Register dst, Register src, const Operand& imm) {
-  DCHECK(src != r0);  // use li instead to show intent
-  d_form(ADDI, dst, src, imm.immediate(), true);
-}
-
-
-void Assembler::addis(Register dst, Register src, const Operand& imm) {
-  DCHECK(src != r0);  // use lis instead to show intent
-  d_form(ADDIS, dst, src, imm.immediate(), true);
-}
-
-
-void Assembler::addic(Register dst, Register src, const Operand& imm) {
-  d_form(ADDIC, dst, src, imm.immediate(), true);
-}
-
-
-void Assembler::andi(Register ra, Register rs, const Operand& imm) {
-  d_form(ANDIx, rs, ra, imm.immediate(), false);
-}
-
-
-void Assembler::andis(Register ra, Register rs, const Operand& imm) {
-  d_form(ANDISx, rs, ra, imm.immediate(), false);
-}
-
-
-void Assembler::ori(Register ra, Register rs, const Operand& imm) {
-  d_form(ORI, rs, ra, imm.immediate(), false);
-}
-
-
-void Assembler::oris(Register dst, Register src, const Operand& imm) {
-  d_form(ORIS, src, dst, imm.immediate(), false);
-}
-
-
-void Assembler::cmpi(Register src1, const Operand& src2, CRegister cr) {
-  intptr_t imm16 = src2.immediate();
-#if V8_TARGET_ARCH_PPC64
-  int L = 1;
-#else
-  int L = 0;
-#endif
-  DCHECK(is_int16(imm16));
-  DCHECK(cr.code() >= 0 && cr.code() <= 7);
-  imm16 &= kImm16Mask;
-  emit(CMPI | cr.code() * B23 | L * B21 | src1.code() * B16 | imm16);
-}
-
-
-void Assembler::cmpli(Register src1, const Operand& src2, CRegister cr) {
-  uintptr_t uimm16 = src2.immediate();
-#if V8_TARGET_ARCH_PPC64
-  int L = 1;
-#else
-  int L = 0;
-#endif
-  DCHECK(is_uint16(uimm16));
-  DCHECK(cr.code() >= 0 && cr.code() <= 7);
-  uimm16 &= kImm16Mask;
-  emit(CMPLI | cr.code() * B23 | L * B21 | src1.code() * B16 | uimm16);
-}
-
-
-void Assembler::cmpwi(Register src1, const Operand& src2, CRegister cr) {
-  intptr_t imm16 = src2.immediate();
-  int L = 0;
-  int pos = pc_offset();
-  DCHECK(is_int16(imm16));
-  DCHECK(cr.code() >= 0 && cr.code() <= 7);
-  imm16 &= kImm16Mask;
-
-  // For cmpwi against 0, save postition and cr for later examination
-  // of potential optimization.
-  if (imm16 == 0 && pos > 0 && last_bound_pos_ != pos) {
-    optimizable_cmpi_pos_ = pos;
-    cmpi_cr_ = cr;
-  }
-  emit(CMPI | cr.code() * B23 | L * B21 | src1.code() * B16 | imm16);
-}
-
-
-void Assembler::cmplwi(Register src1, const Operand& src2, CRegister cr) {
-  uintptr_t uimm16 = src2.immediate();
-  int L = 0;
-  DCHECK(is_uint16(uimm16));
-  DCHECK(cr.code() >= 0 && cr.code() <= 7);
-  uimm16 &= kImm16Mask;
-  emit(CMPLI | cr.code() * B23 | L * B21 | src1.code() * B16 | uimm16);
-}
-
-
-void Assembler::isel(Register rt, Register ra, Register rb, int cb) {
-  emit(EXT2 | ISEL | rt.code() * B21 | ra.code() * B16 | rb.code() * B11 |
-       cb * B6);
-}
-
-
-// Pseudo op - load immediate
-void Assembler::li(Register dst, const Operand& imm) {
-  d_form(ADDI, dst, r0, imm.immediate(), true);
-}
-
-
-void Assembler::lis(Register dst, const Operand& imm) {
-  d_form(ADDIS, dst, r0, imm.immediate(), true);
-}
-
-
-// Pseudo op - move register
-void Assembler::mr(Register dst, Register src) {
-  // actually or(dst, src, src)
-  orx(dst, src, src);
-}
-
-
-void Assembler::lbz(Register dst, const MemOperand& src) {
-  DCHECK(src.ra_ != r0);
-  d_form(LBZ, dst, src.ra(), src.offset(), true);
-}
-
-
-void Assembler::lhz(Register dst, const MemOperand& src) {
-  DCHECK(src.ra_ != r0);
-  d_form(LHZ, dst, src.ra(), src.offset(), true);
-}
-
-
-void Assembler::lwz(Register dst, const MemOperand& src) {
-  DCHECK(src.ra_ != r0);
-  d_form(LWZ, dst, src.ra(), src.offset(), true);
-}
-
-
-void Assembler::lwzu(Register dst, const MemOperand& src) {
-  DCHECK(src.ra_ != r0);
-  d_form(LWZU, dst, src.ra(), src.offset(), true);
-}
-
-
-void Assembler::lha(Register dst, const MemOperand& src) {
-  DCHECK(src.ra_ != r0);
-  d_form(LHA, dst, src.ra(), src.offset(), true);
-}
-
-
-void Assembler::lwa(Register dst, const MemOperand& src) {
-#if V8_TARGET_ARCH_PPC64
-  int offset = src.offset();
-  DCHECK(src.ra_ != r0);
-  CHECK(!(offset & 3) && is_int16(offset));
-  offset = kImm16Mask & offset;
-  emit(LD | dst.code() * B21 | src.ra().code() * B16 | offset | 2);
-#else
-  lwz(dst, src);
-#endif
-}
-
-void Assembler::stb(Register dst, const MemOperand& src) {
-  DCHECK(src.ra_ != r0);
-  d_form(STB, dst, src.ra(), src.offset(), true);
-}
-
-
-void Assembler::sth(Register dst, const MemOperand& src) {
-  DCHECK(src.ra_ != r0);
-  d_form(STH, dst, src.ra(), src.offset(), true);
-}
-
-
-void Assembler::stw(Register dst, const MemOperand& src) {
-  DCHECK(src.ra_ != r0);
-  d_form(STW, dst, src.ra(), src.offset(), true);
-}
-
-
-void Assembler::stwu(Register dst, const MemOperand& src) {
-  DCHECK(src.ra_ != r0);
-  d_form(STWU, dst, src.ra(), src.offset(), true);
-}
-
-
-void Assembler::neg(Register rt, Register ra, OEBit o, RCBit r) {
-  emit(EXT2 | NEGX | rt.code() * B21 | ra.code() * B16 | o | r);
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-// 64bit specific instructions
-void Assembler::ld(Register rd, const MemOperand& src) {
-  int offset = src.offset();
-  DCHECK(src.ra_ != r0);
-  CHECK(!(offset & 3) && is_int16(offset));
-  offset = kImm16Mask & offset;
-  emit(LD | rd.code() * B21 | src.ra().code() * B16 | offset);
-}
-
-
-void Assembler::ldu(Register rd, const MemOperand& src) {
-  int offset = src.offset();
-  DCHECK(src.ra_ != r0);
-  CHECK(!(offset & 3) && is_int16(offset));
-  offset = kImm16Mask & offset;
-  emit(LD | rd.code() * B21 | src.ra().code() * B16 | offset | 1);
-}
-
-
-void Assembler::std(Register rs, const MemOperand& src) {
-  int offset = src.offset();
-  DCHECK(src.ra_ != r0);
-  CHECK(!(offset & 3) && is_int16(offset));
-  offset = kImm16Mask & offset;
-  emit(STD | rs.code() * B21 | src.ra().code() * B16 | offset);
-}
-
-
-void Assembler::stdu(Register rs, const MemOperand& src) {
-  int offset = src.offset();
-  DCHECK(src.ra_ != r0);
-  CHECK(!(offset & 3) && is_int16(offset));
-  offset = kImm16Mask & offset;
-  emit(STD | rs.code() * B21 | src.ra().code() * B16 | offset | 1);
-}
-
-
-void Assembler::rldic(Register ra, Register rs, int sh, int mb, RCBit r) {
-  md_form(EXT5 | RLDIC, ra, rs, sh, mb, r);
-}
-
-
-void Assembler::rldicl(Register ra, Register rs, int sh, int mb, RCBit r) {
-  md_form(EXT5 | RLDICL, ra, rs, sh, mb, r);
-}
-
-
-void Assembler::rldcl(Register ra, Register rs, Register rb, int mb, RCBit r) {
-  mds_form(EXT5 | RLDCL, ra, rs, rb, mb, r);
-}
-
-
-void Assembler::rldicr(Register ra, Register rs, int sh, int me, RCBit r) {
-  md_form(EXT5 | RLDICR, ra, rs, sh, me, r);
-}
-
-
-void Assembler::sldi(Register dst, Register src, const Operand& val, RCBit rc) {
-  DCHECK((64 > val.immediate()) && (val.immediate() >= 0));
-  rldicr(dst, src, val.immediate(), 63 - val.immediate(), rc);
-}
-
-
-void Assembler::srdi(Register dst, Register src, const Operand& val, RCBit rc) {
-  DCHECK((64 > val.immediate()) && (val.immediate() >= 0));
-  rldicl(dst, src, 64 - val.immediate(), val.immediate(), rc);
-}
-
-
-void Assembler::clrrdi(Register dst, Register src, const Operand& val,
-                       RCBit rc) {
-  DCHECK((64 > val.immediate()) && (val.immediate() >= 0));
-  rldicr(dst, src, 0, 63 - val.immediate(), rc);
-}
-
-
-void Assembler::clrldi(Register dst, Register src, const Operand& val,
-                       RCBit rc) {
-  DCHECK((64 > val.immediate()) && (val.immediate() >= 0));
-  rldicl(dst, src, 0, val.immediate(), rc);
-}
-
-
-void Assembler::rldimi(Register ra, Register rs, int sh, int mb, RCBit r) {
-  md_form(EXT5 | RLDIMI, ra, rs, sh, mb, r);
-}
-
-
-void Assembler::sradi(Register ra, Register rs, int sh, RCBit r) {
-  int sh0_4 = sh & 0x1F;
-  int sh5 = (sh >> 5) & 0x1;
-
-  emit(EXT2 | SRADIX | rs.code() * B21 | ra.code() * B16 | sh0_4 * B11 |
-       sh5 * B1 | r);
-}
-
-
-void Assembler::rotld(Register ra, Register rs, Register rb, RCBit r) {
-  rldcl(ra, rs, rb, 0, r);
-}
-
-
-void Assembler::rotldi(Register ra, Register rs, int sh, RCBit r) {
-  rldicl(ra, rs, sh, 0, r);
-}
-
-
-void Assembler::rotrdi(Register ra, Register rs, int sh, RCBit r) {
-  rldicl(ra, rs, 64 - sh, 0, r);
-}
-
-
-void Assembler::mulld(Register dst, Register src1, Register src2, OEBit o,
-                      RCBit r) {
-  xo_form(EXT2 | MULLD, dst, src1, src2, o, r);
-}
-
-
-void Assembler::divd(Register dst, Register src1, Register src2, OEBit o,
-                     RCBit r) {
-  xo_form(EXT2 | DIVD, dst, src1, src2, o, r);
-}
-
-
-void Assembler::divdu(Register dst, Register src1, Register src2, OEBit o,
-                      RCBit r) {
-  xo_form(EXT2 | DIVDU, dst, src1, src2, o, r);
-}
-#endif
-
-
-// Function descriptor for AIX.
-// Code address skips the function descriptor "header".
-// TOC and static chain are ignored and set to 0.
-void Assembler::function_descriptor() {
-  if (ABI_USES_FUNCTION_DESCRIPTORS) {
-    Label instructions;
-    DCHECK_EQ(pc_offset(), 0);
-    emit_label_addr(&instructions);
-    dp(0);
-    dp(0);
-    bind(&instructions);
-  }
-}
-
-
-int Assembler::instructions_required_for_mov(Register dst,
-                                             const Operand& src) const {
-  bool canOptimize =
-      !(src.must_output_reloc_info(this) || is_trampoline_pool_blocked());
-  if (use_constant_pool_for_mov(dst, src, canOptimize)) {
-    if (ConstantPoolAccessIsInOverflow()) {
-      return kMovInstructionsConstantPool + 1;
-    }
-    return kMovInstructionsConstantPool;
-  }
-  DCHECK(!canOptimize);
-  return kMovInstructionsNoConstantPool;
-}
-
-
-bool Assembler::use_constant_pool_for_mov(Register dst, const Operand& src,
-                                          bool canOptimize) const {
-  if (!FLAG_enable_embedded_constant_pool || !is_constant_pool_available()) {
-    // If there is no constant pool available, we must use a mov
-    // immediate sequence.
-    return false;
-  }
-  intptr_t value = src.immediate();
-#if V8_TARGET_ARCH_PPC64
-  bool allowOverflow = !((canOptimize && is_int32(value)) || dst == r0);
-#else
-  bool allowOverflow = !(canOptimize || dst == r0);
-#endif
-  if (canOptimize && is_int16(value)) {
-    // Prefer a single-instruction load-immediate.
-    return false;
-  }
-  if (!allowOverflow && ConstantPoolAccessIsInOverflow()) {
-    // Prefer non-relocatable two-instruction bitwise-mov32 over
-    // overflow sequence.
-    return false;
-  }
-
-  return true;
-}
-
-
-void Assembler::EnsureSpaceFor(int space_needed) {
-  if (buffer_space() <= (kGap + space_needed)) {
-    GrowBuffer(space_needed);
-  }
-}
-
-
-bool Operand::must_output_reloc_info(const Assembler* assembler) const {
-  if (rmode_ == RelocInfo::EXTERNAL_REFERENCE) {
-    if (assembler != nullptr && assembler->predictable_code_size()) return true;
-    return assembler->serializer_enabled();
-  } else if (RelocInfo::IsNone(rmode_)) {
-    return false;
-  }
-  return true;
-}
-
-
-// Primarily used for loading constants
-// This should really move to be in macro-assembler as it
-// is really a pseudo instruction
-// Some usages of this intend for a FIXED_SEQUENCE to be used
-// Todo - break this dependency so we can optimize mov() in general
-// and only use the generic version when we require a fixed sequence
-void Assembler::mov(Register dst, const Operand& src) {
-  intptr_t value;
-  if (src.IsHeapObjectRequest()) {
-    RequestHeapObject(src.heap_object_request());
-    value = 0;
-  } else {
-    value = src.immediate();
-  }
-  bool relocatable = src.must_output_reloc_info(this);
-  bool canOptimize;
-
-  canOptimize =
-      !(relocatable || (is_trampoline_pool_blocked() && !is_int16(value)));
-
-  if (!src.IsHeapObjectRequest() &&
-      use_constant_pool_for_mov(dst, src, canOptimize)) {
-    DCHECK(is_constant_pool_available());
-    if (relocatable) {
-      RecordRelocInfo(src.rmode_);
-    }
-    ConstantPoolEntry::Access access = ConstantPoolAddEntry(src.rmode_, value);
-#if V8_TARGET_ARCH_PPC64
-    if (access == ConstantPoolEntry::OVERFLOWED) {
-      addis(dst, kConstantPoolRegister, Operand::Zero());
-      ld(dst, MemOperand(dst, 0));
-    } else {
-      ld(dst, MemOperand(kConstantPoolRegister, 0));
-    }
-#else
-    if (access == ConstantPoolEntry::OVERFLOWED) {
-      addis(dst, kConstantPoolRegister, Operand::Zero());
-      lwz(dst, MemOperand(dst, 0));
-    } else {
-      lwz(dst, MemOperand(kConstantPoolRegister, 0));
-    }
-#endif
-    return;
-  }
-
-  if (canOptimize) {
-    if (is_int16(value)) {
-      li(dst, Operand(value));
-    } else {
-      uint16_t u16;
-#if V8_TARGET_ARCH_PPC64
-      if (is_int32(value)) {
-#endif
-        lis(dst, Operand(value >> 16));
-#if V8_TARGET_ARCH_PPC64
-      } else {
-        if (is_int48(value)) {
-          li(dst, Operand(value >> 32));
-        } else {
-          lis(dst, Operand(value >> 48));
-          u16 = ((value >> 32) & 0xFFFF);
-          if (u16) {
-            ori(dst, dst, Operand(u16));
-          }
-        }
-        sldi(dst, dst, Operand(32));
-        u16 = ((value >> 16) & 0xFFFF);
-        if (u16) {
-          oris(dst, dst, Operand(u16));
-        }
-      }
-#endif
-      u16 = (value & 0xFFFF);
-      if (u16) {
-        ori(dst, dst, Operand(u16));
-      }
-    }
-    return;
-  }
-
-  DCHECK(!canOptimize);
-  if (relocatable) {
-    RecordRelocInfo(src.rmode_);
-  }
-  bitwise_mov(dst, value);
-}
-
-
-void Assembler::bitwise_mov(Register dst, intptr_t value) {
-    BlockTrampolinePoolScope block_trampoline_pool(this);
-#if V8_TARGET_ARCH_PPC64
-    int32_t hi_32 = static_cast<int32_t>(value >> 32);
-    int32_t lo_32 = static_cast<int32_t>(value);
-    int hi_word = static_cast<int>(hi_32 >> 16);
-    int lo_word = static_cast<int>(hi_32 & 0xFFFF);
-    lis(dst, Operand(SIGN_EXT_IMM16(hi_word)));
-    ori(dst, dst, Operand(lo_word));
-    sldi(dst, dst, Operand(32));
-    hi_word = static_cast<int>(((lo_32 >> 16) & 0xFFFF));
-    lo_word = static_cast<int>(lo_32 & 0xFFFF);
-    oris(dst, dst, Operand(hi_word));
-    ori(dst, dst, Operand(lo_word));
-#else
-    int hi_word = static_cast<int>(value >> 16);
-    int lo_word = static_cast<int>(value & 0xFFFF);
-    lis(dst, Operand(SIGN_EXT_IMM16(hi_word)));
-    ori(dst, dst, Operand(lo_word));
-#endif
-}
-
-
-void Assembler::bitwise_mov32(Register dst, int32_t value) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  int hi_word = static_cast<int>(value >> 16);
-  int lo_word = static_cast<int>(value & 0xFFFF);
-  lis(dst, Operand(SIGN_EXT_IMM16(hi_word)));
-  ori(dst, dst, Operand(lo_word));
-}
-
-
-void Assembler::bitwise_add32(Register dst, Register src, int32_t value) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  if (is_int16(value)) {
-    addi(dst, src, Operand(value));
-    nop();
-  } else {
-    int hi_word = static_cast<int>(value >> 16);
-    int lo_word = static_cast<int>(value & 0xFFFF);
-    if (lo_word & 0x8000) hi_word++;
-    addis(dst, src, Operand(SIGN_EXT_IMM16(hi_word)));
-    addic(dst, dst, Operand(SIGN_EXT_IMM16(lo_word)));
-  }
-}
-
-
-void Assembler::mov_label_offset(Register dst, Label* label) {
-  int position = link(label);
-  if (label->is_bound()) {
-    // Load the position of the label relative to the generated code object.
-    mov(dst, Operand(position + Code::kHeaderSize - kHeapObjectTag));
-  } else {
-    // Encode internal reference to unbound label. We use a dummy opcode
-    // such that it won't collide with any opcode that might appear in the
-    // label's chain.  Encode the destination register in the 2nd instruction.
-    int link = position - pc_offset();
-    DCHECK_EQ(0, link & 3);
-    link >>= 2;
-    DCHECK(is_int26(link));
-
-    // When the label is bound, these instructions will be patched
-    // with a 2 instruction mov sequence that will load the
-    // destination register with the position of the label from the
-    // beginning of the code.
-    //
-    // target_at extracts the link and target_at_put patches the instructions.
-    BlockTrampolinePoolScope block_trampoline_pool(this);
-    emit(kUnboundMovLabelOffsetOpcode | (link & kImm26Mask));
-    emit(dst.code());
-  }
-}
-
-
-void Assembler::add_label_offset(Register dst, Register base, Label* label,
-                                 int delta) {
-  int position = link(label);
-  if (label->is_bound()) {
-    // dst = base + position + delta
-    position += delta;
-    bitwise_add32(dst, base, position);
-  } else {
-    // Encode internal reference to unbound label. We use a dummy opcode
-    // such that it won't collide with any opcode that might appear in the
-    // label's chain.  Encode the operands in the 2nd instruction.
-    int link = position - pc_offset();
-    DCHECK_EQ(0, link & 3);
-    link >>= 2;
-    DCHECK(is_int26(link));
-    DCHECK(is_int16(delta));
-
-    BlockTrampolinePoolScope block_trampoline_pool(this);
-    emit(kUnboundAddLabelOffsetOpcode | (link & kImm26Mask));
-    emit(dst.code() * B21 | base.code() * B16 | (delta & kImm16Mask));
-  }
-}
-
-
-void Assembler::mov_label_addr(Register dst, Label* label) {
-  CheckBuffer();
-  RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE_ENCODED);
-  int position = link(label);
-  if (label->is_bound()) {
-    // Keep internal references relative until EmitRelocations.
-    bitwise_mov(dst, position);
-  } else {
-    // Encode internal reference to unbound label. We use a dummy opcode
-    // such that it won't collide with any opcode that might appear in the
-    // label's chain.  Encode the destination register in the 2nd instruction.
-    int link = position - pc_offset();
-    DCHECK_EQ(0, link & 3);
-    link >>= 2;
-    DCHECK(is_int26(link));
-
-    // When the label is bound, these instructions will be patched
-    // with a multi-instruction mov sequence that will load the
-    // destination register with the address of the label.
-    //
-    // target_at extracts the link and target_at_put patches the instructions.
-    BlockTrampolinePoolScope block_trampoline_pool(this);
-    emit(kUnboundMovLabelAddrOpcode | (link & kImm26Mask));
-    emit(dst.code());
-    DCHECK_GE(kMovInstructionsNoConstantPool, 2);
-    for (int i = 0; i < kMovInstructionsNoConstantPool - 2; i++) nop();
-  }
-}
-
-
-void Assembler::emit_label_addr(Label* label) {
-  CheckBuffer();
-  RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE);
-  int position = link(label);
-  if (label->is_bound()) {
-    // Keep internal references relative until EmitRelocations.
-    dp(position);
-  } else {
-    // Encode internal reference to unbound label. We use a dummy opcode
-    // such that it won't collide with any opcode that might appear in the
-    // label's chain.
-    int link = position - pc_offset();
-    DCHECK_EQ(0, link & 3);
-    link >>= 2;
-    DCHECK(is_int26(link));
-
-    // When the label is bound, the instruction(s) will be patched
-    // as a jump table entry containing the label address.  target_at extracts
-    // the link and target_at_put patches the instruction(s).
-    BlockTrampolinePoolScope block_trampoline_pool(this);
-    emit(kUnboundJumpTableEntryOpcode | (link & kImm26Mask));
-#if V8_TARGET_ARCH_PPC64
-    nop();
-#endif
-  }
-}
-
-
-// Special register instructions
-void Assembler::crxor(int bt, int ba, int bb) {
-  emit(EXT1 | CRXOR | bt * B21 | ba * B16 | bb * B11);
-}
-
-
-void Assembler::creqv(int bt, int ba, int bb) {
-  emit(EXT1 | CREQV | bt * B21 | ba * B16 | bb * B11);
-}
-
-
-void Assembler::mflr(Register dst) {
-  emit(EXT2 | MFSPR | dst.code() * B21 | 256 << 11);  // Ignore RC bit
-}
-
-
-void Assembler::mtlr(Register src) {
-  emit(EXT2 | MTSPR | src.code() * B21 | 256 << 11);  // Ignore RC bit
-}
-
-
-void Assembler::mtctr(Register src) {
-  emit(EXT2 | MTSPR | src.code() * B21 | 288 << 11);  // Ignore RC bit
-}
-
-
-void Assembler::mtxer(Register src) {
-  emit(EXT2 | MTSPR | src.code() * B21 | 32 << 11);
-}
-
-
-void Assembler::mcrfs(CRegister cr, FPSCRBit bit) {
-  DCHECK_LT(static_cast<int>(bit), 32);
-  int bf = cr.code();
-  int bfa = bit / CRWIDTH;
-  emit(EXT4 | MCRFS | bf * B23 | bfa * B18);
-}
-
-
-void Assembler::mfcr(Register dst) { emit(EXT2 | MFCR | dst.code() * B21); }
-
-
-#if V8_TARGET_ARCH_PPC64
-void Assembler::mffprd(Register dst, DoubleRegister src) {
-  emit(EXT2 | MFVSRD | src.code() * B21 | dst.code() * B16);
-}
-
-
-void Assembler::mffprwz(Register dst, DoubleRegister src) {
-  emit(EXT2 | MFVSRWZ | src.code() * B21 | dst.code() * B16);
-}
-
-
-void Assembler::mtfprd(DoubleRegister dst, Register src) {
-  emit(EXT2 | MTVSRD | dst.code() * B21 | src.code() * B16);
-}
-
-
-void Assembler::mtfprwz(DoubleRegister dst, Register src) {
-  emit(EXT2 | MTVSRWZ | dst.code() * B21 | src.code() * B16);
-}
-
-
-void Assembler::mtfprwa(DoubleRegister dst, Register src) {
-  emit(EXT2 | MTVSRWA | dst.code() * B21 | src.code() * B16);
-}
-#endif
-
-
-// Exception-generating instructions and debugging support.
-// Stops with a non-negative code less than kNumOfWatchedStops support
-// enabling/disabling and a counter feature. See simulator-ppc.h .
-void Assembler::stop(const char* msg, Condition cond, int32_t code,
-                     CRegister cr) {
-  if (cond != al) {
-    Label skip;
-    b(NegateCondition(cond), &skip, cr);
-    bkpt(0);
-    bind(&skip);
-  } else {
-    bkpt(0);
-  }
-}
-
-void Assembler::bkpt(uint32_t imm16) { emit(0x7D821008); }
-
-void Assembler::dcbf(Register ra, Register rb) {
-  emit(EXT2 | DCBF | ra.code() * B16 | rb.code() * B11);
-}
-
-
-void Assembler::sync() { emit(EXT2 | SYNC); }
-
-
-void Assembler::lwsync() { emit(EXT2 | SYNC | 1 * B21); }
-
-
-void Assembler::icbi(Register ra, Register rb) {
-  emit(EXT2 | ICBI | ra.code() * B16 | rb.code() * B11);
-}
-
-
-void Assembler::isync() { emit(EXT1 | ISYNC); }
-
-
-// Floating point support
-
-void Assembler::lfd(const DoubleRegister frt, const MemOperand& src) {
-  int offset = src.offset();
-  Register ra = src.ra();
-  DCHECK(ra != r0);
-  CHECK(is_int16(offset));
-  int imm16 = offset & kImm16Mask;
-  // could be x_form instruction with some casting magic
-  emit(LFD | frt.code() * B21 | ra.code() * B16 | imm16);
-}
-
-
-void Assembler::lfdu(const DoubleRegister frt, const MemOperand& src) {
-  int offset = src.offset();
-  Register ra = src.ra();
-  DCHECK(ra != r0);
-  CHECK(is_int16(offset));
-  int imm16 = offset & kImm16Mask;
-  // could be x_form instruction with some casting magic
-  emit(LFDU | frt.code() * B21 | ra.code() * B16 | imm16);
-}
-
-
-void Assembler::lfs(const DoubleRegister frt, const MemOperand& src) {
-  int offset = src.offset();
-  Register ra = src.ra();
-  CHECK(is_int16(offset));
-  DCHECK(ra != r0);
-  int imm16 = offset & kImm16Mask;
-  // could be x_form instruction with some casting magic
-  emit(LFS | frt.code() * B21 | ra.code() * B16 | imm16);
-}
-
-
-void Assembler::lfsu(const DoubleRegister frt, const MemOperand& src) {
-  int offset = src.offset();
-  Register ra = src.ra();
-  CHECK(is_int16(offset));
-  DCHECK(ra != r0);
-  int imm16 = offset & kImm16Mask;
-  // could be x_form instruction with some casting magic
-  emit(LFSU | frt.code() * B21 | ra.code() * B16 | imm16);
-}
-
-
-void Assembler::stfd(const DoubleRegister frs, const MemOperand& src) {
-  int offset = src.offset();
-  Register ra = src.ra();
-  CHECK(is_int16(offset));
-  DCHECK(ra != r0);
-  int imm16 = offset & kImm16Mask;
-  // could be x_form instruction with some casting magic
-  emit(STFD | frs.code() * B21 | ra.code() * B16 | imm16);
-}
-
-
-void Assembler::stfdu(const DoubleRegister frs, const MemOperand& src) {
-  int offset = src.offset();
-  Register ra = src.ra();
-  CHECK(is_int16(offset));
-  DCHECK(ra != r0);
-  int imm16 = offset & kImm16Mask;
-  // could be x_form instruction with some casting magic
-  emit(STFDU | frs.code() * B21 | ra.code() * B16 | imm16);
-}
-
-
-void Assembler::stfs(const DoubleRegister frs, const MemOperand& src) {
-  int offset = src.offset();
-  Register ra = src.ra();
-  CHECK(is_int16(offset));
-  DCHECK(ra != r0);
-  int imm16 = offset & kImm16Mask;
-  // could be x_form instruction with some casting magic
-  emit(STFS | frs.code() * B21 | ra.code() * B16 | imm16);
-}
-
-
-void Assembler::stfsu(const DoubleRegister frs, const MemOperand& src) {
-  int offset = src.offset();
-  Register ra = src.ra();
-  CHECK(is_int16(offset));
-  DCHECK(ra != r0);
-  int imm16 = offset & kImm16Mask;
-  // could be x_form instruction with some casting magic
-  emit(STFSU | frs.code() * B21 | ra.code() * B16 | imm16);
-}
-
-
-void Assembler::fsub(const DoubleRegister frt, const DoubleRegister fra,
-                     const DoubleRegister frb, RCBit rc) {
-  a_form(EXT4 | FSUB, frt, fra, frb, rc);
-}
-
-
-void Assembler::fadd(const DoubleRegister frt, const DoubleRegister fra,
-                     const DoubleRegister frb, RCBit rc) {
-  a_form(EXT4 | FADD, frt, fra, frb, rc);
-}
-
-
-void Assembler::fmul(const DoubleRegister frt, const DoubleRegister fra,
-                     const DoubleRegister frc, RCBit rc) {
-  emit(EXT4 | FMUL | frt.code() * B21 | fra.code() * B16 | frc.code() * B6 |
-       rc);
-}
-
-
-void Assembler::fdiv(const DoubleRegister frt, const DoubleRegister fra,
-                     const DoubleRegister frb, RCBit rc) {
-  a_form(EXT4 | FDIV, frt, fra, frb, rc);
-}
-
-
-void Assembler::fcmpu(const DoubleRegister fra, const DoubleRegister frb,
-                      CRegister cr) {
-  DCHECK(cr.code() >= 0 && cr.code() <= 7);
-  emit(EXT4 | FCMPU | cr.code() * B23 | fra.code() * B16 | frb.code() * B11);
-}
-
-
-void Assembler::fmr(const DoubleRegister frt, const DoubleRegister frb,
-                    RCBit rc) {
-  emit(EXT4 | FMR | frt.code() * B21 | frb.code() * B11 | rc);
-}
-
-
-void Assembler::fctiwz(const DoubleRegister frt, const DoubleRegister frb) {
-  emit(EXT4 | FCTIWZ | frt.code() * B21 | frb.code() * B11);
-}
-
-
-void Assembler::fctiw(const DoubleRegister frt, const DoubleRegister frb) {
-  emit(EXT4 | FCTIW | frt.code() * B21 | frb.code() * B11);
-}
-
-
-void Assembler::frin(const DoubleRegister frt, const DoubleRegister frb,
-                     RCBit rc) {
-  emit(EXT4 | FRIN | frt.code() * B21 | frb.code() * B11 | rc);
-}
-
-
-void Assembler::friz(const DoubleRegister frt, const DoubleRegister frb,
-                     RCBit rc) {
-  emit(EXT4 | FRIZ | frt.code() * B21 | frb.code() * B11 | rc);
-}
-
-
-void Assembler::frip(const DoubleRegister frt, const DoubleRegister frb,
-                     RCBit rc) {
-  emit(EXT4 | FRIP | frt.code() * B21 | frb.code() * B11 | rc);
-}
-
-
-void Assembler::frim(const DoubleRegister frt, const DoubleRegister frb,
-                     RCBit rc) {
-  emit(EXT4 | FRIM | frt.code() * B21 | frb.code() * B11 | rc);
-}
-
-
-void Assembler::frsp(const DoubleRegister frt, const DoubleRegister frb,
-                     RCBit rc) {
-  emit(EXT4 | FRSP | frt.code() * B21 | frb.code() * B11 | rc);
-}
-
-
-void Assembler::fcfid(const DoubleRegister frt, const DoubleRegister frb,
-                      RCBit rc) {
-  emit(EXT4 | FCFID | frt.code() * B21 | frb.code() * B11 | rc);
-}
-
-
-void Assembler::fcfidu(const DoubleRegister frt, const DoubleRegister frb,
-                       RCBit rc) {
-  emit(EXT4 | FCFIDU | frt.code() * B21 | frb.code() * B11 | rc);
-}
-
-
-void Assembler::fcfidus(const DoubleRegister frt, const DoubleRegister frb,
-                        RCBit rc) {
-  emit(EXT3 | FCFIDUS | frt.code() * B21 | frb.code() * B11 | rc);
-}
-
-
-void Assembler::fcfids(const DoubleRegister frt, const DoubleRegister frb,
-                       RCBit rc) {
-  emit(EXT3 | FCFIDS | frt.code() * B21 | frb.code() * B11 | rc);
-}
-
-
-void Assembler::fctid(const DoubleRegister frt, const DoubleRegister frb,
-                      RCBit rc) {
-  emit(EXT4 | FCTID | frt.code() * B21 | frb.code() * B11 | rc);
-}
-
-
-void Assembler::fctidz(const DoubleRegister frt, const DoubleRegister frb,
-                       RCBit rc) {
-  emit(EXT4 | FCTIDZ | frt.code() * B21 | frb.code() * B11 | rc);
-}
-
-
-void Assembler::fctidu(const DoubleRegister frt, const DoubleRegister frb,
-                       RCBit rc) {
-  emit(EXT4 | FCTIDU | frt.code() * B21 | frb.code() * B11 | rc);
-}
-
-
-void Assembler::fctiduz(const DoubleRegister frt, const DoubleRegister frb,
-                        RCBit rc) {
-  emit(EXT4 | FCTIDUZ | frt.code() * B21 | frb.code() * B11 | rc);
-}
-
-
-void Assembler::fsel(const DoubleRegister frt, const DoubleRegister fra,
-                     const DoubleRegister frc, const DoubleRegister frb,
-                     RCBit rc) {
-  emit(EXT4 | FSEL | frt.code() * B21 | fra.code() * B16 | frb.code() * B11 |
-       frc.code() * B6 | rc);
-}
-
-
-void Assembler::fneg(const DoubleRegister frt, const DoubleRegister frb,
-                     RCBit rc) {
-  emit(EXT4 | FNEG | frt.code() * B21 | frb.code() * B11 | rc);
-}
-
-
-void Assembler::mtfsb0(FPSCRBit bit, RCBit rc) {
-  DCHECK_LT(static_cast<int>(bit), 32);
-  int bt = bit;
-  emit(EXT4 | MTFSB0 | bt * B21 | rc);
-}
-
-
-void Assembler::mtfsb1(FPSCRBit bit, RCBit rc) {
-  DCHECK_LT(static_cast<int>(bit), 32);
-  int bt = bit;
-  emit(EXT4 | MTFSB1 | bt * B21 | rc);
-}
-
-
-void Assembler::mtfsfi(int bf, int immediate, RCBit rc) {
-  emit(EXT4 | MTFSFI | bf * B23 | immediate * B12 | rc);
-}
-
-
-void Assembler::mffs(const DoubleRegister frt, RCBit rc) {
-  emit(EXT4 | MFFS | frt.code() * B21 | rc);
-}
-
-
-void Assembler::mtfsf(const DoubleRegister frb, bool L, int FLM, bool W,
-                      RCBit rc) {
-  emit(EXT4 | MTFSF | frb.code() * B11 | W * B16 | FLM * B17 | L * B25 | rc);
-}
-
-
-void Assembler::fsqrt(const DoubleRegister frt, const DoubleRegister frb,
-                      RCBit rc) {
-  emit(EXT4 | FSQRT | frt.code() * B21 | frb.code() * B11 | rc);
-}
-
-
-void Assembler::fabs(const DoubleRegister frt, const DoubleRegister frb,
-                     RCBit rc) {
-  emit(EXT4 | FABS | frt.code() * B21 | frb.code() * B11 | rc);
-}
-
-
-void Assembler::fmadd(const DoubleRegister frt, const DoubleRegister fra,
-                      const DoubleRegister frc, const DoubleRegister frb,
-                      RCBit rc) {
-  emit(EXT4 | FMADD | frt.code() * B21 | fra.code() * B16 | frb.code() * B11 |
-       frc.code() * B6 | rc);
-}
-
-
-void Assembler::fmsub(const DoubleRegister frt, const DoubleRegister fra,
-                      const DoubleRegister frc, const DoubleRegister frb,
-                      RCBit rc) {
-  emit(EXT4 | FMSUB | frt.code() * B21 | fra.code() * B16 | frb.code() * B11 |
-       frc.code() * B6 | rc);
-}
-
-// Pseudo instructions.
-void Assembler::nop(int type) {
-  Register reg = r0;
-  switch (type) {
-    case NON_MARKING_NOP:
-      reg = r0;
-      break;
-    case GROUP_ENDING_NOP:
-      reg = r2;
-      break;
-    case DEBUG_BREAK_NOP:
-      reg = r3;
-      break;
-    default:
-      UNIMPLEMENTED();
-  }
-
-  ori(reg, reg, Operand::Zero());
-}
-
-
-bool Assembler::IsNop(Instr instr, int type) {
-  int reg = 0;
-  switch (type) {
-    case NON_MARKING_NOP:
-      reg = 0;
-      break;
-    case GROUP_ENDING_NOP:
-      reg = 2;
-      break;
-    case DEBUG_BREAK_NOP:
-      reg = 3;
-      break;
-    default:
-      UNIMPLEMENTED();
-  }
-  return instr == (ORI | reg * B21 | reg * B16);
-}
-
-
-void Assembler::GrowBuffer(int needed) {
-  if (!own_buffer_) FATAL("external code buffer is too small");
-
-  // Compute new buffer size.
-  CodeDesc desc;  // the new buffer
-  if (buffer_size_ < 4 * KB) {
-    desc.buffer_size = 4 * KB;
-  } else if (buffer_size_ < 1 * MB) {
-    desc.buffer_size = 2 * buffer_size_;
-  } else {
-    desc.buffer_size = buffer_size_ + 1 * MB;
-  }
-  int space = buffer_space() + (desc.buffer_size - buffer_size_);
-  if (space < needed) {
-    desc.buffer_size += needed - space;
-  }
-
-  // Some internal data structures overflow for very large buffers,
-  // they must ensure that kMaximalBufferSize is not too large.
-  if (desc.buffer_size > kMaximalBufferSize) {
-    V8::FatalProcessOutOfMemory("Assembler::GrowBuffer");
-  }
-
-  // Set up new buffer.
-  desc.buffer = NewArray<byte>(desc.buffer_size);
-  desc.origin = this;
-
-  desc.instr_size = pc_offset();
-  desc.reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos();
-
-  // Copy the data.
-  intptr_t pc_delta = desc.buffer - buffer_;
-  intptr_t rc_delta =
-      (desc.buffer + desc.buffer_size) - (buffer_ + buffer_size_);
-  memmove(desc.buffer, buffer_, desc.instr_size);
-  memmove(reloc_info_writer.pos() + rc_delta, reloc_info_writer.pos(),
-          desc.reloc_size);
-
-  // Switch buffers.
-  DeleteArray(buffer_);
-  buffer_ = desc.buffer;
-  buffer_size_ = desc.buffer_size;
-  pc_ += pc_delta;
-  reloc_info_writer.Reposition(reloc_info_writer.pos() + rc_delta,
-                               reloc_info_writer.last_pc() + pc_delta);
-
-  // Nothing else to do here since we keep all internal references and
-  // deferred relocation entries relative to the buffer (until
-  // EmitRelocations).
-}
-
-
-void Assembler::db(uint8_t data) {
-  CheckBuffer();
-  *reinterpret_cast<uint8_t*>(pc_) = data;
-  pc_ += sizeof(uint8_t);
-}
-
-
-void Assembler::dd(uint32_t data) {
-  CheckBuffer();
-  *reinterpret_cast<uint32_t*>(pc_) = data;
-  pc_ += sizeof(uint32_t);
-}
-
-
-void Assembler::dq(uint64_t value) {
-  CheckBuffer();
-  *reinterpret_cast<uint64_t*>(pc_) = value;
-  pc_ += sizeof(uint64_t);
-}
-
-
-void Assembler::dp(uintptr_t data) {
-  CheckBuffer();
-  *reinterpret_cast<uintptr_t*>(pc_) = data;
-  pc_ += sizeof(uintptr_t);
-}
-
-
-void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
-  if (RelocInfo::IsNone(rmode) ||
-      // Don't record external references unless the heap will be serialized.
-      (rmode == RelocInfo::EXTERNAL_REFERENCE && !serializer_enabled() &&
-       !emit_debug_code())) {
-    return;
-  }
-  DeferredRelocInfo rinfo(pc_offset(), rmode, data);
-  relocations_.push_back(rinfo);
-}
-
-
-void Assembler::EmitRelocations() {
-  EnsureSpaceFor(relocations_.size() * kMaxRelocSize);
-
-  for (std::vector<DeferredRelocInfo>::iterator it = relocations_.begin();
-       it != relocations_.end(); it++) {
-    RelocInfo::Mode rmode = it->rmode();
-    Address pc = buffer_ + it->position();
-    RelocInfo rinfo(pc, rmode, it->data(), nullptr);
-
-    // Fix up internal references now that they are guaranteed to be bound.
-    if (RelocInfo::IsInternalReference(rmode)) {
-      // Jump table entry
-      intptr_t pos = reinterpret_cast<intptr_t>(Memory::Address_at(pc));
-      Memory::Address_at(pc) = buffer_ + pos;
-    } else if (RelocInfo::IsInternalReferenceEncoded(rmode)) {
-      // mov sequence
-      intptr_t pos = reinterpret_cast<intptr_t>(target_address_at(pc, nullptr));
-      set_target_address_at(nullptr, pc, nullptr, buffer_ + pos,
-                            SKIP_ICACHE_FLUSH);
-    }
-
-    reloc_info_writer.Write(&rinfo);
-  }
-}
-
-
-void Assembler::BlockTrampolinePoolFor(int instructions) {
-  BlockTrampolinePoolBefore(pc_offset() + instructions * kInstrSize);
-}
-
-
-void Assembler::CheckTrampolinePool() {
-  // Some small sequences of instructions must not be broken up by the
-  // insertion of a trampoline pool; such sequences are protected by setting
-  // either trampoline_pool_blocked_nesting_ or no_trampoline_pool_before_,
-  // which are both checked here. Also, recursive calls to CheckTrampolinePool
-  // are blocked by trampoline_pool_blocked_nesting_.
-  if (trampoline_pool_blocked_nesting_ > 0) return;
-  if (pc_offset() < no_trampoline_pool_before_) {
-    next_trampoline_check_ = no_trampoline_pool_before_;
-    return;
-  }
-
-  DCHECK(!trampoline_emitted_);
-  if (tracked_branch_count_ > 0) {
-    int size = tracked_branch_count_ * kInstrSize;
-
-    // As we are only going to emit trampoline once, we need to prevent any
-    // further emission.
-    trampoline_emitted_ = true;
-    next_trampoline_check_ = kMaxInt;
-
-    // First we emit jump, then we emit trampoline pool.
-    b(size + kInstrSize, LeaveLK);
-    for (int i = size; i > 0; i -= kInstrSize) {
-      b(i, LeaveLK);
-    }
-
-    trampoline_ = Trampoline(pc_offset() - size, tracked_branch_count_);
-  }
-}
-
-PatchingAssembler::PatchingAssembler(IsolateData isolate_data, byte* address,
-                                     int instructions)
-    : Assembler(isolate_data, address, instructions * kInstrSize + kGap) {
-  DCHECK_EQ(reloc_info_writer.pos(), buffer_ + buffer_size_);
-}
-
-PatchingAssembler::~PatchingAssembler() {
-  // Check that the code was patched as expected.
-  DCHECK_EQ(pc_, buffer_ + buffer_size_ - kGap);
-  DCHECK_EQ(reloc_info_writer.pos(), buffer_ + buffer_size_);
-}
-
-void PatchingAssembler::FlushICache(Isolate* isolate) {
-  Assembler::FlushICache(isolate, buffer_, buffer_size_ - kGap);
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_PPC
diff --git a/src/v8/src/ppc/assembler-ppc.h b/src/v8/src/ppc/assembler-ppc.h
deleted file mode 100644
index 0204d65..0000000
--- a/src/v8/src/ppc/assembler-ppc.h
+++ /dev/null
@@ -1,1674 +0,0 @@
-// Copyright (c) 1994-2006 Sun Microsystems Inc.
-// 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.
-//
-// - Redistribution 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 Sun Microsystems or the names of 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.
-
-// The original source code covered by the above license above has been
-// modified significantly by Google Inc.
-// Copyright 2014 the V8 project authors. All rights reserved.
-
-// A light-weight PPC Assembler
-// Generates user mode instructions for the PPC architecture up
-
-#ifndef V8_PPC_ASSEMBLER_PPC_H_
-#define V8_PPC_ASSEMBLER_PPC_H_
-
-#include <stdio.h>
-#include <vector>
-
-#include "src/assembler.h"
-#include "src/double.h"
-#include "src/ppc/constants-ppc.h"
-
-#if V8_HOST_ARCH_PPC && \
-    (V8_OS_AIX || (V8_TARGET_ARCH_PPC64 && V8_TARGET_BIG_ENDIAN))
-#define ABI_USES_FUNCTION_DESCRIPTORS 1
-#else
-#define ABI_USES_FUNCTION_DESCRIPTORS 0
-#endif
-
-#if !V8_HOST_ARCH_PPC || V8_OS_AIX || V8_TARGET_ARCH_PPC64
-#define ABI_PASSES_HANDLES_IN_REGS 1
-#else
-#define ABI_PASSES_HANDLES_IN_REGS 0
-#endif
-
-#if !V8_HOST_ARCH_PPC || !V8_TARGET_ARCH_PPC64 || V8_TARGET_LITTLE_ENDIAN
-#define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 1
-#else
-#define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 0
-#endif
-
-#if !V8_HOST_ARCH_PPC || (V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN)
-#define ABI_CALL_VIA_IP 1
-#else
-#define ABI_CALL_VIA_IP 0
-#endif
-
-#if !V8_HOST_ARCH_PPC || V8_OS_AIX || V8_TARGET_ARCH_PPC64
-#define ABI_TOC_REGISTER 2
-#else
-#define ABI_TOC_REGISTER 13
-#endif
-
-#define INSTR_AND_DATA_CACHE_COHERENCY LWSYNC
-
-namespace v8 {
-namespace internal {
-
-// clang-format off
-#define GENERAL_REGISTERS(V)                              \
-  V(r0)  V(sp)  V(r2)  V(r3)  V(r4)  V(r5)  V(r6)  V(r7)  \
-  V(r8)  V(r9)  V(r10) V(r11) V(ip) V(r13) V(r14) V(r15)  \
-  V(r16) V(r17) V(r18) V(r19) V(r20) V(r21) V(r22) V(r23) \
-  V(r24) V(r25) V(r26) V(r27) V(r28) V(r29) V(r30) V(fp)
-
-#if V8_EMBEDDED_CONSTANT_POOL
-#define ALLOCATABLE_GENERAL_REGISTERS(V)                  \
-  V(r3)  V(r4)  V(r5)  V(r6)  V(r7)                       \
-  V(r8)  V(r9)  V(r10) V(r14) V(r15)                      \
-  V(r16) V(r17) V(r18) V(r19) V(r20) V(r21) V(r22) V(r23) \
-  V(r24) V(r25) V(r26) V(r27) V(r30)
-#else
-#define ALLOCATABLE_GENERAL_REGISTERS(V)                  \
-  V(r3)  V(r4)  V(r5)  V(r6)  V(r7)                       \
-  V(r8)  V(r9)  V(r10) V(r14) V(r15)                      \
-  V(r16) V(r17) V(r18) V(r19) V(r20) V(r21) V(r22) V(r23) \
-  V(r24) V(r25) V(r26) V(r27) V(r28) V(r30)
-#endif
-
-#define LOW_DOUBLE_REGISTERS(V)                           \
-  V(d0)  V(d1)  V(d2)  V(d3)  V(d4)  V(d5)  V(d6)  V(d7)  \
-  V(d8)  V(d9)  V(d10) V(d11) V(d12) V(d13) V(d14) V(d15)
-
-#define NON_LOW_DOUBLE_REGISTERS(V)                       \
-  V(d16) V(d17) V(d18) V(d19) V(d20) V(d21) V(d22) V(d23) \
-  V(d24) V(d25) V(d26) V(d27) V(d28) V(d29) V(d30) V(d31)
-
-#define DOUBLE_REGISTERS(V) \
-  LOW_DOUBLE_REGISTERS(V) NON_LOW_DOUBLE_REGISTERS(V)
-
-#define FLOAT_REGISTERS DOUBLE_REGISTERS
-#define SIMD128_REGISTERS DOUBLE_REGISTERS
-
-#define ALLOCATABLE_DOUBLE_REGISTERS(V)                   \
-  V(d1)  V(d2)  V(d3)  V(d4)  V(d5)  V(d6)  V(d7)         \
-  V(d8)  V(d9)  V(d10) V(d11) V(d12) V(d15)               \
-  V(d16) V(d17) V(d18) V(d19) V(d20) V(d21) V(d22) V(d23) \
-  V(d24) V(d25) V(d26) V(d27) V(d28) V(d29) V(d30) V(d31)
-
-#define C_REGISTERS(V)                                            \
-  V(cr0)  V(cr1)  V(cr2)  V(cr3)  V(cr4)  V(cr5)  V(cr6)  V(cr7)  \
-  V(cr8)  V(cr9)  V(cr10) V(cr11) V(cr12) V(cr15)
-// clang-format on
-
-// Register list in load/store instructions
-// Note that the bit values must match those used in actual instruction encoding
-const int kNumRegs = 32;
-
-// Caller-saved/arguments registers
-const RegList kJSCallerSaved = 1 << 3 |   // r3  a1
-                               1 << 4 |   // r4  a2
-                               1 << 5 |   // r5  a3
-                               1 << 6 |   // r6  a4
-                               1 << 7 |   // r7  a5
-                               1 << 8 |   // r8  a6
-                               1 << 9 |   // r9  a7
-                               1 << 10 |  // r10 a8
-                               1 << 11;
-
-const int kNumJSCallerSaved = 9;
-
-// Return the code of the n-th caller-saved register available to JavaScript
-// e.g. JSCallerSavedReg(0) returns r0.code() == 0
-int JSCallerSavedCode(int n);
-
-// Callee-saved registers preserved when switching from C to JavaScript
-const RegList kCalleeSaved = 1 << 14 |  // r14
-                             1 << 15 |  // r15
-                             1 << 16 |  // r16
-                             1 << 17 |  // r17
-                             1 << 18 |  // r18
-                             1 << 19 |  // r19
-                             1 << 20 |  // r20
-                             1 << 21 |  // r21
-                             1 << 22 |  // r22
-                             1 << 23 |  // r23
-                             1 << 24 |  // r24
-                             1 << 25 |  // r25
-                             1 << 26 |  // r26
-                             1 << 27 |  // r27
-                             1 << 28 |  // r28
-                             1 << 29 |  // r29
-                             1 << 30 |  // r20
-                             1 << 31;   // r31
-
-const int kNumCalleeSaved = 18;
-
-const RegList kCallerSavedDoubles = 1 << 0 |   // d0
-                                    1 << 1 |   // d1
-                                    1 << 2 |   // d2
-                                    1 << 3 |   // d3
-                                    1 << 4 |   // d4
-                                    1 << 5 |   // d5
-                                    1 << 6 |   // d6
-                                    1 << 7 |   // d7
-                                    1 << 8 |   // d8
-                                    1 << 9 |   // d9
-                                    1 << 10 |  // d10
-                                    1 << 11 |  // d11
-                                    1 << 12 |  // d12
-                                    1 << 13;   // d13
-
-const int kNumCallerSavedDoubles = 14;
-
-const RegList kCalleeSavedDoubles = 1 << 14 |  // d14
-                                    1 << 15 |  // d15
-                                    1 << 16 |  // d16
-                                    1 << 17 |  // d17
-                                    1 << 18 |  // d18
-                                    1 << 19 |  // d19
-                                    1 << 20 |  // d20
-                                    1 << 21 |  // d21
-                                    1 << 22 |  // d22
-                                    1 << 23 |  // d23
-                                    1 << 24 |  // d24
-                                    1 << 25 |  // d25
-                                    1 << 26 |  // d26
-                                    1 << 27 |  // d27
-                                    1 << 28 |  // d28
-                                    1 << 29 |  // d29
-                                    1 << 30 |  // d30
-                                    1 << 31;   // d31
-
-const int kNumCalleeSavedDoubles = 18;
-
-// Number of registers for which space is reserved in safepoints. Must be a
-// multiple of 8.
-const int kNumSafepointRegisters = 32;
-
-// The following constants describe the stack frame linkage area as
-// defined by the ABI.  Note that kNumRequiredStackFrameSlots must
-// satisfy alignment requirements (rounding up if required).
-#if V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN
-// [0] back chain
-// [1] condition register save area
-// [2] link register save area
-// [3] TOC save area
-// [4] Parameter1 save area
-// ...
-// [11] Parameter8 save area
-// [12] Parameter9 slot (if necessary)
-// ...
-const int kNumRequiredStackFrameSlots = 12;
-const int kStackFrameLRSlot = 2;
-const int kStackFrameExtraParamSlot = 12;
-#elif V8_OS_AIX || V8_TARGET_ARCH_PPC64
-// [0] back chain
-// [1] condition register save area
-// [2] link register save area
-// [3] reserved for compiler
-// [4] reserved by binder
-// [5] TOC save area
-// [6] Parameter1 save area
-// ...
-// [13] Parameter8 save area
-// [14] Parameter9 slot (if necessary)
-// ...
-#if V8_TARGET_ARCH_PPC64
-const int kNumRequiredStackFrameSlots = 14;
-#else
-const int kNumRequiredStackFrameSlots = 16;
-#endif
-const int kStackFrameLRSlot = 2;
-const int kStackFrameExtraParamSlot = 14;
-#else
-// [0] back chain
-// [1] link register save area
-// [2] Parameter9 slot (if necessary)
-// ...
-const int kNumRequiredStackFrameSlots = 4;
-const int kStackFrameLRSlot = 1;
-const int kStackFrameExtraParamSlot = 2;
-#endif
-
-// Define the list of registers actually saved at safepoints.
-// Note that the number of saved registers may be smaller than the reserved
-// space, i.e. kNumSafepointSavedRegisters <= kNumSafepointRegisters.
-const RegList kSafepointSavedRegisters = kJSCallerSaved | kCalleeSaved;
-const int kNumSafepointSavedRegisters = kNumJSCallerSaved + kNumCalleeSaved;
-
-enum RegisterCode {
-#define REGISTER_CODE(R) kRegCode_##R,
-  GENERAL_REGISTERS(REGISTER_CODE)
-#undef REGISTER_CODE
-      kRegAfterLast
-};
-
-class Register : public RegisterBase<Register, kRegAfterLast> {
- public:
-#if V8_TARGET_LITTLE_ENDIAN
-  static constexpr int kMantissaOffset = 0;
-  static constexpr int kExponentOffset = 4;
-#else
-  static constexpr int kMantissaOffset = 4;
-  static constexpr int kExponentOffset = 0;
-#endif
-
- private:
-  friend class RegisterBase;
-  explicit constexpr Register(int code) : RegisterBase(code) {}
-};
-
-static_assert(IS_TRIVIALLY_COPYABLE(Register) &&
-                  sizeof(Register) == sizeof(int),
-              "Register can efficiently be passed by value");
-
-#define DEFINE_REGISTER(R) \
-  constexpr Register R = Register::from_code<kRegCode_##R>();
-GENERAL_REGISTERS(DEFINE_REGISTER)
-#undef DEFINE_REGISTER
-constexpr Register no_reg = Register::no_reg();
-
-// Aliases
-constexpr Register kLithiumScratch = r11;        // lithium scratch.
-constexpr Register kConstantPoolRegister = r28;  // Constant pool.
-constexpr Register kRootRegister = r29;          // Roots array pointer.
-constexpr Register cp = r30;                     // JavaScript context pointer.
-
-constexpr bool kPadArguments = false;
-constexpr bool kSimpleFPAliasing = true;
-constexpr bool kSimdMaskRegisters = false;
-
-enum DoubleRegisterCode {
-#define REGISTER_CODE(R) kDoubleCode_##R,
-  DOUBLE_REGISTERS(REGISTER_CODE)
-#undef REGISTER_CODE
-      kDoubleAfterLast
-};
-
-// Double word FP register.
-class DoubleRegister : public RegisterBase<DoubleRegister, kDoubleAfterLast> {
- public:
-  // A few double registers are reserved: one as a scratch register and one to
-  // hold 0.0, that does not fit in the immediate field of vmov instructions.
-  // d14: 0.0
-  // d15: scratch register.
-  static constexpr int kSizeInBytes = 8;
-  inline static int NumRegisters();
-
- private:
-  friend class RegisterBase;
-  explicit constexpr DoubleRegister(int code) : RegisterBase(code) {}
-};
-
-static_assert(IS_TRIVIALLY_COPYABLE(DoubleRegister) &&
-                  sizeof(DoubleRegister) == sizeof(int),
-              "DoubleRegister can efficiently be passed by value");
-
-typedef DoubleRegister FloatRegister;
-
-// TODO(ppc) Define SIMD registers.
-typedef DoubleRegister Simd128Register;
-
-#define DEFINE_REGISTER(R) \
-  constexpr DoubleRegister R = DoubleRegister::from_code<kDoubleCode_##R>();
-DOUBLE_REGISTERS(DEFINE_REGISTER)
-#undef DEFINE_REGISTER
-constexpr DoubleRegister no_dreg = DoubleRegister::no_reg();
-
-constexpr DoubleRegister kFirstCalleeSavedDoubleReg = d14;
-constexpr DoubleRegister kLastCalleeSavedDoubleReg = d31;
-constexpr DoubleRegister kDoubleRegZero = d14;
-constexpr DoubleRegister kScratchDoubleReg = d13;
-
-Register ToRegister(int num);
-
-enum CRegisterCode {
-#define REGISTER_CODE(R) kCCode_##R,
-  C_REGISTERS(REGISTER_CODE)
-#undef REGISTER_CODE
-      kCAfterLast
-};
-
-// Coprocessor register
-class CRegister : public RegisterBase<CRegister, kCAfterLast> {
-  friend class RegisterBase;
-  explicit constexpr CRegister(int code) : RegisterBase(code) {}
-};
-
-constexpr CRegister no_creg = CRegister::no_reg();
-#define DECLARE_C_REGISTER(R) \
-  constexpr CRegister R = CRegister::from_code<kCCode_##R>();
-C_REGISTERS(DECLARE_C_REGISTER)
-#undef DECLARE_C_REGISTER
-
-// -----------------------------------------------------------------------------
-// Machine instruction Operands
-
-#if V8_TARGET_ARCH_PPC64
-constexpr RelocInfo::Mode kRelocInfo_NONEPTR = RelocInfo::NONE64;
-#else
-constexpr RelocInfo::Mode kRelocInfo_NONEPTR = RelocInfo::NONE32;
-#endif
-
-// Class Operand represents a shifter operand in data processing instructions
-class Operand BASE_EMBEDDED {
- public:
-  // immediate
-  INLINE(explicit Operand(intptr_t immediate,
-                          RelocInfo::Mode rmode = kRelocInfo_NONEPTR)
-         : rmode_(rmode)) {
-    value_.immediate = immediate;
-  }
-  INLINE(static Operand Zero()) { return Operand(static_cast<intptr_t>(0)); }
-  INLINE(explicit Operand(const ExternalReference& f)
-         : rmode_(RelocInfo::EXTERNAL_REFERENCE)) {
-    value_.immediate = reinterpret_cast<intptr_t>(f.address());
-  }
-  explicit Operand(Handle<HeapObject> handle);
-  INLINE(explicit Operand(Smi* value) : rmode_(kRelocInfo_NONEPTR)) {
-    value_.immediate = reinterpret_cast<intptr_t>(value);
-  }
-  // rm
-  INLINE(explicit Operand(Register rm));
-
-  static Operand EmbeddedNumber(double number);  // Smi or HeapNumber.
-  static Operand EmbeddedCode(CodeStub* stub);
-
-  // Return true if this is a register operand.
-  INLINE(bool is_reg() const) { return rm_.is_valid(); }
-
-  bool must_output_reloc_info(const Assembler* assembler) const;
-
-  inline intptr_t immediate() const {
-    DCHECK(IsImmediate());
-    DCHECK(!IsHeapObjectRequest());
-    return value_.immediate;
-  }
-  bool IsImmediate() const { return !rm_.is_valid(); }
-
-  HeapObjectRequest heap_object_request() const {
-    DCHECK(IsHeapObjectRequest());
-    return value_.heap_object_request;
-  }
-
-  Register rm() const { return rm_; }
-
-  bool IsHeapObjectRequest() const {
-    DCHECK_IMPLIES(is_heap_object_request_, IsImmediate());
-    DCHECK_IMPLIES(is_heap_object_request_,
-                   rmode_ == RelocInfo::EMBEDDED_OBJECT ||
-                       rmode_ == RelocInfo::CODE_TARGET);
-    return is_heap_object_request_;
-  }
-
- private:
-  Register rm_ = no_reg;
-  union Value {
-    Value() {}
-    HeapObjectRequest heap_object_request;  // if is_heap_object_request_
-    intptr_t immediate;                     // otherwise
-  } value_;                                 // valid if rm_ == no_reg
-  bool is_heap_object_request_ = false;
-
-  RelocInfo::Mode rmode_;
-
-  friend class Assembler;
-  friend class MacroAssembler;
-};
-
-
-// Class MemOperand represents a memory operand in load and store instructions
-// On PowerPC we have base register + 16bit signed value
-// Alternatively we can have a 16bit signed value immediate
-class MemOperand BASE_EMBEDDED {
- public:
-  explicit MemOperand(Register rn, int32_t offset = 0);
-
-  explicit MemOperand(Register ra, Register rb);
-
-  int32_t offset() const {
-    DCHECK(rb_ == no_reg);
-    return offset_;
-  }
-
-  // PowerPC - base register
-  Register ra() const {
-    return ra_;
-  }
-
-  Register rb() const {
-    return rb_;
-  }
-
- private:
-  Register ra_;     // base
-  int32_t offset_;  // offset
-  Register rb_;     // index
-
-  friend class Assembler;
-};
-
-
-class DeferredRelocInfo {
- public:
-  DeferredRelocInfo() {}
-  DeferredRelocInfo(int position, RelocInfo::Mode rmode, intptr_t data)
-      : position_(position), rmode_(rmode), data_(data) {}
-
-  int position() const { return position_; }
-  RelocInfo::Mode rmode() const { return rmode_; }
-  intptr_t data() const { return data_; }
-
- private:
-  int position_;
-  RelocInfo::Mode rmode_;
-  intptr_t data_;
-};
-
-
-class Assembler : public AssemblerBase {
- public:
-  // Create an assembler. Instructions and relocation information are emitted
-  // into a buffer, with the instructions starting from the beginning and the
-  // relocation information starting from the end of the buffer. See CodeDesc
-  // for a detailed comment on the layout (globals.h).
-  //
-  // If the provided buffer is nullptr, the assembler allocates and grows its
-  // own buffer, and buffer_size determines the initial buffer size. The buffer
-  // is owned by the assembler and deallocated upon destruction of the
-  // assembler.
-  //
-  // If the provided buffer is not nullptr, the assembler uses the provided
-  // buffer for code generation and assumes its size to be buffer_size. If the
-  // buffer is too small, a fatal error occurs. No deallocation of the buffer is
-  // done upon destruction of the assembler.
-  Assembler(Isolate* isolate, void* buffer, int buffer_size)
-      : Assembler(IsolateData(isolate), buffer, buffer_size) {}
-  Assembler(IsolateData isolate_data, void* buffer, int buffer_size);
-  virtual ~Assembler() {}
-
-  // GetCode emits any pending (non-emitted) code and fills the descriptor
-  // desc. GetCode() is idempotent; it returns the same result if no other
-  // Assembler functions are invoked in between GetCode() calls.
-  void GetCode(Isolate* isolate, CodeDesc* desc);
-
-  // Label operations & relative jumps (PPUM Appendix D)
-  //
-  // Takes a branch opcode (cc) and a label (L) and generates
-  // either a backward branch or a forward branch and links it
-  // to the label fixup chain. Usage:
-  //
-  // Label L;    // unbound label
-  // j(cc, &L);  // forward branch to unbound label
-  // bind(&L);   // bind label to the current pc
-  // j(cc, &L);  // backward branch to bound label
-  // bind(&L);   // illegal: a label may be bound only once
-  //
-  // Note: The same Label can be used for forward and backward branches
-  // but it may be bound only once.
-
-  void bind(Label* L);  // binds an unbound label L to the current code position
-
-  // Links a label at the current pc_offset().  If already bound, returns the
-  // bound position.  If already linked, returns the position of the prior link.
-  // Otherwise, returns the current pc_offset().
-  int link(Label* L);
-
-  // Determines if Label is bound and near enough so that a single
-  // branch instruction can be used to reach it.
-  bool is_near(Label* L, Condition cond);
-
-  // Returns the branch offset to the given label from the current code position
-  // Links the label to the current position if it is still unbound
-  int branch_offset(Label* L) {
-    if (L->is_unused() && !trampoline_emitted_) {
-      TrackBranch();
-    }
-    return link(L) - pc_offset();
-  }
-
-  // Puts a labels target address at the given position.
-  // The high 8 bits are set to zero.
-  void label_at_put(Label* L, int at_offset);
-
-  INLINE(static bool IsConstantPoolLoadStart(
-      Address pc, ConstantPoolEntry::Access* access = nullptr));
-  INLINE(static bool IsConstantPoolLoadEnd(
-      Address pc, ConstantPoolEntry::Access* access = nullptr));
-  INLINE(static int GetConstantPoolOffset(Address pc,
-                                          ConstantPoolEntry::Access access,
-                                          ConstantPoolEntry::Type type));
-  INLINE(void PatchConstantPoolAccessInstruction(
-      int pc_offset, int offset, ConstantPoolEntry::Access access,
-      ConstantPoolEntry::Type type));
-
-  // Return the address in the constant pool of the code target address used by
-  // the branch/call instruction at pc, or the object in a mov.
-  INLINE(static Address target_constant_pool_address_at(
-      Address pc, Address constant_pool, ConstantPoolEntry::Access access,
-      ConstantPoolEntry::Type type));
-
-  // Read/Modify the code target address in the branch/call instruction at pc.
-  // The isolate argument is unused (and may be nullptr) when skipping flushing.
-  INLINE(static Address target_address_at(Address pc, Address constant_pool));
-  INLINE(static void set_target_address_at(
-      Isolate* isolate, Address pc, Address constant_pool, Address target,
-      ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED));
-
-  // Return the code target address at a call site from the return address
-  // of that call in the instruction stream.
-  inline static Address target_address_from_return_address(Address pc);
-
-  // Given the address of the beginning of a call, return the address
-  // in the instruction stream that the call will return to.
-  INLINE(static Address return_address_from_call_start(Address pc));
-
-  // This sets the branch destination.
-  // This is for calls and branches within generated code.
-  inline static void deserialization_set_special_target_at(
-      Isolate* isolate, Address instruction_payload, Code* code,
-      Address target);
-
-  // This sets the internal reference at the pc.
-  inline static void deserialization_set_target_internal_reference_at(
-      Isolate* isolate, Address pc, Address target,
-      RelocInfo::Mode mode = RelocInfo::INTERNAL_REFERENCE);
-
-  // Size of an instruction.
-  static constexpr int kInstrSize = sizeof(Instr);
-
-  // Here we are patching the address in the LUI/ORI instruction pair.
-  // These values are used in the serialization process and must be zero for
-  // PPC platform, as Code, Embedded Object or External-reference pointers
-  // are split across two consecutive instructions and don't exist separately
-  // in the code, so the serializer should not step forwards in memory after
-  // a target is resolved and written.
-  static constexpr int kSpecialTargetSize = 0;
-
-// Number of instructions to load an address via a mov sequence.
-#if V8_TARGET_ARCH_PPC64
-  static constexpr int kMovInstructionsConstantPool = 1;
-  static constexpr int kMovInstructionsNoConstantPool = 5;
-#if defined(V8_PPC_TAGGING_OPT)
-  static constexpr int kTaggedLoadInstructions = 1;
-#else
-  static constexpr int kTaggedLoadInstructions = 2;
-#endif
-#else
-  static constexpr int kMovInstructionsConstantPool = 1;
-  static constexpr int kMovInstructionsNoConstantPool = 2;
-  static constexpr int kTaggedLoadInstructions = 1;
-#endif
-  static constexpr int kMovInstructions = FLAG_enable_embedded_constant_pool
-                                              ? kMovInstructionsConstantPool
-                                              : kMovInstructionsNoConstantPool;
-
-  // Distance between the instruction referring to the address of the call
-  // target and the return address.
-
-  // Call sequence is a FIXED_SEQUENCE:
-  // mov     r8, @ call address
-  // mtlr    r8
-  // blrl
-  //                      @ return address
-  static constexpr int kCallTargetAddressOffset =
-      (kMovInstructions + 2) * kInstrSize;
-
-  static inline int encode_crbit(const CRegister& cr, enum CRBit crbit) {
-    return ((cr.code() * CRWIDTH) + crbit);
-  }
-
-#define DECLARE_PPC_X_INSTRUCTIONS_A_FORM(name, instr_name, instr_value)    \
-  inline void name(const Register rt, const Register ra,                    \
-                   const Register rb, const RCBit rc = LeaveRC) {           \
-    x_form(instr_name, rt, ra, rb, rc);                                     \
-  }
-
-#define DECLARE_PPC_X_INSTRUCTIONS_B_FORM(name, instr_name, instr_value)    \
-  inline void name(const Register ra, const Register rs,                    \
-                   const Register rb, const RCBit rc = LeaveRC) {           \
-    x_form(instr_name, rs, ra, rb, rc);                                     \
-  }
-
-#define DECLARE_PPC_X_INSTRUCTIONS_C_FORM(name, instr_name, instr_value)    \
-  inline void name(const Register dst, const Register src,                  \
-                   const RCBit rc = LeaveRC) {                              \
-    x_form(instr_name, src, dst, r0, rc);                                   \
-  }
-
-#define DECLARE_PPC_X_INSTRUCTIONS_D_FORM(name, instr_name, instr_value) \
-  template <class R>                                                     \
-  inline void name(const R rt, const Register ra, const Register rb,     \
-                   const RCBit rc = LeaveRC) {                           \
-    DCHECK(ra != r0);                                                    \
-    x_form(instr_name, rt.code(), ra.code(), rb.code(), rc);             \
-  }                                                                      \
-  template <class R>                                                     \
-  inline void name(const R dst, const MemOperand& src) {                 \
-    name(dst, src.ra(), src.rb());                                       \
-  }
-
-#define DECLARE_PPC_X_INSTRUCTIONS_E_FORM(name, instr_name, instr_value)    \
-  inline void name(const Register dst, const Register src,                  \
-                   const int sh, const RCBit rc = LeaveRC) {                \
-    x_form(instr_name, src.code(), dst.code(), sh, rc);                     \
-  }
-
-#define DECLARE_PPC_X_INSTRUCTIONS_F_FORM(name, instr_name, instr_value)    \
-  inline void name(const Register src1, const Register src2,                \
-                   const CRegister cr = cr7, const RCBit rc = LeaveRC) {    \
-    x_form(instr_name, cr, src1, src2, rc);                                 \
-  }                                                                         \
-  inline void name##w(const Register src1, const Register src2,             \
-                      const CRegister cr = cr7, const RCBit rc = LeaveRC) { \
-    x_form(instr_name, cr.code() * B2, src1.code(), src2.code(), LeaveRC);  \
-  }
-
-#define DECLARE_PPC_X_INSTRUCTIONS_EH_S_FORM(name, instr_name, instr_value) \
-  inline void name(const Register dst, const MemOperand& src) {             \
-    x_form(instr_name, src.ra(), dst, src.rb(), SetEH);                     \
-  }
-#define DECLARE_PPC_X_INSTRUCTIONS_EH_L_FORM(name, instr_name, instr_value) \
-  inline void name(const Register dst, const MemOperand& src) {             \
-    DCHECK(src.ra_ != r0);                                                  \
-    x_form(instr_name, src.ra(), dst, src.rb(), SetEH);                     \
-  }
-
-  inline void x_form(Instr instr, int f1, int f2, int f3, int rc) {
-    emit(instr | f1 * B21 | f2 * B16 | f3 * B11 | rc);
-  }
-  inline void x_form(Instr instr, Register rs, Register ra, Register rb,
-                     RCBit rc) {
-    emit(instr | rs.code() * B21 | ra.code() * B16 | rb.code() * B11 | rc);
-  }
-  inline void x_form(Instr instr, Register ra, Register rs, Register rb,
-                     EHBit eh = SetEH) {
-    emit(instr | rs.code() * B21 | ra.code() * B16 | rb.code() * B11 | eh);
-  }
-  inline void x_form(Instr instr, CRegister cr, Register s1, Register s2,
-                     RCBit rc) {
-#if V8_TARGET_ARCH_PPC64
-    int L = 1;
-#else
-    int L = 0;
-#endif
-    emit(instr | cr.code() * B23 | L * B21 | s1.code() * B16 |
-         s2.code() * B11 | rc);
-  }
-
-  PPC_X_OPCODE_A_FORM_LIST(DECLARE_PPC_X_INSTRUCTIONS_A_FORM)
-  PPC_X_OPCODE_B_FORM_LIST(DECLARE_PPC_X_INSTRUCTIONS_B_FORM)
-  PPC_X_OPCODE_C_FORM_LIST(DECLARE_PPC_X_INSTRUCTIONS_C_FORM)
-  PPC_X_OPCODE_D_FORM_LIST(DECLARE_PPC_X_INSTRUCTIONS_D_FORM)
-  PPC_X_OPCODE_E_FORM_LIST(DECLARE_PPC_X_INSTRUCTIONS_E_FORM)
-  PPC_X_OPCODE_F_FORM_LIST(DECLARE_PPC_X_INSTRUCTIONS_F_FORM)
-  PPC_X_OPCODE_EH_S_FORM_LIST(DECLARE_PPC_X_INSTRUCTIONS_EH_S_FORM)
-  PPC_X_OPCODE_EH_L_FORM_LIST(DECLARE_PPC_X_INSTRUCTIONS_EH_L_FORM)
-
-  inline void notx(Register dst, Register src, RCBit rc = LeaveRC) {
-    nor(dst, src, src, rc);
-  }
-  inline void lwax(Register rt, const MemOperand& src) {
-#if V8_TARGET_ARCH_PPC64
-    Register ra = src.ra();
-    Register rb = src.rb();
-    DCHECK(ra != r0);
-    x_form(LWAX, rt, ra, rb, LeaveRC);
-#else
-    lwzx(rt, src);
-#endif
-  }
-  inline void extsw(Register rs, Register ra, RCBit rc = LeaveRC) {
-#if V8_TARGET_ARCH_PPC64
-    emit(EXT2 | EXTSW | ra.code() * B21 | rs.code() * B16 | rc);
-#else
-    // nop on 32-bit
-    DCHECK(rs == ra && rc == LeaveRC);
-#endif
-  }
-
-#undef DECLARE_PPC_X_INSTRUCTIONS_A_FORM
-#undef DECLARE_PPC_X_INSTRUCTIONS_B_FORM
-#undef DECLARE_PPC_X_INSTRUCTIONS_C_FORM
-#undef DECLARE_PPC_X_INSTRUCTIONS_D_FORM
-#undef DECLARE_PPC_X_INSTRUCTIONS_E_FORM
-#undef DECLARE_PPC_X_INSTRUCTIONS_F_FORM
-#undef DECLARE_PPC_X_INSTRUCTIONS_EH_S_FORM
-#undef DECLARE_PPC_X_INSTRUCTIONS_EH_L_FORM
-
-#define DECLARE_PPC_XX3_INSTRUCTIONS(name, instr_name, instr_value)  \
-  inline void name(const DoubleRegister rt, const DoubleRegister ra, \
-                   const DoubleRegister rb) {                        \
-    xx3_form(instr_name, rt, ra, rb);                                \
-  }
-
-  inline void xx3_form(Instr instr, DoubleRegister t, DoubleRegister a,
-                       DoubleRegister b) {
-    int AX = ((a.code() & 0x20) >> 5) & 0x1;
-    int BX = ((b.code() & 0x20) >> 5) & 0x1;
-    int TX = ((t.code() & 0x20) >> 5) & 0x1;
-
-    emit(instr | (t.code() & 0x1F) * B21 | (a.code() & 0x1F) * B16 |
-         (b.code() & 0x1F) * B11 | AX * B2 | BX * B1 | TX);
-  }
-
-  PPC_XX3_OPCODE_LIST(DECLARE_PPC_XX3_INSTRUCTIONS)
-#undef DECLARE_PPC_XX3_INSTRUCTIONS
-
-  // ---------------------------------------------------------------------------
-  // Code generation
-
-  // Insert the smallest number of nop instructions
-  // possible to align the pc offset to a multiple
-  // of m. m must be a power of 2 (>= 4).
-  void Align(int m);
-  // Insert the smallest number of zero bytes possible to align the pc offset
-  // to a mulitple of m. m must be a power of 2 (>= 2).
-  void DataAlign(int m);
-  // Aligns code to something that's optimal for a jump target for the platform.
-  void CodeTargetAlign();
-
-  // Branch instructions
-  void bclr(BOfield bo, int condition_bit, LKBit lk);
-  void blr();
-  void bc(int branch_offset, BOfield bo, int condition_bit, LKBit lk = LeaveLK);
-  void b(int branch_offset, LKBit lk);
-
-  void bcctr(BOfield bo, int condition_bit, LKBit lk);
-  void bctr();
-  void bctrl();
-
-  // Convenience branch instructions using labels
-  void b(Label* L, LKBit lk = LeaveLK) { b(branch_offset(L), lk); }
-
-  inline CRegister cmpi_optimization(CRegister cr) {
-    // Check whether the branch is preceded by an optimizable cmpi against 0.
-    // The cmpi can be deleted if it is also preceded by an instruction that
-    // sets the register used by the compare and supports a dot form.
-    unsigned int sradi_mask = kOpcodeMask | kExt2OpcodeVariant2Mask;
-    unsigned int srawi_mask = kOpcodeMask | kExt2OpcodeMask;
-    int pos = pc_offset();
-    int cmpi_pos = pc_offset() - kInstrSize;
-
-    if (cmpi_pos > 0 && optimizable_cmpi_pos_ == cmpi_pos &&
-        cmpi_cr_.code() == cr.code() && last_bound_pos_ != pos) {
-      int xpos = cmpi_pos - kInstrSize;
-      int xinstr = instr_at(xpos);
-      int cmpi_ra = (instr_at(cmpi_pos) & 0x1f0000) >> 16;
-      // ra is at the same bit position for the three cases below.
-      int ra = (xinstr & 0x1f0000) >> 16;
-      if (cmpi_ra == ra) {
-        if ((xinstr & sradi_mask) == (EXT2 | SRADIX)) {
-          cr = cr0;
-          instr_at_put(xpos, xinstr | SetRC);
-          pc_ -= kInstrSize;
-        } else if ((xinstr & srawi_mask) == (EXT2 | SRAWIX)) {
-          cr = cr0;
-          instr_at_put(xpos, xinstr | SetRC);
-          pc_ -= kInstrSize;
-        } else if ((xinstr & kOpcodeMask) == ANDIx) {
-          cr = cr0;
-          pc_ -= kInstrSize;
-          // nothing to do here since andi. records.
-        }
-        // didn't match one of the above, must keep cmpwi.
-      }
-    }
-    return cr;
-  }
-
-  void bc_short(Condition cond, Label* L, CRegister cr = cr7,
-                LKBit lk = LeaveLK) {
-    DCHECK(cond != al);
-    DCHECK(cr.code() >= 0 && cr.code() <= 7);
-
-    cr = cmpi_optimization(cr);
-
-    int b_offset = branch_offset(L);
-
-    switch (cond) {
-      case eq:
-        bc(b_offset, BT, encode_crbit(cr, CR_EQ), lk);
-        break;
-      case ne:
-        bc(b_offset, BF, encode_crbit(cr, CR_EQ), lk);
-        break;
-      case gt:
-        bc(b_offset, BT, encode_crbit(cr, CR_GT), lk);
-        break;
-      case le:
-        bc(b_offset, BF, encode_crbit(cr, CR_GT), lk);
-        break;
-      case lt:
-        bc(b_offset, BT, encode_crbit(cr, CR_LT), lk);
-        break;
-      case ge:
-        bc(b_offset, BF, encode_crbit(cr, CR_LT), lk);
-        break;
-      case unordered:
-        bc(b_offset, BT, encode_crbit(cr, CR_FU), lk);
-        break;
-      case ordered:
-        bc(b_offset, BF, encode_crbit(cr, CR_FU), lk);
-        break;
-      case overflow:
-        bc(b_offset, BT, encode_crbit(cr, CR_SO), lk);
-        break;
-      case nooverflow:
-        bc(b_offset, BF, encode_crbit(cr, CR_SO), lk);
-        break;
-      default:
-        UNIMPLEMENTED();
-    }
-  }
-
-  void bclr(Condition cond, CRegister cr = cr7, LKBit lk = LeaveLK) {
-    DCHECK(cond != al);
-    DCHECK(cr.code() >= 0 && cr.code() <= 7);
-
-    cr = cmpi_optimization(cr);
-
-    switch (cond) {
-      case eq:
-        bclr(BT, encode_crbit(cr, CR_EQ), lk);
-        break;
-      case ne:
-        bclr(BF, encode_crbit(cr, CR_EQ), lk);
-        break;
-      case gt:
-        bclr(BT, encode_crbit(cr, CR_GT), lk);
-        break;
-      case le:
-        bclr(BF, encode_crbit(cr, CR_GT), lk);
-        break;
-      case lt:
-        bclr(BT, encode_crbit(cr, CR_LT), lk);
-        break;
-      case ge:
-        bclr(BF, encode_crbit(cr, CR_LT), lk);
-        break;
-      case unordered:
-        bclr(BT, encode_crbit(cr, CR_FU), lk);
-        break;
-      case ordered:
-        bclr(BF, encode_crbit(cr, CR_FU), lk);
-        break;
-      case overflow:
-        bclr(BT, encode_crbit(cr, CR_SO), lk);
-        break;
-      case nooverflow:
-        bclr(BF, encode_crbit(cr, CR_SO), lk);
-        break;
-      default:
-        UNIMPLEMENTED();
-    }
-  }
-
-  void isel(Register rt, Register ra, Register rb, int cb);
-  void isel(Condition cond, Register rt, Register ra, Register rb,
-            CRegister cr = cr7) {
-    DCHECK(cond != al);
-    DCHECK(cr.code() >= 0 && cr.code() <= 7);
-
-    cr = cmpi_optimization(cr);
-
-    switch (cond) {
-      case eq:
-        isel(rt, ra, rb, encode_crbit(cr, CR_EQ));
-        break;
-      case ne:
-        isel(rt, rb, ra, encode_crbit(cr, CR_EQ));
-        break;
-      case gt:
-        isel(rt, ra, rb, encode_crbit(cr, CR_GT));
-        break;
-      case le:
-        isel(rt, rb, ra, encode_crbit(cr, CR_GT));
-        break;
-      case lt:
-        isel(rt, ra, rb, encode_crbit(cr, CR_LT));
-        break;
-      case ge:
-        isel(rt, rb, ra, encode_crbit(cr, CR_LT));
-        break;
-      case unordered:
-        isel(rt, ra, rb, encode_crbit(cr, CR_FU));
-        break;
-      case ordered:
-        isel(rt, rb, ra, encode_crbit(cr, CR_FU));
-        break;
-      case overflow:
-        isel(rt, ra, rb, encode_crbit(cr, CR_SO));
-        break;
-      case nooverflow:
-        isel(rt, rb, ra, encode_crbit(cr, CR_SO));
-        break;
-      default:
-        UNIMPLEMENTED();
-    }
-  }
-
-  void b(Condition cond, Label* L, CRegister cr = cr7, LKBit lk = LeaveLK) {
-    if (cond == al) {
-      b(L, lk);
-      return;
-    }
-
-    if ((L->is_bound() && is_near(L, cond)) || !is_trampoline_emitted()) {
-      bc_short(cond, L, cr, lk);
-      return;
-    }
-
-    Label skip;
-    Condition neg_cond = NegateCondition(cond);
-    bc_short(neg_cond, &skip, cr);
-    b(L, lk);
-    bind(&skip);
-  }
-
-  void bne(Label* L, CRegister cr = cr7, LKBit lk = LeaveLK) {
-    b(ne, L, cr, lk);
-  }
-  void beq(Label* L, CRegister cr = cr7, LKBit lk = LeaveLK) {
-    b(eq, L, cr, lk);
-  }
-  void blt(Label* L, CRegister cr = cr7, LKBit lk = LeaveLK) {
-    b(lt, L, cr, lk);
-  }
-  void bge(Label* L, CRegister cr = cr7, LKBit lk = LeaveLK) {
-    b(ge, L, cr, lk);
-  }
-  void ble(Label* L, CRegister cr = cr7, LKBit lk = LeaveLK) {
-    b(le, L, cr, lk);
-  }
-  void bgt(Label* L, CRegister cr = cr7, LKBit lk = LeaveLK) {
-    b(gt, L, cr, lk);
-  }
-  void bunordered(Label* L, CRegister cr = cr7, LKBit lk = LeaveLK) {
-    b(unordered, L, cr, lk);
-  }
-  void bordered(Label* L, CRegister cr = cr7, LKBit lk = LeaveLK) {
-    b(ordered, L, cr, lk);
-  }
-  void boverflow(Label* L, CRegister cr = cr0, LKBit lk = LeaveLK) {
-    b(overflow, L, cr, lk);
-  }
-  void bnooverflow(Label* L, CRegister cr = cr0, LKBit lk = LeaveLK) {
-    b(nooverflow, L, cr, lk);
-  }
-
-  // Decrement CTR; branch if CTR != 0
-  void bdnz(Label* L, LKBit lk = LeaveLK) {
-    bc(branch_offset(L), DCBNZ, 0, lk);
-  }
-
-  // Data-processing instructions
-
-  void sub(Register dst, Register src1, Register src2, OEBit s = LeaveOE,
-           RCBit r = LeaveRC);
-
-  void subc(Register dst, Register src1, Register src2, OEBit s = LeaveOE,
-            RCBit r = LeaveRC);
-  void sube(Register dst, Register src1, Register src2, OEBit s = LeaveOE,
-            RCBit r = LeaveRC);
-
-  void subfic(Register dst, Register src, const Operand& imm);
-
-  void add(Register dst, Register src1, Register src2, OEBit s = LeaveOE,
-           RCBit r = LeaveRC);
-
-  void addc(Register dst, Register src1, Register src2, OEBit o = LeaveOE,
-            RCBit r = LeaveRC);
-  void adde(Register dst, Register src1, Register src2, OEBit o = LeaveOE,
-            RCBit r = LeaveRC);
-  void addze(Register dst, Register src1, OEBit o = LeaveOE, RCBit r = LeaveRC);
-
-  void mullw(Register dst, Register src1, Register src2, OEBit o = LeaveOE,
-             RCBit r = LeaveRC);
-
-  void mulhw(Register dst, Register src1, Register src2, RCBit r = LeaveRC);
-  void mulhwu(Register dst, Register src1, Register src2, RCBit r = LeaveRC);
-
-  void divw(Register dst, Register src1, Register src2, OEBit o = LeaveOE,
-            RCBit r = LeaveRC);
-  void divwu(Register dst, Register src1, Register src2, OEBit o = LeaveOE,
-             RCBit r = LeaveRC);
-
-  void addi(Register dst, Register src, const Operand& imm);
-  void addis(Register dst, Register src, const Operand& imm);
-  void addic(Register dst, Register src, const Operand& imm);
-
-  void andi(Register ra, Register rs, const Operand& imm);
-  void andis(Register ra, Register rs, const Operand& imm);
-  void ori(Register dst, Register src, const Operand& imm);
-  void oris(Register dst, Register src, const Operand& imm);
-  void xori(Register dst, Register src, const Operand& imm);
-  void xoris(Register ra, Register rs, const Operand& imm);
-  void cmpi(Register src1, const Operand& src2, CRegister cr = cr7);
-  void cmpli(Register src1, const Operand& src2, CRegister cr = cr7);
-  void cmpwi(Register src1, const Operand& src2, CRegister cr = cr7);
-  void cmplwi(Register src1, const Operand& src2, CRegister cr = cr7);
-  void li(Register dst, const Operand& src);
-  void lis(Register dst, const Operand& imm);
-  void mr(Register dst, Register src);
-
-  void lbz(Register dst, const MemOperand& src);
-  void lhz(Register dst, const MemOperand& src);
-  void lha(Register dst, const MemOperand& src);
-  void lwz(Register dst, const MemOperand& src);
-  void lwzu(Register dst, const MemOperand& src);
-  void lwa(Register dst, const MemOperand& src);
-  void stb(Register dst, const MemOperand& src);
-  void sth(Register dst, const MemOperand& src);
-  void stw(Register dst, const MemOperand& src);
-  void stwu(Register dst, const MemOperand& src);
-  void neg(Register rt, Register ra, OEBit o = LeaveOE, RCBit c = LeaveRC);
-
-#if V8_TARGET_ARCH_PPC64
-  void ld(Register rd, const MemOperand& src);
-  void ldu(Register rd, const MemOperand& src);
-  void std(Register rs, const MemOperand& src);
-  void stdu(Register rs, const MemOperand& src);
-  void rldic(Register dst, Register src, int sh, int mb, RCBit r = LeaveRC);
-  void rldicl(Register dst, Register src, int sh, int mb, RCBit r = LeaveRC);
-  void rldcl(Register ra, Register rs, Register rb, int mb, RCBit r = LeaveRC);
-  void rldicr(Register dst, Register src, int sh, int me, RCBit r = LeaveRC);
-  void rldimi(Register dst, Register src, int sh, int mb, RCBit r = LeaveRC);
-  void sldi(Register dst, Register src, const Operand& val, RCBit rc = LeaveRC);
-  void srdi(Register dst, Register src, const Operand& val, RCBit rc = LeaveRC);
-  void clrrdi(Register dst, Register src, const Operand& val,
-              RCBit rc = LeaveRC);
-  void clrldi(Register dst, Register src, const Operand& val,
-              RCBit rc = LeaveRC);
-  void sradi(Register ra, Register rs, int sh, RCBit r = LeaveRC);
-  void rotld(Register ra, Register rs, Register rb, RCBit r = LeaveRC);
-  void rotldi(Register ra, Register rs, int sh, RCBit r = LeaveRC);
-  void rotrdi(Register ra, Register rs, int sh, RCBit r = LeaveRC);
-  void mulld(Register dst, Register src1, Register src2, OEBit o = LeaveOE,
-             RCBit r = LeaveRC);
-  void divd(Register dst, Register src1, Register src2, OEBit o = LeaveOE,
-            RCBit r = LeaveRC);
-  void divdu(Register dst, Register src1, Register src2, OEBit o = LeaveOE,
-             RCBit r = LeaveRC);
-#endif
-
-  void rlwinm(Register ra, Register rs, int sh, int mb, int me,
-              RCBit rc = LeaveRC);
-  void rlwimi(Register ra, Register rs, int sh, int mb, int me,
-              RCBit rc = LeaveRC);
-  void rlwnm(Register ra, Register rs, Register rb, int mb, int me,
-             RCBit rc = LeaveRC);
-  void slwi(Register dst, Register src, const Operand& val, RCBit rc = LeaveRC);
-  void srwi(Register dst, Register src, const Operand& val, RCBit rc = LeaveRC);
-  void clrrwi(Register dst, Register src, const Operand& val,
-              RCBit rc = LeaveRC);
-  void clrlwi(Register dst, Register src, const Operand& val,
-              RCBit rc = LeaveRC);
-  void rotlw(Register ra, Register rs, Register rb, RCBit r = LeaveRC);
-  void rotlwi(Register ra, Register rs, int sh, RCBit r = LeaveRC);
-  void rotrwi(Register ra, Register rs, int sh, RCBit r = LeaveRC);
-
-  void subi(Register dst, Register src1, const Operand& src2);
-
-  void mov(Register dst, const Operand& src);
-  void bitwise_mov(Register dst, intptr_t value);
-  void bitwise_mov32(Register dst, int32_t value);
-  void bitwise_add32(Register dst, Register src, int32_t value);
-
-  // Load the position of the label relative to the generated code object
-  // pointer in a register.
-  void mov_label_offset(Register dst, Label* label);
-
-  // dst = base + label position + delta
-  void add_label_offset(Register dst, Register base, Label* label,
-                        int delta = 0);
-
-  // Load the address of the label in a register and associate with an
-  // internal reference relocation.
-  void mov_label_addr(Register dst, Label* label);
-
-  // Emit the address of the label (i.e. a jump table entry) and associate with
-  // an internal reference relocation.
-  void emit_label_addr(Label* label);
-
-  // Multiply instructions
-  void mul(Register dst, Register src1, Register src2, OEBit s = LeaveOE,
-           RCBit r = LeaveRC);
-
-  // Miscellaneous arithmetic instructions
-
-  // Special register access
-  void crxor(int bt, int ba, int bb);
-  void crclr(int bt) { crxor(bt, bt, bt); }
-  void creqv(int bt, int ba, int bb);
-  void crset(int bt) { creqv(bt, bt, bt); }
-  void mflr(Register dst);
-  void mtlr(Register src);
-  void mtctr(Register src);
-  void mtxer(Register src);
-  void mcrfs(CRegister cr, FPSCRBit bit);
-  void mfcr(Register dst);
-#if V8_TARGET_ARCH_PPC64
-  void mffprd(Register dst, DoubleRegister src);
-  void mffprwz(Register dst, DoubleRegister src);
-  void mtfprd(DoubleRegister dst, Register src);
-  void mtfprwz(DoubleRegister dst, Register src);
-  void mtfprwa(DoubleRegister dst, Register src);
-#endif
-
-  void function_descriptor();
-
-  // Exception-generating instructions and debugging support
-  void stop(const char* msg, Condition cond = al,
-            int32_t code = kDefaultStopCode, CRegister cr = cr7);
-
-  void bkpt(uint32_t imm16);  // v5 and above
-
-  void dcbf(Register ra, Register rb);
-  void sync();
-  void lwsync();
-  void icbi(Register ra, Register rb);
-  void isync();
-
-  // Support for floating point
-  void lfd(const DoubleRegister frt, const MemOperand& src);
-  void lfdu(const DoubleRegister frt, const MemOperand& src);
-  void lfs(const DoubleRegister frt, const MemOperand& src);
-  void lfsu(const DoubleRegister frt, const MemOperand& src);
-  void stfd(const DoubleRegister frs, const MemOperand& src);
-  void stfdu(const DoubleRegister frs, const MemOperand& src);
-  void stfs(const DoubleRegister frs, const MemOperand& src);
-  void stfsu(const DoubleRegister frs, const MemOperand& src);
-
-  void fadd(const DoubleRegister frt, const DoubleRegister fra,
-            const DoubleRegister frb, RCBit rc = LeaveRC);
-  void fsub(const DoubleRegister frt, const DoubleRegister fra,
-            const DoubleRegister frb, RCBit rc = LeaveRC);
-  void fdiv(const DoubleRegister frt, const DoubleRegister fra,
-            const DoubleRegister frb, RCBit rc = LeaveRC);
-  void fmul(const DoubleRegister frt, const DoubleRegister fra,
-            const DoubleRegister frc, RCBit rc = LeaveRC);
-  void fcmpu(const DoubleRegister fra, const DoubleRegister frb,
-             CRegister cr = cr7);
-  void fmr(const DoubleRegister frt, const DoubleRegister frb,
-           RCBit rc = LeaveRC);
-  void fctiwz(const DoubleRegister frt, const DoubleRegister frb);
-  void fctiw(const DoubleRegister frt, const DoubleRegister frb);
-  void frin(const DoubleRegister frt, const DoubleRegister frb,
-            RCBit rc = LeaveRC);
-  void friz(const DoubleRegister frt, const DoubleRegister frb,
-            RCBit rc = LeaveRC);
-  void frip(const DoubleRegister frt, const DoubleRegister frb,
-            RCBit rc = LeaveRC);
-  void frim(const DoubleRegister frt, const DoubleRegister frb,
-            RCBit rc = LeaveRC);
-  void frsp(const DoubleRegister frt, const DoubleRegister frb,
-            RCBit rc = LeaveRC);
-  void fcfid(const DoubleRegister frt, const DoubleRegister frb,
-             RCBit rc = LeaveRC);
-  void fcfidu(const DoubleRegister frt, const DoubleRegister frb,
-              RCBit rc = LeaveRC);
-  void fcfidus(const DoubleRegister frt, const DoubleRegister frb,
-               RCBit rc = LeaveRC);
-  void fcfids(const DoubleRegister frt, const DoubleRegister frb,
-              RCBit rc = LeaveRC);
-  void fctid(const DoubleRegister frt, const DoubleRegister frb,
-             RCBit rc = LeaveRC);
-  void fctidz(const DoubleRegister frt, const DoubleRegister frb,
-              RCBit rc = LeaveRC);
-  void fctidu(const DoubleRegister frt, const DoubleRegister frb,
-              RCBit rc = LeaveRC);
-  void fctiduz(const DoubleRegister frt, const DoubleRegister frb,
-               RCBit rc = LeaveRC);
-  void fsel(const DoubleRegister frt, const DoubleRegister fra,
-            const DoubleRegister frc, const DoubleRegister frb,
-            RCBit rc = LeaveRC);
-  void fneg(const DoubleRegister frt, const DoubleRegister frb,
-            RCBit rc = LeaveRC);
-  void mtfsb0(FPSCRBit bit, RCBit rc = LeaveRC);
-  void mtfsb1(FPSCRBit bit, RCBit rc = LeaveRC);
-  void mtfsfi(int bf, int immediate, RCBit rc = LeaveRC);
-  void mffs(const DoubleRegister frt, RCBit rc = LeaveRC);
-  void mtfsf(const DoubleRegister frb, bool L = 1, int FLM = 0, bool W = 0,
-             RCBit rc = LeaveRC);
-  void fsqrt(const DoubleRegister frt, const DoubleRegister frb,
-             RCBit rc = LeaveRC);
-  void fabs(const DoubleRegister frt, const DoubleRegister frb,
-            RCBit rc = LeaveRC);
-  void fmadd(const DoubleRegister frt, const DoubleRegister fra,
-             const DoubleRegister frc, const DoubleRegister frb,
-             RCBit rc = LeaveRC);
-  void fmsub(const DoubleRegister frt, const DoubleRegister fra,
-             const DoubleRegister frc, const DoubleRegister frb,
-             RCBit rc = LeaveRC);
-
-  // Pseudo instructions
-
-  // Different nop operations are used by the code generator to detect certain
-  // states of the generated code.
-  enum NopMarkerTypes {
-    NON_MARKING_NOP = 0,
-    GROUP_ENDING_NOP,
-    DEBUG_BREAK_NOP,
-    // IC markers.
-    PROPERTY_ACCESS_INLINED,
-    PROPERTY_ACCESS_INLINED_CONTEXT,
-    PROPERTY_ACCESS_INLINED_CONTEXT_DONT_DELETE,
-    // Helper values.
-    LAST_CODE_MARKER,
-    FIRST_IC_MARKER = PROPERTY_ACCESS_INLINED
-  };
-
-  void nop(int type = 0);  // 0 is the default non-marking type.
-
-  void push(Register src) {
-#if V8_TARGET_ARCH_PPC64
-    stdu(src, MemOperand(sp, -kPointerSize));
-#else
-    stwu(src, MemOperand(sp, -kPointerSize));
-#endif
-  }
-
-  void pop(Register dst) {
-#if V8_TARGET_ARCH_PPC64
-    ld(dst, MemOperand(sp));
-#else
-    lwz(dst, MemOperand(sp));
-#endif
-    addi(sp, sp, Operand(kPointerSize));
-  }
-
-  void pop() { addi(sp, sp, Operand(kPointerSize)); }
-
-  // Jump unconditionally to given label.
-  void jmp(Label* L) { b(L); }
-
-  // Check the code size generated from label to here.
-  int SizeOfCodeGeneratedSince(Label* label) {
-    return pc_offset() - label->pos();
-  }
-
-  // Check the number of instructions generated from label to here.
-  int InstructionsGeneratedSince(Label* label) {
-    return SizeOfCodeGeneratedSince(label) / kInstrSize;
-  }
-
-  // Class for scoping postponing the trampoline pool generation.
-  class BlockTrampolinePoolScope {
-   public:
-    explicit BlockTrampolinePoolScope(Assembler* assem) : assem_(assem) {
-      assem_->StartBlockTrampolinePool();
-    }
-    ~BlockTrampolinePoolScope() { assem_->EndBlockTrampolinePool(); }
-
-   private:
-    Assembler* assem_;
-
-    DISALLOW_IMPLICIT_CONSTRUCTORS(BlockTrampolinePoolScope);
-  };
-
-  // Class for scoping disabling constant pool entry merging
-  class BlockConstantPoolEntrySharingScope {
-   public:
-    explicit BlockConstantPoolEntrySharingScope(Assembler* assem)
-        : assem_(assem) {
-      assem_->StartBlockConstantPoolEntrySharing();
-    }
-    ~BlockConstantPoolEntrySharingScope() {
-      assem_->EndBlockConstantPoolEntrySharing();
-    }
-
-   private:
-    Assembler* assem_;
-
-    DISALLOW_IMPLICIT_CONSTRUCTORS(BlockConstantPoolEntrySharingScope);
-  };
-
-  // Record a comment relocation entry that can be used by a disassembler.
-  // Use --code-comments to enable.
-  void RecordComment(const char* msg);
-
-  // Record a deoptimization reason that can be used by a log or cpu profiler.
-  // Use --trace-deopt to enable.
-  void RecordDeoptReason(DeoptimizeReason reason, SourcePosition position,
-                         int id);
-
-  // Writes a single byte or word of data in the code stream.  Used
-  // for inline tables, e.g., jump-tables.
-  void db(uint8_t data);
-  void dd(uint32_t data);
-  void dq(uint64_t data);
-  void dp(uintptr_t data);
-
-  // Read/patch instructions
-  Instr instr_at(int pos) { return *reinterpret_cast<Instr*>(buffer_ + pos); }
-  void instr_at_put(int pos, Instr instr) {
-    *reinterpret_cast<Instr*>(buffer_ + pos) = instr;
-  }
-  static Instr instr_at(byte* pc) { return *reinterpret_cast<Instr*>(pc); }
-  static void instr_at_put(byte* pc, Instr instr) {
-    *reinterpret_cast<Instr*>(pc) = instr;
-  }
-  static Condition GetCondition(Instr instr);
-
-  static bool IsLis(Instr instr);
-  static bool IsLi(Instr instr);
-  static bool IsAddic(Instr instr);
-  static bool IsOri(Instr instr);
-
-  static bool IsBranch(Instr instr);
-  static Register GetRA(Instr instr);
-  static Register GetRB(Instr instr);
-#if V8_TARGET_ARCH_PPC64
-  static bool Is64BitLoadIntoR12(Instr instr1, Instr instr2, Instr instr3,
-                                 Instr instr4, Instr instr5);
-#else
-  static bool Is32BitLoadIntoR12(Instr instr1, Instr instr2);
-#endif
-
-  static bool IsCmpRegister(Instr instr);
-  static bool IsCmpImmediate(Instr instr);
-  static bool IsRlwinm(Instr instr);
-  static bool IsAndi(Instr instr);
-#if V8_TARGET_ARCH_PPC64
-  static bool IsRldicl(Instr instr);
-#endif
-  static bool IsCrSet(Instr instr);
-  static Register GetCmpImmediateRegister(Instr instr);
-  static int GetCmpImmediateRawImmediate(Instr instr);
-  static bool IsNop(Instr instr, int type = NON_MARKING_NOP);
-
-  // Postpone the generation of the trampoline pool for the specified number of
-  // instructions.
-  void BlockTrampolinePoolFor(int instructions);
-  void CheckTrampolinePool();
-
-  // For mov.  Return the number of actual instructions required to
-  // load the operand into a register.  This can be anywhere from
-  // one (constant pool small section) to five instructions (full
-  // 64-bit sequence).
-  //
-  // The value returned is only valid as long as no entries are added to the
-  // constant pool between this call and the actual instruction being emitted.
-  int instructions_required_for_mov(Register dst, const Operand& src) const;
-
-  // Decide between using the constant pool vs. a mov immediate sequence.
-  bool use_constant_pool_for_mov(Register dst, const Operand& src,
-                                 bool canOptimize) const;
-
-  // The code currently calls CheckBuffer() too often. This has the side
-  // effect of randomly growing the buffer in the middle of multi-instruction
-  // sequences.
-  //
-  // This function allows outside callers to check and grow the buffer
-  void EnsureSpaceFor(int space_needed);
-
-  int EmitConstantPool() { return constant_pool_builder_.Emit(this); }
-
-  bool ConstantPoolAccessIsInOverflow() const {
-    return constant_pool_builder_.NextAccess(ConstantPoolEntry::INTPTR) ==
-           ConstantPoolEntry::OVERFLOWED;
-  }
-
-  Label* ConstantPoolPosition() {
-    return constant_pool_builder_.EmittedPosition();
-  }
-
-  void EmitRelocations();
-
- protected:
-  int buffer_space() const { return reloc_info_writer.pos() - pc_; }
-
-  // Decode instruction(s) at pos and return backchain to previous
-  // label reference or kEndOfChain.
-  int target_at(int pos);
-
-  // Patch instruction(s) at pos to target target_pos (e.g. branch)
-  void target_at_put(int pos, int target_pos, bool* is_branch = nullptr);
-
-  // Record reloc info for current pc_
-  void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0);
-  ConstantPoolEntry::Access ConstantPoolAddEntry(RelocInfo::Mode rmode,
-                                                 intptr_t value) {
-    bool sharing_ok = RelocInfo::IsNone(rmode) ||
-                      !(serializer_enabled() ||
-                        rmode < RelocInfo::FIRST_SHAREABLE_RELOC_MODE ||
-                        is_constant_pool_entry_sharing_blocked());
-    return constant_pool_builder_.AddEntry(pc_offset(), value, sharing_ok);
-  }
-  ConstantPoolEntry::Access ConstantPoolAddEntry(Double value) {
-    return constant_pool_builder_.AddEntry(pc_offset(), value);
-  }
-
-  // Block the emission of the trampoline pool before pc_offset.
-  void BlockTrampolinePoolBefore(int pc_offset) {
-    if (no_trampoline_pool_before_ < pc_offset)
-      no_trampoline_pool_before_ = pc_offset;
-  }
-
-  void StartBlockTrampolinePool() { trampoline_pool_blocked_nesting_++; }
-  void EndBlockTrampolinePool() {
-    int count = --trampoline_pool_blocked_nesting_;
-    if (count == 0) CheckTrampolinePoolQuick();
-  }
-  bool is_trampoline_pool_blocked() const {
-    return trampoline_pool_blocked_nesting_ > 0;
-  }
-
-  void StartBlockConstantPoolEntrySharing() {
-    constant_pool_entry_sharing_blocked_nesting_++;
-  }
-  void EndBlockConstantPoolEntrySharing() {
-    constant_pool_entry_sharing_blocked_nesting_--;
-  }
-  bool is_constant_pool_entry_sharing_blocked() const {
-    return constant_pool_entry_sharing_blocked_nesting_ > 0;
-  }
-
-  bool has_exception() const { return internal_trampoline_exception_; }
-
-  bool is_trampoline_emitted() const { return trampoline_emitted_; }
-
-  // Code generation
-  // The relocation writer's position is at least kGap bytes below the end of
-  // the generated instructions. This is so that multi-instruction sequences do
-  // not have to check for overflow. The same is true for writes of large
-  // relocation info entries.
-  static constexpr int kGap = 32;
-
-  RelocInfoWriter reloc_info_writer;
-
- private:
-  // Avoid overflows for displacements etc.
-  static const int kMaximalBufferSize = 512 * MB;
-
-  // Repeated checking whether the trampoline pool should be emitted is rather
-  // expensive. By default we only check again once a number of instructions
-  // has been generated.
-  int next_trampoline_check_;  // pc offset of next buffer check.
-
-  // Emission of the trampoline pool may be blocked in some code sequences.
-  int trampoline_pool_blocked_nesting_;  // Block emission if this is not zero.
-  int no_trampoline_pool_before_;  // Block emission before this pc offset.
-
-  // Do not share constant pool entries.
-  int constant_pool_entry_sharing_blocked_nesting_;
-
-  // Relocation info generation
-  // Each relocation is encoded as a variable size value
-  static constexpr int kMaxRelocSize = RelocInfoWriter::kMaxSize;
-  std::vector<DeferredRelocInfo> relocations_;
-
-  // The bound position, before this we cannot do instruction elimination.
-  int last_bound_pos_;
-  // Optimizable cmpi information.
-  int optimizable_cmpi_pos_;
-  CRegister cmpi_cr_ = CRegister::no_reg();
-
-  ConstantPoolBuilder constant_pool_builder_;
-
-  void CheckBuffer() {
-    if (buffer_space() <= kGap) {
-      GrowBuffer();
-    }
-  }
-
-  void GrowBuffer(int needed = 0);
-  // Code emission
-  void emit(Instr x) {
-    CheckBuffer();
-    *reinterpret_cast<Instr*>(pc_) = x;
-    pc_ += kInstrSize;
-    CheckTrampolinePoolQuick();
-  }
-  void TrackBranch() {
-    DCHECK(!trampoline_emitted_);
-    int count = tracked_branch_count_++;
-    if (count == 0) {
-      // We leave space (kMaxBlockTrampolineSectionSize)
-      // for BlockTrampolinePoolScope buffer.
-      next_trampoline_check_ =
-          pc_offset() + kMaxCondBranchReach - kMaxBlockTrampolineSectionSize;
-    } else {
-      next_trampoline_check_ -= kTrampolineSlotsSize;
-    }
-  }
-
-  inline void UntrackBranch();
-  void CheckTrampolinePoolQuick() {
-    if (pc_offset() >= next_trampoline_check_) {
-      CheckTrampolinePool();
-    }
-  }
-
-  // Instruction generation
-  void a_form(Instr instr, DoubleRegister frt, DoubleRegister fra,
-              DoubleRegister frb, RCBit r);
-  void d_form(Instr instr, Register rt, Register ra, const intptr_t val,
-              bool signed_disp);
-  void xo_form(Instr instr, Register rt, Register ra, Register rb, OEBit o,
-               RCBit r);
-  void md_form(Instr instr, Register ra, Register rs, int shift, int maskbit,
-               RCBit r);
-  void mds_form(Instr instr, Register ra, Register rs, Register rb, int maskbit,
-                RCBit r);
-
-  // Labels
-  void print(Label* L);
-  int max_reach_from(int pos);
-  void bind_to(Label* L, int pos);
-  void next(Label* L);
-
-  class Trampoline {
-   public:
-    Trampoline() {
-      next_slot_ = 0;
-      free_slot_count_ = 0;
-    }
-    Trampoline(int start, int slot_count) {
-      next_slot_ = start;
-      free_slot_count_ = slot_count;
-    }
-    int take_slot() {
-      int trampoline_slot = kInvalidSlotPos;
-      if (free_slot_count_ <= 0) {
-        // We have run out of space on trampolines.
-        // Make sure we fail in debug mode, so we become aware of each case
-        // when this happens.
-        DCHECK(0);
-        // Internal exception will be caught.
-      } else {
-        trampoline_slot = next_slot_;
-        free_slot_count_--;
-        next_slot_ += kTrampolineSlotsSize;
-      }
-      return trampoline_slot;
-    }
-
-   private:
-    int next_slot_;
-    int free_slot_count_;
-  };
-
-  int32_t get_trampoline_entry();
-  int tracked_branch_count_;
-  // If trampoline is emitted, generated code is becoming large. As
-  // this is already a slow case which can possibly break our code
-  // generation for the extreme case, we use this information to
-  // trigger different mode of branch instruction generation, where we
-  // no longer use a single branch instruction.
-  bool trampoline_emitted_;
-  static constexpr int kTrampolineSlotsSize = kInstrSize;
-  static constexpr int kMaxCondBranchReach = (1 << (16 - 1)) - 1;
-  static constexpr int kMaxBlockTrampolineSectionSize = 64 * kInstrSize;
-  static constexpr int kInvalidSlotPos = -1;
-
-  Trampoline trampoline_;
-  bool internal_trampoline_exception_;
-
-  friend class RegExpMacroAssemblerPPC;
-  friend class RelocInfo;
-  friend class BlockTrampolinePoolScope;
-  friend class EnsureSpace;
-
-  // The following functions help with avoiding allocations of embedded heap
-  // objects during the code assembly phase. {RequestHeapObject} records the
-  // need for a future heap number allocation or code stub generation. After
-  // code assembly, {AllocateAndInstallRequestedHeapObjects} will allocate these
-  // objects and place them where they are expected (determined by the pc offset
-  // associated with each request). That is, for each request, it will patch the
-  // dummy heap object handle that we emitted during code assembly with the
-  // actual heap object handle.
-  void RequestHeapObject(HeapObjectRequest request);
-  void AllocateAndInstallRequestedHeapObjects(Isolate* isolate);
-
-  std::forward_list<HeapObjectRequest> heap_object_requests_;
-};
-
-
-class EnsureSpace BASE_EMBEDDED {
- public:
-  explicit EnsureSpace(Assembler* assembler) { assembler->CheckBuffer(); }
-};
-
-class PatchingAssembler : public Assembler {
- public:
-  PatchingAssembler(IsolateData isolate_data, byte* address, int instructions);
-  ~PatchingAssembler();
-
-  void FlushICache(Isolate* isolate);
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_PPC_ASSEMBLER_PPC_H_
diff --git a/src/v8/src/ppc/code-stubs-ppc.cc b/src/v8/src/ppc/code-stubs-ppc.cc
deleted file mode 100644
index 5c3d387..0000000
--- a/src/v8/src/ppc/code-stubs-ppc.cc
+++ /dev/null
@@ -1,1345 +0,0 @@
-// Copyright 2014 the V8 project 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 V8_TARGET_ARCH_PPC
-
-#include "src/api-arguments.h"
-#include "src/assembler-inl.h"
-#include "src/base/bits.h"
-#include "src/bootstrapper.h"
-#include "src/code-stubs.h"
-#include "src/double.h"
-#include "src/frame-constants.h"
-#include "src/frames.h"
-#include "src/ic/ic.h"
-#include "src/ic/stub-cache.h"
-#include "src/isolate.h"
-#include "src/regexp/jsregexp.h"
-#include "src/regexp/regexp-macro-assembler.h"
-#include "src/runtime/runtime.h"
-
-#include "src/ppc/code-stubs-ppc.h"  // Cannot be the first include.
-
-namespace v8 {
-namespace internal {
-
-#define __ ACCESS_MASM(masm)
-
-void ArrayNArgumentsConstructorStub::Generate(MacroAssembler* masm) {
-  __ ShiftLeftImm(r0, r3, Operand(kPointerSizeLog2));
-  __ StorePX(r4, MemOperand(sp, r0));
-  __ push(r4);
-  __ push(r5);
-  __ addi(r3, r3, Operand(3));
-  __ TailCallRuntime(Runtime::kNewArray);
-}
-
-
-void DoubleToIStub::Generate(MacroAssembler* masm) {
-  Label out_of_range, only_low, negate, done, fastpath_done;
-  Register result_reg = destination();
-
-  // Immediate values for this stub fit in instructions, so it's safe to use ip.
-  Register scratch = GetRegisterThatIsNotOneOf(result_reg);
-  Register scratch_low = GetRegisterThatIsNotOneOf(result_reg, scratch);
-  Register scratch_high =
-      GetRegisterThatIsNotOneOf(result_reg, scratch, scratch_low);
-  DoubleRegister double_scratch = kScratchDoubleReg;
-
-  __ push(scratch);
-  // Account for saved regs.
-  int argument_offset = 1 * kPointerSize;
-
-  // Load double input.
-  __ lfd(double_scratch, MemOperand(sp, argument_offset));
-
-  // Do fast-path convert from double to int.
-  __ ConvertDoubleToInt64(double_scratch,
-#if !V8_TARGET_ARCH_PPC64
-                          scratch,
-#endif
-                          result_reg, d0);
-
-// Test for overflow
-#if V8_TARGET_ARCH_PPC64
-  __ TestIfInt32(result_reg, r0);
-#else
-  __ TestIfInt32(scratch, result_reg, r0);
-#endif
-  __ beq(&fastpath_done);
-
-  __ Push(scratch_high, scratch_low);
-  // Account for saved regs.
-  argument_offset += 2 * kPointerSize;
-
-  __ lwz(scratch_high,
-         MemOperand(sp, argument_offset + Register::kExponentOffset));
-  __ lwz(scratch_low,
-         MemOperand(sp, argument_offset + Register::kMantissaOffset));
-
-  __ ExtractBitMask(scratch, scratch_high, HeapNumber::kExponentMask);
-  // Load scratch with exponent - 1. This is faster than loading
-  // with exponent because Bias + 1 = 1024 which is a *PPC* immediate value.
-  STATIC_ASSERT(HeapNumber::kExponentBias + 1 == 1024);
-  __ subi(scratch, scratch, Operand(HeapNumber::kExponentBias + 1));
-  // If exponent is greater than or equal to 84, the 32 less significant
-  // bits are 0s (2^84 = 1, 52 significant bits, 32 uncoded bits),
-  // the result is 0.
-  // Compare exponent with 84 (compare exponent - 1 with 83).
-  __ cmpi(scratch, Operand(83));
-  __ bge(&out_of_range);
-
-  // If we reach this code, 31 <= exponent <= 83.
-  // So, we don't have to handle cases where 0 <= exponent <= 20 for
-  // which we would need to shift right the high part of the mantissa.
-  // Scratch contains exponent - 1.
-  // Load scratch with 52 - exponent (load with 51 - (exponent - 1)).
-  __ subfic(scratch, scratch, Operand(51));
-  __ cmpi(scratch, Operand::Zero());
-  __ ble(&only_low);
-  // 21 <= exponent <= 51, shift scratch_low and scratch_high
-  // to generate the result.
-  __ srw(scratch_low, scratch_low, scratch);
-  // Scratch contains: 52 - exponent.
-  // We needs: exponent - 20.
-  // So we use: 32 - scratch = 32 - 52 + exponent = exponent - 20.
-  __ subfic(scratch, scratch, Operand(32));
-  __ ExtractBitMask(result_reg, scratch_high, HeapNumber::kMantissaMask);
-  // Set the implicit 1 before the mantissa part in scratch_high.
-  STATIC_ASSERT(HeapNumber::kMantissaBitsInTopWord >= 16);
-  __ oris(result_reg, result_reg,
-          Operand(1 << ((HeapNumber::kMantissaBitsInTopWord) - 16)));
-  __ slw(r0, result_reg, scratch);
-  __ orx(result_reg, scratch_low, r0);
-  __ b(&negate);
-
-  __ bind(&out_of_range);
-  __ mov(result_reg, Operand::Zero());
-  __ b(&done);
-
-  __ bind(&only_low);
-  // 52 <= exponent <= 83, shift only scratch_low.
-  // On entry, scratch contains: 52 - exponent.
-  __ neg(scratch, scratch);
-  __ slw(result_reg, scratch_low, scratch);
-
-  __ bind(&negate);
-  // If input was positive, scratch_high ASR 31 equals 0 and
-  // scratch_high LSR 31 equals zero.
-  // New result = (result eor 0) + 0 = result.
-  // If the input was negative, we have to negate the result.
-  // Input_high ASR 31 equals 0xFFFFFFFF and scratch_high LSR 31 equals 1.
-  // New result = (result eor 0xFFFFFFFF) + 1 = 0 - result.
-  __ srawi(r0, scratch_high, 31);
-#if V8_TARGET_ARCH_PPC64
-  __ srdi(r0, r0, Operand(32));
-#endif
-  __ xor_(result_reg, result_reg, r0);
-  __ srwi(r0, scratch_high, Operand(31));
-  __ add(result_reg, result_reg, r0);
-
-  __ bind(&done);
-  __ Pop(scratch_high, scratch_low);
-
-  __ bind(&fastpath_done);
-  __ pop(scratch);
-
-  __ Ret();
-}
-
-void MathPowStub::Generate(MacroAssembler* masm) {
-  const Register exponent = MathPowTaggedDescriptor::exponent();
-  DCHECK(exponent == r5);
-  const DoubleRegister double_base = d1;
-  const DoubleRegister double_exponent = d2;
-  const DoubleRegister double_result = d3;
-  const DoubleRegister double_scratch = d0;
-  const Register scratch = r11;
-  const Register scratch2 = r10;
-
-  Label call_runtime, done, int_exponent;
-  if (exponent_type() == TAGGED) {
-    // Base is already in double_base.
-    __ UntagAndJumpIfSmi(scratch, exponent, &int_exponent);
-
-    __ lfd(double_exponent,
-           FieldMemOperand(exponent, HeapNumber::kValueOffset));
-  }
-
-  if (exponent_type() != INTEGER) {
-    // Detect integer exponents stored as double.
-    __ TryDoubleToInt32Exact(scratch, double_exponent, scratch2,
-                             double_scratch);
-    __ beq(&int_exponent);
-
-    __ mflr(r0);
-    __ push(r0);
-    {
-      AllowExternalCallThatCantCauseGC scope(masm);
-      __ PrepareCallCFunction(0, 2, scratch);
-      __ MovToFloatParameters(double_base, double_exponent);
-      __ CallCFunction(
-          ExternalReference::power_double_double_function(isolate()), 0, 2);
-    }
-    __ pop(r0);
-    __ mtlr(r0);
-    __ MovFromFloatResult(double_result);
-    __ b(&done);
-  }
-
-  // Calculate power with integer exponent.
-  __ bind(&int_exponent);
-
-  // Get two copies of exponent in the registers scratch and exponent.
-  if (exponent_type() == INTEGER) {
-    __ mr(scratch, exponent);
-  } else {
-    // Exponent has previously been stored into scratch as untagged integer.
-    __ mr(exponent, scratch);
-  }
-  __ fmr(double_scratch, double_base);  // Back up base.
-  __ li(scratch2, Operand(1));
-  __ ConvertIntToDouble(scratch2, double_result);
-
-  // Get absolute value of exponent.
-  __ cmpi(scratch, Operand::Zero());
-  if (CpuFeatures::IsSupported(ISELECT)) {
-    __ neg(scratch2, scratch);
-    __ isel(lt, scratch, scratch2, scratch);
-  } else {
-    Label positive_exponent;
-    __ bge(&positive_exponent);
-    __ neg(scratch, scratch);
-    __ bind(&positive_exponent);
-  }
-
-  Label while_true, no_carry, loop_end;
-  __ bind(&while_true);
-  __ andi(scratch2, scratch, Operand(1));
-  __ beq(&no_carry, cr0);
-  __ fmul(double_result, double_result, double_scratch);
-  __ bind(&no_carry);
-  __ ShiftRightImm(scratch, scratch, Operand(1), SetRC);
-  __ beq(&loop_end, cr0);
-  __ fmul(double_scratch, double_scratch, double_scratch);
-  __ b(&while_true);
-  __ bind(&loop_end);
-
-  __ cmpi(exponent, Operand::Zero());
-  __ bge(&done);
-
-  __ li(scratch2, Operand(1));
-  __ ConvertIntToDouble(scratch2, double_scratch);
-  __ fdiv(double_result, double_scratch, double_result);
-  // Test whether result is zero.  Bail out to check for subnormal result.
-  // Due to subnormals, x^-y == (1/x)^y does not hold in all cases.
-  __ fcmpu(double_result, kDoubleRegZero);
-  __ bne(&done);
-  // double_exponent may not containe the exponent value if the input was a
-  // smi.  We set it with exponent value before bailing out.
-  __ ConvertIntToDouble(exponent, double_exponent);
-
-  // Returning or bailing out.
-  __ mflr(r0);
-  __ push(r0);
-  {
-    AllowExternalCallThatCantCauseGC scope(masm);
-    __ PrepareCallCFunction(0, 2, scratch);
-    __ MovToFloatParameters(double_base, double_exponent);
-    __ CallCFunction(
-        ExternalReference::power_double_double_function(isolate()), 0, 2);
-  }
-  __ pop(r0);
-  __ mtlr(r0);
-  __ MovFromFloatResult(double_result);
-
-  __ bind(&done);
-  __ Ret();
-}
-
-Movability CEntryStub::NeedsImmovableCode() { return kImmovable; }
-
-void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) {
-  CEntryStub::GenerateAheadOfTime(isolate);
-  CommonArrayConstructorStub::GenerateStubsAheadOfTime(isolate);
-  StoreFastElementStub::GenerateAheadOfTime(isolate);
-}
-
-
-void CodeStub::GenerateFPStubs(Isolate* isolate) {
-  // Generate if not already in cache.
-  SaveFPRegsMode mode = kSaveFPRegs;
-  CEntryStub(isolate, 1, mode).GetCode();
-}
-
-
-void CEntryStub::GenerateAheadOfTime(Isolate* isolate) {
-  CEntryStub stub(isolate, 1, kDontSaveFPRegs);
-  stub.GetCode();
-  CEntryStub save_doubles(isolate, 1, kSaveFPRegs);
-  save_doubles.GetCode();
-}
-
-
-void CEntryStub::Generate(MacroAssembler* masm) {
-  // Called from JavaScript; parameters are on stack as if calling JS function.
-  // r3: number of arguments including receiver
-  // r4: pointer to builtin function
-  // fp: frame pointer  (restored after C call)
-  // sp: stack pointer  (restored as callee's sp after C call)
-  // cp: current context  (C callee-saved)
-  //
-  // If argv_in_register():
-  // r5: pointer to the first argument
-  ProfileEntryHookStub::MaybeCallEntryHook(masm);
-
-  __ mr(r15, r4);
-
-  if (argv_in_register()) {
-    // Move argv into the correct register.
-    __ mr(r4, r5);
-  } else {
-    // Compute the argv pointer.
-    __ ShiftLeftImm(r4, r3, Operand(kPointerSizeLog2));
-    __ add(r4, r4, sp);
-    __ subi(r4, r4, Operand(kPointerSize));
-  }
-
-  // Enter the exit frame that transitions from JavaScript to C++.
-  FrameScope scope(masm, StackFrame::MANUAL);
-
-  // Need at least one extra slot for return address location.
-  int arg_stack_space = 1;
-
-  // Pass buffer for return value on stack if necessary
-  bool needs_return_buffer =
-      (result_size() == 2 && !ABI_RETURNS_OBJECT_PAIRS_IN_REGS);
-  if (needs_return_buffer) {
-    arg_stack_space += result_size();
-  }
-
-  __ EnterExitFrame(save_doubles(), arg_stack_space, is_builtin_exit()
-                                           ? StackFrame::BUILTIN_EXIT
-                                           : StackFrame::EXIT);
-
-  // Store a copy of argc in callee-saved registers for later.
-  __ mr(r14, r3);
-
-  // r3, r14: number of arguments including receiver  (C callee-saved)
-  // r4: pointer to the first argument
-  // r15: pointer to builtin function  (C callee-saved)
-
-  // Result returned in registers or stack, depending on result size and ABI.
-
-  Register isolate_reg = r5;
-  if (needs_return_buffer) {
-    // The return value is a non-scalar value.
-    // Use frame storage reserved by calling function to pass return
-    // buffer as implicit first argument.
-    __ mr(r5, r4);
-    __ mr(r4, r3);
-    __ addi(r3, sp, Operand((kStackFrameExtraParamSlot + 1) * kPointerSize));
-    isolate_reg = r6;
-  }
-
-  // Call C built-in.
-  __ mov(isolate_reg, Operand(ExternalReference::isolate_address(isolate())));
-
-  Register target = r15;
-  if (ABI_USES_FUNCTION_DESCRIPTORS) {
-    // AIX/PPC64BE Linux use a function descriptor.
-    __ LoadP(ToRegister(ABI_TOC_REGISTER), MemOperand(r15, kPointerSize));
-    __ LoadP(ip, MemOperand(r15, 0));  // Instruction address
-    target = ip;
-  } else if (ABI_CALL_VIA_IP) {
-    __ Move(ip, r15);
-    target = ip;
-  }
-
-  // To let the GC traverse the return address of the exit frames, we need to
-  // know where the return address is. The CEntryStub is unmovable, so
-  // we can store the address on the stack to be able to find it again and
-  // we never have to restore it, because it will not change.
-  Label after_call;
-  __ mov_label_addr(r0, &after_call);
-  __ StoreP(r0, MemOperand(sp, kStackFrameExtraParamSlot * kPointerSize));
-  __ Call(target);
-  __ bind(&after_call);
-
-  // If return value is on the stack, pop it to registers.
-  if (needs_return_buffer) {
-    __ LoadP(r4, MemOperand(r3, kPointerSize));
-    __ LoadP(r3, MemOperand(r3));
-  }
-
-  // Check result for exception sentinel.
-  Label exception_returned;
-  __ CompareRoot(r3, Heap::kExceptionRootIndex);
-  __ beq(&exception_returned);
-
-  // Check that there is no pending exception, otherwise we
-  // should have returned the exception sentinel.
-  if (FLAG_debug_code) {
-    Label okay;
-    ExternalReference pending_exception_address(
-        IsolateAddressId::kPendingExceptionAddress, isolate());
-
-    __ mov(r6, Operand(pending_exception_address));
-    __ LoadP(r6, MemOperand(r6));
-    __ CompareRoot(r6, Heap::kTheHoleValueRootIndex);
-    // Cannot use check here as it attempts to generate call into runtime.
-    __ beq(&okay);
-    __ stop("Unexpected pending exception");
-    __ bind(&okay);
-  }
-
-  // Exit C frame and return.
-  // r3:r4: result
-  // sp: stack pointer
-  // fp: frame pointer
-  Register argc = argv_in_register()
-                      // We don't want to pop arguments so set argc to no_reg.
-                      ? no_reg
-                      // r14: still holds argc (callee-saved).
-                      : r14;
-  __ LeaveExitFrame(save_doubles(), argc);
-  __ blr();
-
-  // Handling of exception.
-  __ bind(&exception_returned);
-
-  ExternalReference pending_handler_context_address(
-      IsolateAddressId::kPendingHandlerContextAddress, isolate());
-  ExternalReference pending_handler_entrypoint_address(
-      IsolateAddressId::kPendingHandlerEntrypointAddress, isolate());
-  ExternalReference pending_handler_constant_pool_address(
-      IsolateAddressId::kPendingHandlerConstantPoolAddress, isolate());
-  ExternalReference pending_handler_fp_address(
-      IsolateAddressId::kPendingHandlerFPAddress, isolate());
-  ExternalReference pending_handler_sp_address(
-      IsolateAddressId::kPendingHandlerSPAddress, isolate());
-
-  // Ask the runtime for help to determine the handler. This will set r3 to
-  // contain the current pending exception, don't clobber it.
-  ExternalReference find_handler(Runtime::kUnwindAndFindExceptionHandler,
-                                 isolate());
-  {
-    FrameScope scope(masm, StackFrame::MANUAL);
-    __ PrepareCallCFunction(3, 0, r3);
-    __ li(r3, Operand::Zero());
-    __ li(r4, Operand::Zero());
-    __ mov(r5, Operand(ExternalReference::isolate_address(isolate())));
-    __ CallCFunction(find_handler, 3);
-  }
-
-  // Retrieve the handler context, SP and FP.
-  __ mov(cp, Operand(pending_handler_context_address));
-  __ LoadP(cp, MemOperand(cp));
-  __ mov(sp, Operand(pending_handler_sp_address));
-  __ LoadP(sp, MemOperand(sp));
-  __ mov(fp, Operand(pending_handler_fp_address));
-  __ LoadP(fp, MemOperand(fp));
-
-  // If the handler is a JS frame, restore the context to the frame. Note that
-  // the context will be set to (cp == 0) for non-JS frames.
-  Label skip;
-  __ cmpi(cp, Operand::Zero());
-  __ beq(&skip);
-  __ StoreP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
-  __ bind(&skip);
-
-  // Compute the handler entry address and jump to it.
-  ConstantPoolUnavailableScope constant_pool_unavailable(masm);
-  __ mov(ip, Operand(pending_handler_entrypoint_address));
-  __ LoadP(ip, MemOperand(ip));
-  if (FLAG_enable_embedded_constant_pool) {
-    __ mov(kConstantPoolRegister,
-           Operand(pending_handler_constant_pool_address));
-    __ LoadP(kConstantPoolRegister, MemOperand(kConstantPoolRegister));
-  }
-  __ Jump(ip);
-}
-
-
-void JSEntryStub::Generate(MacroAssembler* masm) {
-  // r3: code entry
-  // r4: function
-  // r5: receiver
-  // r6: argc
-  // [sp+0]: argv
-
-  Label invoke, handler_entry, exit;
-
-// Called from C
-  __ function_descriptor();
-
-  ProfileEntryHookStub::MaybeCallEntryHook(masm);
-
-  // PPC LINUX ABI:
-  // preserve LR in pre-reserved slot in caller's frame
-  __ mflr(r0);
-  __ StoreP(r0, MemOperand(sp, kStackFrameLRSlot * kPointerSize));
-
-  // Save callee saved registers on the stack.
-  __ MultiPush(kCalleeSaved);
-
-  // Save callee-saved double registers.
-  __ MultiPushDoubles(kCalleeSavedDoubles);
-  // Set up the reserved register for 0.0.
-  __ LoadDoubleLiteral(kDoubleRegZero, Double(0.0), r0);
-
-  __ InitializeRootRegister();
-
-  // Push a frame with special values setup to mark it as an entry frame.
-  // r3: code entry
-  // r4: function
-  // r5: receiver
-  // r6: argc
-  // r7: argv
-  __ li(r0, Operand(-1));  // Push a bad frame pointer to fail if it is used.
-  __ push(r0);
-  if (FLAG_enable_embedded_constant_pool) {
-    __ li(kConstantPoolRegister, Operand::Zero());
-    __ push(kConstantPoolRegister);
-  }
-  StackFrame::Type marker = type();
-  __ mov(r0, Operand(StackFrame::TypeToMarker(marker)));
-  __ push(r0);
-  __ push(r0);
-  // Save copies of the top frame descriptor on the stack.
-  __ mov(r8, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress,
-                                       isolate())));
-  __ LoadP(r0, MemOperand(r8));
-  __ push(r0);
-
-  // Set up frame pointer for the frame to be pushed.
-  __ addi(fp, sp, Operand(-EntryFrameConstants::kCallerFPOffset));
-
-  // If this is the outermost JS call, set js_entry_sp value.
-  Label non_outermost_js;
-  ExternalReference js_entry_sp(IsolateAddressId::kJSEntrySPAddress, isolate());
-  __ mov(r8, Operand(ExternalReference(js_entry_sp)));
-  __ LoadP(r9, MemOperand(r8));
-  __ cmpi(r9, Operand::Zero());
-  __ bne(&non_outermost_js);
-  __ StoreP(fp, MemOperand(r8));
-  __ mov(ip, Operand(StackFrame::OUTERMOST_JSENTRY_FRAME));
-  Label cont;
-  __ b(&cont);
-  __ bind(&non_outermost_js);
-  __ mov(ip, Operand(StackFrame::INNER_JSENTRY_FRAME));
-  __ bind(&cont);
-  __ push(ip);  // frame-type
-
-  // Jump to a faked try block that does the invoke, with a faked catch
-  // block that sets the pending exception.
-  __ b(&invoke);
-
-  __ bind(&handler_entry);
-  handler_offset_ = handler_entry.pos();
-  // Caught exception: Store result (exception) in the pending exception
-  // field in the JSEnv and return a failure sentinel.  Coming in here the
-  // fp will be invalid because the PushStackHandler below sets it to 0 to
-  // signal the existence of the JSEntry frame.
-  __ mov(ip, Operand(ExternalReference(
-                 IsolateAddressId::kPendingExceptionAddress, isolate())));
-
-  __ StoreP(r3, MemOperand(ip));
-  __ LoadRoot(r3, Heap::kExceptionRootIndex);
-  __ b(&exit);
-
-  // Invoke: Link this frame into the handler chain.
-  __ bind(&invoke);
-  // Must preserve r3-r7.
-  __ PushStackHandler();
-  // If an exception not caught by another handler occurs, this handler
-  // returns control to the code after the b(&invoke) above, which
-  // restores all kCalleeSaved registers (including cp and fp) to their
-  // saved values before returning a failure to C.
-
-  // Invoke the function by calling through JS entry trampoline builtin.
-  // Notice that we cannot store a reference to the trampoline code directly in
-  // this stub, because runtime stubs are not traversed when doing GC.
-
-  // Expected registers by Builtins::JSEntryTrampoline
-  // r3: code entry
-  // r4: function
-  // r5: receiver
-  // r6: argc
-  // r7: argv
-  __ Call(EntryTrampoline(), RelocInfo::CODE_TARGET);
-
-  // Unlink this frame from the handler chain.
-  __ PopStackHandler();
-
-  __ bind(&exit);  // r3 holds result
-  // Check if the current stack frame is marked as the outermost JS frame.
-  Label non_outermost_js_2;
-  __ pop(r8);
-  __ cmpi(r8, Operand(StackFrame::OUTERMOST_JSENTRY_FRAME));
-  __ bne(&non_outermost_js_2);
-  __ mov(r9, Operand::Zero());
-  __ mov(r8, Operand(ExternalReference(js_entry_sp)));
-  __ StoreP(r9, MemOperand(r8));
-  __ bind(&non_outermost_js_2);
-
-  // Restore the top frame descriptors from the stack.
-  __ pop(r6);
-  __ mov(ip, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress,
-                                       isolate())));
-  __ StoreP(r6, MemOperand(ip));
-
-  // Reset the stack to the callee saved registers.
-  __ addi(sp, sp, Operand(-EntryFrameConstants::kCallerFPOffset));
-
-  // Restore callee-saved double registers.
-  __ MultiPopDoubles(kCalleeSavedDoubles);
-
-  // Restore callee-saved registers.
-  __ MultiPop(kCalleeSaved);
-
-  // Return
-  __ LoadP(r0, MemOperand(sp, kStackFrameLRSlot * kPointerSize));
-  __ mtlr(r0);
-  __ blr();
-}
-
-// This stub is paired with DirectCEntryStub::GenerateCall
-void DirectCEntryStub::Generate(MacroAssembler* masm) {
-  // Place the return address on the stack, making the call
-  // GC safe. The RegExp backend also relies on this.
-  __ mflr(r0);
-  __ StoreP(r0, MemOperand(sp, kStackFrameExtraParamSlot * kPointerSize));
-  __ Call(ip);  // Call the C++ function.
-  __ LoadP(r0, MemOperand(sp, kStackFrameExtraParamSlot * kPointerSize));
-  __ mtlr(r0);
-  __ blr();
-}
-
-
-void DirectCEntryStub::GenerateCall(MacroAssembler* masm, Register target) {
-  if (ABI_USES_FUNCTION_DESCRIPTORS) {
-    // AIX/PPC64BE Linux use a function descriptor.
-    __ LoadP(ToRegister(ABI_TOC_REGISTER), MemOperand(target, kPointerSize));
-    __ LoadP(ip, MemOperand(target, 0));  // Instruction address
-  } else {
-    // ip needs to be set for DirectCEentryStub::Generate, and also
-    // for ABI_CALL_VIA_IP.
-    __ Move(ip, target);
-  }
-
-  intptr_t code = reinterpret_cast<intptr_t>(GetCode().location());
-  __ mov(r0, Operand(code, RelocInfo::CODE_TARGET));
-  __ Call(r0);  // Call the stub.
-}
-
-
-void ProfileEntryHookStub::MaybeCallEntryHookDelayed(TurboAssembler* tasm,
-                                                     Zone* zone) {
-  if (tasm->isolate()->function_entry_hook() != nullptr) {
-    PredictableCodeSizeScope predictable(tasm,
-#if V8_TARGET_ARCH_PPC64
-                                         14 * Assembler::kInstrSize);
-#else
-                                         11 * Assembler::kInstrSize);
-#endif
-    tasm->mflr(r0);
-    tasm->Push(r0, ip);
-    tasm->CallStubDelayed(new (zone) ProfileEntryHookStub(nullptr));
-    tasm->Pop(r0, ip);
-    tasm->mtlr(r0);
-  }
-}
-
-void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
-  if (masm->isolate()->function_entry_hook() != nullptr) {
-    PredictableCodeSizeScope predictable(masm,
-#if V8_TARGET_ARCH_PPC64
-                                         14 * Assembler::kInstrSize);
-#else
-                                         11 * Assembler::kInstrSize);
-#endif
-    ProfileEntryHookStub stub(masm->isolate());
-    __ mflr(r0);
-    __ Push(r0, ip);
-    __ CallStub(&stub);
-    __ Pop(r0, ip);
-    __ mtlr(r0);
-  }
-}
-
-
-void ProfileEntryHookStub::Generate(MacroAssembler* masm) {
-  // The entry hook is a "push lr, ip" instruction, followed by a call.
-  const int32_t kReturnAddressDistanceFromFunctionStart =
-      Assembler::kCallTargetAddressOffset + 3 * Assembler::kInstrSize;
-
-  // This should contain all kJSCallerSaved registers.
-  const RegList kSavedRegs = kJSCallerSaved |  // Caller saved registers.
-                             r15.bit();        // Saved stack pointer.
-
-  // We also save lr, so the count here is one higher than the mask indicates.
-  const int32_t kNumSavedRegs = kNumJSCallerSaved + 2;
-
-  // Save all caller-save registers as this may be called from anywhere.
-  __ mflr(ip);
-  __ MultiPush(kSavedRegs | ip.bit());
-
-  // Compute the function's address for the first argument.
-  __ subi(r3, ip, Operand(kReturnAddressDistanceFromFunctionStart));
-
-  // The caller's return address is two slots above the saved temporaries.
-  // Grab that for the second argument to the hook.
-  __ addi(r4, sp, Operand((kNumSavedRegs + 1) * kPointerSize));
-
-  // Align the stack if necessary.
-  int frame_alignment = masm->ActivationFrameAlignment();
-  if (frame_alignment > kPointerSize) {
-    __ mr(r15, sp);
-    DCHECK(base::bits::IsPowerOfTwo(frame_alignment));
-    __ ClearRightImm(sp, sp, Operand(WhichPowerOf2(frame_alignment)));
-  }
-
-#if !defined(USE_SIMULATOR)
-  uintptr_t entry_hook =
-      reinterpret_cast<uintptr_t>(isolate()->function_entry_hook());
-#else
-  // Under the simulator we need to indirect the entry hook through a
-  // trampoline function at a known address.
-  ApiFunction dispatcher(FUNCTION_ADDR(EntryHookTrampoline));
-  ExternalReference entry_hook = ExternalReference(
-      &dispatcher, ExternalReference::BUILTIN_CALL, isolate());
-
-  // It additionally takes an isolate as a third parameter
-  __ mov(r5, Operand(ExternalReference::isolate_address(isolate())));
-#endif
-
-  __ mov(ip, Operand(entry_hook));
-
-  if (ABI_USES_FUNCTION_DESCRIPTORS) {
-    __ LoadP(ToRegister(ABI_TOC_REGISTER), MemOperand(ip, kPointerSize));
-    __ LoadP(ip, MemOperand(ip, 0));
-  }
-  // ip set above, so nothing more to do for ABI_CALL_VIA_IP.
-
-  // PPC LINUX ABI:
-  __ li(r0, Operand::Zero());
-  __ StorePU(r0, MemOperand(sp, -kNumRequiredStackFrameSlots * kPointerSize));
-
-  __ Call(ip);
-
-  __ addi(sp, sp, Operand(kNumRequiredStackFrameSlots * kPointerSize));
-
-  // Restore the stack pointer if needed.
-  if (frame_alignment > kPointerSize) {
-    __ mr(sp, r15);
-  }
-
-  // Also pop lr to get Ret(0).
-  __ MultiPop(kSavedRegs | ip.bit());
-  __ mtlr(ip);
-  __ Ret();
-}
-
-
-template <class T>
-static void CreateArrayDispatch(MacroAssembler* masm,
-                                AllocationSiteOverrideMode mode) {
-  if (mode == DISABLE_ALLOCATION_SITES) {
-    T stub(masm->isolate(), GetInitialFastElementsKind(), mode);
-    __ TailCallStub(&stub);
-  } else if (mode == DONT_OVERRIDE) {
-    int last_index =
-        GetSequenceIndexFromFastElementsKind(TERMINAL_FAST_ELEMENTS_KIND);
-    for (int i = 0; i <= last_index; ++i) {
-      ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
-      __ Cmpi(r6, Operand(kind), r0);
-      T stub(masm->isolate(), kind);
-      __ TailCallStub(&stub, eq);
-    }
-
-    // If we reached this point there is a problem.
-    __ Abort(AbortReason::kUnexpectedElementsKindInArrayConstructor);
-  } else {
-    UNREACHABLE();
-  }
-}
-
-
-static void CreateArrayDispatchOneArgument(MacroAssembler* masm,
-                                           AllocationSiteOverrideMode mode) {
-  // r5 - allocation site (if mode != DISABLE_ALLOCATION_SITES)
-  // r6 - kind (if mode != DISABLE_ALLOCATION_SITES)
-  // r3 - number of arguments
-  // r4 - constructor?
-  // sp[0] - last argument
-  STATIC_ASSERT(PACKED_SMI_ELEMENTS == 0);
-  STATIC_ASSERT(HOLEY_SMI_ELEMENTS == 1);
-  STATIC_ASSERT(PACKED_ELEMENTS == 2);
-  STATIC_ASSERT(HOLEY_ELEMENTS == 3);
-  STATIC_ASSERT(PACKED_DOUBLE_ELEMENTS == 4);
-  STATIC_ASSERT(HOLEY_DOUBLE_ELEMENTS == 5);
-
-  if (mode == DISABLE_ALLOCATION_SITES) {
-    ElementsKind initial = GetInitialFastElementsKind();
-    ElementsKind holey_initial = GetHoleyElementsKind(initial);
-
-    ArraySingleArgumentConstructorStub stub_holey(
-        masm->isolate(), holey_initial, DISABLE_ALLOCATION_SITES);
-    __ TailCallStub(&stub_holey);
-  } else if (mode == DONT_OVERRIDE) {
-    // is the low bit set? If so, we are holey and that is good.
-    Label normal_sequence;
-    __ andi(r0, r6, Operand(1));
-    __ bne(&normal_sequence, cr0);
-
-    // We are going to create a holey array, but our kind is non-holey.
-    // Fix kind and retry (only if we have an allocation site in the slot).
-    __ addi(r6, r6, Operand(1));
-
-    if (FLAG_debug_code) {
-      __ LoadP(r8, FieldMemOperand(r5, 0));
-      __ CompareRoot(r8, Heap::kAllocationSiteMapRootIndex);
-      __ Assert(eq, AbortReason::kExpectedAllocationSite);
-    }
-
-    // Save the resulting elements kind in type info. We can't just store r6
-    // in the AllocationSite::transition_info field because elements kind is
-    // restricted to a portion of the field...upper bits need to be left alone.
-    STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
-    __ LoadP(r7, FieldMemOperand(
-                     r5, AllocationSite::kTransitionInfoOrBoilerplateOffset));
-    __ AddSmiLiteral(r7, r7, Smi::FromInt(kFastElementsKindPackedToHoley), r0);
-    __ StoreP(
-        r7,
-        FieldMemOperand(r5, AllocationSite::kTransitionInfoOrBoilerplateOffset),
-        r0);
-
-    __ bind(&normal_sequence);
-    int last_index =
-        GetSequenceIndexFromFastElementsKind(TERMINAL_FAST_ELEMENTS_KIND);
-    for (int i = 0; i <= last_index; ++i) {
-      ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
-      __ mov(r0, Operand(kind));
-      __ cmp(r6, r0);
-      ArraySingleArgumentConstructorStub stub(masm->isolate(), kind);
-      __ TailCallStub(&stub, eq);
-    }
-
-    // If we reached this point there is a problem.
-    __ Abort(AbortReason::kUnexpectedElementsKindInArrayConstructor);
-  } else {
-    UNREACHABLE();
-  }
-}
-
-
-template <class T>
-static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) {
-  int to_index =
-      GetSequenceIndexFromFastElementsKind(TERMINAL_FAST_ELEMENTS_KIND);
-  for (int i = 0; i <= to_index; ++i) {
-    ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
-    T stub(isolate, kind);
-    stub.GetCode();
-    if (AllocationSite::ShouldTrack(kind)) {
-      T stub1(isolate, kind, DISABLE_ALLOCATION_SITES);
-      stub1.GetCode();
-    }
-  }
-}
-
-
-void CommonArrayConstructorStub::GenerateStubsAheadOfTime(Isolate* isolate) {
-  ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>(
-      isolate);
-  ArrayNArgumentsConstructorStub stub(isolate);
-  stub.GetCode();
-  ElementsKind kinds[2] = {PACKED_ELEMENTS, HOLEY_ELEMENTS};
-  for (int i = 0; i < 2; i++) {
-    // For internal arrays we only need a few things
-    InternalArrayNoArgumentConstructorStub stubh1(isolate, kinds[i]);
-    stubh1.GetCode();
-    InternalArraySingleArgumentConstructorStub stubh2(isolate, kinds[i]);
-    stubh2.GetCode();
-  }
-}
-
-
-void ArrayConstructorStub::GenerateDispatchToArrayStub(
-    MacroAssembler* masm, AllocationSiteOverrideMode mode) {
-  Label not_zero_case, not_one_case;
-  __ cmpi(r3, Operand::Zero());
-  __ bne(&not_zero_case);
-  CreateArrayDispatch<ArrayNoArgumentConstructorStub>(masm, mode);
-
-  __ bind(&not_zero_case);
-  __ cmpi(r3, Operand(1));
-  __ bgt(&not_one_case);
-  CreateArrayDispatchOneArgument(masm, mode);
-
-  __ bind(&not_one_case);
-  ArrayNArgumentsConstructorStub stub(masm->isolate());
-  __ TailCallStub(&stub);
-}
-
-
-void ArrayConstructorStub::Generate(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- r3 : argc (only if argument_count() == ANY)
-  //  -- r4 : constructor
-  //  -- r5 : AllocationSite or undefined
-  //  -- r6 : new target
-  //  -- sp[0] : return address
-  //  -- sp[4] : last argument
-  // -----------------------------------
-
-  if (FLAG_debug_code) {
-    // The array construct code is only set for the global and natives
-    // builtin Array functions which always have maps.
-
-    // Initial map for the builtin Array function should be a map.
-    __ LoadP(r7, FieldMemOperand(r4, JSFunction::kPrototypeOrInitialMapOffset));
-    // Will both indicate a nullptr and a Smi.
-    __ TestIfSmi(r7, r0);
-    __ Assert(ne, AbortReason::kUnexpectedInitialMapForArrayFunction, cr0);
-    __ CompareObjectType(r7, r7, r8, MAP_TYPE);
-    __ Assert(eq, AbortReason::kUnexpectedInitialMapForArrayFunction);
-
-    // We should either have undefined in r5 or a valid AllocationSite
-    __ AssertUndefinedOrAllocationSite(r5, r7);
-  }
-
-  // Enter the context of the Array function.
-  __ LoadP(cp, FieldMemOperand(r4, JSFunction::kContextOffset));
-
-  Label subclassing;
-  __ cmp(r6, r4);
-  __ bne(&subclassing);
-
-  Label no_info;
-  // Get the elements kind and case on that.
-  __ CompareRoot(r5, Heap::kUndefinedValueRootIndex);
-  __ beq(&no_info);
-
-  __ LoadP(r6, FieldMemOperand(
-                   r5, AllocationSite::kTransitionInfoOrBoilerplateOffset));
-  __ SmiUntag(r6);
-  STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
-  __ And(r6, r6, Operand(AllocationSite::ElementsKindBits::kMask));
-  GenerateDispatchToArrayStub(masm, DONT_OVERRIDE);
-
-  __ bind(&no_info);
-  GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES);
-
-  __ bind(&subclassing);
-  __ ShiftLeftImm(r0, r3, Operand(kPointerSizeLog2));
-  __ StorePX(r4, MemOperand(sp, r0));
-  __ addi(r3, r3, Operand(3));
-  __ Push(r6, r5);
-  __ JumpToExternalReference(ExternalReference(Runtime::kNewArray, isolate()));
-}
-
-
-void InternalArrayConstructorStub::GenerateCase(MacroAssembler* masm,
-                                                ElementsKind kind) {
-  __ cmpli(r3, Operand(1));
-
-  InternalArrayNoArgumentConstructorStub stub0(isolate(), kind);
-  __ TailCallStub(&stub0, lt);
-
-  ArrayNArgumentsConstructorStub stubN(isolate());
-  __ TailCallStub(&stubN, gt);
-
-  if (IsFastPackedElementsKind(kind)) {
-    // We might need to create a holey array
-    // look at the first argument
-    __ LoadP(r6, MemOperand(sp, 0));
-    __ cmpi(r6, Operand::Zero());
-
-    InternalArraySingleArgumentConstructorStub stub1_holey(
-        isolate(), GetHoleyElementsKind(kind));
-    __ TailCallStub(&stub1_holey, ne);
-  }
-
-  InternalArraySingleArgumentConstructorStub stub1(isolate(), kind);
-  __ TailCallStub(&stub1);
-}
-
-
-void InternalArrayConstructorStub::Generate(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- r3 : argc
-  //  -- r4 : constructor
-  //  -- sp[0] : return address
-  //  -- sp[4] : last argument
-  // -----------------------------------
-
-  if (FLAG_debug_code) {
-    // The array construct code is only set for the global and natives
-    // builtin Array functions which always have maps.
-
-    // Initial map for the builtin Array function should be a map.
-    __ LoadP(r6, FieldMemOperand(r4, JSFunction::kPrototypeOrInitialMapOffset));
-    // Will both indicate a nullptr and a Smi.
-    __ TestIfSmi(r6, r0);
-    __ Assert(ne, AbortReason::kUnexpectedInitialMapForArrayFunction, cr0);
-    __ CompareObjectType(r6, r6, r7, MAP_TYPE);
-    __ Assert(eq, AbortReason::kUnexpectedInitialMapForArrayFunction);
-  }
-
-  // Figure out the right elements kind
-  __ LoadP(r6, FieldMemOperand(r4, JSFunction::kPrototypeOrInitialMapOffset));
-  // Load the map's "bit field 2" into |result|.
-  __ lbz(r6, FieldMemOperand(r6, Map::kBitField2Offset));
-  // Retrieve elements_kind from bit field 2.
-  __ DecodeField<Map::ElementsKindBits>(r6);
-
-  if (FLAG_debug_code) {
-    Label done;
-    __ cmpi(r6, Operand(PACKED_ELEMENTS));
-    __ beq(&done);
-    __ cmpi(r6, Operand(HOLEY_ELEMENTS));
-    __ Assert(
-        eq,
-        AbortReason::kInvalidElementsKindForInternalArrayOrInternalPackedArray);
-    __ bind(&done);
-  }
-
-  Label fast_elements_case;
-  __ cmpi(r6, Operand(PACKED_ELEMENTS));
-  __ beq(&fast_elements_case);
-  GenerateCase(masm, HOLEY_ELEMENTS);
-
-  __ bind(&fast_elements_case);
-  GenerateCase(masm, PACKED_ELEMENTS);
-}
-
-static int AddressOffset(ExternalReference ref0, ExternalReference ref1) {
-  return ref0.address() - ref1.address();
-}
-
-
-// Calls an API function.  Allocates HandleScope, extracts returned value
-// from handle and propagates exceptions.  Restores context.  stack_space
-// - space to be unwound on exit (includes the call JS arguments space and
-// the additional space allocated for the fast call).
-static void CallApiFunctionAndReturn(MacroAssembler* masm,
-                                     Register function_address,
-                                     ExternalReference thunk_ref,
-                                     int stack_space,
-                                     MemOperand* stack_space_operand,
-                                     MemOperand return_value_operand) {
-  Isolate* isolate = masm->isolate();
-  ExternalReference next_address =
-      ExternalReference::handle_scope_next_address(isolate);
-  const int kNextOffset = 0;
-  const int kLimitOffset = AddressOffset(
-      ExternalReference::handle_scope_limit_address(isolate), next_address);
-  const int kLevelOffset = AddressOffset(
-      ExternalReference::handle_scope_level_address(isolate), next_address);
-
-  // Additional parameter is the address of the actual callback.
-  DCHECK(function_address == r4 || function_address == r5);
-  Register scratch = r6;
-
-  __ mov(scratch, Operand(ExternalReference::is_profiling_address(isolate)));
-  __ lbz(scratch, MemOperand(scratch, 0));
-  __ cmpi(scratch, Operand::Zero());
-
-  if (CpuFeatures::IsSupported(ISELECT)) {
-    __ mov(scratch, Operand(thunk_ref));
-    __ isel(eq, scratch, function_address, scratch);
-  } else {
-    Label profiler_disabled;
-    Label end_profiler_check;
-    __ beq(&profiler_disabled);
-    __ mov(scratch, Operand(thunk_ref));
-    __ b(&end_profiler_check);
-    __ bind(&profiler_disabled);
-    __ mr(scratch, function_address);
-    __ bind(&end_profiler_check);
-  }
-
-  // Allocate HandleScope in callee-save registers.
-  // r17 - next_address
-  // r14 - next_address->kNextOffset
-  // r15 - next_address->kLimitOffset
-  // r16 - next_address->kLevelOffset
-  __ mov(r17, Operand(next_address));
-  __ LoadP(r14, MemOperand(r17, kNextOffset));
-  __ LoadP(r15, MemOperand(r17, kLimitOffset));
-  __ lwz(r16, MemOperand(r17, kLevelOffset));
-  __ addi(r16, r16, Operand(1));
-  __ stw(r16, MemOperand(r17, kLevelOffset));
-
-  if (FLAG_log_timer_events) {
-    FrameScope frame(masm, StackFrame::MANUAL);
-    __ PushSafepointRegisters();
-    __ PrepareCallCFunction(1, r3);
-    __ mov(r3, Operand(ExternalReference::isolate_address(isolate)));
-    __ CallCFunction(ExternalReference::log_enter_external_function(isolate),
-                     1);
-    __ PopSafepointRegisters();
-  }
-
-  // Native call returns to the DirectCEntry stub which redirects to the
-  // return address pushed on stack (could have moved after GC).
-  // DirectCEntry stub itself is generated early and never moves.
-  DirectCEntryStub stub(isolate);
-  stub.GenerateCall(masm, scratch);
-
-  if (FLAG_log_timer_events) {
-    FrameScope frame(masm, StackFrame::MANUAL);
-    __ PushSafepointRegisters();
-    __ PrepareCallCFunction(1, r3);
-    __ mov(r3, Operand(ExternalReference::isolate_address(isolate)));
-    __ CallCFunction(ExternalReference::log_leave_external_function(isolate),
-                     1);
-    __ PopSafepointRegisters();
-  }
-
-  Label promote_scheduled_exception;
-  Label delete_allocated_handles;
-  Label leave_exit_frame;
-  Label return_value_loaded;
-
-  // load value from ReturnValue
-  __ LoadP(r3, return_value_operand);
-  __ bind(&return_value_loaded);
-  // No more valid handles (the result handle was the last one). Restore
-  // previous handle scope.
-  __ StoreP(r14, MemOperand(r17, kNextOffset));
-  if (__ emit_debug_code()) {
-    __ lwz(r4, MemOperand(r17, kLevelOffset));
-    __ cmp(r4, r16);
-    __ Check(eq, AbortReason::kUnexpectedLevelAfterReturnFromApiCall);
-  }
-  __ subi(r16, r16, Operand(1));
-  __ stw(r16, MemOperand(r17, kLevelOffset));
-  __ LoadP(r0, MemOperand(r17, kLimitOffset));
-  __ cmp(r15, r0);
-  __ bne(&delete_allocated_handles);
-
-  // Leave the API exit frame.
-  __ bind(&leave_exit_frame);
-  // LeaveExitFrame expects unwind space to be in a register.
-  if (stack_space_operand != nullptr) {
-    __ lwz(r14, *stack_space_operand);
-  } else {
-    __ mov(r14, Operand(stack_space));
-  }
-  __ LeaveExitFrame(false, r14, stack_space_operand != nullptr);
-
-  // Check if the function scheduled an exception.
-  __ LoadRoot(r14, Heap::kTheHoleValueRootIndex);
-  __ mov(r15, Operand(ExternalReference::scheduled_exception_address(isolate)));
-  __ LoadP(r15, MemOperand(r15));
-  __ cmp(r14, r15);
-  __ bne(&promote_scheduled_exception);
-
-  __ blr();
-
-  // Re-throw by promoting a scheduled exception.
-  __ bind(&promote_scheduled_exception);
-  __ TailCallRuntime(Runtime::kPromoteScheduledException);
-
-  // HandleScope limit has changed. Delete allocated extensions.
-  __ bind(&delete_allocated_handles);
-  __ StoreP(r15, MemOperand(r17, kLimitOffset));
-  __ mr(r14, r3);
-  __ PrepareCallCFunction(1, r15);
-  __ mov(r3, Operand(ExternalReference::isolate_address(isolate)));
-  __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate),
-                   1);
-  __ mr(r3, r14);
-  __ b(&leave_exit_frame);
-}
-
-void CallApiCallbackStub::Generate(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- r7                  : call_data
-  //  -- r5                  : holder
-  //  -- r4                  : api_function_address
-  //  -- cp                  : context
-  //  --
-  //  -- sp[0]               : last argument
-  //  -- ...
-  //  -- sp[(argc - 1)* 4]   : first argument
-  //  -- sp[argc * 4]        : receiver
-  // -----------------------------------
-
-  Register call_data = r7;
-  Register holder = r5;
-  Register api_function_address = r4;
-
-  typedef FunctionCallbackArguments FCA;
-
-  STATIC_ASSERT(FCA::kArgsLength == 6);
-  STATIC_ASSERT(FCA::kNewTargetIndex == 5);
-  STATIC_ASSERT(FCA::kDataIndex == 4);
-  STATIC_ASSERT(FCA::kReturnValueOffset == 3);
-  STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2);
-  STATIC_ASSERT(FCA::kIsolateIndex == 1);
-  STATIC_ASSERT(FCA::kHolderIndex == 0);
-
-  // new target
-  __ PushRoot(Heap::kUndefinedValueRootIndex);
-
-  // call data
-  __ push(call_data);
-
-  Register scratch = call_data;
-  __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex);
-  // return value
-  __ push(scratch);
-  // return value default
-  __ push(scratch);
-  // isolate
-  __ mov(scratch, Operand(ExternalReference::isolate_address(masm->isolate())));
-  __ push(scratch);
-  // holder
-  __ push(holder);
-
-  // Prepare arguments.
-  __ mr(scratch, sp);
-
-  // Allocate the v8::Arguments structure in the arguments' space since
-  // it's not controlled by GC.
-  // PPC LINUX ABI:
-  //
-  // Create 4 extra slots on stack:
-  //    [0] space for DirectCEntryStub's LR save
-  //    [1-3] FunctionCallbackInfo
-  const int kApiStackSpace = 4;
-  const int kFunctionCallbackInfoOffset =
-      (kStackFrameExtraParamSlot + 1) * kPointerSize;
-
-  FrameScope frame_scope(masm, StackFrame::MANUAL);
-  __ EnterExitFrame(false, kApiStackSpace);
-
-  DCHECK(api_function_address != r3 && scratch != r3);
-  // r3 = FunctionCallbackInfo&
-  // Arguments is after the return address.
-  __ addi(r3, sp, Operand(kFunctionCallbackInfoOffset));
-  // FunctionCallbackInfo::implicit_args_
-  __ StoreP(scratch, MemOperand(r3, 0 * kPointerSize));
-  // FunctionCallbackInfo::values_
-  __ addi(ip, scratch, Operand((FCA::kArgsLength - 1 + argc()) * kPointerSize));
-  __ StoreP(ip, MemOperand(r3, 1 * kPointerSize));
-  // FunctionCallbackInfo::length_ = argc
-  __ li(ip, Operand(argc()));
-  __ stw(ip, MemOperand(r3, 2 * kPointerSize));
-
-  ExternalReference thunk_ref =
-      ExternalReference::invoke_function_callback(masm->isolate());
-
-  AllowExternalCallThatCantCauseGC scope(masm);
-  // Stores return the first js argument
-  int return_value_offset = 2 + FCA::kReturnValueOffset;
-  MemOperand return_value_operand(fp, return_value_offset * kPointerSize);
-  const int stack_space = argc() + FCA::kArgsLength + 1;
-  MemOperand* stack_space_operand = nullptr;
-  CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space,
-                           stack_space_operand, return_value_operand);
-}
-
-
-void CallApiGetterStub::Generate(MacroAssembler* masm) {
-  int arg0Slot = 0;
-  int accessorInfoSlot = 0;
-  int apiStackSpace = 0;
-  // Build v8::PropertyCallbackInfo::args_ array on the stack and push property
-  // name below the exit frame to make GC aware of them.
-  STATIC_ASSERT(PropertyCallbackArguments::kShouldThrowOnErrorIndex == 0);
-  STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 1);
-  STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 2);
-  STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 3);
-  STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 4);
-  STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 5);
-  STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 6);
-  STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 7);
-
-  Register receiver = ApiGetterDescriptor::ReceiverRegister();
-  Register holder = ApiGetterDescriptor::HolderRegister();
-  Register callback = ApiGetterDescriptor::CallbackRegister();
-  Register scratch = r7;
-  DCHECK(!AreAliased(receiver, holder, callback, scratch));
-
-  Register api_function_address = r5;
-
-  __ push(receiver);
-  // Push data from AccessorInfo.
-  __ LoadP(scratch, FieldMemOperand(callback, AccessorInfo::kDataOffset));
-  __ push(scratch);
-  __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex);
-  __ Push(scratch, scratch);
-  __ mov(scratch, Operand(ExternalReference::isolate_address(isolate())));
-  __ Push(scratch, holder);
-  __ Push(Smi::kZero);  // should_throw_on_error -> false
-  __ LoadP(scratch, FieldMemOperand(callback, AccessorInfo::kNameOffset));
-  __ push(scratch);
-
-  // v8::PropertyCallbackInfo::args_ array and name handle.
-  const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1;
-
-  // Load address of v8::PropertyAccessorInfo::args_ array and name handle.
-  __ mr(r3, sp);                               // r3 = Handle<Name>
-  __ addi(r4, r3, Operand(1 * kPointerSize));  // r4 = v8::PCI::args_
-
-// If ABI passes Handles (pointer-sized struct) in a register:
-//
-// Create 2 extra slots on stack:
-//    [0] space for DirectCEntryStub's LR save
-//    [1] AccessorInfo&
-//
-// Otherwise:
-//
-// Create 3 extra slots on stack:
-//    [0] space for DirectCEntryStub's LR save
-//    [1] copy of Handle (first arg)
-//    [2] AccessorInfo&
-  if (ABI_PASSES_HANDLES_IN_REGS) {
-    accessorInfoSlot = kStackFrameExtraParamSlot + 1;
-    apiStackSpace = 2;
-  } else {
-    arg0Slot = kStackFrameExtraParamSlot + 1;
-    accessorInfoSlot = arg0Slot + 1;
-    apiStackSpace = 3;
-  }
-
-  FrameScope frame_scope(masm, StackFrame::MANUAL);
-  __ EnterExitFrame(false, apiStackSpace);
-
-  if (!ABI_PASSES_HANDLES_IN_REGS) {
-    // pass 1st arg by reference
-    __ StoreP(r3, MemOperand(sp, arg0Slot * kPointerSize));
-    __ addi(r3, sp, Operand(arg0Slot * kPointerSize));
-  }
-
-  // Create v8::PropertyCallbackInfo object on the stack and initialize
-  // it's args_ field.
-  __ StoreP(r4, MemOperand(sp, accessorInfoSlot * kPointerSize));
-  __ addi(r4, sp, Operand(accessorInfoSlot * kPointerSize));
-  // r4 = v8::PropertyCallbackInfo&
-
-  ExternalReference thunk_ref =
-      ExternalReference::invoke_accessor_getter_callback(isolate());
-
-  __ LoadP(scratch, FieldMemOperand(callback, AccessorInfo::kJsGetterOffset));
-  __ LoadP(api_function_address,
-        FieldMemOperand(scratch, Foreign::kForeignAddressOffset));
-
-  // +3 is to skip prolog, return address and name handle.
-  MemOperand return_value_operand(
-      fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize);
-  CallApiFunctionAndReturn(masm, api_function_address, thunk_ref,
-                           kStackUnwindSpace, nullptr, return_value_operand);
-}
-
-#undef __
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_PPC
diff --git a/src/v8/src/ppc/code-stubs-ppc.h b/src/v8/src/ppc/code-stubs-ppc.h
deleted file mode 100644
index 8028458..0000000
--- a/src/v8/src/ppc/code-stubs-ppc.h
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_PPC_CODE_STUBS_PPC_H_
-#define V8_PPC_CODE_STUBS_PPC_H_
-
-namespace v8 {
-namespace internal {
-
-// Trampoline stub to call into native code. To call safely into native code
-// in the presence of compacting GC (which can move code objects) we need to
-// keep the code which called into native pinned in the memory. Currently the
-// simplest approach is to generate such stub early enough so it can never be
-// moved by GC
-class DirectCEntryStub : public PlatformCodeStub {
- public:
-  explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {}
-  void GenerateCall(MacroAssembler* masm, Register target);
-
- private:
-  Movability NeedsImmovableCode() override { return kImmovable; }
-
-  DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR();
-  DEFINE_PLATFORM_CODE_STUB(DirectCEntry, PlatformCodeStub);
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_PPC_CODE_STUBS_PPC_H_
diff --git a/src/v8/src/ppc/codegen-ppc.cc b/src/v8/src/ppc/codegen-ppc.cc
deleted file mode 100644
index 4641dc2..0000000
--- a/src/v8/src/ppc/codegen-ppc.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2014 the V8 project 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 V8_TARGET_ARCH_PPC
-
-#include <memory>
-
-#include "src/codegen.h"
-#include "src/macro-assembler.h"
-#include "src/ppc/simulator-ppc.h"
-
-namespace v8 {
-namespace internal {
-
-#define __ masm.
-
-UnaryMathFunctionWithIsolate CreateSqrtFunction(Isolate* isolate) {
-#if defined(USE_SIMULATOR)
-  return nullptr;
-#else
-  size_t allocated = 0;
-  byte* buffer = AllocatePage(isolate->heap()->GetRandomMmapAddr(), &allocated);
-  if (buffer == nullptr) return nullptr;
-
-  MacroAssembler masm(isolate, buffer, static_cast<int>(allocated),
-                      CodeObjectRequired::kNo);
-
-  // Called from C
-  __ function_descriptor();
-
-  __ MovFromFloatParameter(d1);
-  __ fsqrt(d1, d1);
-  __ MovToFloatResult(d1);
-  __ Ret();
-
-  CodeDesc desc;
-  masm.GetCode(isolate, &desc);
-  DCHECK(ABI_USES_FUNCTION_DESCRIPTORS ||
-         !RelocInfo::RequiresRelocation(isolate, desc));
-
-  Assembler::FlushICache(isolate, buffer, allocated);
-  CHECK(SetPermissions(buffer, allocated, PageAllocator::kReadExecute));
-  return FUNCTION_CAST<UnaryMathFunctionWithIsolate>(buffer);
-#endif
-}
-
-#undef __
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_PPC
diff --git a/src/v8/src/ppc/constants-ppc.cc b/src/v8/src/ppc/constants-ppc.cc
deleted file mode 100644
index e6eec64..0000000
--- a/src/v8/src/ppc/constants-ppc.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2014 the V8 project 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 V8_TARGET_ARCH_PPC
-
-#include "src/ppc/constants-ppc.h"
-
-
-namespace v8 {
-namespace internal {
-
-// These register names are defined in a way to match the native disassembler
-// formatting. See for example the command "objdump -d <binary file>".
-const char* Registers::names_[kNumRegisters] = {
-    "r0",  "sp",  "r2",  "r3",  "r4",  "r5",  "r6",  "r7",  "r8",  "r9",  "r10",
-    "r11", "ip",  "r13", "r14", "r15", "r16", "r17", "r18", "r19", "r20", "r21",
-    "r22", "r23", "r24", "r25", "r26", "r27", "r28", "r29", "r30", "fp"};
-
-
-const char* DoubleRegisters::names_[kNumDoubleRegisters] = {
-    "d0",  "d1",  "d2",  "d3",  "d4",  "d5",  "d6",  "d7",  "d8",  "d9",  "d10",
-    "d11", "d12", "d13", "d14", "d15", "d16", "d17", "d18", "d19", "d20", "d21",
-    "d22", "d23", "d24", "d25", "d26", "d27", "d28", "d29", "d30", "d31"};
-
-
-int DoubleRegisters::Number(const char* name) {
-  for (int i = 0; i < kNumDoubleRegisters; i++) {
-    if (strcmp(names_[i], name) == 0) {
-      return i;
-    }
-  }
-
-  // No register with the requested name found.
-  return kNoRegister;
-}
-
-
-int Registers::Number(const char* name) {
-  // Look through the canonical names.
-  for (int i = 0; i < kNumRegisters; i++) {
-    if (strcmp(names_[i], name) == 0) {
-      return i;
-    }
-  }
-
-  // No register with the requested name found.
-  return kNoRegister;
-}
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_PPC
diff --git a/src/v8/src/ppc/constants-ppc.h b/src/v8/src/ppc/constants-ppc.h
deleted file mode 100644
index bab4efe..0000000
--- a/src/v8/src/ppc/constants-ppc.h
+++ /dev/null
@@ -1,2964 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_PPC_CONSTANTS_PPC_H_
-#define V8_PPC_CONSTANTS_PPC_H_
-
-#include <stdint.h>
-
-#include "src/base/logging.h"
-#include "src/base/macros.h"
-#include "src/globals.h"
-
-// UNIMPLEMENTED_ macro for PPC.
-#ifdef DEBUG
-#define UNIMPLEMENTED_PPC()                                                \
-  v8::internal::PrintF("%s, \tline %d: \tfunction %s not implemented. \n", \
-                       __FILE__, __LINE__, __func__)
-#else
-#define UNIMPLEMENTED_PPC()
-#endif
-
-namespace v8 {
-namespace internal {
-
-// Number of registers
-const int kNumRegisters = 32;
-
-// FP support.
-const int kNumDoubleRegisters = 32;
-
-const int kNoRegister = -1;
-
-// Used in embedded constant pool builder - max reach in bits for
-// various load instructions (one less due to unsigned)
-const int kLoadPtrMaxReachBits = 15;
-const int kLoadDoubleMaxReachBits = 15;
-
-// sign-extend the least significant 16-bits of value <imm>
-#define SIGN_EXT_IMM16(imm) ((static_cast<int>(imm) << 16) >> 16)
-
-// sign-extend the least significant 26-bits of value <imm>
-#define SIGN_EXT_IMM26(imm) ((static_cast<int>(imm) << 6) >> 6)
-
-// -----------------------------------------------------------------------------
-// Conditions.
-
-// Defines constants and accessor classes to assemble, disassemble and
-// simulate PPC instructions.
-//
-// Section references in the code refer to the "PowerPC Microprocessor
-// Family: The Programmer.s Reference Guide" from 10/95
-// https://www-01.ibm.com/chips/techlib/techlib.nsf/techdocs/852569B20050FF778525699600741775/$file/prg.pdf
-//
-
-// Constants for specific fields are defined in their respective named enums.
-// General constants are in an anonymous enum in class Instr.
-enum Condition {
-  kNoCondition = -1,
-  eq = 0,         // Equal.
-  ne = 1,         // Not equal.
-  ge = 2,         // Greater or equal.
-  lt = 3,         // Less than.
-  gt = 4,         // Greater than.
-  le = 5,         // Less then or equal
-  unordered = 6,  // Floating-point unordered
-  ordered = 7,
-  overflow = 8,  // Summary overflow
-  nooverflow = 9,
-  al = 10  // Always.
-};
-
-
-inline Condition NegateCondition(Condition cond) {
-  DCHECK(cond != al);
-  return static_cast<Condition>(cond ^ ne);
-}
-
-
-// Commute a condition such that {a cond b == b cond' a}.
-inline Condition CommuteCondition(Condition cond) {
-  switch (cond) {
-    case lt:
-      return gt;
-    case gt:
-      return lt;
-    case ge:
-      return le;
-    case le:
-      return ge;
-    default:
-      return cond;
-  }
-}
-
-// -----------------------------------------------------------------------------
-// Instructions encoding.
-
-// Instr is merely used by the Assembler to distinguish 32bit integers
-// representing instructions from usual 32 bit values.
-// Instruction objects are pointers to 32bit values, and provide methods to
-// access the various ISA fields.
-typedef uint32_t Instr;
-
-#define PPC_XX3_OPCODE_LIST(V)                                                 \
-  /* VSX Scalar Add Double-Precision */                                        \
-  V(xsadddp, XSADDDP, 0xF0000100)                                              \
-  /* VSX Scalar Add Single-Precision */                                        \
-  V(xsaddsp, XSADDSP, 0xF0000000)                                              \
-  /* VSX Scalar Compare Ordered Double-Precision */                            \
-  V(xscmpodp, XSCMPODP, 0xF0000158)                                            \
-  /* VSX Scalar Compare Unordered Double-Precision */                          \
-  V(xscmpudp, XSCMPUDP, 0xF0000118)                                            \
-  /* VSX Scalar Copy Sign Double-Precision */                                  \
-  V(xscpsgndp, XSCPSGNDP, 0xF0000580)                                          \
-  /* VSX Scalar Divide Double-Precision */                                     \
-  V(xsdivdp, XSDIVDP, 0xF00001C0)                                              \
-  /* VSX Scalar Divide Single-Precision */                                     \
-  V(xsdivsp, XSDIVSP, 0xF00000C0)                                              \
-  /* VSX Scalar Multiply-Add Type-A Double-Precision */                        \
-  V(xsmaddadp, XSMADDADP, 0xF0000108)                                          \
-  /* VSX Scalar Multiply-Add Type-A Single-Precision */                        \
-  V(xsmaddasp, XSMADDASP, 0xF0000008)                                          \
-  /* VSX Scalar Multiply-Add Type-M Double-Precision */                        \
-  V(xsmaddmdp, XSMADDMDP, 0xF0000148)                                          \
-  /* VSX Scalar Multiply-Add Type-M Single-Precision */                        \
-  V(xsmaddmsp, XSMADDMSP, 0xF0000048)                                          \
-  /* VSX Scalar Maximum Double-Precision */                                    \
-  V(xsmaxdp, XSMAXDP, 0xF0000500)                                              \
-  /* VSX Scalar Minimum Double-Precision */                                    \
-  V(xsmindp, XSMINDP, 0xF0000540)                                              \
-  /* VSX Scalar Multiply-Subtract Type-A Double-Precision */                   \
-  V(xsmsubadp, XSMSUBADP, 0xF0000188)                                          \
-  /* VSX Scalar Multiply-Subtract Type-A Single-Precision */                   \
-  V(xsmsubasp, XSMSUBASP, 0xF0000088)                                          \
-  /* VSX Scalar Multiply-Subtract Type-M Double-Precision */                   \
-  V(xsmsubmdp, XSMSUBMDP, 0xF00001C8)                                          \
-  /* VSX Scalar Multiply-Subtract Type-M Single-Precision */                   \
-  V(xsmsubmsp, XSMSUBMSP, 0xF00000C8)                                          \
-  /* VSX Scalar Multiply Double-Precision */                                   \
-  V(xsmuldp, XSMULDP, 0xF0000180)                                              \
-  /* VSX Scalar Multiply Single-Precision */                                   \
-  V(xsmulsp, XSMULSP, 0xF0000080)                                              \
-  /* VSX Scalar Negative Multiply-Add Type-A Double-Precision */               \
-  V(xsnmaddadp, XSNMADDADP, 0xF0000508)                                        \
-  /* VSX Scalar Negative Multiply-Add Type-A Single-Precision */               \
-  V(xsnmaddasp, XSNMADDASP, 0xF0000408)                                        \
-  /* VSX Scalar Negative Multiply-Add Type-M Double-Precision */               \
-  V(xsnmaddmdp, XSNMADDMDP, 0xF0000548)                                        \
-  /* VSX Scalar Negative Multiply-Add Type-M Single-Precision */               \
-  V(xsnmaddmsp, XSNMADDMSP, 0xF0000448)                                        \
-  /* VSX Scalar Negative Multiply-Subtract Type-A Double-Precision */          \
-  V(xsnmsubadp, XSNMSUBADP, 0xF0000588)                                        \
-  /* VSX Scalar Negative Multiply-Subtract Type-A Single-Precision */          \
-  V(xsnmsubasp, XSNMSUBASP, 0xF0000488)                                        \
-  /* VSX Scalar Negative Multiply-Subtract Type-M Double-Precision */          \
-  V(xsnmsubmdp, XSNMSUBMDP, 0xF00005C8)                                        \
-  /* VSX Scalar Negative Multiply-Subtract Type-M Single-Precision */          \
-  V(xsnmsubmsp, XSNMSUBMSP, 0xF00004C8)                                        \
-  /* VSX Scalar Reciprocal Estimate Double-Precision */                        \
-  V(xsredp, XSREDP, 0xF0000168)                                                \
-  /* VSX Scalar Reciprocal Estimate Single-Precision */                        \
-  V(xsresp, XSRESP, 0xF0000068)                                                \
-  /* VSX Scalar Subtract Double-Precision */                                   \
-  V(xssubdp, XSSUBDP, 0xF0000140)                                              \
-  /* VSX Scalar Subtract Single-Precision */                                   \
-  V(xssubsp, XSSUBSP, 0xF0000040)                                              \
-  /* VSX Scalar Test for software Divide Double-Precision */                   \
-  V(xstdivdp, XSTDIVDP, 0xF00001E8)                                            \
-  /* VSX Vector Add Double-Precision */                                        \
-  V(xvadddp, XVADDDP, 0xF0000300)                                              \
-  /* VSX Vector Add Single-Precision */                                        \
-  V(xvaddsp, XVADDSP, 0xF0000200)                                              \
-  /* VSX Vector Compare Equal To Double-Precision */                           \
-  V(xvcmpeqdp, XVCMPEQDP, 0xF0000318)                                          \
-  /* VSX Vector Compare Equal To Double-Precision & record CR6 */              \
-  V(xvcmpeqdpx, XVCMPEQDPx, 0xF0000718)                                        \
-  /* VSX Vector Compare Equal To Single-Precision */                           \
-  V(xvcmpeqsp, XVCMPEQSP, 0xF0000218)                                          \
-  /* VSX Vector Compare Equal To Single-Precision & record CR6 */              \
-  V(xvcmpeqspx, XVCMPEQSPx, 0xF0000618)                                        \
-  /* VSX Vector Compare Greater Than or Equal To Double-Precision */           \
-  V(xvcmpgedp, XVCMPGEDP, 0xF0000398)                                          \
-  /* VSX Vector Compare Greater Than or Equal To Double-Precision & record */  \
-  /* CR6 */                                                                    \
-  V(xvcmpgedpx, XVCMPGEDPx, 0xF0000798)                                        \
-  /* VSX Vector Compare Greater Than or Equal To Single-Precision */           \
-  V(xvcmpgesp, XVCMPGESP, 0xF0000298)                                          \
-  /* VSX Vector Compare Greater Than or Equal To Single-Precision & record */  \
-  /* CR6 */                                                                    \
-  V(xvcmpgespx, XVCMPGESPx, 0xF0000698)                                        \
-  /* VSX Vector Compare Greater Than Double-Precision */                       \
-  V(xvcmpgtdp, XVCMPGTDP, 0xF0000358)                                          \
-  /* VSX Vector Compare Greater Than Double-Precision & record CR6 */          \
-  V(xvcmpgtdpx, XVCMPGTDPx, 0xF0000758)                                        \
-  /* VSX Vector Compare Greater Than Single-Precision */                       \
-  V(xvcmpgtsp, XVCMPGTSP, 0xF0000258)                                          \
-  /* VSX Vector Compare Greater Than Single-Precision & record CR6 */          \
-  V(xvcmpgtspx, XVCMPGTSPx, 0xF0000658)                                        \
-  /* VSX Vector Copy Sign Double-Precision */                                  \
-  V(xvcpsgndp, XVCPSGNDP, 0xF0000780)                                          \
-  /* VSX Vector Copy Sign Single-Precision */                                  \
-  V(xvcpsgnsp, XVCPSGNSP, 0xF0000680)                                          \
-  /* VSX Vector Divide Double-Precision */                                     \
-  V(xvdivdp, XVDIVDP, 0xF00003C0)                                              \
-  /* VSX Vector Divide Single-Precision */                                     \
-  V(xvdivsp, XVDIVSP, 0xF00002C0)                                              \
-  /* VSX Vector Multiply-Add Type-A Double-Precision */                        \
-  V(xvmaddadp, XVMADDADP, 0xF0000308)                                          \
-  /* VSX Vector Multiply-Add Type-A Single-Precision */                        \
-  V(xvmaddasp, XVMADDASP, 0xF0000208)                                          \
-  /* VSX Vector Multiply-Add Type-M Double-Precision */                        \
-  V(xvmaddmdp, XVMADDMDP, 0xF0000348)                                          \
-  /* VSX Vector Multiply-Add Type-M Single-Precision */                        \
-  V(xvmaddmsp, XVMADDMSP, 0xF0000248)                                          \
-  /* VSX Vector Maximum Double-Precision */                                    \
-  V(xvmaxdp, XVMAXDP, 0xF0000700)                                              \
-  /* VSX Vector Maximum Single-Precision */                                    \
-  V(xvmaxsp, XVMAXSP, 0xF0000600)                                              \
-  /* VSX Vector Minimum Double-Precision */                                    \
-  V(xvmindp, XVMINDP, 0xF0000740)                                              \
-  /* VSX Vector Minimum Single-Precision */                                    \
-  V(xvminsp, XVMINSP, 0xF0000640)                                              \
-  /* VSX Vector Multiply-Subtract Type-A Double-Precision */                   \
-  V(xvmsubadp, XVMSUBADP, 0xF0000388)                                          \
-  /* VSX Vector Multiply-Subtract Type-A Single-Precision */                   \
-  V(xvmsubasp, XVMSUBASP, 0xF0000288)                                          \
-  /* VSX Vector Multiply-Subtract Type-M Double-Precision */                   \
-  V(xvmsubmdp, XVMSUBMDP, 0xF00003C8)                                          \
-  /* VSX Vector Multiply-Subtract Type-M Single-Precision */                   \
-  V(xvmsubmsp, XVMSUBMSP, 0xF00002C8)                                          \
-  /* VSX Vector Multiply Double-Precision */                                   \
-  V(xvmuldp, XVMULDP, 0xF0000380)                                              \
-  /* VSX Vector Multiply Single-Precision */                                   \
-  V(xvmulsp, XVMULSP, 0xF0000280)                                              \
-  /* VSX Vector Negative Multiply-Add Type-A Double-Precision */               \
-  V(xvnmaddadp, XVNMADDADP, 0xF0000708)                                        \
-  /* VSX Vector Negative Multiply-Add Type-A Single-Precision */               \
-  V(xvnmaddasp, XVNMADDASP, 0xF0000608)                                        \
-  /* VSX Vector Negative Multiply-Add Type-M Double-Precision */               \
-  V(xvnmaddmdp, XVNMADDMDP, 0xF0000748)                                        \
-  /* VSX Vector Negative Multiply-Add Type-M Single-Precision */               \
-  V(xvnmaddmsp, XVNMADDMSP, 0xF0000648)                                        \
-  /* VSX Vector Negative Multiply-Subtract Type-A Double-Precision */          \
-  V(xvnmsubadp, XVNMSUBADP, 0xF0000788)                                        \
-  /* VSX Vector Negative Multiply-Subtract Type-A Single-Precision */          \
-  V(xvnmsubasp, XVNMSUBASP, 0xF0000688)                                        \
-  /* VSX Vector Negative Multiply-Subtract Type-M Double-Precision */          \
-  V(xvnmsubmdp, XVNMSUBMDP, 0xF00007C8)                                        \
-  /* VSX Vector Negative Multiply-Subtract Type-M Single-Precision */          \
-  V(xvnmsubmsp, XVNMSUBMSP, 0xF00006C8)                                        \
-  /* VSX Vector Reciprocal Estimate Double-Precision */                        \
-  V(xvredp, XVREDP, 0xF0000368)                                                \
-  /* VSX Vector Reciprocal Estimate Single-Precision */                        \
-  V(xvresp, XVRESP, 0xF0000268)                                                \
-  /* VSX Vector Subtract Double-Precision */                                   \
-  V(xvsubdp, XVSUBDP, 0xF0000340)                                              \
-  /* VSX Vector Subtract Single-Precision */                                   \
-  V(xvsubsp, XVSUBSP, 0xF0000240)                                              \
-  /* VSX Vector Test for software Divide Double-Precision */                   \
-  V(xvtdivdp, XVTDIVDP, 0xF00003E8)                                            \
-  /* VSX Vector Test for software Divide Single-Precision */                   \
-  V(xvtdivsp, XVTDIVSP, 0xF00002E8)                                            \
-  /* VSX Logical AND */                                                        \
-  V(xxland, XXLAND, 0xF0000410)                                                \
-  /* VSX Logical AND with Complement */                                        \
-  V(xxlandc, XXLANDC, 0xF0000450)                                              \
-  /* VSX Logical Equivalence */                                                \
-  V(xxleqv, XXLEQV, 0xF00005D0)                                                \
-  /* VSX Logical NAND */                                                       \
-  V(xxlnand, XXLNAND, 0xF0000590)                                              \
-  /* VSX Logical NOR */                                                        \
-  V(xxlnor, XXLNOR, 0xF0000510)                                                \
-  /* VSX Logical OR */                                                         \
-  V(xxlor, XXLOR, 0xF0000490)                                                  \
-  /* VSX Logical OR with Complement */                                         \
-  V(xxlorc, XXLORC, 0xF0000550)                                                \
-  /* VSX Logical XOR */                                                        \
-  V(xxlxor, XXLXOR, 0xF00004D0)                                                \
-  /* VSX Merge High Word */                                                    \
-  V(xxmrghw, XXMRGHW, 0xF0000090)                                              \
-  /* VSX Merge Low Word */                                                     \
-  V(xxmrglw, XXMRGLW, 0xF0000190)                                              \
-  /* VSX Permute Doubleword Immediate */                                       \
-  V(xxpermdi, XXPERMDI, 0xF0000050)                                            \
-  /* VSX Shift Left Double by Word Immediate */                                \
-  V(xxsldwi, XXSLDWI, 0xF0000010)                                              \
-  /* VSX Splat Word */                                                         \
-  V(xxspltw, XXSPLTW, 0xF0000290)
-
-#define PPC_Z23_OPCODE_LIST(V)                                                 \
-  /* Decimal Quantize */                                                       \
-  V(dqua, DQUA, 0xEC000006)                                                    \
-  /* Decimal Quantize Immediate */                                             \
-  V(dquai, DQUAI, 0xEC000086)                                                  \
-  /* Decimal Quantize Immediate Quad */                                        \
-  V(dquaiq, DQUAIQ, 0xFC000086)                                                \
-  /* Decimal Quantize Quad */                                                  \
-  V(dquaq, DQUAQ, 0xFC000006)                                                  \
-  /* Decimal Floating Round To FP Integer Without Inexact */                   \
-  V(drintn, DRINTN, 0xEC0001C6)                                                \
-  /* Decimal Floating Round To FP Integer Without Inexact Quad */              \
-  V(drintnq, DRINTNQ, 0xFC0001C6)                                              \
-  /* Decimal Floating Round To FP Integer With Inexact */                      \
-  V(drintx, DRINTX, 0xEC0000C6)                                                \
-  /* Decimal Floating Round To FP Integer With Inexact Quad */                 \
-  V(drintxq, DRINTXQ, 0xFC0000C6)                                              \
-  /* Decimal Floating Reround */                                               \
-  V(drrnd, DRRND, 0xEC000046)                                                  \
-  /* Decimal Floating Reround Quad */                                          \
-  V(drrndq, DRRNDQ, 0xFC000046)
-
-#define PPC_Z22_OPCODE_LIST(V)                                                 \
-  /* Decimal Floating Shift Coefficient Left Immediate */                      \
-  V(dscli, DSCLI, 0xEC000084)                                                  \
-  /* Decimal Floating Shift Coefficient Left Immediate Quad */                 \
-  V(dscliq, DSCLIQ, 0xFC000084)                                                \
-  /* Decimal Floating Shift Coefficient Right Immediate */                     \
-  V(dscri, DSCRI, 0xEC0000C4)                                                  \
-  /* Decimal Floating Shift Coefficient Right Immediate Quad */                \
-  V(dscriq, DSCRIQ, 0xFC0000C4)                                                \
-  /* Decimal Floating Test Data Class */                                       \
-  V(dtstdc, DTSTDC, 0xEC000184)                                                \
-  /* Decimal Floating Test Data Class Quad */                                  \
-  V(dtstdcq, DTSTDCQ, 0xFC000184)                                              \
-  /* Decimal Floating Test Data Group */                                       \
-  V(dtstdg, DTSTDG, 0xEC0001C4)                                                \
-  /* Decimal Floating Test Data Group Quad */                                  \
-  V(dtstdgq, DTSTDGQ, 0xFC0001C4)
-
-#define PPC_XX2_OPCODE_LIST(V)                                                 \
-  /* Move To VSR Doubleword */                                                 \
-  V(mtvsrd, MTVSRD, 0x7C000166)                                                \
-  /* Move To VSR Word Algebraic */                                             \
-  V(mtvsrwa, MTVSRWA, 0x7C0001A6)                                              \
-  /* Move To VSR Word and Zero */                                              \
-  V(mtvsrwz, MTVSRWZ, 0x7C0001E6)                                              \
-  /* VSX Scalar Absolute Value Double-Precision */                             \
-  V(xsabsdp, XSABSDP, 0xF0000564)                                              \
-  /* VSX Scalar Convert Double-Precision to Single-Precision */                \
-  V(xscvdpsp, XSCVDPSP, 0xF0000424)                                            \
-  /* VSX Scalar Convert Double-Precision to Single-Precision format Non- */    \
-  /* signalling */                                                             \
-  V(xscvdpspn, XSCVDPSPN, 0xF000042C)                                          \
-  /* VSX Scalar Convert Double-Precision to Signed Fixed-Point Doubleword */   \
-  /* Saturate */                                                               \
-  V(xscvdpsxds, XSCVDPSXDS, 0xF0000560)                                        \
-  /* VSX Scalar Convert Double-Precision to Signed Fixed-Point Word */         \
-  /* Saturate */                                                               \
-  V(xscvdpsxws, XSCVDPSXWS, 0xF0000160)                                        \
-  /* VSX Scalar Convert Double-Precision to Unsigned Fixed-Point */            \
-  /* Doubleword Saturate */                                                    \
-  V(xscvdpuxds, XSCVDPUXDS, 0xF0000520)                                        \
-  /* VSX Scalar Convert Double-Precision to Unsigned Fixed-Point Word */       \
-  /* Saturate */                                                               \
-  V(xscvdpuxws, XSCVDPUXWS, 0xF0000120)                                        \
-  /* VSX Scalar Convert Single-Precision to Double-Precision (p=1) */          \
-  V(xscvspdp, XSCVSPDP, 0xF0000524)                                            \
-  /* Scalar Convert Single-Precision to Double-Precision format Non- */        \
-  /* signalling */                                                             \
-  V(xscvspdpn, XSCVSPDPN, 0xF000052C)                                          \
-  /* VSX Scalar Convert Signed Fixed-Point Doubleword to Double-Precision */   \
-  V(xscvsxddp, XSCVSXDDP, 0xF00005E0)                                          \
-  /* VSX Scalar Convert Signed Fixed-Point Doubleword to Single-Precision */   \
-  V(xscvsxdsp, XSCVSXDSP, 0xF00004E0)                                          \
-  /* VSX Scalar Convert Unsigned Fixed-Point Doubleword to Double- */          \
-  /* Precision */                                                              \
-  V(xscvuxddp, XSCVUXDDP, 0xF00005A0)                                          \
-  /* VSX Scalar Convert Unsigned Fixed-Point Doubleword to Single- */          \
-  /* Precision */                                                              \
-  V(xscvuxdsp, XSCVUXDSP, 0xF00004A0)                                          \
-  /* VSX Scalar Negative Absolute Value Double-Precision */                    \
-  V(xsnabsdp, XSNABSDP, 0xF00005A4)                                            \
-  /* VSX Scalar Negate Double-Precision */                                     \
-  V(xsnegdp, XSNEGDP, 0xF00005E4)                                              \
-  /* VSX Scalar Round to Double-Precision Integer */                           \
-  V(xsrdpi, XSRDPI, 0xF0000124)                                                \
-  /* VSX Scalar Round to Double-Precision Integer using Current rounding */    \
-  /* mode */                                                                   \
-  V(xsrdpic, XSRDPIC, 0xF00001AC)                                              \
-  /* VSX Scalar Round to Double-Precision Integer toward -Infinity */          \
-  V(xsrdpim, XSRDPIM, 0xF00001E4)                                              \
-  /* VSX Scalar Round to Double-Precision Integer toward +Infinity */          \
-  V(xsrdpip, XSRDPIP, 0xF00001A4)                                              \
-  /* VSX Scalar Round to Double-Precision Integer toward Zero */               \
-  V(xsrdpiz, XSRDPIZ, 0xF0000164)                                              \
-  /* VSX Scalar Round to Single-Precision */                                   \
-  V(xsrsp, XSRSP, 0xF0000464)                                                  \
-  /* VSX Scalar Reciprocal Square Root Estimate Double-Precision */            \
-  V(xsrsqrtedp, XSRSQRTEDP, 0xF0000128)                                        \
-  /* VSX Scalar Reciprocal Square Root Estimate Single-Precision */            \
-  V(xsrsqrtesp, XSRSQRTESP, 0xF0000028)                                        \
-  /* VSX Scalar Square Root Double-Precision */                                \
-  V(xssqrtdp, XSSQRTDP, 0xF000012C)                                            \
-  /* VSX Scalar Square Root Single-Precision */                                \
-  V(xssqrtsp, XSSQRTSP, 0xF000002C)                                            \
-  /* VSX Scalar Test for software Square Root Double-Precision */              \
-  V(xstsqrtdp, XSTSQRTDP, 0xF00001A8)                                          \
-  /* VSX Vector Absolute Value Double-Precision */                             \
-  V(xvabsdp, XVABSDP, 0xF0000764)                                              \
-  /* VSX Vector Absolute Value Single-Precision */                             \
-  V(xvabssp, XVABSSP, 0xF0000664)                                              \
-  /* VSX Vector Convert Double-Precision to Single-Precision */                \
-  V(xvcvdpsp, XVCVDPSP, 0xF0000624)                                            \
-  /* VSX Vector Convert Double-Precision to Signed Fixed-Point Doubleword */   \
-  /* Saturate */                                                               \
-  V(xvcvdpsxds, XVCVDPSXDS, 0xF0000760)                                        \
-  /* VSX Vector Convert Double-Precision to Signed Fixed-Point Word */         \
-  /* Saturate */                                                               \
-  V(xvcvdpsxws, XVCVDPSXWS, 0xF0000360)                                        \
-  /* VSX Vector Convert Double-Precision to Unsigned Fixed-Point */            \
-  /* Doubleword Saturate */                                                    \
-  V(xvcvdpuxds, XVCVDPUXDS, 0xF0000720)                                        \
-  /* VSX Vector Convert Double-Precision to Unsigned Fixed-Point Word */       \
-  /* Saturate */                                                               \
-  V(xvcvdpuxws, XVCVDPUXWS, 0xF0000320)                                        \
-  /* VSX Vector Convert Single-Precision to Double-Precision */                \
-  V(xvcvspdp, XVCVSPDP, 0xF0000724)                                            \
-  /* VSX Vector Convert Single-Precision to Signed Fixed-Point Doubleword */   \
-  /* Saturate */                                                               \
-  V(xvcvspsxds, XVCVSPSXDS, 0xF0000660)                                        \
-  /* VSX Vector Convert Single-Precision to Signed Fixed-Point Word */         \
-  /* Saturate */                                                               \
-  V(xvcvspsxws, XVCVSPSXWS, 0xF0000260)                                        \
-  /* VSX Vector Convert Single-Precision to Unsigned Fixed-Point */            \
-  /* Doubleword Saturate */                                                    \
-  V(xvcvspuxds, XVCVSPUXDS, 0xF0000620)                                        \
-  /* VSX Vector Convert Single-Precision to Unsigned Fixed-Point Word */       \
-  /* Saturate */                                                               \
-  V(xvcvspuxws, XVCVSPUXWS, 0xF0000220)                                        \
-  /* VSX Vector Convert Signed Fixed-Point Doubleword to Double-Precision */   \
-  V(xvcvsxddp, XVCVSXDDP, 0xF00007E0)                                          \
-  /* VSX Vector Convert Signed Fixed-Point Doubleword to Single-Precision */   \
-  V(xvcvsxdsp, XVCVSXDSP, 0xF00006E0)                                          \
-  /* VSX Vector Convert Signed Fixed-Point Word to Double-Precision */         \
-  V(xvcvsxwdp, XVCVSXWDP, 0xF00003E0)                                          \
-  /* VSX Vector Convert Signed Fixed-Point Word to Single-Precision */         \
-  V(xvcvsxwsp, XVCVSXWSP, 0xF00002E0)                                          \
-  /* VSX Vector Convert Unsigned Fixed-Point Doubleword to Double- */          \
-  /* Precision */                                                              \
-  V(xvcvuxddp, XVCVUXDDP, 0xF00007A0)                                          \
-  /* VSX Vector Convert Unsigned Fixed-Point Doubleword to Single- */          \
-  /* Precision */                                                              \
-  V(xvcvuxdsp, XVCVUXDSP, 0xF00006A0)                                          \
-  /* VSX Vector Convert Unsigned Fixed-Point Word to Double-Precision */       \
-  V(xvcvuxwdp, XVCVUXWDP, 0xF00003A0)                                          \
-  /* VSX Vector Convert Unsigned Fixed-Point Word to Single-Precision */       \
-  V(xvcvuxwsp, XVCVUXWSP, 0xF00002A0)                                          \
-  /* VSX Vector Negative Absolute Value Double-Precision */                    \
-  V(xvnabsdp, XVNABSDP, 0xF00007A4)                                            \
-  /* VSX Vector Negative Absolute Value Single-Precision */                    \
-  V(xvnabssp, XVNABSSP, 0xF00006A4)                                            \
-  /* VSX Vector Negate Double-Precision */                                     \
-  V(xvnegdp, XVNEGDP, 0xF00007E4)                                              \
-  /* VSX Vector Negate Single-Precision */                                     \
-  V(xvnegsp, XVNEGSP, 0xF00006E4)                                              \
-  /* VSX Vector Round to Double-Precision Integer */                           \
-  V(xvrdpi, XVRDPI, 0xF0000324)                                                \
-  /* VSX Vector Round to Double-Precision Integer using Current rounding */    \
-  /* mode */                                                                   \
-  V(xvrdpic, XVRDPIC, 0xF00003AC)                                              \
-  /* VSX Vector Round to Double-Precision Integer toward -Infinity */          \
-  V(xvrdpim, XVRDPIM, 0xF00003E4)                                              \
-  /* VSX Vector Round to Double-Precision Integer toward +Infinity */          \
-  V(xvrdpip, XVRDPIP, 0xF00003A4)                                              \
-  /* VSX Vector Round to Double-Precision Integer toward Zero */               \
-  V(xvrdpiz, XVRDPIZ, 0xF0000364)                                              \
-  /* VSX Vector Round to Single-Precision Integer */                           \
-  V(xvrspi, XVRSPI, 0xF0000224)                                                \
-  /* VSX Vector Round to Single-Precision Integer using Current rounding */    \
-  /* mode */                                                                   \
-  V(xvrspic, XVRSPIC, 0xF00002AC)                                              \
-  /* VSX Vector Round to Single-Precision Integer toward -Infinity */          \
-  V(xvrspim, XVRSPIM, 0xF00002E4)                                              \
-  /* VSX Vector Round to Single-Precision Integer toward +Infinity */          \
-  V(xvrspip, XVRSPIP, 0xF00002A4)                                              \
-  /* VSX Vector Round to Single-Precision Integer toward Zero */               \
-  V(xvrspiz, XVRSPIZ, 0xF0000264)                                              \
-  /* VSX Vector Reciprocal Square Root Estimate Double-Precision */            \
-  V(xvrsqrtedp, XVRSQRTEDP, 0xF0000328)                                        \
-  /* VSX Vector Reciprocal Square Root Estimate Single-Precision */            \
-  V(xvrsqrtesp, XVRSQRTESP, 0xF0000228)                                        \
-  /* VSX Vector Square Root Double-Precision */                                \
-  V(xvsqrtdp, XVSQRTDP, 0xF000032C)                                            \
-  /* VSX Vector Square Root Single-Precision */                                \
-  V(xvsqrtsp, XVSQRTSP, 0xF000022C)                                            \
-  /* VSX Vector Test for software Square Root Double-Precision */              \
-  V(xvtsqrtdp, XVTSQRTDP, 0xF00003A8)                                          \
-  /* VSX Vector Test for software Square Root Single-Precision */              \
-  V(xvtsqrtsp, XVTSQRTSP, 0xF00002A8)
-
-#define PPC_EVX_OPCODE_LIST(V)                                                 \
-  /* Vector Load Double Word into Double Word by External PID Indexed */       \
-  V(evlddepx, EVLDDEPX, 0x7C00063E)                                            \
-  /* Vector Store Double of Double by External PID Indexed */                  \
-  V(evstddepx, EVSTDDEPX, 0x7C00073E)                                          \
-  /* Bit Reversed Increment */                                                 \
-  V(brinc, BRINC, 0x1000020F)                                                  \
-  /* Vector Absolute Value */                                                  \
-  V(evabs, EVABS, 0x10000208)                                                  \
-  /* Vector Add Immediate Word */                                              \
-  V(evaddiw, EVADDIW, 0x10000202)                                              \
-  /* Vector Add Signed, Modulo, Integer to Accumulator Word */                 \
-  V(evaddsmiaaw, EVADDSMIAAW, 0x100004C9)                                      \
-  /* Vector Add Signed, Saturate, Integer to Accumulator Word */               \
-  V(evaddssiaaw, EVADDSSIAAW, 0x100004C1)                                      \
-  /* Vector Add Unsigned, Modulo, Integer to Accumulator Word */               \
-  V(evaddumiaaw, EVADDUMIAAW, 0x100004C8)                                      \
-  /* Vector Add Unsigned, Saturate, Integer to Accumulator Word */             \
-  V(evaddusiaaw, EVADDUSIAAW, 0x100004C0)                                      \
-  /* Vector Add Word */                                                        \
-  V(evaddw, EVADDW, 0x10000200)                                                \
-  /* Vector AND */                                                             \
-  V(evand, EVAND, 0x10000211)                                                  \
-  /* Vector AND with Complement */                                             \
-  V(evandc, EVANDC, 0x10000212)                                                \
-  /* Vector Compare Equal */                                                   \
-  V(evcmpeq, EVCMPEQ, 0x10000234)                                              \
-  /* Vector Compare Greater Than Signed */                                     \
-  V(evcmpgts, EVCMPGTS, 0x10000231)                                            \
-  /* Vector Compare Greater Than Unsigned */                                   \
-  V(evcmpgtu, EVCMPGTU, 0x10000230)                                            \
-  /* Vector Compare Less Than Signed */                                        \
-  V(evcmplts, EVCMPLTS, 0x10000233)                                            \
-  /* Vector Compare Less Than Unsigned */                                      \
-  V(evcmpltu, EVCMPLTU, 0x10000232)                                            \
-  /* Vector Count Leading Signed Bits Word */                                  \
-  V(evcntlsw, EVCNTLSW, 0x1000020E)                                            \
-  /* Vector Count Leading Zeros Word */                                        \
-  V(evcntlzw, EVCNTLZW, 0x1000020D)                                            \
-  /* Vector Divide Word Signed */                                              \
-  V(evdivws, EVDIVWS, 0x100004C6)                                              \
-  /* Vector Divide Word Unsigned */                                            \
-  V(evdivwu, EVDIVWU, 0x100004C7)                                              \
-  /* Vector Equivalent */                                                      \
-  V(eveqv, EVEQV, 0x10000219)                                                  \
-  /* Vector Extend Sign Byte */                                                \
-  V(evextsb, EVEXTSB, 0x1000020A)                                              \
-  /* Vector Extend Sign Half Word */                                           \
-  V(evextsh, EVEXTSH, 0x1000020B)                                              \
-  /* Vector Load Double Word into Double Word */                               \
-  V(evldd, EVLDD, 0x10000301)                                                  \
-  /* Vector Load Double Word into Double Word Indexed */                       \
-  V(evlddx, EVLDDX, 0x10000300)                                                \
-  /* Vector Load Double into Four Half Words */                                \
-  V(evldh, EVLDH, 0x10000305)                                                  \
-  /* Vector Load Double into Four Half Words Indexed */                        \
-  V(evldhx, EVLDHX, 0x10000304)                                                \
-  /* Vector Load Double into Two Words */                                      \
-  V(evldw, EVLDW, 0x10000303)                                                  \
-  /* Vector Load Double into Two Words Indexed */                              \
-  V(evldwx, EVLDWX, 0x10000302)                                                \
-  /* Vector Load Half Word into Half Words Even and Splat */                   \
-  V(evlhhesplat, EVLHHESPLAT, 0x10000309)                                      \
-  /* Vector Load Half Word into Half Words Even and Splat Indexed */           \
-  V(evlhhesplatx, EVLHHESPLATX, 0x10000308)                                    \
-  /* Vector Load Half Word into Half Word Odd Signed and Splat */              \
-  V(evlhhossplat, EVLHHOSSPLAT, 0x1000030F)                                    \
-  /* Vector Load Half Word into Half Word Odd Signed and Splat Indexed */      \
-  V(evlhhossplatx, EVLHHOSSPLATX, 0x1000030E)                                  \
-  /* Vector Load Half Word into Half Word Odd Unsigned and Splat */            \
-  V(evlhhousplat, EVLHHOUSPLAT, 0x1000030D)                                    \
-  /* Vector Load Half Word into Half Word Odd Unsigned and Splat Indexed */    \
-  V(evlhhousplatx, EVLHHOUSPLATX, 0x1000030C)                                  \
-  /* Vector Load Word into Two Half Words Even */                              \
-  V(evlwhe, EVLWHE, 0x10000311)                                                \
-  /* Vector Load Word into Two Half Words Odd Signed (with sign extension) */  \
-  V(evlwhos, EVLWHOS, 0x10000317)                                              \
-  /* Vector Load Word into Two Half Words Odd Signed Indexed (with sign */     \
-  /* extension) */                                                             \
-  V(evlwhosx, EVLWHOSX, 0x10000316)                                            \
-  /* Vector Load Word into Two Half Words Odd Unsigned (zero-extended) */      \
-  V(evlwhou, EVLWHOU, 0x10000315)                                              \
-  /* Vector Load Word into Two Half Words Odd Unsigned Indexed (zero- */       \
-  /* extended) */                                                              \
-  V(evlwhoux, EVLWHOUX, 0x10000314)                                            \
-  /* Vector Load Word into Two Half Words and Splat */                         \
-  V(evlwhsplat, EVLWHSPLAT, 0x1000031D)                                        \
-  /* Vector Load Word into Two Half Words and Splat Indexed */                 \
-  V(evlwhsplatx, EVLWHSPLATX, 0x1000031C)                                      \
-  /* Vector Load Word into Word and Splat */                                   \
-  V(evlwwsplat, EVLWWSPLAT, 0x10000319)                                        \
-  /* Vector Load Word into Word and Splat Indexed */                           \
-  V(evlwwsplatx, EVLWWSPLATX, 0x10000318)                                      \
-  /* Vector Merge High */                                                      \
-  V(evmergehi, EVMERGEHI, 0x1000022C)                                          \
-  /* Vector Merge High/Low */                                                  \
-  V(evmergehilo, EVMERGEHILO, 0x1000022E)                                      \
-  /* Vector Merge Low */                                                       \
-  V(evmergelo, EVMERGELO, 0x1000022D)                                          \
-  /* Vector Merge Low/High */                                                  \
-  V(evmergelohi, EVMERGELOHI, 0x1000022F)                                      \
-  /* Vector Multiply Half Words, Even, Guarded, Signed, Modulo, Fractional */  \
-  /* and Accumulate */                                                         \
-  V(evmhegsmfaa, EVMHEGSMFAA, 0x1000052B)                                      \
-  /* Vector Multiply Half Words, Even, Guarded, Signed, Modulo, Fractional */  \
-  /* and Accumulate Negative */                                                \
-  V(evmhegsmfan, EVMHEGSMFAN, 0x100005AB)                                      \
-  /* Vector Multiply Half Words, Even, Guarded, Signed, Modulo, Integer */     \
-  /* and Accumulate */                                                         \
-  V(evmhegsmiaa, EVMHEGSMIAA, 0x10000529)                                      \
-  /* Vector Multiply Half Words, Even, Guarded, Signed, Modulo, Integer */     \
-  /* and Accumulate Negative */                                                \
-  V(evmhegsmian, EVMHEGSMIAN, 0x100005A9)                                      \
-  /* Vector Multiply Half Words, Even, Guarded, Unsigned, Modulo, Integer */   \
-  /* and Accumulate */                                                         \
-  V(evmhegumiaa, EVMHEGUMIAA, 0x10000528)                                      \
-  /* Vector Multiply Half Words, Even, Guarded, Unsigned, Modulo, Integer */   \
-  /* and Accumulate Negative */                                                \
-  V(evmhegumian, EVMHEGUMIAN, 0x100005A8)                                      \
-  /* Vector Multiply Half Words, Even, Signed, Modulo, Fractional */           \
-  V(evmhesmf, EVMHESMF, 0x1000040B)                                            \
-  /* Vector Multiply Half Words, Even, Signed, Modulo, Fractional to */        \
-  /* Accumulator */                                                            \
-  V(evmhesmfa, EVMHESMFA, 0x1000042B)                                          \
-  /* Vector Multiply Half Words, Even, Signed, Modulo, Fractional and */       \
-  /* Accumulate into Words */                                                  \
-  V(evmhesmfaaw, EVMHESMFAAW, 0x1000050B)                                      \
-  /* Vector Multiply Half Words, Even, Signed, Modulo, Fractional and */       \
-  /* Accumulate Negative into Words */                                         \
-  V(evmhesmfanw, EVMHESMFANW, 0x1000058B)                                      \
-  /* Vector Multiply Half Words, Even, Signed, Modulo, Integer */              \
-  V(evmhesmi, EVMHESMI, 0x10000409)                                            \
-  /* Vector Multiply Half Words, Even, Signed, Modulo, Integer to */           \
-  /* Accumulator */                                                            \
-  V(evmhesmia, EVMHESMIA, 0x10000429)                                          \
-  /* Vector Multiply Half Words, Even, Signed, Modulo, Integer and */          \
-  /* Accumulate into Words */                                                  \
-  V(evmhesmiaaw, EVMHESMIAAW, 0x10000509)                                      \
-  /* Vector Multiply Half Words, Even, Signed, Modulo, Integer and */          \
-  /* Accumulate Negative into Words */                                         \
-  V(evmhesmianw, EVMHESMIANW, 0x10000589)                                      \
-  /* Vector Multiply Half Words, Even, Signed, Saturate, Fractional */         \
-  V(evmhessf, EVMHESSF, 0x10000403)                                            \
-  /* Vector Multiply Half Words, Even, Signed, Saturate, Fractional to */      \
-  /* Accumulator */                                                            \
-  V(evmhessfa, EVMHESSFA, 0x10000423)                                          \
-  /* Vector Multiply Half Words, Even, Signed, Saturate, Fractional and */     \
-  /* Accumulate into Words */                                                  \
-  V(evmhessfaaw, EVMHESSFAAW, 0x10000503)                                      \
-  /* Vector Multiply Half Words, Even, Signed, Saturate, Fractional and */     \
-  /* Accumulate Negative into Words */                                         \
-  V(evmhessfanw, EVMHESSFANW, 0x10000583)                                      \
-  /* Vector Multiply Half Words, Even, Signed, Saturate, Integer and */        \
-  /* Accumulate into Words */                                                  \
-  V(evmhessiaaw, EVMHESSIAAW, 0x10000501)                                      \
-  /* Vector Multiply Half Words, Even, Signed, Saturate, Integer and */        \
-  /* Accumulate Negative into Words */                                         \
-  V(evmhessianw, EVMHESSIANW, 0x10000581)                                      \
-  /* Vector Multiply Half Words, Even, Unsigned, Modulo, Integer */            \
-  V(evmheumi, EVMHEUMI, 0x10000408)                                            \
-  /* Vector Multiply Half Words, Even, Unsigned, Modulo, Integer to */         \
-  /* Accumulator */                                                            \
-  V(evmheumia, EVMHEUMIA, 0x10000428)                                          \
-  /* Vector Multiply Half Words, Even, Unsigned, Modulo, Integer and */        \
-  /* Accumulate into Words */                                                  \
-  V(evmheumiaaw, EVMHEUMIAAW, 0x10000508)                                      \
-  /* Vector Multiply Half Words, Even, Unsigned, Modulo, Integer and */        \
-  /* Accumulate Negative into Words */                                         \
-  V(evmheumianw, EVMHEUMIANW, 0x10000588)                                      \
-  /* Vector Multiply Half Words, Even, Unsigned, Saturate, Integer and */      \
-  /* Accumulate into Words */                                                  \
-  V(evmheusiaaw, EVMHEUSIAAW, 0x10000500)                                      \
-  /* Vector Multiply Half Words, Even, Unsigned, Saturate, Integer and */      \
-  /* Accumulate Negative into Words */                                         \
-  V(evmheusianw, EVMHEUSIANW, 0x10000580)                                      \
-  /* Vector Multiply Half Words, Odd, Guarded, Signed, Modulo, Fractional */   \
-  /* and Accumulate */                                                         \
-  V(evmhogsmfaa, EVMHOGSMFAA, 0x1000052F)                                      \
-  /* Vector Multiply Half Words, Odd, Guarded, Signed, Modulo, Fractional */   \
-  /* and Accumulate Negative */                                                \
-  V(evmhogsmfan, EVMHOGSMFAN, 0x100005AF)                                      \
-  /* Vector Multiply Half Words, Odd, Guarded, Signed, Modulo, Integer, */     \
-  /* and Accumulate */                                                         \
-  V(evmhogsmiaa, EVMHOGSMIAA, 0x1000052D)                                      \
-  /* Vector Multiply Half Words, Odd, Guarded, Signed, Modulo, Integer and */  \
-  /* Accumulate Negative */                                                    \
-  V(evmhogsmian, EVMHOGSMIAN, 0x100005AD)                                      \
-  /* Vector Multiply Half Words, Odd, Guarded, Unsigned, Modulo, Integer */    \
-  /* and Accumulate */                                                         \
-  V(evmhogumiaa, EVMHOGUMIAA, 0x1000052C)                                      \
-  /* Vector Multiply Half Words, Odd, Guarded, Unsigned, Modulo, Integer */    \
-  /* and Accumulate Negative */                                                \
-  V(evmhogumian, EVMHOGUMIAN, 0x100005AC)                                      \
-  /* Vector Multiply Half Words, Odd, Signed, Modulo, Fractional */            \
-  V(evmhosmf, EVMHOSMF, 0x1000040F)                                            \
-  /* Vector Multiply Half Words, Odd, Signed, Modulo, Fractional to */         \
-  /* Accumulator */                                                            \
-  V(evmhosmfa, EVMHOSMFA, 0x1000042F)                                          \
-  /* Vector Multiply Half Words, Odd, Signed, Modulo, Fractional and */        \
-  /* Accumulate into Words */                                                  \
-  V(evmhosmfaaw, EVMHOSMFAAW, 0x1000050F)                                      \
-  /* Vector Multiply Half Words, Odd, Signed, Modulo, Fractional and */        \
-  /* Accumulate Negative into Words */                                         \
-  V(evmhosmfanw, EVMHOSMFANW, 0x1000058F)                                      \
-  /* Vector Multiply Half Words, Odd, Signed, Modulo, Integer */               \
-  V(evmhosmi, EVMHOSMI, 0x1000040D)                                            \
-  /* Vector Multiply Half Words, Odd, Signed, Modulo, Integer to */            \
-  /* Accumulator */                                                            \
-  V(evmhosmia, EVMHOSMIA, 0x1000042D)                                          \
-  /* Vector Multiply Half Words, Odd, Signed, Modulo, Integer and */           \
-  /* Accumulate into Words */                                                  \
-  V(evmhosmiaaw, EVMHOSMIAAW, 0x1000050D)                                      \
-  /* Vector Multiply Half Words, Odd, Signed, Modulo, Integer and */           \
-  /* Accumulate Negative into Words */                                         \
-  V(evmhosmianw, EVMHOSMIANW, 0x1000058D)                                      \
-  /* Vector Multiply Half Words, Odd, Signed, Saturate, Fractional */          \
-  V(evmhossf, EVMHOSSF, 0x10000407)                                            \
-  /* Vector Multiply Half Words, Odd, Signed, Saturate, Fractional to */       \
-  /* Accumulator */                                                            \
-  V(evmhossfa, EVMHOSSFA, 0x10000427)                                          \
-  /* Vector Multiply Half Words, Odd, Signed, Saturate, Fractional and */      \
-  /* Accumulate into Words */                                                  \
-  V(evmhossfaaw, EVMHOSSFAAW, 0x10000507)                                      \
-  /* Vector Multiply Half Words, Odd, Signed, Saturate, Fractional and */      \
-  /* Accumulate Negative into Words */                                         \
-  V(evmhossfanw, EVMHOSSFANW, 0x10000587)                                      \
-  /* Vector Multiply Half Words, Odd, Signed, Saturate, Integer and */         \
-  /* Accumulate into Words */                                                  \
-  V(evmhossiaaw, EVMHOSSIAAW, 0x10000505)                                      \
-  /* Vector Multiply Half Words, Odd, Signed, Saturate, Integer and */         \
-  /* Accumulate Negative into Words */                                         \
-  V(evmhossianw, EVMHOSSIANW, 0x10000585)                                      \
-  /* Vector Multiply Half Words, Odd, Unsigned, Modulo, Integer */             \
-  V(evmhoumi, EVMHOUMI, 0x1000040C)                                            \
-  /* Vector Multiply Half Words, Odd, Unsigned, Modulo, Integer to */          \
-  /* Accumulator */                                                            \
-  V(evmhoumia, EVMHOUMIA, 0x1000042C)                                          \
-  /* Vector Multiply Half Words, Odd, Unsigned, Modulo, Integer and */         \
-  /* Accumulate into Words */                                                  \
-  V(evmhoumiaaw, EVMHOUMIAAW, 0x1000050C)                                      \
-  /* Vector Multiply Half Words, Odd, Unsigned, Modulo, Integer and */         \
-  /* Accumulate Negative into Words */                                         \
-  V(evmhoumianw, EVMHOUMIANW, 0x1000058C)                                      \
-  /* Vector Multiply Half Words, Odd, Unsigned, Saturate, Integer and */       \
-  /* Accumulate into Words */                                                  \
-  V(evmhousiaaw, EVMHOUSIAAW, 0x10000504)                                      \
-  /* Vector Multiply Half Words, Odd, Unsigned, Saturate, Integer and */       \
-  /* Accumulate Negative into Words */                                         \
-  V(evmhousianw, EVMHOUSIANW, 0x10000584)                                      \
-  /* Initialize Accumulator */                                                 \
-  V(evmra, EVMRA, 0x100004C4)                                                  \
-  /* Vector Multiply Word High Signed, Modulo, Fractional */                   \
-  V(evmwhsmf, EVMWHSMF, 0x1000044F)                                            \
-  /* Vector Multiply Word High Signed, Modulo, Fractional to Accumulator */    \
-  V(evmwhsmfa, EVMWHSMFA, 0x1000046F)                                          \
-  /* Vector Multiply Word High Signed, Modulo, Integer */                      \
-  V(evmwhsmi, EVMWHSMI, 0x1000044D)                                            \
-  /* Vector Multiply Word High Signed, Modulo, Integer to Accumulator */       \
-  V(evmwhsmia, EVMWHSMIA, 0x1000046D)                                          \
-  /* Vector Multiply Word High Signed, Saturate, Fractional */                 \
-  V(evmwhssf, EVMWHSSF, 0x10000447)                                            \
-  /* Vector Multiply Word High Signed, Saturate, Fractional to Accumulator */  \
-  V(evmwhssfa, EVMWHSSFA, 0x10000467)                                          \
-  /* Vector Multiply Word High Unsigned, Modulo, Integer */                    \
-  V(evmwhumi, EVMWHUMI, 0x1000044C)                                            \
-  /* Vector Multiply Word High Unsigned, Modulo, Integer to Accumulator */     \
-  V(evmwhumia, EVMWHUMIA, 0x1000046C)                                          \
-  /* Vector Multiply Word Low Signed, Modulo, Integer and Accumulate in */     \
-  /* Words */                                                                  \
-  V(evmwlsmiaaw, EVMWLSMIAAW, 0x10000549)                                      \
-  /* Vector Multiply Word Low Signed, Modulo, Integer and Accumulate */        \
-  /* Negative in Words */                                                      \
-  V(evmwlsmianw, EVMWLSMIANW, 0x100005C9)                                      \
-  /* Vector Multiply Word Low Signed, Saturate, Integer and Accumulate in */   \
-  /* Words */                                                                  \
-  V(evmwlssiaaw, EVMWLSSIAAW, 0x10000541)                                      \
-  /* Vector Multiply Word Low Signed, Saturate, Integer and Accumulate */      \
-  /* Negative in Words */                                                      \
-  V(evmwlssianw, EVMWLSSIANW, 0x100005C1)                                      \
-  /* Vector Multiply Word Low Unsigned, Modulo, Integer */                     \
-  V(evmwlumi, EVMWLUMI, 0x10000448)                                            \
-  /* Vector Multiply Word Low Unsigned, Modulo, Integer to Accumulator */      \
-  V(evmwlumia, EVMWLUMIA, 0x10000468)                                          \
-  /* Vector Multiply Word Low Unsigned, Modulo, Integer and Accumulate in */   \
-  /* Words */                                                                  \
-  V(evmwlumiaaw, EVMWLUMIAAW, 0x10000548)                                      \
-  /* Vector Multiply Word Low Unsigned, Modulo, Integer and Accumulate */      \
-  /* Negative in Words */                                                      \
-  V(evmwlumianw, EVMWLUMIANW, 0x100005C8)                                      \
-  /* Vector Multiply Word Low Unsigned, Saturate, Integer and Accumulate */    \
-  /* in Words */                                                               \
-  V(evmwlusiaaw, EVMWLUSIAAW, 0x10000540)                                      \
-  /* Vector Multiply Word Low Unsigned, Saturate, Integer and Accumulate */    \
-  /* Negative in Words */                                                      \
-  V(evmwlusianw, EVMWLUSIANW, 0x100005C0)                                      \
-  /* Vector Multiply Word Signed, Modulo, Fractional */                        \
-  V(evmwsmf, EVMWSMF, 0x1000045B)                                              \
-  /* Vector Multiply Word Signed, Modulo, Fractional to Accumulator */         \
-  V(evmwsmfa, EVMWSMFA, 0x1000047B)                                            \
-  /* Vector Multiply Word Signed, Modulo, Fractional and Accumulate */         \
-  V(evmwsmfaa, EVMWSMFAA, 0x1000055B)                                          \
-  /* Vector Multiply Word Signed, Modulo, Fractional and Accumulate */         \
-  /* Negative */                                                               \
-  V(evmwsmfan, EVMWSMFAN, 0x100005DB)                                          \
-  /* Vector Multiply Word Signed, Modulo, Integer */                           \
-  V(evmwsmi, EVMWSMI, 0x10000459)                                              \
-  /* Vector Multiply Word Signed, Modulo, Integer to Accumulator */            \
-  V(evmwsmia, EVMWSMIA, 0x10000479)                                            \
-  /* Vector Multiply Word Signed, Modulo, Integer and Accumulate */            \
-  V(evmwsmiaa, EVMWSMIAA, 0x10000559)                                          \
-  /* Vector Multiply Word Signed, Modulo, Integer and Accumulate Negative */   \
-  V(evmwsmian, EVMWSMIAN, 0x100005D9)                                          \
-  /* Vector Multiply Word Signed, Saturate, Fractional */                      \
-  V(evmwssf, EVMWSSF, 0x10000453)                                              \
-  /* Vector Multiply Word Signed, Saturate, Fractional to Accumulator */       \
-  V(evmwssfa, EVMWSSFA, 0x10000473)                                            \
-  /* Vector Multiply Word Signed, Saturate, Fractional and Accumulate */       \
-  V(evmwssfaa, EVMWSSFAA, 0x10000553)                                          \
-  /* Vector Multiply Word Signed, Saturate, Fractional and Accumulate */       \
-  /* Negative */                                                               \
-  V(evmwssfan, EVMWSSFAN, 0x100005D3)                                          \
-  /* Vector Multiply Word Unsigned, Modulo, Integer */                         \
-  V(evmwumi, EVMWUMI, 0x10000458)                                              \
-  /* Vector Multiply Word Unsigned, Modulo, Integer to Accumulator */          \
-  V(evmwumia, EVMWUMIA, 0x10000478)                                            \
-  /* Vector Multiply Word Unsigned, Modulo, Integer and Accumulate */          \
-  V(evmwumiaa, EVMWUMIAA, 0x10000558)                                          \
-  /* Vector Multiply Word Unsigned, Modulo, Integer and Accumulate */          \
-  /* Negative */                                                               \
-  V(evmwumian, EVMWUMIAN, 0x100005D8)                                          \
-  /* Vector NAND */                                                            \
-  V(evnand, EVNAND, 0x1000021E)                                                \
-  /* Vector Negate */                                                          \
-  V(evneg, EVNEG, 0x10000209)                                                  \
-  /* Vector NOR */                                                             \
-  V(evnor, EVNOR, 0x10000218)                                                  \
-  /* Vector OR */                                                              \
-  V(evor, EVOR, 0x10000217)                                                    \
-  /* Vector OR with Complement */                                              \
-  V(evorc, EVORC, 0x1000021B)                                                  \
-  /* Vector Rotate Left Word */                                                \
-  V(evrlw, EVRLW, 0x10000228)                                                  \
-  /* Vector Rotate Left Word Immediate */                                      \
-  V(evrlwi, EVRLWI, 0x1000022A)                                                \
-  /* Vector Round Word */                                                      \
-  V(evrndw, EVRNDW, 0x1000020C)                                                \
-  /* Vector Shift Left Word */                                                 \
-  V(evslw, EVSLW, 0x10000224)                                                  \
-  /* Vector Shift Left Word Immediate */                                       \
-  V(evslwi, EVSLWI, 0x10000226)                                                \
-  /* Vector Splat Fractional Immediate */                                      \
-  V(evsplatfi, EVSPLATFI, 0x1000022B)                                          \
-  /* Vector Splat Immediate */                                                 \
-  V(evsplati, EVSPLATI, 0x10000229)                                            \
-  /* Vector Shift Right Word Immediate Signed */                               \
-  V(evsrwis, EVSRWIS, 0x10000223)                                              \
-  /* Vector Shift Right Word Immediate Unsigned */                             \
-  V(evsrwiu, EVSRWIU, 0x10000222)                                              \
-  /* Vector Shift Right Word Signed */                                         \
-  V(evsrws, EVSRWS, 0x10000221)                                                \
-  /* Vector Shift Right Word Unsigned */                                       \
-  V(evsrwu, EVSRWU, 0x10000220)                                                \
-  /* Vector Store Double of Double */                                          \
-  V(evstdd, EVSTDD, 0x10000321)                                                \
-  /* Vector Store Double of Double Indexed */                                  \
-  V(evstddx, EVSTDDX, 0x10000320)                                              \
-  /* Vector Store Double of Four Half Words */                                 \
-  V(evstdh, EVSTDH, 0x10000325)                                                \
-  /* Vector Store Double of Four Half Words Indexed */                         \
-  V(evstdhx, EVSTDHX, 0x10000324)                                              \
-  /* Vector Store Double of Two Words */                                       \
-  V(evstdw, EVSTDW, 0x10000323)                                                \
-  /* Vector Store Double of Two Words Indexed */                               \
-  V(evstdwx, EVSTDWX, 0x10000322)                                              \
-  /* Vector Store Word of Two Half Words from Even */                          \
-  V(evstwhe, EVSTWHE, 0x10000331)                                              \
-  /* Vector Store Word of Two Half Words from Even Indexed */                  \
-  V(evstwhex, EVSTWHEX, 0x10000330)                                            \
-  /* Vector Store Word of Two Half Words from Odd */                           \
-  V(evstwho, EVSTWHO, 0x10000335)                                              \
-  /* Vector Store Word of Two Half Words from Odd Indexed */                   \
-  V(evstwhox, EVSTWHOX, 0x10000334)                                            \
-  /* Vector Store Word of Word from Even */                                    \
-  V(evstwwe, EVSTWWE, 0x10000339)                                              \
-  /* Vector Store Word of Word from Even Indexed */                            \
-  V(evstwwex, EVSTWWEX, 0x10000338)                                            \
-  /* Vector Store Word of Word from Odd */                                     \
-  V(evstwwo, EVSTWWO, 0x1000033D)                                              \
-  /* Vector Store Word of Word from Odd Indexed */                             \
-  V(evstwwox, EVSTWWOX, 0x1000033C)                                            \
-  /* Vector Subtract Signed, Modulo, Integer to Accumulator Word */            \
-  V(evsubfsmiaaw, EVSUBFSMIAAW, 0x100004CB)                                    \
-  /* Vector Subtract Signed, Saturate, Integer to Accumulator Word */          \
-  V(evsubfssiaaw, EVSUBFSSIAAW, 0x100004C3)                                    \
-  /* Vector Subtract Unsigned, Modulo, Integer to Accumulator Word */          \
-  V(evsubfumiaaw, EVSUBFUMIAAW, 0x100004CA)                                    \
-  /* Vector Subtract Unsigned, Saturate, Integer to Accumulator Word */        \
-  V(evsubfusiaaw, EVSUBFUSIAAW, 0x100004C2)                                    \
-  /* Vector Subtract from Word */                                              \
-  V(evsubfw, EVSUBFW, 0x10000204)                                              \
-  /* Vector Subtract Immediate from Word */                                    \
-  V(evsubifw, EVSUBIFW, 0x10000206)                                            \
-  /* Vector XOR */                                                             \
-  V(evxor, EVXOR, 0x10000216)                                                  \
-  /* Floating-Point Double-Precision Absolute Value */                         \
-  V(efdabs, EFDABS, 0x100002E4)                                                \
-  /* Floating-Point Double-Precision Add */                                    \
-  V(efdadd, EFDADD, 0x100002E0)                                                \
-  /* Floating-Point Double-Precision Convert from Single-Precision */          \
-  V(efdcfs, EFDCFS, 0x100002EF)                                                \
-  /* Convert Floating-Point Double-Precision from Signed Fraction */           \
-  V(efdcfsf, EFDCFSF, 0x100002F3)                                              \
-  /* Convert Floating-Point Double-Precision from Signed Integer */            \
-  V(efdcfsi, EFDCFSI, 0x100002F1)                                              \
-  /* Convert Floating-Point Double-Precision from Signed Integer */            \
-  /* Doubleword */                                                             \
-  V(efdcfsid, EFDCFSID, 0x100002E3)                                            \
-  /* Convert Floating-Point Double-Precision from Unsigned Fraction */         \
-  V(efdcfuf, EFDCFUF, 0x100002F2)                                              \
-  /* Convert Floating-Point Double-Precision from Unsigned Integer */          \
-  V(efdcfui, EFDCFUI, 0x100002F0)                                              \
-  /* Convert Floating-Point Double-Precision fromUnsigned Integer */           \
-  /* Doubleword */                                                             \
-  V(efdcfuid, EFDCFUID, 0x100002E2)                                            \
-  /* Floating-Point Double-Precision Compare Equal */                          \
-  V(efdcmpeq, EFDCMPEQ, 0x100002EE)                                            \
-  /* Floating-Point Double-Precision Compare Greater Than */                   \
-  V(efdcmpgt, EFDCMPGT, 0x100002EC)                                            \
-  /* Floating-Point Double-Precision Compare Less Than */                      \
-  V(efdcmplt, EFDCMPLT, 0x100002ED)                                            \
-  /* Convert Floating-Point Double-Precision to Signed Fraction */             \
-  V(efdctsf, EFDCTSF, 0x100002F7)                                              \
-  /* Convert Floating-Point Double-Precision to Signed Integer */              \
-  V(efdctsi, EFDCTSI, 0x100002F5)                                              \
-  /* Convert Floating-Point Double-Precision to Signed Integer Doubleword */   \
-  /* with Round toward Zero */                                                 \
-  V(efdctsidz, EFDCTSIDZ, 0x100002EB)                                          \
-  /* Convert Floating-Point Double-Precision to Signed Integer with Round */   \
-  /* toward Zero */                                                            \
-  V(efdctsiz, EFDCTSIZ, 0x100002FA)                                            \
-  /* Convert Floating-Point Double-Precision to Unsigned Fraction */           \
-  V(efdctuf, EFDCTUF, 0x100002F6)                                              \
-  /* Convert Floating-Point Double-Precision to Unsigned Integer */            \
-  V(efdctui, EFDCTUI, 0x100002F4)                                              \
-  /* Convert Floating-Point Double-Precision to Unsigned Integer */            \
-  /* Doubleword with Round toward Zero */                                      \
-  V(efdctuidz, EFDCTUIDZ, 0x100002EA)                                          \
-  /* Convert Floating-Point Double-Precision to Unsigned Integer with */       \
-  /* Round toward Zero */                                                      \
-  V(efdctuiz, EFDCTUIZ, 0x100002F8)                                            \
-  /* Floating-Point Double-Precision Divide */                                 \
-  V(efddiv, EFDDIV, 0x100002E9)                                                \
-  /* Floating-Point Double-Precision Multiply */                               \
-  V(efdmul, EFDMUL, 0x100002E8)                                                \
-  /* Floating-Point Double-Precision Negative Absolute Value */                \
-  V(efdnabs, EFDNABS, 0x100002E5)                                              \
-  /* Floating-Point Double-Precision Negate */                                 \
-  V(efdneg, EFDNEG, 0x100002E6)                                                \
-  /* Floating-Point Double-Precision Subtract */                               \
-  V(efdsub, EFDSUB, 0x100002E1)                                                \
-  /* Floating-Point Double-Precision Test Equal */                             \
-  V(efdtsteq, EFDTSTEQ, 0x100002FE)                                            \
-  /* Floating-Point Double-Precision Test Greater Than */                      \
-  V(efdtstgt, EFDTSTGT, 0x100002FC)                                            \
-  /* Floating-Point Double-Precision Test Less Than */                         \
-  V(efdtstlt, EFDTSTLT, 0x100002FD)                                            \
-  /* Floating-Point Single-Precision Convert from Double-Precision */          \
-  V(efscfd, EFSCFD, 0x100002CF)                                                \
-  /* Floating-Point Absolute Value */                                          \
-  V(efsabs, EFSABS, 0x100002C4)                                                \
-  /* Floating-Point Add */                                                     \
-  V(efsadd, EFSADD, 0x100002C0)                                                \
-  /* Convert Floating-Point from Signed Fraction */                            \
-  V(efscfsf, EFSCFSF, 0x100002D3)                                              \
-  /* Convert Floating-Point from Signed Integer */                             \
-  V(efscfsi, EFSCFSI, 0x100002D1)                                              \
-  /* Convert Floating-Point from Unsigned Fraction */                          \
-  V(efscfuf, EFSCFUF, 0x100002D2)                                              \
-  /* Convert Floating-Point from Unsigned Integer */                           \
-  V(efscfui, EFSCFUI, 0x100002D0)                                              \
-  /* Floating-Point Compare Equal */                                           \
-  V(efscmpeq, EFSCMPEQ, 0x100002CE)                                            \
-  /* Floating-Point Compare Greater Than */                                    \
-  V(efscmpgt, EFSCMPGT, 0x100002CC)                                            \
-  /* Floating-Point Compare Less Than */                                       \
-  V(efscmplt, EFSCMPLT, 0x100002CD)                                            \
-  /* Convert Floating-Point to Signed Fraction */                              \
-  V(efsctsf, EFSCTSF, 0x100002D7)                                              \
-  /* Convert Floating-Point to Signed Integer */                               \
-  V(efsctsi, EFSCTSI, 0x100002D5)                                              \
-  /* Convert Floating-Point to Signed Integer with Round toward Zero */        \
-  V(efsctsiz, EFSCTSIZ, 0x100002DA)                                            \
-  /* Convert Floating-Point to Unsigned Fraction */                            \
-  V(efsctuf, EFSCTUF, 0x100002D6)                                              \
-  /* Convert Floating-Point to Unsigned Integer */                             \
-  V(efsctui, EFSCTUI, 0x100002D4)                                              \
-  /* Convert Floating-Point to Unsigned Integer with Round toward Zero */      \
-  V(efsctuiz, EFSCTUIZ, 0x100002D8)                                            \
-  /* Floating-Point Divide */                                                  \
-  V(efsdiv, EFSDIV, 0x100002C9)                                                \
-  /* Floating-Point Multiply */                                                \
-  V(efsmul, EFSMUL, 0x100002C8)                                                \
-  /* Floating-Point Negative Absolute Value */                                 \
-  V(efsnabs, EFSNABS, 0x100002C5)                                              \
-  /* Floating-Point Negate */                                                  \
-  V(efsneg, EFSNEG, 0x100002C6)                                                \
-  /* Floating-Point Subtract */                                                \
-  V(efssub, EFSSUB, 0x100002C1)                                                \
-  /* Floating-Point Test Equal */                                              \
-  V(efststeq, EFSTSTEQ, 0x100002DE)                                            \
-  /* Floating-Point Test Greater Than */                                       \
-  V(efststgt, EFSTSTGT, 0x100002DC)                                            \
-  /* Floating-Point Test Less Than */                                          \
-  V(efststlt, EFSTSTLT, 0x100002DD)                                            \
-  /* Vector Floating-Point Absolute Value */                                   \
-  V(evfsabs, EVFSABS, 0x10000284)                                              \
-  /* Vector Floating-Point Add */                                              \
-  V(evfsadd, EVFSADD, 0x10000280)                                              \
-  /* Vector Convert Floating-Point from Signed Fraction */                     \
-  V(evfscfsf, EVFSCFSF, 0x10000293)                                            \
-  /* Vector Convert Floating-Point from Signed Integer */                      \
-  V(evfscfsi, EVFSCFSI, 0x10000291)                                            \
-  /* Vector Convert Floating-Point from Unsigned Fraction */                   \
-  V(evfscfuf, EVFSCFUF, 0x10000292)                                            \
-  /* Vector Convert Floating-Point from Unsigned Integer */                    \
-  V(evfscfui, EVFSCFUI, 0x10000290)                                            \
-  /* Vector Floating-Point Compare Equal */                                    \
-  V(evfscmpeq, EVFSCMPEQ, 0x1000028E)                                          \
-  /* Vector Floating-Point Compare Greater Than */                             \
-  V(evfscmpgt, EVFSCMPGT, 0x1000028C)                                          \
-  /* Vector Floating-Point Compare Less Than */                                \
-  V(evfscmplt, EVFSCMPLT, 0x1000028D)                                          \
-  /* Vector Convert Floating-Point to Signed Fraction */                       \
-  V(evfsctsf, EVFSCTSF, 0x10000297)                                            \
-  /* Vector Convert Floating-Point to Signed Integer */                        \
-  V(evfsctsi, EVFSCTSI, 0x10000295)                                            \
-  /* Vector Convert Floating-Point to Signed Integer with Round toward */      \
-  /* Zero */                                                                   \
-  V(evfsctsiz, EVFSCTSIZ, 0x1000029A)                                          \
-  /* Vector Convert Floating-Point to Unsigned Fraction */                     \
-  V(evfsctuf, EVFSCTUF, 0x10000296)                                            \
-  /* Vector Convert Floating-Point to Unsigned Integer */                      \
-  V(evfsctui, EVFSCTUI, 0x10000294)                                            \
-  /* Vector Convert Floating-Point to Unsigned Integer with Round toward */    \
-  /* Zero */                                                                   \
-  V(evfsctuiz, EVFSCTUIZ, 0x10000298)                                          \
-  /* Vector Floating-Point Divide */                                           \
-  V(evfsdiv, EVFSDIV, 0x10000289)                                              \
-  /* Vector Floating-Point Multiply */                                         \
-  V(evfsmul, EVFSMUL, 0x10000288)                                              \
-  /* Vector Floating-Point Negative Absolute Value */                          \
-  V(evfsnabs, EVFSNABS, 0x10000285)                                            \
-  /* Vector Floating-Point Negate */                                           \
-  V(evfsneg, EVFSNEG, 0x10000286)                                              \
-  /* Vector Floating-Point Subtract */                                         \
-  V(evfssub, EVFSSUB, 0x10000281)                                              \
-  /* Vector Floating-Point Test Equal */                                       \
-  V(evfststeq, EVFSTSTEQ, 0x1000029E)                                          \
-  /* Vector Floating-Point Test Greater Than */                                \
-  V(evfststgt, EVFSTSTGT, 0x1000029C)                                          \
-  /* Vector Floating-Point Test Less Than */                                   \
-  V(evfststlt, EVFSTSTLT, 0x1000029D)
-
-#define PPC_VC_OPCODE_LIST(V)                                                  \
-  /* Vector Compare Bounds Single-Precision */                                 \
-  V(vcmpbfp, VCMPBFP, 0x100003C6)                                              \
-  /* Vector Compare Equal To Single-Precision */                               \
-  V(vcmpeqfp, VCMPEQFP, 0x100000C6)                                            \
-  /* Vector Compare Equal To Unsigned Byte */                                  \
-  V(vcmpequb, VCMPEQUB, 0x10000006)                                            \
-  /* Vector Compare Equal To Unsigned Doubleword */                            \
-  V(vcmpequd, VCMPEQUD, 0x100000C7)                                            \
-  /* Vector Compare Equal To Unsigned Halfword */                              \
-  V(vcmpequh, VCMPEQUH, 0x10000046)                                            \
-  /* Vector Compare Equal To Unsigned Word */                                  \
-  V(vcmpequw, VCMPEQUW, 0x10000086)                                            \
-  /* Vector Compare Greater Than or Equal To Single-Precision */               \
-  V(vcmpgefp, VCMPGEFP, 0x100001C6)                                            \
-  /* Vector Compare Greater Than Single-Precision */                           \
-  V(vcmpgtfp, VCMPGTFP, 0x100002C6)                                            \
-  /* Vector Compare Greater Than Signed Byte */                                \
-  V(vcmpgtsb, VCMPGTSB, 0x10000306)                                            \
-  /* Vector Compare Greater Than Signed Doubleword */                          \
-  V(vcmpgtsd, VCMPGTSD, 0x100003C7)                                            \
-  /* Vector Compare Greater Than Signed Halfword */                            \
-  V(vcmpgtsh, VCMPGTSH, 0x10000346)                                            \
-  /* Vector Compare Greater Than Signed Word */                                \
-  V(vcmpgtsw, VCMPGTSW, 0x10000386)                                            \
-  /* Vector Compare Greater Than Unsigned Byte */                              \
-  V(vcmpgtub, VCMPGTUB, 0x10000206)                                            \
-  /* Vector Compare Greater Than Unsigned Doubleword */                        \
-  V(vcmpgtud, VCMPGTUD, 0x100002C7)                                            \
-  /* Vector Compare Greater Than Unsigned Halfword */                          \
-  V(vcmpgtuh, VCMPGTUH, 0x10000246)                                            \
-  /* Vector Compare Greater Than Unsigned Word */                              \
-  V(vcmpgtuw, VCMPGTUW, 0x10000286)
-
-#define PPC_X_OPCODE_A_FORM_LIST(V) \
-  /* Modulo Signed Dword */         \
-  V(modsd, MODSD, 0x7C000612)       \
-  /*  Modulo Unsigned Dword */      \
-  V(modud, MODUD, 0x7C000212)       \
-  /* Modulo Signed Word */          \
-  V(modsw, MODSW, 0x7C000616)       \
-  /* Modulo Unsigned Word */        \
-  V(moduw, MODUW, 0x7C000216)
-
-#define PPC_X_OPCODE_B_FORM_LIST(V)      \
-  /* XOR */                              \
-  V(xor_, XORX, 0x7C000278)              \
-  /* AND */                              \
-  V(and_, ANDX, 0x7C000038)              \
-  /* AND with Complement */              \
-  V(andc, ANDCX, 0x7C000078)             \
-  /* OR */                               \
-  V(orx, ORX, 0x7C000378)                \
-  /* OR with Complement */               \
-  V(orc, ORC, 0x7C000338)                \
-  /* NOR */                              \
-  V(nor, NORX, 0x7C0000F8)               \
-  /* Shift Right Word */                 \
-  V(srw, SRWX, 0x7C000430)               \
-  /* Shift Left Word */                  \
-  V(slw, SLWX, 0x7C000030)               \
-  /* Shift Right Algebraic Word */       \
-  V(sraw, SRAW, 0x7C000630)              \
-  /* Shift Left Doubleword */            \
-  V(sld, SLDX, 0x7C000036)               \
-  /* Shift Right Algebraic Doubleword */ \
-  V(srad, SRAD, 0x7C000634)              \
-  /* Shift Right Doubleword */           \
-  V(srd, SRDX, 0x7C000436)
-
-#define PPC_X_OPCODE_C_FORM_LIST(V)    \
-  /* Count Leading Zeros Word */       \
-  V(cntlzw, CNTLZWX, 0x7C000034)       \
-  /* Count Leading Zeros Doubleword */ \
-  V(cntlzd, CNTLZDX, 0x7C000074)       \
-  /* Population Count Byte-wise */     \
-  V(popcntb, POPCNTB, 0x7C0000F4)      \
-  /* Population Count Words */         \
-  V(popcntw, POPCNTW, 0x7C0002F4)      \
-  /* Population Count Doubleword */    \
-  V(popcntd, POPCNTD, 0x7C0003F4)      \
-  /* Extend Sign Byte */               \
-  V(extsb, EXTSB, 0x7C000774)          \
-  /* Extend Sign Halfword */           \
-  V(extsh, EXTSH, 0x7C000734)
-
-#define PPC_X_OPCODE_D_FORM_LIST(V)                     \
-  /* Load Halfword Byte-Reverse Indexed */              \
-  V(lhbrx, LHBRX, 0x7C00062C)                           \
-  /* Load Word Byte-Reverse Indexed */                  \
-  V(lwbrx, LWBRX, 0x7C00042C)                           \
-  /* Load Doubleword Byte-Reverse Indexed */            \
-  V(ldbrx, LDBRX, 0x7C000428)                           \
-  /* Load Byte and Zero Indexed */                      \
-  V(lbzx, LBZX, 0x7C0000AE)                             \
-  /* Load Byte and Zero with Update Indexed */          \
-  V(lbzux, LBZUX, 0x7C0000EE)                           \
-  /* Load Halfword and Zero Indexed */                  \
-  V(lhzx, LHZX, 0x7C00022E)                             \
-  /* Load Halfword and Zero with Update Indexed */      \
-  V(lhzux, LHZUX, 0x7C00026E)                           \
-  /* Load Halfword Algebraic Indexed */                 \
-  V(lhax, LHAX, 0x7C0002AE)                             \
-  /* Load Word and Zero Indexed */                      \
-  V(lwzx, LWZX, 0x7C00002E)                             \
-  /* Load Word and Zero with Update Indexed */          \
-  V(lwzux, LWZUX, 0x7C00006E)                           \
-  /* Load Doubleword Indexed */                         \
-  V(ldx, LDX, 0x7C00002A)                               \
-  /* Load Doubleword with Update Indexed */             \
-  V(ldux, LDUX, 0x7C00006A)                             \
-  /* Load Floating-Point Double Indexed */              \
-  V(lfdx, LFDX, 0x7C0004AE)                             \
-  /* Load Floating-Point Single Indexed */              \
-  V(lfsx, LFSX, 0x7C00042E)                             \
-  /* Load Floating-Point Double with Update Indexed */  \
-  V(lfdux, LFDUX, 0x7C0004EE)                           \
-  /* Load Floating-Point Single with Update Indexed */  \
-  V(lfsux, LFSUX, 0x7C00046E)                           \
-  /* Store Byte with Update Indexed */                  \
-  V(stbux, STBUX, 0x7C0001EE)                           \
-  /* Store Byte Indexed */                              \
-  V(stbx, STBX, 0x7C0001AE)                             \
-  /* Store Halfword with Update Indexed */              \
-  V(sthux, STHUX, 0x7C00036E)                           \
-  /* Store Halfword Indexed */                          \
-  V(sthx, STHX, 0x7C00032E)                             \
-  /* Store Word with Update Indexed */                  \
-  V(stwux, STWUX, 0x7C00016E)                           \
-  /* Store Word Indexed */                              \
-  V(stwx, STWX, 0x7C00012E)                             \
-  /* Store Doubleword with Update Indexed */            \
-  V(stdux, STDUX, 0x7C00016A)                           \
-  /* Store Doubleword Indexed */                        \
-  V(stdx, STDX, 0x7C00012A)                             \
-  /* Store Floating-Point Double with Update Indexed */ \
-  V(stfdux, STFDUX, 0x7C0005EE)                         \
-  /* Store Floating-Point Double Indexed */             \
-  V(stfdx, STFDX, 0x7C0005AE)                           \
-  /* Store Floating-Point Single with Update Indexed */ \
-  V(stfsux, STFSUX, 0x7C00056E)                         \
-  /* Store Floating-Point Single Indexed */             \
-  V(stfsx, STFSX, 0x7C00052E)
-
-#define PPC_X_OPCODE_E_FORM_LIST(V)          \
-  /* Shift Right Algebraic Word Immediate */ \
-  V(srawi, SRAWIX, 0x7C000670)
-
-#define PPC_X_OPCODE_F_FORM_LIST(V) \
-  /* Compare */                     \
-  V(cmp, CMP, 0x7C000000)           \
-  /* Compare Logical */             \
-  V(cmpl, CMPL, 0x7C000040)
-
-#define PPC_X_OPCODE_EH_S_FORM_LIST(V)              \
-  /* Store Byte Conditional Indexed */              \
-  V(stbcx, STBCX, 0x7C00056D)                       \
-  /* Store Halfword Conditional Indexed Xform */    \
-  V(sthcx, STHCX, 0x7C0005AD)                       \
-  /* Store Word Conditional Indexed & record CR0 */ \
-  V(stwcx, STWCX, 0x7C00012D)
-
-#define PPC_X_OPCODE_EH_L_FORM_LIST(V)          \
-  /* Load Byte And Reserve Indexed */           \
-  V(lbarx, LBARX, 0x7C000068)                   \
-  /* Load Halfword And Reserve Indexed Xform */ \
-  V(lharx, LHARX, 0x7C0000E8)                   \
-  /* Load Word and Reserve Indexed */           \
-  V(lwarx, LWARX, 0x7C000028)
-
-#define PPC_X_OPCODE_UNUSED_LIST(V)                                            \
-  /* Bit Permute Doubleword */                                                 \
-  V(bpermd, BPERMD, 0x7C0001F8)                                                \
-  /* Extend Sign Word */                                                       \
-  V(extsw, EXTSW, 0x7C0007B4)                                                  \
-  /* Load Doubleword And Reserve Indexed */                                    \
-  V(ldarx, LDARX, 0x7C0000A8)                                                  \
-  /* Load Word Algebraic with Update Indexed */                                \
-  V(lwaux, LWAUX, 0x7C0002EA)                                                  \
-  /* Load Word Algebraic Indexed */                                            \
-  V(lwax, LWAX, 0x7C0002AA)                                                    \
-  /* Parity Doubleword */                                                      \
-  V(prtyd, PRTYD, 0x7C000174)                                                  \
-  /* Store Doubleword Byte-Reverse Indexed */                                  \
-  V(stdbrx, STDBRX, 0x7C000528)                                                \
-  /* Store Doubleword Conditional Indexed & record CR0 */                      \
-  V(stdcx, STDCX, 0x7C0001AD)                                                  \
-  /* Trap Doubleword */                                                        \
-  V(td, TD, 0x7C000088)                                                        \
-  /* Branch Conditional to Branch Target Address Register */                   \
-  V(bctar, BCTAR, 0x4C000460)                                                  \
-  /* Compare Byte */                                                           \
-  V(cmpb, CMPB, 0x7C0003F8)                                                    \
-  /* Data Cache Block Flush */                                                 \
-  V(dcbf, DCBF, 0x7C0000AC)                                                    \
-  /* Data Cache Block Store */                                                 \
-  V(dcbst, DCBST, 0x7C00006C)                                                  \
-  /* Data Cache Block Touch */                                                 \
-  V(dcbt, DCBT, 0x7C00022C)                                                    \
-  /* Data Cache Block Touch for Store */                                       \
-  V(dcbtst, DCBTST, 0x7C0001EC)                                                \
-  /* Data Cache Block Zero */                                                  \
-  V(dcbz, DCBZ, 0x7C0007EC)                                                    \
-  /* Equivalent */                                                             \
-  V(eqv, EQV, 0x7C000238)                                                      \
-  /* Instruction Cache Block Invalidate */                                     \
-  V(icbi, ICBI, 0x7C0007AC)                                                    \
-  /* NAND */                                                                   \
-  V(nand, NAND, 0x7C0003B8)                                                    \
-  /* Parity Word */                                                            \
-  V(prtyw, PRTYW, 0x7C000134)                                                  \
-  /* Store Halfword Byte-Reverse Indexed */                                    \
-  V(sthbrx, STHBRX, 0x7C00072C)                                                \
-  /* Store Word Byte-Reverse Indexed */                                        \
-  V(stwbrx, STWBRX, 0x7C00052C)                                                \
-  /* Synchronize */                                                            \
-  V(sync, SYNC, 0x7C0004AC)                                                    \
-  /* Trap Word */                                                              \
-  V(tw, TW, 0x7C000008)                                                        \
-  /* ExecuExecuted No Operation */                                             \
-  V(xnop, XNOP, 0x68000000)                                                    \
-  /* Convert Binary Coded Decimal To Declets */                                \
-  V(cbcdtd, CBCDTD, 0x7C000274)                                                \
-  /* Convert Declets To Binary Coded Decimal */                                \
-  V(cdtbcd, CDTBCD, 0x7C000234)                                                \
-  /* Decimal Floating Add */                                                   \
-  V(dadd, DADD, 0xEC000004)                                                    \
-  /* Decimal Floating Add Quad */                                              \
-  V(daddq, DADDQ, 0xFC000004)                                                  \
-  /* Decimal Floating Convert From Fixed */                                    \
-  V(dcffix, DCFFIX, 0xEC000644)                                                \
-  /* Decimal Floating Convert From Fixed Quad */                               \
-  V(dcffixq, DCFFIXQ, 0xFC000644)                                              \
-  /* Decimal Floating Compare Ordered */                                       \
-  V(dcmpo, DCMPO, 0xEC000104)                                                  \
-  /* Decimal Floating Compare Ordered Quad */                                  \
-  V(dcmpoq, DCMPOQ, 0xFC000104)                                                \
-  /* Decimal Floating Compare Unordered */                                     \
-  V(dcmpu, DCMPU, 0xEC000504)                                                  \
-  /* Decimal Floating Compare Unordered Quad */                                \
-  V(dcmpuq, DCMPUQ, 0xFC000504)                                                \
-  /* Decimal Floating Convert To DFP Long */                                   \
-  V(dctdp, DCTDP, 0xEC000204)                                                  \
-  /* Decimal Floating Convert To Fixed */                                      \
-  V(dctfix, DCTFIX, 0xEC000244)                                                \
-  /* Decimal Floating Convert To Fixed Quad */                                 \
-  V(dctfixq, DCTFIXQ, 0xFC000244)                                              \
-  /* Decimal Floating Convert To DFP Extended */                               \
-  V(dctqpq, DCTQPQ, 0xFC000204)                                                \
-  /* Decimal Floating Decode DPD To BCD */                                     \
-  V(ddedpd, DDEDPD, 0xEC000284)                                                \
-  /* Decimal Floating Decode DPD To BCD Quad */                                \
-  V(ddedpdq, DDEDPDQ, 0xFC000284)                                              \
-  /* Decimal Floating Divide */                                                \
-  V(ddiv, DDIV, 0xEC000444)                                                    \
-  /* Decimal Floating Divide Quad */                                           \
-  V(ddivq, DDIVQ, 0xFC000444)                                                  \
-  /* Decimal Floating Encode BCD To DPD */                                     \
-  V(denbcd, DENBCD, 0xEC000684)                                                \
-  /* Decimal Floating Encode BCD To DPD Quad */                                \
-  V(denbcdq, DENBCDQ, 0xFC000684)                                              \
-  /* Decimal Floating Insert Exponent */                                       \
-  V(diex, DIEX, 0xEC0006C4)                                                    \
-  /* Decimal Floating Insert Exponent Quad */                                  \
-  V(diexq, DIEXQ, 0xFC0006C4)                                                  \
-  /* Decimal Floating Multiply */                                              \
-  V(dmul, DMUL, 0xEC000044)                                                    \
-  /* Decimal Floating Multiply Quad */                                         \
-  V(dmulq, DMULQ, 0xFC000044)                                                  \
-  /* Decimal Floating Round To DFP Long */                                     \
-  V(drdpq, DRDPQ, 0xFC000604)                                                  \
-  /* Decimal Floating Round To DFP Short */                                    \
-  V(drsp, DRSP, 0xEC000604)                                                    \
-  /* Decimal Floating Subtract */                                              \
-  V(dsub, DSUB, 0xEC000404)                                                    \
-  /* Decimal Floating Subtract Quad */                                         \
-  V(dsubq, DSUBQ, 0xFC000404)                                                  \
-  /* Decimal Floating Test Exponent */                                         \
-  V(dtstex, DTSTEX, 0xEC000144)                                                \
-  /* Decimal Floating Test Exponent Quad */                                    \
-  V(dtstexq, DTSTEXQ, 0xFC000144)                                              \
-  /* Decimal Floating Test Significance */                                     \
-  V(dtstsf, DTSTSF, 0xEC000544)                                                \
-  /* Decimal Floating Test Significance Quad */                                \
-  V(dtstsfq, DTSTSFQ, 0xFC000544)                                              \
-  /* Decimal Floating Extract Exponent */                                      \
-  V(dxex, DXEX, 0xEC0002C4)                                                    \
-  /* Decimal Floating Extract Exponent Quad */                                 \
-  V(dxexq, DXEXQ, 0xFC0002C4)                                                  \
-  /* Decorated Storage Notify */                                               \
-  V(dsn, DSN, 0x7C0003C6)                                                      \
-  /* Load Byte with Decoration Indexed */                                      \
-  V(lbdx, LBDX, 0x7C000406)                                                    \
-  /* Load Doubleword with Decoration Indexed */                                \
-  V(lddx, LDDX, 0x7C0004C6)                                                    \
-  /* Load Floating Doubleword with Decoration Indexed */                       \
-  V(lfddx, LFDDX, 0x7C000646)                                                  \
-  /* Load Halfword with Decoration Indexed */                                  \
-  V(lhdx, LHDX, 0x7C000446)                                                    \
-  /* Load Word with Decoration Indexed */                                      \
-  V(lwdx, LWDX, 0x7C000486)                                                    \
-  /* Store Byte with Decoration Indexed */                                     \
-  V(stbdx, STBDX, 0x7C000506)                                                  \
-  /* Store Doubleword with Decoration Indexed */                               \
-  V(stddx, STDDX, 0x7C0005C6)                                                  \
-  /* Store Floating Doubleword with Decoration Indexed */                      \
-  V(stfddx, STFDDX, 0x7C000746)                                                \
-  /* Store Halfword with Decoration Indexed */                                 \
-  V(sthdx, STHDX, 0x7C000546)                                                  \
-  /* Store Word with Decoration Indexed */                                     \
-  V(stwdx, STWDX, 0x7C000586)                                                  \
-  /* Data Cache Block Allocate */                                              \
-  V(dcba, DCBA, 0x7C0005EC)                                                    \
-  /* Data Cache Block Invalidate */                                            \
-  V(dcbi, DCBI, 0x7C0003AC)                                                    \
-  /* Instruction Cache Block Touch */                                          \
-  V(icbt, ICBT, 0x7C00002C)                                                    \
-  /* Move to Condition Register from XER */                                    \
-  V(mcrxr, MCRXR, 0x7C000400)                                                  \
-  /* TLB Invalidate Local Indexed */                                           \
-  V(tlbilx, TLBILX, 0x7C000024)                                                \
-  /* TLB Invalidate Virtual Address Indexed */                                 \
-  V(tlbivax, TLBIVAX, 0x7C000624)                                              \
-  /* TLB Read Entry */                                                         \
-  V(tlbre, TLBRE, 0x7C000764)                                                  \
-  /* TLB Search Indexed */                                                     \
-  V(tlbsx, TLBSX, 0x7C000724)                                                  \
-  /* TLB Write Entry */                                                        \
-  V(tlbwe, TLBWE, 0x7C0007A4)                                                  \
-  /* Write External Enable */                                                  \
-  V(wrtee, WRTEE, 0x7C000106)                                                  \
-  /* Write External Enable Immediate */                                        \
-  V(wrteei, WRTEEI, 0x7C000146)                                                \
-  /* Data Cache Read */                                                        \
-  V(dcread, DCREAD, 0x7C00028C)                                                \
-  /* Instruction Cache Read */                                                 \
-  V(icread, ICREAD, 0x7C0007CC)                                                \
-  /* Data Cache Invalidate */                                                  \
-  V(dci, DCI, 0x7C00038C)                                                      \
-  /* Instruction Cache Invalidate */                                           \
-  V(ici, ICI, 0x7C00078C)                                                      \
-  /* Move From Device Control Register User Mode Indexed */                    \
-  V(mfdcrux, MFDCRUX, 0x7C000246)                                              \
-  /* Move From Device Control Register Indexed */                              \
-  V(mfdcrx, MFDCRX, 0x7C000206)                                                \
-  /* Move To Device Control Register User Mode Indexed */                      \
-  V(mtdcrux, MTDCRUX, 0x7C000346)                                              \
-  /* Move To Device Control Register Indexed */                                \
-  V(mtdcrx, MTDCRX, 0x7C000306)                                                \
-  /* Return From Debug Interrupt */                                            \
-  V(rfdi, RFDI, 0x4C00004E)                                                    \
-  /* Data Cache Block Flush by External PID */                                 \
-  V(dcbfep, DCBFEP, 0x7C0000FE)                                                \
-  /* Data Cache Block Store by External PID */                                 \
-  V(dcbstep, DCBSTEP, 0x7C00007E)                                              \
-  /* Data Cache Block Touch by External PID */                                 \
-  V(dcbtep, DCBTEP, 0x7C00027E)                                                \
-  /* Data Cache Block Touch for Store by External PID */                       \
-  V(dcbtstep, DCBTSTEP, 0x7C0001FE)                                            \
-  /* Data Cache Block Zero by External PID */                                  \
-  V(dcbzep, DCBZEP, 0x7C0007FE)                                                \
-  /* Instruction Cache Block Invalidate by External PID */                     \
-  V(icbiep, ICBIEP, 0x7C0007BE)                                                \
-  /* Load Byte and Zero by External PID Indexed */                             \
-  V(lbepx, LBEPX, 0x7C0000BE)                                                  \
-  /* Load Floating-Point Double by External PID Indexed */                     \
-  V(lfdepx, LFDEPX, 0x7C0004BE)                                                \
-  /* Load Halfword and Zero by External PID Indexed */                         \
-  V(lhepx, LHEPX, 0x7C00023E)                                                  \
-  /* Load Vector by External PID Indexed */                                    \
-  V(lvepx, LVEPX, 0x7C00024E)                                                  \
-  /* Load Vector by External PID Indexed Last */                               \
-  V(lvepxl, LVEPXL, 0x7C00020E)                                                \
-  /* Load Word and Zero by External PID Indexed */                             \
-  V(lwepx, LWEPX, 0x7C00003E)                                                  \
-  /* Store Byte by External PID Indexed */                                     \
-  V(stbepx, STBEPX, 0x7C0001BE)                                                \
-  /* Store Floating-Point Double by External PID Indexed */                    \
-  V(stfdepx, STFDEPX, 0x7C0005BE)                                              \
-  /* Store Halfword by External PID Indexed */                                 \
-  V(sthepx, STHEPX, 0x7C00033E)                                                \
-  /* Store Vector by External PID Indexed */                                   \
-  V(stvepx, STVEPX, 0x7C00064E)                                                \
-  /* Store Vector by External PID Indexed Last */                              \
-  V(stvepxl, STVEPXL, 0x7C00060E)                                              \
-  /* Store Word by External PID Indexed */                                     \
-  V(stwepx, STWEPX, 0x7C00013E)                                                \
-  /* Load Doubleword by External PID Indexed */                                \
-  V(ldepx, LDEPX, 0x7C00003A)                                                  \
-  /* Store Doubleword by External PID Indexed */                               \
-  V(stdepx, STDEPX, 0x7C00013A)                                                \
-  /* TLB Search and Reserve Indexed */                                         \
-  V(tlbsrx, TLBSRX, 0x7C0006A5)                                                \
-  /* External Control In Word Indexed */                                       \
-  V(eciwx, ECIWX, 0x7C00026C)                                                  \
-  /* External Control Out Word Indexed */                                      \
-  V(ecowx, ECOWX, 0x7C00036C)                                                  \
-  /* Data Cache Block Lock Clear */                                            \
-  V(dcblc, DCBLC, 0x7C00030C)                                                  \
-  /* Data Cache Block Lock Query */                                            \
-  V(dcblq, DCBLQ, 0x7C00034D)                                                  \
-  /* Data Cache Block Touch and Lock Set */                                    \
-  V(dcbtls, DCBTLS, 0x7C00014C)                                                \
-  /* Data Cache Block Touch for Store and Lock Set */                          \
-  V(dcbtstls, DCBTSTLS, 0x7C00010C)                                            \
-  /* Instruction Cache Block Lock Clear */                                     \
-  V(icblc, ICBLC, 0x7C0001CC)                                                  \
-  /* Instruction Cache Block Lock Query */                                     \
-  V(icblq, ICBLQ, 0x7C00018D)                                                  \
-  /* Instruction Cache Block Touch and Lock Set */                             \
-  V(icbtls, ICBTLS, 0x7C0003CC)                                                \
-  /* Floating Compare Ordered */                                               \
-  V(fcmpo, FCMPO, 0xFC000040)                                                  \
-  /* Floating Compare Unordered */                                             \
-  V(fcmpu, FCMPU, 0xFC000000)                                                  \
-  /* Floating Test for software Divide */                                      \
-  V(ftdiv, FTDIV, 0xFC000100)                                                  \
-  /* Floating Test for software Square Root */                                 \
-  V(ftsqrt, FTSQRT, 0xFC000140)                                                \
-  /* Load Floating-Point as Integer Word Algebraic Indexed */                  \
-  V(lfiwax, LFIWAX, 0x7C0006AE)                                                \
-  /* Load Floating-Point as Integer Word and Zero Indexed */                   \
-  V(lfiwzx, LFIWZX, 0x7C0006EE)                                                \
-  /* Move To Condition Register from FPSCR */                                  \
-  V(mcrfs, MCRFS, 0xFC000080)                                                  \
-  /* Store Floating-Point as Integer Word Indexed */                           \
-  V(stfiwx, STFIWX, 0x7C0007AE)                                                \
-  /* Load Floating-Point Double Pair Indexed */                                \
-  V(lfdpx, LFDPX, 0x7C00062E)                                                  \
-  /* Store Floating-Point Double Pair Indexed */                               \
-  V(stfdpx, STFDPX, 0x7C00072E)                                                \
-  /* Floating Absolute Value */                                                \
-  V(fabs, FABS, 0xFC000210)                                                    \
-  /* Floating Convert From Integer Doubleword */                               \
-  V(fcfid, FCFID, 0xFC00069C)                                                  \
-  /* Floating Convert From Integer Doubleword Single */                        \
-  V(fcfids, FCFIDS, 0xEC00069C)                                                \
-  /* Floating Convert From Integer Doubleword Unsigned */                      \
-  V(fcfidu, FCFIDU, 0xFC00079C)                                                \
-  /* Floating Convert From Integer Doubleword Unsigned Single */               \
-  V(fcfidus, FCFIDUS, 0xEC00079C)                                              \
-  /* Floating Copy Sign */                                                     \
-  V(fcpsgn, FCPSGN, 0xFC000010)                                                \
-  /* Floating Convert To Integer Doubleword */                                 \
-  V(fctid, FCTID, 0xFC00065C)                                                  \
-  /* Floating Convert To Integer Doubleword Unsigned */                        \
-  V(fctidu, FCTIDU, 0xFC00075C)                                                \
-  /* Floating Convert To Integer Doubleword Unsigned with round toward */      \
-  /* Zero */                                                                   \
-  V(fctiduz, FCTIDUZ, 0xFC00075E)                                              \
-  /* Floating Convert To Integer Doubleword with round toward Zero */          \
-  V(fctidz, FCTIDZ, 0xFC00065E)                                                \
-  /* Floating Convert To Integer Word */                                       \
-  V(fctiw, FCTIW, 0xFC00001C)                                                  \
-  /* Floating Convert To Integer Word Unsigned */                              \
-  V(fctiwu, FCTIWU, 0xFC00011C)                                                \
-  /* Floating Convert To Integer Word Unsigned with round toward Zero */       \
-  V(fctiwuz, FCTIWUZ, 0xFC00011E)                                              \
-  /* Floating Convert To Integer Word with round to Zero */                    \
-  V(fctiwz, FCTIWZ, 0xFC00001E)                                                \
-  /* Floating Move Register */                                                 \
-  V(fmr, FMR, 0xFC000090)                                                      \
-  /* Floating Negative Absolute Value */                                       \
-  V(fnabs, FNABS, 0xFC000110)                                                  \
-  /* Floating Negate */                                                        \
-  V(fneg, FNEG, 0xFC000050)                                                    \
-  /* Floating Round to Single-Precision */                                     \
-  V(frsp, FRSP, 0xFC000018)                                                    \
-  /* Move From FPSCR */                                                        \
-  V(mffs, MFFS, 0xFC00048E)                                                    \
-  /* Move To FPSCR Bit 0 */                                                    \
-  V(mtfsb0, MTFSB0, 0xFC00008C)                                                \
-  /* Move To FPSCR Bit 1 */                                                    \
-  V(mtfsb1, MTFSB1, 0xFC00004C)                                                \
-  /* Move To FPSCR Field Immediate */                                          \
-  V(mtfsfi, MTFSFI, 0xFC00010C)                                                \
-  /* Floating Round To Integer Minus */                                        \
-  V(frim, FRIM, 0xFC0003D0)                                                    \
-  /* Floating Round To Integer Nearest */                                      \
-  V(frin, FRIN, 0xFC000310)                                                    \
-  /* Floating Round To Integer Plus */                                         \
-  V(frip, FRIP, 0xFC000390)                                                    \
-  /* Floating Round To Integer toward Zero */                                  \
-  V(friz, FRIZ, 0xFC000350)                                                    \
-  /* Multiply Cross Halfword to Word Signed */                                 \
-  V(mulchw, MULCHW, 0x10000150)                                                \
-  /* Multiply Cross Halfword to Word Unsigned */                               \
-  V(mulchwu, MULCHWU, 0x10000110)                                              \
-  /* Multiply High Halfword to Word Signed */                                  \
-  V(mulhhw, MULHHW, 0x10000050)                                                \
-  /* Multiply High Halfword to Word Unsigned */                                \
-  V(mulhhwu, MULHHWU, 0x10000010)                                              \
-  /* Multiply Low Halfword to Word Signed */                                   \
-  V(mullhw, MULLHW, 0x10000350)                                                \
-  /* Multiply Low Halfword to Word Unsigned */                                 \
-  V(mullhwu, MULLHWU, 0x10000310)                                              \
-  /* Determine Leftmost Zero Byte DQ 56 E0000000 P 58 LSQ lq Load Quadword */  \
-  V(dlmzb, DLMZB, 0x7C00009C)                                                  \
-  /* Load Quadword And Reserve Indexed */                                      \
-  V(lqarx, LQARX, 0x7C000228)                                                  \
-  /* Store Quadword Conditional Indexed and record CR0 */                      \
-  V(stqcx, STQCX, 0x7C00016D)                                                  \
-  /* Load String Word Immediate */                                             \
-  V(lswi, LSWI, 0x7C0004AA)                                                    \
-  /* Load String Word Indexed */                                               \
-  V(lswx, LSWX, 0x7C00042A)                                                    \
-  /* Store String Word Immediate */                                            \
-  V(stswi, STSWI, 0x7C0005AA)                                                  \
-  /* Store String Word Indexed */                                              \
-  V(stswx, STSWX, 0x7C00052A)                                                  \
-  /* Clear BHRB */                                                             \
-  V(clrbhrb, CLRBHRB, 0x7C00035C)                                              \
-  /* Enforce In-order Execution of I/O */                                      \
-  V(eieio, EIEIO, 0x7C0006AC)                                                  \
-  /* Load Byte and Zero Caching Inhibited Indexed */                           \
-  V(lbzcix, LBZCIX, 0x7C0006AA)                                                \
-  /* Load Doubleword Caching Inhibited Indexed */                              \
-  V(ldcix, LDCIX, 0x7C0006EA)                                                  \
-  /* Load Halfword and Zero Caching Inhibited Indexed */                       \
-  V(lhzcix, LHZCIX, 0x7C00066A)                                                \
-  /* Load Word and Zero Caching Inhibited Indexed */                           \
-  V(lwzcix, LWZCIX, 0x7C00062A)                                                \
-  /* Move From Segment Register */                                             \
-  V(mfsr, MFSR, 0x7C0004A6)                                                    \
-  /* Move From Segment Register Indirect */                                    \
-  V(mfsrin, MFSRIN, 0x7C000526)                                                \
-  /* Move To Machine State Register Doubleword */                              \
-  V(mtmsrd, MTMSRD, 0x7C000164)                                                \
-  /* Move To Split Little Endian */                                            \
-  V(mtsle, MTSLE, 0x7C000126)                                                  \
-  /* Move To Segment Register */                                               \
-  V(mtsr, MTSR, 0x7C0001A4)                                                    \
-  /* Move To Segment Register Indirect */                                      \
-  V(mtsrin, MTSRIN, 0x7C0001E4)                                                \
-  /* SLB Find Entry ESID */                                                    \
-  V(slbfee, SLBFEE, 0x7C0007A7)                                                \
-  /* SLB Invalidate All */                                                     \
-  V(slbia, SLBIA, 0x7C0003E4)                                                  \
-  /* SLB Invalidate Entry */                                                   \
-  V(slbie, SLBIE, 0x7C000364)                                                  \
-  /* SLB Move From Entry ESID */                                               \
-  V(slbmfee, SLBMFEE, 0x7C000726)                                              \
-  /* SLB Move From Entry VSID */                                               \
-  V(slbmfev, SLBMFEV, 0x7C0006A6)                                              \
-  /* SLB Move To Entry */                                                      \
-  V(slbmte, SLBMTE, 0x7C000324)                                                \
-  /* Store Byte Caching Inhibited Indexed */                                   \
-  V(stbcix, STBCIX, 0x7C0007AA)                                                \
-  /* Store Doubleword Caching Inhibited Indexed */                             \
-  V(stdcix, STDCIX, 0x7C0007EA)                                                \
-  /* Store Halfword and Zero Caching Inhibited Indexed */                      \
-  V(sthcix, STHCIX, 0x7C00076A)                                                \
-  /* Store Word and Zero Caching Inhibited Indexed */                          \
-  V(stwcix, STWCIX, 0x7C00072A)                                                \
-  /* TLB Invalidate All */                                                     \
-  V(tlbia, TLBIA, 0x7C0002E4)                                                  \
-  /* TLB Invalidate Entry */                                                   \
-  V(tlbie, TLBIE, 0x7C000264)                                                  \
-  /* TLB Invalidate Entry Local */                                             \
-  V(tlbiel, TLBIEL, 0x7C000224)                                                \
-  /* Message Clear Privileged */                                               \
-  V(msgclrp, MSGCLRP, 0x7C00015C)                                              \
-  /* Message Send Privileged */                                                \
-  V(msgsndp, MSGSNDP, 0x7C00011C)                                              \
-  /* Message Clear */                                                          \
-  V(msgclr, MSGCLR, 0x7C0001DC)                                                \
-  /* Message Send */                                                           \
-  V(msgsnd, MSGSND, 0x7C00019C)                                                \
-  /* Move From Machine State Register */                                       \
-  V(mfmsr, MFMSR, 0x7C0000A6)                                                  \
-  /* Move To Machine State Register */                                         \
-  V(mtmsr, MTMSR, 0x7C000124)                                                  \
-  /* TLB Synchronize */                                                        \
-  V(tlbsync, TLBSYNC, 0x7C00046C)                                              \
-  /* Transaction Abort */                                                      \
-  V(tabort, TABORT, 0x7C00071D)                                                \
-  /* Transaction Abort Doubleword Conditional */                               \
-  V(tabortdc, TABORTDC, 0x7C00065D)                                            \
-  /* Transaction Abort Doubleword Conditional Immediate */                     \
-  V(tabortdci, TABORTDCI, 0x7C0006DD)                                          \
-  /* Transaction Abort Word Conditional */                                     \
-  V(tabortwc, TABORTWC, 0x7C00061D)                                            \
-  /* Transaction Abort Word Conditional Immediate */                           \
-  V(tabortwci, TABORTWCI, 0x7C00069D)                                          \
-  /* Transaction Begin */                                                      \
-  V(tbegin, TBEGIN, 0x7C00051D)                                                \
-  /* Transaction Check */                                                      \
-  V(tcheck, TCHECK, 0x7C00059C)                                                \
-  /* Transaction End */                                                        \
-  V(tend, TEND, 0x7C00055C)                                                    \
-  /* Transaction Recheckpoint */                                               \
-  V(trechkpt, TRECHKPT, 0x7C0007DD)                                            \
-  /* Transaction Reclaim */                                                    \
-  V(treclaim, TRECLAIM, 0x7C00075D)                                            \
-  /* Transaction Suspend or Resume */                                          \
-  V(tsr, TSR, 0x7C0005DC)                                                      \
-  /* Load Vector Element Byte Indexed */                                       \
-  V(lvebx, LVEBX, 0x7C00000E)                                                  \
-  /* Load Vector Element Halfword Indexed */                                   \
-  V(lvehx, LVEHX, 0x7C00004E)                                                  \
-  /* Load Vector Element Word Indexed */                                       \
-  V(lvewx, LVEWX, 0x7C00008E)                                                  \
-  /* Load Vector for Shift Left */                                             \
-  V(lvsl, LVSL, 0x7C00000C)                                                    \
-  /* Load Vector for Shift Right */                                            \
-  V(lvsr, LVSR, 0x7C00004C)                                                    \
-  /* Load Vector Indexed */                                                    \
-  V(lvx, LVX, 0x7C0000CE)                                                      \
-  /* Load Vector Indexed Last */                                               \
-  V(lvxl, LVXL, 0x7C0002CE)                                                    \
-  /* Store Vector Element Byte Indexed */                                      \
-  V(stvebx, STVEBX, 0x7C00010E)                                                \
-  /* Store Vector Element Halfword Indexed */                                  \
-  V(stvehx, STVEHX, 0x7C00014E)                                                \
-  /* Store Vector Element Word Indexed */                                      \
-  V(stvewx, STVEWX, 0x7C00018E)                                                \
-  /* Store Vector Indexed */                                                   \
-  V(stvx, STVX, 0x7C0001CE)                                                    \
-  /* Store Vector Indexed Last */                                              \
-  V(stvxl, STVXL, 0x7C0003CE)                                                  \
-  /* Vector Minimum Signed Doubleword */                                       \
-  V(vminsd, VMINSD, 0x100003C2)                                                \
-  /* Floating Merge Even Word */                                               \
-  V(fmrgew, FMRGEW, 0xFC00078C)                                                \
-  /* Floating Merge Odd Word */                                                \
-  V(fmrgow, FMRGOW, 0xFC00068C)                                                \
-  /* Wait for Interrupt */                                                     \
-  V(wait, WAIT, 0x7C00007C)
-
-#define PPC_X_OPCODE_LIST(V)     \
-  PPC_X_OPCODE_A_FORM_LIST(V)    \
-  PPC_X_OPCODE_B_FORM_LIST(V)    \
-  PPC_X_OPCODE_C_FORM_LIST(V)    \
-  PPC_X_OPCODE_D_FORM_LIST(V)    \
-  PPC_X_OPCODE_E_FORM_LIST(V)    \
-  PPC_X_OPCODE_F_FORM_LIST(V)    \
-  PPC_X_OPCODE_EH_L_FORM_LIST(V) \
-  PPC_X_OPCODE_UNUSED_LIST(V)
-
-#define PPC_EVS_OPCODE_LIST(V)                                                 \
-  /* Vector Select */                                                          \
-  V(evsel, EVSEL, 0x10000278)
-
-#define PPC_DS_OPCODE_LIST(V)                                                  \
-  /* Load Doubleword */                                                        \
-  V(ld, LD, 0xE8000000)                                                        \
-  /* Load Doubleword with Update */                                            \
-  V(ldu, LDU, 0xE8000001)                                                      \
-  /* Load Word Algebraic */                                                    \
-  V(lwa, LWA, 0xE8000002)                                                      \
-  /* Store Doubleword */                                                       \
-  V(std, STD, 0xF8000000)                                                      \
-  /* Store Doubleword with Update */                                           \
-  V(stdu, STDU, 0xF8000001)                                                    \
-  /* Load Floating-Point Double Pair */                                        \
-  V(lfdp, LFDP, 0xE4000000)                                                    \
-  /* Store Floating-Point Double Pair */                                       \
-  V(stfdp, STFDP, 0xF4000000)                                                  \
-  /* Store Quadword */                                                         \
-  V(stq, STQ, 0xF8000002)
-
-#define PPC_DQ_OPCODE_LIST(V)                                                  \
-  V(lsq, LSQ, 0xE0000000)
-
-#define PPC_D_OPCODE_LIST(V)                                                   \
-  /* Trap Doubleword Immediate */                                              \
-  V(tdi, TDI, 0x08000000)                                                      \
-  /* Add Immediate */                                                          \
-  V(addi, ADDI, 0x38000000)                                                    \
-  /* Add Immediate Carrying */                                                 \
-  V(addic, ADDIC, 0x30000000)                                                  \
-  /* Add Immediate Carrying & record CR0 */                                    \
-  V(addicx, ADDICx, 0x34000000)                                                \
-  /* Add Immediate Shifted */                                                  \
-  V(addis, ADDIS, 0x3C000000)                                                  \
-  /* AND Immediate & record CR0 */                                             \
-  V(andix, ANDIx, 0x70000000)                                                  \
-  /* AND Immediate Shifted & record CR0 */                                     \
-  V(andisx, ANDISx, 0x74000000)                                                \
-  /* Compare Immediate */                                                      \
-  V(cmpi, CMPI, 0x2C000000)                                                    \
-  /* Compare Logical Immediate */                                              \
-  V(cmpli, CMPLI, 0x28000000)                                                  \
-  /* Load Byte and Zero */                                                     \
-  V(lbz, LBZ, 0x88000000)                                                      \
-  /* Load Byte and Zero with Update */                                         \
-  V(lbzu, LBZU, 0x8C000000)                                                    \
-  /* Load Halfword Algebraic */                                                \
-  V(lha, LHA, 0xA8000000)                                                      \
-  /* Load Halfword Algebraic with Update */                                    \
-  V(lhau, LHAU, 0xAC000000)                                                    \
-  /* Load Halfword and Zero */                                                 \
-  V(lhz, LHZ, 0xA0000000)                                                      \
-  /* Load Halfword and Zero with Update */                                     \
-  V(lhzu, LHZU, 0xA4000000)                                                    \
-  /* Load Multiple Word */                                                     \
-  V(lmw, LMW, 0xB8000000)                                                      \
-  /* Load Word and Zero */                                                     \
-  V(lwz, LWZ, 0x80000000)                                                      \
-  /* Load Word and Zero with Update */                                         \
-  V(lwzu, LWZU, 0x84000000)                                                    \
-  /* Multiply Low Immediate */                                                 \
-  V(mulli, MULLI, 0x1C000000)                                                  \
-  /* OR Immediate */                                                           \
-  V(ori, ORI, 0x60000000)                                                      \
-  /* OR Immediate Shifted */                                                   \
-  V(oris, ORIS, 0x64000000)                                                    \
-  /* Store Byte */                                                             \
-  V(stb, STB, 0x98000000)                                                      \
-  /* Store Byte with Update */                                                 \
-  V(stbu, STBU, 0x9C000000)                                                    \
-  /* Store Halfword */                                                         \
-  V(sth, STH, 0xB0000000)                                                      \
-  /* Store Halfword with Update */                                             \
-  V(sthu, STHU, 0xB4000000)                                                    \
-  /* Store Multiple Word */                                                    \
-  V(stmw, STMW, 0xBC000000)                                                    \
-  /* Store Word */                                                             \
-  V(stw, STW, 0x90000000)                                                      \
-  /* Store Word with Update */                                                 \
-  V(stwu, STWU, 0x94000000)                                                    \
-  /* Subtract From Immediate Carrying */                                       \
-  V(subfic, SUBFIC, 0x20000000)                                                \
-  /* Trap Word Immediate */                                                    \
-  V(twi, TWI, 0x0C000000)                                                      \
-  /* XOR Immediate */                                                          \
-  V(xori, XORI, 0x68000000)                                                    \
-  /* XOR Immediate Shifted */                                                  \
-  V(xoris, XORIS, 0x6C000000)                                                  \
-  /* Load Floating-Point Double */                                             \
-  V(lfd, LFD, 0xC8000000)                                                      \
-  /* Load Floating-Point Double with Update */                                 \
-  V(lfdu, LFDU, 0xCC000000)                                                    \
-  /* Load Floating-Point Single */                                             \
-  V(lfs, LFS, 0xC0000000)                                                      \
-  /* Load Floating-Point Single with Update */                                 \
-  V(lfsu, LFSU, 0xC4000000)                                                    \
-  /* Store Floating-Point Double */                                            \
-  V(stfd, STFD, 0xD8000000)                                                    \
-  /* Store Floating-Point Double with Update */                                \
-  V(stfdu, STFDU, 0xDC000000)                                                  \
-  /* Store Floating-Point Single */                                            \
-  V(stfs, STFS, 0xD0000000)                                                    \
-  /* Store Floating-Point Single with Update */                                \
-  V(stfsu, STFSU, 0xD4000000)
-
-#define PPC_XFL_OPCODE_LIST(V)                                                 \
-  /* Move To FPSCR Fields */                                                   \
-  V(mtfsf, MTFSF, 0xFC00058E)
-
-#define PPC_XFX_OPCODE_LIST(V)                                                 \
-  /* Move From Condition Register */                                           \
-  V(mfcr, MFCR, 0x7C000026)                                                    \
-  /* Move From One Condition Register Field */                                 \
-  V(mfocrf, MFOCRF, 0x7C100026)                                                \
-  /* Move From Special Purpose Register */                                     \
-  V(mfspr, MFSPR, 0x7C0002A6)                                                  \
-  /* Move To Condition Register Fields */                                      \
-  V(mtcrf, MTCRF, 0x7C000120)                                                  \
-  /* Move To One Condition Register Field */                                   \
-  V(mtocrf, MTOCRF, 0x7C100120)                                                \
-  /* Move To Special Purpose Register */                                       \
-  V(mtspr, MTSPR, 0x7C0003A6)                                                  \
-  /* Debugger Notify Halt */                                                   \
-  V(dnh, DNH, 0x4C00018C)                                                      \
-  /* Move From Device Control Register */                                      \
-  V(mfdcr, MFDCR, 0x7C000286)                                                  \
-  /* Move To Device Control Register */                                        \
-  V(mtdcr, MTDCR, 0x7C000386)                                                  \
-  /* Move from Performance Monitor Register */                                 \
-  V(mfpmr, MFPMR, 0x7C00029C)                                                  \
-  /* Move To Performance Monitor Register */                                   \
-  V(mtpmr, MTPMR, 0x7C00039C)                                                  \
-  /* Move From Branch History Rolling Buffer */                                \
-  V(mfbhrbe, MFBHRBE, 0x7C00025C)                                              \
-  /* Move From Time Base */                                                    \
-  V(mftb, MFTB, 0x7C0002E6)
-
-#define PPC_MDS_OPCODE_LIST(V)                                                 \
-  /* Rotate Left Doubleword then Clear Left */                                 \
-  V(rldcl, RLDCL, 0x78000010)                                                  \
-  /* Rotate Left Doubleword then Clear Right */                                \
-  V(rldcr, RLDCR, 0x78000012)
-
-#define PPC_A_OPCODE_LIST(V)                                                   \
-  /* Integer Select */                                                         \
-  V(isel, ISEL, 0x7C00001E)                                                    \
-  /* Floating Add */                                                           \
-  V(fadd, FADD, 0xFC00002A)                                                    \
-  /* Floating Add Single */                                                    \
-  V(fadds, FADDS, 0xEC00002A)                                                  \
-  /* Floating Divide */                                                        \
-  V(fdiv, FDIV, 0xFC000024)                                                    \
-  /* Floating Divide Single */                                                 \
-  V(fdivs, FDIVS, 0xEC000024)                                                  \
-  /* Floating Multiply-Add */                                                  \
-  V(fmadd, FMADD, 0xFC00003A)                                                  \
-  /* Floating Multiply-Add Single */                                           \
-  V(fmadds, FMADDS, 0xEC00003A)                                                \
-  /* Floating Multiply-Subtract */                                             \
-  V(fmsub, FMSUB, 0xFC000038)                                                  \
-  /* Floating Multiply-Subtract Single */                                      \
-  V(fmsubs, FMSUBS, 0xEC000038)                                                \
-  /* Floating Multiply */                                                      \
-  V(fmul, FMUL, 0xFC000032)                                                    \
-  /* Floating Multiply Single */                                               \
-  V(fmuls, FMULS, 0xEC000032)                                                  \
-  /* Floating Negative Multiply-Add */                                         \
-  V(fnmadd, FNMADD, 0xFC00003E)                                                \
-  /* Floating Negative Multiply-Add Single */                                  \
-  V(fnmadds, FNMADDS, 0xEC00003E)                                              \
-  /* Floating Negative Multiply-Subtract */                                    \
-  V(fnmsub, FNMSUB, 0xFC00003C)                                                \
-  /* Floating Negative Multiply-Subtract Single */                             \
-  V(fnmsubs, FNMSUBS, 0xEC00003C)                                              \
-  /* Floating Reciprocal Estimate Single */                                    \
-  V(fres, FRES, 0xEC000030)                                                    \
-  /* Floating Reciprocal Square Root Estimate */                               \
-  V(frsqrte, FRSQRTE, 0xFC000034)                                              \
-  /* Floating Select */                                                        \
-  V(fsel, FSEL, 0xFC00002E)                                                    \
-  /* Floating Square Root */                                                   \
-  V(fsqrt, FSQRT, 0xFC00002C)                                                  \
-  /* Floating Square Root Single */                                            \
-  V(fsqrts, FSQRTS, 0xEC00002C)                                                \
-  /* Floating Subtract */                                                      \
-  V(fsub, FSUB, 0xFC000028)                                                    \
-  /* Floating Subtract Single */                                               \
-  V(fsubs, FSUBS, 0xEC000028)                                                  \
-  /* Floating Reciprocal Estimate */                                           \
-  V(fre, FRE, 0xFC000030)                                                      \
-  /* Floating Reciprocal Square Root Estimate Single */                        \
-  V(frsqrtes, FRSQRTES, 0xEC000034)
-
-#define PPC_VA_OPCODE_LIST(V)                                                  \
-  /* Vector Add Extended & write Carry Unsigned Quadword */                    \
-  V(vaddecuq, VADDECUQ, 0x1000003D)                                            \
-  /* Vector Add Extended Unsigned Quadword Modulo */                           \
-  V(vaddeuqm, VADDEUQM, 0x1000003C)                                            \
-  /* Vector Multiply-Add Single-Precision */                                   \
-  V(vmaddfp, VMADDFP, 0x1000002E)                                              \
-  /* Vector Multiply-High-Add Signed Halfword Saturate */                      \
-  V(vmhaddshs, VMHADDSHS, 0x10000020)                                          \
-  /* Vector Multiply-High-Round-Add Signed Halfword Saturate */                \
-  V(vmhraddshs, VMHRADDSHS, 0x10000021)                                        \
-  /* Vector Multiply-Low-Add Unsigned Halfword Modulo */                       \
-  V(vmladduhm, VMLADDUHM, 0x10000022)                                          \
-  /* Vector Multiply-Sum Mixed Byte Modulo */                                  \
-  V(vmsummbm, VMSUMMBM, 0x10000025)                                            \
-  /* Vector Multiply-Sum Signed Halfword Modulo */                             \
-  V(vmsumshm, VMSUMSHM, 0x10000028)                                            \
-  /* Vector Multiply-Sum Signed Halfword Saturate */                           \
-  V(vmsumshs, VMSUMSHS, 0x10000029)                                            \
-  /* Vector Multiply-Sum Unsigned Byte Modulo */                               \
-  V(vmsumubm, VMSUMUBM, 0x10000024)                                            \
-  /* Vector Multiply-Sum Unsigned Halfword Modulo */                           \
-  V(vmsumuhm, VMSUMUHM, 0x10000026)                                            \
-  /* Vector Multiply-Sum Unsigned Halfword Saturate */                         \
-  V(vmsumuhs, VMSUMUHS, 0x10000027)                                            \
-  /* Vector Negative Multiply-Subtract Single-Precision */                     \
-  V(vnmsubfp, VNMSUBFP, 0x1000002F)                                            \
-  /* Vector Permute */                                                         \
-  V(vperm, VPERM, 0x1000002B)                                                  \
-  /* Vector Select */                                                          \
-  V(vsel, VSEL, 0x1000002A)                                                    \
-  /* Vector Shift Left Double by Octet Immediate */                            \
-  V(vsldoi, VSLDOI, 0x1000002C)                                                \
-  /* Vector Subtract Extended & write Carry Unsigned Quadword */               \
-  V(vsubecuq, VSUBECUQ, 0x1000003F)                                            \
-  /* Vector Subtract Extended Unsigned Quadword Modulo */                      \
-  V(vsubeuqm, VSUBEUQM, 0x1000003E)                                            \
-  /* Vector Permute and Exclusive-OR */                                        \
-  V(vpermxor, VPERMXOR, 0x1000002D)
-
-#define PPC_XX1_OPCODE_LIST(V)                                                 \
-  /* Load VSR Scalar Doubleword Indexed */                                     \
-  V(lxsdx, LXSDX, 0x7C000498)                                                  \
-  /* Load VSX Scalar as Integer Word Algebraic Indexed */                      \
-  V(lxsiwax, LXSIWAX, 0x7C000098)                                              \
-  /* Load VSX Scalar as Integer Word and Zero Indexed */                       \
-  V(lxsiwzx, LXSIWZX, 0x7C000018)                                              \
-  /* Load VSX Scalar Single-Precision Indexed */                               \
-  V(lxsspx, LXSSPX, 0x7C000418)                                                \
-  /* Load VSR Vector Doubleword*2 Indexed */                                   \
-  V(lxvd, LXVD, 0x7C000698)                                                    \
-  /* Load VSR Vector Doubleword & Splat Indexed */                             \
-  V(lxvdsx, LXVDSX, 0x7C000298)                                                \
-  /* Load VSR Vector Word*4 Indexed */                                         \
-  V(lxvw, LXVW, 0x7C000618)                                                    \
-  /* Move From VSR Doubleword */                                               \
-  V(mfvsrd, MFVSRD, 0x7C000066)                                                \
-  /* Move From VSR Word and Zero */                                            \
-  V(mfvsrwz, MFVSRWZ, 0x7C0000E6)                                              \
-  /* Store VSR Scalar Doubleword Indexed */                                    \
-  V(stxsdx, STXSDX, 0x7C000598)                                                \
-  /* Store VSX Scalar as Integer Word Indexed */                               \
-  V(stxsiwx, STXSIWX, 0x7C000118)                                              \
-  /* Store VSR Scalar Word Indexed */                                          \
-  V(stxsspx, STXSSPX, 0x7C000518)                                              \
-  /* Store VSR Vector Doubleword*2 Indexed */                                  \
-  V(stxvd, STXVD, 0x7C000798)                                                  \
-  /* Store VSR Vector Word*4 Indexed */                                        \
-  V(stxvw, STXVW, 0x7C000718)
-
-#define PPC_B_OPCODE_LIST(V)                                                   \
-  /* Branch Conditional */                                                     \
-  V(bc, BCX, 0x40000000)
-
-#define PPC_XO_OPCODE_LIST(V)                                                  \
-  /* Divide Doubleword */                                                      \
-  V(divd, DIVD, 0x7C0003D2)                                                    \
-  /* Divide Doubleword Extended */                                             \
-  V(divde, DIVDE, 0x7C000352)                                                  \
-  /* Divide Doubleword Extended & record OV */                                 \
-  V(divdeo, DIVDEO, 0x7C000752)                                                \
-  /* Divide Doubleword Extended Unsigned */                                    \
-  V(divdeu, DIVDEU, 0x7C000312)                                                \
-  /* Divide Doubleword Extended Unsigned & record OV */                        \
-  V(divdeuo, DIVDEUO, 0x7C000712)                                              \
-  /* Divide Doubleword & record OV */                                          \
-  V(divdo, DIVDO, 0x7C0007D2)                                                  \
-  /* Divide Doubleword Unsigned */                                             \
-  V(divdu, DIVDU, 0x7C000392)                                                  \
-  /* Divide Doubleword Unsigned & record OV */                                 \
-  V(divduo, DIVDUO, 0x7C000792)                                                \
-  /* Multiply High Doubleword */                                               \
-  V(mulhd, MULHD, 0x7C000092)                                                  \
-  /* Multiply High Doubleword Unsigned */                                      \
-  V(mulhdu, MULHDU, 0x7C000012)                                                \
-  /* Multiply Low Doubleword */                                                \
-  V(mulld, MULLD, 0x7C0001D2)                                                  \
-  /* Multiply Low Doubleword & record OV */                                    \
-  V(mulldo, MULLDO, 0x7C0005D2)                                                \
-  /* Add */                                                                    \
-  V(add, ADDX, 0x7C000214)                                                     \
-  /* Add Carrying */                                                           \
-  V(addc, ADDCX, 0x7C000014)                                                   \
-  /* Add Carrying & record OV */                                               \
-  V(addco, ADDCO, 0x7C000414)                                                  \
-  /* Add Extended */                                                           \
-  V(adde, ADDEX, 0x7C000114)                                                   \
-  /* Add Extended & record OV & record OV */                                   \
-  V(addeo, ADDEO, 0x7C000514)                                                  \
-  /* Add to Minus One Extended */                                              \
-  V(addme, ADDME, 0x7C0001D4)                                                  \
-  /* Add to Minus One Extended & record OV */                                  \
-  V(addmeo, ADDMEO, 0x7C0005D4)                                                \
-  /* Add & record OV */                                                        \
-  V(addo, ADDO, 0x7C000614)                                                    \
-  /* Add to Zero Extended */                                                   \
-  V(addze, ADDZEX, 0x7C000194)                                                 \
-  /* Add to Zero Extended & record OV */                                       \
-  V(addzeo, ADDZEO, 0x7C000594)                                                \
-  /* Divide Word Format */                                                     \
-  V(divw, DIVW, 0x7C0003D6)                                                    \
-  /* Divide Word Extended */                                                   \
-  V(divwe, DIVWE, 0x7C000356)                                                  \
-  /* Divide Word Extended & record OV */                                       \
-  V(divweo, DIVWEO, 0x7C000756)                                                \
-  /* Divide Word Extended Unsigned */                                          \
-  V(divweu, DIVWEU, 0x7C000316)                                                \
-  /* Divide Word Extended Unsigned & record OV */                              \
-  V(divweuo, DIVWEUO, 0x7C000716)                                              \
-  /* Divide Word & record OV */                                                \
-  V(divwo, DIVWO, 0x7C0007D6)                                                  \
-  /* Divide Word Unsigned */                                                   \
-  V(divwu, DIVWU, 0x7C000396)                                                  \
-  /* Divide Word Unsigned & record OV */                                       \
-  V(divwuo, DIVWUO, 0x7C000796)                                                \
-  /* Multiply High Word */                                                     \
-  V(mulhw, MULHWX, 0x7C000096)                                                 \
-  /* Multiply High Word Unsigned */                                            \
-  V(mulhwu, MULHWUX, 0x7C000016)                                               \
-  /* Multiply Low Word */                                                      \
-  V(mullw, MULLW, 0x7C0001D6)                                                  \
-  /* Multiply Low Word & record OV */                                          \
-  V(mullwo, MULLWO, 0x7C0005D6)                                                \
-  /* Negate */                                                                 \
-  V(neg, NEGX, 0x7C0000D0)                                                     \
-  /* Negate & record OV */                                                     \
-  V(nego, NEGO, 0x7C0004D0)                                                    \
-  /* Subtract From */                                                          \
-  V(subf, SUBFX, 0x7C000050)                                                   \
-  /* Subtract From Carrying */                                                 \
-  V(subfc, SUBFCX, 0x7C000010)                                                 \
-  /* Subtract From Carrying & record OV */                                     \
-  V(subfco, SUBFCO, 0x7C000410)                                                \
-  /* Subtract From Extended */                                                 \
-  V(subfe, SUBFEX, 0x7C000110)                                                 \
-  /* Subtract From Extended & record OV */                                     \
-  V(subfeo, SUBFEO, 0x7C000510)                                                \
-  /* Subtract From Minus One Extended */                                       \
-  V(subfme, SUBFME, 0x7C0001D0)                                                \
-  /* Subtract From Minus One Extended & record OV */                           \
-  V(subfmeo, SUBFMEO, 0x7C0005D0)                                              \
-  /* Subtract From & record OV */                                              \
-  V(subfo, SUBFO, 0x7C000450)                                                  \
-  /* Subtract From Zero Extended */                                            \
-  V(subfze, SUBFZE, 0x7C000190)                                                \
-  /* Subtract From Zero Extended & record OV */                                \
-  V(subfzeo, SUBFZEO, 0x7C000590)                                              \
-  /* Add and Generate Sixes */                                                 \
-  V(addg, ADDG, 0x7C000094)                                                    \
-  /* Multiply Accumulate Cross Halfword to Word Modulo Signed */               \
-  V(macchw, MACCHW, 0x10000158)                                                \
-  /* Multiply Accumulate Cross Halfword to Word Saturate Signed */             \
-  V(macchws, MACCHWS, 0x100001D8)                                              \
-  /* Multiply Accumulate Cross Halfword to Word Saturate Unsigned */           \
-  V(macchwsu, MACCHWSU, 0x10000198)                                            \
-  /* Multiply Accumulate Cross Halfword to Word Modulo Unsigned */             \
-  V(macchwu, MACCHWU, 0x10000118)                                              \
-  /* Multiply Accumulate High Halfword to Word Modulo Signed */                \
-  V(machhw, MACHHW, 0x10000058)                                                \
-  /* Multiply Accumulate High Halfword to Word Saturate Signed */              \
-  V(machhws, MACHHWS, 0x100000D8)                                              \
-  /* Multiply Accumulate High Halfword to Word Saturate Unsigned */            \
-  V(machhwsu, MACHHWSU, 0x10000098)                                            \
-  /* Multiply Accumulate High Halfword to Word Modulo Unsigned */              \
-  V(machhwu, MACHHWU, 0x10000018)                                              \
-  /* Multiply Accumulate Low Halfword to Word Modulo Signed */                 \
-  V(maclhw, MACLHW, 0x10000358)                                                \
-  /* Multiply Accumulate Low Halfword to Word Saturate Signed */               \
-  V(maclhws, MACLHWS, 0x100003D8)                                              \
-  /* Multiply Accumulate Low Halfword to Word Saturate Unsigned */             \
-  V(maclhwsu, MACLHWSU, 0x10000398)                                            \
-  /* Multiply Accumulate Low Halfword to Word Modulo Unsigned */               \
-  V(maclhwu, MACLHWU, 0x10000318)                                              \
-  /* Negative Multiply Accumulate Cross Halfword to Word Modulo Signed */      \
-  V(nmacchw, NMACCHW, 0x1000015C)                                              \
-  /* Negative Multiply Accumulate Cross Halfword to Word Saturate Signed */    \
-  V(nmacchws, NMACCHWS, 0x100001DC)                                            \
-  /* Negative Multiply Accumulate High Halfword to Word Modulo Signed */       \
-  V(nmachhw, NMACHHW, 0x1000005C)                                              \
-  /* Negative Multiply Accumulate High Halfword to Word Saturate Signed */     \
-  V(nmachhws, NMACHHWS, 0x100000DC)                                            \
-  /* Negative Multiply Accumulate Low Halfword to Word Modulo Signed */        \
-  V(nmaclhw, NMACLHW, 0x1000035C)                                              \
-  /* Negative Multiply Accumulate Low Halfword to Word Saturate Signed */      \
-  V(nmaclhws, NMACLHWS, 0x100003DC)                                            \
-
-#define PPC_XL_OPCODE_LIST(V)                                                  \
-  /* Branch Conditional to Count Register */                                   \
-  V(bcctr, BCCTRX, 0x4C000420)                                                 \
-  /* Branch Conditional to Link Register */                                    \
-  V(bclr, BCLRX, 0x4C000020)                                                   \
-  /* Condition Register AND */                                                 \
-  V(crand, CRAND, 0x4C000202)                                                  \
-  /* Condition Register AND with Complement */                                 \
-  V(crandc, CRANDC, 0x4C000102)                                                \
-  /* Condition Register Equivalent */                                          \
-  V(creqv, CREQV, 0x4C000242)                                                  \
-  /* Condition Register NAND */                                                \
-  V(crnand, CRNAND, 0x4C0001C2)                                                \
-  /* Condition Register NOR */                                                 \
-  V(crnor, CRNOR, 0x4C000042)                                                  \
-  /* Condition Register OR */                                                  \
-  V(cror, CROR, 0x4C000382)                                                    \
-  /* Condition Register OR with Complement */                                  \
-  V(crorc, CRORC, 0x4C000342)                                                  \
-  /* Condition Register XOR */                                                 \
-  V(crxor, CRXOR, 0x4C000182)                                                  \
-  /* Instruction Synchronize */                                                \
-  V(isync, ISYNC, 0x4C00012C)                                                  \
-  /* Move Condition Register Field */                                          \
-  V(mcrf, MCRF, 0x4C000000)                                                    \
-  /* Return From Critical Interrupt */                                         \
-  V(rfci, RFCI, 0x4C000066)                                                    \
-  /* Return From Interrupt */                                                  \
-  V(rfi, RFI, 0x4C000064)                                                      \
-  /* Return From Machine Check Interrupt */                                    \
-  V(rfmci, RFMCI, 0x4C00004C)                                                  \
-  /* Embedded Hypervisor Privilege */                                          \
-  V(ehpriv, EHPRIV, 0x7C00021C)                                                \
-  /* Return From Guest Interrupt */                                            \
-  V(rfgi, RFGI, 0x4C0000CC)                                                    \
-  /* Doze */                                                                   \
-  V(doze, DOZE, 0x4C000324)                                                    \
-  /* Return From Interrupt Doubleword Hypervisor */                            \
-  V(hrfid, HRFID, 0x4C000224)                                                  \
-  /* Nap */                                                                    \
-  V(nap, NAP, 0x4C000364)                                                      \
-  /* Return from Event Based Branch */                                         \
-  V(rfebb, RFEBB, 0x4C000124)                                                  \
-  /* Return from Interrupt Doubleword */                                       \
-  V(rfid, RFID, 0x4C000024)                                                    \
-  /* Rip Van Winkle */                                                         \
-  V(rvwinkle, RVWINKLE, 0x4C0003E4)                                            \
-  /* Sleep */                                                                  \
-  V(sleep, SLEEP, 0x4C0003A4)
-
-#define PPC_XX4_OPCODE_LIST(V)                                                 \
-  /* VSX Select */                                                             \
-  V(xxsel, XXSEL, 0xF0000030)
-
-#define PPC_I_OPCODE_LIST(V)                                                   \
-  /* Branch */                                                                 \
-  V(b, BX, 0x48000000)
-
-#define PPC_M_OPCODE_LIST(V)                                                   \
-  /* Rotate Left Word Immediate then Mask Insert */                            \
-  V(rlwimi, RLWIMIX, 0x50000000)                                               \
-  /* Rotate Left Word Immediate then AND with Mask */                          \
-  V(rlwinm, RLWINMX, 0x54000000)                                               \
-  /* Rotate Left Word then AND with Mask */                                    \
-  V(rlwnm, RLWNMX, 0x5C000000)
-
-#define PPC_VX_OPCODE_LIST(V)                                                  \
-  /* Decimal Add Modulo */                                                     \
-  V(bcdadd, BCDADD, 0xF0000400)                                                \
-  /* Decimal Subtract Modulo */                                                \
-  V(bcdsub, BCDSUB, 0xF0000440)                                                \
-  /* Move From Vector Status and Control Register */                           \
-  V(mfvscr, MFVSCR, 0x10000604)                                                \
-  /* Move To Vector Status and Control Register */                             \
-  V(mtvscr, MTVSCR, 0x10000644)                                                \
-  /* Vector Add & write Carry Unsigned Quadword */                             \
-  V(vaddcuq, VADDCUQ, 0x10000140)                                              \
-  /* Vector Add and Write Carry-Out Unsigned Word */                           \
-  V(vaddcuw, VADDCUW, 0x10000180)                                              \
-  /* Vector Add Single-Precision */                                            \
-  V(vaddfp, VADDFP, 0x1000000A)                                                \
-  /* Vector Add Signed Byte Saturate */                                        \
-  V(vaddsbs, VADDSBS, 0x10000300)                                              \
-  /* Vector Add Signed Halfword Saturate */                                    \
-  V(vaddshs, VADDSHS, 0x10000340)                                              \
-  /* Vector Add Signed Word Saturate */                                        \
-  V(vaddsws, VADDSWS, 0x10000380)                                              \
-  /* Vector Add Unsigned Byte Modulo */                                        \
-  V(vaddubm, VADDUBM, 0x10000000)                                              \
-  /* Vector Add Unsigned Byte Saturate */                                      \
-  V(vaddubs, VADDUBS, 0x10000200)                                              \
-  /* Vector Add Unsigned Doubleword Modulo */                                  \
-  V(vaddudm, VADDUDM, 0x100000C0)                                              \
-  /* Vector Add Unsigned Halfword Modulo */                                    \
-  V(vadduhm, VADDUHM, 0x10000040)                                              \
-  /* Vector Add Unsigned Halfword Saturate */                                  \
-  V(vadduhs, VADDUHS, 0x10000240)                                              \
-  /* Vector Add Unsigned Quadword Modulo */                                    \
-  V(vadduqm, VADDUQM, 0x10000100)                                              \
-  /* Vector Add Unsigned Word Modulo */                                        \
-  V(vadduwm, VADDUWM, 0x10000080)                                              \
-  /* Vector Add Unsigned Word Saturate */                                      \
-  V(vadduws, VADDUWS, 0x10000280)                                              \
-  /* Vector Logical AND */                                                     \
-  V(vand, VAND, 0x10000404)                                                    \
-  /* Vector Logical AND with Complement */                                     \
-  V(vandc, VANDC, 0x10000444)                                                  \
-  /* Vector Average Signed Byte */                                             \
-  V(vavgsb, VAVGSB, 0x10000502)                                                \
-  /* Vector Average Signed Halfword */                                         \
-  V(vavgsh, VAVGSH, 0x10000542)                                                \
-  /* Vector Average Signed Word */                                             \
-  V(vavgsw, VAVGSW, 0x10000582)                                                \
-  /* Vector Average Unsigned Byte */                                           \
-  V(vavgub, VAVGUB, 0x10000402)                                                \
-  /* Vector Average Unsigned Halfword */                                       \
-  V(vavguh, VAVGUH, 0x10000442)                                                \
-  /* Vector Average Unsigned Word */                                           \
-  V(vavguw, VAVGUW, 0x10000482)                                                \
-  /* Vector Bit Permute Quadword */                                            \
-  V(vbpermq, VBPERMQ, 0x1000054C)                                              \
-  /* Vector Convert From Signed Fixed-Point Word To Single-Precision */        \
-  V(vcfsx, VCFSX, 0x1000034A)                                                  \
-  /* Vector Convert From Unsigned Fixed-Point Word To Single-Precision */      \
-  V(vcfux, VCFUX, 0x1000030A)                                                  \
-  /* Vector Count Leading Zeros Byte */                                        \
-  V(vclzb, VCLZB, 0x10000702)                                                  \
-  /* Vector Count Leading Zeros Doubleword */                                  \
-  V(vclzd, VCLZD, 0x100007C2)                                                  \
-  /* Vector Count Leading Zeros Halfword */                                    \
-  V(vclzh, VCLZH, 0x10000742)                                                  \
-  /* Vector Count Leading Zeros Word */                                        \
-  V(vclzw, VCLZW, 0x10000782)                                                  \
-  /* Vector Convert From Single-Precision To Signed Fixed-Point Word */        \
-  /* Saturate */                                                               \
-  V(vctsxs, VCTSXS, 0x100003CA)                                                \
-  /* Vector Convert From Single-Precision To Unsigned Fixed-Point Word */      \
-  /* Saturate */                                                               \
-  V(vctuxs, VCTUXS, 0x1000038A)                                                \
-  /* Vector Equivalence */                                                     \
-  V(veqv, VEQV, 0x10000684)                                                    \
-  /* Vector 2 Raised to the Exponent Estimate Single-Precision */              \
-  V(vexptefp, VEXPTEFP, 0x1000018A)                                            \
-  /* Vector Gather Bits by Byte by Doubleword */                               \
-  V(vgbbd, VGBBD, 0x1000050C)                                                  \
-  /* Vector Log Base 2 Estimate Single-Precision */                            \
-  V(vlogefp, VLOGEFP, 0x100001CA)                                              \
-  /* Vector Maximum Single-Precision */                                        \
-  V(vmaxfp, VMAXFP, 0x1000040A)                                                \
-  /* Vector Maximum Signed Byte */                                             \
-  V(vmaxsb, VMAXSB, 0x10000102)                                                \
-  /* Vector Maximum Signed Doubleword */                                       \
-  V(vmaxsd, VMAXSD, 0x100001C2)                                                \
-  /* Vector Maximum Signed Halfword */                                         \
-  V(vmaxsh, VMAXSH, 0x10000142)                                                \
-  /* Vector Maximum Signed Word */                                             \
-  V(vmaxsw, VMAXSW, 0x10000182)                                                \
-  /* Vector Maximum Unsigned Byte */                                           \
-  V(vmaxub, VMAXUB, 0x10000002)                                                \
-  /* Vector Maximum Unsigned Doubleword */                                     \
-  V(vmaxud, VMAXUD, 0x100000C2)                                                \
-  /* Vector Maximum Unsigned Halfword */                                       \
-  V(vmaxuh, VMAXUH, 0x10000042)                                                \
-  /* Vector Maximum Unsigned Word */                                           \
-  V(vmaxuw, VMAXUW, 0x10000082)                                                \
-  /* Vector Minimum Single-Precision */                                        \
-  V(vminfp, VMINFP, 0x1000044A)                                                \
-  /* Vector Minimum Signed Byte */                                             \
-  V(vminsb, VMINSB, 0x10000302)                                                \
-  /* Vector Minimum Signed Halfword */                                         \
-  V(vminsh, VMINSH, 0x10000342)                                                \
-  /* Vector Minimum Signed Word */                                             \
-  V(vminsw, VMINSW, 0x10000382)                                                \
-  /* Vector Minimum Unsigned Byte */                                           \
-  V(vminub, VMINUB, 0x10000202)                                                \
-  /* Vector Minimum Unsigned Doubleword */                                     \
-  V(vminud, VMINUD, 0x100002C2)                                                \
-  /* Vector Minimum Unsigned Halfword */                                       \
-  V(vminuh, VMINUH, 0x10000242)                                                \
-  /* Vector Minimum Unsigned Word */                                           \
-  V(vminuw, VMINUW, 0x10000282)                                                \
-  /* Vector Merge High Byte */                                                 \
-  V(vmrghb, VMRGHB, 0x1000000C)                                                \
-  /* Vector Merge High Halfword */                                             \
-  V(vmrghh, VMRGHH, 0x1000004C)                                                \
-  /* Vector Merge High Word */                                                 \
-  V(vmrghw, VMRGHW, 0x1000008C)                                                \
-  /* Vector Merge Low Byte */                                                  \
-  V(vmrglb, VMRGLB, 0x1000010C)                                                \
-  /* Vector Merge Low Halfword */                                              \
-  V(vmrglh, VMRGLH, 0x1000014C)                                                \
-  /* Vector Merge Low Word */                                                  \
-  V(vmrglw, VMRGLW, 0x1000018C)                                                \
-  /* Vector Multiply Even Signed Byte */                                       \
-  V(vmulesb, VMULESB, 0x10000308)                                              \
-  /* Vector Multiply Even Signed Halfword */                                   \
-  V(vmulesh, VMULESH, 0x10000348)                                              \
-  /* Vector Multiply Even Signed Word */                                       \
-  V(vmulesw, VMULESW, 0x10000388)                                              \
-  /* Vector Multiply Even Unsigned Byte */                                     \
-  V(vmuleub, VMULEUB, 0x10000208)                                              \
-  /* Vector Multiply Even Unsigned Halfword */                                 \
-  V(vmuleuh, VMULEUH, 0x10000248)                                              \
-  /* Vector Multiply Even Unsigned Word */                                     \
-  V(vmuleuw, VMULEUW, 0x10000288)                                              \
-  /* Vector Multiply Odd Signed Byte */                                        \
-  V(vmulosb, VMULOSB, 0x10000108)                                              \
-  /* Vector Multiply Odd Signed Halfword */                                    \
-  V(vmulosh, VMULOSH, 0x10000148)                                              \
-  /* Vector Multiply Odd Signed Word */                                        \
-  V(vmulosw, VMULOSW, 0x10000188)                                              \
-  /* Vector Multiply Odd Unsigned Byte */                                      \
-  V(vmuloub, VMULOUB, 0x10000008)                                              \
-  /* Vector Multiply Odd Unsigned Halfword */                                  \
-  V(vmulouh, VMULOUH, 0x10000048)                                              \
-  /* Vector Multiply Odd Unsigned Word */                                      \
-  V(vmulouw, VMULOUW, 0x10000088)                                              \
-  /* Vector Multiply Unsigned Word Modulo */                                   \
-  V(vmuluwm, VMULUWM, 0x10000089)                                              \
-  /* Vector NAND */                                                            \
-  V(vnand, VNAND, 0x10000584)                                                  \
-  /* Vector Logical NOR */                                                     \
-  V(vnor, VNOR, 0x10000504)                                                    \
-  /* Vector Logical OR */                                                      \
-  V(vor, VOR, 0x10000484)                                                      \
-  /* Vector OR with Complement */                                              \
-  V(vorc, VORC, 0x10000544)                                                    \
-  /* Vector Pack Pixel */                                                      \
-  V(vpkpx, VPKPX, 0x1000030E)                                                  \
-  /* Vector Pack Signed Doubleword Signed Saturate */                          \
-  V(vpksdss, VPKSDSS, 0x100005CE)                                              \
-  /* Vector Pack Signed Doubleword Unsigned Saturate */                        \
-  V(vpksdus, VPKSDUS, 0x1000054E)                                              \
-  /* Vector Pack Signed Halfword Signed Saturate */                            \
-  V(vpkshss, VPKSHSS, 0x1000018E)                                              \
-  /* Vector Pack Signed Halfword Unsigned Saturate */                          \
-  V(vpkshus, VPKSHUS, 0x1000010E)                                              \
-  /* Vector Pack Signed Word Signed Saturate */                                \
-  V(vpkswss, VPKSWSS, 0x100001CE)                                              \
-  /* Vector Pack Signed Word Unsigned Saturate */                              \
-  V(vpkswus, VPKSWUS, 0x1000014E)                                              \
-  /* Vector Pack Unsigned Doubleword Unsigned Modulo */                        \
-  V(vpkudum, VPKUDUM, 0x1000044E)                                              \
-  /* Vector Pack Unsigned Doubleword Unsigned Saturate */                      \
-  V(vpkudus, VPKUDUS, 0x100004CE)                                              \
-  /* Vector Pack Unsigned Halfword Unsigned Modulo */                          \
-  V(vpkuhum, VPKUHUM, 0x1000000E)                                              \
-  /* Vector Pack Unsigned Halfword Unsigned Saturate */                        \
-  V(vpkuhus, VPKUHUS, 0x1000008E)                                              \
-  /* Vector Pack Unsigned Word Unsigned Modulo */                              \
-  V(vpkuwum, VPKUWUM, 0x1000004E)                                              \
-  /* Vector Pack Unsigned Word Unsigned Saturate */                            \
-  V(vpkuwus, VPKUWUS, 0x100000CE)                                              \
-  /* Vector Polynomial Multiply-Sum Byte */                                    \
-  V(vpmsumb, VPMSUMB, 0x10000408)                                              \
-  /* Vector Polynomial Multiply-Sum Doubleword */                              \
-  V(vpmsumd, VPMSUMD, 0x100004C8)                                              \
-  /* Vector Polynomial Multiply-Sum Halfword */                                \
-  V(vpmsumh, VPMSUMH, 0x10000448)                                              \
-  /* Vector Polynomial Multiply-Sum Word */                                    \
-  V(vpmsumw, VPMSUMW, 0x10000488)                                              \
-  /* Vector Population Count Byte */                                           \
-  V(vpopcntb, VPOPCNTB, 0x10000703)                                            \
-  /* Vector Population Count Doubleword */                                     \
-  V(vpopcntd, VPOPCNTD, 0x100007C3)                                            \
-  /* Vector Population Count Halfword */                                       \
-  V(vpopcnth, VPOPCNTH, 0x10000743)                                            \
-  /* Vector Population Count Word */                                           \
-  V(vpopcntw, VPOPCNTW, 0x10000783)                                            \
-  /* Vector Reciprocal Estimate Single-Precision */                            \
-  V(vrefp, VREFP, 0x1000010A)                                                  \
-  /* Vector Round to Single-Precision Integer toward -Infinity */              \
-  V(vrfim, VRFIM, 0x100002CA)                                                  \
-  /* Vector Round to Single-Precision Integer Nearest */                       \
-  V(vrfin, VRFIN, 0x1000020A)                                                  \
-  /* Vector Round to Single-Precision Integer toward +Infinity */              \
-  V(vrfip, VRFIP, 0x1000028A)                                                  \
-  /* Vector Round to Single-Precision Integer toward Zero */                   \
-  V(vrfiz, VRFIZ, 0x1000024A)                                                  \
-  /* Vector Rotate Left Byte */                                                \
-  V(vrlb, VRLB, 0x10000004)                                                    \
-  /* Vector Rotate Left Doubleword */                                          \
-  V(vrld, VRLD, 0x100000C4)                                                    \
-  /* Vector Rotate Left Halfword */                                            \
-  V(vrlh, VRLH, 0x10000044)                                                    \
-  /* Vector Rotate Left Word */                                                \
-  V(vrlw, VRLW, 0x10000084)                                                    \
-  /* Vector Reciprocal Square Root Estimate Single-Precision */                \
-  V(vrsqrtefp, VRSQRTEFP, 0x1000014A)                                          \
-  /* Vector Shift Left */                                                      \
-  V(vsl, VSL, 0x100001C4)                                                      \
-  /* Vector Shift Left Byte */                                                 \
-  V(vslb, VSLB, 0x10000104)                                                    \
-  /* Vector Shift Left Doubleword */                                           \
-  V(vsld, VSLD, 0x100005C4)                                                    \
-  /* Vector Shift Left Halfword */                                             \
-  V(vslh, VSLH, 0x10000144)                                                    \
-  /* Vector Shift Left by Octet */                                             \
-  V(vslo, VSLO, 0x1000040C)                                                    \
-  /* Vector Shift Left Word */                                                 \
-  V(vslw, VSLW, 0x10000184)                                                    \
-  /* Vector Splat Byte */                                                      \
-  V(vspltb, VSPLTB, 0x1000020C)                                                \
-  /* Vector Splat Halfword */                                                  \
-  V(vsplth, VSPLTH, 0x1000024C)                                                \
-  /* Vector Splat Immediate Signed Byte */                                     \
-  V(vspltisb, VSPLTISB, 0x1000030C)                                            \
-  /* Vector Splat Immediate Signed Halfword */                                 \
-  V(vspltish, VSPLTISH, 0x1000034C)                                            \
-  /* Vector Splat Immediate Signed Word */                                     \
-  V(vspltisw, VSPLTISW, 0x1000038C)                                            \
-  /* Vector Splat Word */                                                      \
-  V(vspltw, VSPLTW, 0x1000028C)                                                \
-  /* Vector Shift Right */                                                     \
-  V(vsr, VSR, 0x100002C4)                                                      \
-  /* Vector Shift Right Algebraic Byte */                                      \
-  V(vsrab, VSRAB, 0x10000304)                                                  \
-  /* Vector Shift Right Algebraic Doubleword */                                \
-  V(vsrad, VSRAD, 0x100003C4)                                                  \
-  /* Vector Shift Right Algebraic Halfword */                                  \
-  V(vsrah, VSRAH, 0x10000344)                                                  \
-  /* Vector Shift Right Algebraic Word */                                      \
-  V(vsraw, VSRAW, 0x10000384)                                                  \
-  /* Vector Shift Right Byte */                                                \
-  V(vsrb, VSRB, 0x10000204)                                                    \
-  /* Vector Shift Right Doubleword */                                          \
-  V(vsrd, VSRD, 0x100006C4)                                                    \
-  /* Vector Shift Right Halfword */                                            \
-  V(vsrh, VSRH, 0x10000244)                                                    \
-  /* Vector Shift Right by Octet */                                            \
-  V(vsro, VSRO, 0x1000044C)                                                    \
-  /* Vector Shift Right Word */                                                \
-  V(vsrw, VSRW, 0x10000284)                                                    \
-  /* Vector Subtract & write Carry Unsigned Quadword */                        \
-  V(vsubcuq, VSUBCUQ, 0x10000540)                                              \
-  /* Vector Subtract and Write Carry-Out Unsigned Word */                      \
-  V(vsubcuw, VSUBCUW, 0x10000580)                                              \
-  /* Vector Subtract Single-Precision */                                       \
-  V(vsubfp, VSUBFP, 0x1000004A)                                                \
-  /* Vector Subtract Signed Byte Saturate */                                   \
-  V(vsubsbs, VSUBSBS, 0x10000700)                                              \
-  /* Vector Subtract Signed Halfword Saturate */                               \
-  V(vsubshs, VSUBSHS, 0x10000740)                                              \
-  /* Vector Subtract Signed Word Saturate */                                   \
-  V(vsubsws, VSUBSWS, 0x10000780)                                              \
-  /* Vector Subtract Unsigned Byte Modulo */                                   \
-  V(vsububm, VSUBUBM, 0x10000400)                                              \
-  /* Vector Subtract Unsigned Byte Saturate */                                 \
-  V(vsububs, VSUBUBS, 0x10000600)                                              \
-  /* Vector Subtract Unsigned Doubleword Modulo */                             \
-  V(vsubudm, VSUBUDM, 0x100004C0)                                              \
-  /* Vector Subtract Unsigned Halfword Modulo */                               \
-  V(vsubuhm, VSUBUHM, 0x10000440)                                              \
-  /* Vector Subtract Unsigned Halfword Saturate */                             \
-  V(vsubuhs, VSUBUHS, 0x10000640)                                              \
-  /* Vector Subtract Unsigned Quadword Modulo */                               \
-  V(vsubuqm, VSUBUQM, 0x10000500)                                              \
-  /* Vector Subtract Unsigned Word Modulo */                                   \
-  V(vsubuwm, VSUBUWM, 0x10000480)                                              \
-  /* Vector Subtract Unsigned Word Saturate */                                 \
-  V(vsubuws, VSUBUWS, 0x10000680)                                              \
-  /* Vector Sum across Half Signed Word Saturate */                            \
-  V(vsum2sws, VSUM2SWS, 0x10000688)                                            \
-  /* Vector Sum across Quarter Signed Byte Saturate */                         \
-  V(vsum4sbs, VSUM4SBS, 0x10000708)                                            \
-  /* Vector Sum across Quarter Signed Halfword Saturate */                     \
-  V(vsum4shs, VSUM4SHS, 0x10000648)                                            \
-  /* Vector Sum across Quarter Unsigned Byte Saturate */                       \
-  V(vsum4bus, VSUM4BUS, 0x10000608)                                            \
-  /* Vector Sum across Signed Word Saturate */                                 \
-  V(vsumsws, VSUMSWS, 0x10000788)                                              \
-  /* Vector Unpack High Pixel */                                               \
-  V(vupkhpx, VUPKHPX, 0x1000034E)                                              \
-  /* Vector Unpack High Signed Byte */                                         \
-  V(vupkhsb, VUPKHSB, 0x1000020E)                                              \
-  /* Vector Unpack High Signed Halfword */                                     \
-  V(vupkhsh, VUPKHSH, 0x1000024E)                                              \
-  /* Vector Unpack High Signed Word */                                         \
-  V(vupkhsw, VUPKHSW, 0x1000064E)                                              \
-  /* Vector Unpack Low Pixel */                                                \
-  V(vupklpx, VUPKLPX, 0x100003CE)                                              \
-  /* Vector Unpack Low Signed Byte */                                          \
-  V(vupklsb, VUPKLSB, 0x1000028E)                                              \
-  /* Vector Unpack Low Signed Halfword */                                      \
-  V(vupklsh, VUPKLSH, 0x100002CE)                                              \
-  /* Vector Unpack Low Signed Word */                                          \
-  V(vupklsw, VUPKLSW, 0x100006CE)                                              \
-  /* Vector Logical XOR */                                                     \
-  V(vxor, VXOR, 0x100004C4)                                                    \
-  /* Vector AES Cipher */                                                      \
-  V(vcipher, VCIPHER, 0x10000508)                                              \
-  /* Vector AES Cipher Last */                                                 \
-  V(vcipherlast, VCIPHERLAST, 0x10000509)                                      \
-  /* Vector AES Inverse Cipher */                                              \
-  V(vncipher, VNCIPHER, 0x10000548)                                            \
-  /* Vector AES Inverse Cipher Last */                                         \
-  V(vncipherlast, VNCIPHERLAST, 0x10000549)                                    \
-  /* Vector AES S-Box */                                                       \
-  V(vsbox, VSBOX, 0x100005C8)                                                  \
-  /* Vector SHA-512 Sigma Doubleword */                                        \
-  V(vshasigmad, VSHASIGMAD, 0x100006C2)                                        \
-  /* Vector SHA-256 Sigma Word */                                              \
-  V(vshasigmaw, VSHASIGMAW, 0x10000682)                                        \
-  /* Vector Merge Even Word */                                                 \
-  V(vmrgew, VMRGEW, 0x1000078C)                                                \
-  /* Vector Merge Odd Word */                                                  \
-  V(vmrgow, VMRGOW, 0x1000068C)
-
-#define PPC_XS_OPCODE_LIST(V)                                                  \
-  /* Shift Right Algebraic Doubleword Immediate */                             \
-  V(sradi, SRADIX, 0x7C000674)
-
-#define PPC_MD_OPCODE_LIST(V)                                                  \
-  /* Rotate Left Doubleword Immediate then Clear */                            \
-  V(rldic, RLDIC, 0x78000008)                                                  \
-  /* Rotate Left Doubleword Immediate then Clear Left */                       \
-  V(rldicl, RLDICL, 0x78000000)                                                \
-  /* Rotate Left Doubleword Immediate then Clear Right */                      \
-  V(rldicr, RLDICR, 0x78000004)                                                \
-  /* Rotate Left Doubleword Immediate then Mask Insert */                      \
-  V(rldimi, RLDIMI, 0x7800000C)
-
-#define PPC_SC_OPCODE_LIST(V)                                                  \
-  /* System Call */                                                            \
-  V(sc, SC, 0x44000002)
-
-#define PPC_OPCODE_LIST(V)       \
-  PPC_X_OPCODE_LIST(V)           \
-  PPC_X_OPCODE_EH_S_FORM_LIST(V) \
-  PPC_XO_OPCODE_LIST(V)          \
-  PPC_DS_OPCODE_LIST(V)          \
-  PPC_DQ_OPCODE_LIST(V)          \
-  PPC_MDS_OPCODE_LIST(V)         \
-  PPC_MD_OPCODE_LIST(V)          \
-  PPC_XS_OPCODE_LIST(V)          \
-  PPC_D_OPCODE_LIST(V)           \
-  PPC_I_OPCODE_LIST(V)           \
-  PPC_B_OPCODE_LIST(V)           \
-  PPC_XL_OPCODE_LIST(V)          \
-  PPC_A_OPCODE_LIST(V)           \
-  PPC_XFX_OPCODE_LIST(V)         \
-  PPC_M_OPCODE_LIST(V)           \
-  PPC_SC_OPCODE_LIST(V)          \
-  PPC_Z23_OPCODE_LIST(V)         \
-  PPC_Z22_OPCODE_LIST(V)         \
-  PPC_EVX_OPCODE_LIST(V)         \
-  PPC_XFL_OPCODE_LIST(V)         \
-  PPC_EVS_OPCODE_LIST(V)         \
-  PPC_VX_OPCODE_LIST(V)          \
-  PPC_VA_OPCODE_LIST(V)          \
-  PPC_VC_OPCODE_LIST(V)          \
-  PPC_XX1_OPCODE_LIST(V)         \
-  PPC_XX2_OPCODE_LIST(V)         \
-  PPC_XX3_OPCODE_LIST(V)         \
-  PPC_XX4_OPCODE_LIST(V)
-
-enum Opcode : uint32_t {
-#define DECLARE_INSTRUCTION(name, opcode_name, opcode_value)                   \
-  opcode_name = opcode_value,
-  PPC_OPCODE_LIST(DECLARE_INSTRUCTION)
-#undef DECLARE_INSTRUCTION
-  EXT1 = 0x4C000000,   // Extended code set 1
-  EXT2 = 0x7C000000,   // Extended code set 2
-  EXT3 = 0xEC000000,   // Extended code set 3
-  EXT4 = 0xFC000000,   // Extended code set 4
-  EXT5 = 0x78000000,   // Extended code set 5 - 64bit only
-  EXT6 = 0xF0000000,   // Extended code set 6
-};
-
-// Instruction encoding bits and masks.
-enum {
-  // Instruction encoding bit
-  B1 = 1 << 1,
-  B2 = 1 << 2,
-  B3 = 1 << 3,
-  B4 = 1 << 4,
-  B5 = 1 << 5,
-  B7 = 1 << 7,
-  B8 = 1 << 8,
-  B9 = 1 << 9,
-  B12 = 1 << 12,
-  B18 = 1 << 18,
-  B19 = 1 << 19,
-  B20 = 1 << 20,
-  B22 = 1 << 22,
-  B23 = 1 << 23,
-  B24 = 1 << 24,
-  B25 = 1 << 25,
-  B26 = 1 << 26,
-  B27 = 1 << 27,
-  B28 = 1 << 28,
-  B6 = 1 << 6,
-  B10 = 1 << 10,
-  B11 = 1 << 11,
-  B16 = 1 << 16,
-  B17 = 1 << 17,
-  B21 = 1 << 21,
-
-  // Instruction bit masks
-  kCondMask = 0x1F << 21,
-  kOff12Mask = (1 << 12) - 1,
-  kImm24Mask = (1 << 24) - 1,
-  kOff16Mask = (1 << 16) - 1,
-  kImm16Mask = (1 << 16) - 1,
-  kImm26Mask = (1 << 26) - 1,
-  kBOfieldMask = 0x1f << 21,
-  kOpcodeMask = 0x3f << 26,
-  kExt1OpcodeMask = 0x3ff << 1,
-  kExt2OpcodeMask = 0x3ff << 1,
-  kExt2OpcodeVariant2Mask = 0x1ff << 2,
-  kExt5OpcodeMask = 0x3 << 2,
-  kBOMask = 0x1f << 21,
-  kBIMask = 0x1F << 16,
-  kBDMask = 0x14 << 2,
-  kAAMask = 0x01 << 1,
-  kLKMask = 0x01,
-  kRCMask = 0x01,
-  kTOMask = 0x1f << 21
-};
-
-// -----------------------------------------------------------------------------
-// Addressing modes and instruction variants.
-
-// Overflow Exception
-enum OEBit {
-  SetOE = 1 << 10,   // Set overflow exception
-  LeaveOE = 0 << 10  // No overflow exception
-};
-
-// Record bit
-enum RCBit {   // Bit 0
-  SetRC = 1,   // LT,GT,EQ,SO
-  LeaveRC = 0  // None
-};
-// Exclusive Access hint bit
-enum EHBit {   // Bit 0
-  SetEH = 1,   // Exclusive Access
-  LeaveEH = 0  // Atomic Update
-};
-
-// Link bit
-enum LKBit {   // Bit 0
-  SetLK = 1,   // Load effective address of next instruction
-  LeaveLK = 0  // No action
-};
-
-enum BOfield {        // Bits 25-21
-  DCBNZF = 0 << 21,   // Decrement CTR; branch if CTR != 0 and condition false
-  DCBEZF = 2 << 21,   // Decrement CTR; branch if CTR == 0 and condition false
-  BF = 4 << 21,       // Branch if condition false
-  DCBNZT = 8 << 21,   // Decrement CTR; branch if CTR != 0 and condition true
-  DCBEZT = 10 << 21,  // Decrement CTR; branch if CTR == 0 and condition true
-  BT = 12 << 21,      // Branch if condition true
-  DCBNZ = 16 << 21,   // Decrement CTR; branch if CTR != 0
-  DCBEZ = 18 << 21,   // Decrement CTR; branch if CTR == 0
-  BA = 20 << 21       // Branch always
-};
-
-#if V8_OS_AIX
-#undef CR_LT
-#undef CR_GT
-#undef CR_EQ
-#undef CR_SO
-#endif
-
-enum CRBit { CR_LT = 0, CR_GT = 1, CR_EQ = 2, CR_SO = 3, CR_FU = 3 };
-
-#define CRWIDTH 4
-
-// These are the documented bit positions biased down by 32
-enum FPSCRBit {
-  VXSOFT = 21,  // 53: Software-Defined Condition
-  VXSQRT = 22,  // 54: Invalid Square Root
-  VXCVI = 23    // 55: Invalid Integer Convert
-};
-
-// -----------------------------------------------------------------------------
-// Supervisor Call (svc) specific support.
-
-// Special Software Interrupt codes when used in the presence of the PPC
-// simulator.
-// svc (formerly swi) provides a 24bit immediate value. Use bits 22:0 for
-// standard SoftwareInterrupCode. Bit 23 is reserved for the stop feature.
-enum SoftwareInterruptCodes {
-  // transition to C code
-  kCallRtRedirected = 0x10,
-  // break point
-  kBreakpoint = 0x821008,  // bits23-0 of 0x7d821008 = twge r2, r2
-  // stop
-  kStopCode = 1 << 23
-};
-const uint32_t kStopCodeMask = kStopCode - 1;
-const uint32_t kMaxStopCode = kStopCode - 1;
-const int32_t kDefaultStopCode = -1;
-
-// FP rounding modes.
-enum FPRoundingMode {
-  RN = 0,  // Round to Nearest.
-  RZ = 1,  // Round towards zero.
-  RP = 2,  // Round towards Plus Infinity.
-  RM = 3,  // Round towards Minus Infinity.
-
-  // Aliases.
-  kRoundToNearest = RN,
-  kRoundToZero = RZ,
-  kRoundToPlusInf = RP,
-  kRoundToMinusInf = RM
-};
-
-const uint32_t kFPRoundingModeMask = 3;
-
-enum CheckForInexactConversion {
-  kCheckForInexactConversion,
-  kDontCheckForInexactConversion
-};
-
-// -----------------------------------------------------------------------------
-// Specific instructions, constants, and masks.
-// These constants are declared in assembler-arm.cc, as they use named registers
-// and other constants.
-
-
-// add(sp, sp, 4) instruction (aka Pop())
-extern const Instr kPopInstruction;
-
-// str(r, MemOperand(sp, 4, NegPreIndex), al) instruction (aka push(r))
-// register r is not encoded.
-extern const Instr kPushRegPattern;
-
-// ldr(r, MemOperand(sp, 4, PostIndex), al) instruction (aka pop(r))
-// register r is not encoded.
-extern const Instr kPopRegPattern;
-
-// use TWI to indicate redirection call for simulation mode
-const Instr rtCallRedirInstr = TWI;
-
-// -----------------------------------------------------------------------------
-// Instruction abstraction.
-
-// The class Instruction enables access to individual fields defined in the PPC
-// architecture instruction set encoding.
-// Note that the Assembler uses typedef int32_t Instr.
-//
-// Example: Test whether the instruction at ptr does set the condition code
-// bits.
-//
-// bool InstructionSetsConditionCodes(byte* ptr) {
-//   Instruction* instr = Instruction::At(ptr);
-//   int type = instr->TypeValue();
-//   return ((type == 0) || (type == 1)) && instr->HasS();
-// }
-//
-class Instruction {
- public:
-  enum { kInstrSize = 4, kInstrSizeLog2 = 2, kPCReadOffset = 8 };
-
-// Helper macro to define static accessors.
-// We use the cast to char* trick to bypass the strict anti-aliasing rules.
-#define DECLARE_STATIC_TYPED_ACCESSOR(return_type, Name) \
-  static inline return_type Name(Instr instr) {          \
-    char* temp = reinterpret_cast<char*>(&instr);        \
-    return reinterpret_cast<Instruction*>(temp)->Name(); \
-  }
-
-#define DECLARE_STATIC_ACCESSOR(Name) DECLARE_STATIC_TYPED_ACCESSOR(int, Name)
-
-  // Get the raw instruction bits.
-  inline Instr InstructionBits() const {
-    return *reinterpret_cast<const Instr*>(this);
-  }
-
-  // Set the raw instruction bits to value.
-  inline void SetInstructionBits(Instr value) {
-    *reinterpret_cast<Instr*>(this) = value;
-  }
-
-  // Read one particular bit out of the instruction bits.
-  inline int Bit(int nr) const { return (InstructionBits() >> nr) & 1; }
-
-  // Read a bit field's value out of the instruction bits.
-  inline int Bits(int hi, int lo) const {
-    return (InstructionBits() >> lo) & ((2 << (hi - lo)) - 1);
-  }
-
-  // Read a bit field out of the instruction bits.
-  inline uint32_t BitField(int hi, int lo) const {
-    return InstructionBits() & (((2 << (hi - lo)) - 1) << lo);
-  }
-
-  // Static support.
-
-  // Read one particular bit out of the instruction bits.
-  static inline int Bit(Instr instr, int nr) { return (instr >> nr) & 1; }
-
-  // Read the value of a bit field out of the instruction bits.
-  static inline int Bits(Instr instr, int hi, int lo) {
-    return (instr >> lo) & ((2 << (hi - lo)) - 1);
-  }
-
-
-  // Read a bit field out of the instruction bits.
-  static inline uint32_t BitField(Instr instr, int hi, int lo) {
-    return instr & (((2 << (hi - lo)) - 1) << lo);
-  }
-
-  inline int RSValue() const { return Bits(25, 21); }
-  inline int RTValue() const { return Bits(25, 21); }
-  inline int RAValue() const { return Bits(20, 16); }
-  DECLARE_STATIC_ACCESSOR(RAValue);
-  inline int RBValue() const { return Bits(15, 11); }
-  DECLARE_STATIC_ACCESSOR(RBValue);
-  inline int RCValue() const { return Bits(10, 6); }
-  DECLARE_STATIC_ACCESSOR(RCValue);
-
-  inline int OpcodeValue() const { return static_cast<Opcode>(Bits(31, 26)); }
-  inline uint32_t OpcodeField() const {
-    return static_cast<Opcode>(BitField(31, 26));
-  }
-
-#define OPCODE_CASES(name, opcode_name, opcode_value) \
-  case opcode_name:
-
-  inline Opcode OpcodeBase() const {
-    uint32_t opcode = OpcodeField();
-    uint32_t extcode = OpcodeField();
-    switch (opcode) {
-      PPC_D_OPCODE_LIST(OPCODE_CASES)
-      PPC_I_OPCODE_LIST(OPCODE_CASES)
-      PPC_B_OPCODE_LIST(OPCODE_CASES)
-      PPC_M_OPCODE_LIST(OPCODE_CASES)
-        return static_cast<Opcode>(opcode);
-    }
-
-    opcode = extcode | BitField(10, 0);
-    switch (opcode) {
-      PPC_VX_OPCODE_LIST(OPCODE_CASES)
-      PPC_X_OPCODE_EH_S_FORM_LIST(OPCODE_CASES)
-      return static_cast<Opcode>(opcode);
-    }
-    opcode = extcode | BitField(9, 0);
-    switch (opcode) {
-      PPC_VC_OPCODE_LIST(OPCODE_CASES)
-        return static_cast<Opcode>(opcode);
-    }
-    opcode = extcode | BitField(10, 1) | BitField(20, 20);
-    switch (opcode) {
-      PPC_XFX_OPCODE_LIST(OPCODE_CASES)
-        return static_cast<Opcode>(opcode);
-    }
-    opcode = extcode | BitField(10, 1);
-    switch (opcode) {
-      PPC_X_OPCODE_LIST(OPCODE_CASES)
-      PPC_XL_OPCODE_LIST(OPCODE_CASES)
-      PPC_XFL_OPCODE_LIST(OPCODE_CASES)
-      PPC_XX1_OPCODE_LIST(OPCODE_CASES)
-      PPC_XX2_OPCODE_LIST(OPCODE_CASES)
-      PPC_EVX_OPCODE_LIST(OPCODE_CASES)
-        return static_cast<Opcode>(opcode);
-    }
-    opcode = extcode | BitField(9, 1);
-    switch (opcode) {
-      PPC_XO_OPCODE_LIST(OPCODE_CASES)
-      PPC_Z22_OPCODE_LIST(OPCODE_CASES)
-        return static_cast<Opcode>(opcode);
-    }
-    opcode = extcode | BitField(10, 2);
-    switch (opcode) {
-      PPC_XS_OPCODE_LIST(OPCODE_CASES)
-        return static_cast<Opcode>(opcode);
-    }
-    opcode = extcode | BitField(10, 3);
-    switch (opcode) {
-      PPC_EVS_OPCODE_LIST(OPCODE_CASES)
-      PPC_XX3_OPCODE_LIST(OPCODE_CASES)
-        return static_cast<Opcode>(opcode);
-    }
-    opcode = extcode | BitField(8, 1);
-    switch (opcode) {
-      PPC_Z23_OPCODE_LIST(OPCODE_CASES)
-        return static_cast<Opcode>(opcode);
-     }
-    opcode = extcode | BitField(5, 0);
-    switch (opcode) {
-      PPC_VA_OPCODE_LIST(OPCODE_CASES)
-        return static_cast<Opcode>(opcode);
-    }
-    opcode = extcode | BitField(5, 1);
-    switch (opcode) {
-      PPC_A_OPCODE_LIST(OPCODE_CASES)
-        return static_cast<Opcode>(opcode);
-    }
-    opcode = extcode | BitField(4, 1);
-    switch (opcode) {
-      PPC_MDS_OPCODE_LIST(OPCODE_CASES)
-        return static_cast<Opcode>(opcode);
-    }
-    opcode = extcode | BitField(4, 2);
-    switch (opcode) {
-      PPC_MD_OPCODE_LIST(OPCODE_CASES)
-        return static_cast<Opcode>(opcode);
-    }
-    opcode = extcode | BitField(5, 4);
-    switch (opcode) {
-      PPC_XX4_OPCODE_LIST(OPCODE_CASES)
-        return static_cast<Opcode>(opcode);
-    }
-    opcode = extcode | BitField(2, 0);
-    switch (opcode) {
-      PPC_DQ_OPCODE_LIST(OPCODE_CASES)
-        return static_cast<Opcode>(opcode);
-    }
-    opcode = extcode | BitField(1, 0);
-    switch (opcode) {
-      PPC_DS_OPCODE_LIST(OPCODE_CASES)
-        return static_cast<Opcode>(opcode);
-    }
-    opcode = extcode | BitField(1, 1);
-    switch (opcode) {
-      PPC_SC_OPCODE_LIST(OPCODE_CASES)
-        return static_cast<Opcode>(opcode);
-    }
-    UNIMPLEMENTED();
-    return static_cast<Opcode>(0);
-  }
-
-#undef OPCODE_CASES
-
-  // Fields used in Software interrupt instructions
-  inline SoftwareInterruptCodes SvcValue() const {
-    return static_cast<SoftwareInterruptCodes>(Bits(23, 0));
-  }
-
-  // Instructions are read of out a code stream. The only way to get a
-  // reference to an instruction is to convert a pointer. There is no way
-  // to allocate or create instances of class Instruction.
-  // Use the At(pc) function to create references to Instruction.
-  static Instruction* At(byte* pc) {
-    return reinterpret_cast<Instruction*>(pc);
-  }
-
-
- private:
-  // We need to prevent the creation of instances of class Instruction.
-  DISALLOW_IMPLICIT_CONSTRUCTORS(Instruction);
-};
-
-
-// Helper functions for converting between register numbers and names.
-class Registers {
- public:
-  // Lookup the register number for the name provided.
-  static int Number(const char* name);
-
- private:
-  static const char* names_[kNumRegisters];
-};
-
-// Helper functions for converting between FP register numbers and names.
-class DoubleRegisters {
- public:
-  // Lookup the register number for the name provided.
-  static int Number(const char* name);
-
- private:
-  static const char* names_[kNumDoubleRegisters];
-};
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_PPC_CONSTANTS_PPC_H_
diff --git a/src/v8/src/ppc/cpu-ppc.cc b/src/v8/src/ppc/cpu-ppc.cc
deleted file mode 100644
index 91ea400..0000000
--- a/src/v8/src/ppc/cpu-ppc.cc
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// CPU specific code for ppc independent of OS goes here.
-
-#if V8_TARGET_ARCH_PPC
-
-#include "src/assembler.h"
-#include "src/macro-assembler.h"
-
-namespace v8 {
-namespace internal {
-
-void CpuFeatures::FlushICache(void* buffer, size_t size) {
-#if !defined(USE_SIMULATOR)
-  if (CpuFeatures::IsSupported(INSTR_AND_DATA_CACHE_COHERENCY)) {
-    __asm__ __volatile__(
-        "sync \n"
-        "icbi 0, %0  \n"
-        "isync  \n"
-        : /* no output */
-        : "r"(buffer)
-        : "memory");
-    return;
-  }
-
-  const int kCacheLineSize = CpuFeatures::icache_line_size();
-  intptr_t mask = kCacheLineSize - 1;
-  byte *start =
-      reinterpret_cast<byte *>(reinterpret_cast<intptr_t>(buffer) & ~mask);
-  byte *end = static_cast<byte *>(buffer) + size;
-  for (byte *pointer = start; pointer < end; pointer += kCacheLineSize) {
-    __asm__(
-        "dcbf 0, %0  \n"
-        "sync        \n"
-        "icbi 0, %0  \n"
-        "isync       \n"
-        : /* no output */
-        : "r"(pointer));
-  }
-
-#endif  // !USE_SIMULATOR
-}
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_PPC
diff --git a/src/v8/src/ppc/deoptimizer-ppc.cc b/src/v8/src/ppc/deoptimizer-ppc.cc
deleted file mode 100644
index caa1a24..0000000
--- a/src/v8/src/ppc/deoptimizer-ppc.cc
+++ /dev/null
@@ -1,269 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/assembler-inl.h"
-#include "src/deoptimizer.h"
-#include "src/register-configuration.h"
-#include "src/safepoint-table.h"
-
-namespace v8 {
-namespace internal {
-
-const int Deoptimizer::table_entry_size_ = 8;
-
-#define __ masm()->
-
-// This code tries to be close to ia32 code so that any changes can be
-// easily ported.
-void Deoptimizer::TableEntryGenerator::Generate() {
-  GeneratePrologue();
-
-  // Unlike on ARM we don't save all the registers, just the useful ones.
-  // For the rest, there are gaps on the stack, so the offsets remain the same.
-  const int kNumberOfRegisters = Register::kNumRegisters;
-
-  RegList restored_regs = kJSCallerSaved | kCalleeSaved;
-  RegList saved_regs = restored_regs | sp.bit();
-
-  const int kDoubleRegsSize = kDoubleSize * DoubleRegister::kNumRegisters;
-  const int kFloatRegsSize = kFloatSize * FloatRegister::kNumRegisters;
-
-  // Save all double registers before messing with them.
-  __ subi(sp, sp, Operand(kDoubleRegsSize));
-  const RegisterConfiguration* config = RegisterConfiguration::Default();
-  for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
-    int code = config->GetAllocatableDoubleCode(i);
-    const DoubleRegister dreg = DoubleRegister::from_code(code);
-    int offset = code * kDoubleSize;
-    __ stfd(dreg, MemOperand(sp, offset));
-  }
-  // Save all float registers before messing with them.
-  __ subi(sp, sp, Operand(kFloatRegsSize));
-  for (int i = 0; i < config->num_allocatable_float_registers(); ++i) {
-    int code = config->GetAllocatableFloatCode(i);
-    const FloatRegister freg = FloatRegister::from_code(code);
-    int offset = code * kFloatSize;
-    __ stfs(freg, MemOperand(sp, offset));
-  }
-
-  // Push saved_regs (needed to populate FrameDescription::registers_).
-  // Leave gaps for other registers.
-  __ subi(sp, sp, Operand(kNumberOfRegisters * kPointerSize));
-  for (int16_t i = kNumberOfRegisters - 1; i >= 0; i--) {
-    if ((saved_regs & (1 << i)) != 0) {
-      __ StoreP(ToRegister(i), MemOperand(sp, kPointerSize * i));
-    }
-  }
-
-  __ mov(ip, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress,
-                                       isolate())));
-  __ StoreP(fp, MemOperand(ip));
-
-  const int kSavedRegistersAreaSize =
-      (kNumberOfRegisters * kPointerSize) + kDoubleRegsSize + kFloatRegsSize;
-
-  // Get the bailout id from the stack.
-  __ LoadP(r5, MemOperand(sp, kSavedRegistersAreaSize));
-
-  // Get the address of the location in the code object (r6) (return
-  // address for lazy deoptimization) and compute the fp-to-sp delta in
-  // register r7.
-  __ mflr(r6);
-  // Correct one word for bailout id.
-  __ addi(r7, sp, Operand(kSavedRegistersAreaSize + (1 * kPointerSize)));
-  __ sub(r7, fp, r7);
-
-  // Allocate a new deoptimizer object.
-  // Pass six arguments in r3 to r8.
-  __ PrepareCallCFunction(6, r8);
-  __ li(r3, Operand::Zero());
-  Label context_check;
-  __ LoadP(r4, MemOperand(fp, CommonFrameConstants::kContextOrFrameTypeOffset));
-  __ JumpIfSmi(r4, &context_check);
-  __ LoadP(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
-  __ bind(&context_check);
-  __ li(r4, Operand(type()));  // bailout type,
-  // r5: bailout id already loaded.
-  // r6: code address or 0 already loaded.
-  // r7: Fp-to-sp delta.
-  __ mov(r8, Operand(ExternalReference::isolate_address(isolate())));
-  // Call Deoptimizer::New().
-  {
-    AllowExternalCallThatCantCauseGC scope(masm());
-    __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate()), 6);
-  }
-
-  // Preserve "deoptimizer" object in register r3 and get the input
-  // frame descriptor pointer to r4 (deoptimizer->input_);
-  __ LoadP(r4, MemOperand(r3, Deoptimizer::input_offset()));
-
-  // Copy core registers into FrameDescription::registers_[kNumRegisters].
-  DCHECK_EQ(Register::kNumRegisters, kNumberOfRegisters);
-  for (int i = 0; i < kNumberOfRegisters; i++) {
-    int offset = (i * kPointerSize) + FrameDescription::registers_offset();
-    __ LoadP(r5, MemOperand(sp, i * kPointerSize));
-    __ StoreP(r5, MemOperand(r4, offset));
-  }
-
-  int double_regs_offset = FrameDescription::double_registers_offset();
-  // Copy double registers to
-  // double_registers_[DoubleRegister::kNumRegisters]
-  for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
-    int code = config->GetAllocatableDoubleCode(i);
-    int dst_offset = code * kDoubleSize + double_regs_offset;
-    int src_offset =
-        code * kDoubleSize + kNumberOfRegisters * kPointerSize + kFloatRegsSize;
-    __ lfd(d0, MemOperand(sp, src_offset));
-    __ stfd(d0, MemOperand(r4, dst_offset));
-  }
-  int float_regs_offset = FrameDescription::float_registers_offset();
-  // Copy float registers to
-  // float_registers_[FloatRegister::kNumRegisters]
-  for (int i = 0; i < config->num_allocatable_float_registers(); ++i) {
-    int code = config->GetAllocatableFloatCode(i);
-    int dst_offset = code * kFloatSize + float_regs_offset;
-    int src_offset = code * kFloatSize + kNumberOfRegisters * kPointerSize;
-    __ lfs(d0, MemOperand(sp, src_offset));
-    __ stfs(d0, MemOperand(r4, dst_offset));
-  }
-  // Remove the bailout id and the saved registers from the stack.
-  __ addi(sp, sp, Operand(kSavedRegistersAreaSize + (1 * kPointerSize)));
-
-  // Compute a pointer to the unwinding limit in register r5; that is
-  // the first stack slot not part of the input frame.
-  __ LoadP(r5, MemOperand(r4, FrameDescription::frame_size_offset()));
-  __ add(r5, r5, sp);
-
-  // Unwind the stack down to - but not including - the unwinding
-  // limit and copy the contents of the activation frame to the input
-  // frame description.
-  __ addi(r6, r4, Operand(FrameDescription::frame_content_offset()));
-  Label pop_loop;
-  Label pop_loop_header;
-  __ b(&pop_loop_header);
-  __ bind(&pop_loop);
-  __ pop(r7);
-  __ StoreP(r7, MemOperand(r6, 0));
-  __ addi(r6, r6, Operand(kPointerSize));
-  __ bind(&pop_loop_header);
-  __ cmp(r5, sp);
-  __ bne(&pop_loop);
-
-  // Compute the output frame in the deoptimizer.
-  __ push(r3);  // Preserve deoptimizer object across call.
-  // r3: deoptimizer object; r4: scratch.
-  __ PrepareCallCFunction(1, r4);
-  // Call Deoptimizer::ComputeOutputFrames().
-  {
-    AllowExternalCallThatCantCauseGC scope(masm());
-    __ CallCFunction(
-        ExternalReference::compute_output_frames_function(isolate()), 1);
-  }
-  __ pop(r3);  // Restore deoptimizer object (class Deoptimizer).
-
-  __ LoadP(sp, MemOperand(r3, Deoptimizer::caller_frame_top_offset()));
-
-  // Replace the current (input) frame with the output frames.
-  Label outer_push_loop, inner_push_loop, outer_loop_header, inner_loop_header;
-  // Outer loop state: r7 = current "FrameDescription** output_",
-  // r4 = one past the last FrameDescription**.
-  __ lwz(r4, MemOperand(r3, Deoptimizer::output_count_offset()));
-  __ LoadP(r7, MemOperand(r3, Deoptimizer::output_offset()));  // r7 is output_.
-  __ ShiftLeftImm(r4, r4, Operand(kPointerSizeLog2));
-  __ add(r4, r7, r4);
-  __ b(&outer_loop_header);
-
-  __ bind(&outer_push_loop);
-  // Inner loop state: r5 = current FrameDescription*, r6 = loop index.
-  __ LoadP(r5, MemOperand(r7, 0));  // output_[ix]
-  __ LoadP(r6, MemOperand(r5, FrameDescription::frame_size_offset()));
-  __ b(&inner_loop_header);
-
-  __ bind(&inner_push_loop);
-  __ addi(r6, r6, Operand(-sizeof(intptr_t)));
-  __ add(r9, r5, r6);
-  __ LoadP(r9, MemOperand(r9, FrameDescription::frame_content_offset()));
-  __ push(r9);
-
-  __ bind(&inner_loop_header);
-  __ cmpi(r6, Operand::Zero());
-  __ bne(&inner_push_loop);  // test for gt?
-
-  __ addi(r7, r7, Operand(kPointerSize));
-  __ bind(&outer_loop_header);
-  __ cmp(r7, r4);
-  __ blt(&outer_push_loop);
-
-  __ LoadP(r4, MemOperand(r3, Deoptimizer::input_offset()));
-  for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
-    int code = config->GetAllocatableDoubleCode(i);
-    const DoubleRegister dreg = DoubleRegister::from_code(code);
-    int src_offset = code * kDoubleSize + double_regs_offset;
-    __ lfd(dreg, MemOperand(r4, src_offset));
-  }
-
-  // Push pc, and continuation from the last output frame.
-  __ LoadP(r9, MemOperand(r5, FrameDescription::pc_offset()));
-  __ push(r9);
-  __ LoadP(r9, MemOperand(r5, FrameDescription::continuation_offset()));
-  __ push(r9);
-
-  // Restore the registers from the last output frame.
-  DCHECK(!(ip.bit() & restored_regs));
-  __ mr(ip, r5);
-  for (int i = kNumberOfRegisters - 1; i >= 0; i--) {
-    int offset = (i * kPointerSize) + FrameDescription::registers_offset();
-    if ((restored_regs & (1 << i)) != 0) {
-      __ LoadP(ToRegister(i), MemOperand(ip, offset));
-    }
-  }
-
-  __ InitializeRootRegister();
-
-  __ pop(ip);  // get continuation, leave pc on stack
-  __ pop(r0);
-  __ mtlr(r0);
-  __ Jump(ip);
-  __ stop("Unreachable.");
-}
-
-
-void Deoptimizer::TableEntryGenerator::GeneratePrologue() {
-  Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm());
-
-  // Create a sequence of deoptimization entries.
-  // Note that registers are still live when jumping to an entry.
-  Label done;
-  for (int i = 0; i < count(); i++) {
-    int start = masm()->pc_offset();
-    USE(start);
-    __ li(ip, Operand(i));
-    __ b(&done);
-    DCHECK(masm()->pc_offset() - start == table_entry_size_);
-  }
-  __ bind(&done);
-  __ push(ip);
-}
-
-bool Deoptimizer::PadTopOfStackRegister() { return false; }
-
-void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) {
-  SetFrameSlot(offset, value);
-}
-
-
-void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) {
-  SetFrameSlot(offset, value);
-}
-
-
-void FrameDescription::SetCallerConstantPool(unsigned offset, intptr_t value) {
-  DCHECK(FLAG_enable_embedded_constant_pool);
-  SetFrameSlot(offset, value);
-}
-
-
-#undef __
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/ppc/disasm-ppc.cc b/src/v8/src/ppc/disasm-ppc.cc
deleted file mode 100644
index 7e962e7..0000000
--- a/src/v8/src/ppc/disasm-ppc.cc
+++ /dev/null
@@ -1,1548 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// A Disassembler object is used to disassemble a block of code instruction by
-// instruction. The default implementation of the NameConverter object can be
-// overriden to modify register names or to do symbol lookup on addresses.
-//
-// The example below will disassemble a block of code and print it to stdout.
-//
-//   NameConverter converter;
-//   Disassembler d(converter);
-//   for (byte* pc = begin; pc < end;) {
-//     v8::internal::EmbeddedVector<char, 256> buffer;
-//     byte* prev_pc = pc;
-//     pc += d.InstructionDecode(buffer, pc);
-//     printf("%p    %08x      %s\n",
-//            prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer);
-//   }
-//
-// The Disassembler class also has a convenience method to disassemble a block
-// of code into a FILE*, meaning that the above functionality could also be
-// achieved by just calling Disassembler::Disassemble(stdout, begin, end);
-
-
-#include <assert.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <string.h>
-
-#if V8_TARGET_ARCH_PPC
-
-#include "src/base/platform/platform.h"
-#include "src/disasm.h"
-#include "src/macro-assembler.h"
-#include "src/ppc/constants-ppc.h"
-
-
-namespace v8 {
-namespace internal {
-
-const auto GetRegConfig = RegisterConfiguration::Default;
-
-//------------------------------------------------------------------------------
-
-// Decoder decodes and disassembles instructions into an output buffer.
-// It uses the converter to convert register names and call destinations into
-// more informative description.
-class Decoder {
- public:
-  Decoder(const disasm::NameConverter& converter, Vector<char> out_buffer)
-      : converter_(converter), out_buffer_(out_buffer), out_buffer_pos_(0) {
-    out_buffer_[out_buffer_pos_] = '\0';
-  }
-
-  ~Decoder() {}
-
-  // Writes one disassembled instruction into 'buffer' (0-terminated).
-  // Returns the length of the disassembled machine instruction in bytes.
-  int InstructionDecode(byte* instruction);
-
- private:
-  // Bottleneck functions to print into the out_buffer.
-  void PrintChar(const char ch);
-  void Print(const char* str);
-
-  // Printing of common values.
-  void PrintRegister(int reg);
-  void PrintDRegister(int reg);
-  int FormatFPRegister(Instruction* instr, const char* format);
-  void PrintSoftwareInterrupt(SoftwareInterruptCodes svc);
-
-  // Handle formatting of instructions and their options.
-  int FormatRegister(Instruction* instr, const char* option);
-  int FormatOption(Instruction* instr, const char* option);
-  void Format(Instruction* instr, const char* format);
-  void Unknown(Instruction* instr);
-  void UnknownFormat(Instruction* instr, const char* opcname);
-
-  void DecodeExt1(Instruction* instr);
-  void DecodeExt2(Instruction* instr);
-  void DecodeExt3(Instruction* instr);
-  void DecodeExt4(Instruction* instr);
-  void DecodeExt5(Instruction* instr);
-  void DecodeExt6(Instruction* instr);
-
-  const disasm::NameConverter& converter_;
-  Vector<char> out_buffer_;
-  int out_buffer_pos_;
-
-  DISALLOW_COPY_AND_ASSIGN(Decoder);
-};
-
-
-// Support for assertions in the Decoder formatting functions.
-#define STRING_STARTS_WITH(string, compare_string) \
-  (strncmp(string, compare_string, strlen(compare_string)) == 0)
-
-
-// Append the ch to the output buffer.
-void Decoder::PrintChar(const char ch) { out_buffer_[out_buffer_pos_++] = ch; }
-
-
-// Append the str to the output buffer.
-void Decoder::Print(const char* str) {
-  char cur = *str++;
-  while (cur != '\0' && (out_buffer_pos_ < (out_buffer_.length() - 1))) {
-    PrintChar(cur);
-    cur = *str++;
-  }
-  out_buffer_[out_buffer_pos_] = 0;
-}
-
-
-// Print the register name according to the active name converter.
-void Decoder::PrintRegister(int reg) {
-  Print(converter_.NameOfCPURegister(reg));
-}
-
-
-// Print the double FP register name according to the active name converter.
-void Decoder::PrintDRegister(int reg) {
-  Print(GetRegConfig()->GetDoubleRegisterName(reg));
-}
-
-
-// Print SoftwareInterrupt codes. Factoring this out reduces the complexity of
-// the FormatOption method.
-void Decoder::PrintSoftwareInterrupt(SoftwareInterruptCodes svc) {
-  switch (svc) {
-    case kCallRtRedirected:
-      Print("call rt redirected");
-      return;
-    case kBreakpoint:
-      Print("breakpoint");
-      return;
-    default:
-      if (svc >= kStopCode) {
-        out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d - 0x%x",
-                                    svc & kStopCodeMask, svc & kStopCodeMask);
-      } else {
-        out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", svc);
-      }
-      return;
-  }
-}
-
-
-// Handle all register based formatting in this function to reduce the
-// complexity of FormatOption.
-int Decoder::FormatRegister(Instruction* instr, const char* format) {
-  DCHECK_EQ(format[0], 'r');
-
-  if ((format[1] == 't') || (format[1] == 's')) {  // 'rt & 'rs register
-    int reg = instr->RTValue();
-    PrintRegister(reg);
-    return 2;
-  } else if (format[1] == 'a') {  // 'ra: RA register
-    int reg = instr->RAValue();
-    PrintRegister(reg);
-    return 2;
-  } else if (format[1] == 'b') {  // 'rb: RB register
-    int reg = instr->RBValue();
-    PrintRegister(reg);
-    return 2;
-  }
-
-  UNREACHABLE();
-}
-
-
-// Handle all FP register based formatting in this function to reduce the
-// complexity of FormatOption.
-int Decoder::FormatFPRegister(Instruction* instr, const char* format) {
-  DCHECK_EQ(format[0], 'D');
-
-  int retval = 2;
-  int reg = -1;
-  if (format[1] == 't') {
-    reg = instr->RTValue();
-  } else if (format[1] == 'a') {
-    reg = instr->RAValue();
-  } else if (format[1] == 'b') {
-    reg = instr->RBValue();
-  } else if (format[1] == 'c') {
-    reg = instr->RCValue();
-  } else {
-    UNREACHABLE();
-  }
-
-  PrintDRegister(reg);
-
-  return retval;
-}
-
-
-// FormatOption takes a formatting string and interprets it based on
-// the current instructions. The format string points to the first
-// character of the option string (the option escape has already been
-// consumed by the caller.)  FormatOption returns the number of
-// characters that were consumed from the formatting string.
-int Decoder::FormatOption(Instruction* instr, const char* format) {
-  switch (format[0]) {
-    case 'o': {
-      if (instr->Bit(10) == 1) {
-        Print("o");
-      }
-      return 1;
-    }
-    case '.': {
-      if (instr->Bit(0) == 1) {
-        Print(".");
-      } else {
-        Print(" ");  // ensure consistent spacing
-      }
-      return 1;
-    }
-    case 'r': {
-      return FormatRegister(instr, format);
-    }
-    case 'D': {
-      return FormatFPRegister(instr, format);
-    }
-    case 'i': {  // int16
-      int32_t value = (instr->Bits(15, 0) << 16) >> 16;
-      out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
-      return 5;
-    }
-    case 'u': {  // uint16
-      int32_t value = instr->Bits(15, 0);
-      out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
-      return 6;
-    }
-    case 'l': {
-      // Link (LK) Bit 0
-      if (instr->Bit(0) == 1) {
-        Print("l");
-      }
-      return 1;
-    }
-    case 'a': {
-      // Absolute Address Bit 1
-      if (instr->Bit(1) == 1) {
-        Print("a");
-      }
-      return 1;
-    }
-    case 'c': {  // 'cr: condition register of branch instruction
-      int code = instr->Bits(20, 18);
-      if (code != 7) {
-        out_buffer_pos_ +=
-            SNPrintF(out_buffer_ + out_buffer_pos_, " cr%d", code);
-      }
-      return 2;
-    }
-    case 't': {  // 'target: target of branch instructions
-      // target26 or target16
-      DCHECK(STRING_STARTS_WITH(format, "target"));
-      if ((format[6] == '2') && (format[7] == '6')) {
-        int off = ((instr->Bits(25, 2)) << 8) >> 6;
-        out_buffer_pos_ += SNPrintF(
-            out_buffer_ + out_buffer_pos_, "%+d -> %s", off,
-            converter_.NameOfAddress(reinterpret_cast<byte*>(instr) + off));
-        return 8;
-      } else if ((format[6] == '1') && (format[7] == '6')) {
-        int off = ((instr->Bits(15, 2)) << 18) >> 16;
-        out_buffer_pos_ += SNPrintF(
-            out_buffer_ + out_buffer_pos_, "%+d -> %s", off,
-            converter_.NameOfAddress(reinterpret_cast<byte*>(instr) + off));
-        return 8;
-      }
-      case 's': {
-        DCHECK_EQ(format[1], 'h');
-        int32_t value = 0;
-        int32_t opcode = instr->OpcodeValue() << 26;
-        int32_t sh = instr->Bits(15, 11);
-        if (opcode == EXT5 ||
-            (opcode == EXT2 && instr->Bits(10, 2) << 2 == SRADIX)) {
-          // SH Bits 1 and 15-11 (split field)
-          value = (sh | (instr->Bit(1) << 5));
-        } else {
-          // SH Bits 15-11
-          value = (sh << 26) >> 26;
-        }
-        out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
-        return 2;
-      }
-      case 'm': {
-        int32_t value = 0;
-        if (format[1] == 'e') {
-          if (instr->OpcodeValue() << 26 != EXT5) {
-            // ME Bits 10-6
-            value = (instr->Bits(10, 6) << 26) >> 26;
-          } else {
-            // ME Bits 5 and 10-6 (split field)
-            value = (instr->Bits(10, 6) | (instr->Bit(5) << 5));
-          }
-        } else if (format[1] == 'b') {
-          if (instr->OpcodeValue() << 26 != EXT5) {
-            // MB Bits 5-1
-            value = (instr->Bits(5, 1) << 26) >> 26;
-          } else {
-            // MB Bits 5 and 10-6 (split field)
-            value = (instr->Bits(10, 6) | (instr->Bit(5) << 5));
-          }
-        } else {
-          UNREACHABLE();  // bad format
-        }
-        out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
-        return 2;
-      }
-    }
-#if V8_TARGET_ARCH_PPC64
-    case 'd': {  // ds value for offset
-      int32_t value = SIGN_EXT_IMM16(instr->Bits(15, 0) & ~3);
-      out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
-      return 1;
-    }
-#endif
-    default: {
-      UNREACHABLE();
-      break;
-    }
-  }
-
-  UNREACHABLE();
-}
-
-
-// Format takes a formatting string for a whole instruction and prints it into
-// the output buffer. All escaped options are handed to FormatOption to be
-// parsed further.
-void Decoder::Format(Instruction* instr, const char* format) {
-  char cur = *format++;
-  while ((cur != 0) && (out_buffer_pos_ < (out_buffer_.length() - 1))) {
-    if (cur == '\'') {  // Single quote is used as the formatting escape.
-      format += FormatOption(instr, format);
-    } else {
-      out_buffer_[out_buffer_pos_++] = cur;
-    }
-    cur = *format++;
-  }
-  out_buffer_[out_buffer_pos_] = '\0';
-}
-
-
-// The disassembler may end up decoding data inlined in the code. We do not want
-// it to crash if the data does not resemble any known instruction.
-#define VERIFY(condition) \
-  if (!(condition)) {     \
-    Unknown(instr);       \
-    return;               \
-  }
-
-
-// For currently unimplemented decodings the disassembler calls Unknown(instr)
-// which will just print "unknown" of the instruction bits.
-void Decoder::Unknown(Instruction* instr) { Format(instr, "unknown"); }
-
-
-// For currently unimplemented decodings the disassembler calls
-// UnknownFormat(instr) which will just print opcode name of the
-// instruction bits.
-void Decoder::UnknownFormat(Instruction* instr, const char* name) {
-  char buffer[100];
-  snprintf(buffer, sizeof(buffer), "%s (unknown-format)", name);
-  Format(instr, buffer);
-}
-
-
-void Decoder::DecodeExt1(Instruction* instr) {
-  switch (EXT1 | (instr->BitField(10, 1))) {
-    case MCRF: {
-      UnknownFormat(instr, "mcrf");  // not used by V8
-      break;
-    }
-    case BCLRX: {
-      int bo = instr->BitField(25, 21);
-      int bi = instr->Bits(20, 16);
-      CRBit cond = static_cast<CRBit>(bi & (CRWIDTH - 1));
-      switch (bo) {
-        case DCBNZF: {
-          UnknownFormat(instr, "bclrx-dcbnzf");
-          break;
-        }
-        case DCBEZF: {
-          UnknownFormat(instr, "bclrx-dcbezf");
-          break;
-        }
-        case BF: {
-          switch (cond) {
-            case CR_EQ:
-              Format(instr, "bnelr'l'cr");
-              break;
-            case CR_GT:
-              Format(instr, "blelr'l'cr");
-              break;
-            case CR_LT:
-              Format(instr, "bgelr'l'cr");
-              break;
-            case CR_SO:
-              Format(instr, "bnsolr'l'cr");
-              break;
-          }
-          break;
-        }
-        case DCBNZT: {
-          UnknownFormat(instr, "bclrx-dcbbzt");
-          break;
-        }
-        case DCBEZT: {
-          UnknownFormat(instr, "bclrx-dcbnezt");
-          break;
-        }
-        case BT: {
-          switch (cond) {
-            case CR_EQ:
-              Format(instr, "beqlr'l'cr");
-              break;
-            case CR_GT:
-              Format(instr, "bgtlr'l'cr");
-              break;
-            case CR_LT:
-              Format(instr, "bltlr'l'cr");
-              break;
-            case CR_SO:
-              Format(instr, "bsolr'l'cr");
-              break;
-          }
-          break;
-        }
-        case DCBNZ: {
-          UnknownFormat(instr, "bclrx-dcbnz");
-          break;
-        }
-        case DCBEZ: {
-          UnknownFormat(instr, "bclrx-dcbez");  // not used by V8
-          break;
-        }
-        case BA: {
-          Format(instr, "blr'l");
-          break;
-        }
-      }
-      break;
-    }
-    case BCCTRX: {
-      switch (instr->BitField(25, 21)) {
-        case DCBNZF: {
-          UnknownFormat(instr, "bcctrx-dcbnzf");
-          break;
-        }
-        case DCBEZF: {
-          UnknownFormat(instr, "bcctrx-dcbezf");
-          break;
-        }
-        case BF: {
-          UnknownFormat(instr, "bcctrx-bf");
-          break;
-        }
-        case DCBNZT: {
-          UnknownFormat(instr, "bcctrx-dcbnzt");
-          break;
-        }
-        case DCBEZT: {
-          UnknownFormat(instr, "bcctrx-dcbezf");
-          break;
-        }
-        case BT: {
-          UnknownFormat(instr, "bcctrx-bt");
-          break;
-        }
-        case DCBNZ: {
-          UnknownFormat(instr, "bcctrx-dcbnz");
-          break;
-        }
-        case DCBEZ: {
-          UnknownFormat(instr, "bcctrx-dcbez");
-          break;
-        }
-        case BA: {
-          if (instr->Bit(0) == 1) {
-            Format(instr, "bctrl");
-          } else {
-            Format(instr, "bctr");
-          }
-          break;
-        }
-        default: { UNREACHABLE(); }
-      }
-      break;
-    }
-    case CRNOR: {
-      Format(instr, "crnor (stuff)");
-      break;
-    }
-    case RFI: {
-      Format(instr, "rfi (stuff)");
-      break;
-    }
-    case CRANDC: {
-      Format(instr, "crandc (stuff)");
-      break;
-    }
-    case ISYNC: {
-      Format(instr, "isync (stuff)");
-      break;
-    }
-    case CRXOR: {
-      Format(instr, "crxor (stuff)");
-      break;
-    }
-    case CRNAND: {
-      UnknownFormat(instr, "crnand");
-      break;
-    }
-    case CRAND: {
-      UnknownFormat(instr, "crand");
-      break;
-    }
-    case CREQV: {
-      UnknownFormat(instr, "creqv");
-      break;
-    }
-    case CRORC: {
-      UnknownFormat(instr, "crorc");
-      break;
-    }
-    case CROR: {
-      UnknownFormat(instr, "cror");
-      break;
-    }
-    default: {
-      Unknown(instr);  // not used by V8
-    }
-  }
-}
-
-
-void Decoder::DecodeExt2(Instruction* instr) {
-  // Some encodings are 10-1 bits, handle those first
-  switch (EXT2 | (instr->BitField(10, 1))) {
-    case SRWX: {
-      Format(instr, "srw'.    'ra, 'rs, 'rb");
-      return;
-    }
-#if V8_TARGET_ARCH_PPC64
-    case SRDX: {
-      Format(instr, "srd'.    'ra, 'rs, 'rb");
-      return;
-    }
-#endif
-    case SRAW: {
-      Format(instr, "sraw'.   'ra, 'rs, 'rb");
-      return;
-    }
-#if V8_TARGET_ARCH_PPC64
-    case SRAD: {
-      Format(instr, "srad'.   'ra, 'rs, 'rb");
-      return;
-    }
-#endif
-    case SYNC: {
-      Format(instr, "sync");
-      return;
-    }
-    case MODSW: {
-      Format(instr, "modsw  'rt, 'ra, 'rb");
-      return;
-    }
-    case MODUW: {
-      Format(instr, "moduw  'rt, 'ra, 'rb");
-      return;
-    }
-#if V8_TARGET_ARCH_PPC64
-    case MODSD: {
-      Format(instr, "modsd  'rt, 'ra, 'rb");
-      return;
-    }
-    case MODUD: {
-      Format(instr, "modud  'rt, 'ra, 'rb");
-      return;
-    }
-#endif
-    case SRAWIX: {
-      Format(instr, "srawi'.  'ra,'rs,'sh");
-      return;
-    }
-    case EXTSH: {
-      Format(instr, "extsh'.  'ra, 'rs");
-      return;
-    }
-#if V8_TARGET_ARCH_PPC64
-    case EXTSW: {
-      Format(instr, "extsw'.  'ra, 'rs");
-      return;
-    }
-#endif
-    case EXTSB: {
-      Format(instr, "extsb'.  'ra, 'rs");
-      return;
-    }
-    case LFSX: {
-      Format(instr, "lfsx    'Dt, 'ra, 'rb");
-      return;
-    }
-    case LFSUX: {
-      Format(instr, "lfsux   'Dt, 'ra, 'rb");
-      return;
-    }
-    case LFDX: {
-      Format(instr, "lfdx    'Dt, 'ra, 'rb");
-      return;
-    }
-    case LFDUX: {
-      Format(instr, "lfdux   'Dt, 'ra, 'rb");
-      return;
-    }
-    case STFSX: {
-      Format(instr, "stfsx    'rs, 'ra, 'rb");
-      return;
-    }
-    case STFSUX: {
-      Format(instr, "stfsux   'rs, 'ra, 'rb");
-      return;
-    }
-    case STFDX: {
-      Format(instr, "stfdx    'rs, 'ra, 'rb");
-      return;
-    }
-    case STFDUX: {
-      Format(instr, "stfdux   'rs, 'ra, 'rb");
-      return;
-    }
-    case POPCNTW: {
-      Format(instr, "popcntw  'ra, 'rs");
-      return;
-    }
-#if V8_TARGET_ARCH_PPC64
-    case POPCNTD: {
-      Format(instr, "popcntd  'ra, 'rs");
-      return;
-    }
-#endif
-  }
-
-  switch (EXT2 | (instr->BitField(10, 2))) {
-    case SRADIX: {
-      Format(instr, "sradi'.  'ra,'rs,'sh");
-      return;
-    }
-  }
-
-  switch (EXT2 | (instr->BitField(10, 0))) {
-    case STBCX: {
-      Format(instr, "stbcx   'rs, 'ra, 'rb");
-      return;
-    }
-    case STHCX: {
-      Format(instr, "sthcx   'rs, 'ra, 'rb");
-      return;
-    }
-    case STWCX: {
-      Format(instr, "stwcx   'rs, 'ra, 'rb");
-      return;
-    }
-  }
-
-  // ?? are all of these xo_form?
-  switch (EXT2 | (instr->BitField(9, 1))) {
-    case CMP: {
-#if V8_TARGET_ARCH_PPC64
-      if (instr->Bit(21)) {
-#endif
-        Format(instr, "cmp     'ra, 'rb");
-#if V8_TARGET_ARCH_PPC64
-      } else {
-        Format(instr, "cmpw    'ra, 'rb");
-      }
-#endif
-      return;
-    }
-    case SLWX: {
-      Format(instr, "slw'.   'ra, 'rs, 'rb");
-      return;
-    }
-#if V8_TARGET_ARCH_PPC64
-    case SLDX: {
-      Format(instr, "sld'.   'ra, 'rs, 'rb");
-      return;
-    }
-#endif
-    case SUBFCX: {
-      Format(instr, "subfc'. 'rt, 'ra, 'rb");
-      return;
-    }
-    case SUBFEX: {
-      Format(instr, "subfe'. 'rt, 'ra, 'rb");
-      return;
-    }
-    case ADDCX: {
-      Format(instr, "addc'.   'rt, 'ra, 'rb");
-      return;
-    }
-    case ADDEX: {
-      Format(instr, "adde'.   'rt, 'ra, 'rb");
-      return;
-    }
-    case CNTLZWX: {
-      Format(instr, "cntlzw'. 'ra, 'rs");
-      return;
-    }
-#if V8_TARGET_ARCH_PPC64
-    case CNTLZDX: {
-      Format(instr, "cntlzd'. 'ra, 'rs");
-      return;
-    }
-#endif
-    case ANDX: {
-      Format(instr, "and'.    'ra, 'rs, 'rb");
-      return;
-    }
-    case ANDCX: {
-      Format(instr, "andc'.   'ra, 'rs, 'rb");
-      return;
-    }
-    case CMPL: {
-#if V8_TARGET_ARCH_PPC64
-      if (instr->Bit(21)) {
-#endif
-        Format(instr, "cmpl    'ra, 'rb");
-#if V8_TARGET_ARCH_PPC64
-      } else {
-        Format(instr, "cmplw   'ra, 'rb");
-      }
-#endif
-      return;
-    }
-    case NEGX: {
-      Format(instr, "neg'.    'rt, 'ra");
-      return;
-    }
-    case NORX: {
-      Format(instr, "nor'.    'rt, 'ra, 'rb");
-      return;
-    }
-    case SUBFX: {
-      Format(instr, "subf'.   'rt, 'ra, 'rb");
-      return;
-    }
-    case MULHWX: {
-      Format(instr, "mulhw'o'.  'rt, 'ra, 'rb");
-      return;
-    }
-    case ADDZEX: {
-      Format(instr, "addze'.   'rt, 'ra");
-      return;
-    }
-    case MULLW: {
-      Format(instr, "mullw'o'.  'rt, 'ra, 'rb");
-      return;
-    }
-#if V8_TARGET_ARCH_PPC64
-    case MULLD: {
-      Format(instr, "mulld'o'.  'rt, 'ra, 'rb");
-      return;
-    }
-#endif
-    case DIVW: {
-      Format(instr, "divw'o'.   'rt, 'ra, 'rb");
-      return;
-    }
-    case DIVWU: {
-      Format(instr, "divwu'o'.  'rt, 'ra, 'rb");
-      return;
-    }
-#if V8_TARGET_ARCH_PPC64
-    case DIVD: {
-      Format(instr, "divd'o'.   'rt, 'ra, 'rb");
-      return;
-    }
-#endif
-    case ADDX: {
-      Format(instr, "add'o     'rt, 'ra, 'rb");
-      return;
-    }
-    case XORX: {
-      Format(instr, "xor'.    'ra, 'rs, 'rb");
-      return;
-    }
-    case ORX: {
-      if (instr->RTValue() == instr->RBValue()) {
-        Format(instr, "mr      'ra, 'rb");
-      } else {
-        Format(instr, "or      'ra, 'rs, 'rb");
-      }
-      return;
-    }
-    case MFSPR: {
-      int spr = instr->Bits(20, 11);
-      if (256 == spr) {
-        Format(instr, "mflr    'rt");
-      } else {
-        Format(instr, "mfspr   'rt ??");
-      }
-      return;
-    }
-    case MTSPR: {
-      int spr = instr->Bits(20, 11);
-      if (256 == spr) {
-        Format(instr, "mtlr    'rt");
-      } else if (288 == spr) {
-        Format(instr, "mtctr   'rt");
-      } else {
-        Format(instr, "mtspr   'rt ??");
-      }
-      return;
-    }
-    case MFCR: {
-      Format(instr, "mfcr    'rt");
-      return;
-    }
-    case STWX: {
-      Format(instr, "stwx    'rs, 'ra, 'rb");
-      return;
-    }
-    case STWUX: {
-      Format(instr, "stwux   'rs, 'ra, 'rb");
-      return;
-    }
-    case STBX: {
-      Format(instr, "stbx    'rs, 'ra, 'rb");
-      return;
-    }
-    case STBUX: {
-      Format(instr, "stbux   'rs, 'ra, 'rb");
-      return;
-    }
-    case STHX: {
-      Format(instr, "sthx    'rs, 'ra, 'rb");
-      return;
-    }
-    case STHUX: {
-      Format(instr, "sthux   'rs, 'ra, 'rb");
-      return;
-    }
-    case LWZX: {
-      Format(instr, "lwzx    'rt, 'ra, 'rb");
-      return;
-    }
-    case LWZUX: {
-      Format(instr, "lwzux   'rt, 'ra, 'rb");
-      return;
-    }
-    case LWAX: {
-      Format(instr, "lwax    'rt, 'ra, 'rb");
-      return;
-    }
-    case LBZX: {
-      Format(instr, "lbzx    'rt, 'ra, 'rb");
-      return;
-    }
-    case LBZUX: {
-      Format(instr, "lbzux   'rt, 'ra, 'rb");
-      return;
-    }
-    case LHZX: {
-      Format(instr, "lhzx    'rt, 'ra, 'rb");
-      return;
-    }
-    case LHZUX: {
-      Format(instr, "lhzux   'rt, 'ra, 'rb");
-      return;
-    }
-    case LHAX: {
-      Format(instr, "lhax    'rt, 'ra, 'rb");
-      return;
-    }
-    case LBARX: {
-      Format(instr, "lbarx   'rt, 'ra, 'rb");
-      return;
-    }
-    case LHARX: {
-      Format(instr, "lharx   'rt, 'ra, 'rb");
-      return;
-    }
-    case LWARX: {
-      Format(instr, "lwarx   'rt, 'ra, 'rb");
-      return;
-    }
-#if V8_TARGET_ARCH_PPC64
-    case LDX: {
-      Format(instr, "ldx     'rt, 'ra, 'rb");
-      return;
-    }
-    case LDUX: {
-      Format(instr, "ldux    'rt, 'ra, 'rb");
-      return;
-    }
-    case STDX: {
-      Format(instr, "stdx    'rt, 'ra, 'rb");
-      return;
-    }
-    case STDUX: {
-      Format(instr, "stdux   'rt, 'ra, 'rb");
-      return;
-    }
-    case MFVSRD: {
-      Format(instr, "mffprd  'ra, 'Dt");
-      return;
-    }
-    case MFVSRWZ: {
-      Format(instr, "mffprwz 'ra, 'Dt");
-      return;
-    }
-    case MTVSRD: {
-      Format(instr, "mtfprd  'Dt, 'ra");
-      return;
-    }
-    case MTVSRWA: {
-      Format(instr, "mtfprwa 'Dt, 'ra");
-      return;
-    }
-    case MTVSRWZ: {
-      Format(instr, "mtfprwz 'Dt, 'ra");
-      return;
-    }
-#endif
-  }
-
-  switch (EXT2 | (instr->BitField(5, 1))) {
-    case ISEL: {
-      Format(instr, "isel    'rt, 'ra, 'rb");
-      return;
-    }
-    default: {
-      Unknown(instr);  // not used by V8
-    }
-  }
-}
-
-
-void Decoder::DecodeExt3(Instruction* instr) {
-  switch (EXT3 | (instr->BitField(10, 1))) {
-    case FCFID: {
-      Format(instr, "fcfids'. 'Dt, 'Db");
-      break;
-    }
-    case FCFIDU: {
-      Format(instr, "fcfidus'.'Dt, 'Db");
-      break;
-    }
-    default: {
-      Unknown(instr);  // not used by V8
-    }
-  }
-}
-
-
-void Decoder::DecodeExt4(Instruction* instr) {
-  switch (EXT4 | (instr->BitField(5, 1))) {
-    case FDIV: {
-      Format(instr, "fdiv'.   'Dt, 'Da, 'Db");
-      return;
-    }
-    case FSUB: {
-      Format(instr, "fsub'.   'Dt, 'Da, 'Db");
-      return;
-    }
-    case FADD: {
-      Format(instr, "fadd'.   'Dt, 'Da, 'Db");
-      return;
-    }
-    case FSQRT: {
-      Format(instr, "fsqrt'.  'Dt, 'Db");
-      return;
-    }
-    case FSEL: {
-      Format(instr, "fsel'.   'Dt, 'Da, 'Dc, 'Db");
-      return;
-    }
-    case FMUL: {
-      Format(instr, "fmul'.   'Dt, 'Da, 'Dc");
-      return;
-    }
-    case FMSUB: {
-      Format(instr, "fmsub'.  'Dt, 'Da, 'Dc, 'Db");
-      return;
-    }
-    case FMADD: {
-      Format(instr, "fmadd'.  'Dt, 'Da, 'Dc, 'Db");
-      return;
-    }
-  }
-
-  switch (EXT4 | (instr->BitField(10, 1))) {
-    case FCMPU: {
-      Format(instr, "fcmpu   'Da, 'Db");
-      break;
-    }
-    case FRSP: {
-      Format(instr, "frsp'.   'Dt, 'Db");
-      break;
-    }
-    case FCFID: {
-      Format(instr, "fcfid'.  'Dt, 'Db");
-      break;
-    }
-    case FCFIDU: {
-      Format(instr, "fcfidu'. 'Dt, 'Db");
-      break;
-    }
-    case FCTID: {
-      Format(instr, "fctid   'Dt, 'Db");
-      break;
-    }
-    case FCTIDZ: {
-      Format(instr, "fctidz  'Dt, 'Db");
-      break;
-    }
-    case FCTIDU: {
-      Format(instr, "fctidu  'Dt, 'Db");
-      break;
-    }
-    case FCTIDUZ: {
-      Format(instr, "fctiduz 'Dt, 'Db");
-      break;
-    }
-    case FCTIW: {
-      Format(instr, "fctiw'. 'Dt, 'Db");
-      break;
-    }
-    case FCTIWZ: {
-      Format(instr, "fctiwz'. 'Dt, 'Db");
-      break;
-    }
-    case FMR: {
-      Format(instr, "fmr'.    'Dt, 'Db");
-      break;
-    }
-    case MTFSFI: {
-      Format(instr, "mtfsfi'.  ?,?");
-      break;
-    }
-    case MFFS: {
-      Format(instr, "mffs'.   'Dt");
-      break;
-    }
-    case MTFSF: {
-      Format(instr, "mtfsf'.  'Db ?,?,?");
-      break;
-    }
-    case FABS: {
-      Format(instr, "fabs'.   'Dt, 'Db");
-      break;
-    }
-    case FRIN: {
-      Format(instr, "frin.   'Dt, 'Db");
-      break;
-    }
-    case FRIZ: {
-      Format(instr, "friz.   'Dt, 'Db");
-      break;
-    }
-    case FRIP: {
-      Format(instr, "frip.   'Dt, 'Db");
-      break;
-    }
-    case FRIM: {
-      Format(instr, "frim.   'Dt, 'Db");
-      break;
-    }
-    case FNEG: {
-      Format(instr, "fneg'.   'Dt, 'Db");
-      break;
-    }
-    case MCRFS: {
-      Format(instr, "mcrfs   ?,?");
-      break;
-    }
-    case MTFSB0: {
-      Format(instr, "mtfsb0'. ?");
-      break;
-    }
-    case MTFSB1: {
-      Format(instr, "mtfsb1'. ?");
-      break;
-    }
-    default: {
-      Unknown(instr);  // not used by V8
-    }
-  }
-}
-
-
-void Decoder::DecodeExt5(Instruction* instr) {
-  switch (EXT5 | (instr->BitField(4, 2))) {
-    case RLDICL: {
-      Format(instr, "rldicl'. 'ra, 'rs, 'sh, 'mb");
-      return;
-    }
-    case RLDICR: {
-      Format(instr, "rldicr'. 'ra, 'rs, 'sh, 'me");
-      return;
-    }
-    case RLDIC: {
-      Format(instr, "rldic'.  'ra, 'rs, 'sh, 'mb");
-      return;
-    }
-    case RLDIMI: {
-      Format(instr, "rldimi'. 'ra, 'rs, 'sh, 'mb");
-      return;
-    }
-  }
-  switch (EXT5 | (instr->BitField(4, 1))) {
-    case RLDCL: {
-      Format(instr, "rldcl'.  'ra, 'rs, 'sb, 'mb");
-      return;
-    }
-  }
-  Unknown(instr);  // not used by V8
-}
-
-void Decoder::DecodeExt6(Instruction* instr) {
-  switch (EXT6 | (instr->BitField(10, 3))) {
-#define DECODE_XX3_INSTRUCTIONS(name, opcode_name, opcode_value) \
-  case opcode_name: {                                            \
-    Format(instr, #name" 'Dt, 'Da, 'Db");                        \
-    return;                                                      \
-  }
-    PPC_XX3_OPCODE_LIST(DECODE_XX3_INSTRUCTIONS)
-#undef DECODE_XX3_INSTRUCTIONS
-  }
-  switch (EXT6 | (instr->BitField(10, 2))) {
-#define DECODE_XX2_INSTRUCTIONS(name, opcode_name, opcode_value) \
-  case opcode_name: {                                            \
-    Format(instr, #name" 'Dt, 'Db");                             \
-    return;                                                      \
-  }
-    PPC_XX2_OPCODE_LIST(DECODE_XX2_INSTRUCTIONS)
-  }
-#undef DECODE_XX3_INSTRUCTIONS
-  Unknown(instr);  // not used by V8
-}
-
-#undef VERIFIY
-
-// Disassemble the instruction at *instr_ptr into the output buffer.
-int Decoder::InstructionDecode(byte* instr_ptr) {
-  Instruction* instr = Instruction::At(instr_ptr);
-  // Print raw instruction bytes.
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%08x       ",
-                              instr->InstructionBits());
-
-  if (ABI_USES_FUNCTION_DESCRIPTORS && instr->InstructionBits() == 0) {
-    // The first field will be identified as a jump table entry.  We
-    // emit the rest of the structure as zero, so just skip past them.
-    Format(instr, "constant");
-    return Instruction::kInstrSize;
-  }
-
-  uint32_t opcode = instr->OpcodeValue() << 26;
-  switch (opcode) {
-    case TWI: {
-      PrintSoftwareInterrupt(instr->SvcValue());
-      break;
-    }
-    case MULLI: {
-      UnknownFormat(instr, "mulli");
-      break;
-    }
-    case SUBFIC: {
-      Format(instr, "subfic  'rt, 'ra, 'int16");
-      break;
-    }
-    case CMPLI: {
-#if V8_TARGET_ARCH_PPC64
-      if (instr->Bit(21)) {
-#endif
-        Format(instr, "cmpli   'ra, 'uint16");
-#if V8_TARGET_ARCH_PPC64
-      } else {
-        Format(instr, "cmplwi  'ra, 'uint16");
-      }
-#endif
-      break;
-    }
-    case CMPI: {
-#if V8_TARGET_ARCH_PPC64
-      if (instr->Bit(21)) {
-#endif
-        Format(instr, "cmpi    'ra, 'int16");
-#if V8_TARGET_ARCH_PPC64
-      } else {
-        Format(instr, "cmpwi   'ra, 'int16");
-      }
-#endif
-      break;
-    }
-    case ADDIC: {
-      Format(instr, "addic   'rt, 'ra, 'int16");
-      break;
-    }
-    case ADDICx: {
-      UnknownFormat(instr, "addicx");
-      break;
-    }
-    case ADDI: {
-      if (instr->RAValue() == 0) {
-        // this is load immediate
-        Format(instr, "li      'rt, 'int16");
-      } else {
-        Format(instr, "addi    'rt, 'ra, 'int16");
-      }
-      break;
-    }
-    case ADDIS: {
-      if (instr->RAValue() == 0) {
-        Format(instr, "lis     'rt, 'int16");
-      } else {
-        Format(instr, "addis   'rt, 'ra, 'int16");
-      }
-      break;
-    }
-    case BCX: {
-      int bo = instr->Bits(25, 21) << 21;
-      int bi = instr->Bits(20, 16);
-      CRBit cond = static_cast<CRBit>(bi & (CRWIDTH - 1));
-      switch (bo) {
-        case BT: {  // Branch if condition true
-          switch (cond) {
-            case CR_EQ:
-              Format(instr, "beq'l'a'cr 'target16");
-              break;
-            case CR_GT:
-              Format(instr, "bgt'l'a'cr 'target16");
-              break;
-            case CR_LT:
-              Format(instr, "blt'l'a'cr 'target16");
-              break;
-            case CR_SO:
-              Format(instr, "bso'l'a'cr 'target16");
-              break;
-          }
-          break;
-        }
-        case BF: {  // Branch if condition false
-          switch (cond) {
-            case CR_EQ:
-              Format(instr, "bne'l'a'cr 'target16");
-              break;
-            case CR_GT:
-              Format(instr, "ble'l'a'cr 'target16");
-              break;
-            case CR_LT:
-              Format(instr, "bge'l'a'cr 'target16");
-              break;
-            case CR_SO:
-              Format(instr, "bnso'l'a'cr 'target16");
-              break;
-          }
-          break;
-        }
-        case DCBNZ: {  // Decrement CTR; branch if CTR != 0
-          Format(instr, "bdnz'l'a 'target16");
-          break;
-        }
-        default:
-          Format(instr, "bc'l'a'cr 'target16");
-          break;
-      }
-      break;
-    }
-    case SC: {
-      UnknownFormat(instr, "sc");
-      break;
-    }
-    case BX: {
-      Format(instr, "b'l'a 'target26");
-      break;
-    }
-    case EXT1: {
-      DecodeExt1(instr);
-      break;
-    }
-    case RLWIMIX: {
-      Format(instr, "rlwimi'. 'ra, 'rs, 'sh, 'me, 'mb");
-      break;
-    }
-    case RLWINMX: {
-      Format(instr, "rlwinm'. 'ra, 'rs, 'sh, 'me, 'mb");
-      break;
-    }
-    case RLWNMX: {
-      Format(instr, "rlwnm'.  'ra, 'rs, 'rb, 'me, 'mb");
-      break;
-    }
-    case ORI: {
-      Format(instr, "ori     'ra, 'rs, 'uint16");
-      break;
-    }
-    case ORIS: {
-      Format(instr, "oris    'ra, 'rs, 'uint16");
-      break;
-    }
-    case XORI: {
-      Format(instr, "xori    'ra, 'rs, 'uint16");
-      break;
-    }
-    case XORIS: {
-      Format(instr, "xoris   'ra, 'rs, 'uint16");
-      break;
-    }
-    case ANDIx: {
-      Format(instr, "andi.   'ra, 'rs, 'uint16");
-      break;
-    }
-    case ANDISx: {
-      Format(instr, "andis.  'ra, 'rs, 'uint16");
-      break;
-    }
-    case EXT2: {
-      DecodeExt2(instr);
-      break;
-    }
-    case LWZ: {
-      Format(instr, "lwz     'rt, 'int16('ra)");
-      break;
-    }
-    case LWZU: {
-      Format(instr, "lwzu    'rt, 'int16('ra)");
-      break;
-    }
-    case LBZ: {
-      Format(instr, "lbz     'rt, 'int16('ra)");
-      break;
-    }
-    case LBZU: {
-      Format(instr, "lbzu    'rt, 'int16('ra)");
-      break;
-    }
-    case STW: {
-      Format(instr, "stw     'rs, 'int16('ra)");
-      break;
-    }
-    case STWU: {
-      Format(instr, "stwu    'rs, 'int16('ra)");
-      break;
-    }
-    case STB: {
-      Format(instr, "stb     'rs, 'int16('ra)");
-      break;
-    }
-    case STBU: {
-      Format(instr, "stbu    'rs, 'int16('ra)");
-      break;
-    }
-    case LHZ: {
-      Format(instr, "lhz     'rt, 'int16('ra)");
-      break;
-    }
-    case LHZU: {
-      Format(instr, "lhzu    'rt, 'int16('ra)");
-      break;
-    }
-    case LHA: {
-      Format(instr, "lha     'rt, 'int16('ra)");
-      break;
-    }
-    case LHAU: {
-      Format(instr, "lhau    'rt, 'int16('ra)");
-      break;
-    }
-    case STH: {
-      Format(instr, "sth 'rs, 'int16('ra)");
-      break;
-    }
-    case STHU: {
-      Format(instr, "sthu 'rs, 'int16('ra)");
-      break;
-    }
-    case LMW: {
-      UnknownFormat(instr, "lmw");
-      break;
-    }
-    case STMW: {
-      UnknownFormat(instr, "stmw");
-      break;
-    }
-    case LFS: {
-      Format(instr, "lfs     'Dt, 'int16('ra)");
-      break;
-    }
-    case LFSU: {
-      Format(instr, "lfsu    'Dt, 'int16('ra)");
-      break;
-    }
-    case LFD: {
-      Format(instr, "lfd     'Dt, 'int16('ra)");
-      break;
-    }
-    case LFDU: {
-      Format(instr, "lfdu    'Dt, 'int16('ra)");
-      break;
-    }
-    case STFS: {
-      Format(instr, "stfs    'Dt, 'int16('ra)");
-      break;
-    }
-    case STFSU: {
-      Format(instr, "stfsu   'Dt, 'int16('ra)");
-      break;
-    }
-    case STFD: {
-      Format(instr, "stfd    'Dt, 'int16('ra)");
-      break;
-    }
-    case STFDU: {
-      Format(instr, "stfdu   'Dt, 'int16('ra)");
-      break;
-    }
-    case EXT3: {
-      DecodeExt3(instr);
-      break;
-    }
-    case EXT4: {
-      DecodeExt4(instr);
-      break;
-    }
-    case EXT5: {
-      DecodeExt5(instr);
-      break;
-    }
-    case EXT6: {
-      DecodeExt6(instr);
-      break;
-    }
-#if V8_TARGET_ARCH_PPC64
-    case LD: {
-      switch (instr->Bits(1, 0)) {
-        case 0:
-          Format(instr, "ld      'rt, 'd('ra)");
-          break;
-        case 1:
-          Format(instr, "ldu     'rt, 'd('ra)");
-          break;
-        case 2:
-          Format(instr, "lwa     'rt, 'd('ra)");
-          break;
-      }
-      break;
-    }
-    case STD: {  // could be STD or STDU
-      if (instr->Bit(0) == 0) {
-        Format(instr, "std     'rs, 'd('ra)");
-      } else {
-        Format(instr, "stdu    'rs, 'd('ra)");
-      }
-      break;
-    }
-#endif
-    default: {
-      Unknown(instr);
-      break;
-    }
-  }
-
-  return Instruction::kInstrSize;
-}
-}  // namespace internal
-}  // namespace v8
-
-
-//------------------------------------------------------------------------------
-
-namespace disasm {
-
-
-const char* NameConverter::NameOfAddress(byte* addr) const {
-  v8::internal::SNPrintF(tmp_buffer_, "%p", static_cast<void*>(addr));
-  return tmp_buffer_.start();
-}
-
-
-const char* NameConverter::NameOfConstant(byte* addr) const {
-  return NameOfAddress(addr);
-}
-
-
-const char* NameConverter::NameOfCPURegister(int reg) const {
-  return v8::internal::GetRegConfig()->GetGeneralRegisterName(reg);
-}
-
-const char* NameConverter::NameOfByteCPURegister(int reg) const {
-  UNREACHABLE();  // PPC does not have the concept of a byte register
-  return "nobytereg";
-}
-
-
-const char* NameConverter::NameOfXMMRegister(int reg) const {
-  UNREACHABLE();  // PPC does not have any XMM registers
-  return "noxmmreg";
-}
-
-const char* NameConverter::NameInCode(byte* addr) const {
-  // The default name converter is called for unknown code. So we will not try
-  // to access any memory.
-  return "";
-}
-
-
-//------------------------------------------------------------------------------
-
-Disassembler::Disassembler(const NameConverter& converter)
-    : converter_(converter) {}
-
-
-Disassembler::~Disassembler() {}
-
-
-int Disassembler::InstructionDecode(v8::internal::Vector<char> buffer,
-                                    byte* instruction) {
-  v8::internal::Decoder d(converter_, buffer);
-  return d.InstructionDecode(instruction);
-}
-
-
-// The PPC assembler does not currently use constant pools.
-int Disassembler::ConstantPoolSizeAt(byte* instruction) { return -1; }
-
-
-void Disassembler::Disassemble(FILE* f, byte* begin, byte* end) {
-  NameConverter converter;
-  Disassembler d(converter);
-  for (byte* pc = begin; pc < end;) {
-    v8::internal::EmbeddedVector<char, 128> buffer;
-    buffer[0] = '\0';
-    byte* prev_pc = pc;
-    pc += d.InstructionDecode(buffer, pc);
-    v8::internal::PrintF(f, "%p    %08x      %s\n", static_cast<void*>(prev_pc),
-                         *reinterpret_cast<int32_t*>(prev_pc), buffer.start());
-  }
-}
-
-
-}  // namespace disasm
-
-#endif  // V8_TARGET_ARCH_PPC
diff --git a/src/v8/src/ppc/frame-constants-ppc.cc b/src/v8/src/ppc/frame-constants-ppc.cc
deleted file mode 100644
index f492962..0000000
--- a/src/v8/src/ppc/frame-constants-ppc.cc
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2014 the V8 project 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 V8_TARGET_ARCH_PPC
-
-#include "src/assembler.h"
-#include "src/frame-constants.h"
-#include "src/macro-assembler.h"
-#include "src/ppc/assembler-ppc-inl.h"
-#include "src/ppc/assembler-ppc.h"
-#include "src/ppc/macro-assembler-ppc.h"
-
-#include "src/ppc/frame-constants-ppc.h"
-
-namespace v8 {
-namespace internal {
-
-Register JavaScriptFrame::fp_register() { return v8::internal::fp; }
-Register JavaScriptFrame::context_register() { return cp; }
-Register JavaScriptFrame::constant_pool_pointer_register() {
-  DCHECK(FLAG_enable_embedded_constant_pool);
-  return kConstantPoolRegister;
-}
-
-int InterpreterFrameConstants::RegisterStackSlotCount(int register_count) {
-  return register_count;
-}
-
-int BuiltinContinuationFrameConstants::PaddingSlotCount(int register_count) {
-  USE(register_count);
-  return 0;
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_PPC
diff --git a/src/v8/src/ppc/frame-constants-ppc.h b/src/v8/src/ppc/frame-constants-ppc.h
deleted file mode 100644
index ee7f299..0000000
--- a/src/v8/src/ppc/frame-constants-ppc.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_PPC_FRAMES_PPC_H_
-#define V8_PPC_FRAMES_PPC_H_
-
-#include "src/frame-constants.h"
-
-namespace v8 {
-namespace internal {
-
-class EntryFrameConstants : public AllStatic {
- public:
-  static const int kCallerFPOffset =
-      -(StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize);
-};
-
-class ExitFrameConstants : public TypedFrameConstants {
- public:
-  static const int kSPOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(0);
-  static const int kCodeOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(1);
-  DEFINE_TYPED_FRAME_SIZES(2);
-
-  // The caller fields are below the frame pointer on the stack.
-  static const int kCallerFPOffset = 0 * kPointerSize;
-  // The calling JS function is below FP.
-  static const int kCallerPCOffset = 1 * kPointerSize;
-
-  // FP-relative displacement of the caller's SP.  It points just
-  // below the saved PC.
-  static const int kCallerSPDisplacement = 2 * kPointerSize;
-};
-
-class JavaScriptFrameConstants : public AllStatic {
- public:
-  // FP-relative.
-  static const int kLocal0Offset = StandardFrameConstants::kExpressionsOffset;
-  static const int kLastParameterOffset = +2 * kPointerSize;
-  static const int kFunctionOffset = StandardFrameConstants::kFunctionOffset;
-
-  // Caller SP-relative.
-  static const int kParam0Offset = -2 * kPointerSize;
-  static const int kReceiverOffset = -1 * kPointerSize;
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_PPC_FRAMES_PPC_H_
diff --git a/src/v8/src/ppc/interface-descriptors-ppc.cc b/src/v8/src/ppc/interface-descriptors-ppc.cc
deleted file mode 100644
index 069fcb2..0000000
--- a/src/v8/src/ppc/interface-descriptors-ppc.cc
+++ /dev/null
@@ -1,350 +0,0 @@
-// Copyright 2014 the V8 project 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 V8_TARGET_ARCH_PPC
-
-#include "src/interface-descriptors.h"
-
-namespace v8 {
-namespace internal {
-
-const Register CallInterfaceDescriptor::ContextRegister() { return cp; }
-
-void CallInterfaceDescriptor::DefaultInitializePlatformSpecific(
-    CallInterfaceDescriptorData* data, int register_parameter_count) {
-  const Register default_stub_registers[] = {r3, r4, r5, r6, r7};
-  CHECK_LE(static_cast<size_t>(register_parameter_count),
-           arraysize(default_stub_registers));
-  data->InitializePlatformSpecific(register_parameter_count,
-                                   default_stub_registers);
-}
-
-void RecordWriteDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  const Register default_stub_registers[] = {r3, r4, r5, r6, r7};
-
-  data->RestrictAllocatableRegisters(default_stub_registers,
-                                     arraysize(default_stub_registers));
-
-  CHECK_LE(static_cast<size_t>(kParameterCount),
-           arraysize(default_stub_registers));
-  data->InitializePlatformSpecific(kParameterCount, default_stub_registers);
-}
-
-const Register FastNewFunctionContextDescriptor::FunctionRegister() {
-  return r4;
-}
-const Register FastNewFunctionContextDescriptor::SlotsRegister() { return r3; }
-
-const Register LoadDescriptor::ReceiverRegister() { return r4; }
-const Register LoadDescriptor::NameRegister() { return r5; }
-const Register LoadDescriptor::SlotRegister() { return r3; }
-
-const Register LoadWithVectorDescriptor::VectorRegister() { return r6; }
-
-const Register StoreDescriptor::ReceiverRegister() { return r4; }
-const Register StoreDescriptor::NameRegister() { return r5; }
-const Register StoreDescriptor::ValueRegister() { return r3; }
-const Register StoreDescriptor::SlotRegister() { return r7; }
-
-const Register StoreWithVectorDescriptor::VectorRegister() { return r6; }
-
-const Register StoreTransitionDescriptor::SlotRegister() { return r7; }
-const Register StoreTransitionDescriptor::VectorRegister() { return r6; }
-const Register StoreTransitionDescriptor::MapRegister() { return r8; }
-
-const Register ApiGetterDescriptor::HolderRegister() { return r3; }
-const Register ApiGetterDescriptor::CallbackRegister() { return r6; }
-
-const Register MathPowTaggedDescriptor::exponent() { return r5; }
-
-const Register MathPowIntegerDescriptor::exponent() {
-  return MathPowTaggedDescriptor::exponent();
-}
-
-
-const Register GrowArrayElementsDescriptor::ObjectRegister() { return r3; }
-const Register GrowArrayElementsDescriptor::KeyRegister() { return r6; }
-
-void FastNewClosureDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {r4, r5, r6};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-
-// static
-const Register TypeConversionDescriptor::ArgumentRegister() { return r3; }
-
-void TypeofDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {r6};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallFunctionDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {r4};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallTrampolineDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r3 : number of arguments
-  // r4 : the target to call
-  Register registers[] = {r4, r3};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r3 : number of arguments (on the stack, not including receiver)
-  // r4 : the target to call
-  // r5 : arguments list (FixedArray)
-  // r7 : arguments list length (untagged)
-  Register registers[] = {r4, r3, r5, r7};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallForwardVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r3 : number of arguments
-  // r5 : start index (to support rest parameters)
-  // r4 : the target to call
-  Register registers[] = {r4, r3, r5};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallWithSpreadDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r3 : number of arguments (on the stack, not including receiver)
-  // r4 : the target to call
-  // r5 : the object to spread
-  Register registers[] = {r4, r3, r5};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallWithArrayLikeDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r4 : the target to call
-  // r5 : the arguments list
-  Register registers[] = {r4, r5};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r3 : number of arguments (on the stack, not including receiver)
-  // r4 : the target to call
-  // r6 : the new target
-  // r5 : arguments list (FixedArray)
-  // r7 : arguments list length (untagged)
-  Register registers[] = {r4, r6, r3, r5, r7};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructForwardVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r3 : number of arguments
-  // r6 : the new target
-  // r5 : start index (to support rest parameters)
-  // r4 : the target to call
-  Register registers[] = {r4, r6, r3, r5};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructWithSpreadDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r3 : number of arguments (on the stack, not including receiver)
-  // r4 : the target to call
-  // r6 : the new target
-  // r5 : the object to spread
-  Register registers[] = {r4, r6, r3, r5};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructWithArrayLikeDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r4 : the target to call
-  // r6 : the new target
-  // r5 : the arguments list
-  Register registers[] = {r4, r6, r5};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructStubDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r3 : number of arguments
-  // r4 : the target to call
-  // r6 : the new target
-  // r5 : allocation site or undefined
-  Register registers[] = {r4, r6, r3, r5};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-
-void ConstructTrampolineDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r3 : number of arguments
-  // r4 : the target to call
-  // r6 : the new target
-  Register registers[] = {r4, r6, r3};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-
-void TransitionElementsKindDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {r3, r4};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void AbortJSDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {r4};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void AllocateHeapNumberDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  data->InitializePlatformSpecific(0, nullptr, nullptr);
-}
-
-void ArrayConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // kTarget, kNewTarget, kActualArgumentsCount, kAllocationSite
-  Register registers[] = {r4, r6, r3, r5};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void ArrayNoArgumentConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // register state
-  // r3 -- number of arguments
-  // r4 -- function
-  // r5 -- allocation site with elements kind
-  Register registers[] = {r4, r5, r3};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ArraySingleArgumentConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // register state
-  // r3 -- number of arguments
-  // r4 -- function
-  // r5 -- allocation site with elements kind
-  Register registers[] = {r4, r5, r3};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-
-void ArrayNArgumentsConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // stack param count needs (constructor pointer, and single argument)
-  Register registers[] = {r4, r5, r3};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CompareDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {r4, r3};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-
-void BinaryOpDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {r4, r3};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void StringAddDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {r4, r3};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ArgumentAdaptorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      r4,  // JSFunction
-      r6,  // the new target
-      r3,  // actual number of arguments
-      r5,  // expected number of arguments
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ApiCallbackDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      JavaScriptFrame::context_register(),  // callee context
-      r7,                                   // call_data
-      r5,                                   // holder
-      r4,                                   // api_function_address
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterDispatchDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-  kInterpreterAccumulatorRegister, kInterpreterBytecodeOffsetRegister,
-  kInterpreterBytecodeArrayRegister, kInterpreterDispatchTableRegister};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterPushArgsThenCallDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      r3,  // argument count (not including receiver)
-      r5,  // address of first argument
-      r4   // the target callable to be call
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterPushArgsThenConstructDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      r3,  // argument count (not including receiver)
-      r6,  // new target
-      r4,  // constructor to call
-      r5,  // allocation site feedback if available, undefined otherwise
-      r7   // address of the first argument
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterCEntryDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      r3,  // argument count (argc)
-      r5,  // address of first argument (argv)
-      r4   // the runtime function to call
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ResumeGeneratorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      r3,  // the value to pass to the generator
-      r4   // the JSGeneratorObject to resume
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void FrameDropperTrampolineDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      r4,  // loaded new FP
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_PPC
diff --git a/src/v8/src/ppc/macro-assembler-ppc.cc b/src/v8/src/ppc/macro-assembler-ppc.cc
deleted file mode 100644
index 8d7c3d0..0000000
--- a/src/v8/src/ppc/macro-assembler-ppc.cc
+++ /dev/null
@@ -1,2929 +0,0 @@
-// Copyright 2014 the V8 project 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 <assert.h>  // For assert
-#include <limits.h>  // For LONG_MIN, LONG_MAX.
-
-#if V8_TARGET_ARCH_PPC
-
-#include "src/base/bits.h"
-#include "src/base/division-by-constant.h"
-#include "src/bootstrapper.h"
-#include "src/callable.h"
-#include "src/code-stubs.h"
-#include "src/debug/debug.h"
-#include "src/external-reference-table.h"
-#include "src/frames-inl.h"
-#include "src/register-configuration.h"
-#include "src/runtime/runtime.h"
-
-#include "src/ppc/macro-assembler-ppc.h"
-
-namespace v8 {
-namespace internal {
-
-MacroAssembler::MacroAssembler(Isolate* isolate, void* buffer, int size,
-                               CodeObjectRequired create_code_object)
-    : TurboAssembler(isolate, buffer, size, create_code_object) {}
-
-TurboAssembler::TurboAssembler(Isolate* isolate, void* buffer, int buffer_size,
-                               CodeObjectRequired create_code_object)
-    : Assembler(isolate, buffer, buffer_size), isolate_(isolate) {
-  if (create_code_object == CodeObjectRequired::kYes) {
-    code_object_ =
-        Handle<HeapObject>::New(isolate->heap()->undefined_value(), isolate);
-  }
-}
-
-int TurboAssembler::RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode,
-                                                    Register exclusion1,
-                                                    Register exclusion2,
-                                                    Register exclusion3) const {
-  int bytes = 0;
-  RegList exclusions = 0;
-  if (exclusion1 != no_reg) {
-    exclusions |= exclusion1.bit();
-    if (exclusion2 != no_reg) {
-      exclusions |= exclusion2.bit();
-      if (exclusion3 != no_reg) {
-        exclusions |= exclusion3.bit();
-      }
-    }
-  }
-
-  RegList list = kJSCallerSaved & ~exclusions;
-  bytes += NumRegs(list) * kPointerSize;
-
-  if (fp_mode == kSaveFPRegs) {
-    bytes += kNumCallerSavedDoubles * kDoubleSize;
-  }
-
-  return bytes;
-}
-
-int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
-                                    Register exclusion2, Register exclusion3) {
-  int bytes = 0;
-  RegList exclusions = 0;
-  if (exclusion1 != no_reg) {
-    exclusions |= exclusion1.bit();
-    if (exclusion2 != no_reg) {
-      exclusions |= exclusion2.bit();
-      if (exclusion3 != no_reg) {
-        exclusions |= exclusion3.bit();
-      }
-    }
-  }
-
-  RegList list = kJSCallerSaved & ~exclusions;
-  MultiPush(list);
-  bytes += NumRegs(list) * kPointerSize;
-
-  if (fp_mode == kSaveFPRegs) {
-    MultiPushDoubles(kCallerSavedDoubles);
-    bytes += kNumCallerSavedDoubles * kDoubleSize;
-  }
-
-  return bytes;
-}
-
-int TurboAssembler::PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
-                                   Register exclusion2, Register exclusion3) {
-  int bytes = 0;
-  if (fp_mode == kSaveFPRegs) {
-    MultiPopDoubles(kCallerSavedDoubles);
-    bytes += kNumCallerSavedDoubles * kDoubleSize;
-  }
-
-  RegList exclusions = 0;
-  if (exclusion1 != no_reg) {
-    exclusions |= exclusion1.bit();
-    if (exclusion2 != no_reg) {
-      exclusions |= exclusion2.bit();
-      if (exclusion3 != no_reg) {
-        exclusions |= exclusion3.bit();
-      }
-    }
-  }
-
-  RegList list = kJSCallerSaved & ~exclusions;
-  MultiPop(list);
-  bytes += NumRegs(list) * kPointerSize;
-
-  return bytes;
-}
-
-void TurboAssembler::Jump(Register target) {
-  mtctr(target);
-  bctr();
-}
-
-void MacroAssembler::JumpToJSEntry(Register target) {
-  Move(ip, target);
-  Jump(ip);
-}
-
-void TurboAssembler::Jump(intptr_t target, RelocInfo::Mode rmode,
-                          Condition cond, CRegister cr) {
-  Label skip;
-
-  if (cond != al) b(NegateCondition(cond), &skip, cr);
-
-  DCHECK(rmode == RelocInfo::CODE_TARGET || rmode == RelocInfo::RUNTIME_ENTRY);
-
-  mov(ip, Operand(target, rmode));
-  mtctr(ip);
-  bctr();
-
-  bind(&skip);
-}
-
-void TurboAssembler::Jump(Address target, RelocInfo::Mode rmode, Condition cond,
-                          CRegister cr) {
-  DCHECK(!RelocInfo::IsCodeTarget(rmode));
-  Jump(reinterpret_cast<intptr_t>(target), rmode, cond, cr);
-}
-
-void TurboAssembler::Jump(Handle<Code> code, RelocInfo::Mode rmode,
-                          Condition cond, CRegister cr) {
-  DCHECK(RelocInfo::IsCodeTarget(rmode));
-  // 'code' is always generated ppc code, never THUMB code
-  Jump(reinterpret_cast<intptr_t>(code.address()), rmode, cond, cr);
-}
-
-int TurboAssembler::CallSize(Register target) { return 2 * kInstrSize; }
-
-void TurboAssembler::Call(Register target) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  Label start;
-  bind(&start);
-
-  // branch via link register and set LK bit for return point
-  mtctr(target);
-  bctrl();
-
-  DCHECK_EQ(CallSize(target), SizeOfCodeGeneratedSince(&start));
-}
-
-void MacroAssembler::CallJSEntry(Register target) {
-  DCHECK(target == ip);
-  Call(target);
-}
-
-int TurboAssembler::CallSize(Address target, RelocInfo::Mode rmode,
-                             Condition cond) {
-  Operand mov_operand = Operand(reinterpret_cast<intptr_t>(target), rmode);
-  return (2 + instructions_required_for_mov(ip, mov_operand)) * kInstrSize;
-}
-
-int MacroAssembler::CallSizeNotPredictableCodeSize(Address target,
-                                                   RelocInfo::Mode rmode,
-                                                   Condition cond) {
-  return (2 + kMovInstructionsNoConstantPool) * kInstrSize;
-}
-
-void TurboAssembler::Call(Address target, RelocInfo::Mode rmode,
-                          Condition cond) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  DCHECK(cond == al);
-
-#ifdef DEBUG
-  // Check the expected size before generating code to ensure we assume the same
-  // constant pool availability (e.g., whether constant pool is full or not).
-  int expected_size = CallSize(target, rmode, cond);
-  Label start;
-  bind(&start);
-#endif
-  // This can likely be optimized to make use of bc() with 24bit relative
-  //
-  // RecordRelocInfo(x.rmode_, x.immediate);
-  // bc( BA, .... offset, LKset);
-  //
-
-  mov(ip, Operand(reinterpret_cast<intptr_t>(target), rmode));
-  mtctr(ip);
-  bctrl();
-
-  DCHECK_EQ(expected_size, SizeOfCodeGeneratedSince(&start));
-}
-
-int TurboAssembler::CallSize(Handle<Code> code, RelocInfo::Mode rmode,
-                             Condition cond) {
-  return CallSize(code.address(), rmode, cond);
-}
-
-void TurboAssembler::Call(Handle<Code> code, RelocInfo::Mode rmode,
-                          Condition cond) {
-  BlockTrampolinePoolScope block_trampoline_pool(this);
-  DCHECK(RelocInfo::IsCodeTarget(rmode));
-
-  Label start;
-  bind(&start);
-
-#ifdef DEBUG
-  // Check the expected size before generating code to ensure we assume the same
-  // constant pool availability (e.g., whether constant pool is full or not).
-  int expected_size = CallSize(code, rmode, cond);
-#endif
-
-  Call(code.address(), rmode, cond);
-  DCHECK_EQ(expected_size, SizeOfCodeGeneratedSince(&start));
-}
-
-void TurboAssembler::Drop(int count) {
-  if (count > 0) {
-    Add(sp, sp, count * kPointerSize, r0);
-  }
-}
-
-void TurboAssembler::Drop(Register count, Register scratch) {
-  ShiftLeftImm(scratch, count, Operand(kPointerSizeLog2));
-  add(sp, sp, scratch);
-}
-
-void TurboAssembler::Call(Label* target) { b(target, SetLK); }
-
-void TurboAssembler::Push(Handle<HeapObject> handle) {
-  mov(r0, Operand(handle));
-  push(r0);
-}
-
-void TurboAssembler::Push(Smi* smi) {
-  mov(r0, Operand(smi));
-  push(r0);
-}
-
-void TurboAssembler::Move(Register dst, Handle<HeapObject> value) {
-  mov(dst, Operand(value));
-}
-
-void TurboAssembler::Move(Register dst, Register src, Condition cond) {
-  DCHECK(cond == al);
-  if (dst != src) {
-    mr(dst, src);
-  }
-}
-
-void TurboAssembler::Move(DoubleRegister dst, DoubleRegister src) {
-  if (dst != src) {
-    fmr(dst, src);
-  }
-}
-
-void TurboAssembler::MultiPush(RegList regs, Register location) {
-  int16_t num_to_push = base::bits::CountPopulation(regs);
-  int16_t stack_offset = num_to_push * kPointerSize;
-
-  subi(location, location, Operand(stack_offset));
-  for (int16_t i = Register::kNumRegisters - 1; i >= 0; i--) {
-    if ((regs & (1 << i)) != 0) {
-      stack_offset -= kPointerSize;
-      StoreP(ToRegister(i), MemOperand(location, stack_offset));
-    }
-  }
-}
-
-void TurboAssembler::MultiPop(RegList regs, Register location) {
-  int16_t stack_offset = 0;
-
-  for (int16_t i = 0; i < Register::kNumRegisters; i++) {
-    if ((regs & (1 << i)) != 0) {
-      LoadP(ToRegister(i), MemOperand(location, stack_offset));
-      stack_offset += kPointerSize;
-    }
-  }
-  addi(location, location, Operand(stack_offset));
-}
-
-void TurboAssembler::MultiPushDoubles(RegList dregs, Register location) {
-  int16_t num_to_push = base::bits::CountPopulation(dregs);
-  int16_t stack_offset = num_to_push * kDoubleSize;
-
-  subi(location, location, Operand(stack_offset));
-  for (int16_t i = DoubleRegister::kNumRegisters - 1; i >= 0; i--) {
-    if ((dregs & (1 << i)) != 0) {
-      DoubleRegister dreg = DoubleRegister::from_code(i);
-      stack_offset -= kDoubleSize;
-      stfd(dreg, MemOperand(location, stack_offset));
-    }
-  }
-}
-
-void TurboAssembler::MultiPopDoubles(RegList dregs, Register location) {
-  int16_t stack_offset = 0;
-
-  for (int16_t i = 0; i < DoubleRegister::kNumRegisters; i++) {
-    if ((dregs & (1 << i)) != 0) {
-      DoubleRegister dreg = DoubleRegister::from_code(i);
-      lfd(dreg, MemOperand(location, stack_offset));
-      stack_offset += kDoubleSize;
-    }
-  }
-  addi(location, location, Operand(stack_offset));
-}
-
-void TurboAssembler::LoadRoot(Register destination, Heap::RootListIndex index,
-                              Condition cond) {
-  DCHECK(cond == al);
-  LoadP(destination, MemOperand(kRootRegister, index << kPointerSizeLog2), r0);
-}
-
-void MacroAssembler::RecordWriteField(Register object, int offset,
-                                      Register value, Register dst,
-                                      LinkRegisterStatus lr_status,
-                                      SaveFPRegsMode save_fp,
-                                      RememberedSetAction remembered_set_action,
-                                      SmiCheck smi_check) {
-  // First, check if a write barrier is even needed. The tests below
-  // catch stores of Smis.
-  Label done;
-
-  // Skip barrier if writing a smi.
-  if (smi_check == INLINE_SMI_CHECK) {
-    JumpIfSmi(value, &done);
-  }
-
-  // Although the object register is tagged, the offset is relative to the start
-  // of the object, so so offset must be a multiple of kPointerSize.
-  DCHECK(IsAligned(offset, kPointerSize));
-
-  Add(dst, object, offset - kHeapObjectTag, r0);
-  if (emit_debug_code()) {
-    Label ok;
-    andi(r0, dst, Operand(kPointerSize - 1));
-    beq(&ok, cr0);
-    stop("Unaligned cell in write barrier");
-    bind(&ok);
-  }
-
-  RecordWrite(object, dst, value, lr_status, save_fp, remembered_set_action,
-              OMIT_SMI_CHECK);
-
-  bind(&done);
-
-  // Clobber clobbered input registers when running with the debug-code flag
-  // turned on to provoke errors.
-  if (emit_debug_code()) {
-    mov(value, Operand(bit_cast<intptr_t>(kZapValue + 4)));
-    mov(dst, Operand(bit_cast<intptr_t>(kZapValue + 8)));
-  }
-}
-
-void TurboAssembler::SaveRegisters(RegList registers) {
-  DCHECK_GT(NumRegs(registers), 0);
-  RegList regs = 0;
-  for (int i = 0; i < Register::kNumRegisters; ++i) {
-    if ((registers >> i) & 1u) {
-      regs |= Register::from_code(i).bit();
-    }
-  }
-
-  MultiPush(regs);
-}
-
-void TurboAssembler::RestoreRegisters(RegList registers) {
-  DCHECK_GT(NumRegs(registers), 0);
-  RegList regs = 0;
-  for (int i = 0; i < Register::kNumRegisters; ++i) {
-    if ((registers >> i) & 1u) {
-      regs |= Register::from_code(i).bit();
-    }
-  }
-  MultiPop(regs);
-}
-
-void TurboAssembler::CallRecordWriteStub(
-    Register object, Register address,
-    RememberedSetAction remembered_set_action, SaveFPRegsMode fp_mode) {
-  // TODO(albertnetymk): For now we ignore remembered_set_action and fp_mode,
-  // i.e. always emit remember set and save FP registers in RecordWriteStub. If
-  // large performance regression is observed, we should use these values to
-  // avoid unnecessary work.
-
-  Callable const callable =
-      Builtins::CallableFor(isolate(), Builtins::kRecordWrite);
-  RegList registers = callable.descriptor().allocatable_registers();
-
-  SaveRegisters(registers);
-
-  Register object_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kObject));
-  Register slot_parameter(
-      callable.descriptor().GetRegisterParameter(RecordWriteDescriptor::kSlot));
-  Register isolate_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kIsolate));
-  Register remembered_set_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kRememberedSet));
-  Register fp_mode_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kFPMode));
-
-  push(object);
-  push(address);
-
-  pop(slot_parameter);
-  pop(object_parameter);
-
-  mov(isolate_parameter,
-      Operand(ExternalReference::isolate_address(isolate())));
-  Move(remembered_set_parameter, Smi::FromEnum(remembered_set_action));
-  Move(fp_mode_parameter, Smi::FromEnum(fp_mode));
-  Call(callable.code(), RelocInfo::CODE_TARGET);
-
-  RestoreRegisters(registers);
-}
-
-// Will clobber 4 registers: object, address, scratch, ip.  The
-// register 'object' contains a heap object pointer.  The heap object
-// tag is shifted away.
-void MacroAssembler::RecordWrite(Register object, Register address,
-                                 Register value, LinkRegisterStatus lr_status,
-                                 SaveFPRegsMode fp_mode,
-                                 RememberedSetAction remembered_set_action,
-                                 SmiCheck smi_check) {
-  DCHECK(object != value);
-  if (emit_debug_code()) {
-    LoadP(r0, MemOperand(address));
-    cmp(r0, value);
-    Check(eq, AbortReason::kWrongAddressOrValuePassedToRecordWrite);
-  }
-
-  if (remembered_set_action == OMIT_REMEMBERED_SET &&
-      !FLAG_incremental_marking) {
-    return;
-  }
-
-  // First, check if a write barrier is even needed. The tests below
-  // catch stores of smis and stores into the young generation.
-  Label done;
-
-  if (smi_check == INLINE_SMI_CHECK) {
-    JumpIfSmi(value, &done);
-  }
-
-  CheckPageFlag(value,
-                value,  // Used as scratch.
-                MemoryChunk::kPointersToHereAreInterestingMask, eq, &done);
-  CheckPageFlag(object,
-                value,  // Used as scratch.
-                MemoryChunk::kPointersFromHereAreInterestingMask, eq, &done);
-
-  // Record the actual write.
-  if (lr_status == kLRHasNotBeenSaved) {
-    mflr(r0);
-    push(r0);
-  }
-  CallRecordWriteStub(object, address, remembered_set_action, fp_mode);
-  if (lr_status == kLRHasNotBeenSaved) {
-    pop(r0);
-    mtlr(r0);
-  }
-
-  bind(&done);
-
-  // Count number of write barriers in generated code.
-  isolate()->counters()->write_barriers_static()->Increment();
-  IncrementCounter(isolate()->counters()->write_barriers_dynamic(), 1, ip,
-                   value);
-
-  // Clobber clobbered registers when running with the debug-code flag
-  // turned on to provoke errors.
-  if (emit_debug_code()) {
-    mov(address, Operand(bit_cast<intptr_t>(kZapValue + 12)));
-    mov(value, Operand(bit_cast<intptr_t>(kZapValue + 16)));
-  }
-}
-
-void TurboAssembler::PushCommonFrame(Register marker_reg) {
-  int fp_delta = 0;
-  mflr(r0);
-  if (FLAG_enable_embedded_constant_pool) {
-    if (marker_reg.is_valid()) {
-      Push(r0, fp, kConstantPoolRegister, marker_reg);
-      fp_delta = 2;
-    } else {
-      Push(r0, fp, kConstantPoolRegister);
-      fp_delta = 1;
-    }
-  } else {
-    if (marker_reg.is_valid()) {
-      Push(r0, fp, marker_reg);
-      fp_delta = 1;
-    } else {
-      Push(r0, fp);
-      fp_delta = 0;
-    }
-  }
-  addi(fp, sp, Operand(fp_delta * kPointerSize));
-}
-
-void TurboAssembler::PushStandardFrame(Register function_reg) {
-  int fp_delta = 0;
-  mflr(r0);
-  if (FLAG_enable_embedded_constant_pool) {
-    if (function_reg.is_valid()) {
-      Push(r0, fp, kConstantPoolRegister, cp, function_reg);
-      fp_delta = 3;
-    } else {
-      Push(r0, fp, kConstantPoolRegister, cp);
-      fp_delta = 2;
-    }
-  } else {
-    if (function_reg.is_valid()) {
-      Push(r0, fp, cp, function_reg);
-      fp_delta = 2;
-    } else {
-      Push(r0, fp, cp);
-      fp_delta = 1;
-    }
-  }
-  addi(fp, sp, Operand(fp_delta * kPointerSize));
-}
-
-void TurboAssembler::RestoreFrameStateForTailCall() {
-  if (FLAG_enable_embedded_constant_pool) {
-    LoadP(kConstantPoolRegister,
-          MemOperand(fp, StandardFrameConstants::kConstantPoolOffset));
-    set_constant_pool_available(false);
-  }
-  LoadP(r0, MemOperand(fp, StandardFrameConstants::kCallerPCOffset));
-  LoadP(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
-  mtlr(r0);
-}
-
-// Push and pop all registers that can hold pointers.
-void MacroAssembler::PushSafepointRegisters() {
-  // Safepoints expect a block of kNumSafepointRegisters values on the
-  // stack, so adjust the stack for unsaved registers.
-  const int num_unsaved = kNumSafepointRegisters - kNumSafepointSavedRegisters;
-  DCHECK_GE(num_unsaved, 0);
-  if (num_unsaved > 0) {
-    subi(sp, sp, Operand(num_unsaved * kPointerSize));
-  }
-  MultiPush(kSafepointSavedRegisters);
-}
-
-
-void MacroAssembler::PopSafepointRegisters() {
-  const int num_unsaved = kNumSafepointRegisters - kNumSafepointSavedRegisters;
-  MultiPop(kSafepointSavedRegisters);
-  if (num_unsaved > 0) {
-    addi(sp, sp, Operand(num_unsaved * kPointerSize));
-  }
-}
-
-int MacroAssembler::SafepointRegisterStackIndex(int reg_code) {
-  // The registers are pushed starting with the highest encoding,
-  // which means that lowest encodings are closest to the stack pointer.
-  RegList regs = kSafepointSavedRegisters;
-  int index = 0;
-
-  DCHECK(reg_code >= 0 && reg_code < kNumRegisters);
-
-  for (int16_t i = 0; i < reg_code; i++) {
-    if ((regs & (1 << i)) != 0) {
-      index++;
-    }
-  }
-
-  return index;
-}
-
-
-void TurboAssembler::CanonicalizeNaN(const DoubleRegister dst,
-                                     const DoubleRegister src) {
-  // Turn potential sNaN into qNaN.
-  fsub(dst, src, kDoubleRegZero);
-}
-
-void TurboAssembler::ConvertIntToDouble(Register src, DoubleRegister dst) {
-  MovIntToDouble(dst, src, r0);
-  fcfid(dst, dst);
-}
-
-void TurboAssembler::ConvertUnsignedIntToDouble(Register src,
-                                                DoubleRegister dst) {
-  MovUnsignedIntToDouble(dst, src, r0);
-  fcfid(dst, dst);
-}
-
-void TurboAssembler::ConvertIntToFloat(Register src, DoubleRegister dst) {
-  MovIntToDouble(dst, src, r0);
-  fcfids(dst, dst);
-}
-
-void TurboAssembler::ConvertUnsignedIntToFloat(Register src,
-                                               DoubleRegister dst) {
-  MovUnsignedIntToDouble(dst, src, r0);
-  fcfids(dst, dst);
-}
-
-#if V8_TARGET_ARCH_PPC64
-void TurboAssembler::ConvertInt64ToDouble(Register src,
-                                          DoubleRegister double_dst) {
-  MovInt64ToDouble(double_dst, src);
-  fcfid(double_dst, double_dst);
-}
-
-void TurboAssembler::ConvertUnsignedInt64ToFloat(Register src,
-                                                 DoubleRegister double_dst) {
-  MovInt64ToDouble(double_dst, src);
-  fcfidus(double_dst, double_dst);
-}
-
-void TurboAssembler::ConvertUnsignedInt64ToDouble(Register src,
-                                                  DoubleRegister double_dst) {
-  MovInt64ToDouble(double_dst, src);
-  fcfidu(double_dst, double_dst);
-}
-
-void TurboAssembler::ConvertInt64ToFloat(Register src,
-                                         DoubleRegister double_dst) {
-  MovInt64ToDouble(double_dst, src);
-  fcfids(double_dst, double_dst);
-}
-#endif
-
-void TurboAssembler::ConvertDoubleToInt64(const DoubleRegister double_input,
-#if !V8_TARGET_ARCH_PPC64
-                                          const Register dst_hi,
-#endif
-                                          const Register dst,
-                                          const DoubleRegister double_dst,
-                                          FPRoundingMode rounding_mode) {
-  if (rounding_mode == kRoundToZero) {
-    fctidz(double_dst, double_input);
-  } else {
-    SetRoundingMode(rounding_mode);
-    fctid(double_dst, double_input);
-    ResetRoundingMode();
-  }
-
-  MovDoubleToInt64(
-#if !V8_TARGET_ARCH_PPC64
-      dst_hi,
-#endif
-      dst, double_dst);
-}
-
-#if V8_TARGET_ARCH_PPC64
-void TurboAssembler::ConvertDoubleToUnsignedInt64(
-    const DoubleRegister double_input, const Register dst,
-    const DoubleRegister double_dst, FPRoundingMode rounding_mode) {
-  if (rounding_mode == kRoundToZero) {
-    fctiduz(double_dst, double_input);
-  } else {
-    SetRoundingMode(rounding_mode);
-    fctidu(double_dst, double_input);
-    ResetRoundingMode();
-  }
-
-  MovDoubleToInt64(dst, double_dst);
-}
-#endif
-
-#if !V8_TARGET_ARCH_PPC64
-void TurboAssembler::ShiftLeftPair(Register dst_low, Register dst_high,
-                                   Register src_low, Register src_high,
-                                   Register scratch, Register shift) {
-  DCHECK(!AreAliased(dst_low, src_high));
-  DCHECK(!AreAliased(dst_high, src_low));
-  DCHECK(!AreAliased(dst_low, dst_high, shift));
-  Label less_than_32;
-  Label done;
-  cmpi(shift, Operand(32));
-  blt(&less_than_32);
-  // If shift >= 32
-  andi(scratch, shift, Operand(0x1F));
-  slw(dst_high, src_low, scratch);
-  li(dst_low, Operand::Zero());
-  b(&done);
-  bind(&less_than_32);
-  // If shift < 32
-  subfic(scratch, shift, Operand(32));
-  slw(dst_high, src_high, shift);
-  srw(scratch, src_low, scratch);
-  orx(dst_high, dst_high, scratch);
-  slw(dst_low, src_low, shift);
-  bind(&done);
-}
-
-void TurboAssembler::ShiftLeftPair(Register dst_low, Register dst_high,
-                                   Register src_low, Register src_high,
-                                   uint32_t shift) {
-  DCHECK(!AreAliased(dst_low, src_high));
-  DCHECK(!AreAliased(dst_high, src_low));
-  if (shift == 32) {
-    Move(dst_high, src_low);
-    li(dst_low, Operand::Zero());
-  } else if (shift > 32) {
-    shift &= 0x1F;
-    slwi(dst_high, src_low, Operand(shift));
-    li(dst_low, Operand::Zero());
-  } else if (shift == 0) {
-    Move(dst_low, src_low);
-    Move(dst_high, src_high);
-  } else {
-    slwi(dst_high, src_high, Operand(shift));
-    rlwimi(dst_high, src_low, shift, 32 - shift, 31);
-    slwi(dst_low, src_low, Operand(shift));
-  }
-}
-
-void TurboAssembler::ShiftRightPair(Register dst_low, Register dst_high,
-                                    Register src_low, Register src_high,
-                                    Register scratch, Register shift) {
-  DCHECK(!AreAliased(dst_low, src_high));
-  DCHECK(!AreAliased(dst_high, src_low));
-  DCHECK(!AreAliased(dst_low, dst_high, shift));
-  Label less_than_32;
-  Label done;
-  cmpi(shift, Operand(32));
-  blt(&less_than_32);
-  // If shift >= 32
-  andi(scratch, shift, Operand(0x1F));
-  srw(dst_low, src_high, scratch);
-  li(dst_high, Operand::Zero());
-  b(&done);
-  bind(&less_than_32);
-  // If shift < 32
-  subfic(scratch, shift, Operand(32));
-  srw(dst_low, src_low, shift);
-  slw(scratch, src_high, scratch);
-  orx(dst_low, dst_low, scratch);
-  srw(dst_high, src_high, shift);
-  bind(&done);
-}
-
-void TurboAssembler::ShiftRightPair(Register dst_low, Register dst_high,
-                                    Register src_low, Register src_high,
-                                    uint32_t shift) {
-  DCHECK(!AreAliased(dst_low, src_high));
-  DCHECK(!AreAliased(dst_high, src_low));
-  if (shift == 32) {
-    Move(dst_low, src_high);
-    li(dst_high, Operand::Zero());
-  } else if (shift > 32) {
-    shift &= 0x1F;
-    srwi(dst_low, src_high, Operand(shift));
-    li(dst_high, Operand::Zero());
-  } else if (shift == 0) {
-    Move(dst_low, src_low);
-    Move(dst_high, src_high);
-  } else {
-    srwi(dst_low, src_low, Operand(shift));
-    rlwimi(dst_low, src_high, 32 - shift, 0, shift - 1);
-    srwi(dst_high, src_high, Operand(shift));
-  }
-}
-
-void TurboAssembler::ShiftRightAlgPair(Register dst_low, Register dst_high,
-                                       Register src_low, Register src_high,
-                                       Register scratch, Register shift) {
-  DCHECK(!AreAliased(dst_low, src_high, shift));
-  DCHECK(!AreAliased(dst_high, src_low, shift));
-  Label less_than_32;
-  Label done;
-  cmpi(shift, Operand(32));
-  blt(&less_than_32);
-  // If shift >= 32
-  andi(scratch, shift, Operand(0x1F));
-  sraw(dst_low, src_high, scratch);
-  srawi(dst_high, src_high, 31);
-  b(&done);
-  bind(&less_than_32);
-  // If shift < 32
-  subfic(scratch, shift, Operand(32));
-  srw(dst_low, src_low, shift);
-  slw(scratch, src_high, scratch);
-  orx(dst_low, dst_low, scratch);
-  sraw(dst_high, src_high, shift);
-  bind(&done);
-}
-
-void TurboAssembler::ShiftRightAlgPair(Register dst_low, Register dst_high,
-                                       Register src_low, Register src_high,
-                                       uint32_t shift) {
-  DCHECK(!AreAliased(dst_low, src_high));
-  DCHECK(!AreAliased(dst_high, src_low));
-  if (shift == 32) {
-    Move(dst_low, src_high);
-    srawi(dst_high, src_high, 31);
-  } else if (shift > 32) {
-    shift &= 0x1F;
-    srawi(dst_low, src_high, shift);
-    srawi(dst_high, src_high, 31);
-  } else if (shift == 0) {
-    Move(dst_low, src_low);
-    Move(dst_high, src_high);
-  } else {
-    srwi(dst_low, src_low, Operand(shift));
-    rlwimi(dst_low, src_high, 32 - shift, 0, shift - 1);
-    srawi(dst_high, src_high, shift);
-  }
-}
-#endif
-
-void MacroAssembler::LoadConstantPoolPointerRegisterFromCodeTargetAddress(
-    Register code_target_address) {
-  lwz(kConstantPoolRegister,
-      MemOperand(code_target_address,
-                 Code::kConstantPoolOffset - Code::kHeaderSize));
-  add(kConstantPoolRegister, kConstantPoolRegister, code_target_address);
-}
-
-void TurboAssembler::LoadConstantPoolPointerRegister(Register base,
-                                                     int code_start_delta) {
-  add_label_offset(kConstantPoolRegister, base, ConstantPoolPosition(),
-                   code_start_delta);
-}
-
-void TurboAssembler::LoadConstantPoolPointerRegister() {
-  mov_label_addr(kConstantPoolRegister, ConstantPoolPosition());
-}
-
-void TurboAssembler::StubPrologue(StackFrame::Type type, Register base,
-                                  int prologue_offset) {
-  {
-    ConstantPoolUnavailableScope constant_pool_unavailable(this);
-    mov(r11, Operand(StackFrame::TypeToMarker(type)));
-    PushCommonFrame(r11);
-  }
-  if (FLAG_enable_embedded_constant_pool) {
-    if (base != no_reg) {
-      // base contains prologue address
-      LoadConstantPoolPointerRegister(base, -prologue_offset);
-    } else {
-      LoadConstantPoolPointerRegister();
-    }
-    set_constant_pool_available(true);
-  }
-}
-
-void TurboAssembler::Prologue(Register base, int prologue_offset) {
-  DCHECK(base != no_reg);
-  PushStandardFrame(r4);
-  if (FLAG_enable_embedded_constant_pool) {
-    // base contains prologue address
-    LoadConstantPoolPointerRegister(base, -prologue_offset);
-    set_constant_pool_available(true);
-  }
-}
-
-void TurboAssembler::EnterFrame(StackFrame::Type type,
-                                bool load_constant_pool_pointer_reg) {
-  if (FLAG_enable_embedded_constant_pool && load_constant_pool_pointer_reg) {
-    // Push type explicitly so we can leverage the constant pool.
-    // This path cannot rely on ip containing code entry.
-    PushCommonFrame();
-    LoadConstantPoolPointerRegister();
-    mov(ip, Operand(StackFrame::TypeToMarker(type)));
-    push(ip);
-  } else {
-    mov(ip, Operand(StackFrame::TypeToMarker(type)));
-    PushCommonFrame(ip);
-  }
-  if (type == StackFrame::INTERNAL) {
-    mov(r0, Operand(CodeObject()));
-    push(r0);
-  }
-}
-
-int TurboAssembler::LeaveFrame(StackFrame::Type type, int stack_adjustment) {
-  ConstantPoolUnavailableScope constant_pool_unavailable(this);
-  // r3: preserved
-  // r4: preserved
-  // r5: preserved
-
-  // Drop the execution stack down to the frame pointer and restore
-  // the caller's state.
-  int frame_ends;
-  LoadP(r0, MemOperand(fp, StandardFrameConstants::kCallerPCOffset));
-  LoadP(ip, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
-  if (FLAG_enable_embedded_constant_pool) {
-    LoadP(kConstantPoolRegister,
-          MemOperand(fp, StandardFrameConstants::kConstantPoolOffset));
-  }
-  mtlr(r0);
-  frame_ends = pc_offset();
-  Add(sp, fp, StandardFrameConstants::kCallerSPOffset + stack_adjustment, r0);
-  mr(fp, ip);
-  return frame_ends;
-}
-
-// ExitFrame layout (probably wrongish.. needs updating)
-//
-//  SP -> previousSP
-//        LK reserved
-//        code
-//        sp_on_exit (for debug?)
-// oldSP->prev SP
-//        LK
-//        <parameters on stack>
-
-// Prior to calling EnterExitFrame, we've got a bunch of parameters
-// on the stack that we need to wrap a real frame around.. so first
-// we reserve a slot for LK and push the previous SP which is captured
-// in the fp register (r31)
-// Then - we buy a new frame
-
-void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space,
-                                    StackFrame::Type frame_type) {
-  DCHECK(frame_type == StackFrame::EXIT ||
-         frame_type == StackFrame::BUILTIN_EXIT);
-  // Set up the frame structure on the stack.
-  DCHECK_EQ(2 * kPointerSize, ExitFrameConstants::kCallerSPDisplacement);
-  DCHECK_EQ(1 * kPointerSize, ExitFrameConstants::kCallerPCOffset);
-  DCHECK_EQ(0 * kPointerSize, ExitFrameConstants::kCallerFPOffset);
-  DCHECK_GT(stack_space, 0);
-
-  // This is an opportunity to build a frame to wrap
-  // all of the pushes that have happened inside of V8
-  // since we were called from C code
-
-  mov(ip, Operand(StackFrame::TypeToMarker(frame_type)));
-  PushCommonFrame(ip);
-  // Reserve room for saved entry sp and code object.
-  subi(sp, fp, Operand(ExitFrameConstants::kFixedFrameSizeFromFp));
-
-  if (emit_debug_code()) {
-    li(r8, Operand::Zero());
-    StoreP(r8, MemOperand(fp, ExitFrameConstants::kSPOffset));
-  }
-  if (FLAG_enable_embedded_constant_pool) {
-    StoreP(kConstantPoolRegister,
-           MemOperand(fp, ExitFrameConstants::kConstantPoolOffset));
-  }
-  mov(r8, Operand(CodeObject()));
-  StoreP(r8, MemOperand(fp, ExitFrameConstants::kCodeOffset));
-
-  // Save the frame pointer and the context in top.
-  mov(r8, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress,
-                                    isolate())));
-  StoreP(fp, MemOperand(r8));
-  mov(r8,
-      Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate())));
-  StoreP(cp, MemOperand(r8));
-
-  // Optionally save all volatile double registers.
-  if (save_doubles) {
-    MultiPushDoubles(kCallerSavedDoubles);
-    // Note that d0 will be accessible at
-    //   fp - ExitFrameConstants::kFrameSize -
-    //   kNumCallerSavedDoubles * kDoubleSize,
-    // since the sp slot and code slot were pushed after the fp.
-  }
-
-  addi(sp, sp, Operand(-stack_space * kPointerSize));
-
-  // Allocate and align the frame preparing for calling the runtime
-  // function.
-  const int frame_alignment = ActivationFrameAlignment();
-  if (frame_alignment > kPointerSize) {
-    DCHECK(base::bits::IsPowerOfTwo(frame_alignment));
-    ClearRightImm(sp, sp, Operand(WhichPowerOf2(frame_alignment)));
-  }
-  li(r0, Operand::Zero());
-  StorePU(r0, MemOperand(sp, -kNumRequiredStackFrameSlots * kPointerSize));
-
-  // Set the exit frame sp value to point just before the return address
-  // location.
-  addi(r8, sp, Operand((kStackFrameExtraParamSlot + 1) * kPointerSize));
-  StoreP(r8, MemOperand(fp, ExitFrameConstants::kSPOffset));
-}
-
-int TurboAssembler::ActivationFrameAlignment() {
-#if !defined(USE_SIMULATOR)
-  // Running on the real platform. Use the alignment as mandated by the local
-  // environment.
-  // Note: This will break if we ever start generating snapshots on one PPC
-  // platform for another PPC platform with a different alignment.
-  return base::OS::ActivationFrameAlignment();
-#else  // Simulated
-  // If we are using the simulator then we should always align to the expected
-  // alignment. As the simulator is used to generate snapshots we do not know
-  // if the target platform will need alignment, so this is controlled from a
-  // flag.
-  return FLAG_sim_stack_alignment;
-#endif
-}
-
-
-void MacroAssembler::LeaveExitFrame(bool save_doubles, Register argument_count,
-                                    bool argument_count_is_length) {
-  ConstantPoolUnavailableScope constant_pool_unavailable(this);
-  // Optionally restore all double registers.
-  if (save_doubles) {
-    // Calculate the stack location of the saved doubles and restore them.
-    const int kNumRegs = kNumCallerSavedDoubles;
-    const int offset =
-        (ExitFrameConstants::kFixedFrameSizeFromFp + kNumRegs * kDoubleSize);
-    addi(r6, fp, Operand(-offset));
-    MultiPopDoubles(kCallerSavedDoubles, r6);
-  }
-
-  // Clear top frame.
-  li(r6, Operand::Zero());
-  mov(ip, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress,
-                                    isolate())));
-  StoreP(r6, MemOperand(ip));
-
-  // Restore current context from top and clear it in debug mode.
-  mov(ip,
-      Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate())));
-  LoadP(cp, MemOperand(ip));
-
-#ifdef DEBUG
-  mov(r6, Operand(Context::kInvalidContext));
-  mov(ip,
-      Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate())));
-  StoreP(r6, MemOperand(ip));
-#endif
-
-  // Tear down the exit frame, pop the arguments, and return.
-  LeaveFrame(StackFrame::EXIT);
-
-  if (argument_count.is_valid()) {
-    if (!argument_count_is_length) {
-      ShiftLeftImm(argument_count, argument_count, Operand(kPointerSizeLog2));
-    }
-    add(sp, sp, argument_count);
-  }
-}
-
-void TurboAssembler::MovFromFloatResult(const DoubleRegister dst) {
-  Move(dst, d1);
-}
-
-void TurboAssembler::MovFromFloatParameter(const DoubleRegister dst) {
-  Move(dst, d1);
-}
-
-void TurboAssembler::PrepareForTailCall(const ParameterCount& callee_args_count,
-                                        Register caller_args_count_reg,
-                                        Register scratch0, Register scratch1) {
-#if DEBUG
-  if (callee_args_count.is_reg()) {
-    DCHECK(!AreAliased(callee_args_count.reg(), caller_args_count_reg, scratch0,
-                       scratch1));
-  } else {
-    DCHECK(!AreAliased(caller_args_count_reg, scratch0, scratch1));
-  }
-#endif
-
-  // Calculate the end of destination area where we will put the arguments
-  // after we drop current frame. We add kPointerSize to count the receiver
-  // argument which is not included into formal parameters count.
-  Register dst_reg = scratch0;
-  ShiftLeftImm(dst_reg, caller_args_count_reg, Operand(kPointerSizeLog2));
-  add(dst_reg, fp, dst_reg);
-  addi(dst_reg, dst_reg,
-       Operand(StandardFrameConstants::kCallerSPOffset + kPointerSize));
-
-  Register src_reg = caller_args_count_reg;
-  // Calculate the end of source area. +kPointerSize is for the receiver.
-  if (callee_args_count.is_reg()) {
-    ShiftLeftImm(src_reg, callee_args_count.reg(), Operand(kPointerSizeLog2));
-    add(src_reg, sp, src_reg);
-    addi(src_reg, src_reg, Operand(kPointerSize));
-  } else {
-    Add(src_reg, sp, (callee_args_count.immediate() + 1) * kPointerSize, r0);
-  }
-
-  if (FLAG_debug_code) {
-    cmpl(src_reg, dst_reg);
-    Check(lt, AbortReason::kStackAccessBelowStackPointer);
-  }
-
-  // Restore caller's frame pointer and return address now as they will be
-  // overwritten by the copying loop.
-  RestoreFrameStateForTailCall();
-
-  // Now copy callee arguments to the caller frame going backwards to avoid
-  // callee arguments corruption (source and destination areas could overlap).
-
-  // Both src_reg and dst_reg are pointing to the word after the one to copy,
-  // so they must be pre-decremented in the loop.
-  Register tmp_reg = scratch1;
-  Label loop;
-  if (callee_args_count.is_reg()) {
-    addi(tmp_reg, callee_args_count.reg(), Operand(1));  // +1 for receiver
-  } else {
-    mov(tmp_reg, Operand(callee_args_count.immediate() + 1));
-  }
-  mtctr(tmp_reg);
-  bind(&loop);
-  LoadPU(tmp_reg, MemOperand(src_reg, -kPointerSize));
-  StorePU(tmp_reg, MemOperand(dst_reg, -kPointerSize));
-  bdnz(&loop);
-
-  // Leave current frame.
-  mr(sp, dst_reg);
-}
-
-void MacroAssembler::InvokePrologue(const ParameterCount& expected,
-                                    const ParameterCount& actual, Label* done,
-                                    bool* definitely_mismatches,
-                                    InvokeFlag flag) {
-  bool definitely_matches = false;
-  *definitely_mismatches = false;
-  Label regular_invoke;
-
-  // Check whether the expected and actual arguments count match. If not,
-  // setup registers according to contract with ArgumentsAdaptorTrampoline:
-  //  r3: actual arguments count
-  //  r4: function (passed through to callee)
-  //  r5: expected arguments count
-
-  // The code below is made a lot easier because the calling code already sets
-  // up actual and expected registers according to the contract if values are
-  // passed in registers.
-
-  // ARM has some sanity checks as per below, considering add them for PPC
-  //  DCHECK(actual.is_immediate() || actual.reg() == r3);
-  //  DCHECK(expected.is_immediate() || expected.reg() == r5);
-
-  if (expected.is_immediate()) {
-    DCHECK(actual.is_immediate());
-    mov(r3, Operand(actual.immediate()));
-    if (expected.immediate() == actual.immediate()) {
-      definitely_matches = true;
-    } else {
-      const int sentinel = SharedFunctionInfo::kDontAdaptArgumentsSentinel;
-      if (expected.immediate() == sentinel) {
-        // Don't worry about adapting arguments for builtins that
-        // don't want that done. Skip adaption code by making it look
-        // like we have a match between expected and actual number of
-        // arguments.
-        definitely_matches = true;
-      } else {
-        *definitely_mismatches = true;
-        mov(r5, Operand(expected.immediate()));
-      }
-    }
-  } else {
-    if (actual.is_immediate()) {
-      mov(r3, Operand(actual.immediate()));
-      cmpi(expected.reg(), Operand(actual.immediate()));
-      beq(&regular_invoke);
-    } else {
-      cmp(expected.reg(), actual.reg());
-      beq(&regular_invoke);
-    }
-  }
-
-  if (!definitely_matches) {
-    Handle<Code> adaptor = BUILTIN_CODE(isolate(), ArgumentsAdaptorTrampoline);
-    if (flag == CALL_FUNCTION) {
-      Call(adaptor);
-      if (!*definitely_mismatches) {
-        b(done);
-      }
-    } else {
-      Jump(adaptor, RelocInfo::CODE_TARGET);
-    }
-    bind(&regular_invoke);
-  }
-}
-
-void MacroAssembler::CheckDebugHook(Register fun, Register new_target,
-                                    const ParameterCount& expected,
-                                    const ParameterCount& actual) {
-  Label skip_hook;
-  ExternalReference debug_hook_avtive =
-      ExternalReference::debug_hook_on_function_call_address(isolate());
-  mov(r7, Operand(debug_hook_avtive));
-  LoadByte(r7, MemOperand(r7), r0);
-  extsb(r7, r7);
-  CmpSmiLiteral(r7, Smi::kZero, r0);
-  beq(&skip_hook);
-  {
-    FrameScope frame(this,
-                     has_frame() ? StackFrame::NONE : StackFrame::INTERNAL);
-    if (expected.is_reg()) {
-      SmiTag(expected.reg());
-      Push(expected.reg());
-    }
-    if (actual.is_reg()) {
-      SmiTag(actual.reg());
-      Push(actual.reg());
-    }
-    if (new_target.is_valid()) {
-      Push(new_target);
-    }
-    Push(fun, fun);
-    CallRuntime(Runtime::kDebugOnFunctionCall);
-    Pop(fun);
-    if (new_target.is_valid()) {
-      Pop(new_target);
-    }
-    if (actual.is_reg()) {
-      Pop(actual.reg());
-      SmiUntag(actual.reg());
-    }
-    if (expected.is_reg()) {
-      Pop(expected.reg());
-      SmiUntag(expected.reg());
-    }
-  }
-  bind(&skip_hook);
-}
-
-void MacroAssembler::InvokeFunctionCode(Register function, Register new_target,
-                                        const ParameterCount& expected,
-                                        const ParameterCount& actual,
-                                        InvokeFlag flag) {
-  // You can't call a function without a valid frame.
-  DCHECK(flag == JUMP_FUNCTION || has_frame());
-  DCHECK(function == r4);
-  DCHECK_IMPLIES(new_target.is_valid(), new_target == r6);
-
-  // On function call, call into the debugger if necessary.
-  CheckDebugHook(function, new_target, expected, actual);
-
-  // Clear the new.target register if not given.
-  if (!new_target.is_valid()) {
-    LoadRoot(r6, Heap::kUndefinedValueRootIndex);
-  }
-
-  Label done;
-  bool definitely_mismatches = false;
-  InvokePrologue(expected, actual, &done, &definitely_mismatches, flag);
-  if (!definitely_mismatches) {
-    // We call indirectly through the code field in the function to
-    // allow recompilation to take effect without changing any of the
-    // call sites.
-    Register code = ip;
-    LoadP(code, FieldMemOperand(function, JSFunction::kCodeOffset));
-    addi(code, code, Operand(Code::kHeaderSize - kHeapObjectTag));
-    if (flag == CALL_FUNCTION) {
-      CallJSEntry(code);
-    } else {
-      DCHECK(flag == JUMP_FUNCTION);
-      JumpToJSEntry(code);
-    }
-
-    // Continue here if InvokePrologue does handle the invocation due to
-    // mismatched parameter counts.
-    bind(&done);
-  }
-}
-
-void MacroAssembler::InvokeFunction(Register fun, Register new_target,
-                                    const ParameterCount& actual,
-                                    InvokeFlag flag) {
-  // You can't call a function without a valid frame.
-  DCHECK(flag == JUMP_FUNCTION || has_frame());
-
-  // Contract with called JS functions requires that function is passed in r4.
-  DCHECK(fun == r4);
-
-  Register expected_reg = r5;
-  Register temp_reg = r7;
-
-  LoadP(temp_reg, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset));
-  LoadP(cp, FieldMemOperand(r4, JSFunction::kContextOffset));
-  LoadWordArith(expected_reg,
-                FieldMemOperand(
-                    temp_reg, SharedFunctionInfo::kFormalParameterCountOffset));
-
-  ParameterCount expected(expected_reg);
-  InvokeFunctionCode(fun, new_target, expected, actual, flag);
-}
-
-void MacroAssembler::InvokeFunction(Register function,
-                                    const ParameterCount& expected,
-                                    const ParameterCount& actual,
-                                    InvokeFlag flag) {
-  // You can't call a function without a valid frame.
-  DCHECK(flag == JUMP_FUNCTION || has_frame());
-
-  // Contract with called JS functions requires that function is passed in r4.
-  DCHECK(function == r4);
-
-  // Get the function and setup the context.
-  LoadP(cp, FieldMemOperand(r4, JSFunction::kContextOffset));
-
-  InvokeFunctionCode(r4, no_reg, expected, actual, flag);
-}
-
-void MacroAssembler::InvokeFunction(Handle<JSFunction> function,
-                                    const ParameterCount& expected,
-                                    const ParameterCount& actual,
-                                    InvokeFlag flag) {
-  Move(r4, function);
-  InvokeFunction(r4, expected, actual, flag);
-}
-
-void MacroAssembler::MaybeDropFrames() {
-  // Check whether we need to drop frames to restart a function on the stack.
-  ExternalReference restart_fp =
-      ExternalReference::debug_restart_fp_address(isolate());
-  mov(r4, Operand(restart_fp));
-  LoadP(r4, MemOperand(r4));
-  cmpi(r4, Operand::Zero());
-  Jump(BUILTIN_CODE(isolate(), FrameDropperTrampoline), RelocInfo::CODE_TARGET,
-       ne);
-}
-
-void MacroAssembler::PushStackHandler() {
-  // Adjust this code if not the case.
-  STATIC_ASSERT(StackHandlerConstants::kSize == 2 * kPointerSize);
-  STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize);
-
-  Push(Smi::kZero);  // Padding.
-
-  // Link the current handler as the next handler.
-  // Preserve r3-r7.
-  mov(r8,
-      Operand(ExternalReference(IsolateAddressId::kHandlerAddress, isolate())));
-  LoadP(r0, MemOperand(r8));
-  push(r0);
-
-  // Set this new handler as the current one.
-  StoreP(sp, MemOperand(r8));
-}
-
-
-void MacroAssembler::PopStackHandler() {
-  STATIC_ASSERT(StackHandlerConstants::kSize == 2 * kPointerSize);
-  STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
-
-  pop(r4);
-  mov(ip,
-      Operand(ExternalReference(IsolateAddressId::kHandlerAddress, isolate())));
-  StoreP(r4, MemOperand(ip));
-
-  Drop(1);  // Drop padding.
-}
-
-
-void MacroAssembler::CompareObjectType(Register object, Register map,
-                                       Register type_reg, InstanceType type) {
-  const Register temp = type_reg == no_reg ? r0 : type_reg;
-
-  LoadP(map, FieldMemOperand(object, HeapObject::kMapOffset));
-  CompareInstanceType(map, temp, type);
-}
-
-
-void MacroAssembler::CompareInstanceType(Register map, Register type_reg,
-                                         InstanceType type) {
-  STATIC_ASSERT(Map::kInstanceTypeOffset < 4096);
-  STATIC_ASSERT(LAST_TYPE <= 0xFFFF);
-  lhz(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset));
-  cmpi(type_reg, Operand(type));
-}
-
-
-void MacroAssembler::CompareRoot(Register obj, Heap::RootListIndex index) {
-  DCHECK(obj != r0);
-  LoadRoot(r0, index);
-  cmp(obj, r0);
-}
-
-void TurboAssembler::AddAndCheckForOverflow(Register dst, Register left,
-                                            Register right,
-                                            Register overflow_dst,
-                                            Register scratch) {
-  DCHECK(dst != overflow_dst);
-  DCHECK(dst != scratch);
-  DCHECK(overflow_dst != scratch);
-  DCHECK(overflow_dst != left);
-  DCHECK(overflow_dst != right);
-
-  bool left_is_right = left == right;
-  RCBit xorRC = left_is_right ? SetRC : LeaveRC;
-
-  // C = A+B; C overflows if A/B have same sign and C has diff sign than A
-  if (dst == left) {
-    mr(scratch, left);            // Preserve left.
-    add(dst, left, right);        // Left is overwritten.
-    xor_(overflow_dst, dst, scratch, xorRC);  // Original left.
-    if (!left_is_right) xor_(scratch, dst, right);
-  } else if (dst == right) {
-    mr(scratch, right);           // Preserve right.
-    add(dst, left, right);        // Right is overwritten.
-    xor_(overflow_dst, dst, left, xorRC);
-    if (!left_is_right) xor_(scratch, dst, scratch);  // Original right.
-  } else {
-    add(dst, left, right);
-    xor_(overflow_dst, dst, left, xorRC);
-    if (!left_is_right) xor_(scratch, dst, right);
-  }
-  if (!left_is_right) and_(overflow_dst, scratch, overflow_dst, SetRC);
-}
-
-void TurboAssembler::AddAndCheckForOverflow(Register dst, Register left,
-                                            intptr_t right,
-                                            Register overflow_dst,
-                                            Register scratch) {
-  Register original_left = left;
-  DCHECK(dst != overflow_dst);
-  DCHECK(dst != scratch);
-  DCHECK(overflow_dst != scratch);
-  DCHECK(overflow_dst != left);
-
-  // C = A+B; C overflows if A/B have same sign and C has diff sign than A
-  if (dst == left) {
-    // Preserve left.
-    original_left = overflow_dst;
-    mr(original_left, left);
-  }
-  Add(dst, left, right, scratch);
-  xor_(overflow_dst, dst, original_left);
-  if (right >= 0) {
-    and_(overflow_dst, overflow_dst, dst, SetRC);
-  } else {
-    andc(overflow_dst, overflow_dst, dst, SetRC);
-  }
-}
-
-void TurboAssembler::SubAndCheckForOverflow(Register dst, Register left,
-                                            Register right,
-                                            Register overflow_dst,
-                                            Register scratch) {
-  DCHECK(dst != overflow_dst);
-  DCHECK(dst != scratch);
-  DCHECK(overflow_dst != scratch);
-  DCHECK(overflow_dst != left);
-  DCHECK(overflow_dst != right);
-
-  // C = A-B; C overflows if A/B have diff signs and C has diff sign than A
-  if (dst == left) {
-    mr(scratch, left);      // Preserve left.
-    sub(dst, left, right);  // Left is overwritten.
-    xor_(overflow_dst, dst, scratch);
-    xor_(scratch, scratch, right);
-    and_(overflow_dst, overflow_dst, scratch, SetRC);
-  } else if (dst == right) {
-    mr(scratch, right);     // Preserve right.
-    sub(dst, left, right);  // Right is overwritten.
-    xor_(overflow_dst, dst, left);
-    xor_(scratch, left, scratch);
-    and_(overflow_dst, overflow_dst, scratch, SetRC);
-  } else {
-    sub(dst, left, right);
-    xor_(overflow_dst, dst, left);
-    xor_(scratch, left, right);
-    and_(overflow_dst, scratch, overflow_dst, SetRC);
-  }
-}
-
-
-void MacroAssembler::CallStub(CodeStub* stub, Condition cond) {
-  DCHECK(AllowThisStubCall(stub));  // Stub calls are not allowed in some stubs.
-  Call(stub->GetCode(), RelocInfo::CODE_TARGET, cond);
-}
-
-void TurboAssembler::CallStubDelayed(CodeStub* stub) {
-  DCHECK(AllowThisStubCall(stub));  // Stub calls are not allowed in some stubs.
-
-  // Block constant pool for the call instruction sequence.
-  ConstantPoolUnavailableScope constant_pool_unavailable(this);
-
-  mov(ip, Operand::EmbeddedCode(stub));
-  mtctr(ip);
-  bctrl();
-}
-
-void MacroAssembler::TailCallStub(CodeStub* stub, Condition cond) {
-  Jump(stub->GetCode(), RelocInfo::CODE_TARGET, cond);
-}
-
-bool TurboAssembler::AllowThisStubCall(CodeStub* stub) {
-  return has_frame_ || !stub->SometimesSetsUpAFrame();
-}
-
-void MacroAssembler::TryDoubleToInt32Exact(Register result,
-                                           DoubleRegister double_input,
-                                           Register scratch,
-                                           DoubleRegister double_scratch) {
-  Label done;
-  DCHECK(double_input != double_scratch);
-
-  ConvertDoubleToInt64(double_input,
-#if !V8_TARGET_ARCH_PPC64
-                       scratch,
-#endif
-                       result, double_scratch);
-
-#if V8_TARGET_ARCH_PPC64
-  TestIfInt32(result, r0);
-#else
-  TestIfInt32(scratch, result, r0);
-#endif
-  bne(&done);
-
-  // convert back and compare
-  fcfid(double_scratch, double_scratch);
-  fcmpu(double_scratch, double_input);
-  bind(&done);
-}
-
-void TurboAssembler::TruncateDoubleToIDelayed(Zone* zone, Register result,
-                                              DoubleRegister double_input) {
-  Label done;
-
-  TryInlineTruncateDoubleToI(result, double_input, &done);
-
-  // If we fell through then inline version didn't succeed - call stub instead.
-  mflr(r0);
-  push(r0);
-  // Put input on stack.
-  stfdu(double_input, MemOperand(sp, -kDoubleSize));
-
-  CallStubDelayed(new (zone) DoubleToIStub(nullptr, result));
-
-  addi(sp, sp, Operand(kDoubleSize));
-  pop(r0);
-  mtlr(r0);
-
-  bind(&done);
-}
-
-void TurboAssembler::TryInlineTruncateDoubleToI(Register result,
-                                                DoubleRegister double_input,
-                                                Label* done) {
-  DoubleRegister double_scratch = kScratchDoubleReg;
-#if !V8_TARGET_ARCH_PPC64
-  Register scratch = ip;
-#endif
-
-  ConvertDoubleToInt64(double_input,
-#if !V8_TARGET_ARCH_PPC64
-                       scratch,
-#endif
-                       result, double_scratch);
-
-// Test for overflow
-#if V8_TARGET_ARCH_PPC64
-  TestIfInt32(result, r0);
-#else
-  TestIfInt32(scratch, result, r0);
-#endif
-  beq(done);
-}
-
-void TurboAssembler::CallRuntimeDelayed(Zone* zone, Runtime::FunctionId fid,
-                                        SaveFPRegsMode save_doubles) {
-  const Runtime::Function* f = Runtime::FunctionForId(fid);
-  // TODO(1236192): Most runtime routines don't need the number of
-  // arguments passed in because it is constant. At some point we
-  // should remove this need and make the runtime routine entry code
-  // smarter.
-  mov(r3, Operand(f->nargs));
-  mov(r4, Operand(ExternalReference(f, isolate())));
-  CallStubDelayed(new (zone) CEntryStub(nullptr,
-#if V8_TARGET_ARCH_PPC64
-                                        f->result_size,
-#else
-                                        1,
-#endif
-                                        save_doubles));
-}
-
-void MacroAssembler::CallRuntime(const Runtime::Function* f, int num_arguments,
-                                 SaveFPRegsMode save_doubles) {
-  // All parameters are on the stack.  r3 has the return value after call.
-
-  // If the expected number of arguments of the runtime function is
-  // constant, we check that the actual number of arguments match the
-  // expectation.
-  CHECK(f->nargs < 0 || f->nargs == num_arguments);
-
-  // TODO(1236192): Most runtime routines don't need the number of
-  // arguments passed in because it is constant. At some point we
-  // should remove this need and make the runtime routine entry code
-  // smarter.
-  mov(r3, Operand(num_arguments));
-  mov(r4, Operand(ExternalReference(f, isolate())));
-  CEntryStub stub(isolate(),
-#if V8_TARGET_ARCH_PPC64
-                  f->result_size,
-#else
-                  1,
-#endif
-                  save_doubles);
-  CallStub(&stub);
-}
-
-void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid) {
-  const Runtime::Function* function = Runtime::FunctionForId(fid);
-  DCHECK_EQ(1, function->result_size);
-  if (function->nargs >= 0) {
-    mov(r3, Operand(function->nargs));
-  }
-  JumpToExternalReference(ExternalReference(fid, isolate()));
-}
-
-
-void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin,
-                                             bool builtin_exit_frame) {
-  mov(r4, Operand(builtin));
-  CEntryStub stub(isolate(), 1, kDontSaveFPRegs, kArgvOnStack,
-                  builtin_exit_frame);
-  Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
-}
-
-
-void MacroAssembler::IncrementCounter(StatsCounter* counter, int value,
-                                      Register scratch1, Register scratch2) {
-  DCHECK_GT(value, 0);
-  if (FLAG_native_code_counters && counter->Enabled()) {
-    mov(scratch2, Operand(ExternalReference(counter)));
-    lwz(scratch1, MemOperand(scratch2));
-    addi(scratch1, scratch1, Operand(value));
-    stw(scratch1, MemOperand(scratch2));
-  }
-}
-
-
-void MacroAssembler::DecrementCounter(StatsCounter* counter, int value,
-                                      Register scratch1, Register scratch2) {
-  DCHECK_GT(value, 0);
-  if (FLAG_native_code_counters && counter->Enabled()) {
-    mov(scratch2, Operand(ExternalReference(counter)));
-    lwz(scratch1, MemOperand(scratch2));
-    subi(scratch1, scratch1, Operand(value));
-    stw(scratch1, MemOperand(scratch2));
-  }
-}
-
-void TurboAssembler::Assert(Condition cond, AbortReason reason,
-                            CRegister cr) {
-  if (emit_debug_code()) Check(cond, reason, cr);
-}
-
-void TurboAssembler::Check(Condition cond, AbortReason reason, CRegister cr) {
-  Label L;
-  b(cond, &L, cr);
-  Abort(reason);
-  // will not return here
-  bind(&L);
-}
-
-void TurboAssembler::Abort(AbortReason reason) {
-  Label abort_start;
-  bind(&abort_start);
-#ifdef DEBUG
-  const char* msg = GetBailoutReason(reason);
-  if (msg != nullptr) {
-    RecordComment("Abort message: ");
-    RecordComment(msg);
-  }
-
-  if (FLAG_trap_on_abort) {
-    stop(msg);
-    return;
-  }
-#endif
-
-  LoadSmiLiteral(r4, Smi::FromInt(static_cast<int>(reason)));
-
-  // Disable stub call restrictions to always allow calls to abort.
-  if (!has_frame_) {
-    // We don't actually want to generate a pile of code for this, so just
-    // claim there is a stack frame, without generating one.
-    FrameScope scope(this, StackFrame::NONE);
-    Call(BUILTIN_CODE(isolate(), Abort), RelocInfo::CODE_TARGET);
-  } else {
-    Call(BUILTIN_CODE(isolate(), Abort), RelocInfo::CODE_TARGET);
-  }
-  // will not return here
-}
-
-void MacroAssembler::LoadNativeContextSlot(int index, Register dst) {
-  LoadP(dst, NativeContextMemOperand());
-  LoadP(dst, ContextMemOperand(dst, index));
-}
-
-
-void MacroAssembler::UntagAndJumpIfSmi(Register dst, Register src,
-                                       Label* smi_case) {
-  STATIC_ASSERT(kSmiTag == 0);
-  TestBitRange(src, kSmiTagSize - 1, 0, r0);
-  SmiUntag(dst, src);
-  beq(smi_case, cr0);
-}
-
-void MacroAssembler::JumpIfEitherSmi(Register reg1, Register reg2,
-                                     Label* on_either_smi) {
-  STATIC_ASSERT(kSmiTag == 0);
-  JumpIfSmi(reg1, on_either_smi);
-  JumpIfSmi(reg2, on_either_smi);
-}
-
-void MacroAssembler::AssertNotSmi(Register object) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    TestIfSmi(object, r0);
-    Check(ne, AbortReason::kOperandIsASmi, cr0);
-  }
-}
-
-
-void MacroAssembler::AssertSmi(Register object) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    TestIfSmi(object, r0);
-    Check(eq, AbortReason::kOperandIsNotASmi, cr0);
-  }
-}
-
-void MacroAssembler::AssertFixedArray(Register object) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    TestIfSmi(object, r0);
-    Check(ne, AbortReason::kOperandIsASmiAndNotAFixedArray, cr0);
-    push(object);
-    CompareObjectType(object, object, object, FIXED_ARRAY_TYPE);
-    pop(object);
-    Check(eq, AbortReason::kOperandIsNotAFixedArray);
-  }
-}
-
-void MacroAssembler::AssertFunction(Register object) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    TestIfSmi(object, r0);
-    Check(ne, AbortReason::kOperandIsASmiAndNotAFunction, cr0);
-    push(object);
-    CompareObjectType(object, object, object, JS_FUNCTION_TYPE);
-    pop(object);
-    Check(eq, AbortReason::kOperandIsNotAFunction);
-  }
-}
-
-
-void MacroAssembler::AssertBoundFunction(Register object) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    TestIfSmi(object, r0);
-    Check(ne, AbortReason::kOperandIsASmiAndNotABoundFunction, cr0);
-    push(object);
-    CompareObjectType(object, object, object, JS_BOUND_FUNCTION_TYPE);
-    pop(object);
-    Check(eq, AbortReason::kOperandIsNotABoundFunction);
-  }
-}
-
-void MacroAssembler::AssertGeneratorObject(Register object) {
-  if (!emit_debug_code()) return;
-  TestIfSmi(object, r0);
-  Check(ne, AbortReason::kOperandIsASmiAndNotAGeneratorObject, cr0);
-
-  // Load map
-  Register map = object;
-  push(object);
-  LoadP(map, FieldMemOperand(object, HeapObject::kMapOffset));
-
-  // Check if JSGeneratorObject
-  Label do_check;
-  Register instance_type = object;
-  CompareInstanceType(map, instance_type, JS_GENERATOR_OBJECT_TYPE);
-  beq(&do_check);
-
-  // Check if JSAsyncGeneratorObject (See MacroAssembler::CompareInstanceType)
-  cmpi(instance_type, Operand(JS_ASYNC_GENERATOR_OBJECT_TYPE));
-
-  bind(&do_check);
-  // Restore generator object to register and perform assertion
-  pop(object);
-  Check(eq, AbortReason::kOperandIsNotAGeneratorObject);
-}
-
-void MacroAssembler::AssertUndefinedOrAllocationSite(Register object,
-                                                     Register scratch) {
-  if (emit_debug_code()) {
-    Label done_checking;
-    AssertNotSmi(object);
-    CompareRoot(object, Heap::kUndefinedValueRootIndex);
-    beq(&done_checking);
-    LoadP(scratch, FieldMemOperand(object, HeapObject::kMapOffset));
-    CompareRoot(scratch, Heap::kAllocationSiteMapRootIndex);
-    Assert(eq, AbortReason::kExpectedUndefinedOrCell);
-    bind(&done_checking);
-  }
-}
-
-
-static const int kRegisterPassedArguments = 8;
-
-int TurboAssembler::CalculateStackPassedWords(int num_reg_arguments,
-                                              int num_double_arguments) {
-  int stack_passed_words = 0;
-  if (num_double_arguments > DoubleRegister::kNumRegisters) {
-    stack_passed_words +=
-        2 * (num_double_arguments - DoubleRegister::kNumRegisters);
-  }
-  // Up to 8 simple arguments are passed in registers r3..r10.
-  if (num_reg_arguments > kRegisterPassedArguments) {
-    stack_passed_words += num_reg_arguments - kRegisterPassedArguments;
-  }
-  return stack_passed_words;
-}
-
-void TurboAssembler::PrepareCallCFunction(int num_reg_arguments,
-                                          int num_double_arguments,
-                                          Register scratch) {
-  int frame_alignment = ActivationFrameAlignment();
-  int stack_passed_arguments =
-      CalculateStackPassedWords(num_reg_arguments, num_double_arguments);
-  int stack_space = kNumRequiredStackFrameSlots;
-
-  if (frame_alignment > kPointerSize) {
-    // Make stack end at alignment and make room for stack arguments
-    // -- preserving original value of sp.
-    mr(scratch, sp);
-    addi(sp, sp, Operand(-(stack_passed_arguments + 1) * kPointerSize));
-    DCHECK(base::bits::IsPowerOfTwo(frame_alignment));
-    ClearRightImm(sp, sp, Operand(WhichPowerOf2(frame_alignment)));
-    StoreP(scratch, MemOperand(sp, stack_passed_arguments * kPointerSize));
-  } else {
-    // Make room for stack arguments
-    stack_space += stack_passed_arguments;
-  }
-
-  // Allocate frame with required slots to make ABI work.
-  li(r0, Operand::Zero());
-  StorePU(r0, MemOperand(sp, -stack_space * kPointerSize));
-}
-
-void TurboAssembler::PrepareCallCFunction(int num_reg_arguments,
-                                          Register scratch) {
-  PrepareCallCFunction(num_reg_arguments, 0, scratch);
-}
-
-void TurboAssembler::MovToFloatParameter(DoubleRegister src) { Move(d1, src); }
-
-void TurboAssembler::MovToFloatResult(DoubleRegister src) { Move(d1, src); }
-
-void TurboAssembler::MovToFloatParameters(DoubleRegister src1,
-                                          DoubleRegister src2) {
-  if (src2 == d1) {
-    DCHECK(src1 != d2);
-    Move(d2, src2);
-    Move(d1, src1);
-  } else {
-    Move(d1, src1);
-    Move(d2, src2);
-  }
-}
-
-void TurboAssembler::CallCFunction(ExternalReference function,
-                                   int num_reg_arguments,
-                                   int num_double_arguments) {
-  mov(ip, Operand(function));
-  CallCFunctionHelper(ip, num_reg_arguments, num_double_arguments);
-}
-
-void TurboAssembler::CallCFunction(Register function, int num_reg_arguments,
-                                   int num_double_arguments) {
-  CallCFunctionHelper(function, num_reg_arguments, num_double_arguments);
-}
-
-void TurboAssembler::CallCFunction(ExternalReference function,
-                                   int num_arguments) {
-  CallCFunction(function, num_arguments, 0);
-}
-
-void TurboAssembler::CallCFunction(Register function, int num_arguments) {
-  CallCFunction(function, num_arguments, 0);
-}
-
-void TurboAssembler::CallCFunctionHelper(Register function,
-                                         int num_reg_arguments,
-                                         int num_double_arguments) {
-  DCHECK_LE(num_reg_arguments + num_double_arguments, kMaxCParameters);
-  DCHECK(has_frame());
-
-  // Just call directly. The function called cannot cause a GC, or
-  // allow preemption, so the return address in the link register
-  // stays correct.
-  Register dest = function;
-  if (ABI_USES_FUNCTION_DESCRIPTORS) {
-    // AIX/PPC64BE Linux uses a function descriptor. When calling C code be
-    // aware of this descriptor and pick up values from it
-    LoadP(ToRegister(ABI_TOC_REGISTER), MemOperand(function, kPointerSize));
-    LoadP(ip, MemOperand(function, 0));
-    dest = ip;
-  } else if (ABI_CALL_VIA_IP) {
-    Move(ip, function);
-    dest = ip;
-  }
-
-  Call(dest);
-
-  // Remove frame bought in PrepareCallCFunction
-  int stack_passed_arguments =
-      CalculateStackPassedWords(num_reg_arguments, num_double_arguments);
-  int stack_space = kNumRequiredStackFrameSlots + stack_passed_arguments;
-  if (ActivationFrameAlignment() > kPointerSize) {
-    LoadP(sp, MemOperand(sp, stack_space * kPointerSize));
-  } else {
-    addi(sp, sp, Operand(stack_space * kPointerSize));
-  }
-}
-
-
-void TurboAssembler::CheckPageFlag(
-    Register object,
-    Register scratch,  // scratch may be same register as object
-    int mask, Condition cc, Label* condition_met) {
-  DCHECK(cc == ne || cc == eq);
-  ClearRightImm(scratch, object, Operand(kPageSizeBits));
-  LoadP(scratch, MemOperand(scratch, MemoryChunk::kFlagsOffset));
-
-  mov(r0, Operand(mask));
-  and_(r0, scratch, r0, SetRC);
-
-  if (cc == ne) {
-    bne(condition_met, cr0);
-  }
-  if (cc == eq) {
-    beq(condition_met, cr0);
-  }
-}
-
-void TurboAssembler::SetRoundingMode(FPRoundingMode RN) { mtfsfi(7, RN); }
-
-void TurboAssembler::ResetRoundingMode() {
-  mtfsfi(7, kRoundToNearest);  // reset (default is kRoundToNearest)
-}
-
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// New MacroAssembler Interfaces added for PPC
-//
-////////////////////////////////////////////////////////////////////////////////
-void TurboAssembler::LoadIntLiteral(Register dst, int value) {
-  mov(dst, Operand(value));
-}
-
-void TurboAssembler::LoadSmiLiteral(Register dst, Smi* smi) {
-  mov(dst, Operand(smi));
-}
-
-void TurboAssembler::LoadDoubleLiteral(DoubleRegister result, Double value,
-                                       Register scratch) {
-  if (FLAG_enable_embedded_constant_pool && is_constant_pool_available() &&
-      !(scratch == r0 && ConstantPoolAccessIsInOverflow())) {
-    ConstantPoolEntry::Access access = ConstantPoolAddEntry(value);
-    if (access == ConstantPoolEntry::OVERFLOWED) {
-      addis(scratch, kConstantPoolRegister, Operand::Zero());
-      lfd(result, MemOperand(scratch, 0));
-    } else {
-      lfd(result, MemOperand(kConstantPoolRegister, 0));
-    }
-    return;
-  }
-
-  // avoid gcc strict aliasing error using union cast
-  union {
-    uint64_t dval;
-#if V8_TARGET_ARCH_PPC64
-    intptr_t ival;
-#else
-    intptr_t ival[2];
-#endif
-  } litVal;
-
-  litVal.dval = value.AsUint64();
-
-#if V8_TARGET_ARCH_PPC64
-  if (CpuFeatures::IsSupported(FPR_GPR_MOV)) {
-    mov(scratch, Operand(litVal.ival));
-    mtfprd(result, scratch);
-    return;
-  }
-#endif
-
-  addi(sp, sp, Operand(-kDoubleSize));
-#if V8_TARGET_ARCH_PPC64
-  mov(scratch, Operand(litVal.ival));
-  std(scratch, MemOperand(sp));
-#else
-  LoadIntLiteral(scratch, litVal.ival[0]);
-  stw(scratch, MemOperand(sp, 0));
-  LoadIntLiteral(scratch, litVal.ival[1]);
-  stw(scratch, MemOperand(sp, 4));
-#endif
-  nop(GROUP_ENDING_NOP);  // LHS/RAW optimization
-  lfd(result, MemOperand(sp, 0));
-  addi(sp, sp, Operand(kDoubleSize));
-}
-
-void TurboAssembler::MovIntToDouble(DoubleRegister dst, Register src,
-                                    Register scratch) {
-// sign-extend src to 64-bit
-#if V8_TARGET_ARCH_PPC64
-  if (CpuFeatures::IsSupported(FPR_GPR_MOV)) {
-    mtfprwa(dst, src);
-    return;
-  }
-#endif
-
-  DCHECK(src != scratch);
-  subi(sp, sp, Operand(kDoubleSize));
-#if V8_TARGET_ARCH_PPC64
-  extsw(scratch, src);
-  std(scratch, MemOperand(sp, 0));
-#else
-  srawi(scratch, src, 31);
-  stw(scratch, MemOperand(sp, Register::kExponentOffset));
-  stw(src, MemOperand(sp, Register::kMantissaOffset));
-#endif
-  nop(GROUP_ENDING_NOP);  // LHS/RAW optimization
-  lfd(dst, MemOperand(sp, 0));
-  addi(sp, sp, Operand(kDoubleSize));
-}
-
-void TurboAssembler::MovUnsignedIntToDouble(DoubleRegister dst, Register src,
-                                            Register scratch) {
-// zero-extend src to 64-bit
-#if V8_TARGET_ARCH_PPC64
-  if (CpuFeatures::IsSupported(FPR_GPR_MOV)) {
-    mtfprwz(dst, src);
-    return;
-  }
-#endif
-
-  DCHECK(src != scratch);
-  subi(sp, sp, Operand(kDoubleSize));
-#if V8_TARGET_ARCH_PPC64
-  clrldi(scratch, src, Operand(32));
-  std(scratch, MemOperand(sp, 0));
-#else
-  li(scratch, Operand::Zero());
-  stw(scratch, MemOperand(sp, Register::kExponentOffset));
-  stw(src, MemOperand(sp, Register::kMantissaOffset));
-#endif
-  nop(GROUP_ENDING_NOP);  // LHS/RAW optimization
-  lfd(dst, MemOperand(sp, 0));
-  addi(sp, sp, Operand(kDoubleSize));
-}
-
-void TurboAssembler::MovInt64ToDouble(DoubleRegister dst,
-#if !V8_TARGET_ARCH_PPC64
-                                      Register src_hi,
-#endif
-                                      Register src) {
-#if V8_TARGET_ARCH_PPC64
-  if (CpuFeatures::IsSupported(FPR_GPR_MOV)) {
-    mtfprd(dst, src);
-    return;
-  }
-#endif
-
-  subi(sp, sp, Operand(kDoubleSize));
-#if V8_TARGET_ARCH_PPC64
-  std(src, MemOperand(sp, 0));
-#else
-  stw(src_hi, MemOperand(sp, Register::kExponentOffset));
-  stw(src, MemOperand(sp, Register::kMantissaOffset));
-#endif
-  nop(GROUP_ENDING_NOP);  // LHS/RAW optimization
-  lfd(dst, MemOperand(sp, 0));
-  addi(sp, sp, Operand(kDoubleSize));
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-void TurboAssembler::MovInt64ComponentsToDouble(DoubleRegister dst,
-                                                Register src_hi,
-                                                Register src_lo,
-                                                Register scratch) {
-  if (CpuFeatures::IsSupported(FPR_GPR_MOV)) {
-    sldi(scratch, src_hi, Operand(32));
-    rldimi(scratch, src_lo, 0, 32);
-    mtfprd(dst, scratch);
-    return;
-  }
-
-  subi(sp, sp, Operand(kDoubleSize));
-  stw(src_hi, MemOperand(sp, Register::kExponentOffset));
-  stw(src_lo, MemOperand(sp, Register::kMantissaOffset));
-  nop(GROUP_ENDING_NOP);  // LHS/RAW optimization
-  lfd(dst, MemOperand(sp));
-  addi(sp, sp, Operand(kDoubleSize));
-}
-#endif
-
-void TurboAssembler::InsertDoubleLow(DoubleRegister dst, Register src,
-                                     Register scratch) {
-#if V8_TARGET_ARCH_PPC64
-  if (CpuFeatures::IsSupported(FPR_GPR_MOV)) {
-    mffprd(scratch, dst);
-    rldimi(scratch, src, 0, 32);
-    mtfprd(dst, scratch);
-    return;
-  }
-#endif
-
-  subi(sp, sp, Operand(kDoubleSize));
-  stfd(dst, MemOperand(sp));
-  stw(src, MemOperand(sp, Register::kMantissaOffset));
-  nop(GROUP_ENDING_NOP);  // LHS/RAW optimization
-  lfd(dst, MemOperand(sp));
-  addi(sp, sp, Operand(kDoubleSize));
-}
-
-void TurboAssembler::InsertDoubleHigh(DoubleRegister dst, Register src,
-                                      Register scratch) {
-#if V8_TARGET_ARCH_PPC64
-  if (CpuFeatures::IsSupported(FPR_GPR_MOV)) {
-    mffprd(scratch, dst);
-    rldimi(scratch, src, 32, 0);
-    mtfprd(dst, scratch);
-    return;
-  }
-#endif
-
-  subi(sp, sp, Operand(kDoubleSize));
-  stfd(dst, MemOperand(sp));
-  stw(src, MemOperand(sp, Register::kExponentOffset));
-  nop(GROUP_ENDING_NOP);  // LHS/RAW optimization
-  lfd(dst, MemOperand(sp));
-  addi(sp, sp, Operand(kDoubleSize));
-}
-
-void TurboAssembler::MovDoubleLowToInt(Register dst, DoubleRegister src) {
-#if V8_TARGET_ARCH_PPC64
-  if (CpuFeatures::IsSupported(FPR_GPR_MOV)) {
-    mffprwz(dst, src);
-    return;
-  }
-#endif
-
-  subi(sp, sp, Operand(kDoubleSize));
-  stfd(src, MemOperand(sp));
-  nop(GROUP_ENDING_NOP);  // LHS/RAW optimization
-  lwz(dst, MemOperand(sp, Register::kMantissaOffset));
-  addi(sp, sp, Operand(kDoubleSize));
-}
-
-void TurboAssembler::MovDoubleHighToInt(Register dst, DoubleRegister src) {
-#if V8_TARGET_ARCH_PPC64
-  if (CpuFeatures::IsSupported(FPR_GPR_MOV)) {
-    mffprd(dst, src);
-    srdi(dst, dst, Operand(32));
-    return;
-  }
-#endif
-
-  subi(sp, sp, Operand(kDoubleSize));
-  stfd(src, MemOperand(sp));
-  nop(GROUP_ENDING_NOP);  // LHS/RAW optimization
-  lwz(dst, MemOperand(sp, Register::kExponentOffset));
-  addi(sp, sp, Operand(kDoubleSize));
-}
-
-void TurboAssembler::MovDoubleToInt64(
-#if !V8_TARGET_ARCH_PPC64
-    Register dst_hi,
-#endif
-    Register dst, DoubleRegister src) {
-#if V8_TARGET_ARCH_PPC64
-  if (CpuFeatures::IsSupported(FPR_GPR_MOV)) {
-    mffprd(dst, src);
-    return;
-  }
-#endif
-
-  subi(sp, sp, Operand(kDoubleSize));
-  stfd(src, MemOperand(sp));
-  nop(GROUP_ENDING_NOP);  // LHS/RAW optimization
-#if V8_TARGET_ARCH_PPC64
-  ld(dst, MemOperand(sp, 0));
-#else
-  lwz(dst_hi, MemOperand(sp, Register::kExponentOffset));
-  lwz(dst, MemOperand(sp, Register::kMantissaOffset));
-#endif
-  addi(sp, sp, Operand(kDoubleSize));
-}
-
-void TurboAssembler::MovIntToFloat(DoubleRegister dst, Register src) {
-  subi(sp, sp, Operand(kFloatSize));
-  stw(src, MemOperand(sp, 0));
-  nop(GROUP_ENDING_NOP);  // LHS/RAW optimization
-  lfs(dst, MemOperand(sp, 0));
-  addi(sp, sp, Operand(kFloatSize));
-}
-
-void TurboAssembler::MovFloatToInt(Register dst, DoubleRegister src) {
-  subi(sp, sp, Operand(kFloatSize));
-  stfs(src, MemOperand(sp, 0));
-  nop(GROUP_ENDING_NOP);  // LHS/RAW optimization
-  lwz(dst, MemOperand(sp, 0));
-  addi(sp, sp, Operand(kFloatSize));
-}
-
-void TurboAssembler::Add(Register dst, Register src, intptr_t value,
-                         Register scratch) {
-  if (is_int16(value)) {
-    addi(dst, src, Operand(value));
-  } else {
-    mov(scratch, Operand(value));
-    add(dst, src, scratch);
-  }
-}
-
-
-void MacroAssembler::Cmpi(Register src1, const Operand& src2, Register scratch,
-                          CRegister cr) {
-  intptr_t value = src2.immediate();
-  if (is_int16(value)) {
-    cmpi(src1, src2, cr);
-  } else {
-    mov(scratch, src2);
-    cmp(src1, scratch, cr);
-  }
-}
-
-void TurboAssembler::Cmpli(Register src1, const Operand& src2, Register scratch,
-                           CRegister cr) {
-  intptr_t value = src2.immediate();
-  if (is_uint16(value)) {
-    cmpli(src1, src2, cr);
-  } else {
-    mov(scratch, src2);
-    cmpl(src1, scratch, cr);
-  }
-}
-
-void TurboAssembler::Cmpwi(Register src1, const Operand& src2, Register scratch,
-                           CRegister cr) {
-  intptr_t value = src2.immediate();
-  if (is_int16(value)) {
-    cmpwi(src1, src2, cr);
-  } else {
-    mov(scratch, src2);
-    cmpw(src1, scratch, cr);
-  }
-}
-
-
-void MacroAssembler::Cmplwi(Register src1, const Operand& src2,
-                            Register scratch, CRegister cr) {
-  intptr_t value = src2.immediate();
-  if (is_uint16(value)) {
-    cmplwi(src1, src2, cr);
-  } else {
-    mov(scratch, src2);
-    cmplw(src1, scratch, cr);
-  }
-}
-
-
-void MacroAssembler::And(Register ra, Register rs, const Operand& rb,
-                         RCBit rc) {
-  if (rb.is_reg()) {
-    and_(ra, rs, rb.rm(), rc);
-  } else {
-    if (is_uint16(rb.immediate()) && RelocInfo::IsNone(rb.rmode_) &&
-        rc == SetRC) {
-      andi(ra, rs, rb);
-    } else {
-      // mov handles the relocation.
-      DCHECK(rs != r0);
-      mov(r0, rb);
-      and_(ra, rs, r0, rc);
-    }
-  }
-}
-
-
-void MacroAssembler::Or(Register ra, Register rs, const Operand& rb, RCBit rc) {
-  if (rb.is_reg()) {
-    orx(ra, rs, rb.rm(), rc);
-  } else {
-    if (is_uint16(rb.immediate()) && RelocInfo::IsNone(rb.rmode_) &&
-        rc == LeaveRC) {
-      ori(ra, rs, rb);
-    } else {
-      // mov handles the relocation.
-      DCHECK(rs != r0);
-      mov(r0, rb);
-      orx(ra, rs, r0, rc);
-    }
-  }
-}
-
-
-void MacroAssembler::Xor(Register ra, Register rs, const Operand& rb,
-                         RCBit rc) {
-  if (rb.is_reg()) {
-    xor_(ra, rs, rb.rm(), rc);
-  } else {
-    if (is_uint16(rb.immediate()) && RelocInfo::IsNone(rb.rmode_) &&
-        rc == LeaveRC) {
-      xori(ra, rs, rb);
-    } else {
-      // mov handles the relocation.
-      DCHECK(rs != r0);
-      mov(r0, rb);
-      xor_(ra, rs, r0, rc);
-    }
-  }
-}
-
-
-void MacroAssembler::CmpSmiLiteral(Register src1, Smi* smi, Register scratch,
-                                   CRegister cr) {
-#if V8_TARGET_ARCH_PPC64
-  LoadSmiLiteral(scratch, smi);
-  cmp(src1, scratch, cr);
-#else
-  Cmpi(src1, Operand(smi), scratch, cr);
-#endif
-}
-
-
-void MacroAssembler::CmplSmiLiteral(Register src1, Smi* smi, Register scratch,
-                                    CRegister cr) {
-#if V8_TARGET_ARCH_PPC64
-  LoadSmiLiteral(scratch, smi);
-  cmpl(src1, scratch, cr);
-#else
-  Cmpli(src1, Operand(smi), scratch, cr);
-#endif
-}
-
-
-void MacroAssembler::AddSmiLiteral(Register dst, Register src, Smi* smi,
-                                   Register scratch) {
-#if V8_TARGET_ARCH_PPC64
-  LoadSmiLiteral(scratch, smi);
-  add(dst, src, scratch);
-#else
-  Add(dst, src, reinterpret_cast<intptr_t>(smi), scratch);
-#endif
-}
-
-
-void MacroAssembler::SubSmiLiteral(Register dst, Register src, Smi* smi,
-                                   Register scratch) {
-#if V8_TARGET_ARCH_PPC64
-  LoadSmiLiteral(scratch, smi);
-  sub(dst, src, scratch);
-#else
-  Add(dst, src, -(reinterpret_cast<intptr_t>(smi)), scratch);
-#endif
-}
-
-
-void MacroAssembler::AndSmiLiteral(Register dst, Register src, Smi* smi,
-                                   Register scratch, RCBit rc) {
-#if V8_TARGET_ARCH_PPC64
-  LoadSmiLiteral(scratch, smi);
-  and_(dst, src, scratch, rc);
-#else
-  And(dst, src, Operand(smi), rc);
-#endif
-}
-
-
-// Load a "pointer" sized value from the memory location
-void TurboAssembler::LoadP(Register dst, const MemOperand& mem,
-                           Register scratch) {
-  int offset = mem.offset();
-
-  if (!is_int16(offset)) {
-    /* cannot use d-form */
-    DCHECK(scratch != no_reg);
-    mov(scratch, Operand(offset));
-    LoadPX(dst, MemOperand(mem.ra(), scratch));
-  } else {
-#if V8_TARGET_ARCH_PPC64
-    int misaligned = (offset & 3);
-    if (misaligned) {
-      // adjust base to conform to offset alignment requirements
-      // Todo: enhance to use scratch if dst is unsuitable
-      DCHECK(dst != r0);
-      addi(dst, mem.ra(), Operand((offset & 3) - 4));
-      ld(dst, MemOperand(dst, (offset & ~3) + 4));
-    } else {
-      ld(dst, mem);
-    }
-#else
-    lwz(dst, mem);
-#endif
-  }
-}
-
-void TurboAssembler::LoadPU(Register dst, const MemOperand& mem,
-                            Register scratch) {
-  int offset = mem.offset();
-
-  if (!is_int16(offset)) {
-    /* cannot use d-form */
-    DCHECK(scratch != no_reg);
-    mov(scratch, Operand(offset));
-    LoadPUX(dst, MemOperand(mem.ra(), scratch));
-  } else {
-#if V8_TARGET_ARCH_PPC64
-    ldu(dst, mem);
-#else
-    lwzu(dst, mem);
-#endif
-  }
-}
-
-// Store a "pointer" sized value to the memory location
-void TurboAssembler::StoreP(Register src, const MemOperand& mem,
-                            Register scratch) {
-  int offset = mem.offset();
-
-  if (!is_int16(offset)) {
-    /* cannot use d-form */
-    DCHECK(scratch != no_reg);
-    mov(scratch, Operand(offset));
-    StorePX(src, MemOperand(mem.ra(), scratch));
-  } else {
-#if V8_TARGET_ARCH_PPC64
-    int misaligned = (offset & 3);
-    if (misaligned) {
-      // adjust base to conform to offset alignment requirements
-      // a suitable scratch is required here
-      DCHECK(scratch != no_reg);
-      if (scratch == r0) {
-        LoadIntLiteral(scratch, offset);
-        stdx(src, MemOperand(mem.ra(), scratch));
-      } else {
-        addi(scratch, mem.ra(), Operand((offset & 3) - 4));
-        std(src, MemOperand(scratch, (offset & ~3) + 4));
-      }
-    } else {
-      std(src, mem);
-    }
-#else
-    stw(src, mem);
-#endif
-  }
-}
-
-void TurboAssembler::StorePU(Register src, const MemOperand& mem,
-                             Register scratch) {
-  int offset = mem.offset();
-
-  if (!is_int16(offset)) {
-    /* cannot use d-form */
-    DCHECK(scratch != no_reg);
-    mov(scratch, Operand(offset));
-    StorePUX(src, MemOperand(mem.ra(), scratch));
-  } else {
-#if V8_TARGET_ARCH_PPC64
-    stdu(src, mem);
-#else
-    stwu(src, mem);
-#endif
-  }
-}
-
-void TurboAssembler::LoadWordArith(Register dst, const MemOperand& mem,
-                                   Register scratch) {
-  int offset = mem.offset();
-
-  if (!is_int16(offset)) {
-    DCHECK(scratch != no_reg);
-    mov(scratch, Operand(offset));
-    lwax(dst, MemOperand(mem.ra(), scratch));
-  } else {
-#if V8_TARGET_ARCH_PPC64
-    int misaligned = (offset & 3);
-    if (misaligned) {
-      // adjust base to conform to offset alignment requirements
-      // Todo: enhance to use scratch if dst is unsuitable
-      DCHECK(dst != r0);
-      addi(dst, mem.ra(), Operand((offset & 3) - 4));
-      lwa(dst, MemOperand(dst, (offset & ~3) + 4));
-    } else {
-      lwa(dst, mem);
-    }
-#else
-    lwz(dst, mem);
-#endif
-  }
-}
-
-
-// Variable length depending on whether offset fits into immediate field
-// MemOperand currently only supports d-form
-void MacroAssembler::LoadWord(Register dst, const MemOperand& mem,
-                              Register scratch) {
-  Register base = mem.ra();
-  int offset = mem.offset();
-
-  if (!is_int16(offset)) {
-    LoadIntLiteral(scratch, offset);
-    lwzx(dst, MemOperand(base, scratch));
-  } else {
-    lwz(dst, mem);
-  }
-}
-
-
-// Variable length depending on whether offset fits into immediate field
-// MemOperand current only supports d-form
-void MacroAssembler::StoreWord(Register src, const MemOperand& mem,
-                               Register scratch) {
-  Register base = mem.ra();
-  int offset = mem.offset();
-
-  if (!is_int16(offset)) {
-    LoadIntLiteral(scratch, offset);
-    stwx(src, MemOperand(base, scratch));
-  } else {
-    stw(src, mem);
-  }
-}
-
-
-void MacroAssembler::LoadHalfWordArith(Register dst, const MemOperand& mem,
-                                       Register scratch) {
-  int offset = mem.offset();
-
-  if (!is_int16(offset)) {
-    DCHECK(scratch != no_reg);
-    mov(scratch, Operand(offset));
-    lhax(dst, MemOperand(mem.ra(), scratch));
-  } else {
-    lha(dst, mem);
-  }
-}
-
-
-// Variable length depending on whether offset fits into immediate field
-// MemOperand currently only supports d-form
-void MacroAssembler::LoadHalfWord(Register dst, const MemOperand& mem,
-                                  Register scratch) {
-  Register base = mem.ra();
-  int offset = mem.offset();
-
-  if (!is_int16(offset)) {
-    LoadIntLiteral(scratch, offset);
-    lhzx(dst, MemOperand(base, scratch));
-  } else {
-    lhz(dst, mem);
-  }
-}
-
-
-// Variable length depending on whether offset fits into immediate field
-// MemOperand current only supports d-form
-void MacroAssembler::StoreHalfWord(Register src, const MemOperand& mem,
-                                   Register scratch) {
-  Register base = mem.ra();
-  int offset = mem.offset();
-
-  if (!is_int16(offset)) {
-    LoadIntLiteral(scratch, offset);
-    sthx(src, MemOperand(base, scratch));
-  } else {
-    sth(src, mem);
-  }
-}
-
-
-// Variable length depending on whether offset fits into immediate field
-// MemOperand currently only supports d-form
-void MacroAssembler::LoadByte(Register dst, const MemOperand& mem,
-                              Register scratch) {
-  Register base = mem.ra();
-  int offset = mem.offset();
-
-  if (!is_int16(offset)) {
-    LoadIntLiteral(scratch, offset);
-    lbzx(dst, MemOperand(base, scratch));
-  } else {
-    lbz(dst, mem);
-  }
-}
-
-
-// Variable length depending on whether offset fits into immediate field
-// MemOperand current only supports d-form
-void MacroAssembler::StoreByte(Register src, const MemOperand& mem,
-                               Register scratch) {
-  Register base = mem.ra();
-  int offset = mem.offset();
-
-  if (!is_int16(offset)) {
-    LoadIntLiteral(scratch, offset);
-    stbx(src, MemOperand(base, scratch));
-  } else {
-    stb(src, mem);
-  }
-}
-
-
-void MacroAssembler::LoadRepresentation(Register dst, const MemOperand& mem,
-                                        Representation r, Register scratch) {
-  DCHECK(!r.IsDouble());
-  if (r.IsInteger8()) {
-    LoadByte(dst, mem, scratch);
-    extsb(dst, dst);
-  } else if (r.IsUInteger8()) {
-    LoadByte(dst, mem, scratch);
-  } else if (r.IsInteger16()) {
-    LoadHalfWordArith(dst, mem, scratch);
-  } else if (r.IsUInteger16()) {
-    LoadHalfWord(dst, mem, scratch);
-#if V8_TARGET_ARCH_PPC64
-  } else if (r.IsInteger32()) {
-    LoadWordArith(dst, mem, scratch);
-#endif
-  } else {
-    LoadP(dst, mem, scratch);
-  }
-}
-
-
-void MacroAssembler::StoreRepresentation(Register src, const MemOperand& mem,
-                                         Representation r, Register scratch) {
-  DCHECK(!r.IsDouble());
-  if (r.IsInteger8() || r.IsUInteger8()) {
-    StoreByte(src, mem, scratch);
-  } else if (r.IsInteger16() || r.IsUInteger16()) {
-    StoreHalfWord(src, mem, scratch);
-#if V8_TARGET_ARCH_PPC64
-  } else if (r.IsInteger32()) {
-    StoreWord(src, mem, scratch);
-#endif
-  } else {
-    if (r.IsHeapObject()) {
-      AssertNotSmi(src);
-    } else if (r.IsSmi()) {
-      AssertSmi(src);
-    }
-    StoreP(src, mem, scratch);
-  }
-}
-
-void TurboAssembler::LoadDouble(DoubleRegister dst, const MemOperand& mem,
-                                Register scratch) {
-  Register base = mem.ra();
-  int offset = mem.offset();
-
-  if (!is_int16(offset)) {
-    mov(scratch, Operand(offset));
-    lfdx(dst, MemOperand(base, scratch));
-  } else {
-    lfd(dst, mem);
-  }
-}
-
-void MacroAssembler::LoadDoubleU(DoubleRegister dst, const MemOperand& mem,
-                                Register scratch) {
-  Register base = mem.ra();
-  int offset = mem.offset();
-
-  if (!is_int16(offset)) {
-    mov(scratch, Operand(offset));
-    lfdux(dst, MemOperand(base, scratch));
-  } else {
-    lfdu(dst, mem);
-  }
-}
-
-void TurboAssembler::LoadSingle(DoubleRegister dst, const MemOperand& mem,
-                                Register scratch) {
-  Register base = mem.ra();
-  int offset = mem.offset();
-
-  if (!is_int16(offset)) {
-    mov(scratch, Operand(offset));
-    lfsx(dst, MemOperand(base, scratch));
-  } else {
-    lfs(dst, mem);
-  }
-}
-
-void TurboAssembler::LoadSingleU(DoubleRegister dst, const MemOperand& mem,
-                                 Register scratch) {
-  Register base = mem.ra();
-  int offset = mem.offset();
-
-  if (!is_int16(offset)) {
-    mov(scratch, Operand(offset));
-    lfsux(dst, MemOperand(base, scratch));
-  } else {
-    lfsu(dst, mem);
-  }
-}
-
-void TurboAssembler::StoreDouble(DoubleRegister src, const MemOperand& mem,
-                                 Register scratch) {
-  Register base = mem.ra();
-  int offset = mem.offset();
-
-  if (!is_int16(offset)) {
-    mov(scratch, Operand(offset));
-    stfdx(src, MemOperand(base, scratch));
-  } else {
-    stfd(src, mem);
-  }
-}
-
-void TurboAssembler::StoreDoubleU(DoubleRegister src, const MemOperand& mem,
-                                  Register scratch) {
-  Register base = mem.ra();
-  int offset = mem.offset();
-
-  if (!is_int16(offset)) {
-    mov(scratch, Operand(offset));
-    stfdux(src, MemOperand(base, scratch));
-  } else {
-    stfdu(src, mem);
-  }
-}
-
-void TurboAssembler::StoreSingle(DoubleRegister src, const MemOperand& mem,
-                                 Register scratch) {
-  Register base = mem.ra();
-  int offset = mem.offset();
-
-  if (!is_int16(offset)) {
-    mov(scratch, Operand(offset));
-    stfsx(src, MemOperand(base, scratch));
-  } else {
-    stfs(src, mem);
-  }
-}
-
-void TurboAssembler::StoreSingleU(DoubleRegister src, const MemOperand& mem,
-                                  Register scratch) {
-  Register base = mem.ra();
-  int offset = mem.offset();
-
-  if (!is_int16(offset)) {
-    mov(scratch, Operand(offset));
-    stfsux(src, MemOperand(base, scratch));
-  } else {
-    stfsu(src, mem);
-  }
-}
-
-Register GetRegisterThatIsNotOneOf(Register reg1, Register reg2, Register reg3,
-                                   Register reg4, Register reg5,
-                                   Register reg6) {
-  RegList regs = 0;
-  if (reg1.is_valid()) regs |= reg1.bit();
-  if (reg2.is_valid()) regs |= reg2.bit();
-  if (reg3.is_valid()) regs |= reg3.bit();
-  if (reg4.is_valid()) regs |= reg4.bit();
-  if (reg5.is_valid()) regs |= reg5.bit();
-  if (reg6.is_valid()) regs |= reg6.bit();
-
-  const RegisterConfiguration* config = RegisterConfiguration::Default();
-  for (int i = 0; i < config->num_allocatable_general_registers(); ++i) {
-    int code = config->GetAllocatableGeneralCode(i);
-    Register candidate = Register::from_code(code);
-    if (regs & candidate.bit()) continue;
-    return candidate;
-  }
-  UNREACHABLE();
-}
-
-void TurboAssembler::SwapP(Register src, Register dst, Register scratch) {
-  if (src == dst) return;
-  DCHECK(!AreAliased(src, dst, scratch));
-  mr(scratch, src);
-  mr(src, dst);
-  mr(dst, scratch);
-}
-
-void TurboAssembler::SwapP(Register src, MemOperand dst, Register scratch) {
-  if (dst.ra() != r0) DCHECK(!AreAliased(src, dst.ra(), scratch));
-  if (dst.rb() != r0) DCHECK(!AreAliased(src, dst.rb(), scratch));
-  DCHECK(!AreAliased(src, scratch));
-  mr(scratch, src);
-  LoadP(src, dst);
-  StoreP(scratch, dst);
-}
-
-void TurboAssembler::SwapP(MemOperand src, MemOperand dst, Register scratch_0,
-                           Register scratch_1) {
-  if (src.ra() != r0) DCHECK(!AreAliased(src.ra(), scratch_0, scratch_1));
-  if (src.rb() != r0) DCHECK(!AreAliased(src.rb(), scratch_0, scratch_1));
-  if (dst.ra() != r0) DCHECK(!AreAliased(dst.ra(), scratch_0, scratch_1));
-  if (dst.rb() != r0) DCHECK(!AreAliased(dst.rb(), scratch_0, scratch_1));
-  DCHECK(!AreAliased(scratch_0, scratch_1));
-  LoadP(scratch_0, src);
-  LoadP(scratch_1, dst);
-  StoreP(scratch_0, dst);
-  StoreP(scratch_1, src);
-}
-
-void TurboAssembler::SwapFloat32(DoubleRegister src, DoubleRegister dst,
-                                 DoubleRegister scratch) {
-  if (src == dst) return;
-  DCHECK(!AreAliased(src, dst, scratch));
-  fmr(scratch, src);
-  fmr(src, dst);
-  fmr(dst, scratch);
-}
-
-void TurboAssembler::SwapFloat32(DoubleRegister src, MemOperand dst,
-                                 DoubleRegister scratch) {
-  DCHECK(!AreAliased(src, scratch));
-  fmr(scratch, src);
-  LoadSingle(src, dst);
-  StoreSingle(scratch, dst);
-}
-
-void TurboAssembler::SwapFloat32(MemOperand src, MemOperand dst,
-                                 DoubleRegister scratch_0,
-                                 DoubleRegister scratch_1) {
-  DCHECK(!AreAliased(scratch_0, scratch_1));
-  LoadSingle(scratch_0, src);
-  LoadSingle(scratch_1, dst);
-  StoreSingle(scratch_0, dst);
-  StoreSingle(scratch_1, src);
-}
-
-void TurboAssembler::SwapDouble(DoubleRegister src, DoubleRegister dst,
-                                DoubleRegister scratch) {
-  if (src == dst) return;
-  DCHECK(!AreAliased(src, dst, scratch));
-  fmr(scratch, src);
-  fmr(src, dst);
-  fmr(dst, scratch);
-}
-
-void TurboAssembler::SwapDouble(DoubleRegister src, MemOperand dst,
-                                DoubleRegister scratch) {
-  DCHECK(!AreAliased(src, scratch));
-  fmr(scratch, src);
-  LoadDouble(src, dst);
-  StoreDouble(scratch, dst);
-}
-
-void TurboAssembler::SwapDouble(MemOperand src, MemOperand dst,
-                                DoubleRegister scratch_0,
-                                DoubleRegister scratch_1) {
-  DCHECK(!AreAliased(scratch_0, scratch_1));
-  LoadDouble(scratch_0, src);
-  LoadDouble(scratch_1, dst);
-  StoreDouble(scratch_0, dst);
-  StoreDouble(scratch_1, src);
-}
-
-#ifdef DEBUG
-bool AreAliased(Register reg1, Register reg2, Register reg3, Register reg4,
-                Register reg5, Register reg6, Register reg7, Register reg8,
-                Register reg9, Register reg10) {
-  int n_of_valid_regs = reg1.is_valid() + reg2.is_valid() + reg3.is_valid() +
-                        reg4.is_valid() + reg5.is_valid() + reg6.is_valid() +
-                        reg7.is_valid() + reg8.is_valid() + reg9.is_valid() +
-                        reg10.is_valid();
-
-  RegList regs = 0;
-  if (reg1.is_valid()) regs |= reg1.bit();
-  if (reg2.is_valid()) regs |= reg2.bit();
-  if (reg3.is_valid()) regs |= reg3.bit();
-  if (reg4.is_valid()) regs |= reg4.bit();
-  if (reg5.is_valid()) regs |= reg5.bit();
-  if (reg6.is_valid()) regs |= reg6.bit();
-  if (reg7.is_valid()) regs |= reg7.bit();
-  if (reg8.is_valid()) regs |= reg8.bit();
-  if (reg9.is_valid()) regs |= reg9.bit();
-  if (reg10.is_valid()) regs |= reg10.bit();
-  int n_of_non_aliasing_regs = NumRegs(regs);
-
-  return n_of_valid_regs != n_of_non_aliasing_regs;
-}
-
-bool AreAliased(DoubleRegister reg1, DoubleRegister reg2, DoubleRegister reg3,
-                DoubleRegister reg4, DoubleRegister reg5, DoubleRegister reg6,
-                DoubleRegister reg7, DoubleRegister reg8, DoubleRegister reg9,
-                DoubleRegister reg10) {
-  int n_of_valid_regs = reg1.is_valid() + reg2.is_valid() + reg3.is_valid() +
-                        reg4.is_valid() + reg5.is_valid() + reg6.is_valid() +
-                        reg7.is_valid() + reg8.is_valid() + reg9.is_valid() +
-                        reg10.is_valid();
-
-  RegList regs = 0;
-  if (reg1.is_valid()) regs |= reg1.bit();
-  if (reg2.is_valid()) regs |= reg2.bit();
-  if (reg3.is_valid()) regs |= reg3.bit();
-  if (reg4.is_valid()) regs |= reg4.bit();
-  if (reg5.is_valid()) regs |= reg5.bit();
-  if (reg6.is_valid()) regs |= reg6.bit();
-  if (reg7.is_valid()) regs |= reg7.bit();
-  if (reg8.is_valid()) regs |= reg8.bit();
-  if (reg9.is_valid()) regs |= reg9.bit();
-  if (reg10.is_valid()) regs |= reg10.bit();
-  int n_of_non_aliasing_regs = NumRegs(regs);
-
-  return n_of_valid_regs != n_of_non_aliasing_regs;
-}
-#endif
-
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_PPC
diff --git a/src/v8/src/ppc/macro-assembler-ppc.h b/src/v8/src/ppc/macro-assembler-ppc.h
deleted file mode 100644
index c67ef4a..0000000
--- a/src/v8/src/ppc/macro-assembler-ppc.h
+++ /dev/null
@@ -1,1062 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_PPC_MACRO_ASSEMBLER_PPC_H_
-#define V8_PPC_MACRO_ASSEMBLER_PPC_H_
-
-#include "src/assembler.h"
-#include "src/bailout-reason.h"
-#include "src/double.h"
-#include "src/globals.h"
-#include "src/ppc/assembler-ppc.h"
-
-namespace v8 {
-namespace internal {
-
-// Give alias names to registers for calling conventions.
-const Register kReturnRegister0 = r3;
-const Register kReturnRegister1 = r4;
-const Register kReturnRegister2 = r5;
-const Register kJSFunctionRegister = r4;
-const Register kContextRegister = r30;
-const Register kAllocateSizeRegister = r4;
-const Register kInterpreterAccumulatorRegister = r3;
-const Register kInterpreterBytecodeOffsetRegister = r15;
-const Register kInterpreterBytecodeArrayRegister = r16;
-const Register kInterpreterDispatchTableRegister = r17;
-const Register kJavaScriptCallArgCountRegister = r3;
-const Register kJavaScriptCallNewTargetRegister = r6;
-const Register kRuntimeCallFunctionRegister = r4;
-const Register kRuntimeCallArgCountRegister = r3;
-
-// ----------------------------------------------------------------------------
-// Static helper functions
-
-// Generate a MemOperand for loading a field from an object.
-inline MemOperand FieldMemOperand(Register object, int offset) {
-  return MemOperand(object, offset - kHeapObjectTag);
-}
-
-
-// Flags used for AllocateHeapNumber
-enum TaggingMode {
-  // Tag the result.
-  TAG_RESULT,
-  // Don't tag
-  DONT_TAG_RESULT
-};
-
-
-enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET };
-enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK };
-enum LinkRegisterStatus { kLRHasNotBeenSaved, kLRHasBeenSaved };
-
-
-Register GetRegisterThatIsNotOneOf(Register reg1, Register reg2 = no_reg,
-                                   Register reg3 = no_reg,
-                                   Register reg4 = no_reg,
-                                   Register reg5 = no_reg,
-                                   Register reg6 = no_reg);
-
-
-#ifdef DEBUG
-bool AreAliased(Register reg1, Register reg2, Register reg3 = no_reg,
-                Register reg4 = no_reg, Register reg5 = no_reg,
-                Register reg6 = no_reg, Register reg7 = no_reg,
-                Register reg8 = no_reg, Register reg9 = no_reg,
-                Register reg10 = no_reg);
-bool AreAliased(DoubleRegister reg1, DoubleRegister reg2,
-                DoubleRegister reg3 = no_dreg, DoubleRegister reg4 = no_dreg,
-                DoubleRegister reg5 = no_dreg, DoubleRegister reg6 = no_dreg,
-                DoubleRegister reg7 = no_dreg, DoubleRegister reg8 = no_dreg,
-                DoubleRegister reg9 = no_dreg, DoubleRegister reg10 = no_dreg);
-#endif
-
-// These exist to provide portability between 32 and 64bit
-#if V8_TARGET_ARCH_PPC64
-#define LoadPX ldx
-#define LoadPUX ldux
-#define StorePX stdx
-#define StorePUX stdux
-#define ShiftLeftImm sldi
-#define ShiftRightImm srdi
-#define ClearLeftImm clrldi
-#define ClearRightImm clrrdi
-#define ShiftRightArithImm sradi
-#define ShiftLeft_ sld
-#define ShiftRight_ srd
-#define ShiftRightArith srad
-#define Mul mulld
-#define Div divd
-#else
-#define LoadPX lwzx
-#define LoadPUX lwzux
-#define StorePX stwx
-#define StorePUX stwux
-#define ShiftLeftImm slwi
-#define ShiftRightImm srwi
-#define ClearLeftImm clrlwi
-#define ClearRightImm clrrwi
-#define ShiftRightArithImm srawi
-#define ShiftLeft_ slw
-#define ShiftRight_ srw
-#define ShiftRightArith sraw
-#define Mul mullw
-#define Div divw
-#endif
-
-class TurboAssembler : public Assembler {
- public:
-  TurboAssembler(Isolate* isolate, void* buffer, int buffer_size,
-                 CodeObjectRequired create_code_object);
-
-  void set_has_frame(bool value) { has_frame_ = value; }
-  bool has_frame() { return has_frame_; }
-
-  Isolate* isolate() const { return isolate_; }
-
-  Handle<HeapObject> CodeObject() {
-    DCHECK(!code_object_.is_null());
-    return code_object_;
-  }
-  // Converts the integer (untagged smi) in |src| to a double, storing
-  // the result to |dst|
-  void ConvertIntToDouble(Register src, DoubleRegister dst);
-
-  // Converts the unsigned integer (untagged smi) in |src| to
-  // a double, storing the result to |dst|
-  void ConvertUnsignedIntToDouble(Register src, DoubleRegister dst);
-
-  // Converts the integer (untagged smi) in |src| to
-  // a float, storing the result in |dst|
-  void ConvertIntToFloat(Register src, DoubleRegister dst);
-
-  // Converts the unsigned integer (untagged smi) in |src| to
-  // a float, storing the result in |dst|
-  void ConvertUnsignedIntToFloat(Register src, DoubleRegister dst);
-
-#if V8_TARGET_ARCH_PPC64
-  void ConvertInt64ToFloat(Register src, DoubleRegister double_dst);
-  void ConvertInt64ToDouble(Register src, DoubleRegister double_dst);
-  void ConvertUnsignedInt64ToFloat(Register src, DoubleRegister double_dst);
-  void ConvertUnsignedInt64ToDouble(Register src, DoubleRegister double_dst);
-#endif
-
-  // Converts the double_input to an integer.  Note that, upon return,
-  // the contents of double_dst will also hold the fixed point representation.
-  void ConvertDoubleToInt64(const DoubleRegister double_input,
-#if !V8_TARGET_ARCH_PPC64
-                            const Register dst_hi,
-#endif
-                            const Register dst, const DoubleRegister double_dst,
-                            FPRoundingMode rounding_mode = kRoundToZero);
-
-#if V8_TARGET_ARCH_PPC64
-  // Converts the double_input to an unsigned integer.  Note that, upon return,
-  // the contents of double_dst will also hold the fixed point representation.
-  void ConvertDoubleToUnsignedInt64(
-      const DoubleRegister double_input, const Register dst,
-      const DoubleRegister double_dst,
-      FPRoundingMode rounding_mode = kRoundToZero);
-#endif
-
-  // Activation support.
-  void EnterFrame(StackFrame::Type type,
-                  bool load_constant_pool_pointer_reg = false);
-
-  // Returns the pc offset at which the frame ends.
-  int LeaveFrame(StackFrame::Type type, int stack_adjustment = 0);
-
-  // Push a fixed frame, consisting of lr, fp, constant pool.
-  void PushCommonFrame(Register marker_reg = no_reg);
-
-  // Generates function and stub prologue code.
-  void StubPrologue(StackFrame::Type type, Register base = no_reg,
-                    int prologue_offset = 0);
-  void Prologue(Register base, int prologue_offset = 0);
-
-  // Push a standard frame, consisting of lr, fp, constant pool,
-  // context and JS function
-  void PushStandardFrame(Register function_reg);
-
-  // Restore caller's frame pointer and return address prior to being
-  // overwritten by tail call stack preparation.
-  void RestoreFrameStateForTailCall();
-
-  // Get the actual activation frame alignment for target environment.
-  static int ActivationFrameAlignment();
-
-  void InitializeRootRegister() {
-    ExternalReference roots_array_start =
-        ExternalReference::roots_array_start(isolate());
-    mov(kRootRegister, Operand(roots_array_start));
-  }
-
-  // These exist to provide portability between 32 and 64bit
-  void LoadP(Register dst, const MemOperand& mem, Register scratch = no_reg);
-  void LoadPU(Register dst, const MemOperand& mem, Register scratch = no_reg);
-  void LoadWordArith(Register dst, const MemOperand& mem,
-                     Register scratch = no_reg);
-  void StoreP(Register src, const MemOperand& mem, Register scratch = no_reg);
-  void StorePU(Register src, const MemOperand& mem, Register scratch = no_reg);
-
-  void LoadDouble(DoubleRegister dst, const MemOperand& mem,
-                  Register scratch = no_reg);
-  void LoadDoubleLiteral(DoubleRegister result, Double value, Register scratch);
-
-  // load a literal signed int value <value> to GPR <dst>
-  void LoadIntLiteral(Register dst, int value);
-  // load an SMI value <value> to GPR <dst>
-  void LoadSmiLiteral(Register dst, Smi* smi);
-
-  void LoadSingle(DoubleRegister dst, const MemOperand& mem,
-                  Register scratch = no_reg);
-  void LoadSingleU(DoubleRegister dst, const MemOperand& mem,
-                   Register scratch = no_reg);
-
-  void StoreDouble(DoubleRegister src, const MemOperand& mem,
-                   Register scratch = no_reg);
-  void StoreDoubleU(DoubleRegister src, const MemOperand& mem,
-                    Register scratch = no_reg);
-
-  void StoreSingle(DoubleRegister src, const MemOperand& mem,
-                   Register scratch = no_reg);
-  void StoreSingleU(DoubleRegister src, const MemOperand& mem,
-                    Register scratch = no_reg);
-
-  void Cmpli(Register src1, const Operand& src2, Register scratch,
-             CRegister cr = cr7);
-  void Cmpwi(Register src1, const Operand& src2, Register scratch,
-             CRegister cr = cr7);
-  // Set new rounding mode RN to FPSCR
-  void SetRoundingMode(FPRoundingMode RN);
-
-  // reset rounding mode to default (kRoundToNearest)
-  void ResetRoundingMode();
-  void Add(Register dst, Register src, intptr_t value, Register scratch);
-
-  void Push(Register src) { push(src); }
-  // Push a handle.
-  void Push(Handle<HeapObject> handle);
-  void Push(Smi* smi);
-
-  // Push two registers.  Pushes leftmost register first (to highest address).
-  void Push(Register src1, Register src2) {
-    StorePU(src2, MemOperand(sp, -2 * kPointerSize));
-    StoreP(src1, MemOperand(sp, kPointerSize));
-  }
-
-  // Push three registers.  Pushes leftmost register first (to highest address).
-  void Push(Register src1, Register src2, Register src3) {
-    StorePU(src3, MemOperand(sp, -3 * kPointerSize));
-    StoreP(src2, MemOperand(sp, kPointerSize));
-    StoreP(src1, MemOperand(sp, 2 * kPointerSize));
-  }
-
-  // Push four registers.  Pushes leftmost register first (to highest address).
-  void Push(Register src1, Register src2, Register src3, Register src4) {
-    StorePU(src4, MemOperand(sp, -4 * kPointerSize));
-    StoreP(src3, MemOperand(sp, kPointerSize));
-    StoreP(src2, MemOperand(sp, 2 * kPointerSize));
-    StoreP(src1, MemOperand(sp, 3 * kPointerSize));
-  }
-
-  // Push five registers.  Pushes leftmost register first (to highest address).
-  void Push(Register src1, Register src2, Register src3, Register src4,
-            Register src5) {
-    StorePU(src5, MemOperand(sp, -5 * kPointerSize));
-    StoreP(src4, MemOperand(sp, kPointerSize));
-    StoreP(src3, MemOperand(sp, 2 * kPointerSize));
-    StoreP(src2, MemOperand(sp, 3 * kPointerSize));
-    StoreP(src1, MemOperand(sp, 4 * kPointerSize));
-  }
-
-  void Pop(Register dst) { pop(dst); }
-
-  // Pop two registers. Pops rightmost register first (from lower address).
-  void Pop(Register src1, Register src2) {
-    LoadP(src2, MemOperand(sp, 0));
-    LoadP(src1, MemOperand(sp, kPointerSize));
-    addi(sp, sp, Operand(2 * kPointerSize));
-  }
-
-  // Pop three registers.  Pops rightmost register first (from lower address).
-  void Pop(Register src1, Register src2, Register src3) {
-    LoadP(src3, MemOperand(sp, 0));
-    LoadP(src2, MemOperand(sp, kPointerSize));
-    LoadP(src1, MemOperand(sp, 2 * kPointerSize));
-    addi(sp, sp, Operand(3 * kPointerSize));
-  }
-
-  // Pop four registers.  Pops rightmost register first (from lower address).
-  void Pop(Register src1, Register src2, Register src3, Register src4) {
-    LoadP(src4, MemOperand(sp, 0));
-    LoadP(src3, MemOperand(sp, kPointerSize));
-    LoadP(src2, MemOperand(sp, 2 * kPointerSize));
-    LoadP(src1, MemOperand(sp, 3 * kPointerSize));
-    addi(sp, sp, Operand(4 * kPointerSize));
-  }
-
-  // Pop five registers.  Pops rightmost register first (from lower address).
-  void Pop(Register src1, Register src2, Register src3, Register src4,
-           Register src5) {
-    LoadP(src5, MemOperand(sp, 0));
-    LoadP(src4, MemOperand(sp, kPointerSize));
-    LoadP(src3, MemOperand(sp, 2 * kPointerSize));
-    LoadP(src2, MemOperand(sp, 3 * kPointerSize));
-    LoadP(src1, MemOperand(sp, 4 * kPointerSize));
-    addi(sp, sp, Operand(5 * kPointerSize));
-  }
-
-  void SaveRegisters(RegList registers);
-  void RestoreRegisters(RegList registers);
-
-  void CallRecordWriteStub(Register object, Register address,
-                           RememberedSetAction remembered_set_action,
-                           SaveFPRegsMode fp_mode);
-
-  void MultiPush(RegList regs, Register location = sp);
-  void MultiPop(RegList regs, Register location = sp);
-
-  void MultiPushDoubles(RegList dregs, Register location = sp);
-  void MultiPopDoubles(RegList dregs, Register location = sp);
-
-  // Calculate how much stack space (in bytes) are required to store caller
-  // registers excluding those specified in the arguments.
-  int RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode,
-                                      Register exclusion1 = no_reg,
-                                      Register exclusion2 = no_reg,
-                                      Register exclusion3 = no_reg) const;
-
-  // Push caller saved registers on the stack, and return the number of bytes
-  // stack pointer is adjusted.
-  int PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1 = no_reg,
-                      Register exclusion2 = no_reg,
-                      Register exclusion3 = no_reg);
-  // Restore caller saved registers from the stack, and return the number of
-  // bytes stack pointer is adjusted.
-  int PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1 = no_reg,
-                     Register exclusion2 = no_reg,
-                     Register exclusion3 = no_reg);
-
-  // Load an object from the root table.
-  void LoadRoot(Register destination, Heap::RootListIndex index,
-                Condition cond = al);
-
-  void SwapP(Register src, Register dst, Register scratch);
-  void SwapP(Register src, MemOperand dst, Register scratch);
-  void SwapP(MemOperand src, MemOperand dst, Register scratch_0,
-             Register scratch_1);
-  void SwapFloat32(DoubleRegister src, DoubleRegister dst,
-                   DoubleRegister scratch);
-  void SwapFloat32(DoubleRegister src, MemOperand dst, DoubleRegister scratch);
-  void SwapFloat32(MemOperand src, MemOperand dst, DoubleRegister scratch_0,
-                   DoubleRegister scratch_1);
-  void SwapDouble(DoubleRegister src, DoubleRegister dst,
-                  DoubleRegister scratch);
-  void SwapDouble(DoubleRegister src, MemOperand dst, DoubleRegister scratch);
-  void SwapDouble(MemOperand src, MemOperand dst, DoubleRegister scratch_0,
-                  DoubleRegister scratch_1);
-
-  // Before calling a C-function from generated code, align arguments on stack.
-  // After aligning the frame, non-register arguments must be stored in
-  // sp[0], sp[4], etc., not pushed. The argument count assumes all arguments
-  // are word sized. If double arguments are used, this function assumes that
-  // all double arguments are stored before core registers; otherwise the
-  // correct alignment of the double values is not guaranteed.
-  // Some compilers/platforms require the stack to be aligned when calling
-  // C++ code.
-  // Needs a scratch register to do some arithmetic. This register will be
-  // trashed.
-  void PrepareCallCFunction(int num_reg_arguments, int num_double_registers,
-                            Register scratch);
-  void PrepareCallCFunction(int num_reg_arguments, Register scratch);
-
-  void PrepareForTailCall(const ParameterCount& callee_args_count,
-                          Register caller_args_count_reg, Register scratch0,
-                          Register scratch1);
-
-  // There are two ways of passing double arguments on ARM, depending on
-  // whether soft or hard floating point ABI is used. These functions
-  // abstract parameter passing for the three different ways we call
-  // C functions from generated code.
-  void MovToFloatParameter(DoubleRegister src);
-  void MovToFloatParameters(DoubleRegister src1, DoubleRegister src2);
-  void MovToFloatResult(DoubleRegister src);
-
-  // Calls a C function and cleans up the space for arguments allocated
-  // by PrepareCallCFunction. The called function is not allowed to trigger a
-  // garbage collection, since that might move the code and invalidate the
-  // return address (unless this is somehow accounted for by the called
-  // function).
-  void CallCFunction(ExternalReference function, int num_arguments);
-  void CallCFunction(Register function, int num_arguments);
-  void CallCFunction(ExternalReference function, int num_reg_arguments,
-                     int num_double_arguments);
-  void CallCFunction(Register function, int num_reg_arguments,
-                     int num_double_arguments);
-
-  void CallRuntimeDelayed(Zone* zone, Runtime::FunctionId fid,
-                          SaveFPRegsMode save_doubles = kDontSaveFPRegs);
-  void MovFromFloatParameter(DoubleRegister dst);
-  void MovFromFloatResult(DoubleRegister dst);
-
-  // Calls Abort(msg) if the condition cond is not satisfied.
-  // Use --debug_code to enable.
-  void Assert(Condition cond, AbortReason reason, CRegister cr = cr7);
-
-  // Like Assert(), but always enabled.
-  void Check(Condition cond, AbortReason reason, CRegister cr = cr7);
-
-  // Print a message to stdout and abort execution.
-  void Abort(AbortReason reason);
-
-  inline bool AllowThisStubCall(CodeStub* stub);
-#if !V8_TARGET_ARCH_PPC64
-  void ShiftLeftPair(Register dst_low, Register dst_high, Register src_low,
-                     Register src_high, Register scratch, Register shift);
-  void ShiftLeftPair(Register dst_low, Register dst_high, Register src_low,
-                     Register src_high, uint32_t shift);
-  void ShiftRightPair(Register dst_low, Register dst_high, Register src_low,
-                      Register src_high, Register scratch, Register shift);
-  void ShiftRightPair(Register dst_low, Register dst_high, Register src_low,
-                      Register src_high, uint32_t shift);
-  void ShiftRightAlgPair(Register dst_low, Register dst_high, Register src_low,
-                         Register src_high, Register scratch, Register shift);
-  void ShiftRightAlgPair(Register dst_low, Register dst_high, Register src_low,
-                         Register src_high, uint32_t shift);
-#endif
-  // Returns the size of a call in instructions. Note, the value returned is
-  // only valid as long as no entries are added to the constant pool between
-  // checking the call size and emitting the actual call.
-  static int CallSize(Register target);
-  int CallSize(Address target, RelocInfo::Mode rmode, Condition cond = al);
-
-  // Jump, Call, and Ret pseudo instructions implementing inter-working.
-  void Jump(Register target);
-  void Jump(Address target, RelocInfo::Mode rmode, Condition cond = al,
-            CRegister cr = cr7);
-  void Jump(Handle<Code> code, RelocInfo::Mode rmode, Condition cond = al,
-            CRegister cr = cr7);
-  void Call(Register target);
-  void Call(Address target, RelocInfo::Mode rmode, Condition cond = al);
-  int CallSize(Handle<Code> code,
-               RelocInfo::Mode rmode = RelocInfo::CODE_TARGET,
-               Condition cond = al);
-  void Call(Handle<Code> code, RelocInfo::Mode rmode = RelocInfo::CODE_TARGET,
-            Condition cond = al);
-  void Call(Label* target);
-
-  void CallForDeoptimization(Address target, RelocInfo::Mode rmode) {
-    Call(target, rmode);
-  }
-
-  // Emit code to discard a non-negative number of pointer-sized elements
-  // from the stack, clobbering only the sp register.
-  void Drop(int count);
-  void Drop(Register count, Register scratch = r0);
-
-  void Ret() { blr(); }
-  void Ret(Condition cond, CRegister cr = cr7) { bclr(cond, cr); }
-  void Ret(int drop) {
-    Drop(drop);
-    blr();
-  }
-
-  // If the value is a NaN, canonicalize the value else, do nothing.
-  void CanonicalizeNaN(const DoubleRegister dst, const DoubleRegister src);
-  void CanonicalizeNaN(const DoubleRegister value) {
-    CanonicalizeNaN(value, value);
-  }
-  void CheckPageFlag(Register object, Register scratch, int mask, Condition cc,
-                     Label* condition_met);
-
-  // Move values between integer and floating point registers.
-  void MovIntToDouble(DoubleRegister dst, Register src, Register scratch);
-  void MovUnsignedIntToDouble(DoubleRegister dst, Register src,
-                              Register scratch);
-  void MovInt64ToDouble(DoubleRegister dst,
-#if !V8_TARGET_ARCH_PPC64
-                        Register src_hi,
-#endif
-                        Register src);
-#if V8_TARGET_ARCH_PPC64
-  void MovInt64ComponentsToDouble(DoubleRegister dst, Register src_hi,
-                                  Register src_lo, Register scratch);
-#endif
-  void InsertDoubleLow(DoubleRegister dst, Register src, Register scratch);
-  void InsertDoubleHigh(DoubleRegister dst, Register src, Register scratch);
-  void MovDoubleLowToInt(Register dst, DoubleRegister src);
-  void MovDoubleHighToInt(Register dst, DoubleRegister src);
-  void MovDoubleToInt64(
-#if !V8_TARGET_ARCH_PPC64
-      Register dst_hi,
-#endif
-      Register dst, DoubleRegister src);
-  void MovIntToFloat(DoubleRegister dst, Register src);
-  void MovFloatToInt(Register dst, DoubleRegister src);
-  // Register move. May do nothing if the registers are identical.
-  void Move(Register dst, Smi* smi) { LoadSmiLiteral(dst, smi); }
-  void Move(Register dst, Handle<HeapObject> value);
-  void Move(Register dst, Register src, Condition cond = al);
-  void Move(DoubleRegister dst, DoubleRegister src);
-
-  void SmiUntag(Register reg, RCBit rc = LeaveRC) { SmiUntag(reg, reg, rc); }
-
-  void SmiUntag(Register dst, Register src, RCBit rc = LeaveRC) {
-    ShiftRightArithImm(dst, src, kSmiShift, rc);
-  }
-  // ---------------------------------------------------------------------------
-  // Bit testing/extraction
-  //
-  // Bit numbering is such that the least significant bit is bit 0
-  // (for consistency between 32/64-bit).
-
-  // Extract consecutive bits (defined by rangeStart - rangeEnd) from src
-  // and, if !test, shift them into the least significant bits of dst.
-  inline void ExtractBitRange(Register dst, Register src, int rangeStart,
-                              int rangeEnd, RCBit rc = LeaveRC,
-                              bool test = false) {
-    DCHECK(rangeStart >= rangeEnd && rangeStart < kBitsPerPointer);
-    int rotate = (rangeEnd == 0) ? 0 : kBitsPerPointer - rangeEnd;
-    int width = rangeStart - rangeEnd + 1;
-    if (rc == SetRC && rangeStart < 16 && (rangeEnd == 0 || test)) {
-      // Prefer faster andi when applicable.
-      andi(dst, src, Operand(((1 << width) - 1) << rangeEnd));
-    } else {
-#if V8_TARGET_ARCH_PPC64
-      rldicl(dst, src, rotate, kBitsPerPointer - width, rc);
-#else
-      rlwinm(dst, src, rotate, kBitsPerPointer - width, kBitsPerPointer - 1,
-             rc);
-#endif
-    }
-  }
-
-  inline void ExtractBit(Register dst, Register src, uint32_t bitNumber,
-                         RCBit rc = LeaveRC, bool test = false) {
-    ExtractBitRange(dst, src, bitNumber, bitNumber, rc, test);
-  }
-
-  // Extract consecutive bits (defined by mask) from src and place them
-  // into the least significant bits of dst.
-  inline void ExtractBitMask(Register dst, Register src, uintptr_t mask,
-                             RCBit rc = LeaveRC, bool test = false) {
-    int start = kBitsPerPointer - 1;
-    int end;
-    uintptr_t bit = (1L << start);
-
-    while (bit && (mask & bit) == 0) {
-      start--;
-      bit >>= 1;
-    }
-    end = start;
-    bit >>= 1;
-
-    while (bit && (mask & bit)) {
-      end--;
-      bit >>= 1;
-    }
-
-    // 1-bits in mask must be contiguous
-    DCHECK(bit == 0 || (mask & ((bit << 1) - 1)) == 0);
-
-    ExtractBitRange(dst, src, start, end, rc, test);
-  }
-
-  // Test single bit in value.
-  inline void TestBit(Register value, int bitNumber, Register scratch = r0) {
-    ExtractBitRange(scratch, value, bitNumber, bitNumber, SetRC, true);
-  }
-
-  // Test consecutive bit range in value.  Range is defined by mask.
-  inline void TestBitMask(Register value, uintptr_t mask,
-                          Register scratch = r0) {
-    ExtractBitMask(scratch, value, mask, SetRC, true);
-  }
-  // Test consecutive bit range in value.  Range is defined by
-  // rangeStart - rangeEnd.
-  inline void TestBitRange(Register value, int rangeStart, int rangeEnd,
-                           Register scratch = r0) {
-    ExtractBitRange(scratch, value, rangeStart, rangeEnd, SetRC, true);
-  }
-
-  inline void TestIfSmi(Register value, Register scratch) {
-    TestBitRange(value, kSmiTagSize - 1, 0, scratch);
-  }
-  // Jump the register contains a smi.
-  inline void JumpIfSmi(Register value, Label* smi_label) {
-    TestIfSmi(value, r0);
-    beq(smi_label, cr0);  // branch if SMI
-  }
-#if V8_TARGET_ARCH_PPC64
-  inline void TestIfInt32(Register value, Register scratch,
-                          CRegister cr = cr7) {
-    // High bits must be identical to fit into an 32-bit integer
-    extsw(scratch, value);
-    cmp(scratch, value, cr);
-  }
-#else
-  inline void TestIfInt32(Register hi_word, Register lo_word, Register scratch,
-                          CRegister cr = cr7) {
-    // High bits must be identical to fit into an 32-bit integer
-    srawi(scratch, lo_word, 31);
-    cmp(scratch, hi_word, cr);
-  }
-#endif
-
-  // Overflow handling functions.
-  // Usage: call the appropriate arithmetic function and then call one of the
-  // flow control functions with the corresponding label.
-
-  // Compute dst = left + right, setting condition codes. dst may be same as
-  // either left or right (or a unique register). left and right must not be
-  // the same register.
-  void AddAndCheckForOverflow(Register dst, Register left, Register right,
-                              Register overflow_dst, Register scratch = r0);
-  void AddAndCheckForOverflow(Register dst, Register left, intptr_t right,
-                              Register overflow_dst, Register scratch = r0);
-
-  // Compute dst = left - right, setting condition codes. dst may be same as
-  // either left or right (or a unique register). left and right must not be
-  // the same register.
-  void SubAndCheckForOverflow(Register dst, Register left, Register right,
-                              Register overflow_dst, Register scratch = r0);
-
-  // Performs a truncating conversion of a floating point number as used by
-  // the JS bitwise operations. See ECMA-262 9.5: ToInt32. Goes to 'done' if it
-  // succeeds, otherwise falls through if result is saturated. On return
-  // 'result' either holds answer, or is clobbered on fall through.
-  //
-  // Only public for the test code in test-code-stubs-arm.cc.
-  void TryInlineTruncateDoubleToI(Register result, DoubleRegister input,
-                                  Label* done);
-  void TruncateDoubleToIDelayed(Zone* zone, Register result,
-                                DoubleRegister double_input);
-
-  // Call a code stub.
-  void CallStubDelayed(CodeStub* stub);
-
-  void LoadConstantPoolPointerRegister();
-  void LoadConstantPoolPointerRegister(Register base, int code_entry_delta = 0);
-  void AbortConstantPoolBuilding() {
-#ifdef DEBUG
-    // Avoid DCHECK(!is_linked()) failure in ~Label()
-    bind(ConstantPoolPosition());
-#endif
-  }
-
- private:
-  static const int kSmiShift = kSmiTagSize + kSmiShiftSize;
-
-  bool has_frame_ = false;
-  Isolate* const isolate_;
-  // This handle will be patched with the code object on installation.
-  Handle<HeapObject> code_object_;
-
-  void Jump(intptr_t target, RelocInfo::Mode rmode, Condition cond = al,
-            CRegister cr = cr7);
-  int CalculateStackPassedWords(int num_reg_arguments,
-                                int num_double_arguments);
-  void CallCFunctionHelper(Register function, int num_reg_arguments,
-                           int num_double_arguments);
-};
-
-// MacroAssembler implements a collection of frequently used acros.
-class MacroAssembler : public TurboAssembler {
- public:
-  MacroAssembler(Isolate* isolate, void* buffer, int size,
-                 CodeObjectRequired create_code_object);
-
-  // ---------------------------------------------------------------------------
-  // GC Support
-
-  void IncrementalMarkingRecordWriteHelper(Register object, Register value,
-                                           Register address);
-
-  // Record in the remembered set the fact that we have a pointer to new space
-  // at the address pointed to by the addr register.  Only works if addr is not
-  // in new space.
-  void RememberedSetHelper(Register object,  // Used for debug code.
-                           Register addr, Register scratch,
-                           SaveFPRegsMode save_fp);
-
-  void JumpToJSEntry(Register target);
-  // Check if object is in new space.  Jumps if the object is not in new space.
-  // The register scratch can be object itself, but scratch will be clobbered.
-  void JumpIfNotInNewSpace(Register object, Register scratch, Label* branch) {
-    InNewSpace(object, scratch, eq, branch);
-  }
-
-  // Check if object is in new space.  Jumps if the object is in new space.
-  // The register scratch can be object itself, but it will be clobbered.
-  void JumpIfInNewSpace(Register object, Register scratch, Label* branch) {
-    InNewSpace(object, scratch, ne, branch);
-  }
-
-  // Check if an object has a given incremental marking color.
-  void HasColor(Register object, Register scratch0, Register scratch1,
-                Label* has_color, int first_bit, int second_bit);
-
-  void JumpIfBlack(Register object, Register scratch0, Register scratch1,
-                   Label* on_black);
-
-  // Checks the color of an object.  If the object is white we jump to the
-  // incremental marker.
-  void JumpIfWhite(Register value, Register scratch1, Register scratch2,
-                   Register scratch3, Label* value_is_white);
-
-  // Notify the garbage collector that we wrote a pointer into an object.
-  // |object| is the object being stored into, |value| is the object being
-  // stored.  value and scratch registers are clobbered by the operation.
-  // The offset is the offset from the start of the object, not the offset from
-  // the tagged HeapObject pointer.  For use with FieldMemOperand(reg, off).
-  void RecordWriteField(
-      Register object, int offset, Register value, Register scratch,
-      LinkRegisterStatus lr_status, SaveFPRegsMode save_fp,
-      RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
-      SmiCheck smi_check = INLINE_SMI_CHECK);
-
-  // For a given |object| notify the garbage collector that the slot |address|
-  // has been written.  |value| is the object being stored. The value and
-  // address registers are clobbered by the operation.
-  void RecordWrite(
-      Register object, Register address, Register value,
-      LinkRegisterStatus lr_status, SaveFPRegsMode save_fp,
-      RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
-      SmiCheck smi_check = INLINE_SMI_CHECK);
-
-  // Push and pop the registers that can hold pointers, as defined by the
-  // RegList constant kSafepointSavedRegisters.
-  void PushSafepointRegisters();
-  void PopSafepointRegisters();
-
-  // Loads the constant pool pointer (kConstantPoolRegister).
-  void LoadConstantPoolPointerRegisterFromCodeTargetAddress(
-      Register code_target_address);
-
-  // Flush the I-cache from asm code. You should use CpuFeatures::FlushICache
-  // from C.
-  // Does not handle errors.
-  void FlushICache(Register address, size_t size, Register scratch);
-
-  // Enter exit frame.
-  // stack_space - extra stack space, used for parameters before call to C.
-  // At least one slot (for the return address) should be provided.
-  void EnterExitFrame(bool save_doubles, int stack_space = 1,
-                      StackFrame::Type frame_type = StackFrame::EXIT);
-
-  // Leave the current exit frame. Expects the return value in r0.
-  // Expect the number of values, pushed prior to the exit frame, to
-  // remove in a register (or no_reg, if there is nothing to remove).
-  void LeaveExitFrame(bool save_doubles, Register argument_count,
-                      bool argument_count_is_length = false);
-
-  // Load the global proxy from the current context.
-  void LoadGlobalProxy(Register dst) {
-    LoadNativeContextSlot(Context::GLOBAL_PROXY_INDEX, dst);
-  }
-
-  void LoadNativeContextSlot(int index, Register dst);
-
-  // ----------------------------------------------------------------
-  // new PPC macro-assembler interfaces that are slightly higher level
-  // than assembler-ppc and may generate variable length sequences
-
-  // load a literal double value <value> to FPR <result>
-  void LoadWord(Register dst, const MemOperand& mem, Register scratch);
-  void StoreWord(Register src, const MemOperand& mem, Register scratch);
-
-  void LoadHalfWord(Register dst, const MemOperand& mem, Register scratch);
-  void LoadHalfWordArith(Register dst, const MemOperand& mem,
-                         Register scratch = no_reg);
-  void StoreHalfWord(Register src, const MemOperand& mem, Register scratch);
-
-  void LoadByte(Register dst, const MemOperand& mem, Register scratch);
-  void StoreByte(Register src, const MemOperand& mem, Register scratch);
-
-  void LoadRepresentation(Register dst, const MemOperand& mem, Representation r,
-                          Register scratch = no_reg);
-  void StoreRepresentation(Register src, const MemOperand& mem,
-                           Representation r, Register scratch = no_reg);
-  void LoadDoubleU(DoubleRegister dst, const MemOperand& mem,
-                   Register scratch = no_reg);
-
-  void Cmpi(Register src1, const Operand& src2, Register scratch,
-            CRegister cr = cr7);
-  void Cmplwi(Register src1, const Operand& src2, Register scratch,
-              CRegister cr = cr7);
-  void And(Register ra, Register rs, const Operand& rb, RCBit rc = LeaveRC);
-  void Or(Register ra, Register rs, const Operand& rb, RCBit rc = LeaveRC);
-  void Xor(Register ra, Register rs, const Operand& rb, RCBit rc = LeaveRC);
-
-  void AddSmiLiteral(Register dst, Register src, Smi* smi, Register scratch);
-  void SubSmiLiteral(Register dst, Register src, Smi* smi, Register scratch);
-  void CmpSmiLiteral(Register src1, Smi* smi, Register scratch,
-                     CRegister cr = cr7);
-  void CmplSmiLiteral(Register src1, Smi* smi, Register scratch,
-                      CRegister cr = cr7);
-  void AndSmiLiteral(Register dst, Register src, Smi* smi, Register scratch,
-                     RCBit rc = LeaveRC);
-
-
-
-  // ---------------------------------------------------------------------------
-  // JavaScript invokes
-
-  // Removes current frame and its arguments from the stack preserving
-  // the arguments and a return address pushed to the stack for the next call.
-  // Both |callee_args_count| and |caller_args_count_reg| do not include
-  // receiver. |callee_args_count| is not modified, |caller_args_count_reg|
-  // is trashed.
-
-  // Invoke the JavaScript function code by either calling or jumping.
-  void InvokeFunctionCode(Register function, Register new_target,
-                          const ParameterCount& expected,
-                          const ParameterCount& actual, InvokeFlag flag);
-
-  // On function call, call into the debugger if necessary.
-  void CheckDebugHook(Register fun, Register new_target,
-                      const ParameterCount& expected,
-                      const ParameterCount& actual);
-
-  // Invoke the JavaScript function in the given register. Changes the
-  // current context to the context in the function before invoking.
-  void InvokeFunction(Register function, Register new_target,
-                      const ParameterCount& actual, InvokeFlag flag);
-
-  void InvokeFunction(Register function, const ParameterCount& expected,
-                      const ParameterCount& actual, InvokeFlag flag);
-
-  void InvokeFunction(Handle<JSFunction> function,
-                      const ParameterCount& expected,
-                      const ParameterCount& actual, InvokeFlag flag);
-
-  void DebugBreak();
-  // Frame restart support
-  void MaybeDropFrames();
-
-  // Exception handling
-
-  // Push a new stack handler and link into stack handler chain.
-  void PushStackHandler();
-
-  // Unlink the stack handler on top of the stack from the stack handler chain.
-  // Must preserve the result register.
-  void PopStackHandler();
-
-  // ---------------------------------------------------------------------------
-  // Support functions.
-
-  // Compare object type for heap object.  heap_object contains a non-Smi
-  // whose object type should be compared with the given type.  This both
-  // sets the flags and leaves the object type in the type_reg register.
-  // It leaves the map in the map register (unless the type_reg and map register
-  // are the same register).  It leaves the heap object in the heap_object
-  // register unless the heap_object register is the same register as one of the
-  // other registers.
-  // Type_reg can be no_reg. In that case ip is used.
-  void CompareObjectType(Register heap_object, Register map, Register type_reg,
-                         InstanceType type);
-
-  // Compare instance type in a map.  map contains a valid map object whose
-  // object type should be compared with the given type.  This both
-  // sets the flags and leaves the object type in the type_reg register.
-  void CompareInstanceType(Register map, Register type_reg, InstanceType type);
-
-  // Compare the object in a register to a value from the root list.
-  // Uses the ip register as scratch.
-  void CompareRoot(Register obj, Heap::RootListIndex index);
-  void PushRoot(Heap::RootListIndex index) {
-    LoadRoot(r0, index);
-    Push(r0);
-  }
-
-  // Compare the object in a register to a value and jump if they are equal.
-  void JumpIfRoot(Register with, Heap::RootListIndex index, Label* if_equal) {
-    CompareRoot(with, index);
-    beq(if_equal);
-  }
-
-  // Compare the object in a register to a value and jump if they are not equal.
-  void JumpIfNotRoot(Register with, Heap::RootListIndex index,
-                     Label* if_not_equal) {
-    CompareRoot(with, index);
-    bne(if_not_equal);
-  }
-
-  // Try to convert a double to a signed 32-bit integer.
-  // CR_EQ in cr7 is set and result assigned if the conversion is exact.
-  void TryDoubleToInt32Exact(Register result, DoubleRegister double_input,
-                             Register scratch, DoubleRegister double_scratch);
-
-  // ---------------------------------------------------------------------------
-  // Runtime calls
-
-  static int CallSizeNotPredictableCodeSize(Address target,
-                                            RelocInfo::Mode rmode,
-                                            Condition cond = al);
-  void CallJSEntry(Register target);
-
-  // Call a code stub.
-  void CallStub(CodeStub* stub, Condition cond = al);
-  void TailCallStub(CodeStub* stub, Condition cond = al);
-
-  // Call a runtime routine.
-  void CallRuntime(const Runtime::Function* f, int num_arguments,
-                   SaveFPRegsMode save_doubles = kDontSaveFPRegs);
-  void CallRuntimeSaveDoubles(Runtime::FunctionId fid) {
-    const Runtime::Function* function = Runtime::FunctionForId(fid);
-    CallRuntime(function, function->nargs, kSaveFPRegs);
-  }
-
-  // Convenience function: Same as above, but takes the fid instead.
-  void CallRuntime(Runtime::FunctionId fid,
-                   SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
-    const Runtime::Function* function = Runtime::FunctionForId(fid);
-    CallRuntime(function, function->nargs, save_doubles);
-  }
-
-  // Convenience function: Same as above, but takes the fid instead.
-  void CallRuntime(Runtime::FunctionId fid, int num_arguments,
-                   SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
-    CallRuntime(Runtime::FunctionForId(fid), num_arguments, save_doubles);
-  }
-
-  // Convenience function: tail call a runtime routine (jump).
-  void TailCallRuntime(Runtime::FunctionId fid);
-
-
-
-  // Jump to a runtime routine.
-  void JumpToExternalReference(const ExternalReference& builtin,
-                               bool builtin_exit_frame = false);
-
-  // ---------------------------------------------------------------------------
-  // StatsCounter support
-
-  void IncrementCounter(StatsCounter* counter, int value, Register scratch1,
-                        Register scratch2);
-  void DecrementCounter(StatsCounter* counter, int value, Register scratch1,
-                        Register scratch2);
-
-  // ---------------------------------------------------------------------------
-  // Smi utilities
-
-  // Shift left by kSmiShift
-  void SmiTag(Register reg, RCBit rc = LeaveRC) { SmiTag(reg, reg, rc); }
-  void SmiTag(Register dst, Register src, RCBit rc = LeaveRC) {
-    ShiftLeftImm(dst, src, Operand(kSmiShift), rc);
-  }
-
-  void SmiToPtrArrayOffset(Register dst, Register src) {
-#if V8_TARGET_ARCH_PPC64
-    STATIC_ASSERT(kSmiTag == 0 && kSmiShift > kPointerSizeLog2);
-    ShiftRightArithImm(dst, src, kSmiShift - kPointerSizeLog2);
-#else
-    STATIC_ASSERT(kSmiTag == 0 && kSmiShift < kPointerSizeLog2);
-    ShiftLeftImm(dst, src, Operand(kPointerSizeLog2 - kSmiShift));
-#endif
-  }
-
-  // Untag the source value into destination and jump if source is a smi.
-  // Souce and destination can be the same register.
-  void UntagAndJumpIfSmi(Register dst, Register src, Label* smi_case);
-
-  // Jump if either of the registers contain a non-smi.
-  inline void JumpIfNotSmi(Register value, Label* not_smi_label) {
-    TestIfSmi(value, r0);
-    bne(not_smi_label, cr0);
-  }
-  // Jump if either of the registers contain a smi.
-  void JumpIfEitherSmi(Register reg1, Register reg2, Label* on_either_smi);
-
-  // Abort execution if argument is a smi, enabled via --debug-code.
-  void AssertNotSmi(Register object);
-  void AssertSmi(Register object);
-
-
-
-#if V8_TARGET_ARCH_PPC64
-  // Ensure it is permissible to read/write int value directly from
-  // upper half of the smi.
-  STATIC_ASSERT(kSmiTag == 0);
-  STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32);
-#endif
-#if V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN
-#define SmiWordOffset(offset) (offset + kPointerSize / 2)
-#else
-#define SmiWordOffset(offset) offset
-#endif
-
-  // Abort execution if argument is not a FixedArray, enabled via --debug-code.
-  void AssertFixedArray(Register object);
-
-  void AssertFunction(Register object);
-
-  // Abort execution if argument is not a JSBoundFunction,
-  // enabled via --debug-code.
-  void AssertBoundFunction(Register object);
-
-  // Abort execution if argument is not a JSGeneratorObject (or subclass),
-  // enabled via --debug-code.
-  void AssertGeneratorObject(Register object);
-
-  // Abort execution if argument is not undefined or an AllocationSite, enabled
-  // via --debug-code.
-  void AssertUndefinedOrAllocationSite(Register object, Register scratch);
-
-  // ---------------------------------------------------------------------------
-  // Patching helpers.
-
-  template <typename Field>
-  void DecodeField(Register dst, Register src, RCBit rc = LeaveRC) {
-    ExtractBitRange(dst, src, Field::kShift + Field::kSize - 1, Field::kShift,
-                    rc);
-  }
-
-  template <typename Field>
-  void DecodeField(Register reg, RCBit rc = LeaveRC) {
-    DecodeField<Field>(reg, reg, rc);
-  }
-
- private:
-  static const int kSmiShift = kSmiTagSize + kSmiShiftSize;
-
-  // Helper functions for generating invokes.
-  void InvokePrologue(const ParameterCount& expected,
-                      const ParameterCount& actual, Label* done,
-                      bool* definitely_mismatches, InvokeFlag flag);
-
-  // Helper for implementing JumpIfNotInNewSpace and JumpIfInNewSpace.
-  void InNewSpace(Register object, Register scratch,
-                  Condition cond,  // eq for new space, ne otherwise.
-                  Label* branch);
-
-  // Compute memory operands for safepoint stack slots.
-  static int SafepointRegisterStackIndex(int reg_code);
-
-  // Needs access to SafepointRegisterStackIndex for compiled frame
-  // traversal.
-  friend class StandardFrame;
-};
-
-// -----------------------------------------------------------------------------
-// Static helper functions.
-
-inline MemOperand ContextMemOperand(Register context, int index = 0) {
-  return MemOperand(context, Context::SlotOffset(index));
-}
-
-
-inline MemOperand NativeContextMemOperand() {
-  return ContextMemOperand(cp, Context::NATIVE_CONTEXT_INDEX);
-}
-
-#define ACCESS_MASM(masm) masm->
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_PPC_MACRO_ASSEMBLER_PPC_H_
diff --git a/src/v8/src/ppc/simulator-ppc.cc b/src/v8/src/ppc/simulator-ppc.cc
deleted file mode 100644
index a92e536..0000000
--- a/src/v8/src/ppc/simulator-ppc.cc
+++ /dev/null
@@ -1,4331 +0,0 @@
-// Copyright 2014 the V8 project 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 <stdarg.h>
-#include <stdlib.h>
-#include <cmath>
-
-#if V8_TARGET_ARCH_PPC
-
-#include "src/assembler.h"
-#include "src/base/bits.h"
-#include "src/codegen.h"
-#include "src/disasm.h"
-#include "src/macro-assembler.h"
-#include "src/ostreams.h"
-#include "src/ppc/constants-ppc.h"
-#include "src/ppc/frame-constants-ppc.h"
-#include "src/ppc/simulator-ppc.h"
-#include "src/runtime/runtime-utils.h"
-
-#if defined(USE_SIMULATOR)
-
-// Only build the simulator if not compiling for real PPC hardware.
-namespace v8 {
-namespace internal {
-
-const auto GetRegConfig = RegisterConfiguration::Default;
-
-// static
-base::LazyInstance<Simulator::GlobalMonitor>::type Simulator::global_monitor_ =
-    LAZY_INSTANCE_INITIALIZER;
-
-// This macro provides a platform independent use of sscanf. The reason for
-// SScanF not being implemented in a platform independent way through
-// ::v8::internal::OS in the same way as SNPrintF is that the
-// Windows C Run-Time Library does not provide vsscanf.
-#define SScanF sscanf  // NOLINT
-
-// The PPCDebugger class is used by the simulator while debugging simulated
-// PowerPC code.
-class PPCDebugger {
- public:
-  explicit PPCDebugger(Simulator* sim) : sim_(sim) {}
-
-  void Stop(Instruction* instr);
-  void Debug();
-
- private:
-  static const Instr kBreakpointInstr = (TWI | 0x1F * B21);
-  static const Instr kNopInstr = (ORI);  // ori, 0,0,0
-
-  Simulator* sim_;
-
-  intptr_t GetRegisterValue(int regnum);
-  double GetRegisterPairDoubleValue(int regnum);
-  double GetFPDoubleRegisterValue(int regnum);
-  bool GetValue(const char* desc, intptr_t* value);
-  bool GetFPDoubleValue(const char* desc, double* value);
-
-  // Set or delete a breakpoint. Returns true if successful.
-  bool SetBreakpoint(Instruction* break_pc);
-  bool DeleteBreakpoint(Instruction* break_pc);
-
-  // Undo and redo all breakpoints. This is needed to bracket disassembly and
-  // execution to skip past breakpoints when run from the debugger.
-  void UndoBreakpoints();
-  void RedoBreakpoints();
-};
-
-void PPCDebugger::Stop(Instruction* instr) {
-  // Get the stop code.
-  // use of kStopCodeMask not right on PowerPC
-  uint32_t code = instr->SvcValue() & kStopCodeMask;
-  // Retrieve the encoded address, which comes just after this stop.
-  char* msg =
-      *reinterpret_cast<char**>(sim_->get_pc() + Instruction::kInstrSize);
-  // Update this stop description.
-  if (sim_->isWatchedStop(code) && !sim_->watched_stops_[code].desc) {
-    sim_->watched_stops_[code].desc = msg;
-  }
-  // Print the stop message and code if it is not the default code.
-  if (code != kMaxStopCode) {
-    PrintF("Simulator hit stop %u: %s\n", code, msg);
-  } else {
-    PrintF("Simulator hit %s\n", msg);
-  }
-  sim_->set_pc(sim_->get_pc() + Instruction::kInstrSize + kPointerSize);
-  Debug();
-}
-
-intptr_t PPCDebugger::GetRegisterValue(int regnum) {
-  return sim_->get_register(regnum);
-}
-
-
-double PPCDebugger::GetRegisterPairDoubleValue(int regnum) {
-  return sim_->get_double_from_register_pair(regnum);
-}
-
-
-double PPCDebugger::GetFPDoubleRegisterValue(int regnum) {
-  return sim_->get_double_from_d_register(regnum);
-}
-
-
-bool PPCDebugger::GetValue(const char* desc, intptr_t* value) {
-  int regnum = Registers::Number(desc);
-  if (regnum != kNoRegister) {
-    *value = GetRegisterValue(regnum);
-    return true;
-  } else {
-    if (strncmp(desc, "0x", 2) == 0) {
-      return SScanF(desc + 2, "%" V8PRIxPTR,
-                    reinterpret_cast<uintptr_t*>(value)) == 1;
-    } else {
-      return SScanF(desc, "%" V8PRIuPTR, reinterpret_cast<uintptr_t*>(value)) ==
-             1;
-    }
-  }
-  return false;
-}
-
-
-bool PPCDebugger::GetFPDoubleValue(const char* desc, double* value) {
-  int regnum = DoubleRegisters::Number(desc);
-  if (regnum != kNoRegister) {
-    *value = sim_->get_double_from_d_register(regnum);
-    return true;
-  }
-  return false;
-}
-
-
-bool PPCDebugger::SetBreakpoint(Instruction* break_pc) {
-  // Check if a breakpoint can be set. If not return without any side-effects.
-  if (sim_->break_pc_ != nullptr) {
-    return false;
-  }
-
-  // Set the breakpoint.
-  sim_->break_pc_ = break_pc;
-  sim_->break_instr_ = break_pc->InstructionBits();
-  // Not setting the breakpoint instruction in the code itself. It will be set
-  // when the debugger shell continues.
-  return true;
-}
-
-
-bool PPCDebugger::DeleteBreakpoint(Instruction* break_pc) {
-  if (sim_->break_pc_ != nullptr) {
-    sim_->break_pc_->SetInstructionBits(sim_->break_instr_);
-  }
-
-  sim_->break_pc_ = nullptr;
-  sim_->break_instr_ = 0;
-  return true;
-}
-
-
-void PPCDebugger::UndoBreakpoints() {
-  if (sim_->break_pc_ != nullptr) {
-    sim_->break_pc_->SetInstructionBits(sim_->break_instr_);
-  }
-}
-
-
-void PPCDebugger::RedoBreakpoints() {
-  if (sim_->break_pc_ != nullptr) {
-    sim_->break_pc_->SetInstructionBits(kBreakpointInstr);
-  }
-}
-
-
-void PPCDebugger::Debug() {
-  intptr_t last_pc = -1;
-  bool done = false;
-
-#define COMMAND_SIZE 63
-#define ARG_SIZE 255
-
-#define STR(a) #a
-#define XSTR(a) STR(a)
-
-  char cmd[COMMAND_SIZE + 1];
-  char arg1[ARG_SIZE + 1];
-  char arg2[ARG_SIZE + 1];
-  char* argv[3] = {cmd, arg1, arg2};
-
-  // make sure to have a proper terminating character if reaching the limit
-  cmd[COMMAND_SIZE] = 0;
-  arg1[ARG_SIZE] = 0;
-  arg2[ARG_SIZE] = 0;
-
-  // Undo all set breakpoints while running in the debugger shell. This will
-  // make them invisible to all commands.
-  UndoBreakpoints();
-  // Disable tracing while simulating
-  bool trace = ::v8::internal::FLAG_trace_sim;
-  ::v8::internal::FLAG_trace_sim = false;
-
-  while (!done && !sim_->has_bad_pc()) {
-    if (last_pc != sim_->get_pc()) {
-      disasm::NameConverter converter;
-      disasm::Disassembler dasm(converter);
-      // use a reasonably large buffer
-      v8::internal::EmbeddedVector<char, 256> buffer;
-      dasm.InstructionDecode(buffer, reinterpret_cast<byte*>(sim_->get_pc()));
-      PrintF("  0x%08" V8PRIxPTR "  %s\n", sim_->get_pc(), buffer.start());
-      last_pc = sim_->get_pc();
-    }
-    char* line = ReadLine("sim> ");
-    if (line == nullptr) {
-      break;
-    } else {
-      char* last_input = sim_->last_debugger_input();
-      if (strcmp(line, "\n") == 0 && last_input != nullptr) {
-        line = last_input;
-      } else {
-        // Ownership is transferred to sim_;
-        sim_->set_last_debugger_input(line);
-      }
-      // Use sscanf to parse the individual parts of the command line. At the
-      // moment no command expects more than two parameters.
-      int argc = SScanF(line,
-                        "%" XSTR(COMMAND_SIZE) "s "
-                        "%" XSTR(ARG_SIZE) "s "
-                        "%" XSTR(ARG_SIZE) "s",
-                        cmd, arg1, arg2);
-      if ((strcmp(cmd, "si") == 0) || (strcmp(cmd, "stepi") == 0)) {
-        intptr_t value;
-
-        // If at a breakpoint, proceed past it.
-        if ((reinterpret_cast<Instruction*>(sim_->get_pc()))
-                ->InstructionBits() == 0x7D821008) {
-          sim_->set_pc(sim_->get_pc() + Instruction::kInstrSize);
-        } else {
-          sim_->ExecuteInstruction(
-              reinterpret_cast<Instruction*>(sim_->get_pc()));
-        }
-
-        if (argc == 2 && last_pc != sim_->get_pc() && GetValue(arg1, &value)) {
-          for (int i = 1; i < value; i++) {
-            disasm::NameConverter converter;
-            disasm::Disassembler dasm(converter);
-            // use a reasonably large buffer
-            v8::internal::EmbeddedVector<char, 256> buffer;
-            dasm.InstructionDecode(buffer,
-                                   reinterpret_cast<byte*>(sim_->get_pc()));
-            PrintF("  0x%08" V8PRIxPTR "  %s\n", sim_->get_pc(),
-                   buffer.start());
-            sim_->ExecuteInstruction(
-                reinterpret_cast<Instruction*>(sim_->get_pc()));
-          }
-        }
-      } else if ((strcmp(cmd, "c") == 0) || (strcmp(cmd, "cont") == 0)) {
-        // If at a breakpoint, proceed past it.
-        if ((reinterpret_cast<Instruction*>(sim_->get_pc()))
-                ->InstructionBits() == 0x7D821008) {
-          sim_->set_pc(sim_->get_pc() + Instruction::kInstrSize);
-        } else {
-          // Execute the one instruction we broke at with breakpoints disabled.
-          sim_->ExecuteInstruction(
-              reinterpret_cast<Instruction*>(sim_->get_pc()));
-        }
-        // Leave the debugger shell.
-        done = true;
-      } else if ((strcmp(cmd, "p") == 0) || (strcmp(cmd, "print") == 0)) {
-        if (argc == 2 || (argc == 3 && strcmp(arg2, "fp") == 0)) {
-          intptr_t value;
-          double dvalue;
-          if (strcmp(arg1, "all") == 0) {
-            for (int i = 0; i < kNumRegisters; i++) {
-              value = GetRegisterValue(i);
-              PrintF("    %3s: %08" V8PRIxPTR,
-                     GetRegConfig()->GetGeneralRegisterName(i), value);
-              if ((argc == 3 && strcmp(arg2, "fp") == 0) && i < 8 &&
-                  (i % 2) == 0) {
-                dvalue = GetRegisterPairDoubleValue(i);
-                PrintF(" (%f)\n", dvalue);
-              } else if (i != 0 && !((i + 1) & 3)) {
-                PrintF("\n");
-              }
-            }
-            PrintF("  pc: %08" V8PRIxPTR "  lr: %08" V8PRIxPTR
-                   "  "
-                   "ctr: %08" V8PRIxPTR "  xer: %08x  cr: %08x\n",
-                   sim_->special_reg_pc_, sim_->special_reg_lr_,
-                   sim_->special_reg_ctr_, sim_->special_reg_xer_,
-                   sim_->condition_reg_);
-          } else if (strcmp(arg1, "alld") == 0) {
-            for (int i = 0; i < kNumRegisters; i++) {
-              value = GetRegisterValue(i);
-              PrintF("     %3s: %08" V8PRIxPTR " %11" V8PRIdPTR,
-                     GetRegConfig()->GetGeneralRegisterName(i), value, value);
-              if ((argc == 3 && strcmp(arg2, "fp") == 0) && i < 8 &&
-                  (i % 2) == 0) {
-                dvalue = GetRegisterPairDoubleValue(i);
-                PrintF(" (%f)\n", dvalue);
-              } else if (!((i + 1) % 2)) {
-                PrintF("\n");
-              }
-            }
-            PrintF("   pc: %08" V8PRIxPTR "  lr: %08" V8PRIxPTR
-                   "  "
-                   "ctr: %08" V8PRIxPTR "  xer: %08x  cr: %08x\n",
-                   sim_->special_reg_pc_, sim_->special_reg_lr_,
-                   sim_->special_reg_ctr_, sim_->special_reg_xer_,
-                   sim_->condition_reg_);
-          } else if (strcmp(arg1, "allf") == 0) {
-            for (int i = 0; i < DoubleRegister::kNumRegisters; i++) {
-              dvalue = GetFPDoubleRegisterValue(i);
-              uint64_t as_words = bit_cast<uint64_t>(dvalue);
-              PrintF("%3s: %f 0x%08x %08x\n",
-                     GetRegConfig()->GetDoubleRegisterName(i), dvalue,
-                     static_cast<uint32_t>(as_words >> 32),
-                     static_cast<uint32_t>(as_words & 0xFFFFFFFF));
-            }
-          } else if (arg1[0] == 'r' &&
-                     (arg1[1] >= '0' && arg1[1] <= '9' &&
-                      (arg1[2] == '\0' || (arg1[2] >= '0' && arg1[2] <= '9' &&
-                                           arg1[3] == '\0')))) {
-            int regnum = strtoul(&arg1[1], 0, 10);
-            if (regnum != kNoRegister) {
-              value = GetRegisterValue(regnum);
-              PrintF("%s: 0x%08" V8PRIxPTR " %" V8PRIdPTR "\n", arg1, value,
-                     value);
-            } else {
-              PrintF("%s unrecognized\n", arg1);
-            }
-          } else {
-            if (GetValue(arg1, &value)) {
-              PrintF("%s: 0x%08" V8PRIxPTR " %" V8PRIdPTR "\n", arg1, value,
-                     value);
-            } else if (GetFPDoubleValue(arg1, &dvalue)) {
-              uint64_t as_words = bit_cast<uint64_t>(dvalue);
-              PrintF("%s: %f 0x%08x %08x\n", arg1, dvalue,
-                     static_cast<uint32_t>(as_words >> 32),
-                     static_cast<uint32_t>(as_words & 0xFFFFFFFF));
-            } else {
-              PrintF("%s unrecognized\n", arg1);
-            }
-          }
-        } else {
-          PrintF("print <register>\n");
-        }
-      } else if ((strcmp(cmd, "po") == 0) ||
-                 (strcmp(cmd, "printobject") == 0)) {
-        if (argc == 2) {
-          intptr_t value;
-          OFStream os(stdout);
-          if (GetValue(arg1, &value)) {
-            Object* obj = reinterpret_cast<Object*>(value);
-            os << arg1 << ": \n";
-#ifdef DEBUG
-            obj->Print(os);
-            os << "\n";
-#else
-            os << Brief(obj) << "\n";
-#endif
-          } else {
-            os << arg1 << " unrecognized\n";
-          }
-        } else {
-          PrintF("printobject <value>\n");
-        }
-      } else if (strcmp(cmd, "setpc") == 0) {
-        intptr_t value;
-
-        if (!GetValue(arg1, &value)) {
-          PrintF("%s unrecognized\n", arg1);
-          continue;
-        }
-        sim_->set_pc(value);
-      } else if (strcmp(cmd, "stack") == 0 || strcmp(cmd, "mem") == 0) {
-        intptr_t* cur = nullptr;
-        intptr_t* end = nullptr;
-        int next_arg = 1;
-
-        if (strcmp(cmd, "stack") == 0) {
-          cur = reinterpret_cast<intptr_t*>(sim_->get_register(Simulator::sp));
-        } else {  // "mem"
-          intptr_t value;
-          if (!GetValue(arg1, &value)) {
-            PrintF("%s unrecognized\n", arg1);
-            continue;
-          }
-          cur = reinterpret_cast<intptr_t*>(value);
-          next_arg++;
-        }
-
-        intptr_t words;  // likely inaccurate variable name for 64bit
-        if (argc == next_arg) {
-          words = 10;
-        } else {
-          if (!GetValue(argv[next_arg], &words)) {
-            words = 10;
-          }
-        }
-        end = cur + words;
-
-        while (cur < end) {
-          PrintF("  0x%08" V8PRIxPTR ":  0x%08" V8PRIxPTR " %10" V8PRIdPTR,
-                 reinterpret_cast<intptr_t>(cur), *cur, *cur);
-          HeapObject* obj = reinterpret_cast<HeapObject*>(*cur);
-          intptr_t value = *cur;
-          Heap* current_heap = sim_->isolate_->heap();
-          if (((value & 1) == 0) ||
-              current_heap->ContainsSlow(obj->address())) {
-            PrintF(" (");
-            if ((value & 1) == 0) {
-              PrintF("smi %d", PlatformSmiTagging::SmiToInt(obj));
-            } else {
-              obj->ShortPrint();
-            }
-            PrintF(")");
-          }
-          PrintF("\n");
-          cur++;
-        }
-      } else if (strcmp(cmd, "disasm") == 0 || strcmp(cmd, "di") == 0) {
-        disasm::NameConverter converter;
-        disasm::Disassembler dasm(converter);
-        // use a reasonably large buffer
-        v8::internal::EmbeddedVector<char, 256> buffer;
-
-        byte* prev = nullptr;
-        byte* cur = nullptr;
-        byte* end = nullptr;
-
-        if (argc == 1) {
-          cur = reinterpret_cast<byte*>(sim_->get_pc());
-          end = cur + (10 * Instruction::kInstrSize);
-        } else if (argc == 2) {
-          int regnum = Registers::Number(arg1);
-          if (regnum != kNoRegister || strncmp(arg1, "0x", 2) == 0) {
-            // The argument is an address or a register name.
-            intptr_t value;
-            if (GetValue(arg1, &value)) {
-              cur = reinterpret_cast<byte*>(value);
-              // Disassemble 10 instructions at <arg1>.
-              end = cur + (10 * Instruction::kInstrSize);
-            }
-          } else {
-            // The argument is the number of instructions.
-            intptr_t value;
-            if (GetValue(arg1, &value)) {
-              cur = reinterpret_cast<byte*>(sim_->get_pc());
-              // Disassemble <arg1> instructions.
-              end = cur + (value * Instruction::kInstrSize);
-            }
-          }
-        } else {
-          intptr_t value1;
-          intptr_t value2;
-          if (GetValue(arg1, &value1) && GetValue(arg2, &value2)) {
-            cur = reinterpret_cast<byte*>(value1);
-            end = cur + (value2 * Instruction::kInstrSize);
-          }
-        }
-
-        while (cur < end) {
-          prev = cur;
-          cur += dasm.InstructionDecode(buffer, cur);
-          PrintF("  0x%08" V8PRIxPTR "  %s\n", reinterpret_cast<intptr_t>(prev),
-                 buffer.start());
-        }
-      } else if (strcmp(cmd, "gdb") == 0) {
-        PrintF("relinquishing control to gdb\n");
-        v8::base::OS::DebugBreak();
-        PrintF("regaining control from gdb\n");
-      } else if (strcmp(cmd, "break") == 0) {
-        if (argc == 2) {
-          intptr_t value;
-          if (GetValue(arg1, &value)) {
-            if (!SetBreakpoint(reinterpret_cast<Instruction*>(value))) {
-              PrintF("setting breakpoint failed\n");
-            }
-          } else {
-            PrintF("%s unrecognized\n", arg1);
-          }
-        } else {
-          PrintF("break <address>\n");
-        }
-      } else if (strcmp(cmd, "del") == 0) {
-        if (!DeleteBreakpoint(nullptr)) {
-          PrintF("deleting breakpoint failed\n");
-        }
-      } else if (strcmp(cmd, "cr") == 0) {
-        PrintF("Condition reg: %08x\n", sim_->condition_reg_);
-      } else if (strcmp(cmd, "lr") == 0) {
-        PrintF("Link reg: %08" V8PRIxPTR "\n", sim_->special_reg_lr_);
-      } else if (strcmp(cmd, "ctr") == 0) {
-        PrintF("Ctr reg: %08" V8PRIxPTR "\n", sim_->special_reg_ctr_);
-      } else if (strcmp(cmd, "xer") == 0) {
-        PrintF("XER: %08x\n", sim_->special_reg_xer_);
-      } else if (strcmp(cmd, "fpscr") == 0) {
-        PrintF("FPSCR: %08x\n", sim_->fp_condition_reg_);
-      } else if (strcmp(cmd, "stop") == 0) {
-        intptr_t value;
-        intptr_t stop_pc =
-            sim_->get_pc() - (Instruction::kInstrSize + kPointerSize);
-        Instruction* stop_instr = reinterpret_cast<Instruction*>(stop_pc);
-        Instruction* msg_address =
-            reinterpret_cast<Instruction*>(stop_pc + Instruction::kInstrSize);
-        if ((argc == 2) && (strcmp(arg1, "unstop") == 0)) {
-          // Remove the current stop.
-          if (sim_->isStopInstruction(stop_instr)) {
-            stop_instr->SetInstructionBits(kNopInstr);
-            msg_address->SetInstructionBits(kNopInstr);
-          } else {
-            PrintF("Not at debugger stop.\n");
-          }
-        } else if (argc == 3) {
-          // Print information about all/the specified breakpoint(s).
-          if (strcmp(arg1, "info") == 0) {
-            if (strcmp(arg2, "all") == 0) {
-              PrintF("Stop information:\n");
-              for (uint32_t i = 0; i < sim_->kNumOfWatchedStops; i++) {
-                sim_->PrintStopInfo(i);
-              }
-            } else if (GetValue(arg2, &value)) {
-              sim_->PrintStopInfo(value);
-            } else {
-              PrintF("Unrecognized argument.\n");
-            }
-          } else if (strcmp(arg1, "enable") == 0) {
-            // Enable all/the specified breakpoint(s).
-            if (strcmp(arg2, "all") == 0) {
-              for (uint32_t i = 0; i < sim_->kNumOfWatchedStops; i++) {
-                sim_->EnableStop(i);
-              }
-            } else if (GetValue(arg2, &value)) {
-              sim_->EnableStop(value);
-            } else {
-              PrintF("Unrecognized argument.\n");
-            }
-          } else if (strcmp(arg1, "disable") == 0) {
-            // Disable all/the specified breakpoint(s).
-            if (strcmp(arg2, "all") == 0) {
-              for (uint32_t i = 0; i < sim_->kNumOfWatchedStops; i++) {
-                sim_->DisableStop(i);
-              }
-            } else if (GetValue(arg2, &value)) {
-              sim_->DisableStop(value);
-            } else {
-              PrintF("Unrecognized argument.\n");
-            }
-          }
-        } else {
-          PrintF("Wrong usage. Use help command for more information.\n");
-        }
-      } else if ((strcmp(cmd, "t") == 0) || strcmp(cmd, "trace") == 0) {
-        ::v8::internal::FLAG_trace_sim = !::v8::internal::FLAG_trace_sim;
-        PrintF("Trace of executed instructions is %s\n",
-               ::v8::internal::FLAG_trace_sim ? "on" : "off");
-      } else if ((strcmp(cmd, "h") == 0) || (strcmp(cmd, "help") == 0)) {
-        PrintF("cont\n");
-        PrintF("  continue execution (alias 'c')\n");
-        PrintF("stepi [num instructions]\n");
-        PrintF("  step one/num instruction(s) (alias 'si')\n");
-        PrintF("print <register>\n");
-        PrintF("  print register content (alias 'p')\n");
-        PrintF("  use register name 'all' to display all integer registers\n");
-        PrintF(
-            "  use register name 'alld' to display integer registers "
-            "with decimal values\n");
-        PrintF("  use register name 'rN' to display register number 'N'\n");
-        PrintF("  add argument 'fp' to print register pair double values\n");
-        PrintF(
-            "  use register name 'allf' to display floating-point "
-            "registers\n");
-        PrintF("printobject <register>\n");
-        PrintF("  print an object from a register (alias 'po')\n");
-        PrintF("cr\n");
-        PrintF("  print condition register\n");
-        PrintF("lr\n");
-        PrintF("  print link register\n");
-        PrintF("ctr\n");
-        PrintF("  print ctr register\n");
-        PrintF("xer\n");
-        PrintF("  print XER\n");
-        PrintF("fpscr\n");
-        PrintF("  print FPSCR\n");
-        PrintF("stack [<num words>]\n");
-        PrintF("  dump stack content, default dump 10 words)\n");
-        PrintF("mem <address> [<num words>]\n");
-        PrintF("  dump memory content, default dump 10 words)\n");
-        PrintF("disasm [<instructions>]\n");
-        PrintF("disasm [<address/register>]\n");
-        PrintF("disasm [[<address/register>] <instructions>]\n");
-        PrintF("  disassemble code, default is 10 instructions\n");
-        PrintF("  from pc (alias 'di')\n");
-        PrintF("gdb\n");
-        PrintF("  enter gdb\n");
-        PrintF("break <address>\n");
-        PrintF("  set a break point on the address\n");
-        PrintF("del\n");
-        PrintF("  delete the breakpoint\n");
-        PrintF("trace (alias 't')\n");
-        PrintF("  toogle the tracing of all executed statements\n");
-        PrintF("stop feature:\n");
-        PrintF("  Description:\n");
-        PrintF("    Stops are debug instructions inserted by\n");
-        PrintF("    the Assembler::stop() function.\n");
-        PrintF("    When hitting a stop, the Simulator will\n");
-        PrintF("    stop and and give control to the PPCDebugger.\n");
-        PrintF("    The first %d stop codes are watched:\n",
-               Simulator::kNumOfWatchedStops);
-        PrintF("    - They can be enabled / disabled: the Simulator\n");
-        PrintF("      will / won't stop when hitting them.\n");
-        PrintF("    - The Simulator keeps track of how many times they \n");
-        PrintF("      are met. (See the info command.) Going over a\n");
-        PrintF("      disabled stop still increases its counter. \n");
-        PrintF("  Commands:\n");
-        PrintF("    stop info all/<code> : print infos about number <code>\n");
-        PrintF("      or all stop(s).\n");
-        PrintF("    stop enable/disable all/<code> : enables / disables\n");
-        PrintF("      all or number <code> stop(s)\n");
-        PrintF("    stop unstop\n");
-        PrintF("      ignore the stop instruction at the current location\n");
-        PrintF("      from now on\n");
-      } else {
-        PrintF("Unknown command: %s\n", cmd);
-      }
-    }
-  }
-
-  // Add all the breakpoints back to stop execution and enter the debugger
-  // shell when hit.
-  RedoBreakpoints();
-  // Restore tracing
-  ::v8::internal::FLAG_trace_sim = trace;
-
-#undef COMMAND_SIZE
-#undef ARG_SIZE
-
-#undef STR
-#undef XSTR
-}
-
-
-static bool ICacheMatch(void* one, void* two) {
-  DCHECK_EQ(reinterpret_cast<intptr_t>(one) & CachePage::kPageMask, 0);
-  DCHECK_EQ(reinterpret_cast<intptr_t>(two) & CachePage::kPageMask, 0);
-  return one == two;
-}
-
-
-static uint32_t ICacheHash(void* key) {
-  return static_cast<uint32_t>(reinterpret_cast<uintptr_t>(key)) >> 2;
-}
-
-
-static bool AllOnOnePage(uintptr_t start, int size) {
-  intptr_t start_page = (start & ~CachePage::kPageMask);
-  intptr_t end_page = ((start + size) & ~CachePage::kPageMask);
-  return start_page == end_page;
-}
-
-
-void Simulator::set_last_debugger_input(char* input) {
-  DeleteArray(last_debugger_input_);
-  last_debugger_input_ = input;
-}
-
-void Simulator::SetRedirectInstruction(Instruction* instruction) {
-  instruction->SetInstructionBits(rtCallRedirInstr | kCallRtRedirected);
-}
-
-void Simulator::FlushICache(base::CustomMatcherHashMap* i_cache,
-                            void* start_addr, size_t size) {
-  intptr_t start = reinterpret_cast<intptr_t>(start_addr);
-  int intra_line = (start & CachePage::kLineMask);
-  start -= intra_line;
-  size += intra_line;
-  size = ((size - 1) | CachePage::kLineMask) + 1;
-  int offset = (start & CachePage::kPageMask);
-  while (!AllOnOnePage(start, size - 1)) {
-    int bytes_to_flush = CachePage::kPageSize - offset;
-    FlushOnePage(i_cache, start, bytes_to_flush);
-    start += bytes_to_flush;
-    size -= bytes_to_flush;
-    DCHECK_EQ(0, static_cast<int>(start & CachePage::kPageMask));
-    offset = 0;
-  }
-  if (size != 0) {
-    FlushOnePage(i_cache, start, size);
-  }
-}
-
-CachePage* Simulator::GetCachePage(base::CustomMatcherHashMap* i_cache,
-                                   void* page) {
-  base::HashMap::Entry* entry = i_cache->LookupOrInsert(page, ICacheHash(page));
-  if (entry->value == nullptr) {
-    CachePage* new_page = new CachePage();
-    entry->value = new_page;
-  }
-  return reinterpret_cast<CachePage*>(entry->value);
-}
-
-
-// Flush from start up to and not including start + size.
-void Simulator::FlushOnePage(base::CustomMatcherHashMap* i_cache,
-                             intptr_t start, int size) {
-  DCHECK_LE(size, CachePage::kPageSize);
-  DCHECK(AllOnOnePage(start, size - 1));
-  DCHECK_EQ(start & CachePage::kLineMask, 0);
-  DCHECK_EQ(size & CachePage::kLineMask, 0);
-  void* page = reinterpret_cast<void*>(start & (~CachePage::kPageMask));
-  int offset = (start & CachePage::kPageMask);
-  CachePage* cache_page = GetCachePage(i_cache, page);
-  char* valid_bytemap = cache_page->ValidityByte(offset);
-  memset(valid_bytemap, CachePage::LINE_INVALID, size >> CachePage::kLineShift);
-}
-
-void Simulator::CheckICache(base::CustomMatcherHashMap* i_cache,
-                            Instruction* instr) {
-  intptr_t address = reinterpret_cast<intptr_t>(instr);
-  void* page = reinterpret_cast<void*>(address & (~CachePage::kPageMask));
-  void* line = reinterpret_cast<void*>(address & (~CachePage::kLineMask));
-  int offset = (address & CachePage::kPageMask);
-  CachePage* cache_page = GetCachePage(i_cache, page);
-  char* cache_valid_byte = cache_page->ValidityByte(offset);
-  bool cache_hit = (*cache_valid_byte == CachePage::LINE_VALID);
-  char* cached_line = cache_page->CachedData(offset & ~CachePage::kLineMask);
-  if (cache_hit) {
-    // Check that the data in memory matches the contents of the I-cache.
-    CHECK_EQ(0,
-             memcmp(reinterpret_cast<void*>(instr),
-                    cache_page->CachedData(offset), Instruction::kInstrSize));
-  } else {
-    // Cache miss.  Load memory into the cache.
-    memcpy(cached_line, line, CachePage::kLineLength);
-    *cache_valid_byte = CachePage::LINE_VALID;
-  }
-}
-
-
-Simulator::Simulator(Isolate* isolate) : isolate_(isolate) {
-  i_cache_ = isolate_->simulator_i_cache();
-  if (i_cache_ == nullptr) {
-    i_cache_ = new base::CustomMatcherHashMap(&ICacheMatch);
-    isolate_->set_simulator_i_cache(i_cache_);
-  }
-// Set up simulator support first. Some of this information is needed to
-// setup the architecture state.
-#if V8_TARGET_ARCH_PPC64
-  size_t stack_size = FLAG_sim_stack_size * KB;
-#else
-  size_t stack_size = MB;  // allocate 1MB for stack
-#endif
-  stack_size += 2 * stack_protection_size_;
-  stack_ = reinterpret_cast<char*>(malloc(stack_size));
-  pc_modified_ = false;
-  icount_ = 0;
-  break_pc_ = nullptr;
-  break_instr_ = 0;
-
-  // Set up architecture state.
-  // All registers are initialized to zero to start with.
-  for (int i = 0; i < kNumGPRs; i++) {
-    registers_[i] = 0;
-  }
-  condition_reg_ = 0;
-  fp_condition_reg_ = 0;
-  special_reg_pc_ = 0;
-  special_reg_lr_ = 0;
-  special_reg_ctr_ = 0;
-
-  // Initializing FP registers.
-  for (int i = 0; i < kNumFPRs; i++) {
-    fp_registers_[i] = 0.0;
-  }
-
-  // The sp is initialized to point to the bottom (high address) of the
-  // allocated stack area. To be safe in potential stack underflows we leave
-  // some buffer below.
-  registers_[sp] =
-      reinterpret_cast<intptr_t>(stack_) + stack_size - stack_protection_size_;
-
-  last_debugger_input_ = nullptr;
-}
-
-Simulator::~Simulator() {
-  global_monitor_.Pointer()->RemoveProcessor(&global_monitor_processor_);
-  free(stack_);
-}
-
-
-// Get the active Simulator for the current thread.
-Simulator* Simulator::current(Isolate* isolate) {
-  v8::internal::Isolate::PerIsolateThreadData* isolate_data =
-      isolate->FindOrAllocatePerThreadDataForThisThread();
-  DCHECK_NOT_NULL(isolate_data);
-
-  Simulator* sim = isolate_data->simulator();
-  if (sim == nullptr) {
-    // TODO(146): delete the simulator object when a thread/isolate goes away.
-    sim = new Simulator(isolate);
-    isolate_data->set_simulator(sim);
-  }
-  return sim;
-}
-
-
-// Sets the register in the architecture state.
-void Simulator::set_register(int reg, intptr_t value) {
-  DCHECK((reg >= 0) && (reg < kNumGPRs));
-  registers_[reg] = value;
-}
-
-
-// Get the register from the architecture state.
-intptr_t Simulator::get_register(int reg) const {
-  DCHECK((reg >= 0) && (reg < kNumGPRs));
-  // Stupid code added to avoid bug in GCC.
-  // See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43949
-  if (reg >= kNumGPRs) return 0;
-  // End stupid code.
-  return registers_[reg];
-}
-
-
-double Simulator::get_double_from_register_pair(int reg) {
-  DCHECK((reg >= 0) && (reg < kNumGPRs) && ((reg % 2) == 0));
-
-  double dm_val = 0.0;
-#if !V8_TARGET_ARCH_PPC64  // doesn't make sense in 64bit mode
-  // Read the bits from the unsigned integer register_[] array
-  // into the double precision floating point value and return it.
-  char buffer[sizeof(fp_registers_[0])];
-  memcpy(buffer, &registers_[reg], 2 * sizeof(registers_[0]));
-  memcpy(&dm_val, buffer, 2 * sizeof(registers_[0]));
-#endif
-  return (dm_val);
-}
-
-
-// Raw access to the PC register.
-void Simulator::set_pc(intptr_t value) {
-  pc_modified_ = true;
-  special_reg_pc_ = value;
-}
-
-
-bool Simulator::has_bad_pc() const {
-  return ((special_reg_pc_ == bad_lr) || (special_reg_pc_ == end_sim_pc));
-}
-
-
-// Raw access to the PC register without the special adjustment when reading.
-intptr_t Simulator::get_pc() const { return special_reg_pc_; }
-
-
-// Runtime FP routines take:
-// - two double arguments
-// - one double argument and zero or one integer arguments.
-// All are consructed here from d1, d2 and r3.
-void Simulator::GetFpArgs(double* x, double* y, intptr_t* z) {
-  *x = get_double_from_d_register(1);
-  *y = get_double_from_d_register(2);
-  *z = get_register(3);
-}
-
-
-// The return value is in d1.
-void Simulator::SetFpResult(const double& result) {
-  set_d_register_from_double(1, result);
-}
-
-
-void Simulator::TrashCallerSaveRegisters() {
-// We don't trash the registers with the return value.
-#if 0  // A good idea to trash volatile registers, needs to be done
-  registers_[2] = 0x50BAD4U;
-  registers_[3] = 0x50BAD4U;
-  registers_[12] = 0x50BAD4U;
-#endif
-}
-
-
-uint32_t Simulator::ReadWU(intptr_t addr, Instruction* instr) {
-  // All supported PPC targets allow unaligned accesses, so we don't need to
-  // check the alignment here.
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyLoad(addr);
-  uint32_t* ptr = reinterpret_cast<uint32_t*>(addr);
-  return *ptr;
-}
-
-uint32_t Simulator::ReadExWU(intptr_t addr, Instruction* instr) {
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyLoadExcl(addr, TransactionSize::Word);
-  global_monitor_.Pointer()->NotifyLoadExcl_Locked(addr,
-                                                   &global_monitor_processor_);
-  uint32_t* ptr = reinterpret_cast<uint32_t*>(addr);
-  return *ptr;
-}
-
-int32_t Simulator::ReadW(intptr_t addr, Instruction* instr) {
-  // All supported PPC targets allow unaligned accesses, so we don't need to
-  // check the alignment here.
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyLoad(addr);
-  int32_t* ptr = reinterpret_cast<int32_t*>(addr);
-  return *ptr;
-}
-
-
-void Simulator::WriteW(intptr_t addr, uint32_t value, Instruction* instr) {
-  // All supported PPC targets allow unaligned accesses, so we don't need to
-  // check the alignment here.
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyStore(addr);
-  global_monitor_.Pointer()->NotifyStore_Locked(addr,
-                                                &global_monitor_processor_);
-  uint32_t* ptr = reinterpret_cast<uint32_t*>(addr);
-  *ptr = value;
-  return;
-}
-
-int Simulator::WriteExW(intptr_t addr, uint32_t value, Instruction* instr) {
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  if (local_monitor_.NotifyStoreExcl(addr, TransactionSize::Word) &&
-      global_monitor_.Pointer()->NotifyStoreExcl_Locked(
-          addr, &global_monitor_processor_)) {
-    uint32_t* ptr = reinterpret_cast<uint32_t*>(addr);
-    *ptr = value;
-    return 0;
-  } else {
-    return 1;
-  }
-}
-
-void Simulator::WriteW(intptr_t addr, int32_t value, Instruction* instr) {
-  // All supported PPC targets allow unaligned accesses, so we don't need to
-  // check the alignment here.
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyStore(addr);
-  global_monitor_.Pointer()->NotifyStore_Locked(addr,
-                                                &global_monitor_processor_);
-  int32_t* ptr = reinterpret_cast<int32_t*>(addr);
-  *ptr = value;
-  return;
-}
-
-uint16_t Simulator::ReadHU(intptr_t addr, Instruction* instr) {
-  // All supported PPC targets allow unaligned accesses, so we don't need to
-  // check the alignment here.
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyLoad(addr);
-  uint16_t* ptr = reinterpret_cast<uint16_t*>(addr);
-  return *ptr;
-}
-
-uint16_t Simulator::ReadExHU(intptr_t addr, Instruction* instr) {
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyLoadExcl(addr, TransactionSize::HalfWord);
-  global_monitor_.Pointer()->NotifyLoadExcl_Locked(addr,
-                                                   &global_monitor_processor_);
-  uint16_t* ptr = reinterpret_cast<uint16_t*>(addr);
-  return *ptr;
-}
-
-int16_t Simulator::ReadH(intptr_t addr, Instruction* instr) {
-  // All supported PPC targets allow unaligned accesses, so we don't need to
-  // check the alignment here.
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyLoad(addr);
-  int16_t* ptr = reinterpret_cast<int16_t*>(addr);
-  return *ptr;
-}
-
-
-void Simulator::WriteH(intptr_t addr, uint16_t value, Instruction* instr) {
-  // All supported PPC targets allow unaligned accesses, so we don't need to
-  // check the alignment here.
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyStore(addr);
-  global_monitor_.Pointer()->NotifyStore_Locked(addr,
-                                                &global_monitor_processor_);
-  uint16_t* ptr = reinterpret_cast<uint16_t*>(addr);
-  *ptr = value;
-  return;
-}
-
-
-void Simulator::WriteH(intptr_t addr, int16_t value, Instruction* instr) {
-  // All supported PPC targets allow unaligned accesses, so we don't need to
-  // check the alignment here.
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyStore(addr);
-  global_monitor_.Pointer()->NotifyStore_Locked(addr,
-                                                &global_monitor_processor_);
-  int16_t* ptr = reinterpret_cast<int16_t*>(addr);
-  *ptr = value;
-  return;
-}
-
-int Simulator::WriteExH(intptr_t addr, uint16_t value, Instruction* instr) {
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  if (local_monitor_.NotifyStoreExcl(addr, TransactionSize::HalfWord) &&
-      global_monitor_.Pointer()->NotifyStoreExcl_Locked(
-          addr, &global_monitor_processor_)) {
-    uint16_t* ptr = reinterpret_cast<uint16_t*>(addr);
-    *ptr = value;
-    return 0;
-  } else {
-    return 1;
-  }
-}
-
-uint8_t Simulator::ReadBU(intptr_t addr) {
-  // All supported PPC targets allow unaligned accesses, so we don't need to
-  // check the alignment here.
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyLoad(addr);
-  uint8_t* ptr = reinterpret_cast<uint8_t*>(addr);
-  return *ptr;
-}
-
-
-int8_t Simulator::ReadB(intptr_t addr) {
-  // All supported PPC targets allow unaligned accesses, so we don't need to
-  // check the alignment here.
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyLoad(addr);
-  int8_t* ptr = reinterpret_cast<int8_t*>(addr);
-  return *ptr;
-}
-
-uint8_t Simulator::ReadExBU(intptr_t addr) {
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyLoadExcl(addr, TransactionSize::Byte);
-  global_monitor_.Pointer()->NotifyLoadExcl_Locked(addr,
-                                                   &global_monitor_processor_);
-  uint8_t* ptr = reinterpret_cast<uint8_t*>(addr);
-  return *ptr;
-}
-
-void Simulator::WriteB(intptr_t addr, uint8_t value) {
-  // All supported PPC targets allow unaligned accesses, so we don't need to
-  // check the alignment here.
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyStore(addr);
-  global_monitor_.Pointer()->NotifyStore_Locked(addr,
-                                                &global_monitor_processor_);
-  uint8_t* ptr = reinterpret_cast<uint8_t*>(addr);
-  *ptr = value;
-}
-
-
-void Simulator::WriteB(intptr_t addr, int8_t value) {
-  // All supported PPC targets allow unaligned accesses, so we don't need to
-  // check the alignment here.
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyStore(addr);
-  global_monitor_.Pointer()->NotifyStore_Locked(addr,
-                                                &global_monitor_processor_);
-  int8_t* ptr = reinterpret_cast<int8_t*>(addr);
-  *ptr = value;
-}
-
-int Simulator::WriteExB(intptr_t addr, uint8_t value) {
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  if (local_monitor_.NotifyStoreExcl(addr, TransactionSize::Byte) &&
-      global_monitor_.Pointer()->NotifyStoreExcl_Locked(
-          addr, &global_monitor_processor_)) {
-    uint8_t* ptr = reinterpret_cast<uint8_t*>(addr);
-    *ptr = value;
-    return 0;
-  } else {
-    return 1;
-  }
-}
-
-intptr_t* Simulator::ReadDW(intptr_t addr) {
-  // All supported PPC targets allow unaligned accesses, so we don't need to
-  // check the alignment here.
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyLoad(addr);
-  intptr_t* ptr = reinterpret_cast<intptr_t*>(addr);
-  return ptr;
-}
-
-
-void Simulator::WriteDW(intptr_t addr, int64_t value) {
-  // All supported PPC targets allow unaligned accesses, so we don't need to
-  // check the alignment here.
-  base::LockGuard<base::Mutex> lock_guard(&global_monitor_.Pointer()->mutex);
-  local_monitor_.NotifyStore(addr);
-  global_monitor_.Pointer()->NotifyStore_Locked(addr,
-                                                &global_monitor_processor_);
-  int64_t* ptr = reinterpret_cast<int64_t*>(addr);
-  *ptr = value;
-  return;
-}
-
-
-// Returns the limit of the stack area to enable checking for stack overflows.
-uintptr_t Simulator::StackLimit(uintptr_t c_limit) const {
-  // The simulator uses a separate JS stack. If we have exhausted the C stack,
-  // we also drop down the JS limit to reflect the exhaustion on the JS stack.
-  if (GetCurrentStackPosition() < c_limit) {
-    return reinterpret_cast<uintptr_t>(get_sp());
-  }
-
-  // Otherwise the limit is the JS stack. Leave a safety margin to prevent
-  // overrunning the stack when pushing values.
-  return reinterpret_cast<uintptr_t>(stack_) + stack_protection_size_;
-}
-
-
-// Unsupported instructions use Format to print an error and stop execution.
-void Simulator::Format(Instruction* instr, const char* format) {
-  PrintF("Simulator found unsupported instruction:\n 0x%08" V8PRIxPTR ": %s\n",
-         reinterpret_cast<intptr_t>(instr), format);
-  UNIMPLEMENTED();
-}
-
-
-// Calculate C flag value for additions.
-bool Simulator::CarryFrom(int32_t left, int32_t right, int32_t carry) {
-  uint32_t uleft = static_cast<uint32_t>(left);
-  uint32_t uright = static_cast<uint32_t>(right);
-  uint32_t urest = 0xFFFFFFFFU - uleft;
-
-  return (uright > urest) ||
-         (carry && (((uright + 1) > urest) || (uright > (urest - 1))));
-}
-
-
-// Calculate C flag value for subtractions.
-bool Simulator::BorrowFrom(int32_t left, int32_t right) {
-  uint32_t uleft = static_cast<uint32_t>(left);
-  uint32_t uright = static_cast<uint32_t>(right);
-
-  return (uright > uleft);
-}
-
-
-// Calculate V flag value for additions and subtractions.
-bool Simulator::OverflowFrom(int32_t alu_out, int32_t left, int32_t right,
-                             bool addition) {
-  bool overflow;
-  if (addition) {
-    // operands have the same sign
-    overflow = ((left >= 0 && right >= 0) || (left < 0 && right < 0))
-               // and operands and result have different sign
-               &&
-               ((left < 0 && alu_out >= 0) || (left >= 0 && alu_out < 0));
-  } else {
-    // operands have different signs
-    overflow = ((left < 0 && right >= 0) || (left >= 0 && right < 0))
-               // and first operand and result have different signs
-               &&
-               ((left < 0 && alu_out >= 0) || (left >= 0 && alu_out < 0));
-  }
-  return overflow;
-}
-
-
-#if V8_TARGET_ARCH_PPC64
-static void decodeObjectPair(ObjectPair* pair, intptr_t* x, intptr_t* y) {
-  *x = reinterpret_cast<intptr_t>(pair->x);
-  *y = reinterpret_cast<intptr_t>(pair->y);
-}
-#else
-static void decodeObjectPair(ObjectPair* pair, intptr_t* x, intptr_t* y) {
-#if V8_TARGET_BIG_ENDIAN
-  *x = static_cast<int32_t>(*pair >> 32);
-  *y = static_cast<int32_t>(*pair);
-#else
-  *x = static_cast<int32_t>(*pair);
-  *y = static_cast<int32_t>(*pair >> 32);
-#endif
-}
-#endif
-
-// Calls into the V8 runtime.
-typedef intptr_t (*SimulatorRuntimeCall)(intptr_t arg0, intptr_t arg1,
-                                         intptr_t arg2, intptr_t arg3,
-                                         intptr_t arg4, intptr_t arg5,
-                                         intptr_t arg6, intptr_t arg7,
-                                         intptr_t arg8);
-typedef ObjectPair (*SimulatorRuntimePairCall)(intptr_t arg0, intptr_t arg1,
-                                               intptr_t arg2, intptr_t arg3,
-                                               intptr_t arg4, intptr_t arg5);
-
-// These prototypes handle the four types of FP calls.
-typedef int (*SimulatorRuntimeCompareCall)(double darg0, double darg1);
-typedef double (*SimulatorRuntimeFPFPCall)(double darg0, double darg1);
-typedef double (*SimulatorRuntimeFPCall)(double darg0);
-typedef double (*SimulatorRuntimeFPIntCall)(double darg0, intptr_t arg0);
-
-// This signature supports direct call in to API function native callback
-// (refer to InvocationCallback in v8.h).
-typedef void (*SimulatorRuntimeDirectApiCall)(intptr_t arg0);
-typedef void (*SimulatorRuntimeProfilingApiCall)(intptr_t arg0, void* arg1);
-
-// This signature supports direct call to accessor getter callback.
-typedef void (*SimulatorRuntimeDirectGetterCall)(intptr_t arg0, intptr_t arg1);
-typedef void (*SimulatorRuntimeProfilingGetterCall)(intptr_t arg0,
-                                                    intptr_t arg1, void* arg2);
-
-// Software interrupt instructions are used by the simulator to call into the
-// C-based V8 runtime.
-void Simulator::SoftwareInterrupt(Instruction* instr) {
-  int svc = instr->SvcValue();
-  switch (svc) {
-    case kCallRtRedirected: {
-      // Check if stack is aligned. Error if not aligned is reported below to
-      // include information on the function called.
-      bool stack_aligned =
-          (get_register(sp) & (::v8::internal::FLAG_sim_stack_alignment - 1)) ==
-          0;
-      Redirection* redirection = Redirection::FromInstruction(instr);
-      const int kArgCount = 9;
-      const int kRegisterArgCount = 8;
-      int arg0_regnum = 3;
-      intptr_t result_buffer = 0;
-      bool uses_result_buffer =
-          (redirection->type() == ExternalReference::BUILTIN_CALL_PAIR &&
-           !ABI_RETURNS_OBJECT_PAIRS_IN_REGS);
-      if (uses_result_buffer) {
-        result_buffer = get_register(r3);
-        arg0_regnum++;
-      }
-      intptr_t arg[kArgCount];
-      // First eight arguments in registers r3-r10.
-      for (int i = 0; i < kRegisterArgCount; i++) {
-        arg[i] = get_register(arg0_regnum + i);
-      }
-      intptr_t* stack_pointer = reinterpret_cast<intptr_t*>(get_register(sp));
-      // Remaining argument on stack
-      arg[kRegisterArgCount] = stack_pointer[kStackFrameExtraParamSlot];
-      STATIC_ASSERT(kArgCount == kRegisterArgCount + 1);
-      STATIC_ASSERT(kMaxCParameters == 9);
-      bool fp_call =
-          (redirection->type() == ExternalReference::BUILTIN_FP_FP_CALL) ||
-          (redirection->type() == ExternalReference::BUILTIN_COMPARE_CALL) ||
-          (redirection->type() == ExternalReference::BUILTIN_FP_CALL) ||
-          (redirection->type() == ExternalReference::BUILTIN_FP_INT_CALL);
-      // This is dodgy but it works because the C entry stubs are never moved.
-      // See comment in codegen-arm.cc and bug 1242173.
-      intptr_t saved_lr = special_reg_lr_;
-      intptr_t external =
-          reinterpret_cast<intptr_t>(redirection->external_function());
-      if (fp_call) {
-        double dval0, dval1;  // one or two double parameters
-        intptr_t ival;        // zero or one integer parameters
-        int iresult = 0;      // integer return value
-        double dresult = 0;   // double return value
-        GetFpArgs(&dval0, &dval1, &ival);
-        if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
-          SimulatorRuntimeCall generic_target =
-              reinterpret_cast<SimulatorRuntimeCall>(external);
-          switch (redirection->type()) {
-            case ExternalReference::BUILTIN_FP_FP_CALL:
-            case ExternalReference::BUILTIN_COMPARE_CALL:
-              PrintF("Call to host function at %p with args %f, %f",
-                     static_cast<void*>(FUNCTION_ADDR(generic_target)),
-                     dval0, dval1);
-              break;
-            case ExternalReference::BUILTIN_FP_CALL:
-              PrintF("Call to host function at %p with arg %f",
-                     static_cast<void*>(FUNCTION_ADDR(generic_target)),
-                     dval0);
-              break;
-            case ExternalReference::BUILTIN_FP_INT_CALL:
-              PrintF("Call to host function at %p with args %f, %" V8PRIdPTR,
-                     static_cast<void*>(FUNCTION_ADDR(generic_target)),
-                     dval0, ival);
-              break;
-            default:
-              UNREACHABLE();
-              break;
-          }
-          if (!stack_aligned) {
-            PrintF(" with unaligned stack %08" V8PRIxPTR "\n",
-                   get_register(sp));
-          }
-          PrintF("\n");
-        }
-        CHECK(stack_aligned);
-        switch (redirection->type()) {
-          case ExternalReference::BUILTIN_COMPARE_CALL: {
-            SimulatorRuntimeCompareCall target =
-                reinterpret_cast<SimulatorRuntimeCompareCall>(external);
-            iresult = target(dval0, dval1);
-            set_register(r3, iresult);
-            break;
-          }
-          case ExternalReference::BUILTIN_FP_FP_CALL: {
-            SimulatorRuntimeFPFPCall target =
-                reinterpret_cast<SimulatorRuntimeFPFPCall>(external);
-            dresult = target(dval0, dval1);
-            SetFpResult(dresult);
-            break;
-          }
-          case ExternalReference::BUILTIN_FP_CALL: {
-            SimulatorRuntimeFPCall target =
-                reinterpret_cast<SimulatorRuntimeFPCall>(external);
-            dresult = target(dval0);
-            SetFpResult(dresult);
-            break;
-          }
-          case ExternalReference::BUILTIN_FP_INT_CALL: {
-            SimulatorRuntimeFPIntCall target =
-                reinterpret_cast<SimulatorRuntimeFPIntCall>(external);
-            dresult = target(dval0, ival);
-            SetFpResult(dresult);
-            break;
-          }
-          default:
-            UNREACHABLE();
-            break;
-        }
-        if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
-          switch (redirection->type()) {
-            case ExternalReference::BUILTIN_COMPARE_CALL:
-              PrintF("Returned %08x\n", iresult);
-              break;
-            case ExternalReference::BUILTIN_FP_FP_CALL:
-            case ExternalReference::BUILTIN_FP_CALL:
-            case ExternalReference::BUILTIN_FP_INT_CALL:
-              PrintF("Returned %f\n", dresult);
-              break;
-            default:
-              UNREACHABLE();
-              break;
-          }
-        }
-      } else if (redirection->type() == ExternalReference::DIRECT_API_CALL) {
-        // See callers of MacroAssembler::CallApiFunctionAndReturn for
-        // explanation of register usage.
-        if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
-          PrintF("Call to host function at %p args %08" V8PRIxPTR,
-                 reinterpret_cast<void*>(external), arg[0]);
-          if (!stack_aligned) {
-            PrintF(" with unaligned stack %08" V8PRIxPTR "\n",
-                   get_register(sp));
-          }
-          PrintF("\n");
-        }
-        CHECK(stack_aligned);
-        SimulatorRuntimeDirectApiCall target =
-            reinterpret_cast<SimulatorRuntimeDirectApiCall>(external);
-        target(arg[0]);
-      } else if (redirection->type() == ExternalReference::PROFILING_API_CALL) {
-        // See callers of MacroAssembler::CallApiFunctionAndReturn for
-        // explanation of register usage.
-        if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
-          PrintF("Call to host function at %p args %08" V8PRIxPTR
-                 " %08" V8PRIxPTR,
-                 reinterpret_cast<void*>(external), arg[0], arg[1]);
-          if (!stack_aligned) {
-            PrintF(" with unaligned stack %08" V8PRIxPTR "\n",
-                   get_register(sp));
-          }
-          PrintF("\n");
-        }
-        CHECK(stack_aligned);
-        SimulatorRuntimeProfilingApiCall target =
-            reinterpret_cast<SimulatorRuntimeProfilingApiCall>(external);
-        target(arg[0], Redirection::ReverseRedirection(arg[1]));
-      } else if (redirection->type() == ExternalReference::DIRECT_GETTER_CALL) {
-        // See callers of MacroAssembler::CallApiFunctionAndReturn for
-        // explanation of register usage.
-        if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
-          PrintF("Call to host function at %p args %08" V8PRIxPTR
-                 " %08" V8PRIxPTR,
-                 reinterpret_cast<void*>(external), arg[0], arg[1]);
-          if (!stack_aligned) {
-            PrintF(" with unaligned stack %08" V8PRIxPTR "\n",
-                   get_register(sp));
-          }
-          PrintF("\n");
-        }
-        CHECK(stack_aligned);
-        SimulatorRuntimeDirectGetterCall target =
-            reinterpret_cast<SimulatorRuntimeDirectGetterCall>(external);
-        if (!ABI_PASSES_HANDLES_IN_REGS) {
-          arg[0] = *(reinterpret_cast<intptr_t*>(arg[0]));
-        }
-        target(arg[0], arg[1]);
-      } else if (redirection->type() ==
-                 ExternalReference::PROFILING_GETTER_CALL) {
-        if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
-          PrintF("Call to host function at %p args %08" V8PRIxPTR
-                 " %08" V8PRIxPTR " %08" V8PRIxPTR,
-                 reinterpret_cast<void*>(external), arg[0], arg[1], arg[2]);
-          if (!stack_aligned) {
-            PrintF(" with unaligned stack %08" V8PRIxPTR "\n",
-                   get_register(sp));
-          }
-          PrintF("\n");
-        }
-        CHECK(stack_aligned);
-        SimulatorRuntimeProfilingGetterCall target =
-            reinterpret_cast<SimulatorRuntimeProfilingGetterCall>(external);
-        if (!ABI_PASSES_HANDLES_IN_REGS) {
-          arg[0] = *(reinterpret_cast<intptr_t*>(arg[0]));
-        }
-        target(arg[0], arg[1], Redirection::ReverseRedirection(arg[2]));
-      } else {
-        // builtin call.
-        if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
-          SimulatorRuntimeCall target =
-              reinterpret_cast<SimulatorRuntimeCall>(external);
-          PrintF(
-              "Call to host function at %p,\n"
-              "\t\t\t\targs %08" V8PRIxPTR ", %08" V8PRIxPTR ", %08" V8PRIxPTR
-              ", %08" V8PRIxPTR ", %08" V8PRIxPTR ", %08" V8PRIxPTR
-              ", %08" V8PRIxPTR ", %08" V8PRIxPTR ", %08" V8PRIxPTR,
-              static_cast<void*>(FUNCTION_ADDR(target)), arg[0], arg[1], arg[2],
-              arg[3], arg[4], arg[5], arg[6], arg[7], arg[8]);
-          if (!stack_aligned) {
-            PrintF(" with unaligned stack %08" V8PRIxPTR "\n",
-                   get_register(sp));
-          }
-          PrintF("\n");
-        }
-        CHECK(stack_aligned);
-        if (redirection->type() == ExternalReference::BUILTIN_CALL_PAIR) {
-          SimulatorRuntimePairCall target =
-              reinterpret_cast<SimulatorRuntimePairCall>(external);
-          ObjectPair result =
-              target(arg[0], arg[1], arg[2], arg[3], arg[4], arg[5]);
-          intptr_t x;
-          intptr_t y;
-          decodeObjectPair(&result, &x, &y);
-          if (::v8::internal::FLAG_trace_sim) {
-            PrintF("Returned {%08" V8PRIxPTR ", %08" V8PRIxPTR "}\n", x, y);
-          }
-          if (ABI_RETURNS_OBJECT_PAIRS_IN_REGS) {
-            set_register(r3, x);
-            set_register(r4, y);
-          } else {
-            memcpy(reinterpret_cast<void*>(result_buffer), &result,
-                   sizeof(ObjectPair));
-            set_register(r3, result_buffer);
-          }
-        } else {
-          DCHECK(redirection->type() == ExternalReference::BUILTIN_CALL);
-          SimulatorRuntimeCall target =
-              reinterpret_cast<SimulatorRuntimeCall>(external);
-          intptr_t result = target(arg[0], arg[1], arg[2], arg[3], arg[4],
-                                   arg[5], arg[6], arg[7], arg[8]);
-          if (::v8::internal::FLAG_trace_sim) {
-            PrintF("Returned %08" V8PRIxPTR "\n", result);
-          }
-          set_register(r3, result);
-        }
-      }
-      set_pc(saved_lr);
-      break;
-    }
-    case kBreakpoint: {
-      PPCDebugger dbg(this);
-      dbg.Debug();
-      break;
-    }
-    // stop uses all codes greater than 1 << 23.
-    default: {
-      if (svc >= (1 << 23)) {
-        uint32_t code = svc & kStopCodeMask;
-        if (isWatchedStop(code)) {
-          IncreaseStopCounter(code);
-        }
-        // Stop if it is enabled, otherwise go on jumping over the stop
-        // and the message address.
-        if (isEnabledStop(code)) {
-          PPCDebugger dbg(this);
-          dbg.Stop(instr);
-        } else {
-          set_pc(get_pc() + Instruction::kInstrSize + kPointerSize);
-        }
-      } else {
-        // This is not a valid svc code.
-        UNREACHABLE();
-        break;
-      }
-    }
-  }
-}
-
-
-// Stop helper functions.
-bool Simulator::isStopInstruction(Instruction* instr) {
-  return (instr->Bits(27, 24) == 0xF) && (instr->SvcValue() >= kStopCode);
-}
-
-
-bool Simulator::isWatchedStop(uint32_t code) {
-  DCHECK_LE(code, kMaxStopCode);
-  return code < kNumOfWatchedStops;
-}
-
-
-bool Simulator::isEnabledStop(uint32_t code) {
-  DCHECK_LE(code, kMaxStopCode);
-  // Unwatched stops are always enabled.
-  return !isWatchedStop(code) ||
-         !(watched_stops_[code].count & kStopDisabledBit);
-}
-
-
-void Simulator::EnableStop(uint32_t code) {
-  DCHECK(isWatchedStop(code));
-  if (!isEnabledStop(code)) {
-    watched_stops_[code].count &= ~kStopDisabledBit;
-  }
-}
-
-
-void Simulator::DisableStop(uint32_t code) {
-  DCHECK(isWatchedStop(code));
-  if (isEnabledStop(code)) {
-    watched_stops_[code].count |= kStopDisabledBit;
-  }
-}
-
-
-void Simulator::IncreaseStopCounter(uint32_t code) {
-  DCHECK_LE(code, kMaxStopCode);
-  DCHECK(isWatchedStop(code));
-  if ((watched_stops_[code].count & ~(1 << 31)) == 0x7FFFFFFF) {
-    PrintF(
-        "Stop counter for code %i has overflowed.\n"
-        "Enabling this code and reseting the counter to 0.\n",
-        code);
-    watched_stops_[code].count = 0;
-    EnableStop(code);
-  } else {
-    watched_stops_[code].count++;
-  }
-}
-
-
-// Print a stop status.
-void Simulator::PrintStopInfo(uint32_t code) {
-  DCHECK_LE(code, kMaxStopCode);
-  if (!isWatchedStop(code)) {
-    PrintF("Stop not watched.");
-  } else {
-    const char* state = isEnabledStop(code) ? "Enabled" : "Disabled";
-    int32_t count = watched_stops_[code].count & ~kStopDisabledBit;
-    // Don't print the state of unused breakpoints.
-    if (count != 0) {
-      if (watched_stops_[code].desc) {
-        PrintF("stop %i - 0x%x: \t%s, \tcounter = %i, \t%s\n", code, code,
-               state, count, watched_stops_[code].desc);
-      } else {
-        PrintF("stop %i - 0x%x: \t%s, \tcounter = %i\n", code, code, state,
-               count);
-      }
-    }
-  }
-}
-
-
-void Simulator::SetCR0(intptr_t result, bool setSO) {
-  int bf = 0;
-  if (result < 0) {
-    bf |= 0x80000000;
-  }
-  if (result > 0) {
-    bf |= 0x40000000;
-  }
-  if (result == 0) {
-    bf |= 0x20000000;
-  }
-  if (setSO) {
-    bf |= 0x10000000;
-  }
-  condition_reg_ = (condition_reg_ & ~0xF0000000) | bf;
-}
-
-
-void Simulator::ExecuteBranchConditional(Instruction* instr, BCType type) {
-  int bo = instr->Bits(25, 21) << 21;
-  int condition_bit = instr->Bits(20, 16);
-  int condition_mask = 0x80000000 >> condition_bit;
-  switch (bo) {
-    case DCBNZF:  // Decrement CTR; branch if CTR != 0 and condition false
-    case DCBEZF:  // Decrement CTR; branch if CTR == 0 and condition false
-      UNIMPLEMENTED();
-    case BF: {  // Branch if condition false
-      if (condition_reg_ & condition_mask) return;
-      break;
-    }
-    case DCBNZT:  // Decrement CTR; branch if CTR != 0 and condition true
-    case DCBEZT:  // Decrement CTR; branch if CTR == 0 and condition true
-      UNIMPLEMENTED();
-    case BT: {  // Branch if condition true
-      if (!(condition_reg_ & condition_mask)) return;
-      break;
-    }
-    case DCBNZ:  // Decrement CTR; branch if CTR != 0
-    case DCBEZ:  // Decrement CTR; branch if CTR == 0
-      special_reg_ctr_ -= 1;
-      if ((special_reg_ctr_ == 0) != (bo == DCBEZ)) return;
-      break;
-    case BA: {                   // Branch always
-      break;
-    }
-    default:
-      UNIMPLEMENTED();  // Invalid encoding
-  }
-
-  intptr_t old_pc = get_pc();
-
-  switch (type) {
-    case BC_OFFSET: {
-      int offset = (instr->Bits(15, 2) << 18) >> 16;
-      set_pc(old_pc + offset);
-      break;
-    }
-    case BC_LINK_REG:
-      set_pc(special_reg_lr_);
-      break;
-    case BC_CTR_REG:
-      set_pc(special_reg_ctr_);
-      break;
-  }
-
-  if (instr->Bit(0) == 1) {  // LK flag set
-    special_reg_lr_ = old_pc + 4;
-  }
-}
-
-void Simulator::ExecuteGeneric(Instruction* instr) {
-  uint32_t opcode = instr->OpcodeBase();
-  switch (opcode) {
-    case SUBFIC: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      intptr_t ra_val = get_register(ra);
-      int32_t im_val = instr->Bits(15, 0);
-      im_val = SIGN_EXT_IMM16(im_val);
-      intptr_t alu_out = im_val - ra_val;
-      set_register(rt, alu_out);
-      // todo - handle RC bit
-      break;
-    }
-    case CMPLI: {
-      int ra = instr->RAValue();
-      uint32_t im_val = instr->Bits(15, 0);
-      int cr = instr->Bits(25, 23);
-      uint32_t bf = 0;
-#if V8_TARGET_ARCH_PPC64
-      int L = instr->Bit(21);
-      if (L) {
-#endif
-        uintptr_t ra_val = get_register(ra);
-        if (ra_val < im_val) {
-          bf |= 0x80000000;
-        }
-        if (ra_val > im_val) {
-          bf |= 0x40000000;
-        }
-        if (ra_val == im_val) {
-          bf |= 0x20000000;
-        }
-#if V8_TARGET_ARCH_PPC64
-      } else {
-        uint32_t ra_val = get_register(ra);
-        if (ra_val < im_val) {
-          bf |= 0x80000000;
-        }
-        if (ra_val > im_val) {
-          bf |= 0x40000000;
-        }
-        if (ra_val == im_val) {
-          bf |= 0x20000000;
-        }
-      }
-#endif
-      uint32_t condition_mask = 0xF0000000U >> (cr * 4);
-      uint32_t condition = bf >> (cr * 4);
-      condition_reg_ = (condition_reg_ & ~condition_mask) | condition;
-      break;
-    }
-    case CMPI: {
-      int ra = instr->RAValue();
-      int32_t im_val = instr->Bits(15, 0);
-      im_val = SIGN_EXT_IMM16(im_val);
-      int cr = instr->Bits(25, 23);
-      uint32_t bf = 0;
-#if V8_TARGET_ARCH_PPC64
-      int L = instr->Bit(21);
-      if (L) {
-#endif
-        intptr_t ra_val = get_register(ra);
-        if (ra_val < im_val) {
-          bf |= 0x80000000;
-        }
-        if (ra_val > im_val) {
-          bf |= 0x40000000;
-        }
-        if (ra_val == im_val) {
-          bf |= 0x20000000;
-        }
-#if V8_TARGET_ARCH_PPC64
-      } else {
-        int32_t ra_val = get_register(ra);
-        if (ra_val < im_val) {
-          bf |= 0x80000000;
-        }
-        if (ra_val > im_val) {
-          bf |= 0x40000000;
-        }
-        if (ra_val == im_val) {
-          bf |= 0x20000000;
-        }
-      }
-#endif
-      uint32_t condition_mask = 0xF0000000U >> (cr * 4);
-      uint32_t condition = bf >> (cr * 4);
-      condition_reg_ = (condition_reg_ & ~condition_mask) | condition;
-      break;
-    }
-    case ADDIC: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      uintptr_t ra_val = get_register(ra);
-      uintptr_t im_val = SIGN_EXT_IMM16(instr->Bits(15, 0));
-      uintptr_t alu_out = ra_val + im_val;
-      // Check overflow
-      if (~ra_val < im_val) {
-        special_reg_xer_ = (special_reg_xer_ & ~0xF0000000) | 0x20000000;
-      } else {
-        special_reg_xer_ &= ~0xF0000000;
-      }
-      set_register(rt, alu_out);
-      break;
-    }
-    case ADDI: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int32_t im_val = SIGN_EXT_IMM16(instr->Bits(15, 0));
-      intptr_t alu_out;
-      if (ra == 0) {
-        alu_out = im_val;
-      } else {
-        intptr_t ra_val = get_register(ra);
-        alu_out = ra_val + im_val;
-      }
-      set_register(rt, alu_out);
-      // todo - handle RC bit
-      break;
-    }
-    case ADDIS: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int32_t im_val = (instr->Bits(15, 0) << 16);
-      intptr_t alu_out;
-      if (ra == 0) {  // treat r0 as zero
-        alu_out = im_val;
-      } else {
-        intptr_t ra_val = get_register(ra);
-        alu_out = ra_val + im_val;
-      }
-      set_register(rt, alu_out);
-      break;
-    }
-    case BCX: {
-      ExecuteBranchConditional(instr, BC_OFFSET);
-      break;
-    }
-    case BX: {
-      int offset = (instr->Bits(25, 2) << 8) >> 6;
-      if (instr->Bit(0) == 1) {  // LK flag set
-        special_reg_lr_ = get_pc() + 4;
-      }
-      set_pc(get_pc() + offset);
-      // todo - AA flag
-      break;
-    }
-    case MCRF:
-      UNIMPLEMENTED();  // Not used by V8.
-    case BCLRX:
-      ExecuteBranchConditional(instr, BC_LINK_REG);
-      break;
-    case BCCTRX:
-      ExecuteBranchConditional(instr, BC_CTR_REG);
-      break;
-    case CRNOR:
-    case RFI:
-    case CRANDC:
-      UNIMPLEMENTED();
-    case ISYNC: {
-      // todo - simulate isync
-      break;
-    }
-    case CRXOR: {
-      int bt = instr->Bits(25, 21);
-      int ba = instr->Bits(20, 16);
-      int bb = instr->Bits(15, 11);
-      int ba_val = ((0x80000000 >> ba) & condition_reg_) == 0 ? 0 : 1;
-      int bb_val = ((0x80000000 >> bb) & condition_reg_) == 0 ? 0 : 1;
-      int bt_val = ba_val ^ bb_val;
-      bt_val = bt_val << (31 - bt);  // shift bit to correct destination
-      condition_reg_ &= ~(0x80000000 >> bt);
-      condition_reg_ |= bt_val;
-      break;
-    }
-    case CREQV: {
-      int bt = instr->Bits(25, 21);
-      int ba = instr->Bits(20, 16);
-      int bb = instr->Bits(15, 11);
-      int ba_val = ((0x80000000 >> ba) & condition_reg_) == 0 ? 0 : 1;
-      int bb_val = ((0x80000000 >> bb) & condition_reg_) == 0 ? 0 : 1;
-      int bt_val = 1 - (ba_val ^ bb_val);
-      bt_val = bt_val << (31 - bt);  // shift bit to correct destination
-      condition_reg_ &= ~(0x80000000 >> bt);
-      condition_reg_ |= bt_val;
-      break;
-    }
-    case CRNAND:
-    case CRAND:
-    case CRORC:
-    case CROR: {
-      UNIMPLEMENTED();  // Not used by V8.
-      break;
-    }
-    case RLWIMIX: {
-      int ra = instr->RAValue();
-      int rs = instr->RSValue();
-      uint32_t rs_val = get_register(rs);
-      int32_t ra_val = get_register(ra);
-      int sh = instr->Bits(15, 11);
-      int mb = instr->Bits(10, 6);
-      int me = instr->Bits(5, 1);
-      uint32_t result = base::bits::RotateLeft32(rs_val, sh);
-      int mask = 0;
-      if (mb < me + 1) {
-        int bit = 0x80000000 >> mb;
-        for (; mb <= me; mb++) {
-          mask |= bit;
-          bit >>= 1;
-        }
-      } else if (mb == me + 1) {
-        mask = 0xFFFFFFFF;
-      } else {                             // mb > me+1
-        int bit = 0x80000000 >> (me + 1);  // needs to be tested
-        mask = 0xFFFFFFFF;
-        for (; me < mb; me++) {
-          mask ^= bit;
-          bit >>= 1;
-        }
-      }
-      result &= mask;
-      ra_val &= ~mask;
-      result |= ra_val;
-      set_register(ra, result);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(result);
-      }
-      break;
-    }
-    case RLWINMX:
-    case RLWNMX: {
-      int ra = instr->RAValue();
-      int rs = instr->RSValue();
-      uint32_t rs_val = get_register(rs);
-      int sh = 0;
-      if (opcode == RLWINMX) {
-        sh = instr->Bits(15, 11);
-      } else {
-        int rb = instr->RBValue();
-        uint32_t rb_val = get_register(rb);
-        sh = (rb_val & 0x1F);
-      }
-      int mb = instr->Bits(10, 6);
-      int me = instr->Bits(5, 1);
-      uint32_t result = base::bits::RotateLeft32(rs_val, sh);
-      int mask = 0;
-      if (mb < me + 1) {
-        int bit = 0x80000000 >> mb;
-        for (; mb <= me; mb++) {
-          mask |= bit;
-          bit >>= 1;
-        }
-      } else if (mb == me + 1) {
-        mask = 0xFFFFFFFF;
-      } else {                             // mb > me+1
-        int bit = 0x80000000 >> (me + 1);  // needs to be tested
-        mask = 0xFFFFFFFF;
-        for (; me < mb; me++) {
-          mask ^= bit;
-          bit >>= 1;
-        }
-      }
-      result &= mask;
-      set_register(ra, result);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(result);
-      }
-      break;
-    }
-    case ORI: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      intptr_t rs_val = get_register(rs);
-      uint32_t im_val = instr->Bits(15, 0);
-      intptr_t alu_out = rs_val | im_val;
-      set_register(ra, alu_out);
-      break;
-    }
-    case ORIS: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      intptr_t rs_val = get_register(rs);
-      uint32_t im_val = instr->Bits(15, 0);
-      intptr_t alu_out = rs_val | (im_val << 16);
-      set_register(ra, alu_out);
-      break;
-    }
-    case XORI: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      intptr_t rs_val = get_register(rs);
-      uint32_t im_val = instr->Bits(15, 0);
-      intptr_t alu_out = rs_val ^ im_val;
-      set_register(ra, alu_out);
-      // todo - set condition based SO bit
-      break;
-    }
-    case XORIS: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      intptr_t rs_val = get_register(rs);
-      uint32_t im_val = instr->Bits(15, 0);
-      intptr_t alu_out = rs_val ^ (im_val << 16);
-      set_register(ra, alu_out);
-      break;
-    }
-    case ANDIx: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      intptr_t rs_val = get_register(rs);
-      uint32_t im_val = instr->Bits(15, 0);
-      intptr_t alu_out = rs_val & im_val;
-      set_register(ra, alu_out);
-      SetCR0(alu_out);
-      break;
-    }
-    case ANDISx: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      intptr_t rs_val = get_register(rs);
-      uint32_t im_val = instr->Bits(15, 0);
-      intptr_t alu_out = rs_val & (im_val << 16);
-      set_register(ra, alu_out);
-      SetCR0(alu_out);
-      break;
-    }
-    case SRWX: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      uint32_t rs_val = get_register(rs);
-      uintptr_t rb_val = get_register(rb) & 0x3F;
-      intptr_t result = (rb_val > 31) ? 0 : rs_val >> rb_val;
-      set_register(ra, result);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(result);
-      }
-      break;
-    }
-#if V8_TARGET_ARCH_PPC64
-    case SRDX: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      uintptr_t rs_val = get_register(rs);
-      uintptr_t rb_val = get_register(rb) & 0x7F;
-      intptr_t result = (rb_val > 63) ? 0 : rs_val >> rb_val;
-      set_register(ra, result);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(result);
-      }
-      break;
-    }
-#endif
-    case MODUW: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      uint32_t ra_val = get_register(ra);
-      uint32_t rb_val = get_register(rb);
-      uint32_t alu_out = (rb_val == 0) ? -1 : ra_val % rb_val;
-      set_register(rt, alu_out);
-      break;
-    }
-#if V8_TARGET_ARCH_PPC64
-    case MODUD: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      uint64_t ra_val = get_register(ra);
-      uint64_t rb_val = get_register(rb);
-      uint64_t alu_out = (rb_val == 0) ? -1 : ra_val % rb_val;
-      set_register(rt, alu_out);
-      break;
-    }
-#endif
-    case MODSW: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      int32_t ra_val = get_register(ra);
-      int32_t rb_val = get_register(rb);
-      bool overflow = (ra_val == kMinInt && rb_val == -1);
-      // result is undefined if divisor is zero or if operation
-      // is 0x80000000 / -1.
-      int32_t alu_out = (rb_val == 0 || overflow) ? -1 : ra_val % rb_val;
-      set_register(rt, alu_out);
-      break;
-    }
-#if V8_TARGET_ARCH_PPC64
-    case MODSD: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      int64_t ra_val = get_register(ra);
-      int64_t rb_val = get_register(rb);
-      int64_t one = 1;  // work-around gcc
-      int64_t kMinLongLong = (one << 63);
-      // result is undefined if divisor is zero or if operation
-      // is 0x80000000_00000000 / -1.
-      int64_t alu_out =
-          (rb_val == 0 || (ra_val == kMinLongLong && rb_val == -1))
-              ? -1
-              : ra_val % rb_val;
-      set_register(rt, alu_out);
-      break;
-    }
-#endif
-    case SRAW: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      int32_t rs_val = get_register(rs);
-      intptr_t rb_val = get_register(rb) & 0x3F;
-      intptr_t result = (rb_val > 31) ? rs_val >> 31 : rs_val >> rb_val;
-      set_register(ra, result);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(result);
-      }
-      break;
-    }
-#if V8_TARGET_ARCH_PPC64
-    case SRAD: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      intptr_t rs_val = get_register(rs);
-      intptr_t rb_val = get_register(rb) & 0x7F;
-      intptr_t result = (rb_val > 63) ? rs_val >> 63 : rs_val >> rb_val;
-      set_register(ra, result);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(result);
-      }
-      break;
-    }
-#endif
-    case SRAWIX: {
-      int ra = instr->RAValue();
-      int rs = instr->RSValue();
-      int sh = instr->Bits(15, 11);
-      int32_t rs_val = get_register(rs);
-      intptr_t result = rs_val >> sh;
-      set_register(ra, result);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(result);
-      }
-      break;
-    }
-#if V8_TARGET_ARCH_PPC64
-    case EXTSW: {
-      const int shift = kBitsPerPointer - 32;
-      int ra = instr->RAValue();
-      int rs = instr->RSValue();
-      intptr_t rs_val = get_register(rs);
-      intptr_t ra_val = (rs_val << shift) >> shift;
-      set_register(ra, ra_val);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(ra_val);
-      }
-      break;
-    }
-#endif
-    case EXTSH: {
-      const int shift = kBitsPerPointer - 16;
-      int ra = instr->RAValue();
-      int rs = instr->RSValue();
-      intptr_t rs_val = get_register(rs);
-      intptr_t ra_val = (rs_val << shift) >> shift;
-      set_register(ra, ra_val);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(ra_val);
-      }
-      break;
-    }
-    case EXTSB: {
-      const int shift = kBitsPerPointer - 8;
-      int ra = instr->RAValue();
-      int rs = instr->RSValue();
-      intptr_t rs_val = get_register(rs);
-      intptr_t ra_val = (rs_val << shift) >> shift;
-      set_register(ra, ra_val);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(ra_val);
-      }
-      break;
-    }
-    case LFSUX:
-    case LFSX: {
-      int frt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      intptr_t rb_val = get_register(rb);
-      int32_t val = ReadW(ra_val + rb_val, instr);
-      float* fptr = reinterpret_cast<float*>(&val);
-#if V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64
-      // Conversion using double changes sNan to qNan on ia32/x64
-      if ((val & 0x7F800000) == 0x7F800000) {
-        int64_t dval = static_cast<int64_t>(val);
-        dval = ((dval & 0xC0000000) << 32) | ((dval & 0x40000000) << 31) |
-               ((dval & 0x40000000) << 30) | ((dval & 0x7FFFFFFF) << 29) | 0x0;
-        set_d_register(frt, dval);
-      } else {
-        set_d_register_from_double(frt, static_cast<double>(*fptr));
-      }
-#else
-      set_d_register_from_double(frt, static_cast<double>(*fptr));
-#endif
-      if (opcode == LFSUX) {
-        DCHECK_NE(ra, 0);
-        set_register(ra, ra_val + rb_val);
-      }
-      break;
-    }
-    case LFDUX:
-    case LFDX: {
-      int frt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      intptr_t rb_val = get_register(rb);
-      int64_t* dptr = reinterpret_cast<int64_t*>(ReadDW(ra_val + rb_val));
-      set_d_register(frt, *dptr);
-      if (opcode == LFDUX) {
-        DCHECK_NE(ra, 0);
-        set_register(ra, ra_val + rb_val);
-      }
-      break;
-    }
-    case STFSUX: {
-      case STFSX:
-        int frs = instr->RSValue();
-        int ra = instr->RAValue();
-        int rb = instr->RBValue();
-        intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-        intptr_t rb_val = get_register(rb);
-        float frs_val = static_cast<float>(get_double_from_d_register(frs));
-        int32_t* p = reinterpret_cast<int32_t*>(&frs_val);
-#if V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64
-        // Conversion using double changes sNan to qNan on ia32/x64
-        int32_t sval = 0;
-        int64_t dval = get_d_register(frs);
-        if ((dval & 0x7FF0000000000000) == 0x7FF0000000000000) {
-          sval = ((dval & 0xC000000000000000) >> 32) |
-                 ((dval & 0x07FFFFFFE0000000) >> 29);
-          p = &sval;
-        } else {
-          p = reinterpret_cast<int32_t*>(&frs_val);
-        }
-#else
-        p = reinterpret_cast<int32_t*>(&frs_val);
-#endif
-        WriteW(ra_val + rb_val, *p, instr);
-        if (opcode == STFSUX) {
-          DCHECK_NE(ra, 0);
-          set_register(ra, ra_val + rb_val);
-        }
-        break;
-    }
-    case STFDUX: {
-      case STFDX:
-        int frs = instr->RSValue();
-        int ra = instr->RAValue();
-        int rb = instr->RBValue();
-        intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-        intptr_t rb_val = get_register(rb);
-        int64_t frs_val = get_d_register(frs);
-        WriteDW(ra_val + rb_val, frs_val);
-        if (opcode == STFDUX) {
-          DCHECK_NE(ra, 0);
-          set_register(ra, ra_val + rb_val);
-        }
-        break;
-    }
-    case POPCNTW: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      uintptr_t rs_val = get_register(rs);
-      uintptr_t count = 0;
-      int n = 0;
-      uintptr_t bit = 0x80000000;
-      for (; n < 32; n++) {
-        if (bit & rs_val) count++;
-        bit >>= 1;
-      }
-      set_register(ra, count);
-      break;
-    }
-#if V8_TARGET_ARCH_PPC64
-    case POPCNTD: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      uintptr_t rs_val = get_register(rs);
-      uintptr_t count = 0;
-      int n = 0;
-      uintptr_t bit = 0x8000000000000000UL;
-      for (; n < 64; n++) {
-        if (bit & rs_val) count++;
-        bit >>= 1;
-      }
-      set_register(ra, count);
-      break;
-    }
-#endif
-    case SYNC: {
-      // todo - simulate sync
-      break;
-    }
-    case ICBI: {
-      // todo - simulate icbi
-      break;
-    }
-
-    case LWZU:
-    case LWZ: {
-      int ra = instr->RAValue();
-      int rt = instr->RTValue();
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      int offset = SIGN_EXT_IMM16(instr->Bits(15, 0));
-      set_register(rt, ReadWU(ra_val + offset, instr));
-      if (opcode == LWZU) {
-        DCHECK_NE(ra, 0);
-        set_register(ra, ra_val + offset);
-      }
-      break;
-    }
-
-    case LBZU:
-    case LBZ: {
-      int ra = instr->RAValue();
-      int rt = instr->RTValue();
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      int offset = SIGN_EXT_IMM16(instr->Bits(15, 0));
-      set_register(rt, ReadB(ra_val + offset) & 0xFF);
-      if (opcode == LBZU) {
-        DCHECK_NE(ra, 0);
-        set_register(ra, ra_val + offset);
-      }
-      break;
-    }
-
-    case STWU:
-    case STW: {
-      int ra = instr->RAValue();
-      int rs = instr->RSValue();
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      int32_t rs_val = get_register(rs);
-      int offset = SIGN_EXT_IMM16(instr->Bits(15, 0));
-      WriteW(ra_val + offset, rs_val, instr);
-      if (opcode == STWU) {
-        DCHECK_NE(ra, 0);
-        set_register(ra, ra_val + offset);
-      }
-      break;
-    }
-    case SRADIX: {
-      int ra = instr->RAValue();
-      int rs = instr->RSValue();
-      int sh = (instr->Bits(15, 11) | (instr->Bit(1) << 5));
-      intptr_t rs_val = get_register(rs);
-      intptr_t result = rs_val >> sh;
-      set_register(ra, result);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(result);
-      }
-      break;
-    }
-    case STBCX: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      int8_t rs_val = get_register(rs);
-      intptr_t rb_val = get_register(rb);
-      SetCR0(WriteExB(ra_val + rb_val, rs_val));
-      break;
-    }
-    case STHCX: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      int16_t rs_val = get_register(rs);
-      intptr_t rb_val = get_register(rb);
-      SetCR0(WriteExH(ra_val + rb_val, rs_val, instr));
-      break;
-    }
-    case STWCX: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      int32_t rs_val = get_register(rs);
-      intptr_t rb_val = get_register(rb);
-      SetCR0(WriteExW(ra_val + rb_val, rs_val, instr));
-      break;
-    }
-    case TW: {
-      // used for call redirection in simulation mode
-      SoftwareInterrupt(instr);
-      break;
-    }
-    case CMP: {
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      int cr = instr->Bits(25, 23);
-      uint32_t bf = 0;
-#if V8_TARGET_ARCH_PPC64
-      int L = instr->Bit(21);
-      if (L) {
-#endif
-        intptr_t ra_val = get_register(ra);
-        intptr_t rb_val = get_register(rb);
-        if (ra_val < rb_val) {
-          bf |= 0x80000000;
-        }
-        if (ra_val > rb_val) {
-          bf |= 0x40000000;
-        }
-        if (ra_val == rb_val) {
-          bf |= 0x20000000;
-        }
-#if V8_TARGET_ARCH_PPC64
-      } else {
-        int32_t ra_val = get_register(ra);
-        int32_t rb_val = get_register(rb);
-        if (ra_val < rb_val) {
-          bf |= 0x80000000;
-        }
-        if (ra_val > rb_val) {
-          bf |= 0x40000000;
-        }
-        if (ra_val == rb_val) {
-          bf |= 0x20000000;
-        }
-      }
-#endif
-      uint32_t condition_mask = 0xF0000000U >> (cr * 4);
-      uint32_t condition = bf >> (cr * 4);
-      condition_reg_ = (condition_reg_ & ~condition_mask) | condition;
-      break;
-    }
-    case SUBFCX: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      // int oe = instr->Bit(10);
-      uintptr_t ra_val = get_register(ra);
-      uintptr_t rb_val = get_register(rb);
-      uintptr_t alu_out = ~ra_val + rb_val + 1;
-      // Set carry
-      if (ra_val <= rb_val) {
-        special_reg_xer_ = (special_reg_xer_ & ~0xF0000000) | 0x20000000;
-      } else {
-        special_reg_xer_ &= ~0xF0000000;
-      }
-      set_register(rt, alu_out);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(alu_out);
-      }
-      // todo - handle OE bit
-      break;
-    }
-    case SUBFEX: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      // int oe = instr->Bit(10);
-      uintptr_t ra_val = get_register(ra);
-      uintptr_t rb_val = get_register(rb);
-      uintptr_t alu_out = ~ra_val + rb_val;
-      if (special_reg_xer_ & 0x20000000) {
-        alu_out += 1;
-      }
-      set_register(rt, alu_out);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(static_cast<intptr_t>(alu_out));
-      }
-      // todo - handle OE bit
-      break;
-    }
-    case ADDCX: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      // int oe = instr->Bit(10);
-      uintptr_t ra_val = get_register(ra);
-      uintptr_t rb_val = get_register(rb);
-      uintptr_t alu_out = ra_val + rb_val;
-      // Set carry
-      if (~ra_val < rb_val) {
-        special_reg_xer_ = (special_reg_xer_ & ~0xF0000000) | 0x20000000;
-      } else {
-        special_reg_xer_ &= ~0xF0000000;
-      }
-      set_register(rt, alu_out);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(static_cast<intptr_t>(alu_out));
-      }
-      // todo - handle OE bit
-      break;
-    }
-    case ADDEX: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      // int oe = instr->Bit(10);
-      uintptr_t ra_val = get_register(ra);
-      uintptr_t rb_val = get_register(rb);
-      uintptr_t alu_out = ra_val + rb_val;
-      if (special_reg_xer_ & 0x20000000) {
-        alu_out += 1;
-      }
-      set_register(rt, alu_out);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(static_cast<intptr_t>(alu_out));
-      }
-      // todo - handle OE bit
-      break;
-    }
-    case MULHWX: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      int32_t ra_val = (get_register(ra) & 0xFFFFFFFF);
-      int32_t rb_val = (get_register(rb) & 0xFFFFFFFF);
-      int64_t alu_out = (int64_t)ra_val * (int64_t)rb_val;
-      alu_out >>= 32;
-      set_register(rt, alu_out);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(static_cast<intptr_t>(alu_out));
-      }
-      break;
-    }
-    case MULHWUX: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      uint32_t ra_val = (get_register(ra) & 0xFFFFFFFF);
-      uint32_t rb_val = (get_register(rb) & 0xFFFFFFFF);
-      uint64_t alu_out = (uint64_t)ra_val * (uint64_t)rb_val;
-      alu_out >>= 32;
-      set_register(rt, alu_out);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(static_cast<intptr_t>(alu_out));
-      }
-      break;
-    }
-    case NEGX: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      intptr_t ra_val = get_register(ra);
-      intptr_t alu_out = 1 + ~ra_val;
-#if V8_TARGET_ARCH_PPC64
-      intptr_t one = 1;  // work-around gcc
-      intptr_t kOverflowVal = (one << 63);
-#else
-      intptr_t kOverflowVal = kMinInt;
-#endif
-      set_register(rt, alu_out);
-      if (instr->Bit(10)) {  // OE bit set
-        if (ra_val == kOverflowVal) {
-          special_reg_xer_ |= 0xC0000000;  // set SO,OV
-        } else {
-          special_reg_xer_ &= ~0x40000000;  // clear OV
-        }
-      }
-      if (instr->Bit(0)) {  // RC bit set
-        bool setSO = (special_reg_xer_ & 0x80000000);
-        SetCR0(alu_out, setSO);
-      }
-      break;
-    }
-    case SLWX: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      uint32_t rs_val = get_register(rs);
-      uintptr_t rb_val = get_register(rb) & 0x3F;
-      uint32_t result = (rb_val > 31) ? 0 : rs_val << rb_val;
-      set_register(ra, result);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(result);
-      }
-      break;
-    }
-#if V8_TARGET_ARCH_PPC64
-    case SLDX: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      uintptr_t rs_val = get_register(rs);
-      uintptr_t rb_val = get_register(rb) & 0x7F;
-      uintptr_t result = (rb_val > 63) ? 0 : rs_val << rb_val;
-      set_register(ra, result);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(result);
-      }
-      break;
-    }
-    case MFVSRD: {
-      DCHECK(!instr->Bit(0));
-      int frt = instr->RTValue();
-      int ra = instr->RAValue();
-      int64_t frt_val = get_d_register(frt);
-      set_register(ra, frt_val);
-      break;
-    }
-    case MFVSRWZ: {
-      DCHECK(!instr->Bit(0));
-      int frt = instr->RTValue();
-      int ra = instr->RAValue();
-      int64_t frt_val = get_d_register(frt);
-      set_register(ra, static_cast<uint32_t>(frt_val));
-      break;
-    }
-    case MTVSRD: {
-      DCHECK(!instr->Bit(0));
-      int frt = instr->RTValue();
-      int ra = instr->RAValue();
-      int64_t ra_val = get_register(ra);
-      set_d_register(frt, ra_val);
-      break;
-    }
-    case MTVSRWA: {
-      DCHECK(!instr->Bit(0));
-      int frt = instr->RTValue();
-      int ra = instr->RAValue();
-      int64_t ra_val = static_cast<int32_t>(get_register(ra));
-      set_d_register(frt, ra_val);
-      break;
-    }
-    case MTVSRWZ: {
-      DCHECK(!instr->Bit(0));
-      int frt = instr->RTValue();
-      int ra = instr->RAValue();
-      uint64_t ra_val = static_cast<uint32_t>(get_register(ra));
-      set_d_register(frt, ra_val);
-      break;
-    }
-#endif
-    case CNTLZWX: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      uintptr_t rs_val = get_register(rs);
-      uintptr_t count = 0;
-      int n = 0;
-      uintptr_t bit = 0x80000000;
-      for (; n < 32; n++) {
-        if (bit & rs_val) break;
-        count++;
-        bit >>= 1;
-      }
-      set_register(ra, count);
-      if (instr->Bit(0)) {  // RC Bit set
-        int bf = 0;
-        if (count > 0) {
-          bf |= 0x40000000;
-        }
-        if (count == 0) {
-          bf |= 0x20000000;
-        }
-        condition_reg_ = (condition_reg_ & ~0xF0000000) | bf;
-      }
-      break;
-    }
-#if V8_TARGET_ARCH_PPC64
-    case CNTLZDX: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      uintptr_t rs_val = get_register(rs);
-      uintptr_t count = 0;
-      int n = 0;
-      uintptr_t bit = 0x8000000000000000UL;
-      for (; n < 64; n++) {
-        if (bit & rs_val) break;
-        count++;
-        bit >>= 1;
-      }
-      set_register(ra, count);
-      if (instr->Bit(0)) {  // RC Bit set
-        int bf = 0;
-        if (count > 0) {
-          bf |= 0x40000000;
-        }
-        if (count == 0) {
-          bf |= 0x20000000;
-        }
-        condition_reg_ = (condition_reg_ & ~0xF0000000) | bf;
-      }
-      break;
-    }
-#endif
-    case ANDX: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      intptr_t rs_val = get_register(rs);
-      intptr_t rb_val = get_register(rb);
-      intptr_t alu_out = rs_val & rb_val;
-      set_register(ra, alu_out);
-      if (instr->Bit(0)) {  // RC Bit set
-        SetCR0(alu_out);
-      }
-      break;
-    }
-    case ANDCX: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      intptr_t rs_val = get_register(rs);
-      intptr_t rb_val = get_register(rb);
-      intptr_t alu_out = rs_val & ~rb_val;
-      set_register(ra, alu_out);
-      if (instr->Bit(0)) {  // RC Bit set
-        SetCR0(alu_out);
-      }
-      break;
-    }
-    case CMPL: {
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      int cr = instr->Bits(25, 23);
-      uint32_t bf = 0;
-#if V8_TARGET_ARCH_PPC64
-      int L = instr->Bit(21);
-      if (L) {
-#endif
-        uintptr_t ra_val = get_register(ra);
-        uintptr_t rb_val = get_register(rb);
-        if (ra_val < rb_val) {
-          bf |= 0x80000000;
-        }
-        if (ra_val > rb_val) {
-          bf |= 0x40000000;
-        }
-        if (ra_val == rb_val) {
-          bf |= 0x20000000;
-        }
-#if V8_TARGET_ARCH_PPC64
-      } else {
-        uint32_t ra_val = get_register(ra);
-        uint32_t rb_val = get_register(rb);
-        if (ra_val < rb_val) {
-          bf |= 0x80000000;
-        }
-        if (ra_val > rb_val) {
-          bf |= 0x40000000;
-        }
-        if (ra_val == rb_val) {
-          bf |= 0x20000000;
-        }
-      }
-#endif
-      uint32_t condition_mask = 0xF0000000U >> (cr * 4);
-      uint32_t condition = bf >> (cr * 4);
-      condition_reg_ = (condition_reg_ & ~condition_mask) | condition;
-      break;
-    }
-    case SUBFX: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      // int oe = instr->Bit(10);
-      intptr_t ra_val = get_register(ra);
-      intptr_t rb_val = get_register(rb);
-      intptr_t alu_out = rb_val - ra_val;
-      // todo - figure out underflow
-      set_register(rt, alu_out);
-      if (instr->Bit(0)) {  // RC Bit set
-        SetCR0(alu_out);
-      }
-      // todo - handle OE bit
-      break;
-    }
-    case ADDZEX: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      intptr_t ra_val = get_register(ra);
-      if (special_reg_xer_ & 0x20000000) {
-        ra_val += 1;
-      }
-      set_register(rt, ra_val);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(ra_val);
-      }
-      // todo - handle OE bit
-      break;
-    }
-    case NORX: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      intptr_t rs_val = get_register(rs);
-      intptr_t rb_val = get_register(rb);
-      intptr_t alu_out = ~(rs_val | rb_val);
-      set_register(ra, alu_out);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(alu_out);
-      }
-      break;
-    }
-    case MULLW: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      int32_t ra_val = (get_register(ra) & 0xFFFFFFFF);
-      int32_t rb_val = (get_register(rb) & 0xFFFFFFFF);
-      int32_t alu_out = ra_val * rb_val;
-      set_register(rt, alu_out);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(alu_out);
-      }
-      // todo - handle OE bit
-      break;
-    }
-#if V8_TARGET_ARCH_PPC64
-    case MULLD: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      int64_t ra_val = get_register(ra);
-      int64_t rb_val = get_register(rb);
-      int64_t alu_out = ra_val * rb_val;
-      set_register(rt, alu_out);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(alu_out);
-      }
-      // todo - handle OE bit
-      break;
-    }
-#endif
-    case DIVW: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      int32_t ra_val = get_register(ra);
-      int32_t rb_val = get_register(rb);
-      bool overflow = (ra_val == kMinInt && rb_val == -1);
-      // result is undefined if divisor is zero or if operation
-      // is 0x80000000 / -1.
-      int32_t alu_out = (rb_val == 0 || overflow) ? -1 : ra_val / rb_val;
-      set_register(rt, alu_out);
-      if (instr->Bit(10)) {  // OE bit set
-        if (overflow) {
-          special_reg_xer_ |= 0xC0000000;  // set SO,OV
-        } else {
-          special_reg_xer_ &= ~0x40000000;  // clear OV
-        }
-      }
-      if (instr->Bit(0)) {  // RC bit set
-        bool setSO = (special_reg_xer_ & 0x80000000);
-        SetCR0(alu_out, setSO);
-      }
-      break;
-    }
-    case DIVWU: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      uint32_t ra_val = get_register(ra);
-      uint32_t rb_val = get_register(rb);
-      bool overflow = (rb_val == 0);
-      // result is undefined if divisor is zero
-      uint32_t alu_out = (overflow) ? -1 : ra_val / rb_val;
-      set_register(rt, alu_out);
-      if (instr->Bit(10)) {  // OE bit set
-        if (overflow) {
-          special_reg_xer_ |= 0xC0000000;  // set SO,OV
-        } else {
-          special_reg_xer_ &= ~0x40000000;  // clear OV
-        }
-      }
-      if (instr->Bit(0)) {  // RC bit set
-        bool setSO = (special_reg_xer_ & 0x80000000);
-        SetCR0(alu_out, setSO);
-      }
-      break;
-    }
-#if V8_TARGET_ARCH_PPC64
-    case DIVD: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      int64_t ra_val = get_register(ra);
-      int64_t rb_val = get_register(rb);
-      int64_t one = 1;  // work-around gcc
-      int64_t kMinLongLong = (one << 63);
-      // result is undefined if divisor is zero or if operation
-      // is 0x80000000_00000000 / -1.
-      int64_t alu_out =
-          (rb_val == 0 || (ra_val == kMinLongLong && rb_val == -1))
-              ? -1
-              : ra_val / rb_val;
-      set_register(rt, alu_out);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(alu_out);
-      }
-      // todo - handle OE bit
-      break;
-    }
-    case DIVDU: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      uint64_t ra_val = get_register(ra);
-      uint64_t rb_val = get_register(rb);
-      // result is undefined if divisor is zero
-      uint64_t alu_out = (rb_val == 0) ? -1 : ra_val / rb_val;
-      set_register(rt, alu_out);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(alu_out);
-      }
-      // todo - handle OE bit
-      break;
-    }
-#endif
-    case ADDX: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      // int oe = instr->Bit(10);
-      intptr_t ra_val = get_register(ra);
-      intptr_t rb_val = get_register(rb);
-      intptr_t alu_out = ra_val + rb_val;
-      set_register(rt, alu_out);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(alu_out);
-      }
-      // todo - handle OE bit
-      break;
-    }
-    case XORX: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      intptr_t rs_val = get_register(rs);
-      intptr_t rb_val = get_register(rb);
-      intptr_t alu_out = rs_val ^ rb_val;
-      set_register(ra, alu_out);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(alu_out);
-      }
-      break;
-    }
-    case ORX: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      intptr_t rs_val = get_register(rs);
-      intptr_t rb_val = get_register(rb);
-      intptr_t alu_out = rs_val | rb_val;
-      set_register(ra, alu_out);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(alu_out);
-      }
-      break;
-    }
-    case ORC: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      intptr_t rs_val = get_register(rs);
-      intptr_t rb_val = get_register(rb);
-      intptr_t alu_out = rs_val | ~rb_val;
-      set_register(ra, alu_out);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(alu_out);
-      }
-      break;
-    }
-    case MFSPR: {
-      int rt = instr->RTValue();
-      int spr = instr->Bits(20, 11);
-      if (spr != 256) {
-        UNIMPLEMENTED();  // Only LRLR supported
-      }
-      set_register(rt, special_reg_lr_);
-      break;
-    }
-    case MTSPR: {
-      int rt = instr->RTValue();
-      intptr_t rt_val = get_register(rt);
-      int spr = instr->Bits(20, 11);
-      if (spr == 256) {
-        special_reg_lr_ = rt_val;
-      } else if (spr == 288) {
-        special_reg_ctr_ = rt_val;
-      } else if (spr == 32) {
-        special_reg_xer_ = rt_val;
-      } else {
-        UNIMPLEMENTED();  // Only LR supported
-      }
-      break;
-    }
-    case MFCR: {
-      int rt = instr->RTValue();
-      set_register(rt, condition_reg_);
-      break;
-    }
-    case STWUX:
-    case STWX: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      int32_t rs_val = get_register(rs);
-      intptr_t rb_val = get_register(rb);
-      WriteW(ra_val + rb_val, rs_val, instr);
-      if (opcode == STWUX) {
-        DCHECK_NE(ra, 0);
-        set_register(ra, ra_val + rb_val);
-      }
-      break;
-    }
-    case STBUX:
-    case STBX: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      int8_t rs_val = get_register(rs);
-      intptr_t rb_val = get_register(rb);
-      WriteB(ra_val + rb_val, rs_val);
-      if (opcode == STBUX) {
-        DCHECK_NE(ra, 0);
-        set_register(ra, ra_val + rb_val);
-      }
-      break;
-    }
-    case STHUX:
-    case STHX: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      int16_t rs_val = get_register(rs);
-      intptr_t rb_val = get_register(rb);
-      WriteH(ra_val + rb_val, rs_val, instr);
-      if (opcode == STHUX) {
-        DCHECK_NE(ra, 0);
-        set_register(ra, ra_val + rb_val);
-      }
-      break;
-    }
-    case LWZX:
-    case LWZUX: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      intptr_t rb_val = get_register(rb);
-      set_register(rt, ReadWU(ra_val + rb_val, instr));
-      if (opcode == LWZUX) {
-        DCHECK(ra != 0 && ra != rt);
-        set_register(ra, ra_val + rb_val);
-      }
-      break;
-    }
-#if V8_TARGET_ARCH_PPC64
-    case LWAX: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      intptr_t rb_val = get_register(rb);
-      set_register(rt, ReadW(ra_val + rb_val, instr));
-      break;
-    }
-    case LDX:
-    case LDUX: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      intptr_t rb_val = get_register(rb);
-      intptr_t* result = ReadDW(ra_val + rb_val);
-      set_register(rt, *result);
-      if (opcode == LDUX) {
-        DCHECK(ra != 0 && ra != rt);
-        set_register(ra, ra_val + rb_val);
-      }
-      break;
-    }
-    case STDX:
-    case STDUX: {
-      int rs = instr->RSValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      intptr_t rs_val = get_register(rs);
-      intptr_t rb_val = get_register(rb);
-      WriteDW(ra_val + rb_val, rs_val);
-      if (opcode == STDUX) {
-        DCHECK_NE(ra, 0);
-        set_register(ra, ra_val + rb_val);
-      }
-      break;
-    }
-#endif
-    case LBZX:
-    case LBZUX: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      intptr_t rb_val = get_register(rb);
-      set_register(rt, ReadBU(ra_val + rb_val) & 0xFF);
-      if (opcode == LBZUX) {
-        DCHECK(ra != 0 && ra != rt);
-        set_register(ra, ra_val + rb_val);
-      }
-      break;
-    }
-    case LHZX:
-    case LHZUX: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      intptr_t rb_val = get_register(rb);
-      set_register(rt, ReadHU(ra_val + rb_val, instr) & 0xFFFF);
-      if (opcode == LHZUX) {
-        DCHECK(ra != 0 && ra != rt);
-        set_register(ra, ra_val + rb_val);
-      }
-      break;
-    }
-    case LHAX: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      intptr_t rb_val = get_register(rb);
-      set_register(rt, ReadH(ra_val + rb_val, instr));
-      break;
-    }
-    case LBARX: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      intptr_t rb_val = get_register(rb);
-      set_register(rt, ReadExBU(ra_val + rb_val) & 0xFF);
-      break;
-    }
-    case LHARX: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      intptr_t rb_val = get_register(rb);
-      set_register(rt, ReadExHU(ra_val + rb_val, instr));
-      break;
-    }
-    case LWARX: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      intptr_t rb_val = get_register(rb);
-      set_register(rt, ReadExWU(ra_val + rb_val, instr));
-      break;
-    }
-    case DCBF: {
-      // todo - simulate dcbf
-      break;
-    }
-    case ISEL: {
-      int rt = instr->RTValue();
-      int ra = instr->RAValue();
-      int rb = instr->RBValue();
-      int condition_bit = instr->RCValue();
-      int condition_mask = 0x80000000 >> condition_bit;
-      intptr_t ra_val = (ra == 0) ? 0 : get_register(ra);
-      intptr_t rb_val = get_register(rb);
-      intptr_t value = (condition_reg_ & condition_mask) ? ra_val : rb_val;
-      set_register(rt, value);
-      break;
-    }
-
-    case STBU:
-    case STB: {
-      int ra = instr->RAValue();
-      int rs = instr->RSValue();
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      int8_t rs_val = get_register(rs);
-      int offset = SIGN_EXT_IMM16(instr->Bits(15, 0));
-      WriteB(ra_val + offset, rs_val);
-      if (opcode == STBU) {
-        DCHECK_NE(ra, 0);
-        set_register(ra, ra_val + offset);
-      }
-      break;
-    }
-
-    case LHZU:
-    case LHZ: {
-      int ra = instr->RAValue();
-      int rt = instr->RTValue();
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      int offset = SIGN_EXT_IMM16(instr->Bits(15, 0));
-      uintptr_t result = ReadHU(ra_val + offset, instr) & 0xFFFF;
-      set_register(rt, result);
-      if (opcode == LHZU) {
-        set_register(ra, ra_val + offset);
-      }
-      break;
-    }
-
-    case LHA:
-    case LHAU: {
-      int ra = instr->RAValue();
-      int rt = instr->RTValue();
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      int offset = SIGN_EXT_IMM16(instr->Bits(15, 0));
-      intptr_t result = ReadH(ra_val + offset, instr);
-      set_register(rt, result);
-      if (opcode == LHAU) {
-        set_register(ra, ra_val + offset);
-      }
-      break;
-    }
-
-    case STHU:
-    case STH: {
-      int ra = instr->RAValue();
-      int rs = instr->RSValue();
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      int16_t rs_val = get_register(rs);
-      int offset = SIGN_EXT_IMM16(instr->Bits(15, 0));
-      WriteH(ra_val + offset, rs_val, instr);
-      if (opcode == STHU) {
-        DCHECK_NE(ra, 0);
-        set_register(ra, ra_val + offset);
-      }
-      break;
-    }
-
-    case LMW:
-    case STMW: {
-      UNIMPLEMENTED();
-      break;
-    }
-
-    case LFSU:
-    case LFS: {
-      int frt = instr->RTValue();
-      int ra = instr->RAValue();
-      int32_t offset = SIGN_EXT_IMM16(instr->Bits(15, 0));
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      int32_t val = ReadW(ra_val + offset, instr);
-      float* fptr = reinterpret_cast<float*>(&val);
-#if V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64
-      // Conversion using double changes sNan to qNan on ia32/x64
-      if ((val & 0x7F800000) == 0x7F800000) {
-        int64_t dval = static_cast<int64_t>(val);
-        dval = ((dval & 0xC0000000) << 32) | ((dval & 0x40000000) << 31) |
-               ((dval & 0x40000000) << 30) | ((dval & 0x7FFFFFFF) << 29) | 0x0;
-        set_d_register(frt, dval);
-      } else {
-        set_d_register_from_double(frt, static_cast<double>(*fptr));
-      }
-#else
-      set_d_register_from_double(frt, static_cast<double>(*fptr));
-#endif
-      if (opcode == LFSU) {
-        DCHECK_NE(ra, 0);
-        set_register(ra, ra_val + offset);
-      }
-      break;
-    }
-
-    case LFDU:
-    case LFD: {
-      int frt = instr->RTValue();
-      int ra = instr->RAValue();
-      int32_t offset = SIGN_EXT_IMM16(instr->Bits(15, 0));
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      int64_t* dptr = reinterpret_cast<int64_t*>(ReadDW(ra_val + offset));
-      set_d_register(frt, *dptr);
-      if (opcode == LFDU) {
-        DCHECK_NE(ra, 0);
-        set_register(ra, ra_val + offset);
-      }
-      break;
-    }
-
-    case STFSU: {
-      case STFS:
-        int frs = instr->RSValue();
-        int ra = instr->RAValue();
-        int32_t offset = SIGN_EXT_IMM16(instr->Bits(15, 0));
-        intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-        float frs_val = static_cast<float>(get_double_from_d_register(frs));
-        int32_t* p;
-#if V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64
-        // Conversion using double changes sNan to qNan on ia32/x64
-        int32_t sval = 0;
-        int64_t dval = get_d_register(frs);
-        if ((dval & 0x7FF0000000000000) == 0x7FF0000000000000) {
-          sval = ((dval & 0xC000000000000000) >> 32) |
-                 ((dval & 0x07FFFFFFE0000000) >> 29);
-          p = &sval;
-        } else {
-          p = reinterpret_cast<int32_t*>(&frs_val);
-        }
-#else
-        p = reinterpret_cast<int32_t*>(&frs_val);
-#endif
-        WriteW(ra_val + offset, *p, instr);
-        if (opcode == STFSU) {
-          DCHECK_NE(ra, 0);
-          set_register(ra, ra_val + offset);
-        }
-        break;
-    }
-
-    case STFDU:
-    case STFD: {
-      int frs = instr->RSValue();
-      int ra = instr->RAValue();
-      int32_t offset = SIGN_EXT_IMM16(instr->Bits(15, 0));
-      intptr_t ra_val = ra == 0 ? 0 : get_register(ra);
-      int64_t frs_val = get_d_register(frs);
-      WriteDW(ra_val + offset, frs_val);
-      if (opcode == STFDU) {
-        DCHECK_NE(ra, 0);
-        set_register(ra, ra_val + offset);
-      }
-      break;
-    }
-
-    case FCFIDS: {
-      // fcfids
-      int frt = instr->RTValue();
-      int frb = instr->RBValue();
-      int64_t frb_val = get_d_register(frb);
-      double frt_val = static_cast<float>(frb_val);
-      set_d_register_from_double(frt, frt_val);
-      return;
-    }
-    case FCFIDUS: {
-      // fcfidus
-      int frt = instr->RTValue();
-      int frb = instr->RBValue();
-      uint64_t frb_val = get_d_register(frb);
-      double frt_val = static_cast<float>(frb_val);
-      set_d_register_from_double(frt, frt_val);
-      return;
-    }
-
-    case FDIV: {
-      int frt = instr->RTValue();
-      int fra = instr->RAValue();
-      int frb = instr->RBValue();
-      double fra_val = get_double_from_d_register(fra);
-      double frb_val = get_double_from_d_register(frb);
-      double frt_val = fra_val / frb_val;
-      set_d_register_from_double(frt, frt_val);
-      return;
-    }
-    case FSUB: {
-      int frt = instr->RTValue();
-      int fra = instr->RAValue();
-      int frb = instr->RBValue();
-      double fra_val = get_double_from_d_register(fra);
-      double frb_val = get_double_from_d_register(frb);
-      double frt_val = fra_val - frb_val;
-      set_d_register_from_double(frt, frt_val);
-      return;
-    }
-    case FADD: {
-      int frt = instr->RTValue();
-      int fra = instr->RAValue();
-      int frb = instr->RBValue();
-      double fra_val = get_double_from_d_register(fra);
-      double frb_val = get_double_from_d_register(frb);
-      double frt_val = fra_val + frb_val;
-      set_d_register_from_double(frt, frt_val);
-      return;
-    }
-    case FSQRT: {
-      lazily_initialize_fast_sqrt(isolate_);
-      int frt = instr->RTValue();
-      int frb = instr->RBValue();
-      double frb_val = get_double_from_d_register(frb);
-      double frt_val = fast_sqrt(frb_val, isolate_);
-      set_d_register_from_double(frt, frt_val);
-      return;
-    }
-    case FSEL: {
-      int frt = instr->RTValue();
-      int fra = instr->RAValue();
-      int frb = instr->RBValue();
-      int frc = instr->RCValue();
-      double fra_val = get_double_from_d_register(fra);
-      double frb_val = get_double_from_d_register(frb);
-      double frc_val = get_double_from_d_register(frc);
-      double frt_val = ((fra_val >= 0.0) ? frc_val : frb_val);
-      set_d_register_from_double(frt, frt_val);
-      return;
-    }
-    case FMUL: {
-      int frt = instr->RTValue();
-      int fra = instr->RAValue();
-      int frc = instr->RCValue();
-      double fra_val = get_double_from_d_register(fra);
-      double frc_val = get_double_from_d_register(frc);
-      double frt_val = fra_val * frc_val;
-      set_d_register_from_double(frt, frt_val);
-      return;
-    }
-    case FMSUB: {
-      int frt = instr->RTValue();
-      int fra = instr->RAValue();
-      int frb = instr->RBValue();
-      int frc = instr->RCValue();
-      double fra_val = get_double_from_d_register(fra);
-      double frb_val = get_double_from_d_register(frb);
-      double frc_val = get_double_from_d_register(frc);
-      double frt_val = (fra_val * frc_val) - frb_val;
-      set_d_register_from_double(frt, frt_val);
-      return;
-    }
-    case FMADD: {
-      int frt = instr->RTValue();
-      int fra = instr->RAValue();
-      int frb = instr->RBValue();
-      int frc = instr->RCValue();
-      double fra_val = get_double_from_d_register(fra);
-      double frb_val = get_double_from_d_register(frb);
-      double frc_val = get_double_from_d_register(frc);
-      double frt_val = (fra_val * frc_val) + frb_val;
-      set_d_register_from_double(frt, frt_val);
-      return;
-    }
-    case FCMPU: {
-      int fra = instr->RAValue();
-      int frb = instr->RBValue();
-      double fra_val = get_double_from_d_register(fra);
-      double frb_val = get_double_from_d_register(frb);
-      int cr = instr->Bits(25, 23);
-      int bf = 0;
-      if (fra_val < frb_val) {
-        bf |= 0x80000000;
-      }
-      if (fra_val > frb_val) {
-        bf |= 0x40000000;
-      }
-      if (fra_val == frb_val) {
-        bf |= 0x20000000;
-      }
-      if (std::isunordered(fra_val, frb_val)) {
-        bf |= 0x10000000;
-      }
-      int condition_mask = 0xF0000000 >> (cr * 4);
-      int condition = bf >> (cr * 4);
-      condition_reg_ = (condition_reg_ & ~condition_mask) | condition;
-      return;
-    }
-    case FRIN: {
-      int frt = instr->RTValue();
-      int frb = instr->RBValue();
-      double frb_val = get_double_from_d_register(frb);
-      double frt_val = std::round(frb_val);
-      set_d_register_from_double(frt, frt_val);
-      if (instr->Bit(0)) {  // RC bit set
-                            //  UNIMPLEMENTED();
-      }
-      return;
-    }
-    case FRIZ: {
-      int frt = instr->RTValue();
-      int frb = instr->RBValue();
-      double frb_val = get_double_from_d_register(frb);
-      double frt_val = std::trunc(frb_val);
-      set_d_register_from_double(frt, frt_val);
-      if (instr->Bit(0)) {  // RC bit set
-                            //  UNIMPLEMENTED();
-      }
-      return;
-    }
-    case FRIP: {
-      int frt = instr->RTValue();
-      int frb = instr->RBValue();
-      double frb_val = get_double_from_d_register(frb);
-      double frt_val = std::ceil(frb_val);
-      set_d_register_from_double(frt, frt_val);
-      if (instr->Bit(0)) {  // RC bit set
-                            //  UNIMPLEMENTED();
-      }
-      return;
-    }
-    case FRIM: {
-      int frt = instr->RTValue();
-      int frb = instr->RBValue();
-      double frb_val = get_double_from_d_register(frb);
-      double frt_val = std::floor(frb_val);
-      set_d_register_from_double(frt, frt_val);
-      if (instr->Bit(0)) {  // RC bit set
-                            //  UNIMPLEMENTED();
-      }
-      return;
-    }
-    case FRSP: {
-      int frt = instr->RTValue();
-      int frb = instr->RBValue();
-      // frsp round 8-byte double-precision value to
-      // single-precision value
-      double frb_val = get_double_from_d_register(frb);
-      double frt_val = static_cast<float>(frb_val);
-      set_d_register_from_double(frt, frt_val);
-      if (instr->Bit(0)) {  // RC bit set
-                            //  UNIMPLEMENTED();
-      }
-      return;
-    }
-    case FCFID: {
-      int frt = instr->RTValue();
-      int frb = instr->RBValue();
-      int64_t frb_val = get_d_register(frb);
-      double frt_val = static_cast<double>(frb_val);
-      set_d_register_from_double(frt, frt_val);
-      return;
-    }
-    case FCFIDU: {
-      int frt = instr->RTValue();
-      int frb = instr->RBValue();
-      uint64_t frb_val = get_d_register(frb);
-      double frt_val = static_cast<double>(frb_val);
-      set_d_register_from_double(frt, frt_val);
-      return;
-    }
-    case FCTID:
-    case FCTIDZ: {
-      int frt = instr->RTValue();
-      int frb = instr->RBValue();
-      double frb_val = get_double_from_d_register(frb);
-      int mode = (opcode == FCTIDZ) ? kRoundToZero
-                                    : (fp_condition_reg_ & kFPRoundingModeMask);
-      int64_t frt_val;
-      int64_t one = 1;  // work-around gcc
-      int64_t kMinVal = (one << 63);
-      int64_t kMaxVal = kMinVal - 1;
-      bool invalid_convert = false;
-
-      if (std::isnan(frb_val)) {
-        frt_val = kMinVal;
-        invalid_convert = true;
-      } else {
-        switch (mode) {
-          case kRoundToZero:
-            frb_val = std::trunc(frb_val);
-            break;
-          case kRoundToPlusInf:
-            frb_val = std::ceil(frb_val);
-            break;
-          case kRoundToMinusInf:
-            frb_val = std::floor(frb_val);
-            break;
-          default:
-            UNIMPLEMENTED();  // Not used by V8.
-            break;
-        }
-        if (frb_val < static_cast<double>(kMinVal)) {
-          frt_val = kMinVal;
-          invalid_convert = true;
-        } else if (frb_val >= static_cast<double>(kMaxVal)) {
-          frt_val = kMaxVal;
-          invalid_convert = true;
-        } else {
-          frt_val = (int64_t)frb_val;
-        }
-      }
-      set_d_register(frt, frt_val);
-      if (invalid_convert) SetFPSCR(VXCVI);
-      return;
-    }
-    case FCTIDU:
-    case FCTIDUZ: {
-      int frt = instr->RTValue();
-      int frb = instr->RBValue();
-      double frb_val = get_double_from_d_register(frb);
-      int mode = (opcode == FCTIDUZ)
-                     ? kRoundToZero
-                     : (fp_condition_reg_ & kFPRoundingModeMask);
-      uint64_t frt_val;
-      uint64_t kMinVal = 0;
-      uint64_t kMaxVal = kMinVal - 1;
-      bool invalid_convert = false;
-
-      if (std::isnan(frb_val)) {
-        frt_val = kMinVal;
-        invalid_convert = true;
-      } else {
-        switch (mode) {
-          case kRoundToZero:
-            frb_val = std::trunc(frb_val);
-            break;
-          case kRoundToPlusInf:
-            frb_val = std::ceil(frb_val);
-            break;
-          case kRoundToMinusInf:
-            frb_val = std::floor(frb_val);
-            break;
-          default:
-            UNIMPLEMENTED();  // Not used by V8.
-            break;
-        }
-        if (frb_val < static_cast<double>(kMinVal)) {
-          frt_val = kMinVal;
-          invalid_convert = true;
-        } else if (frb_val >= static_cast<double>(kMaxVal)) {
-          frt_val = kMaxVal;
-          invalid_convert = true;
-        } else {
-          frt_val = (uint64_t)frb_val;
-        }
-      }
-      set_d_register(frt, frt_val);
-      if (invalid_convert) SetFPSCR(VXCVI);
-      return;
-    }
-    case FCTIW:
-    case FCTIWZ: {
-      int frt = instr->RTValue();
-      int frb = instr->RBValue();
-      double frb_val = get_double_from_d_register(frb);
-      int mode = (opcode == FCTIWZ) ? kRoundToZero
-                                    : (fp_condition_reg_ & kFPRoundingModeMask);
-      int64_t frt_val;
-      int64_t kMinVal = kMinInt;
-      int64_t kMaxVal = kMaxInt;
-
-      if (std::isnan(frb_val)) {
-        frt_val = kMinVal;
-      } else {
-        switch (mode) {
-          case kRoundToZero:
-            frb_val = std::trunc(frb_val);
-            break;
-          case kRoundToPlusInf:
-            frb_val = std::ceil(frb_val);
-            break;
-          case kRoundToMinusInf:
-            frb_val = std::floor(frb_val);
-            break;
-          case kRoundToNearest: {
-            double orig = frb_val;
-            frb_val = lround(frb_val);
-            // Round to even if exactly halfway.  (lround rounds up)
-            if (std::fabs(frb_val - orig) == 0.5 && ((int64_t)frb_val % 2)) {
-              frb_val += ((frb_val > 0) ? -1.0 : 1.0);
-            }
-            break;
-          }
-          default:
-            UNIMPLEMENTED();  // Not used by V8.
-            break;
-        }
-        if (frb_val < kMinVal) {
-          frt_val = kMinVal;
-        } else if (frb_val > kMaxVal) {
-          frt_val = kMaxVal;
-        } else {
-          frt_val = (int64_t)frb_val;
-        }
-      }
-      set_d_register(frt, frt_val);
-      return;
-    }
-    case FNEG: {
-      int frt = instr->RTValue();
-      int frb = instr->RBValue();
-      double frb_val = get_double_from_d_register(frb);
-      double frt_val = -frb_val;
-      set_d_register_from_double(frt, frt_val);
-      return;
-    }
-    case FMR: {
-      int frt = instr->RTValue();
-      int frb = instr->RBValue();
-      int64_t frb_val = get_d_register(frb);
-      set_d_register(frt, frb_val);
-      return;
-    }
-    case MTFSFI: {
-      int bf = instr->Bits(25, 23);
-      int imm = instr->Bits(15, 12);
-      int fp_condition_mask = 0xF0000000 >> (bf * 4);
-      fp_condition_reg_ &= ~fp_condition_mask;
-      fp_condition_reg_ |= (imm << (28 - (bf * 4)));
-      if (instr->Bit(0)) {  // RC bit set
-        condition_reg_ &= 0xF0FFFFFF;
-        condition_reg_ |= (imm << 23);
-      }
-      return;
-    }
-    case MTFSF: {
-      int frb = instr->RBValue();
-      int64_t frb_dval = get_d_register(frb);
-      int32_t frb_ival = static_cast<int32_t>((frb_dval)&0xFFFFFFFF);
-      int l = instr->Bits(25, 25);
-      if (l == 1) {
-        fp_condition_reg_ = frb_ival;
-      } else {
-        UNIMPLEMENTED();
-      }
-      if (instr->Bit(0)) {  // RC bit set
-        UNIMPLEMENTED();
-        // int w = instr->Bits(16, 16);
-        // int flm = instr->Bits(24, 17);
-      }
-      return;
-    }
-    case MFFS: {
-      int frt = instr->RTValue();
-      int64_t lval = static_cast<int64_t>(fp_condition_reg_);
-      set_d_register(frt, lval);
-      return;
-    }
-    case MCRFS: {
-      int bf = instr->Bits(25, 23);
-      int bfa = instr->Bits(20, 18);
-      int cr_shift = (7 - bf) * CRWIDTH;
-      int fp_shift = (7 - bfa) * CRWIDTH;
-      int field_val = (fp_condition_reg_ >> fp_shift) & 0xF;
-      condition_reg_ &= ~(0x0F << cr_shift);
-      condition_reg_ |= (field_val << cr_shift);
-      // Clear copied exception bits
-      switch (bfa) {
-        case 5:
-          ClearFPSCR(VXSOFT);
-          ClearFPSCR(VXSQRT);
-          ClearFPSCR(VXCVI);
-          break;
-        default:
-          UNIMPLEMENTED();
-          break;
-      }
-      return;
-    }
-    case MTFSB0: {
-      int bt = instr->Bits(25, 21);
-      ClearFPSCR(bt);
-      if (instr->Bit(0)) {  // RC bit set
-        UNIMPLEMENTED();
-      }
-      return;
-    }
-    case MTFSB1: {
-      int bt = instr->Bits(25, 21);
-      SetFPSCR(bt);
-      if (instr->Bit(0)) {  // RC bit set
-        UNIMPLEMENTED();
-      }
-      return;
-    }
-    case FABS: {
-      int frt = instr->RTValue();
-      int frb = instr->RBValue();
-      double frb_val = get_double_from_d_register(frb);
-      double frt_val = std::fabs(frb_val);
-      set_d_register_from_double(frt, frt_val);
-      return;
-    }
-
-
-#if V8_TARGET_ARCH_PPC64
-    case RLDICL: {
-      int ra = instr->RAValue();
-      int rs = instr->RSValue();
-      uintptr_t rs_val = get_register(rs);
-      int sh = (instr->Bits(15, 11) | (instr->Bit(1) << 5));
-      int mb = (instr->Bits(10, 6) | (instr->Bit(5) << 5));
-      DCHECK(sh >= 0 && sh <= 63);
-      DCHECK(mb >= 0 && mb <= 63);
-      uintptr_t result = base::bits::RotateLeft64(rs_val, sh);
-      uintptr_t mask = 0xFFFFFFFFFFFFFFFF >> mb;
-      result &= mask;
-      set_register(ra, result);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(result);
-      }
-      return;
-    }
-    case RLDICR: {
-      int ra = instr->RAValue();
-      int rs = instr->RSValue();
-      uintptr_t rs_val = get_register(rs);
-      int sh = (instr->Bits(15, 11) | (instr->Bit(1) << 5));
-      int me = (instr->Bits(10, 6) | (instr->Bit(5) << 5));
-      DCHECK(sh >= 0 && sh <= 63);
-      DCHECK(me >= 0 && me <= 63);
-      uintptr_t result = base::bits::RotateLeft64(rs_val, sh);
-      uintptr_t mask = 0xFFFFFFFFFFFFFFFF << (63 - me);
-      result &= mask;
-      set_register(ra, result);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(result);
-      }
-      return;
-    }
-    case RLDIC: {
-      int ra = instr->RAValue();
-      int rs = instr->RSValue();
-      uintptr_t rs_val = get_register(rs);
-      int sh = (instr->Bits(15, 11) | (instr->Bit(1) << 5));
-      int mb = (instr->Bits(10, 6) | (instr->Bit(5) << 5));
-      DCHECK(sh >= 0 && sh <= 63);
-      DCHECK(mb >= 0 && mb <= 63);
-      uintptr_t result = base::bits::RotateLeft64(rs_val, sh);
-      uintptr_t mask = (0xFFFFFFFFFFFFFFFF >> mb) & (0xFFFFFFFFFFFFFFFF << sh);
-      result &= mask;
-      set_register(ra, result);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(result);
-      }
-      return;
-    }
-    case RLDIMI: {
-      int ra = instr->RAValue();
-      int rs = instr->RSValue();
-      uintptr_t rs_val = get_register(rs);
-      intptr_t ra_val = get_register(ra);
-      int sh = (instr->Bits(15, 11) | (instr->Bit(1) << 5));
-      int mb = (instr->Bits(10, 6) | (instr->Bit(5) << 5));
-      int me = 63 - sh;
-      uintptr_t result = base::bits::RotateLeft64(rs_val, sh);
-      uintptr_t mask = 0;
-      if (mb < me + 1) {
-        uintptr_t bit = 0x8000000000000000 >> mb;
-        for (; mb <= me; mb++) {
-          mask |= bit;
-          bit >>= 1;
-        }
-      } else if (mb == me + 1) {
-        mask = 0xFFFFFFFFFFFFFFFF;
-      } else {                                           // mb > me+1
-        uintptr_t bit = 0x8000000000000000 >> (me + 1);  // needs to be tested
-        mask = 0xFFFFFFFFFFFFFFFF;
-        for (; me < mb; me++) {
-          mask ^= bit;
-          bit >>= 1;
-        }
-      }
-      result &= mask;
-      ra_val &= ~mask;
-      result |= ra_val;
-      set_register(ra, result);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(result);
-      }
-      return;
-    }
-    case RLDCL: {
-      int ra = instr->RAValue();
-      int rs = instr->RSValue();
-      int rb = instr->RBValue();
-      uintptr_t rs_val = get_register(rs);
-      uintptr_t rb_val = get_register(rb);
-      int sh = (rb_val & 0x3F);
-      int mb = (instr->Bits(10, 6) | (instr->Bit(5) << 5));
-      DCHECK(sh >= 0 && sh <= 63);
-      DCHECK(mb >= 0 && mb <= 63);
-      uintptr_t result = base::bits::RotateLeft64(rs_val, sh);
-      uintptr_t mask = 0xFFFFFFFFFFFFFFFF >> mb;
-      result &= mask;
-      set_register(ra, result);
-      if (instr->Bit(0)) {  // RC bit set
-        SetCR0(result);
-      }
-      return;
-    }
-
-    case LD:
-    case LDU:
-    case LWA: {
-      int ra = instr->RAValue();
-      int rt = instr->RTValue();
-      int64_t ra_val = ra == 0 ? 0 : get_register(ra);
-      int offset = SIGN_EXT_IMM16(instr->Bits(15, 0) & ~3);
-      switch (instr->Bits(1, 0)) {
-        case 0: {  // ld
-          intptr_t* result = ReadDW(ra_val + offset);
-          set_register(rt, *result);
-          break;
-        }
-        case 1: {  // ldu
-          intptr_t* result = ReadDW(ra_val + offset);
-          set_register(rt, *result);
-          DCHECK_NE(ra, 0);
-          set_register(ra, ra_val + offset);
-          break;
-        }
-        case 2: {  // lwa
-          intptr_t result = ReadW(ra_val + offset, instr);
-          set_register(rt, result);
-          break;
-        }
-      }
-      break;
-    }
-
-    case STD:
-    case STDU: {
-      int ra = instr->RAValue();
-      int rs = instr->RSValue();
-      int64_t ra_val = ra == 0 ? 0 : get_register(ra);
-      int64_t rs_val = get_register(rs);
-      int offset = SIGN_EXT_IMM16(instr->Bits(15, 0) & ~3);
-      WriteDW(ra_val + offset, rs_val);
-      if (opcode == STDU) {
-        DCHECK_NE(ra, 0);
-        set_register(ra, ra_val + offset);
-      }
-      break;
-    }
-#endif
-
-    case XSADDDP: {
-      int frt = instr->RTValue();
-      int fra = instr->RAValue();
-      int frb = instr->RBValue();
-      double fra_val = get_double_from_d_register(fra);
-      double frb_val = get_double_from_d_register(frb);
-      double frt_val = fra_val + frb_val;
-      set_d_register_from_double(frt, frt_val);
-      return;
-    }
-    case XSSUBDP: {
-      int frt = instr->RTValue();
-      int fra = instr->RAValue();
-      int frb = instr->RBValue();
-      double fra_val = get_double_from_d_register(fra);
-      double frb_val = get_double_from_d_register(frb);
-      double frt_val = fra_val - frb_val;
-      set_d_register_from_double(frt, frt_val);
-      return;
-    }
-    case XSMULDP: {
-      int frt = instr->RTValue();
-      int fra = instr->RAValue();
-      int frb = instr->RBValue();
-      double fra_val = get_double_from_d_register(fra);
-      double frb_val = get_double_from_d_register(frb);
-      double frt_val = fra_val * frb_val;
-      set_d_register_from_double(frt, frt_val);
-      return;
-    }
-    case XSDIVDP: {
-      int frt = instr->RTValue();
-      int fra = instr->RAValue();
-      int frb = instr->RBValue();
-      double fra_val = get_double_from_d_register(fra);
-      double frb_val = get_double_from_d_register(frb);
-      double frt_val = fra_val / frb_val;
-      set_d_register_from_double(frt, frt_val);
-      return;
-    }
-
-    default: {
-      UNIMPLEMENTED();
-      break;
-    }
-  }
-}  // NOLINT
-
-
-void Simulator::Trace(Instruction* instr) {
-  disasm::NameConverter converter;
-  disasm::Disassembler dasm(converter);
-  // use a reasonably large buffer
-  v8::internal::EmbeddedVector<char, 256> buffer;
-  dasm.InstructionDecode(buffer, reinterpret_cast<byte*>(instr));
-  PrintF("%05d  %08" V8PRIxPTR "  %s\n", icount_,
-         reinterpret_cast<intptr_t>(instr), buffer.start());
-}
-
-
-// Executes the current instruction.
-void Simulator::ExecuteInstruction(Instruction* instr) {
-  if (v8::internal::FLAG_check_icache) {
-    CheckICache(isolate_->simulator_i_cache(), instr);
-  }
-  pc_modified_ = false;
-  if (::v8::internal::FLAG_trace_sim) {
-    Trace(instr);
-  }
-  uint32_t opcode = instr->OpcodeField();
-  if (opcode == TWI) {
-    SoftwareInterrupt(instr);
-  } else {
-    ExecuteGeneric(instr);
-  }
-  if (!pc_modified_) {
-    set_pc(reinterpret_cast<intptr_t>(instr) + Instruction::kInstrSize);
-  }
-}
-
-
-void Simulator::Execute() {
-  // Get the PC to simulate. Cannot use the accessor here as we need the
-  // raw PC value and not the one used as input to arithmetic instructions.
-  intptr_t program_counter = get_pc();
-
-  if (::v8::internal::FLAG_stop_sim_at == 0) {
-    // Fast version of the dispatch loop without checking whether the simulator
-    // should be stopping at a particular executed instruction.
-    while (program_counter != end_sim_pc) {
-      Instruction* instr = reinterpret_cast<Instruction*>(program_counter);
-      icount_++;
-      ExecuteInstruction(instr);
-      program_counter = get_pc();
-    }
-  } else {
-    // FLAG_stop_sim_at is at the non-default value. Stop in the debugger when
-    // we reach the particular instruction count.
-    while (program_counter != end_sim_pc) {
-      Instruction* instr = reinterpret_cast<Instruction*>(program_counter);
-      icount_++;
-      if (icount_ == ::v8::internal::FLAG_stop_sim_at) {
-        PPCDebugger dbg(this);
-        dbg.Debug();
-      } else {
-        ExecuteInstruction(instr);
-      }
-      program_counter = get_pc();
-    }
-  }
-}
-
-
-void Simulator::CallInternal(byte* entry) {
-  // Adjust JS-based stack limit to C-based stack limit.
-  isolate_->stack_guard()->AdjustStackLimitForSimulator();
-
-  // Prepare to execute the code at entry
-  if (ABI_USES_FUNCTION_DESCRIPTORS) {
-    // entry is the function descriptor
-    set_pc(*(reinterpret_cast<intptr_t*>(entry)));
-  } else {
-    // entry is the instruction address
-    set_pc(reinterpret_cast<intptr_t>(entry));
-  }
-
-  if (ABI_CALL_VIA_IP) {
-    // Put target address in ip (for JS prologue).
-    set_register(r12, get_pc());
-  }
-
-  // Put down marker for end of simulation. The simulator will stop simulation
-  // when the PC reaches this value. By saving the "end simulation" value into
-  // the LR the simulation stops when returning to this call point.
-  special_reg_lr_ = end_sim_pc;
-
-  // Remember the values of non-volatile registers.
-  intptr_t r2_val = get_register(r2);
-  intptr_t r13_val = get_register(r13);
-  intptr_t r14_val = get_register(r14);
-  intptr_t r15_val = get_register(r15);
-  intptr_t r16_val = get_register(r16);
-  intptr_t r17_val = get_register(r17);
-  intptr_t r18_val = get_register(r18);
-  intptr_t r19_val = get_register(r19);
-  intptr_t r20_val = get_register(r20);
-  intptr_t r21_val = get_register(r21);
-  intptr_t r22_val = get_register(r22);
-  intptr_t r23_val = get_register(r23);
-  intptr_t r24_val = get_register(r24);
-  intptr_t r25_val = get_register(r25);
-  intptr_t r26_val = get_register(r26);
-  intptr_t r27_val = get_register(r27);
-  intptr_t r28_val = get_register(r28);
-  intptr_t r29_val = get_register(r29);
-  intptr_t r30_val = get_register(r30);
-  intptr_t r31_val = get_register(fp);
-
-  // Set up the non-volatile registers with a known value. To be able to check
-  // that they are preserved properly across JS execution.
-  intptr_t callee_saved_value = icount_;
-  set_register(r2, callee_saved_value);
-  set_register(r13, callee_saved_value);
-  set_register(r14, callee_saved_value);
-  set_register(r15, callee_saved_value);
-  set_register(r16, callee_saved_value);
-  set_register(r17, callee_saved_value);
-  set_register(r18, callee_saved_value);
-  set_register(r19, callee_saved_value);
-  set_register(r20, callee_saved_value);
-  set_register(r21, callee_saved_value);
-  set_register(r22, callee_saved_value);
-  set_register(r23, callee_saved_value);
-  set_register(r24, callee_saved_value);
-  set_register(r25, callee_saved_value);
-  set_register(r26, callee_saved_value);
-  set_register(r27, callee_saved_value);
-  set_register(r28, callee_saved_value);
-  set_register(r29, callee_saved_value);
-  set_register(r30, callee_saved_value);
-  set_register(fp, callee_saved_value);
-
-  // Start the simulation
-  Execute();
-
-  // Check that the non-volatile registers have been preserved.
-  if (ABI_TOC_REGISTER != 2) {
-    CHECK_EQ(callee_saved_value, get_register(r2));
-  }
-  if (ABI_TOC_REGISTER != 13) {
-    CHECK_EQ(callee_saved_value, get_register(r13));
-  }
-  CHECK_EQ(callee_saved_value, get_register(r14));
-  CHECK_EQ(callee_saved_value, get_register(r15));
-  CHECK_EQ(callee_saved_value, get_register(r16));
-  CHECK_EQ(callee_saved_value, get_register(r17));
-  CHECK_EQ(callee_saved_value, get_register(r18));
-  CHECK_EQ(callee_saved_value, get_register(r19));
-  CHECK_EQ(callee_saved_value, get_register(r20));
-  CHECK_EQ(callee_saved_value, get_register(r21));
-  CHECK_EQ(callee_saved_value, get_register(r22));
-  CHECK_EQ(callee_saved_value, get_register(r23));
-  CHECK_EQ(callee_saved_value, get_register(r24));
-  CHECK_EQ(callee_saved_value, get_register(r25));
-  CHECK_EQ(callee_saved_value, get_register(r26));
-  CHECK_EQ(callee_saved_value, get_register(r27));
-  CHECK_EQ(callee_saved_value, get_register(r28));
-  CHECK_EQ(callee_saved_value, get_register(r29));
-  CHECK_EQ(callee_saved_value, get_register(r30));
-  CHECK_EQ(callee_saved_value, get_register(fp));
-
-  // Restore non-volatile registers with the original value.
-  set_register(r2, r2_val);
-  set_register(r13, r13_val);
-  set_register(r14, r14_val);
-  set_register(r15, r15_val);
-  set_register(r16, r16_val);
-  set_register(r17, r17_val);
-  set_register(r18, r18_val);
-  set_register(r19, r19_val);
-  set_register(r20, r20_val);
-  set_register(r21, r21_val);
-  set_register(r22, r22_val);
-  set_register(r23, r23_val);
-  set_register(r24, r24_val);
-  set_register(r25, r25_val);
-  set_register(r26, r26_val);
-  set_register(r27, r27_val);
-  set_register(r28, r28_val);
-  set_register(r29, r29_val);
-  set_register(r30, r30_val);
-  set_register(fp, r31_val);
-}
-
-intptr_t Simulator::CallImpl(byte* entry, int argument_count,
-                             const intptr_t* arguments) {
-  // Set up arguments
-
-  // First eight arguments passed in registers r3-r10.
-  int reg_arg_count = std::min(8, argument_count);
-  int stack_arg_count = argument_count - reg_arg_count;
-  for (int i = 0; i < reg_arg_count; i++) {
-    set_register(i + 3, arguments[i]);
-  }
-
-  // Remaining arguments passed on stack.
-  intptr_t original_stack = get_register(sp);
-  // Compute position of stack on entry to generated code.
-  intptr_t entry_stack =
-      (original_stack -
-       (kNumRequiredStackFrameSlots + stack_arg_count) * sizeof(intptr_t));
-  if (base::OS::ActivationFrameAlignment() != 0) {
-    entry_stack &= -base::OS::ActivationFrameAlignment();
-  }
-  // Store remaining arguments on stack, from low to high memory.
-  // +2 is a hack for the LR slot + old SP on PPC
-  intptr_t* stack_argument =
-      reinterpret_cast<intptr_t*>(entry_stack) + kStackFrameExtraParamSlot;
-  memcpy(stack_argument, arguments + reg_arg_count,
-         stack_arg_count * sizeof(*arguments));
-  set_register(sp, entry_stack);
-
-  CallInternal(entry);
-
-  // Pop stack passed arguments.
-  CHECK_EQ(entry_stack, get_register(sp));
-  set_register(sp, original_stack);
-
-  return get_register(r3);
-}
-
-
-void Simulator::CallFP(byte* entry, double d0, double d1) {
-  set_d_register_from_double(1, d0);
-  set_d_register_from_double(2, d1);
-  CallInternal(entry);
-}
-
-
-int32_t Simulator::CallFPReturnsInt(byte* entry, double d0, double d1) {
-  CallFP(entry, d0, d1);
-  int32_t result = get_register(r3);
-  return result;
-}
-
-
-double Simulator::CallFPReturnsDouble(byte* entry, double d0, double d1) {
-  CallFP(entry, d0, d1);
-  return get_double_from_d_register(1);
-}
-
-
-uintptr_t Simulator::PushAddress(uintptr_t address) {
-  uintptr_t new_sp = get_register(sp) - sizeof(uintptr_t);
-  uintptr_t* stack_slot = reinterpret_cast<uintptr_t*>(new_sp);
-  *stack_slot = address;
-  set_register(sp, new_sp);
-  return new_sp;
-}
-
-
-uintptr_t Simulator::PopAddress() {
-  uintptr_t current_sp = get_register(sp);
-  uintptr_t* stack_slot = reinterpret_cast<uintptr_t*>(current_sp);
-  uintptr_t address = *stack_slot;
-  set_register(sp, current_sp + sizeof(uintptr_t));
-  return address;
-}
-
-Simulator::LocalMonitor::LocalMonitor()
-    : access_state_(MonitorAccess::Open),
-      tagged_addr_(0),
-      size_(TransactionSize::None) {}
-
-void Simulator::LocalMonitor::Clear() {
-  access_state_ = MonitorAccess::Open;
-  tagged_addr_ = 0;
-  size_ = TransactionSize::None;
-}
-
-void Simulator::LocalMonitor::NotifyLoad(int32_t addr) {
-  if (access_state_ == MonitorAccess::Exclusive) {
-    // A load could cause a cache eviction which will affect the monitor. As a
-    // result, it's most strict to unconditionally clear the local monitor on
-    // load.
-    Clear();
-  }
-}
-
-void Simulator::LocalMonitor::NotifyLoadExcl(int32_t addr,
-                                             TransactionSize size) {
-  access_state_ = MonitorAccess::Exclusive;
-  tagged_addr_ = addr;
-  size_ = size;
-}
-
-void Simulator::LocalMonitor::NotifyStore(int32_t addr) {
-  if (access_state_ == MonitorAccess::Exclusive) {
-    // A store could cause a cache eviction which will affect the
-    // monitor. As a result, it's most strict to unconditionally clear the
-    // local monitor on store.
-    Clear();
-  }
-}
-
-bool Simulator::LocalMonitor::NotifyStoreExcl(int32_t addr,
-                                              TransactionSize size) {
-  if (access_state_ == MonitorAccess::Exclusive) {
-    if (addr == tagged_addr_ && size_ == size) {
-      Clear();
-      return true;
-    } else {
-      Clear();
-      return false;
-    }
-  } else {
-    DCHECK(access_state_ == MonitorAccess::Open);
-    return false;
-  }
-}
-
-Simulator::GlobalMonitor::Processor::Processor()
-    : access_state_(MonitorAccess::Open),
-      tagged_addr_(0),
-      next_(nullptr),
-      prev_(nullptr) {}
-
-void Simulator::GlobalMonitor::Processor::Clear_Locked() {
-  access_state_ = MonitorAccess::Open;
-  tagged_addr_ = 0;
-}
-void Simulator::GlobalMonitor::Processor::NotifyLoadExcl_Locked(int32_t addr) {
-  access_state_ = MonitorAccess::Exclusive;
-  tagged_addr_ = addr;
-}
-
-void Simulator::GlobalMonitor::Processor::NotifyStore_Locked(
-    int32_t addr, bool is_requesting_processor) {
-  if (access_state_ == MonitorAccess::Exclusive) {
-    // It is possible that a store caused a cache eviction,
-    // which can affect the montior, so conservatively,
-    // we always clear the monitor.
-    Clear_Locked();
-  }
-}
-
-bool Simulator::GlobalMonitor::Processor::NotifyStoreExcl_Locked(
-    int32_t addr, bool is_requesting_processor) {
-  if (access_state_ == MonitorAccess::Exclusive) {
-    if (is_requesting_processor) {
-      if (addr == tagged_addr_) {
-        Clear_Locked();
-        return true;
-      }
-    } else if (addr == tagged_addr_) {
-      Clear_Locked();
-      return false;
-    }
-  }
-  return false;
-}
-
-Simulator::GlobalMonitor::GlobalMonitor() : head_(nullptr) {}
-
-void Simulator::GlobalMonitor::NotifyLoadExcl_Locked(int32_t addr,
-                                                     Processor* processor) {
-  processor->NotifyLoadExcl_Locked(addr);
-  PrependProcessor_Locked(processor);
-}
-
-void Simulator::GlobalMonitor::NotifyStore_Locked(int32_t addr,
-                                                  Processor* processor) {
-  // Notify each processor of the store operation.
-  for (Processor* iter = head_; iter; iter = iter->next_) {
-    bool is_requesting_processor = iter == processor;
-    iter->NotifyStore_Locked(addr, is_requesting_processor);
-  }
-}
-
-bool Simulator::GlobalMonitor::NotifyStoreExcl_Locked(int32_t addr,
-                                                      Processor* processor) {
-  DCHECK(IsProcessorInLinkedList_Locked(processor));
-  if (processor->NotifyStoreExcl_Locked(addr, true)) {
-    // Notify the other processors that this StoreExcl succeeded.
-    for (Processor* iter = head_; iter; iter = iter->next_) {
-      if (iter != processor) {
-        iter->NotifyStoreExcl_Locked(addr, false);
-      }
-    }
-    return true;
-  } else {
-    return false;
-  }
-}
-
-bool Simulator::GlobalMonitor::IsProcessorInLinkedList_Locked(
-    Processor* processor) const {
-  return head_ == processor || processor->next_ || processor->prev_;
-}
-
-void Simulator::GlobalMonitor::PrependProcessor_Locked(Processor* processor) {
-  if (IsProcessorInLinkedList_Locked(processor)) {
-    return;
-  }
-
-  if (head_) {
-    head_->prev_ = processor;
-  }
-  processor->prev_ = nullptr;
-  processor->next_ = head_;
-  head_ = processor;
-}
-
-void Simulator::GlobalMonitor::RemoveProcessor(Processor* processor) {
-  base::LockGuard<base::Mutex> lock_guard(&mutex);
-  if (!IsProcessorInLinkedList_Locked(processor)) {
-    return;
-  }
-
-  if (processor->prev_) {
-    processor->prev_->next_ = processor->next_;
-  } else {
-    head_ = processor->next_;
-  }
-  if (processor->next_) {
-    processor->next_->prev_ = processor->prev_;
-  }
-  processor->prev_ = nullptr;
-  processor->next_ = nullptr;
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // USE_SIMULATOR
-#endif  // V8_TARGET_ARCH_PPC
diff --git a/src/v8/src/ppc/simulator-ppc.h b/src/v8/src/ppc/simulator-ppc.h
deleted file mode 100644
index 544b9d4..0000000
--- a/src/v8/src/ppc/simulator-ppc.h
+++ /dev/null
@@ -1,440 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Declares a Simulator for PPC instructions if we are not generating a native
-// PPC binary. This Simulator allows us to run and debug PPC code generation on
-// regular desktop machines.
-// V8 calls into generated code via the GeneratedCode wrapper,
-// which will start execution in the Simulator or forwards to the real entry
-// on a PPC HW platform.
-
-#ifndef V8_PPC_SIMULATOR_PPC_H_
-#define V8_PPC_SIMULATOR_PPC_H_
-
-#include "src/allocation.h"
-
-#if defined(USE_SIMULATOR)
-// Running with a simulator.
-
-#include "src/assembler.h"
-#include "src/base/hashmap.h"
-#include "src/ppc/constants-ppc.h"
-#include "src/simulator-base.h"
-
-namespace v8 {
-namespace internal {
-
-class CachePage {
- public:
-  static const int LINE_VALID = 0;
-  static const int LINE_INVALID = 1;
-
-  static const int kPageShift = 12;
-  static const int kPageSize = 1 << kPageShift;
-  static const int kPageMask = kPageSize - 1;
-  static const int kLineShift = 2;  // The cache line is only 4 bytes right now.
-  static const int kLineLength = 1 << kLineShift;
-  static const int kLineMask = kLineLength - 1;
-
-  CachePage() { memset(&validity_map_, LINE_INVALID, sizeof(validity_map_)); }
-
-  char* ValidityByte(int offset) {
-    return &validity_map_[offset >> kLineShift];
-  }
-
-  char* CachedData(int offset) { return &data_[offset]; }
-
- private:
-  char data_[kPageSize];  // The cached data.
-  static const int kValidityMapSize = kPageSize >> kLineShift;
-  char validity_map_[kValidityMapSize];  // One byte per line.
-};
-
-class Simulator : public SimulatorBase {
- public:
-  friend class PPCDebugger;
-  enum Register {
-    no_reg = -1,
-    r0 = 0,
-    sp,
-    r2,
-    r3,
-    r4,
-    r5,
-    r6,
-    r7,
-    r8,
-    r9,
-    r10,
-    r11,
-    r12,
-    r13,
-    r14,
-    r15,
-    r16,
-    r17,
-    r18,
-    r19,
-    r20,
-    r21,
-    r22,
-    r23,
-    r24,
-    r25,
-    r26,
-    r27,
-    r28,
-    r29,
-    r30,
-    fp,
-    kNumGPRs = 32,
-    d0 = 0,
-    d1,
-    d2,
-    d3,
-    d4,
-    d5,
-    d6,
-    d7,
-    d8,
-    d9,
-    d10,
-    d11,
-    d12,
-    d13,
-    d14,
-    d15,
-    d16,
-    d17,
-    d18,
-    d19,
-    d20,
-    d21,
-    d22,
-    d23,
-    d24,
-    d25,
-    d26,
-    d27,
-    d28,
-    d29,
-    d30,
-    d31,
-    kNumFPRs = 32
-  };
-
-  explicit Simulator(Isolate* isolate);
-  ~Simulator();
-
-  // The currently executing Simulator instance. Potentially there can be one
-  // for each native thread.
-  static Simulator* current(v8::internal::Isolate* isolate);
-
-  // Accessors for register state.
-  void set_register(int reg, intptr_t value);
-  intptr_t get_register(int reg) const;
-  double get_double_from_register_pair(int reg);
-  void set_d_register_from_double(int dreg, const double dbl) {
-    DCHECK(dreg >= 0 && dreg < kNumFPRs);
-    *bit_cast<double*>(&fp_registers_[dreg]) = dbl;
-  }
-  double get_double_from_d_register(int dreg) {
-    DCHECK(dreg >= 0 && dreg < kNumFPRs);
-    return *bit_cast<double*>(&fp_registers_[dreg]);
-  }
-  void set_d_register(int dreg, int64_t value) {
-    DCHECK(dreg >= 0 && dreg < kNumFPRs);
-    fp_registers_[dreg] = value;
-  }
-  int64_t get_d_register(int dreg) {
-    DCHECK(dreg >= 0 && dreg < kNumFPRs);
-    return fp_registers_[dreg];
-  }
-
-  // Special case of set_register and get_register to access the raw PC value.
-  void set_pc(intptr_t value);
-  intptr_t get_pc() const;
-
-  Address get_sp() const {
-    return reinterpret_cast<Address>(static_cast<intptr_t>(get_register(sp)));
-  }
-
-  // Accessor to the internal simulator stack area.
-  uintptr_t StackLimit(uintptr_t c_limit) const;
-
-  // Executes PPC instructions until the PC reaches end_sim_pc.
-  void Execute();
-
-  template <typename Return, typename... Args>
-  Return Call(byte* entry, Args... args) {
-    return VariadicCall<Return>(this, &Simulator::CallImpl, entry, args...);
-  }
-
-  // Alternative: call a 2-argument double function.
-  void CallFP(byte* entry, double d0, double d1);
-  int32_t CallFPReturnsInt(byte* entry, double d0, double d1);
-  double CallFPReturnsDouble(byte* entry, double d0, double d1);
-
-  // Push an address onto the JS stack.
-  uintptr_t PushAddress(uintptr_t address);
-
-  // Pop an address from the JS stack.
-  uintptr_t PopAddress();
-
-  // Debugger input.
-  void set_last_debugger_input(char* input);
-  char* last_debugger_input() { return last_debugger_input_; }
-
-  // Redirection support.
-  static void SetRedirectInstruction(Instruction* instruction);
-
-  // ICache checking.
-  static void FlushICache(base::CustomMatcherHashMap* i_cache, void* start,
-                          size_t size);
-
-  // Returns true if pc register contains one of the 'special_values' defined
-  // below (bad_lr, end_sim_pc).
-  bool has_bad_pc() const;
-
- private:
-  enum special_values {
-    // Known bad pc value to ensure that the simulator does not execute
-    // without being properly setup.
-    bad_lr = -1,
-    // A pc value used to signal the simulator to stop execution.  Generally
-    // the lr is set to this value on transition from native C code to
-    // simulated execution, so that the simulator can "return" to the native
-    // C code.
-    end_sim_pc = -2
-  };
-
-  intptr_t CallImpl(byte* entry, int argument_count, const intptr_t* arguments);
-
-  enum BCType { BC_OFFSET, BC_LINK_REG, BC_CTR_REG };
-
-  // Unsupported instructions use Format to print an error and stop execution.
-  void Format(Instruction* instr, const char* format);
-
-  // Helper functions to set the conditional flags in the architecture state.
-  bool CarryFrom(int32_t left, int32_t right, int32_t carry = 0);
-  bool BorrowFrom(int32_t left, int32_t right);
-  bool OverflowFrom(int32_t alu_out, int32_t left, int32_t right,
-                    bool addition);
-
-  // Helper functions to decode common "addressing" modes
-  int32_t GetShiftRm(Instruction* instr, bool* carry_out);
-  int32_t GetImm(Instruction* instr, bool* carry_out);
-  void ProcessPUW(Instruction* instr, int num_regs, int operand_size,
-                  intptr_t* start_address, intptr_t* end_address);
-  void HandleRList(Instruction* instr, bool load);
-  void HandleVList(Instruction* inst);
-  void SoftwareInterrupt(Instruction* instr);
-
-  // Stop helper functions.
-  inline bool isStopInstruction(Instruction* instr);
-  inline bool isWatchedStop(uint32_t bkpt_code);
-  inline bool isEnabledStop(uint32_t bkpt_code);
-  inline void EnableStop(uint32_t bkpt_code);
-  inline void DisableStop(uint32_t bkpt_code);
-  inline void IncreaseStopCounter(uint32_t bkpt_code);
-  void PrintStopInfo(uint32_t code);
-
-  // Read and write memory.
-  inline uint8_t ReadBU(intptr_t addr);
-  inline uint8_t ReadExBU(intptr_t addr);
-  inline int8_t ReadB(intptr_t addr);
-  inline void WriteB(intptr_t addr, uint8_t value);
-  inline int WriteExB(intptr_t addr, uint8_t value);
-  inline void WriteB(intptr_t addr, int8_t value);
-
-  inline uint16_t ReadHU(intptr_t addr, Instruction* instr);
-  inline uint16_t ReadExHU(intptr_t addr, Instruction* instr);
-  inline int16_t ReadH(intptr_t addr, Instruction* instr);
-  // Note: Overloaded on the sign of the value.
-  inline void WriteH(intptr_t addr, uint16_t value, Instruction* instr);
-  inline int WriteExH(intptr_t addr, uint16_t value, Instruction* instr);
-  inline void WriteH(intptr_t addr, int16_t value, Instruction* instr);
-
-  inline uint32_t ReadWU(intptr_t addr, Instruction* instr);
-  inline uint32_t ReadExWU(intptr_t addr, Instruction* instr);
-  inline int32_t ReadW(intptr_t addr, Instruction* instr);
-  inline void WriteW(intptr_t addr, uint32_t value, Instruction* instr);
-  inline int WriteExW(intptr_t addr, uint32_t value, Instruction* instr);
-  inline void WriteW(intptr_t addr, int32_t value, Instruction* instr);
-
-  intptr_t* ReadDW(intptr_t addr);
-  void WriteDW(intptr_t addr, int64_t value);
-
-  void Trace(Instruction* instr);
-  void SetCR0(intptr_t result, bool setSO = false);
-  void ExecuteBranchConditional(Instruction* instr, BCType type);
-  void ExecuteExt1(Instruction* instr);
-  bool ExecuteExt2_10bit_part1(Instruction* instr);
-  bool ExecuteExt2_10bit_part2(Instruction* instr);
-  bool ExecuteExt2_9bit_part1(Instruction* instr);
-  bool ExecuteExt2_9bit_part2(Instruction* instr);
-  void ExecuteExt2_5bit(Instruction* instr);
-  void ExecuteExt2(Instruction* instr);
-  void ExecuteExt3(Instruction* instr);
-  void ExecuteExt4(Instruction* instr);
-#if V8_TARGET_ARCH_PPC64
-  void ExecuteExt5(Instruction* instr);
-#endif
-  void ExecuteExt6(Instruction* instr);
-  void ExecuteGeneric(Instruction* instr);
-
-  void SetFPSCR(int bit) { fp_condition_reg_ |= (1 << (31 - bit)); }
-  void ClearFPSCR(int bit) { fp_condition_reg_ &= ~(1 << (31 - bit)); }
-
-  // Executes one instruction.
-  void ExecuteInstruction(Instruction* instr);
-
-  // ICache.
-  static void CheckICache(base::CustomMatcherHashMap* i_cache,
-                          Instruction* instr);
-  static void FlushOnePage(base::CustomMatcherHashMap* i_cache, intptr_t start,
-                           int size);
-  static CachePage* GetCachePage(base::CustomMatcherHashMap* i_cache,
-                                 void* page);
-
-  // Handle arguments and return value for runtime FP functions.
-  void GetFpArgs(double* x, double* y, intptr_t* z);
-  void SetFpResult(const double& result);
-  void TrashCallerSaveRegisters();
-
-  void CallInternal(byte* entry);
-
-  // Architecture state.
-  // Saturating instructions require a Q flag to indicate saturation.
-  // There is currently no way to read the CPSR directly, and thus read the Q
-  // flag, so this is left unimplemented.
-  intptr_t registers_[kNumGPRs];
-  int32_t condition_reg_;
-  int32_t fp_condition_reg_;
-  intptr_t special_reg_lr_;
-  intptr_t special_reg_pc_;
-  intptr_t special_reg_ctr_;
-  int32_t special_reg_xer_;
-
-  int64_t fp_registers_[kNumFPRs];
-
-  // Simulator support.
-  char* stack_;
-  static const size_t stack_protection_size_ = 256 * kPointerSize;
-  bool pc_modified_;
-  int icount_;
-
-  // Debugger input.
-  char* last_debugger_input_;
-
-  // Icache simulation
-  base::CustomMatcherHashMap* i_cache_;
-
-  // Registered breakpoints.
-  Instruction* break_pc_;
-  Instr break_instr_;
-
-  v8::internal::Isolate* isolate_;
-
-  // A stop is watched if its code is less than kNumOfWatchedStops.
-  // Only watched stops support enabling/disabling and the counter feature.
-  static const uint32_t kNumOfWatchedStops = 256;
-
-  // Breakpoint is disabled if bit 31 is set.
-  static const uint32_t kStopDisabledBit = 1 << 31;
-
-  // A stop is enabled, meaning the simulator will stop when meeting the
-  // instruction, if bit 31 of watched_stops_[code].count is unset.
-  // The value watched_stops_[code].count & ~(1 << 31) indicates how many times
-  // the breakpoint was hit or gone through.
-  struct StopCountAndDesc {
-    uint32_t count;
-    char* desc;
-  };
-  StopCountAndDesc watched_stops_[kNumOfWatchedStops];
-
-  // Synchronization primitives. See ARM DDI 0406C.b, A2.9.
-  enum class MonitorAccess {
-    Open,
-    Exclusive,
-  };
-
-  enum class TransactionSize {
-    None = 0,
-    Byte = 1,
-    HalfWord = 2,
-    Word = 4,
-  };
-
-  class LocalMonitor {
-   public:
-    LocalMonitor();
-
-    // These functions manage the state machine for the local monitor, but do
-    // not actually perform loads and stores. NotifyStoreExcl only returns
-    // true if the exclusive store is allowed; the global monitor will still
-    // have to be checked to see whether the memory should be updated.
-    void NotifyLoad(int32_t addr);
-    void NotifyLoadExcl(int32_t addr, TransactionSize size);
-    void NotifyStore(int32_t addr);
-    bool NotifyStoreExcl(int32_t addr, TransactionSize size);
-
-   private:
-    void Clear();
-
-    MonitorAccess access_state_;
-    int32_t tagged_addr_;
-    TransactionSize size_;
-  };
-
-  class GlobalMonitor {
-   public:
-    GlobalMonitor();
-
-    class Processor {
-     public:
-      Processor();
-
-     private:
-      friend class GlobalMonitor;
-      // These functions manage the state machine for the global monitor, but do
-      // not actually perform loads and stores.
-      void Clear_Locked();
-      void NotifyLoadExcl_Locked(int32_t addr);
-      void NotifyStore_Locked(int32_t addr, bool is_requesting_processor);
-      bool NotifyStoreExcl_Locked(int32_t addr, bool is_requesting_processor);
-
-      MonitorAccess access_state_;
-      int32_t tagged_addr_;
-      Processor* next_;
-      Processor* prev_;
-    };
-
-    // Exposed so it can be accessed by Simulator::{Read,Write}Ex*.
-    base::Mutex mutex;
-
-    void NotifyLoadExcl_Locked(int32_t addr, Processor* processor);
-    void NotifyStore_Locked(int32_t addr, Processor* processor);
-    bool NotifyStoreExcl_Locked(int32_t addr, Processor* processor);
-
-    // Called when the simulator is destroyed.
-    void RemoveProcessor(Processor* processor);
-
-   private:
-    bool IsProcessorInLinkedList_Locked(Processor* processor) const;
-    void PrependProcessor_Locked(Processor* processor);
-
-    Processor* head_;
-  };
-
-  LocalMonitor local_monitor_;
-  GlobalMonitor::Processor global_monitor_processor_;
-  static base::LazyInstance<GlobalMonitor>::type global_monitor_;
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // defined(USE_SIMULATOR)
-#endif  // V8_PPC_SIMULATOR_PPC_H_
diff --git a/src/v8/src/profiler/unbound-queue-inl.h b/src/v8/src/profiler/unbound-queue-inl.h
deleted file mode 100644
index 4b262b8..0000000
--- a/src/v8/src/profiler/unbound-queue-inl.h
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright 2010 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_PROFILER_UNBOUND_QUEUE_INL_H_
-#define V8_PROFILER_UNBOUND_QUEUE_INL_H_
-
-#include "src/profiler/unbound-queue.h"
-
-namespace v8 {
-namespace internal {
-
-template<typename Record>
-struct UnboundQueue<Record>::Node: public Malloced {
-  explicit Node(const Record& value) : value(value), next(nullptr) {}
-
-  Record value;
-  Node* next;
-};
-
-
-template<typename Record>
-UnboundQueue<Record>::UnboundQueue() {
-  first_ = new Node(Record());
-  divider_ = last_ = reinterpret_cast<base::AtomicWord>(first_);
-}
-
-
-template<typename Record>
-UnboundQueue<Record>::~UnboundQueue() {
-  while (first_ != nullptr) DeleteFirst();
-}
-
-
-template<typename Record>
-void UnboundQueue<Record>::DeleteFirst() {
-  Node* tmp = first_;
-  first_ = tmp->next;
-  delete tmp;
-}
-
-
-template<typename Record>
-bool UnboundQueue<Record>::Dequeue(Record* rec) {
-  if (divider_ == base::Acquire_Load(&last_)) return false;
-  Node* next = reinterpret_cast<Node*>(divider_)->next;
-  *rec = next->value;
-  base::Release_Store(&divider_, reinterpret_cast<base::AtomicWord>(next));
-  return true;
-}
-
-
-template<typename Record>
-void UnboundQueue<Record>::Enqueue(const Record& rec) {
-  Node*& next = reinterpret_cast<Node*>(last_)->next;
-  next = new Node(rec);
-  base::Release_Store(&last_, reinterpret_cast<base::AtomicWord>(next));
-
-  while (first_ != reinterpret_cast<Node*>(base::Acquire_Load(&divider_))) {
-    DeleteFirst();
-  }
-}
-
-
-template<typename Record>
-bool UnboundQueue<Record>::IsEmpty() const {
-  return base::Relaxed_Load(&divider_) == base::Relaxed_Load(&last_);
-}
-
-
-template<typename Record>
-Record* UnboundQueue<Record>::Peek() const {
-  if (divider_ == base::Acquire_Load(&last_)) return nullptr;
-  Node* next = reinterpret_cast<Node*>(divider_)->next;
-  return &next->value;
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_PROFILER_UNBOUND_QUEUE_INL_H_
diff --git a/src/v8/src/profiler/unbound-queue.h b/src/v8/src/profiler/unbound-queue.h
deleted file mode 100644
index c53b35a..0000000
--- a/src/v8/src/profiler/unbound-queue.h
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2010 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_PROFILER_UNBOUND_QUEUE_
-#define V8_PROFILER_UNBOUND_QUEUE_
-
-#include "src/allocation.h"
-#include "src/base/atomicops.h"
-
-namespace v8 {
-namespace internal {
-
-
-// Lock-free unbound queue for small records.  Intended for
-// transferring small records between a Single producer and a Single
-// consumer. Doesn't have restrictions on the number of queued
-// elements, so producer never blocks.  Implemented after Herb
-// Sutter's article:
-// http://www.ddj.com/high-performance-computing/210604448
-template<typename Record>
-class UnboundQueue BASE_EMBEDDED {
- public:
-  inline UnboundQueue();
-  inline ~UnboundQueue();
-
-  INLINE(bool Dequeue(Record* rec));
-  INLINE(void Enqueue(const Record& rec));
-  INLINE(bool IsEmpty() const);
-  INLINE(Record* Peek() const);
-
- private:
-  INLINE(void DeleteFirst());
-
-  struct Node;
-
-  Node* first_;
-  base::AtomicWord divider_;  // Node*
-  base::AtomicWord last_;     // Node*
-
-  DISALLOW_COPY_AND_ASSIGN(UnboundQueue);
-};
-
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_PROFILER_UNBOUND_QUEUE_
diff --git a/src/v8/src/regexp/bytecodes-irregexp.h b/src/v8/src/regexp/bytecodes-irregexp.h
deleted file mode 100644
index 3848f15..0000000
--- a/src/v8/src/regexp/bytecodes-irregexp.h
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-
-#ifndef V8_REGEXP_BYTECODES_IRREGEXP_H_
-#define V8_REGEXP_BYTECODES_IRREGEXP_H_
-
-#ifdef V8_INTERPRETED_REGEXP
-
-namespace v8 {
-namespace internal {
-
-
-const int BYTECODE_MASK = 0xff;
-// The first argument is packed in with the byte code in one word, but so it
-// has 24 bits, but it can be positive and negative so only use 23 bits for
-// positive values.
-const unsigned int MAX_FIRST_ARG = 0x7fffffu;
-const int BYTECODE_SHIFT = 8;
-
-#define BYTECODE_ITERATOR(V)                                                   \
-  V(BREAK, 0, 4)              /* bc8                                        */ \
-  V(PUSH_CP, 1, 4)            /* bc8 pad24                                  */ \
-  V(PUSH_BT, 2, 8)            /* bc8 pad24 offset32                         */ \
-  V(PUSH_REGISTER, 3, 4)      /* bc8 reg_idx24                              */ \
-  V(SET_REGISTER_TO_CP, 4, 8) /* bc8 reg_idx24 offset32                     */ \
-  V(SET_CP_TO_REGISTER, 5, 4) /* bc8 reg_idx24                              */ \
-  V(SET_REGISTER_TO_SP, 6, 4) /* bc8 reg_idx24                              */ \
-  V(SET_SP_TO_REGISTER, 7, 4) /* bc8 reg_idx24                              */ \
-  V(SET_REGISTER, 8, 8)       /* bc8 reg_idx24 value32                      */ \
-  V(ADVANCE_REGISTER, 9, 8)   /* bc8 reg_idx24 value32                      */ \
-  V(POP_CP, 10, 4)            /* bc8 pad24                                  */ \
-  V(POP_BT, 11, 4)            /* bc8 pad24                                  */ \
-  V(POP_REGISTER, 12, 4)      /* bc8 reg_idx24                              */ \
-  V(FAIL, 13, 4)              /* bc8 pad24                                  */ \
-  V(SUCCEED, 14, 4)           /* bc8 pad24                                  */ \
-  V(ADVANCE_CP, 15, 4)        /* bc8 offset24                               */ \
-  V(GOTO, 16, 8)              /* bc8 pad24 addr32                           */ \
-  V(LOAD_CURRENT_CHAR, 17, 8) /* bc8 offset24 addr32                        */ \
-  V(LOAD_CURRENT_CHAR_UNCHECKED, 18, 4)    /* bc8 offset24 */                  \
-  V(LOAD_2_CURRENT_CHARS, 19, 8)           /* bc8 offset24 addr32 */           \
-  V(LOAD_2_CURRENT_CHARS_UNCHECKED, 20, 4) /* bc8 offset24 */                  \
-  V(LOAD_4_CURRENT_CHARS, 21, 8)           /* bc8 offset24 addr32 */           \
-  V(LOAD_4_CURRENT_CHARS_UNCHECKED, 22, 4) /* bc8 offset24 */                  \
-  V(CHECK_4_CHARS, 23, 12) /* bc8 pad24 uint32 addr32                    */    \
-  V(CHECK_CHAR, 24, 8)     /* bc8 pad8 uint16 addr32                     */    \
-  V(CHECK_NOT_4_CHARS, 25, 12) /* bc8 pad24 uint32 addr32 */                   \
-  V(CHECK_NOT_CHAR, 26, 8) /* bc8 pad8 uint16 addr32                     */    \
-  V(AND_CHECK_4_CHARS, 27, 16) /* bc8 pad24 uint32 uint32 addr32 */            \
-  V(AND_CHECK_CHAR, 28, 12) /* bc8 pad8 uint16 uint32 addr32              */   \
-  V(AND_CHECK_NOT_4_CHARS, 29, 16)    /* bc8 pad24 uint32 uint32 addr32 */     \
-  V(AND_CHECK_NOT_CHAR, 30, 12)       /* bc8 pad8 uint16 uint32 addr32 */      \
-  V(MINUS_AND_CHECK_NOT_CHAR, 31, 12) /* bc8 pad8 uc16 uc16 uc16 addr32 */     \
-  V(CHECK_CHAR_IN_RANGE, 32, 12)      /* bc8 pad24 uc16 uc16 addr32 */         \
-  V(CHECK_CHAR_NOT_IN_RANGE, 33, 12)  /* bc8 pad24 uc16 uc16 addr32 */         \
-  V(CHECK_BIT_IN_TABLE, 34, 24)       /* bc8 pad24 addr32 bits128 */           \
-  V(CHECK_LT, 35, 8) /* bc8 pad8 uc16 addr32                       */          \
-  V(CHECK_GT, 36, 8) /* bc8 pad8 uc16 addr32                       */          \
-  V(CHECK_NOT_BACK_REF, 37, 8)         /* bc8 reg_idx24 addr32 */              \
-  V(CHECK_NOT_BACK_REF_NO_CASE, 38, 8) /* bc8 reg_idx24 addr32 */              \
-  V(CHECK_NOT_BACK_REF_NO_CASE_UNICODE, 39, 8)                                 \
-  V(CHECK_NOT_BACK_REF_BACKWARD, 40, 8)         /* bc8 reg_idx24 addr32 */     \
-  V(CHECK_NOT_BACK_REF_NO_CASE_BACKWARD, 41, 8) /* bc8 reg_idx24 addr32 */     \
-  V(CHECK_NOT_BACK_REF_NO_CASE_UNICODE_BACKWARD, 42, 8)                        \
-  V(CHECK_NOT_REGS_EQUAL, 43, 12) /* bc8 regidx24 reg_idx32 addr32 */          \
-  V(CHECK_REGISTER_LT, 44, 12)    /* bc8 reg_idx24 value32 addr32 */           \
-  V(CHECK_REGISTER_GE, 45, 12)    /* bc8 reg_idx24 value32 addr32 */           \
-  V(CHECK_REGISTER_EQ_POS, 46, 8) /* bc8 reg_idx24 addr32 */                   \
-  V(CHECK_AT_START, 47, 8) /* bc8 pad24 addr32                           */    \
-  V(CHECK_NOT_AT_START, 48, 8) /* bc8 offset24 addr32 */                       \
-  V(CHECK_GREEDY, 49, 8) /* bc8 pad24 addr32                           */      \
-  V(ADVANCE_CP_AND_GOTO, 50, 8)           /* bc8 offset24 addr32 */            \
-  V(SET_CURRENT_POSITION_FROM_END, 51, 4) /* bc8 idx24 */
-
-#define DECLARE_BYTECODES(name, code, length) \
-  static const int BC_##name = code;
-BYTECODE_ITERATOR(DECLARE_BYTECODES)
-#undef DECLARE_BYTECODES
-
-#define DECLARE_BYTECODE_LENGTH(name, code, length) \
-  static const int BC_##name##_LENGTH = length;
-BYTECODE_ITERATOR(DECLARE_BYTECODE_LENGTH)
-#undef DECLARE_BYTECODE_LENGTH
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_INTERPRETED_REGEXP
-
-#endif  // V8_REGEXP_BYTECODES_IRREGEXP_H_
diff --git a/src/v8/src/regexp/interpreter-irregexp.cc b/src/v8/src/regexp/interpreter-irregexp.cc
deleted file mode 100644
index 7ba0280..0000000
--- a/src/v8/src/regexp/interpreter-irregexp.cc
+++ /dev/null
@@ -1,625 +0,0 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// A simple interpreter for the Irregexp byte code.
-
-#ifdef V8_INTERPRETED_REGEXP
-
-#include "src/regexp/interpreter-irregexp.h"
-
-#include "src/ast/ast.h"
-#include "src/objects-inl.h"
-#include "src/regexp/bytecodes-irregexp.h"
-#include "src/regexp/jsregexp.h"
-#include "src/regexp/regexp-macro-assembler.h"
-#include "src/unicode.h"
-#include "src/utils.h"
-
-#ifdef V8_INTL_SUPPORT
-#include "unicode/uchar.h"
-#endif  // V8_INTL_SUPPORT
-
-namespace v8 {
-namespace internal {
-
-typedef unibrow::Mapping<unibrow::Ecma262Canonicalize> Canonicalize;
-
-static bool BackRefMatchesNoCase(Isolate* isolate, int from, int current,
-                                 int len, Vector<const uc16> subject,
-                                 bool unicode) {
-  Address offset_a =
-      reinterpret_cast<Address>(const_cast<uc16*>(&subject.at(from)));
-  Address offset_b =
-      reinterpret_cast<Address>(const_cast<uc16*>(&subject.at(current)));
-  size_t length = len * kUC16Size;
-  return RegExpMacroAssembler::CaseInsensitiveCompareUC16(
-             offset_a, offset_b, length, unicode ? nullptr : isolate) == 1;
-}
-
-
-static bool BackRefMatchesNoCase(Isolate* isolate, int from, int current,
-                                 int len, Vector<const uint8_t> subject,
-                                 bool unicode) {
-  // For Latin1 characters the unicode flag makes no difference.
-  for (int i = 0; i < len; i++) {
-    unsigned int old_char = subject[from++];
-    unsigned int new_char = subject[current++];
-    if (old_char == new_char) continue;
-    // Convert both characters to lower case.
-    old_char |= 0x20;
-    new_char |= 0x20;
-    if (old_char != new_char) return false;
-    // Not letters in the ASCII range and Latin-1 range.
-    if (!(old_char - 'a' <= 'z' - 'a') &&
-        !(old_char - 224 <= 254 - 224 && old_char != 247)) {
-      return false;
-    }
-  }
-  return true;
-}
-
-
-#ifdef DEBUG
-static void TraceInterpreter(const byte* code_base,
-                             const byte* pc,
-                             int stack_depth,
-                             int current_position,
-                             uint32_t current_char,
-                             int bytecode_length,
-                             const char* bytecode_name) {
-  if (FLAG_trace_regexp_bytecodes) {
-    bool printable = (current_char < 127 && current_char >= 32);
-    const char* format =
-        printable ?
-        "pc = %02x, sp = %d, curpos = %d, curchar = %08x (%c), bc = %s" :
-        "pc = %02x, sp = %d, curpos = %d, curchar = %08x .%c., bc = %s";
-    PrintF(format,
-           pc - code_base,
-           stack_depth,
-           current_position,
-           current_char,
-           printable ? current_char : '.',
-           bytecode_name);
-    for (int i = 0; i < bytecode_length; i++) {
-      printf(", %02x", pc[i]);
-    }
-    printf(" ");
-    for (int i = 1; i < bytecode_length; i++) {
-      unsigned char b = pc[i];
-      if (b < 127 && b >= 32) {
-        printf("%c", b);
-      } else {
-        printf(".");
-      }
-    }
-    printf("\n");
-  }
-}
-
-
-#define BYTECODE(name)                                                      \
-  case BC_##name:                                                           \
-    TraceInterpreter(code_base,                                             \
-                     pc,                                                    \
-                     static_cast<int>(backtrack_sp - backtrack_stack_base), \
-                     current,                                               \
-                     current_char,                                          \
-                     BC_##name##_LENGTH,                                    \
-                     #name);
-#else
-#define BYTECODE(name)                                                      \
-  case BC_##name:
-#endif
-
-
-static int32_t Load32Aligned(const byte* pc) {
-  DCHECK_EQ(0, reinterpret_cast<intptr_t>(pc) & 3);
-  return *reinterpret_cast<const int32_t *>(pc);
-}
-
-
-static int32_t Load16Aligned(const byte* pc) {
-  DCHECK_EQ(0, reinterpret_cast<intptr_t>(pc) & 1);
-  return *reinterpret_cast<const uint16_t *>(pc);
-}
-
-
-// A simple abstraction over the backtracking stack used by the interpreter.
-// This backtracking stack does not grow automatically, but it ensures that the
-// the memory held by the stack is released or remembered in a cache if the
-// matching terminates.
-class BacktrackStack {
- public:
-  BacktrackStack() { data_ = NewArray<int>(kBacktrackStackSize); }
-
-  ~BacktrackStack() {
-    DeleteArray(data_);
-  }
-
-  int* data() const { return data_; }
-
-  int max_size() const { return kBacktrackStackSize; }
-
- private:
-  static const int kBacktrackStackSize = 10000;
-
-  int* data_;
-
-  DISALLOW_COPY_AND_ASSIGN(BacktrackStack);
-};
-
-
-template <typename Char>
-static RegExpImpl::IrregexpResult RawMatch(Isolate* isolate,
-                                           const byte* code_base,
-                                           Vector<const Char> subject,
-                                           int* registers,
-                                           int current,
-                                           uint32_t current_char) {
-  const byte* pc = code_base;
-  // BacktrackStack ensures that the memory allocated for the backtracking stack
-  // is returned to the system or cached if there is no stack being cached at
-  // the moment.
-  BacktrackStack backtrack_stack;
-  int* backtrack_stack_base = backtrack_stack.data();
-  int* backtrack_sp = backtrack_stack_base;
-  int backtrack_stack_space = backtrack_stack.max_size();
-#ifdef DEBUG
-  if (FLAG_trace_regexp_bytecodes) {
-    PrintF("\n\nStart bytecode interpreter\n\n");
-  }
-#endif
-  while (true) {
-    int32_t insn = Load32Aligned(pc);
-    switch (insn & BYTECODE_MASK) {
-      BYTECODE(BREAK)
-        UNREACHABLE();
-      BYTECODE(PUSH_CP)
-        if (--backtrack_stack_space < 0) {
-          return RegExpImpl::RE_EXCEPTION;
-        }
-        *backtrack_sp++ = current;
-        pc += BC_PUSH_CP_LENGTH;
-        break;
-      BYTECODE(PUSH_BT)
-        if (--backtrack_stack_space < 0) {
-          return RegExpImpl::RE_EXCEPTION;
-        }
-        *backtrack_sp++ = Load32Aligned(pc + 4);
-        pc += BC_PUSH_BT_LENGTH;
-        break;
-      BYTECODE(PUSH_REGISTER)
-        if (--backtrack_stack_space < 0) {
-          return RegExpImpl::RE_EXCEPTION;
-        }
-        *backtrack_sp++ = registers[insn >> BYTECODE_SHIFT];
-        pc += BC_PUSH_REGISTER_LENGTH;
-        break;
-      BYTECODE(SET_REGISTER)
-        registers[insn >> BYTECODE_SHIFT] = Load32Aligned(pc + 4);
-        pc += BC_SET_REGISTER_LENGTH;
-        break;
-      BYTECODE(ADVANCE_REGISTER)
-        registers[insn >> BYTECODE_SHIFT] += Load32Aligned(pc + 4);
-        pc += BC_ADVANCE_REGISTER_LENGTH;
-        break;
-      BYTECODE(SET_REGISTER_TO_CP)
-        registers[insn >> BYTECODE_SHIFT] = current + Load32Aligned(pc + 4);
-        pc += BC_SET_REGISTER_TO_CP_LENGTH;
-        break;
-      BYTECODE(SET_CP_TO_REGISTER)
-        current = registers[insn >> BYTECODE_SHIFT];
-        pc += BC_SET_CP_TO_REGISTER_LENGTH;
-        break;
-      BYTECODE(SET_REGISTER_TO_SP)
-        registers[insn >> BYTECODE_SHIFT] =
-            static_cast<int>(backtrack_sp - backtrack_stack_base);
-        pc += BC_SET_REGISTER_TO_SP_LENGTH;
-        break;
-      BYTECODE(SET_SP_TO_REGISTER)
-        backtrack_sp = backtrack_stack_base + registers[insn >> BYTECODE_SHIFT];
-        backtrack_stack_space = backtrack_stack.max_size() -
-            static_cast<int>(backtrack_sp - backtrack_stack_base);
-        pc += BC_SET_SP_TO_REGISTER_LENGTH;
-        break;
-      BYTECODE(POP_CP)
-        backtrack_stack_space++;
-        --backtrack_sp;
-        current = *backtrack_sp;
-        pc += BC_POP_CP_LENGTH;
-        break;
-      BYTECODE(POP_BT)
-        backtrack_stack_space++;
-        --backtrack_sp;
-        pc = code_base + *backtrack_sp;
-        break;
-      BYTECODE(POP_REGISTER)
-        backtrack_stack_space++;
-        --backtrack_sp;
-        registers[insn >> BYTECODE_SHIFT] = *backtrack_sp;
-        pc += BC_POP_REGISTER_LENGTH;
-        break;
-      BYTECODE(FAIL)
-        return RegExpImpl::RE_FAILURE;
-      BYTECODE(SUCCEED)
-        return RegExpImpl::RE_SUCCESS;
-      BYTECODE(ADVANCE_CP)
-        current += insn >> BYTECODE_SHIFT;
-        pc += BC_ADVANCE_CP_LENGTH;
-        break;
-      BYTECODE(GOTO)
-        pc = code_base + Load32Aligned(pc + 4);
-        break;
-      BYTECODE(ADVANCE_CP_AND_GOTO)
-        current += insn >> BYTECODE_SHIFT;
-        pc = code_base + Load32Aligned(pc + 4);
-        break;
-      BYTECODE(CHECK_GREEDY)
-        if (current == backtrack_sp[-1]) {
-          backtrack_sp--;
-          backtrack_stack_space++;
-          pc = code_base + Load32Aligned(pc + 4);
-        } else {
-          pc += BC_CHECK_GREEDY_LENGTH;
-        }
-        break;
-      BYTECODE(LOAD_CURRENT_CHAR) {
-        int pos = current + (insn >> BYTECODE_SHIFT);
-        if (pos >= subject.length() || pos < 0) {
-          pc = code_base + Load32Aligned(pc + 4);
-        } else {
-          current_char = subject[pos];
-          pc += BC_LOAD_CURRENT_CHAR_LENGTH;
-        }
-        break;
-      }
-      BYTECODE(LOAD_CURRENT_CHAR_UNCHECKED) {
-        int pos = current + (insn >> BYTECODE_SHIFT);
-        current_char = subject[pos];
-        pc += BC_LOAD_CURRENT_CHAR_UNCHECKED_LENGTH;
-        break;
-      }
-      BYTECODE(LOAD_2_CURRENT_CHARS) {
-        int pos = current + (insn >> BYTECODE_SHIFT);
-        if (pos + 2 > subject.length() || pos < 0) {
-          pc = code_base + Load32Aligned(pc + 4);
-        } else {
-          Char next = subject[pos + 1];
-          current_char =
-              (subject[pos] | (next << (kBitsPerByte * sizeof(Char))));
-          pc += BC_LOAD_2_CURRENT_CHARS_LENGTH;
-        }
-        break;
-      }
-      BYTECODE(LOAD_2_CURRENT_CHARS_UNCHECKED) {
-        int pos = current + (insn >> BYTECODE_SHIFT);
-        Char next = subject[pos + 1];
-        current_char = (subject[pos] | (next << (kBitsPerByte * sizeof(Char))));
-        pc += BC_LOAD_2_CURRENT_CHARS_UNCHECKED_LENGTH;
-        break;
-      }
-      BYTECODE(LOAD_4_CURRENT_CHARS) {
-        DCHECK_EQ(1, sizeof(Char));
-        int pos = current + (insn >> BYTECODE_SHIFT);
-        if (pos + 4 > subject.length() || pos < 0) {
-          pc = code_base + Load32Aligned(pc + 4);
-        } else {
-          Char next1 = subject[pos + 1];
-          Char next2 = subject[pos + 2];
-          Char next3 = subject[pos + 3];
-          current_char = (subject[pos] |
-                          (next1 << 8) |
-                          (next2 << 16) |
-                          (next3 << 24));
-          pc += BC_LOAD_4_CURRENT_CHARS_LENGTH;
-        }
-        break;
-      }
-      BYTECODE(LOAD_4_CURRENT_CHARS_UNCHECKED) {
-        DCHECK_EQ(1, sizeof(Char));
-        int pos = current + (insn >> BYTECODE_SHIFT);
-        Char next1 = subject[pos + 1];
-        Char next2 = subject[pos + 2];
-        Char next3 = subject[pos + 3];
-        current_char = (subject[pos] |
-                        (next1 << 8) |
-                        (next2 << 16) |
-                        (next3 << 24));
-        pc += BC_LOAD_4_CURRENT_CHARS_UNCHECKED_LENGTH;
-        break;
-      }
-      BYTECODE(CHECK_4_CHARS) {
-        uint32_t c = Load32Aligned(pc + 4);
-        if (c == current_char) {
-          pc = code_base + Load32Aligned(pc + 8);
-        } else {
-          pc += BC_CHECK_4_CHARS_LENGTH;
-        }
-        break;
-      }
-      BYTECODE(CHECK_CHAR) {
-        uint32_t c = (insn >> BYTECODE_SHIFT);
-        if (c == current_char) {
-          pc = code_base + Load32Aligned(pc + 4);
-        } else {
-          pc += BC_CHECK_CHAR_LENGTH;
-        }
-        break;
-      }
-      BYTECODE(CHECK_NOT_4_CHARS) {
-        uint32_t c = Load32Aligned(pc + 4);
-        if (c != current_char) {
-          pc = code_base + Load32Aligned(pc + 8);
-        } else {
-          pc += BC_CHECK_NOT_4_CHARS_LENGTH;
-        }
-        break;
-      }
-      BYTECODE(CHECK_NOT_CHAR) {
-        uint32_t c = (insn >> BYTECODE_SHIFT);
-        if (c != current_char) {
-          pc = code_base + Load32Aligned(pc + 4);
-        } else {
-          pc += BC_CHECK_NOT_CHAR_LENGTH;
-        }
-        break;
-      }
-      BYTECODE(AND_CHECK_4_CHARS) {
-        uint32_t c = Load32Aligned(pc + 4);
-        if (c == (current_char & Load32Aligned(pc + 8))) {
-          pc = code_base + Load32Aligned(pc + 12);
-        } else {
-          pc += BC_AND_CHECK_4_CHARS_LENGTH;
-        }
-        break;
-      }
-      BYTECODE(AND_CHECK_CHAR) {
-        uint32_t c = (insn >> BYTECODE_SHIFT);
-        if (c == (current_char & Load32Aligned(pc + 4))) {
-          pc = code_base + Load32Aligned(pc + 8);
-        } else {
-          pc += BC_AND_CHECK_CHAR_LENGTH;
-        }
-        break;
-      }
-      BYTECODE(AND_CHECK_NOT_4_CHARS) {
-        uint32_t c = Load32Aligned(pc + 4);
-        if (c != (current_char & Load32Aligned(pc + 8))) {
-          pc = code_base + Load32Aligned(pc + 12);
-        } else {
-          pc += BC_AND_CHECK_NOT_4_CHARS_LENGTH;
-        }
-        break;
-      }
-      BYTECODE(AND_CHECK_NOT_CHAR) {
-        uint32_t c = (insn >> BYTECODE_SHIFT);
-        if (c != (current_char & Load32Aligned(pc + 4))) {
-          pc = code_base + Load32Aligned(pc + 8);
-        } else {
-          pc += BC_AND_CHECK_NOT_CHAR_LENGTH;
-        }
-        break;
-      }
-      BYTECODE(MINUS_AND_CHECK_NOT_CHAR) {
-        uint32_t c = (insn >> BYTECODE_SHIFT);
-        uint32_t minus = Load16Aligned(pc + 4);
-        uint32_t mask = Load16Aligned(pc + 6);
-        if (c != ((current_char - minus) & mask)) {
-          pc = code_base + Load32Aligned(pc + 8);
-        } else {
-          pc += BC_MINUS_AND_CHECK_NOT_CHAR_LENGTH;
-        }
-        break;
-      }
-      BYTECODE(CHECK_CHAR_IN_RANGE) {
-        uint32_t from = Load16Aligned(pc + 4);
-        uint32_t to = Load16Aligned(pc + 6);
-        if (from <= current_char && current_char <= to) {
-          pc = code_base + Load32Aligned(pc + 8);
-        } else {
-          pc += BC_CHECK_CHAR_IN_RANGE_LENGTH;
-        }
-        break;
-      }
-      BYTECODE(CHECK_CHAR_NOT_IN_RANGE) {
-        uint32_t from = Load16Aligned(pc + 4);
-        uint32_t to = Load16Aligned(pc + 6);
-        if (from > current_char || current_char > to) {
-          pc = code_base + Load32Aligned(pc + 8);
-        } else {
-          pc += BC_CHECK_CHAR_NOT_IN_RANGE_LENGTH;
-        }
-        break;
-      }
-      BYTECODE(CHECK_BIT_IN_TABLE) {
-        int mask = RegExpMacroAssembler::kTableMask;
-        byte b = pc[8 + ((current_char & mask) >> kBitsPerByteLog2)];
-        int bit = (current_char & (kBitsPerByte - 1));
-        if ((b & (1 << bit)) != 0) {
-          pc = code_base + Load32Aligned(pc + 4);
-        } else {
-          pc += BC_CHECK_BIT_IN_TABLE_LENGTH;
-        }
-        break;
-      }
-      BYTECODE(CHECK_LT) {
-        uint32_t limit = (insn >> BYTECODE_SHIFT);
-        if (current_char < limit) {
-          pc = code_base + Load32Aligned(pc + 4);
-        } else {
-          pc += BC_CHECK_LT_LENGTH;
-        }
-        break;
-      }
-      BYTECODE(CHECK_GT) {
-        uint32_t limit = (insn >> BYTECODE_SHIFT);
-        if (current_char > limit) {
-          pc = code_base + Load32Aligned(pc + 4);
-        } else {
-          pc += BC_CHECK_GT_LENGTH;
-        }
-        break;
-      }
-      BYTECODE(CHECK_REGISTER_LT)
-        if (registers[insn >> BYTECODE_SHIFT] < Load32Aligned(pc + 4)) {
-          pc = code_base + Load32Aligned(pc + 8);
-        } else {
-          pc += BC_CHECK_REGISTER_LT_LENGTH;
-        }
-        break;
-      BYTECODE(CHECK_REGISTER_GE)
-        if (registers[insn >> BYTECODE_SHIFT] >= Load32Aligned(pc + 4)) {
-          pc = code_base + Load32Aligned(pc + 8);
-        } else {
-          pc += BC_CHECK_REGISTER_GE_LENGTH;
-        }
-        break;
-      BYTECODE(CHECK_REGISTER_EQ_POS)
-        if (registers[insn >> BYTECODE_SHIFT] == current) {
-          pc = code_base + Load32Aligned(pc + 4);
-        } else {
-          pc += BC_CHECK_REGISTER_EQ_POS_LENGTH;
-        }
-        break;
-      BYTECODE(CHECK_NOT_REGS_EQUAL)
-        if (registers[insn >> BYTECODE_SHIFT] ==
-            registers[Load32Aligned(pc + 4)]) {
-          pc += BC_CHECK_NOT_REGS_EQUAL_LENGTH;
-        } else {
-          pc = code_base + Load32Aligned(pc + 8);
-        }
-        break;
-      BYTECODE(CHECK_NOT_BACK_REF) {
-        int from = registers[insn >> BYTECODE_SHIFT];
-        int len = registers[(insn >> BYTECODE_SHIFT) + 1] - from;
-        if (from >= 0 && len > 0) {
-          if (current + len > subject.length() ||
-              CompareChars(&subject[from], &subject[current], len) != 0) {
-            pc = code_base + Load32Aligned(pc + 4);
-            break;
-          }
-          current += len;
-        }
-        pc += BC_CHECK_NOT_BACK_REF_LENGTH;
-        break;
-      }
-      BYTECODE(CHECK_NOT_BACK_REF_BACKWARD) {
-        int from = registers[insn >> BYTECODE_SHIFT];
-        int len = registers[(insn >> BYTECODE_SHIFT) + 1] - from;
-        if (from >= 0 && len > 0) {
-          if (current - len < 0 ||
-              CompareChars(&subject[from], &subject[current - len], len) != 0) {
-            pc = code_base + Load32Aligned(pc + 4);
-            break;
-          }
-          current -= len;
-        }
-        pc += BC_CHECK_NOT_BACK_REF_BACKWARD_LENGTH;
-        break;
-      }
-      BYTECODE(CHECK_NOT_BACK_REF_NO_CASE_UNICODE)
-      BYTECODE(CHECK_NOT_BACK_REF_NO_CASE) {
-        bool unicode =
-            (insn & BYTECODE_MASK) == BC_CHECK_NOT_BACK_REF_NO_CASE_UNICODE;
-        int from = registers[insn >> BYTECODE_SHIFT];
-        int len = registers[(insn >> BYTECODE_SHIFT) + 1] - from;
-        if (from >= 0 && len > 0) {
-          if (current + len > subject.length() ||
-              !BackRefMatchesNoCase(isolate, from, current, len, subject,
-                                    unicode)) {
-            pc = code_base + Load32Aligned(pc + 4);
-            break;
-          }
-          current += len;
-        }
-        pc += BC_CHECK_NOT_BACK_REF_NO_CASE_LENGTH;
-        break;
-      }
-      BYTECODE(CHECK_NOT_BACK_REF_NO_CASE_UNICODE_BACKWARD)
-      BYTECODE(CHECK_NOT_BACK_REF_NO_CASE_BACKWARD) {
-        bool unicode = (insn & BYTECODE_MASK) ==
-                       BC_CHECK_NOT_BACK_REF_NO_CASE_UNICODE_BACKWARD;
-        int from = registers[insn >> BYTECODE_SHIFT];
-        int len = registers[(insn >> BYTECODE_SHIFT) + 1] - from;
-        if (from >= 0 && len > 0) {
-          if (current - len < 0 ||
-              !BackRefMatchesNoCase(isolate, from, current - len, len, subject,
-                                    unicode)) {
-            pc = code_base + Load32Aligned(pc + 4);
-            break;
-          }
-          current -= len;
-        }
-        pc += BC_CHECK_NOT_BACK_REF_NO_CASE_BACKWARD_LENGTH;
-        break;
-      }
-      BYTECODE(CHECK_AT_START)
-        if (current == 0) {
-          pc = code_base + Load32Aligned(pc + 4);
-        } else {
-          pc += BC_CHECK_AT_START_LENGTH;
-        }
-        break;
-      BYTECODE(CHECK_NOT_AT_START)
-        if (current + (insn >> BYTECODE_SHIFT) == 0) {
-          pc += BC_CHECK_NOT_AT_START_LENGTH;
-        } else {
-          pc = code_base + Load32Aligned(pc + 4);
-        }
-        break;
-      BYTECODE(SET_CURRENT_POSITION_FROM_END) {
-        int by = static_cast<uint32_t>(insn) >> BYTECODE_SHIFT;
-        if (subject.length() - current > by) {
-          current = subject.length() - by;
-          current_char = subject[current - 1];
-        }
-        pc += BC_SET_CURRENT_POSITION_FROM_END_LENGTH;
-        break;
-      }
-      default:
-        UNREACHABLE();
-        break;
-    }
-  }
-}
-
-
-RegExpImpl::IrregexpResult IrregexpInterpreter::Match(
-    Isolate* isolate,
-    Handle<ByteArray> code_array,
-    Handle<String> subject,
-    int* registers,
-    int start_position) {
-  DCHECK(subject->IsFlat());
-
-  DisallowHeapAllocation no_gc;
-  const byte* code_base = code_array->GetDataStartAddress();
-  uc16 previous_char = '\n';
-  String::FlatContent subject_content = subject->GetFlatContent();
-  if (subject_content.IsOneByte()) {
-    Vector<const uint8_t> subject_vector = subject_content.ToOneByteVector();
-    if (start_position != 0) previous_char = subject_vector[start_position - 1];
-    return RawMatch(isolate,
-                    code_base,
-                    subject_vector,
-                    registers,
-                    start_position,
-                    previous_char);
-  } else {
-    DCHECK(subject_content.IsTwoByte());
-    Vector<const uc16> subject_vector = subject_content.ToUC16Vector();
-    if (start_position != 0) previous_char = subject_vector[start_position - 1];
-    return RawMatch(isolate,
-                    code_base,
-                    subject_vector,
-                    registers,
-                    start_position,
-                    previous_char);
-  }
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_INTERPRETED_REGEXP
diff --git a/src/v8/src/regexp/interpreter-irregexp.h b/src/v8/src/regexp/interpreter-irregexp.h
deleted file mode 100644
index 887fab6..0000000
--- a/src/v8/src/regexp/interpreter-irregexp.h
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// A simple interpreter for the Irregexp byte code.
-
-#ifndef V8_REGEXP_INTERPRETER_IRREGEXP_H_
-#define V8_REGEXP_INTERPRETER_IRREGEXP_H_
-
-#ifdef V8_INTERPRETED_REGEXP
-
-#include "src/regexp/jsregexp.h"
-
-namespace v8 {
-namespace internal {
-
-class IrregexpInterpreter {
- public:
-  static RegExpImpl::IrregexpResult Match(Isolate* isolate,
-                                          Handle<ByteArray> code,
-                                          Handle<String> subject,
-                                          int* captures,
-                                          int start_position);
-};
-
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_INTERPRETED_REGEXP
-
-#endif  // V8_REGEXP_INTERPRETER_IRREGEXP_H_
diff --git a/src/v8/src/regexp/jsregexp-inl.h b/src/v8/src/regexp/jsregexp-inl.h
deleted file mode 100644
index 1266da3..0000000
--- a/src/v8/src/regexp/jsregexp-inl.h
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-
-#ifndef V8_REGEXP_JSREGEXP_INL_H_
-#define V8_REGEXP_JSREGEXP_INL_H_
-
-#include "src/allocation.h"
-#include "src/objects.h"
-#include "src/regexp/jsregexp.h"
-
-namespace v8 {
-namespace internal {
-
-
-RegExpImpl::GlobalCache::~GlobalCache() {
-  // Deallocate the register array if we allocated it in the constructor
-  // (as opposed to using the existing jsregexp_static_offsets_vector).
-  if (register_array_size_ > Isolate::kJSRegexpStaticOffsetsVectorSize) {
-    DeleteArray(register_array_);
-  }
-}
-
-
-int32_t* RegExpImpl::GlobalCache::FetchNext() {
-  current_match_index_++;
-  if (current_match_index_ >= num_matches_) {
-    // Current batch of results exhausted.
-    // Fail if last batch was not even fully filled.
-    if (num_matches_ < max_matches_) {
-      num_matches_ = 0;  // Signal failed match.
-      return nullptr;
-    }
-
-    int32_t* last_match =
-        &register_array_[(current_match_index_ - 1) * registers_per_match_];
-    int last_end_index = last_match[1];
-
-    if (regexp_->TypeTag() == JSRegExp::ATOM) {
-      num_matches_ = RegExpImpl::AtomExecRaw(regexp_,
-                                             subject_,
-                                             last_end_index,
-                                             register_array_,
-                                             register_array_size_);
-    } else {
-      int last_start_index = last_match[0];
-      if (last_start_index == last_end_index) {
-        // Zero-length match. Advance by one code point.
-        last_end_index = AdvanceZeroLength(last_end_index);
-      }
-      if (last_end_index > subject_->length()) {
-        num_matches_ = 0;  // Signal failed match.
-        return nullptr;
-      }
-      num_matches_ = RegExpImpl::IrregexpExecRaw(regexp_,
-                                                 subject_,
-                                                 last_end_index,
-                                                 register_array_,
-                                                 register_array_size_);
-    }
-
-    if (num_matches_ <= 0) return nullptr;
-    current_match_index_ = 0;
-    return register_array_;
-  } else {
-    return &register_array_[current_match_index_ * registers_per_match_];
-  }
-}
-
-
-int32_t* RegExpImpl::GlobalCache::LastSuccessfulMatch() {
-  int index = current_match_index_ * registers_per_match_;
-  if (num_matches_ == 0) {
-    // After a failed match we shift back by one result.
-    index -= registers_per_match_;
-  }
-  return &register_array_[index];
-}
-
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_REGEXP_JSREGEXP_INL_H_
diff --git a/src/v8/src/regexp/jsregexp.cc b/src/v8/src/regexp/jsregexp.cc
deleted file mode 100644
index a26a1d7..0000000
--- a/src/v8/src/regexp/jsregexp.cc
+++ /dev/null
@@ -1,6910 +0,0 @@
-// Copyright 2012 the V8 project 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 "src/regexp/jsregexp.h"
-
-#include <memory>
-#include <vector>
-
-#include "src/base/platform/platform.h"
-#include "src/compilation-cache.h"
-#include "src/elements.h"
-#include "src/execution.h"
-#include "src/factory.h"
-#include "src/isolate-inl.h"
-#include "src/messages.h"
-#include "src/ostreams.h"
-#include "src/regexp/interpreter-irregexp.h"
-#include "src/regexp/jsregexp-inl.h"
-#include "src/regexp/regexp-macro-assembler-irregexp.h"
-#include "src/regexp/regexp-macro-assembler-tracer.h"
-#include "src/regexp/regexp-macro-assembler.h"
-#include "src/regexp/regexp-parser.h"
-#include "src/regexp/regexp-stack.h"
-#include "src/runtime/runtime.h"
-#include "src/splay-tree-inl.h"
-#include "src/string-search.h"
-#include "src/unicode-decoder.h"
-#include "src/unicode-inl.h"
-
-#ifdef V8_INTL_SUPPORT
-#include "unicode/uniset.h"
-#include "unicode/utypes.h"
-#endif  // V8_INTL_SUPPORT
-
-#ifndef V8_INTERPRETED_REGEXP
-#if V8_TARGET_ARCH_IA32
-#include "src/regexp/ia32/regexp-macro-assembler-ia32.h"
-#elif V8_TARGET_ARCH_X64
-#include "src/regexp/x64/regexp-macro-assembler-x64.h"
-#elif V8_TARGET_ARCH_ARM64
-#include "src/regexp/arm64/regexp-macro-assembler-arm64.h"
-#elif V8_TARGET_ARCH_ARM
-#include "src/regexp/arm/regexp-macro-assembler-arm.h"
-#elif V8_TARGET_ARCH_PPC
-#include "src/regexp/ppc/regexp-macro-assembler-ppc.h"
-#elif V8_TARGET_ARCH_S390
-#include "src/regexp/s390/regexp-macro-assembler-s390.h"
-#elif V8_TARGET_ARCH_MIPS
-#include "src/regexp/mips/regexp-macro-assembler-mips.h"
-#elif V8_TARGET_ARCH_MIPS64
-#include "src/regexp/mips64/regexp-macro-assembler-mips64.h"
-#else
-#error Unsupported target architecture.
-#endif
-#endif
-
-
-namespace v8 {
-namespace internal {
-
-MUST_USE_RESULT
-static inline MaybeHandle<Object> ThrowRegExpException(
-    Handle<JSRegExp> re, Handle<String> pattern, Handle<String> error_text) {
-  Isolate* isolate = re->GetIsolate();
-  THROW_NEW_ERROR(isolate, NewSyntaxError(MessageTemplate::kMalformedRegExp,
-                                          pattern, error_text),
-                  Object);
-}
-
-
-inline void ThrowRegExpException(Handle<JSRegExp> re,
-                                 Handle<String> error_text) {
-  USE(ThrowRegExpException(re, Handle<String>(re->Pattern()), error_text));
-}
-
-
-ContainedInLattice AddRange(ContainedInLattice containment,
-                            const int* ranges,
-                            int ranges_length,
-                            Interval new_range) {
-  DCHECK_EQ(1, ranges_length & 1);
-  DCHECK_EQ(String::kMaxCodePoint + 1, ranges[ranges_length - 1]);
-  if (containment == kLatticeUnknown) return containment;
-  bool inside = false;
-  int last = 0;
-  for (int i = 0; i < ranges_length; inside = !inside, last = ranges[i], i++) {
-    // Consider the range from last to ranges[i].
-    // We haven't got to the new range yet.
-    if (ranges[i] <= new_range.from()) continue;
-    // New range is wholly inside last-ranges[i].  Note that new_range.to() is
-    // inclusive, but the values in ranges are not.
-    if (last <= new_range.from() && new_range.to() < ranges[i]) {
-      return Combine(containment, inside ? kLatticeIn : kLatticeOut);
-    }
-    return kLatticeUnknown;
-  }
-  return containment;
-}
-
-// More makes code generation slower, less makes V8 benchmark score lower.
-const int kMaxLookaheadForBoyerMoore = 8;
-// In a 3-character pattern you can maximally step forwards 3 characters
-// at a time, which is not always enough to pay for the extra logic.
-const int kPatternTooShortForBoyerMoore = 2;
-
-// Identifies the sort of regexps where the regexp engine is faster
-// than the code used for atom matches.
-static bool HasFewDifferentCharacters(Handle<String> pattern) {
-  int length = Min(kMaxLookaheadForBoyerMoore, pattern->length());
-  if (length <= kPatternTooShortForBoyerMoore) return false;
-  const int kMod = 128;
-  bool character_found[kMod];
-  int different = 0;
-  memset(&character_found[0], 0, sizeof(character_found));
-  for (int i = 0; i < length; i++) {
-    int ch = (pattern->Get(i) & (kMod - 1));
-    if (!character_found[ch]) {
-      character_found[ch] = true;
-      different++;
-      // We declare a regexp low-alphabet if it has at least 3 times as many
-      // characters as it has different characters.
-      if (different * 3 > length) return false;
-    }
-  }
-  return true;
-}
-
-// Generic RegExp methods. Dispatches to implementation specific methods.
-
-MaybeHandle<Object> RegExpImpl::Compile(Handle<JSRegExp> re,
-                                        Handle<String> pattern,
-                                        JSRegExp::Flags flags) {
-  DCHECK(pattern->IsFlat());
-
-  Isolate* isolate = re->GetIsolate();
-  Zone zone(isolate->allocator(), ZONE_NAME);
-  CompilationCache* compilation_cache = isolate->compilation_cache();
-  MaybeHandle<FixedArray> maybe_cached =
-      compilation_cache->LookupRegExp(pattern, flags);
-  Handle<FixedArray> cached;
-  if (maybe_cached.ToHandle(&cached)) {
-    re->set_data(*cached);
-    return re;
-  }
-
-  PostponeInterruptsScope postpone(isolate);
-  RegExpCompileData parse_result;
-  FlatStringReader reader(isolate, pattern);
-  DCHECK(!isolate->has_pending_exception());
-  if (!RegExpParser::ParseRegExp(isolate, &zone, &reader, flags,
-                                 &parse_result)) {
-    // Throw an exception if we fail to parse the pattern.
-    return ThrowRegExpException(re, pattern, parse_result.error);
-  }
-
-  bool has_been_compiled = false;
-
-  if (parse_result.simple && !IgnoreCase(flags) && !IsSticky(flags) &&
-      !HasFewDifferentCharacters(pattern)) {
-    // Parse-tree is a single atom that is equal to the pattern.
-    AtomCompile(re, pattern, flags, pattern);
-    has_been_compiled = true;
-  } else if (parse_result.tree->IsAtom() && !IsSticky(flags) &&
-             parse_result.capture_count == 0) {
-    RegExpAtom* atom = parse_result.tree->AsAtom();
-    Vector<const uc16> atom_pattern = atom->data();
-    Handle<String> atom_string;
-    ASSIGN_RETURN_ON_EXCEPTION(
-        isolate, atom_string,
-        isolate->factory()->NewStringFromTwoByte(atom_pattern), Object);
-    if (!IgnoreCase(atom->flags()) && !HasFewDifferentCharacters(atom_string)) {
-      AtomCompile(re, pattern, flags, atom_string);
-      has_been_compiled = true;
-    }
-  }
-  if (!has_been_compiled) {
-    IrregexpInitialize(re, pattern, flags, parse_result.capture_count);
-  }
-  DCHECK(re->data()->IsFixedArray());
-  // Compilation succeeded so the data is set on the regexp
-  // and we can store it in the cache.
-  Handle<FixedArray> data(FixedArray::cast(re->data()));
-  compilation_cache->PutRegExp(pattern, flags, data);
-
-  return re;
-}
-
-MaybeHandle<Object> RegExpImpl::Exec(Handle<JSRegExp> regexp,
-                                     Handle<String> subject, int index,
-                                     Handle<RegExpMatchInfo> last_match_info) {
-  switch (regexp->TypeTag()) {
-    case JSRegExp::ATOM:
-      return AtomExec(regexp, subject, index, last_match_info);
-    case JSRegExp::IRREGEXP: {
-      return IrregexpExec(regexp, subject, index, last_match_info);
-    }
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-// RegExp Atom implementation: Simple string search using indexOf.
-
-
-void RegExpImpl::AtomCompile(Handle<JSRegExp> re,
-                             Handle<String> pattern,
-                             JSRegExp::Flags flags,
-                             Handle<String> match_pattern) {
-  re->GetIsolate()->factory()->SetRegExpAtomData(re,
-                                                 JSRegExp::ATOM,
-                                                 pattern,
-                                                 flags,
-                                                 match_pattern);
-}
-
-static void SetAtomLastCapture(Handle<RegExpMatchInfo> last_match_info,
-                               String* subject, int from, int to) {
-  SealHandleScope shs(last_match_info->GetIsolate());
-  last_match_info->SetNumberOfCaptureRegisters(2);
-  last_match_info->SetLastSubject(subject);
-  last_match_info->SetLastInput(subject);
-  last_match_info->SetCapture(0, from);
-  last_match_info->SetCapture(1, to);
-}
-
-
-int RegExpImpl::AtomExecRaw(Handle<JSRegExp> regexp,
-                            Handle<String> subject,
-                            int index,
-                            int32_t* output,
-                            int output_size) {
-  Isolate* isolate = regexp->GetIsolate();
-
-  DCHECK_LE(0, index);
-  DCHECK_LE(index, subject->length());
-
-  subject = String::Flatten(subject);
-  DisallowHeapAllocation no_gc;  // ensure vectors stay valid
-
-  String* needle = String::cast(regexp->DataAt(JSRegExp::kAtomPatternIndex));
-  int needle_len = needle->length();
-  DCHECK(needle->IsFlat());
-  DCHECK_LT(0, needle_len);
-
-  if (index + needle_len > subject->length()) {
-    return RegExpImpl::RE_FAILURE;
-  }
-
-  for (int i = 0; i < output_size; i += 2) {
-    String::FlatContent needle_content = needle->GetFlatContent();
-    String::FlatContent subject_content = subject->GetFlatContent();
-    DCHECK(needle_content.IsFlat());
-    DCHECK(subject_content.IsFlat());
-    // dispatch on type of strings
-    index =
-        (needle_content.IsOneByte()
-             ? (subject_content.IsOneByte()
-                    ? SearchString(isolate, subject_content.ToOneByteVector(),
-                                   needle_content.ToOneByteVector(), index)
-                    : SearchString(isolate, subject_content.ToUC16Vector(),
-                                   needle_content.ToOneByteVector(), index))
-             : (subject_content.IsOneByte()
-                    ? SearchString(isolate, subject_content.ToOneByteVector(),
-                                   needle_content.ToUC16Vector(), index)
-                    : SearchString(isolate, subject_content.ToUC16Vector(),
-                                   needle_content.ToUC16Vector(), index)));
-    if (index == -1) {
-      return i / 2;  // Return number of matches.
-    } else {
-      output[i] = index;
-      output[i+1] = index + needle_len;
-      index += needle_len;
-    }
-  }
-  return output_size / 2;
-}
-
-Handle<Object> RegExpImpl::AtomExec(Handle<JSRegExp> re, Handle<String> subject,
-                                    int index,
-                                    Handle<RegExpMatchInfo> last_match_info) {
-  Isolate* isolate = re->GetIsolate();
-
-  static const int kNumRegisters = 2;
-  STATIC_ASSERT(kNumRegisters <= Isolate::kJSRegexpStaticOffsetsVectorSize);
-  int32_t* output_registers = isolate->jsregexp_static_offsets_vector();
-
-  int res = AtomExecRaw(re, subject, index, output_registers, kNumRegisters);
-
-  if (res == RegExpImpl::RE_FAILURE) return isolate->factory()->null_value();
-
-  DCHECK_EQ(res, RegExpImpl::RE_SUCCESS);
-  SealHandleScope shs(isolate);
-  SetAtomLastCapture(last_match_info, *subject, output_registers[0],
-                     output_registers[1]);
-  return last_match_info;
-}
-
-
-// Irregexp implementation.
-
-// Ensures that the regexp object contains a compiled version of the
-// source for either one-byte or two-byte subject strings.
-// If the compiled version doesn't already exist, it is compiled
-// from the source pattern.
-// If compilation fails, an exception is thrown and this function
-// returns false.
-bool RegExpImpl::EnsureCompiledIrregexp(Handle<JSRegExp> re,
-                                        Handle<String> sample_subject,
-                                        bool is_one_byte) {
-  Object* compiled_code = re->DataAt(JSRegExp::code_index(is_one_byte));
-#ifdef V8_INTERPRETED_REGEXP
-  if (compiled_code->IsByteArray()) return true;
-#else  // V8_INTERPRETED_REGEXP (RegExp native code)
-  if (compiled_code->IsCode()) return true;
-#endif
-  return CompileIrregexp(re, sample_subject, is_one_byte);
-}
-
-
-bool RegExpImpl::CompileIrregexp(Handle<JSRegExp> re,
-                                 Handle<String> sample_subject,
-                                 bool is_one_byte) {
-  // Compile the RegExp.
-  Isolate* isolate = re->GetIsolate();
-  Zone zone(isolate->allocator(), ZONE_NAME);
-  PostponeInterruptsScope postpone(isolate);
-#ifdef DEBUG
-  Object* entry = re->DataAt(JSRegExp::code_index(is_one_byte));
-  // When arriving here entry can only be a smi representing an uncompiled
-  // regexp.
-  DCHECK(entry->IsSmi());
-  int entry_value = Smi::ToInt(entry);
-  DCHECK_EQ(JSRegExp::kUninitializedValue, entry_value);
-#endif
-
-  JSRegExp::Flags flags = re->GetFlags();
-
-  Handle<String> pattern(re->Pattern());
-  pattern = String::Flatten(pattern);
-  RegExpCompileData compile_data;
-  FlatStringReader reader(isolate, pattern);
-  if (!RegExpParser::ParseRegExp(isolate, &zone, &reader, flags,
-                                 &compile_data)) {
-    // Throw an exception if we fail to parse the pattern.
-    // THIS SHOULD NOT HAPPEN. We already pre-parsed it successfully once.
-    USE(ThrowRegExpException(re, pattern, compile_data.error));
-    return false;
-  }
-  RegExpEngine::CompilationResult result =
-      RegExpEngine::Compile(isolate, &zone, &compile_data, flags, pattern,
-                            sample_subject, is_one_byte);
-  if (result.error_message != nullptr) {
-    // Unable to compile regexp.
-    if (FLAG_abort_on_stack_or_string_length_overflow &&
-        strncmp(result.error_message, "Stack overflow", 15) == 0) {
-      FATAL("Aborting on stack overflow");
-    }
-    Handle<String> error_message = isolate->factory()->NewStringFromUtf8(
-        CStrVector(result.error_message)).ToHandleChecked();
-    ThrowRegExpException(re, error_message);
-    return false;
-  }
-
-  Handle<FixedArray> data = Handle<FixedArray>(FixedArray::cast(re->data()));
-  data->set(JSRegExp::code_index(is_one_byte), result.code);
-  SetIrregexpCaptureNameMap(*data, compile_data.capture_name_map);
-  int register_max = IrregexpMaxRegisterCount(*data);
-  if (result.num_registers > register_max) {
-    SetIrregexpMaxRegisterCount(*data, result.num_registers);
-  }
-
-  return true;
-}
-
-
-int RegExpImpl::IrregexpMaxRegisterCount(FixedArray* re) {
-  return Smi::cast(
-      re->get(JSRegExp::kIrregexpMaxRegisterCountIndex))->value();
-}
-
-
-void RegExpImpl::SetIrregexpMaxRegisterCount(FixedArray* re, int value) {
-  re->set(JSRegExp::kIrregexpMaxRegisterCountIndex, Smi::FromInt(value));
-}
-
-void RegExpImpl::SetIrregexpCaptureNameMap(FixedArray* re,
-                                           Handle<FixedArray> value) {
-  if (value.is_null()) {
-    re->set(JSRegExp::kIrregexpCaptureNameMapIndex, Smi::kZero);
-  } else {
-    re->set(JSRegExp::kIrregexpCaptureNameMapIndex, *value);
-  }
-}
-
-int RegExpImpl::IrregexpNumberOfCaptures(FixedArray* re) {
-  return Smi::ToInt(re->get(JSRegExp::kIrregexpCaptureCountIndex));
-}
-
-
-int RegExpImpl::IrregexpNumberOfRegisters(FixedArray* re) {
-  return Smi::ToInt(re->get(JSRegExp::kIrregexpMaxRegisterCountIndex));
-}
-
-
-ByteArray* RegExpImpl::IrregexpByteCode(FixedArray* re, bool is_one_byte) {
-  return ByteArray::cast(re->get(JSRegExp::code_index(is_one_byte)));
-}
-
-
-Code* RegExpImpl::IrregexpNativeCode(FixedArray* re, bool is_one_byte) {
-  return Code::cast(re->get(JSRegExp::code_index(is_one_byte)));
-}
-
-
-void RegExpImpl::IrregexpInitialize(Handle<JSRegExp> re,
-                                    Handle<String> pattern,
-                                    JSRegExp::Flags flags,
-                                    int capture_count) {
-  // Initialize compiled code entries to null.
-  re->GetIsolate()->factory()->SetRegExpIrregexpData(re,
-                                                     JSRegExp::IRREGEXP,
-                                                     pattern,
-                                                     flags,
-                                                     capture_count);
-}
-
-
-int RegExpImpl::IrregexpPrepare(Handle<JSRegExp> regexp,
-                                Handle<String> subject) {
-  DCHECK(subject->IsFlat());
-
-  // Check representation of the underlying storage.
-  bool is_one_byte = subject->IsOneByteRepresentationUnderneath();
-  if (!EnsureCompiledIrregexp(regexp, subject, is_one_byte)) return -1;
-
-#ifdef V8_INTERPRETED_REGEXP
-  // Byte-code regexp needs space allocated for all its registers.
-  // The result captures are copied to the start of the registers array
-  // if the match succeeds.  This way those registers are not clobbered
-  // when we set the last match info from last successful match.
-  return IrregexpNumberOfRegisters(FixedArray::cast(regexp->data())) +
-         (IrregexpNumberOfCaptures(FixedArray::cast(regexp->data())) + 1) * 2;
-#else  // V8_INTERPRETED_REGEXP
-  // Native regexp only needs room to output captures. Registers are handled
-  // internally.
-  return (IrregexpNumberOfCaptures(FixedArray::cast(regexp->data())) + 1) * 2;
-#endif  // V8_INTERPRETED_REGEXP
-}
-
-
-int RegExpImpl::IrregexpExecRaw(Handle<JSRegExp> regexp,
-                                Handle<String> subject,
-                                int index,
-                                int32_t* output,
-                                int output_size) {
-  Isolate* isolate = regexp->GetIsolate();
-
-  Handle<FixedArray> irregexp(FixedArray::cast(regexp->data()), isolate);
-
-  DCHECK_LE(0, index);
-  DCHECK_LE(index, subject->length());
-  DCHECK(subject->IsFlat());
-
-  bool is_one_byte = subject->IsOneByteRepresentationUnderneath();
-
-#ifndef V8_INTERPRETED_REGEXP
-  DCHECK(output_size >= (IrregexpNumberOfCaptures(*irregexp) + 1) * 2);
-  do {
-    EnsureCompiledIrregexp(regexp, subject, is_one_byte);
-    Handle<Code> code(IrregexpNativeCode(*irregexp, is_one_byte), isolate);
-    // The stack is used to allocate registers for the compiled regexp code.
-    // This means that in case of failure, the output registers array is left
-    // untouched and contains the capture results from the previous successful
-    // match.  We can use that to set the last match info lazily.
-    NativeRegExpMacroAssembler::Result res =
-        NativeRegExpMacroAssembler::Match(code,
-                                          subject,
-                                          output,
-                                          output_size,
-                                          index,
-                                          isolate);
-    if (res != NativeRegExpMacroAssembler::RETRY) {
-      DCHECK(res != NativeRegExpMacroAssembler::EXCEPTION ||
-             isolate->has_pending_exception());
-      STATIC_ASSERT(
-          static_cast<int>(NativeRegExpMacroAssembler::SUCCESS) == RE_SUCCESS);
-      STATIC_ASSERT(
-          static_cast<int>(NativeRegExpMacroAssembler::FAILURE) == RE_FAILURE);
-      STATIC_ASSERT(static_cast<int>(NativeRegExpMacroAssembler::EXCEPTION)
-                    == RE_EXCEPTION);
-      return static_cast<IrregexpResult>(res);
-    }
-    // If result is RETRY, the string has changed representation, and we
-    // must restart from scratch.
-    // In this case, it means we must make sure we are prepared to handle
-    // the, potentially, different subject (the string can switch between
-    // being internal and external, and even between being Latin1 and UC16,
-    // but the characters are always the same).
-    IrregexpPrepare(regexp, subject);
-    is_one_byte = subject->IsOneByteRepresentationUnderneath();
-  } while (true);
-  UNREACHABLE();
-#else  // V8_INTERPRETED_REGEXP
-
-  DCHECK(output_size >= IrregexpNumberOfRegisters(*irregexp));
-  // We must have done EnsureCompiledIrregexp, so we can get the number of
-  // registers.
-  int number_of_capture_registers =
-      (IrregexpNumberOfCaptures(*irregexp) + 1) * 2;
-  int32_t* raw_output = &output[number_of_capture_registers];
-  // We do not touch the actual capture result registers until we know there
-  // has been a match so that we can use those capture results to set the
-  // last match info.
-  for (int i = number_of_capture_registers - 1; i >= 0; i--) {
-    raw_output[i] = -1;
-  }
-  Handle<ByteArray> byte_codes(IrregexpByteCode(*irregexp, is_one_byte),
-                               isolate);
-
-  IrregexpResult result = IrregexpInterpreter::Match(isolate,
-                                                     byte_codes,
-                                                     subject,
-                                                     raw_output,
-                                                     index);
-  if (result == RE_SUCCESS) {
-    // Copy capture results to the start of the registers array.
-    MemCopy(output, raw_output, number_of_capture_registers * sizeof(int32_t));
-  }
-  if (result == RE_EXCEPTION) {
-    DCHECK(!isolate->has_pending_exception());
-    isolate->StackOverflow();
-  }
-  return result;
-#endif  // V8_INTERPRETED_REGEXP
-}
-
-MaybeHandle<Object> RegExpImpl::IrregexpExec(
-    Handle<JSRegExp> regexp, Handle<String> subject, int previous_index,
-    Handle<RegExpMatchInfo> last_match_info) {
-  Isolate* isolate = regexp->GetIsolate();
-  DCHECK_EQ(regexp->TypeTag(), JSRegExp::IRREGEXP);
-
-  subject = String::Flatten(subject);
-
-  // Prepare space for the return values.
-#if defined(V8_INTERPRETED_REGEXP) && defined(DEBUG)
-  if (FLAG_trace_regexp_bytecodes) {
-    String* pattern = regexp->Pattern();
-    PrintF("\n\nRegexp match:   /%s/\n\n", pattern->ToCString().get());
-    PrintF("\n\nSubject string: '%s'\n\n", subject->ToCString().get());
-  }
-#endif
-  int required_registers = RegExpImpl::IrregexpPrepare(regexp, subject);
-  if (required_registers < 0) {
-    // Compiling failed with an exception.
-    DCHECK(isolate->has_pending_exception());
-    return MaybeHandle<Object>();
-  }
-
-  int32_t* output_registers = nullptr;
-  if (required_registers > Isolate::kJSRegexpStaticOffsetsVectorSize) {
-    output_registers = NewArray<int32_t>(required_registers);
-  }
-  std::unique_ptr<int32_t[]> auto_release(output_registers);
-  if (output_registers == nullptr) {
-    output_registers = isolate->jsregexp_static_offsets_vector();
-  }
-
-  int res = RegExpImpl::IrregexpExecRaw(
-      regexp, subject, previous_index, output_registers, required_registers);
-  if (res == RE_SUCCESS) {
-    int capture_count =
-        IrregexpNumberOfCaptures(FixedArray::cast(regexp->data()));
-    return SetLastMatchInfo(
-        last_match_info, subject, capture_count, output_registers);
-  }
-  if (res == RE_EXCEPTION) {
-    DCHECK(isolate->has_pending_exception());
-    return MaybeHandle<Object>();
-  }
-  DCHECK(res == RE_FAILURE);
-  return isolate->factory()->null_value();
-}
-
-Handle<RegExpMatchInfo> RegExpImpl::SetLastMatchInfo(
-    Handle<RegExpMatchInfo> last_match_info, Handle<String> subject,
-    int capture_count, int32_t* match) {
-  // This is the only place where match infos can grow. If, after executing the
-  // regexp, RegExpExecStub finds that the match info is too small, it restarts
-  // execution in RegExpImpl::Exec, which finally grows the match info right
-  // here.
-
-  int capture_register_count = (capture_count + 1) * 2;
-  Handle<RegExpMatchInfo> result =
-      RegExpMatchInfo::ReserveCaptures(last_match_info, capture_register_count);
-  result->SetNumberOfCaptureRegisters(capture_register_count);
-
-  if (*result != *last_match_info) {
-    // The match info has been reallocated, update the corresponding reference
-    // on the native context.
-    Isolate* isolate = last_match_info->GetIsolate();
-    if (*last_match_info == *isolate->regexp_last_match_info()) {
-      isolate->native_context()->set_regexp_last_match_info(*result);
-    } else if (*last_match_info == *isolate->regexp_internal_match_info()) {
-      isolate->native_context()->set_regexp_internal_match_info(*result);
-    }
-  }
-
-  DisallowHeapAllocation no_allocation;
-  if (match != nullptr) {
-    for (int i = 0; i < capture_register_count; i += 2) {
-      result->SetCapture(i, match[i]);
-      result->SetCapture(i + 1, match[i + 1]);
-    }
-  }
-  result->SetLastSubject(*subject);
-  result->SetLastInput(*subject);
-  return result;
-}
-
-RegExpImpl::GlobalCache::GlobalCache(Handle<JSRegExp> regexp,
-                                     Handle<String> subject, Isolate* isolate)
-    : register_array_(nullptr),
-      register_array_size_(0),
-      regexp_(regexp),
-      subject_(subject) {
-#ifdef V8_INTERPRETED_REGEXP
-  bool interpreted = true;
-#else
-  bool interpreted = false;
-#endif  // V8_INTERPRETED_REGEXP
-
-  if (regexp_->TypeTag() == JSRegExp::ATOM) {
-    static const int kAtomRegistersPerMatch = 2;
-    registers_per_match_ = kAtomRegistersPerMatch;
-    // There is no distinction between interpreted and native for atom regexps.
-    interpreted = false;
-  } else {
-    registers_per_match_ = RegExpImpl::IrregexpPrepare(regexp_, subject_);
-    if (registers_per_match_ < 0) {
-      num_matches_ = -1;  // Signal exception.
-      return;
-    }
-  }
-
-  DCHECK(IsGlobal(regexp->GetFlags()));
-  if (!interpreted) {
-    register_array_size_ =
-        Max(registers_per_match_, Isolate::kJSRegexpStaticOffsetsVectorSize);
-    max_matches_ = register_array_size_ / registers_per_match_;
-  } else {
-    // Global loop in interpreted regexp is not implemented.  We choose
-    // the size of the offsets vector so that it can only store one match.
-    register_array_size_ = registers_per_match_;
-    max_matches_ = 1;
-  }
-
-  if (register_array_size_ > Isolate::kJSRegexpStaticOffsetsVectorSize) {
-    register_array_ = NewArray<int32_t>(register_array_size_);
-  } else {
-    register_array_ = isolate->jsregexp_static_offsets_vector();
-  }
-
-  // Set state so that fetching the results the first time triggers a call
-  // to the compiled regexp.
-  current_match_index_ = max_matches_ - 1;
-  num_matches_ = max_matches_;
-  DCHECK_LE(2, registers_per_match_);  // Each match has at least one capture.
-  DCHECK_GE(register_array_size_, registers_per_match_);
-  int32_t* last_match =
-      &register_array_[current_match_index_ * registers_per_match_];
-  last_match[0] = -1;
-  last_match[1] = 0;
-}
-
-int RegExpImpl::GlobalCache::AdvanceZeroLength(int last_index) {
-  if (IsUnicode(regexp_->GetFlags()) && last_index + 1 < subject_->length() &&
-      unibrow::Utf16::IsLeadSurrogate(subject_->Get(last_index)) &&
-      unibrow::Utf16::IsTrailSurrogate(subject_->Get(last_index + 1))) {
-    // Advance over the surrogate pair.
-    return last_index + 2;
-  }
-  return last_index + 1;
-}
-
-// -------------------------------------------------------------------
-// Implementation of the Irregexp regular expression engine.
-//
-// The Irregexp regular expression engine is intended to be a complete
-// implementation of ECMAScript regular expressions.  It generates either
-// bytecodes or native code.
-
-//   The Irregexp regexp engine is structured in three steps.
-//   1) The parser generates an abstract syntax tree.  See ast.cc.
-//   2) From the AST a node network is created.  The nodes are all
-//      subclasses of RegExpNode.  The nodes represent states when
-//      executing a regular expression.  Several optimizations are
-//      performed on the node network.
-//   3) From the nodes we generate either byte codes or native code
-//      that can actually execute the regular expression (perform
-//      the search).  The code generation step is described in more
-//      detail below.
-
-// Code generation.
-//
-//   The nodes are divided into four main categories.
-//   * Choice nodes
-//        These represent places where the regular expression can
-//        match in more than one way.  For example on entry to an
-//        alternation (foo|bar) or a repetition (*, +, ? or {}).
-//   * Action nodes
-//        These represent places where some action should be
-//        performed.  Examples include recording the current position
-//        in the input string to a register (in order to implement
-//        captures) or other actions on register for example in order
-//        to implement the counters needed for {} repetitions.
-//   * Matching nodes
-//        These attempt to match some element part of the input string.
-//        Examples of elements include character classes, plain strings
-//        or back references.
-//   * End nodes
-//        These are used to implement the actions required on finding
-//        a successful match or failing to find a match.
-//
-//   The code generated (whether as byte codes or native code) maintains
-//   some state as it runs.  This consists of the following elements:
-//
-//   * The capture registers.  Used for string captures.
-//   * Other registers.  Used for counters etc.
-//   * The current position.
-//   * The stack of backtracking information.  Used when a matching node
-//     fails to find a match and needs to try an alternative.
-//
-// Conceptual regular expression execution model:
-//
-//   There is a simple conceptual model of regular expression execution
-//   which will be presented first.  The actual code generated is a more
-//   efficient simulation of the simple conceptual model:
-//
-//   * Choice nodes are implemented as follows:
-//     For each choice except the last {
-//       push current position
-//       push backtrack code location
-//       <generate code to test for choice>
-//       backtrack code location:
-//       pop current position
-//     }
-//     <generate code to test for last choice>
-//
-//   * Actions nodes are generated as follows
-//     <push affected registers on backtrack stack>
-//     <generate code to perform action>
-//     push backtrack code location
-//     <generate code to test for following nodes>
-//     backtrack code location:
-//     <pop affected registers to restore their state>
-//     <pop backtrack location from stack and go to it>
-//
-//   * Matching nodes are generated as follows:
-//     if input string matches at current position
-//       update current position
-//       <generate code to test for following nodes>
-//     else
-//       <pop backtrack location from stack and go to it>
-//
-//   Thus it can be seen that the current position is saved and restored
-//   by the choice nodes, whereas the registers are saved and restored by
-//   by the action nodes that manipulate them.
-//
-//   The other interesting aspect of this model is that nodes are generated
-//   at the point where they are needed by a recursive call to Emit().  If
-//   the node has already been code generated then the Emit() call will
-//   generate a jump to the previously generated code instead.  In order to
-//   limit recursion it is possible for the Emit() function to put the node
-//   on a work list for later generation and instead generate a jump.  The
-//   destination of the jump is resolved later when the code is generated.
-//
-// Actual regular expression code generation.
-//
-//   Code generation is actually more complicated than the above.  In order
-//   to improve the efficiency of the generated code some optimizations are
-//   performed
-//
-//   * Choice nodes have 1-character lookahead.
-//     A choice node looks at the following character and eliminates some of
-//     the choices immediately based on that character.  This is not yet
-//     implemented.
-//   * Simple greedy loops store reduced backtracking information.
-//     A quantifier like /.*foo/m will greedily match the whole input.  It will
-//     then need to backtrack to a point where it can match "foo".  The naive
-//     implementation of this would push each character position onto the
-//     backtracking stack, then pop them off one by one.  This would use space
-//     proportional to the length of the input string.  However since the "."
-//     can only match in one way and always has a constant length (in this case
-//     of 1) it suffices to store the current position on the top of the stack
-//     once.  Matching now becomes merely incrementing the current position and
-//     backtracking becomes decrementing the current position and checking the
-//     result against the stored current position.  This is faster and saves
-//     space.
-//   * The current state is virtualized.
-//     This is used to defer expensive operations until it is clear that they
-//     are needed and to generate code for a node more than once, allowing
-//     specialized an efficient versions of the code to be created. This is
-//     explained in the section below.
-//
-// Execution state virtualization.
-//
-//   Instead of emitting code, nodes that manipulate the state can record their
-//   manipulation in an object called the Trace.  The Trace object can record a
-//   current position offset, an optional backtrack code location on the top of
-//   the virtualized backtrack stack and some register changes.  When a node is
-//   to be emitted it can flush the Trace or update it.  Flushing the Trace
-//   will emit code to bring the actual state into line with the virtual state.
-//   Avoiding flushing the state can postpone some work (e.g. updates of capture
-//   registers).  Postponing work can save time when executing the regular
-//   expression since it may be found that the work never has to be done as a
-//   failure to match can occur.  In addition it is much faster to jump to a
-//   known backtrack code location than it is to pop an unknown backtrack
-//   location from the stack and jump there.
-//
-//   The virtual state found in the Trace affects code generation.  For example
-//   the virtual state contains the difference between the actual current
-//   position and the virtual current position, and matching code needs to use
-//   this offset to attempt a match in the correct location of the input
-//   string.  Therefore code generated for a non-trivial trace is specialized
-//   to that trace.  The code generator therefore has the ability to generate
-//   code for each node several times.  In order to limit the size of the
-//   generated code there is an arbitrary limit on how many specialized sets of
-//   code may be generated for a given node.  If the limit is reached, the
-//   trace is flushed and a generic version of the code for a node is emitted.
-//   This is subsequently used for that node.  The code emitted for non-generic
-//   trace is not recorded in the node and so it cannot currently be reused in
-//   the event that code generation is requested for an identical trace.
-
-
-void RegExpTree::AppendToText(RegExpText* text, Zone* zone) {
-  UNREACHABLE();
-}
-
-
-void RegExpAtom::AppendToText(RegExpText* text, Zone* zone) {
-  text->AddElement(TextElement::Atom(this), zone);
-}
-
-
-void RegExpCharacterClass::AppendToText(RegExpText* text, Zone* zone) {
-  text->AddElement(TextElement::CharClass(this), zone);
-}
-
-
-void RegExpText::AppendToText(RegExpText* text, Zone* zone) {
-  for (int i = 0; i < elements()->length(); i++)
-    text->AddElement(elements()->at(i), zone);
-}
-
-
-TextElement TextElement::Atom(RegExpAtom* atom) {
-  return TextElement(ATOM, atom);
-}
-
-
-TextElement TextElement::CharClass(RegExpCharacterClass* char_class) {
-  return TextElement(CHAR_CLASS, char_class);
-}
-
-
-int TextElement::length() const {
-  switch (text_type()) {
-    case ATOM:
-      return atom()->length();
-
-    case CHAR_CLASS:
-      return 1;
-  }
-  UNREACHABLE();
-}
-
-
-DispatchTable* ChoiceNode::GetTable(bool ignore_case) {
-  if (table_ == nullptr) {
-    table_ = new(zone()) DispatchTable(zone());
-    DispatchTableConstructor cons(table_, ignore_case, zone());
-    cons.BuildTable(this);
-  }
-  return table_;
-}
-
-
-class FrequencyCollator {
- public:
-  FrequencyCollator() : total_samples_(0) {
-    for (int i = 0; i < RegExpMacroAssembler::kTableSize; i++) {
-      frequencies_[i] = CharacterFrequency(i);
-    }
-  }
-
-  void CountCharacter(int character) {
-    int index = (character & RegExpMacroAssembler::kTableMask);
-    frequencies_[index].Increment();
-    total_samples_++;
-  }
-
-  // Does not measure in percent, but rather per-128 (the table size from the
-  // regexp macro assembler).
-  int Frequency(int in_character) {
-    DCHECK((in_character & RegExpMacroAssembler::kTableMask) == in_character);
-    if (total_samples_ < 1) return 1;  // Division by zero.
-    int freq_in_per128 =
-        (frequencies_[in_character].counter() * 128) / total_samples_;
-    return freq_in_per128;
-  }
-
- private:
-  class CharacterFrequency {
-   public:
-    CharacterFrequency() : counter_(0), character_(-1) { }
-    explicit CharacterFrequency(int character)
-        : counter_(0), character_(character) { }
-
-    void Increment() { counter_++; }
-    int counter() { return counter_; }
-    int character() { return character_; }
-
-   private:
-    int counter_;
-    int character_;
-  };
-
-
- private:
-  CharacterFrequency frequencies_[RegExpMacroAssembler::kTableSize];
-  int total_samples_;
-};
-
-
-class RegExpCompiler {
- public:
-  RegExpCompiler(Isolate* isolate, Zone* zone, int capture_count,
-                 bool is_one_byte);
-
-  int AllocateRegister() {
-    if (next_register_ >= RegExpMacroAssembler::kMaxRegister) {
-      reg_exp_too_big_ = true;
-      return next_register_;
-    }
-    return next_register_++;
-  }
-
-  // Lookarounds to match lone surrogates for unicode character class matches
-  // are never nested. We can therefore reuse registers.
-  int UnicodeLookaroundStackRegister() {
-    if (unicode_lookaround_stack_register_ == kNoRegister) {
-      unicode_lookaround_stack_register_ = AllocateRegister();
-    }
-    return unicode_lookaround_stack_register_;
-  }
-
-  int UnicodeLookaroundPositionRegister() {
-    if (unicode_lookaround_position_register_ == kNoRegister) {
-      unicode_lookaround_position_register_ = AllocateRegister();
-    }
-    return unicode_lookaround_position_register_;
-  }
-
-  RegExpEngine::CompilationResult Assemble(RegExpMacroAssembler* assembler,
-                                           RegExpNode* start,
-                                           int capture_count,
-                                           Handle<String> pattern);
-
-  inline void AddWork(RegExpNode* node) {
-    if (!node->on_work_list() && !node->label()->is_bound()) {
-      node->set_on_work_list(true);
-      work_list_->push_back(node);
-    }
-  }
-
-  static const int kImplementationOffset = 0;
-  static const int kNumberOfRegistersOffset = 0;
-  static const int kCodeOffset = 1;
-
-  RegExpMacroAssembler* macro_assembler() { return macro_assembler_; }
-  EndNode* accept() { return accept_; }
-
-  static const int kMaxRecursion = 100;
-  inline int recursion_depth() { return recursion_depth_; }
-  inline void IncrementRecursionDepth() { recursion_depth_++; }
-  inline void DecrementRecursionDepth() { recursion_depth_--; }
-
-  void SetRegExpTooBig() { reg_exp_too_big_ = true; }
-
-  inline bool one_byte() { return one_byte_; }
-  inline bool optimize() { return optimize_; }
-  inline void set_optimize(bool value) { optimize_ = value; }
-  inline bool limiting_recursion() { return limiting_recursion_; }
-  inline void set_limiting_recursion(bool value) {
-    limiting_recursion_ = value;
-  }
-  bool read_backward() { return read_backward_; }
-  void set_read_backward(bool value) { read_backward_ = value; }
-  FrequencyCollator* frequency_collator() { return &frequency_collator_; }
-
-  int current_expansion_factor() { return current_expansion_factor_; }
-  void set_current_expansion_factor(int value) {
-    current_expansion_factor_ = value;
-  }
-
-  Isolate* isolate() const { return isolate_; }
-  Zone* zone() const { return zone_; }
-
-  static const int kNoRegister = -1;
-
- private:
-  EndNode* accept_;
-  int next_register_;
-  int unicode_lookaround_stack_register_;
-  int unicode_lookaround_position_register_;
-  std::vector<RegExpNode*>* work_list_;
-  int recursion_depth_;
-  RegExpMacroAssembler* macro_assembler_;
-  bool one_byte_;
-  bool reg_exp_too_big_;
-  bool limiting_recursion_;
-  bool optimize_;
-  bool read_backward_;
-  int current_expansion_factor_;
-  FrequencyCollator frequency_collator_;
-  Isolate* isolate_;
-  Zone* zone_;
-};
-
-
-class RecursionCheck {
- public:
-  explicit RecursionCheck(RegExpCompiler* compiler) : compiler_(compiler) {
-    compiler->IncrementRecursionDepth();
-  }
-  ~RecursionCheck() { compiler_->DecrementRecursionDepth(); }
- private:
-  RegExpCompiler* compiler_;
-};
-
-
-static RegExpEngine::CompilationResult IrregexpRegExpTooBig(Isolate* isolate) {
-  return RegExpEngine::CompilationResult(isolate, "RegExp too big");
-}
-
-
-// Attempts to compile the regexp using an Irregexp code generator.  Returns
-// a fixed array or a null handle depending on whether it succeeded.
-RegExpCompiler::RegExpCompiler(Isolate* isolate, Zone* zone, int capture_count,
-                               bool one_byte)
-    : next_register_(2 * (capture_count + 1)),
-      unicode_lookaround_stack_register_(kNoRegister),
-      unicode_lookaround_position_register_(kNoRegister),
-      work_list_(nullptr),
-      recursion_depth_(0),
-      one_byte_(one_byte),
-      reg_exp_too_big_(false),
-      limiting_recursion_(false),
-      optimize_(FLAG_regexp_optimization),
-      read_backward_(false),
-      current_expansion_factor_(1),
-      frequency_collator_(),
-      isolate_(isolate),
-      zone_(zone) {
-  accept_ = new(zone) EndNode(EndNode::ACCEPT, zone);
-  DCHECK_GE(RegExpMacroAssembler::kMaxRegister, next_register_ - 1);
-}
-
-
-RegExpEngine::CompilationResult RegExpCompiler::Assemble(
-    RegExpMacroAssembler* macro_assembler,
-    RegExpNode* start,
-    int capture_count,
-    Handle<String> pattern) {
-  Isolate* isolate = pattern->GetHeap()->isolate();
-
-#ifdef DEBUG
-  if (FLAG_trace_regexp_assembler)
-    macro_assembler_ = new RegExpMacroAssemblerTracer(isolate, macro_assembler);
-  else
-#endif
-    macro_assembler_ = macro_assembler;
-
-  std::vector<RegExpNode*> work_list;
-  work_list_ = &work_list;
-  Label fail;
-  macro_assembler_->PushBacktrack(&fail);
-  Trace new_trace;
-  start->Emit(this, &new_trace);
-  macro_assembler_->Bind(&fail);
-  macro_assembler_->Fail();
-  while (!work_list.empty()) {
-    RegExpNode* node = work_list.back();
-    work_list.pop_back();
-    node->set_on_work_list(false);
-    if (!node->label()->is_bound()) node->Emit(this, &new_trace);
-  }
-  if (reg_exp_too_big_) {
-    macro_assembler_->AbortedCodeGeneration();
-    return IrregexpRegExpTooBig(isolate_);
-  }
-
-  Handle<HeapObject> code = macro_assembler_->GetCode(pattern);
-  isolate->IncreaseTotalRegexpCodeGenerated(code->Size());
-  work_list_ = nullptr;
-#if defined(ENABLE_DISASSEMBLER) && !defined(V8_INTERPRETED_REGEXP)
-  if (FLAG_print_code) {
-    CodeTracer::Scope trace_scope(isolate->GetCodeTracer());
-    OFStream os(trace_scope.file());
-    Handle<Code>::cast(code)->Disassemble(pattern->ToCString().get(), os);
-  }
-#endif
-#ifdef DEBUG
-  if (FLAG_trace_regexp_assembler) {
-    delete macro_assembler_;
-  }
-#endif
-  return RegExpEngine::CompilationResult(*code, next_register_);
-}
-
-
-bool Trace::DeferredAction::Mentions(int that) {
-  if (action_type() == ActionNode::CLEAR_CAPTURES) {
-    Interval range = static_cast<DeferredClearCaptures*>(this)->range();
-    return range.Contains(that);
-  } else {
-    return reg() == that;
-  }
-}
-
-
-bool Trace::mentions_reg(int reg) {
-  for (DeferredAction* action = actions_; action != nullptr;
-       action = action->next()) {
-    if (action->Mentions(reg))
-      return true;
-  }
-  return false;
-}
-
-
-bool Trace::GetStoredPosition(int reg, int* cp_offset) {
-  DCHECK_EQ(0, *cp_offset);
-  for (DeferredAction* action = actions_; action != nullptr;
-       action = action->next()) {
-    if (action->Mentions(reg)) {
-      if (action->action_type() == ActionNode::STORE_POSITION) {
-        *cp_offset = static_cast<DeferredCapture*>(action)->cp_offset();
-        return true;
-      } else {
-        return false;
-      }
-    }
-  }
-  return false;
-}
-
-
-int Trace::FindAffectedRegisters(OutSet* affected_registers,
-                                 Zone* zone) {
-  int max_register = RegExpCompiler::kNoRegister;
-  for (DeferredAction* action = actions_; action != nullptr;
-       action = action->next()) {
-    if (action->action_type() == ActionNode::CLEAR_CAPTURES) {
-      Interval range = static_cast<DeferredClearCaptures*>(action)->range();
-      for (int i = range.from(); i <= range.to(); i++)
-        affected_registers->Set(i, zone);
-      if (range.to() > max_register) max_register = range.to();
-    } else {
-      affected_registers->Set(action->reg(), zone);
-      if (action->reg() > max_register) max_register = action->reg();
-    }
-  }
-  return max_register;
-}
-
-
-void Trace::RestoreAffectedRegisters(RegExpMacroAssembler* assembler,
-                                     int max_register,
-                                     const OutSet& registers_to_pop,
-                                     const OutSet& registers_to_clear) {
-  for (int reg = max_register; reg >= 0; reg--) {
-    if (registers_to_pop.Get(reg)) {
-      assembler->PopRegister(reg);
-    } else if (registers_to_clear.Get(reg)) {
-      int clear_to = reg;
-      while (reg > 0 && registers_to_clear.Get(reg - 1)) {
-        reg--;
-      }
-      assembler->ClearRegisters(reg, clear_to);
-    }
-  }
-}
-
-
-void Trace::PerformDeferredActions(RegExpMacroAssembler* assembler,
-                                   int max_register,
-                                   const OutSet& affected_registers,
-                                   OutSet* registers_to_pop,
-                                   OutSet* registers_to_clear,
-                                   Zone* zone) {
-  // The "+1" is to avoid a push_limit of zero if stack_limit_slack() is 1.
-  const int push_limit = (assembler->stack_limit_slack() + 1) / 2;
-
-  // Count pushes performed to force a stack limit check occasionally.
-  int pushes = 0;
-
-  for (int reg = 0; reg <= max_register; reg++) {
-    if (!affected_registers.Get(reg)) {
-      continue;
-    }
-
-    // The chronologically first deferred action in the trace
-    // is used to infer the action needed to restore a register
-    // to its previous state (or not, if it's safe to ignore it).
-    enum DeferredActionUndoType { IGNORE, RESTORE, CLEAR };
-    DeferredActionUndoType undo_action = IGNORE;
-
-    int value = 0;
-    bool absolute = false;
-    bool clear = false;
-    static const int kNoStore = kMinInt;
-    int store_position = kNoStore;
-    // This is a little tricky because we are scanning the actions in reverse
-    // historical order (newest first).
-    for (DeferredAction* action = actions_; action != nullptr;
-         action = action->next()) {
-      if (action->Mentions(reg)) {
-        switch (action->action_type()) {
-          case ActionNode::SET_REGISTER: {
-            Trace::DeferredSetRegister* psr =
-                static_cast<Trace::DeferredSetRegister*>(action);
-            if (!absolute) {
-              value += psr->value();
-              absolute = true;
-            }
-            // SET_REGISTER is currently only used for newly introduced loop
-            // counters. They can have a significant previous value if they
-            // occur in a loop. TODO(lrn): Propagate this information, so
-            // we can set undo_action to IGNORE if we know there is no value to
-            // restore.
-            undo_action = RESTORE;
-            DCHECK_EQ(store_position, kNoStore);
-            DCHECK(!clear);
-            break;
-          }
-          case ActionNode::INCREMENT_REGISTER:
-            if (!absolute) {
-              value++;
-            }
-            DCHECK_EQ(store_position, kNoStore);
-            DCHECK(!clear);
-            undo_action = RESTORE;
-            break;
-          case ActionNode::STORE_POSITION: {
-            Trace::DeferredCapture* pc =
-                static_cast<Trace::DeferredCapture*>(action);
-            if (!clear && store_position == kNoStore) {
-              store_position = pc->cp_offset();
-            }
-
-            // For captures we know that stores and clears alternate.
-            // Other register, are never cleared, and if the occur
-            // inside a loop, they might be assigned more than once.
-            if (reg <= 1) {
-              // Registers zero and one, aka "capture zero", is
-              // always set correctly if we succeed. There is no
-              // need to undo a setting on backtrack, because we
-              // will set it again or fail.
-              undo_action = IGNORE;
-            } else {
-              undo_action = pc->is_capture() ? CLEAR : RESTORE;
-            }
-            DCHECK(!absolute);
-            DCHECK_EQ(value, 0);
-            break;
-          }
-          case ActionNode::CLEAR_CAPTURES: {
-            // Since we're scanning in reverse order, if we've already
-            // set the position we have to ignore historically earlier
-            // clearing operations.
-            if (store_position == kNoStore) {
-              clear = true;
-            }
-            undo_action = RESTORE;
-            DCHECK(!absolute);
-            DCHECK_EQ(value, 0);
-            break;
-          }
-          default:
-            UNREACHABLE();
-            break;
-        }
-      }
-    }
-    // Prepare for the undo-action (e.g., push if it's going to be popped).
-    if (undo_action == RESTORE) {
-      pushes++;
-      RegExpMacroAssembler::StackCheckFlag stack_check =
-          RegExpMacroAssembler::kNoStackLimitCheck;
-      if (pushes == push_limit) {
-        stack_check = RegExpMacroAssembler::kCheckStackLimit;
-        pushes = 0;
-      }
-
-      assembler->PushRegister(reg, stack_check);
-      registers_to_pop->Set(reg, zone);
-    } else if (undo_action == CLEAR) {
-      registers_to_clear->Set(reg, zone);
-    }
-    // Perform the chronologically last action (or accumulated increment)
-    // for the register.
-    if (store_position != kNoStore) {
-      assembler->WriteCurrentPositionToRegister(reg, store_position);
-    } else if (clear) {
-      assembler->ClearRegisters(reg, reg);
-    } else if (absolute) {
-      assembler->SetRegister(reg, value);
-    } else if (value != 0) {
-      assembler->AdvanceRegister(reg, value);
-    }
-  }
-}
-
-
-// This is called as we come into a loop choice node and some other tricky
-// nodes.  It normalizes the state of the code generator to ensure we can
-// generate generic code.
-void Trace::Flush(RegExpCompiler* compiler, RegExpNode* successor) {
-  RegExpMacroAssembler* assembler = compiler->macro_assembler();
-
-  DCHECK(!is_trivial());
-
-  if (actions_ == nullptr && backtrack() == nullptr) {
-    // Here we just have some deferred cp advances to fix and we are back to
-    // a normal situation.  We may also have to forget some information gained
-    // through a quick check that was already performed.
-    if (cp_offset_ != 0) assembler->AdvanceCurrentPosition(cp_offset_);
-    // Create a new trivial state and generate the node with that.
-    Trace new_state;
-    successor->Emit(compiler, &new_state);
-    return;
-  }
-
-  // Generate deferred actions here along with code to undo them again.
-  OutSet affected_registers;
-
-  if (backtrack() != nullptr) {
-    // Here we have a concrete backtrack location.  These are set up by choice
-    // nodes and so they indicate that we have a deferred save of the current
-    // position which we may need to emit here.
-    assembler->PushCurrentPosition();
-  }
-
-  int max_register = FindAffectedRegisters(&affected_registers,
-                                           compiler->zone());
-  OutSet registers_to_pop;
-  OutSet registers_to_clear;
-  PerformDeferredActions(assembler,
-                         max_register,
-                         affected_registers,
-                         &registers_to_pop,
-                         &registers_to_clear,
-                         compiler->zone());
-  if (cp_offset_ != 0) {
-    assembler->AdvanceCurrentPosition(cp_offset_);
-  }
-
-  // Create a new trivial state and generate the node with that.
-  Label undo;
-  assembler->PushBacktrack(&undo);
-  if (successor->KeepRecursing(compiler)) {
-    Trace new_state;
-    successor->Emit(compiler, &new_state);
-  } else {
-    compiler->AddWork(successor);
-    assembler->GoTo(successor->label());
-  }
-
-  // On backtrack we need to restore state.
-  assembler->Bind(&undo);
-  RestoreAffectedRegisters(assembler,
-                           max_register,
-                           registers_to_pop,
-                           registers_to_clear);
-  if (backtrack() == nullptr) {
-    assembler->Backtrack();
-  } else {
-    assembler->PopCurrentPosition();
-    assembler->GoTo(backtrack());
-  }
-}
-
-
-void NegativeSubmatchSuccess::Emit(RegExpCompiler* compiler, Trace* trace) {
-  RegExpMacroAssembler* assembler = compiler->macro_assembler();
-
-  // Omit flushing the trace. We discard the entire stack frame anyway.
-
-  if (!label()->is_bound()) {
-    // We are completely independent of the trace, since we ignore it,
-    // so this code can be used as the generic version.
-    assembler->Bind(label());
-  }
-
-  // Throw away everything on the backtrack stack since the start
-  // of the negative submatch and restore the character position.
-  assembler->ReadCurrentPositionFromRegister(current_position_register_);
-  assembler->ReadStackPointerFromRegister(stack_pointer_register_);
-  if (clear_capture_count_ > 0) {
-    // Clear any captures that might have been performed during the success
-    // of the body of the negative look-ahead.
-    int clear_capture_end = clear_capture_start_ + clear_capture_count_ - 1;
-    assembler->ClearRegisters(clear_capture_start_, clear_capture_end);
-  }
-  // Now that we have unwound the stack we find at the top of the stack the
-  // backtrack that the BeginSubmatch node got.
-  assembler->Backtrack();
-}
-
-
-void EndNode::Emit(RegExpCompiler* compiler, Trace* trace) {
-  if (!trace->is_trivial()) {
-    trace->Flush(compiler, this);
-    return;
-  }
-  RegExpMacroAssembler* assembler = compiler->macro_assembler();
-  if (!label()->is_bound()) {
-    assembler->Bind(label());
-  }
-  switch (action_) {
-    case ACCEPT:
-      assembler->Succeed();
-      return;
-    case BACKTRACK:
-      assembler->GoTo(trace->backtrack());
-      return;
-    case NEGATIVE_SUBMATCH_SUCCESS:
-      // This case is handled in a different virtual method.
-      UNREACHABLE();
-  }
-  UNIMPLEMENTED();
-}
-
-
-void GuardedAlternative::AddGuard(Guard* guard, Zone* zone) {
-  if (guards_ == nullptr) guards_ = new (zone) ZoneList<Guard*>(1, zone);
-  guards_->Add(guard, zone);
-}
-
-
-ActionNode* ActionNode::SetRegister(int reg,
-                                    int val,
-                                    RegExpNode* on_success) {
-  ActionNode* result =
-      new(on_success->zone()) ActionNode(SET_REGISTER, on_success);
-  result->data_.u_store_register.reg = reg;
-  result->data_.u_store_register.value = val;
-  return result;
-}
-
-
-ActionNode* ActionNode::IncrementRegister(int reg, RegExpNode* on_success) {
-  ActionNode* result =
-      new(on_success->zone()) ActionNode(INCREMENT_REGISTER, on_success);
-  result->data_.u_increment_register.reg = reg;
-  return result;
-}
-
-
-ActionNode* ActionNode::StorePosition(int reg,
-                                      bool is_capture,
-                                      RegExpNode* on_success) {
-  ActionNode* result =
-      new(on_success->zone()) ActionNode(STORE_POSITION, on_success);
-  result->data_.u_position_register.reg = reg;
-  result->data_.u_position_register.is_capture = is_capture;
-  return result;
-}
-
-
-ActionNode* ActionNode::ClearCaptures(Interval range,
-                                      RegExpNode* on_success) {
-  ActionNode* result =
-      new(on_success->zone()) ActionNode(CLEAR_CAPTURES, on_success);
-  result->data_.u_clear_captures.range_from = range.from();
-  result->data_.u_clear_captures.range_to = range.to();
-  return result;
-}
-
-
-ActionNode* ActionNode::BeginSubmatch(int stack_reg,
-                                      int position_reg,
-                                      RegExpNode* on_success) {
-  ActionNode* result =
-      new(on_success->zone()) ActionNode(BEGIN_SUBMATCH, on_success);
-  result->data_.u_submatch.stack_pointer_register = stack_reg;
-  result->data_.u_submatch.current_position_register = position_reg;
-  return result;
-}
-
-
-ActionNode* ActionNode::PositiveSubmatchSuccess(int stack_reg,
-                                                int position_reg,
-                                                int clear_register_count,
-                                                int clear_register_from,
-                                                RegExpNode* on_success) {
-  ActionNode* result =
-      new(on_success->zone()) ActionNode(POSITIVE_SUBMATCH_SUCCESS, on_success);
-  result->data_.u_submatch.stack_pointer_register = stack_reg;
-  result->data_.u_submatch.current_position_register = position_reg;
-  result->data_.u_submatch.clear_register_count = clear_register_count;
-  result->data_.u_submatch.clear_register_from = clear_register_from;
-  return result;
-}
-
-
-ActionNode* ActionNode::EmptyMatchCheck(int start_register,
-                                        int repetition_register,
-                                        int repetition_limit,
-                                        RegExpNode* on_success) {
-  ActionNode* result =
-      new(on_success->zone()) ActionNode(EMPTY_MATCH_CHECK, on_success);
-  result->data_.u_empty_match_check.start_register = start_register;
-  result->data_.u_empty_match_check.repetition_register = repetition_register;
-  result->data_.u_empty_match_check.repetition_limit = repetition_limit;
-  return result;
-}
-
-
-#define DEFINE_ACCEPT(Type)                                          \
-  void Type##Node::Accept(NodeVisitor* visitor) {                    \
-    visitor->Visit##Type(this);                                      \
-  }
-FOR_EACH_NODE_TYPE(DEFINE_ACCEPT)
-#undef DEFINE_ACCEPT
-
-
-void LoopChoiceNode::Accept(NodeVisitor* visitor) {
-  visitor->VisitLoopChoice(this);
-}
-
-
-// -------------------------------------------------------------------
-// Emit code.
-
-
-void ChoiceNode::GenerateGuard(RegExpMacroAssembler* macro_assembler,
-                               Guard* guard,
-                               Trace* trace) {
-  switch (guard->op()) {
-    case Guard::LT:
-      DCHECK(!trace->mentions_reg(guard->reg()));
-      macro_assembler->IfRegisterGE(guard->reg(),
-                                    guard->value(),
-                                    trace->backtrack());
-      break;
-    case Guard::GEQ:
-      DCHECK(!trace->mentions_reg(guard->reg()));
-      macro_assembler->IfRegisterLT(guard->reg(),
-                                    guard->value(),
-                                    trace->backtrack());
-      break;
-  }
-}
-
-
-// Returns the number of characters in the equivalence class, omitting those
-// that cannot occur in the source string because it is Latin1.
-static int GetCaseIndependentLetters(Isolate* isolate, uc16 character,
-                                     bool one_byte_subject,
-                                     unibrow::uchar* letters) {
-  int length =
-      isolate->jsregexp_uncanonicalize()->get(character, '\0', letters);
-  // Unibrow returns 0 or 1 for characters where case independence is
-  // trivial.
-  if (length == 0) {
-    letters[0] = character;
-    length = 1;
-  }
-
-  if (one_byte_subject) {
-    int new_length = 0;
-    for (int i = 0; i < length; i++) {
-      if (letters[i] <= String::kMaxOneByteCharCode) {
-        letters[new_length++] = letters[i];
-      }
-    }
-    length = new_length;
-  }
-
-  return length;
-}
-
-
-static inline bool EmitSimpleCharacter(Isolate* isolate,
-                                       RegExpCompiler* compiler,
-                                       uc16 c,
-                                       Label* on_failure,
-                                       int cp_offset,
-                                       bool check,
-                                       bool preloaded) {
-  RegExpMacroAssembler* assembler = compiler->macro_assembler();
-  bool bound_checked = false;
-  if (!preloaded) {
-    assembler->LoadCurrentCharacter(
-        cp_offset,
-        on_failure,
-        check);
-    bound_checked = true;
-  }
-  assembler->CheckNotCharacter(c, on_failure);
-  return bound_checked;
-}
-
-
-// Only emits non-letters (things that don't have case).  Only used for case
-// independent matches.
-static inline bool EmitAtomNonLetter(Isolate* isolate,
-                                     RegExpCompiler* compiler,
-                                     uc16 c,
-                                     Label* on_failure,
-                                     int cp_offset,
-                                     bool check,
-                                     bool preloaded) {
-  RegExpMacroAssembler* macro_assembler = compiler->macro_assembler();
-  bool one_byte = compiler->one_byte();
-  unibrow::uchar chars[unibrow::Ecma262UnCanonicalize::kMaxWidth];
-  int length = GetCaseIndependentLetters(isolate, c, one_byte, chars);
-  if (length < 1) {
-    // This can't match.  Must be an one-byte subject and a non-one-byte
-    // character.  We do not need to do anything since the one-byte pass
-    // already handled this.
-    return false;  // Bounds not checked.
-  }
-  bool checked = false;
-  // We handle the length > 1 case in a later pass.
-  if (length == 1) {
-    if (one_byte && c > String::kMaxOneByteCharCodeU) {
-      // Can't match - see above.
-      return false;  // Bounds not checked.
-    }
-    if (!preloaded) {
-      macro_assembler->LoadCurrentCharacter(cp_offset, on_failure, check);
-      checked = check;
-    }
-    macro_assembler->CheckNotCharacter(c, on_failure);
-  }
-  return checked;
-}
-
-
-static bool ShortCutEmitCharacterPair(RegExpMacroAssembler* macro_assembler,
-                                      bool one_byte, uc16 c1, uc16 c2,
-                                      Label* on_failure) {
-  uc16 char_mask;
-  if (one_byte) {
-    char_mask = String::kMaxOneByteCharCode;
-  } else {
-    char_mask = String::kMaxUtf16CodeUnit;
-  }
-  uc16 exor = c1 ^ c2;
-  // Check whether exor has only one bit set.
-  if (((exor - 1) & exor) == 0) {
-    // If c1 and c2 differ only by one bit.
-    // Ecma262UnCanonicalize always gives the highest number last.
-    DCHECK(c2 > c1);
-    uc16 mask = char_mask ^ exor;
-    macro_assembler->CheckNotCharacterAfterAnd(c1, mask, on_failure);
-    return true;
-  }
-  DCHECK(c2 > c1);
-  uc16 diff = c2 - c1;
-  if (((diff - 1) & diff) == 0 && c1 >= diff) {
-    // If the characters differ by 2^n but don't differ by one bit then
-    // subtract the difference from the found character, then do the or
-    // trick.  We avoid the theoretical case where negative numbers are
-    // involved in order to simplify code generation.
-    uc16 mask = char_mask ^ diff;
-    macro_assembler->CheckNotCharacterAfterMinusAnd(c1 - diff,
-                                                    diff,
-                                                    mask,
-                                                    on_failure);
-    return true;
-  }
-  return false;
-}
-
-
-typedef bool EmitCharacterFunction(Isolate* isolate,
-                                   RegExpCompiler* compiler,
-                                   uc16 c,
-                                   Label* on_failure,
-                                   int cp_offset,
-                                   bool check,
-                                   bool preloaded);
-
-// Only emits letters (things that have case).  Only used for case independent
-// matches.
-static inline bool EmitAtomLetter(Isolate* isolate,
-                                  RegExpCompiler* compiler,
-                                  uc16 c,
-                                  Label* on_failure,
-                                  int cp_offset,
-                                  bool check,
-                                  bool preloaded) {
-  RegExpMacroAssembler* macro_assembler = compiler->macro_assembler();
-  bool one_byte = compiler->one_byte();
-  unibrow::uchar chars[unibrow::Ecma262UnCanonicalize::kMaxWidth];
-  int length = GetCaseIndependentLetters(isolate, c, one_byte, chars);
-  if (length <= 1) return false;
-  // We may not need to check against the end of the input string
-  // if this character lies before a character that matched.
-  if (!preloaded) {
-    macro_assembler->LoadCurrentCharacter(cp_offset, on_failure, check);
-  }
-  Label ok;
-  DCHECK_EQ(4, unibrow::Ecma262UnCanonicalize::kMaxWidth);
-  switch (length) {
-    case 2: {
-      if (ShortCutEmitCharacterPair(macro_assembler, one_byte, chars[0],
-                                    chars[1], on_failure)) {
-      } else {
-        macro_assembler->CheckCharacter(chars[0], &ok);
-        macro_assembler->CheckNotCharacter(chars[1], on_failure);
-        macro_assembler->Bind(&ok);
-      }
-      break;
-    }
-    case 4:
-      macro_assembler->CheckCharacter(chars[3], &ok);
-      // Fall through!
-    case 3:
-      macro_assembler->CheckCharacter(chars[0], &ok);
-      macro_assembler->CheckCharacter(chars[1], &ok);
-      macro_assembler->CheckNotCharacter(chars[2], on_failure);
-      macro_assembler->Bind(&ok);
-      break;
-    default:
-      UNREACHABLE();
-      break;
-  }
-  return true;
-}
-
-
-static void EmitBoundaryTest(RegExpMacroAssembler* masm,
-                             int border,
-                             Label* fall_through,
-                             Label* above_or_equal,
-                             Label* below) {
-  if (below != fall_through) {
-    masm->CheckCharacterLT(border, below);
-    if (above_or_equal != fall_through) masm->GoTo(above_or_equal);
-  } else {
-    masm->CheckCharacterGT(border - 1, above_or_equal);
-  }
-}
-
-
-static void EmitDoubleBoundaryTest(RegExpMacroAssembler* masm,
-                                   int first,
-                                   int last,
-                                   Label* fall_through,
-                                   Label* in_range,
-                                   Label* out_of_range) {
-  if (in_range == fall_through) {
-    if (first == last) {
-      masm->CheckNotCharacter(first, out_of_range);
-    } else {
-      masm->CheckCharacterNotInRange(first, last, out_of_range);
-    }
-  } else {
-    if (first == last) {
-      masm->CheckCharacter(first, in_range);
-    } else {
-      masm->CheckCharacterInRange(first, last, in_range);
-    }
-    if (out_of_range != fall_through) masm->GoTo(out_of_range);
-  }
-}
-
-
-// even_label is for ranges[i] to ranges[i + 1] where i - start_index is even.
-// odd_label is for ranges[i] to ranges[i + 1] where i - start_index is odd.
-static void EmitUseLookupTable(
-    RegExpMacroAssembler* masm,
-    ZoneList<int>* ranges,
-    int start_index,
-    int end_index,
-    int min_char,
-    Label* fall_through,
-    Label* even_label,
-    Label* odd_label) {
-  static const int kSize = RegExpMacroAssembler::kTableSize;
-  static const int kMask = RegExpMacroAssembler::kTableMask;
-
-  int base = (min_char & ~kMask);
-  USE(base);
-
-  // Assert that everything is on one kTableSize page.
-  for (int i = start_index; i <= end_index; i++) {
-    DCHECK_EQ(ranges->at(i) & ~kMask, base);
-  }
-  DCHECK(start_index == 0 || (ranges->at(start_index - 1) & ~kMask) <= base);
-
-  char templ[kSize];
-  Label* on_bit_set;
-  Label* on_bit_clear;
-  int bit;
-  if (even_label == fall_through) {
-    on_bit_set = odd_label;
-    on_bit_clear = even_label;
-    bit = 1;
-  } else {
-    on_bit_set = even_label;
-    on_bit_clear = odd_label;
-    bit = 0;
-  }
-  for (int i = 0; i < (ranges->at(start_index) & kMask) && i < kSize; i++) {
-    templ[i] = bit;
-  }
-  int j = 0;
-  bit ^= 1;
-  for (int i = start_index; i < end_index; i++) {
-    for (j = (ranges->at(i) & kMask); j < (ranges->at(i + 1) & kMask); j++) {
-      templ[j] = bit;
-    }
-    bit ^= 1;
-  }
-  for (int i = j; i < kSize; i++) {
-    templ[i] = bit;
-  }
-  Factory* factory = masm->isolate()->factory();
-  // TODO(erikcorry): Cache these.
-  Handle<ByteArray> ba = factory->NewByteArray(kSize, TENURED);
-  for (int i = 0; i < kSize; i++) {
-    ba->set(i, templ[i]);
-  }
-  masm->CheckBitInTable(ba, on_bit_set);
-  if (on_bit_clear != fall_through) masm->GoTo(on_bit_clear);
-}
-
-
-static void CutOutRange(RegExpMacroAssembler* masm,
-                        ZoneList<int>* ranges,
-                        int start_index,
-                        int end_index,
-                        int cut_index,
-                        Label* even_label,
-                        Label* odd_label) {
-  bool odd = (((cut_index - start_index) & 1) == 1);
-  Label* in_range_label = odd ? odd_label : even_label;
-  Label dummy;
-  EmitDoubleBoundaryTest(masm,
-                         ranges->at(cut_index),
-                         ranges->at(cut_index + 1) - 1,
-                         &dummy,
-                         in_range_label,
-                         &dummy);
-  DCHECK(!dummy.is_linked());
-  // Cut out the single range by rewriting the array.  This creates a new
-  // range that is a merger of the two ranges on either side of the one we
-  // are cutting out.  The oddity of the labels is preserved.
-  for (int j = cut_index; j > start_index; j--) {
-    ranges->at(j) = ranges->at(j - 1);
-  }
-  for (int j = cut_index + 1; j < end_index; j++) {
-    ranges->at(j) = ranges->at(j + 1);
-  }
-}
-
-
-// Unicode case.  Split the search space into kSize spaces that are handled
-// with recursion.
-static void SplitSearchSpace(ZoneList<int>* ranges,
-                             int start_index,
-                             int end_index,
-                             int* new_start_index,
-                             int* new_end_index,
-                             int* border) {
-  static const int kSize = RegExpMacroAssembler::kTableSize;
-  static const int kMask = RegExpMacroAssembler::kTableMask;
-
-  int first = ranges->at(start_index);
-  int last = ranges->at(end_index) - 1;
-
-  *new_start_index = start_index;
-  *border = (ranges->at(start_index) & ~kMask) + kSize;
-  while (*new_start_index < end_index) {
-    if (ranges->at(*new_start_index) > *border) break;
-    (*new_start_index)++;
-  }
-  // new_start_index is the index of the first edge that is beyond the
-  // current kSize space.
-
-  // For very large search spaces we do a binary chop search of the non-Latin1
-  // space instead of just going to the end of the current kSize space.  The
-  // heuristics are complicated a little by the fact that any 128-character
-  // encoding space can be quickly tested with a table lookup, so we don't
-  // wish to do binary chop search at a smaller granularity than that.  A
-  // 128-character space can take up a lot of space in the ranges array if,
-  // for example, we only want to match every second character (eg. the lower
-  // case characters on some Unicode pages).
-  int binary_chop_index = (end_index + start_index) / 2;
-  // The first test ensures that we get to the code that handles the Latin1
-  // range with a single not-taken branch, speeding up this important
-  // character range (even non-Latin1 charset-based text has spaces and
-  // punctuation).
-  if (*border - 1 > String::kMaxOneByteCharCode &&  // Latin1 case.
-      end_index - start_index > (*new_start_index - start_index) * 2 &&
-      last - first > kSize * 2 && binary_chop_index > *new_start_index &&
-      ranges->at(binary_chop_index) >= first + 2 * kSize) {
-    int scan_forward_for_section_border = binary_chop_index;;
-    int new_border = (ranges->at(binary_chop_index) | kMask) + 1;
-
-    while (scan_forward_for_section_border < end_index) {
-      if (ranges->at(scan_forward_for_section_border) > new_border) {
-        *new_start_index = scan_forward_for_section_border;
-        *border = new_border;
-        break;
-      }
-      scan_forward_for_section_border++;
-    }
-  }
-
-  DCHECK(*new_start_index > start_index);
-  *new_end_index = *new_start_index - 1;
-  if (ranges->at(*new_end_index) == *border) {
-    (*new_end_index)--;
-  }
-  if (*border >= ranges->at(end_index)) {
-    *border = ranges->at(end_index);
-    *new_start_index = end_index;  // Won't be used.
-    *new_end_index = end_index - 1;
-  }
-}
-
-// Gets a series of segment boundaries representing a character class.  If the
-// character is in the range between an even and an odd boundary (counting from
-// start_index) then go to even_label, otherwise go to odd_label.  We already
-// know that the character is in the range of min_char to max_char inclusive.
-// Either label can be nullptr indicating backtracking.  Either label can also
-// be equal to the fall_through label.
-static void GenerateBranches(RegExpMacroAssembler* masm, ZoneList<int>* ranges,
-                             int start_index, int end_index, uc32 min_char,
-                             uc32 max_char, Label* fall_through,
-                             Label* even_label, Label* odd_label) {
-  DCHECK_LE(min_char, String::kMaxUtf16CodeUnit);
-  DCHECK_LE(max_char, String::kMaxUtf16CodeUnit);
-
-  int first = ranges->at(start_index);
-  int last = ranges->at(end_index) - 1;
-
-  DCHECK_LT(min_char, first);
-
-  // Just need to test if the character is before or on-or-after
-  // a particular character.
-  if (start_index == end_index) {
-    EmitBoundaryTest(masm, first, fall_through, even_label, odd_label);
-    return;
-  }
-
-  // Another almost trivial case:  There is one interval in the middle that is
-  // different from the end intervals.
-  if (start_index + 1 == end_index) {
-    EmitDoubleBoundaryTest(
-        masm, first, last, fall_through, even_label, odd_label);
-    return;
-  }
-
-  // It's not worth using table lookup if there are very few intervals in the
-  // character class.
-  if (end_index - start_index <= 6) {
-    // It is faster to test for individual characters, so we look for those
-    // first, then try arbitrary ranges in the second round.
-    static int kNoCutIndex = -1;
-    int cut = kNoCutIndex;
-    for (int i = start_index; i < end_index; i++) {
-      if (ranges->at(i) == ranges->at(i + 1) - 1) {
-        cut = i;
-        break;
-      }
-    }
-    if (cut == kNoCutIndex) cut = start_index;
-    CutOutRange(
-        masm, ranges, start_index, end_index, cut, even_label, odd_label);
-    DCHECK_GE(end_index - start_index, 2);
-    GenerateBranches(masm,
-                     ranges,
-                     start_index + 1,
-                     end_index - 1,
-                     min_char,
-                     max_char,
-                     fall_through,
-                     even_label,
-                     odd_label);
-    return;
-  }
-
-  // If there are a lot of intervals in the regexp, then we will use tables to
-  // determine whether the character is inside or outside the character class.
-  static const int kBits = RegExpMacroAssembler::kTableSizeBits;
-
-  if ((max_char >> kBits) == (min_char >> kBits)) {
-    EmitUseLookupTable(masm,
-                       ranges,
-                       start_index,
-                       end_index,
-                       min_char,
-                       fall_through,
-                       even_label,
-                       odd_label);
-    return;
-  }
-
-  if ((min_char >> kBits) != (first >> kBits)) {
-    masm->CheckCharacterLT(first, odd_label);
-    GenerateBranches(masm,
-                     ranges,
-                     start_index + 1,
-                     end_index,
-                     first,
-                     max_char,
-                     fall_through,
-                     odd_label,
-                     even_label);
-    return;
-  }
-
-  int new_start_index = 0;
-  int new_end_index = 0;
-  int border = 0;
-
-  SplitSearchSpace(ranges,
-                   start_index,
-                   end_index,
-                   &new_start_index,
-                   &new_end_index,
-                   &border);
-
-  Label handle_rest;
-  Label* above = &handle_rest;
-  if (border == last + 1) {
-    // We didn't find any section that started after the limit, so everything
-    // above the border is one of the terminal labels.
-    above = (end_index & 1) != (start_index & 1) ? odd_label : even_label;
-    DCHECK(new_end_index == end_index - 1);
-  }
-
-  DCHECK_LE(start_index, new_end_index);
-  DCHECK_LE(new_start_index, end_index);
-  DCHECK_LT(start_index, new_start_index);
-  DCHECK_LT(new_end_index, end_index);
-  DCHECK(new_end_index + 1 == new_start_index ||
-         (new_end_index + 2 == new_start_index &&
-          border == ranges->at(new_end_index + 1)));
-  DCHECK_LT(min_char, border - 1);
-  DCHECK_LT(border, max_char);
-  DCHECK_LT(ranges->at(new_end_index), border);
-  DCHECK(border < ranges->at(new_start_index) ||
-         (border == ranges->at(new_start_index) &&
-          new_start_index == end_index &&
-          new_end_index == end_index - 1 &&
-          border == last + 1));
-  DCHECK(new_start_index == 0 || border >= ranges->at(new_start_index - 1));
-
-  masm->CheckCharacterGT(border - 1, above);
-  Label dummy;
-  GenerateBranches(masm,
-                   ranges,
-                   start_index,
-                   new_end_index,
-                   min_char,
-                   border - 1,
-                   &dummy,
-                   even_label,
-                   odd_label);
-  if (handle_rest.is_linked()) {
-    masm->Bind(&handle_rest);
-    bool flip = (new_start_index & 1) != (start_index & 1);
-    GenerateBranches(masm,
-                     ranges,
-                     new_start_index,
-                     end_index,
-                     border,
-                     max_char,
-                     &dummy,
-                     flip ? odd_label : even_label,
-                     flip ? even_label : odd_label);
-  }
-}
-
-
-static void EmitCharClass(RegExpMacroAssembler* macro_assembler,
-                          RegExpCharacterClass* cc, bool one_byte,
-                          Label* on_failure, int cp_offset, bool check_offset,
-                          bool preloaded, Zone* zone) {
-  ZoneList<CharacterRange>* ranges = cc->ranges(zone);
-  CharacterRange::Canonicalize(ranges);
-
-  int max_char;
-  if (one_byte) {
-    max_char = String::kMaxOneByteCharCode;
-  } else {
-    max_char = String::kMaxUtf16CodeUnit;
-  }
-
-  int range_count = ranges->length();
-
-  int last_valid_range = range_count - 1;
-  while (last_valid_range >= 0) {
-    CharacterRange& range = ranges->at(last_valid_range);
-    if (range.from() <= max_char) {
-      break;
-    }
-    last_valid_range--;
-  }
-
-  if (last_valid_range < 0) {
-    if (!cc->is_negated()) {
-      macro_assembler->GoTo(on_failure);
-    }
-    if (check_offset) {
-      macro_assembler->CheckPosition(cp_offset, on_failure);
-    }
-    return;
-  }
-
-  if (last_valid_range == 0 &&
-      ranges->at(0).IsEverything(max_char)) {
-    if (cc->is_negated()) {
-      macro_assembler->GoTo(on_failure);
-    } else {
-      // This is a common case hit by non-anchored expressions.
-      if (check_offset) {
-        macro_assembler->CheckPosition(cp_offset, on_failure);
-      }
-    }
-    return;
-  }
-
-  if (!preloaded) {
-    macro_assembler->LoadCurrentCharacter(cp_offset, on_failure, check_offset);
-  }
-
-  if (cc->is_standard(zone) &&
-      macro_assembler->CheckSpecialCharacterClass(cc->standard_type(),
-                                                  on_failure)) {
-      return;
-  }
-
-
-  // A new list with ascending entries.  Each entry is a code unit
-  // where there is a boundary between code units that are part of
-  // the class and code units that are not.  Normally we insert an
-  // entry at zero which goes to the failure label, but if there
-  // was already one there we fall through for success on that entry.
-  // Subsequent entries have alternating meaning (success/failure).
-  ZoneList<int>* range_boundaries =
-      new(zone) ZoneList<int>(last_valid_range, zone);
-
-  bool zeroth_entry_is_failure = !cc->is_negated();
-
-  for (int i = 0; i <= last_valid_range; i++) {
-    CharacterRange& range = ranges->at(i);
-    if (range.from() == 0) {
-      DCHECK_EQ(i, 0);
-      zeroth_entry_is_failure = !zeroth_entry_is_failure;
-    } else {
-      range_boundaries->Add(range.from(), zone);
-    }
-    range_boundaries->Add(range.to() + 1, zone);
-  }
-  int end_index = range_boundaries->length() - 1;
-  if (range_boundaries->at(end_index) > max_char) {
-    end_index--;
-  }
-
-  Label fall_through;
-  GenerateBranches(macro_assembler,
-                   range_boundaries,
-                   0,  // start_index.
-                   end_index,
-                   0,  // min_char.
-                   max_char,
-                   &fall_through,
-                   zeroth_entry_is_failure ? &fall_through : on_failure,
-                   zeroth_entry_is_failure ? on_failure : &fall_through);
-  macro_assembler->Bind(&fall_through);
-}
-
-
-RegExpNode::~RegExpNode() {
-}
-
-
-RegExpNode::LimitResult RegExpNode::LimitVersions(RegExpCompiler* compiler,
-                                                  Trace* trace) {
-  // If we are generating a greedy loop then don't stop and don't reuse code.
-  if (trace->stop_node() != nullptr) {
-    return CONTINUE;
-  }
-
-  RegExpMacroAssembler* macro_assembler = compiler->macro_assembler();
-  if (trace->is_trivial()) {
-    if (label_.is_bound() || on_work_list() || !KeepRecursing(compiler)) {
-      // If a generic version is already scheduled to be generated or we have
-      // recursed too deeply then just generate a jump to that code.
-      macro_assembler->GoTo(&label_);
-      // This will queue it up for generation of a generic version if it hasn't
-      // already been queued.
-      compiler->AddWork(this);
-      return DONE;
-    }
-    // Generate generic version of the node and bind the label for later use.
-    macro_assembler->Bind(&label_);
-    return CONTINUE;
-  }
-
-  // We are being asked to make a non-generic version.  Keep track of how many
-  // non-generic versions we generate so as not to overdo it.
-  trace_count_++;
-  if (KeepRecursing(compiler) && compiler->optimize() &&
-      trace_count_ < kMaxCopiesCodeGenerated) {
-    return CONTINUE;
-  }
-
-  // If we get here code has been generated for this node too many times or
-  // recursion is too deep.  Time to switch to a generic version.  The code for
-  // generic versions above can handle deep recursion properly.
-  bool was_limiting = compiler->limiting_recursion();
-  compiler->set_limiting_recursion(true);
-  trace->Flush(compiler, this);
-  compiler->set_limiting_recursion(was_limiting);
-  return DONE;
-}
-
-
-bool RegExpNode::KeepRecursing(RegExpCompiler* compiler) {
-  return !compiler->limiting_recursion() &&
-         compiler->recursion_depth() <= RegExpCompiler::kMaxRecursion;
-}
-
-
-int ActionNode::EatsAtLeast(int still_to_find,
-                            int budget,
-                            bool not_at_start) {
-  if (budget <= 0) return 0;
-  if (action_type_ == POSITIVE_SUBMATCH_SUCCESS) return 0;  // Rewinds input!
-  return on_success()->EatsAtLeast(still_to_find,
-                                   budget - 1,
-                                   not_at_start);
-}
-
-
-void ActionNode::FillInBMInfo(Isolate* isolate, int offset, int budget,
-                              BoyerMooreLookahead* bm, bool not_at_start) {
-  if (action_type_ != POSITIVE_SUBMATCH_SUCCESS) {
-    on_success()->FillInBMInfo(isolate, offset, budget - 1, bm, not_at_start);
-  }
-  SaveBMInfo(bm, not_at_start, offset);
-}
-
-
-int AssertionNode::EatsAtLeast(int still_to_find,
-                               int budget,
-                               bool not_at_start) {
-  if (budget <= 0) return 0;
-  // If we know we are not at the start and we are asked "how many characters
-  // will you match if you succeed?" then we can answer anything since false
-  // implies false.  So lets just return the max answer (still_to_find) since
-  // that won't prevent us from preloading a lot of characters for the other
-  // branches in the node graph.
-  if (assertion_type() == AT_START && not_at_start) return still_to_find;
-  return on_success()->EatsAtLeast(still_to_find,
-                                   budget - 1,
-                                   not_at_start);
-}
-
-
-void AssertionNode::FillInBMInfo(Isolate* isolate, int offset, int budget,
-                                 BoyerMooreLookahead* bm, bool not_at_start) {
-  // Match the behaviour of EatsAtLeast on this node.
-  if (assertion_type() == AT_START && not_at_start) return;
-  on_success()->FillInBMInfo(isolate, offset, budget - 1, bm, not_at_start);
-  SaveBMInfo(bm, not_at_start, offset);
-}
-
-
-int BackReferenceNode::EatsAtLeast(int still_to_find,
-                                   int budget,
-                                   bool not_at_start) {
-  if (read_backward()) return 0;
-  if (budget <= 0) return 0;
-  return on_success()->EatsAtLeast(still_to_find,
-                                   budget - 1,
-                                   not_at_start);
-}
-
-
-int TextNode::EatsAtLeast(int still_to_find,
-                          int budget,
-                          bool not_at_start) {
-  if (read_backward()) return 0;
-  int answer = Length();
-  if (answer >= still_to_find) return answer;
-  if (budget <= 0) return answer;
-  // We are not at start after this node so we set the last argument to 'true'.
-  return answer + on_success()->EatsAtLeast(still_to_find - answer,
-                                            budget - 1,
-                                            true);
-}
-
-
-int NegativeLookaroundChoiceNode::EatsAtLeast(int still_to_find, int budget,
-                                              bool not_at_start) {
-  if (budget <= 0) return 0;
-  // Alternative 0 is the negative lookahead, alternative 1 is what comes
-  // afterwards.
-  RegExpNode* node = alternatives_->at(1).node();
-  return node->EatsAtLeast(still_to_find, budget - 1, not_at_start);
-}
-
-
-void NegativeLookaroundChoiceNode::GetQuickCheckDetails(
-    QuickCheckDetails* details, RegExpCompiler* compiler, int filled_in,
-    bool not_at_start) {
-  // Alternative 0 is the negative lookahead, alternative 1 is what comes
-  // afterwards.
-  RegExpNode* node = alternatives_->at(1).node();
-  return node->GetQuickCheckDetails(details, compiler, filled_in, not_at_start);
-}
-
-
-int ChoiceNode::EatsAtLeastHelper(int still_to_find,
-                                  int budget,
-                                  RegExpNode* ignore_this_node,
-                                  bool not_at_start) {
-  if (budget <= 0) return 0;
-  int min = 100;
-  int choice_count = alternatives_->length();
-  budget = (budget - 1) / choice_count;
-  for (int i = 0; i < choice_count; i++) {
-    RegExpNode* node = alternatives_->at(i).node();
-    if (node == ignore_this_node) continue;
-    int node_eats_at_least =
-        node->EatsAtLeast(still_to_find, budget, not_at_start);
-    if (node_eats_at_least < min) min = node_eats_at_least;
-    if (min == 0) return 0;
-  }
-  return min;
-}
-
-
-int LoopChoiceNode::EatsAtLeast(int still_to_find,
-                                int budget,
-                                bool not_at_start) {
-  return EatsAtLeastHelper(still_to_find,
-                           budget - 1,
-                           loop_node_,
-                           not_at_start);
-}
-
-
-int ChoiceNode::EatsAtLeast(int still_to_find,
-                            int budget,
-                            bool not_at_start) {
-  return EatsAtLeastHelper(still_to_find, budget, nullptr, not_at_start);
-}
-
-
-// Takes the left-most 1-bit and smears it out, setting all bits to its right.
-static inline uint32_t SmearBitsRight(uint32_t v) {
-  v |= v >> 1;
-  v |= v >> 2;
-  v |= v >> 4;
-  v |= v >> 8;
-  v |= v >> 16;
-  return v;
-}
-
-
-bool QuickCheckDetails::Rationalize(bool asc) {
-  bool found_useful_op = false;
-  uint32_t char_mask;
-  if (asc) {
-    char_mask = String::kMaxOneByteCharCode;
-  } else {
-    char_mask = String::kMaxUtf16CodeUnit;
-  }
-  mask_ = 0;
-  value_ = 0;
-  int char_shift = 0;
-  for (int i = 0; i < characters_; i++) {
-    Position* pos = &positions_[i];
-    if ((pos->mask & String::kMaxOneByteCharCode) != 0) {
-      found_useful_op = true;
-    }
-    mask_ |= (pos->mask & char_mask) << char_shift;
-    value_ |= (pos->value & char_mask) << char_shift;
-    char_shift += asc ? 8 : 16;
-  }
-  return found_useful_op;
-}
-
-
-bool RegExpNode::EmitQuickCheck(RegExpCompiler* compiler,
-                                Trace* bounds_check_trace,
-                                Trace* trace,
-                                bool preload_has_checked_bounds,
-                                Label* on_possible_success,
-                                QuickCheckDetails* details,
-                                bool fall_through_on_failure) {
-  if (details->characters() == 0) return false;
-  GetQuickCheckDetails(
-      details, compiler, 0, trace->at_start() == Trace::FALSE_VALUE);
-  if (details->cannot_match()) return false;
-  if (!details->Rationalize(compiler->one_byte())) return false;
-  DCHECK(details->characters() == 1 ||
-         compiler->macro_assembler()->CanReadUnaligned());
-  uint32_t mask = details->mask();
-  uint32_t value = details->value();
-
-  RegExpMacroAssembler* assembler = compiler->macro_assembler();
-
-  if (trace->characters_preloaded() != details->characters()) {
-    DCHECK(trace->cp_offset() == bounds_check_trace->cp_offset());
-    // We are attempting to preload the minimum number of characters
-    // any choice would eat, so if the bounds check fails, then none of the
-    // choices can succeed, so we can just immediately backtrack, rather
-    // than go to the next choice.
-    assembler->LoadCurrentCharacter(trace->cp_offset(),
-                                    bounds_check_trace->backtrack(),
-                                    !preload_has_checked_bounds,
-                                    details->characters());
-  }
-
-
-  bool need_mask = true;
-
-  if (details->characters() == 1) {
-    // If number of characters preloaded is 1 then we used a byte or 16 bit
-    // load so the value is already masked down.
-    uint32_t char_mask;
-    if (compiler->one_byte()) {
-      char_mask = String::kMaxOneByteCharCode;
-    } else {
-      char_mask = String::kMaxUtf16CodeUnit;
-    }
-    if ((mask & char_mask) == char_mask) need_mask = false;
-    mask &= char_mask;
-  } else {
-    // For 2-character preloads in one-byte mode or 1-character preloads in
-    // two-byte mode we also use a 16 bit load with zero extend.
-    static const uint32_t kTwoByteMask = 0xFFFF;
-    static const uint32_t kFourByteMask = 0xFFFFFFFF;
-    if (details->characters() == 2 && compiler->one_byte()) {
-      if ((mask & kTwoByteMask) == kTwoByteMask) need_mask = false;
-    } else if (details->characters() == 1 && !compiler->one_byte()) {
-      if ((mask & kTwoByteMask) == kTwoByteMask) need_mask = false;
-    } else {
-      if (mask == kFourByteMask) need_mask = false;
-    }
-  }
-
-  if (fall_through_on_failure) {
-    if (need_mask) {
-      assembler->CheckCharacterAfterAnd(value, mask, on_possible_success);
-    } else {
-      assembler->CheckCharacter(value, on_possible_success);
-    }
-  } else {
-    if (need_mask) {
-      assembler->CheckNotCharacterAfterAnd(value, mask, trace->backtrack());
-    } else {
-      assembler->CheckNotCharacter(value, trace->backtrack());
-    }
-  }
-  return true;
-}
-
-
-// Here is the meat of GetQuickCheckDetails (see also the comment on the
-// super-class in the .h file).
-//
-// We iterate along the text object, building up for each character a
-// mask and value that can be used to test for a quick failure to match.
-// The masks and values for the positions will be combined into a single
-// machine word for the current character width in order to be used in
-// generating a quick check.
-void TextNode::GetQuickCheckDetails(QuickCheckDetails* details,
-                                    RegExpCompiler* compiler,
-                                    int characters_filled_in,
-                                    bool not_at_start) {
-  // Do not collect any quick check details if the text node reads backward,
-  // since it reads in the opposite direction than we use for quick checks.
-  if (read_backward()) return;
-  Isolate* isolate = compiler->macro_assembler()->isolate();
-  DCHECK(characters_filled_in < details->characters());
-  int characters = details->characters();
-  int char_mask;
-  if (compiler->one_byte()) {
-    char_mask = String::kMaxOneByteCharCode;
-  } else {
-    char_mask = String::kMaxUtf16CodeUnit;
-  }
-  for (int k = 0; k < elements()->length(); k++) {
-    TextElement elm = elements()->at(k);
-    if (elm.text_type() == TextElement::ATOM) {
-      Vector<const uc16> quarks = elm.atom()->data();
-      for (int i = 0; i < characters && i < quarks.length(); i++) {
-        QuickCheckDetails::Position* pos =
-            details->positions(characters_filled_in);
-        uc16 c = quarks[i];
-        if (elm.atom()->ignore_case()) {
-          unibrow::uchar chars[unibrow::Ecma262UnCanonicalize::kMaxWidth];
-          int length = GetCaseIndependentLetters(isolate, c,
-                                                 compiler->one_byte(), chars);
-          if (length == 0) {
-            // This can happen because all case variants are non-Latin1, but we
-            // know the input is Latin1.
-            details->set_cannot_match();
-            pos->determines_perfectly = false;
-            return;
-          }
-          if (length == 1) {
-            // This letter has no case equivalents, so it's nice and simple
-            // and the mask-compare will determine definitely whether we have
-            // a match at this character position.
-            pos->mask = char_mask;
-            pos->value = c;
-            pos->determines_perfectly = true;
-          } else {
-            uint32_t common_bits = char_mask;
-            uint32_t bits = chars[0];
-            for (int j = 1; j < length; j++) {
-              uint32_t differing_bits = ((chars[j] & common_bits) ^ bits);
-              common_bits ^= differing_bits;
-              bits &= common_bits;
-            }
-            // If length is 2 and common bits has only one zero in it then
-            // our mask and compare instruction will determine definitely
-            // whether we have a match at this character position.  Otherwise
-            // it can only be an approximate check.
-            uint32_t one_zero = (common_bits | ~char_mask);
-            if (length == 2 && ((~one_zero) & ((~one_zero) - 1)) == 0) {
-              pos->determines_perfectly = true;
-            }
-            pos->mask = common_bits;
-            pos->value = bits;
-          }
-        } else {
-          // Don't ignore case.  Nice simple case where the mask-compare will
-          // determine definitely whether we have a match at this character
-          // position.
-          if (c > char_mask) {
-            details->set_cannot_match();
-            pos->determines_perfectly = false;
-            return;
-          }
-          pos->mask = char_mask;
-          pos->value = c;
-          pos->determines_perfectly = true;
-        }
-        characters_filled_in++;
-        DCHECK(characters_filled_in <= details->characters());
-        if (characters_filled_in == details->characters()) {
-          return;
-        }
-      }
-    } else {
-      QuickCheckDetails::Position* pos =
-          details->positions(characters_filled_in);
-      RegExpCharacterClass* tree = elm.char_class();
-      ZoneList<CharacterRange>* ranges = tree->ranges(zone());
-      DCHECK(!ranges->is_empty());
-      if (tree->is_negated()) {
-        // A quick check uses multi-character mask and compare.  There is no
-        // useful way to incorporate a negative char class into this scheme
-        // so we just conservatively create a mask and value that will always
-        // succeed.
-        pos->mask = 0;
-        pos->value = 0;
-      } else {
-        int first_range = 0;
-        while (ranges->at(first_range).from() > char_mask) {
-          first_range++;
-          if (first_range == ranges->length()) {
-            details->set_cannot_match();
-            pos->determines_perfectly = false;
-            return;
-          }
-        }
-        CharacterRange range = ranges->at(first_range);
-        uc16 from = range.from();
-        uc16 to = range.to();
-        if (to > char_mask) {
-          to = char_mask;
-        }
-        uint32_t differing_bits = (from ^ to);
-        // A mask and compare is only perfect if the differing bits form a
-        // number like 00011111 with one single block of trailing 1s.
-        if ((differing_bits & (differing_bits + 1)) == 0 &&
-             from + differing_bits == to) {
-          pos->determines_perfectly = true;
-        }
-        uint32_t common_bits = ~SmearBitsRight(differing_bits);
-        uint32_t bits = (from & common_bits);
-        for (int i = first_range + 1; i < ranges->length(); i++) {
-          CharacterRange range = ranges->at(i);
-          uc16 from = range.from();
-          uc16 to = range.to();
-          if (from > char_mask) continue;
-          if (to > char_mask) to = char_mask;
-          // Here we are combining more ranges into the mask and compare
-          // value.  With each new range the mask becomes more sparse and
-          // so the chances of a false positive rise.  A character class
-          // with multiple ranges is assumed never to be equivalent to a
-          // mask and compare operation.
-          pos->determines_perfectly = false;
-          uint32_t new_common_bits = (from ^ to);
-          new_common_bits = ~SmearBitsRight(new_common_bits);
-          common_bits &= new_common_bits;
-          bits &= new_common_bits;
-          uint32_t differing_bits = (from & common_bits) ^ bits;
-          common_bits ^= differing_bits;
-          bits &= common_bits;
-        }
-        pos->mask = common_bits;
-        pos->value = bits;
-      }
-      characters_filled_in++;
-      DCHECK(characters_filled_in <= details->characters());
-      if (characters_filled_in == details->characters()) {
-        return;
-      }
-    }
-  }
-  DCHECK(characters_filled_in != details->characters());
-  if (!details->cannot_match()) {
-    on_success()-> GetQuickCheckDetails(details,
-                                        compiler,
-                                        characters_filled_in,
-                                        true);
-  }
-}
-
-
-void QuickCheckDetails::Clear() {
-  for (int i = 0; i < characters_; i++) {
-    positions_[i].mask = 0;
-    positions_[i].value = 0;
-    positions_[i].determines_perfectly = false;
-  }
-  characters_ = 0;
-}
-
-
-void QuickCheckDetails::Advance(int by, bool one_byte) {
-  if (by >= characters_ || by < 0) {
-    DCHECK_IMPLIES(by < 0, characters_ == 0);
-    Clear();
-    return;
-  }
-  DCHECK_LE(characters_ - by, 4);
-  DCHECK_LE(characters_, 4);
-  for (int i = 0; i < characters_ - by; i++) {
-    positions_[i] = positions_[by + i];
-  }
-  for (int i = characters_ - by; i < characters_; i++) {
-    positions_[i].mask = 0;
-    positions_[i].value = 0;
-    positions_[i].determines_perfectly = false;
-  }
-  characters_ -= by;
-  // We could change mask_ and value_ here but we would never advance unless
-  // they had already been used in a check and they won't be used again because
-  // it would gain us nothing.  So there's no point.
-}
-
-
-void QuickCheckDetails::Merge(QuickCheckDetails* other, int from_index) {
-  DCHECK(characters_ == other->characters_);
-  if (other->cannot_match_) {
-    return;
-  }
-  if (cannot_match_) {
-    *this = *other;
-    return;
-  }
-  for (int i = from_index; i < characters_; i++) {
-    QuickCheckDetails::Position* pos = positions(i);
-    QuickCheckDetails::Position* other_pos = other->positions(i);
-    if (pos->mask != other_pos->mask ||
-        pos->value != other_pos->value ||
-        !other_pos->determines_perfectly) {
-      // Our mask-compare operation will be approximate unless we have the
-      // exact same operation on both sides of the alternation.
-      pos->determines_perfectly = false;
-    }
-    pos->mask &= other_pos->mask;
-    pos->value &= pos->mask;
-    other_pos->value &= pos->mask;
-    uc16 differing_bits = (pos->value ^ other_pos->value);
-    pos->mask &= ~differing_bits;
-    pos->value &= pos->mask;
-  }
-}
-
-
-class VisitMarker {
- public:
-  explicit VisitMarker(NodeInfo* info) : info_(info) {
-    DCHECK(!info->visited);
-    info->visited = true;
-  }
-  ~VisitMarker() {
-    info_->visited = false;
-  }
- private:
-  NodeInfo* info_;
-};
-
-RegExpNode* SeqRegExpNode::FilterOneByte(int depth) {
-  if (info()->replacement_calculated) return replacement();
-  if (depth < 0) return this;
-  DCHECK(!info()->visited);
-  VisitMarker marker(info());
-  return FilterSuccessor(depth - 1);
-}
-
-RegExpNode* SeqRegExpNode::FilterSuccessor(int depth) {
-  RegExpNode* next = on_success_->FilterOneByte(depth - 1);
-  if (next == nullptr) return set_replacement(nullptr);
-  on_success_ = next;
-  return set_replacement(this);
-}
-
-// We need to check for the following characters: 0x39C 0x3BC 0x178.
-static inline bool RangeContainsLatin1Equivalents(CharacterRange range) {
-  // TODO(dcarney): this could be a lot more efficient.
-  return range.Contains(0x039C) || range.Contains(0x03BC) ||
-         range.Contains(0x0178);
-}
-
-
-static bool RangesContainLatin1Equivalents(ZoneList<CharacterRange>* ranges) {
-  for (int i = 0; i < ranges->length(); i++) {
-    // TODO(dcarney): this could be a lot more efficient.
-    if (RangeContainsLatin1Equivalents(ranges->at(i))) return true;
-  }
-  return false;
-}
-
-RegExpNode* TextNode::FilterOneByte(int depth) {
-  if (info()->replacement_calculated) return replacement();
-  if (depth < 0) return this;
-  DCHECK(!info()->visited);
-  VisitMarker marker(info());
-  int element_count = elements()->length();
-  for (int i = 0; i < element_count; i++) {
-    TextElement elm = elements()->at(i);
-    if (elm.text_type() == TextElement::ATOM) {
-      Vector<const uc16> quarks = elm.atom()->data();
-      for (int j = 0; j < quarks.length(); j++) {
-        uint16_t c = quarks[j];
-        if (c <= String::kMaxOneByteCharCode) continue;
-        if (!IgnoreCase(elm.atom()->flags())) return set_replacement(nullptr);
-        // Here, we need to check for characters whose upper and lower cases
-        // are outside the Latin-1 range.
-        uint16_t converted = unibrow::Latin1::ConvertNonLatin1ToLatin1(c);
-        // Character is outside Latin-1 completely
-        if (converted == 0) return set_replacement(nullptr);
-        // Convert quark to Latin-1 in place.
-        uint16_t* copy = const_cast<uint16_t*>(quarks.start());
-        copy[j] = converted;
-      }
-    } else {
-      DCHECK(elm.text_type() == TextElement::CHAR_CLASS);
-      RegExpCharacterClass* cc = elm.char_class();
-      ZoneList<CharacterRange>* ranges = cc->ranges(zone());
-      CharacterRange::Canonicalize(ranges);
-      // Now they are in order so we only need to look at the first.
-      int range_count = ranges->length();
-      if (cc->is_negated()) {
-        if (range_count != 0 &&
-            ranges->at(0).from() == 0 &&
-            ranges->at(0).to() >= String::kMaxOneByteCharCode) {
-          // This will be handled in a later filter.
-          if (IgnoreCase(cc->flags()) && RangesContainLatin1Equivalents(ranges))
-            continue;
-          return set_replacement(nullptr);
-        }
-      } else {
-        if (range_count == 0 ||
-            ranges->at(0).from() > String::kMaxOneByteCharCode) {
-          // This will be handled in a later filter.
-          if (IgnoreCase(cc->flags()) && RangesContainLatin1Equivalents(ranges))
-            continue;
-          return set_replacement(nullptr);
-        }
-      }
-    }
-  }
-  return FilterSuccessor(depth - 1);
-}
-
-RegExpNode* LoopChoiceNode::FilterOneByte(int depth) {
-  if (info()->replacement_calculated) return replacement();
-  if (depth < 0) return this;
-  if (info()->visited) return this;
-  {
-    VisitMarker marker(info());
-
-    RegExpNode* continue_replacement = continue_node_->FilterOneByte(depth - 1);
-    // If we can't continue after the loop then there is no sense in doing the
-    // loop.
-    if (continue_replacement == nullptr) return set_replacement(nullptr);
-  }
-
-  return ChoiceNode::FilterOneByte(depth - 1);
-}
-
-RegExpNode* ChoiceNode::FilterOneByte(int depth) {
-  if (info()->replacement_calculated) return replacement();
-  if (depth < 0) return this;
-  if (info()->visited) return this;
-  VisitMarker marker(info());
-  int choice_count = alternatives_->length();
-
-  for (int i = 0; i < choice_count; i++) {
-    GuardedAlternative alternative = alternatives_->at(i);
-    if (alternative.guards() != nullptr &&
-        alternative.guards()->length() != 0) {
-      set_replacement(this);
-      return this;
-    }
-  }
-
-  int surviving = 0;
-  RegExpNode* survivor = nullptr;
-  for (int i = 0; i < choice_count; i++) {
-    GuardedAlternative alternative = alternatives_->at(i);
-    RegExpNode* replacement = alternative.node()->FilterOneByte(depth - 1);
-    DCHECK(replacement != this);  // No missing EMPTY_MATCH_CHECK.
-    if (replacement != nullptr) {
-      alternatives_->at(i).set_node(replacement);
-      surviving++;
-      survivor = replacement;
-    }
-  }
-  if (surviving < 2) return set_replacement(survivor);
-
-  set_replacement(this);
-  if (surviving == choice_count) {
-    return this;
-  }
-  // Only some of the nodes survived the filtering.  We need to rebuild the
-  // alternatives list.
-  ZoneList<GuardedAlternative>* new_alternatives =
-      new(zone()) ZoneList<GuardedAlternative>(surviving, zone());
-  for (int i = 0; i < choice_count; i++) {
-    RegExpNode* replacement =
-        alternatives_->at(i).node()->FilterOneByte(depth - 1);
-    if (replacement != nullptr) {
-      alternatives_->at(i).set_node(replacement);
-      new_alternatives->Add(alternatives_->at(i), zone());
-    }
-  }
-  alternatives_ = new_alternatives;
-  return this;
-}
-
-RegExpNode* NegativeLookaroundChoiceNode::FilterOneByte(int depth) {
-  if (info()->replacement_calculated) return replacement();
-  if (depth < 0) return this;
-  if (info()->visited) return this;
-  VisitMarker marker(info());
-  // Alternative 0 is the negative lookahead, alternative 1 is what comes
-  // afterwards.
-  RegExpNode* node = alternatives_->at(1).node();
-  RegExpNode* replacement = node->FilterOneByte(depth - 1);
-  if (replacement == nullptr) return set_replacement(nullptr);
-  alternatives_->at(1).set_node(replacement);
-
-  RegExpNode* neg_node = alternatives_->at(0).node();
-  RegExpNode* neg_replacement = neg_node->FilterOneByte(depth - 1);
-  // If the negative lookahead is always going to fail then
-  // we don't need to check it.
-  if (neg_replacement == nullptr) return set_replacement(replacement);
-  alternatives_->at(0).set_node(neg_replacement);
-  return set_replacement(this);
-}
-
-
-void LoopChoiceNode::GetQuickCheckDetails(QuickCheckDetails* details,
-                                          RegExpCompiler* compiler,
-                                          int characters_filled_in,
-                                          bool not_at_start) {
-  if (body_can_be_zero_length_ || info()->visited) return;
-  VisitMarker marker(info());
-  return ChoiceNode::GetQuickCheckDetails(details,
-                                          compiler,
-                                          characters_filled_in,
-                                          not_at_start);
-}
-
-
-void LoopChoiceNode::FillInBMInfo(Isolate* isolate, int offset, int budget,
-                                  BoyerMooreLookahead* bm, bool not_at_start) {
-  if (body_can_be_zero_length_ || budget <= 0) {
-    bm->SetRest(offset);
-    SaveBMInfo(bm, not_at_start, offset);
-    return;
-  }
-  ChoiceNode::FillInBMInfo(isolate, offset, budget - 1, bm, not_at_start);
-  SaveBMInfo(bm, not_at_start, offset);
-}
-
-
-void ChoiceNode::GetQuickCheckDetails(QuickCheckDetails* details,
-                                      RegExpCompiler* compiler,
-                                      int characters_filled_in,
-                                      bool not_at_start) {
-  not_at_start = (not_at_start || not_at_start_);
-  int choice_count = alternatives_->length();
-  DCHECK_LT(0, choice_count);
-  alternatives_->at(0).node()->GetQuickCheckDetails(details,
-                                                    compiler,
-                                                    characters_filled_in,
-                                                    not_at_start);
-  for (int i = 1; i < choice_count; i++) {
-    QuickCheckDetails new_details(details->characters());
-    RegExpNode* node = alternatives_->at(i).node();
-    node->GetQuickCheckDetails(&new_details, compiler,
-                               characters_filled_in,
-                               not_at_start);
-    // Here we merge the quick match details of the two branches.
-    details->Merge(&new_details, characters_filled_in);
-  }
-}
-
-
-// Check for [0-9A-Z_a-z].
-static void EmitWordCheck(RegExpMacroAssembler* assembler,
-                          Label* word,
-                          Label* non_word,
-                          bool fall_through_on_word) {
-  if (assembler->CheckSpecialCharacterClass(
-          fall_through_on_word ? 'w' : 'W',
-          fall_through_on_word ? non_word : word)) {
-    // Optimized implementation available.
-    return;
-  }
-  assembler->CheckCharacterGT('z', non_word);
-  assembler->CheckCharacterLT('0', non_word);
-  assembler->CheckCharacterGT('a' - 1, word);
-  assembler->CheckCharacterLT('9' + 1, word);
-  assembler->CheckCharacterLT('A', non_word);
-  assembler->CheckCharacterLT('Z' + 1, word);
-  if (fall_through_on_word) {
-    assembler->CheckNotCharacter('_', non_word);
-  } else {
-    assembler->CheckCharacter('_', word);
-  }
-}
-
-
-// Emit the code to check for a ^ in multiline mode (1-character lookbehind
-// that matches newline or the start of input).
-static void EmitHat(RegExpCompiler* compiler,
-                    RegExpNode* on_success,
-                    Trace* trace) {
-  RegExpMacroAssembler* assembler = compiler->macro_assembler();
-  // We will be loading the previous character into the current character
-  // register.
-  Trace new_trace(*trace);
-  new_trace.InvalidateCurrentCharacter();
-
-  Label ok;
-  if (new_trace.cp_offset() == 0) {
-    // The start of input counts as a newline in this context, so skip to
-    // ok if we are at the start.
-    assembler->CheckAtStart(&ok);
-  }
-  // We already checked that we are not at the start of input so it must be
-  // OK to load the previous character.
-  assembler->LoadCurrentCharacter(new_trace.cp_offset() -1,
-                                  new_trace.backtrack(),
-                                  false);
-  if (!assembler->CheckSpecialCharacterClass('n',
-                                             new_trace.backtrack())) {
-    // Newline means \n, \r, 0x2028 or 0x2029.
-    if (!compiler->one_byte()) {
-      assembler->CheckCharacterAfterAnd(0x2028, 0xFFFE, &ok);
-    }
-    assembler->CheckCharacter('\n', &ok);
-    assembler->CheckNotCharacter('\r', new_trace.backtrack());
-  }
-  assembler->Bind(&ok);
-  on_success->Emit(compiler, &new_trace);
-}
-
-
-// Emit the code to handle \b and \B (word-boundary or non-word-boundary).
-void AssertionNode::EmitBoundaryCheck(RegExpCompiler* compiler, Trace* trace) {
-  RegExpMacroAssembler* assembler = compiler->macro_assembler();
-  Isolate* isolate = assembler->isolate();
-  Trace::TriBool next_is_word_character = Trace::UNKNOWN;
-  bool not_at_start = (trace->at_start() == Trace::FALSE_VALUE);
-  BoyerMooreLookahead* lookahead = bm_info(not_at_start);
-  if (lookahead == nullptr) {
-    int eats_at_least =
-        Min(kMaxLookaheadForBoyerMoore, EatsAtLeast(kMaxLookaheadForBoyerMoore,
-                                                    kRecursionBudget,
-                                                    not_at_start));
-    if (eats_at_least >= 1) {
-      BoyerMooreLookahead* bm =
-          new(zone()) BoyerMooreLookahead(eats_at_least, compiler, zone());
-      FillInBMInfo(isolate, 0, kRecursionBudget, bm, not_at_start);
-      if (bm->at(0)->is_non_word())
-        next_is_word_character = Trace::FALSE_VALUE;
-      if (bm->at(0)->is_word()) next_is_word_character = Trace::TRUE_VALUE;
-    }
-  } else {
-    if (lookahead->at(0)->is_non_word())
-      next_is_word_character = Trace::FALSE_VALUE;
-    if (lookahead->at(0)->is_word())
-      next_is_word_character = Trace::TRUE_VALUE;
-  }
-  bool at_boundary = (assertion_type_ == AssertionNode::AT_BOUNDARY);
-  if (next_is_word_character == Trace::UNKNOWN) {
-    Label before_non_word;
-    Label before_word;
-    if (trace->characters_preloaded() != 1) {
-      assembler->LoadCurrentCharacter(trace->cp_offset(), &before_non_word);
-    }
-    // Fall through on non-word.
-    EmitWordCheck(assembler, &before_word, &before_non_word, false);
-    // Next character is not a word character.
-    assembler->Bind(&before_non_word);
-    Label ok;
-    BacktrackIfPrevious(compiler, trace, at_boundary ? kIsNonWord : kIsWord);
-    assembler->GoTo(&ok);
-
-    assembler->Bind(&before_word);
-    BacktrackIfPrevious(compiler, trace, at_boundary ? kIsWord : kIsNonWord);
-    assembler->Bind(&ok);
-  } else if (next_is_word_character == Trace::TRUE_VALUE) {
-    BacktrackIfPrevious(compiler, trace, at_boundary ? kIsWord : kIsNonWord);
-  } else {
-    DCHECK(next_is_word_character == Trace::FALSE_VALUE);
-    BacktrackIfPrevious(compiler, trace, at_boundary ? kIsNonWord : kIsWord);
-  }
-}
-
-
-void AssertionNode::BacktrackIfPrevious(
-    RegExpCompiler* compiler,
-    Trace* trace,
-    AssertionNode::IfPrevious backtrack_if_previous) {
-  RegExpMacroAssembler* assembler = compiler->macro_assembler();
-  Trace new_trace(*trace);
-  new_trace.InvalidateCurrentCharacter();
-
-  Label fall_through, dummy;
-
-  Label* non_word = backtrack_if_previous == kIsNonWord ?
-                    new_trace.backtrack() :
-                    &fall_through;
-  Label* word = backtrack_if_previous == kIsNonWord ?
-                &fall_through :
-                new_trace.backtrack();
-
-  if (new_trace.cp_offset() == 0) {
-    // The start of input counts as a non-word character, so the question is
-    // decided if we are at the start.
-    assembler->CheckAtStart(non_word);
-  }
-  // We already checked that we are not at the start of input so it must be
-  // OK to load the previous character.
-  assembler->LoadCurrentCharacter(new_trace.cp_offset() - 1, &dummy, false);
-  EmitWordCheck(assembler, word, non_word, backtrack_if_previous == kIsNonWord);
-
-  assembler->Bind(&fall_through);
-  on_success()->Emit(compiler, &new_trace);
-}
-
-
-void AssertionNode::GetQuickCheckDetails(QuickCheckDetails* details,
-                                         RegExpCompiler* compiler,
-                                         int filled_in,
-                                         bool not_at_start) {
-  if (assertion_type_ == AT_START && not_at_start) {
-    details->set_cannot_match();
-    return;
-  }
-  return on_success()->GetQuickCheckDetails(details,
-                                            compiler,
-                                            filled_in,
-                                            not_at_start);
-}
-
-
-void AssertionNode::Emit(RegExpCompiler* compiler, Trace* trace) {
-  RegExpMacroAssembler* assembler = compiler->macro_assembler();
-  switch (assertion_type_) {
-    case AT_END: {
-      Label ok;
-      assembler->CheckPosition(trace->cp_offset(), &ok);
-      assembler->GoTo(trace->backtrack());
-      assembler->Bind(&ok);
-      break;
-    }
-    case AT_START: {
-      if (trace->at_start() == Trace::FALSE_VALUE) {
-        assembler->GoTo(trace->backtrack());
-        return;
-      }
-      if (trace->at_start() == Trace::UNKNOWN) {
-        assembler->CheckNotAtStart(trace->cp_offset(), trace->backtrack());
-        Trace at_start_trace = *trace;
-        at_start_trace.set_at_start(Trace::TRUE_VALUE);
-        on_success()->Emit(compiler, &at_start_trace);
-        return;
-      }
-    }
-    break;
-    case AFTER_NEWLINE:
-      EmitHat(compiler, on_success(), trace);
-      return;
-    case AT_BOUNDARY:
-    case AT_NON_BOUNDARY: {
-      EmitBoundaryCheck(compiler, trace);
-      return;
-    }
-  }
-  on_success()->Emit(compiler, trace);
-}
-
-
-static bool DeterminedAlready(QuickCheckDetails* quick_check, int offset) {
-  if (quick_check == nullptr) return false;
-  if (offset >= quick_check->characters()) return false;
-  return quick_check->positions(offset)->determines_perfectly;
-}
-
-
-static void UpdateBoundsCheck(int index, int* checked_up_to) {
-  if (index > *checked_up_to) {
-    *checked_up_to = index;
-  }
-}
-
-
-// We call this repeatedly to generate code for each pass over the text node.
-// The passes are in increasing order of difficulty because we hope one
-// of the first passes will fail in which case we are saved the work of the
-// later passes.  for example for the case independent regexp /%[asdfghjkl]a/
-// we will check the '%' in the first pass, the case independent 'a' in the
-// second pass and the character class in the last pass.
-//
-// The passes are done from right to left, so for example to test for /bar/
-// we will first test for an 'r' with offset 2, then an 'a' with offset 1
-// and then a 'b' with offset 0.  This means we can avoid the end-of-input
-// bounds check most of the time.  In the example we only need to check for
-// end-of-input when loading the putative 'r'.
-//
-// A slight complication involves the fact that the first character may already
-// be fetched into a register by the previous node.  In this case we want to
-// do the test for that character first.  We do this in separate passes.  The
-// 'preloaded' argument indicates that we are doing such a 'pass'.  If such a
-// pass has been performed then subsequent passes will have true in
-// first_element_checked to indicate that that character does not need to be
-// checked again.
-//
-// In addition to all this we are passed a Trace, which can
-// contain an AlternativeGeneration object.  In this AlternativeGeneration
-// object we can see details of any quick check that was already passed in
-// order to get to the code we are now generating.  The quick check can involve
-// loading characters, which means we do not need to recheck the bounds
-// up to the limit the quick check already checked.  In addition the quick
-// check can have involved a mask and compare operation which may simplify
-// or obviate the need for further checks at some character positions.
-void TextNode::TextEmitPass(RegExpCompiler* compiler,
-                            TextEmitPassType pass,
-                            bool preloaded,
-                            Trace* trace,
-                            bool first_element_checked,
-                            int* checked_up_to) {
-  RegExpMacroAssembler* assembler = compiler->macro_assembler();
-  Isolate* isolate = assembler->isolate();
-  bool one_byte = compiler->one_byte();
-  Label* backtrack = trace->backtrack();
-  QuickCheckDetails* quick_check = trace->quick_check_performed();
-  int element_count = elements()->length();
-  int backward_offset = read_backward() ? -Length() : 0;
-  for (int i = preloaded ? 0 : element_count - 1; i >= 0; i--) {
-    TextElement elm = elements()->at(i);
-    int cp_offset = trace->cp_offset() + elm.cp_offset() + backward_offset;
-    if (elm.text_type() == TextElement::ATOM) {
-      if (SkipPass(pass, elm.atom()->ignore_case())) continue;
-      Vector<const uc16> quarks = elm.atom()->data();
-      for (int j = preloaded ? 0 : quarks.length() - 1; j >= 0; j--) {
-        if (first_element_checked && i == 0 && j == 0) continue;
-        if (DeterminedAlready(quick_check, elm.cp_offset() + j)) continue;
-        EmitCharacterFunction* emit_function = nullptr;
-        switch (pass) {
-          case NON_LATIN1_MATCH:
-            DCHECK(one_byte);
-            if (quarks[j] > String::kMaxOneByteCharCode) {
-              assembler->GoTo(backtrack);
-              return;
-            }
-            break;
-          case NON_LETTER_CHARACTER_MATCH:
-            emit_function = &EmitAtomNonLetter;
-            break;
-          case SIMPLE_CHARACTER_MATCH:
-            emit_function = &EmitSimpleCharacter;
-            break;
-          case CASE_CHARACTER_MATCH:
-            emit_function = &EmitAtomLetter;
-            break;
-          default:
-            break;
-        }
-        if (emit_function != nullptr) {
-          bool bounds_check = *checked_up_to < cp_offset + j || read_backward();
-          bool bound_checked =
-              emit_function(isolate, compiler, quarks[j], backtrack,
-                            cp_offset + j, bounds_check, preloaded);
-          if (bound_checked) UpdateBoundsCheck(cp_offset + j, checked_up_to);
-        }
-      }
-    } else {
-      DCHECK_EQ(TextElement::CHAR_CLASS, elm.text_type());
-      if (pass == CHARACTER_CLASS_MATCH) {
-        if (first_element_checked && i == 0) continue;
-        if (DeterminedAlready(quick_check, elm.cp_offset())) continue;
-        RegExpCharacterClass* cc = elm.char_class();
-        bool bounds_check = *checked_up_to < cp_offset || read_backward();
-        EmitCharClass(assembler, cc, one_byte, backtrack, cp_offset,
-                      bounds_check, preloaded, zone());
-        UpdateBoundsCheck(cp_offset, checked_up_to);
-      }
-    }
-  }
-}
-
-
-int TextNode::Length() {
-  TextElement elm = elements()->last();
-  DCHECK_LE(0, elm.cp_offset());
-  return elm.cp_offset() + elm.length();
-}
-
-bool TextNode::SkipPass(TextEmitPassType pass, bool ignore_case) {
-  if (ignore_case) {
-    return pass == SIMPLE_CHARACTER_MATCH;
-  } else {
-    return pass == NON_LETTER_CHARACTER_MATCH || pass == CASE_CHARACTER_MATCH;
-  }
-}
-
-TextNode* TextNode::CreateForCharacterRanges(Zone* zone,
-                                             ZoneList<CharacterRange>* ranges,
-                                             bool read_backward,
-                                             RegExpNode* on_success,
-                                             JSRegExp::Flags flags) {
-  DCHECK_NOT_NULL(ranges);
-  ZoneList<TextElement>* elms = new (zone) ZoneList<TextElement>(1, zone);
-  elms->Add(TextElement::CharClass(
-                new (zone) RegExpCharacterClass(zone, ranges, flags)),
-            zone);
-  return new (zone) TextNode(elms, read_backward, on_success);
-}
-
-TextNode* TextNode::CreateForSurrogatePair(Zone* zone, CharacterRange lead,
-                                           CharacterRange trail,
-                                           bool read_backward,
-                                           RegExpNode* on_success,
-                                           JSRegExp::Flags flags) {
-  ZoneList<CharacterRange>* lead_ranges = CharacterRange::List(zone, lead);
-  ZoneList<CharacterRange>* trail_ranges = CharacterRange::List(zone, trail);
-  ZoneList<TextElement>* elms = new (zone) ZoneList<TextElement>(2, zone);
-  elms->Add(TextElement::CharClass(
-                new (zone) RegExpCharacterClass(zone, lead_ranges, flags)),
-            zone);
-  elms->Add(TextElement::CharClass(
-                new (zone) RegExpCharacterClass(zone, trail_ranges, flags)),
-            zone);
-  return new (zone) TextNode(elms, read_backward, on_success);
-}
-
-
-// This generates the code to match a text node.  A text node can contain
-// straight character sequences (possibly to be matched in a case-independent
-// way) and character classes.  For efficiency we do not do this in a single
-// pass from left to right.  Instead we pass over the text node several times,
-// emitting code for some character positions every time.  See the comment on
-// TextEmitPass for details.
-void TextNode::Emit(RegExpCompiler* compiler, Trace* trace) {
-  LimitResult limit_result = LimitVersions(compiler, trace);
-  if (limit_result == DONE) return;
-  DCHECK(limit_result == CONTINUE);
-
-  if (trace->cp_offset() + Length() > RegExpMacroAssembler::kMaxCPOffset) {
-    compiler->SetRegExpTooBig();
-    return;
-  }
-
-  if (compiler->one_byte()) {
-    int dummy = 0;
-    TextEmitPass(compiler, NON_LATIN1_MATCH, false, trace, false, &dummy);
-  }
-
-  bool first_elt_done = false;
-  int bound_checked_to = trace->cp_offset() - 1;
-  bound_checked_to += trace->bound_checked_up_to();
-
-  // If a character is preloaded into the current character register then
-  // check that now.
-  if (trace->characters_preloaded() == 1) {
-    for (int pass = kFirstRealPass; pass <= kLastPass; pass++) {
-      TextEmitPass(compiler, static_cast<TextEmitPassType>(pass), true, trace,
-                   false, &bound_checked_to);
-    }
-    first_elt_done = true;
-  }
-
-  for (int pass = kFirstRealPass; pass <= kLastPass; pass++) {
-    TextEmitPass(compiler, static_cast<TextEmitPassType>(pass), false, trace,
-                 first_elt_done, &bound_checked_to);
-  }
-
-  Trace successor_trace(*trace);
-  // If we advance backward, we may end up at the start.
-  successor_trace.AdvanceCurrentPositionInTrace(
-      read_backward() ? -Length() : Length(), compiler);
-  successor_trace.set_at_start(read_backward() ? Trace::UNKNOWN
-                                               : Trace::FALSE_VALUE);
-  RecursionCheck rc(compiler);
-  on_success()->Emit(compiler, &successor_trace);
-}
-
-
-void Trace::InvalidateCurrentCharacter() {
-  characters_preloaded_ = 0;
-}
-
-
-void Trace::AdvanceCurrentPositionInTrace(int by, RegExpCompiler* compiler) {
-  // We don't have an instruction for shifting the current character register
-  // down or for using a shifted value for anything so lets just forget that
-  // we preloaded any characters into it.
-  characters_preloaded_ = 0;
-  // Adjust the offsets of the quick check performed information.  This
-  // information is used to find out what we already determined about the
-  // characters by means of mask and compare.
-  quick_check_performed_.Advance(by, compiler->one_byte());
-  cp_offset_ += by;
-  if (cp_offset_ > RegExpMacroAssembler::kMaxCPOffset) {
-    compiler->SetRegExpTooBig();
-    cp_offset_ = 0;
-  }
-  bound_checked_up_to_ = Max(0, bound_checked_up_to_ - by);
-}
-
-
-void TextNode::MakeCaseIndependent(Isolate* isolate, bool is_one_byte) {
-  int element_count = elements()->length();
-  for (int i = 0; i < element_count; i++) {
-    TextElement elm = elements()->at(i);
-    if (elm.text_type() == TextElement::CHAR_CLASS) {
-      RegExpCharacterClass* cc = elm.char_class();
-#ifdef V8_INTL_SUPPORT
-      bool case_equivalents_already_added =
-          NeedsUnicodeCaseEquivalents(cc->flags());
-#else
-      bool case_equivalents_already_added = false;
-#endif
-      if (IgnoreCase(cc->flags()) && !case_equivalents_already_added) {
-        // None of the standard character classes is different in the case
-        // independent case and it slows us down if we don't know that.
-        if (cc->is_standard(zone())) continue;
-        ZoneList<CharacterRange>* ranges = cc->ranges(zone());
-        CharacterRange::AddCaseEquivalents(isolate, zone(), ranges,
-                                           is_one_byte);
-      }
-    }
-  }
-}
-
-
-int TextNode::GreedyLoopTextLength() { return Length(); }
-
-
-RegExpNode* TextNode::GetSuccessorOfOmnivorousTextNode(
-    RegExpCompiler* compiler) {
-  if (read_backward()) return nullptr;
-  if (elements()->length() != 1) return nullptr;
-  TextElement elm = elements()->at(0);
-  if (elm.text_type() != TextElement::CHAR_CLASS) return nullptr;
-  RegExpCharacterClass* node = elm.char_class();
-  ZoneList<CharacterRange>* ranges = node->ranges(zone());
-  CharacterRange::Canonicalize(ranges);
-  if (node->is_negated()) {
-    return ranges->length() == 0 ? on_success() : nullptr;
-  }
-  if (ranges->length() != 1) return nullptr;
-  uint32_t max_char;
-  if (compiler->one_byte()) {
-    max_char = String::kMaxOneByteCharCode;
-  } else {
-    max_char = String::kMaxUtf16CodeUnit;
-  }
-  return ranges->at(0).IsEverything(max_char) ? on_success() : nullptr;
-}
-
-
-// Finds the fixed match length of a sequence of nodes that goes from
-// this alternative and back to this choice node.  If there are variable
-// length nodes or other complications in the way then return a sentinel
-// value indicating that a greedy loop cannot be constructed.
-int ChoiceNode::GreedyLoopTextLengthForAlternative(
-    GuardedAlternative* alternative) {
-  int length = 0;
-  RegExpNode* node = alternative->node();
-  // Later we will generate code for all these text nodes using recursion
-  // so we have to limit the max number.
-  int recursion_depth = 0;
-  while (node != this) {
-    if (recursion_depth++ > RegExpCompiler::kMaxRecursion) {
-      return kNodeIsTooComplexForGreedyLoops;
-    }
-    int node_length = node->GreedyLoopTextLength();
-    if (node_length == kNodeIsTooComplexForGreedyLoops) {
-      return kNodeIsTooComplexForGreedyLoops;
-    }
-    length += node_length;
-    SeqRegExpNode* seq_node = static_cast<SeqRegExpNode*>(node);
-    node = seq_node->on_success();
-  }
-  return read_backward() ? -length : length;
-}
-
-
-void LoopChoiceNode::AddLoopAlternative(GuardedAlternative alt) {
-  DCHECK_NULL(loop_node_);
-  AddAlternative(alt);
-  loop_node_ = alt.node();
-}
-
-
-void LoopChoiceNode::AddContinueAlternative(GuardedAlternative alt) {
-  DCHECK_NULL(continue_node_);
-  AddAlternative(alt);
-  continue_node_ = alt.node();
-}
-
-
-void LoopChoiceNode::Emit(RegExpCompiler* compiler, Trace* trace) {
-  RegExpMacroAssembler* macro_assembler = compiler->macro_assembler();
-  if (trace->stop_node() == this) {
-    // Back edge of greedy optimized loop node graph.
-    int text_length =
-        GreedyLoopTextLengthForAlternative(&(alternatives_->at(0)));
-    DCHECK_NE(kNodeIsTooComplexForGreedyLoops, text_length);
-    // Update the counter-based backtracking info on the stack.  This is an
-    // optimization for greedy loops (see below).
-    DCHECK(trace->cp_offset() == text_length);
-    macro_assembler->AdvanceCurrentPosition(text_length);
-    macro_assembler->GoTo(trace->loop_label());
-    return;
-  }
-  DCHECK_NULL(trace->stop_node());
-  if (!trace->is_trivial()) {
-    trace->Flush(compiler, this);
-    return;
-  }
-  ChoiceNode::Emit(compiler, trace);
-}
-
-
-int ChoiceNode::CalculatePreloadCharacters(RegExpCompiler* compiler,
-                                           int eats_at_least) {
-  int preload_characters = Min(4, eats_at_least);
-  DCHECK_LE(preload_characters, 4);
-  if (compiler->macro_assembler()->CanReadUnaligned()) {
-    bool one_byte = compiler->one_byte();
-    if (one_byte) {
-      // We can't preload 3 characters because there is no machine instruction
-      // to do that.  We can't just load 4 because we could be reading
-      // beyond the end of the string, which could cause a memory fault.
-      if (preload_characters == 3) preload_characters = 2;
-    } else {
-      if (preload_characters > 2) preload_characters = 2;
-    }
-  } else {
-    if (preload_characters > 1) preload_characters = 1;
-  }
-  return preload_characters;
-}
-
-
-// This class is used when generating the alternatives in a choice node.  It
-// records the way the alternative is being code generated.
-class AlternativeGeneration: public Malloced {
- public:
-  AlternativeGeneration()
-      : possible_success(),
-        expects_preload(false),
-        after(),
-        quick_check_details() { }
-  Label possible_success;
-  bool expects_preload;
-  Label after;
-  QuickCheckDetails quick_check_details;
-};
-
-
-// Creates a list of AlternativeGenerations.  If the list has a reasonable
-// size then it is on the stack, otherwise the excess is on the heap.
-class AlternativeGenerationList {
- public:
-  AlternativeGenerationList(int count, Zone* zone)
-      : alt_gens_(count, zone) {
-    for (int i = 0; i < count && i < kAFew; i++) {
-      alt_gens_.Add(a_few_alt_gens_ + i, zone);
-    }
-    for (int i = kAFew; i < count; i++) {
-      alt_gens_.Add(new AlternativeGeneration(), zone);
-    }
-  }
-  ~AlternativeGenerationList() {
-    for (int i = kAFew; i < alt_gens_.length(); i++) {
-      delete alt_gens_[i];
-      alt_gens_[i] = nullptr;
-    }
-  }
-
-  AlternativeGeneration* at(int i) {
-    return alt_gens_[i];
-  }
-
- private:
-  static const int kAFew = 10;
-  ZoneList<AlternativeGeneration*> alt_gens_;
-  AlternativeGeneration a_few_alt_gens_[kAFew];
-};
-
-
-static const uc32 kRangeEndMarker = 0x110000;
-
-// The '2' variant is has inclusive from and exclusive to.
-// This covers \s as defined in ECMA-262 5.1, 15.10.2.12,
-// which include WhiteSpace (7.2) or LineTerminator (7.3) values.
-static const int kSpaceRanges[] = {
-    '\t',   '\r' + 1, ' ',    ' ' + 1, 0x00A0, 0x00A1, 0x1680,
-    0x1681, 0x2000,   0x200B, 0x2028,  0x202A, 0x202F, 0x2030,
-    0x205F, 0x2060,   0x3000, 0x3001,  0xFEFF, 0xFF00, kRangeEndMarker};
-static const int kSpaceRangeCount = arraysize(kSpaceRanges);
-
-static const int kWordRanges[] = {
-    '0', '9' + 1, 'A', 'Z' + 1, '_', '_' + 1, 'a', 'z' + 1, kRangeEndMarker};
-static const int kWordRangeCount = arraysize(kWordRanges);
-static const int kDigitRanges[] = {'0', '9' + 1, kRangeEndMarker};
-static const int kDigitRangeCount = arraysize(kDigitRanges);
-static const int kSurrogateRanges[] = {
-    kLeadSurrogateStart, kLeadSurrogateStart + 1, kRangeEndMarker};
-static const int kSurrogateRangeCount = arraysize(kSurrogateRanges);
-static const int kLineTerminatorRanges[] = {
-    0x000A, 0x000B, 0x000D, 0x000E, 0x2028, 0x202A, kRangeEndMarker};
-static const int kLineTerminatorRangeCount = arraysize(kLineTerminatorRanges);
-
-void BoyerMoorePositionInfo::Set(int character) {
-  SetInterval(Interval(character, character));
-}
-
-
-void BoyerMoorePositionInfo::SetInterval(const Interval& interval) {
-  s_ = AddRange(s_, kSpaceRanges, kSpaceRangeCount, interval);
-  w_ = AddRange(w_, kWordRanges, kWordRangeCount, interval);
-  d_ = AddRange(d_, kDigitRanges, kDigitRangeCount, interval);
-  surrogate_ =
-      AddRange(surrogate_, kSurrogateRanges, kSurrogateRangeCount, interval);
-  if (interval.to() - interval.from() >= kMapSize - 1) {
-    if (map_count_ != kMapSize) {
-      map_count_ = kMapSize;
-      for (int i = 0; i < kMapSize; i++) map_->at(i) = true;
-    }
-    return;
-  }
-  for (int i = interval.from(); i <= interval.to(); i++) {
-    int mod_character = (i & kMask);
-    if (!map_->at(mod_character)) {
-      map_count_++;
-      map_->at(mod_character) = true;
-    }
-    if (map_count_ == kMapSize) return;
-  }
-}
-
-
-void BoyerMoorePositionInfo::SetAll() {
-  s_ = w_ = d_ = kLatticeUnknown;
-  if (map_count_ != kMapSize) {
-    map_count_ = kMapSize;
-    for (int i = 0; i < kMapSize; i++) map_->at(i) = true;
-  }
-}
-
-
-BoyerMooreLookahead::BoyerMooreLookahead(
-    int length, RegExpCompiler* compiler, Zone* zone)
-    : length_(length),
-      compiler_(compiler) {
-  if (compiler->one_byte()) {
-    max_char_ = String::kMaxOneByteCharCode;
-  } else {
-    max_char_ = String::kMaxUtf16CodeUnit;
-  }
-  bitmaps_ = new(zone) ZoneList<BoyerMoorePositionInfo*>(length, zone);
-  for (int i = 0; i < length; i++) {
-    bitmaps_->Add(new(zone) BoyerMoorePositionInfo(zone), zone);
-  }
-}
-
-
-// Find the longest range of lookahead that has the fewest number of different
-// characters that can occur at a given position.  Since we are optimizing two
-// different parameters at once this is a tradeoff.
-bool BoyerMooreLookahead::FindWorthwhileInterval(int* from, int* to) {
-  int biggest_points = 0;
-  // If more than 32 characters out of 128 can occur it is unlikely that we can
-  // be lucky enough to step forwards much of the time.
-  const int kMaxMax = 32;
-  for (int max_number_of_chars = 4;
-       max_number_of_chars < kMaxMax;
-       max_number_of_chars *= 2) {
-    biggest_points =
-        FindBestInterval(max_number_of_chars, biggest_points, from, to);
-  }
-  if (biggest_points == 0) return false;
-  return true;
-}
-
-
-// Find the highest-points range between 0 and length_ where the character
-// information is not too vague.  'Too vague' means that there are more than
-// max_number_of_chars that can occur at this position.  Calculates the number
-// of points as the product of width-of-the-range and
-// probability-of-finding-one-of-the-characters, where the probability is
-// calculated using the frequency distribution of the sample subject string.
-int BoyerMooreLookahead::FindBestInterval(
-    int max_number_of_chars, int old_biggest_points, int* from, int* to) {
-  int biggest_points = old_biggest_points;
-  static const int kSize = RegExpMacroAssembler::kTableSize;
-  for (int i = 0; i < length_; ) {
-    while (i < length_ && Count(i) > max_number_of_chars) i++;
-    if (i == length_) break;
-    int remembered_from = i;
-    bool union_map[kSize];
-    for (int j = 0; j < kSize; j++) union_map[j] = false;
-    while (i < length_ && Count(i) <= max_number_of_chars) {
-      BoyerMoorePositionInfo* map = bitmaps_->at(i);
-      for (int j = 0; j < kSize; j++) union_map[j] |= map->at(j);
-      i++;
-    }
-    int frequency = 0;
-    for (int j = 0; j < kSize; j++) {
-      if (union_map[j]) {
-        // Add 1 to the frequency to give a small per-character boost for
-        // the cases where our sampling is not good enough and many
-        // characters have a frequency of zero.  This means the frequency
-        // can theoretically be up to 2*kSize though we treat it mostly as
-        // a fraction of kSize.
-        frequency += compiler_->frequency_collator()->Frequency(j) + 1;
-      }
-    }
-    // We use the probability of skipping times the distance we are skipping to
-    // judge the effectiveness of this.  Actually we have a cut-off:  By
-    // dividing by 2 we switch off the skipping if the probability of skipping
-    // is less than 50%.  This is because the multibyte mask-and-compare
-    // skipping in quickcheck is more likely to do well on this case.
-    bool in_quickcheck_range =
-        ((i - remembered_from < 4) ||
-         (compiler_->one_byte() ? remembered_from <= 4 : remembered_from <= 2));
-    // Called 'probability' but it is only a rough estimate and can actually
-    // be outside the 0-kSize range.
-    int probability = (in_quickcheck_range ? kSize / 2 : kSize) - frequency;
-    int points = (i - remembered_from) * probability;
-    if (points > biggest_points) {
-      *from = remembered_from;
-      *to = i - 1;
-      biggest_points = points;
-    }
-  }
-  return biggest_points;
-}
-
-
-// Take all the characters that will not prevent a successful match if they
-// occur in the subject string in the range between min_lookahead and
-// max_lookahead (inclusive) measured from the current position.  If the
-// character at max_lookahead offset is not one of these characters, then we
-// can safely skip forwards by the number of characters in the range.
-int BoyerMooreLookahead::GetSkipTable(int min_lookahead,
-                                      int max_lookahead,
-                                      Handle<ByteArray> boolean_skip_table) {
-  const int kSize = RegExpMacroAssembler::kTableSize;
-
-  const int kSkipArrayEntry = 0;
-  const int kDontSkipArrayEntry = 1;
-
-  for (int i = 0; i < kSize; i++) {
-    boolean_skip_table->set(i, kSkipArrayEntry);
-  }
-  int skip = max_lookahead + 1 - min_lookahead;
-
-  for (int i = max_lookahead; i >= min_lookahead; i--) {
-    BoyerMoorePositionInfo* map = bitmaps_->at(i);
-    for (int j = 0; j < kSize; j++) {
-      if (map->at(j)) {
-        boolean_skip_table->set(j, kDontSkipArrayEntry);
-      }
-    }
-  }
-
-  return skip;
-}
-
-
-// See comment above on the implementation of GetSkipTable.
-void BoyerMooreLookahead::EmitSkipInstructions(RegExpMacroAssembler* masm) {
-  const int kSize = RegExpMacroAssembler::kTableSize;
-
-  int min_lookahead = 0;
-  int max_lookahead = 0;
-
-  if (!FindWorthwhileInterval(&min_lookahead, &max_lookahead)) return;
-
-  bool found_single_character = false;
-  int single_character = 0;
-  for (int i = max_lookahead; i >= min_lookahead; i--) {
-    BoyerMoorePositionInfo* map = bitmaps_->at(i);
-    if (map->map_count() > 1 ||
-        (found_single_character && map->map_count() != 0)) {
-      found_single_character = false;
-      break;
-    }
-    for (int j = 0; j < kSize; j++) {
-      if (map->at(j)) {
-        found_single_character = true;
-        single_character = j;
-        break;
-      }
-    }
-  }
-
-  int lookahead_width = max_lookahead + 1 - min_lookahead;
-
-  if (found_single_character && lookahead_width == 1 && max_lookahead < 3) {
-    // The mask-compare can probably handle this better.
-    return;
-  }
-
-  if (found_single_character) {
-    Label cont, again;
-    masm->Bind(&again);
-    masm->LoadCurrentCharacter(max_lookahead, &cont, true);
-    if (max_char_ > kSize) {
-      masm->CheckCharacterAfterAnd(single_character,
-                                   RegExpMacroAssembler::kTableMask,
-                                   &cont);
-    } else {
-      masm->CheckCharacter(single_character, &cont);
-    }
-    masm->AdvanceCurrentPosition(lookahead_width);
-    masm->GoTo(&again);
-    masm->Bind(&cont);
-    return;
-  }
-
-  Factory* factory = masm->isolate()->factory();
-  Handle<ByteArray> boolean_skip_table = factory->NewByteArray(kSize, TENURED);
-  int skip_distance = GetSkipTable(
-      min_lookahead, max_lookahead, boolean_skip_table);
-  DCHECK_NE(0, skip_distance);
-
-  Label cont, again;
-  masm->Bind(&again);
-  masm->LoadCurrentCharacter(max_lookahead, &cont, true);
-  masm->CheckBitInTable(boolean_skip_table, &cont);
-  masm->AdvanceCurrentPosition(skip_distance);
-  masm->GoTo(&again);
-  masm->Bind(&cont);
-}
-
-
-/* Code generation for choice nodes.
- *
- * We generate quick checks that do a mask and compare to eliminate a
- * choice.  If the quick check succeeds then it jumps to the continuation to
- * do slow checks and check subsequent nodes.  If it fails (the common case)
- * it falls through to the next choice.
- *
- * Here is the desired flow graph.  Nodes directly below each other imply
- * fallthrough.  Alternatives 1 and 2 have quick checks.  Alternative
- * 3 doesn't have a quick check so we have to call the slow check.
- * Nodes are marked Qn for quick checks and Sn for slow checks.  The entire
- * regexp continuation is generated directly after the Sn node, up to the
- * next GoTo if we decide to reuse some already generated code.  Some
- * nodes expect preload_characters to be preloaded into the current
- * character register.  R nodes do this preloading.  Vertices are marked
- * F for failures and S for success (possible success in the case of quick
- * nodes).  L, V, < and > are used as arrow heads.
- *
- * ----------> R
- *             |
- *             V
- *            Q1 -----> S1
- *             |   S   /
- *            F|      /
- *             |    F/
- *             |    /
- *             |   R
- *             |  /
- *             V L
- *            Q2 -----> S2
- *             |   S   /
- *            F|      /
- *             |    F/
- *             |    /
- *             |   R
- *             |  /
- *             V L
- *            S3
- *             |
- *            F|
- *             |
- *             R
- *             |
- * backtrack   V
- * <----------Q4
- *   \    F    |
- *    \        |S
- *     \   F   V
- *      \-----S4
- *
- * For greedy loops we push the current position, then generate the code that
- * eats the input specially in EmitGreedyLoop.  The other choice (the
- * continuation) is generated by the normal code in EmitChoices, and steps back
- * in the input to the starting position when it fails to match.  The loop code
- * looks like this (U is the unwind code that steps back in the greedy loop).
- *
- *              _____
- *             /     \
- *             V     |
- * ----------> S1    |
- *            /|     |
- *           / |S    |
- *         F/  \_____/
- *         /
- *        |<-----
- *        |      \
- *        V       |S
- *        Q2 ---> U----->backtrack
- *        |  F   /
- *       S|     /
- *        V  F /
- *        S2--/
- */
-
-GreedyLoopState::GreedyLoopState(bool not_at_start) {
-  counter_backtrack_trace_.set_backtrack(&label_);
-  if (not_at_start) counter_backtrack_trace_.set_at_start(Trace::FALSE_VALUE);
-}
-
-
-void ChoiceNode::AssertGuardsMentionRegisters(Trace* trace) {
-#ifdef DEBUG
-  int choice_count = alternatives_->length();
-  for (int i = 0; i < choice_count - 1; i++) {
-    GuardedAlternative alternative = alternatives_->at(i);
-    ZoneList<Guard*>* guards = alternative.guards();
-    int guard_count = (guards == nullptr) ? 0 : guards->length();
-    for (int j = 0; j < guard_count; j++) {
-      DCHECK(!trace->mentions_reg(guards->at(j)->reg()));
-    }
-  }
-#endif
-}
-
-
-void ChoiceNode::SetUpPreLoad(RegExpCompiler* compiler,
-                              Trace* current_trace,
-                              PreloadState* state) {
-    if (state->eats_at_least_ == PreloadState::kEatsAtLeastNotYetInitialized) {
-      // Save some time by looking at most one machine word ahead.
-      state->eats_at_least_ =
-          EatsAtLeast(compiler->one_byte() ? 4 : 2, kRecursionBudget,
-                      current_trace->at_start() == Trace::FALSE_VALUE);
-    }
-    state->preload_characters_ =
-        CalculatePreloadCharacters(compiler, state->eats_at_least_);
-
-    state->preload_is_current_ =
-        (current_trace->characters_preloaded() == state->preload_characters_);
-    state->preload_has_checked_bounds_ = state->preload_is_current_;
-}
-
-
-void ChoiceNode::Emit(RegExpCompiler* compiler, Trace* trace) {
-  int choice_count = alternatives_->length();
-
-  if (choice_count == 1 && alternatives_->at(0).guards() == nullptr) {
-    alternatives_->at(0).node()->Emit(compiler, trace);
-    return;
-  }
-
-  AssertGuardsMentionRegisters(trace);
-
-  LimitResult limit_result = LimitVersions(compiler, trace);
-  if (limit_result == DONE) return;
-  DCHECK(limit_result == CONTINUE);
-
-  // For loop nodes we already flushed (see LoopChoiceNode::Emit), but for
-  // other choice nodes we only flush if we are out of code size budget.
-  if (trace->flush_budget() == 0 && trace->actions() != nullptr) {
-    trace->Flush(compiler, this);
-    return;
-  }
-
-  RecursionCheck rc(compiler);
-
-  PreloadState preload;
-  preload.init();
-  GreedyLoopState greedy_loop_state(not_at_start());
-
-  int text_length = GreedyLoopTextLengthForAlternative(&alternatives_->at(0));
-  AlternativeGenerationList alt_gens(choice_count, zone());
-
-  if (choice_count > 1 && text_length != kNodeIsTooComplexForGreedyLoops) {
-    trace = EmitGreedyLoop(compiler,
-                           trace,
-                           &alt_gens,
-                           &preload,
-                           &greedy_loop_state,
-                           text_length);
-  } else {
-    // TODO(erikcorry): Delete this.  We don't need this label, but it makes us
-    // match the traces produced pre-cleanup.
-    Label second_choice;
-    compiler->macro_assembler()->Bind(&second_choice);
-
-    preload.eats_at_least_ = EmitOptimizedUnanchoredSearch(compiler, trace);
-
-    EmitChoices(compiler,
-                &alt_gens,
-                0,
-                trace,
-                &preload);
-  }
-
-  // At this point we need to generate slow checks for the alternatives where
-  // the quick check was inlined.  We can recognize these because the associated
-  // label was bound.
-  int new_flush_budget = trace->flush_budget() / choice_count;
-  for (int i = 0; i < choice_count; i++) {
-    AlternativeGeneration* alt_gen = alt_gens.at(i);
-    Trace new_trace(*trace);
-    // If there are actions to be flushed we have to limit how many times
-    // they are flushed.  Take the budget of the parent trace and distribute
-    // it fairly amongst the children.
-    if (new_trace.actions() != nullptr) {
-      new_trace.set_flush_budget(new_flush_budget);
-    }
-    bool next_expects_preload =
-        i == choice_count - 1 ? false : alt_gens.at(i + 1)->expects_preload;
-    EmitOutOfLineContinuation(compiler,
-                              &new_trace,
-                              alternatives_->at(i),
-                              alt_gen,
-                              preload.preload_characters_,
-                              next_expects_preload);
-  }
-}
-
-
-Trace* ChoiceNode::EmitGreedyLoop(RegExpCompiler* compiler,
-                                  Trace* trace,
-                                  AlternativeGenerationList* alt_gens,
-                                  PreloadState* preload,
-                                  GreedyLoopState* greedy_loop_state,
-                                  int text_length) {
-  RegExpMacroAssembler* macro_assembler = compiler->macro_assembler();
-  // Here we have special handling for greedy loops containing only text nodes
-  // and other simple nodes.  These are handled by pushing the current
-  // position on the stack and then incrementing the current position each
-  // time around the switch.  On backtrack we decrement the current position
-  // and check it against the pushed value.  This avoids pushing backtrack
-  // information for each iteration of the loop, which could take up a lot of
-  // space.
-  DCHECK(trace->stop_node() == nullptr);
-  macro_assembler->PushCurrentPosition();
-  Label greedy_match_failed;
-  Trace greedy_match_trace;
-  if (not_at_start()) greedy_match_trace.set_at_start(Trace::FALSE_VALUE);
-  greedy_match_trace.set_backtrack(&greedy_match_failed);
-  Label loop_label;
-  macro_assembler->Bind(&loop_label);
-  greedy_match_trace.set_stop_node(this);
-  greedy_match_trace.set_loop_label(&loop_label);
-  alternatives_->at(0).node()->Emit(compiler, &greedy_match_trace);
-  macro_assembler->Bind(&greedy_match_failed);
-
-  Label second_choice;  // For use in greedy matches.
-  macro_assembler->Bind(&second_choice);
-
-  Trace* new_trace = greedy_loop_state->counter_backtrack_trace();
-
-  EmitChoices(compiler,
-              alt_gens,
-              1,
-              new_trace,
-              preload);
-
-  macro_assembler->Bind(greedy_loop_state->label());
-  // If we have unwound to the bottom then backtrack.
-  macro_assembler->CheckGreedyLoop(trace->backtrack());
-  // Otherwise try the second priority at an earlier position.
-  macro_assembler->AdvanceCurrentPosition(-text_length);
-  macro_assembler->GoTo(&second_choice);
-  return new_trace;
-}
-
-int ChoiceNode::EmitOptimizedUnanchoredSearch(RegExpCompiler* compiler,
-                                              Trace* trace) {
-  int eats_at_least = PreloadState::kEatsAtLeastNotYetInitialized;
-  if (alternatives_->length() != 2) return eats_at_least;
-
-  GuardedAlternative alt1 = alternatives_->at(1);
-  if (alt1.guards() != nullptr && alt1.guards()->length() != 0) {
-    return eats_at_least;
-  }
-  RegExpNode* eats_anything_node = alt1.node();
-  if (eats_anything_node->GetSuccessorOfOmnivorousTextNode(compiler) != this) {
-    return eats_at_least;
-  }
-
-  // Really we should be creating a new trace when we execute this function,
-  // but there is no need, because the code it generates cannot backtrack, and
-  // we always arrive here with a trivial trace (since it's the entry to a
-  // loop.  That also implies that there are no preloaded characters, which is
-  // good, because it means we won't be violating any assumptions by
-  // overwriting those characters with new load instructions.
-  DCHECK(trace->is_trivial());
-
-  RegExpMacroAssembler* macro_assembler = compiler->macro_assembler();
-  Isolate* isolate = macro_assembler->isolate();
-  // At this point we know that we are at a non-greedy loop that will eat
-  // any character one at a time.  Any non-anchored regexp has such a
-  // loop prepended to it in order to find where it starts.  We look for
-  // a pattern of the form ...abc... where we can look 6 characters ahead
-  // and step forwards 3 if the character is not one of abc.  Abc need
-  // not be atoms, they can be any reasonably limited character class or
-  // small alternation.
-  BoyerMooreLookahead* bm = bm_info(false);
-  if (bm == nullptr) {
-    eats_at_least = Min(kMaxLookaheadForBoyerMoore,
-                        EatsAtLeast(kMaxLookaheadForBoyerMoore,
-                                    kRecursionBudget,
-                                    false));
-    if (eats_at_least >= 1) {
-      bm = new(zone()) BoyerMooreLookahead(eats_at_least,
-                                           compiler,
-                                           zone());
-      GuardedAlternative alt0 = alternatives_->at(0);
-      alt0.node()->FillInBMInfo(isolate, 0, kRecursionBudget, bm, false);
-    }
-  }
-  if (bm != nullptr) {
-    bm->EmitSkipInstructions(macro_assembler);
-  }
-  return eats_at_least;
-}
-
-
-void ChoiceNode::EmitChoices(RegExpCompiler* compiler,
-                             AlternativeGenerationList* alt_gens,
-                             int first_choice,
-                             Trace* trace,
-                             PreloadState* preload) {
-  RegExpMacroAssembler* macro_assembler = compiler->macro_assembler();
-  SetUpPreLoad(compiler, trace, preload);
-
-  // For now we just call all choices one after the other.  The idea ultimately
-  // is to use the Dispatch table to try only the relevant ones.
-  int choice_count = alternatives_->length();
-
-  int new_flush_budget = trace->flush_budget() / choice_count;
-
-  for (int i = first_choice; i < choice_count; i++) {
-    bool is_last = i == choice_count - 1;
-    bool fall_through_on_failure = !is_last;
-    GuardedAlternative alternative = alternatives_->at(i);
-    AlternativeGeneration* alt_gen = alt_gens->at(i);
-    alt_gen->quick_check_details.set_characters(preload->preload_characters_);
-    ZoneList<Guard*>* guards = alternative.guards();
-    int guard_count = (guards == nullptr) ? 0 : guards->length();
-    Trace new_trace(*trace);
-    new_trace.set_characters_preloaded(preload->preload_is_current_ ?
-                                         preload->preload_characters_ :
-                                         0);
-    if (preload->preload_has_checked_bounds_) {
-      new_trace.set_bound_checked_up_to(preload->preload_characters_);
-    }
-    new_trace.quick_check_performed()->Clear();
-    if (not_at_start_) new_trace.set_at_start(Trace::FALSE_VALUE);
-    if (!is_last) {
-      new_trace.set_backtrack(&alt_gen->after);
-    }
-    alt_gen->expects_preload = preload->preload_is_current_;
-    bool generate_full_check_inline = false;
-    if (compiler->optimize() &&
-        try_to_emit_quick_check_for_alternative(i == 0) &&
-        alternative.node()->EmitQuickCheck(
-            compiler, trace, &new_trace, preload->preload_has_checked_bounds_,
-            &alt_gen->possible_success, &alt_gen->quick_check_details,
-            fall_through_on_failure)) {
-      // Quick check was generated for this choice.
-      preload->preload_is_current_ = true;
-      preload->preload_has_checked_bounds_ = true;
-      // If we generated the quick check to fall through on possible success,
-      // we now need to generate the full check inline.
-      if (!fall_through_on_failure) {
-        macro_assembler->Bind(&alt_gen->possible_success);
-        new_trace.set_quick_check_performed(&alt_gen->quick_check_details);
-        new_trace.set_characters_preloaded(preload->preload_characters_);
-        new_trace.set_bound_checked_up_to(preload->preload_characters_);
-        generate_full_check_inline = true;
-      }
-    } else if (alt_gen->quick_check_details.cannot_match()) {
-      if (!fall_through_on_failure) {
-        macro_assembler->GoTo(trace->backtrack());
-      }
-      continue;
-    } else {
-      // No quick check was generated.  Put the full code here.
-      // If this is not the first choice then there could be slow checks from
-      // previous cases that go here when they fail.  There's no reason to
-      // insist that they preload characters since the slow check we are about
-      // to generate probably can't use it.
-      if (i != first_choice) {
-        alt_gen->expects_preload = false;
-        new_trace.InvalidateCurrentCharacter();
-      }
-      generate_full_check_inline = true;
-    }
-    if (generate_full_check_inline) {
-      if (new_trace.actions() != nullptr) {
-        new_trace.set_flush_budget(new_flush_budget);
-      }
-      for (int j = 0; j < guard_count; j++) {
-        GenerateGuard(macro_assembler, guards->at(j), &new_trace);
-      }
-      alternative.node()->Emit(compiler, &new_trace);
-      preload->preload_is_current_ = false;
-    }
-    macro_assembler->Bind(&alt_gen->after);
-  }
-}
-
-
-void ChoiceNode::EmitOutOfLineContinuation(RegExpCompiler* compiler,
-                                           Trace* trace,
-                                           GuardedAlternative alternative,
-                                           AlternativeGeneration* alt_gen,
-                                           int preload_characters,
-                                           bool next_expects_preload) {
-  if (!alt_gen->possible_success.is_linked()) return;
-
-  RegExpMacroAssembler* macro_assembler = compiler->macro_assembler();
-  macro_assembler->Bind(&alt_gen->possible_success);
-  Trace out_of_line_trace(*trace);
-  out_of_line_trace.set_characters_preloaded(preload_characters);
-  out_of_line_trace.set_quick_check_performed(&alt_gen->quick_check_details);
-  if (not_at_start_) out_of_line_trace.set_at_start(Trace::FALSE_VALUE);
-  ZoneList<Guard*>* guards = alternative.guards();
-  int guard_count = (guards == nullptr) ? 0 : guards->length();
-  if (next_expects_preload) {
-    Label reload_current_char;
-    out_of_line_trace.set_backtrack(&reload_current_char);
-    for (int j = 0; j < guard_count; j++) {
-      GenerateGuard(macro_assembler, guards->at(j), &out_of_line_trace);
-    }
-    alternative.node()->Emit(compiler, &out_of_line_trace);
-    macro_assembler->Bind(&reload_current_char);
-    // Reload the current character, since the next quick check expects that.
-    // We don't need to check bounds here because we only get into this
-    // code through a quick check which already did the checked load.
-    macro_assembler->LoadCurrentCharacter(trace->cp_offset(), nullptr, false,
-                                          preload_characters);
-    macro_assembler->GoTo(&(alt_gen->after));
-  } else {
-    out_of_line_trace.set_backtrack(&(alt_gen->after));
-    for (int j = 0; j < guard_count; j++) {
-      GenerateGuard(macro_assembler, guards->at(j), &out_of_line_trace);
-    }
-    alternative.node()->Emit(compiler, &out_of_line_trace);
-  }
-}
-
-
-void ActionNode::Emit(RegExpCompiler* compiler, Trace* trace) {
-  RegExpMacroAssembler* assembler = compiler->macro_assembler();
-  LimitResult limit_result = LimitVersions(compiler, trace);
-  if (limit_result == DONE) return;
-  DCHECK(limit_result == CONTINUE);
-
-  RecursionCheck rc(compiler);
-
-  switch (action_type_) {
-    case STORE_POSITION: {
-      Trace::DeferredCapture
-          new_capture(data_.u_position_register.reg,
-                      data_.u_position_register.is_capture,
-                      trace);
-      Trace new_trace = *trace;
-      new_trace.add_action(&new_capture);
-      on_success()->Emit(compiler, &new_trace);
-      break;
-    }
-    case INCREMENT_REGISTER: {
-      Trace::DeferredIncrementRegister
-          new_increment(data_.u_increment_register.reg);
-      Trace new_trace = *trace;
-      new_trace.add_action(&new_increment);
-      on_success()->Emit(compiler, &new_trace);
-      break;
-    }
-    case SET_REGISTER: {
-      Trace::DeferredSetRegister
-          new_set(data_.u_store_register.reg, data_.u_store_register.value);
-      Trace new_trace = *trace;
-      new_trace.add_action(&new_set);
-      on_success()->Emit(compiler, &new_trace);
-      break;
-    }
-    case CLEAR_CAPTURES: {
-      Trace::DeferredClearCaptures
-        new_capture(Interval(data_.u_clear_captures.range_from,
-                             data_.u_clear_captures.range_to));
-      Trace new_trace = *trace;
-      new_trace.add_action(&new_capture);
-      on_success()->Emit(compiler, &new_trace);
-      break;
-    }
-    case BEGIN_SUBMATCH:
-      if (!trace->is_trivial()) {
-        trace->Flush(compiler, this);
-      } else {
-        assembler->WriteCurrentPositionToRegister(
-            data_.u_submatch.current_position_register, 0);
-        assembler->WriteStackPointerToRegister(
-            data_.u_submatch.stack_pointer_register);
-        on_success()->Emit(compiler, trace);
-      }
-      break;
-    case EMPTY_MATCH_CHECK: {
-      int start_pos_reg = data_.u_empty_match_check.start_register;
-      int stored_pos = 0;
-      int rep_reg = data_.u_empty_match_check.repetition_register;
-      bool has_minimum = (rep_reg != RegExpCompiler::kNoRegister);
-      bool know_dist = trace->GetStoredPosition(start_pos_reg, &stored_pos);
-      if (know_dist && !has_minimum && stored_pos == trace->cp_offset()) {
-        // If we know we haven't advanced and there is no minimum we
-        // can just backtrack immediately.
-        assembler->GoTo(trace->backtrack());
-      } else if (know_dist && stored_pos < trace->cp_offset()) {
-        // If we know we've advanced we can generate the continuation
-        // immediately.
-        on_success()->Emit(compiler, trace);
-      } else if (!trace->is_trivial()) {
-        trace->Flush(compiler, this);
-      } else {
-        Label skip_empty_check;
-        // If we have a minimum number of repetitions we check the current
-        // number first and skip the empty check if it's not enough.
-        if (has_minimum) {
-          int limit = data_.u_empty_match_check.repetition_limit;
-          assembler->IfRegisterLT(rep_reg, limit, &skip_empty_check);
-        }
-        // If the match is empty we bail out, otherwise we fall through
-        // to the on-success continuation.
-        assembler->IfRegisterEqPos(data_.u_empty_match_check.start_register,
-                                   trace->backtrack());
-        assembler->Bind(&skip_empty_check);
-        on_success()->Emit(compiler, trace);
-      }
-      break;
-    }
-    case POSITIVE_SUBMATCH_SUCCESS: {
-      if (!trace->is_trivial()) {
-        trace->Flush(compiler, this);
-        return;
-      }
-      assembler->ReadCurrentPositionFromRegister(
-          data_.u_submatch.current_position_register);
-      assembler->ReadStackPointerFromRegister(
-          data_.u_submatch.stack_pointer_register);
-      int clear_register_count = data_.u_submatch.clear_register_count;
-      if (clear_register_count == 0) {
-        on_success()->Emit(compiler, trace);
-        return;
-      }
-      int clear_registers_from = data_.u_submatch.clear_register_from;
-      Label clear_registers_backtrack;
-      Trace new_trace = *trace;
-      new_trace.set_backtrack(&clear_registers_backtrack);
-      on_success()->Emit(compiler, &new_trace);
-
-      assembler->Bind(&clear_registers_backtrack);
-      int clear_registers_to = clear_registers_from + clear_register_count - 1;
-      assembler->ClearRegisters(clear_registers_from, clear_registers_to);
-
-      DCHECK(trace->backtrack() == nullptr);
-      assembler->Backtrack();
-      return;
-    }
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-void BackReferenceNode::Emit(RegExpCompiler* compiler, Trace* trace) {
-  RegExpMacroAssembler* assembler = compiler->macro_assembler();
-  if (!trace->is_trivial()) {
-    trace->Flush(compiler, this);
-    return;
-  }
-
-  LimitResult limit_result = LimitVersions(compiler, trace);
-  if (limit_result == DONE) return;
-  DCHECK(limit_result == CONTINUE);
-
-  RecursionCheck rc(compiler);
-
-  DCHECK_EQ(start_reg_ + 1, end_reg_);
-  if (IgnoreCase(flags_)) {
-    assembler->CheckNotBackReferenceIgnoreCase(
-        start_reg_, read_backward(), IsUnicode(flags_), trace->backtrack());
-  } else {
-    assembler->CheckNotBackReference(start_reg_, read_backward(),
-                                     trace->backtrack());
-  }
-  // We are going to advance backward, so we may end up at the start.
-  if (read_backward()) trace->set_at_start(Trace::UNKNOWN);
-
-  // Check that the back reference does not end inside a surrogate pair.
-  if (IsUnicode(flags_) && !compiler->one_byte()) {
-    assembler->CheckNotInSurrogatePair(trace->cp_offset(), trace->backtrack());
-  }
-  on_success()->Emit(compiler, trace);
-}
-
-
-// -------------------------------------------------------------------
-// Dot/dotty output
-
-
-#ifdef DEBUG
-
-
-class DotPrinter: public NodeVisitor {
- public:
-  DotPrinter(std::ostream& os, bool ignore_case)  // NOLINT
-      : os_(os),
-        ignore_case_(ignore_case) {}
-  void PrintNode(const char* label, RegExpNode* node);
-  void Visit(RegExpNode* node);
-  void PrintAttributes(RegExpNode* from);
-  void PrintOnFailure(RegExpNode* from, RegExpNode* to);
-#define DECLARE_VISIT(Type)                                          \
-  virtual void Visit##Type(Type##Node* that);
-FOR_EACH_NODE_TYPE(DECLARE_VISIT)
-#undef DECLARE_VISIT
- private:
-  std::ostream& os_;
-  bool ignore_case_;
-};
-
-
-void DotPrinter::PrintNode(const char* label, RegExpNode* node) {
-  os_ << "digraph G {\n  graph [label=\"";
-  for (int i = 0; label[i]; i++) {
-    switch (label[i]) {
-      case '\\':
-        os_ << "\\\\";
-        break;
-      case '"':
-        os_ << "\"";
-        break;
-      default:
-        os_ << label[i];
-        break;
-    }
-  }
-  os_ << "\"];\n";
-  Visit(node);
-  os_ << "}" << std::endl;
-}
-
-
-void DotPrinter::Visit(RegExpNode* node) {
-  if (node->info()->visited) return;
-  node->info()->visited = true;
-  node->Accept(this);
-}
-
-
-void DotPrinter::PrintOnFailure(RegExpNode* from, RegExpNode* on_failure) {
-  os_ << "  n" << from << " -> n" << on_failure << " [style=dotted];\n";
-  Visit(on_failure);
-}
-
-
-class TableEntryBodyPrinter {
- public:
-  TableEntryBodyPrinter(std::ostream& os, ChoiceNode* choice)  // NOLINT
-      : os_(os),
-        choice_(choice) {}
-  void Call(uc16 from, DispatchTable::Entry entry) {
-    OutSet* out_set = entry.out_set();
-    for (unsigned i = 0; i < OutSet::kFirstLimit; i++) {
-      if (out_set->Get(i)) {
-        os_ << "    n" << choice() << ":s" << from << "o" << i << " -> n"
-            << choice()->alternatives()->at(i).node() << ";\n";
-      }
-    }
-  }
- private:
-  ChoiceNode* choice() { return choice_; }
-  std::ostream& os_;
-  ChoiceNode* choice_;
-};
-
-
-class TableEntryHeaderPrinter {
- public:
-  explicit TableEntryHeaderPrinter(std::ostream& os)  // NOLINT
-      : first_(true),
-        os_(os) {}
-  void Call(uc16 from, DispatchTable::Entry entry) {
-    if (first_) {
-      first_ = false;
-    } else {
-      os_ << "|";
-    }
-    os_ << "{\\" << AsUC16(from) << "-\\" << AsUC16(entry.to()) << "|{";
-    OutSet* out_set = entry.out_set();
-    int priority = 0;
-    for (unsigned i = 0; i < OutSet::kFirstLimit; i++) {
-      if (out_set->Get(i)) {
-        if (priority > 0) os_ << "|";
-        os_ << "<s" << from << "o" << i << "> " << priority;
-        priority++;
-      }
-    }
-    os_ << "}}";
-  }
-
- private:
-  bool first_;
-  std::ostream& os_;
-};
-
-
-class AttributePrinter {
- public:
-  explicit AttributePrinter(std::ostream& os)  // NOLINT
-      : os_(os),
-        first_(true) {}
-  void PrintSeparator() {
-    if (first_) {
-      first_ = false;
-    } else {
-      os_ << "|";
-    }
-  }
-  void PrintBit(const char* name, bool value) {
-    if (!value) return;
-    PrintSeparator();
-    os_ << "{" << name << "}";
-  }
-  void PrintPositive(const char* name, int value) {
-    if (value < 0) return;
-    PrintSeparator();
-    os_ << "{" << name << "|" << value << "}";
-  }
-
- private:
-  std::ostream& os_;
-  bool first_;
-};
-
-
-void DotPrinter::PrintAttributes(RegExpNode* that) {
-  os_ << "  a" << that << " [shape=Mrecord, color=grey, fontcolor=grey, "
-      << "margin=0.1, fontsize=10, label=\"{";
-  AttributePrinter printer(os_);
-  NodeInfo* info = that->info();
-  printer.PrintBit("NI", info->follows_newline_interest);
-  printer.PrintBit("WI", info->follows_word_interest);
-  printer.PrintBit("SI", info->follows_start_interest);
-  Label* label = that->label();
-  if (label->is_bound())
-    printer.PrintPositive("@", label->pos());
-  os_ << "}\"];\n"
-      << "  a" << that << " -> n" << that
-      << " [style=dashed, color=grey, arrowhead=none];\n";
-}
-
-
-static const bool kPrintDispatchTable = false;
-void DotPrinter::VisitChoice(ChoiceNode* that) {
-  if (kPrintDispatchTable) {
-    os_ << "  n" << that << " [shape=Mrecord, label=\"";
-    TableEntryHeaderPrinter header_printer(os_);
-    that->GetTable(ignore_case_)->ForEach(&header_printer);
-    os_ << "\"]\n";
-    PrintAttributes(that);
-    TableEntryBodyPrinter body_printer(os_, that);
-    that->GetTable(ignore_case_)->ForEach(&body_printer);
-  } else {
-    os_ << "  n" << that << " [shape=Mrecord, label=\"?\"];\n";
-    for (int i = 0; i < that->alternatives()->length(); i++) {
-      GuardedAlternative alt = that->alternatives()->at(i);
-      os_ << "  n" << that << " -> n" << alt.node();
-    }
-  }
-  for (int i = 0; i < that->alternatives()->length(); i++) {
-    GuardedAlternative alt = that->alternatives()->at(i);
-    alt.node()->Accept(this);
-  }
-}
-
-
-void DotPrinter::VisitText(TextNode* that) {
-  Zone* zone = that->zone();
-  os_ << "  n" << that << " [label=\"";
-  for (int i = 0; i < that->elements()->length(); i++) {
-    if (i > 0) os_ << " ";
-    TextElement elm = that->elements()->at(i);
-    switch (elm.text_type()) {
-      case TextElement::ATOM: {
-        Vector<const uc16> data = elm.atom()->data();
-        for (int i = 0; i < data.length(); i++) {
-          os_ << static_cast<char>(data[i]);
-        }
-        break;
-      }
-      case TextElement::CHAR_CLASS: {
-        RegExpCharacterClass* node = elm.char_class();
-        os_ << "[";
-        if (node->is_negated()) os_ << "^";
-        for (int j = 0; j < node->ranges(zone)->length(); j++) {
-          CharacterRange range = node->ranges(zone)->at(j);
-          os_ << AsUC16(range.from()) << "-" << AsUC16(range.to());
-        }
-        os_ << "]";
-        break;
-      }
-      default:
-        UNREACHABLE();
-    }
-  }
-  os_ << "\", shape=box, peripheries=2];\n";
-  PrintAttributes(that);
-  os_ << "  n" << that << " -> n" << that->on_success() << ";\n";
-  Visit(that->on_success());
-}
-
-
-void DotPrinter::VisitBackReference(BackReferenceNode* that) {
-  os_ << "  n" << that << " [label=\"$" << that->start_register() << "..$"
-      << that->end_register() << "\", shape=doubleoctagon];\n";
-  PrintAttributes(that);
-  os_ << "  n" << that << " -> n" << that->on_success() << ";\n";
-  Visit(that->on_success());
-}
-
-
-void DotPrinter::VisitEnd(EndNode* that) {
-  os_ << "  n" << that << " [style=bold, shape=point];\n";
-  PrintAttributes(that);
-}
-
-
-void DotPrinter::VisitAssertion(AssertionNode* that) {
-  os_ << "  n" << that << " [";
-  switch (that->assertion_type()) {
-    case AssertionNode::AT_END:
-      os_ << "label=\"$\", shape=septagon";
-      break;
-    case AssertionNode::AT_START:
-      os_ << "label=\"^\", shape=septagon";
-      break;
-    case AssertionNode::AT_BOUNDARY:
-      os_ << "label=\"\\b\", shape=septagon";
-      break;
-    case AssertionNode::AT_NON_BOUNDARY:
-      os_ << "label=\"\\B\", shape=septagon";
-      break;
-    case AssertionNode::AFTER_NEWLINE:
-      os_ << "label=\"(?<=\\n)\", shape=septagon";
-      break;
-  }
-  os_ << "];\n";
-  PrintAttributes(that);
-  RegExpNode* successor = that->on_success();
-  os_ << "  n" << that << " -> n" << successor << ";\n";
-  Visit(successor);
-}
-
-
-void DotPrinter::VisitAction(ActionNode* that) {
-  os_ << "  n" << that << " [";
-  switch (that->action_type_) {
-    case ActionNode::SET_REGISTER:
-      os_ << "label=\"$" << that->data_.u_store_register.reg
-          << ":=" << that->data_.u_store_register.value << "\", shape=octagon";
-      break;
-    case ActionNode::INCREMENT_REGISTER:
-      os_ << "label=\"$" << that->data_.u_increment_register.reg
-          << "++\", shape=octagon";
-      break;
-    case ActionNode::STORE_POSITION:
-      os_ << "label=\"$" << that->data_.u_position_register.reg
-          << ":=$pos\", shape=octagon";
-      break;
-    case ActionNode::BEGIN_SUBMATCH:
-      os_ << "label=\"$" << that->data_.u_submatch.current_position_register
-          << ":=$pos,begin\", shape=septagon";
-      break;
-    case ActionNode::POSITIVE_SUBMATCH_SUCCESS:
-      os_ << "label=\"escape\", shape=septagon";
-      break;
-    case ActionNode::EMPTY_MATCH_CHECK:
-      os_ << "label=\"$" << that->data_.u_empty_match_check.start_register
-          << "=$pos?,$" << that->data_.u_empty_match_check.repetition_register
-          << "<" << that->data_.u_empty_match_check.repetition_limit
-          << "?\", shape=septagon";
-      break;
-    case ActionNode::CLEAR_CAPTURES: {
-      os_ << "label=\"clear $" << that->data_.u_clear_captures.range_from
-          << " to $" << that->data_.u_clear_captures.range_to
-          << "\", shape=septagon";
-      break;
-    }
-  }
-  os_ << "];\n";
-  PrintAttributes(that);
-  RegExpNode* successor = that->on_success();
-  os_ << "  n" << that << " -> n" << successor << ";\n";
-  Visit(successor);
-}
-
-
-class DispatchTableDumper {
- public:
-  explicit DispatchTableDumper(std::ostream& os) : os_(os) {}
-  void Call(uc16 key, DispatchTable::Entry entry);
- private:
-  std::ostream& os_;
-};
-
-
-void DispatchTableDumper::Call(uc16 key, DispatchTable::Entry entry) {
-  os_ << "[" << AsUC16(key) << "-" << AsUC16(entry.to()) << "]: {";
-  OutSet* set = entry.out_set();
-  bool first = true;
-  for (unsigned i = 0; i < OutSet::kFirstLimit; i++) {
-    if (set->Get(i)) {
-      if (first) {
-        first = false;
-      } else {
-        os_ << ", ";
-      }
-      os_ << i;
-    }
-  }
-  os_ << "}\n";
-}
-
-
-void DispatchTable::Dump() {
-  OFStream os(stderr);
-  DispatchTableDumper dumper(os);
-  tree()->ForEach(&dumper);
-}
-
-
-void RegExpEngine::DotPrint(const char* label,
-                            RegExpNode* node,
-                            bool ignore_case) {
-  OFStream os(stdout);
-  DotPrinter printer(os, ignore_case);
-  printer.PrintNode(label, node);
-}
-
-
-#endif  // DEBUG
-
-
-// -------------------------------------------------------------------
-// Tree to graph conversion
-
-RegExpNode* RegExpAtom::ToNode(RegExpCompiler* compiler,
-                               RegExpNode* on_success) {
-  ZoneList<TextElement>* elms =
-      new(compiler->zone()) ZoneList<TextElement>(1, compiler->zone());
-  elms->Add(TextElement::Atom(this), compiler->zone());
-  return new (compiler->zone())
-      TextNode(elms, compiler->read_backward(), on_success);
-}
-
-
-RegExpNode* RegExpText::ToNode(RegExpCompiler* compiler,
-                               RegExpNode* on_success) {
-  return new (compiler->zone())
-      TextNode(elements(), compiler->read_backward(), on_success);
-}
-
-
-static bool CompareInverseRanges(ZoneList<CharacterRange>* ranges,
-                                 const int* special_class,
-                                 int length) {
-  length--;  // Remove final marker.
-  DCHECK_EQ(kRangeEndMarker, special_class[length]);
-  DCHECK_NE(0, ranges->length());
-  DCHECK_NE(0, length);
-  DCHECK_NE(0, special_class[0]);
-  if (ranges->length() != (length >> 1) + 1) {
-    return false;
-  }
-  CharacterRange range = ranges->at(0);
-  if (range.from() != 0) {
-    return false;
-  }
-  for (int i = 0; i < length; i += 2) {
-    if (special_class[i] != (range.to() + 1)) {
-      return false;
-    }
-    range = ranges->at((i >> 1) + 1);
-    if (special_class[i+1] != range.from()) {
-      return false;
-    }
-  }
-  if (range.to() != String::kMaxCodePoint) {
-    return false;
-  }
-  return true;
-}
-
-
-static bool CompareRanges(ZoneList<CharacterRange>* ranges,
-                          const int* special_class,
-                          int length) {
-  length--;  // Remove final marker.
-  DCHECK_EQ(kRangeEndMarker, special_class[length]);
-  if (ranges->length() * 2 != length) {
-    return false;
-  }
-  for (int i = 0; i < length; i += 2) {
-    CharacterRange range = ranges->at(i >> 1);
-    if (range.from() != special_class[i] ||
-        range.to() != special_class[i + 1] - 1) {
-      return false;
-    }
-  }
-  return true;
-}
-
-
-bool RegExpCharacterClass::is_standard(Zone* zone) {
-  // TODO(lrn): Remove need for this function, by not throwing away information
-  // along the way.
-  if (is_negated()) {
-    return false;
-  }
-  if (set_.is_standard()) {
-    return true;
-  }
-  if (CompareRanges(set_.ranges(zone), kSpaceRanges, kSpaceRangeCount)) {
-    set_.set_standard_set_type('s');
-    return true;
-  }
-  if (CompareInverseRanges(set_.ranges(zone), kSpaceRanges, kSpaceRangeCount)) {
-    set_.set_standard_set_type('S');
-    return true;
-  }
-  if (CompareInverseRanges(set_.ranges(zone),
-                           kLineTerminatorRanges,
-                           kLineTerminatorRangeCount)) {
-    set_.set_standard_set_type('.');
-    return true;
-  }
-  if (CompareRanges(set_.ranges(zone),
-                    kLineTerminatorRanges,
-                    kLineTerminatorRangeCount)) {
-    set_.set_standard_set_type('n');
-    return true;
-  }
-  if (CompareRanges(set_.ranges(zone), kWordRanges, kWordRangeCount)) {
-    set_.set_standard_set_type('w');
-    return true;
-  }
-  if (CompareInverseRanges(set_.ranges(zone), kWordRanges, kWordRangeCount)) {
-    set_.set_standard_set_type('W');
-    return true;
-  }
-  return false;
-}
-
-
-UnicodeRangeSplitter::UnicodeRangeSplitter(Zone* zone,
-                                           ZoneList<CharacterRange>* base)
-    : zone_(zone),
-      table_(zone),
-      bmp_(nullptr),
-      lead_surrogates_(nullptr),
-      trail_surrogates_(nullptr),
-      non_bmp_(nullptr) {
-  // The unicode range splitter categorizes given character ranges into:
-  // - Code points from the BMP representable by one code unit.
-  // - Code points outside the BMP that need to be split into surrogate pairs.
-  // - Lone lead surrogates.
-  // - Lone trail surrogates.
-  // Lone surrogates are valid code points, even though no actual characters.
-  // They require special matching to make sure we do not split surrogate pairs.
-  // We use the dispatch table to accomplish this. The base range is split up
-  // by the table by the overlay ranges, and the Call callback is used to
-  // filter and collect ranges for each category.
-  for (int i = 0; i < base->length(); i++) {
-    table_.AddRange(base->at(i), kBase, zone_);
-  }
-  // Add overlay ranges.
-  table_.AddRange(CharacterRange::Range(0, kLeadSurrogateStart - 1),
-                  kBmpCodePoints, zone_);
-  table_.AddRange(CharacterRange::Range(kLeadSurrogateStart, kLeadSurrogateEnd),
-                  kLeadSurrogates, zone_);
-  table_.AddRange(
-      CharacterRange::Range(kTrailSurrogateStart, kTrailSurrogateEnd),
-      kTrailSurrogates, zone_);
-  table_.AddRange(
-      CharacterRange::Range(kTrailSurrogateEnd + 1, kNonBmpStart - 1),
-      kBmpCodePoints, zone_);
-  table_.AddRange(CharacterRange::Range(kNonBmpStart, kNonBmpEnd),
-                  kNonBmpCodePoints, zone_);
-  table_.ForEach(this);
-}
-
-
-void UnicodeRangeSplitter::Call(uc32 from, DispatchTable::Entry entry) {
-  OutSet* outset = entry.out_set();
-  if (!outset->Get(kBase)) return;
-  ZoneList<CharacterRange>** target = nullptr;
-  if (outset->Get(kBmpCodePoints)) {
-    target = &bmp_;
-  } else if (outset->Get(kLeadSurrogates)) {
-    target = &lead_surrogates_;
-  } else if (outset->Get(kTrailSurrogates)) {
-    target = &trail_surrogates_;
-  } else {
-    DCHECK(outset->Get(kNonBmpCodePoints));
-    target = &non_bmp_;
-  }
-  if (*target == nullptr)
-    *target = new (zone_) ZoneList<CharacterRange>(2, zone_);
-  (*target)->Add(CharacterRange::Range(entry.from(), entry.to()), zone_);
-}
-
-void AddBmpCharacters(RegExpCompiler* compiler, ChoiceNode* result,
-                      RegExpNode* on_success, UnicodeRangeSplitter* splitter) {
-  ZoneList<CharacterRange>* bmp = splitter->bmp();
-  if (bmp == nullptr) return;
-  JSRegExp::Flags default_flags = JSRegExp::Flags();
-  result->AddAlternative(GuardedAlternative(TextNode::CreateForCharacterRanges(
-      compiler->zone(), bmp, compiler->read_backward(), on_success,
-      default_flags)));
-}
-
-void AddNonBmpSurrogatePairs(RegExpCompiler* compiler, ChoiceNode* result,
-                             RegExpNode* on_success,
-                             UnicodeRangeSplitter* splitter) {
-  ZoneList<CharacterRange>* non_bmp = splitter->non_bmp();
-  if (non_bmp == nullptr) return;
-  DCHECK(!compiler->one_byte());
-  Zone* zone = compiler->zone();
-  JSRegExp::Flags default_flags = JSRegExp::Flags();
-  CharacterRange::Canonicalize(non_bmp);
-  for (int i = 0; i < non_bmp->length(); i++) {
-    // Match surrogate pair.
-    // E.g. [\u10005-\u11005] becomes
-    //      \ud800[\udc05-\udfff]|
-    //      [\ud801-\ud803][\udc00-\udfff]|
-    //      \ud804[\udc00-\udc05]
-    uc32 from = non_bmp->at(i).from();
-    uc32 to = non_bmp->at(i).to();
-    uc16 from_l = unibrow::Utf16::LeadSurrogate(from);
-    uc16 from_t = unibrow::Utf16::TrailSurrogate(from);
-    uc16 to_l = unibrow::Utf16::LeadSurrogate(to);
-    uc16 to_t = unibrow::Utf16::TrailSurrogate(to);
-    if (from_l == to_l) {
-      // The lead surrogate is the same.
-      result->AddAlternative(
-          GuardedAlternative(TextNode::CreateForSurrogatePair(
-              zone, CharacterRange::Singleton(from_l),
-              CharacterRange::Range(from_t, to_t), compiler->read_backward(),
-              on_success, default_flags)));
-    } else {
-      if (from_t != kTrailSurrogateStart) {
-        // Add [from_l][from_t-\udfff]
-        result->AddAlternative(
-            GuardedAlternative(TextNode::CreateForSurrogatePair(
-                zone, CharacterRange::Singleton(from_l),
-                CharacterRange::Range(from_t, kTrailSurrogateEnd),
-                compiler->read_backward(), on_success, default_flags)));
-        from_l++;
-      }
-      if (to_t != kTrailSurrogateEnd) {
-        // Add [to_l][\udc00-to_t]
-        result->AddAlternative(
-            GuardedAlternative(TextNode::CreateForSurrogatePair(
-                zone, CharacterRange::Singleton(to_l),
-                CharacterRange::Range(kTrailSurrogateStart, to_t),
-                compiler->read_backward(), on_success, default_flags)));
-        to_l--;
-      }
-      if (from_l <= to_l) {
-        // Add [from_l-to_l][\udc00-\udfff]
-        result->AddAlternative(
-            GuardedAlternative(TextNode::CreateForSurrogatePair(
-                zone, CharacterRange::Range(from_l, to_l),
-                CharacterRange::Range(kTrailSurrogateStart, kTrailSurrogateEnd),
-                compiler->read_backward(), on_success, default_flags)));
-      }
-    }
-  }
-}
-
-RegExpNode* NegativeLookaroundAgainstReadDirectionAndMatch(
-    RegExpCompiler* compiler, ZoneList<CharacterRange>* lookbehind,
-    ZoneList<CharacterRange>* match, RegExpNode* on_success, bool read_backward,
-    JSRegExp::Flags flags) {
-  Zone* zone = compiler->zone();
-  RegExpNode* match_node = TextNode::CreateForCharacterRanges(
-      zone, match, read_backward, on_success, flags);
-  int stack_register = compiler->UnicodeLookaroundStackRegister();
-  int position_register = compiler->UnicodeLookaroundPositionRegister();
-  RegExpLookaround::Builder lookaround(false, match_node, stack_register,
-                                       position_register);
-  RegExpNode* negative_match = TextNode::CreateForCharacterRanges(
-      zone, lookbehind, !read_backward, lookaround.on_match_success(), flags);
-  return lookaround.ForMatch(negative_match);
-}
-
-RegExpNode* MatchAndNegativeLookaroundInReadDirection(
-    RegExpCompiler* compiler, ZoneList<CharacterRange>* match,
-    ZoneList<CharacterRange>* lookahead, RegExpNode* on_success,
-    bool read_backward, JSRegExp::Flags flags) {
-  Zone* zone = compiler->zone();
-  int stack_register = compiler->UnicodeLookaroundStackRegister();
-  int position_register = compiler->UnicodeLookaroundPositionRegister();
-  RegExpLookaround::Builder lookaround(false, on_success, stack_register,
-                                       position_register);
-  RegExpNode* negative_match = TextNode::CreateForCharacterRanges(
-      zone, lookahead, read_backward, lookaround.on_match_success(), flags);
-  return TextNode::CreateForCharacterRanges(
-      zone, match, read_backward, lookaround.ForMatch(negative_match), flags);
-}
-
-void AddLoneLeadSurrogates(RegExpCompiler* compiler, ChoiceNode* result,
-                           RegExpNode* on_success,
-                           UnicodeRangeSplitter* splitter) {
-  JSRegExp::Flags default_flags = JSRegExp::Flags();
-  ZoneList<CharacterRange>* lead_surrogates = splitter->lead_surrogates();
-  if (lead_surrogates == nullptr) return;
-  Zone* zone = compiler->zone();
-  // E.g. \ud801 becomes \ud801(?![\udc00-\udfff]).
-  ZoneList<CharacterRange>* trail_surrogates = CharacterRange::List(
-      zone, CharacterRange::Range(kTrailSurrogateStart, kTrailSurrogateEnd));
-
-  RegExpNode* match;
-  if (compiler->read_backward()) {
-    // Reading backward. Assert that reading forward, there is no trail
-    // surrogate, and then backward match the lead surrogate.
-    match = NegativeLookaroundAgainstReadDirectionAndMatch(
-        compiler, trail_surrogates, lead_surrogates, on_success, true,
-        default_flags);
-  } else {
-    // Reading forward. Forward match the lead surrogate and assert that
-    // no trail surrogate follows.
-    match = MatchAndNegativeLookaroundInReadDirection(
-        compiler, lead_surrogates, trail_surrogates, on_success, false,
-        default_flags);
-  }
-  result->AddAlternative(GuardedAlternative(match));
-}
-
-void AddLoneTrailSurrogates(RegExpCompiler* compiler, ChoiceNode* result,
-                            RegExpNode* on_success,
-                            UnicodeRangeSplitter* splitter) {
-  JSRegExp::Flags default_flags = JSRegExp::Flags();
-  ZoneList<CharacterRange>* trail_surrogates = splitter->trail_surrogates();
-  if (trail_surrogates == nullptr) return;
-  Zone* zone = compiler->zone();
-  // E.g. \udc01 becomes (?<![\ud800-\udbff])\udc01
-  ZoneList<CharacterRange>* lead_surrogates = CharacterRange::List(
-      zone, CharacterRange::Range(kLeadSurrogateStart, kLeadSurrogateEnd));
-
-  RegExpNode* match;
-  if (compiler->read_backward()) {
-    // Reading backward. Backward match the trail surrogate and assert that no
-    // lead surrogate precedes it.
-    match = MatchAndNegativeLookaroundInReadDirection(
-        compiler, trail_surrogates, lead_surrogates, on_success, true,
-        default_flags);
-  } else {
-    // Reading forward. Assert that reading backward, there is no lead
-    // surrogate, and then forward match the trail surrogate.
-    match = NegativeLookaroundAgainstReadDirectionAndMatch(
-        compiler, lead_surrogates, trail_surrogates, on_success, false,
-        default_flags);
-  }
-  result->AddAlternative(GuardedAlternative(match));
-}
-
-RegExpNode* UnanchoredAdvance(RegExpCompiler* compiler,
-                              RegExpNode* on_success) {
-  // This implements ES2015 21.2.5.2.3, AdvanceStringIndex.
-  DCHECK(!compiler->read_backward());
-  Zone* zone = compiler->zone();
-  // Advance any character. If the character happens to be a lead surrogate and
-  // we advanced into the middle of a surrogate pair, it will work out, as
-  // nothing will match from there. We will have to advance again, consuming
-  // the associated trail surrogate.
-  ZoneList<CharacterRange>* range = CharacterRange::List(
-      zone, CharacterRange::Range(0, String::kMaxUtf16CodeUnit));
-  JSRegExp::Flags default_flags = JSRegExp::Flags();
-  return TextNode::CreateForCharacterRanges(zone, range, false, on_success,
-                                            default_flags);
-}
-
-void AddUnicodeCaseEquivalents(ZoneList<CharacterRange>* ranges, Zone* zone) {
-#ifdef V8_INTL_SUPPORT
-  DCHECK(CharacterRange::IsCanonical(ranges));
-
-  // Micro-optimization to avoid passing large ranges to UnicodeSet::closeOver.
-  // See also https://crbug.com/v8/6727.
-  // TODO(jgruber): This only covers the special case of the {0,0x10FFFF} range,
-  // which we use frequently internally. But large ranges can also easily be
-  // created by the user. We might want to have a more general caching mechanism
-  // for such ranges.
-  if (ranges->length() == 1 && ranges->at(0).IsEverything(kNonBmpEnd)) return;
-
-  // Use ICU to compute the case fold closure over the ranges.
-  icu::UnicodeSet set;
-  for (int i = 0; i < ranges->length(); i++) {
-    set.add(ranges->at(i).from(), ranges->at(i).to());
-  }
-  ranges->Clear();
-  set.closeOver(USET_CASE_INSENSITIVE);
-  // Full case mapping map single characters to multiple characters.
-  // Those are represented as strings in the set. Remove them so that
-  // we end up with only simple and common case mappings.
-  set.removeAllStrings();
-  for (int i = 0; i < set.getRangeCount(); i++) {
-    ranges->Add(CharacterRange::Range(set.getRangeStart(i), set.getRangeEnd(i)),
-                zone);
-  }
-  // No errors and everything we collected have been ranges.
-  CharacterRange::Canonicalize(ranges);
-#endif  // V8_INTL_SUPPORT
-}
-
-
-RegExpNode* RegExpCharacterClass::ToNode(RegExpCompiler* compiler,
-                                         RegExpNode* on_success) {
-  set_.Canonicalize();
-  Zone* zone = compiler->zone();
-  ZoneList<CharacterRange>* ranges = this->ranges(zone);
-  if (NeedsUnicodeCaseEquivalents(flags_)) {
-    AddUnicodeCaseEquivalents(ranges, zone);
-  }
-  if (IsUnicode(flags_) && !compiler->one_byte() &&
-      !contains_split_surrogate()) {
-    if (is_negated()) {
-      ZoneList<CharacterRange>* negated =
-          new (zone) ZoneList<CharacterRange>(2, zone);
-      CharacterRange::Negate(ranges, negated, zone);
-      ranges = negated;
-    }
-    if (ranges->length() == 0) {
-      JSRegExp::Flags default_flags;
-      RegExpCharacterClass* fail =
-          new (zone) RegExpCharacterClass(zone, ranges, default_flags);
-      return new (zone) TextNode(fail, compiler->read_backward(), on_success);
-    }
-    if (standard_type() == '*') {
-      return UnanchoredAdvance(compiler, on_success);
-    } else {
-      ChoiceNode* result = new (zone) ChoiceNode(2, zone);
-      UnicodeRangeSplitter splitter(zone, ranges);
-      AddBmpCharacters(compiler, result, on_success, &splitter);
-      AddNonBmpSurrogatePairs(compiler, result, on_success, &splitter);
-      AddLoneLeadSurrogates(compiler, result, on_success, &splitter);
-      AddLoneTrailSurrogates(compiler, result, on_success, &splitter);
-      return result;
-    }
-  } else {
-    return new (zone) TextNode(this, compiler->read_backward(), on_success);
-  }
-}
-
-
-int CompareFirstChar(RegExpTree* const* a, RegExpTree* const* b) {
-  RegExpAtom* atom1 = (*a)->AsAtom();
-  RegExpAtom* atom2 = (*b)->AsAtom();
-  uc16 character1 = atom1->data().at(0);
-  uc16 character2 = atom2->data().at(0);
-  if (character1 < character2) return -1;
-  if (character1 > character2) return 1;
-  return 0;
-}
-
-
-static unibrow::uchar Canonical(
-    unibrow::Mapping<unibrow::Ecma262Canonicalize>* canonicalize,
-    unibrow::uchar c) {
-  unibrow::uchar chars[unibrow::Ecma262Canonicalize::kMaxWidth];
-  int length = canonicalize->get(c, '\0', chars);
-  DCHECK_LE(length, 1);
-  unibrow::uchar canonical = c;
-  if (length == 1) canonical = chars[0];
-  return canonical;
-}
-
-
-int CompareFirstCharCaseIndependent(
-    unibrow::Mapping<unibrow::Ecma262Canonicalize>* canonicalize,
-    RegExpTree* const* a, RegExpTree* const* b) {
-  RegExpAtom* atom1 = (*a)->AsAtom();
-  RegExpAtom* atom2 = (*b)->AsAtom();
-  unibrow::uchar character1 = atom1->data().at(0);
-  unibrow::uchar character2 = atom2->data().at(0);
-  if (character1 == character2) return 0;
-  if (character1 >= 'a' || character2 >= 'a') {
-    character1 = Canonical(canonicalize, character1);
-    character2 = Canonical(canonicalize, character2);
-  }
-  return static_cast<int>(character1) - static_cast<int>(character2);
-}
-
-
-// We can stable sort runs of atoms, since the order does not matter if they
-// start with different characters.
-// Returns true if any consecutive atoms were found.
-bool RegExpDisjunction::SortConsecutiveAtoms(RegExpCompiler* compiler) {
-  ZoneList<RegExpTree*>* alternatives = this->alternatives();
-  int length = alternatives->length();
-  bool found_consecutive_atoms = false;
-  for (int i = 0; i < length; i++) {
-    while (i < length) {
-      RegExpTree* alternative = alternatives->at(i);
-      if (alternative->IsAtom()) break;
-      i++;
-    }
-    // i is length or it is the index of an atom.
-    if (i == length) break;
-    int first_atom = i;
-    JSRegExp::Flags flags = alternatives->at(i)->AsAtom()->flags();
-    i++;
-    while (i < length) {
-      RegExpTree* alternative = alternatives->at(i);
-      if (!alternative->IsAtom()) break;
-      if (alternative->AsAtom()->flags() != flags) break;
-      i++;
-    }
-    // Sort atoms to get ones with common prefixes together.
-    // This step is more tricky if we are in a case-independent regexp,
-    // because it would change /is|I/ to /I|is/, and order matters when
-    // the regexp parts don't match only disjoint starting points. To fix
-    // this we have a version of CompareFirstChar that uses case-
-    // independent character classes for comparison.
-    DCHECK_LT(first_atom, alternatives->length());
-    DCHECK_LE(i, alternatives->length());
-    DCHECK_LE(first_atom, i);
-    if (IgnoreCase(flags)) {
-      unibrow::Mapping<unibrow::Ecma262Canonicalize>* canonicalize =
-          compiler->isolate()->regexp_macro_assembler_canonicalize();
-      auto compare_closure =
-          [canonicalize](RegExpTree* const* a, RegExpTree* const* b) {
-            return CompareFirstCharCaseIndependent(canonicalize, a, b);
-          };
-      alternatives->StableSort(compare_closure, first_atom, i - first_atom);
-    } else {
-      alternatives->StableSort(CompareFirstChar, first_atom, i - first_atom);
-    }
-    if (i - first_atom > 1) found_consecutive_atoms = true;
-  }
-  return found_consecutive_atoms;
-}
-
-
-// Optimizes ab|ac|az to a(?:b|c|d).
-void RegExpDisjunction::RationalizeConsecutiveAtoms(RegExpCompiler* compiler) {
-  Zone* zone = compiler->zone();
-  ZoneList<RegExpTree*>* alternatives = this->alternatives();
-  int length = alternatives->length();
-
-  int write_posn = 0;
-  int i = 0;
-  while (i < length) {
-    RegExpTree* alternative = alternatives->at(i);
-    if (!alternative->IsAtom()) {
-      alternatives->at(write_posn++) = alternatives->at(i);
-      i++;
-      continue;
-    }
-    RegExpAtom* const atom = alternative->AsAtom();
-    JSRegExp::Flags flags = atom->flags();
-    unibrow::uchar common_prefix = atom->data().at(0);
-    int first_with_prefix = i;
-    int prefix_length = atom->length();
-    i++;
-    while (i < length) {
-      alternative = alternatives->at(i);
-      if (!alternative->IsAtom()) break;
-      RegExpAtom* const atom = alternative->AsAtom();
-      if (atom->flags() != flags) break;
-      unibrow::uchar new_prefix = atom->data().at(0);
-      if (new_prefix != common_prefix) {
-        if (!IgnoreCase(flags)) break;
-        unibrow::Mapping<unibrow::Ecma262Canonicalize>* canonicalize =
-            compiler->isolate()->regexp_macro_assembler_canonicalize();
-        new_prefix = Canonical(canonicalize, new_prefix);
-        common_prefix = Canonical(canonicalize, common_prefix);
-        if (new_prefix != common_prefix) break;
-      }
-      prefix_length = Min(prefix_length, atom->length());
-      i++;
-    }
-    if (i > first_with_prefix + 2) {
-      // Found worthwhile run of alternatives with common prefix of at least one
-      // character.  The sorting function above did not sort on more than one
-      // character for reasons of correctness, but there may still be a longer
-      // common prefix if the terms were similar or presorted in the input.
-      // Find out how long the common prefix is.
-      int run_length = i - first_with_prefix;
-      RegExpAtom* const atom = alternatives->at(first_with_prefix)->AsAtom();
-      for (int j = 1; j < run_length && prefix_length > 1; j++) {
-        RegExpAtom* old_atom =
-            alternatives->at(j + first_with_prefix)->AsAtom();
-        for (int k = 1; k < prefix_length; k++) {
-          if (atom->data().at(k) != old_atom->data().at(k)) {
-            prefix_length = k;
-            break;
-          }
-        }
-      }
-      RegExpAtom* prefix = new (zone)
-          RegExpAtom(atom->data().SubVector(0, prefix_length), flags);
-      ZoneList<RegExpTree*>* pair = new (zone) ZoneList<RegExpTree*>(2, zone);
-      pair->Add(prefix, zone);
-      ZoneList<RegExpTree*>* suffixes =
-          new (zone) ZoneList<RegExpTree*>(run_length, zone);
-      for (int j = 0; j < run_length; j++) {
-        RegExpAtom* old_atom =
-            alternatives->at(j + first_with_prefix)->AsAtom();
-        int len = old_atom->length();
-        if (len == prefix_length) {
-          suffixes->Add(new (zone) RegExpEmpty(), zone);
-        } else {
-          RegExpTree* suffix = new (zone) RegExpAtom(
-              old_atom->data().SubVector(prefix_length, old_atom->length()),
-              flags);
-          suffixes->Add(suffix, zone);
-        }
-      }
-      pair->Add(new (zone) RegExpDisjunction(suffixes), zone);
-      alternatives->at(write_posn++) = new (zone) RegExpAlternative(pair);
-    } else {
-      // Just copy any non-worthwhile alternatives.
-      for (int j = first_with_prefix; j < i; j++) {
-        alternatives->at(write_posn++) = alternatives->at(j);
-      }
-    }
-  }
-  alternatives->Rewind(write_posn);  // Trim end of array.
-}
-
-
-// Optimizes b|c|z to [bcz].
-void RegExpDisjunction::FixSingleCharacterDisjunctions(
-    RegExpCompiler* compiler) {
-  Zone* zone = compiler->zone();
-  ZoneList<RegExpTree*>* alternatives = this->alternatives();
-  int length = alternatives->length();
-
-  int write_posn = 0;
-  int i = 0;
-  while (i < length) {
-    RegExpTree* alternative = alternatives->at(i);
-    if (!alternative->IsAtom()) {
-      alternatives->at(write_posn++) = alternatives->at(i);
-      i++;
-      continue;
-    }
-    RegExpAtom* const atom = alternative->AsAtom();
-    if (atom->length() != 1) {
-      alternatives->at(write_posn++) = alternatives->at(i);
-      i++;
-      continue;
-    }
-    JSRegExp::Flags flags = atom->flags();
-    DCHECK_IMPLIES(IsUnicode(flags),
-                   !unibrow::Utf16::IsLeadSurrogate(atom->data().at(0)));
-    bool contains_trail_surrogate =
-        unibrow::Utf16::IsTrailSurrogate(atom->data().at(0));
-    int first_in_run = i;
-    i++;
-    // Find a run of single-character atom alternatives that have identical
-    // flags (case independence and unicode-ness).
-    while (i < length) {
-      alternative = alternatives->at(i);
-      if (!alternative->IsAtom()) break;
-      RegExpAtom* const atom = alternative->AsAtom();
-      if (atom->length() != 1) break;
-      if (atom->flags() != flags) break;
-      DCHECK_IMPLIES(IsUnicode(flags),
-                     !unibrow::Utf16::IsLeadSurrogate(atom->data().at(0)));
-      contains_trail_surrogate |=
-          unibrow::Utf16::IsTrailSurrogate(atom->data().at(0));
-      i++;
-    }
-    if (i > first_in_run + 1) {
-      // Found non-trivial run of single-character alternatives.
-      int run_length = i - first_in_run;
-      ZoneList<CharacterRange>* ranges =
-          new (zone) ZoneList<CharacterRange>(2, zone);
-      for (int j = 0; j < run_length; j++) {
-        RegExpAtom* old_atom = alternatives->at(j + first_in_run)->AsAtom();
-        DCHECK_EQ(old_atom->length(), 1);
-        ranges->Add(CharacterRange::Singleton(old_atom->data().at(0)), zone);
-      }
-      RegExpCharacterClass::CharacterClassFlags character_class_flags;
-      if (IsUnicode(flags) && contains_trail_surrogate) {
-        character_class_flags = RegExpCharacterClass::CONTAINS_SPLIT_SURROGATE;
-      }
-      alternatives->at(write_posn++) = new (zone)
-          RegExpCharacterClass(zone, ranges, flags, character_class_flags);
-    } else {
-      // Just copy any trivial alternatives.
-      for (int j = first_in_run; j < i; j++) {
-        alternatives->at(write_posn++) = alternatives->at(j);
-      }
-    }
-  }
-  alternatives->Rewind(write_posn);  // Trim end of array.
-}
-
-
-RegExpNode* RegExpDisjunction::ToNode(RegExpCompiler* compiler,
-                                      RegExpNode* on_success) {
-  ZoneList<RegExpTree*>* alternatives = this->alternatives();
-
-  if (alternatives->length() > 2) {
-    bool found_consecutive_atoms = SortConsecutiveAtoms(compiler);
-    if (found_consecutive_atoms) RationalizeConsecutiveAtoms(compiler);
-    FixSingleCharacterDisjunctions(compiler);
-    if (alternatives->length() == 1) {
-      return alternatives->at(0)->ToNode(compiler, on_success);
-    }
-  }
-
-  int length = alternatives->length();
-
-  ChoiceNode* result =
-      new(compiler->zone()) ChoiceNode(length, compiler->zone());
-  for (int i = 0; i < length; i++) {
-    GuardedAlternative alternative(alternatives->at(i)->ToNode(compiler,
-                                                               on_success));
-    result->AddAlternative(alternative);
-  }
-  return result;
-}
-
-
-RegExpNode* RegExpQuantifier::ToNode(RegExpCompiler* compiler,
-                                     RegExpNode* on_success) {
-  return ToNode(min(),
-                max(),
-                is_greedy(),
-                body(),
-                compiler,
-                on_success);
-}
-
-
-// Scoped object to keep track of how much we unroll quantifier loops in the
-// regexp graph generator.
-class RegExpExpansionLimiter {
- public:
-  static const int kMaxExpansionFactor = 6;
-  RegExpExpansionLimiter(RegExpCompiler* compiler, int factor)
-      : compiler_(compiler),
-        saved_expansion_factor_(compiler->current_expansion_factor()),
-        ok_to_expand_(saved_expansion_factor_ <= kMaxExpansionFactor) {
-    DCHECK_LT(0, factor);
-    if (ok_to_expand_) {
-      if (factor > kMaxExpansionFactor) {
-        // Avoid integer overflow of the current expansion factor.
-        ok_to_expand_ = false;
-        compiler->set_current_expansion_factor(kMaxExpansionFactor + 1);
-      } else {
-        int new_factor = saved_expansion_factor_ * factor;
-        ok_to_expand_ = (new_factor <= kMaxExpansionFactor);
-        compiler->set_current_expansion_factor(new_factor);
-      }
-    }
-  }
-
-  ~RegExpExpansionLimiter() {
-    compiler_->set_current_expansion_factor(saved_expansion_factor_);
-  }
-
-  bool ok_to_expand() { return ok_to_expand_; }
-
- private:
-  RegExpCompiler* compiler_;
-  int saved_expansion_factor_;
-  bool ok_to_expand_;
-
-  DISALLOW_IMPLICIT_CONSTRUCTORS(RegExpExpansionLimiter);
-};
-
-
-RegExpNode* RegExpQuantifier::ToNode(int min,
-                                     int max,
-                                     bool is_greedy,
-                                     RegExpTree* body,
-                                     RegExpCompiler* compiler,
-                                     RegExpNode* on_success,
-                                     bool not_at_start) {
-  // x{f, t} becomes this:
-  //
-  //             (r++)<-.
-  //               |     `
-  //               |     (x)
-  //               v     ^
-  //      (r=0)-->(?)---/ [if r < t]
-  //               |
-  //   [if r >= f] \----> ...
-  //
-
-  // 15.10.2.5 RepeatMatcher algorithm.
-  // The parser has already eliminated the case where max is 0.  In the case
-  // where max_match is zero the parser has removed the quantifier if min was
-  // > 0 and removed the atom if min was 0.  See AddQuantifierToAtom.
-
-  // If we know that we cannot match zero length then things are a little
-  // simpler since we don't need to make the special zero length match check
-  // from step 2.1.  If the min and max are small we can unroll a little in
-  // this case.
-  static const int kMaxUnrolledMinMatches = 3;  // Unroll (foo)+ and (foo){3,}
-  static const int kMaxUnrolledMaxMatches = 3;  // Unroll (foo)? and (foo){x,3}
-  if (max == 0) return on_success;  // This can happen due to recursion.
-  bool body_can_be_empty = (body->min_match() == 0);
-  int body_start_reg = RegExpCompiler::kNoRegister;
-  Interval capture_registers = body->CaptureRegisters();
-  bool needs_capture_clearing = !capture_registers.is_empty();
-  Zone* zone = compiler->zone();
-
-  if (body_can_be_empty) {
-    body_start_reg = compiler->AllocateRegister();
-  } else if (compiler->optimize() && !needs_capture_clearing) {
-    // Only unroll if there are no captures and the body can't be
-    // empty.
-    {
-      RegExpExpansionLimiter limiter(
-          compiler, min + ((max != min) ? 1 : 0));
-      if (min > 0 && min <= kMaxUnrolledMinMatches && limiter.ok_to_expand()) {
-        int new_max = (max == kInfinity) ? max : max - min;
-        // Recurse once to get the loop or optional matches after the fixed
-        // ones.
-        RegExpNode* answer = ToNode(
-            0, new_max, is_greedy, body, compiler, on_success, true);
-        // Unroll the forced matches from 0 to min.  This can cause chains of
-        // TextNodes (which the parser does not generate).  These should be
-        // combined if it turns out they hinder good code generation.
-        for (int i = 0; i < min; i++) {
-          answer = body->ToNode(compiler, answer);
-        }
-        return answer;
-      }
-    }
-    if (max <= kMaxUnrolledMaxMatches && min == 0) {
-      DCHECK_LT(0, max);  // Due to the 'if' above.
-      RegExpExpansionLimiter limiter(compiler, max);
-      if (limiter.ok_to_expand()) {
-        // Unroll the optional matches up to max.
-        RegExpNode* answer = on_success;
-        for (int i = 0; i < max; i++) {
-          ChoiceNode* alternation = new(zone) ChoiceNode(2, zone);
-          if (is_greedy) {
-            alternation->AddAlternative(
-                GuardedAlternative(body->ToNode(compiler, answer)));
-            alternation->AddAlternative(GuardedAlternative(on_success));
-          } else {
-            alternation->AddAlternative(GuardedAlternative(on_success));
-            alternation->AddAlternative(
-                GuardedAlternative(body->ToNode(compiler, answer)));
-          }
-          answer = alternation;
-          if (not_at_start && !compiler->read_backward()) {
-            alternation->set_not_at_start();
-          }
-        }
-        return answer;
-      }
-    }
-  }
-  bool has_min = min > 0;
-  bool has_max = max < RegExpTree::kInfinity;
-  bool needs_counter = has_min || has_max;
-  int reg_ctr = needs_counter
-      ? compiler->AllocateRegister()
-      : RegExpCompiler::kNoRegister;
-  LoopChoiceNode* center = new (zone)
-      LoopChoiceNode(body->min_match() == 0, compiler->read_backward(), zone);
-  if (not_at_start && !compiler->read_backward()) center->set_not_at_start();
-  RegExpNode* loop_return = needs_counter
-      ? static_cast<RegExpNode*>(ActionNode::IncrementRegister(reg_ctr, center))
-      : static_cast<RegExpNode*>(center);
-  if (body_can_be_empty) {
-    // If the body can be empty we need to check if it was and then
-    // backtrack.
-    loop_return = ActionNode::EmptyMatchCheck(body_start_reg,
-                                              reg_ctr,
-                                              min,
-                                              loop_return);
-  }
-  RegExpNode* body_node = body->ToNode(compiler, loop_return);
-  if (body_can_be_empty) {
-    // If the body can be empty we need to store the start position
-    // so we can bail out if it was empty.
-    body_node = ActionNode::StorePosition(body_start_reg, false, body_node);
-  }
-  if (needs_capture_clearing) {
-    // Before entering the body of this loop we need to clear captures.
-    body_node = ActionNode::ClearCaptures(capture_registers, body_node);
-  }
-  GuardedAlternative body_alt(body_node);
-  if (has_max) {
-    Guard* body_guard =
-        new(zone) Guard(reg_ctr, Guard::LT, max);
-    body_alt.AddGuard(body_guard, zone);
-  }
-  GuardedAlternative rest_alt(on_success);
-  if (has_min) {
-    Guard* rest_guard = new(compiler->zone()) Guard(reg_ctr, Guard::GEQ, min);
-    rest_alt.AddGuard(rest_guard, zone);
-  }
-  if (is_greedy) {
-    center->AddLoopAlternative(body_alt);
-    center->AddContinueAlternative(rest_alt);
-  } else {
-    center->AddContinueAlternative(rest_alt);
-    center->AddLoopAlternative(body_alt);
-  }
-  if (needs_counter) {
-    return ActionNode::SetRegister(reg_ctr, 0, center);
-  } else {
-    return center;
-  }
-}
-
-namespace {
-// Desugar \b to (?<=\w)(?=\W)|(?<=\W)(?=\w) and
-//         \B to (?<=\w)(?=\w)|(?<=\W)(?=\W)
-RegExpNode* BoundaryAssertionAsLookaround(RegExpCompiler* compiler,
-                                          RegExpNode* on_success,
-                                          RegExpAssertion::AssertionType type,
-                                          JSRegExp::Flags flags) {
-  DCHECK(NeedsUnicodeCaseEquivalents(flags));
-  Zone* zone = compiler->zone();
-  ZoneList<CharacterRange>* word_range =
-      new (zone) ZoneList<CharacterRange>(2, zone);
-  CharacterRange::AddClassEscape('w', word_range, true, zone);
-  int stack_register = compiler->UnicodeLookaroundStackRegister();
-  int position_register = compiler->UnicodeLookaroundPositionRegister();
-  ChoiceNode* result = new (zone) ChoiceNode(2, zone);
-  // Add two choices. The (non-)boundary could start with a word or
-  // a non-word-character.
-  for (int i = 0; i < 2; i++) {
-    bool lookbehind_for_word = i == 0;
-    bool lookahead_for_word =
-        (type == RegExpAssertion::BOUNDARY) ^ lookbehind_for_word;
-    // Look to the left.
-    RegExpLookaround::Builder lookbehind(lookbehind_for_word, on_success,
-                                         stack_register, position_register);
-    RegExpNode* backward = TextNode::CreateForCharacterRanges(
-        zone, word_range, true, lookbehind.on_match_success(), flags);
-    // Look to the right.
-    RegExpLookaround::Builder lookahead(lookahead_for_word,
-                                        lookbehind.ForMatch(backward),
-                                        stack_register, position_register);
-    RegExpNode* forward = TextNode::CreateForCharacterRanges(
-        zone, word_range, false, lookahead.on_match_success(), flags);
-    result->AddAlternative(GuardedAlternative(lookahead.ForMatch(forward)));
-  }
-  return result;
-}
-}  // anonymous namespace
-
-RegExpNode* RegExpAssertion::ToNode(RegExpCompiler* compiler,
-                                    RegExpNode* on_success) {
-  NodeInfo info;
-  Zone* zone = compiler->zone();
-
-  switch (assertion_type()) {
-    case START_OF_LINE:
-      return AssertionNode::AfterNewline(on_success);
-    case START_OF_INPUT:
-      return AssertionNode::AtStart(on_success);
-    case BOUNDARY:
-      return NeedsUnicodeCaseEquivalents(flags_)
-                 ? BoundaryAssertionAsLookaround(compiler, on_success, BOUNDARY,
-                                                 flags_)
-                 : AssertionNode::AtBoundary(on_success);
-    case NON_BOUNDARY:
-      return NeedsUnicodeCaseEquivalents(flags_)
-                 ? BoundaryAssertionAsLookaround(compiler, on_success,
-                                                 NON_BOUNDARY, flags_)
-                 : AssertionNode::AtNonBoundary(on_success);
-    case END_OF_INPUT:
-      return AssertionNode::AtEnd(on_success);
-    case END_OF_LINE: {
-      // Compile $ in multiline regexps as an alternation with a positive
-      // lookahead in one side and an end-of-input on the other side.
-      // We need two registers for the lookahead.
-      int stack_pointer_register = compiler->AllocateRegister();
-      int position_register = compiler->AllocateRegister();
-      // The ChoiceNode to distinguish between a newline and end-of-input.
-      ChoiceNode* result = new(zone) ChoiceNode(2, zone);
-      // Create a newline atom.
-      ZoneList<CharacterRange>* newline_ranges =
-          new(zone) ZoneList<CharacterRange>(3, zone);
-      CharacterRange::AddClassEscape('n', newline_ranges, false, zone);
-      JSRegExp::Flags default_flags = JSRegExp::Flags();
-      RegExpCharacterClass* newline_atom =
-          new (zone) RegExpCharacterClass('n', default_flags);
-      TextNode* newline_matcher = new (zone) TextNode(
-          newline_atom, false, ActionNode::PositiveSubmatchSuccess(
-                                   stack_pointer_register, position_register,
-                                   0,   // No captures inside.
-                                   -1,  // Ignored if no captures.
-                                   on_success));
-      // Create an end-of-input matcher.
-      RegExpNode* end_of_line = ActionNode::BeginSubmatch(
-          stack_pointer_register,
-          position_register,
-          newline_matcher);
-      // Add the two alternatives to the ChoiceNode.
-      GuardedAlternative eol_alternative(end_of_line);
-      result->AddAlternative(eol_alternative);
-      GuardedAlternative end_alternative(AssertionNode::AtEnd(on_success));
-      result->AddAlternative(end_alternative);
-      return result;
-    }
-    default:
-      UNREACHABLE();
-  }
-  return on_success;
-}
-
-
-RegExpNode* RegExpBackReference::ToNode(RegExpCompiler* compiler,
-                                        RegExpNode* on_success) {
-  return new (compiler->zone())
-      BackReferenceNode(RegExpCapture::StartRegister(index()),
-                        RegExpCapture::EndRegister(index()), flags_,
-                        compiler->read_backward(), on_success);
-}
-
-
-RegExpNode* RegExpEmpty::ToNode(RegExpCompiler* compiler,
-                                RegExpNode* on_success) {
-  return on_success;
-}
-
-
-RegExpLookaround::Builder::Builder(bool is_positive, RegExpNode* on_success,
-                                   int stack_pointer_register,
-                                   int position_register,
-                                   int capture_register_count,
-                                   int capture_register_start)
-    : is_positive_(is_positive),
-      on_success_(on_success),
-      stack_pointer_register_(stack_pointer_register),
-      position_register_(position_register) {
-  if (is_positive_) {
-    on_match_success_ = ActionNode::PositiveSubmatchSuccess(
-        stack_pointer_register, position_register, capture_register_count,
-        capture_register_start, on_success_);
-  } else {
-    Zone* zone = on_success_->zone();
-    on_match_success_ = new (zone) NegativeSubmatchSuccess(
-        stack_pointer_register, position_register, capture_register_count,
-        capture_register_start, zone);
-  }
-}
-
-
-RegExpNode* RegExpLookaround::Builder::ForMatch(RegExpNode* match) {
-  if (is_positive_) {
-    return ActionNode::BeginSubmatch(stack_pointer_register_,
-                                     position_register_, match);
-  } else {
-    Zone* zone = on_success_->zone();
-    // We use a ChoiceNode to represent the negative lookaround. The first
-    // alternative is the negative match. On success, the end node backtracks.
-    // On failure, the second alternative is tried and leads to success.
-    // NegativeLookaheadChoiceNode is a special ChoiceNode that ignores the
-    // first exit when calculating quick checks.
-    ChoiceNode* choice_node = new (zone) NegativeLookaroundChoiceNode(
-        GuardedAlternative(match), GuardedAlternative(on_success_), zone);
-    return ActionNode::BeginSubmatch(stack_pointer_register_,
-                                     position_register_, choice_node);
-  }
-}
-
-
-RegExpNode* RegExpLookaround::ToNode(RegExpCompiler* compiler,
-                                     RegExpNode* on_success) {
-  int stack_pointer_register = compiler->AllocateRegister();
-  int position_register = compiler->AllocateRegister();
-
-  const int registers_per_capture = 2;
-  const int register_of_first_capture = 2;
-  int register_count = capture_count_ * registers_per_capture;
-  int register_start =
-    register_of_first_capture + capture_from_ * registers_per_capture;
-
-  RegExpNode* result;
-  bool was_reading_backward = compiler->read_backward();
-  compiler->set_read_backward(type() == LOOKBEHIND);
-  Builder builder(is_positive(), on_success, stack_pointer_register,
-                  position_register, register_count, register_start);
-  RegExpNode* match = body_->ToNode(compiler, builder.on_match_success());
-  result = builder.ForMatch(match);
-  compiler->set_read_backward(was_reading_backward);
-  return result;
-}
-
-
-RegExpNode* RegExpCapture::ToNode(RegExpCompiler* compiler,
-                                  RegExpNode* on_success) {
-  return ToNode(body(), index(), compiler, on_success);
-}
-
-
-RegExpNode* RegExpCapture::ToNode(RegExpTree* body,
-                                  int index,
-                                  RegExpCompiler* compiler,
-                                  RegExpNode* on_success) {
-  DCHECK_NOT_NULL(body);
-  int start_reg = RegExpCapture::StartRegister(index);
-  int end_reg = RegExpCapture::EndRegister(index);
-  if (compiler->read_backward()) std::swap(start_reg, end_reg);
-  RegExpNode* store_end = ActionNode::StorePosition(end_reg, true, on_success);
-  RegExpNode* body_node = body->ToNode(compiler, store_end);
-  return ActionNode::StorePosition(start_reg, true, body_node);
-}
-
-
-RegExpNode* RegExpAlternative::ToNode(RegExpCompiler* compiler,
-                                      RegExpNode* on_success) {
-  ZoneList<RegExpTree*>* children = nodes();
-  RegExpNode* current = on_success;
-  if (compiler->read_backward()) {
-    for (int i = 0; i < children->length(); i++) {
-      current = children->at(i)->ToNode(compiler, current);
-    }
-  } else {
-    for (int i = children->length() - 1; i >= 0; i--) {
-      current = children->at(i)->ToNode(compiler, current);
-    }
-  }
-  return current;
-}
-
-
-static void AddClass(const int* elmv,
-                     int elmc,
-                     ZoneList<CharacterRange>* ranges,
-                     Zone* zone) {
-  elmc--;
-  DCHECK_EQ(kRangeEndMarker, elmv[elmc]);
-  for (int i = 0; i < elmc; i += 2) {
-    DCHECK(elmv[i] < elmv[i + 1]);
-    ranges->Add(CharacterRange::Range(elmv[i], elmv[i + 1] - 1), zone);
-  }
-}
-
-
-static void AddClassNegated(const int *elmv,
-                            int elmc,
-                            ZoneList<CharacterRange>* ranges,
-                            Zone* zone) {
-  elmc--;
-  DCHECK_EQ(kRangeEndMarker, elmv[elmc]);
-  DCHECK_NE(0x0000, elmv[0]);
-  DCHECK_NE(String::kMaxCodePoint, elmv[elmc - 1]);
-  uc16 last = 0x0000;
-  for (int i = 0; i < elmc; i += 2) {
-    DCHECK(last <= elmv[i] - 1);
-    DCHECK(elmv[i] < elmv[i + 1]);
-    ranges->Add(CharacterRange::Range(last, elmv[i] - 1), zone);
-    last = elmv[i + 1];
-  }
-  ranges->Add(CharacterRange::Range(last, String::kMaxCodePoint), zone);
-}
-
-void CharacterRange::AddClassEscape(char type, ZoneList<CharacterRange>* ranges,
-                                    bool add_unicode_case_equivalents,
-                                    Zone* zone) {
-  if (add_unicode_case_equivalents && (type == 'w' || type == 'W')) {
-    // See #sec-runtime-semantics-wordcharacters-abstract-operation
-    // In case of unicode and ignore_case, we need to create the closure over
-    // case equivalent characters before negating.
-    ZoneList<CharacterRange>* new_ranges =
-        new (zone) ZoneList<CharacterRange>(2, zone);
-    AddClass(kWordRanges, kWordRangeCount, new_ranges, zone);
-    AddUnicodeCaseEquivalents(new_ranges, zone);
-    if (type == 'W') {
-      ZoneList<CharacterRange>* negated =
-          new (zone) ZoneList<CharacterRange>(2, zone);
-      CharacterRange::Negate(new_ranges, negated, zone);
-      new_ranges = negated;
-    }
-    ranges->AddAll(*new_ranges, zone);
-    return;
-  }
-  AddClassEscape(type, ranges, zone);
-}
-
-void CharacterRange::AddClassEscape(char type, ZoneList<CharacterRange>* ranges,
-                                    Zone* zone) {
-  switch (type) {
-    case 's':
-      AddClass(kSpaceRanges, kSpaceRangeCount, ranges, zone);
-      break;
-    case 'S':
-      AddClassNegated(kSpaceRanges, kSpaceRangeCount, ranges, zone);
-      break;
-    case 'w':
-      AddClass(kWordRanges, kWordRangeCount, ranges, zone);
-      break;
-    case 'W':
-      AddClassNegated(kWordRanges, kWordRangeCount, ranges, zone);
-      break;
-    case 'd':
-      AddClass(kDigitRanges, kDigitRangeCount, ranges, zone);
-      break;
-    case 'D':
-      AddClassNegated(kDigitRanges, kDigitRangeCount, ranges, zone);
-      break;
-    case '.':
-      AddClassNegated(kLineTerminatorRanges,
-                      kLineTerminatorRangeCount,
-                      ranges,
-                      zone);
-      break;
-    // This is not a character range as defined by the spec but a
-    // convenient shorthand for a character class that matches any
-    // character.
-    case '*':
-      ranges->Add(CharacterRange::Everything(), zone);
-      break;
-    // This is the set of characters matched by the $ and ^ symbols
-    // in multiline mode.
-    case 'n':
-      AddClass(kLineTerminatorRanges,
-               kLineTerminatorRangeCount,
-               ranges,
-               zone);
-      break;
-    default:
-      UNREACHABLE();
-  }
-}
-
-
-Vector<const int> CharacterRange::GetWordBounds() {
-  return Vector<const int>(kWordRanges, kWordRangeCount - 1);
-}
-
-// static
-void CharacterRange::AddCaseEquivalents(Isolate* isolate, Zone* zone,
-                                        ZoneList<CharacterRange>* ranges,
-                                        bool is_one_byte) {
-  CharacterRange::Canonicalize(ranges);
-  int range_count = ranges->length();
-  for (int i = 0; i < range_count; i++) {
-    CharacterRange range = ranges->at(i);
-    uc32 bottom = range.from();
-    if (bottom > String::kMaxUtf16CodeUnit) continue;
-    uc32 top = Min(range.to(), String::kMaxUtf16CodeUnit);
-    // Nothing to be done for surrogates.
-    if (bottom >= kLeadSurrogateStart && top <= kTrailSurrogateEnd) continue;
-    if (is_one_byte && !RangeContainsLatin1Equivalents(range)) {
-      if (bottom > String::kMaxOneByteCharCode) continue;
-      if (top > String::kMaxOneByteCharCode) top = String::kMaxOneByteCharCode;
-    }
-    unibrow::uchar chars[unibrow::Ecma262UnCanonicalize::kMaxWidth];
-    if (top == bottom) {
-      // If this is a singleton we just expand the one character.
-      int length = isolate->jsregexp_uncanonicalize()->get(bottom, '\0', chars);
-      for (int i = 0; i < length; i++) {
-        uc32 chr = chars[i];
-        if (chr != bottom) {
-          ranges->Add(CharacterRange::Singleton(chars[i]), zone);
-        }
-      }
-    } else {
-      // If this is a range we expand the characters block by block, expanding
-      // contiguous subranges (blocks) one at a time.  The approach is as
-      // follows.  For a given start character we look up the remainder of the
-      // block that contains it (represented by the end point), for instance we
-      // find 'z' if the character is 'c'.  A block is characterized by the
-      // property that all characters uncanonicalize in the same way, except
-      // that each entry in the result is incremented by the distance from the
-      // first element.  So a-z is a block because 'a' uncanonicalizes to ['a',
-      // 'A'] and the k'th letter uncanonicalizes to ['a' + k, 'A' + k].  Once
-      // we've found the end point we look up its uncanonicalization and
-      // produce a range for each element.  For instance for [c-f] we look up
-      // ['z', 'Z'] and produce [c-f] and [C-F].  We then only add a range if
-      // it is not already contained in the input, so [c-f] will be skipped but
-      // [C-F] will be added.  If this range is not completely contained in a
-      // block we do this for all the blocks covered by the range (handling
-      // characters that is not in a block as a "singleton block").
-      unibrow::uchar equivalents[unibrow::Ecma262UnCanonicalize::kMaxWidth];
-      int pos = bottom;
-      while (pos <= top) {
-        int length =
-            isolate->jsregexp_canonrange()->get(pos, '\0', equivalents);
-        uc32 block_end;
-        if (length == 0) {
-          block_end = pos;
-        } else {
-          DCHECK_EQ(1, length);
-          block_end = equivalents[0];
-        }
-        int end = (block_end > top) ? top : block_end;
-        length = isolate->jsregexp_uncanonicalize()->get(block_end, '\0',
-                                                         equivalents);
-        for (int i = 0; i < length; i++) {
-          uc32 c = equivalents[i];
-          uc32 range_from = c - (block_end - pos);
-          uc32 range_to = c - (block_end - end);
-          if (!(bottom <= range_from && range_to <= top)) {
-            ranges->Add(CharacterRange::Range(range_from, range_to), zone);
-          }
-        }
-        pos = end + 1;
-      }
-    }
-  }
-}
-
-
-bool CharacterRange::IsCanonical(ZoneList<CharacterRange>* ranges) {
-  DCHECK_NOT_NULL(ranges);
-  int n = ranges->length();
-  if (n <= 1) return true;
-  int max = ranges->at(0).to();
-  for (int i = 1; i < n; i++) {
-    CharacterRange next_range = ranges->at(i);
-    if (next_range.from() <= max + 1) return false;
-    max = next_range.to();
-  }
-  return true;
-}
-
-
-ZoneList<CharacterRange>* CharacterSet::ranges(Zone* zone) {
-  if (ranges_ == nullptr) {
-    ranges_ = new(zone) ZoneList<CharacterRange>(2, zone);
-    CharacterRange::AddClassEscape(standard_set_type_, ranges_, false, zone);
-  }
-  return ranges_;
-}
-
-
-// Move a number of elements in a zonelist to another position
-// in the same list. Handles overlapping source and target areas.
-static void MoveRanges(ZoneList<CharacterRange>* list,
-                       int from,
-                       int to,
-                       int count) {
-  // Ranges are potentially overlapping.
-  if (from < to) {
-    for (int i = count - 1; i >= 0; i--) {
-      list->at(to + i) = list->at(from + i);
-    }
-  } else {
-    for (int i = 0; i < count; i++) {
-      list->at(to + i) = list->at(from + i);
-    }
-  }
-}
-
-
-static int InsertRangeInCanonicalList(ZoneList<CharacterRange>* list,
-                                      int count,
-                                      CharacterRange insert) {
-  // Inserts a range into list[0..count[, which must be sorted
-  // by from value and non-overlapping and non-adjacent, using at most
-  // list[0..count] for the result. Returns the number of resulting
-  // canonicalized ranges. Inserting a range may collapse existing ranges into
-  // fewer ranges, so the return value can be anything in the range 1..count+1.
-  uc32 from = insert.from();
-  uc32 to = insert.to();
-  int start_pos = 0;
-  int end_pos = count;
-  for (int i = count - 1; i >= 0; i--) {
-    CharacterRange current = list->at(i);
-    if (current.from() > to + 1) {
-      end_pos = i;
-    } else if (current.to() + 1 < from) {
-      start_pos = i + 1;
-      break;
-    }
-  }
-
-  // Inserted range overlaps, or is adjacent to, ranges at positions
-  // [start_pos..end_pos[. Ranges before start_pos or at or after end_pos are
-  // not affected by the insertion.
-  // If start_pos == end_pos, the range must be inserted before start_pos.
-  // if start_pos < end_pos, the entire range from start_pos to end_pos
-  // must be merged with the insert range.
-
-  if (start_pos == end_pos) {
-    // Insert between existing ranges at position start_pos.
-    if (start_pos < count) {
-      MoveRanges(list, start_pos, start_pos + 1, count - start_pos);
-    }
-    list->at(start_pos) = insert;
-    return count + 1;
-  }
-  if (start_pos + 1 == end_pos) {
-    // Replace single existing range at position start_pos.
-    CharacterRange to_replace = list->at(start_pos);
-    int new_from = Min(to_replace.from(), from);
-    int new_to = Max(to_replace.to(), to);
-    list->at(start_pos) = CharacterRange::Range(new_from, new_to);
-    return count;
-  }
-  // Replace a number of existing ranges from start_pos to end_pos - 1.
-  // Move the remaining ranges down.
-
-  int new_from = Min(list->at(start_pos).from(), from);
-  int new_to = Max(list->at(end_pos - 1).to(), to);
-  if (end_pos < count) {
-    MoveRanges(list, end_pos, start_pos + 1, count - end_pos);
-  }
-  list->at(start_pos) = CharacterRange::Range(new_from, new_to);
-  return count - (end_pos - start_pos) + 1;
-}
-
-
-void CharacterSet::Canonicalize() {
-  // Special/default classes are always considered canonical. The result
-  // of calling ranges() will be sorted.
-  if (ranges_ == nullptr) return;
-  CharacterRange::Canonicalize(ranges_);
-}
-
-
-void CharacterRange::Canonicalize(ZoneList<CharacterRange>* character_ranges) {
-  if (character_ranges->length() <= 1) return;
-  // Check whether ranges are already canonical (increasing, non-overlapping,
-  // non-adjacent).
-  int n = character_ranges->length();
-  int max = character_ranges->at(0).to();
-  int i = 1;
-  while (i < n) {
-    CharacterRange current = character_ranges->at(i);
-    if (current.from() <= max + 1) {
-      break;
-    }
-    max = current.to();
-    i++;
-  }
-  // Canonical until the i'th range. If that's all of them, we are done.
-  if (i == n) return;
-
-  // The ranges at index i and forward are not canonicalized. Make them so by
-  // doing the equivalent of insertion sort (inserting each into the previous
-  // list, in order).
-  // Notice that inserting a range can reduce the number of ranges in the
-  // result due to combining of adjacent and overlapping ranges.
-  int read = i;  // Range to insert.
-  int num_canonical = i;  // Length of canonicalized part of list.
-  do {
-    num_canonical = InsertRangeInCanonicalList(character_ranges,
-                                               num_canonical,
-                                               character_ranges->at(read));
-    read++;
-  } while (read < n);
-  character_ranges->Rewind(num_canonical);
-
-  DCHECK(CharacterRange::IsCanonical(character_ranges));
-}
-
-
-void CharacterRange::Negate(ZoneList<CharacterRange>* ranges,
-                            ZoneList<CharacterRange>* negated_ranges,
-                            Zone* zone) {
-  DCHECK(CharacterRange::IsCanonical(ranges));
-  DCHECK_EQ(0, negated_ranges->length());
-  int range_count = ranges->length();
-  uc32 from = 0;
-  int i = 0;
-  if (range_count > 0 && ranges->at(0).from() == 0) {
-    from = ranges->at(0).to() + 1;
-    i = 1;
-  }
-  while (i < range_count) {
-    CharacterRange range = ranges->at(i);
-    negated_ranges->Add(CharacterRange::Range(from, range.from() - 1), zone);
-    from = range.to() + 1;
-    i++;
-  }
-  if (from < String::kMaxCodePoint) {
-    negated_ranges->Add(CharacterRange::Range(from, String::kMaxCodePoint),
-                        zone);
-  }
-}
-
-
-// -------------------------------------------------------------------
-// Splay tree
-
-
-OutSet* OutSet::Extend(unsigned value, Zone* zone) {
-  if (Get(value))
-    return this;
-  if (successors(zone) != nullptr) {
-    for (int i = 0; i < successors(zone)->length(); i++) {
-      OutSet* successor = successors(zone)->at(i);
-      if (successor->Get(value))
-        return successor;
-    }
-  } else {
-    successors_ = new(zone) ZoneList<OutSet*>(2, zone);
-  }
-  OutSet* result = new(zone) OutSet(first_, remaining_);
-  result->Set(value, zone);
-  successors(zone)->Add(result, zone);
-  return result;
-}
-
-
-void OutSet::Set(unsigned value, Zone *zone) {
-  if (value < kFirstLimit) {
-    first_ |= (1 << value);
-  } else {
-    if (remaining_ == nullptr)
-      remaining_ = new(zone) ZoneList<unsigned>(1, zone);
-    if (remaining_->is_empty() || !remaining_->Contains(value))
-      remaining_->Add(value, zone);
-  }
-}
-
-
-bool OutSet::Get(unsigned value) const {
-  if (value < kFirstLimit) {
-    return (first_ & (1 << value)) != 0;
-  } else if (remaining_ == nullptr) {
-    return false;
-  } else {
-    return remaining_->Contains(value);
-  }
-}
-
-
-const uc32 DispatchTable::Config::kNoKey = unibrow::Utf8::kBadChar;
-
-
-void DispatchTable::AddRange(CharacterRange full_range, int value,
-                             Zone* zone) {
-  CharacterRange current = full_range;
-  if (tree()->is_empty()) {
-    // If this is the first range we just insert into the table.
-    ZoneSplayTree<Config>::Locator loc;
-    bool inserted = tree()->Insert(current.from(), &loc);
-    DCHECK(inserted);
-    USE(inserted);
-    loc.set_value(Entry(current.from(), current.to(),
-                        empty()->Extend(value, zone)));
-    return;
-  }
-  // First see if there is a range to the left of this one that
-  // overlaps.
-  ZoneSplayTree<Config>::Locator loc;
-  if (tree()->FindGreatestLessThan(current.from(), &loc)) {
-    Entry* entry = &loc.value();
-    // If we've found a range that overlaps with this one, and it
-    // starts strictly to the left of this one, we have to fix it
-    // because the following code only handles ranges that start on
-    // or after the start point of the range we're adding.
-    if (entry->from() < current.from() && entry->to() >= current.from()) {
-      // Snap the overlapping range in half around the start point of
-      // the range we're adding.
-      CharacterRange left =
-          CharacterRange::Range(entry->from(), current.from() - 1);
-      CharacterRange right = CharacterRange::Range(current.from(), entry->to());
-      // The left part of the overlapping range doesn't overlap.
-      // Truncate the whole entry to be just the left part.
-      entry->set_to(left.to());
-      // The right part is the one that overlaps.  We add this part
-      // to the map and let the next step deal with merging it with
-      // the range we're adding.
-      ZoneSplayTree<Config>::Locator loc;
-      bool inserted = tree()->Insert(right.from(), &loc);
-      DCHECK(inserted);
-      USE(inserted);
-      loc.set_value(Entry(right.from(),
-                          right.to(),
-                          entry->out_set()));
-    }
-  }
-  while (current.is_valid()) {
-    if (tree()->FindLeastGreaterThan(current.from(), &loc) &&
-        (loc.value().from() <= current.to()) &&
-        (loc.value().to() >= current.from())) {
-      Entry* entry = &loc.value();
-      // We have overlap.  If there is space between the start point of
-      // the range we're adding and where the overlapping range starts
-      // then we have to add a range covering just that space.
-      if (current.from() < entry->from()) {
-        ZoneSplayTree<Config>::Locator ins;
-        bool inserted = tree()->Insert(current.from(), &ins);
-        DCHECK(inserted);
-        USE(inserted);
-        ins.set_value(Entry(current.from(),
-                            entry->from() - 1,
-                            empty()->Extend(value, zone)));
-        current.set_from(entry->from());
-      }
-      DCHECK_EQ(current.from(), entry->from());
-      // If the overlapping range extends beyond the one we want to add
-      // we have to snap the right part off and add it separately.
-      if (entry->to() > current.to()) {
-        ZoneSplayTree<Config>::Locator ins;
-        bool inserted = tree()->Insert(current.to() + 1, &ins);
-        DCHECK(inserted);
-        USE(inserted);
-        ins.set_value(Entry(current.to() + 1,
-                            entry->to(),
-                            entry->out_set()));
-        entry->set_to(current.to());
-      }
-      DCHECK(entry->to() <= current.to());
-      // The overlapping range is now completely contained by the range
-      // we're adding so we can just update it and move the start point
-      // of the range we're adding just past it.
-      entry->AddValue(value, zone);
-      DCHECK(entry->to() + 1 > current.from());
-      current.set_from(entry->to() + 1);
-    } else {
-      // There is no overlap so we can just add the range
-      ZoneSplayTree<Config>::Locator ins;
-      bool inserted = tree()->Insert(current.from(), &ins);
-      DCHECK(inserted);
-      USE(inserted);
-      ins.set_value(Entry(current.from(),
-                          current.to(),
-                          empty()->Extend(value, zone)));
-      break;
-    }
-  }
-}
-
-
-OutSet* DispatchTable::Get(uc32 value) {
-  ZoneSplayTree<Config>::Locator loc;
-  if (!tree()->FindGreatestLessThan(value, &loc))
-    return empty();
-  Entry* entry = &loc.value();
-  if (value <= entry->to())
-    return entry->out_set();
-  else
-    return empty();
-}
-
-
-// -------------------------------------------------------------------
-// Analysis
-
-
-void Analysis::EnsureAnalyzed(RegExpNode* that) {
-  StackLimitCheck check(isolate());
-  if (check.HasOverflowed()) {
-    fail("Stack overflow");
-    return;
-  }
-  if (that->info()->been_analyzed || that->info()->being_analyzed)
-    return;
-  that->info()->being_analyzed = true;
-  that->Accept(this);
-  that->info()->being_analyzed = false;
-  that->info()->been_analyzed = true;
-}
-
-
-void Analysis::VisitEnd(EndNode* that) {
-  // nothing to do
-}
-
-
-void TextNode::CalculateOffsets() {
-  int element_count = elements()->length();
-  // Set up the offsets of the elements relative to the start.  This is a fixed
-  // quantity since a TextNode can only contain fixed-width things.
-  int cp_offset = 0;
-  for (int i = 0; i < element_count; i++) {
-    TextElement& elm = elements()->at(i);
-    elm.set_cp_offset(cp_offset);
-    cp_offset += elm.length();
-  }
-}
-
-
-void Analysis::VisitText(TextNode* that) {
-  that->MakeCaseIndependent(isolate(), is_one_byte_);
-  EnsureAnalyzed(that->on_success());
-  if (!has_failed()) {
-    that->CalculateOffsets();
-  }
-}
-
-
-void Analysis::VisitAction(ActionNode* that) {
-  RegExpNode* target = that->on_success();
-  EnsureAnalyzed(target);
-  if (!has_failed()) {
-    // If the next node is interested in what it follows then this node
-    // has to be interested too so it can pass the information on.
-    that->info()->AddFromFollowing(target->info());
-  }
-}
-
-
-void Analysis::VisitChoice(ChoiceNode* that) {
-  NodeInfo* info = that->info();
-  for (int i = 0; i < that->alternatives()->length(); i++) {
-    RegExpNode* node = that->alternatives()->at(i).node();
-    EnsureAnalyzed(node);
-    if (has_failed()) return;
-    // Anything the following nodes need to know has to be known by
-    // this node also, so it can pass it on.
-    info->AddFromFollowing(node->info());
-  }
-}
-
-
-void Analysis::VisitLoopChoice(LoopChoiceNode* that) {
-  NodeInfo* info = that->info();
-  for (int i = 0; i < that->alternatives()->length(); i++) {
-    RegExpNode* node = that->alternatives()->at(i).node();
-    if (node != that->loop_node()) {
-      EnsureAnalyzed(node);
-      if (has_failed()) return;
-      info->AddFromFollowing(node->info());
-    }
-  }
-  // Check the loop last since it may need the value of this node
-  // to get a correct result.
-  EnsureAnalyzed(that->loop_node());
-  if (!has_failed()) {
-    info->AddFromFollowing(that->loop_node()->info());
-  }
-}
-
-
-void Analysis::VisitBackReference(BackReferenceNode* that) {
-  EnsureAnalyzed(that->on_success());
-}
-
-
-void Analysis::VisitAssertion(AssertionNode* that) {
-  EnsureAnalyzed(that->on_success());
-}
-
-
-void BackReferenceNode::FillInBMInfo(Isolate* isolate, int offset, int budget,
-                                     BoyerMooreLookahead* bm,
-                                     bool not_at_start) {
-  // Working out the set of characters that a backreference can match is too
-  // hard, so we just say that any character can match.
-  bm->SetRest(offset);
-  SaveBMInfo(bm, not_at_start, offset);
-}
-
-
-STATIC_ASSERT(BoyerMoorePositionInfo::kMapSize ==
-              RegExpMacroAssembler::kTableSize);
-
-
-void ChoiceNode::FillInBMInfo(Isolate* isolate, int offset, int budget,
-                              BoyerMooreLookahead* bm, bool not_at_start) {
-  ZoneList<GuardedAlternative>* alts = alternatives();
-  budget = (budget - 1) / alts->length();
-  for (int i = 0; i < alts->length(); i++) {
-    GuardedAlternative& alt = alts->at(i);
-    if (alt.guards() != nullptr && alt.guards()->length() != 0) {
-      bm->SetRest(offset);  // Give up trying to fill in info.
-      SaveBMInfo(bm, not_at_start, offset);
-      return;
-    }
-    alt.node()->FillInBMInfo(isolate, offset, budget, bm, not_at_start);
-  }
-  SaveBMInfo(bm, not_at_start, offset);
-}
-
-
-void TextNode::FillInBMInfo(Isolate* isolate, int initial_offset, int budget,
-                            BoyerMooreLookahead* bm, bool not_at_start) {
-  if (initial_offset >= bm->length()) return;
-  int offset = initial_offset;
-  int max_char = bm->max_char();
-  for (int i = 0; i < elements()->length(); i++) {
-    if (offset >= bm->length()) {
-      if (initial_offset == 0) set_bm_info(not_at_start, bm);
-      return;
-    }
-    TextElement text = elements()->at(i);
-    if (text.text_type() == TextElement::ATOM) {
-      RegExpAtom* atom = text.atom();
-      for (int j = 0; j < atom->length(); j++, offset++) {
-        if (offset >= bm->length()) {
-          if (initial_offset == 0) set_bm_info(not_at_start, bm);
-          return;
-        }
-        uc16 character = atom->data()[j];
-        if (IgnoreCase(atom->flags())) {
-          unibrow::uchar chars[unibrow::Ecma262UnCanonicalize::kMaxWidth];
-          int length = GetCaseIndependentLetters(
-              isolate, character, bm->max_char() == String::kMaxOneByteCharCode,
-              chars);
-          for (int j = 0; j < length; j++) {
-            bm->Set(offset, chars[j]);
-          }
-        } else {
-          if (character <= max_char) bm->Set(offset, character);
-        }
-      }
-    } else {
-      DCHECK_EQ(TextElement::CHAR_CLASS, text.text_type());
-      RegExpCharacterClass* char_class = text.char_class();
-      ZoneList<CharacterRange>* ranges = char_class->ranges(zone());
-      if (char_class->is_negated()) {
-        bm->SetAll(offset);
-      } else {
-        for (int k = 0; k < ranges->length(); k++) {
-          CharacterRange& range = ranges->at(k);
-          if (range.from() > max_char) continue;
-          int to = Min(max_char, static_cast<int>(range.to()));
-          bm->SetInterval(offset, Interval(range.from(), to));
-        }
-      }
-      offset++;
-    }
-  }
-  if (offset >= bm->length()) {
-    if (initial_offset == 0) set_bm_info(not_at_start, bm);
-    return;
-  }
-  on_success()->FillInBMInfo(isolate, offset, budget - 1, bm,
-                             true);  // Not at start after a text node.
-  if (initial_offset == 0) set_bm_info(not_at_start, bm);
-}
-
-
-// -------------------------------------------------------------------
-// Dispatch table construction
-
-
-void DispatchTableConstructor::VisitEnd(EndNode* that) {
-  AddRange(CharacterRange::Everything());
-}
-
-
-void DispatchTableConstructor::BuildTable(ChoiceNode* node) {
-  node->set_being_calculated(true);
-  ZoneList<GuardedAlternative>* alternatives = node->alternatives();
-  for (int i = 0; i < alternatives->length(); i++) {
-    set_choice_index(i);
-    alternatives->at(i).node()->Accept(this);
-  }
-  node->set_being_calculated(false);
-}
-
-
-class AddDispatchRange {
- public:
-  explicit AddDispatchRange(DispatchTableConstructor* constructor)
-    : constructor_(constructor) { }
-  void Call(uc32 from, DispatchTable::Entry entry);
- private:
-  DispatchTableConstructor* constructor_;
-};
-
-
-void AddDispatchRange::Call(uc32 from, DispatchTable::Entry entry) {
-  constructor_->AddRange(CharacterRange::Range(from, entry.to()));
-}
-
-
-void DispatchTableConstructor::VisitChoice(ChoiceNode* node) {
-  if (node->being_calculated())
-    return;
-  DispatchTable* table = node->GetTable(ignore_case_);
-  AddDispatchRange adder(this);
-  table->ForEach(&adder);
-}
-
-
-void DispatchTableConstructor::VisitBackReference(BackReferenceNode* that) {
-  // TODO(160): Find the node that we refer back to and propagate its start
-  // set back to here.  For now we just accept anything.
-  AddRange(CharacterRange::Everything());
-}
-
-
-void DispatchTableConstructor::VisitAssertion(AssertionNode* that) {
-  RegExpNode* target = that->on_success();
-  target->Accept(this);
-}
-
-
-static int CompareRangeByFrom(const CharacterRange* a,
-                              const CharacterRange* b) {
-  return Compare<uc16>(a->from(), b->from());
-}
-
-
-void DispatchTableConstructor::AddInverse(ZoneList<CharacterRange>* ranges) {
-  ranges->Sort(CompareRangeByFrom);
-  uc16 last = 0;
-  for (int i = 0; i < ranges->length(); i++) {
-    CharacterRange range = ranges->at(i);
-    if (last < range.from())
-      AddRange(CharacterRange::Range(last, range.from() - 1));
-    if (range.to() >= last) {
-      if (range.to() == String::kMaxCodePoint) {
-        return;
-      } else {
-        last = range.to() + 1;
-      }
-    }
-  }
-  AddRange(CharacterRange::Range(last, String::kMaxCodePoint));
-}
-
-
-void DispatchTableConstructor::VisitText(TextNode* that) {
-  TextElement elm = that->elements()->at(0);
-  switch (elm.text_type()) {
-    case TextElement::ATOM: {
-      uc16 c = elm.atom()->data()[0];
-      AddRange(CharacterRange::Range(c, c));
-      break;
-    }
-    case TextElement::CHAR_CLASS: {
-      RegExpCharacterClass* tree = elm.char_class();
-      ZoneList<CharacterRange>* ranges = tree->ranges(that->zone());
-      if (tree->is_negated()) {
-        AddInverse(ranges);
-      } else {
-        for (int i = 0; i < ranges->length(); i++)
-          AddRange(ranges->at(i));
-      }
-      break;
-    }
-    default: {
-      UNIMPLEMENTED();
-    }
-  }
-}
-
-
-void DispatchTableConstructor::VisitAction(ActionNode* that) {
-  RegExpNode* target = that->on_success();
-  target->Accept(this);
-}
-
-RegExpNode* OptionallyStepBackToLeadSurrogate(RegExpCompiler* compiler,
-                                              RegExpNode* on_success,
-                                              JSRegExp::Flags flags) {
-  // If the regexp matching starts within a surrogate pair, step back
-  // to the lead surrogate and start matching from there.
-  DCHECK(!compiler->read_backward());
-  Zone* zone = compiler->zone();
-  ZoneList<CharacterRange>* lead_surrogates = CharacterRange::List(
-      zone, CharacterRange::Range(kLeadSurrogateStart, kLeadSurrogateEnd));
-  ZoneList<CharacterRange>* trail_surrogates = CharacterRange::List(
-      zone, CharacterRange::Range(kTrailSurrogateStart, kTrailSurrogateEnd));
-
-  ChoiceNode* optional_step_back = new (zone) ChoiceNode(2, zone);
-
-  int stack_register = compiler->UnicodeLookaroundStackRegister();
-  int position_register = compiler->UnicodeLookaroundPositionRegister();
-  RegExpNode* step_back = TextNode::CreateForCharacterRanges(
-      zone, lead_surrogates, true, on_success, flags);
-  RegExpLookaround::Builder builder(true, step_back, stack_register,
-                                    position_register);
-  RegExpNode* match_trail = TextNode::CreateForCharacterRanges(
-      zone, trail_surrogates, false, builder.on_match_success(), flags);
-
-  optional_step_back->AddAlternative(
-      GuardedAlternative(builder.ForMatch(match_trail)));
-  optional_step_back->AddAlternative(GuardedAlternative(on_success));
-
-  return optional_step_back;
-}
-
-
-RegExpEngine::CompilationResult RegExpEngine::Compile(
-    Isolate* isolate, Zone* zone, RegExpCompileData* data,
-    JSRegExp::Flags flags, Handle<String> pattern,
-    Handle<String> sample_subject, bool is_one_byte) {
-  if ((data->capture_count + 1) * 2 - 1 > RegExpMacroAssembler::kMaxRegister) {
-    return IrregexpRegExpTooBig(isolate);
-  }
-  bool is_sticky = IsSticky(flags);
-  bool is_global = IsGlobal(flags);
-  bool is_unicode = IsUnicode(flags);
-  RegExpCompiler compiler(isolate, zone, data->capture_count, is_one_byte);
-
-  if (compiler.optimize()) compiler.set_optimize(!TooMuchRegExpCode(pattern));
-
-  // Sample some characters from the middle of the string.
-  static const int kSampleSize = 128;
-
-  sample_subject = String::Flatten(sample_subject);
-  int chars_sampled = 0;
-  int half_way = (sample_subject->length() - kSampleSize) / 2;
-  for (int i = Max(0, half_way);
-       i < sample_subject->length() && chars_sampled < kSampleSize;
-       i++, chars_sampled++) {
-    compiler.frequency_collator()->CountCharacter(sample_subject->Get(i));
-  }
-
-  // Wrap the body of the regexp in capture #0.
-  RegExpNode* captured_body = RegExpCapture::ToNode(data->tree,
-                                                    0,
-                                                    &compiler,
-                                                    compiler.accept());
-  RegExpNode* node = captured_body;
-  bool is_end_anchored = data->tree->IsAnchoredAtEnd();
-  bool is_start_anchored = data->tree->IsAnchoredAtStart();
-  int max_length = data->tree->max_match();
-  if (!is_start_anchored && !is_sticky) {
-    // Add a .*? at the beginning, outside the body capture, unless
-    // this expression is anchored at the beginning or sticky.
-    JSRegExp::Flags default_flags = JSRegExp::Flags();
-    RegExpNode* loop_node = RegExpQuantifier::ToNode(
-        0, RegExpTree::kInfinity, false,
-        new (zone) RegExpCharacterClass('*', default_flags), &compiler,
-        captured_body, data->contains_anchor);
-
-    if (data->contains_anchor) {
-      // Unroll loop once, to take care of the case that might start
-      // at the start of input.
-      ChoiceNode* first_step_node = new(zone) ChoiceNode(2, zone);
-      first_step_node->AddAlternative(GuardedAlternative(captured_body));
-      first_step_node->AddAlternative(GuardedAlternative(new (zone) TextNode(
-          new (zone) RegExpCharacterClass('*', default_flags), false,
-          loop_node)));
-      node = first_step_node;
-    } else {
-      node = loop_node;
-    }
-  }
-  if (is_one_byte) {
-    node = node->FilterOneByte(RegExpCompiler::kMaxRecursion);
-    // Do it again to propagate the new nodes to places where they were not
-    // put because they had not been calculated yet.
-    if (node != nullptr) {
-      node = node->FilterOneByte(RegExpCompiler::kMaxRecursion);
-    }
-  } else if (is_unicode && (is_global || is_sticky)) {
-    node = OptionallyStepBackToLeadSurrogate(&compiler, node, flags);
-  }
-
-  if (node == nullptr) node = new (zone) EndNode(EndNode::BACKTRACK, zone);
-  data->node = node;
-  Analysis analysis(isolate, is_one_byte);
-  analysis.EnsureAnalyzed(node);
-  if (analysis.has_failed()) {
-    const char* error_message = analysis.error_message();
-    return CompilationResult(isolate, error_message);
-  }
-
-  // Create the correct assembler for the architecture.
-#ifndef V8_INTERPRETED_REGEXP
-  // Native regexp implementation.
-
-  NativeRegExpMacroAssembler::Mode mode =
-      is_one_byte ? NativeRegExpMacroAssembler::LATIN1
-                  : NativeRegExpMacroAssembler::UC16;
-
-#if V8_TARGET_ARCH_IA32
-  RegExpMacroAssemblerIA32 macro_assembler(isolate, zone, mode,
-                                           (data->capture_count + 1) * 2);
-#elif V8_TARGET_ARCH_X64
-  RegExpMacroAssemblerX64 macro_assembler(isolate, zone, mode,
-                                          (data->capture_count + 1) * 2);
-#elif V8_TARGET_ARCH_ARM
-  RegExpMacroAssemblerARM macro_assembler(isolate, zone, mode,
-                                          (data->capture_count + 1) * 2);
-#elif V8_TARGET_ARCH_ARM64
-  RegExpMacroAssemblerARM64 macro_assembler(isolate, zone, mode,
-                                            (data->capture_count + 1) * 2);
-#elif V8_TARGET_ARCH_S390
-  RegExpMacroAssemblerS390 macro_assembler(isolate, zone, mode,
-                                           (data->capture_count + 1) * 2);
-#elif V8_TARGET_ARCH_PPC
-  RegExpMacroAssemblerPPC macro_assembler(isolate, zone, mode,
-                                          (data->capture_count + 1) * 2);
-#elif V8_TARGET_ARCH_MIPS
-  RegExpMacroAssemblerMIPS macro_assembler(isolate, zone, mode,
-                                           (data->capture_count + 1) * 2);
-#elif V8_TARGET_ARCH_MIPS64
-  RegExpMacroAssemblerMIPS macro_assembler(isolate, zone, mode,
-                                           (data->capture_count + 1) * 2);
-#else
-#error "Unsupported architecture"
-#endif
-
-#else  // V8_INTERPRETED_REGEXP
-  // Interpreted regexp implementation.
-  EmbeddedVector<byte, 1024> codes;
-  RegExpMacroAssemblerIrregexp macro_assembler(isolate, codes, zone);
-#endif  // V8_INTERPRETED_REGEXP
-
-  macro_assembler.set_slow_safe(TooMuchRegExpCode(pattern));
-
-  // Inserted here, instead of in Assembler, because it depends on information
-  // in the AST that isn't replicated in the Node structure.
-  static const int kMaxBacksearchLimit = 1024;
-  if (is_end_anchored && !is_start_anchored && !is_sticky &&
-      max_length < kMaxBacksearchLimit) {
-    macro_assembler.SetCurrentPositionFromEnd(max_length);
-  }
-
-  if (is_global) {
-    RegExpMacroAssembler::GlobalMode mode = RegExpMacroAssembler::GLOBAL;
-    if (data->tree->min_match() > 0) {
-      mode = RegExpMacroAssembler::GLOBAL_NO_ZERO_LENGTH_CHECK;
-    } else if (is_unicode) {
-      mode = RegExpMacroAssembler::GLOBAL_UNICODE;
-    }
-    macro_assembler.set_global_mode(mode);
-  }
-
-  return compiler.Assemble(&macro_assembler,
-                           node,
-                           data->capture_count,
-                           pattern);
-}
-
-
-bool RegExpEngine::TooMuchRegExpCode(Handle<String> pattern) {
-  Heap* heap = pattern->GetHeap();
-  bool too_much = pattern->length() > RegExpImpl::kRegExpTooLargeToOptimize;
-  if (heap->isolate()->total_regexp_code_generated() >
-          RegExpImpl::kRegExpCompiledLimit &&
-      heap->CommittedMemoryExecutable() >
-          RegExpImpl::kRegExpExecutableMemoryLimit) {
-    too_much = true;
-  }
-  return too_much;
-}
-
-
-Object* RegExpResultsCache::Lookup(Heap* heap, String* key_string,
-                                   Object* key_pattern,
-                                   FixedArray** last_match_cache,
-                                   ResultsCacheType type) {
-  FixedArray* cache;
-  if (!key_string->IsInternalizedString()) return Smi::kZero;
-  if (type == STRING_SPLIT_SUBSTRINGS) {
-    DCHECK(key_pattern->IsString());
-    if (!key_pattern->IsInternalizedString()) return Smi::kZero;
-    cache = heap->string_split_cache();
-  } else {
-    DCHECK(type == REGEXP_MULTIPLE_INDICES);
-    DCHECK(key_pattern->IsFixedArray());
-    cache = heap->regexp_multiple_cache();
-  }
-
-  uint32_t hash = key_string->Hash();
-  uint32_t index = ((hash & (kRegExpResultsCacheSize - 1)) &
-                    ~(kArrayEntriesPerCacheEntry - 1));
-  if (cache->get(index + kStringOffset) != key_string ||
-      cache->get(index + kPatternOffset) != key_pattern) {
-    index =
-        ((index + kArrayEntriesPerCacheEntry) & (kRegExpResultsCacheSize - 1));
-    if (cache->get(index + kStringOffset) != key_string ||
-        cache->get(index + kPatternOffset) != key_pattern) {
-      return Smi::kZero;
-    }
-  }
-
-  *last_match_cache = FixedArray::cast(cache->get(index + kLastMatchOffset));
-  return cache->get(index + kArrayOffset);
-}
-
-
-void RegExpResultsCache::Enter(Isolate* isolate, Handle<String> key_string,
-                               Handle<Object> key_pattern,
-                               Handle<FixedArray> value_array,
-                               Handle<FixedArray> last_match_cache,
-                               ResultsCacheType type) {
-  Factory* factory = isolate->factory();
-  Handle<FixedArray> cache;
-  if (!key_string->IsInternalizedString()) return;
-  if (type == STRING_SPLIT_SUBSTRINGS) {
-    DCHECK(key_pattern->IsString());
-    if (!key_pattern->IsInternalizedString()) return;
-    cache = factory->string_split_cache();
-  } else {
-    DCHECK(type == REGEXP_MULTIPLE_INDICES);
-    DCHECK(key_pattern->IsFixedArray());
-    cache = factory->regexp_multiple_cache();
-  }
-
-  uint32_t hash = key_string->Hash();
-  uint32_t index = ((hash & (kRegExpResultsCacheSize - 1)) &
-                    ~(kArrayEntriesPerCacheEntry - 1));
-  if (cache->get(index + kStringOffset) == Smi::kZero) {
-    cache->set(index + kStringOffset, *key_string);
-    cache->set(index + kPatternOffset, *key_pattern);
-    cache->set(index + kArrayOffset, *value_array);
-    cache->set(index + kLastMatchOffset, *last_match_cache);
-  } else {
-    uint32_t index2 =
-        ((index + kArrayEntriesPerCacheEntry) & (kRegExpResultsCacheSize - 1));
-    if (cache->get(index2 + kStringOffset) == Smi::kZero) {
-      cache->set(index2 + kStringOffset, *key_string);
-      cache->set(index2 + kPatternOffset, *key_pattern);
-      cache->set(index2 + kArrayOffset, *value_array);
-      cache->set(index2 + kLastMatchOffset, *last_match_cache);
-    } else {
-      cache->set(index2 + kStringOffset, Smi::kZero);
-      cache->set(index2 + kPatternOffset, Smi::kZero);
-      cache->set(index2 + kArrayOffset, Smi::kZero);
-      cache->set(index2 + kLastMatchOffset, Smi::kZero);
-      cache->set(index + kStringOffset, *key_string);
-      cache->set(index + kPatternOffset, *key_pattern);
-      cache->set(index + kArrayOffset, *value_array);
-      cache->set(index + kLastMatchOffset, *last_match_cache);
-    }
-  }
-  // If the array is a reasonably short list of substrings, convert it into a
-  // list of internalized strings.
-  if (type == STRING_SPLIT_SUBSTRINGS && value_array->length() < 100) {
-    for (int i = 0; i < value_array->length(); i++) {
-      Handle<String> str(String::cast(value_array->get(i)), isolate);
-      Handle<String> internalized_str = factory->InternalizeString(str);
-      value_array->set(i, *internalized_str);
-    }
-  }
-  // Convert backing store to a copy-on-write array.
-  value_array->set_map_no_write_barrier(isolate->heap()->fixed_cow_array_map());
-}
-
-
-void RegExpResultsCache::Clear(FixedArray* cache) {
-  for (int i = 0; i < kRegExpResultsCacheSize; i++) {
-    cache->set(i, Smi::kZero);
-  }
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/regexp/jsregexp.h b/src/v8/src/regexp/jsregexp.h
deleted file mode 100644
index 021c59d..0000000
--- a/src/v8/src/regexp/jsregexp.h
+++ /dev/null
@@ -1,1571 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_REGEXP_JSREGEXP_H_
-#define V8_REGEXP_JSREGEXP_H_
-
-#include "src/allocation.h"
-#include "src/assembler.h"
-#include "src/objects/js-regexp.h"
-#include "src/regexp/regexp-ast.h"
-#include "src/regexp/regexp-macro-assembler.h"
-
-namespace v8 {
-namespace internal {
-
-class NodeVisitor;
-class RegExpCompiler;
-class RegExpMacroAssembler;
-class RegExpNode;
-class RegExpTree;
-class BoyerMooreLookahead;
-
-inline bool IgnoreCase(JSRegExp::Flags flags) {
-  return (flags & JSRegExp::kIgnoreCase) != 0;
-}
-
-inline bool IsUnicode(JSRegExp::Flags flags) {
-  return (flags & JSRegExp::kUnicode) != 0;
-}
-
-inline bool IsSticky(JSRegExp::Flags flags) {
-  return (flags & JSRegExp::kSticky) != 0;
-}
-
-inline bool IsGlobal(JSRegExp::Flags flags) {
-  return (flags & JSRegExp::kGlobal) != 0;
-}
-
-inline bool DotAll(JSRegExp::Flags flags) {
-  return (flags & JSRegExp::kDotAll) != 0;
-}
-
-inline bool Multiline(JSRegExp::Flags flags) {
-  return (flags & JSRegExp::kMultiline) != 0;
-}
-
-inline bool NeedsUnicodeCaseEquivalents(JSRegExp::Flags flags) {
-  // Both unicode and ignore_case flags are set. We need to use ICU to find
-  // the closure over case equivalents.
-  return IsUnicode(flags) && IgnoreCase(flags);
-}
-
-class RegExpImpl {
- public:
-  // Whether V8 is compiled with native regexp support or not.
-  static bool UsesNativeRegExp() {
-#ifdef V8_INTERPRETED_REGEXP
-    return false;
-#else
-    return true;
-#endif
-  }
-
-  // Returns a string representation of a regular expression.
-  // Implements RegExp.prototype.toString, see ECMA-262 section 15.10.6.4.
-  // This function calls the garbage collector if necessary.
-  static Handle<String> ToString(Handle<Object> value);
-
-  // Parses the RegExp pattern and prepares the JSRegExp object with
-  // generic data and choice of implementation - as well as what
-  // the implementation wants to store in the data field.
-  // Returns false if compilation fails.
-  MUST_USE_RESULT static MaybeHandle<Object> Compile(Handle<JSRegExp> re,
-                                                     Handle<String> pattern,
-                                                     JSRegExp::Flags flags);
-
-  // See ECMA-262 section 15.10.6.2.
-  // This function calls the garbage collector if necessary.
-  V8_EXPORT_PRIVATE MUST_USE_RESULT static MaybeHandle<Object> Exec(
-      Handle<JSRegExp> regexp, Handle<String> subject, int index,
-      Handle<RegExpMatchInfo> last_match_info);
-
-  // Prepares a JSRegExp object with Irregexp-specific data.
-  static void IrregexpInitialize(Handle<JSRegExp> re,
-                                 Handle<String> pattern,
-                                 JSRegExp::Flags flags,
-                                 int capture_register_count);
-
-
-  static void AtomCompile(Handle<JSRegExp> re,
-                          Handle<String> pattern,
-                          JSRegExp::Flags flags,
-                          Handle<String> match_pattern);
-
-
-  static int AtomExecRaw(Handle<JSRegExp> regexp,
-                         Handle<String> subject,
-                         int index,
-                         int32_t* output,
-                         int output_size);
-
-  static Handle<Object> AtomExec(Handle<JSRegExp> regexp,
-                                 Handle<String> subject, int index,
-                                 Handle<RegExpMatchInfo> last_match_info);
-
-  enum IrregexpResult { RE_FAILURE = 0, RE_SUCCESS = 1, RE_EXCEPTION = -1 };
-
-  // Prepare a RegExp for being executed one or more times (using
-  // IrregexpExecOnce) on the subject.
-  // This ensures that the regexp is compiled for the subject, and that
-  // the subject is flat.
-  // Returns the number of integer spaces required by IrregexpExecOnce
-  // as its "registers" argument.  If the regexp cannot be compiled,
-  // an exception is set as pending, and this function returns negative.
-  static int IrregexpPrepare(Handle<JSRegExp> regexp,
-                             Handle<String> subject);
-
-  // Execute a regular expression on the subject, starting from index.
-  // If matching succeeds, return the number of matches.  This can be larger
-  // than one in the case of global regular expressions.
-  // The captures and subcaptures are stored into the registers vector.
-  // If matching fails, returns RE_FAILURE.
-  // If execution fails, sets a pending exception and returns RE_EXCEPTION.
-  static int IrregexpExecRaw(Handle<JSRegExp> regexp,
-                             Handle<String> subject,
-                             int index,
-                             int32_t* output,
-                             int output_size);
-
-  // Execute an Irregexp bytecode pattern.
-  // On a successful match, the result is a JSArray containing
-  // captured positions.  On a failure, the result is the null value.
-  // Returns an empty handle in case of an exception.
-  MUST_USE_RESULT static MaybeHandle<Object> IrregexpExec(
-      Handle<JSRegExp> regexp, Handle<String> subject, int index,
-      Handle<RegExpMatchInfo> last_match_info);
-
-  // Set last match info.  If match is nullptr, then setting captures is
-  // omitted.
-  static Handle<RegExpMatchInfo> SetLastMatchInfo(
-      Handle<RegExpMatchInfo> last_match_info, Handle<String> subject,
-      int capture_count, int32_t* match);
-
-  class GlobalCache {
-   public:
-    GlobalCache(Handle<JSRegExp> regexp,
-                Handle<String> subject,
-                Isolate* isolate);
-
-    INLINE(~GlobalCache());
-
-    // Fetch the next entry in the cache for global regexp match results.
-    // This does not set the last match info.  Upon failure, nullptr is
-    // returned. The cause can be checked with Result().  The previous result is
-    // still in available in memory when a failure happens.
-    INLINE(int32_t* FetchNext());
-
-    INLINE(int32_t* LastSuccessfulMatch());
-
-    INLINE(bool HasException()) { return num_matches_ < 0; }
-
-   private:
-    int AdvanceZeroLength(int last_index);
-
-    int num_matches_;
-    int max_matches_;
-    int current_match_index_;
-    int registers_per_match_;
-    // Pointer to the last set of captures.
-    int32_t* register_array_;
-    int register_array_size_;
-    Handle<JSRegExp> regexp_;
-    Handle<String> subject_;
-  };
-
-  // For acting on the JSRegExp data FixedArray.
-  static int IrregexpMaxRegisterCount(FixedArray* re);
-  static void SetIrregexpMaxRegisterCount(FixedArray* re, int value);
-  static void SetIrregexpCaptureNameMap(FixedArray* re,
-                                        Handle<FixedArray> value);
-  static int IrregexpNumberOfCaptures(FixedArray* re);
-  static int IrregexpNumberOfRegisters(FixedArray* re);
-  static ByteArray* IrregexpByteCode(FixedArray* re, bool is_one_byte);
-  static Code* IrregexpNativeCode(FixedArray* re, bool is_one_byte);
-
-  // Limit the space regexps take up on the heap.  In order to limit this we
-  // would like to keep track of the amount of regexp code on the heap.  This
-  // is not tracked, however.  As a conservative approximation we track the
-  // total regexp code compiled including code that has subsequently been freed
-  // and the total executable memory at any point.
-  static const size_t kRegExpExecutableMemoryLimit = 16 * MB;
-  static const size_t kRegExpCompiledLimit = 1 * MB;
-  static const int kRegExpTooLargeToOptimize = 20 * KB;
-
- private:
-  static bool CompileIrregexp(Handle<JSRegExp> re,
-                              Handle<String> sample_subject, bool is_one_byte);
-  static inline bool EnsureCompiledIrregexp(Handle<JSRegExp> re,
-                                            Handle<String> sample_subject,
-                                            bool is_one_byte);
-};
-
-
-// Represents the location of one element relative to the intersection of
-// two sets. Corresponds to the four areas of a Venn diagram.
-enum ElementInSetsRelation {
-  kInsideNone = 0,
-  kInsideFirst = 1,
-  kInsideSecond = 2,
-  kInsideBoth = 3
-};
-
-
-// A set of unsigned integers that behaves especially well on small
-// integers (< 32).  May do zone-allocation.
-class OutSet: public ZoneObject {
- public:
-  OutSet() : first_(0), remaining_(nullptr), successors_(nullptr) {}
-  OutSet* Extend(unsigned value, Zone* zone);
-  bool Get(unsigned value) const;
-  static const unsigned kFirstLimit = 32;
-
- private:
-  // Destructively set a value in this set.  In most cases you want
-  // to use Extend instead to ensure that only one instance exists
-  // that contains the same values.
-  void Set(unsigned value, Zone* zone);
-
-  // The successors are a list of sets that contain the same values
-  // as this set and the one more value that is not present in this
-  // set.
-  ZoneList<OutSet*>* successors(Zone* zone) { return successors_; }
-
-  OutSet(uint32_t first, ZoneList<unsigned>* remaining)
-      : first_(first), remaining_(remaining), successors_(nullptr) {}
-  uint32_t first_;
-  ZoneList<unsigned>* remaining_;
-  ZoneList<OutSet*>* successors_;
-  friend class Trace;
-};
-
-
-// A mapping from integers, specified as ranges, to a set of integers.
-// Used for mapping character ranges to choices.
-class DispatchTable : public ZoneObject {
- public:
-  explicit DispatchTable(Zone* zone) : tree_(zone) { }
-
-  class Entry {
-   public:
-    Entry() : from_(0), to_(0), out_set_(nullptr) {}
-    Entry(uc32 from, uc32 to, OutSet* out_set)
-        : from_(from), to_(to), out_set_(out_set) {
-      DCHECK(from <= to);
-    }
-    uc32 from() { return from_; }
-    uc32 to() { return to_; }
-    void set_to(uc32 value) { to_ = value; }
-    void AddValue(int value, Zone* zone) {
-      out_set_ = out_set_->Extend(value, zone);
-    }
-    OutSet* out_set() { return out_set_; }
-   private:
-    uc32 from_;
-    uc32 to_;
-    OutSet* out_set_;
-  };
-
-  class Config {
-   public:
-    typedef uc32 Key;
-    typedef Entry Value;
-    static const uc32 kNoKey;
-    static const Entry NoValue() { return Value(); }
-    static inline int Compare(uc32 a, uc32 b) {
-      if (a == b)
-        return 0;
-      else if (a < b)
-        return -1;
-      else
-        return 1;
-    }
-  };
-
-  void AddRange(CharacterRange range, int value, Zone* zone);
-  OutSet* Get(uc32 value);
-  void Dump();
-
-  template <typename Callback>
-  void ForEach(Callback* callback) {
-    return tree()->ForEach(callback);
-  }
-
- private:
-  // There can't be a static empty set since it allocates its
-  // successors in a zone and caches them.
-  OutSet* empty() { return &empty_; }
-  OutSet empty_;
-  ZoneSplayTree<Config>* tree() { return &tree_; }
-  ZoneSplayTree<Config> tree_;
-};
-
-
-// Categorizes character ranges into BMP, non-BMP, lead, and trail surrogates.
-class UnicodeRangeSplitter {
- public:
-  UnicodeRangeSplitter(Zone* zone, ZoneList<CharacterRange>* base);
-  void Call(uc32 from, DispatchTable::Entry entry);
-
-  ZoneList<CharacterRange>* bmp() { return bmp_; }
-  ZoneList<CharacterRange>* lead_surrogates() { return lead_surrogates_; }
-  ZoneList<CharacterRange>* trail_surrogates() { return trail_surrogates_; }
-  ZoneList<CharacterRange>* non_bmp() const { return non_bmp_; }
-
- private:
-  static const int kBase = 0;
-  // Separate ranges into
-  static const int kBmpCodePoints = 1;
-  static const int kLeadSurrogates = 2;
-  static const int kTrailSurrogates = 3;
-  static const int kNonBmpCodePoints = 4;
-
-  Zone* zone_;
-  DispatchTable table_;
-  ZoneList<CharacterRange>* bmp_;
-  ZoneList<CharacterRange>* lead_surrogates_;
-  ZoneList<CharacterRange>* trail_surrogates_;
-  ZoneList<CharacterRange>* non_bmp_;
-};
-
-
-#define FOR_EACH_NODE_TYPE(VISIT)                                    \
-  VISIT(End)                                                         \
-  VISIT(Action)                                                      \
-  VISIT(Choice)                                                      \
-  VISIT(BackReference)                                               \
-  VISIT(Assertion)                                                   \
-  VISIT(Text)
-
-
-class Trace;
-struct PreloadState;
-class GreedyLoopState;
-class AlternativeGenerationList;
-
-struct NodeInfo {
-  NodeInfo()
-      : being_analyzed(false),
-        been_analyzed(false),
-        follows_word_interest(false),
-        follows_newline_interest(false),
-        follows_start_interest(false),
-        at_end(false),
-        visited(false),
-        replacement_calculated(false) { }
-
-  // Returns true if the interests and assumptions of this node
-  // matches the given one.
-  bool Matches(NodeInfo* that) {
-    return (at_end == that->at_end) &&
-           (follows_word_interest == that->follows_word_interest) &&
-           (follows_newline_interest == that->follows_newline_interest) &&
-           (follows_start_interest == that->follows_start_interest);
-  }
-
-  // Updates the interests of this node given the interests of the
-  // node preceding it.
-  void AddFromPreceding(NodeInfo* that) {
-    at_end |= that->at_end;
-    follows_word_interest |= that->follows_word_interest;
-    follows_newline_interest |= that->follows_newline_interest;
-    follows_start_interest |= that->follows_start_interest;
-  }
-
-  bool HasLookbehind() {
-    return follows_word_interest ||
-           follows_newline_interest ||
-           follows_start_interest;
-  }
-
-  // Sets the interests of this node to include the interests of the
-  // following node.
-  void AddFromFollowing(NodeInfo* that) {
-    follows_word_interest |= that->follows_word_interest;
-    follows_newline_interest |= that->follows_newline_interest;
-    follows_start_interest |= that->follows_start_interest;
-  }
-
-  void ResetCompilationState() {
-    being_analyzed = false;
-    been_analyzed = false;
-  }
-
-  bool being_analyzed: 1;
-  bool been_analyzed: 1;
-
-  // These bits are set of this node has to know what the preceding
-  // character was.
-  bool follows_word_interest: 1;
-  bool follows_newline_interest: 1;
-  bool follows_start_interest: 1;
-
-  bool at_end: 1;
-  bool visited: 1;
-  bool replacement_calculated: 1;
-};
-
-
-// Details of a quick mask-compare check that can look ahead in the
-// input stream.
-class QuickCheckDetails {
- public:
-  QuickCheckDetails()
-      : characters_(0),
-        mask_(0),
-        value_(0),
-        cannot_match_(false) { }
-  explicit QuickCheckDetails(int characters)
-      : characters_(characters),
-        mask_(0),
-        value_(0),
-        cannot_match_(false) { }
-  bool Rationalize(bool one_byte);
-  // Merge in the information from another branch of an alternation.
-  void Merge(QuickCheckDetails* other, int from_index);
-  // Advance the current position by some amount.
-  void Advance(int by, bool one_byte);
-  void Clear();
-  bool cannot_match() { return cannot_match_; }
-  void set_cannot_match() { cannot_match_ = true; }
-  struct Position {
-    Position() : mask(0), value(0), determines_perfectly(false) { }
-    uc16 mask;
-    uc16 value;
-    bool determines_perfectly;
-  };
-  int characters() { return characters_; }
-  void set_characters(int characters) { characters_ = characters; }
-  Position* positions(int index) {
-    DCHECK_LE(0, index);
-    DCHECK_GT(characters_, index);
-    return positions_ + index;
-  }
-  uint32_t mask() { return mask_; }
-  uint32_t value() { return value_; }
-
- private:
-  // How many characters do we have quick check information from.  This is
-  // the same for all branches of a choice node.
-  int characters_;
-  Position positions_[4];
-  // These values are the condensate of the above array after Rationalize().
-  uint32_t mask_;
-  uint32_t value_;
-  // If set to true, there is no way this quick check can match at all.
-  // E.g., if it requires to be at the start of the input, and isn't.
-  bool cannot_match_;
-};
-
-
-extern int kUninitializedRegExpNodePlaceHolder;
-
-
-class RegExpNode: public ZoneObject {
- public:
-  explicit RegExpNode(Zone* zone)
-      : replacement_(nullptr),
-        on_work_list_(false),
-        trace_count_(0),
-        zone_(zone) {
-    bm_info_[0] = bm_info_[1] = nullptr;
-  }
-  virtual ~RegExpNode();
-  virtual void Accept(NodeVisitor* visitor) = 0;
-  // Generates a goto to this node or actually generates the code at this point.
-  virtual void Emit(RegExpCompiler* compiler, Trace* trace) = 0;
-  // How many characters must this node consume at a minimum in order to
-  // succeed.  If we have found at least 'still_to_find' characters that
-  // must be consumed there is no need to ask any following nodes whether
-  // they are sure to eat any more characters.  The not_at_start argument is
-  // used to indicate that we know we are not at the start of the input.  In
-  // this case anchored branches will always fail and can be ignored when
-  // determining how many characters are consumed on success.
-  virtual int EatsAtLeast(int still_to_find, int budget, bool not_at_start) = 0;
-  // Emits some quick code that checks whether the preloaded characters match.
-  // Falls through on certain failure, jumps to the label on possible success.
-  // If the node cannot make a quick check it does nothing and returns false.
-  bool EmitQuickCheck(RegExpCompiler* compiler,
-                      Trace* bounds_check_trace,
-                      Trace* trace,
-                      bool preload_has_checked_bounds,
-                      Label* on_possible_success,
-                      QuickCheckDetails* details_return,
-                      bool fall_through_on_failure);
-  // For a given number of characters this returns a mask and a value.  The
-  // next n characters are anded with the mask and compared with the value.
-  // A comparison failure indicates the node cannot match the next n characters.
-  // A comparison success indicates the node may match.
-  virtual void GetQuickCheckDetails(QuickCheckDetails* details,
-                                    RegExpCompiler* compiler,
-                                    int characters_filled_in,
-                                    bool not_at_start) = 0;
-  static const int kNodeIsTooComplexForGreedyLoops = kMinInt;
-  virtual int GreedyLoopTextLength() { return kNodeIsTooComplexForGreedyLoops; }
-  // Only returns the successor for a text node of length 1 that matches any
-  // character and that has no guards on it.
-  virtual RegExpNode* GetSuccessorOfOmnivorousTextNode(
-      RegExpCompiler* compiler) {
-    return nullptr;
-  }
-
-  // Collects information on the possible code units (mod 128) that can match if
-  // we look forward.  This is used for a Boyer-Moore-like string searching
-  // implementation.  TODO(erikcorry):  This should share more code with
-  // EatsAtLeast, GetQuickCheckDetails.  The budget argument is used to limit
-  // the number of nodes we are willing to look at in order to create this data.
-  static const int kRecursionBudget = 200;
-  bool KeepRecursing(RegExpCompiler* compiler);
-  virtual void FillInBMInfo(Isolate* isolate, int offset, int budget,
-                            BoyerMooreLookahead* bm, bool not_at_start) {
-    UNREACHABLE();
-  }
-
-  // If we know that the input is one-byte then there are some nodes that can
-  // never match.  This method returns a node that can be substituted for
-  // itself, or nullptr if the node can never match.
-  virtual RegExpNode* FilterOneByte(int depth) { return this; }
-  // Helper for FilterOneByte.
-  RegExpNode* replacement() {
-    DCHECK(info()->replacement_calculated);
-    return replacement_;
-  }
-  RegExpNode* set_replacement(RegExpNode* replacement) {
-    info()->replacement_calculated = true;
-    replacement_ =  replacement;
-    return replacement;  // For convenience.
-  }
-
-  // We want to avoid recalculating the lookahead info, so we store it on the
-  // node.  Only info that is for this node is stored.  We can tell that the
-  // info is for this node when offset == 0, so the information is calculated
-  // relative to this node.
-  void SaveBMInfo(BoyerMooreLookahead* bm, bool not_at_start, int offset) {
-    if (offset == 0) set_bm_info(not_at_start, bm);
-  }
-
-  Label* label() { return &label_; }
-  // If non-generic code is generated for a node (i.e. the node is not at the
-  // start of the trace) then it cannot be reused.  This variable sets a limit
-  // on how often we allow that to happen before we insist on starting a new
-  // trace and generating generic code for a node that can be reused by flushing
-  // the deferred actions in the current trace and generating a goto.
-  static const int kMaxCopiesCodeGenerated = 10;
-
-  bool on_work_list() { return on_work_list_; }
-  void set_on_work_list(bool value) { on_work_list_ = value; }
-
-  NodeInfo* info() { return &info_; }
-
-  BoyerMooreLookahead* bm_info(bool not_at_start) {
-    return bm_info_[not_at_start ? 1 : 0];
-  }
-
-  Zone* zone() const { return zone_; }
-
- protected:
-  enum LimitResult { DONE, CONTINUE };
-  RegExpNode* replacement_;
-
-  LimitResult LimitVersions(RegExpCompiler* compiler, Trace* trace);
-
-  void set_bm_info(bool not_at_start, BoyerMooreLookahead* bm) {
-    bm_info_[not_at_start ? 1 : 0] = bm;
-  }
-
- private:
-  static const int kFirstCharBudget = 10;
-  Label label_;
-  bool on_work_list_;
-  NodeInfo info_;
-  // This variable keeps track of how many times code has been generated for
-  // this node (in different traces).  We don't keep track of where the
-  // generated code is located unless the code is generated at the start of
-  // a trace, in which case it is generic and can be reused by flushing the
-  // deferred operations in the current trace and generating a goto.
-  int trace_count_;
-  BoyerMooreLookahead* bm_info_[2];
-
-  Zone* zone_;
-};
-
-
-class SeqRegExpNode: public RegExpNode {
- public:
-  explicit SeqRegExpNode(RegExpNode* on_success)
-      : RegExpNode(on_success->zone()), on_success_(on_success) { }
-  RegExpNode* on_success() { return on_success_; }
-  void set_on_success(RegExpNode* node) { on_success_ = node; }
-  virtual RegExpNode* FilterOneByte(int depth);
-  virtual void FillInBMInfo(Isolate* isolate, int offset, int budget,
-                            BoyerMooreLookahead* bm, bool not_at_start) {
-    on_success_->FillInBMInfo(isolate, offset, budget - 1, bm, not_at_start);
-    if (offset == 0) set_bm_info(not_at_start, bm);
-  }
-
- protected:
-  RegExpNode* FilterSuccessor(int depth);
-
- private:
-  RegExpNode* on_success_;
-};
-
-
-class ActionNode: public SeqRegExpNode {
- public:
-  enum ActionType {
-    SET_REGISTER,
-    INCREMENT_REGISTER,
-    STORE_POSITION,
-    BEGIN_SUBMATCH,
-    POSITIVE_SUBMATCH_SUCCESS,
-    EMPTY_MATCH_CHECK,
-    CLEAR_CAPTURES
-  };
-  static ActionNode* SetRegister(int reg, int val, RegExpNode* on_success);
-  static ActionNode* IncrementRegister(int reg, RegExpNode* on_success);
-  static ActionNode* StorePosition(int reg,
-                                   bool is_capture,
-                                   RegExpNode* on_success);
-  static ActionNode* ClearCaptures(Interval range, RegExpNode* on_success);
-  static ActionNode* BeginSubmatch(int stack_pointer_reg,
-                                   int position_reg,
-                                   RegExpNode* on_success);
-  static ActionNode* PositiveSubmatchSuccess(int stack_pointer_reg,
-                                             int restore_reg,
-                                             int clear_capture_count,
-                                             int clear_capture_from,
-                                             RegExpNode* on_success);
-  static ActionNode* EmptyMatchCheck(int start_register,
-                                     int repetition_register,
-                                     int repetition_limit,
-                                     RegExpNode* on_success);
-  virtual void Accept(NodeVisitor* visitor);
-  virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-  virtual int EatsAtLeast(int still_to_find, int budget, bool not_at_start);
-  virtual void GetQuickCheckDetails(QuickCheckDetails* details,
-                                    RegExpCompiler* compiler,
-                                    int filled_in,
-                                    bool not_at_start) {
-    return on_success()->GetQuickCheckDetails(
-        details, compiler, filled_in, not_at_start);
-  }
-  virtual void FillInBMInfo(Isolate* isolate, int offset, int budget,
-                            BoyerMooreLookahead* bm, bool not_at_start);
-  ActionType action_type() { return action_type_; }
-  // TODO(erikcorry): We should allow some action nodes in greedy loops.
-  virtual int GreedyLoopTextLength() { return kNodeIsTooComplexForGreedyLoops; }
-
- private:
-  union {
-    struct {
-      int reg;
-      int value;
-    } u_store_register;
-    struct {
-      int reg;
-    } u_increment_register;
-    struct {
-      int reg;
-      bool is_capture;
-    } u_position_register;
-    struct {
-      int stack_pointer_register;
-      int current_position_register;
-      int clear_register_count;
-      int clear_register_from;
-    } u_submatch;
-    struct {
-      int start_register;
-      int repetition_register;
-      int repetition_limit;
-    } u_empty_match_check;
-    struct {
-      int range_from;
-      int range_to;
-    } u_clear_captures;
-  } data_;
-  ActionNode(ActionType action_type, RegExpNode* on_success)
-      : SeqRegExpNode(on_success),
-        action_type_(action_type) { }
-  ActionType action_type_;
-  friend class DotPrinter;
-};
-
-
-class TextNode: public SeqRegExpNode {
- public:
-  TextNode(ZoneList<TextElement>* elms, bool read_backward,
-           RegExpNode* on_success)
-      : SeqRegExpNode(on_success), elms_(elms), read_backward_(read_backward) {}
-  TextNode(RegExpCharacterClass* that, bool read_backward,
-           RegExpNode* on_success)
-      : SeqRegExpNode(on_success),
-        elms_(new (zone()) ZoneList<TextElement>(1, zone())),
-        read_backward_(read_backward) {
-    elms_->Add(TextElement::CharClass(that), zone());
-  }
-  // Create TextNode for a single character class for the given ranges.
-  static TextNode* CreateForCharacterRanges(Zone* zone,
-                                            ZoneList<CharacterRange>* ranges,
-                                            bool read_backward,
-                                            RegExpNode* on_success,
-                                            JSRegExp::Flags flags);
-  // Create TextNode for a surrogate pair with a range given for the
-  // lead and the trail surrogate each.
-  static TextNode* CreateForSurrogatePair(Zone* zone, CharacterRange lead,
-                                          CharacterRange trail,
-                                          bool read_backward,
-                                          RegExpNode* on_success,
-                                          JSRegExp::Flags flags);
-  virtual void Accept(NodeVisitor* visitor);
-  virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-  virtual int EatsAtLeast(int still_to_find, int budget, bool not_at_start);
-  virtual void GetQuickCheckDetails(QuickCheckDetails* details,
-                                    RegExpCompiler* compiler,
-                                    int characters_filled_in,
-                                    bool not_at_start);
-  ZoneList<TextElement>* elements() { return elms_; }
-  bool read_backward() { return read_backward_; }
-  void MakeCaseIndependent(Isolate* isolate, bool is_one_byte);
-  virtual int GreedyLoopTextLength();
-  virtual RegExpNode* GetSuccessorOfOmnivorousTextNode(
-      RegExpCompiler* compiler);
-  virtual void FillInBMInfo(Isolate* isolate, int offset, int budget,
-                            BoyerMooreLookahead* bm, bool not_at_start);
-  void CalculateOffsets();
-  virtual RegExpNode* FilterOneByte(int depth);
-
- private:
-  enum TextEmitPassType {
-    NON_LATIN1_MATCH,            // Check for characters that can't match.
-    SIMPLE_CHARACTER_MATCH,      // Case-dependent single character check.
-    NON_LETTER_CHARACTER_MATCH,  // Check characters that have no case equivs.
-    CASE_CHARACTER_MATCH,        // Case-independent single character check.
-    CHARACTER_CLASS_MATCH        // Character class.
-  };
-  static bool SkipPass(TextEmitPassType pass, bool ignore_case);
-  static const int kFirstRealPass = SIMPLE_CHARACTER_MATCH;
-  static const int kLastPass = CHARACTER_CLASS_MATCH;
-  void TextEmitPass(RegExpCompiler* compiler,
-                    TextEmitPassType pass,
-                    bool preloaded,
-                    Trace* trace,
-                    bool first_element_checked,
-                    int* checked_up_to);
-  int Length();
-  ZoneList<TextElement>* elms_;
-  bool read_backward_;
-};
-
-
-class AssertionNode: public SeqRegExpNode {
- public:
-  enum AssertionType {
-    AT_END,
-    AT_START,
-    AT_BOUNDARY,
-    AT_NON_BOUNDARY,
-    AFTER_NEWLINE
-  };
-  static AssertionNode* AtEnd(RegExpNode* on_success) {
-    return new(on_success->zone()) AssertionNode(AT_END, on_success);
-  }
-  static AssertionNode* AtStart(RegExpNode* on_success) {
-    return new(on_success->zone()) AssertionNode(AT_START, on_success);
-  }
-  static AssertionNode* AtBoundary(RegExpNode* on_success) {
-    return new(on_success->zone()) AssertionNode(AT_BOUNDARY, on_success);
-  }
-  static AssertionNode* AtNonBoundary(RegExpNode* on_success) {
-    return new(on_success->zone()) AssertionNode(AT_NON_BOUNDARY, on_success);
-  }
-  static AssertionNode* AfterNewline(RegExpNode* on_success) {
-    return new(on_success->zone()) AssertionNode(AFTER_NEWLINE, on_success);
-  }
-  virtual void Accept(NodeVisitor* visitor);
-  virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-  virtual int EatsAtLeast(int still_to_find, int budget, bool not_at_start);
-  virtual void GetQuickCheckDetails(QuickCheckDetails* details,
-                                    RegExpCompiler* compiler,
-                                    int filled_in,
-                                    bool not_at_start);
-  virtual void FillInBMInfo(Isolate* isolate, int offset, int budget,
-                            BoyerMooreLookahead* bm, bool not_at_start);
-  AssertionType assertion_type() { return assertion_type_; }
-
- private:
-  void EmitBoundaryCheck(RegExpCompiler* compiler, Trace* trace);
-  enum IfPrevious { kIsNonWord, kIsWord };
-  void BacktrackIfPrevious(RegExpCompiler* compiler,
-                           Trace* trace,
-                           IfPrevious backtrack_if_previous);
-  AssertionNode(AssertionType t, RegExpNode* on_success)
-      : SeqRegExpNode(on_success), assertion_type_(t) { }
-  AssertionType assertion_type_;
-};
-
-
-class BackReferenceNode: public SeqRegExpNode {
- public:
-  BackReferenceNode(int start_reg, int end_reg, JSRegExp::Flags flags,
-                    bool read_backward, RegExpNode* on_success)
-      : SeqRegExpNode(on_success),
-        start_reg_(start_reg),
-        end_reg_(end_reg),
-        flags_(flags),
-        read_backward_(read_backward) {}
-  virtual void Accept(NodeVisitor* visitor);
-  int start_register() { return start_reg_; }
-  int end_register() { return end_reg_; }
-  bool read_backward() { return read_backward_; }
-  virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-  virtual int EatsAtLeast(int still_to_find,
-                          int recursion_depth,
-                          bool not_at_start);
-  virtual void GetQuickCheckDetails(QuickCheckDetails* details,
-                                    RegExpCompiler* compiler,
-                                    int characters_filled_in,
-                                    bool not_at_start) {
-    return;
-  }
-  virtual void FillInBMInfo(Isolate* isolate, int offset, int budget,
-                            BoyerMooreLookahead* bm, bool not_at_start);
-
- private:
-  int start_reg_;
-  int end_reg_;
-  JSRegExp::Flags flags_;
-  bool read_backward_;
-};
-
-
-class EndNode: public RegExpNode {
- public:
-  enum Action { ACCEPT, BACKTRACK, NEGATIVE_SUBMATCH_SUCCESS };
-  EndNode(Action action, Zone* zone) : RegExpNode(zone), action_(action) {}
-  virtual void Accept(NodeVisitor* visitor);
-  virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-  virtual int EatsAtLeast(int still_to_find,
-                          int recursion_depth,
-                          bool not_at_start) { return 0; }
-  virtual void GetQuickCheckDetails(QuickCheckDetails* details,
-                                    RegExpCompiler* compiler,
-                                    int characters_filled_in,
-                                    bool not_at_start) {
-    // Returning 0 from EatsAtLeast should ensure we never get here.
-    UNREACHABLE();
-  }
-  virtual void FillInBMInfo(Isolate* isolate, int offset, int budget,
-                            BoyerMooreLookahead* bm, bool not_at_start) {
-    // Returning 0 from EatsAtLeast should ensure we never get here.
-    UNREACHABLE();
-  }
-
- private:
-  Action action_;
-};
-
-
-class NegativeSubmatchSuccess: public EndNode {
- public:
-  NegativeSubmatchSuccess(int stack_pointer_reg,
-                          int position_reg,
-                          int clear_capture_count,
-                          int clear_capture_start,
-                          Zone* zone)
-      : EndNode(NEGATIVE_SUBMATCH_SUCCESS, zone),
-        stack_pointer_register_(stack_pointer_reg),
-        current_position_register_(position_reg),
-        clear_capture_count_(clear_capture_count),
-        clear_capture_start_(clear_capture_start) { }
-  virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-
- private:
-  int stack_pointer_register_;
-  int current_position_register_;
-  int clear_capture_count_;
-  int clear_capture_start_;
-};
-
-
-class Guard: public ZoneObject {
- public:
-  enum Relation { LT, GEQ };
-  Guard(int reg, Relation op, int value)
-      : reg_(reg),
-        op_(op),
-        value_(value) { }
-  int reg() { return reg_; }
-  Relation op() { return op_; }
-  int value() { return value_; }
-
- private:
-  int reg_;
-  Relation op_;
-  int value_;
-};
-
-
-class GuardedAlternative {
- public:
-  explicit GuardedAlternative(RegExpNode* node)
-      : node_(node), guards_(nullptr) {}
-  void AddGuard(Guard* guard, Zone* zone);
-  RegExpNode* node() { return node_; }
-  void set_node(RegExpNode* node) { node_ = node; }
-  ZoneList<Guard*>* guards() { return guards_; }
-
- private:
-  RegExpNode* node_;
-  ZoneList<Guard*>* guards_;
-};
-
-
-class AlternativeGeneration;
-
-
-class ChoiceNode: public RegExpNode {
- public:
-  explicit ChoiceNode(int expected_size, Zone* zone)
-      : RegExpNode(zone),
-        alternatives_(new (zone)
-                          ZoneList<GuardedAlternative>(expected_size, zone)),
-        table_(nullptr),
-        not_at_start_(false),
-        being_calculated_(false) {}
-  virtual void Accept(NodeVisitor* visitor);
-  void AddAlternative(GuardedAlternative node) {
-    alternatives()->Add(node, zone());
-  }
-  ZoneList<GuardedAlternative>* alternatives() { return alternatives_; }
-  DispatchTable* GetTable(bool ignore_case);
-  virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-  virtual int EatsAtLeast(int still_to_find, int budget, bool not_at_start);
-  int EatsAtLeastHelper(int still_to_find,
-                        int budget,
-                        RegExpNode* ignore_this_node,
-                        bool not_at_start);
-  virtual void GetQuickCheckDetails(QuickCheckDetails* details,
-                                    RegExpCompiler* compiler,
-                                    int characters_filled_in,
-                                    bool not_at_start);
-  virtual void FillInBMInfo(Isolate* isolate, int offset, int budget,
-                            BoyerMooreLookahead* bm, bool not_at_start);
-
-  bool being_calculated() { return being_calculated_; }
-  bool not_at_start() { return not_at_start_; }
-  void set_not_at_start() { not_at_start_ = true; }
-  void set_being_calculated(bool b) { being_calculated_ = b; }
-  virtual bool try_to_emit_quick_check_for_alternative(bool is_first) {
-    return true;
-  }
-  virtual RegExpNode* FilterOneByte(int depth);
-  virtual bool read_backward() { return false; }
-
- protected:
-  int GreedyLoopTextLengthForAlternative(GuardedAlternative* alternative);
-  ZoneList<GuardedAlternative>* alternatives_;
-
- private:
-  friend class DispatchTableConstructor;
-  friend class Analysis;
-  void GenerateGuard(RegExpMacroAssembler* macro_assembler,
-                     Guard* guard,
-                     Trace* trace);
-  int CalculatePreloadCharacters(RegExpCompiler* compiler, int eats_at_least);
-  void EmitOutOfLineContinuation(RegExpCompiler* compiler,
-                                 Trace* trace,
-                                 GuardedAlternative alternative,
-                                 AlternativeGeneration* alt_gen,
-                                 int preload_characters,
-                                 bool next_expects_preload);
-  void SetUpPreLoad(RegExpCompiler* compiler,
-                    Trace* current_trace,
-                    PreloadState* preloads);
-  void AssertGuardsMentionRegisters(Trace* trace);
-  int EmitOptimizedUnanchoredSearch(RegExpCompiler* compiler, Trace* trace);
-  Trace* EmitGreedyLoop(RegExpCompiler* compiler,
-                        Trace* trace,
-                        AlternativeGenerationList* alt_gens,
-                        PreloadState* preloads,
-                        GreedyLoopState* greedy_loop_state,
-                        int text_length);
-  void EmitChoices(RegExpCompiler* compiler,
-                   AlternativeGenerationList* alt_gens,
-                   int first_choice,
-                   Trace* trace,
-                   PreloadState* preloads);
-  DispatchTable* table_;
-  // If true, this node is never checked at the start of the input.
-  // Allows a new trace to start with at_start() set to false.
-  bool not_at_start_;
-  bool being_calculated_;
-};
-
-
-class NegativeLookaroundChoiceNode : public ChoiceNode {
- public:
-  explicit NegativeLookaroundChoiceNode(GuardedAlternative this_must_fail,
-                                        GuardedAlternative then_do_this,
-                                        Zone* zone)
-      : ChoiceNode(2, zone) {
-    AddAlternative(this_must_fail);
-    AddAlternative(then_do_this);
-  }
-  virtual int EatsAtLeast(int still_to_find, int budget, bool not_at_start);
-  virtual void GetQuickCheckDetails(QuickCheckDetails* details,
-                                    RegExpCompiler* compiler,
-                                    int characters_filled_in,
-                                    bool not_at_start);
-  virtual void FillInBMInfo(Isolate* isolate, int offset, int budget,
-                            BoyerMooreLookahead* bm, bool not_at_start) {
-    alternatives_->at(1).node()->FillInBMInfo(isolate, offset, budget - 1, bm,
-                                              not_at_start);
-    if (offset == 0) set_bm_info(not_at_start, bm);
-  }
-  // For a negative lookahead we don't emit the quick check for the
-  // alternative that is expected to fail.  This is because quick check code
-  // starts by loading enough characters for the alternative that takes fewest
-  // characters, but on a negative lookahead the negative branch did not take
-  // part in that calculation (EatsAtLeast) so the assumptions don't hold.
-  virtual bool try_to_emit_quick_check_for_alternative(bool is_first) {
-    return !is_first;
-  }
-  virtual RegExpNode* FilterOneByte(int depth);
-};
-
-
-class LoopChoiceNode: public ChoiceNode {
- public:
-  LoopChoiceNode(bool body_can_be_zero_length, bool read_backward, Zone* zone)
-      : ChoiceNode(2, zone),
-        loop_node_(nullptr),
-        continue_node_(nullptr),
-        body_can_be_zero_length_(body_can_be_zero_length),
-        read_backward_(read_backward) {}
-  void AddLoopAlternative(GuardedAlternative alt);
-  void AddContinueAlternative(GuardedAlternative alt);
-  virtual void Emit(RegExpCompiler* compiler, Trace* trace);
-  virtual int EatsAtLeast(int still_to_find,  int budget, bool not_at_start);
-  virtual void GetQuickCheckDetails(QuickCheckDetails* details,
-                                    RegExpCompiler* compiler,
-                                    int characters_filled_in,
-                                    bool not_at_start);
-  virtual void FillInBMInfo(Isolate* isolate, int offset, int budget,
-                            BoyerMooreLookahead* bm, bool not_at_start);
-  RegExpNode* loop_node() { return loop_node_; }
-  RegExpNode* continue_node() { return continue_node_; }
-  bool body_can_be_zero_length() { return body_can_be_zero_length_; }
-  virtual bool read_backward() { return read_backward_; }
-  virtual void Accept(NodeVisitor* visitor);
-  virtual RegExpNode* FilterOneByte(int depth);
-
- private:
-  // AddAlternative is made private for loop nodes because alternatives
-  // should not be added freely, we need to keep track of which node
-  // goes back to the node itself.
-  void AddAlternative(GuardedAlternative node) {
-    ChoiceNode::AddAlternative(node);
-  }
-
-  RegExpNode* loop_node_;
-  RegExpNode* continue_node_;
-  bool body_can_be_zero_length_;
-  bool read_backward_;
-};
-
-
-// Improve the speed that we scan for an initial point where a non-anchored
-// regexp can match by using a Boyer-Moore-like table. This is done by
-// identifying non-greedy non-capturing loops in the nodes that eat any
-// character one at a time.  For example in the middle of the regexp
-// /foo[\s\S]*?bar/ we find such a loop.  There is also such a loop implicitly
-// inserted at the start of any non-anchored regexp.
-//
-// When we have found such a loop we look ahead in the nodes to find the set of
-// characters that can come at given distances. For example for the regexp
-// /.?foo/ we know that there are at least 3 characters ahead of us, and the
-// sets of characters that can occur are [any, [f, o], [o]]. We find a range in
-// the lookahead info where the set of characters is reasonably constrained. In
-// our example this is from index 1 to 2 (0 is not constrained). We can now
-// look 3 characters ahead and if we don't find one of [f, o] (the union of
-// [f, o] and [o]) then we can skip forwards by the range size (in this case 2).
-//
-// For Unicode input strings we do the same, but modulo 128.
-//
-// We also look at the first string fed to the regexp and use that to get a hint
-// of the character frequencies in the inputs. This affects the assessment of
-// whether the set of characters is 'reasonably constrained'.
-//
-// We also have another lookahead mechanism (called quick check in the code),
-// which uses a wide load of multiple characters followed by a mask and compare
-// to determine whether a match is possible at this point.
-enum ContainedInLattice {
-  kNotYet = 0,
-  kLatticeIn = 1,
-  kLatticeOut = 2,
-  kLatticeUnknown = 3  // Can also mean both in and out.
-};
-
-
-inline ContainedInLattice Combine(ContainedInLattice a, ContainedInLattice b) {
-  return static_cast<ContainedInLattice>(a | b);
-}
-
-
-ContainedInLattice AddRange(ContainedInLattice a,
-                            const int* ranges,
-                            int ranges_size,
-                            Interval new_range);
-
-
-class BoyerMoorePositionInfo : public ZoneObject {
- public:
-  explicit BoyerMoorePositionInfo(Zone* zone)
-      : map_(new(zone) ZoneList<bool>(kMapSize, zone)),
-        map_count_(0),
-        w_(kNotYet),
-        s_(kNotYet),
-        d_(kNotYet),
-        surrogate_(kNotYet) {
-     for (int i = 0; i < kMapSize; i++) {
-       map_->Add(false, zone);
-     }
-  }
-
-  bool& at(int i) { return map_->at(i); }
-
-  static const int kMapSize = 128;
-  static const int kMask = kMapSize - 1;
-
-  int map_count() const { return map_count_; }
-
-  void Set(int character);
-  void SetInterval(const Interval& interval);
-  void SetAll();
-  bool is_non_word() { return w_ == kLatticeOut; }
-  bool is_word() { return w_ == kLatticeIn; }
-
- private:
-  ZoneList<bool>* map_;
-  int map_count_;  // Number of set bits in the map.
-  ContainedInLattice w_;  // The \w character class.
-  ContainedInLattice s_;  // The \s character class.
-  ContainedInLattice d_;  // The \d character class.
-  ContainedInLattice surrogate_;  // Surrogate UTF-16 code units.
-};
-
-
-class BoyerMooreLookahead : public ZoneObject {
- public:
-  BoyerMooreLookahead(int length, RegExpCompiler* compiler, Zone* zone);
-
-  int length() { return length_; }
-  int max_char() { return max_char_; }
-  RegExpCompiler* compiler() { return compiler_; }
-
-  int Count(int map_number) {
-    return bitmaps_->at(map_number)->map_count();
-  }
-
-  BoyerMoorePositionInfo* at(int i) { return bitmaps_->at(i); }
-
-  void Set(int map_number, int character) {
-    if (character > max_char_) return;
-    BoyerMoorePositionInfo* info = bitmaps_->at(map_number);
-    info->Set(character);
-  }
-
-  void SetInterval(int map_number, const Interval& interval) {
-    if (interval.from() > max_char_) return;
-    BoyerMoorePositionInfo* info = bitmaps_->at(map_number);
-    if (interval.to() > max_char_) {
-      info->SetInterval(Interval(interval.from(), max_char_));
-    } else {
-      info->SetInterval(interval);
-    }
-  }
-
-  void SetAll(int map_number) {
-    bitmaps_->at(map_number)->SetAll();
-  }
-
-  void SetRest(int from_map) {
-    for (int i = from_map; i < length_; i++) SetAll(i);
-  }
-  void EmitSkipInstructions(RegExpMacroAssembler* masm);
-
- private:
-  // This is the value obtained by EatsAtLeast.  If we do not have at least this
-  // many characters left in the sample string then the match is bound to fail.
-  // Therefore it is OK to read a character this far ahead of the current match
-  // point.
-  int length_;
-  RegExpCompiler* compiler_;
-  // 0xff for Latin1, 0xffff for UTF-16.
-  int max_char_;
-  ZoneList<BoyerMoorePositionInfo*>* bitmaps_;
-
-  int GetSkipTable(int min_lookahead,
-                   int max_lookahead,
-                   Handle<ByteArray> boolean_skip_table);
-  bool FindWorthwhileInterval(int* from, int* to);
-  int FindBestInterval(
-    int max_number_of_chars, int old_biggest_points, int* from, int* to);
-};
-
-
-// There are many ways to generate code for a node.  This class encapsulates
-// the current way we should be generating.  In other words it encapsulates
-// the current state of the code generator.  The effect of this is that we
-// generate code for paths that the matcher can take through the regular
-// expression.  A given node in the regexp can be code-generated several times
-// as it can be part of several traces.  For example for the regexp:
-// /foo(bar|ip)baz/ the code to match baz will be generated twice, once as part
-// of the foo-bar-baz trace and once as part of the foo-ip-baz trace.  The code
-// to match foo is generated only once (the traces have a common prefix).  The
-// code to store the capture is deferred and generated (twice) after the places
-// where baz has been matched.
-class Trace {
- public:
-  // A value for a property that is either known to be true, know to be false,
-  // or not known.
-  enum TriBool {
-    UNKNOWN = -1, FALSE_VALUE = 0, TRUE_VALUE = 1
-  };
-
-  class DeferredAction {
-   public:
-    DeferredAction(ActionNode::ActionType action_type, int reg)
-        : action_type_(action_type), reg_(reg), next_(nullptr) {}
-    DeferredAction* next() { return next_; }
-    bool Mentions(int reg);
-    int reg() { return reg_; }
-    ActionNode::ActionType action_type() { return action_type_; }
-   private:
-    ActionNode::ActionType action_type_;
-    int reg_;
-    DeferredAction* next_;
-    friend class Trace;
-  };
-
-  class DeferredCapture : public DeferredAction {
-   public:
-    DeferredCapture(int reg, bool is_capture, Trace* trace)
-        : DeferredAction(ActionNode::STORE_POSITION, reg),
-          cp_offset_(trace->cp_offset()),
-          is_capture_(is_capture) { }
-    int cp_offset() { return cp_offset_; }
-    bool is_capture() { return is_capture_; }
-   private:
-    int cp_offset_;
-    bool is_capture_;
-    void set_cp_offset(int cp_offset) { cp_offset_ = cp_offset; }
-  };
-
-  class DeferredSetRegister : public DeferredAction {
-   public:
-    DeferredSetRegister(int reg, int value)
-        : DeferredAction(ActionNode::SET_REGISTER, reg),
-          value_(value) { }
-    int value() { return value_; }
-   private:
-    int value_;
-  };
-
-  class DeferredClearCaptures : public DeferredAction {
-   public:
-    explicit DeferredClearCaptures(Interval range)
-        : DeferredAction(ActionNode::CLEAR_CAPTURES, -1),
-          range_(range) { }
-    Interval range() { return range_; }
-   private:
-    Interval range_;
-  };
-
-  class DeferredIncrementRegister : public DeferredAction {
-   public:
-    explicit DeferredIncrementRegister(int reg)
-        : DeferredAction(ActionNode::INCREMENT_REGISTER, reg) { }
-  };
-
-  Trace()
-      : cp_offset_(0),
-        actions_(nullptr),
-        backtrack_(nullptr),
-        stop_node_(nullptr),
-        loop_label_(nullptr),
-        characters_preloaded_(0),
-        bound_checked_up_to_(0),
-        flush_budget_(100),
-        at_start_(UNKNOWN) {}
-
-  // End the trace.  This involves flushing the deferred actions in the trace
-  // and pushing a backtrack location onto the backtrack stack.  Once this is
-  // done we can start a new trace or go to one that has already been
-  // generated.
-  void Flush(RegExpCompiler* compiler, RegExpNode* successor);
-  int cp_offset() { return cp_offset_; }
-  DeferredAction* actions() { return actions_; }
-  // A trivial trace is one that has no deferred actions or other state that
-  // affects the assumptions used when generating code.  There is no recorded
-  // backtrack location in a trivial trace, so with a trivial trace we will
-  // generate code that, on a failure to match, gets the backtrack location
-  // from the backtrack stack rather than using a direct jump instruction.  We
-  // always start code generation with a trivial trace and non-trivial traces
-  // are created as we emit code for nodes or add to the list of deferred
-  // actions in the trace.  The location of the code generated for a node using
-  // a trivial trace is recorded in a label in the node so that gotos can be
-  // generated to that code.
-  bool is_trivial() {
-    return backtrack_ == nullptr && actions_ == nullptr && cp_offset_ == 0 &&
-           characters_preloaded_ == 0 && bound_checked_up_to_ == 0 &&
-           quick_check_performed_.characters() == 0 && at_start_ == UNKNOWN;
-  }
-  TriBool at_start() { return at_start_; }
-  void set_at_start(TriBool at_start) { at_start_ = at_start; }
-  Label* backtrack() { return backtrack_; }
-  Label* loop_label() { return loop_label_; }
-  RegExpNode* stop_node() { return stop_node_; }
-  int characters_preloaded() { return characters_preloaded_; }
-  int bound_checked_up_to() { return bound_checked_up_to_; }
-  int flush_budget() { return flush_budget_; }
-  QuickCheckDetails* quick_check_performed() { return &quick_check_performed_; }
-  bool mentions_reg(int reg);
-  // Returns true if a deferred position store exists to the specified
-  // register and stores the offset in the out-parameter.  Otherwise
-  // returns false.
-  bool GetStoredPosition(int reg, int* cp_offset);
-  // These set methods and AdvanceCurrentPositionInTrace should be used only on
-  // new traces - the intention is that traces are immutable after creation.
-  void add_action(DeferredAction* new_action) {
-    DCHECK(new_action->next_ == nullptr);
-    new_action->next_ = actions_;
-    actions_ = new_action;
-  }
-  void set_backtrack(Label* backtrack) { backtrack_ = backtrack; }
-  void set_stop_node(RegExpNode* node) { stop_node_ = node; }
-  void set_loop_label(Label* label) { loop_label_ = label; }
-  void set_characters_preloaded(int count) { characters_preloaded_ = count; }
-  void set_bound_checked_up_to(int to) { bound_checked_up_to_ = to; }
-  void set_flush_budget(int to) { flush_budget_ = to; }
-  void set_quick_check_performed(QuickCheckDetails* d) {
-    quick_check_performed_ = *d;
-  }
-  void InvalidateCurrentCharacter();
-  void AdvanceCurrentPositionInTrace(int by, RegExpCompiler* compiler);
-
- private:
-  int FindAffectedRegisters(OutSet* affected_registers, Zone* zone);
-  void PerformDeferredActions(RegExpMacroAssembler* macro,
-                              int max_register,
-                              const OutSet& affected_registers,
-                              OutSet* registers_to_pop,
-                              OutSet* registers_to_clear,
-                              Zone* zone);
-  void RestoreAffectedRegisters(RegExpMacroAssembler* macro,
-                                int max_register,
-                                const OutSet& registers_to_pop,
-                                const OutSet& registers_to_clear);
-  int cp_offset_;
-  DeferredAction* actions_;
-  Label* backtrack_;
-  RegExpNode* stop_node_;
-  Label* loop_label_;
-  int characters_preloaded_;
-  int bound_checked_up_to_;
-  QuickCheckDetails quick_check_performed_;
-  int flush_budget_;
-  TriBool at_start_;
-};
-
-
-class GreedyLoopState {
- public:
-  explicit GreedyLoopState(bool not_at_start);
-
-  Label* label() { return &label_; }
-  Trace* counter_backtrack_trace() { return &counter_backtrack_trace_; }
-
- private:
-  Label label_;
-  Trace counter_backtrack_trace_;
-};
-
-
-struct PreloadState {
-  static const int kEatsAtLeastNotYetInitialized = -1;
-  bool preload_is_current_;
-  bool preload_has_checked_bounds_;
-  int preload_characters_;
-  int eats_at_least_;
-  void init() {
-    eats_at_least_ = kEatsAtLeastNotYetInitialized;
-  }
-};
-
-
-class NodeVisitor {
- public:
-  virtual ~NodeVisitor() { }
-#define DECLARE_VISIT(Type)                                          \
-  virtual void Visit##Type(Type##Node* that) = 0;
-FOR_EACH_NODE_TYPE(DECLARE_VISIT)
-#undef DECLARE_VISIT
-  virtual void VisitLoopChoice(LoopChoiceNode* that) { VisitChoice(that); }
-};
-
-
-// Node visitor used to add the start set of the alternatives to the
-// dispatch table of a choice node.
-class DispatchTableConstructor: public NodeVisitor {
- public:
-  DispatchTableConstructor(DispatchTable* table, bool ignore_case,
-                           Zone* zone)
-      : table_(table),
-        choice_index_(-1),
-        ignore_case_(ignore_case),
-        zone_(zone) { }
-
-  void BuildTable(ChoiceNode* node);
-
-  void AddRange(CharacterRange range) {
-    table()->AddRange(range, choice_index_, zone_);
-  }
-
-  void AddInverse(ZoneList<CharacterRange>* ranges);
-
-#define DECLARE_VISIT(Type)                                          \
-  virtual void Visit##Type(Type##Node* that);
-FOR_EACH_NODE_TYPE(DECLARE_VISIT)
-#undef DECLARE_VISIT
-
-  DispatchTable* table() { return table_; }
-  void set_choice_index(int value) { choice_index_ = value; }
-
- protected:
-  DispatchTable* table_;
-  int choice_index_;
-  bool ignore_case_;
-  Zone* zone_;
-};
-
-
-// Assertion propagation moves information about assertions such as
-// \b to the affected nodes.  For instance, in /.\b./ information must
-// be propagated to the first '.' that whatever follows needs to know
-// if it matched a word or a non-word, and to the second '.' that it
-// has to check if it succeeds a word or non-word.  In this case the
-// result will be something like:
-//
-//   +-------+        +------------+
-//   |   .   |        |      .     |
-//   +-------+  --->  +------------+
-//   | word? |        | check word |
-//   +-------+        +------------+
-class Analysis: public NodeVisitor {
- public:
-  Analysis(Isolate* isolate, bool is_one_byte)
-      : isolate_(isolate), is_one_byte_(is_one_byte), error_message_(nullptr) {}
-  void EnsureAnalyzed(RegExpNode* node);
-
-#define DECLARE_VISIT(Type)                                          \
-  virtual void Visit##Type(Type##Node* that);
-FOR_EACH_NODE_TYPE(DECLARE_VISIT)
-#undef DECLARE_VISIT
-  virtual void VisitLoopChoice(LoopChoiceNode* that);
-
-  bool has_failed() { return error_message_ != nullptr; }
-  const char* error_message() {
-    DCHECK(error_message_ != nullptr);
-    return error_message_;
-  }
-  void fail(const char* error_message) {
-    error_message_ = error_message;
-  }
-
-  Isolate* isolate() const { return isolate_; }
-
- private:
-  Isolate* isolate_;
-  bool is_one_byte_;
-  const char* error_message_;
-
-  DISALLOW_IMPLICIT_CONSTRUCTORS(Analysis);
-};
-
-
-struct RegExpCompileData {
-  RegExpCompileData()
-      : tree(nullptr),
-        node(nullptr),
-        simple(true),
-        contains_anchor(false),
-        capture_count(0) {}
-  RegExpTree* tree;
-  RegExpNode* node;
-  bool simple;
-  bool contains_anchor;
-  Handle<FixedArray> capture_name_map;
-  Handle<String> error;
-  int capture_count;
-};
-
-
-class RegExpEngine: public AllStatic {
- public:
-  struct CompilationResult {
-    CompilationResult(Isolate* isolate, const char* error_message)
-        : error_message(error_message),
-          code(isolate->heap()->the_hole_value()),
-          num_registers(0) {}
-    CompilationResult(Object* code, int registers)
-        : error_message(nullptr), code(code), num_registers(registers) {}
-    const char* error_message;
-    Object* code;
-    int num_registers;
-  };
-
-  static CompilationResult Compile(Isolate* isolate, Zone* zone,
-                                   RegExpCompileData* input,
-                                   JSRegExp::Flags flags,
-                                   Handle<String> pattern,
-                                   Handle<String> sample_subject,
-                                   bool is_one_byte);
-
-  static bool TooMuchRegExpCode(Handle<String> pattern);
-
-  static void DotPrint(const char* label, RegExpNode* node, bool ignore_case);
-};
-
-
-class RegExpResultsCache : public AllStatic {
- public:
-  enum ResultsCacheType { REGEXP_MULTIPLE_INDICES, STRING_SPLIT_SUBSTRINGS };
-
-  // Attempt to retrieve a cached result.  On failure, 0 is returned as a Smi.
-  // On success, the returned result is guaranteed to be a COW-array.
-  static Object* Lookup(Heap* heap, String* key_string, Object* key_pattern,
-                        FixedArray** last_match_out, ResultsCacheType type);
-  // Attempt to add value_array to the cache specified by type.  On success,
-  // value_array is turned into a COW-array.
-  static void Enter(Isolate* isolate, Handle<String> key_string,
-                    Handle<Object> key_pattern, Handle<FixedArray> value_array,
-                    Handle<FixedArray> last_match_cache, ResultsCacheType type);
-  static void Clear(FixedArray* cache);
-  static const int kRegExpResultsCacheSize = 0x100;
-
- private:
-  static const int kArrayEntriesPerCacheEntry = 4;
-  static const int kStringOffset = 0;
-  static const int kPatternOffset = 1;
-  static const int kArrayOffset = 2;
-  static const int kLastMatchOffset = 3;
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_REGEXP_JSREGEXP_H_
diff --git a/src/v8/src/regexp/regexp-macro-assembler-irregexp-inl.h b/src/v8/src/regexp/regexp-macro-assembler-irregexp-inl.h
deleted file mode 100644
index a602129..0000000
--- a/src/v8/src/regexp/regexp-macro-assembler-irregexp-inl.h
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright 2008-2009 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_REGEXP_REGEXP_MACRO_ASSEMBLER_IRREGEXP_INL_H_
-#define V8_REGEXP_REGEXP_MACRO_ASSEMBLER_IRREGEXP_INL_H_
-
-#ifdef V8_INTERPRETED_REGEXP
-
-#include "src/ast/ast.h"
-#include "src/regexp/bytecodes-irregexp.h"
-
-namespace v8 {
-namespace internal {
-
-void RegExpMacroAssemblerIrregexp::Emit(uint32_t byte,
-                                        uint32_t twenty_four_bits) {
-  uint32_t word = ((twenty_four_bits << BYTECODE_SHIFT) | byte);
-  DCHECK(pc_ <= buffer_.length());
-  if (pc_  + 3 >= buffer_.length()) {
-    Expand();
-  }
-  *reinterpret_cast<uint32_t*>(buffer_.start() + pc_) = word;
-  pc_ += 4;
-}
-
-
-void RegExpMacroAssemblerIrregexp::Emit16(uint32_t word) {
-  DCHECK(pc_ <= buffer_.length());
-  if (pc_ + 1 >= buffer_.length()) {
-    Expand();
-  }
-  *reinterpret_cast<uint16_t*>(buffer_.start() + pc_) = word;
-  pc_ += 2;
-}
-
-
-void RegExpMacroAssemblerIrregexp::Emit8(uint32_t word) {
-  DCHECK(pc_ <= buffer_.length());
-  if (pc_ == buffer_.length()) {
-    Expand();
-  }
-  *reinterpret_cast<unsigned char*>(buffer_.start() + pc_) = word;
-  pc_ += 1;
-}
-
-
-void RegExpMacroAssemblerIrregexp::Emit32(uint32_t word) {
-  DCHECK(pc_ <= buffer_.length());
-  if (pc_ + 3 >= buffer_.length()) {
-    Expand();
-  }
-  *reinterpret_cast<uint32_t*>(buffer_.start() + pc_) = word;
-  pc_ += 4;
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_INTERPRETED_REGEXP
-
-#endif  // V8_REGEXP_REGEXP_MACRO_ASSEMBLER_IRREGEXP_INL_H_
diff --git a/src/v8/src/regexp/regexp-macro-assembler-irregexp.cc b/src/v8/src/regexp/regexp-macro-assembler-irregexp.cc
deleted file mode 100644
index 076197c..0000000
--- a/src/v8/src/regexp/regexp-macro-assembler-irregexp.cc
+++ /dev/null
@@ -1,462 +0,0 @@
-// Copyright 2008-2009 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifdef V8_INTERPRETED_REGEXP
-
-#include "src/regexp/regexp-macro-assembler-irregexp.h"
-
-#include "src/ast/ast.h"
-#include "src/objects-inl.h"
-#include "src/regexp/bytecodes-irregexp.h"
-#include "src/regexp/regexp-macro-assembler-irregexp-inl.h"
-#include "src/regexp/regexp-macro-assembler.h"
-
-namespace v8 {
-namespace internal {
-
-RegExpMacroAssemblerIrregexp::RegExpMacroAssemblerIrregexp(Isolate* isolate,
-                                                           Vector<byte> buffer,
-                                                           Zone* zone)
-    : RegExpMacroAssembler(isolate, zone),
-      buffer_(buffer),
-      pc_(0),
-      own_buffer_(false),
-      advance_current_end_(kInvalidPC),
-      isolate_(isolate) {}
-
-
-RegExpMacroAssemblerIrregexp::~RegExpMacroAssemblerIrregexp() {
-  if (backtrack_.is_linked()) backtrack_.Unuse();
-  if (own_buffer_) buffer_.Dispose();
-}
-
-
-RegExpMacroAssemblerIrregexp::IrregexpImplementation
-RegExpMacroAssemblerIrregexp::Implementation() {
-  return kBytecodeImplementation;
-}
-
-
-void RegExpMacroAssemblerIrregexp::Bind(Label* l) {
-  advance_current_end_ = kInvalidPC;
-  DCHECK(!l->is_bound());
-  if (l->is_linked()) {
-    int pos = l->pos();
-    while (pos != 0) {
-      int fixup = pos;
-      pos = *reinterpret_cast<int32_t*>(buffer_.start() + fixup);
-      *reinterpret_cast<uint32_t*>(buffer_.start() + fixup) = pc_;
-    }
-  }
-  l->bind_to(pc_);
-}
-
-
-void RegExpMacroAssemblerIrregexp::EmitOrLink(Label* l) {
-  if (l == nullptr) l = &backtrack_;
-  if (l->is_bound()) {
-    Emit32(l->pos());
-  } else {
-    int pos = 0;
-    if (l->is_linked()) {
-      pos = l->pos();
-    }
-    l->link_to(pc_);
-    Emit32(pos);
-  }
-}
-
-
-void RegExpMacroAssemblerIrregexp::PopRegister(int register_index) {
-  DCHECK_LE(0, register_index);
-  DCHECK_GE(kMaxRegister, register_index);
-  Emit(BC_POP_REGISTER, register_index);
-}
-
-
-void RegExpMacroAssemblerIrregexp::PushRegister(
-    int register_index,
-    StackCheckFlag check_stack_limit) {
-  DCHECK_LE(0, register_index);
-  DCHECK_GE(kMaxRegister, register_index);
-  Emit(BC_PUSH_REGISTER, register_index);
-}
-
-
-void RegExpMacroAssemblerIrregexp::WriteCurrentPositionToRegister(
-    int register_index, int cp_offset) {
-  DCHECK_LE(0, register_index);
-  DCHECK_GE(kMaxRegister, register_index);
-  Emit(BC_SET_REGISTER_TO_CP, register_index);
-  Emit32(cp_offset);  // Current position offset.
-}
-
-
-void RegExpMacroAssemblerIrregexp::ClearRegisters(int reg_from, int reg_to) {
-  DCHECK(reg_from <= reg_to);
-  for (int reg = reg_from; reg <= reg_to; reg++) {
-    SetRegister(reg, -1);
-  }
-}
-
-
-void RegExpMacroAssemblerIrregexp::ReadCurrentPositionFromRegister(
-    int register_index) {
-  DCHECK_LE(0, register_index);
-  DCHECK_GE(kMaxRegister, register_index);
-  Emit(BC_SET_CP_TO_REGISTER, register_index);
-}
-
-
-void RegExpMacroAssemblerIrregexp::WriteStackPointerToRegister(
-    int register_index) {
-  DCHECK_LE(0, register_index);
-  DCHECK_GE(kMaxRegister, register_index);
-  Emit(BC_SET_REGISTER_TO_SP, register_index);
-}
-
-
-void RegExpMacroAssemblerIrregexp::ReadStackPointerFromRegister(
-    int register_index) {
-  DCHECK_LE(0, register_index);
-  DCHECK_GE(kMaxRegister, register_index);
-  Emit(BC_SET_SP_TO_REGISTER, register_index);
-}
-
-
-void RegExpMacroAssemblerIrregexp::SetCurrentPositionFromEnd(int by) {
-  DCHECK(is_uint24(by));
-  Emit(BC_SET_CURRENT_POSITION_FROM_END, by);
-}
-
-
-void RegExpMacroAssemblerIrregexp::SetRegister(int register_index, int to) {
-  DCHECK_LE(0, register_index);
-  DCHECK_GE(kMaxRegister, register_index);
-  Emit(BC_SET_REGISTER, register_index);
-  Emit32(to);
-}
-
-
-void RegExpMacroAssemblerIrregexp::AdvanceRegister(int register_index, int by) {
-  DCHECK_LE(0, register_index);
-  DCHECK_GE(kMaxRegister, register_index);
-  Emit(BC_ADVANCE_REGISTER, register_index);
-  Emit32(by);
-}
-
-
-void RegExpMacroAssemblerIrregexp::PopCurrentPosition() {
-  Emit(BC_POP_CP, 0);
-}
-
-
-void RegExpMacroAssemblerIrregexp::PushCurrentPosition() {
-  Emit(BC_PUSH_CP, 0);
-}
-
-
-void RegExpMacroAssemblerIrregexp::Backtrack() {
-  Emit(BC_POP_BT, 0);
-}
-
-
-void RegExpMacroAssemblerIrregexp::GoTo(Label* l) {
-  if (advance_current_end_ == pc_) {
-    // Combine advance current and goto.
-    pc_ = advance_current_start_;
-    Emit(BC_ADVANCE_CP_AND_GOTO, advance_current_offset_);
-    EmitOrLink(l);
-    advance_current_end_ = kInvalidPC;
-  } else {
-    // Regular goto.
-    Emit(BC_GOTO, 0);
-    EmitOrLink(l);
-  }
-}
-
-
-void RegExpMacroAssemblerIrregexp::PushBacktrack(Label* l) {
-  Emit(BC_PUSH_BT, 0);
-  EmitOrLink(l);
-}
-
-
-bool RegExpMacroAssemblerIrregexp::Succeed() {
-  Emit(BC_SUCCEED, 0);
-  return false;  // Restart matching for global regexp not supported.
-}
-
-
-void RegExpMacroAssemblerIrregexp::Fail() {
-  Emit(BC_FAIL, 0);
-}
-
-
-void RegExpMacroAssemblerIrregexp::AdvanceCurrentPosition(int by) {
-  DCHECK_LE(kMinCPOffset, by);
-  DCHECK_GE(kMaxCPOffset, by);
-  advance_current_start_ = pc_;
-  advance_current_offset_ = by;
-  Emit(BC_ADVANCE_CP, by);
-  advance_current_end_ = pc_;
-}
-
-
-void RegExpMacroAssemblerIrregexp::CheckGreedyLoop(
-      Label* on_tos_equals_current_position) {
-  Emit(BC_CHECK_GREEDY, 0);
-  EmitOrLink(on_tos_equals_current_position);
-}
-
-
-void RegExpMacroAssemblerIrregexp::LoadCurrentCharacter(int cp_offset,
-                                                        Label* on_failure,
-                                                        bool check_bounds,
-                                                        int characters) {
-  DCHECK_LE(kMinCPOffset, cp_offset);
-  DCHECK_GE(kMaxCPOffset, cp_offset);
-  int bytecode;
-  if (check_bounds) {
-    if (characters == 4) {
-      bytecode = BC_LOAD_4_CURRENT_CHARS;
-    } else if (characters == 2) {
-      bytecode = BC_LOAD_2_CURRENT_CHARS;
-    } else {
-      DCHECK_EQ(1, characters);
-      bytecode = BC_LOAD_CURRENT_CHAR;
-    }
-  } else {
-    if (characters == 4) {
-      bytecode = BC_LOAD_4_CURRENT_CHARS_UNCHECKED;
-    } else if (characters == 2) {
-      bytecode = BC_LOAD_2_CURRENT_CHARS_UNCHECKED;
-    } else {
-      DCHECK_EQ(1, characters);
-      bytecode = BC_LOAD_CURRENT_CHAR_UNCHECKED;
-    }
-  }
-  Emit(bytecode, cp_offset);
-  if (check_bounds) EmitOrLink(on_failure);
-}
-
-
-void RegExpMacroAssemblerIrregexp::CheckCharacterLT(uc16 limit,
-                                                    Label* on_less) {
-  Emit(BC_CHECK_LT, limit);
-  EmitOrLink(on_less);
-}
-
-
-void RegExpMacroAssemblerIrregexp::CheckCharacterGT(uc16 limit,
-                                                    Label* on_greater) {
-  Emit(BC_CHECK_GT, limit);
-  EmitOrLink(on_greater);
-}
-
-
-void RegExpMacroAssemblerIrregexp::CheckCharacter(uint32_t c, Label* on_equal) {
-  if (c > MAX_FIRST_ARG) {
-    Emit(BC_CHECK_4_CHARS, 0);
-    Emit32(c);
-  } else {
-    Emit(BC_CHECK_CHAR, c);
-  }
-  EmitOrLink(on_equal);
-}
-
-
-void RegExpMacroAssemblerIrregexp::CheckAtStart(Label* on_at_start) {
-  Emit(BC_CHECK_AT_START, 0);
-  EmitOrLink(on_at_start);
-}
-
-
-void RegExpMacroAssemblerIrregexp::CheckNotAtStart(int cp_offset,
-                                                   Label* on_not_at_start) {
-  Emit(BC_CHECK_NOT_AT_START, cp_offset);
-  EmitOrLink(on_not_at_start);
-}
-
-
-void RegExpMacroAssemblerIrregexp::CheckNotCharacter(uint32_t c,
-                                                     Label* on_not_equal) {
-  if (c > MAX_FIRST_ARG) {
-    Emit(BC_CHECK_NOT_4_CHARS, 0);
-    Emit32(c);
-  } else {
-    Emit(BC_CHECK_NOT_CHAR, c);
-  }
-  EmitOrLink(on_not_equal);
-}
-
-
-void RegExpMacroAssemblerIrregexp::CheckCharacterAfterAnd(
-    uint32_t c,
-    uint32_t mask,
-    Label* on_equal) {
-  if (c > MAX_FIRST_ARG) {
-    Emit(BC_AND_CHECK_4_CHARS, 0);
-    Emit32(c);
-  } else {
-    Emit(BC_AND_CHECK_CHAR, c);
-  }
-  Emit32(mask);
-  EmitOrLink(on_equal);
-}
-
-
-void RegExpMacroAssemblerIrregexp::CheckNotCharacterAfterAnd(
-    uint32_t c,
-    uint32_t mask,
-    Label* on_not_equal) {
-  if (c > MAX_FIRST_ARG) {
-    Emit(BC_AND_CHECK_NOT_4_CHARS, 0);
-    Emit32(c);
-  } else {
-    Emit(BC_AND_CHECK_NOT_CHAR, c);
-  }
-  Emit32(mask);
-  EmitOrLink(on_not_equal);
-}
-
-
-void RegExpMacroAssemblerIrregexp::CheckNotCharacterAfterMinusAnd(
-    uc16 c,
-    uc16 minus,
-    uc16 mask,
-    Label* on_not_equal) {
-  Emit(BC_MINUS_AND_CHECK_NOT_CHAR, c);
-  Emit16(minus);
-  Emit16(mask);
-  EmitOrLink(on_not_equal);
-}
-
-
-void RegExpMacroAssemblerIrregexp::CheckCharacterInRange(
-    uc16 from,
-    uc16 to,
-    Label* on_in_range) {
-  Emit(BC_CHECK_CHAR_IN_RANGE, 0);
-  Emit16(from);
-  Emit16(to);
-  EmitOrLink(on_in_range);
-}
-
-
-void RegExpMacroAssemblerIrregexp::CheckCharacterNotInRange(
-    uc16 from,
-    uc16 to,
-    Label* on_not_in_range) {
-  Emit(BC_CHECK_CHAR_NOT_IN_RANGE, 0);
-  Emit16(from);
-  Emit16(to);
-  EmitOrLink(on_not_in_range);
-}
-
-
-void RegExpMacroAssemblerIrregexp::CheckBitInTable(
-    Handle<ByteArray> table, Label* on_bit_set) {
-  Emit(BC_CHECK_BIT_IN_TABLE, 0);
-  EmitOrLink(on_bit_set);
-  for (int i = 0; i < kTableSize; i += kBitsPerByte) {
-    int byte = 0;
-    for (int j = 0; j < kBitsPerByte; j++) {
-      if (table->get(i + j) != 0) byte |= 1 << j;
-    }
-    Emit8(byte);
-  }
-}
-
-
-void RegExpMacroAssemblerIrregexp::CheckNotBackReference(int start_reg,
-                                                         bool read_backward,
-                                                         Label* on_not_equal) {
-  DCHECK_LE(0, start_reg);
-  DCHECK_GE(kMaxRegister, start_reg);
-  Emit(read_backward ? BC_CHECK_NOT_BACK_REF_BACKWARD : BC_CHECK_NOT_BACK_REF,
-       start_reg);
-  EmitOrLink(on_not_equal);
-}
-
-
-void RegExpMacroAssemblerIrregexp::CheckNotBackReferenceIgnoreCase(
-    int start_reg, bool read_backward, bool unicode, Label* on_not_equal) {
-  DCHECK_LE(0, start_reg);
-  DCHECK_GE(kMaxRegister, start_reg);
-  Emit(read_backward ? (unicode ? BC_CHECK_NOT_BACK_REF_NO_CASE_UNICODE_BACKWARD
-                                : BC_CHECK_NOT_BACK_REF_NO_CASE_BACKWARD)
-                     : (unicode ? BC_CHECK_NOT_BACK_REF_NO_CASE_UNICODE
-                                : BC_CHECK_NOT_BACK_REF_NO_CASE),
-       start_reg);
-  EmitOrLink(on_not_equal);
-}
-
-
-void RegExpMacroAssemblerIrregexp::IfRegisterLT(int register_index,
-                                                int comparand,
-                                                Label* on_less_than) {
-  DCHECK_LE(0, register_index);
-  DCHECK_GE(kMaxRegister, register_index);
-  Emit(BC_CHECK_REGISTER_LT, register_index);
-  Emit32(comparand);
-  EmitOrLink(on_less_than);
-}
-
-
-void RegExpMacroAssemblerIrregexp::IfRegisterGE(int register_index,
-                                                int comparand,
-                                                Label* on_greater_or_equal) {
-  DCHECK_LE(0, register_index);
-  DCHECK_GE(kMaxRegister, register_index);
-  Emit(BC_CHECK_REGISTER_GE, register_index);
-  Emit32(comparand);
-  EmitOrLink(on_greater_or_equal);
-}
-
-
-void RegExpMacroAssemblerIrregexp::IfRegisterEqPos(int register_index,
-                                                   Label* on_eq) {
-  DCHECK_LE(0, register_index);
-  DCHECK_GE(kMaxRegister, register_index);
-  Emit(BC_CHECK_REGISTER_EQ_POS, register_index);
-  EmitOrLink(on_eq);
-}
-
-
-Handle<HeapObject> RegExpMacroAssemblerIrregexp::GetCode(
-    Handle<String> source) {
-  Bind(&backtrack_);
-  Emit(BC_POP_BT, 0);
-  Handle<ByteArray> array = isolate_->factory()->NewByteArray(length());
-  Copy(array->GetDataStartAddress());
-  return array;
-}
-
-
-int RegExpMacroAssemblerIrregexp::length() {
-  return pc_;
-}
-
-
-void RegExpMacroAssemblerIrregexp::Copy(Address a) {
-  MemCopy(a, buffer_.start(), length());
-}
-
-
-void RegExpMacroAssemblerIrregexp::Expand() {
-  bool old_buffer_was_our_own = own_buffer_;
-  Vector<byte> old_buffer = buffer_;
-  buffer_ = Vector<byte>::New(old_buffer.length() * 2);
-  own_buffer_ = true;
-  MemCopy(buffer_.start(), old_buffer.start(), old_buffer.length());
-  if (old_buffer_was_our_own) {
-    old_buffer.Dispose();
-  }
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_INTERPRETED_REGEXP
diff --git a/src/v8/src/regexp/regexp-macro-assembler-irregexp.h b/src/v8/src/regexp/regexp-macro-assembler-irregexp.h
deleted file mode 100644
index 8063ebb..0000000
--- a/src/v8/src/regexp/regexp-macro-assembler-irregexp.h
+++ /dev/null
@@ -1,134 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_REGEXP_REGEXP_MACRO_ASSEMBLER_IRREGEXP_H_
-#define V8_REGEXP_REGEXP_MACRO_ASSEMBLER_IRREGEXP_H_
-
-#ifdef V8_INTERPRETED_REGEXP
-
-#include "src/regexp/regexp-macro-assembler.h"
-
-namespace v8 {
-namespace internal {
-
-// A light-weight assembler for the Irregexp byte code.
-class RegExpMacroAssemblerIrregexp: public RegExpMacroAssembler {
- public:
-  // Create an assembler. Instructions and relocation information are emitted
-  // into a buffer, with the instructions starting from the beginning and the
-  // relocation information starting from the end of the buffer. See CodeDesc
-  // for a detailed comment on the layout (globals.h).
-  //
-  // If the provided buffer is nullptr, the assembler allocates and grows its
-  // own buffer, and buffer_size determines the initial buffer size. The buffer
-  // is owned by the assembler and deallocated upon destruction of the
-  // assembler.
-  //
-  // If the provided buffer is not nullptr, the assembler uses the provided
-  // buffer for code generation and assumes its size to be buffer_size. If the
-  // buffer is too small, a fatal error occurs. No deallocation of the buffer is
-  // done upon destruction of the assembler.
-  RegExpMacroAssemblerIrregexp(Isolate* isolate, Vector<byte> buffer,
-                               Zone* zone);
-  virtual ~RegExpMacroAssemblerIrregexp();
-  // The byte-code interpreter checks on each push anyway.
-  virtual int stack_limit_slack() { return 1; }
-  virtual bool CanReadUnaligned() { return false; }
-  virtual void Bind(Label* label);
-  virtual void AdvanceCurrentPosition(int by);  // Signed cp change.
-  virtual void PopCurrentPosition();
-  virtual void PushCurrentPosition();
-  virtual void Backtrack();
-  virtual void GoTo(Label* label);
-  virtual void PushBacktrack(Label* label);
-  virtual bool Succeed();
-  virtual void Fail();
-  virtual void PopRegister(int register_index);
-  virtual void PushRegister(int register_index,
-                            StackCheckFlag check_stack_limit);
-  virtual void AdvanceRegister(int reg, int by);  // r[reg] += by.
-  virtual void SetCurrentPositionFromEnd(int by);
-  virtual void SetRegister(int register_index, int to);
-  virtual void WriteCurrentPositionToRegister(int reg, int cp_offset);
-  virtual void ClearRegisters(int reg_from, int reg_to);
-  virtual void ReadCurrentPositionFromRegister(int reg);
-  virtual void WriteStackPointerToRegister(int reg);
-  virtual void ReadStackPointerFromRegister(int reg);
-  virtual void LoadCurrentCharacter(int cp_offset,
-                                    Label* on_end_of_input,
-                                    bool check_bounds = true,
-                                    int characters = 1);
-  virtual void CheckCharacter(unsigned c, Label* on_equal);
-  virtual void CheckCharacterAfterAnd(unsigned c,
-                                      unsigned mask,
-                                      Label* on_equal);
-  virtual void CheckCharacterGT(uc16 limit, Label* on_greater);
-  virtual void CheckCharacterLT(uc16 limit, Label* on_less);
-  virtual void CheckGreedyLoop(Label* on_tos_equals_current_position);
-  virtual void CheckAtStart(Label* on_at_start);
-  virtual void CheckNotAtStart(int cp_offset, Label* on_not_at_start);
-  virtual void CheckNotCharacter(unsigned c, Label* on_not_equal);
-  virtual void CheckNotCharacterAfterAnd(unsigned c,
-                                         unsigned mask,
-                                         Label* on_not_equal);
-  virtual void CheckNotCharacterAfterMinusAnd(uc16 c,
-                                              uc16 minus,
-                                              uc16 mask,
-                                              Label* on_not_equal);
-  virtual void CheckCharacterInRange(uc16 from,
-                                     uc16 to,
-                                     Label* on_in_range);
-  virtual void CheckCharacterNotInRange(uc16 from,
-                                        uc16 to,
-                                        Label* on_not_in_range);
-  virtual void CheckBitInTable(Handle<ByteArray> table, Label* on_bit_set);
-  virtual void CheckNotBackReference(int start_reg, bool read_backward,
-                                     Label* on_no_match);
-  virtual void CheckNotBackReferenceIgnoreCase(int start_reg,
-                                               bool read_backward, bool unicode,
-                                               Label* on_no_match);
-  virtual void IfRegisterLT(int register_index, int comparand, Label* if_lt);
-  virtual void IfRegisterGE(int register_index, int comparand, Label* if_ge);
-  virtual void IfRegisterEqPos(int register_index, Label* if_eq);
-
-  virtual IrregexpImplementation Implementation();
-  virtual Handle<HeapObject> GetCode(Handle<String> source);
-
- private:
-  void Expand();
-  // Code and bitmap emission.
-  inline void EmitOrLink(Label* label);
-  inline void Emit32(uint32_t x);
-  inline void Emit16(uint32_t x);
-  inline void Emit8(uint32_t x);
-  inline void Emit(uint32_t bc, uint32_t arg);
-  // Bytecode buffer.
-  int length();
-  void Copy(Address a);
-
-  // The buffer into which code and relocation info are generated.
-  Vector<byte> buffer_;
-  // The program counter.
-  int pc_;
-  // True if the assembler owns the buffer, false if buffer is external.
-  bool own_buffer_;
-  Label backtrack_;
-
-  int advance_current_start_;
-  int advance_current_offset_;
-  int advance_current_end_;
-
-  Isolate* isolate_;
-
-  static const int kInvalidPC = -1;
-
-  DISALLOW_IMPLICIT_CONSTRUCTORS(RegExpMacroAssemblerIrregexp);
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_INTERPRETED_REGEXP
-
-#endif  // V8_REGEXP_REGEXP_MACRO_ASSEMBLER_IRREGEXP_H_
diff --git a/src/v8/src/runtime/runtime-error.cc b/src/v8/src/runtime/runtime-error.cc
deleted file mode 100644
index 6ded550..0000000
--- a/src/v8/src/runtime/runtime-error.cc
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/runtime/runtime-utils.h"
-
-#include "src/arguments.h"
-#include "src/base/platform/time.h"
-#include "src/conversions-inl.h"
-#include "src/futex-emulation.h"
-#include "src/globals.h"
-
-namespace v8 {
-namespace internal {
-
-RUNTIME_FUNCTION(Runtime_ErrorToString) {
-  HandleScope scope(isolate);
-  DCHECK_EQ(1, args.length());
-  CONVERT_ARG_HANDLE_CHECKED(Object, recv, 0);
-  RETURN_RESULT_OR_FAILURE(isolate, ErrorUtils::ToString(isolate, recv));
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/runtime/runtime-liveedit.cc b/src/v8/src/runtime/runtime-liveedit.cc
deleted file mode 100644
index 4ed2071..0000000
--- a/src/v8/src/runtime/runtime-liveedit.cc
+++ /dev/null
@@ -1,306 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/runtime/runtime-utils.h"
-
-#include "src/arguments.h"
-#include "src/debug/debug.h"
-#include "src/debug/debug-frames.h"
-#include "src/debug/liveedit.h"
-#include "src/frames-inl.h"
-#include "src/isolate-inl.h"
-#include "src/runtime/runtime.h"
-
-namespace v8 {
-namespace internal {
-
-// For a script finds all SharedFunctionInfo's in the heap that points
-// to this script. Returns JSArray of SharedFunctionInfo wrapped
-// in OpaqueReferences.
-RUNTIME_FUNCTION(Runtime_LiveEditFindSharedFunctionInfosForScript) {
-  HandleScope scope(isolate);
-  CHECK(isolate->debug()->live_edit_enabled());
-  DCHECK_EQ(1, args.length());
-  CONVERT_ARG_CHECKED(JSValue, script_value, 0);
-
-  CHECK(script_value->value()->IsScript());
-  Handle<Script> script = Handle<Script>(Script::cast(script_value->value()));
-
-  std::vector<Handle<SharedFunctionInfo>> found;
-  Heap* heap = isolate->heap();
-  {
-    HeapIterator iterator(heap);
-    HeapObject* heap_obj;
-    while ((heap_obj = iterator.next()) != nullptr) {
-      if (!heap_obj->IsSharedFunctionInfo()) continue;
-      SharedFunctionInfo* shared = SharedFunctionInfo::cast(heap_obj);
-      if (shared->script() != *script) continue;
-      found.push_back(Handle<SharedFunctionInfo>(shared));
-    }
-  }
-
-  int found_size = static_cast<int>(found.size());
-  Handle<FixedArray> result = isolate->factory()->NewFixedArray(found_size);
-  for (int i = 0; i < found_size; ++i) {
-    Handle<SharedFunctionInfo> shared = found[i];
-    SharedInfoWrapper info_wrapper = SharedInfoWrapper::Create(isolate);
-    Handle<String> name(shared->name(), isolate);
-    info_wrapper.SetProperties(name, shared->start_position(),
-                               shared->end_position(), shared);
-    result->set(i, *info_wrapper.GetJSArray());
-  }
-  return *isolate->factory()->NewJSArrayWithElements(result);
-}
-
-
-// For a script calculates compilation information about all its functions.
-// The script source is explicitly specified by the second argument.
-// The source of the actual script is not used, however it is important that
-// all generated code keeps references to this particular instance of script.
-// Returns a JSArray of compilation infos. The array is ordered so that
-// each function with all its descendant is always stored in a continues range
-// with the function itself going first. The root function is a script function.
-RUNTIME_FUNCTION(Runtime_LiveEditGatherCompileInfo) {
-  HandleScope scope(isolate);
-  CHECK(isolate->debug()->live_edit_enabled());
-  DCHECK_EQ(2, args.length());
-  CONVERT_ARG_CHECKED(JSValue, script, 0);
-  CONVERT_ARG_HANDLE_CHECKED(String, source, 1);
-
-  CHECK(script->value()->IsScript());
-  Handle<Script> script_handle = Handle<Script>(Script::cast(script->value()));
-
-  RETURN_RESULT_OR_FAILURE(isolate,
-                           LiveEdit::GatherCompileInfo(script_handle, source));
-}
-
-
-// Changes the source of the script to a new_source.
-// If old_script_name is provided (i.e. is a String), also creates a copy of
-// the script with its original source and sends notification to debugger.
-RUNTIME_FUNCTION(Runtime_LiveEditReplaceScript) {
-  HandleScope scope(isolate);
-  CHECK(isolate->debug()->live_edit_enabled());
-  DCHECK_EQ(3, args.length());
-  CONVERT_ARG_CHECKED(JSValue, original_script_value, 0);
-  CONVERT_ARG_HANDLE_CHECKED(String, new_source, 1);
-  CONVERT_ARG_HANDLE_CHECKED(Object, old_script_name, 2);
-
-  CHECK(original_script_value->value()->IsScript());
-  Handle<Script> original_script(Script::cast(original_script_value->value()));
-
-  Handle<Object> old_script = LiveEdit::ChangeScriptSource(
-      original_script, new_source, old_script_name);
-
-  if (old_script->IsScript()) {
-    Handle<Script> script_handle = Handle<Script>::cast(old_script);
-    return *Script::GetWrapper(script_handle);
-  } else {
-    return isolate->heap()->null_value();
-  }
-}
-
-// Recreate the shared function infos array after changing the IDs of all
-// SharedFunctionInfos.
-RUNTIME_FUNCTION(Runtime_LiveEditFixupScript) {
-  HandleScope scope(isolate);
-  CHECK(isolate->debug()->live_edit_enabled());
-  DCHECK_EQ(args.length(), 2);
-  CONVERT_ARG_CHECKED(JSValue, script_value, 0);
-  CONVERT_INT32_ARG_CHECKED(max_function_literal_id, 1);
-
-  CHECK(script_value->value()->IsScript());
-  Handle<Script> script(Script::cast(script_value->value()));
-
-  LiveEdit::FixupScript(script, max_function_literal_id);
-  return isolate->heap()->undefined_value();
-}
-
-RUNTIME_FUNCTION(Runtime_LiveEditFunctionSourceUpdated) {
-  HandleScope scope(isolate);
-  CHECK(isolate->debug()->live_edit_enabled());
-  DCHECK_EQ(args.length(), 2);
-  CONVERT_ARG_HANDLE_CHECKED(JSArray, shared_info, 0);
-  CONVERT_INT32_ARG_CHECKED(new_function_literal_id, 1);
-  CHECK(SharedInfoWrapper::IsInstance(shared_info));
-
-  LiveEdit::FunctionSourceUpdated(shared_info, new_function_literal_id);
-  return isolate->heap()->undefined_value();
-}
-
-
-// Replaces code of SharedFunctionInfo with a new one.
-RUNTIME_FUNCTION(Runtime_LiveEditReplaceFunctionCode) {
-  HandleScope scope(isolate);
-  CHECK(isolate->debug()->live_edit_enabled());
-  DCHECK_EQ(2, args.length());
-  CONVERT_ARG_HANDLE_CHECKED(JSArray, new_compile_info, 0);
-  CONVERT_ARG_HANDLE_CHECKED(JSArray, shared_info, 1);
-  CHECK(SharedInfoWrapper::IsInstance(shared_info));
-
-  LiveEdit::ReplaceFunctionCode(new_compile_info, shared_info);
-  return isolate->heap()->undefined_value();
-}
-
-
-// Connects SharedFunctionInfo to another script.
-RUNTIME_FUNCTION(Runtime_LiveEditFunctionSetScript) {
-  HandleScope scope(isolate);
-  CHECK(isolate->debug()->live_edit_enabled());
-  DCHECK_EQ(2, args.length());
-  CONVERT_ARG_HANDLE_CHECKED(Object, function_object, 0);
-  CONVERT_ARG_HANDLE_CHECKED(Object, script_object, 1);
-
-  if (function_object->IsJSValue()) {
-    Handle<JSValue> function_wrapper = Handle<JSValue>::cast(function_object);
-    if (script_object->IsJSValue()) {
-      CHECK(JSValue::cast(*script_object)->value()->IsScript());
-      Script* script = Script::cast(JSValue::cast(*script_object)->value());
-      script_object = Handle<Object>(script, isolate);
-    }
-    CHECK(function_wrapper->value()->IsSharedFunctionInfo());
-    LiveEdit::SetFunctionScript(function_wrapper, script_object);
-  } else {
-    // Just ignore this. We may not have a SharedFunctionInfo for some functions
-    // and we check it in this function.
-  }
-
-  return isolate->heap()->undefined_value();
-}
-
-
-// In a code of a parent function replaces original function as embedded object
-// with a substitution one.
-RUNTIME_FUNCTION(Runtime_LiveEditReplaceRefToNestedFunction) {
-  HandleScope scope(isolate);
-  CHECK(isolate->debug()->live_edit_enabled());
-  DCHECK_EQ(3, args.length());
-
-  CONVERT_ARG_HANDLE_CHECKED(JSValue, parent_wrapper, 0);
-  CONVERT_ARG_HANDLE_CHECKED(JSValue, orig_wrapper, 1);
-  CONVERT_ARG_HANDLE_CHECKED(JSValue, subst_wrapper, 2);
-  CHECK(parent_wrapper->value()->IsSharedFunctionInfo());
-  CHECK(orig_wrapper->value()->IsSharedFunctionInfo());
-  CHECK(subst_wrapper->value()->IsSharedFunctionInfo());
-
-  LiveEdit::ReplaceRefToNestedFunction(parent_wrapper, orig_wrapper,
-                                       subst_wrapper);
-  return isolate->heap()->undefined_value();
-}
-
-
-// Updates positions of a shared function info (first parameter) according
-// to script source change. Text change is described in second parameter as
-// array of groups of 3 numbers:
-// (change_begin, change_end, change_end_new_position).
-// Each group describes a change in text; groups are sorted by change_begin.
-RUNTIME_FUNCTION(Runtime_LiveEditPatchFunctionPositions) {
-  HandleScope scope(isolate);
-  CHECK(isolate->debug()->live_edit_enabled());
-  DCHECK_EQ(2, args.length());
-  CONVERT_ARG_HANDLE_CHECKED(JSArray, shared_array, 0);
-  CONVERT_ARG_HANDLE_CHECKED(JSArray, position_change_array, 1);
-  CHECK(SharedInfoWrapper::IsInstance(shared_array));
-
-  LiveEdit::PatchFunctionPositions(shared_array, position_change_array);
-  return isolate->heap()->undefined_value();
-}
-
-
-// For array of SharedFunctionInfo's (each wrapped in JSValue)
-// checks that none of them have activations on stacks (of any thread).
-// Returns array of the same length with corresponding results of
-// LiveEdit::FunctionPatchabilityStatus type.
-RUNTIME_FUNCTION(Runtime_LiveEditCheckAndDropActivations) {
-  HandleScope scope(isolate);
-  CHECK(isolate->debug()->live_edit_enabled());
-  DCHECK_EQ(3, args.length());
-  CONVERT_ARG_HANDLE_CHECKED(JSArray, old_shared_array, 0);
-  CONVERT_ARG_HANDLE_CHECKED(JSArray, new_shared_array, 1);
-  CONVERT_BOOLEAN_ARG_CHECKED(do_drop, 2);
-  USE(new_shared_array);
-  CHECK(old_shared_array->length()->IsSmi());
-  CHECK(new_shared_array->length() == old_shared_array->length());
-  CHECK(old_shared_array->HasFastElements());
-  CHECK(new_shared_array->HasFastElements());
-  int array_length = Smi::ToInt(old_shared_array->length());
-  for (int i = 0; i < array_length; i++) {
-    Handle<Object> old_element;
-    Handle<Object> new_element;
-    ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
-        isolate, old_element,
-        JSReceiver::GetElement(isolate, old_shared_array, i));
-    CHECK(old_element->IsJSValue() &&
-          Handle<JSValue>::cast(old_element)->value()->IsSharedFunctionInfo());
-    ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
-        isolate, new_element,
-        JSReceiver::GetElement(isolate, new_shared_array, i));
-    CHECK(
-        new_element->IsUndefined(isolate) ||
-        (new_element->IsJSValue() &&
-         Handle<JSValue>::cast(new_element)->value()->IsSharedFunctionInfo()));
-  }
-
-  return *LiveEdit::CheckAndDropActivations(old_shared_array, new_shared_array,
-                                            do_drop);
-}
-
-
-// Compares 2 strings line-by-line, then token-wise and returns diff in form
-// of JSArray of triplets (pos1, pos1_end, pos2_end) describing list
-// of diff chunks.
-RUNTIME_FUNCTION(Runtime_LiveEditCompareStrings) {
-  HandleScope scope(isolate);
-  CHECK(isolate->debug()->live_edit_enabled());
-  DCHECK_EQ(2, args.length());
-  CONVERT_ARG_HANDLE_CHECKED(String, s1, 0);
-  CONVERT_ARG_HANDLE_CHECKED(String, s2, 1);
-
-  Handle<JSArray> result = LiveEdit::CompareStrings(s1, s2);
-  uint32_t array_length = 0;
-  CHECK(result->length()->ToArrayLength(&array_length));
-  if (array_length > 0) {
-    isolate->debug()->feature_tracker()->Track(DebugFeatureTracker::kLiveEdit);
-  }
-
-  return *result;
-}
-
-
-// Restarts a call frame and completely drops all frames above.
-// Returns true if successful. Otherwise returns undefined or an error message.
-RUNTIME_FUNCTION(Runtime_LiveEditRestartFrame) {
-  HandleScope scope(isolate);
-  CHECK(isolate->debug()->live_edit_enabled());
-  DCHECK_EQ(2, args.length());
-  CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]);
-  CHECK(isolate->debug()->CheckExecutionState(break_id));
-
-  CONVERT_NUMBER_CHECKED(int, index, Int32, args[1]);
-  Heap* heap = isolate->heap();
-
-  // Find the relevant frame with the requested index.
-  StackFrame::Id id = isolate->debug()->break_frame_id();
-  if (id == StackFrame::NO_ID) {
-    // If there are no JavaScript stack frames return undefined.
-    return heap->undefined_value();
-  }
-
-  StackTraceFrameIterator it(isolate, id);
-  int inlined_jsframe_index =
-      DebugFrameHelper::FindIndexedNonNativeFrame(&it, index);
-  // Liveedit is not supported on Wasm.
-  if (inlined_jsframe_index == -1 || it.is_wasm()) {
-    return heap->undefined_value();
-  }
-  // We don't really care what the inlined frame index is, since we are
-  // throwing away the entire frame anyways.
-  const char* error_message = LiveEdit::RestartFrame(it.javascript_frame());
-  if (error_message) {
-    return *(isolate->factory()->InternalizeUtf8String(error_message));
-  }
-  return heap->true_value();
-}
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/runtime/runtime-maths.cc b/src/v8/src/runtime/runtime-maths.cc
deleted file mode 100644
index 1804f93..0000000
--- a/src/v8/src/runtime/runtime-maths.cc
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/runtime/runtime-utils.h"
-
-#include "src/arguments.h"
-#include "src/assembler.h"
-#include "src/base/utils/random-number-generator.h"
-#include "src/bootstrapper.h"
-#include "src/counters.h"
-#include "src/double.h"
-#include "src/objects-inl.h"
-
-namespace v8 {
-namespace internal {
-
-RUNTIME_FUNCTION(Runtime_GenerateRandomNumbers) {
-  HandleScope scope(isolate);
-  DCHECK_EQ(0, args.length());
-
-  Handle<Context> native_context = isolate->native_context();
-  DCHECK_EQ(0, native_context->math_random_index()->value());
-
-  static const int kCacheSize = 64;
-  static const int kState0Offset = kCacheSize - 1;
-  static const int kState1Offset = kState0Offset - 1;
-  // The index is decremented before used to access the cache.
-  static const int kInitialIndex = kState1Offset;
-
-  Handle<FixedDoubleArray> cache;
-  uint64_t state0 = 0;
-  uint64_t state1 = 0;
-  if (native_context->math_random_cache()->IsFixedDoubleArray()) {
-    cache = Handle<FixedDoubleArray>(
-        FixedDoubleArray::cast(native_context->math_random_cache()), isolate);
-    state0 = double_to_uint64(cache->get_scalar(kState0Offset));
-    state1 = double_to_uint64(cache->get_scalar(kState1Offset));
-  } else {
-    cache = Handle<FixedDoubleArray>::cast(
-        isolate->factory()->NewFixedDoubleArray(kCacheSize, TENURED));
-    native_context->set_math_random_cache(*cache);
-    // Initialize state if not yet initialized. If a fixed random seed was
-    // requested, use it to reset our state the first time a script asks for
-    // random numbers in this context. This ensures the script sees a consistent
-    // sequence.
-    if (FLAG_random_seed != 0) {
-      state0 = FLAG_random_seed;
-      state1 = FLAG_random_seed;
-    } else {
-      while (state0 == 0 || state1 == 0) {
-        isolate->random_number_generator()->NextBytes(&state0, sizeof(state0));
-        isolate->random_number_generator()->NextBytes(&state1, sizeof(state1));
-      }
-    }
-  }
-
-  DisallowHeapAllocation no_gc;
-  FixedDoubleArray* raw_cache = *cache;
-  // Create random numbers.
-  for (int i = 0; i < kInitialIndex; i++) {
-    // Generate random numbers using xorshift128+.
-    base::RandomNumberGenerator::XorShift128(&state0, &state1);
-    raw_cache->set(i, base::RandomNumberGenerator::ToDouble(state0, state1));
-  }
-
-  // Persist current state.
-  raw_cache->set(kState0Offset, uint64_to_double(state0));
-  raw_cache->set(kState1Offset, uint64_to_double(state1));
-  return Smi::FromInt(kInitialIndex);
-}
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/s390/assembler-s390-inl.h b/src/v8/src/s390/assembler-s390-inl.h
deleted file mode 100644
index 6323730..0000000
--- a/src/v8/src/s390/assembler-s390-inl.h
+++ /dev/null
@@ -1,373 +0,0 @@
-// Copyright (c) 1994-2006 Sun Microsystems Inc.
-// 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.
-//
-// - Redistribution 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 Sun Microsystems or the names of 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.
-
-// The original source code covered by the above license above has been modified
-// significantly by Google Inc.
-// Copyright 2014 the V8 project authors. All rights reserved.
-
-#ifndef V8_S390_ASSEMBLER_S390_INL_H_
-#define V8_S390_ASSEMBLER_S390_INL_H_
-
-#include "src/s390/assembler-s390.h"
-
-#include "src/assembler.h"
-#include "src/debug/debug.h"
-#include "src/objects-inl.h"
-
-namespace v8 {
-namespace internal {
-
-bool CpuFeatures::SupportsCrankshaft() { return true; }
-
-bool CpuFeatures::SupportsWasmSimd128() { return false; }
-
-void RelocInfo::apply(intptr_t delta) {
-  // Absolute code pointer inside code object moves with the code object.
-  if (IsInternalReference(rmode_)) {
-    // Jump table entry
-    Address target = Memory::Address_at(pc_);
-    Memory::Address_at(pc_) = target + delta;
-  } else if (IsCodeTarget(rmode_)) {
-    SixByteInstr instr =
-        Instruction::InstructionBits(reinterpret_cast<const byte*>(pc_));
-    int32_t dis = static_cast<int32_t>(instr & 0xFFFFFFFF) * 2  // halfwords
-                  - static_cast<int32_t>(delta);
-    instr >>= 32;  // Clear the 4-byte displacement field.
-    instr <<= 32;
-    instr |= static_cast<uint32_t>(dis / 2);
-    Instruction::SetInstructionBits<SixByteInstr>(reinterpret_cast<byte*>(pc_),
-                                                  instr);
-  } else {
-    // mov sequence
-    DCHECK(IsInternalReferenceEncoded(rmode_));
-    Address target = Assembler::target_address_at(pc_, constant_pool_);
-    Assembler::set_target_address_at(nullptr, pc_, constant_pool_,
-                                     target + delta, SKIP_ICACHE_FLUSH);
-  }
-}
-
-Address RelocInfo::target_internal_reference() {
-  if (IsInternalReference(rmode_)) {
-    // Jump table entry
-    return Memory::Address_at(pc_);
-  } else {
-    // mov sequence
-    DCHECK(IsInternalReferenceEncoded(rmode_));
-    return Assembler::target_address_at(pc_, constant_pool_);
-  }
-}
-
-Address RelocInfo::target_internal_reference_address() {
-  DCHECK(IsInternalReference(rmode_) || IsInternalReferenceEncoded(rmode_));
-  return reinterpret_cast<Address>(pc_);
-}
-
-Address RelocInfo::target_address() {
-  DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) || IsWasmCall(rmode_));
-  return Assembler::target_address_at(pc_, constant_pool_);
-}
-
-Address RelocInfo::target_address_address() {
-  DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) || IsWasmCall(rmode_) ||
-         rmode_ == EMBEDDED_OBJECT || rmode_ == EXTERNAL_REFERENCE);
-
-  // Read the address of the word containing the target_address in an
-  // instruction stream.
-  // The only architecture-independent user of this function is the serializer.
-  // The serializer uses it to find out how many raw bytes of instruction to
-  // output before the next target.
-  // For an instruction like LIS/ORI where the target bits are mixed into the
-  // instruction bits, the size of the target will be zero, indicating that the
-  // serializer should not step forward in memory after a target is resolved
-  // and written.
-  return reinterpret_cast<Address>(pc_);
-}
-
-Address RelocInfo::constant_pool_entry_address() {
-  UNREACHABLE();
-}
-
-int RelocInfo::target_address_size() { return Assembler::kSpecialTargetSize; }
-
-Address Assembler::target_address_from_return_address(Address pc) {
-  // Returns the address of the call target from the return address that will
-  // be returned to after a call.
-  // Sequence is:
-  //    BRASL r14, RI
-  return pc - kCallTargetAddressOffset;
-}
-
-Address Assembler::return_address_from_call_start(Address pc) {
-  // Sequence is:
-  //    BRASL r14, RI
-  return pc + kCallTargetAddressOffset;
-}
-
-Handle<Object> Assembler::code_target_object_handle_at(Address pc) {
-  SixByteInstr instr =
-      Instruction::InstructionBits(reinterpret_cast<const byte*>(pc));
-  int index = instr & 0xFFFFFFFF;
-  return code_targets_[index];
-}
-
-HeapObject* RelocInfo::target_object() {
-  DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
-  return HeapObject::cast(reinterpret_cast<Object*>(
-      Assembler::target_address_at(pc_, constant_pool_)));
-}
-
-Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
-  DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
-  if (rmode_ == EMBEDDED_OBJECT) {
-    return Handle<HeapObject>(reinterpret_cast<HeapObject**>(
-        Assembler::target_address_at(pc_, constant_pool_)));
-  } else {
-    return Handle<HeapObject>::cast(origin->code_target_object_handle_at(pc_));
-  }
-}
-
-void RelocInfo::set_target_object(HeapObject* target,
-                                  WriteBarrierMode write_barrier_mode,
-                                  ICacheFlushMode icache_flush_mode) {
-  DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
-  Assembler::set_target_address_at(target->GetIsolate(), pc_, constant_pool_,
-                                   reinterpret_cast<Address>(target),
-                                   icache_flush_mode);
-  if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != nullptr) {
-    host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(host(), this,
-                                                                  target);
-    host()->GetHeap()->RecordWriteIntoCode(host(), this, target);
-  }
-}
-
-Address RelocInfo::target_external_reference() {
-  DCHECK(rmode_ == EXTERNAL_REFERENCE);
-  return Assembler::target_address_at(pc_, constant_pool_);
-}
-
-Address RelocInfo::target_runtime_entry(Assembler* origin) {
-  DCHECK(IsRuntimeEntry(rmode_));
-  return target_address();
-}
-
-void RelocInfo::set_target_runtime_entry(Isolate* isolate, Address target,
-                                         WriteBarrierMode write_barrier_mode,
-                                         ICacheFlushMode icache_flush_mode) {
-  DCHECK(IsRuntimeEntry(rmode_));
-  if (target_address() != target)
-    set_target_address(isolate, target, write_barrier_mode, icache_flush_mode);
-}
-
-void RelocInfo::WipeOut(Isolate* isolate) {
-  DCHECK(IsEmbeddedObject(rmode_) || IsCodeTarget(rmode_) ||
-         IsRuntimeEntry(rmode_) || IsExternalReference(rmode_) ||
-         IsInternalReference(rmode_) || IsInternalReferenceEncoded(rmode_));
-  if (IsInternalReference(rmode_)) {
-    // Jump table entry
-    Memory::Address_at(pc_) = nullptr;
-  } else if (IsInternalReferenceEncoded(rmode_)) {
-    // mov sequence
-    // Currently used only by deserializer, no need to flush.
-    Assembler::set_target_address_at(isolate, pc_, constant_pool_, nullptr,
-                                     SKIP_ICACHE_FLUSH);
-  } else {
-    Assembler::set_target_address_at(isolate, pc_, constant_pool_, nullptr);
-  }
-}
-
-template <typename ObjectVisitor>
-void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) {
-  RelocInfo::Mode mode = rmode();
-  if (mode == RelocInfo::EMBEDDED_OBJECT) {
-    visitor->VisitEmbeddedPointer(host(), this);
-  } else if (RelocInfo::IsCodeTarget(mode)) {
-    visitor->VisitCodeTarget(host(), this);
-  } else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
-    visitor->VisitExternalReference(host(), this);
-  } else if (mode == RelocInfo::INTERNAL_REFERENCE) {
-    visitor->VisitInternalReference(host(), this);
-  } else if (IsRuntimeEntry(mode)) {
-    visitor->VisitRuntimeEntry(host(), this);
-  }
-}
-
-// Operand constructors
-Operand::Operand(Register rm) : rm_(rm), rmode_(kRelocInfo_NONEPTR) {}
-
-int32_t Assembler::emit_code_target(Handle<Code> target,
-                                    RelocInfo::Mode rmode) {
-  DCHECK(RelocInfo::IsCodeTarget(rmode));
-  RecordRelocInfo(rmode);
-
-  size_t current = code_targets_.size();
-  if (current > 0 && !target.is_null() &&
-      code_targets_.back().address() == target.address()) {
-    // Optimization if we keep jumping to the same code target.
-    current--;
-  } else {
-    code_targets_.push_back(target);
-  }
-  return current;
-}
-
-
-// Fetch the 32bit value from the FIXED_SEQUENCE IIHF / IILF
-Address Assembler::target_address_at(Address pc, Address constant_pool) {
-  // S390 Instruction!
-  // We want to check for instructions generated by Asm::mov()
-  Opcode op1 = Instruction::S390OpcodeValue(reinterpret_cast<const byte*>(pc));
-  SixByteInstr instr_1 =
-      Instruction::InstructionBits(reinterpret_cast<const byte*>(pc));
-
-  if (BRASL == op1 || BRCL == op1) {
-    int32_t dis = static_cast<int32_t>(instr_1 & 0xFFFFFFFF) * 2;
-    return reinterpret_cast<Address>(reinterpret_cast<uint64_t>(pc) + dis);
-  }
-
-#if V8_TARGET_ARCH_S390X
-  int instr1_length =
-      Instruction::InstructionLength(reinterpret_cast<const byte*>(pc));
-  Opcode op2 = Instruction::S390OpcodeValue(
-      reinterpret_cast<const byte*>(pc + instr1_length));
-  SixByteInstr instr_2 = Instruction::InstructionBits(
-      reinterpret_cast<const byte*>(pc + instr1_length));
-  // IIHF for hi_32, IILF for lo_32
-  if (IIHF == op1 && IILF == op2) {
-    return reinterpret_cast<Address>(((instr_1 & 0xFFFFFFFF) << 32) |
-                                     ((instr_2 & 0xFFFFFFFF)));
-  }
-#else
-  // IILF loads 32-bits
-  if (IILF == op1 || CFI == op1) {
-    return reinterpret_cast<Address>((instr_1 & 0xFFFFFFFF));
-  }
-#endif
-
-  UNIMPLEMENTED();
-  return (Address)0;
-}
-
-// This sets the branch destination (which gets loaded at the call address).
-// This is for calls and branches within generated code.  The serializer
-// has already deserialized the mov instructions etc.
-// There is a FIXED_SEQUENCE assumption here
-void Assembler::deserialization_set_special_target_at(
-    Isolate* isolate, Address instruction_payload, Code* code, Address target) {
-  set_target_address_at(isolate, instruction_payload,
-                        code ? code->constant_pool() : nullptr, target);
-}
-
-void Assembler::deserialization_set_target_internal_reference_at(
-    Isolate* isolate, Address pc, Address target, RelocInfo::Mode mode) {
-  if (RelocInfo::IsInternalReferenceEncoded(mode)) {
-    set_target_address_at(isolate, pc, nullptr, target, SKIP_ICACHE_FLUSH);
-  } else {
-    Memory::Address_at(pc) = target;
-  }
-}
-
-// This code assumes the FIXED_SEQUENCE of IIHF/IILF
-void Assembler::set_target_address_at(Isolate* isolate, Address pc,
-                                      Address constant_pool, Address target,
-                                      ICacheFlushMode icache_flush_mode) {
-  DCHECK_IMPLIES(isolate == nullptr, icache_flush_mode == SKIP_ICACHE_FLUSH);
-
-  // Check for instructions generated by Asm::mov()
-  Opcode op1 = Instruction::S390OpcodeValue(reinterpret_cast<const byte*>(pc));
-  SixByteInstr instr_1 =
-      Instruction::InstructionBits(reinterpret_cast<const byte*>(pc));
-  bool patched = false;
-
-  if (BRASL == op1 || BRCL == op1) {
-    instr_1 >>= 32;  // Zero out the lower 32-bits
-    instr_1 <<= 32;
-    int32_t halfwords = (target - pc) / 2;  // number of halfwords
-    instr_1 |= static_cast<uint32_t>(halfwords);
-    Instruction::SetInstructionBits<SixByteInstr>(reinterpret_cast<byte*>(pc),
-                                                  instr_1);
-    if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
-      Assembler::FlushICache(isolate, pc, 6);
-    }
-    patched = true;
-  } else {
-#if V8_TARGET_ARCH_S390X
-    int instr1_length =
-        Instruction::InstructionLength(reinterpret_cast<const byte*>(pc));
-    Opcode op2 = Instruction::S390OpcodeValue(
-        reinterpret_cast<const byte*>(pc + instr1_length));
-    SixByteInstr instr_2 = Instruction::InstructionBits(
-        reinterpret_cast<const byte*>(pc + instr1_length));
-    // IIHF for hi_32, IILF for lo_32
-    if (IIHF == op1 && IILF == op2) {
-      // IIHF
-      instr_1 >>= 32;  // Zero out the lower 32-bits
-      instr_1 <<= 32;
-      instr_1 |= reinterpret_cast<uint64_t>(target) >> 32;
-
-      Instruction::SetInstructionBits<SixByteInstr>(reinterpret_cast<byte*>(pc),
-                                                    instr_1);
-
-      // IILF
-      instr_2 >>= 32;
-      instr_2 <<= 32;
-      instr_2 |= reinterpret_cast<uint64_t>(target) & 0xFFFFFFFF;
-
-      Instruction::SetInstructionBits<SixByteInstr>(
-          reinterpret_cast<byte*>(pc + instr1_length), instr_2);
-      if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
-        Assembler::FlushICache(isolate, pc, 12);
-      }
-      patched = true;
-    }
-#else
-    // IILF loads 32-bits
-    if (IILF == op1 || CFI == op1) {
-      instr_1 >>= 32;  // Zero out the lower 32-bits
-      instr_1 <<= 32;
-      instr_1 |= reinterpret_cast<uint32_t>(target);
-
-      Instruction::SetInstructionBits<SixByteInstr>(reinterpret_cast<byte*>(pc),
-                                                    instr_1);
-      if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
-        Assembler::FlushICache(isolate, pc, 6);
-      }
-      patched = true;
-    }
-#endif
-  }
-  if (!patched) UNREACHABLE();
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_S390_ASSEMBLER_S390_INL_H_
diff --git a/src/v8/src/s390/assembler-s390.cc b/src/v8/src/s390/assembler-s390.cc
deleted file mode 100644
index 166da1c..0000000
--- a/src/v8/src/s390/assembler-s390.cc
+++ /dev/null
@@ -1,2237 +0,0 @@
-// Copyright (c) 1994-2006 Sun Microsystems Inc.
-// 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.
-//
-// - Redistribution 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 Sun Microsystems or the names of 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.
-
-// The original source code covered by the above license above has been
-// modified significantly by Google Inc.
-// Copyright 2014 the V8 project authors. All rights reserved.
-
-#include "src/s390/assembler-s390.h"
-#include <sys/auxv.h>
-#include <set>
-#include <string>
-
-#if V8_TARGET_ARCH_S390
-
-#if V8_HOST_ARCH_S390
-#include <elf.h>  // Required for auxv checks for STFLE support
-#endif
-
-#include "src/base/bits.h"
-#include "src/base/cpu.h"
-#include "src/code-stubs.h"
-#include "src/macro-assembler.h"
-#include "src/s390/assembler-s390-inl.h"
-
-namespace v8 {
-namespace internal {
-
-// Get the CPU features enabled by the build.
-static unsigned CpuFeaturesImpliedByCompiler() {
-  unsigned answer = 0;
-  return answer;
-}
-
-static bool supportsCPUFeature(const char* feature) {
-  static std::set<std::string> features;
-  static std::set<std::string> all_available_features = {
-      "iesan3", "zarch",  "stfle",    "msa", "ldisp", "eimm",
-      "dfp",    "etf3eh", "highgprs", "te",  "vx"};
-  if (features.empty()) {
-#if V8_HOST_ARCH_S390
-
-#ifndef HWCAP_S390_VX
-#define HWCAP_S390_VX 2048
-#endif
-#define CHECK_AVAILABILITY_FOR(mask, value) \
-  if (f & mask) features.insert(value);
-
-    // initialize feature vector
-    uint64_t f = getauxval(AT_HWCAP);
-    CHECK_AVAILABILITY_FOR(HWCAP_S390_ESAN3, "iesan3")
-    CHECK_AVAILABILITY_FOR(HWCAP_S390_ZARCH, "zarch")
-    CHECK_AVAILABILITY_FOR(HWCAP_S390_STFLE, "stfle")
-    CHECK_AVAILABILITY_FOR(HWCAP_S390_MSA, "msa")
-    CHECK_AVAILABILITY_FOR(HWCAP_S390_LDISP, "ldisp")
-    CHECK_AVAILABILITY_FOR(HWCAP_S390_EIMM, "eimm")
-    CHECK_AVAILABILITY_FOR(HWCAP_S390_DFP, "dfp")
-    CHECK_AVAILABILITY_FOR(HWCAP_S390_ETF3EH, "etf3eh")
-    CHECK_AVAILABILITY_FOR(HWCAP_S390_HIGH_GPRS, "highgprs")
-    CHECK_AVAILABILITY_FOR(HWCAP_S390_TE, "te")
-    CHECK_AVAILABILITY_FOR(HWCAP_S390_VX, "vx")
-#else
-    // import all features
-    features.insert(all_available_features.begin(),
-                    all_available_features.end());
-#endif
-  }
-  USE(all_available_features);
-  return features.find(feature) != features.end();
-}
-
-// Check whether Store Facility STFLE instruction is available on the platform.
-// Instruction returns a bit vector of the enabled hardware facilities.
-static bool supportsSTFLE() {
-#if V8_HOST_ARCH_S390
-  static bool read_tried = false;
-  static uint32_t auxv_hwcap = 0;
-
-  if (!read_tried) {
-    // Open the AUXV (auxiliary vector) pseudo-file
-    int fd = open("/proc/self/auxv", O_RDONLY);
-
-    read_tried = true;
-    if (fd != -1) {
-#if V8_TARGET_ARCH_S390X
-      static Elf64_auxv_t buffer[16];
-      Elf64_auxv_t* auxv_element;
-#else
-      static Elf32_auxv_t buffer[16];
-      Elf32_auxv_t* auxv_element;
-#endif
-      int bytes_read = 0;
-      while (bytes_read >= 0) {
-        // Read a chunk of the AUXV
-        bytes_read = read(fd, buffer, sizeof(buffer));
-        // Locate and read the platform field of AUXV if it is in the chunk
-        for (auxv_element = buffer;
-             auxv_element + sizeof(auxv_element) <= buffer + bytes_read &&
-             auxv_element->a_type != AT_NULL;
-             auxv_element++) {
-          // We are looking for HWCAP entry in AUXV to search for STFLE support
-          if (auxv_element->a_type == AT_HWCAP) {
-            /* Note: Both auxv_hwcap and buffer are static */
-            auxv_hwcap = auxv_element->a_un.a_val;
-            goto done_reading;
-          }
-        }
-      }
-    done_reading:
-      close(fd);
-    }
-  }
-
-  // Did not find result
-  if (0 == auxv_hwcap) {
-    return false;
-  }
-
-  // HWCAP_S390_STFLE is defined to be 4 in include/asm/elf.h.  Currently
-  // hardcoded in case that include file does not exist.
-  const uint32_t _HWCAP_S390_STFLE = 4;
-  return (auxv_hwcap & _HWCAP_S390_STFLE);
-#else
-  // STFLE is not available on non-s390 hosts
-  return false;
-#endif
-}
-
-void CpuFeatures::ProbeImpl(bool cross_compile) {
-  supported_ |= CpuFeaturesImpliedByCompiler();
-  icache_line_size_ = 256;
-
-  // Only use statically determined features for cross compile (snapshot).
-  if (cross_compile) return;
-
-#ifdef DEBUG
-  initialized_ = true;
-#endif
-
-  static bool performSTFLE = supportsSTFLE();
-
-// Need to define host, as we are generating inlined S390 assembly to test
-// for facilities.
-#if V8_HOST_ARCH_S390
-  if (performSTFLE) {
-    // STFLE D(B) requires:
-    //    GPR0 to specify # of double words to update minus 1.
-    //      i.e. GPR0 = 0 for 1 doubleword
-    //    D(B) to specify to memory location to store the facilities bits
-    // The facilities we are checking for are:
-    //   Bit 45 - Distinct Operands for instructions like ARK, SRK, etc.
-    // As such, we require only 1 double word
-    int64_t facilities[3] = {0L};
-    // LHI sets up GPR0
-    // STFLE is specified as .insn, as opcode is not recognized.
-    // We register the instructions kill r0 (LHI) and the CC (STFLE).
-    asm volatile(
-        "lhi   0,2\n"
-        ".insn s,0xb2b00000,%0\n"
-        : "=Q"(facilities)
-        :
-        : "cc", "r0");
-
-    uint64_t one = static_cast<uint64_t>(1);
-    // Test for Distinct Operands Facility - Bit 45
-    if (facilities[0] & (one << (63 - 45))) {
-      supported_ |= (1u << DISTINCT_OPS);
-    }
-    // Test for General Instruction Extension Facility - Bit 34
-    if (facilities[0] & (one << (63 - 34))) {
-      supported_ |= (1u << GENERAL_INSTR_EXT);
-    }
-    // Test for Floating Point Extension Facility - Bit 37
-    if (facilities[0] & (one << (63 - 37))) {
-      supported_ |= (1u << FLOATING_POINT_EXT);
-    }
-    // Test for Vector Facility - Bit 129
-    if (facilities[2] & (one << (63 - (129 - 128))) &&
-        supportsCPUFeature("vx")) {
-      supported_ |= (1u << VECTOR_FACILITY);
-    }
-    // Test for Miscellaneous Instruction Extension Facility - Bit 58
-    if (facilities[0] & (1lu << (63 - 58))) {
-      supported_ |= (1u << MISC_INSTR_EXT2);
-    }
-  }
-#else
-  // All distinct ops instructions can be simulated
-  supported_ |= (1u << DISTINCT_OPS);
-  // RISBG can be simulated
-  supported_ |= (1u << GENERAL_INSTR_EXT);
-  supported_ |= (1u << FLOATING_POINT_EXT);
-  supported_ |= (1u << MISC_INSTR_EXT2);
-  USE(performSTFLE);  // To avoid assert
-  USE(supportsCPUFeature);
-  supported_ |= (1u << VECTOR_FACILITY);
-#endif
-  supported_ |= (1u << FPU);
-}
-
-void CpuFeatures::PrintTarget() {
-  const char* s390_arch = nullptr;
-
-#if V8_TARGET_ARCH_S390X
-  s390_arch = "s390x";
-#else
-  s390_arch = "s390";
-#endif
-
-  printf("target %s\n", s390_arch);
-}
-
-void CpuFeatures::PrintFeatures() {
-  printf("FPU=%d\n", CpuFeatures::IsSupported(FPU));
-  printf("FPU_EXT=%d\n", CpuFeatures::IsSupported(FLOATING_POINT_EXT));
-  printf("GENERAL_INSTR=%d\n", CpuFeatures::IsSupported(GENERAL_INSTR_EXT));
-  printf("DISTINCT_OPS=%d\n", CpuFeatures::IsSupported(DISTINCT_OPS));
-  printf("VECTOR_FACILITY=%d\n", CpuFeatures::IsSupported(VECTOR_FACILITY));
-  printf("MISC_INSTR_EXT2=%d\n", CpuFeatures::IsSupported(MISC_INSTR_EXT2));
-}
-
-Register ToRegister(int num) {
-  DCHECK(num >= 0 && num < kNumRegisters);
-  const Register kRegisters[] = {r0, r1, r2,  r3, r4, r5,  r6,  r7,
-                                 r8, r9, r10, fp, ip, r13, r14, sp};
-  return kRegisters[num];
-}
-
-// -----------------------------------------------------------------------------
-// Implementation of RelocInfo
-
-const int RelocInfo::kApplyMask =
-    RelocInfo::kCodeTargetMask | 1 << RelocInfo::INTERNAL_REFERENCE;
-
-bool RelocInfo::IsCodedSpecially() {
-  // The deserializer needs to know whether a pointer is specially
-  // coded.  Being specially coded on S390 means that it is an iihf/iilf
-  // instruction sequence, and that is always the case inside code
-  // objects.
-  return true;
-}
-
-bool RelocInfo::IsInConstantPool() { return false; }
-
-Address RelocInfo::embedded_address() const {
-  return Assembler::target_address_at(pc_, constant_pool_);
-}
-
-uint32_t RelocInfo::embedded_size() const {
-  return static_cast<uint32_t>(reinterpret_cast<intptr_t>(
-      Assembler::target_address_at(pc_, constant_pool_)));
-}
-
-void RelocInfo::set_embedded_address(Isolate* isolate, Address address,
-                                     ICacheFlushMode flush_mode) {
-  Assembler::set_target_address_at(isolate, pc_, constant_pool_, address,
-                                   flush_mode);
-}
-
-void RelocInfo::set_embedded_size(Isolate* isolate, uint32_t size,
-                                  ICacheFlushMode flush_mode) {
-  Assembler::set_target_address_at(isolate, pc_, constant_pool_,
-                                   reinterpret_cast<Address>(size), flush_mode);
-}
-
-void RelocInfo::set_js_to_wasm_address(Isolate* isolate, Address address,
-                                       ICacheFlushMode icache_flush_mode) {
-  DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
-  set_embedded_address(isolate, address, icache_flush_mode);
-}
-
-Address RelocInfo::js_to_wasm_address() const {
-  DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
-  return embedded_address();
-}
-
-// -----------------------------------------------------------------------------
-// Implementation of Operand and MemOperand
-// See assembler-s390-inl.h for inlined constructors
-
-Operand::Operand(Handle<HeapObject> handle) {
-  AllowHandleDereference using_location;
-  rm_ = no_reg;
-  value_.immediate = reinterpret_cast<intptr_t>(handle.address());
-  rmode_ = RelocInfo::EMBEDDED_OBJECT;
-}
-
-Operand Operand::EmbeddedNumber(double value) {
-  int32_t smi;
-  if (DoubleToSmiInteger(value, &smi)) return Operand(Smi::FromInt(smi));
-  Operand result(0, RelocInfo::EMBEDDED_OBJECT);
-  result.is_heap_object_request_ = true;
-  result.value_.heap_object_request = HeapObjectRequest(value);
-  return result;
-}
-
-MemOperand::MemOperand(Register rn, int32_t offset)
-    : baseRegister(rn), indexRegister(r0), offset_(offset) {}
-
-MemOperand::MemOperand(Register rx, Register rb, int32_t offset)
-    : baseRegister(rb), indexRegister(rx), offset_(offset) {}
-
-void Assembler::AllocateAndInstallRequestedHeapObjects(Isolate* isolate) {
-  for (auto& request : heap_object_requests_) {
-    Handle<HeapObject> object;
-    Address pc = buffer_ + request.offset();
-    switch (request.kind()) {
-      case HeapObjectRequest::kHeapNumber:
-        object = isolate->factory()->NewHeapNumber(request.heap_number(),
-                                                   IMMUTABLE, TENURED);
-        set_target_address_at(nullptr, pc, static_cast<Address>(nullptr),
-                              reinterpret_cast<Address>(object.location()),
-                              SKIP_ICACHE_FLUSH);
-        break;
-      case HeapObjectRequest::kCodeStub:
-        request.code_stub()->set_isolate(isolate);
-        SixByteInstr instr =
-            Instruction::InstructionBits(reinterpret_cast<const byte*>(pc));
-        int index = instr & 0xFFFFFFFF;
-        code_targets_[index] = request.code_stub()->GetCode();
-        break;
-    }
-  }
-}
-
-// -----------------------------------------------------------------------------
-// Specific instructions, constants, and masks.
-
-Assembler::Assembler(IsolateData isolate_data, void* buffer, int buffer_size)
-    : AssemblerBase(isolate_data, buffer, buffer_size) {
-  reloc_info_writer.Reposition(buffer_ + buffer_size_, pc_);
-  code_targets_.reserve(100);
-
-  last_bound_pos_ = 0;
-  relocations_.reserve(128);
-}
-
-void Assembler::GetCode(Isolate* isolate, CodeDesc* desc) {
-  EmitRelocations();
-
-  AllocateAndInstallRequestedHeapObjects(isolate);
-
-  // Set up code descriptor.
-  desc->buffer = buffer_;
-  desc->buffer_size = buffer_size_;
-  desc->instr_size = pc_offset();
-  desc->reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos();
-  desc->origin = this;
-  desc->unwinding_info_size = 0;
-  desc->unwinding_info = nullptr;
-}
-
-void Assembler::Align(int m) {
-  DCHECK(m >= 4 && base::bits::IsPowerOfTwo(m));
-  while ((pc_offset() & (m - 1)) != 0) {
-    nop(0);
-  }
-}
-
-void Assembler::CodeTargetAlign() { Align(8); }
-
-Condition Assembler::GetCondition(Instr instr) {
-  switch (instr & kCondMask) {
-    case BT:
-      return eq;
-    case BF:
-      return ne;
-    default:
-      UNIMPLEMENTED();
-  }
-  return al;
-}
-
-#if V8_TARGET_ARCH_S390X
-// This code assumes a FIXED_SEQUENCE for 64bit loads (iihf/iilf)
-bool Assembler::Is64BitLoadIntoIP(SixByteInstr instr1, SixByteInstr instr2) {
-  // Check the instructions are the iihf/iilf load into ip
-  return (((instr1 >> 32) == 0xC0C8) && ((instr2 >> 32) == 0xC0C9));
-}
-#else
-// This code assumes a FIXED_SEQUENCE for 32bit loads (iilf)
-bool Assembler::Is32BitLoadIntoIP(SixByteInstr instr) {
-  // Check the instruction is an iilf load into ip/r12.
-  return ((instr >> 32) == 0xC0C9);
-}
-#endif
-
-// Labels refer to positions in the (to be) generated code.
-// There are bound, linked, and unused labels.
-//
-// Bound labels refer to known positions in the already
-// generated code. pos() is the position the label refers to.
-//
-// Linked labels refer to unknown positions in the code
-// to be generated; pos() is the position of the last
-// instruction using the label.
-
-// The link chain is terminated by a negative code position (must be aligned)
-const int kEndOfChain = -4;
-
-// Returns the target address of the relative instructions, typically
-// of the form: pos + imm (where immediate is in # of halfwords for
-// BR* and LARL).
-int Assembler::target_at(int pos) {
-  SixByteInstr instr = instr_at(pos);
-  // check which type of branch this is 16 or 26 bit offset
-  Opcode opcode = Instruction::S390OpcodeValue(buffer_ + pos);
-
-  if (BRC == opcode || BRCT == opcode || BRCTG == opcode) {
-    int16_t imm16 = SIGN_EXT_IMM16((instr & kImm16Mask));
-    imm16 <<= 1;  // BRC immediate is in # of halfwords
-    if (imm16 == 0) return kEndOfChain;
-    return pos + imm16;
-  } else if (LLILF == opcode || BRCL == opcode || LARL == opcode ||
-             BRASL == opcode) {
-    int32_t imm32 =
-        static_cast<int32_t>(instr & (static_cast<uint64_t>(0xFFFFFFFF)));
-    if (LLILF != opcode)
-      imm32 <<= 1;  // BR* + LARL treat immediate in # of halfwords
-    if (imm32 == 0) return kEndOfChain;
-    return pos + imm32;
-  }
-
-  // Unknown condition
-  DCHECK(false);
-  return -1;
-}
-
-// Update the target address of the current relative instruction.
-void Assembler::target_at_put(int pos, int target_pos, bool* is_branch) {
-  SixByteInstr instr = instr_at(pos);
-  Opcode opcode = Instruction::S390OpcodeValue(buffer_ + pos);
-
-  if (is_branch != nullptr) {
-    *is_branch = (opcode == BRC || opcode == BRCT || opcode == BRCTG ||
-                  opcode == BRCL || opcode == BRASL);
-  }
-
-  if (BRC == opcode || BRCT == opcode || BRCTG == opcode) {
-    int16_t imm16 = target_pos - pos;
-    instr &= (~0xFFFF);
-    DCHECK(is_int16(imm16));
-    instr_at_put<FourByteInstr>(pos, instr | (imm16 >> 1));
-    return;
-  } else if (BRCL == opcode || LARL == opcode || BRASL == opcode) {
-    // Immediate is in # of halfwords
-    int32_t imm32 = target_pos - pos;
-    instr &= (~static_cast<uint64_t>(0xFFFFFFFF));
-    instr_at_put<SixByteInstr>(pos, instr | (imm32 >> 1));
-    return;
-  } else if (LLILF == opcode) {
-    DCHECK(target_pos == kEndOfChain || target_pos >= 0);
-    // Emitted label constant, not part of a branch.
-    // Make label relative to Code* of generated Code object.
-    int32_t imm32 = target_pos + (Code::kHeaderSize - kHeapObjectTag);
-    instr &= (~static_cast<uint64_t>(0xFFFFFFFF));
-    instr_at_put<SixByteInstr>(pos, instr | imm32);
-    return;
-  }
-  DCHECK(false);
-}
-
-// Returns the maximum number of bits given instruction can address.
-int Assembler::max_reach_from(int pos) {
-  Opcode opcode = Instruction::S390OpcodeValue(buffer_ + pos);
-
-  // Check which type of instr.  In theory, we can return
-  // the values below + 1, given offset is # of halfwords
-  if (BRC == opcode || BRCT == opcode || BRCTG == opcode) {
-    return 16;
-  } else if (LLILF == opcode || BRCL == opcode || LARL == opcode ||
-             BRASL == opcode) {
-    return 31;  // Using 31 as workaround instead of 32 as
-                // is_intn(x,32) doesn't work on 32-bit platforms.
-                // llilf: Emitted label constant, not part of
-                //        a branch (regexp PushBacktrack).
-  }
-  DCHECK(false);
-  return 16;
-}
-
-void Assembler::bind_to(Label* L, int pos) {
-  DCHECK(0 <= pos && pos <= pc_offset());  // must have a valid binding position
-  bool is_branch = false;
-  while (L->is_linked()) {
-    int fixup_pos = L->pos();
-#ifdef DEBUG
-    int32_t offset = pos - fixup_pos;
-    int maxReach = max_reach_from(fixup_pos);
-#endif
-    next(L);  // call next before overwriting link with target at fixup_pos
-    DCHECK(is_intn(offset, maxReach));
-    target_at_put(fixup_pos, pos, &is_branch);
-  }
-  L->bind_to(pos);
-
-  // Keep track of the last bound label so we don't eliminate any instructions
-  // before a bound label.
-  if (pos > last_bound_pos_) last_bound_pos_ = pos;
-}
-
-void Assembler::bind(Label* L) {
-  DCHECK(!L->is_bound());  // label can only be bound once
-  bind_to(L, pc_offset());
-}
-
-void Assembler::next(Label* L) {
-  DCHECK(L->is_linked());
-  int link = target_at(L->pos());
-  if (link == kEndOfChain) {
-    L->Unuse();
-  } else {
-    DCHECK_GE(link, 0);
-    L->link_to(link);
-  }
-}
-
-bool Assembler::is_near(Label* L, Condition cond) {
-  DCHECK(L->is_bound());
-  if (L->is_bound() == false) return false;
-
-  int maxReach = ((cond == al) ? 26 : 16);
-  int offset = L->pos() - pc_offset();
-
-  return is_intn(offset, maxReach);
-}
-
-int Assembler::link(Label* L) {
-  int position;
-  if (L->is_bound()) {
-    position = L->pos();
-  } else {
-    if (L->is_linked()) {
-      position = L->pos();  // L's link
-    } else {
-      // was: target_pos = kEndOfChain;
-      // However, using self to mark the first reference
-      // should avoid most instances of branch offset overflow.  See
-      // target_at() for where this is converted back to kEndOfChain.
-      position = pc_offset();
-    }
-    L->link_to(pc_offset());
-  }
-
-  return position;
-}
-
-void Assembler::load_label_offset(Register r1, Label* L) {
-  int target_pos;
-  int constant;
-  if (L->is_bound()) {
-    target_pos = L->pos();
-    constant = target_pos + (Code::kHeaderSize - kHeapObjectTag);
-  } else {
-    if (L->is_linked()) {
-      target_pos = L->pos();  // L's link
-    } else {
-      // was: target_pos = kEndOfChain;
-      // However, using branch to self to mark the first reference
-      // should avoid most instances of branch offset overflow.  See
-      // target_at() for where this is converted back to kEndOfChain.
-      target_pos = pc_offset();
-    }
-    L->link_to(pc_offset());
-
-    constant = target_pos - pc_offset();
-  }
-  llilf(r1, Operand(constant));
-}
-
-// Pseudo op - branch on condition
-void Assembler::branchOnCond(Condition c, int branch_offset, bool is_bound) {
-  int offset_in_halfwords = branch_offset / 2;
-  if (is_bound && is_int16(offset_in_halfwords)) {
-    brc(c, Operand(offset_in_halfwords));  // short jump
-  } else {
-    brcl(c, Operand(offset_in_halfwords));  // long jump
-  }
-}
-
-// 32-bit Store Multiple - short displacement (12-bits unsigned)
-void Assembler::stm(Register r1, Register r2, const MemOperand& src) {
-  rs_form(STM, r1, r2, src.rb(), src.offset());
-}
-
-// 32-bit Store Multiple - long displacement (20-bits signed)
-void Assembler::stmy(Register r1, Register r2, const MemOperand& src) {
-  rsy_form(STMY, r1, r2, src.rb(), src.offset());
-}
-
-// 64-bit Store Multiple - long displacement (20-bits signed)
-void Assembler::stmg(Register r1, Register r2, const MemOperand& src) {
-  rsy_form(STMG, r1, r2, src.rb(), src.offset());
-}
-
-// Exception-generating instructions and debugging support.
-// Stops with a non-negative code less than kNumOfWatchedStops support
-// enabling/disabling and a counter feature. See simulator-s390.h .
-void Assembler::stop(const char* msg, Condition cond, int32_t code,
-                     CRegister cr) {
-  if (cond != al) {
-    Label skip;
-    b(NegateCondition(cond), &skip, Label::kNear);
-    bkpt(0);
-    bind(&skip);
-  } else {
-    bkpt(0);
-  }
-}
-
-void Assembler::bkpt(uint32_t imm16) {
-  // GDB software breakpoint instruction
-  emit2bytes(0x0001);
-}
-
-// Pseudo instructions.
-void Assembler::nop(int type) {
-  switch (type) {
-    case 0:
-      lr(r0, r0);
-      break;
-    case DEBUG_BREAK_NOP:
-      // TODO(john.yan): Use a better NOP break
-      oill(r3, Operand::Zero());
-      break;
-    default:
-      UNIMPLEMENTED();
-  }
-}
-
-
-
-// RI1 format: <insn> R1,I2
-//    +--------+----+----+------------------+
-//    | OpCode | R1 |OpCd|        I2        |
-//    +--------+----+----+------------------+
-//    0        8    12   16                31
-#define RI1_FORM_EMIT(name, op) \
-  void Assembler::name(Register r, const Operand& i2) { ri_form(op, r, i2); }
-
-void Assembler::ri_form(Opcode op, Register r1, const Operand& i2) {
-  DCHECK(is_uint12(op));
-  DCHECK(is_uint16(i2.immediate()) || is_int16(i2.immediate()));
-  emit4bytes((op & 0xFF0) * B20 | r1.code() * B20 | (op & 0xF) * B16 |
-             (i2.immediate() & 0xFFFF));
-}
-
-// RI2 format: <insn> M1,I2
-//    +--------+----+----+------------------+
-//    | OpCode | M1 |OpCd|        I2        |
-//    +--------+----+----+------------------+
-//    0        8    12   16                31
-#define RI2_FORM_EMIT(name, op) \
-  void Assembler::name(Condition m, const Operand& i2) { ri_form(op, m, i2); }
-
-void Assembler::ri_form(Opcode op, Condition m1, const Operand& i2) {
-  DCHECK(is_uint12(op));
-  DCHECK(is_uint4(m1));
-  DCHECK(op == BRC ? is_int16(i2.immediate()) : is_uint16(i2.immediate()));
-  emit4bytes((op & 0xFF0) * B20 | m1 * B20 | (op & 0xF) * B16 |
-             (i2.immediate() & 0xFFFF));
-}
-
-// RIE-f format: <insn> R1,R2,I3,I4,I5
-//    +--------+----+----+------------------+--------+--------+
-//    | OpCode | R1 | R2 |   I3   |    I4   |   I5   | OpCode |
-//    +--------+----+----+------------------+--------+--------+
-//    0        8    12   16      24         32       40      47
-void Assembler::rie_f_form(Opcode op, Register r1, Register r2,
-                           const Operand& i3, const Operand& i4,
-                           const Operand& i5) {
-  DCHECK(is_uint16(op));
-  DCHECK(is_uint8(i3.immediate()));
-  DCHECK(is_uint8(i4.immediate()));
-  DCHECK(is_uint8(i5.immediate()));
-  uint64_t code = (static_cast<uint64_t>(op & 0xFF00)) * B32 |
-                  (static_cast<uint64_t>(r1.code())) * B36 |
-                  (static_cast<uint64_t>(r2.code())) * B32 |
-                  (static_cast<uint64_t>(i3.immediate())) * B24 |
-                  (static_cast<uint64_t>(i4.immediate())) * B16 |
-                  (static_cast<uint64_t>(i5.immediate())) * B8 |
-                  (static_cast<uint64_t>(op & 0x00FF));
-  emit6bytes(code);
-}
-
-// RIE format: <insn> R1,R3,I2
-//    +--------+----+----+------------------+--------+--------+
-//    | OpCode | R1 | R3 |        I2        |////////| OpCode |
-//    +--------+----+----+------------------+--------+--------+
-//    0        8    12   16                 32       40      47
-#define RIE_FORM_EMIT(name, op)                                       \
-  void Assembler::name(Register r1, Register r3, const Operand& i2) { \
-    rie_form(op, r1, r3, i2);                                         \
-  }
-
-void Assembler::rie_form(Opcode op, Register r1, Register r3,
-                         const Operand& i2) {
-  DCHECK(is_uint16(op));
-  DCHECK(is_int16(i2.immediate()));
-  uint64_t code = (static_cast<uint64_t>(op & 0xFF00)) * B32 |
-                  (static_cast<uint64_t>(r1.code())) * B36 |
-                  (static_cast<uint64_t>(r3.code())) * B32 |
-                  (static_cast<uint64_t>(i2.immediate() & 0xFFFF)) * B16 |
-                  (static_cast<uint64_t>(op & 0x00FF));
-  emit6bytes(code);
-}
-
-// RS1 format: <insn> R1,R3,D2(B2)
-//    +--------+----+----+----+-------------+
-//    | OpCode | R1 | R3 | B2 |     D2      |
-//    +--------+----+----+----+-------------+
-//    0        8    12   16   20           31
-#define RS1_FORM_EMIT(name, op)                                            \
-  void Assembler::name(Register r1, Register r3, Register b2, Disp d2) {   \
-    rs_form(op, r1, r3, b2, d2);                                           \
-  }                                                                        \
-  void Assembler::name(Register r1, Register r3, const MemOperand& opnd) { \
-    name(r1, r3, opnd.getBaseRegister(), opnd.getDisplacement());          \
-  }
-
-void Assembler::rs_form(Opcode op, Register r1, Register r3, Register b2,
-                        const Disp d2) {
-  DCHECK(is_uint12(d2));
-  emit4bytes(op * B24 | r1.code() * B20 | r3.code() * B16 | b2.code() * B12 |
-             d2);
-}
-
-// RS2 format: <insn> R1,M3,D2(B2)
-//    +--------+----+----+----+-------------+
-//    | OpCode | R1 | M3 | B2 |     D2      |
-//    +--------+----+----+----+-------------+
-//    0        8    12   16   20           31
-#define RS2_FORM_EMIT(name, op)                                             \
-  void Assembler::name(Register r1, Condition m3, Register b2, Disp d2) {   \
-    rs_form(op, r1, m3, b2, d2);                                            \
-  }                                                                         \
-  void Assembler::name(Register r1, Condition m3, const MemOperand& opnd) { \
-    name(r1, m3, opnd.getBaseRegister(), opnd.getDisplacement());           \
-  }
-
-void Assembler::rs_form(Opcode op, Register r1, Condition m3, Register b2,
-                        const Disp d2) {
-  DCHECK(is_uint12(d2));
-  emit4bytes(op * B24 | r1.code() * B20 | m3 * B16 | b2.code() * B12 | d2);
-}
-
-// RSI format: <insn> R1,R3,I2
-//    +--------+----+----+------------------+
-//    | OpCode | R1 | R3 |        RI2       |
-//    +--------+----+----+------------------+
-//    0        8    12   16                 31
-#define RSI_FORM_EMIT(name, op)                                       \
-  void Assembler::name(Register r1, Register r3, const Operand& i2) { \
-    rsi_form(op, r1, r3, i2);                                         \
-  }
-
-void Assembler::rsi_form(Opcode op, Register r1, Register r3,
-                         const Operand& i2) {
-  DCHECK(is_uint8(op));
-  DCHECK(is_uint16(i2.immediate()));
-  emit4bytes(op * B24 | r1.code() * B20 | r3.code() * B16 |
-             (i2.immediate() & 0xFFFF));
-}
-
-// RSL format: <insn> R1,R3,D2(B2)
-//    +--------+----+----+----+-------------+--------+--------+
-//    | OpCode | L1 |    | B2 |    D2       |        | OpCode |
-//    +--------+----+----+----+-------------+--------+--------+
-//    0        8    12   16   20            32       40      47
-#define RSL_FORM_EMIT(name, op)                           \
-  void Assembler::name(Length l1, Register b2, Disp d2) { \
-    rsl_form(op, l1, b2, d2);                             \
-  }
-
-void Assembler::rsl_form(Opcode op, Length l1, Register b2, Disp d2) {
-  DCHECK(is_uint16(op));
-  uint64_t code = (static_cast<uint64_t>(op & 0xFF00)) * B32 |
-                  (static_cast<uint64_t>(l1)) * B36 |
-                  (static_cast<uint64_t>(b2.code())) * B28 |
-                  (static_cast<uint64_t>(d2)) * B16 |
-                  (static_cast<uint64_t>(op & 0x00FF));
-  emit6bytes(code);
-}
-
-// RSY1 format: <insn> R1,R3,D2(B2)
-//    +--------+----+----+----+-------------+--------+--------+
-//    | OpCode | R1 | R3 | B2 |    DL2      |  DH2   | OpCode |
-//    +--------+----+----+----+-------------+--------+--------+
-//    0        8    12   16   20            32       40      47
-#define RSY1_FORM_EMIT(name, op)                                           \
-  void Assembler::name(Register r1, Register r3, Register b2, Disp d2) {   \
-    rsy_form(op, r1, r3, b2, d2);                                          \
-  }                                                                        \
-  void Assembler::name(Register r1, Register r3, const MemOperand& opnd) { \
-    name(r1, r3, opnd.getBaseRegister(), opnd.getDisplacement());          \
-  }
-
-void Assembler::rsy_form(Opcode op, Register r1, Register r3, Register b2,
-                         const Disp d2) {
-  DCHECK(is_int20(d2));
-  DCHECK(is_uint16(op));
-  uint64_t code = (static_cast<uint64_t>(op & 0xFF00)) * B32 |
-                  (static_cast<uint64_t>(r1.code())) * B36 |
-                  (static_cast<uint64_t>(r3.code())) * B32 |
-                  (static_cast<uint64_t>(b2.code())) * B28 |
-                  (static_cast<uint64_t>(d2 & 0x0FFF)) * B16 |
-                  (static_cast<uint64_t>(d2 & 0x0FF000)) >> 4 |
-                  (static_cast<uint64_t>(op & 0x00FF));
-  emit6bytes(code);
-}
-
-// RSY2 format: <insn> R1,M3,D2(B2)
-//    +--------+----+----+----+-------------+--------+--------+
-//    | OpCode | R1 | M3 | B2 |    DL2      |  DH2   | OpCode |
-//    +--------+----+----+----+-------------+--------+--------+
-//    0        8    12   16   20            32       40      47
-#define RSY2_FORM_EMIT(name, op)                                            \
-  void Assembler::name(Register r1, Condition m3, Register b2, Disp d2) {   \
-    rsy_form(op, r1, m3, b2, d2);                                           \
-  }                                                                         \
-  void Assembler::name(Register r1, Condition m3, const MemOperand& opnd) { \
-    name(r1, m3, opnd.getBaseRegister(), opnd.getDisplacement());           \
-  }
-
-void Assembler::rsy_form(Opcode op, Register r1, Condition m3, Register b2,
-                         const Disp d2) {
-  DCHECK(is_int20(d2));
-  DCHECK(is_uint16(op));
-  uint64_t code = (static_cast<uint64_t>(op & 0xFF00)) * B32 |
-                  (static_cast<uint64_t>(r1.code())) * B36 |
-                  (static_cast<uint64_t>(m3)) * B32 |
-                  (static_cast<uint64_t>(b2.code())) * B28 |
-                  (static_cast<uint64_t>(d2 & 0x0FFF)) * B16 |
-                  (static_cast<uint64_t>(d2 & 0x0FF000)) >> 4 |
-                  (static_cast<uint64_t>(op & 0x00FF));
-  emit6bytes(code);
-}
-
-// RXE format: <insn> R1,D2(X2,B2)
-//    +--------+----+----+----+-------------+--------+--------+
-//    | OpCode | R1 | X2 | B2 |     D2      |////////| OpCode |
-//    +--------+----+----+----+-------------+--------+--------+
-//    0        8    12   16   20            32       40      47
-#define RXE_FORM_EMIT(name, op)                                          \
-  void Assembler::name(Register r1, Register x2, Register b2, Disp d2) { \
-    rxe_form(op, r1, x2, b2, d2);                                        \
-  }                                                                      \
-  void Assembler::name(Register r1, const MemOperand& opnd) {            \
-    name(r1, opnd.getIndexRegister(), opnd.getBaseRegister(),            \
-         opnd.getDisplacement());                                        \
-  }
-
-void Assembler::rxe_form(Opcode op, Register r1, Register x2, Register b2,
-                         Disp d2) {
-  DCHECK(is_uint12(d2));
-  DCHECK(is_uint16(op));
-  uint64_t code = (static_cast<uint64_t>(op & 0xFF00)) * B32 |
-                  (static_cast<uint64_t>(r1.code())) * B36 |
-                  (static_cast<uint64_t>(x2.code())) * B32 |
-                  (static_cast<uint64_t>(b2.code())) * B28 |
-                  (static_cast<uint64_t>(d2 & 0x0FFF)) * B16 |
-                  (static_cast<uint64_t>(op & 0x00FF));
-  emit6bytes(code);
-}
-
-// RRS format: <insn> R1,R2,M3,D4(B4)
-//    +--------+----+----+----+-------------+----+---+--------+
-//    | OpCode | R1 | R2 | B4 |     D4      | M3 |///| OpCode |
-//    +--------+----+----+----+-------------+----+---+--------+
-//    0        8    12   16   20            32   36   40      47
-#define RRS_FORM_EMIT(name, op)                                        \
-  void Assembler::name(Register r1, Register r2, Register b4, Disp d4, \
-                       Condition m3) {                                 \
-    rrs_form(op, r1, r2, b4, d4, m3);                                  \
-  }                                                                    \
-  void Assembler::name(Register r1, Register r2, Condition m3,         \
-                       const MemOperand& opnd) {                       \
-    name(r1, r2, opnd.getBaseRegister(), opnd.getDisplacement(), m3);  \
-  }
-
-void Assembler::rrs_form(Opcode op, Register r1, Register r2, Register b4,
-                         Disp d4, Condition m3) {
-  DCHECK(is_uint12(d4));
-  DCHECK(is_uint16(op));
-  uint64_t code = (static_cast<uint64_t>(op & 0xFF00)) * B32 |
-                  (static_cast<uint64_t>(r1.code())) * B36 |
-                  (static_cast<uint64_t>(r2.code())) * B32 |
-                  (static_cast<uint64_t>(b4.code())) * B28 |
-                  (static_cast<uint64_t>(d4)) * B16 |
-                  (static_cast<uint64_t>(m3)) << 12 |
-                  (static_cast<uint64_t>(op & 0x00FF));
-  emit6bytes(code);
-}
-
-// RIS format: <insn> R1,I2,M3,D4(B4)
-//    +--------+----+----+----+-------------+--------+--------+
-//    | OpCode | R1 | M3 | B4 |     D4      |   I2   | OpCode |
-//    +--------+----+----+----+-------------+--------+--------+
-//    0        8    12   16   20            32        40      47
-#define RIS_FORM_EMIT(name, op)                                         \
-  void Assembler::name(Register r1, Condition m3, Register b4, Disp d4, \
-                       const Operand& i2) {                             \
-    ris_form(op, r1, m3, b4, d4, i2);                                   \
-  }                                                                     \
-  void Assembler::name(Register r1, const Operand& i2, Condition m3,    \
-                       const MemOperand& opnd) {                        \
-    name(r1, m3, opnd.getBaseRegister(), opnd.getDisplacement(), i2);   \
-  }
-
-void Assembler::ris_form(Opcode op, Register r1, Condition m3, Register b4,
-                         Disp d4, const Operand& i2) {
-  DCHECK(is_uint12(d4));
-  DCHECK(is_uint16(op));
-  DCHECK(is_uint8(i2.immediate()));
-  uint64_t code = (static_cast<uint64_t>(op & 0xFF00)) * B32 |
-                  (static_cast<uint64_t>(r1.code())) * B36 |
-                  (static_cast<uint64_t>(m3)) * B32 |
-                  (static_cast<uint64_t>(b4.code())) * B28 |
-                  (static_cast<uint64_t>(d4)) * B16 |
-                  (static_cast<uint64_t>(i2.immediate())) << 8 |
-                  (static_cast<uint64_t>(op & 0x00FF));
-  emit6bytes(code);
-}
-
-// S format: <insn> D2(B2)
-//    +------------------+----+-------------+
-//    |      OpCode      | B2 |     D2      |
-//    +------------------+----+-------------+
-//    0                  16   20           31
-#define S_FORM_EMIT(name, op)                                        \
-  void Assembler::name(Register b1, Disp d2) { s_form(op, b1, d2); } \
-  void Assembler::name(const MemOperand& opnd) {                     \
-    name(opnd.getBaseRegister(), opnd.getDisplacement());            \
-  }
-
-void Assembler::s_form(Opcode op, Register b1, Disp d2) {
-  DCHECK(is_uint12(d2));
-  emit4bytes(op << 16 | b1.code() * B12 | d2);
-}
-
-// SI format: <insn> D1(B1),I2
-//    +--------+---------+----+-------------+
-//    | OpCode |   I2    | B1 |     D1      |
-//    +--------+---------+----+-------------+
-//    0        8         16   20           31
-#define SI_FORM_EMIT(name, op)                                      \
-  void Assembler::name(const Operand& i2, Register b1, Disp d1) {   \
-    si_form(op, i2, b1, d1);                                        \
-  }                                                                 \
-  void Assembler::name(const MemOperand& opnd, const Operand& i2) { \
-    name(i2, opnd.getBaseRegister(), opnd.getDisplacement());       \
-  }
-
-void Assembler::si_form(Opcode op, const Operand& i2, Register b1, Disp d1) {
-  emit4bytes((op & 0x00FF) << 24 | i2.immediate() * B16 | b1.code() * B12 | d1);
-}
-
-// SIY format: <insn> D1(B1),I2
-//    +--------+---------+----+-------------+--------+--------+
-//    | OpCode |   I2    | B1 |     DL1     |  DH1   | OpCode |
-//    +--------+---------+----+-------------+--------+--------+
-//    0        8         16   20            32   36   40      47
-#define SIY_FORM_EMIT(name, op)                                     \
-  void Assembler::name(const Operand& i2, Register b1, Disp d1) {   \
-    siy_form(op, i2, b1, d1);                                       \
-  }                                                                 \
-  void Assembler::name(const MemOperand& opnd, const Operand& i2) { \
-    name(i2, opnd.getBaseRegister(), opnd.getDisplacement());       \
-  }
-
-void Assembler::siy_form(Opcode op, const Operand& i2, Register b1, Disp d1) {
-  DCHECK(is_uint20(d1) || is_int20(d1));
-  DCHECK(is_uint16(op));
-  DCHECK(is_uint8(i2.immediate()));
-  uint64_t code = (static_cast<uint64_t>(op & 0xFF00)) * B32 |
-                  (static_cast<uint64_t>(i2.immediate())) * B32 |
-                  (static_cast<uint64_t>(b1.code())) * B28 |
-                  (static_cast<uint64_t>(d1 & 0x0FFF)) * B16 |
-                  (static_cast<uint64_t>(d1 & 0x0FF000)) >> 4 |
-                  (static_cast<uint64_t>(op & 0x00FF));
-  emit6bytes(code);
-}
-
-// SIL format: <insn> D1(B1),I2
-//    +------------------+----+-------------+-----------------+
-//    |     OpCode       | B1 |      D1     |        I2       |
-//    +------------------+----+-------------+-----------------+
-//    0                 16   20            32                47
-#define SIL_FORM_EMIT(name, op)                                     \
-  void Assembler::name(Register b1, Disp d1, const Operand& i2) {   \
-    sil_form(op, b1, d1, i2);                                       \
-  }                                                                 \
-  void Assembler::name(const MemOperand& opnd, const Operand& i2) { \
-    name(opnd.getBaseRegister(), opnd.getDisplacement(), i2);       \
-  }
-
-void Assembler::sil_form(Opcode op, Register b1, Disp d1, const Operand& i2) {
-  DCHECK(is_uint12(d1));
-  DCHECK(is_uint16(op));
-  DCHECK(is_uint16(i2.immediate()));
-  uint64_t code = (static_cast<uint64_t>(op)) * B32 |
-                  (static_cast<uint64_t>(b1.code())) * B28 |
-                  (static_cast<uint64_t>(d1)) * B16 |
-                  (static_cast<uint64_t>(i2.immediate()));
-  emit6bytes(code);
-}
-
-// RXF format: <insn> R1,R3,D2(X2,B2)
-//    +--------+----+----+----+-------------+----+---+--------+
-//    | OpCode | R3 | X2 | B2 |     D2      | R1 |///| OpCode |
-//    +--------+----+----+----+-------------+----+---+--------+
-//    0        8    12   16   20            32   36  40      47
-#define RXF_FORM_EMIT(name, op)                                            \
-  void Assembler::name(Register r1, Register r3, Register b2, Register x2, \
-                       Disp d2) {                                          \
-    rxf_form(op, r1, r3, b2, x2, d2);                                      \
-  }                                                                        \
-  void Assembler::name(Register r1, Register r3, const MemOperand& opnd) { \
-    name(r1, r3, opnd.getBaseRegister(), opnd.getIndexRegister(),          \
-         opnd.getDisplacement());                                          \
-  }
-
-void Assembler::rxf_form(Opcode op, Register r1, Register r3, Register b2,
-                         Register x2, Disp d2) {
-  DCHECK(is_uint12(d2));
-  DCHECK(is_uint16(op));
-  uint64_t code = (static_cast<uint64_t>(op & 0xFF00)) * B32 |
-                  (static_cast<uint64_t>(r3.code())) * B36 |
-                  (static_cast<uint64_t>(x2.code())) * B32 |
-                  (static_cast<uint64_t>(b2.code())) * B28 |
-                  (static_cast<uint64_t>(d2)) * B16 |
-                  (static_cast<uint64_t>(r1.code())) * B12 |
-                  (static_cast<uint64_t>(op & 0x00FF));
-  emit6bytes(code);
-}
-
-// SS1 format: <insn> D1(L,B1),D2(B3)
-//    +--------+----+----+----+-------------+----+------------+
-//    | OpCode |    L    | B1 |     D1      | B2 |     D2     |
-//    +--------+----+----+----+-------------+----+------------+
-//    0        8    12   16   20            32   36          47
-#define SS1_FORM_EMIT(name, op)                                                \
-  void Assembler::name(Register b1, Disp d1, Register b2, Disp d2, Length l) { \
-    ss_form(op, l, b1, d1, b2, d2);                                            \
-  }                                                                            \
-  void Assembler::name(const MemOperand& opnd1, const MemOperand& opnd2,       \
-                       Length length) {                                        \
-    name(opnd1.getBaseRegister(), opnd1.getDisplacement(),                     \
-         opnd2.getBaseRegister(), opnd2.getDisplacement(), length);            \
-  }
-
-void Assembler::ss_form(Opcode op, Length l, Register b1, Disp d1, Register b2,
-                        Disp d2) {
-  DCHECK(is_uint12(d2));
-  DCHECK(is_uint12(d1));
-  DCHECK(is_uint8(op));
-  DCHECK(is_uint8(l));
-  uint64_t code =
-      (static_cast<uint64_t>(op)) * B40 | (static_cast<uint64_t>(l)) * B32 |
-      (static_cast<uint64_t>(b1.code())) * B28 |
-      (static_cast<uint64_t>(d1)) * B16 |
-      (static_cast<uint64_t>(b2.code())) * B12 | (static_cast<uint64_t>(d2));
-  emit6bytes(code);
-}
-
-// SS2 format: <insn> D1(L1,B1), D2(L3,B3)
-//    +--------+----+----+----+-------------+----+------------+
-//    | OpCode | L1 | L2 | B1 |     D1      | B2 |     D2     |
-//    +--------+----+----+----+-------------+----+------------+
-//    0        8    12   16   20            32   36          47
-#define SS2_FORM_EMIT(name, op)                                               \
-  void Assembler::name(Register b1, Disp d1, Register b2, Disp d2, Length l1, \
-                       Length l2) {                                           \
-    ss_form(op, l1, l2, b1, d1, b2, d2);                                      \
-  }                                                                           \
-  void Assembler::name(const MemOperand& opnd1, const MemOperand& opnd2,      \
-                       Length length1, Length length2) {                      \
-    name(opnd1.getBaseRegister(), opnd1.getDisplacement(),                    \
-         opnd2.getBaseRegister(), opnd2.getDisplacement(), length1, length2); \
-  }
-
-void Assembler::ss_form(Opcode op, Length l1, Length l2, Register b1, Disp d1,
-                        Register b2, Disp d2) {
-  DCHECK(is_uint12(d2));
-  DCHECK(is_uint12(d1));
-  DCHECK(is_uint8(op));
-  DCHECK(is_uint4(l2));
-  DCHECK(is_uint4(l1));
-  uint64_t code =
-      (static_cast<uint64_t>(op)) * B40 | (static_cast<uint64_t>(l1)) * B36 |
-      (static_cast<uint64_t>(l2)) * B32 |
-      (static_cast<uint64_t>(b1.code())) * B28 |
-      (static_cast<uint64_t>(d1)) * B16 |
-      (static_cast<uint64_t>(b2.code())) * B12 | (static_cast<uint64_t>(d2));
-  emit6bytes(code);
-}
-
-// SS3 format: <insn> D1(L1,B1), D2(I3,B2)
-//    +--------+----+----+----+-------------+----+------------+
-//    | OpCode | L1 | I3 | B1 |     D1      | B2 |     D2     |
-//    +--------+----+----+----+-------------+----+------------+
-//    0        8    12   16   20            32   36          47
-#define SS3_FORM_EMIT(name, op)                                              \
-  void Assembler::name(const Operand& i3, Register b1, Disp d1, Register b2, \
-                       Disp d2, Length l1) {                                 \
-    ss_form(op, l1, i3, b1, d1, b2, d2);                                     \
-  }                                                                          \
-  void Assembler::name(const MemOperand& opnd1, const MemOperand& opnd2,     \
-                       Length length) {                                      \
-    DCHECK(false);                                                           \
-  }
-void Assembler::ss_form(Opcode op, Length l1, const Operand& i3, Register b1,
-                        Disp d1, Register b2, Disp d2) {
-  DCHECK(is_uint12(d2));
-  DCHECK(is_uint12(d1));
-  DCHECK(is_uint8(op));
-  DCHECK(is_uint4(l1));
-  DCHECK(is_uint4(i3.immediate()));
-  uint64_t code =
-      (static_cast<uint64_t>(op)) * B40 | (static_cast<uint64_t>(l1)) * B36 |
-      (static_cast<uint64_t>(i3.immediate())) * B32 |
-      (static_cast<uint64_t>(b1.code())) * B28 |
-      (static_cast<uint64_t>(d1)) * B16 |
-      (static_cast<uint64_t>(b2.code())) * B12 | (static_cast<uint64_t>(d2));
-  emit6bytes(code);
-}
-
-// SS4 format: <insn> D1(R1,B1), D2(R3,B2)
-//    +--------+----+----+----+-------------+----+------------+
-//    | OpCode | R1 | R3 | B1 |     D1      | B2 |     D2     |
-//    +--------+----+----+----+-------------+----+------------+
-//    0        8    12   16   20            32   36          47
-#define SS4_FORM_EMIT(name, op)                                            \
-  void Assembler::name(Register r1, Register r3, Register b1, Disp d1,     \
-                       Register b2, Disp d2) {                             \
-    ss_form(op, r1, r3, b1, d1, b2, d2);                                   \
-  }                                                                        \
-  void Assembler::name(const MemOperand& opnd1, const MemOperand& opnd2) { \
-    DCHECK(false);                                                         \
-  }
-void Assembler::ss_form(Opcode op, Register r1, Register r3, Register b1,
-                        Disp d1, Register b2, Disp d2) {
-  DCHECK(is_uint12(d2));
-  DCHECK(is_uint12(d1));
-  DCHECK(is_uint8(op));
-  uint64_t code = (static_cast<uint64_t>(op)) * B40 |
-                  (static_cast<uint64_t>(r1.code())) * B36 |
-                  (static_cast<uint64_t>(r3.code())) * B32 |
-                  (static_cast<uint64_t>(b1.code())) * B28 |
-                  (static_cast<uint64_t>(d1)) * B16 |
-                  (static_cast<uint64_t>(b2.code())) * B12 |
-                  (static_cast<uint64_t>(d2));
-  emit6bytes(code);
-}
-
-// SS5 format: <insn> D1(R1,B1), D2(R3,B2)
-//    +--------+----+----+----+-------------+----+------------+
-//    | OpCode | R1 | R3 | B2 |     D2      | B4 |     D4     |
-//    +--------+----+----+----+-------------+----+------------+
-//    0        8    12   16   20            32   36          47
-#define SS5_FORM_EMIT(name, op)                                            \
-  void Assembler::name(Register r1, Register r3, Register b2, Disp d2,     \
-                       Register b4, Disp d4) {                             \
-    ss_form(op, r1, r3, b2, d2, b4, d4); /*SS5 use the same form as SS4*/  \
-  }                                                                        \
-  void Assembler::name(const MemOperand& opnd1, const MemOperand& opnd2) { \
-    DCHECK(false);                                                         \
-  }
-
-#define SS6_FORM_EMIT(name, op) SS1_FORM_EMIT(name, op)
-
-// SSE format: <insn> D1(B1),D2(B2)
-//    +------------------+----+-------------+----+------------+
-//    |      OpCode      | B1 |     D1      | B2 |     D2     |
-//    +------------------+----+-------------+----+------------+
-//    0        8    12   16   20            32   36           47
-#define SSE_FORM_EMIT(name, op)                                            \
-  void Assembler::name(Register b1, Disp d1, Register b2, Disp d2) {       \
-    sse_form(op, b1, d1, b2, d2);                                          \
-  }                                                                        \
-  void Assembler::name(const MemOperand& opnd1, const MemOperand& opnd2) { \
-    name(opnd1.getBaseRegister(), opnd1.getDisplacement(),                 \
-         opnd2.getBaseRegister(), opnd2.getDisplacement());                \
-  }
-void Assembler::sse_form(Opcode op, Register b1, Disp d1, Register b2,
-                         Disp d2) {
-  DCHECK(is_uint12(d2));
-  DCHECK(is_uint12(d1));
-  DCHECK(is_uint16(op));
-  uint64_t code = (static_cast<uint64_t>(op)) * B32 |
-                  (static_cast<uint64_t>(b1.code())) * B28 |
-                  (static_cast<uint64_t>(d1)) * B16 |
-                  (static_cast<uint64_t>(b2.code())) * B12 |
-                  (static_cast<uint64_t>(d2));
-  emit6bytes(code);
-}
-
-// SSF format: <insn> R3, D1(B1),D2(B2),R3
-//    +--------+----+----+----+-------------+----+------------+
-//    | OpCode | R3 |OpCd| B1 |     D1      | B2 |     D2     |
-//    +--------+----+----+----+-------------+----+------------+
-//    0        8    12   16   20            32   36           47
-#define SSF_FORM_EMIT(name, op)                                        \
-  void Assembler::name(Register r3, Register b1, Disp d1, Register b2, \
-                       Disp d2) {                                      \
-    ssf_form(op, r3, b1, d1, b2, d2);                                  \
-  }                                                                    \
-  void Assembler::name(Register r3, const MemOperand& opnd1,           \
-                       const MemOperand& opnd2) {                      \
-    name(r3, opnd1.getBaseRegister(), opnd1.getDisplacement(),         \
-         opnd2.getBaseRegister(), opnd2.getDisplacement());            \
-  }
-
-void Assembler::ssf_form(Opcode op, Register r3, Register b1, Disp d1,
-                         Register b2, Disp d2) {
-  DCHECK(is_uint12(d2));
-  DCHECK(is_uint12(d1));
-  DCHECK(is_uint12(op));
-  uint64_t code = (static_cast<uint64_t>(op & 0xFF0)) * B36 |
-                  (static_cast<uint64_t>(r3.code())) * B36 |
-                  (static_cast<uint64_t>(op & 0x00F)) * B32 |
-                  (static_cast<uint64_t>(b1.code())) * B28 |
-                  (static_cast<uint64_t>(d1)) * B16 |
-                  (static_cast<uint64_t>(b2.code())) * B12 |
-                  (static_cast<uint64_t>(d2));
-  emit6bytes(code);
-}
-
-//  RRF1 format: <insn> R1,R2,R3
-//    +------------------+----+----+----+----+
-//    |      OpCode      | R3 |    | R1 | R2 |
-//    +------------------+----+----+----+----+
-//    0                  16   20   24   28  31
-#define RRF1_FORM_EMIT(name, op)                                        \
-  void Assembler::name(Register r1, Register r2, Register r3) {         \
-    rrf1_form(op << 16 | r3.code() * B12 | r1.code() * B4 | r2.code()); \
-  }
-
-void Assembler::rrf1_form(Opcode op, Register r1, Register r2, Register r3) {
-  uint32_t code = op << 16 | r3.code() * B12 | r1.code() * B4 | r2.code();
-  emit4bytes(code);
-}
-
-void Assembler::rrf1_form(uint32_t code) { emit4bytes(code); }
-
-//  RRF2 format: <insn> R1,R2,M3
-//    +------------------+----+----+----+----+
-//    |      OpCode      | M3 |    | R1 | R2 |
-//    +------------------+----+----+----+----+
-//    0                  16   20   24   28  31
-#define RRF2_FORM_EMIT(name, op)                                 \
-  void Assembler::name(Condition m3, Register r1, Register r2) { \
-    rrf2_form(op << 16 | m3 * B12 | r1.code() * B4 | r2.code()); \
-  }
-
-void Assembler::rrf2_form(uint32_t code) { emit4bytes(code); }
-
-//  RRF3 format: <insn> R1,R2,R3,M4
-//    +------------------+----+----+----+----+
-//    |      OpCode      | R3 | M4 | R1 | R2 |
-//    +------------------+----+----+----+----+
-//    0                  16   20   24   28  31
-#define RRF3_FORM_EMIT(name, op)                                             \
-  void Assembler::name(Register r3, Conition m4, Register r1, Register r2) { \
-    rrf3_form(op << 16 | r3.code() * B12 | m4 * B8 | r1.code() * B4 |        \
-              r2.code());                                                    \
-  }
-
-void Assembler::rrf3_form(uint32_t code) { emit4bytes(code); }
-
-//  RRF-e format: <insn> R1,M3,R2,M4
-//    +------------------+----+----+----+----+
-//    |      OpCode      | M3 | M4 | R1 | R2 |
-//    +------------------+----+----+----+----+
-//    0                  16   20   24   28  31
-void Assembler::rrfe_form(Opcode op, Condition m3, Condition m4, Register r1,
-                          Register r2) {
-  uint32_t code = op << 16 | m3 * B12 | m4 * B8 | r1.code() * B4 | r2.code();
-  emit4bytes(code);
-}
-
-// end of S390 Instruction generation
-
-// start of S390 instruction
-SS1_FORM_EMIT(ed, ED)
-SS1_FORM_EMIT(mvn, MVN)
-SS1_FORM_EMIT(nc, NC)
-SI_FORM_EMIT(ni, NI)
-RI1_FORM_EMIT(nilh, NILH)
-RI1_FORM_EMIT(nill, NILL)
-RI1_FORM_EMIT(oill, OILL)
-RI1_FORM_EMIT(tmll, TMLL)
-SS1_FORM_EMIT(tr, TR)
-S_FORM_EMIT(ts, TS)
-
-// -------------------------
-// Load Address Instructions
-// -------------------------
-// Load Address Relative Long
-void Assembler::larl(Register r1, Label* l) {
-  larl(r1, Operand(branch_offset(l)));
-}
-
-// -----------------
-// Load Instructions
-// -----------------
-// Load Halfword Immediate (32)
-void Assembler::lhi(Register r, const Operand& imm) { ri_form(LHI, r, imm); }
-
-// Load Halfword Immediate (64)
-void Assembler::lghi(Register r, const Operand& imm) { ri_form(LGHI, r, imm); }
-
-// -------------------------
-// Load Logical Instructions
-// -------------------------
-// Load On Condition R-R (32)
-void Assembler::locr(Condition m3, Register r1, Register r2) {
-  rrf2_form(LOCR << 16 | m3 * B12 | r1.code() * B4 | r2.code());
-}
-
-// Load On Condition R-R (64)
-void Assembler::locgr(Condition m3, Register r1, Register r2) {
-  rrf2_form(LOCGR << 16 | m3 * B12 | r1.code() * B4 | r2.code());
-}
-
-// Load On Condition R-M (32)
-void Assembler::loc(Condition m3, Register r1, const MemOperand& src) {
-  rsy_form(LOC, r1, m3, src.rb(), src.offset());
-}
-
-// Load On Condition R-M (64)
-void Assembler::locg(Condition m3, Register r1, const MemOperand& src) {
-  rsy_form(LOCG, r1, m3, src.rb(), src.offset());
-}
-
-// -------------------
-// Branch Instructions
-// -------------------
-// Branch on Count (64)
-// Branch Relative and Save (32)
-void Assembler::bras(Register r, const Operand& opnd) {
-  ri_form(BRAS, r, opnd);
-}
-
-// Branch relative on Condition (32)
-void Assembler::brc(Condition c, const Operand& opnd) { ri_form(BRC, c, opnd); }
-
-// Branch On Count (32)
-void Assembler::brct(Register r1, const Operand& imm) {
-  // BRCT encodes # of halfwords, so divide by 2.
-  int16_t numHalfwords = static_cast<int16_t>(imm.immediate()) / 2;
-  Operand halfwordOp = Operand(numHalfwords);
-  halfwordOp.setBits(16);
-  ri_form(BRCT, r1, halfwordOp);
-}
-
-// Branch On Count (32)
-void Assembler::brctg(Register r1, const Operand& imm) {
-  // BRCTG encodes # of halfwords, so divide by 2.
-  int16_t numHalfwords = static_cast<int16_t>(imm.immediate()) / 2;
-  Operand halfwordOp = Operand(numHalfwords);
-  halfwordOp.setBits(16);
-  ri_form(BRCTG, r1, halfwordOp);
-}
-
-// --------------------
-// Compare Instructions
-// --------------------
-// Compare Halfword Immediate (32)
-void Assembler::chi(Register r, const Operand& opnd) { ri_form(CHI, r, opnd); }
-
-// Compare Halfword Immediate (64)
-void Assembler::cghi(Register r, const Operand& opnd) {
-  ri_form(CGHI, r, opnd);
-}
-
-// ----------------------------
-// Compare Logical Instructions
-// ----------------------------
-// Compare Immediate (Mem - Imm) (8)
-void Assembler::cli(const MemOperand& opnd, const Operand& imm) {
-  si_form(CLI, imm, opnd.rb(), opnd.offset());
-}
-
-// Compare Immediate (Mem - Imm) (8)
-void Assembler::cliy(const MemOperand& opnd, const Operand& imm) {
-  siy_form(CLIY, imm, opnd.rb(), opnd.offset());
-}
-
-// Compare logical - mem to mem operation
-void Assembler::clc(const MemOperand& opnd1, const MemOperand& opnd2,
-                    Length length) {
-  ss_form(CLC, length - 1, opnd1.getBaseRegister(), opnd1.getDisplacement(),
-          opnd2.getBaseRegister(), opnd2.getDisplacement());
-}
-
-// ----------------------------
-// Test Under Mask Instructions
-// ----------------------------
-// Test Under Mask (Mem - Imm) (8)
-void Assembler::tm(const MemOperand& opnd, const Operand& imm) {
-  si_form(TM, imm, opnd.rb(), opnd.offset());
-}
-
-// Test Under Mask (Mem - Imm) (8)
-void Assembler::tmy(const MemOperand& opnd, const Operand& imm) {
-  siy_form(TMY, imm, opnd.rb(), opnd.offset());
-}
-
-// -------------------------------
-// Rotate and Insert Selected Bits
-// -------------------------------
-// Rotate-And-Insert-Selected-Bits
-void Assembler::risbg(Register dst, Register src, const Operand& startBit,
-                      const Operand& endBit, const Operand& shiftAmt,
-                      bool zeroBits) {
-  // High tag the top bit of I4/EndBit to zero out any unselected bits
-  if (zeroBits)
-    rie_f_form(RISBG, dst, src, startBit, Operand(endBit.immediate() | 0x80),
-               shiftAmt);
-  else
-    rie_f_form(RISBG, dst, src, startBit, endBit, shiftAmt);
-}
-
-// Rotate-And-Insert-Selected-Bits
-void Assembler::risbgn(Register dst, Register src, const Operand& startBit,
-                       const Operand& endBit, const Operand& shiftAmt,
-                       bool zeroBits) {
-  // High tag the top bit of I4/EndBit to zero out any unselected bits
-  if (zeroBits)
-    rie_f_form(RISBGN, dst, src, startBit, Operand(endBit.immediate() | 0x80),
-               shiftAmt);
-  else
-    rie_f_form(RISBGN, dst, src, startBit, endBit, shiftAmt);
-}
-
-// ---------------------------
-// Move Character Instructions
-// ---------------------------
-// Move character - mem to mem operation
-void Assembler::mvc(const MemOperand& opnd1, const MemOperand& opnd2,
-                    uint32_t length) {
-  ss_form(MVC, length - 1, opnd1.getBaseRegister(), opnd1.getDisplacement(),
-          opnd2.getBaseRegister(), opnd2.getDisplacement());
-}
-
-// -----------------------
-// 32-bit Add Instructions
-// -----------------------
-// Add Halfword Immediate (32)
-void Assembler::ahi(Register r1, const Operand& i2) { ri_form(AHI, r1, i2); }
-
-// Add Halfword Immediate (32)
-void Assembler::ahik(Register r1, Register r3, const Operand& i2) {
-  rie_form(AHIK, r1, r3, i2);
-}
-
-// Add Register-Register-Register (32)
-void Assembler::ark(Register r1, Register r2, Register r3) {
-  rrf1_form(ARK, r1, r2, r3);
-}
-
-// Add Storage-Imm (32)
-void Assembler::asi(const MemOperand& opnd, const Operand& imm) {
-  DCHECK(is_int8(imm.immediate()));
-  DCHECK(is_int20(opnd.offset()));
-  siy_form(ASI, Operand(0xFF & imm.immediate()), opnd.rb(),
-           0xFFFFF & opnd.offset());
-}
-
-// -----------------------
-// 64-bit Add Instructions
-// -----------------------
-// Add Halfword Immediate (64)
-void Assembler::aghi(Register r1, const Operand& i2) { ri_form(AGHI, r1, i2); }
-
-// Add Halfword Immediate (64)
-void Assembler::aghik(Register r1, Register r3, const Operand& i2) {
-  rie_form(AGHIK, r1, r3, i2);
-}
-
-// Add Register-Register-Register (64)
-void Assembler::agrk(Register r1, Register r2, Register r3) {
-  rrf1_form(AGRK, r1, r2, r3);
-}
-
-// Add Storage-Imm (64)
-void Assembler::agsi(const MemOperand& opnd, const Operand& imm) {
-  DCHECK(is_int8(imm.immediate()));
-  DCHECK(is_int20(opnd.offset()));
-  siy_form(AGSI, Operand(0xFF & imm.immediate()), opnd.rb(),
-           0xFFFFF & opnd.offset());
-}
-
-// -------------------------------
-// 32-bit Add Logical Instructions
-// -------------------------------
-// Add Logical Register-Register-Register (32)
-void Assembler::alrk(Register r1, Register r2, Register r3) {
-  rrf1_form(ALRK, r1, r2, r3);
-}
-
-// -------------------------------
-// 64-bit Add Logical Instructions
-// -------------------------------
-// Add Logical Register-Register-Register (64)
-void Assembler::algrk(Register r1, Register r2, Register r3) {
-  rrf1_form(ALGRK, r1, r2, r3);
-}
-
-// ----------------------------
-// 32-bit Subtract Instructions
-// ----------------------------
-// Subtract Register-Register-Register (32)
-void Assembler::srk(Register r1, Register r2, Register r3) {
-  rrf1_form(SRK, r1, r2, r3);
-}
-
-// ----------------------------
-// 64-bit Subtract Instructions
-// ----------------------------
-// Subtract Register-Register-Register (64)
-void Assembler::sgrk(Register r1, Register r2, Register r3) {
-  rrf1_form(SGRK, r1, r2, r3);
-}
-
-// ------------------------------------
-// 32-bit Subtract Logical Instructions
-// ------------------------------------
-// Subtract Logical Register-Register-Register (32)
-void Assembler::slrk(Register r1, Register r2, Register r3) {
-  rrf1_form(SLRK, r1, r2, r3);
-}
-
-// ------------------------------------
-// 64-bit Subtract Logical Instructions
-// ------------------------------------
-// Subtract Logical Register-Register-Register (64)
-void Assembler::slgrk(Register r1, Register r2, Register r3) {
-  rrf1_form(SLGRK, r1, r2, r3);
-}
-
-// ----------------------------
-// 32-bit Multiply Instructions
-// ----------------------------
-// Multiply Halfword Immediate (32)
-void Assembler::mhi(Register r1, const Operand& opnd) {
-  ri_form(MHI, r1, opnd);
-}
-
-// Multiply Single Register (32)
-void Assembler::msrkc(Register r1, Register r2, Register r3) {
-  rrf1_form(MSRKC, r1, r2, r3);
-}
-
-// Multiply Single Register (64)
-void Assembler::msgrkc(Register r1, Register r2, Register r3) {
-  rrf1_form(MSGRKC, r1, r2, r3);
-}
-
-// ----------------------------
-// 64-bit Multiply Instructions
-// ----------------------------
-// Multiply Halfword Immediate (64)
-void Assembler::mghi(Register r1, const Operand& opnd) {
-  ri_form(MGHI, r1, opnd);
-}
-
-// --------------------
-// Bitwise Instructions
-// --------------------
-// AND Register-Register-Register (32)
-void Assembler::nrk(Register r1, Register r2, Register r3) {
-  rrf1_form(NRK, r1, r2, r3);
-}
-
-// AND Register-Register-Register (64)
-void Assembler::ngrk(Register r1, Register r2, Register r3) {
-  rrf1_form(NGRK, r1, r2, r3);
-}
-
-// OR Register-Register-Register (32)
-void Assembler::ork(Register r1, Register r2, Register r3) {
-  rrf1_form(ORK, r1, r2, r3);
-}
-
-// OR Register-Register-Register (64)
-void Assembler::ogrk(Register r1, Register r2, Register r3) {
-  rrf1_form(OGRK, r1, r2, r3);
-}
-
-// XOR Register-Register-Register (32)
-void Assembler::xrk(Register r1, Register r2, Register r3) {
-  rrf1_form(XRK, r1, r2, r3);
-}
-
-// XOR Register-Register-Register (64)
-void Assembler::xgrk(Register r1, Register r2, Register r3) {
-  rrf1_form(XGRK, r1, r2, r3);
-}
-
-// XOR Storage-Storage
-void Assembler::xc(const MemOperand& opnd1, const MemOperand& opnd2,
-                   Length length) {
-  ss_form(XC, length - 1, opnd1.getBaseRegister(), opnd1.getDisplacement(),
-          opnd2.getBaseRegister(), opnd2.getDisplacement());
-}
-
-void Assembler::EnsureSpaceFor(int space_needed) {
-  if (buffer_space() <= (kGap + space_needed)) {
-    GrowBuffer(space_needed);
-  }
-}
-
-// Rotate Left Single Logical (32)
-void Assembler::rll(Register r1, Register r3, Register opnd) {
-  DCHECK(opnd != r0);
-  rsy_form(RLL, r1, r3, opnd, 0);
-}
-
-// Rotate Left Single Logical (32)
-void Assembler::rll(Register r1, Register r3, const Operand& opnd) {
-  rsy_form(RLL, r1, r3, r0, opnd.immediate());
-}
-
-// Rotate Left Single Logical (32)
-void Assembler::rll(Register r1, Register r3, Register r2,
-                    const Operand& opnd) {
-  rsy_form(RLL, r1, r3, r2, opnd.immediate());
-}
-
-// Rotate Left Single Logical (64)
-void Assembler::rllg(Register r1, Register r3, Register opnd) {
-  DCHECK(opnd != r0);
-  rsy_form(RLLG, r1, r3, opnd, 0);
-}
-
-// Rotate Left Single Logical (64)
-void Assembler::rllg(Register r1, Register r3, const Operand& opnd) {
-  rsy_form(RLLG, r1, r3, r0, opnd.immediate());
-}
-
-// Rotate Left Single Logical (64)
-void Assembler::rllg(Register r1, Register r3, Register r2,
-                     const Operand& opnd) {
-  rsy_form(RLLG, r1, r3, r2, opnd.immediate());
-}
-
-// Shift Left Single Logical (32)
-void Assembler::sll(Register r1, Register opnd) {
-  DCHECK(opnd != r0);
-  rs_form(SLL, r1, r0, opnd, 0);
-}
-
-// Shift Left Single Logical (32)
-void Assembler::sll(Register r1, const Operand& opnd) {
-  rs_form(SLL, r1, r0, r0, opnd.immediate());
-}
-
-// Shift Left Single Logical (32)
-void Assembler::sllk(Register r1, Register r3, Register opnd) {
-  DCHECK(opnd != r0);
-  rsy_form(SLLK, r1, r3, opnd, 0);
-}
-
-// Shift Left Single Logical (32)
-void Assembler::sllk(Register r1, Register r3, const Operand& opnd) {
-  rsy_form(SLLK, r1, r3, r0, opnd.immediate());
-}
-
-// Shift Left Single Logical (64)
-void Assembler::sllg(Register r1, Register r3, Register opnd) {
-  DCHECK(opnd != r0);
-  rsy_form(SLLG, r1, r3, opnd, 0);
-}
-
-// Shift Left Single Logical (64)
-void Assembler::sllg(Register r1, Register r3, const Operand& opnd) {
-  rsy_form(SLLG, r1, r3, r0, opnd.immediate());
-}
-
-// Shift Left Double Logical (64)
-void Assembler::sldl(Register r1, Register b2, const Operand& opnd) {
-  DCHECK_EQ(r1.code() % 2, 0);
-  rs_form(SLDL, r1, r0, b2, opnd.immediate());
-}
-
-// Shift Right Single Logical (32)
-void Assembler::srl(Register r1, Register opnd) {
-  DCHECK(opnd != r0);
-  rs_form(SRL, r1, r0, opnd, 0);
-}
-
-// Shift Right Double Arith (64)
-void Assembler::srda(Register r1, Register b2, const Operand& opnd) {
-  DCHECK_EQ(r1.code() % 2, 0);
-  rs_form(SRDA, r1, r0, b2, opnd.immediate());
-}
-
-// Shift Right Double Logical (64)
-void Assembler::srdl(Register r1, Register b2, const Operand& opnd) {
-  DCHECK_EQ(r1.code() % 2, 0);
-  rs_form(SRDL, r1, r0, b2, opnd.immediate());
-}
-
-// Shift Right Single Logical (32)
-void Assembler::srl(Register r1, const Operand& opnd) {
-  rs_form(SRL, r1, r0, r0, opnd.immediate());
-}
-
-// Shift Right Single Logical (32)
-void Assembler::srlk(Register r1, Register r3, Register opnd) {
-  DCHECK(opnd != r0);
-  rsy_form(SRLK, r1, r3, opnd, 0);
-}
-
-// Shift Right Single Logical (32)
-void Assembler::srlk(Register r1, Register r3, const Operand& opnd) {
-  rsy_form(SRLK, r1, r3, r0, opnd.immediate());
-}
-
-// Shift Right Single Logical (64)
-void Assembler::srlg(Register r1, Register r3, Register opnd) {
-  DCHECK(opnd != r0);
-  rsy_form(SRLG, r1, r3, opnd, 0);
-}
-
-// Shift Right Single Logical (64)
-void Assembler::srlg(Register r1, Register r3, const Operand& opnd) {
-  rsy_form(SRLG, r1, r3, r0, opnd.immediate());
-}
-
-// Shift Left Single (32)
-void Assembler::sla(Register r1, Register opnd) {
-  DCHECK(opnd != r0);
-  rs_form(SLA, r1, r0, opnd, 0);
-}
-
-// Shift Left Single (32)
-void Assembler::sla(Register r1, const Operand& opnd) {
-  rs_form(SLA, r1, r0, r0, opnd.immediate());
-}
-
-// Shift Left Single (32)
-void Assembler::slak(Register r1, Register r3, Register opnd) {
-  DCHECK(opnd != r0);
-  rsy_form(SLAK, r1, r3, opnd, 0);
-}
-
-// Shift Left Single (32)
-void Assembler::slak(Register r1, Register r3, const Operand& opnd) {
-  rsy_form(SLAK, r1, r3, r0, opnd.immediate());
-}
-
-// Shift Left Single (64)
-void Assembler::slag(Register r1, Register r3, Register opnd) {
-  DCHECK(opnd != r0);
-  rsy_form(SLAG, r1, r3, opnd, 0);
-}
-
-// Shift Left Single (64)
-void Assembler::slag(Register r1, Register r3, const Operand& opnd) {
-  rsy_form(SLAG, r1, r3, r0, opnd.immediate());
-}
-
-// Shift Right Single (32)
-void Assembler::sra(Register r1, Register opnd) {
-  DCHECK(opnd != r0);
-  rs_form(SRA, r1, r0, opnd, 0);
-}
-
-// Shift Right Single (32)
-void Assembler::sra(Register r1, const Operand& opnd) {
-  rs_form(SRA, r1, r0, r0, opnd.immediate());
-}
-
-// Shift Right Single (32)
-void Assembler::srak(Register r1, Register r3, Register opnd) {
-  DCHECK(opnd != r0);
-  rsy_form(SRAK, r1, r3, opnd, 0);
-}
-
-// Shift Right Single (32)
-void Assembler::srak(Register r1, Register r3, const Operand& opnd) {
-  rsy_form(SRAK, r1, r3, r0, opnd.immediate());
-}
-
-// Shift Right Single (64)
-void Assembler::srag(Register r1, Register r3, Register opnd) {
-  DCHECK(opnd != r0);
-  rsy_form(SRAG, r1, r3, opnd, 0);
-}
-
-void Assembler::srag(Register r1, Register r3, const Operand& opnd) {
-  rsy_form(SRAG, r1, r3, r0, opnd.immediate());
-}
-
-// Shift Right Double
-void Assembler::srda(Register r1, const Operand& opnd) {
-  DCHECK_EQ(r1.code() % 2, 0);
-  rs_form(SRDA, r1, r0, r0, opnd.immediate());
-}
-
-// Shift Right Double Logical
-void Assembler::srdl(Register r1, const Operand& opnd) {
-  DCHECK_EQ(r1.code() % 2, 0);
-  rs_form(SRDL, r1, r0, r0, opnd.immediate());
-}
-
-void Assembler::call(Handle<Code> target, RelocInfo::Mode rmode) {
-  EnsureSpace ensure_space(this);
-
-  int32_t target_index = emit_code_target(target, rmode);
-  brasl(r14, Operand(target_index));
-}
-
-void Assembler::call(CodeStub* stub) {
-  EnsureSpace ensure_space(this);
-  RequestHeapObject(HeapObjectRequest(stub));
-  int32_t target_index =
-      emit_code_target(Handle<Code>(), RelocInfo::CODE_TARGET);
-  brasl(r14, Operand(target_index));
-}
-
-void Assembler::jump(Handle<Code> target, RelocInfo::Mode rmode,
-                     Condition cond) {
-  EnsureSpace ensure_space(this);
-
-  int32_t target_index = emit_code_target(target, rmode);
-  brcl(cond, Operand(target_index));
-}
-
-// 32-bit Load Multiple - short displacement (12-bits unsigned)
-void Assembler::lm(Register r1, Register r2, const MemOperand& src) {
-  rs_form(LM, r1, r2, src.rb(), src.offset());
-}
-
-// 32-bit Load Multiple - long displacement (20-bits signed)
-void Assembler::lmy(Register r1, Register r2, const MemOperand& src) {
-  rsy_form(LMY, r1, r2, src.rb(), src.offset());
-}
-
-// 64-bit Load Multiple - long displacement (20-bits signed)
-void Assembler::lmg(Register r1, Register r2, const MemOperand& src) {
-  rsy_form(LMG, r1, r2, src.rb(), src.offset());
-}
-
-// 32-bit Compare and Swap
-void Assembler::cs(Register r1, Register r2, const MemOperand& src) {
-  rs_form(CS, r1, r2, src.rb(), src.offset());
-}
-
-// 32-bit Compare and Swap
-void Assembler::csy(Register r1, Register r2, const MemOperand& src) {
-  rsy_form(CSY, r1, r2, src.rb(), src.offset());
-}
-
-// 64-bit Compare and Swap
-void Assembler::csg(Register r1, Register r2, const MemOperand& src) {
-  rsy_form(CSG, r1, r2, src.rb(), src.offset());
-}
-
-// Move integer (32)
-void Assembler::mvhi(const MemOperand& opnd1, const Operand& i2) {
-  sil_form(MVHI, opnd1.getBaseRegister(), opnd1.getDisplacement(), i2);
-}
-
-// Move integer (64)
-void Assembler::mvghi(const MemOperand& opnd1, const Operand& i2) {
-  sil_form(MVGHI, opnd1.getBaseRegister(), opnd1.getDisplacement(), i2);
-}
-
-// Insert Immediate (high high)
-void Assembler::iihh(Register r1, const Operand& opnd) {
-  ri_form(IIHH, r1, opnd);
-}
-
-// Insert Immediate (high low)
-void Assembler::iihl(Register r1, const Operand& opnd) {
-  ri_form(IIHL, r1, opnd);
-}
-
-// Insert Immediate (low high)
-void Assembler::iilh(Register r1, const Operand& opnd) {
-  ri_form(IILH, r1, opnd);
-}
-
-// Insert Immediate (low low)
-void Assembler::iill(Register r1, const Operand& opnd) {
-  ri_form(IILL, r1, opnd);
-}
-
-// GPR <-> FPR Instructions
-
-// Floating point instructions
-//
-// Add Register-Storage (LB)
-void Assembler::adb(DoubleRegister r1, const MemOperand& opnd) {
-  rxe_form(ADB, Register::from_code(r1.code()), opnd.rx(), opnd.rb(),
-           opnd.offset());
-}
-
-// Add Register-Storage (LB)
-void Assembler::aeb(DoubleRegister r1, const MemOperand& opnd) {
-  rxe_form(AEB, Register::from_code(r1.code()), opnd.rx(), opnd.rb(),
-           opnd.offset());
-}
-
-// Sub Register-Storage (LB)
-void Assembler::seb(DoubleRegister r1, const MemOperand& opnd) {
-  rxe_form(SEB, Register::from_code(r1.code()), opnd.rx(), opnd.rb(),
-           opnd.offset());
-}
-
-// Divide Register-Storage (LB)
-void Assembler::ddb(DoubleRegister r1, const MemOperand& opnd) {
-  rxe_form(DDB, Register::from_code(r1.code()), opnd.rx(), opnd.rb(),
-           opnd.offset());
-}
-
-// Divide Register-Storage (LB)
-void Assembler::deb(DoubleRegister r1, const MemOperand& opnd) {
-  rxe_form(DEB, Register::from_code(r1.code()), opnd.rx(), opnd.rb(),
-           opnd.offset());
-}
-
-// Multiply Register-Storage (LB)
-void Assembler::mdb(DoubleRegister r1, const MemOperand& opnd) {
-  rxe_form(MDB, Register::from_code(r1.code()), opnd.rb(), opnd.rx(),
-           opnd.offset());
-}
-
-// Multiply Register-Storage (LB)
-void Assembler::meeb(DoubleRegister r1, const MemOperand& opnd) {
-  rxe_form(MEEB, Register::from_code(r1.code()), opnd.rb(), opnd.rx(),
-           opnd.offset());
-}
-
-// Subtract Register-Storage (LB)
-void Assembler::sdb(DoubleRegister r1, const MemOperand& opnd) {
-  rxe_form(SDB, Register::from_code(r1.code()), opnd.rx(), opnd.rb(),
-           opnd.offset());
-}
-
-void Assembler::ceb(DoubleRegister r1, const MemOperand& opnd) {
-  rxe_form(CEB, Register::from_code(r1.code()), opnd.rx(), opnd.rb(),
-           opnd.offset());
-}
-
-void Assembler::cdb(DoubleRegister r1, const MemOperand& opnd) {
-  rxe_form(CDB, Register::from_code(r1.code()), opnd.rx(), opnd.rb(),
-           opnd.offset());
-}
-
-// Square Root (LB)
-void Assembler::sqdb(DoubleRegister r1, const MemOperand& opnd) {
-  rxe_form(SQDB, Register::from_code(r1.code()), opnd.rx(), opnd.rb(),
-           opnd.offset());
-}
-
-// Convert to Fixed point (64<-S)
-void Assembler::cgebr(Condition m, Register r1, DoubleRegister r2) {
-  rrfe_form(CGEBR, m, Condition(0), r1, Register::from_code(r2.code()));
-}
-
-// Convert to Fixed point (64<-L)
-void Assembler::cgdbr(Condition m, Register r1, DoubleRegister r2) {
-  rrfe_form(CGDBR, m, Condition(0), r1, Register::from_code(r2.code()));
-}
-
-// Convert to Fixed point (32<-L)
-void Assembler::cfdbr(Condition m, Register r1, DoubleRegister r2) {
-  rrfe_form(CFDBR, m, Condition(0), r1, Register::from_code(r2.code()));
-}
-
-// Convert to Fixed Logical (64<-L)
-void Assembler::clgdbr(Condition m3, Condition m4, Register r1,
-                       DoubleRegister r2) {
-  DCHECK_EQ(m4, Condition(0));
-  rrfe_form(CLGDBR, m3, m4, r1, Register::from_code(r2.code()));
-}
-
-// Convert to Fixed Logical (64<-F32)
-void Assembler::clgebr(Condition m3, Condition m4, Register r1,
-                       DoubleRegister r2) {
-  DCHECK_EQ(m4, Condition(0));
-  rrfe_form(CLGEBR, m3, m4, r1, Register::from_code(r2.code()));
-}
-
-// Convert to Fixed Logical (32<-F64)
-void Assembler::clfdbr(Condition m3, Condition m4, Register r1,
-                       DoubleRegister r2) {
-  DCHECK_EQ(m4, Condition(0));
-  rrfe_form(CLFDBR, m3, Condition(0), r1, Register::from_code(r2.code()));
-}
-
-// Convert to Fixed Logical (32<-F32)
-void Assembler::clfebr(Condition m3, Condition m4, Register r1,
-                       DoubleRegister r2) {
-  DCHECK_EQ(m4, Condition(0));
-  rrfe_form(CLFEBR, m3, Condition(0), r1, Register::from_code(r2.code()));
-}
-
-// Convert from Fixed Logical (L<-64)
-void Assembler::celgbr(Condition m3, Condition m4, DoubleRegister r1,
-                       Register r2) {
-  DCHECK_EQ(m3, Condition(0));
-  DCHECK_EQ(m4, Condition(0));
-  rrfe_form(CELGBR, Condition(0), Condition(0), Register::from_code(r1.code()),
-            r2);
-}
-
-// Convert from Fixed Logical (F32<-32)
-void Assembler::celfbr(Condition m3, Condition m4, DoubleRegister r1,
-                       Register r2) {
-  DCHECK_EQ(m4, Condition(0));
-  rrfe_form(CELFBR, m3, Condition(0), Register::from_code(r1.code()), r2);
-}
-
-// Convert from Fixed Logical (L<-64)
-void Assembler::cdlgbr(Condition m3, Condition m4, DoubleRegister r1,
-                       Register r2) {
-  DCHECK_EQ(m3, Condition(0));
-  DCHECK_EQ(m4, Condition(0));
-  rrfe_form(CDLGBR, Condition(0), Condition(0), Register::from_code(r1.code()),
-            r2);
-}
-
-// Convert from Fixed Logical (L<-32)
-void Assembler::cdlfbr(Condition m3, Condition m4, DoubleRegister r1,
-                       Register r2) {
-  DCHECK_EQ(m4, Condition(0));
-  rrfe_form(CDLFBR, m3, Condition(0), Register::from_code(r1.code()), r2);
-}
-
-// Convert from Fixed point (S<-32)
-void Assembler::cefbr(Condition m3, DoubleRegister r1, Register r2) {
-  rrfe_form(CEFBR, m3, Condition(0), Register::from_code(r1.code()), r2);
-}
-
-// Convert to Fixed point (32<-S)
-void Assembler::cfebr(Condition m3, Register r1, DoubleRegister r2) {
-  rrfe_form(CFEBR, m3, Condition(0), r1, Register::from_code(r2.code()));
-}
-
-// Load (L <- S)
-void Assembler::ldeb(DoubleRegister d1, const MemOperand& opnd) {
-  rxe_form(LDEB, Register::from_code(d1.code()), opnd.rx(), opnd.rb(),
-           opnd.offset());
-}
-
-// Load FP Integer
-void Assembler::fiebra(DoubleRegister d1, DoubleRegister d2, FIDBRA_MASK3 m3) {
-  rrf2_form(FIEBRA << 16 | m3 * B12 | d1.code() * B4 | d2.code());
-}
-
-// Load FP Integer
-void Assembler::fidbra(DoubleRegister d1, DoubleRegister d2, FIDBRA_MASK3 m3) {
-  rrf2_form(FIDBRA << 16 | m3 * B12 | d1.code() * B4 | d2.code());
-}
-
-// end of S390instructions
-
-bool Assembler::IsNop(SixByteInstr instr, int type) {
-  DCHECK((0 == type) || (DEBUG_BREAK_NOP == type));
-  if (DEBUG_BREAK_NOP == type) {
-    return ((instr & 0xFFFFFFFF) == 0xA53B0000);  // oill r3, 0
-  }
-  return ((instr & 0xFFFF) == 0x1800);  // lr r0,r0
-}
-
-// dummy instruction reserved for special use.
-void Assembler::dumy(int r1, int x2, int b2, int d2) {
-#if defined(USE_SIMULATOR)
-  int op = 0xE353;
-  uint64_t code = (static_cast<uint64_t>(op & 0xFF00)) * B32 |
-                  (static_cast<uint64_t>(r1) & 0xF) * B36 |
-                  (static_cast<uint64_t>(x2) & 0xF) * B32 |
-                  (static_cast<uint64_t>(b2) & 0xF) * B28 |
-                  (static_cast<uint64_t>(d2 & 0x0FFF)) * B16 |
-                  (static_cast<uint64_t>(d2 & 0x0FF000)) >> 4 |
-                  (static_cast<uint64_t>(op & 0x00FF));
-  emit6bytes(code);
-#endif
-}
-
-void Assembler::GrowBuffer(int needed) {
-  if (!own_buffer_) FATAL("external code buffer is too small");
-
-  // Compute new buffer size.
-  CodeDesc desc;  // the new buffer
-  if (buffer_size_ < 4 * KB) {
-    desc.buffer_size = 4 * KB;
-  } else if (buffer_size_ < 1 * MB) {
-    desc.buffer_size = 2 * buffer_size_;
-  } else {
-    desc.buffer_size = buffer_size_ + 1 * MB;
-  }
-  int space = buffer_space() + (desc.buffer_size - buffer_size_);
-  if (space < needed) {
-    desc.buffer_size += needed - space;
-  }
-
-  // Some internal data structures overflow for very large buffers,
-  // they must ensure that kMaximalBufferSize is not too large.
-  if (desc.buffer_size > kMaximalBufferSize) {
-    V8::FatalProcessOutOfMemory("Assembler::GrowBuffer");
-  }
-
-  // Set up new buffer.
-  desc.buffer = NewArray<byte>(desc.buffer_size);
-  desc.origin = this;
-
-  desc.instr_size = pc_offset();
-  desc.reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos();
-
-  // Copy the data.
-  intptr_t pc_delta = desc.buffer - buffer_;
-  intptr_t rc_delta =
-      (desc.buffer + desc.buffer_size) - (buffer_ + buffer_size_);
-  memmove(desc.buffer, buffer_, desc.instr_size);
-  memmove(reloc_info_writer.pos() + rc_delta, reloc_info_writer.pos(),
-          desc.reloc_size);
-
-  // Switch buffers.
-  DeleteArray(buffer_);
-  buffer_ = desc.buffer;
-  buffer_size_ = desc.buffer_size;
-  pc_ += pc_delta;
-  reloc_info_writer.Reposition(reloc_info_writer.pos() + rc_delta,
-                               reloc_info_writer.last_pc() + pc_delta);
-
-  // None of our relocation types are pc relative pointing outside the code
-  // buffer nor pc absolute pointing inside the code buffer, so there is no need
-  // to relocate any emitted relocation entries.
-}
-
-void Assembler::db(uint8_t data) {
-  CheckBuffer();
-  *reinterpret_cast<uint8_t*>(pc_) = data;
-  pc_ += sizeof(uint8_t);
-}
-
-void Assembler::dd(uint32_t data) {
-  CheckBuffer();
-  *reinterpret_cast<uint32_t*>(pc_) = data;
-  pc_ += sizeof(uint32_t);
-}
-
-void Assembler::dq(uint64_t value) {
-  CheckBuffer();
-  *reinterpret_cast<uint64_t*>(pc_) = value;
-  pc_ += sizeof(uint64_t);
-}
-
-void Assembler::dp(uintptr_t data) {
-  CheckBuffer();
-  *reinterpret_cast<uintptr_t*>(pc_) = data;
-  pc_ += sizeof(uintptr_t);
-}
-
-void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
-  if (RelocInfo::IsNone(rmode) ||
-      // Don't record external references unless the heap will be serialized.
-      (rmode == RelocInfo::EXTERNAL_REFERENCE && !serializer_enabled() &&
-       !emit_debug_code())) {
-    return;
-  }
-  DeferredRelocInfo rinfo(pc_offset(), rmode, data);
-  relocations_.push_back(rinfo);
-}
-
-void Assembler::emit_label_addr(Label* label) {
-  CheckBuffer();
-  RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE);
-  int position = link(label);
-  DCHECK(label->is_bound());
-  // Keep internal references relative until EmitRelocations.
-  dp(position);
-}
-
-void Assembler::EmitRelocations() {
-  EnsureSpaceFor(relocations_.size() * kMaxRelocSize);
-
-  for (std::vector<DeferredRelocInfo>::iterator it = relocations_.begin();
-       it != relocations_.end(); it++) {
-    RelocInfo::Mode rmode = it->rmode();
-    Address pc = buffer_ + it->position();
-    RelocInfo rinfo(pc, rmode, it->data(), nullptr);
-
-    // Fix up internal references now that they are guaranteed to be bound.
-    if (RelocInfo::IsInternalReference(rmode)) {
-      // Jump table entry
-      intptr_t pos = reinterpret_cast<intptr_t>(Memory::Address_at(pc));
-      Memory::Address_at(pc) = buffer_ + pos;
-    } else if (RelocInfo::IsInternalReferenceEncoded(rmode)) {
-      // mov sequence
-      intptr_t pos = reinterpret_cast<intptr_t>(target_address_at(pc, nullptr));
-      set_target_address_at(nullptr, pc, nullptr, buffer_ + pos,
-                            SKIP_ICACHE_FLUSH);
-    }
-
-    reloc_info_writer.Write(&rinfo);
-  }
-}
-
-}  // namespace internal
-}  // namespace v8
-#endif  // V8_TARGET_ARCH_S390
diff --git a/src/v8/src/s390/assembler-s390.h b/src/v8/src/s390/assembler-s390.h
deleted file mode 100644
index 4a5945d..0000000
--- a/src/v8/src/s390/assembler-s390.h
+++ /dev/null
@@ -1,1606 +0,0 @@
-// Copyright (c) 1994-2006 Sun Microsystems Inc.
-// 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.
-//
-// - Redistribution 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 Sun Microsystems or the names of 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.
-
-// The original source code covered by the above license above has been
-// modified significantly by Google Inc.
-// Copyright 2014 the V8 project authors. All rights reserved.
-
-// A light-weight S390 Assembler
-// Generates user mode instructions for z/Architecture
-
-#ifndef V8_S390_ASSEMBLER_S390_H_
-#define V8_S390_ASSEMBLER_S390_H_
-#include <stdio.h>
-#if V8_HOST_ARCH_S390
-// elf.h include is required for auxv check for STFLE facility used
-// for hardware detection, which is sensible only on s390 hosts.
-#include <elf.h>
-#endif
-
-#include <fcntl.h>
-#include <unistd.h>
-#include <vector>
-
-#include "src/assembler.h"
-#include "src/s390/constants-s390.h"
-
-#define ABI_USES_FUNCTION_DESCRIPTORS 0
-
-#define ABI_PASSES_HANDLES_IN_REGS 1
-
-// ObjectPair is defined under runtime/runtime-util.h.
-// On 31-bit, ObjectPair == uint64_t.  ABI dictates long long
-//            be returned with the lower addressed half in r2
-//            and the higher addressed half in r3. (Returns in Regs)
-// On 64-bit, ObjectPair is a Struct.  ABI dictaes Structs be
-//            returned in a storage buffer allocated by the caller,
-//            with the address of this buffer passed as a hidden
-//            argument in r2. (Does NOT return in Regs)
-// For x86 linux, ObjectPair is returned in registers.
-#if V8_TARGET_ARCH_S390X
-#define ABI_RETURNS_OBJECTPAIR_IN_REGS 0
-#else
-#define ABI_RETURNS_OBJECTPAIR_IN_REGS 1
-#endif
-
-#define ABI_CALL_VIA_IP 1
-
-#define INSTR_AND_DATA_CACHE_COHERENCY LWSYNC
-
-namespace v8 {
-namespace internal {
-
-// clang-format off
-#define GENERAL_REGISTERS(V)                              \
-  V(r0)  V(r1)  V(r2)  V(r3)  V(r4)  V(r5)  V(r6)  V(r7)  \
-  V(r8)  V(r9)  V(r10) V(fp) V(ip) V(r13) V(r14) V(sp)
-
-#define ALLOCATABLE_GENERAL_REGISTERS(V)                  \
-  V(r2)  V(r3)  V(r4)  V(r5)  V(r6)  V(r7)                \
-  V(r8)  V(r9)  V(r13)
-
-#define DOUBLE_REGISTERS(V)                               \
-  V(d0)  V(d1)  V(d2)  V(d3)  V(d4)  V(d5)  V(d6)  V(d7)  \
-  V(d8)  V(d9)  V(d10) V(d11) V(d12) V(d13) V(d14) V(d15)
-
-#define FLOAT_REGISTERS DOUBLE_REGISTERS
-#define SIMD128_REGISTERS DOUBLE_REGISTERS
-
-#define ALLOCATABLE_DOUBLE_REGISTERS(V)                   \
-  V(d1)  V(d2)  V(d3)  V(d4)  V(d5)  V(d6)  V(d7)         \
-  V(d8)  V(d9)  V(d10) V(d11) V(d12) V(d15) V(d0)
-
-#define C_REGISTERS(V)                                            \
-  V(cr0)  V(cr1)  V(cr2)  V(cr3)  V(cr4)  V(cr5)  V(cr6)  V(cr7)  \
-  V(cr8)  V(cr9)  V(cr10) V(cr11) V(cr12) V(cr15)
-// clang-format on
-
-// Register list in load/store instructions
-// Note that the bit values must match those used in actual instruction encoding
-const int kNumRegs = 16;
-
-// Caller-saved/arguments registers
-const RegList kJSCallerSaved = 1 << 1 | 1 << 2 |  // r2  a1
-                               1 << 3 |           // r3  a2
-                               1 << 4 |           // r4  a3
-                               1 << 5;            // r5  a4
-
-const int kNumJSCallerSaved = 5;
-
-// Callee-saved registers preserved when switching from C to JavaScript
-const RegList kCalleeSaved =
-    1 << 6 |   // r6 (argument passing in CEntryStub)
-               //    (HandleScope logic in MacroAssembler)
-    1 << 7 |   // r7 (argument passing in CEntryStub)
-               //    (HandleScope logic in MacroAssembler)
-    1 << 8 |   // r8 (argument passing in CEntryStub)
-               //    (HandleScope logic in MacroAssembler)
-    1 << 9 |   // r9 (HandleScope logic in MacroAssembler)
-    1 << 10 |  // r10 (Roots register in Javascript)
-    1 << 11 |  // r11 (fp in Javascript)
-    1 << 12 |  // r12 (ip in Javascript)
-    1 << 13;   // r13 (cp in Javascript)
-// 1 << 15;   // r15 (sp in Javascript)
-
-const int kNumCalleeSaved = 8;
-
-#ifdef V8_TARGET_ARCH_S390X
-
-const RegList kCallerSavedDoubles = 1 << 0 |  // d0
-                                    1 << 1 |  // d1
-                                    1 << 2 |  // d2
-                                    1 << 3 |  // d3
-                                    1 << 4 |  // d4
-                                    1 << 5 |  // d5
-                                    1 << 6 |  // d6
-                                    1 << 7;   // d7
-
-const int kNumCallerSavedDoubles = 8;
-
-const RegList kCalleeSavedDoubles = 1 << 8 |   // d8
-                                    1 << 9 |   // d9
-                                    1 << 10 |  // d10
-                                    1 << 11 |  // d11
-                                    1 << 12 |  // d12
-                                    1 << 13 |  // d12
-                                    1 << 14 |  // d12
-                                    1 << 15;   // d13
-
-const int kNumCalleeSavedDoubles = 8;
-
-#else
-
-const RegList kCallerSavedDoubles = 1 << 14 |  // d14
-                                    1 << 15 |  // d15
-                                    1 << 0 |   // d0
-                                    1 << 1 |   // d1
-                                    1 << 2 |   // d2
-                                    1 << 3 |   // d3
-                                    1 << 5 |   // d5
-                                    1 << 7 |   // d7
-                                    1 << 8 |   // d8
-                                    1 << 9 |   // d9
-                                    1 << 10 |  // d10
-                                    1 << 11 |  // d10
-                                    1 << 12 |  // d10
-                                    1 << 13;   // d11
-
-const int kNumCallerSavedDoubles = 14;
-
-const RegList kCalleeSavedDoubles = 1 << 4 |  // d4
-                                    1 << 6;   // d6
-
-const int kNumCalleeSavedDoubles = 2;
-
-#endif
-
-// Number of registers for which space is reserved in safepoints. Must be a
-// multiple of 8.
-// TODO(regis): Only 8 registers may actually be sufficient. Revisit.
-const int kNumSafepointRegisters = 16;
-
-// Define the list of registers actually saved at safepoints.
-// Note that the number of saved registers may be smaller than the reserved
-// space, i.e. kNumSafepointSavedRegisters <= kNumSafepointRegisters.
-const RegList kSafepointSavedRegisters = kJSCallerSaved | kCalleeSaved;
-const int kNumSafepointSavedRegisters = kNumJSCallerSaved + kNumCalleeSaved;
-
-// The following constants describe the stack frame linkage area as
-// defined by the ABI.
-
-#if V8_TARGET_ARCH_S390X
-// [0] Back Chain
-// [1] Reserved for compiler use
-// [2] GPR 2
-// [3] GPR 3
-// ...
-// [15] GPR 15
-// [16] FPR 0
-// [17] FPR 2
-// [18] FPR 4
-// [19] FPR 6
-const int kNumRequiredStackFrameSlots = 20;
-const int kStackFrameRASlot = 14;
-const int kStackFrameSPSlot = 15;
-const int kStackFrameExtraParamSlot = 20;
-#else
-// [0] Back Chain
-// [1] Reserved for compiler use
-// [2] GPR 2
-// [3] GPR 3
-// ...
-// [15] GPR 15
-// [16..17] FPR 0
-// [18..19] FPR 2
-// [20..21] FPR 4
-// [22..23] FPR 6
-const int kNumRequiredStackFrameSlots = 24;
-const int kStackFrameRASlot = 14;
-const int kStackFrameSPSlot = 15;
-const int kStackFrameExtraParamSlot = 24;
-#endif
-
-// zLinux ABI requires caller frames to include sufficient space for
-// callee preserved register save area.
-#if V8_TARGET_ARCH_S390X
-const int kCalleeRegisterSaveAreaSize = 160;
-#elif V8_TARGET_ARCH_S390
-const int kCalleeRegisterSaveAreaSize = 96;
-#else
-const int kCalleeRegisterSaveAreaSize = 0;
-#endif
-
-enum RegisterCode {
-#define REGISTER_CODE(R) kRegCode_##R,
-  GENERAL_REGISTERS(REGISTER_CODE)
-#undef REGISTER_CODE
-      kRegAfterLast
-};
-
-class Register : public RegisterBase<Register, kRegAfterLast> {
- public:
-#if V8_TARGET_LITTLE_ENDIAN
-  static constexpr int kMantissaOffset = 0;
-  static constexpr int kExponentOffset = 4;
-#else
-  static constexpr int kMantissaOffset = 4;
-  static constexpr int kExponentOffset = 0;
-#endif
-
- private:
-  friend class RegisterBase;
-  explicit constexpr Register(int code) : RegisterBase(code) {}
-};
-
-static_assert(IS_TRIVIALLY_COPYABLE(Register) &&
-                  sizeof(Register) == sizeof(int),
-              "Register can efficiently be passed by value");
-
-#define DEFINE_REGISTER(R) \
-  constexpr Register R = Register::from_code<kRegCode_##R>();
-GENERAL_REGISTERS(DEFINE_REGISTER)
-#undef DEFINE_REGISTER
-constexpr Register no_reg = Register::no_reg();
-
-// Register aliases
-constexpr Register kLithiumScratch = r1;  // lithium scratch.
-constexpr Register kRootRegister = r10;   // Roots array pointer.
-constexpr Register cp = r13;              // JavaScript context pointer.
-
-constexpr bool kPadArguments = false;
-constexpr bool kSimpleFPAliasing = true;
-constexpr bool kSimdMaskRegisters = false;
-
-enum DoubleRegisterCode {
-#define REGISTER_CODE(R) kDoubleCode_##R,
-  DOUBLE_REGISTERS(REGISTER_CODE)
-#undef REGISTER_CODE
-      kDoubleAfterLast
-};
-
-// Double word VFP register.
-class DoubleRegister : public RegisterBase<DoubleRegister, kDoubleAfterLast> {
- public:
-  // A few double registers are reserved: one as a scratch register and one to
-  // hold 0.0, that does not fit in the immediate field of vmov instructions.
-  // d14: 0.0
-  // d15: scratch register.
-  static constexpr int kSizeInBytes = 8;
-  inline static int NumRegisters();
-
- private:
-  friend class RegisterBase;
-
-  explicit constexpr DoubleRegister(int code) : RegisterBase(code) {}
-};
-
-static_assert(IS_TRIVIALLY_COPYABLE(DoubleRegister) &&
-                  sizeof(DoubleRegister) == sizeof(int),
-              "DoubleRegister can efficiently be passed by value");
-
-typedef DoubleRegister FloatRegister;
-
-// TODO(john.yan) Define SIMD registers.
-typedef DoubleRegister Simd128Register;
-
-#define DEFINE_REGISTER(R) \
-  constexpr DoubleRegister R = DoubleRegister::from_code<kDoubleCode_##R>();
-DOUBLE_REGISTERS(DEFINE_REGISTER)
-#undef DEFINE_REGISTER
-constexpr DoubleRegister no_dreg = DoubleRegister::no_reg();
-
-constexpr DoubleRegister kDoubleRegZero = d14;
-constexpr DoubleRegister kScratchDoubleReg = d13;
-
-Register ToRegister(int num);
-
-enum CRegisterCode {
-#define REGISTER_CODE(R) kCCode_##R,
-  C_REGISTERS(REGISTER_CODE)
-#undef REGISTER_CODE
-      kCAfterLast
-};
-
-// Coprocessor register
-class CRegister : public RegisterBase<CRegister, kCAfterLast> {
-  friend class RegisterBase;
-  explicit constexpr CRegister(int code) : RegisterBase(code) {}
-};
-
-constexpr CRegister no_creg = CRegister::no_reg();
-#define DECLARE_C_REGISTER(R) \
-  constexpr CRegister R = CRegister::from_code<kCCode_##R>();
-C_REGISTERS(DECLARE_C_REGISTER)
-#undef DECLARE_C_REGISTER
-
-// -----------------------------------------------------------------------------
-// Machine instruction Operands
-
-#if V8_TARGET_ARCH_S390X
-constexpr RelocInfo::Mode kRelocInfo_NONEPTR = RelocInfo::NONE64;
-#else
-constexpr RelocInfo::Mode kRelocInfo_NONEPTR = RelocInfo::NONE32;
-#endif
-
-// Class Operand represents a shifter operand in data processing instructions
-// defining immediate numbers and masks
-typedef uint8_t Length;
-
-struct Mask {
-  uint8_t mask;
-  uint8_t value() { return mask; }
-  static Mask from_value(uint8_t input) {
-    DCHECK_LE(input, 0x0F);
-    Mask m = {input};
-    return m;
-  }
-};
-
-class Operand BASE_EMBEDDED {
- public:
-  // immediate
-  INLINE(explicit Operand(intptr_t immediate,
-                          RelocInfo::Mode rmode = kRelocInfo_NONEPTR)
-         : rmode_(rmode)) {
-    value_.immediate = immediate;
-  }
-  INLINE(static Operand Zero()) { return Operand(static_cast<intptr_t>(0)); }
-  INLINE(explicit Operand(const ExternalReference& f)
-         : rmode_(RelocInfo::EXTERNAL_REFERENCE)) {
-    value_.immediate = reinterpret_cast<intptr_t>(f.address());
-  }
-  explicit Operand(Handle<HeapObject> handle);
-  INLINE(explicit Operand(Smi* value) : rmode_(kRelocInfo_NONEPTR)) {
-    value_.immediate = reinterpret_cast<intptr_t>(value);
-  }
-
-  // rm
-  INLINE(explicit Operand(Register rm));
-
-  static Operand EmbeddedNumber(double value);  // Smi or HeapNumber
-
-  // Return true if this is a register operand.
-  INLINE(bool is_reg() const) { return rm_.is_valid(); }
-
-  bool must_output_reloc_info(const Assembler* assembler) const;
-
-  inline intptr_t immediate() const {
-    DCHECK(!rm_.is_valid());
-    DCHECK(!is_heap_object_request());
-    return value_.immediate;
-  }
-
-  HeapObjectRequest heap_object_request() const {
-    DCHECK(is_heap_object_request());
-    return value_.heap_object_request;
-  }
-
-  inline void setBits(int n) {
-    value_.immediate =
-        (static_cast<uint32_t>(value_.immediate) << (32 - n)) >> (32 - n);
-  }
-
-  Register rm() const { return rm_; }
-
-  bool is_heap_object_request() const {
-    DCHECK_IMPLIES(is_heap_object_request_, !rm_.is_valid());
-    DCHECK_IMPLIES(is_heap_object_request_,
-                   rmode_ == RelocInfo::EMBEDDED_OBJECT ||
-                       rmode_ == RelocInfo::CODE_TARGET);
-    return is_heap_object_request_;
-  }
-
-  RelocInfo::Mode rmode() const { return rmode_; }
-
- private:
-  Register rm_ = no_reg;
-  union Value {
-    Value() {}
-    HeapObjectRequest heap_object_request;  // if is_heap_object_request_
-    intptr_t immediate;                     // otherwise
-  } value_;                                 // valid if rm_ == no_reg
-  bool is_heap_object_request_ = false;
-
-  RelocInfo::Mode rmode_;
-
-  friend class Assembler;
-  friend class MacroAssembler;
-};
-
-typedef int32_t Disp;
-
-// Class MemOperand represents a memory operand in load and store instructions
-// On S390, we have various flavours of memory operands:
-//   1) a base register + 16 bit unsigned displacement
-//   2) a base register + index register + 16 bit unsigned displacement
-//   3) a base register + index register + 20 bit signed displacement
-class MemOperand BASE_EMBEDDED {
- public:
-  explicit MemOperand(Register rx, Disp offset = 0);
-  explicit MemOperand(Register rx, Register rb, Disp offset = 0);
-
-  int32_t offset() const { return offset_; }
-  uint32_t getDisplacement() const { return offset(); }
-
-  // Base register
-  Register rb() const {
-    DCHECK(baseRegister != no_reg);
-    return baseRegister;
-  }
-
-  Register getBaseRegister() const { return rb(); }
-
-  // Index Register
-  Register rx() const {
-    DCHECK(indexRegister != no_reg);
-    return indexRegister;
-  }
-  Register getIndexRegister() const { return rx(); }
-
- private:
-  Register baseRegister;   // base
-  Register indexRegister;  // index
-  int32_t offset_;         // offset
-
-  friend class Assembler;
-};
-
-class DeferredRelocInfo {
- public:
-  DeferredRelocInfo() {}
-  DeferredRelocInfo(int position, RelocInfo::Mode rmode, intptr_t data)
-      : position_(position), rmode_(rmode), data_(data) {}
-
-  int position() const { return position_; }
-  RelocInfo::Mode rmode() const { return rmode_; }
-  intptr_t data() const { return data_; }
-
- private:
-  int position_;
-  RelocInfo::Mode rmode_;
-  intptr_t data_;
-};
-
-class Assembler : public AssemblerBase {
- public:
-  // Create an assembler. Instructions and relocation information are emitted
-  // into a buffer, with the instructions starting from the beginning and the
-  // relocation information starting from the end of the buffer. See CodeDesc
-  // for a detailed comment on the layout (globals.h).
-  //
-  // If the provided buffer is nullptr, the assembler allocates and grows its
-  // own buffer, and buffer_size determines the initial buffer size. The buffer
-  // is owned by the assembler and deallocated upon destruction of the
-  // assembler.
-  //
-  // If the provided buffer is not nullptr, the assembler uses the provided
-  // buffer for code generation and assumes its size to be buffer_size. If the
-  // buffer is too small, a fatal error occurs. No deallocation of the buffer is
-  // done upon destruction of the assembler.
-  Assembler(Isolate* isolate, void* buffer, int buffer_size)
-      : Assembler(IsolateData(isolate), buffer, buffer_size) {}
-  Assembler(IsolateData isolate_data, void* buffer, int buffer_size);
-  virtual ~Assembler() {}
-
-  // GetCode emits any pending (non-emitted) code and fills the descriptor
-  // desc. GetCode() is idempotent; it returns the same result if no other
-  // Assembler functions are invoked in between GetCode() calls.
-  void GetCode(Isolate* isolate, CodeDesc* desc);
-
-  // Label operations & relative jumps (PPUM Appendix D)
-  //
-  // Takes a branch opcode (cc) and a label (L) and generates
-  // either a backward branch or a forward branch and links it
-  // to the label fixup chain. Usage:
-  //
-  // Label L;    // unbound label
-  // j(cc, &L);  // forward branch to unbound label
-  // bind(&L);   // bind label to the current pc
-  // j(cc, &L);  // backward branch to bound label
-  // bind(&L);   // illegal: a label may be bound only once
-  //
-  // Note: The same Label can be used for forward and backward branches
-  // but it may be bound only once.
-
-  void bind(Label* L);  // binds an unbound label L to the current code position
-
-  // Links a label at the current pc_offset().  If already bound, returns the
-  // bound position.  If already linked, returns the position of the prior link.
-  // Otherwise, returns the current pc_offset().
-  int link(Label* L);
-
-  // Determines if Label is bound and near enough so that a single
-  // branch instruction can be used to reach it.
-  bool is_near(Label* L, Condition cond);
-
-  // Returns the branch offset to the given label from the current code position
-  // Links the label to the current position if it is still unbound
-  int branch_offset(Label* L) { return link(L) - pc_offset(); }
-
-  // Puts a labels target address at the given position.
-  // The high 8 bits are set to zero.
-  void label_at_put(Label* L, int at_offset);
-  void load_label_offset(Register r1, Label* L);
-
-  // Read/Modify the code target address in the branch/call instruction at pc.
-  // The isolate argument is unused (and may be nullptr) when skipping flushing.
-  INLINE(static Address target_address_at(Address pc, Address constant_pool));
-  INLINE(static void set_target_address_at(
-      Isolate* isolate, Address pc, Address constant_pool, Address target,
-      ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED));
-
-  // Return the code target address at a call site from the return address
-  // of that call in the instruction stream.
-  inline static Address target_address_from_return_address(Address pc);
-
-  // Given the address of the beginning of a call, return the address
-  // in the instruction stream that the call will return to.
-  INLINE(static Address return_address_from_call_start(Address pc));
-
-  inline Handle<Object> code_target_object_handle_at(Address pc);
-  // This sets the branch destination.
-  // This is for calls and branches within generated code.
-  inline static void deserialization_set_special_target_at(
-      Isolate* isolate, Address instruction_payload, Code* code,
-      Address target);
-
-  // This sets the internal reference at the pc.
-  inline static void deserialization_set_target_internal_reference_at(
-      Isolate* isolate, Address pc, Address target,
-      RelocInfo::Mode mode = RelocInfo::INTERNAL_REFERENCE);
-
-  // Here we are patching the address in the IIHF/IILF instruction pair.
-  // These values are used in the serialization process and must be zero for
-  // S390 platform, as Code, Embedded Object or External-reference pointers
-  // are split across two consecutive instructions and don't exist separately
-  // in the code, so the serializer should not step forwards in memory after
-  // a target is resolved and written.
-  static constexpr int kSpecialTargetSize = 0;
-
-// Number of bytes for instructions used to store pointer sized constant.
-#if V8_TARGET_ARCH_S390X
-  static constexpr int kBytesForPtrConstant = 12;  // IIHF + IILF
-#else
-  static constexpr int kBytesForPtrConstant = 6;  // IILF
-#endif
-
-  // Distance between the instruction referring to the address of the call
-  // target and the return address.
-
-  // Offset between call target address and return address
-  // for BRASL calls
-  // Patch will be appiled to other FIXED_SEQUENCE call
-  static constexpr int kCallTargetAddressOffset = 6;
-
-// The length of FIXED_SEQUENCE call
-// iihf    r8, <address_hi>  // <64-bit only>
-// iilf    r8, <address_lo>
-// basr    r14, r8
-#if V8_TARGET_ARCH_S390X
-  static constexpr int kCallSequenceLength = 14;
-#else
-  static constexpr int kCallSequenceLength = 8;
-#endif
-
-  static inline int encode_crbit(const CRegister& cr, enum CRBit crbit) {
-    return ((cr.code() * CRWIDTH) + crbit);
-  }
-
-  // ---------------------------------------------------------------------------
-  // Code generation
-
-  template <class T, int size, int lo, int hi>
-  inline T getfield(T value) {
-    DCHECK(lo < hi);
-    DCHECK_GT(size, 0);
-    int mask = hi - lo;
-    int shift = size * 8 - hi;
-    uint32_t mask_value = (mask == 32) ? 0xffffffff : (1 << mask) - 1;
-    return (value & mask_value) << shift;
-  }
-
-  // Declare generic instruction formats by fields
-  inline void e_format(Opcode opcode) {
-    emit2bytes(getfield<uint16_t, 2, 0, 16>(opcode));
-  }
-
-  inline void i_format(Opcode opcode, int f1) {
-    emit2bytes(getfield<uint16_t, 2, 0, 8>(opcode) |
-               getfield<uint16_t, 2, 8, 16>(f1));
-  }
-
-  inline void ie_format(Opcode opcode, int f1, int f2) {
-    emit4bytes(getfield<uint32_t, 4, 0, 16>(opcode) |
-               getfield<uint32_t, 4, 24, 28>(f1) |
-               getfield<uint32_t, 4, 28, 32>(f2));
-  }
-  inline void mii_format(Opcode opcode, int f1, int f2, int f3) {
-    emit6bytes(
-        getfield<uint64_t, 6, 0, 8>(opcode) | getfield<uint64_t, 6, 8, 12>(f1) |
-        getfield<uint64_t, 6, 12, 24>(f2) | getfield<uint64_t, 6, 24, 48>(f3));
-  }
-
-  inline void ri_format(Opcode opcode, int f1, int f2) {
-    uint32_t op1 = opcode >> 4;
-    uint32_t op2 = opcode & 0xf;
-    emit4bytes(
-        getfield<uint32_t, 4, 0, 8>(op1) | getfield<uint32_t, 4, 8, 12>(f1) |
-        getfield<uint32_t, 4, 12, 16>(op2) | getfield<uint32_t, 4, 16, 32>(f2));
-  }
-
-  inline void rie_1_format(Opcode opcode, int f1, int f2, int f3, int f4) {
-    uint32_t op1 = opcode >> 8;
-    uint32_t op2 = opcode & 0xff;
-    emit6bytes(
-        getfield<uint64_t, 6, 0, 8>(op1) | getfield<uint64_t, 6, 8, 12>(f1) |
-        getfield<uint64_t, 6, 12, 16>(f2) | getfield<uint64_t, 6, 16, 32>(f3) |
-        getfield<uint64_t, 6, 32, 36>(f4) | getfield<uint64_t, 6, 40, 48>(op2));
-  }
-
-  inline void rie_2_format(Opcode opcode, int f1, int f2, int f3, int f4) {
-    uint32_t op1 = opcode >> 8;
-    uint32_t op2 = opcode & 0xff;
-    emit6bytes(
-        getfield<uint64_t, 6, 0, 8>(op1) | getfield<uint64_t, 6, 8, 12>(f1) |
-        getfield<uint64_t, 6, 12, 16>(f2) | getfield<uint64_t, 6, 16, 32>(f3) |
-        getfield<uint64_t, 6, 32, 40>(f4) | getfield<uint64_t, 6, 40, 48>(op2));
-  }
-
-  inline void rie_3_format(Opcode opcode, int f1, int f2, int f3, int f4,
-                           int f5) {
-    uint32_t op1 = opcode >> 8;
-    uint32_t op2 = opcode & 0xff;
-    emit6bytes(
-        getfield<uint64_t, 6, 0, 8>(op1) | getfield<uint64_t, 6, 8, 12>(f1) |
-        getfield<uint64_t, 6, 12, 16>(f2) | getfield<uint64_t, 6, 16, 24>(f3) |
-        getfield<uint64_t, 6, 24, 32>(f4) | getfield<uint64_t, 6, 32, 40>(f5) |
-        getfield<uint64_t, 6, 40, 48>(op2));
-  }
-
-#define DECLARE_S390_RIL_AB_INSTRUCTIONS(name, op_name, op_value) \
-  template <class R1>                                             \
-  inline void name(R1 r1, const Operand& i2) {                    \
-    ril_format(op_name, r1.code(), i2.immediate());               \
-  }
-#define DECLARE_S390_RIL_C_INSTRUCTIONS(name, op_name, op_value) \
-  inline void name(Condition m1, const Operand& i2) {            \
-    ril_format(op_name, m1, i2.immediate());                     \
-  }
-
-  inline void ril_format(Opcode opcode, int f1, int f2) {
-    uint32_t op1 = opcode >> 4;
-    uint32_t op2 = opcode & 0xf;
-    emit6bytes(
-        getfield<uint64_t, 6, 0, 8>(op1) | getfield<uint64_t, 6, 8, 12>(f1) |
-        getfield<uint64_t, 6, 12, 16>(op2) | getfield<uint64_t, 6, 16, 48>(f2));
-  }
-  S390_RIL_A_OPCODE_LIST(DECLARE_S390_RIL_AB_INSTRUCTIONS)
-  S390_RIL_B_OPCODE_LIST(DECLARE_S390_RIL_AB_INSTRUCTIONS)
-  S390_RIL_C_OPCODE_LIST(DECLARE_S390_RIL_C_INSTRUCTIONS)
-#undef DECLARE_S390_RIL_AB_INSTRUCTIONS
-#undef DECLARE_S390_RIL_C_INSTRUCTIONS
-
-  inline void ris_format(Opcode opcode, int f1, int f2, int f3, int f4,
-                         int f5) {
-    uint32_t op1 = opcode >> 8;
-    uint32_t op2 = opcode & 0xff;
-    emit6bytes(
-        getfield<uint64_t, 6, 0, 8>(op1) | getfield<uint64_t, 6, 8, 12>(f1) |
-        getfield<uint64_t, 6, 12, 16>(f2) | getfield<uint64_t, 6, 16, 20>(f3) |
-        getfield<uint64_t, 6, 20, 32>(f4) | getfield<uint64_t, 6, 32, 40>(f5) |
-        getfield<uint64_t, 6, 40, 48>(op2));
-  }
-
-#define DECLARE_S390_RR_INSTRUCTIONS(name, op_name, op_value) \
-  inline void name(Register r1, Register r2) {                \
-    rr_format(op_name, r1.code(), r2.code());                 \
-  }                                                           \
-  inline void name(DoubleRegister r1, DoubleRegister r2) {    \
-    rr_format(op_name, r1.code(), r2.code());                 \
-  }                                                           \
-  inline void name(Condition m1, Register r2) {               \
-    rr_format(op_name, m1, r2.code());                        \
-  }
-
-  inline void rr_format(Opcode opcode, int f1, int f2) {
-    emit2bytes(getfield<uint16_t, 2, 0, 8>(opcode) |
-               getfield<uint16_t, 2, 8, 12>(f1) |
-               getfield<uint16_t, 2, 12, 16>(f2));
-  }
-  S390_RR_OPCODE_LIST(DECLARE_S390_RR_INSTRUCTIONS)
-#undef DECLARE_S390_RR_INSTRUCTIONS
-
-#define DECLARE_S390_RRD_INSTRUCTIONS(name, op_name, op_value) \
-  template <class R1, class R2, class R3>                      \
-  inline void name(R1 r1, R3 r3, R2 r2) {                      \
-    rrd_format(op_name, r1.code(), r3.code(), r2.code());      \
-  }
-  inline void rrd_format(Opcode opcode, int f1, int f2, int f3) {
-    emit4bytes(getfield<uint32_t, 4, 0, 16>(opcode) |
-               getfield<uint32_t, 4, 16, 20>(f1) |
-               getfield<uint32_t, 4, 24, 28>(f2) |
-               getfield<uint32_t, 4, 28, 32>(f3));
-  }
-  S390_RRD_OPCODE_LIST(DECLARE_S390_RRD_INSTRUCTIONS)
-#undef DECLARE_S390_RRD_INSTRUCTIONS
-
-#define DECLARE_S390_RRE_INSTRUCTIONS(name, op_name, op_value) \
-  template <class R1, class R2>                                \
-  inline void name(R1 r1, R2 r2) {                             \
-    rre_format(op_name, r1.code(), r2.code());                 \
-  }
-  inline void rre_format(Opcode opcode, int f1, int f2) {
-    emit4bytes(getfield<uint32_t, 4, 0, 16>(opcode) |
-               getfield<uint32_t, 4, 24, 28>(f1) |
-               getfield<uint32_t, 4, 28, 32>(f2));
-  }
-  S390_RRE_OPCODE_LIST(DECLARE_S390_RRE_INSTRUCTIONS)
-  // Special format
-  void lzdr(DoubleRegister r1) { rre_format(LZDR, r1.code(), 0); }
-#undef DECLARE_S390_RRE_INSTRUCTIONS
-
-  inline void rrf_format(Opcode opcode, int f1, int f2, int f3, int f4) {
-    emit4bytes(
-        getfield<uint32_t, 4, 0, 16>(opcode) |
-        getfield<uint32_t, 4, 16, 20>(f1) | getfield<uint32_t, 4, 20, 24>(f2) |
-        getfield<uint32_t, 4, 24, 28>(f3) | getfield<uint32_t, 4, 28, 32>(f4));
-  }
-
-#define DECLARE_S390_RX_INSTRUCTIONS(name, op_name, op_value)        \
-  template <class R1>                                                \
-  inline void name(R1 r1, Register x2, Register b2, Disp d2) {       \
-    rx_format(op_name, r1.code(), x2.code(), b2.code(), d2);         \
-  }                                                                  \
-  template <class R1>                                                \
-  inline void name(R1 r1, const MemOperand& opnd) {                  \
-    name(r1, opnd.getIndexRegister(),                                \
-         opnd.getBaseRegister(), opnd.getDisplacement());            \
-  }
-
-  inline void rx_format(Opcode opcode, int f1, int f2, int f3, int f4) {
-    DCHECK(is_uint8(opcode));
-    DCHECK(is_uint12(f4));
-    emit4bytes(getfield<uint32_t, 4, 0, 8>(opcode) |
-               getfield<uint32_t, 4, 8, 12>(f1) |
-               getfield<uint32_t, 4, 12, 16>(f2) |
-               getfield<uint32_t, 4, 16, 20>(f3) |
-               getfield<uint32_t, 4, 20, 32>(f4));
-  }
-  S390_RX_A_OPCODE_LIST(DECLARE_S390_RX_INSTRUCTIONS)
-
-  void bc(Condition cond, const MemOperand& opnd) {
-    bc(cond, opnd.getIndexRegister(),
-       opnd.getBaseRegister(), opnd.getDisplacement());
-  }
-  void bc(Condition cond, Register x2, Register b2, Disp d2) {
-    rx_format(BC, cond, x2.code(), b2.code(), d2);
-  }
-#undef DECLARE_S390_RX_INSTRUCTIONS
-
-#define DECLARE_S390_RXY_INSTRUCTIONS(name, op_name, op_value)       \
-  template <class R1, class R2>                                      \
-  inline void name(R1 r1, R2 r2, Register b2, Disp d2) {             \
-    rxy_format(op_name, r1.code(), r2.code(), b2.code(), d2);        \
-  }                                                                  \
-  template <class R1>                                                \
-  inline void name(R1 r1, const MemOperand& opnd) {                  \
-    name(r1, opnd.getIndexRegister(),                                \
-         opnd.getBaseRegister(), opnd.getDisplacement());            \
-  }
-
-  inline void rxy_format(Opcode opcode, int f1, int f2, int f3, int f4) {
-    DCHECK(is_uint16(opcode));
-    DCHECK(is_int20(f4));
-    emit6bytes(getfield<uint64_t, 6, 0, 8>(opcode >> 8) |
-               getfield<uint64_t, 6, 8, 12>(f1) |
-               getfield<uint64_t, 6, 12, 16>(f2) |
-               getfield<uint64_t, 6, 16, 20>(f3) |
-               getfield<uint64_t, 6, 20, 32>(f4 & 0x0fff) |
-               getfield<uint64_t, 6, 32, 40>(f4 >> 12) |
-               getfield<uint64_t, 6, 40, 48>(opcode & 0x00ff));
-  }
-  S390_RXY_A_OPCODE_LIST(DECLARE_S390_RXY_INSTRUCTIONS)
-
-  void pfd(Condition cond, const MemOperand& opnd) {
-    pfd(cond, opnd.getIndexRegister(),
-        opnd.getBaseRegister(), opnd.getDisplacement());
-  }
-  void pfd(Condition cond, Register x2, Register b2, Disp d2) {
-    rxy_format(PFD, cond, x2.code(), b2.code(), d2);
-  }
-#undef DECLARE_S390_RXY_INSTRUCTIONS
-
-  // Helper for unconditional branch to Label with update to save register
-  void b(Register r, Label* l) {
-    int32_t halfwords = branch_offset(l) / 2;
-    brasl(r, Operand(halfwords));
-  }
-
-  // Conditional Branch Instruction - Generates either BRC / BRCL
-  void branchOnCond(Condition c, int branch_offset, bool is_bound = false);
-
-  // Helpers for conditional branch to Label
-  void b(Condition cond, Label* l, Label::Distance dist = Label::kFar) {
-    branchOnCond(cond, branch_offset(l),
-                 l->is_bound() || (dist == Label::kNear));
-  }
-
-  void bc_short(Condition cond, Label* l, Label::Distance dist = Label::kFar) {
-    b(cond, l, Label::kNear);
-  }
-  // Helpers for conditional branch to Label
-  void beq(Label* l, Label::Distance dist = Label::kFar) { b(eq, l, dist); }
-  void bne(Label* l, Label::Distance dist = Label::kFar) { b(ne, l, dist); }
-  void blt(Label* l, Label::Distance dist = Label::kFar) { b(lt, l, dist); }
-  void ble(Label* l, Label::Distance dist = Label::kFar) { b(le, l, dist); }
-  void bgt(Label* l, Label::Distance dist = Label::kFar) { b(gt, l, dist); }
-  void bge(Label* l, Label::Distance dist = Label::kFar) { b(ge, l, dist); }
-  void b(Label* l, Label::Distance dist = Label::kFar) { b(al, l, dist); }
-  void jmp(Label* l, Label::Distance dist = Label::kFar) { b(al, l, dist); }
-  void bunordered(Label* l, Label::Distance dist = Label::kFar) {
-    b(unordered, l, dist);
-  }
-  void bordered(Label* l, Label::Distance dist = Label::kFar) {
-    b(ordered, l, dist);
-  }
-
-  // Helpers for conditional indirect branch off register
-  void b(Condition cond, Register r) { bcr(cond, r); }
-  void beq(Register r) { b(eq, r); }
-  void bne(Register r) { b(ne, r); }
-  void blt(Register r) { b(lt, r); }
-  void ble(Register r) { b(le, r); }
-  void bgt(Register r) { b(gt, r); }
-  void bge(Register r) { b(ge, r); }
-  void b(Register r) { b(al, r); }
-  void jmp(Register r) { b(al, r); }
-  void bunordered(Register r) { b(unordered, r); }
-  void bordered(Register r) { b(ordered, r); }
-
-  // ---------------------------------------------------------------------------
-  // Code generation
-
-  // Insert the smallest number of nop instructions
-  // possible to align the pc offset to a multiple
-  // of m. m must be a power of 2 (>= 4).
-  void Align(int m);
-  // Insert the smallest number of zero bytes possible to align the pc offset
-  // to a mulitple of m. m must be a power of 2 (>= 2).
-  void DataAlign(int m);
-  // Aligns code to something that's optimal for a jump target for the platform.
-  void CodeTargetAlign();
-
-  void breakpoint(bool do_print) {
-    if (do_print) {
-      PrintF("DebugBreak is inserted to %p\n", static_cast<void*>(pc_));
-    }
-#if V8_HOST_ARCH_64_BIT
-    int64_t value = reinterpret_cast<uint64_t>(&v8::base::OS::DebugBreak);
-    int32_t hi_32 = static_cast<int64_t>(value) >> 32;
-    int32_t lo_32 = static_cast<int32_t>(value);
-
-    iihf(r1, Operand(hi_32));
-    iilf(r1, Operand(lo_32));
-#else
-    iilf(r1, Operand(reinterpret_cast<uint32_t>(&v8::base::OS::DebugBreak)));
-#endif
-    basr(r14, r1);
-  }
-
-  void call(Handle<Code> target, RelocInfo::Mode rmode);
-  void call(CodeStub* stub);
-  void jump(Handle<Code> target, RelocInfo::Mode rmode, Condition cond);
-
-// S390 instruction generation
-#define I_FORM(name) void name(const Operand& i)
-
-#define RR_FORM(name) void name(Register r1, Register r2)
-
-#define RR2_FORM(name) void name(Condition m1, Register r2)
-
-#define RI1_FORM(name) void name(Register r, const Operand& i)
-
-#define RI2_FORM(name) void name(Condition m, const Operand& i)
-
-#define RIE_FORM(name) void name(Register r1, Register R3, const Operand& i)
-
-#define RIE_F_FORM(name)                                                    \
-  void name(Register r1, Register r2, const Operand& i3, const Operand& i4, \
-            const Operand& i5)
-
-#define RXE_FORM(name)                            \
-  void name(Register r1, const MemOperand& opnd); \
-  void name(Register r1, Register b2, Register x2, Disp d2)
-
-#define RXF_FORM(name)                                         \
-  void name(Register r1, Register r3, const MemOperand& opnd); \
-  void name(Register r1, Register r3, Register b2, Register x2, Disp d2)
-
-#define RSI_FORM(name) void name(Register r1, Register r3, const Operand& i)
-
-#define RIS_FORM(name)                                       \
-  void name(Register r1, Condition m3, Register b4, Disp d4, \
-            const Operand& i2);                              \
-  void name(Register r1, const Operand& i2, Condition m3,    \
-            const MemOperand& opnd)
-
-#define SI_FORM(name)                                  \
-  void name(const MemOperand& opnd, const Operand& i); \
-  void name(const Operand& i2, Register b1, Disp d1)
-
-#define SIL_FORM(name)                                \
-  void name(Register b1, Disp d1, const Operand& i2); \
-  void name(const MemOperand& opnd, const Operand& i2)
-
-#define RRF1_FORM(name) void name(Register r1, Register r2, Register r3)
-
-#define RRF2_FORM(name) void name(Condition m1, Register r1, Register r2)
-
-#define RRF3_FORM(name) \
-  void name(Register r3, Condition m4, Register r1, Register r2)
-
-#define RS1_FORM(name)                                         \
-  void name(Register r1, Register r3, const MemOperand& opnd); \
-  void name(Register r1, Register r3, Register b2, Disp d2)
-
-#define RS2_FORM(name)                                          \
-  void name(Register r1, Condition m3, const MemOperand& opnd); \
-  void name(Register r1, Condition m3, Register b2, Disp d2)
-
-#define RSE_FORM(name)                                         \
-  void name(Register r1, Register r3, const MemOperand& opnd); \
-  void name(Register r1, Register r3, Register b2, Disp d2)
-
-#define RSL_FORM(name)                       \
-  void name(Length l, Register b2, Disp d2); \
-  void name(const MemOperand& opnd)
-
-#define RSY1_FORM(name)                                      \
-  void name(Register r1, Register r3, Register b2, Disp d2); \
-  void name(Register r1, Register r3, const MemOperand& opnd)
-
-#define RSY2_FORM(name)                                       \
-  void name(Register r1, Condition m3, Register b2, Disp d2); \
-  void name(Register r1, Condition m3, const MemOperand& opnd)
-
-#define RRS_FORM(name)                                                     \
-  void name(Register r1, Register r2, Register b4, Disp d4, Condition m3); \
-  void name(Register r1, Register r2, Condition m3, const MemOperand& opnd)
-
-#define S_FORM(name)               \
-  void name(Register b2, Disp d2); \
-  void name(const MemOperand& opnd)
-
-#define SIY_FORM(name)                                \
-  void name(const Operand& i2, Register b1, Disp d1); \
-  void name(const MemOperand& opnd, const Operand& i)
-
-#define SS1_FORM(name)                                                  \
-  void name(Register b1, Disp d1, Register b3, Disp d2, Length length); \
-  void name(const MemOperand& opnd1, const MemOperand& opnd2, Length length)
-
-#define SS2_FORM(name)                                                        \
-  void name(const MemOperand& opnd1, const MemOperand& opnd2, Length length1, \
-            Length length2);                                                  \
-  void name(Register b1, Disp d1, Register b2, Disp d2, Length l1, Length l2)
-
-#define SS3_FORM(name)                                                        \
-  void name(const MemOperand& opnd1, const MemOperand& opnd2, Length length); \
-  void name(const Operand& i3, Register b1, Disp d1, Register b2, Disp d2,    \
-            Length l1)
-
-#define SS4_FORM(name)                                                   \
-  void name(const MemOperand& opnd1, const MemOperand& opnd2);           \
-  void name(Register r1, Register r3, Register b1, Disp d1, Register b2, \
-            Disp d2)
-
-#define SS5_FORM(name)                                                   \
-  void name(const MemOperand& opnd1, const MemOperand& opnd2);           \
-  void name(Register r1, Register r3, Register b3, Disp d2, Register b4, \
-            Disp d4)
-
-#define SSE_FORM(name)                                   \
-  void name(Register b1, Disp d1, Register b2, Disp d2); \
-  void name(const MemOperand& opnd1, const MemOperand& opnd2)
-
-#define SSF_FORM(name)                                                \
-  void name(Register r3, Register b1, Disp d1, Register b2, Disp d2); \
-  void name(Register r3, const MemOperand& opnd1, const MemOperand& opnd2)
-
-#define DECLARE_VRR_A_INSTRUCTIONS(name, opcode_name, opcode_value)           \
-  void name(DoubleRegister v1, DoubleRegister v2, Condition m5, Condition m4, \
-            Condition m3) {                                                   \
-    uint64_t code = (static_cast<uint64_t>(opcode_value & 0xFF00)) * B32 |    \
-                    (static_cast<uint64_t>(v1.code())) * B36 |                \
-                    (static_cast<uint64_t>(v2.code())) * B32 |                \
-                    (static_cast<uint64_t>(m5 & 0xF)) * B20 |                 \
-                    (static_cast<uint64_t>(m4 & 0xF)) * B16 |                 \
-                    (static_cast<uint64_t>(m3 & 0xF)) * B12 |                 \
-                    (static_cast<uint64_t>(opcode_value & 0x00FF));           \
-    emit6bytes(code);                                                         \
-  }
-  S390_VRR_A_OPCODE_LIST(DECLARE_VRR_A_INSTRUCTIONS)
-#undef DECLARE_VRR_A_INSTRUCTIONS
-
-#define DECLARE_VRR_C_INSTRUCTIONS(name, opcode_name, opcode_value)        \
-  void name(DoubleRegister v1, DoubleRegister v2, DoubleRegister v3,       \
-            Condition m6, Condition m5, Condition m4) {                    \
-    uint64_t code = (static_cast<uint64_t>(opcode_value & 0xFF00)) * B32 | \
-                    (static_cast<uint64_t>(v1.code())) * B36 |             \
-                    (static_cast<uint64_t>(v2.code())) * B32 |             \
-                    (static_cast<uint64_t>(v3.code())) * B28 |             \
-                    (static_cast<uint64_t>(m6 & 0xF)) * B20 |              \
-                    (static_cast<uint64_t>(m5 & 0xF)) * B16 |              \
-                    (static_cast<uint64_t>(m4 & 0xF)) * B12 |              \
-                    (static_cast<uint64_t>(opcode_value & 0x00FF));        \
-    emit6bytes(code);                                                      \
-  }
-  S390_VRR_C_OPCODE_LIST(DECLARE_VRR_C_INSTRUCTIONS)
-#undef DECLARE_VRR_C_INSTRUCTIONS
-
-  // Single Element format
-  void vfa(DoubleRegister v1, DoubleRegister v2, DoubleRegister v3) {
-    vfa(v1, v2, v3, static_cast<Condition>(0), static_cast<Condition>(8),
-        static_cast<Condition>(3));
-  }
-  void vfs(DoubleRegister v1, DoubleRegister v2, DoubleRegister v3) {
-    vfs(v1, v2, v3, static_cast<Condition>(0), static_cast<Condition>(8),
-        static_cast<Condition>(3));
-  }
-  void vfm(DoubleRegister v1, DoubleRegister v2, DoubleRegister v3) {
-    vfm(v1, v2, v3, static_cast<Condition>(0), static_cast<Condition>(8),
-        static_cast<Condition>(3));
-  }
-  void vfd(DoubleRegister v1, DoubleRegister v2, DoubleRegister v3) {
-    vfd(v1, v2, v3, static_cast<Condition>(0), static_cast<Condition>(8),
-        static_cast<Condition>(3));
-  }
-
-  // S390 instruction sets
-  RXE_FORM(ddb);
-  SS1_FORM(ed);
-  RRF2_FORM(fidbr);
-  RI1_FORM(iihh);
-  RI1_FORM(iihl);
-  RI1_FORM(iilh);
-  RI1_FORM(iill);
-  RSY1_FORM(loc);
-  RXE_FORM(mdb);
-  SS4_FORM(mvck);
-  SSF_FORM(mvcos);
-  SS4_FORM(mvcs);
-  SS1_FORM(mvn);
-  SS1_FORM(nc);
-  SI_FORM(ni);
-  RI1_FORM(nilh);
-  RI1_FORM(nill);
-  RI1_FORM(oill);
-  RXE_FORM(sdb);
-  RS1_FORM(srdl);
-  RI1_FORM(tmll);
-  SS1_FORM(tr);
-  S_FORM(ts);
-
-  // Load Address Instructions
-  void larl(Register r, Label* l);
-
-  // Load Instructions
-  void lhi(Register r, const Operand& imm);
-  void lghi(Register r, const Operand& imm);
-
-  // Load Multiple Instructions
-  void lm(Register r1, Register r2, const MemOperand& src);
-  void lmy(Register r1, Register r2, const MemOperand& src);
-  void lmg(Register r1, Register r2, const MemOperand& src);
-
-  // Load On Condition Instructions
-  void locr(Condition m3, Register r1, Register r2);
-  void locgr(Condition m3, Register r1, Register r2);
-  void loc(Condition m3, Register r1, const MemOperand& src);
-  void locg(Condition m3, Register r1, const MemOperand& src);
-
-  // Store Instructions
-
-  // Store Multiple Instructions
-  void stm(Register r1, Register r2, const MemOperand& src);
-  void stmy(Register r1, Register r2, const MemOperand& src);
-  void stmg(Register r1, Register r2, const MemOperand& src);
-
-  // Compare Instructions
-  void chi(Register r, const Operand& opnd);
-  void cghi(Register r, const Operand& opnd);
-
-  // Compare Logical Instructions
-  void cli(const MemOperand& mem, const Operand& imm);
-  void cliy(const MemOperand& mem, const Operand& imm);
-  void clc(const MemOperand& opnd1, const MemOperand& opnd2, Length length);
-
-  // Compare and Swap Instructions
-  void cs(Register r1, Register r2, const MemOperand& src);
-  void csy(Register r1, Register r2, const MemOperand& src);
-  void csg(Register r1, Register r2, const MemOperand& src);
-
-  // Test Under Mask Instructions
-  void tm(const MemOperand& mem, const Operand& imm);
-  void tmy(const MemOperand& mem, const Operand& imm);
-
-  // Rotate Instructions
-  void rll(Register r1, Register r3, Register opnd);
-  void rll(Register r1, Register r3, const Operand& opnd);
-  void rll(Register r1, Register r3, Register r2, const Operand& opnd);
-  void rllg(Register r1, Register r3, const Operand& opnd);
-  void rllg(Register r1, Register r3, const Register opnd);
-  void rllg(Register r1, Register r3, Register r2, const Operand& opnd);
-
-  // Shift Instructions (32)
-  void sll(Register r1, Register opnd);
-  void sll(Register r1, const Operand& opnd);
-  void sllk(Register r1, Register r3, Register opnd);
-  void sllk(Register r1, Register r3, const Operand& opnd);
-  void srl(Register r1, Register opnd);
-  void srl(Register r1, const Operand& opnd);
-  void srlk(Register r1, Register r3, Register opnd);
-  void srlk(Register r1, Register r3, const Operand& opnd);
-  void sra(Register r1, Register opnd);
-  void sra(Register r1, const Operand& opnd);
-  void srak(Register r1, Register r3, Register opnd);
-  void srak(Register r1, Register r3, const Operand& opnd);
-  void sla(Register r1, Register opnd);
-  void sla(Register r1, const Operand& opnd);
-  void slak(Register r1, Register r3, Register opnd);
-  void slak(Register r1, Register r3, const Operand& opnd);
-
-  // Shift Instructions (64)
-  void sllg(Register r1, Register r3, const Operand& opnd);
-  void sllg(Register r1, Register r3, const Register opnd);
-  void srlg(Register r1, Register r3, const Operand& opnd);
-  void srlg(Register r1, Register r3, const Register opnd);
-  void srag(Register r1, Register r3, const Operand& opnd);
-  void srag(Register r1, Register r3, const Register opnd);
-  void srda(Register r1, const Operand& opnd);
-  void srdl(Register r1, const Operand& opnd);
-  void slag(Register r1, Register r3, const Operand& opnd);
-  void slag(Register r1, Register r3, const Register opnd);
-  void sldl(Register r1, Register b2, const Operand& opnd);
-  void srdl(Register r1, Register b2, const Operand& opnd);
-  void srda(Register r1, Register b2, const Operand& opnd);
-
-  // Rotate and Insert Selected Bits
-  void risbg(Register dst, Register src, const Operand& startBit,
-             const Operand& endBit, const Operand& shiftAmt,
-             bool zeroBits = true);
-  void risbgn(Register dst, Register src, const Operand& startBit,
-              const Operand& endBit, const Operand& shiftAmt,
-              bool zeroBits = true);
-
-  // Move Character (Mem to Mem)
-  void mvc(const MemOperand& opnd1, const MemOperand& opnd2, uint32_t length);
-
-  // Branch Instructions
-  void bras(Register r, const Operand& opnd);
-  void brc(Condition c, const Operand& opnd);
-  void brct(Register r1, const Operand& opnd);
-  void brctg(Register r1, const Operand& opnd);
-
-  // 32-bit Add Instructions
-  void ahi(Register r1, const Operand& opnd);
-  void ahik(Register r1, Register r3, const Operand& opnd);
-  void ark(Register r1, Register r2, Register r3);
-  void asi(const MemOperand&, const Operand&);
-
-  // 64-bit Add Instructions
-  void aghi(Register r1, const Operand& opnd);
-  void aghik(Register r1, Register r3, const Operand& opnd);
-  void agrk(Register r1, Register r2, Register r3);
-  void agsi(const MemOperand&, const Operand&);
-
-  // 32-bit Add Logical Instructions
-  void alrk(Register r1, Register r2, Register r3);
-
-  // 64-bit Add Logical Instructions
-  void algrk(Register r1, Register r2, Register r3);
-
-  // 32-bit Subtract Instructions
-  void srk(Register r1, Register r2, Register r3);
-
-  // 64-bit Subtract Instructions
-  void sgrk(Register r1, Register r2, Register r3);
-
-  // 32-bit Subtract Logical Instructions
-  void slrk(Register r1, Register r2, Register r3);
-
-  // 64-bit Subtract Logical Instructions
-  void slgrk(Register r1, Register r2, Register r3);
-
-  // 32-bit Multiply Instructions
-  void mhi(Register r1, const Operand& opnd);
-  void msrkc(Register r1, Register r2, Register r3);
-  void msgrkc(Register r1, Register r2, Register r3);
-
-  // 64-bit Multiply Instructions
-  void mghi(Register r1, const Operand& opnd);
-
-  // Bitwise Instructions (AND / OR / XOR)
-  void nrk(Register r1, Register r2, Register r3);
-  void ngrk(Register r1, Register r2, Register r3);
-  void ork(Register r1, Register r2, Register r3);
-  void ogrk(Register r1, Register r2, Register r3);
-  void xrk(Register r1, Register r2, Register r3);
-  void xgrk(Register r1, Register r2, Register r3);
-  void xc(const MemOperand& opnd1, const MemOperand& opnd2, Length length);
-
-  // Floating <-> Fixed Point Conversion Instructions
-  void cdlfbr(Condition m3, Condition m4, DoubleRegister fltReg,
-              Register fixReg);
-  void cdlgbr(Condition m3, Condition m4, DoubleRegister fltReg,
-              Register fixReg);
-  void celgbr(Condition m3, Condition m4, DoubleRegister fltReg,
-              Register fixReg);
-  void celfbr(Condition m3, Condition m4, DoubleRegister fltReg,
-              Register fixReg);
-  void clfdbr(Condition m3, Condition m4, Register fixReg,
-              DoubleRegister fltReg);
-  void clfebr(Condition m3, Condition m4, Register fixReg,
-              DoubleRegister fltReg);
-  void clgdbr(Condition m3, Condition m4, Register fixReg,
-              DoubleRegister fltReg);
-  void clgebr(Condition m3, Condition m4, Register fixReg,
-              DoubleRegister fltReg);
-  void cfdbr(Condition m, Register fixReg, DoubleRegister fltReg);
-  void cgebr(Condition m, Register fixReg, DoubleRegister fltReg);
-  void cgdbr(Condition m, Register fixReg, DoubleRegister fltReg);
-  void cfebr(Condition m3, Register fixReg, DoubleRegister fltReg);
-  void cefbr(Condition m3, DoubleRegister fltReg, Register fixReg);
-
-  // Floating Point Compare Instructions
-  void cdb(DoubleRegister r1, const MemOperand& opnd);
-  void ceb(DoubleRegister r1, const MemOperand& opnd);
-
-  // Floating Point Arithmetic Instructions
-  void adb(DoubleRegister r1, const MemOperand& opnd);
-  void aeb(DoubleRegister r1, const MemOperand& opnd);
-  void sdb(DoubleRegister r1, const MemOperand& opnd);
-  void seb(DoubleRegister r1, const MemOperand& opnd);
-  void mdb(DoubleRegister r1, const MemOperand& opnd);
-  void meeb(DoubleRegister r1, const MemOperand& opnd);
-  void ddb(DoubleRegister r1, const MemOperand& opnd);
-  void deb(DoubleRegister r1, const MemOperand& opnd);
-  void sqdb(DoubleRegister r1, const MemOperand& opnd);
-  void ldeb(DoubleRegister r1, const MemOperand& opnd);
-
-  enum FIDBRA_MASK3 {
-    FIDBRA_CURRENT_ROUNDING_MODE = 0,
-    FIDBRA_ROUND_TO_NEAREST_AWAY_FROM_0 = 1,
-    // ...
-    FIDBRA_ROUND_TOWARD_0 = 5,
-    FIDBRA_ROUND_TOWARD_POS_INF = 6,
-    FIDBRA_ROUND_TOWARD_NEG_INF = 7
-  };
-  void fiebra(DoubleRegister d1, DoubleRegister d2, FIDBRA_MASK3 m3);
-  void fidbra(DoubleRegister d1, DoubleRegister d2, FIDBRA_MASK3 m3);
-
-  // Move integer
-  void mvhi(const MemOperand& opnd1, const Operand& i2);
-  void mvghi(const MemOperand& opnd1, const Operand& i2);
-
-  // Exception-generating instructions and debugging support
-  void stop(const char* msg, Condition cond = al,
-            int32_t code = kDefaultStopCode, CRegister cr = cr7);
-
-  void bkpt(uint32_t imm16);  // v5 and above
-
-  // Different nop operations are used by the code generator to detect certain
-  // states of the generated code.
-  enum NopMarkerTypes {
-    NON_MARKING_NOP = 0,
-    GROUP_ENDING_NOP,
-    DEBUG_BREAK_NOP,
-    // IC markers.
-    PROPERTY_ACCESS_INLINED,
-    PROPERTY_ACCESS_INLINED_CONTEXT,
-    PROPERTY_ACCESS_INLINED_CONTEXT_DONT_DELETE,
-    // Helper values.
-    LAST_CODE_MARKER,
-    FIRST_IC_MARKER = PROPERTY_ACCESS_INLINED
-  };
-
-  void nop(int type = 0);  // 0 is the default non-marking type.
-
-  void dumy(int r1, int x2, int b2, int d2);
-
-  // Check the code size generated from label to here.
-  int SizeOfCodeGeneratedSince(Label* label) {
-    return pc_offset() - label->pos();
-  }
-
-  // Record a comment relocation entry that can be used by a disassembler.
-  // Use --code-comments to enable.
-  void RecordComment(const char* msg);
-
-  // Record a deoptimization reason that can be used by a log or cpu profiler.
-  // Use --trace-deopt to enable.
-  void RecordDeoptReason(DeoptimizeReason reason, SourcePosition position,
-                         int id);
-
-  // Writes a single byte or word of data in the code stream.  Used
-  // for inline tables, e.g., jump-tables.
-  void db(uint8_t data);
-  void dd(uint32_t data);
-  void dq(uint64_t data);
-  void dp(uintptr_t data);
-
-  void PatchConstantPoolAccessInstruction(int pc_offset, int offset,
-                                          ConstantPoolEntry::Access access,
-                                          ConstantPoolEntry::Type type) {
-    // No embedded constant pool support.
-    UNREACHABLE();
-  }
-
-  // Read/patch instructions
-  SixByteInstr instr_at(int pos) {
-    return Instruction::InstructionBits(buffer_ + pos);
-  }
-  template <typename T>
-  void instr_at_put(int pos, T instr) {
-    Instruction::SetInstructionBits<T>(buffer_ + pos, instr);
-  }
-
-  // Decodes instruction at pos, and returns its length
-  int32_t instr_length_at(int pos) {
-    return Instruction::InstructionLength(buffer_ + pos);
-  }
-
-  static SixByteInstr instr_at(byte* pc) {
-    return Instruction::InstructionBits(pc);
-  }
-
-  static Condition GetCondition(Instr instr);
-
-  static bool IsBranch(Instr instr);
-#if V8_TARGET_ARCH_S390X
-  static bool Is64BitLoadIntoIP(SixByteInstr instr1, SixByteInstr instr2);
-#else
-  static bool Is32BitLoadIntoIP(SixByteInstr instr);
-#endif
-
-  static bool IsCmpRegister(Instr instr);
-  static bool IsCmpImmediate(Instr instr);
-  static bool IsNop(SixByteInstr instr, int type = NON_MARKING_NOP);
-
-  // The code currently calls CheckBuffer() too often. This has the side
-  // effect of randomly growing the buffer in the middle of multi-instruction
-  // sequences.
-  //
-  // This function allows outside callers to check and grow the buffer
-  void EnsureSpaceFor(int space_needed);
-
-  void EmitRelocations();
-  void emit_label_addr(Label* label);
-
- public:
-  byte* buffer_pos() const { return buffer_; }
-  void RequestHeapObject(HeapObjectRequest request);
-
- protected:
-  int buffer_space() const { return reloc_info_writer.pos() - pc_; }
-
-  // Decode instruction(s) at pos and return backchain to previous
-  // label reference or kEndOfChain.
-  int target_at(int pos);
-
-  // Patch instruction(s) at pos to target target_pos (e.g. branch)
-  void target_at_put(int pos, int target_pos, bool* is_branch = nullptr);
-
-  // Record reloc info for current pc_
-  void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0);
-
- private:
-  // Avoid overflows for displacements etc.
-  static const int kMaximalBufferSize = 512 * MB;
-
-  // Code generation
-  // The relocation writer's position is at least kGap bytes below the end of
-  // the generated instructions. This is so that multi-instruction sequences do
-  // not have to check for overflow. The same is true for writes of large
-  // relocation info entries.
-  static constexpr int kGap = 32;
-
-  // Relocation info generation
-  // Each relocation is encoded as a variable size value
-  static constexpr int kMaxRelocSize = RelocInfoWriter::kMaxSize;
-  RelocInfoWriter reloc_info_writer;
-  std::vector<DeferredRelocInfo> relocations_;
-
-  // The bound position, before this we cannot do instruction elimination.
-  int last_bound_pos_;
-
-  // Code emission
-  void CheckBuffer() {
-    if (buffer_space() <= kGap) {
-      GrowBuffer();
-    }
-  }
-  void GrowBuffer(int needed = 0);
-  inline void TrackBranch();
-  inline void UntrackBranch();
-
-  inline int32_t emit_code_target(
-      Handle<Code> target, RelocInfo::Mode rmode);
-
-  // Helper to emit the binary encoding of a 2 byte instruction
-  void emit2bytes(uint16_t x) {
-    CheckBuffer();
-#if V8_TARGET_LITTLE_ENDIAN
-    // We need to emit instructions in big endian format as disassembler /
-    // simulator require the first byte of the instruction in order to decode
-    // the instruction length.  Swap the bytes.
-    x = ((x & 0x00FF) << 8) | ((x & 0xFF00) >> 8);
-#endif
-    *reinterpret_cast<uint16_t*>(pc_) = x;
-    pc_ += 2;
-  }
-
-  // Helper to emit the binary encoding of a 4 byte instruction
-  void emit4bytes(uint32_t x) {
-    CheckBuffer();
-#if V8_TARGET_LITTLE_ENDIAN
-    // We need to emit instructions in big endian format as disassembler /
-    // simulator require the first byte of the instruction in order to decode
-    // the instruction length.  Swap the bytes.
-    x = ((x & 0x000000FF) << 24) | ((x & 0x0000FF00) << 8) |
-        ((x & 0x00FF0000) >> 8) | ((x & 0xFF000000) >> 24);
-#endif
-    *reinterpret_cast<uint32_t*>(pc_) = x;
-    pc_ += 4;
-  }
-
-  // Helper to emit the binary encoding of a 6 byte instruction
-  void emit6bytes(uint64_t x) {
-    CheckBuffer();
-#if V8_TARGET_LITTLE_ENDIAN
-    // We need to emit instructions in big endian format as disassembler /
-    // simulator require the first byte of the instruction in order to decode
-    // the instruction length.  Swap the bytes.
-    x = (static_cast<uint64_t>(x & 0xFF) << 40) |
-        (static_cast<uint64_t>((x >> 8) & 0xFF) << 32) |
-        (static_cast<uint64_t>((x >> 16) & 0xFF) << 24) |
-        (static_cast<uint64_t>((x >> 24) & 0xFF) << 16) |
-        (static_cast<uint64_t>((x >> 32) & 0xFF) << 8) |
-        (static_cast<uint64_t>((x >> 40) & 0xFF));
-    x |= (*reinterpret_cast<uint64_t*>(pc_) >> 48) << 48;
-#else
-    // We need to pad two bytes of zeros in order to get the 6-bytes
-    // stored from low address.
-    x = x << 16;
-    x |= *reinterpret_cast<uint64_t*>(pc_) & 0xFFFF;
-#endif
-    // It is safe to store 8-bytes, as CheckBuffer() guarantees we have kGap
-    // space left over.
-    *reinterpret_cast<uint64_t*>(pc_) = x;
-    pc_ += 6;
-  }
-
-  // Helpers to emit binary encoding for various instruction formats.
-
-  inline void rr2_form(uint8_t op, Condition m1, Register r2);
-
-  inline void ri_form(Opcode op, Register r1, const Operand& i2);
-  inline void ri_form(Opcode op, Condition m1, const Operand& i2);
-
-  inline void rie_form(Opcode op, Register r1, Register r3, const Operand& i2);
-  inline void rie_f_form(Opcode op, Register r1, Register r2, const Operand& i3,
-                         const Operand& i4, const Operand& i5);
-
-  inline void ris_form(Opcode op, Register r1, Condition m3, Register b4,
-                       Disp d4, const Operand& i2);
-
-  inline void rrf1_form(Opcode op, Register r1, Register r2, Register r3);
-  inline void rrf1_form(uint32_t x);
-  inline void rrf2_form(uint32_t x);
-  inline void rrf3_form(uint32_t x);
-  inline void rrfe_form(Opcode op, Condition m3, Condition m4, Register r1,
-                        Register r2);
-
-  inline void rrs_form(Opcode op, Register r1, Register r2, Register b4,
-                       Disp d4, Condition m3);
-
-  inline void rs_form(Opcode op, Register r1, Condition m3, Register b2,
-                      const Disp d2);
-  inline void rs_form(Opcode op, Register r1, Register r3, Register b2,
-                      const Disp d2);
-
-  inline void rsi_form(Opcode op, Register r1, Register r3, const Operand& i2);
-  inline void rsl_form(Opcode op, Length l1, Register b2, Disp d2);
-
-  inline void rsy_form(Opcode op, Register r1, Register r3, Register b2,
-                       const Disp d2);
-  inline void rsy_form(Opcode op, Register r1, Condition m3, Register b2,
-                       const Disp d2);
-
-  inline void rxe_form(Opcode op, Register r1, Register x2, Register b2,
-                       Disp d2);
-
-  inline void rxf_form(Opcode op, Register r1, Register r3, Register b2,
-                       Register x2, Disp d2);
-
-  inline void s_form(Opcode op, Register b1, Disp d2);
-
-  inline void si_form(Opcode op, const Operand& i2, Register b1, Disp d1);
-  inline void siy_form(Opcode op, const Operand& i2, Register b1, Disp d1);
-
-  inline void sil_form(Opcode op, Register b1, Disp d1, const Operand& i2);
-
-  inline void ss_form(Opcode op, Length l, Register b1, Disp d1, Register b2,
-                      Disp d2);
-  inline void ss_form(Opcode op, Length l1, Length l2, Register b1, Disp d1,
-                      Register b2, Disp d2);
-  inline void ss_form(Opcode op, Length l1, const Operand& i3, Register b1,
-                      Disp d1, Register b2, Disp d2);
-  inline void ss_form(Opcode op, Register r1, Register r2, Register b1, Disp d1,
-                      Register b2, Disp d2);
-  inline void sse_form(Opcode op, Register b1, Disp d1, Register b2, Disp d2);
-  inline void ssf_form(Opcode op, Register r3, Register b1, Disp d1,
-                       Register b2, Disp d2);
-
-  // Labels
-  void print(Label* L);
-  int max_reach_from(int pos);
-  void bind_to(Label* L, int pos);
-  void next(Label* L);
-
-  // The following functions help with avoiding allocations of embedded heap
-  // objects during the code assembly phase. {RequestHeapObject} records the
-  // need for a future heap number allocation or code stub generation. After
-  // code assembly, {AllocateAndInstallRequestedHeapObjects} will allocate these
-  // objects and place them where they are expected (determined by the pc offset
-  // associated with each request). That is, for each request, it will patch the
-  // dummy heap object handle that we emitted during code assembly with the
-  // actual heap object handle.
-  void AllocateAndInstallRequestedHeapObjects(Isolate* isolate);
-  std::forward_list<HeapObjectRequest> heap_object_requests_;
-
-  friend class RegExpMacroAssemblerS390;
-  friend class RelocInfo;
-
-  std::vector<Handle<Code>> code_targets_;
-  friend class EnsureSpace;
-};
-
-class EnsureSpace BASE_EMBEDDED {
- public:
-  explicit EnsureSpace(Assembler* assembler) { assembler->CheckBuffer(); }
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_S390_ASSEMBLER_S390_H_
diff --git a/src/v8/src/s390/code-stubs-s390.cc b/src/v8/src/s390/code-stubs-s390.cc
deleted file mode 100644
index 783b995..0000000
--- a/src/v8/src/s390/code-stubs-s390.cc
+++ /dev/null
@@ -1,1347 +0,0 @@
-// Copyright 2014 the V8 project 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 V8_TARGET_ARCH_S390
-
-#include "src/api-arguments.h"
-#include "src/assembler-inl.h"
-#include "src/base/bits.h"
-#include "src/bootstrapper.h"
-#include "src/code-stubs.h"
-#include "src/frame-constants.h"
-#include "src/frames.h"
-#include "src/ic/ic.h"
-#include "src/ic/stub-cache.h"
-#include "src/isolate.h"
-#include "src/regexp/jsregexp.h"
-#include "src/regexp/regexp-macro-assembler.h"
-#include "src/runtime/runtime.h"
-
-#include "src/s390/code-stubs-s390.h"  // Cannot be the first include.
-
-namespace v8 {
-namespace internal {
-
-#define __ ACCESS_MASM(masm)
-
-void ArrayNArgumentsConstructorStub::Generate(MacroAssembler* masm) {
-  __ ShiftLeftP(r1, r2, Operand(kPointerSizeLog2));
-  __ StoreP(r3, MemOperand(sp, r1));
-  __ push(r3);
-  __ push(r4);
-  __ AddP(r2, r2, Operand(3));
-  __ TailCallRuntime(Runtime::kNewArray);
-}
-
-void DoubleToIStub::Generate(MacroAssembler* masm) {
-  Label out_of_range, only_low, negate, done, fastpath_done;
-  Register result_reg = destination();
-
-  // Immediate values for this stub fit in instructions, so it's safe to use ip.
-  Register scratch = GetRegisterThatIsNotOneOf(result_reg);
-  Register scratch_low = GetRegisterThatIsNotOneOf(result_reg, scratch);
-  Register scratch_high =
-      GetRegisterThatIsNotOneOf(result_reg, scratch, scratch_low);
-  DoubleRegister double_scratch = kScratchDoubleReg;
-
-  __ push(scratch);
-  // Account for saved regs.
-  int argument_offset = 1 * kPointerSize;
-
-  // Load double input.
-  __ LoadDouble(double_scratch, MemOperand(sp, argument_offset));
-
-  // Do fast-path convert from double to int.
-  __ ConvertDoubleToInt64(result_reg, double_scratch);
-
-  // Test for overflow
-  __ TestIfInt32(result_reg);
-  __ beq(&fastpath_done, Label::kNear);
-
-  __ Push(scratch_high, scratch_low);
-  // Account for saved regs.
-  argument_offset += 2 * kPointerSize;
-
-  __ LoadlW(scratch_high,
-            MemOperand(sp, argument_offset + Register::kExponentOffset));
-  __ LoadlW(scratch_low,
-            MemOperand(sp, argument_offset + Register::kMantissaOffset));
-
-  __ ExtractBitMask(scratch, scratch_high, HeapNumber::kExponentMask);
-  // Load scratch with exponent - 1. This is faster than loading
-  // with exponent because Bias + 1 = 1024 which is a *S390* immediate value.
-  STATIC_ASSERT(HeapNumber::kExponentBias + 1 == 1024);
-  __ SubP(scratch, Operand(HeapNumber::kExponentBias + 1));
-  // If exponent is greater than or equal to 84, the 32 less significant
-  // bits are 0s (2^84 = 1, 52 significant bits, 32 uncoded bits),
-  // the result is 0.
-  // Compare exponent with 84 (compare exponent - 1 with 83).
-  __ CmpP(scratch, Operand(83));
-  __ bge(&out_of_range, Label::kNear);
-
-  // If we reach this code, 31 <= exponent <= 83.
-  // So, we don't have to handle cases where 0 <= exponent <= 20 for
-  // which we would need to shift right the high part of the mantissa.
-  // Scratch contains exponent - 1.
-  // Load scratch with 52 - exponent (load with 51 - (exponent - 1)).
-  __ Load(r0, Operand(51));
-  __ SubP(scratch, r0, scratch);
-  __ CmpP(scratch, Operand::Zero());
-  __ ble(&only_low, Label::kNear);
-  // 21 <= exponent <= 51, shift scratch_low and scratch_high
-  // to generate the result.
-  __ ShiftRight(scratch_low, scratch_low, scratch);
-  // Scratch contains: 52 - exponent.
-  // We needs: exponent - 20.
-  // So we use: 32 - scratch = 32 - 52 + exponent = exponent - 20.
-  __ Load(r0, Operand(32));
-  __ SubP(scratch, r0, scratch);
-  __ ExtractBitMask(result_reg, scratch_high, HeapNumber::kMantissaMask);
-  // Set the implicit 1 before the mantissa part in scratch_high.
-  STATIC_ASSERT(HeapNumber::kMantissaBitsInTopWord >= 16);
-  __ Load(r0, Operand(1 << ((HeapNumber::kMantissaBitsInTopWord)-16)));
-  __ ShiftLeftP(r0, r0, Operand(16));
-  __ OrP(result_reg, result_reg, r0);
-  __ ShiftLeft(r0, result_reg, scratch);
-  __ OrP(result_reg, scratch_low, r0);
-  __ b(&negate, Label::kNear);
-
-  __ bind(&out_of_range);
-  __ mov(result_reg, Operand::Zero());
-  __ b(&done, Label::kNear);
-
-  __ bind(&only_low);
-  // 52 <= exponent <= 83, shift only scratch_low.
-  // On entry, scratch contains: 52 - exponent.
-  __ LoadComplementRR(scratch, scratch);
-  __ ShiftLeft(result_reg, scratch_low, scratch);
-
-  __ bind(&negate);
-  // If input was positive, scratch_high ASR 31 equals 0 and
-  // scratch_high LSR 31 equals zero.
-  // New result = (result eor 0) + 0 = result.
-  // If the input was negative, we have to negate the result.
-  // Input_high ASR 31 equals 0xFFFFFFFF and scratch_high LSR 31 equals 1.
-  // New result = (result eor 0xFFFFFFFF) + 1 = 0 - result.
-  __ ShiftRightArith(r0, scratch_high, Operand(31));
-#if V8_TARGET_ARCH_S390X
-  __ lgfr(r0, r0);
-  __ ShiftRightP(r0, r0, Operand(32));
-#endif
-  __ XorP(result_reg, r0);
-  __ ShiftRight(r0, scratch_high, Operand(31));
-  __ AddP(result_reg, r0);
-
-  __ bind(&done);
-  __ Pop(scratch_high, scratch_low);
-
-  __ bind(&fastpath_done);
-  __ pop(scratch);
-
-  __ Ret();
-}
-
-void MathPowStub::Generate(MacroAssembler* masm) {
-  const Register exponent = MathPowTaggedDescriptor::exponent();
-  DCHECK(exponent == r4);
-  const DoubleRegister double_base = d1;
-  const DoubleRegister double_exponent = d2;
-  const DoubleRegister double_result = d3;
-  const DoubleRegister double_scratch = d0;
-  const Register scratch = r1;
-  const Register scratch2 = r9;
-
-  Label call_runtime, done, int_exponent;
-  if (exponent_type() == TAGGED) {
-    // Base is already in double_base.
-    __ UntagAndJumpIfSmi(scratch, exponent, &int_exponent);
-
-    __ LoadDouble(double_exponent,
-                  FieldMemOperand(exponent, HeapNumber::kValueOffset));
-  }
-
-  if (exponent_type() != INTEGER) {
-    // Detect integer exponents stored as double.
-    __ TryDoubleToInt32Exact(scratch, double_exponent, scratch2,
-                             double_scratch);
-    __ beq(&int_exponent, Label::kNear);
-
-    __ push(r14);
-    {
-      AllowExternalCallThatCantCauseGC scope(masm);
-      __ PrepareCallCFunction(0, 2, scratch);
-      __ MovToFloatParameters(double_base, double_exponent);
-      __ CallCFunction(
-          ExternalReference::power_double_double_function(isolate()), 0, 2);
-    }
-    __ pop(r14);
-    __ MovFromFloatResult(double_result);
-    __ b(&done);
-  }
-
-  // Calculate power with integer exponent.
-  __ bind(&int_exponent);
-
-  // Get two copies of exponent in the registers scratch and exponent.
-  if (exponent_type() == INTEGER) {
-    __ LoadRR(scratch, exponent);
-  } else {
-    // Exponent has previously been stored into scratch as untagged integer.
-    __ LoadRR(exponent, scratch);
-  }
-  __ ldr(double_scratch, double_base);  // Back up base.
-  __ LoadImmP(scratch2, Operand(1));
-  __ ConvertIntToDouble(double_result, scratch2);
-
-  // Get absolute value of exponent.
-  Label positive_exponent;
-  __ CmpP(scratch, Operand::Zero());
-  __ bge(&positive_exponent, Label::kNear);
-  __ LoadComplementRR(scratch, scratch);
-  __ bind(&positive_exponent);
-
-  Label while_true, no_carry, loop_end;
-  __ bind(&while_true);
-  __ mov(scratch2, Operand(1));
-  __ AndP(scratch2, scratch);
-  __ beq(&no_carry, Label::kNear);
-  __ mdbr(double_result, double_scratch);
-  __ bind(&no_carry);
-  __ ShiftRightP(scratch, scratch, Operand(1));
-  __ LoadAndTestP(scratch, scratch);
-  __ beq(&loop_end, Label::kNear);
-  __ mdbr(double_scratch, double_scratch);
-  __ b(&while_true);
-  __ bind(&loop_end);
-
-  __ CmpP(exponent, Operand::Zero());
-  __ bge(&done);
-
-  // get 1/double_result:
-  __ ldr(double_scratch, double_result);
-  __ LoadImmP(scratch2, Operand(1));
-  __ ConvertIntToDouble(double_result, scratch2);
-  __ ddbr(double_result, double_scratch);
-
-  // Test whether result is zero.  Bail out to check for subnormal result.
-  // Due to subnormals, x^-y == (1/x)^y does not hold in all cases.
-  __ lzdr(kDoubleRegZero);
-  __ cdbr(double_result, kDoubleRegZero);
-  __ bne(&done, Label::kNear);
-  // double_exponent may not containe the exponent value if the input was a
-  // smi.  We set it with exponent value before bailing out.
-  __ ConvertIntToDouble(double_exponent, exponent);
-
-  // Returning or bailing out.
-  __ push(r14);
-  {
-    AllowExternalCallThatCantCauseGC scope(masm);
-    __ PrepareCallCFunction(0, 2, scratch);
-    __ MovToFloatParameters(double_base, double_exponent);
-    __ CallCFunction(
-        ExternalReference::power_double_double_function(isolate()), 0, 2);
-  }
-  __ pop(r14);
-  __ MovFromFloatResult(double_result);
-
-  __ bind(&done);
-  __ Ret();
-}
-
-Movability CEntryStub::NeedsImmovableCode() { return kImmovable; }
-
-void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) {
-  CEntryStub::GenerateAheadOfTime(isolate);
-  CommonArrayConstructorStub::GenerateStubsAheadOfTime(isolate);
-  StoreFastElementStub::GenerateAheadOfTime(isolate);
-}
-
-void CodeStub::GenerateFPStubs(Isolate* isolate) {
-  SaveFPRegsMode mode = kSaveFPRegs;
-  CEntryStub(isolate, 1, mode).GetCode();
-}
-
-void CEntryStub::GenerateAheadOfTime(Isolate* isolate) {
-  CEntryStub stub(isolate, 1, kDontSaveFPRegs);
-  stub.GetCode();
-  CEntryStub save_doubles(isolate, 1, kSaveFPRegs);
-  save_doubles.GetCode();
-}
-
-void CEntryStub::Generate(MacroAssembler* masm) {
-  // Called from JavaScript; parameters are on stack as if calling JS function.
-  // r2: number of arguments including receiver
-  // r3: pointer to builtin function
-  // fp: frame pointer  (restored after C call)
-  // sp: stack pointer  (restored as callee's sp after C call)
-  // cp: current context  (C callee-saved)
-  //
-  // If argv_in_register():
-  // r4: pointer to the first argument
-  ProfileEntryHookStub::MaybeCallEntryHook(masm);
-
-  __ LoadRR(r7, r3);
-
-  if (argv_in_register()) {
-    // Move argv into the correct register.
-    __ LoadRR(r3, r4);
-  } else {
-    // Compute the argv pointer.
-    __ ShiftLeftP(r3, r2, Operand(kPointerSizeLog2));
-    __ lay(r3, MemOperand(r3, sp, -kPointerSize));
-  }
-
-  // Enter the exit frame that transitions from JavaScript to C++.
-  FrameScope scope(masm, StackFrame::MANUAL);
-
-  // Need at least one extra slot for return address location.
-  int arg_stack_space = 1;
-
-  // Pass buffer for return value on stack if necessary
-  bool needs_return_buffer =
-      result_size() == 2 && !ABI_RETURNS_OBJECTPAIR_IN_REGS;
-  if (needs_return_buffer) {
-    arg_stack_space += result_size();
-  }
-
-#if V8_TARGET_ARCH_S390X
-  // 64-bit linux pass Argument object by reference not value
-  arg_stack_space += 2;
-#endif
-
-  __ EnterExitFrame(save_doubles(), arg_stack_space, is_builtin_exit()
-                                           ? StackFrame::BUILTIN_EXIT
-                                           : StackFrame::EXIT);
-
-  // Store a copy of argc, argv in callee-saved registers for later.
-  __ LoadRR(r6, r2);
-  __ LoadRR(r8, r3);
-  // r2, r6: number of arguments including receiver  (C callee-saved)
-  // r3, r8: pointer to the first argument
-  // r7: pointer to builtin function  (C callee-saved)
-
-  // Result returned in registers or stack, depending on result size and ABI.
-
-  Register isolate_reg = r4;
-  if (needs_return_buffer) {
-    // The return value is 16-byte non-scalar value.
-    // Use frame storage reserved by calling function to pass return
-    // buffer as implicit first argument in R2.  Shfit original parameters
-    // by one register each.
-    __ LoadRR(r4, r3);
-    __ LoadRR(r3, r2);
-    __ la(r2, MemOperand(sp, (kStackFrameExtraParamSlot + 1) * kPointerSize));
-    isolate_reg = r5;
-  }
-  // Call C built-in.
-  __ mov(isolate_reg, Operand(ExternalReference::isolate_address(isolate())));
-
-  Register target = r7;
-
-  // To let the GC traverse the return address of the exit frames, we need to
-  // know where the return address is. The CEntryStub is unmovable, so
-  // we can store the address on the stack to be able to find it again and
-  // we never have to restore it, because it will not change.
-  {
-    Label return_label;
-    __ larl(r14, &return_label);  // Generate the return addr of call later.
-    __ StoreP(r14, MemOperand(sp, kStackFrameRASlot * kPointerSize));
-
-    // zLinux ABI requires caller's frame to have sufficient space for callee
-    // preserved regsiter save area.
-    // __ lay(sp, MemOperand(sp, -kCalleeRegisterSaveAreaSize));
-    __ b(target);
-    __ bind(&return_label);
-    // __ la(sp, MemOperand(sp, +kCalleeRegisterSaveAreaSize));
-  }
-
-  // If return value is on the stack, pop it to registers.
-  if (needs_return_buffer) {
-    __ LoadP(r3, MemOperand(r2, kPointerSize));
-    __ LoadP(r2, MemOperand(r2));
-  }
-
-  // Check result for exception sentinel.
-  Label exception_returned;
-  __ CompareRoot(r2, Heap::kExceptionRootIndex);
-  __ beq(&exception_returned, Label::kNear);
-
-  // Check that there is no pending exception, otherwise we
-  // should have returned the exception sentinel.
-  if (FLAG_debug_code) {
-    Label okay;
-    ExternalReference pending_exception_address(
-        IsolateAddressId::kPendingExceptionAddress, isolate());
-    __ mov(r1, Operand(pending_exception_address));
-    __ LoadP(r1, MemOperand(r1));
-    __ CompareRoot(r1, Heap::kTheHoleValueRootIndex);
-    // Cannot use check here as it attempts to generate call into runtime.
-    __ beq(&okay, Label::kNear);
-    __ stop("Unexpected pending exception");
-    __ bind(&okay);
-  }
-
-  // Exit C frame and return.
-  // r2:r3: result
-  // sp: stack pointer
-  // fp: frame pointer
-  Register argc = argv_in_register()
-                      // We don't want to pop arguments so set argc to no_reg.
-                      ? no_reg
-                      // r6: still holds argc (callee-saved).
-                      : r6;
-  __ LeaveExitFrame(save_doubles(), argc);
-  __ b(r14);
-
-  // Handling of exception.
-  __ bind(&exception_returned);
-
-  ExternalReference pending_handler_context_address(
-      IsolateAddressId::kPendingHandlerContextAddress, isolate());
-  ExternalReference pending_handler_entrypoint_address(
-      IsolateAddressId::kPendingHandlerEntrypointAddress, isolate());
-  ExternalReference pending_handler_fp_address(
-      IsolateAddressId::kPendingHandlerFPAddress, isolate());
-  ExternalReference pending_handler_sp_address(
-      IsolateAddressId::kPendingHandlerSPAddress, isolate());
-
-  // Ask the runtime for help to determine the handler. This will set r3 to
-  // contain the current pending exception, don't clobber it.
-  ExternalReference find_handler(Runtime::kUnwindAndFindExceptionHandler,
-                                 isolate());
-  {
-    FrameScope scope(masm, StackFrame::MANUAL);
-    __ PrepareCallCFunction(3, 0, r2);
-    __ LoadImmP(r2, Operand::Zero());
-    __ LoadImmP(r3, Operand::Zero());
-    __ mov(r4, Operand(ExternalReference::isolate_address(isolate())));
-    __ CallCFunction(find_handler, 3);
-  }
-
-  // Retrieve the handler context, SP and FP.
-  __ mov(cp, Operand(pending_handler_context_address));
-  __ LoadP(cp, MemOperand(cp));
-  __ mov(sp, Operand(pending_handler_sp_address));
-  __ LoadP(sp, MemOperand(sp));
-  __ mov(fp, Operand(pending_handler_fp_address));
-  __ LoadP(fp, MemOperand(fp));
-
-  // If the handler is a JS frame, restore the context to the frame. Note that
-  // the context will be set to (cp == 0) for non-JS frames.
-  Label skip;
-  __ CmpP(cp, Operand::Zero());
-  __ beq(&skip, Label::kNear);
-  __ StoreP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
-  __ bind(&skip);
-
-  // Compute the handler entry address and jump to it.
-  __ mov(r3, Operand(pending_handler_entrypoint_address));
-  __ LoadP(r3, MemOperand(r3));
-  __ Jump(r3);
-}
-
-void JSEntryStub::Generate(MacroAssembler* masm) {
-  // r2: code entry
-  // r3: function
-  // r4: receiver
-  // r5: argc
-  // r6: argv
-
-  Label invoke, handler_entry, exit;
-
-  ProfileEntryHookStub::MaybeCallEntryHook(masm);
-
-// saving floating point registers
-#if V8_TARGET_ARCH_S390X
-  // 64bit ABI requires f8 to f15 be saved
-  __ lay(sp, MemOperand(sp, -8 * kDoubleSize));
-  __ std(d8, MemOperand(sp));
-  __ std(d9, MemOperand(sp, 1 * kDoubleSize));
-  __ std(d10, MemOperand(sp, 2 * kDoubleSize));
-  __ std(d11, MemOperand(sp, 3 * kDoubleSize));
-  __ std(d12, MemOperand(sp, 4 * kDoubleSize));
-  __ std(d13, MemOperand(sp, 5 * kDoubleSize));
-  __ std(d14, MemOperand(sp, 6 * kDoubleSize));
-  __ std(d15, MemOperand(sp, 7 * kDoubleSize));
-#else
-  // 31bit ABI requires you to store f4 and f6:
-  // http://refspecs.linuxbase.org/ELF/zSeries/lzsabi0_s390.html#AEN417
-  __ lay(sp, MemOperand(sp, -2 * kDoubleSize));
-  __ std(d4, MemOperand(sp));
-  __ std(d6, MemOperand(sp, kDoubleSize));
-#endif
-
-  // zLinux ABI
-  //    Incoming parameters:
-  //          r2: code entry
-  //          r3: function
-  //          r4: receiver
-  //          r5: argc
-  //          r6: argv
-  //    Requires us to save the callee-preserved registers r6-r13
-  //    General convention is to also save r14 (return addr) and
-  //    sp/r15 as well in a single STM/STMG
-  __ lay(sp, MemOperand(sp, -10 * kPointerSize));
-  __ StoreMultipleP(r6, sp, MemOperand(sp, 0));
-
-  // Set up the reserved register for 0.0.
-  // __ LoadDoubleLiteral(kDoubleRegZero, 0.0, r0);
-
-  // Push a frame with special values setup to mark it as an entry frame.
-  //   Bad FP (-1)
-  //   SMI Marker
-  //   SMI Marker
-  //   kCEntryFPAddress
-  //   Frame type
-  __ lay(sp, MemOperand(sp, -5 * kPointerSize));
-
-  // Push a bad frame pointer to fail if it is used.
-  __ LoadImmP(r10, Operand(-1));
-
-  StackFrame::Type marker = type();
-  __ Load(r9, Operand(StackFrame::TypeToMarker(marker)));
-  __ Load(r8, Operand(StackFrame::TypeToMarker(marker)));
-  // Save copies of the top frame descriptor on the stack.
-  __ mov(r7, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress,
-                                       isolate())));
-  __ LoadP(r7, MemOperand(r7));
-  __ StoreMultipleP(r7, r10, MemOperand(sp, kPointerSize));
-  // Set up frame pointer for the frame to be pushed.
-  // Need to add kPointerSize, because sp has one extra
-  // frame already for the frame type being pushed later.
-  __ lay(fp,
-         MemOperand(sp, -EntryFrameConstants::kCallerFPOffset + kPointerSize));
-
-  __ InitializeRootRegister();
-
-  // If this is the outermost JS call, set js_entry_sp value.
-  Label non_outermost_js;
-  ExternalReference js_entry_sp(IsolateAddressId::kJSEntrySPAddress, isolate());
-  __ mov(r7, Operand(ExternalReference(js_entry_sp)));
-  __ LoadAndTestP(r8, MemOperand(r7));
-  __ bne(&non_outermost_js, Label::kNear);
-  __ StoreP(fp, MemOperand(r7));
-  __ Load(ip, Operand(StackFrame::OUTERMOST_JSENTRY_FRAME));
-  Label cont;
-  __ b(&cont, Label::kNear);
-  __ bind(&non_outermost_js);
-  __ Load(ip, Operand(StackFrame::INNER_JSENTRY_FRAME));
-
-  __ bind(&cont);
-  __ StoreP(ip, MemOperand(sp));  // frame-type
-
-  // Jump to a faked try block that does the invoke, with a faked catch
-  // block that sets the pending exception.
-  __ b(&invoke, Label::kNear);
-
-  __ bind(&handler_entry);
-  handler_offset_ = handler_entry.pos();
-  // Caught exception: Store result (exception) in the pending exception
-  // field in the JSEnv and return a failure sentinel.  Coming in here the
-  // fp will be invalid because the PushStackHandler below sets it to 0 to
-  // signal the existence of the JSEntry frame.
-  __ mov(ip, Operand(ExternalReference(
-                 IsolateAddressId::kPendingExceptionAddress, isolate())));
-
-  __ StoreP(r2, MemOperand(ip));
-  __ LoadRoot(r2, Heap::kExceptionRootIndex);
-  __ b(&exit, Label::kNear);
-
-  // Invoke: Link this frame into the handler chain.
-  __ bind(&invoke);
-  // Must preserve r2-r6.
-  __ PushStackHandler();
-  // If an exception not caught by another handler occurs, this handler
-  // returns control to the code after the b(&invoke) above, which
-  // restores all kCalleeSaved registers (including cp and fp) to their
-  // saved values before returning a failure to C.
-
-  // Invoke the function by calling through JS entry trampoline builtin.
-  // Notice that we cannot store a reference to the trampoline code directly in
-  // this stub, because runtime stubs are not traversed when doing GC.
-
-  // Expected registers by Builtins::JSEntryTrampoline
-  // r2: code entry
-  // r3: function
-  // r4: receiver
-  // r5: argc
-  // r6: argv
-  __ Call(EntryTrampoline(), RelocInfo::CODE_TARGET);
-
-  // Unlink this frame from the handler chain.
-  __ PopStackHandler();
-  __ bind(&exit);  // r2 holds result
-
-  // Check if the current stack frame is marked as the outermost JS frame.
-  Label non_outermost_js_2;
-  __ pop(r7);
-  __ CmpP(r7, Operand(StackFrame::OUTERMOST_JSENTRY_FRAME));
-  __ bne(&non_outermost_js_2, Label::kNear);
-  __ mov(r8, Operand::Zero());
-  __ mov(r7, Operand(ExternalReference(js_entry_sp)));
-  __ StoreP(r8, MemOperand(r7));
-  __ bind(&non_outermost_js_2);
-
-  // Restore the top frame descriptors from the stack.
-  __ pop(r5);
-  __ mov(ip, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress,
-                                       isolate())));
-  __ StoreP(r5, MemOperand(ip));
-
-  // Reset the stack to the callee saved registers.
-  __ lay(sp, MemOperand(sp, -EntryFrameConstants::kCallerFPOffset));
-
-  // Reload callee-saved preserved regs, return address reg (r14) and sp
-  __ LoadMultipleP(r6, sp, MemOperand(sp, 0));
-  __ la(sp, MemOperand(sp, 10 * kPointerSize));
-
-// saving floating point registers
-#if V8_TARGET_ARCH_S390X
-  // 64bit ABI requires f8 to f15 be saved
-  __ ld(d8, MemOperand(sp));
-  __ ld(d9, MemOperand(sp, 1 * kDoubleSize));
-  __ ld(d10, MemOperand(sp, 2 * kDoubleSize));
-  __ ld(d11, MemOperand(sp, 3 * kDoubleSize));
-  __ ld(d12, MemOperand(sp, 4 * kDoubleSize));
-  __ ld(d13, MemOperand(sp, 5 * kDoubleSize));
-  __ ld(d14, MemOperand(sp, 6 * kDoubleSize));
-  __ ld(d15, MemOperand(sp, 7 * kDoubleSize));
-  __ la(sp, MemOperand(sp, 8 * kDoubleSize));
-#else
-  // 31bit ABI requires you to store f4 and f6:
-  // http://refspecs.linuxbase.org/ELF/zSeries/lzsabi0_s390.html#AEN417
-  __ ld(d4, MemOperand(sp));
-  __ ld(d6, MemOperand(sp, kDoubleSize));
-  __ la(sp, MemOperand(sp, 2 * kDoubleSize));
-#endif
-
-  __ b(r14);
-}
-
-// This stub is paired with DirectCEntryStub::GenerateCall
-void DirectCEntryStub::Generate(MacroAssembler* masm) {
-  __ CleanseP(r14);
-
-  __ b(ip);  // Callee will return to R14 directly
-}
-
-void DirectCEntryStub::GenerateCall(MacroAssembler* masm, Register target) {
-#if ABI_USES_FUNCTION_DESCRIPTORS && !defined(USE_SIMULATOR)
-  // Native AIX/S390X Linux use a function descriptor.
-  __ LoadP(ToRegister(ABI_TOC_REGISTER), MemOperand(target, kPointerSize));
-  __ LoadP(target, MemOperand(target, 0));  // Instruction address
-#else
-  // ip needs to be set for DirectCEentryStub::Generate, and also
-  // for ABI_CALL_VIA_IP.
-  __ Move(ip, target);
-#endif
-
-  __ call(GetCode(), RelocInfo::CODE_TARGET);  // Call the stub.
-}
-
-void ProfileEntryHookStub::MaybeCallEntryHookDelayed(TurboAssembler* tasm,
-                                                     Zone* zone) {
-  if (tasm->isolate()->function_entry_hook() != nullptr) {
-    PredictableCodeSizeScope predictable(tasm,
-#if V8_TARGET_ARCH_S390X
-                                         40);
-#elif V8_HOST_ARCH_S390
-                                         36);
-#else
-                                         32);
-#endif
-    tasm->CleanseP(r14);
-    tasm->Push(r14, ip);
-    tasm->CallStubDelayed(new (zone) ProfileEntryHookStub(nullptr));
-    tasm->Pop(r14, ip);
-  }
-}
-
-void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
-  if (masm->isolate()->function_entry_hook() != nullptr) {
-    PredictableCodeSizeScope predictable(masm,
-#if V8_TARGET_ARCH_S390X
-                                         40);
-#elif V8_HOST_ARCH_S390
-                                         36);
-#else
-                                         32);
-#endif
-    ProfileEntryHookStub stub(masm->isolate());
-    __ CleanseP(r14);
-    __ Push(r14, ip);
-    __ CallStub(&stub);  // BRASL
-    __ Pop(r14, ip);
-  }
-}
-
-void ProfileEntryHookStub::Generate(MacroAssembler* masm) {
-// The entry hook is a "push lr" instruction (LAY+ST/STG), followed by a call.
-#if V8_TARGET_ARCH_S390X
-  const int32_t kReturnAddressDistanceFromFunctionStart =
-      Assembler::kCallTargetAddressOffset + 18;  // LAY + STG * 2
-#elif V8_HOST_ARCH_S390
-  const int32_t kReturnAddressDistanceFromFunctionStart =
-      Assembler::kCallTargetAddressOffset + 18;  // NILH + LAY + ST * 2
-#else
-  const int32_t kReturnAddressDistanceFromFunctionStart =
-      Assembler::kCallTargetAddressOffset + 14;  // LAY + ST * 2
-#endif
-
-  // This should contain all kJSCallerSaved registers.
-  const RegList kSavedRegs = kJSCallerSaved |  // Caller saved registers.
-                             r7.bit();         // Saved stack pointer.
-
-  // We also save r14+ip, so count here is one higher than the mask indicates.
-  const int32_t kNumSavedRegs = kNumJSCallerSaved + 3;
-
-  // Save all caller-save registers as this may be called from anywhere.
-  __ CleanseP(r14);
-  __ LoadRR(ip, r14);
-  __ MultiPush(kSavedRegs | ip.bit());
-
-  // Compute the function's address for the first argument.
-
-  __ SubP(r2, ip, Operand(kReturnAddressDistanceFromFunctionStart));
-
-  // The caller's return address is two slots above the saved temporaries.
-  // Grab that for the second argument to the hook.
-  __ lay(r3, MemOperand(sp, kNumSavedRegs * kPointerSize));
-
-  // Align the stack if necessary.
-  int frame_alignment = masm->ActivationFrameAlignment();
-  if (frame_alignment > kPointerSize) {
-    __ LoadRR(r7, sp);
-    DCHECK(base::bits::IsPowerOfTwo(frame_alignment));
-    __ ClearRightImm(sp, sp, Operand(WhichPowerOf2(frame_alignment)));
-  }
-
-#if !defined(USE_SIMULATOR)
-  uintptr_t entry_hook =
-      reinterpret_cast<uintptr_t>(isolate()->function_entry_hook());
-  __ mov(ip, Operand(entry_hook));
-
-#if ABI_USES_FUNCTION_DESCRIPTORS
-  // Function descriptor
-  __ LoadP(ToRegister(ABI_TOC_REGISTER), MemOperand(ip, kPointerSize));
-  __ LoadP(ip, MemOperand(ip, 0));
-// ip already set.
-#endif
-#endif
-
-  // zLinux ABI requires caller's frame to have sufficient space for callee
-  // preserved regsiter save area.
-  __ LoadImmP(r0, Operand::Zero());
-  __ lay(sp, MemOperand(sp, -kCalleeRegisterSaveAreaSize -
-                                kNumRequiredStackFrameSlots * kPointerSize));
-  __ StoreP(r0, MemOperand(sp));
-#if defined(USE_SIMULATOR)
-  // Under the simulator we need to indirect the entry hook through a
-  // trampoline function at a known address.
-  // It additionally takes an isolate as a third parameter
-  __ mov(r4, Operand(ExternalReference::isolate_address(isolate())));
-
-  ApiFunction dispatcher(FUNCTION_ADDR(EntryHookTrampoline));
-  __ mov(ip, Operand(ExternalReference(
-                 &dispatcher, ExternalReference::BUILTIN_CALL, isolate())));
-#endif
-  __ Call(ip);
-
-  // zLinux ABI requires caller's frame to have sufficient space for callee
-  // preserved regsiter save area.
-  __ la(sp, MemOperand(sp, kCalleeRegisterSaveAreaSize +
-                               kNumRequiredStackFrameSlots * kPointerSize));
-
-  // Restore the stack pointer if needed.
-  if (frame_alignment > kPointerSize) {
-    __ LoadRR(sp, r7);
-  }
-
-  // Also pop lr to get Ret(0).
-  __ MultiPop(kSavedRegs | ip.bit());
-  __ LoadRR(r14, ip);
-  __ Ret();
-}
-
-template <class T>
-static void CreateArrayDispatch(MacroAssembler* masm,
-                                AllocationSiteOverrideMode mode) {
-  if (mode == DISABLE_ALLOCATION_SITES) {
-    T stub(masm->isolate(), GetInitialFastElementsKind(), mode);
-    __ TailCallStub(&stub);
-  } else if (mode == DONT_OVERRIDE) {
-    int last_index =
-        GetSequenceIndexFromFastElementsKind(TERMINAL_FAST_ELEMENTS_KIND);
-    for (int i = 0; i <= last_index; ++i) {
-      ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
-      __ CmpP(r5, Operand(kind));
-      T stub(masm->isolate(), kind);
-      __ TailCallStub(&stub, eq);
-    }
-
-    // If we reached this point there is a problem.
-    __ Abort(AbortReason::kUnexpectedElementsKindInArrayConstructor);
-  } else {
-    UNREACHABLE();
-  }
-}
-
-static void CreateArrayDispatchOneArgument(MacroAssembler* masm,
-                                           AllocationSiteOverrideMode mode) {
-  // r4 - allocation site (if mode != DISABLE_ALLOCATION_SITES)
-  // r5 - kind (if mode != DISABLE_ALLOCATION_SITES)
-  // r2 - number of arguments
-  // r3 - constructor?
-  // sp[0] - last argument
-  STATIC_ASSERT(PACKED_SMI_ELEMENTS == 0);
-  STATIC_ASSERT(HOLEY_SMI_ELEMENTS == 1);
-  STATIC_ASSERT(PACKED_ELEMENTS == 2);
-  STATIC_ASSERT(HOLEY_ELEMENTS == 3);
-  STATIC_ASSERT(PACKED_DOUBLE_ELEMENTS == 4);
-  STATIC_ASSERT(HOLEY_DOUBLE_ELEMENTS == 5);
-
-  if (mode == DISABLE_ALLOCATION_SITES) {
-    ElementsKind initial = GetInitialFastElementsKind();
-    ElementsKind holey_initial = GetHoleyElementsKind(initial);
-
-    ArraySingleArgumentConstructorStub stub_holey(
-        masm->isolate(), holey_initial, DISABLE_ALLOCATION_SITES);
-    __ TailCallStub(&stub_holey);
-  } else if (mode == DONT_OVERRIDE) {
-    Label normal_sequence;
-    // is the low bit set? If so, we are holey and that is good.
-    __ AndP(r0, r5, Operand(1));
-    __ bne(&normal_sequence);
-
-    // We are going to create a holey array, but our kind is non-holey.
-    // Fix kind and retry (only if we have an allocation site in the slot).
-    __ AddP(r5, r5, Operand(1));
-    if (FLAG_debug_code) {
-      __ LoadP(r7, FieldMemOperand(r4, 0));
-      __ CompareRoot(r7, Heap::kAllocationSiteMapRootIndex);
-      __ Assert(eq, AbortReason::kExpectedAllocationSite);
-    }
-
-    // Save the resulting elements kind in type info. We can't just store r5
-    // in the AllocationSite::transition_info field because elements kind is
-    // restricted to a portion of the field...upper bits need to be left alone.
-    STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
-    __ LoadP(r6, FieldMemOperand(
-                     r4, AllocationSite::kTransitionInfoOrBoilerplateOffset));
-    __ AddSmiLiteral(r6, r6, Smi::FromInt(kFastElementsKindPackedToHoley), r0);
-    __ StoreP(r6, FieldMemOperand(
-                      r4, AllocationSite::kTransitionInfoOrBoilerplateOffset));
-
-    __ bind(&normal_sequence);
-    int last_index =
-        GetSequenceIndexFromFastElementsKind(TERMINAL_FAST_ELEMENTS_KIND);
-    for (int i = 0; i <= last_index; ++i) {
-      ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
-      __ CmpP(r5, Operand(kind));
-      ArraySingleArgumentConstructorStub stub(masm->isolate(), kind);
-      __ TailCallStub(&stub, eq);
-    }
-
-    // If we reached this point there is a problem.
-    __ Abort(AbortReason::kUnexpectedElementsKindInArrayConstructor);
-  } else {
-    UNREACHABLE();
-  }
-}
-
-template <class T>
-static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) {
-  int to_index =
-      GetSequenceIndexFromFastElementsKind(TERMINAL_FAST_ELEMENTS_KIND);
-  for (int i = 0; i <= to_index; ++i) {
-    ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
-    T stub(isolate, kind);
-    stub.GetCode();
-    if (AllocationSite::ShouldTrack(kind)) {
-      T stub1(isolate, kind, DISABLE_ALLOCATION_SITES);
-      stub1.GetCode();
-    }
-  }
-}
-
-void CommonArrayConstructorStub::GenerateStubsAheadOfTime(Isolate* isolate) {
-  ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>(
-      isolate);
-  ArrayNArgumentsConstructorStub stub(isolate);
-  stub.GetCode();
-  ElementsKind kinds[2] = {PACKED_ELEMENTS, HOLEY_ELEMENTS};
-  for (int i = 0; i < 2; i++) {
-    // For internal arrays we only need a few things
-    InternalArrayNoArgumentConstructorStub stubh1(isolate, kinds[i]);
-    stubh1.GetCode();
-    InternalArraySingleArgumentConstructorStub stubh2(isolate, kinds[i]);
-    stubh2.GetCode();
-  }
-}
-
-void ArrayConstructorStub::GenerateDispatchToArrayStub(
-    MacroAssembler* masm, AllocationSiteOverrideMode mode) {
-  Label not_zero_case, not_one_case;
-  __ CmpP(r2, Operand::Zero());
-  __ bne(&not_zero_case);
-  CreateArrayDispatch<ArrayNoArgumentConstructorStub>(masm, mode);
-
-  __ bind(&not_zero_case);
-  __ CmpP(r2, Operand(1));
-  __ bgt(&not_one_case);
-  CreateArrayDispatchOneArgument(masm, mode);
-
-  __ bind(&not_one_case);
-  ArrayNArgumentsConstructorStub stub(masm->isolate());
-  __ TailCallStub(&stub);
-}
-
-void ArrayConstructorStub::Generate(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- r2 : argc (only if argument_count() == ANY)
-  //  -- r3 : constructor
-  //  -- r4 : AllocationSite or undefined
-  //  -- r5 : new target
-  //  -- sp[0] : return address
-  //  -- sp[4] : last argument
-  // -----------------------------------
-
-  if (FLAG_debug_code) {
-    // The array construct code is only set for the global and natives
-    // builtin Array functions which always have maps.
-
-    // Initial map for the builtin Array function should be a map.
-    __ LoadP(r6, FieldMemOperand(r3, JSFunction::kPrototypeOrInitialMapOffset));
-    // Will both indicate a nullptr and a Smi.
-    __ TestIfSmi(r6);
-    __ Assert(ne, AbortReason::kUnexpectedInitialMapForArrayFunction, cr0);
-    __ CompareObjectType(r6, r6, r7, MAP_TYPE);
-    __ Assert(eq, AbortReason::kUnexpectedInitialMapForArrayFunction);
-
-    // We should either have undefined in r4 or a valid AllocationSite
-    __ AssertUndefinedOrAllocationSite(r4, r6);
-  }
-
-  // Enter the context of the Array function.
-  __ LoadP(cp, FieldMemOperand(r3, JSFunction::kContextOffset));
-
-  Label subclassing;
-  __ CmpP(r5, r3);
-  __ bne(&subclassing, Label::kNear);
-
-  Label no_info;
-  // Get the elements kind and case on that.
-  __ CompareRoot(r4, Heap::kUndefinedValueRootIndex);
-  __ beq(&no_info);
-
-  __ LoadP(r5, FieldMemOperand(
-                   r4, AllocationSite::kTransitionInfoOrBoilerplateOffset));
-  __ SmiUntag(r5);
-  STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
-  __ AndP(r5, Operand(AllocationSite::ElementsKindBits::kMask));
-  GenerateDispatchToArrayStub(masm, DONT_OVERRIDE);
-
-  __ bind(&no_info);
-  GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES);
-
-  __ bind(&subclassing);
-  __ ShiftLeftP(r1, r2, Operand(kPointerSizeLog2));
-  __ StoreP(r3, MemOperand(sp, r1));
-  __ AddP(r2, r2, Operand(3));
-  __ Push(r5, r4);
-  __ JumpToExternalReference(ExternalReference(Runtime::kNewArray, isolate()));
-}
-
-void InternalArrayConstructorStub::GenerateCase(MacroAssembler* masm,
-                                                ElementsKind kind) {
-  __ CmpLogicalP(r2, Operand(1));
-
-  InternalArrayNoArgumentConstructorStub stub0(isolate(), kind);
-  __ TailCallStub(&stub0, lt);
-
-  ArrayNArgumentsConstructorStub stubN(isolate());
-  __ TailCallStub(&stubN, gt);
-
-  if (IsFastPackedElementsKind(kind)) {
-    // We might need to create a holey array
-    // look at the first argument
-    __ LoadP(r5, MemOperand(sp, 0));
-    __ CmpP(r5, Operand::Zero());
-
-    InternalArraySingleArgumentConstructorStub stub1_holey(
-        isolate(), GetHoleyElementsKind(kind));
-    __ TailCallStub(&stub1_holey, ne);
-  }
-
-  InternalArraySingleArgumentConstructorStub stub1(isolate(), kind);
-  __ TailCallStub(&stub1);
-}
-
-void InternalArrayConstructorStub::Generate(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- r2 : argc
-  //  -- r3 : constructor
-  //  -- sp[0] : return address
-  //  -- sp[4] : last argument
-  // -----------------------------------
-
-  if (FLAG_debug_code) {
-    // The array construct code is only set for the global and natives
-    // builtin Array functions which always have maps.
-
-    // Initial map for the builtin Array function should be a map.
-    __ LoadP(r5, FieldMemOperand(r3, JSFunction::kPrototypeOrInitialMapOffset));
-    // Will both indicate a nullptr and a Smi.
-    __ TestIfSmi(r5);
-    __ Assert(ne, AbortReason::kUnexpectedInitialMapForArrayFunction, cr0);
-    __ CompareObjectType(r5, r5, r6, MAP_TYPE);
-    __ Assert(eq, AbortReason::kUnexpectedInitialMapForArrayFunction);
-  }
-
-  // Figure out the right elements kind
-  __ LoadP(r5, FieldMemOperand(r3, JSFunction::kPrototypeOrInitialMapOffset));
-  // Load the map's "bit field 2" into |result|.
-  __ LoadlB(r5, FieldMemOperand(r5, Map::kBitField2Offset));
-  // Retrieve elements_kind from bit field 2.
-  __ DecodeField<Map::ElementsKindBits>(r5);
-
-  if (FLAG_debug_code) {
-    Label done;
-    __ CmpP(r5, Operand(PACKED_ELEMENTS));
-    __ beq(&done);
-    __ CmpP(r5, Operand(HOLEY_ELEMENTS));
-    __ Assert(
-        eq,
-        AbortReason::kInvalidElementsKindForInternalArrayOrInternalPackedArray);
-    __ bind(&done);
-  }
-
-  Label fast_elements_case;
-  __ CmpP(r5, Operand(PACKED_ELEMENTS));
-  __ beq(&fast_elements_case);
-  GenerateCase(masm, HOLEY_ELEMENTS);
-
-  __ bind(&fast_elements_case);
-  GenerateCase(masm, PACKED_ELEMENTS);
-}
-
-static int AddressOffset(ExternalReference ref0, ExternalReference ref1) {
-  return ref0.address() - ref1.address();
-}
-
-// Calls an API function.  Allocates HandleScope, extracts returned value
-// from handle and propagates exceptions.  Restores context.  stack_space
-// - space to be unwound on exit (includes the call JS arguments space and
-// the additional space allocated for the fast call).
-static void CallApiFunctionAndReturn(MacroAssembler* masm,
-                                     Register function_address,
-                                     ExternalReference thunk_ref,
-                                     int stack_space,
-                                     MemOperand* stack_space_operand,
-                                     MemOperand return_value_operand) {
-  Isolate* isolate = masm->isolate();
-  ExternalReference next_address =
-      ExternalReference::handle_scope_next_address(isolate);
-  const int kNextOffset = 0;
-  const int kLimitOffset = AddressOffset(
-      ExternalReference::handle_scope_limit_address(isolate), next_address);
-  const int kLevelOffset = AddressOffset(
-      ExternalReference::handle_scope_level_address(isolate), next_address);
-
-  // Additional parameter is the address of the actual callback.
-  DCHECK(function_address == r3 || function_address == r4);
-  Register scratch = r5;
-
-  __ mov(scratch, Operand(ExternalReference::is_profiling_address(isolate)));
-  __ LoadlB(scratch, MemOperand(scratch, 0));
-  __ CmpP(scratch, Operand::Zero());
-
-  Label profiler_disabled;
-  Label end_profiler_check;
-  __ beq(&profiler_disabled, Label::kNear);
-  __ mov(scratch, Operand(thunk_ref));
-  __ b(&end_profiler_check, Label::kNear);
-  __ bind(&profiler_disabled);
-  __ LoadRR(scratch, function_address);
-  __ bind(&end_profiler_check);
-
-  // Allocate HandleScope in callee-save registers.
-  // r9 - next_address
-  // r6 - next_address->kNextOffset
-  // r7 - next_address->kLimitOffset
-  // r8 - next_address->kLevelOffset
-  __ mov(r9, Operand(next_address));
-  __ LoadP(r6, MemOperand(r9, kNextOffset));
-  __ LoadP(r7, MemOperand(r9, kLimitOffset));
-  __ LoadlW(r8, MemOperand(r9, kLevelOffset));
-  __ AddP(r8, Operand(1));
-  __ StoreW(r8, MemOperand(r9, kLevelOffset));
-
-  if (FLAG_log_timer_events) {
-    FrameScope frame(masm, StackFrame::MANUAL);
-    __ PushSafepointRegisters();
-    __ PrepareCallCFunction(1, r2);
-    __ mov(r2, Operand(ExternalReference::isolate_address(isolate)));
-    __ CallCFunction(ExternalReference::log_enter_external_function(isolate),
-                     1);
-    __ PopSafepointRegisters();
-  }
-
-  // Native call returns to the DirectCEntry stub which redirects to the
-  // return address pushed on stack (could have moved after GC).
-  // DirectCEntry stub itself is generated early and never moves.
-  DirectCEntryStub stub(isolate);
-  stub.GenerateCall(masm, scratch);
-
-  if (FLAG_log_timer_events) {
-    FrameScope frame(masm, StackFrame::MANUAL);
-    __ PushSafepointRegisters();
-    __ PrepareCallCFunction(1, r2);
-    __ mov(r2, Operand(ExternalReference::isolate_address(isolate)));
-    __ CallCFunction(ExternalReference::log_leave_external_function(isolate),
-                     1);
-    __ PopSafepointRegisters();
-  }
-
-  Label promote_scheduled_exception;
-  Label delete_allocated_handles;
-  Label leave_exit_frame;
-  Label return_value_loaded;
-
-  // load value from ReturnValue
-  __ LoadP(r2, return_value_operand);
-  __ bind(&return_value_loaded);
-  // No more valid handles (the result handle was the last one). Restore
-  // previous handle scope.
-  __ StoreP(r6, MemOperand(r9, kNextOffset));
-  if (__ emit_debug_code()) {
-    __ LoadlW(r3, MemOperand(r9, kLevelOffset));
-    __ CmpP(r3, r8);
-    __ Check(eq, AbortReason::kUnexpectedLevelAfterReturnFromApiCall);
-  }
-  __ SubP(r8, Operand(1));
-  __ StoreW(r8, MemOperand(r9, kLevelOffset));
-  __ CmpP(r7, MemOperand(r9, kLimitOffset));
-  __ bne(&delete_allocated_handles, Label::kNear);
-
-  // Leave the API exit frame.
-  __ bind(&leave_exit_frame);
-  // LeaveExitFrame expects unwind space to be in a register.
-  if (stack_space_operand != nullptr) {
-    __ l(r6, *stack_space_operand);
-  } else {
-    __ mov(r6, Operand(stack_space));
-  }
-  __ LeaveExitFrame(false, r6, stack_space_operand != nullptr);
-
-  // Check if the function scheduled an exception.
-  __ mov(r7, Operand(ExternalReference::scheduled_exception_address(isolate)));
-  __ LoadP(r7, MemOperand(r7));
-  __ CompareRoot(r7, Heap::kTheHoleValueRootIndex);
-  __ bne(&promote_scheduled_exception, Label::kNear);
-
-  __ b(r14);
-
-  // Re-throw by promoting a scheduled exception.
-  __ bind(&promote_scheduled_exception);
-  __ TailCallRuntime(Runtime::kPromoteScheduledException);
-
-  // HandleScope limit has changed. Delete allocated extensions.
-  __ bind(&delete_allocated_handles);
-  __ StoreP(r7, MemOperand(r9, kLimitOffset));
-  __ LoadRR(r6, r2);
-  __ PrepareCallCFunction(1, r7);
-  __ mov(r2, Operand(ExternalReference::isolate_address(isolate)));
-  __ CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate),
-                   1);
-  __ LoadRR(r2, r6);
-  __ b(&leave_exit_frame, Label::kNear);
-}
-
-void CallApiCallbackStub::Generate(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- r6                  : call_data
-  //  -- r4                  : holder
-  //  -- r3                  : api_function_address
-  //  -- cp                  : context
-  //  --
-  //  -- sp[0]               : last argument
-  //  -- ...
-  //  -- sp[(argc - 1) * 4]  : first argument
-  //  -- sp[argc * 4]        : receiver
-  // -----------------------------------
-
-  Register call_data = r6;
-  Register holder = r4;
-  Register api_function_address = r3;
-
-  typedef FunctionCallbackArguments FCA;
-
-  STATIC_ASSERT(FCA::kArgsLength == 6);
-  STATIC_ASSERT(FCA::kNewTargetIndex == 5);
-  STATIC_ASSERT(FCA::kDataIndex == 4);
-  STATIC_ASSERT(FCA::kReturnValueOffset == 3);
-  STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2);
-  STATIC_ASSERT(FCA::kIsolateIndex == 1);
-  STATIC_ASSERT(FCA::kHolderIndex == 0);
-
-  // new target
-  __ PushRoot(Heap::kUndefinedValueRootIndex);
-
-  // call data
-  __ push(call_data);
-
-  Register scratch = call_data;
-  __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex);
-  // return value
-  __ push(scratch);
-  // return value default
-  __ push(scratch);
-  // isolate
-  __ mov(scratch, Operand(ExternalReference::isolate_address(masm->isolate())));
-  __ push(scratch);
-  // holder
-  __ push(holder);
-
-  // Prepare arguments.
-  __ LoadRR(scratch, sp);
-
-  // Allocate the v8::Arguments structure in the arguments' space since
-  // it's not controlled by GC.
-  // S390 LINUX ABI:
-  //
-  // Create 4 extra slots on stack:
-  //    [0] space for DirectCEntryStub's LR save
-  //    [1-3] FunctionCallbackInfo
-  const int kApiStackSpace = 4;
-  const int kFunctionCallbackInfoOffset =
-      (kStackFrameExtraParamSlot + 1) * kPointerSize;
-
-  FrameScope frame_scope(masm, StackFrame::MANUAL);
-  __ EnterExitFrame(false, kApiStackSpace);
-
-  DCHECK(api_function_address != r2 && scratch != r2);
-  // r2 = FunctionCallbackInfo&
-  // Arguments is after the return address.
-  __ AddP(r2, sp, Operand(kFunctionCallbackInfoOffset));
-  // FunctionCallbackInfo::implicit_args_
-  __ StoreP(scratch, MemOperand(r2, 0 * kPointerSize));
-  // FunctionCallbackInfo::values_
-  __ AddP(ip, scratch, Operand((FCA::kArgsLength - 1 + argc()) * kPointerSize));
-  __ StoreP(ip, MemOperand(r2, 1 * kPointerSize));
-  // FunctionCallbackInfo::length_ = argc
-  __ LoadImmP(ip, Operand(argc()));
-  __ StoreW(ip, MemOperand(r2, 2 * kPointerSize));
-
-  ExternalReference thunk_ref =
-      ExternalReference::invoke_function_callback(masm->isolate());
-
-  AllowExternalCallThatCantCauseGC scope(masm);
-  // Stores return the first js argument
-  int return_value_offset = 2 + FCA::kReturnValueOffset;
-  MemOperand return_value_operand(fp, return_value_offset * kPointerSize);
-  const int stack_space = argc() + FCA::kArgsLength + 1;
-  MemOperand* stack_space_operand = nullptr;
-  CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space,
-                           stack_space_operand, return_value_operand);
-}
-
-void CallApiGetterStub::Generate(MacroAssembler* masm) {
-  int arg0Slot = 0;
-  int accessorInfoSlot = 0;
-  int apiStackSpace = 0;
-  // Build v8::PropertyCallbackInfo::args_ array on the stack and push property
-  // name below the exit frame to make GC aware of them.
-  STATIC_ASSERT(PropertyCallbackArguments::kShouldThrowOnErrorIndex == 0);
-  STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 1);
-  STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 2);
-  STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 3);
-  STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 4);
-  STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 5);
-  STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 6);
-  STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 7);
-
-  Register receiver = ApiGetterDescriptor::ReceiverRegister();
-  Register holder = ApiGetterDescriptor::HolderRegister();
-  Register callback = ApiGetterDescriptor::CallbackRegister();
-  Register scratch = r6;
-  DCHECK(!AreAliased(receiver, holder, callback, scratch));
-
-  Register api_function_address = r4;
-
-  __ push(receiver);
-  // Push data from AccessorInfo.
-  __ LoadP(scratch, FieldMemOperand(callback, AccessorInfo::kDataOffset));
-  __ push(scratch);
-  __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex);
-  __ Push(scratch, scratch);
-  __ mov(scratch, Operand(ExternalReference::isolate_address(isolate())));
-  __ Push(scratch, holder);
-  __ Push(Smi::kZero);  // should_throw_on_error -> false
-  __ LoadP(scratch, FieldMemOperand(callback, AccessorInfo::kNameOffset));
-  __ push(scratch);
-
-  // v8::PropertyCallbackInfo::args_ array and name handle.
-  const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1;
-
-  // Load address of v8::PropertyAccessorInfo::args_ array and name handle.
-  __ LoadRR(r2, sp);                           // r2 = Handle<Name>
-  __ AddP(r3, r2, Operand(1 * kPointerSize));  // r3 = v8::PCI::args_
-
-  // If ABI passes Handles (pointer-sized struct) in a register:
-  //
-  // Create 2 extra slots on stack:
-  //    [0] space for DirectCEntryStub's LR save
-  //    [1] AccessorInfo&
-  //
-  // Otherwise:
-  //
-  // Create 3 extra slots on stack:
-  //    [0] space for DirectCEntryStub's LR save
-  //    [1] copy of Handle (first arg)
-  //    [2] AccessorInfo&
-  if (ABI_PASSES_HANDLES_IN_REGS) {
-    accessorInfoSlot = kStackFrameExtraParamSlot + 1;
-    apiStackSpace = 2;
-  } else {
-    arg0Slot = kStackFrameExtraParamSlot + 1;
-    accessorInfoSlot = arg0Slot + 1;
-    apiStackSpace = 3;
-  }
-
-  FrameScope frame_scope(masm, StackFrame::MANUAL);
-  __ EnterExitFrame(false, apiStackSpace);
-
-  if (!ABI_PASSES_HANDLES_IN_REGS) {
-    // pass 1st arg by reference
-    __ StoreP(r2, MemOperand(sp, arg0Slot * kPointerSize));
-    __ AddP(r2, sp, Operand(arg0Slot * kPointerSize));
-  }
-
-  // Create v8::PropertyCallbackInfo object on the stack and initialize
-  // it's args_ field.
-  __ StoreP(r3, MemOperand(sp, accessorInfoSlot * kPointerSize));
-  __ AddP(r3, sp, Operand(accessorInfoSlot * kPointerSize));
-  // r3 = v8::PropertyCallbackInfo&
-
-  ExternalReference thunk_ref =
-      ExternalReference::invoke_accessor_getter_callback(isolate());
-
-  __ LoadP(scratch, FieldMemOperand(callback, AccessorInfo::kJsGetterOffset));
-  __ LoadP(api_function_address,
-           FieldMemOperand(scratch, Foreign::kForeignAddressOffset));
-
-  // +3 is to skip prolog, return address and name handle.
-  MemOperand return_value_operand(
-      fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize);
-  CallApiFunctionAndReturn(masm, api_function_address, thunk_ref,
-                           kStackUnwindSpace, nullptr, return_value_operand);
-}
-
-#undef __
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_S390
diff --git a/src/v8/src/s390/code-stubs-s390.h b/src/v8/src/s390/code-stubs-s390.h
deleted file mode 100644
index 269d25f..0000000
--- a/src/v8/src/s390/code-stubs-s390.h
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_S390_CODE_STUBS_S390_H_
-#define V8_S390_CODE_STUBS_S390_H_
-
-namespace v8 {
-namespace internal {
-
-// Trampoline stub to call into native code. To call safely into native code
-// in the presence of compacting GC (which can move code objects) we need to
-// keep the code which called into native pinned in the memory. Currently the
-// simplest approach is to generate such stub early enough so it can never be
-// moved by GC
-class DirectCEntryStub : public PlatformCodeStub {
- public:
-  explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {}
-  void GenerateCall(MacroAssembler* masm, Register target);
-
- private:
-  Movability NeedsImmovableCode() override { return kImmovable; }
-
-  DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR();
-  DEFINE_PLATFORM_CODE_STUB(DirectCEntry, PlatformCodeStub);
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_S390_CODE_STUBS_S390_H_
diff --git a/src/v8/src/s390/codegen-s390.cc b/src/v8/src/s390/codegen-s390.cc
deleted file mode 100644
index df02570..0000000
--- a/src/v8/src/s390/codegen-s390.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2015 the V8 project 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 V8_TARGET_ARCH_S390
-
-#include <memory>
-
-#include "src/codegen.h"
-#include "src/macro-assembler.h"
-#include "src/s390/simulator-s390.h"
-
-namespace v8 {
-namespace internal {
-
-#define __ masm.
-
-UnaryMathFunctionWithIsolate CreateSqrtFunction(Isolate* isolate) {
-#if defined(USE_SIMULATOR)
-  return nullptr;
-#else
-  size_t allocated = 0;
-  byte* buffer = AllocatePage(isolate->heap()->GetRandomMmapAddr(), &allocated);
-  if (buffer == nullptr) return nullptr;
-
-  MacroAssembler masm(isolate, buffer, static_cast<int>(allocated),
-                      CodeObjectRequired::kNo);
-
-  __ MovFromFloatParameter(d0);
-  __ sqdbr(d0, d0);
-  __ MovToFloatResult(d0);
-  __ Ret();
-
-  CodeDesc desc;
-  masm.GetCode(isolate, &desc);
-  DCHECK(ABI_USES_FUNCTION_DESCRIPTORS ||
-         !RelocInfo::RequiresRelocation(isolate, desc));
-
-  Assembler::FlushICache(isolate, buffer, allocated);
-  CHECK(SetPermissions(buffer, allocated, PageAllocator::kReadExecute));
-  return FUNCTION_CAST<UnaryMathFunctionWithIsolate>(buffer);
-#endif
-}
-
-#undef __
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_S390
diff --git a/src/v8/src/s390/constants-s390.cc b/src/v8/src/s390/constants-s390.cc
deleted file mode 100644
index bda7f61..0000000
--- a/src/v8/src/s390/constants-s390.cc
+++ /dev/null
@@ -1,309 +0,0 @@
-// Copyright 2015 the V8 project 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 V8_TARGET_ARCH_S390
-
-#include "src/s390/constants-s390.h"
-
-namespace v8 {
-namespace internal {
-
-Instruction::OpcodeFormatType Instruction::OpcodeFormatTable[] = {
-    // Based on Figure B-3 in z/Architecture Principles of
-    // Operation.
-    TWO_BYTE_OPCODE,           // 0x00
-    TWO_BYTE_OPCODE,           // 0x01
-    TWO_BYTE_DISJOINT_OPCODE,  // 0x02
-    TWO_BYTE_DISJOINT_OPCODE,  // 0x03
-    ONE_BYTE_OPCODE,           // 0x04
-    ONE_BYTE_OPCODE,           // 0x05
-    ONE_BYTE_OPCODE,           // 0x06
-    ONE_BYTE_OPCODE,           // 0x07
-    ONE_BYTE_OPCODE,           // 0x08
-    ONE_BYTE_OPCODE,           // 0x09
-    ONE_BYTE_OPCODE,           // 0x0A
-    ONE_BYTE_OPCODE,           // 0x0B
-    ONE_BYTE_OPCODE,           // 0x0C
-    ONE_BYTE_OPCODE,           // 0x0D
-    ONE_BYTE_OPCODE,           // 0x0E
-    ONE_BYTE_OPCODE,           // 0x0F
-    ONE_BYTE_OPCODE,           // 0x10
-    ONE_BYTE_OPCODE,           // 0x11
-    ONE_BYTE_OPCODE,           // 0x12
-    ONE_BYTE_OPCODE,           // 0x13
-    ONE_BYTE_OPCODE,           // 0x14
-    ONE_BYTE_OPCODE,           // 0x15
-    ONE_BYTE_OPCODE,           // 0x16
-    ONE_BYTE_OPCODE,           // 0x17
-    ONE_BYTE_OPCODE,           // 0x18
-    ONE_BYTE_OPCODE,           // 0x19
-    ONE_BYTE_OPCODE,           // 0x1A
-    ONE_BYTE_OPCODE,           // 0x1B
-    ONE_BYTE_OPCODE,           // 0x1C
-    ONE_BYTE_OPCODE,           // 0x1D
-    ONE_BYTE_OPCODE,           // 0x1E
-    ONE_BYTE_OPCODE,           // 0x1F
-    ONE_BYTE_OPCODE,           // 0x20
-    ONE_BYTE_OPCODE,           // 0x21
-    ONE_BYTE_OPCODE,           // 0x22
-    ONE_BYTE_OPCODE,           // 0x23
-    ONE_BYTE_OPCODE,           // 0x24
-    ONE_BYTE_OPCODE,           // 0x25
-    ONE_BYTE_OPCODE,           // 0x26
-    ONE_BYTE_OPCODE,           // 0x27
-    ONE_BYTE_OPCODE,           // 0x28
-    ONE_BYTE_OPCODE,           // 0x29
-    ONE_BYTE_OPCODE,           // 0x2A
-    ONE_BYTE_OPCODE,           // 0x2B
-    ONE_BYTE_OPCODE,           // 0x2C
-    ONE_BYTE_OPCODE,           // 0x2D
-    ONE_BYTE_OPCODE,           // 0x2E
-    ONE_BYTE_OPCODE,           // 0x2F
-    ONE_BYTE_OPCODE,           // 0x30
-    ONE_BYTE_OPCODE,           // 0x31
-    ONE_BYTE_OPCODE,           // 0x32
-    ONE_BYTE_OPCODE,           // 0x33
-    ONE_BYTE_OPCODE,           // 0x34
-    ONE_BYTE_OPCODE,           // 0x35
-    ONE_BYTE_OPCODE,           // 0x36
-    ONE_BYTE_OPCODE,           // 0x37
-    ONE_BYTE_OPCODE,           // 0x38
-    ONE_BYTE_OPCODE,           // 0x39
-    ONE_BYTE_OPCODE,           // 0x3A
-    ONE_BYTE_OPCODE,           // 0x3B
-    ONE_BYTE_OPCODE,           // 0x3C
-    ONE_BYTE_OPCODE,           // 0x3D
-    ONE_BYTE_OPCODE,           // 0x3E
-    ONE_BYTE_OPCODE,           // 0x3F
-    ONE_BYTE_OPCODE,           // 0x40
-    ONE_BYTE_OPCODE,           // 0x41
-    ONE_BYTE_OPCODE,           // 0x42
-    ONE_BYTE_OPCODE,           // 0x43
-    ONE_BYTE_OPCODE,           // 0x44
-    ONE_BYTE_OPCODE,           // 0x45
-    ONE_BYTE_OPCODE,           // 0x46
-    ONE_BYTE_OPCODE,           // 0x47
-    ONE_BYTE_OPCODE,           // 0x48
-    ONE_BYTE_OPCODE,           // 0x49
-    ONE_BYTE_OPCODE,           // 0x4A
-    ONE_BYTE_OPCODE,           // 0x4B
-    ONE_BYTE_OPCODE,           // 0x4C
-    ONE_BYTE_OPCODE,           // 0x4D
-    ONE_BYTE_OPCODE,           // 0x4E
-    ONE_BYTE_OPCODE,           // 0x4F
-    ONE_BYTE_OPCODE,           // 0x50
-    ONE_BYTE_OPCODE,           // 0x51
-    ONE_BYTE_OPCODE,           // 0x52
-    ONE_BYTE_OPCODE,           // 0x53
-    ONE_BYTE_OPCODE,           // 0x54
-    ONE_BYTE_OPCODE,           // 0x55
-    ONE_BYTE_OPCODE,           // 0x56
-    ONE_BYTE_OPCODE,           // 0x57
-    ONE_BYTE_OPCODE,           // 0x58
-    ONE_BYTE_OPCODE,           // 0x59
-    ONE_BYTE_OPCODE,           // 0x5A
-    ONE_BYTE_OPCODE,           // 0x5B
-    ONE_BYTE_OPCODE,           // 0x5C
-    ONE_BYTE_OPCODE,           // 0x5D
-    ONE_BYTE_OPCODE,           // 0x5E
-    ONE_BYTE_OPCODE,           // 0x5F
-    ONE_BYTE_OPCODE,           // 0x60
-    ONE_BYTE_OPCODE,           // 0x61
-    ONE_BYTE_OPCODE,           // 0x62
-    ONE_BYTE_OPCODE,           // 0x63
-    ONE_BYTE_OPCODE,           // 0x64
-    ONE_BYTE_OPCODE,           // 0x65
-    ONE_BYTE_OPCODE,           // 0x66
-    ONE_BYTE_OPCODE,           // 0x67
-    ONE_BYTE_OPCODE,           // 0x68
-    ONE_BYTE_OPCODE,           // 0x69
-    ONE_BYTE_OPCODE,           // 0x6A
-    ONE_BYTE_OPCODE,           // 0x6B
-    ONE_BYTE_OPCODE,           // 0x6C
-    ONE_BYTE_OPCODE,           // 0x6D
-    ONE_BYTE_OPCODE,           // 0x6E
-    ONE_BYTE_OPCODE,           // 0x6F
-    ONE_BYTE_OPCODE,           // 0x70
-    ONE_BYTE_OPCODE,           // 0x71
-    ONE_BYTE_OPCODE,           // 0x72
-    ONE_BYTE_OPCODE,           // 0x73
-    ONE_BYTE_OPCODE,           // 0x74
-    ONE_BYTE_OPCODE,           // 0x75
-    ONE_BYTE_OPCODE,           // 0x76
-    ONE_BYTE_OPCODE,           // 0x77
-    ONE_BYTE_OPCODE,           // 0x78
-    ONE_BYTE_OPCODE,           // 0x79
-    ONE_BYTE_OPCODE,           // 0x7A
-    ONE_BYTE_OPCODE,           // 0x7B
-    ONE_BYTE_OPCODE,           // 0x7C
-    ONE_BYTE_OPCODE,           // 0x7D
-    ONE_BYTE_OPCODE,           // 0x7E
-    ONE_BYTE_OPCODE,           // 0x7F
-    ONE_BYTE_OPCODE,           // 0x80
-    ONE_BYTE_OPCODE,           // 0x81
-    ONE_BYTE_OPCODE,           // 0x82
-    ONE_BYTE_OPCODE,           // 0x83
-    ONE_BYTE_OPCODE,           // 0x84
-    ONE_BYTE_OPCODE,           // 0x85
-    ONE_BYTE_OPCODE,           // 0x86
-    ONE_BYTE_OPCODE,           // 0x87
-    ONE_BYTE_OPCODE,           // 0x88
-    ONE_BYTE_OPCODE,           // 0x89
-    ONE_BYTE_OPCODE,           // 0x8A
-    ONE_BYTE_OPCODE,           // 0x8B
-    ONE_BYTE_OPCODE,           // 0x8C
-    ONE_BYTE_OPCODE,           // 0x8D
-    ONE_BYTE_OPCODE,           // 0x8E
-    ONE_BYTE_OPCODE,           // 0x8F
-    ONE_BYTE_OPCODE,           // 0x90
-    ONE_BYTE_OPCODE,           // 0x91
-    ONE_BYTE_OPCODE,           // 0x92
-    ONE_BYTE_OPCODE,           // 0x93
-    ONE_BYTE_OPCODE,           // 0x94
-    ONE_BYTE_OPCODE,           // 0x95
-    ONE_BYTE_OPCODE,           // 0x96
-    ONE_BYTE_OPCODE,           // 0x97
-    ONE_BYTE_OPCODE,           // 0x98
-    ONE_BYTE_OPCODE,           // 0x99
-    ONE_BYTE_OPCODE,           // 0x9A
-    ONE_BYTE_OPCODE,           // 0x9B
-    TWO_BYTE_DISJOINT_OPCODE,  // 0x9C
-    TWO_BYTE_DISJOINT_OPCODE,  // 0x9D
-    TWO_BYTE_DISJOINT_OPCODE,  // 0x9E
-    TWO_BYTE_DISJOINT_OPCODE,  // 0x9F
-    TWO_BYTE_DISJOINT_OPCODE,  // 0xA0
-    TWO_BYTE_DISJOINT_OPCODE,  // 0xA1
-    TWO_BYTE_DISJOINT_OPCODE,  // 0xA2
-    TWO_BYTE_DISJOINT_OPCODE,  // 0xA3
-    TWO_BYTE_DISJOINT_OPCODE,  // 0xA4
-    THREE_NIBBLE_OPCODE,       // 0xA5
-    TWO_BYTE_DISJOINT_OPCODE,  // 0xA6
-    THREE_NIBBLE_OPCODE,       // 0xA7
-    ONE_BYTE_OPCODE,           // 0xA8
-    ONE_BYTE_OPCODE,           // 0xA9
-    ONE_BYTE_OPCODE,           // 0xAA
-    ONE_BYTE_OPCODE,           // 0xAB
-    ONE_BYTE_OPCODE,           // 0xAC
-    ONE_BYTE_OPCODE,           // 0xAD
-    ONE_BYTE_OPCODE,           // 0xAE
-    ONE_BYTE_OPCODE,           // 0xAF
-    ONE_BYTE_OPCODE,           // 0xB0
-    ONE_BYTE_OPCODE,           // 0xB1
-    TWO_BYTE_OPCODE,           // 0xB2
-    TWO_BYTE_OPCODE,           // 0xB3
-    TWO_BYTE_DISJOINT_OPCODE,  // 0xB4
-    TWO_BYTE_DISJOINT_OPCODE,  // 0xB5
-    TWO_BYTE_DISJOINT_OPCODE,  // 0xB6
-    TWO_BYTE_DISJOINT_OPCODE,  // 0xB7
-    TWO_BYTE_DISJOINT_OPCODE,  // 0xB8
-    TWO_BYTE_OPCODE,           // 0xB9
-    ONE_BYTE_OPCODE,           // 0xBA
-    ONE_BYTE_OPCODE,           // 0xBB
-    ONE_BYTE_OPCODE,           // 0xBC
-    ONE_BYTE_OPCODE,           // 0xBD
-    ONE_BYTE_OPCODE,           // 0xBE
-    ONE_BYTE_OPCODE,           // 0xBF
-    THREE_NIBBLE_OPCODE,       // 0xC0
-    THREE_NIBBLE_OPCODE,       // 0xC1
-    THREE_NIBBLE_OPCODE,       // 0xC2
-    THREE_NIBBLE_OPCODE,       // 0xC3
-    THREE_NIBBLE_OPCODE,       // 0xC4
-    THREE_NIBBLE_OPCODE,       // 0xC5
-    THREE_NIBBLE_OPCODE,       // 0xC6
-    ONE_BYTE_OPCODE,           // 0xC7
-    THREE_NIBBLE_OPCODE,       // 0xC8
-    THREE_NIBBLE_OPCODE,       // 0xC9
-    THREE_NIBBLE_OPCODE,       // 0xCA
-    THREE_NIBBLE_OPCODE,       // 0xCB
-    THREE_NIBBLE_OPCODE,       // 0xCC
-    TWO_BYTE_DISJOINT_OPCODE,  // 0xCD
-    TWO_BYTE_DISJOINT_OPCODE,  // 0xCE
-    TWO_BYTE_DISJOINT_OPCODE,  // 0xCF
-    ONE_BYTE_OPCODE,           // 0xD0
-    ONE_BYTE_OPCODE,           // 0xD1
-    ONE_BYTE_OPCODE,           // 0xD2
-    ONE_BYTE_OPCODE,           // 0xD3
-    ONE_BYTE_OPCODE,           // 0xD4
-    ONE_BYTE_OPCODE,           // 0xD5
-    ONE_BYTE_OPCODE,           // 0xD6
-    ONE_BYTE_OPCODE,           // 0xD7
-    ONE_BYTE_OPCODE,           // 0xD8
-    ONE_BYTE_OPCODE,           // 0xD9
-    ONE_BYTE_OPCODE,           // 0xDA
-    ONE_BYTE_OPCODE,           // 0xDB
-    ONE_BYTE_OPCODE,           // 0xDC
-    ONE_BYTE_OPCODE,           // 0xDD
-    ONE_BYTE_OPCODE,           // 0xDE
-    ONE_BYTE_OPCODE,           // 0xDF
-    ONE_BYTE_OPCODE,           // 0xE0
-    ONE_BYTE_OPCODE,           // 0xE1
-    ONE_BYTE_OPCODE,           // 0xE2
-    TWO_BYTE_DISJOINT_OPCODE,  // 0xE3
-    TWO_BYTE_DISJOINT_OPCODE,  // 0xE4
-    TWO_BYTE_OPCODE,           // 0xE5
-    TWO_BYTE_DISJOINT_OPCODE,  // 0xE6
-    TWO_BYTE_DISJOINT_OPCODE,  // 0xE7
-    ONE_BYTE_OPCODE,           // 0xE8
-    ONE_BYTE_OPCODE,           // 0xE9
-    ONE_BYTE_OPCODE,           // 0xEA
-    TWO_BYTE_DISJOINT_OPCODE,  // 0xEB
-    TWO_BYTE_DISJOINT_OPCODE,  // 0xEC
-    TWO_BYTE_DISJOINT_OPCODE,  // 0xED
-    ONE_BYTE_OPCODE,           // 0xEE
-    ONE_BYTE_OPCODE,           // 0xEF
-    ONE_BYTE_OPCODE,           // 0xF0
-    ONE_BYTE_OPCODE,           // 0xF1
-    ONE_BYTE_OPCODE,           // 0xF2
-    ONE_BYTE_OPCODE,           // 0xF3
-    ONE_BYTE_OPCODE,           // 0xF4
-    ONE_BYTE_OPCODE,           // 0xF5
-    ONE_BYTE_OPCODE,           // 0xF6
-    ONE_BYTE_OPCODE,           // 0xF7
-    ONE_BYTE_OPCODE,           // 0xF8
-    ONE_BYTE_OPCODE,           // 0xF9
-    ONE_BYTE_OPCODE,           // 0xFA
-    ONE_BYTE_OPCODE,           // 0xFB
-    ONE_BYTE_OPCODE,           // 0xFC
-    ONE_BYTE_OPCODE,           // 0xFD
-    TWO_BYTE_DISJOINT_OPCODE,  // 0xFE
-    TWO_BYTE_DISJOINT_OPCODE,  // 0xFF
-};
-
-// These register names are defined in a way to match the native disassembler
-// formatting. See for example the command "objdump -d <binary file>".
-const char* Registers::names_[kNumRegisters] = {
-    "r0", "r1", "r2",  "r3", "r4", "r5",  "r6",  "r7",
-    "r8", "r9", "r10", "fp", "ip", "r13", "r14", "sp"};
-
-const char* DoubleRegisters::names_[kNumDoubleRegisters] = {
-    "f0", "f1", "f2",  "f3",  "f4",  "f5",  "f6",  "f7",
-    "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15"};
-
-int DoubleRegisters::Number(const char* name) {
-  for (int i = 0; i < kNumDoubleRegisters; i++) {
-    if (strcmp(names_[i], name) == 0) {
-      return i;
-    }
-  }
-
-  // No register with the requested name found.
-  return kNoRegister;
-}
-
-int Registers::Number(const char* name) {
-  // Look through the canonical names.
-  for (int i = 0; i < kNumRegisters; i++) {
-    if (strcmp(names_[i], name) == 0) {
-      return i;
-    }
-  }
-
-  // No register with the requested name found.
-  return kNoRegister;
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_S390
diff --git a/src/v8/src/s390/constants-s390.h b/src/v8/src/s390/constants-s390.h
deleted file mode 100644
index dee21b2..0000000
--- a/src/v8/src/s390/constants-s390.h
+++ /dev/null
@@ -1,2392 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_S390_CONSTANTS_S390_H_
-#define V8_S390_CONSTANTS_S390_H_
-
-// Get the standard printf format macros for C99 stdint types.
-#ifndef __STDC_FORMAT_MACROS
-#define __STDC_FORMAT_MACROS
-#endif
-#include <inttypes.h>
-
-#include <stdint.h>
-
-#include "src/base/logging.h"
-#include "src/base/macros.h"
-#include "src/globals.h"
-
-// UNIMPLEMENTED_ macro for S390.
-#ifdef DEBUG
-#define UNIMPLEMENTED_S390()                                               \
-  v8::internal::PrintF("%s, \tline %d: \tfunction %s not implemented. \n", \
-                       __FILE__, __LINE__, __func__)
-#else
-#define UNIMPLEMENTED_S390()
-#endif
-
-namespace v8 {
-namespace internal {
-
-// Number of registers
-const int kNumRegisters = 16;
-
-// FP support.
-const int kNumDoubleRegisters = 16;
-
-const int kNoRegister = -1;
-
-// sign-extend the least significant 16-bits of value <imm>
-#define SIGN_EXT_IMM16(imm) ((static_cast<int>(imm) << 16) >> 16)
-
-// sign-extend the least significant 26-bits of value <imm>
-#define SIGN_EXT_IMM26(imm) ((static_cast<int>(imm) << 6) >> 6)
-
-// -----------------------------------------------------------------------------
-// Conditions.
-
-// Defines constants and accessor classes to assemble, disassemble and
-// simulate z/Architecture instructions.
-//
-// Section references in the code refer to the "z/Architecture Principles
-// Of Operation" http://publibfi.boulder.ibm.com/epubs/pdf/dz9zr009.pdf
-//
-
-// Constants for specific fields are defined in their respective named enums.
-// General constants are in an anonymous enum in class Instr.
-enum Condition {
-  kNoCondition = -1,
-  eq = 0x8,  // Equal.
-  ne = 0x7,  // Not equal.
-  ge = 0xa,  // Greater or equal.
-  lt = 0x4,  // Less than.
-  gt = 0x2,  // Greater than.
-  le = 0xc,  // Less then or equal
-  al = 0xf,  // Always.
-
-  CC_NOP = 0x0,           // S390 NOP
-  CC_EQ = 0x08,           // S390 condition code 0b1000
-  CC_LT = 0x04,           // S390 condition code 0b0100
-  CC_LE = CC_EQ | CC_LT,  // S390 condition code 0b1100
-  CC_GT = 0x02,           // S390 condition code 0b0010
-  CC_GE = CC_EQ | CC_GT,  // S390 condition code 0b1010
-  CC_OF = 0x01,           // S390 condition code 0b0001
-  CC_NOF = 0x0E,          // S390 condition code 0b1110
-  CC_ALWAYS = 0x0F,       // S390 always taken branch
-  unordered = CC_OF,      // Floating-point unordered
-  ordered = CC_NOF,       // floating-point ordered
-  overflow = CC_OF,       // Summary overflow
-  nooverflow = CC_NOF,
-
-  mask0x0 = 0,  // no jumps
-  mask0x1 = 1,
-  mask0x2 = 2,
-  mask0x3 = 3,
-  mask0x4 = 4,
-  mask0x5 = 5,
-  mask0x6 = 6,
-  mask0x7 = 7,
-  mask0x8 = 8,
-  mask0x9 = 9,
-  mask0xA = 10,
-  mask0xB = 11,
-  mask0xC = 12,
-  mask0xD = 13,
-  mask0xE = 14,
-  mask0xF = 15,
-
-  // Rounding modes for floating poing facility
-  CURRENT_ROUNDING_MODE = 0,
-  ROUND_TO_NEAREST_WITH_TIES_AWAY_FROM_0 = 1,
-  ROUND_TO_PREPARE_FOR_SHORTER_PRECISION = 3,
-  ROUND_TO_NEAREST_WITH_TIES_TO_EVEN = 4,
-  ROUND_TOWARD_0 = 5,
-  ROUND_TOWARD_PLUS_INFINITE = 6,
-  ROUND_TOWARD_MINUS_INFINITE = 7
-};
-
-inline Condition NegateCondition(Condition cond) {
-  DCHECK(cond != al);
-  switch (cond) {
-    case eq:
-      return ne;
-    case ne:
-      return eq;
-    case ge:
-      return lt;
-    case gt:
-      return le;
-    case le:
-      return gt;
-    case lt:
-      return ge;
-    case lt | gt:
-      return eq;
-    case le | ge:
-      return CC_OF;
-    case CC_OF:
-      return CC_NOF;
-    default:
-      DCHECK(false);
-  }
-  return al;
-}
-
-// Commute a condition such that {a cond b == b cond' a}.
-inline Condition CommuteCondition(Condition cond) {
-  switch (cond) {
-    case lt:
-      return gt;
-    case gt:
-      return lt;
-    case ge:
-      return le;
-    case le:
-      return ge;
-    case eq:
-      return eq;
-    case ne:
-      return ne;
-    default:
-      DCHECK(false);
-      return cond;
-  }
-}
-
-// -----------------------------------------------------------------------------
-// Instructions encoding.
-
-// Instr is merely used by the Assembler to distinguish 32bit integers
-// representing instructions from usual 32 bit values.
-// Instruction objects are pointers to 32bit values, and provide methods to
-// access the various ISA fields.
-typedef int32_t Instr;
-typedef uint16_t TwoByteInstr;
-typedef uint32_t FourByteInstr;
-typedef uint64_t SixByteInstr;
-
-#define S390_RSY_A_OPCODE_LIST(V)                                              \
-  V(lmg, LMG, 0xEB04)     /* type = RSY_A LOAD MULTIPLE (64)  */               \
-  V(srag, SRAG, 0xEB0A)   /* type = RSY_A SHIFT RIGHT SINGLE (64)  */          \
-  V(slag, SLAG, 0xEB0B)   /* type = RSY_A SHIFT LEFT SINGLE (64)  */           \
-  V(srlg, SRLG, 0xEB0C)   /* type = RSY_A SHIFT RIGHT SINGLE LOGICAL (64)  */  \
-  V(sllg, SLLG, 0xEB0D)   /* type = RSY_A SHIFT LEFT SINGLE LOGICAL (64)  */   \
-  V(tracg, TRACG, 0xEB0F) /* type = RSY_A TRACE (64)  */                       \
-  V(csy, CSY, 0xEB14)     /* type = RSY_A COMPARE AND SWAP (32)  */            \
-  V(rllg, RLLG, 0xEB1C)   /* type = RSY_A ROTATE LEFT SINGLE LOGICAL (64)  */  \
-  V(rll, RLL, 0xEB1D)     /* type = RSY_A ROTATE LEFT SINGLE LOGICAL (32)  */  \
-  V(stmg, STMG, 0xEB24)   /* type = RSY_A STORE MULTIPLE (64)  */              \
-  V(stctg, STCTG, 0xEB25) /* type = RSY_A STORE CONTROL (64)  */               \
-  V(stmh, STMH, 0xEB26)   /* type = RSY_A STORE MULTIPLE HIGH (32)  */         \
-  V(lctlg, LCTLG, 0xEB2F) /* type = RSY_A LOAD CONTROL (64)  */                \
-  V(csg, CSG, 0xEB30)     /* type = RSY_A COMPARE AND SWAP (64)  */            \
-  V(cdsy, CDSY, 0xEB31)   /* type = RSY_A COMPARE DOUBLE AND SWAP (32)  */     \
-  V(cdsg, CDSG, 0xEB3E)   /* type = RSY_A COMPARE DOUBLE AND SWAP (64)  */     \
-  V(bxhg, BXHG, 0xEB44)   /* type = RSY_A BRANCH ON INDEX HIGH (64)  */        \
-  V(bxleg, BXLEG, 0xEB45) /* type = RSY_A BRANCH ON INDEX LOW OR EQUAL (64) */ \
-  V(ecag, ECAG, 0xEB4C)   /* type = RSY_A EXTRACT CPU ATTRIBUTE  */            \
-  V(mvclu, MVCLU, 0xEB8E) /* type = RSY_A MOVE LONG UNICODE  */                \
-  V(clclu, CLCLU, 0xEB8F) /* type = RSY_A COMPARE LOGICAL LONG UNICODE  */     \
-  V(stmy, STMY, 0xEB90)   /* type = RSY_A STORE MULTIPLE (32)  */              \
-  V(lmh, LMH, 0xEB96)     /* type = RSY_A LOAD MULTIPLE HIGH (32)  */          \
-  V(lmy, LMY, 0xEB98)     /* type = RSY_A LOAD MULTIPLE (32)  */               \
-  V(lamy, LAMY, 0xEB9A)   /* type = RSY_A LOAD ACCESS MULTIPLE  */             \
-  V(stamy, STAMY, 0xEB9B) /* type = RSY_A STORE ACCESS MULTIPLE  */            \
-  V(srak, SRAK, 0xEBDC)   /* type = RSY_A SHIFT RIGHT SINGLE (32)  */          \
-  V(slak, SLAK, 0xEBDD)   /* type = RSY_A SHIFT LEFT SINGLE (32)  */           \
-  V(srlk, SRLK, 0xEBDE)   /* type = RSY_A SHIFT RIGHT SINGLE LOGICAL (32)  */  \
-  V(sllk, SLLK, 0xEBDF)   /* type = RSY_A SHIFT LEFT SINGLE LOGICAL (32)  */   \
-  V(lang, LANG, 0xEBE4)   /* type = RSY_A LOAD AND AND (64)  */                \
-  V(laog, LAOG, 0xEBE6)   /* type = RSY_A LOAD AND OR (64)  */                 \
-  V(laxg, LAXG, 0xEBE7)   /* type = RSY_A LOAD AND EXCLUSIVE OR (64)  */       \
-  V(laag, LAAG, 0xEBE8)   /* type = RSY_A LOAD AND ADD (64)  */                \
-  V(laalg, LAALG, 0xEBEA) /* type = RSY_A LOAD AND ADD LOGICAL (64)  */        \
-  V(lan, LAN, 0xEBF4)     /* type = RSY_A LOAD AND AND (32)  */                \
-  V(lao, LAO, 0xEBF6)     /* type = RSY_A LOAD AND OR (32)  */                 \
-  V(lax, LAX, 0xEBF7)     /* type = RSY_A LOAD AND EXCLUSIVE OR (32)  */       \
-  V(laa, LAA, 0xEBF8)     /* type = RSY_A LOAD AND ADD (32)  */                \
-  V(laal, LAAL, 0xEBFA)   /* type = RSY_A LOAD AND ADD LOGICAL (32)  */
-
-#define S390_RSY_B_OPCODE_LIST(V)                                              \
-  V(clmh, CLMH,                                                                \
-    0xEB20) /* type = RSY_B COMPARE LOGICAL CHAR. UNDER MASK (high)  */        \
-  V(clmy, CLMY,                                                                \
-    0xEB21) /* type = RSY_B COMPARE LOGICAL CHAR. UNDER MASK (low)  */         \
-  V(clt, CLT, 0xEB23)   /* type = RSY_B COMPARE LOGICAL AND TRAP (32)  */      \
-  V(clgt, CLGT, 0xEB2B) /* type = RSY_B COMPARE LOGICAL AND TRAP (64)  */      \
-  V(stcmh, STCMH,                                                              \
-    0xEB2C) /* type = RSY_B STORE CHARACTERS UNDER MASK (high)  */             \
-  V(stcmy, STCMY, 0xEB2D) /* type = RSY_B STORE CHARACTERS UNDER MASK (low) */ \
-  V(icmh, ICMH, 0xEB80) /* type = RSY_B INSERT CHARACTERS UNDER MASK (high) */ \
-  V(icmy, ICMY, 0xEB81) /* type = RSY_B INSERT CHARACTERS UNDER MASK (low)  */ \
-  V(locfh, LOCFH, 0xEBE0)   /* type = RSY_B LOAD HIGH ON CONDITION (32)  */    \
-  V(stocfh, STOCFH, 0xEBE1) /* type = RSY_B STORE HIGH ON CONDITION  */        \
-  V(locg, LOCG, 0xEBE2)     /* type = RSY_B LOAD ON CONDITION (64)  */         \
-  V(stocg, STOCG, 0xEBE3)   /* type = RSY_B STORE ON CONDITION (64)  */        \
-  V(loc, LOC, 0xEBF2)       /* type = RSY_B LOAD ON CONDITION (32)  */         \
-  V(stoc, STOC, 0xEBF3)     /* type = RSY_B STORE ON CONDITION (32)  */
-
-#define S390_RXE_OPCODE_LIST(V)                                                \
-  V(lcbb, LCBB, 0xE727) /* type = RXE   LOAD COUNT TO BLOCK BOUNDARY  */       \
-  V(ldeb, LDEB, 0xED04) /* type = RXE   LOAD LENGTHENED (short to long BFP) */ \
-  V(lxdb, LXDB,                                                                \
-    0xED05) /* type = RXE   LOAD LENGTHENED (long to extended BFP)  */         \
-  V(lxeb, LXEB,                                                                \
-    0xED06) /* type = RXE   LOAD LENGTHENED (short to extended BFP)  */        \
-  V(mxdb, MXDB, 0xED07) /* type = RXE   MULTIPLY (long to extended BFP)  */    \
-  V(keb, KEB, 0xED08)   /* type = RXE   COMPARE AND SIGNAL (short BFP)  */     \
-  V(ceb, CEB, 0xED09)   /* type = RXE   COMPARE (short BFP)  */                \
-  V(aeb, AEB, 0xED0A)   /* type = RXE   ADD (short BFP)  */                    \
-  V(seb, SEB, 0xED0B)   /* type = RXE   SUBTRACT (short BFP)  */               \
-  V(mdeb, MDEB, 0xED0C) /* type = RXE   MULTIPLY (short to long BFP)  */       \
-  V(deb, DEB, 0xED0D)   /* type = RXE   DIVIDE (short BFP)  */                 \
-  V(tceb, TCEB, 0xED10) /* type = RXE   TEST DATA CLASS (short BFP)  */        \
-  V(tcdb, TCDB, 0xED11) /* type = RXE   TEST DATA CLASS (long BFP)  */         \
-  V(tcxb, TCXB, 0xED12) /* type = RXE   TEST DATA CLASS (extended BFP)  */     \
-  V(sqeb, SQEB, 0xED14) /* type = RXE   SQUARE ROOT (short BFP)  */            \
-  V(sqdb, SQDB, 0xED15) /* type = RXE   SQUARE ROOT (long BFP)  */             \
-  V(meeb, MEEB, 0xED17) /* type = RXE   MULTIPLY (short BFP)  */               \
-  V(kdb, KDB, 0xED18)   /* type = RXE   COMPARE AND SIGNAL (long BFP)  */      \
-  V(cdb, CDB, 0xED19)   /* type = RXE   COMPARE (long BFP)  */                 \
-  V(adb, ADB, 0xED1A)   /* type = RXE   ADD (long BFP)  */                     \
-  V(sdb, SDB, 0xED1B)   /* type = RXE   SUBTRACT (long BFP)  */                \
-  V(mdb, MDB, 0xED1C)   /* type = RXE   MULTIPLY (long BFP)  */                \
-  V(ddb, DDB, 0xED1D)   /* type = RXE   DIVIDE (long BFP)  */                  \
-  V(lde, LDE, 0xED24) /* type = RXE   LOAD LENGTHENED (short to long HFP)  */  \
-  V(lxd, LXD,                                                                  \
-    0xED25) /* type = RXE   LOAD LENGTHENED (long to extended HFP)  */         \
-  V(lxe, LXE,                                                                  \
-    0xED26) /* type = RXE   LOAD LENGTHENED (short to extended HFP)  */        \
-  V(sqe, SQE, 0xED34)     /* type = RXE   SQUARE ROOT (short HFP)  */          \
-  V(sqd, SQD, 0xED35)     /* type = RXE   SQUARE ROOT (long HFP)  */           \
-  V(mee, MEE, 0xED37)     /* type = RXE   MULTIPLY (short HFP)  */             \
-  V(tdcet, TDCET, 0xED50) /* type = RXE   TEST DATA CLASS (short DFP)  */      \
-  V(tdget, TDGET, 0xED51) /* type = RXE   TEST DATA GROUP (short DFP)  */      \
-  V(tdcdt, TDCDT, 0xED54) /* type = RXE   TEST DATA CLASS (long DFP)  */       \
-  V(tdgdt, TDGDT, 0xED55) /* type = RXE   TEST DATA GROUP (long DFP)  */       \
-  V(tdcxt, TDCXT, 0xED58) /* type = RXE   TEST DATA CLASS (extended DFP)  */   \
-  V(tdgxt, TDGXT, 0xED59) /* type = RXE   TEST DATA GROUP (extended DFP)  */
-
-#define S390_RRF_A_OPCODE_LIST(V)                                           \
-  V(ipte, IPTE, 0xB221)     /* type = RRF_A INVALIDATE PAGE TABLE ENTRY  */ \
-  V(mdtr, MDTR, 0xB3D0)     /* type = RRF_A MULTIPLY (long DFP)  */         \
-  V(mdtra, MDTRA, 0xB3D0)   /* type = RRF_A MULTIPLY (long DFP)  */         \
-  V(ddtr, DDTR, 0xB3D1)     /* type = RRF_A DIVIDE (long DFP)  */           \
-  V(ddtra, DDTRA, 0xB3D1)   /* type = RRF_A DIVIDE (long DFP)  */           \
-  V(adtr, ADTR, 0xB3D2)     /* type = RRF_A ADD (long DFP)  */              \
-  V(adtra, ADTRA, 0xB3D2)   /* type = RRF_A ADD (long DFP)  */              \
-  V(sdtr, SDTR, 0xB3D3)     /* type = RRF_A SUBTRACT (long DFP)  */         \
-  V(sdtra, SDTRA, 0xB3D3)   /* type = RRF_A SUBTRACT (long DFP)  */         \
-  V(mxtr, MXTR, 0xB3D8)     /* type = RRF_A MULTIPLY (extended DFP)  */     \
-  V(mxtra, MXTRA, 0xB3D8)   /* type = RRF_A MULTIPLY (extended DFP)  */     \
-  V(msrkc, MSRKC, 0xB9FD)   /* type = RRF_A MULTIPLY (32)*/                 \
-  V(msgrkc, MSGRKC, 0xB9ED) /* type = RRF_A MULTIPLY (64)*/                 \
-  V(dxtr, DXTR, 0xB3D9)     /* type = RRF_A DIVIDE (extended DFP)  */       \
-  V(dxtra, DXTRA, 0xB3D9)   /* type = RRF_A DIVIDE (extended DFP)  */       \
-  V(axtr, AXTR, 0xB3DA)     /* type = RRF_A ADD (extended DFP)  */          \
-  V(axtra, AXTRA, 0xB3DA)   /* type = RRF_A ADD (extended DFP)  */          \
-  V(sxtr, SXTR, 0xB3DB)     /* type = RRF_A SUBTRACT (extended DFP)  */     \
-  V(sxtra, SXTRA, 0xB3DB)   /* type = RRF_A SUBTRACT (extended DFP)  */     \
-  V(ahhhr, AHHHR, 0xB9C8)   /* type = RRF_A ADD HIGH (32)  */               \
-  V(shhhr, SHHHR, 0xB9C9)   /* type = RRF_A SUBTRACT HIGH (32)  */          \
-  V(alhhhr, ALHHHR, 0xB9CA) /* type = RRF_A ADD LOGICAL HIGH (32)  */       \
-  V(slhhhr, SLHHHR, 0xB9CB) /* type = RRF_A SUBTRACT LOGICAL HIGH (32)  */  \
-  V(ahhlr, AHHLR, 0xB9D8)   /* type = RRF_A ADD HIGH (32)  */               \
-  V(shhlr, SHHLR, 0xB9D9)   /* type = RRF_A SUBTRACT HIGH (32)  */          \
-  V(alhhlr, ALHHLR, 0xB9DA) /* type = RRF_A ADD LOGICAL HIGH (32)  */       \
-  V(slhhlr, SLHHLR, 0xB9DB) /* type = RRF_A SUBTRACT LOGICAL HIGH (32)  */  \
-  V(ngrk, NGRK, 0xB9E4)     /* type = RRF_A AND (64)  */                    \
-  V(ogrk, OGRK, 0xB9E6)     /* type = RRF_A OR (64)  */                     \
-  V(xgrk, XGRK, 0xB9E7)     /* type = RRF_A EXCLUSIVE OR (64)  */           \
-  V(agrk, AGRK, 0xB9E8)     /* type = RRF_A ADD (64)  */                    \
-  V(sgrk, SGRK, 0xB9E9)     /* type = RRF_A SUBTRACT (64)  */               \
-  V(algrk, ALGRK, 0xB9EA)   /* type = RRF_A ADD LOGICAL (64)  */            \
-  V(slgrk, SLGRK, 0xB9EB)   /* type = RRF_A SUBTRACT LOGICAL (64)  */       \
-  V(nrk, NRK, 0xB9F4)       /* type = RRF_A AND (32)  */                    \
-  V(ork, ORK, 0xB9F6)       /* type = RRF_A OR (32)  */                     \
-  V(xrk, XRK, 0xB9F7)       /* type = RRF_A EXCLUSIVE OR (32)  */           \
-  V(ark, ARK, 0xB9F8)       /* type = RRF_A ADD (32)  */                    \
-  V(srk, SRK, 0xB9F9)       /* type = RRF_A SUBTRACT (32)  */               \
-  V(alrk, ALRK, 0xB9FA)     /* type = RRF_A ADD LOGICAL (32)  */            \
-  V(slrk, SLRK, 0xB9FB)     /* type = RRF_A SUBTRACT LOGICAL (32)  */
-
-#define S390_RXF_OPCODE_LIST(V)                                                \
-  V(maeb, MAEB, 0xED0E) /* type = RXF   MULTIPLY AND ADD (short BFP)  */       \
-  V(mseb, MSEB, 0xED0F) /* type = RXF   MULTIPLY AND SUBTRACT (short BFP)  */  \
-  V(madb, MADB, 0xED1E) /* type = RXF   MULTIPLY AND ADD (long BFP)  */        \
-  V(msdb, MSDB, 0xED1F) /* type = RXF   MULTIPLY AND SUBTRACT (long BFP)  */   \
-  V(mae, MAE, 0xED2E)   /* type = RXF   MULTIPLY AND ADD (short HFP)  */       \
-  V(mse, MSE, 0xED2F)   /* type = RXF   MULTIPLY AND SUBTRACT (short HFP)  */  \
-  V(mayl, MAYL,                                                                \
-    0xED38) /* type = RXF   MULTIPLY AND ADD UNNRM. (long to ext. low HFP)  */ \
-  V(myl, MYL,                                                                  \
-    0xED39) /* type = RXF   MULTIPLY UNNORM. (long to ext. low HFP)  */        \
-  V(may, MAY,                                                                  \
-    0xED3A) /* type = RXF   MULTIPLY & ADD UNNORMALIZED (long to ext. HFP)  */ \
-  V(my, MY,                                                                    \
-    0xED3B) /* type = RXF   MULTIPLY UNNORMALIZED (long to ext. HFP)  */       \
-  V(mayh, MAYH,                                                                \
-    0xED3C) /* type = RXF   MULTIPLY AND ADD UNNRM. (long to ext. high HFP) */ \
-  V(myh, MYH,                                                                  \
-    0xED3D) /* type = RXF   MULTIPLY UNNORM. (long to ext. high HFP)  */       \
-  V(mad, MAD, 0xED3E)   /* type = RXF   MULTIPLY AND ADD (long HFP)  */        \
-  V(msd, MSD, 0xED3F)   /* type = RXF   MULTIPLY AND SUBTRACT (long HFP)  */   \
-  V(sldt, SLDT, 0xED40) /* type = RXF   SHIFT SIGNIFICAND LEFT (long DFP)  */  \
-  V(srdt, SRDT, 0xED41) /* type = RXF   SHIFT SIGNIFICAND RIGHT (long DFP)  */ \
-  V(slxt, SLXT,                                                                \
-    0xED48) /* type = RXF   SHIFT SIGNIFICAND LEFT (extended DFP)  */          \
-  V(srxt, SRXT,                                                                \
-    0xED49) /* type = RXF   SHIFT SIGNIFICAND RIGHT (extended DFP)  */
-
-#define S390_IE_OPCODE_LIST(V) \
-  V(niai, NIAI, 0xB2FA) /* type = IE    NEXT INSTRUCTION ACCESS INTENT  */
-
-#define S390_RRF_B_OPCODE_LIST(V)                                           \
-  V(diebr, DIEBR, 0xB353) /* type = RRF_B DIVIDE TO INTEGER (short BFP)  */ \
-  V(didbr, DIDBR, 0xB35B) /* type = RRF_B DIVIDE TO INTEGER (long BFP)  */  \
-  V(cpsdr, CPSDR, 0xB372) /* type = RRF_B COPY SIGN (long)  */              \
-  V(qadtr, QADTR, 0xB3F5) /* type = RRF_B QUANTIZE (long DFP)  */           \
-  V(iedtr, IEDTR,                                                           \
-    0xB3F6) /* type = RRF_B INSERT BIASED EXPONENT (64 to long DFP)  */     \
-  V(rrdtr, RRDTR, 0xB3F7) /* type = RRF_B REROUND (long DFP)  */            \
-  V(qaxtr, QAXTR, 0xB3FD) /* type = RRF_B QUANTIZE (extended DFP)  */       \
-  V(iextr, IEXTR,                                                           \
-    0xB3FE) /* type = RRF_B INSERT BIASED EXPONENT (64 to extended DFP)  */ \
-  V(rrxtr, RRXTR, 0xB3FF) /* type = RRF_B REROUND (extended DFP)  */        \
-  V(kmctr, KMCTR, 0xB92D) /* type = RRF_B CIPHER MESSAGE WITH COUNTER  */   \
-  V(idte, IDTE, 0xB98E)   /* type = RRF_B INVALIDATE DAT TABLE ENTRY  */    \
-  V(crdte, CRDTE,                                                           \
-    0xB98F) /* type = RRF_B COMPARE AND REPLACE DAT TABLE ENTRY  */         \
-  V(lptea, LPTEA, 0xB9AA) /* type = RRF_B LOAD PAGE TABLE ENTRY ADDRESS  */
-
-#define S390_RRF_C_OPCODE_LIST(V)                                           \
-  V(sske, SSKE, 0xB22B)   /* type = RRF_C SET STORAGE KEY EXTENDED  */      \
-  V(cuutf, CUUTF, 0xB2A6) /* type = RRF_C CONVERT UNICODE TO UTF-8  */      \
-  V(cu21, CU21, 0xB2A6)   /* type = RRF_C CONVERT UTF-16 TO UTF-8  */       \
-  V(cutfu, CUTFU, 0xB2A7) /* type = RRF_C CONVERT UTF-8 TO UNICODE  */      \
-  V(cu12, CU12, 0xB2A7)   /* type = RRF_C CONVERT UTF-8 TO UTF-16  */       \
-  V(ppa, PPA, 0xB2E8)     /* type = RRF_C PERFORM PROCESSOR ASSIST  */      \
-  V(cgrt, CGRT, 0xB960)   /* type = RRF_C COMPARE AND TRAP (64)  */         \
-  V(clgrt, CLGRT, 0xB961) /* type = RRF_C COMPARE LOGICAL AND TRAP (64)  */ \
-  V(crt, CRT, 0xB972)     /* type = RRF_C COMPARE AND TRAP (32)  */         \
-  V(clrt, CLRT, 0xB973)   /* type = RRF_C COMPARE LOGICAL AND TRAP (32)  */ \
-  V(trtt, TRTT, 0xB990)   /* type = RRF_C TRANSLATE TWO TO TWO  */          \
-  V(trto, TRTO, 0xB991)   /* type = RRF_C TRANSLATE TWO TO ONE  */          \
-  V(trot, TROT, 0xB992)   /* type = RRF_C TRANSLATE ONE TO TWO  */          \
-  V(troo, TROO, 0xB993)   /* type = RRF_C TRANSLATE ONE TO ONE  */          \
-  V(cu14, CU14, 0xB9B0)   /* type = RRF_C CONVERT UTF-8 TO UTF-32  */       \
-  V(cu24, CU24, 0xB9B1)   /* type = RRF_C CONVERT UTF-16 TO UTF-32  */      \
-  V(trtre, TRTRE,                                                           \
-    0xB9BD) /* type = RRF_C TRANSLATE AND TEST REVERSE EXTENDED  */         \
-  V(trte, TRTE, 0xB9BF)     /* type = RRF_C TRANSLATE AND TEST EXTENDED  */ \
-  V(locfhr, LOCFHR, 0xB9E0) /* type = RRF_C LOAD HIGH ON CONDITION (32)  */ \
-  V(locgr, LOCGR, 0xB9E2)   /* type = RRF_C LOAD ON CONDITION (64)  */      \
-  V(locr, LOCR, 0xB9F2)     /* type = RRF_C LOAD ON CONDITION (32)  */
-
-#define S390_MII_OPCODE_LIST(V) \
-  V(bprp, BPRP, 0xC5) /* type = MII   BRANCH PREDICTION RELATIVE PRELOAD  */
-
-#define S390_RRF_D_OPCODE_LIST(V)                                         \
-  V(ldetr, LDETR,                                                         \
-    0xB3D4) /* type = RRF_D LOAD LENGTHENED (short to long DFP)  */       \
-  V(lxdtr, LXDTR,                                                         \
-    0xB3DC) /* type = RRF_D LOAD LENGTHENED (long to extended DFP)  */    \
-  V(csdtr, CSDTR,                                                         \
-    0xB3E3) /* type = RRF_D CONVERT TO SIGNED PACKED (long DFP to 64)  */ \
-  V(csxtr, CSXTR,                                                         \
-    0xB3EB) /* type = RRF_D CONVERT TO SIGNED PACKED (extended DFP to 128)  */
-
-#define S390_RRF_E_OPCODE_LIST(V)                                              \
-  V(ledbra, LEDBRA,                                                            \
-    0xB344) /* type = RRF_E LOAD ROUNDED (long to short BFP)  */               \
-  V(ldxbra, LDXBRA,                                                            \
-    0xB345) /* type = RRF_E LOAD ROUNDED (extended to long BFP)  */            \
-  V(lexbra, LEXBRA,                                                            \
-    0xB346) /* type = RRF_E LOAD ROUNDED (extended to short BFP)  */           \
-  V(fixbr, FIXBR, 0xB347)   /* type = RRF_E LOAD FP INTEGER (extended BFP)  */ \
-  V(fixbra, FIXBRA, 0xB347) /* type = RRF_E LOAD FP INTEGER (extended BFP)  */ \
-  V(tbedr, TBEDR,                                                              \
-    0xB350)             /* type = RRF_E CONVERT HFP TO BFP (long to short)  */ \
-  V(tbdr, TBDR, 0xB351) /* type = RRF_E CONVERT HFP TO BFP (long)  */          \
-  V(fiebr, FIEBR, 0xB357)   /* type = RRF_E LOAD FP INTEGER (short BFP)  */    \
-  V(fiebra, FIEBRA, 0xB357) /* type = RRF_E LOAD FP INTEGER (short BFP)  */    \
-  V(fidbr, FIDBR, 0xB35F)   /* type = RRF_E LOAD FP INTEGER (long BFP)  */     \
-  V(fidbra, FIDBRA, 0xB35F) /* type = RRF_E LOAD FP INTEGER (long BFP)  */     \
-  V(celfbr, CELFBR,                                                            \
-    0xB390) /* type = RRF_E CONVERT FROM LOGICAL (32 to short BFP)  */         \
-  V(cdlfbr, CDLFBR,                                                            \
-    0xB391) /* type = RRF_E CONVERT FROM LOGICAL (32 to long BFP)  */          \
-  V(cxlfbr, CXLFBR,                                                            \
-    0xB392) /* type = RRF_E CONVERT FROM LOGICAL (32 to extended BFP)  */      \
-  V(cefbra, CEFBRA,                                                            \
-    0xB394) /* type = RRF_E CONVERT FROM FIXED (32 to short BFP)  */           \
-  V(cdfbra, CDFBRA,                                                            \
-    0xB395) /* type = RRF_E CONVERT FROM FIXED (32 to long BFP)  */            \
-  V(cxfbra, CXFBRA,                                                            \
-    0xB396) /* type = RRF_E CONVERT FROM FIXED (32 to extended BFP)  */        \
-  V(cfebr, CFEBR,                                                              \
-    0xB398) /* type = RRF_E CONVERT TO FIXED (short BFP to 32)  */             \
-  V(cfebra, CFEBRA,                                                            \
-    0xB398) /* type = RRF_E CONVERT TO FIXED (short BFP to 32)  */             \
-  V(cfdbr, CFDBR, 0xB399) /* type = RRF_E CONVERT TO FIXED (long BFP to 32) */ \
-  V(cfdbra, CFDBRA,                                                            \
-    0xB399) /* type = RRF_E CONVERT TO FIXED (long BFP to 32)  */              \
-  V(cfxbr, CFXBR,                                                              \
-    0xB39A) /* type = RRF_E CONVERT TO FIXED (extended BFP to 32)  */          \
-  V(cfxbra, CFXBRA,                                                            \
-    0xB39A) /* type = RRF_E CONVERT TO FIXED (extended BFP to 32)  */          \
-  V(clfebr, CLFEBR,                                                            \
-    0xB39C) /* type = RRF_E CONVERT TO LOGICAL (short BFP to 32)  */           \
-  V(clfdbr, CLFDBR,                                                            \
-    0xB39D) /* type = RRF_E CONVERT TO LOGICAL (long BFP to 32)  */            \
-  V(clfxbr, CLFXBR,                                                            \
-    0xB39E) /* type = RRF_E CONVERT TO LOGICAL (extended BFP to 32)  */        \
-  V(celgbr, CELGBR,                                                            \
-    0xB3A0) /* type = RRF_E CONVERT FROM LOGICAL (64 to short BFP)  */         \
-  V(cdlgbr, CDLGBR,                                                            \
-    0xB3A1) /* type = RRF_E CONVERT FROM LOGICAL (64 to long BFP)  */          \
-  V(cxlgbr, CXLGBR,                                                            \
-    0xB3A2) /* type = RRF_E CONVERT FROM LOGICAL (64 to extended BFP)  */      \
-  V(cegbra, CEGBRA,                                                            \
-    0xB3A4) /* type = RRF_E CONVERT FROM FIXED (64 to short BFP)  */           \
-  V(cdgbra, CDGBRA,                                                            \
-    0xB3A5) /* type = RRF_E CONVERT FROM FIXED (64 to long BFP)  */            \
-  V(cxgbra, CXGBRA,                                                            \
-    0xB3A6) /* type = RRF_E CONVERT FROM FIXED (64 to extended BFP)  */        \
-  V(cgebr, CGEBR,                                                              \
-    0xB3A8) /* type = RRF_E CONVERT TO FIXED (short BFP to 64)  */             \
-  V(cgebra, CGEBRA,                                                            \
-    0xB3A8) /* type = RRF_E CONVERT TO FIXED (short BFP to 64)  */             \
-  V(cgdbr, CGDBR, 0xB3A9) /* type = RRF_E CONVERT TO FIXED (long BFP to 64) */ \
-  V(cgdbra, CGDBRA,                                                            \
-    0xB3A9) /* type = RRF_E CONVERT TO FIXED (long BFP to 64)  */              \
-  V(cgxbr, CGXBR,                                                              \
-    0xB3AA) /* type = RRF_E CONVERT TO FIXED (extended BFP to 64)  */          \
-  V(cgxbra, CGXBRA,                                                            \
-    0xB3AA) /* type = RRF_E CONVERT TO FIXED (extended BFP to 64)  */          \
-  V(clgebr, CLGEBR,                                                            \
-    0xB3AC) /* type = RRF_E CONVERT TO LOGICAL (short BFP to 64)  */           \
-  V(clgdbr, CLGDBR,                                                            \
-    0xB3AD) /* type = RRF_E CONVERT TO LOGICAL (long BFP to 64)  */            \
-  V(clgxbr, CLGXBR,                                                            \
-    0xB3AE) /* type = RRF_E CONVERT TO LOGICAL (extended BFP to 64)  */        \
-  V(cfer, CFER, 0xB3B8) /* type = RRF_E CONVERT TO FIXED (short HFP to 32)  */ \
-  V(cfdr, CFDR, 0xB3B9) /* type = RRF_E CONVERT TO FIXED (long HFP to 32)  */  \
-  V(cfxr, CFXR,                                                                \
-    0xB3BA) /* type = RRF_E CONVERT TO FIXED (extended HFP to 32)  */          \
-  V(cger, CGER, 0xB3C8) /* type = RRF_E CONVERT TO FIXED (short HFP to 64)  */ \
-  V(cgdr, CGDR, 0xB3C9) /* type = RRF_E CONVERT TO FIXED (long HFP to 64)  */  \
-  V(cgxr, CGXR,                                                                \
-    0xB3CA) /* type = RRF_E CONVERT TO FIXED (extended HFP to 64)  */          \
-  V(ledtr, LEDTR, 0xB3D5) /* type = RRF_E LOAD ROUNDED (long to short DFP)  */ \
-  V(fidtr, FIDTR, 0xB3D7) /* type = RRF_E LOAD FP INTEGER (long DFP)  */       \
-  V(ldxtr, LDXTR,                                                              \
-    0xB3DD) /* type = RRF_E LOAD ROUNDED (extended to long DFP)  */            \
-  V(fixtr, FIXTR, 0xB3DF) /* type = RRF_E LOAD FP INTEGER (extended DFP)  */   \
-  V(cgdtr, CGDTR, 0xB3E1) /* type = RRF_E CONVERT TO FIXED (long DFP to 64) */ \
-  V(cgdtra, CGDTRA,                                                            \
-    0xB3E1) /* type = RRF_E CONVERT TO FIXED (long DFP to 64)  */              \
-  V(cgxtr, CGXTR,                                                              \
-    0xB3E9) /* type = RRF_E CONVERT TO FIXED (extended DFP to 64)  */          \
-  V(cgxtra, CGXTRA,                                                            \
-    0xB3E9) /* type = RRF_E CONVERT TO FIXED (extended DFP to 64)  */          \
-  V(cdgtra, CDGTRA,                                                            \
-    0xB3F1) /* type = RRF_E CONVERT FROM FIXED (64 to long DFP)  */            \
-  V(cxgtra, CXGTRA,                                                            \
-    0xB3F9) /* type = RRF_E CONVERT FROM FIXED (64 to extended DFP)  */        \
-  V(cfdtr, CFDTR, 0xB941) /* type = RRF_E CONVERT TO FIXED (long DFP to 32) */ \
-  V(clgdtr, CLGDTR,                                                            \
-    0xB942) /* type = RRF_E CONVERT TO LOGICAL (long DFP to 64)  */            \
-  V(clfdtr, CLFDTR,                                                            \
-    0xB943) /* type = RRF_E CONVERT TO LOGICAL (long DFP to 32)  */            \
-  V(cfxtr, CFXTR,                                                              \
-    0xB949) /* type = RRF_E CONVERT TO FIXED (extended DFP to 32)  */          \
-  V(clgxtr, CLGXTR,                                                            \
-    0xB94A) /* type = RRF_E CONVERT TO LOGICAL (extended DFP to 64)  */        \
-  V(clfxtr, CLFXTR,                                                            \
-    0xB94B) /* type = RRF_E CONVERT TO LOGICAL (extended DFP to 32)  */        \
-  V(cdlgtr, CDLGTR,                                                            \
-    0xB952) /* type = RRF_E CONVERT FROM LOGICAL (64 to long DFP)  */          \
-  V(cdlftr, CDLFTR,                                                            \
-    0xB953) /* type = RRF_E CONVERT FROM LOGICAL (32 to long DFP)  */          \
-  V(cxlgtr, CXLGTR,                                                            \
-    0xB95A) /* type = RRF_E CONVERT FROM LOGICAL (64 to extended DFP)  */      \
-  V(cxlftr, CXLFTR,                                                            \
-    0xB95B) /* type = RRF_E CONVERT FROM LOGICAL (32 to extended DFP)  */
-
-#define S390_VRR_A_OPCODE_LIST(V)                                              \
-  V(vpopct, VPOPCT, 0xE750) /* type = VRR_A VECTOR POPULATION COUNT  */        \
-  V(vctz, VCTZ, 0xE752)     /* type = VRR_A VECTOR COUNT TRAILING ZEROS  */    \
-  V(vclz, VCLZ, 0xE753)     /* type = VRR_A VECTOR COUNT LEADING ZEROS  */     \
-  V(vlr, VLR, 0xE756)       /* type = VRR_A VECTOR LOAD  */                    \
-  V(vistr, VISTR, 0xE75C)   /* type = VRR_A VECTOR ISOLATE STRING  */          \
-  V(vseg, VSEG, 0xE75F) /* type = VRR_A VECTOR SIGN EXTEND TO DOUBLEWORD  */   \
-  V(vclgd, VCLGD,                                                              \
-    0xE7C0) /* type = VRR_A VECTOR FP CONVERT TO LOGICAL 64-BIT  */            \
-  V(vcdlg, VCDLG,                                                              \
-    0xE7C1) /* type = VRR_A VECTOR FP CONVERT FROM LOGICAL 64-BIT  */          \
-  V(vcgd, VCGD, 0xE7C2) /* type = VRR_A VECTOR FP CONVERT TO FIXED 64-BIT  */  \
-  V(vcdg, VCDG, 0xE7C3) /* type = VRR_A VECTOR FP CONVERT FROM FIXED 64-BIT */ \
-  V(vlde, VLDE, 0xE7C4) /* type = VRR_A VECTOR FP LOAD LENGTHENED  */          \
-  V(vled, VLED, 0xE7C5) /* type = VRR_A VECTOR FP LOAD ROUNDED  */             \
-  V(vfi, VFI, 0xE7C7)   /* type = VRR_A VECTOR LOAD FP INTEGER  */             \
-  V(wfk, WFK, 0xE7CA) /* type = VRR_A VECTOR FP COMPARE AND SIGNAL SCALAR  */  \
-  V(wfc, WFC, 0xE7CB) /* type = VRR_A VECTOR FP COMPARE SCALAR  */             \
-  V(vfpso, VFPSO, 0xE7CC) /* type = VRR_A VECTOR FP PERFORM SIGN OPERATION  */ \
-  V(vfsq, VFSQ, 0xE7CE)   /* type = VRR_A VECTOR FP SQUARE ROOT  */            \
-  V(vupll, VUPLL, 0xE7D4) /* type = VRR_A VECTOR UNPACK LOGICAL LOW  */        \
-  V(vuplh, VUPLH, 0xE7D5) /* type = VRR_A VECTOR UNPACK LOGICAL HIGH  */       \
-  V(vupl, VUPL, 0xE7D6)   /* type = VRR_A VECTOR UNPACK LOW  */                \
-  V(vuph, VUPH, 0xE7D7)   /* type = VRR_A VECTOR UNPACK HIGH  */               \
-  V(vtm, VTM, 0xE7D8)     /* type = VRR_A VECTOR TEST UNDER MASK  */           \
-  V(vecl, VECL, 0xE7D9)   /* type = VRR_A VECTOR ELEMENT COMPARE LOGICAL  */   \
-  V(vec, VEC, 0xE7DB)     /* type = VRR_A VECTOR ELEMENT COMPARE  */           \
-  V(vlc, VLC, 0xE7DE)     /* type = VRR_A VECTOR LOAD COMPLEMENT  */           \
-  V(vlp, VLP, 0xE7DF)     /* type = VRR_A VECTOR LOAD POSITIVE  */
-
-#define S390_VRR_B_OPCODE_LIST(V)                                           \
-  V(vfee, VFEE, 0xE780)   /* type = VRR_B VECTOR FIND ELEMENT EQUAL  */     \
-  V(vfene, VFENE, 0xE781) /* type = VRR_B VECTOR FIND ELEMENT NOT EQUAL  */ \
-  V(vfae, VFAE, 0xE782)   /* type = VRR_B VECTOR FIND ANY ELEMENT EQUAL  */ \
-  V(vpkls, VPKLS, 0xE795) /* type = VRR_B VECTOR PACK LOGICAL SATURATE  */  \
-  V(vpks, VPKS, 0xE797)   /* type = VRR_B VECTOR PACK SATURATE  */          \
-  V(vceq, VCEQ, 0xE7F8)   /* type = VRR_B VECTOR COMPARE EQUAL  */          \
-  V(vchl, VCHL, 0xE7F9)   /* type = VRR_B VECTOR COMPARE HIGH LOGICAL  */   \
-  V(vch, VCH, 0xE7FB)     /* type = VRR_B VECTOR COMPARE HIGH  */
-
-#define S390_VRR_C_OPCODE_LIST(V)                                              \
-  V(vmrl, VMRL, 0xE760)   /* type = VRR_C VECTOR MERGE LOW  */                 \
-  V(vmrh, VMRH, 0xE761)   /* type = VRR_C VECTOR MERGE HIGH  */                \
-  V(vsum, VSUM, 0xE764)   /* type = VRR_C VECTOR SUM ACROSS WORD  */           \
-  V(vsumg, VSUMG, 0xE765) /* type = VRR_C VECTOR SUM ACROSS DOUBLEWORD  */     \
-  V(vcksm, VCKSM, 0xE766) /* type = VRR_C VECTOR CHECKSUM  */                  \
-  V(vsumq, VSUMQ, 0xE767) /* type = VRR_C VECTOR SUM ACROSS QUADWORD  */       \
-  V(vn, VN, 0xE768)       /* type = VRR_C VECTOR AND  */                       \
-  V(vnc, VNC, 0xE769)     /* type = VRR_C VECTOR AND WITH COMPLEMENT  */       \
-  V(vo, VO, 0xE76A)       /* type = VRR_C VECTOR OR  */                        \
-  V(vno, VNO, 0xE76B)     /* type = VRR_C VECTOR NOR  */                       \
-  V(vx, VX, 0xE76D)       /* type = VRR_C VECTOR EXCLUSIVE OR  */              \
-  V(veslv, VESLV, 0xE770) /* type = VRR_C VECTOR ELEMENT SHIFT LEFT  */        \
-  V(verllv, VERLLV,                                                            \
-    0xE773)             /* type = VRR_C VECTOR ELEMENT ROTATE LEFT LOGICAL  */ \
-  V(vsl, VSL, 0xE774)   /* type = VRR_C VECTOR SHIFT LEFT  */                  \
-  V(vslb, VSLB, 0xE775) /* type = VRR_C VECTOR SHIFT LEFT BY BYTE  */          \
-  V(vesrlv, VESRLV,                                                            \
-    0xE778) /* type = VRR_C VECTOR ELEMENT SHIFT RIGHT LOGICAL  */             \
-  V(vesrav, VESRAV,                                                            \
-    0xE77A) /* type = VRR_C VECTOR ELEMENT SHIFT RIGHT ARITHMETIC  */          \
-  V(vsrl, VSRL, 0xE77C) /* type = VRR_C VECTOR SHIFT RIGHT LOGICAL  */         \
-  V(vsrlb, VSRLB,                                                              \
-    0xE77D)             /* type = VRR_C VECTOR SHIFT RIGHT LOGICAL BY BYTE  */ \
-  V(vsra, VSRA, 0xE77E) /* type = VRR_C VECTOR SHIFT RIGHT ARITHMETIC  */      \
-  V(vsrab, VSRAB,                                                              \
-    0xE77F) /* type = VRR_C VECTOR SHIFT RIGHT ARITHMETIC BY BYTE  */          \
-  V(vpdi, VPDI, 0xE784) /* type = VRR_C VECTOR PERMUTE DOUBLEWORD IMMEDIATE */ \
-  V(vpk, VPK, 0xE794)   /* type = VRR_C VECTOR PACK  */                        \
-  V(vmlh, VMLH, 0xE7A1) /* type = VRR_C VECTOR MULTIPLY LOGICAL HIGH  */       \
-  V(vml, VML, 0xE7A2)   /* type = VRR_C VECTOR MULTIPLY LOW  */                \
-  V(vmh, VMH, 0xE7A3)   /* type = VRR_C VECTOR MULTIPLY HIGH  */               \
-  V(vmle, VMLE, 0xE7A4) /* type = VRR_C VECTOR MULTIPLY LOGICAL EVEN  */       \
-  V(vmlo, VMLO, 0xE7A5) /* type = VRR_C VECTOR MULTIPLY LOGICAL ODD  */        \
-  V(vme, VME, 0xE7A6)   /* type = VRR_C VECTOR MULTIPLY EVEN  */               \
-  V(vmo, VMO, 0xE7A7)   /* type = VRR_C VECTOR MULTIPLY ODD  */                \
-  V(vgfm, VGFM, 0xE7B4) /* type = VRR_C VECTOR GALOIS FIELD MULTIPLY SUM  */   \
-  V(vfs, VFS, 0xE7E2)   /* type = VRR_C VECTOR FP SUBTRACT  */                 \
-  V(vfa, VFA, 0xE7E3)   /* type = VRR_C VECTOR FP ADD  */                      \
-  V(vfd, VFD, 0xE7E5)   /* type = VRR_C VECTOR FP DIVIDE  */                   \
-  V(vfm, VFM, 0xE7E7)   /* type = VRR_C VECTOR FP MULTIPLY  */                 \
-  V(vfce, VFCE, 0xE7E8) /* type = VRR_C VECTOR FP COMPARE EQUAL  */            \
-  V(vfche, VFCHE, 0xE7EA) /* type = VRR_C VECTOR FP COMPARE HIGH OR EQUAL  */  \
-  V(vfch, VFCH, 0xE7EB)   /* type = VRR_C VECTOR FP COMPARE HIGH  */           \
-  V(vavgl, VAVGL, 0xE7F0) /* type = VRR_C VECTOR AVERAGE LOGICAL  */           \
-  V(vacc, VACC, 0xE7F1)   /* type = VRR_C VECTOR ADD COMPUTE CARRY  */         \
-  V(vavg, VAVG, 0xE7F2)   /* type = VRR_C VECTOR AVERAGE  */                   \
-  V(va, VA, 0xE7F3)       /* type = VRR_C VECTOR ADD  */                       \
-  V(vscbi, VSCBI,                                                              \
-    0xE7F5) /* type = VRR_C VECTOR SUBTRACT COMPUTE BORROW INDICATION  */      \
-  V(vs, VS, 0xE7F7)     /* type = VRR_C VECTOR SUBTRACT  */                    \
-  V(vmnl, VMNL, 0xE7FC) /* type = VRR_C VECTOR MINIMUM LOGICAL  */             \
-  V(vmxl, VMXL, 0xE7FD) /* type = VRR_C VECTOR MAXIMUM LOGICAL  */             \
-  V(vmn, VMN, 0xE7FE)   /* type = VRR_C VECTOR MINIMUM  */                     \
-  V(vmx, VMX, 0xE7FF)   /* type = VRR_C VECTOR MAXIMUM  */
-
-#define S390_VRI_A_OPCODE_LIST(V)                                              \
-  V(vleib, VLEIB, 0xE740) /* type = VRI_A VECTOR LOAD ELEMENT IMMEDIATE (8) */ \
-  V(vleih, VLEIH,                                                              \
-    0xE741) /* type = VRI_A VECTOR LOAD ELEMENT IMMEDIATE (16)  */             \
-  V(vleig, VLEIG,                                                              \
-    0xE742) /* type = VRI_A VECTOR LOAD ELEMENT IMMEDIATE (64)  */             \
-  V(vleif, VLEIF,                                                              \
-    0xE743)             /* type = VRI_A VECTOR LOAD ELEMENT IMMEDIATE (32)  */ \
-  V(vgbm, VGBM, 0xE744) /* type = VRI_A VECTOR GENERATE BYTE MASK  */          \
-  V(vrepi, VREPI, 0xE745) /* type = VRI_A VECTOR REPLICATE IMMEDIATE  */
-
-#define S390_VRR_D_OPCODE_LIST(V)                                              \
-  V(vstrc, VSTRC, 0xE78A) /* type = VRR_D VECTOR STRING RANGE COMPARE  */      \
-  V(vmalh, VMALH,                                                              \
-    0xE7A9) /* type = VRR_D VECTOR MULTIPLY AND ADD LOGICAL HIGH  */           \
-  V(vmal, VMAL, 0xE7AA) /* type = VRR_D VECTOR MULTIPLY AND ADD LOW  */        \
-  V(vmah, VMAH, 0xE7AB) /* type = VRR_D VECTOR MULTIPLY AND ADD HIGH  */       \
-  V(vmale, VMALE,                                                              \
-    0xE7AC) /* type = VRR_D VECTOR MULTIPLY AND ADD LOGICAL EVEN  */           \
-  V(vmalo, VMALO,                                                              \
-    0xE7AD) /* type = VRR_D VECTOR MULTIPLY AND ADD LOGICAL ODD  */            \
-  V(vmae, VMAE, 0xE7AE) /* type = VRR_D VECTOR MULTIPLY AND ADD EVEN  */       \
-  V(vmao, VMAO, 0xE7AF) /* type = VRR_D VECTOR MULTIPLY AND ADD ODD  */        \
-  V(vaccc, VACCC,                                                              \
-    0xE7B9)           /* type = VRR_D VECTOR ADD WITH CARRY COMPUTE CARRY  */  \
-  V(vac, VAC, 0xE7BB) /* type = VRR_D VECTOR ADD WITH CARRY  */                \
-  V(vgfma, VGFMA,                                                              \
-    0xE7BC) /* type = VRR_D VECTOR GALOIS FIELD MULTIPLY SUM AND ACCUMULATE */ \
-  V(vsbcbi, VSBCBI, 0xE7BD) /* type = VRR_D VECTOR SUBTRACT WITH BORROW     */ \
-                            /* COMPUTE BORROW INDICATION  */                   \
-  V(vsbi, VSBI,                                                                \
-    0xE7BF) /* type = VRR_D VECTOR SUBTRACT WITH BORROW INDICATION  */
-
-#define S390_VRI_B_OPCODE_LIST(V) \
-  V(vgm, VGM, 0xE746) /* type = VRI_B VECTOR GENERATE MASK  */
-
-#define S390_VRR_E_OPCODE_LIST(V)                                             \
-  V(vperm, VPERM, 0xE78C) /* type = VRR_E VECTOR PERMUTE  */                  \
-  V(vsel, VSEL, 0xE78D)   /* type = VRR_E VECTOR SELECT  */                   \
-  V(vfms, VFMS, 0xE78E)   /* type = VRR_E VECTOR FP MULTIPLY AND SUBTRACT  */ \
-  V(vfma, VFMA, 0xE78F)   /* type = VRR_E VECTOR FP MULTIPLY AND ADD  */
-
-#define S390_VRI_C_OPCODE_LIST(V) \
-  V(vrep, VREP, 0xE74D) /* type = VRI_C VECTOR REPLICATE  */
-
-#define S390_VRI_D_OPCODE_LIST(V)                                           \
-  V(verim, VERIM,                                                           \
-    0xE772) /* type = VRI_D VECTOR ELEMENT ROTATE AND INSERT UNDER MASK  */ \
-  V(vsldb, VSLDB, 0xE777) /* type = VRI_D VECTOR SHIFT LEFT DOUBLE BY BYTE  */
-
-#define S390_VRR_F_OPCODE_LIST(V) \
-  V(vlvgp, VLVGP, 0xE762) /* type = VRR_F VECTOR LOAD VR FROM GRS DISJOINT  */
-
-#define S390_RIS_OPCODE_LIST(V)                                                \
-  V(cgib, CGIB,                                                                \
-    0xECFC) /* type = RIS   COMPARE IMMEDIATE AND BRANCH (64<-8)  */           \
-  V(clgib, CLGIB,                                                              \
-    0xECFD) /* type = RIS   COMPARE LOGICAL IMMEDIATE AND BRANCH (64<-8)  */   \
-  V(cib, CIB, 0xECFE) /* type = RIS   COMPARE IMMEDIATE AND BRANCH (32<-8)  */ \
-  V(clib, CLIB,                                                                \
-    0xECFF) /* type = RIS   COMPARE LOGICAL IMMEDIATE AND BRANCH (32<-8)  */
-
-#define S390_VRI_E_OPCODE_LIST(V) \
-  V(vftci, VFTCI,                 \
-    0xE74A) /* type = VRI_E VECTOR FP TEST DATA CLASS IMMEDIATE  */
-
-#define S390_RSL_A_OPCODE_LIST(V) \
-  V(tp, TP, 0xEBC0) /* type = RSL_A TEST DECIMAL  */
-
-#define S390_RSL_B_OPCODE_LIST(V)                                             \
-  V(cpdt, CPDT, 0xEDAC) /* type = RSL_B CONVERT TO PACKED (from long DFP)  */ \
-  V(cpxt, CPXT,                                                               \
-    0xEDAD) /* type = RSL_B CONVERT TO PACKED (from extended DFP)  */         \
-  V(cdpt, CDPT, 0xEDAE) /* type = RSL_B CONVERT FROM PACKED (to long DFP)  */ \
-  V(cxpt, CXPT,                                                               \
-    0xEDAF) /* type = RSL_B CONVERT FROM PACKED (to extended DFP)  */
-
-#define S390_SI_OPCODE_LIST(V)                                          \
-  V(tm, TM, 0x91)       /* type = SI    TEST UNDER MASK  */             \
-  V(mvi, MVI, 0x92)     /* type = SI    MOVE (immediate)  */            \
-  V(ni, NI, 0x94)       /* type = SI    AND (immediate)  */             \
-  V(cli, CLI, 0x95)     /* type = SI    COMPARE LOGICAL (immediate)  */ \
-  V(oi, OI, 0x96)       /* type = SI    OR (immediate)  */              \
-  V(xi, XI, 0x97)       /* type = SI    EXCLUSIVE OR (immediate)  */    \
-  V(stnsm, STNSM, 0xAC) /* type = SI    STORE THEN AND SYSTEM MASK  */  \
-  V(stosm, STOSM, 0xAD) /* type = SI    STORE THEN OR SYSTEM MASK  */   \
-  V(mc, MC, 0xAF)       /* type = SI    MONITOR CALL  */
-
-#define S390_SIL_OPCODE_LIST(V)                                                \
-  V(mvhhi, MVHHI, 0xE544) /* type = SIL   MOVE (16<-16)  */                    \
-  V(mvghi, MVGHI, 0xE548) /* type = SIL   MOVE (64<-16)  */                    \
-  V(mvhi, MVHI, 0xE54C)   /* type = SIL   MOVE (32<-16)  */                    \
-  V(chhsi, CHHSI,                                                              \
-    0xE554) /* type = SIL   COMPARE HALFWORD IMMEDIATE (16<-16)  */            \
-  V(clhhsi, CLHHSI,                                                            \
-    0xE555) /* type = SIL   COMPARE LOGICAL IMMEDIATE (16<-16)  */             \
-  V(cghsi, CGHSI,                                                              \
-    0xE558) /* type = SIL   COMPARE HALFWORD IMMEDIATE (64<-16)  */            \
-  V(clghsi, CLGHSI,                                                            \
-    0xE559)             /* type = SIL   COMPARE LOGICAL IMMEDIATE (64<-16)  */ \
-  V(chsi, CHSI, 0xE55C) /* type = SIL   COMPARE HALFWORD IMMEDIATE (32<-16) */ \
-  V(clfhsi, CLFHSI,                                                            \
-    0xE55D) /* type = SIL   COMPARE LOGICAL IMMEDIATE (32<-16)  */             \
-  V(tbegin, TBEGIN,                                                            \
-    0xE560) /* type = SIL   TRANSACTION BEGIN (nonconstrained)  */             \
-  V(tbeginc, TBEGINC,                                                          \
-    0xE561) /* type = SIL   TRANSACTION BEGIN (constrained)  */
-
-#define S390_VRS_A_OPCODE_LIST(V)                                            \
-  V(vesl, VESL, 0xE730) /* type = VRS_A VECTOR ELEMENT SHIFT LEFT  */        \
-  V(verll, VERLL,                                                            \
-    0xE733)           /* type = VRS_A VECTOR ELEMENT ROTATE LEFT LOGICAL  */ \
-  V(vlm, VLM, 0xE736) /* type = VRS_A VECTOR LOAD MULTIPLE  */               \
-  V(vesrl, VESRL,                                                            \
-    0xE738) /* type = VRS_A VECTOR ELEMENT SHIFT RIGHT LOGICAL  */           \
-  V(vesra, VESRA,                                                            \
-    0xE73A) /* type = VRS_A VECTOR ELEMENT SHIFT RIGHT ARITHMETIC  */        \
-  V(vstm, VSTM, 0xE73E) /* type = VRS_A VECTOR STORE MULTIPLE  */
-
-#define S390_RIL_A_OPCODE_LIST(V)                                              \
-  V(lgfi, LGFI, 0xC01)   /* type = RIL_A LOAD IMMEDIATE (64<-32)  */           \
-  V(xihf, XIHF, 0xC06)   /* type = RIL_A EXCLUSIVE OR IMMEDIATE (high)  */     \
-  V(xilf, XILF, 0xC07)   /* type = RIL_A EXCLUSIVE OR IMMEDIATE (low)  */      \
-  V(iihf, IIHF, 0xC08)   /* type = RIL_A INSERT IMMEDIATE (high)  */           \
-  V(iilf, IILF, 0xC09)   /* type = RIL_A INSERT IMMEDIATE (low)  */            \
-  V(nihf, NIHF, 0xC0A)   /* type = RIL_A AND IMMEDIATE (high)  */              \
-  V(nilf, NILF, 0xC0B)   /* type = RIL_A AND IMMEDIATE (low)  */               \
-  V(oihf, OIHF, 0xC0C)   /* type = RIL_A OR IMMEDIATE (high)  */               \
-  V(oilf, OILF, 0xC0D)   /* type = RIL_A OR IMMEDIATE (low)  */                \
-  V(llihf, LLIHF, 0xC0E) /* type = RIL_A LOAD LOGICAL IMMEDIATE (high)  */     \
-  V(llilf, LLILF, 0xC0F) /* type = RIL_A LOAD LOGICAL IMMEDIATE (low)  */      \
-  V(msgfi, MSGFI, 0xC20) /* type = RIL_A MULTIPLY SINGLE IMMEDIATE (64<-32) */ \
-  V(msfi, MSFI, 0xC21)   /* type = RIL_A MULTIPLY SINGLE IMMEDIATE (32)  */    \
-  V(slgfi, SLGFI,                                                              \
-    0xC24)             /* type = RIL_A SUBTRACT LOGICAL IMMEDIATE (64<-32)  */ \
-  V(slfi, SLFI, 0xC25) /* type = RIL_A SUBTRACT LOGICAL IMMEDIATE (32)  */     \
-  V(agfi, AGFI, 0xC28) /* type = RIL_A ADD IMMEDIATE (64<-32)  */              \
-  V(afi, AFI, 0xC29)   /* type = RIL_A ADD IMMEDIATE (32)  */                  \
-  V(algfi, ALGFI, 0xC2A) /* type = RIL_A ADD LOGICAL IMMEDIATE (64<-32)  */    \
-  V(alfi, ALFI, 0xC2B)   /* type = RIL_A ADD LOGICAL IMMEDIATE (32)  */        \
-  V(cgfi, CGFI, 0xC2C)   /* type = RIL_A COMPARE IMMEDIATE (64<-32)  */        \
-  V(cfi, CFI, 0xC2D)     /* type = RIL_A COMPARE IMMEDIATE (32)  */            \
-  V(clgfi, CLGFI, 0xC2E) /* type = RIL_A COMPARE LOGICAL IMMEDIATE (64<-32) */ \
-  V(clfi, CLFI, 0xC2F)   /* type = RIL_A COMPARE LOGICAL IMMEDIATE (32)  */    \
-  V(aih, AIH, 0xCC8)     /* type = RIL_A ADD IMMEDIATE HIGH (32)  */           \
-  V(alsih, ALSIH,                                                              \
-    0xCCA) /* type = RIL_A ADD LOGICAL WITH SIGNED IMMEDIATE HIGH (32)  */     \
-  V(alsihn, ALSIHN,                                                            \
-    0xCCB) /* type = RIL_A ADD LOGICAL WITH SIGNED IMMEDIATE HIGH (32)  */     \
-  V(cih, CIH, 0xCCD)   /* type = RIL_A COMPARE IMMEDIATE HIGH (32)  */         \
-  V(clih, CLIH, 0xCCF) /* type = RIL_A COMPARE LOGICAL IMMEDIATE HIGH (32)  */
-
-#define S390_RIL_B_OPCODE_LIST(V)                                              \
-  V(larl, LARL, 0xC00)   /* type = RIL_B LOAD ADDRESS RELATIVE LONG  */        \
-  V(brasl, BRASL, 0xC05) /* type = RIL_B BRANCH RELATIVE AND SAVE LONG  */     \
-  V(llhrl, LLHRL,                                                              \
-    0xC42) /* type = RIL_B LOAD LOGICAL HALFWORD RELATIVE LONG (32<-16)  */    \
-  V(lghrl, LGHRL,                                                              \
-    0xC44) /* type = RIL_B LOAD HALFWORD RELATIVE LONG (64<-16)  */            \
-  V(lhrl, LHRL, 0xC45) /* type = RIL_B LOAD HALFWORD RELATIVE LONG (32<-16) */ \
-  V(llghrl, LLGHRL,                                                            \
-    0xC46) /* type = RIL_B LOAD LOGICAL HALFWORD RELATIVE LONG (64<-16)  */    \
-  V(sthrl, STHRL, 0xC47) /* type = RIL_B STORE HALFWORD RELATIVE LONG (16)  */ \
-  V(lgrl, LGRL, 0xC48)   /* type = RIL_B LOAD RELATIVE LONG (64)  */           \
-  V(stgrl, STGRL, 0xC4B) /* type = RIL_B STORE RELATIVE LONG (64)  */          \
-  V(lgfrl, LGFRL, 0xC4C) /* type = RIL_B LOAD RELATIVE LONG (64<-32)  */       \
-  V(lrl, LRL, 0xC4D)     /* type = RIL_B LOAD RELATIVE LONG (32)  */           \
-  V(llgfrl, LLGFRL,                                                            \
-    0xC4E)             /* type = RIL_B LOAD LOGICAL RELATIVE LONG (64<-32)  */ \
-  V(strl, STRL, 0xC4F) /* type = RIL_B STORE RELATIVE LONG (32)  */            \
-  V(exrl, EXRL, 0xC60) /* type = RIL_B EXECUTE RELATIVE LONG  */               \
-  V(cghrl, CGHRL,                                                              \
-    0xC64) /* type = RIL_B COMPARE HALFWORD RELATIVE LONG (64<-16)  */         \
-  V(chrl, CHRL,                                                                \
-    0xC65) /* type = RIL_B COMPARE HALFWORD RELATIVE LONG (32<-16)  */         \
-  V(clghrl, CLGHRL,                                                            \
-    0xC66) /* type = RIL_B COMPARE LOGICAL RELATIVE LONG (64<-16)  */          \
-  V(clhrl, CLHRL,                                                              \
-    0xC67) /* type = RIL_B COMPARE LOGICAL RELATIVE LONG (32<-16)  */          \
-  V(cgrl, CGRL, 0xC68)   /* type = RIL_B COMPARE RELATIVE LONG (64)  */        \
-  V(clgrl, CLGRL, 0xC6A) /* type = RIL_B COMPARE LOGICAL RELATIVE LONG (64) */ \
-  V(cgfrl, CGFRL, 0xC6C) /* type = RIL_B COMPARE RELATIVE LONG (64<-32)  */    \
-  V(crl, CRL, 0xC6D)     /* type = RIL_B COMPARE RELATIVE LONG (32)  */        \
-  V(clgfrl, CLGFRL,                                                            \
-    0xC6E) /* type = RIL_B COMPARE LOGICAL RELATIVE LONG (64<-32)  */          \
-  V(clrl, CLRL, 0xC6F) /* type = RIL_B COMPARE LOGICAL RELATIVE LONG (32)  */  \
-  V(brcth, BRCTH, 0xCC6) /* type = RIL_B BRANCH RELATIVE ON COUNT HIGH (32) */
-
-#define S390_VRS_B_OPCODE_LIST(V)                                          \
-  V(vlvg, VLVG, 0xE722) /* type = VRS_B VECTOR LOAD VR ELEMENT FROM GR  */ \
-  V(vll, VLL, 0xE737)   /* type = VRS_B VECTOR LOAD WITH LENGTH  */        \
-  V(vstl, VSTL, 0xE73F) /* type = VRS_B VECTOR STORE WITH LENGTH  */
-
-#define S390_RIL_C_OPCODE_LIST(V)                                              \
-  V(brcl, BRCL, 0xC04)   /* type = RIL_C BRANCH RELATIVE ON CONDITION LONG  */ \
-  V(pfdrl, PFDRL, 0xC62) /* type = RIL_C PREFETCH DATA RELATIVE LONG  */
-
-#define S390_VRS_C_OPCODE_LIST(V) \
-  V(vlgv, VLGV, 0xE721) /* type = VRS_C VECTOR LOAD GR FROM VR ELEMENT  */
-
-#define S390_RI_A_OPCODE_LIST(V)                                               \
-  V(iihh, IIHH, 0xA50)   /* type = RI_A  INSERT IMMEDIATE (high high)  */      \
-  V(iihl, IIHL, 0xA51)   /* type = RI_A  INSERT IMMEDIATE (high low)  */       \
-  V(iilh, IILH, 0xA52)   /* type = RI_A  INSERT IMMEDIATE (low high)  */       \
-  V(iill, IILL, 0xA53)   /* type = RI_A  INSERT IMMEDIATE (low low)  */        \
-  V(nihh, NIHH, 0xA54)   /* type = RI_A  AND IMMEDIATE (high high)  */         \
-  V(nihl, NIHL, 0xA55)   /* type = RI_A  AND IMMEDIATE (high low)  */          \
-  V(nilh, NILH, 0xA56)   /* type = RI_A  AND IMMEDIATE (low high)  */          \
-  V(nill, NILL, 0xA57)   /* type = RI_A  AND IMMEDIATE (low low)  */           \
-  V(oihh, OIHH, 0xA58)   /* type = RI_A  OR IMMEDIATE (high high)  */          \
-  V(oihl, OIHL, 0xA59)   /* type = RI_A  OR IMMEDIATE (high low)  */           \
-  V(oilh, OILH, 0xA5A)   /* type = RI_A  OR IMMEDIATE (low high)  */           \
-  V(oill, OILL, 0xA5B)   /* type = RI_A  OR IMMEDIATE (low low)  */            \
-  V(llihh, LLIHH, 0xA5C) /* type = RI_A  LOAD LOGICAL IMMEDIATE (high high) */ \
-  V(llihl, LLIHL, 0xA5D) /* type = RI_A  LOAD LOGICAL IMMEDIATE (high low)  */ \
-  V(llilh, LLILH, 0xA5E) /* type = RI_A  LOAD LOGICAL IMMEDIATE (low high)  */ \
-  V(llill, LLILL, 0xA5F) /* type = RI_A  LOAD LOGICAL IMMEDIATE (low low)  */  \
-  V(tmlh, TMLH, 0xA70)   /* type = RI_A  TEST UNDER MASK (low high)  */        \
-  V(tmh, TMH, 0xA70)     /* type = RI_A  TEST UNDER MASK HIGH  */              \
-  V(tmll, TMLL, 0xA71)   /* type = RI_A  TEST UNDER MASK (low low)  */         \
-  V(tml, TML, 0xA71)     /* type = RI_A  TEST UNDER MASK LOW  */               \
-  V(tmhh, TMHH, 0xA72)   /* type = RI_A  TEST UNDER MASK (high high)  */       \
-  V(tmhl, TMHL, 0xA73)   /* type = RI_A  TEST UNDER MASK (high low)  */        \
-  V(lhi, LHI, 0xA78)     /* type = RI_A  LOAD HALFWORD IMMEDIATE (32)<-16  */  \
-  V(lghi, LGHI, 0xA79)   /* type = RI_A  LOAD HALFWORD IMMEDIATE (64<-16)  */  \
-  V(ahi, AHI, 0xA7A)     /* type = RI_A  ADD HALFWORD IMMEDIATE (32<-16)  */   \
-  V(aghi, AGHI, 0xA7B)   /* type = RI_A  ADD HALFWORD IMMEDIATE (64<-16)  */   \
-  V(mhi, MHI, 0xA7C) /* type = RI_A  MULTIPLY HALFWORD IMMEDIATE (32<-16)  */  \
-  V(mghi, MGHI, 0xA7D) /* type = RI_A  MULTIPLY HALFWORD IMMEDIATE (64<-16) */ \
-  V(chi, CHI, 0xA7E)   /* type = RI_A  COMPARE HALFWORD IMMEDIATE (32<-16)  */ \
-  V(cghi, CGHI, 0xA7F) /* type = RI_A  COMPARE HALFWORD IMMEDIATE (64<-16)  */
-
-#define S390_RSI_OPCODE_LIST(V)                                              \
-  V(brxh, BRXH, 0x84) /* type = RSI   BRANCH RELATIVE ON INDEX HIGH (32)  */ \
-  V(brxle, BRXLE,                                                            \
-    0x85) /* type = RSI   BRANCH RELATIVE ON INDEX LOW OR EQ. (32)  */
-
-#define S390_RI_B_OPCODE_LIST(V)                                           \
-  V(bras, BRAS, 0xA75)   /* type = RI_B  BRANCH RELATIVE AND SAVE  */      \
-  V(brct, BRCT, 0xA76)   /* type = RI_B  BRANCH RELATIVE ON COUNT (32)  */ \
-  V(brctg, BRCTG, 0xA77) /* type = RI_B  BRANCH RELATIVE ON COUNT (64)  */
-
-#define S390_RI_C_OPCODE_LIST(V) \
-  V(brc, BRC, 0xA74) /* type = RI_C BRANCH RELATIVE ON CONDITION  */
-
-#define S390_RSL_OPCODE_LIST(V)                                                \
-  V(czdt, CZDT, 0xEDA8) /* type = RSL CONVERT TO ZONED (from long DFP)  */     \
-  V(czxt, CZXT, 0xEDA9) /* type = RSL CONVERT TO ZONED (from extended DFP)  */ \
-  V(cdzt, CDZT, 0xEDAA) /* type = RSL CONVERT FROM ZONED (to long DFP)  */     \
-  V(cxzt, CXZT, 0xEDAB) /* type = RSL CONVERT FROM ZONED (to extended DFP) */
-
-#define S390_SMI_OPCODE_LIST(V) \
-  V(bpp, BPP, 0xC7) /* type = SMI   BRANCH PREDICTION PRELOAD  */
-
-#define S390_RXY_A_OPCODE_LIST(V)                                              \
-  V(ltg, LTG, 0xE302)   /* type = RXY_A LOAD AND TEST (64)  */                 \
-  V(lrag, LRAG, 0xE303) /* type = RXY_A LOAD REAL ADDRESS (64)  */             \
-  V(lg, LG, 0xE304)     /* type = RXY_A LOAD (64)  */                          \
-  V(cvby, CVBY, 0xE306) /* type = RXY_A CONVERT TO BINARY (32)  */             \
-  V(ag, AG, 0xE308)     /* type = RXY_A ADD (64)  */                           \
-  V(sg, SG, 0xE309)     /* type = RXY_A SUBTRACT (64)  */                      \
-  V(alg, ALG, 0xE30A)   /* type = RXY_A ADD LOGICAL (64)  */                   \
-  V(slg, SLG, 0xE30B)   /* type = RXY_A SUBTRACT LOGICAL (64)  */              \
-  V(msg, MSG, 0xE30C)   /* type = RXY_A MULTIPLY SINGLE (64)  */               \
-  V(dsg, DSG, 0xE30D)   /* type = RXY_A DIVIDE SINGLE (64)  */                 \
-  V(cvbg, CVBG, 0xE30E) /* type = RXY_A CONVERT TO BINARY (64)  */             \
-  V(lrvg, LRVG, 0xE30F) /* type = RXY_A LOAD REVERSED (64)  */                 \
-  V(lt_z, LT, 0xE312)   /* type = RXY_A LOAD AND TEST (32)  */                 \
-  V(lray, LRAY, 0xE313) /* type = RXY_A LOAD REAL ADDRESS (32)  */             \
-  V(lgf, LGF, 0xE314)   /* type = RXY_A LOAD (64<-32)  */                      \
-  V(lgh, LGH, 0xE315)   /* type = RXY_A LOAD HALFWORD (64<-16)  */             \
-  V(llgf, LLGF, 0xE316) /* type = RXY_A LOAD LOGICAL (64<-32)  */              \
-  V(llgt, LLGT,                                                                \
-    0xE317) /* type = RXY_A LOAD LOGICAL THIRTY ONE BITS (64<-31)  */          \
-  V(agf, AGF, 0xE318)     /* type = RXY_A ADD (64<-32)  */                     \
-  V(sgf, SGF, 0xE319)     /* type = RXY_A SUBTRACT (64<-32)  */                \
-  V(algf, ALGF, 0xE31A)   /* type = RXY_A ADD LOGICAL (64<-32)  */             \
-  V(slgf, SLGF, 0xE31B)   /* type = RXY_A SUBTRACT LOGICAL (64<-32)  */        \
-  V(msgf, MSGF, 0xE31C)   /* type = RXY_A MULTIPLY SINGLE (64<-32)  */         \
-  V(dsgf, DSGF, 0xE31D)   /* type = RXY_A DIVIDE SINGLE (64<-32)  */           \
-  V(lrv, LRV, 0xE31E)     /* type = RXY_A LOAD REVERSED (32)  */               \
-  V(lrvh, LRVH, 0xE31F)   /* type = RXY_A LOAD REVERSED (16)  */               \
-  V(cg, CG, 0xE320)       /* type = RXY_A COMPARE (64)  */                     \
-  V(clg, CLG, 0xE321)     /* type = RXY_A COMPARE LOGICAL (64)  */             \
-  V(stg, STG, 0xE324)     /* type = RXY_A STORE (64)  */                       \
-  V(ntstg, NTSTG, 0xE325) /* type = RXY_A NONTRANSACTIONAL STORE (64)  */      \
-  V(cvdy, CVDY, 0xE326)   /* type = RXY_A CONVERT TO DECIMAL (32)  */          \
-  V(lzrg, LZRG, 0xE32A) /* type = RXY_A LOAD AND ZERO RIGHTMOST BYTE (64)  */  \
-  V(cvdg, CVDG, 0xE32E) /* type = RXY_A CONVERT TO DECIMAL (64)  */            \
-  V(strvg, STRVG, 0xE32F) /* type = RXY_A STORE REVERSED (64)  */              \
-  V(cgf, CGF, 0xE330)     /* type = RXY_A COMPARE (64<-32)  */                 \
-  V(clgf, CLGF, 0xE331)   /* type = RXY_A COMPARE LOGICAL (64<-32)  */         \
-  V(ltgf, LTGF, 0xE332)   /* type = RXY_A LOAD AND TEST (64<-32)  */           \
-  V(cgh, CGH, 0xE334)     /* type = RXY_A COMPARE HALFWORD (64<-16)  */        \
-  V(llzrgf, LLZRGF,                                                            \
-    0xE33A) /* type = RXY_A LOAD LOGICAL AND ZERO RIGHTMOST BYTE (64<-32)  */  \
-  V(lzrf, LZRF, 0xE33B) /* type = RXY_A LOAD AND ZERO RIGHTMOST BYTE (32)  */  \
-  V(strv, STRV, 0xE33E) /* type = RXY_A STORE REVERSED (32)  */                \
-  V(strvh, STRVH, 0xE33F) /* type = RXY_A STORE REVERSED (16)  */              \
-  V(bctg, BCTG, 0xE346)   /* type = RXY_A BRANCH ON COUNT (64)  */             \
-  V(sty, STY, 0xE350)     /* type = RXY_A STORE (32)  */                       \
-  V(msy, MSY, 0xE351)     /* type = RXY_A MULTIPLY SINGLE (32)  */             \
-  V(ny, NY, 0xE354)       /* type = RXY_A AND (32)  */                         \
-  V(cly, CLY, 0xE355)     /* type = RXY_A COMPARE LOGICAL (32)  */             \
-  V(oy, OY, 0xE356)       /* type = RXY_A OR (32)  */                          \
-  V(xy, XY, 0xE357)       /* type = RXY_A EXCLUSIVE OR (32)  */                \
-  V(ly, LY, 0xE358)       /* type = RXY_A LOAD (32)  */                        \
-  V(cy, CY, 0xE359)       /* type = RXY_A COMPARE (32)  */                     \
-  V(ay, AY, 0xE35A)       /* type = RXY_A ADD (32)  */                         \
-  V(sy, SY, 0xE35B)       /* type = RXY_A SUBTRACT (32)  */                    \
-  V(mfy, MFY, 0xE35C)     /* type = RXY_A MULTIPLY (64<-32)  */                \
-  V(aly, ALY, 0xE35E)     /* type = RXY_A ADD LOGICAL (32)  */                 \
-  V(sly, SLY, 0xE35F)     /* type = RXY_A SUBTRACT LOGICAL (32)  */            \
-  V(sthy, STHY, 0xE370)   /* type = RXY_A STORE HALFWORD (16)  */              \
-  V(lay, LAY, 0xE371)     /* type = RXY_A LOAD ADDRESS  */                     \
-  V(stcy, STCY, 0xE372)   /* type = RXY_A STORE CHARACTER  */                  \
-  V(icy, ICY, 0xE373)     /* type = RXY_A INSERT CHARACTER  */                 \
-  V(laey, LAEY, 0xE375)   /* type = RXY_A LOAD ADDRESS EXTENDED  */            \
-  V(lb, LB, 0xE376)       /* type = RXY_A LOAD BYTE (32<-8)  */                \
-  V(lgb, LGB, 0xE377)     /* type = RXY_A LOAD BYTE (64<-8)  */                \
-  V(lhy, LHY, 0xE378)     /* type = RXY_A LOAD HALFWORD (32)<-16  */           \
-  V(chy, CHY, 0xE379)     /* type = RXY_A COMPARE HALFWORD (32<-16)  */        \
-  V(ahy, AHY, 0xE37A)     /* type = RXY_A ADD HALFWORD (32<-16)  */            \
-  V(shy, SHY, 0xE37B)     /* type = RXY_A SUBTRACT HALFWORD (32<-16)  */       \
-  V(mhy, MHY, 0xE37C)     /* type = RXY_A MULTIPLY HALFWORD (32<-16)  */       \
-  V(ng, NG, 0xE380)       /* type = RXY_A AND (64)  */                         \
-  V(og, OG, 0xE381)       /* type = RXY_A OR (64)  */                          \
-  V(xg, XG, 0xE382)       /* type = RXY_A EXCLUSIVE OR (64)  */                \
-  V(lgat, LGAT, 0xE385)   /* type = RXY_A LOAD AND TRAP (64)  */               \
-  V(mlg, MLG, 0xE386)     /* type = RXY_A MULTIPLY LOGICAL (128<-64)  */       \
-  V(dlg, DLG, 0xE387)     /* type = RXY_A DIVIDE LOGICAL (64<-128)  */         \
-  V(alcg, ALCG, 0xE388)   /* type = RXY_A ADD LOGICAL WITH CARRY (64)  */      \
-  V(slbg, SLBG, 0xE389) /* type = RXY_A SUBTRACT LOGICAL WITH BORROW (64)  */  \
-  V(stpq, STPQ, 0xE38E) /* type = RXY_A STORE PAIR TO QUADWORD  */             \
-  V(lpq, LPQ, 0xE38F) /* type = RXY_A LOAD PAIR FROM QUADWORD (64&64<-128)  */ \
-  V(llgc, LLGC, 0xE390) /* type = RXY_A LOAD LOGICAL CHARACTER (64<-8)  */     \
-  V(llgh, LLGH, 0xE391) /* type = RXY_A LOAD LOGICAL HALFWORD (64<-16)  */     \
-  V(llc, LLC, 0xE394)   /* type = RXY_A LOAD LOGICAL CHARACTER (32<-8)  */     \
-  V(llh, LLH, 0xE395)   /* type = RXY_A LOAD LOGICAL HALFWORD (32<-16)  */     \
-  V(ml, ML, 0xE396)     /* type = RXY_A MULTIPLY LOGICAL (64<-32)  */          \
-  V(dl, DL, 0xE397)     /* type = RXY_A DIVIDE LOGICAL (32<-64)  */            \
-  V(alc, ALC, 0xE398)   /* type = RXY_A ADD LOGICAL WITH CARRY (32)  */        \
-  V(slb, SLB, 0xE399)   /* type = RXY_A SUBTRACT LOGICAL WITH BORROW (32)  */  \
-  V(llgtat, LLGTAT,                                                            \
-    0xE39C) /* type = RXY_A LOAD LOGICAL THIRTY ONE BITS AND TRAP (64<-31)  */ \
-  V(llgfat, LLGFAT, 0xE39D) /* type = RXY_A LOAD LOGICAL AND TRAP (64<-32)  */ \
-  V(lat, LAT, 0xE39F)       /* type = RXY_A LOAD AND TRAP (32L<-32)  */        \
-  V(lbh, LBH, 0xE3C0)       /* type = RXY_A LOAD BYTE HIGH (32<-8)  */         \
-  V(llch, LLCH, 0xE3C2) /* type = RXY_A LOAD LOGICAL CHARACTER HIGH (32<-8) */ \
-  V(stch, STCH, 0xE3C3) /* type = RXY_A STORE CHARACTER HIGH (8)  */           \
-  V(lhh, LHH, 0xE3C4)   /* type = RXY_A LOAD HALFWORD HIGH (32<-16)  */        \
-  V(llhh, LLHH, 0xE3C6) /* type = RXY_A LOAD LOGICAL HALFWORD HIGH (32<-16) */ \
-  V(sthh, STHH, 0xE3C7) /* type = RXY_A STORE HALFWORD HIGH (16)  */           \
-  V(lfhat, LFHAT, 0xE3C8) /* type = RXY_A LOAD HIGH AND TRAP (32H<-32)  */     \
-  V(lfh, LFH, 0xE3CA)     /* type = RXY_A LOAD HIGH (32)  */                   \
-  V(stfh, STFH, 0xE3CB)   /* type = RXY_A STORE HIGH (32)  */                  \
-  V(chf, CHF, 0xE3CD)     /* type = RXY_A COMPARE HIGH (32)  */                \
-  V(clhf, CLHF, 0xE3CF)   /* type = RXY_A COMPARE LOGICAL HIGH (32)  */        \
-  V(ley, LEY, 0xED64)     /* type = RXY_A LOAD (short)  */                     \
-  V(ldy, LDY, 0xED65)     /* type = RXY_A LOAD (long)  */                      \
-  V(stey, STEY, 0xED66)   /* type = RXY_A STORE (short)  */                    \
-  V(stdy, STDY, 0xED67)   /* type = RXY_A STORE (long)  */                     \
-  V(msc, MSC, 0xE353)     /* type = RSY_A MULTIPLY SINGLE (32)  */             \
-  V(msgc, MSGC, 0xE383)   /* type = RSY_A MULTIPLY SINGLE (64)  */
-
-#define S390_RXY_B_OPCODE_LIST(V) \
-  V(pfd, PFD, 0xE336) /* type = RXY_B PREFETCH DATA  */
-
-#define S390_SIY_OPCODE_LIST(V)                                           \
-  V(tmy, TMY, 0xEB51)   /* type = SIY   TEST UNDER MASK  */               \
-  V(mviy, MVIY, 0xEB52) /* type = SIY   MOVE (immediate)  */              \
-  V(niy, NIY, 0xEB54)   /* type = SIY   AND (immediate)  */               \
-  V(cliy, CLIY, 0xEB55) /* type = SIY   COMPARE LOGICAL (immediate)  */   \
-  V(oiy, OIY, 0xEB56)   /* type = SIY   OR (immediate)  */                \
-  V(xiy, XIY, 0xEB57)   /* type = SIY   EXCLUSIVE OR (immediate)  */      \
-  V(asi, ASI, 0xEB6A)   /* type = SIY   ADD IMMEDIATE (32<-8)  */         \
-  V(alsi, ALSI,                                                           \
-    0xEB6E) /* type = SIY   ADD LOGICAL WITH SIGNED IMMEDIATE (32<-8)  */ \
-  V(agsi, AGSI, 0xEB7A) /* type = SIY   ADD IMMEDIATE (64<-8)  */         \
-  V(algsi, ALGSI,                                                         \
-    0xEB7E) /* type = SIY   ADD LOGICAL WITH SIGNED IMMEDIATE (64<-8)  */
-
-#define S390_SS_A_OPCODE_LIST(V)                                        \
-  V(trtr, TRTR, 0xD0)   /* type = SS_A  TRANSLATE AND TEST REVERSE  */  \
-  V(mvn, MVN, 0xD1)     /* type = SS_A  MOVE NUMERICS  */               \
-  V(mvc, MVC, 0xD2)     /* type = SS_A  MOVE (character)  */            \
-  V(mvz, MVZ, 0xD3)     /* type = SS_A  MOVE ZONES  */                  \
-  V(nc, NC, 0xD4)       /* type = SS_A  AND (character)  */             \
-  V(clc, CLC, 0xD5)     /* type = SS_A  COMPARE LOGICAL (character)  */ \
-  V(oc, OC, 0xD6)       /* type = SS_A  OR (character)  */              \
-  V(xc, XC, 0xD7)       /* type = SS_A  EXCLUSIVE OR (character)  */    \
-  V(tr, TR, 0xDC)       /* type = SS_A  TRANSLATE  */                   \
-  V(trt, TRT, 0xDD)     /* type = SS_A  TRANSLATE AND TEST  */          \
-  V(ed, ED, 0xDE)       /* type = SS_A  EDIT  */                        \
-  V(edmk, EDMK, 0xDF)   /* type = SS_A  EDIT AND MARK  */               \
-  V(unpku, UNPKU, 0xE2) /* type = SS_A  UNPACK UNICODE  */              \
-  V(mvcin, MVCIN, 0xE8) /* type = SS_A  MOVE INVERSE  */                \
-  V(unpka, UNPKA, 0xEA) /* type = SS_A  UNPACK ASCII  */
-
-#define S390_E_OPCODE_LIST(V)                                                  \
-  V(pr, PR, 0x0101)       /* type = E     PROGRAM RETURN  */                   \
-  V(upt, UPT, 0x0102)     /* type = E     UPDATE TREE  */                      \
-  V(ptff, PTFF, 0x0104)   /* type = E     PERFORM TIMING FACILITY FUNCTION  */ \
-  V(sckpf, SCKPF, 0x0107) /* type = E     SET CLOCK PROGRAMMABLE FIELD  */     \
-  V(pfpo, PFPO, 0x010A)   /* type = E     PERFORM FLOATING-POINT OPERATION  */ \
-  V(tam, TAM, 0x010B)     /* type = E     TEST ADDRESSING MODE  */             \
-  V(sam24, SAM24, 0x010C) /* type = E     SET ADDRESSING MODE (24)  */         \
-  V(sam31, SAM31, 0x010D) /* type = E     SET ADDRESSING MODE (31)  */         \
-  V(sam64, SAM64, 0x010E) /* type = E     SET ADDRESSING MODE (64)  */         \
-  V(trap2, TRAP2, 0x01FF) /* type = E     TRAP  */
-
-#define S390_SS_B_OPCODE_LIST(V)                           \
-  V(mvo, MVO, 0xF1)   /* type = SS_B  MOVE WITH OFFSET  */ \
-  V(pack, PACK, 0xF2) /* type = SS_B  PACK  */             \
-  V(unpk, UNPK, 0xF3) /* type = SS_B  UNPACK  */           \
-  V(zap, ZAP, 0xF8)   /* type = SS_B  ZERO AND ADD  */     \
-  V(cp, CP, 0xF9)     /* type = SS_B  COMPARE DECIMAL  */  \
-  V(ap, AP, 0xFA)     /* type = SS_B  ADD DECIMAL  */      \
-  V(sp, SP, 0xFB)     /* type = SS_B  SUBTRACT DECIMAL  */ \
-  V(mp, MP, 0xFC)     /* type = SS_B  MULTIPLY DECIMAL  */ \
-  V(dp, DP, 0xFD)     /* type = SS_B  DIVIDE DECIMAL  */
-
-#define S390_SS_C_OPCODE_LIST(V) \
-  V(srp, SRP, 0xF0) /* type = SS_C  SHIFT AND ROUND DECIMAL  */
-
-#define S390_SS_D_OPCODE_LIST(V)                          \
-  V(mvck, MVCK, 0xD9) /* type = SS_D  MOVE WITH KEY  */   \
-  V(mvcp, MVCP, 0xDA) /* type = SS_D  MOVE TO PRIMARY  */ \
-  V(mvcs, MVCS, 0xDB) /* type = SS_D  MOVE TO SECONDARY  */
-
-#define S390_SS_E_OPCODE_LIST(V)                                 \
-  V(plo, PLO, 0xEE) /* type = SS_E  PERFORM LOCKED OPERATION  */ \
-  V(lmd, LMD, 0xEF) /* type = SS_E  LOAD MULTIPLE DISJOINT (64<-32&32)  */
-
-#define S390_I_OPCODE_LIST(V) \
-  V(svc, SVC, 0x0A) /* type = I     SUPERVISOR CALL  */
-
-#define S390_SS_F_OPCODE_LIST(V)                     \
-  V(pku, PKU, 0xE1) /* type = SS_F  PACK UNICODE  */ \
-  V(pka, PKA, 0xE9) /* type = SS_F  PACK ASCII  */
-
-#define S390_SSE_OPCODE_LIST(V)                                             \
-  V(lasp, LASP, 0xE500)   /* type = SSE   LOAD ADDRESS SPACE PARAMETERS  */ \
-  V(tprot, TPROT, 0xE501) /* type = SSE   TEST PROTECTION  */               \
-  V(strag, STRAG, 0xE502) /* type = SSE   STORE REAL ADDRESS  */            \
-  V(mvcsk, MVCSK, 0xE50E) /* type = SSE   MOVE WITH SOURCE KEY  */          \
-  V(mvcdk, MVCDK, 0xE50F) /* type = SSE   MOVE WITH DESTINATION KEY  */
-
-#define S390_SSF_OPCODE_LIST(V)                                                \
-  V(mvcos, MVCOS, 0xC80) /* type = SSF   MOVE WITH OPTIONAL SPECIFICATIONS  */ \
-  V(ectg, ECTG, 0xC81)   /* type = SSF   EXTRACT CPU TIME  */                  \
-  V(csst, CSST, 0xC82)   /* type = SSF   COMPARE AND SWAP AND STORE  */        \
-  V(lpd, LPD, 0xC84)     /* type = SSF   LOAD PAIR DISJOINT (32)  */           \
-  V(lpdg, LPDG, 0xC85)   /* type = SSF   LOAD PAIR DISJOINT (64)  */
-
-#define S390_RS_A_OPCODE_LIST(V)                                              \
-  V(bxh, BXH, 0x86)     /* type = RS_A  BRANCH ON INDEX HIGH (32)  */         \
-  V(bxle, BXLE, 0x87)   /* type = RS_A  BRANCH ON INDEX LOW OR EQUAL (32)  */ \
-  V(srl, SRL, 0x88)     /* type = RS_A  SHIFT RIGHT SINGLE LOGICAL (32)  */   \
-  V(sll, SLL, 0x89)     /* type = RS_A  SHIFT LEFT SINGLE LOGICAL (32)  */    \
-  V(sra, SRA, 0x8A)     /* type = RS_A  SHIFT RIGHT SINGLE (32)  */           \
-  V(sla, SLA, 0x8B)     /* type = RS_A  SHIFT LEFT SINGLE (32)  */            \
-  V(srdl, SRDL, 0x8C)   /* type = RS_A  SHIFT RIGHT DOUBLE LOGICAL (64)  */   \
-  V(sldl, SLDL, 0x8D)   /* type = RS_A  SHIFT LEFT DOUBLE LOGICAL (64)  */    \
-  V(srda, SRDA, 0x8E)   /* type = RS_A  SHIFT RIGHT DOUBLE (64)  */           \
-  V(slda, SLDA, 0x8F)   /* type = RS_A  SHIFT LEFT DOUBLE (64)  */            \
-  V(stm, STM, 0x90)     /* type = RS_A  STORE MULTIPLE (32)  */               \
-  V(lm, LM, 0x98)       /* type = RS_A  LOAD MULTIPLE (32)  */                \
-  V(trace, TRACE, 0x99) /* type = RS_A  TRACE (32)  */                        \
-  V(lam, LAM, 0x9A)     /* type = RS_A  LOAD ACCESS MULTIPLE  */              \
-  V(stam, STAM, 0x9B)   /* type = RS_A  STORE ACCESS MULTIPLE  */             \
-  V(mvcle, MVCLE, 0xA8) /* type = RS_A  MOVE LONG EXTENDED  */                \
-  V(clcle, CLCLE, 0xA9) /* type = RS_A  COMPARE LOGICAL LONG EXTENDED  */     \
-  V(sigp, SIGP, 0xAE)   /* type = RS_A  SIGNAL PROCESSOR  */                  \
-  V(stctl, STCTL, 0xB6) /* type = RS_A  STORE CONTROL (32)  */                \
-  V(lctl, LCTL, 0xB7)   /* type = RS_A  LOAD CONTROL (32)  */                 \
-  V(cs, CS, 0xBA)       /* type = RS_A  COMPARE AND SWAP (32)  */             \
-  V(cds, CDS, 0xBB)     /* type = RS_A  COMPARE DOUBLE AND SWAP (32)  */
-
-#define S390_RS_B_OPCODE_LIST(V)                                               \
-  V(clm, CLM, 0xBD) /* type = RS_B  COMPARE LOGICAL CHAR. UNDER MASK (low)  */ \
-  V(stcm, STCM, 0xBE) /* type = RS_B  STORE CHARACTERS UNDER MASK (low)  */    \
-  V(icm, ICM, 0xBF)   /* type = RS_B  INSERT CHARACTERS UNDER MASK (low)  */
-
-#define S390_S_OPCODE_LIST(V)                                                  \
-  V(awr, AWR, 0x2E)           /* type = S     ADD UNNORMALIZED (long HFP)  */  \
-  V(lpsw, LPSW, 0x82)         /* type = S     LOAD PSW  */                     \
-  V(diagnose, DIAGNOSE, 0x83) /* type = S     DIAGNOSE  */                     \
-  V(ts, TS, 0x93)             /* type = S     TEST AND SET  */                 \
-  V(stidp, STIDP, 0xB202)     /* type = S     STORE CPU ID  */                 \
-  V(sck, SCK, 0xB204)         /* type = S     SET CLOCK  */                    \
-  V(stck, STCK, 0xB205)       /* type = S     STORE CLOCK  */                  \
-  V(sckc, SCKC, 0xB206)       /* type = S     SET CLOCK COMPARATOR  */         \
-  V(stckc, STCKC, 0xB207)     /* type = S     STORE CLOCK COMPARATOR  */       \
-  V(spt, SPT, 0xB208)         /* type = S     SET CPU TIMER  */                \
-  V(stpt, STPT, 0xB209)       /* type = S     STORE CPU TIMER  */              \
-  V(spka, SPKA, 0xB20A)       /* type = S     SET PSW KEY FROM ADDRESS  */     \
-  V(ipk, IPK, 0xB20B)         /* type = S     INSERT PSW KEY  */               \
-  V(ptlb, PTLB, 0xB20D)       /* type = S     PURGE TLB  */                    \
-  V(spx, SPX, 0xB210)         /* type = S     SET PREFIX  */                   \
-  V(stpx, STPX, 0xB211)       /* type = S     STORE PREFIX  */                 \
-  V(stap, STAP, 0xB212)       /* type = S     STORE CPU ADDRESS  */            \
-  V(pc, PC, 0xB218)           /* type = S     PROGRAM CALL  */                 \
-  V(sac, SAC, 0xB219)         /* type = S     SET ADDRESS SPACE CONTROL  */    \
-  V(cfc, CFC, 0xB21A)         /* type = S     COMPARE AND FORM CODEWORD  */    \
-  V(csch, CSCH, 0xB230)       /* type = S     CLEAR SUBCHANNEL  */             \
-  V(hsch, HSCH, 0xB231)       /* type = S     HALT SUBCHANNEL  */              \
-  V(msch, MSCH, 0xB232)       /* type = S     MODIFY SUBCHANNEL  */            \
-  V(ssch, SSCH, 0xB233)       /* type = S     START SUBCHANNEL  */             \
-  V(stsch, STSCH, 0xB234)     /* type = S     STORE SUBCHANNEL  */             \
-  V(tsch, TSCH, 0xB235)       /* type = S     TEST SUBCHANNEL  */              \
-  V(tpi, TPI, 0xB236)         /* type = S     TEST PENDING INTERRUPTION  */    \
-  V(sal, SAL, 0xB237)         /* type = S     SET ADDRESS LIMIT  */            \
-  V(rsch, RSCH, 0xB238)       /* type = S     RESUME SUBCHANNEL  */            \
-  V(stcrw, STCRW, 0xB239)     /* type = S     STORE CHANNEL REPORT WORD  */    \
-  V(stcps, STCPS, 0xB23A)     /* type = S     STORE CHANNEL PATH STATUS  */    \
-  V(rchp, RCHP, 0xB23B)       /* type = S     RESET CHANNEL PATH  */           \
-  V(schm, SCHM, 0xB23C)       /* type = S     SET CHANNEL MONITOR  */          \
-  V(xsch, XSCH, 0xB276)       /* type = S     CANCEL SUBCHANNEL  */            \
-  V(rp, RP_Z, 0xB277)         /* type = S     RESUME PROGRAM  */               \
-  V(stcke, STCKE, 0xB278)     /* type = S     STORE CLOCK EXTENDED  */         \
-  V(sacf, SACF, 0xB279)     /* type = S     SET ADDRESS SPACE CONTROL FAST  */ \
-  V(stckf, STCKF, 0xB27C)   /* type = S     STORE CLOCK FAST  */               \
-  V(stsi, STSI, 0xB27D)     /* type = S     STORE SYSTEM INFORMATION  */       \
-  V(srnm, SRNM, 0xB299)     /* type = S     SET BFP ROUNDING MODE (2 bit)  */  \
-  V(stfpc, STFPC, 0xB29C)   /* type = S     STORE FPC  */                      \
-  V(lfpc, LFPC, 0xB29D)     /* type = S     LOAD FPC  */                       \
-  V(stfle, STFLE, 0xB2B0)   /* type = S     STORE FACILITY LIST EXTENDED  */   \
-  V(stfl, STFL, 0xB2B1)     /* type = S     STORE FACILITY LIST  */            \
-  V(lpswe, LPSWE, 0xB2B2)   /* type = S     LOAD PSW EXTENDED  */              \
-  V(srnmb, SRNMB, 0xB2B8)   /* type = S     SET BFP ROUNDING MODE (3 bit)  */  \
-  V(srnmt, SRNMT, 0xB2B9)   /* type = S     SET DFP ROUNDING MODE  */          \
-  V(lfas, LFAS, 0xB2BD)     /* type = S     LOAD FPC AND SIGNAL  */            \
-  V(tend, TEND, 0xB2F8)     /* type = S     TRANSACTION END  */                \
-  V(tabort, TABORT, 0xB2FC) /* type = S     TRANSACTION ABORT  */              \
-  V(trap4, TRAP4, 0xB2FF)   /* type = S     TRAP  */
-
-#define S390_RX_A_OPCODE_LIST(V)                                            \
-  V(la, LA, 0x41)     /* type = RX_A  LOAD ADDRESS  */                      \
-  V(stc, STC, 0x42)   /* type = RX_A  STORE CHARACTER  */                   \
-  V(ic_z, IC_z, 0x43) /* type = RX_A  INSERT CHARACTER  */                  \
-  V(ex, EX, 0x44)     /* type = RX_A  EXECUTE  */                           \
-  V(bal, BAL, 0x45)   /* type = RX_A  BRANCH AND LINK  */                   \
-  V(bct, BCT, 0x46)   /* type = RX_A  BRANCH ON COUNT (32)  */              \
-  V(lh, LH, 0x48)     /* type = RX_A  LOAD HALFWORD (32<-16)  */            \
-  V(ch, CH, 0x49)     /* type = RX_A  COMPARE HALFWORD (32<-16)  */         \
-  V(ah, AH, 0x4A)     /* type = RX_A  ADD HALFWORD (32<-16)  */             \
-  V(sh, SH, 0x4B)     /* type = RX_A  SUBTRACT HALFWORD (32<-16)  */        \
-  V(mh, MH, 0x4C)     /* type = RX_A  MULTIPLY HALFWORD (32<-16)  */        \
-  V(bas, BAS, 0x4D)   /* type = RX_A  BRANCH AND SAVE  */                   \
-  V(cvd, CVD, 0x4E)   /* type = RX_A  CONVERT TO DECIMAL (32)  */           \
-  V(cvb, CVB, 0x4F)   /* type = RX_A  CONVERT TO BINARY (32)  */            \
-  V(st, ST, 0x50)     /* type = RX_A  STORE (32)  */                        \
-  V(lae, LAE, 0x51)   /* type = RX_A  LOAD ADDRESS EXTENDED  */             \
-  V(n, N, 0x54)       /* type = RX_A  AND (32)  */                          \
-  V(cl, CL, 0x55)     /* type = RX_A  COMPARE LOGICAL (32)  */              \
-  V(o, O, 0x56)       /* type = RX_A  OR (32)  */                           \
-  V(x, X, 0x57)       /* type = RX_A  EXCLUSIVE OR (32)  */                 \
-  V(l, L, 0x58)       /* type = RX_A  LOAD (32)  */                         \
-  V(c, C, 0x59)       /* type = RX_A  COMPARE (32)  */                      \
-  V(a, A, 0x5A)       /* type = RX_A  ADD (32)  */                          \
-  V(s, S, 0x5B)       /* type = RX_A  SUBTRACT (32)  */                     \
-  V(m, M, 0x5C)       /* type = RX_A  MULTIPLY (64<-32)  */                 \
-  V(d, D, 0x5D)       /* type = RX_A  DIVIDE (32<-64)  */                   \
-  V(al_z, AL, 0x5E)   /* type = RX_A  ADD LOGICAL (32)  */                  \
-  V(sl, SL, 0x5F)     /* type = RX_A  SUBTRACT LOGICAL (32)  */             \
-  V(std, STD, 0x60)   /* type = RX_A  STORE (long)  */                      \
-  V(mxd, MXD, 0x67)   /* type = RX_A  MULTIPLY (long to extended HFP)  */   \
-  V(ld, LD, 0x68)     /* type = RX_A  LOAD (long)  */                       \
-  V(cd, CD, 0x69)     /* type = RX_A  COMPARE (long HFP)  */                \
-  V(ad, AD, 0x6A)     /* type = RX_A  ADD NORMALIZED (long HFP)  */         \
-  V(sd, SD, 0x6B)     /* type = RX_A  SUBTRACT NORMALIZED (long HFP)  */    \
-  V(md, MD, 0x6C)     /* type = RX_A  MULTIPLY (long HFP)  */               \
-  V(dd, DD, 0x6D)     /* type = RX_A  DIVIDE (long HFP)  */                 \
-  V(aw, AW, 0x6E)     /* type = RX_A  ADD UNNORMALIZED (long HFP)  */       \
-  V(sw, SW, 0x6F)     /* type = RX_A  SUBTRACT UNNORMALIZED (long HFP)  */  \
-  V(ste, STE, 0x70)   /* type = RX_A  STORE (short)  */                     \
-  V(ms, MS, 0x71)     /* type = RX_A  MULTIPLY SINGLE (32)  */              \
-  V(le_z, LE, 0x78)   /* type = RX_A  LOAD (short)  */                      \
-  V(ce, CE, 0x79)     /* type = RX_A  COMPARE (short HFP)  */               \
-  V(ae, AE, 0x7A)     /* type = RX_A  ADD NORMALIZED (short HFP)  */        \
-  V(se, SE, 0x7B)     /* type = RX_A  SUBTRACT NORMALIZED (short HFP)  */   \
-  V(mde, MDE, 0x7C)   /* type = RX_A  MULTIPLY (short to long HFP)  */      \
-  V(me, ME, 0x7C)     /* type = RX_A  MULTIPLY (short to long HFP)  */      \
-  V(de, DE, 0x7D)     /* type = RX_A  DIVIDE (short HFP)  */                \
-  V(au, AU, 0x7E)     /* type = RX_A  ADD UNNORMALIZED (short HFP)  */      \
-  V(su, SU, 0x7F)     /* type = RX_A  SUBTRACT UNNORMALIZED (short HFP)  */ \
-  V(ssm, SSM, 0x80)   /* type = RX_A  SET SYSTEM MASK  */                   \
-  V(lra, LRA, 0xB1)   /* type = RX_A  LOAD REAL ADDRESS (32)  */            \
-  V(sth, STH, 0x40)   /* type = RX_A  STORE HALFWORD (16)  */
-
-#define S390_RX_B_OPCODE_LIST(V) \
-  V(bc, BC, 0x47)     /* type = RX_B  BRANCH ON CONDITION  */
-
-#define S390_RIE_A_OPCODE_LIST(V)                                              \
-  V(cgit, CGIT, 0xEC70) /* type = RIE_A COMPARE IMMEDIATE AND TRAP (64<-16) */ \
-  V(clgit, CLGIT,                                                              \
-    0xEC71) /* type = RIE_A COMPARE LOGICAL IMMEDIATE AND TRAP (64<-16)  */    \
-  V(cit, CIT, 0xEC72) /* type = RIE_A COMPARE IMMEDIATE AND TRAP (32<-16)  */  \
-  V(clfit, CLFIT,                                                              \
-    0xEC73) /* type = RIE_A COMPARE LOGICAL IMMEDIATE AND TRAP (32<-16)  */
-
-#define S390_RRD_OPCODE_LIST(V)                                                \
-  V(maebr, MAEBR, 0xB30E) /* type = RRD   MULTIPLY AND ADD (short BFP)  */     \
-  V(msebr, MSEBR, 0xB30F) /* type = RRD   MULTIPLY AND SUBTRACT (short BFP) */ \
-  V(madbr, MADBR, 0xB31E) /* type = RRD   MULTIPLY AND ADD (long BFP)  */      \
-  V(msdbr, MSDBR, 0xB31F) /* type = RRD   MULTIPLY AND SUBTRACT (long BFP)  */ \
-  V(maer, MAER, 0xB32E)   /* type = RRD   MULTIPLY AND ADD (short HFP)  */     \
-  V(mser, MSER, 0xB32F) /* type = RRD   MULTIPLY AND SUBTRACT (short HFP)  */  \
-  V(maylr, MAYLR,                                                              \
-    0xB338) /* type = RRD   MULTIPLY AND ADD UNNRM. (long to ext. low HFP)  */ \
-  V(mylr, MYLR,                                                                \
-    0xB339) /* type = RRD   MULTIPLY UNNORM. (long to ext. low HFP)  */        \
-  V(mayr, MAYR,                                                                \
-    0xB33A) /* type = RRD   MULTIPLY & ADD UNNORMALIZED (long to ext. HFP)  */ \
-  V(myr, MYR,                                                                  \
-    0xB33B) /* type = RRD   MULTIPLY UNNORMALIZED (long to ext. HFP)  */       \
-  V(mayhr, MAYHR,                                                              \
-    0xB33C) /* type = RRD   MULTIPLY AND ADD UNNRM. (long to ext. high HFP) */ \
-  V(myhr, MYHR,                                                                \
-    0xB33D) /* type = RRD   MULTIPLY UNNORM. (long to ext. high HFP)  */       \
-  V(madr, MADR, 0xB33E) /* type = RRD   MULTIPLY AND ADD (long HFP)  */        \
-  V(msdr, MSDR, 0xB33F) /* type = RRD   MULTIPLY AND SUBTRACT (long HFP)  */
-
-#define S390_RIE_B_OPCODE_LIST(V)                                            \
-  V(cgrj, CGRJ, 0xEC64) /* type = RIE_B COMPARE AND BRANCH RELATIVE (64)  */ \
-  V(clgrj, CLGRJ,                                                            \
-    0xEC65) /* type = RIE_B COMPARE LOGICAL AND BRANCH RELATIVE (64)  */     \
-  V(crj, CRJ, 0xEC76) /* type = RIE_B COMPARE AND BRANCH RELATIVE (32)  */   \
-  V(clrj, CLRJ,                                                              \
-    0xEC77) /* type = RIE_B COMPARE LOGICAL AND BRANCH RELATIVE (32)  */
-
-#define S390_RRE_OPCODE_LIST(V)                                                \
-  V(ipm, IPM, 0xB222)     /* type = RRE   INSERT PROGRAM MASK  */              \
-  V(ivsk, IVSK, 0xB223)   /* type = RRE   INSERT VIRTUAL STORAGE KEY  */       \
-  V(iac, IAC, 0xB224)     /* type = RRE   INSERT ADDRESS SPACE CONTROL  */     \
-  V(ssar, SSAR, 0xB225)   /* type = RRE   SET SECONDARY ASN  */                \
-  V(epar, EPAR, 0xB226)   /* type = RRE   EXTRACT PRIMARY ASN  */              \
-  V(esar, ESAR, 0xB227)   /* type = RRE   EXTRACT SECONDARY ASN  */            \
-  V(pt, PT, 0xB228)       /* type = RRE   PROGRAM TRANSFER  */                 \
-  V(iske, ISKE, 0xB229)   /* type = RRE   INSERT STORAGE KEY EXTENDED  */      \
-  V(rrbe, RRBE, 0xB22A)   /* type = RRE   RESET REFERENCE BIT EXTENDED  */     \
-  V(tb, TB, 0xB22C)       /* type = RRE   TEST BLOCK  */                       \
-  V(dxr, DXR, 0xB22D)     /* type = RRE   DIVIDE (extended HFP)  */            \
-  V(pgin, PGIN, 0xB22E)   /* type = RRE   PAGE IN  */                          \
-  V(pgout, PGOUT, 0xB22F) /* type = RRE   PAGE OUT  */                         \
-  V(bakr, BAKR, 0xB240)   /* type = RRE   BRANCH AND STACK  */                 \
-  V(cksm, CKSM, 0xB241)   /* type = RRE   CHECKSUM  */                         \
-  V(sqdr, SQDR, 0xB244)   /* type = RRE   SQUARE ROOT (long HFP)  */           \
-  V(sqer, SQER, 0xB245)   /* type = RRE   SQUARE ROOT (short HFP)  */          \
-  V(stura, STURA, 0xB246) /* type = RRE   STORE USING REAL ADDRESS (32)  */    \
-  V(msta, MSTA, 0xB247)   /* type = RRE   MODIFY STACKED STATE  */             \
-  V(palb, PALB, 0xB248)   /* type = RRE   PURGE ALB  */                        \
-  V(ereg, EREG, 0xB249)   /* type = RRE   EXTRACT STACKED REGISTERS (32)  */   \
-  V(esta, ESTA, 0xB24A)   /* type = RRE   EXTRACT STACKED STATE  */            \
-  V(lura, LURA, 0xB24B)   /* type = RRE   LOAD USING REAL ADDRESS (32)  */     \
-  V(tar, TAR, 0xB24C)     /* type = RRE   TEST ACCESS  */                      \
-  V(cpya, CPYA, 0xB24D)   /* type = RRE   COPY ACCESS  */                      \
-  V(sar, SAR, 0xB24E)     /* type = RRE   SET ACCESS  */                       \
-  V(ear, EAR, 0xB24F)     /* type = RRE   EXTRACT ACCESS  */                   \
-  V(csp, CSP, 0xB250)     /* type = RRE   COMPARE AND SWAP AND PURGE (32)  */  \
-  V(msr, MSR, 0xB252)     /* type = RRE   MULTIPLY SINGLE (32)  */             \
-  V(mvpg, MVPG, 0xB254)   /* type = RRE   MOVE PAGE  */                        \
-  V(mvst, MVST, 0xB255)   /* type = RRE   MOVE STRING  */                      \
-  V(cuse, CUSE, 0xB257)   /* type = RRE   COMPARE UNTIL SUBSTRING EQUAL  */    \
-  V(bsg, BSG, 0xB258)     /* type = RRE   BRANCH IN SUBSPACE GROUP  */         \
-  V(bsa, BSA, 0xB25A)     /* type = RRE   BRANCH AND SET AUTHORITY  */         \
-  V(clst, CLST, 0xB25D)   /* type = RRE   COMPARE LOGICAL STRING  */           \
-  V(srst, SRST, 0xB25E)   /* type = RRE   SEARCH STRING  */                    \
-  V(cmpsc, CMPSC, 0xB263) /* type = RRE   COMPRESSION CALL  */                 \
-  V(tre, TRE, 0xB2A5)     /* type = RRE   TRANSLATE EXTENDED  */               \
-  V(etnd, ETND, 0xB2EC) /* type = RRE   EXTRACT TRANSACTION NESTING DEPTH  */  \
-  V(lpebr, LPEBR, 0xB300) /* type = RRE   LOAD POSITIVE (short BFP)  */        \
-  V(lnebr, LNEBR, 0xB301) /* type = RRE   LOAD NEGATIVE (short BFP)  */        \
-  V(ltebr, LTEBR, 0xB302) /* type = RRE   LOAD AND TEST (short BFP)  */        \
-  V(lcebr, LCEBR, 0xB303) /* type = RRE   LOAD COMPLEMENT (short BFP)  */      \
-  V(ldebr, LDEBR,                                                              \
-    0xB304) /* type = RRE   LOAD LENGTHENED (short to long BFP)  */            \
-  V(lxdbr, LXDBR,                                                              \
-    0xB305) /* type = RRE   LOAD LENGTHENED (long to extended BFP)  */         \
-  V(lxebr, LXEBR,                                                              \
-    0xB306) /* type = RRE   LOAD LENGTHENED (short to extended BFP)  */        \
-  V(mxdbr, MXDBR, 0xB307) /* type = RRE   MULTIPLY (long to extended BFP)  */  \
-  V(kebr, KEBR, 0xB308)   /* type = RRE   COMPARE AND SIGNAL (short BFP)  */   \
-  V(cebr, CEBR, 0xB309)   /* type = RRE   COMPARE (short BFP)  */              \
-  V(aebr, AEBR, 0xB30A)   /* type = RRE   ADD (short BFP)  */                  \
-  V(sebr, SEBR, 0xB30B)   /* type = RRE   SUBTRACT (short BFP)  */             \
-  V(mdebr, MDEBR, 0xB30C) /* type = RRE   MULTIPLY (short to long BFP)  */     \
-  V(debr, DEBR, 0xB30D)   /* type = RRE   DIVIDE (short BFP)  */               \
-  V(lpdbr, LPDBR, 0xB310) /* type = RRE   LOAD POSITIVE (long BFP)  */         \
-  V(lndbr, LNDBR, 0xB311) /* type = RRE   LOAD NEGATIVE (long BFP)  */         \
-  V(ltdbr, LTDBR, 0xB312) /* type = RRE   LOAD AND TEST (long BFP)  */         \
-  V(lcdbr, LCDBR, 0xB313) /* type = RRE   LOAD COMPLEMENT (long BFP)  */       \
-  V(sqebr, SQEBR, 0xB314) /* type = RRE   SQUARE ROOT (short BFP)  */          \
-  V(sqdbr, SQDBR, 0xB315) /* type = RRE   SQUARE ROOT (long BFP)  */           \
-  V(sqxbr, SQXBR, 0xB316) /* type = RRE   SQUARE ROOT (extended BFP)  */       \
-  V(meebr, MEEBR, 0xB317) /* type = RRE   MULTIPLY (short BFP)  */             \
-  V(kdbr, KDBR, 0xB318)   /* type = RRE   COMPARE AND SIGNAL (long BFP)  */    \
-  V(cdbr, CDBR, 0xB319)   /* type = RRE   COMPARE (long BFP)  */               \
-  V(adbr, ADBR, 0xB31A)   /* type = RRE   ADD (long BFP)  */                   \
-  V(sdbr, SDBR, 0xB31B)   /* type = RRE   SUBTRACT (long BFP)  */              \
-  V(mdbr, MDBR, 0xB31C)   /* type = RRE   MULTIPLY (long BFP)  */              \
-  V(ddbr, DDBR, 0xB31D)   /* type = RRE   DIVIDE (long BFP)  */                \
-  V(lder, LDER, 0xB324) /* type = RRE   LOAD LENGTHENED (short to long HFP) */ \
-  V(lxdr, LXDR,                                                                \
-    0xB325) /* type = RRE   LOAD LENGTHENED (long to extended HFP)  */         \
-  V(lxer, LXER,                                                                \
-    0xB326) /* type = RRE   LOAD LENGTHENED (short to extended HFP)  */        \
-  V(sqxr, SQXR, 0xB336)   /* type = RRE   SQUARE ROOT (extended HFP)  */       \
-  V(meer, MEER, 0xB337)   /* type = RRE   MULTIPLY (short HFP)  */             \
-  V(lpxbr, LPXBR, 0xB340) /* type = RRE   LOAD POSITIVE (extended BFP)  */     \
-  V(lnxbr, LNXBR, 0xB341) /* type = RRE   LOAD NEGATIVE (extended BFP)  */     \
-  V(ltxbr, LTXBR, 0xB342) /* type = RRE   LOAD AND TEST (extended BFP)  */     \
-  V(lcxbr, LCXBR, 0xB343) /* type = RRE   LOAD COMPLEMENT (extended BFP)  */   \
-  V(ledbr, LEDBR, 0xB344) /* type = RRE   LOAD ROUNDED (long to short BFP)  */ \
-  V(ldxbr, LDXBR,                                                              \
-    0xB345) /* type = RRE   LOAD ROUNDED (extended to long BFP)  */            \
-  V(lexbr, LEXBR,                                                              \
-    0xB346) /* type = RRE   LOAD ROUNDED (extended to short BFP)  */           \
-  V(kxbr, KXBR, 0xB348) /* type = RRE   COMPARE AND SIGNAL (extended BFP)  */  \
-  V(cxbr, CXBR, 0xB349) /* type = RRE   COMPARE (extended BFP)  */             \
-  V(axbr, AXBR, 0xB34A) /* type = RRE   ADD (extended BFP)  */                 \
-  V(sxbr, SXBR, 0xB34B) /* type = RRE   SUBTRACT (extended BFP)  */            \
-  V(mxbr, MXBR, 0xB34C) /* type = RRE   MULTIPLY (extended BFP)  */            \
-  V(dxbr, DXBR, 0xB34D) /* type = RRE   DIVIDE (extended BFP)  */              \
-  V(thder, THDER,                                                              \
-    0xB358)             /* type = RRE   CONVERT BFP TO HFP (short to long)  */ \
-  V(thdr, THDR, 0xB359) /* type = RRE   CONVERT BFP TO HFP (long)  */          \
-  V(lpxr, LPXR, 0xB360) /* type = RRE   LOAD POSITIVE (extended HFP)  */       \
-  V(lnxr, LNXR, 0xB361) /* type = RRE   LOAD NEGATIVE (extended HFP)  */       \
-  V(ltxr, LTXR, 0xB362) /* type = RRE   LOAD AND TEST (extended HFP)  */       \
-  V(lcxr, LCXR, 0xB363) /* type = RRE   LOAD COMPLEMENT (extended HFP)  */     \
-  V(lxr, LXR, 0xB365)   /* type = RRE   LOAD (extended)  */                    \
-  V(lexr, LEXR,                                                                \
-    0xB366) /* type = RRE   LOAD ROUNDED (extended to short HFP)  */           \
-  V(fixr, FIXR, 0xB367)   /* type = RRE   LOAD FP INTEGER (extended HFP)  */   \
-  V(cxr, CXR, 0xB369)     /* type = RRE   COMPARE (extended HFP)  */           \
-  V(lpdfr, LPDFR, 0xB370) /* type = RRE   LOAD POSITIVE (long)  */             \
-  V(lndfr, LNDFR, 0xB371) /* type = RRE   LOAD NEGATIVE (long)  */             \
-  V(lcdfr, LCDFR, 0xB373) /* type = RRE   LOAD COMPLEMENT (long)  */           \
-  V(lzer, LZER, 0xB374)   /* type = RRE   LOAD ZERO (short)  */                \
-  V(lzdr, LZDR, 0xB375)   /* type = RRE   LOAD ZERO (long)  */                 \
-  V(lzxr, LZXR, 0xB376)   /* type = RRE   LOAD ZERO (extended)  */             \
-  V(fier, FIER, 0xB377)   /* type = RRE   LOAD FP INTEGER (short HFP)  */      \
-  V(fidr, FIDR, 0xB37F)   /* type = RRE   LOAD FP INTEGER (long HFP)  */       \
-  V(sfpc, SFPC, 0xB384)   /* type = RRE   SET FPC  */                          \
-  V(sfasr, SFASR, 0xB385) /* type = RRE   SET FPC AND SIGNAL  */               \
-  V(efpc, EFPC, 0xB38C)   /* type = RRE   EXTRACT FPC  */                      \
-  V(cefbr, CEFBR,                                                              \
-    0xB394) /* type = RRE   CONVERT FROM FIXED (32 to short BFP)  */           \
-  V(cdfbr, CDFBR,                                                              \
-    0xB395) /* type = RRE   CONVERT FROM FIXED (32 to long BFP)  */            \
-  V(cxfbr, CXFBR,                                                              \
-    0xB396) /* type = RRE   CONVERT FROM FIXED (32 to extended BFP)  */        \
-  V(cegbr, CEGBR,                                                              \
-    0xB3A4) /* type = RRE   CONVERT FROM FIXED (64 to short BFP)  */           \
-  V(cdgbr, CDGBR,                                                              \
-    0xB3A5) /* type = RRE   CONVERT FROM FIXED (64 to long BFP)  */            \
-  V(cxgbr, CXGBR,                                                              \
-    0xB3A6) /* type = RRE   CONVERT FROM FIXED (64 to extended BFP)  */        \
-  V(cefr, CEFR,                                                                \
-    0xB3B4) /* type = RRE   CONVERT FROM FIXED (32 to short HFP)  */           \
-  V(cdfr, CDFR, 0xB3B5) /* type = RRE   CONVERT FROM FIXED (32 to long HFP) */ \
-  V(cxfr, CXFR,                                                                \
-    0xB3B6) /* type = RRE   CONVERT FROM FIXED (32 to extended HFP)  */        \
-  V(ldgr, LDGR, 0xB3C1) /* type = RRE   LOAD FPR FROM GR (64 to long)  */      \
-  V(cegr, CEGR,                                                                \
-    0xB3C4) /* type = RRE   CONVERT FROM FIXED (64 to short HFP)  */           \
-  V(cdgr, CDGR, 0xB3C5) /* type = RRE   CONVERT FROM FIXED (64 to long HFP) */ \
-  V(cxgr, CXGR,                                                                \
-    0xB3C6) /* type = RRE   CONVERT FROM FIXED (64 to extended HFP)  */        \
-  V(lgdr, LGDR, 0xB3CD)   /* type = RRE   LOAD GR FROM FPR (long to 64)  */    \
-  V(ltdtr, LTDTR, 0xB3D6) /* type = RRE   LOAD AND TEST (long DFP)  */         \
-  V(ltxtr, LTXTR, 0xB3DE) /* type = RRE   LOAD AND TEST (extended DFP)  */     \
-  V(kdtr, KDTR, 0xB3E0)   /* type = RRE   COMPARE AND SIGNAL (long DFP)  */    \
-  V(cudtr, CUDTR, 0xB3E2) /* type = RRE   CONVERT TO UNSIGNED PACKED (long */  \
-                          /* DFP to 64) CUDTR  */                              \
-  V(cdtr, CDTR, 0xB3E4)   /* type = RRE   COMPARE (long DFP)  */               \
-  V(eedtr, EEDTR,                                                              \
-    0xB3E5) /* type = RRE   EXTRACT BIASED EXPONENT (long DFP to 64)  */       \
-  V(esdtr, ESDTR,                                                              \
-    0xB3E7) /* type = RRE   EXTRACT SIGNIFICANCE (long DFP to 64)  */          \
-  V(kxtr, KXTR, 0xB3E8) /* type = RRE   COMPARE AND SIGNAL (extended DFP)  */  \
-  V(cuxtr, CUXTR,                                                              \
-    0xB3EA) /* type = RRE   CONVERT TO UNSIGNED PACKED (extended DFP       */  \
-            /* CUXTR to 128)  */                                               \
-  V(cxtr, CXTR, 0xB3EC) /* type = RRE   COMPARE (extended DFP)  */             \
-  V(eextr, EEXTR,                                                              \
-    0xB3ED) /* type = RRE   EXTRACT BIASED EXPONENT (extended DFP to 64)  */   \
-  V(esxtr, ESXTR,                                                              \
-    0xB3EF) /* type = RRE   EXTRACT SIGNIFICANCE (extended DFP to 64)  */      \
-  V(cdgtr, CDGTR,                                                              \
-    0xB3F1) /* type = RRE   CONVERT FROM FIXED (64 to long DFP)  */            \
-  V(cdutr, CDUTR,                                                              \
-    0xB3F2) /* type = RRE   CONVERT FROM UNSIGNED PACKED (64 to long DFP)  */  \
-  V(cdstr, CDSTR,                                                              \
-    0xB3F3) /* type = RRE   CONVERT FROM SIGNED PACKED (64 to long DFP)  */    \
-  V(cedtr, CEDTR,                                                              \
-    0xB3F4) /* type = RRE   COMPARE BIASED EXPONENT (long DFP)  */             \
-  V(cxgtr, CXGTR,                                                              \
-    0xB3F9) /* type = RRE   CONVERT FROM FIXED (64 to extended DFP)  */        \
-  V(cxutr, CXUTR,                                                              \
-    0xB3FA) /* type = RRE   CONVERT FROM UNSIGNED PACKED (128 to ext. DFP)  */ \
-  V(cxstr, CXSTR, 0xB3FB) /* type = RRE   CONVERT FROM SIGNED PACKED (128 to*/ \
-                          /* extended DFP)  */                                 \
-  V(cextr, CEXTR,                                                              \
-    0xB3FC) /* type = RRE   COMPARE BIASED EXPONENT (extended DFP)  */         \
-  V(lpgr, LPGR, 0xB900)   /* type = RRE   LOAD POSITIVE (64)  */               \
-  V(lngr, LNGR, 0xB901)   /* type = RRE   LOAD NEGATIVE (64)  */               \
-  V(ltgr, LTGR, 0xB902)   /* type = RRE   LOAD AND TEST (64)  */               \
-  V(lcgr, LCGR, 0xB903)   /* type = RRE   LOAD COMPLEMENT (64)  */             \
-  V(lgr, LGR, 0xB904)     /* type = RRE   LOAD (64)  */                        \
-  V(lurag, LURAG, 0xB905) /* type = RRE   LOAD USING REAL ADDRESS (64)  */     \
-  V(lgbr, LGBR, 0xB906)   /* type = RRE   LOAD BYTE (64<-8)  */                \
-  V(lghr, LGHR, 0xB907)   /* type = RRE   LOAD HALFWORD (64<-16)  */           \
-  V(agr, AGR, 0xB908)     /* type = RRE   ADD (64)  */                         \
-  V(sgr, SGR, 0xB909)     /* type = RRE   SUBTRACT (64)  */                    \
-  V(algr, ALGR, 0xB90A)   /* type = RRE   ADD LOGICAL (64)  */                 \
-  V(slgr, SLGR, 0xB90B)   /* type = RRE   SUBTRACT LOGICAL (64)  */            \
-  V(msgr, MSGR, 0xB90C)   /* type = RRE   MULTIPLY SINGLE (64)  */             \
-  V(dsgr, DSGR, 0xB90D)   /* type = RRE   DIVIDE SINGLE (64)  */               \
-  V(eregg, EREGG, 0xB90E) /* type = RRE   EXTRACT STACKED REGISTERS (64)  */   \
-  V(lrvgr, LRVGR, 0xB90F) /* type = RRE   LOAD REVERSED (64)  */               \
-  V(lpgfr, LPGFR, 0xB910) /* type = RRE   LOAD POSITIVE (64<-32)  */           \
-  V(lngfr, LNGFR, 0xB911) /* type = RRE   LOAD NEGATIVE (64<-32)  */           \
-  V(ltgfr, LTGFR, 0xB912) /* type = RRE   LOAD AND TEST (64<-32)  */           \
-  V(lcgfr, LCGFR, 0xB913) /* type = RRE   LOAD COMPLEMENT (64<-32)  */         \
-  V(lgfr, LGFR, 0xB914)   /* type = RRE   LOAD (64<-32)  */                    \
-  V(llgfr, LLGFR, 0xB916) /* type = RRE   LOAD LOGICAL (64<-32)  */            \
-  V(llgtr, LLGTR,                                                              \
-    0xB917) /* type = RRE   LOAD LOGICAL THIRTY ONE BITS (64<-31)  */          \
-  V(agfr, AGFR, 0xB918)   /* type = RRE   ADD (64<-32)  */                     \
-  V(sgfr, SGFR, 0xB919)   /* type = RRE   SUBTRACT (64<-32)  */                \
-  V(algfr, ALGFR, 0xB91A) /* type = RRE   ADD LOGICAL (64<-32)  */             \
-  V(slgfr, SLGFR, 0xB91B) /* type = RRE   SUBTRACT LOGICAL (64<-32)  */        \
-  V(msgfr, MSGFR, 0xB91C) /* type = RRE   MULTIPLY SINGLE (64<-32)  */         \
-  V(dsgfr, DSGFR, 0xB91D) /* type = RRE   DIVIDE SINGLE (64<-32)  */           \
-  V(kmac, KMAC, 0xB91E) /* type = RRE   COMPUTE MESSAGE AUTHENTICATION CODE */ \
-  V(lrvr, LRVR, 0xB91F) /* type = RRE   LOAD REVERSED (32)  */                 \
-  V(cgr, CGR, 0xB920)   /* type = RRE   COMPARE (64)  */                       \
-  V(clgr, CLGR, 0xB921) /* type = RRE   COMPARE LOGICAL (64)  */               \
-  V(sturg, STURG, 0xB925) /* type = RRE   STORE USING REAL ADDRESS (64)  */    \
-  V(lbr, LBR, 0xB926)     /* type = RRE   LOAD BYTE (32<-8)  */                \
-  V(lhr, LHR, 0xB927)     /* type = RRE   LOAD HALFWORD (32<-16)  */           \
-  V(pckmo, PCKMO,                                                              \
-    0xB928) /* type = RRE   PERFORM CRYPTOGRAPHIC KEY MGMT. OPERATIONS  */     \
-  V(kmf, KMF, 0xB92A) /* type = RRE   CIPHER MESSAGE WITH CIPHER FEEDBACK  */  \
-  V(kmo, KMO, 0xB92B) /* type = RRE   CIPHER MESSAGE WITH OUTPUT FEEDBACK  */  \
-  V(pcc, PCC, 0xB92C) /* type = RRE   PERFORM CRYPTOGRAPHIC COMPUTATION  */    \
-  V(km, KM, 0xB92E)   /* type = RRE   CIPHER MESSAGE  */                       \
-  V(kmc, KMC, 0xB92F) /* type = RRE   CIPHER MESSAGE WITH CHAINING  */         \
-  V(cgfr, CGFR, 0xB930)   /* type = RRE   COMPARE (64<-32)  */                 \
-  V(clgfr, CLGFR, 0xB931) /* type = RRE   COMPARE LOGICAL (64<-32)  */         \
-  V(ppno, PPNO,                                                                \
-    0xB93C) /* type = RRE   PERFORM PSEUDORANDOM NUMBER OPERATION  */          \
-  V(kimd, KIMD, 0xB93E) /* type = RRE   COMPUTE INTERMEDIATE MESSAGE DIGEST */ \
-  V(klmd, KLMD, 0xB93F) /* type = RRE   COMPUTE LAST MESSAGE DIGEST  */        \
-  V(bctgr, BCTGR, 0xB946) /* type = RRE   BRANCH ON COUNT (64)  */             \
-  V(cdftr, CDFTR,                                                              \
-    0xB951) /* type = RRE   CONVERT FROM FIXED (32 to long DFP)  */            \
-  V(cxftr, CXFTR,                                                              \
-    0xB959) /* type = RRE   CONVERT FROM FIXED (32 to extended DFP)  */        \
-  V(ngr, NGR, 0xB980)     /* type = RRE   AND (64)  */                         \
-  V(ogr, OGR, 0xB981)     /* type = RRE   OR (64)  */                          \
-  V(xgr, XGR, 0xB982)     /* type = RRE   EXCLUSIVE OR (64)  */                \
-  V(flogr, FLOGR, 0xB983) /* type = RRE   FIND LEFTMOST ONE  */                \
-  V(llgcr, LLGCR, 0xB984) /* type = RRE   LOAD LOGICAL CHARACTER (64<-8)  */   \
-  V(llghr, LLGHR, 0xB985) /* type = RRE   LOAD LOGICAL HALFWORD (64<-16)  */   \
-  V(mlgr, MLGR, 0xB986)   /* type = RRE   MULTIPLY LOGICAL (128<-64)  */       \
-  V(dlgr, DLGR, 0xB987)   /* type = RRE   DIVIDE LOGICAL (64<-128)  */         \
-  V(alcgr, ALCGR, 0xB988) /* type = RRE   ADD LOGICAL WITH CARRY (64)  */      \
-  V(slbgr, SLBGR, 0xB989) /* type = RRE   SUBTRACT LOGICAL WITH BORROW (64) */ \
-  V(cspg, CSPG, 0xB98A)   /* type = RRE   COMPARE AND SWAP AND PURGE (64)  */  \
-  V(epsw, EPSW, 0xB98D)   /* type = RRE   EXTRACT PSW  */                      \
-  V(llcr, LLCR, 0xB994)   /* type = RRE   LOAD LOGICAL CHARACTER (32<-8)  */   \
-  V(llhr, LLHR, 0xB995)   /* type = RRE   LOAD LOGICAL HALFWORD (32<-16)  */   \
-  V(mlr, MLR, 0xB996)     /* type = RRE   MULTIPLY LOGICAL (64<-32)  */        \
-  V(dlr, DLR, 0xB997)     /* type = RRE   DIVIDE LOGICAL (32<-64)  */          \
-  V(alcr, ALCR, 0xB998)   /* type = RRE   ADD LOGICAL WITH CARRY (32)  */      \
-  V(slbr, SLBR, 0xB999) /* type = RRE   SUBTRACT LOGICAL WITH BORROW (32)  */  \
-  V(epair, EPAIR, 0xB99A) /* type = RRE   EXTRACT PRIMARY ASN AND INSTANCE  */ \
-  V(esair, ESAIR,                                                              \
-    0xB99B)             /* type = RRE   EXTRACT SECONDARY ASN AND INSTANCE  */ \
-  V(esea, ESEA, 0xB99D) /* type = RRE   EXTRACT AND SET EXTENDED AUTHORITY  */ \
-  V(pti, PTI, 0xB99E)   /* type = RRE   PROGRAM TRANSFER WITH INSTANCE  */     \
-  V(ssair, SSAIR, 0xB99F) /* type = RRE   SET SECONDARY ASN WITH INSTANCE  */  \
-  V(ptf, PTF, 0xB9A2)     /* type = RRE   PERFORM TOPOLOGY FUNCTION  */        \
-  V(rrbm, RRBM, 0xB9AE)   /* type = RRE   RESET REFERENCE BITS MULTIPLE  */    \
-  V(pfmf, PFMF, 0xB9AF) /* type = RRE   PERFORM FRAME MANAGEMENT FUNCTION  */  \
-  V(cu41, CU41, 0xB9B2) /* type = RRE   CONVERT UTF-32 TO UTF-8  */            \
-  V(cu42, CU42, 0xB9B3) /* type = RRE   CONVERT UTF-32 TO UTF-16  */           \
-  V(srstu, SRSTU, 0xB9BE)     /* type = RRE   SEARCH STRING UNICODE  */        \
-  V(chhr, CHHR, 0xB9CD)       /* type = RRE   COMPARE HIGH (32)  */            \
-  V(clhhr, CLHHR, 0xB9CF)     /* type = RRE   COMPARE LOGICAL HIGH (32)  */    \
-  V(chlr, CHLR, 0xB9DD)       /* type = RRE   COMPARE HIGH (32)  */            \
-  V(clhlr, CLHLR, 0xB9DF)     /* type = RRE   COMPARE LOGICAL HIGH (32)  */    \
-  V(popcnt, POPCNT_Z, 0xB9E1) /* type = RRE   POPULATION COUNT  */
-
-#define S390_RIE_C_OPCODE_LIST(V)                                             \
-  V(cgij, CGIJ,                                                               \
-    0xEC7C) /* type = RIE_C COMPARE IMMEDIATE AND BRANCH RELATIVE (64<-8)  */ \
-  V(clgij, CLGIJ,                                                             \
-    0xEC7D) /* type = RIE_C COMPARE LOGICAL IMMEDIATE AND BRANCH RELATIVE  */ \
-            /* (64<-8)  */                                                    \
-  V(cij, CIJ,                                                                 \
-    0xEC7E) /* type = RIE_C COMPARE IMMEDIATE AND BRANCH RELATIVE (32<-8)  */ \
-  V(clij, CLIJ, 0xEC7F) /* type = RIE_C COMPARE LOGICAL IMMEDIATE AND      */ \
-                        /* BRANCH RELATIVE (32<-8)  */
-
-#define S390_RIE_D_OPCODE_LIST(V)                                          \
-  V(ahik, AHIK, 0xECD8)   /* type = RIE_D ADD IMMEDIATE (32<-16)  */       \
-  V(aghik, AGHIK, 0xECD9) /* type = RIE_D ADD IMMEDIATE (64<-16)  */       \
-  V(alhsik, ALHSIK,                                                        \
-    0xECDA) /* type = RIE_D ADD LOGICAL WITH SIGNED IMMEDIATE (32<-16)  */ \
-  V(alghsik, ALGHSIK,                                                      \
-    0xECDB) /* type = RIE_D ADD LOGICAL WITH SIGNED IMMEDIATE (64<-16)  */
-
-#define S390_VRV_OPCODE_LIST(V)                                           \
-  V(vgeg, VGEG, 0xE712)   /* type = VRV   VECTOR GATHER ELEMENT (64)  */  \
-  V(vgef, VGEF, 0xE713)   /* type = VRV   VECTOR GATHER ELEMENT (32)  */  \
-  V(vsceg, VSCEG, 0xE71A) /* type = VRV   VECTOR SCATTER ELEMENT (64)  */ \
-  V(vscef, VSCEF, 0xE71B) /* type = VRV   VECTOR SCATTER ELEMENT (32)  */
-
-#define S390_RIE_E_OPCODE_LIST(V)                                  \
-  V(brxhg, BRXHG,                                                  \
-    0xEC44) /* type = RIE_E BRANCH RELATIVE ON INDEX HIGH (64)  */ \
-  V(brxlg, BRXLG,                                                  \
-    0xEC45) /* type = RIE_E BRANCH RELATIVE ON INDEX LOW OR EQ. (64)  */
-
-#define S390_RR_OPCODE_LIST(V)                                                 \
-  V(spm, SPM, 0x04)     /* type = RR    SET PROGRAM MASK  */                   \
-  V(balr, BALR, 0x05)   /* type = RR    BRANCH AND LINK  */                    \
-  V(bctr, BCTR, 0x06)   /* type = RR    BRANCH ON COUNT (32)  */               \
-  V(bcr, BCR, 0x07)     /* type = RR    BRANCH ON CONDITION  */                \
-  V(bsm, BSM, 0x0B)     /* type = RR    BRANCH AND SET MODE  */                \
-  V(bassm, BASSM, 0x0C) /* type = RR    BRANCH AND SAVE AND SET MODE  */       \
-  V(basr, BASR, 0x0D)   /* type = RR    BRANCH AND SAVE  */                    \
-  V(mvcl, MVCL, 0x0E)   /* type = RR    MOVE LONG  */                          \
-  V(clcl, CLCL, 0x0F)   /* type = RR    COMPARE LOGICAL LONG  */               \
-  V(lpr, LPR, 0x10)     /* type = RR    LOAD POSITIVE (32)  */                 \
-  V(lnr, LNR, 0x11)     /* type = RR    LOAD NEGATIVE (32)  */                 \
-  V(ltr, LTR, 0x12)     /* type = RR    LOAD AND TEST (32)  */                 \
-  V(lcr, LCR, 0x13)     /* type = RR    LOAD COMPLEMENT (32)  */               \
-  V(nr, NR, 0x14)       /* type = RR    AND (32)  */                           \
-  V(clr, CLR, 0x15)     /* type = RR    COMPARE LOGICAL (32)  */               \
-  V(or_z, OR, 0x16)     /* type = RR    OR (32)  */                            \
-  V(xr, XR, 0x17)       /* type = RR    EXCLUSIVE OR (32)  */                  \
-  V(lr, LR, 0x18)       /* type = RR    LOAD (32)  */                          \
-  V(cr_z, CR, 0x19)     /* type = RR    COMPARE (32)  */                       \
-  V(ar, AR, 0x1A)       /* type = RR    ADD (32)  */                           \
-  V(sr, SR, 0x1B)       /* type = RR    SUBTRACT (32)  */                      \
-  V(mr_z, MR, 0x1C)     /* type = RR    MULTIPLY (64<-32)  */                  \
-  V(dr, DR, 0x1D)       /* type = RR    DIVIDE (32<-64)  */                    \
-  V(alr, ALR, 0x1E)     /* type = RR    ADD LOGICAL (32)  */                   \
-  V(slr, SLR, 0x1F)     /* type = RR    SUBTRACT LOGICAL (32)  */              \
-  V(lpdr, LPDR, 0x20)   /* type = RR    LOAD POSITIVE (long HFP)  */           \
-  V(lndr, LNDR, 0x21)   /* type = RR    LOAD NEGATIVE (long HFP)  */           \
-  V(ltdr, LTDR, 0x22)   /* type = RR    LOAD AND TEST (long HFP)  */           \
-  V(lcdr, LCDR, 0x23)   /* type = RR    LOAD COMPLEMENT (long HFP)  */         \
-  V(hdr, HDR, 0x24)     /* type = RR    HALVE (long HFP)  */                   \
-  V(ldxr, LDXR, 0x25) /* type = RR    LOAD ROUNDED (extended to long HFP)  */  \
-  V(lrdr, LRDR, 0x25) /* type = RR    LOAD ROUNDED (extended to long HFP)  */  \
-  V(mxr, MXR, 0x26)   /* type = RR    MULTIPLY (extended HFP)  */              \
-  V(mxdr, MXDR, 0x27) /* type = RR    MULTIPLY (long to extended HFP)  */      \
-  V(ldr, LDR, 0x28)   /* type = RR    LOAD (long)  */                          \
-  V(cdr, CDR, 0x29)   /* type = RR    COMPARE (long HFP)  */                   \
-  V(adr, ADR, 0x2A)   /* type = RR    ADD NORMALIZED (long HFP)  */            \
-  V(sdr, SDR, 0x2B)   /* type = RR    SUBTRACT NORMALIZED (long HFP)  */       \
-  V(mdr, MDR, 0x2C)   /* type = RR    MULTIPLY (long HFP)  */                  \
-  V(ddr, DDR, 0x2D)   /* type = RR    DIVIDE (long HFP)  */                    \
-  V(swr, SWR, 0x2F)   /* type = RR    SUBTRACT UNNORMALIZED (long HFP)  */     \
-  V(lper, LPER, 0x30) /* type = RR    LOAD POSITIVE (short HFP)  */            \
-  V(lner, LNER, 0x31) /* type = RR    LOAD NEGATIVE (short HFP)  */            \
-  V(lter, LTER, 0x32) /* type = RR    LOAD AND TEST (short HFP)  */            \
-  V(lcer, LCER, 0x33) /* type = RR    LOAD COMPLEMENT (short HFP)  */          \
-  V(her_z, HER_Z, 0x34) /* type = RR    HALVE (short HFP)  */                  \
-  V(ledr, LEDR, 0x35)   /* type = RR    LOAD ROUNDED (long to short HFP)  */   \
-  V(lrer, LRER, 0x35)   /* type = RR    LOAD ROUNDED (long to short HFP)  */   \
-  V(axr, AXR, 0x36)     /* type = RR    ADD NORMALIZED (extended HFP)  */      \
-  V(sxr, SXR, 0x37)     /* type = RR    SUBTRACT NORMALIZED (extended HFP)  */ \
-  V(ler, LER, 0x38)     /* type = RR    LOAD (short)  */                       \
-  V(cer, CER, 0x39)     /* type = RR    COMPARE (short HFP)  */                \
-  V(aer, AER, 0x3A)     /* type = RR    ADD NORMALIZED (short HFP)  */         \
-  V(ser, SER, 0x3B)     /* type = RR    SUBTRACT NORMALIZED (short HFP)  */    \
-  V(mder, MDER, 0x3C)   /* type = RR    MULTIPLY (short to long HFP)  */       \
-  V(mer, MER, 0x3C)     /* type = RR    MULTIPLY (short to long HFP)  */       \
-  V(der, DER, 0x3D)     /* type = RR    DIVIDE (short HFP)  */                 \
-  V(aur, AUR, 0x3E)     /* type = RR    ADD UNNORMALIZED (short HFP)  */       \
-  V(sur, SUR, 0x3F)     /* type = RR    SUBTRACT UNNORMALIZED (short HFP)  */
-
-#define S390_RIE_F_OPCODE_LIST(V)                                              \
-  V(risblg, RISBLG,                                                            \
-    0xEC51) /* type = RIE_F ROTATE THEN INSERT SELECTED BITS LOW (64)  */      \
-  V(rnsbg, RNSBG,                                                              \
-    0xEC54) /* type = RIE_F ROTATE THEN AND SELECTED BITS (64)  */             \
-  V(risbg, RISBG,                                                              \
-    0xEC55) /* type = RIE_F ROTATE THEN INSERT SELECTED BITS (64)  */          \
-  V(rosbg, ROSBG, 0xEC56) /* type = RIE_F ROTATE THEN OR SELECTED BITS (64) */ \
-  V(rxsbg, RXSBG,                                                              \
-    0xEC57) /* type = RIE_F ROTATE THEN EXCLUSIVE OR SELECT. BITS (64)  */     \
-  V(risbgn, RISBGN,                                                            \
-    0xEC59) /* type = RIE_F ROTATE THEN INSERT SELECTED BITS (64)  */          \
-  V(risbhg, RISBHG,                                                            \
-    0xEC5D) /* type = RIE_F ROTATE THEN INSERT SELECTED BITS HIGH (64)  */
-
-#define S390_VRX_OPCODE_LIST(V)                                             \
-  V(vleb, VLEB, 0xE700) /* type = VRX   VECTOR LOAD ELEMENT (8)  */         \
-  V(vleh, VLEH, 0xE701) /* type = VRX   VECTOR LOAD ELEMENT (16)  */        \
-  V(vleg, VLEG, 0xE702) /* type = VRX   VECTOR LOAD ELEMENT (64)  */        \
-  V(vlef, VLEF, 0xE703) /* type = VRX   VECTOR LOAD ELEMENT (32)  */        \
-  V(vllez, VLLEZ,                                                           \
-    0xE704) /* type = VRX   VECTOR LOAD LOGICAL ELEMENT AND ZERO  */        \
-  V(vlrep, VLREP, 0xE705) /* type = VRX   VECTOR LOAD AND REPLICATE  */     \
-  V(vl, VL, 0xE706)       /* type = VRX   VECTOR LOAD  */                   \
-  V(vlbb, VLBB, 0xE707)   /* type = VRX   VECTOR LOAD TO BLOCK BOUNDARY  */ \
-  V(vsteb, VSTEB, 0xE708) /* type = VRX   VECTOR STORE ELEMENT (8)  */      \
-  V(vsteh, VSTEH, 0xE709) /* type = VRX   VECTOR STORE ELEMENT (16)  */     \
-  V(vsteg, VSTEG, 0xE70A) /* type = VRX   VECTOR STORE ELEMENT (64)  */     \
-  V(vstef, VSTEF, 0xE70B) /* type = VRX   VECTOR STORE ELEMENT (32)  */     \
-  V(vst, VST, 0xE70E)     /* type = VRX   VECTOR STORE  */
-
-#define S390_RIE_G_OPCODE_LIST(V)                                             \
-  V(lochi, LOCHI,                                                             \
-    0xEC42) /* type = RIE_G LOAD HALFWORD IMMEDIATE ON CONDITION (32<-16)  */ \
-  V(locghi, LOCGHI,                                                           \
-    0xEC46) /* type = RIE_G LOAD HALFWORD IMMEDIATE ON CONDITION (64<-16)  */ \
-  V(lochhi, LOCHHI, 0xEC4E) /* type = RIE_G LOAD HALFWORD HIGH IMMEDIATE   */ \
-                            /* ON CONDITION (32<-16)  */
-
-#define S390_RRS_OPCODE_LIST(V)                                               \
-  V(cgrb, CGRB, 0xECE4)   /* type = RRS   COMPARE AND BRANCH (64)  */         \
-  V(clgrb, CLGRB, 0xECE5) /* type = RRS   COMPARE LOGICAL AND BRANCH (64)  */ \
-  V(crb, CRB, 0xECF6)     /* type = RRS   COMPARE AND BRANCH (32)  */         \
-  V(clrb, CLRB, 0xECF7)   /* type = RRS   COMPARE LOGICAL AND BRANCH (32)  */
-
-#define S390_OPCODE_LIST(V) \
-  S390_RSY_A_OPCODE_LIST(V) \
-  S390_RSY_B_OPCODE_LIST(V) \
-  S390_RXE_OPCODE_LIST(V)   \
-  S390_RRF_A_OPCODE_LIST(V) \
-  S390_RXF_OPCODE_LIST(V)   \
-  S390_IE_OPCODE_LIST(V)    \
-  S390_RRF_B_OPCODE_LIST(V) \
-  S390_RRF_C_OPCODE_LIST(V) \
-  S390_MII_OPCODE_LIST(V)   \
-  S390_RRF_D_OPCODE_LIST(V) \
-  S390_RRF_E_OPCODE_LIST(V) \
-  S390_VRR_A_OPCODE_LIST(V) \
-  S390_VRR_B_OPCODE_LIST(V) \
-  S390_VRR_C_OPCODE_LIST(V) \
-  S390_VRI_A_OPCODE_LIST(V) \
-  S390_VRR_D_OPCODE_LIST(V) \
-  S390_VRI_B_OPCODE_LIST(V) \
-  S390_VRR_E_OPCODE_LIST(V) \
-  S390_VRI_C_OPCODE_LIST(V) \
-  S390_VRI_D_OPCODE_LIST(V) \
-  S390_VRR_F_OPCODE_LIST(V) \
-  S390_RIS_OPCODE_LIST(V)   \
-  S390_VRI_E_OPCODE_LIST(V) \
-  S390_RSL_A_OPCODE_LIST(V) \
-  S390_RSL_B_OPCODE_LIST(V) \
-  S390_SI_OPCODE_LIST(V)    \
-  S390_SIL_OPCODE_LIST(V)   \
-  S390_VRS_A_OPCODE_LIST(V) \
-  S390_RIL_A_OPCODE_LIST(V) \
-  S390_RIL_B_OPCODE_LIST(V) \
-  S390_VRS_B_OPCODE_LIST(V) \
-  S390_RIL_C_OPCODE_LIST(V) \
-  S390_VRS_C_OPCODE_LIST(V) \
-  S390_RI_A_OPCODE_LIST(V)  \
-  S390_RSI_OPCODE_LIST(V)   \
-  S390_RI_B_OPCODE_LIST(V)  \
-  S390_RI_C_OPCODE_LIST(V)  \
-  S390_RSL_OPCODE_LIST(V)   \
-  S390_SMI_OPCODE_LIST(V)   \
-  S390_RXY_A_OPCODE_LIST(V) \
-  S390_RXY_B_OPCODE_LIST(V) \
-  S390_SIY_OPCODE_LIST(V)   \
-  S390_SS_A_OPCODE_LIST(V)  \
-  S390_E_OPCODE_LIST(V)     \
-  S390_SS_B_OPCODE_LIST(V)  \
-  S390_SS_C_OPCODE_LIST(V)  \
-  S390_SS_D_OPCODE_LIST(V)  \
-  S390_SS_E_OPCODE_LIST(V)  \
-  S390_I_OPCODE_LIST(V)     \
-  S390_SS_F_OPCODE_LIST(V)  \
-  S390_SSE_OPCODE_LIST(V)   \
-  S390_SSF_OPCODE_LIST(V)   \
-  S390_RS_A_OPCODE_LIST(V)  \
-  S390_RS_B_OPCODE_LIST(V)  \
-  S390_S_OPCODE_LIST(V)     \
-  S390_RX_A_OPCODE_LIST(V)  \
-  S390_RX_B_OPCODE_LIST(V)  \
-  S390_RIE_A_OPCODE_LIST(V) \
-  S390_RRD_OPCODE_LIST(V)   \
-  S390_RIE_B_OPCODE_LIST(V) \
-  S390_RRE_OPCODE_LIST(V)   \
-  S390_RIE_C_OPCODE_LIST(V) \
-  S390_RIE_D_OPCODE_LIST(V) \
-  S390_VRV_OPCODE_LIST(V)   \
-  S390_RIE_E_OPCODE_LIST(V) \
-  S390_RR_OPCODE_LIST(V)    \
-  S390_RIE_F_OPCODE_LIST(V) \
-  S390_VRX_OPCODE_LIST(V)   \
-  S390_RIE_G_OPCODE_LIST(V) \
-  S390_RRS_OPCODE_LIST(V)
-
-// Opcodes as defined in Appendix B-2 table
-enum Opcode {
-#define DECLARE_OPCODES(name, opcode_name, opcode_value) \
-  opcode_name = opcode_value,
-  S390_OPCODE_LIST(DECLARE_OPCODES)
-#undef DECLARE_OPCODES
-
-      BKPT = 0x0001,  // GDB Software Breakpoint
-  DUMY = 0xE352       // Special dummy opcode
-};
-
-// Instruction encoding bits and masks.
-enum {
-  // Instruction encoding bit
-  B1 = 1 << 1,
-  B4 = 1 << 4,
-  B5 = 1 << 5,
-  B7 = 1 << 7,
-  B8 = 1 << 8,
-  B9 = 1 << 9,
-  B12 = 1 << 12,
-  B18 = 1 << 18,
-  B19 = 1 << 19,
-  B20 = 1 << 20,
-  B22 = 1 << 22,
-  B23 = 1 << 23,
-  B24 = 1 << 24,
-  B25 = 1 << 25,
-  B26 = 1 << 26,
-  B27 = 1 << 27,
-  B28 = 1 << 28,
-
-  B6 = 1 << 6,
-  B10 = 1 << 10,
-  B11 = 1 << 11,
-  B16 = 1 << 16,
-  B17 = 1 << 17,
-  B21 = 1 << 21,
-
-  // Instruction bit masks
-  kCondMask = 0x1F << 21,
-  kOff12Mask = (1 << 12) - 1,
-  kImm24Mask = (1 << 24) - 1,
-  kOff16Mask = (1 << 16) - 1,
-  kImm16Mask = (1 << 16) - 1,
-  kImm26Mask = (1 << 26) - 1,
-  kBOfieldMask = 0x1f << 21,
-  kOpcodeMask = 0x3f << 26,
-  kExt2OpcodeMask = 0x1f << 1,
-  kExt5OpcodeMask = 0x3 << 2,
-  kBIMask = 0x1F << 16,
-  kBDMask = 0x14 << 2,
-  kAAMask = 0x01 << 1,
-  kLKMask = 0x01,
-  kRCMask = 0x01,
-  kTOMask = 0x1f << 21
-};
-
-// S390 instructions requires bigger shifts,
-// make them macros instead of enum because of the typing issue
-#define B32 ((uint64_t)1 << 32)
-#define B36 ((uint64_t)1 << 36)
-#define B40 ((uint64_t)1 << 40)
-const FourByteInstr kFourByteBrCondMask = 0xF << 20;
-const SixByteInstr kSixByteBrCondMask = static_cast<SixByteInstr>(0xF) << 36;
-
-// -----------------------------------------------------------------------------
-// Addressing modes and instruction variants.
-
-// Overflow Exception
-enum OEBit {
-  SetOE = 1 << 10,   // Set overflow exception
-  LeaveOE = 0 << 10  // No overflow exception
-};
-
-// Record bit
-enum RCBit {   // Bit 0
-  SetRC = 1,   // LT,GT,EQ,SO
-  LeaveRC = 0  // None
-};
-
-// Link bit
-enum LKBit {   // Bit 0
-  SetLK = 1,   // Load effective address of next instruction
-  LeaveLK = 0  // No action
-};
-
-enum BOfield {        // Bits 25-21
-  DCBNZF = 0 << 21,   // Decrement CTR; branch if CTR != 0 and condition false
-  DCBEZF = 2 << 21,   // Decrement CTR; branch if CTR == 0 and condition false
-  BF = 4 << 21,       // Branch if condition false
-  DCBNZT = 8 << 21,   // Decrement CTR; branch if CTR != 0 and condition true
-  DCBEZT = 10 << 21,  // Decrement CTR; branch if CTR == 0 and condition true
-  BT = 12 << 21,      // Branch if condition true
-  DCBNZ = 16 << 21,   // Decrement CTR; branch if CTR != 0
-  DCBEZ = 18 << 21,   // Decrement CTR; branch if CTR == 0
-  BA = 20 << 21       // Branch always
-};
-
-#ifdef _AIX
-#undef CR_LT
-#undef CR_GT
-#undef CR_EQ
-#undef CR_SO
-#endif
-
-enum CRBit { CR_LT = 0, CR_GT = 1, CR_EQ = 2, CR_SO = 3, CR_FU = 3 };
-
-#define CRWIDTH 4
-
-// -----------------------------------------------------------------------------
-// Supervisor Call (svc) specific support.
-
-// Special Software Interrupt codes when used in the presence of the S390
-// simulator.
-// SVC provides a 24bit immediate value. Use bits 22:0 for standard
-// SoftwareInterrupCode. Bit 23 is reserved for the stop feature.
-enum SoftwareInterruptCodes {
-  // Transition to C code
-  kCallRtRedirected = 0x0010,
-  // Breakpoint
-  kBreakpoint = 0x0000,
-  // Stop
-  kStopCode = 1 << 23
-};
-const uint32_t kStopCodeMask = kStopCode - 1;
-const uint32_t kMaxStopCode = kStopCode - 1;
-const int32_t kDefaultStopCode = -1;
-
-// FP rounding modes.
-enum FPRoundingMode {
-  RN = 0,  // Round to Nearest.
-  RZ = 1,  // Round towards zero.
-  RP = 2,  // Round towards Plus Infinity.
-  RM = 3,  // Round towards Minus Infinity.
-
-  // Aliases.
-  kRoundToNearest = RN,
-  kRoundToZero = RZ,
-  kRoundToPlusInf = RP,
-  kRoundToMinusInf = RM
-};
-
-const uint32_t kFPRoundingModeMask = 3;
-
-enum CheckForInexactConversion {
-  kCheckForInexactConversion,
-  kDontCheckForInexactConversion
-};
-
-// -----------------------------------------------------------------------------
-// Specific instructions, constants, and masks.
-
-// use TRAP4 to indicate redirection call for simulation mode
-const Instr rtCallRedirInstr = TRAP4;
-
-// -----------------------------------------------------------------------------
-// Instruction abstraction.
-
-// The class Instruction enables access to individual fields defined in the
-// z/Architecture instruction set encoding.
-class Instruction {
- public:
-  // S390 Opcode Format Types
-  //   Based on the first byte of the opcode, we can determine how to extract
-  //   the entire opcode of the instruction.  The various favours include:
-  enum OpcodeFormatType {
-    ONE_BYTE_OPCODE,           // One Byte - Bits 0 to 7
-    TWO_BYTE_OPCODE,           // Two Bytes - Bits 0 to 15
-    TWO_BYTE_DISJOINT_OPCODE,  // Two Bytes - Bits 0 to 7, 40 to 47
-    THREE_NIBBLE_OPCODE        // Three Nibbles - Bits 0 to 7, 12 to 15
-  };
-
-  static OpcodeFormatType OpcodeFormatTable[256];
-// Helper macro to define static accessors.
-// We use the cast to char* trick to bypass the strict anti-aliasing rules.
-#define DECLARE_STATIC_TYPED_ACCESSOR(return_type, Name) \
-  static inline return_type Name(Instr instr) {          \
-    char* temp = reinterpret_cast<char*>(&instr);        \
-    return reinterpret_cast<Instruction*>(temp)->Name(); \
-  }
-
-#define DECLARE_STATIC_ACCESSOR(Name) DECLARE_STATIC_TYPED_ACCESSOR(int, Name)
-
-  // Get the raw instruction bits.
-  template <typename T>
-  inline T InstructionBits() const {
-    return Instruction::InstructionBits<T>(reinterpret_cast<const byte*>(this));
-  }
-  inline Instr InstructionBits() const {
-    return *reinterpret_cast<const Instr*>(this);
-  }
-
-  // Set the raw instruction bits to value.
-  template <typename T>
-  inline void SetInstructionBits(T value) const {
-    Instruction::SetInstructionBits<T>(reinterpret_cast<const byte*>(this),
-                                       value);
-  }
-  inline void SetInstructionBits(Instr value) {
-    *reinterpret_cast<Instr*>(this) = value;
-  }
-
-  // Read one particular bit out of the instruction bits.
-  inline int Bit(int nr) const { return (InstructionBits() >> nr) & 1; }
-
-  // Read a bit field's value out of the instruction bits.
-  inline int Bits(int hi, int lo) const {
-    return (InstructionBits() >> lo) & ((2 << (hi - lo)) - 1);
-  }
-
-  // Read bits according to instruction type
-  template <typename T, typename U>
-  inline U Bits(int hi, int lo) const {
-    return (InstructionBits<T>() >> lo) & ((2 << (hi - lo)) - 1);
-  }
-
-  // Read a bit field out of the instruction bits.
-  inline int BitField(int hi, int lo) const {
-    return InstructionBits() & (((2 << (hi - lo)) - 1) << lo);
-  }
-
-  // Determine the instruction length
-  inline int InstructionLength() {
-    return Instruction::InstructionLength(reinterpret_cast<const byte*>(this));
-  }
-  // Extract the Instruction Opcode
-  inline Opcode S390OpcodeValue() {
-    return Instruction::S390OpcodeValue(reinterpret_cast<const byte*>(this));
-  }
-
-  // Static support.
-
-  // Read one particular bit out of the instruction bits.
-  static inline int Bit(Instr instr, int nr) { return (instr >> nr) & 1; }
-
-  // Read the value of a bit field out of the instruction bits.
-  static inline int Bits(Instr instr, int hi, int lo) {
-    return (instr >> lo) & ((2 << (hi - lo)) - 1);
-  }
-
-  // Read a bit field out of the instruction bits.
-  static inline int BitField(Instr instr, int hi, int lo) {
-    return instr & (((2 << (hi - lo)) - 1) << lo);
-  }
-
-  // Determine the instruction length of the given instruction
-  static inline int InstructionLength(const byte* instr) {
-    // Length can be determined by the first nibble.
-    // 0x0 to 0x3 => 2-bytes
-    // 0x4 to 0xB => 4-bytes
-    // 0xC to 0xF => 6-bytes
-    byte topNibble = (*instr >> 4) & 0xF;
-    if (topNibble <= 3)
-      return 2;
-    else if (topNibble <= 0xB)
-      return 4;
-    return 6;
-  }
-
-  // Returns the instruction bits of the given instruction
-  static inline uint64_t InstructionBits(const byte* instr) {
-    int length = InstructionLength(instr);
-    if (2 == length)
-      return static_cast<uint64_t>(InstructionBits<TwoByteInstr>(instr));
-    else if (4 == length)
-      return static_cast<uint64_t>(InstructionBits<FourByteInstr>(instr));
-    else
-      return InstructionBits<SixByteInstr>(instr);
-  }
-
-  // Extract the raw instruction bits
-  template <typename T>
-  static inline T InstructionBits(const byte* instr) {
-#if !V8_TARGET_LITTLE_ENDIAN
-    if (sizeof(T) <= 4) {
-      return *reinterpret_cast<const T*>(instr);
-    } else {
-      // We cannot read 8-byte instructon address directly, because for a
-      // six-byte instruction, the extra 2-byte address might not be
-      // allocated.
-      uint64_t fourBytes = *reinterpret_cast<const uint32_t*>(instr);
-      uint16_t twoBytes = *reinterpret_cast<const uint16_t*>(instr + 4);
-      return (fourBytes << 16 | twoBytes);
-    }
-#else
-    // Even on little endian hosts (simulation), the instructions
-    // are stored as big-endian in order to decode the opcode and
-    // instruction length.
-    T instr_bits = 0;
-
-    // 6-byte instrs are represented by uint64_t
-    uint32_t size = (sizeof(T) == 8) ? 6 : sizeof(T);
-
-    for (T i = 0; i < size; i++) {
-      instr_bits <<= 8;
-      instr_bits |= *(instr + i);
-    }
-    return instr_bits;
-#endif
-  }
-
-  // Set the Instruction Bits to value
-  template <typename T>
-  static inline void SetInstructionBits(byte* instr, T value) {
-#if V8_TARGET_LITTLE_ENDIAN
-    // The instruction bits are stored in big endian format even on little
-    // endian hosts, in order to decode instruction length and opcode.
-    // The following code will reverse the bytes so that the stores later
-    // (which are in native endianess) will effectively save the instruction
-    // in big endian.
-    if (sizeof(T) == 2) {
-      // Two Byte Instruction
-      value = ((value & 0x00FF) << 8) | ((value & 0xFF00) >> 8);
-    } else if (sizeof(T) == 4) {
-      // Four Byte Instruction
-      value = ((value & 0x000000FF) << 24) | ((value & 0x0000FF00) << 8) |
-              ((value & 0x00FF0000) >> 8) | ((value & 0xFF000000) >> 24);
-    } else if (sizeof(T) == 8) {
-      // Six Byte Instruction
-      uint64_t orig_value = static_cast<uint64_t>(value);
-      value = (static_cast<uint64_t>(orig_value & 0xFF) << 40) |
-              (static_cast<uint64_t>((orig_value >> 8) & 0xFF) << 32) |
-              (static_cast<uint64_t>((orig_value >> 16) & 0xFF) << 24) |
-              (static_cast<uint64_t>((orig_value >> 24) & 0xFF) << 16) |
-              (static_cast<uint64_t>((orig_value >> 32) & 0xFF) << 8) |
-              (static_cast<uint64_t>((orig_value >> 40) & 0xFF));
-    }
-#endif
-    if (sizeof(T) <= 4) {
-      *reinterpret_cast<T*>(instr) = value;
-    } else {
-#if V8_TARGET_LITTLE_ENDIAN
-      uint64_t orig_value = static_cast<uint64_t>(value);
-      *reinterpret_cast<uint32_t*>(instr) = static_cast<uint32_t>(value);
-      *reinterpret_cast<uint16_t*>(instr + 4) =
-          static_cast<uint16_t>((orig_value >> 32) & 0xFFFF);
-#else
-      *reinterpret_cast<uint32_t*>(instr) = static_cast<uint32_t>(value >> 16);
-      *reinterpret_cast<uint16_t*>(instr + 4) =
-          static_cast<uint16_t>(value & 0xFFFF);
-#endif
-    }
-  }
-
-  // Get Instruction Format Type
-  static OpcodeFormatType getOpcodeFormatType(const byte* instr) {
-    const byte firstByte = *instr;
-    return OpcodeFormatTable[firstByte];
-  }
-
-  // Extract the full opcode from the instruction.
-  static inline Opcode S390OpcodeValue(const byte* instr) {
-    OpcodeFormatType opcodeType = getOpcodeFormatType(instr);
-
-    // The native instructions are encoded in big-endian format
-    // even if running on little-endian host.  Hence, we need
-    // to ensure we use byte* based bit-wise logic.
-    switch (opcodeType) {
-      case ONE_BYTE_OPCODE:
-        // One Byte - Bits 0 to 7
-        return static_cast<Opcode>(*instr);
-      case TWO_BYTE_OPCODE:
-        // Two Bytes - Bits 0 to 15
-        return static_cast<Opcode>((*instr << 8) | (*(instr + 1)));
-      case TWO_BYTE_DISJOINT_OPCODE:
-        // Two Bytes - Bits 0 to 7, 40 to 47
-        return static_cast<Opcode>((*instr << 8) | (*(instr + 5) & 0xFF));
-      default:
-        // case THREE_NIBBLE_OPCODE:
-        // Three Nibbles - Bits 0 to 7, 12 to 15
-        return static_cast<Opcode>((*instr << 4) | (*(instr + 1) & 0xF));
-    }
-
-    UNREACHABLE();
-  }
-
-  // Fields used in Software interrupt instructions
-  inline SoftwareInterruptCodes SvcValue() const {
-    return static_cast<SoftwareInterruptCodes>(Bits<FourByteInstr, int>(15, 0));
-  }
-
-  // Instructions are read of out a code stream. The only way to get a
-  // reference to an instruction is to convert a pointer. There is no way
-  // to allocate or create instances of class Instruction.
-  // Use the At(pc) function to create references to Instruction.
-  static Instruction* At(byte* pc) {
-    return reinterpret_cast<Instruction*>(pc);
-  }
-
- private:
-  // We need to prevent the creation of instances of class Instruction.
-  DISALLOW_IMPLICIT_CONSTRUCTORS(Instruction);
-};
-
-#define DECLARE_FIELD_FOR_TWO_BYTE_INSTR(name, T, lo, hi)   \
-  inline int name() const {                                 \
-    return Bits<TwoByteInstr, T>(15 - (lo), 15 - (hi) + 1); \
-  }
-
-#define DECLARE_FIELD_FOR_FOUR_BYTE_INSTR(name, T, lo, hi)   \
-  inline int name() const {                                  \
-    return Bits<FourByteInstr, T>(31 - (lo), 31 - (hi) + 1); \
-  }
-
-#define DECLARE_FIELD_FOR_SIX_BYTE_INSTR(name, T, lo, hi)   \
-  inline int name() const {                                 \
-    return Bits<SixByteInstr, T>(47 - (lo), 47 - (hi) + 1); \
-  }
-
-class TwoByteInstruction : public Instruction {
- public:
-  inline int size() const { return 2; }
-};
-
-class FourByteInstruction : public Instruction {
- public:
-  inline int size() const { return 4; }
-};
-
-class SixByteInstruction : public Instruction {
- public:
-  inline int size() const { return 6; }
-};
-
-// I Instruction
-class IInstruction : public TwoByteInstruction {
- public:
-  DECLARE_FIELD_FOR_TWO_BYTE_INSTR(IValue, int, 8, 16);
-};
-
-// E Instruction
-class EInstruction : public TwoByteInstruction {};
-
-// IE Instruction
-class IEInstruction : public FourByteInstruction {
- public:
-  DECLARE_FIELD_FOR_FOUR_BYTE_INSTR(I1Value, int, 24, 28);
-  DECLARE_FIELD_FOR_FOUR_BYTE_INSTR(I2Value, int, 28, 32);
-};
-
-// MII Instruction
-class MIIInstruction : public SixByteInstruction {
- public:
-  DECLARE_FIELD_FOR_SIX_BYTE_INSTR(M1Value, uint32_t, 8, 12);
-  DECLARE_FIELD_FOR_SIX_BYTE_INSTR(RI2Value, int, 12, 24);
-  DECLARE_FIELD_FOR_SIX_BYTE_INSTR(RI3Value, int, 24, 47);
-};
-
-// RI Instruction
-class RIInstruction : public FourByteInstruction {
- public:
-  DECLARE_FIELD_FOR_FOUR_BYTE_INSTR(R1Value, int, 8, 12);
-  DECLARE_FIELD_FOR_FOUR_BYTE_INSTR(I2Value, int, 16, 32);
-  DECLARE_FIELD_FOR_FOUR_BYTE_INSTR(I2UnsignedValue, uint32_t, 16, 32);
-  DECLARE_FIELD_FOR_FOUR_BYTE_INSTR(M1Value, uint32_t, 8, 12);
-};
-
-// RR Instruction
-class RRInstruction : Instruction {
- public:
-  inline int R1Value() const {
-    // the high and low parameters of Bits is the number of bits from
-    // rightmost place
-    return Bits<TwoByteInstr, int>(7, 4);
-  }
-  inline int R2Value() const { return Bits<TwoByteInstr, int>(3, 0); }
-  inline Condition M1Value() const {
-    return static_cast<Condition>(Bits<TwoByteInstr, int>(7, 4));
-  }
-
-  inline int size() const { return 2; }
-};
-
-// RRE Instruction
-class RREInstruction : Instruction {
- public:
-  inline int R1Value() const { return Bits<FourByteInstr, int>(7, 4); }
-  inline int R2Value() const { return Bits<FourByteInstr, int>(3, 0); }
-  inline int M3Value() const { return Bits<FourByteInstr, int>(15, 12); }
-  inline int M4Value() const { return Bits<FourByteInstr, int>(19, 16); }
-  inline int size() const { return 4; }
-};
-
-// RRF Instruction
-class RRFInstruction : Instruction {
- public:
-  inline int R1Value() const { return Bits<FourByteInstr, int>(7, 4); }
-  inline int R2Value() const { return Bits<FourByteInstr, int>(3, 0); }
-  inline int R3Value() const { return Bits<FourByteInstr, int>(15, 12); }
-  inline int M3Value() const { return Bits<FourByteInstr, int>(15, 12); }
-  inline int M4Value() const { return Bits<FourByteInstr, int>(11, 8); }
-  inline int size() const { return 4; }
-};
-
-// RRD Isntruction
-class RRDInstruction : Instruction {
- public:
-  inline int R1Value() const { return Bits<FourByteInstr, int>(15, 12); }
-  inline int R2Value() const { return Bits<FourByteInstr, int>(3, 0); }
-  inline int R3Value() const { return Bits<FourByteInstr, int>(7, 4); }
-  inline int size() const { return 4; }
-};
-
-// RS Instruction
-class RSInstruction : Instruction {
- public:
-  inline int R1Value() const { return Bits<FourByteInstr, int>(23, 20); }
-  inline int R3Value() const { return Bits<FourByteInstr, int>(19, 16); }
-  inline int B2Value() const { return Bits<FourByteInstr, int>(15, 12); }
-  inline unsigned int D2Value() const {
-    return Bits<FourByteInstr, unsigned int>(11, 0);
-  }
-  inline int size() const { return 4; }
-};
-
-// RSY Instruction
-class RSYInstruction : Instruction {
- public:
-  inline int R1Value() const { return Bits<SixByteInstr, int>(39, 36); }
-  inline int R3Value() const { return Bits<SixByteInstr, int>(35, 32); }
-  inline int B2Value() const { return Bits<SixByteInstr, int>(31, 28); }
-  inline int32_t D2Value() const {
-    int32_t value = Bits<SixByteInstr, int32_t>(27, 16);
-    value += Bits<SixByteInstr, int8_t>(15, 8) << 12;
-    return value;
-  }
-  inline int size() const { return 6; }
-};
-
-// RX Instruction
-class RXInstruction : Instruction {
- public:
-  inline int R1Value() const { return Bits<FourByteInstr, int>(23, 20); }
-  inline int X2Value() const { return Bits<FourByteInstr, int>(19, 16); }
-  inline int B2Value() const { return Bits<FourByteInstr, int>(15, 12); }
-  inline uint32_t D2Value() const {
-    return Bits<FourByteInstr, uint32_t>(11, 0);
-  }
-  inline int size() const { return 4; }
-};
-
-// RXY Instruction
-class RXYInstruction : Instruction {
- public:
-  inline int R1Value() const { return Bits<SixByteInstr, int>(39, 36); }
-  inline int X2Value() const { return Bits<SixByteInstr, int>(35, 32); }
-  inline int B2Value() const { return Bits<SixByteInstr, int>(31, 28); }
-  inline int32_t D2Value() const {
-    int32_t value = Bits<SixByteInstr, uint32_t>(27, 16);
-    value += Bits<SixByteInstr, int8_t>(15, 8) << 12;
-    return value;
-  }
-  inline int size() const { return 6; }
-};
-
-// RIL Instruction
-class RILInstruction : Instruction {
- public:
-  inline int R1Value() const { return Bits<SixByteInstr, int>(39, 36); }
-  inline int32_t I2Value() const { return Bits<SixByteInstr, int32_t>(31, 0); }
-  inline uint32_t I2UnsignedValue() const {
-    return Bits<SixByteInstr, uint32_t>(31, 0);
-  }
-  inline int size() const { return 6; }
-};
-
-// SI Instruction
-class SIInstruction : Instruction {
- public:
-  inline int B1Value() const { return Bits<FourByteInstr, int>(15, 12); }
-  inline uint32_t D1Value() const {
-    return Bits<FourByteInstr, uint32_t>(11, 0);
-  }
-  inline uint8_t I2Value() const {
-    return Bits<FourByteInstr, uint8_t>(23, 16);
-  }
-  inline int size() const { return 4; }
-};
-
-// SIY Instruction
-class SIYInstruction : Instruction {
- public:
-  inline int B1Value() const { return Bits<SixByteInstr, int>(31, 28); }
-  inline int32_t D1Value() const {
-    int32_t value = Bits<SixByteInstr, uint32_t>(27, 16);
-    value += Bits<SixByteInstr, int8_t>(15, 8) << 12;
-    return value;
-  }
-  inline uint8_t I2Value() const { return Bits<SixByteInstr, uint8_t>(39, 32); }
-  inline int size() const { return 6; }
-};
-
-// SIL Instruction
-class SILInstruction : Instruction {
- public:
-  inline int B1Value() const { return Bits<SixByteInstr, int>(31, 28); }
-  inline int D1Value() const { return Bits<SixByteInstr, int>(27, 16); }
-  inline int I2Value() const { return Bits<SixByteInstr, int>(15, 0); }
-  inline int size() const { return 6; }
-};
-
-// SS Instruction
-class SSInstruction : Instruction {
- public:
-  inline int B1Value() const { return Bits<SixByteInstr, int>(31, 28); }
-  inline int B2Value() const { return Bits<SixByteInstr, int>(15, 12); }
-  inline int D1Value() const { return Bits<SixByteInstr, int>(27, 16); }
-  inline int D2Value() const { return Bits<SixByteInstr, int>(11, 0); }
-  inline int Length() const { return Bits<SixByteInstr, int>(39, 32); }
-  inline int size() const { return 6; }
-};
-
-// RXE Instruction
-class RXEInstruction : Instruction {
- public:
-  inline int R1Value() const { return Bits<SixByteInstr, int>(39, 36); }
-  inline int X2Value() const { return Bits<SixByteInstr, int>(35, 32); }
-  inline int B2Value() const { return Bits<SixByteInstr, int>(31, 28); }
-  inline int D2Value() const { return Bits<SixByteInstr, int>(27, 16); }
-  inline int size() const { return 6; }
-};
-
-// RIE Instruction
-class RIEInstruction : Instruction {
- public:
-  inline int R1Value() const { return Bits<SixByteInstr, int>(39, 36); }
-  inline int R2Value() const { return Bits<SixByteInstr, int>(35, 32); }
-  inline int I3Value() const { return Bits<SixByteInstr, uint32_t>(31, 24); }
-  inline int I4Value() const { return Bits<SixByteInstr, uint32_t>(23, 16); }
-  inline int I5Value() const { return Bits<SixByteInstr, uint32_t>(15, 8); }
-  inline int I6Value() const {
-    return static_cast<int32_t>(Bits<SixByteInstr, int16_t>(31, 16));
-  }
-  inline int size() const { return 6; }
-};
-
-// VRR Instruction
-class VRR_C_Instruction : SixByteInstruction {
- public:
-  DECLARE_FIELD_FOR_SIX_BYTE_INSTR(R1Value, int, 8, 12);
-  DECLARE_FIELD_FOR_SIX_BYTE_INSTR(R2Value, int, 12, 16);
-  DECLARE_FIELD_FOR_SIX_BYTE_INSTR(R3Value, int, 16, 20);
-  DECLARE_FIELD_FOR_SIX_BYTE_INSTR(M6Value, uint32_t, 24, 28);
-  DECLARE_FIELD_FOR_SIX_BYTE_INSTR(M5Value, uint32_t, 28, 32);
-  DECLARE_FIELD_FOR_SIX_BYTE_INSTR(M4Value, uint32_t, 32, 36);
-};
-
-// Helper functions for converting between register numbers and names.
-class Registers {
- public:
-  // Lookup the register number for the name provided.
-  static int Number(const char* name);
-
- private:
-  static const char* names_[kNumRegisters];
-};
-
-// Helper functions for converting between FP register numbers and names.
-class DoubleRegisters {
- public:
-  // Lookup the register number for the name provided.
-  static int Number(const char* name);
-
- private:
-  static const char* names_[kNumDoubleRegisters];
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_S390_CONSTANTS_S390_H_
diff --git a/src/v8/src/s390/cpu-s390.cc b/src/v8/src/s390/cpu-s390.cc
deleted file mode 100644
index d0d54a8..0000000
--- a/src/v8/src/s390/cpu-s390.cc
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// CPU specific code for s390 independent of OS goes here.
-#include "src/v8.h"
-
-#if V8_TARGET_ARCH_S390
-#include "src/assembler.h"
-
-namespace v8 {
-namespace internal {
-
-void CpuFeatures::FlushICache(void* buffer, size_t size) {
-  // Given the strong memory model on z/Architecture, and the single
-  // thread nature of V8 and JavaScript, instruction cache flushing
-  // is not necessary.  The architecture guarantees that if a core
-  // patches its own instruction cache, the updated instructions will be
-  // reflected automatically.
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_S390
diff --git a/src/v8/src/s390/deoptimizer-s390.cc b/src/v8/src/s390/deoptimizer-s390.cc
deleted file mode 100644
index 291d9d5..0000000
--- a/src/v8/src/s390/deoptimizer-s390.cc
+++ /dev/null
@@ -1,272 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/assembler-inl.h"
-#include "src/deoptimizer.h"
-#include "src/register-configuration.h"
-#include "src/safepoint-table.h"
-
-namespace v8 {
-namespace internal {
-
-// LAY + LGHI/LHI + BRCL
-const int Deoptimizer::table_entry_size_ = 16;
-
-#define __ masm()->
-
-// This code tries to be close to ia32 code so that any changes can be
-// easily ported.
-void Deoptimizer::TableEntryGenerator::Generate() {
-  GeneratePrologue();
-
-  // Save all the registers onto the stack
-  const int kNumberOfRegisters = Register::kNumRegisters;
-
-  RegList restored_regs = kJSCallerSaved | kCalleeSaved;
-
-  const int kDoubleRegsSize = kDoubleSize * DoubleRegister::kNumRegisters;
-  const int kFloatRegsSize = kFloatSize * FloatRegister::kNumRegisters;
-
-  // Save all double registers before messing with them.
-  __ lay(sp, MemOperand(sp, -kDoubleRegsSize));
-  const RegisterConfiguration* config = RegisterConfiguration::Default();
-  for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
-    int code = config->GetAllocatableDoubleCode(i);
-    const DoubleRegister dreg = DoubleRegister::from_code(code);
-    int offset = code * kDoubleSize;
-    __ StoreDouble(dreg, MemOperand(sp, offset));
-  }
-  // Save all float registers before messing with them.
-  __ lay(sp, MemOperand(sp, -kFloatRegsSize));
-  for (int i = 0; i < config->num_allocatable_float_registers(); ++i) {
-    int code = config->GetAllocatableFloatCode(i);
-    const FloatRegister dreg = FloatRegister::from_code(code);
-    int offset = code * kFloatSize;
-    __ StoreFloat32(dreg, MemOperand(sp, offset));
-  }
-
-  // Push all GPRs onto the stack
-  __ lay(sp, MemOperand(sp, -kNumberOfRegisters * kPointerSize));
-  __ StoreMultipleP(r0, sp, MemOperand(sp));  // Save all 16 registers
-
-  __ mov(ip, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress,
-                                       isolate())));
-  __ StoreP(fp, MemOperand(ip));
-
-  const int kSavedRegistersAreaSize =
-      (kNumberOfRegisters * kPointerSize) + kDoubleRegsSize + kFloatRegsSize;
-
-  // Get the bailout id from the stack.
-  __ LoadP(r4, MemOperand(sp, kSavedRegistersAreaSize));
-
-  // Cleanse the Return address for 31-bit
-  __ CleanseP(r14);
-
-  // Get the address of the location in the code object (r5)(return
-  // address for lazy deoptimization) and compute the fp-to-sp delta in
-  // register r6.
-  __ LoadRR(r5, r14);
-  __ la(r6, MemOperand(sp, kSavedRegistersAreaSize + (1 * kPointerSize)));
-  __ SubP(r6, fp, r6);
-
-  // Allocate a new deoptimizer object.
-  // Pass six arguments in r2 to r7.
-  __ PrepareCallCFunction(6, r7);
-  __ LoadImmP(r2, Operand::Zero());
-  Label context_check;
-  __ LoadP(r3, MemOperand(fp, CommonFrameConstants::kContextOrFrameTypeOffset));
-  __ JumpIfSmi(r3, &context_check);
-  __ LoadP(r2, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
-  __ bind(&context_check);
-  __ LoadImmP(r3, Operand(type()));  // bailout type,
-  // r4: bailout id already loaded.
-  // r5: code address or 0 already loaded.
-  // r6: Fp-to-sp delta.
-  // Parm6: isolate is passed on the stack.
-  __ mov(r7, Operand(ExternalReference::isolate_address(isolate())));
-  __ StoreP(r7, MemOperand(sp, kStackFrameExtraParamSlot * kPointerSize));
-
-  // Call Deoptimizer::New().
-  {
-    AllowExternalCallThatCantCauseGC scope(masm());
-    __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate()), 6);
-  }
-
-  // Preserve "deoptimizer" object in register r2 and get the input
-  // frame descriptor pointer to r3 (deoptimizer->input_);
-  __ LoadP(r3, MemOperand(r2, Deoptimizer::input_offset()));
-
-  // Copy core registers into FrameDescription::registers_[kNumRegisters].
-  // DCHECK_EQ(Register::kNumRegisters, kNumberOfRegisters);
-  // __ mvc(MemOperand(r3, FrameDescription::registers_offset()),
-  //        MemOperand(sp), kNumberOfRegisters * kPointerSize);
-  // Copy core registers into FrameDescription::registers_[kNumRegisters].
-  // TODO(john.yan): optimize the following code by using mvc instruction
-  DCHECK_EQ(Register::kNumRegisters, kNumberOfRegisters);
-  for (int i = 0; i < kNumberOfRegisters; i++) {
-    int offset = (i * kPointerSize) + FrameDescription::registers_offset();
-    __ LoadP(r4, MemOperand(sp, i * kPointerSize));
-    __ StoreP(r4, MemOperand(r3, offset));
-  }
-
-  int double_regs_offset = FrameDescription::double_registers_offset();
-  // Copy double registers to
-  // double_registers_[DoubleRegister::kNumRegisters]
-  for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
-    int code = config->GetAllocatableDoubleCode(i);
-    int dst_offset = code * kDoubleSize + double_regs_offset;
-    int src_offset =
-        code * kDoubleSize + kNumberOfRegisters * kPointerSize + kFloatRegsSize;
-    // TODO(joransiu): MVC opportunity
-    __ LoadDouble(d0, MemOperand(sp, src_offset));
-    __ StoreDouble(d0, MemOperand(r3, dst_offset));
-  }
-
-  int float_regs_offset = FrameDescription::float_registers_offset();
-  // Copy float registers to
-  // float_registers_[FloatRegister::kNumRegisters]
-  for (int i = 0; i < config->num_allocatable_float_registers(); ++i) {
-    int code = config->GetAllocatableFloatCode(i);
-    int dst_offset = code * kFloatSize + float_regs_offset;
-    int src_offset = code * kFloatSize + kNumberOfRegisters * kPointerSize;
-    // TODO(joransiu): MVC opportunity
-    __ LoadFloat32(d0, MemOperand(sp, src_offset));
-    __ StoreFloat32(d0, MemOperand(r3, dst_offset));
-  }
-  // Remove the bailout id and the saved registers from the stack.
-  __ la(sp, MemOperand(sp, kSavedRegistersAreaSize + (1 * kPointerSize)));
-
-  // Compute a pointer to the unwinding limit in register r4; that is
-  // the first stack slot not part of the input frame.
-  __ LoadP(r4, MemOperand(r3, FrameDescription::frame_size_offset()));
-  __ AddP(r4, sp);
-
-  // Unwind the stack down to - but not including - the unwinding
-  // limit and copy the contents of the activation frame to the input
-  // frame description.
-  __ la(r5, MemOperand(r3, FrameDescription::frame_content_offset()));
-  Label pop_loop;
-  Label pop_loop_header;
-  __ b(&pop_loop_header, Label::kNear);
-  __ bind(&pop_loop);
-  __ pop(r6);
-  __ StoreP(r6, MemOperand(r5, 0));
-  __ la(r5, MemOperand(r5, kPointerSize));
-  __ bind(&pop_loop_header);
-  __ CmpP(r4, sp);
-  __ bne(&pop_loop);
-
-  // Compute the output frame in the deoptimizer.
-  __ push(r2);  // Preserve deoptimizer object across call.
-  // r2: deoptimizer object; r3: scratch.
-  __ PrepareCallCFunction(1, r3);
-  // Call Deoptimizer::ComputeOutputFrames().
-  {
-    AllowExternalCallThatCantCauseGC scope(masm());
-    __ CallCFunction(
-        ExternalReference::compute_output_frames_function(isolate()), 1);
-  }
-  __ pop(r2);  // Restore deoptimizer object (class Deoptimizer).
-
-  __ LoadP(sp, MemOperand(r2, Deoptimizer::caller_frame_top_offset()));
-
-  // Replace the current (input) frame with the output frames.
-  Label outer_push_loop, inner_push_loop, outer_loop_header, inner_loop_header;
-  // Outer loop state: r6 = current "FrameDescription** output_",
-  // r3 = one past the last FrameDescription**.
-  __ LoadlW(r3, MemOperand(r2, Deoptimizer::output_count_offset()));
-  __ LoadP(r6, MemOperand(r2, Deoptimizer::output_offset()));  // r6 is output_.
-  __ ShiftLeftP(r3, r3, Operand(kPointerSizeLog2));
-  __ AddP(r3, r6, r3);
-  __ b(&outer_loop_header, Label::kNear);
-
-  __ bind(&outer_push_loop);
-  // Inner loop state: r4 = current FrameDescription*, r5 = loop index.
-  __ LoadP(r4, MemOperand(r6, 0));  // output_[ix]
-  __ LoadP(r5, MemOperand(r4, FrameDescription::frame_size_offset()));
-  __ b(&inner_loop_header, Label::kNear);
-
-  __ bind(&inner_push_loop);
-  __ AddP(r5, Operand(-sizeof(intptr_t)));
-  __ AddP(r8, r4, r5);
-  __ LoadP(r8, MemOperand(r8, FrameDescription::frame_content_offset()));
-  __ push(r8);
-
-  __ bind(&inner_loop_header);
-  __ CmpP(r5, Operand::Zero());
-  __ bne(&inner_push_loop);  // test for gt?
-
-  __ AddP(r6, r6, Operand(kPointerSize));
-  __ bind(&outer_loop_header);
-  __ CmpP(r6, r3);
-  __ blt(&outer_push_loop);
-
-  __ LoadP(r3, MemOperand(r2, Deoptimizer::input_offset()));
-  for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
-    int code = config->GetAllocatableDoubleCode(i);
-    const DoubleRegister dreg = DoubleRegister::from_code(code);
-    int src_offset = code * kDoubleSize + double_regs_offset;
-    __ ld(dreg, MemOperand(r3, src_offset));
-  }
-
-  // Push pc and continuation from the last output frame.
-  __ LoadP(r8, MemOperand(r4, FrameDescription::pc_offset()));
-  __ push(r8);
-  __ LoadP(r8, MemOperand(r4, FrameDescription::continuation_offset()));
-  __ push(r8);
-
-  // Restore the registers from the last output frame.
-  __ LoadRR(r1, r4);
-  for (int i = kNumberOfRegisters - 1; i > 0; i--) {
-    int offset = (i * kPointerSize) + FrameDescription::registers_offset();
-    if ((restored_regs & (1 << i)) != 0) {
-      __ LoadP(ToRegister(i), MemOperand(r1, offset));
-    }
-  }
-
-  __ InitializeRootRegister();
-
-  __ pop(ip);  // get continuation, leave pc on stack
-  __ pop(r14);
-  __ Jump(ip);
-  __ stop("Unreachable.");
-}
-
-void Deoptimizer::TableEntryGenerator::GeneratePrologue() {
-  // Create a sequence of deoptimization entries. Note that any
-  // registers may be still live.
-  Label done;
-  for (int i = 0; i < count(); i++) {
-    int start = masm()->pc_offset();
-    USE(start);
-    __ lay(sp, MemOperand(sp, -kPointerSize));
-    __ LoadImmP(ip, Operand(i));
-    __ b(&done);
-    int end = masm()->pc_offset();
-    USE(end);
-    DCHECK(masm()->pc_offset() - start == table_entry_size_);
-  }
-  __ bind(&done);
-  __ StoreP(ip, MemOperand(sp));
-}
-
-bool Deoptimizer::PadTopOfStackRegister() { return false; }
-
-void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) {
-  SetFrameSlot(offset, value);
-}
-
-void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) {
-  SetFrameSlot(offset, value);
-}
-
-void FrameDescription::SetCallerConstantPool(unsigned offset, intptr_t value) {
-  // No out-of-line constant pool support.
-  UNREACHABLE();
-}
-
-#undef __
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/s390/disasm-s390.cc b/src/v8/src/s390/disasm-s390.cc
deleted file mode 100644
index de4db00..0000000
--- a/src/v8/src/s390/disasm-s390.cc
+++ /dev/null
@@ -1,1574 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// A Disassembler object is used to disassemble a block of code instruction by
-// instruction. The default implementation of the NameConverter object can be
-// overriden to modify register names or to do symbol lookup on addresses.
-//
-// The example below will disassemble a block of code and print it to stdout.
-//
-//   NameConverter converter;
-//   Disassembler d(converter);
-//   for (byte* pc = begin; pc < end;) {
-//     v8::internal::EmbeddedVector<char, 256> buffer;
-//     byte* prev_pc = pc;
-//     pc += d.InstructionDecode(buffer, pc);
-//     printf("%p    %08x      %s\n",
-//            prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer);
-//   }
-//
-// The Disassembler class also has a convenience method to disassemble a block
-// of code into a FILE*, meaning that the above functionality could also be
-// achieved by just calling Disassembler::Disassemble(stdout, begin, end);
-
-#include <assert.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <string.h>
-
-#if V8_TARGET_ARCH_S390
-
-#include "src/base/platform/platform.h"
-#include "src/disasm.h"
-#include "src/macro-assembler.h"
-#include "src/s390/constants-s390.h"
-
-namespace v8 {
-namespace internal {
-
-const auto GetRegConfig = RegisterConfiguration::Default;
-
-//------------------------------------------------------------------------------
-
-// Decoder decodes and disassembles instructions into an output buffer.
-// It uses the converter to convert register names and call destinations into
-// more informative description.
-class Decoder {
- public:
-  Decoder(const disasm::NameConverter& converter, Vector<char> out_buffer)
-      : converter_(converter), out_buffer_(out_buffer), out_buffer_pos_(0) {
-    out_buffer_[out_buffer_pos_] = '\0';
-  }
-
-  ~Decoder() {}
-
-  // Writes one disassembled instruction into 'buffer' (0-terminated).
-  // Returns the length of the disassembled machine instruction in bytes.
-  int InstructionDecode(byte* instruction);
-
- private:
-  // Bottleneck functions to print into the out_buffer.
-  void PrintChar(const char ch);
-  void Print(const char* str);
-
-  // Printing of common values.
-  void PrintRegister(int reg);
-  void PrintDRegister(int reg);
-  void PrintSoftwareInterrupt(SoftwareInterruptCodes svc);
-
-  // Handle formatting of instructions and their options.
-  int FormatRegister(Instruction* instr, const char* option);
-  int FormatFloatingRegister(Instruction* instr, const char* option);
-  int FormatMask(Instruction* instr, const char* option);
-  int FormatDisplacement(Instruction* instr, const char* option);
-  int FormatImmediate(Instruction* instr, const char* option);
-  int FormatOption(Instruction* instr, const char* option);
-  void Format(Instruction* instr, const char* format);
-  void Unknown(Instruction* instr);
-  void UnknownFormat(Instruction* instr, const char* opcname);
-
-  bool DecodeTwoByte(Instruction* instr);
-  bool DecodeFourByte(Instruction* instr);
-  bool DecodeSixByte(Instruction* instr);
-
-  const disasm::NameConverter& converter_;
-  Vector<char> out_buffer_;
-  int out_buffer_pos_;
-
-  DISALLOW_COPY_AND_ASSIGN(Decoder);
-};
-
-// Support for assertions in the Decoder formatting functions.
-#define STRING_STARTS_WITH(string, compare_string) \
-  (strncmp(string, compare_string, strlen(compare_string)) == 0)
-
-// Append the ch to the output buffer.
-void Decoder::PrintChar(const char ch) { out_buffer_[out_buffer_pos_++] = ch; }
-
-// Append the str to the output buffer.
-void Decoder::Print(const char* str) {
-  char cur = *str++;
-  while (cur != '\0' && (out_buffer_pos_ < (out_buffer_.length() - 1))) {
-    PrintChar(cur);
-    cur = *str++;
-  }
-  out_buffer_[out_buffer_pos_] = 0;
-}
-
-// Print the register name according to the active name converter.
-void Decoder::PrintRegister(int reg) {
-  Print(converter_.NameOfCPURegister(reg));
-}
-
-// Print the double FP register name according to the active name converter.
-void Decoder::PrintDRegister(int reg) {
-  Print(GetRegConfig()->GetDoubleRegisterName(reg));
-}
-
-// Print SoftwareInterrupt codes. Factoring this out reduces the complexity of
-// the FormatOption method.
-void Decoder::PrintSoftwareInterrupt(SoftwareInterruptCodes svc) {
-  switch (svc) {
-    case kCallRtRedirected:
-      Print("call rt redirected");
-      return;
-    case kBreakpoint:
-      Print("breakpoint");
-      return;
-    default:
-      if (svc >= kStopCode) {
-        out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d - 0x%x",
-                                    svc & kStopCodeMask, svc & kStopCodeMask);
-      } else {
-        out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", svc);
-      }
-      return;
-  }
-}
-
-// Handle all register based formatting in this function to reduce the
-// complexity of FormatOption.
-int Decoder::FormatRegister(Instruction* instr, const char* format) {
-  DCHECK_EQ(format[0], 'r');
-
-  if (format[1] == '1') {  // 'r1: register resides in bit 8-11
-    RRInstruction* rrinstr = reinterpret_cast<RRInstruction*>(instr);
-    int reg = rrinstr->R1Value();
-    PrintRegister(reg);
-    return 2;
-  } else if (format[1] == '2') {  // 'r2: register resides in bit 12-15
-    RRInstruction* rrinstr = reinterpret_cast<RRInstruction*>(instr);
-    int reg = rrinstr->R2Value();
-    // indicating it is a r0 for displacement, in which case the offset
-    // should be 0.
-    if (format[2] == 'd') {
-      if (reg == 0) return 4;
-      PrintRegister(reg);
-      return 3;
-    } else {
-      PrintRegister(reg);
-      return 2;
-    }
-  } else if (format[1] == '3') {  // 'r3: register resides in bit 16-19
-    RSInstruction* rsinstr = reinterpret_cast<RSInstruction*>(instr);
-    int reg = rsinstr->B2Value();
-    PrintRegister(reg);
-    return 2;
-  } else if (format[1] == '4') {  // 'r4: register resides in bit 20-23
-    RSInstruction* rsinstr = reinterpret_cast<RSInstruction*>(instr);
-    int reg = rsinstr->B2Value();
-    PrintRegister(reg);
-    return 2;
-  } else if (format[1] == '5') {  // 'r5: register resides in bit 24-28
-    RREInstruction* rreinstr = reinterpret_cast<RREInstruction*>(instr);
-    int reg = rreinstr->R1Value();
-    PrintRegister(reg);
-    return 2;
-  } else if (format[1] == '6') {  // 'r6: register resides in bit 29-32
-    RREInstruction* rreinstr = reinterpret_cast<RREInstruction*>(instr);
-    int reg = rreinstr->R2Value();
-    PrintRegister(reg);
-    return 2;
-  } else if (format[1] == '7') {  // 'r6: register resides in bit 32-35
-    SSInstruction* ssinstr = reinterpret_cast<SSInstruction*>(instr);
-    int reg = ssinstr->B2Value();
-    PrintRegister(reg);
-    return 2;
-  }
-
-  UNREACHABLE();
-}
-
-int Decoder::FormatFloatingRegister(Instruction* instr, const char* format) {
-  DCHECK_EQ(format[0], 'f');
-
-  // reuse 1, 5 and 6 because it is coresponding
-  if (format[1] == '1') {  // 'r1: register resides in bit 8-11
-    RRInstruction* rrinstr = reinterpret_cast<RRInstruction*>(instr);
-    int reg = rrinstr->R1Value();
-    PrintDRegister(reg);
-    return 2;
-  } else if (format[1] == '2') {  // 'f2: register resides in bit 12-15
-    RRInstruction* rrinstr = reinterpret_cast<RRInstruction*>(instr);
-    int reg = rrinstr->R2Value();
-    PrintDRegister(reg);
-    return 2;
-  } else if (format[1] == '3') {  // 'f3: register resides in bit 16-19
-    RRDInstruction* rrdinstr = reinterpret_cast<RRDInstruction*>(instr);
-    int reg = rrdinstr->R1Value();
-    PrintDRegister(reg);
-    return 2;
-  } else if (format[1] == '5') {  // 'f5: register resides in bit 24-28
-    RREInstruction* rreinstr = reinterpret_cast<RREInstruction*>(instr);
-    int reg = rreinstr->R1Value();
-    PrintDRegister(reg);
-    return 2;
-  } else if (format[1] == '6') {  // 'f6: register resides in bit 29-32
-    RREInstruction* rreinstr = reinterpret_cast<RREInstruction*>(instr);
-    int reg = rreinstr->R2Value();
-    PrintDRegister(reg);
-    return 2;
-  }
-  UNREACHABLE();
-}
-
-// FormatOption takes a formatting string and interprets it based on
-// the current instructions. The format string points to the first
-// character of the option string (the option escape has already been
-// consumed by the caller.)  FormatOption returns the number of
-// characters that were consumed from the formatting string.
-int Decoder::FormatOption(Instruction* instr, const char* format) {
-  switch (format[0]) {
-    case 'o': {
-      if (instr->Bit(10) == 1) {
-        Print("o");
-      }
-      return 1;
-    }
-    case '.': {
-      if (instr->Bit(0) == 1) {
-        Print(".");
-      } else {
-        Print(" ");  // ensure consistent spacing
-      }
-      return 1;
-    }
-    case 'r': {
-      return FormatRegister(instr, format);
-    }
-    case 'f': {
-      return FormatFloatingRegister(instr, format);
-    }
-    case 'i': {  // int16
-      return FormatImmediate(instr, format);
-    }
-    case 'u': {  // uint16
-      int32_t value = instr->Bits(15, 0);
-      out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
-      return 6;
-    }
-    case 'l': {
-      // Link (LK) Bit 0
-      if (instr->Bit(0) == 1) {
-        Print("l");
-      }
-      return 1;
-    }
-    case 'a': {
-      // Absolute Address Bit 1
-      if (instr->Bit(1) == 1) {
-        Print("a");
-      }
-      return 1;
-    }
-    case 't': {  // 'target: target of branch instructions
-      // target26 or target16
-      DCHECK(STRING_STARTS_WITH(format, "target"));
-      if ((format[6] == '2') && (format[7] == '6')) {
-        int off = ((instr->Bits(25, 2)) << 8) >> 6;
-        out_buffer_pos_ += SNPrintF(
-            out_buffer_ + out_buffer_pos_, "%+d -> %s", off,
-            converter_.NameOfAddress(reinterpret_cast<byte*>(instr) + off));
-        return 8;
-      } else if ((format[6] == '1') && (format[7] == '6')) {
-        int off = ((instr->Bits(15, 2)) << 18) >> 16;
-        out_buffer_pos_ += SNPrintF(
-            out_buffer_ + out_buffer_pos_, "%+d -> %s", off,
-            converter_.NameOfAddress(reinterpret_cast<byte*>(instr) + off));
-        return 8;
-      }
-      case 'm': {
-        return FormatMask(instr, format);
-      }
-    }
-    case 'd': {  // ds value for offset
-      return FormatDisplacement(instr, format);
-    }
-    default: {
-      UNREACHABLE();
-      break;
-    }
-  }
-
-  UNREACHABLE();
-}
-
-int Decoder::FormatMask(Instruction* instr, const char* format) {
-  DCHECK_EQ(format[0], 'm');
-  int32_t value = 0;
-  if ((format[1] == '1')) {  // prints the mask format in bits 8-12
-    value = reinterpret_cast<RRInstruction*>(instr)->R1Value();
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "0x%x", value);
-    return 2;
-  } else if (format[1] == '2') {  // mask format in bits 16-19
-    value = reinterpret_cast<RXInstruction*>(instr)->B2Value();
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "0x%x", value);
-    return 2;
-  } else if (format[1] == '3') {  // mask format in bits 20-23
-    value = reinterpret_cast<RRFInstruction*>(instr)->M4Value();
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "0x%x", value);
-    return 2;
-  }
-
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
-  return 2;
-}
-
-int Decoder::FormatDisplacement(Instruction* instr, const char* format) {
-  DCHECK_EQ(format[0], 'd');
-
-  if (format[1] == '1') {  // displacement in 20-31
-    RSInstruction* rsinstr = reinterpret_cast<RSInstruction*>(instr);
-    uint16_t value = rsinstr->D2Value();
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
-
-    return 2;
-  } else if (format[1] == '2') {  // displacement in 20-39
-    RXYInstruction* rxyinstr = reinterpret_cast<RXYInstruction*>(instr);
-    int32_t value = rxyinstr->D2Value();
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
-    return 2;
-  } else if (format[1] == '4') {  // SS displacement 2 36-47
-    SSInstruction* ssInstr = reinterpret_cast<SSInstruction*>(instr);
-    uint16_t value = ssInstr->D2Value();
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
-    return 2;
-  } else if (format[1] == '3') {  // SS displacement 1 20 - 32
-    SSInstruction* ssInstr = reinterpret_cast<SSInstruction*>(instr);
-    uint16_t value = ssInstr->D1Value();
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
-    return 2;
-  } else {  // s390 specific
-    int32_t value = SIGN_EXT_IMM16(instr->Bits(15, 0) & ~3);
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
-    return 1;
-  }
-}
-
-int Decoder::FormatImmediate(Instruction* instr, const char* format) {
-  DCHECK_EQ(format[0], 'i');
-
-  if (format[1] == '1') {  // immediate in 16-31
-    RIInstruction* riinstr = reinterpret_cast<RIInstruction*>(instr);
-    int16_t value = riinstr->I2Value();
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
-    return 2;
-  } else if (format[1] == '2') {  // immediate in 16-48
-    RILInstruction* rilinstr = reinterpret_cast<RILInstruction*>(instr);
-    int32_t value = rilinstr->I2Value();
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
-    return 2;
-  } else if (format[1] == '3') {  // immediate in I format
-    IInstruction* iinstr = reinterpret_cast<IInstruction*>(instr);
-    int8_t value = iinstr->IValue();
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
-    return 2;
-  } else if (format[1] == '4') {  // immediate in 16-31, but outputs as offset
-    RIInstruction* riinstr = reinterpret_cast<RIInstruction*>(instr);
-    int16_t value = riinstr->I2Value() * 2;
-    if (value >= 0)
-      out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "*+");
-    else
-      out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "*");
-
-    out_buffer_pos_ += SNPrintF(
-        out_buffer_ + out_buffer_pos_, "%d -> %s", value,
-        converter_.NameOfAddress(reinterpret_cast<byte*>(instr) + value));
-    return 2;
-  } else if (format[1] == '5') {  // immediate in 16-31, but outputs as offset
-    RILInstruction* rilinstr = reinterpret_cast<RILInstruction*>(instr);
-    int32_t value = rilinstr->I2Value() * 2;
-    if (value >= 0)
-      out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "*+");
-    else
-      out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "*");
-
-    out_buffer_pos_ += SNPrintF(
-        out_buffer_ + out_buffer_pos_, "%d -> %s", value,
-        converter_.NameOfAddress(reinterpret_cast<byte*>(instr) + value));
-    return 2;
-  } else if (format[1] == '6') {  // unsigned immediate in 16-31
-    RIInstruction* riinstr = reinterpret_cast<RIInstruction*>(instr);
-    uint16_t value = riinstr->I2UnsignedValue();
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
-    return 2;
-  } else if (format[1] == '7') {  // unsigned immediate in 16-47
-    RILInstruction* rilinstr = reinterpret_cast<RILInstruction*>(instr);
-    uint32_t value = rilinstr->I2UnsignedValue();
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
-    return 2;
-  } else if (format[1] == '8') {  // unsigned immediate in 8-15
-    SSInstruction* ssinstr = reinterpret_cast<SSInstruction*>(instr);
-    uint8_t value = ssinstr->Length();
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
-    return 2;
-  } else if (format[1] == '9') {  // unsigned immediate in 16-23
-    RIEInstruction* rie_instr = reinterpret_cast<RIEInstruction*>(instr);
-    uint8_t value = rie_instr->I3Value();
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
-    return 2;
-  } else if (format[1] == 'a') {  // unsigned immediate in 24-31
-    RIEInstruction* rie_instr = reinterpret_cast<RIEInstruction*>(instr);
-    uint8_t value = rie_instr->I4Value();
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
-    return 2;
-  } else if (format[1] == 'b') {  // unsigned immediate in 32-39
-    RIEInstruction* rie_instr = reinterpret_cast<RIEInstruction*>(instr);
-    uint8_t value = rie_instr->I5Value();
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
-    return 2;
-  } else if (format[1] == 'c') {  // signed immediate in 8-15
-    SSInstruction* ssinstr = reinterpret_cast<SSInstruction*>(instr);
-    int8_t value = ssinstr->Length();
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
-    return 2;
-  } else if (format[1] == 'd') {  // signed immediate in 32-47
-    SILInstruction* silinstr = reinterpret_cast<SILInstruction*>(instr);
-    int16_t value = silinstr->I2Value();
-    out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
-    return 2;
-  } else if (format[1] == 'e') {  // immediate in 16-47, but outputs as offset
-    RILInstruction* rilinstr = reinterpret_cast<RILInstruction*>(instr);
-    int32_t value = rilinstr->I2Value() * 2;
-    if (value >= 0)
-      out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "*+");
-    else
-      out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "*");
-
-    out_buffer_pos_ += SNPrintF(
-        out_buffer_ + out_buffer_pos_, "%d -> %s", value,
-        converter_.NameOfAddress(reinterpret_cast<byte*>(instr) + value));
-    return 2;
-  }
-
-  UNREACHABLE();
-}
-
-// Format takes a formatting string for a whole instruction and prints it into
-// the output buffer. All escaped options are handed to FormatOption to be
-// parsed further.
-void Decoder::Format(Instruction* instr, const char* format) {
-  char cur = *format++;
-  while ((cur != 0) && (out_buffer_pos_ < (out_buffer_.length() - 1))) {
-    if (cur == '\'') {  // Single quote is used as the formatting escape.
-      format += FormatOption(instr, format);
-    } else {
-      out_buffer_[out_buffer_pos_++] = cur;
-    }
-    cur = *format++;
-  }
-  out_buffer_[out_buffer_pos_] = '\0';
-}
-
-// The disassembler may end up decoding data inlined in the code. We do not want
-// it to crash if the data does not resemble any known instruction.
-#define VERIFY(condition) \
-  if (!(condition)) {     \
-    Unknown(instr);       \
-    return;               \
-  }
-
-// For currently unimplemented decodings the disassembler calls Unknown(instr)
-// which will just print "unknown" of the instruction bits.
-void Decoder::Unknown(Instruction* instr) { Format(instr, "unknown"); }
-
-// For currently unimplemented decodings the disassembler calls
-// UnknownFormat(instr) which will just print opcode name of the
-// instruction bits.
-void Decoder::UnknownFormat(Instruction* instr, const char* name) {
-  char buffer[100];
-  snprintf(buffer, sizeof(buffer), "%s (unknown-format)", name);
-  Format(instr, buffer);
-}
-
-// Disassembles Two Byte S390 Instructions
-// @return true if successfully decoded
-bool Decoder::DecodeTwoByte(Instruction* instr) {
-  // Print the Instruction bits.
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%04x           ",
-                              instr->InstructionBits<TwoByteInstr>());
-
-  Opcode opcode = instr->S390OpcodeValue();
-  switch (opcode) {
-    case AR:
-      Format(instr, "ar\t'r1,'r2");
-      break;
-    case SR:
-      Format(instr, "sr\t'r1,'r2");
-      break;
-    case MR:
-      Format(instr, "mr\t'r1,'r2");
-      break;
-    case DR:
-      Format(instr, "dr\t'r1,'r2");
-      break;
-    case OR:
-      Format(instr, "or\t'r1,'r2");
-      break;
-    case NR:
-      Format(instr, "nr\t'r1,'r2");
-      break;
-    case XR:
-      Format(instr, "xr\t'r1,'r2");
-      break;
-    case LR:
-      Format(instr, "lr\t'r1,'r2");
-      break;
-    case CR:
-      Format(instr, "cr\t'r1,'r2");
-      break;
-    case CLR:
-      Format(instr, "clr\t'r1,'r2");
-      break;
-    case BCR:
-      Format(instr, "bcr\t'm1,'r2");
-      break;
-    case LTR:
-      Format(instr, "ltr\t'r1,'r2");
-      break;
-    case ALR:
-      Format(instr, "alr\t'r1,'r2");
-      break;
-    case SLR:
-      Format(instr, "slr\t'r1,'r2");
-      break;
-    case LNR:
-      Format(instr, "lnr\t'r1,'r2");
-      break;
-    case LCR:
-      Format(instr, "lcr\t'r1,'r2");
-      break;
-    case BASR:
-      Format(instr, "basr\t'r1,'r2");
-      break;
-    case LDR:
-      Format(instr, "ldr\t'f1,'f2");
-      break;
-    case BKPT:
-      Format(instr, "bkpt");
-      break;
-    case LPR:
-      Format(instr, "lpr\t'r1, 'r2");
-      break;
-    default:
-      return false;
-  }
-  return true;
-}
-
-// Disassembles Four Byte S390 Instructions
-// @return true if successfully decoded
-bool Decoder::DecodeFourByte(Instruction* instr) {
-  // Print the Instruction bits.
-  out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%08x       ",
-                              instr->InstructionBits<FourByteInstr>());
-
-  Opcode opcode = instr->S390OpcodeValue();
-  switch (opcode) {
-    case AHI:
-      Format(instr, "ahi\t'r1,'i1");
-      break;
-    case AGHI:
-      Format(instr, "aghi\t'r1,'i1");
-      break;
-    case LHI:
-      Format(instr, "lhi\t'r1,'i1");
-      break;
-    case LGHI:
-      Format(instr, "lghi\t'r1,'i1");
-      break;
-    case MHI:
-      Format(instr, "mhi\t'r1,'i1");
-      break;
-    case MGHI:
-      Format(instr, "mghi\t'r1,'i1");
-      break;
-    case CHI:
-      Format(instr, "chi\t'r1,'i1");
-      break;
-    case CGHI:
-      Format(instr, "cghi\t'r1,'i1");
-      break;
-    case BRAS:
-      Format(instr, "bras\t'r1,'i1");
-      break;
-    case BRC:
-      Format(instr, "brc\t'm1,'i4");
-      break;
-    case BRCT:
-      Format(instr, "brct\t'r1,'i4");
-      break;
-    case BRCTG:
-      Format(instr, "brctg\t'r1,'i4");
-      break;
-    case IIHH:
-      Format(instr, "iihh\t'r1,'i1");
-      break;
-    case IIHL:
-      Format(instr, "iihl\t'r1,'i1");
-      break;
-    case IILH:
-      Format(instr, "iilh\t'r1,'i1");
-      break;
-    case IILL:
-      Format(instr, "iill\t'r1,'i1");
-      break;
-    case OILL:
-      Format(instr, "oill\t'r1,'i1");
-      break;
-    case TMLL:
-      Format(instr, "tmll\t'r1,'i1");
-      break;
-    case STM:
-      Format(instr, "stm\t'r1,'r2,'d1('r3)");
-      break;
-    case LM:
-      Format(instr, "lm\t'r1,'r2,'d1('r3)");
-      break;
-    case CS:
-      Format(instr, "cs\t'r1,'r2,'d1('r3)");
-      break;
-    case SLL:
-      Format(instr, "sll\t'r1,'d1('r3)");
-      break;
-    case SRL:
-      Format(instr, "srl\t'r1,'d1('r3)");
-      break;
-    case SLA:
-      Format(instr, "sla\t'r1,'d1('r3)");
-      break;
-    case SRA:
-      Format(instr, "sra\t'r1,'d1('r3)");
-      break;
-    case SLDL:
-      Format(instr, "sldl\t'r1,'d1('r3)");
-      break;
-    case AGR:
-      Format(instr, "agr\t'r5,'r6");
-      break;
-    case AGFR:
-      Format(instr, "agfr\t'r5,'r6");
-      break;
-    case ARK:
-      Format(instr, "ark\t'r5,'r6,'r3");
-      break;
-    case AGRK:
-      Format(instr, "agrk\t'r5,'r6,'r3");
-      break;
-    case SGR:
-      Format(instr, "sgr\t'r5,'r6");
-      break;
-    case SGFR:
-      Format(instr, "sgfr\t'r5,'r6");
-      break;
-    case SRK:
-      Format(instr, "srk\t'r5,'r6,'r3");
-      break;
-    case SGRK:
-      Format(instr, "sgrk\t'r5,'r6,'r3");
-      break;
-    case NGR:
-      Format(instr, "ngr\t'r5,'r6");
-      break;
-    case NRK:
-      Format(instr, "nrk\t'r5,'r6,'r3");
-      break;
-    case NGRK:
-      Format(instr, "ngrk\t'r5,'r6,'r3");
-      break;
-    case NILL:
-      Format(instr, "nill\t'r1,'i1");
-      break;
-    case NILH:
-      Format(instr, "nilh\t'r1,'i1");
-      break;
-    case OGR:
-      Format(instr, "ogr\t'r5,'r6");
-      break;
-    case ORK:
-      Format(instr, "ork\t'r5,'r6,'r3");
-      break;
-    case OGRK:
-      Format(instr, "ogrk\t'r5,'r6,'r3");
-      break;
-    case XGR:
-      Format(instr, "xgr\t'r5,'r6");
-      break;
-    case XRK:
-      Format(instr, "xrk\t'r5,'r6,'r3");
-      break;
-    case XGRK:
-      Format(instr, "xgrk\t'r5,'r6,'r3");
-      break;
-    case CGFR:
-      Format(instr, "cgfr\t'r5,'r6");
-      break;
-    case CGR:
-      Format(instr, "cgr\t'r5,'r6");
-      break;
-    case CLGR:
-      Format(instr, "clgr\t'r5,'r6");
-      break;
-    case LLGFR:
-      Format(instr, "llgfr\t'r5,'r6");
-      break;
-    case POPCNT_Z:
-      Format(instr, "popcnt\t'r5,'r6");
-      break;
-    case LLGCR:
-      Format(instr, "llgcr\t'r5,'r6");
-      break;
-    case LLCR:
-      Format(instr, "llcr\t'r5,'r6");
-      break;
-    case LBR:
-      Format(instr, "lbr\t'r5,'r6");
-      break;
-    case LEDBR:
-      Format(instr, "ledbr\t'f5,'f6");
-      break;
-    case LDEBR:
-      Format(instr, "ldebr\t'f5,'f6");
-      break;
-    case LTGR:
-      Format(instr, "ltgr\t'r5,'r6");
-      break;
-    case LTDBR:
-      Format(instr, "ltdbr\t'f5,'f6");
-      break;
-    case LTEBR:
-      Format(instr, "ltebr\t'f5,'f6");
-      break;
-    case LRVR:
-      Format(instr, "lrvr\t'r5,'r6");
-      break;
-    case LRVGR:
-      Format(instr, "lrvgr\t'r5,'r6");
-      break;
-    case LGR:
-      Format(instr, "lgr\t'r5,'r6");
-      break;
-    case LGDR:
-      Format(instr, "lgdr\t'r5,'f6");
-      break;
-    case LGFR:
-      Format(instr, "lgfr\t'r5,'r6");
-      break;
-    case LTGFR:
-      Format(instr, "ltgfr\t'r5,'r6");
-      break;
-    case LCGR:
-      Format(instr, "lcgr\t'r5,'r6");
-      break;
-    case MSR:
-      Format(instr, "msr\t'r5,'r6");
-      break;
-    case MSRKC:
-      Format(instr, "msrkc\t'r5,'r6,'r3");
-      break;
-    case LGBR:
-      Format(instr, "lgbr\t'r5,'r6");
-      break;
-    case LGHR:
-      Format(instr, "lghr\t'r5,'r6");
-      break;
-    case MSGR:
-      Format(instr, "msgr\t'r5,'r6");
-      break;
-    case MSGRKC:
-      Format(instr, "msgrkc\t'r5,'r6,'r3");
-      break;
-    case DSGR:
-      Format(instr, "dsgr\t'r5,'r6");
-      break;
-    case DSGFR:
-      Format(instr, "dsgfr\t'r5,'r6");
-      break;
-    case MSGFR:
-      Format(instr, "msgfr\t'r5,'r6");
-      break;
-    case LZDR:
-      Format(instr, "lzdr\t'f5");
-      break;
-    case MLR:
-      Format(instr, "mlr\t'r5,'r6");
-      break;
-    case MLGR:
-      Format(instr, "mlgr\t'r5,'r6");
-      break;
-    case ALCR:
-      Format(instr, "alcr\t'r5,'r6");
-      break;
-    case ALGR:
-      Format(instr, "algr\t'r5,'r6");
-      break;
-    case ALRK:
-      Format(instr, "alrk\t'r5,'r6,'r3");
-      break;
-    case ALGRK:
-      Format(instr, "algrk\t'r5,'r6,'r3");
-      break;
-    case SLGR:
-      Format(instr, "slgr\t'r5,'r6");
-      break;
-    case SLBR:
-      Format(instr, "slbr\t'r5,'r6");
-      break;
-    case DLR:
-      Format(instr, "dlr\t'r5,'r6");
-      break;
-    case DLGR:
-      Format(instr, "dlgr\t'r5,'r6");
-      break;
-    case SLRK:
-      Format(instr, "slrk\t'r5,'r6,'r3");
-      break;
-    case SLGRK:
-      Format(instr, "slgrk\t'r5,'r6,'r3");
-      break;
-    case LHR:
-      Format(instr, "lhr\t'r5,'r6");
-      break;
-    case LLHR:
-      Format(instr, "llhr\t'r5,'r6");
-      break;
-    case LLGHR:
-      Format(instr, "llghr\t'r5,'r6");
-      break;
-    case LOCR:
-      Format(instr, "locr\t'm1,'r5,'r6");
-      break;
-    case LOCGR:
-      Format(instr, "locgr\t'm1,'r5,'r6");
-      break;
-    case LNGR:
-      Format(instr, "lngr\t'r5,'r6");
-      break;
-    case A:
-      Format(instr, "a\t'r1,'d1('r2d,'r3)");
-      break;
-    case S:
-      Format(instr, "s\t'r1,'d1('r2d,'r3)");
-      break;
-    case M:
-      Format(instr, "m\t'r1,'d1('r2d,'r3)");
-      break;
-    case D:
-      Format(instr, "d\t'r1,'d1('r2d,'r3)");
-      break;
-    case O:
-      Format(instr, "o\t'r1,'d1('r2d,'r3)");
-      break;
-    case N:
-      Format(instr, "n\t'r1,'d1('r2d,'r3)");
-      break;
-    case L:
-      Format(instr, "l\t'r1,'d1('r2d,'r3)");
-      break;
-    case C:
-      Format(instr, "c\t'r1,'d1('r2d,'r3)");
-      break;
-    case AH:
-      Format(instr, "ah\t'r1,'d1('r2d,'r3)");
-      break;
-    case SH:
-      Format(instr, "sh\t'r1,'d1('r2d,'r3)");
-      break;
-    case MH:
-      Format(instr, "mh\t'r1,'d1('r2d,'r3)");
-      break;
-    case AL:
-      Format(instr, "al\t'r1,'d1('r2d,'r3)");
-      break;
-    case SL:
-      Format(instr, "sl\t'r1,'d1('r2d,'r3)");
-      break;
-    case LA:
-      Format(instr, "la\t'r1,'d1('r2d,'r3)");
-      break;
-    case CH:
-      Format(instr, "ch\t'r1,'d1('r2d,'r3)");
-      break;
-    case CL:
-      Format(instr, "cl\t'r1,'d1('r2d,'r3)");
-      break;
-    case CLI:
-      Format(instr, "cli\t'd1('r3),'i8");
-      break;
-    case TM:
-      Format(instr, "tm\t'd1('r3),'i8");
-      break;
-    case BC:
-      Format(instr, "bc\t'm1,'d1('r2d,'r3)");
-      break;
-    case BCT:
-      Format(instr, "bct\t'r1,'d1('r2d,'r3)");
-      break;
-    case ST:
-      Format(instr, "st\t'r1,'d1('r2d,'r3)");
-      break;
-    case STC:
-      Format(instr, "stc\t'r1,'d1('r2d,'r3)");
-      break;
-    case IC_z:
-      Format(instr, "ic\t'r1,'d1('r2d,'r3)");
-      break;
-    case LD:
-      Format(instr, "ld\t'f1,'d1('r2d,'r3)");
-      break;
-    case LE:
-      Format(instr, "le\t'f1,'d1('r2d,'r3)");
-      break;
-    case LDGR:
-      Format(instr, "ldgr\t'f5,'r6");
-      break;
-    case MS:
-      Format(instr, "ms\t'r1,'d1('r2d,'r3)");
-      break;
-    case STE:
-      Format(instr, "ste\t'f1,'d1('r2d,'r3)");
-      break;
-    case STD:
-      Format(instr, "std\t'f1,'d1('r2d,'r3)");
-      break;
-    case CFDBR:
-      Format(instr, "cfdbr\t'r5,'m2,'f6");
-      break;
-    case CDFBR:
-      Format(instr, "cdfbr\t'f5,'m2,'r6");
-      break;
-    case CFEBR:
-      Format(instr, "cfebr\t'r5,'m2,'f6");
-      break;
-    case CEFBR:
-      Format(instr, "cefbr\t'f5,'m2,'r6");
-      break;
-    case CELFBR:
-      Format(instr, "celfbr\t'f5,'m2,'r6");
-      break;
-    case CGEBR:
-      Format(instr, "cgebr\t'r5,'m2,'f6");
-      break;
-    case CGDBR:
-      Format(instr, "cgdbr\t'r5,'m2,'f6");
-      break;
-    case CEGBR:
-      Format(instr, "cegbr\t'f5,'m2,'r6");
-      break;
-    case CDGBR:
-      Format(instr, "cdgbr\t'f5,'m2,'r6");
-      break;
-    case CDLFBR:
-      Format(instr, "cdlfbr\t'f5,'m2,'r6");
-      break;
-    case CDLGBR:
-      Format(instr, "cdlgbr\t'f5,'m2,'r6");
-      break;
-    case CELGBR:
-      Format(instr, "celgbr\t'f5,'m2,'r6");
-      break;
-    case CLFDBR:
-      Format(instr, "clfdbr\t'r5,'m2,'f6");
-      break;
-    case CLFEBR:
-      Format(instr, "clfebr\t'r5,'m2,'f6");
-      break;
-    case CLGEBR:
-      Format(instr, "clgebr\t'r5,'m2,'f6");
-      break;
-    case CLGDBR:
-      Format(instr, "clgdbr\t'r5,'m2,'f6");
-      break;
-    case AEBR:
-      Format(instr, "aebr\t'f5,'f6");
-      break;
-    case SEBR:
-      Format(instr, "sebr\t'f5,'f6");
-      break;
-    case MEEBR:
-      Format(instr, "meebr\t'f5,'f6");
-      break;
-    case DEBR:
-      Format(instr, "debr\t'f5,'f6");
-      break;
-    case ADBR:
-      Format(instr, "adbr\t'f5,'f6");
-      break;
-    case SDBR:
-      Format(instr, "sdbr\t'f5,'f6");
-      break;
-    case MDBR:
-      Format(instr, "mdbr\t'f5,'f6");
-      break;
-    case DDBR:
-      Format(instr, "ddbr\t'f5,'f6");
-      break;
-    case CDBR:
-      Format(instr, "cdbr\t'f5,'f6");
-      break;
-    case CEBR:
-      Format(instr, "cebr\t'f5,'f6");
-      break;
-    case SQDBR:
-      Format(instr, "sqdbr\t'f5,'f6");
-      break;
-    case SQEBR:
-      Format(instr, "sqebr\t'f5,'f6");
-      break;
-    case LCDBR:
-      Format(instr, "lcdbr\t'f5,'f6");
-      break;
-    case LCEBR:
-      Format(instr, "lcebr\t'f5,'f6");
-      break;
-    case STH:
-      Format(instr, "sth\t'r1,'d1('r2d,'r3)");
-      break;
-    case SRDA:
-      Format(instr, "srda\t'r1,'d1('r3)");
-      break;
-    case SRDL:
-      Format(instr, "srdl\t'r1,'d1('r3)");
-      break;
-    case MADBR:
-      Format(instr, "madbr\t'f3,'f5,'f6");
-      break;
-    case MSDBR:
-      Format(instr, "msdbr\t'f3,'f5,'f6");
-      break;
-    case FLOGR:
-      Format(instr, "flogr\t'r5,'r6");
-      break;
-    case FIEBRA:
-      Format(instr, "fiebra\t'f5,'m2,'f6,'m3");
-      break;
-    case FIDBRA:
-      Format(instr, "fidbra\t'f5,'m2,'f6,'m3");
-      break;
-    // TRAP4 is used in calling to native function. it will not be generated
-    // in native code.
-    case TRAP4: {
-      Format(instr, "trap4");
-      break;
-    }
-    case LPGR:
-      Format(instr, "lpgr\t'r5,'r6");
-      break;
-    case LPGFR:
-      Format(instr, "lpgfr\t'r5,'r6");
-      break;
-    default:
-      return false;
-  }
-  return true;
-}
-
-// Disassembles Six Byte S390 Instructions
-// @return true if successfully decoded
-bool Decoder::DecodeSixByte(Instruction* instr) {
-  // Print the Instruction bits.
-  out_buffer_pos_ +=
-      SNPrintF(out_buffer_ + out_buffer_pos_, "%012" PRIx64 "   ",
-               instr->InstructionBits<SixByteInstr>());
-
-  Opcode opcode = instr->S390OpcodeValue();
-  switch (opcode) {
-    case DUMY:
-      Format(instr, "dumy\t'r1, 'd2 ( 'r2d, 'r3 )");
-      break;
-#define DECODE_VRR_C_INSTRUCTIONS(name, opcode_name, opcode_value) \
-  case opcode_name:                                                \
-    Format(instr, #name "\t'f1,'f2,'f3");                          \
-    break;
-      S390_VRR_C_OPCODE_LIST(DECODE_VRR_C_INSTRUCTIONS)
-#undef DECODE_VRR_C_INSTRUCTIONS
-    case LLILF:
-      Format(instr, "llilf\t'r1,'i7");
-      break;
-    case LLIHF:
-      Format(instr, "llihf\t'r1,'i7");
-      break;
-    case AFI:
-      Format(instr, "afi\t'r1,'i7");
-      break;
-    case AIH:
-      Format(instr, "aih\t'r1,'i7");
-      break;
-    case ASI:
-      Format(instr, "asi\t'd2('r3),'ic");
-      break;
-    case AGSI:
-      Format(instr, "agsi\t'd2('r3),'ic");
-      break;
-    case ALFI:
-      Format(instr, "alfi\t'r1,'i7");
-      break;
-    case AHIK:
-      Format(instr, "ahik\t'r1,'r2,'i1");
-      break;
-    case AGHIK:
-      Format(instr, "aghik\t'r1,'r2,'i1");
-      break;
-    case CLGFI:
-      Format(instr, "clgfi\t'r1,'i7");
-      break;
-    case CLFI:
-      Format(instr, "clfi\t'r1,'i7");
-      break;
-    case CLIH:
-      Format(instr, "clih\t'r1,'i7");
-      break;
-    case CIH:
-      Format(instr, "cih\t'r1,'i2");
-      break;
-    case CFI:
-      Format(instr, "cfi\t'r1,'i2");
-      break;
-    case CGFI:
-      Format(instr, "cgfi\t'r1,'i2");
-      break;
-    case BRASL:
-      Format(instr, "brasl\t'r1,'ie");
-      break;
-    case BRCL:
-      Format(instr, "brcl\t'm1,'i5");
-      break;
-    case IIHF:
-      Format(instr, "iihf\t'r1,'i7");
-      break;
-    case LGFI:
-      Format(instr, "lgfi\t'r1,'i7");
-      break;
-    case IILF:
-      Format(instr, "iilf\t'r1,'i7");
-      break;
-    case XIHF:
-      Format(instr, "xihf\t'r1,'i7");
-      break;
-    case XILF:
-      Format(instr, "xilf\t'r1,'i7");
-      break;
-    case SLLK:
-      Format(instr, "sllk\t'r1,'r2,'d2('r3)");
-      break;
-    case SLLG:
-      Format(instr, "sllg\t'r1,'r2,'d2('r3)");
-      break;
-    case RLL:
-      Format(instr, "rll\t'r1,'r2,'d2('r3)");
-      break;
-    case RLLG:
-      Format(instr, "rllg\t'r1,'r2,'d2('r3)");
-      break;
-    case SRLK:
-      Format(instr, "srlk\t'r1,'r2,'d2('r3)");
-      break;
-    case SRLG:
-      Format(instr, "srlg\t'r1,'r2,'d2('r3)");
-      break;
-    case SLAK:
-      Format(instr, "slak\t'r1,'r2,'d2('r3)");
-      break;
-    case SLAG:
-      Format(instr, "slag\t'r1,'r2,'d2('r3)");
-      break;
-    case SRAK:
-      Format(instr, "srak\t'r1,'r2,'d2('r3)");
-      break;
-    case SRAG:
-      Format(instr, "srag\t'r1,'r2,'d2('r3)");
-      break;
-    case RISBG:
-      Format(instr, "risbg\t'r1,'r2,'i9,'ia,'ib");
-      break;
-    case RISBGN:
-      Format(instr, "risbgn\t'r1,'r2,'i9,'ia,'ib");
-      break;
-    case LOCG:
-      Format(instr, "locg\t'm2,'r1,'d2('r3)");
-      break;
-    case LOC:
-      Format(instr, "loc\t'm2,'r1,'d2('r3)");
-      break;
-    case LMY:
-      Format(instr, "lmy\t'r1,'r2,'d2('r3)");
-      break;
-    case LMG:
-      Format(instr, "lmg\t'r1,'r2,'d2('r3)");
-      break;
-    case CSY:
-      Format(instr, "csy\t'r1,'r2,'d2('r3)");
-      break;
-    case CSG:
-      Format(instr, "csg\t'r1,'r2,'d2('r3)");
-      break;
-    case STMY:
-      Format(instr, "stmy\t'r1,'r2,'d2('r3)");
-      break;
-    case STMG:
-      Format(instr, "stmg\t'r1,'r2,'d2('r3)");
-      break;
-    case LT:
-      Format(instr, "lt\t'r1,'d2('r2d,'r3)");
-      break;
-    case LTG:
-      Format(instr, "ltg\t'r1,'d2('r2d,'r3)");
-      break;
-    case ML:
-      Format(instr, "ml\t'r1,'d2('r2d,'r3)");
-      break;
-    case AY:
-      Format(instr, "ay\t'r1,'d2('r2d,'r3)");
-      break;
-    case SY:
-      Format(instr, "sy\t'r1,'d2('r2d,'r3)");
-      break;
-    case NY:
-      Format(instr, "ny\t'r1,'d2('r2d,'r3)");
-      break;
-    case OY:
-      Format(instr, "oy\t'r1,'d2('r2d,'r3)");
-      break;
-    case XY:
-      Format(instr, "xy\t'r1,'d2('r2d,'r3)");
-      break;
-    case CY:
-      Format(instr, "cy\t'r1,'d2('r2d,'r3)");
-      break;
-    case AHY:
-      Format(instr, "ahy\t'r1,'d2('r2d,'r3)");
-      break;
-    case SHY:
-      Format(instr, "shy\t'r1,'d2('r2d,'r3)");
-      break;
-    case LGH:
-      Format(instr, "lgh\t'r1,'d2('r2d,'r3)");
-      break;
-    case AG:
-      Format(instr, "ag\t'r1,'d2('r2d,'r3)");
-      break;
-    case AGF:
-      Format(instr, "agf\t'r1,'d2('r2d,'r3)");
-      break;
-    case SG:
-      Format(instr, "sg\t'r1,'d2('r2d,'r3)");
-      break;
-    case NG:
-      Format(instr, "ng\t'r1,'d2('r2d,'r3)");
-      break;
-    case OG:
-      Format(instr, "og\t'r1,'d2('r2d,'r3)");
-      break;
-    case XG:
-      Format(instr, "xg\t'r1,'d2('r2d,'r3)");
-      break;
-    case CG:
-      Format(instr, "cg\t'r1,'d2('r2d,'r3)");
-      break;
-    case LB:
-      Format(instr, "lb\t'r1,'d2('r2d,'r3)");
-      break;
-    case LRVH:
-      Format(instr, "lrvh\t'r1,'d2('r2d,'r3)");
-      break;
-    case LRV:
-      Format(instr, "lrv\t'r1,'d2('r2d,'r3)");
-      break;
-    case LRVG:
-      Format(instr, "lrvg\t'r1,'d2('r2d,'r3)");
-      break;
-    case LG:
-      Format(instr, "lg\t'r1,'d2('r2d,'r3)");
-      break;
-    case LGF:
-      Format(instr, "lgf\t'r1,'d2('r2d,'r3)");
-      break;
-    case LLGF:
-      Format(instr, "llgf\t'r1,'d2('r2d,'r3)");
-      break;
-    case LY:
-      Format(instr, "ly\t'r1,'d2('r2d,'r3)");
-      break;
-    case ALY:
-      Format(instr, "aly\t'r1,'d2('r2d,'r3)");
-      break;
-    case ALG:
-      Format(instr, "alg\t'r1,'d2('r2d,'r3)");
-      break;
-    case SLG:
-      Format(instr, "slg\t'r1,'d2('r2d,'r3)");
-      break;
-    case SGF:
-      Format(instr, "sgf\t'r1,'d2('r2d,'r3)");
-      break;
-    case SLY:
-      Format(instr, "sly\t'r1,'d2('r2d,'r3)");
-      break;
-    case LLH:
-      Format(instr, "llh\t'r1,'d2('r2d,'r3)");
-      break;
-    case LLGH:
-      Format(instr, "llgh\t'r1,'d2('r2d,'r3)");
-      break;
-    case LLC:
-      Format(instr, "llc\t'r1,'d2('r2d,'r3)");
-      break;
-    case LLGC:
-      Format(instr, "llgc\t'r1,'d2('r2d,'r3)");
-      break;
-    case LDEB:
-      Format(instr, "ldeb\t'f1,'d2('r2d,'r3)");
-      break;
-    case LAY:
-      Format(instr, "lay\t'r1,'d2('r2d,'r3)");
-      break;
-    case LARL:
-      Format(instr, "larl\t'r1,'i5");
-      break;
-    case LGB:
-      Format(instr, "lgb\t'r1,'d2('r2d,'r3)");
-      break;
-    case CHY:
-      Format(instr, "chy\t'r1,'d2('r2d,'r3)");
-      break;
-    case CLY:
-      Format(instr, "cly\t'r1,'d2('r2d,'r3)");
-      break;
-    case CLIY:
-      Format(instr, "cliy\t'd2('r3),'i8");
-      break;
-    case TMY:
-      Format(instr, "tmy\t'd2('r3),'i8");
-      break;
-    case CLG:
-      Format(instr, "clg\t'r1,'d2('r2d,'r3)");
-      break;
-    case BCTG:
-      Format(instr, "bctg\t'r1,'d2('r2d,'r3)");
-      break;
-    case STY:
-      Format(instr, "sty\t'r1,'d2('r2d,'r3)");
-      break;
-    case STRVH:
-      Format(instr, "strvh\t'r1,'d2('r2d,'r3)");
-      break;
-    case STRV:
-      Format(instr, "strv\t'r1,'d2('r2d,'r3)");
-      break;
-    case STRVG:
-      Format(instr, "strvg\t'r1,'d2('r2d,'r3)");
-      break;
-    case STG:
-      Format(instr, "stg\t'r1,'d2('r2d,'r3)");
-      break;
-    case ICY:
-      Format(instr, "icy\t'r1,'d2('r2d,'r3)");
-      break;
-    case MVC:
-      Format(instr, "mvc\t'd3('i8,'r3),'d4('r7)");
-      break;
-    case MVHI:
-      Format(instr, "mvhi\t'd3('r3),'id");
-      break;
-    case MVGHI:
-      Format(instr, "mvghi\t'd3('r3),'id");
-      break;
-    case ALGFI:
-      Format(instr, "algfi\t'r1,'i7");
-      break;
-    case SLGFI:
-      Format(instr, "slgfi\t'r1,'i7");
-      break;
-    case SLFI:
-      Format(instr, "slfi\t'r1,'i7");
-      break;
-    case NIHF:
-      Format(instr, "nihf\t'r1,'i7");
-      break;
-    case NILF:
-      Format(instr, "nilf\t'r1,'i7");
-      break;
-    case OIHF:
-      Format(instr, "oihf\t'r1,'i7");
-      break;
-    case OILF:
-      Format(instr, "oilf\t'r1,'i7");
-      break;
-    case MSFI:
-      Format(instr, "msfi\t'r1,'i7");
-      break;
-    case MSGFI:
-      Format(instr, "msgfi\t'r1,'i7");
-      break;
-    case LDY:
-      Format(instr, "ldy\t'f1,'d2('r2d,'r3)");
-      break;
-    case LEY:
-      Format(instr, "ley\t'f1,'d2('r2d,'r3)");
-      break;
-    case MSG:
-      Format(instr, "msg\t'r1,'d2('r2d,'r3)");
-      break;
-    case DSG:
-      Format(instr, "dsg\t'r1,'d2('r2d,'r3)");
-      break;
-    case DSGF:
-      Format(instr, "dsgf\t'r1,'d2('r2d,'r3)");
-      break;
-    case MSGF:
-      Format(instr, "msgf\t'r1,'d2('r2d,'r3)");
-      break;
-    case MSY:
-      Format(instr, "msy\t'r1,'d2('r2d,'r3)");
-      break;
-    case MSC:
-      Format(instr, "msc\t'r1,'d2('r2d,'r3)");
-      break;
-    case MSGC:
-      Format(instr, "msgc\t'r1,'d2('r2d,'r3)");
-      break;
-    case STEY:
-      Format(instr, "stey\t'f1,'d2('r2d,'r3)");
-      break;
-    case STDY:
-      Format(instr, "stdy\t'f1,'d2('r2d,'r3)");
-      break;
-    case ADB:
-      Format(instr, "adb\t'f1,'d1('r2d, 'r3)");
-      break;
-    case AEB:
-      Format(instr, "aeb\t'f1,'d1('r2d, 'r3)");
-      break;
-    case CDB:
-      Format(instr, "cdb\t'f1,'d1('r2d, 'r3)");
-      break;
-    case CEB:
-      Format(instr, "ceb\t'f1,'d1('r2d, 'r3)");
-      break;
-    case SDB:
-      Format(instr, "sdb\t'r1,'d1('r2d, 'r3)");
-      break;
-    case SEB:
-      Format(instr, "seb\t'r1,'d1('r2d, 'r3)");
-      break;
-    case MDB:
-      Format(instr, "mdb\t'r1,'d1('r2d, 'r3)");
-      break;
-    case MEEB:
-      Format(instr, "meeb\t'r1,'d1('r2d, 'r3)");
-      break;
-    case DDB:
-      Format(instr, "ddb\t'r1,'d1('r2d, 'r3)");
-      break;
-    case DEB:
-      Format(instr, "deb\t'r1,'d1('r2d, 'r3)");
-      break;
-    case SQDB:
-      Format(instr, "sqdb\t'r1,'d1('r2d, 'r3)");
-      break;
-    case PFD:
-      Format(instr, "pfd\t'm1,'d2('r2d,'r3)");
-      break;
-    default:
-      return false;
-  }
-  return true;
-}
-
-#undef VERIFIY
-
-// Disassemble the instruction at *instr_ptr into the output buffer.
-int Decoder::InstructionDecode(byte* instr_ptr) {
-  Instruction* instr = Instruction::At(instr_ptr);
-  int instrLength = instr->InstructionLength();
-
-  if (2 == instrLength)
-    DecodeTwoByte(instr);
-  else if (4 == instrLength)
-    DecodeFourByte(instr);
-  else
-    DecodeSixByte(instr);
-
-  return instrLength;
-}
-
-}  // namespace internal
-}  // namespace v8
-
-//------------------------------------------------------------------------------
-
-namespace disasm {
-
-const char* NameConverter::NameOfAddress(byte* addr) const {
-  v8::internal::SNPrintF(tmp_buffer_, "%p", static_cast<void*>(addr));
-  return tmp_buffer_.start();
-}
-
-const char* NameConverter::NameOfConstant(byte* addr) const {
-  return NameOfAddress(addr);
-}
-
-const char* NameConverter::NameOfCPURegister(int reg) const {
-  return v8::internal::GetRegConfig()->GetGeneralRegisterName(reg);
-}
-
-const char* NameConverter::NameOfByteCPURegister(int reg) const {
-  UNREACHABLE();  // S390 does not have the concept of a byte register
-  return "nobytereg";
-}
-
-const char* NameConverter::NameOfXMMRegister(int reg) const {
-  // S390 does not have XMM register
-  // TODO(joransiu): Consider update this for Vector Regs
-  UNREACHABLE();
-}
-
-const char* NameConverter::NameInCode(byte* addr) const {
-  // The default name converter is called for unknown code. So we will not try
-  // to access any memory.
-  return "";
-}
-
-//------------------------------------------------------------------------------
-
-Disassembler::Disassembler(const NameConverter& converter)
-    : converter_(converter) {}
-
-Disassembler::~Disassembler() {}
-
-int Disassembler::InstructionDecode(v8::internal::Vector<char> buffer,
-                                    byte* instruction) {
-  v8::internal::Decoder d(converter_, buffer);
-  return d.InstructionDecode(instruction);
-}
-
-// The S390 assembler does not currently use constant pools.
-int Disassembler::ConstantPoolSizeAt(byte* instruction) { return -1; }
-
-void Disassembler::Disassemble(FILE* f, byte* begin, byte* end) {
-  NameConverter converter;
-  Disassembler d(converter);
-  for (byte* pc = begin; pc < end;) {
-    v8::internal::EmbeddedVector<char, 128> buffer;
-    buffer[0] = '\0';
-    byte* prev_pc = pc;
-    pc += d.InstructionDecode(buffer, pc);
-    v8::internal::PrintF(f, "%p    %08x      %s\n", static_cast<void*>(prev_pc),
-                         *reinterpret_cast<int32_t*>(prev_pc), buffer.start());
-  }
-}
-
-}  // namespace disasm
-
-#endif  // V8_TARGET_ARCH_S390
diff --git a/src/v8/src/s390/frame-constants-s390.cc b/src/v8/src/s390/frame-constants-s390.cc
deleted file mode 100644
index ca4a191..0000000
--- a/src/v8/src/s390/frame-constants-s390.cc
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2015 the V8 project 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 V8_TARGET_ARCH_S390
-
-#include "src/assembler.h"
-#include "src/frame-constants.h"
-#include "src/macro-assembler.h"
-#include "src/s390/assembler-s390-inl.h"
-#include "src/s390/assembler-s390.h"
-#include "src/s390/macro-assembler-s390.h"
-
-#include "src/s390/frame-constants-s390.h"
-
-namespace v8 {
-namespace internal {
-
-Register JavaScriptFrame::fp_register() { return v8::internal::fp; }
-Register JavaScriptFrame::context_register() { return cp; }
-Register JavaScriptFrame::constant_pool_pointer_register() { UNREACHABLE(); }
-
-int InterpreterFrameConstants::RegisterStackSlotCount(int register_count) {
-  return register_count;
-}
-
-int BuiltinContinuationFrameConstants::PaddingSlotCount(int register_count) {
-  USE(register_count);
-  return 0;
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_S390
diff --git a/src/v8/src/s390/frame-constants-s390.h b/src/v8/src/s390/frame-constants-s390.h
deleted file mode 100644
index 3c2a4c8..0000000
--- a/src/v8/src/s390/frame-constants-s390.h
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_S390_FRAMES_S390_H_
-#define V8_S390_FRAMES_S390_H_
-
-namespace v8 {
-namespace internal {
-
-class EntryFrameConstants : public AllStatic {
- public:
-  static const int kCallerFPOffset =
-      -(StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize);
-};
-
-class ExitFrameConstants : public TypedFrameConstants {
- public:
-  static const int kSPOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(0);
-  static const int kCodeOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(1);
-  DEFINE_TYPED_FRAME_SIZES(2);
-
-  // The caller fields are below the frame pointer on the stack.
-  static const int kCallerFPOffset = 0 * kPointerSize;
-  // The calling JS function is below FP.
-  static const int kCallerPCOffset = 1 * kPointerSize;
-
-  // FP-relative displacement of the caller's SP.  It points just
-  // below the saved PC.
-  static const int kCallerSPDisplacement = 2 * kPointerSize;
-};
-
-class JavaScriptFrameConstants : public AllStatic {
- public:
-  // FP-relative.
-  static const int kLocal0Offset = StandardFrameConstants::kExpressionsOffset;
-  static const int kLastParameterOffset = +2 * kPointerSize;
-  static const int kFunctionOffset = StandardFrameConstants::kFunctionOffset;
-
-  // Caller SP-relative.
-  static const int kParam0Offset = -2 * kPointerSize;
-  static const int kReceiverOffset = -1 * kPointerSize;
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_S390_FRAMES_S390_H_
diff --git a/src/v8/src/s390/interface-descriptors-s390.cc b/src/v8/src/s390/interface-descriptors-s390.cc
deleted file mode 100644
index 3cb4f2e..0000000
--- a/src/v8/src/s390/interface-descriptors-s390.cc
+++ /dev/null
@@ -1,344 +0,0 @@
-// Copyright 2015 the V8 project 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 V8_TARGET_ARCH_S390
-
-#include "src/interface-descriptors.h"
-
-namespace v8 {
-namespace internal {
-
-const Register CallInterfaceDescriptor::ContextRegister() { return cp; }
-
-void CallInterfaceDescriptor::DefaultInitializePlatformSpecific(
-    CallInterfaceDescriptorData* data, int register_parameter_count) {
-  const Register default_stub_registers[] = {r2, r3, r4, r5, r6};
-  CHECK_LE(static_cast<size_t>(register_parameter_count),
-           arraysize(default_stub_registers));
-  data->InitializePlatformSpecific(register_parameter_count,
-                                   default_stub_registers);
-}
-
-void RecordWriteDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  const Register default_stub_registers[] = {r2, r3, r4, r5, r6};
-
-  data->RestrictAllocatableRegisters(default_stub_registers,
-                                     arraysize(default_stub_registers));
-
-  CHECK_LE(static_cast<size_t>(kParameterCount),
-           arraysize(default_stub_registers));
-  data->InitializePlatformSpecific(kParameterCount, default_stub_registers);
-}
-
-const Register FastNewFunctionContextDescriptor::FunctionRegister() {
-  return r3;
-}
-const Register FastNewFunctionContextDescriptor::SlotsRegister() { return r2; }
-
-const Register LoadDescriptor::ReceiverRegister() { return r3; }
-const Register LoadDescriptor::NameRegister() { return r4; }
-const Register LoadDescriptor::SlotRegister() { return r2; }
-
-const Register LoadWithVectorDescriptor::VectorRegister() { return r5; }
-
-const Register StoreDescriptor::ReceiverRegister() { return r3; }
-const Register StoreDescriptor::NameRegister() { return r4; }
-const Register StoreDescriptor::ValueRegister() { return r2; }
-const Register StoreDescriptor::SlotRegister() { return r6; }
-
-const Register StoreWithVectorDescriptor::VectorRegister() { return r5; }
-
-const Register StoreTransitionDescriptor::SlotRegister() { return r6; }
-const Register StoreTransitionDescriptor::VectorRegister() { return r5; }
-const Register StoreTransitionDescriptor::MapRegister() { return r7; }
-
-const Register ApiGetterDescriptor::HolderRegister() { return r2; }
-const Register ApiGetterDescriptor::CallbackRegister() { return r5; }
-
-const Register MathPowTaggedDescriptor::exponent() { return r4; }
-
-const Register MathPowIntegerDescriptor::exponent() {
-  return MathPowTaggedDescriptor::exponent();
-}
-
-const Register GrowArrayElementsDescriptor::ObjectRegister() { return r2; }
-const Register GrowArrayElementsDescriptor::KeyRegister() { return r5; }
-
-void FastNewClosureDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {r3, r4, r5};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-// static
-const Register TypeConversionDescriptor::ArgumentRegister() { return r2; }
-
-void TypeofDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {r5};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallFunctionDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {r3};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallTrampolineDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r2 : number of arguments
-  // r3 : the target to call
-  Register registers[] = {r3, r2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r2 : number of arguments (on the stack, not including receiver)
-  // r3 : the target to call
-  // r4 : arguments list (FixedArray)
-  // r6 : arguments list length (untagged)
-  Register registers[] = {r3, r2, r4, r6};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallForwardVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r2 : number of arguments
-  // r4 : start index (to support rest parameters)
-  // r3 : the target to call
-  Register registers[] = {r3, r2, r4};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallWithSpreadDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r2 : number of arguments (on the stack, not including receiver)
-  // r3 : the target to call
-  // r4 : the object to spread
-  Register registers[] = {r3, r2, r4};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallWithArrayLikeDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r3 : the target to call
-  // r4 : the arguments list
-  Register registers[] = {r3, r4};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r2 : number of arguments (on the stack, not including receiver)
-  // r3 : the target to call
-  // r5 : the new target
-  // r4 : arguments list (FixedArray)
-  // r6 : arguments list length (untagged)
-  Register registers[] = {r3, r5, r2, r4, r6};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructForwardVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r2 : number of arguments
-  // r5 : the new target
-  // r4 : start index (to support rest parameters)
-  // r3 : the target to call
-  Register registers[] = {r3, r5, r2, r4};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructWithSpreadDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r2 : number of arguments (on the stack, not including receiver)
-  // r3 : the target to call
-  // r5 : the new target
-  // r4 : the object to spread
-  Register registers[] = {r3, r5, r2, r4};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructWithArrayLikeDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r3 : the target to call
-  // r5 : the new target
-  // r4 : the arguments list
-  Register registers[] = {r3, r5, r4};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructStubDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r2 : number of arguments
-  // r3 : the target to call
-  // r5 : the new target
-  // r4 : allocation site or undefined
-  Register registers[] = {r3, r5, r2, r4};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructTrampolineDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // r2 : number of arguments
-  // r3 : the target to call
-  // r5 : the new target
-  Register registers[] = {r3, r5, r2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void TransitionElementsKindDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {r2, r3};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void AbortJSDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {r3};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void AllocateHeapNumberDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  data->InitializePlatformSpecific(0, nullptr, nullptr);
-}
-
-void ArrayConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // kTarget, kNewTarget, kActualArgumentsCount, kAllocationSite
-  Register registers[] = {r3, r5, r2, r4};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void ArrayNoArgumentConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // register state
-  // r2 -- number of arguments
-  // r3 -- function
-  // r4 -- allocation site with elements kind
-  Register registers[] = {r3, r4, r2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ArraySingleArgumentConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // register state
-  // r2 -- number of arguments
-  // r3 -- function
-  // r4 -- allocation site with elements kind
-  Register registers[] = {r3, r4, r2};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void ArrayNArgumentsConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // stack param count needs (constructor pointer, and single argument)
-  Register registers[] = {r3, r4, r2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CompareDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {r3, r2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void BinaryOpDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {r3, r2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void StringAddDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {r3, r2};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ArgumentAdaptorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      r3,  // JSFunction
-      r5,  // the new target
-      r2,  // actual number of arguments
-      r4,  // expected number of arguments
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ApiCallbackDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      JavaScriptFrame::context_register(),  // callee context
-      r6,                                   // call_data
-      r4,                                   // holder
-      r3,                                   // api_function_address
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterDispatchDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      kInterpreterAccumulatorRegister, kInterpreterBytecodeOffsetRegister,
-      kInterpreterBytecodeArrayRegister, kInterpreterDispatchTableRegister};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterPushArgsThenCallDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      r2,  // argument count (not including receiver)
-      r4,  // address of first argument
-      r3   // the target callable to be call
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterPushArgsThenConstructDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      r2,  // argument count (not including receiver)
-      r5,  // new target
-      r3,  // constructor to call
-      r4,  // allocation site feedback if available, undefined otherwise
-      r6   // address of the first argument
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterCEntryDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      r2,  // argument count (argc)
-      r4,  // address of first argument (argv)
-      r3   // the runtime function to call
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ResumeGeneratorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      r2,  // the value to pass to the generator
-      r3   // the JSGeneratorObject to resume
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void FrameDropperTrampolineDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      r3,  // loaded new FP
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_S390
diff --git a/src/v8/src/s390/macro-assembler-s390.cc b/src/v8/src/s390/macro-assembler-s390.cc
deleted file mode 100644
index fe24884..0000000
--- a/src/v8/src/s390/macro-assembler-s390.cc
+++ /dev/null
@@ -1,4275 +0,0 @@
-// Copyright 2014 the V8 project 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 <assert.h>  // For assert
-#include <limits.h>  // For LONG_MIN, LONG_MAX.
-
-#if V8_TARGET_ARCH_S390
-
-#include "src/base/bits.h"
-#include "src/base/division-by-constant.h"
-#include "src/bootstrapper.h"
-#include "src/callable.h"
-#include "src/code-stubs.h"
-#include "src/debug/debug.h"
-#include "src/external-reference-table.h"
-#include "src/frames-inl.h"
-#include "src/register-configuration.h"
-#include "src/runtime/runtime.h"
-
-#include "src/s390/macro-assembler-s390.h"
-
-namespace v8 {
-namespace internal {
-
-MacroAssembler::MacroAssembler(Isolate* isolate, void* buffer, int size,
-                               CodeObjectRequired create_code_object)
-    : TurboAssembler(isolate, buffer, size, create_code_object) {}
-
-TurboAssembler::TurboAssembler(Isolate* isolate, void* buffer, int buffer_size,
-                               CodeObjectRequired create_code_object)
-    : Assembler(isolate, buffer, buffer_size), isolate_(isolate) {
-  if (create_code_object == CodeObjectRequired::kYes) {
-    code_object_ =
-        Handle<HeapObject>::New(isolate->heap()->undefined_value(), isolate);
-  }
-}
-
-int TurboAssembler::RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode,
-                                                    Register exclusion1,
-                                                    Register exclusion2,
-                                                    Register exclusion3) const {
-  int bytes = 0;
-  RegList exclusions = 0;
-  if (exclusion1 != no_reg) {
-    exclusions |= exclusion1.bit();
-    if (exclusion2 != no_reg) {
-      exclusions |= exclusion2.bit();
-      if (exclusion3 != no_reg) {
-        exclusions |= exclusion3.bit();
-      }
-    }
-  }
-
-  RegList list = kJSCallerSaved & ~exclusions;
-  bytes += NumRegs(list) * kPointerSize;
-
-  if (fp_mode == kSaveFPRegs) {
-    bytes += NumRegs(kCallerSavedDoubles) * kDoubleSize;
-  }
-
-  return bytes;
-}
-
-int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
-                                    Register exclusion2, Register exclusion3) {
-  int bytes = 0;
-  RegList exclusions = 0;
-  if (exclusion1 != no_reg) {
-    exclusions |= exclusion1.bit();
-    if (exclusion2 != no_reg) {
-      exclusions |= exclusion2.bit();
-      if (exclusion3 != no_reg) {
-        exclusions |= exclusion3.bit();
-      }
-    }
-  }
-
-  RegList list = kJSCallerSaved & ~exclusions;
-  MultiPush(list);
-  bytes += NumRegs(list) * kPointerSize;
-
-  if (fp_mode == kSaveFPRegs) {
-    MultiPushDoubles(kCallerSavedDoubles);
-    bytes += NumRegs(kCallerSavedDoubles) * kDoubleSize;
-  }
-
-  return bytes;
-}
-
-int TurboAssembler::PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
-                                   Register exclusion2, Register exclusion3) {
-  int bytes = 0;
-  if (fp_mode == kSaveFPRegs) {
-    MultiPopDoubles(kCallerSavedDoubles);
-    bytes += NumRegs(kCallerSavedDoubles) * kDoubleSize;
-  }
-
-  RegList exclusions = 0;
-  if (exclusion1 != no_reg) {
-    exclusions |= exclusion1.bit();
-    if (exclusion2 != no_reg) {
-      exclusions |= exclusion2.bit();
-      if (exclusion3 != no_reg) {
-        exclusions |= exclusion3.bit();
-      }
-    }
-  }
-
-  RegList list = kJSCallerSaved & ~exclusions;
-  MultiPop(list);
-  bytes += NumRegs(list) * kPointerSize;
-
-  return bytes;
-}
-
-void TurboAssembler::Jump(Register target) { b(target); }
-
-void MacroAssembler::JumpToJSEntry(Register target) {
-  Move(ip, target);
-  Jump(ip);
-}
-
-void TurboAssembler::Jump(intptr_t target, RelocInfo::Mode rmode,
-                          Condition cond, CRegister) {
-  Label skip;
-
-  if (cond != al) b(NegateCondition(cond), &skip);
-
-  DCHECK(rmode == RelocInfo::CODE_TARGET || rmode == RelocInfo::RUNTIME_ENTRY);
-
-  mov(ip, Operand(target, rmode));
-  b(ip);
-
-  bind(&skip);
-}
-
-void TurboAssembler::Jump(Address target, RelocInfo::Mode rmode, Condition cond,
-                          CRegister cr) {
-  DCHECK(!RelocInfo::IsCodeTarget(rmode));
-  Jump(reinterpret_cast<intptr_t>(target), rmode, cond, cr);
-}
-
-void TurboAssembler::Jump(Handle<Code> code, RelocInfo::Mode rmode,
-                          Condition cond) {
-  DCHECK(RelocInfo::IsCodeTarget(rmode));
-  jump(code, rmode, cond);
-}
-
-int TurboAssembler::CallSize(Register target) { return 2; }  // BASR
-
-void TurboAssembler::Call(Register target) {
-  Label start;
-  bind(&start);
-
-  // Branch to target via indirect branch
-  basr(r14, target);
-
-  DCHECK_EQ(CallSize(target), SizeOfCodeGeneratedSince(&start));
-}
-
-void MacroAssembler::CallJSEntry(Register target) {
-  DCHECK(target == ip);
-  Call(target);
-}
-
-int TurboAssembler::CallSize(Address target, RelocInfo::Mode rmode,
-                             Condition cond) {
-  // S390 Assembler::move sequence is IILF / IIHF
-  int size;
-#if V8_TARGET_ARCH_S390X
-  size = 14;  // IILF + IIHF + BASR
-#else
-  size = 8;  // IILF + BASR
-#endif
-  return size;
-}
-
-int MacroAssembler::CallSizeNotPredictableCodeSize(Address target,
-                                                   RelocInfo::Mode rmode,
-                                                   Condition cond) {
-  // S390 Assembler::move sequence is IILF / IIHF
-  int size;
-#if V8_TARGET_ARCH_S390X
-  size = 14;  // IILF + IIHF + BASR
-#else
-  size = 8;  // IILF + BASR
-#endif
-  return size;
-}
-
-void TurboAssembler::Call(Address target, RelocInfo::Mode rmode,
-                          Condition cond) {
-  DCHECK(cond == al);
-
-#ifdef DEBUG
-  // Check the expected size before generating code to ensure we assume the same
-  // constant pool availability (e.g., whether constant pool is full or not).
-  int expected_size = CallSize(target, rmode, cond);
-  Label start;
-  bind(&start);
-#endif
-
-  mov(ip, Operand(reinterpret_cast<intptr_t>(target), rmode));
-  basr(r14, ip);
-
-  DCHECK_EQ(expected_size, SizeOfCodeGeneratedSince(&start));
-}
-
-int TurboAssembler::CallSize(Handle<Code> code, RelocInfo::Mode rmode,
-                             Condition cond) {
-  return 6;  // BRASL
-}
-
-void TurboAssembler::Call(Handle<Code> code, RelocInfo::Mode rmode,
-                          Condition cond) {
-  DCHECK(RelocInfo::IsCodeTarget(rmode) && cond == al);
-
-#ifdef DEBUG
-  // Check the expected size before generating code to ensure we assume the same
-  // constant pool availability (e.g., whether constant pool is full or not).
-  int expected_size = CallSize(code, rmode, cond);
-  Label start;
-  bind(&start);
-#endif
-  call(code, rmode);
-  DCHECK_EQ(expected_size, SizeOfCodeGeneratedSince(&start));
-}
-
-void TurboAssembler::Drop(int count) {
-  if (count > 0) {
-    int total = count * kPointerSize;
-    if (is_uint12(total)) {
-      la(sp, MemOperand(sp, total));
-    } else if (is_int20(total)) {
-      lay(sp, MemOperand(sp, total));
-    } else {
-      AddP(sp, Operand(total));
-    }
-  }
-}
-
-void TurboAssembler::Drop(Register count, Register scratch) {
-  ShiftLeftP(scratch, count, Operand(kPointerSizeLog2));
-  AddP(sp, sp, scratch);
-}
-
-void TurboAssembler::Call(Label* target) { b(r14, target); }
-
-void TurboAssembler::Push(Handle<HeapObject> handle) {
-  mov(r0, Operand(handle));
-  push(r0);
-}
-
-void TurboAssembler::Push(Smi* smi) {
-  mov(r0, Operand(smi));
-  push(r0);
-}
-
-void TurboAssembler::Move(Register dst, Handle<HeapObject> value) {
-  mov(dst, Operand(value));
-}
-
-void TurboAssembler::Move(Register dst, Register src, Condition cond) {
-  if (dst != src) {
-    LoadRR(dst, src);
-  }
-}
-
-void TurboAssembler::Move(DoubleRegister dst, DoubleRegister src) {
-  if (dst != src) {
-    ldr(dst, src);
-  }
-}
-
-void TurboAssembler::MultiPush(RegList regs, Register location) {
-  int16_t num_to_push = base::bits::CountPopulation(regs);
-  int16_t stack_offset = num_to_push * kPointerSize;
-
-  SubP(location, location, Operand(stack_offset));
-  for (int16_t i = Register::kNumRegisters - 1; i >= 0; i--) {
-    if ((regs & (1 << i)) != 0) {
-      stack_offset -= kPointerSize;
-      StoreP(ToRegister(i), MemOperand(location, stack_offset));
-    }
-  }
-}
-
-void TurboAssembler::MultiPop(RegList regs, Register location) {
-  int16_t stack_offset = 0;
-
-  for (int16_t i = 0; i < Register::kNumRegisters; i++) {
-    if ((regs & (1 << i)) != 0) {
-      LoadP(ToRegister(i), MemOperand(location, stack_offset));
-      stack_offset += kPointerSize;
-    }
-  }
-  AddP(location, location, Operand(stack_offset));
-}
-
-void TurboAssembler::MultiPushDoubles(RegList dregs, Register location) {
-  int16_t num_to_push = base::bits::CountPopulation(dregs);
-  int16_t stack_offset = num_to_push * kDoubleSize;
-
-  SubP(location, location, Operand(stack_offset));
-  for (int16_t i = DoubleRegister::kNumRegisters - 1; i >= 0; i--) {
-    if ((dregs & (1 << i)) != 0) {
-      DoubleRegister dreg = DoubleRegister::from_code(i);
-      stack_offset -= kDoubleSize;
-      StoreDouble(dreg, MemOperand(location, stack_offset));
-    }
-  }
-}
-
-void TurboAssembler::MultiPopDoubles(RegList dregs, Register location) {
-  int16_t stack_offset = 0;
-
-  for (int16_t i = 0; i < DoubleRegister::kNumRegisters; i++) {
-    if ((dregs & (1 << i)) != 0) {
-      DoubleRegister dreg = DoubleRegister::from_code(i);
-      LoadDouble(dreg, MemOperand(location, stack_offset));
-      stack_offset += kDoubleSize;
-    }
-  }
-  AddP(location, location, Operand(stack_offset));
-}
-
-void TurboAssembler::LoadRoot(Register destination, Heap::RootListIndex index,
-                              Condition) {
-  LoadP(destination, MemOperand(kRootRegister, index << kPointerSizeLog2), r0);
-}
-
-void MacroAssembler::RecordWriteField(Register object, int offset,
-                                      Register value, Register dst,
-                                      LinkRegisterStatus lr_status,
-                                      SaveFPRegsMode save_fp,
-                                      RememberedSetAction remembered_set_action,
-                                      SmiCheck smi_check) {
-  // First, check if a write barrier is even needed. The tests below
-  // catch stores of Smis.
-  Label done;
-
-  // Skip barrier if writing a smi.
-  if (smi_check == INLINE_SMI_CHECK) {
-    JumpIfSmi(value, &done);
-  }
-
-  // Although the object register is tagged, the offset is relative to the start
-  // of the object, so so offset must be a multiple of kPointerSize.
-  DCHECK(IsAligned(offset, kPointerSize));
-
-  lay(dst, MemOperand(object, offset - kHeapObjectTag));
-  if (emit_debug_code()) {
-    Label ok;
-    AndP(r0, dst, Operand(kPointerSize - 1));
-    beq(&ok, Label::kNear);
-    stop("Unaligned cell in write barrier");
-    bind(&ok);
-  }
-
-  RecordWrite(object, dst, value, lr_status, save_fp, remembered_set_action,
-              OMIT_SMI_CHECK);
-
-  bind(&done);
-
-  // Clobber clobbered input registers when running with the debug-code flag
-  // turned on to provoke errors.
-  if (emit_debug_code()) {
-    mov(value, Operand(bit_cast<intptr_t>(kZapValue + 4)));
-    mov(dst, Operand(bit_cast<intptr_t>(kZapValue + 8)));
-  }
-}
-
-void TurboAssembler::SaveRegisters(RegList registers) {
-  DCHECK_GT(NumRegs(registers), 0);
-  RegList regs = 0;
-  for (int i = 0; i < Register::kNumRegisters; ++i) {
-    if ((registers >> i) & 1u) {
-      regs |= Register::from_code(i).bit();
-    }
-  }
-  MultiPush(regs);
-}
-
-void TurboAssembler::RestoreRegisters(RegList registers) {
-  DCHECK_GT(NumRegs(registers), 0);
-  RegList regs = 0;
-  for (int i = 0; i < Register::kNumRegisters; ++i) {
-    if ((registers >> i) & 1u) {
-      regs |= Register::from_code(i).bit();
-    }
-  }
-  MultiPop(regs);
-}
-
-void TurboAssembler::CallRecordWriteStub(
-    Register object, Register address,
-    RememberedSetAction remembered_set_action, SaveFPRegsMode fp_mode) {
-  // TODO(albertnetymk): For now we ignore remembered_set_action and fp_mode,
-  // i.e. always emit remember set and save FP registers in RecordWriteStub. If
-  // large performance regression is observed, we should use these values to
-  // avoid unnecessary work.
-
-  Callable const callable =
-      Builtins::CallableFor(isolate(), Builtins::kRecordWrite);
-  RegList registers = callable.descriptor().allocatable_registers();
-
-  SaveRegisters(registers);
-  Register object_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kObject));
-  Register slot_parameter(
-      callable.descriptor().GetRegisterParameter(RecordWriteDescriptor::kSlot));
-  Register isolate_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kIsolate));
-  Register remembered_set_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kRememberedSet));
-  Register fp_mode_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kFPMode));
-
-  Push(object);
-  Push(address);
-
-  Pop(slot_parameter);
-  Pop(object_parameter);
-
-  mov(isolate_parameter,
-      Operand(ExternalReference::isolate_address(isolate())));
-  Move(remembered_set_parameter, Smi::FromEnum(remembered_set_action));
-  Move(fp_mode_parameter, Smi::FromEnum(fp_mode));
-  Call(callable.code(), RelocInfo::CODE_TARGET);
-
-  RestoreRegisters(registers);
-}
-
-// Will clobber 4 registers: object, address, scratch, ip.  The
-// register 'object' contains a heap object pointer.  The heap object
-// tag is shifted away.
-void MacroAssembler::RecordWrite(Register object, Register address,
-                                 Register value, LinkRegisterStatus lr_status,
-                                 SaveFPRegsMode fp_mode,
-                                 RememberedSetAction remembered_set_action,
-                                 SmiCheck smi_check) {
-  DCHECK(object != value);
-  if (emit_debug_code()) {
-    CmpP(value, MemOperand(address));
-    Check(eq, AbortReason::kWrongAddressOrValuePassedToRecordWrite);
-  }
-
-  if (remembered_set_action == OMIT_REMEMBERED_SET &&
-      !FLAG_incremental_marking) {
-    return;
-  }
-  // First, check if a write barrier is even needed. The tests below
-  // catch stores of smis and stores into the young generation.
-  Label done;
-
-  if (smi_check == INLINE_SMI_CHECK) {
-    JumpIfSmi(value, &done);
-  }
-
-  CheckPageFlag(value,
-                value,  // Used as scratch.
-                MemoryChunk::kPointersToHereAreInterestingMask, eq, &done);
-  CheckPageFlag(object,
-                value,  // Used as scratch.
-                MemoryChunk::kPointersFromHereAreInterestingMask, eq, &done);
-
-  // Record the actual write.
-  if (lr_status == kLRHasNotBeenSaved) {
-    push(r14);
-  }
-  CallRecordWriteStub(object, address, remembered_set_action, fp_mode);
-  if (lr_status == kLRHasNotBeenSaved) {
-    pop(r14);
-  }
-
-  bind(&done);
-
-  // Count number of write barriers in generated code.
-  isolate()->counters()->write_barriers_static()->Increment();
-  IncrementCounter(isolate()->counters()->write_barriers_dynamic(), 1, ip,
-                   value);
-
-  // Clobber clobbered registers when running with the debug-code flag
-  // turned on to provoke errors.
-  if (emit_debug_code()) {
-    mov(address, Operand(bit_cast<intptr_t>(kZapValue + 12)));
-    mov(value, Operand(bit_cast<intptr_t>(kZapValue + 16)));
-  }
-}
-
-void TurboAssembler::PushCommonFrame(Register marker_reg) {
-  int fp_delta = 0;
-  CleanseP(r14);
-  if (marker_reg.is_valid()) {
-    Push(r14, fp, marker_reg);
-    fp_delta = 1;
-  } else {
-    Push(r14, fp);
-    fp_delta = 0;
-  }
-  la(fp, MemOperand(sp, fp_delta * kPointerSize));
-}
-
-void TurboAssembler::PopCommonFrame(Register marker_reg) {
-  if (marker_reg.is_valid()) {
-    Pop(r14, fp, marker_reg);
-  } else {
-    Pop(r14, fp);
-  }
-}
-
-void TurboAssembler::PushStandardFrame(Register function_reg) {
-  int fp_delta = 0;
-  CleanseP(r14);
-  if (function_reg.is_valid()) {
-    Push(r14, fp, cp, function_reg);
-    fp_delta = 2;
-  } else {
-    Push(r14, fp, cp);
-    fp_delta = 1;
-  }
-  la(fp, MemOperand(sp, fp_delta * kPointerSize));
-}
-
-void TurboAssembler::RestoreFrameStateForTailCall() {
-  // if (FLAG_enable_embedded_constant_pool) {
-  //   LoadP(kConstantPoolRegister,
-  //         MemOperand(fp, StandardFrameConstants::kConstantPoolOffset));
-  //   set_constant_pool_available(false);
-  // }
-  DCHECK(!FLAG_enable_embedded_constant_pool);
-  LoadP(r14, MemOperand(fp, StandardFrameConstants::kCallerPCOffset));
-  LoadP(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
-}
-
-// Push and pop all registers that can hold pointers.
-void MacroAssembler::PushSafepointRegisters() {
-  // Safepoints expect a block of kNumSafepointRegisters values on the
-  // stack, so adjust the stack for unsaved registers.
-  const int num_unsaved = kNumSafepointRegisters - kNumSafepointSavedRegisters;
-  DCHECK_GE(num_unsaved, 0);
-  if (num_unsaved > 0) {
-    lay(sp, MemOperand(sp, -(num_unsaved * kPointerSize)));
-  }
-  MultiPush(kSafepointSavedRegisters);
-}
-
-void MacroAssembler::PopSafepointRegisters() {
-  const int num_unsaved = kNumSafepointRegisters - kNumSafepointSavedRegisters;
-  MultiPop(kSafepointSavedRegisters);
-  if (num_unsaved > 0) {
-    la(sp, MemOperand(sp, num_unsaved * kPointerSize));
-  }
-}
-
-int MacroAssembler::SafepointRegisterStackIndex(int reg_code) {
-  // The registers are pushed starting with the highest encoding,
-  // which means that lowest encodings are closest to the stack pointer.
-  RegList regs = kSafepointSavedRegisters;
-  int index = 0;
-
-  DCHECK(reg_code >= 0 && reg_code < kNumRegisters);
-
-  for (int16_t i = 0; i < reg_code; i++) {
-    if ((regs & (1 << i)) != 0) {
-      index++;
-    }
-  }
-
-  return index;
-}
-
-void TurboAssembler::CanonicalizeNaN(const DoubleRegister dst,
-                                     const DoubleRegister src) {
-  // Turn potential sNaN into qNaN
-  if (dst != src) ldr(dst, src);
-  lzdr(kDoubleRegZero);
-  sdbr(dst, kDoubleRegZero);
-}
-
-void TurboAssembler::ConvertIntToDouble(DoubleRegister dst, Register src) {
-  cdfbr(dst, src);
-}
-
-void TurboAssembler::ConvertUnsignedIntToDouble(DoubleRegister dst,
-                                                Register src) {
-  if (CpuFeatures::IsSupported(FLOATING_POINT_EXT)) {
-    cdlfbr(Condition(5), Condition(0), dst, src);
-  } else {
-    // zero-extend src
-    llgfr(src, src);
-    // convert to double
-    cdgbr(dst, src);
-  }
-}
-
-void TurboAssembler::ConvertIntToFloat(DoubleRegister dst, Register src) {
-  cefbr(Condition(4), dst, src);
-}
-
-void TurboAssembler::ConvertUnsignedIntToFloat(DoubleRegister dst,
-                                               Register src) {
-  celfbr(Condition(4), Condition(0), dst, src);
-}
-
-void TurboAssembler::ConvertInt64ToFloat(DoubleRegister double_dst,
-                                         Register src) {
-  cegbr(double_dst, src);
-}
-
-void TurboAssembler::ConvertInt64ToDouble(DoubleRegister double_dst,
-                                          Register src) {
-  cdgbr(double_dst, src);
-}
-
-void TurboAssembler::ConvertUnsignedInt64ToFloat(DoubleRegister double_dst,
-                                                 Register src) {
-  celgbr(Condition(0), Condition(0), double_dst, src);
-}
-
-void TurboAssembler::ConvertUnsignedInt64ToDouble(DoubleRegister double_dst,
-                                                  Register src) {
-  cdlgbr(Condition(0), Condition(0), double_dst, src);
-}
-
-void TurboAssembler::ConvertFloat32ToInt64(const Register dst,
-                                           const DoubleRegister double_input,
-                                           FPRoundingMode rounding_mode) {
-  Condition m = Condition(0);
-  switch (rounding_mode) {
-    case kRoundToZero:
-      m = Condition(5);
-      break;
-    case kRoundToNearest:
-      UNIMPLEMENTED();
-      break;
-    case kRoundToPlusInf:
-      m = Condition(6);
-      break;
-    case kRoundToMinusInf:
-      m = Condition(7);
-      break;
-    default:
-      UNIMPLEMENTED();
-      break;
-  }
-  cgebr(m, dst, double_input);
-}
-
-void TurboAssembler::ConvertDoubleToInt64(const Register dst,
-                                          const DoubleRegister double_input,
-                                          FPRoundingMode rounding_mode) {
-  Condition m = Condition(0);
-  switch (rounding_mode) {
-    case kRoundToZero:
-      m = Condition(5);
-      break;
-    case kRoundToNearest:
-      UNIMPLEMENTED();
-      break;
-    case kRoundToPlusInf:
-      m = Condition(6);
-      break;
-    case kRoundToMinusInf:
-      m = Condition(7);
-      break;
-    default:
-      UNIMPLEMENTED();
-      break;
-  }
-  cgdbr(m, dst, double_input);
-}
-
-void TurboAssembler::ConvertDoubleToInt32(const Register dst,
-                                          const DoubleRegister double_input,
-                                          FPRoundingMode rounding_mode) {
-  Condition m = Condition(0);
-  switch (rounding_mode) {
-    case kRoundToZero:
-      m = Condition(5);
-      break;
-    case kRoundToNearest:
-      m = Condition(4);
-      break;
-    case kRoundToPlusInf:
-      m = Condition(6);
-      break;
-    case kRoundToMinusInf:
-      m = Condition(7);
-      break;
-    default:
-      UNIMPLEMENTED();
-      break;
-  }
-  cfdbr(m, dst, double_input);
-}
-
-void TurboAssembler::ConvertFloat32ToInt32(const Register result,
-                                           const DoubleRegister double_input,
-                                           FPRoundingMode rounding_mode) {
-  Condition m = Condition(0);
-  switch (rounding_mode) {
-    case kRoundToZero:
-      m = Condition(5);
-      break;
-    case kRoundToNearest:
-      m = Condition(4);
-      break;
-    case kRoundToPlusInf:
-      m = Condition(6);
-      break;
-    case kRoundToMinusInf:
-      m = Condition(7);
-      break;
-    default:
-      UNIMPLEMENTED();
-      break;
-  }
-  cfebr(m, result, double_input);
-}
-
-void TurboAssembler::ConvertFloat32ToUnsignedInt32(
-    const Register result, const DoubleRegister double_input,
-    FPRoundingMode rounding_mode) {
-  Condition m = Condition(0);
-  switch (rounding_mode) {
-    case kRoundToZero:
-      m = Condition(5);
-      break;
-    case kRoundToNearest:
-      UNIMPLEMENTED();
-      break;
-    case kRoundToPlusInf:
-      m = Condition(6);
-      break;
-    case kRoundToMinusInf:
-      m = Condition(7);
-      break;
-    default:
-      UNIMPLEMENTED();
-      break;
-  }
-  clfebr(m, Condition(0), result, double_input);
-}
-
-void TurboAssembler::ConvertFloat32ToUnsignedInt64(
-    const Register result, const DoubleRegister double_input,
-    FPRoundingMode rounding_mode) {
-  Condition m = Condition(0);
-  switch (rounding_mode) {
-    case kRoundToZero:
-      m = Condition(5);
-      break;
-    case kRoundToNearest:
-      UNIMPLEMENTED();
-      break;
-    case kRoundToPlusInf:
-      m = Condition(6);
-      break;
-    case kRoundToMinusInf:
-      m = Condition(7);
-      break;
-    default:
-      UNIMPLEMENTED();
-      break;
-  }
-  clgebr(m, Condition(0), result, double_input);
-}
-
-void TurboAssembler::ConvertDoubleToUnsignedInt64(
-    const Register dst, const DoubleRegister double_input,
-    FPRoundingMode rounding_mode) {
-  Condition m = Condition(0);
-  switch (rounding_mode) {
-    case kRoundToZero:
-      m = Condition(5);
-      break;
-    case kRoundToNearest:
-      UNIMPLEMENTED();
-      break;
-    case kRoundToPlusInf:
-      m = Condition(6);
-      break;
-    case kRoundToMinusInf:
-      m = Condition(7);
-      break;
-    default:
-      UNIMPLEMENTED();
-      break;
-  }
-  clgdbr(m, Condition(0), dst, double_input);
-}
-
-void TurboAssembler::ConvertDoubleToUnsignedInt32(
-    const Register dst, const DoubleRegister double_input,
-    FPRoundingMode rounding_mode) {
-  Condition m = Condition(0);
-  switch (rounding_mode) {
-    case kRoundToZero:
-      m = Condition(5);
-      break;
-    case kRoundToNearest:
-      UNIMPLEMENTED();
-      break;
-    case kRoundToPlusInf:
-      m = Condition(6);
-      break;
-    case kRoundToMinusInf:
-      m = Condition(7);
-      break;
-    default:
-      UNIMPLEMENTED();
-      break;
-  }
-  clfdbr(m, Condition(0), dst, double_input);
-}
-
-#if !V8_TARGET_ARCH_S390X
-void TurboAssembler::ShiftLeftPair(Register dst_low, Register dst_high,
-                                   Register src_low, Register src_high,
-                                   Register scratch, Register shift) {
-  LoadRR(r0, src_high);
-  LoadRR(r1, src_low);
-  sldl(r0, shift, Operand::Zero());
-  LoadRR(dst_high, r0);
-  LoadRR(dst_low, r1);
-}
-
-void TurboAssembler::ShiftLeftPair(Register dst_low, Register dst_high,
-                                   Register src_low, Register src_high,
-                                   uint32_t shift) {
-  LoadRR(r0, src_high);
-  LoadRR(r1, src_low);
-  sldl(r0, r0, Operand(shift));
-  LoadRR(dst_high, r0);
-  LoadRR(dst_low, r1);
-}
-
-void TurboAssembler::ShiftRightPair(Register dst_low, Register dst_high,
-                                    Register src_low, Register src_high,
-                                    Register scratch, Register shift) {
-  LoadRR(r0, src_high);
-  LoadRR(r1, src_low);
-  srdl(r0, shift, Operand::Zero());
-  LoadRR(dst_high, r0);
-  LoadRR(dst_low, r1);
-}
-
-void TurboAssembler::ShiftRightPair(Register dst_low, Register dst_high,
-                                    Register src_low, Register src_high,
-                                    uint32_t shift) {
-  LoadRR(r0, src_high);
-  LoadRR(r1, src_low);
-  srdl(r0, r0, Operand(shift));
-  LoadRR(dst_high, r0);
-  LoadRR(dst_low, r1);
-}
-
-void TurboAssembler::ShiftRightArithPair(Register dst_low, Register dst_high,
-                                         Register src_low, Register src_high,
-                                         Register scratch, Register shift) {
-  LoadRR(r0, src_high);
-  LoadRR(r1, src_low);
-  srda(r0, shift, Operand::Zero());
-  LoadRR(dst_high, r0);
-  LoadRR(dst_low, r1);
-}
-
-void TurboAssembler::ShiftRightArithPair(Register dst_low, Register dst_high,
-                                         Register src_low, Register src_high,
-                                         uint32_t shift) {
-  LoadRR(r0, src_high);
-  LoadRR(r1, src_low);
-  srda(r0, r0, Operand(shift));
-  LoadRR(dst_high, r0);
-  LoadRR(dst_low, r1);
-}
-#endif
-
-void TurboAssembler::MovDoubleToInt64(Register dst, DoubleRegister src) {
-  lgdr(dst, src);
-}
-
-void TurboAssembler::MovInt64ToDouble(DoubleRegister dst, Register src) {
-  ldgr(dst, src);
-}
-
-void TurboAssembler::StubPrologue(StackFrame::Type type, Register base,
-                                  int prologue_offset) {
-  {
-    ConstantPoolUnavailableScope constant_pool_unavailable(this);
-    Load(r1, Operand(StackFrame::TypeToMarker(type)));
-    PushCommonFrame(r1);
-  }
-}
-
-void TurboAssembler::Prologue(Register base, int prologue_offset) {
-  DCHECK(base != no_reg);
-  PushStandardFrame(r3);
-}
-
-void TurboAssembler::EnterFrame(StackFrame::Type type,
-                                bool load_constant_pool_pointer_reg) {
-  // We create a stack frame with:
-  //    Return Addr <-- old sp
-  //    Old FP      <-- new fp
-  //    CP
-  //    type
-  //    CodeObject  <-- new sp
-
-  Load(ip, Operand(StackFrame::TypeToMarker(type)));
-  PushCommonFrame(ip);
-
-  if (type == StackFrame::INTERNAL) {
-    mov(r0, Operand(CodeObject()));
-    push(r0);
-  }
-}
-
-int TurboAssembler::LeaveFrame(StackFrame::Type type, int stack_adjustment) {
-  // Drop the execution stack down to the frame pointer and restore
-  // the caller frame pointer, return address and constant pool pointer.
-  LoadP(r14, MemOperand(fp, StandardFrameConstants::kCallerPCOffset));
-  if (is_int20(StandardFrameConstants::kCallerSPOffset + stack_adjustment)) {
-    lay(r1, MemOperand(fp, StandardFrameConstants::kCallerSPOffset +
-                               stack_adjustment));
-  } else {
-    AddP(r1, fp,
-         Operand(StandardFrameConstants::kCallerSPOffset + stack_adjustment));
-  }
-  LoadP(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
-  LoadRR(sp, r1);
-  int frame_ends = pc_offset();
-  return frame_ends;
-}
-
-// ExitFrame layout (probably wrongish.. needs updating)
-//
-//  SP -> previousSP
-//        LK reserved
-//        code
-//        sp_on_exit (for debug?)
-// oldSP->prev SP
-//        LK
-//        <parameters on stack>
-
-// Prior to calling EnterExitFrame, we've got a bunch of parameters
-// on the stack that we need to wrap a real frame around.. so first
-// we reserve a slot for LK and push the previous SP which is captured
-// in the fp register (r11)
-// Then - we buy a new frame
-
-// r14
-// oldFP <- newFP
-// SP
-// Code
-// Floats
-// gaps
-// Args
-// ABIRes <- newSP
-void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space,
-                                    StackFrame::Type frame_type) {
-  DCHECK(frame_type == StackFrame::EXIT ||
-         frame_type == StackFrame::BUILTIN_EXIT);
-  // Set up the frame structure on the stack.
-  DCHECK_EQ(2 * kPointerSize, ExitFrameConstants::kCallerSPDisplacement);
-  DCHECK_EQ(1 * kPointerSize, ExitFrameConstants::kCallerPCOffset);
-  DCHECK_EQ(0 * kPointerSize, ExitFrameConstants::kCallerFPOffset);
-  DCHECK_GT(stack_space, 0);
-
-  // This is an opportunity to build a frame to wrap
-  // all of the pushes that have happened inside of V8
-  // since we were called from C code
-  CleanseP(r14);
-  Load(r1, Operand(StackFrame::TypeToMarker(frame_type)));
-  PushCommonFrame(r1);
-  // Reserve room for saved entry sp and code object.
-  lay(sp, MemOperand(fp, -ExitFrameConstants::kFixedFrameSizeFromFp));
-
-  if (emit_debug_code()) {
-    StoreP(MemOperand(fp, ExitFrameConstants::kSPOffset), Operand::Zero(), r1);
-  }
-  mov(r1, Operand(CodeObject()));
-  StoreP(r1, MemOperand(fp, ExitFrameConstants::kCodeOffset));
-
-  // Save the frame pointer and the context in top.
-  mov(r1, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress,
-                                    isolate())));
-  StoreP(fp, MemOperand(r1));
-  mov(r1,
-      Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate())));
-  StoreP(cp, MemOperand(r1));
-
-  // Optionally save all volatile double registers.
-  if (save_doubles) {
-    MultiPushDoubles(kCallerSavedDoubles);
-    // Note that d0 will be accessible at
-    //   fp - ExitFrameConstants::kFrameSize -
-    //   kNumCallerSavedDoubles * kDoubleSize,
-    // since the sp slot and code slot were pushed after the fp.
-  }
-
-  lay(sp, MemOperand(sp, -stack_space * kPointerSize));
-
-  // Allocate and align the frame preparing for calling the runtime
-  // function.
-  const int frame_alignment = TurboAssembler::ActivationFrameAlignment();
-  if (frame_alignment > 0) {
-    DCHECK_EQ(frame_alignment, 8);
-    ClearRightImm(sp, sp, Operand(3));  // equivalent to &= -8
-  }
-
-  lay(sp, MemOperand(sp, -kNumRequiredStackFrameSlots * kPointerSize));
-  StoreP(MemOperand(sp), Operand::Zero(), r0);
-  // Set the exit frame sp value to point just before the return address
-  // location.
-  lay(r1, MemOperand(sp, kStackFrameSPSlot * kPointerSize));
-  StoreP(r1, MemOperand(fp, ExitFrameConstants::kSPOffset));
-}
-
-int TurboAssembler::ActivationFrameAlignment() {
-#if !defined(USE_SIMULATOR)
-  // Running on the real platform. Use the alignment as mandated by the local
-  // environment.
-  // Note: This will break if we ever start generating snapshots on one S390
-  // platform for another S390 platform with a different alignment.
-  return base::OS::ActivationFrameAlignment();
-#else  // Simulated
-  // If we are using the simulator then we should always align to the expected
-  // alignment. As the simulator is used to generate snapshots we do not know
-  // if the target platform will need alignment, so this is controlled from a
-  // flag.
-  return FLAG_sim_stack_alignment;
-#endif
-}
-
-void MacroAssembler::LeaveExitFrame(bool save_doubles, Register argument_count,
-                                    bool argument_count_is_length) {
-  // Optionally restore all double registers.
-  if (save_doubles) {
-    // Calculate the stack location of the saved doubles and restore them.
-    const int kNumRegs = kNumCallerSavedDoubles;
-    lay(r5, MemOperand(fp, -(ExitFrameConstants::kFixedFrameSizeFromFp +
-                             kNumRegs * kDoubleSize)));
-    MultiPopDoubles(kCallerSavedDoubles, r5);
-  }
-
-  // Clear top frame.
-  mov(ip, Operand(ExternalReference(IsolateAddressId::kCEntryFPAddress,
-                                    isolate())));
-  StoreP(MemOperand(ip), Operand(0, kRelocInfo_NONEPTR), r0);
-
-  // Restore current context from top and clear it in debug mode.
-  mov(ip,
-      Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate())));
-  LoadP(cp, MemOperand(ip));
-
-#ifdef DEBUG
-  mov(r1, Operand(Context::kInvalidContext));
-  mov(ip,
-      Operand(ExternalReference(IsolateAddressId::kContextAddress, isolate())));
-  StoreP(r1, MemOperand(ip));
-#endif
-
-  // Tear down the exit frame, pop the arguments, and return.
-  LeaveFrame(StackFrame::EXIT);
-
-  if (argument_count.is_valid()) {
-    if (!argument_count_is_length) {
-      ShiftLeftP(argument_count, argument_count, Operand(kPointerSizeLog2));
-    }
-    la(sp, MemOperand(sp, argument_count));
-  }
-}
-
-void TurboAssembler::MovFromFloatResult(const DoubleRegister dst) {
-  Move(dst, d0);
-}
-
-void TurboAssembler::MovFromFloatParameter(const DoubleRegister dst) {
-  Move(dst, d0);
-}
-
-void TurboAssembler::PrepareForTailCall(const ParameterCount& callee_args_count,
-                                        Register caller_args_count_reg,
-                                        Register scratch0, Register scratch1) {
-#if DEBUG
-  if (callee_args_count.is_reg()) {
-    DCHECK(!AreAliased(callee_args_count.reg(), caller_args_count_reg, scratch0,
-                       scratch1));
-  } else {
-    DCHECK(!AreAliased(caller_args_count_reg, scratch0, scratch1));
-  }
-#endif
-
-  // Calculate the end of destination area where we will put the arguments
-  // after we drop current frame. We AddP kPointerSize to count the receiver
-  // argument which is not included into formal parameters count.
-  Register dst_reg = scratch0;
-  ShiftLeftP(dst_reg, caller_args_count_reg, Operand(kPointerSizeLog2));
-  AddP(dst_reg, fp, dst_reg);
-  AddP(dst_reg, dst_reg,
-       Operand(StandardFrameConstants::kCallerSPOffset + kPointerSize));
-
-  Register src_reg = caller_args_count_reg;
-  // Calculate the end of source area. +kPointerSize is for the receiver.
-  if (callee_args_count.is_reg()) {
-    ShiftLeftP(src_reg, callee_args_count.reg(), Operand(kPointerSizeLog2));
-    AddP(src_reg, sp, src_reg);
-    AddP(src_reg, src_reg, Operand(kPointerSize));
-  } else {
-    mov(src_reg, Operand((callee_args_count.immediate() + 1) * kPointerSize));
-    AddP(src_reg, src_reg, sp);
-  }
-
-  if (FLAG_debug_code) {
-    CmpLogicalP(src_reg, dst_reg);
-    Check(lt, AbortReason::kStackAccessBelowStackPointer);
-  }
-
-  // Restore caller's frame pointer and return address now as they will be
-  // overwritten by the copying loop.
-  RestoreFrameStateForTailCall();
-
-  // Now copy callee arguments to the caller frame going backwards to avoid
-  // callee arguments corruption (source and destination areas could overlap).
-
-  // Both src_reg and dst_reg are pointing to the word after the one to copy,
-  // so they must be pre-decremented in the loop.
-  Register tmp_reg = scratch1;
-  Label loop;
-  if (callee_args_count.is_reg()) {
-    AddP(tmp_reg, callee_args_count.reg(), Operand(1));  // +1 for receiver
-  } else {
-    mov(tmp_reg, Operand(callee_args_count.immediate() + 1));
-  }
-  LoadRR(r1, tmp_reg);
-  bind(&loop);
-  LoadP(tmp_reg, MemOperand(src_reg, -kPointerSize));
-  StoreP(tmp_reg, MemOperand(dst_reg, -kPointerSize));
-  lay(src_reg, MemOperand(src_reg, -kPointerSize));
-  lay(dst_reg, MemOperand(dst_reg, -kPointerSize));
-  BranchOnCount(r1, &loop);
-
-  // Leave current frame.
-  LoadRR(sp, dst_reg);
-}
-
-void MacroAssembler::InvokePrologue(const ParameterCount& expected,
-                                    const ParameterCount& actual, Label* done,
-                                    bool* definitely_mismatches,
-                                    InvokeFlag flag) {
-  bool definitely_matches = false;
-  *definitely_mismatches = false;
-  Label regular_invoke;
-
-  // Check whether the expected and actual arguments count match. If not,
-  // setup registers according to contract with ArgumentsAdaptorTrampoline:
-  //  r2: actual arguments count
-  //  r3: function (passed through to callee)
-  //  r4: expected arguments count
-
-  // The code below is made a lot easier because the calling code already sets
-  // up actual and expected registers according to the contract if values are
-  // passed in registers.
-
-  // ARM has some sanity checks as per below, considering add them for S390
-  //  DCHECK(actual.is_immediate() || actual.reg() == r2);
-  //  DCHECK(expected.is_immediate() || expected.reg() == r4);
-
-  if (expected.is_immediate()) {
-    DCHECK(actual.is_immediate());
-    mov(r2, Operand(actual.immediate()));
-    if (expected.immediate() == actual.immediate()) {
-      definitely_matches = true;
-    } else {
-      const int sentinel = SharedFunctionInfo::kDontAdaptArgumentsSentinel;
-      if (expected.immediate() == sentinel) {
-        // Don't worry about adapting arguments for builtins that
-        // don't want that done. Skip adaption code by making it look
-        // like we have a match between expected and actual number of
-        // arguments.
-        definitely_matches = true;
-      } else {
-        *definitely_mismatches = true;
-        mov(r4, Operand(expected.immediate()));
-      }
-    }
-  } else {
-    if (actual.is_immediate()) {
-      mov(r2, Operand(actual.immediate()));
-      CmpPH(expected.reg(), Operand(actual.immediate()));
-      beq(&regular_invoke);
-    } else {
-      CmpP(expected.reg(), actual.reg());
-      beq(&regular_invoke);
-    }
-  }
-
-  if (!definitely_matches) {
-    Handle<Code> adaptor = BUILTIN_CODE(isolate(), ArgumentsAdaptorTrampoline);
-    if (flag == CALL_FUNCTION) {
-      Call(adaptor);
-      if (!*definitely_mismatches) {
-        b(done);
-      }
-    } else {
-      Jump(adaptor, RelocInfo::CODE_TARGET);
-    }
-    bind(&regular_invoke);
-  }
-}
-
-void MacroAssembler::CheckDebugHook(Register fun, Register new_target,
-                                    const ParameterCount& expected,
-                                    const ParameterCount& actual) {
-  Label skip_hook;
-  ExternalReference debug_hook_avtive =
-      ExternalReference::debug_hook_on_function_call_address(isolate());
-  mov(r6, Operand(debug_hook_avtive));
-  LoadB(r6, MemOperand(r6));
-  CmpP(r6, Operand::Zero());
-  beq(&skip_hook);
-  {
-    FrameScope frame(this,
-                     has_frame() ? StackFrame::NONE : StackFrame::INTERNAL);
-    if (expected.is_reg()) {
-      SmiTag(expected.reg());
-      Push(expected.reg());
-    }
-    if (actual.is_reg()) {
-      SmiTag(actual.reg());
-      Push(actual.reg());
-    }
-    if (new_target.is_valid()) {
-      Push(new_target);
-    }
-    Push(fun, fun);
-    CallRuntime(Runtime::kDebugOnFunctionCall);
-    Pop(fun);
-    if (new_target.is_valid()) {
-      Pop(new_target);
-    }
-    if (actual.is_reg()) {
-      Pop(actual.reg());
-      SmiUntag(actual.reg());
-    }
-    if (expected.is_reg()) {
-      Pop(expected.reg());
-      SmiUntag(expected.reg());
-    }
-  }
-  bind(&skip_hook);
-}
-
-void MacroAssembler::InvokeFunctionCode(Register function, Register new_target,
-                                        const ParameterCount& expected,
-                                        const ParameterCount& actual,
-                                        InvokeFlag flag) {
-  // You can't call a function without a valid frame.
-  DCHECK(flag == JUMP_FUNCTION || has_frame());
-
-  DCHECK(function == r3);
-  DCHECK_IMPLIES(new_target.is_valid(), new_target == r5);
-
-  // On function call, call into the debugger if necessary.
-  CheckDebugHook(function, new_target, expected, actual);
-
-  // Clear the new.target register if not given.
-  if (!new_target.is_valid()) {
-    LoadRoot(r5, Heap::kUndefinedValueRootIndex);
-  }
-
-  Label done;
-  bool definitely_mismatches = false;
-  InvokePrologue(expected, actual, &done, &definitely_mismatches, flag);
-  if (!definitely_mismatches) {
-    // We call indirectly through the code field in the function to
-    // allow recompilation to take effect without changing any of the
-    // call sites.
-    Register code = ip;
-    LoadP(code, FieldMemOperand(function, JSFunction::kCodeOffset));
-    AddP(code, code, Operand(Code::kHeaderSize - kHeapObjectTag));
-    if (flag == CALL_FUNCTION) {
-      CallJSEntry(code);
-    } else {
-      DCHECK(flag == JUMP_FUNCTION);
-      JumpToJSEntry(code);
-    }
-
-    // Continue here if InvokePrologue does handle the invocation due to
-    // mismatched parameter counts.
-    bind(&done);
-  }
-}
-
-void MacroAssembler::InvokeFunction(Register fun, Register new_target,
-                                    const ParameterCount& actual,
-                                    InvokeFlag flag) {
-  // You can't call a function without a valid frame.
-  DCHECK(flag == JUMP_FUNCTION || has_frame());
-
-  // Contract with called JS functions requires that function is passed in r3.
-  DCHECK(fun == r3);
-
-  Register expected_reg = r4;
-  Register temp_reg = r6;
-  LoadP(temp_reg, FieldMemOperand(r3, JSFunction::kSharedFunctionInfoOffset));
-  LoadP(cp, FieldMemOperand(r3, JSFunction::kContextOffset));
-  LoadW(expected_reg,
-        FieldMemOperand(temp_reg,
-                        SharedFunctionInfo::kFormalParameterCountOffset));
-
-  ParameterCount expected(expected_reg);
-  InvokeFunctionCode(fun, new_target, expected, actual, flag);
-}
-
-void MacroAssembler::InvokeFunction(Register function,
-                                    const ParameterCount& expected,
-                                    const ParameterCount& actual,
-                                    InvokeFlag flag) {
-  // You can't call a function without a valid frame.
-  DCHECK(flag == JUMP_FUNCTION || has_frame());
-
-  // Contract with called JS functions requires that function is passed in r3.
-  DCHECK(function == r3);
-
-  // Get the function and setup the context.
-  LoadP(cp, FieldMemOperand(r3, JSFunction::kContextOffset));
-
-  InvokeFunctionCode(r3, no_reg, expected, actual, flag);
-}
-
-void MacroAssembler::InvokeFunction(Handle<JSFunction> function,
-                                    const ParameterCount& expected,
-                                    const ParameterCount& actual,
-                                    InvokeFlag flag) {
-  Move(r3, function);
-  InvokeFunction(r3, expected, actual, flag);
-}
-
-void MacroAssembler::MaybeDropFrames() {
-  // Check whether we need to drop frames to restart a function on the stack.
-  ExternalReference restart_fp =
-      ExternalReference::debug_restart_fp_address(isolate());
-  mov(r3, Operand(restart_fp));
-  LoadP(r3, MemOperand(r3));
-  CmpP(r3, Operand::Zero());
-  Jump(BUILTIN_CODE(isolate(), FrameDropperTrampoline), RelocInfo::CODE_TARGET,
-       ne);
-}
-
-void MacroAssembler::PushStackHandler() {
-  // Adjust this code if not the case.
-  STATIC_ASSERT(StackHandlerConstants::kSize == 2 * kPointerSize);
-  STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize);
-
-  // Link the current handler as the next handler.
-  mov(r7,
-      Operand(ExternalReference(IsolateAddressId::kHandlerAddress, isolate())));
-
-  // Buy the full stack frame for 5 slots.
-  lay(sp, MemOperand(sp, -StackHandlerConstants::kSize));
-
-  // Store padding.
-  mov(r0, Operand(Smi::kZero));
-  StoreP(r0, MemOperand(sp));  // Padding.
-
-  // Copy the old handler into the next handler slot.
-  mvc(MemOperand(sp, StackHandlerConstants::kNextOffset), MemOperand(r7),
-      kPointerSize);
-  // Set this new handler as the current one.
-  StoreP(sp, MemOperand(r7));
-}
-
-void MacroAssembler::PopStackHandler() {
-  STATIC_ASSERT(StackHandlerConstants::kSize == 2 * kPointerSize);
-  STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
-
-  // Pop the Next Handler into r3 and store it into Handler Address reference.
-  Pop(r3);
-  mov(ip,
-      Operand(ExternalReference(IsolateAddressId::kHandlerAddress, isolate())));
-  StoreP(r3, MemOperand(ip));
-
-  Drop(1);  // Drop padding.
-}
-
-void MacroAssembler::CompareObjectType(Register object, Register map,
-                                       Register type_reg, InstanceType type) {
-  const Register temp = type_reg == no_reg ? r0 : type_reg;
-
-  LoadP(map, FieldMemOperand(object, HeapObject::kMapOffset));
-  CompareInstanceType(map, temp, type);
-}
-
-void MacroAssembler::CompareInstanceType(Register map, Register type_reg,
-                                         InstanceType type) {
-  STATIC_ASSERT(Map::kInstanceTypeOffset < 4096);
-  STATIC_ASSERT(LAST_TYPE <= 0xFFFF);
-  LoadHalfWordP(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset));
-  CmpP(type_reg, Operand(type));
-}
-
-void MacroAssembler::CompareRoot(Register obj, Heap::RootListIndex index) {
-  CmpP(obj, MemOperand(kRootRegister, index << kPointerSizeLog2));
-}
-
-void MacroAssembler::CallStub(CodeStub* stub, Condition cond) {
-  DCHECK(AllowThisStubCall(stub));  // Stub calls are not allowed in some stubs.
-  Call(stub->GetCode(), RelocInfo::CODE_TARGET, cond);
-}
-
-void TurboAssembler::CallStubDelayed(CodeStub* stub) {
-  DCHECK(AllowThisStubCall(stub));  // Stub calls are not allowed in some stubs.
-  call(stub);
-}
-
-void MacroAssembler::TailCallStub(CodeStub* stub, Condition cond) {
-  Jump(stub->GetCode(), RelocInfo::CODE_TARGET, cond);
-}
-
-bool TurboAssembler::AllowThisStubCall(CodeStub* stub) {
-  return has_frame_ || !stub->SometimesSetsUpAFrame();
-}
-
-void MacroAssembler::TryDoubleToInt32Exact(Register result,
-                                           DoubleRegister double_input,
-                                           Register scratch,
-                                           DoubleRegister double_scratch) {
-  Label done;
-  DCHECK(double_input != double_scratch);
-
-  ConvertDoubleToInt64(result, double_input);
-
-  TestIfInt32(result);
-  bne(&done);
-
-  // convert back and compare
-  cdfbr(double_scratch, result);
-  cdbr(double_scratch, double_input);
-  bind(&done);
-}
-
-void TurboAssembler::TruncateDoubleToIDelayed(Zone* zone, Register result,
-                                              DoubleRegister double_input) {
-  Label done;
-
-  TryInlineTruncateDoubleToI(result, double_input, &done);
-
-  // If we fell through then inline version didn't succeed - call stub instead.
-  push(r14);
-  // Put input on stack.
-  lay(sp, MemOperand(sp, -kDoubleSize));
-  StoreDouble(double_input, MemOperand(sp));
-
-  CallStubDelayed(new (zone) DoubleToIStub(nullptr, result));
-
-  la(sp, MemOperand(sp, kDoubleSize));
-  pop(r14);
-
-  bind(&done);
-}
-
-void TurboAssembler::TryInlineTruncateDoubleToI(Register result,
-                                                DoubleRegister double_input,
-                                                Label* done) {
-  ConvertDoubleToInt64(result, double_input);
-
-  // Test for overflow
-  TestIfInt32(result);
-  beq(done);
-}
-
-void TurboAssembler::CallRuntimeDelayed(Zone* zone, Runtime::FunctionId fid,
-                                        SaveFPRegsMode save_doubles) {
-  const Runtime::Function* f = Runtime::FunctionForId(fid);
-  mov(r2, Operand(f->nargs));
-  mov(r3, Operand(ExternalReference(f, isolate())));
-  CallStubDelayed(new (zone) CEntryStub(nullptr,
-#if V8_TARGET_ARCH_S390X
-                                        f->result_size,
-#else
-                                        1,
-#endif
-                                        save_doubles));
-}
-
-void MacroAssembler::CallRuntime(const Runtime::Function* f, int num_arguments,
-                                 SaveFPRegsMode save_doubles) {
-  // All parameters are on the stack.  r2 has the return value after call.
-
-  // If the expected number of arguments of the runtime function is
-  // constant, we check that the actual number of arguments match the
-  // expectation.
-  CHECK(f->nargs < 0 || f->nargs == num_arguments);
-
-  // TODO(1236192): Most runtime routines don't need the number of
-  // arguments passed in because it is constant. At some point we
-  // should remove this need and make the runtime routine entry code
-  // smarter.
-  mov(r2, Operand(num_arguments));
-  mov(r3, Operand(ExternalReference(f, isolate())));
-  CEntryStub stub(isolate(),
-#if V8_TARGET_ARCH_S390X
-                  f->result_size,
-#else
-                  1,
-#endif
-                  save_doubles);
-  CallStub(&stub);
-}
-
-void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid) {
-  const Runtime::Function* function = Runtime::FunctionForId(fid);
-  DCHECK_EQ(1, function->result_size);
-  if (function->nargs >= 0) {
-    mov(r2, Operand(function->nargs));
-  }
-  JumpToExternalReference(ExternalReference(fid, isolate()));
-}
-
-void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin,
-                                             bool builtin_exit_frame) {
-  mov(r3, Operand(builtin));
-  CEntryStub stub(isolate(), 1, kDontSaveFPRegs, kArgvOnStack,
-                  builtin_exit_frame);
-  Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
-}
-
-void MacroAssembler::IncrementCounter(StatsCounter* counter, int value,
-                                      Register scratch1, Register scratch2) {
-  DCHECK(value > 0 && is_int8(value));
-  if (FLAG_native_code_counters && counter->Enabled()) {
-    mov(scratch1, Operand(ExternalReference(counter)));
-    // @TODO(john.yan): can be optimized by asi()
-    LoadW(scratch2, MemOperand(scratch1));
-    AddP(scratch2, Operand(value));
-    StoreW(scratch2, MemOperand(scratch1));
-  }
-}
-
-void MacroAssembler::DecrementCounter(StatsCounter* counter, int value,
-                                      Register scratch1, Register scratch2) {
-  DCHECK(value > 0 && is_int8(value));
-  if (FLAG_native_code_counters && counter->Enabled()) {
-    mov(scratch1, Operand(ExternalReference(counter)));
-    // @TODO(john.yan): can be optimized by asi()
-    LoadW(scratch2, MemOperand(scratch1));
-    AddP(scratch2, Operand(-value));
-    StoreW(scratch2, MemOperand(scratch1));
-  }
-}
-
-void TurboAssembler::Assert(Condition cond, AbortReason reason, CRegister cr) {
-  if (emit_debug_code()) Check(cond, reason, cr);
-}
-
-void TurboAssembler::Check(Condition cond, AbortReason reason, CRegister cr) {
-  Label L;
-  b(cond, &L);
-  Abort(reason);
-  // will not return here
-  bind(&L);
-}
-
-void TurboAssembler::Abort(AbortReason reason) {
-  Label abort_start;
-  bind(&abort_start);
-#ifdef DEBUG
-  const char* msg = GetAbortReason(reason);
-  if (msg != nullptr) {
-    RecordComment("Abort message: ");
-    RecordComment(msg);
-  }
-
-  if (FLAG_trap_on_abort) {
-    stop(msg);
-    return;
-  }
-#endif
-
-  LoadSmiLiteral(r3, Smi::FromInt(static_cast<int>(reason)));
-
-  // Disable stub call restrictions to always allow calls to abort.
-  if (!has_frame_) {
-    // We don't actually want to generate a pile of code for this, so just
-    // claim there is a stack frame, without generating one.
-    FrameScope scope(this, StackFrame::NONE);
-    Call(BUILTIN_CODE(isolate(), Abort), RelocInfo::CODE_TARGET);
-  } else {
-    Call(BUILTIN_CODE(isolate(), Abort), RelocInfo::CODE_TARGET);
-  }
-  // will not return here
-}
-
-void MacroAssembler::LoadNativeContextSlot(int index, Register dst) {
-  LoadP(dst, NativeContextMemOperand());
-  LoadP(dst, ContextMemOperand(dst, index));
-}
-
-void MacroAssembler::UntagAndJumpIfSmi(Register dst, Register src,
-                                       Label* smi_case) {
-  STATIC_ASSERT(kSmiTag == 0);
-  STATIC_ASSERT(kSmiTagSize == 1);
-  // this won't work if src == dst
-  DCHECK(src.code() != dst.code());
-  SmiUntag(dst, src);
-  TestIfSmi(src);
-  beq(smi_case);
-}
-
-void MacroAssembler::JumpIfEitherSmi(Register reg1, Register reg2,
-                                     Label* on_either_smi) {
-  STATIC_ASSERT(kSmiTag == 0);
-  JumpIfSmi(reg1, on_either_smi);
-  JumpIfSmi(reg2, on_either_smi);
-}
-
-void MacroAssembler::AssertNotSmi(Register object) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    TestIfSmi(object);
-    Check(ne, AbortReason::kOperandIsASmi, cr0);
-  }
-}
-
-void MacroAssembler::AssertSmi(Register object) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    TestIfSmi(object);
-    Check(eq, AbortReason::kOperandIsNotASmi, cr0);
-  }
-}
-
-void MacroAssembler::AssertFixedArray(Register object) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    TestIfSmi(object);
-    Check(ne, AbortReason::kOperandIsASmiAndNotAFixedArray, cr0);
-    push(object);
-    CompareObjectType(object, object, object, FIXED_ARRAY_TYPE);
-    pop(object);
-    Check(eq, AbortReason::kOperandIsNotAFixedArray);
-  }
-}
-
-void MacroAssembler::AssertFunction(Register object) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    TestIfSmi(object);
-    Check(ne, AbortReason::kOperandIsASmiAndNotAFunction, cr0);
-    push(object);
-    CompareObjectType(object, object, object, JS_FUNCTION_TYPE);
-    pop(object);
-    Check(eq, AbortReason::kOperandIsNotAFunction);
-  }
-}
-
-void MacroAssembler::AssertBoundFunction(Register object) {
-  if (emit_debug_code()) {
-    STATIC_ASSERT(kSmiTag == 0);
-    TestIfSmi(object);
-    Check(ne, AbortReason::kOperandIsASmiAndNotABoundFunction, cr0);
-    push(object);
-    CompareObjectType(object, object, object, JS_BOUND_FUNCTION_TYPE);
-    pop(object);
-    Check(eq, AbortReason::kOperandIsNotABoundFunction);
-  }
-}
-
-void MacroAssembler::AssertGeneratorObject(Register object) {
-  if (!emit_debug_code()) return;
-  TestIfSmi(object);
-  Check(ne, AbortReason::kOperandIsASmiAndNotAGeneratorObject, cr0);
-
-  // Load map
-  Register map = object;
-  push(object);
-  LoadP(map, FieldMemOperand(object, HeapObject::kMapOffset));
-
-  // Check if JSGeneratorObject
-  Label do_check;
-  Register instance_type = object;
-  CompareInstanceType(map, instance_type, JS_GENERATOR_OBJECT_TYPE);
-  beq(&do_check);
-
-  // Check if JSAsyncGeneratorObject (See MacroAssembler::CompareInstanceType)
-  CmpP(instance_type, Operand(JS_ASYNC_GENERATOR_OBJECT_TYPE));
-
-  bind(&do_check);
-  // Restore generator object to register and perform assertion
-  pop(object);
-  Check(eq, AbortReason::kOperandIsNotAGeneratorObject);
-}
-
-void MacroAssembler::AssertUndefinedOrAllocationSite(Register object,
-                                                     Register scratch) {
-  if (emit_debug_code()) {
-    Label done_checking;
-    AssertNotSmi(object);
-    CompareRoot(object, Heap::kUndefinedValueRootIndex);
-    beq(&done_checking, Label::kNear);
-    LoadP(scratch, FieldMemOperand(object, HeapObject::kMapOffset));
-    CompareRoot(scratch, Heap::kAllocationSiteMapRootIndex);
-    Assert(eq, AbortReason::kExpectedUndefinedOrCell);
-    bind(&done_checking);
-  }
-}
-
-static const int kRegisterPassedArguments = 5;
-
-int TurboAssembler::CalculateStackPassedWords(int num_reg_arguments,
-                                              int num_double_arguments) {
-  int stack_passed_words = 0;
-  if (num_double_arguments > DoubleRegister::kNumRegisters) {
-    stack_passed_words +=
-        2 * (num_double_arguments - DoubleRegister::kNumRegisters);
-  }
-  // Up to five simple arguments are passed in registers r2..r6
-  if (num_reg_arguments > kRegisterPassedArguments) {
-    stack_passed_words += num_reg_arguments - kRegisterPassedArguments;
-  }
-  return stack_passed_words;
-}
-
-void TurboAssembler::PrepareCallCFunction(int num_reg_arguments,
-                                          int num_double_arguments,
-                                          Register scratch) {
-  int frame_alignment = ActivationFrameAlignment();
-  int stack_passed_arguments =
-      CalculateStackPassedWords(num_reg_arguments, num_double_arguments);
-  int stack_space = kNumRequiredStackFrameSlots;
-  if (frame_alignment > kPointerSize) {
-    // Make stack end at alignment and make room for stack arguments
-    // -- preserving original value of sp.
-    LoadRR(scratch, sp);
-    lay(sp, MemOperand(sp, -(stack_passed_arguments + 1) * kPointerSize));
-    DCHECK(base::bits::IsPowerOfTwo(frame_alignment));
-    ClearRightImm(sp, sp, Operand(WhichPowerOf2(frame_alignment)));
-    StoreP(scratch, MemOperand(sp, (stack_passed_arguments)*kPointerSize));
-  } else {
-    stack_space += stack_passed_arguments;
-  }
-  lay(sp, MemOperand(sp, -(stack_space)*kPointerSize));
-}
-
-void TurboAssembler::PrepareCallCFunction(int num_reg_arguments,
-                                          Register scratch) {
-  PrepareCallCFunction(num_reg_arguments, 0, scratch);
-}
-
-void TurboAssembler::MovToFloatParameter(DoubleRegister src) { Move(d0, src); }
-
-void TurboAssembler::MovToFloatResult(DoubleRegister src) { Move(d0, src); }
-
-void TurboAssembler::MovToFloatParameters(DoubleRegister src1,
-                                          DoubleRegister src2) {
-  if (src2 == d0) {
-    DCHECK(src1 != d2);
-    Move(d2, src2);
-    Move(d0, src1);
-  } else {
-    Move(d0, src1);
-    Move(d2, src2);
-  }
-}
-
-void TurboAssembler::CallCFunction(ExternalReference function,
-                                   int num_reg_arguments,
-                                   int num_double_arguments) {
-  mov(ip, Operand(function));
-  CallCFunctionHelper(ip, num_reg_arguments, num_double_arguments);
-}
-
-void TurboAssembler::CallCFunction(Register function, int num_reg_arguments,
-                                   int num_double_arguments) {
-  CallCFunctionHelper(function, num_reg_arguments, num_double_arguments);
-}
-
-void TurboAssembler::CallCFunction(ExternalReference function,
-                                   int num_arguments) {
-  CallCFunction(function, num_arguments, 0);
-}
-
-void TurboAssembler::CallCFunction(Register function, int num_arguments) {
-  CallCFunction(function, num_arguments, 0);
-}
-
-void TurboAssembler::CallCFunctionHelper(Register function,
-                                         int num_reg_arguments,
-                                         int num_double_arguments) {
-  DCHECK_LE(num_reg_arguments + num_double_arguments, kMaxCParameters);
-  DCHECK(has_frame());
-
-  // Just call directly. The function called cannot cause a GC, or
-  // allow preemption, so the return address in the link register
-  // stays correct.
-  Register dest = function;
-  if (ABI_CALL_VIA_IP) {
-    Move(ip, function);
-    dest = ip;
-  }
-
-  Call(dest);
-
-  int stack_passed_arguments =
-      CalculateStackPassedWords(num_reg_arguments, num_double_arguments);
-  int stack_space = kNumRequiredStackFrameSlots + stack_passed_arguments;
-  if (ActivationFrameAlignment() > kPointerSize) {
-    // Load the original stack pointer (pre-alignment) from the stack
-    LoadP(sp, MemOperand(sp, stack_space * kPointerSize));
-  } else {
-    la(sp, MemOperand(sp, stack_space * kPointerSize));
-  }
-}
-
-void TurboAssembler::CheckPageFlag(
-    Register object,
-    Register scratch,  // scratch may be same register as object
-    int mask, Condition cc, Label* condition_met) {
-  DCHECK(cc == ne || cc == eq);
-  ClearRightImm(scratch, object, Operand(kPageSizeBits));
-
-  if (base::bits::IsPowerOfTwo(mask)) {
-    // If it's a power of two, we can use Test-Under-Mask Memory-Imm form
-    // which allows testing of a single byte in memory.
-    int32_t byte_offset = 4;
-    uint32_t shifted_mask = mask;
-    // Determine the byte offset to be tested
-    if (mask <= 0x80) {
-      byte_offset = kPointerSize - 1;
-    } else if (mask < 0x8000) {
-      byte_offset = kPointerSize - 2;
-      shifted_mask = mask >> 8;
-    } else if (mask < 0x800000) {
-      byte_offset = kPointerSize - 3;
-      shifted_mask = mask >> 16;
-    } else {
-      byte_offset = kPointerSize - 4;
-      shifted_mask = mask >> 24;
-    }
-#if V8_TARGET_LITTLE_ENDIAN
-    // Reverse the byte_offset if emulating on little endian platform
-    byte_offset = kPointerSize - byte_offset - 1;
-#endif
-    tm(MemOperand(scratch, MemoryChunk::kFlagsOffset + byte_offset),
-       Operand(shifted_mask));
-  } else {
-    LoadP(scratch, MemOperand(scratch, MemoryChunk::kFlagsOffset));
-    AndP(r0, scratch, Operand(mask));
-  }
-  // Should be okay to remove rc
-
-  if (cc == ne) {
-    bne(condition_met);
-  }
-  if (cc == eq) {
-    beq(condition_met);
-  }
-}
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// New MacroAssembler Interfaces added for S390
-//
-////////////////////////////////////////////////////////////////////////////////
-// Primarily used for loading constants
-// This should really move to be in macro-assembler as it
-// is really a pseudo instruction
-// Some usages of this intend for a FIXED_SEQUENCE to be used
-// @TODO - break this dependency so we can optimize mov() in general
-// and only use the generic version when we require a fixed sequence
-void MacroAssembler::LoadRepresentation(Register dst, const MemOperand& mem,
-                                        Representation r, Register scratch) {
-  DCHECK(!r.IsDouble());
-  if (r.IsInteger8()) {
-    LoadB(dst, mem);
-  } else if (r.IsUInteger8()) {
-    LoadlB(dst, mem);
-  } else if (r.IsInteger16()) {
-    LoadHalfWordP(dst, mem, scratch);
-  } else if (r.IsUInteger16()) {
-    LoadHalfWordP(dst, mem, scratch);
-#if V8_TARGET_ARCH_S390X
-  } else if (r.IsInteger32()) {
-    LoadW(dst, mem, scratch);
-#endif
-  } else {
-    LoadP(dst, mem, scratch);
-  }
-}
-
-void MacroAssembler::StoreRepresentation(Register src, const MemOperand& mem,
-                                         Representation r, Register scratch) {
-  DCHECK(!r.IsDouble());
-  if (r.IsInteger8() || r.IsUInteger8()) {
-    StoreByte(src, mem, scratch);
-  } else if (r.IsInteger16() || r.IsUInteger16()) {
-    StoreHalfWord(src, mem, scratch);
-#if V8_TARGET_ARCH_S390X
-  } else if (r.IsInteger32()) {
-    StoreW(src, mem, scratch);
-#endif
-  } else {
-    if (r.IsHeapObject()) {
-      AssertNotSmi(src);
-    } else if (r.IsSmi()) {
-      AssertSmi(src);
-    }
-    StoreP(src, mem, scratch);
-  }
-}
-
-Register GetRegisterThatIsNotOneOf(Register reg1, Register reg2, Register reg3,
-                                   Register reg4, Register reg5,
-                                   Register reg6) {
-  RegList regs = 0;
-  if (reg1.is_valid()) regs |= reg1.bit();
-  if (reg2.is_valid()) regs |= reg2.bit();
-  if (reg3.is_valid()) regs |= reg3.bit();
-  if (reg4.is_valid()) regs |= reg4.bit();
-  if (reg5.is_valid()) regs |= reg5.bit();
-  if (reg6.is_valid()) regs |= reg6.bit();
-
-  const RegisterConfiguration* config = RegisterConfiguration::Default();
-  for (int i = 0; i < config->num_allocatable_general_registers(); ++i) {
-    int code = config->GetAllocatableGeneralCode(i);
-    Register candidate = Register::from_code(code);
-    if (regs & candidate.bit()) continue;
-    return candidate;
-  }
-  UNREACHABLE();
-}
-
-void TurboAssembler::mov(Register dst, const Operand& src) {
-#if V8_TARGET_ARCH_S390X
-  int64_t value;
-#else
-  int value;
-#endif
-  if (src.is_heap_object_request()) {
-    RequestHeapObject(src.heap_object_request());
-    value = 0;
-  } else {
-    value = src.immediate();
-  }
-
-  if (src.rmode() != kRelocInfo_NONEPTR) {
-    // some form of relocation needed
-    RecordRelocInfo(src.rmode(), value);
-  }
-
-#if V8_TARGET_ARCH_S390X
-  int32_t hi_32 = static_cast<int64_t>(value) >> 32;
-  int32_t lo_32 = static_cast<int32_t>(value);
-
-  iihf(dst, Operand(hi_32));
-  iilf(dst, Operand(lo_32));
-#else
-  iilf(dst, Operand(value));
-#endif
-}
-
-void TurboAssembler::Mul32(Register dst, const MemOperand& src1) {
-  if (is_uint12(src1.offset())) {
-    ms(dst, src1);
-  } else if (is_int20(src1.offset())) {
-    msy(dst, src1);
-  } else {
-    UNIMPLEMENTED();
-  }
-}
-
-void TurboAssembler::Mul32(Register dst, Register src1) { msr(dst, src1); }
-
-void TurboAssembler::Mul32(Register dst, const Operand& src1) {
-  msfi(dst, src1);
-}
-
-#define Generate_MulHigh32(instr) \
-  {                               \
-    lgfr(dst, src1);              \
-    instr(dst, src2);             \
-    srlg(dst, dst, Operand(32));  \
-  }
-
-void TurboAssembler::MulHigh32(Register dst, Register src1,
-                               const MemOperand& src2) {
-  Generate_MulHigh32(msgf);
-}
-
-void TurboAssembler::MulHigh32(Register dst, Register src1, Register src2) {
-  if (dst == src2) {
-    std::swap(src1, src2);
-  }
-  Generate_MulHigh32(msgfr);
-}
-
-void TurboAssembler::MulHigh32(Register dst, Register src1,
-                               const Operand& src2) {
-  Generate_MulHigh32(msgfi);
-}
-
-#undef Generate_MulHigh32
-
-#define Generate_MulHighU32(instr) \
-  {                                \
-    lr(r1, src1);                  \
-    instr(r0, src2);               \
-    LoadlW(dst, r0);               \
-  }
-
-void TurboAssembler::MulHighU32(Register dst, Register src1,
-                                const MemOperand& src2) {
-  Generate_MulHighU32(ml);
-}
-
-void TurboAssembler::MulHighU32(Register dst, Register src1, Register src2) {
-  Generate_MulHighU32(mlr);
-}
-
-void TurboAssembler::MulHighU32(Register dst, Register src1,
-                                const Operand& src2) {
-  USE(dst);
-  USE(src1);
-  USE(src2);
-  UNREACHABLE();
-}
-
-#undef Generate_MulHighU32
-
-#define Generate_Mul32WithOverflowIfCCUnequal(instr) \
-  {                                                  \
-    lgfr(dst, src1);                                 \
-    instr(dst, src2);                                \
-    cgfr(dst, dst);                                  \
-  }
-
-void TurboAssembler::Mul32WithOverflowIfCCUnequal(Register dst, Register src1,
-                                                  const MemOperand& src2) {
-  Register result = dst;
-  if (src2.rx() == dst || src2.rb() == dst) dst = r0;
-  Generate_Mul32WithOverflowIfCCUnequal(msgf);
-  if (result != dst) llgfr(result, dst);
-}
-
-void TurboAssembler::Mul32WithOverflowIfCCUnequal(Register dst, Register src1,
-                                                  Register src2) {
-  if (dst == src2) {
-    std::swap(src1, src2);
-  }
-  Generate_Mul32WithOverflowIfCCUnequal(msgfr);
-}
-
-void TurboAssembler::Mul32WithOverflowIfCCUnequal(Register dst, Register src1,
-                                                  const Operand& src2) {
-  Generate_Mul32WithOverflowIfCCUnequal(msgfi);
-}
-
-#undef Generate_Mul32WithOverflowIfCCUnequal
-
-void TurboAssembler::Mul64(Register dst, const MemOperand& src1) {
-  if (is_int20(src1.offset())) {
-    msg(dst, src1);
-  } else {
-    UNIMPLEMENTED();
-  }
-}
-
-void TurboAssembler::Mul64(Register dst, Register src1) { msgr(dst, src1); }
-
-void TurboAssembler::Mul64(Register dst, const Operand& src1) {
-  msgfi(dst, src1);
-}
-
-void TurboAssembler::Mul(Register dst, Register src1, Register src2) {
-  if (CpuFeatures::IsSupported(MISC_INSTR_EXT2)) {
-    MulPWithCondition(dst, src1, src2);
-  } else {
-    if (dst == src2) {
-      MulP(dst, src1);
-    } else if (dst == src1) {
-      MulP(dst, src2);
-    } else {
-      Move(dst, src1);
-      MulP(dst, src2);
-    }
-  }
-}
-
-void TurboAssembler::DivP(Register dividend, Register divider) {
-  // have to make sure the src and dst are reg pairs
-  DCHECK_EQ(dividend.code() % 2, 0);
-#if V8_TARGET_ARCH_S390X
-  dsgr(dividend, divider);
-#else
-  dr(dividend, divider);
-#endif
-}
-
-#define Generate_Div32(instr) \
-  {                           \
-    lgfr(r1, src1);           \
-    instr(r0, src2);          \
-    LoadlW(dst, r1);          \
-  }
-
-void TurboAssembler::Div32(Register dst, Register src1,
-                           const MemOperand& src2) {
-  Generate_Div32(dsgf);
-}
-
-void TurboAssembler::Div32(Register dst, Register src1, Register src2) {
-  Generate_Div32(dsgfr);
-}
-
-#undef Generate_Div32
-
-#define Generate_DivU32(instr) \
-  {                            \
-    lr(r0, src1);              \
-    srdl(r0, Operand(32));     \
-    instr(r0, src2);           \
-    LoadlW(dst, r1);           \
-  }
-
-void TurboAssembler::DivU32(Register dst, Register src1,
-                            const MemOperand& src2) {
-  Generate_DivU32(dl);
-}
-
-void TurboAssembler::DivU32(Register dst, Register src1, Register src2) {
-  Generate_DivU32(dlr);
-}
-
-#undef Generate_DivU32
-
-#define Generate_Div64(instr) \
-  {                           \
-    lgr(r1, src1);            \
-    instr(r0, src2);          \
-    lgr(dst, r1);             \
-  }
-
-void TurboAssembler::Div64(Register dst, Register src1,
-                           const MemOperand& src2) {
-  Generate_Div64(dsg);
-}
-
-void TurboAssembler::Div64(Register dst, Register src1, Register src2) {
-  Generate_Div64(dsgr);
-}
-
-#undef Generate_Div64
-
-#define Generate_DivU64(instr) \
-  {                            \
-    lgr(r1, src1);             \
-    lghi(r0, Operand::Zero()); \
-    instr(r0, src2);           \
-    lgr(dst, r1);              \
-  }
-
-void TurboAssembler::DivU64(Register dst, Register src1,
-                            const MemOperand& src2) {
-  Generate_DivU64(dlg);
-}
-
-void TurboAssembler::DivU64(Register dst, Register src1, Register src2) {
-  Generate_DivU64(dlgr);
-}
-
-#undef Generate_DivU64
-
-#define Generate_Mod32(instr) \
-  {                           \
-    lgfr(r1, src1);           \
-    instr(r0, src2);          \
-    LoadlW(dst, r0);          \
-  }
-
-void TurboAssembler::Mod32(Register dst, Register src1,
-                           const MemOperand& src2) {
-  Generate_Mod32(dsgf);
-}
-
-void TurboAssembler::Mod32(Register dst, Register src1, Register src2) {
-  Generate_Mod32(dsgfr);
-}
-
-#undef Generate_Mod32
-
-#define Generate_ModU32(instr) \
-  {                            \
-    lr(r0, src1);              \
-    srdl(r0, Operand(32));     \
-    instr(r0, src2);           \
-    LoadlW(dst, r0);           \
-  }
-
-void TurboAssembler::ModU32(Register dst, Register src1,
-                            const MemOperand& src2) {
-  Generate_ModU32(dl);
-}
-
-void TurboAssembler::ModU32(Register dst, Register src1, Register src2) {
-  Generate_ModU32(dlr);
-}
-
-#undef Generate_ModU32
-
-#define Generate_Mod64(instr) \
-  {                           \
-    lgr(r1, src1);            \
-    instr(r0, src2);          \
-    lgr(dst, r0);             \
-  }
-
-void TurboAssembler::Mod64(Register dst, Register src1,
-                           const MemOperand& src2) {
-  Generate_Mod64(dsg);
-}
-
-void TurboAssembler::Mod64(Register dst, Register src1, Register src2) {
-  Generate_Mod64(dsgr);
-}
-
-#undef Generate_Mod64
-
-#define Generate_ModU64(instr) \
-  {                            \
-    lgr(r1, src1);             \
-    lghi(r0, Operand::Zero()); \
-    instr(r0, src2);           \
-    lgr(dst, r0);              \
-  }
-
-void TurboAssembler::ModU64(Register dst, Register src1,
-                            const MemOperand& src2) {
-  Generate_ModU64(dlg);
-}
-
-void TurboAssembler::ModU64(Register dst, Register src1, Register src2) {
-  Generate_ModU64(dlgr);
-}
-
-#undef Generate_ModU64
-
-void TurboAssembler::MulP(Register dst, const Operand& opnd) {
-#if V8_TARGET_ARCH_S390X
-  msgfi(dst, opnd);
-#else
-  msfi(dst, opnd);
-#endif
-}
-
-void TurboAssembler::MulP(Register dst, Register src) {
-#if V8_TARGET_ARCH_S390X
-  msgr(dst, src);
-#else
-  msr(dst, src);
-#endif
-}
-
-void TurboAssembler::MulPWithCondition(Register dst, Register src1,
-                                       Register src2) {
-  CHECK(CpuFeatures::IsSupported(MISC_INSTR_EXT2));
-#if V8_TARGET_ARCH_S390X
-  msgrkc(dst, src1, src2);
-#else
-  msrkc(dst, src1, src2);
-#endif
-}
-
-void TurboAssembler::MulP(Register dst, const MemOperand& opnd) {
-#if V8_TARGET_ARCH_S390X
-  if (is_uint16(opnd.offset())) {
-    ms(dst, opnd);
-  } else if (is_int20(opnd.offset())) {
-    msy(dst, opnd);
-  } else {
-    UNIMPLEMENTED();
-  }
-#else
-  if (is_int20(opnd.offset())) {
-    msg(dst, opnd);
-  } else {
-    UNIMPLEMENTED();
-  }
-#endif
-}
-
-void TurboAssembler::Sqrt(DoubleRegister result, DoubleRegister input) {
-  sqdbr(result, input);
-}
-void TurboAssembler::Sqrt(DoubleRegister result, const MemOperand& input) {
-  if (is_uint12(input.offset())) {
-    sqdb(result, input);
-  } else {
-    ldy(result, input);
-    sqdbr(result, result);
-  }
-}
-//----------------------------------------------------------------------------
-//  Add Instructions
-//----------------------------------------------------------------------------
-
-// Add 32-bit (Register dst = Register dst + Immediate opnd)
-void TurboAssembler::Add32(Register dst, const Operand& opnd) {
-  if (is_int16(opnd.immediate()))
-    ahi(dst, opnd);
-  else
-    afi(dst, opnd);
-}
-
-// Add 32-bit (Register dst = Register dst + Immediate opnd)
-void TurboAssembler::Add32_RI(Register dst, const Operand& opnd) {
-  // Just a wrapper for above
-  Add32(dst, opnd);
-}
-
-// Add Pointer Size (Register dst = Register dst + Immediate opnd)
-void TurboAssembler::AddP(Register dst, const Operand& opnd) {
-#if V8_TARGET_ARCH_S390X
-  if (is_int16(opnd.immediate()))
-    aghi(dst, opnd);
-  else
-    agfi(dst, opnd);
-#else
-  Add32(dst, opnd);
-#endif
-}
-
-// Add 32-bit (Register dst = Register src + Immediate opnd)
-void TurboAssembler::Add32(Register dst, Register src, const Operand& opnd) {
-  if (dst != src) {
-    if (CpuFeatures::IsSupported(DISTINCT_OPS) && is_int16(opnd.immediate())) {
-      ahik(dst, src, opnd);
-      return;
-    }
-    lr(dst, src);
-  }
-  Add32(dst, opnd);
-}
-
-// Add 32-bit (Register dst = Register src + Immediate opnd)
-void TurboAssembler::Add32_RRI(Register dst, Register src,
-                               const Operand& opnd) {
-  // Just a wrapper for above
-  Add32(dst, src, opnd);
-}
-
-// Add Pointer Size (Register dst = Register src + Immediate opnd)
-void TurboAssembler::AddP(Register dst, Register src, const Operand& opnd) {
-  if (dst != src) {
-    if (CpuFeatures::IsSupported(DISTINCT_OPS) && is_int16(opnd.immediate())) {
-      AddPImm_RRI(dst, src, opnd);
-      return;
-    }
-    LoadRR(dst, src);
-  }
-  AddP(dst, opnd);
-}
-
-// Add 32-bit (Register dst = Register dst + Register src)
-void TurboAssembler::Add32(Register dst, Register src) { ar(dst, src); }
-
-// Add Pointer Size (Register dst = Register dst + Register src)
-void TurboAssembler::AddP(Register dst, Register src) { AddRR(dst, src); }
-
-// Add Pointer Size with src extension
-//     (Register dst(ptr) = Register dst (ptr) + Register src (32 | 32->64))
-// src is treated as a 32-bit signed integer, which is sign extended to
-// 64-bit if necessary.
-void TurboAssembler::AddP_ExtendSrc(Register dst, Register src) {
-#if V8_TARGET_ARCH_S390X
-  agfr(dst, src);
-#else
-  ar(dst, src);
-#endif
-}
-
-// Add 32-bit (Register dst = Register src1 + Register src2)
-void TurboAssembler::Add32(Register dst, Register src1, Register src2) {
-  if (dst != src1 && dst != src2) {
-    // We prefer to generate AR/AGR, over the non clobbering ARK/AGRK
-    // as AR is a smaller instruction
-    if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-      ark(dst, src1, src2);
-      return;
-    } else {
-      lr(dst, src1);
-    }
-  } else if (dst == src2) {
-    src2 = src1;
-  }
-  ar(dst, src2);
-}
-
-// Add Pointer Size (Register dst = Register src1 + Register src2)
-void TurboAssembler::AddP(Register dst, Register src1, Register src2) {
-  if (dst != src1 && dst != src2) {
-    // We prefer to generate AR/AGR, over the non clobbering ARK/AGRK
-    // as AR is a smaller instruction
-    if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-      AddP_RRR(dst, src1, src2);
-      return;
-    } else {
-      LoadRR(dst, src1);
-    }
-  } else if (dst == src2) {
-    src2 = src1;
-  }
-  AddRR(dst, src2);
-}
-
-// Add Pointer Size with src extension
-//      (Register dst (ptr) = Register dst (ptr) + Register src1 (ptr) +
-//                            Register src2 (32 | 32->64))
-// src is treated as a 32-bit signed integer, which is sign extended to
-// 64-bit if necessary.
-void TurboAssembler::AddP_ExtendSrc(Register dst, Register src1,
-                                    Register src2) {
-#if V8_TARGET_ARCH_S390X
-  if (dst == src2) {
-    // The source we need to sign extend is the same as result.
-    lgfr(dst, src2);
-    agr(dst, src1);
-  } else {
-    if (dst != src1) LoadRR(dst, src1);
-    agfr(dst, src2);
-  }
-#else
-  AddP(dst, src1, src2);
-#endif
-}
-
-// Add 32-bit (Register-Memory)
-void TurboAssembler::Add32(Register dst, const MemOperand& opnd) {
-  DCHECK(is_int20(opnd.offset()));
-  if (is_uint12(opnd.offset()))
-    a(dst, opnd);
-  else
-    ay(dst, opnd);
-}
-
-// Add Pointer Size (Register-Memory)
-void TurboAssembler::AddP(Register dst, const MemOperand& opnd) {
-#if V8_TARGET_ARCH_S390X
-  DCHECK(is_int20(opnd.offset()));
-  ag(dst, opnd);
-#else
-  Add32(dst, opnd);
-#endif
-}
-
-// Add Pointer Size with src extension
-//      (Register dst (ptr) = Register dst (ptr) + Mem opnd (32 | 32->64))
-// src is treated as a 32-bit signed integer, which is sign extended to
-// 64-bit if necessary.
-void TurboAssembler::AddP_ExtendSrc(Register dst, const MemOperand& opnd) {
-#if V8_TARGET_ARCH_S390X
-  DCHECK(is_int20(opnd.offset()));
-  agf(dst, opnd);
-#else
-  Add32(dst, opnd);
-#endif
-}
-
-// Add 32-bit (Memory - Immediate)
-void TurboAssembler::Add32(const MemOperand& opnd, const Operand& imm) {
-  DCHECK(is_int8(imm.immediate()));
-  DCHECK(is_int20(opnd.offset()));
-  DCHECK(CpuFeatures::IsSupported(GENERAL_INSTR_EXT));
-  asi(opnd, imm);
-}
-
-// Add Pointer-sized (Memory - Immediate)
-void TurboAssembler::AddP(const MemOperand& opnd, const Operand& imm) {
-  DCHECK(is_int8(imm.immediate()));
-  DCHECK(is_int20(opnd.offset()));
-  DCHECK(CpuFeatures::IsSupported(GENERAL_INSTR_EXT));
-#if V8_TARGET_ARCH_S390X
-  agsi(opnd, imm);
-#else
-  asi(opnd, imm);
-#endif
-}
-
-//----------------------------------------------------------------------------
-//  Add Logical Instructions
-//----------------------------------------------------------------------------
-
-// Add Logical With Carry 32-bit (Register dst = Register src1 + Register src2)
-void TurboAssembler::AddLogicalWithCarry32(Register dst, Register src1,
-                                           Register src2) {
-  if (dst != src2 && dst != src1) {
-    lr(dst, src1);
-    alcr(dst, src2);
-  } else if (dst != src2) {
-    // dst == src1
-    DCHECK(dst == src1);
-    alcr(dst, src2);
-  } else {
-    // dst == src2
-    DCHECK(dst == src2);
-    alcr(dst, src1);
-  }
-}
-
-// Add Logical 32-bit (Register dst = Register src1 + Register src2)
-void TurboAssembler::AddLogical32(Register dst, Register src1, Register src2) {
-  if (dst != src2 && dst != src1) {
-    lr(dst, src1);
-    alr(dst, src2);
-  } else if (dst != src2) {
-    // dst == src1
-    DCHECK(dst == src1);
-    alr(dst, src2);
-  } else {
-    // dst == src2
-    DCHECK(dst == src2);
-    alr(dst, src1);
-  }
-}
-
-// Add Logical 32-bit (Register dst = Register dst + Immediate opnd)
-void TurboAssembler::AddLogical(Register dst, const Operand& imm) {
-  alfi(dst, imm);
-}
-
-// Add Logical Pointer Size (Register dst = Register dst + Immediate opnd)
-void TurboAssembler::AddLogicalP(Register dst, const Operand& imm) {
-#ifdef V8_TARGET_ARCH_S390X
-  algfi(dst, imm);
-#else
-  AddLogical(dst, imm);
-#endif
-}
-
-// Add Logical 32-bit (Register-Memory)
-void TurboAssembler::AddLogical(Register dst, const MemOperand& opnd) {
-  DCHECK(is_int20(opnd.offset()));
-  if (is_uint12(opnd.offset()))
-    al_z(dst, opnd);
-  else
-    aly(dst, opnd);
-}
-
-// Add Logical Pointer Size (Register-Memory)
-void TurboAssembler::AddLogicalP(Register dst, const MemOperand& opnd) {
-#if V8_TARGET_ARCH_S390X
-  DCHECK(is_int20(opnd.offset()));
-  alg(dst, opnd);
-#else
-  AddLogical(dst, opnd);
-#endif
-}
-
-//----------------------------------------------------------------------------
-//  Subtract Instructions
-//----------------------------------------------------------------------------
-
-// Subtract Logical With Carry 32-bit (Register dst = Register src1 - Register
-// src2)
-void TurboAssembler::SubLogicalWithBorrow32(Register dst, Register src1,
-                                            Register src2) {
-  if (dst != src2 && dst != src1) {
-    lr(dst, src1);
-    slbr(dst, src2);
-  } else if (dst != src2) {
-    // dst == src1
-    DCHECK(dst == src1);
-    slbr(dst, src2);
-  } else {
-    // dst == src2
-    DCHECK(dst == src2);
-    lr(r0, dst);
-    SubLogicalWithBorrow32(dst, src1, r0);
-  }
-}
-
-// Subtract Logical 32-bit (Register dst = Register src1 - Register src2)
-void TurboAssembler::SubLogical32(Register dst, Register src1, Register src2) {
-  if (dst != src2 && dst != src1) {
-    lr(dst, src1);
-    slr(dst, src2);
-  } else if (dst != src2) {
-    // dst == src1
-    DCHECK(dst == src1);
-    slr(dst, src2);
-  } else {
-    // dst == src2
-    DCHECK(dst == src2);
-    lr(r0, dst);
-    SubLogical32(dst, src1, r0);
-  }
-}
-
-// Subtract 32-bit (Register dst = Register dst - Immediate opnd)
-void TurboAssembler::Sub32(Register dst, const Operand& imm) {
-  Add32(dst, Operand(-(imm.immediate())));
-}
-
-// Subtract Pointer Size (Register dst = Register dst - Immediate opnd)
-void TurboAssembler::SubP(Register dst, const Operand& imm) {
-  AddP(dst, Operand(-(imm.immediate())));
-}
-
-// Subtract 32-bit (Register dst = Register src - Immediate opnd)
-void TurboAssembler::Sub32(Register dst, Register src, const Operand& imm) {
-  Add32(dst, src, Operand(-(imm.immediate())));
-}
-
-// Subtract Pointer Sized (Register dst = Register src - Immediate opnd)
-void TurboAssembler::SubP(Register dst, Register src, const Operand& imm) {
-  AddP(dst, src, Operand(-(imm.immediate())));
-}
-
-// Subtract 32-bit (Register dst = Register dst - Register src)
-void TurboAssembler::Sub32(Register dst, Register src) { sr(dst, src); }
-
-// Subtract Pointer Size (Register dst = Register dst - Register src)
-void TurboAssembler::SubP(Register dst, Register src) { SubRR(dst, src); }
-
-// Subtract Pointer Size with src extension
-//     (Register dst(ptr) = Register dst (ptr) - Register src (32 | 32->64))
-// src is treated as a 32-bit signed integer, which is sign extended to
-// 64-bit if necessary.
-void TurboAssembler::SubP_ExtendSrc(Register dst, Register src) {
-#if V8_TARGET_ARCH_S390X
-  sgfr(dst, src);
-#else
-  sr(dst, src);
-#endif
-}
-
-// Subtract 32-bit (Register = Register - Register)
-void TurboAssembler::Sub32(Register dst, Register src1, Register src2) {
-  // Use non-clobbering version if possible
-  if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-    srk(dst, src1, src2);
-    return;
-  }
-  if (dst != src1 && dst != src2) lr(dst, src1);
-  // In scenario where we have dst = src - dst, we need to swap and negate
-  if (dst != src1 && dst == src2) {
-    Label done;
-    lcr(dst, dst);  // dst = -dst
-    b(overflow, &done);
-    ar(dst, src1);  // dst = dst + src
-    bind(&done);
-  } else {
-    sr(dst, src2);
-  }
-}
-
-// Subtract Pointer Sized (Register = Register - Register)
-void TurboAssembler::SubP(Register dst, Register src1, Register src2) {
-  // Use non-clobbering version if possible
-  if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-    SubP_RRR(dst, src1, src2);
-    return;
-  }
-  if (dst != src1 && dst != src2) LoadRR(dst, src1);
-  // In scenario where we have dst = src - dst, we need to swap and negate
-  if (dst != src1 && dst == src2) {
-    Label done;
-    LoadComplementRR(dst, dst);  // dst = -dst
-    b(overflow, &done);
-    AddP(dst, src1);  // dst = dst + src
-    bind(&done);
-  } else {
-    SubP(dst, src2);
-  }
-}
-
-// Subtract Pointer Size with src extension
-//     (Register dst(ptr) = Register dst (ptr) - Register src (32 | 32->64))
-// src is treated as a 32-bit signed integer, which is sign extended to
-// 64-bit if necessary.
-void TurboAssembler::SubP_ExtendSrc(Register dst, Register src1,
-                                    Register src2) {
-#if V8_TARGET_ARCH_S390X
-  if (dst != src1 && dst != src2) LoadRR(dst, src1);
-
-  // In scenario where we have dst = src - dst, we need to swap and negate
-  if (dst != src1 && dst == src2) {
-    lgfr(dst, dst);              // Sign extend this operand first.
-    LoadComplementRR(dst, dst);  // dst = -dst
-    AddP(dst, src1);             // dst = -dst + src
-  } else {
-    sgfr(dst, src2);
-  }
-#else
-  SubP(dst, src1, src2);
-#endif
-}
-
-// Subtract 32-bit (Register-Memory)
-void TurboAssembler::Sub32(Register dst, const MemOperand& opnd) {
-  DCHECK(is_int20(opnd.offset()));
-  if (is_uint12(opnd.offset()))
-    s(dst, opnd);
-  else
-    sy(dst, opnd);
-}
-
-// Subtract Pointer Sized (Register - Memory)
-void TurboAssembler::SubP(Register dst, const MemOperand& opnd) {
-#if V8_TARGET_ARCH_S390X
-  sg(dst, opnd);
-#else
-  Sub32(dst, opnd);
-#endif
-}
-
-void TurboAssembler::MovIntToFloat(DoubleRegister dst, Register src) {
-  sllg(r0, src, Operand(32));
-  ldgr(dst, r0);
-}
-
-void TurboAssembler::MovFloatToInt(Register dst, DoubleRegister src) {
-  lgdr(dst, src);
-  srlg(dst, dst, Operand(32));
-}
-
-void TurboAssembler::SubP_ExtendSrc(Register dst, const MemOperand& opnd) {
-#if V8_TARGET_ARCH_S390X
-  DCHECK(is_int20(opnd.offset()));
-  sgf(dst, opnd);
-#else
-  Sub32(dst, opnd);
-#endif
-}
-
-//----------------------------------------------------------------------------
-//  Subtract Logical Instructions
-//----------------------------------------------------------------------------
-
-// Subtract Logical 32-bit (Register - Memory)
-void TurboAssembler::SubLogical(Register dst, const MemOperand& opnd) {
-  DCHECK(is_int20(opnd.offset()));
-  if (is_uint12(opnd.offset()))
-    sl(dst, opnd);
-  else
-    sly(dst, opnd);
-}
-
-// Subtract Logical Pointer Sized (Register - Memory)
-void TurboAssembler::SubLogicalP(Register dst, const MemOperand& opnd) {
-  DCHECK(is_int20(opnd.offset()));
-#if V8_TARGET_ARCH_S390X
-  slgf(dst, opnd);
-#else
-  SubLogical(dst, opnd);
-#endif
-}
-
-// Subtract Logical Pointer Size with src extension
-//      (Register dst (ptr) = Register dst (ptr) - Mem opnd (32 | 32->64))
-// src is treated as a 32-bit signed integer, which is sign extended to
-// 64-bit if necessary.
-void TurboAssembler::SubLogicalP_ExtendSrc(Register dst,
-                                           const MemOperand& opnd) {
-#if V8_TARGET_ARCH_S390X
-  DCHECK(is_int20(opnd.offset()));
-  slgf(dst, opnd);
-#else
-  SubLogical(dst, opnd);
-#endif
-}
-
-//----------------------------------------------------------------------------
-//  Bitwise Operations
-//----------------------------------------------------------------------------
-
-// AND 32-bit - dst = dst & src
-void TurboAssembler::And(Register dst, Register src) { nr(dst, src); }
-
-// AND Pointer Size - dst = dst & src
-void TurboAssembler::AndP(Register dst, Register src) { AndRR(dst, src); }
-
-// Non-clobbering AND 32-bit - dst = src1 & src1
-void TurboAssembler::And(Register dst, Register src1, Register src2) {
-  if (dst != src1 && dst != src2) {
-    // We prefer to generate XR/XGR, over the non clobbering XRK/XRK
-    // as XR is a smaller instruction
-    if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-      nrk(dst, src1, src2);
-      return;
-    } else {
-      lr(dst, src1);
-    }
-  } else if (dst == src2) {
-    src2 = src1;
-  }
-  And(dst, src2);
-}
-
-// Non-clobbering AND pointer size - dst = src1 & src1
-void TurboAssembler::AndP(Register dst, Register src1, Register src2) {
-  if (dst != src1 && dst != src2) {
-    // We prefer to generate XR/XGR, over the non clobbering XRK/XRK
-    // as XR is a smaller instruction
-    if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-      AndP_RRR(dst, src1, src2);
-      return;
-    } else {
-      LoadRR(dst, src1);
-    }
-  } else if (dst == src2) {
-    src2 = src1;
-  }
-  AndP(dst, src2);
-}
-
-// AND 32-bit (Reg - Mem)
-void TurboAssembler::And(Register dst, const MemOperand& opnd) {
-  DCHECK(is_int20(opnd.offset()));
-  if (is_uint12(opnd.offset()))
-    n(dst, opnd);
-  else
-    ny(dst, opnd);
-}
-
-// AND Pointer Size (Reg - Mem)
-void TurboAssembler::AndP(Register dst, const MemOperand& opnd) {
-  DCHECK(is_int20(opnd.offset()));
-#if V8_TARGET_ARCH_S390X
-  ng(dst, opnd);
-#else
-  And(dst, opnd);
-#endif
-}
-
-// AND 32-bit - dst = dst & imm
-void TurboAssembler::And(Register dst, const Operand& opnd) { nilf(dst, opnd); }
-
-// AND Pointer Size - dst = dst & imm
-void TurboAssembler::AndP(Register dst, const Operand& opnd) {
-#if V8_TARGET_ARCH_S390X
-  intptr_t value = opnd.immediate();
-  if (value >> 32 != -1) {
-    // this may not work b/c condition code won't be set correctly
-    nihf(dst, Operand(value >> 32));
-  }
-  nilf(dst, Operand(value & 0xFFFFFFFF));
-#else
-  And(dst, opnd);
-#endif
-}
-
-// AND 32-bit - dst = src & imm
-void TurboAssembler::And(Register dst, Register src, const Operand& opnd) {
-  if (dst != src) lr(dst, src);
-  nilf(dst, opnd);
-}
-
-// AND Pointer Size - dst = src & imm
-void TurboAssembler::AndP(Register dst, Register src, const Operand& opnd) {
-  // Try to exploit RISBG first
-  intptr_t value = opnd.immediate();
-  if (CpuFeatures::IsSupported(GENERAL_INSTR_EXT)) {
-    intptr_t shifted_value = value;
-    int trailing_zeros = 0;
-
-    // We start checking how many trailing zeros are left at the end.
-    while ((0 != shifted_value) && (0 == (shifted_value & 1))) {
-      trailing_zeros++;
-      shifted_value >>= 1;
-    }
-
-    // If temp (value with right-most set of zeros shifted out) is 1 less
-    // than power of 2, we have consecutive bits of 1.
-    // Special case: If shift_value is zero, we cannot use RISBG, as it requires
-    //               selection of at least 1 bit.
-    if ((0 != shifted_value) && base::bits::IsPowerOfTwo(shifted_value + 1)) {
-      int startBit =
-          base::bits::CountLeadingZeros64(shifted_value) - trailing_zeros;
-      int endBit = 63 - trailing_zeros;
-      // Start: startBit, End: endBit, Shift = 0, true = zero unselected bits.
-      risbg(dst, src, Operand(startBit), Operand(endBit), Operand::Zero(),
-            true);
-      return;
-    } else if (-1 == shifted_value) {
-      // A Special case in which all top bits up to MSB are 1's.  In this case,
-      // we can set startBit to be 0.
-      int endBit = 63 - trailing_zeros;
-      risbg(dst, src, Operand::Zero(), Operand(endBit), Operand::Zero(), true);
-      return;
-    }
-  }
-
-  // If we are &'ing zero, we can just whack the dst register and skip copy
-  if (dst != src && (0 != value)) LoadRR(dst, src);
-  AndP(dst, opnd);
-}
-
-// OR 32-bit - dst = dst & src
-void TurboAssembler::Or(Register dst, Register src) { or_z(dst, src); }
-
-// OR Pointer Size - dst = dst & src
-void TurboAssembler::OrP(Register dst, Register src) { OrRR(dst, src); }
-
-// Non-clobbering OR 32-bit - dst = src1 & src1
-void TurboAssembler::Or(Register dst, Register src1, Register src2) {
-  if (dst != src1 && dst != src2) {
-    // We prefer to generate XR/XGR, over the non clobbering XRK/XRK
-    // as XR is a smaller instruction
-    if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-      ork(dst, src1, src2);
-      return;
-    } else {
-      lr(dst, src1);
-    }
-  } else if (dst == src2) {
-    src2 = src1;
-  }
-  Or(dst, src2);
-}
-
-// Non-clobbering OR pointer size - dst = src1 & src1
-void TurboAssembler::OrP(Register dst, Register src1, Register src2) {
-  if (dst != src1 && dst != src2) {
-    // We prefer to generate XR/XGR, over the non clobbering XRK/XRK
-    // as XR is a smaller instruction
-    if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-      OrP_RRR(dst, src1, src2);
-      return;
-    } else {
-      LoadRR(dst, src1);
-    }
-  } else if (dst == src2) {
-    src2 = src1;
-  }
-  OrP(dst, src2);
-}
-
-// OR 32-bit (Reg - Mem)
-void TurboAssembler::Or(Register dst, const MemOperand& opnd) {
-  DCHECK(is_int20(opnd.offset()));
-  if (is_uint12(opnd.offset()))
-    o(dst, opnd);
-  else
-    oy(dst, opnd);
-}
-
-// OR Pointer Size (Reg - Mem)
-void TurboAssembler::OrP(Register dst, const MemOperand& opnd) {
-  DCHECK(is_int20(opnd.offset()));
-#if V8_TARGET_ARCH_S390X
-  og(dst, opnd);
-#else
-  Or(dst, opnd);
-#endif
-}
-
-// OR 32-bit - dst = dst & imm
-void TurboAssembler::Or(Register dst, const Operand& opnd) { oilf(dst, opnd); }
-
-// OR Pointer Size - dst = dst & imm
-void TurboAssembler::OrP(Register dst, const Operand& opnd) {
-#if V8_TARGET_ARCH_S390X
-  intptr_t value = opnd.immediate();
-  if (value >> 32 != 0) {
-    // this may not work b/c condition code won't be set correctly
-    oihf(dst, Operand(value >> 32));
-  }
-  oilf(dst, Operand(value & 0xFFFFFFFF));
-#else
-  Or(dst, opnd);
-#endif
-}
-
-// OR 32-bit - dst = src & imm
-void TurboAssembler::Or(Register dst, Register src, const Operand& opnd) {
-  if (dst != src) lr(dst, src);
-  oilf(dst, opnd);
-}
-
-// OR Pointer Size - dst = src & imm
-void TurboAssembler::OrP(Register dst, Register src, const Operand& opnd) {
-  if (dst != src) LoadRR(dst, src);
-  OrP(dst, opnd);
-}
-
-// XOR 32-bit - dst = dst & src
-void TurboAssembler::Xor(Register dst, Register src) { xr(dst, src); }
-
-// XOR Pointer Size - dst = dst & src
-void TurboAssembler::XorP(Register dst, Register src) { XorRR(dst, src); }
-
-// Non-clobbering XOR 32-bit - dst = src1 & src1
-void TurboAssembler::Xor(Register dst, Register src1, Register src2) {
-  if (dst != src1 && dst != src2) {
-    // We prefer to generate XR/XGR, over the non clobbering XRK/XRK
-    // as XR is a smaller instruction
-    if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-      xrk(dst, src1, src2);
-      return;
-    } else {
-      lr(dst, src1);
-    }
-  } else if (dst == src2) {
-    src2 = src1;
-  }
-  Xor(dst, src2);
-}
-
-// Non-clobbering XOR pointer size - dst = src1 & src1
-void TurboAssembler::XorP(Register dst, Register src1, Register src2) {
-  if (dst != src1 && dst != src2) {
-    // We prefer to generate XR/XGR, over the non clobbering XRK/XRK
-    // as XR is a smaller instruction
-    if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-      XorP_RRR(dst, src1, src2);
-      return;
-    } else {
-      LoadRR(dst, src1);
-    }
-  } else if (dst == src2) {
-    src2 = src1;
-  }
-  XorP(dst, src2);
-}
-
-// XOR 32-bit (Reg - Mem)
-void TurboAssembler::Xor(Register dst, const MemOperand& opnd) {
-  DCHECK(is_int20(opnd.offset()));
-  if (is_uint12(opnd.offset()))
-    x(dst, opnd);
-  else
-    xy(dst, opnd);
-}
-
-// XOR Pointer Size (Reg - Mem)
-void TurboAssembler::XorP(Register dst, const MemOperand& opnd) {
-  DCHECK(is_int20(opnd.offset()));
-#if V8_TARGET_ARCH_S390X
-  xg(dst, opnd);
-#else
-  Xor(dst, opnd);
-#endif
-}
-
-// XOR 32-bit - dst = dst & imm
-void TurboAssembler::Xor(Register dst, const Operand& opnd) { xilf(dst, opnd); }
-
-// XOR Pointer Size - dst = dst & imm
-void TurboAssembler::XorP(Register dst, const Operand& opnd) {
-#if V8_TARGET_ARCH_S390X
-  intptr_t value = opnd.immediate();
-  xihf(dst, Operand(value >> 32));
-  xilf(dst, Operand(value & 0xFFFFFFFF));
-#else
-  Xor(dst, opnd);
-#endif
-}
-
-// XOR 32-bit - dst = src & imm
-void TurboAssembler::Xor(Register dst, Register src, const Operand& opnd) {
-  if (dst != src) lr(dst, src);
-  xilf(dst, opnd);
-}
-
-// XOR Pointer Size - dst = src & imm
-void TurboAssembler::XorP(Register dst, Register src, const Operand& opnd) {
-  if (dst != src) LoadRR(dst, src);
-  XorP(dst, opnd);
-}
-
-void TurboAssembler::Not32(Register dst, Register src) {
-  if (src != no_reg && src != dst) lr(dst, src);
-  xilf(dst, Operand(0xFFFFFFFF));
-}
-
-void TurboAssembler::Not64(Register dst, Register src) {
-  if (src != no_reg && src != dst) lgr(dst, src);
-  xihf(dst, Operand(0xFFFFFFFF));
-  xilf(dst, Operand(0xFFFFFFFF));
-}
-
-void TurboAssembler::NotP(Register dst, Register src) {
-#if V8_TARGET_ARCH_S390X
-  Not64(dst, src);
-#else
-  Not32(dst, src);
-#endif
-}
-
-// works the same as mov
-void TurboAssembler::Load(Register dst, const Operand& opnd) {
-  intptr_t value = opnd.immediate();
-  if (is_int16(value)) {
-#if V8_TARGET_ARCH_S390X
-    lghi(dst, opnd);
-#else
-    lhi(dst, opnd);
-#endif
-  } else if (is_int32(value)) {
-#if V8_TARGET_ARCH_S390X
-    lgfi(dst, opnd);
-#else
-    iilf(dst, opnd);
-#endif
-  } else if (is_uint32(value)) {
-#if V8_TARGET_ARCH_S390X
-    llilf(dst, opnd);
-#else
-    iilf(dst, opnd);
-#endif
-  } else {
-    int32_t hi_32 = static_cast<int64_t>(value) >> 32;
-    int32_t lo_32 = static_cast<int32_t>(value);
-
-    iihf(dst, Operand(hi_32));
-    iilf(dst, Operand(lo_32));
-  }
-}
-
-void TurboAssembler::Load(Register dst, const MemOperand& opnd) {
-  DCHECK(is_int20(opnd.offset()));
-#if V8_TARGET_ARCH_S390X
-  lgf(dst, opnd);  // 64<-32
-#else
-  if (is_uint12(opnd.offset())) {
-    l(dst, opnd);
-  } else {
-    ly(dst, opnd);
-  }
-#endif
-}
-
-void TurboAssembler::LoadPositiveP(Register result, Register input) {
-#if V8_TARGET_ARCH_S390X
-  lpgr(result, input);
-#else
-  lpr(result, input);
-#endif
-}
-
-void TurboAssembler::LoadPositive32(Register result, Register input) {
-  lpr(result, input);
-  lgfr(result, result);
-}
-
-//-----------------------------------------------------------------------------
-//  Compare Helpers
-//-----------------------------------------------------------------------------
-
-// Compare 32-bit Register vs Register
-void TurboAssembler::Cmp32(Register src1, Register src2) { cr_z(src1, src2); }
-
-// Compare Pointer Sized Register vs Register
-void TurboAssembler::CmpP(Register src1, Register src2) {
-#if V8_TARGET_ARCH_S390X
-  cgr(src1, src2);
-#else
-  Cmp32(src1, src2);
-#endif
-}
-
-// Compare 32-bit Register vs Immediate
-// This helper will set up proper relocation entries if required.
-void TurboAssembler::Cmp32(Register dst, const Operand& opnd) {
-  if (opnd.rmode() == kRelocInfo_NONEPTR) {
-    intptr_t value = opnd.immediate();
-    if (is_int16(value))
-      chi(dst, opnd);
-    else
-      cfi(dst, opnd);
-  } else {
-    // Need to generate relocation record here
-    RecordRelocInfo(opnd.rmode(), opnd.immediate());
-    cfi(dst, opnd);
-  }
-}
-
-// Compare Pointer Sized  Register vs Immediate
-// This helper will set up proper relocation entries if required.
-void TurboAssembler::CmpP(Register dst, const Operand& opnd) {
-#if V8_TARGET_ARCH_S390X
-  if (opnd.rmode() == kRelocInfo_NONEPTR) {
-    cgfi(dst, opnd);
-  } else {
-    mov(r0, opnd);  // Need to generate 64-bit relocation
-    cgr(dst, r0);
-  }
-#else
-  Cmp32(dst, opnd);
-#endif
-}
-
-// Compare 32-bit Register vs Memory
-void TurboAssembler::Cmp32(Register dst, const MemOperand& opnd) {
-  // make sure offset is within 20 bit range
-  DCHECK(is_int20(opnd.offset()));
-  if (is_uint12(opnd.offset()))
-    c(dst, opnd);
-  else
-    cy(dst, opnd);
-}
-
-// Compare Pointer Size Register vs Memory
-void TurboAssembler::CmpP(Register dst, const MemOperand& opnd) {
-  // make sure offset is within 20 bit range
-  DCHECK(is_int20(opnd.offset()));
-#if V8_TARGET_ARCH_S390X
-  cg(dst, opnd);
-#else
-  Cmp32(dst, opnd);
-#endif
-}
-
-//-----------------------------------------------------------------------------
-// Compare Logical Helpers
-//-----------------------------------------------------------------------------
-
-// Compare Logical 32-bit Register vs Register
-void TurboAssembler::CmpLogical32(Register dst, Register src) { clr(dst, src); }
-
-// Compare Logical Pointer Sized Register vs Register
-void TurboAssembler::CmpLogicalP(Register dst, Register src) {
-#ifdef V8_TARGET_ARCH_S390X
-  clgr(dst, src);
-#else
-  CmpLogical32(dst, src);
-#endif
-}
-
-// Compare Logical 32-bit Register vs Immediate
-void TurboAssembler::CmpLogical32(Register dst, const Operand& opnd) {
-  clfi(dst, opnd);
-}
-
-// Compare Logical Pointer Sized Register vs Immediate
-void TurboAssembler::CmpLogicalP(Register dst, const Operand& opnd) {
-#if V8_TARGET_ARCH_S390X
-  DCHECK_EQ(static_cast<uint32_t>(opnd.immediate() >> 32), 0);
-  clgfi(dst, opnd);
-#else
-  CmpLogical32(dst, opnd);
-#endif
-}
-
-// Compare Logical 32-bit Register vs Memory
-void TurboAssembler::CmpLogical32(Register dst, const MemOperand& opnd) {
-  // make sure offset is within 20 bit range
-  DCHECK(is_int20(opnd.offset()));
-  if (is_uint12(opnd.offset()))
-    cl(dst, opnd);
-  else
-    cly(dst, opnd);
-}
-
-// Compare Logical Pointer Sized Register vs Memory
-void TurboAssembler::CmpLogicalP(Register dst, const MemOperand& opnd) {
-  // make sure offset is within 20 bit range
-  DCHECK(is_int20(opnd.offset()));
-#if V8_TARGET_ARCH_S390X
-  clg(dst, opnd);
-#else
-  CmpLogical32(dst, opnd);
-#endif
-}
-
-// Compare Logical Byte (Mem - Imm)
-void TurboAssembler::CmpLogicalByte(const MemOperand& mem, const Operand& imm) {
-  DCHECK(is_uint8(imm.immediate()));
-  if (is_uint12(mem.offset()))
-    cli(mem, imm);
-  else
-    cliy(mem, imm);
-}
-
-void TurboAssembler::Branch(Condition c, const Operand& opnd) {
-  intptr_t value = opnd.immediate();
-  if (is_int16(value))
-    brc(c, opnd);
-  else
-    brcl(c, opnd);
-}
-
-// Branch On Count.  Decrement R1, and branch if R1 != 0.
-void TurboAssembler::BranchOnCount(Register r1, Label* l) {
-  int32_t offset = branch_offset(l);
-  if (is_int16(offset)) {
-#if V8_TARGET_ARCH_S390X
-    brctg(r1, Operand(offset));
-#else
-    brct(r1, Operand(offset));
-#endif
-  } else {
-    AddP(r1, Operand(-1));
-    Branch(ne, Operand(offset));
-  }
-}
-
-void TurboAssembler::LoadIntLiteral(Register dst, int value) {
-  Load(dst, Operand(value));
-}
-
-void TurboAssembler::LoadSmiLiteral(Register dst, Smi* smi) {
-  intptr_t value = reinterpret_cast<intptr_t>(smi);
-#if V8_TARGET_ARCH_S390X
-  DCHECK_EQ(value & 0xFFFFFFFF, 0);
-  // The smi value is loaded in upper 32-bits.  Lower 32-bit are zeros.
-  llihf(dst, Operand(value >> 32));
-#else
-  llilf(dst, Operand(value));
-#endif
-}
-
-void TurboAssembler::LoadDoubleLiteral(DoubleRegister result, uint64_t value,
-                                       Register scratch) {
-  uint32_t hi_32 = value >> 32;
-  uint32_t lo_32 = static_cast<uint32_t>(value);
-
-  // Load the 64-bit value into a GPR, then transfer it to FPR via LDGR
-  if (value == 0) {
-    lzdr(result);
-  } else if (lo_32 == 0) {
-    llihf(scratch, Operand(hi_32));
-    ldgr(result, scratch);
-  } else {
-    iihf(scratch, Operand(hi_32));
-    iilf(scratch, Operand(lo_32));
-    ldgr(result, scratch);
-  }
-}
-
-void TurboAssembler::LoadDoubleLiteral(DoubleRegister result, double value,
-                                       Register scratch) {
-  uint64_t int_val = bit_cast<uint64_t, double>(value);
-  LoadDoubleLiteral(result, int_val, scratch);
-}
-
-void TurboAssembler::LoadFloat32Literal(DoubleRegister result, float value,
-                                        Register scratch) {
-  uint64_t int_val = static_cast<uint64_t>(bit_cast<uint32_t, float>(value))
-                     << 32;
-  LoadDoubleLiteral(result, int_val, scratch);
-}
-
-void TurboAssembler::CmpSmiLiteral(Register src1, Smi* smi, Register scratch) {
-#if V8_TARGET_ARCH_S390X
-  if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-    cih(src1, Operand(reinterpret_cast<intptr_t>(smi) >> 32));
-  } else {
-    LoadSmiLiteral(scratch, smi);
-    cgr(src1, scratch);
-  }
-#else
-  // CFI takes 32-bit immediate.
-  cfi(src1, Operand(smi));
-#endif
-}
-
-void TurboAssembler::CmpLogicalSmiLiteral(Register src1, Smi* smi,
-                                          Register scratch) {
-#if V8_TARGET_ARCH_S390X
-  if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-    clih(src1, Operand(reinterpret_cast<intptr_t>(smi) >> 32));
-  } else {
-    LoadSmiLiteral(scratch, smi);
-    clgr(src1, scratch);
-  }
-#else
-  // CLFI takes 32-bit immediate
-  clfi(src1, Operand(smi));
-#endif
-}
-
-void TurboAssembler::AddSmiLiteral(Register dst, Register src, Smi* smi,
-                                   Register scratch) {
-#if V8_TARGET_ARCH_S390X
-  if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-    if (dst != src) LoadRR(dst, src);
-    aih(dst, Operand(reinterpret_cast<intptr_t>(smi) >> 32));
-  } else {
-    LoadSmiLiteral(scratch, smi);
-    AddP(dst, src, scratch);
-  }
-#else
-  AddP(dst, src, Operand(reinterpret_cast<intptr_t>(smi)));
-#endif
-}
-
-void TurboAssembler::SubSmiLiteral(Register dst, Register src, Smi* smi,
-                                   Register scratch) {
-#if V8_TARGET_ARCH_S390X
-  if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-    if (dst != src) LoadRR(dst, src);
-    aih(dst, Operand((-reinterpret_cast<intptr_t>(smi)) >> 32));
-  } else {
-    LoadSmiLiteral(scratch, smi);
-    SubP(dst, src, scratch);
-  }
-#else
-  AddP(dst, src, Operand(-(reinterpret_cast<intptr_t>(smi))));
-#endif
-}
-
-void TurboAssembler::AndSmiLiteral(Register dst, Register src, Smi* smi) {
-  if (dst != src) LoadRR(dst, src);
-#if V8_TARGET_ARCH_S390X
-  DCHECK_EQ(reinterpret_cast<intptr_t>(smi) & 0xFFFFFFFF, 0);
-  int value = static_cast<int>(reinterpret_cast<intptr_t>(smi) >> 32);
-  nihf(dst, Operand(value));
-#else
-  nilf(dst, Operand(reinterpret_cast<int>(smi)));
-#endif
-}
-
-// Load a "pointer" sized value from the memory location
-void TurboAssembler::LoadP(Register dst, const MemOperand& mem,
-                           Register scratch) {
-  int offset = mem.offset();
-
-#if V8_TARGET_ARCH_S390X
-  MemOperand src = mem;
-  if (!is_int20(offset)) {
-    DCHECK(scratch != no_reg && scratch != r0 && mem.rx() == r0);
-    DCHECK(scratch != mem.rb());
-    LoadIntLiteral(scratch, offset);
-    src = MemOperand(mem.rb(), scratch);
-  }
-  lg(dst, src);
-#else
-  if (is_uint12(offset)) {
-    l(dst, mem);
-  } else if (is_int20(offset)) {
-    ly(dst, mem);
-  } else {
-    DCHECK(scratch != no_reg && scratch != r0 && mem.rx() == r0);
-    DCHECK(scratch != mem.rb());
-    LoadIntLiteral(scratch, offset);
-    l(dst, MemOperand(mem.rb(), scratch));
-  }
-#endif
-}
-
-// Store a "pointer" sized value to the memory location
-void TurboAssembler::StoreP(Register src, const MemOperand& mem,
-                            Register scratch) {
-  if (!is_int20(mem.offset())) {
-    DCHECK(scratch != no_reg);
-    DCHECK(scratch != r0);
-    LoadIntLiteral(scratch, mem.offset());
-#if V8_TARGET_ARCH_S390X
-    stg(src, MemOperand(mem.rb(), scratch));
-#else
-    st(src, MemOperand(mem.rb(), scratch));
-#endif
-  } else {
-#if V8_TARGET_ARCH_S390X
-    stg(src, mem);
-#else
-    // StoreW will try to generate ST if offset fits, otherwise
-    // it'll generate STY.
-    StoreW(src, mem);
-#endif
-  }
-}
-
-// Store a "pointer" sized constant to the memory location
-void TurboAssembler::StoreP(const MemOperand& mem, const Operand& opnd,
-                            Register scratch) {
-  // Relocations not supported
-  DCHECK_EQ(opnd.rmode(), kRelocInfo_NONEPTR);
-
-  // Try to use MVGHI/MVHI
-  if (CpuFeatures::IsSupported(GENERAL_INSTR_EXT) && is_uint12(mem.offset()) &&
-      mem.getIndexRegister() == r0 && is_int16(opnd.immediate())) {
-#if V8_TARGET_ARCH_S390X
-    mvghi(mem, opnd);
-#else
-    mvhi(mem, opnd);
-#endif
-  } else {
-    LoadImmP(scratch, opnd);
-    StoreP(scratch, mem);
-  }
-}
-
-void TurboAssembler::LoadMultipleP(Register dst1, Register dst2,
-                                   const MemOperand& mem) {
-#if V8_TARGET_ARCH_S390X
-  DCHECK(is_int20(mem.offset()));
-  lmg(dst1, dst2, mem);
-#else
-  if (is_uint12(mem.offset())) {
-    lm(dst1, dst2, mem);
-  } else {
-    DCHECK(is_int20(mem.offset()));
-    lmy(dst1, dst2, mem);
-  }
-#endif
-}
-
-void TurboAssembler::StoreMultipleP(Register src1, Register src2,
-                                    const MemOperand& mem) {
-#if V8_TARGET_ARCH_S390X
-  DCHECK(is_int20(mem.offset()));
-  stmg(src1, src2, mem);
-#else
-  if (is_uint12(mem.offset())) {
-    stm(src1, src2, mem);
-  } else {
-    DCHECK(is_int20(mem.offset()));
-    stmy(src1, src2, mem);
-  }
-#endif
-}
-
-void TurboAssembler::LoadMultipleW(Register dst1, Register dst2,
-                                   const MemOperand& mem) {
-  if (is_uint12(mem.offset())) {
-    lm(dst1, dst2, mem);
-  } else {
-    DCHECK(is_int20(mem.offset()));
-    lmy(dst1, dst2, mem);
-  }
-}
-
-void TurboAssembler::StoreMultipleW(Register src1, Register src2,
-                                    const MemOperand& mem) {
-  if (is_uint12(mem.offset())) {
-    stm(src1, src2, mem);
-  } else {
-    DCHECK(is_int20(mem.offset()));
-    stmy(src1, src2, mem);
-  }
-}
-
-// Load 32-bits and sign extend if necessary.
-void TurboAssembler::LoadW(Register dst, Register src) {
-#if V8_TARGET_ARCH_S390X
-  lgfr(dst, src);
-#else
-  if (dst != src) lr(dst, src);
-#endif
-}
-
-// Load 32-bits and sign extend if necessary.
-void TurboAssembler::LoadW(Register dst, const MemOperand& mem,
-                           Register scratch) {
-  int offset = mem.offset();
-
-  if (!is_int20(offset)) {
-    DCHECK(scratch != no_reg);
-    LoadIntLiteral(scratch, offset);
-#if V8_TARGET_ARCH_S390X
-    lgf(dst, MemOperand(mem.rb(), scratch));
-#else
-    l(dst, MemOperand(mem.rb(), scratch));
-#endif
-  } else {
-#if V8_TARGET_ARCH_S390X
-    lgf(dst, mem);
-#else
-    if (is_uint12(offset)) {
-      l(dst, mem);
-    } else {
-      ly(dst, mem);
-    }
-#endif
-  }
-}
-
-// Load 32-bits and zero extend if necessary.
-void TurboAssembler::LoadlW(Register dst, Register src) {
-#if V8_TARGET_ARCH_S390X
-  llgfr(dst, src);
-#else
-  if (dst != src) lr(dst, src);
-#endif
-}
-
-// Variable length depending on whether offset fits into immediate field
-// MemOperand of RX or RXY format
-void TurboAssembler::LoadlW(Register dst, const MemOperand& mem,
-                            Register scratch) {
-  Register base = mem.rb();
-  int offset = mem.offset();
-
-#if V8_TARGET_ARCH_S390X
-  if (is_int20(offset)) {
-    llgf(dst, mem);
-  } else if (scratch != no_reg) {
-    // Materialize offset into scratch register.
-    LoadIntLiteral(scratch, offset);
-    llgf(dst, MemOperand(base, scratch));
-  } else {
-    DCHECK(false);
-  }
-#else
-  bool use_RXform = false;
-  bool use_RXYform = false;
-  if (is_uint12(offset)) {
-    // RX-format supports unsigned 12-bits offset.
-    use_RXform = true;
-  } else if (is_int20(offset)) {
-    // RXY-format supports signed 20-bits offset.
-    use_RXYform = true;
-  } else if (scratch != no_reg) {
-    // Materialize offset into scratch register.
-    LoadIntLiteral(scratch, offset);
-  } else {
-    DCHECK(false);
-  }
-
-  if (use_RXform) {
-    l(dst, mem);
-  } else if (use_RXYform) {
-    ly(dst, mem);
-  } else {
-    ly(dst, MemOperand(base, scratch));
-  }
-#endif
-}
-
-void TurboAssembler::LoadLogicalHalfWordP(Register dst, const MemOperand& mem) {
-#if V8_TARGET_ARCH_S390X
-  llgh(dst, mem);
-#else
-  llh(dst, mem);
-#endif
-}
-
-void TurboAssembler::LoadLogicalHalfWordP(Register dst, Register src) {
-#if V8_TARGET_ARCH_S390X
-  llghr(dst, src);
-#else
-  llhr(dst, src);
-#endif
-}
-
-void TurboAssembler::LoadB(Register dst, const MemOperand& mem) {
-#if V8_TARGET_ARCH_S390X
-  lgb(dst, mem);
-#else
-  lb(dst, mem);
-#endif
-}
-
-void TurboAssembler::LoadB(Register dst, Register src) {
-#if V8_TARGET_ARCH_S390X
-  lgbr(dst, src);
-#else
-  lbr(dst, src);
-#endif
-}
-
-void TurboAssembler::LoadlB(Register dst, const MemOperand& mem) {
-#if V8_TARGET_ARCH_S390X
-  llgc(dst, mem);
-#else
-  llc(dst, mem);
-#endif
-}
-
-void TurboAssembler::LoadlB(Register dst, Register src) {
-#if V8_TARGET_ARCH_S390X
-  llgcr(dst, src);
-#else
-  llcr(dst, src);
-#endif
-}
-
-void TurboAssembler::LoadLogicalReversedWordP(Register dst,
-                                              const MemOperand& mem) {
-  lrv(dst, mem);
-  LoadlW(dst, dst);
-}
-
-void TurboAssembler::LoadLogicalReversedHalfWordP(Register dst,
-                                                  const MemOperand& mem) {
-  lrvh(dst, mem);
-  LoadLogicalHalfWordP(dst, dst);
-}
-
-
-// Load And Test (Reg <- Reg)
-void TurboAssembler::LoadAndTest32(Register dst, Register src) {
-  ltr(dst, src);
-}
-
-// Load And Test
-//     (Register dst(ptr) = Register src (32 | 32->64))
-// src is treated as a 32-bit signed integer, which is sign extended to
-// 64-bit if necessary.
-void TurboAssembler::LoadAndTestP_ExtendSrc(Register dst, Register src) {
-#if V8_TARGET_ARCH_S390X
-  ltgfr(dst, src);
-#else
-  ltr(dst, src);
-#endif
-}
-
-// Load And Test Pointer Sized (Reg <- Reg)
-void TurboAssembler::LoadAndTestP(Register dst, Register src) {
-#if V8_TARGET_ARCH_S390X
-  ltgr(dst, src);
-#else
-  ltr(dst, src);
-#endif
-}
-
-// Load And Test 32-bit (Reg <- Mem)
-void TurboAssembler::LoadAndTest32(Register dst, const MemOperand& mem) {
-  lt_z(dst, mem);
-}
-
-// Load And Test Pointer Sized (Reg <- Mem)
-void TurboAssembler::LoadAndTestP(Register dst, const MemOperand& mem) {
-#if V8_TARGET_ARCH_S390X
-  ltg(dst, mem);
-#else
-  lt_z(dst, mem);
-#endif
-}
-
-// Load On Condition Pointer Sized (Reg <- Reg)
-void TurboAssembler::LoadOnConditionP(Condition cond, Register dst,
-                                      Register src) {
-#if V8_TARGET_ARCH_S390X
-  locgr(cond, dst, src);
-#else
-  locr(cond, dst, src);
-#endif
-}
-
-// Load Double Precision (64-bit) Floating Point number from memory
-void TurboAssembler::LoadDouble(DoubleRegister dst, const MemOperand& mem) {
-  // for 32bit and 64bit we all use 64bit floating point regs
-  if (is_uint12(mem.offset())) {
-    ld(dst, mem);
-  } else {
-    ldy(dst, mem);
-  }
-}
-
-// Load Single Precision (32-bit) Floating Point number from memory
-void TurboAssembler::LoadFloat32(DoubleRegister dst, const MemOperand& mem) {
-  if (is_uint12(mem.offset())) {
-    le_z(dst, mem);
-  } else {
-    DCHECK(is_int20(mem.offset()));
-    ley(dst, mem);
-  }
-}
-
-// Load Single Precision (32-bit) Floating Point number from memory,
-// and convert to Double Precision (64-bit)
-void TurboAssembler::LoadFloat32ConvertToDouble(DoubleRegister dst,
-                                                const MemOperand& mem) {
-  LoadFloat32(dst, mem);
-  ldebr(dst, dst);
-}
-
-// Store Double Precision (64-bit) Floating Point number to memory
-void TurboAssembler::StoreDouble(DoubleRegister dst, const MemOperand& mem) {
-  if (is_uint12(mem.offset())) {
-    std(dst, mem);
-  } else {
-    stdy(dst, mem);
-  }
-}
-
-// Store Single Precision (32-bit) Floating Point number to memory
-void TurboAssembler::StoreFloat32(DoubleRegister src, const MemOperand& mem) {
-  if (is_uint12(mem.offset())) {
-    ste(src, mem);
-  } else {
-    stey(src, mem);
-  }
-}
-
-// Convert Double precision (64-bit) to Single Precision (32-bit)
-// and store resulting Float32 to memory
-void TurboAssembler::StoreDoubleAsFloat32(DoubleRegister src,
-                                          const MemOperand& mem,
-                                          DoubleRegister scratch) {
-  ledbr(scratch, src);
-  StoreFloat32(scratch, mem);
-}
-
-void TurboAssembler::AddFloat32(DoubleRegister dst, const MemOperand& opnd,
-                                DoubleRegister scratch) {
-  if (is_uint12(opnd.offset())) {
-    aeb(dst, opnd);
-  } else {
-    ley(scratch, opnd);
-    aebr(dst, scratch);
-  }
-}
-
-void TurboAssembler::AddFloat64(DoubleRegister dst, const MemOperand& opnd,
-                                DoubleRegister scratch) {
-  if (is_uint12(opnd.offset())) {
-    adb(dst, opnd);
-  } else {
-    ldy(scratch, opnd);
-    adbr(dst, scratch);
-  }
-}
-
-void TurboAssembler::SubFloat32(DoubleRegister dst, const MemOperand& opnd,
-                                DoubleRegister scratch) {
-  if (is_uint12(opnd.offset())) {
-    seb(dst, opnd);
-  } else {
-    ley(scratch, opnd);
-    sebr(dst, scratch);
-  }
-}
-
-void TurboAssembler::SubFloat64(DoubleRegister dst, const MemOperand& opnd,
-                                DoubleRegister scratch) {
-  if (is_uint12(opnd.offset())) {
-    sdb(dst, opnd);
-  } else {
-    ldy(scratch, opnd);
-    sdbr(dst, scratch);
-  }
-}
-
-void TurboAssembler::MulFloat32(DoubleRegister dst, const MemOperand& opnd,
-                                DoubleRegister scratch) {
-  if (is_uint12(opnd.offset())) {
-    meeb(dst, opnd);
-  } else {
-    ley(scratch, opnd);
-    meebr(dst, scratch);
-  }
-}
-
-void TurboAssembler::MulFloat64(DoubleRegister dst, const MemOperand& opnd,
-                                DoubleRegister scratch) {
-  if (is_uint12(opnd.offset())) {
-    mdb(dst, opnd);
-  } else {
-    ldy(scratch, opnd);
-    mdbr(dst, scratch);
-  }
-}
-
-void TurboAssembler::DivFloat32(DoubleRegister dst, const MemOperand& opnd,
-                                DoubleRegister scratch) {
-  if (is_uint12(opnd.offset())) {
-    deb(dst, opnd);
-  } else {
-    ley(scratch, opnd);
-    debr(dst, scratch);
-  }
-}
-
-void TurboAssembler::DivFloat64(DoubleRegister dst, const MemOperand& opnd,
-                                DoubleRegister scratch) {
-  if (is_uint12(opnd.offset())) {
-    ddb(dst, opnd);
-  } else {
-    ldy(scratch, opnd);
-    ddbr(dst, scratch);
-  }
-}
-
-void TurboAssembler::LoadFloat32ToDouble(DoubleRegister dst,
-                                         const MemOperand& opnd,
-                                         DoubleRegister scratch) {
-  if (is_uint12(opnd.offset())) {
-    ldeb(dst, opnd);
-  } else {
-    ley(scratch, opnd);
-    ldebr(dst, scratch);
-  }
-}
-
-// Variable length depending on whether offset fits into immediate field
-// MemOperand of RX or RXY format
-void TurboAssembler::StoreW(Register src, const MemOperand& mem,
-                            Register scratch) {
-  Register base = mem.rb();
-  int offset = mem.offset();
-
-  bool use_RXform = false;
-  bool use_RXYform = false;
-
-  if (is_uint12(offset)) {
-    // RX-format supports unsigned 12-bits offset.
-    use_RXform = true;
-  } else if (is_int20(offset)) {
-    // RXY-format supports signed 20-bits offset.
-    use_RXYform = true;
-  } else if (scratch != no_reg) {
-    // Materialize offset into scratch register.
-    LoadIntLiteral(scratch, offset);
-  } else {
-    // scratch is no_reg
-    DCHECK(false);
-  }
-
-  if (use_RXform) {
-    st(src, mem);
-  } else if (use_RXYform) {
-    sty(src, mem);
-  } else {
-    StoreW(src, MemOperand(base, scratch));
-  }
-}
-
-// Loads 16-bits half-word value from memory and sign extends to pointer
-// sized register
-void TurboAssembler::LoadHalfWordP(Register dst, const MemOperand& mem,
-                                   Register scratch) {
-  Register base = mem.rb();
-  int offset = mem.offset();
-
-  if (!is_int20(offset)) {
-    DCHECK(scratch != no_reg);
-    LoadIntLiteral(scratch, offset);
-#if V8_TARGET_ARCH_S390X
-    lgh(dst, MemOperand(base, scratch));
-#else
-    lh(dst, MemOperand(base, scratch));
-#endif
-  } else {
-#if V8_TARGET_ARCH_S390X
-    lgh(dst, mem);
-#else
-    if (is_uint12(offset)) {
-      lh(dst, mem);
-    } else {
-      lhy(dst, mem);
-    }
-#endif
-  }
-}
-
-// Variable length depending on whether offset fits into immediate field
-// MemOperand current only supports d-form
-void TurboAssembler::StoreHalfWord(Register src, const MemOperand& mem,
-                                   Register scratch) {
-  Register base = mem.rb();
-  int offset = mem.offset();
-
-  if (is_uint12(offset)) {
-    sth(src, mem);
-  } else if (is_int20(offset)) {
-    sthy(src, mem);
-  } else {
-    DCHECK(scratch != no_reg);
-    LoadIntLiteral(scratch, offset);
-    sth(src, MemOperand(base, scratch));
-  }
-}
-
-// Variable length depending on whether offset fits into immediate field
-// MemOperand current only supports d-form
-void TurboAssembler::StoreByte(Register src, const MemOperand& mem,
-                               Register scratch) {
-  Register base = mem.rb();
-  int offset = mem.offset();
-
-  if (is_uint12(offset)) {
-    stc(src, mem);
-  } else if (is_int20(offset)) {
-    stcy(src, mem);
-  } else {
-    DCHECK(scratch != no_reg);
-    LoadIntLiteral(scratch, offset);
-    stc(src, MemOperand(base, scratch));
-  }
-}
-
-// Shift left logical for 32-bit integer types.
-void TurboAssembler::ShiftLeft(Register dst, Register src, const Operand& val) {
-  if (dst == src) {
-    sll(dst, val);
-  } else if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-    sllk(dst, src, val);
-  } else {
-    lr(dst, src);
-    sll(dst, val);
-  }
-}
-
-// Shift left logical for 32-bit integer types.
-void TurboAssembler::ShiftLeft(Register dst, Register src, Register val) {
-  if (dst == src) {
-    sll(dst, val);
-  } else if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-    sllk(dst, src, val);
-  } else {
-    DCHECK(dst != val);  // The lr/sll path clobbers val.
-    lr(dst, src);
-    sll(dst, val);
-  }
-}
-
-// Shift right logical for 32-bit integer types.
-void TurboAssembler::ShiftRight(Register dst, Register src,
-                                const Operand& val) {
-  if (dst == src) {
-    srl(dst, val);
-  } else if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-    srlk(dst, src, val);
-  } else {
-    lr(dst, src);
-    srl(dst, val);
-  }
-}
-
-// Shift right logical for 32-bit integer types.
-void TurboAssembler::ShiftRight(Register dst, Register src, Register val) {
-  if (dst == src) {
-    srl(dst, val);
-  } else if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-    srlk(dst, src, val);
-  } else {
-    DCHECK(dst != val);  // The lr/srl path clobbers val.
-    lr(dst, src);
-    srl(dst, val);
-  }
-}
-
-// Shift left arithmetic for 32-bit integer types.
-void TurboAssembler::ShiftLeftArith(Register dst, Register src,
-                                    const Operand& val) {
-  if (dst == src) {
-    sla(dst, val);
-  } else if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-    slak(dst, src, val);
-  } else {
-    lr(dst, src);
-    sla(dst, val);
-  }
-}
-
-// Shift left arithmetic for 32-bit integer types.
-void TurboAssembler::ShiftLeftArith(Register dst, Register src, Register val) {
-  if (dst == src) {
-    sla(dst, val);
-  } else if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-    slak(dst, src, val);
-  } else {
-    DCHECK(dst != val);  // The lr/sla path clobbers val.
-    lr(dst, src);
-    sla(dst, val);
-  }
-}
-
-// Shift right arithmetic for 32-bit integer types.
-void TurboAssembler::ShiftRightArith(Register dst, Register src,
-                                     const Operand& val) {
-  if (dst == src) {
-    sra(dst, val);
-  } else if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-    srak(dst, src, val);
-  } else {
-    lr(dst, src);
-    sra(dst, val);
-  }
-}
-
-// Shift right arithmetic for 32-bit integer types.
-void TurboAssembler::ShiftRightArith(Register dst, Register src, Register val) {
-  if (dst == src) {
-    sra(dst, val);
-  } else if (CpuFeatures::IsSupported(DISTINCT_OPS)) {
-    srak(dst, src, val);
-  } else {
-    DCHECK(dst != val);  // The lr/sra path clobbers val.
-    lr(dst, src);
-    sra(dst, val);
-  }
-}
-
-// Clear right most # of bits
-void TurboAssembler::ClearRightImm(Register dst, Register src,
-                                   const Operand& val) {
-  int numBitsToClear = val.immediate() % (kPointerSize * 8);
-
-  // Try to use RISBG if possible
-  if (CpuFeatures::IsSupported(GENERAL_INSTR_EXT)) {
-    int endBit = 63 - numBitsToClear;
-    risbg(dst, src, Operand::Zero(), Operand(endBit), Operand::Zero(), true);
-    return;
-  }
-
-  uint64_t hexMask = ~((1L << numBitsToClear) - 1);
-
-  // S390 AND instr clobbers source.  Make a copy if necessary
-  if (dst != src) LoadRR(dst, src);
-
-  if (numBitsToClear <= 16) {
-    nill(dst, Operand(static_cast<uint16_t>(hexMask)));
-  } else if (numBitsToClear <= 32) {
-    nilf(dst, Operand(static_cast<uint32_t>(hexMask)));
-  } else if (numBitsToClear <= 64) {
-    nilf(dst, Operand(static_cast<intptr_t>(0)));
-    nihf(dst, Operand(hexMask >> 32));
-  }
-}
-
-void TurboAssembler::Popcnt32(Register dst, Register src) {
-  DCHECK(src != r0);
-  DCHECK(dst != r0);
-
-  popcnt(dst, src);
-  ShiftRight(r0, dst, Operand(16));
-  ar(dst, r0);
-  ShiftRight(r0, dst, Operand(8));
-  ar(dst, r0);
-  llgcr(dst, dst);
-}
-
-#ifdef V8_TARGET_ARCH_S390X
-void TurboAssembler::Popcnt64(Register dst, Register src) {
-  DCHECK(src != r0);
-  DCHECK(dst != r0);
-
-  popcnt(dst, src);
-  ShiftRightP(r0, dst, Operand(32));
-  AddP(dst, r0);
-  ShiftRightP(r0, dst, Operand(16));
-  AddP(dst, r0);
-  ShiftRightP(r0, dst, Operand(8));
-  AddP(dst, r0);
-  LoadlB(dst, dst);
-}
-#endif
-
-void TurboAssembler::SwapP(Register src, Register dst, Register scratch) {
-  if (src == dst) return;
-  DCHECK(!AreAliased(src, dst, scratch));
-  LoadRR(scratch, src);
-  LoadRR(src, dst);
-  LoadRR(dst, scratch);
-}
-
-void TurboAssembler::SwapP(Register src, MemOperand dst, Register scratch) {
-  if (dst.rx() != r0) DCHECK(!AreAliased(src, dst.rx(), scratch));
-  if (dst.rb() != r0) DCHECK(!AreAliased(src, dst.rb(), scratch));
-  DCHECK(!AreAliased(src, scratch));
-  LoadRR(scratch, src);
-  LoadP(src, dst);
-  StoreP(scratch, dst);
-}
-
-void TurboAssembler::SwapP(MemOperand src, MemOperand dst, Register scratch_0,
-                           Register scratch_1) {
-  if (src.rx() != r0) DCHECK(!AreAliased(src.rx(), scratch_0, scratch_1));
-  if (src.rb() != r0) DCHECK(!AreAliased(src.rb(), scratch_0, scratch_1));
-  if (dst.rx() != r0) DCHECK(!AreAliased(dst.rx(), scratch_0, scratch_1));
-  if (dst.rb() != r0) DCHECK(!AreAliased(dst.rb(), scratch_0, scratch_1));
-  DCHECK(!AreAliased(scratch_0, scratch_1));
-  LoadP(scratch_0, src);
-  LoadP(scratch_1, dst);
-  StoreP(scratch_0, dst);
-  StoreP(scratch_1, src);
-}
-
-void TurboAssembler::SwapFloat32(DoubleRegister src, DoubleRegister dst,
-                                 DoubleRegister scratch) {
-  if (src == dst) return;
-  DCHECK(!AreAliased(src, dst, scratch));
-  ldr(scratch, src);
-  ldr(src, dst);
-  ldr(dst, scratch);
-}
-
-void TurboAssembler::SwapFloat32(DoubleRegister src, MemOperand dst,
-                                 DoubleRegister scratch) {
-  DCHECK(!AreAliased(src, scratch));
-  ldr(scratch, src);
-  LoadFloat32(src, dst);
-  StoreFloat32(scratch, dst);
-}
-
-void TurboAssembler::SwapFloat32(MemOperand src, MemOperand dst,
-                                 DoubleRegister scratch_0,
-                                 DoubleRegister scratch_1) {
-  DCHECK(!AreAliased(scratch_0, scratch_1));
-  LoadFloat32(scratch_0, src);
-  LoadFloat32(scratch_1, dst);
-  StoreFloat32(scratch_0, dst);
-  StoreFloat32(scratch_1, src);
-}
-
-void TurboAssembler::SwapDouble(DoubleRegister src, DoubleRegister dst,
-                                DoubleRegister scratch) {
-  if (src == dst) return;
-  DCHECK(!AreAliased(src, dst, scratch));
-  ldr(scratch, src);
-  ldr(src, dst);
-  ldr(dst, scratch);
-}
-
-void TurboAssembler::SwapDouble(DoubleRegister src, MemOperand dst,
-                                DoubleRegister scratch) {
-  DCHECK(!AreAliased(src, scratch));
-  ldr(scratch, src);
-  LoadDouble(src, dst);
-  StoreDouble(scratch, dst);
-}
-
-void TurboAssembler::SwapDouble(MemOperand src, MemOperand dst,
-                                DoubleRegister scratch_0,
-                                DoubleRegister scratch_1) {
-  DCHECK(!AreAliased(scratch_0, scratch_1));
-  LoadDouble(scratch_0, src);
-  LoadDouble(scratch_1, dst);
-  StoreDouble(scratch_0, dst);
-  StoreDouble(scratch_1, src);
-}
-
-#ifdef DEBUG
-bool AreAliased(Register reg1, Register reg2, Register reg3, Register reg4,
-                Register reg5, Register reg6, Register reg7, Register reg8,
-                Register reg9, Register reg10) {
-  int n_of_valid_regs = reg1.is_valid() + reg2.is_valid() + reg3.is_valid() +
-                        reg4.is_valid() + reg5.is_valid() + reg6.is_valid() +
-                        reg7.is_valid() + reg8.is_valid() + reg9.is_valid() +
-                        reg10.is_valid();
-
-  RegList regs = 0;
-  if (reg1.is_valid()) regs |= reg1.bit();
-  if (reg2.is_valid()) regs |= reg2.bit();
-  if (reg3.is_valid()) regs |= reg3.bit();
-  if (reg4.is_valid()) regs |= reg4.bit();
-  if (reg5.is_valid()) regs |= reg5.bit();
-  if (reg6.is_valid()) regs |= reg6.bit();
-  if (reg7.is_valid()) regs |= reg7.bit();
-  if (reg8.is_valid()) regs |= reg8.bit();
-  if (reg9.is_valid()) regs |= reg9.bit();
-  if (reg10.is_valid()) regs |= reg10.bit();
-  int n_of_non_aliasing_regs = NumRegs(regs);
-
-  return n_of_valid_regs != n_of_non_aliasing_regs;
-}
-bool AreAliased(DoubleRegister reg1, DoubleRegister reg2, DoubleRegister reg3,
-                DoubleRegister reg4, DoubleRegister reg5, DoubleRegister reg6,
-                DoubleRegister reg7, DoubleRegister reg8, DoubleRegister reg9,
-                DoubleRegister reg10) {
-  int n_of_valid_regs = reg1.is_valid() + reg2.is_valid() + reg3.is_valid() +
-                        reg4.is_valid() + reg5.is_valid() + reg6.is_valid() +
-                        reg7.is_valid() + reg8.is_valid() + reg9.is_valid() +
-                        reg10.is_valid();
-
-  RegList regs = 0;
-  if (reg1.is_valid()) regs |= reg1.bit();
-  if (reg2.is_valid()) regs |= reg2.bit();
-  if (reg3.is_valid()) regs |= reg3.bit();
-  if (reg4.is_valid()) regs |= reg4.bit();
-  if (reg5.is_valid()) regs |= reg5.bit();
-  if (reg6.is_valid()) regs |= reg6.bit();
-  if (reg7.is_valid()) regs |= reg7.bit();
-  if (reg8.is_valid()) regs |= reg8.bit();
-  if (reg9.is_valid()) regs |= reg9.bit();
-  if (reg10.is_valid()) regs |= reg10.bit();
-  int n_of_non_aliasing_regs = NumRegs(regs);
-
-  return n_of_valid_regs != n_of_non_aliasing_regs;
-}
-#endif
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_S390
diff --git a/src/v8/src/s390/macro-assembler-s390.h b/src/v8/src/s390/macro-assembler-s390.h
deleted file mode 100644
index fcc62f2..0000000
--- a/src/v8/src/s390/macro-assembler-s390.h
+++ /dev/null
@@ -1,1331 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_S390_MACRO_ASSEMBLER_S390_H_
-#define V8_S390_MACRO_ASSEMBLER_S390_H_
-
-#include "src/assembler.h"
-#include "src/bailout-reason.h"
-#include "src/globals.h"
-#include "src/s390/assembler-s390.h"
-
-namespace v8 {
-namespace internal {
-
-// Give alias names to registers for calling conventions.
-const Register kReturnRegister0 = r2;
-const Register kReturnRegister1 = r3;
-const Register kReturnRegister2 = r4;
-const Register kJSFunctionRegister = r3;
-const Register kContextRegister = r13;
-const Register kAllocateSizeRegister = r3;
-const Register kInterpreterAccumulatorRegister = r2;
-const Register kInterpreterBytecodeOffsetRegister = r6;
-const Register kInterpreterBytecodeArrayRegister = r7;
-const Register kInterpreterDispatchTableRegister = r8;
-const Register kJavaScriptCallArgCountRegister = r2;
-const Register kJavaScriptCallNewTargetRegister = r5;
-const Register kRuntimeCallFunctionRegister = r3;
-const Register kRuntimeCallArgCountRegister = r2;
-
-// ----------------------------------------------------------------------------
-// Static helper functions
-
-// Generate a MemOperand for loading a field from an object.
-inline MemOperand FieldMemOperand(Register object, int offset) {
-  return MemOperand(object, offset - kHeapObjectTag);
-}
-
-// Generate a MemOperand for loading a field from an object.
-inline MemOperand FieldMemOperand(Register object, Register index, int offset) {
-  return MemOperand(object, index, offset - kHeapObjectTag);
-}
-
-// Generate a MemOperand for loading a field from Root register
-inline MemOperand RootMemOperand(Heap::RootListIndex index) {
-  return MemOperand(kRootRegister, index << kPointerSizeLog2);
-}
-
-// Flags used for AllocateHeapNumber
-enum TaggingMode {
-  // Tag the result.
-  TAG_RESULT,
-  // Don't tag
-  DONT_TAG_RESULT
-};
-
-enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET };
-enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK };
-enum LinkRegisterStatus { kLRHasNotBeenSaved, kLRHasBeenSaved };
-
-Register GetRegisterThatIsNotOneOf(Register reg1, Register reg2 = no_reg,
-                                   Register reg3 = no_reg,
-                                   Register reg4 = no_reg,
-                                   Register reg5 = no_reg,
-                                   Register reg6 = no_reg);
-
-#ifdef DEBUG
-bool AreAliased(Register reg1, Register reg2, Register reg3 = no_reg,
-                Register reg4 = no_reg, Register reg5 = no_reg,
-                Register reg6 = no_reg, Register reg7 = no_reg,
-                Register reg8 = no_reg, Register reg9 = no_reg,
-                Register reg10 = no_reg);
-bool AreAliased(DoubleRegister reg1, DoubleRegister reg2,
-                DoubleRegister reg3 = no_dreg, DoubleRegister reg4 = no_dreg,
-                DoubleRegister reg5 = no_dreg, DoubleRegister reg6 = no_dreg,
-                DoubleRegister reg7 = no_dreg, DoubleRegister reg8 = no_dreg,
-                DoubleRegister reg9 = no_dreg, DoubleRegister reg10 = no_dreg);
-#endif
-
-// These exist to provide portability between 32 and 64bit
-#if V8_TARGET_ARCH_S390X
-#define Div divd
-
-// The length of the arithmetic operation is the length
-// of the register.
-
-// Length:
-// H = halfword
-// W = word
-
-// arithmetics and bitwise
-#define AddMI agsi
-#define AddRR agr
-#define SubRR sgr
-#define AndRR ngr
-#define OrRR ogr
-#define XorRR xgr
-#define LoadComplementRR lcgr
-#define LoadNegativeRR lngr
-
-// Distinct Operands
-#define AddP_RRR agrk
-#define AddPImm_RRI aghik
-#define AddLogicalP_RRR algrk
-#define SubP_RRR sgrk
-#define SubLogicalP_RRR slgrk
-#define AndP_RRR ngrk
-#define OrP_RRR ogrk
-#define XorP_RRR xgrk
-
-// Load / Store
-#define LoadRR lgr
-#define LoadAndTestRR ltgr
-#define LoadImmP lghi
-
-// Compare
-#define CmpPH cghi
-#define CmpLogicalPW clgfi
-
-// Shifts
-#define ShiftLeftP sllg
-#define ShiftRightP srlg
-#define ShiftLeftArithP slag
-#define ShiftRightArithP srag
-#else
-
-// arithmetics and bitwise
-// Reg2Reg
-#define AddMI asi
-#define AddRR ar
-#define SubRR sr
-#define AndRR nr
-#define OrRR or_z
-#define XorRR xr
-#define LoadComplementRR lcr
-#define LoadNegativeRR lnr
-
-// Distinct Operands
-#define AddP_RRR ark
-#define AddPImm_RRI ahik
-#define AddLogicalP_RRR alrk
-#define SubP_RRR srk
-#define SubLogicalP_RRR slrk
-#define AndP_RRR nrk
-#define OrP_RRR ork
-#define XorP_RRR xrk
-
-// Load / Store
-#define LoadRR lr
-#define LoadAndTestRR ltr
-#define LoadImmP lhi
-
-// Compare
-#define CmpPH chi
-#define CmpLogicalPW clfi
-
-// Shifts
-#define ShiftLeftP ShiftLeft
-#define ShiftRightP ShiftRight
-#define ShiftLeftArithP ShiftLeftArith
-#define ShiftRightArithP ShiftRightArith
-
-#endif
-
-class TurboAssembler : public Assembler {
- public:
-  TurboAssembler(Isolate* isolate, void* buffer, int buffer_size,
-                 CodeObjectRequired create_code_object);
-
-  Isolate* isolate() const { return isolate_; }
-
-  Handle<HeapObject> CodeObject() {
-    DCHECK(!code_object_.is_null());
-    return code_object_;
-  }
-
-  // Returns the size of a call in instructions.
-  static int CallSize(Register target);
-  int CallSize(Address target, RelocInfo::Mode rmode, Condition cond = al);
-
-  // Jump, Call, and Ret pseudo instructions implementing inter-working.
-  void Jump(Register target);
-  void Jump(Address target, RelocInfo::Mode rmode, Condition cond = al,
-            CRegister cr = cr7);
-  void Jump(Handle<Code> code, RelocInfo::Mode rmode, Condition cond = al);
-  // Jump the register contains a smi.
-  inline void JumpIfSmi(Register value, Label* smi_label) {
-    TestIfSmi(value);
-    beq(smi_label /*, cr0*/);  // branch if SMI
-  }
-  void Call(Register target);
-  void Call(Address target, RelocInfo::Mode rmode, Condition cond = al);
-  int CallSize(Handle<Code> code,
-               RelocInfo::Mode rmode = RelocInfo::CODE_TARGET,
-               Condition cond = al);
-  void Call(Handle<Code> code, RelocInfo::Mode rmode = RelocInfo::CODE_TARGET,
-            Condition cond = al);
-  void Ret() { b(r14); }
-  void Ret(Condition cond) { b(cond, r14); }
-
-  void CallForDeoptimization(Address target, RelocInfo::Mode rmode) {
-    Call(target, rmode);
-  }
-
-  // Emit code to discard a non-negative number of pointer-sized elements
-  // from the stack, clobbering only the sp register.
-  void Drop(int count);
-  void Drop(Register count, Register scratch = r0);
-
-  void Ret(int drop) {
-    Drop(drop);
-    Ret();
-  }
-
-  void Call(Label* target);
-
-  // Register move. May do nothing if the registers are identical.
-  void Move(Register dst, Smi* smi) { LoadSmiLiteral(dst, smi); }
-  void Move(Register dst, Handle<HeapObject> value);
-  void Move(Register dst, Register src, Condition cond = al);
-  void Move(DoubleRegister dst, DoubleRegister src);
-
-  void SaveRegisters(RegList registers);
-  void RestoreRegisters(RegList registers);
-
-  void CallRecordWriteStub(Register object, Register address,
-                           RememberedSetAction remembered_set_action,
-                           SaveFPRegsMode fp_mode);
-
-  void MultiPush(RegList regs, Register location = sp);
-  void MultiPop(RegList regs, Register location = sp);
-
-  void MultiPushDoubles(RegList dregs, Register location = sp);
-  void MultiPopDoubles(RegList dregs, Register location = sp);
-
-  // Calculate how much stack space (in bytes) are required to store caller
-  // registers excluding those specified in the arguments.
-  int RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode,
-                                      Register exclusion1 = no_reg,
-                                      Register exclusion2 = no_reg,
-                                      Register exclusion3 = no_reg) const;
-
-  // Push caller saved registers on the stack, and return the number of bytes
-  // stack pointer is adjusted.
-  int PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1 = no_reg,
-                      Register exclusion2 = no_reg,
-                      Register exclusion3 = no_reg);
-  // Restore caller saved registers from the stack, and return the number of
-  // bytes stack pointer is adjusted.
-  int PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1 = no_reg,
-                     Register exclusion2 = no_reg,
-                     Register exclusion3 = no_reg);
-
-  // Load an object from the root table.
-  void LoadRoot(Register destination, Heap::RootListIndex index,
-                Condition cond = al);
-  //--------------------------------------------------------------------------
-  // S390 Macro Assemblers for Instructions
-  //--------------------------------------------------------------------------
-
-  // Arithmetic Operations
-
-  // Add (Register - Immediate)
-  void Add32(Register dst, const Operand& imm);
-  void Add32_RI(Register dst, const Operand& imm);
-  void AddP(Register dst, const Operand& imm);
-  void Add32(Register dst, Register src, const Operand& imm);
-  void Add32_RRI(Register dst, Register src, const Operand& imm);
-  void AddP(Register dst, Register src, const Operand& imm);
-
-  // Add (Register - Register)
-  void Add32(Register dst, Register src);
-  void AddP(Register dst, Register src);
-  void AddP_ExtendSrc(Register dst, Register src);
-  void Add32(Register dst, Register src1, Register src2);
-  void AddP(Register dst, Register src1, Register src2);
-  void AddP_ExtendSrc(Register dst, Register src1, Register src2);
-
-  // Add (Register - Mem)
-  void Add32(Register dst, const MemOperand& opnd);
-  void AddP(Register dst, const MemOperand& opnd);
-  void AddP_ExtendSrc(Register dst, const MemOperand& opnd);
-
-  // Add (Mem - Immediate)
-  void Add32(const MemOperand& opnd, const Operand& imm);
-  void AddP(const MemOperand& opnd, const Operand& imm);
-
-  // Add Logical (Register - Register)
-  void AddLogical32(Register dst, Register src1, Register src2);
-
-  // Add Logical With Carry (Register - Register)
-  void AddLogicalWithCarry32(Register dst, Register src1, Register src2);
-
-  // Add Logical (Register - Immediate)
-  void AddLogical(Register dst, const Operand& imm);
-  void AddLogicalP(Register dst, const Operand& imm);
-
-  // Add Logical (Register - Mem)
-  void AddLogical(Register dst, const MemOperand& opnd);
-  void AddLogicalP(Register dst, const MemOperand& opnd);
-
-  // Subtract (Register - Immediate)
-  void Sub32(Register dst, const Operand& imm);
-  void Sub32_RI(Register dst, const Operand& imm) { Sub32(dst, imm); }
-  void SubP(Register dst, const Operand& imm);
-  void Sub32(Register dst, Register src, const Operand& imm);
-  void Sub32_RRI(Register dst, Register src, const Operand& imm) {
-    Sub32(dst, src, imm);
-  }
-  void SubP(Register dst, Register src, const Operand& imm);
-
-  // Subtract (Register - Register)
-  void Sub32(Register dst, Register src);
-  void SubP(Register dst, Register src);
-  void SubP_ExtendSrc(Register dst, Register src);
-  void Sub32(Register dst, Register src1, Register src2);
-  void SubP(Register dst, Register src1, Register src2);
-  void SubP_ExtendSrc(Register dst, Register src1, Register src2);
-
-  // Subtract (Register - Mem)
-  void Sub32(Register dst, const MemOperand& opnd);
-  void SubP(Register dst, const MemOperand& opnd);
-  void SubP_ExtendSrc(Register dst, const MemOperand& opnd);
-
-  // Subtract Logical (Register - Mem)
-  void SubLogical(Register dst, const MemOperand& opnd);
-  void SubLogicalP(Register dst, const MemOperand& opnd);
-  void SubLogicalP_ExtendSrc(Register dst, const MemOperand& opnd);
-  // Subtract Logical 32-bit
-  void SubLogical32(Register dst, Register src1, Register src2);
-  // Subtract Logical With Borrow 32-bit
-  void SubLogicalWithBorrow32(Register dst, Register src1, Register src2);
-
-  // Multiply
-  void MulP(Register dst, const Operand& opnd);
-  void MulP(Register dst, Register src);
-  void MulP(Register dst, const MemOperand& opnd);
-  void Mul(Register dst, Register src1, Register src2);
-  void Mul32(Register dst, const MemOperand& src1);
-  void Mul32(Register dst, Register src1);
-  void Mul32(Register dst, const Operand& src1);
-  void MulHigh32(Register dst, Register src1, const MemOperand& src2);
-  void MulHigh32(Register dst, Register src1, Register src2);
-  void MulHigh32(Register dst, Register src1, const Operand& src2);
-  void MulHighU32(Register dst, Register src1, const MemOperand& src2);
-  void MulHighU32(Register dst, Register src1, Register src2);
-  void MulHighU32(Register dst, Register src1, const Operand& src2);
-  void Mul32WithOverflowIfCCUnequal(Register dst, Register src1,
-                                    const MemOperand& src2);
-  void Mul32WithOverflowIfCCUnequal(Register dst, Register src1, Register src2);
-  void Mul32WithOverflowIfCCUnequal(Register dst, Register src1,
-                                    const Operand& src2);
-  void Mul64(Register dst, const MemOperand& src1);
-  void Mul64(Register dst, Register src1);
-  void Mul64(Register dst, const Operand& src1);
-  void MulPWithCondition(Register dst, Register src1, Register src2);
-
-  // Divide
-  void DivP(Register dividend, Register divider);
-  void Div32(Register dst, Register src1, const MemOperand& src2);
-  void Div32(Register dst, Register src1, Register src2);
-  void DivU32(Register dst, Register src1, const MemOperand& src2);
-  void DivU32(Register dst, Register src1, Register src2);
-  void Div64(Register dst, Register src1, const MemOperand& src2);
-  void Div64(Register dst, Register src1, Register src2);
-  void DivU64(Register dst, Register src1, const MemOperand& src2);
-  void DivU64(Register dst, Register src1, Register src2);
-
-  // Mod
-  void Mod32(Register dst, Register src1, const MemOperand& src2);
-  void Mod32(Register dst, Register src1, Register src2);
-  void ModU32(Register dst, Register src1, const MemOperand& src2);
-  void ModU32(Register dst, Register src1, Register src2);
-  void Mod64(Register dst, Register src1, const MemOperand& src2);
-  void Mod64(Register dst, Register src1, Register src2);
-  void ModU64(Register dst, Register src1, const MemOperand& src2);
-  void ModU64(Register dst, Register src1, Register src2);
-
-  // Square root
-  void Sqrt(DoubleRegister result, DoubleRegister input);
-  void Sqrt(DoubleRegister result, const MemOperand& input);
-
-  // Compare
-  void Cmp32(Register src1, Register src2);
-  void CmpP(Register src1, Register src2);
-  void Cmp32(Register dst, const Operand& opnd);
-  void CmpP(Register dst, const Operand& opnd);
-  void Cmp32(Register dst, const MemOperand& opnd);
-  void CmpP(Register dst, const MemOperand& opnd);
-
-  // Compare Logical
-  void CmpLogical32(Register src1, Register src2);
-  void CmpLogicalP(Register src1, Register src2);
-  void CmpLogical32(Register src1, const Operand& opnd);
-  void CmpLogicalP(Register src1, const Operand& opnd);
-  void CmpLogical32(Register dst, const MemOperand& opnd);
-  void CmpLogicalP(Register dst, const MemOperand& opnd);
-
-  // Compare Logical Byte (CLI/CLIY)
-  void CmpLogicalByte(const MemOperand& mem, const Operand& imm);
-
-  // Load 32bit
-  void Load(Register dst, const MemOperand& opnd);
-  void Load(Register dst, const Operand& opnd);
-  void LoadW(Register dst, const MemOperand& opnd, Register scratch = no_reg);
-  void LoadW(Register dst, Register src);
-  void LoadlW(Register dst, const MemOperand& opnd, Register scratch = no_reg);
-  void LoadlW(Register dst, Register src);
-  void LoadLogicalHalfWordP(Register dst, const MemOperand& opnd);
-  void LoadLogicalHalfWordP(Register dst, Register src);
-  void LoadB(Register dst, const MemOperand& opnd);
-  void LoadB(Register dst, Register src);
-  void LoadlB(Register dst, const MemOperand& opnd);
-  void LoadlB(Register dst, Register src);
-
-  void LoadLogicalReversedWordP(Register dst, const MemOperand& opnd);
-  void LoadLogicalReversedHalfWordP(Register dst, const MemOperand& opnd);
-
-  // Load And Test
-  void LoadAndTest32(Register dst, Register src);
-  void LoadAndTestP_ExtendSrc(Register dst, Register src);
-  void LoadAndTestP(Register dst, Register src);
-
-  void LoadAndTest32(Register dst, const MemOperand& opnd);
-  void LoadAndTestP(Register dst, const MemOperand& opnd);
-
-  // Load Floating Point
-  void LoadDouble(DoubleRegister dst, const MemOperand& opnd);
-  void LoadFloat32(DoubleRegister dst, const MemOperand& opnd);
-  void LoadFloat32ConvertToDouble(DoubleRegister dst, const MemOperand& mem);
-
-  void AddFloat32(DoubleRegister dst, const MemOperand& opnd,
-                  DoubleRegister scratch);
-  void AddFloat64(DoubleRegister dst, const MemOperand& opnd,
-                  DoubleRegister scratch);
-  void SubFloat32(DoubleRegister dst, const MemOperand& opnd,
-                  DoubleRegister scratch);
-  void SubFloat64(DoubleRegister dst, const MemOperand& opnd,
-                  DoubleRegister scratch);
-  void MulFloat32(DoubleRegister dst, const MemOperand& opnd,
-                  DoubleRegister scratch);
-  void MulFloat64(DoubleRegister dst, const MemOperand& opnd,
-                  DoubleRegister scratch);
-  void DivFloat32(DoubleRegister dst, const MemOperand& opnd,
-                  DoubleRegister scratch);
-  void DivFloat64(DoubleRegister dst, const MemOperand& opnd,
-                  DoubleRegister scratch);
-  void LoadFloat32ToDouble(DoubleRegister dst, const MemOperand& opnd,
-                           DoubleRegister scratch);
-
-  // Load On Condition
-  void LoadOnConditionP(Condition cond, Register dst, Register src);
-
-  void LoadPositiveP(Register result, Register input);
-  void LoadPositive32(Register result, Register input);
-
-  // Store Floating Point
-  void StoreDouble(DoubleRegister dst, const MemOperand& opnd);
-  void StoreFloat32(DoubleRegister dst, const MemOperand& opnd);
-  void StoreDoubleAsFloat32(DoubleRegister src, const MemOperand& mem,
-                            DoubleRegister scratch);
-
-  void Branch(Condition c, const Operand& opnd);
-  void BranchOnCount(Register r1, Label* l);
-
-  // Shifts
-  void ShiftLeft(Register dst, Register src, Register val);
-  void ShiftLeft(Register dst, Register src, const Operand& val);
-  void ShiftRight(Register dst, Register src, Register val);
-  void ShiftRight(Register dst, Register src, const Operand& val);
-  void ShiftLeftArith(Register dst, Register src, Register shift);
-  void ShiftLeftArith(Register dst, Register src, const Operand& val);
-  void ShiftRightArith(Register dst, Register src, Register shift);
-  void ShiftRightArith(Register dst, Register src, const Operand& val);
-
-  void ClearRightImm(Register dst, Register src, const Operand& val);
-
-  // Bitwise operations
-  void And(Register dst, Register src);
-  void AndP(Register dst, Register src);
-  void And(Register dst, Register src1, Register src2);
-  void AndP(Register dst, Register src1, Register src2);
-  void And(Register dst, const MemOperand& opnd);
-  void AndP(Register dst, const MemOperand& opnd);
-  void And(Register dst, const Operand& opnd);
-  void AndP(Register dst, const Operand& opnd);
-  void And(Register dst, Register src, const Operand& opnd);
-  void AndP(Register dst, Register src, const Operand& opnd);
-  void Or(Register dst, Register src);
-  void OrP(Register dst, Register src);
-  void Or(Register dst, Register src1, Register src2);
-  void OrP(Register dst, Register src1, Register src2);
-  void Or(Register dst, const MemOperand& opnd);
-  void OrP(Register dst, const MemOperand& opnd);
-  void Or(Register dst, const Operand& opnd);
-  void OrP(Register dst, const Operand& opnd);
-  void Or(Register dst, Register src, const Operand& opnd);
-  void OrP(Register dst, Register src, const Operand& opnd);
-  void Xor(Register dst, Register src);
-  void XorP(Register dst, Register src);
-  void Xor(Register dst, Register src1, Register src2);
-  void XorP(Register dst, Register src1, Register src2);
-  void Xor(Register dst, const MemOperand& opnd);
-  void XorP(Register dst, const MemOperand& opnd);
-  void Xor(Register dst, const Operand& opnd);
-  void XorP(Register dst, const Operand& opnd);
-  void Xor(Register dst, Register src, const Operand& opnd);
-  void XorP(Register dst, Register src, const Operand& opnd);
-  void Popcnt32(Register dst, Register src);
-  void Not32(Register dst, Register src = no_reg);
-  void Not64(Register dst, Register src = no_reg);
-  void NotP(Register dst, Register src = no_reg);
-
-#ifdef V8_TARGET_ARCH_S390X
-  void Popcnt64(Register dst, Register src);
-#endif
-
-  void mov(Register dst, const Operand& src);
-
-  void CleanUInt32(Register x) {
-#ifdef V8_TARGET_ARCH_S390X
-    llgfr(x, x);
-#endif
-  }
-
-
-  void push(Register src) {
-    lay(sp, MemOperand(sp, -kPointerSize));
-    StoreP(src, MemOperand(sp));
-  }
-
-  void pop(Register dst) {
-    LoadP(dst, MemOperand(sp));
-    la(sp, MemOperand(sp, kPointerSize));
-  }
-
-  void pop() { la(sp, MemOperand(sp, kPointerSize)); }
-
-  void Push(Register src) { push(src); }
-
-  // Push a handle.
-  void Push(Handle<HeapObject> handle);
-  void Push(Smi* smi);
-
-  // Push two registers.  Pushes leftmost register first (to highest address).
-  void Push(Register src1, Register src2) {
-    lay(sp, MemOperand(sp, -kPointerSize * 2));
-    StoreP(src1, MemOperand(sp, kPointerSize));
-    StoreP(src2, MemOperand(sp, 0));
-  }
-
-  // Push three registers.  Pushes leftmost register first (to highest address).
-  void Push(Register src1, Register src2, Register src3) {
-    lay(sp, MemOperand(sp, -kPointerSize * 3));
-    StoreP(src1, MemOperand(sp, kPointerSize * 2));
-    StoreP(src2, MemOperand(sp, kPointerSize));
-    StoreP(src3, MemOperand(sp, 0));
-  }
-
-  // Push four registers.  Pushes leftmost register first (to highest address).
-  void Push(Register src1, Register src2, Register src3, Register src4) {
-    lay(sp, MemOperand(sp, -kPointerSize * 4));
-    StoreP(src1, MemOperand(sp, kPointerSize * 3));
-    StoreP(src2, MemOperand(sp, kPointerSize * 2));
-    StoreP(src3, MemOperand(sp, kPointerSize));
-    StoreP(src4, MemOperand(sp, 0));
-  }
-
-  // Push five registers.  Pushes leftmost register first (to highest address).
-  void Push(Register src1, Register src2, Register src3, Register src4,
-            Register src5) {
-    DCHECK(src1 != src2);
-    DCHECK(src1 != src3);
-    DCHECK(src2 != src3);
-    DCHECK(src1 != src4);
-    DCHECK(src2 != src4);
-    DCHECK(src3 != src4);
-    DCHECK(src1 != src5);
-    DCHECK(src2 != src5);
-    DCHECK(src3 != src5);
-    DCHECK(src4 != src5);
-
-    lay(sp, MemOperand(sp, -kPointerSize * 5));
-    StoreP(src1, MemOperand(sp, kPointerSize * 4));
-    StoreP(src2, MemOperand(sp, kPointerSize * 3));
-    StoreP(src3, MemOperand(sp, kPointerSize * 2));
-    StoreP(src4, MemOperand(sp, kPointerSize));
-    StoreP(src5, MemOperand(sp, 0));
-  }
-
-  void Pop(Register dst) { pop(dst); }
-
-  // Pop two registers. Pops rightmost register first (from lower address).
-  void Pop(Register src1, Register src2) {
-    LoadP(src2, MemOperand(sp, 0));
-    LoadP(src1, MemOperand(sp, kPointerSize));
-    la(sp, MemOperand(sp, 2 * kPointerSize));
-  }
-
-  // Pop three registers.  Pops rightmost register first (from lower address).
-  void Pop(Register src1, Register src2, Register src3) {
-    LoadP(src3, MemOperand(sp, 0));
-    LoadP(src2, MemOperand(sp, kPointerSize));
-    LoadP(src1, MemOperand(sp, 2 * kPointerSize));
-    la(sp, MemOperand(sp, 3 * kPointerSize));
-  }
-
-  // Pop four registers.  Pops rightmost register first (from lower address).
-  void Pop(Register src1, Register src2, Register src3, Register src4) {
-    LoadP(src4, MemOperand(sp, 0));
-    LoadP(src3, MemOperand(sp, kPointerSize));
-    LoadP(src2, MemOperand(sp, 2 * kPointerSize));
-    LoadP(src1, MemOperand(sp, 3 * kPointerSize));
-    la(sp, MemOperand(sp, 4 * kPointerSize));
-  }
-
-  // Pop five registers.  Pops rightmost register first (from lower address).
-  void Pop(Register src1, Register src2, Register src3, Register src4,
-           Register src5) {
-    LoadP(src5, MemOperand(sp, 0));
-    LoadP(src4, MemOperand(sp, kPointerSize));
-    LoadP(src3, MemOperand(sp, 2 * kPointerSize));
-    LoadP(src2, MemOperand(sp, 3 * kPointerSize));
-    LoadP(src1, MemOperand(sp, 4 * kPointerSize));
-    la(sp, MemOperand(sp, 5 * kPointerSize));
-  }
-
-  // Push a fixed frame, consisting of lr, fp, constant pool.
-  void PushCommonFrame(Register marker_reg = no_reg);
-
-  // Push a standard frame, consisting of lr, fp, constant pool,
-  // context and JS function
-  void PushStandardFrame(Register function_reg);
-
-  void PopCommonFrame(Register marker_reg = no_reg);
-
-  // Restore caller's frame pointer and return address prior to being
-  // overwritten by tail call stack preparation.
-  void RestoreFrameStateForTailCall();
-
-  void InitializeRootRegister() {
-    ExternalReference roots_array_start =
-        ExternalReference::roots_array_start(isolate());
-    mov(kRootRegister, Operand(roots_array_start));
-  }
-
-  // Flush the I-cache from asm code. You should use CpuFeatures::FlushICache
-  // from C.
-  // Does not handle errors.
-  void FlushICache(Register address, size_t size, Register scratch);
-
-  // If the value is a NaN, canonicalize the value else, do nothing.
-  void CanonicalizeNaN(const DoubleRegister dst, const DoubleRegister src);
-  void CanonicalizeNaN(const DoubleRegister value) {
-    CanonicalizeNaN(value, value);
-  }
-
-  // Converts the integer (untagged smi) in |src| to a double, storing
-  // the result to |dst|
-  void ConvertIntToDouble(DoubleRegister dst, Register src);
-
-  // Converts the unsigned integer (untagged smi) in |src| to
-  // a double, storing the result to |dst|
-  void ConvertUnsignedIntToDouble(DoubleRegister dst, Register src);
-
-  // Converts the integer (untagged smi) in |src| to
-  // a float, storing the result in |dst|
-  void ConvertIntToFloat(DoubleRegister dst, Register src);
-
-  // Converts the unsigned integer (untagged smi) in |src| to
-  // a float, storing the result in |dst|
-  void ConvertUnsignedIntToFloat(DoubleRegister dst, Register src);
-
-  void ConvertInt64ToFloat(DoubleRegister double_dst, Register src);
-  void ConvertInt64ToDouble(DoubleRegister double_dst, Register src);
-  void ConvertUnsignedInt64ToFloat(DoubleRegister double_dst, Register src);
-  void ConvertUnsignedInt64ToDouble(DoubleRegister double_dst, Register src);
-
-  void MovIntToFloat(DoubleRegister dst, Register src);
-  void MovFloatToInt(Register dst, DoubleRegister src);
-  void MovDoubleToInt64(Register dst, DoubleRegister src);
-  void MovInt64ToDouble(DoubleRegister dst, Register src);
-  // Converts the double_input to an integer.  Note that, upon return,
-  // the contents of double_dst will also hold the fixed point representation.
-  void ConvertFloat32ToInt64(const Register dst,
-                             const DoubleRegister double_input,
-                             FPRoundingMode rounding_mode = kRoundToZero);
-
-  // Converts the double_input to an integer.  Note that, upon return,
-  // the contents of double_dst will also hold the fixed point representation.
-  void ConvertDoubleToInt64(const Register dst,
-                            const DoubleRegister double_input,
-                            FPRoundingMode rounding_mode = kRoundToZero);
-  void ConvertDoubleToInt32(const Register dst,
-                            const DoubleRegister double_input,
-                            FPRoundingMode rounding_mode = kRoundToZero);
-
-  void ConvertFloat32ToInt32(const Register result,
-                             const DoubleRegister double_input,
-                             FPRoundingMode rounding_mode);
-  void ConvertFloat32ToUnsignedInt32(
-      const Register result, const DoubleRegister double_input,
-      FPRoundingMode rounding_mode = kRoundToZero);
-  // Converts the double_input to an unsigned integer.  Note that, upon return,
-  // the contents of double_dst will also hold the fixed point representation.
-  void ConvertDoubleToUnsignedInt64(
-      const Register dst, const DoubleRegister double_input,
-      FPRoundingMode rounding_mode = kRoundToZero);
-  void ConvertDoubleToUnsignedInt32(
-      const Register dst, const DoubleRegister double_input,
-      FPRoundingMode rounding_mode = kRoundToZero);
-  void ConvertFloat32ToUnsignedInt64(
-      const Register result, const DoubleRegister double_input,
-      FPRoundingMode rounding_mode = kRoundToZero);
-
-#if !V8_TARGET_ARCH_S390X
-  void ShiftLeftPair(Register dst_low, Register dst_high, Register src_low,
-                     Register src_high, Register scratch, Register shift);
-  void ShiftLeftPair(Register dst_low, Register dst_high, Register src_low,
-                     Register src_high, uint32_t shift);
-  void ShiftRightPair(Register dst_low, Register dst_high, Register src_low,
-                      Register src_high, Register scratch, Register shift);
-  void ShiftRightPair(Register dst_low, Register dst_high, Register src_low,
-                      Register src_high, uint32_t shift);
-  void ShiftRightArithPair(Register dst_low, Register dst_high,
-                           Register src_low, Register src_high,
-                           Register scratch, Register shift);
-  void ShiftRightArithPair(Register dst_low, Register dst_high,
-                           Register src_low, Register src_high, uint32_t shift);
-#endif
-
-  // Generates function and stub prologue code.
-  void StubPrologue(StackFrame::Type type, Register base = no_reg,
-                    int prologue_offset = 0);
-  void Prologue(Register base, int prologue_offset = 0);
-
-  // Get the actual activation frame alignment for target environment.
-  static int ActivationFrameAlignment();
-  // ----------------------------------------------------------------
-  // new S390 macro-assembler interfaces that are slightly higher level
-  // than assembler-s390 and may generate variable length sequences
-
-  // load a literal signed int value <value> to GPR <dst>
-  void LoadIntLiteral(Register dst, int value);
-
-  // load an SMI value <value> to GPR <dst>
-  void LoadSmiLiteral(Register dst, Smi* smi);
-
-  // load a literal double value <value> to FPR <result>
-  void LoadDoubleLiteral(DoubleRegister result, double value, Register scratch);
-  void LoadDoubleLiteral(DoubleRegister result, uint64_t value,
-                         Register scratch);
-
-  void LoadFloat32Literal(DoubleRegister result, float value, Register scratch);
-
-  void StoreW(Register src, const MemOperand& mem, Register scratch = no_reg);
-
-  void LoadHalfWordP(Register dst, const MemOperand& mem,
-                     Register scratch = no_reg);
-
-  void StoreHalfWord(Register src, const MemOperand& mem,
-                     Register scratch = r0);
-  void StoreByte(Register src, const MemOperand& mem, Register scratch = r0);
-
-  void AddSmiLiteral(Register dst, Register src, Smi* smi,
-                     Register scratch = r0);
-  void SubSmiLiteral(Register dst, Register src, Smi* smi,
-                     Register scratch = r0);
-  void CmpSmiLiteral(Register src1, Smi* smi, Register scratch);
-  void CmpLogicalSmiLiteral(Register src1, Smi* smi, Register scratch);
-  void AndSmiLiteral(Register dst, Register src, Smi* smi);
-
-  // Set new rounding mode RN to FPSCR
-  void SetRoundingMode(FPRoundingMode RN);
-
-  // reset rounding mode to default (kRoundToNearest)
-  void ResetRoundingMode();
-
-  // These exist to provide portability between 32 and 64bit
-  void LoadP(Register dst, const MemOperand& mem, Register scratch = no_reg);
-  void StoreP(Register src, const MemOperand& mem, Register scratch = no_reg);
-  void StoreP(const MemOperand& mem, const Operand& opnd,
-              Register scratch = no_reg);
-  void LoadMultipleP(Register dst1, Register dst2, const MemOperand& mem);
-  void StoreMultipleP(Register dst1, Register dst2, const MemOperand& mem);
-  void LoadMultipleW(Register dst1, Register dst2, const MemOperand& mem);
-  void StoreMultipleW(Register dst1, Register dst2, const MemOperand& mem);
-
-  void SwapP(Register src, Register dst, Register scratch);
-  void SwapP(Register src, MemOperand dst, Register scratch);
-  void SwapP(MemOperand src, MemOperand dst, Register scratch_0,
-             Register scratch_1);
-  void SwapFloat32(DoubleRegister src, DoubleRegister dst,
-                   DoubleRegister scratch);
-  void SwapFloat32(DoubleRegister src, MemOperand dst, DoubleRegister scratch);
-  void SwapFloat32(MemOperand src, MemOperand dst, DoubleRegister scratch_0,
-                   DoubleRegister scratch_1);
-  void SwapDouble(DoubleRegister src, DoubleRegister dst,
-                  DoubleRegister scratch);
-  void SwapDouble(DoubleRegister src, MemOperand dst, DoubleRegister scratch);
-  void SwapDouble(MemOperand src, MemOperand dst, DoubleRegister scratch_0,
-                  DoubleRegister scratch_1);
-
-  // Cleanse pointer address on 31bit by zero out top  bit.
-  // This is a NOP on 64-bit.
-  void CleanseP(Register src) {
-#if (V8_HOST_ARCH_S390 && !(V8_TARGET_ARCH_S390X))
-    nilh(src, Operand(0x7FFF));
-#endif
-  }
-
-  void PrepareForTailCall(const ParameterCount& callee_args_count,
-                          Register caller_args_count_reg, Register scratch0,
-                          Register scratch1);
-
-  // ---------------------------------------------------------------------------
-  // Runtime calls
-
-  // Call a code stub.
-  void CallStubDelayed(CodeStub* stub);
-
-  // Call a runtime routine.
-  void CallRuntimeDelayed(Zone* zone, Runtime::FunctionId fid,
-                          SaveFPRegsMode save_doubles = kDontSaveFPRegs);
-
-  // Before calling a C-function from generated code, align arguments on stack.
-  // After aligning the frame, non-register arguments must be stored in
-  // sp[0], sp[4], etc., not pushed. The argument count assumes all arguments
-  // are word sized. If double arguments are used, this function assumes that
-  // all double arguments are stored before core registers; otherwise the
-  // correct alignment of the double values is not guaranteed.
-  // Some compilers/platforms require the stack to be aligned when calling
-  // C++ code.
-  // Needs a scratch register to do some arithmetic. This register will be
-  // trashed.
-  void PrepareCallCFunction(int num_reg_arguments, int num_double_registers,
-                            Register scratch);
-  void PrepareCallCFunction(int num_reg_arguments, Register scratch);
-
-  // There are two ways of passing double arguments on ARM, depending on
-  // whether soft or hard floating point ABI is used. These functions
-  // abstract parameter passing for the three different ways we call
-  // C functions from generated code.
-  void MovToFloatParameter(DoubleRegister src);
-  void MovToFloatParameters(DoubleRegister src1, DoubleRegister src2);
-  void MovToFloatResult(DoubleRegister src);
-
-  // Calls a C function and cleans up the space for arguments allocated
-  // by PrepareCallCFunction. The called function is not allowed to trigger a
-  // garbage collection, since that might move the code and invalidate the
-  // return address (unless this is somehow accounted for by the called
-  // function).
-  void CallCFunction(ExternalReference function, int num_arguments);
-  void CallCFunction(Register function, int num_arguments);
-  void CallCFunction(ExternalReference function, int num_reg_arguments,
-                     int num_double_arguments);
-  void CallCFunction(Register function, int num_reg_arguments,
-                     int num_double_arguments);
-
-  void MovFromFloatParameter(DoubleRegister dst);
-  void MovFromFloatResult(DoubleRegister dst);
-
-  // Emit code for a truncating division by a constant. The dividend register is
-  // unchanged and ip gets clobbered. Dividend and result must be different.
-  void TruncateDoubleToIDelayed(Zone* zone, Register result,
-                                DoubleRegister double_input);
-  void TryInlineTruncateDoubleToI(Register result, DoubleRegister double_input,
-                                  Label* done);
-
-  // ---------------------------------------------------------------------------
-  // Debugging
-
-  // Calls Abort(msg) if the condition cond is not satisfied.
-  // Use --debug_code to enable.
-  void Assert(Condition cond, AbortReason reason, CRegister cr = cr7);
-
-  // Like Assert(), but always enabled.
-  void Check(Condition cond, AbortReason reason, CRegister cr = cr7);
-
-  // Print a message to stdout and abort execution.
-  void Abort(AbortReason reason);
-
-  void set_has_frame(bool value) { has_frame_ = value; }
-  bool has_frame() { return has_frame_; }
-  inline bool AllowThisStubCall(CodeStub* stub);
-
-  // ---------------------------------------------------------------------------
-  // Bit testing/extraction
-  //
-  // Bit numbering is such that the least significant bit is bit 0
-  // (for consistency between 32/64-bit).
-
-  // Extract consecutive bits (defined by rangeStart - rangeEnd) from src
-  // and place them into the least significant bits of dst.
-  inline void ExtractBitRange(Register dst, Register src, int rangeStart,
-                              int rangeEnd) {
-    DCHECK(rangeStart >= rangeEnd && rangeStart < kBitsPerPointer);
-
-    // Try to use RISBG if possible.
-    if (CpuFeatures::IsSupported(GENERAL_INSTR_EXT)) {
-      int shiftAmount = (64 - rangeEnd) % 64;  // Convert to shift left.
-      int endBit = 63;  // End is always LSB after shifting.
-      int startBit = 63 - rangeStart + rangeEnd;
-      risbg(dst, src, Operand(startBit), Operand(endBit), Operand(shiftAmount),
-            true);
-    } else {
-      if (rangeEnd > 0)  // Don't need to shift if rangeEnd is zero.
-        ShiftRightP(dst, src, Operand(rangeEnd));
-      else if (dst != src)  // If we didn't shift, we might need to copy
-        LoadRR(dst, src);
-      int width = rangeStart - rangeEnd + 1;
-#if V8_TARGET_ARCH_S390X
-      uint64_t mask = (static_cast<uint64_t>(1) << width) - 1;
-      nihf(dst, Operand(mask >> 32));
-      nilf(dst, Operand(mask & 0xFFFFFFFF));
-      ltgr(dst, dst);
-#else
-      uint32_t mask = (1 << width) - 1;
-      AndP(dst, Operand(mask));
-#endif
-    }
-  }
-
-  inline void ExtractBit(Register dst, Register src, uint32_t bitNumber) {
-    ExtractBitRange(dst, src, bitNumber, bitNumber);
-  }
-
-  // Extract consecutive bits (defined by mask) from src and place them
-  // into the least significant bits of dst.
-  inline void ExtractBitMask(Register dst, Register src, uintptr_t mask,
-                             RCBit rc = LeaveRC) {
-    int start = kBitsPerPointer - 1;
-    int end;
-    uintptr_t bit = (1L << start);
-
-    while (bit && (mask & bit) == 0) {
-      start--;
-      bit >>= 1;
-    }
-    end = start;
-    bit >>= 1;
-
-    while (bit && (mask & bit)) {
-      end--;
-      bit >>= 1;
-    }
-
-    // 1-bits in mask must be contiguous
-    DCHECK(bit == 0 || (mask & ((bit << 1) - 1)) == 0);
-
-    ExtractBitRange(dst, src, start, end);
-  }
-
-  // Test single bit in value.
-  inline void TestBit(Register value, int bitNumber, Register scratch = r0) {
-    ExtractBitRange(scratch, value, bitNumber, bitNumber);
-  }
-
-  // Test consecutive bit range in value.  Range is defined by
-  // rangeStart - rangeEnd.
-  inline void TestBitRange(Register value, int rangeStart, int rangeEnd,
-                           Register scratch = r0) {
-    ExtractBitRange(scratch, value, rangeStart, rangeEnd);
-  }
-
-  // Test consecutive bit range in value.  Range is defined by mask.
-  inline void TestBitMask(Register value, uintptr_t mask,
-                          Register scratch = r0) {
-    ExtractBitMask(scratch, value, mask, SetRC);
-  }
-  inline void TestIfSmi(Register value) { tmll(value, Operand(1)); }
-
-  inline void TestIfSmi(MemOperand value) {
-    if (is_uint12(value.offset())) {
-      tm(value, Operand(1));
-    } else if (is_int20(value.offset())) {
-      tmy(value, Operand(1));
-    } else {
-      LoadB(r0, value);
-      tmll(r0, Operand(1));
-    }
-  }
-
-  inline void TestIfInt32(Register value) {
-    // High bits must be identical to fit into an 32-bit integer
-    cgfr(value, value);
-  }
-  void SmiUntag(Register reg) { SmiUntag(reg, reg); }
-
-  void SmiUntag(Register dst, Register src) {
-    ShiftRightArithP(dst, src, Operand(kSmiShift));
-  }
-
-  // Activation support.
-  void EnterFrame(StackFrame::Type type,
-                  bool load_constant_pool_pointer_reg = false);
-  // Returns the pc offset at which the frame ends.
-  int LeaveFrame(StackFrame::Type type, int stack_adjustment = 0);
-
-  void CheckPageFlag(Register object, Register scratch, int mask, Condition cc,
-                     Label* condition_met);
-
- private:
-  static const int kSmiShift = kSmiTagSize + kSmiShiftSize;
-
-  void CallCFunctionHelper(Register function, int num_reg_arguments,
-                           int num_double_arguments);
-
-  void Jump(intptr_t target, RelocInfo::Mode rmode, Condition cond = al,
-            CRegister cr = cr7);
-  int CalculateStackPassedWords(int num_reg_arguments,
-                                int num_double_arguments);
-
-  bool has_frame_ = false;
-  Isolate* isolate_;
-  // This handle will be patched with the code object on installation.
-  Handle<HeapObject> code_object_;
-};
-
-// MacroAssembler implements a collection of frequently used macros.
-class MacroAssembler : public TurboAssembler {
- public:
-  MacroAssembler(Isolate* isolate, void* buffer, int size,
-                 CodeObjectRequired create_code_object);
-
-  // Call a code stub.
-  void TailCallStub(CodeStub* stub, Condition cond = al);
-
-  void CallStub(CodeStub* stub, Condition cond = al);
-  void CallRuntime(const Runtime::Function* f, int num_arguments,
-                   SaveFPRegsMode save_doubles = kDontSaveFPRegs);
-  void CallRuntimeSaveDoubles(Runtime::FunctionId fid) {
-    const Runtime::Function* function = Runtime::FunctionForId(fid);
-    CallRuntime(function, function->nargs, kSaveFPRegs);
-  }
-
-  // Convenience function: Same as above, but takes the fid instead.
-  void CallRuntime(Runtime::FunctionId fid,
-                   SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
-    const Runtime::Function* function = Runtime::FunctionForId(fid);
-    CallRuntime(function, function->nargs, save_doubles);
-  }
-
-  // Convenience function: Same as above, but takes the fid instead.
-  void CallRuntime(Runtime::FunctionId fid, int num_arguments,
-                   SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
-    CallRuntime(Runtime::FunctionForId(fid), num_arguments, save_doubles);
-  }
-
-  // Convenience function: tail call a runtime routine (jump).
-  void TailCallRuntime(Runtime::FunctionId fid);
-
-  // ---------------------------------------------------------------------------
-  // Support functions.
-
-  // Compare object type for heap object.  heap_object contains a non-Smi
-  // whose object type should be compared with the given type.  This both
-  // sets the flags and leaves the object type in the type_reg register.
-  // It leaves the map in the map register (unless the type_reg and map register
-  // are the same register).  It leaves the heap object in the heap_object
-  // register unless the heap_object register is the same register as one of the
-  // other registers.
-  // Type_reg can be no_reg. In that case ip is used.
-  void CompareObjectType(Register heap_object, Register map, Register type_reg,
-                         InstanceType type);
-
-  // Compare instance type in a map.  map contains a valid map object whose
-  // object type should be compared with the given type.  This both
-  // sets the flags and leaves the object type in the type_reg register.
-  void CompareInstanceType(Register map, Register type_reg, InstanceType type);
-
-  // Compare the object in a register to a value from the root list.
-  // Uses the ip register as scratch.
-  void CompareRoot(Register obj, Heap::RootListIndex index);
-  void PushRoot(Heap::RootListIndex index) {
-    LoadRoot(r0, index);
-    Push(r0);
-  }
-
-  // Jump to a runtime routine.
-  void JumpToExternalReference(const ExternalReference& builtin,
-                               bool builtin_exit_frame = false);
-
-  // Compare the object in a register to a value and jump if they are equal.
-  void JumpIfRoot(Register with, Heap::RootListIndex index, Label* if_equal) {
-    CompareRoot(with, index);
-    beq(if_equal);
-  }
-
-  // Compare the object in a register to a value and jump if they are not equal.
-  void JumpIfNotRoot(Register with, Heap::RootListIndex index,
-                     Label* if_not_equal) {
-    CompareRoot(with, index);
-    bne(if_not_equal);
-  }
-
-  // Try to convert a double to a signed 32-bit integer.
-  // CR_EQ in cr7 is set and result assigned if the conversion is exact.
-  void TryDoubleToInt32Exact(Register result, DoubleRegister double_input,
-                             Register scratch, DoubleRegister double_scratch);
-
-  // ---------------------------------------------------------------------------
-  // StatsCounter support
-
-  void IncrementCounter(StatsCounter* counter, int value, Register scratch1,
-                        Register scratch2);
-  void DecrementCounter(StatsCounter* counter, int value, Register scratch1,
-                        Register scratch2);
-  // ---------------------------------------------------------------------------
-  // JavaScript invokes
-
-  // Set up call kind marking in ecx. The method takes ecx as an
-  // explicit first parameter to make the code more readable at the
-  // call sites.
-  // void SetCallKind(Register dst, CallKind kind);
-
-  // Removes current frame and its arguments from the stack preserving
-  // the arguments and a return address pushed to the stack for the next call.
-  // Both |callee_args_count| and |caller_args_count_reg| do not include
-  // receiver. |callee_args_count| is not modified, |caller_args_count_reg|
-  // is trashed.
-
-  // Invoke the JavaScript function code by either calling or jumping.
-  void InvokeFunctionCode(Register function, Register new_target,
-                          const ParameterCount& expected,
-                          const ParameterCount& actual, InvokeFlag flag);
-
-  // On function call, call into the debugger if necessary.
-  void CheckDebugHook(Register fun, Register new_target,
-                      const ParameterCount& expected,
-                      const ParameterCount& actual);
-
-  // Invoke the JavaScript function in the given register. Changes the
-  // current context to the context in the function before invoking.
-  void InvokeFunction(Register function, Register new_target,
-                      const ParameterCount& actual, InvokeFlag flag);
-
-  void InvokeFunction(Register function, const ParameterCount& expected,
-                      const ParameterCount& actual, InvokeFlag flag);
-
-  void InvokeFunction(Handle<JSFunction> function,
-                      const ParameterCount& expected,
-                      const ParameterCount& actual, InvokeFlag flag);
-
-  // Frame restart support
-  void MaybeDropFrames();
-
-  // Exception handling
-
-  // Push a new stack handler and link into stack handler chain.
-  void PushStackHandler();
-
-  // Unlink the stack handler on top of the stack from the stack handler chain.
-  // Must preserve the result register.
-  void PopStackHandler();
-
-  // Enter exit frame.
-  // stack_space - extra stack space, used for parameters before call to C.
-  // At least one slot (for the return address) should be provided.
-  void EnterExitFrame(bool save_doubles, int stack_space = 1,
-                      StackFrame::Type frame_type = StackFrame::EXIT);
-
-  // Leave the current exit frame. Expects the return value in r0.
-  // Expect the number of values, pushed prior to the exit frame, to
-  // remove in a register (or no_reg, if there is nothing to remove).
-  void LeaveExitFrame(bool save_doubles, Register argument_count,
-                      bool argument_count_is_length = false);
-
-  // Load the global proxy from the current context.
-  void LoadGlobalProxy(Register dst) {
-    LoadNativeContextSlot(Context::GLOBAL_PROXY_INDEX, dst);
-  }
-
-  void LoadNativeContextSlot(int index, Register dst);
-
-  // ---------------------------------------------------------------------------
-  // Smi utilities
-
-  // Shift left by kSmiShift
-  void SmiTag(Register reg) { SmiTag(reg, reg); }
-  void SmiTag(Register dst, Register src) {
-    ShiftLeftP(dst, src, Operand(kSmiShift));
-  }
-
-  void SmiToPtrArrayOffset(Register dst, Register src) {
-#if V8_TARGET_ARCH_S390X
-    STATIC_ASSERT(kSmiTag == 0 && kSmiShift > kPointerSizeLog2);
-    ShiftRightArithP(dst, src, Operand(kSmiShift - kPointerSizeLog2));
-#else
-    STATIC_ASSERT(kSmiTag == 0 && kSmiShift < kPointerSizeLog2);
-    ShiftLeftP(dst, src, Operand(kPointerSizeLog2 - kSmiShift));
-#endif
-  }
-
-  // Untag the source value into destination and jump if source is a smi.
-  // Souce and destination can be the same register.
-  void UntagAndJumpIfSmi(Register dst, Register src, Label* smi_case);
-
-  // Jump if either of the registers contain a non-smi.
-  inline void JumpIfNotSmi(Register value, Label* not_smi_label) {
-    TestIfSmi(value);
-    bne(not_smi_label /*, cr0*/);
-  }
-  // Jump if either of the registers contain a smi.
-  void JumpIfEitherSmi(Register reg1, Register reg2, Label* on_either_smi);
-
-  // Abort execution if argument is a smi, enabled via --debug-code.
-  void AssertNotSmi(Register object);
-  void AssertSmi(Register object);
-
-#if V8_TARGET_ARCH_S390X
-  // Ensure it is permissible to read/write int value directly from
-  // upper half of the smi.
-  STATIC_ASSERT(kSmiTag == 0);
-  STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32);
-#endif
-#if V8_TARGET_LITTLE_ENDIAN
-#define SmiWordOffset(offset) (offset + kPointerSize / 2)
-#else
-#define SmiWordOffset(offset) offset
-#endif
-
-  // Abort execution if argument is not a FixedArray, enabled via --debug-code.
-  void AssertFixedArray(Register object);
-
-  void AssertFunction(Register object);
-
-  // Abort execution if argument is not a JSBoundFunction,
-  // enabled via --debug-code.
-  void AssertBoundFunction(Register object);
-
-  // Abort execution if argument is not a JSGeneratorObject (or subclass),
-  // enabled via --debug-code.
-  void AssertGeneratorObject(Register object);
-
-  // Abort execution if argument is not undefined or an AllocationSite, enabled
-  // via --debug-code.
-  void AssertUndefinedOrAllocationSite(Register object, Register scratch);
-
-  template <typename Field>
-  void DecodeField(Register dst, Register src) {
-    ExtractBitRange(dst, src, Field::kShift + Field::kSize - 1, Field::kShift);
-  }
-
-  template <typename Field>
-  void DecodeField(Register reg) {
-    DecodeField<Field>(reg, reg);
-  }
-
-  // ---------------------------------------------------------------------------
-  // GC Support
-
-  void IncrementalMarkingRecordWriteHelper(Register object, Register value,
-                                           Register address);
-
-  // Record in the remembered set the fact that we have a pointer to new space
-  // at the address pointed to by the addr register.  Only works if addr is not
-  // in new space.
-  void RememberedSetHelper(Register object,  // Used for debug code.
-                           Register addr, Register scratch,
-                           SaveFPRegsMode save_fp);
-
-  void CallJSEntry(Register target);
-  static int CallSizeNotPredictableCodeSize(Address target,
-                                            RelocInfo::Mode rmode,
-                                            Condition cond = al);
-  void JumpToJSEntry(Register target);
-
-  // Notify the garbage collector that we wrote a pointer into an object.
-  // |object| is the object being stored into, |value| is the object being
-  // stored.  value and scratch registers are clobbered by the operation.
-  // The offset is the offset from the start of the object, not the offset from
-  // the tagged HeapObject pointer.  For use with FieldMemOperand(reg, off).
-  void RecordWriteField(
-      Register object, int offset, Register value, Register scratch,
-      LinkRegisterStatus lr_status, SaveFPRegsMode save_fp,
-      RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
-      SmiCheck smi_check = INLINE_SMI_CHECK);
-
-  // For a given |object| notify the garbage collector that the slot |address|
-  // has been written.  |value| is the object being stored. The value and
-  // address registers are clobbered by the operation.
-  void RecordWrite(
-      Register object, Register address, Register value,
-      LinkRegisterStatus lr_status, SaveFPRegsMode save_fp,
-      RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
-      SmiCheck smi_check = INLINE_SMI_CHECK);
-
-  // Push and pop the registers that can hold pointers, as defined by the
-  // RegList constant kSafepointSavedRegisters.
-  void PushSafepointRegisters();
-  void PopSafepointRegisters();
-
-  void LoadRepresentation(Register dst, const MemOperand& mem, Representation r,
-                          Register scratch = no_reg);
-  void StoreRepresentation(Register src, const MemOperand& mem,
-                           Representation r, Register scratch = no_reg);
-
- private:
-  static const int kSmiShift = kSmiTagSize + kSmiShiftSize;
-  // Helper functions for generating invokes.
-  void InvokePrologue(const ParameterCount& expected,
-                      const ParameterCount& actual, Label* done,
-                      bool* definitely_mismatches, InvokeFlag flag);
-
-  // Compute memory operands for safepoint stack slots.
-  static int SafepointRegisterStackIndex(int reg_code);
-
-  // Needs access to SafepointRegisterStackIndex for compiled frame
-  // traversal.
-  friend class StandardFrame;
-};
-
-// -----------------------------------------------------------------------------
-// Static helper functions.
-
-inline MemOperand ContextMemOperand(Register context, int index = 0) {
-  return MemOperand(context, Context::SlotOffset(index));
-}
-
-inline MemOperand NativeContextMemOperand() {
-  return ContextMemOperand(cp, Context::NATIVE_CONTEXT_INDEX);
-}
-
-#define ACCESS_MASM(masm) masm->
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_S390_MACRO_ASSEMBLER_S390_H_
diff --git a/src/v8/src/s390/simulator-s390.cc b/src/v8/src/s390/simulator-s390.cc
deleted file mode 100644
index f6754bd..0000000
--- a/src/v8/src/s390/simulator-s390.cc
+++ /dev/null
@@ -1,9724 +0,0 @@
-// Copyright 2014 the V8 project 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 <stdarg.h>
-#include <stdlib.h>
-#include <cmath>
-
-#if V8_TARGET_ARCH_S390
-
-#include "src/assembler.h"
-#include "src/base/bits.h"
-#include "src/base/once.h"
-#include "src/codegen.h"
-#include "src/disasm.h"
-#include "src/macro-assembler.h"
-#include "src/ostreams.h"
-#include "src/runtime/runtime-utils.h"
-#include "src/s390/constants-s390.h"
-#include "src/s390/simulator-s390.h"
-#if defined(USE_SIMULATOR)
-
-// Only build the simulator if not compiling for real s390 hardware.
-namespace v8 {
-namespace internal {
-
-const auto GetRegConfig = RegisterConfiguration::Default;
-
-// This macro provides a platform independent use of sscanf. The reason for
-// SScanF not being implemented in a platform independent way through
-// ::v8::internal::OS in the same way as SNPrintF is that the
-// Windows C Run-Time Library does not provide vsscanf.
-#define SScanF sscanf  // NOLINT
-
-// The S390Debugger class is used by the simulator while debugging simulated
-// z/Architecture code.
-class S390Debugger {
- public:
-  explicit S390Debugger(Simulator* sim) : sim_(sim) {}
-
-  void Stop(Instruction* instr);
-  void Debug();
-
- private:
-#if V8_TARGET_LITTLE_ENDIAN
-  static const Instr kBreakpointInstr = (0x0000FFB2);  // TRAP4 0000
-  static const Instr kNopInstr = (0x00160016);         // OR r0, r0 x2
-#else
-  static const Instr kBreakpointInstr = (0xB2FF0000);  // TRAP4 0000
-  static const Instr kNopInstr = (0x16001600);         // OR r0, r0 x2
-#endif
-
-  Simulator* sim_;
-
-  intptr_t GetRegisterValue(int regnum);
-  double GetRegisterPairDoubleValue(int regnum);
-  double GetFPDoubleRegisterValue(int regnum);
-  float GetFPFloatRegisterValue(int regnum);
-  bool GetValue(const char* desc, intptr_t* value);
-  bool GetFPDoubleValue(const char* desc, double* value);
-
-  // Set or delete a breakpoint. Returns true if successful.
-  bool SetBreakpoint(Instruction* break_pc);
-  bool DeleteBreakpoint(Instruction* break_pc);
-
-  // Undo and redo all breakpoints. This is needed to bracket disassembly and
-  // execution to skip past breakpoints when run from the debugger.
-  void UndoBreakpoints();
-  void RedoBreakpoints();
-};
-
-void S390Debugger::Stop(Instruction* instr) {
-  // Get the stop code.
-  // use of kStopCodeMask not right on PowerPC
-  uint32_t code = instr->SvcValue() & kStopCodeMask;
-  // Retrieve the encoded address, which comes just after this stop.
-  char* msg = *reinterpret_cast<char**>(sim_->get_pc() + sizeof(FourByteInstr));
-  // Update this stop description.
-  if (sim_->isWatchedStop(code) && !sim_->watched_stops_[code].desc) {
-    sim_->watched_stops_[code].desc = msg;
-  }
-  // Print the stop message and code if it is not the default code.
-  if (code != kMaxStopCode) {
-    PrintF("Simulator hit stop %u: %s\n", code, msg);
-  } else {
-    PrintF("Simulator hit %s\n", msg);
-  }
-  sim_->set_pc(sim_->get_pc() + sizeof(FourByteInstr) + kPointerSize);
-  Debug();
-}
-
-intptr_t S390Debugger::GetRegisterValue(int regnum) {
-  return sim_->get_register(regnum);
-}
-
-double S390Debugger::GetRegisterPairDoubleValue(int regnum) {
-  return sim_->get_double_from_register_pair(regnum);
-}
-
-double S390Debugger::GetFPDoubleRegisterValue(int regnum) {
-  return sim_->get_double_from_d_register(regnum);
-}
-
-float S390Debugger::GetFPFloatRegisterValue(int regnum) {
-  return sim_->get_float32_from_d_register(regnum);
-}
-
-bool S390Debugger::GetValue(const char* desc, intptr_t* value) {
-  int regnum = Registers::Number(desc);
-  if (regnum != kNoRegister) {
-    *value = GetRegisterValue(regnum);
-    return true;
-  } else {
-    if (strncmp(desc, "0x", 2) == 0) {
-      return SScanF(desc + 2, "%" V8PRIxPTR,
-                    reinterpret_cast<uintptr_t*>(value)) == 1;
-    } else {
-      return SScanF(desc, "%" V8PRIuPTR, reinterpret_cast<uintptr_t*>(value)) ==
-             1;
-    }
-  }
-  return false;
-}
-
-bool S390Debugger::GetFPDoubleValue(const char* desc, double* value) {
-  int regnum = DoubleRegisters::Number(desc);
-  if (regnum != kNoRegister) {
-    *value = sim_->get_double_from_d_register(regnum);
-    return true;
-  }
-  return false;
-}
-
-bool S390Debugger::SetBreakpoint(Instruction* break_pc) {
-  // Check if a breakpoint can be set. If not return without any side-effects.
-  if (sim_->break_pc_ != nullptr) {
-    return false;
-  }
-
-  // Set the breakpoint.
-  sim_->break_pc_ = break_pc;
-  sim_->break_instr_ = break_pc->InstructionBits();
-  // Not setting the breakpoint instruction in the code itself. It will be set
-  // when the debugger shell continues.
-  return true;
-}
-
-bool S390Debugger::DeleteBreakpoint(Instruction* break_pc) {
-  if (sim_->break_pc_ != nullptr) {
-    sim_->break_pc_->SetInstructionBits(sim_->break_instr_);
-  }
-
-  sim_->break_pc_ = nullptr;
-  sim_->break_instr_ = 0;
-  return true;
-}
-
-void S390Debugger::UndoBreakpoints() {
-  if (sim_->break_pc_ != nullptr) {
-    sim_->break_pc_->SetInstructionBits(sim_->break_instr_);
-  }
-}
-
-void S390Debugger::RedoBreakpoints() {
-  if (sim_->break_pc_ != nullptr) {
-    sim_->break_pc_->SetInstructionBits(kBreakpointInstr);
-  }
-}
-
-void S390Debugger::Debug() {
-  intptr_t last_pc = -1;
-  bool done = false;
-
-#define COMMAND_SIZE 63
-#define ARG_SIZE 255
-
-#define STR(a) #a
-#define XSTR(a) STR(a)
-
-  char cmd[COMMAND_SIZE + 1];
-  char arg1[ARG_SIZE + 1];
-  char arg2[ARG_SIZE + 1];
-  char* argv[3] = {cmd, arg1, arg2};
-
-  // make sure to have a proper terminating character if reaching the limit
-  cmd[COMMAND_SIZE] = 0;
-  arg1[ARG_SIZE] = 0;
-  arg2[ARG_SIZE] = 0;
-
-  // Undo all set breakpoints while running in the debugger shell. This will
-  // make them invisible to all commands.
-  UndoBreakpoints();
-  // Disable tracing while simulating
-  bool trace = ::v8::internal::FLAG_trace_sim;
-  ::v8::internal::FLAG_trace_sim = false;
-
-  while (!done && !sim_->has_bad_pc()) {
-    if (last_pc != sim_->get_pc()) {
-      disasm::NameConverter converter;
-      disasm::Disassembler dasm(converter);
-      // use a reasonably large buffer
-      v8::internal::EmbeddedVector<char, 256> buffer;
-      dasm.InstructionDecode(buffer, reinterpret_cast<byte*>(sim_->get_pc()));
-      PrintF("  0x%08" V8PRIxPTR "  %s\n", sim_->get_pc(), buffer.start());
-      last_pc = sim_->get_pc();
-    }
-    char* line = ReadLine("sim> ");
-    if (line == nullptr) {
-      break;
-    } else {
-      char* last_input = sim_->last_debugger_input();
-      if (strcmp(line, "\n") == 0 && last_input != nullptr) {
-        line = last_input;
-      } else {
-        // Ownership is transferred to sim_;
-        sim_->set_last_debugger_input(line);
-      }
-      // Use sscanf to parse the individual parts of the command line. At the
-      // moment no command expects more than two parameters.
-      int argc = SScanF(line,
-                        "%" XSTR(COMMAND_SIZE) "s "
-                        "%" XSTR(ARG_SIZE) "s "
-                        "%" XSTR(ARG_SIZE) "s",
-                        cmd, arg1, arg2);
-      if ((strcmp(cmd, "si") == 0) || (strcmp(cmd, "stepi") == 0)) {
-        intptr_t value;
-
-        // If at a breakpoint, proceed past it.
-        if ((reinterpret_cast<Instruction*>(sim_->get_pc()))
-                ->InstructionBits() == 0x7D821008) {
-          sim_->set_pc(sim_->get_pc() + sizeof(FourByteInstr));
-        } else {
-          sim_->ExecuteInstruction(
-              reinterpret_cast<Instruction*>(sim_->get_pc()));
-        }
-
-        if (argc == 2 && last_pc != sim_->get_pc()) {
-          disasm::NameConverter converter;
-          disasm::Disassembler dasm(converter);
-          // use a reasonably large buffer
-          v8::internal::EmbeddedVector<char, 256> buffer;
-
-          if (GetValue(arg1, &value)) {
-            // Interpret a numeric argument as the number of instructions to
-            // step past.
-            for (int i = 1; (!sim_->has_bad_pc()) &&  i < value; i++) {
-              dasm.InstructionDecode(buffer,
-                                    reinterpret_cast<byte*>(sim_->get_pc()));
-              PrintF("  0x%08" V8PRIxPTR "  %s\n", sim_->get_pc(),
-                    buffer.start());
-              sim_->ExecuteInstruction(
-                      reinterpret_cast<Instruction*>(sim_->get_pc()));
-            }
-          } else {
-            // Otherwise treat it as the mnemonic of the opcode to stop at.
-            char mnemonic[256];
-            while (!sim_->has_bad_pc()) {
-              dasm.InstructionDecode(buffer,
-                                    reinterpret_cast<byte*>(sim_->get_pc()));
-              char* mnemonicStart = buffer.start();
-              while (*mnemonicStart != 0 && *mnemonicStart != ' ')
-                mnemonicStart++;
-              SScanF(mnemonicStart, "%s", mnemonic);
-              if (!strcmp(arg1, mnemonic)) break;
-
-              PrintF("  0x%08" V8PRIxPTR "  %s\n", sim_->get_pc(),
-                    buffer.start());
-              sim_->ExecuteInstruction(
-                      reinterpret_cast<Instruction*>(sim_->get_pc()));
-            }
-          }
-        }
-      } else if ((strcmp(cmd, "c") == 0) || (strcmp(cmd, "cont") == 0)) {
-        // If at a breakpoint, proceed past it.
-        if ((reinterpret_cast<Instruction*>(sim_->get_pc()))
-                ->InstructionBits() == 0x7D821008) {
-          sim_->set_pc(sim_->get_pc() + sizeof(FourByteInstr));
-        } else {
-          // Execute the one instruction we broke at with breakpoints disabled.
-          sim_->ExecuteInstruction(
-              reinterpret_cast<Instruction*>(sim_->get_pc()));
-        }
-        // Leave the debugger shell.
-        done = true;
-      } else if ((strcmp(cmd, "p") == 0) || (strcmp(cmd, "print") == 0)) {
-        if (argc == 2 || (argc == 3 && strcmp(arg2, "fp") == 0)) {
-          intptr_t value;
-          double dvalue;
-          if (strcmp(arg1, "all") == 0) {
-            for (int i = 0; i < kNumRegisters; i++) {
-              value = GetRegisterValue(i);
-              PrintF("    %3s: %08" V8PRIxPTR,
-                     GetRegConfig()->GetGeneralRegisterName(i), value);
-              if ((argc == 3 && strcmp(arg2, "fp") == 0) && i < 8 &&
-                  (i % 2) == 0) {
-                dvalue = GetRegisterPairDoubleValue(i);
-                PrintF(" (%f)\n", dvalue);
-              } else if (i != 0 && !((i + 1) & 3)) {
-                PrintF("\n");
-              }
-            }
-            PrintF("  pc: %08" V8PRIxPTR "  cr: %08x\n", sim_->special_reg_pc_,
-                   sim_->condition_reg_);
-          } else if (strcmp(arg1, "alld") == 0) {
-            for (int i = 0; i < kNumRegisters; i++) {
-              value = GetRegisterValue(i);
-              PrintF("     %3s: %08" V8PRIxPTR " %11" V8PRIdPTR,
-                     GetRegConfig()->GetGeneralRegisterName(i), value, value);
-              if ((argc == 3 && strcmp(arg2, "fp") == 0) && i < 8 &&
-                  (i % 2) == 0) {
-                dvalue = GetRegisterPairDoubleValue(i);
-                PrintF(" (%f)\n", dvalue);
-              } else if (!((i + 1) % 2)) {
-                PrintF("\n");
-              }
-            }
-            PrintF("   pc: %08" V8PRIxPTR "  cr: %08x\n", sim_->special_reg_pc_,
-                   sim_->condition_reg_);
-          } else if (strcmp(arg1, "allf") == 0) {
-            for (int i = 0; i < DoubleRegister::kNumRegisters; i++) {
-              float fvalue = GetFPFloatRegisterValue(i);
-              uint32_t as_words = bit_cast<uint32_t>(fvalue);
-              PrintF("%3s: %f 0x%08x\n",
-                     GetRegConfig()->GetDoubleRegisterName(i), fvalue,
-                     as_words);
-            }
-          } else if (strcmp(arg1, "alld") == 0) {
-            for (int i = 0; i < DoubleRegister::kNumRegisters; i++) {
-              dvalue = GetFPDoubleRegisterValue(i);
-              uint64_t as_words = bit_cast<uint64_t>(dvalue);
-              PrintF("%3s: %f 0x%08x %08x\n",
-                     GetRegConfig()->GetDoubleRegisterName(i), dvalue,
-                     static_cast<uint32_t>(as_words >> 32),
-                     static_cast<uint32_t>(as_words & 0xFFFFFFFF));
-            }
-          } else if (arg1[0] == 'r' &&
-                     (arg1[1] >= '0' && arg1[1] <= '2' &&
-                      (arg1[2] == '\0' || (arg1[2] >= '0' && arg1[2] <= '5' &&
-                                           arg1[3] == '\0')))) {
-            int regnum = strtoul(&arg1[1], 0, 10);
-            if (regnum != kNoRegister) {
-              value = GetRegisterValue(regnum);
-              PrintF("%s: 0x%08" V8PRIxPTR " %" V8PRIdPTR "\n", arg1, value,
-                     value);
-            } else {
-              PrintF("%s unrecognized\n", arg1);
-            }
-          } else {
-            if (GetValue(arg1, &value)) {
-              PrintF("%s: 0x%08" V8PRIxPTR " %" V8PRIdPTR "\n", arg1, value,
-                     value);
-            } else if (GetFPDoubleValue(arg1, &dvalue)) {
-              uint64_t as_words = bit_cast<uint64_t>(dvalue);
-              PrintF("%s: %f 0x%08x %08x\n", arg1, dvalue,
-                     static_cast<uint32_t>(as_words >> 32),
-                     static_cast<uint32_t>(as_words & 0xFFFFFFFF));
-            } else {
-              PrintF("%s unrecognized\n", arg1);
-            }
-          }
-        } else {
-          PrintF("print <register>\n");
-        }
-      } else if ((strcmp(cmd, "po") == 0) ||
-                 (strcmp(cmd, "printobject") == 0)) {
-        if (argc == 2) {
-          intptr_t value;
-          OFStream os(stdout);
-          if (GetValue(arg1, &value)) {
-            Object* obj = reinterpret_cast<Object*>(value);
-            os << arg1 << ": \n";
-#ifdef DEBUG
-            obj->Print(os);
-            os << "\n";
-#else
-            os << Brief(obj) << "\n";
-#endif
-          } else {
-            os << arg1 << " unrecognized\n";
-          }
-        } else {
-          PrintF("printobject <value>\n");
-        }
-      } else if (strcmp(cmd, "setpc") == 0) {
-        intptr_t value;
-
-        if (!GetValue(arg1, &value)) {
-          PrintF("%s unrecognized\n", arg1);
-          continue;
-        }
-        sim_->set_pc(value);
-      } else if (strcmp(cmd, "stack") == 0 || strcmp(cmd, "mem") == 0) {
-        intptr_t* cur = nullptr;
-        intptr_t* end = nullptr;
-        int next_arg = 1;
-
-        if (strcmp(cmd, "stack") == 0) {
-          cur = reinterpret_cast<intptr_t*>(sim_->get_register(Simulator::sp));
-        } else {  // "mem"
-          intptr_t value;
-          if (!GetValue(arg1, &value)) {
-            PrintF("%s unrecognized\n", arg1);
-            continue;
-          }
-          cur = reinterpret_cast<intptr_t*>(value);
-          next_arg++;
-        }
-
-        intptr_t words;  // likely inaccurate variable name for 64bit
-        if (argc == next_arg) {
-          words = 10;
-        } else {
-          if (!GetValue(argv[next_arg], &words)) {
-            words = 10;
-          }
-        }
-        end = cur + words;
-
-        while (cur < end) {
-          PrintF("  0x%08" V8PRIxPTR ":  0x%08" V8PRIxPTR " %10" V8PRIdPTR,
-                 reinterpret_cast<intptr_t>(cur), *cur, *cur);
-          HeapObject* obj = reinterpret_cast<HeapObject*>(*cur);
-          intptr_t value = *cur;
-          Heap* current_heap = sim_->isolate_->heap();
-          if (((value & 1) == 0) ||
-              current_heap->ContainsSlow(obj->address())) {
-            PrintF("(smi %d)", PlatformSmiTagging::SmiToInt(obj));
-          } else if (current_heap->Contains(obj)) {
-            PrintF(" (");
-            obj->ShortPrint();
-            PrintF(")");
-          }
-          PrintF("\n");
-          cur++;
-        }
-      } else if (strcmp(cmd, "disasm") == 0 || strcmp(cmd, "di") == 0) {
-        disasm::NameConverter converter;
-        disasm::Disassembler dasm(converter);
-        // use a reasonably large buffer
-        v8::internal::EmbeddedVector<char, 256> buffer;
-
-        byte* prev = nullptr;
-        byte* cur = nullptr;
-        // Default number of instructions to disassemble.
-        int32_t numInstructions = 10;
-
-        if (argc == 1) {
-          cur = reinterpret_cast<byte*>(sim_->get_pc());
-        } else if (argc == 2) {
-          int regnum = Registers::Number(arg1);
-          if (regnum != kNoRegister || strncmp(arg1, "0x", 2) == 0) {
-            // The argument is an address or a register name.
-            intptr_t value;
-            if (GetValue(arg1, &value)) {
-              cur = reinterpret_cast<byte*>(value);
-            }
-          } else {
-            // The argument is the number of instructions.
-            intptr_t value;
-            if (GetValue(arg1, &value)) {
-              cur = reinterpret_cast<byte*>(sim_->get_pc());
-              // Disassemble <arg1> instructions.
-              numInstructions = static_cast<int32_t>(value);
-            }
-          }
-        } else {
-          intptr_t value1;
-          intptr_t value2;
-          if (GetValue(arg1, &value1) && GetValue(arg2, &value2)) {
-            cur = reinterpret_cast<byte*>(value1);
-            // Disassemble <arg2> instructions.
-            numInstructions = static_cast<int32_t>(value2);
-          }
-        }
-
-        while (numInstructions > 0) {
-          prev = cur;
-          cur += dasm.InstructionDecode(buffer, cur);
-          PrintF("  0x%08" V8PRIxPTR "  %s\n", reinterpret_cast<intptr_t>(prev),
-                 buffer.start());
-          numInstructions--;
-        }
-      } else if (strcmp(cmd, "gdb") == 0) {
-        PrintF("relinquishing control to gdb\n");
-        v8::base::OS::DebugBreak();
-        PrintF("regaining control from gdb\n");
-      } else if (strcmp(cmd, "break") == 0) {
-        if (argc == 2) {
-          intptr_t value;
-          if (GetValue(arg1, &value)) {
-            if (!SetBreakpoint(reinterpret_cast<Instruction*>(value))) {
-              PrintF("setting breakpoint failed\n");
-            }
-          } else {
-            PrintF("%s unrecognized\n", arg1);
-          }
-        } else {
-          PrintF("break <address>\n");
-        }
-      } else if (strcmp(cmd, "del") == 0) {
-        if (!DeleteBreakpoint(nullptr)) {
-          PrintF("deleting breakpoint failed\n");
-        }
-      } else if (strcmp(cmd, "cr") == 0) {
-        PrintF("Condition reg: %08x\n", sim_->condition_reg_);
-      } else if (strcmp(cmd, "stop") == 0) {
-        intptr_t value;
-        intptr_t stop_pc =
-            sim_->get_pc() - (sizeof(FourByteInstr) + kPointerSize);
-        Instruction* stop_instr = reinterpret_cast<Instruction*>(stop_pc);
-        Instruction* msg_address =
-            reinterpret_cast<Instruction*>(stop_pc + sizeof(FourByteInstr));
-        if ((argc == 2) && (strcmp(arg1, "unstop") == 0)) {
-          // Remove the current stop.
-          if (sim_->isStopInstruction(stop_instr)) {
-            stop_instr->SetInstructionBits(kNopInstr);
-            msg_address->SetInstructionBits(kNopInstr);
-          } else {
-            PrintF("Not at debugger stop.\n");
-          }
-        } else if (argc == 3) {
-          // Print information about all/the specified breakpoint(s).
-          if (strcmp(arg1, "info") == 0) {
-            if (strcmp(arg2, "all") == 0) {
-              PrintF("Stop information:\n");
-              for (uint32_t i = 0; i < sim_->kNumOfWatchedStops; i++) {
-                sim_->PrintStopInfo(i);
-              }
-            } else if (GetValue(arg2, &value)) {
-              sim_->PrintStopInfo(value);
-            } else {
-              PrintF("Unrecognized argument.\n");
-            }
-          } else if (strcmp(arg1, "enable") == 0) {
-            // Enable all/the specified breakpoint(s).
-            if (strcmp(arg2, "all") == 0) {
-              for (uint32_t i = 0; i < sim_->kNumOfWatchedStops; i++) {
-                sim_->EnableStop(i);
-              }
-            } else if (GetValue(arg2, &value)) {
-              sim_->EnableStop(value);
-            } else {
-              PrintF("Unrecognized argument.\n");
-            }
-          } else if (strcmp(arg1, "disable") == 0) {
-            // Disable all/the specified breakpoint(s).
-            if (strcmp(arg2, "all") == 0) {
-              for (uint32_t i = 0; i < sim_->kNumOfWatchedStops; i++) {
-                sim_->DisableStop(i);
-              }
-            } else if (GetValue(arg2, &value)) {
-              sim_->DisableStop(value);
-            } else {
-              PrintF("Unrecognized argument.\n");
-            }
-          }
-        } else {
-          PrintF("Wrong usage. Use help command for more information.\n");
-        }
-      } else if (strcmp(cmd, "icount") == 0) {
-        PrintF("%05" PRId64 "\n", sim_->icount_);
-      } else if ((strcmp(cmd, "t") == 0) || strcmp(cmd, "trace") == 0) {
-        ::v8::internal::FLAG_trace_sim = !::v8::internal::FLAG_trace_sim;
-        PrintF("Trace of executed instructions is %s\n",
-               ::v8::internal::FLAG_trace_sim ? "on" : "off");
-      } else if ((strcmp(cmd, "h") == 0) || (strcmp(cmd, "help") == 0)) {
-        PrintF("cont\n");
-        PrintF("  continue execution (alias 'c')\n");
-        PrintF("stepi [num instructions]\n");
-        PrintF("  step one/num instruction(s) (alias 'si')\n");
-        PrintF("print <register>\n");
-        PrintF("  print register content (alias 'p')\n");
-        PrintF("  use register name 'all' to display all integer registers\n");
-        PrintF(
-            "  use register name 'alld' to display integer registers "
-            "with decimal values\n");
-        PrintF("  use register name 'rN' to display register number 'N'\n");
-        PrintF("  add argument 'fp' to print register pair double values\n");
-        PrintF(
-            "  use register name 'allf' to display floating-point "
-            "registers\n");
-        PrintF("printobject <register>\n");
-        PrintF("  print an object from a register (alias 'po')\n");
-        PrintF("cr\n");
-        PrintF("  print condition register\n");
-        PrintF("stack [<num words>]\n");
-        PrintF("  dump stack content, default dump 10 words)\n");
-        PrintF("mem <address> [<num words>]\n");
-        PrintF("  dump memory content, default dump 10 words)\n");
-        PrintF("disasm [<instructions>]\n");
-        PrintF("disasm [<address/register>]\n");
-        PrintF("disasm [[<address/register>] <instructions>]\n");
-        PrintF("  disassemble code, default is 10 instructions\n");
-        PrintF("  from pc (alias 'di')\n");
-        PrintF("gdb\n");
-        PrintF("  enter gdb\n");
-        PrintF("break <address>\n");
-        PrintF("  set a break point on the address\n");
-        PrintF("del\n");
-        PrintF("  delete the breakpoint\n");
-        PrintF("trace (alias 't')\n");
-        PrintF("  toogle the tracing of all executed statements\n");
-        PrintF("stop feature:\n");
-        PrintF("  Description:\n");
-        PrintF("    Stops are debug instructions inserted by\n");
-        PrintF("    the Assembler::stop() function.\n");
-        PrintF("    When hitting a stop, the Simulator will\n");
-        PrintF("    stop and and give control to the S390Debugger.\n");
-        PrintF("    The first %d stop codes are watched:\n",
-               Simulator::kNumOfWatchedStops);
-        PrintF("    - They can be enabled / disabled: the Simulator\n");
-        PrintF("      will / won't stop when hitting them.\n");
-        PrintF("    - The Simulator keeps track of how many times they \n");
-        PrintF("      are met. (See the info command.) Going over a\n");
-        PrintF("      disabled stop still increases its counter. \n");
-        PrintF("  Commands:\n");
-        PrintF("    stop info all/<code> : print infos about number <code>\n");
-        PrintF("      or all stop(s).\n");
-        PrintF("    stop enable/disable all/<code> : enables / disables\n");
-        PrintF("      all or number <code> stop(s)\n");
-        PrintF("    stop unstop\n");
-        PrintF("      ignore the stop instruction at the current location\n");
-        PrintF("      from now on\n");
-      } else {
-        PrintF("Unknown command: %s\n", cmd);
-      }
-    }
-  }
-
-  // Add all the breakpoints back to stop execution and enter the debugger
-  // shell when hit.
-  RedoBreakpoints();
-  // Restore tracing
-  ::v8::internal::FLAG_trace_sim = trace;
-
-#undef COMMAND_SIZE
-#undef ARG_SIZE
-
-#undef STR
-#undef XSTR
-}
-
-static bool ICacheMatch(void* one, void* two) {
-  DCHECK_EQ(reinterpret_cast<intptr_t>(one) & CachePage::kPageMask, 0);
-  DCHECK_EQ(reinterpret_cast<intptr_t>(two) & CachePage::kPageMask, 0);
-  return one == two;
-}
-
-static uint32_t ICacheHash(void* key) {
-  return static_cast<uint32_t>(reinterpret_cast<uintptr_t>(key)) >> 2;
-}
-
-static bool AllOnOnePage(uintptr_t start, int size) {
-  intptr_t start_page = (start & ~CachePage::kPageMask);
-  intptr_t end_page = ((start + size) & ~CachePage::kPageMask);
-  return start_page == end_page;
-}
-
-void Simulator::set_last_debugger_input(char* input) {
-  DeleteArray(last_debugger_input_);
-  last_debugger_input_ = input;
-}
-
-void Simulator::SetRedirectInstruction(Instruction* instruction) {
-// we use TRAP4 here (0xBF22)
-#if V8_TARGET_LITTLE_ENDIAN
-  instruction->SetInstructionBits(0x1000FFB2);
-#else
-  instruction->SetInstructionBits(0xB2FF0000 | kCallRtRedirected);
-#endif
-}
-
-void Simulator::FlushICache(base::CustomMatcherHashMap* i_cache,
-                            void* start_addr, size_t size) {
-  intptr_t start = reinterpret_cast<intptr_t>(start_addr);
-  int intra_line = (start & CachePage::kLineMask);
-  start -= intra_line;
-  size += intra_line;
-  size = ((size - 1) | CachePage::kLineMask) + 1;
-  int offset = (start & CachePage::kPageMask);
-  while (!AllOnOnePage(start, size - 1)) {
-    int bytes_to_flush = CachePage::kPageSize - offset;
-    FlushOnePage(i_cache, start, bytes_to_flush);
-    start += bytes_to_flush;
-    size -= bytes_to_flush;
-    DCHECK_EQ(0, static_cast<int>(start & CachePage::kPageMask));
-    offset = 0;
-  }
-  if (size != 0) {
-    FlushOnePage(i_cache, start, size);
-  }
-}
-
-CachePage* Simulator::GetCachePage(base::CustomMatcherHashMap* i_cache,
-                                   void* page) {
-  base::HashMap::Entry* entry = i_cache->LookupOrInsert(page, ICacheHash(page));
-  if (entry->value == nullptr) {
-    CachePage* new_page = new CachePage();
-    entry->value = new_page;
-  }
-  return reinterpret_cast<CachePage*>(entry->value);
-}
-
-// Flush from start up to and not including start + size.
-void Simulator::FlushOnePage(base::CustomMatcherHashMap* i_cache,
-                             intptr_t start, int size) {
-  DCHECK_LE(size, CachePage::kPageSize);
-  DCHECK(AllOnOnePage(start, size - 1));
-  DCHECK_EQ(start & CachePage::kLineMask, 0);
-  DCHECK_EQ(size & CachePage::kLineMask, 0);
-  void* page = reinterpret_cast<void*>(start & (~CachePage::kPageMask));
-  int offset = (start & CachePage::kPageMask);
-  CachePage* cache_page = GetCachePage(i_cache, page);
-  char* valid_bytemap = cache_page->ValidityByte(offset);
-  memset(valid_bytemap, CachePage::LINE_INVALID, size >> CachePage::kLineShift);
-}
-
-void Simulator::CheckICache(base::CustomMatcherHashMap* i_cache,
-                            Instruction* instr) {
-  intptr_t address = reinterpret_cast<intptr_t>(instr);
-  void* page = reinterpret_cast<void*>(address & (~CachePage::kPageMask));
-  void* line = reinterpret_cast<void*>(address & (~CachePage::kLineMask));
-  int offset = (address & CachePage::kPageMask);
-  CachePage* cache_page = GetCachePage(i_cache, page);
-  char* cache_valid_byte = cache_page->ValidityByte(offset);
-  bool cache_hit = (*cache_valid_byte == CachePage::LINE_VALID);
-  char* cached_line = cache_page->CachedData(offset & ~CachePage::kLineMask);
-  if (cache_hit) {
-    // Check that the data in memory matches the contents of the I-cache.
-    CHECK_EQ(memcmp(reinterpret_cast<void*>(instr),
-                    cache_page->CachedData(offset), sizeof(FourByteInstr)),
-             0);
-  } else {
-    // Cache miss.  Load memory into the cache.
-    memcpy(cached_line, line, CachePage::kLineLength);
-    *cache_valid_byte = CachePage::LINE_VALID;
-  }
-}
-
-Simulator::EvaluateFuncType Simulator::EvalTable[] = {nullptr};
-
-void Simulator::EvalTableInit() {
-  for (int i = 0; i < MAX_NUM_OPCODES; i++) {
-    EvalTable[i] = &Simulator::Evaluate_Unknown;
-  }
-
-#define S390_SUPPORTED_VECTOR_OPCODE_LIST(V)                 \
-  V(vfs, VFS, 0xE7E2) /* type = VRR_C VECTOR FP SUBTRACT  */ \
-  V(vfa, VFA, 0xE7E3) /* type = VRR_C VECTOR FP ADD  */      \
-  V(vfd, VFD, 0xE7E5) /* type = VRR_C VECTOR FP DIVIDE  */   \
-  V(vfm, VFM, 0xE7E7) /* type = VRR_C VECTOR FP MULTIPLY  */
-
-#define CREATE_EVALUATE_TABLE(name, op_name, op_value) \
-  EvalTable[op_name] = &Simulator::Evaluate_##op_name;
-  S390_SUPPORTED_VECTOR_OPCODE_LIST(CREATE_EVALUATE_TABLE);
-#undef CREATE_EVALUATE_TABLE
-
-  EvalTable[DUMY] = &Simulator::Evaluate_DUMY;
-  EvalTable[BKPT] = &Simulator::Evaluate_BKPT;
-  EvalTable[SPM] = &Simulator::Evaluate_SPM;
-  EvalTable[BALR] = &Simulator::Evaluate_BALR;
-  EvalTable[BCTR] = &Simulator::Evaluate_BCTR;
-  EvalTable[BCR] = &Simulator::Evaluate_BCR;
-  EvalTable[SVC] = &Simulator::Evaluate_SVC;
-  EvalTable[BSM] = &Simulator::Evaluate_BSM;
-  EvalTable[BASSM] = &Simulator::Evaluate_BASSM;
-  EvalTable[BASR] = &Simulator::Evaluate_BASR;
-  EvalTable[MVCL] = &Simulator::Evaluate_MVCL;
-  EvalTable[CLCL] = &Simulator::Evaluate_CLCL;
-  EvalTable[LPR] = &Simulator::Evaluate_LPR;
-  EvalTable[LNR] = &Simulator::Evaluate_LNR;
-  EvalTable[LTR] = &Simulator::Evaluate_LTR;
-  EvalTable[LCR] = &Simulator::Evaluate_LCR;
-  EvalTable[NR] = &Simulator::Evaluate_NR;
-  EvalTable[CLR] = &Simulator::Evaluate_CLR;
-  EvalTable[OR] = &Simulator::Evaluate_OR;
-  EvalTable[XR] = &Simulator::Evaluate_XR;
-  EvalTable[LR] = &Simulator::Evaluate_LR;
-  EvalTable[CR] = &Simulator::Evaluate_CR;
-  EvalTable[AR] = &Simulator::Evaluate_AR;
-  EvalTable[SR] = &Simulator::Evaluate_SR;
-  EvalTable[MR] = &Simulator::Evaluate_MR;
-  EvalTable[DR] = &Simulator::Evaluate_DR;
-  EvalTable[ALR] = &Simulator::Evaluate_ALR;
-  EvalTable[SLR] = &Simulator::Evaluate_SLR;
-  EvalTable[LDR] = &Simulator::Evaluate_LDR;
-  EvalTable[CDR] = &Simulator::Evaluate_CDR;
-  EvalTable[LER] = &Simulator::Evaluate_LER;
-  EvalTable[STH] = &Simulator::Evaluate_STH;
-  EvalTable[LA] = &Simulator::Evaluate_LA;
-  EvalTable[STC] = &Simulator::Evaluate_STC;
-  EvalTable[IC_z] = &Simulator::Evaluate_IC_z;
-  EvalTable[EX] = &Simulator::Evaluate_EX;
-  EvalTable[BAL] = &Simulator::Evaluate_BAL;
-  EvalTable[BCT] = &Simulator::Evaluate_BCT;
-  EvalTable[BC] = &Simulator::Evaluate_BC;
-  EvalTable[LH] = &Simulator::Evaluate_LH;
-  EvalTable[CH] = &Simulator::Evaluate_CH;
-  EvalTable[AH] = &Simulator::Evaluate_AH;
-  EvalTable[SH] = &Simulator::Evaluate_SH;
-  EvalTable[MH] = &Simulator::Evaluate_MH;
-  EvalTable[BAS] = &Simulator::Evaluate_BAS;
-  EvalTable[CVD] = &Simulator::Evaluate_CVD;
-  EvalTable[CVB] = &Simulator::Evaluate_CVB;
-  EvalTable[ST] = &Simulator::Evaluate_ST;
-  EvalTable[LAE] = &Simulator::Evaluate_LAE;
-  EvalTable[N] = &Simulator::Evaluate_N;
-  EvalTable[CL] = &Simulator::Evaluate_CL;
-  EvalTable[O] = &Simulator::Evaluate_O;
-  EvalTable[X] = &Simulator::Evaluate_X;
-  EvalTable[L] = &Simulator::Evaluate_L;
-  EvalTable[C] = &Simulator::Evaluate_C;
-  EvalTable[A] = &Simulator::Evaluate_A;
-  EvalTable[S] = &Simulator::Evaluate_S;
-  EvalTable[M] = &Simulator::Evaluate_M;
-  EvalTable[D] = &Simulator::Evaluate_D;
-  EvalTable[AL] = &Simulator::Evaluate_AL;
-  EvalTable[SL] = &Simulator::Evaluate_SL;
-  EvalTable[STD] = &Simulator::Evaluate_STD;
-  EvalTable[LD] = &Simulator::Evaluate_LD;
-  EvalTable[CD] = &Simulator::Evaluate_CD;
-  EvalTable[STE] = &Simulator::Evaluate_STE;
-  EvalTable[MS] = &Simulator::Evaluate_MS;
-  EvalTable[LE] = &Simulator::Evaluate_LE;
-  EvalTable[BRXH] = &Simulator::Evaluate_BRXH;
-  EvalTable[BRXLE] = &Simulator::Evaluate_BRXLE;
-  EvalTable[BXH] = &Simulator::Evaluate_BXH;
-  EvalTable[BXLE] = &Simulator::Evaluate_BXLE;
-  EvalTable[SRL] = &Simulator::Evaluate_SRL;
-  EvalTable[SLL] = &Simulator::Evaluate_SLL;
-  EvalTable[SRA] = &Simulator::Evaluate_SRA;
-  EvalTable[SLA] = &Simulator::Evaluate_SLA;
-  EvalTable[SRDL] = &Simulator::Evaluate_SRDL;
-  EvalTable[SLDL] = &Simulator::Evaluate_SLDL;
-  EvalTable[SRDA] = &Simulator::Evaluate_SRDA;
-  EvalTable[SLDA] = &Simulator::Evaluate_SLDA;
-  EvalTable[STM] = &Simulator::Evaluate_STM;
-  EvalTable[TM] = &Simulator::Evaluate_TM;
-  EvalTable[MVI] = &Simulator::Evaluate_MVI;
-  EvalTable[TS] = &Simulator::Evaluate_TS;
-  EvalTable[NI] = &Simulator::Evaluate_NI;
-  EvalTable[CLI] = &Simulator::Evaluate_CLI;
-  EvalTable[OI] = &Simulator::Evaluate_OI;
-  EvalTable[XI] = &Simulator::Evaluate_XI;
-  EvalTable[LM] = &Simulator::Evaluate_LM;
-  EvalTable[CS] = &Simulator::Evaluate_CS;
-  EvalTable[MVCLE] = &Simulator::Evaluate_MVCLE;
-  EvalTable[CLCLE] = &Simulator::Evaluate_CLCLE;
-  EvalTable[MC] = &Simulator::Evaluate_MC;
-  EvalTable[CDS] = &Simulator::Evaluate_CDS;
-  EvalTable[STCM] = &Simulator::Evaluate_STCM;
-  EvalTable[ICM] = &Simulator::Evaluate_ICM;
-  EvalTable[BPRP] = &Simulator::Evaluate_BPRP;
-  EvalTable[BPP] = &Simulator::Evaluate_BPP;
-  EvalTable[TRTR] = &Simulator::Evaluate_TRTR;
-  EvalTable[MVN] = &Simulator::Evaluate_MVN;
-  EvalTable[MVC] = &Simulator::Evaluate_MVC;
-  EvalTable[MVZ] = &Simulator::Evaluate_MVZ;
-  EvalTable[NC] = &Simulator::Evaluate_NC;
-  EvalTable[CLC] = &Simulator::Evaluate_CLC;
-  EvalTable[OC] = &Simulator::Evaluate_OC;
-  EvalTable[XC] = &Simulator::Evaluate_XC;
-  EvalTable[MVCP] = &Simulator::Evaluate_MVCP;
-  EvalTable[TR] = &Simulator::Evaluate_TR;
-  EvalTable[TRT] = &Simulator::Evaluate_TRT;
-  EvalTable[ED] = &Simulator::Evaluate_ED;
-  EvalTable[EDMK] = &Simulator::Evaluate_EDMK;
-  EvalTable[PKU] = &Simulator::Evaluate_PKU;
-  EvalTable[UNPKU] = &Simulator::Evaluate_UNPKU;
-  EvalTable[MVCIN] = &Simulator::Evaluate_MVCIN;
-  EvalTable[PKA] = &Simulator::Evaluate_PKA;
-  EvalTable[UNPKA] = &Simulator::Evaluate_UNPKA;
-  EvalTable[PLO] = &Simulator::Evaluate_PLO;
-  EvalTable[LMD] = &Simulator::Evaluate_LMD;
-  EvalTable[SRP] = &Simulator::Evaluate_SRP;
-  EvalTable[MVO] = &Simulator::Evaluate_MVO;
-  EvalTable[PACK] = &Simulator::Evaluate_PACK;
-  EvalTable[UNPK] = &Simulator::Evaluate_UNPK;
-  EvalTable[ZAP] = &Simulator::Evaluate_ZAP;
-  EvalTable[AP] = &Simulator::Evaluate_AP;
-  EvalTable[SP] = &Simulator::Evaluate_SP;
-  EvalTable[MP] = &Simulator::Evaluate_MP;
-  EvalTable[DP] = &Simulator::Evaluate_DP;
-  EvalTable[UPT] = &Simulator::Evaluate_UPT;
-  EvalTable[PFPO] = &Simulator::Evaluate_PFPO;
-  EvalTable[IIHH] = &Simulator::Evaluate_IIHH;
-  EvalTable[IIHL] = &Simulator::Evaluate_IIHL;
-  EvalTable[IILH] = &Simulator::Evaluate_IILH;
-  EvalTable[IILL] = &Simulator::Evaluate_IILL;
-  EvalTable[NIHH] = &Simulator::Evaluate_NIHH;
-  EvalTable[NIHL] = &Simulator::Evaluate_NIHL;
-  EvalTable[NILH] = &Simulator::Evaluate_NILH;
-  EvalTable[NILL] = &Simulator::Evaluate_NILL;
-  EvalTable[OIHH] = &Simulator::Evaluate_OIHH;
-  EvalTable[OIHL] = &Simulator::Evaluate_OIHL;
-  EvalTable[OILH] = &Simulator::Evaluate_OILH;
-  EvalTable[OILL] = &Simulator::Evaluate_OILL;
-  EvalTable[LLIHH] = &Simulator::Evaluate_LLIHH;
-  EvalTable[LLIHL] = &Simulator::Evaluate_LLIHL;
-  EvalTable[LLILH] = &Simulator::Evaluate_LLILH;
-  EvalTable[LLILL] = &Simulator::Evaluate_LLILL;
-  EvalTable[TMLH] = &Simulator::Evaluate_TMLH;
-  EvalTable[TMLL] = &Simulator::Evaluate_TMLL;
-  EvalTable[TMHH] = &Simulator::Evaluate_TMHH;
-  EvalTable[TMHL] = &Simulator::Evaluate_TMHL;
-  EvalTable[BRC] = &Simulator::Evaluate_BRC;
-  EvalTable[BRAS] = &Simulator::Evaluate_BRAS;
-  EvalTable[BRCT] = &Simulator::Evaluate_BRCT;
-  EvalTable[BRCTG] = &Simulator::Evaluate_BRCTG;
-  EvalTable[LHI] = &Simulator::Evaluate_LHI;
-  EvalTable[LGHI] = &Simulator::Evaluate_LGHI;
-  EvalTable[AHI] = &Simulator::Evaluate_AHI;
-  EvalTable[AGHI] = &Simulator::Evaluate_AGHI;
-  EvalTable[MHI] = &Simulator::Evaluate_MHI;
-  EvalTable[MGHI] = &Simulator::Evaluate_MGHI;
-  EvalTable[CHI] = &Simulator::Evaluate_CHI;
-  EvalTable[CGHI] = &Simulator::Evaluate_CGHI;
-  EvalTable[LARL] = &Simulator::Evaluate_LARL;
-  EvalTable[LGFI] = &Simulator::Evaluate_LGFI;
-  EvalTable[BRCL] = &Simulator::Evaluate_BRCL;
-  EvalTable[BRASL] = &Simulator::Evaluate_BRASL;
-  EvalTable[XIHF] = &Simulator::Evaluate_XIHF;
-  EvalTable[XILF] = &Simulator::Evaluate_XILF;
-  EvalTable[IIHF] = &Simulator::Evaluate_IIHF;
-  EvalTable[IILF] = &Simulator::Evaluate_IILF;
-  EvalTable[NIHF] = &Simulator::Evaluate_NIHF;
-  EvalTable[NILF] = &Simulator::Evaluate_NILF;
-  EvalTable[OIHF] = &Simulator::Evaluate_OIHF;
-  EvalTable[OILF] = &Simulator::Evaluate_OILF;
-  EvalTable[LLIHF] = &Simulator::Evaluate_LLIHF;
-  EvalTable[LLILF] = &Simulator::Evaluate_LLILF;
-  EvalTable[MSGFI] = &Simulator::Evaluate_MSGFI;
-  EvalTable[MSFI] = &Simulator::Evaluate_MSFI;
-  EvalTable[SLGFI] = &Simulator::Evaluate_SLGFI;
-  EvalTable[SLFI] = &Simulator::Evaluate_SLFI;
-  EvalTable[AGFI] = &Simulator::Evaluate_AGFI;
-  EvalTable[AFI] = &Simulator::Evaluate_AFI;
-  EvalTable[ALGFI] = &Simulator::Evaluate_ALGFI;
-  EvalTable[ALFI] = &Simulator::Evaluate_ALFI;
-  EvalTable[CGFI] = &Simulator::Evaluate_CGFI;
-  EvalTable[CFI] = &Simulator::Evaluate_CFI;
-  EvalTable[CLGFI] = &Simulator::Evaluate_CLGFI;
-  EvalTable[CLFI] = &Simulator::Evaluate_CLFI;
-  EvalTable[LLHRL] = &Simulator::Evaluate_LLHRL;
-  EvalTable[LGHRL] = &Simulator::Evaluate_LGHRL;
-  EvalTable[LHRL] = &Simulator::Evaluate_LHRL;
-  EvalTable[LLGHRL] = &Simulator::Evaluate_LLGHRL;
-  EvalTable[STHRL] = &Simulator::Evaluate_STHRL;
-  EvalTable[LGRL] = &Simulator::Evaluate_LGRL;
-  EvalTable[STGRL] = &Simulator::Evaluate_STGRL;
-  EvalTable[LGFRL] = &Simulator::Evaluate_LGFRL;
-  EvalTable[LRL] = &Simulator::Evaluate_LRL;
-  EvalTable[LLGFRL] = &Simulator::Evaluate_LLGFRL;
-  EvalTable[STRL] = &Simulator::Evaluate_STRL;
-  EvalTable[EXRL] = &Simulator::Evaluate_EXRL;
-  EvalTable[PFDRL] = &Simulator::Evaluate_PFDRL;
-  EvalTable[CGHRL] = &Simulator::Evaluate_CGHRL;
-  EvalTable[CHRL] = &Simulator::Evaluate_CHRL;
-  EvalTable[CGRL] = &Simulator::Evaluate_CGRL;
-  EvalTable[CGFRL] = &Simulator::Evaluate_CGFRL;
-  EvalTable[ECTG] = &Simulator::Evaluate_ECTG;
-  EvalTable[CSST] = &Simulator::Evaluate_CSST;
-  EvalTable[LPD] = &Simulator::Evaluate_LPD;
-  EvalTable[LPDG] = &Simulator::Evaluate_LPDG;
-  EvalTable[BRCTH] = &Simulator::Evaluate_BRCTH;
-  EvalTable[AIH] = &Simulator::Evaluate_AIH;
-  EvalTable[ALSIH] = &Simulator::Evaluate_ALSIH;
-  EvalTable[ALSIHN] = &Simulator::Evaluate_ALSIHN;
-  EvalTable[CIH] = &Simulator::Evaluate_CIH;
-  EvalTable[CLIH] = &Simulator::Evaluate_CLIH;
-  EvalTable[STCK] = &Simulator::Evaluate_STCK;
-  EvalTable[CFC] = &Simulator::Evaluate_CFC;
-  EvalTable[IPM] = &Simulator::Evaluate_IPM;
-  EvalTable[HSCH] = &Simulator::Evaluate_HSCH;
-  EvalTable[MSCH] = &Simulator::Evaluate_MSCH;
-  EvalTable[SSCH] = &Simulator::Evaluate_SSCH;
-  EvalTable[STSCH] = &Simulator::Evaluate_STSCH;
-  EvalTable[TSCH] = &Simulator::Evaluate_TSCH;
-  EvalTable[TPI] = &Simulator::Evaluate_TPI;
-  EvalTable[SAL] = &Simulator::Evaluate_SAL;
-  EvalTable[RSCH] = &Simulator::Evaluate_RSCH;
-  EvalTable[STCRW] = &Simulator::Evaluate_STCRW;
-  EvalTable[STCPS] = &Simulator::Evaluate_STCPS;
-  EvalTable[RCHP] = &Simulator::Evaluate_RCHP;
-  EvalTable[SCHM] = &Simulator::Evaluate_SCHM;
-  EvalTable[CKSM] = &Simulator::Evaluate_CKSM;
-  EvalTable[SAR] = &Simulator::Evaluate_SAR;
-  EvalTable[EAR] = &Simulator::Evaluate_EAR;
-  EvalTable[MSR] = &Simulator::Evaluate_MSR;
-  EvalTable[MSRKC] = &Simulator::Evaluate_MSRKC;
-  EvalTable[MVST] = &Simulator::Evaluate_MVST;
-  EvalTable[CUSE] = &Simulator::Evaluate_CUSE;
-  EvalTable[SRST] = &Simulator::Evaluate_SRST;
-  EvalTable[XSCH] = &Simulator::Evaluate_XSCH;
-  EvalTable[STCKE] = &Simulator::Evaluate_STCKE;
-  EvalTable[STCKF] = &Simulator::Evaluate_STCKF;
-  EvalTable[SRNM] = &Simulator::Evaluate_SRNM;
-  EvalTable[STFPC] = &Simulator::Evaluate_STFPC;
-  EvalTable[LFPC] = &Simulator::Evaluate_LFPC;
-  EvalTable[TRE] = &Simulator::Evaluate_TRE;
-  EvalTable[CUUTF] = &Simulator::Evaluate_CUUTF;
-  EvalTable[CUTFU] = &Simulator::Evaluate_CUTFU;
-  EvalTable[STFLE] = &Simulator::Evaluate_STFLE;
-  EvalTable[SRNMB] = &Simulator::Evaluate_SRNMB;
-  EvalTable[SRNMT] = &Simulator::Evaluate_SRNMT;
-  EvalTable[LFAS] = &Simulator::Evaluate_LFAS;
-  EvalTable[PPA] = &Simulator::Evaluate_PPA;
-  EvalTable[ETND] = &Simulator::Evaluate_ETND;
-  EvalTable[TEND] = &Simulator::Evaluate_TEND;
-  EvalTable[NIAI] = &Simulator::Evaluate_NIAI;
-  EvalTable[TABORT] = &Simulator::Evaluate_TABORT;
-  EvalTable[TRAP4] = &Simulator::Evaluate_TRAP4;
-  EvalTable[LPEBR] = &Simulator::Evaluate_LPEBR;
-  EvalTable[LNEBR] = &Simulator::Evaluate_LNEBR;
-  EvalTable[LTEBR] = &Simulator::Evaluate_LTEBR;
-  EvalTable[LCEBR] = &Simulator::Evaluate_LCEBR;
-  EvalTable[LDEBR] = &Simulator::Evaluate_LDEBR;
-  EvalTable[LXDBR] = &Simulator::Evaluate_LXDBR;
-  EvalTable[LXEBR] = &Simulator::Evaluate_LXEBR;
-  EvalTable[MXDBR] = &Simulator::Evaluate_MXDBR;
-  EvalTable[KEBR] = &Simulator::Evaluate_KEBR;
-  EvalTable[CEBR] = &Simulator::Evaluate_CEBR;
-  EvalTable[AEBR] = &Simulator::Evaluate_AEBR;
-  EvalTable[SEBR] = &Simulator::Evaluate_SEBR;
-  EvalTable[MDEBR] = &Simulator::Evaluate_MDEBR;
-  EvalTable[DEBR] = &Simulator::Evaluate_DEBR;
-  EvalTable[MAEBR] = &Simulator::Evaluate_MAEBR;
-  EvalTable[MSEBR] = &Simulator::Evaluate_MSEBR;
-  EvalTable[LPDBR] = &Simulator::Evaluate_LPDBR;
-  EvalTable[LNDBR] = &Simulator::Evaluate_LNDBR;
-  EvalTable[LTDBR] = &Simulator::Evaluate_LTDBR;
-  EvalTable[LCDBR] = &Simulator::Evaluate_LCDBR;
-  EvalTable[SQEBR] = &Simulator::Evaluate_SQEBR;
-  EvalTable[SQDBR] = &Simulator::Evaluate_SQDBR;
-  EvalTable[SQXBR] = &Simulator::Evaluate_SQXBR;
-  EvalTable[MEEBR] = &Simulator::Evaluate_MEEBR;
-  EvalTable[KDBR] = &Simulator::Evaluate_KDBR;
-  EvalTable[CDBR] = &Simulator::Evaluate_CDBR;
-  EvalTable[ADBR] = &Simulator::Evaluate_ADBR;
-  EvalTable[SDBR] = &Simulator::Evaluate_SDBR;
-  EvalTable[MDBR] = &Simulator::Evaluate_MDBR;
-  EvalTable[DDBR] = &Simulator::Evaluate_DDBR;
-  EvalTable[MADBR] = &Simulator::Evaluate_MADBR;
-  EvalTable[MSDBR] = &Simulator::Evaluate_MSDBR;
-  EvalTable[LPXBR] = &Simulator::Evaluate_LPXBR;
-  EvalTable[LNXBR] = &Simulator::Evaluate_LNXBR;
-  EvalTable[LTXBR] = &Simulator::Evaluate_LTXBR;
-  EvalTable[LCXBR] = &Simulator::Evaluate_LCXBR;
-  EvalTable[LEDBRA] = &Simulator::Evaluate_LEDBRA;
-  EvalTable[LDXBRA] = &Simulator::Evaluate_LDXBRA;
-  EvalTable[LEXBRA] = &Simulator::Evaluate_LEXBRA;
-  EvalTable[FIXBRA] = &Simulator::Evaluate_FIXBRA;
-  EvalTable[KXBR] = &Simulator::Evaluate_KXBR;
-  EvalTable[CXBR] = &Simulator::Evaluate_CXBR;
-  EvalTable[AXBR] = &Simulator::Evaluate_AXBR;
-  EvalTable[SXBR] = &Simulator::Evaluate_SXBR;
-  EvalTable[MXBR] = &Simulator::Evaluate_MXBR;
-  EvalTable[DXBR] = &Simulator::Evaluate_DXBR;
-  EvalTable[TBEDR] = &Simulator::Evaluate_TBEDR;
-  EvalTable[TBDR] = &Simulator::Evaluate_TBDR;
-  EvalTable[DIEBR] = &Simulator::Evaluate_DIEBR;
-  EvalTable[FIEBRA] = &Simulator::Evaluate_FIEBRA;
-  EvalTable[THDER] = &Simulator::Evaluate_THDER;
-  EvalTable[THDR] = &Simulator::Evaluate_THDR;
-  EvalTable[DIDBR] = &Simulator::Evaluate_DIDBR;
-  EvalTable[FIDBRA] = &Simulator::Evaluate_FIDBRA;
-  EvalTable[LXR] = &Simulator::Evaluate_LXR;
-  EvalTable[LPDFR] = &Simulator::Evaluate_LPDFR;
-  EvalTable[LNDFR] = &Simulator::Evaluate_LNDFR;
-  EvalTable[LCDFR] = &Simulator::Evaluate_LCDFR;
-  EvalTable[LZER] = &Simulator::Evaluate_LZER;
-  EvalTable[LZDR] = &Simulator::Evaluate_LZDR;
-  EvalTable[LZXR] = &Simulator::Evaluate_LZXR;
-  EvalTable[SFPC] = &Simulator::Evaluate_SFPC;
-  EvalTable[SFASR] = &Simulator::Evaluate_SFASR;
-  EvalTable[EFPC] = &Simulator::Evaluate_EFPC;
-  EvalTable[CELFBR] = &Simulator::Evaluate_CELFBR;
-  EvalTable[CDLFBR] = &Simulator::Evaluate_CDLFBR;
-  EvalTable[CXLFBR] = &Simulator::Evaluate_CXLFBR;
-  EvalTable[CEFBRA] = &Simulator::Evaluate_CEFBRA;
-  EvalTable[CDFBRA] = &Simulator::Evaluate_CDFBRA;
-  EvalTable[CXFBRA] = &Simulator::Evaluate_CXFBRA;
-  EvalTable[CFEBRA] = &Simulator::Evaluate_CFEBRA;
-  EvalTable[CFDBRA] = &Simulator::Evaluate_CFDBRA;
-  EvalTable[CFXBRA] = &Simulator::Evaluate_CFXBRA;
-  EvalTable[CLFEBR] = &Simulator::Evaluate_CLFEBR;
-  EvalTable[CLFDBR] = &Simulator::Evaluate_CLFDBR;
-  EvalTable[CLFXBR] = &Simulator::Evaluate_CLFXBR;
-  EvalTable[CELGBR] = &Simulator::Evaluate_CELGBR;
-  EvalTable[CDLGBR] = &Simulator::Evaluate_CDLGBR;
-  EvalTable[CXLGBR] = &Simulator::Evaluate_CXLGBR;
-  EvalTable[CEGBRA] = &Simulator::Evaluate_CEGBRA;
-  EvalTable[CDGBRA] = &Simulator::Evaluate_CDGBRA;
-  EvalTable[CXGBRA] = &Simulator::Evaluate_CXGBRA;
-  EvalTable[CGEBRA] = &Simulator::Evaluate_CGEBRA;
-  EvalTable[CGDBRA] = &Simulator::Evaluate_CGDBRA;
-  EvalTable[CGXBRA] = &Simulator::Evaluate_CGXBRA;
-  EvalTable[CLGEBR] = &Simulator::Evaluate_CLGEBR;
-  EvalTable[CLGDBR] = &Simulator::Evaluate_CLGDBR;
-  EvalTable[CFER] = &Simulator::Evaluate_CFER;
-  EvalTable[CFDR] = &Simulator::Evaluate_CFDR;
-  EvalTable[CFXR] = &Simulator::Evaluate_CFXR;
-  EvalTable[LDGR] = &Simulator::Evaluate_LDGR;
-  EvalTable[CGER] = &Simulator::Evaluate_CGER;
-  EvalTable[CGDR] = &Simulator::Evaluate_CGDR;
-  EvalTable[CGXR] = &Simulator::Evaluate_CGXR;
-  EvalTable[LGDR] = &Simulator::Evaluate_LGDR;
-  EvalTable[MDTR] = &Simulator::Evaluate_MDTR;
-  EvalTable[MDTRA] = &Simulator::Evaluate_MDTRA;
-  EvalTable[DDTRA] = &Simulator::Evaluate_DDTRA;
-  EvalTable[ADTRA] = &Simulator::Evaluate_ADTRA;
-  EvalTable[SDTRA] = &Simulator::Evaluate_SDTRA;
-  EvalTable[LDETR] = &Simulator::Evaluate_LDETR;
-  EvalTable[LEDTR] = &Simulator::Evaluate_LEDTR;
-  EvalTable[LTDTR] = &Simulator::Evaluate_LTDTR;
-  EvalTable[FIDTR] = &Simulator::Evaluate_FIDTR;
-  EvalTable[MXTRA] = &Simulator::Evaluate_MXTRA;
-  EvalTable[DXTRA] = &Simulator::Evaluate_DXTRA;
-  EvalTable[AXTRA] = &Simulator::Evaluate_AXTRA;
-  EvalTable[SXTRA] = &Simulator::Evaluate_SXTRA;
-  EvalTable[LXDTR] = &Simulator::Evaluate_LXDTR;
-  EvalTable[LDXTR] = &Simulator::Evaluate_LDXTR;
-  EvalTable[LTXTR] = &Simulator::Evaluate_LTXTR;
-  EvalTable[FIXTR] = &Simulator::Evaluate_FIXTR;
-  EvalTable[KDTR] = &Simulator::Evaluate_KDTR;
-  EvalTable[CGDTRA] = &Simulator::Evaluate_CGDTRA;
-  EvalTable[CUDTR] = &Simulator::Evaluate_CUDTR;
-  EvalTable[CDTR] = &Simulator::Evaluate_CDTR;
-  EvalTable[EEDTR] = &Simulator::Evaluate_EEDTR;
-  EvalTable[ESDTR] = &Simulator::Evaluate_ESDTR;
-  EvalTable[KXTR] = &Simulator::Evaluate_KXTR;
-  EvalTable[CGXTRA] = &Simulator::Evaluate_CGXTRA;
-  EvalTable[CUXTR] = &Simulator::Evaluate_CUXTR;
-  EvalTable[CSXTR] = &Simulator::Evaluate_CSXTR;
-  EvalTable[CXTR] = &Simulator::Evaluate_CXTR;
-  EvalTable[EEXTR] = &Simulator::Evaluate_EEXTR;
-  EvalTable[ESXTR] = &Simulator::Evaluate_ESXTR;
-  EvalTable[CDGTRA] = &Simulator::Evaluate_CDGTRA;
-  EvalTable[CDUTR] = &Simulator::Evaluate_CDUTR;
-  EvalTable[CDSTR] = &Simulator::Evaluate_CDSTR;
-  EvalTable[CEDTR] = &Simulator::Evaluate_CEDTR;
-  EvalTable[QADTR] = &Simulator::Evaluate_QADTR;
-  EvalTable[IEDTR] = &Simulator::Evaluate_IEDTR;
-  EvalTable[RRDTR] = &Simulator::Evaluate_RRDTR;
-  EvalTable[CXGTRA] = &Simulator::Evaluate_CXGTRA;
-  EvalTable[CXUTR] = &Simulator::Evaluate_CXUTR;
-  EvalTable[CXSTR] = &Simulator::Evaluate_CXSTR;
-  EvalTable[CEXTR] = &Simulator::Evaluate_CEXTR;
-  EvalTable[QAXTR] = &Simulator::Evaluate_QAXTR;
-  EvalTable[IEXTR] = &Simulator::Evaluate_IEXTR;
-  EvalTable[RRXTR] = &Simulator::Evaluate_RRXTR;
-  EvalTable[LPGR] = &Simulator::Evaluate_LPGR;
-  EvalTable[LNGR] = &Simulator::Evaluate_LNGR;
-  EvalTable[LTGR] = &Simulator::Evaluate_LTGR;
-  EvalTable[LCGR] = &Simulator::Evaluate_LCGR;
-  EvalTable[LGR] = &Simulator::Evaluate_LGR;
-  EvalTable[LGBR] = &Simulator::Evaluate_LGBR;
-  EvalTable[LGHR] = &Simulator::Evaluate_LGHR;
-  EvalTable[AGR] = &Simulator::Evaluate_AGR;
-  EvalTable[SGR] = &Simulator::Evaluate_SGR;
-  EvalTable[ALGR] = &Simulator::Evaluate_ALGR;
-  EvalTable[SLGR] = &Simulator::Evaluate_SLGR;
-  EvalTable[MSGR] = &Simulator::Evaluate_MSGR;
-  EvalTable[MSGRKC] = &Simulator::Evaluate_MSGRKC;
-  EvalTable[DSGR] = &Simulator::Evaluate_DSGR;
-  EvalTable[LRVGR] = &Simulator::Evaluate_LRVGR;
-  EvalTable[LPGFR] = &Simulator::Evaluate_LPGFR;
-  EvalTable[LNGFR] = &Simulator::Evaluate_LNGFR;
-  EvalTable[LTGFR] = &Simulator::Evaluate_LTGFR;
-  EvalTable[LCGFR] = &Simulator::Evaluate_LCGFR;
-  EvalTable[LGFR] = &Simulator::Evaluate_LGFR;
-  EvalTable[LLGFR] = &Simulator::Evaluate_LLGFR;
-  EvalTable[LLGTR] = &Simulator::Evaluate_LLGTR;
-  EvalTable[AGFR] = &Simulator::Evaluate_AGFR;
-  EvalTable[SGFR] = &Simulator::Evaluate_SGFR;
-  EvalTable[ALGFR] = &Simulator::Evaluate_ALGFR;
-  EvalTable[SLGFR] = &Simulator::Evaluate_SLGFR;
-  EvalTable[MSGFR] = &Simulator::Evaluate_MSGFR;
-  EvalTable[DSGFR] = &Simulator::Evaluate_DSGFR;
-  EvalTable[KMAC] = &Simulator::Evaluate_KMAC;
-  EvalTable[LRVR] = &Simulator::Evaluate_LRVR;
-  EvalTable[CGR] = &Simulator::Evaluate_CGR;
-  EvalTable[CLGR] = &Simulator::Evaluate_CLGR;
-  EvalTable[LBR] = &Simulator::Evaluate_LBR;
-  EvalTable[LHR] = &Simulator::Evaluate_LHR;
-  EvalTable[KMF] = &Simulator::Evaluate_KMF;
-  EvalTable[KMO] = &Simulator::Evaluate_KMO;
-  EvalTable[PCC] = &Simulator::Evaluate_PCC;
-  EvalTable[KMCTR] = &Simulator::Evaluate_KMCTR;
-  EvalTable[KM] = &Simulator::Evaluate_KM;
-  EvalTable[KMC] = &Simulator::Evaluate_KMC;
-  EvalTable[CGFR] = &Simulator::Evaluate_CGFR;
-  EvalTable[KIMD] = &Simulator::Evaluate_KIMD;
-  EvalTable[KLMD] = &Simulator::Evaluate_KLMD;
-  EvalTable[CFDTR] = &Simulator::Evaluate_CFDTR;
-  EvalTable[CLGDTR] = &Simulator::Evaluate_CLGDTR;
-  EvalTable[CLFDTR] = &Simulator::Evaluate_CLFDTR;
-  EvalTable[BCTGR] = &Simulator::Evaluate_BCTGR;
-  EvalTable[CFXTR] = &Simulator::Evaluate_CFXTR;
-  EvalTable[CLFXTR] = &Simulator::Evaluate_CLFXTR;
-  EvalTable[CDFTR] = &Simulator::Evaluate_CDFTR;
-  EvalTable[CDLGTR] = &Simulator::Evaluate_CDLGTR;
-  EvalTable[CDLFTR] = &Simulator::Evaluate_CDLFTR;
-  EvalTable[CXFTR] = &Simulator::Evaluate_CXFTR;
-  EvalTable[CXLGTR] = &Simulator::Evaluate_CXLGTR;
-  EvalTable[CXLFTR] = &Simulator::Evaluate_CXLFTR;
-  EvalTable[CGRT] = &Simulator::Evaluate_CGRT;
-  EvalTable[NGR] = &Simulator::Evaluate_NGR;
-  EvalTable[OGR] = &Simulator::Evaluate_OGR;
-  EvalTable[XGR] = &Simulator::Evaluate_XGR;
-  EvalTable[FLOGR] = &Simulator::Evaluate_FLOGR;
-  EvalTable[LLGCR] = &Simulator::Evaluate_LLGCR;
-  EvalTable[LLGHR] = &Simulator::Evaluate_LLGHR;
-  EvalTable[MLGR] = &Simulator::Evaluate_MLGR;
-  EvalTable[DLGR] = &Simulator::Evaluate_DLGR;
-  EvalTable[ALCGR] = &Simulator::Evaluate_ALCGR;
-  EvalTable[SLBGR] = &Simulator::Evaluate_SLBGR;
-  EvalTable[EPSW] = &Simulator::Evaluate_EPSW;
-  EvalTable[TRTT] = &Simulator::Evaluate_TRTT;
-  EvalTable[TRTO] = &Simulator::Evaluate_TRTO;
-  EvalTable[TROT] = &Simulator::Evaluate_TROT;
-  EvalTable[TROO] = &Simulator::Evaluate_TROO;
-  EvalTable[LLCR] = &Simulator::Evaluate_LLCR;
-  EvalTable[LLHR] = &Simulator::Evaluate_LLHR;
-  EvalTable[MLR] = &Simulator::Evaluate_MLR;
-  EvalTable[DLR] = &Simulator::Evaluate_DLR;
-  EvalTable[ALCR] = &Simulator::Evaluate_ALCR;
-  EvalTable[SLBR] = &Simulator::Evaluate_SLBR;
-  EvalTable[CU14] = &Simulator::Evaluate_CU14;
-  EvalTable[CU24] = &Simulator::Evaluate_CU24;
-  EvalTable[CU41] = &Simulator::Evaluate_CU41;
-  EvalTable[CU42] = &Simulator::Evaluate_CU42;
-  EvalTable[TRTRE] = &Simulator::Evaluate_TRTRE;
-  EvalTable[SRSTU] = &Simulator::Evaluate_SRSTU;
-  EvalTable[TRTE] = &Simulator::Evaluate_TRTE;
-  EvalTable[AHHHR] = &Simulator::Evaluate_AHHHR;
-  EvalTable[SHHHR] = &Simulator::Evaluate_SHHHR;
-  EvalTable[ALHHHR] = &Simulator::Evaluate_ALHHHR;
-  EvalTable[SLHHHR] = &Simulator::Evaluate_SLHHHR;
-  EvalTable[CHHR] = &Simulator::Evaluate_CHHR;
-  EvalTable[AHHLR] = &Simulator::Evaluate_AHHLR;
-  EvalTable[SHHLR] = &Simulator::Evaluate_SHHLR;
-  EvalTable[ALHHLR] = &Simulator::Evaluate_ALHHLR;
-  EvalTable[SLHHLR] = &Simulator::Evaluate_SLHHLR;
-  EvalTable[CHLR] = &Simulator::Evaluate_CHLR;
-  EvalTable[POPCNT_Z] = &Simulator::Evaluate_POPCNT_Z;
-  EvalTable[LOCGR] = &Simulator::Evaluate_LOCGR;
-  EvalTable[NGRK] = &Simulator::Evaluate_NGRK;
-  EvalTable[OGRK] = &Simulator::Evaluate_OGRK;
-  EvalTable[XGRK] = &Simulator::Evaluate_XGRK;
-  EvalTable[AGRK] = &Simulator::Evaluate_AGRK;
-  EvalTable[SGRK] = &Simulator::Evaluate_SGRK;
-  EvalTable[ALGRK] = &Simulator::Evaluate_ALGRK;
-  EvalTable[SLGRK] = &Simulator::Evaluate_SLGRK;
-  EvalTable[LOCR] = &Simulator::Evaluate_LOCR;
-  EvalTable[NRK] = &Simulator::Evaluate_NRK;
-  EvalTable[ORK] = &Simulator::Evaluate_ORK;
-  EvalTable[XRK] = &Simulator::Evaluate_XRK;
-  EvalTable[ARK] = &Simulator::Evaluate_ARK;
-  EvalTable[SRK] = &Simulator::Evaluate_SRK;
-  EvalTable[ALRK] = &Simulator::Evaluate_ALRK;
-  EvalTable[SLRK] = &Simulator::Evaluate_SLRK;
-  EvalTable[LTG] = &Simulator::Evaluate_LTG;
-  EvalTable[LG] = &Simulator::Evaluate_LG;
-  EvalTable[CVBY] = &Simulator::Evaluate_CVBY;
-  EvalTable[AG] = &Simulator::Evaluate_AG;
-  EvalTable[SG] = &Simulator::Evaluate_SG;
-  EvalTable[ALG] = &Simulator::Evaluate_ALG;
-  EvalTable[SLG] = &Simulator::Evaluate_SLG;
-  EvalTable[MSG] = &Simulator::Evaluate_MSG;
-  EvalTable[DSG] = &Simulator::Evaluate_DSG;
-  EvalTable[CVBG] = &Simulator::Evaluate_CVBG;
-  EvalTable[LRVG] = &Simulator::Evaluate_LRVG;
-  EvalTable[LT] = &Simulator::Evaluate_LT;
-  EvalTable[LGF] = &Simulator::Evaluate_LGF;
-  EvalTable[LGH] = &Simulator::Evaluate_LGH;
-  EvalTable[LLGF] = &Simulator::Evaluate_LLGF;
-  EvalTable[LLGT] = &Simulator::Evaluate_LLGT;
-  EvalTable[AGF] = &Simulator::Evaluate_AGF;
-  EvalTable[SGF] = &Simulator::Evaluate_SGF;
-  EvalTable[ALGF] = &Simulator::Evaluate_ALGF;
-  EvalTable[SLGF] = &Simulator::Evaluate_SLGF;
-  EvalTable[MSGF] = &Simulator::Evaluate_MSGF;
-  EvalTable[DSGF] = &Simulator::Evaluate_DSGF;
-  EvalTable[LRV] = &Simulator::Evaluate_LRV;
-  EvalTable[LRVH] = &Simulator::Evaluate_LRVH;
-  EvalTable[CG] = &Simulator::Evaluate_CG;
-  EvalTable[CLG] = &Simulator::Evaluate_CLG;
-  EvalTable[STG] = &Simulator::Evaluate_STG;
-  EvalTable[NTSTG] = &Simulator::Evaluate_NTSTG;
-  EvalTable[CVDY] = &Simulator::Evaluate_CVDY;
-  EvalTable[CVDG] = &Simulator::Evaluate_CVDG;
-  EvalTable[STRVG] = &Simulator::Evaluate_STRVG;
-  EvalTable[CGF] = &Simulator::Evaluate_CGF;
-  EvalTable[CLGF] = &Simulator::Evaluate_CLGF;
-  EvalTable[LTGF] = &Simulator::Evaluate_LTGF;
-  EvalTable[CGH] = &Simulator::Evaluate_CGH;
-  EvalTable[PFD] = &Simulator::Evaluate_PFD;
-  EvalTable[STRV] = &Simulator::Evaluate_STRV;
-  EvalTable[STRVH] = &Simulator::Evaluate_STRVH;
-  EvalTable[BCTG] = &Simulator::Evaluate_BCTG;
-  EvalTable[STY] = &Simulator::Evaluate_STY;
-  EvalTable[MSY] = &Simulator::Evaluate_MSY;
-  EvalTable[MSC] = &Simulator::Evaluate_MSC;
-  EvalTable[NY] = &Simulator::Evaluate_NY;
-  EvalTable[CLY] = &Simulator::Evaluate_CLY;
-  EvalTable[OY] = &Simulator::Evaluate_OY;
-  EvalTable[XY] = &Simulator::Evaluate_XY;
-  EvalTable[LY] = &Simulator::Evaluate_LY;
-  EvalTable[CY] = &Simulator::Evaluate_CY;
-  EvalTable[AY] = &Simulator::Evaluate_AY;
-  EvalTable[SY] = &Simulator::Evaluate_SY;
-  EvalTable[MFY] = &Simulator::Evaluate_MFY;
-  EvalTable[ALY] = &Simulator::Evaluate_ALY;
-  EvalTable[SLY] = &Simulator::Evaluate_SLY;
-  EvalTable[STHY] = &Simulator::Evaluate_STHY;
-  EvalTable[LAY] = &Simulator::Evaluate_LAY;
-  EvalTable[STCY] = &Simulator::Evaluate_STCY;
-  EvalTable[ICY] = &Simulator::Evaluate_ICY;
-  EvalTable[LAEY] = &Simulator::Evaluate_LAEY;
-  EvalTable[LB] = &Simulator::Evaluate_LB;
-  EvalTable[LGB] = &Simulator::Evaluate_LGB;
-  EvalTable[LHY] = &Simulator::Evaluate_LHY;
-  EvalTable[CHY] = &Simulator::Evaluate_CHY;
-  EvalTable[AHY] = &Simulator::Evaluate_AHY;
-  EvalTable[SHY] = &Simulator::Evaluate_SHY;
-  EvalTable[MHY] = &Simulator::Evaluate_MHY;
-  EvalTable[NG] = &Simulator::Evaluate_NG;
-  EvalTable[OG] = &Simulator::Evaluate_OG;
-  EvalTable[XG] = &Simulator::Evaluate_XG;
-  EvalTable[LGAT] = &Simulator::Evaluate_LGAT;
-  EvalTable[MLG] = &Simulator::Evaluate_MLG;
-  EvalTable[DLG] = &Simulator::Evaluate_DLG;
-  EvalTable[ALCG] = &Simulator::Evaluate_ALCG;
-  EvalTable[SLBG] = &Simulator::Evaluate_SLBG;
-  EvalTable[STPQ] = &Simulator::Evaluate_STPQ;
-  EvalTable[LPQ] = &Simulator::Evaluate_LPQ;
-  EvalTable[LLGC] = &Simulator::Evaluate_LLGC;
-  EvalTable[LLGH] = &Simulator::Evaluate_LLGH;
-  EvalTable[LLC] = &Simulator::Evaluate_LLC;
-  EvalTable[LLH] = &Simulator::Evaluate_LLH;
-  EvalTable[ML] = &Simulator::Evaluate_ML;
-  EvalTable[DL] = &Simulator::Evaluate_DL;
-  EvalTable[ALC] = &Simulator::Evaluate_ALC;
-  EvalTable[SLB] = &Simulator::Evaluate_SLB;
-  EvalTable[LLGTAT] = &Simulator::Evaluate_LLGTAT;
-  EvalTable[LLGFAT] = &Simulator::Evaluate_LLGFAT;
-  EvalTable[LAT] = &Simulator::Evaluate_LAT;
-  EvalTable[LBH] = &Simulator::Evaluate_LBH;
-  EvalTable[LLCH] = &Simulator::Evaluate_LLCH;
-  EvalTable[STCH] = &Simulator::Evaluate_STCH;
-  EvalTable[LHH] = &Simulator::Evaluate_LHH;
-  EvalTable[LLHH] = &Simulator::Evaluate_LLHH;
-  EvalTable[STHH] = &Simulator::Evaluate_STHH;
-  EvalTable[LFHAT] = &Simulator::Evaluate_LFHAT;
-  EvalTable[LFH] = &Simulator::Evaluate_LFH;
-  EvalTable[STFH] = &Simulator::Evaluate_STFH;
-  EvalTable[CHF] = &Simulator::Evaluate_CHF;
-  EvalTable[MVCDK] = &Simulator::Evaluate_MVCDK;
-  EvalTable[MVHHI] = &Simulator::Evaluate_MVHHI;
-  EvalTable[MVGHI] = &Simulator::Evaluate_MVGHI;
-  EvalTable[MVHI] = &Simulator::Evaluate_MVHI;
-  EvalTable[CHHSI] = &Simulator::Evaluate_CHHSI;
-  EvalTable[CGHSI] = &Simulator::Evaluate_CGHSI;
-  EvalTable[CHSI] = &Simulator::Evaluate_CHSI;
-  EvalTable[CLFHSI] = &Simulator::Evaluate_CLFHSI;
-  EvalTable[TBEGIN] = &Simulator::Evaluate_TBEGIN;
-  EvalTable[TBEGINC] = &Simulator::Evaluate_TBEGINC;
-  EvalTable[LMG] = &Simulator::Evaluate_LMG;
-  EvalTable[SRAG] = &Simulator::Evaluate_SRAG;
-  EvalTable[SLAG] = &Simulator::Evaluate_SLAG;
-  EvalTable[SRLG] = &Simulator::Evaluate_SRLG;
-  EvalTable[SLLG] = &Simulator::Evaluate_SLLG;
-  EvalTable[CSY] = &Simulator::Evaluate_CSY;
-  EvalTable[RLLG] = &Simulator::Evaluate_RLLG;
-  EvalTable[RLL] = &Simulator::Evaluate_RLL;
-  EvalTable[STMG] = &Simulator::Evaluate_STMG;
-  EvalTable[STMH] = &Simulator::Evaluate_STMH;
-  EvalTable[STCMH] = &Simulator::Evaluate_STCMH;
-  EvalTable[STCMY] = &Simulator::Evaluate_STCMY;
-  EvalTable[CDSY] = &Simulator::Evaluate_CDSY;
-  EvalTable[CDSG] = &Simulator::Evaluate_CDSG;
-  EvalTable[BXHG] = &Simulator::Evaluate_BXHG;
-  EvalTable[BXLEG] = &Simulator::Evaluate_BXLEG;
-  EvalTable[ECAG] = &Simulator::Evaluate_ECAG;
-  EvalTable[TMY] = &Simulator::Evaluate_TMY;
-  EvalTable[MVIY] = &Simulator::Evaluate_MVIY;
-  EvalTable[NIY] = &Simulator::Evaluate_NIY;
-  EvalTable[CLIY] = &Simulator::Evaluate_CLIY;
-  EvalTable[OIY] = &Simulator::Evaluate_OIY;
-  EvalTable[XIY] = &Simulator::Evaluate_XIY;
-  EvalTable[ASI] = &Simulator::Evaluate_ASI;
-  EvalTable[ALSI] = &Simulator::Evaluate_ALSI;
-  EvalTable[AGSI] = &Simulator::Evaluate_AGSI;
-  EvalTable[ALGSI] = &Simulator::Evaluate_ALGSI;
-  EvalTable[ICMH] = &Simulator::Evaluate_ICMH;
-  EvalTable[ICMY] = &Simulator::Evaluate_ICMY;
-  EvalTable[MVCLU] = &Simulator::Evaluate_MVCLU;
-  EvalTable[CLCLU] = &Simulator::Evaluate_CLCLU;
-  EvalTable[STMY] = &Simulator::Evaluate_STMY;
-  EvalTable[LMH] = &Simulator::Evaluate_LMH;
-  EvalTable[LMY] = &Simulator::Evaluate_LMY;
-  EvalTable[TP] = &Simulator::Evaluate_TP;
-  EvalTable[SRAK] = &Simulator::Evaluate_SRAK;
-  EvalTable[SLAK] = &Simulator::Evaluate_SLAK;
-  EvalTable[SRLK] = &Simulator::Evaluate_SRLK;
-  EvalTable[SLLK] = &Simulator::Evaluate_SLLK;
-  EvalTable[LOCG] = &Simulator::Evaluate_LOCG;
-  EvalTable[STOCG] = &Simulator::Evaluate_STOCG;
-  EvalTable[LANG] = &Simulator::Evaluate_LANG;
-  EvalTable[LAOG] = &Simulator::Evaluate_LAOG;
-  EvalTable[LAXG] = &Simulator::Evaluate_LAXG;
-  EvalTable[LAAG] = &Simulator::Evaluate_LAAG;
-  EvalTable[LAALG] = &Simulator::Evaluate_LAALG;
-  EvalTable[LOC] = &Simulator::Evaluate_LOC;
-  EvalTable[STOC] = &Simulator::Evaluate_STOC;
-  EvalTable[LAN] = &Simulator::Evaluate_LAN;
-  EvalTable[LAO] = &Simulator::Evaluate_LAO;
-  EvalTable[LAX] = &Simulator::Evaluate_LAX;
-  EvalTable[LAA] = &Simulator::Evaluate_LAA;
-  EvalTable[LAAL] = &Simulator::Evaluate_LAAL;
-  EvalTable[BRXHG] = &Simulator::Evaluate_BRXHG;
-  EvalTable[BRXLG] = &Simulator::Evaluate_BRXLG;
-  EvalTable[RISBLG] = &Simulator::Evaluate_RISBLG;
-  EvalTable[RNSBG] = &Simulator::Evaluate_RNSBG;
-  EvalTable[RISBG] = &Simulator::Evaluate_RISBG;
-  EvalTable[ROSBG] = &Simulator::Evaluate_ROSBG;
-  EvalTable[RXSBG] = &Simulator::Evaluate_RXSBG;
-  EvalTable[RISBGN] = &Simulator::Evaluate_RISBGN;
-  EvalTable[RISBHG] = &Simulator::Evaluate_RISBHG;
-  EvalTable[CGRJ] = &Simulator::Evaluate_CGRJ;
-  EvalTable[CGIT] = &Simulator::Evaluate_CGIT;
-  EvalTable[CIT] = &Simulator::Evaluate_CIT;
-  EvalTable[CLFIT] = &Simulator::Evaluate_CLFIT;
-  EvalTable[CGIJ] = &Simulator::Evaluate_CGIJ;
-  EvalTable[CIJ] = &Simulator::Evaluate_CIJ;
-  EvalTable[AHIK] = &Simulator::Evaluate_AHIK;
-  EvalTable[AGHIK] = &Simulator::Evaluate_AGHIK;
-  EvalTable[ALHSIK] = &Simulator::Evaluate_ALHSIK;
-  EvalTable[ALGHSIK] = &Simulator::Evaluate_ALGHSIK;
-  EvalTable[CGRB] = &Simulator::Evaluate_CGRB;
-  EvalTable[CGIB] = &Simulator::Evaluate_CGIB;
-  EvalTable[CIB] = &Simulator::Evaluate_CIB;
-  EvalTable[LDEB] = &Simulator::Evaluate_LDEB;
-  EvalTable[LXDB] = &Simulator::Evaluate_LXDB;
-  EvalTable[LXEB] = &Simulator::Evaluate_LXEB;
-  EvalTable[MXDB] = &Simulator::Evaluate_MXDB;
-  EvalTable[KEB] = &Simulator::Evaluate_KEB;
-  EvalTable[CEB] = &Simulator::Evaluate_CEB;
-  EvalTable[AEB] = &Simulator::Evaluate_AEB;
-  EvalTable[SEB] = &Simulator::Evaluate_SEB;
-  EvalTable[MDEB] = &Simulator::Evaluate_MDEB;
-  EvalTable[DEB] = &Simulator::Evaluate_DEB;
-  EvalTable[MAEB] = &Simulator::Evaluate_MAEB;
-  EvalTable[MSEB] = &Simulator::Evaluate_MSEB;
-  EvalTable[TCEB] = &Simulator::Evaluate_TCEB;
-  EvalTable[TCDB] = &Simulator::Evaluate_TCDB;
-  EvalTable[TCXB] = &Simulator::Evaluate_TCXB;
-  EvalTable[SQEB] = &Simulator::Evaluate_SQEB;
-  EvalTable[SQDB] = &Simulator::Evaluate_SQDB;
-  EvalTable[MEEB] = &Simulator::Evaluate_MEEB;
-  EvalTable[KDB] = &Simulator::Evaluate_KDB;
-  EvalTable[CDB] = &Simulator::Evaluate_CDB;
-  EvalTable[ADB] = &Simulator::Evaluate_ADB;
-  EvalTable[SDB] = &Simulator::Evaluate_SDB;
-  EvalTable[MDB] = &Simulator::Evaluate_MDB;
-  EvalTable[DDB] = &Simulator::Evaluate_DDB;
-  EvalTable[MADB] = &Simulator::Evaluate_MADB;
-  EvalTable[MSDB] = &Simulator::Evaluate_MSDB;
-  EvalTable[SLDT] = &Simulator::Evaluate_SLDT;
-  EvalTable[SRDT] = &Simulator::Evaluate_SRDT;
-  EvalTable[SLXT] = &Simulator::Evaluate_SLXT;
-  EvalTable[SRXT] = &Simulator::Evaluate_SRXT;
-  EvalTable[TDCET] = &Simulator::Evaluate_TDCET;
-  EvalTable[TDGET] = &Simulator::Evaluate_TDGET;
-  EvalTable[TDCDT] = &Simulator::Evaluate_TDCDT;
-  EvalTable[TDGDT] = &Simulator::Evaluate_TDGDT;
-  EvalTable[TDCXT] = &Simulator::Evaluate_TDCXT;
-  EvalTable[TDGXT] = &Simulator::Evaluate_TDGXT;
-  EvalTable[LEY] = &Simulator::Evaluate_LEY;
-  EvalTable[LDY] = &Simulator::Evaluate_LDY;
-  EvalTable[STEY] = &Simulator::Evaluate_STEY;
-  EvalTable[STDY] = &Simulator::Evaluate_STDY;
-  EvalTable[CZDT] = &Simulator::Evaluate_CZDT;
-  EvalTable[CZXT] = &Simulator::Evaluate_CZXT;
-  EvalTable[CDZT] = &Simulator::Evaluate_CDZT;
-  EvalTable[CXZT] = &Simulator::Evaluate_CXZT;
-}  // NOLINT
-
-Simulator::Simulator(Isolate* isolate) : isolate_(isolate) {
-  i_cache_ = isolate_->simulator_i_cache();
-  if (i_cache_ == nullptr) {
-    i_cache_ = new base::CustomMatcherHashMap(&ICacheMatch);
-    isolate_->set_simulator_i_cache(i_cache_);
-  }
-  static base::OnceType once = V8_ONCE_INIT;
-  base::CallOnce(&once, &Simulator::EvalTableInit);
-// Set up simulator support first. Some of this information is needed to
-// setup the architecture state.
-#if V8_TARGET_ARCH_S390X
-  size_t stack_size = FLAG_sim_stack_size * KB;
-#else
-  size_t stack_size = MB;  // allocate 1MB for stack
-#endif
-  stack_size += 2 * stack_protection_size_;
-  stack_ = reinterpret_cast<char*>(malloc(stack_size));
-  pc_modified_ = false;
-  icount_ = 0;
-  break_pc_ = nullptr;
-  break_instr_ = 0;
-
-// make sure our register type can hold exactly 4/8 bytes
-#ifdef V8_TARGET_ARCH_S390X
-  DCHECK_EQ(sizeof(intptr_t), 8);
-#else
-  DCHECK_EQ(sizeof(intptr_t), 4);
-#endif
-  // Set up architecture state.
-  // All registers are initialized to zero to start with.
-  for (int i = 0; i < kNumGPRs; i++) {
-    registers_[i] = 0;
-  }
-  condition_reg_ = 0;
-  special_reg_pc_ = 0;
-
-  // Initializing FP registers.
-  for (int i = 0; i < kNumFPRs; i++) {
-    fp_registers_[i] = 0.0;
-  }
-
-  // The sp is initialized to point to the bottom (high address) of the
-  // allocated stack area. To be safe in potential stack underflows we leave
-  // some buffer below.
-  registers_[sp] =
-      reinterpret_cast<intptr_t>(stack_) + stack_size - stack_protection_size_;
-
-  last_debugger_input_ = nullptr;
-}
-
-Simulator::~Simulator() { free(stack_); }
-
-// Get the active Simulator for the current thread.
-Simulator* Simulator::current(Isolate* isolate) {
-  v8::internal::Isolate::PerIsolateThreadData* isolate_data =
-      isolate->FindOrAllocatePerThreadDataForThisThread();
-  DCHECK_NOT_NULL(isolate_data);
-
-  Simulator* sim = isolate_data->simulator();
-  if (sim == nullptr) {
-    // TODO(146): delete the simulator object when a thread/isolate goes away.
-    sim = new Simulator(isolate);
-    isolate_data->set_simulator(sim);
-  }
-  return sim;
-}
-
-// Sets the register in the architecture state.
-void Simulator::set_register(int reg, uint64_t value) {
-  DCHECK((reg >= 0) && (reg < kNumGPRs));
-  registers_[reg] = value;
-}
-
-// Get the register from the architecture state.
-uint64_t Simulator::get_register(int reg) const {
-  DCHECK((reg >= 0) && (reg < kNumGPRs));
-  // Stupid code added to avoid bug in GCC.
-  // See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43949
-  if (reg >= kNumGPRs) return 0;
-  // End stupid code.
-  return registers_[reg];
-}
-
-template <typename T>
-T Simulator::get_low_register(int reg) const {
-  DCHECK((reg >= 0) && (reg < kNumGPRs));
-  // Stupid code added to avoid bug in GCC.
-  // See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43949
-  if (reg >= kNumGPRs) return 0;
-  // End stupid code.
-  return static_cast<T>(registers_[reg] & 0xFFFFFFFF);
-}
-
-template <typename T>
-T Simulator::get_high_register(int reg) const {
-  DCHECK((reg >= 0) && (reg < kNumGPRs));
-  // Stupid code added to avoid bug in GCC.
-  // See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43949
-  if (reg >= kNumGPRs) return 0;
-  // End stupid code.
-  return static_cast<T>(registers_[reg] >> 32);
-}
-
-void Simulator::set_low_register(int reg, uint32_t value) {
-  uint64_t shifted_val = static_cast<uint64_t>(value);
-  uint64_t orig_val = static_cast<uint64_t>(registers_[reg]);
-  uint64_t result = (orig_val >> 32 << 32) | shifted_val;
-  registers_[reg] = result;
-}
-
-void Simulator::set_high_register(int reg, uint32_t value) {
-  uint64_t shifted_val = static_cast<uint64_t>(value) << 32;
-  uint64_t orig_val = static_cast<uint64_t>(registers_[reg]);
-  uint64_t result = (orig_val & 0xFFFFFFFF) | shifted_val;
-  registers_[reg] = result;
-}
-
-double Simulator::get_double_from_register_pair(int reg) {
-  DCHECK((reg >= 0) && (reg < kNumGPRs) && ((reg % 2) == 0));
-
-  double dm_val = 0.0;
-#if 0 && !V8_TARGET_ARCH_S390X  // doesn't make sense in 64bit mode
-  // Read the bits from the unsigned integer register_[] array
-  // into the double precision floating point value and return it.
-  char buffer[sizeof(fp_registers_[0])];
-  memcpy(buffer, &registers_[reg], 2 * sizeof(registers_[0]));
-  memcpy(&dm_val, buffer, 2 * sizeof(registers_[0]));
-#endif
-  return (dm_val);
-}
-
-// Raw access to the PC register.
-void Simulator::set_pc(intptr_t value) {
-  pc_modified_ = true;
-  special_reg_pc_ = value;
-}
-
-bool Simulator::has_bad_pc() const {
-  return ((special_reg_pc_ == bad_lr) || (special_reg_pc_ == end_sim_pc));
-}
-
-// Raw access to the PC register without the special adjustment when reading.
-intptr_t Simulator::get_pc() const { return special_reg_pc_; }
-
-// Runtime FP routines take:
-// - two double arguments
-// - one double argument and zero or one integer arguments.
-// All are consructed here from d1, d2 and r2.
-void Simulator::GetFpArgs(double* x, double* y, intptr_t* z) {
-  *x = get_double_from_d_register(0);
-  *y = get_double_from_d_register(2);
-  *z = get_register(2);
-}
-
-// The return value is in d0.
-void Simulator::SetFpResult(const double& result) {
-  set_d_register_from_double(0, result);
-}
-
-void Simulator::TrashCallerSaveRegisters() {
-// We don't trash the registers with the return value.
-#if 0  // A good idea to trash volatile registers, needs to be done
-  registers_[2] = 0x50BAD4U;
-  registers_[3] = 0x50BAD4U;
-  registers_[12] = 0x50BAD4U;
-#endif
-}
-
-uint32_t Simulator::ReadWU(intptr_t addr, Instruction* instr) {
-  uint32_t* ptr = reinterpret_cast<uint32_t*>(addr);
-  return *ptr;
-}
-
-int64_t Simulator::ReadW64(intptr_t addr, Instruction* instr) {
-  int64_t* ptr = reinterpret_cast<int64_t*>(addr);
-  return *ptr;
-}
-
-int32_t Simulator::ReadW(intptr_t addr, Instruction* instr) {
-  int32_t* ptr = reinterpret_cast<int32_t*>(addr);
-  return *ptr;
-}
-
-void Simulator::WriteW(intptr_t addr, uint32_t value, Instruction* instr) {
-  uint32_t* ptr = reinterpret_cast<uint32_t*>(addr);
-  *ptr = value;
-  return;
-}
-
-void Simulator::WriteW(intptr_t addr, int32_t value, Instruction* instr) {
-  int32_t* ptr = reinterpret_cast<int32_t*>(addr);
-  *ptr = value;
-  return;
-}
-
-uint16_t Simulator::ReadHU(intptr_t addr, Instruction* instr) {
-  uint16_t* ptr = reinterpret_cast<uint16_t*>(addr);
-  return *ptr;
-}
-
-int16_t Simulator::ReadH(intptr_t addr, Instruction* instr) {
-  int16_t* ptr = reinterpret_cast<int16_t*>(addr);
-  return *ptr;
-}
-
-void Simulator::WriteH(intptr_t addr, uint16_t value, Instruction* instr) {
-  uint16_t* ptr = reinterpret_cast<uint16_t*>(addr);
-  *ptr = value;
-  return;
-}
-
-void Simulator::WriteH(intptr_t addr, int16_t value, Instruction* instr) {
-  int16_t* ptr = reinterpret_cast<int16_t*>(addr);
-  *ptr = value;
-  return;
-}
-
-uint8_t Simulator::ReadBU(intptr_t addr) {
-  uint8_t* ptr = reinterpret_cast<uint8_t*>(addr);
-  return *ptr;
-}
-
-int8_t Simulator::ReadB(intptr_t addr) {
-  int8_t* ptr = reinterpret_cast<int8_t*>(addr);
-  return *ptr;
-}
-
-void Simulator::WriteB(intptr_t addr, uint8_t value) {
-  uint8_t* ptr = reinterpret_cast<uint8_t*>(addr);
-  *ptr = value;
-}
-
-void Simulator::WriteB(intptr_t addr, int8_t value) {
-  int8_t* ptr = reinterpret_cast<int8_t*>(addr);
-  *ptr = value;
-}
-
-int64_t Simulator::ReadDW(intptr_t addr) {
-  int64_t* ptr = reinterpret_cast<int64_t*>(addr);
-  return *ptr;
-}
-
-void Simulator::WriteDW(intptr_t addr, int64_t value) {
-  int64_t* ptr = reinterpret_cast<int64_t*>(addr);
-  *ptr = value;
-  return;
-}
-
-/**
- * Reads a double value from memory at given address.
- */
-double Simulator::ReadDouble(intptr_t addr) {
-  double* ptr = reinterpret_cast<double*>(addr);
-  return *ptr;
-}
-
-float Simulator::ReadFloat(intptr_t addr) {
-  float* ptr = reinterpret_cast<float*>(addr);
-  return *ptr;
-}
-
-// Returns the limit of the stack area to enable checking for stack overflows.
-uintptr_t Simulator::StackLimit(uintptr_t c_limit) const {
-  // The simulator uses a separate JS stack. If we have exhausted the C stack,
-  // we also drop down the JS limit to reflect the exhaustion on the JS stack.
-  if (GetCurrentStackPosition() < c_limit) {
-    return reinterpret_cast<uintptr_t>(get_sp());
-  }
-
-  // Otherwise the limit is the JS stack. Leave a safety margin to prevent
-  // overrunning the stack when pushing values.
-  return reinterpret_cast<uintptr_t>(stack_) + stack_protection_size_;
-}
-
-// Unsupported instructions use Format to print an error and stop execution.
-void Simulator::Format(Instruction* instr, const char* format) {
-  PrintF("Simulator found unsupported instruction:\n 0x%08" V8PRIxPTR ": %s\n",
-         reinterpret_cast<intptr_t>(instr), format);
-  UNIMPLEMENTED();
-}
-
-// Calculate C flag value for additions.
-bool Simulator::CarryFrom(int32_t left, int32_t right, int32_t carry) {
-  uint32_t uleft = static_cast<uint32_t>(left);
-  uint32_t uright = static_cast<uint32_t>(right);
-  uint32_t urest = 0xFFFFFFFFU - uleft;
-
-  return (uright > urest) ||
-         (carry && (((uright + 1) > urest) || (uright > (urest - 1))));
-}
-
-// Calculate C flag value for subtractions.
-bool Simulator::BorrowFrom(int32_t left, int32_t right) {
-  uint32_t uleft = static_cast<uint32_t>(left);
-  uint32_t uright = static_cast<uint32_t>(right);
-
-  return (uright > uleft);
-}
-
-// Calculate V flag value for additions and subtractions.
-template <typename T1>
-bool Simulator::OverflowFromSigned(T1 alu_out, T1 left, T1 right,
-                                   bool addition) {
-  bool overflow;
-  if (addition) {
-    // operands have the same sign
-    overflow = ((left >= 0 && right >= 0) || (left < 0 && right < 0))
-               // and operands and result have different sign
-               && ((left < 0 && alu_out >= 0) || (left >= 0 && alu_out < 0));
-  } else {
-    // operands have different signs
-    overflow = ((left < 0 && right >= 0) || (left >= 0 && right < 0))
-               // and first operand and result have different signs
-               && ((left < 0 && alu_out >= 0) || (left >= 0 && alu_out < 0));
-  }
-  return overflow;
-}
-
-#if V8_TARGET_ARCH_S390X
-static void decodeObjectPair(ObjectPair* pair, intptr_t* x, intptr_t* y) {
-  *x = reinterpret_cast<intptr_t>(pair->x);
-  *y = reinterpret_cast<intptr_t>(pair->y);
-}
-#else
-static void decodeObjectPair(ObjectPair* pair, intptr_t* x, intptr_t* y) {
-#if V8_TARGET_BIG_ENDIAN
-  *x = static_cast<int32_t>(*pair >> 32);
-  *y = static_cast<int32_t>(*pair);
-#else
-  *x = static_cast<int32_t>(*pair);
-  *y = static_cast<int32_t>(*pair >> 32);
-#endif
-}
-#endif
-
-// Calls into the V8 runtime.
-typedef intptr_t (*SimulatorRuntimeCall)(intptr_t arg0, intptr_t arg1,
-                                         intptr_t arg2, intptr_t arg3,
-                                         intptr_t arg4, intptr_t arg5,
-                                         intptr_t arg6, intptr_t arg7,
-                                         intptr_t arg8);
-typedef ObjectPair (*SimulatorRuntimePairCall)(intptr_t arg0, intptr_t arg1,
-                                               intptr_t arg2, intptr_t arg3,
-                                               intptr_t arg4, intptr_t arg5);
-
-// These prototypes handle the four types of FP calls.
-typedef int (*SimulatorRuntimeCompareCall)(double darg0, double darg1);
-typedef double (*SimulatorRuntimeFPFPCall)(double darg0, double darg1);
-typedef double (*SimulatorRuntimeFPCall)(double darg0);
-typedef double (*SimulatorRuntimeFPIntCall)(double darg0, intptr_t arg0);
-
-// This signature supports direct call in to API function native callback
-// (refer to InvocationCallback in v8.h).
-typedef void (*SimulatorRuntimeDirectApiCall)(intptr_t arg0);
-typedef void (*SimulatorRuntimeProfilingApiCall)(intptr_t arg0, void* arg1);
-
-// This signature supports direct call to accessor getter callback.
-typedef void (*SimulatorRuntimeDirectGetterCall)(intptr_t arg0, intptr_t arg1);
-typedef void (*SimulatorRuntimeProfilingGetterCall)(intptr_t arg0,
-                                                    intptr_t arg1, void* arg2);
-
-// Software interrupt instructions are used by the simulator to call into the
-// C-based V8 runtime.
-void Simulator::SoftwareInterrupt(Instruction* instr) {
-  int svc = instr->SvcValue();
-  switch (svc) {
-    case kCallRtRedirected: {
-      // Check if stack is aligned. Error if not aligned is reported below to
-      // include information on the function called.
-      bool stack_aligned =
-          (get_register(sp) & (::v8::internal::FLAG_sim_stack_alignment - 1)) ==
-          0;
-      Redirection* redirection = Redirection::FromInstruction(instr);
-      const int kArgCount = 9;
-      const int kRegisterArgCount = 5;
-      int arg0_regnum = 2;
-      intptr_t result_buffer = 0;
-      bool uses_result_buffer =
-          redirection->type() == ExternalReference::BUILTIN_CALL_PAIR &&
-          !ABI_RETURNS_OBJECTPAIR_IN_REGS;
-      if (uses_result_buffer) {
-        result_buffer = get_register(r2);
-        arg0_regnum++;
-      }
-      intptr_t arg[kArgCount];
-      // First 5 arguments in registers r2-r6.
-      for (int i = 0; i < kRegisterArgCount; i++) {
-        arg[i] = get_register(arg0_regnum + i);
-      }
-      // Remaining arguments on stack
-      intptr_t* stack_pointer = reinterpret_cast<intptr_t*>(get_register(sp));
-      for (int i = kRegisterArgCount; i < kArgCount; i++) {
-        arg[i] = stack_pointer[(kCalleeRegisterSaveAreaSize / kPointerSize) +
-                               (i - kRegisterArgCount)];
-      }
-      STATIC_ASSERT(kArgCount == kRegisterArgCount + 4);
-      STATIC_ASSERT(kMaxCParameters == 9);
-      bool fp_call =
-          (redirection->type() == ExternalReference::BUILTIN_FP_FP_CALL) ||
-          (redirection->type() == ExternalReference::BUILTIN_COMPARE_CALL) ||
-          (redirection->type() == ExternalReference::BUILTIN_FP_CALL) ||
-          (redirection->type() == ExternalReference::BUILTIN_FP_INT_CALL);
-
-      // Place the return address on the stack, making the call GC safe.
-      *reinterpret_cast<intptr_t*>(get_register(sp) +
-                                   kStackFrameRASlot * kPointerSize) =
-          get_register(r14);
-
-      intptr_t external =
-          reinterpret_cast<intptr_t>(redirection->external_function());
-      if (fp_call) {
-        double dval0, dval1;  // one or two double parameters
-        intptr_t ival;        // zero or one integer parameters
-        int iresult = 0;      // integer return value
-        double dresult = 0;   // double return value
-        GetFpArgs(&dval0, &dval1, &ival);
-        if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
-          SimulatorRuntimeCall generic_target =
-              reinterpret_cast<SimulatorRuntimeCall>(external);
-          switch (redirection->type()) {
-            case ExternalReference::BUILTIN_FP_FP_CALL:
-            case ExternalReference::BUILTIN_COMPARE_CALL:
-              PrintF("Call to host function at %p with args %f, %f",
-                     static_cast<void*>(FUNCTION_ADDR(generic_target)), dval0,
-                     dval1);
-              break;
-            case ExternalReference::BUILTIN_FP_CALL:
-              PrintF("Call to host function at %p with arg %f",
-                     static_cast<void*>(FUNCTION_ADDR(generic_target)), dval0);
-              break;
-            case ExternalReference::BUILTIN_FP_INT_CALL:
-              PrintF("Call to host function at %p with args %f, %" V8PRIdPTR,
-                     static_cast<void*>(FUNCTION_ADDR(generic_target)), dval0,
-                     ival);
-              break;
-            default:
-              UNREACHABLE();
-              break;
-          }
-          if (!stack_aligned) {
-            PrintF(" with unaligned stack %08" V8PRIxPTR "\n",
-                   static_cast<intptr_t>(get_register(sp)));
-          }
-          PrintF("\n");
-        }
-        CHECK(stack_aligned);
-        switch (redirection->type()) {
-          case ExternalReference::BUILTIN_COMPARE_CALL: {
-            SimulatorRuntimeCompareCall target =
-                reinterpret_cast<SimulatorRuntimeCompareCall>(external);
-            iresult = target(dval0, dval1);
-            set_register(r2, iresult);
-            break;
-          }
-          case ExternalReference::BUILTIN_FP_FP_CALL: {
-            SimulatorRuntimeFPFPCall target =
-                reinterpret_cast<SimulatorRuntimeFPFPCall>(external);
-            dresult = target(dval0, dval1);
-            SetFpResult(dresult);
-            break;
-          }
-          case ExternalReference::BUILTIN_FP_CALL: {
-            SimulatorRuntimeFPCall target =
-                reinterpret_cast<SimulatorRuntimeFPCall>(external);
-            dresult = target(dval0);
-            SetFpResult(dresult);
-            break;
-          }
-          case ExternalReference::BUILTIN_FP_INT_CALL: {
-            SimulatorRuntimeFPIntCall target =
-                reinterpret_cast<SimulatorRuntimeFPIntCall>(external);
-            dresult = target(dval0, ival);
-            SetFpResult(dresult);
-            break;
-          }
-          default:
-            UNREACHABLE();
-            break;
-        }
-        if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
-          switch (redirection->type()) {
-            case ExternalReference::BUILTIN_COMPARE_CALL:
-              PrintF("Returned %08x\n", iresult);
-              break;
-            case ExternalReference::BUILTIN_FP_FP_CALL:
-            case ExternalReference::BUILTIN_FP_CALL:
-            case ExternalReference::BUILTIN_FP_INT_CALL:
-              PrintF("Returned %f\n", dresult);
-              break;
-            default:
-              UNREACHABLE();
-              break;
-          }
-        }
-      } else if (redirection->type() == ExternalReference::DIRECT_API_CALL) {
-        // See callers of MacroAssembler::CallApiFunctionAndReturn for
-        // explanation of register usage.
-        if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
-          PrintF("Call to host function at %p args %08" V8PRIxPTR,
-                 reinterpret_cast<void*>(external), arg[0]);
-          if (!stack_aligned) {
-            PrintF(" with unaligned stack %08" V8PRIxPTR "\n",
-                   static_cast<intptr_t>(get_register(sp)));
-          }
-          PrintF("\n");
-        }
-        CHECK(stack_aligned);
-        SimulatorRuntimeDirectApiCall target =
-            reinterpret_cast<SimulatorRuntimeDirectApiCall>(external);
-        target(arg[0]);
-      } else if (redirection->type() == ExternalReference::PROFILING_API_CALL) {
-        // See callers of MacroAssembler::CallApiFunctionAndReturn for
-        // explanation of register usage.
-        if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
-          PrintF("Call to host function at %p args %08" V8PRIxPTR
-                 " %08" V8PRIxPTR,
-                 reinterpret_cast<void*>(external), arg[0], arg[1]);
-          if (!stack_aligned) {
-            PrintF(" with unaligned stack %08" V8PRIxPTR "\n",
-                   static_cast<intptr_t>(get_register(sp)));
-          }
-          PrintF("\n");
-        }
-        CHECK(stack_aligned);
-        SimulatorRuntimeProfilingApiCall target =
-            reinterpret_cast<SimulatorRuntimeProfilingApiCall>(external);
-        target(arg[0], Redirection::ReverseRedirection(arg[1]));
-      } else if (redirection->type() == ExternalReference::DIRECT_GETTER_CALL) {
-        // See callers of MacroAssembler::CallApiFunctionAndReturn for
-        // explanation of register usage.
-        if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
-          PrintF("Call to host function at %p args %08" V8PRIxPTR
-                 " %08" V8PRIxPTR,
-                 reinterpret_cast<void*>(external), arg[0], arg[1]);
-          if (!stack_aligned) {
-            PrintF(" with unaligned stack %08" V8PRIxPTR "\n",
-                   static_cast<intptr_t>(get_register(sp)));
-          }
-          PrintF("\n");
-        }
-        CHECK(stack_aligned);
-        SimulatorRuntimeDirectGetterCall target =
-            reinterpret_cast<SimulatorRuntimeDirectGetterCall>(external);
-        if (!ABI_PASSES_HANDLES_IN_REGS) {
-          arg[0] = *(reinterpret_cast<intptr_t*>(arg[0]));
-        }
-        target(arg[0], arg[1]);
-      } else if (redirection->type() ==
-                 ExternalReference::PROFILING_GETTER_CALL) {
-        if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
-          PrintF("Call to host function at %p args %08" V8PRIxPTR
-                 " %08" V8PRIxPTR " %08" V8PRIxPTR,
-                 reinterpret_cast<void*>(external), arg[0], arg[1], arg[2]);
-          if (!stack_aligned) {
-            PrintF(" with unaligned stack %08" V8PRIxPTR "\n",
-                   static_cast<intptr_t>(get_register(sp)));
-          }
-          PrintF("\n");
-        }
-        CHECK(stack_aligned);
-        SimulatorRuntimeProfilingGetterCall target =
-            reinterpret_cast<SimulatorRuntimeProfilingGetterCall>(external);
-        if (!ABI_PASSES_HANDLES_IN_REGS) {
-          arg[0] = *(reinterpret_cast<intptr_t*>(arg[0]));
-        }
-        target(arg[0], arg[1], Redirection::ReverseRedirection(arg[2]));
-      } else {
-        // builtin call.
-        if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
-          SimulatorRuntimeCall target =
-              reinterpret_cast<SimulatorRuntimeCall>(external);
-          PrintF(
-              "Call to host function at %p,\n"
-              "\t\t\t\targs %08" V8PRIxPTR ", %08" V8PRIxPTR ", %08" V8PRIxPTR
-              ", %08" V8PRIxPTR ", %08" V8PRIxPTR ", %08" V8PRIxPTR
-              ", %08" V8PRIxPTR ", %08" V8PRIxPTR ", %08" V8PRIxPTR,
-              static_cast<void*>(FUNCTION_ADDR(target)), arg[0], arg[1], arg[2],
-              arg[3], arg[4], arg[5], arg[6], arg[7], arg[8]);
-          if (!stack_aligned) {
-            PrintF(" with unaligned stack %08" V8PRIxPTR "\n",
-                   static_cast<intptr_t>(get_register(sp)));
-          }
-          PrintF("\n");
-        }
-        CHECK(stack_aligned);
-        if (redirection->type() == ExternalReference::BUILTIN_CALL_PAIR) {
-          SimulatorRuntimePairCall target =
-              reinterpret_cast<SimulatorRuntimePairCall>(external);
-          ObjectPair result =
-              target(arg[0], arg[1], arg[2], arg[3], arg[4], arg[5]);
-          intptr_t x;
-          intptr_t y;
-          decodeObjectPair(&result, &x, &y);
-          if (::v8::internal::FLAG_trace_sim) {
-            PrintF("Returned {%08" V8PRIxPTR ", %08" V8PRIxPTR "}\n", x, y);
-          }
-          if (ABI_RETURNS_OBJECTPAIR_IN_REGS) {
-            set_register(r2, x);
-            set_register(r3, y);
-          } else {
-            memcpy(reinterpret_cast<void*>(result_buffer), &result,
-                   sizeof(ObjectPair));
-            set_register(r2, result_buffer);
-          }
-        } else {
-          DCHECK(redirection->type() == ExternalReference::BUILTIN_CALL);
-          SimulatorRuntimeCall target =
-              reinterpret_cast<SimulatorRuntimeCall>(external);
-          intptr_t result = target(arg[0], arg[1], arg[2], arg[3], arg[4],
-                                   arg[5], arg[6], arg[7], arg[8]);
-          if (::v8::internal::FLAG_trace_sim) {
-            PrintF("Returned %08" V8PRIxPTR "\n", result);
-          }
-          set_register(r2, result);
-        }
-        // #if !V8_TARGET_ARCH_S390X
-        //         DCHECK(redirection->type() ==
-        //         ExternalReference::BUILTIN_CALL);
-        //         SimulatorRuntimeCall target =
-        //             reinterpret_cast<SimulatorRuntimeCall>(external);
-        //         int64_t result = target(arg[0], arg[1], arg[2], arg[3],
-        //         arg[4],
-        //                                 arg[5]);
-        //         int32_t lo_res = static_cast<int32_t>(result);
-        //         int32_t hi_res = static_cast<int32_t>(result >> 32);
-        // #if !V8_TARGET_LITTLE_ENDIAN
-        //         if (::v8::internal::FLAG_trace_sim) {
-        //           PrintF("Returned %08x\n", hi_res);
-        //         }
-        //         set_register(r2, hi_res);
-        //         set_register(r3, lo_res);
-        // #else
-        //         if (::v8::internal::FLAG_trace_sim) {
-        //           PrintF("Returned %08x\n", lo_res);
-        //         }
-        //         set_register(r2, lo_res);
-        //         set_register(r3, hi_res);
-        // #endif
-        // #else
-        //         if (redirection->type() == ExternalReference::BUILTIN_CALL) {
-        //           SimulatorRuntimeCall target =
-        //             reinterpret_cast<SimulatorRuntimeCall>(external);
-        //           intptr_t result = target(arg[0], arg[1], arg[2], arg[3],
-        //           arg[4],
-        //               arg[5]);
-        //           if (::v8::internal::FLAG_trace_sim) {
-        //             PrintF("Returned %08" V8PRIxPTR "\n", result);
-        //           }
-        //           set_register(r2, result);
-        //         } else {
-        //           DCHECK(redirection->type() ==
-        //               ExternalReference::BUILTIN_CALL_PAIR);
-        //           SimulatorRuntimePairCall target =
-        //             reinterpret_cast<SimulatorRuntimePairCall>(external);
-        //           ObjectPair result = target(arg[0], arg[1], arg[2], arg[3],
-        //               arg[4], arg[5]);
-        //           if (::v8::internal::FLAG_trace_sim) {
-        //             PrintF("Returned %08" V8PRIxPTR ", %08" V8PRIxPTR "\n",
-        //                 result.x, result.y);
-        //           }
-        // #if ABI_RETURNS_OBJECTPAIR_IN_REGS
-        //           set_register(r2, result.x);
-        //           set_register(r3, result.y);
-        // #else
-        //            memcpy(reinterpret_cast<void *>(result_buffer), &result,
-        //                sizeof(ObjectPair));
-        // #endif
-        //         }
-        // #endif
-      }
-      int64_t saved_lr = *reinterpret_cast<intptr_t*>(
-          get_register(sp) + kStackFrameRASlot * kPointerSize);
-#if (!V8_TARGET_ARCH_S390X && V8_HOST_ARCH_S390)
-      // On zLinux-31, the saved_lr might be tagged with a high bit of 1.
-      // Cleanse it before proceeding with simulation.
-      saved_lr &= 0x7FFFFFFF;
-#endif
-      set_pc(saved_lr);
-      break;
-    }
-    case kBreakpoint: {
-      S390Debugger dbg(this);
-      dbg.Debug();
-      break;
-    }
-    // stop uses all codes greater than 1 << 23.
-    default: {
-      if (svc >= (1 << 23)) {
-        uint32_t code = svc & kStopCodeMask;
-        if (isWatchedStop(code)) {
-          IncreaseStopCounter(code);
-        }
-        // Stop if it is enabled, otherwise go on jumping over the stop
-        // and the message address.
-        if (isEnabledStop(code)) {
-          S390Debugger dbg(this);
-          dbg.Stop(instr);
-        } else {
-          set_pc(get_pc() + sizeof(FourByteInstr) + kPointerSize);
-        }
-      } else {
-        // This is not a valid svc code.
-        UNREACHABLE();
-        break;
-      }
-    }
-  }
-}
-
-// Stop helper functions.
-bool Simulator::isStopInstruction(Instruction* instr) {
-  return (instr->Bits(27, 24) == 0xF) && (instr->SvcValue() >= kStopCode);
-}
-
-bool Simulator::isWatchedStop(uint32_t code) {
-  DCHECK_LE(code, kMaxStopCode);
-  return code < kNumOfWatchedStops;
-}
-
-bool Simulator::isEnabledStop(uint32_t code) {
-  DCHECK_LE(code, kMaxStopCode);
-  // Unwatched stops are always enabled.
-  return !isWatchedStop(code) ||
-         !(watched_stops_[code].count & kStopDisabledBit);
-}
-
-void Simulator::EnableStop(uint32_t code) {
-  DCHECK(isWatchedStop(code));
-  if (!isEnabledStop(code)) {
-    watched_stops_[code].count &= ~kStopDisabledBit;
-  }
-}
-
-void Simulator::DisableStop(uint32_t code) {
-  DCHECK(isWatchedStop(code));
-  if (isEnabledStop(code)) {
-    watched_stops_[code].count |= kStopDisabledBit;
-  }
-}
-
-void Simulator::IncreaseStopCounter(uint32_t code) {
-  DCHECK_LE(code, kMaxStopCode);
-  DCHECK(isWatchedStop(code));
-  if ((watched_stops_[code].count & ~(1 << 31)) == 0x7FFFFFFF) {
-    PrintF(
-        "Stop counter for code %i has overflowed.\n"
-        "Enabling this code and reseting the counter to 0.\n",
-        code);
-    watched_stops_[code].count = 0;
-    EnableStop(code);
-  } else {
-    watched_stops_[code].count++;
-  }
-}
-
-// Print a stop status.
-void Simulator::PrintStopInfo(uint32_t code) {
-  DCHECK_LE(code, kMaxStopCode);
-  if (!isWatchedStop(code)) {
-    PrintF("Stop not watched.");
-  } else {
-    const char* state = isEnabledStop(code) ? "Enabled" : "Disabled";
-    int32_t count = watched_stops_[code].count & ~kStopDisabledBit;
-    // Don't print the state of unused breakpoints.
-    if (count != 0) {
-      if (watched_stops_[code].desc) {
-        PrintF("stop %i - 0x%x: \t%s, \tcounter = %i, \t%s\n", code, code,
-               state, count, watched_stops_[code].desc);
-      } else {
-        PrintF("stop %i - 0x%x: \t%s, \tcounter = %i\n", code, code, state,
-               count);
-      }
-    }
-  }
-}
-
-// Method for checking overflow on signed addition:
-//   Test src1 and src2 have opposite sign,
-//   (1) No overflow if they have opposite sign
-//   (2) Test the result and one of the operands have opposite sign
-//      (a) No overflow if they don't have opposite sign
-//      (b) Overflow if opposite
-#define CheckOverflowForIntAdd(src1, src2, type) \
-  OverflowFromSigned<type>(src1 + src2, src1, src2, true);
-
-#define CheckOverflowForIntSub(src1, src2, type) \
-  OverflowFromSigned<type>(src1 - src2, src1, src2, false);
-
-// Method for checking overflow on unsigned addition
-#define CheckOverflowForUIntAdd(src1, src2) \
-  ((src1) + (src2) < (src1) || (src1) + (src2) < (src2))
-
-// Method for checking overflow on unsigned subtraction
-#define CheckOverflowForUIntSub(src1, src2) ((src1) - (src2) > (src1))
-
-// Method for checking overflow on multiplication
-#define CheckOverflowForMul(src1, src2) (((src1) * (src2)) / (src2) != (src1))
-
-// Method for checking overflow on shift right
-#define CheckOverflowForShiftRight(src1, src2) \
-  (((src1) >> (src2)) << (src2) != (src1))
-
-// Method for checking overflow on shift left
-#define CheckOverflowForShiftLeft(src1, src2) \
-  (((src1) << (src2)) >> (src2) != (src1))
-
-int16_t Simulator::ByteReverse(int16_t hword) {
-#if defined(__GNUC__)
-  return __builtin_bswap16(hword);
-#else
-  return (hword << 8) | ((hword >> 8) & 0x00FF);
-#endif
-}
-
-int32_t Simulator::ByteReverse(int32_t word) {
-#if defined(__GNUC__)
-  return __builtin_bswap32(word);
-#else
-  int32_t result = word << 24;
-  result |= (word << 8) & 0x00FF0000;
-  result |= (word >> 8) & 0x0000FF00;
-  result |= (word >> 24) & 0x00000FF;
-  return result;
-#endif
-}
-
-int64_t Simulator::ByteReverse(int64_t dword) {
-#if defined(__GNUC__)
-  return __builtin_bswap64(dword);
-#else
-#error unsupport __builtin_bswap64
-#endif
-}
-
-int Simulator::DecodeInstruction(Instruction* instr) {
-  Opcode op = instr->S390OpcodeValue();
-  DCHECK_NOT_NULL(EvalTable[op]);
-  return (this->*EvalTable[op])(instr);
-}
-
-// Executes the current instruction.
-void Simulator::ExecuteInstruction(Instruction* instr, bool auto_incr_pc) {
-  icount_++;
-
-  if (v8::internal::FLAG_check_icache) {
-    CheckICache(isolate_->simulator_i_cache(), instr);
-  }
-
-  pc_modified_ = false;
-
-  if (::v8::internal::FLAG_trace_sim) {
-    disasm::NameConverter converter;
-    disasm::Disassembler dasm(converter);
-    // use a reasonably large buffer
-    v8::internal::EmbeddedVector<char, 256> buffer;
-    dasm.InstructionDecode(buffer, reinterpret_cast<byte*>(instr));
-    PrintF("%05" PRId64 "  %08" V8PRIxPTR "  %s\n", icount_,
-           reinterpret_cast<intptr_t>(instr), buffer.start());
-
-    // Flush stdout to prevent incomplete file output during abnormal exits
-    // This is caused by the output being buffered before being written to file
-    fflush(stdout);
-  }
-
-  // Try to simulate as S390 Instruction first.
-  int length = DecodeInstruction(instr);
-
-  if (!pc_modified_ && auto_incr_pc) {
-    DCHECK(length == instr->InstructionLength());
-    set_pc(reinterpret_cast<intptr_t>(instr) + length);
-  }
-  return;
-}
-
-void Simulator::DebugStart() {
-  S390Debugger dbg(this);
-  dbg.Debug();
-}
-
-void Simulator::Execute() {
-  // Get the PC to simulate. Cannot use the accessor here as we need the
-  // raw PC value and not the one used as input to arithmetic instructions.
-  intptr_t program_counter = get_pc();
-
-  if (::v8::internal::FLAG_stop_sim_at == 0) {
-    // Fast version of the dispatch loop without checking whether the simulator
-    // should be stopping at a particular executed instruction.
-    while (program_counter != end_sim_pc) {
-      Instruction* instr = reinterpret_cast<Instruction*>(program_counter);
-      ExecuteInstruction(instr);
-      program_counter = get_pc();
-    }
-  } else {
-    // FLAG_stop_sim_at is at the non-default value. Stop in the debugger when
-    // we reach the particular instruction count.
-    while (program_counter != end_sim_pc) {
-      Instruction* instr = reinterpret_cast<Instruction*>(program_counter);
-      if (icount_ == ::v8::internal::FLAG_stop_sim_at) {
-        S390Debugger dbg(this);
-        dbg.Debug();
-      } else {
-        ExecuteInstruction(instr);
-      }
-      program_counter = get_pc();
-    }
-  }
-}
-
-void Simulator::CallInternal(byte* entry, int reg_arg_count) {
-  // Adjust JS-based stack limit to C-based stack limit.
-  isolate_->stack_guard()->AdjustStackLimitForSimulator();
-
-  // Prepare to execute the code at entry
-  if (ABI_USES_FUNCTION_DESCRIPTORS) {
-    // entry is the function descriptor
-    set_pc(*(reinterpret_cast<intptr_t*>(entry)));
-  } else {
-    // entry is the instruction address
-    set_pc(reinterpret_cast<intptr_t>(entry));
-  }
-  // Remember the values of non-volatile registers.
-  int64_t r6_val = get_register(r6);
-  int64_t r7_val = get_register(r7);
-  int64_t r8_val = get_register(r8);
-  int64_t r9_val = get_register(r9);
-  int64_t r10_val = get_register(r10);
-  int64_t r11_val = get_register(r11);
-  int64_t r12_val = get_register(r12);
-  int64_t r13_val = get_register(r13);
-
-  if (ABI_CALL_VIA_IP) {
-    // Put target address in ip (for JS prologue).
-    set_register(ip, get_pc());
-  }
-
-  // Put down marker for end of simulation. The simulator will stop simulation
-  // when the PC reaches this value. By saving the "end simulation" value into
-  // the LR the simulation stops when returning to this call point.
-  registers_[14] = end_sim_pc;
-
-  // Set up the non-volatile registers with a known value. To be able to check
-  // that they are preserved properly across JS execution.
-  uintptr_t callee_saved_value = icount_;
-  if (reg_arg_count < 5) {
-    set_register(r6, callee_saved_value + 6);
-  }
-  set_register(r7, callee_saved_value + 7);
-  set_register(r8, callee_saved_value + 8);
-  set_register(r9, callee_saved_value + 9);
-  set_register(r10, callee_saved_value + 10);
-  set_register(r11, callee_saved_value + 11);
-  set_register(r12, callee_saved_value + 12);
-  set_register(r13, callee_saved_value + 13);
-
-  // Start the simulation
-  Execute();
-
-// Check that the non-volatile registers have been preserved.
-#ifndef V8_TARGET_ARCH_S390X
-  if (reg_arg_count < 5) {
-    DCHECK_EQ(callee_saved_value + 6, get_low_register<uint32_t>(r6));
-  }
-  DCHECK_EQ(callee_saved_value + 7, get_low_register<uint32_t>(r7));
-  DCHECK_EQ(callee_saved_value + 8, get_low_register<uint32_t>(r8));
-  DCHECK_EQ(callee_saved_value + 9, get_low_register<uint32_t>(r9));
-  DCHECK_EQ(callee_saved_value + 10, get_low_register<uint32_t>(r10));
-  DCHECK_EQ(callee_saved_value + 11, get_low_register<uint32_t>(r11));
-  DCHECK_EQ(callee_saved_value + 12, get_low_register<uint32_t>(r12));
-  DCHECK_EQ(callee_saved_value + 13, get_low_register<uint32_t>(r13));
-#else
-  if (reg_arg_count < 5) {
-    DCHECK_EQ(callee_saved_value + 6, get_register(r6));
-  }
-  DCHECK_EQ(callee_saved_value + 7, get_register(r7));
-  DCHECK_EQ(callee_saved_value + 8, get_register(r8));
-  DCHECK_EQ(callee_saved_value + 9, get_register(r9));
-  DCHECK_EQ(callee_saved_value + 10, get_register(r10));
-  DCHECK_EQ(callee_saved_value + 11, get_register(r11));
-  DCHECK_EQ(callee_saved_value + 12, get_register(r12));
-  DCHECK_EQ(callee_saved_value + 13, get_register(r13));
-#endif
-
-  // Restore non-volatile registers with the original value.
-  set_register(r6, r6_val);
-  set_register(r7, r7_val);
-  set_register(r8, r8_val);
-  set_register(r9, r9_val);
-  set_register(r10, r10_val);
-  set_register(r11, r11_val);
-  set_register(r12, r12_val);
-  set_register(r13, r13_val);
-}
-
-intptr_t Simulator::CallImpl(byte* entry, int argument_count,
-                             const intptr_t* arguments) {
-  // Adjust JS-based stack limit to C-based stack limit.
-  isolate_->stack_guard()->AdjustStackLimitForSimulator();
-
-  // Remember the values of non-volatile registers.
-  int64_t r6_val = get_register(r6);
-  int64_t r7_val = get_register(r7);
-  int64_t r8_val = get_register(r8);
-  int64_t r9_val = get_register(r9);
-  int64_t r10_val = get_register(r10);
-  int64_t r11_val = get_register(r11);
-  int64_t r12_val = get_register(r12);
-  int64_t r13_val = get_register(r13);
-
-  // Set up arguments
-
-  // First 5 arguments passed in registers r2-r6.
-  int reg_arg_count = std::min(5, argument_count);
-  int stack_arg_count = argument_count - reg_arg_count;
-  for (int i = 0; i < reg_arg_count; i++) {
-    set_register(i + 2, arguments[i]);
-  }
-
-  // Remaining arguments passed on stack.
-  int64_t original_stack = get_register(sp);
-  // Compute position of stack on entry to generated code.
-  uintptr_t entry_stack =
-      (original_stack -
-       (kCalleeRegisterSaveAreaSize + stack_arg_count * sizeof(intptr_t)));
-  if (base::OS::ActivationFrameAlignment() != 0) {
-    entry_stack &= -base::OS::ActivationFrameAlignment();
-  }
-
-  // Store remaining arguments on stack, from low to high memory.
-  intptr_t* stack_argument =
-      reinterpret_cast<intptr_t*>(entry_stack + kCalleeRegisterSaveAreaSize);
-  memcpy(stack_argument, arguments + reg_arg_count,
-         stack_arg_count * sizeof(*arguments));
-  set_register(sp, entry_stack);
-
-// Prepare to execute the code at entry
-#if ABI_USES_FUNCTION_DESCRIPTORS
-  // entry is the function descriptor
-  set_pc(*(reinterpret_cast<intptr_t*>(entry)));
-#else
-  // entry is the instruction address
-  set_pc(reinterpret_cast<intptr_t>(entry));
-#endif
-
-  // Put target address in ip (for JS prologue).
-  set_register(r12, get_pc());
-
-  // Put down marker for end of simulation. The simulator will stop simulation
-  // when the PC reaches this value. By saving the "end simulation" value into
-  // the LR the simulation stops when returning to this call point.
-  registers_[14] = end_sim_pc;
-
-  // Set up the non-volatile registers with a known value. To be able to check
-  // that they are preserved properly across JS execution.
-  uintptr_t callee_saved_value = icount_;
-  if (reg_arg_count < 5) {
-    set_register(r6, callee_saved_value + 6);
-  }
-  set_register(r7, callee_saved_value + 7);
-  set_register(r8, callee_saved_value + 8);
-  set_register(r9, callee_saved_value + 9);
-  set_register(r10, callee_saved_value + 10);
-  set_register(r11, callee_saved_value + 11);
-  set_register(r12, callee_saved_value + 12);
-  set_register(r13, callee_saved_value + 13);
-
-  // Start the simulation
-  Execute();
-
-// Check that the non-volatile registers have been preserved.
-#ifndef V8_TARGET_ARCH_S390X
-  if (reg_arg_count < 5) {
-    DCHECK_EQ(callee_saved_value + 6, get_low_register<uint32_t>(r6));
-  }
-  DCHECK_EQ(callee_saved_value + 7, get_low_register<uint32_t>(r7));
-  DCHECK_EQ(callee_saved_value + 8, get_low_register<uint32_t>(r8));
-  DCHECK_EQ(callee_saved_value + 9, get_low_register<uint32_t>(r9));
-  DCHECK_EQ(callee_saved_value + 10, get_low_register<uint32_t>(r10));
-  DCHECK_EQ(callee_saved_value + 11, get_low_register<uint32_t>(r11));
-  DCHECK_EQ(callee_saved_value + 12, get_low_register<uint32_t>(r12));
-  DCHECK_EQ(callee_saved_value + 13, get_low_register<uint32_t>(r13));
-#else
-  if (reg_arg_count < 5) {
-    DCHECK_EQ(callee_saved_value + 6, get_register(r6));
-  }
-  DCHECK_EQ(callee_saved_value + 7, get_register(r7));
-  DCHECK_EQ(callee_saved_value + 8, get_register(r8));
-  DCHECK_EQ(callee_saved_value + 9, get_register(r9));
-  DCHECK_EQ(callee_saved_value + 10, get_register(r10));
-  DCHECK_EQ(callee_saved_value + 11, get_register(r11));
-  DCHECK_EQ(callee_saved_value + 12, get_register(r12));
-  DCHECK_EQ(callee_saved_value + 13, get_register(r13));
-#endif
-
-  // Restore non-volatile registers with the original value.
-  set_register(r6, r6_val);
-  set_register(r7, r7_val);
-  set_register(r8, r8_val);
-  set_register(r9, r9_val);
-  set_register(r10, r10_val);
-  set_register(r11, r11_val);
-  set_register(r12, r12_val);
-  set_register(r13, r13_val);
-// Pop stack passed arguments.
-
-#ifndef V8_TARGET_ARCH_S390X
-  DCHECK_EQ(entry_stack, get_low_register<uint32_t>(sp));
-#else
-  DCHECK_EQ(entry_stack, get_register(sp));
-#endif
-  set_register(sp, original_stack);
-
-  // Return value register
-  return get_register(r2);
-}
-
-void Simulator::CallFP(byte* entry, double d0, double d1) {
-  set_d_register_from_double(0, d0);
-  set_d_register_from_double(1, d1);
-  CallInternal(entry);
-}
-
-int32_t Simulator::CallFPReturnsInt(byte* entry, double d0, double d1) {
-  CallFP(entry, d0, d1);
-  int32_t result = get_register(r2);
-  return result;
-}
-
-double Simulator::CallFPReturnsDouble(byte* entry, double d0, double d1) {
-  CallFP(entry, d0, d1);
-  return get_double_from_d_register(0);
-}
-
-uintptr_t Simulator::PushAddress(uintptr_t address) {
-  uintptr_t new_sp = get_register(sp) - sizeof(uintptr_t);
-  uintptr_t* stack_slot = reinterpret_cast<uintptr_t*>(new_sp);
-  *stack_slot = address;
-  set_register(sp, new_sp);
-  return new_sp;
-}
-
-uintptr_t Simulator::PopAddress() {
-  uintptr_t current_sp = get_register(sp);
-  uintptr_t* stack_slot = reinterpret_cast<uintptr_t*>(current_sp);
-  uintptr_t address = *stack_slot;
-  set_register(sp, current_sp + sizeof(uintptr_t));
-  return address;
-}
-
-#define EVALUATE(name) \
-  int Simulator::Evaluate_##name(Instruction* instr)
-
-#define DCHECK_OPCODE(op) DCHECK(instr->S390OpcodeValue() == op)
-
-#define AS(type) reinterpret_cast<type*>(instr)
-
-#define DECODE_RIL_A_INSTRUCTION(r1, i2)               \
-  int r1 = AS(RILInstruction)->R1Value();              \
-  uint32_t i2 = AS(RILInstruction)->I2UnsignedValue(); \
-  int length = 6;
-
-#define DECODE_RIL_B_INSTRUCTION(r1, i2)      \
-  int r1 = AS(RILInstruction)->R1Value();     \
-  int32_t i2 = AS(RILInstruction)->I2Value(); \
-  int length = 6;
-
-#define DECODE_RIL_C_INSTRUCTION(m1, ri2)                               \
-  Condition m1 = static_cast<Condition>(AS(RILInstruction)->R1Value()); \
-  uint64_t ri2 = AS(RILInstruction)->I2Value();                         \
-  int length = 6;
-
-#define DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2) \
-  int r1 = AS(RXYInstruction)->R1Value();        \
-  int x2 = AS(RXYInstruction)->X2Value();        \
-  int b2 = AS(RXYInstruction)->B2Value();        \
-  int d2 = AS(RXYInstruction)->D2Value();        \
-  int length = 6;
-
-#define DECODE_RX_A_INSTRUCTION(x2, b2, r1, d2_val) \
-  int x2 = AS(RXInstruction)->X2Value();            \
-  int b2 = AS(RXInstruction)->B2Value();            \
-  int r1 = AS(RXInstruction)->R1Value();            \
-  intptr_t d2_val = AS(RXInstruction)->D2Value();   \
-  int length = 4;
-
-#define DECODE_RS_A_INSTRUCTION(r1, r3, b2, d2) \
-  int r3 = AS(RSInstruction)->R3Value();        \
-  int b2 = AS(RSInstruction)->B2Value();        \
-  int r1 = AS(RSInstruction)->R1Value();        \
-  intptr_t d2 = AS(RSInstruction)->D2Value();   \
-  int length = 4;
-
-#define DECODE_RS_A_INSTRUCTION_NO_R3(r1, b2, d2) \
-  int b2 = AS(RSInstruction)->B2Value();          \
-  int r1 = AS(RSInstruction)->R1Value();          \
-  int d2 = AS(RSInstruction)->D2Value();          \
-  int length = 4;
-
-#define DECODE_SI_INSTRUCTION_I_UINT8(b1, d1_val, imm_val) \
-  int b1 = AS(SIInstruction)->B1Value();                   \
-  intptr_t d1_val = AS(SIInstruction)->D1Value();          \
-  uint8_t imm_val = AS(SIInstruction)->I2Value();          \
-  int length = 4;
-
-#define DECODE_SIL_INSTRUCTION(b1, d1, i2)     \
-  int b1 = AS(SILInstruction)->B1Value();      \
-  intptr_t d1 = AS(SILInstruction)->D1Value(); \
-  int16_t i2 = AS(SILInstruction)->I2Value();  \
-  int length = 6;
-
-#define DECODE_SIY_INSTRUCTION(b1, d1, i2)     \
-  int b1 = AS(SIYInstruction)->B1Value();      \
-  intptr_t d1 = AS(SIYInstruction)->D1Value(); \
-  uint8_t i2 = AS(SIYInstruction)->I2Value();  \
-  int length = 6;
-
-#define DECODE_RRE_INSTRUCTION(r1, r2)    \
-  int r1 = AS(RREInstruction)->R1Value(); \
-  int r2 = AS(RREInstruction)->R2Value(); \
-  int length = 4;
-
-#define DECODE_RRE_INSTRUCTION_M3(r1, r2, m3) \
-  int r1 = AS(RREInstruction)->R1Value();     \
-  int r2 = AS(RREInstruction)->R2Value();     \
-  int m3 = AS(RREInstruction)->M3Value();     \
-  int length = 4;
-
-#define DECODE_RRE_INSTRUCTION_NO_R2(r1)  \
-  int r1 = AS(RREInstruction)->R1Value(); \
-  int length = 4;
-
-#define DECODE_RRD_INSTRUCTION(r1, r2, r3) \
-  int r1 = AS(RRDInstruction)->R1Value();  \
-  int r2 = AS(RRDInstruction)->R2Value();  \
-  int r3 = AS(RRDInstruction)->R3Value();  \
-  int length = 4;
-
-#define DECODE_RRF_E_INSTRUCTION(r1, r2, m3, m4) \
-  int r1 = AS(RRFInstruction)->R1Value();        \
-  int r2 = AS(RRFInstruction)->R2Value();        \
-  int m3 = AS(RRFInstruction)->M3Value();        \
-  int m4 = AS(RRFInstruction)->M4Value();        \
-  int length = 4;
-
-#define DECODE_RRF_A_INSTRUCTION(r1, r2, r3) \
-  int r1 = AS(RRFInstruction)->R1Value();    \
-  int r2 = AS(RRFInstruction)->R2Value();    \
-  int r3 = AS(RRFInstruction)->R3Value();    \
-  int length = 4;
-
-#define DECODE_RRF_C_INSTRUCTION(r1, r2, m3)                            \
-  int r1 = AS(RRFInstruction)->R1Value();                               \
-  int r2 = AS(RRFInstruction)->R2Value();                               \
-  Condition m3 = static_cast<Condition>(AS(RRFInstruction)->M3Value()); \
-  int length = 4;
-
-#define DECODE_RR_INSTRUCTION(r1, r2)    \
-  int r1 = AS(RRInstruction)->R1Value(); \
-  int r2 = AS(RRInstruction)->R2Value(); \
-  int length = 2;
-
-#define DECODE_RIE_D_INSTRUCTION(r1, r2, i2)  \
-  int r1 = AS(RIEInstruction)->R1Value();     \
-  int r2 = AS(RIEInstruction)->R2Value();     \
-  int32_t i2 = AS(RIEInstruction)->I6Value(); \
-  int length = 6;
-
-#define DECODE_RIE_F_INSTRUCTION(r1, r2, i3, i4, i5) \
-  int r1 = AS(RIEInstruction)->R1Value();            \
-  int r2 = AS(RIEInstruction)->R2Value();            \
-  uint32_t i3 = AS(RIEInstruction)->I3Value();       \
-  uint32_t i4 = AS(RIEInstruction)->I4Value();       \
-  uint32_t i5 = AS(RIEInstruction)->I5Value();       \
-  int length = 6;
-
-#define DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2) \
-  int r1 = AS(RSYInstruction)->R1Value();        \
-  int r3 = AS(RSYInstruction)->R3Value();        \
-  int b2 = AS(RSYInstruction)->B2Value();        \
-  intptr_t d2 = AS(RSYInstruction)->D2Value();   \
-  int length = 6;
-
-#define DECODE_RI_A_INSTRUCTION(instr, r1, i2) \
-  int32_t r1 = AS(RIInstruction)->R1Value();   \
-  int16_t i2 = AS(RIInstruction)->I2Value();   \
-  int length = 4;
-
-#define DECODE_RI_B_INSTRUCTION(instr, r1, i2) \
-  int32_t r1 = AS(RILInstruction)->R1Value();  \
-  int16_t i2 = AS(RILInstruction)->I2Value();  \
-  int length = 4;
-
-#define DECODE_RI_C_INSTRUCTION(instr, m1, i2)                         \
-  Condition m1 = static_cast<Condition>(AS(RIInstruction)->R1Value()); \
-  int16_t i2 = AS(RIInstruction)->I2Value();                           \
-  int length = 4;
-
-#define DECODE_RXE_INSTRUCTION(r1, b2, x2, d2) \
-  int r1 = AS(RXEInstruction)->R1Value();      \
-  int b2 = AS(RXEInstruction)->B2Value();      \
-  int x2 = AS(RXEInstruction)->X2Value();      \
-  int d2 = AS(RXEInstruction)->D2Value();      \
-  int length = 6;
-
-#define DECODE_VRR_C_INSTRUCTION(r1, r2, r3, m6, m5, m4) \
-  int r1 = AS(VRR_C_Instruction)->R1Value();             \
-  int r2 = AS(VRR_C_Instruction)->R2Value();             \
-  int r3 = AS(VRR_C_Instruction)->R3Value();             \
-  int m6 = AS(VRR_C_Instruction)->M6Value();             \
-  int m5 = AS(VRR_C_Instruction)->M5Value();             \
-  int m4 = AS(VRR_C_Instruction)->M4Value();             \
-  int length = 6;
-
-#define GET_ADDRESS(index_reg, base_reg, offset)       \
-  (((index_reg) == 0) ? 0 : get_register(index_reg)) + \
-      (((base_reg) == 0) ? 0 : get_register(base_reg)) + offset
-
-int Simulator::Evaluate_Unknown(Instruction* instr) {
-  UNREACHABLE();
-}
-
-EVALUATE(VFA) {
-  DCHECK_OPCODE(VFA);
-  DECODE_VRR_C_INSTRUCTION(r1, r2, r3, m6, m5, m4);
-  USE(m6);
-  USE(m5);
-  USE(m4);
-  DCHECK_EQ(m5, 8);
-  DCHECK_EQ(m4, 3);
-  double r2_val = get_double_from_d_register(r2);
-  double r3_val = get_double_from_d_register(r3);
-  double r1_val = r2_val + r3_val;
-  set_d_register_from_double(r1, r1_val);
-  return length;
-}
-
-EVALUATE(VFS) {
-  DCHECK_OPCODE(VFS);
-  DECODE_VRR_C_INSTRUCTION(r1, r2, r3, m6, m5, m4);
-  USE(m6);
-  USE(m5);
-  USE(m4);
-  DCHECK_EQ(m5, 8);
-  DCHECK_EQ(m4, 3);
-  double r2_val = get_double_from_d_register(r2);
-  double r3_val = get_double_from_d_register(r3);
-  double r1_val = r2_val - r3_val;
-  set_d_register_from_double(r1, r1_val);
-  return length;
-}
-
-EVALUATE(VFM) {
-  DCHECK_OPCODE(VFM);
-  DECODE_VRR_C_INSTRUCTION(r1, r2, r3, m6, m5, m4);
-  USE(m6);
-  USE(m5);
-  USE(m4);
-  DCHECK_EQ(m5, 8);
-  DCHECK_EQ(m4, 3);
-  double r2_val = get_double_from_d_register(r2);
-  double r3_val = get_double_from_d_register(r3);
-  double r1_val = r2_val * r3_val;
-  set_d_register_from_double(r1, r1_val);
-  return length;
-}
-
-EVALUATE(VFD) {
-  DCHECK_OPCODE(VFD);
-  DECODE_VRR_C_INSTRUCTION(r1, r2, r3, m6, m5, m4);
-  USE(m6);
-  USE(m5);
-  USE(m4);
-  DCHECK_EQ(m5, 8);
-  DCHECK_EQ(m4, 3);
-  double r2_val = get_double_from_d_register(r2);
-  double r3_val = get_double_from_d_register(r3);
-  double r1_val = r2_val / r3_val;
-  set_d_register_from_double(r1, r1_val);
-  return length;
-}
-
-EVALUATE(DUMY) {
-  DCHECK_OPCODE(DUMY);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  USE(r1);
-  USE(x2);
-  USE(b2);
-  USE(d2);
-  // dummy instruction does nothing.
-  return length;
-}
-
-EVALUATE(CLR) {
-  DCHECK_OPCODE(CLR);
-  DECODE_RR_INSTRUCTION(r1, r2);
-  uint32_t r1_val = get_low_register<uint32_t>(r1);
-  uint32_t r2_val = get_low_register<uint32_t>(r2);
-  SetS390ConditionCode<uint32_t>(r1_val, r2_val);
-  return length;
-}
-
-EVALUATE(LR) {
-  DCHECK_OPCODE(LR);
-  DECODE_RR_INSTRUCTION(r1, r2);
-  set_low_register(r1, get_low_register<int32_t>(r2));
-  return length;
-}
-
-EVALUATE(AR) {
-  DCHECK_OPCODE(AR);
-  DECODE_RR_INSTRUCTION(r1, r2);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  bool isOF = CheckOverflowForIntAdd(r1_val, r2_val, int32_t);
-  r1_val += r2_val;
-  SetS390ConditionCode<int32_t>(r1_val, 0);
-  SetS390OverflowCode(isOF);
-  set_low_register(r1, r1_val);
-  return length;
-}
-
-EVALUATE(L) {
-  DCHECK_OPCODE(L);
-  DECODE_RX_A_INSTRUCTION(x2, b2, r1, d2_val);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t addr = b2_val + x2_val + d2_val;
-  int32_t mem_val = ReadW(addr, instr);
-  set_low_register(r1, mem_val);
-  return length;
-}
-
-EVALUATE(BRC) {
-  DCHECK_OPCODE(BRC);
-  DECODE_RI_C_INSTRUCTION(instr, m1, i2);
-
-  if (TestConditionCode(m1)) {
-    intptr_t offset = 2 * i2;
-    set_pc(get_pc() + offset);
-  }
-  return length;
-}
-
-EVALUATE(AHI) {
-  DCHECK_OPCODE(AHI);
-  DECODE_RI_A_INSTRUCTION(instr, r1, i2);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  bool isOF = CheckOverflowForIntAdd(r1_val, i2, int32_t);
-  r1_val += i2;
-  set_low_register(r1, r1_val);
-  SetS390ConditionCode<int32_t>(r1_val, 0);
-  SetS390OverflowCode(isOF);
-  return length;
-}
-
-EVALUATE(AGHI) {
-  DCHECK_OPCODE(AGHI);
-  DECODE_RI_A_INSTRUCTION(instr, r1, i2);
-  int64_t r1_val = get_register(r1);
-  bool isOF = false;
-  isOF = CheckOverflowForIntAdd(r1_val, i2, int64_t);
-  r1_val += i2;
-  set_register(r1, r1_val);
-  SetS390ConditionCode<int64_t>(r1_val, 0);
-  SetS390OverflowCode(isOF);
-  return length;
-}
-
-EVALUATE(BRCL) {
-  DCHECK_OPCODE(BRCL);
-  DECODE_RIL_C_INSTRUCTION(m1, ri2);
-
-  if (TestConditionCode(m1)) {
-    intptr_t offset = 2 * ri2;
-    set_pc(get_pc() + offset);
-  }
-  return length;
-}
-
-EVALUATE(IIHF) {
-  DCHECK_OPCODE(IIHF);
-  DECODE_RIL_A_INSTRUCTION(r1, imm);
-  set_high_register(r1, imm);
-  return length;
-}
-
-EVALUATE(IILF) {
-  DCHECK_OPCODE(IILF);
-  DECODE_RIL_A_INSTRUCTION(r1, imm);
-  set_low_register(r1, imm);
-  return length;
-}
-
-EVALUATE(LGR) {
-  DCHECK_OPCODE(LGR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  set_register(r1, get_register(r2));
-  return length;
-}
-
-EVALUATE(LG) {
-  DCHECK_OPCODE(LG);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  intptr_t addr = GET_ADDRESS(x2, b2, d2);
-  int64_t mem_val = ReadDW(addr);
-  set_register(r1, mem_val);
-  return length;
-}
-
-EVALUATE(AGR) {
-  DCHECK_OPCODE(AGR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int64_t r1_val = get_register(r1);
-  int64_t r2_val = get_register(r2);
-  bool isOF = CheckOverflowForIntAdd(r1_val, r2_val, int64_t);
-  r1_val += r2_val;
-  set_register(r1, r1_val);
-  SetS390ConditionCode<int64_t>(r1_val, 0);
-  SetS390OverflowCode(isOF);
-  return length;
-}
-
-EVALUATE(LGFR) {
-  DCHECK_OPCODE(LGFR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  int64_t result = static_cast<int64_t>(r2_val);
-  set_register(r1, result);
-
-  return length;
-}
-
-EVALUATE(LBR) {
-  DCHECK_OPCODE(LBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  r2_val <<= 24;
-  r2_val >>= 24;
-  set_low_register(r1, r2_val);
-  return length;
-}
-
-EVALUATE(LGBR) {
-  DCHECK_OPCODE(LGBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int64_t r2_val = get_low_register<int64_t>(r2);
-  r2_val <<= 56;
-  r2_val >>= 56;
-  set_register(r1, r2_val);
-  return length;
-}
-
-EVALUATE(LHR) {
-  DCHECK_OPCODE(LHR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  r2_val <<= 16;
-  r2_val >>= 16;
-  set_low_register(r1, r2_val);
-  return length;
-}
-
-EVALUATE(LGHR) {
-  DCHECK_OPCODE(LGHR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int64_t r2_val = get_low_register<int64_t>(r2);
-  r2_val <<= 48;
-  r2_val >>= 48;
-  set_register(r1, r2_val);
-  return length;
-}
-
-EVALUATE(LGF) {
-  DCHECK_OPCODE(LGF);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  intptr_t addr = GET_ADDRESS(x2, b2, d2);
-  int64_t mem_val = static_cast<int64_t>(ReadW(addr, instr));
-  set_register(r1, mem_val);
-  return length;
-}
-
-EVALUATE(ST) {
-  DCHECK_OPCODE(ST);
-  DECODE_RX_A_INSTRUCTION(x2, b2, r1, d2_val);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t addr = b2_val + x2_val + d2_val;
-  WriteW(addr, r1_val, instr);
-  return length;
-}
-
-EVALUATE(STG) {
-  DCHECK_OPCODE(STG);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  intptr_t addr = GET_ADDRESS(x2, b2, d2);
-  uint64_t value = get_register(r1);
-  WriteDW(addr, value);
-  return length;
-}
-
-EVALUATE(STY) {
-  DCHECK_OPCODE(STY);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  intptr_t addr = GET_ADDRESS(x2, b2, d2);
-  uint32_t value = get_low_register<uint32_t>(r1);
-  WriteW(addr, value, instr);
-  return length;
-}
-
-EVALUATE(LY) {
-  DCHECK_OPCODE(LY);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  intptr_t addr = GET_ADDRESS(x2, b2, d2);
-  uint32_t mem_val = ReadWU(addr, instr);
-  set_low_register(r1, mem_val);
-  return length;
-}
-
-EVALUATE(LLGC) {
-  DCHECK_OPCODE(LLGC);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  uint8_t mem_val = ReadBU(GET_ADDRESS(x2, b2, d2));
-  set_register(r1, static_cast<uint64_t>(mem_val));
-  return length;
-}
-
-EVALUATE(LLC) {
-  DCHECK_OPCODE(LLC);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  uint8_t mem_val = ReadBU(GET_ADDRESS(x2, b2, d2));
-  set_low_register(r1, static_cast<uint32_t>(mem_val));
-  return length;
-}
-
-EVALUATE(RLL) {
-  DCHECK_OPCODE(RLL);
-  DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2);
-  // only takes rightmost 6 bits
-  int shiftBits = GET_ADDRESS(0, b2, d2) & 0x3F;
-  // unsigned
-  uint32_t r3_val = get_low_register<uint32_t>(r3);
-  uint32_t alu_out = 0;
-  uint32_t rotateBits = r3_val >> (32 - shiftBits);
-  alu_out = (r3_val << shiftBits) | (rotateBits);
-  set_low_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(RISBG) {
-  DCHECK_OPCODE(RISBG);
-  DECODE_RIE_F_INSTRUCTION(r1, r2, i3, i4, i5);
-  // Starting Bit Position is Bits 2-7 of I3 field
-  uint32_t start_bit = i3 & 0x3F;
-  // Ending Bit Position is Bits 2-7 of I4 field
-  uint32_t end_bit = i4 & 0x3F;
-  // Shift Amount is Bits 2-7 of I5 field
-  uint32_t shift_amount = i5 & 0x3F;
-  // Zero out Remaining (unslected) bits if Bit 0 of I4 is 1.
-  bool zero_remaining = (0 != (i4 & 0x80));
-
-  uint64_t src_val = get_register(r2);
-
-  // Rotate Left by Shift Amount first
-  uint64_t rotated_val =
-      (src_val << shift_amount) | (src_val >> (64 - shift_amount));
-  int32_t width = end_bit - start_bit + 1;
-
-  uint64_t selection_mask = 0;
-  if (width < 64) {
-    selection_mask = (static_cast<uint64_t>(1) << width) - 1;
-  } else {
-    selection_mask = static_cast<uint64_t>(static_cast<int64_t>(-1));
-  }
-  selection_mask = selection_mask << (63 - end_bit);
-
-  uint64_t selected_val = rotated_val & selection_mask;
-
-  if (!zero_remaining) {
-    // Merged the unselected bits from the original value
-    selected_val = (get_register(r1) & ~selection_mask) | selected_val;
-  }
-
-  // Condition code is set by treating result as 64-bit signed int
-  SetS390ConditionCode<int64_t>(selected_val, 0);
-  set_register(r1, selected_val);
-  return length;
-}
-
-EVALUATE(AHIK) {
-  DCHECK_OPCODE(AHIK);
-  DECODE_RIE_D_INSTRUCTION(r1, r2, i2);
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  int32_t imm = static_cast<int32_t>(i2);
-  bool isOF = CheckOverflowForIntAdd(r2_val, imm, int32_t);
-  set_low_register(r1, r2_val + imm);
-  SetS390ConditionCode<int32_t>(r2_val + imm, 0);
-  SetS390OverflowCode(isOF);
-  return length;
-}
-
-EVALUATE(AGHIK) {
-  // 64-bit Add
-  DCHECK_OPCODE(AGHIK);
-  DECODE_RIE_D_INSTRUCTION(r1, r2, i2);
-  int64_t r2_val = get_register(r2);
-  int64_t imm = static_cast<int64_t>(i2);
-  bool isOF = CheckOverflowForIntAdd(r2_val, imm, int64_t);
-  set_register(r1, r2_val + imm);
-  SetS390ConditionCode<int64_t>(r2_val + imm, 0);
-  SetS390OverflowCode(isOF);
-  return length;
-}
-
-EVALUATE(BKPT) {
-  DCHECK_OPCODE(BKPT);
-  set_pc(get_pc() + 2);
-  S390Debugger dbg(this);
-  dbg.Debug();
-  int length = 2;
-  return length;
-}
-
-EVALUATE(SPM) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(BALR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(BCTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(BCR) {
-  DCHECK_OPCODE(BCR);
-  DECODE_RR_INSTRUCTION(r1, r2);
-  if (TestConditionCode(Condition(r1))) {
-    intptr_t r2_val = get_register(r2);
-#if (!V8_TARGET_ARCH_S390X && V8_HOST_ARCH_S390)
-    // On 31-bit, the top most bit may be 0 or 1, but is ignored by the
-    // hardware.  Cleanse the top bit before jumping to it, unless it's one
-    // of the special PCs
-    if (r2_val != bad_lr && r2_val != end_sim_pc) r2_val &= 0x7FFFFFFF;
-#endif
-    set_pc(r2_val);
-  }
-
-  return length;
-}
-
-EVALUATE(SVC) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(BSM) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(BASSM) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(BASR) {
-  DCHECK_OPCODE(BASR);
-  DECODE_RR_INSTRUCTION(r1, r2);
-  intptr_t link_addr = get_pc() + 2;
-  // If R2 is zero, the BASR does not branch.
-  int64_t r2_val = (r2 == 0) ? link_addr : get_register(r2);
-#if (!V8_TARGET_ARCH_S390X && V8_HOST_ARCH_S390)
-  // On 31-bit, the top most bit may be 0 or 1, which can cause issues
-  // for stackwalker.  The top bit should either be cleanse before being
-  // pushed onto the stack, or during stack walking when dereferenced.
-  // For simulator, we'll take the worst case scenario and always tag
-  // the high bit, to flush out more problems.
-  link_addr |= 0x80000000;
-#endif
-  set_register(r1, link_addr);
-  set_pc(r2_val);
-  return length;
-}
-
-EVALUATE(MVCL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CLCL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LPR) {
-  DCHECK_OPCODE(LPR);
-  // Load Positive (32)
-  DECODE_RR_INSTRUCTION(r1, r2);
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  // If negative, then negate it.
-  r2_val = (r2_val < 0) ? -r2_val : r2_val;
-  set_low_register(r1, r2_val);
-  SetS390ConditionCode<int32_t>(r2_val, 0);
-  if (r2_val == (static_cast<int32_t>(1) << 31)) {
-    SetS390OverflowCode(true);
-  }
-  return length;
-}
-
-EVALUATE(LNR) {
-  DCHECK_OPCODE(LNR);
-  // Load Negative (32)
-  DECODE_RR_INSTRUCTION(r1, r2);
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  r2_val = (r2_val >= 0) ? -r2_val : r2_val;  // If pos, then negate it.
-  set_low_register(r1, r2_val);
-  condition_reg_ = (r2_val == 0) ? CC_EQ : CC_LT;  // CC0 - result is zero
-  // CC1 - result is negative
-  return length;
-}
-
-EVALUATE(LTR) {
-  DCHECK_OPCODE(LTR);
-  DECODE_RR_INSTRUCTION(r1, r2);
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  SetS390ConditionCode<int32_t>(r2_val, 0);
-  set_low_register(r1, r2_val);
-  return length;
-}
-
-EVALUATE(LCR) {
-  DCHECK_OPCODE(LCR);
-  DECODE_RR_INSTRUCTION(r1, r2);
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  int32_t result = 0;
-  bool isOF = false;
-  isOF = __builtin_ssub_overflow(0, r2_val, &result);
-  set_low_register(r1, result);
-  SetS390ConditionCode<int32_t>(r2_val, 0);
-  // Checks for overflow where r2_val = -2147483648.
-  // Cannot do int comparison due to GCC 4.8 bug on x86.
-  // Detect INT_MIN alternatively, as it is the only value where both
-  // original and result are negative due to overflow.
-  if (isOF) {
-    SetS390OverflowCode(true);
-  }
-  return length;
-}
-
-EVALUATE(NR) {
-  DCHECK_OPCODE(NR);
-  DECODE_RR_INSTRUCTION(r1, r2);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  r1_val &= r2_val;
-  SetS390BitWiseConditionCode<uint32_t>(r1_val);
-  set_low_register(r1, r1_val);
-  return length;
-}
-
-EVALUATE(OR) {
-  DCHECK_OPCODE(OR);
-  DECODE_RR_INSTRUCTION(r1, r2);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  r1_val |= r2_val;
-  SetS390BitWiseConditionCode<uint32_t>(r1_val);
-  set_low_register(r1, r1_val);
-  return length;
-}
-
-EVALUATE(XR) {
-  DCHECK_OPCODE(XR);
-  DECODE_RR_INSTRUCTION(r1, r2);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  r1_val ^= r2_val;
-  SetS390BitWiseConditionCode<uint32_t>(r1_val);
-  set_low_register(r1, r1_val);
-  return length;
-}
-
-EVALUATE(CR) {
-  DCHECK_OPCODE(CR);
-  DECODE_RR_INSTRUCTION(r1, r2);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  SetS390ConditionCode<int32_t>(r1_val, r2_val);
-  return length;
-}
-
-EVALUATE(SR) {
-  DCHECK_OPCODE(SR);
-  DECODE_RR_INSTRUCTION(r1, r2);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  bool isOF = false;
-  isOF = CheckOverflowForIntSub(r1_val, r2_val, int32_t);
-  r1_val -= r2_val;
-  SetS390ConditionCode<int32_t>(r1_val, 0);
-  SetS390OverflowCode(isOF);
-  set_low_register(r1, r1_val);
-  return length;
-}
-
-EVALUATE(MR) {
-  DCHECK_OPCODE(MR);
-  DECODE_RR_INSTRUCTION(r1, r2);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  DCHECK_EQ(r1 % 2, 0);
-  r1_val = get_low_register<int32_t>(r1 + 1);
-  int64_t product = static_cast<int64_t>(r1_val) * static_cast<int64_t>(r2_val);
-  int32_t high_bits = product >> 32;
-  r1_val = high_bits;
-  int32_t low_bits = product & 0x00000000FFFFFFFF;
-  set_low_register(r1, high_bits);
-  set_low_register(r1 + 1, low_bits);
-  return length;
-}
-
-EVALUATE(DR) {
-  DCHECK_OPCODE(DR);
-  DECODE_RR_INSTRUCTION(r1, r2);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  // reg-reg pair should be even-odd pair, assert r1 is an even register
-  DCHECK_EQ(r1 % 2, 0);
-  // leftmost 32 bits of the dividend are in r1
-  // rightmost 32 bits of the dividend are in r1+1
-  // get the signed value from r1
-  int64_t dividend = static_cast<int64_t>(r1_val) << 32;
-  // get unsigned value from r1+1
-  // avoid addition with sign-extended r1+1 value
-  dividend += get_low_register<uint32_t>(r1 + 1);
-  int32_t remainder = dividend % r2_val;
-  int32_t quotient = dividend / r2_val;
-  r1_val = remainder;
-  set_low_register(r1, remainder);
-  set_low_register(r1 + 1, quotient);
-  set_low_register(r1, r1_val);
-  return length;
-}
-
-EVALUATE(ALR) {
-  DCHECK_OPCODE(ALR);
-  DECODE_RR_INSTRUCTION(r1, r2);
-  uint32_t r1_val = get_low_register<uint32_t>(r1);
-  uint32_t r2_val = get_low_register<uint32_t>(r2);
-  uint32_t alu_out = 0;
-  bool isOF = false;
-  alu_out = r1_val + r2_val;
-  isOF = CheckOverflowForUIntAdd(r1_val, r2_val);
-  set_low_register(r1, alu_out);
-  SetS390ConditionCodeCarry<uint32_t>(alu_out, isOF);
-  return length;
-}
-
-EVALUATE(SLR) {
-  DCHECK_OPCODE(SLR);
-  DECODE_RR_INSTRUCTION(r1, r2);
-  uint32_t r1_val = get_low_register<uint32_t>(r1);
-  uint32_t r2_val = get_low_register<uint32_t>(r2);
-  uint32_t alu_out = 0;
-  bool isOF = false;
-  alu_out = r1_val - r2_val;
-  isOF = CheckOverflowForUIntSub(r1_val, r2_val);
-  set_low_register(r1, alu_out);
-  SetS390ConditionCodeCarry<uint32_t>(alu_out, isOF);
-  return length;
-}
-
-EVALUATE(LDR) {
-  DCHECK_OPCODE(LDR);
-  DECODE_RR_INSTRUCTION(r1, r2);
-  int64_t r2_val = get_d_register(r2);
-  set_d_register(r1, r2_val);
-  return length;
-}
-
-EVALUATE(CDR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LER) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(STH) {
-  DCHECK_OPCODE(STH);
-  DECODE_RX_A_INSTRUCTION(x2, b2, r1, d2_val);
-  int16_t r1_val = get_low_register<int32_t>(r1);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t mem_addr = b2_val + x2_val + d2_val;
-  WriteH(mem_addr, r1_val, instr);
-
-  return length;
-}
-
-EVALUATE(LA) {
-  DCHECK_OPCODE(LA);
-  DECODE_RX_A_INSTRUCTION(x2, b2, r1, d2_val);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t addr = b2_val + x2_val + d2_val;
-  set_register(r1, addr);
-  return length;
-}
-
-EVALUATE(STC) {
-  DCHECK_OPCODE(STC);
-  // Store Character/Byte
-  DECODE_RX_A_INSTRUCTION(x2, b2, r1, d2_val);
-  uint8_t r1_val = get_low_register<int32_t>(r1);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t mem_addr = b2_val + x2_val + d2_val;
-  WriteB(mem_addr, r1_val);
-  return length;
-}
-
-EVALUATE(IC_z) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(EX) {
-  DCHECK_OPCODE(EX);
-  DECODE_RX_A_INSTRUCTION(x2, b2, r1, d2_val);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-
-  SixByteInstr the_instr = Instruction::InstructionBits(
-      reinterpret_cast<const byte*>(b2_val + x2_val + d2_val));
-  int inst_length = Instruction::InstructionLength(
-      reinterpret_cast<const byte*>(b2_val + x2_val + d2_val));
-
-  char new_instr_buf[8];
-  char* addr = reinterpret_cast<char*>(&new_instr_buf[0]);
-  the_instr |= static_cast<SixByteInstr>(r1_val & 0xFF)
-               << (8 * inst_length - 16);
-  Instruction::SetInstructionBits<SixByteInstr>(
-      reinterpret_cast<byte*>(addr), static_cast<SixByteInstr>(the_instr));
-  ExecuteInstruction(reinterpret_cast<Instruction*>(addr), false);
-  return length;
-}
-
-EVALUATE(BAL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(BCT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(BC) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LH) {
-  DCHECK_OPCODE(LH);
-  // Load Halfword
-  DECODE_RX_A_INSTRUCTION(x2, b2, r1, d2_val);
-
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  intptr_t mem_addr = x2_val + b2_val + d2_val;
-
-  int32_t result = static_cast<int32_t>(ReadH(mem_addr, instr));
-  set_low_register(r1, result);
-  return length;
-}
-
-EVALUATE(CH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(AH) {
-  DCHECK_OPCODE(AH);
-  DECODE_RX_A_INSTRUCTION(x2, b2, r1, d2_val);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t addr = b2_val + x2_val + d2_val;
-  int32_t mem_val = static_cast<int32_t>(ReadH(addr, instr));
-  int32_t alu_out = 0;
-  bool isOF = false;
-  isOF = CheckOverflowForIntAdd(r1_val, mem_val, int32_t);
-  alu_out = r1_val + mem_val;
-  set_low_register(r1, alu_out);
-  SetS390ConditionCode<int32_t>(alu_out, 0);
-  SetS390OverflowCode(isOF);
-
-  return length;
-}
-
-EVALUATE(SH) {
-  DCHECK_OPCODE(SH);
-  DECODE_RX_A_INSTRUCTION(x2, b2, r1, d2_val);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t addr = b2_val + x2_val + d2_val;
-  int32_t mem_val = static_cast<int32_t>(ReadH(addr, instr));
-  int32_t alu_out = 0;
-  bool isOF = false;
-  isOF = CheckOverflowForIntSub(r1_val, mem_val, int32_t);
-  alu_out = r1_val - mem_val;
-  SetS390ConditionCode<int32_t>(alu_out, 0);
-  SetS390OverflowCode(isOF);
-
-  return length;
-}
-
-EVALUATE(MH) {
-  DCHECK_OPCODE(MH);
-  DECODE_RX_A_INSTRUCTION(x2, b2, r1, d2_val);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t addr = b2_val + x2_val + d2_val;
-  int32_t mem_val = static_cast<int32_t>(ReadH(addr, instr));
-  int32_t alu_out = 0;
-  alu_out = r1_val * mem_val;
-  set_low_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(BAS) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CVD) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CVB) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LAE) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(N) {
-  DCHECK_OPCODE(N);
-  // 32-bit Reg-Mem instructions
-  DECODE_RX_A_INSTRUCTION(x2, b2, r1, d2_val);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int32_t mem_val = ReadW(b2_val + x2_val + d2_val, instr);
-  int32_t alu_out = 0;
-  alu_out = r1_val & mem_val;
-  SetS390BitWiseConditionCode<uint32_t>(alu_out);
-  set_low_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(CL) {
-  DCHECK_OPCODE(CL);
-  DECODE_RX_A_INSTRUCTION(x2, b2, r1, d2_val);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t addr = b2_val + x2_val + d2_val;
-  int32_t mem_val = ReadW(addr, instr);
-  SetS390ConditionCode<uint32_t>(r1_val, mem_val);
-  return length;
-}
-
-EVALUATE(O) {
-  DCHECK_OPCODE(O);
-  // 32-bit Reg-Mem instructions
-  DECODE_RX_A_INSTRUCTION(x2, b2, r1, d2_val);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int32_t mem_val = ReadW(b2_val + x2_val + d2_val, instr);
-  int32_t alu_out = 0;
-  alu_out = r1_val | mem_val;
-  SetS390BitWiseConditionCode<uint32_t>(alu_out);
-  set_low_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(X) {
-  DCHECK_OPCODE(X);
-  // 32-bit Reg-Mem instructions
-  DECODE_RX_A_INSTRUCTION(x2, b2, r1, d2_val);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int32_t mem_val = ReadW(b2_val + x2_val + d2_val, instr);
-  int32_t alu_out = 0;
-  alu_out = r1_val ^ mem_val;
-  SetS390BitWiseConditionCode<uint32_t>(alu_out);
-  set_low_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(C) {
-  DCHECK_OPCODE(C);
-  DECODE_RX_A_INSTRUCTION(x2, b2, r1, d2_val);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t addr = b2_val + x2_val + d2_val;
-  int32_t mem_val = ReadW(addr, instr);
-  SetS390ConditionCode<int32_t>(r1_val, mem_val);
-  return length;
-}
-
-EVALUATE(A) {
-  DCHECK_OPCODE(A);
-  // 32-bit Reg-Mem instructions
-  DECODE_RX_A_INSTRUCTION(x2, b2, r1, d2_val);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int32_t mem_val = ReadW(b2_val + x2_val + d2_val, instr);
-  int32_t alu_out = 0;
-  bool isOF = false;
-  isOF = CheckOverflowForIntAdd(r1_val, mem_val, int32_t);
-  alu_out = r1_val + mem_val;
-  SetS390ConditionCode<int32_t>(alu_out, 0);
-  SetS390OverflowCode(isOF);
-  set_low_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(S) {
-  DCHECK_OPCODE(S);
-  // 32-bit Reg-Mem instructions
-  DECODE_RX_A_INSTRUCTION(x2, b2, r1, d2_val);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int32_t mem_val = ReadW(b2_val + x2_val + d2_val, instr);
-  int32_t alu_out = 0;
-  bool isOF = false;
-  isOF = CheckOverflowForIntSub(r1_val, mem_val, int32_t);
-  alu_out = r1_val - mem_val;
-  SetS390ConditionCode<int32_t>(alu_out, 0);
-  SetS390OverflowCode(isOF);
-  set_low_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(M) {
-  DCHECK_OPCODE(M);
-  DECODE_RX_A_INSTRUCTION(x2, b2, r1, d2_val);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t addr = b2_val + x2_val + d2_val;
-  DCHECK_EQ(r1 % 2, 0);
-  int32_t mem_val = ReadW(addr, instr);
-  int32_t r1_val = get_low_register<int32_t>(r1 + 1);
-  int64_t product =
-      static_cast<int64_t>(r1_val) * static_cast<int64_t>(mem_val);
-  int32_t high_bits = product >> 32;
-  r1_val = high_bits;
-  int32_t low_bits = product & 0x00000000FFFFFFFF;
-  set_low_register(r1, high_bits);
-  set_low_register(r1 + 1, low_bits);
-  return length;
-}
-
-EVALUATE(D) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(AL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(STD) {
-  DCHECK_OPCODE(STD);
-  DECODE_RX_A_INSTRUCTION(x2, b2, r1, d2_val);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t addr = b2_val + x2_val + d2_val;
-  int64_t frs_val = get_d_register(r1);
-  WriteDW(addr, frs_val);
-  return length;
-}
-
-EVALUATE(LD) {
-  DCHECK_OPCODE(LD);
-  DECODE_RX_A_INSTRUCTION(x2, b2, r1, d2_val);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t addr = b2_val + x2_val + d2_val;
-  int64_t dbl_val = *reinterpret_cast<int64_t*>(addr);
-  set_d_register(r1, dbl_val);
-  return length;
-}
-
-EVALUATE(CD) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(STE) {
-  DCHECK_OPCODE(STE);
-  DECODE_RX_A_INSTRUCTION(x2, b2, r1, d2_val);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t addr = b2_val + x2_val + d2_val;
-  int64_t frs_val = get_d_register(r1) >> 32;
-  WriteW(addr, static_cast<int32_t>(frs_val), instr);
-  return length;
-}
-
-EVALUATE(MS) {
-  DCHECK_OPCODE(MS);
-  DECODE_RX_A_INSTRUCTION(x2, b2, r1, d2_val);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int32_t mem_val = ReadW(b2_val + x2_val + d2_val, instr);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  set_low_register(r1, r1_val * mem_val);
-  return length;
-}
-
-EVALUATE(LE) {
-  DCHECK_OPCODE(LE);
-  DECODE_RX_A_INSTRUCTION(x2, b2, r1, d2_val);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t addr = b2_val + x2_val + d2_val;
-  float float_val = *reinterpret_cast<float*>(addr);
-  set_d_register_from_float32(r1, float_val);
-  return length;
-}
-
-EVALUATE(BRXH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(BRXLE) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(BXH) {
-  DCHECK_OPCODE(BXH);
-  DECODE_RS_A_INSTRUCTION(r1, r3, b2, d2);
-
-  // r1_val is the first operand, r3_val is the increment
-  int32_t r1_val = (r1 == 0) ? 0 : get_register(r1);
-  int32_t r3_val = (r3 == 0) ? 0 : get_register(r3);
-  intptr_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  intptr_t branch_address = b2_val + d2;
-  // increment r1_val
-  r1_val += r3_val;
-
-  // if the increment is even, then it designates a pair of registers
-  // and the contents of the even and odd registers of the pair are used as
-  // the increment and compare value respectively. If the increment is odd,
-  // the increment itself is used as both the increment and compare value
-  int32_t compare_val = r3 % 2 == 0 ? get_register(r3 + 1) : r3_val;
-  if (r1_val > compare_val) {
-    // branch to address if r1_val is greater than compare value
-    set_pc(branch_address);
-  }
-
-  // update contents of register in r1 with the new incremented value
-  set_register(r1, r1_val);
-
-  return length;
-}
-
-EVALUATE(BXLE) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SRL) {
-  DCHECK_OPCODE(SRL);
-  DECODE_RS_A_INSTRUCTION_NO_R3(r1, b2, d2);
-  // only takes rightmost 6bits
-  int64_t b2_val = b2 == 0 ? 0 : get_register(b2);
-  int shiftBits = (b2_val + d2) & 0x3F;
-  uint32_t r1_val = get_low_register<uint32_t>(r1);
-  uint32_t alu_out = 0;
-  alu_out = r1_val >> shiftBits;
-  set_low_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(SLL) {
-  DCHECK_OPCODE(SLL);
-  DECODE_RS_A_INSTRUCTION_NO_R3(r1, b2, d2)
-  // only takes rightmost 6bits
-  int64_t b2_val = b2 == 0 ? 0 : get_register(b2);
-  int shiftBits = (b2_val + d2) & 0x3F;
-  uint32_t r1_val = get_low_register<uint32_t>(r1);
-  uint32_t alu_out = 0;
-  alu_out = r1_val << shiftBits;
-  set_low_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(SRA) {
-  DCHECK_OPCODE(SRA);
-  DECODE_RS_A_INSTRUCTION_NO_R3(r1, b2, d2);
-  // only takes rightmost 6bits
-  int64_t b2_val = b2 == 0 ? 0 : get_register(b2);
-  int shiftBits = (b2_val + d2) & 0x3F;
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int32_t alu_out = 0;
-  bool isOF = false;
-  alu_out = r1_val >> shiftBits;
-  set_low_register(r1, alu_out);
-  SetS390ConditionCode<int32_t>(alu_out, 0);
-  SetS390OverflowCode(isOF);
-  return length;
-}
-
-EVALUATE(SLA) {
-  DCHECK_OPCODE(SLA);
-  DECODE_RS_A_INSTRUCTION_NO_R3(r1, b2, d2);
-  // only takes rightmost 6bits
-  int64_t b2_val = b2 == 0 ? 0 : get_register(b2);
-  int shiftBits = (b2_val + d2) & 0x3F;
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int32_t alu_out = 0;
-  bool isOF = false;
-  isOF = CheckOverflowForShiftLeft(r1_val, shiftBits);
-  alu_out = r1_val << shiftBits;
-  set_low_register(r1, alu_out);
-  SetS390ConditionCode<int32_t>(alu_out, 0);
-  SetS390OverflowCode(isOF);
-  return length;
-}
-
-EVALUATE(SRDL) {
-  DCHECK_OPCODE(SRDL);
-  DECODE_RS_A_INSTRUCTION_NO_R3(r1, b2, d2);
-  DCHECK_EQ(r1 % 2, 0);  // must be a reg pair
-  // only takes rightmost 6bits
-  int64_t b2_val = b2 == 0 ? 0 : get_register(b2);
-  int shiftBits = (b2_val + d2) & 0x3F;
-  uint64_t opnd1 = static_cast<uint64_t>(get_low_register<uint32_t>(r1)) << 32;
-  uint64_t opnd2 = static_cast<uint64_t>(get_low_register<uint32_t>(r1 + 1));
-  uint64_t r1_val = opnd1 | opnd2;
-  uint64_t alu_out = r1_val >> shiftBits;
-  set_low_register(r1, alu_out >> 32);
-  set_low_register(r1 + 1, alu_out & 0x00000000FFFFFFFF);
-  SetS390ConditionCode<int32_t>(alu_out, 0);
-  return length;
-}
-
-EVALUATE(SLDL) {
-  DCHECK_OPCODE(SLDL);
-  DECODE_RS_A_INSTRUCTION_NO_R3(r1, b2, d2);
-  // only takes rightmost 6bits
-  int64_t b2_val = b2 == 0 ? 0 : get_register(b2);
-  int shiftBits = (b2_val + d2) & 0x3F;
-
-  DCHECK_EQ(r1 % 2, 0);
-  uint32_t r1_val = get_low_register<uint32_t>(r1);
-  uint32_t r1_next_val = get_low_register<uint32_t>(r1 + 1);
-  uint64_t alu_out = (static_cast<uint64_t>(r1_val) << 32) |
-                     (static_cast<uint64_t>(r1_next_val));
-  alu_out <<= shiftBits;
-  set_low_register(r1 + 1, static_cast<uint32_t>(alu_out));
-  set_low_register(r1, static_cast<uint32_t>(alu_out >> 32));
-  return length;
-}
-
-EVALUATE(SRDA) {
-  DCHECK_OPCODE(SRDA);
-  DECODE_RS_A_INSTRUCTION_NO_R3(r1, b2, d2);
-  DCHECK_EQ(r1 % 2, 0);  // must be a reg pair
-  // only takes rightmost 6bits
-  int64_t b2_val = b2 == 0 ? 0 : get_register(b2);
-  int shiftBits = (b2_val + d2) & 0x3F;
-  int64_t opnd1 = static_cast<int64_t>(get_low_register<int32_t>(r1)) << 32;
-  int64_t opnd2 = static_cast<uint64_t>(get_low_register<uint32_t>(r1 + 1));
-  int64_t r1_val = opnd1 + opnd2;
-  int64_t alu_out = r1_val >> shiftBits;
-  set_low_register(r1, alu_out >> 32);
-  set_low_register(r1 + 1, alu_out & 0x00000000FFFFFFFF);
-  SetS390ConditionCode<int32_t>(alu_out, 0);
-  return length;
-}
-
-EVALUATE(SLDA) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(STM) {
-  DCHECK_OPCODE(STM);
-  DECODE_RS_A_INSTRUCTION(r1, r3, rb, d2);
-  // Store Multiple 32-bits.
-  int offset = d2;
-  // Regs roll around if r3 is less than r1.
-  // Artificially increase r3 by 16 so we can calculate
-  // the number of regs stored properly.
-  if (r3 < r1) r3 += 16;
-
-  int32_t rb_val = (rb == 0) ? 0 : get_low_register<int32_t>(rb);
-
-  // Store each register in ascending order.
-  for (int i = 0; i <= r3 - r1; i++) {
-    int32_t value = get_low_register<int32_t>((r1 + i) % 16);
-    WriteW(rb_val + offset + 4 * i, value, instr);
-  }
-  return length;
-}
-
-EVALUATE(TM) {
-  DCHECK_OPCODE(TM);
-  // Test Under Mask (Mem - Imm) (8)
-  DECODE_SI_INSTRUCTION_I_UINT8(b1, d1_val, imm_val)
-  int64_t b1_val = (b1 == 0) ? 0 : get_register(b1);
-  intptr_t addr = b1_val + d1_val;
-  uint8_t mem_val = ReadB(addr);
-  uint8_t selected_bits = mem_val & imm_val;
-  // CC0: Selected bits are zero
-  // CC1: Selected bits mixed zeros and ones
-  // CC3: Selected bits all ones
-  if (0 == selected_bits) {
-    condition_reg_ = CC_EQ;  // CC0
-  } else if (selected_bits == imm_val) {
-    condition_reg_ = 0x1;  // CC3
-  } else {
-    condition_reg_ = 0x4;  // CC1
-  }
-  return length;
-}
-
-EVALUATE(MVI) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TS) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(NI) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CLI) {
-  DCHECK_OPCODE(CLI);
-  // Compare Immediate (Mem - Imm) (8)
-  DECODE_SI_INSTRUCTION_I_UINT8(b1, d1_val, imm_val)
-  int64_t b1_val = (b1 == 0) ? 0 : get_register(b1);
-  intptr_t addr = b1_val + d1_val;
-  uint8_t mem_val = ReadB(addr);
-  SetS390ConditionCode<uint8_t>(mem_val, imm_val);
-  return length;
-}
-
-EVALUATE(OI) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(XI) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LM) {
-  DCHECK_OPCODE(LM);
-  DECODE_RS_A_INSTRUCTION(r1, r3, rb, d2);
-  // Store Multiple 32-bits.
-  int offset = d2;
-  // Regs roll around if r3 is less than r1.
-  // Artificially increase r3 by 16 so we can calculate
-  // the number of regs stored properly.
-  if (r3 < r1) r3 += 16;
-
-  int32_t rb_val = (rb == 0) ? 0 : get_low_register<int32_t>(rb);
-
-  // Store each register in ascending order.
-  for (int i = 0; i <= r3 - r1; i++) {
-    int32_t value = ReadW(rb_val + offset + 4 * i, instr);
-    set_low_register((r1 + i) % 16, value);
-  }
-  return length;
-}
-
-EVALUATE(MVCLE) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CLCLE) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MC) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CDS) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(STCM) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(ICM) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(BPRP) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(BPP) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TRTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MVN) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MVC) {
-  DCHECK_OPCODE(MVC);
-  // Move Character
-  SSInstruction* ssInstr = reinterpret_cast<SSInstruction*>(instr);
-  int b1 = ssInstr->B1Value();
-  intptr_t d1 = ssInstr->D1Value();
-  int b2 = ssInstr->B2Value();
-  intptr_t d2 = ssInstr->D2Value();
-  int length = ssInstr->Length();
-  int64_t b1_val = (b1 == 0) ? 0 : get_register(b1);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  intptr_t src_addr = b2_val + d2;
-  intptr_t dst_addr = b1_val + d1;
-  // remember that the length is the actual length - 1
-  for (int i = 0; i < length + 1; ++i) {
-    WriteB(dst_addr++, ReadB(src_addr++));
-  }
-  length = 6;
-  return length;
-}
-
-EVALUATE(MVZ) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(NC) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CLC) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(OC) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(XC) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MVCP) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TRT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(ED) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(EDMK) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(PKU) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(UNPKU) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MVCIN) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(PKA) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(UNPKA) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(PLO) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LMD) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SRP) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MVO) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(PACK) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(UNPK) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(ZAP) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(AP) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SP) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MP) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(DP) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(UPT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(PFPO) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(IIHH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(IIHL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(IILH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(IILL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(NIHH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(NIHL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(NILH) {
-  DCHECK_OPCODE(NILH);
-  DECODE_RI_A_INSTRUCTION(instr, r1, i);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  // CC is set based on the 16 bits that are AND'd
-  SetS390BitWiseConditionCode<uint16_t>((r1_val >> 16) & i);
-  i = (i << 16) | 0x0000FFFF;
-  set_low_register(r1, r1_val & i);
-  return length;
-}
-
-EVALUATE(NILL) {
-  DCHECK_OPCODE(NILL);
-  DECODE_RI_A_INSTRUCTION(instr, r1, i);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  // CC is set based on the 16 bits that are AND'd
-  SetS390BitWiseConditionCode<uint16_t>(r1_val & i);
-  i |= 0xFFFF0000;
-  set_low_register(r1, r1_val & i);
-  return length;
-}
-
-EVALUATE(OIHH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(OIHL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(OILH) {
-  DCHECK_OPCODE(OILH);
-  DECODE_RI_A_INSTRUCTION(instr, r1, i);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  // CC is set based on the 16 bits that are AND'd
-  SetS390BitWiseConditionCode<uint16_t>((r1_val >> 16) | i);
-  i = i << 16;
-  set_low_register(r1, r1_val | i);
-  return length;
-}
-
-EVALUATE(OILL) {
-  DCHECK_OPCODE(OILL);
-  DECODE_RI_A_INSTRUCTION(instr, r1, i);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  // CC is set based on the 16 bits that are AND'd
-  SetS390BitWiseConditionCode<uint16_t>(r1_val | i);
-  set_low_register(r1, r1_val | i);
-  return length;
-}
-
-EVALUATE(LLIHH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LLIHL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LLILH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LLILL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TMLH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TMLL) {
-  DCHECK_OPCODE(TMLL);
-  DECODE_RI_A_INSTRUCTION(instr, r1, i2);
-  uint32_t mask = i2 & 0x0000FFFF;
-  uint32_t r1_val = get_low_register<uint32_t>(r1);
-  r1_val = r1_val & 0x0000FFFF;  // uses only the last 16bits
-
-  // Test if all selected bits are zeros or mask is zero
-  if (0 == (mask & r1_val)) {
-    condition_reg_ = 0x8;
-    return length;  // Done!
-  }
-
-  DCHECK_NE(mask, 0);
-  // Test if all selected bits are one
-  if (mask == (mask & r1_val)) {
-    condition_reg_ = 0x1;
-    return length;  // Done!
-  }
-
-  // Now we know selected bits mixed zeros and ones
-  // Test if the leftmost bit is zero or one
-#if defined(__GNUC__)
-  int leadingZeros = __builtin_clz(mask);
-  mask = 0x80000000u >> leadingZeros;
-  if (mask & r1_val) {
-    // leftmost bit is one
-    condition_reg_ = 0x2;
-  } else {
-    // leftmost bit is zero
-    condition_reg_ = 0x4;
-  }
-  return length;  // Done!
-#else
-  for (int i = 15; i >= 0; i--) {
-    if (mask & (1 << i)) {
-      if (r1_val & (1 << i)) {
-        // leftmost bit is one
-        condition_reg_ = 0x2;
-      } else {
-        // leftmost bit is zero
-        condition_reg_ = 0x4;
-      }
-      return length;  // Done!
-    }
-  }
-#endif
-  UNREACHABLE();
-}
-
-EVALUATE(TMHH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TMHL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(BRAS) {
-  DCHECK_OPCODE(BRAS);
-  // Branch Relative and Save
-  DECODE_RI_B_INSTRUCTION(instr, r1, d2)
-  intptr_t pc = get_pc();
-  // Set PC of next instruction to register
-  set_register(r1, pc + sizeof(FourByteInstr));
-  // Update PC to branch target
-  set_pc(pc + d2 * 2);
-  return length;
-}
-
-EVALUATE(BRCT) {
-  DCHECK_OPCODE(BRCT);
-  // Branch On Count (32/64).
-  DECODE_RI_A_INSTRUCTION(instr, r1, i2);
-  int64_t value = get_low_register<int32_t>(r1);
-  set_low_register(r1, --value);
-  // Branch if value != 0
-  if (value != 0) {
-    intptr_t offset = i2 * 2;
-    set_pc(get_pc() + offset);
-  }
-  return length;
-}
-
-EVALUATE(BRCTG) {
-  DCHECK_OPCODE(BRCTG);
-  // Branch On Count (32/64).
-  DECODE_RI_A_INSTRUCTION(instr, r1, i2);
-  int64_t value = get_register(r1);
-  set_register(r1, --value);
-  // Branch if value != 0
-  if (value != 0) {
-    intptr_t offset = i2 * 2;
-    set_pc(get_pc() + offset);
-  }
-  return length;
-}
-
-EVALUATE(LHI) {
-  DCHECK_OPCODE(LHI);
-  DECODE_RI_A_INSTRUCTION(instr, r1, i);
-  set_low_register(r1, i);
-  return length;
-}
-
-EVALUATE(LGHI) {
-  DCHECK_OPCODE(LGHI);
-  DECODE_RI_A_INSTRUCTION(instr, r1, i2);
-  int64_t i = static_cast<int64_t>(i2);
-  set_register(r1, i);
-  return length;
-}
-
-EVALUATE(MHI) {
-  DCHECK_OPCODE(MHI);
-  DECODE_RI_A_INSTRUCTION(instr, r1, i);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  bool isOF = false;
-  isOF = CheckOverflowForMul(r1_val, i);
-  r1_val *= i;
-  set_low_register(r1, r1_val);
-  SetS390ConditionCode<int32_t>(r1_val, 0);
-  SetS390OverflowCode(isOF);
-  return length;
-}
-
-EVALUATE(MGHI) {
-  DCHECK_OPCODE(MGHI);
-  DECODE_RI_A_INSTRUCTION(instr, r1, i2);
-  int64_t i = static_cast<int64_t>(i2);
-  int64_t r1_val = get_register(r1);
-  bool isOF = false;
-  isOF = CheckOverflowForMul(r1_val, i);
-  r1_val *= i;
-  set_register(r1, r1_val);
-  SetS390ConditionCode<int32_t>(r1_val, 0);
-  SetS390OverflowCode(isOF);
-  return length;
-}
-
-EVALUATE(CHI) {
-  DCHECK_OPCODE(CHI);
-  DECODE_RI_A_INSTRUCTION(instr, r1, i);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  SetS390ConditionCode<int32_t>(r1_val, i);
-  return length;
-}
-
-EVALUATE(CGHI) {
-  DCHECK_OPCODE(CGHI);
-  DECODE_RI_A_INSTRUCTION(instr, r1, i2);
-  int64_t i = static_cast<int64_t>(i2);
-  int64_t r1_val = get_register(r1);
-  SetS390ConditionCode<int64_t>(r1_val, i);
-  return length;
-}
-
-EVALUATE(LARL) {
-  DCHECK_OPCODE(LARL);
-  DECODE_RIL_B_INSTRUCTION(r1, i2);
-  intptr_t offset = i2 * 2;
-  set_register(r1, get_pc() + offset);
-  return length;
-}
-
-EVALUATE(LGFI) {
-  DCHECK_OPCODE(LGFI);
-  DECODE_RIL_A_INSTRUCTION(r1, imm);
-  set_register(r1, static_cast<int64_t>(static_cast<int32_t>(imm)));
-  return length;
-}
-
-EVALUATE(BRASL) {
-  DCHECK_OPCODE(BRASL);
-  // Branch and Save Relative Long
-  DECODE_RIL_B_INSTRUCTION(r1, i2);
-  intptr_t d2 = i2;
-  intptr_t pc = get_pc();
-  set_register(r1, pc + 6);  // save next instruction to register
-  set_pc(pc + d2 * 2);       // update register
-  return length;
-}
-
-EVALUATE(XIHF) {
-  DCHECK_OPCODE(XIHF);
-  DECODE_RIL_A_INSTRUCTION(r1, imm);
-  uint32_t alu_out = 0;
-  alu_out = get_high_register<uint32_t>(r1);
-  alu_out = alu_out ^ imm;
-  set_high_register(r1, alu_out);
-  SetS390BitWiseConditionCode<uint32_t>(alu_out);
-  return length;
-}
-
-EVALUATE(XILF) {
-  DCHECK_OPCODE(XILF);
-  DECODE_RIL_A_INSTRUCTION(r1, imm);
-  uint32_t alu_out = 0;
-  alu_out = get_low_register<uint32_t>(r1);
-  alu_out = alu_out ^ imm;
-  set_low_register(r1, alu_out);
-  SetS390BitWiseConditionCode<uint32_t>(alu_out);
-  return length;
-}
-
-EVALUATE(NIHF) {
-  DCHECK_OPCODE(NIHF);
-  // Bitwise Op on upper 32-bits
-  DECODE_RIL_A_INSTRUCTION(r1, imm);
-  uint32_t alu_out = get_high_register<uint32_t>(r1);
-  alu_out &= imm;
-  SetS390BitWiseConditionCode<uint32_t>(alu_out);
-  set_high_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(NILF) {
-  DCHECK_OPCODE(NILF);
-  // Bitwise Op on lower 32-bits
-  DECODE_RIL_A_INSTRUCTION(r1, imm);
-  uint32_t alu_out = get_low_register<uint32_t>(r1);
-  alu_out &= imm;
-  SetS390BitWiseConditionCode<uint32_t>(alu_out);
-  set_low_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(OIHF) {
-  DCHECK_OPCODE(OIHF);
-  // Bitwise Op on upper 32-bits
-  DECODE_RIL_B_INSTRUCTION(r1, imm);
-  uint32_t alu_out = get_high_register<uint32_t>(r1);
-  alu_out |= imm;
-  SetS390BitWiseConditionCode<uint32_t>(alu_out);
-  set_high_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(OILF) {
-  DCHECK_OPCODE(OILF);
-  // Bitwise Op on lower 32-bits
-  DECODE_RIL_B_INSTRUCTION(r1, imm);
-  uint32_t alu_out = get_low_register<uint32_t>(r1);
-  alu_out |= imm;
-  SetS390BitWiseConditionCode<uint32_t>(alu_out);
-  set_low_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(LLIHF) {
-  DCHECK_OPCODE(LLIHF);
-  // Load Logical Immediate into high word
-  DECODE_RIL_A_INSTRUCTION(r1, i2);
-  uint64_t imm = static_cast<uint64_t>(i2);
-  set_register(r1, imm << 32);
-  return length;
-}
-
-EVALUATE(LLILF) {
-  DCHECK_OPCODE(LLILF);
-  // Load Logical into lower 32-bits (zero extend upper 32-bits)
-  DECODE_RIL_A_INSTRUCTION(r1, i2);
-  uint64_t imm = static_cast<uint64_t>(i2);
-  set_register(r1, imm);
-  return length;
-}
-
-EVALUATE(MSGFI) {
-  DCHECK_OPCODE(MSGFI);
-  DECODE_RIL_B_INSTRUCTION(r1, i2);
-  int64_t alu_out = get_register(r1);
-  alu_out = alu_out * i2;
-  set_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(MSFI) {
-  DCHECK_OPCODE(MSFI);
-  DECODE_RIL_B_INSTRUCTION(r1, i2);
-  int32_t alu_out = get_low_register<int32_t>(r1);
-  alu_out = alu_out * i2;
-  set_low_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(SLGFI) {
-  DCHECK_OPCODE(SLGFI);
-#ifndef V8_TARGET_ARCH_S390X
-  // should only be called on 64bit
-  DCHECK(false);
-#endif
-  DECODE_RIL_A_INSTRUCTION(r1, i2);
-  uint64_t r1_val = (uint64_t)(get_register(r1));
-  uint64_t alu_out;
-  alu_out = r1_val - i2;
-  set_register(r1, (intptr_t)alu_out);
-  SetS390ConditionCode<uint64_t>(alu_out, 0);
-  return length;
-}
-
-EVALUATE(SLFI) {
-  DCHECK_OPCODE(SLFI);
-  DECODE_RIL_A_INSTRUCTION(r1, imm);
-  uint32_t alu_out = get_low_register<uint32_t>(r1);
-  alu_out -= imm;
-  SetS390ConditionCode<uint32_t>(alu_out, 0);
-  set_low_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(AGFI) {
-  DCHECK_OPCODE(AGFI);
-  // Clobbering Add Word Immediate
-  DECODE_RIL_B_INSTRUCTION(r1, i2_val);
-  bool isOF = false;
-  // 64-bit Add (Register + 32-bit Imm)
-  int64_t r1_val = get_register(r1);
-  int64_t i2 = static_cast<int64_t>(i2_val);
-  isOF = CheckOverflowForIntAdd(r1_val, i2, int64_t);
-  int64_t alu_out = r1_val + i2;
-  set_register(r1, alu_out);
-  SetS390ConditionCode<int64_t>(alu_out, 0);
-  SetS390OverflowCode(isOF);
-  return length;
-}
-
-EVALUATE(AFI) {
-  DCHECK_OPCODE(AFI);
-  // Clobbering Add Word Immediate
-  DECODE_RIL_B_INSTRUCTION(r1, i2);
-  bool isOF = false;
-  // 32-bit Add (Register + 32-bit Immediate)
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  isOF = CheckOverflowForIntAdd(r1_val, i2, int32_t);
-  int32_t alu_out = r1_val + i2;
-  set_low_register(r1, alu_out);
-  SetS390ConditionCode<int32_t>(alu_out, 0);
-  SetS390OverflowCode(isOF);
-  return length;
-}
-
-EVALUATE(ALGFI) {
-  DCHECK_OPCODE(ALGFI);
-#ifndef V8_TARGET_ARCH_S390X
-  // should only be called on 64bit
-  DCHECK(false);
-#endif
-  DECODE_RIL_A_INSTRUCTION(r1, i2);
-  uint64_t r1_val = (uint64_t)(get_register(r1));
-  uint64_t alu_out;
-  alu_out = r1_val + i2;
-  set_register(r1, (intptr_t)alu_out);
-  SetS390ConditionCode<uint64_t>(alu_out, 0);
-
-  return length;
-}
-
-EVALUATE(ALFI) {
-  DCHECK_OPCODE(ALFI);
-  DECODE_RIL_A_INSTRUCTION(r1, imm);
-  uint32_t alu_out = get_low_register<uint32_t>(r1);
-  alu_out += imm;
-  SetS390ConditionCode<uint32_t>(alu_out, 0);
-  set_low_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(CGFI) {
-  DCHECK_OPCODE(CGFI);
-  // Compare with Immediate (64)
-  DECODE_RIL_B_INSTRUCTION(r1, i2);
-  int64_t imm = static_cast<int64_t>(i2);
-  SetS390ConditionCode<int64_t>(get_register(r1), imm);
-  return length;
-}
-
-EVALUATE(CFI) {
-  DCHECK_OPCODE(CFI);
-  // Compare with Immediate (32)
-  DECODE_RIL_B_INSTRUCTION(r1, imm);
-  SetS390ConditionCode<int32_t>(get_low_register<int32_t>(r1), imm);
-  return length;
-}
-
-EVALUATE(CLGFI) {
-  DCHECK_OPCODE(CLGFI);
-  // Compare Logical with Immediate (64)
-  DECODE_RIL_A_INSTRUCTION(r1, i2);
-  uint64_t imm = static_cast<uint64_t>(i2);
-  SetS390ConditionCode<uint64_t>(get_register(r1), imm);
-  return length;
-}
-
-EVALUATE(CLFI) {
-  DCHECK_OPCODE(CLFI);
-  // Compare Logical with Immediate (32)
-  DECODE_RIL_A_INSTRUCTION(r1, imm);
-  SetS390ConditionCode<uint32_t>(get_low_register<uint32_t>(r1), imm);
-  return length;
-}
-
-EVALUATE(LLHRL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LGHRL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LHRL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LLGHRL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(STHRL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LGRL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(STGRL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LGFRL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LRL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LLGFRL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(STRL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(EXRL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(PFDRL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CGHRL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CHRL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CGRL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CGFRL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(ECTG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CSST) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LPD) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LPDG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(BRCTH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(AIH) {
-  DCHECK_OPCODE(AIH);
-  DECODE_RIL_A_INSTRUCTION(r1, i2);
-  int32_t r1_val = get_high_register<int32_t>(r1);
-  bool isOF = CheckOverflowForIntAdd(r1_val, static_cast<int32_t>(i2), int32_t);
-  r1_val += static_cast<int32_t>(i2);
-  set_high_register(r1, r1_val);
-  SetS390ConditionCode<int32_t>(r1_val, 0);
-  SetS390OverflowCode(isOF);
-  return length;
-}
-
-EVALUATE(ALSIH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(ALSIHN) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CIH) {
-  DCHECK_OPCODE(CIH);
-  DECODE_RIL_A_INSTRUCTION(r1, imm);
-  int32_t r1_val = get_high_register<int32_t>(r1);
-  SetS390ConditionCode<int32_t>(r1_val, static_cast<int32_t>(imm));
-  return length;
-}
-
-EVALUATE(CLIH) {
-  DCHECK_OPCODE(CLIH);
-  // Compare Logical with Immediate (32)
-  DECODE_RIL_A_INSTRUCTION(r1, imm);
-  SetS390ConditionCode<uint32_t>(get_high_register<uint32_t>(r1), imm);
-  return length;
-}
-
-EVALUATE(STCK) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CFC) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(IPM) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(HSCH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MSCH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SSCH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(STSCH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TSCH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TPI) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SAL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(RSCH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(STCRW) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(STCPS) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(RCHP) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SCHM) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CKSM) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SAR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(EAR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MSR) {
-  DCHECK_OPCODE(MSR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  set_low_register(r1, r1_val * r2_val);
-  return length;
-}
-
-EVALUATE(MSRKC) {
-  DCHECK_OPCODE(MSRKC);
-  DECODE_RRF_A_INSTRUCTION(r1, r2, r3);
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  int32_t r3_val = get_low_register<int32_t>(r3);
-  int64_t result64 =
-      static_cast<int64_t>(r2_val) * static_cast<int64_t>(r3_val);
-  int32_t result32 = static_cast<int32_t>(result64);
-  bool isOF = (static_cast<int64_t>(result32) != result64);
-  SetS390ConditionCode<int32_t>(result32, 0);
-  SetS390OverflowCode(isOF);
-  set_low_register(r1, result32);
-  return length;
-}
-
-EVALUATE(MVST) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CUSE) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SRST) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(XSCH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(STCKE) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(STCKF) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SRNM) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(STFPC) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LFPC) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TRE) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CUUTF) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CUTFU) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(STFLE) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SRNMB) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SRNMT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LFAS) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(PPA) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(ETND) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TEND) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(NIAI) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TABORT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TRAP4) {
-  DCHECK_OPCODE(TRAP4);
-  int length = 4;
-  // whack the space of the caller allocated stack
-  int64_t sp_addr = get_register(sp);
-  for (int i = 0; i < kCalleeRegisterSaveAreaSize / kPointerSize; ++i) {
-    // we dont want to whack the RA (r14)
-    if (i != 14) (reinterpret_cast<intptr_t*>(sp_addr))[i] = 0xDEADBABE;
-  }
-  SoftwareInterrupt(instr);
-  return length;
-}
-
-EVALUATE(LPEBR) {
-  DCHECK_OPCODE(LPEBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  float fr1_val = get_float32_from_d_register(r1);
-  float fr2_val = get_float32_from_d_register(r2);
-  fr1_val = std::fabs(fr2_val);
-  set_d_register_from_float32(r1, fr1_val);
-  if (fr2_val != fr2_val) {  // input is NaN
-    condition_reg_ = CC_OF;
-  } else if (fr2_val == 0) {
-    condition_reg_ = CC_EQ;
-  } else {
-    condition_reg_ = CC_GT;
-  }
-
-  return length;
-}
-
-EVALUATE(LNEBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LTEBR) {
-  DCHECK_OPCODE(LTEBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int64_t r2_val = get_d_register(r2);
-  float fr2_val = get_float32_from_d_register(r2);
-  SetS390ConditionCode<float>(fr2_val, 0.0);
-  set_d_register(r1, r2_val);
-  return length;
-}
-
-EVALUATE(LCEBR) {
-  DCHECK_OPCODE(LCEBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  float fr1_val = get_float32_from_d_register(r1);
-  float fr2_val = get_float32_from_d_register(r2);
-  fr1_val = -fr2_val;
-  set_d_register_from_float32(r1, fr1_val);
-  if (fr2_val != fr2_val) {  // input is NaN
-    condition_reg_ = CC_OF;
-  } else if (fr2_val == 0) {
-    condition_reg_ = CC_EQ;
-  } else if (fr2_val < 0) {
-    condition_reg_ = CC_LT;
-  } else if (fr2_val > 0) {
-    condition_reg_ = CC_GT;
-  }
-  return length;
-}
-
-EVALUATE(LDEBR) {
-  DCHECK_OPCODE(LDEBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  float fp_val = get_float32_from_d_register(r2);
-  double db_val = static_cast<double>(fp_val);
-  set_d_register_from_double(r1, db_val);
-  return length;
-}
-
-EVALUATE(LXDBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LXEBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MXDBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(KEBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CEBR) {
-  DCHECK_OPCODE(CEBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  float fr1_val = get_float32_from_d_register(r1);
-  float fr2_val = get_float32_from_d_register(r2);
-  if (isNaN(fr1_val) || isNaN(fr2_val)) {
-    condition_reg_ = CC_OF;
-  } else {
-    SetS390ConditionCode<float>(fr1_val, fr2_val);
-  }
-
-  return length;
-}
-
-EVALUATE(AEBR) {
-  DCHECK_OPCODE(AEBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  float fr1_val = get_float32_from_d_register(r1);
-  float fr2_val = get_float32_from_d_register(r2);
-  fr1_val += fr2_val;
-  set_d_register_from_float32(r1, fr1_val);
-  SetS390ConditionCode<float>(fr1_val, 0);
-
-  return length;
-}
-
-EVALUATE(SEBR) {
-  DCHECK_OPCODE(SEBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  float fr1_val = get_float32_from_d_register(r1);
-  float fr2_val = get_float32_from_d_register(r2);
-  fr1_val -= fr2_val;
-  set_d_register_from_float32(r1, fr1_val);
-  SetS390ConditionCode<float>(fr1_val, 0);
-
-  return length;
-}
-
-EVALUATE(MDEBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(DEBR) {
-  DCHECK_OPCODE(DEBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  float fr1_val = get_float32_from_d_register(r1);
-  float fr2_val = get_float32_from_d_register(r2);
-  fr1_val /= fr2_val;
-  set_d_register_from_float32(r1, fr1_val);
-  return length;
-}
-
-EVALUATE(MAEBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MSEBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LPDBR) {
-  DCHECK_OPCODE(LPDBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  double r1_val = get_double_from_d_register(r1);
-  double r2_val = get_double_from_d_register(r2);
-  r1_val = std::fabs(r2_val);
-  set_d_register_from_double(r1, r1_val);
-  if (r2_val != r2_val) {  // input is NaN
-    condition_reg_ = CC_OF;
-  } else if (r2_val == 0) {
-    condition_reg_ = CC_EQ;
-  } else {
-    condition_reg_ = CC_GT;
-  }
-  return length;
-}
-
-EVALUATE(LNDBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LTDBR) {
-  DCHECK_OPCODE(LTDBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int64_t r2_val = get_d_register(r2);
-  SetS390ConditionCode<double>(bit_cast<double, int64_t>(r2_val), 0.0);
-  set_d_register(r1, r2_val);
-  return length;
-}
-
-EVALUATE(LCDBR) {
-  DCHECK_OPCODE(LCDBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  double r1_val = get_double_from_d_register(r1);
-  double r2_val = get_double_from_d_register(r2);
-  r1_val = -r2_val;
-  set_d_register_from_double(r1, r1_val);
-  if (r2_val != r2_val) {  // input is NaN
-    condition_reg_ = CC_OF;
-  } else if (r2_val == 0) {
-    condition_reg_ = CC_EQ;
-  } else if (r2_val < 0) {
-    condition_reg_ = CC_LT;
-  } else if (r2_val > 0) {
-    condition_reg_ = CC_GT;
-  }
-  return length;
-}
-
-EVALUATE(SQEBR) {
-  DCHECK_OPCODE(SQEBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  float fr1_val = get_float32_from_d_register(r1);
-  float fr2_val = get_float32_from_d_register(r2);
-  fr1_val = std::sqrt(fr2_val);
-  set_d_register_from_float32(r1, fr1_val);
-  return length;
-}
-
-EVALUATE(SQDBR) {
-  DCHECK_OPCODE(SQDBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  double r1_val = get_double_from_d_register(r1);
-  double r2_val = get_double_from_d_register(r2);
-  r1_val = std::sqrt(r2_val);
-  set_d_register_from_double(r1, r1_val);
-  return length;
-}
-
-EVALUATE(SQXBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MEEBR) {
-  DCHECK_OPCODE(MEEBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  float fr1_val = get_float32_from_d_register(r1);
-  float fr2_val = get_float32_from_d_register(r2);
-  fr1_val *= fr2_val;
-  set_d_register_from_float32(r1, fr1_val);
-  return length;
-}
-
-EVALUATE(KDBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CDBR) {
-  DCHECK_OPCODE(CDBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  double r1_val = get_double_from_d_register(r1);
-  double r2_val = get_double_from_d_register(r2);
-  if (isNaN(r1_val) || isNaN(r2_val)) {
-    condition_reg_ = CC_OF;
-  } else {
-    SetS390ConditionCode<double>(r1_val, r2_val);
-  }
-  return length;
-}
-
-EVALUATE(ADBR) {
-  DCHECK_OPCODE(ADBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  double r1_val = get_double_from_d_register(r1);
-  double r2_val = get_double_from_d_register(r2);
-  r1_val += r2_val;
-  set_d_register_from_double(r1, r1_val);
-  SetS390ConditionCode<double>(r1_val, 0);
-  return length;
-}
-
-EVALUATE(SDBR) {
-  DCHECK_OPCODE(SDBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  double r1_val = get_double_from_d_register(r1);
-  double r2_val = get_double_from_d_register(r2);
-  r1_val -= r2_val;
-  set_d_register_from_double(r1, r1_val);
-  SetS390ConditionCode<double>(r1_val, 0);
-  return length;
-}
-
-EVALUATE(MDBR) {
-  DCHECK_OPCODE(MDBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  double r1_val = get_double_from_d_register(r1);
-  double r2_val = get_double_from_d_register(r2);
-  r1_val *= r2_val;
-  set_d_register_from_double(r1, r1_val);
-  return length;
-}
-
-EVALUATE(DDBR) {
-  DCHECK_OPCODE(DDBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  double r1_val = get_double_from_d_register(r1);
-  double r2_val = get_double_from_d_register(r2);
-  r1_val /= r2_val;
-  set_d_register_from_double(r1, r1_val);
-  return length;
-}
-
-EVALUATE(MADBR) {
-  DCHECK_OPCODE(MADBR);
-  DECODE_RRD_INSTRUCTION(r1, r2, r3);
-  double r1_val = get_double_from_d_register(r1);
-  double r2_val = get_double_from_d_register(r2);
-  double r3_val = get_double_from_d_register(r3);
-  r1_val += r2_val * r3_val;
-  set_d_register_from_double(r1, r1_val);
-  SetS390ConditionCode<double>(r1_val, 0);
-  return length;
-}
-
-EVALUATE(MSDBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LPXBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LNXBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LTXBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LCXBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LEDBRA) {
-  DCHECK_OPCODE(LEDBRA);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  double r2_val = get_double_from_d_register(r2);
-  set_d_register_from_float32(r1, static_cast<float>(r2_val));
-  return length;
-}
-
-EVALUATE(LDXBRA) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LEXBRA) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(FIXBRA) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(KXBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CXBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(AXBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SXBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MXBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(DXBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TBEDR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TBDR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(DIEBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(FIEBRA) {
-  DCHECK_OPCODE(FIEBRA);
-  DECODE_RRF_E_INSTRUCTION(r1, r2, m3, m4);
-  float r2_val = get_float32_from_d_register(r2);
-  CHECK_EQ(m4, 0);
-  switch (m3) {
-    case Assembler::FIDBRA_ROUND_TO_NEAREST_AWAY_FROM_0:
-      set_d_register_from_float32(r1, round(r2_val));
-      break;
-    case Assembler::FIDBRA_ROUND_TOWARD_0:
-      set_d_register_from_float32(r1, trunc(r2_val));
-      break;
-    case Assembler::FIDBRA_ROUND_TOWARD_POS_INF:
-      set_d_register_from_float32(r1, std::ceil(r2_val));
-      break;
-    case Assembler::FIDBRA_ROUND_TOWARD_NEG_INF:
-      set_d_register_from_float32(r1, std::floor(r2_val));
-      break;
-    default:
-      UNIMPLEMENTED();
-      break;
-  }
-  return length;
-}
-
-EVALUATE(THDER) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(THDR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(DIDBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(FIDBRA) {
-  DCHECK_OPCODE(FIDBRA);
-  DECODE_RRF_E_INSTRUCTION(r1, r2, m3, m4);
-  double r2_val = get_double_from_d_register(r2);
-  CHECK_EQ(m4, 0);
-  switch (m3) {
-    case Assembler::FIDBRA_ROUND_TO_NEAREST_AWAY_FROM_0:
-      set_d_register_from_double(r1, round(r2_val));
-      break;
-    case Assembler::FIDBRA_ROUND_TOWARD_0:
-      set_d_register_from_double(r1, trunc(r2_val));
-      break;
-    case Assembler::FIDBRA_ROUND_TOWARD_POS_INF:
-      set_d_register_from_double(r1, std::ceil(r2_val));
-      break;
-    case Assembler::FIDBRA_ROUND_TOWARD_NEG_INF:
-      set_d_register_from_double(r1, std::floor(r2_val));
-      break;
-    default:
-      UNIMPLEMENTED();
-      break;
-  }
-  return length;
-}
-
-EVALUATE(LXR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LPDFR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LNDFR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LCDFR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LZER) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LZDR) {
-  DCHECK_OPCODE(LZDR);
-  DECODE_RRE_INSTRUCTION_NO_R2(r1);
-  set_d_register_from_double(r1, 0.0);
-  return length;
-}
-
-EVALUATE(LZXR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SFPC) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SFASR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(EFPC) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CELFBR) {
-  DCHECK_OPCODE(CELFBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  uint32_t r2_val = get_low_register<uint32_t>(r2);
-  float r1_val = static_cast<float>(r2_val);
-  set_d_register_from_float32(r1, r1_val);
-  return length;
-}
-
-EVALUATE(CDLFBR) {
-  DCHECK_OPCODE(CDLFBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  uint32_t r2_val = get_low_register<uint32_t>(r2);
-  double r1_val = static_cast<double>(r2_val);
-  set_d_register_from_double(r1, r1_val);
-  return length;
-}
-
-EVALUATE(CXLFBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CEFBRA) {
-  DCHECK_OPCODE(CEFBRA);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int32_t fr2_val = get_low_register<int32_t>(r2);
-  float fr1_val = static_cast<float>(fr2_val);
-  set_d_register_from_float32(r1, fr1_val);
-  return length;
-}
-
-EVALUATE(CDFBRA) {
-  DCHECK_OPCODE(CDFBRA);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  double r1_val = static_cast<double>(r2_val);
-  set_d_register_from_double(r1, r1_val);
-  return length;
-}
-
-EVALUATE(CXFBRA) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CFEBRA) {
-  DCHECK_OPCODE(CFEBRA);
-  DECODE_RRE_INSTRUCTION_M3(r1, r2, mask_val);
-  float r2_fval = get_float32_from_d_register(r2);
-  int32_t r1_val = 0;
-
-  SetS390RoundConditionCode(r2_fval, INT32_MAX, INT32_MIN);
-
-  switch (mask_val) {
-    case CURRENT_ROUNDING_MODE:
-    case ROUND_TO_PREPARE_FOR_SHORTER_PRECISION: {
-      r1_val = static_cast<int32_t>(r2_fval);
-      break;
-    }
-    case ROUND_TO_NEAREST_WITH_TIES_AWAY_FROM_0: {
-      float ceil_val = std::ceil(r2_fval);
-      float floor_val = std::floor(r2_fval);
-      float sub_val1 = std::fabs(r2_fval - floor_val);
-      float sub_val2 = std::fabs(r2_fval - ceil_val);
-      if (sub_val1 > sub_val2) {
-        r1_val = static_cast<int32_t>(ceil_val);
-      } else if (sub_val1 < sub_val2) {
-        r1_val = static_cast<int32_t>(floor_val);
-      } else {  // round away from zero:
-        if (r2_fval > 0.0) {
-          r1_val = static_cast<int32_t>(ceil_val);
-        } else {
-          r1_val = static_cast<int32_t>(floor_val);
-        }
-      }
-      break;
-    }
-    case ROUND_TO_NEAREST_WITH_TIES_TO_EVEN: {
-      float ceil_val = std::ceil(r2_fval);
-      float floor_val = std::floor(r2_fval);
-      float sub_val1 = std::fabs(r2_fval - floor_val);
-      float sub_val2 = std::fabs(r2_fval - ceil_val);
-      if (sub_val1 > sub_val2) {
-        r1_val = static_cast<int32_t>(ceil_val);
-      } else if (sub_val1 < sub_val2) {
-        r1_val = static_cast<int32_t>(floor_val);
-      } else {  // check which one is even:
-        int32_t c_v = static_cast<int32_t>(ceil_val);
-        int32_t f_v = static_cast<int32_t>(floor_val);
-        if (f_v % 2 == 0)
-          r1_val = f_v;
-        else
-          r1_val = c_v;
-      }
-      break;
-    }
-    case ROUND_TOWARD_0: {
-      // check for overflow, cast r2_fval to 64bit integer
-      // then check value within the range of INT_MIN and INT_MAX
-      // and set condition code accordingly
-      int64_t temp = static_cast<int64_t>(r2_fval);
-      if (temp < INT_MIN || temp > INT_MAX) {
-        condition_reg_ = CC_OF;
-      }
-      r1_val = static_cast<int32_t>(r2_fval);
-      break;
-    }
-    case ROUND_TOWARD_PLUS_INFINITE: {
-      r1_val = static_cast<int32_t>(std::ceil(r2_fval));
-      break;
-    }
-    case ROUND_TOWARD_MINUS_INFINITE: {
-      // check for overflow, cast r2_fval to 64bit integer
-      // then check value within the range of INT_MIN and INT_MAX
-      // and set condition code accordingly
-      int64_t temp = static_cast<int64_t>(std::floor(r2_fval));
-      if (temp < INT_MIN || temp > INT_MAX) {
-        condition_reg_ = CC_OF;
-      }
-      r1_val = static_cast<int32_t>(std::floor(r2_fval));
-      break;
-    }
-    default:
-      UNREACHABLE();
-  }
-  set_low_register(r1, r1_val);
-  return length;
-}
-
-EVALUATE(CFDBRA) {
-  DCHECK_OPCODE(CFDBRA);
-  DECODE_RRE_INSTRUCTION_M3(r1, r2, mask_val);
-  double r2_val = get_double_from_d_register(r2);
-  int32_t r1_val = 0;
-
-  SetS390RoundConditionCode(r2_val, INT32_MAX, INT32_MIN);
-
-  switch (mask_val) {
-    case CURRENT_ROUNDING_MODE:
-    case ROUND_TO_PREPARE_FOR_SHORTER_PRECISION: {
-      r1_val = static_cast<int32_t>(r2_val);
-      break;
-    }
-    case ROUND_TO_NEAREST_WITH_TIES_AWAY_FROM_0: {
-      double ceil_val = std::ceil(r2_val);
-      double floor_val = std::floor(r2_val);
-      double sub_val1 = std::fabs(r2_val - floor_val);
-      double sub_val2 = std::fabs(r2_val - ceil_val);
-      if (sub_val1 > sub_val2) {
-        r1_val = static_cast<int32_t>(ceil_val);
-      } else if (sub_val1 < sub_val2) {
-        r1_val = static_cast<int32_t>(floor_val);
-      } else {  // round away from zero:
-        if (r2_val > 0.0) {
-          r1_val = static_cast<int32_t>(ceil_val);
-        } else {
-          r1_val = static_cast<int32_t>(floor_val);
-        }
-      }
-      break;
-    }
-    case ROUND_TO_NEAREST_WITH_TIES_TO_EVEN: {
-      double ceil_val = std::ceil(r2_val);
-      double floor_val = std::floor(r2_val);
-      double sub_val1 = std::fabs(r2_val - floor_val);
-      double sub_val2 = std::fabs(r2_val - ceil_val);
-      if (sub_val1 > sub_val2) {
-        r1_val = static_cast<int32_t>(ceil_val);
-      } else if (sub_val1 < sub_val2) {
-        r1_val = static_cast<int32_t>(floor_val);
-      } else {  // check which one is even:
-        int32_t c_v = static_cast<int32_t>(ceil_val);
-        int32_t f_v = static_cast<int32_t>(floor_val);
-        if (f_v % 2 == 0)
-          r1_val = f_v;
-        else
-          r1_val = c_v;
-      }
-      break;
-    }
-    case ROUND_TOWARD_0: {
-      // check for overflow, cast r2_val to 64bit integer
-      // then check value within the range of INT_MIN and INT_MAX
-      // and set condition code accordingly
-      int64_t temp = static_cast<int64_t>(r2_val);
-      if (temp < INT_MIN || temp > INT_MAX) {
-        condition_reg_ = CC_OF;
-      }
-      r1_val = static_cast<int32_t>(r2_val);
-      break;
-    }
-    case ROUND_TOWARD_PLUS_INFINITE: {
-      r1_val = static_cast<int32_t>(std::ceil(r2_val));
-      break;
-    }
-    case ROUND_TOWARD_MINUS_INFINITE: {
-      // check for overflow, cast r2_val to 64bit integer
-      // then check value within the range of INT_MIN and INT_MAX
-      // and set condition code accordingly
-      int64_t temp = static_cast<int64_t>(std::floor(r2_val));
-      if (temp < INT_MIN || temp > INT_MAX) {
-        condition_reg_ = CC_OF;
-      }
-      r1_val = static_cast<int32_t>(std::floor(r2_val));
-      break;
-    }
-    default:
-      UNREACHABLE();
-  }
-  set_low_register(r1, r1_val);
-  return length;
-}
-
-EVALUATE(CFXBRA) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CLFEBR) {
-  DCHECK_OPCODE(CLFEBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  float r2_val = get_float32_from_d_register(r2);
-  uint32_t r1_val = static_cast<uint32_t>(r2_val);
-  set_low_register(r1, r1_val);
-  SetS390ConvertConditionCode<double>(r2_val, r1_val, UINT32_MAX);
-  return length;
-}
-
-EVALUATE(CLFDBR) {
-  DCHECK_OPCODE(CLFDBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  double a = get_double_from_d_register(r2);
-  double n = std::round(a);
-  uint32_t r1_val = static_cast<uint32_t>(n);
-  set_low_register(r1, r1_val);
-  if (std::isfinite(a) && a < 0.0) {
-    DCHECK(n <= 0.0 && std::isfinite(n));
-    condition_reg_ = (n < 0.0) ? 0x1 : 0x4;
-  } else if (a == 0.0) {
-    condition_reg_ = 0x8;
-  } else if (std::isfinite(a) && a > 0.0) {
-    DCHECK(n >= 0.0 && std::isfinite(n));
-    condition_reg_ = (n <= static_cast<double>(UINT32_MAX)) ? 0x2 : 0x1;
-  } else {
-    condition_reg_ = 0x1;
-  }
-  return length;
-}
-
-EVALUATE(CLFXBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CELGBR) {
-  DCHECK_OPCODE(CELGBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  uint64_t r2_val = get_register(r2);
-  float r1_val = static_cast<float>(r2_val);
-  set_d_register_from_float32(r1, r1_val);
-  return length;
-}
-
-EVALUATE(CDLGBR) {
-  DCHECK_OPCODE(CDLGBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  uint64_t r2_val = get_register(r2);
-  double r1_val = static_cast<double>(r2_val);
-  set_d_register_from_double(r1, r1_val);
-  return length;
-}
-
-EVALUATE(CXLGBR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CEGBRA) {
-  DCHECK_OPCODE(CEGBRA);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int64_t fr2_val = get_register(r2);
-  float fr1_val = static_cast<float>(fr2_val);
-  set_d_register_from_float32(r1, fr1_val);
-  return length;
-}
-
-EVALUATE(CDGBRA) {
-  DCHECK_OPCODE(CDGBRA);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int64_t r2_val = get_register(r2);
-  double r1_val = static_cast<double>(r2_val);
-  set_d_register_from_double(r1, r1_val);
-  return length;
-}
-
-EVALUATE(CXGBRA) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CGEBRA) {
-  DCHECK_OPCODE(CGEBRA);
-  DECODE_RRE_INSTRUCTION_M3(r1, r2, mask_val);
-  float r2_fval = get_float32_from_d_register(r2);
-  int64_t r1_val = 0;
-
-  SetS390RoundConditionCode(r2_fval, INT64_MAX, INT64_MIN);
-
-  switch (mask_val) {
-    case CURRENT_ROUNDING_MODE:
-    case ROUND_TO_NEAREST_WITH_TIES_AWAY_FROM_0:
-    case ROUND_TO_PREPARE_FOR_SHORTER_PRECISION: {
-      UNIMPLEMENTED();
-      break;
-    }
-    case ROUND_TO_NEAREST_WITH_TIES_TO_EVEN: {
-      float ceil_val = std::ceil(r2_fval);
-      float floor_val = std::floor(r2_fval);
-      if (std::abs(r2_fval - floor_val) > std::abs(r2_fval - ceil_val)) {
-        r1_val = static_cast<int64_t>(ceil_val);
-      } else if (std::abs(r2_fval - floor_val) < std::abs(r2_fval - ceil_val)) {
-        r1_val = static_cast<int64_t>(floor_val);
-      } else {  // check which one is even:
-        int64_t c_v = static_cast<int64_t>(ceil_val);
-        int64_t f_v = static_cast<int64_t>(floor_val);
-        if (f_v % 2 == 0)
-          r1_val = f_v;
-        else
-          r1_val = c_v;
-      }
-      break;
-    }
-    case ROUND_TOWARD_0: {
-      r1_val = static_cast<int64_t>(r2_fval);
-      break;
-    }
-    case ROUND_TOWARD_PLUS_INFINITE: {
-      r1_val = static_cast<int64_t>(std::ceil(r2_fval));
-      break;
-    }
-    case ROUND_TOWARD_MINUS_INFINITE: {
-      r1_val = static_cast<int64_t>(std::floor(r2_fval));
-      break;
-    }
-    default:
-      UNREACHABLE();
-  }
-  set_register(r1, r1_val);
-  return length;
-}
-
-EVALUATE(CGDBRA) {
-  DCHECK_OPCODE(CGDBRA);
-  DECODE_RRE_INSTRUCTION_M3(r1, r2, mask_val);
-  double r2_val = get_double_from_d_register(r2);
-  int64_t r1_val = 0;
-
-  SetS390RoundConditionCode(r2_val, INT64_MAX, INT64_MIN);
-
-  switch (mask_val) {
-    case CURRENT_ROUNDING_MODE:
-    case ROUND_TO_NEAREST_WITH_TIES_AWAY_FROM_0:
-    case ROUND_TO_PREPARE_FOR_SHORTER_PRECISION: {
-      UNIMPLEMENTED();
-      break;
-    }
-    case ROUND_TO_NEAREST_WITH_TIES_TO_EVEN: {
-      double ceil_val = std::ceil(r2_val);
-      double floor_val = std::floor(r2_val);
-      if (std::abs(r2_val - floor_val) > std::abs(r2_val - ceil_val)) {
-        r1_val = static_cast<int64_t>(ceil_val);
-      } else if (std::abs(r2_val - floor_val) < std::abs(r2_val - ceil_val)) {
-        r1_val = static_cast<int64_t>(floor_val);
-      } else {  // check which one is even:
-        int64_t c_v = static_cast<int64_t>(ceil_val);
-        int64_t f_v = static_cast<int64_t>(floor_val);
-        if (f_v % 2 == 0)
-          r1_val = f_v;
-        else
-          r1_val = c_v;
-      }
-      break;
-    }
-    case ROUND_TOWARD_0: {
-      r1_val = static_cast<int64_t>(r2_val);
-      break;
-    }
-    case ROUND_TOWARD_PLUS_INFINITE: {
-      r1_val = static_cast<int64_t>(std::ceil(r2_val));
-      break;
-    }
-    case ROUND_TOWARD_MINUS_INFINITE: {
-      r1_val = static_cast<int64_t>(std::floor(r2_val));
-      break;
-    }
-    default:
-      UNREACHABLE();
-  }
-  set_register(r1, r1_val);
-  return length;
-}
-
-EVALUATE(CGXBRA) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CLGEBR) {
-  DCHECK_OPCODE(CLGEBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  float r2_val = get_float32_from_d_register(r2);
-  uint64_t r1_val = static_cast<uint64_t>(r2_val);
-  set_register(r1, r1_val);
-  SetS390ConvertConditionCode<double>(r2_val, r1_val, UINT64_MAX);
-  return length;
-}
-
-EVALUATE(CLGDBR) {
-  DCHECK_OPCODE(CLGDBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  double r2_val = get_double_from_d_register(r2);
-  uint64_t r1_val = static_cast<uint64_t>(r2_val);
-  set_register(r1, r1_val);
-  SetS390ConvertConditionCode<double>(r2_val, r1_val, UINT64_MAX);
-  return length;
-}
-
-EVALUATE(CFER) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CFDR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CFXR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LDGR) {
-  DCHECK_OPCODE(LDGR);
-  // Load FPR from GPR (L <- 64)
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  uint64_t int_val = get_register(r2);
-  // double double_val = bit_cast<double, uint64_t>(int_val);
-  // set_d_register_from_double(rreInst->R1Value(), double_val);
-  set_d_register(r1, int_val);
-  return length;
-}
-
-EVALUATE(CGER) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CGDR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CGXR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LGDR) {
-  DCHECK_OPCODE(LGDR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  // Load GPR from FPR (64 <- L)
-  int64_t double_val = get_d_register(r2);
-  set_register(r1, double_val);
-  return length;
-}
-
-EVALUATE(MDTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MDTRA) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(DDTRA) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(ADTRA) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SDTRA) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LDETR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LEDTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LTDTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(FIDTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MXTRA) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(DXTRA) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(AXTRA) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SXTRA) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LXDTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LDXTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LTXTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(FIXTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(KDTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CGDTRA) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CUDTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CDTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(EEDTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(ESDTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(KXTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CGXTRA) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CUXTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CSXTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CXTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(EEXTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(ESXTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CDGTRA) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CDUTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CDSTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CEDTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(QADTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(IEDTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(RRDTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CXGTRA) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CXUTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CXSTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CEXTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(QAXTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(IEXTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(RRXTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LPGR) {
-  DCHECK_OPCODE(LPGR);
-  // Load Positive (32)
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int64_t r2_val = get_register(r2);
-  r2_val = (r2_val < 0) ? -r2_val : r2_val;  // If negative, then negate it.
-  set_register(r1, r2_val);
-  SetS390ConditionCode<int64_t>(r2_val, 0);
-  if (r2_val == (static_cast<int64_t>(1) << 63)) {
-    SetS390OverflowCode(true);
-  }
-  return length;
-}
-
-EVALUATE(LNGR) {
-  DCHECK_OPCODE(LNGR);
-  // Load Negative (64)
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int64_t r2_val = get_register(r2);
-  r2_val = (r2_val >= 0) ? -r2_val : r2_val;  // If pos, then negate it.
-  set_register(r1, r2_val);
-  condition_reg_ = (r2_val == 0) ? CC_EQ : CC_LT;  // CC0 - result is zero
-  // CC1 - result is negative
-  return length;
-}
-
-EVALUATE(LTGR) {
-  DCHECK_OPCODE(LTGR);
-  // Load Register (64)
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int64_t r2_val = get_register(r2);
-  SetS390ConditionCode<int64_t>(r2_val, 0);
-  set_register(r1, get_register(r2));
-  return length;
-}
-
-EVALUATE(LCGR) {
-  DCHECK_OPCODE(LCGR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int64_t r2_val = get_register(r2);
-  int64_t result = 0;
-  bool isOF = false;
-#ifdef V8_TARGET_ARCH_S390X
-  isOF = __builtin_ssubl_overflow(0L, r2_val, &result);
-#else
-  isOF = __builtin_ssubll_overflow(0L, r2_val, &result);
-#endif
-  set_register(r1, result);
-  SetS390ConditionCode<int64_t>(result, 0);
-  if (isOF) {
-    SetS390OverflowCode(true);
-  }
-  return length;
-}
-
-EVALUATE(SGR) {
-  DCHECK_OPCODE(SGR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int64_t r1_val = get_register(r1);
-  int64_t r2_val = get_register(r2);
-  bool isOF = false;
-  isOF = CheckOverflowForIntSub(r1_val, r2_val, int64_t);
-  r1_val -= r2_val;
-  SetS390ConditionCode<int64_t>(r1_val, 0);
-  SetS390OverflowCode(isOF);
-  set_register(r1, r1_val);
-  return length;
-}
-
-EVALUATE(ALGR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SLGR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MSGR) {
-  DCHECK_OPCODE(MSGR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int64_t r1_val = get_register(r1);
-  int64_t r2_val = get_register(r2);
-  set_register(r1, r1_val * r2_val);
-  return length;
-}
-
-EVALUATE(MSGRKC) {
-  DCHECK_OPCODE(MSGRKC);
-  DECODE_RRF_A_INSTRUCTION(r1, r2, r3);
-  int64_t r2_val = get_register(r2);
-  int64_t r3_val = get_register(r3);
-  volatile int64_t result64 = r2_val * r3_val;
-  bool isOF = ((r2_val == -1 && result64 == (static_cast<int64_t>(1L) << 63)) ||
-               (r2_val != 0 && result64 / r2_val != r3_val));
-  SetS390ConditionCode<int64_t>(result64, 0);
-  SetS390OverflowCode(isOF);
-  set_register(r1, result64);
-  return length;
-}
-
-EVALUATE(DSGR) {
-  DCHECK_OPCODE(DSGR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-
-  DCHECK_EQ(r1 % 2, 0);
-
-  int64_t dividend = get_register(r1 + 1);
-  int64_t divisor = get_register(r2);
-  set_register(r1, dividend % divisor);
-  set_register(r1 + 1, dividend / divisor);
-  return length;
-}
-
-EVALUATE(LRVGR) {
-  DCHECK_OPCODE(LRVGR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int64_t r2_val = get_register(r2);
-  int64_t r1_val = ByteReverse(r2_val);
-
-  set_register(r1, r1_val);
-  return length;
-}
-
-EVALUATE(LPGFR) {
-  DCHECK_OPCODE(LPGFR);
-  // Load Positive (32)
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  // If negative, then negate it.
-  int64_t r1_val = static_cast<int64_t>((r2_val < 0) ? -r2_val : r2_val);
-  set_register(r1, r1_val);
-  SetS390ConditionCode<int64_t>(r1_val, 0);
-  return length;
-}
-
-EVALUATE(LNGFR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LTGFR) {
-  DCHECK_OPCODE(LTGFR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  // Load and Test Register (64 <- 32)  (Sign Extends 32-bit val)
-  // Load Register (64 <- 32)  (Sign Extends 32-bit val)
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  int64_t result = static_cast<int64_t>(r2_val);
-  set_register(r1, result);
-  SetS390ConditionCode<int64_t>(result, 0);
-  return length;
-}
-
-EVALUATE(LCGFR) {
-  DCHECK_OPCODE(LCGFR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  // Load and Test Register (64 <- 32)  (Sign Extends 32-bit val)
-  // Load Register (64 <- 32)  (Sign Extends 32-bit val)
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  int64_t result = static_cast<int64_t>(r2_val);
-  set_register(r1, result);
-  return length;
-}
-
-EVALUATE(LLGFR) {
-  DCHECK_OPCODE(LLGFR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  uint64_t r2_finalval = (static_cast<uint64_t>(r2_val) & 0x00000000FFFFFFFF);
-  set_register(r1, r2_finalval);
-  return length;
-}
-
-EVALUATE(LLGTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(AGFR) {
-  DCHECK_OPCODE(AGFR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  // Add Register (64 <- 32)  (Sign Extends 32-bit val)
-  int64_t r1_val = get_register(r1);
-  int64_t r2_val = static_cast<int64_t>(get_low_register<int32_t>(r2));
-  bool isOF = CheckOverflowForIntAdd(r1_val, r2_val, int64_t);
-  r1_val += r2_val;
-  SetS390ConditionCode<int64_t>(r1_val, 0);
-  SetS390OverflowCode(isOF);
-  set_register(r1, r1_val);
-  return length;
-}
-
-EVALUATE(SGFR) {
-  DCHECK_OPCODE(SGFR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  // Sub Reg (64 <- 32)
-  int64_t r1_val = get_register(r1);
-  int64_t r2_val = static_cast<int64_t>(get_low_register<int32_t>(r2));
-  bool isOF = false;
-  isOF = CheckOverflowForIntSub(r1_val, r2_val, int64_t);
-  r1_val -= r2_val;
-  SetS390ConditionCode<int64_t>(r1_val, 0);
-  SetS390OverflowCode(isOF);
-  set_register(r1, r1_val);
-  return length;
-}
-
-EVALUATE(ALGFR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SLGFR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MSGFR) {
-  DCHECK_OPCODE(MSGFR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int64_t r1_val = get_register(r1);
-  int64_t r2_val = static_cast<int64_t>(get_low_register<int32_t>(r2));
-  int64_t product = r1_val * r2_val;
-  set_register(r1, product);
-  return length;
-}
-
-EVALUATE(DSGFR) {
-  DCHECK_OPCODE(DSGFR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  DCHECK_EQ(r1 % 2, 0);
-  int64_t r1_val = get_register(r1 + 1);
-  int64_t r2_val = static_cast<int64_t>(get_low_register<int32_t>(r2));
-  int64_t quotient = r1_val / r2_val;
-  int64_t remainder = r1_val % r2_val;
-  set_register(r1, remainder);
-  set_register(r1 + 1, quotient);
-  return length;
-}
-
-EVALUATE(KMAC) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LRVR) {
-  DCHECK_OPCODE(LRVR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  int32_t r1_val = ByteReverse(r2_val);
-
-  set_low_register(r1, r1_val);
-  return length;
-}
-
-EVALUATE(CGR) {
-  DCHECK_OPCODE(CGR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  // Compare (64)
-  int64_t r1_val = get_register(r1);
-  int64_t r2_val = get_register(r2);
-  SetS390ConditionCode<int64_t>(r1_val, r2_val);
-  return length;
-}
-
-EVALUATE(CLGR) {
-  DCHECK_OPCODE(CLGR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  // Compare Logical (64)
-  uint64_t r1_val = static_cast<uint64_t>(get_register(r1));
-  uint64_t r2_val = static_cast<uint64_t>(get_register(r2));
-  SetS390ConditionCode<uint64_t>(r1_val, r2_val);
-  return length;
-}
-
-EVALUATE(KMF) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(KMO) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(PCC) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(KMCTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(KM) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(KMC) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CGFR) {
-  DCHECK_OPCODE(CGFR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  // Compare (64)
-  int64_t r1_val = get_register(r1);
-  int64_t r2_val = static_cast<int64_t>(get_low_register<int32_t>(r2));
-  SetS390ConditionCode<int64_t>(r1_val, r2_val);
-  return length;
-}
-
-EVALUATE(KIMD) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(KLMD) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CFDTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CLGDTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CLFDTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(BCTGR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CFXTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CLFXTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CDFTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CDLGTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CDLFTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CXFTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CXLGTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CXLFTR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CGRT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(NGR) {
-  DCHECK_OPCODE(NGR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int64_t r1_val = get_register(r1);
-  int64_t r2_val = get_register(r2);
-  r1_val &= r2_val;
-  SetS390BitWiseConditionCode<uint64_t>(r1_val);
-  set_register(r1, r1_val);
-  return length;
-}
-
-EVALUATE(OGR) {
-  DCHECK_OPCODE(OGR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int64_t r1_val = get_register(r1);
-  int64_t r2_val = get_register(r2);
-  r1_val |= r2_val;
-  SetS390BitWiseConditionCode<uint64_t>(r1_val);
-  set_register(r1, r1_val);
-  return length;
-}
-
-EVALUATE(XGR) {
-  DCHECK_OPCODE(XGR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int64_t r1_val = get_register(r1);
-  int64_t r2_val = get_register(r2);
-  r1_val ^= r2_val;
-  SetS390BitWiseConditionCode<uint64_t>(r1_val);
-  set_register(r1, r1_val);
-  return length;
-}
-
-EVALUATE(FLOGR) {
-  DCHECK_OPCODE(FLOGR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-
-  DCHECK_EQ(r1 % 2, 0);
-
-  int64_t r2_val = get_register(r2);
-
-  int i = 0;
-  for (; i < 64; i++) {
-    if (r2_val < 0) break;
-    r2_val <<= 1;
-  }
-
-  r2_val = get_register(r2);
-
-  int64_t mask = ~(1 << (63 - i));
-  set_register(r1, i);
-  set_register(r1 + 1, r2_val & mask);
-  return length;
-}
-
-EVALUATE(LLGCR) {
-  DCHECK_OPCODE(LLGCR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  uint64_t r2_val = get_low_register<uint64_t>(r2);
-  r2_val <<= 56;
-  r2_val >>= 56;
-  set_register(r1, r2_val);
-  return length;
-}
-
-EVALUATE(LLGHR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MLGR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(DLGR) {
-  DCHECK_OPCODE(DLGR);
-#ifdef V8_TARGET_ARCH_S390X
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  uint64_t r1_val = get_register(r1);
-  uint64_t r2_val = get_register(r2);
-  DCHECK_EQ(r1 % 2, 0);
-  unsigned __int128 dividend = static_cast<unsigned __int128>(r1_val) << 64;
-  dividend += get_register(r1 + 1);
-  uint64_t remainder = dividend % r2_val;
-  uint64_t quotient = dividend / r2_val;
-  set_register(r1, remainder);
-  set_register(r1 + 1, quotient);
-  return length;
-#else
-  // 32 bit arch doesn't support __int128 type
-  USE(instr);
-  UNREACHABLE();
-#endif
-}
-
-EVALUATE(ALCGR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SLBGR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(EPSW) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TRTT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TRTO) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TROT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TROO) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LLCR) {
-  DCHECK_OPCODE(LLCR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  uint32_t r2_val = get_low_register<uint32_t>(r2);
-  r2_val <<= 24;
-  r2_val >>= 24;
-  set_low_register(r1, r2_val);
-  return length;
-}
-
-EVALUATE(LLHR) {
-  DCHECK_OPCODE(LLHR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  uint32_t r2_val = get_low_register<uint32_t>(r2);
-  r2_val <<= 16;
-  r2_val >>= 16;
-  set_low_register(r1, r2_val);
-  return length;
-}
-
-EVALUATE(MLR) {
-  DCHECK_OPCODE(MLR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  DCHECK_EQ(r1 % 2, 0);
-
-  uint32_t r1_val = get_low_register<uint32_t>(r1 + 1);
-  uint32_t r2_val = get_low_register<uint32_t>(r2);
-  uint64_t product =
-      static_cast<uint64_t>(r1_val) * static_cast<uint64_t>(r2_val);
-  int32_t high_bits = product >> 32;
-  int32_t low_bits = product & 0x00000000FFFFFFFF;
-  set_low_register(r1, high_bits);
-  set_low_register(r1 + 1, low_bits);
-  return length;
-}
-
-EVALUATE(DLR) {
-  DCHECK_OPCODE(DLR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  uint32_t r1_val = get_low_register<uint32_t>(r1);
-  uint32_t r2_val = get_low_register<uint32_t>(r2);
-  DCHECK_EQ(r1 % 2, 0);
-  uint64_t dividend = static_cast<uint64_t>(r1_val) << 32;
-  dividend += get_low_register<uint32_t>(r1 + 1);
-  uint32_t remainder = dividend % r2_val;
-  uint32_t quotient = dividend / r2_val;
-  r1_val = remainder;
-  set_low_register(r1, remainder);
-  set_low_register(r1 + 1, quotient);
-  return length;
-}
-
-EVALUATE(ALCR) {
-  DCHECK_OPCODE(ALCR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  uint32_t r1_val = get_low_register<uint32_t>(r1);
-  uint32_t r2_val = get_low_register<uint32_t>(r2);
-  uint32_t alu_out = 0;
-  bool isOF = false;
-
-  alu_out = r1_val + r2_val;
-  bool isOF_original = CheckOverflowForUIntAdd(r1_val, r2_val);
-  if (TestConditionCode((Condition)2) || TestConditionCode((Condition)3)) {
-    alu_out = alu_out + 1;
-    isOF = isOF_original || CheckOverflowForUIntAdd(alu_out, 1);
-  } else {
-    isOF = isOF_original;
-  }
-  set_low_register(r1, alu_out);
-  SetS390ConditionCodeCarry<uint32_t>(alu_out, isOF);
-  return length;
-}
-
-EVALUATE(SLBR) {
-  DCHECK_OPCODE(SLBR);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  uint32_t r1_val = get_low_register<uint32_t>(r1);
-  uint32_t r2_val = get_low_register<uint32_t>(r2);
-  uint32_t alu_out = 0;
-  bool isOF = false;
-
-  alu_out = r1_val - r2_val;
-  bool isOF_original = CheckOverflowForUIntSub(r1_val, r2_val);
-  if (TestConditionCode((Condition)2) || TestConditionCode((Condition)3)) {
-    alu_out = alu_out - 1;
-    isOF = isOF_original || CheckOverflowForUIntSub(alu_out, 1);
-  } else {
-    isOF = isOF_original;
-  }
-  set_low_register(r1, alu_out);
-  SetS390ConditionCodeCarry<uint32_t>(alu_out, isOF);
-  return length;
-}
-
-EVALUATE(CU14) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CU24) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CU41) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CU42) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TRTRE) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SRSTU) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TRTE) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(AHHHR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SHHHR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(ALHHHR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SLHHHR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CHHR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(AHHLR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SHHLR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(ALHHLR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SLHHLR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CHLR) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(POPCNT_Z) {
-  DCHECK_OPCODE(POPCNT_Z);
-  DECODE_RRE_INSTRUCTION(r1, r2);
-  int64_t r2_val = get_register(r2);
-  int64_t r1_val = 0;
-
-  uint8_t* r2_val_ptr = reinterpret_cast<uint8_t*>(&r2_val);
-  uint8_t* r1_val_ptr = reinterpret_cast<uint8_t*>(&r1_val);
-  for (int i = 0; i < 8; i++) {
-    uint32_t x = static_cast<uint32_t>(r2_val_ptr[i]);
-#if defined(__GNUC__)
-    r1_val_ptr[i] = __builtin_popcount(x);
-#else
-#error unsupport __builtin_popcount
-#endif
-  }
-  set_register(r1, static_cast<uint64_t>(r1_val));
-  return length;
-}
-
-EVALUATE(LOCGR) {
-  DCHECK_OPCODE(LOCGR);
-  DECODE_RRF_C_INSTRUCTION(r1, r2, m3);
-  if (TestConditionCode(m3)) {
-    set_register(r1, get_register(r2));
-  }
-  return length;
-}
-
-EVALUATE(NGRK) {
-  DCHECK_OPCODE(NGRK);
-  DECODE_RRF_A_INSTRUCTION(r1, r2, r3);
-  // 64-bit Non-clobbering arithmetics / bitwise ops.
-  int64_t r2_val = get_register(r2);
-  int64_t r3_val = get_register(r3);
-  uint64_t bitwise_result = 0;
-  bitwise_result = r2_val & r3_val;
-  SetS390BitWiseConditionCode<uint64_t>(bitwise_result);
-  set_register(r1, bitwise_result);
-  return length;
-}
-
-EVALUATE(OGRK) {
-  DCHECK_OPCODE(OGRK);
-  DECODE_RRF_A_INSTRUCTION(r1, r2, r3);
-  // 64-bit Non-clobbering arithmetics / bitwise ops.
-  int64_t r2_val = get_register(r2);
-  int64_t r3_val = get_register(r3);
-  uint64_t bitwise_result = 0;
-  bitwise_result = r2_val | r3_val;
-  SetS390BitWiseConditionCode<uint64_t>(bitwise_result);
-  set_register(r1, bitwise_result);
-  return length;
-}
-
-EVALUATE(XGRK) {
-  DCHECK_OPCODE(XGRK);
-  DECODE_RRF_A_INSTRUCTION(r1, r2, r3);
-  // 64-bit Non-clobbering arithmetics / bitwise ops.
-  int64_t r2_val = get_register(r2);
-  int64_t r3_val = get_register(r3);
-  uint64_t bitwise_result = 0;
-  bitwise_result = r2_val ^ r3_val;
-  SetS390BitWiseConditionCode<uint64_t>(bitwise_result);
-  set_register(r1, bitwise_result);
-  return length;
-}
-
-EVALUATE(AGRK) {
-  DCHECK_OPCODE(AGRK);
-  DECODE_RRF_A_INSTRUCTION(r1, r2, r3);
-  // 64-bit Non-clobbering arithmetics / bitwise ops.
-  int64_t r2_val = get_register(r2);
-  int64_t r3_val = get_register(r3);
-  bool isOF = CheckOverflowForIntAdd(r2_val, r3_val, int64_t);
-  SetS390ConditionCode<int64_t>(r2_val + r3_val, 0);
-  SetS390OverflowCode(isOF);
-  set_register(r1, r2_val + r3_val);
-  return length;
-}
-
-EVALUATE(SGRK) {
-  DCHECK_OPCODE(SGRK);
-  DECODE_RRF_A_INSTRUCTION(r1, r2, r3);
-  // 64-bit Non-clobbering arithmetics / bitwise ops.
-  int64_t r2_val = get_register(r2);
-  int64_t r3_val = get_register(r3);
-  bool isOF = CheckOverflowForIntSub(r2_val, r3_val, int64_t);
-  SetS390ConditionCode<int64_t>(r2_val - r3_val, 0);
-  SetS390OverflowCode(isOF);
-  set_register(r1, r2_val - r3_val);
-  return length;
-}
-
-EVALUATE(ALGRK) {
-  DCHECK_OPCODE(ALGRK);
-  DECODE_RRF_A_INSTRUCTION(r1, r2, r3);
-  // 64-bit Non-clobbering unsigned arithmetics
-  uint64_t r2_val = get_register(r2);
-  uint64_t r3_val = get_register(r3);
-  bool isOF = CheckOverflowForUIntAdd(r2_val, r3_val);
-  SetS390ConditionCode<uint64_t>(r2_val + r3_val, 0);
-  SetS390OverflowCode(isOF);
-  set_register(r1, r2_val + r3_val);
-  return length;
-}
-
-EVALUATE(SLGRK) {
-  DCHECK_OPCODE(SLGRK);
-  DECODE_RRF_A_INSTRUCTION(r1, r2, r3);
-  // 64-bit Non-clobbering unsigned arithmetics
-  uint64_t r2_val = get_register(r2);
-  uint64_t r3_val = get_register(r3);
-  bool isOF = CheckOverflowForUIntSub(r2_val, r3_val);
-  SetS390ConditionCode<uint64_t>(r2_val - r3_val, 0);
-  SetS390OverflowCode(isOF);
-  set_register(r1, r2_val - r3_val);
-  return length;
-}
-
-EVALUATE(LOCR) {
-  DCHECK_OPCODE(LOCR);
-  DECODE_RRF_C_INSTRUCTION(r1, r2, m3);
-  if (TestConditionCode(m3)) {
-    set_low_register(r1, get_low_register<int32_t>(r2));
-  }
-  return length;
-}
-
-EVALUATE(NRK) {
-  DCHECK_OPCODE(NRK);
-  DECODE_RRF_A_INSTRUCTION(r1, r2, r3);
-  // 32-bit Non-clobbering arithmetics / bitwise ops
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  int32_t r3_val = get_low_register<int32_t>(r3);
-  // Assume bitwise operation here
-  uint32_t bitwise_result = 0;
-  bitwise_result = r2_val & r3_val;
-  SetS390BitWiseConditionCode<uint32_t>(bitwise_result);
-  set_low_register(r1, bitwise_result);
-  return length;
-}
-
-EVALUATE(ORK) {
-  DCHECK_OPCODE(ORK);
-  DECODE_RRF_A_INSTRUCTION(r1, r2, r3);
-  // 32-bit Non-clobbering arithmetics / bitwise ops
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  int32_t r3_val = get_low_register<int32_t>(r3);
-  // Assume bitwise operation here
-  uint32_t bitwise_result = 0;
-  bitwise_result = r2_val | r3_val;
-  SetS390BitWiseConditionCode<uint32_t>(bitwise_result);
-  set_low_register(r1, bitwise_result);
-  return length;
-}
-
-EVALUATE(XRK) {
-  DCHECK_OPCODE(XRK);
-  DECODE_RRF_A_INSTRUCTION(r1, r2, r3);
-  // 32-bit Non-clobbering arithmetics / bitwise ops
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  int32_t r3_val = get_low_register<int32_t>(r3);
-  // Assume bitwise operation here
-  uint32_t bitwise_result = 0;
-  bitwise_result = r2_val ^ r3_val;
-  SetS390BitWiseConditionCode<uint32_t>(bitwise_result);
-  set_low_register(r1, bitwise_result);
-  return length;
-}
-
-EVALUATE(ARK) {
-  DCHECK_OPCODE(ARK);
-  DECODE_RRF_A_INSTRUCTION(r1, r2, r3);
-  // 32-bit Non-clobbering arithmetics / bitwise ops
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  int32_t r3_val = get_low_register<int32_t>(r3);
-  bool isOF = CheckOverflowForIntAdd(r2_val, r3_val, int32_t);
-  SetS390ConditionCode<int32_t>(r2_val + r3_val, 0);
-  SetS390OverflowCode(isOF);
-  set_low_register(r1, r2_val + r3_val);
-  return length;
-}
-
-EVALUATE(SRK) {
-  DCHECK_OPCODE(SRK);
-  DECODE_RRF_A_INSTRUCTION(r1, r2, r3);
-  // 32-bit Non-clobbering arithmetics / bitwise ops
-  int32_t r2_val = get_low_register<int32_t>(r2);
-  int32_t r3_val = get_low_register<int32_t>(r3);
-  bool isOF = CheckOverflowForIntSub(r2_val, r3_val, int32_t);
-  SetS390ConditionCode<int32_t>(r2_val - r3_val, 0);
-  SetS390OverflowCode(isOF);
-  set_low_register(r1, r2_val - r3_val);
-  return length;
-}
-
-EVALUATE(ALRK) {
-  DCHECK_OPCODE(ALRK);
-  DECODE_RRF_A_INSTRUCTION(r1, r2, r3);
-  // 32-bit Non-clobbering unsigned arithmetics
-  uint32_t r2_val = get_low_register<uint32_t>(r2);
-  uint32_t r3_val = get_low_register<uint32_t>(r3);
-  bool isOF = CheckOverflowForUIntAdd(r2_val, r3_val);
-  SetS390ConditionCode<uint32_t>(r2_val + r3_val, 0);
-  SetS390OverflowCode(isOF);
-  set_low_register(r1, r2_val + r3_val);
-  return length;
-}
-
-EVALUATE(SLRK) {
-  DCHECK_OPCODE(SLRK);
-  DECODE_RRF_A_INSTRUCTION(r1, r2, r3);
-  // 32-bit Non-clobbering unsigned arithmetics
-  uint32_t r2_val = get_low_register<uint32_t>(r2);
-  uint32_t r3_val = get_low_register<uint32_t>(r3);
-  bool isOF = CheckOverflowForUIntSub(r2_val, r3_val);
-  SetS390ConditionCode<uint32_t>(r2_val - r3_val, 0);
-  SetS390OverflowCode(isOF);
-  set_low_register(r1, r2_val - r3_val);
-  return length;
-}
-
-EVALUATE(LTG) {
-  DCHECK_OPCODE(LTG);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  intptr_t addr = x2_val + b2_val + d2;
-  int64_t value = ReadDW(addr);
-  set_register(r1, value);
-  SetS390ConditionCode<int64_t>(value, 0);
-  return length;
-}
-
-EVALUATE(CVBY) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(AG) {
-  DCHECK_OPCODE(AG);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t alu_out = get_register(r1);
-  int64_t mem_val = ReadDW(b2_val + x2_val + d2);
-  bool isOF = CheckOverflowForIntAdd(alu_out, mem_val, int64_t);
-  alu_out += mem_val;
-  SetS390ConditionCode<int64_t>(alu_out, 0);
-  SetS390OverflowCode(isOF);
-  set_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(SG) {
-  DCHECK_OPCODE(SG);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t alu_out = get_register(r1);
-  int64_t mem_val = ReadDW(b2_val + x2_val + d2);
-  bool isOF = CheckOverflowForIntSub(alu_out, mem_val, int64_t);
-  alu_out -= mem_val;
-  SetS390ConditionCode<int32_t>(alu_out, 0);
-  SetS390OverflowCode(isOF);
-  set_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(ALG) {
-  DCHECK_OPCODE(ALG);
-#ifndef V8_TARGET_ARCH_S390X
-  DCHECK(false);
-#endif
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  uint64_t r1_val = get_register(r1);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t d2_val = d2;
-  uint64_t alu_out = r1_val;
-  uint64_t mem_val = static_cast<uint64_t>(ReadDW(b2_val + d2_val + x2_val));
-  alu_out += mem_val;
-  SetS390ConditionCode<uint64_t>(alu_out, 0);
-  set_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(SLG) {
-  DCHECK_OPCODE(SLG);
-#ifndef V8_TARGET_ARCH_S390X
-  DCHECK(false);
-#endif
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  uint64_t r1_val = get_register(r1);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t d2_val = d2;
-  uint64_t alu_out = r1_val;
-  uint64_t mem_val = static_cast<uint64_t>(ReadDW(b2_val + d2_val + x2_val));
-  alu_out -= mem_val;
-  SetS390ConditionCode<uint64_t>(alu_out, 0);
-  set_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(MSG) {
-  DCHECK_OPCODE(MSG);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t d2_val = d2;
-  int64_t mem_val = ReadDW(b2_val + d2_val + x2_val);
-  int64_t r1_val = get_register(r1);
-  set_register(r1, mem_val * r1_val);
-  return length;
-}
-
-EVALUATE(DSG) {
-  DCHECK_OPCODE(DSG);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  DCHECK_EQ(r1 % 2, 0);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t d2_val = d2;
-  int64_t mem_val = ReadDW(b2_val + d2_val + x2_val);
-  int64_t r1_val = get_register(r1 + 1);
-  int64_t quotient = r1_val / mem_val;
-  int64_t remainder = r1_val % mem_val;
-  set_register(r1, remainder);
-  set_register(r1 + 1, quotient);
-  return length;
-}
-
-EVALUATE(CVBG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LT) {
-  DCHECK_OPCODE(LT);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  intptr_t addr = x2_val + b2_val + d2;
-  int32_t value = ReadW(addr, instr);
-  set_low_register(r1, value);
-  SetS390ConditionCode<int32_t>(value, 0);
-  return length;
-}
-
-EVALUATE(LGH) {
-  DCHECK_OPCODE(LGH);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  // Miscellaneous Loads and Stores
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  intptr_t addr = x2_val + b2_val + d2;
-  int64_t mem_val = static_cast<int64_t>(ReadH(addr, instr));
-  set_register(r1, mem_val);
-  return length;
-}
-
-EVALUATE(LLGF) {
-  DCHECK_OPCODE(LLGF);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  // Miscellaneous Loads and Stores
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  intptr_t addr = x2_val + b2_val + d2;
-  uint64_t mem_val = static_cast<uint64_t>(ReadWU(addr, instr));
-  set_register(r1, mem_val);
-  return length;
-}
-
-EVALUATE(LLGT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(AGF) {
-  DCHECK_OPCODE(AGF);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  uint64_t r1_val = get_register(r1);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t d2_val = d2;
-  uint64_t alu_out = r1_val;
-  uint32_t mem_val = ReadW(b2_val + d2_val + x2_val, instr);
-  alu_out += mem_val;
-  SetS390ConditionCode<int64_t>(alu_out, 0);
-  set_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(SGF) {
-  DCHECK_OPCODE(SGF);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  uint64_t r1_val = get_register(r1);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t d2_val = d2;
-  uint64_t alu_out = r1_val;
-  uint32_t mem_val = ReadW(b2_val + d2_val + x2_val, instr);
-  alu_out -= mem_val;
-  SetS390ConditionCode<int64_t>(alu_out, 0);
-  set_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(ALGF) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SLGF) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MSGF) {
-  DCHECK_OPCODE(MSGF);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t d2_val = d2;
-  int64_t mem_val =
-      static_cast<int64_t>(ReadW(b2_val + d2_val + x2_val, instr));
-  int64_t r1_val = get_register(r1);
-  int64_t product = r1_val * mem_val;
-  set_register(r1, product);
-  return length;
-}
-
-EVALUATE(DSGF) {
-  DCHECK_OPCODE(DSGF);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  DCHECK_EQ(r1 % 2, 0);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t d2_val = d2;
-  int64_t mem_val =
-      static_cast<int64_t>(ReadW(b2_val + d2_val + x2_val, instr));
-  int64_t r1_val = get_register(r1 + 1);
-  int64_t quotient = r1_val / mem_val;
-  int64_t remainder = r1_val % mem_val;
-  set_register(r1, remainder);
-  set_register(r1 + 1, quotient);
-  return length;
-}
-
-EVALUATE(LRVG) {
-  DCHECK_OPCODE(LRVG);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  intptr_t mem_addr = b2_val + x2_val + d2;
-  int64_t mem_val = ReadW64(mem_addr, instr);
-  set_register(r1, ByteReverse(mem_val));
-  return length;
-}
-
-EVALUATE(LRV) {
-  DCHECK_OPCODE(LRV);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  intptr_t mem_addr = b2_val + x2_val + d2;
-  int32_t mem_val = ReadW(mem_addr, instr);
-  set_low_register(r1, ByteReverse(mem_val));
-  return length;
-}
-
-EVALUATE(LRVH) {
-  DCHECK_OPCODE(LRVH);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  intptr_t mem_addr = b2_val + x2_val + d2;
-  int16_t mem_val = ReadH(mem_addr, instr);
-  int32_t result = ByteReverse(mem_val) & 0x0000FFFF;
-  result |= r1_val & 0xFFFF0000;
-  set_low_register(r1, result);
-  return length;
-}
-
-EVALUATE(CG) {
-  DCHECK_OPCODE(CG);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t alu_out = get_register(r1);
-  int64_t mem_val = ReadDW(b2_val + x2_val + d2);
-  SetS390ConditionCode<int64_t>(alu_out, mem_val);
-  set_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(CLG) {
-  DCHECK_OPCODE(CLG);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t alu_out = get_register(r1);
-  int64_t mem_val = ReadDW(b2_val + x2_val + d2);
-  SetS390ConditionCode<uint64_t>(alu_out, mem_val);
-  set_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(NTSTG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CVDY) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CVDG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CGF) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CLGF) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LTGF) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CGH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(PFD) {
-  DCHECK_OPCODE(PFD);
-  USE(instr);
-  return 6;
-}
-
-EVALUATE(STRV) {
-  DCHECK_OPCODE(STRV);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  intptr_t mem_addr = b2_val + x2_val + d2;
-  WriteW(mem_addr, ByteReverse(r1_val), instr);
-  return length;
-}
-
-EVALUATE(STRVG) {
-  DCHECK_OPCODE(STRVG);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t r1_val = get_register(r1);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  intptr_t mem_addr = b2_val + x2_val + d2;
-  WriteDW(mem_addr, ByteReverse(r1_val));
-  return length;
-}
-
-EVALUATE(STRVH) {
-  DCHECK_OPCODE(STRVH);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  intptr_t mem_addr = b2_val + x2_val + d2;
-  int16_t result = static_cast<int16_t>(r1_val >> 16);
-  WriteH(mem_addr, ByteReverse(result), instr);
-  return length;
-}
-
-EVALUATE(BCTG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MSY) {
-  DCHECK_OPCODE(MSY);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t d2_val = d2;
-  int32_t mem_val = ReadW(b2_val + d2_val + x2_val, instr);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  set_low_register(r1, mem_val * r1_val);
-  return length;
-}
-
-EVALUATE(MSC) {
-  DCHECK_OPCODE(MSC);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t d2_val = d2;
-  int32_t mem_val = ReadW(b2_val + d2_val + x2_val, instr);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int64_t result64 =
-      static_cast<int64_t>(r1_val) * static_cast<int64_t>(mem_val);
-  int32_t result32 = static_cast<int32_t>(result64);
-  bool isOF = (static_cast<int64_t>(result32) != result64);
-  SetS390ConditionCode<int32_t>(result32, 0);
-  SetS390OverflowCode(isOF);
-  set_low_register(r1, result32);
-  set_low_register(r1, mem_val * r1_val);
-  return length;
-}
-
-EVALUATE(NY) {
-  DCHECK_OPCODE(NY);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int32_t alu_out = get_low_register<int32_t>(r1);
-  int32_t mem_val = ReadW(b2_val + x2_val + d2, instr);
-  alu_out &= mem_val;
-  SetS390BitWiseConditionCode<uint32_t>(alu_out);
-  set_low_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(CLY) {
-  DCHECK_OPCODE(CLY);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  uint32_t alu_out = get_low_register<uint32_t>(r1);
-  uint32_t mem_val = ReadWU(b2_val + x2_val + d2, instr);
-  SetS390ConditionCode<uint32_t>(alu_out, mem_val);
-  return length;
-}
-
-EVALUATE(OY) {
-  DCHECK_OPCODE(OY);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int32_t alu_out = get_low_register<int32_t>(r1);
-  int32_t mem_val = ReadW(b2_val + x2_val + d2, instr);
-  alu_out |= mem_val;
-  SetS390BitWiseConditionCode<uint32_t>(alu_out);
-  set_low_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(XY) {
-  DCHECK_OPCODE(XY);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int32_t alu_out = get_low_register<int32_t>(r1);
-  int32_t mem_val = ReadW(b2_val + x2_val + d2, instr);
-  alu_out ^= mem_val;
-  SetS390BitWiseConditionCode<uint32_t>(alu_out);
-  set_low_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(CY) {
-  DCHECK_OPCODE(CY);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int32_t alu_out = get_low_register<int32_t>(r1);
-  int32_t mem_val = ReadW(b2_val + x2_val + d2, instr);
-  SetS390ConditionCode<int32_t>(alu_out, mem_val);
-  return length;
-}
-
-EVALUATE(AY) {
-  DCHECK_OPCODE(AY);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int32_t alu_out = get_low_register<int32_t>(r1);
-  int32_t mem_val = ReadW(b2_val + x2_val + d2, instr);
-  bool isOF = false;
-  isOF = CheckOverflowForIntAdd(alu_out, mem_val, int32_t);
-  alu_out += mem_val;
-  SetS390ConditionCode<int32_t>(alu_out, 0);
-  SetS390OverflowCode(isOF);
-  set_low_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(SY) {
-  DCHECK_OPCODE(SY);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int32_t alu_out = get_low_register<int32_t>(r1);
-  int32_t mem_val = ReadW(b2_val + x2_val + d2, instr);
-  bool isOF = false;
-  isOF = CheckOverflowForIntSub(alu_out, mem_val, int32_t);
-  alu_out -= mem_val;
-  SetS390ConditionCode<int32_t>(alu_out, 0);
-  SetS390OverflowCode(isOF);
-  set_low_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(MFY) {
-  DCHECK_OPCODE(MFY);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  DCHECK_EQ(r1 % 2, 0);
-  int32_t mem_val = ReadW(b2_val + x2_val + d2, instr);
-  int32_t r1_val = get_low_register<int32_t>(r1 + 1);
-  int64_t product =
-      static_cast<int64_t>(r1_val) * static_cast<int64_t>(mem_val);
-  int32_t high_bits = product >> 32;
-  r1_val = high_bits;
-  int32_t low_bits = product & 0x00000000FFFFFFFF;
-  set_low_register(r1, high_bits);
-  set_low_register(r1 + 1, low_bits);
-  return length;
-}
-
-EVALUATE(ALY) {
-  DCHECK_OPCODE(ALY);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  uint32_t alu_out = get_low_register<uint32_t>(r1);
-  uint32_t mem_val = ReadWU(b2_val + x2_val + d2, instr);
-  alu_out += mem_val;
-  set_low_register(r1, alu_out);
-  SetS390ConditionCode<uint32_t>(alu_out, 0);
-  return length;
-}
-
-EVALUATE(SLY) {
-  DCHECK_OPCODE(SLY);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  uint32_t alu_out = get_low_register<uint32_t>(r1);
-  uint32_t mem_val = ReadWU(b2_val + x2_val + d2, instr);
-  alu_out -= mem_val;
-  set_low_register(r1, alu_out);
-  SetS390ConditionCode<uint32_t>(alu_out, 0);
-  return length;
-}
-
-EVALUATE(STHY) {
-  DCHECK_OPCODE(STHY);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  // Miscellaneous Loads and Stores
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  intptr_t addr = x2_val + b2_val + d2;
-  uint16_t value = get_low_register<uint32_t>(r1);
-  WriteH(addr, value, instr);
-  return length;
-}
-
-EVALUATE(LAY) {
-  DCHECK_OPCODE(LAY);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  // Load Address
-  int rb = b2;
-  int rx = x2;
-  int offset = d2;
-  int64_t rb_val = (rb == 0) ? 0 : get_register(rb);
-  int64_t rx_val = (rx == 0) ? 0 : get_register(rx);
-  set_register(r1, rx_val + rb_val + offset);
-  return length;
-}
-
-EVALUATE(STCY) {
-  DCHECK_OPCODE(STCY);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  // Miscellaneous Loads and Stores
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  intptr_t addr = x2_val + b2_val + d2;
-  uint8_t value = get_low_register<uint32_t>(r1);
-  WriteB(addr, value);
-  return length;
-}
-
-EVALUATE(ICY) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LAEY) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LB) {
-  DCHECK_OPCODE(LB);
-  // Miscellaneous Loads and Stores
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  intptr_t addr = x2_val + b2_val + d2;
-  int32_t mem_val = ReadB(addr);
-  set_low_register(r1, mem_val);
-  return length;
-}
-
-EVALUATE(LGB) {
-  DCHECK_OPCODE(LGB);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  // Miscellaneous Loads and Stores
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  intptr_t addr = x2_val + b2_val + d2;
-  int64_t mem_val = ReadB(addr);
-  set_register(r1, mem_val);
-  return length;
-}
-
-EVALUATE(LHY) {
-  DCHECK_OPCODE(LHY);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  // Miscellaneous Loads and Stores
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  intptr_t addr = x2_val + b2_val + d2;
-  int32_t result = static_cast<int32_t>(ReadH(addr, instr));
-  set_low_register(r1, result);
-  return length;
-}
-
-EVALUATE(CHY) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(AHY) {
-  DCHECK_OPCODE(AHY);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t d2_val = d2;
-  int32_t mem_val =
-      static_cast<int32_t>(ReadH(b2_val + d2_val + x2_val, instr));
-  int32_t alu_out = 0;
-  bool isOF = false;
-  alu_out = r1_val + mem_val;
-  isOF = CheckOverflowForIntAdd(r1_val, mem_val, int32_t);
-  set_low_register(r1, alu_out);
-  SetS390ConditionCode<int32_t>(alu_out, 0);
-  SetS390OverflowCode(isOF);
-  return length;
-}
-
-EVALUATE(SHY) {
-  DCHECK_OPCODE(SHY);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t d2_val = d2;
-  int32_t mem_val =
-      static_cast<int32_t>(ReadH(b2_val + d2_val + x2_val, instr));
-  int32_t alu_out = 0;
-  bool isOF = false;
-  alu_out = r1_val - mem_val;
-  isOF = CheckOverflowForIntSub(r1_val, mem_val, int64_t);
-  set_low_register(r1, alu_out);
-  SetS390ConditionCode<int32_t>(alu_out, 0);
-  SetS390OverflowCode(isOF);
-  return length;
-}
-
-EVALUATE(MHY) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(NG) {
-  DCHECK_OPCODE(NG);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t alu_out = get_register(r1);
-  int64_t mem_val = ReadDW(b2_val + x2_val + d2);
-  alu_out &= mem_val;
-  SetS390BitWiseConditionCode<uint32_t>(alu_out);
-  set_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(OG) {
-  DCHECK_OPCODE(OG);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t alu_out = get_register(r1);
-  int64_t mem_val = ReadDW(b2_val + x2_val + d2);
-  alu_out |= mem_val;
-  SetS390BitWiseConditionCode<uint32_t>(alu_out);
-  set_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(XG) {
-  DCHECK_OPCODE(XG);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t alu_out = get_register(r1);
-  int64_t mem_val = ReadDW(b2_val + x2_val + d2);
-  alu_out ^= mem_val;
-  SetS390BitWiseConditionCode<uint32_t>(alu_out);
-  set_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(LGAT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MLG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(DLG) {
-  DCHECK_OPCODE(DLG);
-#ifdef V8_TARGET_ARCH_S390X
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  uint64_t r1_val = get_register(r1);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  DCHECK_EQ(r1 % 2, 0);
-  unsigned __int128 dividend = static_cast<unsigned __int128>(r1_val) << 64;
-  dividend += get_register(r1 + 1);
-  int64_t mem_val = ReadDW(b2_val + x2_val + d2);
-  uint64_t remainder = dividend % mem_val;
-  uint64_t quotient = dividend / mem_val;
-  set_register(r1, remainder);
-  set_register(r1 + 1, quotient);
-  return length;
-#else
-  // 32 bit arch doesn't support __int128 type
-  USE(instr);
-  UNREACHABLE();
-#endif
-}
-
-EVALUATE(ALCG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SLBG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(STPQ) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LPQ) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LLGH) {
-  DCHECK_OPCODE(LLGH);
-  // Load Logical Halfword
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t d2_val = d2;
-  uint16_t mem_val = ReadHU(b2_val + d2_val + x2_val, instr);
-  set_register(r1, mem_val);
-  return length;
-}
-
-EVALUATE(LLH) {
-  DCHECK_OPCODE(LLH);
-  // Load Logical Halfword
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t d2_val = d2;
-  uint16_t mem_val = ReadHU(b2_val + d2_val + x2_val, instr);
-  set_low_register(r1, mem_val);
-  return length;
-}
-
-EVALUATE(ML) {
-  DCHECK_OPCODE(ML);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  DCHECK_EQ(r1 % 2, 0);
-  uint32_t mem_val = ReadWU(b2_val + x2_val + d2, instr);
-  uint32_t r1_val = get_low_register<uint32_t>(r1 + 1);
-  uint64_t product =
-      static_cast<uint64_t>(r1_val) * static_cast<uint64_t>(mem_val);
-  uint32_t high_bits = product >> 32;
-  r1_val = high_bits;
-  uint32_t low_bits = product & 0x00000000FFFFFFFF;
-  set_low_register(r1, high_bits);
-  set_low_register(r1 + 1, low_bits);
-  return length;
-}
-
-EVALUATE(DL) {
-  DCHECK_OPCODE(DL);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  DCHECK_EQ(r1 % 2, 0);
-  uint32_t mem_val = ReadWU(b2_val + x2_val + d2, instr);
-  uint32_t r1_val = get_low_register<uint32_t>(r1 + 1);
-  uint64_t quotient =
-      static_cast<uint64_t>(r1_val) / static_cast<uint64_t>(mem_val);
-  uint64_t remainder =
-      static_cast<uint64_t>(r1_val) % static_cast<uint64_t>(mem_val);
-  set_low_register(r1, remainder);
-  set_low_register(r1 + 1, quotient);
-  return length;
-}
-
-EVALUATE(ALC) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SLB) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LLGTAT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LLGFAT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LAT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LBH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LLCH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(STCH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LHH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LLHH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(STHH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LFHAT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LFH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(STFH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CHF) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MVCDK) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MVHHI) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MVGHI) {
-  DCHECK_OPCODE(MVGHI);
-  // Move Integer (64)
-  DECODE_SIL_INSTRUCTION(b1, d1, i2);
-  int64_t b1_val = (b1 == 0) ? 0 : get_register(b1);
-  intptr_t src_addr = b1_val + d1;
-  WriteDW(src_addr, i2);
-  return length;
-}
-
-EVALUATE(MVHI) {
-  DCHECK_OPCODE(MVHI);
-  // Move Integer (32)
-  DECODE_SIL_INSTRUCTION(b1, d1, i2);
-  int64_t b1_val = (b1 == 0) ? 0 : get_register(b1);
-  intptr_t src_addr = b1_val + d1;
-  WriteW(src_addr, i2, instr);
-  return length;
-}
-
-EVALUATE(CHHSI) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CGHSI) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CHSI) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CLFHSI) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TBEGIN) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TBEGINC) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LMG) {
-  DCHECK_OPCODE(LMG);
-  // Store Multiple 64-bits.
-  DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2);
-  int rb = b2;
-  int offset = d2;
-
-  // Regs roll around if r3 is less than r1.
-  // Artificially increase r3 by 16 so we can calculate
-  // the number of regs stored properly.
-  if (r3 < r1) r3 += 16;
-
-  int64_t rb_val = (rb == 0) ? 0 : get_register(rb);
-
-  // Store each register in ascending order.
-  for (int i = 0; i <= r3 - r1; i++) {
-    int64_t value = ReadDW(rb_val + offset + 8 * i);
-    set_register((r1 + i) % 16, value);
-  }
-  return length;
-}
-
-EVALUATE(SRAG) {
-  DCHECK_OPCODE(SRAG);
-  // 64-bit non-clobbering shift-left/right arithmetic
-  DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2);
-  // only takes rightmost 6 bits
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int shiftBits = (b2_val + d2) & 0x3F;
-  int64_t r3_val = get_register(r3);
-  intptr_t alu_out = 0;
-  bool isOF = false;
-  alu_out = r3_val >> shiftBits;
-  set_register(r1, alu_out);
-  SetS390ConditionCode<intptr_t>(alu_out, 0);
-  SetS390OverflowCode(isOF);
-  return length;
-}
-
-EVALUATE(SLAG) {
-  DCHECK_OPCODE(SLAG);
-  // 64-bit non-clobbering shift-left/right arithmetic
-  DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2);
-  // only takes rightmost 6 bits
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int shiftBits = (b2_val + d2) & 0x3F;
-  int64_t r3_val = get_register(r3);
-  intptr_t alu_out = 0;
-  bool isOF = false;
-  isOF = CheckOverflowForShiftLeft(r3_val, shiftBits);
-  alu_out = r3_val << shiftBits;
-  set_register(r1, alu_out);
-  SetS390ConditionCode<intptr_t>(alu_out, 0);
-  SetS390OverflowCode(isOF);
-  return length;
-}
-
-EVALUATE(SRLG) {
-  DCHECK_OPCODE(SRLG);
-  // For SLLG/SRLG, the 64-bit third operand is shifted the number
-  // of bits specified by the second-operand address, and the result is
-  // placed at the first-operand location. Except for when the R1 and R3
-  // fields designate the same register, the third operand remains
-  // unchanged in general register R3.
-  DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2);
-  // only takes rightmost 6 bits
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int shiftBits = (b2_val + d2) & 0x3F;
-  // unsigned
-  uint64_t r3_val = get_register(r3);
-  uint64_t alu_out = 0;
-  alu_out = r3_val >> shiftBits;
-  set_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(SLLG) {
-  DCHECK_OPCODE(SLLG);
-  // For SLLG/SRLG, the 64-bit third operand is shifted the number
-  // of bits specified by the second-operand address, and the result is
-  // placed at the first-operand location. Except for when the R1 and R3
-  // fields designate the same register, the third operand remains
-  // unchanged in general register R3.
-  DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2);
-  // only takes rightmost 6 bits
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int shiftBits = (b2_val + d2) & 0x3F;
-  // unsigned
-  uint64_t r3_val = get_register(r3);
-  uint64_t alu_out = 0;
-  alu_out = r3_val << shiftBits;
-  set_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(CS) {
-  DCHECK_OPCODE(CS);
-  DECODE_RS_A_INSTRUCTION(r1, r3, rb, d2);
-  int32_t offset = d2;
-  int64_t rb_val = (rb == 0) ? 0 : get_register(rb);
-  intptr_t target_addr = static_cast<intptr_t>(rb_val) + offset;
-
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int32_t r3_val = get_low_register<int32_t>(r3);
-
-  DCHECK_EQ(target_addr & 0x3, 0);
-  bool is_success = __atomic_compare_exchange_n(
-      reinterpret_cast<int32_t*>(target_addr), &r1_val, r3_val, true,
-      __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
-  if (!is_success) {
-    set_low_register(r1, r1_val);
-    condition_reg_ = 0x4;
-  } else {
-    condition_reg_ = 0x8;
-  }
-  return length;
-}
-
-EVALUATE(CSY) {
-  DCHECK_OPCODE(CSY);
-  DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2);
-  int32_t offset = d2;
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  intptr_t target_addr = static_cast<intptr_t>(b2_val) + offset;
-
-  int32_t r1_val = get_low_register<int32_t>(r1);
-  int32_t r3_val = get_low_register<int32_t>(r3);
-
-  DCHECK_EQ(target_addr & 0x3, 0);
-  bool is_success = __atomic_compare_exchange_n(
-      reinterpret_cast<int32_t*>(target_addr), &r1_val, r3_val, true,
-      __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
-  if (!is_success) {
-    set_low_register(r1, r1_val);
-    condition_reg_ = 0x4;
-  } else {
-    condition_reg_ = 0x8;
-  }
-  return length;
-}
-
-EVALUATE(CSG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(RLLG) {
-  DCHECK_OPCODE(RLLG);
-  // For SLLG/SRLG, the 64-bit third operand is shifted the number
-  // of bits specified by the second-operand address, and the result is
-  // placed at the first-operand location. Except for when the R1 and R3
-  // fields designate the same register, the third operand remains
-  // unchanged in general register R3.
-  DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2);
-  // only takes rightmost 6 bits
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int shiftBits = (b2_val + d2) & 0x3F;
-  // unsigned
-  uint64_t r3_val = get_register(r3);
-  uint64_t alu_out = 0;
-  uint64_t rotateBits = r3_val >> (64 - shiftBits);
-  alu_out = (r3_val << shiftBits) | (rotateBits);
-  set_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(STMG) {
-  DCHECK_OPCODE(STMG);
-  DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2);
-  int rb = b2;
-  int offset = d2;
-
-  // Regs roll around if r3 is less than r1.
-  // Artificially increase r3 by 16 so we can calculate
-  // the number of regs stored properly.
-  if (r3 < r1) r3 += 16;
-
-  int64_t rb_val = (rb == 0) ? 0 : get_register(rb);
-
-  // Store each register in ascending order.
-  for (int i = 0; i <= r3 - r1; i++) {
-    int64_t value = get_register((r1 + i) % 16);
-    WriteDW(rb_val + offset + 8 * i, value);
-  }
-  return length;
-}
-
-EVALUATE(STMH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(STCMH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(STCMY) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CDSY) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CDSG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(BXHG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(BXLEG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(ECAG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TMY) {
-  DCHECK_OPCODE(TMY);
-  // Test Under Mask (Mem - Imm) (8)
-  DECODE_SIY_INSTRUCTION(b1, d1, i2);
-  int64_t b1_val = (b1 == 0) ? 0 : get_register(b1);
-  intptr_t d1_val = d1;
-  intptr_t addr = b1_val + d1_val;
-  uint8_t mem_val = ReadB(addr);
-  uint8_t imm_val = i2;
-  uint8_t selected_bits = mem_val & imm_val;
-  // CC0: Selected bits are zero
-  // CC1: Selected bits mixed zeros and ones
-  // CC3: Selected bits all ones
-  if (0 == selected_bits) {
-    condition_reg_ = CC_EQ;  // CC0
-  } else if (selected_bits == imm_val) {
-    condition_reg_ = 0x1;  // CC3
-  } else {
-    condition_reg_ = 0x4;  // CC1
-  }
-  return length;
-}
-
-EVALUATE(MVIY) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(NIY) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CLIY) {
-  DCHECK_OPCODE(CLIY);
-  DECODE_SIY_INSTRUCTION(b1, d1, i2);
-  // Compare Immediate (Mem - Imm) (8)
-  int64_t b1_val = (b1 == 0) ? 0 : get_register(b1);
-  intptr_t d1_val = d1;
-  intptr_t addr = b1_val + d1_val;
-  uint8_t mem_val = ReadB(addr);
-  uint8_t imm_val = i2;
-  SetS390ConditionCode<uint8_t>(mem_val, imm_val);
-  return length;
-}
-
-EVALUATE(OIY) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(XIY) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(ASI) {
-  DCHECK_OPCODE(ASI);
-  // TODO(bcleung): Change all fooInstr->I2Value() to template functions.
-  // The below static cast to 8 bit and then to 32 bit is necessary
-  // because siyInstr->I2Value() returns a uint8_t, which a direct
-  // cast to int32_t could incorrectly interpret.
-  DECODE_SIY_INSTRUCTION(b1, d1, i2_unsigned);
-  int8_t i2_8bit = static_cast<int8_t>(i2_unsigned);
-  int32_t i2 = static_cast<int32_t>(i2_8bit);
-  intptr_t b1_val = (b1 == 0) ? 0 : get_register(b1);
-
-  int d1_val = d1;
-  intptr_t addr = b1_val + d1_val;
-
-  int32_t mem_val = ReadW(addr, instr);
-  bool isOF = CheckOverflowForIntAdd(mem_val, i2, int32_t);
-  int32_t alu_out = mem_val + i2;
-  SetS390ConditionCode<int32_t>(alu_out, 0);
-  SetS390OverflowCode(isOF);
-  WriteW(addr, alu_out, instr);
-  return length;
-}
-
-EVALUATE(ALSI) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(AGSI) {
-  DCHECK_OPCODE(AGSI);
-  // TODO(bcleung): Change all fooInstr->I2Value() to template functions.
-  // The below static cast to 8 bit and then to 32 bit is necessary
-  // because siyInstr->I2Value() returns a uint8_t, which a direct
-  // cast to int32_t could incorrectly interpret.
-  DECODE_SIY_INSTRUCTION(b1, d1, i2_unsigned);
-  int8_t i2_8bit = static_cast<int8_t>(i2_unsigned);
-  int64_t i2 = static_cast<int64_t>(i2_8bit);
-  intptr_t b1_val = (b1 == 0) ? 0 : get_register(b1);
-
-  int d1_val = d1;
-  intptr_t addr = b1_val + d1_val;
-
-  int64_t mem_val = ReadDW(addr);
-  int isOF = CheckOverflowForIntAdd(mem_val, i2, int64_t);
-  int64_t alu_out = mem_val + i2;
-  SetS390ConditionCode<uint64_t>(alu_out, 0);
-  SetS390OverflowCode(isOF);
-  WriteDW(addr, alu_out);
-  return length;
-}
-
-EVALUATE(ALGSI) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(ICMH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(ICMY) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MVCLU) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CLCLU) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(STMY) {
-  DCHECK_OPCODE(STMY);
-  DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2);
-  // Load/Store Multiple (32)
-  int offset = d2;
-
-  // Regs roll around if r3 is less than r1.
-  // Artificially increase r3 by 16 so we can calculate
-  // the number of regs stored properly.
-  if (r3 < r1) r3 += 16;
-
-  int32_t b2_val = (b2 == 0) ? 0 : get_low_register<int32_t>(b2);
-
-  // Store each register in ascending order.
-  for (int i = 0; i <= r3 - r1; i++) {
-    int32_t value = get_low_register<int32_t>((r1 + i) % 16);
-    WriteW(b2_val + offset + 4 * i, value, instr);
-  }
-  return length;
-}
-
-EVALUATE(LMH) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LMY) {
-  DCHECK_OPCODE(LMY);
-  DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2);
-  // Load/Store Multiple (32)
-  int offset = d2;
-
-  // Regs roll around if r3 is less than r1.
-  // Artificially increase r3 by 16 so we can calculate
-  // the number of regs stored properly.
-  if (r3 < r1) r3 += 16;
-
-  int32_t b2_val = (b2 == 0) ? 0 : get_low_register<int32_t>(b2);
-
-  // Store each register in ascending order.
-  for (int i = 0; i <= r3 - r1; i++) {
-    int32_t value = ReadW(b2_val + offset + 4 * i, instr);
-    set_low_register((r1 + i) % 16, value);
-  }
-  return length;
-}
-
-EVALUATE(TP) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SRAK) {
-  DCHECK_OPCODE(SRAK);
-  DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2);
-  // 32-bit non-clobbering shift-left/right arithmetic
-  // only takes rightmost 6 bits
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int shiftBits = (b2_val + d2) & 0x3F;
-  int32_t r3_val = get_low_register<int32_t>(r3);
-  int32_t alu_out = 0;
-  bool isOF = false;
-  alu_out = r3_val >> shiftBits;
-  set_low_register(r1, alu_out);
-  SetS390ConditionCode<int32_t>(alu_out, 0);
-  SetS390OverflowCode(isOF);
-  return length;
-}
-
-EVALUATE(SLAK) {
-  DCHECK_OPCODE(SLAK);
-  DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2);
-  // 32-bit non-clobbering shift-left/right arithmetic
-  // only takes rightmost 6 bits
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int shiftBits = (b2_val + d2) & 0x3F;
-  int32_t r3_val = get_low_register<int32_t>(r3);
-  int32_t alu_out = 0;
-  bool isOF = false;
-  isOF = CheckOverflowForShiftLeft(r3_val, shiftBits);
-  alu_out = r3_val << shiftBits;
-  set_low_register(r1, alu_out);
-  SetS390ConditionCode<int32_t>(alu_out, 0);
-  SetS390OverflowCode(isOF);
-  return length;
-}
-
-EVALUATE(SRLK) {
-  DCHECK_OPCODE(SRLK);
-  // For SLLK/SRLL, the 32-bit third operand is shifted the number
-  // of bits specified by the second-operand address, and the result is
-  // placed at the first-operand location. Except for when the R1 and R3
-  // fields designate the same register, the third operand remains
-  // unchanged in general register R3.
-  DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2);
-  // only takes rightmost 6 bits
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int shiftBits = (b2_val + d2) & 0x3F;
-  // unsigned
-  uint32_t r3_val = get_low_register<uint32_t>(r3);
-  uint32_t alu_out = 0;
-  alu_out = r3_val >> shiftBits;
-  set_low_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(SLLK) {
-  DCHECK_OPCODE(SLLK);
-  // For SLLK/SRLL, the 32-bit third operand is shifted the number
-  // of bits specified by the second-operand address, and the result is
-  // placed at the first-operand location. Except for when the R1 and R3
-  // fields designate the same register, the third operand remains
-  // unchanged in general register R3.
-  DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2);
-  // only takes rightmost 6 bits
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int shiftBits = (b2_val + d2) & 0x3F;
-  // unsigned
-  uint32_t r3_val = get_low_register<uint32_t>(r3);
-  uint32_t alu_out = 0;
-  alu_out = r3_val << shiftBits;
-  set_low_register(r1, alu_out);
-  return length;
-}
-
-EVALUATE(LOCG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(STOCG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LANG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LAOG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LAXG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LAAG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LAALG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LOC) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(STOC) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LAN) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LAO) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LAX) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LAA) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LAAL) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(BRXHG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(BRXLG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(RISBLG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(RNSBG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(ROSBG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(RXSBG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(RISBGN) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(RISBHG) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CGRJ) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CGIT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CIT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CLFIT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CGIJ) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CIJ) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(ALHSIK) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(ALGHSIK) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CGRB) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CGIB) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CIB) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LDEB) {
-  DCHECK_OPCODE(LDEB);
-  DECODE_RXE_INSTRUCTION(r1, b2, x2, d2);
-  int rb = b2;
-  int rx = x2;
-  int offset = d2;
-  int64_t rb_val = (rb == 0) ? 0 : get_register(rb);
-  int64_t rx_val = (rx == 0) ? 0 : get_register(rx);
-  float fval = ReadFloat(rx_val + rb_val + offset);
-  set_d_register_from_double(r1, static_cast<double>(fval));
-  return length;
-}
-
-EVALUATE(LXDB) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LXEB) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MXDB) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(KEB) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CEB) {
-  DCHECK_OPCODE(CEB);
-
-  DECODE_RXE_INSTRUCTION(r1, b2, x2, d2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t d2_val = d2;
-  float r1_val = get_float32_from_d_register(r1);
-  float fval = ReadFloat(b2_val + x2_val + d2_val);
-  SetS390ConditionCode<float>(r1_val, fval);
-  return length;
-}
-
-EVALUATE(AEB) {
-  DCHECK_OPCODE(AEB);
-  DECODE_RXE_INSTRUCTION(r1, b2, x2, d2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t d2_val = d2;
-  float r1_val = get_float32_from_d_register(r1);
-  float fval = ReadFloat(b2_val + x2_val + d2_val);
-  r1_val += fval;
-  set_d_register_from_float32(r1, r1_val);
-  SetS390ConditionCode<float>(r1_val, 0);
-  return length;
-}
-
-EVALUATE(SEB) {
-  DCHECK_OPCODE(SEB);
-  DECODE_RXE_INSTRUCTION(r1, b2, x2, d2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t d2_val = d2;
-  float r1_val = get_float32_from_d_register(r1);
-  float fval = ReadFloat(b2_val + x2_val + d2_val);
-  r1_val -= fval;
-  set_d_register_from_float32(r1, r1_val);
-  SetS390ConditionCode<float>(r1_val, 0);
-  return length;
-}
-
-EVALUATE(MDEB) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(DEB) {
-  DCHECK_OPCODE(DEB);
-  DECODE_RXE_INSTRUCTION(r1, b2, x2, d2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t d2_val = d2;
-  float r1_val = get_float32_from_d_register(r1);
-  float fval = ReadFloat(b2_val + x2_val + d2_val);
-  r1_val /= fval;
-  set_d_register_from_float32(r1, r1_val);
-  return length;
-}
-
-EVALUATE(MAEB) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MSEB) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TCEB) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TCDB) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TCXB) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SQEB) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SQDB) {
-  DCHECK_OPCODE(SQDB);
-  DECODE_RXE_INSTRUCTION(r1, b2, x2, d2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t d2_val = d2;
-  double r1_val = get_double_from_d_register(r1);
-  double dbl_val = ReadDouble(b2_val + x2_val + d2_val);
-  r1_val = std::sqrt(dbl_val);
-  set_d_register_from_double(r1, r1_val);
-  return length;
-}
-
-EVALUATE(MEEB) {
-  DCHECK_OPCODE(MEEB);
-  DECODE_RXE_INSTRUCTION(r1, b2, x2, d2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t d2_val = d2;
-  float r1_val = get_float32_from_d_register(r1);
-  float fval = ReadFloat(b2_val + x2_val + d2_val);
-  r1_val *= fval;
-  set_d_register_from_float32(r1, r1_val);
-  return length;
-}
-
-EVALUATE(KDB) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CDB) {
-  DCHECK_OPCODE(CDB);
-
-  DECODE_RXE_INSTRUCTION(r1, b2, x2, d2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t d2_val = d2;
-  double r1_val = get_double_from_d_register(r1);
-  double dbl_val = ReadDouble(b2_val + x2_val + d2_val);
-  SetS390ConditionCode<double>(r1_val, dbl_val);
-  return length;
-}
-
-EVALUATE(ADB) {
-  DCHECK_OPCODE(ADB);
-
-  DECODE_RXE_INSTRUCTION(r1, b2, x2, d2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t d2_val = d2;
-  double r1_val = get_double_from_d_register(r1);
-  double dbl_val = ReadDouble(b2_val + x2_val + d2_val);
-  r1_val += dbl_val;
-  set_d_register_from_double(r1, r1_val);
-  SetS390ConditionCode<double>(r1_val, 0);
-  return length;
-}
-
-EVALUATE(SDB) {
-  DCHECK_OPCODE(SDB);
-  DECODE_RXE_INSTRUCTION(r1, b2, x2, d2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t d2_val = d2;
-  double r1_val = get_double_from_d_register(r1);
-  double dbl_val = ReadDouble(b2_val + x2_val + d2_val);
-  r1_val -= dbl_val;
-  set_d_register_from_double(r1, r1_val);
-  SetS390ConditionCode<double>(r1_val, 0);
-  return length;
-}
-
-EVALUATE(MDB) {
-  DCHECK_OPCODE(MDB);
-  DECODE_RXE_INSTRUCTION(r1, b2, x2, d2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t d2_val = d2;
-  double r1_val = get_double_from_d_register(r1);
-  double dbl_val = ReadDouble(b2_val + x2_val + d2_val);
-  r1_val *= dbl_val;
-  set_d_register_from_double(r1, r1_val);
-  return length;
-}
-
-EVALUATE(DDB) {
-  DCHECK_OPCODE(DDB);
-  DECODE_RXE_INSTRUCTION(r1, b2, x2, d2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  intptr_t d2_val = d2;
-  double r1_val = get_double_from_d_register(r1);
-  double dbl_val = ReadDouble(b2_val + x2_val + d2_val);
-  r1_val /= dbl_val;
-  set_d_register_from_double(r1, r1_val);
-  return length;
-}
-
-EVALUATE(MADB) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(MSDB) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SLDT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SRDT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SLXT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(SRXT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TDCET) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TDGET) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TDCDT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TDGDT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TDCXT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(TDGXT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(LEY) {
-  DCHECK_OPCODE(LEY);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  // Miscellaneous Loads and Stores
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  intptr_t addr = x2_val + b2_val + d2;
-  float float_val = *reinterpret_cast<float*>(addr);
-  set_d_register_from_float32(r1, float_val);
-  return length;
-}
-
-EVALUATE(LDY) {
-  DCHECK_OPCODE(LDY);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  // Miscellaneous Loads and Stores
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  intptr_t addr = x2_val + b2_val + d2;
-  uint64_t dbl_val = *reinterpret_cast<uint64_t*>(addr);
-  set_d_register(r1, dbl_val);
-  return length;
-}
-
-EVALUATE(STEY) {
-  DCHECK_OPCODE(STEY);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  // Miscellaneous Loads and Stores
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  intptr_t addr = x2_val + b2_val + d2;
-  int64_t frs_val = get_d_register(r1) >> 32;
-  WriteW(addr, static_cast<int32_t>(frs_val), instr);
-  return length;
-}
-
-EVALUATE(STDY) {
-  DCHECK_OPCODE(STDY);
-  DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
-  // Miscellaneous Loads and Stores
-  int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
-  int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
-  intptr_t addr = x2_val + b2_val + d2;
-  int64_t frs_val = get_d_register(r1);
-  WriteDW(addr, frs_val);
-  return length;
-}
-
-EVALUATE(CZDT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CZXT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CDZT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-EVALUATE(CXZT) {
-  UNIMPLEMENTED();
-  USE(instr);
-  return 0;
-}
-
-#undef EVALUATE
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // USE_SIMULATOR
-#endif  // V8_TARGET_ARCH_S390
diff --git a/src/v8/src/s390/simulator-s390.h b/src/v8/src/s390/simulator-s390.h
deleted file mode 100644
index 1ff8020..0000000
--- a/src/v8/src/s390/simulator-s390.h
+++ /dev/null
@@ -1,1208 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Declares a Simulator for S390 instructions if we are not generating a native
-// S390 binary. This Simulator allows us to run and debug S390 code generation
-// on regular desktop machines.
-// V8 calls into generated code via the GeneratedCode wrapper,
-// which will start execution in the Simulator or forwards to the real entry
-// on a S390 hardware platform.
-
-#ifndef V8_S390_SIMULATOR_S390_H_
-#define V8_S390_SIMULATOR_S390_H_
-
-#include "src/allocation.h"
-
-#if defined(USE_SIMULATOR)
-// Running with a simulator.
-
-#include "src/assembler.h"
-#include "src/base/hashmap.h"
-#include "src/s390/constants-s390.h"
-#include "src/simulator-base.h"
-
-namespace v8 {
-namespace internal {
-
-class CachePage {
- public:
-  static const int LINE_VALID = 0;
-  static const int LINE_INVALID = 1;
-
-  static const int kPageShift = 12;
-  static const int kPageSize = 1 << kPageShift;
-  static const int kPageMask = kPageSize - 1;
-  static const int kLineShift = 2;  // The cache line is only 4 bytes right now.
-  static const int kLineLength = 1 << kLineShift;
-  static const int kLineMask = kLineLength - 1;
-
-  CachePage() { memset(&validity_map_, LINE_INVALID, sizeof(validity_map_)); }
-
-  char* ValidityByte(int offset) {
-    return &validity_map_[offset >> kLineShift];
-  }
-
-  char* CachedData(int offset) { return &data_[offset]; }
-
- private:
-  char data_[kPageSize];  // The cached data.
-  static const int kValidityMapSize = kPageSize >> kLineShift;
-  char validity_map_[kValidityMapSize];  // One byte per line.
-};
-
-class Simulator : public SimulatorBase {
- public:
-  friend class S390Debugger;
-  enum Register {
-    no_reg = -1,
-    r0 = 0,
-    r1 = 1,
-    r2 = 2,
-    r3 = 3,
-    r4 = 4,
-    r5 = 5,
-    r6 = 6,
-    r7 = 7,
-    r8 = 8,
-    r9 = 9,
-    r10 = 10,
-    r11 = 11,
-    r12 = 12,
-    r13 = 13,
-    r14 = 14,
-    r15 = 15,
-    fp = r11,
-    ip = r12,
-    cp = r13,
-    ra = r14,
-    sp = r15,  // name aliases
-    kNumGPRs = 16,
-    d0 = 0,
-    d1,
-    d2,
-    d3,
-    d4,
-    d5,
-    d6,
-    d7,
-    d8,
-    d9,
-    d10,
-    d11,
-    d12,
-    d13,
-    d14,
-    d15,
-    kNumFPRs = 16
-  };
-
-  explicit Simulator(Isolate* isolate);
-  ~Simulator();
-
-  // The currently executing Simulator instance. Potentially there can be one
-  // for each native thread.
-  static Simulator* current(v8::internal::Isolate* isolate);
-
-  // Accessors for register state.
-  void set_register(int reg, uint64_t value);
-  uint64_t get_register(int reg) const;
-  template <typename T>
-  T get_low_register(int reg) const;
-  template <typename T>
-  T get_high_register(int reg) const;
-  void set_low_register(int reg, uint32_t value);
-  void set_high_register(int reg, uint32_t value);
-
-  double get_double_from_register_pair(int reg);
-  void set_d_register_from_double(int dreg, const double dbl) {
-    DCHECK(dreg >= 0 && dreg < kNumFPRs);
-    *bit_cast<double*>(&fp_registers_[dreg]) = dbl;
-  }
-
-  double get_double_from_d_register(int dreg) {
-    DCHECK(dreg >= 0 && dreg < kNumFPRs);
-    return *bit_cast<double*>(&fp_registers_[dreg]);
-  }
-  void set_d_register(int dreg, int64_t value) {
-    DCHECK(dreg >= 0 && dreg < kNumFPRs);
-    fp_registers_[dreg] = value;
-  }
-  int64_t get_d_register(int dreg) {
-    DCHECK(dreg >= 0 && dreg < kNumFPRs);
-    return fp_registers_[dreg];
-  }
-
-  void set_d_register_from_float32(int dreg, const float f) {
-    DCHECK(dreg >= 0 && dreg < kNumFPRs);
-
-    int32_t f_int = *bit_cast<int32_t*>(&f);
-    int64_t finalval = static_cast<int64_t>(f_int) << 32;
-    set_d_register(dreg, finalval);
-  }
-
-  float get_float32_from_d_register(int dreg) {
-    DCHECK(dreg >= 0 && dreg < kNumFPRs);
-
-    int64_t regval = get_d_register(dreg) >> 32;
-    int32_t regval32 = static_cast<int32_t>(regval);
-    return *bit_cast<float*>(&regval32);
-  }
-
-  // Special case of set_register and get_register to access the raw PC value.
-  void set_pc(intptr_t value);
-  intptr_t get_pc() const;
-
-  Address get_sp() const {
-    return reinterpret_cast<Address>(static_cast<intptr_t>(get_register(sp)));
-  }
-
-  // Accessor to the internal simulator stack area.
-  uintptr_t StackLimit(uintptr_t c_limit) const;
-
-  // Executes S390 instructions until the PC reaches end_sim_pc.
-  void Execute();
-
-  template <typename Return, typename... Args>
-  Return Call(byte* entry, Args... args) {
-    return VariadicCall<Return>(this, &Simulator::CallImpl, entry, args...);
-  }
-
-  // Alternative: call a 2-argument double function.
-  void CallFP(byte* entry, double d0, double d1);
-  int32_t CallFPReturnsInt(byte* entry, double d0, double d1);
-  double CallFPReturnsDouble(byte* entry, double d0, double d1);
-
-  // Push an address onto the JS stack.
-  uintptr_t PushAddress(uintptr_t address);
-
-  // Pop an address from the JS stack.
-  uintptr_t PopAddress();
-
-  // Debugger input.
-  void set_last_debugger_input(char* input);
-  char* last_debugger_input() { return last_debugger_input_; }
-
-  // Redirection support.
-  static void SetRedirectInstruction(Instruction* instruction);
-
-  // ICache checking.
-  static void FlushICache(base::CustomMatcherHashMap* i_cache, void* start,
-                          size_t size);
-
-  // Returns true if pc register contains one of the 'special_values' defined
-  // below (bad_lr, end_sim_pc).
-  bool has_bad_pc() const;
-
- private:
-  enum special_values {
-    // Known bad pc value to ensure that the simulator does not execute
-    // without being properly setup.
-    bad_lr = -1,
-    // A pc value used to signal the simulator to stop execution.  Generally
-    // the lr is set to this value on transition from native C code to
-    // simulated execution, so that the simulator can "return" to the native
-    // C code.
-    end_sim_pc = -2
-  };
-
-  intptr_t CallImpl(byte* entry, int argument_count, const intptr_t* arguments);
-
-  // Unsupported instructions use Format to print an error and stop execution.
-  void Format(Instruction* instr, const char* format);
-
-  // Helper functions to set the conditional flags in the architecture state.
-  bool CarryFrom(int32_t left, int32_t right, int32_t carry = 0);
-  bool BorrowFrom(int32_t left, int32_t right);
-  template <typename T1>
-  inline bool OverflowFromSigned(T1 alu_out, T1 left, T1 right, bool addition);
-
-  // Helper functions to decode common "addressing" modes
-  int32_t GetShiftRm(Instruction* instr, bool* carry_out);
-  int32_t GetImm(Instruction* instr, bool* carry_out);
-  void ProcessPUW(Instruction* instr, int num_regs, int operand_size,
-                  intptr_t* start_address, intptr_t* end_address);
-  void HandleRList(Instruction* instr, bool load);
-  void HandleVList(Instruction* inst);
-  void SoftwareInterrupt(Instruction* instr);
-
-  // Stop helper functions.
-  inline bool isStopInstruction(Instruction* instr);
-  inline bool isWatchedStop(uint32_t bkpt_code);
-  inline bool isEnabledStop(uint32_t bkpt_code);
-  inline void EnableStop(uint32_t bkpt_code);
-  inline void DisableStop(uint32_t bkpt_code);
-  inline void IncreaseStopCounter(uint32_t bkpt_code);
-  void PrintStopInfo(uint32_t code);
-
-  // Byte Reverse
-  inline int16_t ByteReverse(int16_t hword);
-  inline int32_t ByteReverse(int32_t word);
-  inline int64_t ByteReverse(int64_t dword);
-
-  // Read and write memory.
-  inline uint8_t ReadBU(intptr_t addr);
-  inline int8_t ReadB(intptr_t addr);
-  inline void WriteB(intptr_t addr, uint8_t value);
-  inline void WriteB(intptr_t addr, int8_t value);
-
-  inline uint16_t ReadHU(intptr_t addr, Instruction* instr);
-  inline int16_t ReadH(intptr_t addr, Instruction* instr);
-  // Note: Overloaded on the sign of the value.
-  inline void WriteH(intptr_t addr, uint16_t value, Instruction* instr);
-  inline void WriteH(intptr_t addr, int16_t value, Instruction* instr);
-
-  inline uint32_t ReadWU(intptr_t addr, Instruction* instr);
-  inline int32_t ReadW(intptr_t addr, Instruction* instr);
-  inline int64_t ReadW64(intptr_t addr, Instruction* instr);
-  inline void WriteW(intptr_t addr, uint32_t value, Instruction* instr);
-  inline void WriteW(intptr_t addr, int32_t value, Instruction* instr);
-
-  inline int64_t ReadDW(intptr_t addr);
-  inline double ReadDouble(intptr_t addr);
-  inline float ReadFloat(intptr_t addr);
-  inline void WriteDW(intptr_t addr, int64_t value);
-
-  // S390
-  void Trace(Instruction* instr);
-
-  // Used by the CL**BR instructions.
-  template <typename T1, typename T2>
-  void SetS390RoundConditionCode(T1 r2_val, T2 max, T2 min) {
-    condition_reg_ = 0;
-    double r2_dval = static_cast<double>(r2_val);
-    double dbl_min = static_cast<double>(min);
-    double dbl_max = static_cast<double>(max);
-
-    if (r2_dval == 0.0)
-      condition_reg_ = 8;
-    else if (r2_dval < 0.0 && r2_dval >= dbl_min && std::isfinite(r2_dval))
-      condition_reg_ = 4;
-    else if (r2_dval > 0.0 && r2_dval <= dbl_max && std::isfinite(r2_dval))
-      condition_reg_ = 2;
-    else
-      condition_reg_ = 1;
-  }
-
-  template <typename T1>
-  void SetS390RoundConditionCode(T1 r2_val, int64_t max, int64_t min) {
-    condition_reg_ = 0;
-    double r2_dval = static_cast<double>(r2_val);
-    double dbl_min = static_cast<double>(min);
-    double dbl_max = static_cast<double>(max);
-
-    // Note that the IEEE 754 floating-point representations (both 32 and
-    // 64 bit) cannot exactly represent INT64_MAX. The closest it can get
-    // is INT64_max + 1. IEEE 754 FP can, though, represent INT64_MIN
-    // exactly.
-
-    // This is not an issue for INT32, as IEEE754 64-bit can represent
-    // INT32_MAX and INT32_MIN with exact precision.
-
-    if (r2_dval == 0.0)
-      condition_reg_ = 8;
-    else if (r2_dval < 0.0 && r2_dval >= dbl_min && std::isfinite(r2_dval))
-      condition_reg_ = 4;
-    else if (r2_dval > 0.0 && r2_dval < dbl_max && std::isfinite(r2_dval))
-      condition_reg_ = 2;
-    else
-      condition_reg_ = 1;
-  }
-
-  // Used by the CL**BR instructions.
-  template <typename T1, typename T2, typename T3>
-  void SetS390ConvertConditionCode(T1 src, T2 dst, T3 max) {
-    condition_reg_ = 0;
-    if (src == static_cast<T1>(0.0)) {
-      condition_reg_ |= 8;
-    } else if (src < static_cast<T1>(0.0) && static_cast<T2>(src) == 0 &&
-               std::isfinite(src)) {
-      condition_reg_ |= 4;
-    } else if (src > static_cast<T1>(0.0) && std::isfinite(src) &&
-               src < static_cast<T1>(max)) {
-      condition_reg_ |= 2;
-    } else {
-      condition_reg_ |= 1;
-    }
-  }
-
-  template <typename T>
-  void SetS390ConditionCode(T lhs, T rhs) {
-    condition_reg_ = 0;
-    if (lhs == rhs) {
-      condition_reg_ |= CC_EQ;
-    } else if (lhs < rhs) {
-      condition_reg_ |= CC_LT;
-    } else if (lhs > rhs) {
-      condition_reg_ |= CC_GT;
-    }
-
-    // We get down here only for floating point
-    // comparisons and the values are unordered
-    // i.e. NaN
-    if (condition_reg_ == 0) condition_reg_ = unordered;
-  }
-
-  // Used by arithmetic operations that use carry.
-  template <typename T>
-  void SetS390ConditionCodeCarry(T result, bool overflow) {
-    condition_reg_ = 0;
-    bool zero_result = (result == static_cast<T>(0));
-    if (zero_result && !overflow) {
-      condition_reg_ |= 8;
-    } else if (!zero_result && !overflow) {
-      condition_reg_ |= 4;
-    } else if (zero_result && overflow) {
-      condition_reg_ |= 2;
-    } else if (!zero_result && overflow) {
-      condition_reg_ |= 1;
-    }
-    if (condition_reg_ == 0) UNREACHABLE();
-  }
-
-  bool isNaN(double value) { return (value != value); }
-
-  // Set the condition code for bitwise operations
-  // CC0 is set if value == 0.
-  // CC1 is set if value != 0.
-  // CC2/CC3 are not set.
-  template <typename T>
-  void SetS390BitWiseConditionCode(T value) {
-    condition_reg_ = 0;
-
-    if (value == 0)
-      condition_reg_ |= CC_EQ;
-    else
-      condition_reg_ |= CC_LT;
-  }
-
-  void SetS390OverflowCode(bool isOF) {
-    if (isOF) condition_reg_ = CC_OF;
-  }
-
-  bool TestConditionCode(Condition mask) {
-    // Check for unconditional branch
-    if (mask == 0xf) return true;
-
-    return (condition_reg_ & mask) != 0;
-  }
-
-  // Executes one instruction.
-  void ExecuteInstruction(Instruction* instr, bool auto_incr_pc = true);
-
-  // ICache.
-  static void CheckICache(base::CustomMatcherHashMap* i_cache,
-                          Instruction* instr);
-  static void FlushOnePage(base::CustomMatcherHashMap* i_cache, intptr_t start,
-                           int size);
-  static CachePage* GetCachePage(base::CustomMatcherHashMap* i_cache,
-                                 void* page);
-
-  // Handle arguments and return value for runtime FP functions.
-  void GetFpArgs(double* x, double* y, intptr_t* z);
-  void SetFpResult(const double& result);
-  void TrashCallerSaveRegisters();
-
-  void CallInternal(byte* entry, int reg_arg_count = 3);
-
-  // Architecture state.
-  // On z9 and higher and supported Linux on z Systems platforms, all registers
-  // are 64-bit, even in 31-bit mode.
-  uint64_t registers_[kNumGPRs];
-  int64_t fp_registers_[kNumFPRs];
-
-  // Condition Code register. In S390, the last 4 bits are used.
-  int32_t condition_reg_;
-  // Special register to track PC.
-  intptr_t special_reg_pc_;
-
-  // Simulator support.
-  char* stack_;
-  static const size_t stack_protection_size_ = 256 * kPointerSize;
-  bool pc_modified_;
-  int64_t icount_;
-
-  // Debugger input.
-  char* last_debugger_input_;
-
-  // Icache simulation
-  base::CustomMatcherHashMap* i_cache_;
-
-  // Registered breakpoints.
-  Instruction* break_pc_;
-  Instr break_instr_;
-
-  v8::internal::Isolate* isolate_;
-
-  // A stop is watched if its code is less than kNumOfWatchedStops.
-  // Only watched stops support enabling/disabling and the counter feature.
-  static const uint32_t kNumOfWatchedStops = 256;
-
-  // Breakpoint is disabled if bit 31 is set.
-  static const uint32_t kStopDisabledBit = 1 << 31;
-
-  // A stop is enabled, meaning the simulator will stop when meeting the
-  // instruction, if bit 31 of watched_stops_[code].count is unset.
-  // The value watched_stops_[code].count & ~(1 << 31) indicates how many times
-  // the breakpoint was hit or gone through.
-  struct StopCountAndDesc {
-    uint32_t count;
-    char* desc;
-  };
-  StopCountAndDesc watched_stops_[kNumOfWatchedStops];
-  void DebugStart();
-
-  int DecodeInstructionOriginal(Instruction* instr);
-  int DecodeInstruction(Instruction* instr);
-  int Evaluate_Unknown(Instruction* instr);
-#define MAX_NUM_OPCODES (1 << 16)
-  typedef int (Simulator::*EvaluateFuncType)(Instruction*);
-
-  static EvaluateFuncType EvalTable[MAX_NUM_OPCODES];
-  static void EvalTableInit();
-
-#define EVALUATE(name) int Evaluate_##name(Instruction* instr)
-#define EVALUATE_VRR_INSTRUCTIONS(name, op_name, op_value) EVALUATE(op_name);
-  S390_VRR_C_OPCODE_LIST(EVALUATE_VRR_INSTRUCTIONS)
-  S390_VRR_A_OPCODE_LIST(EVALUATE_VRR_INSTRUCTIONS)
-#undef EVALUATE_VRR_INSTRUCTIONS
-
-  EVALUATE(DUMY);
-  EVALUATE(BKPT);
-  EVALUATE(SPM);
-  EVALUATE(BALR);
-  EVALUATE(BCTR);
-  EVALUATE(BCR);
-  EVALUATE(SVC);
-  EVALUATE(BSM);
-  EVALUATE(BASSM);
-  EVALUATE(BASR);
-  EVALUATE(MVCL);
-  EVALUATE(CLCL);
-  EVALUATE(LPR);
-  EVALUATE(LNR);
-  EVALUATE(LTR);
-  EVALUATE(LCR);
-  EVALUATE(NR);
-  EVALUATE(CLR);
-  EVALUATE(OR);
-  EVALUATE(XR);
-  EVALUATE(LR);
-  EVALUATE(CR);
-  EVALUATE(AR);
-  EVALUATE(SR);
-  EVALUATE(MR);
-  EVALUATE(DR);
-  EVALUATE(ALR);
-  EVALUATE(SLR);
-  EVALUATE(LDR);
-  EVALUATE(CDR);
-  EVALUATE(LER);
-  EVALUATE(STH);
-  EVALUATE(LA);
-  EVALUATE(STC);
-  EVALUATE(IC_z);
-  EVALUATE(EX);
-  EVALUATE(BAL);
-  EVALUATE(BCT);
-  EVALUATE(BC);
-  EVALUATE(LH);
-  EVALUATE(CH);
-  EVALUATE(AH);
-  EVALUATE(SH);
-  EVALUATE(MH);
-  EVALUATE(BAS);
-  EVALUATE(CVD);
-  EVALUATE(CVB);
-  EVALUATE(ST);
-  EVALUATE(LAE);
-  EVALUATE(N);
-  EVALUATE(CL);
-  EVALUATE(O);
-  EVALUATE(X);
-  EVALUATE(L);
-  EVALUATE(C);
-  EVALUATE(A);
-  EVALUATE(S);
-  EVALUATE(M);
-  EVALUATE(D);
-  EVALUATE(AL);
-  EVALUATE(SL);
-  EVALUATE(STD);
-  EVALUATE(LD);
-  EVALUATE(CD);
-  EVALUATE(STE);
-  EVALUATE(MS);
-  EVALUATE(LE);
-  EVALUATE(BRXH);
-  EVALUATE(BRXLE);
-  EVALUATE(BXH);
-  EVALUATE(BXLE);
-  EVALUATE(SRL);
-  EVALUATE(SLL);
-  EVALUATE(SRA);
-  EVALUATE(SLA);
-  EVALUATE(SRDL);
-  EVALUATE(SLDL);
-  EVALUATE(SRDA);
-  EVALUATE(SLDA);
-  EVALUATE(STM);
-  EVALUATE(TM);
-  EVALUATE(MVI);
-  EVALUATE(TS);
-  EVALUATE(NI);
-  EVALUATE(CLI);
-  EVALUATE(OI);
-  EVALUATE(XI);
-  EVALUATE(LM);
-  EVALUATE(CS);
-  EVALUATE(MVCLE);
-  EVALUATE(CLCLE);
-  EVALUATE(MC);
-  EVALUATE(CDS);
-  EVALUATE(STCM);
-  EVALUATE(ICM);
-  EVALUATE(BPRP);
-  EVALUATE(BPP);
-  EVALUATE(TRTR);
-  EVALUATE(MVN);
-  EVALUATE(MVC);
-  EVALUATE(MVZ);
-  EVALUATE(NC);
-  EVALUATE(CLC);
-  EVALUATE(OC);
-  EVALUATE(XC);
-  EVALUATE(MVCP);
-  EVALUATE(TR);
-  EVALUATE(TRT);
-  EVALUATE(ED);
-  EVALUATE(EDMK);
-  EVALUATE(PKU);
-  EVALUATE(UNPKU);
-  EVALUATE(MVCIN);
-  EVALUATE(PKA);
-  EVALUATE(UNPKA);
-  EVALUATE(PLO);
-  EVALUATE(LMD);
-  EVALUATE(SRP);
-  EVALUATE(MVO);
-  EVALUATE(PACK);
-  EVALUATE(UNPK);
-  EVALUATE(ZAP);
-  EVALUATE(AP);
-  EVALUATE(SP);
-  EVALUATE(MP);
-  EVALUATE(DP);
-  EVALUATE(UPT);
-  EVALUATE(PFPO);
-  EVALUATE(IIHH);
-  EVALUATE(IIHL);
-  EVALUATE(IILH);
-  EVALUATE(IILL);
-  EVALUATE(NIHH);
-  EVALUATE(NIHL);
-  EVALUATE(NILH);
-  EVALUATE(NILL);
-  EVALUATE(OIHH);
-  EVALUATE(OIHL);
-  EVALUATE(OILH);
-  EVALUATE(OILL);
-  EVALUATE(LLIHH);
-  EVALUATE(LLIHL);
-  EVALUATE(LLILH);
-  EVALUATE(LLILL);
-  EVALUATE(TMLH);
-  EVALUATE(TMLL);
-  EVALUATE(TMHH);
-  EVALUATE(TMHL);
-  EVALUATE(BRC);
-  EVALUATE(BRAS);
-  EVALUATE(BRCT);
-  EVALUATE(BRCTG);
-  EVALUATE(LHI);
-  EVALUATE(LGHI);
-  EVALUATE(AHI);
-  EVALUATE(AGHI);
-  EVALUATE(MHI);
-  EVALUATE(MGHI);
-  EVALUATE(CHI);
-  EVALUATE(CGHI);
-  EVALUATE(LARL);
-  EVALUATE(LGFI);
-  EVALUATE(BRCL);
-  EVALUATE(BRASL);
-  EVALUATE(XIHF);
-  EVALUATE(XILF);
-  EVALUATE(IIHF);
-  EVALUATE(IILF);
-  EVALUATE(NIHF);
-  EVALUATE(NILF);
-  EVALUATE(OIHF);
-  EVALUATE(OILF);
-  EVALUATE(LLIHF);
-  EVALUATE(LLILF);
-  EVALUATE(MSGFI);
-  EVALUATE(MSFI);
-  EVALUATE(SLGFI);
-  EVALUATE(SLFI);
-  EVALUATE(AGFI);
-  EVALUATE(AFI);
-  EVALUATE(ALGFI);
-  EVALUATE(ALFI);
-  EVALUATE(CGFI);
-  EVALUATE(CFI);
-  EVALUATE(CLGFI);
-  EVALUATE(CLFI);
-  EVALUATE(LLHRL);
-  EVALUATE(LGHRL);
-  EVALUATE(LHRL);
-  EVALUATE(LLGHRL);
-  EVALUATE(STHRL);
-  EVALUATE(LGRL);
-  EVALUATE(STGRL);
-  EVALUATE(LGFRL);
-  EVALUATE(LRL);
-  EVALUATE(LLGFRL);
-  EVALUATE(STRL);
-  EVALUATE(EXRL);
-  EVALUATE(PFDRL);
-  EVALUATE(CGHRL);
-  EVALUATE(CHRL);
-  EVALUATE(CGRL);
-  EVALUATE(CGFRL);
-  EVALUATE(ECTG);
-  EVALUATE(CSST);
-  EVALUATE(LPD);
-  EVALUATE(LPDG);
-  EVALUATE(BRCTH);
-  EVALUATE(AIH);
-  EVALUATE(ALSIH);
-  EVALUATE(ALSIHN);
-  EVALUATE(CIH);
-  EVALUATE(CLIH);
-  EVALUATE(STCK);
-  EVALUATE(CFC);
-  EVALUATE(IPM);
-  EVALUATE(HSCH);
-  EVALUATE(MSCH);
-  EVALUATE(SSCH);
-  EVALUATE(STSCH);
-  EVALUATE(TSCH);
-  EVALUATE(TPI);
-  EVALUATE(SAL);
-  EVALUATE(RSCH);
-  EVALUATE(STCRW);
-  EVALUATE(STCPS);
-  EVALUATE(RCHP);
-  EVALUATE(SCHM);
-  EVALUATE(CKSM);
-  EVALUATE(SAR);
-  EVALUATE(EAR);
-  EVALUATE(MSR);
-  EVALUATE(MSRKC);
-  EVALUATE(MVST);
-  EVALUATE(CUSE);
-  EVALUATE(SRST);
-  EVALUATE(XSCH);
-  EVALUATE(STCKE);
-  EVALUATE(STCKF);
-  EVALUATE(SRNM);
-  EVALUATE(STFPC);
-  EVALUATE(LFPC);
-  EVALUATE(TRE);
-  EVALUATE(CUUTF);
-  EVALUATE(CUTFU);
-  EVALUATE(STFLE);
-  EVALUATE(SRNMB);
-  EVALUATE(SRNMT);
-  EVALUATE(LFAS);
-  EVALUATE(PPA);
-  EVALUATE(ETND);
-  EVALUATE(TEND);
-  EVALUATE(NIAI);
-  EVALUATE(TABORT);
-  EVALUATE(TRAP4);
-  EVALUATE(LPEBR);
-  EVALUATE(LNEBR);
-  EVALUATE(LTEBR);
-  EVALUATE(LCEBR);
-  EVALUATE(LDEBR);
-  EVALUATE(LXDBR);
-  EVALUATE(LXEBR);
-  EVALUATE(MXDBR);
-  EVALUATE(KEBR);
-  EVALUATE(CEBR);
-  EVALUATE(AEBR);
-  EVALUATE(SEBR);
-  EVALUATE(MDEBR);
-  EVALUATE(DEBR);
-  EVALUATE(MAEBR);
-  EVALUATE(MSEBR);
-  EVALUATE(LPDBR);
-  EVALUATE(LNDBR);
-  EVALUATE(LTDBR);
-  EVALUATE(LCDBR);
-  EVALUATE(SQEBR);
-  EVALUATE(SQDBR);
-  EVALUATE(SQXBR);
-  EVALUATE(MEEBR);
-  EVALUATE(KDBR);
-  EVALUATE(CDBR);
-  EVALUATE(ADBR);
-  EVALUATE(SDBR);
-  EVALUATE(MDBR);
-  EVALUATE(DDBR);
-  EVALUATE(MADBR);
-  EVALUATE(MSDBR);
-  EVALUATE(LPXBR);
-  EVALUATE(LNXBR);
-  EVALUATE(LTXBR);
-  EVALUATE(LCXBR);
-  EVALUATE(LEDBRA);
-  EVALUATE(LDXBRA);
-  EVALUATE(LEXBRA);
-  EVALUATE(FIXBRA);
-  EVALUATE(KXBR);
-  EVALUATE(CXBR);
-  EVALUATE(AXBR);
-  EVALUATE(SXBR);
-  EVALUATE(MXBR);
-  EVALUATE(DXBR);
-  EVALUATE(TBEDR);
-  EVALUATE(TBDR);
-  EVALUATE(DIEBR);
-  EVALUATE(FIEBRA);
-  EVALUATE(THDER);
-  EVALUATE(THDR);
-  EVALUATE(DIDBR);
-  EVALUATE(FIDBRA);
-  EVALUATE(LXR);
-  EVALUATE(LPDFR);
-  EVALUATE(LNDFR);
-  EVALUATE(LCDFR);
-  EVALUATE(LZER);
-  EVALUATE(LZDR);
-  EVALUATE(LZXR);
-  EVALUATE(SFPC);
-  EVALUATE(SFASR);
-  EVALUATE(EFPC);
-  EVALUATE(CELFBR);
-  EVALUATE(CDLFBR);
-  EVALUATE(CXLFBR);
-  EVALUATE(CEFBRA);
-  EVALUATE(CDFBRA);
-  EVALUATE(CXFBRA);
-  EVALUATE(CFEBRA);
-  EVALUATE(CFDBRA);
-  EVALUATE(CFXBRA);
-  EVALUATE(CLFEBR);
-  EVALUATE(CLFDBR);
-  EVALUATE(CLFXBR);
-  EVALUATE(CELGBR);
-  EVALUATE(CDLGBR);
-  EVALUATE(CXLGBR);
-  EVALUATE(CEGBRA);
-  EVALUATE(CDGBRA);
-  EVALUATE(CXGBRA);
-  EVALUATE(CGEBRA);
-  EVALUATE(CGDBRA);
-  EVALUATE(CGXBRA);
-  EVALUATE(CLGEBR);
-  EVALUATE(CLGDBR);
-  EVALUATE(CFER);
-  EVALUATE(CFDR);
-  EVALUATE(CFXR);
-  EVALUATE(LDGR);
-  EVALUATE(CGER);
-  EVALUATE(CGDR);
-  EVALUATE(CGXR);
-  EVALUATE(LGDR);
-  EVALUATE(MDTR);
-  EVALUATE(MDTRA);
-  EVALUATE(DDTRA);
-  EVALUATE(ADTRA);
-  EVALUATE(SDTRA);
-  EVALUATE(LDETR);
-  EVALUATE(LEDTR);
-  EVALUATE(LTDTR);
-  EVALUATE(FIDTR);
-  EVALUATE(MXTRA);
-  EVALUATE(DXTRA);
-  EVALUATE(AXTRA);
-  EVALUATE(SXTRA);
-  EVALUATE(LXDTR);
-  EVALUATE(LDXTR);
-  EVALUATE(LTXTR);
-  EVALUATE(FIXTR);
-  EVALUATE(KDTR);
-  EVALUATE(CGDTRA);
-  EVALUATE(CUDTR);
-  EVALUATE(CDTR);
-  EVALUATE(EEDTR);
-  EVALUATE(ESDTR);
-  EVALUATE(KXTR);
-  EVALUATE(CGXTRA);
-  EVALUATE(CUXTR);
-  EVALUATE(CSXTR);
-  EVALUATE(CXTR);
-  EVALUATE(EEXTR);
-  EVALUATE(ESXTR);
-  EVALUATE(CDGTRA);
-  EVALUATE(CDUTR);
-  EVALUATE(CDSTR);
-  EVALUATE(CEDTR);
-  EVALUATE(QADTR);
-  EVALUATE(IEDTR);
-  EVALUATE(RRDTR);
-  EVALUATE(CXGTRA);
-  EVALUATE(CXUTR);
-  EVALUATE(CXSTR);
-  EVALUATE(CEXTR);
-  EVALUATE(QAXTR);
-  EVALUATE(IEXTR);
-  EVALUATE(RRXTR);
-  EVALUATE(LPGR);
-  EVALUATE(LNGR);
-  EVALUATE(LTGR);
-  EVALUATE(LCGR);
-  EVALUATE(LGR);
-  EVALUATE(LGBR);
-  EVALUATE(LGHR);
-  EVALUATE(AGR);
-  EVALUATE(SGR);
-  EVALUATE(ALGR);
-  EVALUATE(SLGR);
-  EVALUATE(MSGR);
-  EVALUATE(MSGRKC);
-  EVALUATE(DSGR);
-  EVALUATE(LRVGR);
-  EVALUATE(LPGFR);
-  EVALUATE(LNGFR);
-  EVALUATE(LTGFR);
-  EVALUATE(LCGFR);
-  EVALUATE(LGFR);
-  EVALUATE(LLGFR);
-  EVALUATE(LLGTR);
-  EVALUATE(AGFR);
-  EVALUATE(SGFR);
-  EVALUATE(ALGFR);
-  EVALUATE(SLGFR);
-  EVALUATE(MSGFR);
-  EVALUATE(DSGFR);
-  EVALUATE(KMAC);
-  EVALUATE(LRVR);
-  EVALUATE(CGR);
-  EVALUATE(CLGR);
-  EVALUATE(LBR);
-  EVALUATE(LHR);
-  EVALUATE(KMF);
-  EVALUATE(KMO);
-  EVALUATE(PCC);
-  EVALUATE(KMCTR);
-  EVALUATE(KM);
-  EVALUATE(KMC);
-  EVALUATE(CGFR);
-  EVALUATE(KIMD);
-  EVALUATE(KLMD);
-  EVALUATE(CFDTR);
-  EVALUATE(CLGDTR);
-  EVALUATE(CLFDTR);
-  EVALUATE(BCTGR);
-  EVALUATE(CFXTR);
-  EVALUATE(CLFXTR);
-  EVALUATE(CDFTR);
-  EVALUATE(CDLGTR);
-  EVALUATE(CDLFTR);
-  EVALUATE(CXFTR);
-  EVALUATE(CXLGTR);
-  EVALUATE(CXLFTR);
-  EVALUATE(CGRT);
-  EVALUATE(NGR);
-  EVALUATE(OGR);
-  EVALUATE(XGR);
-  EVALUATE(FLOGR);
-  EVALUATE(LLGCR);
-  EVALUATE(LLGHR);
-  EVALUATE(MLGR);
-  EVALUATE(DLGR);
-  EVALUATE(ALCGR);
-  EVALUATE(SLBGR);
-  EVALUATE(EPSW);
-  EVALUATE(TRTT);
-  EVALUATE(TRTO);
-  EVALUATE(TROT);
-  EVALUATE(TROO);
-  EVALUATE(LLCR);
-  EVALUATE(LLHR);
-  EVALUATE(MLR);
-  EVALUATE(DLR);
-  EVALUATE(ALCR);
-  EVALUATE(SLBR);
-  EVALUATE(CU14);
-  EVALUATE(CU24);
-  EVALUATE(CU41);
-  EVALUATE(CU42);
-  EVALUATE(TRTRE);
-  EVALUATE(SRSTU);
-  EVALUATE(TRTE);
-  EVALUATE(AHHHR);
-  EVALUATE(SHHHR);
-  EVALUATE(ALHHHR);
-  EVALUATE(SLHHHR);
-  EVALUATE(CHHR);
-  EVALUATE(AHHLR);
-  EVALUATE(SHHLR);
-  EVALUATE(ALHHLR);
-  EVALUATE(SLHHLR);
-  EVALUATE(CHLR);
-  EVALUATE(POPCNT_Z);
-  EVALUATE(LOCGR);
-  EVALUATE(NGRK);
-  EVALUATE(OGRK);
-  EVALUATE(XGRK);
-  EVALUATE(AGRK);
-  EVALUATE(SGRK);
-  EVALUATE(ALGRK);
-  EVALUATE(SLGRK);
-  EVALUATE(LOCR);
-  EVALUATE(NRK);
-  EVALUATE(ORK);
-  EVALUATE(XRK);
-  EVALUATE(ARK);
-  EVALUATE(SRK);
-  EVALUATE(ALRK);
-  EVALUATE(SLRK);
-  EVALUATE(LTG);
-  EVALUATE(LG);
-  EVALUATE(CVBY);
-  EVALUATE(AG);
-  EVALUATE(SG);
-  EVALUATE(ALG);
-  EVALUATE(SLG);
-  EVALUATE(MSG);
-  EVALUATE(DSG);
-  EVALUATE(CVBG);
-  EVALUATE(LRVG);
-  EVALUATE(LT);
-  EVALUATE(LGF);
-  EVALUATE(LGH);
-  EVALUATE(LLGF);
-  EVALUATE(LLGT);
-  EVALUATE(AGF);
-  EVALUATE(SGF);
-  EVALUATE(ALGF);
-  EVALUATE(SLGF);
-  EVALUATE(MSGF);
-  EVALUATE(DSGF);
-  EVALUATE(LRV);
-  EVALUATE(LRVH);
-  EVALUATE(CG);
-  EVALUATE(CLG);
-  EVALUATE(STG);
-  EVALUATE(NTSTG);
-  EVALUATE(CVDY);
-  EVALUATE(CVDG);
-  EVALUATE(STRVG);
-  EVALUATE(CGF);
-  EVALUATE(CLGF);
-  EVALUATE(LTGF);
-  EVALUATE(CGH);
-  EVALUATE(PFD);
-  EVALUATE(STRV);
-  EVALUATE(STRVH);
-  EVALUATE(BCTG);
-  EVALUATE(STY);
-  EVALUATE(MSY);
-  EVALUATE(MSC);
-  EVALUATE(NY);
-  EVALUATE(CLY);
-  EVALUATE(OY);
-  EVALUATE(XY);
-  EVALUATE(LY);
-  EVALUATE(CY);
-  EVALUATE(AY);
-  EVALUATE(SY);
-  EVALUATE(MFY);
-  EVALUATE(ALY);
-  EVALUATE(SLY);
-  EVALUATE(STHY);
-  EVALUATE(LAY);
-  EVALUATE(STCY);
-  EVALUATE(ICY);
-  EVALUATE(LAEY);
-  EVALUATE(LB);
-  EVALUATE(LGB);
-  EVALUATE(LHY);
-  EVALUATE(CHY);
-  EVALUATE(AHY);
-  EVALUATE(SHY);
-  EVALUATE(MHY);
-  EVALUATE(NG);
-  EVALUATE(OG);
-  EVALUATE(XG);
-  EVALUATE(LGAT);
-  EVALUATE(MLG);
-  EVALUATE(DLG);
-  EVALUATE(ALCG);
-  EVALUATE(SLBG);
-  EVALUATE(STPQ);
-  EVALUATE(LPQ);
-  EVALUATE(LLGC);
-  EVALUATE(LLGH);
-  EVALUATE(LLC);
-  EVALUATE(LLH);
-  EVALUATE(ML);
-  EVALUATE(DL);
-  EVALUATE(ALC);
-  EVALUATE(SLB);
-  EVALUATE(LLGTAT);
-  EVALUATE(LLGFAT);
-  EVALUATE(LAT);
-  EVALUATE(LBH);
-  EVALUATE(LLCH);
-  EVALUATE(STCH);
-  EVALUATE(LHH);
-  EVALUATE(LLHH);
-  EVALUATE(STHH);
-  EVALUATE(LFHAT);
-  EVALUATE(LFH);
-  EVALUATE(STFH);
-  EVALUATE(CHF);
-  EVALUATE(MVCDK);
-  EVALUATE(MVHHI);
-  EVALUATE(MVGHI);
-  EVALUATE(MVHI);
-  EVALUATE(CHHSI);
-  EVALUATE(CGHSI);
-  EVALUATE(CHSI);
-  EVALUATE(CLFHSI);
-  EVALUATE(TBEGIN);
-  EVALUATE(TBEGINC);
-  EVALUATE(LMG);
-  EVALUATE(SRAG);
-  EVALUATE(SLAG);
-  EVALUATE(SRLG);
-  EVALUATE(SLLG);
-  EVALUATE(CSY);
-  EVALUATE(CSG);
-  EVALUATE(RLLG);
-  EVALUATE(RLL);
-  EVALUATE(STMG);
-  EVALUATE(STMH);
-  EVALUATE(STCMH);
-  EVALUATE(STCMY);
-  EVALUATE(CDSY);
-  EVALUATE(CDSG);
-  EVALUATE(BXHG);
-  EVALUATE(BXLEG);
-  EVALUATE(ECAG);
-  EVALUATE(TMY);
-  EVALUATE(MVIY);
-  EVALUATE(NIY);
-  EVALUATE(CLIY);
-  EVALUATE(OIY);
-  EVALUATE(XIY);
-  EVALUATE(ASI);
-  EVALUATE(ALSI);
-  EVALUATE(AGSI);
-  EVALUATE(ALGSI);
-  EVALUATE(ICMH);
-  EVALUATE(ICMY);
-  EVALUATE(MVCLU);
-  EVALUATE(CLCLU);
-  EVALUATE(STMY);
-  EVALUATE(LMH);
-  EVALUATE(LMY);
-  EVALUATE(TP);
-  EVALUATE(SRAK);
-  EVALUATE(SLAK);
-  EVALUATE(SRLK);
-  EVALUATE(SLLK);
-  EVALUATE(LOCG);
-  EVALUATE(STOCG);
-  EVALUATE(LANG);
-  EVALUATE(LAOG);
-  EVALUATE(LAXG);
-  EVALUATE(LAAG);
-  EVALUATE(LAALG);
-  EVALUATE(LOC);
-  EVALUATE(STOC);
-  EVALUATE(LAN);
-  EVALUATE(LAO);
-  EVALUATE(LAX);
-  EVALUATE(LAA);
-  EVALUATE(LAAL);
-  EVALUATE(BRXHG);
-  EVALUATE(BRXLG);
-  EVALUATE(RISBLG);
-  EVALUATE(RNSBG);
-  EVALUATE(RISBG);
-  EVALUATE(ROSBG);
-  EVALUATE(RXSBG);
-  EVALUATE(RISBGN);
-  EVALUATE(RISBHG);
-  EVALUATE(CGRJ);
-  EVALUATE(CGIT);
-  EVALUATE(CIT);
-  EVALUATE(CLFIT);
-  EVALUATE(CGIJ);
-  EVALUATE(CIJ);
-  EVALUATE(AHIK);
-  EVALUATE(AGHIK);
-  EVALUATE(ALHSIK);
-  EVALUATE(ALGHSIK);
-  EVALUATE(CGRB);
-  EVALUATE(CGIB);
-  EVALUATE(CIB);
-  EVALUATE(LDEB);
-  EVALUATE(LXDB);
-  EVALUATE(LXEB);
-  EVALUATE(MXDB);
-  EVALUATE(KEB);
-  EVALUATE(CEB);
-  EVALUATE(AEB);
-  EVALUATE(SEB);
-  EVALUATE(MDEB);
-  EVALUATE(DEB);
-  EVALUATE(MAEB);
-  EVALUATE(MSEB);
-  EVALUATE(TCEB);
-  EVALUATE(TCDB);
-  EVALUATE(TCXB);
-  EVALUATE(SQEB);
-  EVALUATE(SQDB);
-  EVALUATE(MEEB);
-  EVALUATE(KDB);
-  EVALUATE(CDB);
-  EVALUATE(ADB);
-  EVALUATE(SDB);
-  EVALUATE(MDB);
-  EVALUATE(DDB);
-  EVALUATE(MADB);
-  EVALUATE(MSDB);
-  EVALUATE(SLDT);
-  EVALUATE(SRDT);
-  EVALUATE(SLXT);
-  EVALUATE(SRXT);
-  EVALUATE(TDCET);
-  EVALUATE(TDGET);
-  EVALUATE(TDCDT);
-  EVALUATE(TDGDT);
-  EVALUATE(TDCXT);
-  EVALUATE(TDGXT);
-  EVALUATE(LEY);
-  EVALUATE(LDY);
-  EVALUATE(STEY);
-  EVALUATE(STDY);
-  EVALUATE(CZDT);
-  EVALUATE(CZXT);
-  EVALUATE(CDZT);
-  EVALUATE(CXZT);
-#undef EVALUATE
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // defined(USE_SIMULATOR)
-#endif  // V8_S390_SIMULATOR_S390_H_
diff --git a/src/v8/src/snapshot/builtin-deserializer-allocator.cc b/src/v8/src/snapshot/builtin-deserializer-allocator.cc
deleted file mode 100644
index 59cab6d..0000000
--- a/src/v8/src/snapshot/builtin-deserializer-allocator.cc
+++ /dev/null
@@ -1,289 +0,0 @@
-// Copyright 2017 the V8 project 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 "src/snapshot/builtin-deserializer-allocator.h"
-
-#include "src/heap/heap-inl.h"
-#include "src/interpreter/interpreter.h"
-#include "src/snapshot/builtin-deserializer.h"
-#include "src/snapshot/deserializer.h"
-
-namespace v8 {
-namespace internal {
-
-using interpreter::Bytecodes;
-using interpreter::Interpreter;
-
-BuiltinDeserializerAllocator::BuiltinDeserializerAllocator(
-    Deserializer<BuiltinDeserializerAllocator>* deserializer)
-    : deserializer_(deserializer) {}
-
-BuiltinDeserializerAllocator::~BuiltinDeserializerAllocator() {
-  delete handler_allocations_;
-}
-
-namespace {
-int HandlerAllocationIndex(int code_object_id) {
-  return code_object_id - BuiltinSnapshotUtils::kFirstHandlerIndex;
-}
-}  // namespace
-
-Address BuiltinDeserializerAllocator::Allocate(AllocationSpace space,
-                                               int size) {
-  const int code_object_id = deserializer()->CurrentCodeObjectId();
-  DCHECK_NE(BuiltinDeserializer::kNoCodeObjectId, code_object_id);
-  DCHECK_EQ(CODE_SPACE, space);
-  DCHECK_EQ(deserializer()->ExtractCodeObjectSize(code_object_id), size);
-#ifdef DEBUG
-  RegisterCodeObjectAllocation(code_object_id);
-#endif
-
-  if (BSU::IsBuiltinIndex(code_object_id)) {
-    Object* obj = isolate()->builtins()->builtin(code_object_id);
-    DCHECK(Internals::HasHeapObjectTag(obj));
-    return HeapObject::cast(obj)->address();
-  } else if (BSU::IsHandlerIndex(code_object_id)) {
-    if (handler_allocation_ != nullptr) {
-      // Lazy deserialization.
-      DCHECK_NULL(handler_allocations_);
-      return handler_allocation_;
-    } else {
-      // Eager deserialization.
-      DCHECK_NULL(handler_allocation_);
-      DCHECK_NOT_NULL(handler_allocations_);
-      int index = HandlerAllocationIndex(code_object_id);
-      DCHECK_NOT_NULL(handler_allocations_->at(index));
-      return handler_allocations_->at(index);
-    }
-  }
-
-  UNREACHABLE();
-}
-
-Heap::Reservation
-BuiltinDeserializerAllocator::CreateReservationsForEagerBuiltinsAndHandlers() {
-  Heap::Reservation result;
-
-  // Reservations for builtins.
-
-  // DeserializeLazy is always the first builtin reservation (to simplify logic
-  // in InitializeBuiltinsTable).
-  {
-    DCHECK(!Builtins::IsLazy(Builtins::kDeserializeLazy));
-    uint32_t builtin_size =
-        deserializer()->ExtractCodeObjectSize(Builtins::kDeserializeLazy);
-    DCHECK_LE(builtin_size, MemoryAllocator::PageAreaSize(CODE_SPACE));
-    result.push_back({builtin_size, nullptr, nullptr});
-  }
-
-  for (int i = 0; i < BSU::kNumberOfBuiltins; i++) {
-    if (i == Builtins::kDeserializeLazy) continue;
-
-    // Skip lazy builtins. These will be replaced by the DeserializeLazy code
-    // object in InitializeFromReservations and thus require no reserved space.
-    if (deserializer()->IsLazyDeserializationEnabled() && Builtins::IsLazy(i)) {
-      continue;
-    }
-
-    uint32_t builtin_size = deserializer()->ExtractCodeObjectSize(i);
-    DCHECK_LE(builtin_size, MemoryAllocator::PageAreaSize(CODE_SPACE));
-    result.push_back({builtin_size, nullptr, nullptr});
-  }
-
-  // Reservations for bytecode handlers.
-
-  BSU::ForEachBytecode(
-      [=, &result](Bytecode bytecode, OperandScale operand_scale) {
-        if (!Bytecodes::BytecodeHasHandler(bytecode, operand_scale)) {
-          // Bytecodes without a handler don't require a reservation.
-          return;
-        } else if (FLAG_lazy_handler_deserialization &&
-                   deserializer()->IsLazyDeserializationEnabled() &&
-                   Bytecodes::IsLazy(bytecode)) {
-          // Skip lazy handlers. These will be replaced by the DeserializeLazy
-          // code object in InitializeFromReservations and thus require no
-          // reserved space.
-          return;
-        }
-
-        const int index = BSU::BytecodeToIndex(bytecode, operand_scale);
-        uint32_t handler_size = deserializer()->ExtractCodeObjectSize(index);
-        DCHECK_LE(handler_size, MemoryAllocator::PageAreaSize(CODE_SPACE));
-        result.push_back({handler_size, nullptr, nullptr});
-      });
-
-  return result;
-}
-
-void BuiltinDeserializerAllocator::InitializeBuiltinFromReservation(
-    const Heap::Chunk& chunk, int builtin_id) {
-  DCHECK_EQ(deserializer()->ExtractCodeObjectSize(builtin_id), chunk.size);
-  DCHECK_EQ(chunk.size, chunk.end - chunk.start);
-
-  SkipList::Update(chunk.start, chunk.size);
-  isolate()->builtins()->set_builtin(builtin_id,
-                                     HeapObject::FromAddress(chunk.start));
-
-#ifdef DEBUG
-  RegisterCodeObjectReservation(builtin_id);
-#endif
-}
-
-void BuiltinDeserializerAllocator::InitializeHandlerFromReservation(
-    const Heap::Chunk& chunk, interpreter::Bytecode bytecode,
-    interpreter::OperandScale operand_scale) {
-  DCHECK_EQ(deserializer()->ExtractCodeObjectSize(
-                BSU::BytecodeToIndex(bytecode, operand_scale)),
-            chunk.size);
-  DCHECK_EQ(chunk.size, chunk.end - chunk.start);
-
-  SkipList::Update(chunk.start, chunk.size);
-
-  DCHECK_NOT_NULL(handler_allocations_);
-  const int index =
-      HandlerAllocationIndex(BSU::BytecodeToIndex(bytecode, operand_scale));
-  handler_allocations_->at(index) = chunk.start;
-
-#ifdef DEBUG
-  RegisterCodeObjectReservation(BSU::BytecodeToIndex(bytecode, operand_scale));
-#endif
-}
-
-void BuiltinDeserializerAllocator::InitializeFromReservations(
-    const Heap::Reservation& reservation) {
-  DCHECK(!AllowHeapAllocation::IsAllowed());
-
-  // Initialize the builtins table.
-
-  Builtins* builtins = isolate()->builtins();
-  int reservation_index = 0;
-
-  // Other builtins can be replaced by DeserializeLazy so it may not be lazy.
-  // It always occupies the first reservation slot.
-  {
-    DCHECK(!Builtins::IsLazy(Builtins::kDeserializeLazy));
-    InitializeBuiltinFromReservation(reservation[reservation_index],
-                                     Builtins::kDeserializeLazy);
-    reservation_index++;
-  }
-
-  Code* deserialize_lazy = builtins->builtin(Builtins::kDeserializeLazy);
-
-  for (int i = 0; i < BSU::kNumberOfBuiltins; i++) {
-    if (i == Builtins::kDeserializeLazy) continue;
-
-    if (deserializer()->IsLazyDeserializationEnabled() && Builtins::IsLazy(i)) {
-      builtins->set_builtin(i, deserialize_lazy);
-    } else {
-      InitializeBuiltinFromReservation(reservation[reservation_index], i);
-      reservation_index++;
-    }
-  }
-
-  // Initialize interpreter bytecode handler reservations.
-
-  DCHECK_NULL(handler_allocations_);
-  handler_allocations_ = new std::vector<Address>(BSU::kNumberOfHandlers);
-
-  BSU::ForEachBytecode(
-      [=, &reservation_index](Bytecode bytecode, OperandScale operand_scale) {
-        if (!Bytecodes::BytecodeHasHandler(bytecode, operand_scale)) {
-          // Bytecodes without a handler don't have a reservation.
-          return;
-        } else if (FLAG_lazy_handler_deserialization &&
-                   deserializer()->IsLazyDeserializationEnabled() &&
-                   Bytecodes::IsLazy(bytecode)) {
-          // Likewise, bytecodes with lazy handlers don't either.
-          return;
-        }
-
-        InitializeHandlerFromReservation(reservation[reservation_index],
-                                         bytecode, operand_scale);
-        reservation_index++;
-      });
-
-  DCHECK_EQ(reservation.size(), reservation_index);
-}
-
-void BuiltinDeserializerAllocator::ReserveAndInitializeBuiltinsTableForBuiltin(
-    int builtin_id) {
-  DCHECK(AllowHeapAllocation::IsAllowed());
-  DCHECK(isolate()->builtins()->is_initialized());
-  DCHECK(Builtins::IsBuiltinId(builtin_id));
-  DCHECK_NE(Builtins::kDeserializeLazy, builtin_id);
-  DCHECK_EQ(Builtins::kDeserializeLazy,
-            isolate()->builtins()->builtin(builtin_id)->builtin_index());
-
-  const uint32_t builtin_size =
-      deserializer()->ExtractCodeObjectSize(builtin_id);
-  DCHECK_LE(builtin_size, MemoryAllocator::PageAreaSize(CODE_SPACE));
-
-  Handle<HeapObject> o =
-      isolate()->factory()->NewCodeForDeserialization(builtin_size);
-
-  // Note: After this point and until deserialization finishes, heap allocation
-  // is disallowed. We currently can't safely assert this since we'd need to
-  // pass the DisallowHeapAllocation scope out of this function.
-
-  // Write the allocated filler object into the builtins table. It will be
-  // returned by our custom Allocate method below once needed.
-
-  isolate()->builtins()->set_builtin(builtin_id, *o);
-
-#ifdef DEBUG
-  RegisterCodeObjectReservation(builtin_id);
-#endif
-}
-
-void BuiltinDeserializerAllocator::ReserveForHandler(
-    Bytecode bytecode, OperandScale operand_scale) {
-  DCHECK(AllowHeapAllocation::IsAllowed());
-  DCHECK(isolate()->interpreter()->IsDispatchTableInitialized());
-
-  const int code_object_id = BSU::BytecodeToIndex(bytecode, operand_scale);
-  const uint32_t handler_size =
-      deserializer()->ExtractCodeObjectSize(code_object_id);
-  DCHECK_LE(handler_size, MemoryAllocator::PageAreaSize(CODE_SPACE));
-
-  handler_allocation_ =
-      isolate()->factory()->NewCodeForDeserialization(handler_size)->address();
-
-// Note: After this point and until deserialization finishes, heap allocation
-// is disallowed. We currently can't safely assert this since we'd need to
-// pass the DisallowHeapAllocation scope out of this function.
-
-#ifdef DEBUG
-  RegisterCodeObjectReservation(code_object_id);
-#endif
-}
-
-#ifdef DEBUG
-void BuiltinDeserializerAllocator::RegisterCodeObjectReservation(
-    int code_object_id) {
-  const auto result = unused_reservations_.emplace(code_object_id);
-  CHECK(result.second);  // False, iff builtin_id was already present in set.
-}
-
-void BuiltinDeserializerAllocator::RegisterCodeObjectAllocation(
-    int code_object_id) {
-  const size_t removed_elems = unused_reservations_.erase(code_object_id);
-  CHECK_EQ(removed_elems, 1);
-}
-
-bool BuiltinDeserializerAllocator::ReservationsAreFullyUsed() const {
-  // Not 100% precise but should be good enough.
-  return unused_reservations_.empty();
-}
-#endif  // DEBUG
-
-Isolate* BuiltinDeserializerAllocator::isolate() const {
-  return deserializer()->isolate();
-}
-
-BuiltinDeserializer* BuiltinDeserializerAllocator::deserializer() const {
-  return static_cast<BuiltinDeserializer*>(deserializer_);
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/snapshot/builtin-deserializer-allocator.h b/src/v8/src/snapshot/builtin-deserializer-allocator.h
deleted file mode 100644
index eb04b54..0000000
--- a/src/v8/src/snapshot/builtin-deserializer-allocator.h
+++ /dev/null
@@ -1,132 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_SNAPSHOT_BUILTIN_DESERIALIZER_ALLOCATOR_H_
-#define V8_SNAPSHOT_BUILTIN_DESERIALIZER_ALLOCATOR_H_
-
-#include <unordered_set>
-
-#include "src/globals.h"
-#include "src/heap/heap.h"
-#include "src/interpreter/interpreter.h"
-#include "src/snapshot/serializer-common.h"
-
-namespace v8 {
-namespace internal {
-
-template <class AllocatorT>
-class Deserializer;
-
-class BuiltinDeserializer;
-class BuiltinSnapshotUtils;
-
-class BuiltinDeserializerAllocator final {
-  using BSU = BuiltinSnapshotUtils;
-  using Bytecode = interpreter::Bytecode;
-  using OperandScale = interpreter::OperandScale;
-
- public:
-  BuiltinDeserializerAllocator(
-      Deserializer<BuiltinDeserializerAllocator>* deserializer);
-
-  ~BuiltinDeserializerAllocator();
-
-  // ------- Allocation Methods -------
-  // Methods related to memory allocation during deserialization.
-
-  // Allocation works differently here than in other deserializers. Instead of
-  // a statically-known memory area determined at serialization-time, our
-  // memory requirements here are determined at runtime. Another major
-  // difference is that we create builtin Code objects up-front (before
-  // deserialization) in order to avoid having to patch builtin references
-  // later on. See also the kBuiltin case in deserializer.cc.
-  //
-  // There are three ways that we use to reserve / allocate space. In all
-  // cases, required objects are requested from the GC prior to
-  // deserialization. 1. pre-allocated builtin code objects are written into
-  // the builtins table (this is to make deserialization of builtin references
-  // easier). Pre-allocated handler code objects are 2. stored in the
-  // {handler_allocations_} vector (at eager-deserialization time) and 3.
-  // stored in {handler_allocation_} (at lazy-deserialization time).
-  //
-  // Allocate simply returns the pre-allocated object prepared by
-  // InitializeFromReservations.
-  Address Allocate(AllocationSpace space, int size);
-
-  void MoveToNextChunk(AllocationSpace space) { UNREACHABLE(); }
-  void SetAlignment(AllocationAlignment alignment) { UNREACHABLE(); }
-
-  HeapObject* GetMap(uint32_t index) { UNREACHABLE(); }
-  HeapObject* GetLargeObject(uint32_t index) { UNREACHABLE(); }
-  HeapObject* GetObject(AllocationSpace space, uint32_t chunk_index,
-                        uint32_t chunk_offset) {
-    UNREACHABLE();
-  }
-
-  // ------- Reservation Methods -------
-  // Methods related to memory reservations (prior to deserialization).
-
-  // Builtin deserialization does not bake reservations into the snapshot, hence
-  // this is a nop.
-  void DecodeReservation(std::vector<SerializedData::Reservation> res) {}
-
-  // These methods are used to pre-allocate builtin objects prior to
-  // deserialization.
-  // TODO(jgruber): Refactor reservation/allocation logic in deserializers to
-  // make this less messy.
-  Heap::Reservation CreateReservationsForEagerBuiltinsAndHandlers();
-  void InitializeFromReservations(const Heap::Reservation& reservation);
-
-  // Creates reservations and initializes the builtins table in preparation for
-  // lazily deserializing a single builtin.
-  void ReserveAndInitializeBuiltinsTableForBuiltin(int builtin_id);
-
-  // Pre-allocates a code object preparation for lazily deserializing a single
-  // handler.
-  void ReserveForHandler(Bytecode bytecode, OperandScale operand_scale);
-
-#ifdef DEBUG
-  bool ReservationsAreFullyUsed() const;
-#endif
-
- private:
-  Isolate* isolate() const;
-  BuiltinDeserializer* deserializer() const;
-
-  // Used after memory allocation prior to isolate initialization, to register
-  // the newly created object in code space and add it to the builtins table.
-  void InitializeBuiltinFromReservation(const Heap::Chunk& chunk,
-                                        int builtin_id);
-
-  // As above, but for interpreter bytecode handlers.
-  void InitializeHandlerFromReservation(
-      const Heap::Chunk& chunk, interpreter::Bytecode bytecode,
-      interpreter::OperandScale operand_scale);
-
-#ifdef DEBUG
-  void RegisterCodeObjectReservation(int code_object_id);
-  void RegisterCodeObjectAllocation(int code_object_id);
-  std::unordered_set<int> unused_reservations_;
-#endif
-
- private:
-  // The current deserializer. Note that this always points to a
-  // BuiltinDeserializer instance, but we can't perform the cast during
-  // construction since that makes vtable-based checks fail.
-  Deserializer<BuiltinDeserializerAllocator>* const deserializer_;
-
-  // Stores allocated space for bytecode handlers during eager deserialization.
-  std::vector<Address>* handler_allocations_ = nullptr;
-
-  // Stores the allocated space for a single handler during lazy
-  // deserialization.
-  Address handler_allocation_ = nullptr;
-
-  DISALLOW_COPY_AND_ASSIGN(BuiltinDeserializerAllocator)
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_SNAPSHOT_BUILTIN_DESERIALIZER_ALLOCATOR_H_
diff --git a/src/v8/src/snapshot/builtin-deserializer.cc b/src/v8/src/snapshot/builtin-deserializer.cc
deleted file mode 100644
index 53a0f30..0000000
--- a/src/v8/src/snapshot/builtin-deserializer.cc
+++ /dev/null
@@ -1,205 +0,0 @@
-// Copyright 2017 the V8 project 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 "src/snapshot/builtin-deserializer.h"
-
-#include "src/assembler-inl.h"
-#include "src/interpreter/interpreter.h"
-#include "src/objects-inl.h"
-#include "src/snapshot/snapshot.h"
-
-namespace v8 {
-namespace internal {
-
-using interpreter::Bytecodes;
-using interpreter::Interpreter;
-
-// Tracks the code object currently being deserialized (required for
-// allocation).
-class DeserializingCodeObjectScope {
- public:
-  DeserializingCodeObjectScope(BuiltinDeserializer* builtin_deserializer,
-                               int code_object_id)
-      : builtin_deserializer_(builtin_deserializer) {
-    DCHECK_EQ(BuiltinDeserializer::kNoCodeObjectId,
-              builtin_deserializer->current_code_object_id_);
-    builtin_deserializer->current_code_object_id_ = code_object_id;
-  }
-
-  ~DeserializingCodeObjectScope() {
-    builtin_deserializer_->current_code_object_id_ =
-        BuiltinDeserializer::kNoCodeObjectId;
-  }
-
- private:
-  BuiltinDeserializer* builtin_deserializer_;
-
-  DISALLOW_COPY_AND_ASSIGN(DeserializingCodeObjectScope)
-};
-
-BuiltinDeserializer::BuiltinDeserializer(Isolate* isolate,
-                                         const BuiltinSnapshotData* data)
-    : Deserializer(data, false) {
-  code_offsets_ = data->BuiltinOffsets();
-  DCHECK_EQ(BSU::kNumberOfCodeObjects, code_offsets_.length());
-  DCHECK(std::is_sorted(code_offsets_.begin(), code_offsets_.end()));
-
-  Initialize(isolate);
-}
-
-void BuiltinDeserializer::DeserializeEagerBuiltinsAndHandlers() {
-  DCHECK(!AllowHeapAllocation::IsAllowed());
-  DCHECK_EQ(0, source()->position());
-
-  // Deserialize builtins.
-
-  Builtins* builtins = isolate()->builtins();
-  for (int i = 0; i < BSU::kNumberOfBuiltins; i++) {
-    if (IsLazyDeserializationEnabled() && Builtins::IsLazy(i)) {
-      // Do nothing. These builtins have been replaced by DeserializeLazy in
-      // InitializeFromReservations.
-      DCHECK_EQ(builtins->builtin(Builtins::kDeserializeLazy),
-                builtins->builtin(i));
-    } else {
-      builtins->set_builtin(i, DeserializeBuiltinRaw(i));
-    }
-  }
-
-#ifdef DEBUG
-  for (int i = 0; i < BSU::kNumberOfBuiltins; i++) {
-    Object* o = builtins->builtin(i);
-    DCHECK(o->IsCode() && Code::cast(o)->is_builtin());
-  }
-#endif
-
-  // Deserialize bytecode handlers.
-
-  Interpreter* interpreter = isolate()->interpreter();
-  DCHECK(!isolate()->interpreter()->IsDispatchTableInitialized());
-
-  BSU::ForEachBytecode([=](Bytecode bytecode, OperandScale operand_scale) {
-    // Bytecodes without a dedicated handler are patched up in a second pass.
-    if (!Bytecodes::BytecodeHasHandler(bytecode, operand_scale)) return;
-
-    // If lazy-deserialization is enabled and the current bytecode is lazy,
-    // we write the generic LazyDeserialization handler into the dispatch table
-    // and deserialize later upon first use.
-    Code* code = (FLAG_lazy_handler_deserialization &&
-                  IsLazyDeserializationEnabled() && Bytecodes::IsLazy(bytecode))
-                     ? GetDeserializeLazyHandler(operand_scale)
-                     : DeserializeHandlerRaw(bytecode, operand_scale);
-
-    interpreter->SetBytecodeHandler(bytecode, operand_scale, code);
-  });
-
-  // Patch up holes in the dispatch table.
-
-  Code* illegal_handler = interpreter->GetBytecodeHandler(
-      Bytecode::kIllegal, OperandScale::kSingle);
-
-  BSU::ForEachBytecode([=](Bytecode bytecode, OperandScale operand_scale) {
-    if (Bytecodes::BytecodeHasHandler(bytecode, operand_scale)) return;
-    interpreter->SetBytecodeHandler(bytecode, operand_scale, illegal_handler);
-  });
-
-  DCHECK(isolate()->interpreter()->IsDispatchTableInitialized());
-}
-
-Code* BuiltinDeserializer::DeserializeBuiltin(int builtin_id) {
-  allocator()->ReserveAndInitializeBuiltinsTableForBuiltin(builtin_id);
-  DisallowHeapAllocation no_gc;
-  return DeserializeBuiltinRaw(builtin_id);
-}
-
-Code* BuiltinDeserializer::DeserializeHandler(Bytecode bytecode,
-                                              OperandScale operand_scale) {
-  allocator()->ReserveForHandler(bytecode, operand_scale);
-  DisallowHeapAllocation no_gc;
-  return DeserializeHandlerRaw(bytecode, operand_scale);
-}
-
-Code* BuiltinDeserializer::DeserializeBuiltinRaw(int builtin_id) {
-  DCHECK(!AllowHeapAllocation::IsAllowed());
-  DCHECK(Builtins::IsBuiltinId(builtin_id));
-
-  DeserializingCodeObjectScope scope(this, builtin_id);
-
-  const int initial_position = source()->position();
-  source()->set_position(code_offsets_[builtin_id]);
-
-  Object* o = ReadDataSingle();
-  DCHECK(o->IsCode() && Code::cast(o)->is_builtin());
-
-  // Rewind.
-  source()->set_position(initial_position);
-
-  // Flush the instruction cache.
-  Code* code = Code::cast(o);
-  Assembler::FlushICache(isolate(), code->instruction_start(),
-                         code->instruction_size());
-
-  return code;
-}
-
-Code* BuiltinDeserializer::DeserializeHandlerRaw(Bytecode bytecode,
-                                                 OperandScale operand_scale) {
-  DCHECK(!AllowHeapAllocation::IsAllowed());
-  DCHECK(Bytecodes::BytecodeHasHandler(bytecode, operand_scale));
-
-  const int code_object_id = BSU::BytecodeToIndex(bytecode, operand_scale);
-  DeserializingCodeObjectScope scope(this, code_object_id);
-
-  const int initial_position = source()->position();
-  source()->set_position(code_offsets_[code_object_id]);
-
-  Object* o = ReadDataSingle();
-  DCHECK(o->IsCode() && Code::cast(o)->kind() == Code::BYTECODE_HANDLER);
-
-  // Rewind.
-  source()->set_position(initial_position);
-
-  // Flush the instruction cache.
-  Code* code = Code::cast(o);
-  Assembler::FlushICache(isolate(), code->instruction_start(),
-                         code->instruction_size());
-
-  return code;
-}
-
-uint32_t BuiltinDeserializer::ExtractCodeObjectSize(int code_object_id) {
-  DCHECK_LT(code_object_id, BSU::kNumberOfCodeObjects);
-
-  const int initial_position = source()->position();
-
-  // Grab the size of the code object.
-  source()->set_position(code_offsets_[code_object_id]);
-  byte data = source()->Get();
-
-  USE(data);
-  DCHECK_EQ(kNewObject | kPlain | kStartOfObject | CODE_SPACE, data);
-  const uint32_t result = source()->GetInt() << kObjectAlignmentBits;
-
-  // Rewind.
-  source()->set_position(initial_position);
-
-  return result;
-}
-
-Code* BuiltinDeserializer::GetDeserializeLazyHandler(
-    interpreter::OperandScale operand_scale) const {
-  STATIC_ASSERT(interpreter::BytecodeOperands::kOperandScaleCount == 3);
-  switch (operand_scale) {
-    case OperandScale::kSingle:
-      return Code::cast(isolate()->heap()->deserialize_lazy_handler());
-    case OperandScale::kDouble:
-      return Code::cast(isolate()->heap()->deserialize_lazy_handler_wide());
-    case OperandScale::kQuadruple:
-      return Code::cast(
-          isolate()->heap()->deserialize_lazy_handler_extra_wide());
-  }
-  UNREACHABLE();
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/snapshot/builtin-deserializer.h b/src/v8/src/snapshot/builtin-deserializer.h
deleted file mode 100644
index 38ba2fe..0000000
--- a/src/v8/src/snapshot/builtin-deserializer.h
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_SNAPSHOT_BUILTIN_DESERIALIZER_H_
-#define V8_SNAPSHOT_BUILTIN_DESERIALIZER_H_
-
-#include "src/interpreter/interpreter.h"
-#include "src/snapshot/builtin-deserializer-allocator.h"
-#include "src/snapshot/builtin-snapshot-utils.h"
-#include "src/snapshot/deserializer.h"
-
-namespace v8 {
-namespace internal {
-
-class BuiltinSnapshotData;
-
-// Deserializes the builtins blob.
-class BuiltinDeserializer final
-    : public Deserializer<BuiltinDeserializerAllocator> {
-  using BSU = BuiltinSnapshotUtils;
-  using Bytecode = interpreter::Bytecode;
-  using OperandScale = interpreter::OperandScale;
-
- public:
-  BuiltinDeserializer(Isolate* isolate, const BuiltinSnapshotData* data);
-
-  // Builtins deserialization is tightly integrated with deserialization of the
-  // startup blob. In particular, we need to ensure that no GC can occur
-  // between startup- and builtins deserialization, as all builtins have been
-  // pre-allocated and their pointers may not be invalidated.
-  //
-  // After this, the instruction cache must be flushed by the caller (we don't
-  // do it ourselves since the startup serializer batch-flushes all code pages).
-  void DeserializeEagerBuiltinsAndHandlers();
-
-  // Deserializes the single given builtin. This is used whenever a builtin is
-  // lazily deserialized at runtime.
-  Code* DeserializeBuiltin(int builtin_id);
-
-  // Deserializes the single given handler. This is used whenever a handler is
-  // lazily deserialized at runtime.
-  Code* DeserializeHandler(Bytecode bytecode, OperandScale operand_scale);
-
- private:
-  // Deserializes the single given builtin. Assumes that reservations have
-  // already been allocated.
-  Code* DeserializeBuiltinRaw(int builtin_id);
-
-  // Deserializes the single given bytecode handler. Assumes that reservations
-  // have already been allocated.
-  Code* DeserializeHandlerRaw(Bytecode bytecode, OperandScale operand_scale);
-
-  // Extracts the size builtin Code objects (baked into the snapshot).
-  uint32_t ExtractCodeObjectSize(int builtin_id);
-
-  // BuiltinDeserializer implements its own builtin iteration logic. Make sure
-  // the RootVisitor API is not used accidentally.
-  void VisitRootPointers(Root root, Object** start, Object** end) override {
-    UNREACHABLE();
-  }
-
-  int CurrentCodeObjectId() const { return current_code_object_id_; }
-
-  // Convenience function to grab the handler off the heap's strong root list.
-  Code* GetDeserializeLazyHandler(OperandScale operand_scale) const;
-
- private:
-  // Stores the code object currently being deserialized. The
-  // {current_code_object_id} stores the index of the currently-deserialized
-  // code object within the snapshot (and within {code_offsets_}). We need this
-  // to determine where to 'allocate' from during deserialization.
-  static const int kNoCodeObjectId = -1;
-  int current_code_object_id_ = kNoCodeObjectId;
-
-  // The offsets of each builtin within the serialized data. Equivalent to
-  // BuiltinSerializer::builtin_offsets_ but on the deserialization side.
-  Vector<const uint32_t> code_offsets_;
-
-  // For current_code_object_id_.
-  friend class DeserializingCodeObjectScope;
-
-  // For isolate(), IsLazyDeserializationEnabled(), CurrentCodeObjectId() and
-  // ExtractBuiltinSize().
-  friend class BuiltinDeserializerAllocator;
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_SNAPSHOT_BUILTIN_DESERIALIZER_H_
diff --git a/src/v8/src/snapshot/builtin-serializer-allocator.cc b/src/v8/src/snapshot/builtin-serializer-allocator.cc
deleted file mode 100644
index dbb5789..0000000
--- a/src/v8/src/snapshot/builtin-serializer-allocator.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2017 the V8 project 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 "src/snapshot/builtin-serializer-allocator.h"
-
-#include "src/heap/heap-inl.h"
-
-namespace v8 {
-namespace internal {
-
-SerializerReference BuiltinSerializerAllocator::Allocate(AllocationSpace space,
-                                                         uint32_t size) {
-  DCHECK_EQ(space, CODE_SPACE);
-  DCHECK_GT(size, 0);
-
-  // Builtin serialization & deserialization does not use the reservation
-  // system.  Instead of worrying about chunk indices and offsets, we simply
-  // need to generate unique offsets here.
-
-  const uint32_t virtual_chunk_index = 0;
-  const auto ref = SerializerReference::BackReference(
-      CODE_SPACE, virtual_chunk_index, virtual_chunk_offset_);
-
-  virtual_chunk_size_ += size;
-  virtual_chunk_offset_ += kObjectAlignment;  // Needs to be aligned.
-
-  return ref;
-}
-
-#ifdef DEBUG
-bool BuiltinSerializerAllocator::BackReferenceIsAlreadyAllocated(
-    SerializerReference reference) const {
-  DCHECK(reference.is_back_reference());
-  AllocationSpace space = reference.space();
-  DCHECK_EQ(space, CODE_SPACE);
-  DCHECK_EQ(reference.chunk_index(), 0);
-  return reference.chunk_offset() < virtual_chunk_offset_;
-}
-#endif  // DEBUG
-
-std::vector<SerializedData::Reservation>
-BuiltinSerializerAllocator::EncodeReservations() const {
-  return std::vector<SerializedData::Reservation>();
-}
-
-void BuiltinSerializerAllocator::OutputStatistics() {
-  DCHECK(FLAG_serialization_statistics);
-
-  PrintF("  Spaces (bytes):\n");
-
-  STATIC_ASSERT(NEW_SPACE == 0);
-  for (int space = 0; space < kNumberOfSpaces; space++) {
-    PrintF("%16s", AllocationSpaceName(static_cast<AllocationSpace>(space)));
-  }
-  PrintF("\n");
-
-  STATIC_ASSERT(NEW_SPACE == 0);
-  for (int space = 0; space < kNumberOfSpaces; space++) {
-    uint32_t space_size = (space == CODE_SPACE) ? virtual_chunk_size_ : 0;
-    PrintF("%16d", space_size);
-  }
-  PrintF("\n");
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/snapshot/builtin-serializer-allocator.h b/src/v8/src/snapshot/builtin-serializer-allocator.h
deleted file mode 100644
index a2c9a03..0000000
--- a/src/v8/src/snapshot/builtin-serializer-allocator.h
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_SNAPSHOT_BUILTIN_SERIALIZER_ALLOCATOR_H_
-#define V8_SNAPSHOT_BUILTIN_SERIALIZER_ALLOCATOR_H_
-
-#include "src/snapshot/serializer-common.h"
-
-namespace v8 {
-namespace internal {
-
-template <class AllocatorT>
-class Serializer;
-
-class BuiltinSerializerAllocator final {
- public:
-  BuiltinSerializerAllocator(
-      Serializer<BuiltinSerializerAllocator>* serializer) {}
-
-  SerializerReference Allocate(AllocationSpace space, uint32_t size);
-  SerializerReference AllocateMap() { UNREACHABLE(); }
-  SerializerReference AllocateLargeObject(uint32_t size) { UNREACHABLE(); }
-  SerializerReference AllocateOffHeapBackingStore() { UNREACHABLE(); }
-
-#ifdef DEBUG
-  bool BackReferenceIsAlreadyAllocated(
-      SerializerReference back_reference) const;
-#endif
-
-  std::vector<SerializedData::Reservation> EncodeReservations() const;
-
-  void OutputStatistics();
-
- private:
-  static constexpr int kNumberOfPreallocatedSpaces =
-      SerializerDeserializer::kNumberOfPreallocatedSpaces;
-  static constexpr int kNumberOfSpaces =
-      SerializerDeserializer::kNumberOfSpaces;
-
-  // We need to track a faked offset to create back-references. The size is
-  // kept simply to display statistics.
-  uint32_t virtual_chunk_size_ = 0;
-  uint32_t virtual_chunk_offset_ = 0;
-
-  DISALLOW_COPY_AND_ASSIGN(BuiltinSerializerAllocator)
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_SNAPSHOT_BUILTIN_SERIALIZER_ALLOCATOR_H_
diff --git a/src/v8/src/snapshot/builtin-serializer.cc b/src/v8/src/snapshot/builtin-serializer.cc
deleted file mode 100644
index 893c79c..0000000
--- a/src/v8/src/snapshot/builtin-serializer.cc
+++ /dev/null
@@ -1,144 +0,0 @@
-// Copyright 2017 the V8 project 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 "src/snapshot/builtin-serializer.h"
-
-#include "src/interpreter/interpreter.h"
-#include "src/objects-inl.h"
-#include "src/snapshot/startup-serializer.h"
-
-namespace v8 {
-namespace internal {
-
-using interpreter::Bytecode;
-using interpreter::Bytecodes;
-using interpreter::OperandScale;
-
-BuiltinSerializer::BuiltinSerializer(Isolate* isolate,
-                                     StartupSerializer* startup_serializer)
-    : Serializer(isolate), startup_serializer_(startup_serializer) {}
-
-BuiltinSerializer::~BuiltinSerializer() {
-  OutputStatistics("BuiltinSerializer");
-}
-
-void BuiltinSerializer::SerializeBuiltinsAndHandlers() {
-  // Serialize builtins.
-
-  STATIC_ASSERT(0 == BSU::kFirstBuiltinIndex);
-
-  for (int i = 0; i < BSU::kNumberOfBuiltins; i++) {
-    SetBuiltinOffset(i, sink_.Position());
-    SerializeBuiltin(isolate()->builtins()->builtin(i));
-  }
-
-  // Serialize bytecode handlers.
-
-  STATIC_ASSERT(BSU::kNumberOfBuiltins == BSU::kFirstHandlerIndex);
-
-  BSU::ForEachBytecode([=](Bytecode bytecode, OperandScale operand_scale) {
-    SetHandlerOffset(bytecode, operand_scale, sink_.Position());
-    if (!Bytecodes::BytecodeHasHandler(bytecode, operand_scale)) return;
-
-    SerializeHandler(
-        isolate()->interpreter()->GetBytecodeHandler(bytecode, operand_scale));
-  });
-
-  STATIC_ASSERT(BSU::kFirstHandlerIndex + BSU::kNumberOfHandlers ==
-                BSU::kNumberOfCodeObjects);
-
-  // The DeserializeLazy handlers are serialized by the StartupSerializer
-  // during strong root iteration.
-
-  DCHECK(isolate()->heap()->deserialize_lazy_handler()->IsCode());
-  DCHECK(isolate()->heap()->deserialize_lazy_handler_wide()->IsCode());
-  DCHECK(isolate()->heap()->deserialize_lazy_handler_extra_wide()->IsCode());
-
-  // Pad with kNop since GetInt() might read too far.
-  Pad();
-
-  // Append the offset table. During deserialization, the offset table is
-  // extracted by BuiltinSnapshotData.
-  const byte* data = reinterpret_cast<const byte*>(&code_offsets_[0]);
-  int data_length = static_cast<int>(sizeof(code_offsets_));
-  sink_.PutRaw(data, data_length, "BuiltinOffsets");
-}
-
-void BuiltinSerializer::VisitRootPointers(Root root, Object** start,
-                                          Object** end) {
-  UNREACHABLE();  // We iterate manually in SerializeBuiltins.
-}
-
-void BuiltinSerializer::SerializeBuiltin(Code* code) {
-  DCHECK_GE(code->builtin_index(), 0);
-
-  // All builtins are serialized unconditionally when the respective builtin is
-  // reached while iterating the builtins list. A builtin seen at any other
-  // time (e.g. startup snapshot creation, or while iterating a builtin code
-  // object during builtin serialization) is serialized by reference - see
-  // BuiltinSerializer::SerializeObject below.
-  ObjectSerializer object_serializer(this, code, &sink_, kPlain,
-                                     kStartOfObject);
-  object_serializer.Serialize();
-}
-
-void BuiltinSerializer::SerializeHandler(Code* code) {
-  DCHECK(ObjectIsBytecodeHandler(code));
-  ObjectSerializer object_serializer(this, code, &sink_, kPlain,
-                                     kStartOfObject);
-  object_serializer.Serialize();
-}
-
-void BuiltinSerializer::SerializeObject(HeapObject* o, HowToCode how_to_code,
-                                        WhereToPoint where_to_point, int skip) {
-  DCHECK(!o->IsSmi());
-
-  // Roots can simply be serialized as root references.
-  int root_index = root_index_map()->Lookup(o);
-  if (root_index != RootIndexMap::kInvalidRootIndex) {
-    DCHECK(startup_serializer_->root_has_been_serialized(root_index));
-    PutRoot(root_index, o, how_to_code, where_to_point, skip);
-    return;
-  }
-
-  // Builtins are serialized using a dedicated bytecode. We only reach this
-  // point if encountering a Builtin e.g. while iterating the body of another
-  // builtin.
-  if (SerializeBuiltinReference(o, how_to_code, where_to_point, skip)) return;
-
-  // Embedded objects are serialized as part of the partial snapshot cache.
-  // Currently we expect to see:
-  // * Code: Jump targets.
-  // * ByteArrays: Relocation infos.
-  // * FixedArrays: Handler tables.
-  // * Strings: CSA_ASSERTs in debug builds, various other string constants.
-  // * HeapNumbers: Embedded constants.
-  // TODO(6624): Jump targets should never trigger content serialization, it
-  // should always result in a reference instead. Reloc infos and handler
-  // tables should not end up in the partial snapshot cache.
-
-  FlushSkip(skip);
-
-  int cache_index = startup_serializer_->PartialSnapshotCacheIndex(o);
-  sink_.Put(kPartialSnapshotCache + how_to_code + where_to_point,
-            "PartialSnapshotCache");
-  sink_.PutInt(cache_index, "partial_snapshot_cache_index");
-}
-
-void BuiltinSerializer::SetBuiltinOffset(int builtin_id, uint32_t offset) {
-  DCHECK(Builtins::IsBuiltinId(builtin_id));
-  DCHECK(BSU::IsBuiltinIndex(builtin_id));
-  code_offsets_[builtin_id] = offset;
-}
-
-void BuiltinSerializer::SetHandlerOffset(Bytecode bytecode,
-                                         OperandScale operand_scale,
-                                         uint32_t offset) {
-  const int index = BSU::BytecodeToIndex(bytecode, operand_scale);
-  DCHECK(BSU::IsHandlerIndex(index));
-  code_offsets_[index] = offset;
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/snapshot/builtin-serializer.h b/src/v8/src/snapshot/builtin-serializer.h
deleted file mode 100644
index bb8bbde..0000000
--- a/src/v8/src/snapshot/builtin-serializer.h
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_SNAPSHOT_BUILTIN_SERIALIZER_H_
-#define V8_SNAPSHOT_BUILTIN_SERIALIZER_H_
-
-#include "src/interpreter/interpreter.h"
-#include "src/snapshot/builtin-serializer-allocator.h"
-#include "src/snapshot/builtin-snapshot-utils.h"
-#include "src/snapshot/serializer.h"
-
-namespace v8 {
-namespace internal {
-
-class StartupSerializer;
-
-// Responsible for serializing builtin and bytecode handler objects during
-// startup snapshot creation into a dedicated area of the snapshot.
-// See snapshot.h for documentation of the snapshot layout.
-class BuiltinSerializer : public Serializer<BuiltinSerializerAllocator> {
-  using BSU = BuiltinSnapshotUtils;
-
- public:
-  BuiltinSerializer(Isolate* isolate, StartupSerializer* startup_serializer);
-  ~BuiltinSerializer() override;
-
-  void SerializeBuiltinsAndHandlers();
-
- private:
-  void VisitRootPointers(Root root, Object** start, Object** end) override;
-
-  void SerializeBuiltin(Code* code);
-  void SerializeHandler(Code* code);
-  void SerializeObject(HeapObject* o, HowToCode how_to_code,
-                       WhereToPoint where_to_point, int skip) override;
-
-  void SetBuiltinOffset(int builtin_id, uint32_t offset);
-  void SetHandlerOffset(interpreter::Bytecode bytecode,
-                        interpreter::OperandScale operand_scale,
-                        uint32_t offset);
-
-  // The startup serializer is needed for access to the partial snapshot cache,
-  // which is used to serialize things like embedded constants.
-  StartupSerializer* startup_serializer_;
-
-  // Stores the starting offset, within the serialized data, of each code
-  // object. This is later packed into the builtin snapshot, and used by the
-  // builtin deserializer to deserialize individual builtins and bytecode
-  // handlers.
-  //
-  // Indices [kFirstBuiltinIndex, kFirstBuiltinIndex + kNumberOfBuiltins[:
-  //     Builtin offsets.
-  // Indices [kFirstHandlerIndex, kFirstHandlerIndex + kNumberOfHandlers[:
-  //     Bytecode handler offsets.
-  uint32_t code_offsets_[BuiltinSnapshotUtils::kNumberOfCodeObjects];
-
-  DISALLOW_COPY_AND_ASSIGN(BuiltinSerializer);
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_SNAPSHOT_BUILTIN_SERIALIZER_H_
diff --git a/src/v8/src/snapshot/builtin-snapshot-utils.cc b/src/v8/src/snapshot/builtin-snapshot-utils.cc
deleted file mode 100644
index e32a857..0000000
--- a/src/v8/src/snapshot/builtin-snapshot-utils.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2017 the V8 project 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 "src/snapshot/builtin-snapshot-utils.h"
-
-namespace v8 {
-namespace internal {
-
-// static
-bool BuiltinSnapshotUtils::IsBuiltinIndex(int maybe_index) {
-  return (kFirstBuiltinIndex <= maybe_index &&
-          maybe_index < kFirstBuiltinIndex + kNumberOfBuiltins);
-}
-
-// static
-bool BuiltinSnapshotUtils::IsHandlerIndex(int maybe_index) {
-  return (kFirstHandlerIndex <= maybe_index &&
-          maybe_index < kFirstHandlerIndex + kNumberOfHandlers);
-}
-
-// static
-int BuiltinSnapshotUtils::BytecodeToIndex(Bytecode bytecode,
-                                          OperandScale operand_scale) {
-  int index =
-      BuiltinSnapshotUtils::kNumberOfBuiltins + static_cast<int>(bytecode);
-  switch (operand_scale) {  // clang-format off
-    case OperandScale::kSingle: return index;
-    case OperandScale::kDouble: return index + Bytecodes::kBytecodeCount;
-    case OperandScale::kQuadruple: return index + 2 * Bytecodes::kBytecodeCount;
-  }  // clang-format on
-  UNREACHABLE();
-}
-
-// static
-std::pair<interpreter::Bytecode, interpreter::OperandScale>
-BuiltinSnapshotUtils::BytecodeFromIndex(int index) {
-  DCHECK(IsHandlerIndex(index));
-
-  const int x = index - BuiltinSnapshotUtils::kNumberOfBuiltins;
-  Bytecode bytecode = Bytecodes::FromByte(x % Bytecodes::kBytecodeCount);
-  switch (x / Bytecodes::kBytecodeCount) {  // clang-format off
-    case 0: return {bytecode, OperandScale::kSingle};
-    case 1: return {bytecode, OperandScale::kDouble};
-    case 2: return {bytecode, OperandScale::kQuadruple};
-    default: UNREACHABLE();
-  }  // clang-format on
-}
-
-// static
-void BuiltinSnapshotUtils::ForEachBytecode(
-    std::function<void(Bytecode, OperandScale)> f) {
-  static const OperandScale kOperandScales[] = {
-#define VALUE(Name, _) OperandScale::k##Name,
-      OPERAND_SCALE_LIST(VALUE)
-#undef VALUE
-  };
-
-  for (OperandScale operand_scale : kOperandScales) {
-    for (int i = 0; i < Bytecodes::kBytecodeCount; i++) {
-      f(Bytecodes::FromByte(i), operand_scale);
-    }
-  }
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/snapshot/builtin-snapshot-utils.h b/src/v8/src/snapshot/builtin-snapshot-utils.h
deleted file mode 100644
index 587b4a3..0000000
--- a/src/v8/src/snapshot/builtin-snapshot-utils.h
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_SNAPSHOT_BUILTIN_SNAPSHOT_UTILS_H_
-#define V8_SNAPSHOT_BUILTIN_SNAPSHOT_UTILS_H_
-
-#include <functional>
-
-#include "src/interpreter/interpreter.h"
-
-namespace v8 {
-namespace internal {
-
-// Constants and utility methods used by builtin and bytecode handler
-// (de)serialization.
-class BuiltinSnapshotUtils : public AllStatic {
-  using Bytecode = interpreter::Bytecode;
-  using BytecodeOperands = interpreter::BytecodeOperands;
-  using Bytecodes = interpreter::Bytecodes;
-  using Interpreter = interpreter::Interpreter;
-  using OperandScale = interpreter::OperandScale;
-
- public:
-  static const int kFirstBuiltinIndex = 0;
-  static const int kNumberOfBuiltins = Builtins::builtin_count;
-
-  static const int kFirstHandlerIndex = kFirstBuiltinIndex + kNumberOfBuiltins;
-  static const int kNumberOfHandlers =
-      Bytecodes::kBytecodeCount * BytecodeOperands::kOperandScaleCount;
-
-  // The number of code objects in the builtin snapshot.
-  // TODO(jgruber): This could be reduced by a bit since not every
-  // {bytecode, operand_scale} combination has an associated handler
-  // (see Bytecodes::BytecodeHasHandler).
-  static const int kNumberOfCodeObjects = kNumberOfBuiltins + kNumberOfHandlers;
-
-  // Indexes into the offsets vector contained in snapshot.
-  // See e.g. BuiltinSerializer::code_offsets_.
-  static bool IsBuiltinIndex(int maybe_index);
-  static bool IsHandlerIndex(int maybe_index);
-  static int BytecodeToIndex(Bytecode bytecode, OperandScale operand_scale);
-
-  // Converts an index back into the {bytecode,operand_scale} tuple. This is the
-  // inverse operation of BytecodeToIndex().
-  static std::pair<Bytecode, OperandScale> BytecodeFromIndex(int index);
-
-  // Iteration over all {bytecode,operand_scale} pairs. Implemented here since
-  // (de)serialization depends on the iteration order.
-  static void ForEachBytecode(std::function<void(Bytecode, OperandScale)> f);
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_SNAPSHOT_BUILTIN_SNAPSHOT_UTILS_H_
diff --git a/src/v8/src/snapshot/default-deserializer-allocator.cc b/src/v8/src/snapshot/default-deserializer-allocator.cc
deleted file mode 100644
index 5b34bfa..0000000
--- a/src/v8/src/snapshot/default-deserializer-allocator.cc
+++ /dev/null
@@ -1,246 +0,0 @@
-// Copyright 2017 the V8 project 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 "src/snapshot/default-deserializer-allocator.h"
-
-#include "src/heap/heap-inl.h"
-#include "src/snapshot/builtin-deserializer.h"
-#include "src/snapshot/deserializer.h"
-#include "src/snapshot/startup-deserializer.h"
-
-namespace v8 {
-namespace internal {
-
-DefaultDeserializerAllocator::DefaultDeserializerAllocator(
-    Deserializer<DefaultDeserializerAllocator>* deserializer)
-    : deserializer_(deserializer) {}
-
-// We know the space requirements before deserialization and can
-// pre-allocate that reserved space. During deserialization, all we need
-// to do is to bump up the pointer for each space in the reserved
-// space. This is also used for fixing back references.
-// We may have to split up the pre-allocation into several chunks
-// because it would not fit onto a single page. We do not have to keep
-// track of when to move to the next chunk. An opcode will signal this.
-// Since multiple large objects cannot be folded into one large object
-// space allocation, we have to do an actual allocation when deserializing
-// each large object. Instead of tracking offset for back references, we
-// reference large objects by index.
-Address DefaultDeserializerAllocator::AllocateRaw(AllocationSpace space,
-                                                  int size) {
-  if (space == LO_SPACE) {
-    AlwaysAllocateScope scope(isolate());
-    LargeObjectSpace* lo_space = isolate()->heap()->lo_space();
-    // TODO(jgruber): May be cleaner to pass in executability as an argument.
-    Executability exec =
-        static_cast<Executability>(deserializer_->source()->Get());
-    AllocationResult result = lo_space->AllocateRaw(size, exec);
-    HeapObject* obj = result.ToObjectChecked();
-    deserialized_large_objects_.push_back(obj);
-    return obj->address();
-  } else if (space == MAP_SPACE) {
-    DCHECK_EQ(Map::kSize, size);
-    return allocated_maps_[next_map_index_++];
-  } else {
-    DCHECK_LT(space, kNumberOfPreallocatedSpaces);
-    Address address = high_water_[space];
-    DCHECK_NOT_NULL(address);
-    high_water_[space] += size;
-#ifdef DEBUG
-    // Assert that the current reserved chunk is still big enough.
-    const Heap::Reservation& reservation = reservations_[space];
-    int chunk_index = current_chunk_[space];
-    DCHECK_LE(high_water_[space], reservation[chunk_index].end);
-#endif
-    if (space == CODE_SPACE) SkipList::Update(address, size);
-    return address;
-  }
-}
-
-Address DefaultDeserializerAllocator::Allocate(AllocationSpace space,
-                                               int size) {
-  Address address;
-  HeapObject* obj;
-
-  if (next_alignment_ != kWordAligned) {
-    const int reserved = size + Heap::GetMaximumFillToAlign(next_alignment_);
-    address = AllocateRaw(space, reserved);
-    obj = HeapObject::FromAddress(address);
-    // If one of the following assertions fails, then we are deserializing an
-    // aligned object when the filler maps have not been deserialized yet.
-    // We require filler maps as padding to align the object.
-    Heap* heap = isolate()->heap();
-    DCHECK(heap->free_space_map()->IsMap());
-    DCHECK(heap->one_pointer_filler_map()->IsMap());
-    DCHECK(heap->two_pointer_filler_map()->IsMap());
-    obj = heap->AlignWithFiller(obj, size, reserved, next_alignment_);
-    address = obj->address();
-    next_alignment_ = kWordAligned;
-    return address;
-  } else {
-    return AllocateRaw(space, size);
-  }
-}
-
-void DefaultDeserializerAllocator::MoveToNextChunk(AllocationSpace space) {
-  DCHECK_LT(space, kNumberOfPreallocatedSpaces);
-  uint32_t chunk_index = current_chunk_[space];
-  const Heap::Reservation& reservation = reservations_[space];
-  // Make sure the current chunk is indeed exhausted.
-  CHECK_EQ(reservation[chunk_index].end, high_water_[space]);
-  // Move to next reserved chunk.
-  chunk_index = ++current_chunk_[space];
-  CHECK_LT(chunk_index, reservation.size());
-  high_water_[space] = reservation[chunk_index].start;
-}
-
-HeapObject* DefaultDeserializerAllocator::GetMap(uint32_t index) {
-  DCHECK_LT(index, next_map_index_);
-  return HeapObject::FromAddress(allocated_maps_[index]);
-}
-
-HeapObject* DefaultDeserializerAllocator::GetLargeObject(uint32_t index) {
-  DCHECK_LT(index, deserialized_large_objects_.size());
-  return deserialized_large_objects_[index];
-}
-
-HeapObject* DefaultDeserializerAllocator::GetObject(AllocationSpace space,
-                                                    uint32_t chunk_index,
-                                                    uint32_t chunk_offset) {
-  DCHECK_LT(space, kNumberOfPreallocatedSpaces);
-  DCHECK_LE(chunk_index, current_chunk_[space]);
-  Address address = reservations_[space][chunk_index].start + chunk_offset;
-  if (next_alignment_ != kWordAligned) {
-    int padding = Heap::GetFillToAlign(address, next_alignment_);
-    next_alignment_ = kWordAligned;
-    DCHECK(padding == 0 || HeapObject::FromAddress(address)->IsFiller());
-    address += padding;
-  }
-  return HeapObject::FromAddress(address);
-}
-
-void DefaultDeserializerAllocator::DecodeReservation(
-    std::vector<SerializedData::Reservation> res) {
-  DCHECK_EQ(0, reservations_[NEW_SPACE].size());
-  STATIC_ASSERT(NEW_SPACE == 0);
-  int current_space = NEW_SPACE;
-  for (auto& r : res) {
-    reservations_[current_space].push_back({r.chunk_size(), NULL, NULL});
-    if (r.is_last()) current_space++;
-  }
-  DCHECK_EQ(kNumberOfSpaces, current_space);
-  for (int i = 0; i < kNumberOfPreallocatedSpaces; i++) current_chunk_[i] = 0;
-}
-
-bool DefaultDeserializerAllocator::ReserveSpace() {
-#ifdef DEBUG
-  for (int i = NEW_SPACE; i < kNumberOfSpaces; ++i) {
-    DCHECK_GT(reservations_[i].size(), 0);
-  }
-#endif  // DEBUG
-  DCHECK(allocated_maps_.empty());
-  if (!isolate()->heap()->ReserveSpace(reservations_, &allocated_maps_)) {
-    return false;
-  }
-  for (int i = 0; i < kNumberOfPreallocatedSpaces; i++) {
-    high_water_[i] = reservations_[i][0].start;
-  }
-  return true;
-}
-
-// static
-bool DefaultDeserializerAllocator::ReserveSpace(
-    StartupDeserializer* startup_deserializer,
-    BuiltinDeserializer* builtin_deserializer) {
-  const int first_space = NEW_SPACE;
-  const int last_space = SerializerDeserializer::kNumberOfSpaces;
-  Isolate* isolate = startup_deserializer->isolate();
-
-  // Create a set of merged reservations to reserve space in one go.
-  // The BuiltinDeserializer's reservations are ignored, since our actual
-  // requirements vary based on whether lazy deserialization is enabled.
-  // Instead, we manually determine the required code-space.
-
-  Heap::Reservation merged_reservations[kNumberOfSpaces];
-  for (int i = first_space; i < last_space; i++) {
-    merged_reservations[i] =
-        startup_deserializer->allocator()->reservations_[i];
-  }
-
-  Heap::Reservation builtin_reservations =
-      builtin_deserializer->allocator()
-          ->CreateReservationsForEagerBuiltinsAndHandlers();
-  DCHECK(!builtin_reservations.empty());
-
-  for (const auto& c : builtin_reservations) {
-    merged_reservations[CODE_SPACE].push_back(c);
-  }
-
-  if (!isolate->heap()->ReserveSpace(
-          merged_reservations,
-          &startup_deserializer->allocator()->allocated_maps_)) {
-    return false;
-  }
-
-  DisallowHeapAllocation no_allocation;
-
-  // Distribute the successful allocations between both deserializers.
-  // There's nothing to be done here except for code space.
-
-  {
-    const int num_builtin_reservations =
-        static_cast<int>(builtin_reservations.size());
-    for (int i = num_builtin_reservations - 1; i >= 0; i--) {
-      const auto& c = merged_reservations[CODE_SPACE].back();
-      DCHECK_EQ(c.size, builtin_reservations[i].size);
-      DCHECK_EQ(c.size, c.end - c.start);
-      builtin_reservations[i].start = c.start;
-      builtin_reservations[i].end = c.end;
-      merged_reservations[CODE_SPACE].pop_back();
-    }
-
-    builtin_deserializer->allocator()->InitializeFromReservations(
-        builtin_reservations);
-  }
-
-  // Write back startup reservations.
-
-  for (int i = first_space; i < last_space; i++) {
-    startup_deserializer->allocator()->reservations_[i].swap(
-        merged_reservations[i]);
-  }
-
-  for (int i = first_space; i < kNumberOfPreallocatedSpaces; i++) {
-    startup_deserializer->allocator()->high_water_[i] =
-        startup_deserializer->allocator()->reservations_[i][0].start;
-  }
-
-  return true;
-}
-
-bool DefaultDeserializerAllocator::ReservationsAreFullyUsed() const {
-  for (int space = 0; space < kNumberOfPreallocatedSpaces; space++) {
-    const uint32_t chunk_index = current_chunk_[space];
-    if (reservations_[space].size() != chunk_index + 1) {
-      return false;
-    }
-    if (reservations_[space][chunk_index].end != high_water_[space]) {
-      return false;
-    }
-  }
-  return (allocated_maps_.size() == next_map_index_);
-}
-
-void DefaultDeserializerAllocator::
-    RegisterDeserializedObjectsForBlackAllocation() {
-  isolate()->heap()->RegisterDeserializedObjectsForBlackAllocation(
-      reservations_, deserialized_large_objects_, allocated_maps_);
-}
-
-Isolate* DefaultDeserializerAllocator::isolate() const {
-  return deserializer_->isolate();
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/snapshot/default-deserializer-allocator.h b/src/v8/src/snapshot/default-deserializer-allocator.h
deleted file mode 100644
index 124c637..0000000
--- a/src/v8/src/snapshot/default-deserializer-allocator.h
+++ /dev/null
@@ -1,102 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_SNAPSHOT_DEFAULT_DESERIALIZER_ALLOCATOR_H_
-#define V8_SNAPSHOT_DEFAULT_DESERIALIZER_ALLOCATOR_H_
-
-#include "src/globals.h"
-#include "src/heap/heap.h"
-#include "src/snapshot/serializer-common.h"
-
-namespace v8 {
-namespace internal {
-
-template <class AllocatorT>
-class Deserializer;
-
-class BuiltinDeserializer;
-class StartupDeserializer;
-
-class DefaultDeserializerAllocator final {
- public:
-  DefaultDeserializerAllocator(
-      Deserializer<DefaultDeserializerAllocator>* deserializer);
-
-  // ------- Allocation Methods -------
-  // Methods related to memory allocation during deserialization.
-
-  Address Allocate(AllocationSpace space, int size);
-
-  void MoveToNextChunk(AllocationSpace space);
-  void SetAlignment(AllocationAlignment alignment) {
-    DCHECK_EQ(kWordAligned, next_alignment_);
-    DCHECK_LE(kWordAligned, alignment);
-    DCHECK_LE(alignment, kDoubleUnaligned);
-    next_alignment_ = static_cast<AllocationAlignment>(alignment);
-  }
-
-  HeapObject* GetMap(uint32_t index);
-  HeapObject* GetLargeObject(uint32_t index);
-  HeapObject* GetObject(AllocationSpace space, uint32_t chunk_index,
-                        uint32_t chunk_offset);
-
-  // ------- Reservation Methods -------
-  // Methods related to memory reservations (prior to deserialization).
-
-  void DecodeReservation(std::vector<SerializedData::Reservation> res);
-  bool ReserveSpace();
-
-  // Atomically reserves space for the two given deserializers. Guarantees
-  // reservation for both without garbage collection in-between.
-  static bool ReserveSpace(StartupDeserializer* startup_deserializer,
-                           BuiltinDeserializer* builtin_deserializer);
-
-  bool ReservationsAreFullyUsed() const;
-
-  // ------- Misc Utility Methods -------
-
-  void RegisterDeserializedObjectsForBlackAllocation();
-
- private:
-  Isolate* isolate() const;
-
-  // Raw allocation without considering alignment.
-  Address AllocateRaw(AllocationSpace space, int size);
-
- private:
-  static constexpr int kNumberOfPreallocatedSpaces =
-      SerializerDeserializer::kNumberOfPreallocatedSpaces;
-  static constexpr int kNumberOfSpaces =
-      SerializerDeserializer::kNumberOfSpaces;
-
-  // The address of the next object that will be allocated in each space.
-  // Each space has a number of chunks reserved by the GC, with each chunk
-  // fitting into a page. Deserialized objects are allocated into the
-  // current chunk of the target space by bumping up high water mark.
-  Heap::Reservation reservations_[kNumberOfSpaces];
-  uint32_t current_chunk_[kNumberOfPreallocatedSpaces];
-  Address high_water_[kNumberOfPreallocatedSpaces];
-
-  // The alignment of the next allocation.
-  AllocationAlignment next_alignment_ = kWordAligned;
-
-  // All required maps are pre-allocated during reservation. {next_map_index_}
-  // stores the index of the next map to return from allocation.
-  uint32_t next_map_index_ = 0;
-  std::vector<Address> allocated_maps_;
-
-  // Allocated large objects are kept in this map and may be fetched later as
-  // back-references.
-  std::vector<HeapObject*> deserialized_large_objects_;
-
-  // The current deserializer.
-  Deserializer<DefaultDeserializerAllocator>* const deserializer_;
-
-  DISALLOW_COPY_AND_ASSIGN(DefaultDeserializerAllocator)
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_SNAPSHOT_DEFAULT_DESERIALIZER_ALLOCATOR_H_
diff --git a/src/v8/src/snapshot/default-serializer-allocator.cc b/src/v8/src/snapshot/default-serializer-allocator.cc
deleted file mode 100644
index b8cc55f..0000000
--- a/src/v8/src/snapshot/default-serializer-allocator.cc
+++ /dev/null
@@ -1,146 +0,0 @@
-// Copyright 2017 the V8 project 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 "src/snapshot/default-serializer-allocator.h"
-
-#include "src/heap/heap-inl.h"
-#include "src/snapshot/serializer.h"
-#include "src/snapshot/snapshot-source-sink.h"
-
-namespace v8 {
-namespace internal {
-
-DefaultSerializerAllocator::DefaultSerializerAllocator(
-    Serializer<DefaultSerializerAllocator>* serializer)
-    : serializer_(serializer) {
-  for (int i = 0; i < kNumberOfPreallocatedSpaces; i++) {
-    pending_chunk_[i] = 0;
-  }
-}
-
-SerializerReference DefaultSerializerAllocator::Allocate(AllocationSpace space,
-                                                         uint32_t size) {
-  DCHECK(space >= 0 && space < kNumberOfPreallocatedSpaces);
-  DCHECK(size > 0 && size <= MaxChunkSizeInSpace(space));
-
-  // Maps are allocated through AllocateMap.
-  DCHECK_NE(MAP_SPACE, space);
-
-  uint32_t new_chunk_size = pending_chunk_[space] + size;
-  if (new_chunk_size > MaxChunkSizeInSpace(space)) {
-    // The new chunk size would not fit onto a single page. Complete the
-    // current chunk and start a new one.
-    serializer_->PutNextChunk(space);
-    completed_chunks_[space].push_back(pending_chunk_[space]);
-    pending_chunk_[space] = 0;
-    new_chunk_size = size;
-  }
-  uint32_t offset = pending_chunk_[space];
-  pending_chunk_[space] = new_chunk_size;
-  return SerializerReference::BackReference(
-      space, static_cast<uint32_t>(completed_chunks_[space].size()), offset);
-}
-
-SerializerReference DefaultSerializerAllocator::AllocateMap() {
-  // Maps are allocated one-by-one when deserializing.
-  return SerializerReference::MapReference(num_maps_++);
-}
-
-SerializerReference DefaultSerializerAllocator::AllocateLargeObject(
-    uint32_t size) {
-  // Large objects are allocated one-by-one when deserializing. We do not
-  // have to keep track of multiple chunks.
-  large_objects_total_size_ += size;
-  return SerializerReference::LargeObjectReference(seen_large_objects_index_++);
-}
-
-SerializerReference DefaultSerializerAllocator::AllocateOffHeapBackingStore() {
-  DCHECK_NE(0, seen_backing_stores_index_);
-  return SerializerReference::OffHeapBackingStoreReference(
-      seen_backing_stores_index_++);
-}
-
-#ifdef DEBUG
-bool DefaultSerializerAllocator::BackReferenceIsAlreadyAllocated(
-    SerializerReference reference) const {
-  DCHECK(reference.is_back_reference());
-  AllocationSpace space = reference.space();
-  if (space == LO_SPACE) {
-    return reference.large_object_index() < seen_large_objects_index_;
-  } else if (space == MAP_SPACE) {
-    return reference.map_index() < num_maps_;
-  } else {
-    size_t chunk_index = reference.chunk_index();
-    if (chunk_index == completed_chunks_[space].size()) {
-      return reference.chunk_offset() < pending_chunk_[space];
-    } else {
-      return chunk_index < completed_chunks_[space].size() &&
-             reference.chunk_offset() < completed_chunks_[space][chunk_index];
-    }
-  }
-}
-#endif
-
-std::vector<SerializedData::Reservation>
-DefaultSerializerAllocator::EncodeReservations() const {
-  std::vector<SerializedData::Reservation> out;
-
-  STATIC_ASSERT(NEW_SPACE == 0);
-  for (int i = 0; i < kNumberOfPreallocatedSpaces; i++) {
-    for (size_t j = 0; j < completed_chunks_[i].size(); j++) {
-      out.emplace_back(completed_chunks_[i][j]);
-    }
-
-    if (pending_chunk_[i] > 0 || completed_chunks_[i].size() == 0) {
-      out.emplace_back(pending_chunk_[i]);
-    }
-    out.back().mark_as_last();
-  }
-
-  STATIC_ASSERT(MAP_SPACE == kNumberOfPreallocatedSpaces);
-  out.emplace_back(num_maps_ * Map::kSize);
-  out.back().mark_as_last();
-
-  STATIC_ASSERT(LO_SPACE == MAP_SPACE + 1);
-  out.emplace_back(large_objects_total_size_);
-  out.back().mark_as_last();
-
-  return out;
-}
-
-void DefaultSerializerAllocator::OutputStatistics() {
-  DCHECK(FLAG_serialization_statistics);
-
-  PrintF("  Spaces (bytes):\n");
-
-  STATIC_ASSERT(NEW_SPACE == 0);
-  for (int space = 0; space < kNumberOfSpaces; space++) {
-    PrintF("%16s", AllocationSpaceName(static_cast<AllocationSpace>(space)));
-  }
-  PrintF("\n");
-
-  STATIC_ASSERT(NEW_SPACE == 0);
-  for (int space = 0; space < kNumberOfPreallocatedSpaces; space++) {
-    size_t s = pending_chunk_[space];
-    for (uint32_t chunk_size : completed_chunks_[space]) s += chunk_size;
-    PrintF("%16" PRIuS, s);
-  }
-
-  STATIC_ASSERT(MAP_SPACE == kNumberOfPreallocatedSpaces);
-  PrintF("%16d", num_maps_ * Map::kSize);
-
-  STATIC_ASSERT(LO_SPACE == MAP_SPACE + 1);
-  PrintF("%16d\n", large_objects_total_size_);
-}
-
-// static
-uint32_t DefaultSerializerAllocator::MaxChunkSizeInSpace(int space) {
-  DCHECK(0 <= space && space < kNumberOfPreallocatedSpaces);
-
-  return static_cast<uint32_t>(
-      MemoryAllocator::PageAreaSize(static_cast<AllocationSpace>(space)));
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/snapshot/default-serializer-allocator.h b/src/v8/src/snapshot/default-serializer-allocator.h
deleted file mode 100644
index b015327..0000000
--- a/src/v8/src/snapshot/default-serializer-allocator.h
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_SNAPSHOT_DEFAULT_SERIALIZER_ALLOCATOR_H_
-#define V8_SNAPSHOT_DEFAULT_SERIALIZER_ALLOCATOR_H_
-
-#include "src/snapshot/serializer-common.h"
-
-namespace v8 {
-namespace internal {
-
-template <class AllocatorT>
-class Serializer;
-
-class DefaultSerializerAllocator final {
- public:
-  DefaultSerializerAllocator(
-      Serializer<DefaultSerializerAllocator>* serializer);
-
-  SerializerReference Allocate(AllocationSpace space, uint32_t size);
-  SerializerReference AllocateMap();
-  SerializerReference AllocateLargeObject(uint32_t size);
-  SerializerReference AllocateOffHeapBackingStore();
-
-#ifdef DEBUG
-  bool BackReferenceIsAlreadyAllocated(
-      SerializerReference back_reference) const;
-#endif
-
-  std::vector<SerializedData::Reservation> EncodeReservations() const;
-
-  void OutputStatistics();
-
- private:
-  static constexpr int kNumberOfPreallocatedSpaces =
-      SerializerDeserializer::kNumberOfPreallocatedSpaces;
-  static constexpr int kNumberOfSpaces =
-      SerializerDeserializer::kNumberOfSpaces;
-
-  static uint32_t MaxChunkSizeInSpace(int space);
-
-  // Objects from the same space are put into chunks for bulk-allocation
-  // when deserializing. We have to make sure that each chunk fits into a
-  // page. So we track the chunk size in pending_chunk_ of a space, but
-  // when it exceeds a page, we complete the current chunk and start a new one.
-  uint32_t pending_chunk_[kNumberOfPreallocatedSpaces];
-  std::vector<uint32_t> completed_chunks_[kNumberOfPreallocatedSpaces];
-
-  // Number of maps that we need to allocate.
-  uint32_t num_maps_ = 0;
-
-  // We map serialized large objects to indexes for back-referencing.
-  uint32_t large_objects_total_size_ = 0;
-  uint32_t seen_large_objects_index_ = 0;
-
-  // Used to keep track of the off-heap backing stores used by TypedArrays/
-  // ArrayBuffers. Note that the index begins at 1 and not 0, because when a
-  // TypedArray has an on-heap backing store, the backing_store pointer in the
-  // corresponding ArrayBuffer will be null, which makes it indistinguishable
-  // from index 0.
-  uint32_t seen_backing_stores_index_ = 1;
-
-  // The current serializer.
-  Serializer<DefaultSerializerAllocator>* const serializer_;
-
-  DISALLOW_COPY_AND_ASSIGN(DefaultSerializerAllocator)
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_SNAPSHOT_DEFAULT_SERIALIZER_ALLOCATOR_H_
diff --git a/src/v8/src/third_party/vtune/v8vtune.gyp b/src/v8/src/third_party/vtune/v8vtune.gyp
deleted file mode 100644
index aaf521f..0000000
--- a/src/v8/src/third_party/vtune/v8vtune.gyp
+++ /dev/null
@@ -1,59 +0,0 @@
-# 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_code': 1,
-  },
-  'includes': ['../../../gypfiles/toolchain.gypi', '../../../gypfiles/features.gypi'],
-  'targets': [
-    {
-      'target_name': 'v8_vtune',
-      'type': 'static_library',
-      'dependencies': [
-        '../../v8.gyp:v8',
-      ],
-      'sources': [
-        'ittnotify_config.h',
-        'ittnotify_types.h',
-        'jitprofiling.cc',
-        'jitprofiling.h',
-        'v8-vtune.h',
-        'vtune-jit.cc',
-        'vtune-jit.h',
-      ],
-      'direct_dependent_settings': {
-        'defines': ['ENABLE_VTUNE_JIT_INTERFACE',],
-        'conditions': [
-          ['OS != "win"', {
-            'libraries': ['-ldl',],
-          }],   
-        ],
-      },
-    },
-  ],
-}
diff --git a/src/v8/src/wasm/compilation-manager.cc b/src/v8/src/wasm/compilation-manager.cc
deleted file mode 100644
index a19a228..0000000
--- a/src/v8/src/wasm/compilation-manager.cc
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2017 the V8 project 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 "src/wasm/compilation-manager.h"
-#include "src/base/template-utils.h"
-
-#include "src/objects-inl.h"
-
-namespace v8 {
-namespace internal {
-namespace wasm {
-
-AsyncCompileJob* CompilationManager::CreateAsyncCompileJob(
-    Isolate* isolate, std::unique_ptr<byte[]> bytes_copy, size_t length,
-    Handle<Context> context, Handle<JSPromise> promise) {
-  std::shared_ptr<AsyncCompileJob> job(new AsyncCompileJob(
-      isolate, std::move(bytes_copy), length, context, promise));
-  jobs_.insert({job.get(), job});
-  return job.get();
-}
-
-void CompilationManager::StartAsyncCompileJob(
-    Isolate* isolate, std::unique_ptr<byte[]> bytes_copy, size_t length,
-    Handle<Context> context, Handle<JSPromise> promise) {
-  AsyncCompileJob* job = CreateAsyncCompileJob(isolate, std::move(bytes_copy),
-                                               length, context, promise);
-  job->Start();
-}
-
-std::shared_ptr<StreamingDecoder> CompilationManager::StartStreamingCompilation(
-    Isolate* isolate, Handle<Context> context, Handle<JSPromise> promise) {
-  AsyncCompileJob* job = CreateAsyncCompileJob(
-      isolate, std::unique_ptr<byte[]>(nullptr), 0, context, promise);
-  return job->CreateStreamingDecoder();
-}
-
-std::shared_ptr<AsyncCompileJob> CompilationManager::RemoveJob(
-    AsyncCompileJob* job) {
-  auto item = jobs_.find(job);
-  DCHECK(item != jobs_.end());
-  std::shared_ptr<AsyncCompileJob> result = std::move(item->second);
-  jobs_.erase(item);
-  return result;
-}
-
-void CompilationManager::TearDown() { jobs_.clear(); }
-
-}  // namespace wasm
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/wasm/compilation-manager.h b/src/v8/src/wasm/compilation-manager.h
deleted file mode 100644
index e359b11..0000000
--- a/src/v8/src/wasm/compilation-manager.h
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_WASM_COMPILATION_MANAGER_H_
-#define V8_WASM_COMPILATION_MANAGER_H_
-
-#include <vector>
-
-#include "src/handles.h"
-#include "src/isolate.h"
-#include "src/wasm/module-compiler.h"
-
-namespace v8 {
-namespace internal {
-namespace wasm {
-
-// The CompilationManager manages a list of active WebAssembly compile jobs. The
-// manager owns the memory of the compile jobs and can trigger the abortion of
-// compile jobs. If the isolate tears down, the CompilationManager makes sure
-// that all compile jobs finish executing before the isolate becomes
-// unavailable.
-class CompilationManager {
- public:
-  void StartAsyncCompileJob(Isolate* isolate,
-                            std::unique_ptr<byte[]> bytes_copy, size_t length,
-                            Handle<Context> context, Handle<JSPromise> promise);
-
-  std::shared_ptr<StreamingDecoder> StartStreamingCompilation(
-      Isolate* isolate, Handle<Context> context, Handle<JSPromise> promise);
-
-  // Removes {job} from the list of active compile jobs.
-  std::shared_ptr<AsyncCompileJob> RemoveJob(AsyncCompileJob* job);
-
-  void TearDown();
-
- private:
-  AsyncCompileJob* CreateAsyncCompileJob(Isolate* isolate,
-                                         std::unique_ptr<byte[]> bytes_copy,
-                                         size_t length, Handle<Context> context,
-                                         Handle<JSPromise> promise);
-
-  // We use an AsyncCompileJob as the key for itself so that we can delete the
-  // job from the map when it is finished.
-  std::unordered_map<AsyncCompileJob*, std::shared_ptr<AsyncCompileJob>> jobs_;
-};
-
-}  // namespace wasm
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_WASM_COMPILATION_MANAGER_H_
diff --git a/src/v8/src/wasm/wasm-api.cc b/src/v8/src/wasm/wasm-api.cc
deleted file mode 100644
index 4c51dc5..0000000
--- a/src/v8/src/wasm/wasm-api.cc
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2017 the V8 project 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 "src/wasm/wasm-api.h"
-
-#include "src/isolate-inl.h"
-#include "src/isolate.h"
-
-namespace v8 {
-namespace internal {
-namespace wasm {
-
-ScheduledErrorThrower::~ScheduledErrorThrower() {
-  // There should never be both a pending and a scheduled exception.
-  DCHECK(!isolate()->has_scheduled_exception() ||
-         !isolate()->has_pending_exception());
-  // Don't throw another error if there is already a scheduled error.
-  if (isolate()->has_scheduled_exception()) {
-    Reset();
-  } else if (isolate()->has_pending_exception()) {
-    Reset();
-    isolate()->OptionalRescheduleException(false);
-  } else if (error()) {
-    isolate()->ScheduleThrow(*Reify());
-  }
-}
-
-}  // namespace wasm
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/wasm/wasm-api.h b/src/v8/src/wasm/wasm-api.h
deleted file mode 100644
index 464cdfa..0000000
--- a/src/v8/src/wasm/wasm-api.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_WASM_API_H_
-#define V8_WASM_API_H_
-
-#include "src/wasm/wasm-result.h"
-
-namespace v8 {
-namespace internal {
-namespace wasm {
-
-// Like an ErrorThrower, but turns all pending exceptions into scheduled
-// exceptions when going out of scope. Use this in API methods.
-// Note that pending exceptions are not necessarily created by the ErrorThrower,
-// but e.g. by the wasm start function. There might also be a scheduled
-// exception, created by another API call (e.g. v8::Object::Get). But there
-// should never be both pending and scheduled exceptions.
-class V8_EXPORT_PRIVATE ScheduledErrorThrower : public ErrorThrower {
- public:
-  ScheduledErrorThrower(v8::Isolate* isolate, const char* context)
-      : ScheduledErrorThrower(reinterpret_cast<Isolate*>(isolate), context) {}
-
-  ScheduledErrorThrower(Isolate* isolate, const char* context)
-      : ErrorThrower(isolate, context) {}
-
-  ~ScheduledErrorThrower();
-};
-
-}  // namespace wasm
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_WASM_API_H_
diff --git a/src/v8/src/wasm/wasm-code-specialization.cc b/src/v8/src/wasm/wasm-code-specialization.cc
deleted file mode 100644
index 416d1d6..0000000
--- a/src/v8/src/wasm/wasm-code-specialization.cc
+++ /dev/null
@@ -1,322 +0,0 @@
-// Copyright 2017 the V8 project 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 "src/wasm/wasm-code-specialization.h"
-
-#include "src/assembler-inl.h"
-#include "src/base/optional.h"
-#include "src/objects-inl.h"
-#include "src/source-position-table.h"
-#include "src/wasm/decoder.h"
-#include "src/wasm/wasm-code-manager.h"
-#include "src/wasm/wasm-module.h"
-#include "src/wasm/wasm-objects-inl.h"
-
-namespace v8 {
-namespace internal {
-namespace wasm {
-
-uint32_t ExtractDirectCallIndex(wasm::Decoder& decoder, const byte* pc) {
-  DCHECK_EQ(static_cast<int>(kExprCallFunction), static_cast<int>(*pc));
-  decoder.Reset(pc + 1, pc + 6);
-  uint32_t call_idx = decoder.consume_u32v("call index");
-  DCHECK(decoder.ok());
-  DCHECK_GE(kMaxInt, call_idx);
-  return call_idx;
-}
-
-namespace {
-
-int AdvanceSourcePositionTableIterator(SourcePositionTableIterator& iterator,
-                                       size_t offset_l) {
-  DCHECK_GE(kMaxInt, offset_l);
-  int offset = static_cast<int>(offset_l);
-  DCHECK(!iterator.done());
-  int byte_pos;
-  do {
-    byte_pos = iterator.source_position().ScriptOffset();
-    iterator.Advance();
-  } while (!iterator.done() && iterator.code_offset() <= offset);
-  return byte_pos;
-}
-
-class PatchDirectCallsHelper {
- public:
-  PatchDirectCallsHelper(WasmInstanceObject* instance, const WasmCode* code)
-      : source_pos_it(ByteArray::cast(
-            instance->compiled_module()->source_positions()->get(
-                static_cast<int>(code->index())))),
-        decoder(nullptr, nullptr) {
-    uint32_t func_index = code->index();
-    WasmCompiledModule* comp_mod = instance->compiled_module();
-    func_bytes =
-        comp_mod->shared()->module_bytes()->GetChars() +
-        comp_mod->shared()->module()->functions[func_index].code.offset();
-  }
-
-  PatchDirectCallsHelper(WasmInstanceObject* instance, Code* code)
-      : source_pos_it(code->SourcePositionTable()), decoder(nullptr, nullptr) {
-    FixedArray* deopt_data = code->deoptimization_data();
-    DCHECK_EQ(2, deopt_data->length());
-    WasmSharedModuleData* shared = instance->compiled_module()->shared();
-    int func_index = Smi::ToInt(deopt_data->get(1));
-    func_bytes = shared->module_bytes()->GetChars() +
-                 shared->module()->functions[func_index].code.offset();
-  }
-
-  SourcePositionTableIterator source_pos_it;
-  Decoder decoder;
-  const byte* func_bytes;
-};
-
-bool IsAtWasmDirectCallTarget(RelocIterator& it) {
-  DCHECK(RelocInfo::IsCodeTarget(it.rinfo()->rmode()));
-  Code* code = Code::GetCodeFromTargetAddress(it.rinfo()->target_address());
-  return code->kind() == Code::WASM_FUNCTION ||
-         code->kind() == Code::WASM_TO_JS_FUNCTION ||
-         code->kind() == Code::WASM_TO_WASM_FUNCTION ||
-         code->kind() == Code::WASM_INTERPRETER_ENTRY ||
-         code->builtin_index() == Builtins::kIllegal ||
-         code->builtin_index() == Builtins::kWasmCompileLazy;
-}
-
-}  // namespace
-
-CodeSpecialization::CodeSpecialization(Isolate* isolate, Zone* zone)
-    : isolate_(isolate) {}
-
-CodeSpecialization::~CodeSpecialization() {}
-
-void CodeSpecialization::RelocateWasmContextReferences(Address new_context) {
-  DCHECK_NOT_NULL(new_context);
-  DCHECK_NULL(new_wasm_context_address);
-  new_wasm_context_address = new_context;
-}
-
-void CodeSpecialization::PatchTableSize(uint32_t old_size, uint32_t new_size) {
-  DCHECK(old_function_table_size == 0 && new_function_table_size == 0);
-  old_function_table_size = old_size;
-  new_function_table_size = new_size;
-}
-
-void CodeSpecialization::RelocateDirectCalls(
-    Handle<WasmInstanceObject> instance) {
-  DCHECK(relocate_direct_calls_instance.is_null());
-  DCHECK(!instance.is_null());
-  relocate_direct_calls_instance = instance;
-}
-
-void CodeSpecialization::RelocatePointer(Address old_ptr, Address new_ptr) {
-  pointers_to_relocate.insert(std::make_pair(old_ptr, new_ptr));
-}
-
-bool CodeSpecialization::ApplyToWholeInstance(
-    WasmInstanceObject* instance, ICacheFlushMode icache_flush_mode) {
-  DisallowHeapAllocation no_gc;
-  WasmCompiledModule* compiled_module = instance->compiled_module();
-  NativeModule* native_module = compiled_module->GetNativeModule();
-  FixedArray* code_table = compiled_module->code_table();
-  WasmSharedModuleData* shared = compiled_module->shared();
-  WasmModule* module = shared->module();
-  std::vector<WasmFunction>* wasm_functions = &shared->module()->functions;
-  DCHECK_EQ(compiled_module->export_wrappers()->length(),
-            shared->module()->num_exported_functions);
-
-  bool changed = false;
-  int func_index = module->num_imported_functions;
-
-  // Patch all wasm functions.
-  for (int num_wasm_functions = static_cast<int>(wasm_functions->size());
-       func_index < num_wasm_functions; ++func_index) {
-    WasmCodeWrapper wrapper;
-    if (FLAG_wasm_jit_to_native) {
-      const WasmCode* wasm_function = native_module->GetCode(func_index);
-      if (wasm_function->kind() != WasmCode::kFunction) {
-        continue;
-      }
-      wrapper = WasmCodeWrapper(wasm_function);
-    } else {
-      Code* wasm_function = Code::cast(code_table->get(func_index));
-      if (wasm_function->kind() != Code::WASM_FUNCTION) continue;
-      wrapper = WasmCodeWrapper(handle(wasm_function));
-    }
-    changed |= ApplyToWasmCode(wrapper, icache_flush_mode);
-  }
-
-  // Patch all exported functions (JS_TO_WASM_FUNCTION).
-  int reloc_mode = 0;
-  // We need to patch WASM_CONTEXT_REFERENCE to put the correct address.
-  if (new_wasm_context_address) {
-    reloc_mode |= RelocInfo::ModeMask(RelocInfo::WASM_CONTEXT_REFERENCE);
-  }
-  // Patch CODE_TARGET if we shall relocate direct calls. If we patch direct
-  // calls, the instance registered for that (relocate_direct_calls_instance)
-  // should match the instance we currently patch (instance).
-  if (!relocate_direct_calls_instance.is_null()) {
-    DCHECK_EQ(instance, *relocate_direct_calls_instance);
-    reloc_mode |=
-        RelocInfo::ModeMask(FLAG_wasm_jit_to_native ? RelocInfo::JS_TO_WASM_CALL
-                                                    : RelocInfo::CODE_TARGET);
-  }
-  if (!reloc_mode) return changed;
-  int wrapper_index = 0;
-  for (auto exp : module->export_table) {
-    if (exp.kind != kExternalFunction) continue;
-    Code* export_wrapper =
-        Code::cast(compiled_module->export_wrappers()->get(wrapper_index));
-    DCHECK_EQ(Code::JS_TO_WASM_FUNCTION, export_wrapper->kind());
-    for (RelocIterator it(export_wrapper, reloc_mode); !it.done(); it.next()) {
-      RelocInfo::Mode mode = it.rinfo()->rmode();
-      switch (mode) {
-        case RelocInfo::WASM_CONTEXT_REFERENCE:
-          it.rinfo()->set_wasm_context_reference(export_wrapper->GetIsolate(),
-                                                 new_wasm_context_address,
-                                                 icache_flush_mode);
-          break;
-        case RelocInfo::JS_TO_WASM_CALL: {
-          DCHECK(FLAG_wasm_jit_to_native);
-          const WasmCode* new_code = native_module->GetCode(exp.index);
-          it.rinfo()->set_js_to_wasm_address(
-              nullptr, new_code->instructions().start(), SKIP_ICACHE_FLUSH);
-        } break;
-        case RelocInfo::CODE_TARGET: {
-          DCHECK(!FLAG_wasm_jit_to_native);
-          // Ignore calls to other builtins like ToNumber.
-          if (!IsAtWasmDirectCallTarget(it)) continue;
-          Code* new_code = Code::cast(code_table->get(exp.index));
-          it.rinfo()->set_target_address(
-              new_code->GetIsolate(), new_code->instruction_start(),
-              UPDATE_WRITE_BARRIER, SKIP_ICACHE_FLUSH);
-        } break;
-        default:
-          UNREACHABLE();
-      }
-    }
-    changed = true;
-    ++wrapper_index;
-  }
-  DCHECK_EQ(module->functions.size(), func_index);
-  DCHECK_EQ(compiled_module->export_wrappers()->length(), wrapper_index);
-  return changed;
-}
-
-bool CodeSpecialization::ApplyToWasmCode(WasmCodeWrapper code,
-                                         ICacheFlushMode icache_flush_mode) {
-  DisallowHeapAllocation no_gc;
-  if (code.IsCodeObject()) {
-    DCHECK_EQ(Code::WASM_FUNCTION, code.GetCode()->kind());
-  } else {
-    DCHECK_EQ(wasm::WasmCode::kFunction, code.GetWasmCode()->kind());
-  }
-
-  bool patch_table_size = old_function_table_size || new_function_table_size;
-  bool reloc_direct_calls = !relocate_direct_calls_instance.is_null();
-  bool reloc_pointers = pointers_to_relocate.size() > 0;
-
-  int reloc_mode = 0;
-  auto add_mode = [&reloc_mode](bool cond, RelocInfo::Mode mode) {
-    if (cond) reloc_mode |= RelocInfo::ModeMask(mode);
-  };
-  add_mode(patch_table_size, RelocInfo::WASM_FUNCTION_TABLE_SIZE_REFERENCE);
-  if (code.IsCodeObject()) {
-    add_mode(reloc_direct_calls, RelocInfo::CODE_TARGET);
-  } else {
-    add_mode(reloc_direct_calls, RelocInfo::WASM_CALL);
-  }
-  add_mode(reloc_pointers, RelocInfo::WASM_GLOBAL_HANDLE);
-
-  base::Optional<PatchDirectCallsHelper> patch_direct_calls_helper;
-  bool changed = false;
-
-  NativeModule* native_module =
-      code.IsCodeObject() ? nullptr : code.GetWasmCode()->owner();
-
-  RelocIterator it =
-      code.IsCodeObject()
-          ? RelocIterator(*code.GetCode(), reloc_mode)
-          : RelocIterator(code.GetWasmCode()->instructions(),
-                          code.GetWasmCode()->reloc_info(),
-                          code.GetWasmCode()->constant_pool(), reloc_mode);
-  for (; !it.done(); it.next()) {
-    RelocInfo::Mode mode = it.rinfo()->rmode();
-    switch (mode) {
-      case RelocInfo::CODE_TARGET: {
-        DCHECK(!FLAG_wasm_jit_to_native);
-        DCHECK(reloc_direct_calls);
-        // Skip everything which is not a wasm call (stack checks, traps, ...).
-        if (!IsAtWasmDirectCallTarget(it)) continue;
-        // Iterate simultaneously over the relocation information and the source
-        // position table. For each call in the reloc info, move the source
-        // position iterator forward to that position to find the byte offset of
-        // the respective call. Then extract the call index from the module wire
-        // bytes to find the new compiled function.
-        size_t offset = it.rinfo()->pc() - code.GetCode()->instruction_start();
-        if (!patch_direct_calls_helper) {
-          patch_direct_calls_helper.emplace(*relocate_direct_calls_instance,
-                                            *code.GetCode());
-        }
-        int byte_pos = AdvanceSourcePositionTableIterator(
-            patch_direct_calls_helper->source_pos_it, offset);
-        int called_func_index = ExtractDirectCallIndex(
-            patch_direct_calls_helper->decoder,
-            patch_direct_calls_helper->func_bytes + byte_pos);
-        FixedArray* code_table =
-            relocate_direct_calls_instance->compiled_module()->code_table();
-        Code* new_code = Code::cast(code_table->get(called_func_index));
-        it.rinfo()->set_target_address(new_code->GetIsolate(),
-                                       new_code->instruction_start(),
-                                       UPDATE_WRITE_BARRIER, icache_flush_mode);
-        changed = true;
-      } break;
-      case RelocInfo::WASM_CALL: {
-        DCHECK(FLAG_wasm_jit_to_native);
-        DCHECK(reloc_direct_calls);
-        // Iterate simultaneously over the relocation information and the source
-        // position table. For each call in the reloc info, move the source
-        // position iterator forward to that position to find the byte offset of
-        // the respective call. Then extract the call index from the module wire
-        // bytes to find the new compiled function.
-        size_t offset =
-            it.rinfo()->pc() - code.GetWasmCode()->instructions().start();
-        if (!patch_direct_calls_helper) {
-          patch_direct_calls_helper.emplace(*relocate_direct_calls_instance,
-                                            code.GetWasmCode());
-        }
-        int byte_pos = AdvanceSourcePositionTableIterator(
-            patch_direct_calls_helper->source_pos_it, offset);
-        uint32_t called_func_index = ExtractDirectCallIndex(
-            patch_direct_calls_helper->decoder,
-            patch_direct_calls_helper->func_bytes + byte_pos);
-        const WasmCode* new_code = native_module->GetCode(called_func_index);
-        it.rinfo()->set_wasm_call_address(
-            isolate_, new_code->instructions().start(), icache_flush_mode);
-        changed = true;
-      } break;
-      case RelocInfo::WASM_GLOBAL_HANDLE: {
-        DCHECK(reloc_pointers);
-        Address old_ptr = it.rinfo()->global_handle();
-        if (pointers_to_relocate.count(old_ptr) == 1) {
-          Address new_ptr = pointers_to_relocate[old_ptr];
-          it.rinfo()->set_global_handle(isolate_, new_ptr, icache_flush_mode);
-          changed = true;
-        }
-      } break;
-      case RelocInfo::WASM_FUNCTION_TABLE_SIZE_REFERENCE:
-        DCHECK(patch_table_size);
-        it.rinfo()->update_wasm_function_table_size_reference(
-            isolate_, old_function_table_size, new_function_table_size,
-            icache_flush_mode);
-        changed = true;
-        break;
-      default:
-        UNREACHABLE();
-    }
-  }
-
-  return changed;
-}
-
-}  // namespace wasm
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/wasm/wasm-code-specialization.h b/src/v8/src/wasm/wasm-code-specialization.h
deleted file mode 100644
index 8f68677..0000000
--- a/src/v8/src/wasm/wasm-code-specialization.h
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_WASM_CODE_SPECIALIZATION_H_
-#define V8_WASM_CODE_SPECIALIZATION_H_
-
-#include "src/assembler.h"
-#include "src/identity-map.h"
-#include "src/wasm/decoder.h"
-#include "src/wasm/wasm-objects.h"
-
-namespace v8 {
-namespace internal {
-namespace wasm {
-
-uint32_t ExtractDirectCallIndex(wasm::Decoder& decoder, const byte* pc);
-
-// Helper class to specialize wasm code for a specific instance, or to update
-// code when memory / globals / tables change.
-// This class in unhandlified, and contains a DisallowHeapAllocation field to
-// ensure that no allocations happen while it is alive.
-//
-// Set up all relocations / patching that should be performed by the Relocate* /
-// Patch* methods, then apply all changes in one step using the Apply* methods.
-class CodeSpecialization {
- public:
-  CodeSpecialization(Isolate*, Zone*);
-  ~CodeSpecialization();
-
-  // Update WasmContext references.
-  void RelocateWasmContextReferences(Address new_context);
-  // Update function table size.
-  // TODO(wasm): Prepare this for more than one indirect function table.
-  void PatchTableSize(uint32_t old_size, uint32_t new_size);
-  // Update all direct call sites based on the code table in the given instance.
-  void RelocateDirectCalls(Handle<WasmInstanceObject> instance);
-  // Relocate an arbitrary object (e.g. function table).
-  void RelocatePointer(Address old_obj, Address new_obj);
-
-  // Apply all relocations and patching to all code in the instance (wasm code
-  // and exported functions).
-  bool ApplyToWholeInstance(WasmInstanceObject*,
-                            ICacheFlushMode = FLUSH_ICACHE_IF_NEEDED);
-  // Apply all relocations and patching to one wasm code object.
-  bool ApplyToWasmCode(WasmCodeWrapper,
-                       ICacheFlushMode = FLUSH_ICACHE_IF_NEEDED);
-
- private:
-  Isolate* isolate_;
-  Address new_wasm_context_address = 0;
-
-  uint32_t old_function_table_size = 0;
-  uint32_t new_function_table_size = 0;
-
-  Handle<WasmInstanceObject> relocate_direct_calls_instance;
-
-  std::map<Address, Address> pointers_to_relocate;
-};
-
-}  // namespace wasm
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_WASM_CODE_SPECIALIZATION_H_
diff --git a/src/v8/src/wasm/wasm-code-wrapper.cc b/src/v8/src/wasm/wasm-code-wrapper.cc
deleted file mode 100644
index 9256391..0000000
--- a/src/v8/src/wasm/wasm-code-wrapper.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright 2017 the V8 project 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 "src/wasm/wasm-code-wrapper.h"
-
-#include "src/objects-inl.h"
-#include "src/objects/code.h"
-#include "src/wasm/wasm-code-manager.h"
-#include "src/wasm/wasm-objects.h"
-
-namespace v8 {
-namespace internal {
-
-// When constructing, we check the flag. After that, we just
-// check using the member.
-WasmCodeWrapper::WasmCodeWrapper(Handle<Code> code) {
-  DCHECK(!FLAG_wasm_jit_to_native);
-  code_ptr_.code_handle_ = code.location();
-}
-
-WasmCodeWrapper::WasmCodeWrapper(const wasm::WasmCode* code) {
-  DCHECK(FLAG_wasm_jit_to_native);
-  code_ptr_.wasm_code_ = code;
-}
-
-Handle<Code> WasmCodeWrapper::GetCode() const {
-  DCHECK(IsCodeObject());
-  return Handle<Code>(code_ptr_.code_handle_);
-}
-
-const wasm::WasmCode* WasmCodeWrapper::GetWasmCode() const {
-  DCHECK(!IsCodeObject());
-  return code_ptr_.wasm_code_;
-}
-
-bool WasmCodeWrapper::IsCodeObject() const { return !FLAG_wasm_jit_to_native; }
-
-#ifdef ENABLE_DISASSEMBLER
-void WasmCodeWrapper::Disassemble(const char* name, Isolate* isolate,
-                                  std::ostream& os) const {
-  if (IsCodeObject()) {
-    GetCode()->Disassemble(name, os);
-  } else {
-    GetWasmCode()->Disassemble(name, isolate, os);
-  }
-}
-#endif
-
-bool WasmCodeWrapper::is_liftoff() const {
-  return IsCodeObject() ? !GetCode()->is_turbofanned()
-                        : GetWasmCode()->is_liftoff();
-}
-
-Vector<uint8_t> WasmCodeWrapper::instructions() const {
-  if (!IsCodeObject()) return GetWasmCode()->instructions();
-  Handle<Code> code = GetCode();
-  return {code->instruction_start(),
-          static_cast<size_t>(code->instruction_size())};
-}
-
-Handle<WasmInstanceObject> WasmCodeWrapper::wasm_instance() const {
-  return IsCodeObject()
-             ? handle(WasmInstanceObject::GetOwningInstanceGC(*GetCode()))
-             : handle(WasmInstanceObject::GetOwningInstance(GetWasmCode()));
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/wasm/wasm-code-wrapper.h b/src/v8/src/wasm/wasm-code-wrapper.h
deleted file mode 100644
index 7d97815..0000000
--- a/src/v8/src/wasm/wasm-code-wrapper.h
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-#ifndef V8_WASM_CODE_WRAPPER_H_
-#define V8_WASM_CODE_WRAPPER_H_
-
-#include "src/handles.h"
-
-namespace v8 {
-namespace internal {
-namespace wasm {
-class WasmCode;
-}  // namespace wasm
-
-class Code;
-class WasmInstanceObject;
-
-// TODO(mtrofin): remove once we remove FLAG_wasm_jit_to_native
-class WasmCodeWrapper {
- public:
-  WasmCodeWrapper() {}
-
-  explicit WasmCodeWrapper(Handle<Code> code);
-  explicit WasmCodeWrapper(const wasm::WasmCode* code);
-  Handle<Code> GetCode() const;
-  const wasm::WasmCode* GetWasmCode() const;
-  bool is_null() const { return code_ptr_.wasm_code_ == nullptr; }
-  bool IsCodeObject() const;
-  bool is_liftoff() const;
-
-  Vector<uint8_t> instructions() const;
-
-  Handle<WasmInstanceObject> wasm_instance() const;
-
-#ifdef ENABLE_DISASSEMBLER
-  void Disassemble(const char* name, Isolate* isolate, std::ostream& os) const;
-#endif
-
- private:
-  union {
-    const wasm::WasmCode* wasm_code_;
-    Code** code_handle_;
-  } code_ptr_ = {};
-};
-
-}  // namespace internal
-}  // namespace v8
-#endif  // V8_WASM_CODE_WRAPPER_H_
diff --git a/src/v8/src/x64/assembler-x64-inl.h b/src/v8/src/x64/assembler-x64-inl.h
deleted file mode 100644
index a75a8dd..0000000
--- a/src/v8/src/x64/assembler-x64-inl.h
+++ /dev/null
@@ -1,483 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_X64_ASSEMBLER_X64_INL_H_
-#define V8_X64_ASSEMBLER_X64_INL_H_
-
-#include "src/x64/assembler-x64.h"
-
-#include "src/base/cpu.h"
-#include "src/debug/debug.h"
-#include "src/objects-inl.h"
-#include "src/v8memory.h"
-
-namespace v8 {
-namespace internal {
-
-bool CpuFeatures::SupportsCrankshaft() { return true; }
-
-bool CpuFeatures::SupportsWasmSimd128() { return IsSupported(SSE4_1); }
-
-// -----------------------------------------------------------------------------
-// Implementation of Assembler
-
-
-static const byte kCallOpcode = 0xE8;
-
-
-void Assembler::emitl(uint32_t x) {
-  Memory::uint32_at(pc_) = x;
-  pc_ += sizeof(uint32_t);
-}
-
-
-void Assembler::emitp(void* x, RelocInfo::Mode rmode) {
-  uintptr_t value = reinterpret_cast<uintptr_t>(x);
-  Memory::uintptr_at(pc_) = value;
-  if (!RelocInfo::IsNone(rmode)) {
-    RecordRelocInfo(rmode, value);
-  }
-  pc_ += sizeof(uintptr_t);
-}
-
-
-void Assembler::emitq(uint64_t x) {
-  Memory::uint64_at(pc_) = x;
-  pc_ += sizeof(uint64_t);
-}
-
-
-void Assembler::emitw(uint16_t x) {
-  Memory::uint16_at(pc_) = x;
-  pc_ += sizeof(uint16_t);
-}
-
-void Assembler::emit_code_target(Handle<Code> target, RelocInfo::Mode rmode) {
-  DCHECK(RelocInfo::IsCodeTarget(rmode));
-  RecordRelocInfo(rmode);
-  int current = static_cast<int>(code_targets_.size());
-  if (current > 0 && !target.is_null() &&
-      code_targets_.back().address() == target.address()) {
-    // Optimization if we keep jumping to the same code target.
-    emitl(current - 1);
-  } else {
-    code_targets_.push_back(target);
-    emitl(current);
-  }
-}
-
-
-void Assembler::emit_runtime_entry(Address entry, RelocInfo::Mode rmode) {
-  DCHECK(RelocInfo::IsRuntimeEntry(rmode));
-  RecordRelocInfo(rmode);
-  emitl(static_cast<uint32_t>(entry - isolate_data().code_range_start_));
-}
-
-void Assembler::emit(Immediate x) {
-  if (!RelocInfo::IsNone(x.rmode_)) {
-    RecordRelocInfo(x.rmode_);
-  }
-  emitl(x.value_);
-}
-
-void Assembler::emit_rex_64(Register reg, Register rm_reg) {
-  emit(0x48 | reg.high_bit() << 2 | rm_reg.high_bit());
-}
-
-
-void Assembler::emit_rex_64(XMMRegister reg, Register rm_reg) {
-  emit(0x48 | (reg.code() & 0x8) >> 1 | rm_reg.code() >> 3);
-}
-
-
-void Assembler::emit_rex_64(Register reg, XMMRegister rm_reg) {
-  emit(0x48 | (reg.code() & 0x8) >> 1 | rm_reg.code() >> 3);
-}
-
-
-void Assembler::emit_rex_64(Register reg, const Operand& op) {
-  emit(0x48 | reg.high_bit() << 2 | op.rex_);
-}
-
-
-void Assembler::emit_rex_64(XMMRegister reg, const Operand& op) {
-  emit(0x48 | (reg.code() & 0x8) >> 1 | op.rex_);
-}
-
-
-void Assembler::emit_rex_64(Register rm_reg) {
-  DCHECK_EQ(rm_reg.code() & 0xf, rm_reg.code());
-  emit(0x48 | rm_reg.high_bit());
-}
-
-
-void Assembler::emit_rex_64(const Operand& op) {
-  emit(0x48 | op.rex_);
-}
-
-
-void Assembler::emit_rex_32(Register reg, Register rm_reg) {
-  emit(0x40 | reg.high_bit() << 2 | rm_reg.high_bit());
-}
-
-
-void Assembler::emit_rex_32(Register reg, const Operand& op) {
-  emit(0x40 | reg.high_bit() << 2  | op.rex_);
-}
-
-
-void Assembler::emit_rex_32(Register rm_reg) {
-  emit(0x40 | rm_reg.high_bit());
-}
-
-
-void Assembler::emit_rex_32(const Operand& op) {
-  emit(0x40 | op.rex_);
-}
-
-
-void Assembler::emit_optional_rex_32(Register reg, Register rm_reg) {
-  byte rex_bits = reg.high_bit() << 2 | rm_reg.high_bit();
-  if (rex_bits != 0) emit(0x40 | rex_bits);
-}
-
-
-void Assembler::emit_optional_rex_32(Register reg, const Operand& op) {
-  byte rex_bits =  reg.high_bit() << 2 | op.rex_;
-  if (rex_bits != 0) emit(0x40 | rex_bits);
-}
-
-
-void Assembler::emit_optional_rex_32(XMMRegister reg, const Operand& op) {
-  byte rex_bits =  (reg.code() & 0x8) >> 1 | op.rex_;
-  if (rex_bits != 0) emit(0x40 | rex_bits);
-}
-
-
-void Assembler::emit_optional_rex_32(XMMRegister reg, XMMRegister base) {
-  byte rex_bits =  (reg.code() & 0x8) >> 1 | (base.code() & 0x8) >> 3;
-  if (rex_bits != 0) emit(0x40 | rex_bits);
-}
-
-
-void Assembler::emit_optional_rex_32(XMMRegister reg, Register base) {
-  byte rex_bits =  (reg.code() & 0x8) >> 1 | (base.code() & 0x8) >> 3;
-  if (rex_bits != 0) emit(0x40 | rex_bits);
-}
-
-
-void Assembler::emit_optional_rex_32(Register reg, XMMRegister base) {
-  byte rex_bits =  (reg.code() & 0x8) >> 1 | (base.code() & 0x8) >> 3;
-  if (rex_bits != 0) emit(0x40 | rex_bits);
-}
-
-
-void Assembler::emit_optional_rex_32(Register rm_reg) {
-  if (rm_reg.high_bit()) emit(0x41);
-}
-
-void Assembler::emit_optional_rex_32(XMMRegister rm_reg) {
-  if (rm_reg.high_bit()) emit(0x41);
-}
-
-void Assembler::emit_optional_rex_32(const Operand& op) {
-  if (op.rex_ != 0) emit(0x40 | op.rex_);
-}
-
-
-// byte 1 of 3-byte VEX
-void Assembler::emit_vex3_byte1(XMMRegister reg, XMMRegister rm,
-                                LeadingOpcode m) {
-  byte rxb = ~((reg.high_bit() << 2) | rm.high_bit()) << 5;
-  emit(rxb | m);
-}
-
-
-// byte 1 of 3-byte VEX
-void Assembler::emit_vex3_byte1(XMMRegister reg, const Operand& rm,
-                                LeadingOpcode m) {
-  byte rxb = ~((reg.high_bit() << 2) | rm.rex_) << 5;
-  emit(rxb | m);
-}
-
-
-// byte 1 of 2-byte VEX
-void Assembler::emit_vex2_byte1(XMMRegister reg, XMMRegister v, VectorLength l,
-                                SIMDPrefix pp) {
-  byte rv = ~((reg.high_bit() << 4) | v.code()) << 3;
-  emit(rv | l | pp);
-}
-
-
-// byte 2 of 3-byte VEX
-void Assembler::emit_vex3_byte2(VexW w, XMMRegister v, VectorLength l,
-                                SIMDPrefix pp) {
-  emit(w | ((~v.code() & 0xf) << 3) | l | pp);
-}
-
-
-void Assembler::emit_vex_prefix(XMMRegister reg, XMMRegister vreg,
-                                XMMRegister rm, VectorLength l, SIMDPrefix pp,
-                                LeadingOpcode mm, VexW w) {
-  if (rm.high_bit() || mm != k0F || w != kW0) {
-    emit_vex3_byte0();
-    emit_vex3_byte1(reg, rm, mm);
-    emit_vex3_byte2(w, vreg, l, pp);
-  } else {
-    emit_vex2_byte0();
-    emit_vex2_byte1(reg, vreg, l, pp);
-  }
-}
-
-
-void Assembler::emit_vex_prefix(Register reg, Register vreg, Register rm,
-                                VectorLength l, SIMDPrefix pp, LeadingOpcode mm,
-                                VexW w) {
-  XMMRegister ireg = XMMRegister::from_code(reg.code());
-  XMMRegister ivreg = XMMRegister::from_code(vreg.code());
-  XMMRegister irm = XMMRegister::from_code(rm.code());
-  emit_vex_prefix(ireg, ivreg, irm, l, pp, mm, w);
-}
-
-
-void Assembler::emit_vex_prefix(XMMRegister reg, XMMRegister vreg,
-                                const Operand& rm, VectorLength l,
-                                SIMDPrefix pp, LeadingOpcode mm, VexW w) {
-  if (rm.rex_ || mm != k0F || w != kW0) {
-    emit_vex3_byte0();
-    emit_vex3_byte1(reg, rm, mm);
-    emit_vex3_byte2(w, vreg, l, pp);
-  } else {
-    emit_vex2_byte0();
-    emit_vex2_byte1(reg, vreg, l, pp);
-  }
-}
-
-
-void Assembler::emit_vex_prefix(Register reg, Register vreg, const Operand& rm,
-                                VectorLength l, SIMDPrefix pp, LeadingOpcode mm,
-                                VexW w) {
-  XMMRegister ireg = XMMRegister::from_code(reg.code());
-  XMMRegister ivreg = XMMRegister::from_code(vreg.code());
-  emit_vex_prefix(ireg, ivreg, rm, l, pp, mm, w);
-}
-
-
-Address Assembler::target_address_at(Address pc, Address constant_pool) {
-  return Memory::int32_at(pc) + pc + 4;
-}
-
-
-void Assembler::set_target_address_at(Isolate* isolate, Address pc,
-                                      Address constant_pool, Address target,
-                                      ICacheFlushMode icache_flush_mode) {
-  DCHECK_IMPLIES(isolate == nullptr, icache_flush_mode == SKIP_ICACHE_FLUSH);
-  Memory::int32_at(pc) = static_cast<int32_t>(target - pc - 4);
-  if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
-    Assembler::FlushICache(isolate, pc, sizeof(int32_t));
-  }
-}
-
-void Assembler::deserialization_set_target_internal_reference_at(
-    Isolate* isolate, Address pc, Address target, RelocInfo::Mode mode) {
-  Memory::Address_at(pc) = target;
-}
-
-
-Address Assembler::target_address_from_return_address(Address pc) {
-  return pc - kCallTargetAddressOffset;
-}
-
-void Assembler::deserialization_set_special_target_at(
-    Isolate* isolate, Address instruction_payload, Code* code, Address target) {
-  set_target_address_at(isolate, instruction_payload,
-                        code ? code->constant_pool() : nullptr, target);
-}
-
-Handle<Code> Assembler::code_target_object_handle_at(Address pc) {
-  return code_targets_[Memory::int32_at(pc)];
-}
-
-Address Assembler::runtime_entry_at(Address pc) {
-  return Memory::int32_at(pc) + isolate_data().code_range_start_;
-}
-
-// -----------------------------------------------------------------------------
-// Implementation of RelocInfo
-
-// The modes possibly affected by apply must be in kApplyMask.
-void RelocInfo::apply(intptr_t delta) {
-  if (IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)) {
-    Memory::int32_at(pc_) -= static_cast<int32_t>(delta);
-  } else if (IsInternalReference(rmode_)) {
-    // absolute code pointer inside code object moves with the code object.
-    Memory::Address_at(pc_) += delta;
-  }
-}
-
-
-Address RelocInfo::target_address() {
-  DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) || IsWasmCall(rmode_));
-  return Assembler::target_address_at(pc_, constant_pool_);
-}
-
-Address RelocInfo::target_address_address() {
-  DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) || IsWasmCall(rmode_) ||
-         rmode_ == EMBEDDED_OBJECT || rmode_ == EXTERNAL_REFERENCE);
-  return reinterpret_cast<Address>(pc_);
-}
-
-
-Address RelocInfo::constant_pool_entry_address() {
-  UNREACHABLE();
-}
-
-
-int RelocInfo::target_address_size() {
-  if (IsCodedSpecially()) {
-    return Assembler::kSpecialTargetSize;
-  } else {
-    return kPointerSize;
-  }
-}
-
-HeapObject* RelocInfo::target_object() {
-  DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
-  return HeapObject::cast(Memory::Object_at(pc_));
-}
-
-Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
-  DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
-  if (rmode_ == EMBEDDED_OBJECT) {
-    return Handle<HeapObject>::cast(Memory::Object_Handle_at(pc_));
-  } else {
-    return origin->code_target_object_handle_at(pc_);
-  }
-}
-
-
-Address RelocInfo::target_external_reference() {
-  DCHECK(rmode_ == RelocInfo::EXTERNAL_REFERENCE);
-  return Memory::Address_at(pc_);
-}
-
-
-Address RelocInfo::target_internal_reference() {
-  DCHECK(rmode_ == INTERNAL_REFERENCE);
-  return Memory::Address_at(pc_);
-}
-
-
-Address RelocInfo::target_internal_reference_address() {
-  DCHECK(rmode_ == INTERNAL_REFERENCE);
-  return reinterpret_cast<Address>(pc_);
-}
-
-void RelocInfo::set_target_object(HeapObject* target,
-                                  WriteBarrierMode write_barrier_mode,
-                                  ICacheFlushMode icache_flush_mode) {
-  DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
-  Memory::Object_at(pc_) = target;
-  if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
-    Assembler::FlushICache(target->GetIsolate(), pc_, sizeof(Address));
-  }
-  if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != nullptr) {
-    host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(host(), this,
-                                                                  target);
-    host()->GetHeap()->RecordWriteIntoCode(host(), this, target);
-  }
-}
-
-
-Address RelocInfo::target_runtime_entry(Assembler* origin) {
-  DCHECK(IsRuntimeEntry(rmode_));
-  return origin->runtime_entry_at(pc_);
-}
-
-void RelocInfo::set_target_runtime_entry(Isolate* isolate, Address target,
-                                         WriteBarrierMode write_barrier_mode,
-                                         ICacheFlushMode icache_flush_mode) {
-  DCHECK(IsRuntimeEntry(rmode_));
-  if (target_address() != target) {
-    set_target_address(isolate, target, write_barrier_mode, icache_flush_mode);
-  }
-}
-
-void RelocInfo::WipeOut(Isolate* isolate) {
-  if (IsEmbeddedObject(rmode_) || IsExternalReference(rmode_) ||
-      IsInternalReference(rmode_)) {
-    Memory::Address_at(pc_) = nullptr;
-  } else if (IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)) {
-    // Effectively write zero into the relocation.
-    Assembler::set_target_address_at(isolate, pc_, constant_pool_,
-                                     pc_ + sizeof(int32_t));
-  } else {
-    UNREACHABLE();
-  }
-}
-
-template <typename ObjectVisitor>
-void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) {
-  RelocInfo::Mode mode = rmode();
-  if (mode == RelocInfo::EMBEDDED_OBJECT) {
-    visitor->VisitEmbeddedPointer(host(), this);
-    Assembler::FlushICache(isolate, pc_, sizeof(Address));
-  } else if (RelocInfo::IsCodeTarget(mode)) {
-    visitor->VisitCodeTarget(host(), this);
-  } else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
-    visitor->VisitExternalReference(host(), this);
-  } else if (mode == RelocInfo::INTERNAL_REFERENCE) {
-    visitor->VisitInternalReference(host(), this);
-  } else if (RelocInfo::IsRuntimeEntry(mode)) {
-    visitor->VisitRuntimeEntry(host(), this);
-  }
-}
-
-// -----------------------------------------------------------------------------
-// Implementation of Operand
-
-void Operand::set_modrm(int mod, Register rm_reg) {
-  DCHECK(is_uint2(mod));
-  buf_[0] = mod << 6 | rm_reg.low_bits();
-  // Set REX.B to the high bit of rm.code().
-  rex_ |= rm_reg.high_bit();
-}
-
-
-void Operand::set_sib(ScaleFactor scale, Register index, Register base) {
-  DCHECK_EQ(len_, 1);
-  DCHECK(is_uint2(scale));
-  // Use SIB with no index register only for base rsp or r12. Otherwise we
-  // would skip the SIB byte entirely.
-  DCHECK(index != rsp || base == rsp || base == r12);
-  buf_[1] = (scale << 6) | (index.low_bits() << 3) | base.low_bits();
-  rex_ |= index.high_bit() << 1 | base.high_bit();
-  len_ = 2;
-}
-
-void Operand::set_disp8(int disp) {
-  DCHECK(is_int8(disp));
-  DCHECK(len_ == 1 || len_ == 2);
-  int8_t* p = reinterpret_cast<int8_t*>(&buf_[len_]);
-  *p = disp;
-  len_ += sizeof(int8_t);
-}
-
-void Operand::set_disp32(int disp) {
-  DCHECK(len_ == 1 || len_ == 2);
-  int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]);
-  *p = disp;
-  len_ += sizeof(int32_t);
-}
-
-void Operand::set_disp64(int64_t disp) {
-  DCHECK_EQ(1, len_);
-  int64_t* p = reinterpret_cast<int64_t*>(&buf_[len_]);
-  *p = disp;
-  len_ += sizeof(disp);
-}
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_X64_ASSEMBLER_X64_INL_H_
diff --git a/src/v8/src/x64/assembler-x64.cc b/src/v8/src/x64/assembler-x64.cc
deleted file mode 100644
index 1b768de..0000000
--- a/src/v8/src/x64/assembler-x64.cc
+++ /dev/null
@@ -1,4939 +0,0 @@
-// Copyright 2012 the V8 project 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 "src/x64/assembler-x64.h"
-
-#if defined(STARBOARD)
-#include "starboard/client_porting/poem/stdlib_poem.h"
-#include "starboard/common/log.h"
-#define printf(format, ...) SbLogFormatF(format, __VA_ARGS__)
-#endif
-
-#include <cstring>
-
-#if V8_TARGET_ARCH_X64
-
-#if V8_LIBC_MSVCRT
-#include <intrin.h>  // _xgetbv()
-#endif
-#if V8_OS_MACOSX
-#include <sys/sysctl.h>
-#endif
-
-#include "src/assembler-inl.h"
-#include "src/base/bits.h"
-#include "src/base/cpu.h"
-#include "src/code-stubs.h"
-#include "src/macro-assembler.h"
-#include "src/v8.h"
-
-namespace v8 {
-namespace internal {
-
-// -----------------------------------------------------------------------------
-// Implementation of CpuFeatures
-
-namespace {
-
-V8_INLINE uint64_t xgetbv(unsigned int xcr) {
-#if V8_LIBC_MSVCRT
-  return _xgetbv(xcr);
-#else
-  unsigned eax, edx;
-  // Check xgetbv; this uses a .byte sequence instead of the instruction
-  // directly because older assemblers do not include support for xgetbv and
-  // there is no easy way to conditionally compile based on the assembler
-  // used.
-  __asm__ volatile(".byte 0x0F, 0x01, 0xD0" : "=a"(eax), "=d"(edx) : "c"(xcr));
-  return static_cast<uint64_t>(eax) | (static_cast<uint64_t>(edx) << 32);
-#endif
-}
-
-bool OSHasAVXSupport() {
-#if V8_OS_MACOSX
-  // Mac OS X up to 10.9 has a bug where AVX transitions were indeed being
-  // caused by ISRs, so we detect that here and disable AVX in that case.
-  char buffer[128];
-  size_t buffer_size = arraysize(buffer);
-  int ctl_name[] = {CTL_KERN, KERN_OSRELEASE};
-  if (sysctl(ctl_name, 2, buffer, &buffer_size, nullptr, 0) != 0) {
-    V8_Fatal(__FILE__, __LINE__, "V8 failed to get kernel version");
-  }
-  // The buffer now contains a string of the form XX.YY.ZZ, where
-  // XX is the major kernel version component.
-  char* period_pos = strchr(buffer, '.');
-  DCHECK_NOT_NULL(period_pos);
-  *period_pos = '\0';
-  long kernel_version_major = strtol(buffer, nullptr, 10);  // NOLINT
-  if (kernel_version_major <= 13) return false;
-#endif  // V8_OS_MACOSX
-  // Check whether OS claims to support AVX.
-  uint64_t feature_mask = xgetbv(0);  // XCR_XFEATURE_ENABLED_MASK
-  return (feature_mask & 0x6) == 0x6;
-}
-
-}  // namespace
-
-
-void CpuFeatures::ProbeImpl(bool cross_compile) {
-  base::CPU cpu;
-  CHECK(cpu.has_sse2());  // SSE2 support is mandatory.
-  CHECK(cpu.has_cmov());  // CMOV support is mandatory.
-
-  // Only use statically determined features for cross compile (snapshot).
-  if (cross_compile) return;
-
-  if (cpu.has_sse41() && FLAG_enable_sse4_1) supported_ |= 1u << SSE4_1;
-  if (cpu.has_ssse3() && FLAG_enable_ssse3) supported_ |= 1u << SSSE3;
-  if (cpu.has_sse3() && FLAG_enable_sse3) supported_ |= 1u << SSE3;
-  // SAHF is not generally available in long mode.
-  if (cpu.has_sahf() && FLAG_enable_sahf) supported_ |= 1u << SAHF;
-  if (cpu.has_avx() && FLAG_enable_avx && cpu.has_osxsave() &&
-      OSHasAVXSupport()) {
-    supported_ |= 1u << AVX;
-  }
-  if (cpu.has_fma3() && FLAG_enable_fma3 && cpu.has_osxsave() &&
-      OSHasAVXSupport()) {
-    supported_ |= 1u << FMA3;
-  }
-  if (cpu.has_bmi1() && FLAG_enable_bmi1) supported_ |= 1u << BMI1;
-  if (cpu.has_bmi2() && FLAG_enable_bmi2) supported_ |= 1u << BMI2;
-  if (cpu.has_lzcnt() && FLAG_enable_lzcnt) supported_ |= 1u << LZCNT;
-  if (cpu.has_popcnt() && FLAG_enable_popcnt) supported_ |= 1u << POPCNT;
-  if (strcmp(FLAG_mcpu, "auto") == 0) {
-    if (cpu.is_atom()) supported_ |= 1u << ATOM;
-  } else if (strcmp(FLAG_mcpu, "atom") == 0) {
-    supported_ |= 1u << ATOM;
-  }
-}
-
-
-void CpuFeatures::PrintTarget() { }
-void CpuFeatures::PrintFeatures() {
-  printf(
-      "SSE3=%d SSSE3=%d SSE4_1=%d SAHF=%d AVX=%d FMA3=%d BMI1=%d BMI2=%d "
-      "LZCNT=%d "
-      "POPCNT=%d ATOM=%d\n",
-      CpuFeatures::IsSupported(SSE3), CpuFeatures::IsSupported(SSSE3),
-      CpuFeatures::IsSupported(SSE4_1), CpuFeatures::IsSupported(SAHF),
-      CpuFeatures::IsSupported(AVX), CpuFeatures::IsSupported(FMA3),
-      CpuFeatures::IsSupported(BMI1), CpuFeatures::IsSupported(BMI2),
-      CpuFeatures::IsSupported(LZCNT), CpuFeatures::IsSupported(POPCNT),
-      CpuFeatures::IsSupported(ATOM));
-}
-
-// -----------------------------------------------------------------------------
-// Implementation of RelocInfo
-
-Address RelocInfo::embedded_address() const { return Memory::Address_at(pc_); }
-
-uint32_t RelocInfo::embedded_size() const { return Memory::uint32_at(pc_); }
-
-void RelocInfo::set_embedded_address(Isolate* isolate, Address address,
-                                     ICacheFlushMode icache_flush_mode) {
-  Memory::Address_at(pc_) = address;
-  if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
-    Assembler::FlushICache(isolate, pc_, sizeof(Address));
-  }
-}
-
-void RelocInfo::set_embedded_size(Isolate* isolate, uint32_t size,
-                                  ICacheFlushMode icache_flush_mode) {
-  Memory::uint32_at(pc_) = size;
-  if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
-    Assembler::FlushICache(isolate, pc_, sizeof(uint32_t));
-  }
-}
-
-void RelocInfo::set_js_to_wasm_address(Isolate* isolate, Address address,
-                                       ICacheFlushMode icache_flush_mode) {
-  DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
-  set_embedded_address(isolate, address, icache_flush_mode);
-}
-
-Address RelocInfo::js_to_wasm_address() const {
-  DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
-  return embedded_address();
-}
-
-// -----------------------------------------------------------------------------
-// Implementation of Operand
-
-Operand::Operand(Register base, int32_t disp) : rex_(0) {
-  len_ = 1;
-  if (base == rsp || base == r12) {
-    // SIB byte is needed to encode (rsp + offset) or (r12 + offset).
-    set_sib(times_1, rsp, base);
-  }
-
-  if (disp == 0 && base != rbp && base != r13) {
-    set_modrm(0, base);
-  } else if (is_int8(disp)) {
-    set_modrm(1, base);
-    set_disp8(disp);
-  } else {
-    set_modrm(2, base);
-    set_disp32(disp);
-  }
-}
-
-
-Operand::Operand(Register base,
-                 Register index,
-                 ScaleFactor scale,
-                 int32_t disp) : rex_(0) {
-  DCHECK(index != rsp);
-  len_ = 1;
-  set_sib(scale, index, base);
-  if (disp == 0 && base != rbp && base != r13) {
-    // This call to set_modrm doesn't overwrite the REX.B (or REX.X) bits
-    // possibly set by set_sib.
-    set_modrm(0, rsp);
-  } else if (is_int8(disp)) {
-    set_modrm(1, rsp);
-    set_disp8(disp);
-  } else {
-    set_modrm(2, rsp);
-    set_disp32(disp);
-  }
-}
-
-
-Operand::Operand(Register index,
-                 ScaleFactor scale,
-                 int32_t disp) : rex_(0) {
-  DCHECK(index != rsp);
-  len_ = 1;
-  set_modrm(0, rsp);
-  set_sib(scale, index, rbp);
-  set_disp32(disp);
-}
-
-
-Operand::Operand(Label* label) : rex_(0), len_(1) {
-  DCHECK_NOT_NULL(label);
-  set_modrm(0, rbp);
-  set_disp64(reinterpret_cast<intptr_t>(label));
-}
-
-
-Operand::Operand(const Operand& operand, int32_t offset) {
-  DCHECK_GE(operand.len_, 1);
-  // Operand encodes REX ModR/M [SIB] [Disp].
-  byte modrm = operand.buf_[0];
-  DCHECK_LT(modrm, 0xC0);  // Disallow mode 3 (register target).
-  bool has_sib = ((modrm & 0x07) == 0x04);
-  byte mode = modrm & 0xC0;
-  int disp_offset = has_sib ? 2 : 1;
-  int base_reg = (has_sib ? operand.buf_[1] : modrm) & 0x07;
-  // Mode 0 with rbp/r13 as ModR/M or SIB base register always has a 32-bit
-  // displacement.
-  bool is_baseless = (mode == 0) && (base_reg == 0x05);  // No base or RIP base.
-  int32_t disp_value = 0;
-  if (mode == 0x80 || is_baseless) {
-    // Mode 2 or mode 0 with rbp/r13 as base: Word displacement.
-    disp_value = *bit_cast<const int32_t*>(&operand.buf_[disp_offset]);
-  } else if (mode == 0x40) {
-    // Mode 1: Byte displacement.
-    disp_value = static_cast<signed char>(operand.buf_[disp_offset]);
-  }
-
-  // Write new operand with same registers, but with modified displacement.
-  DCHECK(offset >= 0 ? disp_value + offset > disp_value
-                     : disp_value + offset < disp_value);  // No overflow.
-  disp_value += offset;
-  rex_ = operand.rex_;
-  if (!is_int8(disp_value) || is_baseless) {
-    // Need 32 bits of displacement, mode 2 or mode 1 with register rbp/r13.
-    buf_[0] = (modrm & 0x3F) | (is_baseless ? 0x00 : 0x80);
-    len_ = disp_offset + 4;
-    Memory::int32_at(&buf_[disp_offset]) = disp_value;
-  } else if (disp_value != 0 || (base_reg == 0x05)) {
-    // Need 8 bits of displacement.
-    buf_[0] = (modrm & 0x3F) | 0x40;  // Mode 1.
-    len_ = disp_offset + 1;
-    buf_[disp_offset] = static_cast<byte>(disp_value);
-  } else {
-    // Need no displacement.
-    buf_[0] = (modrm & 0x3F);  // Mode 0.
-    len_ = disp_offset;
-  }
-  if (has_sib) {
-    buf_[1] = operand.buf_[1];
-  }
-}
-
-
-bool Operand::AddressUsesRegister(Register reg) const {
-  int code = reg.code();
-  DCHECK_NE(buf_[0] & 0xC0, 0xC0);  // Always a memory operand.
-  // Start with only low three bits of base register. Initial decoding doesn't
-  // distinguish on the REX.B bit.
-  int base_code = buf_[0] & 0x07;
-  if (base_code == rsp.code()) {
-    // SIB byte present in buf_[1].
-    // Check the index register from the SIB byte + REX.X prefix.
-    int index_code = ((buf_[1] >> 3) & 0x07) | ((rex_ & 0x02) << 2);
-    // Index code (including REX.X) of 0x04 (rsp) means no index register.
-    if (index_code != rsp.code() && index_code == code) return true;
-    // Add REX.B to get the full base register code.
-    base_code = (buf_[1] & 0x07) | ((rex_ & 0x01) << 3);
-    // A base register of 0x05 (rbp) with mod = 0 means no base register.
-    if (base_code == rbp.code() && ((buf_[0] & 0xC0) == 0)) return false;
-    return code == base_code;
-  } else {
-    // A base register with low bits of 0x05 (rbp or r13) and mod = 0 means
-    // no base register.
-    if (base_code == rbp.code() && ((buf_[0] & 0xC0) == 0)) return false;
-    base_code |= ((rex_ & 0x01) << 3);
-    return code == base_code;
-  }
-}
-
-void Assembler::AllocateAndInstallRequestedHeapObjects(Isolate* isolate) {
-  for (auto& request : heap_object_requests_) {
-    Address pc = buffer_ + request.offset();
-    switch (request.kind()) {
-      case HeapObjectRequest::kHeapNumber: {
-        Handle<HeapNumber> object = isolate->factory()->NewHeapNumber(
-            request.heap_number(), IMMUTABLE, TENURED);
-        Memory::Object_Handle_at(pc) = object;
-        break;
-      }
-      case HeapObjectRequest::kCodeStub: {
-        request.code_stub()->set_isolate(isolate);
-        code_targets_[Memory::int32_at(pc)] = request.code_stub()->GetCode();
-        break;
-      }
-    }
-  }
-}
-
-// -----------------------------------------------------------------------------
-// Implementation of Assembler.
-
-Assembler::Assembler(IsolateData isolate_data, void* buffer, int buffer_size)
-    : AssemblerBase(isolate_data, buffer, buffer_size) {
-// Clear the buffer in debug mode unless it was provided by the
-// caller in which case we can't be sure it's okay to overwrite
-// existing code in it.
-#ifdef DEBUG
-  if (own_buffer_) {
-    memset(buffer_, 0xCC, buffer_size_);  // int3
-  }
-#endif
-
-  code_targets_.reserve(100);
-  reloc_info_writer.Reposition(buffer_ + buffer_size_, pc_);
-}
-
-void Assembler::GetCode(Isolate* isolate, CodeDesc* desc) {
-  // At this point overflow() may be true, but the gap ensures
-  // that we are still not overlapping instructions and relocation info.
-  DCHECK(pc_ <= reloc_info_writer.pos());  // No overlap.
-
-  AllocateAndInstallRequestedHeapObjects(isolate);
-
-  // Set up code descriptor.
-  desc->buffer = buffer_;
-  desc->buffer_size = buffer_size_;
-  desc->instr_size = pc_offset();
-  DCHECK_GT(desc->instr_size, 0);  // Zero-size code objects upset the system.
-  desc->reloc_size =
-      static_cast<int>((buffer_ + buffer_size_) - reloc_info_writer.pos());
-  desc->origin = this;
-  desc->constant_pool_size = 0;
-  desc->unwinding_info_size = 0;
-  desc->unwinding_info = nullptr;
-
-  // Collection stage
-  auto jump_opt = jump_optimization_info();
-  if (jump_opt && jump_opt->is_collecting()) {
-    auto& bitmap = jump_opt->farjmp_bitmap();
-    int num = static_cast<int>(farjmp_positions_.size());
-    if (num && bitmap.empty()) {
-      bool can_opt = false;
-
-      bitmap.resize((num + 31) / 32, 0);
-      for (int i = 0; i < num; i++) {
-        int disp_pos = farjmp_positions_[i];
-        int disp = long_at(disp_pos);
-        if (is_int8(disp)) {
-          bitmap[i / 32] |= 1 << (i & 31);
-          can_opt = true;
-        }
-      }
-      if (can_opt) {
-        jump_opt->set_optimizable();
-      }
-    }
-  }
-}
-
-
-void Assembler::Align(int m) {
-  DCHECK(base::bits::IsPowerOfTwo(m));
-  int delta = (m - (pc_offset() & (m - 1))) & (m - 1);
-  Nop(delta);
-}
-
-
-void Assembler::CodeTargetAlign() {
-  Align(16);  // Preferred alignment of jump targets on x64.
-}
-
-
-bool Assembler::IsNop(Address addr) {
-  Address a = addr;
-  while (*a == 0x66) a++;
-  if (*a == 0x90) return true;
-  if (a[0] == 0xF && a[1] == 0x1F) return true;
-  return false;
-}
-
-
-void Assembler::bind_to(Label* L, int pos) {
-  DCHECK(!L->is_bound());  // Label may only be bound once.
-  DCHECK(0 <= pos && pos <= pc_offset());  // Position must be valid.
-  if (L->is_linked()) {
-    int current = L->pos();
-    int next = long_at(current);
-    while (next != current) {
-      if (current >= 4 && long_at(current - 4) == 0) {
-        // Absolute address.
-        intptr_t imm64 = reinterpret_cast<intptr_t>(buffer_ + pos);
-        *reinterpret_cast<intptr_t*>(addr_at(current - 4)) = imm64;
-        internal_reference_positions_.push_back(current - 4);
-      } else {
-        // Relative address, relative to point after address.
-        int imm32 = pos - (current + sizeof(int32_t));
-        long_at_put(current, imm32);
-      }
-      current = next;
-      next = long_at(next);
-    }
-    // Fix up last fixup on linked list.
-    if (current >= 4 && long_at(current - 4) == 0) {
-      // Absolute address.
-      intptr_t imm64 = reinterpret_cast<intptr_t>(buffer_ + pos);
-      *reinterpret_cast<intptr_t*>(addr_at(current - 4)) = imm64;
-      internal_reference_positions_.push_back(current - 4);
-    } else {
-      // Relative address, relative to point after address.
-      int imm32 = pos - (current + sizeof(int32_t));
-      long_at_put(current, imm32);
-    }
-  }
-  while (L->is_near_linked()) {
-    int fixup_pos = L->near_link_pos();
-    int offset_to_next =
-        static_cast<int>(*reinterpret_cast<int8_t*>(addr_at(fixup_pos)));
-    DCHECK_LE(offset_to_next, 0);
-    int disp = pos - (fixup_pos + sizeof(int8_t));
-    CHECK(is_int8(disp));
-    set_byte_at(fixup_pos, disp);
-    if (offset_to_next < 0) {
-      L->link_to(fixup_pos + offset_to_next, Label::kNear);
-    } else {
-      L->UnuseNear();
-    }
-  }
-
-  // Optimization stage
-  auto jump_opt = jump_optimization_info();
-  if (jump_opt && jump_opt->is_optimizing()) {
-    auto it = label_farjmp_maps_.find(L);
-    if (it != label_farjmp_maps_.end()) {
-      auto& pos_vector = it->second;
-      for (auto fixup_pos : pos_vector) {
-        int disp = pos - (fixup_pos + sizeof(int8_t));
-        CHECK(is_int8(disp));
-        set_byte_at(fixup_pos, disp);
-      }
-      label_farjmp_maps_.erase(it);
-    }
-  }
-  L->bind_to(pos);
-}
-
-
-void Assembler::bind(Label* L) {
-  bind_to(L, pc_offset());
-}
-
-void Assembler::record_farjmp_position(Label* L, int pos) {
-  auto& pos_vector = label_farjmp_maps_[L];
-  pos_vector.push_back(pos);
-}
-
-bool Assembler::is_optimizable_farjmp(int idx) {
-  if (predictable_code_size()) return false;
-
-  auto jump_opt = jump_optimization_info();
-  CHECK(jump_opt->is_optimizing());
-
-  auto& bitmap = jump_opt->farjmp_bitmap();
-  CHECK(idx < static_cast<int>(bitmap.size() * 32));
-  return !!(bitmap[idx / 32] & (1 << (idx & 31)));
-}
-
-void Assembler::GrowBuffer() {
-  DCHECK(buffer_overflow());
-  if (!own_buffer_) FATAL("external code buffer is too small");
-
-  // Compute new buffer size.
-  CodeDesc desc;  // the new buffer
-  desc.buffer_size = 2 * buffer_size_;
-
-  // Some internal data structures overflow for very large buffers,
-  // they must ensure that kMaximalBufferSize is not too large.
-  if (desc.buffer_size > kMaximalBufferSize) {
-    V8::FatalProcessOutOfMemory("Assembler::GrowBuffer");
-  }
-
-  // Set up new buffer.
-  desc.buffer = NewArray<byte>(desc.buffer_size);
-  desc.origin = this;
-  desc.instr_size = pc_offset();
-  desc.reloc_size =
-      static_cast<int>((buffer_ + buffer_size_) - (reloc_info_writer.pos()));
-
-  // Clear the buffer in debug mode. Use 'int3' instructions to make
-  // sure to get into problems if we ever run uninitialized code.
-#ifdef DEBUG
-  memset(desc.buffer, 0xCC, desc.buffer_size);
-#endif
-
-  // Copy the data.
-  intptr_t pc_delta = desc.buffer - buffer_;
-  intptr_t rc_delta = (desc.buffer + desc.buffer_size) -
-      (buffer_ + buffer_size_);
-  MemMove(desc.buffer, buffer_, desc.instr_size);
-  MemMove(rc_delta + reloc_info_writer.pos(), reloc_info_writer.pos(),
-          desc.reloc_size);
-
-  // Switch buffers.
-  DeleteArray(buffer_);
-  buffer_ = desc.buffer;
-  buffer_size_ = desc.buffer_size;
-  pc_ += pc_delta;
-  reloc_info_writer.Reposition(reloc_info_writer.pos() + rc_delta,
-                               reloc_info_writer.last_pc() + pc_delta);
-
-  // Relocate internal references.
-  for (auto pos : internal_reference_positions_) {
-    intptr_t* p = reinterpret_cast<intptr_t*>(buffer_ + pos);
-    *p += pc_delta;
-  }
-
-  DCHECK(!buffer_overflow());
-}
-
-
-void Assembler::emit_operand(int code, const Operand& adr) {
-  DCHECK(is_uint3(code));
-  const unsigned length = adr.len_;
-  DCHECK_GT(length, 0);
-
-  // Emit updated ModR/M byte containing the given register.
-  DCHECK_EQ(adr.buf_[0] & 0x38, 0);
-  *pc_++ = adr.buf_[0] | code << 3;
-
-  // Recognize RIP relative addressing.
-  if (adr.buf_[0] == 5) {
-    DCHECK_EQ(9u, length);
-    Label* label = *bit_cast<Label* const*>(&adr.buf_[1]);
-    if (label->is_bound()) {
-      int offset = label->pos() - pc_offset() - sizeof(int32_t);
-      DCHECK_GE(0, offset);
-      emitl(offset);
-    } else if (label->is_linked()) {
-      emitl(label->pos());
-      label->link_to(pc_offset() - sizeof(int32_t));
-    } else {
-      DCHECK(label->is_unused());
-      int32_t current = pc_offset();
-      emitl(current);
-      label->link_to(current);
-    }
-  } else {
-    // Emit the rest of the encoded operand.
-    for (unsigned i = 1; i < length; i++) *pc_++ = adr.buf_[i];
-  }
-}
-
-
-// Assembler Instruction implementations.
-
-void Assembler::arithmetic_op(byte opcode,
-                              Register reg,
-                              const Operand& op,
-                              int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(reg, op, size);
-  emit(opcode);
-  emit_operand(reg, op);
-}
-
-
-void Assembler::arithmetic_op(byte opcode,
-                              Register reg,
-                              Register rm_reg,
-                              int size) {
-  EnsureSpace ensure_space(this);
-  DCHECK_EQ(opcode & 0xC6, 2);
-  if (rm_reg.low_bits() == 4)  {  // Forces SIB byte.
-    // Swap reg and rm_reg and change opcode operand order.
-    emit_rex(rm_reg, reg, size);
-    emit(opcode ^ 0x02);
-    emit_modrm(rm_reg, reg);
-  } else {
-    emit_rex(reg, rm_reg, size);
-    emit(opcode);
-    emit_modrm(reg, rm_reg);
-  }
-}
-
-
-void Assembler::arithmetic_op_16(byte opcode, Register reg, Register rm_reg) {
-  EnsureSpace ensure_space(this);
-  DCHECK_EQ(opcode & 0xC6, 2);
-  if (rm_reg.low_bits() == 4) {  // Forces SIB byte.
-    // Swap reg and rm_reg and change opcode operand order.
-    emit(0x66);
-    emit_optional_rex_32(rm_reg, reg);
-    emit(opcode ^ 0x02);
-    emit_modrm(rm_reg, reg);
-  } else {
-    emit(0x66);
-    emit_optional_rex_32(reg, rm_reg);
-    emit(opcode);
-    emit_modrm(reg, rm_reg);
-  }
-}
-
-
-void Assembler::arithmetic_op_16(byte opcode,
-                                 Register reg,
-                                 const Operand& rm_reg) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(reg, rm_reg);
-  emit(opcode);
-  emit_operand(reg, rm_reg);
-}
-
-
-void Assembler::arithmetic_op_8(byte opcode, Register reg, const Operand& op) {
-  EnsureSpace ensure_space(this);
-  if (!reg.is_byte_register()) {
-    emit_rex_32(reg, op);
-  } else {
-    emit_optional_rex_32(reg, op);
-  }
-  emit(opcode);
-  emit_operand(reg, op);
-}
-
-
-void Assembler::arithmetic_op_8(byte opcode, Register reg, Register rm_reg) {
-  EnsureSpace ensure_space(this);
-  DCHECK_EQ(opcode & 0xC6, 2);
-  if (rm_reg.low_bits() == 4)  {  // Forces SIB byte.
-    // Swap reg and rm_reg and change opcode operand order.
-    if (!rm_reg.is_byte_register() || !reg.is_byte_register()) {
-      // Register is not one of al, bl, cl, dl.  Its encoding needs REX.
-      emit_rex_32(rm_reg, reg);
-    }
-    emit(opcode ^ 0x02);
-    emit_modrm(rm_reg, reg);
-  } else {
-    if (!reg.is_byte_register() || !rm_reg.is_byte_register()) {
-      // Register is not one of al, bl, cl, dl.  Its encoding needs REX.
-      emit_rex_32(reg, rm_reg);
-    }
-    emit(opcode);
-    emit_modrm(reg, rm_reg);
-  }
-}
-
-
-void Assembler::immediate_arithmetic_op(byte subcode,
-                                        Register dst,
-                                        Immediate src,
-                                        int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(dst, size);
-  if (is_int8(src.value_) && RelocInfo::IsNone(src.rmode_)) {
-    emit(0x83);
-    emit_modrm(subcode, dst);
-    emit(src.value_);
-  } else if (dst == rax) {
-    emit(0x05 | (subcode << 3));
-    emit(src);
-  } else {
-    emit(0x81);
-    emit_modrm(subcode, dst);
-    emit(src);
-  }
-}
-
-void Assembler::immediate_arithmetic_op(byte subcode,
-                                        const Operand& dst,
-                                        Immediate src,
-                                        int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(dst, size);
-  if (is_int8(src.value_) && RelocInfo::IsNone(src.rmode_)) {
-    emit(0x83);
-    emit_operand(subcode, dst);
-    emit(src.value_);
-  } else {
-    emit(0x81);
-    emit_operand(subcode, dst);
-    emit(src);
-  }
-}
-
-
-void Assembler::immediate_arithmetic_op_16(byte subcode,
-                                           Register dst,
-                                           Immediate src) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);  // Operand size override prefix.
-  emit_optional_rex_32(dst);
-  if (is_int8(src.value_)) {
-    emit(0x83);
-    emit_modrm(subcode, dst);
-    emit(src.value_);
-  } else if (dst == rax) {
-    emit(0x05 | (subcode << 3));
-    emitw(src.value_);
-  } else {
-    emit(0x81);
-    emit_modrm(subcode, dst);
-    emitw(src.value_);
-  }
-}
-
-
-void Assembler::immediate_arithmetic_op_16(byte subcode,
-                                           const Operand& dst,
-                                           Immediate src) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);  // Operand size override prefix.
-  emit_optional_rex_32(dst);
-  if (is_int8(src.value_)) {
-    emit(0x83);
-    emit_operand(subcode, dst);
-    emit(src.value_);
-  } else {
-    emit(0x81);
-    emit_operand(subcode, dst);
-    emitw(src.value_);
-  }
-}
-
-
-void Assembler::immediate_arithmetic_op_8(byte subcode,
-                                          const Operand& dst,
-                                          Immediate src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst);
-  DCHECK(is_int8(src.value_) || is_uint8(src.value_));
-  emit(0x80);
-  emit_operand(subcode, dst);
-  emit(src.value_);
-}
-
-
-void Assembler::immediate_arithmetic_op_8(byte subcode,
-                                          Register dst,
-                                          Immediate src) {
-  EnsureSpace ensure_space(this);
-  if (!dst.is_byte_register()) {
-    // Register is not one of al, bl, cl, dl.  Its encoding needs REX.
-    emit_rex_32(dst);
-  }
-  DCHECK(is_int8(src.value_) || is_uint8(src.value_));
-  emit(0x80);
-  emit_modrm(subcode, dst);
-  emit(src.value_);
-}
-
-
-void Assembler::shift(Register dst,
-                      Immediate shift_amount,
-                      int subcode,
-                      int size) {
-  EnsureSpace ensure_space(this);
-  DCHECK(size == kInt64Size ? is_uint6(shift_amount.value_)
-                            : is_uint5(shift_amount.value_));
-  if (shift_amount.value_ == 1) {
-    emit_rex(dst, size);
-    emit(0xD1);
-    emit_modrm(subcode, dst);
-  } else {
-    emit_rex(dst, size);
-    emit(0xC1);
-    emit_modrm(subcode, dst);
-    emit(shift_amount.value_);
-  }
-}
-
-
-void Assembler::shift(Operand dst, Immediate shift_amount, int subcode,
-                      int size) {
-  EnsureSpace ensure_space(this);
-  DCHECK(size == kInt64Size ? is_uint6(shift_amount.value_)
-                            : is_uint5(shift_amount.value_));
-  if (shift_amount.value_ == 1) {
-    emit_rex(dst, size);
-    emit(0xD1);
-    emit_operand(subcode, dst);
-  } else {
-    emit_rex(dst, size);
-    emit(0xC1);
-    emit_operand(subcode, dst);
-    emit(shift_amount.value_);
-  }
-}
-
-
-void Assembler::shift(Register dst, int subcode, int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(dst, size);
-  emit(0xD3);
-  emit_modrm(subcode, dst);
-}
-
-
-void Assembler::shift(Operand dst, int subcode, int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(dst, size);
-  emit(0xD3);
-  emit_operand(subcode, dst);
-}
-
-
-void Assembler::bt(const Operand& dst, Register src) {
-  EnsureSpace ensure_space(this);
-  emit_rex_64(src, dst);
-  emit(0x0F);
-  emit(0xA3);
-  emit_operand(src, dst);
-}
-
-
-void Assembler::bts(const Operand& dst, Register src) {
-  EnsureSpace ensure_space(this);
-  emit_rex_64(src, dst);
-  emit(0x0F);
-  emit(0xAB);
-  emit_operand(src, dst);
-}
-
-
-void Assembler::bsrl(Register dst, Register src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0xBD);
-  emit_modrm(dst, src);
-}
-
-
-void Assembler::bsrl(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0xBD);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::bsrq(Register dst, Register src) {
-  EnsureSpace ensure_space(this);
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0xBD);
-  emit_modrm(dst, src);
-}
-
-
-void Assembler::bsrq(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0xBD);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::bsfl(Register dst, Register src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0xBC);
-  emit_modrm(dst, src);
-}
-
-
-void Assembler::bsfl(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0xBC);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::bsfq(Register dst, Register src) {
-  EnsureSpace ensure_space(this);
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0xBC);
-  emit_modrm(dst, src);
-}
-
-
-void Assembler::bsfq(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0xBC);
-  emit_operand(dst, src);
-}
-
-void Assembler::pshufw(XMMRegister dst, XMMRegister src, uint8_t shuffle) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x70);
-  emit(0xC0 | (dst.low_bits() << 3) | src.low_bits());
-  emit(shuffle);
-}
-
-void Assembler::pshufw(XMMRegister dst, const Operand& src, uint8_t shuffle) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x70);
-  emit_operand(dst.code(), src);
-  emit(shuffle);
-}
-
-void Assembler::call(Label* L) {
-  EnsureSpace ensure_space(this);
-  // 1110 1000 #32-bit disp.
-  emit(0xE8);
-  if (L->is_bound()) {
-    int offset = L->pos() - pc_offset() - sizeof(int32_t);
-    DCHECK_LE(offset, 0);
-    emitl(offset);
-  } else if (L->is_linked()) {
-    emitl(L->pos());
-    L->link_to(pc_offset() - sizeof(int32_t));
-  } else {
-    DCHECK(L->is_unused());
-    int32_t current = pc_offset();
-    emitl(current);
-    L->link_to(current);
-  }
-}
-
-
-void Assembler::call(Address entry, RelocInfo::Mode rmode) {
-  DCHECK(RelocInfo::IsRuntimeEntry(rmode));
-  EnsureSpace ensure_space(this);
-  // 1110 1000 #32-bit disp.
-  emit(0xE8);
-  emit_runtime_entry(entry, rmode);
-}
-
-void Assembler::call(CodeStub* stub) {
-  EnsureSpace ensure_space(this);
-  // 1110 1000 #32-bit disp.
-  emit(0xE8);
-  RequestHeapObject(HeapObjectRequest(stub));
-  emit_code_target(Handle<Code>(), RelocInfo::CODE_TARGET);
-}
-
-void Assembler::call(Handle<Code> target, RelocInfo::Mode rmode) {
-  EnsureSpace ensure_space(this);
-  // 1110 1000 #32-bit disp.
-  emit(0xE8);
-  emit_code_target(target, rmode);
-}
-
-void Assembler::near_call(Address addr, RelocInfo::Mode rmode) {
-  EnsureSpace ensure_space(this);
-  emit(0xE8);
-  intptr_t value = reinterpret_cast<intptr_t>(addr);
-  DCHECK(is_int32(value));
-  RecordRelocInfo(rmode);
-  emitl(static_cast<int32_t>(value));
-}
-
-void Assembler::near_jmp(Address addr, RelocInfo::Mode rmode) {
-  EnsureSpace ensure_space(this);
-  emit(0xE9);
-  intptr_t value = reinterpret_cast<intptr_t>(addr);
-  DCHECK(is_int32(value));
-  RecordRelocInfo(rmode);
-  emitl(static_cast<int32_t>(value));
-}
-
-void Assembler::call(Register adr) {
-  EnsureSpace ensure_space(this);
-  // Opcode: FF /2 r64.
-  emit_optional_rex_32(adr);
-  emit(0xFF);
-  emit_modrm(0x2, adr);
-}
-
-
-void Assembler::call(const Operand& op) {
-  EnsureSpace ensure_space(this);
-  // Opcode: FF /2 m64.
-  emit_optional_rex_32(op);
-  emit(0xFF);
-  emit_operand(0x2, op);
-}
-
-
-// Calls directly to the given address using a relative offset.
-// Should only ever be used in Code objects for calls within the
-// same Code object. Should not be used when generating new code (use labels),
-// but only when patching existing code.
-void Assembler::call(Address target) {
-  EnsureSpace ensure_space(this);
-  // 1110 1000 #32-bit disp.
-  emit(0xE8);
-  Address source = pc_ + 4;
-  intptr_t displacement = target - source;
-  DCHECK(is_int32(displacement));
-  emitl(static_cast<int32_t>(displacement));
-}
-
-
-void Assembler::clc() {
-  EnsureSpace ensure_space(this);
-  emit(0xF8);
-}
-
-
-void Assembler::cld() {
-  EnsureSpace ensure_space(this);
-  emit(0xFC);
-}
-
-void Assembler::cdq() {
-  EnsureSpace ensure_space(this);
-  emit(0x99);
-}
-
-
-void Assembler::cmovq(Condition cc, Register dst, Register src) {
-  if (cc == always) {
-    movq(dst, src);
-  } else if (cc == never) {
-    return;
-  }
-  // No need to check CpuInfo for CMOV support, it's a required part of the
-  // 64-bit architecture.
-  DCHECK_GE(cc, 0);  // Use mov for unconditional moves.
-  EnsureSpace ensure_space(this);
-  // Opcode: REX.W 0f 40 + cc /r.
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0x40 + cc);
-  emit_modrm(dst, src);
-}
-
-
-void Assembler::cmovq(Condition cc, Register dst, const Operand& src) {
-  if (cc == always) {
-    movq(dst, src);
-  } else if (cc == never) {
-    return;
-  }
-  DCHECK_GE(cc, 0);
-  EnsureSpace ensure_space(this);
-  // Opcode: REX.W 0f 40 + cc /r.
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0x40 + cc);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::cmovl(Condition cc, Register dst, Register src) {
-  if (cc == always) {
-    movl(dst, src);
-  } else if (cc == never) {
-    return;
-  }
-  DCHECK_GE(cc, 0);
-  EnsureSpace ensure_space(this);
-  // Opcode: 0f 40 + cc /r.
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x40 + cc);
-  emit_modrm(dst, src);
-}
-
-
-void Assembler::cmovl(Condition cc, Register dst, const Operand& src) {
-  if (cc == always) {
-    movl(dst, src);
-  } else if (cc == never) {
-    return;
-  }
-  DCHECK_GE(cc, 0);
-  EnsureSpace ensure_space(this);
-  // Opcode: 0f 40 + cc /r.
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x40 + cc);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::cmpb_al(Immediate imm8) {
-  DCHECK(is_int8(imm8.value_) || is_uint8(imm8.value_));
-  EnsureSpace ensure_space(this);
-  emit(0x3C);
-  emit(imm8.value_);
-}
-
-void Assembler::lock() {
-  EnsureSpace ensure_space(this);
-  emit(0xF0);
-}
-
-void Assembler::cmpxchgb(const Operand& dst, Register src) {
-  EnsureSpace ensure_space(this);
-  if (!src.is_byte_register()) {
-    // Register is not one of al, bl, cl, dl.  Its encoding needs REX.
-    emit_rex_32(src, dst);
-  } else {
-    emit_optional_rex_32(src, dst);
-  }
-  emit(0x0F);
-  emit(0xB0);
-  emit_operand(src, dst);
-}
-
-void Assembler::cmpxchgw(const Operand& dst, Register src) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(src, dst);
-  emit(0x0F);
-  emit(0xB1);
-  emit_operand(src, dst);
-}
-
-void Assembler::emit_cmpxchg(const Operand& dst, Register src, int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(src, dst, size);
-  emit(0x0F);
-  emit(0xB1);
-  emit_operand(src, dst);
-}
-
-void Assembler::lfence() {
-  EnsureSpace ensure_space(this);
-  emit(0x0F);
-  emit(0xAE);
-  emit(0xE8);
-}
-
-void Assembler::cpuid() {
-  EnsureSpace ensure_space(this);
-  emit(0x0F);
-  emit(0xA2);
-}
-
-
-void Assembler::cqo() {
-  EnsureSpace ensure_space(this);
-  emit_rex_64();
-  emit(0x99);
-}
-
-
-void Assembler::emit_dec(Register dst, int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(dst, size);
-  emit(0xFF);
-  emit_modrm(0x1, dst);
-}
-
-
-void Assembler::emit_dec(const Operand& dst, int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(dst, size);
-  emit(0xFF);
-  emit_operand(1, dst);
-}
-
-
-void Assembler::decb(Register dst) {
-  EnsureSpace ensure_space(this);
-  if (!dst.is_byte_register()) {
-    // Register is not one of al, bl, cl, dl.  Its encoding needs REX.
-    emit_rex_32(dst);
-  }
-  emit(0xFE);
-  emit_modrm(0x1, dst);
-}
-
-
-void Assembler::decb(const Operand& dst) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst);
-  emit(0xFE);
-  emit_operand(1, dst);
-}
-
-
-void Assembler::enter(Immediate size) {
-  EnsureSpace ensure_space(this);
-  emit(0xC8);
-  emitw(size.value_);  // 16 bit operand, always.
-  emit(0);
-}
-
-
-void Assembler::hlt() {
-  EnsureSpace ensure_space(this);
-  emit(0xF4);
-}
-
-
-void Assembler::emit_idiv(Register src, int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(src, size);
-  emit(0xF7);
-  emit_modrm(0x7, src);
-}
-
-
-void Assembler::emit_div(Register src, int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(src, size);
-  emit(0xF7);
-  emit_modrm(0x6, src);
-}
-
-
-void Assembler::emit_imul(Register src, int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(src, size);
-  emit(0xF7);
-  emit_modrm(0x5, src);
-}
-
-
-void Assembler::emit_imul(const Operand& src, int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(src, size);
-  emit(0xF7);
-  emit_operand(0x5, src);
-}
-
-
-void Assembler::emit_imul(Register dst, Register src, int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(dst, src, size);
-  emit(0x0F);
-  emit(0xAF);
-  emit_modrm(dst, src);
-}
-
-
-void Assembler::emit_imul(Register dst, const Operand& src, int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(dst, src, size);
-  emit(0x0F);
-  emit(0xAF);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::emit_imul(Register dst, Register src, Immediate imm, int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(dst, src, size);
-  if (is_int8(imm.value_)) {
-    emit(0x6B);
-    emit_modrm(dst, src);
-    emit(imm.value_);
-  } else {
-    emit(0x69);
-    emit_modrm(dst, src);
-    emitl(imm.value_);
-  }
-}
-
-
-void Assembler::emit_imul(Register dst, const Operand& src, Immediate imm,
-                          int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(dst, src, size);
-  if (is_int8(imm.value_)) {
-    emit(0x6B);
-    emit_operand(dst, src);
-    emit(imm.value_);
-  } else {
-    emit(0x69);
-    emit_operand(dst, src);
-    emitl(imm.value_);
-  }
-}
-
-
-void Assembler::emit_inc(Register dst, int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(dst, size);
-  emit(0xFF);
-  emit_modrm(0x0, dst);
-}
-
-
-void Assembler::emit_inc(const Operand& dst, int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(dst, size);
-  emit(0xFF);
-  emit_operand(0, dst);
-}
-
-
-void Assembler::int3() {
-  EnsureSpace ensure_space(this);
-  emit(0xCC);
-}
-
-
-void Assembler::j(Condition cc, Label* L, Label::Distance distance) {
-  if (cc == always) {
-    jmp(L);
-    return;
-  } else if (cc == never) {
-    return;
-  }
-  EnsureSpace ensure_space(this);
-  DCHECK(is_uint4(cc));
-  if (L->is_bound()) {
-    const int short_size = 2;
-    const int long_size  = 6;
-    int offs = L->pos() - pc_offset();
-    DCHECK_LE(offs, 0);
-    // Determine whether we can use 1-byte offsets for backwards branches,
-    // which have a max range of 128 bytes.
-
-    // We also need to check predictable_code_size() flag here, because on x64,
-    // when the full code generator recompiles code for debugging, some places
-    // need to be padded out to a certain size. The debugger is keeping track of
-    // how often it did this so that it can adjust return addresses on the
-    // stack, but if the size of jump instructions can also change, that's not
-    // enough and the calculated offsets would be incorrect.
-    if (is_int8(offs - short_size) && !predictable_code_size()) {
-      // 0111 tttn #8-bit disp.
-      emit(0x70 | cc);
-      emit((offs - short_size) & 0xFF);
-    } else {
-      // 0000 1111 1000 tttn #32-bit disp.
-      emit(0x0F);
-      emit(0x80 | cc);
-      emitl(offs - long_size);
-    }
-  } else if (distance == Label::kNear) {
-    // 0111 tttn #8-bit disp
-    emit(0x70 | cc);
-    byte disp = 0x00;
-    if (L->is_near_linked()) {
-      int offset = L->near_link_pos() - pc_offset();
-      DCHECK(is_int8(offset));
-      disp = static_cast<byte>(offset & 0xFF);
-    }
-    L->link_to(pc_offset(), Label::kNear);
-    emit(disp);
-  } else {
-    auto jump_opt = jump_optimization_info();
-    if (V8_UNLIKELY(jump_opt)) {
-      if (jump_opt->is_optimizing() && is_optimizable_farjmp(farjmp_num_++)) {
-        // 0111 tttn #8-bit disp
-        emit(0x70 | cc);
-        record_farjmp_position(L, pc_offset());
-        emit(0);
-        return;
-      }
-      if (jump_opt->is_collecting()) {
-        farjmp_positions_.push_back(pc_offset() + 2);
-      }
-    }
-    if (L->is_linked()) {
-      // 0000 1111 1000 tttn #32-bit disp.
-      emit(0x0F);
-      emit(0x80 | cc);
-      emitl(L->pos());
-      L->link_to(pc_offset() - sizeof(int32_t));
-    } else {
-      DCHECK(L->is_unused());
-      emit(0x0F);
-      emit(0x80 | cc);
-      int32_t current = pc_offset();
-      emitl(current);
-      L->link_to(current);
-    }
-  }
-}
-
-
-void Assembler::j(Condition cc, Address entry, RelocInfo::Mode rmode) {
-  DCHECK(RelocInfo::IsRuntimeEntry(rmode));
-  EnsureSpace ensure_space(this);
-  DCHECK(is_uint4(cc));
-  emit(0x0F);
-  emit(0x80 | cc);
-  emit_runtime_entry(entry, rmode);
-}
-
-
-void Assembler::j(Condition cc,
-                  Handle<Code> target,
-                  RelocInfo::Mode rmode) {
-  EnsureSpace ensure_space(this);
-  DCHECK(is_uint4(cc));
-  // 0000 1111 1000 tttn #32-bit disp.
-  emit(0x0F);
-  emit(0x80 | cc);
-  emit_code_target(target, rmode);
-}
-
-
-void Assembler::jmp(Label* L, Label::Distance distance) {
-  EnsureSpace ensure_space(this);
-  const int short_size = sizeof(int8_t);
-  const int long_size = sizeof(int32_t);
-  if (L->is_bound()) {
-    int offs = L->pos() - pc_offset() - 1;
-    DCHECK_LE(offs, 0);
-    if (is_int8(offs - short_size) && !predictable_code_size()) {
-      // 1110 1011 #8-bit disp.
-      emit(0xEB);
-      emit((offs - short_size) & 0xFF);
-    } else {
-      // 1110 1001 #32-bit disp.
-      emit(0xE9);
-      emitl(offs - long_size);
-    }
-  } else if (distance == Label::kNear) {
-    emit(0xEB);
-    byte disp = 0x00;
-    if (L->is_near_linked()) {
-      int offset = L->near_link_pos() - pc_offset();
-      DCHECK(is_int8(offset));
-      disp = static_cast<byte>(offset & 0xFF);
-    }
-    L->link_to(pc_offset(), Label::kNear);
-    emit(disp);
-  } else {
-    auto jump_opt = jump_optimization_info();
-    if (V8_UNLIKELY(jump_opt)) {
-      if (jump_opt->is_optimizing() && is_optimizable_farjmp(farjmp_num_++)) {
-        emit(0xEB);
-        record_farjmp_position(L, pc_offset());
-        emit(0);
-        return;
-      }
-      if (jump_opt->is_collecting()) {
-        farjmp_positions_.push_back(pc_offset() + 1);
-      }
-    }
-    if (L->is_linked()) {
-      // 1110 1001 #32-bit disp.
-      emit(0xE9);
-      emitl(L->pos());
-      L->link_to(pc_offset() - long_size);
-    } else {
-      // 1110 1001 #32-bit disp.
-      DCHECK(L->is_unused());
-      emit(0xE9);
-      int32_t current = pc_offset();
-      emitl(current);
-      L->link_to(current);
-    }
-  }
-}
-
-
-void Assembler::jmp(Handle<Code> target, RelocInfo::Mode rmode) {
-  EnsureSpace ensure_space(this);
-  // 1110 1001 #32-bit disp.
-  emit(0xE9);
-  emit_code_target(target, rmode);
-}
-
-
-void Assembler::jmp(Register target) {
-  EnsureSpace ensure_space(this);
-  // Opcode FF/4 r64.
-  emit_optional_rex_32(target);
-  emit(0xFF);
-  emit_modrm(0x4, target);
-}
-
-
-void Assembler::jmp(const Operand& src) {
-  EnsureSpace ensure_space(this);
-  // Opcode FF/4 m64.
-  emit_optional_rex_32(src);
-  emit(0xFF);
-  emit_operand(0x4, src);
-}
-
-
-void Assembler::emit_lea(Register dst, const Operand& src, int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(dst, src, size);
-  emit(0x8D);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::load_rax(void* value, RelocInfo::Mode mode) {
-  EnsureSpace ensure_space(this);
-  if (kPointerSize == kInt64Size) {
-    emit(0x48);  // REX.W
-    emit(0xA1);
-    emitp(value, mode);
-  } else {
-    DCHECK_EQ(kPointerSize, kInt32Size);
-    emit(0xA1);
-    emitp(value, mode);
-    // In 64-bit mode, need to zero extend the operand to 8 bytes.
-    // See 2.2.1.4 in Intel64 and IA32 Architectures Software
-    // Developer's Manual Volume 2.
-    emitl(0);
-  }
-}
-
-
-void Assembler::load_rax(ExternalReference ref) {
-  load_rax(ref.address(), RelocInfo::EXTERNAL_REFERENCE);
-}
-
-
-void Assembler::leave() {
-  EnsureSpace ensure_space(this);
-  emit(0xC9);
-}
-
-
-void Assembler::movb(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  if (!dst.is_byte_register()) {
-    // Register is not one of al, bl, cl, dl.  Its encoding needs REX.
-    emit_rex_32(dst, src);
-  } else {
-    emit_optional_rex_32(dst, src);
-  }
-  emit(0x8A);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::movb(Register dst, Immediate imm) {
-  EnsureSpace ensure_space(this);
-  if (!dst.is_byte_register()) {
-    // Register is not one of al, bl, cl, dl.  Its encoding needs REX.
-    emit_rex_32(dst);
-  }
-  emit(0xB0 + dst.low_bits());
-  emit(imm.value_);
-}
-
-
-void Assembler::movb(const Operand& dst, Register src) {
-  EnsureSpace ensure_space(this);
-  if (!src.is_byte_register()) {
-    // Register is not one of al, bl, cl, dl.  Its encoding needs REX.
-    emit_rex_32(src, dst);
-  } else {
-    emit_optional_rex_32(src, dst);
-  }
-  emit(0x88);
-  emit_operand(src, dst);
-}
-
-
-void Assembler::movb(const Operand& dst, Immediate imm) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst);
-  emit(0xC6);
-  emit_operand(0x0, dst);
-  emit(static_cast<byte>(imm.value_));
-}
-
-
-void Assembler::movw(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x8B);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::movw(const Operand& dst, Register src) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(src, dst);
-  emit(0x89);
-  emit_operand(src, dst);
-}
-
-
-void Assembler::movw(const Operand& dst, Immediate imm) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst);
-  emit(0xC7);
-  emit_operand(0x0, dst);
-  emit(static_cast<byte>(imm.value_ & 0xFF));
-  emit(static_cast<byte>(imm.value_ >> 8));
-}
-
-
-void Assembler::emit_mov(Register dst, const Operand& src, int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(dst, src, size);
-  emit(0x8B);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::emit_mov(Register dst, Register src, int size) {
-  EnsureSpace ensure_space(this);
-  if (src.low_bits() == 4) {
-    emit_rex(src, dst, size);
-    emit(0x89);
-    emit_modrm(src, dst);
-  } else {
-    emit_rex(dst, src, size);
-    emit(0x8B);
-    emit_modrm(dst, src);
-  }
-}
-
-
-void Assembler::emit_mov(const Operand& dst, Register src, int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(src, dst, size);
-  emit(0x89);
-  emit_operand(src, dst);
-}
-
-
-void Assembler::emit_mov(Register dst, Immediate value, int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(dst, size);
-  if (size == kInt64Size) {
-    emit(0xC7);
-    emit_modrm(0x0, dst);
-  } else {
-    DCHECK_EQ(size, kInt32Size);
-    emit(0xB8 + dst.low_bits());
-  }
-  emit(value);
-}
-
-
-void Assembler::emit_mov(const Operand& dst, Immediate value, int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(dst, size);
-  emit(0xC7);
-  emit_operand(0x0, dst);
-  emit(value);
-}
-
-
-void Assembler::movp(Register dst, void* value, RelocInfo::Mode rmode) {
-  EnsureSpace ensure_space(this);
-  emit_rex(dst, kPointerSize);
-  emit(0xB8 | dst.low_bits());
-  emitp(value, rmode);
-}
-
-void Assembler::movp_heap_number(Register dst, double value) {
-  EnsureSpace ensure_space(this);
-  emit_rex(dst, kPointerSize);
-  emit(0xB8 | dst.low_bits());
-  RequestHeapObject(HeapObjectRequest(value));
-  emitp(nullptr, RelocInfo::EMBEDDED_OBJECT);
-}
-
-void Assembler::movq(Register dst, int64_t value, RelocInfo::Mode rmode) {
-  EnsureSpace ensure_space(this);
-  emit_rex_64(dst);
-  emit(0xB8 | dst.low_bits());
-  if (!RelocInfo::IsNone(rmode)) {
-    RecordRelocInfo(rmode, value);
-  }
-  emitq(value);
-}
-
-void Assembler::movq(Register dst, uint64_t value, RelocInfo::Mode rmode) {
-  movq(dst, static_cast<int64_t>(value), rmode);
-}
-
-// Loads the ip-relative location of the src label into the target location
-// (as a 32-bit offset sign extended to 64-bit).
-void Assembler::movl(const Operand& dst, Label* src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst);
-  emit(0xC7);
-  emit_operand(0, dst);
-  if (src->is_bound()) {
-    int offset = src->pos() - pc_offset() - sizeof(int32_t);
-    DCHECK_LE(offset, 0);
-    emitl(offset);
-  } else if (src->is_linked()) {
-    emitl(src->pos());
-    src->link_to(pc_offset() - sizeof(int32_t));
-  } else {
-    DCHECK(src->is_unused());
-    int32_t current = pc_offset();
-    emitl(current);
-    src->link_to(current);
-  }
-}
-
-
-void Assembler::movsxbl(Register dst, Register src) {
-  EnsureSpace ensure_space(this);
-  if (!src.is_byte_register()) {
-    // Register is not one of al, bl, cl, dl.  Its encoding needs REX.
-    emit_rex_32(dst, src);
-  } else {
-    emit_optional_rex_32(dst, src);
-  }
-  emit(0x0F);
-  emit(0xBE);
-  emit_modrm(dst, src);
-}
-
-
-void Assembler::movsxbl(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0xBE);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::movsxbq(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0xBE);
-  emit_operand(dst, src);
-}
-
-void Assembler::movsxbq(Register dst, Register src) {
-  EnsureSpace ensure_space(this);
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0xBE);
-  emit_modrm(dst, src);
-}
-
-void Assembler::movsxwl(Register dst, Register src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0xBF);
-  emit_modrm(dst, src);
-}
-
-
-void Assembler::movsxwl(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0xBF);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::movsxwq(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0xBF);
-  emit_operand(dst, src);
-}
-
-void Assembler::movsxwq(Register dst, Register src) {
-  EnsureSpace ensure_space(this);
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0xBF);
-  emit_modrm(dst, src);
-}
-
-void Assembler::movsxlq(Register dst, Register src) {
-  EnsureSpace ensure_space(this);
-  emit_rex_64(dst, src);
-  emit(0x63);
-  emit_modrm(dst, src);
-}
-
-
-void Assembler::movsxlq(Register dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit_rex_64(dst, src);
-  emit(0x63);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::emit_movzxb(Register dst, const Operand& src, int size) {
-  EnsureSpace ensure_space(this);
-  // 32 bit operations zero the top 32 bits of 64 bit registers.  Therefore
-  // there is no need to make this a 64 bit operation.
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0xB6);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::emit_movzxb(Register dst, Register src, int size) {
-  EnsureSpace ensure_space(this);
-  // 32 bit operations zero the top 32 bits of 64 bit registers.  Therefore
-  // there is no need to make this a 64 bit operation.
-  if (!src.is_byte_register()) {
-    // Register is not one of al, bl, cl, dl.  Its encoding needs REX.
-    emit_rex_32(dst, src);
-  } else {
-    emit_optional_rex_32(dst, src);
-  }
-  emit(0x0F);
-  emit(0xB6);
-  emit_modrm(dst, src);
-}
-
-
-void Assembler::emit_movzxw(Register dst, const Operand& src, int size) {
-  EnsureSpace ensure_space(this);
-  // 32 bit operations zero the top 32 bits of 64 bit registers.  Therefore
-  // there is no need to make this a 64 bit operation.
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0xB7);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::emit_movzxw(Register dst, Register src, int size) {
-  EnsureSpace ensure_space(this);
-  // 32 bit operations zero the top 32 bits of 64 bit registers.  Therefore
-  // there is no need to make this a 64 bit operation.
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0xB7);
-  emit_modrm(dst, src);
-}
-
-
-void Assembler::repmovsb() {
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit(0xA4);
-}
-
-
-void Assembler::repmovsw() {
-  EnsureSpace ensure_space(this);
-  emit(0x66);  // Operand size override.
-  emit(0xF3);
-  emit(0xA4);
-}
-
-
-void Assembler::emit_repmovs(int size) {
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_rex(size);
-  emit(0xA5);
-}
-
-
-void Assembler::mull(Register src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(src);
-  emit(0xF7);
-  emit_modrm(0x4, src);
-}
-
-
-void Assembler::mull(const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(src);
-  emit(0xF7);
-  emit_operand(0x4, src);
-}
-
-
-void Assembler::mulq(Register src) {
-  EnsureSpace ensure_space(this);
-  emit_rex_64(src);
-  emit(0xF7);
-  emit_modrm(0x4, src);
-}
-
-
-void Assembler::emit_neg(Register dst, int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(dst, size);
-  emit(0xF7);
-  emit_modrm(0x3, dst);
-}
-
-
-void Assembler::emit_neg(const Operand& dst, int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex_64(dst);
-  emit(0xF7);
-  emit_operand(3, dst);
-}
-
-
-void Assembler::nop() {
-  EnsureSpace ensure_space(this);
-  emit(0x90);
-}
-
-
-void Assembler::emit_not(Register dst, int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(dst, size);
-  emit(0xF7);
-  emit_modrm(0x2, dst);
-}
-
-
-void Assembler::emit_not(const Operand& dst, int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(dst, size);
-  emit(0xF7);
-  emit_operand(2, dst);
-}
-
-
-void Assembler::Nop(int n) {
-  // The recommended muti-byte sequences of NOP instructions from the Intel 64
-  // and IA-32 Architectures Software Developer's Manual.
-  //
-  // Length   Assembly                                Byte Sequence
-  // 2 bytes  66 NOP                                  66 90H
-  // 3 bytes  NOP DWORD ptr [EAX]                     0F 1F 00H
-  // 4 bytes  NOP DWORD ptr [EAX + 00H]               0F 1F 40 00H
-  // 5 bytes  NOP DWORD ptr [EAX + EAX*1 + 00H]       0F 1F 44 00 00H
-  // 6 bytes  66 NOP DWORD ptr [EAX + EAX*1 + 00H]    66 0F 1F 44 00 00H
-  // 7 bytes  NOP DWORD ptr [EAX + 00000000H]         0F 1F 80 00 00 00 00H
-  // 8 bytes  NOP DWORD ptr [EAX + EAX*1 + 00000000H] 0F 1F 84 00 00 00 00 00H
-  // 9 bytes  66 NOP DWORD ptr [EAX + EAX*1 +         66 0F 1F 84 00 00 00 00
-  //          00000000H]                              00H
-
-  EnsureSpace ensure_space(this);
-  while (n > 0) {
-    switch (n) {
-      case 2:
-        emit(0x66);
-      case 1:
-        emit(0x90);
-        return;
-      case 3:
-        emit(0x0F);
-        emit(0x1F);
-        emit(0x00);
-        return;
-      case 4:
-        emit(0x0F);
-        emit(0x1F);
-        emit(0x40);
-        emit(0x00);
-        return;
-      case 6:
-        emit(0x66);
-      case 5:
-        emit(0x0F);
-        emit(0x1F);
-        emit(0x44);
-        emit(0x00);
-        emit(0x00);
-        return;
-      case 7:
-        emit(0x0F);
-        emit(0x1F);
-        emit(0x80);
-        emit(0x00);
-        emit(0x00);
-        emit(0x00);
-        emit(0x00);
-        return;
-      default:
-      case 11:
-        emit(0x66);
-        n--;
-      case 10:
-        emit(0x66);
-        n--;
-      case 9:
-        emit(0x66);
-        n--;
-      case 8:
-        emit(0x0F);
-        emit(0x1F);
-        emit(0x84);
-        emit(0x00);
-        emit(0x00);
-        emit(0x00);
-        emit(0x00);
-        emit(0x00);
-        n -= 8;
-    }
-  }
-}
-
-
-void Assembler::popq(Register dst) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst);
-  emit(0x58 | dst.low_bits());
-}
-
-
-void Assembler::popq(const Operand& dst) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst);
-  emit(0x8F);
-  emit_operand(0, dst);
-}
-
-
-void Assembler::popfq() {
-  EnsureSpace ensure_space(this);
-  emit(0x9D);
-}
-
-
-void Assembler::pushq(Register src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(src);
-  emit(0x50 | src.low_bits());
-}
-
-
-void Assembler::pushq(const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(src);
-  emit(0xFF);
-  emit_operand(6, src);
-}
-
-
-void Assembler::pushq(Immediate value) {
-  EnsureSpace ensure_space(this);
-  if (is_int8(value.value_)) {
-    emit(0x6A);
-    emit(value.value_);  // Emit low byte of value.
-  } else {
-    emit(0x68);
-    emitl(value.value_);
-  }
-}
-
-
-void Assembler::pushq_imm32(int32_t imm32) {
-  EnsureSpace ensure_space(this);
-  emit(0x68);
-  emitl(imm32);
-}
-
-
-void Assembler::pushfq() {
-  EnsureSpace ensure_space(this);
-  emit(0x9C);
-}
-
-
-void Assembler::ret(int imm16) {
-  EnsureSpace ensure_space(this);
-  DCHECK(is_uint16(imm16));
-  if (imm16 == 0) {
-    emit(0xC3);
-  } else {
-    emit(0xC2);
-    emit(imm16 & 0xFF);
-    emit((imm16 >> 8) & 0xFF);
-  }
-}
-
-
-void Assembler::ud2() {
-  EnsureSpace ensure_space(this);
-  emit(0x0F);
-  emit(0x0B);
-}
-
-
-void Assembler::setcc(Condition cc, Register reg) {
-  if (cc > last_condition) {
-    movb(reg, Immediate(cc == always ? 1 : 0));
-    return;
-  }
-  EnsureSpace ensure_space(this);
-  DCHECK(is_uint4(cc));
-  if (!reg.is_byte_register()) {
-    // Register is not one of al, bl, cl, dl.  Its encoding needs REX.
-    emit_rex_32(reg);
-  }
-  emit(0x0F);
-  emit(0x90 | cc);
-  emit_modrm(0x0, reg);
-}
-
-
-void Assembler::shld(Register dst, Register src) {
-  EnsureSpace ensure_space(this);
-  emit_rex_64(src, dst);
-  emit(0x0F);
-  emit(0xA5);
-  emit_modrm(src, dst);
-}
-
-
-void Assembler::shrd(Register dst, Register src) {
-  EnsureSpace ensure_space(this);
-  emit_rex_64(src, dst);
-  emit(0x0F);
-  emit(0xAD);
-  emit_modrm(src, dst);
-}
-
-void Assembler::xchgb(Register reg, const Operand& op) {
-  EnsureSpace ensure_space(this);
-  if (!reg.is_byte_register()) {
-    // Register is not one of al, bl, cl, dl.  Its encoding needs REX.
-    emit_rex_32(reg, op);
-  } else {
-    emit_optional_rex_32(reg, op);
-  }
-  emit(0x86);
-  emit_operand(reg, op);
-}
-
-void Assembler::xchgw(Register reg, const Operand& op) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(reg, op);
-  emit(0x87);
-  emit_operand(reg, op);
-}
-
-void Assembler::emit_xchg(Register dst, Register src, int size) {
-  EnsureSpace ensure_space(this);
-  if (src == rax || dst == rax) {  // Single-byte encoding
-    Register other = src == rax ? dst : src;
-    emit_rex(other, size);
-    emit(0x90 | other.low_bits());
-  } else if (dst.low_bits() == 4) {
-    emit_rex(dst, src, size);
-    emit(0x87);
-    emit_modrm(dst, src);
-  } else {
-    emit_rex(src, dst, size);
-    emit(0x87);
-    emit_modrm(src, dst);
-  }
-}
-
-
-void Assembler::emit_xchg(Register dst, const Operand& src, int size) {
-  EnsureSpace ensure_space(this);
-  emit_rex(dst, src, size);
-  emit(0x87);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::store_rax(void* dst, RelocInfo::Mode mode) {
-  EnsureSpace ensure_space(this);
-  if (kPointerSize == kInt64Size) {
-    emit(0x48);  // REX.W
-    emit(0xA3);
-    emitp(dst, mode);
-  } else {
-    DCHECK_EQ(kPointerSize, kInt32Size);
-    emit(0xA3);
-    emitp(dst, mode);
-    // In 64-bit mode, need to zero extend the operand to 8 bytes.
-    // See 2.2.1.4 in Intel64 and IA32 Architectures Software
-    // Developer's Manual Volume 2.
-    emitl(0);
-  }
-}
-
-
-void Assembler::store_rax(ExternalReference ref) {
-  store_rax(ref.address(), RelocInfo::EXTERNAL_REFERENCE);
-}
-
-
-void Assembler::testb(Register dst, Register src) {
-  EnsureSpace ensure_space(this);
-  emit_test(dst, src, sizeof(int8_t));
-}
-
-void Assembler::testb(Register reg, Immediate mask) {
-  DCHECK(is_int8(mask.value_) || is_uint8(mask.value_));
-  emit_test(reg, mask, sizeof(int8_t));
-}
-
-void Assembler::testb(const Operand& op, Immediate mask) {
-  DCHECK(is_int8(mask.value_) || is_uint8(mask.value_));
-  emit_test(op, mask, sizeof(int8_t));
-}
-
-
-void Assembler::testb(const Operand& op, Register reg) {
-  emit_test(op, reg, sizeof(int8_t));
-}
-
-void Assembler::testw(Register dst, Register src) {
-  emit_test(dst, src, sizeof(uint16_t));
-}
-
-void Assembler::testw(Register reg, Immediate mask) {
-  emit_test(reg, mask, sizeof(int16_t));
-}
-
-void Assembler::testw(const Operand& op, Immediate mask) {
-  emit_test(op, mask, sizeof(int16_t));
-}
-
-void Assembler::testw(const Operand& op, Register reg) {
-  emit_test(op, reg, sizeof(int16_t));
-}
-
-void Assembler::emit_test(Register dst, Register src, int size) {
-  EnsureSpace ensure_space(this);
-  if (src.low_bits() == 4) std::swap(dst, src);
-  if (size == sizeof(int16_t)) {
-    emit(0x66);
-    size = sizeof(int32_t);
-  }
-  bool byte_operand = size == sizeof(int8_t);
-  if (byte_operand) {
-    size = sizeof(int32_t);
-    if (!src.is_byte_register() || !dst.is_byte_register()) {
-      emit_rex_32(dst, src);
-    }
-  } else {
-    emit_rex(dst, src, size);
-  }
-  emit(byte_operand ? 0x84 : 0x85);
-  emit_modrm(dst, src);
-}
-
-
-void Assembler::emit_test(Register reg, Immediate mask, int size) {
-  if (is_uint8(mask.value_)) {
-    size = sizeof(int8_t);
-  } else if (is_uint16(mask.value_)) {
-    size = sizeof(int16_t);
-  }
-  EnsureSpace ensure_space(this);
-  bool half_word = size == sizeof(int16_t);
-  if (half_word) {
-    emit(0x66);
-    size = sizeof(int32_t);
-  }
-  bool byte_operand = size == sizeof(int8_t);
-  if (byte_operand) {
-    size = sizeof(int32_t);
-    if (!reg.is_byte_register()) emit_rex_32(reg);
-  } else {
-    emit_rex(reg, size);
-  }
-  if (reg == rax) {
-    emit(byte_operand ? 0xA8 : 0xA9);
-  } else {
-    emit(byte_operand ? 0xF6 : 0xF7);
-    emit_modrm(0x0, reg);
-  }
-  if (byte_operand) {
-    emit(mask.value_);
-  } else if (half_word) {
-    emitw(mask.value_);
-  } else {
-    emit(mask);
-  }
-}
-
-void Assembler::emit_test(const Operand& op, Immediate mask, int size) {
-  if (is_uint8(mask.value_)) {
-    size = sizeof(int8_t);
-  } else if (is_uint16(mask.value_)) {
-    size = sizeof(int16_t);
-  }
-  EnsureSpace ensure_space(this);
-  bool half_word = size == sizeof(int16_t);
-  if (half_word) {
-    emit(0x66);
-    size = sizeof(int32_t);
-  }
-  bool byte_operand = size == sizeof(int8_t);
-  if (byte_operand) {
-    size = sizeof(int32_t);
-  }
-  emit_rex(rax, op, size);
-  emit(byte_operand ? 0xF6 : 0xF7);
-  emit_operand(rax, op);  // Operation code 0
-  if (byte_operand) {
-    emit(mask.value_);
-  } else if (half_word) {
-    emitw(mask.value_);
-  } else {
-    emit(mask);
-  }
-}
-
-void Assembler::emit_test(const Operand& op, Register reg, int size) {
-  EnsureSpace ensure_space(this);
-  if (size == sizeof(int16_t)) {
-    emit(0x66);
-    size = sizeof(int32_t);
-  }
-  bool byte_operand = size == sizeof(int8_t);
-  if (byte_operand) {
-    size = sizeof(int32_t);
-    if (!reg.is_byte_register()) {
-      // Register is not one of al, bl, cl, dl.  Its encoding needs REX.
-      emit_rex_32(reg, op);
-    } else {
-      emit_optional_rex_32(reg, op);
-    }
-  } else {
-    emit_rex(reg, op, size);
-  }
-  emit(byte_operand ? 0x84 : 0x85);
-  emit_operand(reg, op);
-}
-
-
-// FPU instructions.
-
-
-void Assembler::fld(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xD9, 0xC0, i);
-}
-
-
-void Assembler::fld1() {
-  EnsureSpace ensure_space(this);
-  emit(0xD9);
-  emit(0xE8);
-}
-
-
-void Assembler::fldz() {
-  EnsureSpace ensure_space(this);
-  emit(0xD9);
-  emit(0xEE);
-}
-
-
-void Assembler::fldpi() {
-  EnsureSpace ensure_space(this);
-  emit(0xD9);
-  emit(0xEB);
-}
-
-
-void Assembler::fldln2() {
-  EnsureSpace ensure_space(this);
-  emit(0xD9);
-  emit(0xED);
-}
-
-
-void Assembler::fld_s(const Operand& adr) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(adr);
-  emit(0xD9);
-  emit_operand(0, adr);
-}
-
-
-void Assembler::fld_d(const Operand& adr) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(adr);
-  emit(0xDD);
-  emit_operand(0, adr);
-}
-
-
-void Assembler::fstp_s(const Operand& adr) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(adr);
-  emit(0xD9);
-  emit_operand(3, adr);
-}
-
-
-void Assembler::fstp_d(const Operand& adr) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(adr);
-  emit(0xDD);
-  emit_operand(3, adr);
-}
-
-
-void Assembler::fstp(int index) {
-  DCHECK(is_uint3(index));
-  EnsureSpace ensure_space(this);
-  emit_farith(0xDD, 0xD8, index);
-}
-
-
-void Assembler::fild_s(const Operand& adr) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(adr);
-  emit(0xDB);
-  emit_operand(0, adr);
-}
-
-
-void Assembler::fild_d(const Operand& adr) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(adr);
-  emit(0xDF);
-  emit_operand(5, adr);
-}
-
-
-void Assembler::fistp_s(const Operand& adr) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(adr);
-  emit(0xDB);
-  emit_operand(3, adr);
-}
-
-
-void Assembler::fisttp_s(const Operand& adr) {
-  DCHECK(IsEnabled(SSE3));
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(adr);
-  emit(0xDB);
-  emit_operand(1, adr);
-}
-
-
-void Assembler::fisttp_d(const Operand& adr) {
-  DCHECK(IsEnabled(SSE3));
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(adr);
-  emit(0xDD);
-  emit_operand(1, adr);
-}
-
-
-void Assembler::fist_s(const Operand& adr) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(adr);
-  emit(0xDB);
-  emit_operand(2, adr);
-}
-
-
-void Assembler::fistp_d(const Operand& adr) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(adr);
-  emit(0xDF);
-  emit_operand(7, adr);
-}
-
-
-void Assembler::fabs() {
-  EnsureSpace ensure_space(this);
-  emit(0xD9);
-  emit(0xE1);
-}
-
-
-void Assembler::fchs() {
-  EnsureSpace ensure_space(this);
-  emit(0xD9);
-  emit(0xE0);
-}
-
-
-void Assembler::fcos() {
-  EnsureSpace ensure_space(this);
-  emit(0xD9);
-  emit(0xFF);
-}
-
-
-void Assembler::fsin() {
-  EnsureSpace ensure_space(this);
-  emit(0xD9);
-  emit(0xFE);
-}
-
-
-void Assembler::fptan() {
-  EnsureSpace ensure_space(this);
-  emit(0xD9);
-  emit(0xF2);
-}
-
-
-void Assembler::fyl2x() {
-  EnsureSpace ensure_space(this);
-  emit(0xD9);
-  emit(0xF1);
-}
-
-
-void Assembler::f2xm1() {
-  EnsureSpace ensure_space(this);
-  emit(0xD9);
-  emit(0xF0);
-}
-
-
-void Assembler::fscale() {
-  EnsureSpace ensure_space(this);
-  emit(0xD9);
-  emit(0xFD);
-}
-
-
-void Assembler::fninit() {
-  EnsureSpace ensure_space(this);
-  emit(0xDB);
-  emit(0xE3);
-}
-
-
-void Assembler::fadd(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xDC, 0xC0, i);
-}
-
-
-void Assembler::fsub(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xDC, 0xE8, i);
-}
-
-
-void Assembler::fisub_s(const Operand& adr) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(adr);
-  emit(0xDA);
-  emit_operand(4, adr);
-}
-
-
-void Assembler::fmul(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xDC, 0xC8, i);
-}
-
-
-void Assembler::fdiv(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xDC, 0xF8, i);
-}
-
-
-void Assembler::faddp(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xDE, 0xC0, i);
-}
-
-
-void Assembler::fsubp(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xDE, 0xE8, i);
-}
-
-
-void Assembler::fsubrp(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xDE, 0xE0, i);
-}
-
-
-void Assembler::fmulp(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xDE, 0xC8, i);
-}
-
-
-void Assembler::fdivp(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xDE, 0xF8, i);
-}
-
-
-void Assembler::fprem() {
-  EnsureSpace ensure_space(this);
-  emit(0xD9);
-  emit(0xF8);
-}
-
-
-void Assembler::fprem1() {
-  EnsureSpace ensure_space(this);
-  emit(0xD9);
-  emit(0xF5);
-}
-
-
-void Assembler::fxch(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xD9, 0xC8, i);
-}
-
-
-void Assembler::fincstp() {
-  EnsureSpace ensure_space(this);
-  emit(0xD9);
-  emit(0xF7);
-}
-
-
-void Assembler::ffree(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xDD, 0xC0, i);
-}
-
-
-void Assembler::ftst() {
-  EnsureSpace ensure_space(this);
-  emit(0xD9);
-  emit(0xE4);
-}
-
-
-void Assembler::fucomp(int i) {
-  EnsureSpace ensure_space(this);
-  emit_farith(0xDD, 0xE8, i);
-}
-
-
-void Assembler::fucompp() {
-  EnsureSpace ensure_space(this);
-  emit(0xDA);
-  emit(0xE9);
-}
-
-
-void Assembler::fucomi(int i) {
-  EnsureSpace ensure_space(this);
-  emit(0xDB);
-  emit(0xE8 + i);
-}
-
-
-void Assembler::fucomip() {
-  EnsureSpace ensure_space(this);
-  emit(0xDF);
-  emit(0xE9);
-}
-
-
-void Assembler::fcompp() {
-  EnsureSpace ensure_space(this);
-  emit(0xDE);
-  emit(0xD9);
-}
-
-
-void Assembler::fnstsw_ax() {
-  EnsureSpace ensure_space(this);
-  emit(0xDF);
-  emit(0xE0);
-}
-
-
-void Assembler::fwait() {
-  EnsureSpace ensure_space(this);
-  emit(0x9B);
-}
-
-
-void Assembler::frndint() {
-  EnsureSpace ensure_space(this);
-  emit(0xD9);
-  emit(0xFC);
-}
-
-
-void Assembler::fnclex() {
-  EnsureSpace ensure_space(this);
-  emit(0xDB);
-  emit(0xE2);
-}
-
-
-void Assembler::sahf() {
-  // TODO(X64): Test for presence. Not all 64-bit intel CPU's have sahf
-  // in 64-bit mode. Test CpuID.
-  DCHECK(IsEnabled(SAHF));
-  EnsureSpace ensure_space(this);
-  emit(0x9E);
-}
-
-
-void Assembler::emit_farith(int b1, int b2, int i) {
-  DCHECK(is_uint8(b1) && is_uint8(b2));  // wrong opcode
-  DCHECK(is_uint3(i));  // illegal stack offset
-  emit(b1);
-  emit(b2 + i);
-}
-
-
-// SSE operations.
-
-void Assembler::andps(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x54);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::andps(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x54);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::orps(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x56);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::orps(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x56);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::xorps(XMMRegister dst, XMMRegister src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x57);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::xorps(XMMRegister dst, const Operand& src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x57);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::addps(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x58);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::addps(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x58);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::subps(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5C);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::subps(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5C);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::mulps(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x59);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::mulps(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x59);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::divps(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5E);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::divps(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5E);
-  emit_sse_operand(dst, src);
-}
-
-
-// SSE 2 operations.
-
-void Assembler::movd(XMMRegister dst, Register src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x6E);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::movd(XMMRegister dst, const Operand& src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x6E);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::movd(Register dst, XMMRegister src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(src, dst);
-  emit(0x0F);
-  emit(0x7E);
-  emit_sse_operand(src, dst);
-}
-
-
-void Assembler::movq(XMMRegister dst, Register src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0x6E);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::movq(Register dst, XMMRegister src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_rex_64(src, dst);
-  emit(0x0F);
-  emit(0x7E);
-  emit_sse_operand(src, dst);
-}
-
-
-void Assembler::movq(XMMRegister dst, XMMRegister src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  if (dst.low_bits() == 4) {
-    // Avoid unnecessary SIB byte.
-    emit(0xF3);
-    emit_optional_rex_32(dst, src);
-    emit(0x0F);
-    emit(0x7E);
-    emit_sse_operand(dst, src);
-  } else {
-    emit(0x66);
-    emit_optional_rex_32(src, dst);
-    emit(0x0F);
-    emit(0xD6);
-    emit_sse_operand(src, dst);
-  }
-}
-
-
-void Assembler::movdqa(const Operand& dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_rex_64(src, dst);
-  emit(0x0F);
-  emit(0x7F);
-  emit_sse_operand(src, dst);
-}
-
-
-void Assembler::movdqa(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0x6F);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::movdqu(const Operand& dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_rex_64(src, dst);
-  emit(0x0F);
-  emit(0x7F);
-  emit_sse_operand(src, dst);
-}
-
-
-void Assembler::movdqu(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0x6F);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::extractps(Register dst, XMMRegister src, byte imm8) {
-  DCHECK(IsEnabled(SSE4_1));
-  DCHECK(is_uint8(imm8));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(src, dst);
-  emit(0x0F);
-  emit(0x3A);
-  emit(0x17);
-  emit_sse_operand(src, dst);
-  emit(imm8);
-}
-
-void Assembler::pextrb(Register dst, XMMRegister src, int8_t imm8) {
-  DCHECK(IsEnabled(SSE4_1));
-  DCHECK(is_uint8(imm8));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(src, dst);
-  emit(0x0F);
-  emit(0x3A);
-  emit(0x14);
-  emit_sse_operand(src, dst);
-  emit(imm8);
-}
-
-void Assembler::pextrb(const Operand& dst, XMMRegister src, int8_t imm8) {
-  DCHECK(IsEnabled(SSE4_1));
-  DCHECK(is_uint8(imm8));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(src, dst);
-  emit(0x0F);
-  emit(0x3A);
-  emit(0x14);
-  emit_sse_operand(src, dst);
-  emit(imm8);
-}
-
-void Assembler::pinsrw(XMMRegister dst, Register src, int8_t imm8) {
-  DCHECK(is_uint8(imm8));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0xC4);
-  emit_sse_operand(dst, src);
-  emit(imm8);
-}
-
-void Assembler::pinsrw(XMMRegister dst, const Operand& src, int8_t imm8) {
-  DCHECK(is_uint8(imm8));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0xC4);
-  emit_sse_operand(dst, src);
-  emit(imm8);
-}
-
-void Assembler::pextrw(Register dst, XMMRegister src, int8_t imm8) {
-  DCHECK(IsEnabled(SSE4_1));
-  DCHECK(is_uint8(imm8));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(src, dst);
-  emit(0x0F);
-  emit(0x3A);
-  emit(0x15);
-  emit_sse_operand(src, dst);
-  emit(imm8);
-}
-
-void Assembler::pextrw(const Operand& dst, XMMRegister src, int8_t imm8) {
-  DCHECK(IsEnabled(SSE4_1));
-  DCHECK(is_uint8(imm8));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(src, dst);
-  emit(0x0F);
-  emit(0x3A);
-  emit(0x15);
-  emit_sse_operand(src, dst);
-  emit(imm8);
-}
-
-void Assembler::pextrd(Register dst, XMMRegister src, int8_t imm8) {
-  DCHECK(IsEnabled(SSE4_1));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(src, dst);
-  emit(0x0F);
-  emit(0x3A);
-  emit(0x16);
-  emit_sse_operand(src, dst);
-  emit(imm8);
-}
-
-void Assembler::pextrd(const Operand& dst, XMMRegister src, int8_t imm8) {
-  DCHECK(IsEnabled(SSE4_1));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(src, dst);
-  emit(0x0F);
-  emit(0x3A);
-  emit(0x16);
-  emit_sse_operand(src, dst);
-  emit(imm8);
-}
-
-void Assembler::pinsrd(XMMRegister dst, Register src, int8_t imm8) {
-  DCHECK(IsEnabled(SSE4_1));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x3A);
-  emit(0x22);
-  emit_sse_operand(dst, src);
-  emit(imm8);
-}
-
-
-void Assembler::pinsrd(XMMRegister dst, const Operand& src, int8_t imm8) {
-  DCHECK(IsEnabled(SSE4_1));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x3A);
-  emit(0x22);
-  emit_sse_operand(dst, src);
-  emit(imm8);
-}
-
-void Assembler::pinsrb(XMMRegister dst, Register src, int8_t imm8) {
-  DCHECK(IsEnabled(SSE4_1));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x3A);
-  emit(0x20);
-  emit_sse_operand(dst, src);
-  emit(imm8);
-}
-
-void Assembler::pinsrb(XMMRegister dst, const Operand& src, int8_t imm8) {
-  DCHECK(IsEnabled(SSE4_1));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x3A);
-  emit(0x20);
-  emit_sse_operand(dst, src);
-  emit(imm8);
-}
-
-void Assembler::insertps(XMMRegister dst, XMMRegister src, byte imm8) {
-  DCHECK(CpuFeatures::IsSupported(SSE4_1));
-  DCHECK(is_uint8(imm8));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x3A);
-  emit(0x21);
-  emit_sse_operand(dst, src);
-  emit(imm8);
-}
-
-void Assembler::movsd(const Operand& dst, XMMRegister src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF2);  // double
-  emit_optional_rex_32(src, dst);
-  emit(0x0F);
-  emit(0x11);  // store
-  emit_sse_operand(src, dst);
-}
-
-
-void Assembler::movsd(XMMRegister dst, XMMRegister src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF2);  // double
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x10);  // load
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::movsd(XMMRegister dst, const Operand& src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF2);  // double
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x10);  // load
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::movaps(XMMRegister dst, XMMRegister src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  if (src.low_bits() == 4) {
-    // Try to avoid an unnecessary SIB byte.
-    emit_optional_rex_32(src, dst);
-    emit(0x0F);
-    emit(0x29);
-    emit_sse_operand(src, dst);
-  } else {
-    emit_optional_rex_32(dst, src);
-    emit(0x0F);
-    emit(0x28);
-    emit_sse_operand(dst, src);
-  }
-}
-
-
-void Assembler::shufps(XMMRegister dst, XMMRegister src, byte imm8) {
-  DCHECK(is_uint8(imm8));
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0xC6);
-  emit_sse_operand(dst, src);
-  emit(imm8);
-}
-
-
-void Assembler::movapd(XMMRegister dst, XMMRegister src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  if (src.low_bits() == 4) {
-    // Try to avoid an unnecessary SIB byte.
-    emit(0x66);
-    emit_optional_rex_32(src, dst);
-    emit(0x0F);
-    emit(0x29);
-    emit_sse_operand(src, dst);
-  } else {
-    emit(0x66);
-    emit_optional_rex_32(dst, src);
-    emit(0x0F);
-    emit(0x28);
-    emit_sse_operand(dst, src);
-  }
-}
-
-
-void Assembler::movupd(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x10);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::movupd(const Operand& dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(src, dst);
-  emit(0x0F);
-  emit(0x11);
-  emit_sse_operand(src, dst);
-}
-
-void Assembler::addss(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x58);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::addss(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x58);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::subss(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5C);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::subss(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5C);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::mulss(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x59);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::mulss(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x59);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::divss(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5E);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::divss(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5E);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::maxss(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5F);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::maxss(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5F);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::minss(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5D);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::minss(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5D);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::sqrtss(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x51);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::sqrtss(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x51);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::ucomiss(XMMRegister dst, XMMRegister src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x2E);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::ucomiss(XMMRegister dst, const Operand& src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x2E);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::movss(XMMRegister dst, XMMRegister src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF3);  // single
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x10);  // load
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::movss(XMMRegister dst, const Operand& src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF3);  // single
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x10);  // load
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::movss(const Operand& src, XMMRegister dst) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF3);  // single
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x11);  // store
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::psllq(XMMRegister reg, byte imm8) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(reg);
-  emit(0x0F);
-  emit(0x73);
-  emit_sse_operand(rsi, reg);  // rsi == 6
-  emit(imm8);
-}
-
-
-void Assembler::psrlq(XMMRegister reg, byte imm8) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(reg);
-  emit(0x0F);
-  emit(0x73);
-  emit_sse_operand(rdx, reg);  // rdx == 2
-  emit(imm8);
-}
-
-void Assembler::psllw(XMMRegister reg, byte imm8) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(reg);
-  emit(0x0F);
-  emit(0x71);
-  emit_sse_operand(rsi, reg);  // rsi == 6
-  emit(imm8);
-}
-
-void Assembler::pslld(XMMRegister reg, byte imm8) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(reg);
-  emit(0x0F);
-  emit(0x72);
-  emit_sse_operand(rsi, reg);  // rsi == 6
-  emit(imm8);
-}
-
-void Assembler::psrlw(XMMRegister reg, byte imm8) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(reg);
-  emit(0x0F);
-  emit(0x71);
-  emit_sse_operand(rdx, reg);  // rdx == 2
-  emit(imm8);
-}
-
-void Assembler::psrld(XMMRegister reg, byte imm8) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(reg);
-  emit(0x0F);
-  emit(0x72);
-  emit_sse_operand(rdx, reg);  // rdx == 2
-  emit(imm8);
-}
-
-void Assembler::psraw(XMMRegister reg, byte imm8) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(reg);
-  emit(0x0F);
-  emit(0x71);
-  emit_sse_operand(rsp, reg);  // rsp == 4
-  emit(imm8);
-}
-
-void Assembler::psrad(XMMRegister reg, byte imm8) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(reg);
-  emit(0x0F);
-  emit(0x72);
-  emit_sse_operand(rsp, reg);  // rsp == 4
-  emit(imm8);
-}
-
-void Assembler::cmpps(XMMRegister dst, XMMRegister src, int8_t cmp) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0xC2);
-  emit_sse_operand(dst, src);
-  emit(cmp);
-}
-
-void Assembler::cmpps(XMMRegister dst, const Operand& src, int8_t cmp) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0xC2);
-  emit_sse_operand(dst, src);
-  emit(cmp);
-}
-
-void Assembler::cmppd(XMMRegister dst, XMMRegister src, int8_t cmp) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x66);
-  emit(0x0F);
-  emit(0xC2);
-  emit_sse_operand(dst, src);
-  emit(cmp);
-}
-
-void Assembler::cmppd(XMMRegister dst, const Operand& src, int8_t cmp) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x66);
-  emit(0x0F);
-  emit(0xC2);
-  emit_sse_operand(dst, src);
-  emit(cmp);
-}
-
-void Assembler::cvttss2si(Register dst, const Operand& src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x2C);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::cvttss2si(Register dst, XMMRegister src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x2C);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::cvttsd2si(Register dst, const Operand& src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x2C);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::cvttsd2si(Register dst, XMMRegister src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x2C);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::cvttss2siq(Register dst, XMMRegister src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0x2C);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::cvttss2siq(Register dst, const Operand& src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0x2C);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::cvttsd2siq(Register dst, XMMRegister src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0x2C);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::cvttsd2siq(Register dst, const Operand& src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0x2C);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::cvtlsi2sd(XMMRegister dst, const Operand& src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x2A);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::cvtlsi2sd(XMMRegister dst, Register src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x2A);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::cvtlsi2ss(XMMRegister dst, const Operand& src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x2A);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::cvtlsi2ss(XMMRegister dst, Register src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x2A);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::cvtqsi2ss(XMMRegister dst, const Operand& src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0x2A);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::cvtqsi2ss(XMMRegister dst, Register src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0x2A);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::cvtqsi2sd(XMMRegister dst, const Operand& src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0x2A);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::cvtqsi2sd(XMMRegister dst, Register src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0x2A);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::cvtss2sd(XMMRegister dst, XMMRegister src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5A);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::cvtss2sd(XMMRegister dst, const Operand& src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5A);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::cvtsd2ss(XMMRegister dst, XMMRegister src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5A);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::cvtsd2ss(XMMRegister dst, const Operand& src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5A);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::cvtsd2si(Register dst, XMMRegister src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x2D);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::cvtsd2siq(Register dst, XMMRegister src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0x2D);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::addsd(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x58);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::addsd(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x58);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::mulsd(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x59);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::mulsd(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x59);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::subsd(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5C);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::subsd(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5C);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::divsd(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5E);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::divsd(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5E);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::maxsd(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5F);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::maxsd(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5F);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::minsd(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5D);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::minsd(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5D);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::andpd(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x54);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::andpd(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x54);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::orpd(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x56);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::orpd(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x56);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::xorpd(XMMRegister dst, XMMRegister src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x57);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::xorpd(XMMRegister dst, const Operand& src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x57);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::sqrtsd(XMMRegister dst, XMMRegister src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x51);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::sqrtsd(XMMRegister dst, const Operand& src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x51);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::haddps(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x7C);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::haddps(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x7C);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::ucomisd(XMMRegister dst, XMMRegister src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x2E);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::ucomisd(XMMRegister dst, const Operand& src) {
-  DCHECK(!IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x2E);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::cmpltsd(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0xC2);
-  emit_sse_operand(dst, src);
-  emit(0x01);  // LT == 1
-}
-
-
-void Assembler::roundss(XMMRegister dst, XMMRegister src, RoundingMode mode) {
-  DCHECK(!IsEnabled(AVX));
-  DCHECK(IsEnabled(SSE4_1));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x3A);
-  emit(0x0A);
-  emit_sse_operand(dst, src);
-  // Mask precision exception.
-  emit(static_cast<byte>(mode) | 0x8);
-}
-
-
-void Assembler::roundsd(XMMRegister dst, XMMRegister src, RoundingMode mode) {
-  DCHECK(!IsEnabled(AVX));
-  DCHECK(IsEnabled(SSE4_1));
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x3A);
-  emit(0x0B);
-  emit_sse_operand(dst, src);
-  // Mask precision exception.
-  emit(static_cast<byte>(mode) | 0x8);
-}
-
-
-void Assembler::movmskpd(Register dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x50);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::movmskps(Register dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x50);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::punpckldq(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x62);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::punpckldq(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x62);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::punpckhdq(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x6A);
-  emit_sse_operand(dst, src);
-}
-
-
-// AVX instructions
-void Assembler::vfmasd(byte op, XMMRegister dst, XMMRegister src1,
-                       XMMRegister src2) {
-  DCHECK(IsEnabled(FMA3));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(dst, src1, src2, kLIG, k66, k0F38, kW1);
-  emit(op);
-  emit_sse_operand(dst, src2);
-}
-
-
-void Assembler::vfmasd(byte op, XMMRegister dst, XMMRegister src1,
-                       const Operand& src2) {
-  DCHECK(IsEnabled(FMA3));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(dst, src1, src2, kLIG, k66, k0F38, kW1);
-  emit(op);
-  emit_sse_operand(dst, src2);
-}
-
-
-void Assembler::vfmass(byte op, XMMRegister dst, XMMRegister src1,
-                       XMMRegister src2) {
-  DCHECK(IsEnabled(FMA3));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(dst, src1, src2, kLIG, k66, k0F38, kW0);
-  emit(op);
-  emit_sse_operand(dst, src2);
-}
-
-
-void Assembler::vfmass(byte op, XMMRegister dst, XMMRegister src1,
-                       const Operand& src2) {
-  DCHECK(IsEnabled(FMA3));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(dst, src1, src2, kLIG, k66, k0F38, kW0);
-  emit(op);
-  emit_sse_operand(dst, src2);
-}
-
-
-void Assembler::vmovd(XMMRegister dst, Register src) {
-  DCHECK(IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  XMMRegister isrc = XMMRegister::from_code(src.code());
-  emit_vex_prefix(dst, xmm0, isrc, kL128, k66, k0F, kW0);
-  emit(0x6E);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::vmovd(XMMRegister dst, const Operand& src) {
-  DCHECK(IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(dst, xmm0, src, kL128, k66, k0F, kW0);
-  emit(0x6E);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::vmovd(Register dst, XMMRegister src) {
-  DCHECK(IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  XMMRegister idst = XMMRegister::from_code(dst.code());
-  emit_vex_prefix(src, xmm0, idst, kL128, k66, k0F, kW0);
-  emit(0x7E);
-  emit_sse_operand(src, dst);
-}
-
-
-void Assembler::vmovq(XMMRegister dst, Register src) {
-  DCHECK(IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  XMMRegister isrc = XMMRegister::from_code(src.code());
-  emit_vex_prefix(dst, xmm0, isrc, kL128, k66, k0F, kW1);
-  emit(0x6E);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::vmovq(XMMRegister dst, const Operand& src) {
-  DCHECK(IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(dst, xmm0, src, kL128, k66, k0F, kW1);
-  emit(0x6E);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::vmovq(Register dst, XMMRegister src) {
-  DCHECK(IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  XMMRegister idst = XMMRegister::from_code(dst.code());
-  emit_vex_prefix(src, xmm0, idst, kL128, k66, k0F, kW1);
-  emit(0x7E);
-  emit_sse_operand(src, dst);
-}
-
-void Assembler::vinstr(byte op, XMMRegister dst, XMMRegister src1,
-                       XMMRegister src2, SIMDPrefix pp, LeadingOpcode m,
-                       VexW w) {
-  DCHECK(IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(dst, src1, src2, kLIG, pp, m, w);
-  emit(op);
-  emit_sse_operand(dst, src2);
-}
-
-void Assembler::vinstr(byte op, XMMRegister dst, XMMRegister src1,
-                       const Operand& src2, SIMDPrefix pp, LeadingOpcode m,
-                       VexW w) {
-  DCHECK(IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(dst, src1, src2, kLIG, pp, m, w);
-  emit(op);
-  emit_sse_operand(dst, src2);
-}
-
-
-void Assembler::vps(byte op, XMMRegister dst, XMMRegister src1,
-                    XMMRegister src2) {
-  DCHECK(IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(dst, src1, src2, kL128, kNone, k0F, kWIG);
-  emit(op);
-  emit_sse_operand(dst, src2);
-}
-
-
-void Assembler::vps(byte op, XMMRegister dst, XMMRegister src1,
-                    const Operand& src2) {
-  DCHECK(IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(dst, src1, src2, kL128, kNone, k0F, kWIG);
-  emit(op);
-  emit_sse_operand(dst, src2);
-}
-
-
-void Assembler::vpd(byte op, XMMRegister dst, XMMRegister src1,
-                    XMMRegister src2) {
-  DCHECK(IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(dst, src1, src2, kL128, k66, k0F, kWIG);
-  emit(op);
-  emit_sse_operand(dst, src2);
-}
-
-
-void Assembler::vpd(byte op, XMMRegister dst, XMMRegister src1,
-                    const Operand& src2) {
-  DCHECK(IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(dst, src1, src2, kL128, k66, k0F, kWIG);
-  emit(op);
-  emit_sse_operand(dst, src2);
-}
-
-
-void Assembler::vucomiss(XMMRegister dst, XMMRegister src) {
-  DCHECK(IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(dst, xmm0, src, kLIG, kNone, k0F, kWIG);
-  emit(0x2E);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::vucomiss(XMMRegister dst, const Operand& src) {
-  DCHECK(IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(dst, xmm0, src, kLIG, kNone, k0F, kWIG);
-  emit(0x2E);
-  emit_sse_operand(dst, src);
-}
-
-
-void Assembler::vss(byte op, XMMRegister dst, XMMRegister src1,
-                    XMMRegister src2) {
-  DCHECK(IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(dst, src1, src2, kLIG, kF3, k0F, kWIG);
-  emit(op);
-  emit_sse_operand(dst, src2);
-}
-
-
-void Assembler::vss(byte op, XMMRegister dst, XMMRegister src1,
-                    const Operand& src2) {
-  DCHECK(IsEnabled(AVX));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(dst, src1, src2, kLIG, kF3, k0F, kWIG);
-  emit(op);
-  emit_sse_operand(dst, src2);
-}
-
-
-void Assembler::bmi1q(byte op, Register reg, Register vreg, Register rm) {
-  DCHECK(IsEnabled(BMI1));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(reg, vreg, rm, kLZ, kNone, k0F38, kW1);
-  emit(op);
-  emit_modrm(reg, rm);
-}
-
-
-void Assembler::bmi1q(byte op, Register reg, Register vreg, const Operand& rm) {
-  DCHECK(IsEnabled(BMI1));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(reg, vreg, rm, kLZ, kNone, k0F38, kW1);
-  emit(op);
-  emit_operand(reg, rm);
-}
-
-
-void Assembler::bmi1l(byte op, Register reg, Register vreg, Register rm) {
-  DCHECK(IsEnabled(BMI1));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(reg, vreg, rm, kLZ, kNone, k0F38, kW0);
-  emit(op);
-  emit_modrm(reg, rm);
-}
-
-
-void Assembler::bmi1l(byte op, Register reg, Register vreg, const Operand& rm) {
-  DCHECK(IsEnabled(BMI1));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(reg, vreg, rm, kLZ, kNone, k0F38, kW0);
-  emit(op);
-  emit_operand(reg, rm);
-}
-
-
-void Assembler::tzcntq(Register dst, Register src) {
-  DCHECK(IsEnabled(BMI1));
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0xBC);
-  emit_modrm(dst, src);
-}
-
-
-void Assembler::tzcntq(Register dst, const Operand& src) {
-  DCHECK(IsEnabled(BMI1));
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0xBC);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::tzcntl(Register dst, Register src) {
-  DCHECK(IsEnabled(BMI1));
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0xBC);
-  emit_modrm(dst, src);
-}
-
-
-void Assembler::tzcntl(Register dst, const Operand& src) {
-  DCHECK(IsEnabled(BMI1));
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0xBC);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::lzcntq(Register dst, Register src) {
-  DCHECK(IsEnabled(LZCNT));
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0xBD);
-  emit_modrm(dst, src);
-}
-
-
-void Assembler::lzcntq(Register dst, const Operand& src) {
-  DCHECK(IsEnabled(LZCNT));
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0xBD);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::lzcntl(Register dst, Register src) {
-  DCHECK(IsEnabled(LZCNT));
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0xBD);
-  emit_modrm(dst, src);
-}
-
-
-void Assembler::lzcntl(Register dst, const Operand& src) {
-  DCHECK(IsEnabled(LZCNT));
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0xBD);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::popcntq(Register dst, Register src) {
-  DCHECK(IsEnabled(POPCNT));
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0xB8);
-  emit_modrm(dst, src);
-}
-
-
-void Assembler::popcntq(Register dst, const Operand& src) {
-  DCHECK(IsEnabled(POPCNT));
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_rex_64(dst, src);
-  emit(0x0F);
-  emit(0xB8);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::popcntl(Register dst, Register src) {
-  DCHECK(IsEnabled(POPCNT));
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0xB8);
-  emit_modrm(dst, src);
-}
-
-
-void Assembler::popcntl(Register dst, const Operand& src) {
-  DCHECK(IsEnabled(POPCNT));
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0xB8);
-  emit_operand(dst, src);
-}
-
-
-void Assembler::bmi2q(SIMDPrefix pp, byte op, Register reg, Register vreg,
-                      Register rm) {
-  DCHECK(IsEnabled(BMI2));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(reg, vreg, rm, kLZ, pp, k0F38, kW1);
-  emit(op);
-  emit_modrm(reg, rm);
-}
-
-
-void Assembler::bmi2q(SIMDPrefix pp, byte op, Register reg, Register vreg,
-                      const Operand& rm) {
-  DCHECK(IsEnabled(BMI2));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(reg, vreg, rm, kLZ, pp, k0F38, kW1);
-  emit(op);
-  emit_operand(reg, rm);
-}
-
-
-void Assembler::bmi2l(SIMDPrefix pp, byte op, Register reg, Register vreg,
-                      Register rm) {
-  DCHECK(IsEnabled(BMI2));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(reg, vreg, rm, kLZ, pp, k0F38, kW0);
-  emit(op);
-  emit_modrm(reg, rm);
-}
-
-
-void Assembler::bmi2l(SIMDPrefix pp, byte op, Register reg, Register vreg,
-                      const Operand& rm) {
-  DCHECK(IsEnabled(BMI2));
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(reg, vreg, rm, kLZ, pp, k0F38, kW0);
-  emit(op);
-  emit_operand(reg, rm);
-}
-
-
-void Assembler::rorxq(Register dst, Register src, byte imm8) {
-  DCHECK(IsEnabled(BMI2));
-  DCHECK(is_uint8(imm8));
-  Register vreg = Register::from_code<0>();  // VEX.vvvv unused
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(dst, vreg, src, kLZ, kF2, k0F3A, kW1);
-  emit(0xF0);
-  emit_modrm(dst, src);
-  emit(imm8);
-}
-
-
-void Assembler::rorxq(Register dst, const Operand& src, byte imm8) {
-  DCHECK(IsEnabled(BMI2));
-  DCHECK(is_uint8(imm8));
-  Register vreg = Register::from_code<0>();  // VEX.vvvv unused
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(dst, vreg, src, kLZ, kF2, k0F3A, kW1);
-  emit(0xF0);
-  emit_operand(dst, src);
-  emit(imm8);
-}
-
-
-void Assembler::rorxl(Register dst, Register src, byte imm8) {
-  DCHECK(IsEnabled(BMI2));
-  DCHECK(is_uint8(imm8));
-  Register vreg = Register::from_code<0>();  // VEX.vvvv unused
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(dst, vreg, src, kLZ, kF2, k0F3A, kW0);
-  emit(0xF0);
-  emit_modrm(dst, src);
-  emit(imm8);
-}
-
-
-void Assembler::rorxl(Register dst, const Operand& src, byte imm8) {
-  DCHECK(IsEnabled(BMI2));
-  DCHECK(is_uint8(imm8));
-  Register vreg = Register::from_code<0>();  // VEX.vvvv unused
-  EnsureSpace ensure_space(this);
-  emit_vex_prefix(dst, vreg, src, kLZ, kF2, k0F3A, kW0);
-  emit(0xF0);
-  emit_operand(dst, src);
-  emit(imm8);
-}
-
-void Assembler::pause() {
-  emit(0xF3);
-  emit(0x90);
-}
-
-void Assembler::minps(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5D);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::minps(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5D);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::maxps(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5F);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::maxps(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5F);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::rcpps(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x53);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::rcpps(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x53);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::rsqrtps(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x52);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::rsqrtps(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x52);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::sqrtps(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x51);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::sqrtps(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x51);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::cvtdq2ps(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5B);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::cvtdq2ps(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x5B);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::movups(XMMRegister dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  if (src.low_bits() == 4) {
-    // Try to avoid an unnecessary SIB byte.
-    emit_optional_rex_32(src, dst);
-    emit(0x0F);
-    emit(0x11);
-    emit_sse_operand(src, dst);
-  } else {
-    emit_optional_rex_32(dst, src);
-    emit(0x0F);
-    emit(0x10);
-    emit_sse_operand(dst, src);
-  }
-}
-
-void Assembler::movups(XMMRegister dst, const Operand& src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x10);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::movups(const Operand& dst, XMMRegister src) {
-  EnsureSpace ensure_space(this);
-  emit_optional_rex_32(src, dst);
-  emit(0x0F);
-  emit(0x11);
-  emit_sse_operand(src, dst);
-}
-
-void Assembler::sse2_instr(XMMRegister dst, XMMRegister src, byte prefix,
-                           byte escape, byte opcode) {
-  EnsureSpace ensure_space(this);
-  emit(prefix);
-  emit_optional_rex_32(dst, src);
-  emit(escape);
-  emit(opcode);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::sse2_instr(XMMRegister dst, const Operand& src, byte prefix,
-                           byte escape, byte opcode) {
-  EnsureSpace ensure_space(this);
-  emit(prefix);
-  emit_optional_rex_32(dst, src);
-  emit(escape);
-  emit(opcode);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::ssse3_instr(XMMRegister dst, XMMRegister src, byte prefix,
-                            byte escape1, byte escape2, byte opcode) {
-  DCHECK(IsEnabled(SSSE3));
-  EnsureSpace ensure_space(this);
-  emit(prefix);
-  emit_optional_rex_32(dst, src);
-  emit(escape1);
-  emit(escape2);
-  emit(opcode);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::ssse3_instr(XMMRegister dst, const Operand& src, byte prefix,
-                            byte escape1, byte escape2, byte opcode) {
-  DCHECK(IsEnabled(SSSE3));
-  EnsureSpace ensure_space(this);
-  emit(prefix);
-  emit_optional_rex_32(dst, src);
-  emit(escape1);
-  emit(escape2);
-  emit(opcode);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::sse4_instr(XMMRegister dst, XMMRegister src, byte prefix,
-                           byte escape1, byte escape2, byte opcode) {
-  DCHECK(IsEnabled(SSE4_1));
-  EnsureSpace ensure_space(this);
-  emit(prefix);
-  emit_optional_rex_32(dst, src);
-  emit(escape1);
-  emit(escape2);
-  emit(opcode);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::sse4_instr(XMMRegister dst, const Operand& src, byte prefix,
-                           byte escape1, byte escape2, byte opcode) {
-  DCHECK(IsEnabled(SSE4_1));
-  EnsureSpace ensure_space(this);
-  emit(prefix);
-  emit_optional_rex_32(dst, src);
-  emit(escape1);
-  emit(escape2);
-  emit(opcode);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::lddqu(XMMRegister dst, const Operand& src) {
-  DCHECK(IsEnabled(SSE3));
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0xF0);
-  emit_sse_operand(dst, src);
-}
-
-void Assembler::psrldq(XMMRegister dst, uint8_t shift) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst);
-  emit(0x0F);
-  emit(0x73);
-  emit_sse_operand(dst);
-  emit(shift);
-}
-
-void Assembler::pshufhw(XMMRegister dst, XMMRegister src, uint8_t shuffle) {
-  EnsureSpace ensure_space(this);
-  emit(0xF3);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x70);
-  emit_sse_operand(dst, src);
-  emit(shuffle);
-}
-
-void Assembler::pshuflw(XMMRegister dst, XMMRegister src, uint8_t shuffle) {
-  EnsureSpace ensure_space(this);
-  emit(0xF2);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x70);
-  emit_sse_operand(dst, src);
-  emit(shuffle);
-}
-
-void Assembler::pshufd(XMMRegister dst, XMMRegister src, uint8_t shuffle) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x70);
-  emit_sse_operand(dst, src);
-  emit(shuffle);
-}
-
-void Assembler::pshufd(XMMRegister dst, const Operand& src, uint8_t shuffle) {
-  EnsureSpace ensure_space(this);
-  emit(0x66);
-  emit_optional_rex_32(dst, src);
-  emit(0x0F);
-  emit(0x70);
-  emit_sse_operand(dst, src);
-  emit(shuffle);
-}
-
-void Assembler::emit_sse_operand(XMMRegister reg, const Operand& adr) {
-  Register ireg = Register::from_code(reg.code());
-  emit_operand(ireg, adr);
-}
-
-
-void Assembler::emit_sse_operand(Register reg, const Operand& adr) {
-  emit_operand(reg, adr);
-}
-
-
-void Assembler::emit_sse_operand(XMMRegister dst, XMMRegister src) {
-  emit(0xC0 | (dst.low_bits() << 3) | src.low_bits());
-}
-
-
-void Assembler::emit_sse_operand(XMMRegister dst, Register src) {
-  emit(0xC0 | (dst.low_bits() << 3) | src.low_bits());
-}
-
-
-void Assembler::emit_sse_operand(Register dst, XMMRegister src) {
-  emit(0xC0 | (dst.low_bits() << 3) | src.low_bits());
-}
-
-void Assembler::emit_sse_operand(XMMRegister dst) {
-  emit(0xD8 | dst.low_bits());
-}
-
-void Assembler::db(uint8_t data) {
-  EnsureSpace ensure_space(this);
-  emit(data);
-}
-
-
-void Assembler::dd(uint32_t data) {
-  EnsureSpace ensure_space(this);
-  emitl(data);
-}
-
-
-void Assembler::dq(uint64_t data) {
-  EnsureSpace ensure_space(this);
-  emitq(data);
-}
-
-
-void Assembler::dq(Label* label) {
-  EnsureSpace ensure_space(this);
-  if (label->is_bound()) {
-    internal_reference_positions_.push_back(pc_offset());
-    emitp(buffer_ + label->pos(), RelocInfo::INTERNAL_REFERENCE);
-  } else {
-    RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE);
-    emitl(0);  // Zero for the first 32bit marks it as 64bit absolute address.
-    if (label->is_linked()) {
-      emitl(label->pos());
-      label->link_to(pc_offset() - sizeof(int32_t));
-    } else {
-      DCHECK(label->is_unused());
-      int32_t current = pc_offset();
-      emitl(current);
-      label->link_to(current);
-    }
-  }
-}
-
-
-// Relocation information implementations.
-
-void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
-  DCHECK(!RelocInfo::IsNone(rmode));
-  // Don't record external references unless the heap will be serialized.
-  if (rmode == RelocInfo::EXTERNAL_REFERENCE &&
-      !serializer_enabled() && !emit_debug_code()) {
-    return;
-  }
-  RelocInfo rinfo(pc_, rmode, data, nullptr);
-  reloc_info_writer.Write(&rinfo);
-}
-
-const int RelocInfo::kApplyMask =
-    RelocInfo::kCodeTargetMask | 1 << RelocInfo::RUNTIME_ENTRY |
-    1 << RelocInfo::INTERNAL_REFERENCE | 1 << RelocInfo::WASM_CALL;
-
-bool RelocInfo::IsCodedSpecially() {
-  // The deserializer needs to know whether a pointer is specially coded.  Being
-  // specially coded on x64 means that it is a relative 32 bit address, as used
-  // by branch instructions.
-  return (1 << rmode_) & kApplyMask;
-}
-
-
-bool RelocInfo::IsInConstantPool() {
-  return false;
-}
-
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_X64
diff --git a/src/v8/src/x64/assembler-x64.h b/src/v8/src/x64/assembler-x64.h
deleted file mode 100644
index 1c838b9..0000000
--- a/src/v8/src/x64/assembler-x64.h
+++ /dev/null
@@ -1,2481 +0,0 @@
-// Copyright (c) 1994-2006 Sun Microsystems Inc.
-// 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.
-//
-// - Redistribution 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 Sun Microsystems or the names of 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.
-
-// The original source code covered by the above license above has been
-// modified significantly by Google Inc.
-// Copyright 2012 the V8 project authors. All rights reserved.
-
-// A lightweight X64 Assembler.
-
-#ifndef V8_X64_ASSEMBLER_X64_H_
-#define V8_X64_ASSEMBLER_X64_H_
-
-#include <deque>
-#include <forward_list>
-#include <vector>
-
-#include "src/assembler.h"
-#include "src/x64/sse-instr.h"
-
-namespace v8 {
-namespace internal {
-
-// Utility functions
-
-#define GENERAL_REGISTERS(V) \
-  V(rax)                     \
-  V(rcx)                     \
-  V(rdx)                     \
-  V(rbx)                     \
-  V(rsp)                     \
-  V(rbp)                     \
-  V(rsi)                     \
-  V(rdi)                     \
-  V(r8)                      \
-  V(r9)                      \
-  V(r10)                     \
-  V(r11)                     \
-  V(r12)                     \
-  V(r13)                     \
-  V(r14)                     \
-  V(r15)
-
-#define ALLOCATABLE_GENERAL_REGISTERS(V) \
-  V(rax)                                 \
-  V(rbx)                                 \
-  V(rdx)                                 \
-  V(rcx)                                 \
-  V(rsi)                                 \
-  V(rdi)                                 \
-  V(r8)                                  \
-  V(r9)                                  \
-  V(r11)                                 \
-  V(r12)                                 \
-  V(r14)                                 \
-  V(r15)
-
-// The length of pushq(rbp), movp(rbp, rsp), Push(rsi) and Push(rdi).
-constexpr int kNoCodeAgeSequenceLength = kPointerSize == kInt64Size ? 6 : 17;
-
-enum RegisterCode {
-#define REGISTER_CODE(R) kRegCode_##R,
-  GENERAL_REGISTERS(REGISTER_CODE)
-#undef REGISTER_CODE
-      kRegAfterLast
-};
-
-class Register : public RegisterBase<Register, kRegAfterLast> {
- public:
-  bool is_byte_register() const { return reg_code_ <= 3; }
-  // Return the high bit of the register code as a 0 or 1.  Used often
-  // when constructing the REX prefix byte.
-  int high_bit() const { return reg_code_ >> 3; }
-  // Return the 3 low bits of the register code.  Used when encoding registers
-  // in modR/M, SIB, and opcode bytes.
-  int low_bits() const { return reg_code_ & 0x7; }
-
- private:
-  friend class RegisterBase<Register, kRegAfterLast>;
-  explicit constexpr Register(int code) : RegisterBase(code) {}
-};
-
-static_assert(IS_TRIVIALLY_COPYABLE(Register) &&
-                  sizeof(Register) == sizeof(int),
-              "Register can efficiently be passed by value");
-
-#define DECLARE_REGISTER(R) \
-  constexpr Register R = Register::from_code<kRegCode_##R>();
-GENERAL_REGISTERS(DECLARE_REGISTER)
-#undef DECLARE_REGISTER
-constexpr Register no_reg = Register::no_reg();
-
-constexpr int kNumRegs = 16;
-
-constexpr RegList kJSCallerSaved =
-    Register::ListOf<rax, rcx, rdx,
-                     rbx,  // used as a caller-saved register in JavaScript code
-                     rdi   // callee function
-                     >();
-
-constexpr int kNumJSCallerSaved = 5;
-
-// Number of registers for which space is reserved in safepoints.
-constexpr int kNumSafepointRegisters = 16;
-
-#ifdef _WIN64
-  // Windows calling convention
-constexpr Register arg_reg_1 = rcx;
-constexpr Register arg_reg_2 = rdx;
-constexpr Register arg_reg_3 = r8;
-constexpr Register arg_reg_4 = r9;
-#else
-  // AMD64 calling convention
-constexpr Register arg_reg_1 = rdi;
-constexpr Register arg_reg_2 = rsi;
-constexpr Register arg_reg_3 = rdx;
-constexpr Register arg_reg_4 = rcx;
-#endif  // _WIN64
-
-
-#define DOUBLE_REGISTERS(V) \
-  V(xmm0)                   \
-  V(xmm1)                   \
-  V(xmm2)                   \
-  V(xmm3)                   \
-  V(xmm4)                   \
-  V(xmm5)                   \
-  V(xmm6)                   \
-  V(xmm7)                   \
-  V(xmm8)                   \
-  V(xmm9)                   \
-  V(xmm10)                  \
-  V(xmm11)                  \
-  V(xmm12)                  \
-  V(xmm13)                  \
-  V(xmm14)                  \
-  V(xmm15)
-
-#define FLOAT_REGISTERS DOUBLE_REGISTERS
-#define SIMD128_REGISTERS DOUBLE_REGISTERS
-
-#define ALLOCATABLE_DOUBLE_REGISTERS(V) \
-  V(xmm0)                               \
-  V(xmm1)                               \
-  V(xmm2)                               \
-  V(xmm3)                               \
-  V(xmm4)                               \
-  V(xmm5)                               \
-  V(xmm6)                               \
-  V(xmm7)                               \
-  V(xmm8)                               \
-  V(xmm9)                               \
-  V(xmm10)                              \
-  V(xmm11)                              \
-  V(xmm12)                              \
-  V(xmm13)                              \
-  V(xmm14)
-
-constexpr bool kPadArguments = false;
-constexpr bool kSimpleFPAliasing = true;
-constexpr bool kSimdMaskRegisters = false;
-
-enum DoubleRegisterCode {
-#define REGISTER_CODE(R) kDoubleCode_##R,
-  DOUBLE_REGISTERS(REGISTER_CODE)
-#undef REGISTER_CODE
-      kDoubleAfterLast
-};
-
-class XMMRegister : public RegisterBase<XMMRegister, kDoubleAfterLast> {
- public:
-  // Return the high bit of the register code as a 0 or 1.  Used often
-  // when constructing the REX prefix byte.
-  int high_bit() const { return reg_code_ >> 3; }
-  // Return the 3 low bits of the register code.  Used when encoding registers
-  // in modR/M, SIB, and opcode bytes.
-  int low_bits() const { return reg_code_ & 0x7; }
-
- private:
-  friend class RegisterBase<XMMRegister, kDoubleAfterLast>;
-  explicit constexpr XMMRegister(int code) : RegisterBase(code) {}
-};
-
-static_assert(IS_TRIVIALLY_COPYABLE(XMMRegister) &&
-                  sizeof(XMMRegister) == sizeof(int),
-              "XMMRegister can efficiently be passed by value");
-
-typedef XMMRegister FloatRegister;
-
-typedef XMMRegister DoubleRegister;
-
-typedef XMMRegister Simd128Register;
-
-#define DECLARE_REGISTER(R) \
-  constexpr DoubleRegister R = DoubleRegister::from_code<kDoubleCode_##R>();
-DOUBLE_REGISTERS(DECLARE_REGISTER)
-#undef DECLARE_REGISTER
-constexpr DoubleRegister no_double_reg = DoubleRegister::no_reg();
-
-enum Condition {
-  // any value < 0 is considered no_condition
-  no_condition  = -1,
-
-  overflow      =  0,
-  no_overflow   =  1,
-  below         =  2,
-  above_equal   =  3,
-  equal         =  4,
-  not_equal     =  5,
-  below_equal   =  6,
-  above         =  7,
-  negative      =  8,
-  positive      =  9,
-  parity_even   = 10,
-  parity_odd    = 11,
-  less          = 12,
-  greater_equal = 13,
-  less_equal    = 14,
-  greater       = 15,
-
-  // Fake conditions that are handled by the
-  // opcodes using them.
-  always        = 16,
-  never         = 17,
-  // aliases
-  carry         = below,
-  not_carry     = above_equal,
-  zero          = equal,
-  not_zero      = not_equal,
-  sign          = negative,
-  not_sign      = positive,
-  last_condition = greater
-};
-
-
-// Returns the equivalent of !cc.
-// Negation of the default no_condition (-1) results in a non-default
-// no_condition value (-2). As long as tests for no_condition check
-// for condition < 0, this will work as expected.
-inline Condition NegateCondition(Condition cc) {
-  return static_cast<Condition>(cc ^ 1);
-}
-
-
-// Commute a condition such that {a cond b == b cond' a}.
-inline Condition CommuteCondition(Condition cc) {
-  switch (cc) {
-    case below:
-      return above;
-    case above:
-      return below;
-    case above_equal:
-      return below_equal;
-    case below_equal:
-      return above_equal;
-    case less:
-      return greater;
-    case greater:
-      return less;
-    case greater_equal:
-      return less_equal;
-    case less_equal:
-      return greater_equal;
-    default:
-      return cc;
-  }
-}
-
-
-enum RoundingMode {
-  kRoundToNearest = 0x0,
-  kRoundDown = 0x1,
-  kRoundUp = 0x2,
-  kRoundToZero = 0x3
-};
-
-
-// -----------------------------------------------------------------------------
-// Machine instruction Immediates
-
-class Immediate BASE_EMBEDDED {
- public:
-  explicit Immediate(int32_t value) : value_(value) {}
-  explicit Immediate(int32_t value, RelocInfo::Mode rmode)
-      : value_(value), rmode_(rmode) {}
-  explicit Immediate(Smi* value) {
-    DCHECK(SmiValuesAre31Bits());  // Only available for 31-bit SMI.
-    value_ = static_cast<int32_t>(reinterpret_cast<intptr_t>(value));
-  }
-
- private:
-  int32_t value_;
-  RelocInfo::Mode rmode_ = RelocInfo::NONE32;
-
-  friend class Assembler;
-};
-
-
-// -----------------------------------------------------------------------------
-// Machine instruction Operands
-
-enum ScaleFactor {
-  times_1 = 0,
-  times_2 = 1,
-  times_4 = 2,
-  times_8 = 3,
-  times_int_size = times_4,
-  times_pointer_size = (kPointerSize == 8) ? times_8 : times_4
-};
-
-
-class Operand BASE_EMBEDDED {
- public:
-  // [base + disp/r]
-  Operand(Register base, int32_t disp);
-
-  // [base + index*scale + disp/r]
-  Operand(Register base,
-          Register index,
-          ScaleFactor scale,
-          int32_t disp);
-
-  // [index*scale + disp/r]
-  Operand(Register index,
-          ScaleFactor scale,
-          int32_t disp);
-
-  // Offset from existing memory operand.
-  // Offset is added to existing displacement as 32-bit signed values and
-  // this must not overflow.
-  Operand(const Operand& base, int32_t offset);
-
-  // [rip + disp/r]
-  explicit Operand(Label* label);
-
-  // Checks whether either base or index register is the given register.
-  // Does not check the "reg" part of the Operand.
-  bool AddressUsesRegister(Register reg) const;
-
-  // Queries related to the size of the generated instruction.
-  // Whether the generated instruction will have a REX prefix.
-  bool requires_rex() const { return rex_ != 0; }
-  // Size of the ModR/M, SIB and displacement parts of the generated
-  // instruction.
-  int operand_size() const { return len_; }
-
- private:
-  byte rex_;
-  byte buf_[9];
-  // The number of bytes of buf_ in use.
-  byte len_;
-
-  // Set the ModR/M byte without an encoded 'reg' register. The
-  // register is encoded later as part of the emit_operand operation.
-  // set_modrm can be called before or after set_sib and set_disp*.
-  inline void set_modrm(int mod, Register rm);
-
-  // Set the SIB byte if one is needed. Sets the length to 2 rather than 1.
-  inline void set_sib(ScaleFactor scale, Register index, Register base);
-
-  // Adds operand displacement fields (offsets added to the memory address).
-  // Needs to be called after set_sib, not before it.
-  inline void set_disp8(int disp);
-  inline void set_disp32(int disp);
-  inline void set_disp64(int64_t disp);  // for labels.
-
-  friend class Assembler;
-};
-
-#define ASSEMBLER_INSTRUCTION_LIST(V) \
-  V(add)                              \
-  V(and)                              \
-  V(cmp)                              \
-  V(cmpxchg)                          \
-  V(dec)                              \
-  V(idiv)                             \
-  V(div)                              \
-  V(imul)                             \
-  V(inc)                              \
-  V(lea)                              \
-  V(mov)                              \
-  V(movzxb)                           \
-  V(movzxw)                           \
-  V(neg)                              \
-  V(not)                              \
-  V(or)                               \
-  V(repmovs)                          \
-  V(sbb)                              \
-  V(sub)                              \
-  V(test)                             \
-  V(xchg)                             \
-  V(xor)
-
-// Shift instructions on operands/registers with kPointerSize, kInt32Size and
-// kInt64Size.
-#define SHIFT_INSTRUCTION_LIST(V) \
-  V(rol, 0x0)                     \
-  V(ror, 0x1)                     \
-  V(rcl, 0x2)                     \
-  V(rcr, 0x3)                     \
-  V(shl, 0x4)                     \
-  V(shr, 0x5)                     \
-  V(sar, 0x7)
-
-class Assembler : public AssemblerBase {
- private:
-  // We check before assembling an instruction that there is sufficient
-  // space to write an instruction and its relocation information.
-  // The relocation writer's position must be kGap bytes above the end of
-  // the generated instructions. This leaves enough space for the
-  // longest possible x64 instruction, 15 bytes, and the longest possible
-  // relocation information encoding, RelocInfoWriter::kMaxLength == 16.
-  // (There is a 15 byte limit on x64 instruction length that rules out some
-  // otherwise valid instructions.)
-  // This allows for a single, fast space check per instruction.
-  static constexpr int kGap = 32;
-
- public:
-  // Create an assembler. Instructions and relocation information are emitted
-  // into a buffer, with the instructions starting from the beginning and the
-  // relocation information starting from the end of the buffer. See CodeDesc
-  // for a detailed comment on the layout (globals.h).
-  //
-  // If the provided buffer is nullptr, the assembler allocates and grows its
-  // own buffer, and buffer_size determines the initial buffer size. The buffer
-  // is owned by the assembler and deallocated upon destruction of the
-  // assembler.
-  //
-  // If the provided buffer is not nullptr, the assembler uses the provided
-  // buffer for code generation and assumes its size to be buffer_size. If the
-  // buffer is too small, a fatal error occurs. No deallocation of the buffer is
-  // done upon destruction of the assembler.
-  Assembler(Isolate* isolate, void* buffer, int buffer_size)
-      : Assembler(IsolateData(isolate), buffer, buffer_size) {}
-  Assembler(IsolateData isolate_data, void* buffer, int buffer_size);
-  virtual ~Assembler() {}
-
-  // GetCode emits any pending (non-emitted) code and fills the descriptor
-  // desc. GetCode() is idempotent; it returns the same result if no other
-  // Assembler functions are invoked in between GetCode() calls.
-  void GetCode(Isolate* isolate, CodeDesc* desc);
-
-  // Read/Modify the code target in the relative branch/call instruction at pc.
-  // On the x64 architecture, we use relative jumps with a 32-bit displacement
-  // to jump to other Code objects in the Code space in the heap.
-  // Jumps to C functions are done indirectly through a 64-bit register holding
-  // the absolute address of the target.
-  // These functions convert between absolute Addresses of Code objects and
-  // the relative displacements stored in the code.
-  // The isolate argument is unused (and may be nullptr) when skipping flushing.
-  static inline Address target_address_at(Address pc, Address constant_pool);
-  static inline void set_target_address_at(
-      Isolate* isolate, Address pc, Address constant_pool, Address target,
-      ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED);
-
-  // Return the code target address at a call site from the return address
-  // of that call in the instruction stream.
-  static inline Address target_address_from_return_address(Address pc);
-
-  // This sets the branch destination (which is in the instruction on x64).
-  // This is for calls and branches within generated code.
-  inline static void deserialization_set_special_target_at(
-      Isolate* isolate, Address instruction_payload, Code* code,
-      Address target);
-
-  // This sets the internal reference at the pc.
-  inline static void deserialization_set_target_internal_reference_at(
-      Isolate* isolate, Address pc, Address target,
-      RelocInfo::Mode mode = RelocInfo::INTERNAL_REFERENCE);
-
-  static inline RelocInfo::Mode RelocInfoNone() {
-    if (kPointerSize == kInt64Size) {
-      return RelocInfo::NONE64;
-    } else {
-      DCHECK_EQ(kPointerSize, kInt32Size);
-      return RelocInfo::NONE32;
-    }
-  }
-
-  inline Handle<Code> code_target_object_handle_at(Address pc);
-  inline Address runtime_entry_at(Address pc);
-  // Number of bytes taken up by the branch target in the code.
-  static constexpr int kSpecialTargetSize = 4;  // 32-bit displacement.
-  // Distance between the address of the code target in the call instruction
-  // and the return address pushed on the stack.
-  static constexpr int kCallTargetAddressOffset = 4;  // 32-bit displacement.
-  // The length of call(kScratchRegister).
-  static constexpr int kCallScratchRegisterInstructionLength = 3;
-  // The length of call(Immediate32).
-  static constexpr int kShortCallInstructionLength = 5;
-  // The length of movq(kScratchRegister, address).
-  static constexpr int kMoveAddressIntoScratchRegisterInstructionLength =
-      2 + kPointerSize;
-  // The length of movq(kScratchRegister, address) and call(kScratchRegister).
-  static constexpr int kCallSequenceLength =
-      kMoveAddressIntoScratchRegisterInstructionLength +
-      kCallScratchRegisterInstructionLength;
-
-  // One byte opcode for test eax,0xXXXXXXXX.
-  static constexpr byte kTestEaxByte = 0xA9;
-  // One byte opcode for test al, 0xXX.
-  static constexpr byte kTestAlByte = 0xA8;
-  // One byte opcode for nop.
-  static constexpr byte kNopByte = 0x90;
-
-  // One byte prefix for a short conditional jump.
-  static constexpr byte kJccShortPrefix = 0x70;
-  static constexpr byte kJncShortOpcode = kJccShortPrefix | not_carry;
-  static constexpr byte kJcShortOpcode = kJccShortPrefix | carry;
-  static constexpr byte kJnzShortOpcode = kJccShortPrefix | not_zero;
-  static constexpr byte kJzShortOpcode = kJccShortPrefix | zero;
-
-  // VEX prefix encodings.
-  enum SIMDPrefix { kNone = 0x0, k66 = 0x1, kF3 = 0x2, kF2 = 0x3 };
-  enum VectorLength { kL128 = 0x0, kL256 = 0x4, kLIG = kL128, kLZ = kL128 };
-  enum VexW { kW0 = 0x0, kW1 = 0x80, kWIG = kW0 };
-  enum LeadingOpcode { k0F = 0x1, k0F38 = 0x2, k0F3A = 0x3 };
-
-  // ---------------------------------------------------------------------------
-  // Code generation
-  //
-  // Function names correspond one-to-one to x64 instruction mnemonics.
-  // Unless specified otherwise, instructions operate on 64-bit operands.
-  //
-  // If we need versions of an assembly instruction that operate on different
-  // width arguments, we add a single-letter suffix specifying the width.
-  // This is done for the following instructions: mov, cmp, inc, dec,
-  // add, sub, and test.
-  // There are no versions of these instructions without the suffix.
-  // - Instructions on 8-bit (byte) operands/registers have a trailing 'b'.
-  // - Instructions on 16-bit (word) operands/registers have a trailing 'w'.
-  // - Instructions on 32-bit (doubleword) operands/registers use 'l'.
-  // - Instructions on 64-bit (quadword) operands/registers use 'q'.
-  // - Instructions on operands/registers with pointer size use 'p'.
-
-  STATIC_ASSERT(kPointerSize == kInt64Size || kPointerSize == kInt32Size);
-
-#define DECLARE_INSTRUCTION(instruction)                \
-  template<class P1>                                    \
-  void instruction##p(P1 p1) {                          \
-    emit_##instruction(p1, kPointerSize);               \
-  }                                                     \
-                                                        \
-  template<class P1>                                    \
-  void instruction##l(P1 p1) {                          \
-    emit_##instruction(p1, kInt32Size);                 \
-  }                                                     \
-                                                        \
-  template<class P1>                                    \
-  void instruction##q(P1 p1) {                          \
-    emit_##instruction(p1, kInt64Size);                 \
-  }                                                     \
-                                                        \
-  template<class P1, class P2>                          \
-  void instruction##p(P1 p1, P2 p2) {                   \
-    emit_##instruction(p1, p2, kPointerSize);           \
-  }                                                     \
-                                                        \
-  template<class P1, class P2>                          \
-  void instruction##l(P1 p1, P2 p2) {                   \
-    emit_##instruction(p1, p2, kInt32Size);             \
-  }                                                     \
-                                                        \
-  template<class P1, class P2>                          \
-  void instruction##q(P1 p1, P2 p2) {                   \
-    emit_##instruction(p1, p2, kInt64Size);             \
-  }                                                     \
-                                                        \
-  template<class P1, class P2, class P3>                \
-  void instruction##p(P1 p1, P2 p2, P3 p3) {            \
-    emit_##instruction(p1, p2, p3, kPointerSize);       \
-  }                                                     \
-                                                        \
-  template<class P1, class P2, class P3>                \
-  void instruction##l(P1 p1, P2 p2, P3 p3) {            \
-    emit_##instruction(p1, p2, p3, kInt32Size);         \
-  }                                                     \
-                                                        \
-  template<class P1, class P2, class P3>                \
-  void instruction##q(P1 p1, P2 p2, P3 p3) {            \
-    emit_##instruction(p1, p2, p3, kInt64Size);         \
-  }
-  ASSEMBLER_INSTRUCTION_LIST(DECLARE_INSTRUCTION)
-#undef DECLARE_INSTRUCTION
-
-  // Insert the smallest number of nop instructions
-  // possible to align the pc offset to a multiple
-  // of m, where m must be a power of 2.
-  void Align(int m);
-  // Insert the smallest number of zero bytes possible to align the pc offset
-  // to a mulitple of m. m must be a power of 2 (>= 2).
-  void DataAlign(int m);
-  void Nop(int bytes = 1);
-  // Aligns code to something that's optimal for a jump target for the platform.
-  void CodeTargetAlign();
-
-  // Stack
-  void pushfq();
-  void popfq();
-
-  void pushq(Immediate value);
-  // Push a 32 bit integer, and guarantee that it is actually pushed as a
-  // 32 bit value, the normal push will optimize the 8 bit case.
-  void pushq_imm32(int32_t imm32);
-  void pushq(Register src);
-  void pushq(const Operand& src);
-
-  void popq(Register dst);
-  void popq(const Operand& dst);
-
-  void enter(Immediate size);
-  void leave();
-
-  // Moves
-  void movb(Register dst, const Operand& src);
-  void movb(Register dst, Immediate imm);
-  void movb(const Operand& dst, Register src);
-  void movb(const Operand& dst, Immediate imm);
-
-  // Move the low 16 bits of a 64-bit register value to a 16-bit
-  // memory location.
-  void movw(Register dst, const Operand& src);
-  void movw(const Operand& dst, Register src);
-  void movw(const Operand& dst, Immediate imm);
-
-  // Move the offset of the label location relative to the current
-  // position (after the move) to the destination.
-  void movl(const Operand& dst, Label* src);
-
-  // Loads a pointer into a register with a relocation mode.
-  void movp(Register dst, void* ptr, RelocInfo::Mode rmode);
-
-  // Load a heap number into a register.
-  // The heap number will not be allocated and embedded into the code right
-  // away. Instead, we emit the load of a dummy object. Later, when calling
-  // Assembler::GetCode, the heap number will be allocated and the code will be
-  // patched by replacing the dummy with the actual object. The RelocInfo for
-  // the embedded object gets already recorded correctly when emitting the dummy
-  // move.
-  void movp_heap_number(Register dst, double value);
-
-  // Loads a 64-bit immediate into a register.
-  void movq(Register dst, int64_t value,
-            RelocInfo::Mode rmode = RelocInfo::NONE64);
-  void movq(Register dst, uint64_t value,
-            RelocInfo::Mode rmode = RelocInfo::NONE64);
-
-  void movsxbl(Register dst, Register src);
-  void movsxbl(Register dst, const Operand& src);
-  void movsxbq(Register dst, Register src);
-  void movsxbq(Register dst, const Operand& src);
-  void movsxwl(Register dst, Register src);
-  void movsxwl(Register dst, const Operand& src);
-  void movsxwq(Register dst, Register src);
-  void movsxwq(Register dst, const Operand& src);
-  void movsxlq(Register dst, Register src);
-  void movsxlq(Register dst, const Operand& src);
-
-  // Repeated moves.
-
-  void repmovsb();
-  void repmovsw();
-  void repmovsp() { emit_repmovs(kPointerSize); }
-  void repmovsl() { emit_repmovs(kInt32Size); }
-  void repmovsq() { emit_repmovs(kInt64Size); }
-
-  // Instruction to load from an immediate 64-bit pointer into RAX.
-  void load_rax(void* ptr, RelocInfo::Mode rmode);
-  void load_rax(ExternalReference ext);
-
-  // Conditional moves.
-  void cmovq(Condition cc, Register dst, Register src);
-  void cmovq(Condition cc, Register dst, const Operand& src);
-  void cmovl(Condition cc, Register dst, Register src);
-  void cmovl(Condition cc, Register dst, const Operand& src);
-
-  void cmpb(Register dst, Immediate src) {
-    immediate_arithmetic_op_8(0x7, dst, src);
-  }
-
-  void cmpb_al(Immediate src);
-
-  void cmpb(Register dst, Register src) {
-    arithmetic_op_8(0x3A, dst, src);
-  }
-
-  void cmpb(Register dst, const Operand& src) {
-    arithmetic_op_8(0x3A, dst, src);
-  }
-
-  void cmpb(const Operand& dst, Register src) {
-    arithmetic_op_8(0x38, src, dst);
-  }
-
-  void cmpb(const Operand& dst, Immediate src) {
-    immediate_arithmetic_op_8(0x7, dst, src);
-  }
-
-  void cmpw(const Operand& dst, Immediate src) {
-    immediate_arithmetic_op_16(0x7, dst, src);
-  }
-
-  void cmpw(Register dst, Immediate src) {
-    immediate_arithmetic_op_16(0x7, dst, src);
-  }
-
-  void cmpw(Register dst, const Operand& src) {
-    arithmetic_op_16(0x3B, dst, src);
-  }
-
-  void cmpw(Register dst, Register src) {
-    arithmetic_op_16(0x3B, dst, src);
-  }
-
-  void cmpw(const Operand& dst, Register src) {
-    arithmetic_op_16(0x39, src, dst);
-  }
-
-  void testb(Register reg, const Operand& op) { testb(op, reg); }
-
-  void testw(Register reg, const Operand& op) { testw(op, reg); }
-
-  void andb(Register dst, Immediate src) {
-    immediate_arithmetic_op_8(0x4, dst, src);
-  }
-
-  void decb(Register dst);
-  void decb(const Operand& dst);
-
-  // Lock prefix.
-  void lock();
-
-  void xchgb(Register reg, const Operand& op);
-  void xchgw(Register reg, const Operand& op);
-
-  void cmpxchgb(const Operand& dst, Register src);
-  void cmpxchgw(const Operand& dst, Register src);
-
-  // Sign-extends rax into rdx:rax.
-  void cqo();
-  // Sign-extends eax into edx:eax.
-  void cdq();
-
-  // Multiply eax by src, put the result in edx:eax.
-  void mull(Register src);
-  void mull(const Operand& src);
-  // Multiply rax by src, put the result in rdx:rax.
-  void mulq(Register src);
-
-#define DECLARE_SHIFT_INSTRUCTION(instruction, subcode)                       \
-  void instruction##p(Register dst, Immediate imm8) {                         \
-    shift(dst, imm8, subcode, kPointerSize);                                  \
-  }                                                                           \
-                                                                              \
-  void instruction##l(Register dst, Immediate imm8) {                         \
-    shift(dst, imm8, subcode, kInt32Size);                                    \
-  }                                                                           \
-                                                                              \
-  void instruction##q(Register dst, Immediate imm8) {                         \
-    shift(dst, imm8, subcode, kInt64Size);                                    \
-  }                                                                           \
-                                                                              \
-  void instruction##p(Operand dst, Immediate imm8) {                          \
-    shift(dst, imm8, subcode, kPointerSize);                                  \
-  }                                                                           \
-                                                                              \
-  void instruction##l(Operand dst, Immediate imm8) {                          \
-    shift(dst, imm8, subcode, kInt32Size);                                    \
-  }                                                                           \
-                                                                              \
-  void instruction##q(Operand dst, Immediate imm8) {                          \
-    shift(dst, imm8, subcode, kInt64Size);                                    \
-  }                                                                           \
-                                                                              \
-  void instruction##p_cl(Register dst) { shift(dst, subcode, kPointerSize); } \
-                                                                              \
-  void instruction##l_cl(Register dst) { shift(dst, subcode, kInt32Size); }   \
-                                                                              \
-  void instruction##q_cl(Register dst) { shift(dst, subcode, kInt64Size); }   \
-                                                                              \
-  void instruction##p_cl(Operand dst) { shift(dst, subcode, kPointerSize); }  \
-                                                                              \
-  void instruction##l_cl(Operand dst) { shift(dst, subcode, kInt32Size); }    \
-                                                                              \
-  void instruction##q_cl(Operand dst) { shift(dst, subcode, kInt64Size); }
-  SHIFT_INSTRUCTION_LIST(DECLARE_SHIFT_INSTRUCTION)
-#undef DECLARE_SHIFT_INSTRUCTION
-
-  // Shifts dst:src left by cl bits, affecting only dst.
-  void shld(Register dst, Register src);
-
-  // Shifts src:dst right by cl bits, affecting only dst.
-  void shrd(Register dst, Register src);
-
-  void store_rax(void* dst, RelocInfo::Mode mode);
-  void store_rax(ExternalReference ref);
-
-  void subb(Register dst, Immediate src) {
-    immediate_arithmetic_op_8(0x5, dst, src);
-  }
-
-  void testb(Register dst, Register src);
-  void testb(Register reg, Immediate mask);
-  void testb(const Operand& op, Immediate mask);
-  void testb(const Operand& op, Register reg);
-
-  void testw(Register dst, Register src);
-  void testw(Register reg, Immediate mask);
-  void testw(const Operand& op, Immediate mask);
-  void testw(const Operand& op, Register reg);
-
-  // Bit operations.
-  void bt(const Operand& dst, Register src);
-  void bts(const Operand& dst, Register src);
-  void bsrq(Register dst, Register src);
-  void bsrq(Register dst, const Operand& src);
-  void bsrl(Register dst, Register src);
-  void bsrl(Register dst, const Operand& src);
-  void bsfq(Register dst, Register src);
-  void bsfq(Register dst, const Operand& src);
-  void bsfl(Register dst, Register src);
-  void bsfl(Register dst, const Operand& src);
-
-  // Miscellaneous
-  void clc();
-  void cld();
-  void cpuid();
-  void hlt();
-  void int3();
-  void nop();
-  void ret(int imm16);
-  void ud2();
-  void setcc(Condition cc, Register reg);
-
-  void pshufw(XMMRegister dst, XMMRegister src, uint8_t shuffle);
-  void pshufw(XMMRegister dst, const Operand& src, uint8_t shuffle);
-
-  // Label operations & relative jumps (PPUM Appendix D)
-  //
-  // Takes a branch opcode (cc) and a label (L) and generates
-  // either a backward branch or a forward branch and links it
-  // to the label fixup chain. Usage:
-  //
-  // Label L;    // unbound label
-  // j(cc, &L);  // forward branch to unbound label
-  // bind(&L);   // bind label to the current pc
-  // j(cc, &L);  // backward branch to bound label
-  // bind(&L);   // illegal: a label may be bound only once
-  //
-  // Note: The same Label can be used for forward and backward branches
-  // but it may be bound only once.
-
-  void bind(Label* L);  // binds an unbound label L to the current code position
-
-  // Calls
-  // Call near relative 32-bit displacement, relative to next instruction.
-  void call(Label* L);
-  void call(Address entry, RelocInfo::Mode rmode);
-  void near_call(Address entry, RelocInfo::Mode rmode);
-  void near_jmp(Address entry, RelocInfo::Mode rmode);
-  void call(CodeStub* stub);
-  void call(Handle<Code> target,
-            RelocInfo::Mode rmode = RelocInfo::CODE_TARGET);
-
-  // Calls directly to the given address using a relative offset.
-  // Should only ever be used in Code objects for calls within the
-  // same Code object. Should not be used when generating new code (use labels),
-  // but only when patching existing code.
-  void call(Address target);
-
-  // Call near absolute indirect, address in register
-  void call(Register adr);
-
-  // Jumps
-  // Jump short or near relative.
-  // Use a 32-bit signed displacement.
-  // Unconditional jump to L
-  void jmp(Label* L, Label::Distance distance = Label::kFar);
-  void jmp(Handle<Code> target, RelocInfo::Mode rmode);
-
-  // Jump near absolute indirect (r64)
-  void jmp(Register adr);
-  void jmp(const Operand& src);
-
-  // Conditional jumps
-  void j(Condition cc,
-         Label* L,
-         Label::Distance distance = Label::kFar);
-  void j(Condition cc, Address entry, RelocInfo::Mode rmode);
-  void j(Condition cc, Handle<Code> target, RelocInfo::Mode rmode);
-
-  // Floating-point operations
-  void fld(int i);
-
-  void fld1();
-  void fldz();
-  void fldpi();
-  void fldln2();
-
-  void fld_s(const Operand& adr);
-  void fld_d(const Operand& adr);
-
-  void fstp_s(const Operand& adr);
-  void fstp_d(const Operand& adr);
-  void fstp(int index);
-
-  void fild_s(const Operand& adr);
-  void fild_d(const Operand& adr);
-
-  void fist_s(const Operand& adr);
-
-  void fistp_s(const Operand& adr);
-  void fistp_d(const Operand& adr);
-
-  void fisttp_s(const Operand& adr);
-  void fisttp_d(const Operand& adr);
-
-  void fabs();
-  void fchs();
-
-  void fadd(int i);
-  void fsub(int i);
-  void fmul(int i);
-  void fdiv(int i);
-
-  void fisub_s(const Operand& adr);
-
-  void faddp(int i = 1);
-  void fsubp(int i = 1);
-  void fsubrp(int i = 1);
-  void fmulp(int i = 1);
-  void fdivp(int i = 1);
-  void fprem();
-  void fprem1();
-
-  void fxch(int i = 1);
-  void fincstp();
-  void ffree(int i = 0);
-
-  void ftst();
-  void fucomp(int i);
-  void fucompp();
-  void fucomi(int i);
-  void fucomip();
-
-  void fcompp();
-  void fnstsw_ax();
-  void fwait();
-  void fnclex();
-
-  void fsin();
-  void fcos();
-  void fptan();
-  void fyl2x();
-  void f2xm1();
-  void fscale();
-  void fninit();
-
-  void frndint();
-
-  void sahf();
-
-  // SSE instructions
-  void addss(XMMRegister dst, XMMRegister src);
-  void addss(XMMRegister dst, const Operand& src);
-  void subss(XMMRegister dst, XMMRegister src);
-  void subss(XMMRegister dst, const Operand& src);
-  void mulss(XMMRegister dst, XMMRegister src);
-  void mulss(XMMRegister dst, const Operand& src);
-  void divss(XMMRegister dst, XMMRegister src);
-  void divss(XMMRegister dst, const Operand& src);
-
-  void maxss(XMMRegister dst, XMMRegister src);
-  void maxss(XMMRegister dst, const Operand& src);
-  void minss(XMMRegister dst, XMMRegister src);
-  void minss(XMMRegister dst, const Operand& src);
-
-  void sqrtss(XMMRegister dst, XMMRegister src);
-  void sqrtss(XMMRegister dst, const Operand& src);
-
-  void ucomiss(XMMRegister dst, XMMRegister src);
-  void ucomiss(XMMRegister dst, const Operand& src);
-  void movaps(XMMRegister dst, XMMRegister src);
-
-  // Don't use this unless it's important to keep the
-  // top half of the destination register unchanged.
-  // Use movaps when moving float values and movd for integer
-  // values in xmm registers.
-  void movss(XMMRegister dst, XMMRegister src);
-
-  void movss(XMMRegister dst, const Operand& src);
-  void movss(const Operand& dst, XMMRegister src);
-  void shufps(XMMRegister dst, XMMRegister src, byte imm8);
-
-  void cvttss2si(Register dst, const Operand& src);
-  void cvttss2si(Register dst, XMMRegister src);
-  void cvtlsi2ss(XMMRegister dst, const Operand& src);
-  void cvtlsi2ss(XMMRegister dst, Register src);
-
-  void andps(XMMRegister dst, XMMRegister src);
-  void andps(XMMRegister dst, const Operand& src);
-  void orps(XMMRegister dst, XMMRegister src);
-  void orps(XMMRegister dst, const Operand& src);
-  void xorps(XMMRegister dst, XMMRegister src);
-  void xorps(XMMRegister dst, const Operand& src);
-
-  void addps(XMMRegister dst, XMMRegister src);
-  void addps(XMMRegister dst, const Operand& src);
-  void subps(XMMRegister dst, XMMRegister src);
-  void subps(XMMRegister dst, const Operand& src);
-  void mulps(XMMRegister dst, XMMRegister src);
-  void mulps(XMMRegister dst, const Operand& src);
-  void divps(XMMRegister dst, XMMRegister src);
-  void divps(XMMRegister dst, const Operand& src);
-
-  void movmskps(Register dst, XMMRegister src);
-
-  void vinstr(byte op, XMMRegister dst, XMMRegister src1, XMMRegister src2,
-              SIMDPrefix pp, LeadingOpcode m, VexW w);
-  void vinstr(byte op, XMMRegister dst, XMMRegister src1, const Operand& src2,
-              SIMDPrefix pp, LeadingOpcode m, VexW w);
-
-  // SSE2 instructions
-  void sse2_instr(XMMRegister dst, XMMRegister src, byte prefix, byte escape,
-                  byte opcode);
-  void sse2_instr(XMMRegister dst, const Operand& src, byte prefix, byte escape,
-                  byte opcode);
-#define DECLARE_SSE2_INSTRUCTION(instruction, prefix, escape, opcode) \
-  void instruction(XMMRegister dst, XMMRegister src) {                \
-    sse2_instr(dst, src, 0x##prefix, 0x##escape, 0x##opcode);         \
-  }                                                                   \
-  void instruction(XMMRegister dst, const Operand& src) {             \
-    sse2_instr(dst, src, 0x##prefix, 0x##escape, 0x##opcode);         \
-  }
-
-  SSE2_INSTRUCTION_LIST(DECLARE_SSE2_INSTRUCTION)
-#undef DECLARE_SSE2_INSTRUCTION
-
-#define DECLARE_SSE2_AVX_INSTRUCTION(instruction, prefix, escape, opcode)    \
-  void v##instruction(XMMRegister dst, XMMRegister src1, XMMRegister src2) { \
-    vinstr(0x##opcode, dst, src1, src2, k##prefix, k##escape, kW0);          \
-  }                                                                          \
-  void v##instruction(XMMRegister dst, XMMRegister src1,                     \
-                      const Operand& src2) {                                 \
-    vinstr(0x##opcode, dst, src1, src2, k##prefix, k##escape, kW0);          \
-  }
-
-  SSE2_INSTRUCTION_LIST(DECLARE_SSE2_AVX_INSTRUCTION)
-#undef DECLARE_SSE2_AVX_INSTRUCTION
-
-  // SSE3
-  void lddqu(XMMRegister dst, const Operand& src);
-
-  // SSSE3
-  void ssse3_instr(XMMRegister dst, XMMRegister src, byte prefix, byte escape1,
-                   byte escape2, byte opcode);
-  void ssse3_instr(XMMRegister dst, const Operand& src, byte prefix,
-                   byte escape1, byte escape2, byte opcode);
-
-#define DECLARE_SSSE3_INSTRUCTION(instruction, prefix, escape1, escape2,     \
-                                  opcode)                                    \
-  void instruction(XMMRegister dst, XMMRegister src) {                       \
-    ssse3_instr(dst, src, 0x##prefix, 0x##escape1, 0x##escape2, 0x##opcode); \
-  }                                                                          \
-  void instruction(XMMRegister dst, const Operand& src) {                    \
-    ssse3_instr(dst, src, 0x##prefix, 0x##escape1, 0x##escape2, 0x##opcode); \
-  }
-
-  SSSE3_INSTRUCTION_LIST(DECLARE_SSSE3_INSTRUCTION)
-#undef DECLARE_SSSE3_INSTRUCTION
-
-  // SSE4
-  void sse4_instr(XMMRegister dst, XMMRegister src, byte prefix, byte escape1,
-                  byte escape2, byte opcode);
-  void sse4_instr(XMMRegister dst, const Operand& src, byte prefix,
-                  byte escape1, byte escape2, byte opcode);
-#define DECLARE_SSE4_INSTRUCTION(instruction, prefix, escape1, escape2,     \
-                                 opcode)                                    \
-  void instruction(XMMRegister dst, XMMRegister src) {                      \
-    sse4_instr(dst, src, 0x##prefix, 0x##escape1, 0x##escape2, 0x##opcode); \
-  }                                                                         \
-  void instruction(XMMRegister dst, const Operand& src) {                   \
-    sse4_instr(dst, src, 0x##prefix, 0x##escape1, 0x##escape2, 0x##opcode); \
-  }
-
-  SSE4_INSTRUCTION_LIST(DECLARE_SSE4_INSTRUCTION)
-#undef DECLARE_SSE4_INSTRUCTION
-
-#define DECLARE_SSE34_AVX_INSTRUCTION(instruction, prefix, escape1, escape2,  \
-                                      opcode)                                 \
-  void v##instruction(XMMRegister dst, XMMRegister src1, XMMRegister src2) {  \
-    vinstr(0x##opcode, dst, src1, src2, k##prefix, k##escape1##escape2, kW0); \
-  }                                                                           \
-  void v##instruction(XMMRegister dst, XMMRegister src1,                      \
-                      const Operand& src2) {                                  \
-    vinstr(0x##opcode, dst, src1, src2, k##prefix, k##escape1##escape2, kW0); \
-  }
-
-  SSSE3_INSTRUCTION_LIST(DECLARE_SSE34_AVX_INSTRUCTION)
-  SSE4_INSTRUCTION_LIST(DECLARE_SSE34_AVX_INSTRUCTION)
-#undef DECLARE_SSE34_AVX_INSTRUCTION
-
-  void movd(XMMRegister dst, Register src);
-  void movd(XMMRegister dst, const Operand& src);
-  void movd(Register dst, XMMRegister src);
-  void movq(XMMRegister dst, Register src);
-  void movq(Register dst, XMMRegister src);
-  void movq(XMMRegister dst, XMMRegister src);
-
-  // Don't use this unless it's important to keep the
-  // top half of the destination register unchanged.
-  // Use movapd when moving double values and movq for integer
-  // values in xmm registers.
-  void movsd(XMMRegister dst, XMMRegister src);
-
-  void movsd(const Operand& dst, XMMRegister src);
-  void movsd(XMMRegister dst, const Operand& src);
-
-  void movdqa(const Operand& dst, XMMRegister src);
-  void movdqa(XMMRegister dst, const Operand& src);
-
-  void movdqu(const Operand& dst, XMMRegister src);
-  void movdqu(XMMRegister dst, const Operand& src);
-
-  void movapd(XMMRegister dst, XMMRegister src);
-  void movupd(XMMRegister dst, const Operand& src);
-  void movupd(const Operand& dst, XMMRegister src);
-
-  void psllq(XMMRegister reg, byte imm8);
-  void psrlq(XMMRegister reg, byte imm8);
-  void psllw(XMMRegister reg, byte imm8);
-  void pslld(XMMRegister reg, byte imm8);
-  void psrlw(XMMRegister reg, byte imm8);
-  void psrld(XMMRegister reg, byte imm8);
-  void psraw(XMMRegister reg, byte imm8);
-  void psrad(XMMRegister reg, byte imm8);
-
-  void cvttsd2si(Register dst, const Operand& src);
-  void cvttsd2si(Register dst, XMMRegister src);
-  void cvttss2siq(Register dst, XMMRegister src);
-  void cvttss2siq(Register dst, const Operand& src);
-  void cvttsd2siq(Register dst, XMMRegister src);
-  void cvttsd2siq(Register dst, const Operand& src);
-
-  void cvtlsi2sd(XMMRegister dst, const Operand& src);
-  void cvtlsi2sd(XMMRegister dst, Register src);
-
-  void cvtqsi2ss(XMMRegister dst, const Operand& src);
-  void cvtqsi2ss(XMMRegister dst, Register src);
-
-  void cvtqsi2sd(XMMRegister dst, const Operand& src);
-  void cvtqsi2sd(XMMRegister dst, Register src);
-
-
-  void cvtss2sd(XMMRegister dst, XMMRegister src);
-  void cvtss2sd(XMMRegister dst, const Operand& src);
-  void cvtsd2ss(XMMRegister dst, XMMRegister src);
-  void cvtsd2ss(XMMRegister dst, const Operand& src);
-
-  void cvtsd2si(Register dst, XMMRegister src);
-  void cvtsd2siq(Register dst, XMMRegister src);
-
-  void addsd(XMMRegister dst, XMMRegister src);
-  void addsd(XMMRegister dst, const Operand& src);
-  void subsd(XMMRegister dst, XMMRegister src);
-  void subsd(XMMRegister dst, const Operand& src);
-  void mulsd(XMMRegister dst, XMMRegister src);
-  void mulsd(XMMRegister dst, const Operand& src);
-  void divsd(XMMRegister dst, XMMRegister src);
-  void divsd(XMMRegister dst, const Operand& src);
-
-  void maxsd(XMMRegister dst, XMMRegister src);
-  void maxsd(XMMRegister dst, const Operand& src);
-  void minsd(XMMRegister dst, XMMRegister src);
-  void minsd(XMMRegister dst, const Operand& src);
-
-  void andpd(XMMRegister dst, XMMRegister src);
-  void andpd(XMMRegister dst, const Operand& src);
-  void orpd(XMMRegister dst, XMMRegister src);
-  void orpd(XMMRegister dst, const Operand& src);
-  void xorpd(XMMRegister dst, XMMRegister src);
-  void xorpd(XMMRegister dst, const Operand& src);
-  void sqrtsd(XMMRegister dst, XMMRegister src);
-  void sqrtsd(XMMRegister dst, const Operand& src);
-
-  void haddps(XMMRegister dst, XMMRegister src);
-  void haddps(XMMRegister dst, const Operand& src);
-
-  void ucomisd(XMMRegister dst, XMMRegister src);
-  void ucomisd(XMMRegister dst, const Operand& src);
-  void cmpltsd(XMMRegister dst, XMMRegister src);
-
-  void movmskpd(Register dst, XMMRegister src);
-
-  void punpckldq(XMMRegister dst, XMMRegister src);
-  void punpckldq(XMMRegister dst, const Operand& src);
-  void punpckhdq(XMMRegister dst, XMMRegister src);
-
-  // SSE 4.1 instruction
-  void insertps(XMMRegister dst, XMMRegister src, byte imm8);
-  void extractps(Register dst, XMMRegister src, byte imm8);
-  void pextrb(Register dst, XMMRegister src, int8_t imm8);
-  void pextrb(const Operand& dst, XMMRegister src, int8_t imm8);
-  void pextrw(Register dst, XMMRegister src, int8_t imm8);
-  void pextrw(const Operand& dst, XMMRegister src, int8_t imm8);
-  void pextrd(Register dst, XMMRegister src, int8_t imm8);
-  void pextrd(const Operand& dst, XMMRegister src, int8_t imm8);
-  void pinsrb(XMMRegister dst, Register src, int8_t imm8);
-  void pinsrb(XMMRegister dst, const Operand& src, int8_t imm8);
-  void pinsrw(XMMRegister dst, Register src, int8_t imm8);
-  void pinsrw(XMMRegister dst, const Operand& src, int8_t imm8);
-  void pinsrd(XMMRegister dst, Register src, int8_t imm8);
-  void pinsrd(XMMRegister dst, const Operand& src, int8_t imm8);
-
-  void roundss(XMMRegister dst, XMMRegister src, RoundingMode mode);
-  void roundsd(XMMRegister dst, XMMRegister src, RoundingMode mode);
-
-  void cmpps(XMMRegister dst, XMMRegister src, int8_t cmp);
-  void cmpps(XMMRegister dst, const Operand& src, int8_t cmp);
-  void cmppd(XMMRegister dst, XMMRegister src, int8_t cmp);
-  void cmppd(XMMRegister dst, const Operand& src, int8_t cmp);
-
-#define SSE_CMP_P(instr, imm8)                                                \
-  void instr##ps(XMMRegister dst, XMMRegister src) { cmpps(dst, src, imm8); } \
-  void instr##ps(XMMRegister dst, const Operand& src) {                       \
-    cmpps(dst, src, imm8);                                                    \
-  }                                                                           \
-  void instr##pd(XMMRegister dst, XMMRegister src) { cmppd(dst, src, imm8); } \
-  void instr##pd(XMMRegister dst, const Operand& src) { cmppd(dst, src, imm8); }
-
-  SSE_CMP_P(cmpeq, 0x0);
-  SSE_CMP_P(cmplt, 0x1);
-  SSE_CMP_P(cmple, 0x2);
-  SSE_CMP_P(cmpneq, 0x4);
-  SSE_CMP_P(cmpnlt, 0x5);
-  SSE_CMP_P(cmpnle, 0x6);
-
-#undef SSE_CMP_P
-
-  void minps(XMMRegister dst, XMMRegister src);
-  void minps(XMMRegister dst, const Operand& src);
-  void maxps(XMMRegister dst, XMMRegister src);
-  void maxps(XMMRegister dst, const Operand& src);
-  void rcpps(XMMRegister dst, XMMRegister src);
-  void rcpps(XMMRegister dst, const Operand& src);
-  void rsqrtps(XMMRegister dst, XMMRegister src);
-  void rsqrtps(XMMRegister dst, const Operand& src);
-  void sqrtps(XMMRegister dst, XMMRegister src);
-  void sqrtps(XMMRegister dst, const Operand& src);
-  void movups(XMMRegister dst, XMMRegister src);
-  void movups(XMMRegister dst, const Operand& src);
-  void movups(const Operand& dst, XMMRegister src);
-  void psrldq(XMMRegister dst, uint8_t shift);
-  void pshufd(XMMRegister dst, XMMRegister src, uint8_t shuffle);
-  void pshufd(XMMRegister dst, const Operand& src, uint8_t shuffle);
-  void pshufhw(XMMRegister dst, XMMRegister src, uint8_t shuffle);
-  void pshuflw(XMMRegister dst, XMMRegister src, uint8_t shuffle);
-  void cvtdq2ps(XMMRegister dst, XMMRegister src);
-  void cvtdq2ps(XMMRegister dst, const Operand& src);
-
-  // AVX instruction
-  void vfmadd132sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmasd(0x99, dst, src1, src2);
-  }
-  void vfmadd213sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmasd(0xa9, dst, src1, src2);
-  }
-  void vfmadd231sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmasd(0xb9, dst, src1, src2);
-  }
-  void vfmadd132sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmasd(0x99, dst, src1, src2);
-  }
-  void vfmadd213sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmasd(0xa9, dst, src1, src2);
-  }
-  void vfmadd231sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmasd(0xb9, dst, src1, src2);
-  }
-  void vfmsub132sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmasd(0x9b, dst, src1, src2);
-  }
-  void vfmsub213sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmasd(0xab, dst, src1, src2);
-  }
-  void vfmsub231sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmasd(0xbb, dst, src1, src2);
-  }
-  void vfmsub132sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmasd(0x9b, dst, src1, src2);
-  }
-  void vfmsub213sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmasd(0xab, dst, src1, src2);
-  }
-  void vfmsub231sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmasd(0xbb, dst, src1, src2);
-  }
-  void vfnmadd132sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmasd(0x9d, dst, src1, src2);
-  }
-  void vfnmadd213sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmasd(0xad, dst, src1, src2);
-  }
-  void vfnmadd231sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmasd(0xbd, dst, src1, src2);
-  }
-  void vfnmadd132sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmasd(0x9d, dst, src1, src2);
-  }
-  void vfnmadd213sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmasd(0xad, dst, src1, src2);
-  }
-  void vfnmadd231sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmasd(0xbd, dst, src1, src2);
-  }
-  void vfnmsub132sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmasd(0x9f, dst, src1, src2);
-  }
-  void vfnmsub213sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmasd(0xaf, dst, src1, src2);
-  }
-  void vfnmsub231sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmasd(0xbf, dst, src1, src2);
-  }
-  void vfnmsub132sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmasd(0x9f, dst, src1, src2);
-  }
-  void vfnmsub213sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmasd(0xaf, dst, src1, src2);
-  }
-  void vfnmsub231sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmasd(0xbf, dst, src1, src2);
-  }
-  void vfmasd(byte op, XMMRegister dst, XMMRegister src1, XMMRegister src2);
-  void vfmasd(byte op, XMMRegister dst, XMMRegister src1, const Operand& src2);
-
-  void vfmadd132ss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmass(0x99, dst, src1, src2);
-  }
-  void vfmadd213ss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmass(0xa9, dst, src1, src2);
-  }
-  void vfmadd231ss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmass(0xb9, dst, src1, src2);
-  }
-  void vfmadd132ss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmass(0x99, dst, src1, src2);
-  }
-  void vfmadd213ss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmass(0xa9, dst, src1, src2);
-  }
-  void vfmadd231ss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmass(0xb9, dst, src1, src2);
-  }
-  void vfmsub132ss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmass(0x9b, dst, src1, src2);
-  }
-  void vfmsub213ss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmass(0xab, dst, src1, src2);
-  }
-  void vfmsub231ss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmass(0xbb, dst, src1, src2);
-  }
-  void vfmsub132ss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmass(0x9b, dst, src1, src2);
-  }
-  void vfmsub213ss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmass(0xab, dst, src1, src2);
-  }
-  void vfmsub231ss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmass(0xbb, dst, src1, src2);
-  }
-  void vfnmadd132ss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmass(0x9d, dst, src1, src2);
-  }
-  void vfnmadd213ss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmass(0xad, dst, src1, src2);
-  }
-  void vfnmadd231ss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmass(0xbd, dst, src1, src2);
-  }
-  void vfnmadd132ss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmass(0x9d, dst, src1, src2);
-  }
-  void vfnmadd213ss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmass(0xad, dst, src1, src2);
-  }
-  void vfnmadd231ss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmass(0xbd, dst, src1, src2);
-  }
-  void vfnmsub132ss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmass(0x9f, dst, src1, src2);
-  }
-  void vfnmsub213ss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmass(0xaf, dst, src1, src2);
-  }
-  void vfnmsub231ss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vfmass(0xbf, dst, src1, src2);
-  }
-  void vfnmsub132ss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmass(0x9f, dst, src1, src2);
-  }
-  void vfnmsub213ss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmass(0xaf, dst, src1, src2);
-  }
-  void vfnmsub231ss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vfmass(0xbf, dst, src1, src2);
-  }
-  void vfmass(byte op, XMMRegister dst, XMMRegister src1, XMMRegister src2);
-  void vfmass(byte op, XMMRegister dst, XMMRegister src1, const Operand& src2);
-
-  void vmovd(XMMRegister dst, Register src);
-  void vmovd(XMMRegister dst, const Operand& src);
-  void vmovd(Register dst, XMMRegister src);
-  void vmovq(XMMRegister dst, Register src);
-  void vmovq(XMMRegister dst, const Operand& src);
-  void vmovq(Register dst, XMMRegister src);
-
-  void vmovsd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vsd(0x10, dst, src1, src2);
-  }
-  void vmovsd(XMMRegister dst, const Operand& src) {
-    vsd(0x10, dst, xmm0, src);
-  }
-  void vmovsd(const Operand& dst, XMMRegister src) {
-    vsd(0x11, src, xmm0, dst);
-  }
-
-#define AVX_SP_3(instr, opcode) \
-  AVX_S_3(instr, opcode)        \
-  AVX_P_3(instr, opcode)
-
-#define AVX_S_3(instr, opcode)  \
-  AVX_3(instr##ss, opcode, vss) \
-  AVX_3(instr##sd, opcode, vsd)
-
-#define AVX_P_3(instr, opcode)  \
-  AVX_3(instr##ps, opcode, vps) \
-  AVX_3(instr##pd, opcode, vpd)
-
-#define AVX_3(instr, opcode, impl)                                     \
-  void instr(XMMRegister dst, XMMRegister src1, XMMRegister src2) {    \
-    impl(opcode, dst, src1, src2);                                     \
-  }                                                                    \
-  void instr(XMMRegister dst, XMMRegister src1, const Operand& src2) { \
-    impl(opcode, dst, src1, src2);                                     \
-  }
-
-  AVX_SP_3(vsqrt, 0x51);
-  AVX_SP_3(vadd, 0x58);
-  AVX_SP_3(vsub, 0x5c);
-  AVX_SP_3(vmul, 0x59);
-  AVX_SP_3(vdiv, 0x5e);
-  AVX_SP_3(vmin, 0x5d);
-  AVX_SP_3(vmax, 0x5f);
-  AVX_P_3(vand, 0x54);
-  AVX_P_3(vor, 0x56);
-  AVX_P_3(vxor, 0x57);
-  AVX_3(vcvtsd2ss, 0x5a, vsd);
-
-#undef AVX_3
-#undef AVX_S_3
-#undef AVX_P_3
-#undef AVX_SP_3
-
-  void vpsrlq(XMMRegister dst, XMMRegister src, byte imm8) {
-    vpd(0x73, xmm2, dst, src);
-    emit(imm8);
-  }
-  void vpsllq(XMMRegister dst, XMMRegister src, byte imm8) {
-    vpd(0x73, xmm6, dst, src);
-    emit(imm8);
-  }
-  void vcvtss2sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vinstr(0x5a, dst, src1, src2, kF3, k0F, kWIG);
-  }
-  void vcvtss2sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vinstr(0x5a, dst, src1, src2, kF3, k0F, kWIG);
-  }
-  void vcvtlsi2sd(XMMRegister dst, XMMRegister src1, Register src2) {
-    XMMRegister isrc2 = XMMRegister::from_code(src2.code());
-    vinstr(0x2a, dst, src1, isrc2, kF2, k0F, kW0);
-  }
-  void vcvtlsi2sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vinstr(0x2a, dst, src1, src2, kF2, k0F, kW0);
-  }
-  void vcvtlsi2ss(XMMRegister dst, XMMRegister src1, Register src2) {
-    XMMRegister isrc2 = XMMRegister::from_code(src2.code());
-    vinstr(0x2a, dst, src1, isrc2, kF3, k0F, kW0);
-  }
-  void vcvtlsi2ss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vinstr(0x2a, dst, src1, src2, kF3, k0F, kW0);
-  }
-  void vcvtqsi2ss(XMMRegister dst, XMMRegister src1, Register src2) {
-    XMMRegister isrc2 = XMMRegister::from_code(src2.code());
-    vinstr(0x2a, dst, src1, isrc2, kF3, k0F, kW1);
-  }
-  void vcvtqsi2ss(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vinstr(0x2a, dst, src1, src2, kF3, k0F, kW1);
-  }
-  void vcvtqsi2sd(XMMRegister dst, XMMRegister src1, Register src2) {
-    XMMRegister isrc2 = XMMRegister::from_code(src2.code());
-    vinstr(0x2a, dst, src1, isrc2, kF2, k0F, kW1);
-  }
-  void vcvtqsi2sd(XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vinstr(0x2a, dst, src1, src2, kF2, k0F, kW1);
-  }
-  void vcvttss2si(Register dst, XMMRegister src) {
-    XMMRegister idst = XMMRegister::from_code(dst.code());
-    vinstr(0x2c, idst, xmm0, src, kF3, k0F, kW0);
-  }
-  void vcvttss2si(Register dst, const Operand& src) {
-    XMMRegister idst = XMMRegister::from_code(dst.code());
-    vinstr(0x2c, idst, xmm0, src, kF3, k0F, kW0);
-  }
-  void vcvttsd2si(Register dst, XMMRegister src) {
-    XMMRegister idst = XMMRegister::from_code(dst.code());
-    vinstr(0x2c, idst, xmm0, src, kF2, k0F, kW0);
-  }
-  void vcvttsd2si(Register dst, const Operand& src) {
-    XMMRegister idst = XMMRegister::from_code(dst.code());
-    vinstr(0x2c, idst, xmm0, src, kF2, k0F, kW0);
-  }
-  void vcvttss2siq(Register dst, XMMRegister src) {
-    XMMRegister idst = XMMRegister::from_code(dst.code());
-    vinstr(0x2c, idst, xmm0, src, kF3, k0F, kW1);
-  }
-  void vcvttss2siq(Register dst, const Operand& src) {
-    XMMRegister idst = XMMRegister::from_code(dst.code());
-    vinstr(0x2c, idst, xmm0, src, kF3, k0F, kW1);
-  }
-  void vcvttsd2siq(Register dst, XMMRegister src) {
-    XMMRegister idst = XMMRegister::from_code(dst.code());
-    vinstr(0x2c, idst, xmm0, src, kF2, k0F, kW1);
-  }
-  void vcvttsd2siq(Register dst, const Operand& src) {
-    XMMRegister idst = XMMRegister::from_code(dst.code());
-    vinstr(0x2c, idst, xmm0, src, kF2, k0F, kW1);
-  }
-  void vcvtsd2si(Register dst, XMMRegister src) {
-    XMMRegister idst = XMMRegister::from_code(dst.code());
-    vinstr(0x2d, idst, xmm0, src, kF2, k0F, kW0);
-  }
-  void vucomisd(XMMRegister dst, XMMRegister src) {
-    vinstr(0x2e, dst, xmm0, src, k66, k0F, kWIG);
-  }
-  void vucomisd(XMMRegister dst, const Operand& src) {
-    vinstr(0x2e, dst, xmm0, src, k66, k0F, kWIG);
-  }
-  void vroundss(XMMRegister dst, XMMRegister src1, XMMRegister src2,
-                RoundingMode mode) {
-    vinstr(0x0a, dst, src1, src2, k66, k0F3A, kWIG);
-    emit(static_cast<byte>(mode) | 0x8);  // Mask precision exception.
-  }
-  void vroundsd(XMMRegister dst, XMMRegister src1, XMMRegister src2,
-                RoundingMode mode) {
-    vinstr(0x0b, dst, src1, src2, k66, k0F3A, kWIG);
-    emit(static_cast<byte>(mode) | 0x8);  // Mask precision exception.
-  }
-
-  void vsd(byte op, XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vinstr(op, dst, src1, src2, kF2, k0F, kWIG);
-  }
-  void vsd(byte op, XMMRegister dst, XMMRegister src1, const Operand& src2) {
-    vinstr(op, dst, src1, src2, kF2, k0F, kWIG);
-  }
-
-  void vmovss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
-    vss(0x10, dst, src1, src2);
-  }
-  void vmovss(XMMRegister dst, const Operand& src) {
-    vss(0x10, dst, xmm0, src);
-  }
-  void vmovss(const Operand& dst, XMMRegister src) {
-    vss(0x11, src, xmm0, dst);
-  }
-  void vucomiss(XMMRegister dst, XMMRegister src);
-  void vucomiss(XMMRegister dst, const Operand& src);
-  void vss(byte op, XMMRegister dst, XMMRegister src1, XMMRegister src2);
-  void vss(byte op, XMMRegister dst, XMMRegister src1, const Operand& src2);
-
-  void vmovaps(XMMRegister dst, XMMRegister src) { vps(0x28, dst, xmm0, src); }
-  void vmovups(XMMRegister dst, XMMRegister src) { vps(0x10, dst, xmm0, src); }
-  void vmovups(XMMRegister dst, const Operand& src) {
-    vps(0x10, dst, xmm0, src);
-  }
-  void vmovups(const Operand& dst, XMMRegister src) {
-    vps(0x11, src, xmm0, dst);
-  }
-  void vmovapd(XMMRegister dst, XMMRegister src) { vpd(0x28, dst, xmm0, src); }
-  void vmovupd(XMMRegister dst, const Operand& src) {
-    vpd(0x10, dst, xmm0, src);
-  }
-  void vmovupd(const Operand& dst, XMMRegister src) {
-    vpd(0x11, src, xmm0, dst);
-  }
-  void vmovmskps(Register dst, XMMRegister src) {
-    XMMRegister idst = XMMRegister::from_code(dst.code());
-    vps(0x50, idst, xmm0, src);
-  }
-  void vmovmskpd(Register dst, XMMRegister src) {
-    XMMRegister idst = XMMRegister::from_code(dst.code());
-    vpd(0x50, idst, xmm0, src);
-  }
-  void vcmpps(XMMRegister dst, XMMRegister src1, XMMRegister src2, int8_t cmp) {
-    vps(0xC2, dst, src1, src2);
-    emit(cmp);
-  }
-  void vcmpps(XMMRegister dst, XMMRegister src1, const Operand& src2,
-              int8_t cmp) {
-    vps(0xC2, dst, src1, src2);
-    emit(cmp);
-  }
-  void vcmppd(XMMRegister dst, XMMRegister src1, XMMRegister src2, int8_t cmp) {
-    vpd(0xC2, dst, src1, src2);
-    emit(cmp);
-  }
-  void vcmppd(XMMRegister dst, XMMRegister src1, const Operand& src2,
-              int8_t cmp) {
-    vpd(0xC2, dst, src1, src2);
-    emit(cmp);
-  }
-
-#define AVX_CMP_P(instr, imm8)                                             \
-  void instr##ps(XMMRegister dst, XMMRegister src1, XMMRegister src2) {    \
-    vcmpps(dst, src1, src2, imm8);                                         \
-  }                                                                        \
-  void instr##ps(XMMRegister dst, XMMRegister src1, const Operand& src2) { \
-    vcmpps(dst, src1, src2, imm8);                                         \
-  }                                                                        \
-  void instr##pd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {    \
-    vcmppd(dst, src1, src2, imm8);                                         \
-  }                                                                        \
-  void instr##pd(XMMRegister dst, XMMRegister src1, const Operand& src2) { \
-    vcmppd(dst, src1, src2, imm8);                                         \
-  }
-
-  AVX_CMP_P(vcmpeq, 0x0);
-  AVX_CMP_P(vcmplt, 0x1);
-  AVX_CMP_P(vcmple, 0x2);
-  AVX_CMP_P(vcmpneq, 0x4);
-  AVX_CMP_P(vcmpnlt, 0x5);
-  AVX_CMP_P(vcmpnle, 0x6);
-
-#undef AVX_CMP_P
-
-  void vlddqu(XMMRegister dst, const Operand& src) {
-    vinstr(0xF0, dst, xmm0, src, kF2, k0F, kWIG);
-  }
-  void vpsllw(XMMRegister dst, XMMRegister src, int8_t imm8) {
-    vinstr(0x71, xmm6, dst, src, k66, k0F, kWIG);
-    emit(imm8);
-  }
-  void vpsrlw(XMMRegister dst, XMMRegister src, int8_t imm8) {
-    vinstr(0x71, xmm2, dst, src, k66, k0F, kWIG);
-    emit(imm8);
-  }
-  void vpsraw(XMMRegister dst, XMMRegister src, int8_t imm8) {
-    vinstr(0x71, xmm4, dst, src, k66, k0F, kWIG);
-    emit(imm8);
-  }
-  void vpslld(XMMRegister dst, XMMRegister src, int8_t imm8) {
-    vinstr(0x72, xmm6, dst, src, k66, k0F, kWIG);
-    emit(imm8);
-  }
-  void vpsrld(XMMRegister dst, XMMRegister src, int8_t imm8) {
-    vinstr(0x72, xmm2, dst, src, k66, k0F, kWIG);
-    emit(imm8);
-  }
-  void vpsrad(XMMRegister dst, XMMRegister src, int8_t imm8) {
-    vinstr(0x72, xmm4, dst, src, k66, k0F, kWIG);
-    emit(imm8);
-  }
-  void vpextrb(Register dst, XMMRegister src, int8_t imm8) {
-    XMMRegister idst = XMMRegister::from_code(dst.code());
-    vinstr(0x14, src, xmm0, idst, k66, k0F3A, kW0);
-    emit(imm8);
-  }
-  void vpextrb(const Operand& dst, XMMRegister src, int8_t imm8) {
-    vinstr(0x14, src, xmm0, dst, k66, k0F3A, kW0);
-    emit(imm8);
-  }
-  void vpextrw(Register dst, XMMRegister src, int8_t imm8) {
-    XMMRegister idst = XMMRegister::from_code(dst.code());
-    vinstr(0xc5, idst, xmm0, src, k66, k0F, kW0);
-    emit(imm8);
-  }
-  void vpextrw(const Operand& dst, XMMRegister src, int8_t imm8) {
-    vinstr(0x15, src, xmm0, dst, k66, k0F3A, kW0);
-    emit(imm8);
-  }
-  void vpextrd(Register dst, XMMRegister src, int8_t imm8) {
-    XMMRegister idst = XMMRegister::from_code(dst.code());
-    vinstr(0x16, src, xmm0, idst, k66, k0F3A, kW0);
-    emit(imm8);
-  }
-  void vpextrd(const Operand& dst, XMMRegister src, int8_t imm8) {
-    vinstr(0x16, src, xmm0, dst, k66, k0F3A, kW0);
-    emit(imm8);
-  }
-  void vpinsrb(XMMRegister dst, XMMRegister src1, Register src2, int8_t imm8) {
-    XMMRegister isrc = XMMRegister::from_code(src2.code());
-    vinstr(0x20, dst, src1, isrc, k66, k0F3A, kW0);
-    emit(imm8);
-  }
-  void vpinsrb(XMMRegister dst, XMMRegister src1, const Operand& src2,
-               int8_t imm8) {
-    vinstr(0x20, dst, src1, src2, k66, k0F3A, kW0);
-    emit(imm8);
-  }
-  void vpinsrw(XMMRegister dst, XMMRegister src1, Register src2, int8_t imm8) {
-    XMMRegister isrc = XMMRegister::from_code(src2.code());
-    vinstr(0xc4, dst, src1, isrc, k66, k0F, kW0);
-    emit(imm8);
-  }
-  void vpinsrw(XMMRegister dst, XMMRegister src1, const Operand& src2,
-               int8_t imm8) {
-    vinstr(0xc4, dst, src1, src2, k66, k0F, kW0);
-    emit(imm8);
-  }
-  void vpinsrd(XMMRegister dst, XMMRegister src1, Register src2, int8_t imm8) {
-    XMMRegister isrc = XMMRegister::from_code(src2.code());
-    vinstr(0x22, dst, src1, isrc, k66, k0F3A, kW0);
-    emit(imm8);
-  }
-  void vpinsrd(XMMRegister dst, XMMRegister src1, const Operand& src2,
-               int8_t imm8) {
-    vinstr(0x22, dst, src1, src2, k66, k0F3A, kW0);
-    emit(imm8);
-  }
-  void vpshufd(XMMRegister dst, XMMRegister src, int8_t imm8) {
-    vinstr(0x70, dst, xmm0, src, k66, k0F, kWIG);
-    emit(imm8);
-  }
-
-  void vps(byte op, XMMRegister dst, XMMRegister src1, XMMRegister src2);
-  void vps(byte op, XMMRegister dst, XMMRegister src1, const Operand& src2);
-  void vpd(byte op, XMMRegister dst, XMMRegister src1, XMMRegister src2);
-  void vpd(byte op, XMMRegister dst, XMMRegister src1, const Operand& src2);
-
-  // BMI instruction
-  void andnq(Register dst, Register src1, Register src2) {
-    bmi1q(0xf2, dst, src1, src2);
-  }
-  void andnq(Register dst, Register src1, const Operand& src2) {
-    bmi1q(0xf2, dst, src1, src2);
-  }
-  void andnl(Register dst, Register src1, Register src2) {
-    bmi1l(0xf2, dst, src1, src2);
-  }
-  void andnl(Register dst, Register src1, const Operand& src2) {
-    bmi1l(0xf2, dst, src1, src2);
-  }
-  void bextrq(Register dst, Register src1, Register src2) {
-    bmi1q(0xf7, dst, src2, src1);
-  }
-  void bextrq(Register dst, const Operand& src1, Register src2) {
-    bmi1q(0xf7, dst, src2, src1);
-  }
-  void bextrl(Register dst, Register src1, Register src2) {
-    bmi1l(0xf7, dst, src2, src1);
-  }
-  void bextrl(Register dst, const Operand& src1, Register src2) {
-    bmi1l(0xf7, dst, src2, src1);
-  }
-  void blsiq(Register dst, Register src) { bmi1q(0xf3, rbx, dst, src); }
-  void blsiq(Register dst, const Operand& src) { bmi1q(0xf3, rbx, dst, src); }
-  void blsil(Register dst, Register src) { bmi1l(0xf3, rbx, dst, src); }
-  void blsil(Register dst, const Operand& src) { bmi1l(0xf3, rbx, dst, src); }
-  void blsmskq(Register dst, Register src) { bmi1q(0xf3, rdx, dst, src); }
-  void blsmskq(Register dst, const Operand& src) { bmi1q(0xf3, rdx, dst, src); }
-  void blsmskl(Register dst, Register src) { bmi1l(0xf3, rdx, dst, src); }
-  void blsmskl(Register dst, const Operand& src) { bmi1l(0xf3, rdx, dst, src); }
-  void blsrq(Register dst, Register src) { bmi1q(0xf3, rcx, dst, src); }
-  void blsrq(Register dst, const Operand& src) { bmi1q(0xf3, rcx, dst, src); }
-  void blsrl(Register dst, Register src) { bmi1l(0xf3, rcx, dst, src); }
-  void blsrl(Register dst, const Operand& src) { bmi1l(0xf3, rcx, dst, src); }
-  void tzcntq(Register dst, Register src);
-  void tzcntq(Register dst, const Operand& src);
-  void tzcntl(Register dst, Register src);
-  void tzcntl(Register dst, const Operand& src);
-
-  void lzcntq(Register dst, Register src);
-  void lzcntq(Register dst, const Operand& src);
-  void lzcntl(Register dst, Register src);
-  void lzcntl(Register dst, const Operand& src);
-
-  void popcntq(Register dst, Register src);
-  void popcntq(Register dst, const Operand& src);
-  void popcntl(Register dst, Register src);
-  void popcntl(Register dst, const Operand& src);
-
-  void bzhiq(Register dst, Register src1, Register src2) {
-    bmi2q(kNone, 0xf5, dst, src2, src1);
-  }
-  void bzhiq(Register dst, const Operand& src1, Register src2) {
-    bmi2q(kNone, 0xf5, dst, src2, src1);
-  }
-  void bzhil(Register dst, Register src1, Register src2) {
-    bmi2l(kNone, 0xf5, dst, src2, src1);
-  }
-  void bzhil(Register dst, const Operand& src1, Register src2) {
-    bmi2l(kNone, 0xf5, dst, src2, src1);
-  }
-  void mulxq(Register dst1, Register dst2, Register src) {
-    bmi2q(kF2, 0xf6, dst1, dst2, src);
-  }
-  void mulxq(Register dst1, Register dst2, const Operand& src) {
-    bmi2q(kF2, 0xf6, dst1, dst2, src);
-  }
-  void mulxl(Register dst1, Register dst2, Register src) {
-    bmi2l(kF2, 0xf6, dst1, dst2, src);
-  }
-  void mulxl(Register dst1, Register dst2, const Operand& src) {
-    bmi2l(kF2, 0xf6, dst1, dst2, src);
-  }
-  void pdepq(Register dst, Register src1, Register src2) {
-    bmi2q(kF2, 0xf5, dst, src1, src2);
-  }
-  void pdepq(Register dst, Register src1, const Operand& src2) {
-    bmi2q(kF2, 0xf5, dst, src1, src2);
-  }
-  void pdepl(Register dst, Register src1, Register src2) {
-    bmi2l(kF2, 0xf5, dst, src1, src2);
-  }
-  void pdepl(Register dst, Register src1, const Operand& src2) {
-    bmi2l(kF2, 0xf5, dst, src1, src2);
-  }
-  void pextq(Register dst, Register src1, Register src2) {
-    bmi2q(kF3, 0xf5, dst, src1, src2);
-  }
-  void pextq(Register dst, Register src1, const Operand& src2) {
-    bmi2q(kF3, 0xf5, dst, src1, src2);
-  }
-  void pextl(Register dst, Register src1, Register src2) {
-    bmi2l(kF3, 0xf5, dst, src1, src2);
-  }
-  void pextl(Register dst, Register src1, const Operand& src2) {
-    bmi2l(kF3, 0xf5, dst, src1, src2);
-  }
-  void sarxq(Register dst, Register src1, Register src2) {
-    bmi2q(kF3, 0xf7, dst, src2, src1);
-  }
-  void sarxq(Register dst, const Operand& src1, Register src2) {
-    bmi2q(kF3, 0xf7, dst, src2, src1);
-  }
-  void sarxl(Register dst, Register src1, Register src2) {
-    bmi2l(kF3, 0xf7, dst, src2, src1);
-  }
-  void sarxl(Register dst, const Operand& src1, Register src2) {
-    bmi2l(kF3, 0xf7, dst, src2, src1);
-  }
-  void shlxq(Register dst, Register src1, Register src2) {
-    bmi2q(k66, 0xf7, dst, src2, src1);
-  }
-  void shlxq(Register dst, const Operand& src1, Register src2) {
-    bmi2q(k66, 0xf7, dst, src2, src1);
-  }
-  void shlxl(Register dst, Register src1, Register src2) {
-    bmi2l(k66, 0xf7, dst, src2, src1);
-  }
-  void shlxl(Register dst, const Operand& src1, Register src2) {
-    bmi2l(k66, 0xf7, dst, src2, src1);
-  }
-  void shrxq(Register dst, Register src1, Register src2) {
-    bmi2q(kF2, 0xf7, dst, src2, src1);
-  }
-  void shrxq(Register dst, const Operand& src1, Register src2) {
-    bmi2q(kF2, 0xf7, dst, src2, src1);
-  }
-  void shrxl(Register dst, Register src1, Register src2) {
-    bmi2l(kF2, 0xf7, dst, src2, src1);
-  }
-  void shrxl(Register dst, const Operand& src1, Register src2) {
-    bmi2l(kF2, 0xf7, dst, src2, src1);
-  }
-  void rorxq(Register dst, Register src, byte imm8);
-  void rorxq(Register dst, const Operand& src, byte imm8);
-  void rorxl(Register dst, Register src, byte imm8);
-  void rorxl(Register dst, const Operand& src, byte imm8);
-
-  void lfence();
-  void pause();
-
-  // Check the code size generated from label to here.
-  int SizeOfCodeGeneratedSince(Label* label) {
-    return pc_offset() - label->pos();
-  }
-
-  // Record a comment relocation entry that can be used by a disassembler.
-  // Use --code-comments to enable.
-  void RecordComment(const char* msg);
-
-  // Record a deoptimization reason that can be used by a log or cpu profiler.
-  // Use --trace-deopt to enable.
-  void RecordDeoptReason(DeoptimizeReason reason, SourcePosition position,
-                         int id);
-
-  void PatchConstantPoolAccessInstruction(int pc_offset, int offset,
-                                          ConstantPoolEntry::Access access,
-                                          ConstantPoolEntry::Type type) {
-    // No embedded constant pool support.
-    UNREACHABLE();
-  }
-
-  // Writes a single word of data in the code stream.
-  // Used for inline tables, e.g., jump-tables.
-  void db(uint8_t data);
-  void dd(uint32_t data);
-  void dq(uint64_t data);
-  void dp(uintptr_t data) { dq(data); }
-  void dq(Label* label);
-
-  // Check if there is less than kGap bytes available in the buffer.
-  // If this is the case, we need to grow the buffer before emitting
-  // an instruction or relocation information.
-  inline bool buffer_overflow() const {
-    return pc_ >= reloc_info_writer.pos() - kGap;
-  }
-
-  // Get the number of bytes available in the buffer.
-  inline int available_space() const {
-    return static_cast<int>(reloc_info_writer.pos() - pc_);
-  }
-
-  static bool IsNop(Address addr);
-
-  // Avoid overflows for displacements etc.
-  static constexpr int kMaximalBufferSize = 512 * MB;
-
-  byte byte_at(int pos)  { return buffer_[pos]; }
-  void set_byte_at(int pos, byte value) { buffer_[pos] = value; }
-
-  Address pc() const { return pc_; }
-
- protected:
-  // Call near indirect
-  void call(const Operand& operand);
-
- private:
-  byte* addr_at(int pos)  { return buffer_ + pos; }
-  uint32_t long_at(int pos)  {
-    return *reinterpret_cast<uint32_t*>(addr_at(pos));
-  }
-  void long_at_put(int pos, uint32_t x)  {
-    *reinterpret_cast<uint32_t*>(addr_at(pos)) = x;
-  }
-
-  // code emission
-  void GrowBuffer();
-
-  void emit(byte x) { *pc_++ = x; }
-  inline void emitl(uint32_t x);
-  inline void emitp(void* x, RelocInfo::Mode rmode);
-  inline void emitq(uint64_t x);
-  inline void emitw(uint16_t x);
-  inline void emit_code_target(Handle<Code> target, RelocInfo::Mode rmode);
-  inline void emit_runtime_entry(Address entry, RelocInfo::Mode rmode);
-  inline void emit(Immediate x);
-
-  // Emits a REX prefix that encodes a 64-bit operand size and
-  // the top bit of both register codes.
-  // High bit of reg goes to REX.R, high bit of rm_reg goes to REX.B.
-  // REX.W is set.
-  inline void emit_rex_64(XMMRegister reg, Register rm_reg);
-  inline void emit_rex_64(Register reg, XMMRegister rm_reg);
-  inline void emit_rex_64(Register reg, Register rm_reg);
-
-  // Emits a REX prefix that encodes a 64-bit operand size and
-  // the top bit of the destination, index, and base register codes.
-  // The high bit of reg is used for REX.R, the high bit of op's base
-  // register is used for REX.B, and the high bit of op's index register
-  // is used for REX.X.  REX.W is set.
-  inline void emit_rex_64(Register reg, const Operand& op);
-  inline void emit_rex_64(XMMRegister reg, const Operand& op);
-
-  // Emits a REX prefix that encodes a 64-bit operand size and
-  // the top bit of the register code.
-  // The high bit of register is used for REX.B.
-  // REX.W is set and REX.R and REX.X are clear.
-  inline void emit_rex_64(Register rm_reg);
-
-  // Emits a REX prefix that encodes a 64-bit operand size and
-  // the top bit of the index and base register codes.
-  // The high bit of op's base register is used for REX.B, and the high
-  // bit of op's index register is used for REX.X.
-  // REX.W is set and REX.R clear.
-  inline void emit_rex_64(const Operand& op);
-
-  // Emit a REX prefix that only sets REX.W to choose a 64-bit operand size.
-  void emit_rex_64() { emit(0x48); }
-
-  // High bit of reg goes to REX.R, high bit of rm_reg goes to REX.B.
-  // REX.W is clear.
-  inline void emit_rex_32(Register reg, Register rm_reg);
-
-  // The high bit of reg is used for REX.R, the high bit of op's base
-  // register is used for REX.B, and the high bit of op's index register
-  // is used for REX.X.  REX.W is cleared.
-  inline void emit_rex_32(Register reg, const Operand& op);
-
-  // High bit of rm_reg goes to REX.B.
-  // REX.W, REX.R and REX.X are clear.
-  inline void emit_rex_32(Register rm_reg);
-
-  // High bit of base goes to REX.B and high bit of index to REX.X.
-  // REX.W and REX.R are clear.
-  inline void emit_rex_32(const Operand& op);
-
-  // High bit of reg goes to REX.R, high bit of rm_reg goes to REX.B.
-  // REX.W is cleared.  If no REX bits are set, no byte is emitted.
-  inline void emit_optional_rex_32(Register reg, Register rm_reg);
-
-  // The high bit of reg is used for REX.R, the high bit of op's base
-  // register is used for REX.B, and the high bit of op's index register
-  // is used for REX.X.  REX.W is cleared.  If no REX bits are set, nothing
-  // is emitted.
-  inline void emit_optional_rex_32(Register reg, const Operand& op);
-
-  // As for emit_optional_rex_32(Register, Register), except that
-  // the registers are XMM registers.
-  inline void emit_optional_rex_32(XMMRegister reg, XMMRegister base);
-
-  // As for emit_optional_rex_32(Register, Register), except that
-  // one of the registers is an XMM registers.
-  inline void emit_optional_rex_32(XMMRegister reg, Register base);
-
-  // As for emit_optional_rex_32(Register, Register), except that
-  // one of the registers is an XMM registers.
-  inline void emit_optional_rex_32(Register reg, XMMRegister base);
-
-  // As for emit_optional_rex_32(Register, const Operand&), except that
-  // the register is an XMM register.
-  inline void emit_optional_rex_32(XMMRegister reg, const Operand& op);
-
-  // Optionally do as emit_rex_32(Register) if the register number has
-  // the high bit set.
-  inline void emit_optional_rex_32(Register rm_reg);
-  inline void emit_optional_rex_32(XMMRegister rm_reg);
-
-  // Optionally do as emit_rex_32(const Operand&) if the operand register
-  // numbers have a high bit set.
-  inline void emit_optional_rex_32(const Operand& op);
-
-  void emit_rex(int size) {
-    if (size == kInt64Size) {
-      emit_rex_64();
-    } else {
-      DCHECK_EQ(size, kInt32Size);
-    }
-  }
-
-  template<class P1>
-  void emit_rex(P1 p1, int size) {
-    if (size == kInt64Size) {
-      emit_rex_64(p1);
-    } else {
-      DCHECK_EQ(size, kInt32Size);
-      emit_optional_rex_32(p1);
-    }
-  }
-
-  template<class P1, class P2>
-  void emit_rex(P1 p1, P2 p2, int size) {
-    if (size == kInt64Size) {
-      emit_rex_64(p1, p2);
-    } else {
-      DCHECK_EQ(size, kInt32Size);
-      emit_optional_rex_32(p1, p2);
-    }
-  }
-
-  // Emit vex prefix
-  void emit_vex2_byte0() { emit(0xc5); }
-  inline void emit_vex2_byte1(XMMRegister reg, XMMRegister v, VectorLength l,
-                              SIMDPrefix pp);
-  void emit_vex3_byte0() { emit(0xc4); }
-  inline void emit_vex3_byte1(XMMRegister reg, XMMRegister rm, LeadingOpcode m);
-  inline void emit_vex3_byte1(XMMRegister reg, const Operand& rm,
-                              LeadingOpcode m);
-  inline void emit_vex3_byte2(VexW w, XMMRegister v, VectorLength l,
-                              SIMDPrefix pp);
-  inline void emit_vex_prefix(XMMRegister reg, XMMRegister v, XMMRegister rm,
-                              VectorLength l, SIMDPrefix pp, LeadingOpcode m,
-                              VexW w);
-  inline void emit_vex_prefix(Register reg, Register v, Register rm,
-                              VectorLength l, SIMDPrefix pp, LeadingOpcode m,
-                              VexW w);
-  inline void emit_vex_prefix(XMMRegister reg, XMMRegister v, const Operand& rm,
-                              VectorLength l, SIMDPrefix pp, LeadingOpcode m,
-                              VexW w);
-  inline void emit_vex_prefix(Register reg, Register v, const Operand& rm,
-                              VectorLength l, SIMDPrefix pp, LeadingOpcode m,
-                              VexW w);
-
-  // Emit the ModR/M byte, and optionally the SIB byte and
-  // 1- or 4-byte offset for a memory operand.  Also encodes
-  // the second operand of the operation, a register or operation
-  // subcode, into the reg field of the ModR/M byte.
-  void emit_operand(Register reg, const Operand& adr) {
-    emit_operand(reg.low_bits(), adr);
-  }
-
-  // Emit the ModR/M byte, and optionally the SIB byte and
-  // 1- or 4-byte offset for a memory operand.  Also used to encode
-  // a three-bit opcode extension into the ModR/M byte.
-  void emit_operand(int rm, const Operand& adr);
-
-  // Emit a ModR/M byte with registers coded in the reg and rm_reg fields.
-  void emit_modrm(Register reg, Register rm_reg) {
-    emit(0xC0 | reg.low_bits() << 3 | rm_reg.low_bits());
-  }
-
-  // Emit a ModR/M byte with an operation subcode in the reg field and
-  // a register in the rm_reg field.
-  void emit_modrm(int code, Register rm_reg) {
-    DCHECK(is_uint3(code));
-    emit(0xC0 | code << 3 | rm_reg.low_bits());
-  }
-
-  // Emit the code-object-relative offset of the label's position
-  inline void emit_code_relative_offset(Label* label);
-
-  // The first argument is the reg field, the second argument is the r/m field.
-  void emit_sse_operand(XMMRegister dst, XMMRegister src);
-  void emit_sse_operand(XMMRegister reg, const Operand& adr);
-  void emit_sse_operand(Register reg, const Operand& adr);
-  void emit_sse_operand(XMMRegister dst, Register src);
-  void emit_sse_operand(Register dst, XMMRegister src);
-  void emit_sse_operand(XMMRegister dst);
-
-  // Emit machine code for one of the operations ADD, ADC, SUB, SBC,
-  // AND, OR, XOR, or CMP.  The encodings of these operations are all
-  // similar, differing just in the opcode or in the reg field of the
-  // ModR/M byte.
-  void arithmetic_op_8(byte opcode, Register reg, Register rm_reg);
-  void arithmetic_op_8(byte opcode, Register reg, const Operand& rm_reg);
-  void arithmetic_op_16(byte opcode, Register reg, Register rm_reg);
-  void arithmetic_op_16(byte opcode, Register reg, const Operand& rm_reg);
-  // Operate on operands/registers with pointer size, 32-bit or 64-bit size.
-  void arithmetic_op(byte opcode, Register reg, Register rm_reg, int size);
-  void arithmetic_op(byte opcode,
-                     Register reg,
-                     const Operand& rm_reg,
-                     int size);
-  // Operate on a byte in memory or register.
-  void immediate_arithmetic_op_8(byte subcode,
-                                 Register dst,
-                                 Immediate src);
-  void immediate_arithmetic_op_8(byte subcode,
-                                 const Operand& dst,
-                                 Immediate src);
-  // Operate on a word in memory or register.
-  void immediate_arithmetic_op_16(byte subcode,
-                                  Register dst,
-                                  Immediate src);
-  void immediate_arithmetic_op_16(byte subcode,
-                                  const Operand& dst,
-                                  Immediate src);
-  // Operate on operands/registers with pointer size, 32-bit or 64-bit size.
-  void immediate_arithmetic_op(byte subcode,
-                               Register dst,
-                               Immediate src,
-                               int size);
-  void immediate_arithmetic_op(byte subcode,
-                               const Operand& dst,
-                               Immediate src,
-                               int size);
-
-  // Emit machine code for a shift operation.
-  void shift(Operand dst, Immediate shift_amount, int subcode, int size);
-  void shift(Register dst, Immediate shift_amount, int subcode, int size);
-  // Shift dst by cl % 64 bits.
-  void shift(Register dst, int subcode, int size);
-  void shift(Operand dst, int subcode, int size);
-
-  void emit_farith(int b1, int b2, int i);
-
-  // labels
-  // void print(Label* L);
-  void bind_to(Label* L, int pos);
-
-  // record reloc info for current pc_
-  void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0);
-
-  // Arithmetics
-  void emit_add(Register dst, Register src, int size) {
-    arithmetic_op(0x03, dst, src, size);
-  }
-
-  void emit_add(Register dst, Immediate src, int size) {
-    immediate_arithmetic_op(0x0, dst, src, size);
-  }
-
-  void emit_add(Register dst, const Operand& src, int size) {
-    arithmetic_op(0x03, dst, src, size);
-  }
-
-  void emit_add(const Operand& dst, Register src, int size) {
-    arithmetic_op(0x1, src, dst, size);
-  }
-
-  void emit_add(const Operand& dst, Immediate src, int size) {
-    immediate_arithmetic_op(0x0, dst, src, size);
-  }
-
-  void emit_and(Register dst, Register src, int size) {
-    arithmetic_op(0x23, dst, src, size);
-  }
-
-  void emit_and(Register dst, const Operand& src, int size) {
-    arithmetic_op(0x23, dst, src, size);
-  }
-
-  void emit_and(const Operand& dst, Register src, int size) {
-    arithmetic_op(0x21, src, dst, size);
-  }
-
-  void emit_and(Register dst, Immediate src, int size) {
-    immediate_arithmetic_op(0x4, dst, src, size);
-  }
-
-  void emit_and(const Operand& dst, Immediate src, int size) {
-    immediate_arithmetic_op(0x4, dst, src, size);
-  }
-
-  void emit_cmp(Register dst, Register src, int size) {
-    arithmetic_op(0x3B, dst, src, size);
-  }
-
-  void emit_cmp(Register dst, const Operand& src, int size) {
-    arithmetic_op(0x3B, dst, src, size);
-  }
-
-  void emit_cmp(const Operand& dst, Register src, int size) {
-    arithmetic_op(0x39, src, dst, size);
-  }
-
-  void emit_cmp(Register dst, Immediate src, int size) {
-    immediate_arithmetic_op(0x7, dst, src, size);
-  }
-
-  void emit_cmp(const Operand& dst, Immediate src, int size) {
-    immediate_arithmetic_op(0x7, dst, src, size);
-  }
-
-  // Compare {al,ax,eax,rax} with src.  If equal, set ZF and write dst into
-  // src. Otherwise clear ZF and write src into {al,ax,eax,rax}.  This
-  // operation is only atomic if prefixed by the lock instruction.
-  void emit_cmpxchg(const Operand& dst, Register src, int size);
-
-  void emit_dec(Register dst, int size);
-  void emit_dec(const Operand& dst, int size);
-
-  // Divide rdx:rax by src.  Quotient in rax, remainder in rdx when size is 64.
-  // Divide edx:eax by lower 32 bits of src.  Quotient in eax, remainder in edx
-  // when size is 32.
-  void emit_idiv(Register src, int size);
-  void emit_div(Register src, int size);
-
-  // Signed multiply instructions.
-  // rdx:rax = rax * src when size is 64 or edx:eax = eax * src when size is 32.
-  void emit_imul(Register src, int size);
-  void emit_imul(const Operand& src, int size);
-  void emit_imul(Register dst, Register src, int size);
-  void emit_imul(Register dst, const Operand& src, int size);
-  void emit_imul(Register dst, Register src, Immediate imm, int size);
-  void emit_imul(Register dst, const Operand& src, Immediate imm, int size);
-
-  void emit_inc(Register dst, int size);
-  void emit_inc(const Operand& dst, int size);
-
-  void emit_lea(Register dst, const Operand& src, int size);
-
-  void emit_mov(Register dst, const Operand& src, int size);
-  void emit_mov(Register dst, Register src, int size);
-  void emit_mov(const Operand& dst, Register src, int size);
-  void emit_mov(Register dst, Immediate value, int size);
-  void emit_mov(const Operand& dst, Immediate value, int size);
-
-  void emit_movzxb(Register dst, const Operand& src, int size);
-  void emit_movzxb(Register dst, Register src, int size);
-  void emit_movzxw(Register dst, const Operand& src, int size);
-  void emit_movzxw(Register dst, Register src, int size);
-
-  void emit_neg(Register dst, int size);
-  void emit_neg(const Operand& dst, int size);
-
-  void emit_not(Register dst, int size);
-  void emit_not(const Operand& dst, int size);
-
-  void emit_or(Register dst, Register src, int size) {
-    arithmetic_op(0x0B, dst, src, size);
-  }
-
-  void emit_or(Register dst, const Operand& src, int size) {
-    arithmetic_op(0x0B, dst, src, size);
-  }
-
-  void emit_or(const Operand& dst, Register src, int size) {
-    arithmetic_op(0x9, src, dst, size);
-  }
-
-  void emit_or(Register dst, Immediate src, int size) {
-    immediate_arithmetic_op(0x1, dst, src, size);
-  }
-
-  void emit_or(const Operand& dst, Immediate src, int size) {
-    immediate_arithmetic_op(0x1, dst, src, size);
-  }
-
-  void emit_repmovs(int size);
-
-  void emit_sbb(Register dst, Register src, int size) {
-    arithmetic_op(0x1b, dst, src, size);
-  }
-
-  void emit_sub(Register dst, Register src, int size) {
-    arithmetic_op(0x2B, dst, src, size);
-  }
-
-  void emit_sub(Register dst, Immediate src, int size) {
-    immediate_arithmetic_op(0x5, dst, src, size);
-  }
-
-  void emit_sub(Register dst, const Operand& src, int size) {
-    arithmetic_op(0x2B, dst, src, size);
-  }
-
-  void emit_sub(const Operand& dst, Register src, int size) {
-    arithmetic_op(0x29, src, dst, size);
-  }
-
-  void emit_sub(const Operand& dst, Immediate src, int size) {
-    immediate_arithmetic_op(0x5, dst, src, size);
-  }
-
-  void emit_test(Register dst, Register src, int size);
-  void emit_test(Register reg, Immediate mask, int size);
-  void emit_test(const Operand& op, Register reg, int size);
-  void emit_test(const Operand& op, Immediate mask, int size);
-  void emit_test(Register reg, const Operand& op, int size) {
-    return emit_test(op, reg, size);
-  }
-
-  void emit_xchg(Register dst, Register src, int size);
-  void emit_xchg(Register dst, const Operand& src, int size);
-
-  void emit_xor(Register dst, Register src, int size) {
-    if (size == kInt64Size && dst.code() == src.code()) {
-    // 32 bit operations zero the top 32 bits of 64 bit registers. Therefore
-    // there is no need to make this a 64 bit operation.
-      arithmetic_op(0x33, dst, src, kInt32Size);
-    } else {
-      arithmetic_op(0x33, dst, src, size);
-    }
-  }
-
-  void emit_xor(Register dst, const Operand& src, int size) {
-    arithmetic_op(0x33, dst, src, size);
-  }
-
-  void emit_xor(Register dst, Immediate src, int size) {
-    immediate_arithmetic_op(0x6, dst, src, size);
-  }
-
-  void emit_xor(const Operand& dst, Immediate src, int size) {
-    immediate_arithmetic_op(0x6, dst, src, size);
-  }
-
-  void emit_xor(const Operand& dst, Register src, int size) {
-    arithmetic_op(0x31, src, dst, size);
-  }
-
-  // Most BMI instructions are similar.
-  void bmi1q(byte op, Register reg, Register vreg, Register rm);
-  void bmi1q(byte op, Register reg, Register vreg, const Operand& rm);
-  void bmi1l(byte op, Register reg, Register vreg, Register rm);
-  void bmi1l(byte op, Register reg, Register vreg, const Operand& rm);
-  void bmi2q(SIMDPrefix pp, byte op, Register reg, Register vreg, Register rm);
-  void bmi2q(SIMDPrefix pp, byte op, Register reg, Register vreg,
-             const Operand& rm);
-  void bmi2l(SIMDPrefix pp, byte op, Register reg, Register vreg, Register rm);
-  void bmi2l(SIMDPrefix pp, byte op, Register reg, Register vreg,
-             const Operand& rm);
-
-  // record the position of jmp/jcc instruction
-  void record_farjmp_position(Label* L, int pos);
-
-  bool is_optimizable_farjmp(int idx);
-
-  friend class EnsureSpace;
-  friend class RegExpMacroAssemblerX64;
-
-  // code generation
-  RelocInfoWriter reloc_info_writer;
-
-  // Internal reference positions, required for (potential) patching in
-  // GrowBuffer(); contains only those internal references whose labels
-  // are already bound.
-  std::deque<int> internal_reference_positions_;
-
-  std::vector<Handle<Code>> code_targets_;
-
-  // The following functions help with avoiding allocations of embedded heap
-  // objects during the code assembly phase. {RequestHeapObject} records the
-  // need for a future heap number allocation or code stub generation. After
-  // code assembly, {AllocateAndInstallRequestedHeapObjects} will allocate these
-  // objects and place them where they are expected (determined by the pc offset
-  // associated with each request). That is, for each request, it will patch the
-  // dummy heap object handle that we emitted during code assembly with the
-  // actual heap object handle.
-  void RequestHeapObject(HeapObjectRequest request);
-  void AllocateAndInstallRequestedHeapObjects(Isolate* isolate);
-
-  std::forward_list<HeapObjectRequest> heap_object_requests_;
-
-  // Variables for this instance of assembler
-  int farjmp_num_ = 0;
-  std::deque<int> farjmp_positions_;
-  std::map<Label*, std::vector<int>> label_farjmp_maps_;
-};
-
-
-// Helper class that ensures that there is enough space for generating
-// instructions and relocation information.  The constructor makes
-// sure that there is enough space and (in debug mode) the destructor
-// checks that we did not generate too much.
-class EnsureSpace BASE_EMBEDDED {
- public:
-  explicit EnsureSpace(Assembler* assembler) : assembler_(assembler) {
-    if (assembler_->buffer_overflow()) assembler_->GrowBuffer();
-#ifdef DEBUG
-    space_before_ = assembler_->available_space();
-#endif
-  }
-
-#ifdef DEBUG
-  ~EnsureSpace() {
-    int bytes_generated = space_before_ - assembler_->available_space();
-    DCHECK(bytes_generated < assembler_->kGap);
-  }
-#endif
-
- private:
-  Assembler* assembler_;
-#ifdef DEBUG
-  int space_before_;
-#endif
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_X64_ASSEMBLER_X64_H_
diff --git a/src/v8/src/x64/code-stubs-x64.cc b/src/v8/src/x64/code-stubs-x64.cc
deleted file mode 100644
index 27061c1..0000000
--- a/src/v8/src/x64/code-stubs-x64.cc
+++ /dev/null
@@ -1,1288 +0,0 @@
-// Copyright 2013 the V8 project 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 V8_TARGET_ARCH_X64
-
-#include "src/api-arguments.h"
-#include "src/bootstrapper.h"
-#include "src/code-stubs.h"
-#include "src/counters.h"
-#include "src/double.h"
-#include "src/frame-constants.h"
-#include "src/frames.h"
-#include "src/heap/heap-inl.h"
-#include "src/ic/ic.h"
-#include "src/ic/stub-cache.h"
-#include "src/isolate.h"
-#include "src/objects-inl.h"
-#include "src/objects/regexp-match-info.h"
-#include "src/regexp/jsregexp.h"
-#include "src/regexp/regexp-macro-assembler.h"
-#include "src/runtime/runtime.h"
-
-namespace v8 {
-namespace internal {
-
-#define __ ACCESS_MASM(masm)
-
-void ArrayNArgumentsConstructorStub::Generate(MacroAssembler* masm) {
-  __ popq(rcx);
-  __ movq(MemOperand(rsp, rax, times_8, 0), rdi);
-  __ pushq(rdi);
-  __ pushq(rbx);
-  __ pushq(rcx);
-  __ addq(rax, Immediate(3));
-  __ TailCallRuntime(Runtime::kNewArray);
-}
-
-
-void DoubleToIStub::Generate(MacroAssembler* masm) {
-    Register final_result_reg = this->destination();
-
-    Label check_negative, process_64_bits, done;
-
-    // Account for return address and saved regs.
-    const int kArgumentOffset = 3 * kRegisterSize;
-
-    MemOperand mantissa_operand(MemOperand(rsp, kArgumentOffset));
-    MemOperand exponent_operand(
-        MemOperand(rsp, kArgumentOffset + kDoubleSize / 2));
-
-    Register scratch1 = no_reg;
-    Register scratch_candidates[3] = { rbx, rdx, rdi };
-    for (int i = 0; i < 3; i++) {
-      scratch1 = scratch_candidates[i];
-      if (final_result_reg != scratch1) break;
-    }
-
-    // Since we must use rcx for shifts below, use some other register (rax)
-    // to calculate the result if ecx is the requested return register.
-    Register result_reg = final_result_reg == rcx ? rax : final_result_reg;
-    // Save ecx if it isn't the return register and therefore volatile, or if it
-    // is the return register, then save the temp register we use in its stead
-    // for the result.
-    Register save_reg = final_result_reg == rcx ? rax : rcx;
-    __ pushq(scratch1);
-    __ pushq(save_reg);
-
-    __ movl(scratch1, mantissa_operand);
-    __ Movsd(kScratchDoubleReg, mantissa_operand);
-    __ movl(rcx, exponent_operand);
-
-    __ andl(rcx, Immediate(HeapNumber::kExponentMask));
-    __ shrl(rcx, Immediate(HeapNumber::kExponentShift));
-    __ leal(result_reg, MemOperand(rcx, -HeapNumber::kExponentBias));
-    __ cmpl(result_reg, Immediate(HeapNumber::kMantissaBits));
-    __ j(below, &process_64_bits);
-
-    // Result is entirely in lower 32-bits of mantissa
-    int delta = HeapNumber::kExponentBias + Double::kPhysicalSignificandSize;
-    __ subl(rcx, Immediate(delta));
-    __ xorl(result_reg, result_reg);
-    __ cmpl(rcx, Immediate(31));
-    __ j(above, &done);
-    __ shll_cl(scratch1);
-    __ jmp(&check_negative);
-
-    __ bind(&process_64_bits);
-    __ Cvttsd2siq(result_reg, kScratchDoubleReg);
-    __ jmp(&done, Label::kNear);
-
-    // If the double was negative, negate the integer result.
-    __ bind(&check_negative);
-    __ movl(result_reg, scratch1);
-    __ negl(result_reg);
-    __ cmpl(exponent_operand, Immediate(0));
-    __ cmovl(greater, result_reg, scratch1);
-
-    // Restore registers
-    __ bind(&done);
-    if (final_result_reg != result_reg) {
-      DCHECK(final_result_reg == rcx);
-      __ movl(final_result_reg, result_reg);
-    }
-    __ popq(save_reg);
-    __ popq(scratch1);
-    __ ret(0);
-}
-
-void MathPowStub::Generate(MacroAssembler* masm) {
-  const Register exponent = MathPowTaggedDescriptor::exponent();
-  DCHECK(exponent == rdx);
-  const Register scratch = rcx;
-  const XMMRegister double_result = xmm3;
-  const XMMRegister double_base = xmm2;
-  const XMMRegister double_exponent = xmm1;
-  const XMMRegister double_scratch = xmm4;
-
-  Label call_runtime, done, exponent_not_smi, int_exponent;
-
-  // Save 1 in double_result - we need this several times later on.
-  __ movp(scratch, Immediate(1));
-  __ Cvtlsi2sd(double_result, scratch);
-
-  if (exponent_type() == TAGGED) {
-    __ JumpIfNotSmi(exponent, &exponent_not_smi, Label::kNear);
-    __ SmiToInteger32(exponent, exponent);
-    __ jmp(&int_exponent);
-
-    __ bind(&exponent_not_smi);
-    __ Movsd(double_exponent, FieldOperand(exponent, HeapNumber::kValueOffset));
-  }
-
-  if (exponent_type() != INTEGER) {
-    Label fast_power, try_arithmetic_simplification;
-    // Detect integer exponents stored as double.
-    __ DoubleToI(exponent, double_exponent, double_scratch,
-                 TREAT_MINUS_ZERO_AS_ZERO, &try_arithmetic_simplification,
-                 &try_arithmetic_simplification,
-                 &try_arithmetic_simplification);
-    __ jmp(&int_exponent);
-
-    __ bind(&try_arithmetic_simplification);
-    __ Cvttsd2si(exponent, double_exponent);
-    // Skip to runtime if possibly NaN (indicated by the indefinite integer).
-    __ cmpl(exponent, Immediate(0x1));
-    __ j(overflow, &call_runtime);
-
-    // Using FPU instructions to calculate power.
-    Label fast_power_failed;
-    __ bind(&fast_power);
-    __ fnclex();  // Clear flags to catch exceptions later.
-    // Transfer (B)ase and (E)xponent onto the FPU register stack.
-    __ subp(rsp, Immediate(kDoubleSize));
-    __ Movsd(Operand(rsp, 0), double_exponent);
-    __ fld_d(Operand(rsp, 0));  // E
-    __ Movsd(Operand(rsp, 0), double_base);
-    __ fld_d(Operand(rsp, 0));  // B, E
-
-    // Exponent is in st(1) and base is in st(0)
-    // B ^ E = (2^(E * log2(B)) - 1) + 1 = (2^X - 1) + 1 for X = E * log2(B)
-    // FYL2X calculates st(1) * log2(st(0))
-    __ fyl2x();    // X
-    __ fld(0);     // X, X
-    __ frndint();  // rnd(X), X
-    __ fsub(1);    // rnd(X), X-rnd(X)
-    __ fxch(1);    // X - rnd(X), rnd(X)
-    // F2XM1 calculates 2^st(0) - 1 for -1 < st(0) < 1
-    __ f2xm1();    // 2^(X-rnd(X)) - 1, rnd(X)
-    __ fld1();     // 1, 2^(X-rnd(X)) - 1, rnd(X)
-    __ faddp(1);   // 2^(X-rnd(X)), rnd(X)
-    // FSCALE calculates st(0) * 2^st(1)
-    __ fscale();   // 2^X, rnd(X)
-    __ fstp(1);
-    // Bail out to runtime in case of exceptions in the status word.
-    __ fnstsw_ax();
-    __ testb(rax, Immediate(0x5F));  // Check for all but precision exception.
-    __ j(not_zero, &fast_power_failed, Label::kNear);
-    __ fstp_d(Operand(rsp, 0));
-    __ Movsd(double_result, Operand(rsp, 0));
-    __ addp(rsp, Immediate(kDoubleSize));
-    __ jmp(&done);
-
-    __ bind(&fast_power_failed);
-    __ fninit();
-    __ addp(rsp, Immediate(kDoubleSize));
-    __ jmp(&call_runtime);
-  }
-
-  // Calculate power with integer exponent.
-  __ bind(&int_exponent);
-  const XMMRegister double_scratch2 = double_exponent;
-  // Back up exponent as we need to check if exponent is negative later.
-  __ movp(scratch, exponent);  // Back up exponent.
-  __ Movsd(double_scratch, double_base);     // Back up base.
-  __ Movsd(double_scratch2, double_result);  // Load double_exponent with 1.
-
-  // Get absolute value of exponent.
-  Label no_neg, while_true, while_false;
-  __ testl(scratch, scratch);
-  __ j(positive, &no_neg, Label::kNear);
-  __ negl(scratch);
-  __ bind(&no_neg);
-
-  __ j(zero, &while_false, Label::kNear);
-  __ shrl(scratch, Immediate(1));
-  // Above condition means CF==0 && ZF==0.  This means that the
-  // bit that has been shifted out is 0 and the result is not 0.
-  __ j(above, &while_true, Label::kNear);
-  __ Movsd(double_result, double_scratch);
-  __ j(zero, &while_false, Label::kNear);
-
-  __ bind(&while_true);
-  __ shrl(scratch, Immediate(1));
-  __ Mulsd(double_scratch, double_scratch);
-  __ j(above, &while_true, Label::kNear);
-  __ Mulsd(double_result, double_scratch);
-  __ j(not_zero, &while_true);
-
-  __ bind(&while_false);
-  // If the exponent is negative, return 1/result.
-  __ testl(exponent, exponent);
-  __ j(greater, &done);
-  __ Divsd(double_scratch2, double_result);
-  __ Movsd(double_result, double_scratch2);
-  // Test whether result is zero.  Bail out to check for subnormal result.
-  // Due to subnormals, x^-y == (1/x)^y does not hold in all cases.
-  __ Xorpd(double_scratch2, double_scratch2);
-  __ Ucomisd(double_scratch2, double_result);
-  // double_exponent aliased as double_scratch2 has already been overwritten
-  // and may not have contained the exponent value in the first place when the
-  // input was a smi.  We reset it with exponent value before bailing out.
-  __ j(not_equal, &done);
-  __ Cvtlsi2sd(double_exponent, exponent);
-
-  // Returning or bailing out.
-  __ bind(&call_runtime);
-  // Move base to the correct argument register.  Exponent is already in xmm1.
-  __ Movsd(xmm0, double_base);
-  DCHECK(double_exponent == xmm1);
-  {
-    AllowExternalCallThatCantCauseGC scope(masm);
-    __ PrepareCallCFunction(2);
-    __ CallCFunction(ExternalReference::power_double_double_function(isolate()),
-                     2);
-  }
-  // Return value is in xmm0.
-  __ Movsd(double_result, xmm0);
-
-  __ bind(&done);
-  __ ret(0);
-}
-
-Movability CEntryStub::NeedsImmovableCode() { return kMovable; }
-
-void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) {
-  CEntryStub::GenerateAheadOfTime(isolate);
-  // It is important that the store buffer overflow stubs are generated first.
-  CommonArrayConstructorStub::GenerateStubsAheadOfTime(isolate);
-  StoreFastElementStub::GenerateAheadOfTime(isolate);
-}
-
-
-void CodeStub::GenerateFPStubs(Isolate* isolate) {
-}
-
-
-void CEntryStub::GenerateAheadOfTime(Isolate* isolate) {
-  CEntryStub stub(isolate, 1, kDontSaveFPRegs);
-  stub.GetCode();
-  CEntryStub save_doubles(isolate, 1, kSaveFPRegs);
-  save_doubles.GetCode();
-}
-
-
-void CEntryStub::Generate(MacroAssembler* masm) {
-  // rax: number of arguments including receiver
-  // rbx: pointer to C function  (C callee-saved)
-  // rbp: frame pointer of calling JS frame (restored after C call)
-  // rsp: stack pointer  (restored after C call)
-  // rsi: current context (restored)
-  //
-  // If argv_in_register():
-  // r15: pointer to the first argument
-
-  ProfileEntryHookStub::MaybeCallEntryHook(masm);
-
-#ifdef _WIN64
-  // Windows 64-bit ABI passes arguments in rcx, rdx, r8, r9. It requires the
-  // stack to be aligned to 16 bytes. It only allows a single-word to be
-  // returned in register rax. Larger return sizes must be written to an address
-  // passed as a hidden first argument.
-  const Register kCCallArg0 = rcx;
-  const Register kCCallArg1 = rdx;
-  const Register kCCallArg2 = r8;
-  const Register kCCallArg3 = r9;
-  const int kArgExtraStackSpace = 2;
-  const int kMaxRegisterResultSize = 1;
-#else
-  // GCC / Clang passes arguments in rdi, rsi, rdx, rcx, r8, r9. Simple results
-  // are returned in rax, and a struct of two pointers are returned in rax+rdx.
-  // Larger return sizes must be written to an address passed as a hidden first
-  // argument.
-  const Register kCCallArg0 = rdi;
-  const Register kCCallArg1 = rsi;
-  const Register kCCallArg2 = rdx;
-  const Register kCCallArg3 = rcx;
-  const int kArgExtraStackSpace = 0;
-  const int kMaxRegisterResultSize = 2;
-#endif  // _WIN64
-
-  // Enter the exit frame that transitions from JavaScript to C++.
-  int arg_stack_space =
-      kArgExtraStackSpace +
-      (result_size() <= kMaxRegisterResultSize ? 0 : result_size());
-  if (argv_in_register()) {
-    DCHECK(!save_doubles());
-    DCHECK(!is_builtin_exit());
-    __ EnterApiExitFrame(arg_stack_space);
-    // Move argc into r14 (argv is already in r15).
-    __ movp(r14, rax);
-  } else {
-    __ EnterExitFrame(
-        arg_stack_space, save_doubles(),
-        is_builtin_exit() ? StackFrame::BUILTIN_EXIT : StackFrame::EXIT);
-  }
-
-  // rbx: pointer to builtin function  (C callee-saved).
-  // rbp: frame pointer of exit frame  (restored after C call).
-  // rsp: stack pointer (restored after C call).
-  // r14: number of arguments including receiver (C callee-saved).
-  // r15: argv pointer (C callee-saved).
-
-  // Check stack alignment.
-  if (FLAG_debug_code) {
-    __ CheckStackAlignment();
-  }
-
-  // Call C function. The arguments object will be created by stubs declared by
-  // DECLARE_RUNTIME_FUNCTION().
-  if (result_size() <= kMaxRegisterResultSize) {
-    // Pass a pointer to the Arguments object as the first argument.
-    // Return result in single register (rax), or a register pair (rax, rdx).
-    __ movp(kCCallArg0, r14);  // argc.
-    __ movp(kCCallArg1, r15);  // argv.
-    __ Move(kCCallArg2, ExternalReference::isolate_address(isolate()));
-  } else {
-    DCHECK_LE(result_size(), 2);
-    // Pass a pointer to the result location as the first argument.
-    __ leap(kCCallArg0, StackSpaceOperand(kArgExtraStackSpace));
-    // Pass a pointer to the Arguments object as the second argument.
-    __ movp(kCCallArg1, r14);  // argc.
-    __ movp(kCCallArg2, r15);  // argv.
-    __ Move(kCCallArg3, ExternalReference::isolate_address(isolate()));
-  }
-  __ call(rbx);
-
-  if (result_size() > kMaxRegisterResultSize) {
-    // Read result values stored on stack. Result is stored
-    // above the the two Arguments object slots on Win64.
-    DCHECK_LE(result_size(), 2);
-    __ movq(kReturnRegister0, StackSpaceOperand(kArgExtraStackSpace + 0));
-    __ movq(kReturnRegister1, StackSpaceOperand(kArgExtraStackSpace + 1));
-  }
-  // Result is in rax or rdx:rax - do not destroy these registers!
-
-  // Check result for exception sentinel.
-  Label exception_returned;
-  __ CompareRoot(rax, Heap::kExceptionRootIndex);
-  __ j(equal, &exception_returned);
-
-  // Check that there is no pending exception, otherwise we
-  // should have returned the exception sentinel.
-  if (FLAG_debug_code) {
-    Label okay;
-    __ LoadRoot(r14, Heap::kTheHoleValueRootIndex);
-    ExternalReference pending_exception_address(
-        IsolateAddressId::kPendingExceptionAddress, isolate());
-    Operand pending_exception_operand =
-        masm->ExternalOperand(pending_exception_address);
-    __ cmpp(r14, pending_exception_operand);
-    __ j(equal, &okay, Label::kNear);
-    __ int3();
-    __ bind(&okay);
-  }
-
-  // Exit the JavaScript to C++ exit frame.
-  __ LeaveExitFrame(save_doubles(), !argv_in_register());
-  __ ret(0);
-
-  // Handling of exception.
-  __ bind(&exception_returned);
-
-  ExternalReference pending_handler_context_address(
-      IsolateAddressId::kPendingHandlerContextAddress, isolate());
-  ExternalReference pending_handler_entrypoint_address(
-      IsolateAddressId::kPendingHandlerEntrypointAddress, isolate());
-  ExternalReference pending_handler_fp_address(
-      IsolateAddressId::kPendingHandlerFPAddress, isolate());
-  ExternalReference pending_handler_sp_address(
-      IsolateAddressId::kPendingHandlerSPAddress, isolate());
-
-  // Ask the runtime for help to determine the handler. This will set rax to
-  // contain the current pending exception, don't clobber it.
-  ExternalReference find_handler(Runtime::kUnwindAndFindExceptionHandler,
-                                 isolate());
-  {
-    FrameScope scope(masm, StackFrame::MANUAL);
-    __ movp(arg_reg_1, Immediate(0));  // argc.
-    __ movp(arg_reg_2, Immediate(0));  // argv.
-    __ Move(arg_reg_3, ExternalReference::isolate_address(isolate()));
-    __ PrepareCallCFunction(3);
-    __ CallCFunction(find_handler, 3);
-  }
-  // Retrieve the handler context, SP and FP.
-  __ movp(rsi, masm->ExternalOperand(pending_handler_context_address));
-  __ movp(rsp, masm->ExternalOperand(pending_handler_sp_address));
-  __ movp(rbp, masm->ExternalOperand(pending_handler_fp_address));
-
-  // If the handler is a JS frame, restore the context to the frame. Note that
-  // the context will be set to (rsi == 0) for non-JS frames.
-  Label skip;
-  __ testp(rsi, rsi);
-  __ j(zero, &skip, Label::kNear);
-  __ movp(Operand(rbp, StandardFrameConstants::kContextOffset), rsi);
-  __ bind(&skip);
-
-  // Compute the handler entry address and jump to it.
-  __ movp(rdi, masm->ExternalOperand(pending_handler_entrypoint_address));
-  __ jmp(rdi);
-}
-
-
-void JSEntryStub::Generate(MacroAssembler* masm) {
-  Label invoke, handler_entry, exit;
-  Label not_outermost_js, not_outermost_js_2;
-
-  ProfileEntryHookStub::MaybeCallEntryHook(masm);
-
-  {  // NOLINT. Scope block confuses linter.
-    MacroAssembler::NoRootArrayScope uninitialized_root_register(masm);
-    // Set up frame.
-    __ pushq(rbp);
-    __ movp(rbp, rsp);
-
-    // Push the stack frame type.
-    __ Push(Immediate(StackFrame::TypeToMarker(type())));  // context slot
-    ExternalReference context_address(IsolateAddressId::kContextAddress,
-                                      isolate());
-    __ Load(kScratchRegister, context_address);
-    __ Push(kScratchRegister);  // context
-    // Save callee-saved registers (X64/X32/Win64 calling conventions).
-    __ pushq(r12);
-    __ pushq(r13);
-    __ pushq(r14);
-    __ pushq(r15);
-#ifdef _WIN64
-    __ pushq(rdi);  // Only callee save in Win64 ABI, argument in AMD64 ABI.
-    __ pushq(rsi);  // Only callee save in Win64 ABI, argument in AMD64 ABI.
-#endif
-    __ pushq(rbx);
-
-#ifdef _WIN64
-    // On Win64 XMM6-XMM15 are callee-save
-    __ subp(rsp, Immediate(EntryFrameConstants::kXMMRegistersBlockSize));
-    __ movdqu(Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 0), xmm6);
-    __ movdqu(Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 1), xmm7);
-    __ movdqu(Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 2), xmm8);
-    __ movdqu(Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 3), xmm9);
-    __ movdqu(Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 4), xmm10);
-    __ movdqu(Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 5), xmm11);
-    __ movdqu(Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 6), xmm12);
-    __ movdqu(Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 7), xmm13);
-    __ movdqu(Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 8), xmm14);
-    __ movdqu(Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 9), xmm15);
-#endif
-
-    // Set up the roots and smi constant registers.
-    // Needs to be done before any further smi loads.
-    __ InitializeRootRegister();
-  }
-
-  // Save copies of the top frame descriptor on the stack.
-  ExternalReference c_entry_fp(IsolateAddressId::kCEntryFPAddress, isolate());
-  {
-    Operand c_entry_fp_operand = masm->ExternalOperand(c_entry_fp);
-    __ Push(c_entry_fp_operand);
-  }
-
-  // If this is the outermost JS call, set js_entry_sp value.
-  ExternalReference js_entry_sp(IsolateAddressId::kJSEntrySPAddress, isolate());
-  __ Load(rax, js_entry_sp);
-  __ testp(rax, rax);
-  __ j(not_zero, &not_outermost_js);
-  __ Push(Immediate(StackFrame::OUTERMOST_JSENTRY_FRAME));
-  __ movp(rax, rbp);
-  __ Store(js_entry_sp, rax);
-  Label cont;
-  __ jmp(&cont);
-  __ bind(&not_outermost_js);
-  __ Push(Immediate(StackFrame::INNER_JSENTRY_FRAME));
-  __ bind(&cont);
-
-  // Jump to a faked try block that does the invoke, with a faked catch
-  // block that sets the pending exception.
-  __ jmp(&invoke);
-  __ bind(&handler_entry);
-  handler_offset_ = handler_entry.pos();
-  // Caught exception: Store result (exception) in the pending exception
-  // field in the JSEnv and return a failure sentinel.
-  ExternalReference pending_exception(
-      IsolateAddressId::kPendingExceptionAddress, isolate());
-  __ Store(pending_exception, rax);
-  __ LoadRoot(rax, Heap::kExceptionRootIndex);
-  __ jmp(&exit);
-
-  // Invoke: Link this frame into the handler chain.
-  __ bind(&invoke);
-  __ PushStackHandler();
-
-  // Invoke the function by calling through JS entry trampoline builtin and
-  // pop the faked function when we return. We load the address from an
-  // external reference instead of inlining the call target address directly
-  // in the code, because the builtin stubs may not have been generated yet
-  // at the time this code is generated.
-  __ Call(EntryTrampoline(), RelocInfo::CODE_TARGET);
-
-  // Unlink this frame from the handler chain.
-  __ PopStackHandler();
-
-  __ bind(&exit);
-  // Check if the current stack frame is marked as the outermost JS frame.
-  __ Pop(rbx);
-  __ cmpp(rbx, Immediate(StackFrame::OUTERMOST_JSENTRY_FRAME));
-  __ j(not_equal, &not_outermost_js_2);
-  __ Move(kScratchRegister, js_entry_sp);
-  __ movp(Operand(kScratchRegister, 0), Immediate(0));
-  __ bind(&not_outermost_js_2);
-
-  // Restore the top frame descriptor from the stack.
-  { Operand c_entry_fp_operand = masm->ExternalOperand(c_entry_fp);
-    __ Pop(c_entry_fp_operand);
-  }
-
-  // Restore callee-saved registers (X64 conventions).
-#ifdef _WIN64
-  // On Win64 XMM6-XMM15 are callee-save
-  __ movdqu(xmm6, Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 0));
-  __ movdqu(xmm7, Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 1));
-  __ movdqu(xmm8, Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 2));
-  __ movdqu(xmm9, Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 3));
-  __ movdqu(xmm10, Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 4));
-  __ movdqu(xmm11, Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 5));
-  __ movdqu(xmm12, Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 6));
-  __ movdqu(xmm13, Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 7));
-  __ movdqu(xmm14, Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 8));
-  __ movdqu(xmm15, Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 9));
-  __ addp(rsp, Immediate(EntryFrameConstants::kXMMRegistersBlockSize));
-#endif
-
-  __ popq(rbx);
-#ifdef _WIN64
-  // Callee save on in Win64 ABI, arguments/volatile in AMD64 ABI.
-  __ popq(rsi);
-  __ popq(rdi);
-#endif
-  __ popq(r15);
-  __ popq(r14);
-  __ popq(r13);
-  __ popq(r12);
-  __ addp(rsp, Immediate(2 * kPointerSize));  // remove markers
-
-  // Restore frame pointer and return.
-  __ popq(rbp);
-  __ ret(0);
-}
-
-void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
-  if (masm->isolate()->function_entry_hook() != nullptr) {
-    ProfileEntryHookStub stub(masm->isolate());
-    masm->CallStub(&stub);
-  }
-}
-
-void ProfileEntryHookStub::MaybeCallEntryHookDelayed(TurboAssembler* tasm,
-                                                     Zone* zone) {
-  if (tasm->isolate()->function_entry_hook() != nullptr) {
-    tasm->CallStubDelayed(new (zone) ProfileEntryHookStub(nullptr));
-  }
-}
-
-void ProfileEntryHookStub::Generate(MacroAssembler* masm) {
-  // This stub can be called from essentially anywhere, so it needs to save
-  // all volatile and callee-save registers.
-  const size_t kNumSavedRegisters = 2;
-  __ pushq(arg_reg_1);
-  __ pushq(arg_reg_2);
-
-  // Calculate the original stack pointer and store it in the second arg.
-  __ leap(arg_reg_2,
-         Operand(rsp, kNumSavedRegisters * kRegisterSize + kPCOnStackSize));
-
-  // Calculate the function address to the first arg.
-  __ movp(arg_reg_1, Operand(rsp, kNumSavedRegisters * kRegisterSize));
-  __ subp(arg_reg_1, Immediate(Assembler::kShortCallInstructionLength));
-
-  // Save the remainder of the volatile registers.
-  masm->PushCallerSaved(kSaveFPRegs, arg_reg_1, arg_reg_2);
-
-  // Call the entry hook function.
-  __ Move(rax, FUNCTION_ADDR(isolate()->function_entry_hook()),
-          Assembler::RelocInfoNone());
-
-  AllowExternalCallThatCantCauseGC scope(masm);
-
-  const int kArgumentCount = 2;
-  __ PrepareCallCFunction(kArgumentCount);
-  __ CallCFunction(rax, kArgumentCount);
-
-  // Restore volatile regs.
-  masm->PopCallerSaved(kSaveFPRegs, arg_reg_1, arg_reg_2);
-  __ popq(arg_reg_2);
-  __ popq(arg_reg_1);
-
-  __ Ret();
-}
-
-
-template<class T>
-static void CreateArrayDispatch(MacroAssembler* masm,
-                                AllocationSiteOverrideMode mode) {
-  if (mode == DISABLE_ALLOCATION_SITES) {
-    T stub(masm->isolate(), GetInitialFastElementsKind(), mode);
-    __ TailCallStub(&stub);
-  } else if (mode == DONT_OVERRIDE) {
-    int last_index =
-        GetSequenceIndexFromFastElementsKind(TERMINAL_FAST_ELEMENTS_KIND);
-    for (int i = 0; i <= last_index; ++i) {
-      Label next;
-      ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
-      __ cmpl(rdx, Immediate(kind));
-      __ j(not_equal, &next);
-      T stub(masm->isolate(), kind);
-      __ TailCallStub(&stub);
-      __ bind(&next);
-    }
-
-    // If we reached this point there is a problem.
-    __ Abort(AbortReason::kUnexpectedElementsKindInArrayConstructor);
-  } else {
-    UNREACHABLE();
-  }
-}
-
-
-static void CreateArrayDispatchOneArgument(MacroAssembler* masm,
-                                           AllocationSiteOverrideMode mode) {
-  // rbx - allocation site (if mode != DISABLE_ALLOCATION_SITES)
-  // rdx - kind (if mode != DISABLE_ALLOCATION_SITES)
-  // rax - number of arguments
-  // rdi - constructor?
-  // rsp[0] - return address
-  // rsp[8] - last argument
-
-  STATIC_ASSERT(PACKED_SMI_ELEMENTS == 0);
-  STATIC_ASSERT(HOLEY_SMI_ELEMENTS == 1);
-  STATIC_ASSERT(PACKED_ELEMENTS == 2);
-  STATIC_ASSERT(HOLEY_ELEMENTS == 3);
-  STATIC_ASSERT(PACKED_DOUBLE_ELEMENTS == 4);
-  STATIC_ASSERT(HOLEY_DOUBLE_ELEMENTS == 5);
-
-  if (mode == DISABLE_ALLOCATION_SITES) {
-    ElementsKind initial = GetInitialFastElementsKind();
-    ElementsKind holey_initial = GetHoleyElementsKind(initial);
-
-    ArraySingleArgumentConstructorStub stub_holey(masm->isolate(),
-                                                  holey_initial,
-                                                  DISABLE_ALLOCATION_SITES);
-    __ TailCallStub(&stub_holey);
-  } else if (mode == DONT_OVERRIDE) {
-    // is the low bit set? If so, we are holey and that is good.
-    Label normal_sequence;
-    __ testb(rdx, Immediate(1));
-    __ j(not_zero, &normal_sequence);
-
-    // We are going to create a holey array, but our kind is non-holey.
-    // Fix kind and retry (only if we have an allocation site in the slot).
-    __ incl(rdx);
-
-    if (FLAG_debug_code) {
-      Handle<Map> allocation_site_map =
-          masm->isolate()->factory()->allocation_site_map();
-      __ Cmp(FieldOperand(rbx, 0), allocation_site_map);
-      __ Assert(equal, AbortReason::kExpectedAllocationSite);
-    }
-
-    // Save the resulting elements kind in type info. We can't just store r3
-    // in the AllocationSite::transition_info field because elements kind is
-    // restricted to a portion of the field...upper bits need to be left alone.
-    STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
-    __ SmiAddConstant(
-        FieldOperand(rbx, AllocationSite::kTransitionInfoOrBoilerplateOffset),
-        Smi::FromInt(kFastElementsKindPackedToHoley));
-
-    __ bind(&normal_sequence);
-    int last_index =
-        GetSequenceIndexFromFastElementsKind(TERMINAL_FAST_ELEMENTS_KIND);
-    for (int i = 0; i <= last_index; ++i) {
-      Label next;
-      ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
-      __ cmpl(rdx, Immediate(kind));
-      __ j(not_equal, &next);
-      ArraySingleArgumentConstructorStub stub(masm->isolate(), kind);
-      __ TailCallStub(&stub);
-      __ bind(&next);
-    }
-
-    // If we reached this point there is a problem.
-    __ Abort(AbortReason::kUnexpectedElementsKindInArrayConstructor);
-  } else {
-    UNREACHABLE();
-  }
-}
-
-
-template<class T>
-static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) {
-  int to_index =
-      GetSequenceIndexFromFastElementsKind(TERMINAL_FAST_ELEMENTS_KIND);
-  for (int i = 0; i <= to_index; ++i) {
-    ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
-    T stub(isolate, kind);
-    stub.GetCode();
-    if (AllocationSite::ShouldTrack(kind)) {
-      T stub1(isolate, kind, DISABLE_ALLOCATION_SITES);
-      stub1.GetCode();
-    }
-  }
-}
-
-void CommonArrayConstructorStub::GenerateStubsAheadOfTime(Isolate* isolate) {
-  ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>(
-      isolate);
-  ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>(
-      isolate);
-  ArrayNArgumentsConstructorStub stub(isolate);
-  stub.GetCode();
-
-  ElementsKind kinds[2] = {PACKED_ELEMENTS, HOLEY_ELEMENTS};
-  for (int i = 0; i < 2; i++) {
-    // For internal arrays we only need a few things
-    InternalArrayNoArgumentConstructorStub stubh1(isolate, kinds[i]);
-    stubh1.GetCode();
-    InternalArraySingleArgumentConstructorStub stubh2(isolate, kinds[i]);
-    stubh2.GetCode();
-  }
-}
-
-void ArrayConstructorStub::GenerateDispatchToArrayStub(
-    MacroAssembler* masm, AllocationSiteOverrideMode mode) {
-  Label not_zero_case, not_one_case;
-  __ testp(rax, rax);
-  __ j(not_zero, &not_zero_case);
-  CreateArrayDispatch<ArrayNoArgumentConstructorStub>(masm, mode);
-
-  __ bind(&not_zero_case);
-  __ cmpl(rax, Immediate(1));
-  __ j(greater, &not_one_case);
-  CreateArrayDispatchOneArgument(masm, mode);
-
-  __ bind(&not_one_case);
-  ArrayNArgumentsConstructorStub stub(masm->isolate());
-  __ TailCallStub(&stub);
-}
-
-void ArrayConstructorStub::Generate(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- rax    : argc
-  //  -- rbx    : AllocationSite or undefined
-  //  -- rdi    : constructor
-  //  -- rdx    : new target
-  //  -- rsp[0] : return address
-  //  -- rsp[8] : last argument
-  // -----------------------------------
-  if (FLAG_debug_code) {
-    // The array construct code is only set for the global and natives
-    // builtin Array functions which always have maps.
-
-    // Initial map for the builtin Array function should be a map.
-    __ movp(rcx, FieldOperand(rdi, JSFunction::kPrototypeOrInitialMapOffset));
-    // Will both indicate a nullptr and a Smi.
-    STATIC_ASSERT(kSmiTag == 0);
-    Condition not_smi = NegateCondition(masm->CheckSmi(rcx));
-    __ Check(not_smi, AbortReason::kUnexpectedInitialMapForArrayFunction);
-    __ CmpObjectType(rcx, MAP_TYPE, rcx);
-    __ Check(equal, AbortReason::kUnexpectedInitialMapForArrayFunction);
-
-    // We should either have undefined in rbx or a valid AllocationSite
-    __ AssertUndefinedOrAllocationSite(rbx);
-  }
-
-  // Enter the context of the Array function.
-  __ movp(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
-
-  Label subclassing;
-  __ cmpp(rdi, rdx);
-  __ j(not_equal, &subclassing);
-
-  Label no_info;
-  // If the feedback vector is the undefined value call an array constructor
-  // that doesn't use AllocationSites.
-  __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex);
-  __ j(equal, &no_info);
-
-  // Only look at the lower 16 bits of the transition info.
-  __ movp(rdx, FieldOperand(
-                   rbx, AllocationSite::kTransitionInfoOrBoilerplateOffset));
-  __ SmiToInteger32(rdx, rdx);
-  STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
-  __ andp(rdx, Immediate(AllocationSite::ElementsKindBits::kMask));
-  GenerateDispatchToArrayStub(masm, DONT_OVERRIDE);
-
-  __ bind(&no_info);
-  GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES);
-
-  // Subclassing
-  __ bind(&subclassing);
-  StackArgumentsAccessor args(rsp, rax);
-  __ movp(args.GetReceiverOperand(), rdi);
-  __ addp(rax, Immediate(3));
-  __ PopReturnAddressTo(rcx);
-  __ Push(rdx);
-  __ Push(rbx);
-  __ PushReturnAddressFrom(rcx);
-  __ JumpToExternalReference(ExternalReference(Runtime::kNewArray, isolate()));
-}
-
-
-void InternalArrayConstructorStub::GenerateCase(
-    MacroAssembler* masm, ElementsKind kind) {
-  Label not_zero_case, not_one_case;
-  Label normal_sequence;
-
-  __ testp(rax, rax);
-  __ j(not_zero, &not_zero_case);
-  InternalArrayNoArgumentConstructorStub stub0(isolate(), kind);
-  __ TailCallStub(&stub0);
-
-  __ bind(&not_zero_case);
-  __ cmpl(rax, Immediate(1));
-  __ j(greater, &not_one_case);
-
-  if (IsFastPackedElementsKind(kind)) {
-    // We might need to create a holey array
-    // look at the first argument
-    StackArgumentsAccessor args(rsp, 1, ARGUMENTS_DONT_CONTAIN_RECEIVER);
-    __ movp(rcx, args.GetArgumentOperand(0));
-    __ testp(rcx, rcx);
-    __ j(zero, &normal_sequence);
-
-    InternalArraySingleArgumentConstructorStub
-        stub1_holey(isolate(), GetHoleyElementsKind(kind));
-    __ TailCallStub(&stub1_holey);
-  }
-
-  __ bind(&normal_sequence);
-  InternalArraySingleArgumentConstructorStub stub1(isolate(), kind);
-  __ TailCallStub(&stub1);
-
-  __ bind(&not_one_case);
-  ArrayNArgumentsConstructorStub stubN(isolate());
-  __ TailCallStub(&stubN);
-}
-
-
-void InternalArrayConstructorStub::Generate(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- rax    : argc
-  //  -- rdi    : constructor
-  //  -- rsp[0] : return address
-  //  -- rsp[8] : last argument
-  // -----------------------------------
-
-  if (FLAG_debug_code) {
-    // The array construct code is only set for the global and natives
-    // builtin Array functions which always have maps.
-
-    // Initial map for the builtin Array function should be a map.
-    __ movp(rcx, FieldOperand(rdi, JSFunction::kPrototypeOrInitialMapOffset));
-    // Will both indicate a nullptr and a Smi.
-    STATIC_ASSERT(kSmiTag == 0);
-    Condition not_smi = NegateCondition(masm->CheckSmi(rcx));
-    __ Check(not_smi, AbortReason::kUnexpectedInitialMapForArrayFunction);
-    __ CmpObjectType(rcx, MAP_TYPE, rcx);
-    __ Check(equal, AbortReason::kUnexpectedInitialMapForArrayFunction);
-  }
-
-  // Figure out the right elements kind
-  __ movp(rcx, FieldOperand(rdi, JSFunction::kPrototypeOrInitialMapOffset));
-
-  // Load the map's "bit field 2" into |result|. We only need the first byte,
-  // but the following masking takes care of that anyway.
-  __ movzxbp(rcx, FieldOperand(rcx, Map::kBitField2Offset));
-  // Retrieve elements_kind from bit field 2.
-  __ DecodeField<Map::ElementsKindBits>(rcx);
-
-  if (FLAG_debug_code) {
-    Label done;
-    __ cmpl(rcx, Immediate(PACKED_ELEMENTS));
-    __ j(equal, &done);
-    __ cmpl(rcx, Immediate(HOLEY_ELEMENTS));
-    __ Assert(
-        equal,
-        AbortReason::kInvalidElementsKindForInternalArrayOrInternalPackedArray);
-    __ bind(&done);
-  }
-
-  Label fast_elements_case;
-  __ cmpl(rcx, Immediate(PACKED_ELEMENTS));
-  __ j(equal, &fast_elements_case);
-  GenerateCase(masm, HOLEY_ELEMENTS);
-
-  __ bind(&fast_elements_case);
-  GenerateCase(masm, PACKED_ELEMENTS);
-}
-
-static int Offset(ExternalReference ref0, ExternalReference ref1) {
-  int64_t offset = (ref0.address() - ref1.address());
-  // Check that fits into int.
-  DCHECK(static_cast<int>(offset) == offset);
-  return static_cast<int>(offset);
-}
-
-// Prepares stack to put arguments (aligns and so on).  WIN64 calling convention
-// requires to put the pointer to the return value slot into rcx (rcx must be
-// preserverd until CallApiFunctionAndReturn). Clobbers rax.  Allocates
-// arg_stack_space * kPointerSize inside the exit frame (not GCed) accessible
-// via StackSpaceOperand.
-static void PrepareCallApiFunction(MacroAssembler* masm, int arg_stack_space) {
-  __ EnterApiExitFrame(arg_stack_space);
-}
-
-
-// Calls an API function.  Allocates HandleScope, extracts returned value
-// from handle and propagates exceptions.  Clobbers r14, r15, rbx and
-// caller-save registers.  Restores context.  On return removes
-// stack_space * kPointerSize (GCed).
-static void CallApiFunctionAndReturn(MacroAssembler* masm,
-                                     Register function_address,
-                                     ExternalReference thunk_ref,
-                                     Register thunk_last_arg, int stack_space,
-                                     Operand* stack_space_operand,
-                                     Operand return_value_operand) {
-  Label prologue;
-  Label promote_scheduled_exception;
-  Label delete_allocated_handles;
-  Label leave_exit_frame;
-  Label write_back;
-
-  Isolate* isolate = masm->isolate();
-  Factory* factory = isolate->factory();
-  ExternalReference next_address =
-      ExternalReference::handle_scope_next_address(isolate);
-  const int kNextOffset = 0;
-  const int kLimitOffset = Offset(
-      ExternalReference::handle_scope_limit_address(isolate), next_address);
-  const int kLevelOffset = Offset(
-      ExternalReference::handle_scope_level_address(isolate), next_address);
-  ExternalReference scheduled_exception_address =
-      ExternalReference::scheduled_exception_address(isolate);
-
-  DCHECK(rdx == function_address || r8 == function_address);
-  // Allocate HandleScope in callee-save registers.
-  Register prev_next_address_reg = r14;
-  Register prev_limit_reg = rbx;
-  Register base_reg = r15;
-  __ Move(base_reg, next_address);
-  __ movp(prev_next_address_reg, Operand(base_reg, kNextOffset));
-  __ movp(prev_limit_reg, Operand(base_reg, kLimitOffset));
-  __ addl(Operand(base_reg, kLevelOffset), Immediate(1));
-
-  if (FLAG_log_timer_events) {
-    FrameScope frame(masm, StackFrame::MANUAL);
-    __ PushSafepointRegisters();
-    __ PrepareCallCFunction(1);
-    __ LoadAddress(arg_reg_1, ExternalReference::isolate_address(isolate));
-    __ CallCFunction(ExternalReference::log_enter_external_function(isolate),
-                     1);
-    __ PopSafepointRegisters();
-  }
-
-  Label profiler_disabled;
-  Label end_profiler_check;
-  __ Move(rax, ExternalReference::is_profiling_address(isolate));
-  __ cmpb(Operand(rax, 0), Immediate(0));
-  __ j(zero, &profiler_disabled);
-
-  // Third parameter is the address of the actual getter function.
-  __ Move(thunk_last_arg, function_address);
-  __ Move(rax, thunk_ref);
-  __ jmp(&end_profiler_check);
-
-  __ bind(&profiler_disabled);
-  // Call the api function!
-  __ Move(rax, function_address);
-
-  __ bind(&end_profiler_check);
-
-  // Call the api function!
-  __ call(rax);
-
-  if (FLAG_log_timer_events) {
-    FrameScope frame(masm, StackFrame::MANUAL);
-    __ PushSafepointRegisters();
-    __ PrepareCallCFunction(1);
-    __ LoadAddress(arg_reg_1, ExternalReference::isolate_address(isolate));
-    __ CallCFunction(ExternalReference::log_leave_external_function(isolate),
-                     1);
-    __ PopSafepointRegisters();
-  }
-
-  // Load the value from ReturnValue
-  __ movp(rax, return_value_operand);
-  __ bind(&prologue);
-
-  // No more valid handles (the result handle was the last one). Restore
-  // previous handle scope.
-  __ subl(Operand(base_reg, kLevelOffset), Immediate(1));
-  __ movp(Operand(base_reg, kNextOffset), prev_next_address_reg);
-  __ cmpp(prev_limit_reg, Operand(base_reg, kLimitOffset));
-  __ j(not_equal, &delete_allocated_handles);
-
-  // Leave the API exit frame.
-  __ bind(&leave_exit_frame);
-  if (stack_space_operand != nullptr) {
-    __ movp(rbx, *stack_space_operand);
-  }
-  __ LeaveApiExitFrame();
-
-  // Check if the function scheduled an exception.
-  __ Move(rdi, scheduled_exception_address);
-  __ Cmp(Operand(rdi, 0), factory->the_hole_value());
-  __ j(not_equal, &promote_scheduled_exception);
-
-#if DEBUG
-  // Check if the function returned a valid JavaScript value.
-  Label ok;
-  Register return_value = rax;
-  Register map = rcx;
-
-  __ JumpIfSmi(return_value, &ok, Label::kNear);
-  __ movp(map, FieldOperand(return_value, HeapObject::kMapOffset));
-
-  __ CmpInstanceType(map, LAST_NAME_TYPE);
-  __ j(below_equal, &ok, Label::kNear);
-
-  __ CmpInstanceType(map, FIRST_JS_RECEIVER_TYPE);
-  __ j(above_equal, &ok, Label::kNear);
-
-  __ CompareRoot(map, Heap::kHeapNumberMapRootIndex);
-  __ j(equal, &ok, Label::kNear);
-
-  __ CompareRoot(return_value, Heap::kUndefinedValueRootIndex);
-  __ j(equal, &ok, Label::kNear);
-
-  __ CompareRoot(return_value, Heap::kTrueValueRootIndex);
-  __ j(equal, &ok, Label::kNear);
-
-  __ CompareRoot(return_value, Heap::kFalseValueRootIndex);
-  __ j(equal, &ok, Label::kNear);
-
-  __ CompareRoot(return_value, Heap::kNullValueRootIndex);
-  __ j(equal, &ok, Label::kNear);
-
-  __ Abort(AbortReason::kAPICallReturnedInvalidObject);
-
-  __ bind(&ok);
-#endif
-
-  if (stack_space_operand != nullptr) {
-    DCHECK_EQ(stack_space, 0);
-    __ PopReturnAddressTo(rcx);
-    __ addq(rsp, rbx);
-    __ jmp(rcx);
-  } else {
-    __ ret(stack_space * kPointerSize);
-  }
-
-  // Re-throw by promoting a scheduled exception.
-  __ bind(&promote_scheduled_exception);
-  __ TailCallRuntime(Runtime::kPromoteScheduledException);
-
-  // HandleScope limit has changed. Delete allocated extensions.
-  __ bind(&delete_allocated_handles);
-  __ movp(Operand(base_reg, kLimitOffset), prev_limit_reg);
-  __ movp(prev_limit_reg, rax);
-  __ LoadAddress(arg_reg_1, ExternalReference::isolate_address(isolate));
-  __ LoadAddress(rax,
-                 ExternalReference::delete_handle_scope_extensions(isolate));
-  __ call(rax);
-  __ movp(rax, prev_limit_reg);
-  __ jmp(&leave_exit_frame);
-}
-
-void CallApiCallbackStub::Generate(MacroAssembler* masm) {
-  // ----------- S t a t e -------------
-  //  -- rbx                 : call_data
-  //  -- rcx                 : holder
-  //  -- rdx                 : api_function_address
-  //  -- rsi                 : context
-  //  -- rax                 : number of arguments if argc is a register
-  //  -- rsp[0]              : return address
-  //  -- rsp[8]              : last argument
-  //  -- ...
-  //  -- rsp[argc * 8]       : first argument
-  //  -- rsp[(argc + 1) * 8] : receiver
-  // -----------------------------------
-
-  Register call_data = rbx;
-  Register holder = rcx;
-  Register api_function_address = rdx;
-  Register return_address = r8;
-
-  typedef FunctionCallbackArguments FCA;
-
-  STATIC_ASSERT(FCA::kArgsLength == 6);
-  STATIC_ASSERT(FCA::kNewTargetIndex == 5);
-  STATIC_ASSERT(FCA::kDataIndex == 4);
-  STATIC_ASSERT(FCA::kReturnValueOffset == 3);
-  STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2);
-  STATIC_ASSERT(FCA::kIsolateIndex == 1);
-  STATIC_ASSERT(FCA::kHolderIndex == 0);
-
-  __ PopReturnAddressTo(return_address);
-
-  // new target
-  __ PushRoot(Heap::kUndefinedValueRootIndex);
-
-  // call data
-  __ Push(call_data);
-
-  // return value
-  __ PushRoot(Heap::kUndefinedValueRootIndex);
-  // return value default
-  __ PushRoot(Heap::kUndefinedValueRootIndex);
-  // isolate
-  Register scratch = call_data;
-  __ Move(scratch, ExternalReference::isolate_address(masm->isolate()));
-  __ Push(scratch);
-  // holder
-  __ Push(holder);
-
-  int argc = this->argc();
-
-  __ movp(scratch, rsp);
-  // Push return address back on stack.
-  __ PushReturnAddressFrom(return_address);
-
-  // Allocate the v8::Arguments structure in the arguments' space since
-  // it's not controlled by GC.
-  const int kApiStackSpace = 3;
-
-  PrepareCallApiFunction(masm, kApiStackSpace);
-
-  // FunctionCallbackInfo::implicit_args_.
-  __ movp(StackSpaceOperand(0), scratch);
-  __ addp(scratch, Immediate((argc + FCA::kArgsLength - 1) * kPointerSize));
-  // FunctionCallbackInfo::values_.
-  __ movp(StackSpaceOperand(1), scratch);
-  // FunctionCallbackInfo::length_.
-  __ Set(StackSpaceOperand(2), argc);
-
-#if defined(__MINGW64__) || defined(_WIN64)
-  Register arguments_arg = rcx;
-  Register callback_arg = rdx;
-#else
-  Register arguments_arg = rdi;
-  Register callback_arg = rsi;
-#endif
-
-  // It's okay if api_function_address == callback_arg
-  // but not arguments_arg
-  DCHECK(api_function_address != arguments_arg);
-
-  // v8::InvocationCallback's argument.
-  __ leap(arguments_arg, StackSpaceOperand(0));
-
-  ExternalReference thunk_ref =
-      ExternalReference::invoke_function_callback(masm->isolate());
-
-  // Accessor for FunctionCallbackInfo and first js arg.
-  StackArgumentsAccessor args_from_rbp(rbp, FCA::kArgsLength + 1,
-                                       ARGUMENTS_DONT_CONTAIN_RECEIVER);
-  Operand return_value_operand = args_from_rbp.GetArgumentOperand(
-      FCA::kArgsLength - FCA::kReturnValueOffset);
-  const int stack_space = argc + FCA::kArgsLength + 1;
-  Operand* stack_space_operand = nullptr;
-  CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, callback_arg,
-                           stack_space, stack_space_operand,
-                           return_value_operand);
-}
-
-
-void CallApiGetterStub::Generate(MacroAssembler* masm) {
-#if defined(__MINGW64__) || defined(_WIN64)
-  Register getter_arg = r8;
-  Register accessor_info_arg = rdx;
-  Register name_arg = rcx;
-#else
-  Register getter_arg = rdx;
-  Register accessor_info_arg = rsi;
-  Register name_arg = rdi;
-#endif
-  Register api_function_address = r8;
-  Register receiver = ApiGetterDescriptor::ReceiverRegister();
-  Register holder = ApiGetterDescriptor::HolderRegister();
-  Register callback = ApiGetterDescriptor::CallbackRegister();
-  Register scratch = rax;
-  DCHECK(!AreAliased(receiver, holder, callback, scratch));
-
-  // Build v8::PropertyCallbackInfo::args_ array on the stack and push property
-  // name below the exit frame to make GC aware of them.
-  STATIC_ASSERT(PropertyCallbackArguments::kShouldThrowOnErrorIndex == 0);
-  STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 1);
-  STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 2);
-  STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 3);
-  STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 4);
-  STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 5);
-  STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 6);
-  STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 7);
-
-  // Insert additional parameters into the stack frame above return address.
-  __ PopReturnAddressTo(scratch);
-  __ Push(receiver);
-  __ Push(FieldOperand(callback, AccessorInfo::kDataOffset));
-  __ LoadRoot(kScratchRegister, Heap::kUndefinedValueRootIndex);
-  __ Push(kScratchRegister);  // return value
-  __ Push(kScratchRegister);  // return value default
-  __ PushAddress(ExternalReference::isolate_address(isolate()));
-  __ Push(holder);
-  __ Push(Smi::kZero);  // should_throw_on_error -> false
-  __ Push(FieldOperand(callback, AccessorInfo::kNameOffset));
-  __ PushReturnAddressFrom(scratch);
-
-  // v8::PropertyCallbackInfo::args_ array and name handle.
-  const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1;
-
-  // Allocate v8::PropertyCallbackInfo in non-GCed stack space.
-  const int kArgStackSpace = 1;
-
-  // Load address of v8::PropertyAccessorInfo::args_ array.
-  __ leap(scratch, Operand(rsp, 2 * kPointerSize));
-
-  PrepareCallApiFunction(masm, kArgStackSpace);
-  // Create v8::PropertyCallbackInfo object on the stack and initialize
-  // it's args_ field.
-  Operand info_object = StackSpaceOperand(0);
-  __ movp(info_object, scratch);
-
-  __ leap(name_arg, Operand(scratch, -kPointerSize));
-  // The context register (rsi) has been saved in PrepareCallApiFunction and
-  // could be used to pass arguments.
-  __ leap(accessor_info_arg, info_object);
-
-  ExternalReference thunk_ref =
-      ExternalReference::invoke_accessor_getter_callback(isolate());
-
-  // It's okay if api_function_address == getter_arg
-  // but not accessor_info_arg or name_arg
-  DCHECK(api_function_address != accessor_info_arg);
-  DCHECK(api_function_address != name_arg);
-  __ movp(scratch, FieldOperand(callback, AccessorInfo::kJsGetterOffset));
-  __ movp(api_function_address,
-          FieldOperand(scratch, Foreign::kForeignAddressOffset));
-
-  // +3 is to skip prolog, return address and name handle.
-  Operand return_value_operand(
-      rbp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize);
-  CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, getter_arg,
-                           kStackUnwindSpace, nullptr, return_value_operand);
-}
-
-#undef __
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_X64
diff --git a/src/v8/src/x64/codegen-x64.cc b/src/v8/src/x64/codegen-x64.cc
deleted file mode 100644
index 25a74b9..0000000
--- a/src/v8/src/x64/codegen-x64.cc
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2012 the V8 project 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 V8_TARGET_ARCH_X64
-
-#include "src/codegen.h"
-#include "src/macro-assembler.h"
-#include "src/x64/assembler-x64-inl.h"
-
-namespace v8 {
-namespace internal {
-
-#define __ masm.
-
-UnaryMathFunctionWithIsolate CreateSqrtFunction(Isolate* isolate) {
-  size_t allocated = 0;
-  byte* buffer = AllocatePage(isolate->heap()->GetRandomMmapAddr(), &allocated);
-  if (buffer == nullptr) return nullptr;
-
-  MacroAssembler masm(isolate, buffer, static_cast<int>(allocated),
-                      CodeObjectRequired::kNo);
-
-  // xmm0: raw double input.
-  // Move double input into registers.
-  __ Sqrtsd(xmm0, xmm0);
-  __ Ret();
-
-  CodeDesc desc;
-  masm.GetCode(isolate, &desc);
-  DCHECK(!RelocInfo::RequiresRelocation(isolate, desc));
-
-  Assembler::FlushICache(isolate, buffer, allocated);
-  CHECK(SetPermissions(buffer, allocated, PageAllocator::kReadExecute));
-  return FUNCTION_CAST<UnaryMathFunctionWithIsolate>(buffer);
-}
-
-#undef __
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_X64
diff --git a/src/v8/src/x64/cpu-x64.cc b/src/v8/src/x64/cpu-x64.cc
deleted file mode 100644
index f98862b..0000000
--- a/src/v8/src/x64/cpu-x64.cc
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// CPU specific code for x64 independent of OS goes here.
-
-#if defined(__GNUC__) && !defined(__MINGW64__)
-#include "src/third_party/valgrind/valgrind.h"
-#endif
-
-#if V8_TARGET_ARCH_X64
-
-#include "src/assembler.h"
-#include "src/macro-assembler.h"
-
-namespace v8 {
-namespace internal {
-
-void CpuFeatures::FlushICache(void* start, size_t size) {
-  // No need to flush the instruction cache on Intel. On Intel instruction
-  // cache flushing is only necessary when multiple cores running the same
-  // code simultaneously. V8 (and JavaScript) is single threaded and when code
-  // is patched on an intel CPU the core performing the patching will have its
-  // own instruction cache updated automatically.
-
-  // If flushing of the instruction cache becomes necessary Windows has the
-  // API function FlushInstructionCache.
-
-  // By default, valgrind only checks the stack for writes that might need to
-  // invalidate already cached translated code.  This leads to random
-  // instability when code patches or moves are sometimes unnoticed.  One
-  // solution is to run valgrind with --smc-check=all, but this comes at a big
-  // performance cost.  We can notify valgrind to invalidate its cache.
-#ifdef VALGRIND_DISCARD_TRANSLATIONS
-  unsigned res = VALGRIND_DISCARD_TRANSLATIONS(start, size);
-  USE(res);
-#endif
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_X64
diff --git a/src/v8/src/x64/deoptimizer-x64.cc b/src/v8/src/x64/deoptimizer-x64.cc
deleted file mode 100644
index 8c4d6a2..0000000
--- a/src/v8/src/x64/deoptimizer-x64.cc
+++ /dev/null
@@ -1,289 +0,0 @@
-// Copyright 2012 the V8 project 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 V8_TARGET_ARCH_X64
-
-#include "src/deoptimizer.h"
-#include "src/objects-inl.h"
-#include "src/register-configuration.h"
-#include "src/safepoint-table.h"
-
-namespace v8 {
-namespace internal {
-
-const int Deoptimizer::table_entry_size_ = 5;
-
-#define __ masm()->
-
-void Deoptimizer::TableEntryGenerator::Generate() {
-  Label deopt_table_entry;
-  __ bind(&deopt_table_entry);
-
-  GeneratePrologue();
-
-  // Save all general purpose registers before messing with them.
-  const int kNumberOfRegisters = Register::kNumRegisters;
-
-  const int kDoubleRegsSize = kDoubleSize * XMMRegister::kNumRegisters;
-  __ subp(rsp, Immediate(kDoubleRegsSize));
-
-  const RegisterConfiguration* config = RegisterConfiguration::Default();
-  for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
-    int code = config->GetAllocatableDoubleCode(i);
-    XMMRegister xmm_reg = XMMRegister::from_code(code);
-    int offset = code * kDoubleSize;
-    __ Movsd(Operand(rsp, offset), xmm_reg);
-  }
-
-  const int kFloatRegsSize = kFloatSize * XMMRegister::kNumRegisters;
-  __ subp(rsp, Immediate(kFloatRegsSize));
-
-  for (int i = 0; i < config->num_allocatable_float_registers(); ++i) {
-    int code = config->GetAllocatableFloatCode(i);
-    XMMRegister xmm_reg = XMMRegister::from_code(code);
-    int offset = code * kFloatSize;
-    __ Movss(Operand(rsp, offset), xmm_reg);
-  }
-
-  // We push all registers onto the stack, even though we do not need
-  // to restore all later.
-  for (int i = 0; i < kNumberOfRegisters; i++) {
-    Register r = Register::from_code(i);
-    __ pushq(r);
-  }
-
-  const int kSavedRegistersAreaSize =
-      kNumberOfRegisters * kRegisterSize + kDoubleRegsSize + kFloatRegsSize;
-
-  __ Store(ExternalReference(IsolateAddressId::kCEntryFPAddress, isolate()),
-           rbp);
-
-  // We use this to keep the value of the fifth argument temporarily.
-  // Unfortunately we can't store it directly in r8 (used for passing
-  // this on linux), since it is another parameter passing register on windows.
-  Register arg5 = r11;
-
-  // Get the bailout id from the stack.
-  __ movp(rax, Operand(rsp, kSavedRegistersAreaSize));
-
-  // address of deoptimization table
-  __ leap(rdx, Operand(&deopt_table_entry));
-
-  // rax = deopt_entry - deopt_table_entry - 5
-  __ subp(rax, rdx);
-  __ subl(rax, Immediate(5));
-
-  // rax /= 5
-  __ movl(rbx, Immediate(0xcccccccd));
-  __ imulq(rax, rbx);
-  __ shrq(rax, Immediate(0x22));
-
-  // bailout id
-  __ movl(arg_reg_3, rax);
-
-  // Get the address of the location in the code object
-  // and compute the fp-to-sp delta in register arg5.
-  __ movp(arg_reg_4, Operand(rsp, kSavedRegistersAreaSize + 1 * kRegisterSize));
-  __ leap(arg5, Operand(rsp, kSavedRegistersAreaSize + 1 * kRegisterSize +
-                            kPCOnStackSize));
-
-  __ subp(arg5, rbp);
-  __ negp(arg5);
-
-  // Allocate a new deoptimizer object.
-  __ PrepareCallCFunction(6);
-  __ movp(rax, Immediate(0));
-  Label context_check;
-  __ movp(rdi, Operand(rbp, CommonFrameConstants::kContextOrFrameTypeOffset));
-  __ JumpIfSmi(rdi, &context_check);
-  __ movp(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
-  __ bind(&context_check);
-  __ movp(arg_reg_1, rax);
-  __ Set(arg_reg_2, type());
-  // Args 3 and 4 are already in the right registers.
-
-  // On windows put the arguments on the stack (PrepareCallCFunction
-  // has created space for this). On linux pass the arguments in r8 and r9.
-#ifdef _WIN64
-  __ movq(Operand(rsp, 4 * kRegisterSize), arg5);
-  __ LoadAddress(arg5, ExternalReference::isolate_address(isolate()));
-  __ movq(Operand(rsp, 5 * kRegisterSize), arg5);
-#else
-  __ movp(r8, arg5);
-  __ LoadAddress(r9, ExternalReference::isolate_address(isolate()));
-#endif
-
-  { AllowExternalCallThatCantCauseGC scope(masm());
-    __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate()), 6);
-  }
-  // Preserve deoptimizer object in register rax and get the input
-  // frame descriptor pointer.
-  __ movp(rbx, Operand(rax, Deoptimizer::input_offset()));
-
-  // Fill in the input registers.
-  for (int i = kNumberOfRegisters -1; i >= 0; i--) {
-    int offset = (i * kPointerSize) + FrameDescription::registers_offset();
-    __ PopQuad(Operand(rbx, offset));
-  }
-
-  // Fill in the float input registers.
-  int float_regs_offset = FrameDescription::float_registers_offset();
-  for (int i = 0; i < XMMRegister::kNumRegisters; i++) {
-    int src_offset = i * kFloatSize;
-    int dst_offset = i * kFloatSize + float_regs_offset;
-    __ movl(rcx, Operand(rsp, src_offset));
-    __ movl(Operand(rbx, dst_offset), rcx);
-  }
-  __ addp(rsp, Immediate(kFloatRegsSize));
-
-  // Fill in the double input registers.
-  int double_regs_offset = FrameDescription::double_registers_offset();
-  for (int i = 0; i < XMMRegister::kNumRegisters; i++) {
-    int dst_offset = i * kDoubleSize + double_regs_offset;
-    __ popq(Operand(rbx, dst_offset));
-  }
-
-  // Remove the bailout id and return address from the stack.
-  __ addp(rsp, Immediate(1 * kRegisterSize + kPCOnStackSize));
-
-  // Compute a pointer to the unwinding limit in register rcx; that is
-  // the first stack slot not part of the input frame.
-  __ movp(rcx, Operand(rbx, FrameDescription::frame_size_offset()));
-  __ addp(rcx, rsp);
-
-  // Unwind the stack down to - but not including - the unwinding
-  // limit and copy the contents of the activation frame to the input
-  // frame description.
-  __ leap(rdx, Operand(rbx, FrameDescription::frame_content_offset()));
-  Label pop_loop_header;
-  __ jmp(&pop_loop_header);
-  Label pop_loop;
-  __ bind(&pop_loop);
-  __ Pop(Operand(rdx, 0));
-  __ addp(rdx, Immediate(sizeof(intptr_t)));
-  __ bind(&pop_loop_header);
-  __ cmpp(rcx, rsp);
-  __ j(not_equal, &pop_loop);
-
-  // Compute the output frame in the deoptimizer.
-  __ pushq(rax);
-  __ PrepareCallCFunction(2);
-  __ movp(arg_reg_1, rax);
-  __ LoadAddress(arg_reg_2, ExternalReference::isolate_address(isolate()));
-  {
-    AllowExternalCallThatCantCauseGC scope(masm());
-    __ CallCFunction(
-        ExternalReference::compute_output_frames_function(isolate()), 2);
-  }
-  __ popq(rax);
-
-  __ movp(rsp, Operand(rax, Deoptimizer::caller_frame_top_offset()));
-
-  // Replace the current (input) frame with the output frames.
-  Label outer_push_loop, inner_push_loop,
-      outer_loop_header, inner_loop_header;
-  // Outer loop state: rax = current FrameDescription**, rdx = one past the
-  // last FrameDescription**.
-  __ movl(rdx, Operand(rax, Deoptimizer::output_count_offset()));
-  __ movp(rax, Operand(rax, Deoptimizer::output_offset()));
-  __ leap(rdx, Operand(rax, rdx, times_pointer_size, 0));
-  __ jmp(&outer_loop_header);
-  __ bind(&outer_push_loop);
-  // Inner loop state: rbx = current FrameDescription*, rcx = loop index.
-  __ movp(rbx, Operand(rax, 0));
-  __ movp(rcx, Operand(rbx, FrameDescription::frame_size_offset()));
-  __ jmp(&inner_loop_header);
-  __ bind(&inner_push_loop);
-  __ subp(rcx, Immediate(sizeof(intptr_t)));
-  __ Push(Operand(rbx, rcx, times_1, FrameDescription::frame_content_offset()));
-  __ bind(&inner_loop_header);
-  __ testp(rcx, rcx);
-  __ j(not_zero, &inner_push_loop);
-  __ addp(rax, Immediate(kPointerSize));
-  __ bind(&outer_loop_header);
-  __ cmpp(rax, rdx);
-  __ j(below, &outer_push_loop);
-
-  for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
-    int code = config->GetAllocatableDoubleCode(i);
-    XMMRegister xmm_reg = XMMRegister::from_code(code);
-    int src_offset = code * kDoubleSize + double_regs_offset;
-    __ Movsd(xmm_reg, Operand(rbx, src_offset));
-  }
-
-  // Push pc and continuation from the last output frame.
-  __ PushQuad(Operand(rbx, FrameDescription::pc_offset()));
-  __ PushQuad(Operand(rbx, FrameDescription::continuation_offset()));
-
-  // Push the registers from the last output frame.
-  for (int i = 0; i < kNumberOfRegisters; i++) {
-    int offset = (i * kPointerSize) + FrameDescription::registers_offset();
-    __ PushQuad(Operand(rbx, offset));
-  }
-
-  // Restore the registers from the stack.
-  for (int i = kNumberOfRegisters - 1; i >= 0 ; i--) {
-    Register r = Register::from_code(i);
-    // Do not restore rsp, simply pop the value into the next register
-    // and overwrite this afterwards.
-    if (r == rsp) {
-      DCHECK_GT(i, 0);
-      r = Register::from_code(i - 1);
-    }
-    __ popq(r);
-  }
-
-  // Set up the roots register.
-  __ InitializeRootRegister();
-
-  // Return to the continuation point.
-  __ ret(0);
-}
-
-
-void Deoptimizer::TableEntryGenerator::GeneratePrologue() {
-  // Create a sequence of deoptimization entries.
-  Label done;
-  for (int i = 0; i < count(); i++) {
-    int start = masm()->pc_offset();
-    USE(start);
-    __ call(&done);
-    DCHECK(masm()->pc_offset() - start == table_entry_size_);
-  }
-  __ bind(&done);
-}
-
-bool Deoptimizer::PadTopOfStackRegister() { return false; }
-
-void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) {
-  if (kPCOnStackSize == 2 * kPointerSize) {
-    // Zero out the high-32 bit of PC for x32 port.
-    SetFrameSlot(offset + kPointerSize, 0);
-  }
-  SetFrameSlot(offset, value);
-}
-
-
-void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) {
-  if (kFPOnStackSize == 2 * kPointerSize) {
-    // Zero out the high-32 bit of FP for x32 port.
-    SetFrameSlot(offset + kPointerSize, 0);
-  }
-  SetFrameSlot(offset, value);
-}
-
-
-void FrameDescription::SetCallerConstantPool(unsigned offset, intptr_t value) {
-  // No embedded constant pool support.
-  UNREACHABLE();
-}
-
-
-#undef __
-
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_X64
diff --git a/src/v8/src/x64/disasm-x64.cc b/src/v8/src/x64/disasm-x64.cc
deleted file mode 100644
index 0cb9231..0000000
--- a/src/v8/src/x64/disasm-x64.cc
+++ /dev/null
@@ -1,2855 +0,0 @@
-// Copyright 2011 the V8 project 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 !V8_OS_STARBOARD
-#include <assert.h>
-#include <stdarg.h>
-#include <stdio.h>
-#else  // V8_OS_STARBOARD
-#include "starboard/common/log.h"
-#endif  // !V8_OS_STARBOARD
-
-#if V8_TARGET_ARCH_X64
-
-#include "src/base/compiler-specific.h"
-#include "src/base/lazy-instance.h"
-#include "src/disasm.h"
-#include "src/x64/sse-instr.h"
-
-namespace disasm {
-
-enum OperandType {
-  UNSET_OP_ORDER = 0,
-  // Operand size decides between 16, 32 and 64 bit operands.
-  REG_OPER_OP_ORDER = 1,  // Register destination, operand source.
-  OPER_REG_OP_ORDER = 2,  // Operand destination, register source.
-  // Fixed 8-bit operands.
-  BYTE_SIZE_OPERAND_FLAG = 4,
-  BYTE_REG_OPER_OP_ORDER = REG_OPER_OP_ORDER | BYTE_SIZE_OPERAND_FLAG,
-  BYTE_OPER_REG_OP_ORDER = OPER_REG_OP_ORDER | BYTE_SIZE_OPERAND_FLAG
-};
-
-
-//------------------------------------------------------------------
-// Tables
-//------------------------------------------------------------------
-struct ByteMnemonic {
-  int b;  // -1 terminates, otherwise must be in range (0..255)
-  OperandType op_order_;
-  const char* mnem;
-};
-
-
-static const ByteMnemonic two_operands_instr[] = {
-  { 0x00, BYTE_OPER_REG_OP_ORDER, "add" },
-  { 0x01, OPER_REG_OP_ORDER,      "add" },
-  { 0x02, BYTE_REG_OPER_OP_ORDER, "add" },
-  { 0x03, REG_OPER_OP_ORDER,      "add" },
-  { 0x08, BYTE_OPER_REG_OP_ORDER, "or" },
-  { 0x09, OPER_REG_OP_ORDER,      "or" },
-  { 0x0A, BYTE_REG_OPER_OP_ORDER, "or" },
-  { 0x0B, REG_OPER_OP_ORDER,      "or" },
-  { 0x10, BYTE_OPER_REG_OP_ORDER, "adc" },
-  { 0x11, OPER_REG_OP_ORDER,      "adc" },
-  { 0x12, BYTE_REG_OPER_OP_ORDER, "adc" },
-  { 0x13, REG_OPER_OP_ORDER,      "adc" },
-  { 0x18, BYTE_OPER_REG_OP_ORDER, "sbb" },
-  { 0x19, OPER_REG_OP_ORDER,      "sbb" },
-  { 0x1A, BYTE_REG_OPER_OP_ORDER, "sbb" },
-  { 0x1B, REG_OPER_OP_ORDER,      "sbb" },
-  { 0x20, BYTE_OPER_REG_OP_ORDER, "and" },
-  { 0x21, OPER_REG_OP_ORDER,      "and" },
-  { 0x22, BYTE_REG_OPER_OP_ORDER, "and" },
-  { 0x23, REG_OPER_OP_ORDER,      "and" },
-  { 0x28, BYTE_OPER_REG_OP_ORDER, "sub" },
-  { 0x29, OPER_REG_OP_ORDER,      "sub" },
-  { 0x2A, BYTE_REG_OPER_OP_ORDER, "sub" },
-  { 0x2B, REG_OPER_OP_ORDER,      "sub" },
-  { 0x30, BYTE_OPER_REG_OP_ORDER, "xor" },
-  { 0x31, OPER_REG_OP_ORDER,      "xor" },
-  { 0x32, BYTE_REG_OPER_OP_ORDER, "xor" },
-  { 0x33, REG_OPER_OP_ORDER,      "xor" },
-  { 0x38, BYTE_OPER_REG_OP_ORDER, "cmp" },
-  { 0x39, OPER_REG_OP_ORDER,      "cmp" },
-  { 0x3A, BYTE_REG_OPER_OP_ORDER, "cmp" },
-  { 0x3B, REG_OPER_OP_ORDER,      "cmp" },
-  { 0x63, REG_OPER_OP_ORDER,      "movsxl" },
-  { 0x84, BYTE_REG_OPER_OP_ORDER, "test" },
-  { 0x85, REG_OPER_OP_ORDER,      "test" },
-  { 0x86, BYTE_REG_OPER_OP_ORDER, "xchg" },
-  { 0x87, REG_OPER_OP_ORDER,      "xchg" },
-  { 0x88, BYTE_OPER_REG_OP_ORDER, "mov" },
-  { 0x89, OPER_REG_OP_ORDER,      "mov" },
-  { 0x8A, BYTE_REG_OPER_OP_ORDER, "mov" },
-  { 0x8B, REG_OPER_OP_ORDER,      "mov" },
-  { 0x8D, REG_OPER_OP_ORDER,      "lea" },
-  { -1, UNSET_OP_ORDER, "" }
-};
-
-
-static const ByteMnemonic zero_operands_instr[] = {
-  { 0xC3, UNSET_OP_ORDER, "ret" },
-  { 0xC9, UNSET_OP_ORDER, "leave" },
-  { 0xF4, UNSET_OP_ORDER, "hlt" },
-  { 0xFC, UNSET_OP_ORDER, "cld" },
-  { 0xCC, UNSET_OP_ORDER, "int3" },
-  { 0x60, UNSET_OP_ORDER, "pushad" },
-  { 0x61, UNSET_OP_ORDER, "popad" },
-  { 0x9C, UNSET_OP_ORDER, "pushfd" },
-  { 0x9D, UNSET_OP_ORDER, "popfd" },
-  { 0x9E, UNSET_OP_ORDER, "sahf" },
-  { 0x99, UNSET_OP_ORDER, "cdq" },
-  { 0x9B, UNSET_OP_ORDER, "fwait" },
-  { 0xA4, UNSET_OP_ORDER, "movs" },
-  { 0xA5, UNSET_OP_ORDER, "movs" },
-  { 0xA6, UNSET_OP_ORDER, "cmps" },
-  { 0xA7, UNSET_OP_ORDER, "cmps" },
-  { -1, UNSET_OP_ORDER, "" }
-};
-
-
-static const ByteMnemonic call_jump_instr[] = {
-  { 0xE8, UNSET_OP_ORDER, "call" },
-  { 0xE9, UNSET_OP_ORDER, "jmp" },
-  { -1, UNSET_OP_ORDER, "" }
-};
-
-
-static const ByteMnemonic short_immediate_instr[] = {
-  { 0x05, UNSET_OP_ORDER, "add" },
-  { 0x0D, UNSET_OP_ORDER, "or" },
-  { 0x15, UNSET_OP_ORDER, "adc" },
-  { 0x1D, UNSET_OP_ORDER, "sbb" },
-  { 0x25, UNSET_OP_ORDER, "and" },
-  { 0x2D, UNSET_OP_ORDER, "sub" },
-  { 0x35, UNSET_OP_ORDER, "xor" },
-  { 0x3D, UNSET_OP_ORDER, "cmp" },
-  { -1, UNSET_OP_ORDER, "" }
-};
-
-
-static const char* const conditional_code_suffix[] = {
-  "o", "no", "c", "nc", "z", "nz", "na", "a",
-  "s", "ns", "pe", "po", "l", "ge", "le", "g"
-};
-
-
-enum InstructionType {
-  NO_INSTR,
-  ZERO_OPERANDS_INSTR,
-  TWO_OPERANDS_INSTR,
-  JUMP_CONDITIONAL_SHORT_INSTR,
-  REGISTER_INSTR,
-  PUSHPOP_INSTR,  // Has implicit 64-bit operand size.
-  MOVE_REG_INSTR,
-  CALL_JUMP_INSTR,
-  SHORT_IMMEDIATE_INSTR
-};
-
-enum Prefixes {
-  ESCAPE_PREFIX = 0x0F,
-  OPERAND_SIZE_OVERRIDE_PREFIX = 0x66,
-  ADDRESS_SIZE_OVERRIDE_PREFIX = 0x67,
-  VEX3_PREFIX = 0xC4,
-  VEX2_PREFIX = 0xC5,
-  LOCK_PREFIX = 0xF0,
-  REPNE_PREFIX = 0xF2,
-  REP_PREFIX = 0xF3,
-  REPEQ_PREFIX = REP_PREFIX
-};
-
-struct InstructionDesc {
-  const char* mnem;
-  InstructionType type;
-  OperandType op_order_;
-  bool byte_size_operation;  // Fixed 8-bit operation.
-};
-
-
-class InstructionTable {
- public:
-  InstructionTable();
-  const InstructionDesc& Get(byte x) const {
-    return instructions_[x];
-  }
-
- private:
-  InstructionDesc instructions_[256];
-  void Clear();
-  void Init();
-  void CopyTable(const ByteMnemonic bm[], InstructionType type);
-  void SetTableRange(InstructionType type, byte start, byte end, bool byte_size,
-                     const char* mnem);
-  void AddJumpConditionalShort();
-};
-
-
-InstructionTable::InstructionTable() {
-  Clear();
-  Init();
-}
-
-
-void InstructionTable::Clear() {
-  for (int i = 0; i < 256; i++) {
-    instructions_[i].mnem = "(bad)";
-    instructions_[i].type = NO_INSTR;
-    instructions_[i].op_order_ = UNSET_OP_ORDER;
-    instructions_[i].byte_size_operation = false;
-  }
-}
-
-
-void InstructionTable::Init() {
-  CopyTable(two_operands_instr, TWO_OPERANDS_INSTR);
-  CopyTable(zero_operands_instr, ZERO_OPERANDS_INSTR);
-  CopyTable(call_jump_instr, CALL_JUMP_INSTR);
-  CopyTable(short_immediate_instr, SHORT_IMMEDIATE_INSTR);
-  AddJumpConditionalShort();
-  SetTableRange(PUSHPOP_INSTR, 0x50, 0x57, false, "push");
-  SetTableRange(PUSHPOP_INSTR, 0x58, 0x5F, false, "pop");
-  SetTableRange(MOVE_REG_INSTR, 0xB8, 0xBF, false, "mov");
-}
-
-
-void InstructionTable::CopyTable(const ByteMnemonic bm[],
-                                 InstructionType type) {
-  for (int i = 0; bm[i].b >= 0; i++) {
-    InstructionDesc* id = &instructions_[bm[i].b];
-    id->mnem = bm[i].mnem;
-    OperandType op_order = bm[i].op_order_;
-    id->op_order_ =
-        static_cast<OperandType>(op_order & ~BYTE_SIZE_OPERAND_FLAG);
-    DCHECK_EQ(NO_INSTR, id->type);  // Information not already entered
-    id->type = type;
-    id->byte_size_operation = ((op_order & BYTE_SIZE_OPERAND_FLAG) != 0);
-  }
-}
-
-
-void InstructionTable::SetTableRange(InstructionType type,
-                                     byte start,
-                                     byte end,
-                                     bool byte_size,
-                                     const char* mnem) {
-  for (byte b = start; b <= end; b++) {
-    InstructionDesc* id = &instructions_[b];
-    DCHECK_EQ(NO_INSTR, id->type);  // Information not already entered
-    id->mnem = mnem;
-    id->type = type;
-    id->byte_size_operation = byte_size;
-  }
-}
-
-
-void InstructionTable::AddJumpConditionalShort() {
-  for (byte b = 0x70; b <= 0x7F; b++) {
-    InstructionDesc* id = &instructions_[b];
-    DCHECK_EQ(NO_INSTR, id->type);  // Information not already entered
-    id->mnem = nullptr;             // Computed depending on condition code.
-    id->type = JUMP_CONDITIONAL_SHORT_INSTR;
-  }
-}
-
-
-static v8::base::LazyInstance<InstructionTable>::type instruction_table =
-    LAZY_INSTANCE_INITIALIZER;
-
-
-static const InstructionDesc cmov_instructions[16] = {
-  {"cmovo", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovno", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovc", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovnc", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovz", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovnz", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovna", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmova", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovs", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovns", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovpe", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovpo", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovl", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovge", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovle", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false},
-  {"cmovg", TWO_OPERANDS_INSTR, REG_OPER_OP_ORDER, false}
-};
-
-
-//------------------------------------------------------------------------------
-// DisassemblerX64 implementation.
-
-enum UnimplementedOpcodeAction {
-  CONTINUE_ON_UNIMPLEMENTED_OPCODE,
-  ABORT_ON_UNIMPLEMENTED_OPCODE
-};
-
-
-// A new DisassemblerX64 object is created to disassemble each instruction.
-// The object can only disassemble a single instruction.
-class DisassemblerX64 {
- public:
-  DisassemblerX64(const NameConverter& converter,
-                  UnimplementedOpcodeAction unimplemented_action =
-                      ABORT_ON_UNIMPLEMENTED_OPCODE)
-      : converter_(converter),
-        tmp_buffer_pos_(0),
-        abort_on_unimplemented_(unimplemented_action ==
-                                ABORT_ON_UNIMPLEMENTED_OPCODE),
-        rex_(0),
-        operand_size_(0),
-        group_1_prefix_(0),
-        vex_byte0_(0),
-        vex_byte1_(0),
-        vex_byte2_(0),
-        byte_size_operand_(false),
-        instruction_table_(instruction_table.Pointer()) {
-    tmp_buffer_[0] = '\0';
-  }
-
-  virtual ~DisassemblerX64() {
-  }
-
-  // Writes one disassembled instruction into 'buffer' (0-terminated).
-  // Returns the length of the disassembled machine instruction in bytes.
-  int InstructionDecode(v8::internal::Vector<char> buffer, byte* instruction);
-
- private:
-  enum OperandSize {
-    OPERAND_BYTE_SIZE = 0,
-    OPERAND_WORD_SIZE = 1,
-    OPERAND_DOUBLEWORD_SIZE = 2,
-    OPERAND_QUADWORD_SIZE = 3
-  };
-
-  const NameConverter& converter_;
-  v8::internal::EmbeddedVector<char, 128> tmp_buffer_;
-  unsigned int tmp_buffer_pos_;
-  bool abort_on_unimplemented_;
-  // Prefixes parsed
-  byte rex_;
-  byte operand_size_;  // 0x66 or (if no group 3 prefix is present) 0x0.
-  byte group_1_prefix_;  // 0xF2, 0xF3, or (if no group 1 prefix is present) 0.
-  byte vex_byte0_;       // 0xC4 or 0xC5
-  byte vex_byte1_;
-  byte vex_byte2_;  // only for 3 bytes vex prefix
-  // Byte size operand override.
-  bool byte_size_operand_;
-  const InstructionTable* const instruction_table_;
-
-  void setRex(byte rex) {
-    DCHECK_EQ(0x40, rex & 0xF0);
-    rex_ = rex;
-  }
-
-  bool rex() { return rex_ != 0; }
-
-  bool rex_b() { return (rex_ & 0x01) != 0; }
-
-  // Actual number of base register given the low bits and the rex.b state.
-  int base_reg(int low_bits) { return low_bits | ((rex_ & 0x01) << 3); }
-
-  bool rex_x() { return (rex_ & 0x02) != 0; }
-
-  bool rex_r() { return (rex_ & 0x04) != 0; }
-
-  bool rex_w() { return (rex_ & 0x08) != 0; }
-
-  bool vex_w() {
-    DCHECK(vex_byte0_ == VEX3_PREFIX || vex_byte0_ == VEX2_PREFIX);
-    return vex_byte0_ == VEX3_PREFIX ? (vex_byte2_ & 0x80) != 0 : false;
-  }
-
-  bool vex_128() {
-    DCHECK(vex_byte0_ == VEX3_PREFIX || vex_byte0_ == VEX2_PREFIX);
-    byte checked = vex_byte0_ == VEX3_PREFIX ? vex_byte2_ : vex_byte1_;
-    return (checked & 4) == 0;
-  }
-
-  bool vex_none() {
-    DCHECK(vex_byte0_ == VEX3_PREFIX || vex_byte0_ == VEX2_PREFIX);
-    byte checked = vex_byte0_ == VEX3_PREFIX ? vex_byte2_ : vex_byte1_;
-    return (checked & 3) == 0;
-  }
-
-  bool vex_66() {
-    DCHECK(vex_byte0_ == VEX3_PREFIX || vex_byte0_ == VEX2_PREFIX);
-    byte checked = vex_byte0_ == VEX3_PREFIX ? vex_byte2_ : vex_byte1_;
-    return (checked & 3) == 1;
-  }
-
-  bool vex_f3() {
-    DCHECK(vex_byte0_ == VEX3_PREFIX || vex_byte0_ == VEX2_PREFIX);
-    byte checked = vex_byte0_ == VEX3_PREFIX ? vex_byte2_ : vex_byte1_;
-    return (checked & 3) == 2;
-  }
-
-  bool vex_f2() {
-    DCHECK(vex_byte0_ == VEX3_PREFIX || vex_byte0_ == VEX2_PREFIX);
-    byte checked = vex_byte0_ == VEX3_PREFIX ? vex_byte2_ : vex_byte1_;
-    return (checked & 3) == 3;
-  }
-
-  bool vex_0f() {
-    if (vex_byte0_ == VEX2_PREFIX) return true;
-    return (vex_byte1_ & 3) == 1;
-  }
-
-  bool vex_0f38() {
-    if (vex_byte0_ == VEX2_PREFIX) return false;
-    return (vex_byte1_ & 3) == 2;
-  }
-
-  bool vex_0f3a() {
-    if (vex_byte0_ == VEX2_PREFIX) return false;
-    return (vex_byte1_ & 3) == 3;
-  }
-
-  int vex_vreg() {
-    DCHECK(vex_byte0_ == VEX3_PREFIX || vex_byte0_ == VEX2_PREFIX);
-    byte checked = vex_byte0_ == VEX3_PREFIX ? vex_byte2_ : vex_byte1_;
-    return ~(checked >> 3) & 0xF;
-  }
-
-  OperandSize operand_size() {
-    if (byte_size_operand_) return OPERAND_BYTE_SIZE;
-    if (rex_w()) return OPERAND_QUADWORD_SIZE;
-    if (operand_size_ != 0) return OPERAND_WORD_SIZE;
-    return OPERAND_DOUBLEWORD_SIZE;
-  }
-
-  char operand_size_code() {
-    return "bwlq"[operand_size()];
-  }
-
-  char float_size_code() { return "sd"[rex_w()]; }
-
-  const char* NameOfCPURegister(int reg) const {
-    return converter_.NameOfCPURegister(reg);
-  }
-
-  const char* NameOfByteCPURegister(int reg) const {
-    return converter_.NameOfByteCPURegister(reg);
-  }
-
-  const char* NameOfXMMRegister(int reg) const {
-    return converter_.NameOfXMMRegister(reg);
-  }
-
-  const char* NameOfAddress(byte* addr) const {
-    return converter_.NameOfAddress(addr);
-  }
-
-  // Disassembler helper functions.
-  void get_modrm(byte data,
-                 int* mod,
-                 int* regop,
-                 int* rm) {
-    *mod = (data >> 6) & 3;
-    *regop = ((data & 0x38) >> 3) | (rex_r() ? 8 : 0);
-    *rm = (data & 7) | (rex_b() ? 8 : 0);
-  }
-
-  void get_sib(byte data,
-               int* scale,
-               int* index,
-               int* base) {
-    *scale = (data >> 6) & 3;
-    *index = ((data >> 3) & 7) | (rex_x() ? 8 : 0);
-    *base = (data & 7) | (rex_b() ? 8 : 0);
-  }
-
-  typedef const char* (DisassemblerX64::*RegisterNameMapping)(int reg) const;
-
-  int PrintRightOperandHelper(byte* modrmp,
-                              RegisterNameMapping register_name);
-  int PrintRightOperand(byte* modrmp);
-  int PrintRightByteOperand(byte* modrmp);
-  int PrintRightXMMOperand(byte* modrmp);
-  int PrintOperands(const char* mnem,
-                    OperandType op_order,
-                    byte* data);
-  int PrintImmediate(byte* data, OperandSize size);
-  int PrintImmediateOp(byte* data);
-  const char* TwoByteMnemonic(byte opcode);
-  int TwoByteOpcodeInstruction(byte* data);
-  int F6F7Instruction(byte* data);
-  int ShiftInstruction(byte* data);
-  int JumpShort(byte* data);
-  int JumpConditional(byte* data);
-  int JumpConditionalShort(byte* data);
-  int SetCC(byte* data);
-  int FPUInstruction(byte* data);
-  int MemoryFPUInstruction(int escape_opcode, int regop, byte* modrm_start);
-  int RegisterFPUInstruction(int escape_opcode, byte modrm_byte);
-  int AVXInstruction(byte* data);
-  PRINTF_FORMAT(2, 3) void AppendToBuffer(const char* format, ...);
-
-  void UnimplementedInstruction() {
-    if (abort_on_unimplemented_) {
-      FATAL("'Unimplemented Instruction'");
-    } else {
-      AppendToBuffer("'Unimplemented Instruction'");
-    }
-  }
-};
-
-
-void DisassemblerX64::AppendToBuffer(const char* format, ...) {
-  v8::internal::Vector<char> buf = tmp_buffer_ + tmp_buffer_pos_;
-  va_list args;
-  va_start(args, format);
-  int result = v8::internal::VSNPrintF(buf, format, args);
-  va_end(args);
-  tmp_buffer_pos_ += result;
-}
-
-
-int DisassemblerX64::PrintRightOperandHelper(
-    byte* modrmp,
-    RegisterNameMapping direct_register_name) {
-  int mod, regop, rm;
-  get_modrm(*modrmp, &mod, &regop, &rm);
-  RegisterNameMapping register_name = (mod == 3) ? direct_register_name :
-      &DisassemblerX64::NameOfCPURegister;
-  switch (mod) {
-    case 0:
-      if ((rm & 7) == 5) {
-        int32_t disp = *reinterpret_cast<int32_t*>(modrmp + 1);
-        AppendToBuffer("[rip+0x%x]", disp);
-        return 5;
-      } else if ((rm & 7) == 4) {
-        // Codes for SIB byte.
-        byte sib = *(modrmp + 1);
-        int scale, index, base;
-        get_sib(sib, &scale, &index, &base);
-        if (index == 4 && (base & 7) == 4 && scale == 0 /*times_1*/) {
-          // index == rsp means no index. Only use sib byte with no index for
-          // rsp and r12 base.
-          AppendToBuffer("[%s]", NameOfCPURegister(base));
-          return 2;
-        } else if (base == 5) {
-          // base == rbp means no base register (when mod == 0).
-          int32_t disp = *reinterpret_cast<int32_t*>(modrmp + 2);
-          AppendToBuffer("[%s*%d%s0x%x]",
-                         NameOfCPURegister(index),
-                         1 << scale,
-                         disp < 0 ? "-" : "+",
-                         disp < 0 ? -disp : disp);
-          return 6;
-        } else if (index != 4 && base != 5) {
-          // [base+index*scale]
-          AppendToBuffer("[%s+%s*%d]",
-                         NameOfCPURegister(base),
-                         NameOfCPURegister(index),
-                         1 << scale);
-          return 2;
-        } else {
-          UnimplementedInstruction();
-          return 1;
-        }
-      } else {
-        AppendToBuffer("[%s]", NameOfCPURegister(rm));
-        return 1;
-      }
-      break;
-    case 1:  // fall through
-    case 2:
-      if ((rm & 7) == 4) {
-        byte sib = *(modrmp + 1);
-        int scale, index, base;
-        get_sib(sib, &scale, &index, &base);
-        int disp = (mod == 2) ? *reinterpret_cast<int32_t*>(modrmp + 2)
-                              : *reinterpret_cast<int8_t*>(modrmp + 2);
-        if (index == 4 && (base & 7) == 4 && scale == 0 /*times_1*/) {
-          AppendToBuffer("[%s%s0x%x]",
-                         NameOfCPURegister(base),
-                         disp < 0 ? "-" : "+",
-                         disp < 0 ? -disp : disp);
-        } else {
-          AppendToBuffer("[%s+%s*%d%s0x%x]",
-                         NameOfCPURegister(base),
-                         NameOfCPURegister(index),
-                         1 << scale,
-                         disp < 0 ? "-" : "+",
-                         disp < 0 ? -disp : disp);
-        }
-        return mod == 2 ? 6 : 3;
-      } else {
-        // No sib.
-        int disp = (mod == 2) ? *reinterpret_cast<int32_t*>(modrmp + 1)
-                              : *reinterpret_cast<int8_t*>(modrmp + 1);
-        AppendToBuffer("[%s%s0x%x]",
-                       NameOfCPURegister(rm),
-                       disp < 0 ? "-" : "+",
-                       disp < 0 ? -disp : disp);
-        return (mod == 2) ? 5 : 2;
-      }
-      break;
-    case 3:
-      AppendToBuffer("%s", (this->*register_name)(rm));
-      return 1;
-    default:
-      UnimplementedInstruction();
-      return 1;
-  }
-  UNREACHABLE();
-}
-
-
-int DisassemblerX64::PrintImmediate(byte* data, OperandSize size) {
-  int64_t value;
-  int count;
-  switch (size) {
-    case OPERAND_BYTE_SIZE:
-      value = *data;
-      count = 1;
-      break;
-    case OPERAND_WORD_SIZE:
-      value = *reinterpret_cast<int16_t*>(data);
-      count = 2;
-      break;
-    case OPERAND_DOUBLEWORD_SIZE:
-      value = *reinterpret_cast<uint32_t*>(data);
-      count = 4;
-      break;
-    case OPERAND_QUADWORD_SIZE:
-      value = *reinterpret_cast<int32_t*>(data);
-      count = 4;
-      break;
-    default:
-      UNREACHABLE();
-  }
-  AppendToBuffer("%" PRIx64, value);
-  return count;
-}
-
-
-int DisassemblerX64::PrintRightOperand(byte* modrmp) {
-  return PrintRightOperandHelper(modrmp,
-                                 &DisassemblerX64::NameOfCPURegister);
-}
-
-
-int DisassemblerX64::PrintRightByteOperand(byte* modrmp) {
-  return PrintRightOperandHelper(modrmp,
-                                 &DisassemblerX64::NameOfByteCPURegister);
-}
-
-
-int DisassemblerX64::PrintRightXMMOperand(byte* modrmp) {
-  return PrintRightOperandHelper(modrmp,
-                                 &DisassemblerX64::NameOfXMMRegister);
-}
-
-
-// Returns number of bytes used including the current *data.
-// Writes instruction's mnemonic, left and right operands to 'tmp_buffer_'.
-int DisassemblerX64::PrintOperands(const char* mnem,
-                                   OperandType op_order,
-                                   byte* data) {
-  byte modrm = *data;
-  int mod, regop, rm;
-  get_modrm(modrm, &mod, &regop, &rm);
-  int advance = 0;
-  const char* register_name =
-      byte_size_operand_ ? NameOfByteCPURegister(regop)
-                         : NameOfCPURegister(regop);
-  switch (op_order) {
-    case REG_OPER_OP_ORDER: {
-      AppendToBuffer("%s%c %s,",
-                     mnem,
-                     operand_size_code(),
-                     register_name);
-      advance = byte_size_operand_ ? PrintRightByteOperand(data)
-                                   : PrintRightOperand(data);
-      break;
-    }
-    case OPER_REG_OP_ORDER: {
-      AppendToBuffer("%s%c ", mnem, operand_size_code());
-      advance = byte_size_operand_ ? PrintRightByteOperand(data)
-                                   : PrintRightOperand(data);
-      AppendToBuffer(",%s", register_name);
-      break;
-    }
-    default:
-      UNREACHABLE();
-      break;
-  }
-  return advance;
-}
-
-
-// Returns number of bytes used by machine instruction, including *data byte.
-// Writes immediate instructions to 'tmp_buffer_'.
-int DisassemblerX64::PrintImmediateOp(byte* data) {
-  bool byte_size_immediate = (*data & 0x02) != 0;
-  byte modrm = *(data + 1);
-  int mod, regop, rm;
-  get_modrm(modrm, &mod, &regop, &rm);
-  const char* mnem = "Imm???";
-  switch (regop) {
-    case 0:
-      mnem = "add";
-      break;
-    case 1:
-      mnem = "or";
-      break;
-    case 2:
-      mnem = "adc";
-      break;
-    case 3:
-      mnem = "sbb";
-      break;
-    case 4:
-      mnem = "and";
-      break;
-    case 5:
-      mnem = "sub";
-      break;
-    case 6:
-      mnem = "xor";
-      break;
-    case 7:
-      mnem = "cmp";
-      break;
-    default:
-      UnimplementedInstruction();
-  }
-  AppendToBuffer("%s%c ", mnem, operand_size_code());
-  int count = PrintRightOperand(data + 1);
-  AppendToBuffer(",0x");
-  OperandSize immediate_size =
-      byte_size_immediate ? OPERAND_BYTE_SIZE : operand_size();
-  count += PrintImmediate(data + 1 + count, immediate_size);
-  return 1 + count;
-}
-
-
-// Returns number of bytes used, including *data.
-int DisassemblerX64::F6F7Instruction(byte* data) {
-  DCHECK(*data == 0xF7 || *data == 0xF6);
-  byte modrm = *(data + 1);
-  int mod, regop, rm;
-  get_modrm(modrm, &mod, &regop, &rm);
-  if (mod == 3 && regop != 0) {
-    const char* mnem = nullptr;
-    switch (regop) {
-      case 2:
-        mnem = "not";
-        break;
-      case 3:
-        mnem = "neg";
-        break;
-      case 4:
-        mnem = "mul";
-        break;
-      case 5:
-        mnem = "imul";
-        break;
-      case 6:
-        mnem = "div";
-        break;
-      case 7:
-        mnem = "idiv";
-        break;
-      default:
-        UnimplementedInstruction();
-    }
-    AppendToBuffer("%s%c %s",
-                   mnem,
-                   operand_size_code(),
-                   NameOfCPURegister(rm));
-    return 2;
-  } else if (regop == 0) {
-    AppendToBuffer("test%c ", operand_size_code());
-    int count = PrintRightOperand(data + 1);  // Use name of 64-bit register.
-    AppendToBuffer(",0x");
-    count += PrintImmediate(data + 1 + count, operand_size());
-    return 1 + count;
-  } else {
-    UnimplementedInstruction();
-    return 2;
-  }
-}
-
-
-int DisassemblerX64::ShiftInstruction(byte* data) {
-  byte op = *data & (~1);
-  int count = 1;
-  if (op != 0xD0 && op != 0xD2 && op != 0xC0) {
-    UnimplementedInstruction();
-    return count;
-  }
-  // Print mneumonic.
-  {
-    byte modrm = *(data + count);
-    int mod, regop, rm;
-    get_modrm(modrm, &mod, &regop, &rm);
-    regop &= 0x7;  // The REX.R bit does not affect the operation.
-    const char* mnem = nullptr;
-    switch (regop) {
-      case 0:
-        mnem = "rol";
-        break;
-      case 1:
-        mnem = "ror";
-        break;
-      case 2:
-        mnem = "rcl";
-        break;
-      case 3:
-        mnem = "rcr";
-        break;
-      case 4:
-        mnem = "shl";
-        break;
-      case 5:
-        mnem = "shr";
-        break;
-      case 7:
-        mnem = "sar";
-        break;
-      default:
-        UnimplementedInstruction();
-        return count + 1;
-    }
-    DCHECK_NOT_NULL(mnem);
-    AppendToBuffer("%s%c ", mnem, operand_size_code());
-  }
-  count += PrintRightOperand(data + count);
-  if (op == 0xD2) {
-    AppendToBuffer(", cl");
-  } else {
-    int imm8 = -1;
-    if (op == 0xD0) {
-      imm8 = 1;
-    } else {
-      DCHECK_EQ(0xC0, op);
-      imm8 = *(data + count);
-      count++;
-    }
-    AppendToBuffer(", %d", imm8);
-  }
-  return count;
-}
-
-
-// Returns number of bytes used, including *data.
-int DisassemblerX64::JumpShort(byte* data) {
-  DCHECK_EQ(0xEB, *data);
-  byte b = *(data + 1);
-  byte* dest = data + static_cast<int8_t>(b) + 2;
-  AppendToBuffer("jmp %s", NameOfAddress(dest));
-  return 2;
-}
-
-
-// Returns number of bytes used, including *data.
-int DisassemblerX64::JumpConditional(byte* data) {
-  DCHECK_EQ(0x0F, *data);
-  byte cond = *(data + 1) & 0x0F;
-  byte* dest = data + *reinterpret_cast<int32_t*>(data + 2) + 6;
-  const char* mnem = conditional_code_suffix[cond];
-  AppendToBuffer("j%s %s", mnem, NameOfAddress(dest));
-  return 6;  // includes 0x0F
-}
-
-
-// Returns number of bytes used, including *data.
-int DisassemblerX64::JumpConditionalShort(byte* data) {
-  byte cond = *data & 0x0F;
-  byte b = *(data + 1);
-  byte* dest = data + static_cast<int8_t>(b) + 2;
-  const char* mnem = conditional_code_suffix[cond];
-  AppendToBuffer("j%s %s", mnem, NameOfAddress(dest));
-  return 2;
-}
-
-
-// Returns number of bytes used, including *data.
-int DisassemblerX64::SetCC(byte* data) {
-  DCHECK_EQ(0x0F, *data);
-  byte cond = *(data + 1) & 0x0F;
-  const char* mnem = conditional_code_suffix[cond];
-  AppendToBuffer("set%s%c ", mnem, operand_size_code());
-  PrintRightByteOperand(data + 2);
-  return 3;  // includes 0x0F
-}
-
-const char* sf_str[4] = {"", "rl", "ra", "ll"};
-
-int DisassemblerX64::AVXInstruction(byte* data) {
-  byte opcode = *data;
-  byte* current = data + 1;
-  if (vex_66() && vex_0f38()) {
-    int mod, regop, rm, vvvv = vex_vreg();
-    get_modrm(*current, &mod, &regop, &rm);
-    switch (opcode) {
-      case 0x99:
-        AppendToBuffer("vfmadd132s%c %s,%s,", float_size_code(),
-                       NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0xA9:
-        AppendToBuffer("vfmadd213s%c %s,%s,", float_size_code(),
-                       NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0xB9:
-        AppendToBuffer("vfmadd231s%c %s,%s,", float_size_code(),
-                       NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x9B:
-        AppendToBuffer("vfmsub132s%c %s,%s,", float_size_code(),
-                       NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0xAB:
-        AppendToBuffer("vfmsub213s%c %s,%s,", float_size_code(),
-                       NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0xBB:
-        AppendToBuffer("vfmsub231s%c %s,%s,", float_size_code(),
-                       NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x9D:
-        AppendToBuffer("vfnmadd132s%c %s,%s,", float_size_code(),
-                       NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0xAD:
-        AppendToBuffer("vfnmadd213s%c %s,%s,", float_size_code(),
-                       NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0xBD:
-        AppendToBuffer("vfnmadd231s%c %s,%s,", float_size_code(),
-                       NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x9F:
-        AppendToBuffer("vfnmsub132s%c %s,%s,", float_size_code(),
-                       NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0xAF:
-        AppendToBuffer("vfnmsub213s%c %s,%s,", float_size_code(),
-                       NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0xBF:
-        AppendToBuffer("vfnmsub231s%c %s,%s,", float_size_code(),
-                       NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0xF7:
-        AppendToBuffer("shlx%c %s,", operand_size_code(),
-                       NameOfCPURegister(regop));
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%s", NameOfCPURegister(vvvv));
-        break;
-#define DECLARE_SSE_AVX_DIS_CASE(instruction, notUsed1, notUsed2, notUsed3, \
-                                 opcode)                                    \
-  case 0x##opcode: {                                                        \
-    AppendToBuffer("v" #instruction " %s,%s,", NameOfXMMRegister(regop),    \
-                   NameOfXMMRegister(vvvv));                                \
-    current += PrintRightXMMOperand(current);                               \
-    break;                                                                  \
-  }
-
-        SSSE3_INSTRUCTION_LIST(DECLARE_SSE_AVX_DIS_CASE)
-        SSE4_INSTRUCTION_LIST(DECLARE_SSE_AVX_DIS_CASE)
-#undef DECLARE_SSE_AVX_DIS_CASE
-      default:
-        UnimplementedInstruction();
-    }
-  } else if (vex_66() && vex_0f3a()) {
-    int mod, regop, rm, vvvv = vex_vreg();
-    get_modrm(*current, &mod, &regop, &rm);
-    switch (opcode) {
-      case 0x0A:
-        AppendToBuffer("vroundss %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        AppendToBuffer(",0x%x", *current++);
-        break;
-      case 0x0B:
-        AppendToBuffer("vroundsd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        AppendToBuffer(",0x%x", *current++);
-        break;
-      case 0x14:
-        AppendToBuffer("vpextrb ");
-        current += PrintRightByteOperand(current);
-        AppendToBuffer(",%s,0x%x,", NameOfXMMRegister(regop), *current++);
-        break;
-      case 0x15:
-        AppendToBuffer("vpextrw ");
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%s,0x%x,", NameOfXMMRegister(regop), *current++);
-        break;
-      case 0x16:
-        AppendToBuffer("vpextrd ");
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%s,0x%x,", NameOfXMMRegister(regop), *current++);
-        break;
-      case 0x20:
-        AppendToBuffer("vpinsrb %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightByteOperand(current);
-        AppendToBuffer(",0x%x", *current++);
-        break;
-      case 0x22:
-        AppendToBuffer("vpinsrd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightOperand(current);
-        AppendToBuffer(",0x%x", *current++);
-        break;
-      default:
-        UnimplementedInstruction();
-    }
-  } else if (vex_f3() && vex_0f()) {
-    int mod, regop, rm, vvvv = vex_vreg();
-    get_modrm(*current, &mod, &regop, &rm);
-    switch (opcode) {
-      case 0x10:
-        AppendToBuffer("vmovss %s,", NameOfXMMRegister(regop));
-        if (mod == 3) {
-          AppendToBuffer("%s,", NameOfXMMRegister(vvvv));
-        }
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x11:
-        AppendToBuffer("vmovss ");
-        current += PrintRightXMMOperand(current);
-        if (mod == 3) {
-          AppendToBuffer(",%s", NameOfXMMRegister(vvvv));
-        }
-        AppendToBuffer(",%s", NameOfXMMRegister(regop));
-        break;
-      case 0x2A:
-        AppendToBuffer("%s %s,%s,", vex_w() ? "vcvtqsi2ss" : "vcvtlsi2ss",
-                       NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
-        current += PrintRightOperand(current);
-        break;
-      case 0x2C:
-        AppendToBuffer("vcvttss2si%s %s,", vex_w() ? "q" : "",
-                       NameOfCPURegister(regop));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x58:
-        AppendToBuffer("vaddss %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x59:
-        AppendToBuffer("vmulss %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5A:
-        AppendToBuffer("vcvtss2sd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5C:
-        AppendToBuffer("vsubss %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5D:
-        AppendToBuffer("vminss %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5E:
-        AppendToBuffer("vdivss %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5F:
-        AppendToBuffer("vmaxss %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      default:
-        UnimplementedInstruction();
-    }
-  } else if (vex_f2() && vex_0f()) {
-    int mod, regop, rm, vvvv = vex_vreg();
-    get_modrm(*current, &mod, &regop, &rm);
-    switch (opcode) {
-      case 0x10:
-        AppendToBuffer("vmovsd %s,", NameOfXMMRegister(regop));
-        if (mod == 3) {
-          AppendToBuffer("%s,", NameOfXMMRegister(vvvv));
-        }
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x11:
-        AppendToBuffer("vmovsd ");
-        current += PrintRightXMMOperand(current);
-        if (mod == 3) {
-          AppendToBuffer(",%s", NameOfXMMRegister(vvvv));
-        }
-        AppendToBuffer(",%s", NameOfXMMRegister(regop));
-        break;
-      case 0x2A:
-        AppendToBuffer("%s %s,%s,", vex_w() ? "vcvtqsi2sd" : "vcvtlsi2sd",
-                       NameOfXMMRegister(regop), NameOfXMMRegister(vvvv));
-        current += PrintRightOperand(current);
-        break;
-      case 0x2C:
-        AppendToBuffer("vcvttsd2si%s %s,", vex_w() ? "q" : "",
-                       NameOfCPURegister(regop));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x2D:
-        AppendToBuffer("vcvtsd2si%s %s,", vex_w() ? "q" : "",
-                       NameOfCPURegister(regop));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x51:
-        AppendToBuffer("vsqrtsd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x58:
-        AppendToBuffer("vaddsd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x59:
-        AppendToBuffer("vmulsd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5A:
-        AppendToBuffer("vcvtsd2ss %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5C:
-        AppendToBuffer("vsubsd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5D:
-        AppendToBuffer("vminsd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5E:
-        AppendToBuffer("vdivsd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x5F:
-        AppendToBuffer("vmaxsd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0xF0:
-        AppendToBuffer("vlddqu %s,", NameOfXMMRegister(regop));
-        current += PrintRightXMMOperand(current);
-        break;
-      default:
-        UnimplementedInstruction();
-    }
-  } else if (vex_none() && vex_0f38()) {
-    int mod, regop, rm, vvvv = vex_vreg();
-    get_modrm(*current, &mod, &regop, &rm);
-    const char* mnem = "?";
-    switch (opcode) {
-      case 0xF2:
-        AppendToBuffer("andn%c %s,%s,", operand_size_code(),
-                       NameOfCPURegister(regop), NameOfCPURegister(vvvv));
-        current += PrintRightOperand(current);
-        break;
-      case 0xF5:
-        AppendToBuffer("bzhi%c %s,", operand_size_code(),
-                       NameOfCPURegister(regop));
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%s", NameOfCPURegister(vvvv));
-        break;
-      case 0xF7:
-        AppendToBuffer("bextr%c %s,", operand_size_code(),
-                       NameOfCPURegister(regop));
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%s", NameOfCPURegister(vvvv));
-        break;
-      case 0xF3:
-        switch (regop) {
-          case 1:
-            mnem = "blsr";
-            break;
-          case 2:
-            mnem = "blsmsk";
-            break;
-          case 3:
-            mnem = "blsi";
-            break;
-          default:
-            UnimplementedInstruction();
-        }
-        AppendToBuffer("%s%c %s,", mnem, operand_size_code(),
-                       NameOfCPURegister(vvvv));
-        current += PrintRightOperand(current);
-        mnem = "?";
-        break;
-      default:
-        UnimplementedInstruction();
-    }
-  } else if (vex_f2() && vex_0f38()) {
-    int mod, regop, rm, vvvv = vex_vreg();
-    get_modrm(*current, &mod, &regop, &rm);
-    switch (opcode) {
-      case 0xF5:
-        AppendToBuffer("pdep%c %s,%s,", operand_size_code(),
-                       NameOfCPURegister(regop), NameOfCPURegister(vvvv));
-        current += PrintRightOperand(current);
-        break;
-      case 0xF6:
-        AppendToBuffer("mulx%c %s,%s,", operand_size_code(),
-                       NameOfCPURegister(regop), NameOfCPURegister(vvvv));
-        current += PrintRightOperand(current);
-        break;
-      case 0xF7:
-        AppendToBuffer("shrx%c %s,", operand_size_code(),
-                       NameOfCPURegister(regop));
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%s", NameOfCPURegister(vvvv));
-        break;
-      default:
-        UnimplementedInstruction();
-    }
-  } else if (vex_f3() && vex_0f38()) {
-    int mod, regop, rm, vvvv = vex_vreg();
-    get_modrm(*current, &mod, &regop, &rm);
-    switch (opcode) {
-      case 0xF5:
-        AppendToBuffer("pext%c %s,%s,", operand_size_code(),
-                       NameOfCPURegister(regop), NameOfCPURegister(vvvv));
-        current += PrintRightOperand(current);
-        break;
-      case 0xF7:
-        AppendToBuffer("sarx%c %s,", operand_size_code(),
-                       NameOfCPURegister(regop));
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%s", NameOfCPURegister(vvvv));
-        break;
-      default:
-        UnimplementedInstruction();
-    }
-  } else if (vex_f2() && vex_0f3a()) {
-    int mod, regop, rm;
-    get_modrm(*current, &mod, &regop, &rm);
-    switch (opcode) {
-      case 0xF0:
-        AppendToBuffer("rorx%c %s,", operand_size_code(),
-                       NameOfCPURegister(regop));
-        current += PrintRightOperand(current);
-        switch (operand_size()) {
-          case OPERAND_DOUBLEWORD_SIZE:
-            AppendToBuffer(",%d", *current & 0x1F);
-            break;
-          case OPERAND_QUADWORD_SIZE:
-            AppendToBuffer(",%d", *current & 0x3F);
-            break;
-          default:
-            UnimplementedInstruction();
-        }
-        current += 1;
-        break;
-      default:
-        UnimplementedInstruction();
-    }
-  } else if (vex_none() && vex_0f()) {
-    int mod, regop, rm, vvvv = vex_vreg();
-    get_modrm(*current, &mod, &regop, &rm);
-    switch (opcode) {
-      case 0x10:
-        AppendToBuffer("vmovups %s,", NameOfXMMRegister(regop));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x11:
-        AppendToBuffer("vmovups ");
-        current += PrintRightXMMOperand(current);
-        AppendToBuffer(",%s", NameOfXMMRegister(regop));
-        break;
-      case 0x28:
-        AppendToBuffer("vmovaps %s,", NameOfXMMRegister(regop));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x29:
-        AppendToBuffer("vmovaps ");
-        current += PrintRightXMMOperand(current);
-        AppendToBuffer(",%s", NameOfXMMRegister(regop));
-        break;
-      case 0x2E:
-        AppendToBuffer("vucomiss %s,", NameOfXMMRegister(regop));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x50:
-        AppendToBuffer("vmovmskps %s,", NameOfCPURegister(regop));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x54:
-        AppendToBuffer("vandps %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x57:
-        AppendToBuffer("vxorps %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0xC2: {
-        AppendToBuffer("vcmpps %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        const char* const pseudo_op[] = {"eq",  "lt",  "le",  "unord",
-                                         "neq", "nlt", "nle", "ord"};
-        AppendToBuffer(", (%s)", pseudo_op[*current]);
-        current += 1;
-        break;
-      }
-      default:
-        UnimplementedInstruction();
-    }
-  } else if (vex_66() && vex_0f()) {
-    int mod, regop, rm, vvvv = vex_vreg();
-    get_modrm(*current, &mod, &regop, &rm);
-    switch (opcode) {
-      case 0x10:
-        AppendToBuffer("vmovupd %s,", NameOfXMMRegister(regop));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x11:
-        AppendToBuffer("vmovupd ");
-        current += PrintRightXMMOperand(current);
-        AppendToBuffer(",%s", NameOfXMMRegister(regop));
-        break;
-      case 0x28:
-        AppendToBuffer("vmovapd %s,", NameOfXMMRegister(regop));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x29:
-        AppendToBuffer("vmovapd ");
-        current += PrintRightXMMOperand(current);
-        AppendToBuffer(",%s", NameOfXMMRegister(regop));
-        break;
-      case 0x2E:
-        AppendToBuffer("vucomisd %s,", NameOfXMMRegister(regop));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x50:
-        AppendToBuffer("vmovmskpd %s,", NameOfCPURegister(regop));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x54:
-        AppendToBuffer("vandpd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x56:
-        AppendToBuffer("vorpd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x57:
-        AppendToBuffer("vxorpd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        break;
-      case 0x6E:
-        AppendToBuffer("vmov%c %s,", vex_w() ? 'q' : 'd',
-                       NameOfXMMRegister(regop));
-        current += PrintRightOperand(current);
-        break;
-      case 0x70:
-        AppendToBuffer("vpshufd %s,", NameOfXMMRegister(regop));
-        current += PrintRightXMMOperand(current);
-        AppendToBuffer(",0x%x", *current++);
-        break;
-      case 0x71:
-        AppendToBuffer("vps%sw %s,", sf_str[regop / 2],
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        AppendToBuffer(",%u", *current++);
-        break;
-      case 0x72:
-        AppendToBuffer("vps%sd %s,", sf_str[regop / 2],
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        AppendToBuffer(",%u", *current++);
-        break;
-      case 0x73:
-        AppendToBuffer("vps%sq %s,", sf_str[regop / 2],
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        AppendToBuffer(",%u", *current++);
-        break;
-      case 0x7E:
-        AppendToBuffer("vmov%c ", vex_w() ? 'q' : 'd');
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%s", NameOfXMMRegister(regop));
-        break;
-      case 0xC2: {
-        AppendToBuffer("vcmppd %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightXMMOperand(current);
-        const char* const pseudo_op[] = {"eq",  "lt",  "le",  "unord",
-                                         "neq", "nlt", "nle", "ord"};
-        AppendToBuffer(", (%s)", pseudo_op[*current]);
-        current += 1;
-        break;
-      }
-      case 0xC4:
-        AppendToBuffer("vpinsrw %s,%s,", NameOfXMMRegister(regop),
-                       NameOfXMMRegister(vvvv));
-        current += PrintRightOperand(current);
-        AppendToBuffer(",0x%x", *current++);
-        break;
-      case 0xC5:
-        AppendToBuffer("vpextrw %s,", NameOfCPURegister(regop));
-        current += PrintRightXMMOperand(current);
-        AppendToBuffer(",0x%x", *current++);
-        break;
-#define DECLARE_SSE_AVX_DIS_CASE(instruction, notUsed1, notUsed2, opcode) \
-  case 0x##opcode: {                                                      \
-    AppendToBuffer("v" #instruction " %s,%s,", NameOfXMMRegister(regop),  \
-                   NameOfXMMRegister(vvvv));                              \
-    current += PrintRightXMMOperand(current);                             \
-    break;                                                                \
-  }
-
-        SSE2_INSTRUCTION_LIST(DECLARE_SSE_AVX_DIS_CASE)
-#undef DECLARE_SSE_AVX_DIS_CASE
-      default:
-        UnimplementedInstruction();
-    }
-
-  } else {
-    UnimplementedInstruction();
-  }
-
-  return static_cast<int>(current - data);
-}
-
-// Returns number of bytes used, including *data.
-int DisassemblerX64::FPUInstruction(byte* data) {
-  byte escape_opcode = *data;
-  DCHECK_EQ(0xD8, escape_opcode & 0xF8);
-  byte modrm_byte = *(data+1);
-
-  if (modrm_byte >= 0xC0) {
-    return RegisterFPUInstruction(escape_opcode, modrm_byte);
-  } else {
-    return MemoryFPUInstruction(escape_opcode, modrm_byte, data+1);
-  }
-}
-
-int DisassemblerX64::MemoryFPUInstruction(int escape_opcode,
-                                           int modrm_byte,
-                                           byte* modrm_start) {
-  const char* mnem = "?";
-  int regop = (modrm_byte >> 3) & 0x7;  // reg/op field of modrm byte.
-  switch (escape_opcode) {
-    case 0xD9: switch (regop) {
-        case 0: mnem = "fld_s"; break;
-        case 3: mnem = "fstp_s"; break;
-        case 7: mnem = "fstcw"; break;
-        default: UnimplementedInstruction();
-      }
-      break;
-
-    case 0xDB: switch (regop) {
-        case 0: mnem = "fild_s"; break;
-        case 1: mnem = "fisttp_s"; break;
-        case 2: mnem = "fist_s"; break;
-        case 3: mnem = "fistp_s"; break;
-        default: UnimplementedInstruction();
-      }
-      break;
-
-    case 0xDD: switch (regop) {
-        case 0: mnem = "fld_d"; break;
-        case 3: mnem = "fstp_d"; break;
-        default: UnimplementedInstruction();
-      }
-      break;
-
-    case 0xDF: switch (regop) {
-        case 5: mnem = "fild_d"; break;
-        case 7: mnem = "fistp_d"; break;
-        default: UnimplementedInstruction();
-      }
-      break;
-
-    default: UnimplementedInstruction();
-  }
-  AppendToBuffer("%s ", mnem);
-  int count = PrintRightOperand(modrm_start);
-  return count + 1;
-}
-
-int DisassemblerX64::RegisterFPUInstruction(int escape_opcode,
-                                             byte modrm_byte) {
-  bool has_register = false;  // Is the FPU register encoded in modrm_byte?
-  const char* mnem = "?";
-
-  switch (escape_opcode) {
-    case 0xD8:
-      UnimplementedInstruction();
-      break;
-
-    case 0xD9:
-      switch (modrm_byte & 0xF8) {
-        case 0xC0:
-          mnem = "fld";
-          has_register = true;
-          break;
-        case 0xC8:
-          mnem = "fxch";
-          has_register = true;
-          break;
-        default:
-          switch (modrm_byte) {
-            case 0xE0: mnem = "fchs"; break;
-            case 0xE1: mnem = "fabs"; break;
-            case 0xE3: mnem = "fninit"; break;
-            case 0xE4: mnem = "ftst"; break;
-            case 0xE8: mnem = "fld1"; break;
-            case 0xEB: mnem = "fldpi"; break;
-            case 0xED: mnem = "fldln2"; break;
-            case 0xEE: mnem = "fldz"; break;
-            case 0xF0: mnem = "f2xm1"; break;
-            case 0xF1: mnem = "fyl2x"; break;
-            case 0xF2: mnem = "fptan"; break;
-            case 0xF5: mnem = "fprem1"; break;
-            case 0xF7: mnem = "fincstp"; break;
-            case 0xF8: mnem = "fprem"; break;
-            case 0xFC: mnem = "frndint"; break;
-            case 0xFD: mnem = "fscale"; break;
-            case 0xFE: mnem = "fsin"; break;
-            case 0xFF: mnem = "fcos"; break;
-            default: UnimplementedInstruction();
-          }
-      }
-      break;
-
-    case 0xDA:
-      if (modrm_byte == 0xE9) {
-        mnem = "fucompp";
-      } else {
-        UnimplementedInstruction();
-      }
-      break;
-
-    case 0xDB:
-      if ((modrm_byte & 0xF8) == 0xE8) {
-        mnem = "fucomi";
-        has_register = true;
-      } else if (modrm_byte  == 0xE2) {
-        mnem = "fclex";
-      } else if (modrm_byte == 0xE3) {
-        mnem = "fninit";
-      } else {
-        UnimplementedInstruction();
-      }
-      break;
-
-    case 0xDC:
-      has_register = true;
-      switch (modrm_byte & 0xF8) {
-        case 0xC0: mnem = "fadd"; break;
-        case 0xE8: mnem = "fsub"; break;
-        case 0xC8: mnem = "fmul"; break;
-        case 0xF8: mnem = "fdiv"; break;
-        default: UnimplementedInstruction();
-      }
-      break;
-
-    case 0xDD:
-      has_register = true;
-      switch (modrm_byte & 0xF8) {
-        case 0xC0: mnem = "ffree"; break;
-        case 0xD8: mnem = "fstp"; break;
-        default: UnimplementedInstruction();
-      }
-      break;
-
-    case 0xDE:
-      if (modrm_byte  == 0xD9) {
-        mnem = "fcompp";
-      } else {
-        has_register = true;
-        switch (modrm_byte & 0xF8) {
-          case 0xC0: mnem = "faddp"; break;
-          case 0xE8: mnem = "fsubp"; break;
-          case 0xC8: mnem = "fmulp"; break;
-          case 0xF8: mnem = "fdivp"; break;
-          default: UnimplementedInstruction();
-        }
-      }
-      break;
-
-    case 0xDF:
-      if (modrm_byte == 0xE0) {
-        mnem = "fnstsw_ax";
-      } else if ((modrm_byte & 0xF8) == 0xE8) {
-        mnem = "fucomip";
-        has_register = true;
-      }
-      break;
-
-    default: UnimplementedInstruction();
-  }
-
-  if (has_register) {
-    AppendToBuffer("%s st%d", mnem, modrm_byte & 0x7);
-  } else {
-    AppendToBuffer("%s", mnem);
-  }
-  return 2;
-}
-
-
-
-// Handle all two-byte opcodes, which start with 0x0F.
-// These instructions may be affected by an 0x66, 0xF2, or 0xF3 prefix.
-// We do not use any three-byte opcodes, which start with 0x0F38 or 0x0F3A.
-int DisassemblerX64::TwoByteOpcodeInstruction(byte* data) {
-  byte opcode = *(data + 1);
-  byte* current = data + 2;
-  // At return, "current" points to the start of the next instruction.
-  const char* mnemonic = TwoByteMnemonic(opcode);
-  if (operand_size_ == 0x66) {
-    // 0x66 0x0F prefix.
-    int mod, regop, rm;
-    if (opcode == 0x38) {
-      byte third_byte = *current;
-      current = data + 3;
-      get_modrm(*current, &mod, &regop, &rm);
-      switch (third_byte) {
-#define SSE34_DIS_CASE(instruction, notUsed1, notUsed2, notUsed3, opcode) \
-  case 0x##opcode: {                                                      \
-    AppendToBuffer(#instruction " %s,", NameOfXMMRegister(regop));        \
-    current += PrintRightXMMOperand(current);                             \
-    break;                                                                \
-  }
-
-        SSSE3_INSTRUCTION_LIST(SSE34_DIS_CASE)
-        SSE4_INSTRUCTION_LIST(SSE34_DIS_CASE)
-#undef SSE34_DIS_CASE
-        default:
-          UnimplementedInstruction();
-      }
-    } else if (opcode == 0x3A) {
-      byte third_byte = *current;
-      current = data + 3;
-      if (third_byte == 0x17) {
-        get_modrm(*current, &mod, &regop, &rm);
-        AppendToBuffer("extractps ");  // reg/m32, xmm, imm8
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%s,%d", NameOfXMMRegister(regop), (*current) & 3);
-        current += 1;
-      } else if (third_byte == 0x0A) {
-        get_modrm(*current, &mod, &regop, &rm);
-        AppendToBuffer("roundss %s,", NameOfXMMRegister(regop));
-        current += PrintRightXMMOperand(current);
-        AppendToBuffer(",0x%x", (*current) & 3);
-        current += 1;
-      } else if (third_byte == 0x0B) {
-        get_modrm(*current, &mod, &regop, &rm);
-         // roundsd xmm, xmm/m64, imm8
-        AppendToBuffer("roundsd %s,", NameOfXMMRegister(regop));
-        current += PrintRightXMMOperand(current);
-        AppendToBuffer(",0x%x", (*current) & 3);
-        current += 1;
-      } else if (third_byte == 0x14) {
-        get_modrm(*current, &mod, &regop, &rm);
-        AppendToBuffer("pextrb ");  // reg/m32, xmm, imm8
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%s,%d", NameOfXMMRegister(regop), (*current) & 3);
-        current += 1;
-      } else if (third_byte == 0x15) {
-        get_modrm(*current, &mod, &regop, &rm);
-        AppendToBuffer("pextrw ");  // reg/m32, xmm, imm8
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%s,%d", NameOfXMMRegister(regop), (*current) & 7);
-        current += 1;
-      } else if (third_byte == 0x16) {
-        get_modrm(*current, &mod, &regop, &rm);
-        AppendToBuffer("pextrd ");  // reg/m32, xmm, imm8
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%s,%d", NameOfXMMRegister(regop), (*current) & 3);
-        current += 1;
-      } else if (third_byte == 0x20) {
-        get_modrm(*current, &mod, &regop, &rm);
-        AppendToBuffer("pinsrd ");  // xmm, reg/m32, imm8
-        AppendToBuffer(" %s,", NameOfXMMRegister(regop));
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%d", (*current) & 3);
-        current += 1;
-      } else if (third_byte == 0x21) {
-        get_modrm(*current, &mod, &regop, &rm);
-        // insertps xmm, xmm/m32, imm8
-        AppendToBuffer("insertps %s,", NameOfXMMRegister(regop));
-        current += PrintRightXMMOperand(current);
-        AppendToBuffer(",0x%x", (*current) & 3);
-        current += 1;
-      } else if (third_byte == 0x22) {
-        get_modrm(*current, &mod, &regop, &rm);
-        AppendToBuffer("pinsrd ");  // xmm, reg/m32, imm8
-        AppendToBuffer(" %s,", NameOfXMMRegister(regop));
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%d", (*current) & 3);
-        current += 1;
-      } else {
-        UnimplementedInstruction();
-      }
-    } else {
-      get_modrm(*current, &mod, &regop, &rm);
-      if (opcode == 0x1F) {
-        current++;
-        if (rm == 4) {  // SIB byte present.
-          current++;
-        }
-        if (mod == 1) {  // Byte displacement.
-          current += 1;
-        } else if (mod == 2) {  // 32-bit displacement.
-          current += 4;
-        }  // else no immediate displacement.
-        AppendToBuffer("nop");
-      } else if (opcode == 0x10) {
-        AppendToBuffer("movupd %s,", NameOfXMMRegister(regop));
-        current += PrintRightXMMOperand(current);
-      } else if (opcode == 0x11) {
-        AppendToBuffer("movupd ");
-        current += PrintRightXMMOperand(current);
-        AppendToBuffer(",%s", NameOfXMMRegister(regop));
-      } else if (opcode == 0x28) {
-        AppendToBuffer("movapd %s,", NameOfXMMRegister(regop));
-        current += PrintRightXMMOperand(current);
-      } else if (opcode == 0x29) {
-        AppendToBuffer("movapd ");
-        current += PrintRightXMMOperand(current);
-        AppendToBuffer(",%s", NameOfXMMRegister(regop));
-      } else if (opcode == 0x6E) {
-        AppendToBuffer("mov%c %s,",
-                       rex_w() ? 'q' : 'd',
-                       NameOfXMMRegister(regop));
-        current += PrintRightOperand(current);
-      } else if (opcode == 0x6F) {
-        AppendToBuffer("movdqa %s,",
-                       NameOfXMMRegister(regop));
-        current += PrintRightXMMOperand(current);
-      } else if (opcode == 0x7E) {
-        AppendToBuffer("mov%c ",
-                       rex_w() ? 'q' : 'd');
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%s", NameOfXMMRegister(regop));
-      } else if (opcode == 0x7F) {
-        AppendToBuffer("movdqa ");
-        current += PrintRightXMMOperand(current);
-        AppendToBuffer(",%s", NameOfXMMRegister(regop));
-      } else if (opcode == 0xD6) {
-        AppendToBuffer("movq ");
-        current += PrintRightXMMOperand(current);
-        AppendToBuffer(",%s", NameOfXMMRegister(regop));
-      } else if (opcode == 0x50) {
-        AppendToBuffer("movmskpd %s,", NameOfCPURegister(regop));
-        current += PrintRightXMMOperand(current);
-      } else if (opcode == 0x70) {
-        AppendToBuffer("pshufd %s,", NameOfXMMRegister(regop));
-        current += PrintRightXMMOperand(current);
-        AppendToBuffer(",0x%x", *current);
-        current += 1;
-      } else if (opcode == 0x71) {
-        current += 1;
-        AppendToBuffer("ps%sw %s,%d", sf_str[regop / 2], NameOfXMMRegister(rm),
-                       *current & 0x7F);
-        current += 1;
-      } else if (opcode == 0x72) {
-        current += 1;
-        AppendToBuffer("ps%sd %s,%d", sf_str[regop / 2], NameOfXMMRegister(rm),
-                       *current & 0x7F);
-        current += 1;
-      } else if (opcode == 0x73) {
-        current += 1;
-        AppendToBuffer("ps%sq %s,%d", sf_str[regop / 2], NameOfXMMRegister(rm),
-                       *current & 0x7F);
-        current += 1;
-      } else if (opcode == 0xB1) {
-        current += PrintOperands("cmpxchg", OPER_REG_OP_ORDER, current);
-      } else if (opcode == 0xC4) {
-        AppendToBuffer("pinsrw %s,", NameOfXMMRegister(regop));
-        current += PrintRightOperand(current);
-        AppendToBuffer(",0x%x", (*current) & 7);
-        current += 1;
-      } else {
-        const char* mnemonic = "?";
-        if (opcode == 0x54) {
-          mnemonic = "andpd";
-        } else  if (opcode == 0x56) {
-          mnemonic = "orpd";
-        } else  if (opcode == 0x57) {
-          mnemonic = "xorpd";
-        } else if (opcode == 0x5B) {
-          mnemonic = "cvtps2dq";
-        } else if (opcode == 0x2E) {
-          mnemonic = "ucomisd";
-        } else if (opcode == 0x2F) {
-          mnemonic = "comisd";
-        } else if (opcode == 0x64) {
-          mnemonic = "pcmpgtb";
-        } else if (opcode == 0x65) {
-          mnemonic = "pcmpgtw";
-        } else if (opcode == 0x66) {
-          mnemonic = "pcmpgtd";
-        } else if (opcode == 0x74) {
-          mnemonic = "pcmpeqb";
-        } else if (opcode == 0x75) {
-          mnemonic = "pcmpeqw";
-        } else if (opcode == 0x76) {
-          mnemonic = "pcmpeqd";
-        } else if (opcode == 0x62) {
-          mnemonic = "punpckldq";
-        } else if (opcode == 0x63) {
-          mnemonic = "packsswb";
-        } else if (opcode == 0x67) {
-          mnemonic = "packuswb";
-        } else if (opcode == 0x6A) {
-          mnemonic = "punpckhdq";
-        } else if (opcode == 0x6B) {
-          mnemonic = "packssdw";
-        } else if (opcode == 0xD1) {
-          mnemonic = "psrlw";
-        } else if (opcode == 0xD2) {
-          mnemonic = "psrld";
-        } else if (opcode == 0xD5) {
-          mnemonic = "pmullw";
-        } else if (opcode == 0xD7) {
-          mnemonic = "pmovmskb";
-        } else if (opcode == 0xD8) {
-          mnemonic = "psubusb";
-        } else if (opcode == 0xD9) {
-          mnemonic = "psubusw";
-        } else if (opcode == 0xDA) {
-          mnemonic = "pminub";
-        } else if (opcode == 0xDC) {
-          mnemonic = "paddusb";
-        } else if (opcode == 0xDD) {
-          mnemonic = "paddusw";
-        } else if (opcode == 0xDE) {
-          mnemonic = "pmaxub";
-        } else if (opcode == 0xE1) {
-          mnemonic = "psraw";
-        } else if (opcode == 0xE2) {
-          mnemonic = "psrad";
-        } else if (opcode == 0xE8) {
-          mnemonic = "psubsb";
-        } else if (opcode == 0xE9) {
-          mnemonic = "psubsw";
-        } else if (opcode == 0xEA) {
-          mnemonic = "pminsw";
-        } else if (opcode == 0xEC) {
-          mnemonic = "paddsb";
-        } else if (opcode == 0xED) {
-          mnemonic = "paddsw";
-        } else if (opcode == 0xEE) {
-          mnemonic = "pmaxsw";
-        } else if (opcode == 0xEF) {
-          mnemonic = "pxor";
-        } else if (opcode == 0xF1) {
-          mnemonic = "psllw";
-        } else if (opcode == 0xF2) {
-          mnemonic = "pslld";
-        } else if (opcode == 0xF4) {
-          mnemonic = "pmuludq";
-        } else if (opcode == 0xF8) {
-          mnemonic = "psubb";
-        } else if (opcode == 0xF9) {
-          mnemonic = "psubw";
-        } else if (opcode == 0xFA) {
-          mnemonic = "psubd";
-        } else if (opcode == 0xFC) {
-          mnemonic = "paddb";
-        } else if (opcode == 0xFD) {
-          mnemonic = "paddw";
-        } else if (opcode == 0xFE) {
-          mnemonic = "paddd";
-        } else if (opcode == 0xC2) {
-          mnemonic = "cmppd";
-        } else {
-          UnimplementedInstruction();
-        }
-        AppendToBuffer("%s %s,", mnemonic, NameOfXMMRegister(regop));
-        current += PrintRightXMMOperand(current);
-        if (opcode == 0xC2) {
-          const char* const pseudo_op[] = {"eq",  "lt",  "le",  "unord",
-                                           "neq", "nlt", "nle", "ord"};
-          AppendToBuffer(", (%s)", pseudo_op[*current]);
-          current += 1;
-        }
-      }
-    }
-  } else if (group_1_prefix_ == 0xF2) {
-    // Beginning of instructions with prefix 0xF2.
-
-    if (opcode == 0x11 || opcode == 0x10) {
-      // MOVSD: Move scalar double-precision fp to/from/between XMM registers.
-      AppendToBuffer("movsd ");
-      int mod, regop, rm;
-      get_modrm(*current, &mod, &regop, &rm);
-      if (opcode == 0x11) {
-        current += PrintRightXMMOperand(current);
-        AppendToBuffer(",%s", NameOfXMMRegister(regop));
-      } else {
-        AppendToBuffer("%s,", NameOfXMMRegister(regop));
-        current += PrintRightXMMOperand(current);
-      }
-    } else if (opcode == 0x2A) {
-      // CVTSI2SD: integer to XMM double conversion.
-      int mod, regop, rm;
-      get_modrm(*current, &mod, &regop, &rm);
-      AppendToBuffer("%s %s,", mnemonic, NameOfXMMRegister(regop));
-      current += PrintRightOperand(current);
-    } else if (opcode == 0x2C) {
-      // CVTTSD2SI:
-      // Convert with truncation scalar double-precision FP to integer.
-      int mod, regop, rm;
-      get_modrm(*current, &mod, &regop, &rm);
-      AppendToBuffer("cvttsd2si%c %s,",
-          operand_size_code(), NameOfCPURegister(regop));
-      current += PrintRightXMMOperand(current);
-    } else if (opcode == 0x2D) {
-      // CVTSD2SI: Convert scalar double-precision FP to integer.
-      int mod, regop, rm;
-      get_modrm(*current, &mod, &regop, &rm);
-      AppendToBuffer("cvtsd2si%c %s,",
-          operand_size_code(), NameOfCPURegister(regop));
-      current += PrintRightXMMOperand(current);
-    } else if ((opcode & 0xF8) == 0x58 || opcode == 0x51) {
-      // XMM arithmetic. Mnemonic was retrieved at the start of this function.
-      int mod, regop, rm;
-      get_modrm(*current, &mod, &regop, &rm);
-      AppendToBuffer("%s %s,", mnemonic, NameOfXMMRegister(regop));
-      current += PrintRightXMMOperand(current);
-    } else if (opcode == 0x70) {
-      int mod, regop, rm;
-      get_modrm(*current, &mod, &regop, &rm);
-      AppendToBuffer("pshuflw %s, ", NameOfXMMRegister(regop));
-      current += PrintRightXMMOperand(current);
-      AppendToBuffer(", %d", (*current) & 7);
-      current += 1;
-    } else if (opcode == 0xC2) {
-      // Intel manual 2A, Table 3-18.
-      int mod, regop, rm;
-      get_modrm(*current, &mod, &regop, &rm);
-      const char* const pseudo_op[] = {
-        "cmpeqsd",
-        "cmpltsd",
-        "cmplesd",
-        "cmpunordsd",
-        "cmpneqsd",
-        "cmpnltsd",
-        "cmpnlesd",
-        "cmpordsd"
-      };
-      AppendToBuffer("%s %s,%s",
-                     pseudo_op[current[1]],
-                     NameOfXMMRegister(regop),
-                     NameOfXMMRegister(rm));
-      current += 2;
-    } else if (opcode == 0xF0) {
-      int mod, regop, rm;
-      get_modrm(*current, &mod, &regop, &rm);
-      AppendToBuffer("lddqu %s,", NameOfXMMRegister(regop));
-      current += PrintRightOperand(current);
-    } else if (opcode == 0x7C) {
-      int mod, regop, rm;
-      get_modrm(*current, &mod, &regop, &rm);
-      AppendToBuffer("haddps %s,", NameOfXMMRegister(regop));
-      current += PrintRightOperand(current);
-    } else {
-      UnimplementedInstruction();
-    }
-  } else if (group_1_prefix_ == 0xF3) {
-    // Instructions with prefix 0xF3.
-    if (opcode == 0x11 || opcode == 0x10) {
-      // MOVSS: Move scalar double-precision fp to/from/between XMM registers.
-      AppendToBuffer("movss ");
-      int mod, regop, rm;
-      get_modrm(*current, &mod, &regop, &rm);
-      if (opcode == 0x11) {
-        current += PrintRightOperand(current);
-        AppendToBuffer(",%s", NameOfXMMRegister(regop));
-      } else {
-        AppendToBuffer("%s,", NameOfXMMRegister(regop));
-        current += PrintRightOperand(current);
-      }
-    } else if (opcode == 0x2A) {
-      // CVTSI2SS: integer to XMM single conversion.
-      int mod, regop, rm;
-      get_modrm(*current, &mod, &regop, &rm);
-      AppendToBuffer("%s %s,", mnemonic, NameOfXMMRegister(regop));
-      current += PrintRightOperand(current);
-    } else if (opcode == 0x2C) {
-      // CVTTSS2SI:
-      // Convert with truncation scalar single-precision FP to dword integer.
-      int mod, regop, rm;
-      get_modrm(*current, &mod, &regop, &rm);
-      AppendToBuffer("cvttss2si%c %s,",
-          operand_size_code(), NameOfCPURegister(regop));
-      current += PrintRightXMMOperand(current);
-    } else if (opcode == 0x70) {
-      int mod, regop, rm;
-      get_modrm(*current, &mod, &regop, &rm);
-      AppendToBuffer("pshufhw %s, ", NameOfXMMRegister(regop));
-      current += PrintRightXMMOperand(current);
-      AppendToBuffer(", %d", (*current) & 7);
-      current += 1;
-    } else if (opcode == 0x6F) {
-      int mod, regop, rm;
-      get_modrm(*current, &mod, &regop, &rm);
-      AppendToBuffer("movdqu %s,", NameOfXMMRegister(regop));
-      current += PrintRightXMMOperand(current);
-    } else if (opcode == 0x7E) {
-      int mod, regop, rm;
-      get_modrm(*current, &mod, &regop, &rm);
-      AppendToBuffer("movq %s,", NameOfXMMRegister(regop));
-      current += PrintRightXMMOperand(current);
-    } else if (opcode == 0x7F) {
-      int mod, regop, rm;
-      get_modrm(*current, &mod, &regop, &rm);
-      AppendToBuffer("movdqu ");
-      current += PrintRightXMMOperand(current);
-      AppendToBuffer(",%s", NameOfXMMRegister(regop));
-    } else if ((opcode & 0xF8) == 0x58 || opcode == 0x51) {
-      // XMM arithmetic. Mnemonic was retrieved at the start of this function.
-      int mod, regop, rm;
-      get_modrm(*current, &mod, &regop, &rm);
-      AppendToBuffer("%s %s,", mnemonic, NameOfXMMRegister(regop));
-      current += PrintRightXMMOperand(current);
-    } else if (opcode == 0xB8) {
-      int mod, regop, rm;
-      get_modrm(*current, &mod, &regop, &rm);
-      AppendToBuffer("popcnt%c %s,", operand_size_code(),
-                     NameOfCPURegister(regop));
-      current += PrintRightOperand(current);
-    } else if (opcode == 0xBC) {
-      int mod, regop, rm;
-      get_modrm(*current, &mod, &regop, &rm);
-      AppendToBuffer("tzcnt%c %s,", operand_size_code(),
-                     NameOfCPURegister(regop));
-      current += PrintRightOperand(current);
-    } else if (opcode == 0xBD) {
-      int mod, regop, rm;
-      get_modrm(*current, &mod, &regop, &rm);
-      AppendToBuffer("lzcnt%c %s,", operand_size_code(),
-                     NameOfCPURegister(regop));
-      current += PrintRightOperand(current);
-    } else if (opcode == 0xC2) {
-      // Intel manual 2A, Table 3-18.
-      int mod, regop, rm;
-      get_modrm(*current, &mod, &regop, &rm);
-      const char* const pseudo_op[] = {"cmpeqss",    "cmpltss",  "cmpless",
-                                       "cmpunordss", "cmpneqss", "cmpnltss",
-                                       "cmpnless",   "cmpordss"};
-      AppendToBuffer("%s %s,%s", pseudo_op[current[1]],
-                     NameOfXMMRegister(regop), NameOfXMMRegister(rm));
-      current += 2;
-    } else {
-      UnimplementedInstruction();
-    }
-  } else if (opcode == 0x10 || opcode == 0x11) {
-    // movups xmm, xmm/m128
-    // movups xmm/m128, xmm
-    int mod, regop, rm;
-    get_modrm(*current, &mod, &regop, &rm);
-    AppendToBuffer("movups ");
-    if (opcode == 0x11) {
-      current += PrintRightXMMOperand(current);
-      AppendToBuffer(",%s", NameOfXMMRegister(regop));
-    } else {
-      AppendToBuffer("%s,", NameOfXMMRegister(regop));
-      current += PrintRightXMMOperand(current);
-    }
-  } else if (opcode == 0x1F) {
-    // NOP
-    int mod, regop, rm;
-    get_modrm(*current, &mod, &regop, &rm);
-    current++;
-    if (rm == 4) {  // SIB byte present.
-      current++;
-    }
-    if (mod == 1) {  // Byte displacement.
-      current += 1;
-    } else if (mod == 2) {  // 32-bit displacement.
-      current += 4;
-    }  // else no immediate displacement.
-    AppendToBuffer("nop");
-
-  } else if (opcode == 0x28) {
-    // movaps xmm, xmm/m128
-    int mod, regop, rm;
-    get_modrm(*current, &mod, &regop, &rm);
-    AppendToBuffer("movaps %s,", NameOfXMMRegister(regop));
-    current += PrintRightXMMOperand(current);
-
-  } else if (opcode == 0x29) {
-    // movaps xmm/m128, xmm
-    int mod, regop, rm;
-    get_modrm(*current, &mod, &regop, &rm);
-    AppendToBuffer("movaps ");
-    current += PrintRightXMMOperand(current);
-    AppendToBuffer(",%s", NameOfXMMRegister(regop));
-
-  } else if (opcode == 0x2E) {
-    int mod, regop, rm;
-    get_modrm(*current, &mod, &regop, &rm);
-    AppendToBuffer("ucomiss %s,", NameOfXMMRegister(regop));
-    current += PrintRightXMMOperand(current);
-  } else if (opcode == 0xA2) {
-    // CPUID
-    AppendToBuffer("%s", mnemonic);
-
-  } else if ((opcode & 0xF0) == 0x40) {
-    // CMOVcc: conditional move.
-    int condition = opcode & 0x0F;
-    const InstructionDesc& idesc = cmov_instructions[condition];
-    byte_size_operand_ = idesc.byte_size_operation;
-    current += PrintOperands(idesc.mnem, idesc.op_order_, current);
-
-  } else if (opcode >= 0x51 && opcode <= 0x5F) {
-    const char* const pseudo_op[] = {
-        "sqrtps",   "rsqrtps", "rcpps", "andps", "andnps",
-        "orps",     "xorps",   "addps", "mulps", "cvtps2pd",
-        "cvtdq2ps", "subps",   "minps", "divps", "maxps",
-    };
-    int mod, regop, rm;
-    get_modrm(*current, &mod, &regop, &rm);
-    AppendToBuffer("%s %s,", pseudo_op[opcode - 0x51],
-                   NameOfXMMRegister(regop));
-    current += PrintRightXMMOperand(current);
-
-  } else if (opcode == 0xC2) {
-    // cmpps xmm, xmm/m128, imm8
-    int mod, regop, rm;
-    get_modrm(*current, &mod, &regop, &rm);
-    const char* const pseudo_op[] = {"eq",  "lt",  "le",  "unord",
-                                     "neq", "nlt", "nle", "ord"};
-    AppendToBuffer("cmpps %s, ", NameOfXMMRegister(regop));
-    current += PrintRightXMMOperand(current);
-    AppendToBuffer(", %s", pseudo_op[*current]);
-    current += 1;
-  } else if (opcode == 0xC6) {
-    // shufps xmm, xmm/m128, imm8
-    int mod, regop, rm;
-    get_modrm(*current, &mod, &regop, &rm);
-    AppendToBuffer("shufps %s, ", NameOfXMMRegister(regop));
-    current += PrintRightXMMOperand(current);
-    AppendToBuffer(", %d", (*current) & 3);
-    current += 1;
-  } else if (opcode == 0x50) {
-    // movmskps reg, xmm
-    int mod, regop, rm;
-    get_modrm(*current, &mod, &regop, &rm);
-    AppendToBuffer("movmskps %s,", NameOfCPURegister(regop));
-    current += PrintRightXMMOperand(current);
-  } else if (opcode == 0x70) {
-    int mod, regop, rm;
-    get_modrm(*current, &mod, &regop, &rm);
-    AppendToBuffer("pshufw %s, ", NameOfXMMRegister(regop));
-    current += PrintRightXMMOperand(current);
-    AppendToBuffer(", %d", (*current) & 3);
-    current += 1;
-  } else if ((opcode & 0xF0) == 0x80) {
-    // Jcc: Conditional jump (branch).
-    current = data + JumpConditional(data);
-
-  } else if (opcode == 0xBE || opcode == 0xBF || opcode == 0xB6 ||
-             opcode == 0xB7 || opcode == 0xAF) {
-    // Size-extending moves, IMUL.
-    current += PrintOperands(mnemonic, REG_OPER_OP_ORDER, current);
-
-  } else if ((opcode & 0xF0) == 0x90) {
-    // SETcc: Set byte on condition. Needs pointer to beginning of instruction.
-    current = data + SetCC(data);
-
-  } else if (opcode == 0xAB || opcode == 0xA5 || opcode == 0xAD) {
-    // SHLD, SHRD (double-precision shift), BTS (bit set).
-    AppendToBuffer("%s ", mnemonic);
-    int mod, regop, rm;
-    get_modrm(*current, &mod, &regop, &rm);
-    current += PrintRightOperand(current);
-    if (opcode == 0xAB) {
-      AppendToBuffer(",%s", NameOfCPURegister(regop));
-    } else {
-      AppendToBuffer(",%s,cl", NameOfCPURegister(regop));
-    }
-  } else if (opcode == 0xB8 || opcode == 0xBC || opcode == 0xBD) {
-    // POPCNT, CTZ, CLZ.
-    AppendToBuffer("%s%c ", mnemonic, operand_size_code());
-    int mod, regop, rm;
-    get_modrm(*current, &mod, &regop, &rm);
-    AppendToBuffer("%s,", NameOfCPURegister(regop));
-    current += PrintRightOperand(current);
-  } else if (opcode == 0x0B) {
-    AppendToBuffer("ud2");
-  } else if (opcode == 0xB0 || opcode == 0xB1) {
-    // CMPXCHG.
-    if (opcode == 0xB0) {
-      byte_size_operand_ = true;
-    }
-    current += PrintOperands(mnemonic, OPER_REG_OP_ORDER, current);
-  } else if (opcode == 0xAE && (*(data + 2) & 0xF8) == 0xE8) {
-    AppendToBuffer("lfence");
-    current = data + 3;
-  } else {
-    UnimplementedInstruction();
-  }
-  return static_cast<int>(current - data);
-}
-
-// Mnemonics for two-byte opcode instructions starting with 0x0F.
-// The argument is the second byte of the two-byte opcode.
-// Returns nullptr if the instruction is not handled here.
-const char* DisassemblerX64::TwoByteMnemonic(byte opcode) {
-  switch (opcode) {
-    case 0x1F:
-      return "nop";
-    case 0x2A:  // F2/F3 prefix.
-      return (group_1_prefix_ == 0xF2) ? "cvtsi2sd" : "cvtsi2ss";
-    case 0x51:  // F2/F3 prefix.
-      return (group_1_prefix_ == 0xF2) ? "sqrtsd" : "sqrtss";
-    case 0x58:  // F2/F3 prefix.
-      return (group_1_prefix_ == 0xF2) ? "addsd" : "addss";
-    case 0x59:  // F2/F3 prefix.
-      return (group_1_prefix_ == 0xF2) ? "mulsd" : "mulss";
-    case 0x5A:  // F2/F3 prefix.
-      return (group_1_prefix_ == 0xF2) ? "cvtsd2ss" : "cvtss2sd";
-    case 0x5D:  // F2/F3 prefix.
-      return (group_1_prefix_ == 0xF2) ? "minsd" : "minss";
-    case 0x5C:  // F2/F3 prefix.
-      return (group_1_prefix_ == 0xF2) ? "subsd" : "subss";
-    case 0x5E:  // F2/F3 prefix.
-      return (group_1_prefix_ == 0xF2) ? "divsd" : "divss";
-    case 0x5F:  // F2/F3 prefix.
-      return (group_1_prefix_ == 0xF2) ? "maxsd" : "maxss";
-    case 0xA2:
-      return "cpuid";
-    case 0xA5:
-      return "shld";
-    case 0xAB:
-      return "bts";
-    case 0xAD:
-      return "shrd";
-    case 0xAF:
-      return "imul";
-    case 0xB0:
-    case 0xB1:
-      return "cmpxchg";
-    case 0xB6:
-      return "movzxb";
-    case 0xB7:
-      return "movzxw";
-    case 0xBC:
-      return "bsf";
-    case 0xBD:
-      return "bsr";
-    case 0xBE:
-      return "movsxb";
-    case 0xBF:
-      return "movsxw";
-    default:
-      return nullptr;
-  }
-}
-
-
-// Disassembles the instruction at instr, and writes it into out_buffer.
-int DisassemblerX64::InstructionDecode(v8::internal::Vector<char> out_buffer,
-                                       byte* instr) {
-  tmp_buffer_pos_ = 0;  // starting to write as position 0
-  byte* data = instr;
-  bool processed = true;  // Will be set to false if the current instruction
-                          // is not in 'instructions' table.
-  byte current;
-
-  // Scan for prefixes.
-  while (true) {
-    current = *data;
-    if (current == OPERAND_SIZE_OVERRIDE_PREFIX) {  // Group 3 prefix.
-      operand_size_ = current;
-    } else if ((current & 0xF0) == 0x40) {  // REX prefix.
-      setRex(current);
-      if (rex_w()) AppendToBuffer("REX.W ");
-    } else if ((current & 0xFE) == 0xF2) {  // Group 1 prefix (0xF2 or 0xF3).
-      group_1_prefix_ = current;
-    } else if (current == LOCK_PREFIX) {
-      AppendToBuffer("lock ");
-    } else if (current == VEX3_PREFIX) {
-      vex_byte0_ = current;
-      vex_byte1_ = *(data + 1);
-      vex_byte2_ = *(data + 2);
-      setRex(0x40 | (~(vex_byte1_ >> 5) & 7) | ((vex_byte2_ >> 4) & 8));
-      data += 3;
-      break;  // Vex is the last prefix.
-    } else if (current == VEX2_PREFIX) {
-      vex_byte0_ = current;
-      vex_byte1_ = *(data + 1);
-      setRex(0x40 | (~(vex_byte1_ >> 5) & 4));
-      data += 2;
-      break;  // Vex is the last prefix.
-    } else {  // Not a prefix - an opcode.
-      break;
-    }
-    data++;
-  }
-
-  // Decode AVX instructions.
-  if (vex_byte0_ != 0) {
-    processed = true;
-    data += AVXInstruction(data);
-  } else {
-    const InstructionDesc& idesc = instruction_table_->Get(current);
-    byte_size_operand_ = idesc.byte_size_operation;
-    switch (idesc.type) {
-      case ZERO_OPERANDS_INSTR:
-        if (current >= 0xA4 && current <= 0xA7) {
-          // String move or compare operations.
-          if (group_1_prefix_ == REP_PREFIX) {
-            // REP.
-            AppendToBuffer("rep ");
-          }
-          if (rex_w()) AppendToBuffer("REX.W ");
-          AppendToBuffer("%s%c", idesc.mnem, operand_size_code());
-        } else {
-          AppendToBuffer("%s%c", idesc.mnem, operand_size_code());
-        }
-        data++;
-        break;
-
-      case TWO_OPERANDS_INSTR:
-        data++;
-        data += PrintOperands(idesc.mnem, idesc.op_order_, data);
-        break;
-
-      case JUMP_CONDITIONAL_SHORT_INSTR:
-        data += JumpConditionalShort(data);
-        break;
-
-      case REGISTER_INSTR:
-        AppendToBuffer("%s%c %s", idesc.mnem, operand_size_code(),
-                       NameOfCPURegister(base_reg(current & 0x07)));
-        data++;
-        break;
-      case PUSHPOP_INSTR:
-        AppendToBuffer("%s %s", idesc.mnem,
-                       NameOfCPURegister(base_reg(current & 0x07)));
-        data++;
-        break;
-      case MOVE_REG_INSTR: {
-        byte* addr = nullptr;
-        switch (operand_size()) {
-          case OPERAND_WORD_SIZE:
-            addr =
-                reinterpret_cast<byte*>(*reinterpret_cast<int16_t*>(data + 1));
-            data += 3;
-            break;
-          case OPERAND_DOUBLEWORD_SIZE:
-            addr =
-                reinterpret_cast<byte*>(*reinterpret_cast<uint32_t*>(data + 1));
-            data += 5;
-            break;
-          case OPERAND_QUADWORD_SIZE:
-            addr =
-                reinterpret_cast<byte*>(*reinterpret_cast<int64_t*>(data + 1));
-            data += 9;
-            break;
-          default:
-            UNREACHABLE();
-        }
-        AppendToBuffer("mov%c %s,%s", operand_size_code(),
-                       NameOfCPURegister(base_reg(current & 0x07)),
-                       NameOfAddress(addr));
-        break;
-      }
-
-      case CALL_JUMP_INSTR: {
-        byte* addr = data + *reinterpret_cast<int32_t*>(data + 1) + 5;
-        AppendToBuffer("%s %s", idesc.mnem, NameOfAddress(addr));
-        data += 5;
-        break;
-      }
-
-      case SHORT_IMMEDIATE_INSTR: {
-        int32_t imm;
-        if (operand_size() == OPERAND_WORD_SIZE) {
-          imm = *reinterpret_cast<int16_t*>(data + 1);
-          data += 3;
-        } else {
-          imm = *reinterpret_cast<int32_t*>(data + 1);
-          data += 5;
-        }
-        AppendToBuffer("%s rax,0x%x", idesc.mnem, imm);
-        break;
-      }
-
-      case NO_INSTR:
-        processed = false;
-        break;
-
-      default:
-        UNIMPLEMENTED();  // This type is not implemented.
-    }
-  }
-
-  // The first byte didn't match any of the simple opcodes, so we
-  // need to do special processing on it.
-  if (!processed) {
-    switch (*data) {
-      case 0xC2:
-        AppendToBuffer("ret 0x%x", *reinterpret_cast<uint16_t*>(data + 1));
-        data += 3;
-        break;
-
-      case 0x69:  // fall through
-      case 0x6B: {
-        int count = 1;
-        count += PrintOperands("imul", REG_OPER_OP_ORDER, data + count);
-        AppendToBuffer(",0x");
-        if (*data == 0x69) {
-          count += PrintImmediate(data + count, operand_size());
-        } else {
-          count += PrintImmediate(data + count, OPERAND_BYTE_SIZE);
-        }
-        data += count;
-        break;
-      }
-
-      case 0x81:  // fall through
-      case 0x83:  // 0x81 with sign extension bit set
-        data += PrintImmediateOp(data);
-        break;
-
-      case 0x0F:
-        data += TwoByteOpcodeInstruction(data);
-        break;
-
-      case 0x8F: {
-        data++;
-        int mod, regop, rm;
-        get_modrm(*data, &mod, &regop, &rm);
-        if (regop == 0) {
-          AppendToBuffer("pop ");
-          data += PrintRightOperand(data);
-        }
-      }
-        break;
-
-      case 0xFF: {
-        data++;
-        int mod, regop, rm;
-        get_modrm(*data, &mod, &regop, &rm);
-        const char* mnem = nullptr;
-        switch (regop) {
-          case 0:
-            mnem = "inc";
-            break;
-          case 1:
-            mnem = "dec";
-            break;
-          case 2:
-            mnem = "call";
-            break;
-          case 4:
-            mnem = "jmp";
-            break;
-          case 6:
-            mnem = "push";
-            break;
-          default:
-            mnem = "???";
-        }
-        if (regop <= 1) {
-          AppendToBuffer("%s%c ", mnem, operand_size_code());
-        } else {
-          AppendToBuffer("%s ", mnem);
-        }
-        data += PrintRightOperand(data);
-      }
-        break;
-
-      case 0xC7:  // imm32, fall through
-      case 0xC6:  // imm8
-      {
-        bool is_byte = *data == 0xC6;
-        data++;
-        if (is_byte) {
-          AppendToBuffer("movb ");
-          data += PrintRightByteOperand(data);
-          int32_t imm = *data;
-          AppendToBuffer(",0x%x", imm);
-          data++;
-        } else {
-          AppendToBuffer("mov%c ", operand_size_code());
-          data += PrintRightOperand(data);
-          if (operand_size() == OPERAND_WORD_SIZE) {
-            int16_t imm = *reinterpret_cast<int16_t*>(data);
-            AppendToBuffer(",0x%x", imm);
-            data += 2;
-          } else {
-            int32_t imm = *reinterpret_cast<int32_t*>(data);
-            AppendToBuffer(",0x%x", imm);
-            data += 4;
-          }
-        }
-      }
-        break;
-
-      case 0x80: {
-        data++;
-        AppendToBuffer("cmpb ");
-        data += PrintRightByteOperand(data);
-        int32_t imm = *data;
-        AppendToBuffer(",0x%x", imm);
-        data++;
-      }
-        break;
-
-      case 0x88:  // 8bit, fall through
-      case 0x89:  // 32bit
-      {
-        bool is_byte = *data == 0x88;
-        int mod, regop, rm;
-        data++;
-        get_modrm(*data, &mod, &regop, &rm);
-        if (is_byte) {
-          AppendToBuffer("movb ");
-          data += PrintRightByteOperand(data);
-          AppendToBuffer(",%s", NameOfByteCPURegister(regop));
-        } else {
-          AppendToBuffer("mov%c ", operand_size_code());
-          data += PrintRightOperand(data);
-          AppendToBuffer(",%s", NameOfCPURegister(regop));
-        }
-      }
-        break;
-
-      case 0x90:
-      case 0x91:
-      case 0x92:
-      case 0x93:
-      case 0x94:
-      case 0x95:
-      case 0x96:
-      case 0x97: {
-        int reg = (*data & 0x7) | (rex_b() ? 8 : 0);
-        if (reg == 0) {
-          AppendToBuffer("nop");  // Common name for xchg rax,rax.
-        } else {
-          AppendToBuffer("xchg%c rax,%s",
-                         operand_size_code(),
-                         NameOfCPURegister(reg));
-        }
-        data++;
-      }
-        break;
-      case 0xB0:
-      case 0xB1:
-      case 0xB2:
-      case 0xB3:
-      case 0xB4:
-      case 0xB5:
-      case 0xB6:
-      case 0xB7:
-      case 0xB8:
-      case 0xB9:
-      case 0xBA:
-      case 0xBB:
-      case 0xBC:
-      case 0xBD:
-      case 0xBE:
-      case 0xBF: {
-        // mov reg8,imm8 or mov reg32,imm32
-        byte opcode = *data;
-        data++;
-        bool is_32bit = (opcode >= 0xB8);
-        int reg = (opcode & 0x7) | (rex_b() ? 8 : 0);
-        if (is_32bit) {
-          AppendToBuffer("mov%c %s,",
-                         operand_size_code(),
-                         NameOfCPURegister(reg));
-          data += PrintImmediate(data, OPERAND_DOUBLEWORD_SIZE);
-        } else {
-          AppendToBuffer("movb %s,",
-                         NameOfByteCPURegister(reg));
-          data += PrintImmediate(data, OPERAND_BYTE_SIZE);
-        }
-        break;
-      }
-      case 0xFE: {
-        data++;
-        int mod, regop, rm;
-        get_modrm(*data, &mod, &regop, &rm);
-        if (regop == 1) {
-          AppendToBuffer("decb ");
-          data += PrintRightByteOperand(data);
-        } else {
-          UnimplementedInstruction();
-        }
-        break;
-      }
-      case 0x68:
-        AppendToBuffer("push 0x%x", *reinterpret_cast<int32_t*>(data + 1));
-        data += 5;
-        break;
-
-      case 0x6A:
-        AppendToBuffer("push 0x%x", *reinterpret_cast<int8_t*>(data + 1));
-        data += 2;
-        break;
-
-      case 0xA1:  // Fall through.
-      case 0xA3:
-        switch (operand_size()) {
-          case OPERAND_DOUBLEWORD_SIZE: {
-            const char* memory_location = NameOfAddress(
-                reinterpret_cast<byte*>(
-                    *reinterpret_cast<int32_t*>(data + 1)));
-            if (*data == 0xA1) {  // Opcode 0xA1
-              AppendToBuffer("movzxlq rax,(%s)", memory_location);
-            } else {  // Opcode 0xA3
-              AppendToBuffer("movzxlq (%s),rax", memory_location);
-            }
-            data += 5;
-            break;
-          }
-          case OPERAND_QUADWORD_SIZE: {
-            // New x64 instruction mov rax,(imm_64).
-            const char* memory_location = NameOfAddress(
-                *reinterpret_cast<byte**>(data + 1));
-            if (*data == 0xA1) {  // Opcode 0xA1
-              AppendToBuffer("movq rax,(%s)", memory_location);
-            } else {  // Opcode 0xA3
-              AppendToBuffer("movq (%s),rax", memory_location);
-            }
-            data += 9;
-            break;
-          }
-          default:
-            UnimplementedInstruction();
-            data += 2;
-        }
-        break;
-
-      case 0xA8:
-        AppendToBuffer("test al,0x%x", *reinterpret_cast<uint8_t*>(data + 1));
-        data += 2;
-        break;
-
-      case 0xA9: {
-        int64_t value = 0;
-        switch (operand_size()) {
-          case OPERAND_WORD_SIZE:
-            value = *reinterpret_cast<uint16_t*>(data + 1);
-            data += 3;
-            break;
-          case OPERAND_DOUBLEWORD_SIZE:
-            value = *reinterpret_cast<uint32_t*>(data + 1);
-            data += 5;
-            break;
-          case OPERAND_QUADWORD_SIZE:
-            value = *reinterpret_cast<int32_t*>(data + 1);
-            data += 5;
-            break;
-          default:
-            UNREACHABLE();
-        }
-        AppendToBuffer("test%c rax,0x%" PRIx64, operand_size_code(), value);
-        break;
-      }
-      case 0xD1:  // fall through
-      case 0xD3:  // fall through
-      case 0xC1:
-        data += ShiftInstruction(data);
-        break;
-      case 0xD0:  // fall through
-      case 0xD2:  // fall through
-      case 0xC0:
-        byte_size_operand_ = true;
-        data += ShiftInstruction(data);
-        break;
-
-      case 0xD9:  // fall through
-      case 0xDA:  // fall through
-      case 0xDB:  // fall through
-      case 0xDC:  // fall through
-      case 0xDD:  // fall through
-      case 0xDE:  // fall through
-      case 0xDF:
-        data += FPUInstruction(data);
-        break;
-
-      case 0xEB:
-        data += JumpShort(data);
-        break;
-
-      case 0xF6:
-        byte_size_operand_ = true;  // fall through
-      case 0xF7:
-        data += F6F7Instruction(data);
-        break;
-
-      case 0x3C:
-        AppendToBuffer("cmp al,0x%x", *reinterpret_cast<int8_t*>(data + 1));
-        data +=2;
-        break;
-
-      default:
-        UnimplementedInstruction();
-        data += 1;
-    }
-  }  // !processed
-
-  if (tmp_buffer_pos_ < sizeof tmp_buffer_) {
-    tmp_buffer_[tmp_buffer_pos_] = '\0';
-  }
-
-  int instr_len = static_cast<int>(data - instr);
-  DCHECK_GT(instr_len, 0);  // Ensure progress.
-
-  int outp = 0;
-  // Instruction bytes.
-  for (byte* bp = instr; bp < data; bp++) {
-    outp += v8::internal::SNPrintF(out_buffer + outp, "%02x", *bp);
-  }
-  for (int i = 6 - instr_len; i >= 0; i--) {
-    outp += v8::internal::SNPrintF(out_buffer + outp, "  ");
-  }
-
-  outp += v8::internal::SNPrintF(out_buffer + outp, " %s",
-                                 tmp_buffer_.start());
-  return instr_len;
-}
-
-
-//------------------------------------------------------------------------------
-
-
-static const char* const cpu_regs[16] = {
-  "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi",
-  "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"
-};
-
-
-static const char* const byte_cpu_regs[16] = {
-  "al", "cl", "dl", "bl", "spl", "bpl", "sil", "dil",
-  "r8l", "r9l", "r10l", "r11l", "r12l", "r13l", "r14l", "r15l"
-};
-
-
-static const char* const xmm_regs[16] = {
-  "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7",
-  "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15"
-};
-
-
-const char* NameConverter::NameOfAddress(byte* addr) const {
-  v8::internal::SNPrintF(tmp_buffer_, "%p", static_cast<void*>(addr));
-  return tmp_buffer_.start();
-}
-
-
-const char* NameConverter::NameOfConstant(byte* addr) const {
-  return NameOfAddress(addr);
-}
-
-
-const char* NameConverter::NameOfCPURegister(int reg) const {
-  if (0 <= reg && reg < 16)
-    return cpu_regs[reg];
-  return "noreg";
-}
-
-
-const char* NameConverter::NameOfByteCPURegister(int reg) const {
-  if (0 <= reg && reg < 16)
-    return byte_cpu_regs[reg];
-  return "noreg";
-}
-
-
-const char* NameConverter::NameOfXMMRegister(int reg) const {
-  if (0 <= reg && reg < 16)
-    return xmm_regs[reg];
-  return "noxmmreg";
-}
-
-
-const char* NameConverter::NameInCode(byte* addr) const {
-  // X64 does not embed debug strings at the moment.
-  UNREACHABLE();
-}
-
-
-//------------------------------------------------------------------------------
-
-Disassembler::Disassembler(const NameConverter& converter)
-    : converter_(converter) { }
-
-Disassembler::~Disassembler() { }
-
-
-int Disassembler::InstructionDecode(v8::internal::Vector<char> buffer,
-                                    byte* instruction) {
-  DisassemblerX64 d(converter_, CONTINUE_ON_UNIMPLEMENTED_OPCODE);
-  return d.InstructionDecode(buffer, instruction);
-}
-
-
-// The X64 assembler does not use constant pools.
-int Disassembler::ConstantPoolSizeAt(byte* instruction) {
-  return -1;
-}
-
-
-void Disassembler::Disassemble(FILE* f, byte* begin, byte* end) {
-#if V8_OS_STARBOARD
-  SB_NOTIMPLEMENTED();
-#else
-  NameConverter converter;
-  Disassembler d(converter);
-  for (byte* pc = begin; pc < end;) {
-    v8::internal::EmbeddedVector<char, 128> buffer;
-    buffer[0] = '\0';
-    byte* prev_pc = pc;
-    pc += d.InstructionDecode(buffer, pc);
-    fprintf(f, "%p", static_cast<void*>(prev_pc));
-    fprintf(f, "    ");
-
-    for (byte* bp = prev_pc; bp < pc; bp++) {
-      fprintf(f, "%02x", *bp);
-    }
-    for (int i = 6 - static_cast<int>(pc - prev_pc); i >= 0; i--) {
-      fprintf(f, "  ");
-    }
-    fprintf(f, "  %s\n", buffer.start());
-  }
-#endif
-}
-
-}  // namespace disasm
-
-#endif  // V8_TARGET_ARCH_X64
diff --git a/src/v8/src/x64/eh-frame-x64.cc b/src/v8/src/x64/eh-frame-x64.cc
deleted file mode 100644
index ec4fc11..0000000
--- a/src/v8/src/x64/eh-frame-x64.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/eh-frame.h"
-#include "src/zone/zone-containers.h"
-
-namespace v8 {
-namespace internal {
-
-static const int kRaxDwarfCode = 0;
-static const int kRbpDwarfCode = 6;
-static const int kRspDwarfCode = 7;
-static const int kRipDwarfCode = 16;
-
-const int EhFrameConstants::kCodeAlignmentFactor = 1;
-const int EhFrameConstants::kDataAlignmentFactor = -8;
-
-void EhFrameWriter::WriteReturnAddressRegisterCode() {
-  WriteULeb128(kRipDwarfCode);
-}
-
-void EhFrameWriter::WriteInitialStateInCie() {
-  SetBaseAddressRegisterAndOffset(rsp, kPointerSize);
-  // x64 rip (r16) has no Register instance associated.
-  RecordRegisterSavedToStack(kRipDwarfCode, -kPointerSize);
-}
-
-// static
-int EhFrameWriter::RegisterToDwarfCode(Register name) {
-  switch (name.code()) {
-    case kRegCode_rbp:
-      return kRbpDwarfCode;
-    case kRegCode_rsp:
-      return kRspDwarfCode;
-    case kRegCode_rax:
-      return kRaxDwarfCode;
-    default:
-      UNIMPLEMENTED();
-      return -1;
-  }
-}
-
-#ifdef ENABLE_DISASSEMBLER
-
-// static
-const char* EhFrameDisassembler::DwarfRegisterCodeToString(int code) {
-  switch (code) {
-    case kRbpDwarfCode:
-      return "rbp";
-    case kRspDwarfCode:
-      return "rsp";
-    case kRipDwarfCode:
-      return "rip";
-    default:
-      UNIMPLEMENTED();
-      return nullptr;
-  }
-}
-
-#endif
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/src/x64/frame-constants-x64.cc b/src/v8/src/x64/frame-constants-x64.cc
deleted file mode 100644
index 553d3ef..0000000
--- a/src/v8/src/x64/frame-constants-x64.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2010 the V8 project 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 V8_TARGET_ARCH_X64
-
-#include "src/assembler.h"
-#include "src/frame-constants.h"
-#include "src/x64/assembler-x64-inl.h"
-#include "src/x64/assembler-x64.h"
-
-#include "src/x64/frame-constants-x64.h"
-
-namespace v8 {
-namespace internal {
-
-Register JavaScriptFrame::fp_register() { return rbp; }
-Register JavaScriptFrame::context_register() { return rsi; }
-Register JavaScriptFrame::constant_pool_pointer_register() { UNREACHABLE(); }
-
-int InterpreterFrameConstants::RegisterStackSlotCount(int register_count) {
-  return register_count;
-}
-
-int BuiltinContinuationFrameConstants::PaddingSlotCount(int register_count) {
-  USE(register_count);
-  return 0;
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_X64
diff --git a/src/v8/src/x64/frame-constants-x64.h b/src/v8/src/x64/frame-constants-x64.h
deleted file mode 100644
index 0a84b42..0000000
--- a/src/v8/src/x64/frame-constants-x64.h
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_X64_FRAMES_X64_H_
-#define V8_X64_FRAMES_X64_H_
-
-namespace v8 {
-namespace internal {
-
-class EntryFrameConstants : public AllStatic {
- public:
-#ifdef V8_TARGET_OS_WIN
-  static const int kCalleeSaveXMMRegisters = 10;
-  static const int kXMMRegisterSize = 16;
-  static const int kXMMRegistersBlockSize =
-      kXMMRegisterSize * kCalleeSaveXMMRegisters;
-  static const int kCallerFPOffset =
-      -3 * kPointerSize + -7 * kRegisterSize - kXMMRegistersBlockSize;
-#else
-  // We have 3 Push and 5 pushq in the JSEntryStub::GenerateBody.
-  static const int kCallerFPOffset = -3 * kPointerSize + -5 * kRegisterSize;
-#endif
-  static const int kArgvOffset = 6 * kPointerSize;
-};
-
-class ExitFrameConstants : public TypedFrameConstants {
- public:
-  static const int kSPOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(0);
-  static const int kCodeOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(1);
-  DEFINE_TYPED_FRAME_SIZES(2);
-
-  static const int kCallerFPOffset = +0 * kPointerSize;
-  static const int kCallerPCOffset = kFPOnStackSize;
-
-  // FP-relative displacement of the caller's SP.  It points just
-  // below the saved PC.
-  static const int kCallerSPDisplacement = kCallerPCOffset + kPCOnStackSize;
-
-  static const int kConstantPoolOffset = 0;  // Not used
-};
-
-class JavaScriptFrameConstants : public AllStatic {
- public:
-  // FP-relative.
-  static const int kLocal0Offset = StandardFrameConstants::kExpressionsOffset;
-  static const int kLastParameterOffset = kFPOnStackSize + kPCOnStackSize;
-  static const int kFunctionOffset = StandardFrameConstants::kFunctionOffset;
-
-  // Caller SP-relative.
-  static const int kParam0Offset = -2 * kPointerSize;
-  static const int kReceiverOffset = -1 * kPointerSize;
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_X64_FRAMES_X64_H_
diff --git a/src/v8/src/x64/interface-descriptors-x64.cc b/src/v8/src/x64/interface-descriptors-x64.cc
deleted file mode 100644
index 22bad69..0000000
--- a/src/v8/src/x64/interface-descriptors-x64.cc
+++ /dev/null
@@ -1,355 +0,0 @@
-// Copyright 2012 the V8 project 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 V8_TARGET_ARCH_X64
-
-#include "src/interface-descriptors.h"
-
-namespace v8 {
-namespace internal {
-
-const Register CallInterfaceDescriptor::ContextRegister() { return rsi; }
-
-void CallInterfaceDescriptor::DefaultInitializePlatformSpecific(
-    CallInterfaceDescriptorData* data, int register_parameter_count) {
-  const Register default_stub_registers[] = {rax, rbx, rcx, rdx, rdi};
-  CHECK_LE(static_cast<size_t>(register_parameter_count),
-           arraysize(default_stub_registers));
-  data->InitializePlatformSpecific(register_parameter_count,
-                                   default_stub_registers);
-}
-
-void RecordWriteDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  const Register default_stub_registers[] = {arg_reg_1, arg_reg_2, arg_reg_3,
-                                             arg_reg_4, kReturnRegister0};
-
-  data->RestrictAllocatableRegisters(default_stub_registers,
-                                     arraysize(default_stub_registers));
-
-  CHECK_LE(static_cast<size_t>(kParameterCount),
-           arraysize(default_stub_registers));
-  data->InitializePlatformSpecific(kParameterCount, default_stub_registers);
-}
-
-const Register FastNewFunctionContextDescriptor::FunctionRegister() {
-  return rdi;
-}
-const Register FastNewFunctionContextDescriptor::SlotsRegister() { return rax; }
-
-const Register LoadDescriptor::ReceiverRegister() { return rdx; }
-const Register LoadDescriptor::NameRegister() { return rcx; }
-const Register LoadDescriptor::SlotRegister() { return rax; }
-
-const Register LoadWithVectorDescriptor::VectorRegister() { return rbx; }
-
-const Register StoreDescriptor::ReceiverRegister() { return rdx; }
-const Register StoreDescriptor::NameRegister() { return rcx; }
-const Register StoreDescriptor::ValueRegister() { return rax; }
-const Register StoreDescriptor::SlotRegister() { return rdi; }
-
-const Register StoreWithVectorDescriptor::VectorRegister() { return rbx; }
-
-const Register StoreTransitionDescriptor::SlotRegister() { return rdi; }
-const Register StoreTransitionDescriptor::VectorRegister() { return rbx; }
-const Register StoreTransitionDescriptor::MapRegister() { return r11; }
-
-const Register ApiGetterDescriptor::HolderRegister() { return rcx; }
-const Register ApiGetterDescriptor::CallbackRegister() { return rbx; }
-
-const Register MathPowTaggedDescriptor::exponent() { return rdx; }
-
-const Register MathPowIntegerDescriptor::exponent() {
-  return MathPowTaggedDescriptor::exponent();
-}
-
-
-const Register GrowArrayElementsDescriptor::ObjectRegister() { return rax; }
-const Register GrowArrayElementsDescriptor::KeyRegister() { return rbx; }
-
-
-void FastNewClosureDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // SharedFunctionInfo, vector, slot index.
-  Register registers[] = {rbx, rcx, rdx};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void TypeofDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {rbx};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-
-// static
-const Register TypeConversionDescriptor::ArgumentRegister() { return rax; }
-
-void CallFunctionDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {rdi};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallTrampolineDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // rax : number of arguments
-  // rdi : the target to call
-  Register registers[] = {rdi, rax};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // rax : number of arguments (on the stack, not including receiver)
-  // rdi : the target to call
-  // rbx : arguments list (FixedArray)
-  // rcx : arguments list length (untagged)
-  Register registers[] = {rdi, rax, rbx, rcx};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallForwardVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // rax : number of arguments
-  // rcx : start index (to support rest parameters)
-  // rdi : the target to call
-  Register registers[] = {rdi, rax, rcx};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallWithSpreadDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // rax : number of arguments (on the stack, not including receiver)
-  // rdi : the target to call
-  // rbx : the object to spread
-  Register registers[] = {rdi, rax, rbx};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void CallWithArrayLikeDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // rdi : the target to call
-  // rbx : the arguments list
-  Register registers[] = {rdi, rbx};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // rax : number of arguments (on the stack, not including receiver)
-  // rdi : the target to call
-  // rdx : the new target
-  // rbx : arguments list (FixedArray)
-  // rcx : arguments list length (untagged)
-  Register registers[] = {rdi, rdx, rax, rbx, rcx};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructForwardVarargsDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // rax : number of arguments
-  // rdx : the new target
-  // rcx : start index (to support rest parameters)
-  // rdi : the target to call
-  Register registers[] = {rdi, rdx, rax, rcx};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructWithSpreadDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // rax : number of arguments (on the stack, not including receiver)
-  // rdi : the target to call
-  // rdx : the new target
-  // rbx : the object to spread
-  Register registers[] = {rdi, rdx, rax, rbx};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructWithArrayLikeDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // rdi : the target to call
-  // rdx : the new target
-  // rbx : the arguments list
-  Register registers[] = {rdi, rdx, rbx};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ConstructStubDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // rax : number of arguments
-  // rdx : the new target
-  // rdi : the target to call
-  // rbx : allocation site or undefined
-  Register registers[] = {rdi, rdx, rax, rbx};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-
-void ConstructTrampolineDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // rax : number of arguments
-  // rdx : the new target
-  // rdi : the target to call
-  Register registers[] = {rdi, rdx, rax};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-
-void TransitionElementsKindDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {rax, rbx};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void AbortJSDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {rdx};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void AllocateHeapNumberDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  data->InitializePlatformSpecific(0, nullptr, nullptr);
-}
-
-void ArrayConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // kTarget, kNewTarget, kActualArgumentsCount, kAllocationSite
-  Register registers[] = {rdi, rdx, rax, rbx};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void ArrayNoArgumentConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // register state
-  // rax -- number of arguments
-  // rdi -- function
-  // rbx -- allocation site with elements kind
-  Register registers[] = {rdi, rbx, rax};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void ArraySingleArgumentConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // register state
-  // rax -- number of arguments
-  // rdi -- function
-  // rbx -- allocation site with elements kind
-  Register registers[] = {rdi, rbx, rax};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void ArrayNArgumentsConstructorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  // register state
-  // rax -- number of arguments
-  // rdi -- function
-  // rbx -- allocation site with elements kind
-  Register registers[] = {rdi, rbx, rax};
-  data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
-}
-
-void CompareDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {rdx, rax};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-
-void BinaryOpDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {rdx, rax};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void StringAddDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {rdx, rax};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ArgumentAdaptorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      rdi,  // JSFunction
-      rdx,  // the new target
-      rax,  // actual number of arguments
-      rbx,  // expected number of arguments
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ApiCallbackDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      JavaScriptFrame::context_register(),  // callee context
-      rbx,                                  // call_data
-      rcx,                                  // holder
-      rdx,                                  // api_function_address
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterDispatchDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      kInterpreterAccumulatorRegister, kInterpreterBytecodeOffsetRegister,
-      kInterpreterBytecodeArrayRegister, kInterpreterDispatchTableRegister};
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterPushArgsThenCallDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      rax,  // argument count (not including receiver)
-      rbx,  // address of first argument
-      rdi   // the target callable to be call
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterPushArgsThenConstructDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      rax,  // argument count (not including receiver)
-      rdx,  // new target
-      rdi,  // constructor
-      rbx,  // allocation site feedback if available, undefined otherwise
-      rcx,  // address of first argument
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void InterpreterCEntryDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      rax,  // argument count (argc)
-      r15,  // address of first argument (argv)
-      rbx   // the runtime function to call
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void ResumeGeneratorDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      rax,  // the value to pass to the generator
-      rdx   // the JSGeneratorObject / JSAsyncGeneratorObject to resume
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-void FrameDropperTrampolineDescriptor::InitializePlatformSpecific(
-    CallInterfaceDescriptorData* data) {
-  Register registers[] = {
-      rbx,  // loaded new FP
-  };
-  data->InitializePlatformSpecific(arraysize(registers), registers);
-}
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_X64
diff --git a/src/v8/src/x64/macro-assembler-x64.cc b/src/v8/src/x64/macro-assembler-x64.cc
deleted file mode 100644
index 5019be3..0000000
--- a/src/v8/src/x64/macro-assembler-x64.cc
+++ /dev/null
@@ -1,2745 +0,0 @@
-// Copyright 2012 the V8 project 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 V8_TARGET_ARCH_X64
-
-#include "src/base/bits.h"
-#include "src/base/division-by-constant.h"
-#include "src/base/utils/random-number-generator.h"
-#include "src/bootstrapper.h"
-#include "src/callable.h"
-#include "src/code-stubs.h"
-#include "src/counters.h"
-#include "src/debug/debug.h"
-#include "src/external-reference-table.h"
-#include "src/frames-inl.h"
-#include "src/heap/heap-inl.h"
-#include "src/objects-inl.h"
-#include "src/register-configuration.h"
-#include "src/x64/assembler-x64.h"
-
-#include "src/x64/macro-assembler-x64.h"  // Cannot be the first include.
-
-namespace v8 {
-namespace internal {
-
-Operand StackArgumentsAccessor::GetArgumentOperand(int index) {
-  DCHECK_GE(index, 0);
-  int receiver = (receiver_mode_ == ARGUMENTS_CONTAIN_RECEIVER) ? 1 : 0;
-  int displacement_to_last_argument =
-      base_reg_ == rsp ? kPCOnStackSize : kFPOnStackSize + kPCOnStackSize;
-  displacement_to_last_argument += extra_displacement_to_last_argument_;
-  if (argument_count_reg_ == no_reg) {
-    // argument[0] is at base_reg_ + displacement_to_last_argument +
-    // (argument_count_immediate_ + receiver - 1) * kPointerSize.
-    DCHECK_GT(argument_count_immediate_ + receiver, 0);
-    return Operand(
-        base_reg_,
-        displacement_to_last_argument +
-            (argument_count_immediate_ + receiver - 1 - index) * kPointerSize);
-  } else {
-    // argument[0] is at base_reg_ + displacement_to_last_argument +
-    // argument_count_reg_ * times_pointer_size + (receiver - 1) * kPointerSize.
-    return Operand(
-        base_reg_, argument_count_reg_, times_pointer_size,
-        displacement_to_last_argument + (receiver - 1 - index) * kPointerSize);
-  }
-}
-
-StackArgumentsAccessor::StackArgumentsAccessor(
-    Register base_reg, const ParameterCount& parameter_count,
-    StackArgumentsAccessorReceiverMode receiver_mode,
-    int extra_displacement_to_last_argument)
-    : base_reg_(base_reg),
-      argument_count_reg_(parameter_count.is_reg() ? parameter_count.reg()
-                                                   : no_reg),
-      argument_count_immediate_(
-          parameter_count.is_immediate() ? parameter_count.immediate() : 0),
-      receiver_mode_(receiver_mode),
-      extra_displacement_to_last_argument_(
-          extra_displacement_to_last_argument) {}
-
-MacroAssembler::MacroAssembler(Isolate* isolate, void* buffer, int size,
-                               CodeObjectRequired create_code_object)
-    : TurboAssembler(isolate, buffer, size, create_code_object) {}
-
-TurboAssembler::TurboAssembler(Isolate* isolate, void* buffer, int buffer_size,
-                               CodeObjectRequired create_code_object)
-    : Assembler(isolate, buffer, buffer_size), isolate_(isolate) {
-  if (create_code_object == CodeObjectRequired::kYes) {
-    code_object_ =
-        Handle<HeapObject>::New(isolate->heap()->undefined_value(), isolate);
-  }
-}
-
-static const int64_t kInvalidRootRegisterDelta = -1;
-
-int64_t TurboAssembler::RootRegisterDelta(ExternalReference other) {
-  if (predictable_code_size() &&
-      (other.address() < reinterpret_cast<Address>(isolate()) ||
-       other.address() >= reinterpret_cast<Address>(isolate() + 1))) {
-    return kInvalidRootRegisterDelta;
-  }
-  Address roots_register_value =
-      kRootRegisterBias +
-      reinterpret_cast<Address>(isolate()->heap()->roots_array_start());
-
-  int64_t delta = kInvalidRootRegisterDelta;  // Bogus initialization.
-  if (kPointerSize == kInt64Size) {
-    delta = other.address() - roots_register_value;
-  } else {
-    // For x32, zero extend the address to 64-bit and calculate the delta.
-    uint64_t o = static_cast<uint32_t>(
-        reinterpret_cast<intptr_t>(other.address()));
-    uint64_t r = static_cast<uint32_t>(
-        reinterpret_cast<intptr_t>(roots_register_value));
-    delta = o - r;
-  }
-  return delta;
-}
-
-
-Operand MacroAssembler::ExternalOperand(ExternalReference target,
-                                        Register scratch) {
-  if (root_array_available_ && !serializer_enabled()) {
-    int64_t delta = RootRegisterDelta(target);
-    if (delta != kInvalidRootRegisterDelta && is_int32(delta)) {
-      return Operand(kRootRegister, static_cast<int32_t>(delta));
-    }
-  }
-  Move(scratch, target);
-  return Operand(scratch, 0);
-}
-
-
-void MacroAssembler::Load(Register destination, ExternalReference source) {
-  if (root_array_available_ && !serializer_enabled()) {
-    int64_t delta = RootRegisterDelta(source);
-    if (delta != kInvalidRootRegisterDelta && is_int32(delta)) {
-      movp(destination, Operand(kRootRegister, static_cast<int32_t>(delta)));
-      return;
-    }
-  }
-  // Safe code.
-  if (destination == rax) {
-    load_rax(source);
-  } else {
-    Move(kScratchRegister, source);
-    movp(destination, Operand(kScratchRegister, 0));
-  }
-}
-
-
-void MacroAssembler::Store(ExternalReference destination, Register source) {
-  if (root_array_available_ && !serializer_enabled()) {
-    int64_t delta = RootRegisterDelta(destination);
-    if (delta != kInvalidRootRegisterDelta && is_int32(delta)) {
-      movp(Operand(kRootRegister, static_cast<int32_t>(delta)), source);
-      return;
-    }
-  }
-  // Safe code.
-  if (source == rax) {
-    store_rax(destination);
-  } else {
-    Move(kScratchRegister, destination);
-    movp(Operand(kScratchRegister, 0), source);
-  }
-}
-
-void TurboAssembler::LoadAddress(Register destination,
-                                 ExternalReference source) {
-  if (root_array_available_ && !serializer_enabled()) {
-    int64_t delta = RootRegisterDelta(source);
-    if (delta != kInvalidRootRegisterDelta && is_int32(delta)) {
-      leap(destination, Operand(kRootRegister, static_cast<int32_t>(delta)));
-      return;
-    }
-  }
-  // Safe code.
-  Move(destination, source);
-}
-
-int TurboAssembler::LoadAddressSize(ExternalReference source) {
-  if (root_array_available_ && !serializer_enabled()) {
-    // This calculation depends on the internals of LoadAddress.
-    // It's correctness is ensured by the asserts in the Call
-    // instruction below.
-    int64_t delta = RootRegisterDelta(source);
-    if (delta != kInvalidRootRegisterDelta && is_int32(delta)) {
-      // Operand is leap(scratch, Operand(kRootRegister, delta));
-      // Opcodes : REX.W 8D ModRM Disp8/Disp32  - 4 or 7.
-      int size = 4;
-      if (!is_int8(static_cast<int32_t>(delta))) {
-        size += 3;  // Need full four-byte displacement in lea.
-      }
-      return size;
-    }
-  }
-  // Size of movp(destination, src);
-  return Assembler::kMoveAddressIntoScratchRegisterInstructionLength;
-}
-
-
-void MacroAssembler::PushAddress(ExternalReference source) {
-  int64_t address = reinterpret_cast<int64_t>(source.address());
-  if (is_int32(address) && !serializer_enabled()) {
-    if (emit_debug_code()) {
-      Move(kScratchRegister, reinterpret_cast<Address>(kZapValue),
-           Assembler::RelocInfoNone());
-    }
-    Push(Immediate(static_cast<int32_t>(address)));
-    return;
-  }
-  LoadAddress(kScratchRegister, source);
-  Push(kScratchRegister);
-}
-
-void TurboAssembler::LoadRoot(Register destination, Heap::RootListIndex index) {
-  DCHECK(root_array_available_);
-  movp(destination, Operand(kRootRegister,
-                            (index << kPointerSizeLog2) - kRootRegisterBias));
-}
-
-void MacroAssembler::PushRoot(Heap::RootListIndex index) {
-  DCHECK(root_array_available_);
-  Push(Operand(kRootRegister, (index << kPointerSizeLog2) - kRootRegisterBias));
-}
-
-void TurboAssembler::CompareRoot(Register with, Heap::RootListIndex index) {
-  DCHECK(root_array_available_);
-  cmpp(with, Operand(kRootRegister,
-                     (index << kPointerSizeLog2) - kRootRegisterBias));
-}
-
-void TurboAssembler::CompareRoot(const Operand& with,
-                                 Heap::RootListIndex index) {
-  DCHECK(root_array_available_);
-  DCHECK(!with.AddressUsesRegister(kScratchRegister));
-  LoadRoot(kScratchRegister, index);
-  cmpp(with, kScratchRegister);
-}
-
-void MacroAssembler::RecordWriteField(Register object, int offset,
-                                      Register value, Register dst,
-                                      SaveFPRegsMode save_fp,
-                                      RememberedSetAction remembered_set_action,
-                                      SmiCheck smi_check) {
-  // First, check if a write barrier is even needed. The tests below
-  // catch stores of Smis.
-  Label done;
-
-  // Skip barrier if writing a smi.
-  if (smi_check == INLINE_SMI_CHECK) {
-    JumpIfSmi(value, &done);
-  }
-
-  // Although the object register is tagged, the offset is relative to the start
-  // of the object, so so offset must be a multiple of kPointerSize.
-  DCHECK(IsAligned(offset, kPointerSize));
-
-  leap(dst, FieldOperand(object, offset));
-  if (emit_debug_code()) {
-    Label ok;
-    testb(dst, Immediate(kPointerSize - 1));
-    j(zero, &ok, Label::kNear);
-    int3();
-    bind(&ok);
-  }
-
-  RecordWrite(object, dst, value, save_fp, remembered_set_action,
-              OMIT_SMI_CHECK);
-
-  bind(&done);
-
-  // Clobber clobbered input registers when running with the debug-code flag
-  // turned on to provoke errors.
-  if (emit_debug_code()) {
-    Move(value, reinterpret_cast<Address>(kZapValue),
-         Assembler::RelocInfoNone());
-    Move(dst, reinterpret_cast<Address>(kZapValue), Assembler::RelocInfoNone());
-  }
-}
-
-void TurboAssembler::SaveRegisters(RegList registers) {
-  DCHECK_GT(NumRegs(registers), 0);
-  for (int i = 0; i < Register::kNumRegisters; ++i) {
-    if ((registers >> i) & 1u) {
-      pushq(Register::from_code(i));
-    }
-  }
-}
-
-void TurboAssembler::RestoreRegisters(RegList registers) {
-  DCHECK_GT(NumRegs(registers), 0);
-  for (int i = Register::kNumRegisters - 1; i >= 0; --i) {
-    if ((registers >> i) & 1u) {
-      popq(Register::from_code(i));
-    }
-  }
-}
-
-void TurboAssembler::CallRecordWriteStub(
-    Register object, Register address,
-    RememberedSetAction remembered_set_action, SaveFPRegsMode fp_mode) {
-  Callable const callable =
-      Builtins::CallableFor(isolate(), Builtins::kRecordWrite);
-  RegList registers = callable.descriptor().allocatable_registers();
-
-  SaveRegisters(registers);
-
-  Register object_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kObject));
-  Register slot_parameter(
-      callable.descriptor().GetRegisterParameter(RecordWriteDescriptor::kSlot));
-  Register isolate_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kIsolate));
-  Register remembered_set_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kRememberedSet));
-  Register fp_mode_parameter(callable.descriptor().GetRegisterParameter(
-      RecordWriteDescriptor::kFPMode));
-
-  // Prepare argument registers for calling RecordWrite
-  // slot_parameter   <= address
-  // object_parameter <= object
-  if (slot_parameter != object) {
-    // Normal case
-    Move(slot_parameter, address);
-    Move(object_parameter, object);
-  } else if (object_parameter != address) {
-    // Only slot_parameter and object are the same register
-    // object_parameter <= object
-    // slot_parameter   <= address
-    Move(object_parameter, object);
-    Move(slot_parameter, address);
-  } else {
-    // slot_parameter   \/ address
-    // object_parameter /\ object
-    xchgq(slot_parameter, object_parameter);
-  }
-
-  LoadAddress(isolate_parameter, ExternalReference::isolate_address(isolate()));
-
-  Smi* smi_rsa = Smi::FromEnum(remembered_set_action);
-  Smi* smi_fm = Smi::FromEnum(fp_mode);
-  Move(remembered_set_parameter, smi_rsa);
-  if (smi_rsa != smi_fm) {
-    Move(fp_mode_parameter, smi_fm);
-  } else {
-    movq(fp_mode_parameter, remembered_set_parameter);
-  }
-  Call(callable.code(), RelocInfo::CODE_TARGET);
-
-  RestoreRegisters(registers);
-}
-
-void MacroAssembler::RecordWrite(Register object, Register address,
-                                 Register value, SaveFPRegsMode fp_mode,
-                                 RememberedSetAction remembered_set_action,
-                                 SmiCheck smi_check) {
-  DCHECK(object != value);
-  DCHECK(object != address);
-  DCHECK(value != address);
-  AssertNotSmi(object);
-
-  if (remembered_set_action == OMIT_REMEMBERED_SET &&
-      !FLAG_incremental_marking) {
-    return;
-  }
-
-  if (emit_debug_code()) {
-    Label ok;
-    cmpp(value, Operand(address, 0));
-    j(equal, &ok, Label::kNear);
-    int3();
-    bind(&ok);
-  }
-
-  // First, check if a write barrier is even needed. The tests below
-  // catch stores of smis and stores into the young generation.
-  Label done;
-
-  if (smi_check == INLINE_SMI_CHECK) {
-    // Skip barrier if writing a smi.
-    JumpIfSmi(value, &done);
-  }
-
-  CheckPageFlag(value,
-                value,  // Used as scratch.
-                MemoryChunk::kPointersToHereAreInterestingMask, zero, &done,
-                Label::kNear);
-
-  CheckPageFlag(object,
-                value,  // Used as scratch.
-                MemoryChunk::kPointersFromHereAreInterestingMask,
-                zero,
-                &done,
-                Label::kNear);
-
-  CallRecordWriteStub(object, address, remembered_set_action, fp_mode);
-
-  bind(&done);
-
-  // Count number of write barriers in generated code.
-  isolate()->counters()->write_barriers_static()->Increment();
-  IncrementCounter(isolate()->counters()->write_barriers_dynamic(), 1);
-
-  // Clobber clobbered registers when running with the debug-code flag
-  // turned on to provoke errors.
-  if (emit_debug_code()) {
-    Move(address, reinterpret_cast<Address>(kZapValue),
-         Assembler::RelocInfoNone());
-    Move(value, reinterpret_cast<Address>(kZapValue),
-         Assembler::RelocInfoNone());
-  }
-}
-
-void TurboAssembler::Assert(Condition cc, AbortReason reason) {
-  if (emit_debug_code()) Check(cc, reason);
-}
-
-void TurboAssembler::AssertUnreachable(AbortReason reason) {
-  if (emit_debug_code()) Abort(reason);
-}
-
-void TurboAssembler::Check(Condition cc, AbortReason reason) {
-  Label L;
-  j(cc, &L, Label::kNear);
-  Abort(reason);
-  // Control will not return here.
-  bind(&L);
-}
-
-void TurboAssembler::CheckStackAlignment() {
-  int frame_alignment = base::OS::ActivationFrameAlignment();
-  int frame_alignment_mask = frame_alignment - 1;
-  if (frame_alignment > kPointerSize) {
-    DCHECK(base::bits::IsPowerOfTwo(frame_alignment));
-    Label alignment_as_expected;
-    testp(rsp, Immediate(frame_alignment_mask));
-    j(zero, &alignment_as_expected, Label::kNear);
-    // Abort if stack is not aligned.
-    int3();
-    bind(&alignment_as_expected);
-  }
-}
-
-void TurboAssembler::Abort(AbortReason reason) {
-#ifdef DEBUG
-  const char* msg = GetAbortReason(reason);
-  if (msg != nullptr) {
-    RecordComment("Abort message: ");
-    RecordComment(msg);
-  }
-
-  if (FLAG_trap_on_abort) {
-    int3();
-    return;
-  }
-#endif
-
-  Move(rdx, Smi::FromInt(static_cast<int>(reason)));
-
-  if (!has_frame()) {
-    // We don't actually want to generate a pile of code for this, so just
-    // claim there is a stack frame, without generating one.
-    FrameScope scope(this, StackFrame::NONE);
-    Call(BUILTIN_CODE(isolate(), Abort), RelocInfo::CODE_TARGET);
-  } else {
-    Call(BUILTIN_CODE(isolate(), Abort), RelocInfo::CODE_TARGET);
-  }
-  // Control will not return here.
-  int3();
-}
-
-void TurboAssembler::CallStubDelayed(CodeStub* stub) {
-  DCHECK(AllowThisStubCall(stub));  // Calls are not allowed in some stubs
-  call(stub);
-}
-
-void MacroAssembler::CallStub(CodeStub* stub) {
-  DCHECK(AllowThisStubCall(stub));  // Calls are not allowed in some stubs
-  Call(stub->GetCode(), RelocInfo::CODE_TARGET);
-}
-
-
-void MacroAssembler::TailCallStub(CodeStub* stub) {
-  Jump(stub->GetCode(), RelocInfo::CODE_TARGET);
-}
-
-bool TurboAssembler::AllowThisStubCall(CodeStub* stub) {
-  return has_frame() || !stub->SometimesSetsUpAFrame();
-}
-
-void TurboAssembler::CallRuntimeDelayed(Zone* zone, Runtime::FunctionId fid,
-                                        SaveFPRegsMode save_doubles) {
-  const Runtime::Function* f = Runtime::FunctionForId(fid);
-  // TODO(1236192): Most runtime routines don't need the number of
-  // arguments passed in because it is constant. At some point we
-  // should remove this need and make the runtime routine entry code
-  // smarter.
-  Set(rax, f->nargs);
-  LoadAddress(rbx, ExternalReference(f, isolate()));
-  CallStubDelayed(new (zone) CEntryStub(nullptr, f->result_size, save_doubles));
-}
-
-void MacroAssembler::CallRuntime(const Runtime::Function* f,
-                                 int num_arguments,
-                                 SaveFPRegsMode save_doubles) {
-  // If the expected number of arguments of the runtime function is
-  // constant, we check that the actual number of arguments match the
-  // expectation.
-  CHECK(f->nargs < 0 || f->nargs == num_arguments);
-
-  // TODO(1236192): Most runtime routines don't need the number of
-  // arguments passed in because it is constant. At some point we
-  // should remove this need and make the runtime routine entry code
-  // smarter.
-  Set(rax, num_arguments);
-  LoadAddress(rbx, ExternalReference(f, isolate()));
-  CEntryStub ces(isolate(), f->result_size, save_doubles);
-  CallStub(&ces);
-}
-
-void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid) {
-  // ----------- S t a t e -------------
-  //  -- rsp[0]                 : return address
-  //  -- rsp[8]                 : argument num_arguments - 1
-  //  ...
-  //  -- rsp[8 * num_arguments] : argument 0 (receiver)
-  //
-  //  For runtime functions with variable arguments:
-  //  -- rax                    : number of  arguments
-  // -----------------------------------
-
-  const Runtime::Function* function = Runtime::FunctionForId(fid);
-  DCHECK_EQ(1, function->result_size);
-  if (function->nargs >= 0) {
-    Set(rax, function->nargs);
-  }
-  JumpToExternalReference(ExternalReference(fid, isolate()));
-}
-
-void MacroAssembler::JumpToExternalReference(const ExternalReference& ext,
-                                             bool builtin_exit_frame) {
-  // Set the entry point and jump to the C entry runtime stub.
-  LoadAddress(rbx, ext);
-  CEntryStub ces(isolate(), 1, kDontSaveFPRegs, kArgvOnStack,
-                 builtin_exit_frame);
-  jmp(ces.GetCode(), RelocInfo::CODE_TARGET);
-}
-
-static constexpr Register saved_regs[] = {rax, rcx, rdx, rbx, rbp, rsi,
-                                          rdi, r8,  r9,  r10, r11};
-
-static constexpr int kNumberOfSavedRegs = sizeof(saved_regs) / sizeof(Register);
-
-int TurboAssembler::RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode,
-                                                    Register exclusion1,
-                                                    Register exclusion2,
-                                                    Register exclusion3) const {
-  int bytes = 0;
-  for (int i = 0; i < kNumberOfSavedRegs; i++) {
-    Register reg = saved_regs[i];
-    if (reg != exclusion1 && reg != exclusion2 && reg != exclusion3) {
-      bytes += kPointerSize;
-    }
-  }
-
-  // R12 to r15 are callee save on all platforms.
-  if (fp_mode == kSaveFPRegs) {
-    bytes += kDoubleSize * XMMRegister::kNumRegisters;
-  }
-
-  return bytes;
-}
-
-int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
-                                    Register exclusion2, Register exclusion3) {
-  // We don't allow a GC during a store buffer overflow so there is no need to
-  // store the registers in any particular way, but we do have to store and
-  // restore them.
-  int bytes = 0;
-  for (int i = 0; i < kNumberOfSavedRegs; i++) {
-    Register reg = saved_regs[i];
-    if (reg != exclusion1 && reg != exclusion2 && reg != exclusion3) {
-      pushq(reg);
-      bytes += kPointerSize;
-    }
-  }
-
-  // R12 to r15 are callee save on all platforms.
-  if (fp_mode == kSaveFPRegs) {
-    int delta = kDoubleSize * XMMRegister::kNumRegisters;
-    subp(rsp, Immediate(delta));
-    for (int i = 0; i < XMMRegister::kNumRegisters; i++) {
-      XMMRegister reg = XMMRegister::from_code(i);
-      Movsd(Operand(rsp, i * kDoubleSize), reg);
-    }
-    bytes += delta;
-  }
-
-  return bytes;
-}
-
-int TurboAssembler::PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
-                                   Register exclusion2, Register exclusion3) {
-  int bytes = 0;
-  if (fp_mode == kSaveFPRegs) {
-    for (int i = 0; i < XMMRegister::kNumRegisters; i++) {
-      XMMRegister reg = XMMRegister::from_code(i);
-      Movsd(reg, Operand(rsp, i * kDoubleSize));
-    }
-    int delta = kDoubleSize * XMMRegister::kNumRegisters;
-    addp(rsp, Immediate(kDoubleSize * XMMRegister::kNumRegisters));
-    bytes += delta;
-  }
-
-  for (int i = kNumberOfSavedRegs - 1; i >= 0; i--) {
-    Register reg = saved_regs[i];
-    if (reg != exclusion1 && reg != exclusion2 && reg != exclusion3) {
-      popq(reg);
-      bytes += kPointerSize;
-    }
-  }
-
-  return bytes;
-}
-
-void TurboAssembler::Cvtss2sd(XMMRegister dst, XMMRegister src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vcvtss2sd(dst, src, src);
-  } else {
-    cvtss2sd(dst, src);
-  }
-}
-
-void TurboAssembler::Cvtss2sd(XMMRegister dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vcvtss2sd(dst, dst, src);
-  } else {
-    cvtss2sd(dst, src);
-  }
-}
-
-void TurboAssembler::Cvtsd2ss(XMMRegister dst, XMMRegister src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vcvtsd2ss(dst, src, src);
-  } else {
-    cvtsd2ss(dst, src);
-  }
-}
-
-void TurboAssembler::Cvtsd2ss(XMMRegister dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vcvtsd2ss(dst, dst, src);
-  } else {
-    cvtsd2ss(dst, src);
-  }
-}
-
-void TurboAssembler::Cvtlsi2sd(XMMRegister dst, Register src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vxorpd(dst, dst, dst);
-    vcvtlsi2sd(dst, dst, src);
-  } else {
-    xorpd(dst, dst);
-    cvtlsi2sd(dst, src);
-  }
-}
-
-void TurboAssembler::Cvtlsi2sd(XMMRegister dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vxorpd(dst, dst, dst);
-    vcvtlsi2sd(dst, dst, src);
-  } else {
-    xorpd(dst, dst);
-    cvtlsi2sd(dst, src);
-  }
-}
-
-void TurboAssembler::Cvtlsi2ss(XMMRegister dst, Register src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vxorps(dst, dst, dst);
-    vcvtlsi2ss(dst, dst, src);
-  } else {
-    xorps(dst, dst);
-    cvtlsi2ss(dst, src);
-  }
-}
-
-void TurboAssembler::Cvtlsi2ss(XMMRegister dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vxorps(dst, dst, dst);
-    vcvtlsi2ss(dst, dst, src);
-  } else {
-    xorps(dst, dst);
-    cvtlsi2ss(dst, src);
-  }
-}
-
-void TurboAssembler::Cvtqsi2ss(XMMRegister dst, Register src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vxorps(dst, dst, dst);
-    vcvtqsi2ss(dst, dst, src);
-  } else {
-    xorps(dst, dst);
-    cvtqsi2ss(dst, src);
-  }
-}
-
-void TurboAssembler::Cvtqsi2ss(XMMRegister dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vxorps(dst, dst, dst);
-    vcvtqsi2ss(dst, dst, src);
-  } else {
-    xorps(dst, dst);
-    cvtqsi2ss(dst, src);
-  }
-}
-
-void TurboAssembler::Cvtqsi2sd(XMMRegister dst, Register src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vxorpd(dst, dst, dst);
-    vcvtqsi2sd(dst, dst, src);
-  } else {
-    xorpd(dst, dst);
-    cvtqsi2sd(dst, src);
-  }
-}
-
-void TurboAssembler::Cvtqsi2sd(XMMRegister dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vxorpd(dst, dst, dst);
-    vcvtqsi2sd(dst, dst, src);
-  } else {
-    xorpd(dst, dst);
-    cvtqsi2sd(dst, src);
-  }
-}
-
-void TurboAssembler::Cvtqui2ss(XMMRegister dst, Register src, Register tmp) {
-  Label msb_set_src;
-  Label jmp_return;
-  testq(src, src);
-  j(sign, &msb_set_src, Label::kNear);
-  Cvtqsi2ss(dst, src);
-  jmp(&jmp_return, Label::kNear);
-  bind(&msb_set_src);
-  movq(tmp, src);
-  shrq(src, Immediate(1));
-  // Recover the least significant bit to avoid rounding errors.
-  andq(tmp, Immediate(1));
-  orq(src, tmp);
-  Cvtqsi2ss(dst, src);
-  addss(dst, dst);
-  bind(&jmp_return);
-}
-
-void TurboAssembler::Cvtqui2sd(XMMRegister dst, Register src, Register tmp) {
-  Label msb_set_src;
-  Label jmp_return;
-  testq(src, src);
-  j(sign, &msb_set_src, Label::kNear);
-  Cvtqsi2sd(dst, src);
-  jmp(&jmp_return, Label::kNear);
-  bind(&msb_set_src);
-  movq(tmp, src);
-  shrq(src, Immediate(1));
-  andq(tmp, Immediate(1));
-  orq(src, tmp);
-  Cvtqsi2sd(dst, src);
-  addsd(dst, dst);
-  bind(&jmp_return);
-}
-
-void TurboAssembler::Cvttss2si(Register dst, XMMRegister src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vcvttss2si(dst, src);
-  } else {
-    cvttss2si(dst, src);
-  }
-}
-
-void TurboAssembler::Cvttss2si(Register dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vcvttss2si(dst, src);
-  } else {
-    cvttss2si(dst, src);
-  }
-}
-
-void TurboAssembler::Cvttsd2si(Register dst, XMMRegister src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vcvttsd2si(dst, src);
-  } else {
-    cvttsd2si(dst, src);
-  }
-}
-
-void TurboAssembler::Cvttsd2si(Register dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vcvttsd2si(dst, src);
-  } else {
-    cvttsd2si(dst, src);
-  }
-}
-
-void TurboAssembler::Cvttss2siq(Register dst, XMMRegister src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vcvttss2siq(dst, src);
-  } else {
-    cvttss2siq(dst, src);
-  }
-}
-
-void TurboAssembler::Cvttss2siq(Register dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vcvttss2siq(dst, src);
-  } else {
-    cvttss2siq(dst, src);
-  }
-}
-
-void TurboAssembler::Cvttsd2siq(Register dst, XMMRegister src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vcvttsd2siq(dst, src);
-  } else {
-    cvttsd2siq(dst, src);
-  }
-}
-
-void TurboAssembler::Cvttsd2siq(Register dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vcvttsd2siq(dst, src);
-  } else {
-    cvttsd2siq(dst, src);
-  }
-}
-
-
-void MacroAssembler::Load(Register dst, const Operand& src, Representation r) {
-  DCHECK(!r.IsDouble());
-  if (r.IsInteger8()) {
-    movsxbq(dst, src);
-  } else if (r.IsUInteger8()) {
-    movzxbl(dst, src);
-  } else if (r.IsInteger16()) {
-    movsxwq(dst, src);
-  } else if (r.IsUInteger16()) {
-    movzxwl(dst, src);
-  } else if (r.IsInteger32()) {
-    movl(dst, src);
-  } else {
-    movp(dst, src);
-  }
-}
-
-
-void MacroAssembler::Store(const Operand& dst, Register src, Representation r) {
-  DCHECK(!r.IsDouble());
-  if (r.IsInteger8() || r.IsUInteger8()) {
-    movb(dst, src);
-  } else if (r.IsInteger16() || r.IsUInteger16()) {
-    movw(dst, src);
-  } else if (r.IsInteger32()) {
-    movl(dst, src);
-  } else {
-    if (r.IsHeapObject()) {
-      AssertNotSmi(src);
-    } else if (r.IsSmi()) {
-      AssertSmi(src);
-    }
-    movp(dst, src);
-  }
-}
-
-void TurboAssembler::Set(Register dst, int64_t x) {
-  if (x == 0) {
-    xorl(dst, dst);
-  } else if (is_uint32(x)) {
-    movl(dst, Immediate(static_cast<uint32_t>(x)));
-  } else if (is_int32(x)) {
-    movq(dst, Immediate(static_cast<int32_t>(x)));
-  } else {
-    movq(dst, x);
-  }
-}
-
-void TurboAssembler::Set(const Operand& dst, intptr_t x) {
-  if (kPointerSize == kInt64Size) {
-    if (is_int32(x)) {
-      movp(dst, Immediate(static_cast<int32_t>(x)));
-    } else {
-      Set(kScratchRegister, x);
-      movp(dst, kScratchRegister);
-    }
-  } else {
-    movp(dst, Immediate(static_cast<int32_t>(x)));
-  }
-}
-
-
-// ----------------------------------------------------------------------------
-// Smi tagging, untagging and tag detection.
-
-Register TurboAssembler::GetSmiConstant(Smi* source) {
-  STATIC_ASSERT(kSmiTag == 0);
-  int value = source->value();
-  if (value == 0) {
-    xorl(kScratchRegister, kScratchRegister);
-    return kScratchRegister;
-  }
-  Move(kScratchRegister, source);
-  return kScratchRegister;
-}
-
-void TurboAssembler::Move(Register dst, Smi* source) {
-  STATIC_ASSERT(kSmiTag == 0);
-  int value = source->value();
-  if (value == 0) {
-    xorl(dst, dst);
-  } else {
-    Move(dst, source, Assembler::RelocInfoNone());
-  }
-}
-
-void MacroAssembler::Integer32ToSmi(Register dst, Register src) {
-  STATIC_ASSERT(kSmiTag == 0);
-  if (dst != src) {
-    movl(dst, src);
-  }
-  shlp(dst, Immediate(kSmiShift));
-}
-
-void TurboAssembler::SmiToInteger32(Register dst, Register src) {
-  STATIC_ASSERT(kSmiTag == 0);
-  if (dst != src) {
-    movp(dst, src);
-  }
-
-  if (SmiValuesAre32Bits()) {
-    shrp(dst, Immediate(kSmiShift));
-  } else {
-    DCHECK(SmiValuesAre31Bits());
-    sarl(dst, Immediate(kSmiShift));
-  }
-}
-
-void TurboAssembler::SmiToInteger32(Register dst, const Operand& src) {
-  if (SmiValuesAre32Bits()) {
-    movl(dst, Operand(src, kSmiShift / kBitsPerByte));
-  } else {
-    DCHECK(SmiValuesAre31Bits());
-    movl(dst, src);
-    sarl(dst, Immediate(kSmiShift));
-  }
-}
-
-
-void MacroAssembler::SmiToInteger64(Register dst, Register src) {
-  STATIC_ASSERT(kSmiTag == 0);
-  if (dst != src) {
-    movp(dst, src);
-  }
-  sarp(dst, Immediate(kSmiShift));
-  if (kPointerSize == kInt32Size) {
-    // Sign extend to 64-bit.
-    movsxlq(dst, dst);
-  }
-}
-
-void MacroAssembler::SmiCompare(Register smi1, Register smi2) {
-  AssertSmi(smi1);
-  AssertSmi(smi2);
-  cmpp(smi1, smi2);
-}
-
-
-void MacroAssembler::SmiCompare(Register dst, Smi* src) {
-  AssertSmi(dst);
-  Cmp(dst, src);
-}
-
-
-void MacroAssembler::Cmp(Register dst, Smi* src) {
-  DCHECK_NE(dst, kScratchRegister);
-  if (src->value() == 0) {
-    testp(dst, dst);
-  } else {
-    Register constant_reg = GetSmiConstant(src);
-    cmpp(dst, constant_reg);
-  }
-}
-
-
-void MacroAssembler::SmiCompare(Register dst, const Operand& src) {
-  AssertSmi(dst);
-  AssertSmi(src);
-  cmpp(dst, src);
-}
-
-
-void MacroAssembler::SmiCompare(const Operand& dst, Register src) {
-  AssertSmi(dst);
-  AssertSmi(src);
-  cmpp(dst, src);
-}
-
-
-void MacroAssembler::SmiCompare(const Operand& dst, Smi* src) {
-  AssertSmi(dst);
-  if (SmiValuesAre32Bits()) {
-    cmpl(Operand(dst, kSmiShift / kBitsPerByte), Immediate(src->value()));
-  } else {
-    DCHECK(SmiValuesAre31Bits());
-    cmpl(dst, Immediate(src));
-  }
-}
-
-
-void MacroAssembler::Cmp(const Operand& dst, Smi* src) {
-  // The Operand cannot use the smi register.
-  Register smi_reg = GetSmiConstant(src);
-  DCHECK(!dst.AddressUsesRegister(smi_reg));
-  cmpp(dst, smi_reg);
-}
-
-
-Condition TurboAssembler::CheckSmi(Register src) {
-  STATIC_ASSERT(kSmiTag == 0);
-  testb(src, Immediate(kSmiTagMask));
-  return zero;
-}
-
-Condition TurboAssembler::CheckSmi(const Operand& src) {
-  STATIC_ASSERT(kSmiTag == 0);
-  testb(src, Immediate(kSmiTagMask));
-  return zero;
-}
-
-void TurboAssembler::JumpIfSmi(Register src, Label* on_smi,
-                               Label::Distance near_jump) {
-  Condition smi = CheckSmi(src);
-  j(smi, on_smi, near_jump);
-}
-
-
-void MacroAssembler::JumpIfNotSmi(Register src,
-                                  Label* on_not_smi,
-                                  Label::Distance near_jump) {
-  Condition smi = CheckSmi(src);
-  j(NegateCondition(smi), on_not_smi, near_jump);
-}
-
-void MacroAssembler::JumpIfNotSmi(Operand src, Label* on_not_smi,
-                                  Label::Distance near_jump) {
-  Condition smi = CheckSmi(src);
-  j(NegateCondition(smi), on_not_smi, near_jump);
-}
-
-void MacroAssembler::SmiAddConstant(const Operand& dst, Smi* constant) {
-  if (constant->value() != 0) {
-    if (SmiValuesAre32Bits()) {
-      addl(Operand(dst, kSmiShift / kBitsPerByte),
-           Immediate(constant->value()));
-    } else {
-      DCHECK(SmiValuesAre31Bits());
-      addp(dst, Immediate(constant));
-    }
-  }
-}
-
-SmiIndex MacroAssembler::SmiToIndex(Register dst,
-                                    Register src,
-                                    int shift) {
-  if (SmiValuesAre32Bits()) {
-    DCHECK(is_uint6(shift));
-    // There is a possible optimization if shift is in the range 60-63, but that
-    // will (and must) never happen.
-    if (dst != src) {
-      movp(dst, src);
-    }
-    if (shift < kSmiShift) {
-      sarp(dst, Immediate(kSmiShift - shift));
-    } else {
-      shlp(dst, Immediate(shift - kSmiShift));
-    }
-    return SmiIndex(dst, times_1);
-  } else {
-    DCHECK(SmiValuesAre31Bits());
-    DCHECK(shift >= times_1 && shift <= (static_cast<int>(times_8) + 1));
-    if (dst != src) {
-      movp(dst, src);
-    }
-    // We have to sign extend the index register to 64-bit as the SMI might
-    // be negative.
-    movsxlq(dst, dst);
-    if (shift == times_1) {
-      sarq(dst, Immediate(kSmiShift));
-      return SmiIndex(dst, times_1);
-    }
-    return SmiIndex(dst, static_cast<ScaleFactor>(shift - 1));
-  }
-}
-
-void TurboAssembler::Push(Smi* source) {
-  intptr_t smi = reinterpret_cast<intptr_t>(source);
-  if (is_int32(smi)) {
-    Push(Immediate(static_cast<int32_t>(smi)));
-    return;
-  }
-  int first_byte_set = base::bits::CountTrailingZeros64(smi) / 8;
-  int last_byte_set = (63 - base::bits::CountLeadingZeros64(smi)) / 8;
-  if (first_byte_set == last_byte_set && kPointerSize == kInt64Size) {
-    // This sequence has only 7 bytes, compared to the 12 bytes below.
-    Push(Immediate(0));
-    movb(Operand(rsp, first_byte_set),
-         Immediate(static_cast<int8_t>(smi >> (8 * first_byte_set))));
-    return;
-  }
-  Register constant = GetSmiConstant(source);
-  Push(constant);
-}
-
-// ----------------------------------------------------------------------------
-
-void TurboAssembler::Move(Register dst, Register src) {
-  if (dst != src) {
-    movp(dst, src);
-  }
-}
-
-void TurboAssembler::MoveNumber(Register dst, double value) {
-  int32_t smi;
-  if (DoubleToSmiInteger(value, &smi)) {
-    Move(dst, Smi::FromInt(smi));
-  } else {
-    movp_heap_number(dst, value);
-  }
-}
-
-void TurboAssembler::Move(XMMRegister dst, uint32_t src) {
-  if (src == 0) {
-    Xorpd(dst, dst);
-  } else {
-    unsigned pop = base::bits::CountPopulation(src);
-    DCHECK_NE(0u, pop);
-    if (pop == 32) {
-      Pcmpeqd(dst, dst);
-    } else {
-      movl(kScratchRegister, Immediate(src));
-      Movq(dst, kScratchRegister);
-    }
-  }
-}
-
-void TurboAssembler::Move(XMMRegister dst, uint64_t src) {
-  if (src == 0) {
-    Xorpd(dst, dst);
-  } else {
-    unsigned nlz = base::bits::CountLeadingZeros(src);
-    unsigned ntz = base::bits::CountTrailingZeros(src);
-    unsigned pop = base::bits::CountPopulation(src);
-    DCHECK_NE(0u, pop);
-    if (pop == 64) {
-      Pcmpeqd(dst, dst);
-    } else if (pop + ntz == 64) {
-      Pcmpeqd(dst, dst);
-      Psllq(dst, ntz);
-    } else if (pop + nlz == 64) {
-      Pcmpeqd(dst, dst);
-      Psrlq(dst, nlz);
-    } else {
-      uint32_t lower = static_cast<uint32_t>(src);
-      uint32_t upper = static_cast<uint32_t>(src >> 32);
-      if (upper == 0) {
-        Move(dst, lower);
-      } else {
-        movq(kScratchRegister, src);
-        Movq(dst, kScratchRegister);
-      }
-    }
-  }
-}
-
-void TurboAssembler::Movaps(XMMRegister dst, XMMRegister src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vmovaps(dst, src);
-  } else {
-    movaps(dst, src);
-  }
-}
-
-void TurboAssembler::Movups(XMMRegister dst, XMMRegister src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vmovups(dst, src);
-  } else {
-    movups(dst, src);
-  }
-}
-
-void TurboAssembler::Movups(XMMRegister dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vmovups(dst, src);
-  } else {
-    movups(dst, src);
-  }
-}
-
-void TurboAssembler::Movups(const Operand& dst, XMMRegister src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vmovups(dst, src);
-  } else {
-    movups(dst, src);
-  }
-}
-
-void TurboAssembler::Movapd(XMMRegister dst, XMMRegister src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vmovapd(dst, src);
-  } else {
-    movapd(dst, src);
-  }
-}
-
-void TurboAssembler::Movsd(XMMRegister dst, XMMRegister src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vmovsd(dst, dst, src);
-  } else {
-    movsd(dst, src);
-  }
-}
-
-void TurboAssembler::Movsd(XMMRegister dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vmovsd(dst, src);
-  } else {
-    movsd(dst, src);
-  }
-}
-
-void TurboAssembler::Movsd(const Operand& dst, XMMRegister src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vmovsd(dst, src);
-  } else {
-    movsd(dst, src);
-  }
-}
-
-void TurboAssembler::Movss(XMMRegister dst, XMMRegister src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vmovss(dst, dst, src);
-  } else {
-    movss(dst, src);
-  }
-}
-
-void TurboAssembler::Movss(XMMRegister dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vmovss(dst, src);
-  } else {
-    movss(dst, src);
-  }
-}
-
-void TurboAssembler::Movss(const Operand& dst, XMMRegister src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vmovss(dst, src);
-  } else {
-    movss(dst, src);
-  }
-}
-
-void TurboAssembler::Movd(XMMRegister dst, Register src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vmovd(dst, src);
-  } else {
-    movd(dst, src);
-  }
-}
-
-void TurboAssembler::Movd(XMMRegister dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vmovd(dst, src);
-  } else {
-    movd(dst, src);
-  }
-}
-
-void TurboAssembler::Movd(Register dst, XMMRegister src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vmovd(dst, src);
-  } else {
-    movd(dst, src);
-  }
-}
-
-void TurboAssembler::Movq(XMMRegister dst, Register src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vmovq(dst, src);
-  } else {
-    movq(dst, src);
-  }
-}
-
-void TurboAssembler::Movq(Register dst, XMMRegister src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vmovq(dst, src);
-  } else {
-    movq(dst, src);
-  }
-}
-
-void TurboAssembler::Movmskps(Register dst, XMMRegister src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vmovmskps(dst, src);
-  } else {
-    movmskps(dst, src);
-  }
-}
-
-void TurboAssembler::Movmskpd(Register dst, XMMRegister src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vmovmskpd(dst, src);
-  } else {
-    movmskpd(dst, src);
-  }
-}
-
-void TurboAssembler::Xorps(XMMRegister dst, XMMRegister src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vxorps(dst, dst, src);
-  } else {
-    xorps(dst, src);
-  }
-}
-
-void TurboAssembler::Xorps(XMMRegister dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vxorps(dst, dst, src);
-  } else {
-    xorps(dst, src);
-  }
-}
-
-void TurboAssembler::Roundss(XMMRegister dst, XMMRegister src,
-                             RoundingMode mode) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vroundss(dst, dst, src, mode);
-  } else {
-    roundss(dst, src, mode);
-  }
-}
-
-void TurboAssembler::Roundsd(XMMRegister dst, XMMRegister src,
-                             RoundingMode mode) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vroundsd(dst, dst, src, mode);
-  } else {
-    roundsd(dst, src, mode);
-  }
-}
-
-void TurboAssembler::Sqrtsd(XMMRegister dst, XMMRegister src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vsqrtsd(dst, dst, src);
-  } else {
-    sqrtsd(dst, src);
-  }
-}
-
-void TurboAssembler::Sqrtsd(XMMRegister dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vsqrtsd(dst, dst, src);
-  } else {
-    sqrtsd(dst, src);
-  }
-}
-
-void TurboAssembler::Ucomiss(XMMRegister src1, XMMRegister src2) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vucomiss(src1, src2);
-  } else {
-    ucomiss(src1, src2);
-  }
-}
-
-void TurboAssembler::Ucomiss(XMMRegister src1, const Operand& src2) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vucomiss(src1, src2);
-  } else {
-    ucomiss(src1, src2);
-  }
-}
-
-void TurboAssembler::Ucomisd(XMMRegister src1, XMMRegister src2) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vucomisd(src1, src2);
-  } else {
-    ucomisd(src1, src2);
-  }
-}
-
-void TurboAssembler::Ucomisd(XMMRegister src1, const Operand& src2) {
-  if (CpuFeatures::IsSupported(AVX)) {
-    CpuFeatureScope scope(this, AVX);
-    vucomisd(src1, src2);
-  } else {
-    ucomisd(src1, src2);
-  }
-}
-
-// ----------------------------------------------------------------------------
-
-void MacroAssembler::Absps(XMMRegister dst) {
-  Andps(dst,
-        ExternalOperand(ExternalReference::address_of_float_abs_constant()));
-}
-
-void MacroAssembler::Negps(XMMRegister dst) {
-  Xorps(dst,
-        ExternalOperand(ExternalReference::address_of_float_neg_constant()));
-}
-
-void MacroAssembler::Abspd(XMMRegister dst) {
-  Andps(dst,
-        ExternalOperand(ExternalReference::address_of_double_abs_constant()));
-}
-
-void MacroAssembler::Negpd(XMMRegister dst) {
-  Xorps(dst,
-        ExternalOperand(ExternalReference::address_of_double_neg_constant()));
-}
-
-void MacroAssembler::Cmp(Register dst, Handle<Object> source) {
-  AllowDeferredHandleDereference smi_check;
-  if (source->IsSmi()) {
-    Cmp(dst, Smi::cast(*source));
-  } else {
-    Move(kScratchRegister, Handle<HeapObject>::cast(source));
-    cmpp(dst, kScratchRegister);
-  }
-}
-
-
-void MacroAssembler::Cmp(const Operand& dst, Handle<Object> source) {
-  AllowDeferredHandleDereference smi_check;
-  if (source->IsSmi()) {
-    Cmp(dst, Smi::cast(*source));
-  } else {
-    Move(kScratchRegister, Handle<HeapObject>::cast(source));
-    cmpp(dst, kScratchRegister);
-  }
-}
-
-void TurboAssembler::Push(Handle<HeapObject> source) {
-  Move(kScratchRegister, source);
-  Push(kScratchRegister);
-}
-
-void TurboAssembler::Move(Register result, Handle<HeapObject> object,
-                          RelocInfo::Mode rmode) {
-  movp(result, reinterpret_cast<void*>(object.address()), rmode);
-}
-
-void TurboAssembler::Move(const Operand& dst, Handle<HeapObject> object,
-                          RelocInfo::Mode rmode) {
-  Move(kScratchRegister, object, rmode);
-  movp(dst, kScratchRegister);
-}
-
-void MacroAssembler::Drop(int stack_elements) {
-  if (stack_elements > 0) {
-    addp(rsp, Immediate(stack_elements * kPointerSize));
-  }
-}
-
-
-void MacroAssembler::DropUnderReturnAddress(int stack_elements,
-                                            Register scratch) {
-  DCHECK_GT(stack_elements, 0);
-  if (kPointerSize == kInt64Size && stack_elements == 1) {
-    popq(MemOperand(rsp, 0));
-    return;
-  }
-
-  PopReturnAddressTo(scratch);
-  Drop(stack_elements);
-  PushReturnAddressFrom(scratch);
-}
-
-void TurboAssembler::Push(Register src) {
-  if (kPointerSize == kInt64Size) {
-    pushq(src);
-  } else {
-    // x32 uses 64-bit push for rbp in the prologue.
-    DCHECK(src.code() != rbp.code());
-    leal(rsp, Operand(rsp, -4));
-    movp(Operand(rsp, 0), src);
-  }
-}
-
-void TurboAssembler::Push(const Operand& src) {
-  if (kPointerSize == kInt64Size) {
-    pushq(src);
-  } else {
-    movp(kScratchRegister, src);
-    leal(rsp, Operand(rsp, -4));
-    movp(Operand(rsp, 0), kScratchRegister);
-  }
-}
-
-
-void MacroAssembler::PushQuad(const Operand& src) {
-  if (kPointerSize == kInt64Size) {
-    pushq(src);
-  } else {
-    movp(kScratchRegister, src);
-    pushq(kScratchRegister);
-  }
-}
-
-void TurboAssembler::Push(Immediate value) {
-  if (kPointerSize == kInt64Size) {
-    pushq(value);
-  } else {
-    leal(rsp, Operand(rsp, -4));
-    movp(Operand(rsp, 0), value);
-  }
-}
-
-
-void MacroAssembler::PushImm32(int32_t imm32) {
-  if (kPointerSize == kInt64Size) {
-    pushq_imm32(imm32);
-  } else {
-    leal(rsp, Operand(rsp, -4));
-    movp(Operand(rsp, 0), Immediate(imm32));
-  }
-}
-
-
-void MacroAssembler::Pop(Register dst) {
-  if (kPointerSize == kInt64Size) {
-    popq(dst);
-  } else {
-    // x32 uses 64-bit pop for rbp in the epilogue.
-    DCHECK(dst.code() != rbp.code());
-    movp(dst, Operand(rsp, 0));
-    leal(rsp, Operand(rsp, 4));
-  }
-}
-
-
-void MacroAssembler::Pop(const Operand& dst) {
-  if (kPointerSize == kInt64Size) {
-    popq(dst);
-  } else {
-    Register scratch = dst.AddressUsesRegister(kScratchRegister)
-        ? kRootRegister : kScratchRegister;
-    movp(scratch, Operand(rsp, 0));
-    movp(dst, scratch);
-    leal(rsp, Operand(rsp, 4));
-    if (scratch == kRootRegister) {
-      // Restore kRootRegister.
-      InitializeRootRegister();
-    }
-  }
-}
-
-
-void MacroAssembler::PopQuad(const Operand& dst) {
-  if (kPointerSize == kInt64Size) {
-    popq(dst);
-  } else {
-    popq(kScratchRegister);
-    movp(dst, kScratchRegister);
-  }
-}
-
-
-void MacroAssembler::Jump(ExternalReference ext) {
-  LoadAddress(kScratchRegister, ext);
-  jmp(kScratchRegister);
-}
-
-
-void MacroAssembler::Jump(const Operand& op) {
-  if (kPointerSize == kInt64Size) {
-    jmp(op);
-  } else {
-    movp(kScratchRegister, op);
-    jmp(kScratchRegister);
-  }
-}
-
-
-void MacroAssembler::Jump(Address destination, RelocInfo::Mode rmode) {
-  Move(kScratchRegister, destination, rmode);
-  jmp(kScratchRegister);
-}
-
-
-void MacroAssembler::Jump(Handle<Code> code_object, RelocInfo::Mode rmode) {
-  // TODO(X64): Inline this
-  jmp(code_object, rmode);
-}
-
-int TurboAssembler::CallSize(ExternalReference ext) {
-  // Opcode for call kScratchRegister is: Rex.B FF D4 (three bytes).
-  return LoadAddressSize(ext) +
-         Assembler::kCallScratchRegisterInstructionLength;
-}
-
-void TurboAssembler::Call(ExternalReference ext) {
-#ifdef DEBUG
-  int end_position = pc_offset() + CallSize(ext);
-#endif
-  LoadAddress(kScratchRegister, ext);
-  call(kScratchRegister);
-  DCHECK_EQ(end_position, pc_offset());
-}
-
-void TurboAssembler::Call(const Operand& op) {
-  if (kPointerSize == kInt64Size && !CpuFeatures::IsSupported(ATOM)) {
-    call(op);
-  } else {
-    movp(kScratchRegister, op);
-    call(kScratchRegister);
-  }
-}
-
-void TurboAssembler::Call(Address destination, RelocInfo::Mode rmode) {
-#ifdef DEBUG
-  int end_position = pc_offset() + CallSize(destination);
-#endif
-  Move(kScratchRegister, destination, rmode);
-  call(kScratchRegister);
-  DCHECK_EQ(pc_offset(), end_position);
-}
-
-void TurboAssembler::Call(Handle<Code> code_object, RelocInfo::Mode rmode) {
-#ifdef DEBUG
-  int end_position = pc_offset() + CallSize(code_object);
-#endif
-  DCHECK(RelocInfo::IsCodeTarget(rmode));
-  call(code_object, rmode);
-  DCHECK_EQ(end_position, pc_offset());
-}
-
-void TurboAssembler::RetpolineCall(Register reg) {
-  Label setup_return, setup_target, inner_indirect_branch, capture_spec;
-
-  jmp(&setup_return);  // Jump past the entire retpoline below.
-
-  bind(&inner_indirect_branch);
-  call(&setup_target);
-
-  bind(&capture_spec);
-  pause();
-  jmp(&capture_spec);
-
-  bind(&setup_target);
-  movq(Operand(rsp, 0), reg);
-  ret(0);
-
-  bind(&setup_return);
-  call(&inner_indirect_branch);  // Callee will return after this instruction.
-}
-
-void TurboAssembler::RetpolineCall(Address destination, RelocInfo::Mode rmode) {
-#ifdef DEBUG
-// TODO(titzer): CallSize() is wrong for RetpolineCalls
-//  int end_position = pc_offset() + CallSize(destination);
-#endif
-  Move(kScratchRegister, destination, rmode);
-  RetpolineCall(kScratchRegister);
-  // TODO(titzer): CallSize() is wrong for RetpolineCalls
-  //  DCHECK_EQ(pc_offset(), end_position);
-}
-
-void TurboAssembler::RetpolineJump(Register reg) {
-  Label setup_target, capture_spec;
-
-  call(&setup_target);
-
-  bind(&capture_spec);
-  pause();
-  jmp(&capture_spec);
-
-  bind(&setup_target);
-  movq(Operand(rsp, 0), reg);
-  ret(0);
-}
-
-void TurboAssembler::Pextrd(Register dst, XMMRegister src, int8_t imm8) {
-  if (imm8 == 0) {
-    Movd(dst, src);
-    return;
-  }
-  if (CpuFeatures::IsSupported(SSE4_1)) {
-    CpuFeatureScope sse_scope(this, SSE4_1);
-    pextrd(dst, src, imm8);
-    return;
-  }
-  DCHECK_EQ(1, imm8);
-  movq(dst, src);
-  shrq(dst, Immediate(32));
-}
-
-void TurboAssembler::Pinsrd(XMMRegister dst, Register src, int8_t imm8) {
-  if (CpuFeatures::IsSupported(SSE4_1)) {
-    CpuFeatureScope sse_scope(this, SSE4_1);
-    pinsrd(dst, src, imm8);
-    return;
-  }
-  Movd(kScratchDoubleReg, src);
-  if (imm8 == 1) {
-    punpckldq(dst, kScratchDoubleReg);
-  } else {
-    DCHECK_EQ(0, imm8);
-    Movss(dst, kScratchDoubleReg);
-  }
-}
-
-void TurboAssembler::Pinsrd(XMMRegister dst, const Operand& src, int8_t imm8) {
-  DCHECK(imm8 == 0 || imm8 == 1);
-  if (CpuFeatures::IsSupported(SSE4_1)) {
-    CpuFeatureScope sse_scope(this, SSE4_1);
-    pinsrd(dst, src, imm8);
-    return;
-  }
-  Movd(kScratchDoubleReg, src);
-  if (imm8 == 1) {
-    punpckldq(dst, kScratchDoubleReg);
-  } else {
-    DCHECK_EQ(0, imm8);
-    Movss(dst, kScratchDoubleReg);
-  }
-}
-
-void TurboAssembler::Lzcntl(Register dst, Register src) {
-  if (CpuFeatures::IsSupported(LZCNT)) {
-    CpuFeatureScope scope(this, LZCNT);
-    lzcntl(dst, src);
-    return;
-  }
-  Label not_zero_src;
-  bsrl(dst, src);
-  j(not_zero, &not_zero_src, Label::kNear);
-  Set(dst, 63);  // 63^31 == 32
-  bind(&not_zero_src);
-  xorl(dst, Immediate(31));  // for x in [0..31], 31^x == 31 - x
-}
-
-void TurboAssembler::Lzcntl(Register dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(LZCNT)) {
-    CpuFeatureScope scope(this, LZCNT);
-    lzcntl(dst, src);
-    return;
-  }
-  Label not_zero_src;
-  bsrl(dst, src);
-  j(not_zero, &not_zero_src, Label::kNear);
-  Set(dst, 63);  // 63^31 == 32
-  bind(&not_zero_src);
-  xorl(dst, Immediate(31));  // for x in [0..31], 31^x == 31 - x
-}
-
-void TurboAssembler::Lzcntq(Register dst, Register src) {
-  if (CpuFeatures::IsSupported(LZCNT)) {
-    CpuFeatureScope scope(this, LZCNT);
-    lzcntq(dst, src);
-    return;
-  }
-  Label not_zero_src;
-  bsrq(dst, src);
-  j(not_zero, &not_zero_src, Label::kNear);
-  Set(dst, 127);  // 127^63 == 64
-  bind(&not_zero_src);
-  xorl(dst, Immediate(63));  // for x in [0..63], 63^x == 63 - x
-}
-
-void TurboAssembler::Lzcntq(Register dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(LZCNT)) {
-    CpuFeatureScope scope(this, LZCNT);
-    lzcntq(dst, src);
-    return;
-  }
-  Label not_zero_src;
-  bsrq(dst, src);
-  j(not_zero, &not_zero_src, Label::kNear);
-  Set(dst, 127);  // 127^63 == 64
-  bind(&not_zero_src);
-  xorl(dst, Immediate(63));  // for x in [0..63], 63^x == 63 - x
-}
-
-void TurboAssembler::Tzcntq(Register dst, Register src) {
-  if (CpuFeatures::IsSupported(BMI1)) {
-    CpuFeatureScope scope(this, BMI1);
-    tzcntq(dst, src);
-    return;
-  }
-  Label not_zero_src;
-  bsfq(dst, src);
-  j(not_zero, &not_zero_src, Label::kNear);
-  // Define the result of tzcnt(0) separately, because bsf(0) is undefined.
-  Set(dst, 64);
-  bind(&not_zero_src);
-}
-
-void TurboAssembler::Tzcntq(Register dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(BMI1)) {
-    CpuFeatureScope scope(this, BMI1);
-    tzcntq(dst, src);
-    return;
-  }
-  Label not_zero_src;
-  bsfq(dst, src);
-  j(not_zero, &not_zero_src, Label::kNear);
-  // Define the result of tzcnt(0) separately, because bsf(0) is undefined.
-  Set(dst, 64);
-  bind(&not_zero_src);
-}
-
-void TurboAssembler::Tzcntl(Register dst, Register src) {
-  if (CpuFeatures::IsSupported(BMI1)) {
-    CpuFeatureScope scope(this, BMI1);
-    tzcntl(dst, src);
-    return;
-  }
-  Label not_zero_src;
-  bsfl(dst, src);
-  j(not_zero, &not_zero_src, Label::kNear);
-  Set(dst, 32);  // The result of tzcnt is 32 if src = 0.
-  bind(&not_zero_src);
-}
-
-void TurboAssembler::Tzcntl(Register dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(BMI1)) {
-    CpuFeatureScope scope(this, BMI1);
-    tzcntl(dst, src);
-    return;
-  }
-  Label not_zero_src;
-  bsfl(dst, src);
-  j(not_zero, &not_zero_src, Label::kNear);
-  Set(dst, 32);  // The result of tzcnt is 32 if src = 0.
-  bind(&not_zero_src);
-}
-
-void TurboAssembler::Popcntl(Register dst, Register src) {
-  if (CpuFeatures::IsSupported(POPCNT)) {
-    CpuFeatureScope scope(this, POPCNT);
-    popcntl(dst, src);
-    return;
-  }
-  UNREACHABLE();
-}
-
-void TurboAssembler::Popcntl(Register dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(POPCNT)) {
-    CpuFeatureScope scope(this, POPCNT);
-    popcntl(dst, src);
-    return;
-  }
-  UNREACHABLE();
-}
-
-void TurboAssembler::Popcntq(Register dst, Register src) {
-  if (CpuFeatures::IsSupported(POPCNT)) {
-    CpuFeatureScope scope(this, POPCNT);
-    popcntq(dst, src);
-    return;
-  }
-  UNREACHABLE();
-}
-
-void TurboAssembler::Popcntq(Register dst, const Operand& src) {
-  if (CpuFeatures::IsSupported(POPCNT)) {
-    CpuFeatureScope scope(this, POPCNT);
-    popcntq(dst, src);
-    return;
-  }
-  UNREACHABLE();
-}
-
-
-void MacroAssembler::Pushad() {
-  Push(rax);
-  Push(rcx);
-  Push(rdx);
-  Push(rbx);
-  // Not pushing rsp or rbp.
-  Push(rsi);
-  Push(rdi);
-  Push(r8);
-  Push(r9);
-  // r10 is kScratchRegister.
-  Push(r11);
-  Push(r12);
-  // r13 is kRootRegister.
-  Push(r14);
-  Push(r15);
-  STATIC_ASSERT(12 == kNumSafepointSavedRegisters);
-  // Use lea for symmetry with Popad.
-  int sp_delta =
-      (kNumSafepointRegisters - kNumSafepointSavedRegisters) * kPointerSize;
-  leap(rsp, Operand(rsp, -sp_delta));
-}
-
-
-void MacroAssembler::Popad() {
-  // Popad must not change the flags, so use lea instead of addq.
-  int sp_delta =
-      (kNumSafepointRegisters - kNumSafepointSavedRegisters) * kPointerSize;
-  leap(rsp, Operand(rsp, sp_delta));
-  Pop(r15);
-  Pop(r14);
-  Pop(r12);
-  Pop(r11);
-  Pop(r9);
-  Pop(r8);
-  Pop(rdi);
-  Pop(rsi);
-  Pop(rbx);
-  Pop(rdx);
-  Pop(rcx);
-  Pop(rax);
-}
-
-
-// Order general registers are pushed by Pushad:
-// rax, rcx, rdx, rbx, rsi, rdi, r8, r9, r11, r14, r15.
-const int
-MacroAssembler::kSafepointPushRegisterIndices[Register::kNumRegisters] = {
-    0,
-    1,
-    2,
-    3,
-    -1,
-    -1,
-    4,
-    5,
-    6,
-    7,
-    -1,
-    8,
-    9,
-    -1,
-    10,
-    11
-};
-
-void MacroAssembler::PushStackHandler() {
-  // Adjust this code if not the case.
-  STATIC_ASSERT(StackHandlerConstants::kSize == 2 * kPointerSize);
-  STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
-
-  Push(Immediate(0));  // Padding.
-
-  // Link the current handler as the next handler.
-  ExternalReference handler_address(IsolateAddressId::kHandlerAddress,
-                                    isolate());
-  Push(ExternalOperand(handler_address));
-
-  // Set this new handler as the current one.
-  movp(ExternalOperand(handler_address), rsp);
-}
-
-
-void MacroAssembler::PopStackHandler() {
-  STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
-  ExternalReference handler_address(IsolateAddressId::kHandlerAddress,
-                                    isolate());
-  Pop(ExternalOperand(handler_address));
-  addp(rsp, Immediate(StackHandlerConstants::kSize - kPointerSize));
-}
-
-void TurboAssembler::Ret() { ret(0); }
-
-void TurboAssembler::Ret(int bytes_dropped, Register scratch) {
-  if (is_uint16(bytes_dropped)) {
-    ret(bytes_dropped);
-  } else {
-    PopReturnAddressTo(scratch);
-    addp(rsp, Immediate(bytes_dropped));
-    PushReturnAddressFrom(scratch);
-    ret(0);
-  }
-}
-
-void MacroAssembler::CmpObjectType(Register heap_object,
-                                   InstanceType type,
-                                   Register map) {
-  movp(map, FieldOperand(heap_object, HeapObject::kMapOffset));
-  CmpInstanceType(map, type);
-}
-
-
-void MacroAssembler::CmpInstanceType(Register map, InstanceType type) {
-  cmpw(FieldOperand(map, Map::kInstanceTypeOffset), Immediate(type));
-}
-
-void TurboAssembler::SlowTruncateToIDelayed(Zone* zone, Register result_reg) {
-  CallStubDelayed(new (zone) DoubleToIStub(nullptr, result_reg));
-}
-
-void MacroAssembler::DoubleToI(Register result_reg, XMMRegister input_reg,
-                               XMMRegister scratch,
-                               MinusZeroMode minus_zero_mode,
-                               Label* lost_precision, Label* is_nan,
-                               Label* minus_zero, Label::Distance dst) {
-  Cvttsd2si(result_reg, input_reg);
-  Cvtlsi2sd(kScratchDoubleReg, result_reg);
-  Ucomisd(kScratchDoubleReg, input_reg);
-  j(not_equal, lost_precision, dst);
-  j(parity_even, is_nan, dst);  // NaN.
-  if (minus_zero_mode == FAIL_ON_MINUS_ZERO) {
-    Label done;
-    // The integer converted back is equal to the original. We
-    // only have to test if we got -0 as an input.
-    testl(result_reg, result_reg);
-    j(not_zero, &done, Label::kNear);
-    Movmskpd(result_reg, input_reg);
-    // Bit 0 contains the sign of the double in input_reg.
-    // If input was positive, we are ok and return 0, otherwise
-    // jump to minus_zero.
-    andl(result_reg, Immediate(1));
-    j(not_zero, minus_zero, dst);
-    bind(&done);
-  }
-}
-
-
-void MacroAssembler::AssertNotSmi(Register object) {
-  if (emit_debug_code()) {
-    Condition is_smi = CheckSmi(object);
-    Check(NegateCondition(is_smi), AbortReason::kOperandIsASmi);
-  }
-}
-
-
-void MacroAssembler::AssertSmi(Register object) {
-  if (emit_debug_code()) {
-    Condition is_smi = CheckSmi(object);
-    Check(is_smi, AbortReason::kOperandIsNotASmi);
-  }
-}
-
-
-void MacroAssembler::AssertSmi(const Operand& object) {
-  if (emit_debug_code()) {
-    Condition is_smi = CheckSmi(object);
-    Check(is_smi, AbortReason::kOperandIsNotASmi);
-  }
-}
-
-void MacroAssembler::AssertFixedArray(Register object) {
-  if (emit_debug_code()) {
-    testb(object, Immediate(kSmiTagMask));
-    Check(not_equal, AbortReason::kOperandIsASmiAndNotAFixedArray);
-    Push(object);
-    CmpObjectType(object, FIXED_ARRAY_TYPE, object);
-    Pop(object);
-    Check(equal, AbortReason::kOperandIsNotAFixedArray);
-  }
-}
-
-void TurboAssembler::AssertZeroExtended(Register int32_register) {
-  if (emit_debug_code()) {
-    DCHECK_NE(int32_register, kScratchRegister);
-    movq(kScratchRegister, int64_t{0x0000000100000000});
-    cmpq(kScratchRegister, int32_register);
-    Check(above_equal, AbortReason::k32BitValueInRegisterIsNotZeroExtended);
-  }
-}
-
-
-void MacroAssembler::AssertFunction(Register object) {
-  if (emit_debug_code()) {
-    testb(object, Immediate(kSmiTagMask));
-    Check(not_equal, AbortReason::kOperandIsASmiAndNotAFunction);
-    Push(object);
-    CmpObjectType(object, JS_FUNCTION_TYPE, object);
-    Pop(object);
-    Check(equal, AbortReason::kOperandIsNotAFunction);
-  }
-}
-
-
-void MacroAssembler::AssertBoundFunction(Register object) {
-  if (emit_debug_code()) {
-    testb(object, Immediate(kSmiTagMask));
-    Check(not_equal, AbortReason::kOperandIsASmiAndNotABoundFunction);
-    Push(object);
-    CmpObjectType(object, JS_BOUND_FUNCTION_TYPE, object);
-    Pop(object);
-    Check(equal, AbortReason::kOperandIsNotABoundFunction);
-  }
-}
-
-void MacroAssembler::AssertGeneratorObject(Register object) {
-  if (!emit_debug_code()) return;
-  testb(object, Immediate(kSmiTagMask));
-  Check(not_equal, AbortReason::kOperandIsASmiAndNotAGeneratorObject);
-
-  // Load map
-  Register map = object;
-  Push(object);
-  movp(map, FieldOperand(object, HeapObject::kMapOffset));
-
-  Label do_check;
-  // Check if JSGeneratorObject
-  CmpInstanceType(map, JS_GENERATOR_OBJECT_TYPE);
-  j(equal, &do_check);
-
-  // Check if JSAsyncGeneratorObject
-  CmpInstanceType(map, JS_ASYNC_GENERATOR_OBJECT_TYPE);
-
-  bind(&do_check);
-  // Restore generator object to register and perform assertion
-  Pop(object);
-  Check(equal, AbortReason::kOperandIsNotAGeneratorObject);
-}
-
-void MacroAssembler::AssertUndefinedOrAllocationSite(Register object) {
-  if (emit_debug_code()) {
-    Label done_checking;
-    AssertNotSmi(object);
-    Cmp(object, isolate()->factory()->undefined_value());
-    j(equal, &done_checking);
-    Cmp(FieldOperand(object, 0), isolate()->factory()->allocation_site_map());
-    Assert(equal, AbortReason::kExpectedUndefinedOrCell);
-    bind(&done_checking);
-  }
-}
-
-void MacroAssembler::IncrementCounter(StatsCounter* counter, int value) {
-  DCHECK_GT(value, 0);
-  if (FLAG_native_code_counters && counter->Enabled()) {
-    Operand counter_operand = ExternalOperand(ExternalReference(counter));
-    if (value == 1) {
-      incl(counter_operand);
-    } else {
-      addl(counter_operand, Immediate(value));
-    }
-  }
-}
-
-
-void MacroAssembler::DecrementCounter(StatsCounter* counter, int value) {
-  DCHECK_GT(value, 0);
-  if (FLAG_native_code_counters && counter->Enabled()) {
-    Operand counter_operand = ExternalOperand(ExternalReference(counter));
-    if (value == 1) {
-      decl(counter_operand);
-    } else {
-      subl(counter_operand, Immediate(value));
-    }
-  }
-}
-
-void MacroAssembler::MaybeDropFrames() {
-  // Check whether we need to drop frames to restart a function on the stack.
-  ExternalReference restart_fp =
-      ExternalReference::debug_restart_fp_address(isolate());
-  Load(rbx, restart_fp);
-  testp(rbx, rbx);
-  j(not_zero, BUILTIN_CODE(isolate(), FrameDropperTrampoline),
-    RelocInfo::CODE_TARGET);
-}
-
-void TurboAssembler::PrepareForTailCall(const ParameterCount& callee_args_count,
-                                        Register caller_args_count_reg,
-                                        Register scratch0, Register scratch1) {
-#if DEBUG
-  if (callee_args_count.is_reg()) {
-    DCHECK(!AreAliased(callee_args_count.reg(), caller_args_count_reg, scratch0,
-                       scratch1));
-  } else {
-    DCHECK(!AreAliased(caller_args_count_reg, scratch0, scratch1));
-  }
-#endif
-
-  // Calculate the destination address where we will put the return address
-  // after we drop current frame.
-  Register new_sp_reg = scratch0;
-  if (callee_args_count.is_reg()) {
-    subp(caller_args_count_reg, callee_args_count.reg());
-    leap(new_sp_reg, Operand(rbp, caller_args_count_reg, times_pointer_size,
-                             StandardFrameConstants::kCallerPCOffset));
-  } else {
-    leap(new_sp_reg, Operand(rbp, caller_args_count_reg, times_pointer_size,
-                             StandardFrameConstants::kCallerPCOffset -
-                                 callee_args_count.immediate() * kPointerSize));
-  }
-
-  if (FLAG_debug_code) {
-    cmpp(rsp, new_sp_reg);
-    Check(below, AbortReason::kStackAccessBelowStackPointer);
-  }
-
-  // Copy return address from caller's frame to current frame's return address
-  // to avoid its trashing and let the following loop copy it to the right
-  // place.
-  Register tmp_reg = scratch1;
-  movp(tmp_reg, Operand(rbp, StandardFrameConstants::kCallerPCOffset));
-  movp(Operand(rsp, 0), tmp_reg);
-
-  // Restore caller's frame pointer now as it could be overwritten by
-  // the copying loop.
-  movp(rbp, Operand(rbp, StandardFrameConstants::kCallerFPOffset));
-
-  // +2 here is to copy both receiver and return address.
-  Register count_reg = caller_args_count_reg;
-  if (callee_args_count.is_reg()) {
-    leap(count_reg, Operand(callee_args_count.reg(), 2));
-  } else {
-    movp(count_reg, Immediate(callee_args_count.immediate() + 2));
-    // TODO(ishell): Unroll copying loop for small immediate values.
-  }
-
-  // Now copy callee arguments to the caller frame going backwards to avoid
-  // callee arguments corruption (source and destination areas could overlap).
-  Label loop, entry;
-  jmp(&entry, Label::kNear);
-  bind(&loop);
-  decp(count_reg);
-  movp(tmp_reg, Operand(rsp, count_reg, times_pointer_size, 0));
-  movp(Operand(new_sp_reg, count_reg, times_pointer_size, 0), tmp_reg);
-  bind(&entry);
-  cmpp(count_reg, Immediate(0));
-  j(not_equal, &loop, Label::kNear);
-
-  // Leave current frame.
-  movp(rsp, new_sp_reg);
-}
-
-void MacroAssembler::InvokeFunction(Register function, Register new_target,
-                                    const ParameterCount& actual,
-                                    InvokeFlag flag) {
-  movp(rbx, FieldOperand(function, JSFunction::kSharedFunctionInfoOffset));
-  movsxlq(rbx,
-          FieldOperand(rbx, SharedFunctionInfo::kFormalParameterCountOffset));
-
-  ParameterCount expected(rbx);
-  InvokeFunction(function, new_target, expected, actual, flag);
-}
-
-void MacroAssembler::InvokeFunction(Register function, Register new_target,
-                                    const ParameterCount& expected,
-                                    const ParameterCount& actual,
-                                    InvokeFlag flag) {
-  DCHECK(function == rdi);
-  movp(rsi, FieldOperand(function, JSFunction::kContextOffset));
-  InvokeFunctionCode(rdi, new_target, expected, actual, flag);
-}
-
-void MacroAssembler::InvokeFunctionCode(Register function, Register new_target,
-                                        const ParameterCount& expected,
-                                        const ParameterCount& actual,
-                                        InvokeFlag flag) {
-  // You can't call a function without a valid frame.
-  DCHECK(flag == JUMP_FUNCTION || has_frame());
-  DCHECK(function == rdi);
-  DCHECK_IMPLIES(new_target.is_valid(), new_target == rdx);
-
-  // On function call, call into the debugger if necessary.
-  CheckDebugHook(function, new_target, expected, actual);
-
-  // Clear the new.target register if not given.
-  if (!new_target.is_valid()) {
-    LoadRoot(rdx, Heap::kUndefinedValueRootIndex);
-  }
-
-  Label done;
-  bool definitely_mismatches = false;
-  InvokePrologue(expected, actual, &done, &definitely_mismatches, flag,
-                 Label::kNear);
-  if (!definitely_mismatches) {
-    // We call indirectly through the code field in the function to
-    // allow recompilation to take effect without changing any of the
-    // call sites.
-    movp(rcx, FieldOperand(function, JSFunction::kCodeOffset));
-    addp(rcx, Immediate(Code::kHeaderSize - kHeapObjectTag));
-    if (flag == CALL_FUNCTION) {
-      call(rcx);
-    } else {
-      DCHECK(flag == JUMP_FUNCTION);
-      jmp(rcx);
-    }
-    bind(&done);
-  }
-}
-
-void MacroAssembler::InvokePrologue(const ParameterCount& expected,
-                                    const ParameterCount& actual, Label* done,
-                                    bool* definitely_mismatches,
-                                    InvokeFlag flag,
-                                    Label::Distance near_jump) {
-  bool definitely_matches = false;
-  *definitely_mismatches = false;
-  Label invoke;
-  if (expected.is_immediate()) {
-    DCHECK(actual.is_immediate());
-    Set(rax, actual.immediate());
-    if (expected.immediate() == actual.immediate()) {
-      definitely_matches = true;
-    } else {
-      if (expected.immediate() ==
-              SharedFunctionInfo::kDontAdaptArgumentsSentinel) {
-        // Don't worry about adapting arguments for built-ins that
-        // don't want that done. Skip adaption code by making it look
-        // like we have a match between expected and actual number of
-        // arguments.
-        definitely_matches = true;
-      } else {
-        *definitely_mismatches = true;
-        Set(rbx, expected.immediate());
-      }
-    }
-  } else {
-    if (actual.is_immediate()) {
-      // Expected is in register, actual is immediate. This is the
-      // case when we invoke function values without going through the
-      // IC mechanism.
-      Set(rax, actual.immediate());
-      cmpp(expected.reg(), Immediate(actual.immediate()));
-      j(equal, &invoke, Label::kNear);
-      DCHECK(expected.reg() == rbx);
-    } else if (expected.reg() != actual.reg()) {
-      // Both expected and actual are in (different) registers. This
-      // is the case when we invoke functions using call and apply.
-      cmpp(expected.reg(), actual.reg());
-      j(equal, &invoke, Label::kNear);
-      DCHECK(actual.reg() == rax);
-      DCHECK(expected.reg() == rbx);
-    } else {
-      definitely_matches = true;
-      Move(rax, actual.reg());
-    }
-  }
-
-  if (!definitely_matches) {
-    Handle<Code> adaptor = BUILTIN_CODE(isolate(), ArgumentsAdaptorTrampoline);
-    if (flag == CALL_FUNCTION) {
-      Call(adaptor, RelocInfo::CODE_TARGET);
-      if (!*definitely_mismatches) {
-        jmp(done, near_jump);
-      }
-    } else {
-      Jump(adaptor, RelocInfo::CODE_TARGET);
-    }
-    bind(&invoke);
-  }
-}
-
-void MacroAssembler::CheckDebugHook(Register fun, Register new_target,
-                                    const ParameterCount& expected,
-                                    const ParameterCount& actual) {
-  Label skip_hook;
-  ExternalReference debug_hook_active =
-      ExternalReference::debug_hook_on_function_call_address(isolate());
-  Operand debug_hook_active_operand = ExternalOperand(debug_hook_active);
-  cmpb(debug_hook_active_operand, Immediate(0));
-  j(equal, &skip_hook);
-  {
-    FrameScope frame(this,
-                     has_frame() ? StackFrame::NONE : StackFrame::INTERNAL);
-    if (expected.is_reg()) {
-      Integer32ToSmi(expected.reg(), expected.reg());
-      Push(expected.reg());
-    }
-    if (actual.is_reg()) {
-      Integer32ToSmi(actual.reg(), actual.reg());
-      Push(actual.reg());
-    }
-    if (new_target.is_valid()) {
-      Push(new_target);
-    }
-    Push(fun);
-    Push(fun);
-    CallRuntime(Runtime::kDebugOnFunctionCall);
-    Pop(fun);
-    if (new_target.is_valid()) {
-      Pop(new_target);
-    }
-    if (actual.is_reg()) {
-      Pop(actual.reg());
-      SmiToInteger64(actual.reg(), actual.reg());
-    }
-    if (expected.is_reg()) {
-      Pop(expected.reg());
-      SmiToInteger64(expected.reg(), expected.reg());
-    }
-  }
-  bind(&skip_hook);
-}
-
-void TurboAssembler::StubPrologue(StackFrame::Type type) {
-  pushq(rbp);  // Caller's frame pointer.
-  movp(rbp, rsp);
-  Push(Immediate(StackFrame::TypeToMarker(type)));
-}
-
-void TurboAssembler::Prologue() {
-  pushq(rbp);  // Caller's frame pointer.
-  movp(rbp, rsp);
-  Push(rsi);  // Callee's context.
-  Push(rdi);  // Callee's JS function.
-}
-
-void TurboAssembler::EnterFrame(StackFrame::Type type) {
-  pushq(rbp);
-  movp(rbp, rsp);
-  Push(Immediate(StackFrame::TypeToMarker(type)));
-  if (type == StackFrame::INTERNAL) {
-    Move(kScratchRegister, CodeObject(), RelocInfo::EMBEDDED_OBJECT);
-    Push(kScratchRegister);
-  }
-  if (emit_debug_code()) {
-    Move(kScratchRegister,
-         isolate()->factory()->undefined_value(),
-         RelocInfo::EMBEDDED_OBJECT);
-    cmpp(Operand(rsp, 0), kScratchRegister);
-    Check(not_equal, AbortReason::kCodeObjectNotProperlyPatched);
-  }
-}
-
-void TurboAssembler::LeaveFrame(StackFrame::Type type) {
-  if (emit_debug_code()) {
-    cmpp(Operand(rbp, CommonFrameConstants::kContextOrFrameTypeOffset),
-         Immediate(StackFrame::TypeToMarker(type)));
-    Check(equal, AbortReason::kStackFrameTypesMustMatch);
-  }
-  movp(rsp, rbp);
-  popq(rbp);
-}
-
-void MacroAssembler::EnterBuiltinFrame(Register context, Register target,
-                                       Register argc) {
-  Push(rbp);
-  Move(rbp, rsp);
-  Push(context);
-  Push(target);
-  Push(argc);
-}
-
-void MacroAssembler::LeaveBuiltinFrame(Register context, Register target,
-                                       Register argc) {
-  Pop(argc);
-  Pop(target);
-  Pop(context);
-  leave();
-}
-
-void MacroAssembler::EnterExitFramePrologue(bool save_rax,
-                                            StackFrame::Type frame_type) {
-  DCHECK(frame_type == StackFrame::EXIT ||
-         frame_type == StackFrame::BUILTIN_EXIT);
-
-  // Set up the frame structure on the stack.
-  // All constants are relative to the frame pointer of the exit frame.
-  DCHECK_EQ(kFPOnStackSize + kPCOnStackSize,
-            ExitFrameConstants::kCallerSPDisplacement);
-  DCHECK_EQ(kFPOnStackSize, ExitFrameConstants::kCallerPCOffset);
-  DCHECK_EQ(0 * kPointerSize, ExitFrameConstants::kCallerFPOffset);
-  pushq(rbp);
-  movp(rbp, rsp);
-
-  // Reserve room for entry stack pointer and push the code object.
-  Push(Immediate(StackFrame::TypeToMarker(frame_type)));
-  DCHECK_EQ(-2 * kPointerSize, ExitFrameConstants::kSPOffset);
-  Push(Immediate(0));  // Saved entry sp, patched before call.
-  Move(kScratchRegister, CodeObject(), RelocInfo::EMBEDDED_OBJECT);
-  Push(kScratchRegister);  // Accessed from ExitFrame::code_slot.
-
-  // Save the frame pointer and the context in top.
-  if (save_rax) {
-    movp(r14, rax);  // Backup rax in callee-save register.
-  }
-
-  Store(ExternalReference(IsolateAddressId::kCEntryFPAddress, isolate()), rbp);
-  Store(ExternalReference(IsolateAddressId::kContextAddress, isolate()), rsi);
-  Store(ExternalReference(IsolateAddressId::kCFunctionAddress, isolate()), rbx);
-}
-
-
-void MacroAssembler::EnterExitFrameEpilogue(int arg_stack_space,
-                                            bool save_doubles) {
-#ifdef _WIN64
-  const int kShadowSpace = 4;
-  arg_stack_space += kShadowSpace;
-#endif
-  // Optionally save all XMM registers.
-  if (save_doubles) {
-    int space = XMMRegister::kNumRegisters * kDoubleSize +
-                arg_stack_space * kRegisterSize;
-    subp(rsp, Immediate(space));
-    int offset = -ExitFrameConstants::kFixedFrameSizeFromFp;
-    const RegisterConfiguration* config = RegisterConfiguration::Default();
-    for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
-      DoubleRegister reg =
-          DoubleRegister::from_code(config->GetAllocatableDoubleCode(i));
-      Movsd(Operand(rbp, offset - ((i + 1) * kDoubleSize)), reg);
-    }
-  } else if (arg_stack_space > 0) {
-    subp(rsp, Immediate(arg_stack_space * kRegisterSize));
-  }
-
-  // Get the required frame alignment for the OS.
-  const int kFrameAlignment = base::OS::ActivationFrameAlignment();
-  if (kFrameAlignment > 0) {
-    DCHECK(base::bits::IsPowerOfTwo(kFrameAlignment));
-    DCHECK(is_int8(kFrameAlignment));
-    andp(rsp, Immediate(-kFrameAlignment));
-  }
-
-  // Patch the saved entry sp.
-  movp(Operand(rbp, ExitFrameConstants::kSPOffset), rsp);
-}
-
-void MacroAssembler::EnterExitFrame(int arg_stack_space, bool save_doubles,
-                                    StackFrame::Type frame_type) {
-  EnterExitFramePrologue(true, frame_type);
-
-  // Set up argv in callee-saved register r15. It is reused in LeaveExitFrame,
-  // so it must be retained across the C-call.
-  int offset = StandardFrameConstants::kCallerSPOffset - kPointerSize;
-  leap(r15, Operand(rbp, r14, times_pointer_size, offset));
-
-  EnterExitFrameEpilogue(arg_stack_space, save_doubles);
-}
-
-
-void MacroAssembler::EnterApiExitFrame(int arg_stack_space) {
-  EnterExitFramePrologue(false, StackFrame::EXIT);
-  EnterExitFrameEpilogue(arg_stack_space, false);
-}
-
-
-void MacroAssembler::LeaveExitFrame(bool save_doubles, bool pop_arguments) {
-  // Registers:
-  // r15 : argv
-  if (save_doubles) {
-    int offset = -ExitFrameConstants::kFixedFrameSizeFromFp;
-    const RegisterConfiguration* config = RegisterConfiguration::Default();
-    for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
-      DoubleRegister reg =
-          DoubleRegister::from_code(config->GetAllocatableDoubleCode(i));
-      Movsd(reg, Operand(rbp, offset - ((i + 1) * kDoubleSize)));
-    }
-  }
-
-  if (pop_arguments) {
-    // Get the return address from the stack and restore the frame pointer.
-    movp(rcx, Operand(rbp, kFPOnStackSize));
-    movp(rbp, Operand(rbp, 0 * kPointerSize));
-
-    // Drop everything up to and including the arguments and the receiver
-    // from the caller stack.
-    leap(rsp, Operand(r15, 1 * kPointerSize));
-
-    PushReturnAddressFrom(rcx);
-  } else {
-    // Otherwise just leave the exit frame.
-    leave();
-  }
-
-  LeaveExitFrameEpilogue();
-}
-
-void MacroAssembler::LeaveApiExitFrame() {
-  movp(rsp, rbp);
-  popq(rbp);
-
-  LeaveExitFrameEpilogue();
-}
-
-void MacroAssembler::LeaveExitFrameEpilogue() {
-  // Restore current context from top and clear it in debug mode.
-  ExternalReference context_address(IsolateAddressId::kContextAddress,
-                                    isolate());
-  Operand context_operand = ExternalOperand(context_address);
-  movp(rsi, context_operand);
-#ifdef DEBUG
-  movp(context_operand, Immediate(Context::kInvalidContext));
-#endif
-
-  // Clear the top frame.
-  ExternalReference c_entry_fp_address(IsolateAddressId::kCEntryFPAddress,
-                                       isolate());
-  Operand c_entry_fp_operand = ExternalOperand(c_entry_fp_address);
-  movp(c_entry_fp_operand, Immediate(0));
-}
-
-
-#ifdef _WIN64
-static const int kRegisterPassedArguments = 4;
-#else
-static const int kRegisterPassedArguments = 6;
-#endif
-
-
-void MacroAssembler::LoadNativeContextSlot(int index, Register dst) {
-  movp(dst, NativeContextOperand());
-  movp(dst, ContextOperand(dst, index));
-}
-
-
-int TurboAssembler::ArgumentStackSlotsForCFunctionCall(int num_arguments) {
-  // On Windows 64 stack slots are reserved by the caller for all arguments
-  // including the ones passed in registers, and space is always allocated for
-  // the four register arguments even if the function takes fewer than four
-  // arguments.
-  // On AMD64 ABI (Linux/Mac) the first six arguments are passed in registers
-  // and the caller does not reserve stack slots for them.
-  DCHECK_GE(num_arguments, 0);
-#ifdef _WIN64
-  const int kMinimumStackSlots = kRegisterPassedArguments;
-  if (num_arguments < kMinimumStackSlots) return kMinimumStackSlots;
-  return num_arguments;
-#else
-  if (num_arguments < kRegisterPassedArguments) return 0;
-  return num_arguments - kRegisterPassedArguments;
-#endif
-}
-
-void TurboAssembler::PrepareCallCFunction(int num_arguments) {
-  int frame_alignment = base::OS::ActivationFrameAlignment();
-  DCHECK_NE(frame_alignment, 0);
-  DCHECK_GE(num_arguments, 0);
-
-  // Make stack end at alignment and allocate space for arguments and old rsp.
-  movp(kScratchRegister, rsp);
-  DCHECK(base::bits::IsPowerOfTwo(frame_alignment));
-  int argument_slots_on_stack =
-      ArgumentStackSlotsForCFunctionCall(num_arguments);
-  subp(rsp, Immediate((argument_slots_on_stack + 1) * kRegisterSize));
-  andp(rsp, Immediate(-frame_alignment));
-  movp(Operand(rsp, argument_slots_on_stack * kRegisterSize), kScratchRegister);
-}
-
-void TurboAssembler::CallCFunction(ExternalReference function,
-                                   int num_arguments) {
-  LoadAddress(rax, function);
-  CallCFunction(rax, num_arguments);
-}
-
-void TurboAssembler::CallCFunction(Register function, int num_arguments) {
-  DCHECK_LE(num_arguments, kMaxCParameters);
-  DCHECK(has_frame());
-  // Check stack alignment.
-  if (emit_debug_code()) {
-    CheckStackAlignment();
-  }
-
-  call(function);
-  DCHECK_NE(base::OS::ActivationFrameAlignment(), 0);
-  DCHECK_GE(num_arguments, 0);
-  int argument_slots_on_stack =
-      ArgumentStackSlotsForCFunctionCall(num_arguments);
-  movp(rsp, Operand(rsp, argument_slots_on_stack * kRegisterSize));
-}
-
-
-#ifdef DEBUG
-bool AreAliased(Register reg1,
-                Register reg2,
-                Register reg3,
-                Register reg4,
-                Register reg5,
-                Register reg6,
-                Register reg7,
-                Register reg8) {
-  int n_of_valid_regs = reg1.is_valid() + reg2.is_valid() +
-      reg3.is_valid() + reg4.is_valid() + reg5.is_valid() + reg6.is_valid() +
-      reg7.is_valid() + reg8.is_valid();
-
-  RegList regs = 0;
-  if (reg1.is_valid()) regs |= reg1.bit();
-  if (reg2.is_valid()) regs |= reg2.bit();
-  if (reg3.is_valid()) regs |= reg3.bit();
-  if (reg4.is_valid()) regs |= reg4.bit();
-  if (reg5.is_valid()) regs |= reg5.bit();
-  if (reg6.is_valid()) regs |= reg6.bit();
-  if (reg7.is_valid()) regs |= reg7.bit();
-  if (reg8.is_valid()) regs |= reg8.bit();
-  int n_of_non_aliasing_regs = NumRegs(regs);
-
-  return n_of_valid_regs != n_of_non_aliasing_regs;
-}
-#endif
-
-void TurboAssembler::CheckPageFlag(Register object, Register scratch, int mask,
-                                   Condition cc, Label* condition_met,
-                                   Label::Distance condition_met_distance) {
-  DCHECK(cc == zero || cc == not_zero);
-  if (scratch == object) {
-    andp(scratch, Immediate(~Page::kPageAlignmentMask));
-  } else {
-    movp(scratch, Immediate(~Page::kPageAlignmentMask));
-    andp(scratch, object);
-  }
-  if (mask < (1 << kBitsPerByte)) {
-    testb(Operand(scratch, MemoryChunk::kFlagsOffset),
-          Immediate(static_cast<uint8_t>(mask)));
-  } else {
-    testl(Operand(scratch, MemoryChunk::kFlagsOffset), Immediate(mask));
-  }
-  j(cc, condition_met, condition_met_distance);
-}
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_TARGET_ARCH_X64
diff --git a/src/v8/src/x64/macro-assembler-x64.h b/src/v8/src/x64/macro-assembler-x64.h
deleted file mode 100644
index 4ceab2c..0000000
--- a/src/v8/src/x64/macro-assembler-x64.h
+++ /dev/null
@@ -1,1010 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_X64_MACRO_ASSEMBLER_X64_H_
-#define V8_X64_MACRO_ASSEMBLER_X64_H_
-
-#include "src/bailout-reason.h"
-#include "src/base/flags.h"
-#include "src/globals.h"
-#include "src/x64/assembler-x64.h"
-
-namespace v8 {
-namespace internal {
-
-// Give alias names to registers for calling conventions.
-constexpr Register kReturnRegister0 = rax;
-constexpr Register kReturnRegister1 = rdx;
-constexpr Register kReturnRegister2 = r8;
-constexpr Register kJSFunctionRegister = rdi;
-constexpr Register kContextRegister = rsi;
-constexpr Register kAllocateSizeRegister = rdx;
-constexpr Register kInterpreterAccumulatorRegister = rax;
-constexpr Register kInterpreterBytecodeOffsetRegister = r12;
-constexpr Register kInterpreterBytecodeArrayRegister = r14;
-constexpr Register kInterpreterDispatchTableRegister = r15;
-constexpr Register kJavaScriptCallArgCountRegister = rax;
-constexpr Register kJavaScriptCallNewTargetRegister = rdx;
-constexpr Register kRuntimeCallFunctionRegister = rbx;
-constexpr Register kRuntimeCallArgCountRegister = rax;
-
-// Default scratch register used by MacroAssembler (and other code that needs
-// a spare register). The register isn't callee save, and not used by the
-// function calling convention.
-constexpr Register kScratchRegister = r10;
-constexpr XMMRegister kScratchDoubleReg = xmm15;
-constexpr Register kRootRegister = r13;  // callee save
-// Actual value of root register is offset from the root array's start
-// to take advantage of negitive 8-bit displacement values.
-constexpr int kRootRegisterBias = 128;
-
-// Convenience for platform-independent signatures.
-typedef Operand MemOperand;
-
-enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET };
-enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK };
-
-#ifdef DEBUG
-bool AreAliased(Register reg1,
-                Register reg2,
-                Register reg3 = no_reg,
-                Register reg4 = no_reg,
-                Register reg5 = no_reg,
-                Register reg6 = no_reg,
-                Register reg7 = no_reg,
-                Register reg8 = no_reg);
-#endif
-
-// Forward declaration.
-class JumpTarget;
-
-struct SmiIndex {
-  SmiIndex(Register index_register, ScaleFactor scale)
-      : reg(index_register),
-        scale(scale) {}
-  Register reg;
-  ScaleFactor scale;
-};
-
-enum StackArgumentsAccessorReceiverMode {
-  ARGUMENTS_CONTAIN_RECEIVER,
-  ARGUMENTS_DONT_CONTAIN_RECEIVER
-};
-
-class StackArgumentsAccessor BASE_EMBEDDED {
- public:
-  StackArgumentsAccessor(Register base_reg, int argument_count_immediate,
-                         StackArgumentsAccessorReceiverMode receiver_mode =
-                             ARGUMENTS_CONTAIN_RECEIVER,
-                         int extra_displacement_to_last_argument = 0)
-      : base_reg_(base_reg),
-        argument_count_reg_(no_reg),
-        argument_count_immediate_(argument_count_immediate),
-        receiver_mode_(receiver_mode),
-        extra_displacement_to_last_argument_(
-            extra_displacement_to_last_argument) {}
-
-  StackArgumentsAccessor(Register base_reg, Register argument_count_reg,
-                         StackArgumentsAccessorReceiverMode receiver_mode =
-                             ARGUMENTS_CONTAIN_RECEIVER,
-                         int extra_displacement_to_last_argument = 0)
-      : base_reg_(base_reg),
-        argument_count_reg_(argument_count_reg),
-        argument_count_immediate_(0),
-        receiver_mode_(receiver_mode),
-        extra_displacement_to_last_argument_(
-            extra_displacement_to_last_argument) {}
-
-  StackArgumentsAccessor(Register base_reg,
-                         const ParameterCount& parameter_count,
-                         StackArgumentsAccessorReceiverMode receiver_mode =
-                             ARGUMENTS_CONTAIN_RECEIVER,
-                         int extra_displacement_to_last_argument = 0);
-
-  Operand GetArgumentOperand(int index);
-  Operand GetReceiverOperand() {
-    DCHECK(receiver_mode_ == ARGUMENTS_CONTAIN_RECEIVER);
-    return GetArgumentOperand(0);
-  }
-
- private:
-  const Register base_reg_;
-  const Register argument_count_reg_;
-  const int argument_count_immediate_;
-  const StackArgumentsAccessorReceiverMode receiver_mode_;
-  const int extra_displacement_to_last_argument_;
-
-  DISALLOW_IMPLICIT_CONSTRUCTORS(StackArgumentsAccessor);
-};
-
-class TurboAssembler : public Assembler {
- public:
-  TurboAssembler(Isolate* isolate, void* buffer, int buffer_size,
-                 CodeObjectRequired create_code_object);
-
-  void set_has_frame(bool value) { has_frame_ = value; }
-  bool has_frame() const { return has_frame_; }
-
-  Isolate* isolate() const { return isolate_; }
-
-  Handle<HeapObject> CodeObject() {
-    DCHECK(!code_object_.is_null());
-    return code_object_;
-  }
-
-#define AVX_OP2_WITH_TYPE(macro_name, name, src_type) \
-  void macro_name(XMMRegister dst, src_type src) {    \
-    if (CpuFeatures::IsSupported(AVX)) {              \
-      CpuFeatureScope scope(this, AVX);               \
-      v##name(dst, dst, src);                         \
-    } else {                                          \
-      name(dst, src);                                 \
-    }                                                 \
-  }
-#define AVX_OP2_X(macro_name, name) \
-  AVX_OP2_WITH_TYPE(macro_name, name, XMMRegister)
-#define AVX_OP2_O(macro_name, name) \
-  AVX_OP2_WITH_TYPE(macro_name, name, const Operand&)
-#define AVX_OP2_XO(macro_name, name) \
-  AVX_OP2_X(macro_name, name)        \
-  AVX_OP2_O(macro_name, name)
-
-  AVX_OP2_XO(Subsd, subsd)
-  AVX_OP2_XO(Divss, divss)
-  AVX_OP2_XO(Divsd, divsd)
-  AVX_OP2_XO(Xorpd, xorpd)
-  AVX_OP2_X(Pcmpeqd, pcmpeqd)
-  AVX_OP2_WITH_TYPE(Psllq, psllq, byte)
-  AVX_OP2_WITH_TYPE(Psrlq, psrlq, byte)
-
-#undef AVX_OP2_O
-#undef AVX_OP2_X
-#undef AVX_OP2_XO
-#undef AVX_OP2_WITH_TYPE
-
-  void Xorps(XMMRegister dst, XMMRegister src);
-  void Xorps(XMMRegister dst, const Operand& src);
-
-  void Movd(XMMRegister dst, Register src);
-  void Movd(XMMRegister dst, const Operand& src);
-  void Movd(Register dst, XMMRegister src);
-  void Movq(XMMRegister dst, Register src);
-  void Movq(Register dst, XMMRegister src);
-
-  void Movsd(XMMRegister dst, XMMRegister src);
-  void Movsd(XMMRegister dst, const Operand& src);
-  void Movsd(const Operand& dst, XMMRegister src);
-  void Movss(XMMRegister dst, XMMRegister src);
-  void Movss(XMMRegister dst, const Operand& src);
-  void Movss(const Operand& dst, XMMRegister src);
-
-  void PushReturnAddressFrom(Register src) { pushq(src); }
-  void PopReturnAddressTo(Register dst) { popq(dst); }
-
-  void Ret();
-
-  // Return and drop arguments from stack, where the number of arguments
-  // may be bigger than 2^16 - 1.  Requires a scratch register.
-  void Ret(int bytes_dropped, Register scratch);
-
-  // Load a register with a long value as efficiently as possible.
-  void Set(Register dst, int64_t x);
-  void Set(const Operand& dst, intptr_t x);
-
-  // Operations on roots in the root-array.
-  void LoadRoot(Register destination, Heap::RootListIndex index);
-  void LoadRoot(const Operand& destination, Heap::RootListIndex index) {
-    LoadRoot(kScratchRegister, index);
-    movp(destination, kScratchRegister);
-  }
-
-  void Movups(XMMRegister dst, XMMRegister src);
-  void Movups(XMMRegister dst, const Operand& src);
-  void Movups(const Operand& dst, XMMRegister src);
-  void Movapd(XMMRegister dst, XMMRegister src);
-  void Movaps(XMMRegister dst, XMMRegister src);
-  void Movmskpd(Register dst, XMMRegister src);
-  void Movmskps(Register dst, XMMRegister src);
-
-  void Push(Register src);
-  void Push(const Operand& src);
-  void Push(Immediate value);
-  void Push(Smi* smi);
-  void Push(Handle<HeapObject> source);
-
-  // Before calling a C-function from generated code, align arguments on stack.
-  // After aligning the frame, arguments must be stored in rsp[0], rsp[8],
-  // etc., not pushed. The argument count assumes all arguments are word sized.
-  // The number of slots reserved for arguments depends on platform. On Windows
-  // stack slots are reserved for the arguments passed in registers. On other
-  // platforms stack slots are only reserved for the arguments actually passed
-  // on the stack.
-  void PrepareCallCFunction(int num_arguments);
-
-  // Calls a C function and cleans up the space for arguments allocated
-  // by PrepareCallCFunction. The called function is not allowed to trigger a
-  // garbage collection, since that might move the code and invalidate the
-  // return address (unless this is somehow accounted for by the called
-  // function).
-  void CallCFunction(ExternalReference function, int num_arguments);
-  void CallCFunction(Register function, int num_arguments);
-
-  // Calculate the number of stack slots to reserve for arguments when calling a
-  // C function.
-  int ArgumentStackSlotsForCFunctionCall(int num_arguments);
-
-  void CheckPageFlag(Register object, Register scratch, int mask, Condition cc,
-                     Label* condition_met,
-                     Label::Distance condition_met_distance = Label::kFar);
-
-  void Cvtss2sd(XMMRegister dst, XMMRegister src);
-  void Cvtss2sd(XMMRegister dst, const Operand& src);
-  void Cvtsd2ss(XMMRegister dst, XMMRegister src);
-  void Cvtsd2ss(XMMRegister dst, const Operand& src);
-  void Cvttsd2si(Register dst, XMMRegister src);
-  void Cvttsd2si(Register dst, const Operand& src);
-  void Cvttsd2siq(Register dst, XMMRegister src);
-  void Cvttsd2siq(Register dst, const Operand& src);
-  void Cvttss2si(Register dst, XMMRegister src);
-  void Cvttss2si(Register dst, const Operand& src);
-  void Cvttss2siq(Register dst, XMMRegister src);
-  void Cvttss2siq(Register dst, const Operand& src);
-  void Cvtqsi2ss(XMMRegister dst, Register src);
-  void Cvtqsi2ss(XMMRegister dst, const Operand& src);
-  void Cvtqsi2sd(XMMRegister dst, Register src);
-  void Cvtqsi2sd(XMMRegister dst, const Operand& src);
-  void Cvtlsi2ss(XMMRegister dst, Register src);
-  void Cvtlsi2ss(XMMRegister dst, const Operand& src);
-  void Cvtqui2ss(XMMRegister dst, Register src, Register tmp);
-  void Cvtqui2sd(XMMRegister dst, Register src, Register tmp);
-
-  // cvtsi2sd instruction only writes to the low 64-bit of dst register, which
-  // hinders register renaming and makes dependence chains longer. So we use
-  // xorpd to clear the dst register before cvtsi2sd to solve this issue.
-  void Cvtlsi2sd(XMMRegister dst, Register src);
-  void Cvtlsi2sd(XMMRegister dst, const Operand& src);
-
-  void Roundss(XMMRegister dst, XMMRegister src, RoundingMode mode);
-  void Roundsd(XMMRegister dst, XMMRegister src, RoundingMode mode);
-
-  void Sqrtsd(XMMRegister dst, XMMRegister src);
-  void Sqrtsd(XMMRegister dst, const Operand& src);
-
-  void Ucomiss(XMMRegister src1, XMMRegister src2);
-  void Ucomiss(XMMRegister src1, const Operand& src2);
-  void Ucomisd(XMMRegister src1, XMMRegister src2);
-  void Ucomisd(XMMRegister src1, const Operand& src2);
-
-  void Lzcntq(Register dst, Register src);
-  void Lzcntq(Register dst, const Operand& src);
-  void Lzcntl(Register dst, Register src);
-  void Lzcntl(Register dst, const Operand& src);
-  void Tzcntq(Register dst, Register src);
-  void Tzcntq(Register dst, const Operand& src);
-  void Tzcntl(Register dst, Register src);
-  void Tzcntl(Register dst, const Operand& src);
-  void Popcntl(Register dst, Register src);
-  void Popcntl(Register dst, const Operand& src);
-  void Popcntq(Register dst, Register src);
-  void Popcntq(Register dst, const Operand& src);
-
-  // Is the value a tagged smi.
-  Condition CheckSmi(Register src);
-  Condition CheckSmi(const Operand& src);
-
-  // Jump to label if the value is a tagged smi.
-  void JumpIfSmi(Register src, Label* on_smi,
-                 Label::Distance near_jump = Label::kFar);
-
-  void Move(Register dst, Smi* source);
-
-  void Move(const Operand& dst, Smi* source) {
-    Register constant = GetSmiConstant(source);
-    movp(dst, constant);
-  }
-
-  void Move(Register dst, ExternalReference ext) {
-    movp(dst, reinterpret_cast<void*>(ext.address()),
-         RelocInfo::EXTERNAL_REFERENCE);
-  }
-
-  void Move(XMMRegister dst, uint32_t src);
-  void Move(XMMRegister dst, uint64_t src);
-  void Move(XMMRegister dst, float src) { Move(dst, bit_cast<uint32_t>(src)); }
-  void Move(XMMRegister dst, double src) { Move(dst, bit_cast<uint64_t>(src)); }
-
-  // Move if the registers are not identical.
-  void Move(Register target, Register source);
-
-  void Move(Register dst, Handle<HeapObject> source,
-            RelocInfo::Mode rmode = RelocInfo::EMBEDDED_OBJECT);
-  void Move(const Operand& dst, Handle<HeapObject> source,
-            RelocInfo::Mode rmode = RelocInfo::EMBEDDED_OBJECT);
-
-  // Loads a pointer into a register with a relocation mode.
-  void Move(Register dst, void* ptr, RelocInfo::Mode rmode) {
-    // This method must not be used with heap object references. The stored
-    // address is not GC safe. Use the handle version instead.
-    DCHECK(rmode > RelocInfo::LAST_GCED_ENUM);
-    movp(dst, ptr, rmode);
-  }
-
-  // Convert smi to 32-bit integer. I.e., not sign extended into
-  // high 32 bits of destination.
-  void SmiToInteger32(Register dst, Register src);
-  void SmiToInteger32(Register dst, const Operand& src);
-
-  // Loads the address of the external reference into the destination
-  // register.
-  void LoadAddress(Register destination, ExternalReference source);
-
-  void Call(const Operand& op);
-  void Call(Handle<Code> code_object, RelocInfo::Mode rmode);
-  void Call(Address destination, RelocInfo::Mode rmode);
-  void Call(ExternalReference ext);
-  void Call(Label* target) { call(target); }
-
-  void RetpolineCall(Register reg);
-  void RetpolineCall(Address destination, RelocInfo::Mode rmode);
-
-  void RetpolineJump(Register reg);
-
-  void CallForDeoptimization(Address target, RelocInfo::Mode rmode) {
-    call(target, rmode);
-  }
-
-  // The size of the code generated for different call instructions.
-  int CallSize(ExternalReference ext);
-  int CallSize(Address destination) { return kCallSequenceLength; }
-  int CallSize(Handle<Code> code_object) {
-    // Code calls use 32-bit relative addressing.
-    return kShortCallInstructionLength;
-  }
-  int CallSize(Register target) {
-    // Opcode: REX_opt FF /2 m64
-    return (target.high_bit() != 0) ? 3 : 2;
-  }
-  int CallSize(const Operand& target) {
-    // Opcode: REX_opt FF /2 m64
-    return (target.requires_rex() ? 2 : 1) + target.operand_size();
-  }
-
-  // Returns the size of the code generated by LoadAddress.
-  // Used by CallSize(ExternalReference) to find the size of a call.
-  int LoadAddressSize(ExternalReference source);
-
-  // Non-SSE2 instructions.
-  void Pextrd(Register dst, XMMRegister src, int8_t imm8);
-  void Pinsrd(XMMRegister dst, Register src, int8_t imm8);
-  void Pinsrd(XMMRegister dst, const Operand& src, int8_t imm8);
-
-  void CompareRoot(Register with, Heap::RootListIndex index);
-  void CompareRoot(const Operand& with, Heap::RootListIndex index);
-
-  // Generates function and stub prologue code.
-  void StubPrologue(StackFrame::Type type);
-  void Prologue();
-
-  // Calls Abort(msg) if the condition cc is not satisfied.
-  // Use --debug_code to enable.
-  void Assert(Condition cc, AbortReason reason);
-
-  // Like Assert(), but without condition.
-  // Use --debug_code to enable.
-  void AssertUnreachable(AbortReason reason);
-
-  // Abort execution if a 64 bit register containing a 32 bit payload does not
-  // have zeros in the top 32 bits, enabled via --debug-code.
-  void AssertZeroExtended(Register reg);
-
-  // Like Assert(), but always enabled.
-  void Check(Condition cc, AbortReason reason);
-
-  // Print a message to stdout and abort execution.
-  void Abort(AbortReason msg);
-
-  // Check that the stack is aligned.
-  void CheckStackAlignment();
-
-  // Activation support.
-  void EnterFrame(StackFrame::Type type);
-  void EnterFrame(StackFrame::Type type, bool load_constant_pool_pointer_reg) {
-    // Out-of-line constant pool not implemented on x64.
-    UNREACHABLE();
-  }
-  void LeaveFrame(StackFrame::Type type);
-
-  // Removes current frame and its arguments from the stack preserving the
-  // arguments and a return address pushed to the stack for the next call.  Both
-  // |callee_args_count| and |caller_args_count_reg| do not include receiver.
-  // |callee_args_count| is not modified, |caller_args_count_reg| is trashed.
-  void PrepareForTailCall(const ParameterCount& callee_args_count,
-                          Register caller_args_count_reg, Register scratch0,
-                          Register scratch1);
-
-  inline bool AllowThisStubCall(CodeStub* stub);
-
-  // Call a code stub. This expects {stub} to be zone-allocated, as it does not
-  // trigger generation of the stub's code object but instead files a
-  // HeapObjectRequest that will be fulfilled after code assembly.
-  void CallStubDelayed(CodeStub* stub);
-
-  void SlowTruncateToIDelayed(Zone* zone, Register result_reg);
-
-  // Call a runtime routine.
-  void CallRuntimeDelayed(Zone* zone, Runtime::FunctionId fid,
-                          SaveFPRegsMode save_doubles = kDontSaveFPRegs);
-
-  void InitializeRootRegister() {
-    ExternalReference roots_array_start =
-        ExternalReference::roots_array_start(isolate());
-    Move(kRootRegister, roots_array_start);
-    addp(kRootRegister, Immediate(kRootRegisterBias));
-  }
-
-  void SaveRegisters(RegList registers);
-  void RestoreRegisters(RegList registers);
-
-  void CallRecordWriteStub(Register object, Register address,
-                           RememberedSetAction remembered_set_action,
-                           SaveFPRegsMode fp_mode);
-
-  void MoveNumber(Register dst, double value);
-  void MoveNonSmi(Register dst, double value);
-
-  // Calculate how much stack space (in bytes) are required to store caller
-  // registers excluding those specified in the arguments.
-  int RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode,
-                                      Register exclusion1 = no_reg,
-                                      Register exclusion2 = no_reg,
-                                      Register exclusion3 = no_reg) const;
-
-  // PushCallerSaved and PopCallerSaved do not arrange the registers in any
-  // particular order so they are not useful for calls that can cause a GC.
-  // The caller can exclude up to 3 registers that do not need to be saved and
-  // restored.
-
-  // Push caller saved registers on the stack, and return the number of bytes
-  // stack pointer is adjusted.
-  int PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1 = no_reg,
-                      Register exclusion2 = no_reg,
-                      Register exclusion3 = no_reg);
-  // Restore caller saved registers from the stack, and return the number of
-  // bytes stack pointer is adjusted.
-  int PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1 = no_reg,
-                     Register exclusion2 = no_reg,
-                     Register exclusion3 = no_reg);
-
- protected:
-  static const int kSmiShift = kSmiTagSize + kSmiShiftSize;
-  int smi_count = 0;
-  int heap_object_count = 0;
-
-  bool root_array_available_ = true;
-
-  int64_t RootRegisterDelta(ExternalReference other);
-
-  // Returns a register holding the smi value. The register MUST NOT be
-  // modified. It may be the "smi 1 constant" register.
-  Register GetSmiConstant(Smi* value);
-
- private:
-  bool has_frame_ = false;
-  // This handle will be patched with the code object on installation.
-  Handle<HeapObject> code_object_;
-  Isolate* const isolate_;
-};
-
-// MacroAssembler implements a collection of frequently used macros.
-class MacroAssembler : public TurboAssembler {
- public:
-  MacroAssembler(Isolate* isolate, void* buffer, int size,
-                 CodeObjectRequired create_code_object);
-
-  // Prevent the use of the RootArray during the lifetime of this
-  // scope object.
-  class NoRootArrayScope BASE_EMBEDDED {
-   public:
-    explicit NoRootArrayScope(MacroAssembler* assembler)
-        : variable_(&assembler->root_array_available_),
-          old_value_(assembler->root_array_available_) {
-      assembler->root_array_available_ = false;
-    }
-    ~NoRootArrayScope() {
-      *variable_ = old_value_;
-    }
-   private:
-    bool* variable_;
-    bool old_value_;
-  };
-
-  // Operand pointing to an external reference.
-  // May emit code to set up the scratch register. The operand is
-  // only guaranteed to be correct as long as the scratch register
-  // isn't changed.
-  // If the operand is used more than once, use a scratch register
-  // that is guaranteed not to be clobbered.
-  Operand ExternalOperand(ExternalReference reference,
-                          Register scratch = kScratchRegister);
-  // Loads and stores the value of an external reference.
-  // Special case code for load and store to take advantage of
-  // load_rax/store_rax if possible/necessary.
-  // For other operations, just use:
-  //   Operand operand = ExternalOperand(extref);
-  //   operation(operand, ..);
-  void Load(Register destination, ExternalReference source);
-  void Store(ExternalReference destination, Register source);
-
-  // Pushes the address of the external reference onto the stack.
-  void PushAddress(ExternalReference source);
-
-  // Operations on roots in the root-array.
-  // Load a root value where the index (or part of it) is variable.
-  // The variable_offset register is added to the fixed_offset value
-  // to get the index into the root-array.
-  void PushRoot(Heap::RootListIndex index);
-
-  // Compare the object in a register to a value and jump if they are equal.
-  void JumpIfRoot(Register with, Heap::RootListIndex index, Label* if_equal,
-                  Label::Distance if_equal_distance = Label::kFar) {
-    CompareRoot(with, index);
-    j(equal, if_equal, if_equal_distance);
-  }
-  void JumpIfRoot(const Operand& with, Heap::RootListIndex index,
-                  Label* if_equal,
-                  Label::Distance if_equal_distance = Label::kFar) {
-    CompareRoot(with, index);
-    j(equal, if_equal, if_equal_distance);
-  }
-
-  // Compare the object in a register to a value and jump if they are not equal.
-  void JumpIfNotRoot(Register with, Heap::RootListIndex index,
-                     Label* if_not_equal,
-                     Label::Distance if_not_equal_distance = Label::kFar) {
-    CompareRoot(with, index);
-    j(not_equal, if_not_equal, if_not_equal_distance);
-  }
-  void JumpIfNotRoot(const Operand& with, Heap::RootListIndex index,
-                     Label* if_not_equal,
-                     Label::Distance if_not_equal_distance = Label::kFar) {
-    CompareRoot(with, index);
-    j(not_equal, if_not_equal, if_not_equal_distance);
-  }
-
-
-// ---------------------------------------------------------------------------
-// GC Support
-
-  // Notify the garbage collector that we wrote a pointer into an object.
-  // |object| is the object being stored into, |value| is the object being
-  // stored.  value and scratch registers are clobbered by the operation.
-  // The offset is the offset from the start of the object, not the offset from
-  // the tagged HeapObject pointer.  For use with FieldOperand(reg, off).
-  void RecordWriteField(
-      Register object, int offset, Register value, Register scratch,
-      SaveFPRegsMode save_fp,
-      RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
-      SmiCheck smi_check = INLINE_SMI_CHECK);
-
-  // For page containing |object| mark region covering |address|
-  // dirty. |object| is the object being stored into, |value| is the
-  // object being stored. The address and value registers are clobbered by the
-  // operation.  RecordWrite filters out smis so it does not update
-  // the write barrier if the value is a smi.
-  void RecordWrite(
-      Register object, Register address, Register value, SaveFPRegsMode save_fp,
-      RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
-      SmiCheck smi_check = INLINE_SMI_CHECK);
-
-  // Frame restart support.
-  void MaybeDropFrames();
-
-  // Enter specific kind of exit frame; either in normal or
-  // debug mode. Expects the number of arguments in register rax and
-  // sets up the number of arguments in register rdi and the pointer
-  // to the first argument in register rsi.
-  //
-  // Allocates arg_stack_space * kPointerSize memory (not GCed) on the stack
-  // accessible via StackSpaceOperand.
-  void EnterExitFrame(int arg_stack_space = 0, bool save_doubles = false,
-                      StackFrame::Type frame_type = StackFrame::EXIT);
-
-  // Enter specific kind of exit frame. Allocates arg_stack_space * kPointerSize
-  // memory (not GCed) on the stack accessible via StackSpaceOperand.
-  void EnterApiExitFrame(int arg_stack_space);
-
-  // Leave the current exit frame. Expects/provides the return value in
-  // register rax:rdx (untouched) and the pointer to the first
-  // argument in register rsi (if pop_arguments == true).
-  void LeaveExitFrame(bool save_doubles = false, bool pop_arguments = true);
-
-  // Leave the current exit frame. Expects/provides the return value in
-  // register rax (untouched).
-  void LeaveApiExitFrame();
-
-  // Push and pop the registers that can hold pointers.
-  void PushSafepointRegisters() { Pushad(); }
-  void PopSafepointRegisters() { Popad(); }
-
-  // ---------------------------------------------------------------------------
-  // JavaScript invokes
-
-  // Invoke the JavaScript function code by either calling or jumping.
-  void InvokeFunctionCode(Register function, Register new_target,
-                          const ParameterCount& expected,
-                          const ParameterCount& actual, InvokeFlag flag);
-
-  // On function call, call into the debugger if necessary.
-  void CheckDebugHook(Register fun, Register new_target,
-                      const ParameterCount& expected,
-                      const ParameterCount& actual);
-
-  // Invoke the JavaScript function in the given register. Changes the
-  // current context to the context in the function before invoking.
-  void InvokeFunction(Register function, Register new_target,
-                      const ParameterCount& actual, InvokeFlag flag);
-
-  void InvokeFunction(Register function, Register new_target,
-                      const ParameterCount& expected,
-                      const ParameterCount& actual, InvokeFlag flag);
-
-  void InvokeFunction(Handle<JSFunction> function,
-                      const ParameterCount& expected,
-                      const ParameterCount& actual, InvokeFlag flag);
-
-  // ---------------------------------------------------------------------------
-  // Conversions between tagged smi values and non-tagged integer values.
-
-  // Tag an integer value. The result must be known to be a valid smi value.
-  // Only uses the low 32 bits of the src register. Sets the N and Z flags
-  // based on the value of the resulting smi.
-  void Integer32ToSmi(Register dst, Register src);
-
-  // Convert smi to 64-bit integer (sign extended if necessary).
-  void SmiToInteger64(Register dst, Register src);
-
-  // Simple comparison of smis.  Both sides must be known smis to use these,
-  // otherwise use Cmp.
-  void SmiCompare(Register smi1, Register smi2);
-  void SmiCompare(Register dst, Smi* src);
-  void SmiCompare(Register dst, const Operand& src);
-  void SmiCompare(const Operand& dst, Register src);
-  void SmiCompare(const Operand& dst, Smi* src);
-
-  // Functions performing a check on a known or potential smi. Returns
-  // a condition that is satisfied if the check is successful.
-
-  // Test-and-jump functions. Typically combines a check function
-  // above with a conditional jump.
-
-  // Jump to label if the value is not a tagged smi.
-  void JumpIfNotSmi(Register src,
-                    Label* on_not_smi,
-                    Label::Distance near_jump = Label::kFar);
-
-  // Jump to label if the value is not a tagged smi.
-  void JumpIfNotSmi(Operand src, Label* on_not_smi,
-                    Label::Distance near_jump = Label::kFar);
-
-  // Operations on tagged smi values.
-
-  // Smis represent a subset of integers. The subset is always equivalent to
-  // a two's complement interpretation of a fixed number of bits.
-
-  // Add an integer constant to a tagged smi, giving a tagged smi as result.
-  // No overflow testing on the result is done.
-  void SmiAddConstant(const Operand& dst, Smi* constant);
-
-  // Specialized operations
-
-  // Converts, if necessary, a smi to a combination of number and
-  // multiplier to be used as a scaled index.
-  // The src register contains a *positive* smi value. The shift is the
-  // power of two to multiply the index value by (e.g.
-  // to index by smi-value * kPointerSize, pass the smi and kPointerSizeLog2).
-  // The returned index register may be either src or dst, depending
-  // on what is most efficient. If src and dst are different registers,
-  // src is always unchanged.
-  SmiIndex SmiToIndex(Register dst, Register src, int shift);
-
-  // ---------------------------------------------------------------------------
-  // Macro instructions.
-
-  // Load/store with specific representation.
-  void Load(Register dst, const Operand& src, Representation r);
-  void Store(const Operand& dst, Register src, Representation r);
-
-  void Cmp(Register dst, Handle<Object> source);
-  void Cmp(const Operand& dst, Handle<Object> source);
-  void Cmp(Register dst, Smi* src);
-  void Cmp(const Operand& dst, Smi* src);
-
-  // Emit code to discard a non-negative number of pointer-sized elements
-  // from the stack, clobbering only the rsp register.
-  void Drop(int stack_elements);
-  // Emit code to discard a positive number of pointer-sized elements
-  // from the stack under the return address which remains on the top,
-  // clobbering the rsp register.
-  void DropUnderReturnAddress(int stack_elements,
-                              Register scratch = kScratchRegister);
-
-  void PushQuad(const Operand& src);
-  void PushImm32(int32_t imm32);
-  void Pop(Register dst);
-  void Pop(const Operand& dst);
-  void PopQuad(const Operand& dst);
-
-#define AVX_OP2_WITH_TYPE(macro_name, name, src_type) \
-  void macro_name(XMMRegister dst, src_type src) {    \
-    if (CpuFeatures::IsSupported(AVX)) {              \
-      CpuFeatureScope scope(this, AVX);               \
-      v##name(dst, dst, src);                         \
-    } else {                                          \
-      name(dst, src);                                 \
-    }                                                 \
-  }
-#define AVX_OP2_X(macro_name, name) \
-  AVX_OP2_WITH_TYPE(macro_name, name, XMMRegister)
-#define AVX_OP2_O(macro_name, name) \
-  AVX_OP2_WITH_TYPE(macro_name, name, const Operand&)
-#define AVX_OP2_XO(macro_name, name) \
-  AVX_OP2_X(macro_name, name)        \
-  AVX_OP2_O(macro_name, name)
-
-  AVX_OP2_XO(Addsd, addsd)
-  AVX_OP2_XO(Mulsd, mulsd)
-  AVX_OP2_XO(Andps, andps)
-  AVX_OP2_XO(Andpd, andpd)
-  AVX_OP2_XO(Orpd, orpd)
-  AVX_OP2_XO(Cmpeqps, cmpeqps)
-  AVX_OP2_XO(Cmpltps, cmpltps)
-  AVX_OP2_XO(Cmpleps, cmpleps)
-  AVX_OP2_XO(Cmpneqps, cmpneqps)
-  AVX_OP2_XO(Cmpnltps, cmpnltps)
-  AVX_OP2_XO(Cmpnleps, cmpnleps)
-  AVX_OP2_XO(Cmpeqpd, cmpeqpd)
-  AVX_OP2_XO(Cmpltpd, cmpltpd)
-  AVX_OP2_XO(Cmplepd, cmplepd)
-  AVX_OP2_XO(Cmpneqpd, cmpneqpd)
-  AVX_OP2_XO(Cmpnltpd, cmpnltpd)
-  AVX_OP2_XO(Cmpnlepd, cmpnlepd)
-
-#undef AVX_OP2_O
-#undef AVX_OP2_X
-#undef AVX_OP2_XO
-#undef AVX_OP2_WITH_TYPE
-
-  // ---------------------------------------------------------------------------
-  // SIMD macros.
-  void Absps(XMMRegister dst);
-  void Negps(XMMRegister dst);
-  void Abspd(XMMRegister dst);
-  void Negpd(XMMRegister dst);
-
-  // Control Flow
-  void Jump(Address destination, RelocInfo::Mode rmode);
-  void Jump(ExternalReference ext);
-  void Jump(const Operand& op);
-  void Jump(Handle<Code> code_object, RelocInfo::Mode rmode);
-
-  // Non-x64 instructions.
-  // Push/pop all general purpose registers.
-  // Does not push rsp/rbp nor any of the assembler's special purpose registers
-  // (kScratchRegister, kRootRegister).
-  void Pushad();
-  void Popad();
-
-  // Compare object type for heap object.
-  // Always use unsigned comparisons: above and below, not less and greater.
-  // Incoming register is heap_object and outgoing register is map.
-  // They may be the same register, and may be kScratchRegister.
-  void CmpObjectType(Register heap_object, InstanceType type, Register map);
-
-  // Compare instance type for map.
-  // Always use unsigned comparisons: above and below, not less and greater.
-  void CmpInstanceType(Register map, InstanceType type);
-
-  void DoubleToI(Register result_reg, XMMRegister input_reg,
-                 XMMRegister scratch, MinusZeroMode minus_zero_mode,
-                 Label* lost_precision, Label* is_nan, Label* minus_zero,
-                 Label::Distance dst = Label::kFar);
-
-  template<typename Field>
-  void DecodeField(Register reg) {
-    static const int shift = Field::kShift;
-    static const int mask = Field::kMask >> Field::kShift;
-    if (shift != 0) {
-      shrp(reg, Immediate(shift));
-    }
-    andp(reg, Immediate(mask));
-  }
-
-  // Abort execution if argument is a smi, enabled via --debug-code.
-  void AssertNotSmi(Register object);
-
-  // Abort execution if argument is not a smi, enabled via --debug-code.
-  void AssertSmi(Register object);
-  void AssertSmi(const Operand& object);
-
-  // Abort execution if argument is not a FixedArray, enabled via --debug-code.
-  void AssertFixedArray(Register object);
-
-  // Abort execution if argument is not a JSFunction, enabled via --debug-code.
-  void AssertFunction(Register object);
-
-  // Abort execution if argument is not a JSBoundFunction,
-  // enabled via --debug-code.
-  void AssertBoundFunction(Register object);
-
-  // Abort execution if argument is not a JSGeneratorObject (or subclass),
-  // enabled via --debug-code.
-  void AssertGeneratorObject(Register object);
-
-  // Abort execution if argument is not undefined or an AllocationSite, enabled
-  // via --debug-code.
-  void AssertUndefinedOrAllocationSite(Register object);
-
-  // ---------------------------------------------------------------------------
-  // Exception handling
-
-  // Push a new stack handler and link it into stack handler chain.
-  void PushStackHandler();
-
-  // Unlink the stack handler on top of the stack from the stack handler chain.
-  void PopStackHandler();
-
-  // ---------------------------------------------------------------------------
-  // Support functions.
-
-  // Load the global proxy from the current context.
-  void LoadGlobalProxy(Register dst) {
-    LoadNativeContextSlot(Context::GLOBAL_PROXY_INDEX, dst);
-  }
-
-  // Load the native context slot with the current index.
-  void LoadNativeContextSlot(int index, Register dst);
-
-  // ---------------------------------------------------------------------------
-  // Runtime calls
-
-  // Call a code stub.
-  // The code object is generated immediately, in contrast to
-  // TurboAssembler::CallStubDelayed.
-  void CallStub(CodeStub* stub);
-
-  // Tail call a code stub (jump).
-  void TailCallStub(CodeStub* stub);
-
-  // Call a runtime routine.
-  void CallRuntime(const Runtime::Function* f,
-                   int num_arguments,
-                   SaveFPRegsMode save_doubles = kDontSaveFPRegs);
-
-  // Convenience function: Same as above, but takes the fid instead.
-  void CallRuntime(Runtime::FunctionId fid,
-                   SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
-    const Runtime::Function* function = Runtime::FunctionForId(fid);
-    CallRuntime(function, function->nargs, save_doubles);
-  }
-
-  // Convenience function: Same as above, but takes the fid instead.
-  void CallRuntime(Runtime::FunctionId fid, int num_arguments,
-                   SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
-    CallRuntime(Runtime::FunctionForId(fid), num_arguments, save_doubles);
-  }
-
-  // Convenience function: tail call a runtime routine (jump)
-  void TailCallRuntime(Runtime::FunctionId fid);
-
-  // Jump to a runtime routines
-  void JumpToExternalReference(const ExternalReference& ext,
-                               bool builtin_exit_frame = false);
-
-  // ---------------------------------------------------------------------------
-  // StatsCounter support
-  void IncrementCounter(StatsCounter* counter, int value);
-  void DecrementCounter(StatsCounter* counter, int value);
-
-
-  // ---------------------------------------------------------------------------
-  // Debugging
-
-  static int SafepointRegisterStackIndex(Register reg) {
-    return SafepointRegisterStackIndex(reg.code());
-  }
-
-  void EnterBuiltinFrame(Register context, Register target, Register argc);
-  void LeaveBuiltinFrame(Register context, Register target, Register argc);
-
- private:
-  // Order general registers are pushed by Pushad.
-  // rax, rcx, rdx, rbx, rsi, rdi, r8, r9, r11, r12, r14, r15.
-  static const int kSafepointPushRegisterIndices[Register::kNumRegisters];
-  static const int kNumSafepointSavedRegisters = 12;
-
-  // Helper functions for generating invokes.
-  void InvokePrologue(const ParameterCount& expected,
-                      const ParameterCount& actual, Label* done,
-                      bool* definitely_mismatches, InvokeFlag flag,
-                      Label::Distance near_jump);
-
-  void EnterExitFramePrologue(bool save_rax, StackFrame::Type frame_type);
-
-  // Allocates arg_stack_space * kPointerSize memory (not GCed) on the stack
-  // accessible via StackSpaceOperand.
-  void EnterExitFrameEpilogue(int arg_stack_space, bool save_doubles);
-
-  void LeaveExitFrameEpilogue();
-
-  // Helper for implementing JumpIfNotInNewSpace and JumpIfInNewSpace.
-  void InNewSpace(Register object,
-                  Register scratch,
-                  Condition cc,
-                  Label* branch,
-                  Label::Distance distance = Label::kFar);
-
-  // Compute memory operands for safepoint stack slots.
-  static int SafepointRegisterStackIndex(int reg_code) {
-    return kNumSafepointRegisters - kSafepointPushRegisterIndices[reg_code] - 1;
-  }
-
-  // Needs access to SafepointRegisterStackIndex for compiled frame
-  // traversal.
-  friend class StandardFrame;
-};
-
-// -----------------------------------------------------------------------------
-// Static helper functions.
-
-// Generate an Operand for loading a field from an object.
-inline Operand FieldOperand(Register object, int offset) {
-  return Operand(object, offset - kHeapObjectTag);
-}
-
-
-// Generate an Operand for loading an indexed field from an object.
-inline Operand FieldOperand(Register object,
-                            Register index,
-                            ScaleFactor scale,
-                            int offset) {
-  return Operand(object, index, scale, offset - kHeapObjectTag);
-}
-
-
-inline Operand ContextOperand(Register context, int index) {
-  return Operand(context, Context::SlotOffset(index));
-}
-
-
-inline Operand ContextOperand(Register context, Register index) {
-  return Operand(context, index, times_pointer_size, Context::SlotOffset(0));
-}
-
-
-inline Operand NativeContextOperand() {
-  return ContextOperand(rsi, Context::NATIVE_CONTEXT_INDEX);
-}
-
-
-// Provides access to exit frame stack space (not GCed).
-inline Operand StackSpaceOperand(int index) {
-#ifdef _WIN64
-  const int kShaddowSpace = 4;
-  return Operand(rsp, (index + kShaddowSpace) * kPointerSize);
-#else
-  return Operand(rsp, index * kPointerSize);
-#endif
-}
-
-
-inline Operand StackOperandForReturnAddress(int32_t disp) {
-  return Operand(rsp, disp);
-}
-
-#define ACCESS_MASM(masm) masm->
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_X64_MACRO_ASSEMBLER_X64_H_
diff --git a/src/v8/src/x64/simulator-x64.cc b/src/v8/src/x64/simulator-x64.cc
deleted file mode 100644
index 4797ae9..0000000
--- a/src/v8/src/x64/simulator-x64.cc
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright 2009 the V8 project 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 "src/x64/simulator-x64.h"
-
-// Since there is no simulator for the x64 architecture this file is empty.
diff --git a/src/v8/src/x64/simulator-x64.h b/src/v8/src/x64/simulator-x64.h
deleted file mode 100644
index ce9f359..0000000
--- a/src/v8/src/x64/simulator-x64.h
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_X64_SIMULATOR_X64_H_
-#define V8_X64_SIMULATOR_X64_H_
-
-// Since there is no simulator for the x64 architecture this file is empty.
-
-#endif  // V8_X64_SIMULATOR_X64_H_
diff --git a/src/v8/src/x64/sse-instr.h b/src/v8/src/x64/sse-instr.h
deleted file mode 100644
index 235aa75..0000000
--- a/src/v8/src/x64/sse-instr.h
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_SSE_INSTR_H_
-#define V8_SSE_INSTR_H_
-
-#define SSE2_INSTRUCTION_LIST(V) \
-  V(packsswb, 66, 0F, 63)        \
-  V(packssdw, 66, 0F, 6B)        \
-  V(packuswb, 66, 0F, 67)        \
-  V(paddb, 66, 0F, FC)           \
-  V(paddw, 66, 0F, FD)           \
-  V(paddd, 66, 0F, FE)           \
-  V(paddsb, 66, 0F, EC)          \
-  V(paddsw, 66, 0F, ED)          \
-  V(paddusb, 66, 0F, DC)         \
-  V(paddusw, 66, 0F, DD)         \
-  V(pcmpeqb, 66, 0F, 74)         \
-  V(pcmpeqw, 66, 0F, 75)         \
-  V(pcmpeqd, 66, 0F, 76)         \
-  V(pcmpgtb, 66, 0F, 64)         \
-  V(pcmpgtw, 66, 0F, 65)         \
-  V(pcmpgtd, 66, 0F, 66)         \
-  V(pmaxsw, 66, 0F, EE)          \
-  V(pmaxub, 66, 0F, DE)          \
-  V(pminsw, 66, 0F, EA)          \
-  V(pminub, 66, 0F, DA)          \
-  V(pmullw, 66, 0F, D5)          \
-  V(pmuludq, 66, 0F, F4)         \
-  V(psllw, 66, 0F, F1)           \
-  V(pslld, 66, 0F, F2)           \
-  V(psraw, 66, 0F, E1)           \
-  V(psrad, 66, 0F, E2)           \
-  V(psrlw, 66, 0F, D1)           \
-  V(psrld, 66, 0F, D2)           \
-  V(psubb, 66, 0F, F8)           \
-  V(psubw, 66, 0F, F9)           \
-  V(psubd, 66, 0F, FA)           \
-  V(psubsb, 66, 0F, E8)          \
-  V(psubsw, 66, 0F, E9)          \
-  V(psubusb, 66, 0F, D8)         \
-  V(psubusw, 66, 0F, D9)         \
-  V(pand, 66, 0F, DB)            \
-  V(por, 66, 0F, EB)             \
-  V(pxor, 66, 0F, EF)            \
-  V(cvtps2dq, 66, 0F, 5B)
-
-#define SSSE3_INSTRUCTION_LIST(V) \
-  V(pabsb, 66, 0F, 38, 1C)        \
-  V(pabsw, 66, 0F, 38, 1D)        \
-  V(pabsd, 66, 0F, 38, 1E)        \
-  V(phaddd, 66, 0F, 38, 02)       \
-  V(phaddw, 66, 0F, 38, 01)       \
-  V(pshufb, 66, 0F, 38, 00)       \
-  V(psignb, 66, 0F, 38, 08)       \
-  V(psignw, 66, 0F, 38, 09)       \
-  V(psignd, 66, 0F, 38, 0A)
-
-#define SSE4_INSTRUCTION_LIST(V) \
-  V(packusdw, 66, 0F, 38, 2B)    \
-  V(pminsb, 66, 0F, 38, 38)      \
-  V(pminsd, 66, 0F, 38, 39)      \
-  V(pminuw, 66, 0F, 38, 3A)      \
-  V(pminud, 66, 0F, 38, 3B)      \
-  V(pmaxsb, 66, 0F, 38, 3C)      \
-  V(pmaxsd, 66, 0F, 38, 3D)      \
-  V(pmaxuw, 66, 0F, 38, 3E)      \
-  V(pmaxud, 66, 0F, 38, 3F)      \
-  V(pmulld, 66, 0F, 38, 40)      \
-  V(ptest, 66, 0F, 38, 17)
-
-#endif  // V8_SSE_INSTR_H_
diff --git a/src/v8/test/benchmarks/benchmarks.gyp b/src/v8/test/benchmarks/benchmarks.gyp
deleted file mode 100644
index 0822ee4..0000000
--- a/src/v8/test/benchmarks/benchmarks.gyp
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'conditions': [
-    ['test_isolation_mode != "noop"', {
-      'targets': [
-        {
-          'target_name': 'benchmarks_run',
-          'type': 'none',
-          'dependencies': [
-            '../../src/d8.gyp:d8_run',
-          ],
-          'includes': [
-            '../../gypfiles/features.gypi',
-            '../../gypfiles/isolate.gypi',
-          ],
-          'sources': [
-            'benchmarks.isolate',
-          ],
-        },
-      ],
-    }],
-  ],
-}
diff --git a/src/v8/test/benchmarks/benchmarks.isolate b/src/v8/test/benchmarks/benchmarks.isolate
deleted file mode 100644
index dbeca5e..0000000
--- a/src/v8/test/benchmarks/benchmarks.isolate
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'variables': {
-    'files': [
-      './',
-    ],
-  },
-  'includes': [
-    '../../src/d8.isolate',
-    '../../tools/testrunner/testrunner.isolate',
-  ],
-}
\ No newline at end of file
diff --git a/src/v8/test/bot_default.gyp b/src/v8/test/bot_default.gyp
deleted file mode 100644
index 11223e0..0000000
--- a/src/v8/test/bot_default.gyp
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'conditions': [
-    ['test_isolation_mode != "noop"', {
-      'targets': [
-        {
-          'target_name': 'bot_default_run',
-          'type': 'none',
-          'dependencies': [
-            'cctest/cctest.gyp:cctest_run',
-            'debugger/debugger.gyp:debugger_run',
-            'fuzzer/fuzzer.gyp:fuzzer_run',
-            'inspector/inspector.gyp:inspector-test_run',
-            'intl/intl.gyp:intl_run',
-            'message/message.gyp:message_run',
-            'mjsunit/mjsunit.gyp:mjsunit_run',
-            'preparser/preparser.gyp:preparser_run',
-            'unittests/unittests.gyp:unittests_run',
-            'wasm-spec-tests/wasm-spec-tests.gyp:wasm_spec_tests_run',
-            'webkit/webkit.gyp:webkit_run',
-          ],
-          'includes': [
-            '../gypfiles/features.gypi',
-            '../gypfiles/isolate.gypi',
-          ],
-          'sources': [
-            'bot_default.isolate',
-          ],
-        },
-      ],
-    }],
-  ],
-}
diff --git a/src/v8/test/bot_default.isolate b/src/v8/test/bot_default.isolate
deleted file mode 100644
index c4db291..0000000
--- a/src/v8/test/bot_default.isolate
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'variables': {
-    'command': [
-      '../tools/run-tests.py',
-    ],
-  },
-  'includes': [
-    'cctest/cctest.isolate',
-    'debugger/debugger.isolate',
-    'fuzzer/fuzzer.isolate',
-    'inspector/inspector.isolate',
-    'intl/intl.isolate',
-    'message/message.isolate',
-    'mjsunit/mjsunit.isolate',
-    'mkgrokdump/mkgrokdump.isolate',
-    'preparser/preparser.isolate',
-    'unittests/unittests.isolate',
-    'wasm-spec-tests/wasm-spec-tests.isolate',
-    'webkit/webkit.isolate',
-  ],
-}
diff --git a/src/v8/test/cctest/cctest.gyp b/src/v8/test/cctest/cctest.gyp
deleted file mode 100644
index 483426f..0000000
--- a/src/v8/test/cctest/cctest.gyp
+++ /dev/null
@@ -1,523 +0,0 @@
-# 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.
-
-# The sources are kept automatically in sync with BUILD.gn.
-
-{
-  'variables': {
-    'v8_code': 1,
-    'generated_file': '<(SHARED_INTERMEDIATE_DIR)/resources.cc',
-    'cctest_sources': [  ### gcmole(all) ###
-      'compiler/c-signature.h',
-      'compiler/call-tester.h',
-      'compiler/codegen-tester.cc',
-      'compiler/codegen-tester.h',
-      'compiler/code-assembler-tester.h',
-      'compiler/function-tester.cc',
-      'compiler/function-tester.h',
-      'compiler/graph-builder-tester.h',
-      'compiler/test-basic-block-profiler.cc',
-      'compiler/test-branch-combine.cc',
-      'compiler/test-run-unwinding-info.cc',
-      'compiler/test-gap-resolver.cc',
-      'compiler/test-graph-visualizer.cc',
-      'compiler/test-code-generator.cc',
-      'compiler/test-code-assembler.cc',
-      'compiler/test-instruction.cc',
-      'compiler/test-js-context-specialization.cc',
-      'compiler/test-js-constant-cache.cc',
-      'compiler/test-js-typed-lowering.cc',
-      'compiler/test-jump-threading.cc',
-      'compiler/test-linkage.cc',
-      'compiler/test-loop-analysis.cc',
-      'compiler/test-machine-operator-reducer.cc',
-      'compiler/test-multiple-return.cc',
-      'compiler/test-node.cc',
-      'compiler/test-operator.cc',
-      'compiler/test-representation-change.cc',
-      'compiler/test-run-bytecode-graph-builder.cc',
-      'compiler/test-run-calls-to-external-references.cc',
-      'compiler/test-run-deopt.cc',
-      'compiler/test-run-intrinsics.cc',
-      'compiler/test-run-jsbranches.cc',
-      'compiler/test-run-jscalls.cc',
-      'compiler/test-run-jsexceptions.cc',
-      'compiler/test-run-jsobjects.cc',
-      'compiler/test-run-jsops.cc',
-      'compiler/test-run-load-store.cc',
-      'compiler/test-run-machops.cc',
-      'compiler/test-run-native-calls.cc',
-      'compiler/test-run-retpoline.cc',
-      'compiler/test-run-stackcheck.cc',
-      'compiler/test-run-stubs.cc',
-      'compiler/test-run-tail-calls.cc',
-      'compiler/test-run-variables.cc',
-      'compiler/test-run-wasm-machops.cc',
-      'compiler/value-helper.cc',
-      'compiler/value-helper.h',
-      'cctest.cc',
-      'cctest.h',
-      'expression-type-collector-macros.h',
-      'gay-fixed.cc',
-      'gay-fixed.h',
-      'gay-precision.cc',
-      'gay-precision.h',
-      'gay-shortest.cc',
-      'gay-shortest.h',
-      'heap/heap-tester.h',
-      'heap/heap-utils.cc',
-      'heap/heap-utils.h',
-      'heap/test-alloc.cc',
-      'heap/test-array-buffer-tracker.cc',
-      'heap/test-compaction.cc',
-      'heap/test-concurrent-marking.cc',
-      'heap/test-embedder-tracing.cc',
-      'heap/test-heap.cc',
-      'heap/test-incremental-marking.cc',
-      'heap/test-invalidated-slots.cc',
-      'heap/test-lab.cc',
-      'heap/test-mark-compact.cc',
-      'heap/test-page-promotion.cc',
-      'heap/test-spaces.cc',
-      'interpreter/interpreter-tester.cc',
-      'interpreter/interpreter-tester.h',
-      'interpreter/source-position-matcher.cc',
-      'interpreter/source-position-matcher.h',
-      'interpreter/test-bytecode-generator.cc',
-      'interpreter/test-interpreter.cc',
-      'interpreter/test-interpreter-intrinsics.cc',
-      'interpreter/test-source-positions.cc',
-      'interpreter/bytecode-expectations-printer.cc',
-      'interpreter/bytecode-expectations-printer.h',
-      'libplatform/test-tracing.cc',
-      'libsampler/test-sampler.cc',
-      'parsing/test-parse-decision.cc',
-      'parsing/test-preparser.cc',
-      'parsing/test-scanner-streams.cc',
-      'parsing/test-scanner.cc',
-      'print-extension.cc',
-      'print-extension.h',
-      'profiler-extension.cc',
-      'profiler-extension.h',
-      'scope-test-helper.h',
-      'setup-isolate-for-tests.cc',
-      'setup-isolate-for-tests.h',
-      'test-access-checks.cc',
-      'test-accessor-assembler.cc',
-      'test-accessors.cc',
-      'test-allocation.cc',
-      'test-api.cc',
-      'test-api.h',
-      'test-api-accessors.cc',
-      'test-api-interceptors.cc',
-      'test-array-list.cc',
-      'test-atomicops.cc',
-      'test-bignum.cc',
-      'test-bignum-dtoa.cc',
-      'test-bit-vector.cc',
-      'test-circular-queue.cc',
-      'test-code-layout.cc',
-      'test-code-stub-assembler.cc',
-      'test-compiler.cc',
-      'test-constantpool.cc',
-      'test-conversions.cc',
-      'test-cpu-profiler.cc',
-      'test-date.cc',
-      'test-debug.cc',
-      'test-decls.cc',
-      'test-deoptimization.cc',
-      'test-dictionary.cc',
-      'test-diy-fp.cc',
-      'test-double.cc',
-      'test-dtoa.cc',
-      'test-elements-kind.cc',
-      'test-fast-dtoa.cc',
-      'test-feedback-vector.cc',
-      'test-feedback-vector.h',
-      'test-field-type-tracking.cc',
-      'test-fixed-dtoa.cc',
-      'test-flags.cc',
-      'test-func-name-inference.cc',
-      'test-global-handles.cc',
-      'test-global-object.cc',
-      'test-hashcode.cc',
-      'test-hashmap.cc',
-      'test-heap-profiler.cc',
-      'test-identity-map.cc',
-      'test-intl.cc',
-      'test-inobject-slack-tracking.cc',
-      'test-liveedit.cc',
-      'test-lockers.cc',
-      'test-log.cc',
-      'test-managed.cc',
-      'test-mementos.cc',
-      'test-modules.cc',
-      'test-object.cc',
-      'test-orderedhashtable.cc',
-      'test-parsing.cc',
-      'test-platform.cc',
-      'test-profile-generator.cc',
-      'test-random-number-generator.cc',
-      'test-regexp.cc',
-      'test-representation.cc',
-      'test-sampler-api.cc',
-      'test-serialize.cc',
-      'test-strings.cc',
-      'test-symbols.cc',
-      'test-strtod.cc',
-      'test-thread-termination.cc',
-      'test-threads.cc',
-      'test-trace-event.cc',
-      'test-traced-value.cc',
-      'test-transitions.cc',
-      'test-transitions.h',
-      'test-typedarrays.cc',
-      'test-types.cc',
-      'test-unbound-queue.cc',
-      'test-unboxed-doubles.cc',
-      'test-unscopables-hidden-prototype.cc',
-      'test-usecounters.cc',
-      'test-utils.cc',
-      'test-version.cc',
-      'test-weakmaps.cc',
-      'test-weaksets.cc',
-      'trace-extension.cc',
-      'trace-extension.h',
-      'types-fuzz.h',
-      'unicode-helpers.h',
-      'wasm/test-c-wasm-entry.cc',
-      'wasm/test-streaming-compilation.cc',
-      'wasm/test-run-wasm.cc',
-      'wasm/test-run-wasm-64.cc',
-      'wasm/test-run-wasm-asmjs.cc',
-      'wasm/test-run-wasm-atomics.cc',
-      'wasm/test-run-wasm-interpreter.cc',
-      'wasm/test-run-wasm-js.cc',
-      'wasm/test-run-wasm-module.cc',
-      'wasm/test-run-wasm-relocation.cc',
-      'wasm/test-run-wasm-simd.cc',
-      'wasm/test-wasm-breakpoints.cc',
-      "wasm/test-wasm-codegen.cc",
-      'wasm/test-wasm-interpreter-entry.cc',
-      'wasm/test-wasm-stack.cc',
-      'wasm/test-wasm-trap-position.cc',
-      'wasm/wasm-run-utils.cc',
-      'wasm/wasm-run-utils.h',
-    ],
-    'cctest_sources_x86': [  ### gcmole(arch:x86) ###
-      'test-assembler-ia32.cc',
-      'test-code-stubs.cc',
-      'test-code-stubs.h',
-      'test-code-stubs-ia32.cc',
-      'test-disasm-ia32.cc',
-      'test-log-stack-tracer.cc',
-      'test-run-wasm-relocation-ia32.cc',
-    ],
-    'cctest_sources_x64': [  ### gcmole(arch:x64) ###
-      'test-assembler-x64.cc',
-      'test-code-stubs.cc',
-      'test-code-stubs.h',
-      'test-code-stubs-x64.cc',
-      'test-disasm-x64.cc',
-      'test-macro-assembler-x64.cc',
-      'test-log-stack-tracer.cc',
-      'test-run-wasm-relocation-x64.cc',
-    ],
-    'cctest_sources_arm': [  ### gcmole(arch:arm) ###
-      'assembler-helper-arm.cc',
-      'assembler-helper-arm.h',
-      'test-assembler-arm.cc',
-      'test-code-stubs.cc',
-      'test-code-stubs.h',
-      'test-code-stubs-arm.cc',
-      'test-disasm-arm.cc',
-      'test-macro-assembler-arm.cc',
-      'test-run-wasm-relocation-arm.cc',
-      'test-sync-primitives-arm.cc',
-    ],
-    'cctest_sources_arm64': [  ### gcmole(arch:arm64) ###
-      'test-utils-arm64.cc',
-      'test-utils-arm64.h',
-      'test-assembler-arm64.cc',
-      'test-code-stubs.cc',
-      'test-code-stubs.h',
-      'test-code-stubs-arm64.cc',
-      'test-disasm-arm64.cc',
-      'test-fuzz-arm64.cc',
-      'test-javascript-arm64.cc',
-      'test-js-arm64-variables.cc',
-      'test-run-wasm-relocation-arm64.cc',
-      'test-sync-primitives-arm64.cc',
-    ],
-    'cctest_sources_s390': [  ### gcmole(arch:s390) ###
-      'test-assembler-s390.cc',
-      'test-code-stubs.cc',
-      'test-code-stubs.h',
-      'test-disasm-s390.cc',
-    ],
-    'cctest_sources_ppc': [  ### gcmole(arch:ppc) ###
-      'test-assembler-ppc.cc',
-      'test-code-stubs.cc',
-      'test-code-stubs.h',
-      'test-disasm-ppc.cc',
-    ],
-    'cctest_sources_mips': [  ### gcmole(arch:mips) ###
-      'test-assembler-mips.cc',
-      'test-code-stubs.cc',
-      'test-code-stubs.h',
-      'test-code-stubs-mips.cc',
-      'test-disasm-mips.cc',
-      'test-macro-assembler-mips.cc',
-    ],
-    'cctest_sources_mipsel': [  ### gcmole(arch:mipsel) ###
-      'test-assembler-mips.cc',
-      'test-code-stubs.cc',
-      'test-code-stubs.h',
-      'test-code-stubs-mips.cc',
-      'test-disasm-mips.cc',
-      'test-macro-assembler-mips.cc',
-    ],
-    'cctest_sources_mips64': [  ### gcmole(arch:mips64) ###
-      'test-assembler-mips64.cc',
-      'test-code-stubs.cc',
-      'test-code-stubs.h',
-      'test-code-stubs-mips64.cc',
-      'test-disasm-mips64.cc',
-      'test-macro-assembler-mips64.cc',
-    ],
-    'cctest_sources_mips64el': [  ### gcmole(arch:mips64el) ###
-      'test-assembler-mips64.cc',
-      'test-code-stubs.cc',
-      'test-code-stubs.h',
-      'test-code-stubs-mips64.cc',
-      'test-disasm-mips64.cc',
-      'test-macro-assembler-mips64.cc',
-    ],
-  },
-  'includes': ['../../gypfiles/toolchain.gypi', '../../gypfiles/features.gypi'],
-  'targets': [
-    {
-      'target_name': 'cctest',
-      'type': 'executable',
-      'dependencies': [
-        'resources',
-        '../../src/v8.gyp:v8_libbase',
-        '../../src/v8.gyp:v8_libplatform',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [
-        '../common/wasm/flag-utils.h',
-        '../common/wasm/test-signatures.h',
-        '../common/wasm/wasm-macro-gen.h',
-        '../common/wasm/wasm-module-runner.cc',
-        '../common/wasm/wasm-module-runner.h',
-        '<@(cctest_sources)',
-        '<(generated_file)',
-      ],
-      'conditions': [
-        ['v8_target_arch=="x86"', {
-          'sources': [
-            '<@(cctest_sources_x86)',
-          ],
-        }],
-        ['v8_target_arch=="x64"', {
-          'sources': [
-            '<@(cctest_sources_x64)',
-          ],
-        }],
-        ['v8_target_arch=="arm"', {
-          'sources': [
-            '<@(cctest_sources_arm)',
-          ],
-        }],
-        ['v8_target_arch=="arm64"', {
-          'sources': [
-            '<@(cctest_sources_arm64)',
-          ],
-        }],
-        ['v8_target_arch=="s390"', {
-          'sources': [
-            '<@(cctest_sources_s390)',
-          ],
-        }],
-        ['v8_target_arch=="s390x"', {
-          'sources': [
-            '<@(cctest_sources_s390)',
-          ],
-        }],
-        ['v8_target_arch=="ppc"', {
-          'sources': [
-            '<@(cctest_sources_ppc)',
-          ],
-        }],
-        ['v8_target_arch=="ppc64"', {
-          'sources': [
-            '<@(cctest_sources_ppc)',
-          ],
-        }],
-        ['v8_target_arch=="mips"', {
-          'sources': [
-            '<@(cctest_sources_mips)',
-          ],
-        }],
-        ['v8_target_arch=="mipsel"', {
-          'sources': [
-            '<@(cctest_sources_mipsel)',
-          ],
-        }],
-        ['v8_target_arch=="mips64"', {
-          'sources': [
-            '<@(cctest_sources_mips64)',
-          ],
-        }],
-        ['v8_target_arch=="mips64el"', {
-          'sources': [
-            '<@(cctest_sources_mips64el)',
-          ],
-        }],
-        [ 'OS=="win"', {
-          'msvs_settings': {
-            'VCCLCompilerTool': {
-              # MSVS wants this for gay-{precision,shortest}.cc.
-              'AdditionalOptions': ['/bigobj'],
-            },
-          },
-        }],
-        ['v8_target_arch=="ppc" or v8_target_arch=="ppc64" \
-          or v8_target_arch=="arm" or v8_target_arch=="arm64" \
-          or v8_target_arch=="s390" or v8_target_arch=="s390x" \
-          or v8_target_arch=="mips" or v8_target_arch=="mips64" \
-          or v8_target_arch=="mipsel" or v8_target_arch=="mips64el"', {
-          # disable fmadd/fmsub so that expected results match generated code in
-          # RunFloat64MulAndFloat64Add1 and friends.
-          'cflags': ['-ffp-contract=off'],
-        }],
-        ['OS=="aix"', {
-          'ldflags': [ '-Wl,-bbigtoc' ],
-        }],
-        ['component=="shared_library"', {
-          # cctest can't be built against a shared library, so we need to
-          # depend on the underlying static target in that case.
-          'dependencies': ['../../src/v8.gyp:v8_maybe_snapshot'],
-          'defines': [ 'BUILDING_V8_SHARED', ]
-        }, {
-          'dependencies': ['../../src/v8.gyp:v8'],
-        }],
-        ['v8_use_snapshot=="true"', {
-          'dependencies': ['../../src/v8.gyp:v8_initializers'],
-        }],
-      ],
-    },
-    {
-      'target_name': 'resources',
-      'type': 'none',
-      'variables': {
-        'file_list': [
-           '../../tools/splaytree.js',
-           '../../tools/codemap.js',
-           '../../tools/csvparser.js',
-           '../../tools/consarray.js',
-           '../../tools/profile.js',
-           '../../tools/profile_view.js',
-           '../../tools/arguments.js',
-           '../../tools/logreader.js',
-           'log-eq-of-logging-and-traversal.js',
-        ],
-      },
-      'actions': [
-        {
-          'action_name': 'js2c',
-          'inputs': [
-            '../../tools/js2c.py',
-            '<@(file_list)',
-          ],
-          'outputs': [
-            '<(generated_file)',
-          ],
-          'action': [
-            'python',
-            '../../tools/js2c.py',
-            '<@(_outputs)',
-            'TEST',  # type
-            '<@(file_list)',
-          ],
-        }
-      ],
-    },
-    {
-      'target_name': 'generate-bytecode-expectations',
-      'type': 'executable',
-      'dependencies': [
-        '../../src/v8.gyp:v8',
-        '../../src/v8.gyp:v8_libbase',
-        '../../src/v8.gyp:v8_libplatform',
-      ],
-      'include_dirs+': [
-        '../..',
-      ],
-      'sources': [
-        'interpreter/bytecode-expectations-printer.cc',
-        'interpreter/bytecode-expectations-printer.h',
-        'interpreter/generate-bytecode-expectations.cc',
-      ],
-    },
-  ],
-  'conditions': [
-    ['test_isolation_mode != "noop"', {
-      'targets': [
-        {
-          'target_name': 'cctest_exe_run',
-          'type': 'none',
-          'dependencies': [
-            'cctest',
-          ],
-          'includes': [
-            '../../gypfiles/isolate.gypi',
-          ],
-          'sources': [
-            'cctest_exe.isolate',
-          ],
-        },
-        {
-          'target_name': 'cctest_run',
-          'type': 'none',
-          'dependencies': [
-            'cctest_exe_run',
-          ],
-          'includes': [
-            '../../gypfiles/isolate.gypi',
-          ],
-          'sources': [
-            'cctest.isolate',
-          ],
-        },
-      ],
-    }],
-  ],
-}
diff --git a/src/v8/test/cctest/cctest.isolate b/src/v8/test/cctest/cctest.isolate
deleted file mode 100644
index dd03ab8..0000000
--- a/src/v8/test/cctest/cctest.isolate
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'variables': {
-    'files': [
-      './cctest.status',
-      './testcfg.py',
-      './interpreter/bytecode_expectations/',
-    ],
-  },
-  'includes': [
-    'cctest_exe.isolate',
-    '../../tools/testrunner/testrunner.isolate',
-  ],
-}
diff --git a/src/v8/test/cctest/cctest_exe.isolate b/src/v8/test/cctest/cctest_exe.isolate
deleted file mode 100644
index da53278..0000000
--- a/src/v8/test/cctest/cctest_exe.isolate
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2016 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'variables': {
-    'files': [
-      '<(PRODUCT_DIR)/cctest<(EXECUTABLE_SUFFIX)',
-    ],
-  },
-  'includes': [
-    '../../src/base.isolate',
-  ],
-}
diff --git a/src/v8/test/cctest/compiler/graph-builder-tester.h b/src/v8/test/cctest/compiler/graph-builder-tester.h
deleted file mode 100644
index 24c2877..0000000
--- a/src/v8/test/cctest/compiler/graph-builder-tester.h
+++ /dev/null
@@ -1,285 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_CCTEST_COMPILER_GRAPH_BUILDER_TESTER_H_
-#define V8_CCTEST_COMPILER_GRAPH_BUILDER_TESTER_H_
-
-#include "src/compilation-info.h"
-#include "src/compiler/common-operator.h"
-#include "src/compiler/instruction-selector.h"
-#include "src/compiler/linkage.h"
-#include "src/compiler/machine-operator.h"
-#include "src/compiler/operator-properties.h"
-#include "src/compiler/pipeline.h"
-#include "src/compiler/simplified-operator.h"
-#include "test/cctest/cctest.h"
-#include "test/cctest/compiler/call-tester.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-class GraphAndBuilders {
- public:
-  explicit GraphAndBuilders(Zone* zone)
-      : main_graph_(new (zone) Graph(zone)),
-        main_common_(zone),
-        main_machine_(zone, MachineType::PointerRepresentation(),
-                      InstructionSelector::SupportedMachineOperatorFlags(),
-                      InstructionSelector::AlignmentRequirements()),
-        main_simplified_(zone) {}
-
-  Graph* graph() const { return main_graph_; }
-  Zone* zone() const { return graph()->zone(); }
-  CommonOperatorBuilder* common() { return &main_common_; }
-  MachineOperatorBuilder* machine() { return &main_machine_; }
-  SimplifiedOperatorBuilder* simplified() { return &main_simplified_; }
-
- protected:
-  // Prefixed with main_ to avoid naming conflicts.
-  Graph* main_graph_;
-  CommonOperatorBuilder main_common_;
-  MachineOperatorBuilder main_machine_;
-  SimplifiedOperatorBuilder main_simplified_;
-};
-
-
-template <typename ReturnType>
-class GraphBuilderTester : public HandleAndZoneScope,
-                           public GraphAndBuilders,
-                           public CallHelper<ReturnType> {
- public:
-  template <typename... ParamMachTypes>
-  explicit GraphBuilderTester(ParamMachTypes... p)
-      : GraphAndBuilders(main_zone()),
-        CallHelper<ReturnType>(
-            main_isolate(),
-            CSignature::New(main_zone(), MachineTypeForC<ReturnType>(), p...)),
-        effect_(nullptr),
-        return_(nullptr),
-        parameters_(main_zone()->template NewArray<Node*>(parameter_count())) {
-    Begin(static_cast<int>(parameter_count()));
-    InitParameters();
-  }
-  virtual ~GraphBuilderTester() {}
-
-  void GenerateCode() { Generate(); }
-  Node* Parameter(size_t index) {
-    CHECK_LT(index, parameter_count());
-    return parameters_[index];
-  }
-
-  Isolate* isolate() { return main_isolate(); }
-  Factory* factory() { return isolate()->factory(); }
-
-  // Initialize graph and builder.
-  void Begin(int num_parameters) {
-    CHECK_NULL(graph()->start());
-    Node* start = graph()->NewNode(common()->Start(num_parameters + 3));
-    graph()->SetStart(start);
-    effect_ = start;
-  }
-
-  void Return(Node* value) {
-    Node* zero = graph()->NewNode(common()->Int32Constant(0));
-    return_ = graph()->NewNode(common()->Return(), zero, value, effect_,
-                               graph()->start());
-    effect_ = nullptr;
-  }
-
-  // Close the graph.
-  void End() {
-    Node* end = graph()->NewNode(common()->End(1), return_);
-    graph()->SetEnd(end);
-  }
-
-  Node* PointerConstant(void* value) {
-    intptr_t intptr_value = reinterpret_cast<intptr_t>(value);
-    return kPointerSize == 8 ? NewNode(common()->Int64Constant(intptr_value))
-                             : Int32Constant(static_cast<int>(intptr_value));
-  }
-  Node* Int32Constant(int32_t value) {
-    return NewNode(common()->Int32Constant(value));
-  }
-  Node* HeapConstant(Handle<HeapObject> object) {
-    return NewNode(common()->HeapConstant(object));
-  }
-
-  Node* BooleanNot(Node* a) { return NewNode(simplified()->BooleanNot(), a); }
-
-  Node* NumberEqual(Node* a, Node* b) {
-    return NewNode(simplified()->NumberEqual(), a, b);
-  }
-  Node* NumberLessThan(Node* a, Node* b) {
-    return NewNode(simplified()->NumberLessThan(), a, b);
-  }
-  Node* NumberLessThanOrEqual(Node* a, Node* b) {
-    return NewNode(simplified()->NumberLessThanOrEqual(), a, b);
-  }
-  Node* NumberAdd(Node* a, Node* b) {
-    return NewNode(simplified()->NumberAdd(), a, b);
-  }
-  Node* NumberSubtract(Node* a, Node* b) {
-    return NewNode(simplified()->NumberSubtract(), a, b);
-  }
-  Node* NumberMultiply(Node* a, Node* b) {
-    return NewNode(simplified()->NumberMultiply(), a, b);
-  }
-  Node* NumberDivide(Node* a, Node* b) {
-    return NewNode(simplified()->NumberDivide(), a, b);
-  }
-  Node* NumberModulus(Node* a, Node* b) {
-    return NewNode(simplified()->NumberModulus(), a, b);
-  }
-  Node* NumberToInt32(Node* a) {
-    return NewNode(simplified()->NumberToInt32(), a);
-  }
-  Node* NumberToUint32(Node* a) {
-    return NewNode(simplified()->NumberToUint32(), a);
-  }
-
-  Node* StringEqual(Node* a, Node* b) {
-    return NewNode(simplified()->StringEqual(), a, b);
-  }
-  Node* StringLessThan(Node* a, Node* b) {
-    return NewNode(simplified()->StringLessThan(), a, b);
-  }
-  Node* StringLessThanOrEqual(Node* a, Node* b) {
-    return NewNode(simplified()->StringLessThanOrEqual(), a, b);
-  }
-
-  Node* ChangeTaggedToInt32(Node* a) {
-    return NewNode(simplified()->ChangeTaggedToInt32(), a);
-  }
-  Node* ChangeTaggedToUint32(Node* a) {
-    return NewNode(simplified()->ChangeTaggedToUint32(), a);
-  }
-  Node* ChangeTaggedToFloat64(Node* a) {
-    return NewNode(simplified()->ChangeTaggedToFloat64(), a);
-  }
-  Node* ChangeInt32ToTagged(Node* a) {
-    return NewNode(simplified()->ChangeInt32ToTagged(), a);
-  }
-  Node* ChangeUint32ToTagged(Node* a) {
-    return NewNode(simplified()->ChangeUint32ToTagged(), a);
-  }
-  Node* ChangeFloat64ToTagged(Node* a) {
-    return NewNode(simplified()->ChangeFloat64ToTagged(), a);
-  }
-  Node* ChangeTaggedToBit(Node* a) {
-    return NewNode(simplified()->ChangeTaggedToBit(), a);
-  }
-  Node* ChangeBitToTagged(Node* a) {
-    return NewNode(simplified()->ChangeBitToTagged(), a);
-  }
-
-  Node* LoadField(const FieldAccess& access, Node* object) {
-    return NewNode(simplified()->LoadField(access), object);
-  }
-  Node* StoreField(const FieldAccess& access, Node* object, Node* value) {
-    return NewNode(simplified()->StoreField(access), object, value);
-  }
-  Node* LoadElement(const ElementAccess& access, Node* object, Node* index) {
-    return NewNode(simplified()->LoadElement(access), object, index);
-  }
-  Node* StoreElement(const ElementAccess& access, Node* object, Node* index,
-                     Node* value) {
-    return NewNode(simplified()->StoreElement(access), object, index, value);
-  }
-
-  template <typename... NodePtrs>
-  Node* NewNode(const Operator* op, NodePtrs... n) {
-    std::array<Node*, sizeof...(n)> inputs{{n...}};
-    return MakeNode(op, inputs.size(), inputs.data());
-  }
-
-  Node* NewNode(const Operator* op, int value_input_count,
-                Node** value_inputs) {
-    return MakeNode(op, value_input_count, value_inputs);
-  }
-
-  Handle<Code> GetCode() {
-    Generate();
-    return code_.ToHandleChecked();
-  }
-
- protected:
-  Node* MakeNode(const Operator* op, int value_input_count,
-                 Node** value_inputs) {
-    CHECK_EQ(op->ValueInputCount(), value_input_count);
-
-    CHECK(!OperatorProperties::HasContextInput(op));
-    CHECK(!OperatorProperties::HasFrameStateInput(op));
-    bool has_control = op->ControlInputCount() == 1;
-    bool has_effect = op->EffectInputCount() == 1;
-
-    CHECK_LT(op->ControlInputCount(), 2);
-    CHECK_LT(op->EffectInputCount(), 2);
-
-    Node* result = nullptr;
-    if (!has_control && !has_effect) {
-      result = graph()->NewNode(op, value_input_count, value_inputs);
-    } else {
-      int input_count_with_deps = value_input_count;
-      if (has_control) ++input_count_with_deps;
-      if (has_effect) ++input_count_with_deps;
-      Node** buffer = zone()->template NewArray<Node*>(input_count_with_deps);
-      memcpy(buffer, value_inputs, kPointerSize * value_input_count);
-      Node** current_input = buffer + value_input_count;
-      if (has_effect) {
-        *current_input++ = effect_;
-      }
-      if (has_control) {
-        *current_input++ = graph()->start();
-      }
-      result = graph()->NewNode(op, input_count_with_deps, buffer);
-      if (has_effect) {
-        effect_ = result;
-      }
-      // This graph builder does not support control flow.
-      CHECK_EQ(0, op->ControlOutputCount());
-    }
-
-    return result;
-  }
-
-  virtual byte* Generate() {
-    if (code_.is_null()) {
-      Zone* zone = graph()->zone();
-      CallDescriptor* desc =
-          Linkage::GetSimplifiedCDescriptor(zone, this->csig_);
-      CompilationInfo info(ArrayVector("testing"), main_zone(), Code::STUB);
-      code_ = Pipeline::GenerateCodeForTesting(&info, main_isolate(), desc,
-                                               graph());
-#ifdef ENABLE_DISASSEMBLER
-      if (!code_.is_null() && FLAG_print_opt_code) {
-        OFStream os(stdout);
-        code_.ToHandleChecked()->Disassemble("test code", os);
-      }
-#endif
-    }
-    return code_.ToHandleChecked()->entry();
-  }
-
-  void InitParameters() {
-    int param_count = static_cast<int>(parameter_count());
-    for (int i = 0; i < param_count; ++i) {
-      parameters_[i] = this->NewNode(common()->Parameter(i), graph()->start());
-    }
-  }
-
-  size_t parameter_count() const { return this->csig_->parameter_count(); }
-
- private:
-  Node* effect_;
-  Node* return_;
-  Node** parameters_;
-  MaybeHandle<Code> code_;
-};
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_CCTEST_COMPILER_GRAPH_BUILDER_TESTER_H_
diff --git a/src/v8/test/cctest/compiler/test-run-stubs.cc b/src/v8/test/cctest/compiler/test-run-stubs.cc
deleted file mode 100644
index 139db1e..0000000
--- a/src/v8/test/cctest/compiler/test-run-stubs.cc
+++ /dev/null
@@ -1,238 +0,0 @@
-// Copyright 2015 the V8 project 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 "src/bootstrapper.h"
-#include "src/callable.h"
-#include "src/code-stubs.h"
-#include "src/compilation-info.h"
-#include "src/compiler/common-operator.h"
-#include "src/compiler/graph.h"
-#include "src/compiler/js-graph.h"
-#include "src/compiler/js-operator.h"
-#include "src/compiler/linkage.h"
-#include "src/compiler/machine-operator.h"
-#include "src/compiler/pipeline.h"
-#include "src/objects-inl.h"
-#include "test/cctest/compiler/function-tester.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-class StubTester {
- public:
-  StubTester(Isolate* isolate, Zone* zone, CodeStub* stub)
-      : zone_(zone),
-        info_(ArrayVector("test"), zone, Code::STUB),
-        interface_descriptor_(stub->GetCallInterfaceDescriptor()),
-        descriptor_(Linkage::GetStubCallDescriptor(
-            isolate, zone, interface_descriptor_,
-            stub->GetStackParameterCount(), CallDescriptor::kNoFlags,
-            Operator::kNoProperties)),
-        graph_(zone_),
-        common_(zone_),
-        tester_(InitializeFunctionTester(stub->GetCode()),
-                GetParameterCountWithContext()) {}
-
-  StubTester(Isolate* isolate, Zone* zone, Builtins::Name name)
-      : zone_(zone),
-        info_(ArrayVector("test"), zone, Code::STUB),
-        interface_descriptor_(
-            Builtins::CallableFor(isolate, name).descriptor()),
-        descriptor_(Linkage::GetStubCallDescriptor(
-            isolate, zone, interface_descriptor_,
-            interface_descriptor_.GetStackParameterCount(),
-            CallDescriptor::kNoFlags, Operator::kNoProperties)),
-        graph_(zone_),
-        common_(zone_),
-        tester_(InitializeFunctionTester(
-                    Handle<Code>(isolate->builtins()->builtin(name))),
-                GetParameterCountWithContext()) {}
-
-  template <typename... Args>
-  Handle<Object> Call(Args... args) {
-    DCHECK_EQ(interface_descriptor_.GetParameterCount(), sizeof...(args));
-    MaybeHandle<Object> result =
-        tester_.Call(args..., Handle<HeapObject>(tester_.function->context()))
-            .ToHandleChecked();
-    return result.ToHandleChecked();
-  }
-
-  FunctionTester& ft() { return tester_; }
-
- private:
-  Graph* InitializeFunctionTester(Handle<Code> stub) {
-    // Add target, effect and control.
-    int node_count = GetParameterCountWithContext() + 3;
-    // Add extra inputs for the JSFunction parameter and the receiver (which for
-    // the tester is always undefined) to the start node.
-    Node* start =
-        graph_.NewNode(common_.Start(GetParameterCountWithContext() + 2));
-    Node** node_array = zone_->NewArray<Node*>(node_count);
-    node_array[0] = graph_.NewNode(common_.HeapConstant(stub));
-    for (int i = 0; i < GetParameterCountWithContext(); ++i) {
-      CHECK(IsAnyTagged(descriptor_->GetParameterType(i).representation()));
-      node_array[i + 1] = graph_.NewNode(common_.Parameter(i + 1), start);
-    }
-    node_array[node_count - 2] = start;
-    node_array[node_count - 1] = start;
-    Node* call =
-        graph_.NewNode(common_.Call(descriptor_), node_count, &node_array[0]);
-
-    Node* zero = graph_.NewNode(common_.Int32Constant(0));
-    Node* ret = graph_.NewNode(common_.Return(), zero, call, call, start);
-    Node* end = graph_.NewNode(common_.End(1), ret);
-    graph_.SetStart(start);
-    graph_.SetEnd(end);
-    return &graph_;
-  }
-
-  int GetParameterCountWithContext() {
-    return interface_descriptor_.GetParameterCount() + 1;
-  }
-
-  Zone* zone_;
-  CompilationInfo info_;
-  CallInterfaceDescriptor interface_descriptor_;
-  CallDescriptor* descriptor_;
-  Graph graph_;
-  CommonOperatorBuilder common_;
-  FunctionTester tester_;
-};
-
-TEST(RunStringWrapperLengthStub) {
-  HandleAndZoneScope scope;
-  Isolate* isolate = scope.main_isolate();
-  Zone* zone = scope.main_zone();
-
-  StubTester tester(isolate, zone, Builtins::kLoadIC_StringWrapperLength);
-
-  // Actuall call through to the stub, verifying its result.
-  const char* testString = "Und das Lamm schrie HURZ!";
-  Handle<Object> receiverArg =
-      Object::ToObject(isolate, tester.ft().Val(testString)).ToHandleChecked();
-  Handle<Object> nameArg = tester.ft().Val("length");
-  Handle<Object> slot = tester.ft().Val(0.0);
-  Handle<Object> vector = tester.ft().Val(0.0);
-  Handle<Object> result = tester.Call(receiverArg, nameArg, slot, vector);
-  CHECK_EQ(static_cast<int>(strlen(testString)), Smi::ToInt(*result));
-}
-
-TEST(RunArrayExtractStubSimple) {
-  HandleAndZoneScope scope;
-  Isolate* isolate = scope.main_isolate();
-  Zone* zone = scope.main_zone();
-
-  StubTester tester(isolate, zone, Builtins::kExtractFastJSArray);
-
-  // Actuall call through to the stub, verifying its result.
-  Handle<JSArray> source_array = isolate->factory()->NewJSArray(
-      PACKED_ELEMENTS, 5, 10, INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE);
-  static_cast<FixedArray*>(source_array->elements())->set(0, Smi::FromInt(5));
-  static_cast<FixedArray*>(source_array->elements())->set(1, Smi::FromInt(4));
-  static_cast<FixedArray*>(source_array->elements())->set(2, Smi::FromInt(3));
-  static_cast<FixedArray*>(source_array->elements())->set(3, Smi::FromInt(2));
-  static_cast<FixedArray*>(source_array->elements())->set(4, Smi::FromInt(1));
-  Handle<JSArray> result = Handle<JSArray>::cast(
-      tester.Call(source_array, Handle<Smi>(Smi::FromInt(0), isolate),
-                  Handle<Smi>(Smi::FromInt(5), isolate)));
-  CHECK_NE(*source_array, *result);
-  CHECK_EQ(result->GetElementsKind(), PACKED_ELEMENTS);
-  CHECK_EQ(static_cast<FixedArray*>(result->elements())->get(0),
-           Smi::FromInt(5));
-  CHECK_EQ(static_cast<FixedArray*>(result->elements())->get(1),
-           Smi::FromInt(4));
-  CHECK_EQ(static_cast<FixedArray*>(result->elements())->get(2),
-           Smi::FromInt(3));
-  CHECK_EQ(static_cast<FixedArray*>(result->elements())->get(3),
-           Smi::FromInt(2));
-  CHECK_EQ(static_cast<FixedArray*>(result->elements())->get(4),
-           Smi::FromInt(1));
-}
-
-TEST(RunArrayExtractDoubleStubSimple) {
-  HandleAndZoneScope scope;
-  Isolate* isolate = scope.main_isolate();
-  Zone* zone = scope.main_zone();
-
-  StubTester tester(isolate, zone, Builtins::kExtractFastJSArray);
-
-  // Actuall call through to the stub, verifying its result.
-  Handle<JSArray> source_array = isolate->factory()->NewJSArray(
-      PACKED_DOUBLE_ELEMENTS, 5, 10, INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE);
-  static_cast<FixedDoubleArray*>(source_array->elements())->set(0, 5);
-  static_cast<FixedDoubleArray*>(source_array->elements())->set(1, 4);
-  static_cast<FixedDoubleArray*>(source_array->elements())->set(2, 3);
-  static_cast<FixedDoubleArray*>(source_array->elements())->set(3, 2);
-  static_cast<FixedDoubleArray*>(source_array->elements())->set(4, 1);
-  Handle<JSArray> result = Handle<JSArray>::cast(
-      tester.Call(source_array, Handle<Smi>(Smi::FromInt(0), isolate),
-                  Handle<Smi>(Smi::FromInt(5), isolate)));
-  CHECK_NE(*source_array, *result);
-  CHECK_EQ(result->GetElementsKind(), PACKED_DOUBLE_ELEMENTS);
-  CHECK_EQ(static_cast<FixedDoubleArray*>(result->elements())->get_scalar(0),
-           5);
-  CHECK_EQ(static_cast<FixedDoubleArray*>(result->elements())->get_scalar(1),
-           4);
-  CHECK_EQ(static_cast<FixedDoubleArray*>(result->elements())->get_scalar(2),
-           3);
-  CHECK_EQ(static_cast<FixedDoubleArray*>(result->elements())->get_scalar(3),
-           2);
-  CHECK_EQ(static_cast<FixedDoubleArray*>(result->elements())->get_scalar(4),
-           1);
-}
-
-TEST(RunArrayExtractStubTooBigForNewSpace) {
-  HandleAndZoneScope scope;
-  Isolate* isolate = scope.main_isolate();
-  Zone* zone = scope.main_zone();
-
-  StubTester tester(isolate, zone, Builtins::kExtractFastJSArray);
-
-  // Actuall call through to the stub, verifying its result.
-  Handle<JSArray> source_array = isolate->factory()->NewJSArray(
-      PACKED_ELEMENTS, 500000, 500000, INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE);
-  for (int i = 0; i < 500000; ++i) {
-    static_cast<FixedArray*>(source_array->elements())->set(i, Smi::FromInt(i));
-  }
-  Handle<JSArray> result = Handle<JSArray>::cast(
-      tester.Call(source_array, Handle<Smi>(Smi::FromInt(0), isolate),
-                  Handle<Smi>(Smi::FromInt(500000), isolate)));
-  CHECK_NE(*source_array, *result);
-  CHECK_EQ(result->GetElementsKind(), PACKED_ELEMENTS);
-  for (int i = 0; i < 500000; ++i) {
-    CHECK_EQ(static_cast<FixedArray*>(source_array->elements())->get(i),
-             static_cast<FixedArray*>(result->elements())->get(i));
-  }
-}
-
-TEST(RunArrayExtractDoubleStubTooBigForNewSpace) {
-  HandleAndZoneScope scope;
-  Isolate* isolate = scope.main_isolate();
-  Zone* zone = scope.main_zone();
-
-  StubTester tester(isolate, zone, Builtins::kExtractFastJSArray);
-
-  // Actuall call through to the stub, verifying its result.
-  Handle<JSArray> source_array = isolate->factory()->NewJSArray(
-      PACKED_DOUBLE_ELEMENTS, 500000, 500000,
-      INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE, TENURED);
-  for (int i = 0; i < 500000; ++i) {
-    static_cast<FixedDoubleArray*>(source_array->elements())->set(i, i);
-  }
-  Handle<JSArray> result = Handle<JSArray>::cast(
-      tester.Call(source_array, Handle<Smi>(Smi::FromInt(0), isolate),
-                  Handle<Smi>(Smi::FromInt(500000), isolate)));
-  CHECK_NE(*source_array, *result);
-  CHECK_EQ(result->GetElementsKind(), PACKED_DOUBLE_ELEMENTS);
-  for (int i = 0; i < 500000; ++i) {
-    CHECK_EQ(
-        static_cast<FixedDoubleArray*>(source_array->elements())->get_scalar(i),
-        static_cast<FixedDoubleArray*>(result->elements())->get_scalar(i));
-  }
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/cctest/compiler/test-run-wasm-machops.cc b/src/v8/test/cctest/compiler/test-run-wasm-machops.cc
deleted file mode 100644
index 2f15364..0000000
--- a/src/v8/test/cctest/compiler/test-run-wasm-machops.cc
+++ /dev/null
@@ -1,201 +0,0 @@
-// Copyright 2016 the V8 project 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 <cmath>
-#include <functional>
-#include <limits>
-
-#include "src/base/bits.h"
-#include "src/base/utils/random-number-generator.h"
-#include "src/codegen.h"
-#include "src/objects-inl.h"
-#include "src/wasm/wasm-objects.h"
-#include "test/cctest/cctest.h"
-#include "test/cctest/compiler/codegen-tester.h"
-#include "test/cctest/compiler/graph-builder-tester.h"
-#include "test/cctest/compiler/value-helper.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-static void UpdateFunctionTableSizeReferences(Handle<Code> code,
-                                              uint32_t old_size,
-                                              uint32_t new_size) {
-  Isolate* isolate = CcTest::i_isolate();
-  // TODO(6792): No longer needed once WebAssembly code is off heap.
-  CodeSpaceMemoryModificationScope modification_scope(isolate->heap());
-  bool modified = false;
-  int mode_mask =
-      RelocInfo::ModeMask(RelocInfo::WASM_FUNCTION_TABLE_SIZE_REFERENCE);
-  for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) {
-    RelocInfo::Mode mode = it.rinfo()->rmode();
-    if (RelocInfo::IsWasmFunctionTableSizeReference(mode)) {
-      it.rinfo()->update_wasm_function_table_size_reference(isolate, old_size,
-                                                            new_size);
-      modified = true;
-    }
-  }
-  if (modified) {
-    Assembler::FlushICache(isolate, code->instruction_start(),
-                           code->instruction_size());
-  }
-}
-
-template <typename CType>
-static void RunLoadStoreRelocation(MachineType rep) {
-  const int kNumElems = 2;
-  CType buffer[kNumElems];
-  CType new_buffer[kNumElems];
-  byte* raw = reinterpret_cast<byte*>(buffer);
-  byte* new_raw = reinterpret_cast<byte*>(new_buffer);
-  WasmContext wasm_context;
-  wasm_context.SetRawMemory(raw, sizeof(buffer));
-  for (size_t i = 0; i < sizeof(buffer); i++) {
-    raw[i] = static_cast<byte>((i + sizeof(CType)) ^ 0xAA);
-    new_raw[i] = static_cast<byte>((i + sizeof(CType)) ^ 0xAA);
-  }
-  uint32_t OK = 0x29000;
-  RawMachineAssemblerTester<uint32_t> m;
-  Node* wasm_context_node =
-      m.RelocatableIntPtrConstant(reinterpret_cast<uintptr_t>(&wasm_context),
-                                  RelocInfo::WASM_CONTEXT_REFERENCE);
-  Node* offset = m.Int32Constant(offsetof(WasmContext, mem_start));
-  Node* base = m.Load(MachineType::UintPtr(), wasm_context_node, offset);
-  Node* base1 = m.IntPtrAdd(base, m.Int32Constant(sizeof(CType)));
-  Node* index = m.Int32Constant(0);
-  Node* load = m.Load(rep, base, index);
-  m.Store(rep.representation(), base1, index, load, kNoWriteBarrier);
-  m.Return(m.Int32Constant(OK));
-  CHECK(buffer[0] != buffer[1]);
-  CHECK_EQ(OK, m.Call());
-  CHECK(buffer[0] == buffer[1]);
-  wasm_context.SetRawMemory(new_raw, sizeof(new_buffer));
-  CHECK(new_buffer[0] != new_buffer[1]);
-  CHECK_EQ(OK, m.Call());
-  CHECK(new_buffer[0] == new_buffer[1]);
-}
-
-TEST(RunLoadStoreRelocation) {
-  RunLoadStoreRelocation<int8_t>(MachineType::Int8());
-  RunLoadStoreRelocation<uint8_t>(MachineType::Uint8());
-  RunLoadStoreRelocation<int16_t>(MachineType::Int16());
-  RunLoadStoreRelocation<uint16_t>(MachineType::Uint16());
-  RunLoadStoreRelocation<int32_t>(MachineType::Int32());
-  RunLoadStoreRelocation<uint32_t>(MachineType::Uint32());
-  RunLoadStoreRelocation<void*>(MachineType::AnyTagged());
-  RunLoadStoreRelocation<float>(MachineType::Float32());
-  RunLoadStoreRelocation<double>(MachineType::Float64());
-}
-
-template <typename CType>
-static void RunLoadStoreRelocationOffset(MachineType rep) {
-  RawMachineAssemblerTester<int32_t> r(MachineType::Int32());
-  const int kNumElems = 4;
-  CType buffer[kNumElems];
-  CType new_buffer[kNumElems + 1];
-  WasmContext wasm_context;
-
-  for (int32_t x = 0; x < kNumElems; x++) {
-    int32_t y = kNumElems - x - 1;
-    // initialize the buffer with raw data.
-    byte* raw = reinterpret_cast<byte*>(buffer);
-    wasm_context.SetRawMemory(raw, sizeof(buffer));
-    for (size_t i = 0; i < sizeof(buffer); i++) {
-      raw[i] = static_cast<byte>((i + sizeof(buffer)) ^ 0xAA);
-    }
-
-    RawMachineAssemblerTester<int32_t> m;
-    int32_t OK = 0x29000 + x;
-    Node* wasm_context_node =
-        m.RelocatableIntPtrConstant(reinterpret_cast<uintptr_t>(&wasm_context),
-                                    RelocInfo::WASM_CONTEXT_REFERENCE);
-    Node* offset = m.Int32Constant(offsetof(WasmContext, mem_start));
-    Node* base = m.Load(MachineType::UintPtr(), wasm_context_node, offset);
-    Node* index0 = m.IntPtrConstant(x * sizeof(buffer[0]));
-    Node* load = m.Load(rep, base, index0);
-    Node* index1 = m.IntPtrConstant(y * sizeof(buffer[0]));
-    m.Store(rep.representation(), base, index1, load, kNoWriteBarrier);
-    m.Return(m.Int32Constant(OK));
-
-    CHECK(buffer[x] != buffer[y]);
-    CHECK_EQ(OK, m.Call());
-    CHECK(buffer[x] == buffer[y]);
-
-    // Initialize new buffer and set old_buffer to 0
-    byte* new_raw = reinterpret_cast<byte*>(new_buffer);
-    for (size_t i = 0; i < sizeof(buffer); i++) {
-      raw[i] = 0;
-      new_raw[i] = static_cast<byte>((i + sizeof(buffer)) ^ 0xAA);
-    }
-
-    wasm_context.SetRawMemory(new_raw, sizeof(new_buffer));
-
-    CHECK(new_buffer[x] != new_buffer[y]);
-    CHECK_EQ(OK, m.Call());
-    CHECK(new_buffer[x] == new_buffer[y]);
-  }
-}
-
-TEST(RunLoadStoreRelocationOffset) {
-  RunLoadStoreRelocationOffset<int8_t>(MachineType::Int8());
-  RunLoadStoreRelocationOffset<uint8_t>(MachineType::Uint8());
-  RunLoadStoreRelocationOffset<int16_t>(MachineType::Int16());
-  RunLoadStoreRelocationOffset<uint16_t>(MachineType::Uint16());
-  RunLoadStoreRelocationOffset<int32_t>(MachineType::Int32());
-  RunLoadStoreRelocationOffset<uint32_t>(MachineType::Uint32());
-  RunLoadStoreRelocationOffset<void*>(MachineType::AnyTagged());
-  RunLoadStoreRelocationOffset<float>(MachineType::Float32());
-  RunLoadStoreRelocationOffset<double>(MachineType::Float64());
-}
-
-TEST(Uint32LessThanMemoryRelocation) {
-  RawMachineAssemblerTester<uint32_t> m;
-  RawMachineLabel within_bounds, out_of_bounds;
-  WasmContext wasm_context;
-  wasm_context.SetRawMemory(reinterpret_cast<void*>(1234), 0x200);
-  Node* index = m.Int32Constant(0x200);
-  Node* wasm_context_node =
-      m.RelocatableIntPtrConstant(reinterpret_cast<uintptr_t>(&wasm_context),
-                                  RelocInfo::WASM_CONTEXT_REFERENCE);
-  Node* offset = m.Int32Constant(offsetof(WasmContext, mem_size));
-  Node* limit = m.Load(MachineType::Uint32(), wasm_context_node, offset);
-  Node* cond = m.AddNode(m.machine()->Uint32LessThan(), index, limit);
-  m.Branch(cond, &within_bounds, &out_of_bounds);
-  m.Bind(&within_bounds);
-  m.Return(m.Int32Constant(0xACED));
-  m.Bind(&out_of_bounds);
-  m.Return(m.Int32Constant(0xDEADBEEF));
-  // Check that index is out of bounds with current size
-  CHECK_EQ(0xDEADBEEF, m.Call());
-  wasm_context.SetRawMemory(wasm_context.mem_start, 0x400);
-  // Check that after limit is increased, index is within bounds.
-  CHECK_EQ(0xACEDu, m.Call());
-}
-
-TEST(Uint32LessThanFunctionTableRelocation) {
-  RawMachineAssemblerTester<uint32_t> m;
-  RawMachineLabel within_bounds, out_of_bounds;
-  Node* index = m.Int32Constant(0x200);
-  Node* limit = m.RelocatableInt32Constant(
-      0x200, RelocInfo::WASM_FUNCTION_TABLE_SIZE_REFERENCE);
-  Node* cond = m.AddNode(m.machine()->Uint32LessThan(), index, limit);
-  m.Branch(cond, &within_bounds, &out_of_bounds);
-  m.Bind(&within_bounds);
-  m.Return(m.Int32Constant(0xACED));
-  m.Bind(&out_of_bounds);
-  m.Return(m.Int32Constant(0xDEADBEEF));
-  // Check that index is out of bounds with current size
-  CHECK_EQ(0xDEADBEEF, m.Call());
-  m.GenerateCode();
-
-  Handle<Code> code = m.GetCode();
-  UpdateFunctionTableSizeReferences(code, 0x200, 0x400);
-  // Check that after limit is increased, index is within bounds.
-  CHECK_EQ(0xACED, m.Call());
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/cctest/interpreter/bytecode_expectations/ClassFields.golden b/src/v8/test/cctest/interpreter/bytecode_expectations/ClassFields.golden
deleted file mode 100644
index b8b7710..0000000
--- a/src/v8/test/cctest/interpreter/bytecode_expectations/ClassFields.golden
+++ /dev/null
@@ -1,251 +0,0 @@
-#
-# Autogenerated by generate-bytecode-expectations.
-#
-
----
-wrap: yes
-public fields: yes
-
----
-snippet: "
-  {
-    class A {
-      a;
-      ['b'];
-    }
-  
-    class B {
-      a = 1;
-      ['b'] = this.a;
-    }
-    new A;
-    new B;
-  }
-"
-frame size: 10
-parameter count: 1
-bytecode array length: 129
-bytecodes: [
-  /*   30 E> */ B(StackCheck),
-                B(Ldar), R(closure),
-                B(CreateBlockContext), U8(0),
-                B(PushContext), R(4),
-                B(LdaTheHole),
-                B(StaCurrentContextSlot), U8(4),
-                B(LdaTheHole),
-                B(Star), R(8),
-                B(CreateClosure), U8(2), U8(0), U8(2),
-                B(Star), R(5),
-                B(LdaConstant), U8(1),
-                B(Star), R(6),
-                B(LdaConstant), U8(3),
-                B(StaCurrentContextSlot), U8(4),
-                B(Star), R(9),
-                B(Mov), R(5), R(7),
-                B(CallRuntime), U16(Runtime::kDefineClass), R(6), U8(4),
-                B(Star), R(6),
-                B(Mov), R(7), R(1),
-                B(CreateClosure), U8(4), U8(1), U8(2),
-                B(Star), R(7),
-                B(StaNamedProperty), R(5), U8(5), U8(2),
-                B(PopContext), R(4),
-                B(Mov), R(1), R(2),
-                B(Ldar), R(closure),
-  /*   38 E> */ B(CreateBlockContext), U8(6),
-                B(PushContext), R(4),
-                B(LdaTheHole),
-                B(StaCurrentContextSlot), U8(4),
-                B(LdaTheHole),
-                B(Star), R(8),
-                B(CreateClosure), U8(8), U8(4), U8(2),
-                B(Star), R(5),
-                B(LdaConstant), U8(7),
-                B(Star), R(6),
-                B(LdaConstant), U8(3),
-                B(StaCurrentContextSlot), U8(4),
-                B(Star), R(9),
-                B(Mov), R(5), R(7),
-                B(CallRuntime), U16(Runtime::kDefineClass), R(6), U8(4),
-                B(Star), R(6),
-                B(Mov), R(7), R(0),
-                B(CreateClosure), U8(9), U8(5), U8(2),
-                B(Star), R(7),
-                B(StaNamedProperty), R(5), U8(5), U8(6),
-                B(PopContext), R(4),
-                B(Mov), R(0), R(3),
-  /*  120 S> */ B(Ldar), R(1),
-  /*  120 E> */ B(Construct), R(1), R(0), U8(0), U8(8),
-  /*  129 S> */ B(Ldar), R(0),
-  /*  129 E> */ B(Construct), R(0), R(0), U8(0), U8(10),
-                B(LdaUndefined),
-  /*  138 S> */ B(Return),
-]
-constant pool: [
-  FIXED_ARRAY_TYPE,
-  FIXED_ARRAY_TYPE,
-  SHARED_FUNCTION_INFO_TYPE,
-  ONE_BYTE_INTERNALIZED_STRING_TYPE ["b"],
-  SHARED_FUNCTION_INFO_TYPE,
-  SYMBOL_TYPE,
-  FIXED_ARRAY_TYPE,
-  FIXED_ARRAY_TYPE,
-  SHARED_FUNCTION_INFO_TYPE,
-  SHARED_FUNCTION_INFO_TYPE,
-]
-handlers: [
-]
-
----
-snippet: "
-  {
-    class A extends class {} {
-      a;
-      ['b'];
-    }
-  
-    class B extends class {} {
-      a = 1;
-      ['b'] = this.a;
-      foo() { return 1; }
-      constructor() {
-        super();
-      }
-    }
-  
-    class C extends B {
-      a = 1;
-      ['b'] = this.a;
-      constructor() {
-        (() => super())();
-      }
-    }
-  
-    new A;
-    new B;
-    new C;
-  }
-"
-frame size: 15
-parameter count: 1
-bytecode array length: 244
-bytecodes: [
-  /*   30 E> */ B(StackCheck),
-                B(Ldar), R(closure),
-                B(CreateBlockContext), U8(0),
-                B(PushContext), R(6),
-                B(LdaTheHole),
-                B(StaCurrentContextSlot), U8(4),
-                B(LdaTheHole),
-                B(Star), R(14),
-                B(CreateClosure), U8(3), U8(0), U8(2),
-                B(Star), R(11),
-                B(LdaConstant), U8(2),
-                B(Star), R(12),
-                B(Mov), R(11), R(13),
-                B(CallRuntime), U16(Runtime::kDefineClass), R(12), U8(3),
-                B(Star), R(12),
-                B(CreateClosure), U8(4), U8(1), U8(2),
-                B(Star), R(7),
-                B(LdaConstant), U8(1),
-                B(Star), R(8),
-                B(LdaConstant), U8(5),
-                B(StaCurrentContextSlot), U8(4),
-                B(Star), R(11),
-                B(Mov), R(7), R(9),
-                B(Mov), R(13), R(10),
-                B(CallRuntime), U16(Runtime::kDefineClass), R(8), U8(4),
-                B(Star), R(8),
-                B(Mov), R(9), R(2),
-                B(CreateClosure), U8(6), U8(2), U8(2),
-                B(Star), R(9),
-                B(StaNamedProperty), R(7), U8(7), U8(3),
-                B(PopContext), R(6),
-                B(Mov), R(2), R(3),
-                B(Ldar), R(closure),
-  /*   38 E> */ B(CreateBlockContext), U8(8),
-                B(PushContext), R(6),
-                B(LdaTheHole),
-                B(StaCurrentContextSlot), U8(4),
-                B(LdaTheHole),
-                B(Star), R(14),
-                B(CreateClosure), U8(11), U8(5), U8(2),
-                B(Star), R(11),
-                B(LdaConstant), U8(10),
-                B(Star), R(12),
-                B(Mov), R(11), R(13),
-                B(CallRuntime), U16(Runtime::kDefineClass), R(12), U8(3),
-                B(Star), R(12),
-                B(CreateClosure), U8(12), U8(6), U8(2),
-                B(Star), R(7),
-                B(LdaConstant), U8(9),
-                B(Star), R(8),
-                B(LdaConstant), U8(5),
-                B(StaCurrentContextSlot), U8(4),
-                B(Star), R(11),
-                B(CreateClosure), U8(13), U8(7), U8(2),
-                B(Star), R(12),
-                B(Mov), R(7), R(9),
-                B(Mov), R(13), R(10),
-                B(CallRuntime), U16(Runtime::kDefineClass), R(8), U8(5),
-                B(Star), R(8),
-                B(Mov), R(9), R(1),
-                B(CreateClosure), U8(14), U8(8), U8(2),
-                B(Star), R(9),
-                B(StaNamedProperty), R(7), U8(7), U8(9),
-                B(PopContext), R(6),
-                B(Mov), R(1), R(4),
-                B(Ldar), R(closure),
-  /*   90 E> */ B(CreateBlockContext), U8(15),
-                B(PushContext), R(6),
-                B(LdaTheHole),
-                B(StaCurrentContextSlot), U8(4),
-  /*  236 E> */ B(CreateClosure), U8(17), U8(11), U8(2),
-                B(Star), R(7),
-                B(LdaConstant), U8(16),
-                B(Star), R(8),
-                B(LdaConstant), U8(5),
-                B(StaCurrentContextSlot), U8(4),
-                B(Star), R(11),
-                B(Mov), R(7), R(9),
-                B(Mov), R(1), R(10),
-                B(CallRuntime), U16(Runtime::kDefineClass), R(8), U8(4),
-                B(Star), R(8),
-                B(Mov), R(9), R(0),
-                B(CreateClosure), U8(18), U8(12), U8(2),
-                B(Star), R(9),
-                B(StaNamedProperty), R(7), U8(7), U8(13),
-                B(PopContext), R(6),
-                B(Mov), R(0), R(5),
-  /*  329 S> */ B(Ldar), R(2),
-  /*  329 E> */ B(Construct), R(2), R(0), U8(0), U8(15),
-  /*  338 S> */ B(Ldar), R(1),
-  /*  338 E> */ B(Construct), R(1), R(0), U8(0), U8(17),
-  /*  347 S> */ B(Ldar), R(0),
-  /*  347 E> */ B(Construct), R(0), R(0), U8(0), U8(19),
-                B(LdaUndefined),
-  /*  356 S> */ B(Return),
-]
-constant pool: [
-  FIXED_ARRAY_TYPE,
-  FIXED_ARRAY_TYPE,
-  FIXED_ARRAY_TYPE,
-  SHARED_FUNCTION_INFO_TYPE,
-  SHARED_FUNCTION_INFO_TYPE,
-  ONE_BYTE_INTERNALIZED_STRING_TYPE ["b"],
-  SHARED_FUNCTION_INFO_TYPE,
-  SYMBOL_TYPE,
-  FIXED_ARRAY_TYPE,
-  FIXED_ARRAY_TYPE,
-  FIXED_ARRAY_TYPE,
-  SHARED_FUNCTION_INFO_TYPE,
-  SHARED_FUNCTION_INFO_TYPE,
-  SHARED_FUNCTION_INFO_TYPE,
-  SHARED_FUNCTION_INFO_TYPE,
-  FIXED_ARRAY_TYPE,
-  FIXED_ARRAY_TYPE,
-  SHARED_FUNCTION_INFO_TYPE,
-  SHARED_FUNCTION_INFO_TYPE,
-]
-handlers: [
-]
-
diff --git a/src/v8/test/cctest/interpreter/bytecode_expectations/DoExpression.golden b/src/v8/test/cctest/interpreter/bytecode_expectations/DoExpression.golden
deleted file mode 100644
index 44912a7..0000000
--- a/src/v8/test/cctest/interpreter/bytecode_expectations/DoExpression.golden
+++ /dev/null
@@ -1,71 +0,0 @@
-#
-# Autogenerated by generate-bytecode-expectations.
-#
-
----
-wrap: yes
-do expressions: yes
-
----
-snippet: "
-  var a = do { }; return a;
-"
-frame size: 2
-parameter count: 1
-bytecode array length: 7
-bytecodes: [
-  /*   30 E> */ B(StackCheck),
-  /*   42 S> */ B(Mov), R(0), R(1),
-  /*   50 S> */ B(Ldar), R(1),
-  /*   59 S> */ B(Return),
-]
-constant pool: [
-]
-handlers: [
-]
-
----
-snippet: "
-  var a = do { var x = 100; }; return a;
-"
-frame size: 3
-parameter count: 1
-bytecode array length: 11
-bytecodes: [
-  /*   30 E> */ B(StackCheck),
-  /*   55 S> */ B(LdaSmi), I8(100),
-                B(Star), R(0),
-  /*   42 S> */ B(LdaUndefined),
-                B(Star), R(1),
-                B(Star), R(2),
-  /*   72 S> */ B(Return),
-]
-constant pool: [
-]
-handlers: [
-]
-
----
-snippet: "
-  while(true) { var a = 10; a = do { ++a; break; }; a = 20; }
-"
-frame size: 2
-parameter count: 1
-bytecode array length: 16
-bytecodes: [
-  /*   30 E> */ B(StackCheck),
-  /*   34 E> */ B(StackCheck),
-  /*   56 S> */ B(LdaSmi), I8(10),
-                B(Star), R(0),
-  /*   69 S> */ B(Inc), U8(0),
-                B(Star), R(0),
-                B(Star), R(1),
-  /*   74 S> */ B(Jump), U8(2),
-                B(LdaUndefined),
-  /*   94 S> */ B(Return),
-]
-constant pool: [
-]
-handlers: [
-]
-
diff --git a/src/v8/test/cctest/log-eq-of-logging-and-traversal.js b/src/v8/test/cctest/log-eq-of-logging-and-traversal.js
deleted file mode 100644
index cc3c818..0000000
--- a/src/v8/test/cctest/log-eq-of-logging-and-traversal.js
+++ /dev/null
@@ -1,201 +0,0 @@
-// Copyright 2011 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.
-
-// This is a supplementary file for test-log/EquivalenceOfLoggingAndTraversal.
-
-function parseState(s) {
-  switch (s) {
-  case "": return Profile.CodeState.COMPILED;
-  case "~": return Profile.CodeState.OPTIMIZABLE;
-  case "*": return Profile.CodeState.OPTIMIZED;
-  }
-  throw new Error("unknown code state: " + s);
-}
-
-function LogProcessor() {
-  LogReader.call(this, {
-      'code-creation': {
-          parsers: [null, parseInt, parseInt, parseInt, parseInt,
-                    null, 'var-args'],
-          processor: this.processCodeCreation },
-      'code-move': { parsers: [parseInt, parseInt],
-          processor: this.processCodeMove },
-      'code-delete': null,
-      'sfi-move': { parsers: [parseInt, parseInt],
-          processor: this.processFunctionMove },
-      'shared-library': null,
-      'profiler': null,
-      'tick': null });
-  this.profile = new Profile();
-
-}
-LogProcessor.prototype.__proto__ = LogReader.prototype;
-
-LogProcessor.prototype.processCodeCreation = function(
-    type, kind, timestamp, start, size, name, maybe_func) {
-  if (type != "LazyCompile" && type != "Script" && type != "Function") {
-    return;
-  }
-  // Scripts will compile into anonymous functions starting at 1:1. Adjust the
-  // name here so that it matches corrsponding function's name during the heap
-  // traversal.
-  if (type == "Script") name = " :1:1";
-  // Discard types to avoid discrepancies in "LazyCompile" vs. "Function".
-  type = "";
-  if (maybe_func.length) {
-    var funcAddr = parseInt(maybe_func[0]);
-    var state = parseState(maybe_func[1]);
-    this.profile.addFuncCode(type, name, timestamp, start, size, funcAddr, state);
-  } else {
-    this.profile.addCode(type, name, timestamp, start, size);
-  }
-};
-
-LogProcessor.prototype.processCodeMove = function(from, to) {
-  this.profile.moveCode(from, to);
-};
-
-LogProcessor.prototype.processFunctionMove = function(from, to) {
-  this.profile.moveFunc(from, to);
-};
-
-function RunTest() {
-  // _log must be provided externally.
-  var log_lines = _log.split("\n");
-  var line, pos = 0, log_lines_length = log_lines.length;
-  if (log_lines_length < 2)
-    return "log_lines_length < 2";
-  var logging_processor = new LogProcessor();
-  for ( ; pos < log_lines_length; ++pos) {
-    line = log_lines[pos];
-    if (line === "test-logging-done,\"\"") {
-      ++pos;
-      break;
-    }
-    logging_processor.processLogLine(line);
-  }
-  logging_processor.profile.cleanUpFuncEntries();
-  var logging_entries =
-    logging_processor.profile.codeMap_.getAllDynamicEntriesWithAddresses();
-  if (logging_entries.length === 0)
-    return "logging_entries.length === 0";
-
-  var traversal_processor = new LogProcessor();
-  for ( ; pos < log_lines_length; ++pos) {
-    line = log_lines[pos];
-    if (line === "test-traversal-done,\"\"") break;
-    traversal_processor.processLogLine(line);
-  }
-  var traversal_entries =
-    traversal_processor.profile.codeMap_.getAllDynamicEntriesWithAddresses();
-  if (traversal_entries.length === 0)
-    return "traversal_entries.length === 0";
-
-  function addressComparator(entryA, entryB) {
-    return entryA[0] < entryB[0] ? -1 : (entryA[0] > entryB[0] ? 1 : 0);
-  }
-
-  logging_entries.sort(addressComparator);
-  traversal_entries.sort(addressComparator);
-
-  function entityNamesEqual(entityA, entityB) {
-    if ("getRawName" in entityB &&
-        entityNamesEqual.builtins.indexOf(entityB.getRawName()) !== -1) {
-      return true;
-    }
-    if (entityNamesEqual.builtins.indexOf(entityB.getName()) !== -1) return true;
-    return entityA.getName() === entityB.getName();
-  }
-  entityNamesEqual.builtins =
-    ["Boolean", "Function", "Number", "Object",
-     "Script", "String", "RegExp", "Date", "Error"];
-
-  function entitiesEqual(entityA, entityB) {
-    if ((entityA === null && entityB !== null) ||
-      (entityA !== null && entityB === null)) return true;
-    return entityA.size === entityB.size && entityNamesEqual(entityA, entityB);
-  }
-
-  var l_pos = 0, t_pos = 0;
-  var l_len = logging_entries.length, t_len = traversal_entries.length;
-  var comparison = [];
-  var equal = true;
-  // Do a merge-like comparison of entries. At the same address we expect to
-  // find the same entries. We skip builtins during log parsing, but compiled
-  // functions traversal may erroneously recognize them as functions, so we are
-  // expecting more functions in traversal vs. logging.
-  // Since we don't track code deletions, logging can also report more entries
-  // than traversal.
-  while (l_pos < l_len && t_pos < t_len) {
-    var entryA = logging_entries[l_pos];
-    var entryB = traversal_entries[t_pos];
-    var cmp = addressComparator(entryA, entryB);
-    var entityA = entryA[1], entityB = entryB[1];
-    var address = entryA[0];
-    if (cmp < 0) {
-      ++l_pos;
-      entityB = null;
-    } else if (cmp > 0) {
-      ++t_pos;
-      entityA = null;
-      address = entryB[0];
-    } else {
-      ++l_pos;
-      ++t_pos;
-    }
-    var entities_equal = entitiesEqual(entityA, entityB);
-    if (!entities_equal) equal = false;
-    comparison.push([entities_equal, address, entityA, entityB]);
-  }
-  return [equal, comparison];
-}
-
-
-var result = RunTest();
-if (typeof result !== "string") {
-  var out = [];
-  if (!result[0]) {
-    var comparison = result[1];
-    for (var i = 0, l = comparison.length; i < l; ++i) {
-      var c = comparison[i];
-      out.push((c[0] ? "  " : "* ") +
-               c[1].toString(16) + " " +
-               (c[2] ? c[2] : "---") + " " +
-               (c[3] ? c[3] : "---"));
-    }
-    out.push("================================================")
-    out.push("MAKE SURE TO USE A CLEAN ISOLATiE!");
-    out.push("Use tools/test.py");
-    out.push("================================================")
-    out.push("*   Lines are the same");
-    out.push("--- Line is missing"
-    out.push("================================================")
-  }
-  result[0] ? true : out.join("\n");
-} else {
-  result;
-}
diff --git a/src/v8/test/cctest/test-code-stubs-arm.cc b/src/v8/test/cctest/test-code-stubs-arm.cc
deleted file mode 100644
index d042ea6..0000000
--- a/src/v8/test/cctest/test-code-stubs-arm.cc
+++ /dev/null
@@ -1,166 +0,0 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Rrdistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Rrdistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Rrdistributions 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.
-
-#include <stdlib.h>
-
-#include "src/assembler-inl.h"
-#include "src/base/platform/platform.h"
-#include "src/code-stubs.h"
-#include "src/factory.h"
-#include "src/macro-assembler.h"
-#include "src/objects-inl.h"
-#include "src/simulator.h"
-#include "src/v8.h"
-#include "test/cctest/cctest.h"
-#include "test/cctest/test-code-stubs.h"
-
-namespace v8 {
-namespace internal {
-
-#define __ masm.
-
-ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate,
-                                              Register destination_reg) {
-  HandleScope handles(isolate);
-
-  size_t allocated;
-  byte* buffer = AllocateAssemblerBuffer(&allocated);
-  MacroAssembler masm(isolate, buffer, static_cast<int>(allocated),
-                      v8::internal::CodeObjectRequired::kYes);
-
-  DoubleToIStub stub(isolate, destination_reg);
-
-  byte* start = stub.GetCode()->instruction_start();
-
-  // Save callee save registers.
-  __ Push(r7, r6, r5, r4);
-  __ Push(lr);
-
-  // For softfp, move the input value into d0.
-  if (!masm.use_eabi_hardfloat()) {
-    __ vmov(d0, r0, r1);
-  }
-  // Push the double argument.
-  __ sub(sp, sp, Operand(kDoubleSize));
-  __ vstr(d0, sp, 0);
-
-  // Save registers make sure they don't get clobbered.
-  int source_reg_offset = kDoubleSize;
-  int reg_num = 0;
-  for (; reg_num < Register::kNumRegisters; ++reg_num) {
-    if (RegisterConfiguration::Default()->IsAllocatableGeneralCode(reg_num)) {
-      Register reg = Register::from_code(reg_num);
-      if (reg != destination_reg) {
-        __ push(reg);
-        source_reg_offset += kPointerSize;
-      }
-    }
-  }
-
-  // Re-push the double argument.
-  __ sub(sp, sp, Operand(kDoubleSize));
-  __ vstr(d0, sp, 0);
-
-  // Call through to the actual stub
-  __ Call(start, RelocInfo::EXTERNAL_REFERENCE);
-
-  __ add(sp, sp, Operand(kDoubleSize));
-
-  // Make sure no registers have been unexpectedly clobbered
-  for (--reg_num; reg_num >= 0; --reg_num) {
-    if (RegisterConfiguration::Default()->IsAllocatableGeneralCode(reg_num)) {
-      Register reg = Register::from_code(reg_num);
-      if (reg != destination_reg) {
-        __ ldr(ip, MemOperand(sp, 0));
-        __ cmp(reg, ip);
-        __ Assert(eq, AbortReason::kRegisterWasClobbered);
-        __ add(sp, sp, Operand(kPointerSize));
-      }
-    }
-  }
-
-  __ add(sp, sp, Operand(kDoubleSize));
-
-  if (destination_reg != r0) __ mov(r0, destination_reg);
-
-  // Restore callee save registers.
-  __ Pop(lr);
-  __ Pop(r7, r6, r5, r4);
-
-  __ Ret(0);
-
-  CodeDesc desc;
-  masm.GetCode(isolate, &desc);
-  MakeAssemblerBufferExecutable(buffer, allocated);
-  Assembler::FlushICache(isolate, buffer, allocated);
-  return (reinterpret_cast<ConvertDToIFunc>(
-      reinterpret_cast<intptr_t>(buffer)));
-}
-
-#undef __
-
-
-static Isolate* GetIsolateFrom(LocalContext* context) {
-  return reinterpret_cast<Isolate*>((*context)->GetIsolate());
-}
-
-
-int32_t RunGeneratedCodeCallWrapper(ConvertDToIFunc func,
-                                    double from) {
-#ifdef USE_SIMULATOR
-  return Simulator::current(CcTest::i_isolate())
-      ->CallFP<int32_t>(FUNCTION_ADDR(func), from, 0);
-#else
-  return (*func)(from);
-#endif
-}
-
-
-TEST(ConvertDToI) {
-  CcTest::InitializeVM();
-  LocalContext context;
-  Isolate* isolate = GetIsolateFrom(&context);
-  HandleScope scope(isolate);
-
-#if DEBUG
-  // Verify that the tests actually work with the C version. In the release
-  // code, the compiler optimizes it away because it's all constant, but does it
-  // wrong, triggering an assert on gcc.
-  RunAllTruncationTests(&ConvertDToICVersion);
-#endif
-
-  Register dest_registers[] = {r0, r1, r2, r3, r4, r5, r6, r7};
-
-  for (size_t d = 0; d < sizeof(dest_registers) / sizeof(Register); d++) {
-    RunAllTruncationTests(
-        RunGeneratedCodeCallWrapper,
-        MakeConvertDToIFuncTrampoline(isolate, dest_registers[d]));
-  }
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/cctest/test-code-stubs-arm64.cc b/src/v8/test/cctest/test-code-stubs-arm64.cc
deleted file mode 100644
index 1086bea..0000000
--- a/src/v8/test/cctest/test-code-stubs-arm64.cc
+++ /dev/null
@@ -1,181 +0,0 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Rrdistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Rrdistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Rrdistributions 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.
-
-#include <stdlib.h>
-
-#include "src/v8.h"
-
-#include "src/arm64/macro-assembler-arm64-inl.h"
-#include "src/base/platform/platform.h"
-#include "src/code-stubs.h"
-#include "src/factory.h"
-#include "src/macro-assembler.h"
-#include "src/simulator.h"
-#include "test/cctest/cctest.h"
-#include "test/cctest/test-code-stubs.h"
-
-namespace v8 {
-namespace internal {
-
-#define __ masm.
-
-ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate,
-                                              Register destination_reg) {
-  HandleScope handles(isolate);
-
-  size_t allocated;
-  byte* buffer =
-      AllocateAssemblerBuffer(&allocated, 4 * Assembler::kMinimalBufferSize);
-  MacroAssembler masm(isolate, buffer, static_cast<int>(allocated),
-                      v8::internal::CodeObjectRequired::kYes);
-
-  DoubleToIStub stub(isolate, destination_reg);
-
-  byte* start = stub.GetCode()->instruction_start();
-
-  __ PushCalleeSavedRegisters();
-
-  MacroAssembler::PushPopQueue queue(&masm);
-
-  // Save registers make sure they don't get clobbered.
-  int source_reg_offset = kDoubleSize;
-  int reg_num = 0;
-  queue.Queue(xzr);  // Push xzr to maintain sp alignment.
-  for (; reg_num < Register::kNumRegisters; ++reg_num) {
-    if (RegisterConfiguration::Default()->IsAllocatableGeneralCode(reg_num)) {
-      Register reg = Register::from_code(reg_num);
-      queue.Queue(reg);
-      source_reg_offset += kPointerSize;
-    }
-  }
-  // Push the double argument. We push a second copy to maintain sp alignment.
-  queue.Queue(d0);
-  queue.Queue(d0);
-
-  queue.PushQueued();
-
-  // Call through to the actual stub.
-  __ Call(start, RelocInfo::EXTERNAL_REFERENCE);
-
-  __ Drop(2, kDoubleSize);
-
-  // Make sure no registers have been unexpectedly clobbered.
-  {
-    const RegisterConfiguration* config(RegisterConfiguration::Default());
-    int allocatable_register_count =
-        config->num_allocatable_general_registers();
-    UseScratchRegisterScope temps(&masm);
-    Register temp0 = temps.AcquireX();
-    Register temp1 = temps.AcquireX();
-    for (int i = allocatable_register_count - 1; i > 0; i -= 2) {
-      int code0 = config->GetAllocatableGeneralCode(i);
-      int code1 = config->GetAllocatableGeneralCode(i - 1);
-      Register reg0 = Register::from_code(code0);
-      Register reg1 = Register::from_code(code1);
-      __ Pop(temp0, temp1);
-      if (!reg0.is(destination_reg)) {
-        __ Cmp(reg0, temp0);
-        __ Assert(eq, AbortReason::kRegisterWasClobbered);
-      }
-      if (!reg1.is(destination_reg)) {
-        __ Cmp(reg1, temp1);
-        __ Assert(eq, AbortReason::kRegisterWasClobbered);
-      }
-    }
-
-    if (allocatable_register_count % 2 != 0) {
-      int code = config->GetAllocatableGeneralCode(0);
-      Register reg = Register::from_code(code);
-      __ Pop(temp0, xzr);
-      if (!reg.is(destination_reg)) {
-        __ Cmp(reg, temp0);
-        __ Assert(eq, AbortReason::kRegisterWasClobbered);
-      }
-    }
-  }
-
-  if (!destination_reg.is(x0))
-    __ Mov(x0, destination_reg);
-
-  // Restore callee save registers.
-  __ PopCalleeSavedRegisters();
-
-  __ Ret();
-
-  CodeDesc desc;
-  masm.GetCode(isolate, &desc);
-  MakeAssemblerBufferExecutable(buffer, allocated);
-  Assembler::FlushICache(isolate, buffer, allocated);
-  return (reinterpret_cast<ConvertDToIFunc>(
-      reinterpret_cast<intptr_t>(buffer)));
-}
-
-#undef __
-
-
-static Isolate* GetIsolateFrom(LocalContext* context) {
-  return reinterpret_cast<Isolate*>((*context)->GetIsolate());
-}
-
-
-int32_t RunGeneratedCodeCallWrapper(ConvertDToIFunc func,
-                                    double from) {
-#ifdef USE_SIMULATOR
-  return Simulator::current(CcTest::i_isolate())
-      ->Call<int32_t>(FUNCTION_ADDR(func), from);
-#else
-  return (*func)(from);
-#endif
-}
-
-
-TEST(ConvertDToI) {
-  CcTest::InitializeVM();
-  LocalContext context;
-  Isolate* isolate = GetIsolateFrom(&context);
-  HandleScope scope(isolate);
-
-#if DEBUG
-  // Verify that the tests actually work with the C version. In the release
-  // code, the compiler optimizes it away because it's all constant, but does it
-  // wrong, triggering an assert on gcc.
-  RunAllTruncationTests(&ConvertDToICVersion);
-#endif
-
-  Register dest_registers[] = {x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11,
-                               x12, x13, x14, x15, x18, x19, x20, x21, x22, x23,
-                               x24};
-
-  for (size_t d = 0; d < sizeof(dest_registers) / sizeof(Register); d++) {
-    RunAllTruncationTests(
-        RunGeneratedCodeCallWrapper,
-        MakeConvertDToIFuncTrampoline(isolate, dest_registers[d]));
-  }
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/cctest/test-code-stubs-ia32.cc b/src/v8/test/cctest/test-code-stubs-ia32.cc
deleted file mode 100644
index 7e62ab8..0000000
--- a/src/v8/test/cctest/test-code-stubs-ia32.cc
+++ /dev/null
@@ -1,146 +0,0 @@
-// Copyright 2013 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.
-
-#include <stdlib.h>
-
-#include <limits>
-
-#include "src/v8.h"
-
-#include "src/base/platform/platform.h"
-#include "src/code-stubs.h"
-#include "src/factory.h"
-#include "src/macro-assembler.h"
-#include "src/objects-inl.h"
-#include "test/cctest/cctest.h"
-#include "test/cctest/test-code-stubs.h"
-
-namespace v8 {
-namespace internal {
-
-#define __ masm.
-
-ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate,
-                                              Register destination_reg) {
-  HandleScope handles(isolate);
-
-  size_t allocated;
-  byte* buffer = AllocateAssemblerBuffer(&allocated);
-  MacroAssembler masm(isolate, buffer, static_cast<int>(allocated),
-                      v8::internal::CodeObjectRequired::kYes);
-
-  DoubleToIStub stub(isolate, destination_reg);
-  byte* start = stub.GetCode()->instruction_start();
-
-  __ push(ebx);
-  __ push(ecx);
-  __ push(edx);
-  __ push(esi);
-  __ push(edi);
-
-  int param_offset = 7 * kPointerSize;
-  // Save registers make sure they don't get clobbered.
-  int reg_num = 0;
-  for (; reg_num < Register::kNumRegisters; ++reg_num) {
-    if (RegisterConfiguration::Default()->IsAllocatableGeneralCode(reg_num)) {
-      Register reg = Register::from_code(reg_num);
-      if (reg != esp && reg != ebp && reg != destination_reg) {
-        __ push(reg);
-        param_offset += kPointerSize;
-      }
-    }
-  }
-
-  // Re-push the double argument
-  __ push(MemOperand(esp, param_offset));
-  __ push(MemOperand(esp, param_offset));
-
-  // Call through to the actual stub
-  __ call(start, RelocInfo::EXTERNAL_REFERENCE);
-
-  __ add(esp, Immediate(kDoubleSize));
-
-  // Make sure no registers have been unexpectedly clobbered
-  for (--reg_num; reg_num >= 0; --reg_num) {
-    if (RegisterConfiguration::Default()->IsAllocatableGeneralCode(reg_num)) {
-      Register reg = Register::from_code(reg_num);
-      if (reg != esp && reg != ebp && reg != destination_reg) {
-        __ cmp(reg, MemOperand(esp, 0));
-        __ Assert(equal, AbortReason::kRegisterWasClobbered);
-        __ add(esp, Immediate(kPointerSize));
-      }
-    }
-  }
-
-  __ mov(eax, destination_reg);
-
-  __ pop(edi);
-  __ pop(esi);
-  __ pop(edx);
-  __ pop(ecx);
-  __ pop(ebx);
-
-  __ ret(kDoubleSize);
-
-  CodeDesc desc;
-  masm.GetCode(isolate, &desc);
-  MakeAssemblerBufferExecutable(buffer, allocated);
-  return reinterpret_cast<ConvertDToIFunc>(
-      reinterpret_cast<intptr_t>(buffer));
-}
-
-#undef __
-
-
-static Isolate* GetIsolateFrom(LocalContext* context) {
-  return reinterpret_cast<Isolate*>((*context)->GetIsolate());
-}
-
-
-TEST(ConvertDToI) {
-  CcTest::InitializeVM();
-  LocalContext context;
-  Isolate* isolate = GetIsolateFrom(&context);
-  HandleScope scope(isolate);
-
-#if DEBUG
-  // Verify that the tests actually work with the C version. In the release
-  // code, the compiler optimizes it away because it's all constant, but does it
-  // wrong, triggering an assert on gcc.
-  RunAllTruncationTests(&ConvertDToICVersion);
-#endif
-
-  Register dest_registers[] = {eax, ebx, ecx, edx, edi, esi};
-
-  for (size_t d = 0; d < sizeof(dest_registers) / sizeof(Register); d++) {
-    RunAllTruncationTests(
-        MakeConvertDToIFuncTrampoline(isolate, dest_registers[d]));
-  }
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/cctest/test-code-stubs-mips.cc b/src/v8/test/cctest/test-code-stubs-mips.cc
deleted file mode 100644
index b1df94f..0000000
--- a/src/v8/test/cctest/test-code-stubs-mips.cc
+++ /dev/null
@@ -1,181 +0,0 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Rrdistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Rrdistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Rrdistributions 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.
-
-#include <stdlib.h>
-
-#include "src/v8.h"
-
-#include "src/base/platform/platform.h"
-#include "src/code-stubs.h"
-#include "src/factory.h"
-#include "src/macro-assembler.h"
-#include "src/mips/constants-mips.h"
-#include "src/objects-inl.h"
-#include "src/register-configuration.h"
-#include "src/simulator.h"
-#include "test/cctest/cctest.h"
-#include "test/cctest/test-code-stubs.h"
-
-namespace v8 {
-namespace internal {
-
-#define __ masm.
-
-ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate,
-                                              Register destination_reg) {
-  HandleScope handles(isolate);
-
-  size_t allocated;
-  byte* buffer = AllocateAssemblerBuffer(&allocated);
-  MacroAssembler masm(isolate, buffer, static_cast<int>(allocated),
-                      v8::internal::CodeObjectRequired::kYes);
-
-  DoubleToIStub stub(isolate, destination_reg);
-
-  byte* start = stub.GetCode()->instruction_start();
-
-  // Save callee save registers.
-  __ MultiPush(kCalleeSaved | ra.bit());
-
-  // Save callee-saved FPU registers.
-  __ MultiPushFPU(kCalleeSavedFPU);
-  // Set up the reserved register for 0.0.
-  __ Move(kDoubleRegZero, 0.0);
-
-  // For softfp, move the input value into f12.
-  if (IsMipsSoftFloatABI) {
-    __ Move(f12, a0, a1);
-  }
-  // Push the double argument.
-  __ Subu(sp, sp, Operand(kDoubleSize));
-  __ Sdc1(f12, MemOperand(sp));
-
-  // Save registers make sure they don't get clobbered.
-  int source_reg_offset = kDoubleSize;
-  int reg_num = 2;
-  for (; reg_num < Register::kNumRegisters; ++reg_num) {
-    if (RegisterConfiguration::Default()->IsAllocatableGeneralCode(reg_num)) {
-      Register reg = Register::from_code(reg_num);
-      if (reg != destination_reg) {
-        __ push(reg);
-        source_reg_offset += kPointerSize;
-      }
-    }
-  }
-
-  // Re-push the double argument.
-  __ Subu(sp, sp, Operand(kDoubleSize));
-  __ Sdc1(f12, MemOperand(sp));
-
-  // Call through to the actual stub
-  __ Call(start, RelocInfo::EXTERNAL_REFERENCE);
-
-  __ Addu(sp, sp, Operand(kDoubleSize));
-
-  // Make sure no registers have been unexpectedly clobbered
-  for (--reg_num; reg_num >= 2; --reg_num) {
-    if (RegisterConfiguration::Default()->IsAllocatableGeneralCode(reg_num)) {
-      Register reg = Register::from_code(reg_num);
-      if (reg != destination_reg) {
-        __ lw(at, MemOperand(sp, 0));
-        __ Assert(eq, AbortReason::kRegisterWasClobbered, reg, Operand(at));
-        __ Addu(sp, sp, Operand(kPointerSize));
-      }
-    }
-  }
-
-  __ Addu(sp, sp, Operand(kDoubleSize));
-
-  __ Move(v0, destination_reg);
-  Label ok;
-  __ Branch(&ok, eq, v0, Operand(zero_reg));
-  __ bind(&ok);
-
-  // Restore callee-saved FPU registers.
-  __ MultiPopFPU(kCalleeSavedFPU);
-
-  // Restore callee save registers.
-  __ MultiPop(kCalleeSaved | ra.bit());
-
-  Label ok1;
-  __ Branch(&ok1, eq, v0, Operand(zero_reg));
-  __ bind(&ok1);
-  __ Ret();
-
-  CodeDesc desc;
-  masm.GetCode(isolate, &desc);
-  MakeAssemblerBufferExecutable(buffer, allocated);
-  Assembler::FlushICache(isolate, buffer, allocated);
-  return (reinterpret_cast<ConvertDToIFunc>(
-      reinterpret_cast<intptr_t>(buffer)));
-}
-
-#undef __
-
-
-static Isolate* GetIsolateFrom(LocalContext* context) {
-  return reinterpret_cast<Isolate*>((*context)->GetIsolate());
-}
-
-
-int32_t RunGeneratedCodeCallWrapper(ConvertDToIFunc func,
-                                    double from) {
-#ifdef USE_SIMULATOR
-  Simulator::current(CcTest::i_isolate())
-      ->CallFP(FUNCTION_ADDR(func), from, 0.);
-  return Simulator::current(CcTest::i_isolate())->get_register(v0.code());
-#else
-  return (*func)(from);
-#endif
-}
-
-
-TEST(ConvertDToI) {
-  CcTest::InitializeVM();
-  LocalContext context;
-  Isolate* isolate = GetIsolateFrom(&context);
-  HandleScope scope(isolate);
-
-#if DEBUG
-  // Verify that the tests actually work with the C version. In the release
-  // code, the compiler optimizes it away because it's all constant, but does it
-  // wrong, triggering an assert on gcc.
-  RunAllTruncationTests(&ConvertDToICVersion);
-#endif
-
-  Register dest_registers[] = {
-      v0, v1, a0, a1, a2, a3, t0, t1, t2, t3, t4, t5};
-
-  for (size_t d = 0; d < sizeof(dest_registers) / sizeof(Register); d++) {
-    RunAllTruncationTests(
-        RunGeneratedCodeCallWrapper,
-        MakeConvertDToIFuncTrampoline(isolate, dest_registers[d]));
-  }
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/cctest/test-code-stubs-mips64.cc b/src/v8/test/cctest/test-code-stubs-mips64.cc
deleted file mode 100644
index c09dac2..0000000
--- a/src/v8/test/cctest/test-code-stubs-mips64.cc
+++ /dev/null
@@ -1,179 +0,0 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Rrdistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Rrdistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Rrdistributions 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.
-
-#include <stdlib.h>
-
-#include "src/v8.h"
-
-#include "src/base/platform/platform.h"
-#include "src/code-stubs.h"
-#include "src/factory.h"
-#include "src/macro-assembler.h"
-#include "src/mips64/constants-mips64.h"
-#include "src/objects-inl.h"
-#include "src/register-configuration.h"
-#include "src/simulator.h"
-#include "test/cctest/cctest.h"
-#include "test/cctest/test-code-stubs.h"
-
-namespace v8 {
-namespace internal {
-
-#define __ masm.
-
-ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate,
-                                              Register destination_reg) {
-  HandleScope handles(isolate);
-
-  size_t allocated;
-  byte* buffer = AllocateAssemblerBuffer(&allocated);
-  MacroAssembler masm(isolate, buffer, static_cast<int>(allocated),
-                      v8::internal::CodeObjectRequired::kYes);
-
-  DoubleToIStub stub(isolate, destination_reg);
-
-  byte* start = stub.GetCode()->instruction_start();
-
-  // Save callee save registers.
-  __ MultiPush(kCalleeSaved | ra.bit());
-
-  // Save callee-saved FPU registers.
-  __ MultiPushFPU(kCalleeSavedFPU);
-  // Set up the reserved register for 0.0.
-  __ Move(kDoubleRegZero, 0.0);
-
-  // For softfp, move the input value into f12.
-  if (IsMipsSoftFloatABI) {
-    __ Move(f12, a0, a1);
-  }
-  // Push the double argument.
-  __ Dsubu(sp, sp, Operand(kDoubleSize));
-  __ Sdc1(f12, MemOperand(sp));
-
-  // Save registers make sure they don't get clobbered.
-  int source_reg_offset = kDoubleSize;
-  int reg_num = 2;
-  const RegisterConfiguration* config = RegisterConfiguration::Default();
-  for (; reg_num < config->num_allocatable_general_registers(); ++reg_num) {
-    Register reg = Register::from_code(reg_num);
-    if (reg != destination_reg) {
-      __ push(reg);
-      source_reg_offset += kPointerSize;
-    }
-  }
-
-  // Re-push the double argument.
-  __ Dsubu(sp, sp, Operand(kDoubleSize));
-  __ Sdc1(f12, MemOperand(sp));
-
-  // Call through to the actual stub
-  __ Call(start, RelocInfo::EXTERNAL_REFERENCE);
-
-  __ Daddu(sp, sp, Operand(kDoubleSize));
-
-  // Make sure no registers have been unexpectedly clobbered
-  for (--reg_num; reg_num >= 2; --reg_num) {
-    Register reg = Register::from_code(reg_num);
-    if (reg != destination_reg) {
-      __ Ld(at, MemOperand(sp, 0));
-      __ Assert(eq, AbortReason::kRegisterWasClobbered, reg, Operand(at));
-      __ Daddu(sp, sp, Operand(kPointerSize));
-    }
-  }
-
-  __ Daddu(sp, sp, Operand(kDoubleSize));
-
-  __ Move(v0, destination_reg);
-  Label ok;
-  __ Branch(&ok, eq, v0, Operand(zero_reg));
-  __ bind(&ok);
-
-  // Restore callee-saved FPU registers.
-  __ MultiPopFPU(kCalleeSavedFPU);
-
-  // Restore callee save registers.
-  __ MultiPop(kCalleeSaved | ra.bit());
-
-  Label ok1;
-  __ Branch(&ok1, eq, v0, Operand(zero_reg));
-  __ bind(&ok1);
-  __ Ret();
-
-  CodeDesc desc;
-  masm.GetCode(isolate, &desc);
-  MakeAssemblerBufferExecutable(buffer, allocated);
-  Assembler::FlushICache(isolate, buffer, allocated);
-  return (reinterpret_cast<ConvertDToIFunc>(
-      reinterpret_cast<intptr_t>(buffer)));
-}
-
-#undef __
-
-
-static Isolate* GetIsolateFrom(LocalContext* context) {
-  return reinterpret_cast<Isolate*>((*context)->GetIsolate());
-}
-
-
-int32_t RunGeneratedCodeCallWrapper(ConvertDToIFunc func,
-                                    double from) {
-#ifdef USE_SIMULATOR
-  Simulator::current(CcTest::i_isolate())
-      ->CallFP(FUNCTION_ADDR(func), from, 0.);
-  return static_cast<int32_t>(
-      Simulator::current(CcTest::i_isolate())->get_register(v0.code()));
-#else
-  return (*func)(from);
-#endif
-}
-
-
-TEST(ConvertDToI) {
-  CcTest::InitializeVM();
-  LocalContext context;
-  Isolate* isolate = GetIsolateFrom(&context);
-  HandleScope scope(isolate);
-
-#if DEBUG
-  // Verify that the tests actually work with the C version. In the release
-  // code, the compiler optimizes it away because it's all constant, but does it
-  // wrong, triggering an assert on gcc.
-  RunAllTruncationTests(&ConvertDToICVersion);
-#endif
-
-  Register dest_registers[] = {
-      v0, v1, a0, a1, a2, a3, a4, a5, a6, a7, t0, t1};
-
-  for (size_t d = 0; d < sizeof(dest_registers) / sizeof(Register); d++) {
-    RunAllTruncationTests(
-        RunGeneratedCodeCallWrapper,
-        MakeConvertDToIFuncTrampoline(isolate, dest_registers[d]));
-  }
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/cctest/test-code-stubs-x64.cc b/src/v8/test/cctest/test-code-stubs-x64.cc
deleted file mode 100644
index a03cb4b..0000000
--- a/src/v8/test/cctest/test-code-stubs-x64.cc
+++ /dev/null
@@ -1,145 +0,0 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Rrdistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Rrdistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Rrdistributions 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.
-
-#include <stdlib.h>
-
-#include "src/v8.h"
-
-#include "src/base/platform/platform.h"
-#include "src/code-stubs.h"
-#include "src/factory.h"
-#include "src/macro-assembler.h"
-#include "src/objects-inl.h"
-#include "src/register-configuration.h"
-#include "test/cctest/cctest.h"
-#include "test/cctest/test-code-stubs.h"
-
-namespace v8 {
-namespace internal {
-namespace test_code_stubs_x64 {
-
-#define __ masm.
-
-ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate,
-                                              Register destination_reg) {
-  HandleScope handles(isolate);
-
-  size_t allocated;
-  byte* buffer = AllocateAssemblerBuffer(&allocated);
-  MacroAssembler masm(isolate, buffer, static_cast<int>(allocated),
-                      v8::internal::CodeObjectRequired::kYes);
-
-  DoubleToIStub stub(isolate, destination_reg);
-  byte* start = stub.GetCode()->instruction_start();
-
-  __ pushq(rbx);
-  __ pushq(rcx);
-  __ pushq(rdx);
-  __ pushq(rsi);
-  __ pushq(rdi);
-
-  const RegisterConfiguration* config = RegisterConfiguration::Default();
-
-  // Save registers make sure they don't get clobbered.
-  int reg_num = 0;
-  for (; reg_num < config->num_allocatable_general_registers(); ++reg_num) {
-    Register reg =
-        Register::from_code(config->GetAllocatableGeneralCode(reg_num));
-    if (reg != rsp && reg != rbp && reg != destination_reg) {
-      __ pushq(reg);
-    }
-  }
-
-  // Put the double argument into the designated double argument slot.
-  __ subq(rsp, Immediate(kDoubleSize));
-  __ Movsd(MemOperand(rsp, 0), xmm0);
-
-  // Call through to the actual stub
-  __ Call(start, RelocInfo::EXTERNAL_REFERENCE);
-
-  __ addq(rsp, Immediate(kDoubleSize));
-
-  // Make sure no registers have been unexpectedly clobbered
-  for (--reg_num; reg_num >= 0; --reg_num) {
-    Register reg =
-        Register::from_code(config->GetAllocatableGeneralCode(reg_num));
-    if (reg != rsp && reg != rbp && reg != destination_reg) {
-      __ cmpq(reg, MemOperand(rsp, 0));
-      __ Assert(equal, AbortReason::kRegisterWasClobbered);
-      __ addq(rsp, Immediate(kPointerSize));
-    }
-  }
-
-  __ movq(rax, destination_reg);
-
-  __ popq(rdi);
-  __ popq(rsi);
-  __ popq(rdx);
-  __ popq(rcx);
-  __ popq(rbx);
-
-  __ ret(0);
-
-  CodeDesc desc;
-  masm.GetCode(isolate, &desc);
-  MakeAssemblerBufferExecutable(buffer, allocated);
-  return reinterpret_cast<ConvertDToIFunc>(
-      reinterpret_cast<intptr_t>(buffer));
-}
-
-#undef __
-
-
-static Isolate* GetIsolateFrom(LocalContext* context) {
-  return reinterpret_cast<Isolate*>((*context)->GetIsolate());
-}
-
-
-TEST(ConvertDToI) {
-  CcTest::InitializeVM();
-  LocalContext context;
-  Isolate* isolate = GetIsolateFrom(&context);
-  HandleScope scope(isolate);
-
-#if DEBUG
-  // Verify that the tests actually work with the C version. In the release
-  // code, the compiler optimizes it away because it's all constant, but does it
-  // wrong, triggering an assert on gcc.
-  RunAllTruncationTests(&ConvertDToICVersion);
-#endif
-
-  Register dest_registers[] = {rax, rbx, rcx, rdx, rsi, rdi, r8, r9};
-
-  for (size_t d = 0; d < sizeof(dest_registers) / sizeof(Register); d++) {
-    RunAllTruncationTests(
-        MakeConvertDToIFuncTrampoline(isolate, dest_registers[d]));
-  }
-}
-
-}  // namespace test_code_stubs_x64
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/cctest/test-code-stubs.cc b/src/v8/test/cctest/test-code-stubs.cc
deleted file mode 100644
index 61d3a81..0000000
--- a/src/v8/test/cctest/test-code-stubs.cc
+++ /dev/null
@@ -1,204 +0,0 @@
-// Copyright 2013 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.
-
-#include <stdlib.h>
-
-#include <limits>
-
-#include "src/v8.h"
-
-#include "src/base/platform/platform.h"
-#include "src/code-stubs.h"
-#include "src/double.h"
-#include "src/factory.h"
-#include "src/macro-assembler.h"
-#include "src/objects-inl.h"
-#include "test/cctest/cctest.h"
-#include "test/cctest/test-code-stubs.h"
-
-namespace v8 {
-namespace internal {
-
-int STDCALL ConvertDToICVersion(double d) {
-#if defined(V8_TARGET_BIG_ENDIAN)
-  const int kExponentIndex = 0;
-  const int kMantissaIndex = 1;
-#elif defined(V8_TARGET_LITTLE_ENDIAN)
-  const int kExponentIndex = 1;
-  const int kMantissaIndex = 0;
-#else
-#error Unsupported endianness
-#endif
-  union { double d; uint32_t u[2]; } dbl;
-  dbl.d = d;
-  uint32_t exponent_bits = dbl.u[kExponentIndex];
-  int32_t shifted_mask = static_cast<int32_t>(Double::kExponentMask >> 32);
-  int32_t exponent = (((exponent_bits & shifted_mask) >>
-                       (Double::kPhysicalSignificandSize - 32)) -
-                      HeapNumber::kExponentBias);
-  if (exponent < 0) {
-    return 0;
-  }
-  uint32_t unsigned_exponent = static_cast<uint32_t>(exponent);
-  int result = 0;
-  uint32_t max_exponent =
-    static_cast<uint32_t>(Double::kPhysicalSignificandSize);
-  if (unsigned_exponent >= max_exponent) {
-    if ((exponent - Double::kPhysicalSignificandSize) < 32) {
-      result = dbl.u[kMantissaIndex]
-               << (exponent - Double::kPhysicalSignificandSize);
-    }
-  } else {
-    uint64_t big_result =
-        (bit_cast<uint64_t>(d) & Double::kSignificandMask) | Double::kHiddenBit;
-    big_result = big_result >> (Double::kPhysicalSignificandSize - exponent);
-    result = static_cast<uint32_t>(big_result);
-  }
-  if (static_cast<int32_t>(exponent_bits) < 0) {
-    return (0 - result);
-  } else {
-    return result;
-  }
-}
-
-
-void RunOneTruncationTestWithTest(ConvertDToICallWrapper callWrapper,
-                                  ConvertDToIFunc func,
-                                  double from,
-                                  int32_t to) {
-  int32_t result = (*callWrapper)(func, from);
-  CHECK_EQ(to, result);
-}
-
-
-int32_t DefaultCallWrapper(ConvertDToIFunc func,
-                           double from) {
-  return (*func)(from);
-}
-
-
-// #define NaN and Infinity so that it's possible to cut-and-paste these tests
-// directly to a .js file and run them.
-#define NaN (std::numeric_limits<double>::quiet_NaN())
-#define Infinity (std::numeric_limits<double>::infinity())
-#define RunOneTruncationTest(p1, p2) \
-    RunOneTruncationTestWithTest(callWrapper, func, p1, p2)
-
-
-void RunAllTruncationTests(ConvertDToIFunc func) {
-  RunAllTruncationTests(DefaultCallWrapper, func);
-}
-
-
-void RunAllTruncationTests(ConvertDToICallWrapper callWrapper,
-                           ConvertDToIFunc func) {
-  RunOneTruncationTest(0, 0);
-  RunOneTruncationTest(0.5, 0);
-  RunOneTruncationTest(-0.5, 0);
-  RunOneTruncationTest(1.5, 1);
-  RunOneTruncationTest(-1.5, -1);
-  RunOneTruncationTest(5.5, 5);
-  RunOneTruncationTest(-5.0, -5);
-  RunOneTruncationTest(NaN, 0);
-  RunOneTruncationTest(Infinity, 0);
-  RunOneTruncationTest(-NaN, 0);
-  RunOneTruncationTest(-Infinity, 0);
-  RunOneTruncationTest(4.94065645841e-324, 0);
-  RunOneTruncationTest(-4.94065645841e-324, 0);
-
-  RunOneTruncationTest(0.9999999999999999, 0);
-  RunOneTruncationTest(-0.9999999999999999, 0);
-  RunOneTruncationTest(4294967296.0, 0);
-  RunOneTruncationTest(-4294967296.0, 0);
-  RunOneTruncationTest(9223372036854775000.0, -1024);
-  RunOneTruncationTest(-9223372036854775000.0, 1024);
-  RunOneTruncationTest(4.5036e+15, 372629504);
-  RunOneTruncationTest(-4.5036e+15, -372629504);
-
-  RunOneTruncationTest(287524199.5377777, 0x11234567);
-  RunOneTruncationTest(-287524199.5377777, -0x11234567);
-  RunOneTruncationTest(2300193596.302222, -1994773700);
-  RunOneTruncationTest(-2300193596.302222, 1994773700);
-  RunOneTruncationTest(4600387192.604444, 305419896);
-  RunOneTruncationTest(-4600387192.604444, -305419896);
-  RunOneTruncationTest(4823855600872397.0, 1737075661);
-  RunOneTruncationTest(-4823855600872397.0, -1737075661);
-
-  RunOneTruncationTest(4503603922337791.0, -1);
-  RunOneTruncationTest(-4503603922337791.0, 1);
-  RunOneTruncationTest(4503601774854143.0, 2147483647);
-  RunOneTruncationTest(-4503601774854143.0, -2147483647);
-  RunOneTruncationTest(9007207844675582.0, -2);
-  RunOneTruncationTest(-9007207844675582.0, 2);
-
-  RunOneTruncationTest(2.4178527921507624e+24, -536870912);
-  RunOneTruncationTest(-2.4178527921507624e+24, 536870912);
-  RunOneTruncationTest(2.417853945072267e+24, -536870912);
-  RunOneTruncationTest(-2.417853945072267e+24, 536870912);
-
-  RunOneTruncationTest(4.8357055843015248e+24, -1073741824);
-  RunOneTruncationTest(-4.8357055843015248e+24, 1073741824);
-  RunOneTruncationTest(4.8357078901445341e+24, -1073741824);
-  RunOneTruncationTest(-4.8357078901445341e+24, 1073741824);
-
-  RunOneTruncationTest(2147483647.0, 2147483647);
-  RunOneTruncationTest(-2147483648.0, -2147483647-1);
-  RunOneTruncationTest(9.6714111686030497e+24, -2147483647-1);
-  RunOneTruncationTest(-9.6714111686030497e+24, -2147483647-1);
-  RunOneTruncationTest(9.6714157802890681e+24, -2147483647-1);
-  RunOneTruncationTest(-9.6714157802890681e+24, -2147483647-1);
-  RunOneTruncationTest(1.9342813113834065e+25, -2147483647-1);
-  RunOneTruncationTest(-1.9342813113834065e+25, -2147483647-1);
-
-  RunOneTruncationTest(3.868562622766813e+25, 0);
-  RunOneTruncationTest(-3.868562622766813e+25, 0);
-  RunOneTruncationTest(1.7976931348623157e+308, 0);
-  RunOneTruncationTest(-1.7976931348623157e+308, 0);
-}
-
-#undef NaN
-#undef Infinity
-#undef RunOneTruncationTest
-
-
-TEST(CodeStubMajorKeys) {
-  CcTest::InitializeVM();
-  LocalContext context;
-  Isolate* isolate = CcTest::i_isolate();
-
-#define CHECK_STUB(NAME)                        \
-  {                                             \
-    HandleScope scope(isolate);                 \
-    NAME##Stub stub_impl(0xABCD, isolate);      \
-    CodeStub* stub = &stub_impl;                \
-    CHECK_EQ(stub->MajorKey(), CodeStub::NAME); \
-  }
-  CODE_STUB_LIST(CHECK_STUB);
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/cctest/test-code-stubs.h b/src/v8/test/cctest/test-code-stubs.h
deleted file mode 100644
index 54182d0..0000000
--- a/src/v8/test/cctest/test-code-stubs.h
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2013 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.
-
-#ifndef V8_TEST_CODE_STUBS_H_
-#define V8_TEST_CODE_STUBS_H_
-
-namespace v8 {
-namespace internal {
-
-#if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X87
-#if __GNUC__
-#define STDCALL  __attribute__((stdcall))
-#else
-#define STDCALL  __stdcall
-#endif
-#else
-#define STDCALL
-#endif
-
-typedef int32_t STDCALL ConvertDToIFuncType(double input);
-typedef ConvertDToIFuncType* ConvertDToIFunc;
-
-typedef int32_t ConvertDToICallWrapperType(ConvertDToIFunc func, double from);
-typedef ConvertDToICallWrapperType* ConvertDToICallWrapper;
-
-int STDCALL ConvertDToICVersion(double d);
-
-void RunAllTruncationTests(ConvertDToIFunc func);
-void RunAllTruncationTests(ConvertDToICallWrapper callWrapper,
-                           ConvertDToIFunc func);
-
-}  // namespace internal
-}  // namespace v8
-
-#endif
diff --git a/src/v8/test/cctest/test-experimental-extra.js b/src/v8/test/cctest/test-experimental-extra.js
deleted file mode 100644
index a29fc76..0000000
--- a/src/v8/test/cctest/test-experimental-extra.js
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-(function (global, binding) {
-  'use strict';
-  binding.testExperimentalExtraShouldReturnTen = function () {
-    return 10;
-  };
-
-  binding.testExperimentalExtraShouldCallToRuntime = function() {
-    return binding.runtime(3);
-  };
-})
diff --git a/src/v8/test/cctest/test-run-wasm-relocation-arm.cc b/src/v8/test/cctest/test-run-wasm-relocation-arm.cc
deleted file mode 100644
index 000cf34..0000000
--- a/src/v8/test/cctest/test-run-wasm-relocation-arm.cc
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright 2015 the V8 project 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 <iostream>  // NOLINT(readability/streams)
-
-#include "src/v8.h"
-#include "test/cctest/cctest.h"
-
-#include "src/arm/assembler-arm-inl.h"
-#include "src/arm/simulator-arm.h"
-#include "src/disassembler.h"
-#include "src/factory.h"
-#include "src/ostreams.h"
-#include "test/cctest/compiler/c-signature.h"
-#include "test/cctest/compiler/call-tester.h"
-
-namespace v8 {
-namespace internal {
-namespace wasm {
-
-#define __ assm.
-
-static int32_t DummyStaticFunction(Object* result) { return 1; }
-
-TEST(WasmRelocationArmContextReference) {
-  Isolate* isolate = CcTest::i_isolate();
-  HandleScope scope(isolate);
-  v8::internal::byte buffer[4096];
-  DummyStaticFunction(nullptr);
-  int32_t imm = 1234567;
-
-  Assembler assm(isolate, buffer, sizeof buffer);
-
-  __ mov(r0, Operand(imm, RelocInfo::WASM_CONTEXT_REFERENCE));
-  __ mov(pc, Operand(lr));
-
-  CodeDesc desc;
-  assm.GetCode(isolate, &desc);
-  Handle<Code> code =
-      isolate->factory()->NewCode(desc, Code::STUB, Handle<Code>());
-
-  compiler::CSignatureOf<int32_t> csig;
-  compiler::CodeRunner<int32_t> runnable(isolate, code, &csig);
-  int32_t ret_value = runnable.Call();
-  CHECK_EQ(ret_value, imm);
-
-#ifdef DEBUG
-  OFStream os(stdout);
-  code->Print(os);
-  ::printf("f() = %d\n\n", ret_value);
-#endif
-  int offset = 1234;
-
-  // Relocating references by offset
-  int mode_mask = (1 << RelocInfo::WASM_CONTEXT_REFERENCE);
-  for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) {
-    // TODO(6792): No longer needed once WebAssembly code is off heap.
-    CodeSpaceMemoryModificationScope modification_scope(isolate->heap());
-    DCHECK(RelocInfo::IsWasmContextReference(it.rinfo()->rmode()));
-    it.rinfo()->set_wasm_context_reference(
-        isolate, it.rinfo()->wasm_context_reference() + offset,
-        SKIP_ICACHE_FLUSH);
-  }
-
-  // Call into relocated code object
-  ret_value = runnable.Call();
-  CHECK_EQ((imm + offset), ret_value);
-
-#ifdef DEBUG
-  code->Print(os);
-  ::printf("f() = %d\n\n", ret_value);
-#endif
-}
-
-#undef __
-
-}  // namespace wasm
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/cctest/test-run-wasm-relocation-arm64.cc b/src/v8/test/cctest/test-run-wasm-relocation-arm64.cc
deleted file mode 100644
index 59f38e1..0000000
--- a/src/v8/test/cctest/test-run-wasm-relocation-arm64.cc
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright 2015 the V8 project 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 <iostream>  // NOLINT(readability/streams)
-
-#include "src/v8.h"
-#include "test/cctest/cctest.h"
-
-#include "src/arm64/assembler-arm64-inl.h"
-#include "src/arm64/macro-assembler-arm64-inl.h"
-#include "src/arm64/simulator-arm64.h"
-#include "src/arm64/utils-arm64.h"
-#include "src/disassembler.h"
-#include "src/factory.h"
-#include "src/macro-assembler.h"
-#include "src/objects-inl.h"
-#include "src/ostreams.h"
-#include "test/cctest/compiler/c-signature.h"
-#include "test/cctest/compiler/call-tester.h"
-
-namespace v8 {
-namespace internal {
-namespace wasm {
-
-#define __ masm.
-
-static int64_t DummyStaticFunction(Object* result) { return 1; }
-
-TEST(WasmRelocationArm64ContextReference) {
-  Isolate* isolate = CcTest::i_isolate();
-  HandleScope scope(isolate);
-  v8::internal::byte buffer[4096];
-  DummyStaticFunction(nullptr);
-  int64_t imm = 1234567;
-
-  MacroAssembler masm(isolate, buffer, sizeof buffer,
-                      v8::internal::CodeObjectRequired::kYes);
-
-  __ Mov(x0, Immediate(imm, RelocInfo::WASM_CONTEXT_REFERENCE));
-  __ Ret();
-
-  CodeDesc desc;
-  masm.GetCode(isolate, &desc);
-  Handle<Code> code =
-      isolate->factory()->NewCode(desc, Code::STUB, Handle<Code>());
-
-  compiler::CSignatureOf<int64_t> csig;
-  compiler::CodeRunner<int64_t> runnable(isolate, code, &csig);
-  int64_t ret_value = runnable.Call();
-  CHECK_EQ(ret_value, imm);
-
-#ifdef DEBUG
-  OFStream os(stdout);
-  code->Print(os);
-  ::printf("f() = %" PRIx64 "\n\n", ret_value);
-#endif
-  int offset = 1234;
-
-  // Relocating reference by offset
-  int mode_mask = (1 << RelocInfo::WASM_CONTEXT_REFERENCE);
-  for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) {
-    // TODO(6792): No longer needed once WebAssembly code is off heap.
-    CodeSpaceMemoryModificationScope modification_scope(isolate->heap());
-    DCHECK(RelocInfo::IsWasmContextReference(it.rinfo()->rmode()));
-    it.rinfo()->set_wasm_context_reference(
-        isolate, it.rinfo()->wasm_context_reference() + offset,
-        SKIP_ICACHE_FLUSH);
-  }
-
-  // Call into relocated code object
-  ret_value = runnable.Call();
-  CHECK_EQ((imm + offset), ret_value);
-
-#ifdef DEBUG
-  code->Print(os);
-  ::printf("f() = %" PRIx64 "\n\n", ret_value);
-#endif
-}
-
-#undef __
-
-}  // namespace wasm
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/cctest/test-run-wasm-relocation-ia32.cc b/src/v8/test/cctest/test-run-wasm-relocation-ia32.cc
deleted file mode 100644
index 080da36..0000000
--- a/src/v8/test/cctest/test-run-wasm-relocation-ia32.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright 2015 the V8 project 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 <stdlib.h>
-
-#include "src/v8.h"
-
-#include "src/debug/debug.h"
-#include "src/disasm.h"
-#include "src/disassembler.h"
-#include "src/frame-constants.h"
-#include "src/ic/ic.h"
-#include "src/macro-assembler.h"
-#include "src/objects-inl.h"
-#include "src/ostreams.h"
-#include "test/cctest/cctest.h"
-#include "test/cctest/compiler/c-signature.h"
-#include "test/cctest/compiler/call-tester.h"
-
-namespace v8 {
-namespace internal {
-namespace wasm {
-
-#define __ assm.
-
-static int32_t DummyStaticFunction(Object* result) { return 1; }
-
-TEST(WasmRelocationIa32ContextReference) {
-  Isolate* isolate = CcTest::i_isolate();
-  Zone zone(isolate->allocator(), ZONE_NAME);
-  HandleScope scope(isolate);
-  v8::internal::byte buffer[4096];
-  Assembler assm(isolate, buffer, sizeof buffer);
-  DummyStaticFunction(nullptr);
-  int32_t imm = 1234567;
-
-  __ mov(eax, Immediate(reinterpret_cast<Address>(imm),
-                        RelocInfo::WASM_CONTEXT_REFERENCE));
-  __ nop();
-  __ ret(0);
-
-  compiler::CSignatureOf<int32_t> csig;
-  CodeDesc desc;
-  assm.GetCode(isolate, &desc);
-  Handle<Code> code =
-      isolate->factory()->NewCode(desc, Code::STUB, Handle<Code>());
-  USE(code);
-
-  compiler::CodeRunner<int32_t> runnable(isolate, code, &csig);
-  int32_t ret_value = runnable.Call();
-  CHECK_EQ(ret_value, imm);
-
-#ifdef OBJECT_PRINT
-  OFStream os(stdout);
-  code->Print(os);
-  byte* begin = code->instruction_start();
-  byte* end = begin + code->instruction_size();
-  disasm::Disassembler::Disassemble(stdout, begin, end);
-#endif
-
-  int offset = 1234;
-
-  // Relocating references by offset
-  int mode_mask = (1 << RelocInfo::WASM_CONTEXT_REFERENCE);
-  for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) {
-    // TODO(6792): No longer needed once WebAssembly code is off heap.
-    CodeSpaceMemoryModificationScope modification_scope(isolate->heap());
-    DCHECK(RelocInfo::IsWasmContextReference(it.rinfo()->rmode()));
-    it.rinfo()->set_wasm_context_reference(
-        isolate, it.rinfo()->wasm_context_reference() + offset,
-        SKIP_ICACHE_FLUSH);
-  }
-
-  // Check if immediate is updated correctly
-  ret_value = runnable.Call();
-  CHECK_EQ(ret_value, imm + offset);
-
-#ifdef OBJECT_PRINT
-  code->Print(os);
-  begin = code->instruction_start();
-  end = begin + code->instruction_size();
-  disasm::Disassembler::Disassemble(stdout, begin, end);
-#endif
-}
-
-#undef __
-
-}  // namespace wasm
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/cctest/test-run-wasm-relocation-x64.cc b/src/v8/test/cctest/test-run-wasm-relocation-x64.cc
deleted file mode 100644
index 0526ce2..0000000
--- a/src/v8/test/cctest/test-run-wasm-relocation-x64.cc
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright 2015 the V8 project 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 <stdlib.h>
-
-#include "src/v8.h"
-
-#include "src/debug/debug.h"
-#include "src/disasm.h"
-#include "src/disassembler.h"
-#include "src/ic/ic.h"
-#include "src/macro-assembler.h"
-#include "src/objects-inl.h"
-#include "src/ostreams.h"
-#include "test/cctest/cctest.h"
-#include "test/cctest/compiler/c-signature.h"
-#include "test/cctest/compiler/call-tester.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-#define __ assm.
-
-static int32_t DummyStaticFunction(Object* result) { return 1; }
-
-TEST(WasmRelocationX64ContextReference) {
-  Isolate* isolate = CcTest::i_isolate();
-  HandleScope scope(isolate);
-  v8::internal::byte buffer[4096];
-  Assembler assm(isolate, buffer, sizeof buffer);
-  DummyStaticFunction(nullptr);
-  int64_t imm = 1234567;
-
-  __ movq(rax, imm, RelocInfo::WASM_CONTEXT_REFERENCE);
-  __ nop();
-  __ ret(0);
-
-  CodeDesc desc;
-  assm.GetCode(isolate, &desc);
-  Handle<Code> code =
-      isolate->factory()->NewCode(desc, Code::STUB, Handle<Code>());
-  USE(code);
-
-  CSignatureOf<int64_t> csig;
-  CodeRunner<int64_t> runnable(isolate, code, &csig);
-  int64_t ret_value = runnable.Call();
-  CHECK_EQ(ret_value, imm);
-
-#ifdef OBJECT_PRINT
-  OFStream os(stdout);
-  code->Print(os);
-  byte* begin = code->instruction_start();
-  byte* end = begin + code->instruction_size();
-  disasm::Disassembler::Disassemble(stdout, begin, end);
-#endif
-  int offset = 1234;
-
-  // Relocating references by offset
-  int mode_mask = (1 << RelocInfo::WASM_CONTEXT_REFERENCE);
-  for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) {
-    // TODO(6792): No longer needed once WebAssembly code is off heap.
-    CodeSpaceMemoryModificationScope modification_scope(isolate->heap());
-    DCHECK(RelocInfo::IsWasmContextReference(it.rinfo()->rmode()));
-    it.rinfo()->set_wasm_context_reference(
-        isolate, it.rinfo()->wasm_context_reference() + offset,
-        SKIP_ICACHE_FLUSH);
-  }
-
-  // Check if immediate is updated correctly
-  ret_value = runnable.Call();
-  CHECK_EQ(ret_value, imm + offset);
-
-#ifdef OBJECT_PRINT
-  code->Print(os);
-  begin = code->instruction_start();
-  end = begin + code->instruction_size();
-  disasm::Disassembler::Disassemble(stdout, begin, end);
-#endif
-}
-
-#undef __
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/cctest/test-unbound-queue.cc b/src/v8/test/cctest/test-unbound-queue.cc
deleted file mode 100644
index 48e344a..0000000
--- a/src/v8/test/cctest/test-unbound-queue.cc
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright 2010 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.
-//
-// Tests of the unbound queue.
-
-#include "src/v8.h"
-#include "test/cctest/cctest.h"
-
-#include "src/profiler/unbound-queue-inl.h"
-
-using i::UnboundQueue;
-
-
-TEST(SingleRecord) {
-  typedef int Record;
-  UnboundQueue<Record> cq;
-  CHECK(cq.IsEmpty());
-  cq.Enqueue(1);
-  CHECK(!cq.IsEmpty());
-  Record rec = 0;
-  cq.Dequeue(&rec);
-  CHECK_EQ(1, rec);
-  CHECK(cq.IsEmpty());
-}
-
-
-TEST(MultipleRecords) {
-  typedef int Record;
-  UnboundQueue<Record> cq;
-  CHECK(cq.IsEmpty());
-  cq.Enqueue(1);
-  CHECK(!cq.IsEmpty());
-  for (int i = 2; i <= 5; ++i) {
-    cq.Enqueue(i);
-    CHECK(!cq.IsEmpty());
-  }
-  Record rec = 0;
-  for (int i = 1; i <= 4; ++i) {
-    CHECK(!cq.IsEmpty());
-    cq.Dequeue(&rec);
-    CHECK_EQ(i, rec);
-  }
-  for (int i = 6; i <= 12; ++i) {
-    cq.Enqueue(i);
-    CHECK(!cq.IsEmpty());
-  }
-  for (int i = 5; i <= 12; ++i) {
-    CHECK(!cq.IsEmpty());
-    cq.Dequeue(&rec);
-    CHECK_EQ(i, rec);
-  }
-  CHECK(cq.IsEmpty());
-}
diff --git a/src/v8/test/cctest/types-fuzz.h b/src/v8/test/cctest/types-fuzz.h
deleted file mode 100644
index 90cdc8e..0000000
--- a/src/v8/test/cctest/types-fuzz.h
+++ /dev/null
@@ -1,225 +0,0 @@
-// Copyright 2014 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.
-
-#ifndef V8_TEST_CCTEST_TYPES_H_
-#define V8_TEST_CCTEST_TYPES_H_
-
-#include "src/base/utils/random-number-generator.h"
-#include "src/factory.h"
-#include "src/isolate.h"
-#include "src/v8.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-class Types {
- public:
-  Types(Zone* zone, Isolate* isolate, v8::base::RandomNumberGenerator* rng)
-      : zone_(zone), rng_(rng) {
-#define DECLARE_TYPE(name, value) \
-  name = Type::name();            \
-  types.push_back(name);
-    PROPER_BITSET_TYPE_LIST(DECLARE_TYPE)
-    #undef DECLARE_TYPE
-
-    SignedSmall = Type::SignedSmall();
-    UnsignedSmall = Type::UnsignedSmall();
-
-    object_map = isolate->factory()->NewMap(
-        JS_OBJECT_TYPE, JSObject::kHeaderSize);
-
-    smi = handle(Smi::FromInt(666), isolate);
-    boxed_smi = isolate->factory()->NewHeapNumber(666);
-    signed32 = isolate->factory()->NewHeapNumber(0x40000000);
-    float1 = isolate->factory()->NewHeapNumber(1.53);
-    float2 = isolate->factory()->NewHeapNumber(0.53);
-    // float3 is identical to float1 in order to test that OtherNumberConstant
-    // types are equal by double value and not by handle pointer value.
-    float3 = isolate->factory()->NewHeapNumber(1.53);
-    object1 = isolate->factory()->NewJSObjectFromMap(object_map);
-    object2 = isolate->factory()->NewJSObjectFromMap(object_map);
-    array = isolate->factory()->NewJSArray(20);
-    uninitialized = isolate->factory()->uninitialized_value();
-    SmiConstant = Type::NewConstant(smi, zone);
-    Signed32Constant = Type::NewConstant(signed32, zone);
-
-    ObjectConstant1 = Type::HeapConstant(object1, zone);
-    ObjectConstant2 = Type::HeapConstant(object2, zone);
-    ArrayConstant = Type::HeapConstant(array, zone);
-    UninitializedConstant = Type::HeapConstant(uninitialized, zone);
-
-    values.push_back(smi);
-    values.push_back(boxed_smi);
-    values.push_back(signed32);
-    values.push_back(object1);
-    values.push_back(object2);
-    values.push_back(array);
-    values.push_back(uninitialized);
-    values.push_back(float1);
-    values.push_back(float2);
-    values.push_back(float3);
-    for (ValueVector::iterator it = values.begin(); it != values.end(); ++it) {
-      types.push_back(Type::NewConstant(*it, zone));
-    }
-
-    integers.push_back(isolate->factory()->NewNumber(-V8_INFINITY));
-    integers.push_back(isolate->factory()->NewNumber(+V8_INFINITY));
-    integers.push_back(isolate->factory()->NewNumber(-rng_->NextInt(10)));
-    integers.push_back(isolate->factory()->NewNumber(+rng_->NextInt(10)));
-    for (int i = 0; i < 10; ++i) {
-      double x = rng_->NextInt();
-      integers.push_back(isolate->factory()->NewNumber(x));
-      x *= rng_->NextInt();
-      if (!IsMinusZero(x)) integers.push_back(isolate->factory()->NewNumber(x));
-    }
-
-    Integer = Type::Range(-V8_INFINITY, +V8_INFINITY, zone);
-
-    for (int i = 0; i < 30; ++i) {
-      types.push_back(Fuzz());
-    }
-  }
-
-  Handle<i::Map> object_map;
-
-  Handle<i::Smi> smi;
-  Handle<i::HeapNumber> boxed_smi;
-  Handle<i::HeapNumber> signed32;
-  Handle<i::HeapNumber> float1;
-  Handle<i::HeapNumber> float2;
-  Handle<i::HeapNumber> float3;
-  Handle<i::JSObject> object1;
-  Handle<i::JSObject> object2;
-  Handle<i::JSArray> array;
-  Handle<i::Oddball> uninitialized;
-
-#define DECLARE_TYPE(name, value) Type* name;
-  PROPER_BITSET_TYPE_LIST(DECLARE_TYPE)
-  #undef DECLARE_TYPE
-
-  Type* SignedSmall;
-  Type* UnsignedSmall;
-
-  Type* SmiConstant;
-  Type* Signed32Constant;
-  Type* ObjectConstant1;
-  Type* ObjectConstant2;
-  Type* ArrayConstant;
-  Type* UninitializedConstant;
-
-  Type* Integer;
-
-  typedef std::vector<Type*> TypeVector;
-  typedef std::vector<Handle<i::Object> > ValueVector;
-
-  TypeVector types;
-  ValueVector values;
-  ValueVector integers;  // "Integer" values used for range limits.
-
-  Type* Of(Handle<i::Object> value) { return Type::Of(value, zone_); }
-
-  Type* NewConstant(Handle<i::Object> value) {
-    return Type::NewConstant(value, zone_);
-  }
-
-  Type* HeapConstant(Handle<i::HeapObject> value) {
-    return Type::HeapConstant(value, zone_);
-  }
-
-  Type* Range(double min, double max) { return Type::Range(min, max, zone_); }
-
-  Type* Union(Type* t1, Type* t2) { return Type::Union(t1, t2, zone_); }
-
-  Type* Intersect(Type* t1, Type* t2) { return Type::Intersect(t1, t2, zone_); }
-
-  Type* Random() {
-    return types[rng_->NextInt(static_cast<int>(types.size()))];
-  }
-
-  Type* Fuzz(int depth = 4) {
-    switch (rng_->NextInt(depth == 0 ? 3 : 20)) {
-      case 0: {  // bitset
-        #define COUNT_BITSET_TYPES(type, value) + 1
-        int n = 0 PROPER_BITSET_TYPE_LIST(COUNT_BITSET_TYPES);
-        #undef COUNT_BITSET_TYPES
-        // Pick a bunch of named bitsets and return their intersection.
-        Type* result = Type::Any();
-        for (int i = 0, m = 1 + rng_->NextInt(3); i < m; ++i) {
-          int j = rng_->NextInt(n);
-#define PICK_BITSET_TYPE(type, value)                         \
-  if (j-- == 0) {                                             \
-    Type* tmp = Type::Intersect(result, Type::type(), zone_); \
-    if (tmp->Is(Type::None()) && i != 0) {                    \
-      break;                                                  \
-    } else {                                                  \
-      result = tmp;                                           \
-      continue;                                               \
-    }                                                         \
-  }
-          PROPER_BITSET_TYPE_LIST(PICK_BITSET_TYPE)
-          #undef PICK_BITSET_TYPE
-        }
-        return result;
-      }
-      case 1: {  // constant
-        int i = rng_->NextInt(static_cast<int>(values.size()));
-        return Type::NewConstant(values[i], zone_);
-      }
-      case 2: {  // range
-        int i = rng_->NextInt(static_cast<int>(integers.size()));
-        int j = rng_->NextInt(static_cast<int>(integers.size()));
-        double min = integers[i]->Number();
-        double max = integers[j]->Number();
-        if (min > max) std::swap(min, max);
-        return Type::Range(min, max, zone_);
-      }
-      default: {  // union
-        int n = rng_->NextInt(10);
-        Type* type = None;
-        for (int i = 0; i < n; ++i) {
-          Type* operand = Fuzz(depth - 1);
-          type = Type::Union(type, operand, zone_);
-        }
-        return type;
-      }
-    }
-    UNREACHABLE();
-  }
-
-  Zone* zone() { return zone_; }
-
- private:
-  Zone* zone_;
-  v8::base::RandomNumberGenerator* rng_;
-};
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif
diff --git a/src/v8/test/cctest/wasm/test-run-wasm-relocation.cc b/src/v8/test/cctest/wasm/test-run-wasm-relocation.cc
deleted file mode 100644
index 482ab9e..0000000
--- a/src/v8/test/cctest/wasm/test-run-wasm-relocation.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright 2015 the V8 project 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 <stdlib.h>
-
-#include "src/assembler-inl.h"
-#include "src/objects-inl.h"
-#include "src/v8.h"
-#include "test/cctest/cctest.h"
-#include "test/cctest/compiler/c-signature.h"
-#include "test/cctest/wasm/wasm-run-utils.h"
-#include "test/common/wasm/wasm-macro-gen.h"
-
-namespace v8 {
-namespace internal {
-namespace wasm {
-namespace test_run_wasm_relocation {
-
-WASM_COMPILED_EXEC_TEST(RunPatchWasmContext) {
-  WasmRunner<uint32_t, uint32_t> r(execution_mode);
-  Isolate* isolate = CcTest::i_isolate();
-
-  r.builder().AddGlobal<uint32_t>();
-  r.builder().AddGlobal<uint32_t>();
-
-  BUILD(r, WASM_SET_GLOBAL(0, WASM_GET_LOCAL(0)), WASM_GET_GLOBAL(0));
-  CHECK_EQ(1, r.builder().CodeTableLength());
-
-  // Run with the old global data.
-  CHECK_EQ(113, r.Call(113));
-
-  WasmContext* old_wasm_context =
-      r.builder().instance_object()->wasm_context()->get();
-  Address old_wasm_context_address =
-      reinterpret_cast<Address>(old_wasm_context);
-
-  uint32_t new_global_data[3] = {0, 0, 0};
-  WasmContext new_wasm_context;
-  new_wasm_context.globals_start = reinterpret_cast<byte*>(new_global_data);
-
-  {
-    // TODO(6792): No longer needed once WebAssembly code is off heap.
-    CodeSpaceMemoryModificationScope modification_scope(isolate->heap());
-
-    // Patch in a new WasmContext that points to the new global data.
-    int filter = 1 << RelocInfo::WASM_CONTEXT_REFERENCE;
-    bool patched = false;
-    Handle<Code> code = r.GetWrapperCode();
-    for (RelocIterator it(*code, filter); !it.done(); it.next()) {
-      CHECK_EQ(old_wasm_context_address, it.rinfo()->wasm_context_reference());
-      it.rinfo()->set_wasm_context_reference(
-          isolate, reinterpret_cast<Address>(&new_wasm_context));
-      patched = true;
-    }
-    CHECK(patched);
-    Assembler::FlushICache(isolate, code->instruction_start(),
-                           code->instruction_size());
-  }
-
-  // Run with the new global data.
-  CHECK_EQ(115, r.Call(115));
-  CHECK_EQ(115, new_global_data[0]);
-}
-
-}  // namespace test_run_wasm_relocation
-}  // namespace wasm
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/d8_default.gyp b/src/v8/test/d8_default.gyp
deleted file mode 100644
index 399623d..0000000
--- a/src/v8/test/d8_default.gyp
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright 2018 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'conditions': [
-    ['test_isolation_mode != "noop"', {
-      'targets': [
-        {
-          'target_name': 'd8_default_run',
-          'type': 'none',
-          'dependencies': [
-            'debugger/debugger.gyp:debugger_run',
-            'intl/intl.gyp:intl_run',
-            'message/message.gyp:message_run',
-            'mjsunit/mjsunit.gyp:mjsunit_run',
-            'preparser/preparser.gyp:preparser_run',
-            'webkit/webkit.gyp:webkit_run',
-          ],
-          'includes': [
-            '../gypfiles/features.gypi',
-            '../gypfiles/isolate.gypi',
-          ],
-          'sources': [
-            'd8_default.isolate',
-          ],
-        },
-      ],
-    }],
-  ],
-}
diff --git a/src/v8/test/d8_default.isolate b/src/v8/test/d8_default.isolate
deleted file mode 100644
index efeae64..0000000
--- a/src/v8/test/d8_default.isolate
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright 2018 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'variables': {
-    'command': [
-      '../tools/run-tests.py',
-    ],
-  },
-  'includes': [
-    'debugger/debugger.isolate',
-    'intl/intl.isolate',
-    'message/message.isolate',
-    'mjsunit/mjsunit.isolate',
-    'preparser/preparser.isolate',
-    'webkit/webkit.isolate',
-  ],
-}
diff --git a/src/v8/test/debugger/debug/debug-evaluate-no-side-effect-async.js b/src/v8/test/debugger/debug/debug-evaluate-no-side-effect-async.js
deleted file mode 100644
index c5c8eeb..0000000
--- a/src/v8/test/debugger/debug/debug-evaluate-no-side-effect-async.js
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Test that asynchronous features do not work with
-// side-effect free debug-evaluate.
-
-Debug = debug.Debug
-
-var exception = null;
-
-function* generator() {
-  yield 1;
-}
-
-async function async() {
-  return 1;
-}
-
-var g = generator();
-
-function listener(event, exec_state, event_data, data) {
-  if (event != Debug.DebugEvent.Break) return;
-  try {
-    function fail(source) {
-      assertThrows(() => exec_state.frame(0).evaluate(source, true),
-                   EvalError);
-    }
-    fail("new Promise()");
-    fail("generator()");
-    fail("g.next()");
-    fail("async()");
-  } catch (e) {
-    exception = e;
-    print(e, e.stack);
-  };
-};
-
-// Add the debug event listener.
-Debug.setListener(listener);
-
-function f() {
-  debugger;
-};
-
-f();
-
-assertNull(exception);
diff --git a/src/v8/test/debugger/debug/debug-evaluate-no-side-effect-builtins-2.js b/src/v8/test/debugger/debug/debug-evaluate-no-side-effect-builtins-2.js
deleted file mode 100644
index 1b357ef..0000000
--- a/src/v8/test/debugger/debug/debug-evaluate-no-side-effect-builtins-2.js
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-Debug = debug.Debug
-
-var exception = null;
-var date = new Date();
-var map = new Map().set("a", "b").set("c", "d");
-
-function listener(event, exec_state, event_data, data) {
-  if (event != Debug.DebugEvent.Break) return;
-  try {
-    function success(expectation, source) {
-      var result = exec_state.frame(0).evaluate(source, true).value();
-      if (expectation !== undefined) assertEquals(expectation, result);
-    }
-    function fail(source) {
-      assertThrows(() => exec_state.frame(0).evaluate(source, true),
-                   EvalError);
-    }
-
-    // Test Date.prototype functions.
-    success(undefined, `Date()`);
-    success(undefined, `new Date()`);
-    success(undefined, `Date.now()`);
-    success(undefined, `Date.parse(1)`);
-    for (f of Object.getOwnPropertyNames(Date.prototype)) {
-      if (typeof Date.prototype[f] === "function") {
-        if (f.startsWith("set")) {
-          fail(`date.${f}(5);`, true);
-        } else if (f.startsWith("toLocale")) {
-          if (typeof Intl === "undefined") continue;
-          fail(`date.${f}();`, true);
-        } else {
-          success(undefined, `date.${f}();`, true);
-        }
-      }
-    }
-
-    // Test Boolean.
-    success(true, `Boolean(1)`);
-    success(new Boolean(true), `new Boolean(1)`);
-    success("true", `true.toString()`);
-    success(true, `true.valueOf()`);
-
-    // Test global functions.
-    success(1, `parseInt("1")`);
-    success(1.3, `parseFloat("1.3")`);
-    success("abc", `decodeURI("abc")`);
-    success("abc", `encodeURI("abc")`);
-    success("abc", `decodeURIComponent("abc")`);
-    success("abc", `encodeURIComponent("abc")`);
-    success("abc", `escape("abc")`);
-    success("abc", `unescape("abc")`);
-    success(true, `isFinite(0)`);
-    success(true, `isNaN(0/0)`);
-
-    // Test Map functions.
-    success(undefined, `new Map()`);
-    success("[object Map]", `map.toString()`);
-    success("b", `map.get("a")`);
-    success(true, `map.get("x") === undefined`);
-    success(undefined, `map.entries()`);
-    success(undefined, `map.keys()`);
-    success(undefined, `map.values()`);
-    success(2, `map.size`);
-    fail(`map.has("c")`);  // This sets a hash on the object.
-    fail(`map.forEach(()=>1)`);
-    fail(`map.delete("a")`);
-    fail(`map.clear()`);
-    fail(`map.set("x", "y")`);
-  } catch (e) {
-    exception = e;
-    print(e, e.stack);
-  };
-};
-
-// Add the debug event listener.
-Debug.setListener(listener);
-
-function f() {
-  debugger;
-};
-
-f();
-
-assertNull(exception);
diff --git a/src/v8/test/debugger/debug/debug-evaluate-no-side-effect-builtins.js b/src/v8/test/debugger/debug/debug-evaluate-no-side-effect-builtins.js
deleted file mode 100644
index 73edb03..0000000
--- a/src/v8/test/debugger/debug/debug-evaluate-no-side-effect-builtins.js
+++ /dev/null
@@ -1,167 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-Debug = debug.Debug
-
-var exception = null;
-var object_with_symbol_key = {[Symbol("a")]: 1};
-var object_with_callbacks = { toString: () => "string", valueOf: () => 3};
-var symbol_for_a = Symbol.for("a");
-
-function listener(event, exec_state, event_data, data) {
-  if (event != Debug.DebugEvent.Break) return;
-  try {
-    function success(expectation, source) {
-      var result = exec_state.frame(0).evaluate(source, true).value();
-      if (expectation !== undefined) assertEquals(expectation, result);
-    }
-    function fail(source) {
-      assertThrows(() => exec_state.frame(0).evaluate(source, true),
-                   EvalError);
-    }
-
-    // Test some Object functions.
-    success({}, `new Object()`);
-    success({p : 3}, `Object.create({}, { p: { value: 3 } })`);
-    success("[[\"a\",1],[\"b\",2]]",
-            `JSON.stringify(Object.entries({a:1, b:2}))`);
-    success({value: 1, writable: true, enumerable: true, configurable: true},
-            `Object.getOwnPropertyDescriptor({a: 1}, "a")`);
-    success("{\"a\":{\"value\":1,\"writable\":true," +
-            "\"enumerable\":true,\"configurable\":true}}",
-            `JSON.stringify(Object.getOwnPropertyDescriptors({a: 1}))`);
-    success(["a"], `Object.getOwnPropertyNames({a: 1})`);
-    success(undefined, `Object.getOwnPropertySymbols(object_with_symbol_key)`);
-    success({}, `Object.getPrototypeOf(Object.create({}))`);
-    success(true, `Object.is(Object, Object)`);
-    success(true, `Object.isExtensible({})`);
-    success(false, `Object.isFrozen({})`);
-    success(false, `Object.isSealed({})`);
-    success([1, 2], `Object.values({a:1, b:2})`);
-
-    fail(`Object.assign({}, {})`);
-    fail(`Object.defineProperties({}, [{p:{value:3}}])`);
-    fail(`Object.defineProperty({}, {p:{value:3}})`);
-    fail(`Object.freeze({})`);
-    fail(`Object.preventExtensions({})`);
-    fail(`Object.seal({})`);
-    fail(`Object.setPrototypeOf({}, {})`);
-
-    // Test some Object.prototype functions.
-    success(true, `({a:1}).hasOwnProperty("a")`);
-    success(true, `Object.prototype.isPrototypeOf({})`);
-    success(true, `({a:1}).propertyIsEnumerable("a")`);
-    success("[object Object]", `({a:1}).toString()`);
-    success("string", `(object_with_callbacks).toString()`);
-    success(3, `(object_with_callbacks).valueOf()`);
-
-    // Test Array functions.
-    success([], `new Array()`);
-    var function_param = [
-      "forEach", "every", "some", "reduce", "reduceRight", "find", "filter",
-      "map", "findIndex"
-    ];
-    var fails = ["toString", "join", "toLocaleString", "pop", "push",
-      "reverse", "shift", "unshift", "slice", "splice", "sort", "filter",
-      "map", "copyWithin", "fill", "concat"];
-    for (f of Object.getOwnPropertyNames(Array.prototype)) {
-      if (typeof Array.prototype[f] === "function") {
-        if (fails.includes(f)) {
-          if (function_param.includes(f)) {
-            fail(`[1, 2, 3].${f}(()=>{});`);
-          } else {
-            fail(`[1, 2, 3].${f}();`);
-          }
-        } else if (function_param.includes(f)) {
-          exec_state.frame(0).evaluate(`[1, 2, 3].${f}(()=>{});`, true);
-        } else {
-          exec_state.frame(0).evaluate(`[1, 2, 3].${f}();`, true);
-        }
-      }
-    }
-
-    // Test Math functions.
-    for (f of Object.getOwnPropertyNames(Math)) {
-      if (typeof Math[f] === "function") {
-        var result = exec_state.frame(0).evaluate(
-                         `Math.${f}(0.5, -0.5);`, true).value();
-        if (f != "random") assertEquals(Math[f](0.5, -0.5), result);
-      }
-    }
-
-    // Test Number functions.
-    success(new Number(0), `new Number()`);
-    for (f of Object.getOwnPropertyNames(Number)) {
-      if (typeof Number[f] === "function") {
-        success(Number[f](0.5), `Number.${f}(0.5);`);
-      }
-    }
-    for (f of Object.getOwnPropertyNames(Number.prototype)) {
-      if (typeof Number.prototype[f] === "function") {
-        if (f == "toLocaleString") continue;
-        success(Number(0.5)[f](5), `Number(0.5).${f}(5);`);
-      }
-    }
-
-    // Test String functions.
-    success(new String(), `new String()`);
-    success(" ", "String.fromCodePoint(0x20)");
-    success(" ", "String.fromCharCode(0x20)");
-    for (f of Object.getOwnPropertyNames(String.prototype)) {
-      if (typeof String.prototype[f] === "function") {
-        // Do not expect locale-specific or regexp-related functions to work.
-        // {Lower,Upper}Case (Locale-specific or not) do not work either
-        // if Intl is enabled.
-        if (f.indexOf("locale") >= 0) continue;
-        if (f.indexOf("Locale") >= 0) continue;
-        if (typeof Intl !== 'undefined') {
-          if (f == "toUpperCase") continue;
-          if (f == "toLowerCase") continue;
-        }
-        if (f == "normalize") continue;
-        if (f == "match") continue;
-        if (f == "search") continue;
-        if (f == "split" || f == "replace") {
-          fail(`'abcd'.${f}(2)`);
-          continue;
-        }
-        success("abcd"[f](2), `"abcd".${f}(2);`);
-      }
-    }
-    fail("'abCd'.toLocaleLowerCase()");
-    fail("'abcd'.toLocaleUpperCase()");
-    if (typeof Intl !== 'undefined') {
-      fail("'abCd'.toLowerCase()");
-      fail("'abcd'.toUpperCase()");
-    }
-    fail("'abcd'.match(/a/)");
-    fail("'abcd'.replace(/a/)");
-    fail("'abcd'.search(/a/)");
-    fail("'abcd'.split(/a/)");
-
-    // Test JSON functions.
-    success('{"abc":[1,2]}', "JSON.stringify(JSON.parse('{\"abc\":[1,2]}'))");
-
-    // Test Symbol functions.
-    success(undefined, `Symbol("a")`);
-    fail(`Symbol.for("a")`);  // Symbol.for can be observed via Symbol.keyFor.
-    success("a", `Symbol.keyFor(symbol_for_a)`);
-    success("Symbol(a)", `symbol_for_a.valueOf().toString()`);
-    success("Symbol(a)", `symbol_for_a[Symbol.toPrimitive]().toString()`);
-  } catch (e) {
-    exception = e;
-    print(e, e.stack);
-  };
-};
-
-// Add the debug event listener.
-Debug.setListener(listener);
-
-function f() {
-  debugger;
-};
-
-f();
-
-assertNull(exception);
diff --git a/src/v8/test/debugger/debug/debug-evaluate-no-side-effect-control.js b/src/v8/test/debugger/debug/debug-evaluate-no-side-effect-control.js
deleted file mode 100644
index e19a277..0000000
--- a/src/v8/test/debugger/debug/debug-evaluate-no-side-effect-control.js
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-Debug = debug.Debug
-
-var exception = null;
-
-var o = { p : 1 };
-
-var successes = [
-  [45,
-   `(function() {
-      var sum = 0;
-      for (var i = 0; i < 10; i++) sum += i;
-      return sum;
-    })()`
-  ],
-  ["0012",
-   `(function() {
-      var sum = 0;
-      for (var i in [1, 2, 3]) sum += i;
-      return sum;
-    })()`
-  ],
-  [15,
-   `(function() {
-      var sum = 1;
-      while (sum < 12) sum += sum + 1;
-      return sum;
-    })()`
-  ],
-  [15,
-   `(function() {
-      var sum = 1;
-      do { sum += sum + 1; } while (sum < 12);
-      return sum;
-    })()`
-  ],
-  ["023",
-   `(function() {
-      var sum = "";
-      for (var i = 0; i < 4; i++) {
-        switch (i) {
-          case 0:
-          case 1:
-            if (i == 0) sum += i;
-            break;
-          default:
-          case 3:
-            sum += i;
-            break;
-        }
-      }
-      return sum;
-    })()`
-  ],
-  ["oups",
-   `(function() {
-      try {
-        if (Math.sin(1) < 1) throw new Error("oups");
-      } catch (e) {
-        return e.message;
-      }
-    })()`
-  ],
-];
-
-var fails = [
-  `(function() {  // Iterator.prototype.next performs stores.
-     var sum = 0;
-     for (let i of [1, 2, 3]) sum += i;
-     return sum;
-   })()`,
-  `(function() {  // Store to scope object.
-     with (o) {
-       p = 2;
-     }
-   })()`,
-];
-
-function listener(event, exec_state, event_data, data) {
-  if (event != Debug.DebugEvent.Break) return;
-  try {
-    successes.forEach(function ([expectation, source]) {
-      assertEquals(expectation,
-                   exec_state.frame(0).evaluate(source, true).value());
-    });
-    fails.forEach(function (test) {
-      assertThrows(() => exec_state.frame(0).evaluate(test, true), EvalError);
-    });
-  } catch (e) {
-    exception = e;
-    print(e, e.stack);
-  };
-};
-
-// Add the debug event listener.
-Debug.setListener(listener);
-
-function f() {
-  debugger;
-};
-
-f();
-
-assertNull(exception);
diff --git a/src/v8/test/debugger/debug/debug-evaluate-no-side-effect-iife.js b/src/v8/test/debugger/debug/debug-evaluate-no-side-effect-iife.js
deleted file mode 100644
index c8dc2a5..0000000
--- a/src/v8/test/debugger/debug/debug-evaluate-no-side-effect-iife.js
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Test that declaring local variables in IIFEs works with
-// side-effect free debug-evaluate.
-
-Debug = debug.Debug
-
-var exception = null;
-
-function listener(event, exec_state, event_data, data) {
-  if (event != Debug.DebugEvent.Break) return;
-  try {
-    function success(expectation, source) {
-      assertEquals(expectation,
-                   exec_state.frame(0).evaluate(source, true).value());
-    }
-    function fail(source) {
-      assertThrows(() => exec_state.frame(0).evaluate(source, true),
-                   EvalError);
-    }
-    // Declaring 'a' sets a property to the global object.
-    fail("var a = 3");
-    exec_state.frame(0).evaluate("var a = 2", false);
-    assertEquals(2, a);
-    // Wrapping into an IIFE would be fine, since 'a' is local.
-    success(100,
-            `(function(x) {
-                var a = 0;
-                for (var i = 0; i < x; i++) {
-                  a += x;
-                }
-                return a;
-              })(10);`);
-    success(100,
-            `(x => {
-                let a = 0;
-                for (var i = 0; i < x; i++) {
-                  a += x;
-                }
-                return a;
-              })(10);`);
-    // Not using 'var' to declare would make the access go to global object.
-    fail(   `(function(x) {
-                a = 0;
-                for (var i = 0; i < x; i++) {
-                  a += x;
-                }
-                return a;
-              })(10);`);
-  } catch (e) {
-    exception = e;
-    print(e, e.stack);
-  };
-};
-
-// Add the debug event listener.
-Debug.setListener(listener);
-
-function f() {
-  debugger;
-};
-
-f();
-
-assertNull(exception);
diff --git a/src/v8/test/debugger/debug/debug-evaluate-no-side-effect-ops.js b/src/v8/test/debugger/debug/debug-evaluate-no-side-effect-ops.js
deleted file mode 100644
index b7e49dc..0000000
--- a/src/v8/test/debugger/debug/debug-evaluate-no-side-effect-ops.js
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-Debug = debug.Debug
-
-var exception = null;
-var date = new Date();
-var T = true;
-var F = false;
-var one = 1;
-var two = 2;
-var string = "s";
-var array = [1, 2, 3];
-function max(...rest) {
-  return Math.max(...rest);
-}
-
-function def(a = 1) {
-  return a;
-}
-
-function d1([a, b = 'b']) {
-  return a + b;
-}
-
-function d2({ x: c, y, z = 'z' } = {x: 'x', y: 'y' }) {
-  return c + y + z;
-}
-
-function listener(event, exec_state, event_data, data) {
-  if (event != Debug.DebugEvent.Break) return;
-  try {
-    function success(expectation, source) {
-      var result = exec_state.frame(0).evaluate(source, true).value();
-      if (expectation !== undefined) assertEquals(expectation, result);
-    }
-    function fail(source) {
-      assertThrows(() => exec_state.frame(0).evaluate(source, true),
-                   EvalError);
-    }
-    success(false, `Object == {}`);
-    success(false, `Object === {}`);
-    success(true, `Object != {}`);
-    success(true, `Object !== {}`);
-    success(true, `'s' == string`);
-    success(true, `'s' === string`);
-    success(true, `1 < Math.cos(0) * 2`);
-    success(false, `1 < string`);
-    success(true, `'a' < string`);
-    success("s", `string[0]`);
-    success(0, `[0][0]`);
-    success(1, `T^F`);
-    success(0, `T&F`);
-    success(1, `T|F`);
-    success(false, `T&&F`);
-    success(true, `T||F`);
-    success(false, `T?F:T`);
-    success(false, `!T`);
-    success(1, `+one`);
-    success(-1, `-one`);
-    success(-2, `~one`);
-    success(4, `one << two`);
-    success(1, `two >> one`);
-    success(1, `two >>> one`);
-    success(3, `two + one`);
-    success(2, `two * one`);
-    success(0.5, `one / two`);
-    success(0, `(one / two) | 0`);
-    success(1, `one ** two`);
-    success(NaN, `string * two`);
-    success("s2", `string + two`);
-    success("s2", `string + two`);
-    fail(`[...array]`);
-    success(3, `max(...array)`);
-    fail(`({[string]:1})`);
-    fail(`[a, b] = [1, 2]`);
-    success(2, `def(2)`);
-    success(1, `def()`);
-    fail(`d1(['a'])`);  // Iterator.prototype.next performs stores.
-    success("XYz", `d2({x:'X', y:'Y'})`);
-  } catch (e) {
-    exception = e;
-    print(e, e.stack);
-  };
-};
-
-// Add the debug event listener.
-Debug.setListener(listener);
-
-function f() {
-  debugger;
-};
-
-f();
-
-assertNull(exception);
diff --git a/src/v8/test/debugger/debug/debug-evaluate-no-side-effect.js b/src/v8/test/debugger/debug/debug-evaluate-no-side-effect.js
deleted file mode 100644
index 26cf258..0000000
--- a/src/v8/test/debugger/debug/debug-evaluate-no-side-effect.js
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-Debug = debug.Debug
-
-var exception = null;
-let a = 1;
-var object = { property : 2,
-               get getter() { return 3; }
-             };
-var string1 = { toString() { return "x"; } };
-var string2 = { toString() { print("x"); return "x"; } };
-var array = [4, 5];
-var error = new Error();
-
-function set_a() { a = 2; }
-function get_a() { return a; }
-var bound = get_a.bind(0);
-
-var global_eval = eval;
-
-function listener(event, exec_state, event_data, data) {
-  if (event != Debug.DebugEvent.Break) return;
-  try {
-    function success(expectation, source) {
-      assertEquals(expectation,
-                   exec_state.frame(0).evaluate(source, true).value());
-    }
-    function fail(source) {
-      assertThrows(() => exec_state.frame(0).evaluate(source, true),
-                   EvalError);
-    }
-    // Simple test.
-    success(3, "1 + 2");
-    // Dymanic load.
-    success(array, "array");
-    // Context load.
-    success(1, "a");
-    // Global and named property load.
-    success(2, "object.property");
-    // Load via read-only getter.
-    success(3, "object.getter");
-    // Implicit call to read-only toString.
-    success("xy", "string1 + 'y'");
-    // Keyed property load.
-    success(5, "array[1]");
-    // Call to read-only function.
-    success(1, "get_a()");
-    success(1, "bound()");
-    success({}, "new get_a()");
-    // Call to read-only function within try-catch.
-    success(1, "try { get_a() } catch (e) {}");
-    // Call to C++ built-in.
-    success(Math.sin(2), "Math.sin(2)");
-    // Call to whitelisted get accessors.
-    success(3, "'abc'.length");
-    success(2, "array.length");
-    success(1, "'x'.length");
-    success(0, "set_a.length");
-    success("set_a", "set_a.name");
-    success(0, "bound.length");
-    success("bound get_a", "bound.name");
-    // Test that non-read-only code fails.
-    fail("exception = 1");
-    // Test that calling a non-read-only function fails.
-    fail("set_a()");
-    fail("new set_a()");
-    // Test that implicit call to a non-read-only function fails.
-    fail("string2 + 'y'");
-    // Test that try-catch does not catch the EvalError.
-    fail("try { set_a() } catch (e) {}");
-    // Test that call to set accessor fails.
-    fail("array.length = 4");
-    // Test that call to non-whitelisted get accessor fails.
-    fail("error.stack");
-    // Eval is not allowed.
-    fail("eval('Math.sin(1)')");
-    fail("eval('exception = 1')");
-    fail("global_eval('1')");
-  } catch (e) {
-    exception = e;
-    print(e, e.stack);
-  };
-};
-
-// Add the debug event listener.
-Debug.setListener(listener);
-
-function f() {
-  debugger;
-};
-
-f();
-
-assertNull(exception);
-assertEquals(1, a);
diff --git a/src/v8/test/debugger/debug/debug-liveedit-diff.js b/src/v8/test/debugger/debug/debug-liveedit-diff.js
deleted file mode 100644
index d049cb0..0000000
--- a/src/v8/test/debugger/debug/debug-liveedit-diff.js
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright 2010 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.
-
-
-Debug = debug.Debug
-
-function CheckCompareOneWay(s1, s2) {
-  var diff_array = Debug.LiveEdit.TestApi.CompareStrings(s1, s2);
-
-  var pos1 = 0;
-  var pos2 = 0;
-  print("Compare:");
-  print("s1='" + s1 + "'");
-  print("s2='" + s2 + "'");
-  print("Diff:");
-  print("" + diff_array);
-  for (var i = 0; i < diff_array.length; i += 3) {
-    var similar_length = diff_array[i] - pos1;
-    assertEquals(s1.substring(pos1, pos1 + similar_length),
-                 s2.substring(pos2, pos2 + similar_length));
-
-    print(s1.substring(pos1, pos1 + similar_length));
-    pos1 += similar_length;
-    pos2 += similar_length;
-    print("<<< " + pos1 + " " + diff_array[i + 1]);
-    print(s1.substring(pos1, diff_array[i + 1]));
-    print("===");
-    print(s2.substring(pos2, diff_array[i + 2]));
-    print(">>> " + pos2 + " " + diff_array[i + 2]);
-    pos1 = diff_array[i + 1];
-    pos2 = diff_array[i + 2];
-  }
-  {
-    // After last change
-    var similar_length = s1.length - pos1;
-    assertEquals(similar_length, s2.length - pos2);
-    assertEquals(s1.substring(pos1, pos1 + similar_length),
-                 s2.substring(pos2, pos2 + similar_length));
-
-    print(s1.substring(pos1, pos1 + similar_length));
-  }
-  print("");
-}
-
-function CheckCompareOneWayPlayWithLF(s1, s2) {
-  var s1Oneliner = s1.replace(/\n/g, ' ');
-  var s2Oneliner = s2.replace(/\n/g, ' ');
-  CheckCompareOneWay(s1, s2);
-  CheckCompareOneWay(s1Oneliner, s2);
-  CheckCompareOneWay(s1, s2Oneliner);
-  CheckCompareOneWay(s1Oneliner, s2Oneliner);
-}
-
-function CheckCompare(s1, s2) {
-  CheckCompareOneWayPlayWithLF(s1, s2);
-  CheckCompareOneWayPlayWithLF(s2, s1);
-}
-
-CheckCompare("", "");
-
-CheckCompare("a", "b");
-
-CheckCompare(
-    "yesterday\nall\nmy\ntroubles\nseemed\nso\nfar\naway",
-    "yesterday\nall\nmy\ntroubles\nseem\nso\nfar\naway"
-);
-
-CheckCompare(
-    "yesterday\nall\nmy\ntroubles\nseemed\nso\nfar\naway",
-    "\nall\nmy\ntroubles\nseemed\nso\nfar\naway"
-);
-
-CheckCompare(
-    "yesterday\nall\nmy\ntroubles\nseemed\nso\nfar\naway",
-    "all\nmy\ntroubles\nseemed\nso\nfar\naway"
-);
-
-CheckCompare(
-    "yesterday\nall\nmy\ntroubles\nseemed\nso\nfar\naway",
-    "yesterday\nall\nmy\ntroubles\nseemed\nso\nfar\naway\n"
-);
-
-CheckCompare(
-    "yesterday\nall\nmy\ntroubles\nseemed\nso\nfar\naway",
-    "yesterday\nall\nmy\ntroubles\nseemed\nso\n"
-);
diff --git a/src/v8/test/debugger/debug/debug-liveedit-stack-padding.js b/src/v8/test/debugger/debug/debug-liveedit-stack-padding.js
deleted file mode 100644
index d0cc77a..0000000
--- a/src/v8/test/debugger/debug/debug-liveedit-stack-padding.js
+++ /dev/null
@@ -1,88 +0,0 @@
-// 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.
-
-
-Debug = debug.Debug;
-Debug.setListener(listener);
-
-SlimFunction = eval(
-    "(function() {\n " +
-    "  return 'Cat';\n" +
-    "})\n"
-);
-
-var script = Debug.findScript(SlimFunction);
-
-Debug.setScriptBreakPointById(script.id, 1, 0);
-
-var orig_animal = "'Cat'";
-var patch_pos = script.source.indexOf(orig_animal);
-var new_animal_patch = "'Capybara'";
-
-debugger_handler = (function() {
-  var already_called = false;
-  return function() {
-    if (already_called) {
-      return;
-    }
-    already_called = true;
-
-    var change_log = new Array();
-    try {
-      Debug.LiveEdit.TestApi.ApplySingleChunkPatch(script, patch_pos,
-          orig_animal.length, new_animal_patch, change_log);
-    } finally {
-      print("Change log: " + JSON.stringify(change_log) + "\n");
-    }
-  };
-})();
-
-var saved_exception = null;
-
-function listener(event, exec_state, event_data, data) {
-  if (event == Debug.DebugEvent.Break) {
-    try {
-      debugger_handler();
-    } catch (e) {
-      saved_exception = e;
-    }
-  } else {
-    print("Other: " + event);
-  }
-}
-
-
-var animal = SlimFunction();
-
-if (saved_exception) {
-  print("Exception: " + saved_exception);
-  assertUnreachable();
-}
-
-assertEquals("Capybara", animal);
-
-Debug.setListener(null);
diff --git a/src/v8/test/debugger/debug/debug-liveedit-utils.js b/src/v8/test/debugger/debug/debug-liveedit-utils.js
deleted file mode 100644
index df63181..0000000
--- a/src/v8/test/debugger/debug/debug-liveedit-utils.js
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright 2010 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.
-
-
-Debug = debug.Debug
-
-function Return2010() {
-  return 2010;
-}
-
-
-// Diff it trivial: zero chunks
-var NoChunkTranslator = new Debug.LiveEdit.TestApi.PosTranslator([]);
-
-assertEquals(0, NoChunkTranslator.Translate(0));
-assertEquals(10, NoChunkTranslator.Translate(10));
-
-
-// Diff has one chunk
-var SingleChunkTranslator = new Debug.LiveEdit.TestApi.PosTranslator([20, 30, 25]);
-
-assertEquals(0, SingleChunkTranslator.Translate(0));
-assertEquals(5, SingleChunkTranslator.Translate(5));
-assertEquals(10, SingleChunkTranslator.Translate(10));
-assertEquals(19, SingleChunkTranslator.Translate(19));
-assertEquals(2010, SingleChunkTranslator.Translate(20, Return2010));
-assertEquals(25, SingleChunkTranslator.Translate(30));
-assertEquals(26, SingleChunkTranslator.Translate(31));
-assertEquals(2010, SingleChunkTranslator.Translate(26, Return2010));
-
-try {
-  SingleChunkTranslator.Translate(21);
-  assertTrue(false);
-} catch (ignore) {
-}
-try {
-  SingleChunkTranslator.Translate(24);
-  assertTrue(false);
-} catch (ignore) {
-}
-
-
-// Diff has several chunk (3). See the table below.
-
-/*
-chunks: (new <- old)
- 10   10
- 15   20
-
- 35   40
- 50   40
-
- 70   60
- 70   70
-*/
-
-var MultiChunkTranslator = new Debug.LiveEdit.TestApi.PosTranslator([10, 20, 15, 40, 40, 50, 60, 70, 70 ]);
-assertEquals(5, MultiChunkTranslator.Translate(5));
-assertEquals(9, MultiChunkTranslator.Translate(9));
-assertEquals(2010, MultiChunkTranslator.Translate(10, Return2010));
-assertEquals(15, MultiChunkTranslator.Translate(20));
-assertEquals(20, MultiChunkTranslator.Translate(25));
-assertEquals(34, MultiChunkTranslator.Translate(39));
-assertEquals(50, MultiChunkTranslator.Translate(40, Return2010));
-assertEquals(55, MultiChunkTranslator.Translate(45));
-assertEquals(69, MultiChunkTranslator.Translate(59));
-assertEquals(2010, MultiChunkTranslator.Translate(60, Return2010));
-assertEquals(70, MultiChunkTranslator.Translate(70));
-assertEquals(75, MultiChunkTranslator.Translate(75));
diff --git a/src/v8/test/debugger/debug/debug-modules-set-variable-value.js b/src/v8/test/debugger/debug/debug-modules-set-variable-value.js
deleted file mode 100644
index 1d1c6d5..0000000
--- a/src/v8/test/debugger/debug/debug-modules-set-variable-value.js
+++ /dev/null
@@ -1,378 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// MODULE
-// Flags: --no-always-opt
-
-// The first part of this file is copied over from debug-set-variable-value.js
-// (a few tests were removed because they make no sense for modules). The second
-// part is new.
-
-var Debug = debug.Debug;
-
-// Accepts a function/closure 'fun' that must have a debugger statement inside.
-// A variable 'variable_name' must be initialized before debugger statement
-// and returned after the statement. The test will alter variable value when
-// on debugger statement and check that returned value reflects the change.
-function RunPauseTest(scope_number, expected_old_result, variable_name,
-    new_value, expected_new_result, fun) {
-  var actual_old_result = fun();
-  assertEquals(expected_old_result, actual_old_result);
-
-  var listener_delegate;
-  var listener_called = false;
-  var exception = null;
-
-  function listener_delegate(exec_state) {
-    var scope = exec_state.frame(0).scope(scope_number);
-    scope.setVariableValue(variable_name, new_value);
-  }
-
-  function listener(event, exec_state, event_data, data) {
-    try {
-      if (event == Debug.DebugEvent.Break) {
-        listener_called = true;
-        listener_delegate(exec_state);
-      }
-    } catch (e) {
-      exception = e;
-    }
-  }
-
-  // Add the debug event listener.
-  Debug.setListener(listener);
-
-  var actual_new_result;
-  try {
-    actual_new_result = fun();
-  } finally {
-    Debug.setListener(null);
-  }
-
-  if (exception != null) {
-   assertUnreachable("Exception in listener\n" + exception.stack);
-  }
-  assertTrue(listener_called);
-
-  assertEquals(expected_new_result, actual_new_result);
-}
-
-
-function ClosureTestCase(scope_index, old_result, variable_name, new_value,
-    new_result, success_expected, factory) {
-  this.scope_index_ = scope_index;
-  this.old_result_ = old_result;
-  this.variable_name_ = variable_name;
-  this.new_value_ = new_value;
-  this.new_result_ = new_result;
-  this.success_expected_ = success_expected;
-  this.factory_ = factory;
-}
-
-ClosureTestCase.prototype.run_pause_test = function() {
-  var th = this;
-  var fun = this.factory_(true);
-  this.run_and_catch_(function() {
-    RunPauseTest(th.scope_index_ + 1, th.old_result_, th.variable_name_,
-        th.new_value_, th.new_result_, fun);
-  });
-}
-
-ClosureTestCase.prototype.run_and_catch_ = function(runnable) {
-  if (this.success_expected_) {
-    runnable();
-  } else {
-    assertThrows(runnable);
-  }
-}
-
-
-// Test scopes visible from closures.
-
-var closure_test_cases = [
-  new ClosureTestCase(0, 'cat', 'v1', 5, 5, true,
-      function Factory(debug_stop) {
-    var v1 = 'cat';
-    return function() {
-      if (debug_stop) debugger;
-      return v1;
-    }
-  }),
-
-  new ClosureTestCase(0, 4, 't', 7, 9, true, function Factory(debug_stop) {
-    var t = 2;
-    var r = eval("t");
-    return function() {
-      if (debug_stop) debugger;
-      return r + t;
-    }
-  }),
-
-  new ClosureTestCase(0, 6, 't', 10, 13, true, function Factory(debug_stop) {
-    var t = 2;
-    var r = eval("t = 3");
-    return function() {
-      if (debug_stop) debugger;
-      return r + t;
-    }
-  }),
-
-  new ClosureTestCase(2, 'capybara', 'foo', 77, 77, true,
-      function Factory(debug_stop) {
-    var foo = "capybara";
-    return (function() {
-      var bar = "fish";
-      try {
-        throw {name: "test exception"};
-      } catch (e) {
-        return function() {
-          if (debug_stop) debugger;
-          bar = "beast";
-          return foo;
-        }
-      }
-    })();
-  }),
-
-  new ClosureTestCase(0, 'AlphaBeta', 'eee', 5, '5Beta', true,
-      function Factory(debug_stop) {
-    var foo = "Beta";
-    return (function() {
-      var bar = "fish";
-      try {
-        throw "Alpha";
-      } catch (eee) {
-        return function() {
-          if (debug_stop) debugger;
-          return eee + foo;
-        }
-      }
-    })();
-  })
-];
-
-for (var i = 0; i < closure_test_cases.length; i++) {
-  closure_test_cases[i].run_pause_test();
-}
-
-
-// Test local scope.
-
-RunPauseTest(0, 'HelloYou', 'u', 'We', 'HelloWe', (function Factory() {
-  return function() {
-    var u = "You";
-    var v = "Hello";
-    debugger;
-    return v + u;
-  }
-})());
-
-RunPauseTest(0, 'Helloworld', 'p', 'GoodBye', 'HelloGoodBye',
-    (function Factory() {
-  function H(p) {
-    var v = "Hello";
-    debugger;
-    return v + p;
-  }
-  return function() {
-    return H("world");
-  }
-})());
-
-RunPauseTest(0, 'mouse', 'v1', 'dog', 'dog', (function Factory() {
-  return function() {
-    var v1 = 'cat';
-    eval("v1 = 'mouse'");
-    debugger;
-    return v1;
-  }
-})());
-
-// Check that we correctly update local variable that
-// is referenced from an inner closure.
-RunPauseTest(0, 'Blue', 'v', 'Green', 'Green', (function Factory() {
-  return function() {
-    function A() {
-      var v = "Blue";
-      function Inner() {
-        return void v;
-      }
-      debugger;
-      return v;
-    }
-    return A();
-  }
-})());
-
-// Check that we correctly update parameter, that is known to be stored
-// both on stack and in heap.
-RunPauseTest(0, 5, 'p', 2012, 2012, (function Factory() {
-  return function() {
-    function A(p) {
-      function Inner() {
-        return void p;
-      }
-      debugger;
-      return p;
-    }
-    return A(5);
-  }
-})());
-
-
-////////////////////////////////////////////////////////////////////////////////
-// From here on we test the module scope.
-////////////////////////////////////////////////////////////////////////////////
-
-
-// Non-existing variable.
-{
-  let exception;
-  function listener(event, exec_state) {
-    if (event == Debug.DebugEvent.Break) {
-      let module_scope = exec_state.frame().scope(1);
-      assertEquals(debug.ScopeType.Module, module_scope.scopeType());
-      try {
-        module_scope.setVariableValue('spargel', 42);
-      } catch(e) { exception = e; }
-    }
-  }
-
-  Debug.setListener(listener);
-  assertThrows(() => spargel, ReferenceError);
-  debugger;
-  assertThrows(() => spargel, ReferenceError);
-  assertTrue(exception !== undefined);
-}
-
-
-// Local (non-exported) variable.
-let salat = 12;
-{
-  function listener(event, exec_state) {
-    if (event == Debug.DebugEvent.Break) {
-      let module_scope = exec_state.frame().scope(1);
-      assertEquals(debug.ScopeType.Module, module_scope.scopeType());
-      module_scope.setVariableValue('salat', 42);
-    }
-  }
-
-  Debug.setListener(listener);
-  assertEquals(12, salat);
-  debugger;
-  assertEquals(42, salat);
-}
-
-
-// Local (non-exported) variable, nested access.
-let salad = 12;
-{
-  function listener(event, exec_state) {
-    if (event == Debug.DebugEvent.Break) {
-      let scope_count = exec_state.frame().scopeCount();
-      let module_scope = exec_state.frame().scope(1);
-      assertEquals(debug.ScopeType.Module, module_scope.scopeType());
-      module_scope.setVariableValue('salad', 42);
-    }
-  }
-
-  Debug.setListener(listener);
-  function foo() {
-    assertEquals(12, salad);
-    debugger;
-    assertEquals(42, salad);
-  };
-  foo();
-}
-
-
-// Exported variable.
-export let salami = 1;
-{
-  function listener(event, exec_state) {
-    if (event == Debug.DebugEvent.Break) {
-      let module_scope = exec_state.frame().scope(1);
-      assertEquals(debug.ScopeType.Module, module_scope.scopeType());
-      module_scope.setVariableValue('salami', 2);
-    }
-  }
-
-  Debug.setListener(listener);
-  assertEquals(1, salami);
-  debugger;
-  assertEquals(2, salami);
-}
-
-
-// Exported variable, nested access.
-export let ham = 1;
-{
-  function listener(event, exec_state) {
-    if (event == Debug.DebugEvent.Break) {
-      let scope_count = exec_state.frame().scopeCount();
-      let module_scope = exec_state.frame().scope(1);
-      assertEquals(debug.ScopeType.Module, module_scope.scopeType());
-      module_scope.setVariableValue('ham', 2);
-    }
-  }
-
-  Debug.setListener(listener);
-  function foo() {
-    assertEquals(1, ham);
-    debugger;
-    assertEquals(2, ham);
-  };
-  foo();
-}
-
-
-// Imported variable. Setting is currently not supported.
-import { salami as wurst } from "./debug-modules-set-variable-value.js";
-{
-  let exception;
-  function listener(event, exec_state) {
-    if (event == Debug.DebugEvent.Break) {
-      let module_scope = exec_state.frame().scope(1);
-      assertEquals(debug.ScopeType.Module, module_scope.scopeType());
-      try {
-        module_scope.setVariableValue('wurst', 3);
-      } catch(e) { exception = e; }
-    }
-  }
-
-  Debug.setListener(listener);
-  assertEquals(2, wurst);
-  debugger;
-  assertEquals(2, wurst);
-  assertTrue(exception !== undefined);
-}
-
-
-// Imported variable, nested access. Setting is currently not supported.
-import { salami as wurstl } from "./debug-modules-set-variable-value.js";
-{
-  let exception;
-  function listener(event, exec_state) {
-    if (event == Debug.DebugEvent.Break) {
-      let scope_count = exec_state.frame().scopeCount();
-      let module_scope = exec_state.frame().scope(2);
-      assertEquals(debug.ScopeType.Module, module_scope.scopeType());
-      try {
-        module_scope.setVariableValue('wurstl', 3);
-      } catch(e) { exception = e; }
-    }
-  }
-
-  Debug.setListener(listener);
-  function foo() {
-    assertEquals(2, wurstl);
-    debugger;
-    assertEquals(2, wurstl);
-    assertTrue(exception !== undefined);
-  };
-  foo();
-}
-
-
-Debug.setListener(null);
diff --git a/src/v8/test/debugger/debug/debug-script.js b/src/v8/test/debugger/debug/debug-script.js
deleted file mode 100644
index 342f619..0000000
--- a/src/v8/test/debugger/debug/debug-script.js
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright 2008 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.
-
-// Flags: --expose-gc --send-idle-notification
-// Flags: --expose-natives-as natives
-// Flags: --noharmony-shipping
-// Flags: --nostress-opt --nostress-background-compile
-
-// --nostress-opt and --nostress-background-compilation is specified because in
-// stress mode the compilation cache may hold on to old copies of scripts (see
-// bug 1641).
-
-// Note: this test checks that that the number of scripts reported as native
-// by Debug.scripts() is the same as a number of core native scripts.
-// Native scripts that are added by --harmony-shipping are classified
-// as 'experimental', but are still returned by Debug.scripts(), so
-// we disable harmony-shipping for this test
-
-Debug = debug.Debug;
-Debug.setListener(function(){});
-
-Date();
-RegExp();
-
-// Count script types.
-var named_native_count = 0;
-var named_native_names = {};
-var extension_count = 0;
-var normal_count = 0;
-var inspector_count = 0;
-var scripts = Debug.scripts();
-for (i = 0; i < scripts.length; i++) {
-  if (scripts[i].type == Debug.ScriptType.Native) {
-    if (scripts[i].name) {
-      // TODO(1641): Remove check for equally named native scripts once the
-      // underlying issue is fixed.
-      if (!named_native_names[scripts[i].name]) {
-        named_native_names[scripts[i].name] = true;
-        named_native_count++;
-      }
-    }
-  } else if (scripts[i].type == Debug.ScriptType.Extension) {
-    extension_count++;
-  } else if (scripts[i].type == Debug.ScriptType.Normal) {
-    normal_count++;
-  } else if (scripts[i].type == Debug.ScriptType.Inspector) {
-    inspector_count++;
-  } else {
-    assertUnreachable('Unexpected type ' + scripts[i].type);
-  }
-}
-
-// This has to be updated if the number of native scripts change.
-assertEquals(%NativeScriptsCount(), named_native_count);
-// The 'gc' extension and one or two extras scripts are loaded.
-assertTrue(extension_count == 2 || extension_count == 3);
-// This script, test-api.js and mjsunit.js has been loaded.  If using d8, d8
-// loads a normal script during startup too.
-assertTrue(normal_count == 3 || normal_count == 4);
-assertTrue(inspector_count == 0);
-
-// Test a builtins script.
-var array_script = Debug.findScript('native array.js');
-assertEquals('native array.js', array_script.name);
-assertEquals(Debug.ScriptType.Native, array_script.type);
-
-// Test a debugger script.
-var debug_delay_script = Debug.findScript('native debug.js');
-assertEquals('native debug.js', debug_delay_script.name);
-assertEquals(Debug.ScriptType.Native, debug_delay_script.type);
-
-// Test an extension script.
-var extension_gc_script = Debug.findScript('v8/gc');
-if (extension_gc_script) {
-  assertEquals('v8/gc', extension_gc_script.name);
-  assertEquals(Debug.ScriptType.Extension, extension_gc_script.type);
-}
-
-// Test a normal script.
-var debug_script = Debug.findScript(/debug-script.js/);
-assertTrue(/debug-script.js/.test(debug_script.name));
-assertEquals(Debug.ScriptType.Normal, debug_script.type);
-
-// Check a nonexistent script.
-var dummy_script = Debug.findScript('dummy.js');
-assertTrue(typeof dummy_script == 'undefined');
-
-Debug.setListener(null);
diff --git a/src/v8/test/debugger/debug/debug-setbreakpoint.js b/src/v8/test/debugger/debug/debug-setbreakpoint.js
deleted file mode 100644
index bfcab7c..0000000
--- a/src/v8/test/debugger/debug/debug-setbreakpoint.js
+++ /dev/null
@@ -1,140 +0,0 @@
-// Copyright 2008 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.
-
-Debug = debug.Debug
-
-// Simple function which stores the last debug event.
-var listenerComplete = false;
-var exception = false;
-var f_script_id = 0;
-var g_script_id = 0;
-var h_script_id = 0;
-var f_line = 0;
-var g_line = 0;
-var h_line = 0;
-
-function listener(event, exec_state, event_data, data) {
-  try {
-    if (event == Debug.DebugEvent.Break) {
-      if (listenerComplete) return;
-
-      Debug.setScriptBreakPointById(f_script_id, f_line);
-      Debug.setScriptBreakPointById(g_script_id, g_line);
-      Debug.setScriptBreakPointById(h_script_id, h_line);
-
-      // Indicate that all was processed.
-      listenerComplete = true;
-    }
-  } catch (e) {
-    exception = e
-    print(e)
-  };
-};
-
-// Add the debug event listener.
-Debug.setListener(listener);
-
-function f() {
-  a=1;
-};
-
-function g() {
-  // Comment.
-  f();
-};
-
-eval('function h(){}');
-eval('function sourceUrlFunc() { a = 2; }\n//# sourceURL=sourceUrlScript');
-
-o = {a:function(){},b:function(){}}
-
-// Check the script ids for the test functions.
-f_script_id = Debug.findScript(f).id;
-g_script_id = Debug.findScript(g).id;
-h_script_id = Debug.findScript(h).id;
-sourceURL_script_id = Debug.findScript(sourceUrlFunc).id;
-
-assertTrue(f_script_id > 0, "invalid script id for f");
-assertTrue(g_script_id > 0, "invalid script id for g");
-assertTrue(h_script_id > 0, "invalid script id for h");
-assertTrue(sourceURL_script_id > 0, "invalid script id for sourceUrlFunc");
-assertEquals(f_script_id, g_script_id);
-
-// Get the source line for the test functions.
-f_line = Debug.findFunctionSourceLocation(f).line;
-g_line = Debug.findFunctionSourceLocation(g).line;
-h_line = Debug.findFunctionSourceLocation(h).line;
-assertTrue(f_line > 0, "invalid line for f");
-assertTrue(g_line > 0, "invalid line for g");
-assertTrue(f_line < g_line);
-assertEquals(h_line, 0, "invalid line for h");
-
-// Set a break point and call to invoke the debug event listener.
-Debug.setBreakPoint(g, 0, 0);
-g();
-
-// Make sure that the debug event listener was invoked.
-assertTrue(listenerComplete, "listener did not run to completion: " + exception);
-
-// Try setting breakpoint by url specified in sourceURL
-
-var breakListenerCalled = false;
-
-function breakListener(event) {
-  if (event == Debug.DebugEvent.Break)
-    breakListenerCalled = true;
-}
-
-Debug.setBreakPoint(sourceUrlFunc);
-
-Debug.setListener(breakListener);
-
-sourceUrlFunc();
-
-assertTrue(breakListenerCalled, "Break listener not called on breakpoint set by sourceURL");
-
-
-// Breakpoint in a script with no statements test case. If breakpoint is set
-// to the script body, its actual position is taken from the nearest statement
-// below or like in this case is reset to the very end of the script.
-// Unless some precautions made, this position becomes out-of-range and
-// we get an exception.
-
-// Gets a script of 'i1' function and sets the breakpoint at line #4 which
-// should be empty.
-function SetBreakpointInI1Script() {
-  var i_script = Debug.findScript(i1);
-  assertTrue(!!i_script, "invalid script for i1");
-  Debug.setScriptBreakPoint(Debug.ScriptBreakPointType.ScriptId,
-                            i_script.id, 4);
-}
-
-// Creates the eval script and tries to set the breakpoint.
-// The tricky part is that the script function must be strongly reachable at the
-// moment. Since there's no way of simply getting the pointer to the function,
-// we run this code while the script function is being activated on stack.
-eval('SetBreakpointInI1Script()\nfunction i1(){}\n\n\n\nfunction i2(){}\n');
diff --git a/src/v8/test/debugger/debug/debug-sourceinfo.js b/src/v8/test/debugger/debug/debug-sourceinfo.js
deleted file mode 100644
index 1085dca..0000000
--- a/src/v8/test/debugger/debug/debug-sourceinfo.js
+++ /dev/null
@@ -1,199 +0,0 @@
-// Copyright 2008 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.
-
-function a() { b(); };
-function    b() {
-  c(true);
-};
-  function c(x) {
-    if (x) {
-      return 1;
-    } else {
-      return 1;
-    }
-  };
-function d(x) {
-  x = 1 ;
-  x = 2 ;
-  x = 3 ;
-  x = 4 ;
-  x = 5 ;
-  x = 6 ;
-  x = 7 ;
-  x = 8 ;
-  x = 9 ;
-  x = 10;
-  x = 11;
-  x = 12;
-  x = 13;
-  x = 14;
-  x = 15;
-}
-
-Debug = debug.Debug
-
-// This is the number of comment lines above the first test function.
-var comment_lines = 27;
-
-// This is the last position in the entire file (note: this equals
-// file size of <debug-sourceinfo.js> - 1, since starting at 0).
-var last_position = 8022;
-// This is the last line of entire file (note: starting at 0).
-var last_line = 198;
-// This is the last column of last line (note: starting at 0).
-var last_column = 71;
-
-// This magic number is the length or the first line comment (actually number
-// of characters before 'function a(...'.
-var comment_line_length = 1599;
-var start_a = 9 + comment_line_length;
-var start_b = 35 + comment_line_length;
-var start_c = 66 + comment_line_length;
-var start_d = 151 + comment_line_length;
-
-// The position of the first line of d(), i.e. "x = 1 ;".
-var start_code_d = start_d + 6;
-// The line # of the first line of d() (note: starting at 0).
-var start_line_d = 39;
-var line_length_d = 10;
-var num_lines_d = 15;
-
-assertEquals(start_a, Debug.sourcePosition(a));
-assertEquals(start_b, Debug.sourcePosition(b));
-assertEquals(start_c, Debug.sourcePosition(c));
-assertEquals(start_d, Debug.sourcePosition(d));
-
-var script = Debug.findScript(a);
-assertTrue(script.data === Debug.findScript(b).data);
-assertTrue(script.data === Debug.findScript(c).data);
-assertTrue(script.data === Debug.findScript(d).data);
-assertTrue(script.source === Debug.findScript(b).source);
-assertTrue(script.source === Debug.findScript(c).source);
-assertTrue(script.source === Debug.findScript(d).source);
-
-// Test that when running through source positions the position, line and
-// column progresses as expected.
-var position;
-var line;
-var column;
-for (var p = 0; p < 100; p++) {
-  var location = script.locationFromPosition(p);
-  if (p > 0) {
-    assertEquals(position + 1, location.position);
-    if (line == location.line) {
-      assertEquals(column + 1, location.column);
-    } else {
-      assertEquals(line + 1, location.line);
-      assertEquals(0, location.column);
-    }
-  } else {
-    assertEquals(0, location.position);
-    assertEquals(0, location.line);
-    assertEquals(0, location.column);
-  }
-
-  // Remember the location.
-  position = location.position;
-  line = location.line;
-  column = location.column;
-}
-
-// Every line of d() is the same length.  Verify we can loop through all
-// positions and find the right line # for each.
-var p = start_code_d;
-for (line = 0; line < num_lines_d; line++) {
-  for (column = 0; column < line_length_d; column++) {
-    var location = script.locationFromPosition(p);
-    assertEquals(p, location.position);
-    assertEquals(start_line_d + line, location.line);
-    assertEquals(column, location.column);
-    p++;
-  }
-}
-
-// Test first position.
-assertEquals(0, script.locationFromPosition(0).position);
-assertEquals(0, script.locationFromPosition(0).line);
-assertEquals(0, script.locationFromPosition(0).column);
-
-// Test second position.
-assertEquals(1, script.locationFromPosition(1).position);
-assertEquals(0, script.locationFromPosition(1).line);
-assertEquals(1, script.locationFromPosition(1).column);
-
-// Test first position in function a().
-assertEquals(start_a, script.locationFromPosition(start_a).position);
-assertEquals(0, script.locationFromPosition(start_a).line - comment_lines);
-assertEquals(10, script.locationFromPosition(start_a).column);
-
-// Test first position in function b().
-assertEquals(start_b, script.locationFromPosition(start_b).position);
-assertEquals(1, script.locationFromPosition(start_b).line - comment_lines);
-assertEquals(13, script.locationFromPosition(start_b).column);
-
-// Test first position in function c().
-assertEquals(start_c, script.locationFromPosition(start_c).position);
-assertEquals(4, script.locationFromPosition(start_c).line - comment_lines);
-assertEquals(12, script.locationFromPosition(start_c).column);
-
-// Test first position in function d().
-assertEquals(start_d, script.locationFromPosition(start_d).position);
-assertEquals(11, script.locationFromPosition(start_d).line - comment_lines);
-assertEquals(10, script.locationFromPosition(start_d).column);
-
-// Test the Debug.findSourcePosition which wraps SourceManager.
-assertEquals(0 + start_a, Debug.findFunctionSourceLocation(a, 0, 0).position);
-assertEquals(0 + start_b, Debug.findFunctionSourceLocation(b, 0, 0).position);
-assertEquals(5 + start_b, Debug.findFunctionSourceLocation(b, 1, 0).position);
-assertEquals(7 + start_b, Debug.findFunctionSourceLocation(b, 1, 2).position);
-assertEquals(16 + start_b, Debug.findFunctionSourceLocation(b, 2, 0).position);
-assertEquals(0 + start_c, Debug.findFunctionSourceLocation(c, 0, 0).position);
-assertEquals(6 + start_c, Debug.findFunctionSourceLocation(c, 1, 0).position);
-assertEquals(19 + start_c, Debug.findFunctionSourceLocation(c, 2, 0).position);
-assertEquals(35 + start_c, Debug.findFunctionSourceLocation(c, 3, 0).position);
-assertEquals(48 + start_c, Debug.findFunctionSourceLocation(c, 4, 0).position);
-assertEquals(64 + start_c, Debug.findFunctionSourceLocation(c, 5, 0).position);
-assertEquals(70 + start_c, Debug.findFunctionSourceLocation(c, 6, 0).position);
-assertEquals(0 + start_d, Debug.findFunctionSourceLocation(d, 0, 0).position);
-assertEquals(6 + start_d, Debug.findFunctionSourceLocation(d, 1, 0).position);
-for (i = 1; i <= num_lines_d; i++) {
-  assertEquals(6 + (i * line_length_d) + start_d,
-               Debug.findFunctionSourceLocation(d, (i + 1), 0).position);
-}
-assertEquals(158 + start_d, Debug.findFunctionSourceLocation(d, 17, 0).position);
-
-// Make sure invalid inputs work properly.
-assertEquals(0, script.locationFromPosition(-1).line);
-assertEquals(null, script.locationFromPosition(last_position + 2));
-
-// Test last position.
-assertEquals(last_position, script.locationFromPosition(last_position).position);
-assertEquals(last_line, script.locationFromPosition(last_position).line);
-assertEquals(last_column, script.locationFromPosition(last_position).column);
-assertEquals(last_line + 1,
-             script.locationFromPosition(last_position + 1).line);
-assertEquals(0, script.locationFromPosition(last_position + 1).column);
diff --git a/src/v8/test/debugger/debug/harmony/modules-debug-scopes1.js b/src/v8/test/debugger/debug/harmony/modules-debug-scopes1.js
deleted file mode 100644
index cbecca9..0000000
--- a/src/v8/test/debugger/debug/harmony/modules-debug-scopes1.js
+++ /dev/null
@@ -1,871 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// MODULE
-// Flags: --allow-natives-syntax --noanalyze-environment-liveness
-
-// These tests are copied from mjsunit/debug-scopes.js and adapted for modules.
-
-
-var Debug = debug.Debug;
-
-var test_name;
-var listener_delegate;
-var listener_called;
-var exception;
-var begin_test_count = 0;
-var end_test_count = 0;
-var break_count = 0;
-
-
-// Debug event listener which delegates.
-function listener(event, exec_state, event_data, data) {
-  try {
-    if (event == Debug.DebugEvent.Break) {
-      break_count++;
-      listener_called = true;
-      listener_delegate(exec_state);
-    }
-  } catch (e) {
-    exception = e;
-  }
-}
-
-// Add the debug event listener.
-Debug.setListener(listener);
-
-
-// Initialize for a new test.
-function BeginTest(name) {
-  test_name = name;
-  listener_delegate = null;
-  listener_called = false;
-  exception = null;
-  begin_test_count++;
-}
-
-
-// Check result of a test.
-function EndTest() {
-  assertTrue(listener_called, "listener not called for " + test_name);
-  assertNull(exception, test_name + " / " + exception);
-  end_test_count++;
-}
-
-
-// Check that two scope are the same.
-function assertScopeMirrorEquals(scope1, scope2) {
-  assertEquals(scope1.scopeType(), scope2.scopeType());
-  assertEquals(scope1.frameIndex(), scope2.frameIndex());
-  assertEquals(scope1.scopeIndex(), scope2.scopeIndex());
-  assertPropertiesEqual(scope1.scopeObject().value(),
-                        scope2.scopeObject().value());
-}
-
-function CheckFastAllScopes(scopes, exec_state)
-{
-  var fast_all_scopes = exec_state.frame().allScopes(true);
-  var length = fast_all_scopes.length;
-  assertTrue(scopes.length >= length);
-  for (var i = 0; i < scopes.length && i < length; i++) {
-    var scope = fast_all_scopes[length - i - 1];
-    assertEquals(scopes[scopes.length - i - 1], scope.scopeType());
-  }
-}
-
-
-// Check that the scope chain contains the expected types of scopes.
-function CheckScopeChain(scopes, exec_state) {
-  var all_scopes = exec_state.frame().allScopes();
-  assertEquals(scopes.length, exec_state.frame().scopeCount());
-  assertEquals(scopes.length, all_scopes.length,
-               "FrameMirror.allScopes length");
-  for (var i = 0; i < scopes.length; i++) {
-    var scope = exec_state.frame().scope(i);
-    assertEquals(scopes[i], scope.scopeType());
-    assertScopeMirrorEquals(all_scopes[i], scope);
-  }
-  CheckFastAllScopes(scopes, exec_state);
-}
-
-
-// Check that the scope chain contains the expected names of scopes.
-function CheckScopeChainNames(names, exec_state) {
-  var all_scopes = exec_state.frame().allScopes();
-  assertEquals(names.length, all_scopes.length, "FrameMirror.allScopes length");
-  for (var i = 0; i < names.length; i++) {
-    var scope = exec_state.frame().scope(i);
-    assertEquals(names[i], scope.details().name())
-  }
-}
-
-
-// Check that the scope contains at least minimum_content. For functions just
-// check that there is a function.
-function CheckScopeContent(minimum_content, number, exec_state) {
-  var scope = exec_state.frame().scope(number);
-  var minimum_count = 0;
-  for (var p in minimum_content) {
-    var property_mirror = scope.scopeObject().property(p);
-    assertFalse(property_mirror.isUndefined(),
-                'property ' + p + ' not found in scope');
-    assertEquals(minimum_content[p], property_mirror.value().value(),
-                 'property ' + p + ' has unexpected value');
-    minimum_count++;
-  }
-
-  // 'arguments' and might be exposed in the local and closure scope. Just
-  // ignore this.
-  var scope_size = scope.scopeObject().properties().length;
-  if (!scope.scopeObject().property('arguments').isUndefined()) {
-    scope_size--;
-  }
-  // Ditto for 'this'.
-  if (!scope.scopeObject().property('this').isUndefined()) {
-    scope_size--;
-  }
-  // Temporary variables introduced by the parser have not been materialized.
-  assertTrue(scope.scopeObject().property('').isUndefined());
-
-  if (scope_size < minimum_count) {
-    print('Names found in scope:');
-    var names = scope.scopeObject().propertyNames();
-    for (var i = 0; i < names.length; i++) {
-      print(names[i]);
-    }
-  }
-  assertTrue(scope_size >= minimum_count);
-}
-
-// Check that the scopes have positions as expected.
-function CheckScopeChainPositions(positions, exec_state) {
-  var all_scopes = exec_state.frame().allScopes();
-  assertTrue(positions.length <= all_scopes.length,
-             "FrameMirror.allScopes length");
-  for (var i = 0; i < positions.length; i++) {
-    var scope = exec_state.frame().scope(i);
-    var position = positions[i];
-    if (!position)
-      continue;
-
-    print(
-        `Checking position.start = ${position.start}, .end = ${position.end}`);
-    assertEquals(position.start, scope.details().startPosition())
-    assertEquals(position.end, scope.details().endPosition())
-  }
-}
-
-// Simple empty local scope.
-BeginTest("Local 1");
-
-function local_1() {
-  debugger;
-}
-
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Local,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeContent({}, 0, exec_state);
-};
-local_1();
-EndTest();
-
-
-// Local scope with a parameter.
-BeginTest("Local 2");
-
-function local_2(a) {
-  debugger;
-}
-
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Local,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeContent({a:1}, 0, exec_state);
-};
-local_2(1);
-EndTest();
-
-
-// Local scope with a parameter and a local variable.
-BeginTest("Local 3");
-
-function local_3(a) {
-  var x = 3;
-  debugger;
-}
-
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Local,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeContent({a:1,x:3}, 0, exec_state);
-};
-local_3(1);
-EndTest();
-
-
-// Local scope with parameters and local variables.
-BeginTest("Local 4");
-
-function local_4(a, b) {
-  var x = 3;
-  var y = 4;
-  debugger;
-}
-
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Local,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeContent({a:1,b:2,x:3,y:4}, 0, exec_state);
-};
-local_4(1, 2);
-EndTest();
-
-
-// Empty local scope with use of eval.
-BeginTest("Local 5");
-
-function local_5() {
-  eval('');
-  debugger;
-}
-
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Local,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeContent({}, 0, exec_state);
-};
-local_5();
-EndTest();
-
-
-// Local introducing local variable using eval.
-BeginTest("Local 6");
-
-function local_6() {
-  eval('var i = 5');
-  debugger;
-}
-
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Local,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeContent({}, 0, exec_state);
-};
-local_6();
-EndTest();
-
-
-// Local scope with parameters and local variables.
-BeginTest("Local 7");
-
-function local_7(a, b) {
-  var x = 3;
-  var y = 4;
-  eval('var i = 5');
-  eval('var j = 6');
-  debugger;
-}
-
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Local,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeContent({a:1,b:2,x:3,y:4}, 0, exec_state);
-};
-local_7(1, 2);
-EndTest();
-
-
-// Simple closure formed by returning an inner function referering the outer
-// functions arguments.
-BeginTest("Closure 1");
-
-function closure_1(a) {
-  function f() {
-    debugger;
-    return a;
-  };
-  return f;
-}
-
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Local,
-                   debug.ScopeType.Closure,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeContent({a:1}, 1, exec_state);
-  CheckScopeChainNames(["f", "closure_1", undefined, undefined, undefined], exec_state)
-};
-closure_1(1)();
-EndTest();
-
-
-// Simple closure formed by returning an inner function referering the outer
-// functions arguments. Due to VM optimizations parts of the actual closure is
-// missing from the debugger information.
-BeginTest("Closure 2");
-
-function closure_2(a, b) {
-  var x = a + 2;
-  var y = b + 2;
-  function f() {
-    debugger;
-    return a + x;
-  };
-  return f;
-}
-
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Local,
-                   debug.ScopeType.Closure,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeContent({a:1,x:3}, 1, exec_state);
-  CheckScopeChainNames(["f", "closure_2", undefined, undefined, undefined],
-                       exec_state)
-};
-closure_2(1, 2)();
-EndTest();
-
-
-// Simple closure formed by returning an inner function referering the outer
-// functions arguments. Using all arguments and locals from the outer function
-// in the inner function makes these part of the debugger information on the
-// closure.
-BeginTest("Closure 3");
-
-function closure_3(a, b) {
-  var x = a + 2;
-  var y = b + 2;
-  function f() {
-    debugger;
-    return a + b + x + y;
-  };
-  return f;
-}
-
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Local,
-                   debug.ScopeType.Closure,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeContent({a:1,b:2,x:3,y:4}, 1, exec_state);
-  CheckScopeChainNames(["f", "closure_3", undefined, undefined, undefined],
-                       exec_state)
-};
-closure_3(1, 2)();
-EndTest();
-
-
-
-// Simple closure formed by returning an inner function referering the outer
-// functions arguments. Using all arguments and locals from the outer function
-// in the inner function makes these part of the debugger information on the
-// closure. Use the inner function as well...
-BeginTest("Closure 4");
-
-function closure_4(a, b) {
-  var x = a + 2;
-  var y = b + 2;
-  function f() {
-    debugger;
-    if (f) {
-      return a + b + x + y;
-    }
-  };
-  return f;
-}
-
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Local,
-                   debug.ScopeType.Closure,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeContent({a:1,b:2,x:3,y:4,f:undefined}, 1, exec_state);
-  CheckScopeChainNames(["f", "closure_4", undefined, undefined, undefined],
-                       exec_state)
-};
-closure_4(1, 2)();
-EndTest();
-
-
-
-// Simple closure formed by returning an inner function referering the outer
-// functions arguments. In the presence of eval all arguments and locals
-// (including the inner function itself) from the outer function becomes part of
-// the debugger infformation on the closure.
-BeginTest("Closure 5");
-
-function closure_5(a, b) {
-  var x = 3;
-  var y = 4;
-  function f() {
-    eval('');
-    debugger;
-    return 1;
-  };
-  return f;
-}
-
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Local,
-                   debug.ScopeType.Closure,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeContent({a:1,b:2,x:3,y:4,f:undefined}, 1, exec_state);
-  CheckScopeChainNames(["f", "closure_5", undefined, undefined, undefined],
-                       exec_state)
-};
-closure_5(1, 2)();
-EndTest();
-
-
-// Two closures. Due to optimizations only the parts actually used are provided
-// through the debugger information.
-BeginTest("Closure 6");
-let some_global;
-function closure_6(a, b) {
-  function f(a, b) {
-    var x = 3;
-    var y = 4;
-    return function() {
-      var x = 3;
-      var y = 4;
-      debugger;
-      some_global = a;
-      return f;
-    };
-  }
-  return f(a, b);
-}
-
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Local,
-                   debug.ScopeType.Closure,
-                   debug.ScopeType.Closure,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeContent({a:1}, 1, exec_state);
-  CheckScopeContent({f:undefined}, 2, exec_state);
-  CheckScopeChainNames(
-      [undefined, "f", "closure_6", undefined, undefined, undefined],
-      exec_state);
-};
-closure_6(1, 2)();
-EndTest();
-
-
-// Two closures. In the presence of eval all information is provided as the
-// compiler cannot determine which parts are used.
-BeginTest("Closure 7");
-function closure_7(a, b) {
-  var x = 3;
-  var y = 4;
-  eval('var i = 5');
-  eval('var j = 6');
-  function f(a, b) {
-    var x = 3;
-    var y = 4;
-    eval('var i = 5');
-    eval('var j = 6');
-    return function() {
-      debugger;
-      some_global = a;
-      return f;
-    };
-  }
-  return f(a, b);
-}
-
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Local,
-                   debug.ScopeType.Closure,
-                   debug.ScopeType.Closure,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeContent({}, 0, exec_state);
-  CheckScopeContent({a:1,b:2,x:3,y:4}, 1, exec_state);
-  CheckScopeContent({a:1,b:2,x:3,y:4,f:undefined}, 2, exec_state);
-  CheckScopeChainNames(
-      [undefined, "f", "closure_7", undefined, undefined, undefined],
-      exec_state);
-};
-closure_7(1, 2)();
-EndTest();
-
-
-// Closure that may be optimized out.
-BeginTest("Closure 8");
-function closure_8() {
-  (function inner(x) {
-    debugger;
-  })(2);
-}
-
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Local,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeContent({x: 2}, 0, exec_state);
-  CheckScopeChainNames(["inner", undefined, undefined, undefined], exec_state);
-};
-closure_8();
-EndTest();
-
-
-BeginTest("Closure 9");
-let closure_9 = Function(' \
-  eval("var y = 1;"); \
-  eval("var z = 1;"); \
-  (function inner(x) { \
-    y++; \
-    z++; \
-    debugger; \
-  })(2); \
-')
-
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Local,
-                   debug.ScopeType.Closure,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeChainNames(["inner", undefined, undefined, undefined], exec_state);
-};
-closure_9();
-EndTest();
-
-
-// Test global scope.
-BeginTest("Global");
-listener_delegate = function(exec_state) {
-  CheckScopeChain(
-      [debug.ScopeType.Module, debug.ScopeType.Script, debug.ScopeType.Global],
-      exec_state);
-  CheckScopeChainNames([undefined, undefined, undefined], exec_state);
-};
-debugger;
-EndTest();
-
-
-BeginTest("Catch block 1");
-function catch_block_1() {
-  try {
-    throw 'Exception';
-  } catch (e) {
-    debugger;
-  }
-};
-
-
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Catch,
-                   debug.ScopeType.Local,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeContent({e:'Exception'}, 0, exec_state);
-  CheckScopeChainNames(
-      ["catch_block_1", "catch_block_1", undefined, undefined, undefined],
-      exec_state);
-};
-catch_block_1();
-EndTest();
-
-
-BeginTest("Catch block 3");
-function catch_block_3() {
-  eval("var y = 78;");
-  try {
-    throw 'Exception';
-  } catch (e) {
-    debugger;
-  }
-};
-
-
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Catch,
-                   debug.ScopeType.Local,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeContent({e:'Exception'}, 0, exec_state);
-  CheckScopeContent({}, 1, exec_state);
-  CheckScopeChainNames(
-      ["catch_block_3", "catch_block_3", undefined, undefined, undefined],
-      exec_state);
-};
-catch_block_3();
-EndTest();
-
-
-// Test catch in global scope.
-BeginTest("Catch block 5");
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Catch,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeContent({e:'Exception'}, 0, exec_state);
-  CheckScopeChainNames([undefined, undefined, undefined, undefined],
-                       exec_state);
-};
-
-try {
-  throw 'Exception';
-} catch (e) {
-  debugger;
-}
-
-EndTest();
-
-
-// Closure inside catch in global code.
-BeginTest("Catch block 6");
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Local,
-                   debug.ScopeType.Catch,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeContent({x: 2}, 0, exec_state);
-  CheckScopeContent({e:'Exception'}, 1, exec_state);
-  CheckScopeChainNames([undefined, undefined, undefined, undefined, undefined],
-                       exec_state);
-};
-
-try {
-  throw 'Exception';
-} catch (e) {
-  (function(x) {
-    debugger;
-  })(2);
-}
-EndTest();
-
-
-// Catch block in function that is marked for optimization while being executed.
-BeginTest("Catch block 7");
-function catch_block_7() {
-  %OptimizeFunctionOnNextCall(catch_block_7);
-  try {
-    throw 'Exception';
-  } catch (e) {
-    debugger;
-  }
-};
-
-
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Catch,
-                   debug.ScopeType.Local,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeContent({e:'Exception'}, 0, exec_state);
-  CheckScopeChainNames(
-      ["catch_block_7", "catch_block_7", undefined, undefined, undefined],
-      exec_state);
-};
-catch_block_7();
-EndTest();
-
-
-BeginTest("Classes and methods 1");
-
-listener_delegate = function(exec_state) {
-  "use strict"
-  CheckScopeChain([debug.ScopeType.Local,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeContent({}, 1, exec_state);
-  CheckScopeChainNames(["m", undefined, undefined, undefined], exec_state);
-};
-
-(function() {
-  "use strict";
-  class C1 {
-    m() {
-      debugger;
-    }
-  }
-  new C1().m();
-})();
-
-EndTest();
-
-BeginTest("Scope positions");
-var code1 = "function f() {        \n" +
-            "  var a = 1;          \n" +
-            "  function b() {      \n" +
-            "    debugger;         \n" +
-            "    return a + 1;     \n" +
-            "  }                   \n" +
-            "  b();                \n" +
-            "}                     \n" +
-            "f();                  \n";
-
-listener_delegate = function(exec_state) {
-  CheckScopeChainPositions([{start: 58, end: 118}, {start: 10, end: 162}],
-                           exec_state);
-}
-eval(code1);
-EndTest();
-
-
-BeginTest("Scope positions in for statement");
-var code3 = "function for_statement() {         \n" +
-            "  for (let i = 0; i < 1; i++) {    \n" +
-            "    debugger;                      \n" +
-            "  }                                \n" +
-            "}                                  \n" +
-            "for_statement();                   \n";
-
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Block,
-                   debug.ScopeType.Local,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeChainPositions([{start: 42, end: 111}, {start: 22, end: 145}],
-                           exec_state);
-}
-eval(code3);
-EndTest();
-
-BeginTest("Scope positions in for statement with lexical block");
-var code4 = "function for_statement() {         \n" +
-            "  for (let i = 0; i < 1; i++) {    \n" +
-            "    let j;                         \n" +
-            "    debugger;                      \n" +
-            "  }                                \n" +
-            "}                                  \n" +
-            "for_statement();                   \n";
-
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Block,
-                   debug.ScopeType.Block,
-                   debug.ScopeType.Local,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeChainPositions([{start: 66, end: 147},
-                            {start: 42, end: 147},
-                            {start: 22, end: 181}], exec_state);
-}
-eval(code4);
-EndTest();
-
-BeginTest("Scope positions in lexical for each statement");
-var code5 = "function for_each_statement() {    \n" +
-            "  for (let i of [0]) {             \n" +
-            "    debugger;                      \n" +
-            "  }                                \n" +
-            "}                                  \n" +
-            "for_each_statement();              \n";
-
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Block,
-                   debug.ScopeType.Local,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeChainPositions([{start: 55, end: 111}, {start: 27, end: 145}],
-                           exec_state);
-}
-eval(code5);
-EndTest();
-
-BeginTest("Scope positions in lexical for each statement with lexical block");
-var code6 = "function for_each_statement() {    \n" +
-            "  for (let i of [0]) {             \n" +
-            "    let j;                         \n" +
-            "    debugger;                      \n" +
-            "  }                                \n" +
-            "}                                  \n" +
-            "for_each_statement();              \n";
-
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Block,
-                   debug.ScopeType.Block,
-                   debug.ScopeType.Local,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeChainPositions([{start: 57, end: 147},
-                            {start: 55, end: 147},
-                            {start: 27, end: 181}], exec_state);
-}
-eval(code6);
-EndTest();
-
-BeginTest("Scope positions in non-lexical for each statement");
-var code7 = "function for_each_statement() {    \n" +
-            "  var i;                           \n" +
-            "  for (i of [0]) {                 \n" +
-            "    debugger;                      \n" +
-            "  }                                \n" +
-            "}                                  \n" +
-            "for_each_statement();              \n";
-
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Local,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeChainPositions([{start: 27, end: 181}], exec_state);
-}
-eval(code7);
-EndTest();
-
-BeginTest(
-    "Scope positions in non-lexical for each statement with lexical block");
-var code8 = "function for_each_statement() {    \n" +
-            "  var i;                           \n" +
-            "  for (i of [0]) {                 \n" +
-            "    let j;                         \n" +
-            "    debugger;                      \n" +
-            "  }                                \n" +
-            "}                                  \n" +
-            "for_each_statement();              \n";
-
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Block,
-                   debug.ScopeType.Local,
-                   debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeChainPositions([{start: 89, end: 183}, {start: 27, end: 217}],
-                           exec_state);
-}
-eval(code8);
-EndTest();
-
-assertEquals(begin_test_count, break_count,
-             'one or more tests did not enter the debugger');
-assertEquals(begin_test_count, end_test_count,
-             'one or more tests did not have its result checked');
diff --git a/src/v8/test/debugger/debug/harmony/modules-debug-scopes2.js b/src/v8/test/debugger/debug/harmony/modules-debug-scopes2.js
deleted file mode 100644
index cc1091e..0000000
--- a/src/v8/test/debugger/debug/harmony/modules-debug-scopes2.js
+++ /dev/null
@@ -1,187 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// MODULE
-
-
-var Debug = debug.Debug;
-
-var test_name;
-var listener_delegate;
-var listener_called;
-var exception;
-var begin_test_count = 0;
-var end_test_count = 0;
-var break_count = 0;
-
-function listener(event, exec_state, event_data, data) {
-  try {
-    if (event == Debug.DebugEvent.Break) {
-      break_count++;
-      listener_called = true;
-      listener_delegate(exec_state);
-    }
-  } catch (e) {
-    exception = e;
-  }
-}
-
-Debug.setListener(listener);
-
-
-function BeginTest(name) {
-  test_name = name;
-  listener_delegate = null;
-  listener_called = false;
-  exception = null;
-  begin_test_count++;
-}
-
-function EndTest() {
-  assertTrue(listener_called, "listener not called for " + test_name);
-  assertNull(exception, test_name + " / " + exception);
-  end_test_count++;
-}
-
-
-// Check that two scope are the same.
-function assertScopeMirrorEquals(scope1, scope2) {
-  assertEquals(scope1.scopeType(), scope2.scopeType());
-  assertEquals(scope1.frameIndex(), scope2.frameIndex());
-  assertEquals(scope1.scopeIndex(), scope2.scopeIndex());
-  assertPropertiesEqual(scope1.scopeObject().value(),
-                        scope2.scopeObject().value());
-}
-
-function CheckFastAllScopes(scopes, exec_state)
-{
-  var fast_all_scopes = exec_state.frame().allScopes(true);
-  var length = fast_all_scopes.length;
-  assertTrue(scopes.length >= length);
-  for (var i = 0; i < scopes.length && i < length; i++) {
-    var scope = fast_all_scopes[length - i - 1];
-    assertEquals(scopes[scopes.length - i - 1], scope.scopeType());
-  }
-}
-
-
-// Check that the scope chain contains the expected types of scopes.
-function CheckScopeChain(scopes, exec_state) {
-  var all_scopes = exec_state.frame().allScopes();
-  assertEquals(scopes.length, exec_state.frame().scopeCount());
-  assertEquals(scopes.length, all_scopes.length, "FrameMirror.allScopes length");
-  for (var i = 0; i < scopes.length; i++) {
-    var scope = exec_state.frame().scope(i);
-    assertEquals(scopes[i], scope.scopeType());
-    assertScopeMirrorEquals(all_scopes[i], scope);
-  }
-  CheckFastAllScopes(scopes, exec_state);
-}
-
-
-function CheckScopeDoesNotHave(properties, number, exec_state) {
-  var scope = exec_state.frame().scope(number);
-  for (var p of properties) {
-    var property_mirror = scope.scopeObject().property(p);
-    assertTrue(property_mirror.isUndefined(),
-               'property ' + p + ' found in scope');
-  }
-}
-
-
-// Check that the scope contains at least minimum_content. For functions just
-// check that there is a function.
-function CheckScopeContent(minimum_content, number, exec_state) {
-  var scope = exec_state.frame().scope(number);
-  var minimum_count = 0;
-  for (var p in minimum_content) {
-    var property_mirror = scope.scopeObject().property(p);
-    assertFalse(property_mirror.isUndefined(),
-                'property ' + p + ' not found in scope');
-    assertEquals(minimum_content[p], property_mirror.value().value(),
-                 'property ' + p + ' has unexpected value');
-    minimum_count++;
-  }
-
-  // 'arguments' and might be exposed in the local and closure scope. Just
-  // ignore this.
-  var scope_size = scope.scopeObject().properties().length;
-  if (!scope.scopeObject().property('arguments').isUndefined()) {
-    scope_size--;
-  }
-  // Ditto for 'this'.
-  if (!scope.scopeObject().property('this').isUndefined()) {
-    scope_size--;
-  }
-  // Temporary variables introduced by the parser have not been materialized.
-  assertTrue(scope.scopeObject().property('').isUndefined());
-
-  if (scope_size < minimum_count) {
-    print('Names found in scope:');
-    var names = scope.scopeObject().propertyNames();
-    for (var i = 0; i < names.length; i++) {
-      print(names[i]);
-    }
-  }
-  assertTrue(scope_size >= minimum_count);
-}
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Actual tests.
-////////////////////////////////////////////////////////////////////////////////
-
-
-BeginTest();
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeContent(
-      {exported_var: undefined, imported_var: undefined},
-      0, exec_state);
-  CheckScopeDoesNotHave(
-      ["local_var", "doesntexist", "local_let", "exported_let", "imported_let"],
-      0, exec_state);
-};
-debugger;
-EndTest();
-
-let local_let = 1;
-var local_var = 2;
-export let exported_let = 3;
-export var exported_var = 4;
-import {exported_let as imported_let} from "modules-debug-scopes2.js";
-import {exported_var as imported_var} from "modules-debug-scopes2.js";
-
-BeginTest();
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeContent(
-      {exported_let: 3, exported_var: 4,
-       imported_let: 3, imported_var: 4}, 0, exec_state);
-  CheckScopeDoesNotHave(["local_var", "local_let"], 0, exec_state);
-};
-debugger;
-EndTest();
-
-local_let += 10;
-local_var += 10;
-exported_let += 10;
-exported_var += 10;
-
-BeginTest();
-listener_delegate = function(exec_state) {
-  CheckScopeChain([debug.ScopeType.Module,
-                   debug.ScopeType.Script,
-                   debug.ScopeType.Global], exec_state);
-  CheckScopeContent(
-      {exported_let: 13, exported_var: 14,
-       imported_let: 13, imported_var: 14}, 0, exec_state);
-  CheckScopeDoesNotHave(["local_var", "local_let"], 0, exec_state);
-};
-debugger;
-EndTest();
diff --git a/src/v8/test/debugger/debug/regress/regress-1853.js b/src/v8/test/debugger/debug/regress/regress-1853.js
deleted file mode 100644
index 4cd069f..0000000
--- a/src/v8/test/debugger/debug/regress/regress-1853.js
+++ /dev/null
@@ -1,100 +0,0 @@
-// 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.
-
-// Flags: --expose-gc
-// Test whether scripts compiled after setting the break point are
-// updated correctly.
-
-gc();
-Debug = debug.Debug;
-
-var break_count = 0;
-var test_break_1 = false;
-var test_break_2 = false;
-
-function setBreakPointByName(state) {
-  var scripts = Debug.scripts();
-  for (var script of scripts) {
-    if (script.source_url == "testScriptOne") {
-      Debug.setScriptBreakPointById(script.id, 2);
-    }
-  }
-}
-
-function setBreakPointByRegExp(state) {
-  var scripts = Debug.scripts();
-  for (var script of scripts) {
-    if (/Scrip.Two/.test(script.source_url)) {
-      Debug.setScriptBreakPointById(script.id, 2);
-    }
-  }
-}
-
-function listener(event, exec_state, event_data, data) {
-  try {
-    if (event == Debug.DebugEvent.Break) {
-      switch (break_count) {
-        case 0:
-          // Set break points before the code has been compiled.
-          setBreakPointByName(exec_state);
-          setBreakPointByRegExp(exec_state);
-          break;
-        case 1:
-          // Set the flag to prove that we hit the first break point.
-          test_break_1 = true;
-          break;
-        case 2:
-          // Set the flag to prove that we hit the second break point.
-          test_break_2 = true;
-          break;
-      }
-      break_count++;
-    }
-  } catch (e) {
-    print(e);
-  }
-}
-
-Debug.setListener(listener);
-
-eval('function test1() {                \n' +
-     '  assertFalse(test_break_1);      \n' +
-     '  assertTrue(test_break_1);       \n' +
-     '}                                 \n' +
-     '//# sourceURL=testScriptOne');
-
-eval('function test2() {                \n' +
-     '  assertFalse(test_break_2);      \n' +
-     '  assertTrue(test_break_2);       \n' +
-     '}                                 \n' +
-     '//# sourceURL=testScriptTwo');
-
-debugger;
-
-test1();
-test2();
-assertEquals(3, break_count);
diff --git a/src/v8/test/debugger/debug/regress/regress-3960.js b/src/v8/test/debugger/debug/regress/regress-3960.js
deleted file mode 100644
index 6580d4b..0000000
--- a/src/v8/test/debugger/debug/regress/regress-3960.js
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-
-// Test that setting break point works correctly when the debugger is
-// activated late, which leads to duplicate shared function infos.
-
-(function() {
-  var Debug = %GetDebugContext().Debug;
-
-  function listener(event, exec_state, event_data, data) {
-    if (event != Debug.DebugEvent.Break) return;
-    try {
-      assertTrue(/foo/.test(exec_state.frame(0).sourceLineText()));
-      break_count++;
-    } catch (e) {
-      exception = e;
-    }
-  }
-
-  for (var i = 0; i < 3; i++) {
-    var foo = function() { a = 1; }
-    var exception = null;
-    var break_count = 0;
-    Debug.setListener(listener);
-    if (i < 2) Debug.setBreakPoint(foo, 0, 0);
-    assertTrue(/\[B\d\]a = 1/.test(Debug.showBreakPoints(foo)));
-    foo();
-    assertEquals(1, break_count);
-    assertNull(exception);
-  }
-
-  Debug.setListener(null);
-})();
diff --git a/src/v8/test/debugger/debug/regress/regress-419663.js b/src/v8/test/debugger/debug/regress/regress-419663.js
deleted file mode 100644
index 51bd85a..0000000
--- a/src/v8/test/debugger/debug/regress/regress-419663.js
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-
-var o = {
-  f: function(x) {
-    var a = x + 1;
-    o = 1;
-  }
-}
-
-function sentinel() {}
-
-var Debug = debug.Debug;
-
-Debug.setListener(function() {});
-
-var script = Debug.findScript(sentinel);
-
-// Used in Debug.setScriptBreakPointById.
-var p = Debug.findScriptSourcePosition(script, 8, 0);
-var q = Debug.setBreakPointByScriptIdAndPosition(script.id, p).actual_position;
-
-function assertLocation(p, l, c) {
-  var location = script.locationFromPosition(p, false);
-  assertEquals(l, location.line);
-  assertEquals(c, location.column);
-}
-
-assertLocation(p, 8, 0);
-assertLocation(q, 8, 4);
diff --git a/src/v8/test/debugger/debug/regress/regress-crbug-424142.js b/src/v8/test/debugger/debug/regress/regress-crbug-424142.js
deleted file mode 100644
index bda061c..0000000
--- a/src/v8/test/debugger/debug/regress/regress-crbug-424142.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-
-(function outer() {
-  var C = (function C_() {
-    var y = 1;
-    function CC() {
-      this.x = 0;
-    }
-    CC.prototype.f = function CCf() {
-      this.x += y;
-      return this.x;
-    };
-    return CC;
-  })();
-
-  var c = new C(0);
-})
-
-function sentinel() {}
-
-Debug = debug.Debug;
-Debug.setListener(function(){});
-
-var script = Debug.findScript(sentinel);
-var line = 13;
-var line_start = Debug.findScriptSourcePosition(script, line, 0);
-var line_end = Debug.findScriptSourcePosition(script, line + 1, 0) - 1;
-var actual = Debug.setBreakPointByScriptIdAndPosition(
-                 script.id, line_start).actual_position;
-// Make sure the actual break position is within the line where we set
-// the break point.
-assertTrue(line_start <= actual);
-assertTrue(actual <= line_end);
-
-Debug.setListener(null);
diff --git a/src/v8/test/debugger/debug/regress/regress-crbug-481896.js b/src/v8/test/debugger/debug/regress/regress-crbug-481896.js
deleted file mode 100644
index 751b62a..0000000
--- a/src/v8/test/debugger/debug/regress/regress-crbug-481896.js
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-// Flags: --expose-gc
-gc();
-function static() {
-  print("> static");  // Break
-}
-
-var Debug = debug.Debug;
-var exception = null;
-var break_count = 0;
-
-function listener(event, exec_state, event_data, data) {
-  if (event != Debug.DebugEvent.Break) return;
-  try {
-    print("breakpoint hit at " + exec_state.frame(0).sourceLineText());
-    assertTrue(exec_state.frame(0).sourceLineText().indexOf("// Break") > 0);
-    break_count++;
-  } catch (e) {
-    exception = e;
-  }
-}
-
-Debug.setListener(listener);
-
-function install() {
-  eval("this.dynamic = function dynamic() { \n" +
-       "  print(\"> dynamic\");  // Break\n" +
-       "}\n" +
-       "//@ sourceURL=dynamicScript");
-}
-
-install();
-
-var scripts = Debug.scripts();
-var dynamic_script;
-var static_script;
-for (var script of scripts) {
-  if (script.source_url == "dynamicScript") dynamic_script = script;
-  if (script.source_url == "staticScript") static_script = script;
-}
-
-Debug.setScriptBreakPointById(dynamic_script.id, 1);
-Debug.setScriptBreakPointById(static_script.id, 6);
-
-dynamic();
-static();
-
-Debug.setListener(null);
-
-assertNull(exception);
-assertEquals(2, break_count);
-
-//@ sourceURL=staticScript
diff --git a/src/v8/test/debugger/debug/regress/regress-crbug-517592.js b/src/v8/test/debugger/debug/regress/regress-crbug-517592.js
deleted file mode 100644
index 57e96a2..0000000
--- a/src/v8/test/debugger/debug/regress/regress-crbug-517592.js
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var source =
-  "var foo = function foo() {\n" +
-  "  var a = 1;\n" +
-  "}\n" +
-  "//@ sourceURL=test";
-
-Debug = debug.Debug;
-Debug.setListener(listener);
-var exception = null;
-var break_count = 0;
-
-function listener(event, exec_state, event_data, data) {
-  if (event == Debug.DebugEvent.Break) break_count++;
-  if (event != Debug.DebugEvent.AfterCompile) return;
-  try {
-    var name = event_data.script().name();
-    var id = event_data.script().id();
-    assertEquals("test", name);
-    Debug.setScriptBreakPointById(id, 2);
-  } catch (e) {
-    exception = e;
-  }
-}
-
-eval(source);
-
-assertEquals(0, break_count);
-foo();
-assertEquals(1, break_count);
-assertNull(exception);
diff --git a/src/v8/test/debugger/debugger.gyp b/src/v8/test/debugger/debugger.gyp
deleted file mode 100644
index c093d09..0000000
--- a/src/v8/test/debugger/debugger.gyp
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2016 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'conditions': [
-    ['test_isolation_mode != "noop"', {
-      'targets': [
-        {
-          'target_name': 'debugger_run',
-          'type': 'none',
-          'dependencies': [
-            '../../src/d8.gyp:d8_run',
-          ],
-          'includes': [
-            '../../gypfiles/features.gypi',
-            '../../gypfiles/isolate.gypi',
-          ],
-          'sources': [
-            'debugger.isolate',
-          ],
-        },
-      ],
-    }],
-  ],
-}
diff --git a/src/v8/test/debugger/debugger.isolate b/src/v8/test/debugger/debugger.isolate
deleted file mode 100644
index 3843c73..0000000
--- a/src/v8/test/debugger/debugger.isolate
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright 2016 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'variables': {
-    'files': [
-      './',
-    ],
-  },
-  'includes': [
-    '../../src/d8.isolate',
-    '../../tools/testrunner/testrunner.isolate',
-  ],
-}
diff --git a/src/v8/test/default.gyp b/src/v8/test/default.gyp
deleted file mode 100644
index d1007b8..0000000
--- a/src/v8/test/default.gyp
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'conditions': [
-    ['test_isolation_mode != "noop"', {
-      'targets': [
-        {
-          'target_name': 'default_run',
-          'type': 'none',
-          'dependencies': [
-            'cctest/cctest.gyp:cctest_run',
-            'debugger/debugger.gyp:debugger_run',
-            'fuzzer/fuzzer.gyp:fuzzer_run',
-            'inspector/inspector.gyp:inspector-test_run',
-            'intl/intl.gyp:intl_run',
-            'message/message.gyp:message_run',
-            'mjsunit/mjsunit.gyp:mjsunit_run',
-            'preparser/preparser.gyp:preparser_run',
-            'unittests/unittests.gyp:unittests_run',
-            'wasm-spec-tests/wasm-spec-tests.gyp:wasm_spec_tests_run',
-          ],
-          'includes': [
-            '../gypfiles/features.gypi',
-            '../gypfiles/isolate.gypi',
-          ],
-          'sources': [
-            'default.isolate',
-          ],
-        },
-      ],
-    }],
-  ],
-}
diff --git a/src/v8/test/default.isolate b/src/v8/test/default.isolate
deleted file mode 100644
index e910463..0000000
--- a/src/v8/test/default.isolate
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'variables': {
-    'command': [
-      '../tools/run-tests.py',
-    ],
-  },
-  'includes': [
-    'cctest/cctest.isolate',
-    'debugger/debugger.isolate',
-    'fuzzer/fuzzer.isolate',
-    'inspector/inspector.isolate'
-    'intl/intl.isolate',
-    'message/message.isolate',
-    'mjsunit/mjsunit.isolate',
-    'mkgrokdump/mkgrokdump.isolate',
-    'preparser/preparser.isolate',
-    'unittests/unittests.isolate',
-    'wasm-spec-tests/wasm-spec-tests.isolate',
-  ],
-}
diff --git a/src/v8/test/fuzzer/fuzzer.gyp b/src/v8/test/fuzzer/fuzzer.gyp
deleted file mode 100644
index 0c54211..0000000
--- a/src/v8/test/fuzzer/fuzzer.gyp
+++ /dev/null
@@ -1,544 +0,0 @@
-# Copyright 2016 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'variables': {
-    'v8_code': 1,
-  },
-  'includes': ['../../gypfiles/toolchain.gypi', '../../gypfiles/features.gypi'],
-  'targets': [
-    {
-      'target_name': 'v8_simple_json_fuzzer',
-      'type': 'executable',
-      'dependencies': [
-        'json_fuzzer_lib',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [
-        'fuzzer.cc',
-      ],
-    },
-    {
-      'target_name': 'json_fuzzer_lib',
-      'type': 'static_library',
-      'dependencies': [
-        '../../src/v8.gyp:v8_libplatform',
-        'fuzzer_support',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [  ### gcmole(all) ###
-        'json.cc',
-      ],
-    },
-    {
-      'target_name': 'v8_simple_parser_fuzzer',
-      'type': 'executable',
-      'dependencies': [
-        'parser_fuzzer_lib',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [
-        'fuzzer.cc',
-      ],
-    },
-    {
-      'target_name': 'parser_fuzzer_lib',
-      'type': 'static_library',
-      'dependencies': [
-        '../../src/v8.gyp:v8_libplatform',
-        'fuzzer_support',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [  ### gcmole(all) ###
-        'parser.cc',
-      ],
-    },
-    {
-      'target_name': 'v8_simple_regexp_fuzzer',
-      'type': 'executable',
-      'dependencies': [
-        'regexp_fuzzer_lib',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [
-        'fuzzer.cc',
-      ],
-    },
-    {
-      'target_name': 'regexp_fuzzer_lib',
-      'type': 'static_library',
-      'dependencies': [
-        '../../src/v8.gyp:v8_libplatform',
-        'fuzzer_support',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [  ### gcmole(all) ###
-        'regexp.cc',
-      ],
-    },
-    {
-      'target_name': 'v8_simple_multi_return_fuzzer',
-      'type': 'executable',
-      'dependencies': [
-        'multi_return_fuzzer_lib',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [
-        'fuzzer.cc',
-      ],
-    },
-    {
-      'target_name': 'multi_return_fuzzer_lib',
-      'type': 'static_library',
-      'dependencies': [
-        '../../src/v8.gyp:v8_libplatform',
-        'fuzzer_support',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [  ### gcmole(all) ###
-        '../compiler/c-signature.h',
-        '../compiler/call-helper.h',
-        '../compiler/raw-machine-assembler-tester.h',
-        'multi-return.cc',
-      ],
-    },
-    {
-      'target_name': 'v8_simple_wasm_fuzzer',
-      'type': 'executable',
-      'dependencies': [
-        'wasm_fuzzer_lib',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [
-        'fuzzer.cc',
-      ],
-    },
-    {
-      'target_name': 'wasm_fuzzer_lib',
-      'type': 'static_library',
-      'dependencies': [
-        '../../src/v8.gyp:v8_libplatform',
-        'fuzzer_support',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [  ### gcmole(all) ###
-        'wasm.cc',
-        '../common/wasm/wasm-module-runner.cc',
-        '../common/wasm/wasm-module-runner.h',
-        'wasm-fuzzer-common.cc',
-        'wasm-fuzzer-common.h',
-      ],
-    },
-    {
-      'target_name': 'v8_simple_wasm_async_fuzzer',
-      'type': 'executable',
-      'dependencies': [
-        'wasm_async_fuzzer_lib',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [
-        'fuzzer.cc',
-      ],
-    },
-    {
-      'target_name': 'wasm_async_fuzzer_lib',
-      'type': 'static_library',
-      'dependencies': [
-        '../../src/v8.gyp:v8_libplatform',
-        'fuzzer_support',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [  ### gcmole(all) ###
-        'wasm-async.cc',
-        '../common/wasm/wasm-module-runner.cc',
-        '../common/wasm/wasm-module-runner.h',
-        'wasm-fuzzer-common.cc',
-        'wasm-fuzzer-common.h',
-      ],
-    },
-    {
-      'target_name': 'v8_simple_wasm_call_fuzzer',
-      'type': 'executable',
-      'dependencies': [
-        'wasm_call_fuzzer_lib',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [
-        'fuzzer.cc',
-      ],
-    },
-    {
-      'target_name': 'wasm_call_fuzzer_lib',
-      'type': 'static_library',
-      'dependencies': [
-        '../../src/v8.gyp:v8_libplatform',
-        'fuzzer_support',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [  ### gcmole(all) ###
-        'wasm-call.cc',
-        '../common/wasm/test-signatures.h',
-        '../common/wasm/wasm-module-runner.cc',
-        '../common/wasm/wasm-module-runner.h',
-        'wasm-fuzzer-common.cc',
-        'wasm-fuzzer-common.h',
-      ],
-    },
-    {
-      'target_name': 'v8_simple_wasm_code_fuzzer',
-      'type': 'executable',
-      'dependencies': [
-        'wasm_code_fuzzer_lib',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [
-        'fuzzer.cc',
-      ],
-    },
-    {
-      'target_name': 'wasm_code_fuzzer_lib',
-      'type': 'static_library',
-      'dependencies': [
-        '../../src/v8.gyp:v8_libplatform',
-        'fuzzer_support',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [  ### gcmole(all) ###
-        'wasm-code.cc',
-        '../common/wasm/test-signatures.h',
-        '../common/wasm/wasm-module-runner.cc',
-        '../common/wasm/wasm-module-runner.h',
-        'wasm-fuzzer-common.cc',
-        'wasm-fuzzer-common.h',
-      ],
-    },
-    {
-      'target_name': 'v8_simple_wasm_compile_fuzzer',
-      'type': 'executable',
-      'dependencies': [
-        'wasm_compile_fuzzer_lib',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [
-        'fuzzer.cc',
-      ],
-    },
-    {
-      'target_name': 'wasm_compile_fuzzer_lib',
-      'type': 'static_library',
-      'dependencies': [
-        '../../src/v8.gyp:v8_libplatform',
-        'fuzzer_support',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [  ### gcmole(all) ###
-        'wasm-compile.cc',
-        '../common/wasm/test-signatures.h',
-        '../common/wasm/wasm-module-runner.cc',
-        '../common/wasm/wasm-module-runner.h',
-        'wasm-fuzzer-common.cc',
-        'wasm-fuzzer-common.h',
-      ],
-    },
-    {
-      'target_name': 'v8_simple_wasm_data_section_fuzzer',
-      'type': 'executable',
-      'dependencies': [
-        'wasm_data_section_fuzzer_lib',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [
-        'fuzzer.cc',
-      ],
-    },
-    {
-      'target_name': 'wasm_data_section_fuzzer_lib',
-      'type': 'static_library',
-      'dependencies': [
-        '../../src/v8.gyp:v8_libplatform',
-        'fuzzer_support',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [  ### gcmole(all) ###
-        'wasm-data-section.cc',
-        '../common/wasm/wasm-module-runner.cc',
-        '../common/wasm/wasm-module-runner.h',
-        'wasm-fuzzer-common.cc',
-        'wasm-fuzzer-common.h',
-      ],
-    },
-    {
-      'target_name': 'v8_simple_wasm_function_sigs_section_fuzzer',
-      'type': 'executable',
-      'dependencies': [
-        'wasm_function_sigs_section_fuzzer_lib',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [
-        'fuzzer.cc',
-      ],
-    },
-    {
-      'target_name': 'wasm_function_sigs_section_fuzzer_lib',
-      'type': 'static_library',
-      'dependencies': [
-        '../../src/v8.gyp:v8_libplatform',
-        'fuzzer_support',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [  ### gcmole(all) ###
-        'wasm-function-sigs-section.cc',
-        '../common/wasm/wasm-module-runner.cc',
-        '../common/wasm/wasm-module-runner.h',
-        'wasm-fuzzer-common.cc',
-        'wasm-fuzzer-common.h',
-      ],
-    },
-    {
-      'target_name': 'v8_simple_wasm_globals_section_fuzzer',
-      'type': 'executable',
-      'dependencies': [
-        'wasm_globals_section_fuzzer_lib',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [
-        'fuzzer.cc',
-      ],
-    },
-    {
-      'target_name': 'wasm_globals_section_fuzzer_lib',
-      'type': 'static_library',
-      'dependencies': [
-        '../../src/v8.gyp:v8_libplatform',
-        'fuzzer_support',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [  ### gcmole(all) ###
-        'wasm-globals-section.cc',
-        '../common/wasm/wasm-module-runner.cc',
-        '../common/wasm/wasm-module-runner.h',
-        'wasm-fuzzer-common.cc',
-        'wasm-fuzzer-common.h',
-      ],
-    },
-    {
-      'target_name': 'v8_simple_wasm_imports_section_fuzzer',
-      'type': 'executable',
-      'dependencies': [
-        'wasm_imports_section_fuzzer_lib',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [
-        'fuzzer.cc',
-      ],
-    },
-    {
-      'target_name': 'wasm_imports_section_fuzzer_lib',
-      'type': 'static_library',
-      'dependencies': [
-        '../../src/v8.gyp:v8_libplatform',
-        'fuzzer_support',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [  ### gcmole(all) ###
-        'wasm-imports-section.cc',
-        '../common/wasm/wasm-module-runner.cc',
-        '../common/wasm/wasm-module-runner.h',
-        'wasm-fuzzer-common.cc',
-        'wasm-fuzzer-common.h',
-      ],
-    },
-    {
-      'target_name': 'v8_simple_wasm_memory_section_fuzzer',
-      'type': 'executable',
-      'dependencies': [
-        'wasm_memory_section_fuzzer_lib',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [
-        'fuzzer.cc',
-      ],
-    },
-    {
-      'target_name': 'wasm_memory_section_fuzzer_lib',
-      'type': 'static_library',
-      'dependencies': [
-        '../../src/v8.gyp:v8_libplatform',
-        'fuzzer_support',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [  ### gcmole(all) ###
-        'wasm-memory-section.cc',
-        '../common/wasm/wasm-module-runner.cc',
-        '../common/wasm/wasm-module-runner.h',
-        'wasm-fuzzer-common.cc',
-        'wasm-fuzzer-common.h',
-      ],
-    },
-    {
-      'target_name': 'v8_simple_wasm_names_section_fuzzer',
-      'type': 'executable',
-      'dependencies': [
-        'wasm_names_section_fuzzer_lib',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [
-        'fuzzer.cc',
-      ],
-    },
-    {
-      'target_name': 'wasm_names_section_fuzzer_lib',
-      'type': 'static_library',
-      'dependencies': [
-        '../../src/v8.gyp:v8_libplatform',
-        'fuzzer_support',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [  ### gcmole(all) ###
-        'wasm-names-section.cc',
-        '../common/wasm/wasm-module-runner.cc',
-        '../common/wasm/wasm-module-runner.h',
-        'wasm-fuzzer-common.cc',
-        'wasm-fuzzer-common.h',
-      ],
-    },
-    {
-      'target_name': 'v8_simple_wasm_types_section_fuzzer',
-      'type': 'executable',
-      'dependencies': [
-        'wasm_types_section_fuzzer_lib',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [
-        'fuzzer.cc',
-      ],
-    },
-    {
-      'target_name': 'wasm_types_section_fuzzer_lib',
-      'type': 'static_library',
-      'dependencies': [
-        '../../src/v8.gyp:v8_libplatform',
-        'fuzzer_support',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [  ### gcmole(all) ###
-        'wasm-types-section.cc',
-        '../common/wasm/wasm-module-runner.cc',
-        '../common/wasm/wasm-module-runner.h',
-        'wasm-fuzzer-common.cc',
-        'wasm-fuzzer-common.h',
-      ],
-    },
-    {
-      'target_name': 'fuzzer_support',
-      'type': 'static_library',
-      'dependencies': [
-        '../../src/v8.gyp:v8',
-        '../../src/v8.gyp:v8_libbase',
-        '../../src/v8.gyp:v8_libplatform',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [  ### gcmole(all) ###
-        'fuzzer-support.cc',
-        'fuzzer-support.h',
-      ],
-      'conditions': [
-        ['v8_enable_i18n_support==1', {
-          'dependencies': [
-            '<(icu_gyp_path):icui18n',
-            '<(icu_gyp_path):icuuc',
-          ],
-        }],
-      ],
-    },
-  ],
-  'conditions': [
-    ['test_isolation_mode != "noop"', {
-      'targets': [
-        {
-          'target_name': 'fuzzer_run',
-          'type': 'none',
-          'dependencies': [
-            'v8_simple_json_fuzzer',
-            'v8_simple_parser_fuzzer',
-            'v8_simple_regexp_fuzzer',
-            'v8_simple_wasm_fuzzer',
-          ],
-          'includes': [
-            '../../gypfiles/isolate.gypi',
-          ],
-          'sources': [
-            'fuzzer.isolate',
-          ],
-        },
-      ],
-    }],
-  ],
-}
diff --git a/src/v8/test/fuzzer/fuzzer.isolate b/src/v8/test/fuzzer/fuzzer.isolate
deleted file mode 100644
index 9391dcc..0000000
--- a/src/v8/test/fuzzer/fuzzer.isolate
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright 2016 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'variables': {
-    'files': [
-      '<(PRODUCT_DIR)/v8_simple_json_fuzzer<(EXECUTABLE_SUFFIX)',
-      '<(PRODUCT_DIR)/v8_simple_parser_fuzzer<(EXECUTABLE_SUFFIX)',
-      '<(PRODUCT_DIR)/v8_simple_regexp_fuzzer<(EXECUTABLE_SUFFIX)',
-      '<(PRODUCT_DIR)/v8_simple_multi_return_fuzzer<(EXECUTABLE_SUFFIX)',
-      '<(PRODUCT_DIR)/v8_simple_wasm_fuzzer<(EXECUTABLE_SUFFIX)',
-      '<(PRODUCT_DIR)/v8_simple_wasm_async_fuzzer<(EXECUTABLE_SUFFIX)',
-      '<(PRODUCT_DIR)/v8_simple_wasm_call_fuzzer<(EXECUTABLE_SUFFIX)',
-      '<(PRODUCT_DIR)/v8_simple_wasm_code_fuzzer<(EXECUTABLE_SUFFIX)',
-      '<(PRODUCT_DIR)/v8_simple_wasm_compile_fuzzer<(EXECUTABLE_SUFFIX)',
-      '<(PRODUCT_DIR)/v8_simple_wasm_data_section_fuzzer<(EXECUTABLE_SUFFIX)',
-      '<(PRODUCT_DIR)/v8_simple_wasm_function_sigs_section_fuzzer<(EXECUTABLE_SUFFIX)',
-      '<(PRODUCT_DIR)/v8_simple_wasm_globals_section_fuzzer<(EXECUTABLE_SUFFIX)',
-      '<(PRODUCT_DIR)/v8_simple_wasm_imports_section_fuzzer<(EXECUTABLE_SUFFIX)',
-      '<(PRODUCT_DIR)/v8_simple_wasm_memory_section_fuzzer<(EXECUTABLE_SUFFIX)',
-      '<(PRODUCT_DIR)/v8_simple_wasm_names_section_fuzzer<(EXECUTABLE_SUFFIX)',
-      '<(PRODUCT_DIR)/v8_simple_wasm_types_section_fuzzer<(EXECUTABLE_SUFFIX)',
-      './fuzzer.status',
-      './testcfg.py',
-      './json/',
-      './parser/',
-      './regexp/',
-      './multi_return/',
-      './wasm/',
-      './wasm_async/',
-      './wasm_call/',
-      './wasm_code/',
-      './wasm_compile/',
-      './wasm_data_section/',
-      './wasm_function_sigs_section/',
-      './wasm_globals_section/',
-      './wasm_imports_section/',
-      './wasm_memory_section/',
-      './wasm_names_section/',
-      './wasm_types_section/',
-    ],
-  },
-  'includes': [
-    '../../src/base.isolate',
-    '../../tools/testrunner/testrunner.isolate',
-  ],
-}
diff --git a/src/v8/test/fuzzer/wasm-call.cc b/src/v8/test/fuzzer/wasm-call.cc
deleted file mode 100644
index 5c85502..0000000
--- a/src/v8/test/fuzzer/wasm-call.cc
+++ /dev/null
@@ -1,134 +0,0 @@
-// Copyright 2016 the V8 project 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 <stddef.h>
-#include <stdint.h>
-
-#include "include/v8.h"
-#include "src/isolate.h"
-#include "src/objects-inl.h"
-#include "src/objects.h"
-#include "src/utils.h"
-#include "src/wasm/wasm-interpreter.h"
-#include "src/wasm/wasm-module-builder.h"
-#include "src/wasm/wasm-module.h"
-#include "test/common/wasm/test-signatures.h"
-#include "test/common/wasm/wasm-module-runner.h"
-#include "test/fuzzer/fuzzer-support.h"
-#include "test/fuzzer/wasm-fuzzer-common.h"
-
-namespace v8 {
-namespace internal {
-namespace wasm {
-namespace fuzzer {
-
-static constexpr uint32_t kMaxNumFunctions = 3;
-static constexpr uint32_t kMaxNumParams = 3;
-
-class WasmCallFuzzer : public WasmExecutionFuzzer {
-  template <typename V>
-  static inline V read_value(const uint8_t** data, size_t* size, bool* ok) {
-    // The status flag {ok} checks that the decoding up until now was okay, and
-    // that a value of type V can be read without problems.
-    *ok &= (*size > sizeof(V));
-    if (!(*ok)) return 0;
-    V result = ReadLittleEndianValue<V>(*data);
-    *data += sizeof(V);
-    *size -= sizeof(V);
-    return result;
-  }
-
-  static void add_argument(Isolate* isolate, ValueType type,
-                           WasmValue* interpreter_args,
-                           Handle<Object>* compiler_args, int* argc,
-                           const uint8_t** data, size_t* size, bool* ok) {
-    if (!(*ok)) return;
-    switch (type) {
-      case kWasmF32: {
-        float value = read_value<float>(data, size, ok);
-        interpreter_args[*argc] = WasmValue(value);
-        compiler_args[*argc] =
-            isolate->factory()->NewNumber(static_cast<double>(value));
-        break;
-      }
-      case kWasmF64: {
-        double value = read_value<double>(data, size, ok);
-        interpreter_args[*argc] = WasmValue(value);
-        compiler_args[*argc] = isolate->factory()->NewNumber(value);
-        break;
-      }
-      case kWasmI32: {
-        int32_t value = read_value<int32_t>(data, size, ok);
-        interpreter_args[*argc] = WasmValue(value);
-        compiler_args[*argc] =
-            isolate->factory()->NewNumber(static_cast<double>(value));
-        break;
-      }
-      default:
-        UNREACHABLE();
-    }
-    (*argc)++;
-  }
-
-  bool GenerateModule(
-      Isolate* isolate, Zone* zone, const uint8_t* data, size_t size,
-      ZoneBuffer& buffer, int32_t& num_args,
-      std::unique_ptr<WasmValue[]>& interpreter_args,
-      std::unique_ptr<Handle<Object>[]>& compiler_args) override {
-    bool ok = true;
-    uint8_t num_functions =
-        (read_value<uint8_t>(&data, &size, &ok) % kMaxNumFunctions) + 1;
-
-    ValueType types[] = {kWasmF32, kWasmF64, kWasmI32, kWasmI64};
-
-    interpreter_args.reset(new WasmValue[3]);
-    compiler_args.reset(new Handle<Object>[3]);
-
-    WasmModuleBuilder builder(zone);
-    for (int fun = 0; fun < num_functions; fun++) {
-      size_t num_params = static_cast<size_t>(
-          (read_value<uint8_t>(&data, &size, &ok) % kMaxNumParams) + 1);
-      FunctionSig::Builder sig_builder(zone, 1, num_params);
-      sig_builder.AddReturn(kWasmI32);
-      for (size_t param = 0; param < num_params; param++) {
-        // The main function cannot handle int64 parameters.
-        ValueType param_type = types[(read_value<uint8_t>(&data, &size, &ok) %
-                                      (arraysize(types) - (fun == 0 ? 1 : 0)))];
-        sig_builder.AddParam(param_type);
-        if (fun == 0) {
-          add_argument(isolate, param_type, interpreter_args.get(),
-                       compiler_args.get(), &num_args, &data, &size, &ok);
-        }
-      }
-      WasmFunctionBuilder* f = builder.AddFunction(sig_builder.Build());
-      uint32_t code_size = static_cast<uint32_t>(size / num_functions);
-      f->EmitCode(data, code_size);
-      uint8_t end_opcode = kExprEnd;
-      f->EmitCode(&end_opcode, 1);
-      data += code_size;
-      size -= code_size;
-      if (fun == 0) {
-        builder.AddExport(CStrVector("main"), f);
-      }
-    }
-
-    builder.SetMaxMemorySize(32);
-    builder.WriteTo(buffer);
-
-    if (!ok) {
-      // The input data was too short.
-      return 0;
-    }
-    return true;
-  }
-};
-
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
-  return WasmCallFuzzer().FuzzWasmModule(data, size);
-}
-
-}  // namespace fuzzer
-}  // namespace wasm
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/fuzzer/wasm-data-section.cc b/src/v8/test/fuzzer/wasm-data-section.cc
deleted file mode 100644
index c6a7547..0000000
--- a/src/v8/test/fuzzer/wasm-data-section.cc
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/objects-inl.h"
-#include "test/fuzzer/wasm-fuzzer-common.h"
-
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
-  return v8::internal::wasm::fuzzer::FuzzWasmSection(
-      v8::internal::wasm::kDataSectionCode, data, size);
-}
diff --git a/src/v8/test/fuzzer/wasm-function-sigs-section.cc b/src/v8/test/fuzzer/wasm-function-sigs-section.cc
deleted file mode 100644
index 2c894d6..0000000
--- a/src/v8/test/fuzzer/wasm-function-sigs-section.cc
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/objects-inl.h"
-#include "test/fuzzer/wasm-fuzzer-common.h"
-
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
-  return v8::internal::wasm::fuzzer::FuzzWasmSection(
-      v8::internal::wasm::kFunctionSectionCode, data, size);
-}
diff --git a/src/v8/test/fuzzer/wasm-globals-section.cc b/src/v8/test/fuzzer/wasm-globals-section.cc
deleted file mode 100644
index 23a8dcf..0000000
--- a/src/v8/test/fuzzer/wasm-globals-section.cc
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/objects-inl.h"
-#include "test/fuzzer/wasm-fuzzer-common.h"
-
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
-  return v8::internal::wasm::fuzzer::FuzzWasmSection(
-      v8::internal::wasm::kGlobalSectionCode, data, size);
-}
diff --git a/src/v8/test/fuzzer/wasm-imports-section.cc b/src/v8/test/fuzzer/wasm-imports-section.cc
deleted file mode 100644
index a8f455e..0000000
--- a/src/v8/test/fuzzer/wasm-imports-section.cc
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/objects-inl.h"
-#include "test/fuzzer/wasm-fuzzer-common.h"
-
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
-  return v8::internal::wasm::fuzzer::FuzzWasmSection(
-      v8::internal::wasm::kImportSectionCode, data, size);
-}
diff --git a/src/v8/test/fuzzer/wasm-memory-section.cc b/src/v8/test/fuzzer/wasm-memory-section.cc
deleted file mode 100644
index b80545a..0000000
--- a/src/v8/test/fuzzer/wasm-memory-section.cc
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/objects-inl.h"
-#include "test/fuzzer/wasm-fuzzer-common.h"
-
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
-  return v8::internal::wasm::fuzzer::FuzzWasmSection(
-      v8::internal::wasm::kMemorySectionCode, data, size);
-}
diff --git a/src/v8/test/fuzzer/wasm-names-section.cc b/src/v8/test/fuzzer/wasm-names-section.cc
deleted file mode 100644
index 6dec255..0000000
--- a/src/v8/test/fuzzer/wasm-names-section.cc
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/objects-inl.h"
-#include "test/fuzzer/wasm-fuzzer-common.h"
-
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
-  // TODO(titzer): Names section requires a preceding function section.
-  return v8::internal::wasm::fuzzer::FuzzWasmSection(
-      v8::internal::wasm::kNameSectionCode, data, size);
-}
diff --git a/src/v8/test/fuzzer/wasm-types-section.cc b/src/v8/test/fuzzer/wasm-types-section.cc
deleted file mode 100644
index e3c6b58..0000000
--- a/src/v8/test/fuzzer/wasm-types-section.cc
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/objects-inl.h"
-#include "test/fuzzer/wasm-fuzzer-common.h"
-
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
-  return v8::internal::wasm::fuzzer::FuzzWasmSection(
-      v8::internal::wasm::kTypeSectionCode, data, size);
-}
diff --git a/src/v8/test/fuzzer/wasm_call/foo b/src/v8/test/fuzzer/wasm_call/foo
deleted file mode 100644
index e69de29..0000000
--- a/src/v8/test/fuzzer/wasm_call/foo
+++ /dev/null
diff --git a/src/v8/test/fuzzer/wasm_data_section/foo b/src/v8/test/fuzzer/wasm_data_section/foo
deleted file mode 100644
index e69de29..0000000
--- a/src/v8/test/fuzzer/wasm_data_section/foo
+++ /dev/null
diff --git a/src/v8/test/fuzzer/wasm_function_sigs_section/foo b/src/v8/test/fuzzer/wasm_function_sigs_section/foo
deleted file mode 100644
index e69de29..0000000
--- a/src/v8/test/fuzzer/wasm_function_sigs_section/foo
+++ /dev/null
diff --git a/src/v8/test/fuzzer/wasm_globals_section/foo b/src/v8/test/fuzzer/wasm_globals_section/foo
deleted file mode 100644
index e69de29..0000000
--- a/src/v8/test/fuzzer/wasm_globals_section/foo
+++ /dev/null
diff --git a/src/v8/test/fuzzer/wasm_imports_section/foo b/src/v8/test/fuzzer/wasm_imports_section/foo
deleted file mode 100644
index e69de29..0000000
--- a/src/v8/test/fuzzer/wasm_imports_section/foo
+++ /dev/null
diff --git a/src/v8/test/fuzzer/wasm_memory_section/foo b/src/v8/test/fuzzer/wasm_memory_section/foo
deleted file mode 100644
index e69de29..0000000
--- a/src/v8/test/fuzzer/wasm_memory_section/foo
+++ /dev/null
diff --git a/src/v8/test/fuzzer/wasm_names_section/foo b/src/v8/test/fuzzer/wasm_names_section/foo
deleted file mode 100644
index e69de29..0000000
--- a/src/v8/test/fuzzer/wasm_names_section/foo
+++ /dev/null
diff --git a/src/v8/test/fuzzer/wasm_types_section/foo b/src/v8/test/fuzzer/wasm_types_section/foo
deleted file mode 100644
index e69de29..0000000
--- a/src/v8/test/fuzzer/wasm_types_section/foo
+++ /dev/null
diff --git a/src/v8/test/inspector/debugger/es6-module-set-script-source-expected.txt b/src/v8/test/inspector/debugger/es6-module-set-script-source-expected.txt
deleted file mode 100644
index cd0ef1f..0000000
--- a/src/v8/test/inspector/debugger/es6-module-set-script-source-expected.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-Checks that Debugger.setScriptSource doesn't crash with modules
-{
-    error : {
-        code : -32000
-        message : Editing module's script is not supported.
-    }
-    id : <messageId>
-}
diff --git a/src/v8/test/inspector/debugger/es6-module-set-script-source.js b/src/v8/test/inspector/debugger/es6-module-set-script-source.js
deleted file mode 100644
index 81d97b6..0000000
--- a/src/v8/test/inspector/debugger/es6-module-set-script-source.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-let {session, contextGroup, Protocol} = InspectorTest.start('Checks that Debugger.setScriptSource doesn\'t crash with modules');
-
-var module1 = `
-export function foo() {
-  return 42;
-}`;
-
-var editedModule1 = `
-export function foo() {
-  return 239;
-}`;
-
-var module2 = `
-import { foo } from 'module1';
-console.log(foo());
-`;
-
-var module1Id;
-Protocol.Debugger.onScriptParsed(message => {
-  if (message.params.url === 'module1')
-    module1Id = message.params.scriptId;
-});
-Protocol.Debugger.enable()
-  .then(() => contextGroup.addModule(module1, 'module1'))
-  .then(() => contextGroup.addModule(module2, 'module2'))
-  .then(() => InspectorTest.waitForPendingTasks())
-  .then(() => Protocol.Debugger.setScriptSource({ scriptId: module1Id, scriptSource: editedModule1 }))
-  .then(InspectorTest.logMessage)
-  .then(InspectorTest.completeTest);
diff --git a/src/v8/test/inspector/debugger/schedule-step-into-async-expected.txt b/src/v8/test/inspector/debugger/schedule-step-into-async-expected.txt
deleted file mode 100644
index be3cad1..0000000
--- a/src/v8/test/inspector/debugger/schedule-step-into-async-expected.txt
+++ /dev/null
@@ -1,191 +0,0 @@
-Checks Debugger.scheduleStepIntoAsync.
-
-Running test: testScheduleErrors
-paused at:
-function testNoScheduledTask() {
-  #debugger;
-  return 42;
-
-{
-    error : {
-        code : -32000
-        message : Current scheduled step into async was overriden with new one.
-    }
-    id : <messageId>
-}
-{
-    error : {
-        code : -32000
-        message : No async tasks were scheduled before pause.
-    }
-    id : <messageId>
-}
-paused at:
-  debugger;
-  #return 42;
-}
-
-
-Running test: testSimple
-paused at:
-function testSimple() {
-  #debugger;
-  Promise.resolve().then(v => v * 2);
-
-paused at:
-  debugger;
-  #Promise.resolve().then(v => v * 2);
-}
-
-{
-    id : <messageId>
-    result : {
-    }
-}
-paused at:
-  debugger;
-  Promise.resolve().then(#v => v * 2);
-}
-
-
-Running test: testNotResolvedPromise
-paused at:
-  var p = new Promise(resolve => resolveCallback = resolve);
-  #debugger;
-  p.then(v => v * 2);
-
-paused at:
-  debugger;
-  p.#then(v => v * 2);
-  resolveCallback();
-
-{
-    id : <messageId>
-    result : {
-    }
-}
-paused at:
-  debugger;
-  p.then(#v => v * 2);
-  resolveCallback();
-
-
-Running test: testTwoAsyncTasks
-paused at:
-function testTwoAsyncTasks() {
-  #debugger;
-  Promise.resolve().then(v => v * 2);
-
-{
-    id : <messageId>
-    result : {
-    }
-}
-paused at:
-  debugger;
-  Promise.resolve().then(#v => v * 2);
-  Promise.resolve().then(v => v * 4);
-
-
-Running test: testTwoTasksAndGoToSecond
-paused at:
-function testTwoAsyncTasks() {
-  #debugger;
-  Promise.resolve().then(v => v * 2);
-
-paused at:
-  debugger;
-  #Promise.resolve().then(v => v * 2);
-  Promise.resolve().then(v => v * 4);
-
-paused at:
-  Promise.resolve().then(v => v * 2);
-  #Promise.resolve().then(v => v * 4);
-}
-
-{
-    id : <messageId>
-    result : {
-    }
-}
-paused at:
-  Promise.resolve().then(v => v * 2);
-  Promise.resolve().then(#v => v * 4);
-}
-
-
-Running test: testTwoAsyncTasksWithBreak
-paused at:
-function testTwoAsyncTasksWithBreak() {
-  #debugger;
-  Promise.resolve().then(v => v * 2);
-
-paused at:
-  debugger;
-  #Promise.resolve().then(v => v * 2);
-  debugger;
-
-{
-    id : <messageId>
-    result : {
-    }
-}
-paused at:
-  Promise.resolve().then(v => v * 2);
-  #debugger;
-  Promise.resolve().then(v => v * 4);
-
-{
-    id : <messageId>
-    result : {
-    }
-}
-paused at:
-  debugger;
-  Promise.resolve().then(#v => v * 4);
-}
-
-
-Running test: testPromiseAll
-paused at:
-function testPromiseAll() {
-  #debugger;
-  Promise.all([ Promise.resolve(), Promise.resolve() ]).then(v => v * 2);
-
-paused at:
-  debugger;
-  #Promise.all([ Promise.resolve(), Promise.resolve() ]).then(v => v * 2);
-}
-
-{
-    id : <messageId>
-    result : {
-    }
-}
-paused at:
-  debugger;
-  Promise.all([ Promise.resolve(), Promise.resolve() ]).then(#v => v * 2);
-}
-
-
-Running test: testWithBlackboxedCode
-paused at:
-function testBlackboxedCreatePromise() {
-  #debugger;
-  createPromise().then(v => v * 2);
-
-paused at:
-  debugger;
-  #createPromise().then(v => v * 2);
-}
-
-{
-    id : <messageId>
-    result : {
-    }
-}
-paused at:
-  debugger;
-  createPromise().then(#v => v * 2);
-}
-
diff --git a/src/v8/test/inspector/debugger/schedule-step-into-async-set-timeout-expected.txt b/src/v8/test/inspector/debugger/schedule-step-into-async-set-timeout-expected.txt
deleted file mode 100644
index 28f3a19..0000000
--- a/src/v8/test/inspector/debugger/schedule-step-into-async-set-timeout-expected.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-Checks Debugger.scheduleStepIntoAsync with setTimeout.
-
-Running test: testSetTimeout
-paused at:
-debugger; #setTimeout(() => 1, 0);
-
-paused at:
-debugger; setTimeout(#() => 1, 0);
-
-
-Running test: testDebuggerStmtBeforeCallback1
-paused at:
-debugger; #setTimeout(() => 1, 0);debugger;
-
-paused at:
-debugger; setTimeout(() => 1, 0);#debugger;
-
-paused at:
-#debugger//should-break-here
-
-
-Running test: testDebuggerStmtBeforeCallback2
-paused at:
-setTimeout('debugger//should-break-here', 0);
-#setTimeout(() => 1, 0);
-
-paused at:
-#debugger//should-break-here
-
-
-Running test: testSetTimeoutWithoutJS
-paused at:
-debugger; #setTimeout('}', 0);
-setTimeout('var a = 239;', 0);
-
-paused at:
-#debugger//should-break-here
-
-
-Running test: testResume
-paused at:
-#setTimeout(() => 42, 0)
-
-paused at:
-setTimeout(#() => 42, 0)
-
diff --git a/src/v8/test/inspector/debugger/schedule-step-into-async-set-timeout.js b/src/v8/test/inspector/debugger/schedule-step-into-async-set-timeout.js
deleted file mode 100644
index f2171a5..0000000
--- a/src/v8/test/inspector/debugger/schedule-step-into-async-set-timeout.js
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-let {session, contextGroup, Protocol} = InspectorTest.start('Checks Debugger.scheduleStepIntoAsync with setTimeout.');
-session.setupScriptMap();
-Protocol.Debugger.enable();
-InspectorTest.runAsyncTestSuite([
-  async function testSetTimeout() {
-    Protocol.Runtime.evaluate({expression: 'debugger; setTimeout(() => 1, 0);'});
-    await Protocol.Debugger.oncePaused();
-    Protocol.Debugger.stepOver();
-    await waitPauseAndDumpLocation();
-    Protocol.Debugger.scheduleStepIntoAsync();
-    Protocol.Debugger.stepOver();
-    await waitPauseAndDumpLocation();
-    await Protocol.Debugger.resume();
-  },
-
-  async function testDebuggerStmtBeforeCallback1() {
-    Protocol.Runtime.evaluate({expression: 'debugger; setTimeout(() => 1, 0);debugger;'});
-    Protocol.Runtime.evaluate({expression: 'setTimeout(\'debugger//should-break-here\', 0)'});
-    await Protocol.Debugger.oncePaused();
-    Protocol.Debugger.stepOver();
-    await waitPauseAndDumpLocation();
-    Protocol.Debugger.scheduleStepIntoAsync();
-    Protocol.Debugger.stepOver();
-    await waitPauseAndDumpLocation();
-    await Protocol.Debugger.resume();
-    await waitPauseAndDumpLocation();
-    await Protocol.Debugger.resume();
-  },
-
-  async function testDebuggerStmtBeforeCallback2() {
-    Protocol.Runtime.evaluate({expression: 'debugger;\nsetTimeout(\'debugger//should-break-here\', 0);\nsetTimeout(() => 1, 0);'});
-    await Protocol.Debugger.oncePaused();
-    Protocol.Debugger.stepOver();
-    await Protocol.Debugger.oncePaused();
-    Protocol.Debugger.stepOver();
-    await waitPauseAndDumpLocation();
-    Protocol.Debugger.scheduleStepIntoAsync();
-    Protocol.Debugger.stepOver();
-    await waitPauseAndDumpLocation();
-    await Protocol.Debugger.resume();
-    await InspectorTest.waitForPendingTasks();
-  },
-
-  async function testSetTimeoutWithoutJS() {
-    Protocol.Runtime.evaluate({expression: 'debugger; setTimeout(\'}\', 0);\nsetTimeout(\'var a = 239;\', 0);\nsetTimeout(\'debugger//should-break-here\', 0);'});
-    await Protocol.Debugger.oncePaused();
-    Protocol.Debugger.stepOver();
-    await waitPauseAndDumpLocation();
-    Protocol.Debugger.scheduleStepIntoAsync();
-    Protocol.Debugger.stepOver();
-    await waitPauseAndDumpLocation();
-    await Protocol.Debugger.resume();
-  },
-
-  async function testResume() {
-    Protocol.Debugger.pause();
-    Protocol.Runtime.evaluate({expression: 'setTimeout(() => 42, 0)'});
-    await waitPauseAndDumpLocation();
-    Protocol.Debugger.scheduleStepIntoAsync();
-    Protocol.Debugger.resume();
-    await waitPauseAndDumpLocation();
-    await Protocol.Debugger.resume();
-  }
-]);
-
-async function waitPauseAndDumpLocation() {
-  var message = await Protocol.Debugger.oncePaused();
-  InspectorTest.log('paused at:');
-  await session.logSourceLocation(message.params.callFrames[0].location);
-  return message;
-}
diff --git a/src/v8/test/inspector/debugger/schedule-step-into-async.js b/src/v8/test/inspector/debugger/schedule-step-into-async.js
deleted file mode 100644
index c4dfb73..0000000
--- a/src/v8/test/inspector/debugger/schedule-step-into-async.js
+++ /dev/null
@@ -1,159 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-let {session, contextGroup, Protocol} = InspectorTest.start('Checks Debugger.scheduleStepIntoAsync.');
-
-contextGroup.addScript(`
-function testNoScheduledTask() {
-  debugger;
-  return 42;
-}
-
-function testSimple() {
-  debugger;
-  Promise.resolve().then(v => v * 2);
-}
-
-function testNotResolvedPromise() {
-  var resolveCallback;
-  var p = new Promise(resolve => resolveCallback = resolve);
-  debugger;
-  p.then(v => v * 2);
-  resolveCallback();
-}
-
-function testTwoAsyncTasks() {
-  debugger;
-  Promise.resolve().then(v => v * 2);
-  Promise.resolve().then(v => v * 4);
-}
-
-function testTwoAsyncTasksWithBreak() {
-  debugger;
-  Promise.resolve().then(v => v * 2);
-  debugger;
-  Promise.resolve().then(v => v * 4);
-}
-
-function testPromiseAll() {
-  debugger;
-  Promise.all([ Promise.resolve(), Promise.resolve() ]).then(v => v * 2);
-}
-
-function testBlackboxedCreatePromise() {
-  debugger;
-  createPromise().then(v => v * 2);
-}
-//# sourceURL=test.js`);
-
-contextGroup.addScript(`
-
-function createPromise() {
-  return Promise.resolve().then(v => v * 3).then(v => v * 4);
-}
-
-//# sourceURL=framework.js`)
-
-session.setupScriptMap();
-
-Protocol.Debugger.enable();
-InspectorTest.runAsyncTestSuite([
-  async function testScheduleErrors() {
-    Protocol.Runtime.evaluate({ expression: 'testNoScheduledTask()' });
-    await waitPauseAndDumpLocation();
-    Protocol.Debugger.scheduleStepIntoAsync().then(InspectorTest.logMessage);
-    Protocol.Debugger.scheduleStepIntoAsync().then(InspectorTest.logMessage);
-    Protocol.Debugger.stepInto();
-    await waitPauseAndDumpLocation();
-    await Protocol.Debugger.resume();
-  },
-
-  async function testSimple() {
-    Protocol.Runtime.evaluate({ expression: 'testSimple()' });
-    await waitPauseAndDumpLocation();
-    Protocol.Debugger.stepOver();
-    await waitPauseAndDumpLocation();
-    Protocol.Debugger.scheduleStepIntoAsync().then(InspectorTest.logMessage);
-    Protocol.Debugger.stepInto();
-    await waitPauseAndDumpLocation();
-    await Protocol.Debugger.resume();
-  },
-
-  async function testNotResolvedPromise() {
-    Protocol.Runtime.evaluate({ expression: 'testNotResolvedPromise()' });
-    await waitPauseAndDumpLocation();
-    Protocol.Debugger.stepOver();
-    await waitPauseAndDumpLocation();
-    Protocol.Debugger.scheduleStepIntoAsync().then(InspectorTest.logMessage);
-    Protocol.Debugger.stepInto();
-    await waitPauseAndDumpLocation();
-    await Protocol.Debugger.resume();
-  },
-
-  async function testTwoAsyncTasks() {
-    Protocol.Runtime.evaluate({ expression: 'testTwoAsyncTasks()' });
-    await waitPauseAndDumpLocation();
-    Protocol.Debugger.scheduleStepIntoAsync().then(InspectorTest.logMessage);
-    Protocol.Debugger.resume();
-    await waitPauseAndDumpLocation();
-    await Protocol.Debugger.resume();
-  },
-
-  async function testTwoTasksAndGoToSecond() {
-    Protocol.Runtime.evaluate({ expression: 'testTwoAsyncTasks()' });
-    await waitPauseAndDumpLocation();
-    Protocol.Debugger.stepOver();
-    await waitPauseAndDumpLocation();
-    Protocol.Debugger.stepOver();
-    await waitPauseAndDumpLocation();
-    Protocol.Debugger.scheduleStepIntoAsync().then(InspectorTest.logMessage);
-    Protocol.Debugger.resume();
-    await waitPauseAndDumpLocation();
-    await Protocol.Debugger.resume();
-  },
-
-  async function testTwoAsyncTasksWithBreak() {
-    Protocol.Runtime.evaluate({ expression: 'testTwoAsyncTasksWithBreak()' });
-    await waitPauseAndDumpLocation();
-    Protocol.Debugger.stepOver();
-    await waitPauseAndDumpLocation();
-    Protocol.Debugger.scheduleStepIntoAsync().then(InspectorTest.logMessage);
-    Protocol.Debugger.resume();
-    await waitPauseAndDumpLocation();
-    Protocol.Debugger.scheduleStepIntoAsync().then(InspectorTest.logMessage);
-    Protocol.Debugger.resume();
-    await waitPauseAndDumpLocation();
-    await Protocol.Debugger.resume();
-  },
-
-  async function testPromiseAll() {
-    Protocol.Runtime.evaluate({ expression: 'testPromiseAll()' });
-    await waitPauseAndDumpLocation();
-    Protocol.Debugger.stepOver();
-    await waitPauseAndDumpLocation();
-    Protocol.Debugger.scheduleStepIntoAsync().then(InspectorTest.logMessage);
-    Protocol.Debugger.stepOver();
-    await waitPauseAndDumpLocation();
-    await Protocol.Debugger.resume();
-  },
-
-  async function testWithBlackboxedCode() {
-    Protocol.Runtime.evaluate({ expression: 'testBlackboxedCreatePromise()' });
-    await waitPauseAndDumpLocation();
-    Protocol.Debugger.stepOver();
-    await waitPauseAndDumpLocation();
-    await Protocol.Debugger.setBlackboxPatterns({patterns: ['framework\.js'] });
-    Protocol.Debugger.scheduleStepIntoAsync().then(InspectorTest.logMessage);
-    Protocol.Debugger.stepOver();
-    await waitPauseAndDumpLocation();
-    await Protocol.Debugger.resume();
-  }
-]);
-
-async function waitPauseAndDumpLocation() {
-  var message = await Protocol.Debugger.oncePaused();
-  InspectorTest.log('paused at:');
-  session.logSourceLocation(message.params.callFrames[0].location);
-  return message;
-}
diff --git a/src/v8/test/inspector/debugger/stepping-ignores-injected-script-expected.txt b/src/v8/test/inspector/debugger/stepping-ignores-injected-script-expected.txt
deleted file mode 100644
index 5a63493..0000000
--- a/src/v8/test/inspector/debugger/stepping-ignores-injected-script-expected.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Tests that stepping ignores injected script
-InjectedSciptSource was not reached
diff --git a/src/v8/test/inspector/debugger/stepping-ignores-injected-script.js b/src/v8/test/inspector/debugger/stepping-ignores-injected-script.js
deleted file mode 100644
index 9021664..0000000
--- a/src/v8/test/inspector/debugger/stepping-ignores-injected-script.js
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-let {session, contextGroup, Protocol} = InspectorTest.start('Tests that stepping ignores injected script');
-
-Protocol.Debugger.onPaused(message => {
-  let url = session._scriptMap.get(message.params.callFrames[0].location.scriptId).url;
-  if (url !== 'test.js') {
-    InspectorTest.log('InjectedSciptSource on stack.');
-    InspectorTest.completeTest();
-  }
-  Protocol.Debugger.stepInto();
-});
-
-session.setupScriptMap();
-Protocol.Debugger.enable();
-Protocol.Debugger.pause();
-Protocol.Runtime.evaluate({expression: 'console.log(42)//# sourceURL=test.js'})
-  .then(() => InspectorTest.log('InjectedSciptSource was not reached'))
-  .then(InspectorTest.completeTest);
diff --git a/src/v8/test/inspector/debugger/stepping-with-exposed-injected-script-expected.txt b/src/v8/test/inspector/debugger/stepping-with-exposed-injected-script-expected.txt
deleted file mode 100644
index 65c32c3..0000000
--- a/src/v8/test/inspector/debugger/stepping-with-exposed-injected-script-expected.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Tests that stepping does not ignore injected script when passed a flag
-InjectedSciptSource on stack.
diff --git a/src/v8/test/inspector/debugger/stepping-with-exposed-injected-script.js b/src/v8/test/inspector/debugger/stepping-with-exposed-injected-script.js
deleted file mode 100644
index d608137..0000000
--- a/src/v8/test/inspector/debugger/stepping-with-exposed-injected-script.js
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-// Flags: --expose-inspector-scripts
-
-let {session, contextGroup, Protocol} = InspectorTest.start('Tests that stepping does not ignore injected script when passed a flag');
-
-Protocol.Debugger.onPaused(message => {
-  let url = session._scriptMap.get(message.params.callFrames[0].location.scriptId).url;
-  if (url !== 'test.js') {
-    InspectorTest.log('InjectedSciptSource on stack.');
-    InspectorTest.completeTest();
-  }
-  Protocol.Debugger.stepInto();
-});
-
-session.setupScriptMap();
-Protocol.Debugger.enable();
-Protocol.Debugger.pause();
-Protocol.Runtime.evaluate({expression: 'console.log(42)//# sourceURL=test.js'})
-  .then(() => InspectorTest.log('InjectedSciptSource was not reached'))
-  .then(InspectorTest.completeTest);
diff --git a/src/v8/test/inspector/inspector.gyp b/src/v8/test/inspector/inspector.gyp
deleted file mode 100644
index b465f9e..0000000
--- a/src/v8/test/inspector/inspector.gyp
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright 2016 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'variables': {
-    'v8_code': 1,
-  },
-  'includes': ['../../gypfiles/toolchain.gypi', '../../gypfiles/features.gypi'],
-  'targets': [
-    {
-      'target_name': 'inspector-test',
-      'type': 'executable',
-      'dependencies': [
-        '../../src/v8.gyp:v8_libplatform',
-        '../../src/v8.gyp:v8_libbase',
-        '../../src/v8.gyp:v8',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [
-        'inspector-test.cc',
-        'isolate-data.cc',
-        'isolate-data.h',
-        'task-runner.cc',
-        'task-runner.h',
-      ],
-      'conditions': [
-        ['v8_enable_i18n_support==1', {
-          'dependencies': [
-            '<(icu_gyp_path):icui18n',
-            '<(icu_gyp_path):icuuc',
-          ],
-        }],
-      ],
-    },
-  ],
-  'conditions': [
-    ['test_isolation_mode != "noop"', {
-      'targets': [
-        {
-          'target_name': 'inspector-test_run',
-          'type': 'none',
-          'dependencies': [
-            'inspector-test',
-          ],
-          'includes': [
-            '../../gypfiles/isolate.gypi',
-          ],
-          'sources': [
-            'inspector.isolate',
-          ],
-        },
-      ],
-    }],
-  ],
-}
diff --git a/src/v8/test/inspector/inspector.isolate b/src/v8/test/inspector/inspector.isolate
deleted file mode 100644
index 38a96c5..0000000
--- a/src/v8/test/inspector/inspector.isolate
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 2016 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'variables': {
-    'files': [
-      './console/',
-      './cpu-profiler/',
-      './debugger/',
-      './heap-profiler/',
-      './inspector.status',
-      './json-parse-expected.txt',
-      './json-parse.js',
-      './protocol-test.js',
-      './runtime/',
-      './sessions/',
-      './testcfg.py',
-      './type-profiler/',
-      '../../src/inspector/injected-script-source.js',
-      '<(PRODUCT_DIR)/inspector-test<(EXECUTABLE_SUFFIX)',
-    ],
-  },
-  'includes': [
-    '../../src/base.isolate',
-    '../../tools/testrunner/testrunner.isolate',
-  ],
-}
diff --git a/src/v8/test/inspector/runtime/console-deprecated-methods-expected.txt b/src/v8/test/inspector/runtime/console-deprecated-methods-expected.txt
deleted file mode 100644
index 4c1e265..0000000
--- a/src/v8/test/inspector/runtime/console-deprecated-methods-expected.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-Tests checks that deprecation messages for console.
-'console.timeline' is deprecated. Please use 'console.time' instead.
-'console.timelineEnd' is deprecated. Please use 'console.timeEnd' instead.
-'console.markTimeline' is deprecated. Please use 'console.timeStamp' instead.
diff --git a/src/v8/test/inspector/runtime/console-deprecated-methods.js b/src/v8/test/inspector/runtime/console-deprecated-methods.js
deleted file mode 100644
index e8ccd2a..0000000
--- a/src/v8/test/inspector/runtime/console-deprecated-methods.js
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-let {session, contextGroup, Protocol} = InspectorTest.start("Tests checks that deprecation messages for console.")
-
-Protocol.Runtime.onConsoleAPICalled(messageAdded);
-Protocol.Runtime.enable();
-
-var deprecatedMethods = [
-  "console.timeline(\"42\")",
-  "console.timeline(\"42\")",
-  "console.timeline(\"42\")", // three calls should produce one warning message
-  "console.timelineEnd(\"42\")",
-  "console.markTimeline(\"42\")",
-];
-Protocol.Runtime.evaluate({ expression: deprecatedMethods.join(";") });
-
-var messagesLeft = 3;
-function messageAdded(data)
-{
-  var text = data.params.args[0].value;
-  if (text.indexOf("deprecated") === -1)
-    return;
-  InspectorTest.log(text);
-  if (!--messagesLeft)
-    InspectorTest.completeTest();
-}
diff --git a/src/v8/test/intl/break-iterator/wellformed-unsupported-locale.js b/src/v8/test/intl/break-iterator/wellformed-unsupported-locale.js
deleted file mode 100644
index 5ac8fbc..0000000
--- a/src/v8/test/intl/break-iterator/wellformed-unsupported-locale.js
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2013 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.
-
-// Passing a well formed but unsupported locale falls back to default.
-
-var iterator = Intl.v8BreakIterator(['xx']);
-
-assertEquals(iterator.resolvedOptions().locale, %GetDefaultICULocale());
diff --git a/src/v8/test/intl/collator/wellformed-unsupported-locale.js b/src/v8/test/intl/collator/wellformed-unsupported-locale.js
deleted file mode 100644
index 3963d47..0000000
--- a/src/v8/test/intl/collator/wellformed-unsupported-locale.js
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2013 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.
-
-// Passing a well formed but unsupported locale falls back to default.
-
-var collator = Intl.Collator(['xx']);
-
-assertEquals(collator.resolvedOptions().locale, %GetDefaultICULocale());
diff --git a/src/v8/test/intl/date-format/wellformed-unsupported-locale.js b/src/v8/test/intl/date-format/wellformed-unsupported-locale.js
deleted file mode 100644
index 6f063ab..0000000
--- a/src/v8/test/intl/date-format/wellformed-unsupported-locale.js
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2013 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.
-
-// Passing a well formed but unsupported locale falls back to default.
-
-var dtf = Intl.DateTimeFormat(['xx']);
-
-assertEquals(dtf.resolvedOptions().locale, %GetDefaultICULocale());
diff --git a/src/v8/test/intl/intl.gyp b/src/v8/test/intl/intl.gyp
deleted file mode 100644
index f2e107f..0000000
--- a/src/v8/test/intl/intl.gyp
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'conditions': [
-    ['test_isolation_mode != "noop"', {
-      'targets': [
-        {
-          'target_name': 'intl_run',
-          'type': 'none',
-          'dependencies': [
-            '../../src/d8.gyp:d8_run',
-          ],
-          'includes': [
-            '../../gypfiles/features.gypi',
-            '../../gypfiles/isolate.gypi',
-          ],
-          'sources': [
-            'intl.isolate',
-          ],
-        },
-      ],
-    }],
-  ],
-}
diff --git a/src/v8/test/intl/intl.isolate b/src/v8/test/intl/intl.isolate
deleted file mode 100644
index dbeca5e..0000000
--- a/src/v8/test/intl/intl.isolate
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'variables': {
-    'files': [
-      './',
-    ],
-  },
-  'includes': [
-    '../../src/d8.isolate',
-    '../../tools/testrunner/testrunner.isolate',
-  ],
-}
\ No newline at end of file
diff --git a/src/v8/test/intl/number-format/wellformed-unsupported-locale.js b/src/v8/test/intl/number-format/wellformed-unsupported-locale.js
deleted file mode 100644
index 195eba4..0000000
--- a/src/v8/test/intl/number-format/wellformed-unsupported-locale.js
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2013 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.
-
-// Passing a well formed but unsupported locale falls back to default.
-
-var nf = Intl.NumberFormat(['xx']);
-
-assertEquals(nf.resolvedOptions().locale, %GetDefaultICULocale());
diff --git a/src/v8/test/intl/regexp-assert.js b/src/v8/test/intl/regexp-assert.js
deleted file mode 100644
index 28fafd0..0000000
--- a/src/v8/test/intl/regexp-assert.js
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-assertEquals("a", RegExp.$1);
-assertEquals("b", RegExp.$2);
-assertEquals("c", RegExp.$3);
-assertEquals("d", RegExp.$4);
-assertEquals("e", RegExp.$5);
-assertEquals("f", RegExp.$6);
-assertEquals("g", RegExp.$7);
-assertEquals("h", RegExp.$8);
-assertEquals("i", RegExp.$9);
-
-assertEquals("abcdefghij", RegExp.lastMatch);
-assertEquals("j", RegExp.lastParen);
-assertEquals(">>>", RegExp.leftContext);
-assertEquals("<<<", RegExp.rightContext);
-assertEquals(">>>abcdefghij<<<", RegExp.input);
diff --git a/src/v8/test/intl/regexp-prepare.js b/src/v8/test/intl/regexp-prepare.js
deleted file mode 100644
index dec8411..0000000
--- a/src/v8/test/intl/regexp-prepare.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/(\w)(\w)(\w)(\w)(\w)(\w)(\w)(\w)(\w)(\w)/.exec(">>>abcdefghij<<<");
diff --git a/src/v8/test/js-perf-test/JSTests.json b/src/v8/test/js-perf-test/JSTests.json
deleted file mode 100644
index a1a19f5..0000000
--- a/src/v8/test/js-perf-test/JSTests.json
+++ /dev/null
@@ -1,685 +0,0 @@
-{
-  "name": "JSTests",
-  "run_count": 3,
-  "run_count_arm": 1,
-  "run_count_arm64": 1,
-  "timeout": 120,
-  "units": "score",
-  "total": true,
-  "resources": ["base.js"],
-  "tests": [
-    {
-      "name": "Proxies",
-      "path": ["Proxies"],
-      "main": "run.js",
-      "resources": ["proxies.js"],
-      "results_regexp": "^%s\\-Proxies\\(Score\\): (.+)$",
-      "tests": [
-        {"name": "GetStringWithoutTrap"},
-        {"name": "GetStringWithTrap"},
-        {"name": "GetIndexWithoutTrap"},
-        {"name": "GetIndexWithTrap"},
-        {"name": "GetSymbolWithoutTrap"},
-        {"name": "GetSymbolWithTrap"},
-        {"name": "HasStringWithoutTrap"},
-        {"name": "HasStringWithTrap"},
-        {"name": "HasSymbolWithoutTrap"},
-        {"name": "HasSymbolWithTrap"},
-        {"name": "SetStringWithoutTrap"},
-        {"name": "SetStringWithTrap"},
-        {"name": "SetIndexWithoutTrap"},
-        {"name": "SetIndexWithTrap"},
-        {"name": "SetSymbolWithoutTrap"},
-        {"name": "SetSymbolWithTrap"},
-        {"name": "HasInIdiom"}
-      ]
-    },
-    {
-      "name": "AsyncAwait",
-      "path": ["AsyncAwait"],
-      "main": "run.js",
-      "resources": [
-        "native.js",
-        "baseline-babel-es2017.js",
-        "baseline-naive-promises.js"
-      ],
-      "flags": ["--allow-natives-syntax"],
-      "results_regexp": "^%s\\-AsyncAwait\\(Score\\): (.+)$",
-      "tests": [
-        {"name": "BaselineES2017"},
-        {"name": "BaselineNaivePromises"},
-        {"name": "Native"}
-      ]
-    },
-    {
-      "name": "Generators",
-      "path": ["Generators"],
-      "main": "run.js",
-      "resources": ["generators.js"],
-      "flags": ["--harmony-function-sent"],
-      "results_regexp": "^Generators\\-Generators\\(Score\\): (.+)$"
-    },
-    {
-      "name": "RestParameters",
-      "path": ["RestParameters"],
-      "main": "run.js",
-      "resources": ["rest.js"],
-      "units": "score",
-      "results_regexp": "^%s\\-RestParameters\\(Score\\): (.+)$",
-      "tests": [
-        {"name": "Basic1"},
-        {"name": "ReturnArgsBabel"},
-        {"name": "ReturnArgsNative"}
-      ]
-    },
-    {
-      "name": "SpreadCalls",
-      "path": ["SpreadCalls"],
-      "main": "run.js",
-      "resources": ["spreadcalls.js"],
-      "units": "score",
-      "results_regexp": "^%s\\-SpreadCalls\\(Score\\): (.+)$",
-      "tests": [
-        {"name": "Call"},
-        {"name": "CallMethod"},
-        {"name": "CallNew"}
-      ]
-    },
-    {
-      "name": "Classes",
-      "path": ["Classes"],
-      "main": "run.js",
-      "resources": [
-        "super.js",
-        "default-constructor.js",
-        "leaf-constructors.js"],
-      "results_regexp": "^%s\\-Classes\\(Score\\): (.+)$",
-      "tests": [
-        {"name": "Super"},
-        {"name": "DefaultConstructor"},
-        {"name": "LeafConstructors"}
-      ]
-    },
-    {
-      "name": "Closures",
-      "path": ["Closures"],
-      "main": "run.js",
-      "resources": ["closures.js"],
-      "flags": [],
-      "results_regexp": "^%s\\-Closures\\(Score\\): (.+)$",
-      "tests": [
-        {"name": "Closures"}
-      ]
-    },
-    {
-      "name": "ClosuresMarkForTierUp",
-      "path": ["Closures"],
-      "main": "run.js",
-      "resources": ["closures.js"],
-      "flags": ["--mark_shared_functions_for_tier_up"],
-      "results_regexp": "^%s\\-Closures\\(Score\\): (.+)$",
-      "tests": [
-        {"name": "Closures"}
-      ]
-    },
-    {
-      "name": "ManyClosures",
-      "path": ["ManyClosures"],
-      "main": "run.js",
-      "resources": ["create-many-closures.js"],
-      "flags": [ "--allow-natives-syntax", "--expose-gc" ],
-      "results_regexp": "^%s\\-ManyClosures\\(Score\\): (.+)$",
-      "tests": [
-        {"name": "ManyClosures"}
-      ]
-    },
-    {
-      "name": "Collections",
-      "path": ["Collections"],
-      "main": "run.js",
-      "resources": [
-        "common.js",
-        "map.js",
-        "run.js",
-        "set.js",
-        "weakmap.js",
-        "weakset.js"
-      ],
-      "results_regexp": "^%s\\-Collections\\(Score\\): (.+)$",
-      "tests": [
-        {"name": "Map-Smi"},
-        {"name": "Map-String"},
-        {"name": "Map-Object"},
-        {"name": "Map-Object-Set-Get-Large"},
-        {"name": "Map-Double"},
-        {"name": "Map-Iteration"},
-        {"name": "Map-Iterator"},
-        {"name": "Set-Smi"},
-        {"name": "Set-String"},
-        {"name": "Set-Object"},
-        {"name": "Set-Double"},
-        {"name": "Set-Iteration"},
-        {"name": "Set-Iterator"},
-        {"name": "WeakMap"},
-        {"name": "WeakMap-Constructor"},
-        {"name": "WeakSet"},
-        {"name": "WeakSet-Constructor"}
-      ]
-    },
-    {
-      "name": "Iterators",
-      "path": ["Iterators"],
-      "main": "run.js",
-      "resources": ["forof.js"],
-      "results_regexp": "^%s\\-Iterators\\(Score\\): (.+)$",
-      "tests": [
-        {"name": "ForOf"}
-      ]
-    },
-    {
-      "name": "Strings",
-      "path": ["Strings"],
-      "main": "run.js",
-      "resources": ["harmony-string.js", "string-indexof.js"],
-      "results_regexp": "^%s\\-Strings\\(Score\\): (.+)$",
-      "run_count": 1,
-      "timeout": 240,
-      "timeout_arm": 420,
-      "tests": [
-        {"name": "StringFunctions"},
-        {"name": "StringIndexOfConstant"},
-        {"name": "StringIndexOfNonConstant"},
-        {"name": "StringCharCodeAtConstant"},
-        {"name": "StringCharCodeAtNonConstant"}
-      ]
-    },
-    {
-      "name": "StringIterators",
-      "path": ["StringIterators"],
-      "main": "run.js",
-      "resources": ["string-iterator.js"],
-      "results_regexp": "^%s\\-StringIterators\\(Score\\): (.+)$",
-      "tests": [
-        {"name": "Spread_OneByteShort"},
-        {"name": "Spread_TwoByteShort"},
-        {"name": "Spread_WithSurrogatePairsShort"},
-        {"name": "ForOf_OneByteShort"},
-        {"name": "ForOf_TwoByteShort"},
-        {"name": "ForOf_WithSurrogatePairsShort"},
-        {"name": "ForOf_OneByteLong"},
-        {"name": "ForOf_TwoByteLong"},
-        {"name": "ForOf_WithSurrogatePairsLong"}
-      ]
-    },
-    {
-      "name": "Templates",
-      "path": ["Templates"],
-      "main": "run.js",
-      "resources": ["templates.js"],
-      "units": "score",
-      "results_regexp": "^%s\\-Templates\\(Score\\): (.+)$",
-      "total": true,
-      "tests": [
-        {"name": "Untagged"},
-        {"name": "LargeUntagged"},
-        {"name": "Tagged"}
-      ]
-    },
-    {
-      "name": "Object",
-      "path": ["Object"],
-      "main": "run.js",
-      "flags": ["--harmony"],
-      "resources": [
-        "assign.js",
-        "create.js",
-        "entries.js",
-        "values.js"
-      ],
-      "results_regexp": "^%s\\-Object\\(Score\\): (.+)$",
-      "tests": [
-        {"name": "Assign"},
-        {"name": "Create"},
-        {"name": "Entries"},
-        {"name": "EntriesMegamorphic"},
-        {"name": "Values"},
-        {"name": "ValuesMegamorphic"}
-      ]
-    },
-    {
-      "name": "Scope",
-      "path": ["Scope"],
-      "main": "run.js",
-      "resources": ["with.js"],
-      "results_regexp": "^%s\\-Scope\\(Score\\): (.+)$",
-      "tests": [
-        {"name": "With"}
-      ]
-    },
-    {
-      "name": "Exceptions",
-      "path": ["Exceptions"],
-      "main": "run.js",
-      "resources": ["try-catch.js"],
-      "results_regexp": "^%s\\-Exceptions\\(Score\\): (.+)$",
-      "tests": [
-        {"name": "Try-Catch"}
-      ]
-    },
-    {
-      "name": "Keys",
-      "path": ["Keys"],
-      "main": "run.js",
-      "resources": ["keys.js"],
-      "results_regexp": "^%s\\-Keys\\(Score\\): (.+)$",
-      "tests": [
-        {"name": "Object.keys()"},
-        {"name": "for-in"},
-        {"name": "for-in hasOwnProperty()"},
-        {"name": "for (i < Object.keys().length)"},
-        {"name": "Object.keys().forEach()"},
-        {"name": "for (i < array.length)"},
-        {"name": "for (i < length)"}
-      ]
-    },
-    {
-      "name": "PropertyQueries",
-      "path": ["PropertyQueries"],
-      "main": "run.js",
-      "resources": ["property-queries.js"],
-      "results_regexp": "^%s\\-PropertyQueries\\(Score\\): (.+)$",
-      "tests": [
-        {"name": "in--INTERN-prop"},
-        {"name": "in--DEINTERN-prop"},
-        {"name": "in--NE-INTERN-prop"},
-        {"name": "in--NE-DEINTERN-prop"},
-        {"name": "in--el"},
-        {"name": "in--el-str"},
-        {"name": "in--NE-el"},
-        {"name": "Object.hasOwnProperty--INTERN-prop"},
-        {"name": "Object.hasOwnProperty--DEINTERN-prop"},
-        {"name": "Object.hasOwnProperty--NE-INTERN-prop"},
-        {"name": "Object.hasOwnProperty--NE-DEINTERN-prop"},
-        {"name": "Object.hasOwnProperty--el"},
-        {"name": "Object.hasOwnProperty--el-str"},
-        {"name": "Object.hasOwnProperty--NE-el"}
-      ]
-    },
-    {
-      "name": "TypedArrays",
-      "path": ["TypedArrays"],
-      "results_regexp": "^TypedArrays\\-%s\\(Score\\): (.+)$",
-      "tests": [
-        {
-          "name": "CopyWithin",
-          "main": "run.js",
-          "resources": ["copywithin.js"],
-          "test_flags": ["copywithin"]
-        },
-        {
-          "name": "Constructor",
-          "main": "run.js",
-          "resources": ["constructor.js"],
-          "test_flags": ["constructor"]
-        },
-        {
-          "name": "ConstructWithBuffer",
-          "main": "run.js",
-          "resources": ["construct-buffer.js"],
-          "test_flags": ["construct-buffer"]
-        },
-        {
-          "name": "ConstructArrayLike",
-          "main": "run.js",
-          "resources": ["construct-arraylike.js"],
-          "test_flags": ["construct-arraylike"]
-        },
-        {
-          "name": "ConstructByTypedArray",
-          "main": "run.js",
-          "resources": ["construct-typedarray.js"],
-          "test_flags": ["construct-typedarray"]
-        },
-        {
-          "name": "ConstructBySameTypedArray",
-          "main": "run.js",
-          "resources": ["construct-same-typedarray.js"],
-          "test_flags": ["construct-same-typedarray"]
-        },
-        {
-          "name": "ConstructAllTypedArrays",
-          "main": "run.js",
-          "resources": ["construct-all-typedarrays.js"],
-          "test_flags": ["construct-all-typedarrays"]
-        },
-        {
-          "name": "SetFromArrayLike",
-          "main": "run.js",
-          "resources": ["set-from-arraylike.js"],
-          "test_flags": ["set-from-arraylike"]
-        },
-        {
-          "name": "SetFromDifferentType",
-          "main": "run.js",
-          "resources": ["set-from-different-type.js"],
-          "test_flags": ["set-from-different-type"]
-        },
-        {
-          "name": "SetFromSameType",
-          "main": "run.js",
-          "resources": ["set-from-same-type.js"],
-          "test_flags": ["set-from-same-type"]
-        },
-        {
-          "name": "SliceNoSpecies",
-          "main": "run.js",
-          "resources": ["slice-nospecies.js"],
-          "test_flags": ["slice-nospecies"]
-        },
-        {
-          "name": "Sort",
-          "main": "run.js",
-          "resources": ["sort.js"],
-          "test_flags": ["sort"]
-        },
-        {
-          "name": "SubarrayNoSpecies",
-          "main": "run.js",
-          "resources": ["subarray-nospecies.js"],
-          "test_flags": ["subarray-nospecies"]
-        }
-      ]
-    },
-    {
-      "name": "Array",
-      "path": ["Array"],
-      "main": "run.js",
-      "resources": [
-        "filter.js", "map.js", "every.js", "join.js", "some.js",
-        "reduce.js", "reduce-right.js", "to-string.js", "find.js",
-        "find-index.js", "of.js"
-      ],
-      "flags": [
-        "--allow-natives-syntax"
-      ],
-      "results_regexp": "^%s\\-Array\\(Score\\): (.+)$",
-      "tests": [
-        {"name": "NaiveForEachReplacement"},
-        {"name": "DoubleForEach"},
-        {"name": "SmiForEach"},
-        {"name": "FastForEach"},
-        {"name": "GenericForEach"},
-        {"name": "OptFastForEach"},
-        {"name": "OptUnreliableForEach"},
-        {"name": "NaiveFilterReplacement"},
-        {"name": "DoubleFilter"},
-        {"name": "SmiFilter"},
-        {"name": "FastFilter"},
-        {"name": "GenericFilter"},
-        {"name": "OptFastFilter"},
-        {"name": "OptUnreliableFilter"},
-        {"name": "NaiveMapReplacement"},
-        {"name": "DoubleMap"},
-        {"name": "SmiMap"},
-        {"name": "FastMap"},
-        {"name": "GenericMap"},
-        {"name": "OptFastMap"},
-        {"name": "OptUnreliableMap"},
-        {"name": "DoubleEvery"},
-        {"name": "SmiEvery"},
-        {"name": "FastEvery"},
-        {"name": "OptFastEvery"},
-        {"name": "OptUnreliableEvery"},
-        {"name": "SmiJoin"},
-        {"name": "StringJoin"},
-        {"name": "SparseSmiJoin"},
-        {"name": "SparseStringJoin"},
-        {"name": "DoubleSome"},
-        {"name": "SmiSome"},
-        {"name": "FastSome"},
-        {"name": "OptFastSome"},
-        {"name": "OptUnreliableSome"},
-        {"name": "DoubleReduce"},
-        {"name": "SmiReduce"},
-        {"name": "FastReduce"},
-        {"name": "OptFastReduce"},
-        {"name": "OptUnreliableReduce"},
-        {"name": "DoubleReduceRight"},
-        {"name": "SmiReduceRight"},
-        {"name": "FastReduceRight"},
-        {"name": "OptFastReduceRight"},
-        {"name": "OptUnreliableReduceRight"},
-        {"name": "SmiToString"},
-        {"name": "StringToString"},
-        {"name": "SparseSmiToString"},
-        {"name": "SparseStringToString"},
-        {"name": "NaiveFindReplacement"},
-        {"name": "DoubleFind"},
-        {"name": "SmiFind"},
-        {"name": "FastFind"},
-        {"name": "GenericFind"},
-        {"name": "OptFastFind"},
-        {"name": "OptUnreliableFind"},
-        {"name": "NaiveFindIndexReplacement"},
-        {"name": "DoubleFindIndex"},
-        {"name": "SmiFindIndex"},
-        {"name": "FastFindIndex"},
-        {"name": "GenericFindIndex"},
-        {"name": "OptFastFindIndex"},
-        {"name": "OptUnreliableFindIndex"},
-        {"name": "EmptyArrayOf"},
-        {"name": "SmallSmiArrayOf"},
-        {"name": "LargeSmiArrayOf"},
-        {"name": "SmallTransplantedArrayOf"},
-        {"name": "SmallDoubleArrayOf"},
-        {"name": "SmallStringArrayOf"},
-        {"name": "SmallMixedArrayOf"}
-      ]
-    },
-    {
-      "name": "ForLoops",
-      "path": ["ForLoops"],
-      "main": "run.js",
-      "resources": [
-        "for_loop.js"
-      ],
-      "results_regexp": "^%s\\-ForLoop\\(Score\\): (.+)$",
-      "tests": [
-        {"name": "Let-Standard"},
-        {"name": "Var-Standard"}
-      ]
-    },
-    {
-      "name": "Modules",
-      "path": ["Modules"],
-      "main": "run.js",
-      "resources": ["basic-export.js", "basic-import.js", "basic-namespace.js", "value.js"],
-      "flags": [
-        "--allow-natives-syntax",
-        "--harmony-dynamic-import"
-      ],
-      "results_regexp": "^%s\\-Modules\\(Score\\): (.+)$",
-      "tests": [
-        {"name": "BasicExport"},
-        {"name": "BasicImport"},
-        {"name": "BasicNamespace"}
-      ]
-    },
-    {
-      "name": "BytecodeHandlers",
-      "path": ["BytecodeHandlers"],
-      "flags": [ "--no-opt" ],
-      "tests": [
-        {
-          "name": "Compare",
-          "main": "run.js",
-          "resources": [ "compare.js" ],
-          "test_flags": [ "compare" ],
-          "results_regexp": "^%s\\-BytecodeHandler\\(Score\\): (.+)$",
-          "tests": [
-            {"name": "Smi-StrictEquals-True"},
-            {"name": "Smi-StrictEquals-False"},
-            {"name": "Number-StrictEquals-True"},
-            {"name": "Number-StrictEquals-False"},
-            {"name": "String-StrictEquals-True"},
-            {"name": "String-StrictEquals-False"},
-            {"name": "SmiString-StrictEquals"},
-            {"name": "Smi-Equals-True"},
-            {"name": "Smi-Equals-False"},
-            {"name": "Number-Equals-True"},
-            {"name": "Number-Equals-False"},
-            {"name": "String-Equals-True"},
-            {"name": "String-Equals-False"},
-            {"name": "ObjectNull-Equals"},
-            {"name": "SmiString-Equals"},
-            {"name": "Smi-RelationalCompare"},
-            {"name": "Number-RelationalCompare"},
-            {"name": "String-RelationalCompare"},
-            {"name": "SmiString-RelationalCompare"}
-          ]
-        },
-        {
-          "name": "StringConcat",
-          "main": "run.js",
-          "resources": [ "string-concat.js" ],
-          "test_flags": [ "string-concat" ],
-          "results_regexp": "^%s\\-BytecodeHandler\\(Score\\): (.+)$",
-          "tests": [
-            {"name": "ShortString-StringConcat-2"},
-            {"name": "ShortString-StringConcat-3"},
-            {"name": "ShortString-StringConcat-5"},
-            {"name": "ShortString-StringConcat-10"},
-            {"name": "LongString-StringConcat-2"},
-            {"name": "LongString-StringConcat-3"},
-            {"name": "LongString-StringConcat-5"},
-            {"name": "LongString-StringConcat-10"},
-            {"name": "NumberString-StringConcat-2"},
-            {"name": "NumberString-StringConcat-3"},
-            {"name": "NumberString-StringConcat-5"},
-            {"name": "NumberString-StringConcat-10"}
-          ]
-        },
-        {
-          "name": "Arithmetic",
-          "main": "run.js",
-          "resources": [ "arithmetic.js" ],
-          "test_flags": [ "arithmetic" ],
-          "results_regexp": "^%s\\-BytecodeHandler\\(Score\\): (.+)$",
-          "timeout": 240,
-          "tests": [
-            {"name": "Smi-Add"},
-            {"name": "Number-Add"},
-            {"name": "Number-Oddball-Add"},
-            {"name": "String-Add"},
-            {"name": "Object-Add"},
-            {"name": "Number-String-Add"},
-            {"name": "Smi-Sub"},
-            {"name": "Number-Sub"},
-            {"name": "Number-Oddball-Sub"},
-            {"name": "Object-Sub"},
-            {"name": "Smi-Mul"},
-            {"name": "Number-Mul"},
-            {"name": "Number-Oddball-Mul"},
-            {"name": "Object-Mul"},
-            {"name": "Smi-Div"},
-            {"name": "Number-Div"},
-            {"name": "Number-Oddball-Div"},
-            {"name": "Object-Div"},
-            {"name": "Smi-Mod"},
-            {"name": "Number-Mod"},
-            {"name": "Number-Oddball-Mod"},
-            {"name": "Object-Mod"},
-            {"name": "Smi-Constant-Add"},
-            {"name": "Smi-Constant-Sub"},
-            {"name": "Smi-Constant-Mul"},
-            {"name": "Smi-Constant-Div"},
-            {"name": "Smi-Constant-Mod"},
-            {"name": "Smi-Increment"},
-            {"name": "Number-Increment"},
-            {"name": "Smi-Decrement"},
-            {"name": "Number-Decrement"}
-          ]
-        },
-        {
-          "name": "Bitwise",
-          "main": "run.js",
-          "resources": [ "bitwise.js" ],
-          "test_flags": [ "bitwise" ],
-          "results_regexp": "^%s\\-BytecodeHandler\\(Score\\): (.+)$",
-          "tests": [
-            {"name": "Smi-Or"},
-            {"name": "Number-Or"},
-            {"name": "Smi-Xor"},
-            {"name": "Number-Xor"},
-            {"name": "Smi-And"},
-            {"name": "Number-And"},
-            {"name": "Smi-Constant-Or"},
-            {"name": "Smi-Constant-Xor"},
-            {"name": "Smi-Constant-And"},
-            {"name": "Smi-ShiftLeft"},
-            {"name": "Number-ShiftLeft"},
-            {"name": "Smi-ShiftRight"},
-            {"name": "Number-ShiftRight"},
-            {"name": "Smi-ShiftRightLogical"},
-            {"name": "Number-ShiftRightLogical"},
-            {"name": "Smi-Constant-ShiftLeft"},
-            {"name": "Smi-Constant-ShiftRight"},
-            {"name": "Smi-Constant-ShiftRightLogical"}
-          ]
-        }
-      ]
-    },
-    {
-      "name": "ExpressionDepth",
-      "path": ["ExpressionDepth"],
-      "main": "run.js",
-      "flags": [ "--no-opt" ],
-      "results_regexp": "^%s\\-ExpressionDepth\\(Score\\): (.+)$",
-      "tests": [
-        {"name": "Or-Value"},
-        {"name": "Or-Test"},
-        {"name": "And-Value"},
-        {"name": "And-Test"},
-        {"name": "Comma-Value"},
-        {"name": "Comma-Test"},
-        {"name": "Equals-Value"},
-        {"name": "Equals-Test"},
-        {"name": "StrictEquals-Value"},
-        {"name": "StrictEquals-Test"},
-        {"name": "GreaterThan-Value"},
-        {"name": "GreaterThan-Test"},
-        {"name": "Add"},
-        {"name": "Sub"},
-        {"name": "StringConcat"},
-        {"name": "BitwiseOr"}
-      ]
-    },
-    {
-      "name": "Inspector",
-      "path": ["Inspector"],
-      "main": "run.js",
-      "resources": [ "debugger.js", "runtime.js" ],
-      "flags": ["--enable-inspector","--allow-natives-syntax"],
-      "results_regexp": "^%s\\-Inspector\\(Score\\): (.+)$",
-      "tests": [
-        {"name": "Debugger.paused"},
-        {"name": "Runtime.evaluate(String16Cstor)"},
-        {"name": "Debugger.getPossibleBreakpoints"},
-        {"name": "AsyncStacksInstrumentation"}
-      ]
-    },
-    {
-      "name": "Parsing",
-      "path": ["Parsing"],
-      "main": "run.js",
-      "flags": ["--no-compilation-cache", "--allow-natives-syntax"],
-      "resources": [ "comments.js"],
-      "results_regexp": "^%s\\-Parsing\\(Score\\): (.+)$",
-      "tests": [
-        {"name": "OneLineComment"},
-        {"name": "OneLineComments"},
-        {"name": "MultiLineComment"}
-      ]
-    }
-  ]
-}
diff --git a/src/v8/test/message/fail/export-duplicate-as.js b/src/v8/test/message/fail/export-duplicate-as.js
deleted file mode 100644
index 416180b..0000000
--- a/src/v8/test/message/fail/export-duplicate-as.js
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-var a, b, c;
-export { a as c };
-export { a, b as c, c, b };
diff --git a/src/v8/test/message/fail/export-duplicate-default.js b/src/v8/test/message/fail/export-duplicate-default.js
deleted file mode 100644
index de1a880..0000000
--- a/src/v8/test/message/fail/export-duplicate-default.js
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-export default function f() {};
-export default 42;
-export default class C {};
diff --git a/src/v8/test/message/fail/export-duplicate.js b/src/v8/test/message/fail/export-duplicate.js
deleted file mode 100644
index 93011f0..0000000
--- a/src/v8/test/message/fail/export-duplicate.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-var a, b, c;
-export { a };
-export { a, b };
-export { b, c };
diff --git a/src/v8/test/message/fail/function-sent-escaped.js b/src/v8/test/message/fail/function-sent-escaped.js
deleted file mode 100644
index aa17258..0000000
--- a/src/v8/test/message/fail/function-sent-escaped.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// Flags: --harmony-function-sent
-
-function* f() {
-  return function.s\u0065nt;
-}
-for (var i of f()) print(i);
diff --git a/src/v8/test/message/fail/function-sent-escaped.out b/src/v8/test/message/fail/function-sent-escaped.out
deleted file mode 100644
index d9613d8..0000000
--- a/src/v8/test/message/fail/function-sent-escaped.out
+++ /dev/null
@@ -1,4 +0,0 @@
-*%(basename)s:8: SyntaxError: 'function.sent' must not contain escaped characters
-  return function.s\u0065nt;
-         ^^^^^^^^^^^^^^^^^^
-SyntaxError: 'function.sent' must not contain escaped characters
diff --git a/src/v8/test/message/fail/import-as-eval.js b/src/v8/test/message/fail/import-as-eval.js
deleted file mode 100644
index 66adc32..0000000
--- a/src/v8/test/message/fail/import-as-eval.js
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import { foo as eval } from "mod";
diff --git a/src/v8/test/message/fail/import-as-redeclaration.js b/src/v8/test/message/fail/import-as-redeclaration.js
deleted file mode 100644
index 43bf278..0000000
--- a/src/v8/test/message/fail/import-as-redeclaration.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-let foo = 42;
-import { bar as foo } from "mod";
diff --git a/src/v8/test/message/fail/import-as-reserved-word.js b/src/v8/test/message/fail/import-as-reserved-word.js
deleted file mode 100644
index 562699d..0000000
--- a/src/v8/test/message/fail/import-as-reserved-word.js
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import { foo as import } from "mod";
diff --git a/src/v8/test/message/fail/import-eval.js b/src/v8/test/message/fail/import-eval.js
deleted file mode 100644
index 8ab35ba..0000000
--- a/src/v8/test/message/fail/import-eval.js
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import { eval } from "mod";
diff --git a/src/v8/test/message/fail/import-redeclaration.js b/src/v8/test/message/fail/import-redeclaration.js
deleted file mode 100644
index 27b0cdc..0000000
--- a/src/v8/test/message/fail/import-redeclaration.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-let foo = 42;
-import { foo } from "mod";
diff --git a/src/v8/test/message/fail/import-reserved-word.js b/src/v8/test/message/fail/import-reserved-word.js
deleted file mode 100644
index 1fd7ba2..0000000
--- a/src/v8/test/message/fail/import-reserved-word.js
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import { import } from "mod";
diff --git a/src/v8/test/message/fail/isvar.js b/src/v8/test/message/fail/isvar.js
deleted file mode 100644
index fedf9d5..0000000
--- a/src/v8/test/message/fail/isvar.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2008 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.
-
-// Flags: --allow-natives-syntax
-var x;
-%IS_VAR(x);
-%IS_VAR(x+x);
diff --git a/src/v8/test/message/fail/isvar.out b/src/v8/test/message/fail/isvar.out
deleted file mode 100644
index 6d5cca3..0000000
--- a/src/v8/test/message/fail/isvar.out
+++ /dev/null
@@ -1,4 +0,0 @@
-*%(basename)s:31: SyntaxError: builtin %%IS_VAR: not a variable
-%%IS_VAR(x+x);
-           ^
-SyntaxError: builtin %%IS_VAR: not a variable
diff --git a/src/v8/test/message/fail/modules-cycle1.js b/src/v8/test/message/fail/modules-cycle1.js
deleted file mode 100644
index e3497ca..0000000
--- a/src/v8/test/message/fail/modules-cycle1.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {a} from "modules-cycle1.js";
-export {a};
diff --git a/src/v8/test/message/fail/modules-cycle2.js b/src/v8/test/message/fail/modules-cycle2.js
deleted file mode 100644
index 1121c30..0000000
--- a/src/v8/test/message/fail/modules-cycle2.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {a} from "modules-skip-cycle2.js";
-export {a as b};
diff --git a/src/v8/test/message/fail/modules-cycle3.js b/src/v8/test/message/fail/modules-cycle3.js
deleted file mode 100644
index 133d203..0000000
--- a/src/v8/test/message/fail/modules-cycle3.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-export {a as x} from "modules-skip-cycle3.js";
-export {b as y} from "modules-skip-cycle3.js";
diff --git a/src/v8/test/message/fail/modules-cycle4.js b/src/v8/test/message/fail/modules-cycle4.js
deleted file mode 100644
index 2e22757..0000000
--- a/src/v8/test/message/fail/modules-cycle4.js
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {x} from "modules-cycle3.js";
diff --git a/src/v8/test/message/fail/modules-cycle5.js b/src/v8/test/message/fail/modules-cycle5.js
deleted file mode 100644
index 53382da..0000000
--- a/src/v8/test/message/fail/modules-cycle5.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import "modules-skip-cycle5.js";
-export {foo} from "modules-cycle5.js";
diff --git a/src/v8/test/message/fail/modules-cycle6.js b/src/v8/test/message/fail/modules-cycle6.js
deleted file mode 100644
index 3043e1d..0000000
--- a/src/v8/test/message/fail/modules-cycle6.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import "modules-skip-cycle6.js";
-export * from "modules-cycle6.js";
diff --git a/src/v8/test/message/fail/modules-duplicate-export1.js b/src/v8/test/message/fail/modules-duplicate-export1.js
deleted file mode 100644
index 0ba421a..0000000
--- a/src/v8/test/message/fail/modules-duplicate-export1.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-export {x};
-export let x = 42;
diff --git a/src/v8/test/message/fail/modules-duplicate-export2.js b/src/v8/test/message/fail/modules-duplicate-export2.js
deleted file mode 100644
index 3aec862..0000000
--- a/src/v8/test/message/fail/modules-duplicate-export2.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-export let x = 42;
-export {x};
diff --git a/src/v8/test/message/fail/modules-duplicate-export3.js b/src/v8/test/message/fail/modules-duplicate-export3.js
deleted file mode 100644
index 36fc27b..0000000
--- a/src/v8/test/message/fail/modules-duplicate-export3.js
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-export let x = 42;
-let y;
-export {y as x};
diff --git a/src/v8/test/message/fail/modules-duplicate-export4.js b/src/v8/test/message/fail/modules-duplicate-export4.js
deleted file mode 100644
index 1bc60da..0000000
--- a/src/v8/test/message/fail/modules-duplicate-export4.js
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-export let x = 42;
-let y;
-export {y as z, y as x, y};
diff --git a/src/v8/test/message/fail/modules-import-redeclare1.js b/src/v8/test/message/fail/modules-import-redeclare1.js
deleted file mode 100644
index 22e1ce3..0000000
--- a/src/v8/test/message/fail/modules-import-redeclare1.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-export let x = 42;
-import {x} from "modules-import-redeclare1.js";
diff --git a/src/v8/test/message/fail/modules-import-redeclare2.js b/src/v8/test/message/fail/modules-import-redeclare2.js
deleted file mode 100644
index af7ec2b..0000000
--- a/src/v8/test/message/fail/modules-import-redeclare2.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-export let x = 42;
-import {y, x, z} from "modules-import-redeclare1.js";
diff --git a/src/v8/test/message/fail/modules-import-redeclare3.js b/src/v8/test/message/fail/modules-import-redeclare3.js
deleted file mode 100644
index 60ae6f2..0000000
--- a/src/v8/test/message/fail/modules-import-redeclare3.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {y, x, z} from "modules-import-redeclare1.js";
-export let x = 42;
diff --git a/src/v8/test/message/fail/modules-import1.js b/src/v8/test/message/fail/modules-import1.js
deleted file mode 100644
index fbfe907..0000000
--- a/src/v8/test/message/fail/modules-import1.js
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {a} from "modules-import1.js";
diff --git a/src/v8/test/message/fail/modules-import2.js b/src/v8/test/message/fail/modules-import2.js
deleted file mode 100644
index 8a719ac..0000000
--- a/src/v8/test/message/fail/modules-import2.js
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {a as b} from "modules-import2.js";
diff --git a/src/v8/test/message/fail/modules-import3.js b/src/v8/test/message/fail/modules-import3.js
deleted file mode 100644
index 7e93ff3..0000000
--- a/src/v8/test/message/fail/modules-import3.js
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import foo from "modules-import3.js";
diff --git a/src/v8/test/message/fail/modules-import4.js b/src/v8/test/message/fail/modules-import4.js
deleted file mode 100644
index 0410e38..0000000
--- a/src/v8/test/message/fail/modules-import4.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {a as b} from "modules-import4.js";
-export {c as a} from "modules-import4.js";
diff --git a/src/v8/test/message/fail/modules-import5.js b/src/v8/test/message/fail/modules-import5.js
deleted file mode 100644
index d4cb655..0000000
--- a/src/v8/test/message/fail/modules-import5.js
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {a as b} from "modules-import5.js";
-export {c as a} from "modules-import5.js";
-import {c} from "modules-import5.js";
diff --git a/src/v8/test/message/fail/modules-import6.js b/src/v8/test/message/fail/modules-import6.js
deleted file mode 100644
index f625a34..0000000
--- a/src/v8/test/message/fail/modules-import6.js
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {a as b} from "modules-import6.js";
-export {c as a};
-import {c} from "modules-import6.js";
diff --git a/src/v8/test/message/fail/modules-skip-cycle2.js b/src/v8/test/message/fail/modules-skip-cycle2.js
deleted file mode 100644
index 8b5ea93..0000000
--- a/src/v8/test/message/fail/modules-skip-cycle2.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export {b as a} from "modules-cycle2.js";
diff --git a/src/v8/test/message/fail/modules-skip-cycle3.js b/src/v8/test/message/fail/modules-skip-cycle3.js
deleted file mode 100644
index a63a660..0000000
--- a/src/v8/test/message/fail/modules-skip-cycle3.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export {y as a} from "modules-cycle3.js";
-export {x as b} from "modules-cycle3.js";
diff --git a/src/v8/test/message/fail/modules-skip-cycle5.js b/src/v8/test/message/fail/modules-skip-cycle5.js
deleted file mode 100644
index 6eee474..0000000
--- a/src/v8/test/message/fail/modules-skip-cycle5.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export {foo} from "modules-cycle5.js";
diff --git a/src/v8/test/message/fail/modules-skip-cycle6.js b/src/v8/test/message/fail/modules-skip-cycle6.js
deleted file mode 100644
index c27c302..0000000
--- a/src/v8/test/message/fail/modules-skip-cycle6.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export {foo} from "modules-cycle6.js";
diff --git a/src/v8/test/message/fail/modules-star-conflict1.js b/src/v8/test/message/fail/modules-star-conflict1.js
deleted file mode 100644
index 4281f7c..0000000
--- a/src/v8/test/message/fail/modules-star-conflict1.js
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {a} from "../../mjsunit/modules-skip-7.js";
diff --git a/src/v8/test/message/fail/modules-star-conflict2.js b/src/v8/test/message/fail/modules-star-conflict2.js
deleted file mode 100644
index 6235851..0000000
--- a/src/v8/test/message/fail/modules-star-conflict2.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-export * from "../../mjsunit/modules-skip-star-exports-conflict.js";
-export * from "../../mjsunit/modules-skip-6.js";
-
-import {a} from "modules-star-conflict2.js";
diff --git a/src/v8/test/message/fail/modules-star-default.js b/src/v8/test/message/fail/modules-star-default.js
deleted file mode 100644
index 30bc8f2..0000000
--- a/src/v8/test/message/fail/modules-star-default.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-// Star exports do not propagate a default export.
-import a from "modules-import4.js";
diff --git a/src/v8/test/message/fail/modules-undefined-export1.js b/src/v8/test/message/fail/modules-undefined-export1.js
deleted file mode 100644
index ddedbaa..0000000
--- a/src/v8/test/message/fail/modules-undefined-export1.js
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-export {x};
diff --git a/src/v8/test/message/fail/modules-undefined-export2.js b/src/v8/test/message/fail/modules-undefined-export2.js
deleted file mode 100644
index bf8c2a0..0000000
--- a/src/v8/test/message/fail/modules-undefined-export2.js
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-export {x as y};
diff --git a/src/v8/test/message/message.gyp b/src/v8/test/message/message.gyp
deleted file mode 100644
index fc1ae32..0000000
--- a/src/v8/test/message/message.gyp
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'conditions': [
-    ['test_isolation_mode != "noop"', {
-      'targets': [
-        {
-          'target_name': 'message_run',
-          'type': 'none',
-          'dependencies': [
-            '../../src/d8.gyp:d8_run',
-          ],
-          'includes': [
-            '../../gypfiles/features.gypi',
-            '../../gypfiles/isolate.gypi',
-          ],
-          'sources': [
-            'message.isolate',
-          ],
-        },
-      ],
-    }],
-  ],
-}
diff --git a/src/v8/test/message/message.isolate b/src/v8/test/message/message.isolate
deleted file mode 100644
index dbeca5e..0000000
--- a/src/v8/test/message/message.isolate
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'variables': {
-    'files': [
-      './',
-    ],
-  },
-  'includes': [
-    '../../src/d8.isolate',
-    '../../tools/testrunner/testrunner.isolate',
-  ],
-}
\ No newline at end of file
diff --git a/src/v8/test/mjsunit/compiler/constructor-inlining-no-harmony-restrict-constructor-return.js b/src/v8/test/mjsunit/compiler/constructor-inlining-no-harmony-restrict-constructor-return.js
deleted file mode 100644
index 50d15eb..0000000
--- a/src/v8/test/mjsunit/compiler/constructor-inlining-no-harmony-restrict-constructor-return.js
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --no-harmony-restrict-constructor-return
-
-this.FLAG_harmony_restrict_constructor_return = false;
-try {
-  load('mjsunit/compiler/constructor-inlining.js');
-} catch(e) {
-  load('test/mjsunit/compiler/constructor-inlining.js');
-}
diff --git a/src/v8/test/mjsunit/deserialize-script-id.js b/src/v8/test/mjsunit/deserialize-script-id.js
deleted file mode 100644
index 5dca9f3..0000000
--- a/src/v8/test/mjsunit/deserialize-script-id.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --cache=code
-// Test that script ids are unique and we found the correct ones.
-
-var Debug = %GetDebugContext().Debug;
-Debug.setListener(function(){});
-
-var scripts = %DebugGetLoadedScripts();
-scripts.sort(function(a, b) { return a.id - b.id; });
-scripts.reduce(function(prev, cur) {
-  assertTrue(prev === undefined || prev.id != cur.id);
-});
-
-Debug.setListener(null);
diff --git a/src/v8/test/mjsunit/es6/classof-proxy.js b/src/v8/test/mjsunit/es6/classof-proxy.js
deleted file mode 100644
index 0204361..0000000
--- a/src/v8/test/mjsunit/es6/classof-proxy.js
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax
-
-function test_function(o) {
-  if (%_ClassOf(o) === "Function") {
-    return true;
-  } else {
-    return false;
-  }
-}
-
-var non_callable = new Proxy({}, {});
-var callable = new Proxy(function(){}.__proto__, {});
-var constructable = new Proxy(function(){}, {});
-
-assertFalse(test_function(non_callable));
-assertTrue(test_function(callable));
-assertTrue(test_function(constructable));
-
-%OptimizeFunctionOnNextCall(test_function);
-
-assertFalse(test_function(non_callable));
-assertTrue(test_function(callable));
-assertTrue(test_function(constructable));
diff --git a/src/v8/test/mjsunit/es6/spread-array.js b/src/v8/test/mjsunit/es6/spread-array.js
deleted file mode 100644
index d112422..0000000
--- a/src/v8/test/mjsunit/es6/spread-array.js
+++ /dev/null
@@ -1,179 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax
-
-(function TestBasics() {
-  var a = [1, 2];
-  var b = [...a];
-  assertArrayEquals([1, 2], b)
-
-  assertArrayEquals(['a', 'b', 'c', 'd', 'e', 'f'],
-                    ['a', ...'bc', 'd', ...'ef'])
-})();
-
-
-var log = [];
-
-function* gen(n) {
-  log.push(n, 1);
-  yield 1;
-  log.push(n, 2);
-  yield 2;
-  log.push(n, 3);
-  yield 3;
-  log.push(n, 'done');
-}
-
-function id(v) {
-  log.push(v);
-  return v;
-}
-
-
-(function TestGenerator() {
-  assertArrayEquals([1, 2, 3], [...gen('a')]);
-  assertArrayEquals(['x', 1, 2, 3, 'y', 1, 2, 3, 'z'],
-                    ['x', ...gen('a'), 'y', ...gen('b'), 'z']);
-})();
-
-
-(function TestOrderOfExecution() {
-  log = [];
-  assertArrayEquals(['x', 1, 2, 3, 'y', 1, 2, 3, 'z'],
-                    [id('x'), ...gen('a'), id('y'), ...gen('b'), id('z')]);
-  assertArrayEquals([
-    'x', 'a', 1, 'a', 2, 'a', 3, 'a', 'done',
-    'y', 'b', 1, 'b', 2, 'b', 3, 'b', 'done',
-    'z'
-  ], log);
-})();
-
-
-(function TestNotIterable() {
-  var a;
-  assertThrows(function() {
-    a = [...42];
-  }, TypeError);
-  assertSame(undefined, a);
-
-
-})();
-
-
-(function TestInvalidIterator() {
-  var iter = {
-    [Symbol.iterator]: 42
-  };
-  var a;
-  assertThrows(function() {
-    a = [...iter];
-  }, TypeError);
-  assertSame(undefined, a);
-})();
-
-
-(function TestIteratorNotAnObject() {
-  var iter = {
-    [Symbol.iterator]() {
-      return 42;
-    }
-  };
-  var a;
-  assertThrows(function() {
-    a = [...iter];
-  }, TypeError);
-  assertSame(undefined, a);
-})();
-
-
-(function TestIteratorNoNext() {
-  var iter = {
-    [Symbol.iterator]() {
-      return {};
-    }
-  };
-  var a;
-  assertThrows(function() {
-    a = [...iter];
-  }, TypeError);
-  assertSame(undefined, a);
-})();
-
-
-(function TestIteratorResultDoneThrows() {
-  function MyError() {}
-  var iter = {
-    [Symbol.iterator]() {
-      return {
-        next() {
-          return {
-            get done() {
-              throw new MyError();
-            }
-          }
-        }
-      };
-    }
-  };
-  var a;
-  assertThrows(function() {
-    a = [...iter];
-  }, MyError);
-  assertSame(undefined, a);
-})();
-
-
-(function TestIteratorResultValueThrows() {
-  function MyError() {}
-  var iter = {
-    [Symbol.iterator]() {
-      return {
-        next() {
-          return {
-            done: false,
-            get value() {
-              throw new MyError();
-            }
-          }
-        }
-      };
-    }
-  };
-  var a;
-  assertThrows(function() {
-    a = [...iter];
-  }, MyError);
-  assertSame(undefined, a);
-})();
-
-
-(function TestOptimize() {
-  function f() {
-    return [...'abc'];
-  }
-  assertArrayEquals(['a', 'b', 'c'], f());
-  %OptimizeFunctionOnNextCall(f);
-  assertArrayEquals(['a', 'b', 'c'], f());
-})();
-
-
-(function TestDeoptimize() {
-  var iter = {
-    [Symbol.iterator]() {
-      var i = 0;
-      return {
-        next() {
-          $DeoptimizeFunction(f);
-          return {value: ++i, done: i === 3};
-        }
-      };
-    }
-  };
-  function f() {
-    return [0, ...iter];
-  }
-
-  assertArrayEquals([0, 1, 2], f());
-});
diff --git a/src/v8/test/mjsunit/es6/typedarray-neutered.js b/src/v8/test/mjsunit/es6/typedarray-neutered.js
deleted file mode 100644
index f272f4f..0000000
--- a/src/v8/test/mjsunit/es6/typedarray-neutered.js
+++ /dev/null
@@ -1,781 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax
-
-// Disable the neutering protector.
-%ArrayBufferNeuter(new ArrayBuffer(1024));
-
-// ArrayBuffer
-
-function TestByteLength(param, expectedByteLength) {
-  var ab = new ArrayBuffer(param);
-  assertSame(expectedByteLength, ab.byteLength);
-}
-
-function TestArrayBufferCreation() {
-  TestByteLength(1, 1);
-  TestByteLength(256, 256);
-  TestByteLength(2.567, 2);
-
-  TestByteLength("abc", 0);
-
-  TestByteLength(0, 0);
-
-  assertThrows(function() { new ArrayBuffer(-10); }, RangeError);
-  assertThrows(function() { new ArrayBuffer(-2.567); }, RangeError);
-
-/* TODO[dslomov]: Reenable the test
-  assertThrows(function() {
-    var ab1 = new ArrayBuffer(0xFFFFFFFFFFFF)
-  }, RangeError);
-*/
-
-  var ab = new ArrayBuffer();
-  assertSame(0, ab.byteLength);
-  assertEquals("[object ArrayBuffer]",
-      Object.prototype.toString.call(ab));
-}
-
-TestArrayBufferCreation();
-
-function TestByteLengthNotWritable() {
-  var ab = new ArrayBuffer(1024);
-  assertSame(1024, ab.byteLength);
-
-  assertThrows(function() { "use strict"; ab.byteLength = 42; }, TypeError);
-}
-
-TestByteLengthNotWritable();
-
-function TestSlice(expectedResultLen, initialLen, start, end) {
-  var ab = new ArrayBuffer(initialLen);
-  var a1 = new Uint8Array(ab);
-  for (var i = 0; i < a1.length; i++) {
-    a1[i] = 0xCA;
-  }
-  var slice = ab.slice(start, end);
-  assertSame(expectedResultLen, slice.byteLength);
-  var a2 = new Uint8Array(slice);
-  for (var i = 0; i < a2.length; i++) {
-    assertSame(0xCA, a2[i]);
-  }
-}
-
-function TestArrayBufferSlice() {
-  var ab = new ArrayBuffer(1024);
-  var ab1 = ab.slice(512, 1024);
-  assertSame(512, ab1.byteLength);
-
-  TestSlice(512, 1024, 512, 1024);
-  TestSlice(512, 1024, 512);
-
-  TestSlice(0, 0, 1, 20);
-  TestSlice(100, 100, 0, 100);
-  TestSlice(100, 100, 0, 1000);
-
-  TestSlice(0, 100, 5, 1);
-
-  TestSlice(1, 100, -11, -10);
-  TestSlice(9, 100, -10, 99);
-  TestSlice(0, 100, -10, 80);
-  TestSlice(10, 100, 80, -10);
-
-  TestSlice(10, 100, 90, "100");
-  TestSlice(10, 100, "90", "100");
-
-  TestSlice(0,  100, 90, "abc");
-  TestSlice(10, 100, "abc", 10);
-
-  TestSlice(10, 100, 0.96, 10.96);
-  TestSlice(10, 100, 0.96, 10.01);
-  TestSlice(10, 100, 0.01, 10.01);
-  TestSlice(10, 100, 0.01, 10.96);
-
-  TestSlice(10, 100, 90);
-  TestSlice(10, 100, -10);
-}
-
-TestArrayBufferSlice();
-
-// Typed arrays
-
-function TestTypedArray(constr, elementSize, typicalElement) {
-  assertSame(elementSize, constr.BYTES_PER_ELEMENT);
-
-  var ab = new ArrayBuffer(256*elementSize);
-
-  var a0 = new constr(30);
-  assertEquals("[object " + constr.name + "]",
-      Object.prototype.toString.call(a0));
-
-  assertTrue(ArrayBuffer.isView(a0));
-  assertSame(elementSize, a0.BYTES_PER_ELEMENT);
-  assertSame(30, a0.length);
-  assertSame(30*elementSize, a0.byteLength);
-  assertSame(0, a0.byteOffset);
-  assertSame(30*elementSize, a0.buffer.byteLength);
-
-  var aLen0 = new constr(0);
-  assertSame(elementSize, aLen0.BYTES_PER_ELEMENT);
-  assertSame(0, aLen0.length);
-  assertSame(0, aLen0.byteLength);
-  assertSame(0, aLen0.byteOffset);
-  assertSame(0, aLen0.buffer.byteLength);
-
-  var aOverBufferLen0 = new constr(ab, 128*elementSize, 0);
-  assertSame(ab, aOverBufferLen0.buffer);
-  assertSame(elementSize, aOverBufferLen0.BYTES_PER_ELEMENT);
-  assertSame(0, aOverBufferLen0.length);
-  assertSame(0, aOverBufferLen0.byteLength);
-  assertSame(128*elementSize, aOverBufferLen0.byteOffset);
-
-  var a1 = new constr(ab, 128*elementSize, 128);
-  assertSame(ab, a1.buffer);
-  assertSame(elementSize, a1.BYTES_PER_ELEMENT);
-  assertSame(128, a1.length);
-  assertSame(128*elementSize, a1.byteLength);
-  assertSame(128*elementSize, a1.byteOffset);
-
-
-  var a2 = new constr(ab, 64*elementSize, 128);
-  assertSame(ab, a2.buffer);
-  assertSame(elementSize, a2.BYTES_PER_ELEMENT);
-  assertSame(128, a2.length);
-  assertSame(128*elementSize, a2.byteLength);
-  assertSame(64*elementSize, a2.byteOffset);
-
-  var a3 = new constr(ab, 192*elementSize);
-  assertSame(ab, a3.buffer);
-  assertSame(64, a3.length);
-  assertSame(64*elementSize, a3.byteLength);
-  assertSame(192*elementSize, a3.byteOffset);
-
-  var a4 = new constr(ab);
-  assertSame(ab, a4.buffer);
-  assertSame(256, a4.length);
-  assertSame(256*elementSize, a4.byteLength);
-  assertSame(0, a4.byteOffset);
-
-
-  var i;
-  for (i = 0; i < 128; i++) {
-    a1[i] = typicalElement;
-  }
-
-  for (i = 0; i < 128; i++) {
-    assertSame(typicalElement, a1[i]);
-  }
-
-  for (i = 0; i < 64; i++) {
-    assertSame(0, a2[i]);
-  }
-
-  for (i = 64; i < 128; i++) {
-    assertSame(typicalElement, a2[i]);
-  }
-
-  for (i = 0; i < 64; i++) {
-    assertSame(typicalElement, a3[i]);
-  }
-
-  for (i = 0; i < 128; i++) {
-    assertSame(0, a4[i]);
-  }
-
-  for (i = 128; i < 256; i++) {
-    assertSame(typicalElement, a4[i]);
-  }
-
-  var aAtTheEnd = new constr(ab, 256*elementSize);
-  assertSame(elementSize, aAtTheEnd.BYTES_PER_ELEMENT);
-  assertSame(0, aAtTheEnd.length);
-  assertSame(0, aAtTheEnd.byteLength);
-  assertSame(256*elementSize, aAtTheEnd.byteOffset);
-
-  assertThrows(function () { new constr(ab, 257*elementSize); }, RangeError);
-  assertThrows(
-      function () { new constr(ab, 128*elementSize, 192); },
-      RangeError);
-
-  if (elementSize !== 1) {
-    assertThrows(function() { new constr(ab, 128*elementSize - 1, 10); },
-                 RangeError);
-    var unalignedArrayBuffer = new ArrayBuffer(10*elementSize + 1);
-    var goodArray = new constr(unalignedArrayBuffer, 0, 10);
-    assertSame(10, goodArray.length);
-    assertSame(10*elementSize, goodArray.byteLength);
-    assertThrows(function() { new constr(unalignedArrayBuffer)}, RangeError);
-    assertThrows(function() { new constr(unalignedArrayBuffer, 5*elementSize)},
-                 RangeError);
-  }
-
-  var aFromUndef = new constr();
-  assertSame(elementSize, aFromUndef.BYTES_PER_ELEMENT);
-  assertSame(0, aFromUndef.length);
-  assertSame(0*elementSize, aFromUndef.byteLength);
-  assertSame(0, aFromUndef.byteOffset);
-  assertSame(0*elementSize, aFromUndef.buffer.byteLength);
-
-  var aFromNull = new constr(null);
-  assertSame(elementSize, aFromNull.BYTES_PER_ELEMENT);
-  assertSame(0, aFromNull.length);
-  assertSame(0*elementSize, aFromNull.byteLength);
-  assertSame(0, aFromNull.byteOffset);
-  assertSame(0*elementSize, aFromNull.buffer.byteLength);
-
-  var aFromBool = new constr(true);
-  assertSame(elementSize, aFromBool.BYTES_PER_ELEMENT);
-  assertSame(1, aFromBool.length);
-  assertSame(1*elementSize, aFromBool.byteLength);
-  assertSame(0, aFromBool.byteOffset);
-  assertSame(1*elementSize, aFromBool.buffer.byteLength);
-
-  var aFromString = new constr("30");
-  assertSame(elementSize, aFromString.BYTES_PER_ELEMENT);
-  assertSame(30, aFromString.length);
-  assertSame(30*elementSize, aFromString.byteLength);
-  assertSame(0, aFromString.byteOffset);
-  assertSame(30*elementSize, aFromString.buffer.byteLength);
-
-  assertThrows(function() { new constr(Symbol()); }, TypeError);
-
-  var jsArray = [];
-  for (i = 0; i < 30; i++) {
-    jsArray.push(typicalElement);
-  }
-  var aFromArray = new constr(jsArray);
-  assertSame(elementSize, aFromArray.BYTES_PER_ELEMENT);
-  assertSame(30, aFromArray.length);
-  assertSame(30*elementSize, aFromArray.byteLength);
-  assertSame(0, aFromArray.byteOffset);
-  assertSame(30*elementSize, aFromArray.buffer.byteLength);
-  for (i = 0; i < 30; i++) {
-    assertSame(typicalElement, aFromArray[i]);
-  }
-
-  var abLen0 = new ArrayBuffer(0);
-  var aOverAbLen0 = new constr(abLen0);
-  assertSame(abLen0, aOverAbLen0.buffer);
-  assertSame(elementSize, aOverAbLen0.BYTES_PER_ELEMENT);
-  assertSame(0, aOverAbLen0.length);
-  assertSame(0, aOverAbLen0.byteLength);
-  assertSame(0, aOverAbLen0.byteOffset);
-
-  var aNoParam = new constr();
-  assertSame(elementSize, aNoParam.BYTES_PER_ELEMENT);
-  assertSame(0, aNoParam.length);
-  assertSame(0, aNoParam.byteLength);
-  assertSame(0, aNoParam.byteOffset);
-
-  var a = new constr(ab, 64*elementSize, 128);
-  assertEquals("[object " + constr.name + "]",
-      Object.prototype.toString.call(a));
-  var desc = Object.getOwnPropertyDescriptor(
-      constr.prototype.__proto__, Symbol.toStringTag);
-  assertTrue(desc.configurable);
-  assertFalse(desc.enumerable);
-  assertFalse(!!desc.writable);
-  assertFalse(!!desc.set);
-  assertEquals("function", typeof desc.get);
-
-  // Test that the constructor can be called with an iterable
-  function* gen() { for (var i = 0; i < 10; i++) yield i; }
-  var genArr = new constr(gen());
-  assertEquals(10, genArr.length);
-  assertEquals(0, genArr[0]);
-  assertEquals(9, genArr[9]);
-  // Arrays can be converted to TypedArrays
-  genArr = new constr([1, 2, 3]);
-  assertEquals(3, genArr.length);
-  assertEquals(1, genArr[0]);
-  assertEquals(3, genArr[2]);
-  // Redefining Array.prototype[Symbol.iterator] still works
-  var arrayIterator = Array.prototype[Symbol.iterator];
-  Array.prototype[Symbol.iterator] = gen;
-  genArr = new constr([1, 2, 3]);
-  assertEquals(10, genArr.length);
-  assertEquals(0, genArr[0]);
-  assertEquals(9, genArr[9]);
-  Array.prototype[Symbol.iterator] = arrayIterator;
-  // Other array-like things can be made into a TypedArray
-  var myObject = { 0: 5, 1: 6, length: 2 };
-  genArr = new constr(myObject);
-  assertEquals(2, genArr.length);
-  assertEquals(5, genArr[0]);
-  assertEquals(6, genArr[1]);
-  // Iterator takes precedence over array-like, and the property
-  // is read only once.
-  var iteratorReadCount = 0;
-  Object.defineProperty(myObject, Symbol.iterator, {
-    get: function() { iteratorReadCount++; return gen; }
-  });
-  genArr = new constr(myObject);
-  assertEquals(10, genArr.length);
-  assertEquals(0, genArr[0]);
-  assertEquals(9, genArr[9]);
-  assertEquals(1, iteratorReadCount);
-}
-
-TestTypedArray(Uint8Array, 1, 0xFF);
-TestTypedArray(Int8Array, 1, -0x7F);
-TestTypedArray(Uint16Array, 2, 0xFFFF);
-TestTypedArray(Int16Array, 2, -0x7FFF);
-TestTypedArray(Uint32Array, 4, 0xFFFFFFFF);
-TestTypedArray(Int32Array, 4, -0x7FFFFFFF);
-TestTypedArray(Float32Array, 4, 0.5);
-TestTypedArray(Float64Array, 8, 0.5);
-TestTypedArray(Uint8ClampedArray, 1, 0xFF);
-
-function SubarrayTestCase(constructor, item, expectedResultLen, expectedStartIndex,
-                          initialLen, start, end) {
-  var a = new constructor(initialLen);
-  var s = a.subarray(start, end);
-  assertSame(constructor, s.constructor);
-  assertSame(expectedResultLen, s.length);
-  if (s.length > 0) {
-    s[0] = item;
-    assertSame(item, a[expectedStartIndex]);
-  }
-}
-
-function TestSubArray(constructor, item) {
-  SubarrayTestCase(constructor, item, 512, 512, 1024, 512, 1024);
-  SubarrayTestCase(constructor, item, 512, 512, 1024, 512);
-
-  SubarrayTestCase(constructor, item, 0, undefined, 0, 1, 20);
-  SubarrayTestCase(constructor, item, 100, 0,       100, 0, 100);
-  SubarrayTestCase(constructor, item, 100, 0,       100,  0, 1000);
-  SubarrayTestCase(constructor, item, 0, undefined, 100, 5, 1);
-
-  SubarrayTestCase(constructor, item, 1, 89,        100, -11, -10);
-  SubarrayTestCase(constructor, item, 9, 90,        100, -10, 99);
-  SubarrayTestCase(constructor, item, 0, undefined, 100, -10, 80);
-  SubarrayTestCase(constructor, item, 10,80,        100, 80, -10);
-
-  SubarrayTestCase(constructor, item, 10,90,        100, 90, "100");
-  SubarrayTestCase(constructor, item, 10,90,        100, "90", "100");
-
-  SubarrayTestCase(constructor, item, 0, undefined, 100, 90, "abc");
-  SubarrayTestCase(constructor, item, 10,0,         100, "abc", 10);
-
-  SubarrayTestCase(constructor, item, 10,0,         100, 0.96, 10.96);
-  SubarrayTestCase(constructor, item, 10,0,         100, 0.96, 10.01);
-  SubarrayTestCase(constructor, item, 10,0,         100, 0.01, 10.01);
-  SubarrayTestCase(constructor, item, 10,0,         100, 0.01, 10.96);
-
-
-  SubarrayTestCase(constructor, item, 10,90,        100, 90);
-  SubarrayTestCase(constructor, item, 10,90,        100, -10);
-
-  var method = constructor.prototype.subarray;
-  method.call(new constructor(100), 0, 100);
-  var o = {};
-  assertThrows(function() { method.call(o, 0, 100); }, TypeError);
-}
-
-TestSubArray(Uint8Array, 0xFF);
-TestSubArray(Int8Array, -0x7F);
-TestSubArray(Uint16Array, 0xFFFF);
-TestSubArray(Int16Array, -0x7FFF);
-TestSubArray(Uint32Array, 0xFFFFFFFF);
-TestSubArray(Int32Array, -0x7FFFFFFF);
-TestSubArray(Float32Array, 0.5);
-TestSubArray(Float64Array, 0.5);
-TestSubArray(Uint8ClampedArray, 0xFF);
-
-function TestTypedArrayOutOfRange(constructor, value, result) {
-  var a = new constructor(1);
-  a[0] = value;
-  assertSame(result, a[0]);
-}
-
-TestTypedArrayOutOfRange(Uint8Array, 0x1FA, 0xFA);
-TestTypedArrayOutOfRange(Uint8Array, -1, 0xFF);
-
-TestTypedArrayOutOfRange(Int8Array, 0x1FA, 0x7A - 0x80);
-
-TestTypedArrayOutOfRange(Uint16Array, 0x1FFFA, 0xFFFA);
-TestTypedArrayOutOfRange(Uint16Array, -1, 0xFFFF);
-TestTypedArrayOutOfRange(Int16Array, 0x1FFFA, 0x7FFA - 0x8000);
-
-TestTypedArrayOutOfRange(Uint32Array, 0x1FFFFFFFA, 0xFFFFFFFA);
-TestTypedArrayOutOfRange(Uint32Array, -1, 0xFFFFFFFF);
-TestTypedArrayOutOfRange(Int32Array, 0x1FFFFFFFA, 0x7FFFFFFA - 0x80000000);
-
-TestTypedArrayOutOfRange(Uint8ClampedArray, 0x1FA, 0xFF);
-TestTypedArrayOutOfRange(Uint8ClampedArray, -1, 0);
-
-var typedArrayConstructors = [
-  Uint8Array,
-  Int8Array,
-  Uint16Array,
-  Int16Array,
-  Uint32Array,
-  Int32Array,
-  Uint8ClampedArray,
-  Float32Array,
-  Float64Array];
-
-function TestPropertyTypeChecks(constructor) {
-  function CheckProperty(name) {
-    assertThrows(function() { 'use strict'; new constructor(10)[name] = 0; })
-    var d = Object.getOwnPropertyDescriptor(constructor.prototype.__proto__, name);
-    var o = {};
-    assertThrows(function() {d.get.call(o);}, TypeError);
-    for (var i = 0; i < typedArrayConstructors.length; i++) {
-      var ctor = typedArrayConstructors[i];
-      var a = new ctor(10);
-      d.get.call(a); // shouldn't throw
-    }
-  }
-
-  CheckProperty("buffer");
-  CheckProperty("byteOffset");
-  CheckProperty("byteLength");
-  CheckProperty("length");
-}
-
-for(i = 0; i < typedArrayConstructors.length; i++) {
-  TestPropertyTypeChecks(typedArrayConstructors[i]);
-}
-
-
-function TestTypedArraySet() {
-  // Test array.set in different combinations.
-
-  function assertArrayPrefix(expected, array) {
-    for (var i = 0; i < expected.length; ++i) {
-      assertEquals(expected[i], array[i]);
-    }
-  }
-
-  var a11 = new Int16Array([1, 2, 3, 4, 0, -1])
-  var a12 = new Uint16Array(15)
-  a12.set(a11, 3)
-  assertArrayPrefix([0, 0, 0, 1, 2, 3, 4, 0, 0xffff, 0, 0], a12)
-  assertThrows(function(){ a11.set(a12) })
-
-  var a21 = [1, undefined, 10, NaN, 0, -1, {valueOf: function() {return 3}}]
-  var a22 = new Int32Array(12)
-  a22.set(a21, 2)
-  assertArrayPrefix([0, 0, 1, 0, 10, 0, 0, -1, 3, 0], a22)
-
-  var a31 = new Float32Array([2, 4, 6, 8, 11, NaN, 1/0, -3])
-  var a32 = a31.subarray(2, 6)
-  a31.set(a32, 4)
-  assertArrayPrefix([2, 4, 6, 8, 6, 8, 11, NaN], a31)
-  assertArrayPrefix([6, 8, 6, 8], a32)
-
-  var a4 = new Uint8ClampedArray([3,2,5,6])
-  a4.set(a4)
-  assertArrayPrefix([3, 2, 5, 6], a4)
-
-  // Cases with overlapping backing store but different element sizes.
-  var b = new ArrayBuffer(4)
-  var a5 = new Int16Array(b)
-  var a50 = new Int8Array(b)
-  var a51 = new Int8Array(b, 0, 2)
-  var a52 = new Int8Array(b, 1, 2)
-  var a53 = new Int8Array(b, 2, 2)
-
-  a5.set([0x5050, 0x0a0a])
-  assertArrayPrefix([0x50, 0x50, 0x0a, 0x0a], a50)
-  assertArrayPrefix([0x50, 0x50], a51)
-  assertArrayPrefix([0x50, 0x0a], a52)
-  assertArrayPrefix([0x0a, 0x0a], a53)
-
-  a50.set([0x50, 0x50, 0x0a, 0x0a])
-  a51.set(a5)
-  assertArrayPrefix([0x50, 0x0a, 0x0a, 0x0a], a50)
-
-  a50.set([0x50, 0x50, 0x0a, 0x0a])
-  a52.set(a5)
-  assertArrayPrefix([0x50, 0x50, 0x0a, 0x0a], a50)
-
-  a50.set([0x50, 0x50, 0x0a, 0x0a])
-  a53.set(a5)
-  assertArrayPrefix([0x50, 0x50, 0x50, 0x0a], a50)
-
-  a50.set([0x50, 0x51, 0x0a, 0x0b])
-  a5.set(a51)
-  assertArrayPrefix([0x0050, 0x0051], a5)
-
-  a50.set([0x50, 0x51, 0x0a, 0x0b])
-  a5.set(a52)
-  assertArrayPrefix([0x0051, 0x000a], a5)
-
-  a50.set([0x50, 0x51, 0x0a, 0x0b])
-  a5.set(a53)
-  assertArrayPrefix([0x000a, 0x000b], a5)
-
-  // Mixed types of same size.
-  var a61 = new Float32Array([1.2, 12.3])
-  var a62 = new Int32Array(2)
-  a62.set(a61)
-  assertArrayPrefix([1, 12], a62)
-  a61.set(a62)
-  assertArrayPrefix([1, 12], a61)
-
-  // Invalid source
-  var a = new Uint16Array(50);
-  var expected = [];
-  for (i = 0; i < 50; i++) {
-    a[i] = i;
-    expected.push(i);
-  }
-  a.set({});
-  assertArrayPrefix(expected, a);
-  assertThrows(function() { a.set.call({}) }, TypeError);
-  assertThrows(function() { a.set.call([]) }, TypeError);
-
-  assertThrows(function() { a.set(0); }, TypeError);
-  assertThrows(function() { a.set(0, 1); }, TypeError);
-
-  assertEquals(1, a.set.length);
-}
-
-TestTypedArraySet();
-
-function TestTypedArraysWithIllegalIndices() {
-  var a = new Int32Array(100);
-
-  a[-10] = 10;
-  assertEquals(undefined, a[-10]);
-  a["-10"] = 10;
-  assertEquals(undefined, a["-10"]);
-
-  var s = "    -10";
-  a[s] = 10;
-  assertEquals(10, a[s]);
-  var s1 = "    -10   ";
-  a[s] = 10;
-  assertEquals(10, a[s]);
-
-  a["-1e2"] = 10;
-  assertEquals(10, a["-1e2"]);
-  assertEquals(undefined, a[-1e2]);
-
-  a["-0"] = 256;
-  var s2 = "     -0";
-  a[s2] = 255;
-  assertEquals(undefined, a["-0"]);
-  assertEquals(255, a[s2]);
-  assertEquals(0, a[-0]);
-
-  a[-Infinity] = 50;
-  assertEquals(undefined, a[-Infinity]);
-
-  a[1.5] = 10;
-  assertEquals(undefined, a[1.5]);
-  var nan = Math.sqrt(-1);
-  a[nan] = 5;
-  assertEquals(undefined, a[nan]);
-
-  var x = 0;
-  var y = -0;
-  assertEquals(Infinity, 1/x);
-  assertEquals(-Infinity, 1/y);
-  a[x] = 5;
-  a[y] = 27;
-  assertEquals(27, a[x]);
-  assertEquals(27, a[y]);
-}
-
-TestTypedArraysWithIllegalIndices();
-
-function TestTypedArraysWithIllegalIndicesStrict() {
-  'use strict';
-  var a = new Int32Array(100);
-
-  a[-10] = 10;
-  assertEquals(undefined, a[-10]);
-  a["-10"] = 10;
-  assertEquals(undefined, a["-10"]);
-
-  var s = "    -10";
-  a[s] = 10;
-  assertEquals(10, a[s]);
-  var s1 = "    -10   ";
-  a[s] = 10;
-  assertEquals(10, a[s]);
-
-  a["-1e2"] = 10;
-  assertEquals(10, a["-1e2"]);
-  assertEquals(undefined, a[-1e2]);
-
-  a["-0"] = 256;
-  var s2 = "     -0";
-  a[s2] = 255;
-  assertEquals(undefined, a["-0"]);
-  assertEquals(255, a[s2]);
-  assertEquals(0, a[-0]);
-
-  /* Chromium bug: 424619
-   * a[-Infinity] = 50;
-   * assertEquals(undefined, a[-Infinity]);
-   */
-  a[1.5] = 10;
-  assertEquals(undefined, a[1.5]);
-  var nan = Math.sqrt(-1);
-  a[nan] = 5;
-  assertEquals(undefined, a[nan]);
-
-  var x = 0;
-  var y = -0;
-  assertEquals(Infinity, 1/x);
-  assertEquals(-Infinity, 1/y);
-  a[x] = 5;
-  a[y] = 27;
-  assertEquals(27, a[x]);
-  assertEquals(27, a[y]);
-}
-
-TestTypedArraysWithIllegalIndicesStrict();
-
-// DataView
-function TestDataViewConstructor() {
-  var ab = new ArrayBuffer(256);
-
-  var d1 = new DataView(ab, 1, 255);
-  assertTrue(ArrayBuffer.isView(d1));
-  assertSame(ab, d1.buffer);
-  assertSame(1, d1.byteOffset);
-  assertSame(255, d1.byteLength);
-
-  var d2 = new DataView(ab, 2);
-  assertSame(ab, d2.buffer);
-  assertSame(2, d2.byteOffset);
-  assertSame(254, d2.byteLength);
-
-  var d3 = new DataView(ab);
-  assertSame(ab, d3.buffer);
-  assertSame(0, d3.byteOffset);
-  assertSame(256, d3.byteLength);
-
-  var d3a = new DataView(ab, 1, 0);
-  assertSame(ab, d3a.buffer);
-  assertSame(1, d3a.byteOffset);
-  assertSame(0, d3a.byteLength);
-
-  var d3b = new DataView(ab, 256, 0);
-  assertSame(ab, d3b.buffer);
-  assertSame(256, d3b.byteOffset);
-  assertSame(0, d3b.byteLength);
-
-  var d3c = new DataView(ab, 256);
-  assertSame(ab, d3c.buffer);
-  assertSame(256, d3c.byteOffset);
-  assertSame(0, d3c.byteLength);
-
-  var d4 = new DataView(ab, 1, 3.1415926);
-  assertSame(ab, d4.buffer);
-  assertSame(1, d4.byteOffset);
-  assertSame(3, d4.byteLength);
-
-
-  // error cases
-  assertThrows(function() { new DataView(ab, -1); }, RangeError);
-  assertThrows(function() { new DataView(); }, TypeError);
-  assertThrows(function() { new DataView([]); }, TypeError);
-  assertThrows(function() { new DataView(ab, 257); }, RangeError);
-  assertThrows(function() { new DataView(ab, 1, 1024); }, RangeError);
-}
-
-TestDataViewConstructor();
-
-function TestDataViewPropertyTypeChecks() {
-  var a = new DataView(new ArrayBuffer(10));
-  function CheckProperty(name) {
-    var d = Object.getOwnPropertyDescriptor(DataView.prototype, name);
-    var o = {}
-    assertThrows(function() {d.get.call(o);}, TypeError);
-    d.get.call(a); // shouldn't throw
-  }
-
-  CheckProperty("buffer");
-  CheckProperty("byteOffset");
-  CheckProperty("byteLength");
-
-  function CheckGetSetLength(name) {
-    assertEquals(1, DataView.prototype["get" + name].length);
-    assertEquals(2, DataView.prototype["set" + name].length);
-  }
-  CheckGetSetLength("Int8");
-  CheckGetSetLength("Uint8");
-  CheckGetSetLength("Int16");
-  CheckGetSetLength("Uint16");
-  CheckGetSetLength("Int32");
-  CheckGetSetLength("Uint32");
-  CheckGetSetLength("Float32");
-  CheckGetSetLength("Float64");
-}
-
-
-TestDataViewPropertyTypeChecks();
-
-
-function TestDataViewToStringTag() {
-  var a = new DataView(new ArrayBuffer(10));
-  assertEquals("[object DataView]", Object.prototype.toString.call(a));
-  var desc = Object.getOwnPropertyDescriptor(
-      DataView.prototype, Symbol.toStringTag);
-  assertTrue(desc.configurable);
-  assertFalse(desc.enumerable);
-  assertFalse(desc.writable);
-  assertEquals("DataView", desc.value);
-}
-
-
-// General tests for properties
-
-// Test property attribute [[Enumerable]]
-function TestEnumerable(func, obj) {
-  function props(x) {
-    var array = [];
-    for (var p in x) array.push(p);
-    return array.sort();
-  }
-  assertArrayEquals([], props(func));
-  assertArrayEquals([], props(func.prototype));
-  if (obj)
-    assertArrayEquals([], props(obj));
-}
-TestEnumerable(ArrayBuffer, new ArrayBuffer());
-for(i = 0; i < typedArrayConstructors.length; i++) {
-  TestEnumerable(typedArrayConstructors[i]);
-}
-TestEnumerable(DataView, new DataView(new ArrayBuffer()));
-
-// Test arbitrary properties on ArrayBuffer
-function TestArbitrary(m) {
-  function TestProperty(map, property, value) {
-    map[property] = value;
-    assertEquals(value, map[property]);
-  }
-  for (var i = 0; i < 20; i++) {
-    TestProperty(m, 'key' + i, 'val' + i);
-    TestProperty(m, 'foo' + i, 'bar' + i);
-  }
-}
-TestArbitrary(new ArrayBuffer(256));
-for(i = 0; i < typedArrayConstructors.length; i++) {
-  TestArbitrary(new typedArrayConstructors[i](10));
-}
-TestArbitrary(new DataView(new ArrayBuffer(256)));
-
-
-// Test direct constructor call
-assertThrows(function() { ArrayBuffer(); }, TypeError);
-assertThrows(function() { DataView(new ArrayBuffer()); }, TypeError);
-
-function TestNonConfigurableProperties(constructor) {
-  var arr = new constructor([100])
-  assertFalse(Object.getOwnPropertyDescriptor(arr,"0").configurable)
-  assertFalse(delete arr[0])
-}
-
-for(i = 0; i < typedArrayConstructors.length; i++) {
-  TestNonConfigurableProperties(typedArrayConstructors[i]);
-}
diff --git a/src/v8/test/mjsunit/es8/constructor-returning-primitive.js b/src/v8/test/mjsunit/es8/constructor-returning-primitive.js
deleted file mode 100644
index 1c0e772..0000000
--- a/src/v8/test/mjsunit/es8/constructor-returning-primitive.js
+++ /dev/null
@@ -1,318 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --harmony-restrict-constructor-return
-
-assertThrows(
-  () => {
-    new class {
-      constructor() {
-        return 1;
-      }
-    }();
-  },
-  TypeError,
-  "Class constructors may only return object or undefined"
-);
-
-assertThrows(
-  () => {
-    new class {
-      constructor() {
-        return 2147483649;
-      }
-    }();
-  },
-  TypeError,
-  "Class constructors may only return object or undefined"
-);
-
-assertThrows(
-  () => {
-    new class {
-      constructor() {
-        return true;
-      }
-    }();
-  },
-  TypeError,
-  "Class constructors may only return object or undefined"
-);
-
-assertThrows(
-  () => {
-    new class {
-      constructor() {
-        return null;
-      }
-    }();
-  },
-  TypeError,
-  "Class constructors may only return object or undefined"
-);
-
-assertThrows(
-  () => {
-    new class {
-      constructor() {
-        return "wat";
-      }
-    }();
-  },
-  TypeError,
-  "Class constructors may only return object or undefined"
-);
-
-assertThrows(
-  () => {
-    new class {
-      constructor() {
-        return Symbol();
-      }
-    }();
-  },
-  TypeError,
-  "Class constructors may only return object or undefined"
-);
-
-assertThrows(
-  () => {
-    new class {
-      constructor() {
-        return 2.2;
-      }
-    }();
-  },
-  TypeError,
-  "Class constructors may only return object or undefined"
-);
-
-assertThrows(
-  () => {
-    new class extends Object {
-      constructor() {
-        return 1;
-      }
-    }();
-  },
-  TypeError,
-  "Class constructors may only return object or undefined"
-);
-
-assertThrows(
-  () => {
-    new class extends Object {
-      constructor() {
-        return 2147483649;
-      }
-    }();
-  },
-  TypeError,
-  "Class constructors may only return object or undefined"
-);
-
-assertThrows(
-  () => {
-    new class extends Object {
-      constructor() {
-        return true;
-      }
-    }();
-  },
-  TypeError,
-  "Class constructors may only return object or undefined"
-);
-
-assertThrows(
-  () => {
-    new class extends Object {
-      constructor() {
-        return null;
-      }
-    }();
-  },
-  TypeError,
-  "Class constructors may only return object or undefined"
-);
-
-assertThrows(
-  () => {
-    new class extends Object {
-      constructor() {
-        return "wat";
-      }
-    }();
-  },
-  TypeError,
-  "Class constructors may only return object or undefined"
-);
-
-assertThrows(
-  () => {
-    new class extends Object {
-      constructor() {
-        return Symbol();
-      }
-    }();
-  },
-  TypeError,
-  "Class constructors may only return object or undefined"
-);
-
-assertThrows(
-  () => {
-    new class extends Object {
-      constructor() {
-        return 2.2;
-      }
-    }();
-  },
-  TypeError,
-  "Class constructors may only return object or undefined"
-);
-
-assertThrows(
-  () => {
-    new class extends Object {
-      constructor() {}
-    }();
-  },
-  ReferenceError,
-  "Must call super constructor in derived class before accessing " +
-    "'this' or returning from derived constructor"
-);
-
-(function() {
-  let ret_val = { x: 1 };
-  let x = new class {
-    constructor() {
-      return ret_val;
-    }
-  }();
-  assertSame(ret_val, x);
-})();
-
-(function() {
-  class Foo {
-    constructor() {}
-  }
-  let x = new Foo();
-  assertTrue(x instanceof Foo);
-})();
-
-(function() {
-  class Foo {
-    constructor() {
-      return undefined;
-    }
-  }
-  let x = new Foo();
-  assertTrue(x instanceof Foo);
-})();
-
-(function() {
-  let ret_val = { x: 1 };
-  let x = new class extends Object {
-    constructor() {
-      return ret_val;
-    }
-  }();
-  assertSame(ret_val, x);
-})();
-
-(function() {
-  class Foo extends Object {
-    constructor() {
-      super();
-      return undefined;
-    }
-  }
-
-  let x = new Foo();
-  assertTrue(x instanceof Foo);
-})();
-
-(function() {
-  class Foo extends Object {
-    constructor() {
-      super();
-    }
-  }
-
-  let x = new Foo();
-  assertTrue(x instanceof Foo);
-})();
-
-(function() {
-  function foo() {
-    return 1;
-  }
-  let x = new foo();
-  assertTrue(x instanceof foo);
-})();
-
-(function() {
-  function foo() {
-    return 2147483649;
-  }
-  let x = new foo();
-  assertTrue(x instanceof foo);
-})();
-
-(function() {
-  function foo() {
-    return true;
-  }
-  let x = new foo();
-  assertTrue(x instanceof foo);
-})();
-
-(function() {
-  function foo() {
-    return undefined;
-  }
-  let x = new foo();
-  assertTrue(x instanceof foo);
-})();
-
-(function() {
-  function foo() {
-    return null;
-  }
-  let x = new foo();
-  assertTrue(x instanceof foo);
-})();
-
-(function() {
-  function foo() {
-    return "wat";
-  }
-  let x = new foo();
-  assertTrue(x instanceof foo);
-})();
-
-(function() {
-  function foo() {
-    return Symbol();
-  }
-  let x = new foo();
-  assertTrue(x instanceof foo);
-})();
-
-(function() {
-  function foo() {
-    return 2.2;
-  }
-  let x = new foo();
-  assertTrue(x instanceof foo);
-})();
-
-(function() {
-  var ret_val = { x: 1 };
-  function foo() {
-    return ret_val;
-  }
-  let x = new foo();
-  assertSame(x, ret_val);
-})();
diff --git a/src/v8/test/mjsunit/harmony/default-parameter-do-expression.js b/src/v8/test/mjsunit/harmony/default-parameter-do-expression.js
deleted file mode 100644
index cb80d24..0000000
--- a/src/v8/test/mjsunit/harmony/default-parameter-do-expression.js
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --harmony-do-expressions --nolazy
-
-function hoist_unique_do_var() {
-  var f = (y = do { var unique = 3 }) => unique;
-  assertEquals(3, f());
-  assertThrows(() => unique, ReferenceError);
-}
-hoist_unique_do_var();
-
-function hoist_duplicate_do_var() {
-  var duplicate = 100;
-  var f = (y = do { var duplicate = 3 }) => duplicate;
-  assertEquals(3, f());
-  // TODO(verwaest): The {duplicate} declarations were invalidly merged.
-  assertEquals(3, duplicate);
-}
-hoist_duplicate_do_var();
diff --git a/src/v8/test/mjsunit/harmony/do-expressions-arrow-param-scope.js b/src/v8/test/mjsunit/harmony/do-expressions-arrow-param-scope.js
deleted file mode 100644
index f5d5097..0000000
--- a/src/v8/test/mjsunit/harmony/do-expressions-arrow-param-scope.js
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --harmony-do-expressions
-
-(function testBasic() {
-  let f = (x = eval("var z = 42; z"), y = do { 43 }) => x + y;
-  assertEquals(85, f());
-})();
-
-(function testReturnParam() {
-  let f = (x = eval("var z = 42; z"), y = do { x }) => x + y;
-  assertEquals(84, f());
-})();
-
-(function testCaptureParam() {
-  let f = (x = eval("var z = 42; z"), y = do { () => x }) => x + y();
-  assertEquals(84, f());
-})();
-
-(function testScoped() {
-  let f = (x = eval("var z = 42; z"), y = do { let z; x }) => x + y;
-  assertEquals(84, f());
-})();
-
-(function testCaptureScoped() {
-  let f = (x = eval("var z = 42; z"), y = do { let z; () => x }) => x + y();
-  assertEquals(84, f());
-})();
-
-(function testCaptureOuter() {
-  let z = 44;
-  let f = (x = eval("var z = 42; z"), y = do { () => z }) => x + y();
-  assertEquals(86, f())
-})();
-
-(function testCaptureOuterScoped() {
-  let z = 44;
-  let f = (x = eval("var z = 42; z"), y = do { let q; () => z }) => x + y();
-  assertEquals(86, f())
-})();
-
-(function testWith() {
-  let f = (x = eval("var z = 42; z"),
-           y = do {
-             with ({foo: "bar"}) {
-               () => x }
-           }) => x + y();
-  assertEquals(84, f())
-})();
-
-(function testTry() {
-  let f = (x = eval("var z = 42; z"),
-           y = do {
-             try { () => x }
-             catch (e) { }
-           }) => x + y();
-  assertEquals(84, f())
-})();
-
-(function testCatch() {
-  let f = (x = eval("var z = 42; z"),
-           y = do {
-             try { throw 42 }
-             catch (e) { () => x }
-           }) => x + y();
-  assertEquals(84, f())
-})();
-
-(function testFinally() {
-  let z = 44;
-  let q;
-  let f = (x = eval("var z = 42; z"),
-           y = do {
-             try { }
-             catch (e) { }
-             finally { q = () => z }
-             q;
-           }) => x + y();
-  assertEquals(86, f())
-})();
-
-(function testFinallyThrow() {
-  let z = 44;
-  let q;
-  let f = (x = eval("var z = 42; z"),
-           y = do {
-             try { throw 42; }
-             catch (e) { }
-             finally { q = () => z }
-             q;
-           }) => x + y();
-  assertEquals(86, f())
-})();
diff --git a/src/v8/test/mjsunit/harmony/do-expressions-control.js b/src/v8/test/mjsunit/harmony/do-expressions-control.js
deleted file mode 100644
index 12c5429..0000000
--- a/src/v8/test/mjsunit/harmony/do-expressions-control.js
+++ /dev/null
@@ -1,109 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --harmony-do-expressions
-
-(function TestDoForInDoBreak() {
-  function f(o, i) {
-    var a = "result@" + do {
-      var r = "(";
-      for (var x in o) {
-        var b = "end@" + do {
-          if (x == i) { break } else { r += o[x]; x }
-        }
-      }
-      r + ")";
-    }
-    return a + "," + b;
-  }
-  assertEquals("result@(3),end@0", f([3], 2));
-  assertEquals("result@(35),end@1", f([3,5], 2));
-  assertEquals("result@(35),end@1", f([3,5,7], 2));
-  assertEquals("result@(35),end@1", f([3,5,7,9], 2));
-  %OptimizeFunctionOnNextCall(f);
-  assertEquals("result@(3),end@0", f([3], 2));
-  assertEquals("result@(35),end@1", f([3,5], 2));
-  assertEquals("result@(35),end@1", f([3,5,7], 2));
-  assertEquals("result@(35),end@1", f([3,5,7,9], 2));
-})();
-
-(function TestDoForInDoContinue() {
-  function f(o, i) {
-    var a = "result@" + do {
-      var r = "("
-      for (var x in o) {
-        var b = "end@" + do {
-          if (x == i) { continue } else { r += o[x]; x }
-        }
-      }
-      r + ")"
-    }
-    return a + "," + b
-  }
-  assertEquals("result@(3),end@0", f([3], 2));
-  assertEquals("result@(35),end@1", f([3,5], 2));
-  assertEquals("result@(35),end@1", f([3,5,7], 2));
-  assertEquals("result@(359),end@3", f([3,5,7,9], 2));
-  %OptimizeFunctionOnNextCall(f);
-  assertEquals("result@(3),end@0", f([3], 2));
-  assertEquals("result@(35),end@1", f([3,5], 2));
-  assertEquals("result@(35),end@1", f([3,5,7], 2));
-  assertEquals("result@(359),end@3", f([3,5,7,9], 2));
-})();
-
-(function TestDoForNestedWithTargetLabels() {
-  function f(mode) {
-    var loop = true;
-    var head = "<";
-    var tail = ">";
-    var middle =
-    "1" + do { loop1: for(; loop; head += "A") {
-      "2" + do { loop2: for(; loop; head += "B") {
-        "3" + do { loop3: for(; loop; head += "C") {
-          "4" + do { loop4: for(; loop; head += "D") {
-            "5" + do { loop5: for(; loop; head += "E") {
-              "6" + do { loop6: for(; loop; head += "F") {
-                loop = false;
-                switch (mode) {
-                  case "b1": break loop1;
-                  case "b2": break loop2;
-                  case "b3": break loop3;
-                  case "b4": break loop4;
-                  case "b5": break loop5;
-                  case "b6": break loop6;
-                  case "c1": continue loop1;
-                  case "c2": continue loop2;
-                  case "c3": continue loop3;
-                  case "c4": continue loop4;
-                  case "c5": continue loop5;
-                  case "c6": continue loop6;
-                  default: "7";
-                }
-              }}
-            }}
-          }}
-        }}
-      }}
-    }}
-    return head + middle + tail;
-  }
-  function test() {
-    assertEquals(      "<1undefined>",      f("b1"));
-    assertEquals(     "<A1undefined>",      f("c1"));
-    assertEquals(     "<A12undefined>",     f("b2"));
-    assertEquals(    "<BA12undefined>",     f("c2"));
-    assertEquals(    "<BA123undefined>",    f("b3"));
-    assertEquals(   "<CBA123undefined>",    f("c3"));
-    assertEquals(   "<CBA1234undefined>",   f("b4"));
-    assertEquals(  "<DCBA1234undefined>",   f("c4"));
-    assertEquals(  "<DCBA12345undefined>",  f("b5"));
-    assertEquals( "<EDCBA12345undefined>",  f("c5"));
-    assertEquals( "<EDCBA123456undefined>", f("b6"));
-    assertEquals("<FEDCBA123456undefined>", f("c6"));
-    assertEquals("<FEDCBA1234567>",         f("xx"));
-  }
-  test();
-  %OptimizeFunctionOnNextCall(f);
-  test();
-})();
diff --git a/src/v8/test/mjsunit/harmony/do-expressions.js b/src/v8/test/mjsunit/harmony/do-expressions.js
deleted file mode 100644
index f66c71e..0000000
--- a/src/v8/test/mjsunit/harmony/do-expressions.js
+++ /dev/null
@@ -1,305 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --harmony-do-expressions --allow-natives-syntax --no-always-opt --opt
-
-function returnValue(v) { return v; }
-function MyError() {}
-var global = this;
-
-function TestBasic() {
-  // Looping and lexical declarations
-  assertEquals(512, returnValue(do {
-    let n = 2;
-    for (let i = 0; i < 4; i++) n <<= 2;
-  }));
-
-  // Strings do the right thing
-  assertEquals("spooky halloween", returnValue(do {
-    "happy halloween".replace('happy', 'spooky');
-  }));
-
-  // Do expressions with no completion produce an undefined value
-  assertEquals(undefined, returnValue(do {}));
-  assertEquals(undefined, returnValue(do { var x = 99; }));
-  assertEquals(undefined, returnValue(do { function f() {}; }));
-  assertEquals(undefined, returnValue(do { let z = 33; }));
-
-  // Propagation of exception
-  assertThrows(function() {
-    (do {
-      throw new MyError();
-      "potatoes";
-    });
-  }, MyError);
-
-  assertThrows(function() {
-    return do {
-      throw new MyError();
-      "potatoes";
-    };
-  }, MyError);
-
-  // Return value within do-block overrides `return |do-expression|`
-  assertEquals("inner-return", (function() {
-    return "outer-return" + do {
-      return "inner-return";
-      "";
-    };
-  })());
-
-  var count = 0, n = 1;
-  // Breaking out |do-expression|
-  assertEquals(3, (function() {
-    for (var i = 0; i < 10; ++i) (count += 2 * do { if (i === 3) break; ++n });
-    return i;
-  })());
-  // (2 * 2) + (2 * 3) + (2 * 4)
-  assertEquals(18, count);
-
-  // Continue in |do-expression|
-  count = 0, n = 1;
-  assertEquals([1, 3, 5, 7, 9], (function() {
-    var values = [];
-    for (var i = 0; i < 10; ++i) {
-      count += 2 * (do {
-        if ((i & 1) === 0) continue;
-        values.push(i);
-        ++n;
-      }) + 1;
-    }
-    // (2*2) + 1 + (2*3) + 1 + (2*4) + 1 + (2*5) + 1 + (2*6) + 1
-    return values;
-  })());
-  assertEquals(count, 45);
-
-  assertThrows("(do { break; });", SyntaxError);
-  assertThrows("(do { continue; });", SyntaxError);
-
-  // Real-world use case for desugaring
-  var array = [1, 2, 3, 4, 5], iterable = [6, 7, 8,9];
-  assertEquals([1, 2, 3, 4, 5, 6, 7, 8, 9], do {
-    for (var element of iterable) array.push(element);
-    array;
-  });
-
-  // Nested do-expressions
-  assertEquals(125, do { (do { (do { 5 * 5 * 5 }) }) });
-
-  // Directives are not honoured
-  (do {
-    "use strict";
-    foo = 80;
-    assertEquals(foo, 80);
-  });
-
-  // Non-empty operand stack testing
-  var O = {
-    method1() {
-      let x = 256;
-      return x + do {
-        for (var i = 0; i < 4; ++i) x += i;
-      } + 17;
-    },
-    method2() {
-      let x = 256;
-      this.reset();
-      return x + do {
-        for (var i = 0; i < this.length(); ++i) x += this.index() * 2;
-      };
-    },
-    _index: 0,
-    index() {
-      return ++this._index;
-    },
-    _length: 4,
-    length() { return this._length; },
-    reset() { this._index = 0; }
-  };
-  assertEquals(535, O["method" + do { 1 } + ""]());
-  assertEquals(532, O["method" + do { ({ valueOf() { return "2"; } }); }]());
-  assertEquals(532, O[
-      do { let s = ""; for (let c of "method") s += c; } + "2"]());
-}
-TestBasic();
-
-
-function TestDeoptimization1() {
-  function f(v) {
-    return 88 + do {
-      v.a * v.b + v.c;
-    };
-  }
-
-  var o1 = {};
-  o1.a = 10;
-  o1.b = 5;
-  o1.c = 50;
-
-  var o2 = {};
-  o2.c = 100;
-  o2.a = 10;
-  o2.b = 10;
-
-  assertEquals(188, f(o1));
-  assertEquals(188, f(o1));
-  %OptimizeFunctionOnNextCall(f);
-  assertEquals(188, f(o1));
-  assertOptimized(f);
-  assertEquals(288, f(o2));
-  assertUnoptimized(f);
-  assertEquals(288, f(o2));
-}
-TestDeoptimization1();
-
-
-function TestInParameterInitializers() {
-  var first_name = "George";
-  var last_name = "Jetson";
-  function fn1(name = do { first_name + " " + last_name }) {
-    return name;
-  }
-  assertEquals("George Jetson", fn1());
-
-  var _items = [1, 2, 3, NaN, 4, 5];
-  function fn2(items = do {
-    let items = [];
-    for (var el of _items) {
-      if (el !== el) {
-        items;
-        break;
-      }
-      items.push(el), items;
-    }
-  }) {
-    return items;
-  }
-  assertEquals([1, 2, 3], fn2());
-
-  function thrower() { throw new MyError(); }
-  function fn3(exception = do {  try { thrower(); } catch (e) { e } }) {
-    return exception;
-  }
-  assertDoesNotThrow(fn3);
-  assertInstanceof(fn3(), MyError);
-
-  function fn4(exception = do { throw new MyError() }) {}
-  function catcher(fn) {
-    try {
-      fn();
-      assertUnreachable("fn() initializer should throw");
-    } catch (e) {
-      assertInstanceof(e, MyError);
-    }
-  }
-  catcher(fn4);
-}
-TestInParameterInitializers();
-
-
-function TestWithEval() {
-  (function sloppy1() {
-    assertEquals(do { eval("var x = 5"), x }, 5);
-    assertEquals(x, 5);
-  })();
-
-  assertThrows(function strict1() {
-    "use strict";
-    (do { eval("var x = 5"), x }, 5);
-  }, ReferenceError);
-
-  assertThrows(function strict2() {
-    (do { eval("'use strict'; var x = 5"), x }, 5);
-  }, ReferenceError);
-}
-TestWithEval();
-
-
-function TestHoisting() {
-  (do { var a = 1; });
-  assertEquals(a, 1);
-  assertEquals(global.a, undefined);
-
-  (do {
-    for (let it of [1, 2, 3, 4, 5]) {
-      var b = it;
-    }
-  });
-  assertEquals(b, 5);
-  assertEquals(global.b, undefined);
-
-  {
-    let x = 1
-
-    // TODO(caitp): ensure VariableStatements in |do-expressions| in parameter
-    // initializers, are evaluated in the same VariableEnvironment as they would
-    // be for eval().
-    // function f1(a = do { var x = 2 }, b = x) { return b }
-    // assertEquals(1, f1())
-
-    // function f2(a = x, b = do { var x = 2 }) { return a }
-    // assertEquals(1, f2())
-
-    function f3({a = do { var x = 2 }, b = x}) { return b }
-    assertEquals(2, f3({}))
-
-    function f4({a = x, b = do { var x = 2 }}) { return b }
-    assertEquals(undefined, f4({}))
-
-    function f5(a = do { var y = 0 }) {}
-    assertThrows(() => y, ReferenceError)
-  }
-
-  // TODO(caitp): Always block-scope function declarations in |do| expressions
-  //(do {
-  //  assertEquals(true, inner_func());
-  //  function inner_func() { return true; }
-  //});
-  //assertThrows(function() { return innerFunc(); }, ReferenceError);
-}
-TestHoisting();
-
-
-// v8:4661
-
-function tryFinallySimple() { (do { try {} finally {} }); }
-tryFinallySimple();
-tryFinallySimple();
-tryFinallySimple();
-tryFinallySimple();
-
-var finallyRanCount = 0;
-function tryFinallyDoExpr() {
-  return (do {
-    try {
-      throw "BOO";
-    } catch (e) {
-      "Caught: " + e + " (" + finallyRanCount + ")"
-    } finally {
-      ++finallyRanCount;
-    }
-  });
-}
-assertEquals("Caught: BOO (0)", tryFinallyDoExpr());
-assertEquals(1, finallyRanCount);
-assertEquals("Caught: BOO (1)", tryFinallyDoExpr());
-assertEquals(2, finallyRanCount);
-assertEquals("Caught: BOO (2)", tryFinallyDoExpr());
-assertEquals(3, finallyRanCount);
-assertEquals("Caught: BOO (3)", tryFinallyDoExpr());
-assertEquals(4, finallyRanCount);
-
-
-function TestOSR() {
-  var numbers = do {
-    let nums = [];
-    for (let i = 0; i < 1000; ++i) {
-      let value = (Math.random() * 100) | 0;
-      nums.push(value === 0 ? 1 : value), nums;
-    }
-  };
-  assertEquals(numbers.length, 1000);
-}
-
-for (var i = 0; i < 64; ++i) TestOSR();
diff --git a/src/v8/test/mjsunit/harmony/function-sent.js b/src/v8/test/mjsunit/harmony/function-sent.js
deleted file mode 100644
index cd0ca95..0000000
--- a/src/v8/test/mjsunit/harmony/function-sent.js
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --harmony-function-sent
-
-
-{
-  function* g() { return function.sent }
-  assertEquals({value: 42, done: true}, g().next(42));
-}
-
-
-{
-  function* g() {
-    try {
-      yield function.sent;
-    } finally {
-      yield function.sent;
-      return function.sent;
-    }
-  }
-
-  {
-    let x = g();
-    assertEquals({value: 1, done: false}, x.next(1));
-    assertEquals({value: 2, done: false}, x.next(2));
-    assertEquals({value: 3, done: true}, x.next(3));
-  }
-
-  {
-    let x = g();
-    assertEquals({value: 1, done: false}, x.next(1));
-    assertEquals({value: 2, done: false}, x.throw(2));
-    assertEquals({value: 3, done: true}, x.next(3));
-  }
-
-  {
-    let x = g();
-    assertEquals({value: 1, done: false}, x.next(1));
-    assertEquals({value: 2, done: false}, x.return(2));
-    assertEquals({value: 3, done: true}, x.next(3));
-  }
-}
-
-
-{
-  function* inner() {
-    try {
-      yield function.sent;
-    } finally {
-      return 23;
-    }
-  }
-
-  function* g() {
-    yield function.sent;
-    yield* inner();
-    return function.sent;
-  }
-
-  {
-    let x = g();
-    assertEquals({value: 1, done: false}, x.next(1));
-    assertEquals({value: undefined, done: false}, x.next(2));
-    assertEquals({value: 3, done: true}, x.next(3));
-  }
-
-  {
-    let x = g();
-    assertEquals({value: 1, done: false}, x.next(1));
-    assertEquals({value: undefined, done: false}, x.next(2));
-    assertEquals({value: 42, done: true}, x.throw(42));
-  }
-
-  {
-    let x = g();
-    assertEquals({value: 1, done: false}, x.next(1));
-    assertEquals({value: undefined, done: false}, x.next(2));
-    assertEquals({value: 23, done: true}, x.return(42));
-  }
-}
-
-
-assertThrows("function f() { return function.sent }", SyntaxError);
-assertThrows("() => { return function.sent }", SyntaxError);
-assertThrows("() => { function.sent }", SyntaxError);
-assertThrows("() => function.sent", SyntaxError);
-assertThrows("({*f() { function.sent }})", SyntaxError);
-assertDoesNotThrow("({*f() { return function.sent }})");
diff --git a/src/v8/test/mjsunit/harmony/intl-numberformat-formattoparts.js b/src/v8/test/mjsunit/harmony/intl-numberformat-formattoparts.js
deleted file mode 100644
index 3ffe6ce..0000000
--- a/src/v8/test/mjsunit/harmony/intl-numberformat-formattoparts.js
+++ /dev/null
@@ -1,336 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --harmony-number-format-to-parts
-
-// Adapted from Gecko's js/src/tests/Intl/NumberFormat/formatToParts.js,
-// which was dedicated to the public domain.
-
-// NOTE: Some of these tests exercise standard behavior (e.g. that format and
-//       formatToParts expose the same formatted string).  But much of this,
-//       like the exact-formatted-string expectations, is technically
-//       implementation-dependent.  This is necessary as a practical matter to
-//       properly test the conversion from ICU's nested-field exposure to
-//       ECMA-402's sequential-parts exposure.
-
-if (this.Intl) {
-
-  function GenericPartCreator(type)
-  {
-    return function(str) { return { type, value: str }; };
-  }
-
-  var Nan = GenericPartCreator("nan");
-  var Inf = GenericPartCreator("infinity");
-  var Integer = GenericPartCreator("integer");
-  var Group = GenericPartCreator("group");
-  var Decimal = GenericPartCreator("decimal");
-  var Fraction = GenericPartCreator("fraction");
-  var MinusSign = GenericPartCreator("minusSign");
-  var PlusSign = GenericPartCreator("plusSign");
-  var PercentSign = GenericPartCreator("percentSign");
-  var Currency = GenericPartCreator("currency");
-  var Literal = GenericPartCreator("literal");
-
-  function assertParts(nf, x, expected)
-  {
-    var parts = nf.formatToParts(x);
-    assertEquals(nf.format(x),
-                 parts.map(part => part.value).join(""));
-
-    var len = parts.length;
-    assertEquals(expected.length, len);
-    for (var i = 0; i < len; i++)
-    {
-      assertEquals(expected[i].type, parts[i].type);
-      assertEquals(expected[i].value, parts[i].value);
-    }
-  }
-
-  //-----------------------------------------------------------------------------
-
-  // Test behavior of a currency with code formatting.
-  var usdCodeOptions =
-    {
-      style: "currency",
-      currency: "USD",
-      currencyDisplay: "code",
-      minimumFractionDigits: 0,
-      maximumFractionDigits: 0,
-    };
-  var usDollarsCode = new Intl.NumberFormat("en-US", usdCodeOptions);
-
-  assertParts(usDollarsCode, 25,
-              [Currency("USD"), Integer("25")]);
-
-  // ISO 4217 currency codes are formed from an ISO 3166-1 alpha-2 country code
-  // followed by a third letter.  ISO 3166 guarantees that no country code
-  // starting with "X" will ever be assigned.  Stepping carefully around a few
-  // 4217-designated special "currencies", XQQ will never have a representation.
-  // Thus, yes: this really is specified to work, as unrecognized or unsupported
-  // codes pass into the string unmodified.
-  var xqqCodeOptions =
-    {
-      style: "currency",
-      currency: "XQQ",
-      currencyDisplay: "code",
-      minimumFractionDigits: 0,
-      maximumFractionDigits: 0,
-    };
-  var xqqMoneyCode = new Intl.NumberFormat("en-US", xqqCodeOptions);
-
-  assertParts(xqqMoneyCode, 25,
-              [Currency("XQQ"), Integer("25")]);
-
-  // Test currencyDisplay: "name".
-  var usdNameOptions =
-    {
-      style: "currency",
-      currency: "USD",
-      currencyDisplay: "name",
-      minimumFractionDigits: 0,
-      maximumFractionDigits: 0,
-    };
-  var usDollarsName = new Intl.NumberFormat("en-US", usdNameOptions);
-
-  assertParts(usDollarsName, 25,
-              [Integer("25"), Literal(" "), Currency("US dollars")]);
-
-  var usdNameGroupingOptions =
-    {
-      style: "currency",
-      currency: "USD",
-      currencyDisplay: "name",
-      minimumFractionDigits: 0,
-      maximumFractionDigits: 0,
-    };
-  var usDollarsNameGrouping =
-    new Intl.NumberFormat("en-US", usdNameGroupingOptions);
-
-  assertParts(usDollarsNameGrouping, 12345678,
-              [Integer("12"),
-               Group(","),
-               Integer("345"),
-               Group(","),
-               Integer("678"),
-               Literal(" "),
-               Currency("US dollars")]);
-
-  // But if the implementation doesn't recognize the currency, the provided code
-  // is used in place of a proper name, unmolested.
-  var xqqNameOptions =
-    {
-      style: "currency",
-      currency: "XQQ",
-      currencyDisplay: "name",
-      minimumFractionDigits: 0,
-      maximumFractionDigits: 0,
-    };
-  var xqqMoneyName = new Intl.NumberFormat("en-US", xqqNameOptions);
-
-  assertParts(xqqMoneyName, 25,
-              [Integer("25"), Literal(" "), Currency("XQQ")]);
-
-  // Test some currencies with fractional components.
-
-  var usdNameFractionOptions =
-    {
-      style: "currency",
-      currency: "USD",
-      currencyDisplay: "name",
-      minimumFractionDigits: 2,
-      maximumFractionDigits: 2,
-    };
-  var usdNameFractionFormatter =
-    new Intl.NumberFormat("en-US", usdNameFractionOptions);
-
-  // The US national surplus (i.e. debt) as of October 18, 2016.
-  // (Replicating data from a comment in Intl.cpp.)
-  var usNationalSurplus = -19766580028249.41;
-
-  assertParts(usdNameFractionFormatter, usNationalSurplus,
-              [MinusSign("-"),
-               Integer("19"),
-               Group(","),
-               Integer("766"),
-               Group(","),
-               Integer("580"),
-               Group(","),
-               Integer("028"),
-               Group(","),
-               Integer("249"),
-               Decimal("."),
-               Fraction("41"),
-               Literal(" "),
-               Currency("US dollars")]);
-
-  // Percents in various forms.
-
-  var usPercentOptions =
-    {
-      style: "percent",
-      minimumFractionDigits: 1,
-      maximumFractionDigits: 1,
-    };
-  var usPercentFormatter =
-    new Intl.NumberFormat("en-US", usPercentOptions);
-
-  assertParts(usPercentFormatter, 0.375,
-              [Integer("37"), Decimal("."), Fraction("5"), PercentSign("%")]);
-
-  assertParts(usPercentFormatter, -1284.375,
-              [MinusSign("-"),
-               Integer("128"),
-               Group(","),
-               Integer("437"),
-               Decimal("."),
-               Fraction("5"),
-               PercentSign("%")]);
-
-  assertParts(usPercentFormatter, NaN,
-              [Nan("NaN")]);
-
-  assertParts(usPercentFormatter, Infinity,
-              [Inf("∞"), PercentSign("%")]);
-
-  assertParts(usPercentFormatter, -Infinity,
-              [MinusSign("-"), Inf("∞"), PercentSign("%")]);
-
-  var arPercentOptions =
-    {
-      style: "percent",
-      minimumFractionDigits: 2,
-    };
-  var arPercentFormatter =
-    new Intl.NumberFormat("ar-IQ", arPercentOptions);
-
-  assertParts(arPercentFormatter, -135.32,
-              [MinusSign("\u{061C}-"),
-               Integer("١٣"),
-               Group("Ù¬"),
-               Integer("٥٣٢"),
-               Decimal("Ù«"),
-               Fraction("٠٠"),
-               Literal("\xA0"),
-               PercentSign("Ùª\u{061C}")]);
-
-  // Decimals.
-
-  var usDecimalOptions =
-    {
-      style: "decimal",
-      maximumFractionDigits: 7 // minimum defaults to 0
-    };
-  var usDecimalFormatter =
-    new Intl.NumberFormat("en-US", usDecimalOptions);
-
-  assertParts(usDecimalFormatter, 42,
-              [Integer("42")]);
-
-  assertParts(usDecimalFormatter, 1337,
-              [Integer("1"), Group(","), Integer("337")]);
-
-  assertParts(usDecimalFormatter, -6.25,
-              [MinusSign("-"), Integer("6"), Decimal("."), Fraction("25")]);
-
-  assertParts(usDecimalFormatter, -1376.25,
-              [MinusSign("-"),
-               Integer("1"),
-               Group(","),
-               Integer("376"),
-               Decimal("."),
-               Fraction("25")]);
-
-  assertParts(usDecimalFormatter, 124816.8359375,
-              [Integer("124"),
-               Group(","),
-               Integer("816"),
-               Decimal("."),
-               Fraction("8359375")]);
-
-  var usNoGroupingDecimalOptions =
-    {
-      style: "decimal",
-      useGrouping: false,
-      maximumFractionDigits: 7 // minimum defaults to 0
-    };
-  var usNoGroupingDecimalFormatter =
-    new Intl.NumberFormat("en-US", usNoGroupingDecimalOptions);
-
-  assertParts(usNoGroupingDecimalFormatter, 1337,
-              [Integer("1337")]);
-
-  assertParts(usNoGroupingDecimalFormatter, -6.25,
-              [MinusSign("-"), Integer("6"), Decimal("."), Fraction("25")]);
-
-  assertParts(usNoGroupingDecimalFormatter, -1376.25,
-              [MinusSign("-"),
-               Integer("1376"),
-               Decimal("."),
-               Fraction("25")]);
-
-  assertParts(usNoGroupingDecimalFormatter, 124816.8359375,
-              [Integer("124816"),
-               Decimal("."),
-               Fraction("8359375")]);
-
-  var deDecimalOptions =
-    {
-      style: "decimal",
-      maximumFractionDigits: 7 // minimum defaults to 0
-    };
-  var deDecimalFormatter =
-    new Intl.NumberFormat("de-DE", deDecimalOptions);
-
-  assertParts(deDecimalFormatter, 42,
-              [Integer("42")]);
-
-  assertParts(deDecimalFormatter, 1337,
-              [Integer("1"), Group("."), Integer("337")]);
-
-  assertParts(deDecimalFormatter, -6.25,
-              [MinusSign("-"), Integer("6"), Decimal(","), Fraction("25")]);
-
-  assertParts(deDecimalFormatter, -1376.25,
-              [MinusSign("-"),
-               Integer("1"),
-               Group("."),
-               Integer("376"),
-               Decimal(","),
-               Fraction("25")]);
-
-  assertParts(deDecimalFormatter, 124816.8359375,
-              [Integer("124"),
-               Group("."),
-               Integer("816"),
-               Decimal(","),
-               Fraction("8359375")]);
-
-  var deNoGroupingDecimalOptions =
-    {
-      style: "decimal",
-      useGrouping: false,
-      maximumFractionDigits: 7 // minimum defaults to 0
-    };
-  var deNoGroupingDecimalFormatter =
-    new Intl.NumberFormat("de-DE", deNoGroupingDecimalOptions);
-
-  assertParts(deNoGroupingDecimalFormatter, 1337,
-              [Integer("1337")]);
-
-  assertParts(deNoGroupingDecimalFormatter, -6.25,
-              [MinusSign("-"), Integer("6"), Decimal(","), Fraction("25")]);
-
-  assertParts(deNoGroupingDecimalFormatter, -1376.25,
-              [MinusSign("-"),
-               Integer("1376"),
-               Decimal(","),
-               Fraction("25")]);
-
-  assertParts(deNoGroupingDecimalFormatter, 124816.8359375,
-              [Integer("124816"),
-               Decimal(","),
-               Fraction("8359375")]);
-
-}
diff --git a/src/v8/test/mjsunit/harmony/intl-pluralrules-select.js b/src/v8/test/mjsunit/harmony/intl-pluralrules-select.js
deleted file mode 100644
index cced9b1..0000000
--- a/src/v8/test/mjsunit/harmony/intl-pluralrules-select.js
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --harmony-plural-rules
-
-if (this.Intl) {
-  var pr;
-  var suffixes;
-  function format(n) {
-    return "" + n + suffixes[pr.select(n)];
-  }
-
-  // These English examples illustrate the purpose of the PluralRules class.
-  pr = new Intl.PluralRules("en-US");
-  suffixes = {
-    one:   " day",
-    other: " days",
-  };
-  assertEquals("0 days",   format(0));
-  assertEquals("0.5 days", format(0.5));
-  assertEquals("1 day",    format(1));
-  assertEquals("1.5 days", format(1.5));
-  assertEquals("2 days",   format(2));
-
-  pr = new Intl.PluralRules("en-US", {type: "ordinal"});
-  suffixes = {
-    one:   "st",
-    two:   "nd",
-    few:   "rd",
-    other: "th",
-  };
-  assertEquals("0th",   format(0));
-  assertEquals("1st",   format(1));
-  assertEquals("2nd",   format(2));
-  assertEquals("3rd",   format(3));
-  assertEquals("4th",   format(4));
-  assertEquals("11th",  format(11));
-  assertEquals("21st",  format(21));
-  assertEquals("103rd", format(103));
-
-  // Arabic can cause every possible return value from select()
-  pr = new Intl.PluralRules("ar");
-  suffixes = null;
-  assertEquals("zero",  pr.select(0));
-  assertEquals("one",   pr.select(1));
-  assertEquals("two",   pr.select(2));
-  assertEquals("few",   pr.select(3));
-  assertEquals("many",  pr.select(11));
-  assertEquals("other", pr.select(100));
-  assertEquals("other", pr.select(1.5));
-}
diff --git a/src/v8/test/mjsunit/harmony/module-parsing-eval.js b/src/v8/test/mjsunit/harmony/module-parsing-eval.js
deleted file mode 100644
index 6c080db..0000000
--- a/src/v8/test/mjsunit/harmony/module-parsing-eval.js
+++ /dev/null
@@ -1,39 +0,0 @@
-// 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.
-
-// Check that import/export declarations are rejected in eval or local scope.
-assertThrows("export let x;", SyntaxError);
-assertThrows("import x from 'http://url';", SyntaxError);
-
-assertThrows("{ export let x; }", SyntaxError);
-assertThrows("{ import x from 'http://url'; }", SyntaxError);
-
-assertThrows("function f() { export let x; }", SyntaxError);
-assertThrows("function f() { import x from 'http://url'; }", SyntaxError);
-
-assertThrows("function f() { { export let x; } }", SyntaxError);
-assertThrows("function f() { { import x from 'http://url'; } }", SyntaxError);
diff --git a/src/v8/test/mjsunit/harmony/modules-import-1.js b/src/v8/test/mjsunit/harmony/modules-import-1.js
deleted file mode 100644
index 7fd567f..0000000
--- a/src/v8/test/mjsunit/harmony/modules-import-1.js
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --harmony-dynamic-import
-
-var life;
-import('modules-skip-1.js').then(namespace => life = namespace.life());
-
-%RunMicrotasks();
-
-assertEquals(42, life);
diff --git a/src/v8/test/mjsunit/harmony/modules-import-10.js b/src/v8/test/mjsunit/harmony/modules-import-10.js
deleted file mode 100644
index 68e000a..0000000
--- a/src/v8/test/mjsunit/harmony/modules-import-10.js
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --harmony-dynamic-import
-
-var life;
-import('modules-skip-6.js').then(namespace => life = namespace.life);
-
-assertEquals(undefined, Object.life);
-
-%RunMicrotasks();
-
-assertEquals(42, Object.life);
-assertEquals("42", life);
diff --git a/src/v8/test/mjsunit/harmony/modules-import-11.js b/src/v8/test/mjsunit/harmony/modules-import-11.js
deleted file mode 100644
index a5afa10..0000000
--- a/src/v8/test/mjsunit/harmony/modules-import-11.js
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --harmony-dynamic-import
-
-var ran = false;
-
-async function test() {
-  try {
-    let namespace = await import('modules-skip-7.js');
-    let life = await namespace.getLife();
-    assertEquals(42, life);
-    ran = true;
-  } catch (e) {
-    %AbortJS('failure: ' + e);
-  }
-}
-
-test();
-%RunMicrotasks();
-assertTrue(ran);
diff --git a/src/v8/test/mjsunit/harmony/modules-import-12.js b/src/v8/test/mjsunit/harmony/modules-import-12.js
deleted file mode 100644
index bcb8569..0000000
--- a/src/v8/test/mjsunit/harmony/modules-import-12.js
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --harmony-dynamic-import
-
-ran = false;
-async function test() {
-  try {
-    let namespace = await import('modules-skip-empty.js');
-    ran = true;
-  } catch(e) {
-    %AbortJS('failure: '+ e);
-  }
-}
-
-test();
-%RunMicrotasks();
-assertTrue(ran);
diff --git a/src/v8/test/mjsunit/harmony/modules-import-13.js b/src/v8/test/mjsunit/harmony/modules-import-13.js
deleted file mode 100644
index 4001624..0000000
--- a/src/v8/test/mjsunit/harmony/modules-import-13.js
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --harmony-dynamic-import
-
-ran = false;
-async function test1() {
-  try {
-    let x = { toString() { return 'modules-skip-1.js' } };
-    let namespace = await import(x);
-    let life = namespace.life();
-    assertEquals(42, life);
-    ran = true;
-  } catch(e) {
-    %AbortJS('failure: '+ e);
-  }
-}
-
-test1();
-%RunMicrotasks();
-assertTrue(ran);
-
-ran = false;
-async function test2() {
-  try {
-    let x = { get toString() { return () => 'modules-skip-1.js' } };
-    let namespace = await import(x);
-    let life = namespace.life();
-    assertEquals(42, life);
-    ran = true;
-  } catch(e) {
-    %AbortJS('failure: '+ e);
-  }
-}
-
-test2();
-%RunMicrotasks();
-assertTrue(ran);
diff --git a/src/v8/test/mjsunit/harmony/modules-import-14.js b/src/v8/test/mjsunit/harmony/modules-import-14.js
deleted file mode 100644
index 3849c54..0000000
--- a/src/v8/test/mjsunit/harmony/modules-import-14.js
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --harmony-dynamic-import
-
-var ran = false;
-
-async function test() {
-  try {
-    let x = await import('modules-skip-1.js');
-    // modules-skip-5.js statically imports modules-skip-1.js
-    let y = await import('modules-skip-5.js');
-    assertSame(x, y.static_life);
-
-    let z = await import('modules-skip-1.js');
-    assertSame(x, z);
-    ran = true;
-  } catch(e) {
-    %AbortJS('failure: '+ e.message);
-  }
-}
-
-test();
-%RunMicrotasks();
-assertTrue(ran);
diff --git a/src/v8/test/mjsunit/harmony/modules-import-15.js b/src/v8/test/mjsunit/harmony/modules-import-15.js
deleted file mode 100644
index 32255ce..0000000
--- a/src/v8/test/mjsunit/harmony/modules-import-15.js
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --harmony-dynamic-import
-
-var ran = false;
-
-async function test1() {
-  try {
-    let x = await import('modules-skip-8.js');
-    %AbortJS('failure: should be unreachable');
-  } catch(e) {
-    assertEquals('Unexpected reserved word', e.message);
-    ran = true;
-  }
-}
-
-test1();
-%RunMicrotasks();
-assertTrue(ran);
-
-ran = false;
-
-async function test2() {
-  try {
-    let x = await import('modules-skip-9.js');
-    %AbortJS('failure: should be unreachable');
-  } catch(e) {
-    assertInstanceof(e, SyntaxError);
-    assertEquals(
-      "The requested module 'modules-skip-empty.js' does not provide an " +
-      "export named 'default'",
-      e.message);
-    ran = true;
-  }
-}
-
-test2();
-%RunMicrotasks();
-assertTrue(ran);
-
-ran = false;
-
-async function test3() {
-  try {
-    let x = await import('nonexistent-file.js');
-    %AbortJS('failure: should be unreachable');
-  } catch(e) {
-    assertTrue(e.startsWith('Error reading'));
-    ran = true;
-  }
-}
-
-test3();
-%RunMicrotasks();
-assertTrue(ran);
diff --git a/src/v8/test/mjsunit/harmony/modules-import-16.js b/src/v8/test/mjsunit/harmony/modules-import-16.js
deleted file mode 100644
index 94510d4..0000000
--- a/src/v8/test/mjsunit/harmony/modules-import-16.js
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --harmony-dynamic-import
-
-var ran = false;
-var x;
-
-var body = "import('modules-skip-1.js').then(ns => { x = ns.life();" +
-    " ran = true;} ).catch(err => %AbortJS(err))"
-var func = new Function(body);
-func();
-
-%RunMicrotasks();
-assertEquals(42, x);
-assertTrue(ran);
-
-var ran = false;
-var body = "import('modules-skip-1.js').then(ns => { x = ns.life();" +
-    " ran = true;} ).catch(err => %AbortJS(err))"
-eval("var func = new Function(body); func();");
-
-%RunMicrotasks();
-assertEquals(42, x);
-assertTrue(ran);
-
-var ran = false;
-var body = "eval(import('modules-skip-1.js').then(ns => { x = ns.life();" +
-    " ran = true;} ).catch(err => %AbortJS(err)))"
-var func = new Function(body);
-func();
-
-%RunMicrotasks();
-assertEquals(42, x);
-assertTrue(ran);
diff --git a/src/v8/test/mjsunit/harmony/modules-import-2.js b/src/v8/test/mjsunit/harmony/modules-import-2.js
deleted file mode 100644
index f50a5c8..0000000
--- a/src/v8/test/mjsunit/harmony/modules-import-2.js
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --harmony-dynamic-import
-
-var life;
-var msg;
-import('modules-skip-1.js').then(namespace => life = namespace.life());
-import('modules-skip-2.js').catch(err => msg = err.message);
-
-assertEquals(undefined, life);
-assertEquals(undefined, msg);
-
-%RunMicrotasks();
-
-assertEquals(42, life);
-assertEquals('42 is not the answer', msg);
diff --git a/src/v8/test/mjsunit/harmony/modules-import-3.js b/src/v8/test/mjsunit/harmony/modules-import-3.js
deleted file mode 100644
index 669f820..0000000
--- a/src/v8/test/mjsunit/harmony/modules-import-3.js
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --harmony-dynamic-import
-
-var ran = false;
-async function foo () {
-  try {
-    let life = await import('modules-skip-2.js');
-    assertUnreachable();
-  } catch(e) {
-    assertEquals('42 is not the answer', e.message);
-    ran = true;
-  }
-}
-
-foo();
-
-%RunMicrotasks();
-
-assertTrue(ran);
diff --git a/src/v8/test/mjsunit/harmony/modules-import-4.js b/src/v8/test/mjsunit/harmony/modules-import-4.js
deleted file mode 100644
index 38a80b3..0000000
--- a/src/v8/test/mjsunit/harmony/modules-import-4.js
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --harmony-dynamic-import
-
-try {
-  import(x);
-  let x;
-  assertUnreachable();
-} catch(e) {
-  assertEquals("ReferenceError", e.name);
-}
diff --git a/src/v8/test/mjsunit/harmony/modules-import-5.js b/src/v8/test/mjsunit/harmony/modules-import-5.js
deleted file mode 100644
index d923782..0000000
--- a/src/v8/test/mjsunit/harmony/modules-import-5.js
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --harmony-dynamic-import
-
-var life;
-let x = 'modules-skip-1.js';
-import(x).then(namespace => life = namespace.life());
-x = 'modules-skip-2.js';
-
-%RunMicrotasks();
-assertEquals(42, life);
diff --git a/src/v8/test/mjsunit/harmony/modules-import-6.js b/src/v8/test/mjsunit/harmony/modules-import-6.js
deleted file mode 100644
index 6a5b7c8..0000000
--- a/src/v8/test/mjsunit/harmony/modules-import-6.js
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --harmony-dynamic-import
-
-var ran = false;
-
-async function test() {
-  try {
-    let [namespace1, namespace2] = await Promise.all([
-      import('modules-skip-1.js'),
-      import('modules-skip-3.js')
-    ]);
-
-    let life = namespace1.life();
-    let stringlife = namespace2.stringlife;
-    assertEquals(42, life);
-    assertEquals("42", stringlife);
-    ran = true;
-  } catch(e) {
-    %AbortJS("failure: " + e);
-  }
-}
-
-test();
-
-%RunMicrotasks();
-assertTrue(ran);
diff --git a/src/v8/test/mjsunit/harmony/modules-import-7.js b/src/v8/test/mjsunit/harmony/modules-import-7.js
deleted file mode 100644
index d010511..0000000
--- a/src/v8/test/mjsunit/harmony/modules-import-7.js
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --harmony-dynamic-import
-
-var ran = false;
-
-async function test() {
-  try {
-    let namespace = await import('modules-skip-4.js');
-    assertEquals(42, namespace.life());
-    assertEquals("42", namespace.stringlife);
-    ran = true;
-  } catch(e) {
-    %AbortJS('failure: '+ e);
-  }
-}
-
-test();
-
-%RunMicrotasks();
-
-assertTrue(ran);
diff --git a/src/v8/test/mjsunit/harmony/modules-import-8.js b/src/v8/test/mjsunit/harmony/modules-import-8.js
deleted file mode 100644
index 4417f0e..0000000
--- a/src/v8/test/mjsunit/harmony/modules-import-8.js
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --harmony-dynamic-import
-
-var ran = false;
-
-var x = {
-  get toString() { return undefined; }
-};
-import(x);
-
-var x = {
-  toString() {
-    throw new Error('42 is the answer');
-  }
-};
-import(x);
-
-var x = {
-  get toString() {
-    throw new Error('42 is the answer');
-  }
-};
-import(x);
-
-async function test1() {
-  try {
-    let x = {
-      toString() {
-        throw new Error('42 is the answer');
-      }
-    };
-
-    let namespace = await import(x);
-    %AbortJS('failure: this should throw');
-  } catch(e) {
-    assertEquals(e.message, '42 is the answer');
-    ran = true;
-  }
-}
-
-test1();
-
-%RunMicrotasks();
-
-assertTrue(ran);
-
-ran = false;
-async function test2() {
-  try {
-    let x = {
-      get toString() {
-        throw new Error('42 is the answer');
-      }
-    };
-
-    let namespace = await import(x);
-    %AbortJS('failure: this should throw');
-  } catch(e) {
-    assertEquals(e.message, '42 is the answer');
-    ran = true;
-  }
-}
-
-test2();
-
-%RunMicrotasks();
-
-assertTrue(ran);
-
-ran = false;
-async function test3() {
-  try {
-    let x = {
-      get toString() { return undefined; }
-    };
-    let namespace = await import(x);
-    %AbortJS('failure: this should throw');
-  } catch(e) {
-    assertEquals(e.message, 'Cannot convert object to primitive value');
-    ran = true;
-  }
-}
-
-test3();
-
-%RunMicrotasks();
-
-assertTrue(ran);
diff --git a/src/v8/test/mjsunit/harmony/modules-import-9.js b/src/v8/test/mjsunit/harmony/modules-import-9.js
deleted file mode 100644
index b39c7a5..0000000
--- a/src/v8/test/mjsunit/harmony/modules-import-9.js
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --harmony-dynamic-import
-
-var ran = false;
-
-async function test() {
-  try {
-    let namespace = await import('modules-skip-5.js');
-    assertSame(namespace.static_life, namespace.dynamic_life);
-    assertSame(namespace.relative_static_life, namespace.dynamic_life);
-    ran = true;
-  } catch(e) {
-    %AbortJS('failure: ' + e);
-  }
-}
-
-test();
-%RunMicrotasks();
-assertTrue(ran);
diff --git a/src/v8/test/mjsunit/harmony/modules-import-large.js b/src/v8/test/mjsunit/harmony/modules-import-large.js
deleted file mode 100644
index 250a41b..0000000
--- a/src/v8/test/mjsunit/harmony/modules-import-large.js
+++ /dev/null
@@ -1,1120 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-// Flags: --allow-natives-syntax
-
-import * as m1 from "modules-skip-large1.js";
-import * as m2 from "modules-skip-large2.js";
-
-assertFalse(%HasFastProperties(m1));
-assertFalse(%HasFastProperties(m2));
-assertFalse(%HaveSameMap(m1, m2));
-
-function verify(m) {
-  assertEquals(m.a0, 0);
-  assertEquals(m.a1, 1);
-  assertEquals(m.a2, 2);
-  assertEquals(m.a3, 3);
-  assertEquals(m.a4, 4);
-  assertEquals(m.a5, 5);
-  assertEquals(m.a6, 6);
-  assertEquals(m.a7, 7);
-  assertEquals(m.a8, 8);
-  assertEquals(m.a9, 9);
-  assertEquals(m.a10, 10);
-  assertEquals(m.a11, 11);
-  assertEquals(m.a12, 12);
-  assertEquals(m.a13, 13);
-  assertEquals(m.a14, 14);
-  assertEquals(m.a15, 15);
-  assertEquals(m.a16, 16);
-  assertEquals(m.a17, 17);
-  assertEquals(m.a18, 18);
-  assertEquals(m.a19, 19);
-  assertEquals(m.a20, 20);
-  assertEquals(m.a21, 21);
-  assertEquals(m.a22, 22);
-  assertEquals(m.a23, 23);
-  assertEquals(m.a24, 24);
-  assertEquals(m.a25, 25);
-  assertEquals(m.a26, 26);
-  assertEquals(m.a27, 27);
-  assertEquals(m.a28, 28);
-  assertEquals(m.a29, 29);
-  assertEquals(m.a30, 30);
-  assertEquals(m.a31, 31);
-  assertEquals(m.a32, 32);
-  assertEquals(m.a33, 33);
-  assertEquals(m.a34, 34);
-  assertEquals(m.a35, 35);
-  assertEquals(m.a36, 36);
-  assertEquals(m.a37, 37);
-  assertEquals(m.a38, 38);
-  assertEquals(m.a39, 39);
-  assertEquals(m.a40, 40);
-  assertEquals(m.a41, 41);
-  assertEquals(m.a42, 42);
-  assertEquals(m.a43, 43);
-  assertEquals(m.a44, 44);
-  assertEquals(m.a45, 45);
-  assertEquals(m.a46, 46);
-  assertEquals(m.a47, 47);
-  assertEquals(m.a48, 48);
-  assertEquals(m.a49, 49);
-  assertEquals(m.a50, 50);
-  assertEquals(m.a51, 51);
-  assertEquals(m.a52, 52);
-  assertEquals(m.a53, 53);
-  assertEquals(m.a54, 54);
-  assertEquals(m.a55, 55);
-  assertEquals(m.a56, 56);
-  assertEquals(m.a57, 57);
-  assertEquals(m.a58, 58);
-  assertEquals(m.a59, 59);
-  assertEquals(m.a60, 60);
-  assertEquals(m.a61, 61);
-  assertEquals(m.a62, 62);
-  assertEquals(m.a63, 63);
-  assertEquals(m.a64, 64);
-  assertEquals(m.a65, 65);
-  assertEquals(m.a66, 66);
-  assertEquals(m.a67, 67);
-  assertEquals(m.a68, 68);
-  assertEquals(m.a69, 69);
-  assertEquals(m.a70, 70);
-  assertEquals(m.a71, 71);
-  assertEquals(m.a72, 72);
-  assertEquals(m.a73, 73);
-  assertEquals(m.a74, 74);
-  assertEquals(m.a75, 75);
-  assertEquals(m.a76, 76);
-  assertEquals(m.a77, 77);
-  assertEquals(m.a78, 78);
-  assertEquals(m.a79, 79);
-  assertEquals(m.a80, 80);
-  assertEquals(m.a81, 81);
-  assertEquals(m.a82, 82);
-  assertEquals(m.a83, 83);
-  assertEquals(m.a84, 84);
-  assertEquals(m.a85, 85);
-  assertEquals(m.a86, 86);
-  assertEquals(m.a87, 87);
-  assertEquals(m.a88, 88);
-  assertEquals(m.a89, 89);
-  assertEquals(m.a90, 90);
-  assertEquals(m.a91, 91);
-  assertEquals(m.a92, 92);
-  assertEquals(m.a93, 93);
-  assertEquals(m.a94, 94);
-  assertEquals(m.a95, 95);
-  assertEquals(m.a96, 96);
-  assertEquals(m.a97, 97);
-  assertEquals(m.a98, 98);
-  assertEquals(m.a99, 99);
-  assertEquals(m.a100, 100);
-  assertEquals(m.a101, 101);
-  assertEquals(m.a102, 102);
-  assertEquals(m.a103, 103);
-  assertEquals(m.a104, 104);
-  assertEquals(m.a105, 105);
-  assertEquals(m.a106, 106);
-  assertEquals(m.a107, 107);
-  assertEquals(m.a108, 108);
-  assertEquals(m.a109, 109);
-  assertEquals(m.a110, 110);
-  assertEquals(m.a111, 111);
-  assertEquals(m.a112, 112);
-  assertEquals(m.a113, 113);
-  assertEquals(m.a114, 114);
-  assertEquals(m.a115, 115);
-  assertEquals(m.a116, 116);
-  assertEquals(m.a117, 117);
-  assertEquals(m.a118, 118);
-  assertEquals(m.a119, 119);
-  assertEquals(m.a120, 120);
-  assertEquals(m.a121, 121);
-  assertEquals(m.a122, 122);
-  assertEquals(m.a123, 123);
-  assertEquals(m.a124, 124);
-  assertEquals(m.a125, 125);
-  assertEquals(m.a126, 126);
-  assertEquals(m.a127, 127);
-  assertEquals(m.a128, 128);
-  assertEquals(m.a129, 129);
-  assertEquals(m.a130, 130);
-  assertEquals(m.a131, 131);
-  assertEquals(m.a132, 132);
-  assertEquals(m.a133, 133);
-  assertEquals(m.a134, 134);
-  assertEquals(m.a135, 135);
-  assertEquals(m.a136, 136);
-  assertEquals(m.a137, 137);
-  assertEquals(m.a138, 138);
-  assertEquals(m.a139, 139);
-  assertEquals(m.a140, 140);
-  assertEquals(m.a141, 141);
-  assertEquals(m.a142, 142);
-  assertEquals(m.a143, 143);
-  assertEquals(m.a144, 144);
-  assertEquals(m.a145, 145);
-  assertEquals(m.a146, 146);
-  assertEquals(m.a147, 147);
-  assertEquals(m.a148, 148);
-  assertEquals(m.a149, 149);
-  assertEquals(m.a150, 150);
-  assertEquals(m.a151, 151);
-  assertEquals(m.a152, 152);
-  assertEquals(m.a153, 153);
-  assertEquals(m.a154, 154);
-  assertEquals(m.a155, 155);
-  assertEquals(m.a156, 156);
-  assertEquals(m.a157, 157);
-  assertEquals(m.a158, 158);
-  assertEquals(m.a159, 159);
-  assertEquals(m.a160, 160);
-  assertEquals(m.a161, 161);
-  assertEquals(m.a162, 162);
-  assertEquals(m.a163, 163);
-  assertEquals(m.a164, 164);
-  assertEquals(m.a165, 165);
-  assertEquals(m.a166, 166);
-  assertEquals(m.a167, 167);
-  assertEquals(m.a168, 168);
-  assertEquals(m.a169, 169);
-  assertEquals(m.a170, 170);
-  assertEquals(m.a171, 171);
-  assertEquals(m.a172, 172);
-  assertEquals(m.a173, 173);
-  assertEquals(m.a174, 174);
-  assertEquals(m.a175, 175);
-  assertEquals(m.a176, 176);
-  assertEquals(m.a177, 177);
-  assertEquals(m.a178, 178);
-  assertEquals(m.a179, 179);
-  assertEquals(m.a180, 180);
-  assertEquals(m.a181, 181);
-  assertEquals(m.a182, 182);
-  assertEquals(m.a183, 183);
-  assertEquals(m.a184, 184);
-  assertEquals(m.a185, 185);
-  assertEquals(m.a186, 186);
-  assertEquals(m.a187, 187);
-  assertEquals(m.a188, 188);
-  assertEquals(m.a189, 189);
-  assertEquals(m.a190, 190);
-  assertEquals(m.a191, 191);
-  assertEquals(m.a192, 192);
-  assertEquals(m.a193, 193);
-  assertEquals(m.a194, 194);
-  assertEquals(m.a195, 195);
-  assertEquals(m.a196, 196);
-  assertEquals(m.a197, 197);
-  assertEquals(m.a198, 198);
-  assertEquals(m.a199, 199);
-  assertEquals(m.a200, 200);
-  assertEquals(m.a201, 201);
-  assertEquals(m.a202, 202);
-  assertEquals(m.a203, 203);
-  assertEquals(m.a204, 204);
-  assertEquals(m.a205, 205);
-  assertEquals(m.a206, 206);
-  assertEquals(m.a207, 207);
-  assertEquals(m.a208, 208);
-  assertEquals(m.a209, 209);
-  assertEquals(m.a210, 210);
-  assertEquals(m.a211, 211);
-  assertEquals(m.a212, 212);
-  assertEquals(m.a213, 213);
-  assertEquals(m.a214, 214);
-  assertEquals(m.a215, 215);
-  assertEquals(m.a216, 216);
-  assertEquals(m.a217, 217);
-  assertEquals(m.a218, 218);
-  assertEquals(m.a219, 219);
-  assertEquals(m.a220, 220);
-  assertEquals(m.a221, 221);
-  assertEquals(m.a222, 222);
-  assertEquals(m.a223, 223);
-  assertEquals(m.a224, 224);
-  assertEquals(m.a225, 225);
-  assertEquals(m.a226, 226);
-  assertEquals(m.a227, 227);
-  assertEquals(m.a228, 228);
-  assertEquals(m.a229, 229);
-  assertEquals(m.a230, 230);
-  assertEquals(m.a231, 231);
-  assertEquals(m.a232, 232);
-  assertEquals(m.a233, 233);
-  assertEquals(m.a234, 234);
-  assertEquals(m.a235, 235);
-  assertEquals(m.a236, 236);
-  assertEquals(m.a237, 237);
-  assertEquals(m.a238, 238);
-  assertEquals(m.a239, 239);
-  assertEquals(m.a240, 240);
-  assertEquals(m.a241, 241);
-  assertEquals(m.a242, 242);
-  assertEquals(m.a243, 243);
-  assertEquals(m.a244, 244);
-  assertEquals(m.a245, 245);
-  assertEquals(m.a246, 246);
-  assertEquals(m.a247, 247);
-  assertEquals(m.a248, 248);
-  assertEquals(m.a249, 249);
-  assertEquals(m.a250, 250);
-  assertEquals(m.a251, 251);
-  assertEquals(m.a252, 252);
-  assertEquals(m.a253, 253);
-  assertEquals(m.a254, 254);
-  assertEquals(m.a255, 255);
-  assertEquals(m.a256, 256);
-  assertEquals(m.a257, 257);
-  assertEquals(m.a258, 258);
-  assertEquals(m.a259, 259);
-  assertEquals(m.a260, 260);
-  assertEquals(m.a261, 261);
-  assertEquals(m.a262, 262);
-  assertEquals(m.a263, 263);
-  assertEquals(m.a264, 264);
-  assertEquals(m.a265, 265);
-  assertEquals(m.a266, 266);
-  assertEquals(m.a267, 267);
-  assertEquals(m.a268, 268);
-  assertEquals(m.a269, 269);
-  assertEquals(m.a270, 270);
-  assertEquals(m.a271, 271);
-  assertEquals(m.a272, 272);
-  assertEquals(m.a273, 273);
-  assertEquals(m.a274, 274);
-  assertEquals(m.a275, 275);
-  assertEquals(m.a276, 276);
-  assertEquals(m.a277, 277);
-  assertEquals(m.a278, 278);
-  assertEquals(m.a279, 279);
-  assertEquals(m.a280, 280);
-  assertEquals(m.a281, 281);
-  assertEquals(m.a282, 282);
-  assertEquals(m.a283, 283);
-  assertEquals(m.a284, 284);
-  assertEquals(m.a285, 285);
-  assertEquals(m.a286, 286);
-  assertEquals(m.a287, 287);
-  assertEquals(m.a288, 288);
-  assertEquals(m.a289, 289);
-  assertEquals(m.a290, 290);
-  assertEquals(m.a291, 291);
-  assertEquals(m.a292, 292);
-  assertEquals(m.a293, 293);
-  assertEquals(m.a294, 294);
-  assertEquals(m.a295, 295);
-  assertEquals(m.a296, 296);
-  assertEquals(m.a297, 297);
-  assertEquals(m.a298, 298);
-  assertEquals(m.a299, 299);
-  assertEquals(m.a300, 300);
-  assertEquals(m.a301, 301);
-  assertEquals(m.a302, 302);
-  assertEquals(m.a303, 303);
-  assertEquals(m.a304, 304);
-  assertEquals(m.a305, 305);
-  assertEquals(m.a306, 306);
-  assertEquals(m.a307, 307);
-  assertEquals(m.a308, 308);
-  assertEquals(m.a309, 309);
-  assertEquals(m.a310, 310);
-  assertEquals(m.a311, 311);
-  assertEquals(m.a312, 312);
-  assertEquals(m.a313, 313);
-  assertEquals(m.a314, 314);
-  assertEquals(m.a315, 315);
-  assertEquals(m.a316, 316);
-  assertEquals(m.a317, 317);
-  assertEquals(m.a318, 318);
-  assertEquals(m.a319, 319);
-  assertEquals(m.a320, 320);
-  assertEquals(m.a321, 321);
-  assertEquals(m.a322, 322);
-  assertEquals(m.a323, 323);
-  assertEquals(m.a324, 324);
-  assertEquals(m.a325, 325);
-  assertEquals(m.a326, 326);
-  assertEquals(m.a327, 327);
-  assertEquals(m.a328, 328);
-  assertEquals(m.a329, 329);
-  assertEquals(m.a330, 330);
-  assertEquals(m.a331, 331);
-  assertEquals(m.a332, 332);
-  assertEquals(m.a333, 333);
-  assertEquals(m.a334, 334);
-  assertEquals(m.a335, 335);
-  assertEquals(m.a336, 336);
-  assertEquals(m.a337, 337);
-  assertEquals(m.a338, 338);
-  assertEquals(m.a339, 339);
-  assertEquals(m.a340, 340);
-  assertEquals(m.a341, 341);
-  assertEquals(m.a342, 342);
-  assertEquals(m.a343, 343);
-  assertEquals(m.a344, 344);
-  assertEquals(m.a345, 345);
-  assertEquals(m.a346, 346);
-  assertEquals(m.a347, 347);
-  assertEquals(m.a348, 348);
-  assertEquals(m.a349, 349);
-  assertEquals(m.a350, 350);
-  assertEquals(m.a351, 351);
-  assertEquals(m.a352, 352);
-  assertEquals(m.a353, 353);
-  assertEquals(m.a354, 354);
-  assertEquals(m.a355, 355);
-  assertEquals(m.a356, 356);
-  assertEquals(m.a357, 357);
-  assertEquals(m.a358, 358);
-  assertEquals(m.a359, 359);
-  assertEquals(m.a360, 360);
-  assertEquals(m.a361, 361);
-  assertEquals(m.a362, 362);
-  assertEquals(m.a363, 363);
-  assertEquals(m.a364, 364);
-  assertEquals(m.a365, 365);
-  assertEquals(m.a366, 366);
-  assertEquals(m.a367, 367);
-  assertEquals(m.a368, 368);
-  assertEquals(m.a369, 369);
-  assertEquals(m.a370, 370);
-  assertEquals(m.a371, 371);
-  assertEquals(m.a372, 372);
-  assertEquals(m.a373, 373);
-  assertEquals(m.a374, 374);
-  assertEquals(m.a375, 375);
-  assertEquals(m.a376, 376);
-  assertEquals(m.a377, 377);
-  assertEquals(m.a378, 378);
-  assertEquals(m.a379, 379);
-  assertEquals(m.a380, 380);
-  assertEquals(m.a381, 381);
-  assertEquals(m.a382, 382);
-  assertEquals(m.a383, 383);
-  assertEquals(m.a384, 384);
-  assertEquals(m.a385, 385);
-  assertEquals(m.a386, 386);
-  assertEquals(m.a387, 387);
-  assertEquals(m.a388, 388);
-  assertEquals(m.a389, 389);
-  assertEquals(m.a390, 390);
-  assertEquals(m.a391, 391);
-  assertEquals(m.a392, 392);
-  assertEquals(m.a393, 393);
-  assertEquals(m.a394, 394);
-  assertEquals(m.a395, 395);
-  assertEquals(m.a396, 396);
-  assertEquals(m.a397, 397);
-  assertEquals(m.a398, 398);
-  assertEquals(m.a399, 399);
-  assertEquals(m.a400, 400);
-  assertEquals(m.a401, 401);
-  assertEquals(m.a402, 402);
-  assertEquals(m.a403, 403);
-  assertEquals(m.a404, 404);
-  assertEquals(m.a405, 405);
-  assertEquals(m.a406, 406);
-  assertEquals(m.a407, 407);
-  assertEquals(m.a408, 408);
-  assertEquals(m.a409, 409);
-  assertEquals(m.a410, 410);
-  assertEquals(m.a411, 411);
-  assertEquals(m.a412, 412);
-  assertEquals(m.a413, 413);
-  assertEquals(m.a414, 414);
-  assertEquals(m.a415, 415);
-  assertEquals(m.a416, 416);
-  assertEquals(m.a417, 417);
-  assertEquals(m.a418, 418);
-  assertEquals(m.a419, 419);
-  assertEquals(m.a420, 420);
-  assertEquals(m.a421, 421);
-  assertEquals(m.a422, 422);
-  assertEquals(m.a423, 423);
-  assertEquals(m.a424, 424);
-  assertEquals(m.a425, 425);
-  assertEquals(m.a426, 426);
-  assertEquals(m.a427, 427);
-  assertEquals(m.a428, 428);
-  assertEquals(m.a429, 429);
-  assertEquals(m.a430, 430);
-  assertEquals(m.a431, 431);
-  assertEquals(m.a432, 432);
-  assertEquals(m.a433, 433);
-  assertEquals(m.a434, 434);
-  assertEquals(m.a435, 435);
-  assertEquals(m.a436, 436);
-  assertEquals(m.a437, 437);
-  assertEquals(m.a438, 438);
-  assertEquals(m.a439, 439);
-  assertEquals(m.a440, 440);
-  assertEquals(m.a441, 441);
-  assertEquals(m.a442, 442);
-  assertEquals(m.a443, 443);
-  assertEquals(m.a444, 444);
-  assertEquals(m.a445, 445);
-  assertEquals(m.a446, 446);
-  assertEquals(m.a447, 447);
-  assertEquals(m.a448, 448);
-  assertEquals(m.a449, 449);
-  assertEquals(m.a450, 450);
-  assertEquals(m.a451, 451);
-  assertEquals(m.a452, 452);
-  assertEquals(m.a453, 453);
-  assertEquals(m.a454, 454);
-  assertEquals(m.a455, 455);
-  assertEquals(m.a456, 456);
-  assertEquals(m.a457, 457);
-  assertEquals(m.a458, 458);
-  assertEquals(m.a459, 459);
-  assertEquals(m.a460, 460);
-  assertEquals(m.a461, 461);
-  assertEquals(m.a462, 462);
-  assertEquals(m.a463, 463);
-  assertEquals(m.a464, 464);
-  assertEquals(m.a465, 465);
-  assertEquals(m.a466, 466);
-  assertEquals(m.a467, 467);
-  assertEquals(m.a468, 468);
-  assertEquals(m.a469, 469);
-  assertEquals(m.a470, 470);
-  assertEquals(m.a471, 471);
-  assertEquals(m.a472, 472);
-  assertEquals(m.a473, 473);
-  assertEquals(m.a474, 474);
-  assertEquals(m.a475, 475);
-  assertEquals(m.a476, 476);
-  assertEquals(m.a477, 477);
-  assertEquals(m.a478, 478);
-  assertEquals(m.a479, 479);
-  assertEquals(m.a480, 480);
-  assertEquals(m.a481, 481);
-  assertEquals(m.a482, 482);
-  assertEquals(m.a483, 483);
-  assertEquals(m.a484, 484);
-  assertEquals(m.a485, 485);
-  assertEquals(m.a486, 486);
-  assertEquals(m.a487, 487);
-  assertEquals(m.a488, 488);
-  assertEquals(m.a489, 489);
-  assertEquals(m.a490, 490);
-  assertEquals(m.a491, 491);
-  assertEquals(m.a492, 492);
-  assertEquals(m.a493, 493);
-  assertEquals(m.a494, 494);
-  assertEquals(m.a495, 495);
-  assertEquals(m.a496, 496);
-  assertEquals(m.a497, 497);
-  assertEquals(m.a498, 498);
-  assertEquals(m.a499, 499);
-  assertEquals(m.a500, 500);
-  assertEquals(m.a501, 501);
-  assertEquals(m.a502, 502);
-  assertEquals(m.a503, 503);
-  assertEquals(m.a504, 504);
-  assertEquals(m.a505, 505);
-  assertEquals(m.a506, 506);
-  assertEquals(m.a507, 507);
-  assertEquals(m.a508, 508);
-  assertEquals(m.a509, 509);
-  assertEquals(m.a510, 510);
-  assertEquals(m.a511, 511);
-  assertEquals(m.a512, 512);
-  assertEquals(m.a513, 513);
-  assertEquals(m.a514, 514);
-  assertEquals(m.a515, 515);
-  assertEquals(m.a516, 516);
-  assertEquals(m.a517, 517);
-  assertEquals(m.a518, 518);
-  assertEquals(m.a519, 519);
-  assertEquals(m.a520, 520);
-  assertEquals(m.a521, 521);
-  assertEquals(m.a522, 522);
-  assertEquals(m.a523, 523);
-  assertEquals(m.a524, 524);
-  assertEquals(m.a525, 525);
-  assertEquals(m.a526, 526);
-  assertEquals(m.a527, 527);
-  assertEquals(m.a528, 528);
-  assertEquals(m.a529, 529);
-  assertEquals(m.a530, 530);
-  assertEquals(m.a531, 531);
-  assertEquals(m.a532, 532);
-  assertEquals(m.a533, 533);
-  assertEquals(m.a534, 534);
-  assertEquals(m.a535, 535);
-  assertEquals(m.a536, 536);
-  assertEquals(m.a537, 537);
-  assertEquals(m.a538, 538);
-  assertEquals(m.a539, 539);
-  assertEquals(m.a540, 540);
-  assertEquals(m.a541, 541);
-  assertEquals(m.a542, 542);
-  assertEquals(m.a543, 543);
-  assertEquals(m.a544, 544);
-  assertEquals(m.a545, 545);
-  assertEquals(m.a546, 546);
-  assertEquals(m.a547, 547);
-  assertEquals(m.a548, 548);
-  assertEquals(m.a549, 549);
-  assertEquals(m.a550, 550);
-  assertEquals(m.a551, 551);
-  assertEquals(m.a552, 552);
-  assertEquals(m.a553, 553);
-  assertEquals(m.a554, 554);
-  assertEquals(m.a555, 555);
-  assertEquals(m.a556, 556);
-  assertEquals(m.a557, 557);
-  assertEquals(m.a558, 558);
-  assertEquals(m.a559, 559);
-  assertEquals(m.a560, 560);
-  assertEquals(m.a561, 561);
-  assertEquals(m.a562, 562);
-  assertEquals(m.a563, 563);
-  assertEquals(m.a564, 564);
-  assertEquals(m.a565, 565);
-  assertEquals(m.a566, 566);
-  assertEquals(m.a567, 567);
-  assertEquals(m.a568, 568);
-  assertEquals(m.a569, 569);
-  assertEquals(m.a570, 570);
-  assertEquals(m.a571, 571);
-  assertEquals(m.a572, 572);
-  assertEquals(m.a573, 573);
-  assertEquals(m.a574, 574);
-  assertEquals(m.a575, 575);
-  assertEquals(m.a576, 576);
-  assertEquals(m.a577, 577);
-  assertEquals(m.a578, 578);
-  assertEquals(m.a579, 579);
-  assertEquals(m.a580, 580);
-  assertEquals(m.a581, 581);
-  assertEquals(m.a582, 582);
-  assertEquals(m.a583, 583);
-  assertEquals(m.a584, 584);
-  assertEquals(m.a585, 585);
-  assertEquals(m.a586, 586);
-  assertEquals(m.a587, 587);
-  assertEquals(m.a588, 588);
-  assertEquals(m.a589, 589);
-  assertEquals(m.a590, 590);
-  assertEquals(m.a591, 591);
-  assertEquals(m.a592, 592);
-  assertEquals(m.a593, 593);
-  assertEquals(m.a594, 594);
-  assertEquals(m.a595, 595);
-  assertEquals(m.a596, 596);
-  assertEquals(m.a597, 597);
-  assertEquals(m.a598, 598);
-  assertEquals(m.a599, 599);
-  assertEquals(m.a600, 600);
-  assertEquals(m.a601, 601);
-  assertEquals(m.a602, 602);
-  assertEquals(m.a603, 603);
-  assertEquals(m.a604, 604);
-  assertEquals(m.a605, 605);
-  assertEquals(m.a606, 606);
-  assertEquals(m.a607, 607);
-  assertEquals(m.a608, 608);
-  assertEquals(m.a609, 609);
-  assertEquals(m.a610, 610);
-  assertEquals(m.a611, 611);
-  assertEquals(m.a612, 612);
-  assertEquals(m.a613, 613);
-  assertEquals(m.a614, 614);
-  assertEquals(m.a615, 615);
-  assertEquals(m.a616, 616);
-  assertEquals(m.a617, 617);
-  assertEquals(m.a618, 618);
-  assertEquals(m.a619, 619);
-  assertEquals(m.a620, 620);
-  assertEquals(m.a621, 621);
-  assertEquals(m.a622, 622);
-  assertEquals(m.a623, 623);
-  assertEquals(m.a624, 624);
-  assertEquals(m.a625, 625);
-  assertEquals(m.a626, 626);
-  assertEquals(m.a627, 627);
-  assertEquals(m.a628, 628);
-  assertEquals(m.a629, 629);
-  assertEquals(m.a630, 630);
-  assertEquals(m.a631, 631);
-  assertEquals(m.a632, 632);
-  assertEquals(m.a633, 633);
-  assertEquals(m.a634, 634);
-  assertEquals(m.a635, 635);
-  assertEquals(m.a636, 636);
-  assertEquals(m.a637, 637);
-  assertEquals(m.a638, 638);
-  assertEquals(m.a639, 639);
-  assertEquals(m.a640, 640);
-  assertEquals(m.a641, 641);
-  assertEquals(m.a642, 642);
-  assertEquals(m.a643, 643);
-  assertEquals(m.a644, 644);
-  assertEquals(m.a645, 645);
-  assertEquals(m.a646, 646);
-  assertEquals(m.a647, 647);
-  assertEquals(m.a648, 648);
-  assertEquals(m.a649, 649);
-  assertEquals(m.a650, 650);
-  assertEquals(m.a651, 651);
-  assertEquals(m.a652, 652);
-  assertEquals(m.a653, 653);
-  assertEquals(m.a654, 654);
-  assertEquals(m.a655, 655);
-  assertEquals(m.a656, 656);
-  assertEquals(m.a657, 657);
-  assertEquals(m.a658, 658);
-  assertEquals(m.a659, 659);
-  assertEquals(m.a660, 660);
-  assertEquals(m.a661, 661);
-  assertEquals(m.a662, 662);
-  assertEquals(m.a663, 663);
-  assertEquals(m.a664, 664);
-  assertEquals(m.a665, 665);
-  assertEquals(m.a666, 666);
-  assertEquals(m.a667, 667);
-  assertEquals(m.a668, 668);
-  assertEquals(m.a669, 669);
-  assertEquals(m.a670, 670);
-  assertEquals(m.a671, 671);
-  assertEquals(m.a672, 672);
-  assertEquals(m.a673, 673);
-  assertEquals(m.a674, 674);
-  assertEquals(m.a675, 675);
-  assertEquals(m.a676, 676);
-  assertEquals(m.a677, 677);
-  assertEquals(m.a678, 678);
-  assertEquals(m.a679, 679);
-  assertEquals(m.a680, 680);
-  assertEquals(m.a681, 681);
-  assertEquals(m.a682, 682);
-  assertEquals(m.a683, 683);
-  assertEquals(m.a684, 684);
-  assertEquals(m.a685, 685);
-  assertEquals(m.a686, 686);
-  assertEquals(m.a687, 687);
-  assertEquals(m.a688, 688);
-  assertEquals(m.a689, 689);
-  assertEquals(m.a690, 690);
-  assertEquals(m.a691, 691);
-  assertEquals(m.a692, 692);
-  assertEquals(m.a693, 693);
-  assertEquals(m.a694, 694);
-  assertEquals(m.a695, 695);
-  assertEquals(m.a696, 696);
-  assertEquals(m.a697, 697);
-  assertEquals(m.a698, 698);
-  assertEquals(m.a699, 699);
-  assertEquals(m.a700, 700);
-  assertEquals(m.a701, 701);
-  assertEquals(m.a702, 702);
-  assertEquals(m.a703, 703);
-  assertEquals(m.a704, 704);
-  assertEquals(m.a705, 705);
-  assertEquals(m.a706, 706);
-  assertEquals(m.a707, 707);
-  assertEquals(m.a708, 708);
-  assertEquals(m.a709, 709);
-  assertEquals(m.a710, 710);
-  assertEquals(m.a711, 711);
-  assertEquals(m.a712, 712);
-  assertEquals(m.a713, 713);
-  assertEquals(m.a714, 714);
-  assertEquals(m.a715, 715);
-  assertEquals(m.a716, 716);
-  assertEquals(m.a717, 717);
-  assertEquals(m.a718, 718);
-  assertEquals(m.a719, 719);
-  assertEquals(m.a720, 720);
-  assertEquals(m.a721, 721);
-  assertEquals(m.a722, 722);
-  assertEquals(m.a723, 723);
-  assertEquals(m.a724, 724);
-  assertEquals(m.a725, 725);
-  assertEquals(m.a726, 726);
-  assertEquals(m.a727, 727);
-  assertEquals(m.a728, 728);
-  assertEquals(m.a729, 729);
-  assertEquals(m.a730, 730);
-  assertEquals(m.a731, 731);
-  assertEquals(m.a732, 732);
-  assertEquals(m.a733, 733);
-  assertEquals(m.a734, 734);
-  assertEquals(m.a735, 735);
-  assertEquals(m.a736, 736);
-  assertEquals(m.a737, 737);
-  assertEquals(m.a738, 738);
-  assertEquals(m.a739, 739);
-  assertEquals(m.a740, 740);
-  assertEquals(m.a741, 741);
-  assertEquals(m.a742, 742);
-  assertEquals(m.a743, 743);
-  assertEquals(m.a744, 744);
-  assertEquals(m.a745, 745);
-  assertEquals(m.a746, 746);
-  assertEquals(m.a747, 747);
-  assertEquals(m.a748, 748);
-  assertEquals(m.a749, 749);
-  assertEquals(m.a750, 750);
-  assertEquals(m.a751, 751);
-  assertEquals(m.a752, 752);
-  assertEquals(m.a753, 753);
-  assertEquals(m.a754, 754);
-  assertEquals(m.a755, 755);
-  assertEquals(m.a756, 756);
-  assertEquals(m.a757, 757);
-  assertEquals(m.a758, 758);
-  assertEquals(m.a759, 759);
-  assertEquals(m.a760, 760);
-  assertEquals(m.a761, 761);
-  assertEquals(m.a762, 762);
-  assertEquals(m.a763, 763);
-  assertEquals(m.a764, 764);
-  assertEquals(m.a765, 765);
-  assertEquals(m.a766, 766);
-  assertEquals(m.a767, 767);
-  assertEquals(m.a768, 768);
-  assertEquals(m.a769, 769);
-  assertEquals(m.a770, 770);
-  assertEquals(m.a771, 771);
-  assertEquals(m.a772, 772);
-  assertEquals(m.a773, 773);
-  assertEquals(m.a774, 774);
-  assertEquals(m.a775, 775);
-  assertEquals(m.a776, 776);
-  assertEquals(m.a777, 777);
-  assertEquals(m.a778, 778);
-  assertEquals(m.a779, 779);
-  assertEquals(m.a780, 780);
-  assertEquals(m.a781, 781);
-  assertEquals(m.a782, 782);
-  assertEquals(m.a783, 783);
-  assertEquals(m.a784, 784);
-  assertEquals(m.a785, 785);
-  assertEquals(m.a786, 786);
-  assertEquals(m.a787, 787);
-  assertEquals(m.a788, 788);
-  assertEquals(m.a789, 789);
-  assertEquals(m.a790, 790);
-  assertEquals(m.a791, 791);
-  assertEquals(m.a792, 792);
-  assertEquals(m.a793, 793);
-  assertEquals(m.a794, 794);
-  assertEquals(m.a795, 795);
-  assertEquals(m.a796, 796);
-  assertEquals(m.a797, 797);
-  assertEquals(m.a798, 798);
-  assertEquals(m.a799, 799);
-  assertEquals(m.a800, 800);
-  assertEquals(m.a801, 801);
-  assertEquals(m.a802, 802);
-  assertEquals(m.a803, 803);
-  assertEquals(m.a804, 804);
-  assertEquals(m.a805, 805);
-  assertEquals(m.a806, 806);
-  assertEquals(m.a807, 807);
-  assertEquals(m.a808, 808);
-  assertEquals(m.a809, 809);
-  assertEquals(m.a810, 810);
-  assertEquals(m.a811, 811);
-  assertEquals(m.a812, 812);
-  assertEquals(m.a813, 813);
-  assertEquals(m.a814, 814);
-  assertEquals(m.a815, 815);
-  assertEquals(m.a816, 816);
-  assertEquals(m.a817, 817);
-  assertEquals(m.a818, 818);
-  assertEquals(m.a819, 819);
-  assertEquals(m.a820, 820);
-  assertEquals(m.a821, 821);
-  assertEquals(m.a822, 822);
-  assertEquals(m.a823, 823);
-  assertEquals(m.a824, 824);
-  assertEquals(m.a825, 825);
-  assertEquals(m.a826, 826);
-  assertEquals(m.a827, 827);
-  assertEquals(m.a828, 828);
-  assertEquals(m.a829, 829);
-  assertEquals(m.a830, 830);
-  assertEquals(m.a831, 831);
-  assertEquals(m.a832, 832);
-  assertEquals(m.a833, 833);
-  assertEquals(m.a834, 834);
-  assertEquals(m.a835, 835);
-  assertEquals(m.a836, 836);
-  assertEquals(m.a837, 837);
-  assertEquals(m.a838, 838);
-  assertEquals(m.a839, 839);
-  assertEquals(m.a840, 840);
-  assertEquals(m.a841, 841);
-  assertEquals(m.a842, 842);
-  assertEquals(m.a843, 843);
-  assertEquals(m.a844, 844);
-  assertEquals(m.a845, 845);
-  assertEquals(m.a846, 846);
-  assertEquals(m.a847, 847);
-  assertEquals(m.a848, 848);
-  assertEquals(m.a849, 849);
-  assertEquals(m.a850, 850);
-  assertEquals(m.a851, 851);
-  assertEquals(m.a852, 852);
-  assertEquals(m.a853, 853);
-  assertEquals(m.a854, 854);
-  assertEquals(m.a855, 855);
-  assertEquals(m.a856, 856);
-  assertEquals(m.a857, 857);
-  assertEquals(m.a858, 858);
-  assertEquals(m.a859, 859);
-  assertEquals(m.a860, 860);
-  assertEquals(m.a861, 861);
-  assertEquals(m.a862, 862);
-  assertEquals(m.a863, 863);
-  assertEquals(m.a864, 864);
-  assertEquals(m.a865, 865);
-  assertEquals(m.a866, 866);
-  assertEquals(m.a867, 867);
-  assertEquals(m.a868, 868);
-  assertEquals(m.a869, 869);
-  assertEquals(m.a870, 870);
-  assertEquals(m.a871, 871);
-  assertEquals(m.a872, 872);
-  assertEquals(m.a873, 873);
-  assertEquals(m.a874, 874);
-  assertEquals(m.a875, 875);
-  assertEquals(m.a876, 876);
-  assertEquals(m.a877, 877);
-  assertEquals(m.a878, 878);
-  assertEquals(m.a879, 879);
-  assertEquals(m.a880, 880);
-  assertEquals(m.a881, 881);
-  assertEquals(m.a882, 882);
-  assertEquals(m.a883, 883);
-  assertEquals(m.a884, 884);
-  assertEquals(m.a885, 885);
-  assertEquals(m.a886, 886);
-  assertEquals(m.a887, 887);
-  assertEquals(m.a888, 888);
-  assertEquals(m.a889, 889);
-  assertEquals(m.a890, 890);
-  assertEquals(m.a891, 891);
-  assertEquals(m.a892, 892);
-  assertEquals(m.a893, 893);
-  assertEquals(m.a894, 894);
-  assertEquals(m.a895, 895);
-  assertEquals(m.a896, 896);
-  assertEquals(m.a897, 897);
-  assertEquals(m.a898, 898);
-  assertEquals(m.a899, 899);
-  assertEquals(m.a900, 900);
-  assertEquals(m.a901, 901);
-  assertEquals(m.a902, 902);
-  assertEquals(m.a903, 903);
-  assertEquals(m.a904, 904);
-  assertEquals(m.a905, 905);
-  assertEquals(m.a906, 906);
-  assertEquals(m.a907, 907);
-  assertEquals(m.a908, 908);
-  assertEquals(m.a909, 909);
-  assertEquals(m.a910, 910);
-  assertEquals(m.a911, 911);
-  assertEquals(m.a912, 912);
-  assertEquals(m.a913, 913);
-  assertEquals(m.a914, 914);
-  assertEquals(m.a915, 915);
-  assertEquals(m.a916, 916);
-  assertEquals(m.a917, 917);
-  assertEquals(m.a918, 918);
-  assertEquals(m.a919, 919);
-  assertEquals(m.a920, 920);
-  assertEquals(m.a921, 921);
-  assertEquals(m.a922, 922);
-  assertEquals(m.a923, 923);
-  assertEquals(m.a924, 924);
-  assertEquals(m.a925, 925);
-  assertEquals(m.a926, 926);
-  assertEquals(m.a927, 927);
-  assertEquals(m.a928, 928);
-  assertEquals(m.a929, 929);
-  assertEquals(m.a930, 930);
-  assertEquals(m.a931, 931);
-  assertEquals(m.a932, 932);
-  assertEquals(m.a933, 933);
-  assertEquals(m.a934, 934);
-  assertEquals(m.a935, 935);
-  assertEquals(m.a936, 936);
-  assertEquals(m.a937, 937);
-  assertEquals(m.a938, 938);
-  assertEquals(m.a939, 939);
-  assertEquals(m.a940, 940);
-  assertEquals(m.a941, 941);
-  assertEquals(m.a942, 942);
-  assertEquals(m.a943, 943);
-  assertEquals(m.a944, 944);
-  assertEquals(m.a945, 945);
-  assertEquals(m.a946, 946);
-  assertEquals(m.a947, 947);
-  assertEquals(m.a948, 948);
-  assertEquals(m.a949, 949);
-  assertEquals(m.a950, 950);
-  assertEquals(m.a951, 951);
-  assertEquals(m.a952, 952);
-  assertEquals(m.a953, 953);
-  assertEquals(m.a954, 954);
-  assertEquals(m.a955, 955);
-  assertEquals(m.a956, 956);
-  assertEquals(m.a957, 957);
-  assertEquals(m.a958, 958);
-  assertEquals(m.a959, 959);
-  assertEquals(m.a960, 960);
-  assertEquals(m.a961, 961);
-  assertEquals(m.a962, 962);
-  assertEquals(m.a963, 963);
-  assertEquals(m.a964, 964);
-  assertEquals(m.a965, 965);
-  assertEquals(m.a966, 966);
-  assertEquals(m.a967, 967);
-  assertEquals(m.a968, 968);
-  assertEquals(m.a969, 969);
-  assertEquals(m.a970, 970);
-  assertEquals(m.a971, 971);
-  assertEquals(m.a972, 972);
-  assertEquals(m.a973, 973);
-  assertEquals(m.a974, 974);
-  assertEquals(m.a975, 975);
-  assertEquals(m.a976, 976);
-  assertEquals(m.a977, 977);
-  assertEquals(m.a978, 978);
-  assertEquals(m.a979, 979);
-  assertEquals(m.a980, 980);
-  assertEquals(m.a981, 981);
-  assertEquals(m.a982, 982);
-  assertEquals(m.a983, 983);
-  assertEquals(m.a984, 984);
-  assertEquals(m.a985, 985);
-  assertEquals(m.a986, 986);
-  assertEquals(m.a987, 987);
-  assertEquals(m.a988, 988);
-  assertEquals(m.a989, 989);
-  assertEquals(m.a990, 990);
-  assertEquals(m.a991, 991);
-  assertEquals(m.a992, 992);
-  assertEquals(m.a993, 993);
-  assertEquals(m.a994, 994);
-  assertEquals(m.a995, 995);
-  assertEquals(m.a996, 996);
-  assertEquals(m.a997, 997);
-  assertEquals(m.a998, 998);
-  assertEquals(m.a999, 999);
-  assertEquals(m.a1000, 1000);
-  assertEquals(m.a1001, 1001);
-  assertEquals(m.a1002, 1002);
-  assertEquals(m.a1003, 1003);
-  assertEquals(m.a1004, 1004);
-  assertEquals(m.a1005, 1005);
-  assertEquals(m.a1006, 1006);
-  assertEquals(m.a1007, 1007);
-  assertEquals(m.a1008, 1008);
-  assertEquals(m.a1009, 1009);
-  assertEquals(m.a1010, 1010);
-  assertEquals(m.a1011, 1011);
-  assertEquals(m.a1012, 1012);
-  assertEquals(m.a1013, 1013);
-  assertEquals(m.a1014, 1014);
-  assertEquals(m.a1015, 1015);
-  assertEquals(m.a1016, 1016);
-  assertEquals(m.a1017, 1017);
-  assertEquals(m.a1018, 1018);
-  assertEquals(m.a1019, 1019);
-  assertEquals(m.a1020, 1020);
-  assertEquals(m.a1021, 1021);
-  assertEquals(m.a1022, 1022);
-  assertEquals(m.a1023, 1023);
-  assertEquals(m.a1024, 1024);
-  assertEquals(m.a1025, 1025);
-  assertEquals(m.a1026, 1026);
-  assertEquals(m.a1027, 1027);
-  assertEquals(m.a1028, 1028);
-  assertEquals(m.a1029, 1029);
-  assertEquals(m.a1030, 1030);
-  assertEquals(m.a1031, 1031);
-  assertEquals(m.a1032, 1032);
-  assertEquals(m.a1033, 1033);
-  assertEquals(m.a1034, 1034);
-  assertEquals(m.a1035, 1035);
-  assertEquals(m.a1036, 1036);
-  assertEquals(m.a1037, 1037);
-  assertEquals(m.a1038, 1038);
-  assertEquals(m.a1039, 1039);
-  assertEquals(m.a1040, 1040);
-  assertEquals(m.a1041, 1041);
-  assertEquals(m.a1042, 1042);
-  assertEquals(m.a1043, 1043);
-  assertEquals(m.a1044, 1044);
-  assertEquals(m.a1045, 1045);
-  assertEquals(m.a1046, 1046);
-  assertEquals(m.a1047, 1047);
-  assertEquals(m.a1048, 1048);
-  assertEquals(m.a1049, 1049);
-  assertEquals(m.a1050, 1050);
-  assertEquals(m.a1051, 1051);
-  assertEquals(m.a1052, 1052);
-  assertEquals(m.a1053, 1053);
-  assertEquals(m.a1054, 1054);
-  assertEquals(m.a1055, 1055);
-  assertEquals(m.a1056, 1056);
-  assertEquals(m.a1057, 1057);
-  assertEquals(m.a1058, 1058);
-  assertEquals(m.a1059, 1059);
-  assertEquals(m.a1060, 1060);
-  assertEquals(m.a1061, 1061);
-  assertEquals(m.a1062, 1062);
-  assertEquals(m.a1063, 1063);
-  assertEquals(m.a1064, 1064);
-  assertEquals(m.a1065, 1065);
-  assertEquals(m.a1066, 1066);
-  assertEquals(m.a1067, 1067);
-  assertEquals(m.a1068, 1068);
-  assertEquals(m.a1069, 1069);
-  assertEquals(m.a1070, 1070);
-  assertEquals(m.a1071, 1071);
-  assertEquals(m.a1072, 1072);
-  assertEquals(m.a1073, 1073);
-  assertEquals(m.a1074, 1074);
-  assertEquals(m.a1075, 1075);
-  assertEquals(m.a1076, 1076);
-  assertEquals(m.a1077, 1077);
-  assertEquals(m.a1078, 1078);
-  assertEquals(m.a1079, 1079);
-  assertEquals(m.a1080, 1080);
-  assertEquals(m.a1081, 1081);
-  assertEquals(m.a1082, 1082);
-  assertEquals(m.a1083, 1083);
-  assertEquals(m.a1084, 1084);
-  assertEquals(m.a1085, 1085);
-  assertEquals(m.a1086, 1086);
-  assertEquals(m.a1087, 1087);
-  assertEquals(m.a1088, 1088);
-  assertEquals(m.a1089, 1089);
-  assertEquals(m.a1090, 1090);
-  assertEquals(m.a1091, 1091);
-  assertEquals(m.a1092, 1092);
-  assertEquals(m.a1093, 1093);
-  assertEquals(m.a1094, 1094);
-  assertEquals(m.a1095, 1095);
-  assertEquals(m.a1096, 1096);
-  assertEquals(m.a1097, 1097);
-  assertEquals(m.a1098, 1098);
-  assertEquals(m.a1099, 1099);
-}
-verify(m1);  // Uninitialized.
-verify(m1);  // Premonomorphic.
-verify(m2);  // Monomorphic.
diff --git a/src/v8/test/mjsunit/harmony/modules-import-meta.js b/src/v8/test/mjsunit/harmony/modules-import-meta.js
deleted file mode 100644
index 5ea8a68..0000000
--- a/src/v8/test/mjsunit/harmony/modules-import-meta.js
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// MODULE
-// Flags: --harmony-import-meta
-
-import foreign, { url as otherUrl } from './modules-skip-export-import-meta.js';
-
-assertEquals("object", typeof import.meta);
-assertEquals(null, Object.getPrototypeOf(import.meta));
-assertSame(import.meta, import.meta);
-
-const loadImportMetaArrow = () => import.meta;
-assertSame(loadImportMetaArrow(), import.meta);
-function loadImportMetaFn() {
-  try {
-    throw new Error('force catch code path for nested context');
-  } catch (e) {
-    return import.meta;
-  }
-}
-loadImportMetaFn();
-assertSame(loadImportMetaFn(), import.meta);
-
-// This property isn't part of the spec itself but is mentioned as an example
-assertMatches(/\/modules-import-meta\.js$/, import.meta.url);
-
-import.meta.x = 42;
-assertEquals(42, import.meta.x);
-Object.assign(import.meta, { foo: "bar" })
-assertEquals("bar", import.meta.foo);
-
-// PerformEval parses its argument for the goal symbol Script. So the following
-// should fail just as it does for every other Script context.
-//
-// See:
-// https://github.com/tc39/proposal-import-meta/issues/7#issuecomment-329363083
-assertThrows(() => eval('import.meta'), SyntaxError);
-assertThrows(() => new Function('return import.meta;'), SyntaxError);
-
-assertNotEquals(foreign, import.meta);
-assertMatches(/\/modules-skip-export-import-meta\.js$/, foreign.url);
-assertEquals(foreign.url, otherUrl);
diff --git a/src/v8/test/mjsunit/harmony/modules-skip-1.js b/src/v8/test/mjsunit/harmony/modules-skip-1.js
deleted file mode 100644
index ee854b6..0000000
--- a/src/v8/test/mjsunit/harmony/modules-skip-1.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export function life() { return 42; }
diff --git a/src/v8/test/mjsunit/harmony/modules-skip-10.js b/src/v8/test/mjsunit/harmony/modules-skip-10.js
deleted file mode 100644
index fff168a..0000000
--- a/src/v8/test/mjsunit/harmony/modules-skip-10.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2017 the V8 project 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 {x} from "./modules-skip-10.js"
diff --git a/src/v8/test/mjsunit/harmony/modules-skip-11.js b/src/v8/test/mjsunit/harmony/modules-skip-11.js
deleted file mode 100644
index 8981f50..0000000
--- a/src/v8/test/mjsunit/harmony/modules-skip-11.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-throw Symbol();
diff --git a/src/v8/test/mjsunit/harmony/modules-skip-12.js b/src/v8/test/mjsunit/harmony/modules-skip-12.js
deleted file mode 100644
index 05fedfa..0000000
--- a/src/v8/test/mjsunit/harmony/modules-skip-12.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-$^#$%@#@^^%^%$^#%%#!#$%!#$@#$%
diff --git a/src/v8/test/mjsunit/harmony/modules-skip-2.js b/src/v8/test/mjsunit/harmony/modules-skip-2.js
deleted file mode 100644
index 6ff97a9..0000000
--- a/src/v8/test/mjsunit/harmony/modules-skip-2.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-throw new Error('42 is not the answer');
diff --git a/src/v8/test/mjsunit/harmony/modules-skip-3.js b/src/v8/test/mjsunit/harmony/modules-skip-3.js
deleted file mode 100644
index 6f9984e..0000000
--- a/src/v8/test/mjsunit/harmony/modules-skip-3.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export let stringlife = "42";
diff --git a/src/v8/test/mjsunit/harmony/modules-skip-4.js b/src/v8/test/mjsunit/harmony/modules-skip-4.js
deleted file mode 100644
index 7611536..0000000
--- a/src/v8/test/mjsunit/harmony/modules-skip-4.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export * from 'modules-skip-1.js';
-export * from 'modules-skip-3.js';
diff --git a/src/v8/test/mjsunit/harmony/modules-skip-5.js b/src/v8/test/mjsunit/harmony/modules-skip-5.js
deleted file mode 100644
index 8794459..0000000
--- a/src/v8/test/mjsunit/harmony/modules-skip-5.js
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --harmony-dynamic-import
-
-var dynamic_life;
-
-import * as static_life from 'modules-skip-1.js';
-import * as relative_static_life from './modules-skip-1.js';
-import('modules-skip-1.js').then(namespace => dynamic_life = namespace);
-
-export { static_life };
-export { relative_static_life };
-export { dynamic_life };
diff --git a/src/v8/test/mjsunit/harmony/modules-skip-6.js b/src/v8/test/mjsunit/harmony/modules-skip-6.js
deleted file mode 100644
index 6acc2b8..0000000
--- a/src/v8/test/mjsunit/harmony/modules-skip-6.js
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --harmony-dynamic-import
-
-Object.defineProperty(Object, 'life', {
-  value: 42
-});
-
-export let life = "42";
diff --git a/src/v8/test/mjsunit/harmony/modules-skip-7.js b/src/v8/test/mjsunit/harmony/modules-skip-7.js
deleted file mode 100644
index 4d3a952..0000000
--- a/src/v8/test/mjsunit/harmony/modules-skip-7.js
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --harmony-dynamic-import
-
-export async function getLife() {
-  try {
-    let namespace = await import('modules-skip-1.js');
-    return namespace.life();
-  } catch (e) {
-    %AbortJS('failure: ' + e);
-  }
-}
diff --git a/src/v8/test/mjsunit/harmony/modules-skip-8.js b/src/v8/test/mjsunit/harmony/modules-skip-8.js
deleted file mode 100644
index 816cf2c..0000000
--- a/src/v8/test/mjsunit/harmony/modules-skip-8.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-await x;
diff --git a/src/v8/test/mjsunit/harmony/modules-skip-9.js b/src/v8/test/mjsunit/harmony/modules-skip-9.js
deleted file mode 100644
index c474988..0000000
--- a/src/v8/test/mjsunit/harmony/modules-skip-9.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2017 the V8 project 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 x from 'modules-skip-empty.js';
diff --git a/src/v8/test/mjsunit/harmony/modules-skip-empty.js b/src/v8/test/mjsunit/harmony/modules-skip-empty.js
deleted file mode 100644
index 4af874c..0000000
--- a/src/v8/test/mjsunit/harmony/modules-skip-empty.js
+++ /dev/null
@@ -1,3 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
diff --git a/src/v8/test/mjsunit/harmony/modules-skip-export-import-meta.js b/src/v8/test/mjsunit/harmony/modules-skip-export-import-meta.js
deleted file mode 100644
index e58e501..0000000
--- a/src/v8/test/mjsunit/harmony/modules-skip-export-import-meta.js
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export default import.meta;
-const { url } = import.meta;
-export { url };
diff --git a/src/v8/test/mjsunit/harmony/modules-skip-large1.js b/src/v8/test/mjsunit/harmony/modules-skip-large1.js
deleted file mode 100644
index e643df3..0000000
--- a/src/v8/test/mjsunit/harmony/modules-skip-large1.js
+++ /dev/null
@@ -1,2204 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export let a0 = 0;
-export let a1 = 1;
-export let a2 = 2;
-export let a3 = 3;
-export let a4 = 4;
-export let a5 = 5;
-export let a6 = 6;
-export let a7 = 7;
-export let a8 = 8;
-export let a9 = 9;
-export let a10 = 10;
-export let a11 = 11;
-export let a12 = 12;
-export let a13 = 13;
-export let a14 = 14;
-export let a15 = 15;
-export let a16 = 16;
-export let a17 = 17;
-export let a18 = 18;
-export let a19 = 19;
-export let a20 = 20;
-export let a21 = 21;
-export let a22 = 22;
-export let a23 = 23;
-export let a24 = 24;
-export let a25 = 25;
-export let a26 = 26;
-export let a27 = 27;
-export let a28 = 28;
-export let a29 = 29;
-export let a30 = 30;
-export let a31 = 31;
-export let a32 = 32;
-export let a33 = 33;
-export let a34 = 34;
-export let a35 = 35;
-export let a36 = 36;
-export let a37 = 37;
-export let a38 = 38;
-export let a39 = 39;
-export let a40 = 40;
-export let a41 = 41;
-export let a42 = 42;
-export let a43 = 43;
-export let a44 = 44;
-export let a45 = 45;
-export let a46 = 46;
-export let a47 = 47;
-export let a48 = 48;
-export let a49 = 49;
-export let a50 = 50;
-export let a51 = 51;
-export let a52 = 52;
-export let a53 = 53;
-export let a54 = 54;
-export let a55 = 55;
-export let a56 = 56;
-export let a57 = 57;
-export let a58 = 58;
-export let a59 = 59;
-export let a60 = 60;
-export let a61 = 61;
-export let a62 = 62;
-export let a63 = 63;
-export let a64 = 64;
-export let a65 = 65;
-export let a66 = 66;
-export let a67 = 67;
-export let a68 = 68;
-export let a69 = 69;
-export let a70 = 70;
-export let a71 = 71;
-export let a72 = 72;
-export let a73 = 73;
-export let a74 = 74;
-export let a75 = 75;
-export let a76 = 76;
-export let a77 = 77;
-export let a78 = 78;
-export let a79 = 79;
-export let a80 = 80;
-export let a81 = 81;
-export let a82 = 82;
-export let a83 = 83;
-export let a84 = 84;
-export let a85 = 85;
-export let a86 = 86;
-export let a87 = 87;
-export let a88 = 88;
-export let a89 = 89;
-export let a90 = 90;
-export let a91 = 91;
-export let a92 = 92;
-export let a93 = 93;
-export let a94 = 94;
-export let a95 = 95;
-export let a96 = 96;
-export let a97 = 97;
-export let a98 = 98;
-export let a99 = 99;
-export let a100 = 100;
-export let a101 = 101;
-export let a102 = 102;
-export let a103 = 103;
-export let a104 = 104;
-export let a105 = 105;
-export let a106 = 106;
-export let a107 = 107;
-export let a108 = 108;
-export let a109 = 109;
-export let a110 = 110;
-export let a111 = 111;
-export let a112 = 112;
-export let a113 = 113;
-export let a114 = 114;
-export let a115 = 115;
-export let a116 = 116;
-export let a117 = 117;
-export let a118 = 118;
-export let a119 = 119;
-export let a120 = 120;
-export let a121 = 121;
-export let a122 = 122;
-export let a123 = 123;
-export let a124 = 124;
-export let a125 = 125;
-export let a126 = 126;
-export let a127 = 127;
-export let a128 = 128;
-export let a129 = 129;
-export let a130 = 130;
-export let a131 = 131;
-export let a132 = 132;
-export let a133 = 133;
-export let a134 = 134;
-export let a135 = 135;
-export let a136 = 136;
-export let a137 = 137;
-export let a138 = 138;
-export let a139 = 139;
-export let a140 = 140;
-export let a141 = 141;
-export let a142 = 142;
-export let a143 = 143;
-export let a144 = 144;
-export let a145 = 145;
-export let a146 = 146;
-export let a147 = 147;
-export let a148 = 148;
-export let a149 = 149;
-export let a150 = 150;
-export let a151 = 151;
-export let a152 = 152;
-export let a153 = 153;
-export let a154 = 154;
-export let a155 = 155;
-export let a156 = 156;
-export let a157 = 157;
-export let a158 = 158;
-export let a159 = 159;
-export let a160 = 160;
-export let a161 = 161;
-export let a162 = 162;
-export let a163 = 163;
-export let a164 = 164;
-export let a165 = 165;
-export let a166 = 166;
-export let a167 = 167;
-export let a168 = 168;
-export let a169 = 169;
-export let a170 = 170;
-export let a171 = 171;
-export let a172 = 172;
-export let a173 = 173;
-export let a174 = 174;
-export let a175 = 175;
-export let a176 = 176;
-export let a177 = 177;
-export let a178 = 178;
-export let a179 = 179;
-export let a180 = 180;
-export let a181 = 181;
-export let a182 = 182;
-export let a183 = 183;
-export let a184 = 184;
-export let a185 = 185;
-export let a186 = 186;
-export let a187 = 187;
-export let a188 = 188;
-export let a189 = 189;
-export let a190 = 190;
-export let a191 = 191;
-export let a192 = 192;
-export let a193 = 193;
-export let a194 = 194;
-export let a195 = 195;
-export let a196 = 196;
-export let a197 = 197;
-export let a198 = 198;
-export let a199 = 199;
-export let a200 = 200;
-export let a201 = 201;
-export let a202 = 202;
-export let a203 = 203;
-export let a204 = 204;
-export let a205 = 205;
-export let a206 = 206;
-export let a207 = 207;
-export let a208 = 208;
-export let a209 = 209;
-export let a210 = 210;
-export let a211 = 211;
-export let a212 = 212;
-export let a213 = 213;
-export let a214 = 214;
-export let a215 = 215;
-export let a216 = 216;
-export let a217 = 217;
-export let a218 = 218;
-export let a219 = 219;
-export let a220 = 220;
-export let a221 = 221;
-export let a222 = 222;
-export let a223 = 223;
-export let a224 = 224;
-export let a225 = 225;
-export let a226 = 226;
-export let a227 = 227;
-export let a228 = 228;
-export let a229 = 229;
-export let a230 = 230;
-export let a231 = 231;
-export let a232 = 232;
-export let a233 = 233;
-export let a234 = 234;
-export let a235 = 235;
-export let a236 = 236;
-export let a237 = 237;
-export let a238 = 238;
-export let a239 = 239;
-export let a240 = 240;
-export let a241 = 241;
-export let a242 = 242;
-export let a243 = 243;
-export let a244 = 244;
-export let a245 = 245;
-export let a246 = 246;
-export let a247 = 247;
-export let a248 = 248;
-export let a249 = 249;
-export let a250 = 250;
-export let a251 = 251;
-export let a252 = 252;
-export let a253 = 253;
-export let a254 = 254;
-export let a255 = 255;
-export let a256 = 256;
-export let a257 = 257;
-export let a258 = 258;
-export let a259 = 259;
-export let a260 = 260;
-export let a261 = 261;
-export let a262 = 262;
-export let a263 = 263;
-export let a264 = 264;
-export let a265 = 265;
-export let a266 = 266;
-export let a267 = 267;
-export let a268 = 268;
-export let a269 = 269;
-export let a270 = 270;
-export let a271 = 271;
-export let a272 = 272;
-export let a273 = 273;
-export let a274 = 274;
-export let a275 = 275;
-export let a276 = 276;
-export let a277 = 277;
-export let a278 = 278;
-export let a279 = 279;
-export let a280 = 280;
-export let a281 = 281;
-export let a282 = 282;
-export let a283 = 283;
-export let a284 = 284;
-export let a285 = 285;
-export let a286 = 286;
-export let a287 = 287;
-export let a288 = 288;
-export let a289 = 289;
-export let a290 = 290;
-export let a291 = 291;
-export let a292 = 292;
-export let a293 = 293;
-export let a294 = 294;
-export let a295 = 295;
-export let a296 = 296;
-export let a297 = 297;
-export let a298 = 298;
-export let a299 = 299;
-export let a300 = 300;
-export let a301 = 301;
-export let a302 = 302;
-export let a303 = 303;
-export let a304 = 304;
-export let a305 = 305;
-export let a306 = 306;
-export let a307 = 307;
-export let a308 = 308;
-export let a309 = 309;
-export let a310 = 310;
-export let a311 = 311;
-export let a312 = 312;
-export let a313 = 313;
-export let a314 = 314;
-export let a315 = 315;
-export let a316 = 316;
-export let a317 = 317;
-export let a318 = 318;
-export let a319 = 319;
-export let a320 = 320;
-export let a321 = 321;
-export let a322 = 322;
-export let a323 = 323;
-export let a324 = 324;
-export let a325 = 325;
-export let a326 = 326;
-export let a327 = 327;
-export let a328 = 328;
-export let a329 = 329;
-export let a330 = 330;
-export let a331 = 331;
-export let a332 = 332;
-export let a333 = 333;
-export let a334 = 334;
-export let a335 = 335;
-export let a336 = 336;
-export let a337 = 337;
-export let a338 = 338;
-export let a339 = 339;
-export let a340 = 340;
-export let a341 = 341;
-export let a342 = 342;
-export let a343 = 343;
-export let a344 = 344;
-export let a345 = 345;
-export let a346 = 346;
-export let a347 = 347;
-export let a348 = 348;
-export let a349 = 349;
-export let a350 = 350;
-export let a351 = 351;
-export let a352 = 352;
-export let a353 = 353;
-export let a354 = 354;
-export let a355 = 355;
-export let a356 = 356;
-export let a357 = 357;
-export let a358 = 358;
-export let a359 = 359;
-export let a360 = 360;
-export let a361 = 361;
-export let a362 = 362;
-export let a363 = 363;
-export let a364 = 364;
-export let a365 = 365;
-export let a366 = 366;
-export let a367 = 367;
-export let a368 = 368;
-export let a369 = 369;
-export let a370 = 370;
-export let a371 = 371;
-export let a372 = 372;
-export let a373 = 373;
-export let a374 = 374;
-export let a375 = 375;
-export let a376 = 376;
-export let a377 = 377;
-export let a378 = 378;
-export let a379 = 379;
-export let a380 = 380;
-export let a381 = 381;
-export let a382 = 382;
-export let a383 = 383;
-export let a384 = 384;
-export let a385 = 385;
-export let a386 = 386;
-export let a387 = 387;
-export let a388 = 388;
-export let a389 = 389;
-export let a390 = 390;
-export let a391 = 391;
-export let a392 = 392;
-export let a393 = 393;
-export let a394 = 394;
-export let a395 = 395;
-export let a396 = 396;
-export let a397 = 397;
-export let a398 = 398;
-export let a399 = 399;
-export let a400 = 400;
-export let a401 = 401;
-export let a402 = 402;
-export let a403 = 403;
-export let a404 = 404;
-export let a405 = 405;
-export let a406 = 406;
-export let a407 = 407;
-export let a408 = 408;
-export let a409 = 409;
-export let a410 = 410;
-export let a411 = 411;
-export let a412 = 412;
-export let a413 = 413;
-export let a414 = 414;
-export let a415 = 415;
-export let a416 = 416;
-export let a417 = 417;
-export let a418 = 418;
-export let a419 = 419;
-export let a420 = 420;
-export let a421 = 421;
-export let a422 = 422;
-export let a423 = 423;
-export let a424 = 424;
-export let a425 = 425;
-export let a426 = 426;
-export let a427 = 427;
-export let a428 = 428;
-export let a429 = 429;
-export let a430 = 430;
-export let a431 = 431;
-export let a432 = 432;
-export let a433 = 433;
-export let a434 = 434;
-export let a435 = 435;
-export let a436 = 436;
-export let a437 = 437;
-export let a438 = 438;
-export let a439 = 439;
-export let a440 = 440;
-export let a441 = 441;
-export let a442 = 442;
-export let a443 = 443;
-export let a444 = 444;
-export let a445 = 445;
-export let a446 = 446;
-export let a447 = 447;
-export let a448 = 448;
-export let a449 = 449;
-export let a450 = 450;
-export let a451 = 451;
-export let a452 = 452;
-export let a453 = 453;
-export let a454 = 454;
-export let a455 = 455;
-export let a456 = 456;
-export let a457 = 457;
-export let a458 = 458;
-export let a459 = 459;
-export let a460 = 460;
-export let a461 = 461;
-export let a462 = 462;
-export let a463 = 463;
-export let a464 = 464;
-export let a465 = 465;
-export let a466 = 466;
-export let a467 = 467;
-export let a468 = 468;
-export let a469 = 469;
-export let a470 = 470;
-export let a471 = 471;
-export let a472 = 472;
-export let a473 = 473;
-export let a474 = 474;
-export let a475 = 475;
-export let a476 = 476;
-export let a477 = 477;
-export let a478 = 478;
-export let a479 = 479;
-export let a480 = 480;
-export let a481 = 481;
-export let a482 = 482;
-export let a483 = 483;
-export let a484 = 484;
-export let a485 = 485;
-export let a486 = 486;
-export let a487 = 487;
-export let a488 = 488;
-export let a489 = 489;
-export let a490 = 490;
-export let a491 = 491;
-export let a492 = 492;
-export let a493 = 493;
-export let a494 = 494;
-export let a495 = 495;
-export let a496 = 496;
-export let a497 = 497;
-export let a498 = 498;
-export let a499 = 499;
-export let a500 = 500;
-export let a501 = 501;
-export let a502 = 502;
-export let a503 = 503;
-export let a504 = 504;
-export let a505 = 505;
-export let a506 = 506;
-export let a507 = 507;
-export let a508 = 508;
-export let a509 = 509;
-export let a510 = 510;
-export let a511 = 511;
-export let a512 = 512;
-export let a513 = 513;
-export let a514 = 514;
-export let a515 = 515;
-export let a516 = 516;
-export let a517 = 517;
-export let a518 = 518;
-export let a519 = 519;
-export let a520 = 520;
-export let a521 = 521;
-export let a522 = 522;
-export let a523 = 523;
-export let a524 = 524;
-export let a525 = 525;
-export let a526 = 526;
-export let a527 = 527;
-export let a528 = 528;
-export let a529 = 529;
-export let a530 = 530;
-export let a531 = 531;
-export let a532 = 532;
-export let a533 = 533;
-export let a534 = 534;
-export let a535 = 535;
-export let a536 = 536;
-export let a537 = 537;
-export let a538 = 538;
-export let a539 = 539;
-export let a540 = 540;
-export let a541 = 541;
-export let a542 = 542;
-export let a543 = 543;
-export let a544 = 544;
-export let a545 = 545;
-export let a546 = 546;
-export let a547 = 547;
-export let a548 = 548;
-export let a549 = 549;
-export let a550 = 550;
-export let a551 = 551;
-export let a552 = 552;
-export let a553 = 553;
-export let a554 = 554;
-export let a555 = 555;
-export let a556 = 556;
-export let a557 = 557;
-export let a558 = 558;
-export let a559 = 559;
-export let a560 = 560;
-export let a561 = 561;
-export let a562 = 562;
-export let a563 = 563;
-export let a564 = 564;
-export let a565 = 565;
-export let a566 = 566;
-export let a567 = 567;
-export let a568 = 568;
-export let a569 = 569;
-export let a570 = 570;
-export let a571 = 571;
-export let a572 = 572;
-export let a573 = 573;
-export let a574 = 574;
-export let a575 = 575;
-export let a576 = 576;
-export let a577 = 577;
-export let a578 = 578;
-export let a579 = 579;
-export let a580 = 580;
-export let a581 = 581;
-export let a582 = 582;
-export let a583 = 583;
-export let a584 = 584;
-export let a585 = 585;
-export let a586 = 586;
-export let a587 = 587;
-export let a588 = 588;
-export let a589 = 589;
-export let a590 = 590;
-export let a591 = 591;
-export let a592 = 592;
-export let a593 = 593;
-export let a594 = 594;
-export let a595 = 595;
-export let a596 = 596;
-export let a597 = 597;
-export let a598 = 598;
-export let a599 = 599;
-export let a600 = 600;
-export let a601 = 601;
-export let a602 = 602;
-export let a603 = 603;
-export let a604 = 604;
-export let a605 = 605;
-export let a606 = 606;
-export let a607 = 607;
-export let a608 = 608;
-export let a609 = 609;
-export let a610 = 610;
-export let a611 = 611;
-export let a612 = 612;
-export let a613 = 613;
-export let a614 = 614;
-export let a615 = 615;
-export let a616 = 616;
-export let a617 = 617;
-export let a618 = 618;
-export let a619 = 619;
-export let a620 = 620;
-export let a621 = 621;
-export let a622 = 622;
-export let a623 = 623;
-export let a624 = 624;
-export let a625 = 625;
-export let a626 = 626;
-export let a627 = 627;
-export let a628 = 628;
-export let a629 = 629;
-export let a630 = 630;
-export let a631 = 631;
-export let a632 = 632;
-export let a633 = 633;
-export let a634 = 634;
-export let a635 = 635;
-export let a636 = 636;
-export let a637 = 637;
-export let a638 = 638;
-export let a639 = 639;
-export let a640 = 640;
-export let a641 = 641;
-export let a642 = 642;
-export let a643 = 643;
-export let a644 = 644;
-export let a645 = 645;
-export let a646 = 646;
-export let a647 = 647;
-export let a648 = 648;
-export let a649 = 649;
-export let a650 = 650;
-export let a651 = 651;
-export let a652 = 652;
-export let a653 = 653;
-export let a654 = 654;
-export let a655 = 655;
-export let a656 = 656;
-export let a657 = 657;
-export let a658 = 658;
-export let a659 = 659;
-export let a660 = 660;
-export let a661 = 661;
-export let a662 = 662;
-export let a663 = 663;
-export let a664 = 664;
-export let a665 = 665;
-export let a666 = 666;
-export let a667 = 667;
-export let a668 = 668;
-export let a669 = 669;
-export let a670 = 670;
-export let a671 = 671;
-export let a672 = 672;
-export let a673 = 673;
-export let a674 = 674;
-export let a675 = 675;
-export let a676 = 676;
-export let a677 = 677;
-export let a678 = 678;
-export let a679 = 679;
-export let a680 = 680;
-export let a681 = 681;
-export let a682 = 682;
-export let a683 = 683;
-export let a684 = 684;
-export let a685 = 685;
-export let a686 = 686;
-export let a687 = 687;
-export let a688 = 688;
-export let a689 = 689;
-export let a690 = 690;
-export let a691 = 691;
-export let a692 = 692;
-export let a693 = 693;
-export let a694 = 694;
-export let a695 = 695;
-export let a696 = 696;
-export let a697 = 697;
-export let a698 = 698;
-export let a699 = 699;
-export let a700 = 700;
-export let a701 = 701;
-export let a702 = 702;
-export let a703 = 703;
-export let a704 = 704;
-export let a705 = 705;
-export let a706 = 706;
-export let a707 = 707;
-export let a708 = 708;
-export let a709 = 709;
-export let a710 = 710;
-export let a711 = 711;
-export let a712 = 712;
-export let a713 = 713;
-export let a714 = 714;
-export let a715 = 715;
-export let a716 = 716;
-export let a717 = 717;
-export let a718 = 718;
-export let a719 = 719;
-export let a720 = 720;
-export let a721 = 721;
-export let a722 = 722;
-export let a723 = 723;
-export let a724 = 724;
-export let a725 = 725;
-export let a726 = 726;
-export let a727 = 727;
-export let a728 = 728;
-export let a729 = 729;
-export let a730 = 730;
-export let a731 = 731;
-export let a732 = 732;
-export let a733 = 733;
-export let a734 = 734;
-export let a735 = 735;
-export let a736 = 736;
-export let a737 = 737;
-export let a738 = 738;
-export let a739 = 739;
-export let a740 = 740;
-export let a741 = 741;
-export let a742 = 742;
-export let a743 = 743;
-export let a744 = 744;
-export let a745 = 745;
-export let a746 = 746;
-export let a747 = 747;
-export let a748 = 748;
-export let a749 = 749;
-export let a750 = 750;
-export let a751 = 751;
-export let a752 = 752;
-export let a753 = 753;
-export let a754 = 754;
-export let a755 = 755;
-export let a756 = 756;
-export let a757 = 757;
-export let a758 = 758;
-export let a759 = 759;
-export let a760 = 760;
-export let a761 = 761;
-export let a762 = 762;
-export let a763 = 763;
-export let a764 = 764;
-export let a765 = 765;
-export let a766 = 766;
-export let a767 = 767;
-export let a768 = 768;
-export let a769 = 769;
-export let a770 = 770;
-export let a771 = 771;
-export let a772 = 772;
-export let a773 = 773;
-export let a774 = 774;
-export let a775 = 775;
-export let a776 = 776;
-export let a777 = 777;
-export let a778 = 778;
-export let a779 = 779;
-export let a780 = 780;
-export let a781 = 781;
-export let a782 = 782;
-export let a783 = 783;
-export let a784 = 784;
-export let a785 = 785;
-export let a786 = 786;
-export let a787 = 787;
-export let a788 = 788;
-export let a789 = 789;
-export let a790 = 790;
-export let a791 = 791;
-export let a792 = 792;
-export let a793 = 793;
-export let a794 = 794;
-export let a795 = 795;
-export let a796 = 796;
-export let a797 = 797;
-export let a798 = 798;
-export let a799 = 799;
-export let a800 = 800;
-export let a801 = 801;
-export let a802 = 802;
-export let a803 = 803;
-export let a804 = 804;
-export let a805 = 805;
-export let a806 = 806;
-export let a807 = 807;
-export let a808 = 808;
-export let a809 = 809;
-export let a810 = 810;
-export let a811 = 811;
-export let a812 = 812;
-export let a813 = 813;
-export let a814 = 814;
-export let a815 = 815;
-export let a816 = 816;
-export let a817 = 817;
-export let a818 = 818;
-export let a819 = 819;
-export let a820 = 820;
-export let a821 = 821;
-export let a822 = 822;
-export let a823 = 823;
-export let a824 = 824;
-export let a825 = 825;
-export let a826 = 826;
-export let a827 = 827;
-export let a828 = 828;
-export let a829 = 829;
-export let a830 = 830;
-export let a831 = 831;
-export let a832 = 832;
-export let a833 = 833;
-export let a834 = 834;
-export let a835 = 835;
-export let a836 = 836;
-export let a837 = 837;
-export let a838 = 838;
-export let a839 = 839;
-export let a840 = 840;
-export let a841 = 841;
-export let a842 = 842;
-export let a843 = 843;
-export let a844 = 844;
-export let a845 = 845;
-export let a846 = 846;
-export let a847 = 847;
-export let a848 = 848;
-export let a849 = 849;
-export let a850 = 850;
-export let a851 = 851;
-export let a852 = 852;
-export let a853 = 853;
-export let a854 = 854;
-export let a855 = 855;
-export let a856 = 856;
-export let a857 = 857;
-export let a858 = 858;
-export let a859 = 859;
-export let a860 = 860;
-export let a861 = 861;
-export let a862 = 862;
-export let a863 = 863;
-export let a864 = 864;
-export let a865 = 865;
-export let a866 = 866;
-export let a867 = 867;
-export let a868 = 868;
-export let a869 = 869;
-export let a870 = 870;
-export let a871 = 871;
-export let a872 = 872;
-export let a873 = 873;
-export let a874 = 874;
-export let a875 = 875;
-export let a876 = 876;
-export let a877 = 877;
-export let a878 = 878;
-export let a879 = 879;
-export let a880 = 880;
-export let a881 = 881;
-export let a882 = 882;
-export let a883 = 883;
-export let a884 = 884;
-export let a885 = 885;
-export let a886 = 886;
-export let a887 = 887;
-export let a888 = 888;
-export let a889 = 889;
-export let a890 = 890;
-export let a891 = 891;
-export let a892 = 892;
-export let a893 = 893;
-export let a894 = 894;
-export let a895 = 895;
-export let a896 = 896;
-export let a897 = 897;
-export let a898 = 898;
-export let a899 = 899;
-export let a900 = 900;
-export let a901 = 901;
-export let a902 = 902;
-export let a903 = 903;
-export let a904 = 904;
-export let a905 = 905;
-export let a906 = 906;
-export let a907 = 907;
-export let a908 = 908;
-export let a909 = 909;
-export let a910 = 910;
-export let a911 = 911;
-export let a912 = 912;
-export let a913 = 913;
-export let a914 = 914;
-export let a915 = 915;
-export let a916 = 916;
-export let a917 = 917;
-export let a918 = 918;
-export let a919 = 919;
-export let a920 = 920;
-export let a921 = 921;
-export let a922 = 922;
-export let a923 = 923;
-export let a924 = 924;
-export let a925 = 925;
-export let a926 = 926;
-export let a927 = 927;
-export let a928 = 928;
-export let a929 = 929;
-export let a930 = 930;
-export let a931 = 931;
-export let a932 = 932;
-export let a933 = 933;
-export let a934 = 934;
-export let a935 = 935;
-export let a936 = 936;
-export let a937 = 937;
-export let a938 = 938;
-export let a939 = 939;
-export let a940 = 940;
-export let a941 = 941;
-export let a942 = 942;
-export let a943 = 943;
-export let a944 = 944;
-export let a945 = 945;
-export let a946 = 946;
-export let a947 = 947;
-export let a948 = 948;
-export let a949 = 949;
-export let a950 = 950;
-export let a951 = 951;
-export let a952 = 952;
-export let a953 = 953;
-export let a954 = 954;
-export let a955 = 955;
-export let a956 = 956;
-export let a957 = 957;
-export let a958 = 958;
-export let a959 = 959;
-export let a960 = 960;
-export let a961 = 961;
-export let a962 = 962;
-export let a963 = 963;
-export let a964 = 964;
-export let a965 = 965;
-export let a966 = 966;
-export let a967 = 967;
-export let a968 = 968;
-export let a969 = 969;
-export let a970 = 970;
-export let a971 = 971;
-export let a972 = 972;
-export let a973 = 973;
-export let a974 = 974;
-export let a975 = 975;
-export let a976 = 976;
-export let a977 = 977;
-export let a978 = 978;
-export let a979 = 979;
-export let a980 = 980;
-export let a981 = 981;
-export let a982 = 982;
-export let a983 = 983;
-export let a984 = 984;
-export let a985 = 985;
-export let a986 = 986;
-export let a987 = 987;
-export let a988 = 988;
-export let a989 = 989;
-export let a990 = 990;
-export let a991 = 991;
-export let a992 = 992;
-export let a993 = 993;
-export let a994 = 994;
-export let a995 = 995;
-export let a996 = 996;
-export let a997 = 997;
-export let a998 = 998;
-export let a999 = 999;
-export let a1000 = 1000;
-export let a1001 = 1001;
-export let a1002 = 1002;
-export let a1003 = 1003;
-export let a1004 = 1004;
-export let a1005 = 1005;
-export let a1006 = 1006;
-export let a1007 = 1007;
-export let a1008 = 1008;
-export let a1009 = 1009;
-export let a1010 = 1010;
-export let a1011 = 1011;
-export let a1012 = 1012;
-export let a1013 = 1013;
-export let a1014 = 1014;
-export let a1015 = 1015;
-export let a1016 = 1016;
-export let a1017 = 1017;
-export let a1018 = 1018;
-export let a1019 = 1019;
-export let a1020 = 1020;
-export let a1021 = 1021;
-export let a1022 = 1022;
-export let a1023 = 1023;
-export let a1024 = 1024;
-export let a1025 = 1025;
-export let a1026 = 1026;
-export let a1027 = 1027;
-export let a1028 = 1028;
-export let a1029 = 1029;
-export let a1030 = 1030;
-export let a1031 = 1031;
-export let a1032 = 1032;
-export let a1033 = 1033;
-export let a1034 = 1034;
-export let a1035 = 1035;
-export let a1036 = 1036;
-export let a1037 = 1037;
-export let a1038 = 1038;
-export let a1039 = 1039;
-export let a1040 = 1040;
-export let a1041 = 1041;
-export let a1042 = 1042;
-export let a1043 = 1043;
-export let a1044 = 1044;
-export let a1045 = 1045;
-export let a1046 = 1046;
-export let a1047 = 1047;
-export let a1048 = 1048;
-export let a1049 = 1049;
-export let a1050 = 1050;
-export let a1051 = 1051;
-export let a1052 = 1052;
-export let a1053 = 1053;
-export let a1054 = 1054;
-export let a1055 = 1055;
-export let a1056 = 1056;
-export let a1057 = 1057;
-export let a1058 = 1058;
-export let a1059 = 1059;
-export let a1060 = 1060;
-export let a1061 = 1061;
-export let a1062 = 1062;
-export let a1063 = 1063;
-export let a1064 = 1064;
-export let a1065 = 1065;
-export let a1066 = 1066;
-export let a1067 = 1067;
-export let a1068 = 1068;
-export let a1069 = 1069;
-export let a1070 = 1070;
-export let a1071 = 1071;
-export let a1072 = 1072;
-export let a1073 = 1073;
-export let a1074 = 1074;
-export let a1075 = 1075;
-export let a1076 = 1076;
-export let a1077 = 1077;
-export let a1078 = 1078;
-export let a1079 = 1079;
-export let a1080 = 1080;
-export let a1081 = 1081;
-export let a1082 = 1082;
-export let a1083 = 1083;
-export let a1084 = 1084;
-export let a1085 = 1085;
-export let a1086 = 1086;
-export let a1087 = 1087;
-export let a1088 = 1088;
-export let a1089 = 1089;
-export let a1090 = 1090;
-export let a1091 = 1091;
-export let a1092 = 1092;
-export let a1093 = 1093;
-export let a1094 = 1094;
-export let a1095 = 1095;
-export let a1096 = 1096;
-export let a1097 = 1097;
-export let a1098 = 1098;
-export let a1099 = 1099;
-export let a1100 = 1100;
-export let a1101 = 1101;
-export let a1102 = 1102;
-export let a1103 = 1103;
-export let a1104 = 1104;
-export let a1105 = 1105;
-export let a1106 = 1106;
-export let a1107 = 1107;
-export let a1108 = 1108;
-export let a1109 = 1109;
-export let a1110 = 1110;
-export let a1111 = 1111;
-export let a1112 = 1112;
-export let a1113 = 1113;
-export let a1114 = 1114;
-export let a1115 = 1115;
-export let a1116 = 1116;
-export let a1117 = 1117;
-export let a1118 = 1118;
-export let a1119 = 1119;
-export let a1120 = 1120;
-export let a1121 = 1121;
-export let a1122 = 1122;
-export let a1123 = 1123;
-export let a1124 = 1124;
-export let a1125 = 1125;
-export let a1126 = 1126;
-export let a1127 = 1127;
-export let a1128 = 1128;
-export let a1129 = 1129;
-export let a1130 = 1130;
-export let a1131 = 1131;
-export let a1132 = 1132;
-export let a1133 = 1133;
-export let a1134 = 1134;
-export let a1135 = 1135;
-export let a1136 = 1136;
-export let a1137 = 1137;
-export let a1138 = 1138;
-export let a1139 = 1139;
-export let a1140 = 1140;
-export let a1141 = 1141;
-export let a1142 = 1142;
-export let a1143 = 1143;
-export let a1144 = 1144;
-export let a1145 = 1145;
-export let a1146 = 1146;
-export let a1147 = 1147;
-export let a1148 = 1148;
-export let a1149 = 1149;
-export let a1150 = 1150;
-export let a1151 = 1151;
-export let a1152 = 1152;
-export let a1153 = 1153;
-export let a1154 = 1154;
-export let a1155 = 1155;
-export let a1156 = 1156;
-export let a1157 = 1157;
-export let a1158 = 1158;
-export let a1159 = 1159;
-export let a1160 = 1160;
-export let a1161 = 1161;
-export let a1162 = 1162;
-export let a1163 = 1163;
-export let a1164 = 1164;
-export let a1165 = 1165;
-export let a1166 = 1166;
-export let a1167 = 1167;
-export let a1168 = 1168;
-export let a1169 = 1169;
-export let a1170 = 1170;
-export let a1171 = 1171;
-export let a1172 = 1172;
-export let a1173 = 1173;
-export let a1174 = 1174;
-export let a1175 = 1175;
-export let a1176 = 1176;
-export let a1177 = 1177;
-export let a1178 = 1178;
-export let a1179 = 1179;
-export let a1180 = 1180;
-export let a1181 = 1181;
-export let a1182 = 1182;
-export let a1183 = 1183;
-export let a1184 = 1184;
-export let a1185 = 1185;
-export let a1186 = 1186;
-export let a1187 = 1187;
-export let a1188 = 1188;
-export let a1189 = 1189;
-export let a1190 = 1190;
-export let a1191 = 1191;
-export let a1192 = 1192;
-export let a1193 = 1193;
-export let a1194 = 1194;
-export let a1195 = 1195;
-export let a1196 = 1196;
-export let a1197 = 1197;
-export let a1198 = 1198;
-export let a1199 = 1199;
-export let a1200 = 1200;
-export let a1201 = 1201;
-export let a1202 = 1202;
-export let a1203 = 1203;
-export let a1204 = 1204;
-export let a1205 = 1205;
-export let a1206 = 1206;
-export let a1207 = 1207;
-export let a1208 = 1208;
-export let a1209 = 1209;
-export let a1210 = 1210;
-export let a1211 = 1211;
-export let a1212 = 1212;
-export let a1213 = 1213;
-export let a1214 = 1214;
-export let a1215 = 1215;
-export let a1216 = 1216;
-export let a1217 = 1217;
-export let a1218 = 1218;
-export let a1219 = 1219;
-export let a1220 = 1220;
-export let a1221 = 1221;
-export let a1222 = 1222;
-export let a1223 = 1223;
-export let a1224 = 1224;
-export let a1225 = 1225;
-export let a1226 = 1226;
-export let a1227 = 1227;
-export let a1228 = 1228;
-export let a1229 = 1229;
-export let a1230 = 1230;
-export let a1231 = 1231;
-export let a1232 = 1232;
-export let a1233 = 1233;
-export let a1234 = 1234;
-export let a1235 = 1235;
-export let a1236 = 1236;
-export let a1237 = 1237;
-export let a1238 = 1238;
-export let a1239 = 1239;
-export let a1240 = 1240;
-export let a1241 = 1241;
-export let a1242 = 1242;
-export let a1243 = 1243;
-export let a1244 = 1244;
-export let a1245 = 1245;
-export let a1246 = 1246;
-export let a1247 = 1247;
-export let a1248 = 1248;
-export let a1249 = 1249;
-export let a1250 = 1250;
-export let a1251 = 1251;
-export let a1252 = 1252;
-export let a1253 = 1253;
-export let a1254 = 1254;
-export let a1255 = 1255;
-export let a1256 = 1256;
-export let a1257 = 1257;
-export let a1258 = 1258;
-export let a1259 = 1259;
-export let a1260 = 1260;
-export let a1261 = 1261;
-export let a1262 = 1262;
-export let a1263 = 1263;
-export let a1264 = 1264;
-export let a1265 = 1265;
-export let a1266 = 1266;
-export let a1267 = 1267;
-export let a1268 = 1268;
-export let a1269 = 1269;
-export let a1270 = 1270;
-export let a1271 = 1271;
-export let a1272 = 1272;
-export let a1273 = 1273;
-export let a1274 = 1274;
-export let a1275 = 1275;
-export let a1276 = 1276;
-export let a1277 = 1277;
-export let a1278 = 1278;
-export let a1279 = 1279;
-export let a1280 = 1280;
-export let a1281 = 1281;
-export let a1282 = 1282;
-export let a1283 = 1283;
-export let a1284 = 1284;
-export let a1285 = 1285;
-export let a1286 = 1286;
-export let a1287 = 1287;
-export let a1288 = 1288;
-export let a1289 = 1289;
-export let a1290 = 1290;
-export let a1291 = 1291;
-export let a1292 = 1292;
-export let a1293 = 1293;
-export let a1294 = 1294;
-export let a1295 = 1295;
-export let a1296 = 1296;
-export let a1297 = 1297;
-export let a1298 = 1298;
-export let a1299 = 1299;
-export let a1300 = 1300;
-export let a1301 = 1301;
-export let a1302 = 1302;
-export let a1303 = 1303;
-export let a1304 = 1304;
-export let a1305 = 1305;
-export let a1306 = 1306;
-export let a1307 = 1307;
-export let a1308 = 1308;
-export let a1309 = 1309;
-export let a1310 = 1310;
-export let a1311 = 1311;
-export let a1312 = 1312;
-export let a1313 = 1313;
-export let a1314 = 1314;
-export let a1315 = 1315;
-export let a1316 = 1316;
-export let a1317 = 1317;
-export let a1318 = 1318;
-export let a1319 = 1319;
-export let a1320 = 1320;
-export let a1321 = 1321;
-export let a1322 = 1322;
-export let a1323 = 1323;
-export let a1324 = 1324;
-export let a1325 = 1325;
-export let a1326 = 1326;
-export let a1327 = 1327;
-export let a1328 = 1328;
-export let a1329 = 1329;
-export let a1330 = 1330;
-export let a1331 = 1331;
-export let a1332 = 1332;
-export let a1333 = 1333;
-export let a1334 = 1334;
-export let a1335 = 1335;
-export let a1336 = 1336;
-export let a1337 = 1337;
-export let a1338 = 1338;
-export let a1339 = 1339;
-export let a1340 = 1340;
-export let a1341 = 1341;
-export let a1342 = 1342;
-export let a1343 = 1343;
-export let a1344 = 1344;
-export let a1345 = 1345;
-export let a1346 = 1346;
-export let a1347 = 1347;
-export let a1348 = 1348;
-export let a1349 = 1349;
-export let a1350 = 1350;
-export let a1351 = 1351;
-export let a1352 = 1352;
-export let a1353 = 1353;
-export let a1354 = 1354;
-export let a1355 = 1355;
-export let a1356 = 1356;
-export let a1357 = 1357;
-export let a1358 = 1358;
-export let a1359 = 1359;
-export let a1360 = 1360;
-export let a1361 = 1361;
-export let a1362 = 1362;
-export let a1363 = 1363;
-export let a1364 = 1364;
-export let a1365 = 1365;
-export let a1366 = 1366;
-export let a1367 = 1367;
-export let a1368 = 1368;
-export let a1369 = 1369;
-export let a1370 = 1370;
-export let a1371 = 1371;
-export let a1372 = 1372;
-export let a1373 = 1373;
-export let a1374 = 1374;
-export let a1375 = 1375;
-export let a1376 = 1376;
-export let a1377 = 1377;
-export let a1378 = 1378;
-export let a1379 = 1379;
-export let a1380 = 1380;
-export let a1381 = 1381;
-export let a1382 = 1382;
-export let a1383 = 1383;
-export let a1384 = 1384;
-export let a1385 = 1385;
-export let a1386 = 1386;
-export let a1387 = 1387;
-export let a1388 = 1388;
-export let a1389 = 1389;
-export let a1390 = 1390;
-export let a1391 = 1391;
-export let a1392 = 1392;
-export let a1393 = 1393;
-export let a1394 = 1394;
-export let a1395 = 1395;
-export let a1396 = 1396;
-export let a1397 = 1397;
-export let a1398 = 1398;
-export let a1399 = 1399;
-export let a1400 = 1400;
-export let a1401 = 1401;
-export let a1402 = 1402;
-export let a1403 = 1403;
-export let a1404 = 1404;
-export let a1405 = 1405;
-export let a1406 = 1406;
-export let a1407 = 1407;
-export let a1408 = 1408;
-export let a1409 = 1409;
-export let a1410 = 1410;
-export let a1411 = 1411;
-export let a1412 = 1412;
-export let a1413 = 1413;
-export let a1414 = 1414;
-export let a1415 = 1415;
-export let a1416 = 1416;
-export let a1417 = 1417;
-export let a1418 = 1418;
-export let a1419 = 1419;
-export let a1420 = 1420;
-export let a1421 = 1421;
-export let a1422 = 1422;
-export let a1423 = 1423;
-export let a1424 = 1424;
-export let a1425 = 1425;
-export let a1426 = 1426;
-export let a1427 = 1427;
-export let a1428 = 1428;
-export let a1429 = 1429;
-export let a1430 = 1430;
-export let a1431 = 1431;
-export let a1432 = 1432;
-export let a1433 = 1433;
-export let a1434 = 1434;
-export let a1435 = 1435;
-export let a1436 = 1436;
-export let a1437 = 1437;
-export let a1438 = 1438;
-export let a1439 = 1439;
-export let a1440 = 1440;
-export let a1441 = 1441;
-export let a1442 = 1442;
-export let a1443 = 1443;
-export let a1444 = 1444;
-export let a1445 = 1445;
-export let a1446 = 1446;
-export let a1447 = 1447;
-export let a1448 = 1448;
-export let a1449 = 1449;
-export let a1450 = 1450;
-export let a1451 = 1451;
-export let a1452 = 1452;
-export let a1453 = 1453;
-export let a1454 = 1454;
-export let a1455 = 1455;
-export let a1456 = 1456;
-export let a1457 = 1457;
-export let a1458 = 1458;
-export let a1459 = 1459;
-export let a1460 = 1460;
-export let a1461 = 1461;
-export let a1462 = 1462;
-export let a1463 = 1463;
-export let a1464 = 1464;
-export let a1465 = 1465;
-export let a1466 = 1466;
-export let a1467 = 1467;
-export let a1468 = 1468;
-export let a1469 = 1469;
-export let a1470 = 1470;
-export let a1471 = 1471;
-export let a1472 = 1472;
-export let a1473 = 1473;
-export let a1474 = 1474;
-export let a1475 = 1475;
-export let a1476 = 1476;
-export let a1477 = 1477;
-export let a1478 = 1478;
-export let a1479 = 1479;
-export let a1480 = 1480;
-export let a1481 = 1481;
-export let a1482 = 1482;
-export let a1483 = 1483;
-export let a1484 = 1484;
-export let a1485 = 1485;
-export let a1486 = 1486;
-export let a1487 = 1487;
-export let a1488 = 1488;
-export let a1489 = 1489;
-export let a1490 = 1490;
-export let a1491 = 1491;
-export let a1492 = 1492;
-export let a1493 = 1493;
-export let a1494 = 1494;
-export let a1495 = 1495;
-export let a1496 = 1496;
-export let a1497 = 1497;
-export let a1498 = 1498;
-export let a1499 = 1499;
-export let a1500 = 1500;
-export let a1501 = 1501;
-export let a1502 = 1502;
-export let a1503 = 1503;
-export let a1504 = 1504;
-export let a1505 = 1505;
-export let a1506 = 1506;
-export let a1507 = 1507;
-export let a1508 = 1508;
-export let a1509 = 1509;
-export let a1510 = 1510;
-export let a1511 = 1511;
-export let a1512 = 1512;
-export let a1513 = 1513;
-export let a1514 = 1514;
-export let a1515 = 1515;
-export let a1516 = 1516;
-export let a1517 = 1517;
-export let a1518 = 1518;
-export let a1519 = 1519;
-export let a1520 = 1520;
-export let a1521 = 1521;
-export let a1522 = 1522;
-export let a1523 = 1523;
-export let a1524 = 1524;
-export let a1525 = 1525;
-export let a1526 = 1526;
-export let a1527 = 1527;
-export let a1528 = 1528;
-export let a1529 = 1529;
-export let a1530 = 1530;
-export let a1531 = 1531;
-export let a1532 = 1532;
-export let a1533 = 1533;
-export let a1534 = 1534;
-export let a1535 = 1535;
-export let a1536 = 1536;
-export let a1537 = 1537;
-export let a1538 = 1538;
-export let a1539 = 1539;
-export let a1540 = 1540;
-export let a1541 = 1541;
-export let a1542 = 1542;
-export let a1543 = 1543;
-export let a1544 = 1544;
-export let a1545 = 1545;
-export let a1546 = 1546;
-export let a1547 = 1547;
-export let a1548 = 1548;
-export let a1549 = 1549;
-export let a1550 = 1550;
-export let a1551 = 1551;
-export let a1552 = 1552;
-export let a1553 = 1553;
-export let a1554 = 1554;
-export let a1555 = 1555;
-export let a1556 = 1556;
-export let a1557 = 1557;
-export let a1558 = 1558;
-export let a1559 = 1559;
-export let a1560 = 1560;
-export let a1561 = 1561;
-export let a1562 = 1562;
-export let a1563 = 1563;
-export let a1564 = 1564;
-export let a1565 = 1565;
-export let a1566 = 1566;
-export let a1567 = 1567;
-export let a1568 = 1568;
-export let a1569 = 1569;
-export let a1570 = 1570;
-export let a1571 = 1571;
-export let a1572 = 1572;
-export let a1573 = 1573;
-export let a1574 = 1574;
-export let a1575 = 1575;
-export let a1576 = 1576;
-export let a1577 = 1577;
-export let a1578 = 1578;
-export let a1579 = 1579;
-export let a1580 = 1580;
-export let a1581 = 1581;
-export let a1582 = 1582;
-export let a1583 = 1583;
-export let a1584 = 1584;
-export let a1585 = 1585;
-export let a1586 = 1586;
-export let a1587 = 1587;
-export let a1588 = 1588;
-export let a1589 = 1589;
-export let a1590 = 1590;
-export let a1591 = 1591;
-export let a1592 = 1592;
-export let a1593 = 1593;
-export let a1594 = 1594;
-export let a1595 = 1595;
-export let a1596 = 1596;
-export let a1597 = 1597;
-export let a1598 = 1598;
-export let a1599 = 1599;
-export let a1600 = 1600;
-export let a1601 = 1601;
-export let a1602 = 1602;
-export let a1603 = 1603;
-export let a1604 = 1604;
-export let a1605 = 1605;
-export let a1606 = 1606;
-export let a1607 = 1607;
-export let a1608 = 1608;
-export let a1609 = 1609;
-export let a1610 = 1610;
-export let a1611 = 1611;
-export let a1612 = 1612;
-export let a1613 = 1613;
-export let a1614 = 1614;
-export let a1615 = 1615;
-export let a1616 = 1616;
-export let a1617 = 1617;
-export let a1618 = 1618;
-export let a1619 = 1619;
-export let a1620 = 1620;
-export let a1621 = 1621;
-export let a1622 = 1622;
-export let a1623 = 1623;
-export let a1624 = 1624;
-export let a1625 = 1625;
-export let a1626 = 1626;
-export let a1627 = 1627;
-export let a1628 = 1628;
-export let a1629 = 1629;
-export let a1630 = 1630;
-export let a1631 = 1631;
-export let a1632 = 1632;
-export let a1633 = 1633;
-export let a1634 = 1634;
-export let a1635 = 1635;
-export let a1636 = 1636;
-export let a1637 = 1637;
-export let a1638 = 1638;
-export let a1639 = 1639;
-export let a1640 = 1640;
-export let a1641 = 1641;
-export let a1642 = 1642;
-export let a1643 = 1643;
-export let a1644 = 1644;
-export let a1645 = 1645;
-export let a1646 = 1646;
-export let a1647 = 1647;
-export let a1648 = 1648;
-export let a1649 = 1649;
-export let a1650 = 1650;
-export let a1651 = 1651;
-export let a1652 = 1652;
-export let a1653 = 1653;
-export let a1654 = 1654;
-export let a1655 = 1655;
-export let a1656 = 1656;
-export let a1657 = 1657;
-export let a1658 = 1658;
-export let a1659 = 1659;
-export let a1660 = 1660;
-export let a1661 = 1661;
-export let a1662 = 1662;
-export let a1663 = 1663;
-export let a1664 = 1664;
-export let a1665 = 1665;
-export let a1666 = 1666;
-export let a1667 = 1667;
-export let a1668 = 1668;
-export let a1669 = 1669;
-export let a1670 = 1670;
-export let a1671 = 1671;
-export let a1672 = 1672;
-export let a1673 = 1673;
-export let a1674 = 1674;
-export let a1675 = 1675;
-export let a1676 = 1676;
-export let a1677 = 1677;
-export let a1678 = 1678;
-export let a1679 = 1679;
-export let a1680 = 1680;
-export let a1681 = 1681;
-export let a1682 = 1682;
-export let a1683 = 1683;
-export let a1684 = 1684;
-export let a1685 = 1685;
-export let a1686 = 1686;
-export let a1687 = 1687;
-export let a1688 = 1688;
-export let a1689 = 1689;
-export let a1690 = 1690;
-export let a1691 = 1691;
-export let a1692 = 1692;
-export let a1693 = 1693;
-export let a1694 = 1694;
-export let a1695 = 1695;
-export let a1696 = 1696;
-export let a1697 = 1697;
-export let a1698 = 1698;
-export let a1699 = 1699;
-export let a1700 = 1700;
-export let a1701 = 1701;
-export let a1702 = 1702;
-export let a1703 = 1703;
-export let a1704 = 1704;
-export let a1705 = 1705;
-export let a1706 = 1706;
-export let a1707 = 1707;
-export let a1708 = 1708;
-export let a1709 = 1709;
-export let a1710 = 1710;
-export let a1711 = 1711;
-export let a1712 = 1712;
-export let a1713 = 1713;
-export let a1714 = 1714;
-export let a1715 = 1715;
-export let a1716 = 1716;
-export let a1717 = 1717;
-export let a1718 = 1718;
-export let a1719 = 1719;
-export let a1720 = 1720;
-export let a1721 = 1721;
-export let a1722 = 1722;
-export let a1723 = 1723;
-export let a1724 = 1724;
-export let a1725 = 1725;
-export let a1726 = 1726;
-export let a1727 = 1727;
-export let a1728 = 1728;
-export let a1729 = 1729;
-export let a1730 = 1730;
-export let a1731 = 1731;
-export let a1732 = 1732;
-export let a1733 = 1733;
-export let a1734 = 1734;
-export let a1735 = 1735;
-export let a1736 = 1736;
-export let a1737 = 1737;
-export let a1738 = 1738;
-export let a1739 = 1739;
-export let a1740 = 1740;
-export let a1741 = 1741;
-export let a1742 = 1742;
-export let a1743 = 1743;
-export let a1744 = 1744;
-export let a1745 = 1745;
-export let a1746 = 1746;
-export let a1747 = 1747;
-export let a1748 = 1748;
-export let a1749 = 1749;
-export let a1750 = 1750;
-export let a1751 = 1751;
-export let a1752 = 1752;
-export let a1753 = 1753;
-export let a1754 = 1754;
-export let a1755 = 1755;
-export let a1756 = 1756;
-export let a1757 = 1757;
-export let a1758 = 1758;
-export let a1759 = 1759;
-export let a1760 = 1760;
-export let a1761 = 1761;
-export let a1762 = 1762;
-export let a1763 = 1763;
-export let a1764 = 1764;
-export let a1765 = 1765;
-export let a1766 = 1766;
-export let a1767 = 1767;
-export let a1768 = 1768;
-export let a1769 = 1769;
-export let a1770 = 1770;
-export let a1771 = 1771;
-export let a1772 = 1772;
-export let a1773 = 1773;
-export let a1774 = 1774;
-export let a1775 = 1775;
-export let a1776 = 1776;
-export let a1777 = 1777;
-export let a1778 = 1778;
-export let a1779 = 1779;
-export let a1780 = 1780;
-export let a1781 = 1781;
-export let a1782 = 1782;
-export let a1783 = 1783;
-export let a1784 = 1784;
-export let a1785 = 1785;
-export let a1786 = 1786;
-export let a1787 = 1787;
-export let a1788 = 1788;
-export let a1789 = 1789;
-export let a1790 = 1790;
-export let a1791 = 1791;
-export let a1792 = 1792;
-export let a1793 = 1793;
-export let a1794 = 1794;
-export let a1795 = 1795;
-export let a1796 = 1796;
-export let a1797 = 1797;
-export let a1798 = 1798;
-export let a1799 = 1799;
-export let a1800 = 1800;
-export let a1801 = 1801;
-export let a1802 = 1802;
-export let a1803 = 1803;
-export let a1804 = 1804;
-export let a1805 = 1805;
-export let a1806 = 1806;
-export let a1807 = 1807;
-export let a1808 = 1808;
-export let a1809 = 1809;
-export let a1810 = 1810;
-export let a1811 = 1811;
-export let a1812 = 1812;
-export let a1813 = 1813;
-export let a1814 = 1814;
-export let a1815 = 1815;
-export let a1816 = 1816;
-export let a1817 = 1817;
-export let a1818 = 1818;
-export let a1819 = 1819;
-export let a1820 = 1820;
-export let a1821 = 1821;
-export let a1822 = 1822;
-export let a1823 = 1823;
-export let a1824 = 1824;
-export let a1825 = 1825;
-export let a1826 = 1826;
-export let a1827 = 1827;
-export let a1828 = 1828;
-export let a1829 = 1829;
-export let a1830 = 1830;
-export let a1831 = 1831;
-export let a1832 = 1832;
-export let a1833 = 1833;
-export let a1834 = 1834;
-export let a1835 = 1835;
-export let a1836 = 1836;
-export let a1837 = 1837;
-export let a1838 = 1838;
-export let a1839 = 1839;
-export let a1840 = 1840;
-export let a1841 = 1841;
-export let a1842 = 1842;
-export let a1843 = 1843;
-export let a1844 = 1844;
-export let a1845 = 1845;
-export let a1846 = 1846;
-export let a1847 = 1847;
-export let a1848 = 1848;
-export let a1849 = 1849;
-export let a1850 = 1850;
-export let a1851 = 1851;
-export let a1852 = 1852;
-export let a1853 = 1853;
-export let a1854 = 1854;
-export let a1855 = 1855;
-export let a1856 = 1856;
-export let a1857 = 1857;
-export let a1858 = 1858;
-export let a1859 = 1859;
-export let a1860 = 1860;
-export let a1861 = 1861;
-export let a1862 = 1862;
-export let a1863 = 1863;
-export let a1864 = 1864;
-export let a1865 = 1865;
-export let a1866 = 1866;
-export let a1867 = 1867;
-export let a1868 = 1868;
-export let a1869 = 1869;
-export let a1870 = 1870;
-export let a1871 = 1871;
-export let a1872 = 1872;
-export let a1873 = 1873;
-export let a1874 = 1874;
-export let a1875 = 1875;
-export let a1876 = 1876;
-export let a1877 = 1877;
-export let a1878 = 1878;
-export let a1879 = 1879;
-export let a1880 = 1880;
-export let a1881 = 1881;
-export let a1882 = 1882;
-export let a1883 = 1883;
-export let a1884 = 1884;
-export let a1885 = 1885;
-export let a1886 = 1886;
-export let a1887 = 1887;
-export let a1888 = 1888;
-export let a1889 = 1889;
-export let a1890 = 1890;
-export let a1891 = 1891;
-export let a1892 = 1892;
-export let a1893 = 1893;
-export let a1894 = 1894;
-export let a1895 = 1895;
-export let a1896 = 1896;
-export let a1897 = 1897;
-export let a1898 = 1898;
-export let a1899 = 1899;
-export let a1900 = 1900;
-export let a1901 = 1901;
-export let a1902 = 1902;
-export let a1903 = 1903;
-export let a1904 = 1904;
-export let a1905 = 1905;
-export let a1906 = 1906;
-export let a1907 = 1907;
-export let a1908 = 1908;
-export let a1909 = 1909;
-export let a1910 = 1910;
-export let a1911 = 1911;
-export let a1912 = 1912;
-export let a1913 = 1913;
-export let a1914 = 1914;
-export let a1915 = 1915;
-export let a1916 = 1916;
-export let a1917 = 1917;
-export let a1918 = 1918;
-export let a1919 = 1919;
-export let a1920 = 1920;
-export let a1921 = 1921;
-export let a1922 = 1922;
-export let a1923 = 1923;
-export let a1924 = 1924;
-export let a1925 = 1925;
-export let a1926 = 1926;
-export let a1927 = 1927;
-export let a1928 = 1928;
-export let a1929 = 1929;
-export let a1930 = 1930;
-export let a1931 = 1931;
-export let a1932 = 1932;
-export let a1933 = 1933;
-export let a1934 = 1934;
-export let a1935 = 1935;
-export let a1936 = 1936;
-export let a1937 = 1937;
-export let a1938 = 1938;
-export let a1939 = 1939;
-export let a1940 = 1940;
-export let a1941 = 1941;
-export let a1942 = 1942;
-export let a1943 = 1943;
-export let a1944 = 1944;
-export let a1945 = 1945;
-export let a1946 = 1946;
-export let a1947 = 1947;
-export let a1948 = 1948;
-export let a1949 = 1949;
-export let a1950 = 1950;
-export let a1951 = 1951;
-export let a1952 = 1952;
-export let a1953 = 1953;
-export let a1954 = 1954;
-export let a1955 = 1955;
-export let a1956 = 1956;
-export let a1957 = 1957;
-export let a1958 = 1958;
-export let a1959 = 1959;
-export let a1960 = 1960;
-export let a1961 = 1961;
-export let a1962 = 1962;
-export let a1963 = 1963;
-export let a1964 = 1964;
-export let a1965 = 1965;
-export let a1966 = 1966;
-export let a1967 = 1967;
-export let a1968 = 1968;
-export let a1969 = 1969;
-export let a1970 = 1970;
-export let a1971 = 1971;
-export let a1972 = 1972;
-export let a1973 = 1973;
-export let a1974 = 1974;
-export let a1975 = 1975;
-export let a1976 = 1976;
-export let a1977 = 1977;
-export let a1978 = 1978;
-export let a1979 = 1979;
-export let a1980 = 1980;
-export let a1981 = 1981;
-export let a1982 = 1982;
-export let a1983 = 1983;
-export let a1984 = 1984;
-export let a1985 = 1985;
-export let a1986 = 1986;
-export let a1987 = 1987;
-export let a1988 = 1988;
-export let a1989 = 1989;
-export let a1990 = 1990;
-export let a1991 = 1991;
-export let a1992 = 1992;
-export let a1993 = 1993;
-export let a1994 = 1994;
-export let a1995 = 1995;
-export let a1996 = 1996;
-export let a1997 = 1997;
-export let a1998 = 1998;
-export let a1999 = 1999;
-export let a2000 = 2000;
-export let a2001 = 2001;
-export let a2002 = 2002;
-export let a2003 = 2003;
-export let a2004 = 2004;
-export let a2005 = 2005;
-export let a2006 = 2006;
-export let a2007 = 2007;
-export let a2008 = 2008;
-export let a2009 = 2009;
-export let a2010 = 2010;
-export let a2011 = 2011;
-export let a2012 = 2012;
-export let a2013 = 2013;
-export let a2014 = 2014;
-export let a2015 = 2015;
-export let a2016 = 2016;
-export let a2017 = 2017;
-export let a2018 = 2018;
-export let a2019 = 2019;
-export let a2020 = 2020;
-export let a2021 = 2021;
-export let a2022 = 2022;
-export let a2023 = 2023;
-export let a2024 = 2024;
-export let a2025 = 2025;
-export let a2026 = 2026;
-export let a2027 = 2027;
-export let a2028 = 2028;
-export let a2029 = 2029;
-export let a2030 = 2030;
-export let a2031 = 2031;
-export let a2032 = 2032;
-export let a2033 = 2033;
-export let a2034 = 2034;
-export let a2035 = 2035;
-export let a2036 = 2036;
-export let a2037 = 2037;
-export let a2038 = 2038;
-export let a2039 = 2039;
-export let a2040 = 2040;
-export let a2041 = 2041;
-export let a2042 = 2042;
-export let a2043 = 2043;
-export let a2044 = 2044;
-export let a2045 = 2045;
-export let a2046 = 2046;
-export let a2047 = 2047;
-export let a2048 = 2048;
-export let a2049 = 2049;
-export let a2050 = 2050;
-export let a2051 = 2051;
-export let a2052 = 2052;
-export let a2053 = 2053;
-export let a2054 = 2054;
-export let a2055 = 2055;
-export let a2056 = 2056;
-export let a2057 = 2057;
-export let a2058 = 2058;
-export let a2059 = 2059;
-export let a2060 = 2060;
-export let a2061 = 2061;
-export let a2062 = 2062;
-export let a2063 = 2063;
-export let a2064 = 2064;
-export let a2065 = 2065;
-export let a2066 = 2066;
-export let a2067 = 2067;
-export let a2068 = 2068;
-export let a2069 = 2069;
-export let a2070 = 2070;
-export let a2071 = 2071;
-export let a2072 = 2072;
-export let a2073 = 2073;
-export let a2074 = 2074;
-export let a2075 = 2075;
-export let a2076 = 2076;
-export let a2077 = 2077;
-export let a2078 = 2078;
-export let a2079 = 2079;
-export let a2080 = 2080;
-export let a2081 = 2081;
-export let a2082 = 2082;
-export let a2083 = 2083;
-export let a2084 = 2084;
-export let a2085 = 2085;
-export let a2086 = 2086;
-export let a2087 = 2087;
-export let a2088 = 2088;
-export let a2089 = 2089;
-export let a2090 = 2090;
-export let a2091 = 2091;
-export let a2092 = 2092;
-export let a2093 = 2093;
-export let a2094 = 2094;
-export let a2095 = 2095;
-export let a2096 = 2096;
-export let a2097 = 2097;
-export let a2098 = 2098;
-export let a2099 = 2099;
-export let a2100 = 2100;
-export let a2101 = 2101;
-export let a2102 = 2102;
-export let a2103 = 2103;
-export let a2104 = 2104;
-export let a2105 = 2105;
-export let a2106 = 2106;
-export let a2107 = 2107;
-export let a2108 = 2108;
-export let a2109 = 2109;
-export let a2110 = 2110;
-export let a2111 = 2111;
-export let a2112 = 2112;
-export let a2113 = 2113;
-export let a2114 = 2114;
-export let a2115 = 2115;
-export let a2116 = 2116;
-export let a2117 = 2117;
-export let a2118 = 2118;
-export let a2119 = 2119;
-export let a2120 = 2120;
-export let a2121 = 2121;
-export let a2122 = 2122;
-export let a2123 = 2123;
-export let a2124 = 2124;
-export let a2125 = 2125;
-export let a2126 = 2126;
-export let a2127 = 2127;
-export let a2128 = 2128;
-export let a2129 = 2129;
-export let a2130 = 2130;
-export let a2131 = 2131;
-export let a2132 = 2132;
-export let a2133 = 2133;
-export let a2134 = 2134;
-export let a2135 = 2135;
-export let a2136 = 2136;
-export let a2137 = 2137;
-export let a2138 = 2138;
-export let a2139 = 2139;
-export let a2140 = 2140;
-export let a2141 = 2141;
-export let a2142 = 2142;
-export let a2143 = 2143;
-export let a2144 = 2144;
-export let a2145 = 2145;
-export let a2146 = 2146;
-export let a2147 = 2147;
-export let a2148 = 2148;
-export let a2149 = 2149;
-export let a2150 = 2150;
-export let a2151 = 2151;
-export let a2152 = 2152;
-export let a2153 = 2153;
-export let a2154 = 2154;
-export let a2155 = 2155;
-export let a2156 = 2156;
-export let a2157 = 2157;
-export let a2158 = 2158;
-export let a2159 = 2159;
-export let a2160 = 2160;
-export let a2161 = 2161;
-export let a2162 = 2162;
-export let a2163 = 2163;
-export let a2164 = 2164;
-export let a2165 = 2165;
-export let a2166 = 2166;
-export let a2167 = 2167;
-export let a2168 = 2168;
-export let a2169 = 2169;
-export let a2170 = 2170;
-export let a2171 = 2171;
-export let a2172 = 2172;
-export let a2173 = 2173;
-export let a2174 = 2174;
-export let a2175 = 2175;
-export let a2176 = 2176;
-export let a2177 = 2177;
-export let a2178 = 2178;
-export let a2179 = 2179;
-export let a2180 = 2180;
-export let a2181 = 2181;
-export let a2182 = 2182;
-export let a2183 = 2183;
-export let a2184 = 2184;
-export let a2185 = 2185;
-export let a2186 = 2186;
-export let a2187 = 2187;
-export let a2188 = 2188;
-export let a2189 = 2189;
-export let a2190 = 2190;
-export let a2191 = 2191;
-export let a2192 = 2192;
-export let a2193 = 2193;
-export let a2194 = 2194;
-export let a2195 = 2195;
-export let a2196 = 2196;
-export let a2197 = 2197;
-export let a2198 = 2198;
-export let a2199 = 2199;
diff --git a/src/v8/test/mjsunit/harmony/modules-skip-large2.js b/src/v8/test/mjsunit/harmony/modules-skip-large2.js
deleted file mode 100644
index 2c03557..0000000
--- a/src/v8/test/mjsunit/harmony/modules-skip-large2.js
+++ /dev/null
@@ -1,1104 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export let a0 = 0;
-export let a1 = 1;
-export let a2 = 2;
-export let a3 = 3;
-export let a4 = 4;
-export let a5 = 5;
-export let a6 = 6;
-export let a7 = 7;
-export let a8 = 8;
-export let a9 = 9;
-export let a10 = 10;
-export let a11 = 11;
-export let a12 = 12;
-export let a13 = 13;
-export let a14 = 14;
-export let a15 = 15;
-export let a16 = 16;
-export let a17 = 17;
-export let a18 = 18;
-export let a19 = 19;
-export let a20 = 20;
-export let a21 = 21;
-export let a22 = 22;
-export let a23 = 23;
-export let a24 = 24;
-export let a25 = 25;
-export let a26 = 26;
-export let a27 = 27;
-export let a28 = 28;
-export let a29 = 29;
-export let a30 = 30;
-export let a31 = 31;
-export let a32 = 32;
-export let a33 = 33;
-export let a34 = 34;
-export let a35 = 35;
-export let a36 = 36;
-export let a37 = 37;
-export let a38 = 38;
-export let a39 = 39;
-export let a40 = 40;
-export let a41 = 41;
-export let a42 = 42;
-export let a43 = 43;
-export let a44 = 44;
-export let a45 = 45;
-export let a46 = 46;
-export let a47 = 47;
-export let a48 = 48;
-export let a49 = 49;
-export let a50 = 50;
-export let a51 = 51;
-export let a52 = 52;
-export let a53 = 53;
-export let a54 = 54;
-export let a55 = 55;
-export let a56 = 56;
-export let a57 = 57;
-export let a58 = 58;
-export let a59 = 59;
-export let a60 = 60;
-export let a61 = 61;
-export let a62 = 62;
-export let a63 = 63;
-export let a64 = 64;
-export let a65 = 65;
-export let a66 = 66;
-export let a67 = 67;
-export let a68 = 68;
-export let a69 = 69;
-export let a70 = 70;
-export let a71 = 71;
-export let a72 = 72;
-export let a73 = 73;
-export let a74 = 74;
-export let a75 = 75;
-export let a76 = 76;
-export let a77 = 77;
-export let a78 = 78;
-export let a79 = 79;
-export let a80 = 80;
-export let a81 = 81;
-export let a82 = 82;
-export let a83 = 83;
-export let a84 = 84;
-export let a85 = 85;
-export let a86 = 86;
-export let a87 = 87;
-export let a88 = 88;
-export let a89 = 89;
-export let a90 = 90;
-export let a91 = 91;
-export let a92 = 92;
-export let a93 = 93;
-export let a94 = 94;
-export let a95 = 95;
-export let a96 = 96;
-export let a97 = 97;
-export let a98 = 98;
-export let a99 = 99;
-export let a100 = 100;
-export let a101 = 101;
-export let a102 = 102;
-export let a103 = 103;
-export let a104 = 104;
-export let a105 = 105;
-export let a106 = 106;
-export let a107 = 107;
-export let a108 = 108;
-export let a109 = 109;
-export let a110 = 110;
-export let a111 = 111;
-export let a112 = 112;
-export let a113 = 113;
-export let a114 = 114;
-export let a115 = 115;
-export let a116 = 116;
-export let a117 = 117;
-export let a118 = 118;
-export let a119 = 119;
-export let a120 = 120;
-export let a121 = 121;
-export let a122 = 122;
-export let a123 = 123;
-export let a124 = 124;
-export let a125 = 125;
-export let a126 = 126;
-export let a127 = 127;
-export let a128 = 128;
-export let a129 = 129;
-export let a130 = 130;
-export let a131 = 131;
-export let a132 = 132;
-export let a133 = 133;
-export let a134 = 134;
-export let a135 = 135;
-export let a136 = 136;
-export let a137 = 137;
-export let a138 = 138;
-export let a139 = 139;
-export let a140 = 140;
-export let a141 = 141;
-export let a142 = 142;
-export let a143 = 143;
-export let a144 = 144;
-export let a145 = 145;
-export let a146 = 146;
-export let a147 = 147;
-export let a148 = 148;
-export let a149 = 149;
-export let a150 = 150;
-export let a151 = 151;
-export let a152 = 152;
-export let a153 = 153;
-export let a154 = 154;
-export let a155 = 155;
-export let a156 = 156;
-export let a157 = 157;
-export let a158 = 158;
-export let a159 = 159;
-export let a160 = 160;
-export let a161 = 161;
-export let a162 = 162;
-export let a163 = 163;
-export let a164 = 164;
-export let a165 = 165;
-export let a166 = 166;
-export let a167 = 167;
-export let a168 = 168;
-export let a169 = 169;
-export let a170 = 170;
-export let a171 = 171;
-export let a172 = 172;
-export let a173 = 173;
-export let a174 = 174;
-export let a175 = 175;
-export let a176 = 176;
-export let a177 = 177;
-export let a178 = 178;
-export let a179 = 179;
-export let a180 = 180;
-export let a181 = 181;
-export let a182 = 182;
-export let a183 = 183;
-export let a184 = 184;
-export let a185 = 185;
-export let a186 = 186;
-export let a187 = 187;
-export let a188 = 188;
-export let a189 = 189;
-export let a190 = 190;
-export let a191 = 191;
-export let a192 = 192;
-export let a193 = 193;
-export let a194 = 194;
-export let a195 = 195;
-export let a196 = 196;
-export let a197 = 197;
-export let a198 = 198;
-export let a199 = 199;
-export let a200 = 200;
-export let a201 = 201;
-export let a202 = 202;
-export let a203 = 203;
-export let a204 = 204;
-export let a205 = 205;
-export let a206 = 206;
-export let a207 = 207;
-export let a208 = 208;
-export let a209 = 209;
-export let a210 = 210;
-export let a211 = 211;
-export let a212 = 212;
-export let a213 = 213;
-export let a214 = 214;
-export let a215 = 215;
-export let a216 = 216;
-export let a217 = 217;
-export let a218 = 218;
-export let a219 = 219;
-export let a220 = 220;
-export let a221 = 221;
-export let a222 = 222;
-export let a223 = 223;
-export let a224 = 224;
-export let a225 = 225;
-export let a226 = 226;
-export let a227 = 227;
-export let a228 = 228;
-export let a229 = 229;
-export let a230 = 230;
-export let a231 = 231;
-export let a232 = 232;
-export let a233 = 233;
-export let a234 = 234;
-export let a235 = 235;
-export let a236 = 236;
-export let a237 = 237;
-export let a238 = 238;
-export let a239 = 239;
-export let a240 = 240;
-export let a241 = 241;
-export let a242 = 242;
-export let a243 = 243;
-export let a244 = 244;
-export let a245 = 245;
-export let a246 = 246;
-export let a247 = 247;
-export let a248 = 248;
-export let a249 = 249;
-export let a250 = 250;
-export let a251 = 251;
-export let a252 = 252;
-export let a253 = 253;
-export let a254 = 254;
-export let a255 = 255;
-export let a256 = 256;
-export let a257 = 257;
-export let a258 = 258;
-export let a259 = 259;
-export let a260 = 260;
-export let a261 = 261;
-export let a262 = 262;
-export let a263 = 263;
-export let a264 = 264;
-export let a265 = 265;
-export let a266 = 266;
-export let a267 = 267;
-export let a268 = 268;
-export let a269 = 269;
-export let a270 = 270;
-export let a271 = 271;
-export let a272 = 272;
-export let a273 = 273;
-export let a274 = 274;
-export let a275 = 275;
-export let a276 = 276;
-export let a277 = 277;
-export let a278 = 278;
-export let a279 = 279;
-export let a280 = 280;
-export let a281 = 281;
-export let a282 = 282;
-export let a283 = 283;
-export let a284 = 284;
-export let a285 = 285;
-export let a286 = 286;
-export let a287 = 287;
-export let a288 = 288;
-export let a289 = 289;
-export let a290 = 290;
-export let a291 = 291;
-export let a292 = 292;
-export let a293 = 293;
-export let a294 = 294;
-export let a295 = 295;
-export let a296 = 296;
-export let a297 = 297;
-export let a298 = 298;
-export let a299 = 299;
-export let a300 = 300;
-export let a301 = 301;
-export let a302 = 302;
-export let a303 = 303;
-export let a304 = 304;
-export let a305 = 305;
-export let a306 = 306;
-export let a307 = 307;
-export let a308 = 308;
-export let a309 = 309;
-export let a310 = 310;
-export let a311 = 311;
-export let a312 = 312;
-export let a313 = 313;
-export let a314 = 314;
-export let a315 = 315;
-export let a316 = 316;
-export let a317 = 317;
-export let a318 = 318;
-export let a319 = 319;
-export let a320 = 320;
-export let a321 = 321;
-export let a322 = 322;
-export let a323 = 323;
-export let a324 = 324;
-export let a325 = 325;
-export let a326 = 326;
-export let a327 = 327;
-export let a328 = 328;
-export let a329 = 329;
-export let a330 = 330;
-export let a331 = 331;
-export let a332 = 332;
-export let a333 = 333;
-export let a334 = 334;
-export let a335 = 335;
-export let a336 = 336;
-export let a337 = 337;
-export let a338 = 338;
-export let a339 = 339;
-export let a340 = 340;
-export let a341 = 341;
-export let a342 = 342;
-export let a343 = 343;
-export let a344 = 344;
-export let a345 = 345;
-export let a346 = 346;
-export let a347 = 347;
-export let a348 = 348;
-export let a349 = 349;
-export let a350 = 350;
-export let a351 = 351;
-export let a352 = 352;
-export let a353 = 353;
-export let a354 = 354;
-export let a355 = 355;
-export let a356 = 356;
-export let a357 = 357;
-export let a358 = 358;
-export let a359 = 359;
-export let a360 = 360;
-export let a361 = 361;
-export let a362 = 362;
-export let a363 = 363;
-export let a364 = 364;
-export let a365 = 365;
-export let a366 = 366;
-export let a367 = 367;
-export let a368 = 368;
-export let a369 = 369;
-export let a370 = 370;
-export let a371 = 371;
-export let a372 = 372;
-export let a373 = 373;
-export let a374 = 374;
-export let a375 = 375;
-export let a376 = 376;
-export let a377 = 377;
-export let a378 = 378;
-export let a379 = 379;
-export let a380 = 380;
-export let a381 = 381;
-export let a382 = 382;
-export let a383 = 383;
-export let a384 = 384;
-export let a385 = 385;
-export let a386 = 386;
-export let a387 = 387;
-export let a388 = 388;
-export let a389 = 389;
-export let a390 = 390;
-export let a391 = 391;
-export let a392 = 392;
-export let a393 = 393;
-export let a394 = 394;
-export let a395 = 395;
-export let a396 = 396;
-export let a397 = 397;
-export let a398 = 398;
-export let a399 = 399;
-export let a400 = 400;
-export let a401 = 401;
-export let a402 = 402;
-export let a403 = 403;
-export let a404 = 404;
-export let a405 = 405;
-export let a406 = 406;
-export let a407 = 407;
-export let a408 = 408;
-export let a409 = 409;
-export let a410 = 410;
-export let a411 = 411;
-export let a412 = 412;
-export let a413 = 413;
-export let a414 = 414;
-export let a415 = 415;
-export let a416 = 416;
-export let a417 = 417;
-export let a418 = 418;
-export let a419 = 419;
-export let a420 = 420;
-export let a421 = 421;
-export let a422 = 422;
-export let a423 = 423;
-export let a424 = 424;
-export let a425 = 425;
-export let a426 = 426;
-export let a427 = 427;
-export let a428 = 428;
-export let a429 = 429;
-export let a430 = 430;
-export let a431 = 431;
-export let a432 = 432;
-export let a433 = 433;
-export let a434 = 434;
-export let a435 = 435;
-export let a436 = 436;
-export let a437 = 437;
-export let a438 = 438;
-export let a439 = 439;
-export let a440 = 440;
-export let a441 = 441;
-export let a442 = 442;
-export let a443 = 443;
-export let a444 = 444;
-export let a445 = 445;
-export let a446 = 446;
-export let a447 = 447;
-export let a448 = 448;
-export let a449 = 449;
-export let a450 = 450;
-export let a451 = 451;
-export let a452 = 452;
-export let a453 = 453;
-export let a454 = 454;
-export let a455 = 455;
-export let a456 = 456;
-export let a457 = 457;
-export let a458 = 458;
-export let a459 = 459;
-export let a460 = 460;
-export let a461 = 461;
-export let a462 = 462;
-export let a463 = 463;
-export let a464 = 464;
-export let a465 = 465;
-export let a466 = 466;
-export let a467 = 467;
-export let a468 = 468;
-export let a469 = 469;
-export let a470 = 470;
-export let a471 = 471;
-export let a472 = 472;
-export let a473 = 473;
-export let a474 = 474;
-export let a475 = 475;
-export let a476 = 476;
-export let a477 = 477;
-export let a478 = 478;
-export let a479 = 479;
-export let a480 = 480;
-export let a481 = 481;
-export let a482 = 482;
-export let a483 = 483;
-export let a484 = 484;
-export let a485 = 485;
-export let a486 = 486;
-export let a487 = 487;
-export let a488 = 488;
-export let a489 = 489;
-export let a490 = 490;
-export let a491 = 491;
-export let a492 = 492;
-export let a493 = 493;
-export let a494 = 494;
-export let a495 = 495;
-export let a496 = 496;
-export let a497 = 497;
-export let a498 = 498;
-export let a499 = 499;
-export let a500 = 500;
-export let a501 = 501;
-export let a502 = 502;
-export let a503 = 503;
-export let a504 = 504;
-export let a505 = 505;
-export let a506 = 506;
-export let a507 = 507;
-export let a508 = 508;
-export let a509 = 509;
-export let a510 = 510;
-export let a511 = 511;
-export let a512 = 512;
-export let a513 = 513;
-export let a514 = 514;
-export let a515 = 515;
-export let a516 = 516;
-export let a517 = 517;
-export let a518 = 518;
-export let a519 = 519;
-export let a520 = 520;
-export let a521 = 521;
-export let a522 = 522;
-export let a523 = 523;
-export let a524 = 524;
-export let a525 = 525;
-export let a526 = 526;
-export let a527 = 527;
-export let a528 = 528;
-export let a529 = 529;
-export let a530 = 530;
-export let a531 = 531;
-export let a532 = 532;
-export let a533 = 533;
-export let a534 = 534;
-export let a535 = 535;
-export let a536 = 536;
-export let a537 = 537;
-export let a538 = 538;
-export let a539 = 539;
-export let a540 = 540;
-export let a541 = 541;
-export let a542 = 542;
-export let a543 = 543;
-export let a544 = 544;
-export let a545 = 545;
-export let a546 = 546;
-export let a547 = 547;
-export let a548 = 548;
-export let a549 = 549;
-export let a550 = 550;
-export let a551 = 551;
-export let a552 = 552;
-export let a553 = 553;
-export let a554 = 554;
-export let a555 = 555;
-export let a556 = 556;
-export let a557 = 557;
-export let a558 = 558;
-export let a559 = 559;
-export let a560 = 560;
-export let a561 = 561;
-export let a562 = 562;
-export let a563 = 563;
-export let a564 = 564;
-export let a565 = 565;
-export let a566 = 566;
-export let a567 = 567;
-export let a568 = 568;
-export let a569 = 569;
-export let a570 = 570;
-export let a571 = 571;
-export let a572 = 572;
-export let a573 = 573;
-export let a574 = 574;
-export let a575 = 575;
-export let a576 = 576;
-export let a577 = 577;
-export let a578 = 578;
-export let a579 = 579;
-export let a580 = 580;
-export let a581 = 581;
-export let a582 = 582;
-export let a583 = 583;
-export let a584 = 584;
-export let a585 = 585;
-export let a586 = 586;
-export let a587 = 587;
-export let a588 = 588;
-export let a589 = 589;
-export let a590 = 590;
-export let a591 = 591;
-export let a592 = 592;
-export let a593 = 593;
-export let a594 = 594;
-export let a595 = 595;
-export let a596 = 596;
-export let a597 = 597;
-export let a598 = 598;
-export let a599 = 599;
-export let a600 = 600;
-export let a601 = 601;
-export let a602 = 602;
-export let a603 = 603;
-export let a604 = 604;
-export let a605 = 605;
-export let a606 = 606;
-export let a607 = 607;
-export let a608 = 608;
-export let a609 = 609;
-export let a610 = 610;
-export let a611 = 611;
-export let a612 = 612;
-export let a613 = 613;
-export let a614 = 614;
-export let a615 = 615;
-export let a616 = 616;
-export let a617 = 617;
-export let a618 = 618;
-export let a619 = 619;
-export let a620 = 620;
-export let a621 = 621;
-export let a622 = 622;
-export let a623 = 623;
-export let a624 = 624;
-export let a625 = 625;
-export let a626 = 626;
-export let a627 = 627;
-export let a628 = 628;
-export let a629 = 629;
-export let a630 = 630;
-export let a631 = 631;
-export let a632 = 632;
-export let a633 = 633;
-export let a634 = 634;
-export let a635 = 635;
-export let a636 = 636;
-export let a637 = 637;
-export let a638 = 638;
-export let a639 = 639;
-export let a640 = 640;
-export let a641 = 641;
-export let a642 = 642;
-export let a643 = 643;
-export let a644 = 644;
-export let a645 = 645;
-export let a646 = 646;
-export let a647 = 647;
-export let a648 = 648;
-export let a649 = 649;
-export let a650 = 650;
-export let a651 = 651;
-export let a652 = 652;
-export let a653 = 653;
-export let a654 = 654;
-export let a655 = 655;
-export let a656 = 656;
-export let a657 = 657;
-export let a658 = 658;
-export let a659 = 659;
-export let a660 = 660;
-export let a661 = 661;
-export let a662 = 662;
-export let a663 = 663;
-export let a664 = 664;
-export let a665 = 665;
-export let a666 = 666;
-export let a667 = 667;
-export let a668 = 668;
-export let a669 = 669;
-export let a670 = 670;
-export let a671 = 671;
-export let a672 = 672;
-export let a673 = 673;
-export let a674 = 674;
-export let a675 = 675;
-export let a676 = 676;
-export let a677 = 677;
-export let a678 = 678;
-export let a679 = 679;
-export let a680 = 680;
-export let a681 = 681;
-export let a682 = 682;
-export let a683 = 683;
-export let a684 = 684;
-export let a685 = 685;
-export let a686 = 686;
-export let a687 = 687;
-export let a688 = 688;
-export let a689 = 689;
-export let a690 = 690;
-export let a691 = 691;
-export let a692 = 692;
-export let a693 = 693;
-export let a694 = 694;
-export let a695 = 695;
-export let a696 = 696;
-export let a697 = 697;
-export let a698 = 698;
-export let a699 = 699;
-export let a700 = 700;
-export let a701 = 701;
-export let a702 = 702;
-export let a703 = 703;
-export let a704 = 704;
-export let a705 = 705;
-export let a706 = 706;
-export let a707 = 707;
-export let a708 = 708;
-export let a709 = 709;
-export let a710 = 710;
-export let a711 = 711;
-export let a712 = 712;
-export let a713 = 713;
-export let a714 = 714;
-export let a715 = 715;
-export let a716 = 716;
-export let a717 = 717;
-export let a718 = 718;
-export let a719 = 719;
-export let a720 = 720;
-export let a721 = 721;
-export let a722 = 722;
-export let a723 = 723;
-export let a724 = 724;
-export let a725 = 725;
-export let a726 = 726;
-export let a727 = 727;
-export let a728 = 728;
-export let a729 = 729;
-export let a730 = 730;
-export let a731 = 731;
-export let a732 = 732;
-export let a733 = 733;
-export let a734 = 734;
-export let a735 = 735;
-export let a736 = 736;
-export let a737 = 737;
-export let a738 = 738;
-export let a739 = 739;
-export let a740 = 740;
-export let a741 = 741;
-export let a742 = 742;
-export let a743 = 743;
-export let a744 = 744;
-export let a745 = 745;
-export let a746 = 746;
-export let a747 = 747;
-export let a748 = 748;
-export let a749 = 749;
-export let a750 = 750;
-export let a751 = 751;
-export let a752 = 752;
-export let a753 = 753;
-export let a754 = 754;
-export let a755 = 755;
-export let a756 = 756;
-export let a757 = 757;
-export let a758 = 758;
-export let a759 = 759;
-export let a760 = 760;
-export let a761 = 761;
-export let a762 = 762;
-export let a763 = 763;
-export let a764 = 764;
-export let a765 = 765;
-export let a766 = 766;
-export let a767 = 767;
-export let a768 = 768;
-export let a769 = 769;
-export let a770 = 770;
-export let a771 = 771;
-export let a772 = 772;
-export let a773 = 773;
-export let a774 = 774;
-export let a775 = 775;
-export let a776 = 776;
-export let a777 = 777;
-export let a778 = 778;
-export let a779 = 779;
-export let a780 = 780;
-export let a781 = 781;
-export let a782 = 782;
-export let a783 = 783;
-export let a784 = 784;
-export let a785 = 785;
-export let a786 = 786;
-export let a787 = 787;
-export let a788 = 788;
-export let a789 = 789;
-export let a790 = 790;
-export let a791 = 791;
-export let a792 = 792;
-export let a793 = 793;
-export let a794 = 794;
-export let a795 = 795;
-export let a796 = 796;
-export let a797 = 797;
-export let a798 = 798;
-export let a799 = 799;
-export let a800 = 800;
-export let a801 = 801;
-export let a802 = 802;
-export let a803 = 803;
-export let a804 = 804;
-export let a805 = 805;
-export let a806 = 806;
-export let a807 = 807;
-export let a808 = 808;
-export let a809 = 809;
-export let a810 = 810;
-export let a811 = 811;
-export let a812 = 812;
-export let a813 = 813;
-export let a814 = 814;
-export let a815 = 815;
-export let a816 = 816;
-export let a817 = 817;
-export let a818 = 818;
-export let a819 = 819;
-export let a820 = 820;
-export let a821 = 821;
-export let a822 = 822;
-export let a823 = 823;
-export let a824 = 824;
-export let a825 = 825;
-export let a826 = 826;
-export let a827 = 827;
-export let a828 = 828;
-export let a829 = 829;
-export let a830 = 830;
-export let a831 = 831;
-export let a832 = 832;
-export let a833 = 833;
-export let a834 = 834;
-export let a835 = 835;
-export let a836 = 836;
-export let a837 = 837;
-export let a838 = 838;
-export let a839 = 839;
-export let a840 = 840;
-export let a841 = 841;
-export let a842 = 842;
-export let a843 = 843;
-export let a844 = 844;
-export let a845 = 845;
-export let a846 = 846;
-export let a847 = 847;
-export let a848 = 848;
-export let a849 = 849;
-export let a850 = 850;
-export let a851 = 851;
-export let a852 = 852;
-export let a853 = 853;
-export let a854 = 854;
-export let a855 = 855;
-export let a856 = 856;
-export let a857 = 857;
-export let a858 = 858;
-export let a859 = 859;
-export let a860 = 860;
-export let a861 = 861;
-export let a862 = 862;
-export let a863 = 863;
-export let a864 = 864;
-export let a865 = 865;
-export let a866 = 866;
-export let a867 = 867;
-export let a868 = 868;
-export let a869 = 869;
-export let a870 = 870;
-export let a871 = 871;
-export let a872 = 872;
-export let a873 = 873;
-export let a874 = 874;
-export let a875 = 875;
-export let a876 = 876;
-export let a877 = 877;
-export let a878 = 878;
-export let a879 = 879;
-export let a880 = 880;
-export let a881 = 881;
-export let a882 = 882;
-export let a883 = 883;
-export let a884 = 884;
-export let a885 = 885;
-export let a886 = 886;
-export let a887 = 887;
-export let a888 = 888;
-export let a889 = 889;
-export let a890 = 890;
-export let a891 = 891;
-export let a892 = 892;
-export let a893 = 893;
-export let a894 = 894;
-export let a895 = 895;
-export let a896 = 896;
-export let a897 = 897;
-export let a898 = 898;
-export let a899 = 899;
-export let a900 = 900;
-export let a901 = 901;
-export let a902 = 902;
-export let a903 = 903;
-export let a904 = 904;
-export let a905 = 905;
-export let a906 = 906;
-export let a907 = 907;
-export let a908 = 908;
-export let a909 = 909;
-export let a910 = 910;
-export let a911 = 911;
-export let a912 = 912;
-export let a913 = 913;
-export let a914 = 914;
-export let a915 = 915;
-export let a916 = 916;
-export let a917 = 917;
-export let a918 = 918;
-export let a919 = 919;
-export let a920 = 920;
-export let a921 = 921;
-export let a922 = 922;
-export let a923 = 923;
-export let a924 = 924;
-export let a925 = 925;
-export let a926 = 926;
-export let a927 = 927;
-export let a928 = 928;
-export let a929 = 929;
-export let a930 = 930;
-export let a931 = 931;
-export let a932 = 932;
-export let a933 = 933;
-export let a934 = 934;
-export let a935 = 935;
-export let a936 = 936;
-export let a937 = 937;
-export let a938 = 938;
-export let a939 = 939;
-export let a940 = 940;
-export let a941 = 941;
-export let a942 = 942;
-export let a943 = 943;
-export let a944 = 944;
-export let a945 = 945;
-export let a946 = 946;
-export let a947 = 947;
-export let a948 = 948;
-export let a949 = 949;
-export let a950 = 950;
-export let a951 = 951;
-export let a952 = 952;
-export let a953 = 953;
-export let a954 = 954;
-export let a955 = 955;
-export let a956 = 956;
-export let a957 = 957;
-export let a958 = 958;
-export let a959 = 959;
-export let a960 = 960;
-export let a961 = 961;
-export let a962 = 962;
-export let a963 = 963;
-export let a964 = 964;
-export let a965 = 965;
-export let a966 = 966;
-export let a967 = 967;
-export let a968 = 968;
-export let a969 = 969;
-export let a970 = 970;
-export let a971 = 971;
-export let a972 = 972;
-export let a973 = 973;
-export let a974 = 974;
-export let a975 = 975;
-export let a976 = 976;
-export let a977 = 977;
-export let a978 = 978;
-export let a979 = 979;
-export let a980 = 980;
-export let a981 = 981;
-export let a982 = 982;
-export let a983 = 983;
-export let a984 = 984;
-export let a985 = 985;
-export let a986 = 986;
-export let a987 = 987;
-export let a988 = 988;
-export let a989 = 989;
-export let a990 = 990;
-export let a991 = 991;
-export let a992 = 992;
-export let a993 = 993;
-export let a994 = 994;
-export let a995 = 995;
-export let a996 = 996;
-export let a997 = 997;
-export let a998 = 998;
-export let a999 = 999;
-export let a1000 = 1000;
-export let a1001 = 1001;
-export let a1002 = 1002;
-export let a1003 = 1003;
-export let a1004 = 1004;
-export let a1005 = 1005;
-export let a1006 = 1006;
-export let a1007 = 1007;
-export let a1008 = 1008;
-export let a1009 = 1009;
-export let a1010 = 1010;
-export let a1011 = 1011;
-export let a1012 = 1012;
-export let a1013 = 1013;
-export let a1014 = 1014;
-export let a1015 = 1015;
-export let a1016 = 1016;
-export let a1017 = 1017;
-export let a1018 = 1018;
-export let a1019 = 1019;
-export let a1020 = 1020;
-export let a1021 = 1021;
-export let a1022 = 1022;
-export let a1023 = 1023;
-export let a1024 = 1024;
-export let a1025 = 1025;
-export let a1026 = 1026;
-export let a1027 = 1027;
-export let a1028 = 1028;
-export let a1029 = 1029;
-export let a1030 = 1030;
-export let a1031 = 1031;
-export let a1032 = 1032;
-export let a1033 = 1033;
-export let a1034 = 1034;
-export let a1035 = 1035;
-export let a1036 = 1036;
-export let a1037 = 1037;
-export let a1038 = 1038;
-export let a1039 = 1039;
-export let a1040 = 1040;
-export let a1041 = 1041;
-export let a1042 = 1042;
-export let a1043 = 1043;
-export let a1044 = 1044;
-export let a1045 = 1045;
-export let a1046 = 1046;
-export let a1047 = 1047;
-export let a1048 = 1048;
-export let a1049 = 1049;
-export let a1050 = 1050;
-export let a1051 = 1051;
-export let a1052 = 1052;
-export let a1053 = 1053;
-export let a1054 = 1054;
-export let a1055 = 1055;
-export let a1056 = 1056;
-export let a1057 = 1057;
-export let a1058 = 1058;
-export let a1059 = 1059;
-export let a1060 = 1060;
-export let a1061 = 1061;
-export let a1062 = 1062;
-export let a1063 = 1063;
-export let a1064 = 1064;
-export let a1065 = 1065;
-export let a1066 = 1066;
-export let a1067 = 1067;
-export let a1068 = 1068;
-export let a1069 = 1069;
-export let a1070 = 1070;
-export let a1071 = 1071;
-export let a1072 = 1072;
-export let a1073 = 1073;
-export let a1074 = 1074;
-export let a1075 = 1075;
-export let a1076 = 1076;
-export let a1077 = 1077;
-export let a1078 = 1078;
-export let a1079 = 1079;
-export let a1080 = 1080;
-export let a1081 = 1081;
-export let a1082 = 1082;
-export let a1083 = 1083;
-export let a1084 = 1084;
-export let a1085 = 1085;
-export let a1086 = 1086;
-export let a1087 = 1087;
-export let a1088 = 1088;
-export let a1089 = 1089;
-export let a1090 = 1090;
-export let a1091 = 1091;
-export let a1092 = 1092;
-export let a1093 = 1093;
-export let a1094 = 1094;
-export let a1095 = 1095;
-export let a1096 = 1096;
-export let a1097 = 1097;
-export let a1098 = 1098;
-export let a1099 = 1099;
diff --git a/src/v8/test/mjsunit/harmony/regexp-property-disabled.js b/src/v8/test/mjsunit/harmony/regexp-property-disabled.js
deleted file mode 100644
index f471ef4..0000000
--- a/src/v8/test/mjsunit/harmony/regexp-property-disabled.js
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --no-harmony-regexp-property
-
-function test(source, message) {
-  try {
-    eval(source);
-  } catch (e) {
-    assertEquals(message, e.message);
-    return;
-  }
-  assertUnreachable();
-}
-
-test("/\\pL/u", "Invalid regular expression: /\\pL/: Invalid escape");
-test("/[\\p{L}]/u", "Invalid regular expression: /[\\p{L}]/: Invalid escape");
diff --git a/src/v8/test/mjsunit/harmony/regress/regress-4658.js b/src/v8/test/mjsunit/harmony/regress/regress-4658.js
deleted file mode 100644
index 35bea12..0000000
--- a/src/v8/test/mjsunit/harmony/regress/regress-4658.js
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --harmony-do-expressions
-
-(function testWithSimpleLoopVariable() {
-  var f = (x, y = (do { var s=0; for (var e of x) s += e; s; })) => y*(y+1);
-  var result = f([1,2,3]);  // core dump here, if not fixed.
-  assertEquals(result, 42);
-})();
-
-(function testWithComplexLoopVariable() {
-  var f = (x, i=x[0]-1, a=[],
-           y = (do { var s=0;
-                     for (a[i] of x) s += a[i++];
-                     s;
-                   })) => y*(a[0]+a[1]*a[2]);
-  var result = f([1,2,3]);  // core dump here, if not fixed.
-  assertEquals(result, 42);
-})();
diff --git a/src/v8/test/mjsunit/harmony/regress/regress-4755.js b/src/v8/test/mjsunit/harmony/regress/regress-4755.js
deleted file mode 100644
index 2a0df9d..0000000
--- a/src/v8/test/mjsunit/harmony/regress/regress-4755.js
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --harmony-do-expressions
-
-(function DoTryCatchInsideBinop() {
-  function f(a, b) {
-    return a + do { try { throw "boom" } catch(e) { b } }
-  }
-  assertEquals(3, f(1, 2));
-  assertEquals(3, f(1, 2));
-  %OptimizeFunctionOnNextCall(f);
-  assertEquals(3, f(1, 2));
-})();
-
-(function DoTryCatchInsideCall() {
-  function f(a, b) {
-    return Math.max(a, do { try { throw a } catch(e) { e + b } })
-  }
-  assertEquals(3, f(1, 2));
-  assertEquals(3, f(1, 2));
-  %OptimizeFunctionOnNextCall(f);
-  assertEquals(3, f(1, 2));
-})();
-
-(function DoTryCatchInsideTry() {
-  function f(a, b) {
-    try { return do { try { throw a } catch(e) { e + b } } } catch(e) {}
-  }
-  assertEquals(3, f(1, 2));
-  assertEquals(3, f(1, 2));
-  %OptimizeFunctionOnNextCall(f);
-  assertEquals(3, f(1, 2));
-})();
-
-(function DoTryCatchInsideFinally() {
-  function f(a, b) {
-    try {} finally { return do { try { throw a } catch(e) { e + b } } }
-  }
-  assertEquals(3, f(1, 2));
-  assertEquals(3, f(1, 2));
-  %OptimizeFunctionOnNextCall(f);
-  assertEquals(3, f(1, 2));
-})();
diff --git a/src/v8/test/mjsunit/harmony/regress/regress-4904.js b/src/v8/test/mjsunit/harmony/regress/regress-4904.js
deleted file mode 100644
index a57d246..0000000
--- a/src/v8/test/mjsunit/harmony/regress/regress-4904.js
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --harmony-do-expressions
-
-(function testCatchScopeInDoExpression() {
-  var f = (s = 17, y = do { try { throw 25; } catch(e) { s += e; }; }) => s;
-  var result = f();
-  assertEquals(result, 42);
-})();
-
-(function testCatchScopeInDoExpression() {
-  var f = (s = 17, y = do { let t; try { throw 25; } catch(e) { s += e; }; }) => s;
-  var result = f();
-  assertEquals(result, 42);
-})();
-
-(function testCatchScopeInDoExpression() {
-  let t1;
-  var f = (s = 17, y = do { let t2; try { throw 25; } catch(e) { s += e; }; }) => s;
-  var result = f();
-  assertEquals(result, 42);
-})();
diff --git a/src/v8/test/mjsunit/harmony/regress/regress-546967.js b/src/v8/test/mjsunit/harmony/regress/regress-546967.js
deleted file mode 100644
index 0315c43..0000000
--- a/src/v8/test/mjsunit/harmony/regress/regress-546967.js
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// Flags: --harmony-do-expressions --allow-natives-syntax
-
-function func1() {
-  for (var i = 0; i < 64; ++i) func2();
-}
-
-%OptimizeFunctionOnNextCall(func1);
-func1();
-
-function func2() {
-  var v = do {};
-}
diff --git a/src/v8/test/mjsunit/harmony/regress/regress-crbug-578038.js b/src/v8/test/mjsunit/harmony/regress/regress-crbug-578038.js
deleted file mode 100644
index 42774b8..0000000
--- a/src/v8/test/mjsunit/harmony/regress/regress-crbug-578038.js
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --harmony-do-expressions
-
-(function testWithoutOtherLiteral() {
-  var result = ((x = [...[42]]) => x)();
-  assertEquals(result, [42]);
-})();
-
-(function testWithSomeOtherLiteral() {
-  []; // important: an array literal before the arrow function
-  var result = ((x = [...[42]]) => x)();  // will core dump, if not fixed.
-  assertEquals(result, [42]);
-})();
diff --git a/src/v8/test/mjsunit/harmony/to-primitive.js b/src/v8/test/mjsunit/harmony/to-primitive.js
deleted file mode 100644
index 8decb04..0000000
--- a/src/v8/test/mjsunit/harmony/to-primitive.js
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax
-
-assertEquals(1, %ToPrimitive(1));
-assertEquals(1, %ToPrimitive_Number(1));
-
-assertEquals(.5, %ToPrimitive(.5));
-assertEquals(.5, %ToPrimitive_Number(.5));
-
-assertEquals(null, %ToPrimitive(null));
-assertEquals(null, %ToPrimitive_Number(null));
-
-assertEquals(true, %ToPrimitive(true));
-assertEquals(true, %ToPrimitive_Number(true));
-
-assertEquals(false, %ToPrimitive(false));
-assertEquals(false, %ToPrimitive_Number(false));
-
-assertEquals(undefined, %ToPrimitive(undefined));
-assertEquals(undefined, %ToPrimitive_Number(undefined));
-
-assertEquals("random text", %ToPrimitive("random text"));
-assertEquals("random text", %ToPrimitive_Number("random text"));
-
-assertEquals(Symbol.toPrimitive, %ToPrimitive(Symbol.toPrimitive));
-assertEquals(Symbol.toPrimitive, %ToPrimitive_Number(Symbol.toPrimitive));
-
-var a = { toString: function() { return "xyz" }};
-assertEquals("xyz", %ToPrimitive(a));
-assertEquals("xyz", %ToPrimitive_Number(a));
-
-var b = { valueOf: function() { return 42 }};
-assertEquals(42, %ToPrimitive(b));
-assertEquals(42, %ToPrimitive_Number(b));
-
-var c = {
-  toString: function() { return "x"},
-  valueOf: function() { return 123 }
-};
-assertEquals(123, %ToPrimitive(c));
-assertEquals(123, %ToPrimitive_Number(c));
-
-var d = {
-  [Symbol.toPrimitive]: function(hint) { return hint }
-};
-assertEquals("default", %ToPrimitive(d));
-assertEquals("number", %ToPrimitive_Number(d));
-
-var e = new Date(0);
-assertEquals(e.toString(), %ToPrimitive(e));
-assertEquals(0, %ToPrimitive_Number(e));
diff --git a/src/v8/test/mjsunit/mjsunit.gyp b/src/v8/test/mjsunit/mjsunit.gyp
deleted file mode 100644
index e0a7469..0000000
--- a/src/v8/test/mjsunit/mjsunit.gyp
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'conditions': [
-    ['test_isolation_mode != "noop"', {
-      'targets': [
-        {
-          'target_name': 'mjsunit_run',
-          'type': 'none',
-          'dependencies': [
-            '../../src/d8.gyp:d8_run',
-          ],
-          'includes': [
-            '../../gypfiles/features.gypi',
-            '../../gypfiles/isolate.gypi',
-          ],
-          'sources': [
-            'mjsunit.isolate',
-          ],
-        },
-      ],
-    }],
-  ],
-}
diff --git a/src/v8/test/mjsunit/mjsunit.isolate b/src/v8/test/mjsunit/mjsunit.isolate
deleted file mode 100644
index a7d151a..0000000
--- a/src/v8/test/mjsunit/mjsunit.isolate
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'variables': {
-    'files': [
-      './',
-      '../../tools/codemap.js',
-      '../../tools/consarray.js',
-      '../../tools/csvparser.js',
-      '../../tools/logreader.js',
-      '../../tools/arguments.js',
-      '../../tools/profile.js',
-      '../../tools/profile_view.js',
-      '../../tools/profviz/composer.js',
-      '../../tools/splaytree.js',
-      '../../tools/tickprocessor.js',
-      '../../tools/dumpcpp.js',
-      '../wasm-js/test/harness/wasm-constants.js',
-      '../wasm-js/test/harness/wasm-module-builder.js',
-      '../wasm-js/test/js-api/jsapi.js',
-    ],
-  },
-  'includes': [
-    '../../src/d8.isolate',
-    '../../tools/testrunner/testrunner.isolate',
-  ],
-}
diff --git a/src/v8/test/mjsunit/modules-circular-valid.js b/src/v8/test/mjsunit/modules-circular-valid.js
deleted file mode 100644
index e381eef..0000000
--- a/src/v8/test/mjsunit/modules-circular-valid.js
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-export {a as b} from "modules-skip-circular-valid.js";
diff --git a/src/v8/test/mjsunit/modules-cycle.js b/src/v8/test/mjsunit/modules-cycle.js
deleted file mode 100644
index 6b775a5..0000000
--- a/src/v8/test/mjsunit/modules-cycle.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import "modules-skip-cycle.js";
-export {a as foo} from "modules-skip-1.js"
diff --git a/src/v8/test/mjsunit/modules-default-name1.js b/src/v8/test/mjsunit/modules-default-name1.js
deleted file mode 100644
index 54c3afe..0000000
--- a/src/v8/test/mjsunit/modules-default-name1.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {default as goo} from "modules-skip-default-name1.js";
-assertEquals(
-    {value: "gaga", configurable: true, writable: false, enumerable: false},
-    Reflect.getOwnPropertyDescriptor(goo, 'name'));
diff --git a/src/v8/test/mjsunit/modules-default-name2.js b/src/v8/test/mjsunit/modules-default-name2.js
deleted file mode 100644
index 51e6413..0000000
--- a/src/v8/test/mjsunit/modules-default-name2.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {default as goo} from "modules-skip-default-name2.js";
-assertEquals(
-    {value: "gaga", configurable: true, writable: false, enumerable: false},
-    Reflect.getOwnPropertyDescriptor(goo, 'name'));
diff --git a/src/v8/test/mjsunit/modules-default-name3.js b/src/v8/test/mjsunit/modules-default-name3.js
deleted file mode 100644
index caab3eb..0000000
--- a/src/v8/test/mjsunit/modules-default-name3.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {default as goo} from "modules-skip-default-name3.js";
-assertEquals(
-    {value: "default", configurable: true, writable: false, enumerable: false},
-    Reflect.getOwnPropertyDescriptor(goo, 'name'));
diff --git a/src/v8/test/mjsunit/modules-default-name4.js b/src/v8/test/mjsunit/modules-default-name4.js
deleted file mode 100644
index c69da9d..0000000
--- a/src/v8/test/mjsunit/modules-default-name4.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {default as goo} from "modules-skip-default-name4.js";
-assertEquals(
-    {value: "Gaga", configurable: true, writable: false, enumerable: false},
-    Reflect.getOwnPropertyDescriptor(goo, 'name'));
diff --git a/src/v8/test/mjsunit/modules-default-name5.js b/src/v8/test/mjsunit/modules-default-name5.js
deleted file mode 100644
index d6e0e5c..0000000
--- a/src/v8/test/mjsunit/modules-default-name5.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {default as goo} from "modules-skip-default-name5.js";
-assertEquals(
-    {value: "Gaga", configurable: true, writable: false, enumerable: false},
-    Reflect.getOwnPropertyDescriptor(goo, 'name'));
diff --git a/src/v8/test/mjsunit/modules-default-name6.js b/src/v8/test/mjsunit/modules-default-name6.js
deleted file mode 100644
index 1ac1bcb..0000000
--- a/src/v8/test/mjsunit/modules-default-name6.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {default as goo} from "modules-skip-default-name6.js";
-assertEquals(
-    {value: "default", configurable: true, writable: false, enumerable: false},
-    Reflect.getOwnPropertyDescriptor(goo, 'name'));
diff --git a/src/v8/test/mjsunit/modules-default-name7.js b/src/v8/test/mjsunit/modules-default-name7.js
deleted file mode 100644
index 82904d4..0000000
--- a/src/v8/test/mjsunit/modules-default-name7.js
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {default as goo} from "modules-skip-default-name7.js";
-let descr = Reflect.getOwnPropertyDescriptor(goo, 'name');
-assertEquals(descr,
-    {value: descr.value, configurable: true, writable: true, enumerable: false});
-assertEquals("yo", descr.value());
diff --git a/src/v8/test/mjsunit/modules-default-name8.js b/src/v8/test/mjsunit/modules-default-name8.js
deleted file mode 100644
index b192a25..0000000
--- a/src/v8/test/mjsunit/modules-default-name8.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {default as goo} from "modules-skip-default-name8.js";
-assertEquals(
-    {value: "default", configurable: true, writable: false, enumerable: false},
-    Reflect.getOwnPropertyDescriptor(goo, 'name'));
diff --git a/src/v8/test/mjsunit/modules-default-name9.js b/src/v8/test/mjsunit/modules-default-name9.js
deleted file mode 100644
index 3ba711f..0000000
--- a/src/v8/test/mjsunit/modules-default-name9.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {default as goo} from "modules-skip-default-name9.js";
-assertEquals(
-    {value: "default", configurable: true, writable: false, enumerable: false},
-    Reflect.getOwnPropertyDescriptor(goo, 'name'));
diff --git a/src/v8/test/mjsunit/modules-default.js b/src/v8/test/mjsunit/modules-default.js
deleted file mode 100644
index 304703b..0000000
--- a/src/v8/test/mjsunit/modules-default.js
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import foo from "modules-skip-1.js";
-assertEquals(42, foo);
-
-import {default as gaga} from "modules-skip-1.js";
-assertEquals(42, gaga);
diff --git a/src/v8/test/mjsunit/modules-empty-import1.js b/src/v8/test/mjsunit/modules-empty-import1.js
deleted file mode 100644
index 60498f1..0000000
--- a/src/v8/test/mjsunit/modules-empty-import1.js
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import "modules-skip-empty-import.js";
-import {counter} from "modules-skip-empty-import-aux.js";
-assertEquals(1, counter);
diff --git a/src/v8/test/mjsunit/modules-empty-import2.js b/src/v8/test/mjsunit/modules-empty-import2.js
deleted file mode 100644
index 8862c94..0000000
--- a/src/v8/test/mjsunit/modules-empty-import2.js
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {} from "modules-skip-empty-import.js";
-import {counter} from "modules-skip-empty-import-aux.js";
-assertEquals(1, counter);
diff --git a/src/v8/test/mjsunit/modules-empty-import3.js b/src/v8/test/mjsunit/modules-empty-import3.js
deleted file mode 100644
index 0503891..0000000
--- a/src/v8/test/mjsunit/modules-empty-import3.js
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-export {} from "modules-skip-empty-import.js";
-import {counter} from "modules-skip-empty-import-aux.js";
-assertEquals(1, counter);
diff --git a/src/v8/test/mjsunit/modules-empty-import4.js b/src/v8/test/mjsunit/modules-empty-import4.js
deleted file mode 100644
index 0cea643..0000000
--- a/src/v8/test/mjsunit/modules-empty-import4.js
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import "modules-skip-empty-import.js";
-import {} from "modules-skip-empty-import.js";
-export {} from "modules-skip-empty-import.js";
-import {counter} from "modules-skip-empty-import-aux.js";
-assertEquals(1, counter);
diff --git a/src/v8/test/mjsunit/modules-error-trace.js b/src/v8/test/mjsunit/modules-error-trace.js
deleted file mode 100644
index bbf83c5..0000000
--- a/src/v8/test/mjsunit/modules-error-trace.js
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-// Make sure the generator resume function doesn't show up in the stack trace.
-const stack = (new Error).stack;
-assertEquals(2, stack.split(/\r\n|\r|\n/).length);
diff --git a/src/v8/test/mjsunit/modules-exports1.js b/src/v8/test/mjsunit/modules-exports1.js
deleted file mode 100644
index 260f545..0000000
--- a/src/v8/test/mjsunit/modules-exports1.js
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// MODULE
-
-export var myvar = "VAR";
-assertEquals("VAR", myvar);
-assertEquals("VAR", eval("myvar"));
-(() => assertEquals("VAR", myvar))();
-
-export let mylet = "LET";
-assertEquals("LET", mylet);
-assertEquals("LET", eval("mylet"));
-(() => assertEquals("LET", mylet))();
-
-export const myconst = "CONST";
-assertEquals("CONST", myconst);
-assertEquals("CONST", eval("myconst"));
-(() => assertEquals("CONST", myconst))();
-
-
-myvar = 1;
-assertEquals(1, myvar);
-assertEquals(1, eval("myvar"));
-(() => assertEquals(1, myvar))();
-(() => myvar = 2)();
-assertEquals(2, myvar);
-(() => assertEquals(2, myvar))();
-{
-  let f = () => assertEquals(2, myvar);
-  f();
-}
-
-mylet = 1;
-assertEquals(1, mylet);
-assertEquals(1, eval("mylet"));
-(() => assertEquals(1, mylet))();
-(() => mylet = 2)();
-assertEquals(2, mylet);
-assertEquals(2, eval("mylet"));
-(() => assertEquals(2, mylet))();
-{
-  let f = () => assertEquals(2, mylet);
-  f();
-}
-
-assertThrows(() => myconst = 1, TypeError);
-assertEquals("CONST", myconst);
-assertEquals("CONST", eval("myconst"));
-(() => assertEquals("CONST", myconst))();
-{
-  let f = () => assertEquals("CONST", myconst);
-  f();
-}
diff --git a/src/v8/test/mjsunit/modules-exports2.js b/src/v8/test/mjsunit/modules-exports2.js
deleted file mode 100644
index 77f6bb6..0000000
--- a/src/v8/test/mjsunit/modules-exports2.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// MODULE
-
-export function foo() { return 42 }
-assertEquals(42, foo());
-foo = 1;
-assertEquals(1, foo);
-
-let gaga = 43;
-export {gaga as gugu};
-assertEquals(43, gaga);
-
-export default (function bar() { return 43 })
-assertThrows(() => bar(), ReferenceError);
-assertThrows("default", SyntaxError);
-assertThrows("*default*", SyntaxError);
-
-
-var bla = 44;
-var blu = 45;
-export {bla};
-export {bla as blu};
-export {bla as bli};
-assertEquals(44, bla);
-assertEquals(45, blu);
-bla = 46;
-assertEquals(46, bla);
-assertEquals(45, blu);
diff --git a/src/v8/test/mjsunit/modules-exports3.js b/src/v8/test/mjsunit/modules-exports3.js
deleted file mode 100644
index a792852..0000000
--- a/src/v8/test/mjsunit/modules-exports3.js
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// MODULE
-
-export { myvar, mylet, myconst };
-
-var myvar = "VAR";
-assertEquals("VAR", myvar);
-let mylet = "LET";
-assertEquals("LET", mylet);
-const myconst = "CONST";
-assertEquals("CONST", myconst);
-
-function* gaga() { yield 1 }
-assertEquals(1, gaga().next().value);
-export {gaga};
-export default gaga;
-export {gaga as gigi};
-assertEquals(1, gaga().next().value);
-
-
-export let gugu = 42;
-
-{
-  assertEquals(42, gugu);
-}
-
-try {
-  assertEquals(42, gugu);
-} catch(_) {
-  assertUnreachable();
-}
-
-try {
-  throw {};
-} catch(_) {
-  assertEquals(42, gugu);
-}
-
-try {
-  throw {};
-} catch({x=gugu}) {
-  assertEquals(42, x);
-}
-
-assertEquals(5, eval("var x = 5; x"));
diff --git a/src/v8/test/mjsunit/modules-imports1.js b/src/v8/test/mjsunit/modules-imports1.js
deleted file mode 100644
index f2e33f0..0000000
--- a/src/v8/test/mjsunit/modules-imports1.js
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {a as x, set_a as set_x} from "modules-skip-1.js"
-
-let get_x = () => x;
-
-assertEquals(1, x);
-assertEquals(1, (() => x)());
-assertEquals(1, eval('x'));
-assertEquals(1, get_x());
-
-assertThrows(() => x = 666, TypeError);
-assertEquals(1, x);
-assertEquals(1, (() => x)());
-assertEquals(1, eval('x'));
-assertEquals(1, get_x());
-
-set_x("foo");
-assertEquals("foo", x);
-assertEquals("foo", (() => x)());
-assertEquals("foo", eval('x'));
-assertEquals("foo", get_x());
diff --git a/src/v8/test/mjsunit/modules-imports2.js b/src/v8/test/mjsunit/modules-imports2.js
deleted file mode 100644
index 35a7f76..0000000
--- a/src/v8/test/mjsunit/modules-imports2.js
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-let get_x = () => x;
-
-assertEquals(1, x);
-assertEquals(1, (() => x)());
-assertEquals(1, eval('x'));
-assertEquals(1, get_x());
-
-assertThrows(() => x = 666, TypeError);
-assertEquals(1, x);
-assertEquals(1, (() => x)());
-assertEquals(1, eval('x'));
-assertEquals(1, get_x());
-
-set_x("foo");
-assertEquals("foo", x);
-assertEquals("foo", (() => x)());
-assertEquals("foo", eval('x'));
-assertEquals("foo", get_x());
-
-import {a as x, set_a as set_x} from "modules-skip-1.js"
diff --git a/src/v8/test/mjsunit/modules-imports3.js b/src/v8/test/mjsunit/modules-imports3.js
deleted file mode 100644
index 42fcdce..0000000
--- a/src/v8/test/mjsunit/modules-imports3.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {a as x, a as y} from "modules-skip-1.js";
-import {b as z, get_a, set_a} from "modules-skip-1.js";
-
-assertEquals(1, get_a());
-assertEquals(1, x);
-assertEquals(1, y);
-assertEquals(1, z);
-
-set_a(2);
-assertEquals(2, get_a());
-assertEquals(2, x);
-assertEquals(2, y);
-assertEquals(2, z);
-
-assertThrows(() => x = 3, TypeError);
-assertThrows(() => y = 3, TypeError);
-assertThrows(() => z = 3, TypeError);
-
-assertEquals(2, get_a());
-assertEquals(2, x);
-assertEquals(2, y);
-assertEquals(2, z);
-
-assertEquals(2, eval('get_a()'));
-assertEquals(2, eval('x'));
-assertEquals(2, eval('y'));
-assertEquals(2, eval('z'));
-
-assertEquals(2, (() => get_a())());
-assertEquals(2, (() => x)());
-assertEquals(2, (() => y)());
-assertEquals(2, (() => z)());
diff --git a/src/v8/test/mjsunit/modules-imports4.js b/src/v8/test/mjsunit/modules-imports4.js
deleted file mode 100644
index 4d73487..0000000
--- a/src/v8/test/mjsunit/modules-imports4.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {b, c} from "modules-skip-2.js";
-import {a, set_a} from "modules-skip-1.js";
-import x from "modules-skip-2.js";
-
-assertEquals(42, x);
-
-assertEquals(1, a);
-assertEquals(1, b);
-assertEquals(1, c);
-
-set_a(2);
-assertEquals(2, a);
-assertEquals(2, b);
-assertEquals(2, c);
-
-assertThrows(() => a = 3, TypeError);
-assertThrows(() => b = 3, TypeError);
-assertThrows(() => c = 3, TypeError);
-
-assertEquals(2, a);
-assertEquals(2, b);
-assertEquals(2, c);
-
-assertThrows(() => x = 43, TypeError);
-assertEquals(42, x);
diff --git a/src/v8/test/mjsunit/modules-imports5.js b/src/v8/test/mjsunit/modules-imports5.js
deleted file mode 100644
index b494c7e..0000000
--- a/src/v8/test/mjsunit/modules-imports5.js
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {a} from "modules-skip-3.js";
-export var b = 20;
-assertEquals(42, a+b);
diff --git a/src/v8/test/mjsunit/modules-imports6.js b/src/v8/test/mjsunit/modules-imports6.js
deleted file mode 100644
index 4cb117a..0000000
--- a/src/v8/test/mjsunit/modules-imports6.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {b, c} from "modules-skip-4.js";
-import {a, set_a} from "modules-skip-4.js";
-
-assertEquals(1, a);
-assertEquals(1, b);
-assertEquals(1, c);
-
-set_a(2);
-assertEquals(2, a);
-assertEquals(2, b);
-assertEquals(2, c);
-
-assertThrows(() => a = 3, TypeError);
-assertThrows(() => b = 3, TypeError);
-assertThrows(() => c = 3, TypeError);
-
-assertEquals(2, a);
-assertEquals(2, b);
-assertEquals(2, c);
diff --git a/src/v8/test/mjsunit/modules-imports7.js b/src/v8/test/mjsunit/modules-imports7.js
deleted file mode 100644
index 2501481..0000000
--- a/src/v8/test/mjsunit/modules-imports7.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {a} from "modules-skip-6.js";
-assertEquals(10, a);
diff --git a/src/v8/test/mjsunit/modules-init1.js b/src/v8/test/mjsunit/modules-init1.js
deleted file mode 100644
index fbc8df2..0000000
--- a/src/v8/test/mjsunit/modules-init1.js
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import "modules-skip-init1.js";
-export function bar() { return 42 };
-bar = 5;
diff --git a/src/v8/test/mjsunit/modules-init2.js b/src/v8/test/mjsunit/modules-init2.js
deleted file mode 100644
index 866cb27..0000000
--- a/src/v8/test/mjsunit/modules-init2.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {bar} from "modules-init1.js";
-assertEquals(5, bar);
diff --git a/src/v8/test/mjsunit/modules-init3.js b/src/v8/test/mjsunit/modules-init3.js
deleted file mode 100644
index e8b4610..0000000
--- a/src/v8/test/mjsunit/modules-init3.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {check} from "modules-skip-init3.js";
-
-assertSame(undefined, w);
-assertThrows(() => x, ReferenceError);
-assertThrows(() => y, ReferenceError);
-assertThrows(() => z, ReferenceError);
-
-assertEquals(23, w = 23);
-assertThrows(() => x = 666, ReferenceError);
-assertThrows(() => y = 666, ReferenceError);
-assertThrows(() => z = 666, TypeError);
-
-export function* v() { return 40 }
-export var w = 41;
-export let x = 42;
-export class y {};
-export const z = "hello world";
-
-assertTrue(check());
diff --git a/src/v8/test/mjsunit/modules-init4.js b/src/v8/test/mjsunit/modules-init4.js
deleted file mode 100644
index 6b9e477..0000000
--- a/src/v8/test/mjsunit/modules-init4.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import "./modules-skip-init4a.js"
-export {foo, ns} from "./modules-skip-init4b.js"
diff --git a/src/v8/test/mjsunit/modules-namespace1.js b/src/v8/test/mjsunit/modules-namespace1.js
deleted file mode 100644
index 9c2ce93..0000000
--- a/src/v8/test/mjsunit/modules-namespace1.js
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-let ja = 42;
-export {ja as yo};
-export const bla = "blaa";
-export {foo as foo_again};
-// See further below for the actual star import that declares "foo".
-
-// The object itself.
-assertEquals("object", typeof foo);
-assertThrows(() => foo = 666, TypeError);
-assertFalse(Reflect.isExtensible(foo));
-assertTrue(Reflect.preventExtensions(foo));
-assertThrows(() => Reflect.apply(foo, {}, []));
-assertThrows(() => Reflect.construct(foo, {}, []));
-assertSame(null, Reflect.getPrototypeOf(foo));
-assertTrue(Reflect.setPrototypeOf(foo, null));
-assertFalse(Reflect.setPrototypeOf(foo, {}));
-assertSame(null, Reflect.getPrototypeOf(foo));
-assertEquals(
-    ["bla", "foo_again", "yo", Symbol.toStringTag], Reflect.ownKeys(foo));
-
-// Its "yo" property.
-assertEquals(
-    {value: 42, enumerable: true, configurable: false, writable: true},
-    Reflect.getOwnPropertyDescriptor(foo, "yo"));
-assertFalse(Reflect.deleteProperty(foo, "yo"));
-assertTrue(Reflect.has(foo, "yo"));
-assertFalse(Reflect.set(foo, "yo", true));
-// TODO(neis): The next two should be False.
-assertTrue(Reflect.defineProperty(foo, "yo",
-    Reflect.getOwnPropertyDescriptor(foo, "yo")));
-assertTrue(Reflect.defineProperty(foo, "yo", {}));
-assertFalse(Reflect.defineProperty(foo, "yo", {get() {return 1}}));
-assertEquals(42, Reflect.get(foo, "yo"));
-assertEquals(43, (ja++, foo.yo));
-
-// Its "foo_again" property.
-assertSame(foo, foo.foo_again);
-
-// Its @@toStringTag property.
-assertTrue(Reflect.has(foo, Symbol.toStringTag));
-assertEquals("string", typeof Reflect.get(foo, Symbol.toStringTag));
-assertEquals(
-    {value: "Module", configurable: false, writable: false, enumerable: false},
-    Reflect.getOwnPropertyDescriptor(foo, Symbol.toStringTag));
-assertFalse(Reflect.deleteProperty(foo, Symbol.toStringTag));
-assertEquals(
-    {value: "Module", configurable: false, writable: false, enumerable: false},
-    Reflect.getOwnPropertyDescriptor(foo, Symbol.toStringTag));
-
-// Nonexistant properties.
-let nonexistant = ["gaga", 123, Symbol('')];
-for (let key of nonexistant) {
-  assertSame(undefined, Reflect.getOwnPropertyDescriptor(foo, key));
-  assertTrue(Reflect.deleteProperty(foo, key));
-  assertFalse(Reflect.set(foo, key, true));
-  assertSame(undefined, Reflect.get(foo, key));
-  assertFalse(Reflect.defineProperty(foo, key, {get() {return 1}}));
-  assertFalse(Reflect.has(foo, key));
-}
-
-// The actual star import that we are testing. Namespace imports are
-// initialized before evaluation.
-import * as foo from "modules-namespace1.js";
-
-// There can be only one namespace object.
-import * as bar from "modules-namespace1.js";
-assertSame(foo, bar);
diff --git a/src/v8/test/mjsunit/modules-namespace2.js b/src/v8/test/mjsunit/modules-namespace2.js
deleted file mode 100644
index 03c90a0..0000000
--- a/src/v8/test/mjsunit/modules-namespace2.js
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-assertEquals(
-    ["b", "c", "get_a", "ns2", "set_a", "zzz", Symbol.toStringTag],
-    Reflect.ownKeys(ns));
-
-import * as foo from "modules-skip-1.js";
-assertSame(foo.a, ns.b);
-assertSame(foo.a, ns.c);
-assertSame(foo.get_a, ns.get_a);
-assertSame(foo.set_a, ns.set_a);
-assertEquals(123, ns.zzz);
-
-assertSame(ns, ns.ns2.ns);
-import * as ns from "modules-skip-namespace.js";
-export {ns};
diff --git a/src/v8/test/mjsunit/modules-namespace3.js b/src/v8/test/mjsunit/modules-namespace3.js
deleted file mode 100644
index df9ef78..0000000
--- a/src/v8/test/mjsunit/modules-namespace3.js
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import * as foo from "modules-namespace3.js";
-export * from "modules-namespace3.js";
-export var bar;
-assertEquals(["bar", "default"], Object.getOwnPropertyNames(foo));
-export default function() {};
diff --git a/src/v8/test/mjsunit/modules-namespace4.js b/src/v8/test/mjsunit/modules-namespace4.js
deleted file mode 100644
index ef508d5..0000000
--- a/src/v8/test/mjsunit/modules-namespace4.js
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import * as foo from "modules-namespace4.js";
-
-assertSame(undefined, a);
-assertThrows(() => b, ReferenceError);
-assertThrows(() => B, ReferenceError);
-assertThrows(() => c, ReferenceError);
-assertEquals(45, d());
-
-assertSame(undefined, foo.a);
-assertThrows(() => foo.b, ReferenceError);
-assertThrows(() => foo.B, ReferenceError);
-assertThrows(() => foo.c, ReferenceError);
-assertEquals(45, foo.d());
-assertThrows(() => foo.default, ReferenceError);
-assertSame(undefined, foo.doesnotexist);
-
-Function("Foo", " \
-    with (Foo) { \
-      assertEquals(undefined, a); \
-      assertThrows(() => b, ReferenceError); \
-      assertThrows(() => B, ReferenceError); \
-      assertThrows(() => c, ReferenceError); \
-      assertEquals(45, d()); \
-    }")(foo);
-
-export var a = 42;
-export let b = 43;
-export {b as B};
-export const c = 44;
-export function d() { return 45 };
-export default 46;
-
-assertEquals(42, a);
-assertEquals(43, b);
-assertEquals(44, c);
-assertEquals(45, d());
-
-assertEquals(42, foo.a);
-assertEquals(43, foo.b);
-assertEquals(43, foo.B);
-assertEquals(44, foo.c);
-assertEquals(45, foo.d());
-assertEquals(46, foo.default);
-assertSame(undefined, foo.doesnotexist);
-
-Function("Foo", " \
-    with (Foo) { \
-      assertEquals(42, a); \
-      assertEquals(43, b); \
-      assertEquals(43, B); \
-      assertEquals(44, c); \
-      assertEquals(45, d()); \
-    }")(foo);
diff --git a/src/v8/test/mjsunit/modules-preparse.js b/src/v8/test/mjsunit/modules-preparse.js
deleted file mode 100644
index d5922bb..0000000
--- a/src/v8/test/mjsunit/modules-preparse.js
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-let foo = 42;
-function testFoo(x) { assertEquals(x, foo); }
-testFoo(42);
-foo++;
-testFoo(43);
diff --git a/src/v8/test/mjsunit/modules-relative-path.js b/src/v8/test/mjsunit/modules-relative-path.js
deleted file mode 100644
index 7e6a37a..0000000
--- a/src/v8/test/mjsunit/modules-relative-path.js
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import {x as y} from "./modules-relative-path.js";
-export let x = 0;
-
-assertEquals(0, x);
-assertEquals(x, y);
-x++;
-assertEquals(1, x);
-assertEquals(x, y);
diff --git a/src/v8/test/mjsunit/modules-skip-1.js b/src/v8/test/mjsunit/modules-skip-1.js
deleted file mode 100644
index 3573180..0000000
--- a/src/v8/test/mjsunit/modules-skip-1.js
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export default 42;
-export let a = 1;
-export {a as b};
-export function set_a(x) { a = x };
-export function get_a() { return a };
diff --git a/src/v8/test/mjsunit/modules-skip-2.js b/src/v8/test/mjsunit/modules-skip-2.js
deleted file mode 100644
index d5ff578..0000000
--- a/src/v8/test/mjsunit/modules-skip-2.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export {a as b, default} from "modules-skip-1.js";
-import {a as tmp} from "modules-skip-1.js";
-export {tmp as c};
-export const zzz = 999;
diff --git a/src/v8/test/mjsunit/modules-skip-3.js b/src/v8/test/mjsunit/modules-skip-3.js
deleted file mode 100644
index 38ead49..0000000
--- a/src/v8/test/mjsunit/modules-skip-3.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2016 the V8 project 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 {b} from "modules-imports5.js";
-export let a = 22;
-assertSame(undefined, b);
-assertEquals(22, a);
diff --git a/src/v8/test/mjsunit/modules-skip-4.js b/src/v8/test/mjsunit/modules-skip-4.js
deleted file mode 100644
index 092e27b..0000000
--- a/src/v8/test/mjsunit/modules-skip-4.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export * from "modules-skip-1.js";
-export * from "modules-skip-2.js";
diff --git a/src/v8/test/mjsunit/modules-skip-5.js b/src/v8/test/mjsunit/modules-skip-5.js
deleted file mode 100644
index 6a1ef49..0000000
--- a/src/v8/test/mjsunit/modules-skip-5.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export function a() { return "ooo" }
diff --git a/src/v8/test/mjsunit/modules-skip-6.js b/src/v8/test/mjsunit/modules-skip-6.js
deleted file mode 100644
index 4a0ef8d..0000000
--- a/src/v8/test/mjsunit/modules-skip-6.js
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export * from "modules-skip-1.js";
-export * from "modules-skip-5.js";
-export const a = 10;
diff --git a/src/v8/test/mjsunit/modules-skip-7.js b/src/v8/test/mjsunit/modules-skip-7.js
deleted file mode 100644
index 9f46990..0000000
--- a/src/v8/test/mjsunit/modules-skip-7.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export * from "modules-skip-1.js"
-export * from "modules-skip-5.js"
diff --git a/src/v8/test/mjsunit/modules-skip-circular-valid.js b/src/v8/test/mjsunit/modules-skip-circular-valid.js
deleted file mode 100644
index c22544a..0000000
--- a/src/v8/test/mjsunit/modules-skip-circular-valid.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export let a = {key: 'value'};
-import {b} from "modules-circular-valid.js";
-assertSame(a, b);
-assertEquals('value', a.key);
diff --git a/src/v8/test/mjsunit/modules-skip-cycle.js b/src/v8/test/mjsunit/modules-skip-cycle.js
deleted file mode 100644
index b4adbc7..0000000
--- a/src/v8/test/mjsunit/modules-skip-cycle.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export {foo} from "modules-cycle.js";
diff --git a/src/v8/test/mjsunit/modules-skip-default-name1.js b/src/v8/test/mjsunit/modules-skip-default-name1.js
deleted file mode 100644
index 30a95cd..0000000
--- a/src/v8/test/mjsunit/modules-skip-default-name1.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export default function gaga() {}
diff --git a/src/v8/test/mjsunit/modules-skip-default-name2.js b/src/v8/test/mjsunit/modules-skip-default-name2.js
deleted file mode 100644
index a064b05..0000000
--- a/src/v8/test/mjsunit/modules-skip-default-name2.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export default (function gaga() {})
diff --git a/src/v8/test/mjsunit/modules-skip-default-name3.js b/src/v8/test/mjsunit/modules-skip-default-name3.js
deleted file mode 100644
index ed26e46..0000000
--- a/src/v8/test/mjsunit/modules-skip-default-name3.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export default (function () {})
diff --git a/src/v8/test/mjsunit/modules-skip-default-name4.js b/src/v8/test/mjsunit/modules-skip-default-name4.js
deleted file mode 100644
index 1c569be..0000000
--- a/src/v8/test/mjsunit/modules-skip-default-name4.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export default class Gaga { }
diff --git a/src/v8/test/mjsunit/modules-skip-default-name5.js b/src/v8/test/mjsunit/modules-skip-default-name5.js
deleted file mode 100644
index df72336..0000000
--- a/src/v8/test/mjsunit/modules-skip-default-name5.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export default (class Gaga { })
diff --git a/src/v8/test/mjsunit/modules-skip-default-name6.js b/src/v8/test/mjsunit/modules-skip-default-name6.js
deleted file mode 100644
index 02f5629..0000000
--- a/src/v8/test/mjsunit/modules-skip-default-name6.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export default (class { })
diff --git a/src/v8/test/mjsunit/modules-skip-default-name7.js b/src/v8/test/mjsunit/modules-skip-default-name7.js
deleted file mode 100644
index e4400ca..0000000
--- a/src/v8/test/mjsunit/modules-skip-default-name7.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export default (class { static name() {return "yo"} })
diff --git a/src/v8/test/mjsunit/modules-skip-default-name8.js b/src/v8/test/mjsunit/modules-skip-default-name8.js
deleted file mode 100644
index 83e1ae4..0000000
--- a/src/v8/test/mjsunit/modules-skip-default-name8.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export default function() { }
diff --git a/src/v8/test/mjsunit/modules-skip-default-name9.js b/src/v8/test/mjsunit/modules-skip-default-name9.js
deleted file mode 100644
index ac166f3..0000000
--- a/src/v8/test/mjsunit/modules-skip-default-name9.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export default class { }
diff --git a/src/v8/test/mjsunit/modules-skip-empty-import-aux.js b/src/v8/test/mjsunit/modules-skip-empty-import-aux.js
deleted file mode 100644
index 1eb5b15..0000000
--- a/src/v8/test/mjsunit/modules-skip-empty-import-aux.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export let counter = 0;
-export function incr() { counter++ };
diff --git a/src/v8/test/mjsunit/modules-skip-empty-import.js b/src/v8/test/mjsunit/modules-skip-empty-import.js
deleted file mode 100644
index 74d4d3a..0000000
--- a/src/v8/test/mjsunit/modules-skip-empty-import.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// Copyright 2016 the V8 project 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 {incr} from "modules-skip-empty-import-aux.js";
-incr();
diff --git a/src/v8/test/mjsunit/modules-skip-init1.js b/src/v8/test/mjsunit/modules-skip-init1.js
deleted file mode 100644
index 4eb4a0a..0000000
--- a/src/v8/test/mjsunit/modules-skip-init1.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// Copyright 2012 the V8 project 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 {bar} from "modules-init1.js";
-assertEquals(42, bar());
diff --git a/src/v8/test/mjsunit/modules-skip-init3.js b/src/v8/test/mjsunit/modules-skip-init3.js
deleted file mode 100644
index 589b2cf..0000000
--- a/src/v8/test/mjsunit/modules-skip-init3.js
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2016 the V8 project 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 {v, w, x, y, z} from "modules-init3.js";
-
-assertEquals({value: 40, done: true}, v().next());
-assertSame(undefined, w);
-assertThrows(() => x, ReferenceError);
-assertThrows(() => y, ReferenceError);
-assertThrows(() => z, ReferenceError);
-
-assertThrows(() => v = 666, TypeError);
-assertThrows(() => w = 666, TypeError);
-assertThrows(() => x = 666, TypeError);
-assertThrows(() => y = 666, TypeError);
-assertThrows(() => z = 666, TypeError);
-
-export function check() {
-  assertEquals({value: 40, done: true}, v().next());
-  assertEquals(41, w);
-  assertEquals(42, x);
-  assertEquals("y", y.name);
-  assertEquals("hello world", z);
-  return true;
-}
diff --git a/src/v8/test/mjsunit/modules-skip-init4a.js b/src/v8/test/mjsunit/modules-skip-init4a.js
deleted file mode 100644
index 66f4e82..0000000
--- a/src/v8/test/mjsunit/modules-skip-init4a.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2017 the V8 project 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 {foo, ns} from "./modules-init4.js"
-assertEquals(foo(), 42)
-assertEquals(ns.foo(), 42)
-assertSame(foo, ns.foo)
diff --git a/src/v8/test/mjsunit/modules-skip-init4b.js b/src/v8/test/mjsunit/modules-skip-init4b.js
deleted file mode 100644
index 502c93b..0000000
--- a/src/v8/test/mjsunit/modules-skip-init4b.js
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright 2017 the V8 project 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 * as ns from "./modules-skip-init4b.js"
-export function foo() { return 42 }
-export {ns}
diff --git a/src/v8/test/mjsunit/modules-skip-namespace.js b/src/v8/test/mjsunit/modules-skip-namespace.js
deleted file mode 100644
index ff6a7b8..0000000
--- a/src/v8/test/mjsunit/modules-skip-namespace.js
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-//assertEquals(
-//    ["ns", Symbol.toStringTag, Symbol.iterator], Reflect.ownKeys(ns2));
-//assertEquals(["ns"], [...ns2]);
-
-export * from "modules-skip-4.js";
-export * from "modules-skip-5.js";
-export var zzz = 123;
-export {ns2};
-import * as ns2 from "modules-namespace2.js";
diff --git a/src/v8/test/mjsunit/modules-skip-star-exports-conflict.js b/src/v8/test/mjsunit/modules-skip-star-exports-conflict.js
deleted file mode 100644
index 5cbcd85..0000000
--- a/src/v8/test/mjsunit/modules-skip-star-exports-conflict.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export * from "modules-skip-1.js";
-export * from "modules-skip-5.js";
diff --git a/src/v8/test/mjsunit/modules-skip-star-exports-cycle.js b/src/v8/test/mjsunit/modules-skip-star-exports-cycle.js
deleted file mode 100644
index ab67ca8..0000000
--- a/src/v8/test/mjsunit/modules-skip-star-exports-cycle.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export * from "modules-skip-star-exports-cycle.js";
-export * from "modules-star-exports-cycle.js";
diff --git a/src/v8/test/mjsunit/modules-star-exports-cycle.js b/src/v8/test/mjsunit/modules-star-exports-cycle.js
deleted file mode 100644
index 6af3139..0000000
--- a/src/v8/test/mjsunit/modules-star-exports-cycle.js
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-const bar = 42;
-export {bar as foo};
-
-import {foo} from "modules-skip-star-exports-cycle.js";
-assertEquals(42, foo);
diff --git a/src/v8/test/mjsunit/modules-this.js b/src/v8/test/mjsunit/modules-this.js
deleted file mode 100644
index 2c8fc74..0000000
--- a/src/v8/test/mjsunit/modules-this.js
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// MODULE
-
-assertEquals(undefined, this);
diff --git a/src/v8/test/mjsunit/modules-turbo1.js b/src/v8/test/mjsunit/modules-turbo1.js
deleted file mode 100644
index 20df5c0..0000000
--- a/src/v8/test/mjsunit/modules-turbo1.js
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// MODULE
-// Flags: --allow-natives-syntax --opt --turbo-filter=*
-
-export let x = 0;
-function foo() { x++ };
-foo();
-%OptimizeFunctionOnNextCall(foo);
-foo();
-assertOptimized(foo);
-assertEquals(2, x);
diff --git a/src/v8/test/mjsunit/modules-turbo2.js b/src/v8/test/mjsunit/modules-turbo2.js
deleted file mode 100644
index 2e08086..0000000
--- a/src/v8/test/mjsunit/modules-turbo2.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// MODULE
-// Flags: --allow-natives-syntax
-
-export let x = 0;
-
-function foo() { return x++ };
-
-function gaga(f) { return f() };
-
-assertEquals(0, gaga(foo));
-assertEquals(1, gaga(foo));
-%OptimizeFunctionOnNextCall(gaga);
-assertEquals(2, gaga(foo));
diff --git a/src/v8/test/mjsunit/regress/regress-2185-2.js b/src/v8/test/mjsunit/regress/regress-2185-2.js
deleted file mode 100644
index b1eedb9..0000000
--- a/src/v8/test/mjsunit/regress/regress-2185-2.js
+++ /dev/null
@@ -1,145 +0,0 @@
-// 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.
-
-// These tests used to time out before this was fixed.
-
-var LEN = 2e4;
-
-function short() {
-  var sum = 0;
-  for (var i = 0; i < 1000; i++) {
-    var a = [1, 4, 34, 23, 6, 123, 3, 2, 11, 515, 4, 33, 22, 2, 2, 1, 0, 123,
-            23, 42, 43, 1002, 44, 43, 101, 23, 55, 11, 101, 102, 45, 11, 404,
-            31415, 34, 53, 453, 45, 34, 5, 2, 35, 5, 345, 36, 45, 345, 3, 45,
-            3, 5, 5, 2, 2342344, 2234, 23, 2718, 1500, 2, 19, 22, 43, 41, 0,
-            -1, 33, 45, 78];
-    a.sort(function(a, b) { return a - b; });
-    sum += a[0];
-  }
-  return sum;
-}
-
-function short_bench(name, array) {
-  var start = new Date();
-  short();
-  var end = new Date();
-  var ms = end - start;
-  print("Short " + Math.floor(ms) + "ms");
-}
-
-function sawseq(a, tooth) {
-  var count = 0;
-  while (true) {
-    for (var i = 0; i < tooth; i++) {
-      a.push(i);
-      if (++count >= LEN) return a;
-    }
-  }
-}
-
-function sawseq2(a, tooth) {
-  var count = 0;
-  while (true) {
-    for (var i = 0; i < tooth; i++) {
-      a.push(i);
-      if (++count >= LEN) return a;
-    }
-    for (var i = 0; i < tooth; i++) {
-      a.push(tooth - i);
-      if (++count >= LEN) return a;
-    }
-  }
-}
-
-function sawseq3(a, tooth) {
-  var count = 0;
-  while (true) {
-    for (var i = 0; i < tooth; i++) {
-      a.push(tooth - i);
-      if (++count >= LEN) return a;
-    }
-  }
-}
-
-function up(a) {
-  for (var i = 0; i < LEN; i++) {
-    a.push(i);
-  }
-  return a;
-}
-
-function down(a) {
-  for (var i = 0; i < LEN; i++) {
-    a.push(LEN - i);
-  }
-  return a;
-}
-
-function ran(a) {
-  for (var i = 0; i < LEN; i++) {
-    a.push(Math.floor(Math.random() * LEN));
-  }
-  return a;
-}
-
-var random = ran([]);
-var asc = up([]);
-var desc = down([]);
-var asc_desc = down(up([]));
-var desc_asc = up(down([]));
-var asc_asc = up(up([]));
-var desc_desc = down(down([]));
-var saw1 = sawseq([], 1000);
-var saw2 = sawseq([], 500);
-var saw3 = sawseq([], 200);
-var saw4 = sawseq2([], 200);
-var saw5 = sawseq3([], 200);
-
-function bench(name, array) {
-  var start = new Date();
-  array.sort(function(a, b) { return a - b; });
-  var end = new Date();
-  for (var i = 0; i < array.length - 1; i++) {
-    if (array[i] > array[i + 1]) throw name + " " + i;
-  }
-  var ms = end - start;
-  print(name + " " + Math.floor(ms) + "ms");
-}
-
-short_bench();
-bench("random", random);
-bench("up", asc);
-bench("down", desc);
-bench("saw 1000", saw1);
-bench("saw 500", saw2);
-bench("saw 200", saw3);
-bench("saw 200 symmetric", saw4);
-bench("saw 200 down", saw4);
-bench("up, down", asc_desc);
-bench("up, up", asc_asc);
-bench("down, down", desc_desc);
-bench("down, up", desc_asc);
diff --git a/src/v8/test/mjsunit/regress/regress-2185.js b/src/v8/test/mjsunit/regress/regress-2185.js
deleted file mode 100644
index 9b91066..0000000
--- a/src/v8/test/mjsunit/regress/regress-2185.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// 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.
-
-// Flags: --noenable-slow-asserts
-
-var a = [];
-
-for (var i = 0; i < 2; i++) {
-  for (var j = 0; j < 30000; j++) {
-    a.push(j);
-  }
-}
-
-a.sort(function(a, b) { return a - b; } );
diff --git a/src/v8/test/mjsunit/regress/regress-2988.js b/src/v8/test/mjsunit/regress/regress-2988.js
deleted file mode 100644
index 0311d2b..0000000
--- a/src/v8/test/mjsunit/regress/regress-2988.js
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2013 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.
-
-// Flags: --allow-natives-syntax --gc-global --throws
-
-var f = eval("(function f() { throw 'kaboom'; })");
-
-// Prepare that next MessageHandler::MakeMessageObject will result in
-// reclamation of existing script wrapper while weak handle is used.
-%FunctionGetScript(f);
-%SetAllocationTimeout(1000, 2);
-
-// This call throws to the console but the --throws flag passed to this
-// test will make sure we don't count it as an actual failure.
-f();
diff --git a/src/v8/test/mjsunit/regress/regress-373283.js b/src/v8/test/mjsunit/regress/regress-373283.js
deleted file mode 100644
index 20cee4d..0000000
--- a/src/v8/test/mjsunit/regress/regress-373283.js
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags:  --allow-natives-syntax --deopt-every-n-times=1
-
-function __f_0() {
-  var x = [];
-  x[21] = 1;
-  x[21] + 0;
-}
-
-for (var i = 0; i < 3; i++) __f_0();
-%OptimizeFunctionOnNextCall(__f_0);
-for (var i = 0; i < 10; i++) __f_0();
-%OptimizeFunctionOnNextCall(__f_0);
-__f_0();
-%GetScript("foo");
diff --git a/src/v8/test/mjsunit/regress/regress-408036.js b/src/v8/test/mjsunit/regress/regress-408036.js
deleted file mode 100644
index a4dfade..0000000
--- a/src/v8/test/mjsunit/regress/regress-408036.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --expose-natives-as 1
diff --git a/src/v8/test/mjsunit/regress/regress-5010.js b/src/v8/test/mjsunit/regress/regress-5010.js
deleted file mode 100644
index ecd4026..0000000
--- a/src/v8/test/mjsunit/regress/regress-5010.js
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax
-
-var bound = (function(){}).bind({});
-assertEquals("Function", %_ClassOf(bound));
-assertEquals("Function", %ClassOf(bound));
diff --git a/src/v8/test/mjsunit/regress/regress-5767.js b/src/v8/test/mjsunit/regress/regress-5767.js
deleted file mode 100644
index 75c83c0..0000000
--- a/src/v8/test/mjsunit/regress/regress-5767.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-assertEquals("0", Number.MIN_VALUE.toString(35));
diff --git a/src/v8/test/mjsunit/regress/regress-6681.js b/src/v8/test/mjsunit/regress/regress-6681.js
deleted file mode 100644
index d35ae41..0000000
--- a/src/v8/test/mjsunit/regress/regress-6681.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// MODULE
-
-import * as ns from "./regress-6681.js";
-export var foo;
-
-assertEquals(false, Reflect.defineProperty(ns, 'foo', {value: 123}));
diff --git a/src/v8/test/mjsunit/regress/regress-685.js b/src/v8/test/mjsunit/regress/regress-685.js
deleted file mode 100644
index d77d61b..0000000
--- a/src/v8/test/mjsunit/regress/regress-685.js
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2010 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.
-
-// Regression test for http://code.google.com/p/v8/issues/detail?id=685.
-//
-// Test that keyed load IC generic stub uses unsigned comparison for
-// for the length field of arrays.
-//
-// The test passes if it does not crash.
-
-function test() {
-  var N = 0xFFFFFFFF;
-  var a = [];
-  a[N - 1] = 0;
-  a[N - 2] = 1;
-  a.reverse();
-}
-
-test();
diff --git a/src/v8/test/mjsunit/regress/regress-791334.js b/src/v8/test/mjsunit/regress/regress-791334.js
deleted file mode 100644
index 9f2748f..0000000
--- a/src/v8/test/mjsunit/regress/regress-791334.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// MODULE
-
-let foo = () => { return this };
-assertEquals(undefined, foo());
diff --git a/src/v8/test/mjsunit/regress/regress-85177.js b/src/v8/test/mjsunit/regress/regress-85177.js
deleted file mode 100644
index aa938f5..0000000
--- a/src/v8/test/mjsunit/regress/regress-85177.js
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2011 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.
-
-// Flags: --allow-natives-syntax
-
-gW=gH=175;
-g=[];
-
-for(var n=0; n<gW; n++){
- var l=[];
- for(var p=0; p<gH; p++){
-   l.push(1)
- }
- g.push(l)
-}
-
-function k(a,b){
- if(a<0||b<0||a>=gW||b>=gH)
-   return 0;
- return g[a][b];
-}
-
-function f(){
- for(var a=[],f=0; f<gW; f++){
-   var b=[];
-   for(var h=0; h<gH; h++){
-     var e=0;
-     for(var i=-1; i<=1; i++)
-       for(var j=-1; j<=1; j++)
-          e+=k(f+i,h+j);
-     e=k(f,h)==1?1:0;
-     b.push(e)
-   }
-   a.push(b)
- }
-}
-
-f();
-%OptimizeFunctionOnNextCall(f);
-f();
diff --git a/src/v8/test/mjsunit/regress/regress-arguments-gc.js b/src/v8/test/mjsunit/regress/regress-arguments-gc.js
deleted file mode 100644
index b5ed608..0000000
--- a/src/v8/test/mjsunit/regress/regress-arguments-gc.js
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2011 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.
-
-// Flags: --expose-gc --nocleanup-code-caches-at-gc
-
-function f(x) {
-  gc();
-  arguments[0] = {};
-}
-
-f(1);
-f(1);
-f(1);
diff --git a/src/v8/test/mjsunit/regress/regress-crbug-380671.js b/src/v8/test/mjsunit/regress/regress-crbug-380671.js
deleted file mode 100644
index 3b03064..0000000
--- a/src/v8/test/mjsunit/regress/regress-crbug-380671.js
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --mock-arraybuffer-allocator --expose-gc
-
-var buffer = new ArrayBuffer(0xc0000000);
-assertEquals(0xc0000000, buffer.byteLength);
-// We call the GC here to free up the large array buffer. Otherwise, the
-// mock allocator would allow us to allocate more than the physical memory
-// available on 32bit platforms, leaving the internal counters in an invalid
-// state.
-gc();
diff --git a/src/v8/test/mjsunit/regress/regress-crbug-410033.js b/src/v8/test/mjsunit/regress/regress-crbug-410033.js
deleted file mode 100644
index 63693e6..0000000
--- a/src/v8/test/mjsunit/regress/regress-crbug-410033.js
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --expose-gc
-
-%GetScript('v8/gc');
diff --git a/src/v8/test/mjsunit/regress/regress-crbug-469480.js b/src/v8/test/mjsunit/regress/regress-crbug-469480.js
deleted file mode 100644
index 8bb0c52..0000000
--- a/src/v8/test/mjsunit/regress/regress-crbug-469480.js
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --stress-compaction --verify-heap
-// Flags: --stack-size=100
-
-// Load the debug context to fill up code space.
-%GetDebugContext();
-%GetDebugContext();
-
-// Recurse and run regexp code.
-assertThrows(function f() { f(/./.test("a")); }, RangeError);
diff --git a/src/v8/test/mjsunit/regress/regress-crbug-474297.js b/src/v8/test/mjsunit/regress/regress-crbug-474297.js
deleted file mode 100644
index ce24025..0000000
--- a/src/v8/test/mjsunit/regress/regress-crbug-474297.js
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --gc-interval=33 --expose-gc --allow-natives-syntax
-
-var Debug = %GetDebugContext().Debug;
-Debug.setListener(function(){});
-
-%DebugGetLoadedScripts();
-
-Debug.setListener(null);
diff --git a/src/v8/test/mjsunit/regress/regress-crbug-505007-1.js b/src/v8/test/mjsunit/regress/regress-crbug-505007-1.js
deleted file mode 100644
index 910f4a6..0000000
--- a/src/v8/test/mjsunit/regress/regress-crbug-505007-1.js
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --stack-size=100 --allow-natives-syntax
-
-var count = 0;
-function f() {
-  try {
-    f();
-  } catch(e) {
-    if (count < 100) {
-      count++;
-      %GetDebugContext();
-    }
-  }
-}
-f();
diff --git a/src/v8/test/mjsunit/regress/regress-crbug-506443.js b/src/v8/test/mjsunit/regress/regress-crbug-506443.js
deleted file mode 100644
index 490edf0..0000000
--- a/src/v8/test/mjsunit/regress/regress-crbug-506443.js
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --opt --no-always-opt
-
-assertSame = function assertSame() {
-  if (found === expected) {
-    if (1 / expected) return;
-  } else if ((expected !== expected) && (found !== found)) {
-    return;
-  };
-};
-assertEquals = function assertEquals() {
-  if (expected) {;
-  }
-};
-assertArrayEquals = function assertArrayEquals() {
-  var start = "";
-  if (name_opt) {
-    start = name_opt + " - ";
-  };
-  if (expected.length == found.length) {
-    for (var i = 0; i < expected.length; ++i) {;
-    }
-  }
-};
-assertPropertiesEqual = function assertPropertiesEqual() {
-  if (found) {;
-  }
-};
-assertToStringEquals = function assertToStringEquals() {
-  if (found) {;
-  }
-};
-assertTrue = function assertTrue() {;
-};
-assertFalse = function assertFalse() {;
-};
-assertUnreachable = function assertUnreachable() {
-  var message = "Fail" + "ure: unreachable";
-  if (name_opt) {
-    message += " - " + name_opt;
-  }
-};
-OptimizationStatus = function() {}
-assertUnoptimized = function assertUnoptimized() {;
-}
-assertOptimized = function assertOptimized() {;
-}
-triggerAssertFalse = function() {}
-var __v_2 = {};
-var __v_3 = {};
-var __v_4 = {};
-var __v_5 = {};
-var __v_6 = 1073741823;
-var __v_7 = {};
-var __v_8 = {};
-var __v_9 = {};
-var __v_10 = {};
-var __v_11 = 2147483648;
-var __v_12 = 1073741823;
-var __v_13 = {};
-var __v_14 = {};
-var __v_15 = -2147483648;
-var __v_16 = {};
-var __v_17 = {};
-var __v_19 = {};
-var __v_20 = {};
-var __v_21 = {};
-var __v_22 = {};
-var __v_23 = {};
-var __v_24 = {};
-try {
-  (function() {
-    var Debug = %GetDebugContext().Debug;
-
-    function __f_0() {}
-    for (var __v_0 = 0; __v_0 < 3; __v_0++) {
-      var __v_2 = function() {
-        a = 1;
-      }
-      Debug.setListener(__f_0);
-      if (__v_0 < 2) Debug.setBreakPoint(__v_2);
-    }
-  })();
-} catch (e) {
-  print();
-}
diff --git a/src/v8/test/mjsunit/regress/regress-crbug-507070.js b/src/v8/test/mjsunit/regress/regress-crbug-507070.js
deleted file mode 100644
index 0cb14b2..0000000
--- a/src/v8/test/mjsunit/regress/regress-crbug-507070.js
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --cache=code --no-debug-code
-
-try { } catch(e) { }
-try { try { } catch (e) { } } catch(e) { }
-try {
-  var Debug = %GetDebugContext().Debug;
-  Debug.setListener(function(){});
-} catch(e) { }
-(function() {
-  Debug.setBreakPoint(function(){}, 0, 0);
-})();
-
-var a = 1;
-a += a;
-Debug.setListener(null);
-assertEquals(2, a);
diff --git a/src/v8/test/mjsunit/regress/regress-crbug-546968.js b/src/v8/test/mjsunit/regress/regress-crbug-546968.js
deleted file mode 100644
index 51f20c4..0000000
--- a/src/v8/test/mjsunit/regress/regress-crbug-546968.js
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --harmony-do-expressions
-
-function f() {
-  print(
-    do {
-      for (var i = 0; i < 10; i++) { if (i == 5) %OptimizeOsr(); }
-    }
-  );
-}
-f();
diff --git a/src/v8/test/mjsunit/regress/regress-crbug-582703.js b/src/v8/test/mjsunit/regress/regress-crbug-582703.js
deleted file mode 100644
index 792266f..0000000
--- a/src/v8/test/mjsunit/regress/regress-crbug-582703.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax
-
-%FunctionGetScript({});
-%FunctionGetSourceCode({});
diff --git a/src/v8/test/mjsunit/regress/regress-osr-in-case-label.js b/src/v8/test/mjsunit/regress/regress-osr-in-case-label.js
deleted file mode 100644
index 3ad9e33..0000000
--- a/src/v8/test/mjsunit/regress/regress-osr-in-case-label.js
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --harmony-do-expressions
-
-function f(x) {
-  switch (x) {
-    case 1: return "one";
-    case 2: return "two";
-    case do { for (var i = 0; i < 10; i++) { if (i == 5) %OptimizeOsr(); } }:
-    case 3: return "WAT";
-  }
-}
-
-assertEquals("one", f(1));
-assertEquals("two", f(2));
-assertEquals("WAT", f(3));
diff --git a/src/v8/test/mjsunit/regress/regress-osr-in-literal.js b/src/v8/test/mjsunit/regress/regress-osr-in-literal.js
deleted file mode 100644
index 7553b9c..0000000
--- a/src/v8/test/mjsunit/regress/regress-osr-in-literal.js
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax --harmony-do-expressions
-
-"use strict";
-
-var p = {};
-var testCases = [
-  { s:"[1, do { _OSR_ 2 }, 3]",                      r:[1, 2, 3] },
-  { s:"[1, ...[2], do { _OSR_ 3 }, 4]",              r:[1, 2, 3, 4] },
-  { s:"[1, ...do { _OSR_ [2,3] }, 4]",               r:[1, 2, 3, 4] },
-  { s:"{ a:do { _OSR_ 1 } }",                        r:{ a:1 } },
-  { s:"{ a:do { _OSR_ 2 }, __proto__:p }",           r:{ a:2, __proto__:p } },
-  { s:"{ a:do { _OSR_ 3 }, get b() { return 4; } }", r:{ a:3, b:4 } },
-  { s:"{ [do { _OSR_ 'b' }]: 3 }",                   r:{ b:3 } },
-  { s:"{ [do { _OSR_ 'b' }]: 3, c: 4 }",             r:{ b:3, c:4 } },
-  { s:"{ [do { _OSR_ 'b' }]: 3, __proto__:p }",      r:{ b:3, __proto__:p } },
-  { s:"{ get [do { _OSR_ 'c' }]() { return 4; } }",  r:{ c:4 } },
-  { s:"class { [do { _OSR_ 'f' }]() {} }" },
-  { s:"class { [do { _OSR_ 'f' }]() {}; g() {} }" },
-];
-
-for (var i = 0; i < testCases.length; ++i) {
-  var source = "(function f" + i + "(x) { return " + testCases[i].s + "})";
-  var osr = "for (var i = 0; i < 10; i++) { if (i == 5) %OptimizeOsr(); }";
-  var result = eval(source.replace("_OSR_", osr))();
-  if (testCases[i].r) assertEquals(testCases[i].r, result);
-}
diff --git a/src/v8/test/mjsunit/regress/regress-splice-large-index.js b/src/v8/test/mjsunit/regress/regress-splice-large-index.js
deleted file mode 100644
index 1f4eb9c..0000000
--- a/src/v8/test/mjsunit/regress/regress-splice-large-index.js
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2013 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.
-
-var a = [];
-a[0xfffffffe] = 10;
-assertThrows("a.unshift(1);", RangeError);
-assertEquals(0xffffffff, a.length);
-assertEquals(10, a[0xffffffff]);
-assertEquals(0xffffffff, a.length);
-assertEquals(undefined, a[0xfffffffe]);
-
-a = [1,2,3];
-a[0xfffffffe] = 10;
-assertThrows("a.splice(1,1,7,7,7,7,7);", RangeError);
-assertEquals([1,7,7,7,7,7,3], a.slice(0, 7));
-assertEquals(0xffffffff, a.length);
-assertEquals(10, a[0xfffffffe + 5 - 1]);
diff --git a/src/v8/test/mjsunit/sparse-array-reverse.js b/src/v8/test/mjsunit/sparse-array-reverse.js
deleted file mode 100644
index 45a6da4..0000000
--- a/src/v8/test/mjsunit/sparse-array-reverse.js
+++ /dev/null
@@ -1,131 +0,0 @@
-// Copyright 2008 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.
-
-/**
- * @fileoverview Test reverse on small * and large arrays.
- */
-
-var VERYLARGE = 4000000000;
-
-// Nicer for firefox 1.5.  Unless you uncomment the following line,
-// smjs will appear to hang on this file.
-//var VERYLARGE = 40000;
-
-
-// Simple test of reverse on sparse array.
-var a = [];
-a.length = 2000;
-a[15] = 'a';
-a[30] = 'b';
-Array.prototype[30] = 'B';  // Should be hidden by a[30].
-a[40] = 'c';
-a[50] = 'deleted';
-delete a[50]; // Should leave no trace once deleted.
-a[1959] = 'd'; // Swapped with a[40] when reversing.
-a[1999] = 'e';
-assertEquals("abcde", a.join(''));
-a.reverse();
-delete Array.prototype[30];
-assertEquals("edcba", a.join(''));
-
-
-
-var seed = 43;
-
-// CONG pseudo random number generator.  Used for fuzzing the sparse array
-// reverse code.
-function DoOrDont() {
-  seed = (69069 * seed + 1234567) % 0x100000000;
-  return (seed & 0x100000) != 0;
-}
-
-var sizes = [140, 40000, VERYLARGE];
-var poses = [0, 10, 50, 69];
-
-
-// Fuzzing test of reverse on sparse array.
-for (var iterations = 0; iterations < 20; iterations++) {
-  for (var size_pos = 0; size_pos < sizes.length; size_pos++) {
-    var size = sizes[size_pos];
-
-    var to_delete = [];
-
-    var a;
-    // Make sure we test both array-backed and hash-table backed
-    // arrays.
-    if (size < 1000) {
-      a = new Array(size);
-    } else {
-      a = new Array();
-      a.length = size;
-    }
-
-    var expected = '';
-    var expected_reversed = '';
-
-    for (var pos_pos = 0; pos_pos < poses.length; pos_pos++) {
-      var pos = poses[pos_pos];
-      var letter = String.fromCharCode(97 + pos_pos);
-      if (DoOrDont()) {
-        a[pos] = letter;
-        expected += letter;
-        expected_reversed = letter + expected_reversed;
-      } else if (DoOrDont()) {
-        Array.prototype[pos] = letter;
-        expected += letter;
-        expected_reversed = letter + expected_reversed;
-        to_delete.push(pos);
-      }
-    }
-    var expected2 = '';
-    var expected_reversed2 = '';
-    for (var pos_pos = poses.length - 1; pos_pos >= 0; pos_pos--) {
-      var letter = String.fromCharCode(110 + pos_pos);
-      var pos = size - poses[pos_pos] - 1;
-      if (DoOrDont()) {
-        a[pos] = letter;
-        expected2 += letter;
-        expected_reversed2 = letter + expected_reversed2;
-      } else if (DoOrDont()) {
-        Array.prototype[pos] = letter;
-        expected2 += letter;
-        expected_reversed2 = letter + expected_reversed2;
-        to_delete.push(pos);
-      }
-    }
-
-    assertEquals(expected + expected2, a.join(''), 'join' + size);
-    a.reverse();
-
-    while (to_delete.length != 0) {
-      var pos = to_delete.pop();
-      delete(Array.prototype[pos]);
-    }
-
-    assertEquals(expected_reversed2 + expected_reversed, a.join(''), 'reverse then join' + size);
-  }
-}
diff --git a/src/v8/test/mjsunit/wasm/default-liftoff-setting.js b/src/v8/test/mjsunit/wasm/default-liftoff-setting.js
deleted file mode 100644
index 9ae6e92..0000000
--- a/src/v8/test/mjsunit/wasm/default-liftoff-setting.js
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax
-
-// This test makes sure that by default, we do not compile with liftoff.
-
-load('test/mjsunit/wasm/wasm-constants.js');
-load('test/mjsunit/wasm/wasm-module-builder.js');
-
-const builder = new WasmModuleBuilder();
-builder.addFunction('i32_add', kSig_i_ii)
-    .addBody([kExprGetLocal, 0, kExprGetLocal, 1, kExprI32Add])
-    .exportFunc();
-
-const instance = builder.instantiate();
-
-assertFalse(
-    %IsLiftoffFunction(instance.exports.i32_add),
-    'liftoff compilation should be off by default');
diff --git a/src/v8/test/mjsunit/wasm/jsapi-harness.js b/src/v8/test/mjsunit/wasm/jsapi-harness.js
deleted file mode 100644
index d827b67..0000000
--- a/src/v8/test/mjsunit/wasm/jsapi-harness.js
+++ /dev/null
@@ -1,139 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// TODO(eholk): Once we have stable test IDs, use those as the key instead.
-// See https://github.com/WebAssembly/spec/issues/415
-//
-// Flags: --expose-wasm --allow-natives-syntax
-
-const known_failures = {
-  // Enter failing tests like follows:
-  // "'WebAssembly.Instance.prototype.exports' accessor property":
-  //  'https://bugs.chromium.org/p/v8/issues/detail?id=5507',
-};
-
-let failures = [];
-let unexpected_successes = [];
-
-let last_promise = new Promise((resolve, reject) => { resolve(); });
-
-function test(func, description) {
-  let maybeErr;
-  try { func(); }
-  catch(e) { maybeErr = e; }
-  if (typeof maybeErr !== 'undefined') {
-    var known = "";
-    if (known_failures[description]) {
-      known = " (known)";
-    }
-    print(`${description}: FAIL${known}. ${maybeErr}`);
-    failures.push(description);
-  } else {
-    if (known_failures[description]) {
-      unexpected_successes.push(description);
-    }
-    print(`${description}: PASS.`);
-  }
-}
-
-function promise_test(func, description) {
-  last_promise = last_promise.then(func)
-  .then(_ => {
-    if (known_failures[description]) {
-      unexpected_successes.push(description);
-    }
-    print(`${description}: PASS.`);
-  })
-  .catch(err => {
-    var known = "";
-    if (known_failures[description]) {
-      known = " (known)";
-    }
-    print(`${description}: FAIL${known}. ${err}`);
-    failures.push(description);
-  });
-}
-
-let assert_true = assertEquals.bind(null, true);
-let assert_false = assertEquals.bind(null, false);
-
-function same_value(x, y) {
-  if (y !== y) {
-    // NaN case
-    return x!==x;
-  }
-  if (x === 0 && y === 0) {
-    // Distinguish +0 and -0
-    return 1/x === 1/y;
-  }
-  return x === y;
-}
-
-let assert_equals = function(expected, found, description) {
-  if (typeof found != typeof expected) {
-    assert_true(false, "assert_equals", description,
-        "expected (" + typeof expected + ") ${expected} but got (" +
-        typeof found + ") ${found}", {expected:expected, found:found});
-  }
-  assert_true(same_value(found, expected), "assert_equals", description,
-      "expected ${expected} but got ${found}",
-      {expected:expected, found:found});
-}
-
-let assert_not_equals = function(expected, found, description) {
-  assert_true(!same_value(found, expected), "assert_not_equals", description,
-      "got disallowed value ${found}", {found:found});
-}
-
-function assert_unreached(description) {
-  throw new Error(`unreachable:\n${description}`);
-}
-
-function assertErrorMessage(f, ctor, test) {
-  try { f(); }
-  catch (e) {
-    assert_true(e instanceof ctor, "expected exception " + ctor.name + ", got " + e);
-    return;
-  }
-  assert_true(false, "expected exception " + ctor.name + ", no exception thrown");
-};
-
-load("test/wasm-js/test/harness/wasm-constants.js");
-load("test/wasm-js/test/harness/wasm-module-builder.js");
-load("test/wasm-js/test/js-api/jsapi.js");
-
-assertPromiseResult(last_promise, _ => {
-  if (failures.length > 0) {
-    let unexpected = false;
-    print("Some tests FAILED:");
-    for (let i in failures) {
-      if (known_failures[failures[i]]) {
-        print(`  ${failures[i]} [KNOWN: ${known_failures[failures[i]]}]`);
-      } else {
-        print(`  ${failures[i]}`);
-        unexpected = true;
-      }
-    }
-    if (unexpected_successes.length > 0) {
-      unexpected = true;
-      print("");
-      print("Unexpected successes:");
-      for(let i in unexpected_successes) {
-        print(`  ${unexpected_successes[i]}`);
-      }
-      print("Some tests SUCCEEDED but were known failures. If you've fixed " +
-            "the bug, please remove the test from the known failures list.")
-    }
-    if (unexpected) {
-      print("\n");
-      print("   #############################################################");
-      print("   #                                                           #");
-      print("   # Unexpected outcome. Did you forget to run 'gclient sync'? #");
-      print("   #                                                           #");
-      print("   #############################################################");
-      print("\n");
-      assertUnreachable("Unexpected outcome");
-    }
-  }
-});
diff --git a/src/v8/test/mjsunit/wasm/test-import-export-wrapper.js b/src/v8/test/mjsunit/wasm/test-import-export-wrapper.js
deleted file mode 100644
index e298468..0000000
--- a/src/v8/test/mjsunit/wasm/test-import-export-wrapper.js
+++ /dev/null
@@ -1,326 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --expose-wasm --allow-natives-syntax
-
-load("test/mjsunit/wasm/wasm-constants.js");
-load("test/mjsunit/wasm/wasm-module-builder.js");
-
-var expect_elison = 0;
-var expect_no_elison = 1;
-// function calls stack: first_export -> first_func -> first_import ->
-// second_export -> second_import
-// In this case, first_import and second_export have same signature,
-// So that wrappers will be removed
-(function TestWasmWrapperElision() {
-    var imported = function (a) {
-        return a;
-    };
-
-    var second_module = new WasmModuleBuilder();
-    var sig_index = second_module.addType(kSig_i_i);
-    second_module
-        .addImport("import_module_2", "import_name_2", sig_index);
-    second_module
-        .addFunction("second_export", sig_index)
-        .addBody([
-            kExprGetLocal, 0,
-            kExprCallFunction, 0,
-            kExprReturn
-        ])
-        .exportFunc();
-
-    var first_module = new WasmModuleBuilder();
-    var sig_index = first_module.addType(kSig_i_i);
-    first_module
-        .addImport("import_module_1", "import_name_1", sig_index);
-    first_module
-        .addFunction("first_export", sig_index)
-        .addBody([
-            kExprGetLocal, 0,
-            kExprCallFunction, 2,
-            kExprReturn
-        ])
-        .exportFunc();
-    first_module
-        .addFunction("first_func", sig_index)
-        .addBody([
-            kExprI32Const, 1,
-            kExprGetLocal, 0,
-            kExprI32Add,
-            kExprCallFunction, 0,
-            kExprReturn
-        ]);
-
-    var f = second_module
-        .instantiate({import_module_2: {import_name_2: imported}})
-        .exports.second_export;
-    var the_export = first_module
-        .instantiate({import_module_1: {import_name_1: f}})
-        .exports.first_export;
-    assertEquals(the_export(2), 3);
-    assertEquals(the_export(-1), 0);
-    assertEquals(the_export(0), 1);
-    assertEquals(the_export(5.5), 6);
-    assertEquals(%CheckWasmWrapperElision(the_export, expect_elison), true);
-})();
-
-// Function calls stack: first_export -> first_func -> first_import ->
-// second_export -> second_import
-// In this test, first_import and second_export have the same signature, and
-// therefore the wrappers will be removed. If the wrappers are not removed, then
-// the test crashes because of the int64 parameter, which is not allowed in the
-// wrappers.
-(function TestWasmWrapperElisionInt64() {
- var imported = function (a) {
-     return a;
- };
-
- var second_module = new WasmModuleBuilder();
- var sig_index1 = second_module.addType(kSig_i_i);
- var sig_index_ll = second_module.addType(kSig_l_l);
- second_module
-     .addImport("import_module_2", "import_name_2", sig_index1);
- second_module
-     .addFunction("second_export", sig_index_ll)
-     .addBody([
-         kExprGetLocal, 0,
-         kExprI32ConvertI64,
-         kExprCallFunction, 0,
-         kExprI64SConvertI32,
-         kExprReturn
-     ])
-     .exportFunc();
-
- var first_module = new WasmModuleBuilder();
- var sig_index = first_module.addType(kSig_i_v);
- var sig_index_ll = first_module.addType(kSig_l_l);
- first_module
-     .addImport("import_module_1", "import_name_1", sig_index_ll);
- first_module
-     .addFunction("first_export", sig_index)
-     .addBody([
-         kExprI64Const, 2,
-         kExprCallFunction, 2,
-         kExprI32ConvertI64,
-         kExprReturn
-     ])
-     .exportFunc();
- first_module
-     .addFunction("first_func", sig_index_ll)
-     .addBody([
-         kExprI64Const, 1,
-         kExprGetLocal, 0,
-         kExprI64Add,
-         kExprCallFunction, 0,
-         kExprReturn
-     ]);
-
- var f = second_module
-     .instantiate({import_module_2: {import_name_2: imported}})
-     .exports.second_export;
- var the_export = first_module
-     .instantiate({import_module_1: {import_name_1: f}})
-     .exports.first_export;
-   assertEquals(the_export(), 3);
-})();
-
-// function calls stack: first_export -> first_func -> first_import ->
-// second_export -> second_import
-// In this case, second_export has fewer params than first_import,
-// so instantiation should fail.
-assertThrows(function TestWasmWrapperNoElisionLessParams() {
-    var imported = function (a) {
-        return a;
-    };
-
-    var second_module = new WasmModuleBuilder();
-    var sig_index_1 = second_module.addType(kSig_i_i);
-    second_module
-        .addImport("import_module_2", "import_name_2", sig_index_1);
-    second_module
-        .addFunction("second_export", sig_index_1)
-        .addBody([
-            kExprGetLocal, 0,
-            kExprCallFunction, 0,
-            kExprReturn
-        ])
-        .exportFunc();
-
-    var first_module = new WasmModuleBuilder();
-    var sig_index_2 = first_module.addType(kSig_i_ii);
-    first_module
-        .addImport("import_module_1", "import_name_1", sig_index_2);
-    first_module
-        .addFunction("first_export", sig_index_2)
-        .addBody([
-            kExprGetLocal, 0,
-            kExprGetLocal, 1,
-            kExprCallFunction, 2,
-            kExprReturn
-        ])
-        .exportFunc();
-    first_module
-        .addFunction("first_func", sig_index_2)
-        .addBody([
-            kExprGetLocal, 0,
-            kExprGetLocal, 1,
-            kExprCallFunction, 0,
-            kExprReturn
-        ]);
-
-    var f = second_module
-        .instantiate({import_module_2: {import_name_2: imported}})
-        .exports.second_export;
-    var the_export = first_module
-        .instantiate({import_module_1: {import_name_1: f}})
-        .exports.first_export;
-    assertEquals(the_export(4, 5), 4);
-    assertEquals(the_export(-1, 4), -1);
-    assertEquals(the_export(0, 2), 0);
-    assertEquals(the_export(9.9, 4.3), 9);
-    assertEquals(%CheckWasmWrapperElision(the_export, expect_no_elison), true);
-});
-
-// function calls stack: first_export -> first_func -> first_import ->
-// second_export -> second_import
-// In this case, second_export has more params than first_import,
-// so instantiation should fail.
-assertThrows(function TestWasmWrapperNoElisionMoreParams() {
-    var imported = function (a, b, c) {
-        return a+b+c;
-    };
-
-    var second_module = new WasmModuleBuilder();
-    var sig_index_3 = second_module.addType(kSig_i_iii);
-    second_module
-        .addImport("import_module_2", "import_name_2", sig_index_3);
-    second_module
-        .addFunction("second_export", sig_index_3)
-        .addBody([
-            kExprGetLocal, 0,
-            kExprGetLocal, 1,
-            kExprGetLocal, 2,
-            kExprCallFunction, 0,
-            kExprReturn
-        ])
-        .exportFunc();
-
-    var first_module = new WasmModuleBuilder();
-    var sig_index_2 = first_module.addType(kSig_i_ii);
-    first_module
-        .addImport("import_module_1", "import_name_1", sig_index_2);
-    first_module
-        .addFunction("first_export", sig_index_2)
-        .addBody([
-            kExprGetLocal, 0,
-            kExprGetLocal, 1,
-            kExprCallFunction, 2,
-            kExprReturn
-        ])
-        .exportFunc();
-    first_module
-        .addFunction("first_func", sig_index_2)
-        .addBody([
-            kExprGetLocal, 0,
-            kExprGetLocal, 1,
-            kExprCallFunction, 0,
-            kExprReturn
-        ]);
-
-    var f = second_module
-        .instantiate({import_module_2: {import_name_2: imported}})
-        .exports.second_export;
-    var the_export = first_module
-        .instantiate({import_module_1: {import_name_1: f}})
-        .exports.first_export;
-    assertEquals(the_export(5, 6), 11);
-    assertEquals(the_export(-1, -4), -5);
-    assertEquals(the_export(0, 0), 0);
-    assertEquals(the_export(1.1, 2.7), 3);
-    assertEquals(%CheckWasmWrapperElision(the_export, expect_no_elison), true);
-});
-
-// function calls stack: first_export -> first_func -> first_import ->
-// second_export -> second_import
-// In this case, second_export has different params type with first_import,
-// so instantiation should fail.
-assertThrows(function TestWasmWrapperNoElisionTypeMismatch() {
-    var imported = function (a, b) {
-        return a+b;
-    };
-
-    var second_module = new WasmModuleBuilder();
-    var sig_index_2 = second_module.addType(kSig_d_dd);
-    second_module
-        .addImport("import_module_2", "import_name_2", sig_index_2);
-    second_module
-        .addFunction("second_export", sig_index_2)
-        .addBody([
-            kExprGetLocal, 0,
-            kExprGetLocal, 1,
-            kExprCallFunction, 0,
-            kExprReturn
-        ])
-        .exportFunc();
-
-    var first_module = new WasmModuleBuilder();
-    var sig_index_2 = first_module.addType(kSig_i_ii);
-    first_module
-        .addImport("import_module_1", "import_name_1", sig_index_2);
-    first_module
-        .addFunction("first_export", sig_index_2)
-        .addBody([
-            kExprGetLocal, 0,
-            kExprGetLocal, 1,
-            kExprCallFunction, 2,
-            kExprReturn
-        ])
-        .exportFunc();
-    first_module
-        .addFunction("first_func", sig_index_2)
-        .addBody([
-            kExprGetLocal, 0,
-            kExprGetLocal, 1,
-            kExprCallFunction, 0,
-            kExprReturn
-        ]);
-
-    var f = second_module
-        .instantiate({import_module_2: {import_name_2: imported}})
-        .exports.second_export;
-    var the_export = first_module
-        .instantiate({import_module_1: {import_name_1: f}})
-        .exports.first_export;
-    assertEquals(the_export(2.8, 9.1), 11);
-    assertEquals(the_export(-1.7, -2.5), -3);
-    assertEquals(the_export(0.0, 0.0), 0);
-    assertEquals(the_export(2, -2), 0);
-    assertEquals(%CheckWasmWrapperElision(the_export, expect_no_elison), true);
-});
-
-
-(function TestSimpleI64Ret() {
-  var builder = new WasmModuleBuilder();
-  builder.addFunction("exp", kSig_l_v)
-    .addBody([
-      kExprI64Const, 23
-    ])
-    .exportFunc();
-  var exported = builder.instantiate().exports.exp;
-
-  var builder = new WasmModuleBuilder();
-  builder.addImport("imp", "func", kSig_l_v);
-  builder.addFunction("main", kSig_i_v)
-    .addBody([
-      kExprCallFunction, 0,
-      kExprI32ConvertI64
-    ])
-    .exportFunc();
-
-  var instance = builder.instantiate({imp: {func: exported}});
-
-  assertEquals(23, instance.exports.main());
-
-})();
diff --git a/src/v8/test/mjsunit/wasm/wasm-constants.js b/src/v8/test/mjsunit/wasm/wasm-constants.js
deleted file mode 100644
index 4c86065..0000000
--- a/src/v8/test/mjsunit/wasm/wasm-constants.js
+++ /dev/null
@@ -1,445 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --expose-wasm
-
-function bytes() {
-  var buffer = new ArrayBuffer(arguments.length);
-  var view = new Uint8Array(buffer);
-  for (var i = 0; i < arguments.length; i++) {
-    var val = arguments[i];
-    if ((typeof val) == "string") val = val.charCodeAt(0);
-    view[i] = val | 0;
-  }
-  return buffer;
-}
-
-// V8 internal constants
-var kV8MaxPages = 32767;
-
-// Header declaration constants
-var kWasmH0 = 0;
-var kWasmH1 = 0x61;
-var kWasmH2 = 0x73;
-var kWasmH3 = 0x6d;
-
-var kWasmV0 = 0x1;
-var kWasmV1 = 0;
-var kWasmV2 = 0;
-var kWasmV3 = 0;
-
-var kHeaderSize = 8;
-var kPageSize = 65536;
-var kSpecMaxPages = 65535;
-
-function bytesWithHeader() {
-  var buffer = new ArrayBuffer(kHeaderSize + arguments.length);
-  var view = new Uint8Array(buffer);
-  view[0] = kWasmH0;
-  view[1] = kWasmH1;
-  view[2] = kWasmH2;
-  view[3] = kWasmH3;
-  view[4] = kWasmV0;
-  view[5] = kWasmV1;
-  view[6] = kWasmV2;
-  view[7] = kWasmV3;
-  for (var i = 0; i < arguments.length; i++) {
-    var val = arguments[i];
-    if ((typeof val) == "string") val = val.charCodeAt(0);
-    view[kHeaderSize + i] = val | 0;
-  }
-  return buffer;
-}
-
-let kDeclNoLocals = 0;
-
-// Section declaration constants
-let kUnknownSectionCode = 0;
-let kTypeSectionCode = 1;        // Function signature declarations
-let kImportSectionCode = 2;      // Import declarations
-let kFunctionSectionCode = 3;    // Function declarations
-let kTableSectionCode = 4;       // Indirect function table and other tables
-let kMemorySectionCode = 5;      // Memory attributes
-let kGlobalSectionCode = 6;      // Global declarations
-let kExportSectionCode = 7;      // Exports
-let kStartSectionCode = 8;       // Start function declaration
-let kElementSectionCode = 9;     // Elements section
-let kCodeSectionCode = 10;       // Function code
-let kDataSectionCode = 11;       // Data segments
-let kNameSectionCode = 12;       // Name section (encoded as string)
-let kExceptionSectionCode = 13;  // Exception section (must appear before code section)
-
-// Name section types
-let kModuleNameCode = 0;
-let kFunctionNamesCode = 1;
-let kLocalNamesCode = 2;
-
-let kWasmFunctionTypeForm = 0x60;
-let kWasmAnyFunctionTypeForm = 0x70;
-
-let kHasMaximumFlag = 1;
-
-// Function declaration flags
-let kDeclFunctionName   = 0x01;
-let kDeclFunctionImport = 0x02;
-let kDeclFunctionLocals = 0x04;
-let kDeclFunctionExport = 0x08;
-
-// Local types
-let kWasmStmt = 0x40;
-let kWasmI32 = 0x7f;
-let kWasmI64 = 0x7e;
-let kWasmF32 = 0x7d;
-let kWasmF64 = 0x7c;
-let kWasmS128  = 0x7b;
-
-let kExternalFunction = 0;
-let kExternalTable = 1;
-let kExternalMemory = 2;
-let kExternalGlobal = 3;
-
-let kTableZero = 0;
-let kMemoryZero = 0;
-
-// Useful signatures
-let kSig_i_i = makeSig([kWasmI32], [kWasmI32]);
-let kSig_l_l = makeSig([kWasmI64], [kWasmI64]);
-let kSig_i_l = makeSig([kWasmI64], [kWasmI32]);
-let kSig_i_ii = makeSig([kWasmI32, kWasmI32], [kWasmI32]);
-let kSig_i_iii = makeSig([kWasmI32, kWasmI32, kWasmI32], [kWasmI32]);
-let kSig_d_dd = makeSig([kWasmF64, kWasmF64], [kWasmF64]);
-let kSig_l_ll = makeSig([kWasmI64, kWasmI64], [kWasmI64]);
-let kSig_i_dd = makeSig([kWasmF64, kWasmF64], [kWasmI32]);
-let kSig_v_v = makeSig([], []);
-let kSig_i_v = makeSig([], [kWasmI32]);
-let kSig_l_v = makeSig([], [kWasmI64]);
-let kSig_f_v = makeSig([], [kWasmF64]);
-let kSig_d_v = makeSig([], [kWasmF64]);
-let kSig_v_i = makeSig([kWasmI32], []);
-let kSig_v_ii = makeSig([kWasmI32, kWasmI32], []);
-let kSig_v_iii = makeSig([kWasmI32, kWasmI32, kWasmI32], []);
-let kSig_v_l = makeSig([kWasmI64], []);
-let kSig_v_d = makeSig([kWasmF64], []);
-let kSig_v_dd = makeSig([kWasmF64, kWasmF64], []);
-let kSig_v_ddi = makeSig([kWasmF64, kWasmF64, kWasmI32], []);
-let kSig_ii_v = makeSig([], [kWasmI32, kWasmI32]);
-let kSig_iii_v = makeSig([], [kWasmI32, kWasmI32, kWasmI32]);
-let kSig_ii_i = makeSig([kWasmI32], [kWasmI32, kWasmI32]);
-let kSig_iii_i = makeSig([kWasmI32], [kWasmI32, kWasmI32, kWasmI32]);
-let kSig_ii_ii = makeSig([kWasmI32, kWasmI32], [kWasmI32, kWasmI32]);
-let kSig_iii_ii = makeSig([kWasmI32, kWasmI32], [kWasmI32, kWasmI32, kWasmI32]);
-
-let kSig_v_f = makeSig([kWasmF32], []);
-let kSig_f_f = makeSig([kWasmF32], [kWasmF32]);
-let kSig_d_d = makeSig([kWasmF64], [kWasmF64]);
-
-function makeSig(params, results) {
-  return {params: params, results: results};
-}
-
-function makeSig_v_x(x) {
-  return makeSig([x], []);
-}
-
-function makeSig_v_xx(x) {
-  return makeSig([x, x], []);
-}
-
-function makeSig_r_v(r) {
-  return makeSig([], [r]);
-}
-
-function makeSig_r_x(r, x) {
-  return makeSig([x], [r]);
-}
-
-function makeSig_r_xx(r, x) {
-  return makeSig([x, x], [r]);
-}
-
-// Opcodes
-let kExprUnreachable = 0x00;
-let kExprNop = 0x01;
-let kExprBlock = 0x02;
-let kExprLoop = 0x03;
-let kExprIf = 0x04;
-let kExprElse = 0x05;
-let kExprTry = 0x06;
-let kExprCatch = 0x07;
-let kExprThrow = 0x08;
-let kExprEnd = 0x0b;
-let kExprBr = 0x0c;
-let kExprBrIf = 0x0d;
-let kExprBrTable = 0x0e;
-let kExprReturn = 0x0f;
-let kExprCallFunction = 0x10;
-let kExprCallIndirect = 0x11;
-let kExprDrop = 0x1a;
-let kExprSelect = 0x1b;
-let kExprGetLocal = 0x20;
-let kExprSetLocal = 0x21;
-let kExprTeeLocal = 0x22;
-let kExprGetGlobal = 0x23;
-let kExprSetGlobal = 0x24;
-let kExprI32Const = 0x41;
-let kExprI64Const = 0x42;
-let kExprF32Const = 0x43;
-let kExprF64Const = 0x44;
-let kExprI32LoadMem = 0x28;
-let kExprI64LoadMem = 0x29;
-let kExprF32LoadMem = 0x2a;
-let kExprF64LoadMem = 0x2b;
-let kExprI32LoadMem8S = 0x2c;
-let kExprI32LoadMem8U = 0x2d;
-let kExprI32LoadMem16S = 0x2e;
-let kExprI32LoadMem16U = 0x2f;
-let kExprI64LoadMem8S = 0x30;
-let kExprI64LoadMem8U = 0x31;
-let kExprI64LoadMem16S = 0x32;
-let kExprI64LoadMem16U = 0x33;
-let kExprI64LoadMem32S = 0x34;
-let kExprI64LoadMem32U = 0x35;
-let kExprI32StoreMem = 0x36;
-let kExprI64StoreMem = 0x37;
-let kExprF32StoreMem = 0x38;
-let kExprF64StoreMem = 0x39;
-let kExprI32StoreMem8 = 0x3a;
-let kExprI32StoreMem16 = 0x3b;
-let kExprI64StoreMem8 = 0x3c;
-let kExprI64StoreMem16 = 0x3d;
-let kExprI64StoreMem32 = 0x3e;
-let kExprMemorySize = 0x3f;
-let kExprGrowMemory = 0x40;
-let kExprI32Eqz = 0x45;
-let kExprI32Eq = 0x46;
-let kExprI32Ne = 0x47;
-let kExprI32LtS = 0x48;
-let kExprI32LtU = 0x49;
-let kExprI32GtS = 0x4a;
-let kExprI32GtU = 0x4b;
-let kExprI32LeS = 0x4c;
-let kExprI32LeU = 0x4d;
-let kExprI32GeS = 0x4e;
-let kExprI32GeU = 0x4f;
-let kExprI64Eqz = 0x50;
-let kExprI64Eq = 0x51;
-let kExprI64Ne = 0x52;
-let kExprI64LtS = 0x53;
-let kExprI64LtU = 0x54;
-let kExprI64GtS = 0x55;
-let kExprI64GtU = 0x56;
-let kExprI64LeS = 0x57;
-let kExprI64LeU = 0x58;
-let kExprI64GeS = 0x59;
-let kExprI64GeU = 0x5a;
-let kExprF32Eq = 0x5b;
-let kExprF32Ne = 0x5c;
-let kExprF32Lt = 0x5d;
-let kExprF32Gt = 0x5e;
-let kExprF32Le = 0x5f;
-let kExprF32Ge = 0x60;
-let kExprF64Eq = 0x61;
-let kExprF64Ne = 0x62;
-let kExprF64Lt = 0x63;
-let kExprF64Gt = 0x64;
-let kExprF64Le = 0x65;
-let kExprF64Ge = 0x66;
-let kExprI32Clz = 0x67;
-let kExprI32Ctz = 0x68;
-let kExprI32Popcnt = 0x69;
-let kExprI32Add = 0x6a;
-let kExprI32Sub = 0x6b;
-let kExprI32Mul = 0x6c;
-let kExprI32DivS = 0x6d;
-let kExprI32DivU = 0x6e;
-let kExprI32RemS = 0x6f;
-let kExprI32RemU = 0x70;
-let kExprI32And = 0x71;
-let kExprI32Ior = 0x72;
-let kExprI32Xor = 0x73;
-let kExprI32Shl = 0x74;
-let kExprI32ShrS = 0x75;
-let kExprI32ShrU = 0x76;
-let kExprI32Rol = 0x77;
-let kExprI32Ror = 0x78;
-let kExprI64Clz = 0x79;
-let kExprI64Ctz = 0x7a;
-let kExprI64Popcnt = 0x7b;
-let kExprI64Add = 0x7c;
-let kExprI64Sub = 0x7d;
-let kExprI64Mul = 0x7e;
-let kExprI64DivS = 0x7f;
-let kExprI64DivU = 0x80;
-let kExprI64RemS = 0x81;
-let kExprI64RemU = 0x82;
-let kExprI64And = 0x83;
-let kExprI64Ior = 0x84;
-let kExprI64Xor = 0x85;
-let kExprI64Shl = 0x86;
-let kExprI64ShrS = 0x87;
-let kExprI64ShrU = 0x88;
-let kExprI64Rol = 0x89;
-let kExprI64Ror = 0x8a;
-let kExprF32Abs = 0x8b;
-let kExprF32Neg = 0x8c;
-let kExprF32Ceil = 0x8d;
-let kExprF32Floor = 0x8e;
-let kExprF32Trunc = 0x8f;
-let kExprF32NearestInt = 0x90;
-let kExprF32Sqrt = 0x91;
-let kExprF32Add = 0x92;
-let kExprF32Sub = 0x93;
-let kExprF32Mul = 0x94;
-let kExprF32Div = 0x95;
-let kExprF32Min = 0x96;
-let kExprF32Max = 0x97;
-let kExprF32CopySign = 0x98;
-let kExprF64Abs = 0x99;
-let kExprF64Neg = 0x9a;
-let kExprF64Ceil = 0x9b;
-let kExprF64Floor = 0x9c;
-let kExprF64Trunc = 0x9d;
-let kExprF64NearestInt = 0x9e;
-let kExprF64Sqrt = 0x9f;
-let kExprF64Add = 0xa0;
-let kExprF64Sub = 0xa1;
-let kExprF64Mul = 0xa2;
-let kExprF64Div = 0xa3;
-let kExprF64Min = 0xa4;
-let kExprF64Max = 0xa5;
-let kExprF64CopySign = 0xa6;
-let kExprI32ConvertI64 = 0xa7;
-let kExprI32SConvertF32 = 0xa8;
-let kExprI32UConvertF32 = 0xa9;
-let kExprI32SConvertF64 = 0xaa;
-let kExprI32UConvertF64 = 0xab;
-let kExprI64SConvertI32 = 0xac;
-let kExprI64UConvertI32 = 0xad;
-let kExprI64SConvertF32 = 0xae;
-let kExprI64UConvertF32 = 0xaf;
-let kExprI64SConvertF64 = 0xb0;
-let kExprI64UConvertF64 = 0xb1;
-let kExprF32SConvertI32 = 0xb2;
-let kExprF32UConvertI32 = 0xb3;
-let kExprF32SConvertI64 = 0xb4;
-let kExprF32UConvertI64 = 0xb5;
-let kExprF32ConvertF64 = 0xb6;
-let kExprF64SConvertI32 = 0xb7;
-let kExprF64UConvertI32 = 0xb8;
-let kExprF64SConvertI64 = 0xb9;
-let kExprF64UConvertI64 = 0xba;
-let kExprF64ConvertF32 = 0xbb;
-let kExprI32ReinterpretF32 = 0xbc;
-let kExprI64ReinterpretF64 = 0xbd;
-let kExprF32ReinterpretI32 = 0xbe;
-let kExprF64ReinterpretI64 = 0xbf;
-
-// Prefix opcodes
-let kAtomicPrefix = 0xfe;
-
-let kExprI32AtomicLoad = 0x10;
-let kExprI32AtomicLoad8U = 0x12;
-let kExprI32AtomicLoad16U = 0x13;
-let kExprI32AtomicStore = 0x17;
-let kExprI32AtomicStore8U = 0x19;
-let kExprI32AtomicStore16U = 0x1a;
-let kExprI32AtomicAdd = 0x1e;
-let kExprI32AtomicAdd8U = 0x20;
-let kExprI32AtomicAdd16U = 0x21;
-let kExprI32AtomicSub = 0x25;
-let kExprI32AtomicSub8U = 0x27;
-let kExprI32AtomicSub16U = 0x28;
-let kExprI32AtomicAnd = 0x2c;
-let kExprI32AtomicAnd8U = 0x2e;
-let kExprI32AtomicAnd16U = 0x2f;
-let kExprI32AtomicOr = 0x33;
-let kExprI32AtomicOr8U = 0x35;
-let kExprI32AtomicOr16U = 0x36;
-let kExprI32AtomicXor = 0x3a;
-let kExprI32AtomicXor8U = 0x3c;
-let kExprI32AtomicXor16U = 0x3d;
-let kExprI32AtomicExchange = 0x41;
-let kExprI32AtomicExchange8U = 0x43;
-let kExprI32AtomicExchange16U = 0x44;
-let kExprI32AtomicCompareExchange = 0x48
-let kExprI32AtomicCompareExchange8U = 0x4a
-let kExprI32AtomicCompareExchange16U = 0x4b
-
-let kTrapUnreachable          = 0;
-let kTrapMemOutOfBounds       = 1;
-let kTrapDivByZero            = 2;
-let kTrapDivUnrepresentable   = 3;
-let kTrapRemByZero            = 4;
-let kTrapFloatUnrepresentable = 5;
-let kTrapFuncInvalid          = 6;
-let kTrapFuncSigMismatch      = 7;
-let kTrapInvalidIndex         = 8;
-
-let kTrapMsgs = [
-  "unreachable",
-  "memory access out of bounds",
-  "divide by zero",
-  "divide result unrepresentable",
-  "remainder by zero",
-  "integer result unrepresentable",
-  "invalid function",
-  "function signature mismatch",
-  "invalid index into function table"
-];
-
-function assertTraps(trap, code) {
-  try {
-    if (typeof code === 'function') {
-      code();
-    } else {
-      eval(code);
-    }
-  } catch (e) {
-    assertEquals('object', typeof e);
-    assertEquals(kTrapMsgs[trap], e.message);
-    // Success.
-    return;
-  }
-  throw new MjsUnitAssertionError('Did not trap, expected: ' + kTrapMsgs[trap]);
-}
-
-function assertWasmThrows(runtime_id, values, code) {
-  try {
-    if (typeof code === 'function') {
-      code();
-    } else {
-      eval(code);
-    }
-  } catch (e) {
-    assertTrue(e instanceof WebAssembly.RuntimeError);
-    var e_runtime_id = e['WasmExceptionRuntimeId'];
-    assertEquals(e_runtime_id, runtime_id);
-    assertTrue(Number.isInteger(e_runtime_id));
-    var e_values = e['WasmExceptionValues'];
-    assertEquals(values.length, e_values.length);
-    for (i = 0; i < values.length; ++i) {
-      assertEquals(values[i], e_values[i]);
-    }
-    // Success.
-    return;
-  }
-  throw new MjsUnitAssertionError('Did not throw expected: ' + runtime_id + values);
-}
-
-function wasmI32Const(val) {
-  let bytes = [kExprI32Const];
-  for (let i = 0; i < 4; ++i) {
-    bytes.push(0x80 | ((val >> (7 * i)) & 0x7f));
-  }
-  bytes.push((val >> (7 * 4)) & 0x7f);
-  return bytes;
-}
-
-function wasmF32Const(f) {
-  return [kExprF32Const].concat(Array.from(new Uint8Array((new Float32Array([f])).buffer)));
-}
-
-function wasmF64Const(f) {
-  return [kExprF64Const].concat(Array.from(new Uint8Array((new Float64Array([f])).buffer)));
-}
diff --git a/src/v8/test/mkgrokdump/mkgrokdump.gyp b/src/v8/test/mkgrokdump/mkgrokdump.gyp
deleted file mode 100644
index 56f9ad1..0000000
--- a/src/v8/test/mkgrokdump/mkgrokdump.gyp
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright 2017 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'variables': {
-    'v8_code': 1,
-  },
-  'includes': ['../../gypfiles/toolchain.gypi', '../../gypfiles/features.gypi'],
-  'targets': [
-    {
-      'target_name': 'mkgrokdump',
-      'type': 'executable',
-      'dependencies': [
-        '../../src/v8.gyp:v8',
-        '../../src/v8.gyp:v8_libbase',
-        '../../src/v8.gyp:v8_libplatform',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [
-        'mkgrokdump.cc',
-      ],
-    },
-  ],
-  'conditions': [
-    ['test_isolation_mode != "noop"', {
-      'targets': [
-        {
-          'target_name': 'mkgrokdump_run',
-          'type': 'none',
-          'dependencies': [
-            'mkgrokdump',
-          ],
-          'includes': [
-            '../../gypfiles/isolate.gypi',
-          ],
-          'sources': [
-            'mkgrokdump.isolate',
-          ],
-        },
-      ],
-    }],
-  ],
-}
diff --git a/src/v8/test/mkgrokdump/mkgrokdump.isolate b/src/v8/test/mkgrokdump/mkgrokdump.isolate
deleted file mode 100644
index b2cbc32..0000000
--- a/src/v8/test/mkgrokdump/mkgrokdump.isolate
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright 2017 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'variables': {
-    'files': [
-      './mkgrokdump.status',
-      './testcfg.py',
-      '../../tools/v8heapconst.py',
-      '<(PRODUCT_DIR)/mkgrokdump<(EXECUTABLE_SUFFIX)',
-    ],
-  },
-  'includes': [
-    '../../src/base.isolate',
-    '../../tools/testrunner/testrunner.isolate',
-  ],
-}
diff --git a/src/v8/test/mozilla/mozilla.gyp b/src/v8/test/mozilla/mozilla.gyp
deleted file mode 100644
index 0327dd8..0000000
--- a/src/v8/test/mozilla/mozilla.gyp
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'conditions': [
-    ['test_isolation_mode != "noop"', {
-      'targets': [
-        {
-          'target_name': 'mozilla_run',
-          'type': 'none',
-          'dependencies': [
-            '../../src/d8.gyp:d8_run',
-          ],
-          'includes': [
-            '../../gypfiles/features.gypi',
-            '../../gypfiles/isolate.gypi',
-          ],
-          'sources': [
-            'mozilla.isolate',
-          ],
-        },
-      ],
-    }],
-  ],
-}
diff --git a/src/v8/test/mozilla/mozilla.isolate b/src/v8/test/mozilla/mozilla.isolate
deleted file mode 100644
index dbeca5e..0000000
--- a/src/v8/test/mozilla/mozilla.isolate
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'variables': {
-    'files': [
-      './',
-    ],
-  },
-  'includes': [
-    '../../src/d8.isolate',
-    '../../tools/testrunner/testrunner.isolate',
-  ],
-}
\ No newline at end of file
diff --git a/src/v8/test/optimize_for_size.gyp b/src/v8/test/optimize_for_size.gyp
deleted file mode 100644
index 8728479..0000000
--- a/src/v8/test/optimize_for_size.gyp
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'conditions': [
-    ['test_isolation_mode != "noop"', {
-      'targets': [
-        {
-          'target_name': 'optimize_for_size_run',
-          'type': 'none',
-          'dependencies': [
-            'cctest/cctest.gyp:cctest_run',
-            'debugger/debugger.gyp:debugger_run',
-            'intl/intl.gyp:intl_run',
-            'mjsunit/mjsunit.gyp:mjsunit_run',
-            'webkit/webkit.gyp:webkit_run',
-          ],
-          'includes': [
-            '../gypfiles/features.gypi',
-            '../gypfiles/isolate.gypi',
-          ],
-          'sources': [
-            'optimize_for_size.isolate',
-          ],
-        },
-      ],
-    }],
-  ],
-}
diff --git a/src/v8/test/optimize_for_size.isolate b/src/v8/test/optimize_for_size.isolate
deleted file mode 100644
index 6f3313e..0000000
--- a/src/v8/test/optimize_for_size.isolate
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'variables': {
-    'command': [
-      '../tools/run-tests.py',
-    ],
-  },
-  'includes': [
-    'cctest/cctest.isolate',
-    'debugger/debugger.isolate',
-    'inspector/inspector.isolate',
-    'intl/intl.isolate',
-    'mjsunit/mjsunit.isolate',
-    'webkit/webkit.isolate',
-  ],
-}
diff --git a/src/v8/test/perf.gyp b/src/v8/test/perf.gyp
deleted file mode 100644
index 4f024f7..0000000
--- a/src/v8/test/perf.gyp
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 2016 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'conditions': [
-    ['test_isolation_mode != "noop"', {
-      'targets': [
-        {
-          'target_name': 'perf_run',
-          'type': 'none',
-          'dependencies': [
-            'cctest/cctest.gyp:cctest_exe_run',
-            '../src/d8.gyp:d8_run',
-          ],
-          'includes': [
-            '../gypfiles/features.gypi',
-            '../gypfiles/isolate.gypi',
-          ],
-          'sources': [
-            'perf.isolate',
-          ],
-        },
-      ],
-    }],
-  ],
-}
diff --git a/src/v8/test/perf.isolate b/src/v8/test/perf.isolate
deleted file mode 100644
index 132bcc5..0000000
--- a/src/v8/test/perf.isolate
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 2016 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'variables': {
-    'command': [
-      '../tools/run_perf.py',
-    ],
-    'files': [
-      '../tools/run_perf.py',
-      # TODO(machenbach): These files are referenced by the perf runner.
-      # They should be transformed into a proper python module.
-      '../tools/testrunner/local/command.py',
-      '../tools/testrunner/local/utils.py',
-      '../tools/testrunner/objects/output.py',
-      # This is often used to trigger performance bots. We include it in the
-      # isolate to not get these builds deduped.
-      '../tools/whitespace.txt',
-      'js-perf-test/',
-      'memory/',
-    ],
-  },
-  'includes': [
-    'cctest/cctest_exe.isolate',
-    '../src/d8.isolate',
-  ],
-}
diff --git a/src/v8/test/preparser/preparser.gyp b/src/v8/test/preparser/preparser.gyp
deleted file mode 100644
index 8e944ed..0000000
--- a/src/v8/test/preparser/preparser.gyp
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'conditions': [
-    ['test_isolation_mode != "noop"', {
-      'targets': [
-        {
-          'target_name': 'preparser_run',
-          'type': 'none',
-          'dependencies': [
-            '../../src/d8.gyp:d8_run',
-          ],
-          'includes': [
-            '../../gypfiles/features.gypi',
-            '../../gypfiles/isolate.gypi',
-          ],
-          'sources': [
-            'preparser.isolate',
-          ],
-        },
-      ],
-    }],
-  ],
-}
diff --git a/src/v8/test/preparser/preparser.isolate b/src/v8/test/preparser/preparser.isolate
deleted file mode 100644
index dbeca5e..0000000
--- a/src/v8/test/preparser/preparser.isolate
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'variables': {
-    'files': [
-      './',
-    ],
-  },
-  'includes': [
-    '../../src/d8.isolate',
-    '../../tools/testrunner/testrunner.isolate',
-  ],
-}
\ No newline at end of file
diff --git a/src/v8/test/test262/archive.py b/src/v8/test/test262/archive.py
deleted file mode 100755
index 894853e..0000000
--- a/src/v8/test/test262/archive.py
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2016 the V8 project 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 os
-import sys
-import tarfile
-import time
-
-# In GN we expect the path to a stamp file as an argument.
-if len(sys.argv) == 2:
-  STAMP_FILE = os.path.abspath(sys.argv[1])
-
-os.chdir(os.path.dirname(os.path.abspath(__file__)))
-
-# Workaround for slow grp and pwd calls.
-tarfile.grp = None
-tarfile.pwd = None
-
-def filter_git(tar_info):
-  if tar_info.name.startswith(os.path.join('data', '.git')) or \
-      tar_info.name.startswith(os.path.join('harness', '.git')):
-    return None
-  else:
-    tar_info.uname = tar_info.gname = "test262"
-    return tar_info
-
-with tarfile.open('data.tar', 'w') as tar:
-  tar.add('data', filter=filter_git)
-  tar.add('harness', filter=filter_git)
-
-# Workaround for GN. We can't specify the tarfile as output because it's
-# not in the product directory. Therefore we track running of this script
-# with an extra stamp file in the product directory.
-if len(sys.argv) == 2:
-  with open(STAMP_FILE, 'w') as f:
-    f.write(str(time.time()))
diff --git a/src/v8/test/test262/list.py b/src/v8/test/test262/list.py
deleted file mode 100755
index e99be68..0000000
--- a/src/v8/test/test262/list.py
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2016 the V8 project 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 os
-import sys
-import tarfile
-from itertools import chain
-
-os.chdir(os.path.dirname(os.path.abspath(__file__)))
-
-for root, dirs, files in chain(os.walk("data"), os.walk("harness")):
-  dirs[:] = [d for d in dirs if not d.endswith('.git')]
-  for name in files:
-    # These names are for gyp, which expects slashes on all platforms.
-    pathname = '/'.join(root.split(os.sep) + [name])
-    # For gyp, quote the name in case it includes spaces
-    if len(sys.argv) > 1 and sys.argv[1] == '--quoted':
-      pathname = '"' + pathname + '"'
-      # Temporary hack until we upgrade to gn swarming:
-      # gyp doesn't handle files containing $ in the name very well, so we just
-      # exclude them from the 'sources' list and hope that other changes cause
-      # the archive to be rebuilt.
-      if '$' in pathname: continue
-    print(pathname)
diff --git a/src/v8/test/test262/local-tests/test/built-ins/TypedArray/prototype/set/typedarray-arg-src-byteoffset-internal.js b/src/v8/test/test262/local-tests/test/built-ins/TypedArray/prototype/set/typedarray-arg-src-byteoffset-internal.js
deleted file mode 100644
index 430dbdf..0000000
--- a/src/v8/test/test262/local-tests/test/built-ins/TypedArray/prototype/set/typedarray-arg-src-byteoffset-internal.js
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-/*---
-esid: sec-%typedarray%.prototype.set-typedarray-offset
-description: >
-  Uses typedArray's internal [[ByteOffset]]
-info: >
-  22.2.3.23.2 %TypedArray%.prototype.set(typedArray [ , offset ] )
-  1. Assert: typedArray has a [[TypedArrayName]] internal slot. If it does not,
-  the definition in 22.2.3.23.1 applies.
-  ...
-  21. Let srcByteOffset be typedArray.[[ByteOffset]].
-  ...
-includes: [testTypedArray.js]
----*/
-
-var getCalls = 0;
-var desc = {
-  get: function getLen() {
-    getCalls++;
-    return 0;
-  }
-};
-
-Object.defineProperty(TypedArray.prototype, "byteOffset", desc);
-
-testWithTypedArrayConstructors(function(TA) {
-  var sample = new TA(2);
-  var src = new TA([42, 43]);
-  var differentTA = TA === Uint8Array ? Int8Array : Uint8Array;
-  var src2 = new differentTA([42, 43]);
-  var src3 = new differentTA(sample.buffer, 0, 2);
-
-  Object.defineProperty(TA.prototype, "byteOffset", desc);
-  Object.defineProperty(src, "byteOffset", desc);
-  Object.defineProperty(src2, "byteOffset", desc);
-  Object.defineProperty(src3, "byteOffset", desc);
-
-  sample.set(src);
-  sample.set(src2);
-  sample.set(src3);
-
-  assert.sameValue(getCalls, 0, "ignores byteOffset properties");
-});
diff --git a/src/v8/test/test262/local-tests/test/built-ins/TypedArray/prototype/set/typedarray-arg-target-byteoffset-internal.js b/src/v8/test/test262/local-tests/test/built-ins/TypedArray/prototype/set/typedarray-arg-target-byteoffset-internal.js
deleted file mode 100644
index ab49f66..0000000
--- a/src/v8/test/test262/local-tests/test/built-ins/TypedArray/prototype/set/typedarray-arg-target-byteoffset-internal.js
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-/*---
-esid: sec-%typedarray%.prototype.set-typedarray-offset
-description: >
-  Uses target's internal [[ArrayLength]]
-info: >
-  22.2.3.23.2 %TypedArray%.prototype.set(typedArray [ , offset ] )
-  1. Assert: typedArray has a [[TypedArrayName]] internal slot. If it does not,
-  the definition in 22.2.3.23.1 applies.
-  2. Let target be the this value.
-  ...
-  16. Let targetByteOffset be target.[[ByteOffset]].
-  ...
-includes: [testTypedArray.js]
----*/
-
-var getCalls = 0;
-var desc = {
-  get: function() {
-    getCalls++;
-    return 0;
-  }
-};
-
-Object.defineProperty(TypedArray.prototype, "byteOffset", desc);
-
-testWithTypedArrayConstructors(function(TA) {
-  var sample = new TA(2);
-  var src = new TA([42, 43]);
-  var differentTA = TA === Uint8Array ? Int8Array : Uint8Array;
-  var src2 = new differentTA([42, 43]);
-  var src3 = new differentTA(sample.buffer, 0, 2);
-
-  Object.defineProperty(TA.prototype, "byteOffset", desc);
-  Object.defineProperty(sample, "byteOffset", desc);
-
-  sample.set(src);
-  sample.set(src2);
-  sample.set(src3);
-
-  assert.sameValue(getCalls, 0, "ignores byteoffset properties");
-});
diff --git a/src/v8/test/test262/local-tests/test/intl402/NumberFormat/fraction-digit-options-read-once.js b/src/v8/test/test262/local-tests/test/intl402/NumberFormat/fraction-digit-options-read-once.js
deleted file mode 100644
index e7e37b8..0000000
--- a/src/v8/test/test262/local-tests/test/intl402/NumberFormat/fraction-digit-options-read-once.js
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// This code is governed by the license found in the LICENSE file.
-
-/*---
-esid: ECMA-402 #sec-setnfdigitoptions
-description: >
-    The maximum and minimum fraction digits properties should be read from
-    the options bag exactly once from the NumberFormat constructor.
-    Regression test for https://bugs.chromium.org/p/v8/issues/detail?id=6015
-include: [assert.js]
----*/
-
-var minCounter = 0;
-var maxCounter = 0;
-new Intl.NumberFormat("en", { get minimumFractionDigits() { minCounter++ },
-                              get maximumFractionDigits() { maxCounter++ } });
-assert.sameValue(1, minCounter);
-assert.sameValue(1, maxCounter);
diff --git a/src/v8/test/test262/local-tests/test/intl402/NumberFormat/prototype/formatToParts/default-parameter.js b/src/v8/test/test262/local-tests/test/intl402/NumberFormat/prototype/formatToParts/default-parameter.js
deleted file mode 100644
index 408694c..0000000
--- a/src/v8/test/test262/local-tests/test/intl402/NumberFormat/prototype/formatToParts/default-parameter.js
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (C) 2017 Josh Wolfe. All rights reserved.
-// This code is governed by the BSD license found in the LICENSE file.
-/*---
-esid: #sec-intl.numberformat.prototype.formattoparts
-description: Intl.NumberFormat.prototype.formatToParts called with no parameters
-info: >
-  Intl.NumberFormat.prototype.formatToParts ([ value ])
-
-  3. If value is not provided, let value be undefined.
----*/
-
-var nf = new Intl.NumberFormat();
-
-// Example value: [{"type":"nan","value":"NaN"}]
-var implicit = nf.formatToParts();
-var explicit = nf.formatToParts(undefined);
-
-assert(partsEquals(implicit, explicit),
-  "formatToParts() should be equivalent to formatToParts(undefined)");
-
-function partsEquals(parts1, parts2) {
-  if (parts1.length !== parts2.length) return false;
-  for (var i = 0; i < parts1.length; i++) {
-    var part1 = parts1[i];
-    var part2 = parts2[i];
-    if (part1.type !== part2.type) return false;
-    if (part1.value !== part2.value) return false;
-  }
-  return true;
-}
diff --git a/src/v8/test/test262/test262.gyp b/src/v8/test/test262/test262.gyp
deleted file mode 100644
index eb14da4..0000000
--- a/src/v8/test/test262/test262.gyp
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'conditions': [
-    ['test_isolation_mode != "noop"', {
-      'targets': [
-        {
-          'target_name': 'test262_run',
-          'type': 'none',
-          'dependencies': [
-            '../../src/d8.gyp:d8_run',
-          ],
-          'includes': [
-            '../../gypfiles/features.gypi',
-            '../../gypfiles/isolate.gypi',
-          ],
-          'sources': [
-            'test262.isolate',
-          ],
-          'actions': [
-            {
-              'action_name': 'archive_test262',
-              'inputs': ['archive.py', '<!@(python list.py --quoted)'],
-              'outputs': ['data.tar'],
-              'action': ['python', 'archive.py'],
-            },
-          ],
-        },
-      ],
-    }],
-  ],
-}
diff --git a/src/v8/test/test262/test262.isolate b/src/v8/test/test262/test262.isolate
deleted file mode 100644
index 7631438..0000000
--- a/src/v8/test/test262/test262.isolate
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'variables': {
-    'files': [
-      'data.tar',
-      'detachArrayBuffer.js',
-      'harness-adapt.js',
-      'harness-agent.js',
-      'test262.status',
-      'testcfg.py',
-      'local-tests/',
-    ],
-  },
-  'includes': [
-    '../../src/d8.isolate',
-    '../../tools/testrunner/testrunner.isolate',
-  ],
-}
diff --git a/src/v8/test/unittests/allocation-unittest.cc b/src/v8/test/unittests/allocation-unittest.cc
deleted file mode 100644
index 42904da..0000000
--- a/src/v8/test/unittests/allocation-unittest.cc
+++ /dev/null
@@ -1,164 +0,0 @@
-// Copyright 2017 the V8 project 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 "src/allocation.h"
-
-#if V8_OS_POSIX
-#include <setjmp.h>
-#include <signal.h>
-#include <unistd.h>  // NOLINT
-#endif               // V8_OS_POSIX
-
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace v8 {
-namespace internal {
-
-// TODO(eholk): Add a windows version of permissions tests.
-#if V8_OS_POSIX
-namespace {
-
-// These tests make sure the routines to allocate memory do so with the correct
-// permissions.
-//
-// Unfortunately, there is no API to find the protection of a memory address,
-// so instead we test permissions by installing a signal handler, probing a
-// memory location and recovering from the fault.
-//
-// We don't test the execution permission because to do so we'd have to
-// dynamically generate code and test if we can execute it.
-
-class MemoryAllocationPermissionsTest : public ::testing::Test {
-  static void SignalHandler(int signal, siginfo_t* info, void*) {
-    siglongjmp(continuation_, 1);
-  }
-  struct sigaction old_action_;
-// On Mac, sometimes we get SIGBUS instead of SIGSEGV.
-#if V8_OS_MACOSX
-  struct sigaction old_bus_action_;
-#endif
-
- protected:
-  virtual void SetUp() {
-    struct sigaction action;
-    action.sa_sigaction = SignalHandler;
-    sigemptyset(&action.sa_mask);
-    action.sa_flags = SA_SIGINFO;
-    sigaction(SIGSEGV, &action, &old_action_);
-#if V8_OS_MACOSX
-    sigaction(SIGBUS, &action, &old_bus_action_);
-#endif
-  }
-
-  virtual void TearDown() {
-    // Be a good citizen and restore the old signal handler.
-    sigaction(SIGSEGV, &old_action_, nullptr);
-#if V8_OS_MACOSX
-    sigaction(SIGBUS, &old_bus_action_, nullptr);
-#endif
-  }
-
- public:
-  static sigjmp_buf continuation_;
-
-  enum class MemoryAction { kRead, kWrite };
-
-  void ProbeMemory(volatile int* buffer, MemoryAction action,
-                   bool should_succeed) {
-    const int save_sigs = 1;
-    if (!sigsetjmp(continuation_, save_sigs)) {
-      switch (action) {
-        case MemoryAction::kRead: {
-          // static_cast to remove the reference and force a memory read.
-          USE(static_cast<int>(*buffer));
-          break;
-        }
-        case MemoryAction::kWrite: {
-          *buffer = 0;
-          break;
-        }
-      }
-      if (should_succeed) {
-        SUCCEED();
-      } else {
-        FAIL();
-      }
-      return;
-    }
-    if (should_succeed) {
-      FAIL();
-    } else {
-      SUCCEED();
-    }
-  }
-
-  void TestPermissions(PageAllocator::Permission permission, bool can_read,
-                       bool can_write) {
-    const size_t page_size = AllocatePageSize();
-    int* buffer = static_cast<int*>(
-        AllocatePages(nullptr, page_size, page_size, permission));
-    ProbeMemory(buffer, MemoryAction::kRead, can_read);
-    ProbeMemory(buffer, MemoryAction::kWrite, can_write);
-    CHECK(FreePages(buffer, page_size));
-  }
-};
-
-sigjmp_buf MemoryAllocationPermissionsTest::continuation_;
-
-}  // namespace
-
-TEST_F(MemoryAllocationPermissionsTest, DoTest) {
-  TestPermissions(PageAllocator::Permission::kNoAccess, false, false);
-  TestPermissions(PageAllocator::Permission::kReadWrite, true, true);
-  TestPermissions(PageAllocator::Permission::kReadWriteExecute, true, true);
-}
-#endif  // V8_OS_POSIX
-
-// Basic tests of allocation.
-
-class AllocationTest : public ::testing::Test {};
-
-TEST(AllocationTest, AllocateAndFree) {
-  size_t page_size = v8::internal::AllocatePageSize();
-  CHECK_NE(0, page_size);
-
-  // A large allocation, aligned at native allocation granularity.
-  const size_t kAllocationSize = 1 * v8::internal::MB;
-  void* mem_addr = v8::internal::AllocatePages(
-      v8::internal::GetRandomMmapAddr(), kAllocationSize, page_size,
-      PageAllocator::Permission::kReadWrite);
-  CHECK_NOT_NULL(mem_addr);
-  CHECK(v8::internal::FreePages(mem_addr, kAllocationSize));
-
-  // A large allocation, aligned significantly beyond native granularity.
-  const size_t kBigAlignment = 64 * v8::internal::MB;
-  void* aligned_mem_addr = v8::internal::AllocatePages(
-      v8::internal::GetRandomMmapAddr(), kAllocationSize, kBigAlignment,
-      PageAllocator::Permission::kReadWrite);
-  CHECK_NOT_NULL(aligned_mem_addr);
-  CHECK_EQ(aligned_mem_addr, AlignedAddress(aligned_mem_addr, kBigAlignment));
-  CHECK(v8::internal::FreePages(aligned_mem_addr, kAllocationSize));
-}
-
-TEST(AllocationTest, ReserveMemory) {
-  size_t page_size = v8::internal::AllocatePageSize();
-  const size_t kAllocationSize = 1 * v8::internal::MB;
-  void* mem_addr = v8::internal::AllocatePages(
-      v8::internal::GetRandomMmapAddr(), kAllocationSize, page_size,
-      PageAllocator::Permission::kReadWrite);
-  CHECK_NE(0, page_size);
-  CHECK_NOT_NULL(mem_addr);
-  size_t commit_size = v8::internal::CommitPageSize();
-  CHECK(v8::internal::SetPermissions(mem_addr, commit_size,
-                                     PageAllocator::Permission::kReadWrite));
-  // Check whether we can write to memory.
-  int* addr = static_cast<int*>(mem_addr);
-  addr[v8::internal::KB - 1] = 2;
-  CHECK(v8::internal::SetPermissions(mem_addr, commit_size,
-                                     PageAllocator::Permission::kNoAccess));
-  CHECK(v8::internal::FreePages(mem_addr, kAllocationSize));
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/unittests/asmjs/switch-logic-unittest.cc b/src/v8/test/unittests/asmjs/switch-logic-unittest.cc
deleted file mode 100644
index cc3fbb0..0000000
--- a/src/v8/test/unittests/asmjs/switch-logic-unittest.cc
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/asmjs/switch-logic.h"
-#include "test/unittests/test-utils.h"
-
-namespace v8 {
-namespace internal {
-namespace wasm {
-class SwitchLogicTest : public TestWithZone {};
-
-void CheckNodeValues(CaseNode* node, int begin, int end) {
-  CHECK_EQ(node->begin, begin);
-  CHECK_EQ(node->end, end);
-}
-
-TEST_F(SwitchLogicTest, Single_Table_Test) {
-  ZoneVector<int> values(zone());
-  values.push_back(14);
-  values.push_back(12);
-  values.push_back(15);
-  values.push_back(19);
-  values.push_back(18);
-  values.push_back(16);
-  CaseNode* root = OrderCases(&values, zone());
-  CHECK_NULL(root->left);
-  CHECK_NULL(root->right);
-  CheckNodeValues(root, 12, 19);
-}
-
-TEST_F(SwitchLogicTest, Balanced_Tree_Test) {
-  ZoneVector<int> values(zone());
-  values.push_back(5);
-  values.push_back(1);
-  values.push_back(6);
-  values.push_back(9);
-  values.push_back(-4);
-  CaseNode* root = OrderCases(&values, zone());
-  CheckNodeValues(root, 5, 5);
-  CheckNodeValues(root->left, -4, -4);
-  CHECK_NULL(root->left->left);
-  CheckNodeValues(root->left->right, 1, 1);
-  CHECK_NULL(root->left->right->left);
-  CHECK_NULL(root->left->right->right);
-  CheckNodeValues(root->right, 6, 6);
-  CHECK_NULL(root->right->left);
-  CheckNodeValues(root->right->right, 9, 9);
-  CHECK_NULL(root->right->right->left);
-  CHECK_NULL(root->right->right->right);
-}
-
-TEST_F(SwitchLogicTest, Hybrid_Test) {
-  ZoneVector<int> values(zone());
-  values.push_back(1);
-  values.push_back(2);
-  values.push_back(3);
-  values.push_back(4);
-  values.push_back(7);
-  values.push_back(10);
-  values.push_back(11);
-  values.push_back(12);
-  values.push_back(13);
-  values.push_back(16);
-  CaseNode* root = OrderCases(&values, zone());
-  CheckNodeValues(root, 7, 7);
-  CheckNodeValues(root->left, 1, 4);
-  CheckNodeValues(root->right, 10, 13);
-  CheckNodeValues(root->right->right, 16, 16);
-}
-
-TEST_F(SwitchLogicTest, Single_Case) {
-  ZoneVector<int> values(zone());
-  values.push_back(3);
-  CaseNode* root = OrderCases(&values, zone());
-  CheckNodeValues(root, 3, 3);
-  CHECK_NULL(root->left);
-  CHECK_NULL(root->right);
-}
-
-TEST_F(SwitchLogicTest, Empty_Case) {
-  ZoneVector<int> values(zone());
-  CaseNode* root = OrderCases(&values, zone());
-  CHECK_NULL(root);
-}
-
-}  // namespace wasm
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/unittests/bigint-unittest.cc b/src/v8/test/unittests/bigint-unittest.cc
deleted file mode 100644
index 6e1018c..0000000
--- a/src/v8/test/unittests/bigint-unittest.cc
+++ /dev/null
@@ -1,115 +0,0 @@
-// Copyright 2017 the V8 project 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 <cmath>
-
-#include "src/conversions.h"
-#include "src/factory.h"
-#include "src/isolate.h"
-#include "src/objects-inl.h"
-#include "src/objects/bigint.h"
-#include "test/unittests/test-utils.h"
-
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace v8 {
-namespace internal {
-
-typedef TestWithIsolate BigIntWithIsolate;
-
-void Compare(Handle<BigInt> x, double value, ComparisonResult expected) {
-  CHECK_EQ(expected, BigInt::CompareToDouble(x, value));
-}
-
-Handle<BigInt> NewFromInt(Isolate* isolate, int value) {
-  Handle<Smi> smi_value = handle(Smi::FromInt(value), isolate);
-  return BigInt::FromNumber(isolate, smi_value).ToHandleChecked();
-}
-
-TEST_F(BigIntWithIsolate, CompareToDouble) {
-  Handle<BigInt> zero = NewFromInt(isolate(), 0);
-  Handle<BigInt> one = NewFromInt(isolate(), 1);
-  Handle<BigInt> minus_one = NewFromInt(isolate(), -1);
-
-  // Non-finite doubles.
-  Compare(zero, std::nan(""), ComparisonResult::kUndefined);
-  Compare(one, INFINITY, ComparisonResult::kLessThan);
-  Compare(one, -INFINITY, ComparisonResult::kGreaterThan);
-
-  // Unequal sign.
-  Compare(one, -1, ComparisonResult::kGreaterThan);
-  Compare(minus_one, 1, ComparisonResult::kLessThan);
-
-  // Cases involving zero.
-  Compare(zero, 0, ComparisonResult::kEqual);
-  Compare(zero, -0, ComparisonResult::kEqual);
-  Compare(one, 0, ComparisonResult::kGreaterThan);
-  Compare(minus_one, 0, ComparisonResult::kLessThan);
-  Compare(zero, 1, ComparisonResult::kLessThan);
-  Compare(zero, -1, ComparisonResult::kGreaterThan);
-
-  // Small doubles.
-  Compare(zero, 0.25, ComparisonResult::kLessThan);
-  Compare(one, 0.5, ComparisonResult::kGreaterThan);
-  Compare(one, -0.5, ComparisonResult::kGreaterThan);
-  Compare(zero, -0.25, ComparisonResult::kGreaterThan);
-  Compare(minus_one, -0.5, ComparisonResult::kLessThan);
-
-  // Different bit lengths.
-  Handle<BigInt> four = NewFromInt(isolate(), 4);
-  Handle<BigInt> minus_five = NewFromInt(isolate(), -5);
-  Compare(four, 3.9, ComparisonResult::kGreaterThan);
-  Compare(four, 1.5, ComparisonResult::kGreaterThan);
-  Compare(four, 8, ComparisonResult::kLessThan);
-  Compare(four, 16, ComparisonResult::kLessThan);
-  Compare(minus_five, -4.9, ComparisonResult::kLessThan);
-  Compare(minus_five, -4, ComparisonResult::kLessThan);
-  Compare(minus_five, -25, ComparisonResult::kGreaterThan);
-
-  // Same bit length, difference in first digit.
-  double big_double = 4428155326412785451008.0;
-  Handle<BigInt> big =
-      BigIntLiteral(isolate(), "0xF10D00000000000000").ToHandleChecked();
-  Compare(big, big_double, ComparisonResult::kGreaterThan);
-  big = BigIntLiteral(isolate(), "0xE00D00000000000000").ToHandleChecked();
-  Compare(big, big_double, ComparisonResult::kLessThan);
-
-  double other_double = -13758438578910658560.0;
-  Handle<BigInt> other =
-      BigIntLiteral(isolate(), "-0xBEEFC1FE00000000").ToHandleChecked();
-  Compare(other, other_double, ComparisonResult::kGreaterThan);
-  other = BigIntLiteral(isolate(), "-0xBEEFCBFE00000000").ToHandleChecked();
-  Compare(other, other_double, ComparisonResult::kLessThan);
-
-  // Same bit length, difference in non-first digit.
-  big = BigIntLiteral(isolate(), "0xF00D00000000000001").ToHandleChecked();
-  Compare(big, big_double, ComparisonResult::kGreaterThan);
-  big = BigIntLiteral(isolate(), "0xF00A00000000000000").ToHandleChecked();
-  Compare(big, big_double, ComparisonResult::kLessThan);
-
-  other = BigIntLiteral(isolate(), "-0xBEEFCAFE00000001").ToHandleChecked();
-  Compare(other, other_double, ComparisonResult::kLessThan);
-
-  // Same bit length, difference in fractional part.
-  Compare(one, 1.5, ComparisonResult::kLessThan);
-  Compare(minus_one, -1.25, ComparisonResult::kGreaterThan);
-  big = NewFromInt(isolate(), 0xF00D00);
-  Compare(big, 15731968.125, ComparisonResult::kLessThan);
-  Compare(big, 15731967.875, ComparisonResult::kGreaterThan);
-  big = BigIntLiteral(isolate(), "0x123456789AB").ToHandleChecked();
-  Compare(big, 1250999896491.125, ComparisonResult::kLessThan);
-
-  // Equality!
-  Compare(one, 1, ComparisonResult::kEqual);
-  Compare(minus_one, -1, ComparisonResult::kEqual);
-  big = BigIntLiteral(isolate(), "0xF00D00000000000000").ToHandleChecked();
-  Compare(big, big_double, ComparisonResult::kEqual);
-
-  Handle<BigInt> two_52 =
-      BigIntLiteral(isolate(), "0x10000000000000").ToHandleChecked();
-  Compare(two_52, 4503599627370496.0, ComparisonResult::kEqual);
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/unittests/cancelable-tasks-unittest.cc b/src/v8/test/unittests/cancelable-tasks-unittest.cc
deleted file mode 100644
index d046287..0000000
--- a/src/v8/test/unittests/cancelable-tasks-unittest.cc
+++ /dev/null
@@ -1,263 +0,0 @@
-// Copyright 2015 the V8 project 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 "src/base/atomicops.h"
-#include "src/base/platform/platform.h"
-#include "src/cancelable-task.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-
-namespace v8 {
-namespace internal {
-
-namespace {
-
-class TestTask : public Task, public Cancelable {
- public:
-  enum Mode { kDoNothing, kWaitTillCanceledAgain, kCheckNotRun };
-
-  TestTask(CancelableTaskManager* parent, base::AtomicWord* result,
-           Mode mode = kDoNothing)
-      : Cancelable(parent), result_(result), mode_(mode) {}
-
-  // Task overrides.
-  void Run() final {
-    if (TryRun()) {
-      RunInternal();
-    }
-  }
-
- private:
-  void RunInternal() {
-    base::Release_Store(result_, id());
-
-    switch (mode_) {
-      case kWaitTillCanceledAgain:
-        // Simple busy wait until the main thread tried to cancel.
-        while (CancelAttempts() == 0) {
-        }
-        break;
-      case kCheckNotRun:
-        // Check that we never execute {RunInternal}.
-        EXPECT_TRUE(false);
-        break;
-      default:
-        break;
-    }
-  }
-
-  base::AtomicWord* result_;
-  Mode mode_;
-};
-
-
-class SequentialRunner {
- public:
-  explicit SequentialRunner(TestTask* task) : task_(task) {}
-
-  void Run() {
-    task_->Run();
-    delete task_;
-  }
-
- private:
-  TestTask* task_;
-};
-
-
-class ThreadedRunner final : public base::Thread {
- public:
-  explicit ThreadedRunner(TestTask* task)
-      : Thread(Options("runner thread")), task_(task) {}
-
-  virtual void Run() {
-    task_->Run();
-    delete task_;
-  }
-
- private:
-  TestTask* task_;
-};
-
-
-typedef base::AtomicWord ResultType;
-
-
-intptr_t GetValue(ResultType* result) { return base::Acquire_Load(result); }
-
-}  // namespace
-
-
-TEST(CancelableTask, EmptyCancelableTaskManager) {
-  CancelableTaskManager manager;
-  manager.CancelAndWait();
-}
-
-
-TEST(CancelableTask, SequentialCancelAndWait) {
-  CancelableTaskManager manager;
-  ResultType result1 = 0;
-  SequentialRunner runner1(
-      new TestTask(&manager, &result1, TestTask::kCheckNotRun));
-  EXPECT_EQ(GetValue(&result1), 0);
-  manager.CancelAndWait();
-  EXPECT_EQ(GetValue(&result1), 0);
-  runner1.Run();  // Run to avoid leaking the Task.
-  EXPECT_EQ(GetValue(&result1), 0);
-}
-
-
-TEST(CancelableTask, SequentialMultipleTasks) {
-  CancelableTaskManager manager;
-  ResultType result1 = 0;
-  ResultType result2 = 0;
-  TestTask* task1 = new TestTask(&manager, &result1);
-  TestTask* task2 = new TestTask(&manager, &result2);
-  SequentialRunner runner1(task1);
-  SequentialRunner runner2(task2);
-  EXPECT_EQ(task1->id(), 1u);
-  EXPECT_EQ(task2->id(), 2u);
-
-  EXPECT_EQ(GetValue(&result1), 0);
-  runner1.Run();  // Don't touch task1 after running it.
-  EXPECT_EQ(GetValue(&result1), 1);
-
-  EXPECT_EQ(GetValue(&result2), 0);
-  runner2.Run();  // Don't touch task2 after running it.
-  EXPECT_EQ(GetValue(&result2), 2);
-
-  manager.CancelAndWait();
-  EXPECT_FALSE(manager.TryAbort(1));
-  EXPECT_FALSE(manager.TryAbort(2));
-}
-
-
-TEST(CancelableTask, ThreadedMultipleTasksStarted) {
-  CancelableTaskManager manager;
-  ResultType result1 = 0;
-  ResultType result2 = 0;
-  TestTask* task1 =
-      new TestTask(&manager, &result1, TestTask::kWaitTillCanceledAgain);
-  TestTask* task2 =
-      new TestTask(&manager, &result2, TestTask::kWaitTillCanceledAgain);
-  ThreadedRunner runner1(task1);
-  ThreadedRunner runner2(task2);
-  runner1.Start();
-  runner2.Start();
-  // Busy wait on result to make sure both tasks are done.
-  while ((GetValue(&result1) == 0) || (GetValue(&result2) == 0)) {
-  }
-  manager.CancelAndWait();
-  runner1.Join();
-  runner2.Join();
-  EXPECT_EQ(GetValue(&result1), 1);
-  EXPECT_EQ(GetValue(&result2), 2);
-}
-
-
-TEST(CancelableTask, ThreadedMultipleTasksNotRun) {
-  CancelableTaskManager manager;
-  ResultType result1 = 0;
-  ResultType result2 = 0;
-  TestTask* task1 = new TestTask(&manager, &result1, TestTask::kCheckNotRun);
-  TestTask* task2 = new TestTask(&manager, &result2, TestTask::kCheckNotRun);
-  ThreadedRunner runner1(task1);
-  ThreadedRunner runner2(task2);
-  manager.CancelAndWait();
-  // Tasks are canceled, hence the runner will bail out and not update result.
-  runner1.Start();
-  runner2.Start();
-  runner1.Join();
-  runner2.Join();
-  EXPECT_EQ(GetValue(&result1), 0);
-  EXPECT_EQ(GetValue(&result2), 0);
-}
-
-
-TEST(CancelableTask, RemoveBeforeCancelAndWait) {
-  CancelableTaskManager manager;
-  ResultType result1 = 0;
-  TestTask* task1 = new TestTask(&manager, &result1, TestTask::kCheckNotRun);
-  ThreadedRunner runner1(task1);
-  CancelableTaskManager::Id id = task1->id();
-  EXPECT_EQ(id, 1u);
-  EXPECT_TRUE(manager.TryAbort(id));
-  runner1.Start();
-  runner1.Join();
-  manager.CancelAndWait();
-  EXPECT_EQ(GetValue(&result1), 0);
-}
-
-
-TEST(CancelableTask, RemoveAfterCancelAndWait) {
-  CancelableTaskManager manager;
-  ResultType result1 = 0;
-  TestTask* task1 = new TestTask(&manager, &result1);
-  ThreadedRunner runner1(task1);
-  CancelableTaskManager::Id id = task1->id();
-  EXPECT_EQ(id, 1u);
-  runner1.Start();
-  runner1.Join();
-  manager.CancelAndWait();
-  EXPECT_FALSE(manager.TryAbort(id));
-  EXPECT_EQ(GetValue(&result1), 1);
-}
-
-
-TEST(CancelableTask, RemoveUnmanagedId) {
-  CancelableTaskManager manager;
-  EXPECT_FALSE(manager.TryAbort(1));
-  EXPECT_FALSE(manager.TryAbort(2));
-  manager.CancelAndWait();
-  EXPECT_FALSE(manager.TryAbort(1));
-  EXPECT_FALSE(manager.TryAbort(3));
-}
-
-TEST(CancelableTask, EmptyTryAbortAll) {
-  CancelableTaskManager manager;
-  EXPECT_EQ(manager.TryAbortAll(), CancelableTaskManager::kTaskRemoved);
-}
-
-TEST(CancelableTask, ThreadedMultipleTasksNotRunTryAbortAll) {
-  CancelableTaskManager manager;
-  ResultType result1 = 0;
-  ResultType result2 = 0;
-  TestTask* task1 = new TestTask(&manager, &result1, TestTask::kCheckNotRun);
-  TestTask* task2 = new TestTask(&manager, &result2, TestTask::kCheckNotRun);
-  ThreadedRunner runner1(task1);
-  ThreadedRunner runner2(task2);
-  EXPECT_EQ(manager.TryAbortAll(), CancelableTaskManager::kTaskAborted);
-  // Tasks are canceled, hence the runner will bail out and not update result.
-  runner1.Start();
-  runner2.Start();
-  runner1.Join();
-  runner2.Join();
-  EXPECT_EQ(GetValue(&result1), 0);
-  EXPECT_EQ(GetValue(&result2), 0);
-}
-
-TEST(CancelableTask, ThreadedMultipleTasksStartedTryAbortAll) {
-  CancelableTaskManager manager;
-  ResultType result1 = 0;
-  ResultType result2 = 0;
-  TestTask* task1 =
-      new TestTask(&manager, &result1, TestTask::kWaitTillCanceledAgain);
-  TestTask* task2 =
-      new TestTask(&manager, &result2, TestTask::kWaitTillCanceledAgain);
-  ThreadedRunner runner1(task1);
-  ThreadedRunner runner2(task2);
-  runner1.Start();
-  // Busy wait on result to make sure task1 is done.
-  while (GetValue(&result1) == 0) {
-  }
-  EXPECT_EQ(manager.TryAbortAll(), CancelableTaskManager::kTaskRunning);
-  runner2.Start();
-  runner1.Join();
-  runner2.Join();
-  EXPECT_EQ(GetValue(&result1), 1);
-  EXPECT_EQ(GetValue(&result2), 0);
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/unittests/char-predicates-unittest.cc b/src/v8/test/unittests/char-predicates-unittest.cc
deleted file mode 100644
index 3c6cf5d..0000000
--- a/src/v8/test/unittests/char-predicates-unittest.cc
+++ /dev/null
@@ -1,192 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/char-predicates.h"
-#include "src/unicode.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace v8 {
-namespace internal {
-
-TEST(CharPredicatesTest, WhiteSpace) {
-  EXPECT_TRUE(WhiteSpace::Is(0x0009));
-  EXPECT_TRUE(WhiteSpace::Is(0x000B));
-  EXPECT_TRUE(WhiteSpace::Is(0x000C));
-  EXPECT_TRUE(WhiteSpace::Is(' '));
-  EXPECT_TRUE(WhiteSpace::Is(0x00A0));
-  EXPECT_TRUE(WhiteSpace::Is(0x1680));
-  EXPECT_TRUE(WhiteSpace::Is(0x2000));
-  EXPECT_TRUE(WhiteSpace::Is(0x2007));
-  EXPECT_TRUE(WhiteSpace::Is(0x202F));
-  EXPECT_TRUE(WhiteSpace::Is(0x205F));
-  EXPECT_TRUE(WhiteSpace::Is(0x3000));
-  EXPECT_TRUE(WhiteSpace::Is(0xFEFF));
-  EXPECT_FALSE(WhiteSpace::Is(0x180E));
-}
-
-
-TEST(CharPredicatesTest, WhiteSpaceOrLineTerminator) {
-  EXPECT_TRUE(WhiteSpaceOrLineTerminator::Is(0x0009));
-  EXPECT_TRUE(WhiteSpaceOrLineTerminator::Is(0x000B));
-  EXPECT_TRUE(WhiteSpaceOrLineTerminator::Is(0x000C));
-  EXPECT_TRUE(WhiteSpaceOrLineTerminator::Is(' '));
-  EXPECT_TRUE(WhiteSpaceOrLineTerminator::Is(0x00A0));
-  EXPECT_TRUE(WhiteSpaceOrLineTerminator::Is(0x1680));
-  EXPECT_TRUE(WhiteSpaceOrLineTerminator::Is(0x2000));
-  EXPECT_TRUE(WhiteSpaceOrLineTerminator::Is(0x2007));
-  EXPECT_TRUE(WhiteSpaceOrLineTerminator::Is(0x202F));
-  EXPECT_TRUE(WhiteSpaceOrLineTerminator::Is(0x205F));
-  EXPECT_TRUE(WhiteSpaceOrLineTerminator::Is(0xFEFF));
-  // Line terminators
-  EXPECT_TRUE(WhiteSpaceOrLineTerminator::Is(0x000A));
-  EXPECT_TRUE(WhiteSpaceOrLineTerminator::Is(0x000D));
-  EXPECT_TRUE(WhiteSpaceOrLineTerminator::Is(0x2028));
-  EXPECT_TRUE(WhiteSpaceOrLineTerminator::Is(0x2029));
-  EXPECT_FALSE(WhiteSpaceOrLineTerminator::Is(0x180E));
-}
-
-
-TEST(CharPredicatesTest, IdentifierStart) {
-  EXPECT_TRUE(IdentifierStart::Is('$'));
-  EXPECT_TRUE(IdentifierStart::Is('_'));
-  EXPECT_TRUE(IdentifierStart::Is('\\'));
-
-  // http://www.unicode.org/reports/tr31/
-  // curl http://www.unicode.org/Public/UCD/latest/ucd/PropList.txt |
-  // grep 'Other_ID_Start'
-  // Other_ID_Start
-  EXPECT_TRUE(IdentifierStart::Is(0x1885));
-  EXPECT_TRUE(IdentifierStart::Is(0x1886));
-  EXPECT_TRUE(IdentifierStart::Is(0x2118));
-  EXPECT_TRUE(IdentifierStart::Is(0x212E));
-  EXPECT_TRUE(IdentifierStart::Is(0x309B));
-  EXPECT_TRUE(IdentifierStart::Is(0x309C));
-
-  // Issue 2892:
-  // \u2E2F has the Pattern_Syntax property, excluding it from ID_Start.
-  EXPECT_FALSE(IdentifierStart::Is(0x2E2F));
-
-#ifdef V8_INTL_SUPPORT
-  // New in Unicode 8.0 (6,847 code points)
-  // [:ID_Start:] & [[:Age=8.0:] - [:Age=7.0:]]
-  EXPECT_TRUE(IdentifierStart::Is(0x08B3));
-  EXPECT_TRUE(IdentifierStart::Is(0x0AF9));
-  EXPECT_TRUE(IdentifierStart::Is(0x13F8));
-  EXPECT_TRUE(IdentifierStart::Is(0x9FCD));
-  EXPECT_TRUE(IdentifierStart::Is(0xAB60));
-  EXPECT_TRUE(IdentifierStart::Is(0x10CC0));
-  EXPECT_TRUE(IdentifierStart::Is(0x108E0));
-  EXPECT_TRUE(IdentifierStart::Is(0x2B820));
-
-  // New in Unicode 9.0 (7,177 code points)
-  // [:ID_Start:] & [[:Age=9.0:] - [:Age=8.0:]]
-
-  EXPECT_TRUE(IdentifierStart::Is(0x1C80));
-  EXPECT_TRUE(IdentifierStart::Is(0x104DB));
-  EXPECT_TRUE(IdentifierStart::Is(0x1E922));
-#endif
-}
-
-
-TEST(CharPredicatesTest, IdentifierPart) {
-  EXPECT_TRUE(IdentifierPart::Is('$'));
-  EXPECT_TRUE(IdentifierPart::Is('_'));
-  EXPECT_TRUE(IdentifierPart::Is('\\'));
-  EXPECT_TRUE(IdentifierPart::Is(0x200C));
-  EXPECT_TRUE(IdentifierPart::Is(0x200D));
-
-#ifdef V8_INTL_SUPPORT
-  // New in Unicode 8.0 (6,847 code points)
-  // [:ID_Start:] & [[:Age=8.0:] - [:Age=7.0:]]
-  EXPECT_TRUE(IdentifierPart::Is(0x08B3));
-  EXPECT_TRUE(IdentifierPart::Is(0x0AF9));
-  EXPECT_TRUE(IdentifierPart::Is(0x13F8));
-  EXPECT_TRUE(IdentifierPart::Is(0x9FCD));
-  EXPECT_TRUE(IdentifierPart::Is(0xAB60));
-  EXPECT_TRUE(IdentifierPart::Is(0x10CC0));
-  EXPECT_TRUE(IdentifierPart::Is(0x108E0));
-  EXPECT_TRUE(IdentifierPart::Is(0x2B820));
-
-  // [[:ID_Continue:]-[:ID_Start:]] &  [[:Age=8.0:]-[:Age=7.0:]]
-  // 162 code points
-  EXPECT_TRUE(IdentifierPart::Is(0x08E3));
-  EXPECT_TRUE(IdentifierPart::Is(0xA69E));
-  EXPECT_TRUE(IdentifierPart::Is(0x11730));
-
-  // New in Unicode 9.0 (7,177 code points)
-  // [:ID_Start:] & [[:Age=9.0:] - [:Age=8.0:]]
-  EXPECT_TRUE(IdentifierPart::Is(0x1C80));
-  EXPECT_TRUE(IdentifierPart::Is(0x104DB));
-  EXPECT_TRUE(IdentifierPart::Is(0x1E922));
-
-  // [[:ID_Continue:]-[:ID_Start:]] &  [[:Age=9.0:]-[:Age=8.0:]]
-  // 162 code points
-  EXPECT_TRUE(IdentifierPart::Is(0x08D4));
-  EXPECT_TRUE(IdentifierPart::Is(0x1DFB));
-  EXPECT_TRUE(IdentifierPart::Is(0xA8C5));
-  EXPECT_TRUE(IdentifierPart::Is(0x11450));
-#endif
-
-  // http://www.unicode.org/reports/tr31/
-  // curl http://www.unicode.org/Public/UCD/latest/ucd/PropList.txt |
-  // grep 'Other_ID_(Continue|Start)'
-
-  // Other_ID_Start
-  EXPECT_TRUE(IdentifierPart::Is(0x1885));
-  EXPECT_TRUE(IdentifierPart::Is(0x1886));
-  EXPECT_TRUE(IdentifierPart::Is(0x2118));
-  EXPECT_TRUE(IdentifierPart::Is(0x212E));
-  EXPECT_TRUE(IdentifierPart::Is(0x309B));
-  EXPECT_TRUE(IdentifierPart::Is(0x309C));
-
-  // Other_ID_Continue
-  EXPECT_TRUE(IdentifierPart::Is(0x00B7));
-  EXPECT_TRUE(IdentifierPart::Is(0x0387));
-  EXPECT_TRUE(IdentifierPart::Is(0x1369));
-  EXPECT_TRUE(IdentifierPart::Is(0x1370));
-  EXPECT_TRUE(IdentifierPart::Is(0x1371));
-  EXPECT_TRUE(IdentifierPart::Is(0x19DA));
-
-  // Issue 2892:
-  // \u2E2F has the Pattern_Syntax property, excluding it from ID_Start.
-  EXPECT_FALSE(IdentifierPart::Is(0x2E2F));
-}
-
-#ifdef V8_INTL_SUPPORT
-TEST(CharPredicatesTest, SupplementaryPlaneIdentifiers) {
-  // Both ID_Start and ID_Continue.
-  EXPECT_TRUE(IdentifierStart::Is(0x10403));  // Category Lu
-  EXPECT_TRUE(IdentifierPart::Is(0x10403));
-  EXPECT_TRUE(IdentifierStart::Is(0x1043C));  // Category Ll
-  EXPECT_TRUE(IdentifierPart::Is(0x1043C));
-  EXPECT_TRUE(IdentifierStart::Is(0x16F9C));  // Category Lm
-  EXPECT_TRUE(IdentifierPart::Is(0x16F9C));
-  EXPECT_TRUE(IdentifierStart::Is(0x10048));  // Category Lo
-  EXPECT_TRUE(IdentifierPart::Is(0x10048));
-  EXPECT_TRUE(IdentifierStart::Is(0x1014D));  // Category Nl
-  EXPECT_TRUE(IdentifierPart::Is(0x1014D));
-
-  // New in Unicode 8.0
-  // [ [:ID_Start=Yes:] & [:Age=8.0:]] - [:Age=7.0:]
-  EXPECT_TRUE(IdentifierStart::Is(0x108E0));
-  EXPECT_TRUE(IdentifierStart::Is(0x10C80));
-
-  // Only ID_Continue.
-  EXPECT_FALSE(IdentifierStart::Is(0x101FD));  // Category Mn
-  EXPECT_TRUE(IdentifierPart::Is(0x101FD));
-  EXPECT_FALSE(IdentifierStart::Is(0x11002));  // Category Mc
-  EXPECT_TRUE(IdentifierPart::Is(0x11002));
-  EXPECT_FALSE(IdentifierStart::Is(0x104A9));  // Category Nd
-  EXPECT_TRUE(IdentifierPart::Is(0x104A9));
-
-  // Neither.
-  EXPECT_FALSE(IdentifierStart::Is(0x10111));  // Category No
-  EXPECT_FALSE(IdentifierPart::Is(0x10111));
-  EXPECT_FALSE(IdentifierStart::Is(0x1F4A9));  // Category So
-  EXPECT_FALSE(IdentifierPart::Is(0x1F4A9));
-}
-#endif  // V8_INTL_SUPPORT
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/unittests/code-stub-assembler-unittest.cc b/src/v8/test/unittests/code-stub-assembler-unittest.cc
deleted file mode 100644
index 0ef06c7..0000000
--- a/src/v8/test/unittests/code-stub-assembler-unittest.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2017 the V8 project 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 "test/unittests/code-stub-assembler-unittest.h"
-
-#include "src/code-factory.h"
-#include "src/compiler/node.h"
-#include "src/interface-descriptors.h"
-#include "src/isolate.h"
-#include "src/objects-inl.h"
-#include "test/unittests/compiler/compiler-test-utils.h"
-#include "test/unittests/compiler/node-test-utils.h"
-
-using ::testing::_;
-using v8::internal::compiler::Node;
-
-namespace c = v8::internal::compiler;
-
-namespace v8 {
-namespace internal {
-
-#ifdef ENABLE_VERIFY_CSA
-#define IS_BITCAST_WORD_TO_TAGGED_SIGNED(x) IsBitcastWordToTaggedSigned(x)
-#define IS_BITCAST_TAGGED_TO_WORD(x) IsBitcastTaggedToWord(x)
-#else
-#define IS_BITCAST_WORD_TO_TAGGED_SIGNED(x) (x)
-#define IS_BITCAST_TAGGED_TO_WORD(x) (x)
-#endif
-
-CodeStubAssemblerTestState::CodeStubAssemblerTestState(
-    CodeStubAssemblerTest* test)
-    : compiler::CodeAssemblerState(test->isolate(), test->zone(),
-                                   VoidDescriptor(test->isolate()), Code::STUB,
-                                   "test") {}
-
-TARGET_TEST_F(CodeStubAssemblerTest, SmiTag) {
-  CodeStubAssemblerTestState state(this);
-  CodeStubAssemblerForTest m(&state);
-  Node* value = m.Int32Constant(44);
-  EXPECT_THAT(m.SmiTag(value),
-              IS_BITCAST_WORD_TO_TAGGED_SIGNED(c::IsIntPtrConstant(
-                  static_cast<intptr_t>(44) << (kSmiShiftSize + kSmiTagSize))));
-  EXPECT_THAT(m.SmiUntag(value),
-              c::IsIntPtrConstant(static_cast<intptr_t>(44) >>
-                                  (kSmiShiftSize + kSmiTagSize)));
-}
-
-TARGET_TEST_F(CodeStubAssemblerTest, IntPtrMax) {
-  CodeStubAssemblerTestState state(this);
-  CodeStubAssemblerForTest m(&state);
-  {
-    Node* a = m.IntPtrConstant(100);
-    Node* b = m.IntPtrConstant(1);
-    Node* z = m.IntPtrMax(a, b);
-    EXPECT_THAT(z, c::IsIntPtrConstant(100));
-  }
-}
-
-TARGET_TEST_F(CodeStubAssemblerTest, IntPtrMin) {
-  CodeStubAssemblerTestState state(this);
-  CodeStubAssemblerForTest m(&state);
-  {
-    Node* a = m.IntPtrConstant(100);
-    Node* b = m.IntPtrConstant(1);
-    Node* z = m.IntPtrMin(a, b);
-    EXPECT_THAT(z, c::IsIntPtrConstant(1));
-  }
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/unittests/code-stub-assembler-unittest.h b/src/v8/test/unittests/code-stub-assembler-unittest.h
deleted file mode 100644
index 2c32e0f..0000000
--- a/src/v8/test/unittests/code-stub-assembler-unittest.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_UNITTESTS_CODE_STUB_ASSEMBLER_UNITTEST_H_
-#define V8_UNITTESTS_CODE_STUB_ASSEMBLER_UNITTEST_H_
-
-#include "src/code-stub-assembler.h"
-#include "test/unittests/test-utils.h"
-#include "testing/gmock-support.h"
-
-namespace v8 {
-namespace internal {
-
-class CodeStubAssemblerTest : public TestWithIsolateAndZone {
- public:
-  CodeStubAssemblerTest() {}
-  ~CodeStubAssemblerTest() override {}
-};
-
-class CodeStubAssemblerTestState : public compiler::CodeAssemblerState {
- public:
-  explicit CodeStubAssemblerTestState(CodeStubAssemblerTest* test);
-};
-
-class CodeStubAssemblerForTest : public CodeStubAssembler {
- public:
-  explicit CodeStubAssemblerForTest(CodeStubAssemblerTestState* state)
-      : CodeStubAssembler(state) {}
-};
-
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_UNITTESTS_CODE_STUB_ASSEMBLER_UNITTEST_H_
diff --git a/src/v8/test/unittests/compiler-dispatcher/compiler-dispatcher-tracer-unittest.cc b/src/v8/test/unittests/compiler-dispatcher/compiler-dispatcher-tracer-unittest.cc
deleted file mode 100644
index 6ae5c7b..0000000
--- a/src/v8/test/unittests/compiler-dispatcher/compiler-dispatcher-tracer-unittest.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/compiler-dispatcher/compiler-dispatcher-tracer.h"
-#include "testing/gtest-support.h"
-
-namespace v8 {
-namespace internal {
-
-TEST(CompilerDispatcherTracerTest, EstimateWithoutSamples) {
-  CompilerDispatcherTracer tracer(nullptr);
-
-  EXPECT_EQ(0.0, tracer.EstimatePrepareInMs());
-  EXPECT_EQ(1.0, tracer.EstimateCompileInMs(1));
-  EXPECT_EQ(1.0, tracer.EstimateCompileInMs(42));
-  EXPECT_EQ(0.0, tracer.EstimateFinalizeInMs());
-}
-
-TEST(CompilerDispatcherTracerTest, Average) {
-  CompilerDispatcherTracer tracer(nullptr);
-
-  EXPECT_EQ(0.0, tracer.EstimatePrepareInMs());
-
-  tracer.RecordPrepare(1.0);
-  tracer.RecordPrepare(2.0);
-  tracer.RecordPrepare(3.0);
-
-  EXPECT_EQ((1.0 + 2.0 + 3.0) / 3, tracer.EstimatePrepareInMs());
-}
-
-TEST(CompilerDispatcherTracerTest, SizeBasedAverage) {
-  CompilerDispatcherTracer tracer(nullptr);
-
-  EXPECT_EQ(1.0, tracer.EstimateCompileInMs(100));
-
-  // All three samples parse 100 units/ms.
-  tracer.RecordCompile(1.0, 100);
-  tracer.RecordCompile(2.0, 200);
-  tracer.RecordCompile(3.0, 300);
-
-  EXPECT_EQ(1.0, tracer.EstimateCompileInMs(100));
-  EXPECT_EQ(5.0, tracer.EstimateCompileInMs(500));
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/unittests/compiler-dispatcher/unoptimized-compile-job-unittest.cc b/src/v8/test/unittests/compiler-dispatcher/unoptimized-compile-job-unittest.cc
deleted file mode 100644
index d681627..0000000
--- a/src/v8/test/unittests/compiler-dispatcher/unoptimized-compile-job-unittest.cc
+++ /dev/null
@@ -1,273 +0,0 @@
-// Copyright 2016 the V8 project 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 <memory>
-
-#include "include/v8.h"
-#include "src/api.h"
-#include "src/ast/ast.h"
-#include "src/ast/scopes.h"
-#include "src/base/platform/semaphore.h"
-#include "src/compiler-dispatcher/compiler-dispatcher-job.h"
-#include "src/compiler-dispatcher/compiler-dispatcher-tracer.h"
-#include "src/compiler-dispatcher/unoptimized-compile-job.h"
-#include "src/flags.h"
-#include "src/isolate-inl.h"
-#include "src/parsing/parse-info.h"
-#include "src/v8.h"
-#include "test/unittests/test-helpers.h"
-#include "test/unittests/test-utils.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace v8 {
-namespace internal {
-
-class UnoptimizedCompileJobTest : public TestWithNativeContext {
- public:
-  UnoptimizedCompileJobTest() : tracer_(isolate()) {}
-  ~UnoptimizedCompileJobTest() override {}
-
-  CompilerDispatcherTracer* tracer() { return &tracer_; }
-
-  static void SetUpTestCase() {
-    CHECK_NULL(save_flags_);
-    save_flags_ = new SaveFlags();
-    TestWithNativeContext ::SetUpTestCase();
-  }
-
-  static void TearDownTestCase() {
-    TestWithNativeContext ::TearDownTestCase();
-    CHECK_NOT_NULL(save_flags_);
-    delete save_flags_;
-    save_flags_ = nullptr;
-  }
-
-  static Variable* LookupVariableByName(UnoptimizedCompileJob* job,
-                                        const char* name) {
-    const AstRawString* name_raw_string =
-        job->parse_info_->ast_value_factory()->GetOneByteString(name);
-    return job->parse_info_->literal()->scope()->Lookup(name_raw_string);
-  }
-
- private:
-  CompilerDispatcherTracer tracer_;
-  static SaveFlags* save_flags_;
-
-  DISALLOW_COPY_AND_ASSIGN(UnoptimizedCompileJobTest);
-};
-
-SaveFlags* UnoptimizedCompileJobTest::save_flags_ = nullptr;
-
-#define ASSERT_JOB_STATUS(STATUS, JOB) ASSERT_EQ(STATUS, JOB->status())
-
-TEST_F(UnoptimizedCompileJobTest, Construct) {
-  std::unique_ptr<UnoptimizedCompileJob> job(new UnoptimizedCompileJob(
-      isolate(), tracer(), test::CreateSharedFunctionInfo(isolate(), nullptr),
-      FLAG_stack_size));
-}
-
-TEST_F(UnoptimizedCompileJobTest, StateTransitions) {
-  std::unique_ptr<UnoptimizedCompileJob> job(new UnoptimizedCompileJob(
-      isolate(), tracer(), test::CreateSharedFunctionInfo(isolate(), nullptr),
-      FLAG_stack_size));
-
-  ASSERT_JOB_STATUS(CompilerDispatcherJob::Status::kInitial, job);
-  job->PrepareOnMainThread(isolate());
-  ASSERT_FALSE(job->IsFailed());
-  ASSERT_JOB_STATUS(CompilerDispatcherJob::Status::kPrepared, job);
-  job->Compile(false);
-  ASSERT_FALSE(job->IsFailed());
-  ASSERT_JOB_STATUS(CompilerDispatcherJob::Status::kCompiled, job);
-  job->FinalizeOnMainThread(isolate());
-  ASSERT_FALSE(job->IsFailed());
-  ASSERT_JOB_STATUS(CompilerDispatcherJob::Status::kDone, job);
-  job->ResetOnMainThread(isolate());
-  ASSERT_JOB_STATUS(CompilerDispatcherJob::Status::kInitial, job);
-}
-
-TEST_F(UnoptimizedCompileJobTest, SyntaxError) {
-  test::ScriptResource script("^^^", strlen("^^^"));
-  std::unique_ptr<UnoptimizedCompileJob> job(new UnoptimizedCompileJob(
-      isolate(), tracer(), test::CreateSharedFunctionInfo(isolate(), &script),
-      FLAG_stack_size));
-
-  job->PrepareOnMainThread(isolate());
-  ASSERT_FALSE(job->IsFailed());
-  job->Compile(false);
-  ASSERT_FALSE(job->IsFailed());
-  job->ReportErrorsOnMainThread(isolate());
-  ASSERT_TRUE(job->IsFailed());
-  ASSERT_JOB_STATUS(CompilerDispatcherJob::Status::kFailed, job);
-  ASSERT_TRUE(isolate()->has_pending_exception());
-
-  isolate()->clear_pending_exception();
-
-  job->ResetOnMainThread(isolate());
-  ASSERT_JOB_STATUS(CompilerDispatcherJob::Status::kInitial, job);
-}
-
-TEST_F(UnoptimizedCompileJobTest, CompileAndRun) {
-  const char script[] =
-      "function g() {\n"
-      "  f = function(a) {\n"
-      "        for (var i = 0; i < 3; i++) { a += 20; }\n"
-      "        return a;\n"
-      "      }\n"
-      "  return f;\n"
-      "}\n"
-      "g();";
-  Handle<JSFunction> f = RunJS<JSFunction>(script);
-  std::unique_ptr<UnoptimizedCompileJob> job(new UnoptimizedCompileJob(
-      isolate(), tracer(), handle(f->shared()), FLAG_stack_size));
-
-  job->PrepareOnMainThread(isolate());
-  ASSERT_FALSE(job->IsFailed());
-  job->Compile(false);
-  ASSERT_FALSE(job->IsFailed());
-  job->FinalizeOnMainThread(isolate());
-  ASSERT_FALSE(job->IsFailed());
-  ASSERT_JOB_STATUS(CompilerDispatcherJob::Status::kDone, job);
-
-  Smi* value = Smi::cast(*RunJS("f(100);"));
-  ASSERT_TRUE(value == Smi::FromInt(160));
-
-  job->ResetOnMainThread(isolate());
-  ASSERT_JOB_STATUS(CompilerDispatcherJob::Status::kInitial, job);
-}
-
-TEST_F(UnoptimizedCompileJobTest, CompileFailureToAnalyse) {
-  std::string raw_script("() { var a = ");
-  for (int i = 0; i < 500000; i++) {
-    // TODO(leszeks): Figure out a more "unit-test-y" way of forcing an analysis
-    // failure than a binop stack overflow.
-
-    // Alternate + and - to avoid n-ary operation nodes.
-    raw_script += "'x' + 'x' - ";
-  }
-  raw_script += " 'x'; }";
-  test::ScriptResource script(raw_script.c_str(), strlen(raw_script.c_str()));
-  std::unique_ptr<UnoptimizedCompileJob> job(new UnoptimizedCompileJob(
-      isolate(), tracer(), test::CreateSharedFunctionInfo(isolate(), &script),
-      100));
-
-  job->PrepareOnMainThread(isolate());
-  ASSERT_FALSE(job->IsFailed());
-  job->Compile(false);
-  ASSERT_FALSE(job->IsFailed());
-  job->ReportErrorsOnMainThread(isolate());
-  ASSERT_TRUE(job->IsFailed());
-  ASSERT_JOB_STATUS(CompilerDispatcherJob::Status::kFailed, job);
-  ASSERT_TRUE(isolate()->has_pending_exception());
-
-  isolate()->clear_pending_exception();
-  job->ResetOnMainThread(isolate());
-  ASSERT_JOB_STATUS(CompilerDispatcherJob::Status::kInitial, job);
-}
-
-TEST_F(UnoptimizedCompileJobTest, CompileFailureToFinalize) {
-  std::string raw_script("() { var a = ");
-  for (int i = 0; i < 500; i++) {
-    // Alternate + and - to avoid n-ary operation nodes.
-    raw_script += "'x' + 'x' - ";
-  }
-  raw_script += " 'x'; }";
-  test::ScriptResource script(raw_script.c_str(), strlen(raw_script.c_str()));
-  std::unique_ptr<UnoptimizedCompileJob> job(new UnoptimizedCompileJob(
-      isolate(), tracer(), test::CreateSharedFunctionInfo(isolate(), &script),
-      50));
-
-  job->PrepareOnMainThread(isolate());
-  ASSERT_FALSE(job->IsFailed());
-  job->Compile(false);
-  ASSERT_FALSE(job->IsFailed());
-  job->ReportErrorsOnMainThread(isolate());
-  ASSERT_TRUE(job->IsFailed());
-  ASSERT_JOB_STATUS(CompilerDispatcherJob::Status::kFailed, job);
-  ASSERT_TRUE(isolate()->has_pending_exception());
-
-  isolate()->clear_pending_exception();
-  job->ResetOnMainThread(isolate());
-  ASSERT_JOB_STATUS(CompilerDispatcherJob::Status::kInitial, job);
-}
-
-class CompileTask : public Task {
- public:
-  CompileTask(UnoptimizedCompileJob* job, base::Semaphore* semaphore)
-      : job_(job), semaphore_(semaphore) {}
-  ~CompileTask() override {}
-
-  void Run() override {
-    job_->Compile(true);
-    ASSERT_FALSE(job_->IsFailed());
-    semaphore_->Signal();
-  }
-
- private:
-  UnoptimizedCompileJob* job_;
-  base::Semaphore* semaphore_;
-  DISALLOW_COPY_AND_ASSIGN(CompileTask);
-};
-
-TEST_F(UnoptimizedCompileJobTest, CompileOnBackgroundThread) {
-  const char* raw_script =
-      "(a, b) {\n"
-      "  var c = a + b;\n"
-      "  function bar() { return b }\n"
-      "  var d = { foo: 100, bar : bar() }\n"
-      "  return bar;"
-      "}";
-  test::ScriptResource script(raw_script, strlen(raw_script));
-  std::unique_ptr<UnoptimizedCompileJob> job(new UnoptimizedCompileJob(
-      isolate(), tracer(), test::CreateSharedFunctionInfo(isolate(), &script),
-      100));
-
-  job->PrepareOnMainThread(isolate());
-  ASSERT_FALSE(job->IsFailed());
-
-  base::Semaphore semaphore(0);
-  CompileTask* background_task = new CompileTask(job.get(), &semaphore);
-  ASSERT_JOB_STATUS(CompilerDispatcherJob::Status::kPrepared, job);
-  V8::GetCurrentPlatform()->CallOnBackgroundThread(background_task,
-                                                   Platform::kShortRunningTask);
-  semaphore.Wait();
-  job->FinalizeOnMainThread(isolate());
-  ASSERT_FALSE(job->IsFailed());
-  ASSERT_JOB_STATUS(CompilerDispatcherJob::Status::kDone, job);
-
-  job->ResetOnMainThread(isolate());
-  ASSERT_JOB_STATUS(CompilerDispatcherJob::Status::kInitial, job);
-}
-
-TEST_F(UnoptimizedCompileJobTest, LazyInnerFunctions) {
-  const char script[] =
-      "f = function() {\n"
-      "  e = (function() { return 42; });\n"
-      "  return e;\n"
-      "};\n"
-      "f;";
-  Handle<JSFunction> f = RunJS<JSFunction>(script);
-
-  std::unique_ptr<UnoptimizedCompileJob> job(new UnoptimizedCompileJob(
-      isolate(), tracer(), handle(f->shared()), FLAG_stack_size));
-
-  job->PrepareOnMainThread(isolate());
-  ASSERT_FALSE(job->IsFailed());
-  job->Compile(false);
-  ASSERT_FALSE(job->IsFailed());
-  job->FinalizeOnMainThread(isolate());
-  ASSERT_FALSE(job->IsFailed());
-  ASSERT_JOB_STATUS(CompilerDispatcherJob::Status::kDone, job);
-
-  Handle<JSFunction> e = RunJS<JSFunction>("f();");
-
-  ASSERT_FALSE(e->shared()->is_compiled());
-
-  job->ResetOnMainThread(isolate());
-  ASSERT_JOB_STATUS(CompilerDispatcherJob::Status::kInitial, job);
-}
-
-#undef ASSERT_JOB_STATUS
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/unittests/compiler/instruction-selector-unittest.cc b/src/v8/test/unittests/compiler/instruction-selector-unittest.cc
deleted file mode 100644
index 3444e05..0000000
--- a/src/v8/test/unittests/compiler/instruction-selector-unittest.cc
+++ /dev/null
@@ -1,619 +0,0 @@
-// Copyright 2014 the V8 project 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 "test/unittests/compiler/instruction-selector-unittest.h"
-
-#include "src/code-factory.h"
-#include "src/compiler/compiler-source-position-table.h"
-#include "src/compiler/graph.h"
-#include "src/compiler/schedule.h"
-#include "src/flags.h"
-#include "src/objects-inl.h"
-#include "test/unittests/compiler/compiler-test-utils.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-
-InstructionSelectorTest::InstructionSelectorTest() : rng_(FLAG_random_seed) {}
-
-
-InstructionSelectorTest::~InstructionSelectorTest() {}
-
-
-InstructionSelectorTest::Stream InstructionSelectorTest::StreamBuilder::Build(
-    InstructionSelector::Features features,
-    InstructionSelectorTest::StreamBuilderMode mode,
-    InstructionSelector::SourcePositionMode source_position_mode) {
-  Schedule* schedule = Export();
-  if (FLAG_trace_turbo) {
-    OFStream out(stdout);
-    out << "=== Schedule before instruction selection ===" << std::endl
-        << *schedule;
-  }
-  size_t const node_count = graph()->NodeCount();
-  EXPECT_NE(0u, node_count);
-  Linkage linkage(call_descriptor());
-  InstructionBlocks* instruction_blocks =
-      InstructionSequence::InstructionBlocksFor(test_->zone(), schedule);
-  InstructionSequence sequence(test_->isolate(), test_->zone(),
-                               instruction_blocks);
-  SourcePositionTable source_position_table(graph());
-  InstructionSelector selector(test_->zone(), node_count, &linkage, &sequence,
-                               schedule, &source_position_table, nullptr,
-                               source_position_mode, features,
-                               InstructionSelector::kDisableScheduling);
-  selector.SelectInstructions();
-  if (FLAG_trace_turbo) {
-    OFStream out(stdout);
-    PrintableInstructionSequence printable = {RegisterConfiguration::Default(),
-                                              &sequence};
-    out << "=== Code sequence after instruction selection ===" << std::endl
-        << printable;
-  }
-  Stream s;
-  s.virtual_registers_ = selector.GetVirtualRegistersForTesting();
-  // Map virtual registers.
-  for (Instruction* const instr : sequence) {
-    if (instr->opcode() < 0) continue;
-    if (mode == kTargetInstructions) {
-      switch (instr->arch_opcode()) {
-#define CASE(Name) \
-  case k##Name:    \
-    break;
-        TARGET_ARCH_OPCODE_LIST(CASE)
-#undef CASE
-        default:
-          continue;
-      }
-    }
-    if (mode == kAllExceptNopInstructions && instr->arch_opcode() == kArchNop) {
-      continue;
-    }
-    for (size_t i = 0; i < instr->OutputCount(); ++i) {
-      InstructionOperand* output = instr->OutputAt(i);
-      EXPECT_NE(InstructionOperand::IMMEDIATE, output->kind());
-      if (output->IsConstant()) {
-        int vreg = ConstantOperand::cast(output)->virtual_register();
-        s.constants_.insert(std::make_pair(vreg, sequence.GetConstant(vreg)));
-      }
-    }
-    for (size_t i = 0; i < instr->InputCount(); ++i) {
-      InstructionOperand* input = instr->InputAt(i);
-      EXPECT_NE(InstructionOperand::CONSTANT, input->kind());
-      if (input->IsImmediate()) {
-        auto imm = ImmediateOperand::cast(input);
-        if (imm->type() == ImmediateOperand::INDEXED) {
-          int index = imm->indexed_value();
-          s.immediates_.insert(
-              std::make_pair(index, sequence.GetImmediate(imm)));
-        }
-      }
-    }
-    s.instructions_.push_back(instr);
-  }
-  for (auto i : s.virtual_registers_) {
-    int const virtual_register = i.second;
-    if (sequence.IsFP(virtual_register)) {
-      EXPECT_FALSE(sequence.IsReference(virtual_register));
-      s.doubles_.insert(virtual_register);
-    }
-    if (sequence.IsReference(virtual_register)) {
-      EXPECT_FALSE(sequence.IsFP(virtual_register));
-      s.references_.insert(virtual_register);
-    }
-  }
-  for (int i = 0; i < sequence.GetDeoptimizationEntryCount(); i++) {
-    s.deoptimization_entries_.push_back(
-        sequence.GetDeoptimizationEntry(i).descriptor());
-  }
-  return s;
-}
-
-
-int InstructionSelectorTest::Stream::ToVreg(const Node* node) const {
-  VirtualRegisters::const_iterator i = virtual_registers_.find(node->id());
-  CHECK(i != virtual_registers_.end());
-  return i->second;
-}
-
-
-bool InstructionSelectorTest::Stream::IsFixed(const InstructionOperand* operand,
-                                              Register reg) const {
-  if (!operand->IsUnallocated()) return false;
-  const UnallocatedOperand* unallocated = UnallocatedOperand::cast(operand);
-  if (!unallocated->HasFixedRegisterPolicy()) return false;
-  return unallocated->fixed_register_index() == reg.code();
-}
-
-
-bool InstructionSelectorTest::Stream::IsSameAsFirst(
-    const InstructionOperand* operand) const {
-  if (!operand->IsUnallocated()) return false;
-  const UnallocatedOperand* unallocated = UnallocatedOperand::cast(operand);
-  return unallocated->HasSameAsInputPolicy();
-}
-
-
-bool InstructionSelectorTest::Stream::IsUsedAtStart(
-    const InstructionOperand* operand) const {
-  if (!operand->IsUnallocated()) return false;
-  const UnallocatedOperand* unallocated = UnallocatedOperand::cast(operand);
-  return unallocated->IsUsedAtStart();
-}
-
-
-const FrameStateFunctionInfo*
-InstructionSelectorTest::StreamBuilder::GetFrameStateFunctionInfo(
-    int parameter_count, int local_count) {
-  return common()->CreateFrameStateFunctionInfo(
-      FrameStateType::kInterpretedFunction, parameter_count, local_count,
-      Handle<SharedFunctionInfo>());
-}
-
-
-// -----------------------------------------------------------------------------
-// Return.
-
-
-TARGET_TEST_F(InstructionSelectorTest, ReturnFloat32Constant) {
-  const float kValue = 4.2f;
-  StreamBuilder m(this, MachineType::Float32());
-  m.Return(m.Float32Constant(kValue));
-  Stream s = m.Build(kAllInstructions);
-  ASSERT_EQ(3U, s.size());
-  EXPECT_EQ(kArchNop, s[0]->arch_opcode());
-  ASSERT_EQ(InstructionOperand::CONSTANT, s[0]->OutputAt(0)->kind());
-  EXPECT_FLOAT_EQ(kValue, s.ToFloat32(s[0]->OutputAt(0)));
-  EXPECT_EQ(kArchRet, s[1]->arch_opcode());
-  EXPECT_EQ(2U, s[1]->InputCount());
-}
-
-
-TARGET_TEST_F(InstructionSelectorTest, ReturnParameter) {
-  StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
-  m.Return(m.Parameter(0));
-  Stream s = m.Build(kAllInstructions);
-  ASSERT_EQ(3U, s.size());
-  EXPECT_EQ(kArchNop, s[0]->arch_opcode());
-  ASSERT_EQ(1U, s[0]->OutputCount());
-  EXPECT_EQ(kArchRet, s[1]->arch_opcode());
-  EXPECT_EQ(2U, s[1]->InputCount());
-}
-
-
-TARGET_TEST_F(InstructionSelectorTest, ReturnZero) {
-  StreamBuilder m(this, MachineType::Int32());
-  m.Return(m.Int32Constant(0));
-  Stream s = m.Build(kAllInstructions);
-  ASSERT_EQ(3U, s.size());
-  EXPECT_EQ(kArchNop, s[0]->arch_opcode());
-  ASSERT_EQ(1U, s[0]->OutputCount());
-  EXPECT_EQ(InstructionOperand::CONSTANT, s[0]->OutputAt(0)->kind());
-  EXPECT_EQ(0, s.ToInt32(s[0]->OutputAt(0)));
-  EXPECT_EQ(kArchRet, s[1]->arch_opcode());
-  EXPECT_EQ(2U, s[1]->InputCount());
-}
-
-
-// -----------------------------------------------------------------------------
-// Conversions.
-
-TARGET_TEST_F(InstructionSelectorTest, TruncateFloat64ToWord32WithParameter) {
-  StreamBuilder m(this, MachineType::Int32(), MachineType::Float64());
-  m.Return(m.TruncateFloat64ToWord32(m.Parameter(0)));
-  Stream s = m.Build(kAllInstructions);
-  ASSERT_EQ(4U, s.size());
-  EXPECT_EQ(kArchNop, s[0]->arch_opcode());
-  EXPECT_EQ(kArchTruncateDoubleToI, s[1]->arch_opcode());
-  EXPECT_EQ(1U, s[1]->InputCount());
-  EXPECT_EQ(1U, s[1]->OutputCount());
-  EXPECT_EQ(kArchRet, s[2]->arch_opcode());
-}
-
-
-// -----------------------------------------------------------------------------
-// Parameters.
-
-
-TARGET_TEST_F(InstructionSelectorTest, DoubleParameter) {
-  StreamBuilder m(this, MachineType::Float64(), MachineType::Float64());
-  Node* param = m.Parameter(0);
-  m.Return(param);
-  Stream s = m.Build(kAllInstructions);
-  EXPECT_TRUE(s.IsDouble(param));
-}
-
-
-TARGET_TEST_F(InstructionSelectorTest, ReferenceParameter) {
-  StreamBuilder m(this, MachineType::AnyTagged(), MachineType::AnyTagged());
-  Node* param = m.Parameter(0);
-  m.Return(param);
-  Stream s = m.Build(kAllInstructions);
-  EXPECT_TRUE(s.IsReference(param));
-}
-
-
-// -----------------------------------------------------------------------------
-// FinishRegion.
-
-
-TARGET_TEST_F(InstructionSelectorTest, FinishRegion) {
-  StreamBuilder m(this, MachineType::AnyTagged(), MachineType::AnyTagged());
-  Node* param = m.Parameter(0);
-  Node* finish =
-      m.AddNode(m.common()->FinishRegion(), param, m.graph()->start());
-  m.Return(finish);
-  Stream s = m.Build(kAllInstructions);
-  ASSERT_EQ(3U, s.size());
-  EXPECT_EQ(kArchNop, s[0]->arch_opcode());
-  ASSERT_EQ(1U, s[0]->OutputCount());
-  ASSERT_TRUE(s[0]->Output()->IsUnallocated());
-  EXPECT_EQ(kArchRet, s[1]->arch_opcode());
-  EXPECT_EQ(s.ToVreg(param), s.ToVreg(s[0]->Output()));
-  EXPECT_EQ(s.ToVreg(param), s.ToVreg(s[1]->InputAt(1)));
-  EXPECT_TRUE(s.IsReference(finish));
-}
-
-
-// -----------------------------------------------------------------------------
-// Phi.
-
-
-typedef InstructionSelectorTestWithParam<MachineType>
-    InstructionSelectorPhiTest;
-
-
-TARGET_TEST_P(InstructionSelectorPhiTest, Doubleness) {
-  const MachineType type = GetParam();
-  StreamBuilder m(this, type, type, type);
-  Node* param0 = m.Parameter(0);
-  Node* param1 = m.Parameter(1);
-  RawMachineLabel a, b, c;
-  m.Branch(m.Int32Constant(0), &a, &b);
-  m.Bind(&a);
-  m.Goto(&c);
-  m.Bind(&b);
-  m.Goto(&c);
-  m.Bind(&c);
-  Node* phi = m.Phi(type.representation(), param0, param1);
-  m.Return(phi);
-  Stream s = m.Build(kAllInstructions);
-  EXPECT_EQ(s.IsDouble(phi), s.IsDouble(param0));
-  EXPECT_EQ(s.IsDouble(phi), s.IsDouble(param1));
-}
-
-
-TARGET_TEST_P(InstructionSelectorPhiTest, Referenceness) {
-  const MachineType type = GetParam();
-  StreamBuilder m(this, type, type, type);
-  Node* param0 = m.Parameter(0);
-  Node* param1 = m.Parameter(1);
-  RawMachineLabel a, b, c;
-  m.Branch(m.Int32Constant(1), &a, &b);
-  m.Bind(&a);
-  m.Goto(&c);
-  m.Bind(&b);
-  m.Goto(&c);
-  m.Bind(&c);
-  Node* phi = m.Phi(type.representation(), param0, param1);
-  m.Return(phi);
-  Stream s = m.Build(kAllInstructions);
-  EXPECT_EQ(s.IsReference(phi), s.IsReference(param0));
-  EXPECT_EQ(s.IsReference(phi), s.IsReference(param1));
-}
-
-
-INSTANTIATE_TEST_CASE_P(
-    InstructionSelectorTest, InstructionSelectorPhiTest,
-    ::testing::Values(MachineType::Float64(), MachineType::Int8(),
-                      MachineType::Uint8(), MachineType::Int16(),
-                      MachineType::Uint16(), MachineType::Int32(),
-                      MachineType::Uint32(), MachineType::Int64(),
-                      MachineType::Uint64(), MachineType::Pointer(),
-                      MachineType::AnyTagged()));
-
-
-// -----------------------------------------------------------------------------
-// ValueEffect.
-
-
-TARGET_TEST_F(InstructionSelectorTest, ValueEffect) {
-  StreamBuilder m1(this, MachineType::Int32(), MachineType::Pointer());
-  Node* p1 = m1.Parameter(0);
-  m1.Return(m1.Load(MachineType::Int32(), p1, m1.Int32Constant(0)));
-  Stream s1 = m1.Build(kAllInstructions);
-  StreamBuilder m2(this, MachineType::Int32(), MachineType::Pointer());
-  Node* p2 = m2.Parameter(0);
-  m2.Return(m2.AddNode(
-      m2.machine()->Load(MachineType::Int32()), p2, m2.Int32Constant(0),
-      m2.AddNode(m2.common()->BeginRegion(RegionObservability::kObservable),
-                 m2.graph()->start())));
-  Stream s2 = m2.Build(kAllInstructions);
-  EXPECT_LE(3U, s1.size());
-  ASSERT_EQ(s1.size(), s2.size());
-  TRACED_FORRANGE(size_t, i, 0, s1.size() - 1) {
-    const Instruction* i1 = s1[i];
-    const Instruction* i2 = s2[i];
-    EXPECT_EQ(i1->arch_opcode(), i2->arch_opcode());
-    EXPECT_EQ(i1->InputCount(), i2->InputCount());
-    EXPECT_EQ(i1->OutputCount(), i2->OutputCount());
-  }
-}
-
-
-// -----------------------------------------------------------------------------
-// Calls with deoptimization.
-
-
-TARGET_TEST_F(InstructionSelectorTest, CallJSFunctionWithDeopt) {
-  StreamBuilder m(this, MachineType::AnyTagged(), MachineType::AnyTagged(),
-                  MachineType::AnyTagged(), MachineType::AnyTagged());
-
-  BailoutId bailout_id(42);
-
-  Node* function_node = m.Parameter(0);
-  Node* receiver = m.Parameter(1);
-  Node* context = m.Parameter(2);
-
-  ZoneVector<MachineType> int32_type(1, MachineType::Int32(), zone());
-  ZoneVector<MachineType> empty_types(zone());
-
-  CallDescriptor* descriptor = Linkage::GetJSCallDescriptor(
-      zone(), false, 1, CallDescriptor::kNeedsFrameState);
-
-  // Build frame state for the state before the call.
-  Node* parameters = m.AddNode(
-      m.common()->TypedStateValues(&int32_type, SparseInputMask::Dense()),
-      m.Int32Constant(1));
-  Node* locals = m.AddNode(
-      m.common()->TypedStateValues(&empty_types, SparseInputMask::Dense()));
-  Node* stack = m.AddNode(
-      m.common()->TypedStateValues(&empty_types, SparseInputMask::Dense()));
-  Node* context_sentinel = m.Int32Constant(0);
-  Node* state_node = m.AddNode(
-      m.common()->FrameState(bailout_id, OutputFrameStateCombine::PokeAt(0),
-                             m.GetFrameStateFunctionInfo(1, 0)),
-      parameters, locals, stack, context_sentinel, function_node,
-      m.UndefinedConstant());
-
-  // Build the call.
-  Node* nodes[] = {function_node,      receiver, m.UndefinedConstant(),
-                   m.Int32Constant(1), context,  state_node};
-  Node* call = m.CallNWithFrameState(descriptor, arraysize(nodes), nodes);
-  m.Return(call);
-
-  Stream s = m.Build(kAllExceptNopInstructions);
-
-  // Skip until kArchCallJSFunction.
-  size_t index = 0;
-  for (; index < s.size() && s[index]->arch_opcode() != kArchCallJSFunction;
-       index++) {
-  }
-  // Now we should have two instructions: call and return.
-  ASSERT_EQ(index + 2, s.size());
-
-  EXPECT_EQ(kArchCallJSFunction, s[index++]->arch_opcode());
-  EXPECT_EQ(kArchRet, s[index++]->arch_opcode());
-
-  // TODO(jarin) Check deoptimization table.
-}
-
-
-TARGET_TEST_F(InstructionSelectorTest, CallStubWithDeopt) {
-  StreamBuilder m(this, MachineType::AnyTagged(), MachineType::AnyTagged(),
-                  MachineType::AnyTagged(), MachineType::AnyTagged());
-
-  BailoutId bailout_id_before(42);
-
-  // Some arguments for the call node.
-  Node* function_node = m.Parameter(0);
-  Node* receiver = m.Parameter(1);
-  Node* context = m.Int32Constant(1);  // Context is ignored.
-
-  ZoneVector<MachineType> int32_type(1, MachineType::Int32(), zone());
-  ZoneVector<MachineType> float64_type(1, MachineType::Float64(), zone());
-  ZoneVector<MachineType> tagged_type(1, MachineType::AnyTagged(), zone());
-
-  Callable callable = Builtins::CallableFor(isolate(), Builtins::kToObject);
-  CallDescriptor* descriptor = Linkage::GetStubCallDescriptor(
-      isolate(), zone(), callable.descriptor(), 1,
-      CallDescriptor::kNeedsFrameState, Operator::kNoProperties);
-
-  // Build frame state for the state before the call.
-  Node* parameters = m.AddNode(
-      m.common()->TypedStateValues(&int32_type, SparseInputMask::Dense()),
-      m.Int32Constant(43));
-  Node* locals = m.AddNode(
-      m.common()->TypedStateValues(&float64_type, SparseInputMask::Dense()),
-      m.Float64Constant(0.5));
-  Node* stack = m.AddNode(
-      m.common()->TypedStateValues(&tagged_type, SparseInputMask::Dense()),
-      m.UndefinedConstant());
-  Node* context_sentinel = m.Int32Constant(0);
-  Node* state_node =
-      m.AddNode(m.common()->FrameState(bailout_id_before,
-                                       OutputFrameStateCombine::PokeAt(0),
-                                       m.GetFrameStateFunctionInfo(1, 1)),
-                parameters, locals, stack, context_sentinel, function_node,
-                m.UndefinedConstant());
-
-  // Build the call.
-  Node* stub_code = m.HeapConstant(callable.code());
-  Node* nodes[] = {stub_code, function_node, receiver, context, state_node};
-  Node* call = m.CallNWithFrameState(descriptor, arraysize(nodes), nodes);
-  m.Return(call);
-
-  Stream s = m.Build(kAllExceptNopInstructions);
-
-  // Skip until kArchCallJSFunction.
-  size_t index = 0;
-  for (; index < s.size() && s[index]->arch_opcode() != kArchCallCodeObject;
-       index++) {
-  }
-  // Now we should have two instructions: call, return.
-  ASSERT_EQ(index + 2, s.size());
-
-  // Check the call instruction
-  const Instruction* call_instr = s[index++];
-  EXPECT_EQ(kArchCallCodeObject, call_instr->arch_opcode());
-  size_t num_operands =
-      1 +  // Code object.
-      1 +
-      5 +  // Frame state deopt id + one input for each value in frame state.
-      1 +  // Function.
-      1;   // Context.
-  ASSERT_EQ(num_operands, call_instr->InputCount());
-
-  // Code object.
-  EXPECT_TRUE(call_instr->InputAt(0)->IsImmediate());
-
-  // Deoptimization id.
-  int32_t deopt_id_before = s.ToInt32(call_instr->InputAt(1));
-  FrameStateDescriptor* desc_before =
-      s.GetFrameStateDescriptor(deopt_id_before);
-  EXPECT_EQ(bailout_id_before, desc_before->bailout_id());
-  EXPECT_EQ(1u, desc_before->parameters_count());
-  EXPECT_EQ(1u, desc_before->locals_count());
-  EXPECT_EQ(1u, desc_before->stack_count());
-  EXPECT_EQ(43, s.ToInt32(call_instr->InputAt(3)));
-  EXPECT_EQ(0, s.ToInt32(call_instr->InputAt(4)));  // This should be a context.
-                                                    // We inserted 0 here.
-  EXPECT_EQ(0.5, s.ToFloat64(call_instr->InputAt(5)));
-  EXPECT_TRUE(s.ToHeapObject(call_instr->InputAt(6))->IsUndefined(isolate()));
-
-  // Function.
-  EXPECT_EQ(s.ToVreg(function_node), s.ToVreg(call_instr->InputAt(7)));
-  // Context.
-  EXPECT_EQ(s.ToVreg(context), s.ToVreg(call_instr->InputAt(8)));
-
-  EXPECT_EQ(kArchRet, s[index++]->arch_opcode());
-
-  EXPECT_EQ(index, s.size());
-}
-
-
-TARGET_TEST_F(InstructionSelectorTest, CallStubWithDeoptRecursiveFrameState) {
-  StreamBuilder m(this, MachineType::AnyTagged(), MachineType::AnyTagged(),
-                  MachineType::AnyTagged(), MachineType::AnyTagged());
-
-  BailoutId bailout_id_before(42);
-  BailoutId bailout_id_parent(62);
-
-  // Some arguments for the call node.
-  Node* function_node = m.Parameter(0);
-  Node* receiver = m.Parameter(1);
-  Node* context = m.Int32Constant(66);
-  Node* context2 = m.Int32Constant(46);
-
-  ZoneVector<MachineType> int32_type(1, MachineType::Int32(), zone());
-  ZoneVector<MachineType> int32x2_type(2, MachineType::Int32(), zone());
-  ZoneVector<MachineType> float64_type(1, MachineType::Float64(), zone());
-
-  Callable callable = Builtins::CallableFor(isolate(), Builtins::kToObject);
-  CallDescriptor* descriptor = Linkage::GetStubCallDescriptor(
-      isolate(), zone(), callable.descriptor(), 1,
-      CallDescriptor::kNeedsFrameState, Operator::kNoProperties);
-
-  // Build frame state for the state before the call.
-  Node* parameters = m.AddNode(
-      m.common()->TypedStateValues(&int32_type, SparseInputMask::Dense()),
-      m.Int32Constant(63));
-  Node* locals = m.AddNode(
-      m.common()->TypedStateValues(&int32_type, SparseInputMask::Dense()),
-      m.Int32Constant(64));
-  Node* stack = m.AddNode(
-      m.common()->TypedStateValues(&int32_type, SparseInputMask::Dense()),
-      m.Int32Constant(65));
-  Node* frame_state_parent = m.AddNode(
-      m.common()->FrameState(bailout_id_parent,
-                             OutputFrameStateCombine::Ignore(),
-                             m.GetFrameStateFunctionInfo(1, 1)),
-      parameters, locals, stack, context, function_node, m.UndefinedConstant());
-
-  Node* parameters2 = m.AddNode(
-      m.common()->TypedStateValues(&int32_type, SparseInputMask::Dense()),
-      m.Int32Constant(43));
-  Node* locals2 = m.AddNode(
-      m.common()->TypedStateValues(&float64_type, SparseInputMask::Dense()),
-      m.Float64Constant(0.25));
-  Node* stack2 = m.AddNode(
-      m.common()->TypedStateValues(&int32x2_type, SparseInputMask::Dense()),
-      m.Int32Constant(44), m.Int32Constant(45));
-  Node* state_node =
-      m.AddNode(m.common()->FrameState(bailout_id_before,
-                                       OutputFrameStateCombine::PokeAt(0),
-                                       m.GetFrameStateFunctionInfo(1, 1)),
-                parameters2, locals2, stack2, context2, function_node,
-                frame_state_parent);
-
-  // Build the call.
-  Node* stub_code = m.HeapConstant(callable.code());
-  Node* nodes[] = {stub_code, function_node, receiver, context2, state_node};
-  Node* call = m.CallNWithFrameState(descriptor, arraysize(nodes), nodes);
-  m.Return(call);
-
-  Stream s = m.Build(kAllExceptNopInstructions);
-
-  // Skip until kArchCallJSFunction.
-  size_t index = 0;
-  for (; index < s.size() && s[index]->arch_opcode() != kArchCallCodeObject;
-       index++) {
-  }
-  // Now we should have three instructions: call, return.
-  EXPECT_EQ(index + 2, s.size());
-
-  // Check the call instruction
-  const Instruction* call_instr = s[index++];
-  EXPECT_EQ(kArchCallCodeObject, call_instr->arch_opcode());
-  size_t num_operands =
-      1 +  // Code object.
-      1 +  // Frame state deopt id
-      6 +  // One input for each value in frame state + context.
-      5 +  // One input for each value in the parent frame state + context.
-      1 +  // Function.
-      1;   // Context.
-  EXPECT_EQ(num_operands, call_instr->InputCount());
-  // Code object.
-  EXPECT_TRUE(call_instr->InputAt(0)->IsImmediate());
-
-  // Deoptimization id.
-  int32_t deopt_id_before = s.ToInt32(call_instr->InputAt(1));
-  FrameStateDescriptor* desc_before =
-      s.GetFrameStateDescriptor(deopt_id_before);
-  FrameStateDescriptor* desc_before_outer = desc_before->outer_state();
-  EXPECT_EQ(bailout_id_before, desc_before->bailout_id());
-  EXPECT_EQ(1u, desc_before_outer->parameters_count());
-  EXPECT_EQ(1u, desc_before_outer->locals_count());
-  EXPECT_EQ(1u, desc_before_outer->stack_count());
-  // Values from parent environment.
-  EXPECT_EQ(63, s.ToInt32(call_instr->InputAt(3)));
-  // Context:
-  EXPECT_EQ(66, s.ToInt32(call_instr->InputAt(4)));
-  EXPECT_EQ(64, s.ToInt32(call_instr->InputAt(5)));
-  EXPECT_EQ(65, s.ToInt32(call_instr->InputAt(6)));
-  // Values from the nested frame.
-  EXPECT_EQ(1u, desc_before->parameters_count());
-  EXPECT_EQ(1u, desc_before->locals_count());
-  EXPECT_EQ(2u, desc_before->stack_count());
-  EXPECT_EQ(43, s.ToInt32(call_instr->InputAt(8)));
-  EXPECT_EQ(46, s.ToInt32(call_instr->InputAt(9)));
-  EXPECT_EQ(0.25, s.ToFloat64(call_instr->InputAt(10)));
-  EXPECT_EQ(44, s.ToInt32(call_instr->InputAt(11)));
-  EXPECT_EQ(45, s.ToInt32(call_instr->InputAt(12)));
-
-  // Function.
-  EXPECT_EQ(s.ToVreg(function_node), s.ToVreg(call_instr->InputAt(13)));
-  // Context.
-  EXPECT_EQ(s.ToVreg(context2), s.ToVreg(call_instr->InputAt(14)));
-  // Continuation.
-
-  EXPECT_EQ(kArchRet, s[index++]->arch_opcode());
-  EXPECT_EQ(index, s.size());
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/unittests/compiler/instruction-selector-unittest.h b/src/v8/test/unittests/compiler/instruction-selector-unittest.h
deleted file mode 100644
index cc6a4f6..0000000
--- a/src/v8/test/unittests/compiler/instruction-selector-unittest.h
+++ /dev/null
@@ -1,301 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_UNITTESTS_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_
-#define V8_UNITTESTS_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_
-
-#include <deque>
-#include <set>
-
-#include "src/base/utils/random-number-generator.h"
-#include "src/compiler/instruction-selector.h"
-#include "src/compiler/raw-machine-assembler.h"
-#include "src/macro-assembler.h"
-#include "test/unittests/test-utils.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-class InstructionSelectorTest : public TestWithContext,
-                                public TestWithIsolateAndZone {
- public:
-  InstructionSelectorTest();
-  ~InstructionSelectorTest() override;
-
-  base::RandomNumberGenerator* rng() { return &rng_; }
-
-  class Stream;
-
-  enum StreamBuilderMode {
-    kAllInstructions,
-    kTargetInstructions,
-    kAllExceptNopInstructions
-  };
-
-  class StreamBuilder final : public RawMachineAssembler {
-   public:
-    StreamBuilder(InstructionSelectorTest* test, MachineType return_type)
-        : RawMachineAssembler(test->isolate(),
-                              new (test->zone()) Graph(test->zone()),
-                              MakeCallDescriptor(test->zone(), return_type),
-                              MachineType::PointerRepresentation(),
-                              MachineOperatorBuilder::kAllOptionalOps),
-          test_(test) {}
-    StreamBuilder(InstructionSelectorTest* test, MachineType return_type,
-                  MachineType parameter0_type)
-        : RawMachineAssembler(
-              test->isolate(), new (test->zone()) Graph(test->zone()),
-              MakeCallDescriptor(test->zone(), return_type, parameter0_type),
-              MachineType::PointerRepresentation(),
-              MachineOperatorBuilder::kAllOptionalOps,
-              InstructionSelector::AlignmentRequirements()),
-          test_(test) {}
-    StreamBuilder(InstructionSelectorTest* test, MachineType return_type,
-                  MachineType parameter0_type, MachineType parameter1_type)
-        : RawMachineAssembler(
-              test->isolate(), new (test->zone()) Graph(test->zone()),
-              MakeCallDescriptor(test->zone(), return_type, parameter0_type,
-                                 parameter1_type),
-              MachineType::PointerRepresentation(),
-              MachineOperatorBuilder::kAllOptionalOps),
-          test_(test) {}
-    StreamBuilder(InstructionSelectorTest* test, MachineType return_type,
-                  MachineType parameter0_type, MachineType parameter1_type,
-                  MachineType parameter2_type)
-        : RawMachineAssembler(
-              test->isolate(), new (test->zone()) Graph(test->zone()),
-              MakeCallDescriptor(test->zone(), return_type, parameter0_type,
-                                 parameter1_type, parameter2_type),
-              MachineType::PointerRepresentation(),
-              MachineOperatorBuilder::kAllOptionalOps),
-          test_(test) {}
-
-    Stream Build(CpuFeature feature) {
-      return Build(InstructionSelector::Features(feature));
-    }
-    Stream Build(CpuFeature feature1, CpuFeature feature2) {
-      return Build(InstructionSelector::Features(feature1, feature2));
-    }
-    Stream Build(StreamBuilderMode mode = kTargetInstructions) {
-      return Build(InstructionSelector::Features(), mode);
-    }
-    Stream Build(InstructionSelector::Features features,
-                 StreamBuilderMode mode = kTargetInstructions,
-                 InstructionSelector::SourcePositionMode source_position_mode =
-                     InstructionSelector::kAllSourcePositions);
-
-    const FrameStateFunctionInfo* GetFrameStateFunctionInfo(int parameter_count,
-                                                            int local_count);
-
-   private:
-    CallDescriptor* MakeCallDescriptor(Zone* zone, MachineType return_type) {
-      MachineSignature::Builder builder(zone, 1, 0);
-      builder.AddReturn(return_type);
-      return MakeSimpleCallDescriptor(zone, builder.Build());
-    }
-
-    CallDescriptor* MakeCallDescriptor(Zone* zone, MachineType return_type,
-                                       MachineType parameter0_type) {
-      MachineSignature::Builder builder(zone, 1, 1);
-      builder.AddReturn(return_type);
-      builder.AddParam(parameter0_type);
-      return MakeSimpleCallDescriptor(zone, builder.Build());
-    }
-
-    CallDescriptor* MakeCallDescriptor(Zone* zone, MachineType return_type,
-                                       MachineType parameter0_type,
-                                       MachineType parameter1_type) {
-      MachineSignature::Builder builder(zone, 1, 2);
-      builder.AddReturn(return_type);
-      builder.AddParam(parameter0_type);
-      builder.AddParam(parameter1_type);
-      return MakeSimpleCallDescriptor(zone, builder.Build());
-    }
-
-    CallDescriptor* MakeCallDescriptor(Zone* zone, MachineType return_type,
-                                       MachineType parameter0_type,
-                                       MachineType parameter1_type,
-                                       MachineType parameter2_type) {
-      MachineSignature::Builder builder(zone, 1, 3);
-      builder.AddReturn(return_type);
-      builder.AddParam(parameter0_type);
-      builder.AddParam(parameter1_type);
-      builder.AddParam(parameter2_type);
-      return MakeSimpleCallDescriptor(zone, builder.Build());
-    }
-
-   private:
-    InstructionSelectorTest* test_;
-
-    // Create a simple call descriptor for testing.
-    CallDescriptor* MakeSimpleCallDescriptor(Zone* zone,
-                                             MachineSignature* msig) {
-      LocationSignature::Builder locations(zone, msig->return_count(),
-                                           msig->parameter_count());
-
-      // Add return location(s).
-      const int return_count = static_cast<int>(msig->return_count());
-      for (int i = 0; i < return_count; i++) {
-        locations.AddReturn(
-            LinkageLocation::ForCallerFrameSlot(-1 - i, msig->GetReturn(i)));
-      }
-
-      // Just put all parameters on the stack.
-      const int parameter_count = static_cast<int>(msig->parameter_count());
-      for (int i = 0; i < parameter_count; i++) {
-        locations.AddParam(
-            LinkageLocation::ForCallerFrameSlot(-1 - i, msig->GetParam(i)));
-      }
-
-      const RegList kCalleeSaveRegisters = 0;
-      const RegList kCalleeSaveFPRegisters = 0;
-
-      MachineType target_type = MachineType::Pointer();
-      LinkageLocation target_loc = LinkageLocation::ForAnyRegister();
-      return new (zone) CallDescriptor(  // --
-          CallDescriptor::kCallAddress,  // kind
-          target_type,                   // target MachineType
-          target_loc,                    // target location
-          locations.Build(),             // location_sig
-          0,                             // stack_parameter_count
-          Operator::kNoProperties,       // properties
-          kCalleeSaveRegisters,          // callee-saved registers
-          kCalleeSaveFPRegisters,        // callee-saved fp regs
-          CallDescriptor::kNoFlags,      // flags
-          "iselect-test-call");
-    }
-  };
-
-  class Stream final {
-   public:
-    size_t size() const { return instructions_.size(); }
-    const Instruction* operator[](size_t index) const {
-      EXPECT_LT(index, size());
-      return instructions_[index];
-    }
-
-    bool IsDouble(const InstructionOperand* operand) const {
-      return IsDouble(ToVreg(operand));
-    }
-
-    bool IsDouble(const Node* node) const { return IsDouble(ToVreg(node)); }
-
-    bool IsInteger(const InstructionOperand* operand) const {
-      return IsInteger(ToVreg(operand));
-    }
-
-    bool IsInteger(const Node* node) const { return IsInteger(ToVreg(node)); }
-
-    bool IsReference(const InstructionOperand* operand) const {
-      return IsReference(ToVreg(operand));
-    }
-
-    bool IsReference(const Node* node) const {
-      return IsReference(ToVreg(node));
-    }
-
-    float ToFloat32(const InstructionOperand* operand) const {
-      return ToConstant(operand).ToFloat32();
-    }
-
-    double ToFloat64(const InstructionOperand* operand) const {
-      return ToConstant(operand).ToFloat64().value();
-    }
-
-    int32_t ToInt32(const InstructionOperand* operand) const {
-      return ToConstant(operand).ToInt32();
-    }
-
-    int64_t ToInt64(const InstructionOperand* operand) const {
-      return ToConstant(operand).ToInt64();
-    }
-
-    Handle<HeapObject> ToHeapObject(const InstructionOperand* operand) const {
-      return ToConstant(operand).ToHeapObject();
-    }
-
-    int ToVreg(const InstructionOperand* operand) const {
-      if (operand->IsConstant()) {
-        return ConstantOperand::cast(operand)->virtual_register();
-      }
-      EXPECT_EQ(InstructionOperand::UNALLOCATED, operand->kind());
-      return UnallocatedOperand::cast(operand)->virtual_register();
-    }
-
-    int ToVreg(const Node* node) const;
-
-    bool IsFixed(const InstructionOperand* operand, Register reg) const;
-    bool IsSameAsFirst(const InstructionOperand* operand) const;
-    bool IsUsedAtStart(const InstructionOperand* operand) const;
-
-    FrameStateDescriptor* GetFrameStateDescriptor(int deoptimization_id) {
-      EXPECT_LT(deoptimization_id, GetFrameStateDescriptorCount());
-      return deoptimization_entries_[deoptimization_id];
-    }
-
-    int GetFrameStateDescriptorCount() {
-      return static_cast<int>(deoptimization_entries_.size());
-    }
-
-   private:
-    bool IsDouble(int virtual_register) const {
-      return doubles_.find(virtual_register) != doubles_.end();
-    }
-
-    bool IsInteger(int virtual_register) const {
-      return !IsDouble(virtual_register) && !IsReference(virtual_register);
-    }
-
-    bool IsReference(int virtual_register) const {
-      return references_.find(virtual_register) != references_.end();
-    }
-
-    Constant ToConstant(const InstructionOperand* operand) const {
-      ConstantMap::const_iterator i;
-      if (operand->IsConstant()) {
-        i = constants_.find(ConstantOperand::cast(operand)->virtual_register());
-        EXPECT_EQ(ConstantOperand::cast(operand)->virtual_register(), i->first);
-        EXPECT_FALSE(constants_.end() == i);
-      } else {
-        EXPECT_EQ(InstructionOperand::IMMEDIATE, operand->kind());
-        auto imm = ImmediateOperand::cast(operand);
-        if (imm->type() == ImmediateOperand::INLINE) {
-          return Constant(imm->inline_value());
-        }
-        i = immediates_.find(imm->indexed_value());
-        EXPECT_EQ(imm->indexed_value(), i->first);
-        EXPECT_FALSE(immediates_.end() == i);
-      }
-      return i->second;
-    }
-
-    friend class StreamBuilder;
-
-    typedef std::map<int, Constant> ConstantMap;
-    typedef std::map<NodeId, int> VirtualRegisters;
-
-    ConstantMap constants_;
-    ConstantMap immediates_;
-    std::deque<Instruction*> instructions_;
-    std::set<int> doubles_;
-    std::set<int> references_;
-    VirtualRegisters virtual_registers_;
-    std::deque<FrameStateDescriptor*> deoptimization_entries_;
-  };
-
-  base::RandomNumberGenerator rng_;
-};
-
-
-template <typename T>
-class InstructionSelectorTestWithParam
-    : public InstructionSelectorTest,
-      public ::testing::WithParamInterface<T> {};
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_UNITTESTS_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_
diff --git a/src/v8/test/unittests/compiler/instruction-sequence-unittest.cc b/src/v8/test/unittests/compiler/instruction-sequence-unittest.cc
deleted file mode 100644
index 17d1572..0000000
--- a/src/v8/test/unittests/compiler/instruction-sequence-unittest.cc
+++ /dev/null
@@ -1,564 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/base/utils/random-number-generator.h"
-#include "src/compiler/pipeline.h"
-#include "test/unittests/compiler/instruction-sequence-unittest.h"
-#include "test/unittests/test-utils.h"
-#include "testing/gmock/include/gmock/gmock.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-static const char*
-    general_register_names_[RegisterConfiguration::kMaxGeneralRegisters];
-static const char*
-    double_register_names_[RegisterConfiguration::kMaxFPRegisters];
-static char register_names_[10 * (RegisterConfiguration::kMaxGeneralRegisters +
-                                  RegisterConfiguration::kMaxFPRegisters)];
-
-namespace {
-static int allocatable_codes[InstructionSequenceTest::kDefaultNRegs] = {
-    0, 1, 2, 3, 4, 5, 6, 7};
-}
-
-static void InitializeRegisterNames() {
-  char* loc = register_names_;
-  for (int i = 0; i < RegisterConfiguration::kMaxGeneralRegisters; ++i) {
-    general_register_names_[i] = loc;
-    loc += base::OS::SNPrintF(loc, 100, "gp_%d", i);
-    *loc++ = 0;
-  }
-  for (int i = 0; i < RegisterConfiguration::kMaxFPRegisters; ++i) {
-    double_register_names_[i] = loc;
-    loc += base::OS::SNPrintF(loc, 100, "fp_%d", i) + 1;
-    *loc++ = 0;
-  }
-}
-
-InstructionSequenceTest::InstructionSequenceTest()
-    : sequence_(nullptr),
-      num_general_registers_(kDefaultNRegs),
-      num_double_registers_(kDefaultNRegs),
-      instruction_blocks_(zone()),
-      current_block_(nullptr),
-      block_returns_(false) {
-  InitializeRegisterNames();
-}
-
-
-void InstructionSequenceTest::SetNumRegs(int num_general_registers,
-                                         int num_double_registers) {
-  CHECK(!config_);
-  CHECK(instructions_.empty());
-  CHECK(instruction_blocks_.empty());
-  num_general_registers_ = num_general_registers;
-  num_double_registers_ = num_double_registers;
-}
-
-int InstructionSequenceTest::GetNumRegs(MachineRepresentation rep) {
-  switch (rep) {
-    case MachineRepresentation::kFloat32:
-      return config()->num_float_registers();
-    case MachineRepresentation::kFloat64:
-      return config()->num_double_registers();
-    case MachineRepresentation::kSimd128:
-      return config()->num_simd128_registers();
-    default:
-      return config()->num_general_registers();
-  }
-}
-
-int InstructionSequenceTest::GetAllocatableCode(int index,
-                                                MachineRepresentation rep) {
-  switch (rep) {
-    case MachineRepresentation::kFloat32:
-      return config()->GetAllocatableFloatCode(index);
-    case MachineRepresentation::kFloat64:
-      return config()->GetAllocatableDoubleCode(index);
-    case MachineRepresentation::kSimd128:
-      return config()->GetAllocatableSimd128Code(index);
-    default:
-      return config()->GetAllocatableGeneralCode(index);
-  }
-}
-
-const RegisterConfiguration* InstructionSequenceTest::config() {
-  if (!config_) {
-    config_.reset(new RegisterConfiguration(
-        num_general_registers_, num_double_registers_, num_general_registers_,
-        num_double_registers_, allocatable_codes, allocatable_codes,
-        kSimpleFPAliasing ? RegisterConfiguration::OVERLAP
-                          : RegisterConfiguration::COMBINE,
-        general_register_names_,
-        double_register_names_,  // float register names
-        double_register_names_,
-        double_register_names_));  // SIMD 128 register names
-  }
-  return config_.get();
-}
-
-
-InstructionSequence* InstructionSequenceTest::sequence() {
-  if (sequence_ == nullptr) {
-    sequence_ = new (zone())
-        InstructionSequence(isolate(), zone(), &instruction_blocks_);
-    sequence_->SetRegisterConfigurationForTesting(
-        InstructionSequenceTest::config());
-  }
-  return sequence_;
-}
-
-
-void InstructionSequenceTest::StartLoop(int loop_blocks) {
-  CHECK_NULL(current_block_);
-  if (!loop_blocks_.empty()) {
-    CHECK(!loop_blocks_.back().loop_header_.IsValid());
-  }
-  LoopData loop_data = {Rpo::Invalid(), loop_blocks};
-  loop_blocks_.push_back(loop_data);
-}
-
-
-void InstructionSequenceTest::EndLoop() {
-  CHECK_NULL(current_block_);
-  CHECK(!loop_blocks_.empty());
-  CHECK_EQ(0, loop_blocks_.back().expected_blocks_);
-  loop_blocks_.pop_back();
-}
-
-
-void InstructionSequenceTest::StartBlock(bool deferred) {
-  block_returns_ = false;
-  NewBlock(deferred);
-}
-
-
-Instruction* InstructionSequenceTest::EndBlock(BlockCompletion completion) {
-  Instruction* result = nullptr;
-  if (block_returns_) {
-    CHECK(completion.type_ == kBlockEnd || completion.type_ == kFallThrough);
-    completion.type_ = kBlockEnd;
-  }
-  switch (completion.type_) {
-    case kBlockEnd:
-      break;
-    case kFallThrough:
-      result = EmitJump();
-      break;
-    case kJump:
-      CHECK(!block_returns_);
-      result = EmitJump();
-      break;
-    case kBranch:
-      CHECK(!block_returns_);
-      result = EmitBranch(completion.op_);
-      break;
-  }
-  completions_.push_back(completion);
-  CHECK_NOT_NULL(current_block_);
-  sequence()->EndBlock(current_block_->rpo_number());
-  current_block_ = nullptr;
-  return result;
-}
-
-
-InstructionSequenceTest::TestOperand InstructionSequenceTest::Imm(int32_t imm) {
-  return TestOperand(kImmediate, imm);
-}
-
-
-InstructionSequenceTest::VReg InstructionSequenceTest::Define(
-    TestOperand output_op) {
-  VReg vreg = NewReg(output_op);
-  InstructionOperand outputs[1]{ConvertOutputOp(vreg, output_op)};
-  Emit(kArchNop, 1, outputs);
-  return vreg;
-}
-
-Instruction* InstructionSequenceTest::Return(TestOperand input_op_0) {
-  block_returns_ = true;
-  InstructionOperand inputs[1]{ConvertInputOp(input_op_0)};
-  return Emit(kArchRet, 0, nullptr, 1, inputs);
-}
-
-
-PhiInstruction* InstructionSequenceTest::Phi(VReg incoming_vreg_0,
-                                             VReg incoming_vreg_1,
-                                             VReg incoming_vreg_2,
-                                             VReg incoming_vreg_3) {
-  VReg inputs[] = {incoming_vreg_0, incoming_vreg_1, incoming_vreg_2,
-                   incoming_vreg_3};
-  size_t input_count = 0;
-  for (; input_count < arraysize(inputs); ++input_count) {
-    if (inputs[input_count].value_ == kNoValue) break;
-  }
-  CHECK_LT(0, input_count);
-  auto phi = new (zone()) PhiInstruction(zone(), NewReg().value_, input_count);
-  for (size_t i = 0; i < input_count; ++i) {
-    SetInput(phi, i, inputs[i]);
-  }
-  current_block_->AddPhi(phi);
-  return phi;
-}
-
-
-PhiInstruction* InstructionSequenceTest::Phi(VReg incoming_vreg_0,
-                                             size_t input_count) {
-  auto phi = new (zone()) PhiInstruction(zone(), NewReg().value_, input_count);
-  SetInput(phi, 0, incoming_vreg_0);
-  current_block_->AddPhi(phi);
-  return phi;
-}
-
-
-void InstructionSequenceTest::SetInput(PhiInstruction* phi, size_t input,
-                                       VReg vreg) {
-  CHECK_NE(kNoValue, vreg.value_);
-  phi->SetInput(input, vreg.value_);
-}
-
-
-InstructionSequenceTest::VReg InstructionSequenceTest::DefineConstant(
-    int32_t imm) {
-  VReg vreg = NewReg();
-  sequence()->AddConstant(vreg.value_, Constant(imm));
-  InstructionOperand outputs[1]{ConstantOperand(vreg.value_)};
-  Emit(kArchNop, 1, outputs);
-  return vreg;
-}
-
-
-Instruction* InstructionSequenceTest::EmitNop() { return Emit(kArchNop); }
-
-
-static size_t CountInputs(size_t size,
-                          InstructionSequenceTest::TestOperand* inputs) {
-  size_t i = 0;
-  for (; i < size; ++i) {
-    if (inputs[i].type_ == InstructionSequenceTest::kInvalid) break;
-  }
-  return i;
-}
-
-
-Instruction* InstructionSequenceTest::EmitI(size_t input_size,
-                                            TestOperand* inputs) {
-  InstructionOperand* mapped_inputs = ConvertInputs(input_size, inputs);
-  return Emit(kArchNop, 0, nullptr, input_size, mapped_inputs);
-}
-
-
-Instruction* InstructionSequenceTest::EmitI(TestOperand input_op_0,
-                                            TestOperand input_op_1,
-                                            TestOperand input_op_2,
-                                            TestOperand input_op_3) {
-  TestOperand inputs[] = {input_op_0, input_op_1, input_op_2, input_op_3};
-  return EmitI(CountInputs(arraysize(inputs), inputs), inputs);
-}
-
-
-InstructionSequenceTest::VReg InstructionSequenceTest::EmitOI(
-    TestOperand output_op, size_t input_size, TestOperand* inputs) {
-  VReg output_vreg = NewReg(output_op);
-  InstructionOperand outputs[1]{ConvertOutputOp(output_vreg, output_op)};
-  InstructionOperand* mapped_inputs = ConvertInputs(input_size, inputs);
-  Emit(kArchNop, 1, outputs, input_size, mapped_inputs);
-  return output_vreg;
-}
-
-
-InstructionSequenceTest::VReg InstructionSequenceTest::EmitOI(
-    TestOperand output_op, TestOperand input_op_0, TestOperand input_op_1,
-    TestOperand input_op_2, TestOperand input_op_3) {
-  TestOperand inputs[] = {input_op_0, input_op_1, input_op_2, input_op_3};
-  return EmitOI(output_op, CountInputs(arraysize(inputs), inputs), inputs);
-}
-
-
-InstructionSequenceTest::VRegPair InstructionSequenceTest::EmitOOI(
-    TestOperand output_op_0, TestOperand output_op_1, size_t input_size,
-    TestOperand* inputs) {
-  VRegPair output_vregs =
-      std::make_pair(NewReg(output_op_0), NewReg(output_op_1));
-  InstructionOperand outputs[2]{
-      ConvertOutputOp(output_vregs.first, output_op_0),
-      ConvertOutputOp(output_vregs.second, output_op_1)};
-  InstructionOperand* mapped_inputs = ConvertInputs(input_size, inputs);
-  Emit(kArchNop, 2, outputs, input_size, mapped_inputs);
-  return output_vregs;
-}
-
-
-InstructionSequenceTest::VRegPair InstructionSequenceTest::EmitOOI(
-    TestOperand output_op_0, TestOperand output_op_1, TestOperand input_op_0,
-    TestOperand input_op_1, TestOperand input_op_2, TestOperand input_op_3) {
-  TestOperand inputs[] = {input_op_0, input_op_1, input_op_2, input_op_3};
-  return EmitOOI(output_op_0, output_op_1,
-                 CountInputs(arraysize(inputs), inputs), inputs);
-}
-
-
-InstructionSequenceTest::VReg InstructionSequenceTest::EmitCall(
-    TestOperand output_op, size_t input_size, TestOperand* inputs) {
-  VReg output_vreg = NewReg(output_op);
-  InstructionOperand outputs[1]{ConvertOutputOp(output_vreg, output_op)};
-  CHECK(UnallocatedOperand::cast(outputs[0]).HasFixedPolicy());
-  InstructionOperand* mapped_inputs = ConvertInputs(input_size, inputs);
-  Emit(kArchCallCodeObject, 1, outputs, input_size, mapped_inputs, 0, nullptr,
-       true);
-  return output_vreg;
-}
-
-
-InstructionSequenceTest::VReg InstructionSequenceTest::EmitCall(
-    TestOperand output_op, TestOperand input_op_0, TestOperand input_op_1,
-    TestOperand input_op_2, TestOperand input_op_3) {
-  TestOperand inputs[] = {input_op_0, input_op_1, input_op_2, input_op_3};
-  return EmitCall(output_op, CountInputs(arraysize(inputs), inputs), inputs);
-}
-
-
-Instruction* InstructionSequenceTest::EmitBranch(TestOperand input_op) {
-  InstructionOperand inputs[4]{ConvertInputOp(input_op), ConvertInputOp(Imm()),
-                               ConvertInputOp(Imm()), ConvertInputOp(Imm())};
-  InstructionCode opcode = kArchJmp | FlagsModeField::encode(kFlags_branch) |
-                           FlagsConditionField::encode(kEqual);
-  auto instruction = NewInstruction(opcode, 0, nullptr, 4, inputs);
-  return AddInstruction(instruction);
-}
-
-
-Instruction* InstructionSequenceTest::EmitFallThrough() {
-  auto instruction = NewInstruction(kArchNop, 0, nullptr);
-  return AddInstruction(instruction);
-}
-
-
-Instruction* InstructionSequenceTest::EmitJump() {
-  InstructionOperand inputs[1]{ConvertInputOp(Imm())};
-  auto instruction = NewInstruction(kArchJmp, 0, nullptr, 1, inputs);
-  return AddInstruction(instruction);
-}
-
-
-Instruction* InstructionSequenceTest::NewInstruction(
-    InstructionCode code, size_t outputs_size, InstructionOperand* outputs,
-    size_t inputs_size, InstructionOperand* inputs, size_t temps_size,
-    InstructionOperand* temps) {
-  CHECK(current_block_);
-  return Instruction::New(zone(), code, outputs_size, outputs, inputs_size,
-                          inputs, temps_size, temps);
-}
-
-
-InstructionOperand InstructionSequenceTest::Unallocated(
-    TestOperand op, UnallocatedOperand::ExtendedPolicy policy) {
-  return UnallocatedOperand(policy, op.vreg_.value_);
-}
-
-
-InstructionOperand InstructionSequenceTest::Unallocated(
-    TestOperand op, UnallocatedOperand::ExtendedPolicy policy,
-    UnallocatedOperand::Lifetime lifetime) {
-  return UnallocatedOperand(policy, lifetime, op.vreg_.value_);
-}
-
-
-InstructionOperand InstructionSequenceTest::Unallocated(
-    TestOperand op, UnallocatedOperand::ExtendedPolicy policy, int index) {
-  return UnallocatedOperand(policy, index, op.vreg_.value_);
-}
-
-
-InstructionOperand InstructionSequenceTest::Unallocated(
-    TestOperand op, UnallocatedOperand::BasicPolicy policy, int index) {
-  return UnallocatedOperand(policy, index, op.vreg_.value_);
-}
-
-
-InstructionOperand* InstructionSequenceTest::ConvertInputs(
-    size_t input_size, TestOperand* inputs) {
-  InstructionOperand* mapped_inputs =
-      zone()->NewArray<InstructionOperand>(static_cast<int>(input_size));
-  for (size_t i = 0; i < input_size; ++i) {
-    mapped_inputs[i] = ConvertInputOp(inputs[i]);
-  }
-  return mapped_inputs;
-}
-
-
-InstructionOperand InstructionSequenceTest::ConvertInputOp(TestOperand op) {
-  if (op.type_ == kImmediate) {
-    CHECK_EQ(op.vreg_.value_, kNoValue);
-    return ImmediateOperand(ImmediateOperand::INLINE, op.value_);
-  }
-  CHECK_NE(op.vreg_.value_, kNoValue);
-  switch (op.type_) {
-    case kNone:
-      return Unallocated(op, UnallocatedOperand::NONE,
-                         UnallocatedOperand::USED_AT_START);
-    case kUnique:
-      return Unallocated(op, UnallocatedOperand::NONE);
-    case kUniqueRegister:
-      return Unallocated(op, UnallocatedOperand::MUST_HAVE_REGISTER);
-    case kRegister:
-      return Unallocated(op, UnallocatedOperand::MUST_HAVE_REGISTER,
-                         UnallocatedOperand::USED_AT_START);
-    case kSlot:
-      return Unallocated(op, UnallocatedOperand::MUST_HAVE_SLOT,
-                         UnallocatedOperand::USED_AT_START);
-    case kFixedRegister: {
-      MachineRepresentation rep = GetCanonicalRep(op);
-      CHECK(0 <= op.value_ && op.value_ < GetNumRegs(rep));
-      if (DoesRegisterAllocation()) {
-        auto extended_policy = IsFloatingPoint(rep)
-                                   ? UnallocatedOperand::FIXED_FP_REGISTER
-                                   : UnallocatedOperand::FIXED_REGISTER;
-        return Unallocated(op, extended_policy, op.value_);
-      } else {
-        return AllocatedOperand(LocationOperand::REGISTER, rep, op.value_);
-      }
-    }
-    case kFixedSlot:
-      if (DoesRegisterAllocation()) {
-        return Unallocated(op, UnallocatedOperand::FIXED_SLOT, op.value_);
-      } else {
-        return AllocatedOperand(LocationOperand::STACK_SLOT,
-                                GetCanonicalRep(op), op.value_);
-      }
-    default:
-      break;
-  }
-  UNREACHABLE();
-}
-
-
-InstructionOperand InstructionSequenceTest::ConvertOutputOp(VReg vreg,
-                                                            TestOperand op) {
-  CHECK_EQ(op.vreg_.value_, kNoValue);
-  op.vreg_ = vreg;
-  switch (op.type_) {
-    case kSameAsFirst:
-      return Unallocated(op, UnallocatedOperand::SAME_AS_FIRST_INPUT);
-    case kRegister:
-      return Unallocated(op, UnallocatedOperand::MUST_HAVE_REGISTER);
-    case kFixedSlot:
-      if (DoesRegisterAllocation()) {
-        return Unallocated(op, UnallocatedOperand::FIXED_SLOT, op.value_);
-      } else {
-        return AllocatedOperand(LocationOperand::STACK_SLOT,
-                                GetCanonicalRep(op), op.value_);
-      }
-    case kFixedRegister: {
-      MachineRepresentation rep = GetCanonicalRep(op);
-      CHECK(0 <= op.value_ && op.value_ < GetNumRegs(rep));
-      if (DoesRegisterAllocation()) {
-        auto extended_policy = IsFloatingPoint(rep)
-                                   ? UnallocatedOperand::FIXED_FP_REGISTER
-                                   : UnallocatedOperand::FIXED_REGISTER;
-        return Unallocated(op, extended_policy, op.value_);
-      } else {
-        return AllocatedOperand(LocationOperand::REGISTER, rep, op.value_);
-      }
-    }
-    default:
-      break;
-  }
-  UNREACHABLE();
-}
-
-
-InstructionBlock* InstructionSequenceTest::NewBlock(bool deferred) {
-  CHECK_NULL(current_block_);
-  Rpo rpo = Rpo::FromInt(static_cast<int>(instruction_blocks_.size()));
-  Rpo loop_header = Rpo::Invalid();
-  Rpo loop_end = Rpo::Invalid();
-  if (!loop_blocks_.empty()) {
-    auto& loop_data = loop_blocks_.back();
-    // This is a loop header.
-    if (!loop_data.loop_header_.IsValid()) {
-      loop_end = Rpo::FromInt(rpo.ToInt() + loop_data.expected_blocks_);
-      loop_data.expected_blocks_--;
-      loop_data.loop_header_ = rpo;
-    } else {
-      // This is a loop body.
-      CHECK_NE(0, loop_data.expected_blocks_);
-      // TODO(dcarney): handle nested loops.
-      loop_data.expected_blocks_--;
-      loop_header = loop_data.loop_header_;
-    }
-  }
-  // Construct instruction block.
-  auto instruction_block = new (zone())
-      InstructionBlock(zone(), rpo, loop_header, loop_end, deferred, false);
-  instruction_blocks_.push_back(instruction_block);
-  current_block_ = instruction_block;
-  sequence()->StartBlock(rpo);
-  return instruction_block;
-}
-
-
-void InstructionSequenceTest::WireBlocks() {
-  CHECK(!current_block());
-  CHECK(instruction_blocks_.size() == completions_.size());
-  CHECK(loop_blocks_.empty());
-  // Wire in end block to look like a scheduler produced cfg.
-  auto end_block = NewBlock();
-  current_block_ = nullptr;
-  sequence()->EndBlock(end_block->rpo_number());
-  size_t offset = 0;
-  for (const auto& completion : completions_) {
-    switch (completion.type_) {
-      case kBlockEnd: {
-        auto block = instruction_blocks_[offset];
-        block->successors().push_back(end_block->rpo_number());
-        end_block->predecessors().push_back(block->rpo_number());
-        break;
-      }
-      case kFallThrough:  // Fallthrough.
-      case kJump:
-        WireBlock(offset, completion.offset_0_);
-        break;
-      case kBranch:
-        WireBlock(offset, completion.offset_0_);
-        WireBlock(offset, completion.offset_1_);
-        break;
-    }
-    ++offset;
-  }
-}
-
-
-void InstructionSequenceTest::WireBlock(size_t block_offset, int jump_offset) {
-  size_t target_block_offset = block_offset + static_cast<size_t>(jump_offset);
-  CHECK(block_offset < instruction_blocks_.size());
-  CHECK(target_block_offset < instruction_blocks_.size());
-  auto block = instruction_blocks_[block_offset];
-  auto target = instruction_blocks_[target_block_offset];
-  block->successors().push_back(target->rpo_number());
-  target->predecessors().push_back(block->rpo_number());
-}
-
-
-Instruction* InstructionSequenceTest::Emit(
-    InstructionCode code, size_t outputs_size, InstructionOperand* outputs,
-    size_t inputs_size, InstructionOperand* inputs, size_t temps_size,
-    InstructionOperand* temps, bool is_call) {
-  auto instruction = NewInstruction(code, outputs_size, outputs, inputs_size,
-                                    inputs, temps_size, temps);
-  if (is_call) instruction->MarkAsCall();
-  return AddInstruction(instruction);
-}
-
-
-Instruction* InstructionSequenceTest::AddInstruction(Instruction* instruction) {
-  sequence()->AddInstruction(instruction);
-  return instruction;
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/unittests/compiler/instruction-sequence-unittest.h b/src/v8/test/unittests/compiler/instruction-sequence-unittest.h
deleted file mode 100644
index 2c4df03..0000000
--- a/src/v8/test/unittests/compiler/instruction-sequence-unittest.h
+++ /dev/null
@@ -1,296 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_UNITTESTS_COMPILER_INSTRUCTION_SEQUENCE_UNITTEST_H_
-#define V8_UNITTESTS_COMPILER_INSTRUCTION_SEQUENCE_UNITTEST_H_
-
-#include <memory>
-
-#include "src/compiler/instruction.h"
-#include "test/unittests/test-utils.h"
-#include "testing/gmock/include/gmock/gmock.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-class InstructionSequenceTest : public TestWithIsolateAndZone {
- public:
-  static const int kDefaultNRegs = 8;
-  static const int kNoValue = kMinInt;
-  static const MachineRepresentation kNoRep = MachineRepresentation::kNone;
-  static const MachineRepresentation kFloat32 = MachineRepresentation::kFloat32;
-  static const MachineRepresentation kFloat64 = MachineRepresentation::kFloat64;
-  static const MachineRepresentation kSimd128 = MachineRepresentation::kSimd128;
-
-  typedef RpoNumber Rpo;
-
-  struct VReg {
-    VReg() : value_(kNoValue) {}
-    VReg(PhiInstruction* phi) : value_(phi->virtual_register()) {}  // NOLINT
-    explicit VReg(int value, MachineRepresentation rep = kNoRep)
-        : value_(value), rep_(rep) {}
-    int value_;
-    MachineRepresentation rep_ = kNoRep;
-  };
-
-  typedef std::pair<VReg, VReg> VRegPair;
-
-  enum TestOperandType {
-    kInvalid,
-    kSameAsFirst,
-    kRegister,
-    kFixedRegister,
-    kSlot,
-    kFixedSlot,
-    kExplicit,
-    kImmediate,
-    kNone,
-    kConstant,
-    kUnique,
-    kUniqueRegister
-  };
-
-  struct TestOperand {
-    TestOperand() : type_(kInvalid), vreg_(), value_(kNoValue), rep_(kNoRep) {}
-    explicit TestOperand(TestOperandType type)
-        : type_(type), vreg_(), value_(kNoValue), rep_(kNoRep) {}
-    // For tests that do register allocation.
-    TestOperand(TestOperandType type, VReg vreg, int value = kNoValue)
-        : type_(type), vreg_(vreg), value_(value), rep_(vreg.rep_) {}
-    // For immediates, constants, and tests that don't do register allocation.
-    TestOperand(TestOperandType type, int value,
-                MachineRepresentation rep = kNoRep)
-        : type_(type), vreg_(), value_(value), rep_(rep) {}
-
-    TestOperandType type_;
-    VReg vreg_;
-    int value_;
-    MachineRepresentation rep_;
-  };
-
-  static TestOperand Same() { return TestOperand(kSameAsFirst); }
-
-  static TestOperand ExplicitReg(int index) {
-    TestOperandType type = kExplicit;
-    return TestOperand(type, index);
-  }
-
-  static TestOperand ExplicitFPReg(int index,
-                                   MachineRepresentation rep = kFloat64) {
-    TestOperandType type = kExplicit;
-    return TestOperand(type, index, rep);
-  }
-
-  static TestOperand Reg(VReg vreg, int index = kNoValue) {
-    TestOperandType type = (index == kNoValue) ? kRegister : kFixedRegister;
-    return TestOperand(type, vreg, index);
-  }
-
-  static TestOperand Reg(int index = kNoValue,
-                         MachineRepresentation rep = kNoRep) {
-    return Reg(VReg(kNoValue, rep), index);
-  }
-
-  static TestOperand FPReg(int index = kNoValue,
-                           MachineRepresentation rep = kFloat64) {
-    return Reg(index, rep);
-  }
-
-  static TestOperand Slot(VReg vreg, int index = kNoValue) {
-    TestOperandType type = (index == kNoValue) ? kSlot : kFixedSlot;
-    return TestOperand(type, vreg, index);
-  }
-
-  static TestOperand Slot(int index = kNoValue,
-                          MachineRepresentation rep = kNoRep) {
-    return Slot(VReg(kNoValue, rep), index);
-  }
-
-  static TestOperand Const(int index) {
-    CHECK_NE(kNoValue, index);
-    return TestOperand(kConstant, index);
-  }
-
-  static TestOperand Use(VReg vreg) { return TestOperand(kNone, vreg); }
-
-  static TestOperand Use() { return Use(VReg()); }
-
-  static TestOperand Unique(VReg vreg) { return TestOperand(kUnique, vreg); }
-
-  static TestOperand UniqueReg(VReg vreg) {
-    return TestOperand(kUniqueRegister, vreg);
-  }
-
-  enum BlockCompletionType { kBlockEnd, kFallThrough, kBranch, kJump };
-
-  struct BlockCompletion {
-    BlockCompletionType type_;
-    TestOperand op_;
-    int offset_0_;
-    int offset_1_;
-  };
-
-  static BlockCompletion FallThrough() {
-    BlockCompletion completion = {kFallThrough, TestOperand(), 1, kNoValue};
-    return completion;
-  }
-
-  static BlockCompletion Jump(int offset) {
-    BlockCompletion completion = {kJump, TestOperand(), offset, kNoValue};
-    return completion;
-  }
-
-  static BlockCompletion Branch(TestOperand op, int left_offset,
-                                int right_offset) {
-    BlockCompletion completion = {kBranch, op, left_offset, right_offset};
-    return completion;
-  }
-
-  static BlockCompletion Last() {
-    BlockCompletion completion = {kBlockEnd, TestOperand(), kNoValue, kNoValue};
-    return completion;
-  }
-
-  InstructionSequenceTest();
-
-  void SetNumRegs(int num_general_registers, int num_double_registers);
-  int GetNumRegs(MachineRepresentation rep);
-  int GetAllocatableCode(int index, MachineRepresentation rep = kNoRep);
-  const RegisterConfiguration* config();
-  InstructionSequence* sequence();
-
-  void StartLoop(int loop_blocks);
-  void EndLoop();
-  void StartBlock(bool deferred = false);
-  Instruction* EndBlock(BlockCompletion completion = FallThrough());
-
-  TestOperand Imm(int32_t imm = 0);
-  VReg Define(TestOperand output_op);
-  VReg Parameter(TestOperand output_op = Reg()) { return Define(output_op); }
-  VReg FPParameter(MachineRepresentation rep = kFloat64) {
-    return Parameter(FPReg(kNoValue, rep));
-  }
-
-  MachineRepresentation GetCanonicalRep(TestOperand op) {
-    return IsFloatingPoint(op.rep_) ? op.rep_
-                                    : sequence()->DefaultRepresentation();
-  }
-
-  Instruction* Return(TestOperand input_op_0);
-  Instruction* Return(VReg vreg) { return Return(Reg(vreg, 0)); }
-
-  PhiInstruction* Phi(VReg incoming_vreg_0 = VReg(),
-                      VReg incoming_vreg_1 = VReg(),
-                      VReg incoming_vreg_2 = VReg(),
-                      VReg incoming_vreg_3 = VReg());
-  PhiInstruction* Phi(VReg incoming_vreg_0, size_t input_count);
-  void SetInput(PhiInstruction* phi, size_t input, VReg vreg);
-
-  VReg DefineConstant(int32_t imm = 0);
-  Instruction* EmitNop();
-  Instruction* EmitI(size_t input_size, TestOperand* inputs);
-  Instruction* EmitI(TestOperand input_op_0 = TestOperand(),
-                     TestOperand input_op_1 = TestOperand(),
-                     TestOperand input_op_2 = TestOperand(),
-                     TestOperand input_op_3 = TestOperand());
-  VReg EmitOI(TestOperand output_op, size_t input_size, TestOperand* inputs);
-  VReg EmitOI(TestOperand output_op, TestOperand input_op_0 = TestOperand(),
-              TestOperand input_op_1 = TestOperand(),
-              TestOperand input_op_2 = TestOperand(),
-              TestOperand input_op_3 = TestOperand());
-  VRegPair EmitOOI(TestOperand output_op_0, TestOperand output_op_1,
-                   size_t input_size, TestOperand* inputs);
-  VRegPair EmitOOI(TestOperand output_op_0, TestOperand output_op_1,
-                   TestOperand input_op_0 = TestOperand(),
-                   TestOperand input_op_1 = TestOperand(),
-                   TestOperand input_op_2 = TestOperand(),
-                   TestOperand input_op_3 = TestOperand());
-  VReg EmitCall(TestOperand output_op, size_t input_size, TestOperand* inputs);
-  VReg EmitCall(TestOperand output_op, TestOperand input_op_0 = TestOperand(),
-                TestOperand input_op_1 = TestOperand(),
-                TestOperand input_op_2 = TestOperand(),
-                TestOperand input_op_3 = TestOperand());
-
-  InstructionBlock* current_block() const { return current_block_; }
-
-  // Called after all instructions have been inserted.
-  void WireBlocks();
-
- private:
-  virtual bool DoesRegisterAllocation() const { return true; }
-
-  VReg NewReg(TestOperand op = TestOperand()) {
-    int vreg = sequence()->NextVirtualRegister();
-    if (IsFloatingPoint(op.rep_))
-      sequence()->MarkAsRepresentation(op.rep_, vreg);
-    return VReg(vreg, op.rep_);
-  }
-
-  static TestOperand Invalid() { return TestOperand(kInvalid); }
-
-  Instruction* EmitBranch(TestOperand input_op);
-  Instruction* EmitFallThrough();
-  Instruction* EmitJump();
-  Instruction* NewInstruction(InstructionCode code, size_t outputs_size,
-                              InstructionOperand* outputs,
-                              size_t inputs_size = 0,
-                              InstructionOperand* inputs = nullptr,
-                              size_t temps_size = 0,
-                              InstructionOperand* temps = nullptr);
-  InstructionOperand Unallocated(TestOperand op,
-                                 UnallocatedOperand::ExtendedPolicy policy);
-  InstructionOperand Unallocated(TestOperand op,
-                                 UnallocatedOperand::ExtendedPolicy policy,
-                                 UnallocatedOperand::Lifetime lifetime);
-  InstructionOperand Unallocated(TestOperand op,
-                                 UnallocatedOperand::ExtendedPolicy policy,
-                                 int index);
-  InstructionOperand Unallocated(TestOperand op,
-                                 UnallocatedOperand::BasicPolicy policy,
-                                 int index);
-  InstructionOperand* ConvertInputs(size_t input_size, TestOperand* inputs);
-  InstructionOperand ConvertInputOp(TestOperand op);
-  InstructionOperand ConvertOutputOp(VReg vreg, TestOperand op);
-  InstructionBlock* NewBlock(bool deferred = false);
-  void WireBlock(size_t block_offset, int jump_offset);
-
-  Instruction* Emit(InstructionCode code, size_t outputs_size = 0,
-                    InstructionOperand* outputs = nullptr,
-                    size_t inputs_size = 0,
-                    InstructionOperand* inputs = nullptr, size_t temps_size = 0,
-                    InstructionOperand* temps = nullptr, bool is_call = false);
-
-  Instruction* AddInstruction(Instruction* instruction);
-
-  struct LoopData {
-    Rpo loop_header_;
-    int expected_blocks_;
-  };
-
-  typedef std::vector<LoopData> LoopBlocks;
-  typedef std::map<int, const Instruction*> Instructions;
-  typedef std::vector<BlockCompletion> Completions;
-
-  std::unique_ptr<RegisterConfiguration> config_;
-  InstructionSequence* sequence_;
-  int num_general_registers_;
-  int num_double_registers_;
-
-  // Block building state.
-  InstructionBlocks instruction_blocks_;
-  Instructions instructions_;
-  Completions completions_;
-  LoopBlocks loop_blocks_;
-  InstructionBlock* current_block_;
-  bool block_returns_;
-
-  DISALLOW_COPY_AND_ASSIGN(InstructionSequenceTest);
-};
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_UNITTESTS_COMPILER_INSTRUCTION_SEQUENCE_UNITTEST_H_
diff --git a/src/v8/test/unittests/compiler/instruction-unittest.cc b/src/v8/test/unittests/compiler/instruction-unittest.cc
deleted file mode 100644
index 96add7f..0000000
--- a/src/v8/test/unittests/compiler/instruction-unittest.cc
+++ /dev/null
@@ -1,177 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/compiler/instruction.h"
-#include "src/register-configuration.h"
-#include "test/unittests/test-utils.h"
-#include "testing/gtest-support.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-namespace instruction_unittest {
-
-namespace {
-
-const MachineRepresentation kWord = MachineRepresentation::kWord32;
-const MachineRepresentation kFloat = MachineRepresentation::kFloat32;
-const MachineRepresentation kDouble = MachineRepresentation::kFloat64;
-
-bool Interfere(LocationOperand::LocationKind kind, MachineRepresentation rep1,
-               int index1, MachineRepresentation rep2, int index2) {
-  return AllocatedOperand(kind, rep1, index1)
-      .InterferesWith(AllocatedOperand(kind, rep2, index2));
-}
-
-bool Contains(const ZoneVector<MoveOperands*>* moves,
-              const InstructionOperand& to, const InstructionOperand& from) {
-  for (auto move : *moves) {
-    if (move->destination().Equals(to) && move->source().Equals(from)) {
-      return true;
-    }
-  }
-  return false;
-}
-
-}  // namespace
-
-class InstructionTest : public TestWithZone {
- public:
-  InstructionTest() {}
-  virtual ~InstructionTest() {}
-
-  ParallelMove* CreateParallelMove(
-      const std::vector<InstructionOperand>& operand_pairs) {
-    ParallelMove* parallel_move = new (zone()) ParallelMove(zone());
-    for (size_t i = 0; i < operand_pairs.size(); i += 2)
-      parallel_move->AddMove(operand_pairs[i + 1], operand_pairs[i]);
-    return parallel_move;
-  }
-};
-
-TEST_F(InstructionTest, OperandInterference) {
-  // All general registers and slots interfere only with themselves.
-  for (int i = 0; i < RegisterConfiguration::kMaxGeneralRegisters; ++i) {
-    EXPECT_TRUE(Interfere(LocationOperand::REGISTER, kWord, i, kWord, i));
-    EXPECT_TRUE(Interfere(LocationOperand::STACK_SLOT, kWord, i, kWord, i));
-    for (int j = i + 1; j < RegisterConfiguration::kMaxGeneralRegisters; ++j) {
-      EXPECT_FALSE(Interfere(LocationOperand::REGISTER, kWord, i, kWord, j));
-      EXPECT_FALSE(Interfere(LocationOperand::STACK_SLOT, kWord, i, kWord, j));
-    }
-  }
-
-  // All FP registers interfere with themselves.
-  for (int i = 0; i < RegisterConfiguration::kMaxFPRegisters; ++i) {
-    EXPECT_TRUE(Interfere(LocationOperand::REGISTER, kFloat, i, kFloat, i));
-    EXPECT_TRUE(Interfere(LocationOperand::STACK_SLOT, kFloat, i, kFloat, i));
-    EXPECT_TRUE(Interfere(LocationOperand::REGISTER, kDouble, i, kDouble, i));
-    EXPECT_TRUE(Interfere(LocationOperand::STACK_SLOT, kDouble, i, kDouble, i));
-  }
-
-  if (kSimpleFPAliasing) {
-    // Simple FP aliasing: interfering registers of different reps have the same
-    // index.
-    for (int i = 0; i < RegisterConfiguration::kMaxFPRegisters; ++i) {
-      EXPECT_TRUE(Interfere(LocationOperand::REGISTER, kFloat, i, kDouble, i));
-      EXPECT_TRUE(Interfere(LocationOperand::REGISTER, kDouble, i, kFloat, i));
-      for (int j = i + 1; j < RegisterConfiguration::kMaxFPRegisters; ++j) {
-        EXPECT_FALSE(Interfere(LocationOperand::REGISTER, kWord, i, kWord, j));
-        EXPECT_FALSE(
-            Interfere(LocationOperand::STACK_SLOT, kWord, i, kWord, j));
-      }
-    }
-  } else {
-    // Complex FP aliasing: sub-registers intefere with containing registers.
-    // Test sub-register indices which may not exist on the platform. This is
-    // necessary since the GapResolver may split large moves into smaller ones.
-    for (int i = 0; i < RegisterConfiguration::kMaxFPRegisters; ++i) {
-      EXPECT_TRUE(
-          Interfere(LocationOperand::REGISTER, kFloat, i * 2, kDouble, i));
-      EXPECT_TRUE(
-          Interfere(LocationOperand::REGISTER, kFloat, i * 2 + 1, kDouble, i));
-      EXPECT_TRUE(
-          Interfere(LocationOperand::REGISTER, kDouble, i, kFloat, i * 2));
-      EXPECT_TRUE(
-          Interfere(LocationOperand::REGISTER, kDouble, i, kFloat, i * 2 + 1));
-
-      for (int j = i + 1; j < RegisterConfiguration::kMaxFPRegisters; ++j) {
-        EXPECT_FALSE(
-            Interfere(LocationOperand::REGISTER, kFloat, i * 2, kDouble, j));
-        EXPECT_FALSE(Interfere(LocationOperand::REGISTER, kFloat, i * 2 + 1,
-                               kDouble, j));
-        EXPECT_FALSE(
-            Interfere(LocationOperand::REGISTER, kDouble, i, kFloat, j * 2));
-        EXPECT_FALSE(Interfere(LocationOperand::REGISTER, kDouble, i, kFloat,
-                               j * 2 + 1));
-      }
-    }
-  }
-}
-
-TEST_F(InstructionTest, PrepareInsertAfter) {
-  InstructionOperand r0 = AllocatedOperand(LocationOperand::REGISTER,
-                                           MachineRepresentation::kWord32, 0);
-  InstructionOperand r1 = AllocatedOperand(LocationOperand::REGISTER,
-                                           MachineRepresentation::kWord32, 1);
-  InstructionOperand r2 = AllocatedOperand(LocationOperand::REGISTER,
-                                           MachineRepresentation::kWord32, 2);
-
-  InstructionOperand d0 = AllocatedOperand(LocationOperand::REGISTER,
-                                           MachineRepresentation::kFloat64, 0);
-  InstructionOperand d1 = AllocatedOperand(LocationOperand::REGISTER,
-                                           MachineRepresentation::kFloat64, 1);
-  InstructionOperand d2 = AllocatedOperand(LocationOperand::REGISTER,
-                                           MachineRepresentation::kFloat64, 2);
-
-  {
-    // Moves inserted after should pick up assignments to their sources.
-    // Moves inserted after should cause interfering moves to be eliminated.
-    ZoneVector<MoveOperands*> to_eliminate(zone());
-    std::vector<InstructionOperand> moves = {
-        r1, r0,  // r1 <- r0
-        r2, r0,  // r2 <- r0
-        d1, d0,  // d1 <- d0
-        d2, d0   // d2 <- d0
-    };
-
-    ParallelMove* pm = CreateParallelMove(moves);
-    MoveOperands m1(r1, r2);  // r2 <- r1
-    pm->PrepareInsertAfter(&m1, &to_eliminate);
-    CHECK(m1.source().Equals(r0));
-    CHECK(Contains(&to_eliminate, r2, r0));
-    MoveOperands m2(d1, d2);  // d2 <- d1
-    pm->PrepareInsertAfter(&m2, &to_eliminate);
-    CHECK(m2.source().Equals(d0));
-    CHECK(Contains(&to_eliminate, d2, d0));
-  }
-
-  if (!kSimpleFPAliasing) {
-    // Moves inserted after should cause all interfering moves to be eliminated.
-    auto s0 = AllocatedOperand(LocationOperand::REGISTER,
-                               MachineRepresentation::kFloat32, 0);
-    auto s1 = AllocatedOperand(LocationOperand::REGISTER,
-                               MachineRepresentation::kFloat32, 1);
-    auto s2 = AllocatedOperand(LocationOperand::REGISTER,
-                               MachineRepresentation::kFloat32, 2);
-
-    {
-      ZoneVector<MoveOperands*> to_eliminate(zone());
-      std::vector<InstructionOperand> moves = {
-          s0, s2,  // s0 <- s2
-          s1, s2   // s1 <- s2
-      };
-
-      ParallelMove* pm = CreateParallelMove(moves);
-      MoveOperands m1(d1, d0);  // d0 <- d1
-      pm->PrepareInsertAfter(&m1, &to_eliminate);
-      CHECK(Contains(&to_eliminate, s0, s2));
-      CHECK(Contains(&to_eliminate, s1, s2));
-    }
-  }
-}
-
-}  // namespace instruction_unittest
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/unittests/compiler/js-builtin-reducer-unittest.cc b/src/v8/test/unittests/compiler/js-builtin-reducer-unittest.cc
deleted file mode 100644
index a0ea6f3..0000000
--- a/src/v8/test/unittests/compiler/js-builtin-reducer-unittest.cc
+++ /dev/null
@@ -1,1587 +0,0 @@
-// Copyright 2014 the V8 project 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 "src/compiler/js-builtin-reducer.h"
-#include "src/compiler/js-graph.h"
-#include "src/compiler/node-properties.h"
-#include "src/compiler/simplified-operator.h"
-#include "src/compiler/typer.h"
-#include "src/isolate-inl.h"
-#include "test/unittests/compiler/graph-unittest.h"
-#include "test/unittests/compiler/node-test-utils.h"
-#include "testing/gmock-support.h"
-
-using testing::BitEq;
-using testing::Capture;
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-class JSBuiltinReducerTest : public TypedGraphTest {
- public:
-  JSBuiltinReducerTest() : javascript_(zone()) {}
-
- protected:
-  Reduction Reduce(Node* node, MachineOperatorBuilder::Flags flags =
-                                   MachineOperatorBuilder::Flag::kNoFlags) {
-    MachineOperatorBuilder machine(zone(), MachineType::PointerRepresentation(),
-                                   flags);
-    SimplifiedOperatorBuilder simplified(zone());
-    JSGraph jsgraph(isolate(), graph(), common(), javascript(), &simplified,
-                    &machine);
-    // TODO(titzer): mock the GraphReducer here for better unit testing.
-    GraphReducer graph_reducer(zone(), graph());
-
-    JSBuiltinReducer reducer(&graph_reducer, &jsgraph, nullptr,
-                             native_context());
-    return reducer.Reduce(node);
-  }
-
-  Node* GlobalFunction(const char* name) {
-    Handle<JSFunction> f = Handle<JSFunction>::cast(
-        Object::GetProperty(
-            isolate()->global_object(),
-            isolate()->factory()->NewStringFromAsciiChecked(name))
-            .ToHandleChecked());
-    return HeapConstant(f);
-  }
-
-  Node* MathFunction(const char* name) {
-    Handle<Object> m =
-        JSObject::GetProperty(isolate()->global_object(),
-                              isolate()->factory()->NewStringFromAsciiChecked(
-                                  "Math")).ToHandleChecked();
-    Handle<JSFunction> f = Handle<JSFunction>::cast(
-        Object::GetProperty(
-            m, isolate()->factory()->NewStringFromAsciiChecked(name))
-            .ToHandleChecked());
-    return HeapConstant(f);
-  }
-
-  Node* NumberFunction(const char* name) {
-    Handle<Object> m =
-        JSObject::GetProperty(
-            isolate()->global_object(),
-            isolate()->factory()->NewStringFromAsciiChecked("Number"))
-            .ToHandleChecked();
-    Handle<JSFunction> f = Handle<JSFunction>::cast(
-        Object::GetProperty(
-            m, isolate()->factory()->NewStringFromAsciiChecked(name))
-            .ToHandleChecked());
-    return HeapConstant(f);
-  }
-
-  Node* StringFunction(const char* name) {
-    Handle<Object> m =
-        JSObject::GetProperty(
-            isolate()->global_object(),
-            isolate()->factory()->NewStringFromAsciiChecked("String"))
-            .ToHandleChecked();
-    Handle<JSFunction> f = Handle<JSFunction>::cast(
-        Object::GetProperty(
-            m, isolate()->factory()->NewStringFromAsciiChecked(name))
-            .ToHandleChecked());
-    return HeapConstant(f);
-  }
-
-  JSOperatorBuilder* javascript() { return &javascript_; }
-
- private:
-  JSOperatorBuilder javascript_;
-};
-
-
-namespace {
-
-Type* const kIntegral32Types[] = {Type::UnsignedSmall(), Type::Negative32(),
-                                  Type::Unsigned31(),    Type::SignedSmall(),
-                                  Type::Signed32(),      Type::Unsigned32(),
-                                  Type::Integral32()};
-
-
-Type* const kNumberTypes[] = {
-    Type::UnsignedSmall(), Type::Negative32(),  Type::Unsigned31(),
-    Type::SignedSmall(),   Type::Signed32(),    Type::Unsigned32(),
-    Type::Integral32(),    Type::MinusZero(),   Type::NaN(),
-    Type::OrderedNumber(), Type::PlainNumber(), Type::Number()};
-
-}  // namespace
-
-
-// -----------------------------------------------------------------------------
-// isFinite
-
-TEST_F(JSBuiltinReducerTest, GlobalIsFiniteWithNumber) {
-  Node* function = GlobalFunction("isFinite");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsNumberEqual(IsNumberSubtract(p0, p0),
-                                               IsNumberSubtract(p0, p0)));
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, GlobalIsFiniteWithPlainPrimitive) {
-  Node* function = GlobalFunction("isFinite");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(),
-              IsNumberEqual(IsNumberSubtract(IsPlainPrimitiveToNumber(p0),
-                                             IsPlainPrimitiveToNumber(p0)),
-                            IsNumberSubtract(IsPlainPrimitiveToNumber(p0),
-                                             IsPlainPrimitiveToNumber(p0))));
-}
-
-// -----------------------------------------------------------------------------
-// isNaN
-
-TEST_F(JSBuiltinReducerTest, GlobalIsNaNWithNumber) {
-  Node* function = GlobalFunction("isNaN");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsBooleanNot(IsNumberEqual(p0, p0)));
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, GlobalIsNaNWithPlainPrimitive) {
-  Node* function = GlobalFunction("isNaN");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(),
-              IsBooleanNot(IsNumberEqual(IsPlainPrimitiveToNumber(p0),
-                                         IsPlainPrimitiveToNumber(p0))));
-}
-
-// -----------------------------------------------------------------------------
-// Math.abs
-
-TEST_F(JSBuiltinReducerTest, MathAbsWithNumber) {
-  Node* function = MathFunction("abs");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsNumberAbs(p0));
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathAbsWithPlainPrimitive) {
-  Node* function = MathFunction("abs");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberAbs(IsPlainPrimitiveToNumber(p0)));
-}
-
-// -----------------------------------------------------------------------------
-// Math.acos
-
-TEST_F(JSBuiltinReducerTest, MathAcosWithNumber) {
-  Node* function = MathFunction("acos");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsNumberAcos(p0));
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathAcosWithPlainPrimitive) {
-  Node* function = MathFunction("acos");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberAcos(IsPlainPrimitiveToNumber(p0)));
-}
-
-// -----------------------------------------------------------------------------
-// Math.acosh
-
-TEST_F(JSBuiltinReducerTest, MathAcoshWithNumber) {
-  Node* function = MathFunction("acosh");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsNumberAcosh(p0));
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathAcoshWithPlainPrimitive) {
-  Node* function = MathFunction("acosh");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberAcosh(IsPlainPrimitiveToNumber(p0)));
-}
-
-// -----------------------------------------------------------------------------
-// Math.asin
-
-TEST_F(JSBuiltinReducerTest, MathAsinWithNumber) {
-  Node* function = MathFunction("asin");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsNumberAsin(p0));
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathAsinWithPlainPrimitive) {
-  Node* function = MathFunction("asin");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberAsin(IsPlainPrimitiveToNumber(p0)));
-}
-
-// -----------------------------------------------------------------------------
-// Math.asinh
-
-TEST_F(JSBuiltinReducerTest, MathAsinhWithNumber) {
-  Node* function = MathFunction("asinh");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsNumberAsinh(p0));
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathAsinhWithPlainPrimitive) {
-  Node* function = MathFunction("asinh");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberAsinh(IsPlainPrimitiveToNumber(p0)));
-}
-
-// -----------------------------------------------------------------------------
-// Math.atan
-
-TEST_F(JSBuiltinReducerTest, MathAtanWithNumber) {
-  Node* function = MathFunction("atan");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsNumberAtan(p0));
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathAtanWithPlainPrimitive) {
-  Node* function = MathFunction("atan");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberAtan(IsPlainPrimitiveToNumber(p0)));
-}
-
-// -----------------------------------------------------------------------------
-// Math.atanh
-
-TEST_F(JSBuiltinReducerTest, MathAtanhWithNumber) {
-  Node* function = MathFunction("atanh");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsNumberAtanh(p0));
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathAtanhWithPlainPrimitive) {
-  Node* function = MathFunction("atanh");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberAtanh(IsPlainPrimitiveToNumber(p0)));
-}
-
-// -----------------------------------------------------------------------------
-// Math.atan2
-
-TEST_F(JSBuiltinReducerTest, MathAtan2WithNumber) {
-  Node* function = MathFunction("atan2");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    TRACED_FOREACH(Type*, t1, kNumberTypes) {
-      Node* p1 = Parameter(t1, 0);
-      Node* call =
-          graph()->NewNode(javascript()->Call(4), function, UndefinedConstant(),
-                           p0, p1, context, frame_state, effect, control);
-      Reduction r = Reduce(call);
-
-      ASSERT_TRUE(r.Changed());
-      EXPECT_THAT(r.replacement(), IsNumberAtan2(p0, p1));
-    }
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathAtan2WithPlainPrimitive) {
-  Node* function = MathFunction("atan2");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* p1 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(4), function, UndefinedConstant(), p0,
-                       p1, context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberAtan2(IsPlainPrimitiveToNumber(p0),
-                                             IsPlainPrimitiveToNumber(p1)));
-}
-
-// -----------------------------------------------------------------------------
-// Math.ceil
-
-TEST_F(JSBuiltinReducerTest, MathCeilWithNumber) {
-  Node* function = MathFunction("ceil");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsNumberCeil(p0));
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathCeilWithPlainPrimitive) {
-  Node* function = MathFunction("ceil");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberCeil(IsPlainPrimitiveToNumber(p0)));
-}
-
-// -----------------------------------------------------------------------------
-// Math.clz32
-
-TEST_F(JSBuiltinReducerTest, MathClz32WithUnsigned32) {
-  Node* function = MathFunction("clz32");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::Unsigned32(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberClz32(p0));
-}
-
-TEST_F(JSBuiltinReducerTest, MathClz32WithNumber) {
-  Node* function = MathFunction("clz32");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::Number(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberClz32(IsNumberToUint32(p0)));
-}
-
-TEST_F(JSBuiltinReducerTest, MathClz32WithPlainPrimitive) {
-  Node* function = MathFunction("clz32");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(),
-              IsNumberClz32(IsNumberToUint32(IsPlainPrimitiveToNumber(p0))));
-}
-
-// -----------------------------------------------------------------------------
-// Math.cos
-
-TEST_F(JSBuiltinReducerTest, MathCosWithNumber) {
-  Node* function = MathFunction("cos");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsNumberCos(p0));
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathCosWithPlainPrimitive) {
-  Node* function = MathFunction("cos");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberCos(IsPlainPrimitiveToNumber(p0)));
-}
-
-// -----------------------------------------------------------------------------
-// Math.cosh
-
-TEST_F(JSBuiltinReducerTest, MathCoshWithNumber) {
-  Node* function = MathFunction("cosh");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsNumberCosh(p0));
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathCoshWithPlainPrimitive) {
-  Node* function = MathFunction("cosh");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberCosh(IsPlainPrimitiveToNumber(p0)));
-}
-
-// -----------------------------------------------------------------------------
-// Math.exp
-
-TEST_F(JSBuiltinReducerTest, MathExpWithNumber) {
-  Node* function = MathFunction("exp");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsNumberExp(p0));
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathExpWithPlainPrimitive) {
-  Node* function = MathFunction("exp");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberExp(IsPlainPrimitiveToNumber(p0)));
-}
-
-// -----------------------------------------------------------------------------
-// Math.floor
-
-TEST_F(JSBuiltinReducerTest, MathFloorWithNumber) {
-  Node* function = MathFunction("floor");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsNumberFloor(p0));
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathFloorWithPlainPrimitive) {
-  Node* function = MathFunction("floor");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberFloor(IsPlainPrimitiveToNumber(p0)));
-}
-
-// -----------------------------------------------------------------------------
-// Math.fround
-
-TEST_F(JSBuiltinReducerTest, MathFroundWithNumber) {
-  Node* function = MathFunction("fround");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsNumberFround(p0));
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathFroundWithPlainPrimitive) {
-  Node* function = MathFunction("fround");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberFround(IsPlainPrimitiveToNumber(p0)));
-}
-
-// -----------------------------------------------------------------------------
-// Math.imul
-
-TEST_F(JSBuiltinReducerTest, MathImulWithUnsigned32) {
-  Node* function = MathFunction("imul");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::Unsigned32(), 0);
-  Node* p1 = Parameter(Type::Unsigned32(), 1);
-  Node* call =
-      graph()->NewNode(javascript()->Call(4), function, UndefinedConstant(), p0,
-                       p1, context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberImul(p0, p1));
-}
-
-TEST_F(JSBuiltinReducerTest, MathImulWithNumber) {
-  Node* function = MathFunction("imul");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::Number(), 0);
-  Node* p1 = Parameter(Type::Number(), 1);
-  Node* call =
-      graph()->NewNode(javascript()->Call(4), function, UndefinedConstant(), p0,
-                       p1, context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(),
-              IsNumberImul(IsNumberToUint32(p0), IsNumberToUint32(p1)));
-}
-
-TEST_F(JSBuiltinReducerTest, MathImulWithPlainPrimitive) {
-  Node* function = MathFunction("imul");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* p1 = Parameter(Type::PlainPrimitive(), 1);
-  Node* call =
-      graph()->NewNode(javascript()->Call(4), function, UndefinedConstant(), p0,
-                       p1, context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(),
-              IsNumberImul(IsNumberToUint32(IsPlainPrimitiveToNumber(p0)),
-                           IsNumberToUint32(IsPlainPrimitiveToNumber(p1))));
-}
-
-// -----------------------------------------------------------------------------
-// Math.log
-
-TEST_F(JSBuiltinReducerTest, MathLogWithNumber) {
-  Node* function = MathFunction("log");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsNumberLog(p0));
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathLogWithPlainPrimitive) {
-  Node* function = MathFunction("log");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberLog(IsPlainPrimitiveToNumber(p0)));
-}
-
-// -----------------------------------------------------------------------------
-// Math.log1p
-
-TEST_F(JSBuiltinReducerTest, MathLog1pWithNumber) {
-  Node* function = MathFunction("log1p");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsNumberLog1p(p0));
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathLog1pWithPlainPrimitive) {
-  Node* function = MathFunction("log1p");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberLog1p(IsPlainPrimitiveToNumber(p0)));
-}
-
-// -----------------------------------------------------------------------------
-// Math.max
-
-TEST_F(JSBuiltinReducerTest, MathMaxWithNoArguments) {
-  Node* function = MathFunction("max");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* call =
-      graph()->NewNode(javascript()->Call(2), function, UndefinedConstant(),
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberConstant(-V8_INFINITY));
-}
-
-TEST_F(JSBuiltinReducerTest, MathMaxWithNumber) {
-  Node* function = MathFunction("max");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), p0);
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathMaxWithPlainPrimitive) {
-  Node* function = MathFunction("max");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* p1 = Parameter(Type::PlainPrimitive(), 1);
-  Node* call =
-      graph()->NewNode(javascript()->Call(4), function, UndefinedConstant(), p0,
-                       p1, context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberMax(IsPlainPrimitiveToNumber(p0),
-                                           IsPlainPrimitiveToNumber(p1)));
-}
-
-// -----------------------------------------------------------------------------
-// Math.min
-
-TEST_F(JSBuiltinReducerTest, MathMinWithNoArguments) {
-  Node* function = MathFunction("min");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* call =
-      graph()->NewNode(javascript()->Call(2), function, UndefinedConstant(),
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberConstant(V8_INFINITY));
-}
-
-TEST_F(JSBuiltinReducerTest, MathMinWithNumber) {
-  Node* function = MathFunction("min");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), p0);
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathMinWithPlainPrimitive) {
-  Node* function = MathFunction("min");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* p1 = Parameter(Type::PlainPrimitive(), 1);
-  Node* call =
-      graph()->NewNode(javascript()->Call(4), function, UndefinedConstant(), p0,
-                       p1, context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberMin(IsPlainPrimitiveToNumber(p0),
-                                           IsPlainPrimitiveToNumber(p1)));
-}
-
-// -----------------------------------------------------------------------------
-// Math.round
-
-TEST_F(JSBuiltinReducerTest, MathRoundWithNumber) {
-  Node* function = MathFunction("round");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsNumberRound(p0));
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathRoundWithPlainPrimitive) {
-  Node* function = MathFunction("round");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberRound(IsPlainPrimitiveToNumber(p0)));
-}
-
-// -----------------------------------------------------------------------------
-// Math.pow
-
-TEST_F(JSBuiltinReducerTest, MathPowWithNumber) {
-  Node* function = MathFunction("pow");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    TRACED_FOREACH(Type*, t1, kNumberTypes) {
-      Node* p1 = Parameter(t1, 0);
-      Node* call =
-          graph()->NewNode(javascript()->Call(4), function, UndefinedConstant(),
-                           p0, p1, context, frame_state, effect, control);
-      Reduction r = Reduce(call);
-
-      ASSERT_TRUE(r.Changed());
-      EXPECT_THAT(r.replacement(), IsNumberPow(p0, p1));
-    }
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathPowWithPlainPrimitive) {
-  Node* function = MathFunction("pow");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* p1 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(4), function, UndefinedConstant(), p0,
-                       p1, context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberPow(IsPlainPrimitiveToNumber(p0),
-                                           IsPlainPrimitiveToNumber(p1)));
-}
-
-// -----------------------------------------------------------------------------
-// Math.sign
-
-TEST_F(JSBuiltinReducerTest, MathSignWithNumber) {
-  Node* function = MathFunction("sign");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsNumberSign(p0));
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathSignWithPlainPrimitive) {
-  Node* function = MathFunction("sign");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberSign(IsPlainPrimitiveToNumber(p0)));
-}
-
-// -----------------------------------------------------------------------------
-// Math.sin
-
-TEST_F(JSBuiltinReducerTest, MathSinWithNumber) {
-  Node* function = MathFunction("sin");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsNumberSin(p0));
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathSinWithPlainPrimitive) {
-  Node* function = MathFunction("sin");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberSin(IsPlainPrimitiveToNumber(p0)));
-}
-
-// -----------------------------------------------------------------------------
-// Math.sinh
-
-TEST_F(JSBuiltinReducerTest, MathSinhWithNumber) {
-  Node* function = MathFunction("sinh");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsNumberSinh(p0));
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathSinhWithPlainPrimitive) {
-  Node* function = MathFunction("sinh");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberSinh(IsPlainPrimitiveToNumber(p0)));
-}
-
-// -----------------------------------------------------------------------------
-// Math.sqrt
-
-TEST_F(JSBuiltinReducerTest, MathSqrtWithNumber) {
-  Node* function = MathFunction("sqrt");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsNumberSqrt(p0));
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathSqrtWithPlainPrimitive) {
-  Node* function = MathFunction("sqrt");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberSqrt(IsPlainPrimitiveToNumber(p0)));
-}
-
-// -----------------------------------------------------------------------------
-// Math.tan
-
-TEST_F(JSBuiltinReducerTest, MathTanWithNumber) {
-  Node* function = MathFunction("tan");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsNumberTan(p0));
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathTanWithPlainPrimitive) {
-  Node* function = MathFunction("tan");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberTan(IsPlainPrimitiveToNumber(p0)));
-}
-
-// -----------------------------------------------------------------------------
-// Math.tanh
-
-TEST_F(JSBuiltinReducerTest, MathTanhWithNumber) {
-  Node* function = MathFunction("tanh");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsNumberTanh(p0));
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathTanhWithPlainPrimitive) {
-  Node* function = MathFunction("tanh");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberTanh(IsPlainPrimitiveToNumber(p0)));
-}
-
-// -----------------------------------------------------------------------------
-// Math.trunc
-
-TEST_F(JSBuiltinReducerTest, MathTruncWithNumber) {
-  Node* function = MathFunction("trunc");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsNumberTrunc(p0));
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, MathTruncWithPlainPrimitive) {
-  Node* function = MathFunction("trunc");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(), IsNumberTrunc(IsPlainPrimitiveToNumber(p0)));
-}
-
-// -----------------------------------------------------------------------------
-// Number.isFinite
-
-TEST_F(JSBuiltinReducerTest, NumberIsFiniteWithNumber) {
-  Node* function = NumberFunction("isFinite");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsNumberEqual(IsNumberSubtract(p0, p0),
-                                               IsNumberSubtract(p0, p0)));
-  }
-}
-
-// -----------------------------------------------------------------------------
-// Number.isInteger
-
-TEST_F(JSBuiltinReducerTest, NumberIsIntegerWithNumber) {
-  Node* function = NumberFunction("isInteger");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(),
-                IsNumberEqual(IsNumberSubtract(p0, IsNumberTrunc(p0)),
-                              IsNumberConstant(0.0)));
-  }
-}
-
-// -----------------------------------------------------------------------------
-// Number.isNaN
-
-TEST_F(JSBuiltinReducerTest, NumberIsNaNWithNumber) {
-  Node* function = NumberFunction("isNaN");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsObjectIsNaN(p0));
-  }
-}
-
-// -----------------------------------------------------------------------------
-// Number.isSafeInteger
-
-TEST_F(JSBuiltinReducerTest, NumberIsSafeIntegerWithIntegral32) {
-  Node* function = NumberFunction("isSafeInteger");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kIntegral32Types) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsTrueConstant());
-  }
-}
-
-// -----------------------------------------------------------------------------
-// Number.parseInt
-
-TEST_F(JSBuiltinReducerTest, NumberParseIntWithIntegral32) {
-  Node* function = NumberFunction("parseInt");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kIntegral32Types) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_EQ(p0, r.replacement());
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, NumberParseIntWithIntegral32AndUndefined) {
-  Node* function = NumberFunction("parseInt");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kIntegral32Types) {
-    Node* p0 = Parameter(t0, 0);
-    Node* p1 = Parameter(Type::Undefined(), 1);
-    Node* call =
-        graph()->NewNode(javascript()->Call(4), function, UndefinedConstant(),
-                         p0, p1, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_EQ(p0, r.replacement());
-  }
-}
-
-// -----------------------------------------------------------------------------
-// String.fromCharCode
-
-TEST_F(JSBuiltinReducerTest, StringFromCharCodeWithNumber) {
-  Node* function = StringFunction("fromCharCode");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  TRACED_FOREACH(Type*, t0, kNumberTypes) {
-    Node* p0 = Parameter(t0, 0);
-    Node* call =
-        graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
-                         p0, context, frame_state, effect, control);
-    Reduction r = Reduce(call);
-
-    ASSERT_TRUE(r.Changed());
-    EXPECT_THAT(r.replacement(), IsStringFromCharCode(p0));
-  }
-}
-
-TEST_F(JSBuiltinReducerTest, StringFromCharCodeWithPlainPrimitive) {
-  Node* function = StringFunction("fromCharCode");
-
-  Node* effect = graph()->start();
-  Node* control = graph()->start();
-  Node* context = UndefinedConstant();
-  Node* frame_state = graph()->start();
-  Node* p0 = Parameter(Type::PlainPrimitive(), 0);
-  Node* call =
-      graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), p0,
-                       context, frame_state, effect, control);
-  Reduction r = Reduce(call);
-
-  ASSERT_TRUE(r.Changed());
-  EXPECT_THAT(r.replacement(),
-              IsStringFromCharCode(IsPlainPrimitiveToNumber(p0)));
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/unittests/compiler/live-range-builder.h b/src/v8/test/unittests/compiler/live-range-builder.h
deleted file mode 100644
index 4a5621f..0000000
--- a/src/v8/test/unittests/compiler/live-range-builder.h
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_LIVE_RANGE_BUILDER_H_
-#define V8_LIVE_RANGE_BUILDER_H_
-
-#include "src/compiler/register-allocator.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-
-// Utility offering shorthand syntax for building up a range by providing its ID
-// and pairs (start, end) specifying intervals. Circumvents current incomplete
-// support for C++ features such as instantiation lists, on OS X and Android.
-class TestRangeBuilder {
- public:
-  explicit TestRangeBuilder(Zone* zone)
-      : id_(-1), pairs_(), uses_(), zone_(zone) {}
-
-  TestRangeBuilder& Id(int id) {
-    id_ = id;
-    return *this;
-  }
-  TestRangeBuilder& Add(int start, int end) {
-    pairs_.push_back({start, end});
-    return *this;
-  }
-
-  TestRangeBuilder& AddUse(int pos) {
-    uses_.insert(pos);
-    return *this;
-  }
-
-  TopLevelLiveRange* Build(int start, int end) {
-    return Add(start, end).Build();
-  }
-
-  TopLevelLiveRange* Build() {
-    TopLevelLiveRange* range =
-        new (zone_) TopLevelLiveRange(id_, MachineRepresentation::kTagged);
-    // Traverse the provided interval specifications backwards, because that is
-    // what LiveRange expects.
-    for (int i = static_cast<int>(pairs_.size()) - 1; i >= 0; --i) {
-      Interval pair = pairs_[i];
-      LifetimePosition start = LifetimePosition::FromInt(pair.first);
-      LifetimePosition end = LifetimePosition::FromInt(pair.second);
-      CHECK(start < end);
-      range->AddUseInterval(start, end, zone_);
-    }
-    for (int pos : uses_) {
-      UsePosition* use_position =
-          new (zone_) UsePosition(LifetimePosition::FromInt(pos), nullptr,
-                                  nullptr, UsePositionHintType::kNone);
-      range->AddUsePosition(use_position);
-    }
-
-    pairs_.clear();
-    return range;
-  }
-
- private:
-  typedef std::pair<int, int> Interval;
-  typedef std::vector<Interval> IntervalList;
-  int id_;
-  IntervalList pairs_;
-  std::set<int> uses_;
-  Zone* zone_;
-};
-
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_LIVE_RANGE_BUILDER_H_
diff --git a/src/v8/test/unittests/counters-unittest.cc b/src/v8/test/unittests/counters-unittest.cc
deleted file mode 100644
index 887ba54..0000000
--- a/src/v8/test/unittests/counters-unittest.cc
+++ /dev/null
@@ -1,684 +0,0 @@
-// Copyright 2014 the V8 project 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 <vector>
-
-#include "src/base/atomic-utils.h"
-#include "src/base/platform/time.h"
-#include "src/counters-inl.h"
-#include "src/counters.h"
-#include "src/handles-inl.h"
-#include "src/objects-inl.h"
-#include "src/tracing/tracing-category-observer.h"
-
-#include "test/unittests/test-utils.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace v8 {
-namespace internal {
-
-namespace {
-
-class MockHistogram : public Histogram {
- public:
-  void AddSample(int value) { samples_.push_back(value); }
-  std::vector<int>* samples() { return &samples_; }
-
- private:
-  std::vector<int> samples_;
-};
-
-
-class AggregatedMemoryHistogramTest : public ::testing::Test {
- public:
-  AggregatedMemoryHistogramTest() : aggregated_(&mock_) {}
-  virtual ~AggregatedMemoryHistogramTest() {}
-
-  void AddSample(double current_ms, double current_value) {
-    aggregated_.AddSample(current_ms, current_value);
-  }
-
-  std::vector<int>* samples() { return mock_.samples(); }
-
- private:
-  AggregatedMemoryHistogram<MockHistogram> aggregated_;
-  MockHistogram mock_;
-};
-
-static base::TimeTicks runtime_call_stats_test_time_ = base::TimeTicks();
-// Time source used for the RuntimeCallTimer during tests. We cannot rely on
-// the native timer since it's too unpredictable on the build bots.
-static base::TimeTicks RuntimeCallStatsTestNow() {
-  return runtime_call_stats_test_time_;
-}
-
-class RuntimeCallStatsTest : public TestWithNativeContext {
- public:
-  RuntimeCallStatsTest() {
-    base::AsAtomic32::Relaxed_Store(
-        &FLAG_runtime_stats,
-        v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE);
-    // We need to set {time_} to a non-zero value since it would otherwise
-    // cause runtime call timers to think they are uninitialized.
-    Sleep(1);
-    stats()->Reset();
-  }
-
-  ~RuntimeCallStatsTest() {
-    // Disable RuntimeCallStats before tearing down the isolate to prevent
-    // printing the tests table. Comment the following line for debugging
-    // purposes.
-    base::AsAtomic32::Relaxed_Store(&FLAG_runtime_stats, 0);
-  }
-
-  static void SetUpTestCase() {
-    TestWithIsolate::SetUpTestCase();
-    // Use a custom time source to precisly emulate system time.
-    RuntimeCallTimer::Now = &RuntimeCallStatsTestNow;
-  }
-
-  static void TearDownTestCase() {
-    TestWithIsolate::TearDownTestCase();
-    // Restore the original time source.
-    RuntimeCallTimer::Now = &base::TimeTicks::HighResolutionNow;
-  }
-
-  RuntimeCallStats* stats() {
-    return isolate()->counters()->runtime_call_stats();
-  }
-
-  // Print current RuntimeCallStats table. For debugging purposes.
-  void PrintStats() { stats()->Print(); }
-
-  RuntimeCallCounterId counter_id() {
-    return RuntimeCallCounterId::kTestCounter1;
-  }
-
-  RuntimeCallCounterId counter_id2() {
-    return RuntimeCallCounterId::kTestCounter2;
-  }
-
-  RuntimeCallCounterId counter_id3() {
-    return RuntimeCallCounterId::kTestCounter3;
-  }
-
-  RuntimeCallCounter* js_counter() {
-    return stats()->GetCounter(RuntimeCallCounterId::kJS_Execution);
-  }
-  RuntimeCallCounter* counter() { return stats()->GetCounter(counter_id()); }
-  RuntimeCallCounter* counter2() { return stats()->GetCounter(counter_id2()); }
-  RuntimeCallCounter* counter3() { return stats()->GetCounter(counter_id3()); }
-
-  void Sleep(int64_t microseconds) {
-    base::TimeDelta delta = base::TimeDelta::FromMicroseconds(microseconds);
-    time_ += delta;
-    runtime_call_stats_test_time_ =
-        base::TimeTicks::FromInternalValue(time_.InMicroseconds());
-  }
-
- private:
-  base::TimeDelta time_;
-};
-
-// Temporarily use the native time to modify the test time.
-class ElapsedTimeScope {
- public:
-  explicit ElapsedTimeScope(RuntimeCallStatsTest* test) : test_(test) {
-    timer_.Start();
-  }
-  ~ElapsedTimeScope() { test_->Sleep(timer_.Elapsed().InMicroseconds()); }
-
- private:
-  base::ElapsedTimer timer_;
-  RuntimeCallStatsTest* test_;
-};
-
-// Temporarily use the default time source.
-class NativeTimeScope {
- public:
-  NativeTimeScope() {
-    CHECK_EQ(RuntimeCallTimer::Now, &RuntimeCallStatsTestNow);
-    RuntimeCallTimer::Now = &base::TimeTicks::HighResolutionNow;
-  }
-  ~NativeTimeScope() {
-    CHECK_EQ(RuntimeCallTimer::Now, &base::TimeTicks::HighResolutionNow);
-    RuntimeCallTimer::Now = &RuntimeCallStatsTestNow;
-  }
-};
-
-}  // namespace
-
-
-TEST_F(AggregatedMemoryHistogramTest, OneSample1) {
-  FLAG_histogram_interval = 10;
-  AddSample(10, 1000);
-  AddSample(20, 1000);
-  EXPECT_EQ(1U, samples()->size());
-  EXPECT_EQ(1000, (*samples())[0]);
-}
-
-
-TEST_F(AggregatedMemoryHistogramTest, OneSample2) {
-  FLAG_histogram_interval = 10;
-  AddSample(10, 500);
-  AddSample(20, 1000);
-  EXPECT_EQ(1U, samples()->size());
-  EXPECT_EQ(750, (*samples())[0]);
-}
-
-
-TEST_F(AggregatedMemoryHistogramTest, OneSample3) {
-  FLAG_histogram_interval = 10;
-  AddSample(10, 500);
-  AddSample(15, 500);
-  AddSample(15, 1000);
-  AddSample(20, 1000);
-  EXPECT_EQ(1U, samples()->size());
-  EXPECT_EQ(750, (*samples())[0]);
-}
-
-
-TEST_F(AggregatedMemoryHistogramTest, OneSample4) {
-  FLAG_histogram_interval = 10;
-  AddSample(10, 500);
-  AddSample(15, 750);
-  AddSample(20, 1000);
-  EXPECT_EQ(1U, samples()->size());
-  EXPECT_EQ(750, (*samples())[0]);
-}
-
-
-TEST_F(AggregatedMemoryHistogramTest, TwoSamples1) {
-  FLAG_histogram_interval = 10;
-  AddSample(10, 1000);
-  AddSample(30, 1000);
-  EXPECT_EQ(2U, samples()->size());
-  EXPECT_EQ(1000, (*samples())[0]);
-  EXPECT_EQ(1000, (*samples())[1]);
-}
-
-
-TEST_F(AggregatedMemoryHistogramTest, TwoSamples2) {
-  FLAG_histogram_interval = 10;
-  AddSample(10, 1000);
-  AddSample(20, 1000);
-  AddSample(30, 1000);
-  EXPECT_EQ(2U, samples()->size());
-  EXPECT_EQ(1000, (*samples())[0]);
-  EXPECT_EQ(1000, (*samples())[1]);
-}
-
-
-TEST_F(AggregatedMemoryHistogramTest, TwoSamples3) {
-  FLAG_histogram_interval = 10;
-  AddSample(10, 1000);
-  AddSample(20, 1000);
-  AddSample(20, 500);
-  AddSample(30, 500);
-  EXPECT_EQ(2U, samples()->size());
-  EXPECT_EQ(1000, (*samples())[0]);
-  EXPECT_EQ(500, (*samples())[1]);
-}
-
-
-TEST_F(AggregatedMemoryHistogramTest, TwoSamples4) {
-  FLAG_histogram_interval = 10;
-  AddSample(10, 1000);
-  AddSample(30, 0);
-  EXPECT_EQ(2U, samples()->size());
-  EXPECT_EQ(750, (*samples())[0]);
-  EXPECT_EQ(250, (*samples())[1]);
-}
-
-
-TEST_F(AggregatedMemoryHistogramTest, TwoSamples5) {
-  FLAG_histogram_interval = 10;
-  AddSample(10, 0);
-  AddSample(30, 1000);
-  EXPECT_EQ(2U, samples()->size());
-  EXPECT_EQ(250, (*samples())[0]);
-  EXPECT_EQ(750, (*samples())[1]);
-}
-
-
-TEST_F(AggregatedMemoryHistogramTest, TwoSamples6) {
-  FLAG_histogram_interval = 10;
-  AddSample(10, 0);
-  AddSample(15, 1000);
-  AddSample(30, 1000);
-  EXPECT_EQ(2U, samples()->size());
-  EXPECT_EQ((500 + 1000) / 2, (*samples())[0]);
-  EXPECT_EQ(1000, (*samples())[1]);
-}
-
-
-TEST_F(AggregatedMemoryHistogramTest, TwoSamples7) {
-  FLAG_histogram_interval = 10;
-  AddSample(10, 0);
-  AddSample(15, 1000);
-  AddSample(25, 0);
-  AddSample(30, 1000);
-  EXPECT_EQ(2U, samples()->size());
-  EXPECT_EQ((500 + 750) / 2, (*samples())[0]);
-  EXPECT_EQ((250 + 500) / 2, (*samples())[1]);
-}
-
-
-TEST_F(AggregatedMemoryHistogramTest, TwoSamples8) {
-  FLAG_histogram_interval = 10;
-  AddSample(10, 1000);
-  AddSample(15, 0);
-  AddSample(25, 1000);
-  AddSample(30, 0);
-  EXPECT_EQ(2U, samples()->size());
-  EXPECT_EQ((500 + 250) / 2, (*samples())[0]);
-  EXPECT_EQ((750 + 500) / 2, (*samples())[1]);
-}
-
-
-TEST_F(AggregatedMemoryHistogramTest, ManySamples1) {
-  FLAG_histogram_interval = 10;
-  const int kMaxSamples = 1000;
-  AddSample(0, 0);
-  AddSample(10 * kMaxSamples, 10 * kMaxSamples);
-  EXPECT_EQ(static_cast<unsigned>(kMaxSamples), samples()->size());
-  for (int i = 0; i < kMaxSamples; i++) {
-    EXPECT_EQ(i * 10 + 5, (*samples())[i]);
-  }
-}
-
-
-TEST_F(AggregatedMemoryHistogramTest, ManySamples2) {
-  FLAG_histogram_interval = 10;
-  const int kMaxSamples = 1000;
-  AddSample(0, 0);
-  AddSample(10 * (2 * kMaxSamples), 10 * (2 * kMaxSamples));
-  EXPECT_EQ(static_cast<unsigned>(kMaxSamples), samples()->size());
-  for (int i = 0; i < kMaxSamples; i++) {
-    EXPECT_EQ(i * 10 + 5, (*samples())[i]);
-  }
-}
-
-TEST_F(RuntimeCallStatsTest, RuntimeCallTimer) {
-  RuntimeCallTimer timer;
-
-  Sleep(50);
-  stats()->Enter(&timer, counter_id());
-  EXPECT_EQ(counter(), timer.counter());
-  EXPECT_EQ(nullptr, timer.parent());
-  EXPECT_TRUE(timer.IsStarted());
-  EXPECT_EQ(&timer, stats()->current_timer());
-
-  Sleep(100);
-
-  stats()->Leave(&timer);
-  Sleep(50);
-  EXPECT_FALSE(timer.IsStarted());
-  EXPECT_EQ(1, counter()->count());
-  EXPECT_EQ(100, counter()->time().InMicroseconds());
-}
-
-TEST_F(RuntimeCallStatsTest, RuntimeCallTimerSubTimer) {
-  RuntimeCallTimer timer;
-  RuntimeCallTimer timer2;
-
-  stats()->Enter(&timer, counter_id());
-  EXPECT_TRUE(timer.IsStarted());
-  EXPECT_FALSE(timer2.IsStarted());
-  EXPECT_EQ(counter(), timer.counter());
-  EXPECT_EQ(nullptr, timer.parent());
-  EXPECT_EQ(&timer, stats()->current_timer());
-
-  Sleep(50);
-
-  stats()->Enter(&timer2, counter_id2());
-  // timer 1 is paused, while timer 2 is active.
-  EXPECT_TRUE(timer2.IsStarted());
-  EXPECT_EQ(counter(), timer.counter());
-  EXPECT_EQ(counter2(), timer2.counter());
-  EXPECT_EQ(nullptr, timer.parent());
-  EXPECT_EQ(&timer, timer2.parent());
-  EXPECT_EQ(&timer2, stats()->current_timer());
-
-  Sleep(100);
-  stats()->Leave(&timer2);
-
-  // The subtimer subtracts its time from the parent timer.
-  EXPECT_TRUE(timer.IsStarted());
-  EXPECT_FALSE(timer2.IsStarted());
-  EXPECT_EQ(0, counter()->count());
-  EXPECT_EQ(1, counter2()->count());
-  EXPECT_EQ(0, counter()->time().InMicroseconds());
-  EXPECT_EQ(100, counter2()->time().InMicroseconds());
-  EXPECT_EQ(&timer, stats()->current_timer());
-
-  Sleep(100);
-
-  stats()->Leave(&timer);
-  EXPECT_FALSE(timer.IsStarted());
-  EXPECT_EQ(1, counter()->count());
-  EXPECT_EQ(1, counter2()->count());
-  EXPECT_EQ(150, counter()->time().InMicroseconds());
-  EXPECT_EQ(100, counter2()->time().InMicroseconds());
-  EXPECT_EQ(nullptr, stats()->current_timer());
-}
-
-TEST_F(RuntimeCallStatsTest, RuntimeCallTimerRecursive) {
-  RuntimeCallTimer timer;
-  RuntimeCallTimer timer2;
-
-  stats()->Enter(&timer, counter_id());
-  EXPECT_EQ(counter(), timer.counter());
-  EXPECT_EQ(nullptr, timer.parent());
-  EXPECT_TRUE(timer.IsStarted());
-  EXPECT_EQ(&timer, stats()->current_timer());
-
-  stats()->Enter(&timer2, counter_id());
-  EXPECT_EQ(counter(), timer2.counter());
-  EXPECT_EQ(nullptr, timer.parent());
-  EXPECT_EQ(&timer, timer2.parent());
-  EXPECT_TRUE(timer2.IsStarted());
-  EXPECT_EQ(&timer2, stats()->current_timer());
-
-  Sleep(50);
-
-  stats()->Leave(&timer2);
-  EXPECT_EQ(nullptr, timer.parent());
-  EXPECT_FALSE(timer2.IsStarted());
-  EXPECT_TRUE(timer.IsStarted());
-  EXPECT_EQ(1, counter()->count());
-  EXPECT_EQ(50, counter()->time().InMicroseconds());
-
-  Sleep(100);
-
-  stats()->Leave(&timer);
-  EXPECT_FALSE(timer.IsStarted());
-  EXPECT_EQ(2, counter()->count());
-  EXPECT_EQ(150, counter()->time().InMicroseconds());
-}
-
-TEST_F(RuntimeCallStatsTest, RuntimeCallTimerScope) {
-  {
-    RuntimeCallTimerScope scope(stats(), counter_id());
-    Sleep(50);
-  }
-  Sleep(100);
-  EXPECT_EQ(1, counter()->count());
-  EXPECT_EQ(50, counter()->time().InMicroseconds());
-  {
-    RuntimeCallTimerScope scope(stats(), counter_id());
-    Sleep(50);
-  }
-  EXPECT_EQ(2, counter()->count());
-  EXPECT_EQ(100, counter()->time().InMicroseconds());
-}
-
-TEST_F(RuntimeCallStatsTest, RuntimeCallTimerScopeRecursive) {
-  {
-    RuntimeCallTimerScope scope(stats(), counter_id());
-    Sleep(50);
-    EXPECT_EQ(0, counter()->count());
-    EXPECT_EQ(0, counter()->time().InMicroseconds());
-    {
-      RuntimeCallTimerScope scope(stats(), counter_id());
-      Sleep(50);
-    }
-    EXPECT_EQ(1, counter()->count());
-    EXPECT_EQ(50, counter()->time().InMicroseconds());
-  }
-  EXPECT_EQ(2, counter()->count());
-  EXPECT_EQ(100, counter()->time().InMicroseconds());
-}
-
-TEST_F(RuntimeCallStatsTest, RenameTimer) {
-  {
-    RuntimeCallTimerScope scope(stats(), counter_id());
-    Sleep(50);
-    EXPECT_EQ(0, counter()->count());
-    EXPECT_EQ(0, counter2()->count());
-    EXPECT_EQ(0, counter()->time().InMicroseconds());
-    EXPECT_EQ(0, counter2()->time().InMicroseconds());
-    {
-      RuntimeCallTimerScope scope(stats(), counter_id());
-      Sleep(100);
-    }
-    CHANGE_CURRENT_RUNTIME_COUNTER(stats(),
-                                   RuntimeCallCounterId::kTestCounter2);
-    EXPECT_EQ(1, counter()->count());
-    EXPECT_EQ(0, counter2()->count());
-    EXPECT_EQ(100, counter()->time().InMicroseconds());
-    EXPECT_EQ(0, counter2()->time().InMicroseconds());
-  }
-  EXPECT_EQ(1, counter()->count());
-  EXPECT_EQ(1, counter2()->count());
-  EXPECT_EQ(100, counter()->time().InMicroseconds());
-  EXPECT_EQ(50, counter2()->time().InMicroseconds());
-}
-
-TEST_F(RuntimeCallStatsTest, BasicPrintAndSnapshot) {
-  std::ostringstream out;
-  stats()->Print(out);
-  EXPECT_EQ(0, counter()->count());
-  EXPECT_EQ(0, counter2()->count());
-  EXPECT_EQ(0, counter3()->count());
-  EXPECT_EQ(0, counter()->time().InMicroseconds());
-  EXPECT_EQ(0, counter2()->time().InMicroseconds());
-  EXPECT_EQ(0, counter3()->time().InMicroseconds());
-
-  {
-    RuntimeCallTimerScope scope(stats(), counter_id());
-    Sleep(50);
-    stats()->Print(out);
-  }
-  stats()->Print(out);
-  EXPECT_EQ(1, counter()->count());
-  EXPECT_EQ(0, counter2()->count());
-  EXPECT_EQ(0, counter3()->count());
-  EXPECT_EQ(50, counter()->time().InMicroseconds());
-  EXPECT_EQ(0, counter2()->time().InMicroseconds());
-  EXPECT_EQ(0, counter3()->time().InMicroseconds());
-}
-
-TEST_F(RuntimeCallStatsTest, PrintAndSnapshot) {
-  {
-    RuntimeCallTimerScope scope(stats(), counter_id());
-    Sleep(100);
-    EXPECT_EQ(0, counter()->count());
-    EXPECT_EQ(0, counter()->time().InMicroseconds());
-    {
-      RuntimeCallTimerScope scope(stats(), counter_id2());
-      EXPECT_EQ(0, counter2()->count());
-      EXPECT_EQ(0, counter2()->time().InMicroseconds());
-      Sleep(50);
-
-      // This calls Snapshot on the current active timer and sychronizes and
-      // commits the whole timer stack.
-      std::ostringstream out;
-      stats()->Print(out);
-      EXPECT_EQ(0, counter()->count());
-      EXPECT_EQ(0, counter2()->count());
-      EXPECT_EQ(100, counter()->time().InMicroseconds());
-      EXPECT_EQ(50, counter2()->time().InMicroseconds());
-      // Calling Print several times shouldn't have a (big) impact on the
-      // measured times.
-      stats()->Print(out);
-      EXPECT_EQ(0, counter()->count());
-      EXPECT_EQ(0, counter2()->count());
-      EXPECT_EQ(100, counter()->time().InMicroseconds());
-      EXPECT_EQ(50, counter2()->time().InMicroseconds());
-
-      Sleep(50);
-      stats()->Print(out);
-      EXPECT_EQ(0, counter()->count());
-      EXPECT_EQ(0, counter2()->count());
-      EXPECT_EQ(100, counter()->time().InMicroseconds());
-      EXPECT_EQ(100, counter2()->time().InMicroseconds());
-      Sleep(50);
-    }
-    Sleep(50);
-    EXPECT_EQ(0, counter()->count());
-    EXPECT_EQ(1, counter2()->count());
-    EXPECT_EQ(100, counter()->time().InMicroseconds());
-    EXPECT_EQ(150, counter2()->time().InMicroseconds());
-    Sleep(50);
-  }
-  EXPECT_EQ(1, counter()->count());
-  EXPECT_EQ(1, counter2()->count());
-  EXPECT_EQ(200, counter()->time().InMicroseconds());
-  EXPECT_EQ(150, counter2()->time().InMicroseconds());
-}
-
-TEST_F(RuntimeCallStatsTest, NestedScopes) {
-  {
-    RuntimeCallTimerScope scope(stats(), counter_id());
-    Sleep(100);
-    {
-      RuntimeCallTimerScope scope(stats(), counter_id2());
-      Sleep(100);
-      {
-        RuntimeCallTimerScope scope(stats(), counter_id3());
-        Sleep(50);
-      }
-      Sleep(50);
-      {
-        RuntimeCallTimerScope scope(stats(), counter_id3());
-        Sleep(50);
-      }
-      Sleep(50);
-    }
-    Sleep(100);
-    {
-      RuntimeCallTimerScope scope(stats(), counter_id2());
-      Sleep(100);
-    }
-    Sleep(50);
-  }
-  EXPECT_EQ(1, counter()->count());
-  EXPECT_EQ(2, counter2()->count());
-  EXPECT_EQ(2, counter3()->count());
-  EXPECT_EQ(250, counter()->time().InMicroseconds());
-  EXPECT_EQ(300, counter2()->time().InMicroseconds());
-  EXPECT_EQ(100, counter3()->time().InMicroseconds());
-}
-
-TEST_F(RuntimeCallStatsTest, BasicJavaScript) {
-  RuntimeCallCounter* counter =
-      stats()->GetCounter(RuntimeCallCounterId::kJS_Execution);
-  EXPECT_EQ(0, counter->count());
-  EXPECT_EQ(0, counter->time().InMicroseconds());
-
-  {
-    NativeTimeScope native_timer_scope;
-    RunJS("function f() { return 1; }");
-  }
-  EXPECT_EQ(1, counter->count());
-  int64_t time = counter->time().InMicroseconds();
-  EXPECT_LT(0, time);
-
-  {
-    NativeTimeScope native_timer_scope;
-    RunJS("f()");
-  }
-  EXPECT_EQ(2, counter->count());
-  EXPECT_LE(time, counter->time().InMicroseconds());
-}
-
-TEST_F(RuntimeCallStatsTest, FunctionLengthGetter) {
-  RuntimeCallCounter* getter_counter =
-      stats()->GetCounter(RuntimeCallCounterId::kFunctionLengthGetter);
-  RuntimeCallCounter* js_counter =
-      stats()->GetCounter(RuntimeCallCounterId::kJS_Execution);
-  EXPECT_EQ(0, getter_counter->count());
-  EXPECT_EQ(0, js_counter->count());
-  EXPECT_EQ(0, getter_counter->time().InMicroseconds());
-  EXPECT_EQ(0, js_counter->time().InMicroseconds());
-
-  {
-    NativeTimeScope native_timer_scope;
-    RunJS("function f(array) { return array.length; }");
-  }
-  EXPECT_EQ(0, getter_counter->count());
-  EXPECT_EQ(1, js_counter->count());
-  EXPECT_EQ(0, getter_counter->time().InMicroseconds());
-  int64_t js_time = js_counter->time().InMicroseconds();
-  EXPECT_LT(0, js_time);
-
-  {
-    NativeTimeScope native_timer_scope;
-    RunJS("f.length");
-  }
-  EXPECT_EQ(1, getter_counter->count());
-  EXPECT_EQ(2, js_counter->count());
-  EXPECT_LE(0, getter_counter->time().InMicroseconds());
-  EXPECT_LT(js_time, js_counter->time().InMicroseconds());
-
-  {
-    NativeTimeScope native_timer_scope;
-    RunJS("for (let i = 0; i < 50; i++) { f.length }");
-  }
-  EXPECT_EQ(51, getter_counter->count());
-  EXPECT_EQ(3, js_counter->count());
-}
-
-namespace {
-static RuntimeCallStatsTest* current_test;
-static const int kCustomCallbackTime = 1234;
-static void CustomCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
-  RuntimeCallTimerScope scope(current_test->stats(),
-                              current_test->counter_id2());
-  current_test->Sleep(kCustomCallbackTime);
-}
-}  // namespace
-
-TEST_F(RuntimeCallStatsTest, CustomCallback) {
-  current_test = this;
-  // Set up a function template with a custom callback.
-  v8::Isolate* isolate = v8_isolate();
-  v8::HandleScope scope(isolate);
-
-  v8::Local<v8::ObjectTemplate> object_template =
-      v8::ObjectTemplate::New(isolate);
-  object_template->Set(isolate, "callback",
-                       v8::FunctionTemplate::New(isolate, CustomCallback));
-  v8::Local<v8::Object> object =
-      object_template->NewInstance(v8_context()).ToLocalChecked();
-  SetGlobalProperty("custom_object", object);
-
-  // TODO(cbruni): Check api accessor timer (one above the custom callback).
-  EXPECT_EQ(0, js_counter()->count());
-  EXPECT_EQ(0, counter()->count());
-  EXPECT_EQ(0, counter2()->count());
-  {
-    RuntimeCallTimerScope scope(stats(), counter_id());
-    Sleep(100);
-    RunJS("custom_object.callback();");
-  }
-  EXPECT_EQ(1, js_counter()->count());
-  // Given that no native timers are used, only the two scopes explitly
-  // mentioned above will track the time.
-  EXPECT_EQ(0, js_counter()->time().InMicroseconds());
-  EXPECT_EQ(1, counter()->count());
-  EXPECT_EQ(100, counter()->time().InMicroseconds());
-  EXPECT_EQ(1, counter2()->count());
-  EXPECT_EQ(kCustomCallbackTime, counter2()->time().InMicroseconds());
-
-  RunJS("for (let i = 0; i < 9; i++) { custom_object.callback() };");
-  EXPECT_EQ(2, js_counter()->count());
-  EXPECT_EQ(0, js_counter()->time().InMicroseconds());
-  EXPECT_EQ(1, counter()->count());
-  EXPECT_EQ(100, counter()->time().InMicroseconds());
-  EXPECT_EQ(10, counter2()->count());
-  EXPECT_EQ(kCustomCallbackTime * 10, counter2()->time().InMicroseconds());
-
-  RunJS("for (let i = 0; i < 4000; i++) { custom_object.callback() };");
-  EXPECT_EQ(3, js_counter()->count());
-  EXPECT_EQ(0, js_counter()->time().InMicroseconds());
-  EXPECT_EQ(1, counter()->count());
-  EXPECT_EQ(100, counter()->time().InMicroseconds());
-  EXPECT_EQ(4010, counter2()->count());
-  EXPECT_EQ(kCustomCallbackTime * 4010, counter2()->time().InMicroseconds());
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/unittests/detachable-vector-unittest.cc b/src/v8/test/unittests/detachable-vector-unittest.cc
deleted file mode 100644
index f9c846d..0000000
--- a/src/v8/test/unittests/detachable-vector-unittest.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2017 the V8 project 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 "src/detachable-vector.h"
-
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace v8 {
-namespace internal {
-
-TEST(DetachableVector, ConstructIsEmpty) {
-  DetachableVector<int> v;
-
-  size_t empty_size = 0;
-  EXPECT_EQ(empty_size, v.size());
-  EXPECT_TRUE(v.empty());
-}
-
-TEST(DetachableVector, PushAddsElement) {
-  DetachableVector<int> v;
-
-  v.push_back(1);
-
-  EXPECT_EQ(1, v.front());
-  EXPECT_EQ(1, v.back());
-  EXPECT_EQ(1, v.at(0));
-  size_t one_size = 1;
-  EXPECT_EQ(one_size, v.size());
-  EXPECT_FALSE(v.empty());
-}
-
-TEST(DetachableVector, AfterFreeIsEmpty) {
-  DetachableVector<int> v;
-
-  v.push_back(1);
-  v.free();
-
-  size_t empty_size = 0;
-  EXPECT_EQ(empty_size, v.size());
-  EXPECT_TRUE(v.empty());
-}
-
-// This test relies on ASAN to detect leaks and double-frees.
-TEST(DetachableVector, DetachLeaksBackingStore) {
-  DetachableVector<int> v;
-  DetachableVector<int> v2;
-
-  size_t one_size = 1;
-  EXPECT_TRUE(v2.empty());
-
-  // Force allocation of the backing store.
-  v.push_back(1);
-  // Bit-copy the data structure.
-  memcpy(&v2, &v, sizeof(DetachableVector<int>));
-  // The backing store should be leaked here - free was not called.
-  v.detach();
-
-  // We have transferred the backing store to the second vector.
-  EXPECT_EQ(one_size, v2.size());
-  EXPECT_TRUE(v.empty());
-
-  // The destructor of v2 will release the backing store.
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/unittests/eh-frame-iterator-unittest.cc b/src/v8/test/unittests/eh-frame-iterator-unittest.cc
deleted file mode 100644
index fff3820..0000000
--- a/src/v8/test/unittests/eh-frame-iterator-unittest.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/eh-frame.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace v8 {
-namespace internal {
-
-// Test enabled only on supported architectures.
-#if defined(V8_TARGET_ARCH_X64) || defined(V8_TARGET_ARCH_ARM) || \
-    defined(V8_TARGET_ARCH_ARM64)
-
-namespace {
-
-class EhFrameIteratorTest : public testing::Test {};
-
-}  // namespace
-
-TEST_F(EhFrameIteratorTest, Values) {
-  // Assuming little endian.
-  static const byte kEncoded[] = {0xDE, 0xC0, 0xAD, 0xDE, 0xEF, 0xBE, 0xFF};
-  EhFrameIterator iterator(&kEncoded[0], &kEncoded[0] + sizeof(kEncoded));
-  EXPECT_EQ(0xDEADC0DE, iterator.GetNextUInt32());
-  EXPECT_EQ(0xBEEF, iterator.GetNextUInt16());
-  EXPECT_EQ(0xFF, iterator.GetNextByte());
-  EXPECT_TRUE(iterator.Done());
-}
-
-TEST_F(EhFrameIteratorTest, Skip) {
-  static const byte kEncoded[] = {0xDE, 0xAD, 0xC0, 0xDE};
-  EhFrameIterator iterator(&kEncoded[0], &kEncoded[0] + sizeof(kEncoded));
-  iterator.Skip(2);
-  EXPECT_EQ(2, iterator.GetCurrentOffset());
-  EXPECT_EQ(0xC0, iterator.GetNextByte());
-  iterator.Skip(1);
-  EXPECT_TRUE(iterator.Done());
-}
-
-TEST_F(EhFrameIteratorTest, ULEB128Decoding) {
-  static const byte kEncoded[] = {0xE5, 0x8E, 0x26};
-  EhFrameIterator iterator(&kEncoded[0], &kEncoded[0] + sizeof(kEncoded));
-  EXPECT_EQ(624485u, iterator.GetNextULeb128());
-  EXPECT_TRUE(iterator.Done());
-}
-
-TEST_F(EhFrameIteratorTest, SLEB128DecodingPositive) {
-  static const byte kEncoded[] = {0xE5, 0x8E, 0x26};
-  EhFrameIterator iterator(&kEncoded[0], &kEncoded[0] + sizeof(kEncoded));
-  EXPECT_EQ(624485, iterator.GetNextSLeb128());
-  EXPECT_TRUE(iterator.Done());
-}
-
-TEST_F(EhFrameIteratorTest, SLEB128DecodingNegative) {
-  static const byte kEncoded[] = {0x9B, 0xF1, 0x59};
-  EhFrameIterator iterator(&kEncoded[0], &kEncoded[0] + sizeof(kEncoded));
-  EXPECT_EQ(-624485, iterator.GetNextSLeb128());
-  EXPECT_TRUE(iterator.Done());
-}
-
-#endif
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/unittests/eh-frame-writer-unittest.cc b/src/v8/test/unittests/eh-frame-writer-unittest.cc
deleted file mode 100644
index 0846fda..0000000
--- a/src/v8/test/unittests/eh-frame-writer-unittest.cc
+++ /dev/null
@@ -1,473 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/eh-frame.h"
-#include "test/unittests/test-utils.h"
-
-namespace v8 {
-namespace internal {
-
-// Test enabled only on supported architectures.
-#if defined(V8_TARGET_ARCH_X64) || defined(V8_TARGET_ARCH_ARM) || \
-    defined(V8_TARGET_ARCH_ARM64)
-
-namespace {
-
-class EhFrameWriterTest : public TestWithZone {
- protected:
-  // Being a 7bit positive integer, this also serves as its ULEB128 encoding.
-  static const int kTestRegisterCode = 0;
-
-  static EhFrameIterator MakeIterator(EhFrameWriter* writer) {
-    CodeDesc desc;
-    writer->GetEhFrame(&desc);
-    DCHECK_GT(desc.unwinding_info_size, 0);
-    return EhFrameIterator(desc.unwinding_info,
-                           desc.unwinding_info + desc.unwinding_info_size);
-  }
-};
-
-const int EhFrameWriterTest::kTestRegisterCode;
-
-}  // namespace
-
-TEST_F(EhFrameWriterTest, Alignment) {
-  EhFrameWriter writer(zone());
-  writer.Initialize();
-  writer.AdvanceLocation(42 * EhFrameConstants::kCodeAlignmentFactor);
-  writer.Finish(100);
-
-  EhFrameIterator iterator = MakeIterator(&writer);
-  ASSERT_EQ(0, EhFrameConstants::kEhFrameHdrSize % 4);
-  ASSERT_EQ(0, EhFrameConstants::kEhFrameTerminatorSize % 4);
-  EXPECT_EQ(0, (iterator.GetBufferSize() - EhFrameConstants::kEhFrameHdrSize -
-                EhFrameConstants::kEhFrameTerminatorSize) %
-                   kPointerSize);
-}
-
-TEST_F(EhFrameWriterTest, FDEHeader) {
-  static const int kProcedureSize = 0x5678ABCD;
-
-  EhFrameWriter writer(zone());
-  writer.Initialize();
-  writer.Finish(kProcedureSize);
-
-  EhFrameIterator iterator = MakeIterator(&writer);
-  int cie_size = iterator.GetNextUInt32();
-  iterator.Skip(cie_size);
-
-  int fde_size = iterator.GetNextUInt32();
-  EXPECT_EQ(iterator.GetBufferSize(),
-            fde_size + cie_size + EhFrameConstants::kEhFrameTerminatorSize +
-                EhFrameConstants::kEhFrameHdrSize + 2 * kInt32Size);
-
-  int backwards_offset_to_cie_offset = iterator.GetCurrentOffset();
-  int backwards_offset_to_cie = iterator.GetNextUInt32();
-  EXPECT_EQ(backwards_offset_to_cie_offset, backwards_offset_to_cie);
-
-  int procedure_address_offset = iterator.GetCurrentOffset();
-  int procedure_address = iterator.GetNextUInt32();
-  EXPECT_EQ(-(procedure_address_offset + RoundUp(kProcedureSize, 8)),
-            procedure_address);
-
-  int procedure_size = iterator.GetNextUInt32();
-  EXPECT_EQ(kProcedureSize, procedure_size);
-}
-
-TEST_F(EhFrameWriterTest, SetOffset) {
-  static const uint32_t kOffset = 0x0BADC0DE;
-
-  EhFrameWriter writer(zone());
-  writer.Initialize();
-  writer.SetBaseAddressOffset(kOffset);
-  writer.Finish(100);
-
-  EhFrameIterator iterator = MakeIterator(&writer);
-  iterator.SkipToFdeDirectives();
-
-  EXPECT_EQ(EhFrameConstants::DwarfOpcodes::kDefCfaOffset,
-            iterator.GetNextOpcode());
-  EXPECT_EQ(kOffset, iterator.GetNextULeb128());
-}
-
-TEST_F(EhFrameWriterTest, IncreaseOffset) {
-  static const uint32_t kFirstOffset = 121;
-  static const uint32_t kSecondOffset = 16;
-
-  EhFrameWriter writer(zone());
-  writer.Initialize();
-  writer.SetBaseAddressOffset(kFirstOffset);
-  writer.IncreaseBaseAddressOffset(kSecondOffset);
-  writer.Finish(100);
-
-  EhFrameIterator iterator = MakeIterator(&writer);
-  iterator.SkipToFdeDirectives();
-
-  EXPECT_EQ(EhFrameConstants::DwarfOpcodes::kDefCfaOffset,
-            iterator.GetNextOpcode());
-  EXPECT_EQ(kFirstOffset, iterator.GetNextULeb128());
-
-  EXPECT_EQ(EhFrameConstants::DwarfOpcodes::kDefCfaOffset,
-            iterator.GetNextOpcode());
-  EXPECT_EQ(kFirstOffset + kSecondOffset, iterator.GetNextULeb128());
-}
-
-TEST_F(EhFrameWriterTest, SetRegister) {
-  Register test_register = Register::from_code(kTestRegisterCode);
-
-  EhFrameWriter writer(zone());
-  writer.Initialize();
-  writer.SetBaseAddressRegister(test_register);
-  writer.Finish(100);
-
-  EhFrameIterator iterator = MakeIterator(&writer);
-  iterator.SkipToFdeDirectives();
-
-  EXPECT_EQ(EhFrameConstants::DwarfOpcodes::kDefCfaRegister,
-            iterator.GetNextOpcode());
-  EXPECT_EQ(static_cast<uint32_t>(kTestRegisterCode),
-            iterator.GetNextULeb128());
-}
-
-TEST_F(EhFrameWriterTest, SetRegisterAndOffset) {
-  Register test_register = Register::from_code(kTestRegisterCode);
-  static const uint32_t kOffset = 0x0BADC0DE;
-
-  EhFrameWriter writer(zone());
-  writer.Initialize();
-  writer.SetBaseAddressRegisterAndOffset(test_register, kOffset);
-  writer.Finish(100);
-
-  EhFrameIterator iterator = MakeIterator(&writer);
-  iterator.SkipToFdeDirectives();
-
-  EXPECT_EQ(EhFrameConstants::DwarfOpcodes::kDefCfa, iterator.GetNextOpcode());
-  EXPECT_EQ(static_cast<uint32_t>(kTestRegisterCode),
-            iterator.GetNextULeb128());
-  EXPECT_EQ(kOffset, iterator.GetNextULeb128());
-}
-
-TEST_F(EhFrameWriterTest, PcOffsetEncoding6bit) {
-  static const int kOffset = 42;
-
-  EhFrameWriter writer(zone());
-  writer.Initialize();
-  writer.AdvanceLocation(kOffset * EhFrameConstants::kCodeAlignmentFactor);
-  writer.Finish(100);
-
-  EhFrameIterator iterator = MakeIterator(&writer);
-  iterator.SkipToFdeDirectives();
-
-  EXPECT_EQ((1 << 6) | kOffset, iterator.GetNextByte());
-}
-
-TEST_F(EhFrameWriterTest, PcOffsetEncoding6bitDelta) {
-  static const int kFirstOffset = 42;
-  static const int kSecondOffset = 62;
-
-  EhFrameWriter writer(zone());
-  writer.Initialize();
-  writer.AdvanceLocation(kFirstOffset * EhFrameConstants::kCodeAlignmentFactor);
-  writer.AdvanceLocation(kSecondOffset *
-                         EhFrameConstants::kCodeAlignmentFactor);
-  writer.Finish(100);
-
-  EhFrameIterator iterator = MakeIterator(&writer);
-  iterator.SkipToFdeDirectives();
-
-  EXPECT_EQ((1 << 6) | kFirstOffset, iterator.GetNextByte());
-  EXPECT_EQ((1 << 6) | (kSecondOffset - kFirstOffset), iterator.GetNextByte());
-}
-
-TEST_F(EhFrameWriterTest, PcOffsetEncoding8bit) {
-  static const int kOffset = 0x42;
-
-  EhFrameWriter writer(zone());
-  writer.Initialize();
-  writer.AdvanceLocation(kOffset * EhFrameConstants::kCodeAlignmentFactor);
-  writer.Finish(100);
-
-  EhFrameIterator iterator = MakeIterator(&writer);
-  iterator.SkipToFdeDirectives();
-
-  EXPECT_EQ(EhFrameConstants::DwarfOpcodes::kAdvanceLoc1,
-            iterator.GetNextOpcode());
-  EXPECT_EQ(kOffset, iterator.GetNextByte());
-}
-
-TEST_F(EhFrameWriterTest, PcOffsetEncoding8bitDelta) {
-  static const int kFirstOffset = 0x10;
-  static const int kSecondOffset = 0x70;
-  static const int kThirdOffset = 0xB5;
-
-  EhFrameWriter writer(zone());
-  writer.Initialize();
-  writer.AdvanceLocation(kFirstOffset * EhFrameConstants::kCodeAlignmentFactor);
-  writer.AdvanceLocation(kSecondOffset *
-                         EhFrameConstants::kCodeAlignmentFactor);
-  writer.AdvanceLocation(kThirdOffset * EhFrameConstants::kCodeAlignmentFactor);
-  writer.Finish(100);
-
-  EhFrameIterator iterator = MakeIterator(&writer);
-  iterator.SkipToFdeDirectives();
-
-  EXPECT_EQ((1 << 6) | kFirstOffset, iterator.GetNextByte());
-
-  EXPECT_EQ(EhFrameConstants::DwarfOpcodes::kAdvanceLoc1,
-            iterator.GetNextOpcode());
-  EXPECT_EQ(kSecondOffset - kFirstOffset, iterator.GetNextByte());
-
-  EXPECT_EQ(EhFrameConstants::DwarfOpcodes::kAdvanceLoc1,
-            iterator.GetNextOpcode());
-  EXPECT_EQ(kThirdOffset - kSecondOffset, iterator.GetNextByte());
-}
-
-TEST_F(EhFrameWriterTest, PcOffsetEncoding16bit) {
-  static const int kOffset = kMaxUInt8 + 42;
-  ASSERT_LT(kOffset, kMaxUInt16);
-
-  EhFrameWriter writer(zone());
-  writer.Initialize();
-  writer.AdvanceLocation(kOffset * EhFrameConstants::kCodeAlignmentFactor);
-  writer.Finish(100);
-
-  EhFrameIterator iterator = MakeIterator(&writer);
-  iterator.SkipToFdeDirectives();
-
-  EXPECT_EQ(EhFrameConstants::DwarfOpcodes::kAdvanceLoc2,
-            iterator.GetNextOpcode());
-  EXPECT_EQ(kOffset, iterator.GetNextUInt16());
-}
-
-TEST_F(EhFrameWriterTest, PcOffsetEncoding16bitDelta) {
-  static const int kFirstOffset = 0x41;
-  static const int kSecondOffset = kMaxUInt8 + 0x42;
-
-  EhFrameWriter writer(zone());
-  writer.Initialize();
-  writer.AdvanceLocation(kFirstOffset * EhFrameConstants::kCodeAlignmentFactor);
-  writer.AdvanceLocation(kSecondOffset *
-                         EhFrameConstants::kCodeAlignmentFactor);
-  writer.Finish(100);
-
-  EhFrameIterator iterator = MakeIterator(&writer);
-  iterator.SkipToFdeDirectives();
-
-  EXPECT_EQ(EhFrameConstants::DwarfOpcodes::kAdvanceLoc1,
-            iterator.GetNextOpcode());
-  EXPECT_EQ(kFirstOffset, iterator.GetNextByte());
-
-  EXPECT_EQ(EhFrameConstants::DwarfOpcodes::kAdvanceLoc2,
-            iterator.GetNextOpcode());
-  EXPECT_EQ(kSecondOffset - kFirstOffset, iterator.GetNextUInt16());
-}
-
-TEST_F(EhFrameWriterTest, PcOffsetEncoding32bit) {
-  static const uint32_t kOffset = kMaxUInt16 + 42;
-
-  EhFrameWriter writer(zone());
-  writer.Initialize();
-  writer.AdvanceLocation(kOffset * EhFrameConstants::kCodeAlignmentFactor);
-  writer.Finish(100);
-
-  EhFrameIterator iterator = MakeIterator(&writer);
-  iterator.SkipToFdeDirectives();
-
-  EXPECT_EQ(EhFrameConstants::DwarfOpcodes::kAdvanceLoc4,
-            iterator.GetNextOpcode());
-  EXPECT_EQ(kOffset, iterator.GetNextUInt32());
-}
-
-TEST_F(EhFrameWriterTest, PcOffsetEncoding32bitDelta) {
-  static const uint32_t kFirstOffset = kMaxUInt16 + 0x42;
-  static const uint32_t kSecondOffset = kMaxUInt16 + 0x67;
-
-  EhFrameWriter writer(zone());
-  writer.Initialize();
-  writer.AdvanceLocation(kFirstOffset * EhFrameConstants::kCodeAlignmentFactor);
-  writer.AdvanceLocation(kSecondOffset *
-                         EhFrameConstants::kCodeAlignmentFactor);
-  writer.Finish(100);
-
-  EhFrameIterator iterator = MakeIterator(&writer);
-  iterator.SkipToFdeDirectives();
-
-  EXPECT_EQ(EhFrameConstants::DwarfOpcodes::kAdvanceLoc4,
-            iterator.GetNextOpcode());
-  EXPECT_EQ(kFirstOffset, iterator.GetNextUInt32());
-
-  EXPECT_EQ((1 << 6) | (kSecondOffset - kFirstOffset), iterator.GetNextByte());
-}
-
-TEST_F(EhFrameWriterTest, SaveRegisterUnsignedOffset) {
-  Register test_register = Register::from_code(kTestRegisterCode);
-  static const int kOffset =
-      EhFrameConstants::kDataAlignmentFactor > 0 ? 12344 : -12344;
-
-  EhFrameWriter writer(zone());
-  writer.Initialize();
-  writer.RecordRegisterSavedToStack(test_register, kOffset);
-  writer.Finish(100);
-
-  EhFrameIterator iterator = MakeIterator(&writer);
-  iterator.SkipToFdeDirectives();
-
-  EXPECT_EQ((2 << 6) | kTestRegisterCode, iterator.GetNextByte());
-  EXPECT_EQ(
-      static_cast<uint32_t>(kOffset / EhFrameConstants::kDataAlignmentFactor),
-      iterator.GetNextULeb128());
-}
-
-TEST_F(EhFrameWriterTest, SaveRegisterSignedOffset) {
-  Register test_register = Register::from_code(kTestRegisterCode);
-  static const int kOffset =
-      EhFrameConstants::kDataAlignmentFactor < 0 ? 12344 : -12344;
-
-  ASSERT_EQ(kOffset % EhFrameConstants::kDataAlignmentFactor, 0);
-
-  EhFrameWriter writer(zone());
-  writer.Initialize();
-  writer.RecordRegisterSavedToStack(test_register, kOffset);
-  writer.Finish(100);
-
-  EhFrameIterator iterator = MakeIterator(&writer);
-  iterator.SkipToFdeDirectives();
-
-  EXPECT_EQ(EhFrameConstants::DwarfOpcodes::kOffsetExtendedSf,
-            iterator.GetNextOpcode());
-  EXPECT_EQ(static_cast<uint32_t>(kTestRegisterCode),
-            iterator.GetNextULeb128());
-  EXPECT_EQ(kOffset / EhFrameConstants::kDataAlignmentFactor,
-            iterator.GetNextSLeb128());
-}
-
-TEST_F(EhFrameWriterTest, RegisterNotModified) {
-  Register test_register = Register::from_code(kTestRegisterCode);
-
-  EhFrameWriter writer(zone());
-  writer.Initialize();
-  writer.RecordRegisterNotModified(test_register);
-  writer.Finish(100);
-
-  EhFrameIterator iterator = MakeIterator(&writer);
-  iterator.SkipToFdeDirectives();
-
-  EXPECT_EQ(EhFrameConstants::DwarfOpcodes::kSameValue,
-            iterator.GetNextOpcode());
-  EXPECT_EQ(static_cast<uint32_t>(kTestRegisterCode),
-            iterator.GetNextULeb128());
-}
-
-TEST_F(EhFrameWriterTest, RegisterFollowsInitialRule) {
-  Register test_register = Register::from_code(kTestRegisterCode);
-
-  EhFrameWriter writer(zone());
-  writer.Initialize();
-  writer.RecordRegisterFollowsInitialRule(test_register);
-  writer.Finish(100);
-
-  EhFrameIterator iterator = MakeIterator(&writer);
-  iterator.SkipToFdeDirectives();
-
-  EXPECT_EQ((3 << 6) | kTestRegisterCode, iterator.GetNextByte());
-}
-
-TEST_F(EhFrameWriterTest, EhFrameHdrLayout) {
-  static const int kCodeSize = 10;
-  static const int kPaddingSize = 6;
-
-  EhFrameWriter writer(zone());
-  writer.Initialize();
-  writer.Finish(kCodeSize);
-
-  EhFrameIterator iterator = MakeIterator(&writer);
-
-  // Skip the .eh_frame.
-
-  int encoded_cie_size = iterator.GetNextUInt32();
-  iterator.Skip(encoded_cie_size);
-  int cie_size = encoded_cie_size + kInt32Size;
-
-  int encoded_fde_size = iterator.GetNextUInt32();
-  iterator.Skip(encoded_fde_size);
-  int fde_size = encoded_fde_size + kInt32Size;
-
-  iterator.Skip(EhFrameConstants::kEhFrameTerminatorSize);
-
-  int eh_frame_size =
-      cie_size + fde_size + EhFrameConstants::kEhFrameTerminatorSize;
-
-  //
-  // Plugging some numbers in the DSO layout shown in eh-frame.cc:
-  //
-  //  |      ...      |
-  //  +---------------+ <-- (E) ---------
-  //  |               |                 ^
-  //  |  Instructions |  10 bytes       | .text
-  //  |               |                 v
-  //  +---------------+ <----------------
-  //  |///////////////|
-  //  |////Padding////|   6 bytes
-  //  |///////////////|
-  //  +---------------+ <---(D)----------
-  //  |               |                 ^
-  //  |      CIE      | cie_size bytes* |
-  //  |               |                 |
-  //  +---------------+ <-- (C)         |
-  //  |               |                 | .eh_frame
-  //  |      FDE      | fde_size bytes  |
-  //  |               |                 |
-  //  +---------------+                 |
-  //  |   terminator  |   4 bytes       v
-  //  +---------------+ <-- (B) ---------
-  //  |    version    |                 ^
-  //  +---------------+   4 bytes       |
-  //  |   encoding    |                 |
-  //  |  specifiers   |                 |
-  //  +---------------+ <---(A)         | .eh_frame_hdr
-  //  |   offset to   |                 |
-  //  |   .eh_frame   |                 |
-  //  +---------------+                 |
-  //  |      ...      |                ...
-  //
-  //  (*) the size of the CIE is platform dependent.
-  //
-
-  int eh_frame_hdr_version = iterator.GetNextByte();
-  EXPECT_EQ(EhFrameConstants::kEhFrameHdrVersion, eh_frame_hdr_version);
-
-  // .eh_frame pointer encoding specifier.
-  EXPECT_EQ(EhFrameConstants::kSData4 | EhFrameConstants::kPcRel,
-            iterator.GetNextByte());
-
-  // Lookup table size encoding specifier.
-  EXPECT_EQ(EhFrameConstants::kUData4, iterator.GetNextByte());
-
-  // Lookup table pointers encoding specifier.
-  EXPECT_EQ(EhFrameConstants::kSData4 | EhFrameConstants::kDataRel,
-            iterator.GetNextByte());
-
-  // A -> D
-  int offset_to_eh_frame = iterator.GetNextUInt32();
-  EXPECT_EQ(-(EhFrameConstants::kFdeVersionSize +
-              EhFrameConstants::kFdeEncodingSpecifiersSize + eh_frame_size),
-            offset_to_eh_frame);
-
-  int lut_entries = iterator.GetNextUInt32();
-  EXPECT_EQ(1, lut_entries);
-
-  // B -> E
-  int offset_to_procedure = iterator.GetNextUInt32();
-  EXPECT_EQ(-(eh_frame_size + kPaddingSize + kCodeSize), offset_to_procedure);
-
-  // B -> C
-  int offset_to_fde = iterator.GetNextUInt32();
-  EXPECT_EQ(-(fde_size + EhFrameConstants::kEhFrameTerminatorSize),
-            offset_to_fde);
-}
-
-#endif
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/unittests/locked-queue-unittest.cc b/src/v8/test/unittests/locked-queue-unittest.cc
deleted file mode 100644
index cc176d9..0000000
--- a/src/v8/test/unittests/locked-queue-unittest.cc
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright 2015 the V8 project 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 "src/locked-queue-inl.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-
-typedef int Record;
-
-}  // namespace
-
-namespace v8 {
-namespace internal {
-
-TEST(LockedQueue, ConstructorEmpty) {
-  LockedQueue<Record> queue;
-  EXPECT_TRUE(queue.IsEmpty());
-}
-
-
-TEST(LockedQueue, SingleRecordEnqueueDequeue) {
-  LockedQueue<Record> queue;
-  EXPECT_TRUE(queue.IsEmpty());
-  queue.Enqueue(1);
-  EXPECT_FALSE(queue.IsEmpty());
-  Record a = -1;
-  bool success = queue.Dequeue(&a);
-  EXPECT_TRUE(success);
-  EXPECT_EQ(a, 1);
-  EXPECT_TRUE(queue.IsEmpty());
-}
-
-
-TEST(LockedQueue, Peek) {
-  LockedQueue<Record> queue;
-  EXPECT_TRUE(queue.IsEmpty());
-  queue.Enqueue(1);
-  EXPECT_FALSE(queue.IsEmpty());
-  Record a = -1;
-  bool success = queue.Peek(&a);
-  EXPECT_TRUE(success);
-  EXPECT_EQ(a, 1);
-  EXPECT_FALSE(queue.IsEmpty());
-  success = queue.Dequeue(&a);
-  EXPECT_TRUE(success);
-  EXPECT_EQ(a, 1);
-  EXPECT_TRUE(queue.IsEmpty());
-}
-
-
-TEST(LockedQueue, PeekOnEmpty) {
-  LockedQueue<Record> queue;
-  EXPECT_TRUE(queue.IsEmpty());
-  Record a = -1;
-  bool success = queue.Peek(&a);
-  EXPECT_FALSE(success);
-}
-
-
-TEST(LockedQueue, MultipleRecords) {
-  LockedQueue<Record> queue;
-  EXPECT_TRUE(queue.IsEmpty());
-  queue.Enqueue(1);
-  EXPECT_FALSE(queue.IsEmpty());
-  for (int i = 2; i <= 5; ++i) {
-    queue.Enqueue(i);
-    EXPECT_FALSE(queue.IsEmpty());
-  }
-  Record rec = 0;
-  for (int i = 1; i <= 4; ++i) {
-    EXPECT_FALSE(queue.IsEmpty());
-    queue.Dequeue(&rec);
-    EXPECT_EQ(i, rec);
-  }
-  for (int i = 6; i <= 12; ++i) {
-    queue.Enqueue(i);
-    EXPECT_FALSE(queue.IsEmpty());
-  }
-  for (int i = 5; i <= 12; ++i) {
-    EXPECT_FALSE(queue.IsEmpty());
-    queue.Dequeue(&rec);
-    EXPECT_EQ(i, rec);
-  }
-  EXPECT_TRUE(queue.IsEmpty());
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/unittests/object-unittest.cc b/src/v8/test/unittests/object-unittest.cc
deleted file mode 100644
index 4cb113a..0000000
--- a/src/v8/test/unittests/object-unittest.cc
+++ /dev/null
@@ -1,152 +0,0 @@
-// Copyright 2016 the V8 project 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 <cmath>
-#include <iostream>
-#include <limits>
-
-#include "src/objects-inl.h"
-#include "src/objects.h"
-#include "test/unittests/test-utils.h"
-
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace v8 {
-namespace internal {
-
-namespace {
-
-bool IsInStringInstanceTypeList(InstanceType instance_type) {
-  switch (instance_type) {
-#define TEST_INSTANCE_TYPE(type, ...) \
-  case InstanceType::type:            \
-    STATIC_ASSERT(InstanceType::type < InstanceType::FIRST_NONSTRING_TYPE);
-
-    STRING_TYPE_LIST(TEST_INSTANCE_TYPE)
-#undef TEST_INSTANCE_TYPE
-    return true;
-    default:
-      EXPECT_LE(InstanceType::FIRST_NONSTRING_TYPE, instance_type);
-      return false;
-  }
-}
-
-void CheckOneInstanceType(InstanceType instance_type) {
-  if (IsInStringInstanceTypeList(instance_type)) {
-    EXPECT_TRUE((instance_type & kIsNotStringMask) == kStringTag)
-        << "Failing IsString mask check for " << instance_type;
-  } else {
-    EXPECT_FALSE((instance_type & kIsNotStringMask) == kStringTag)
-        << "Failing !IsString mask check for " << instance_type;
-  }
-}
-
-}  // namespace
-
-TEST(Object, InstanceTypeList) {
-#define TEST_INSTANCE_TYPE(type) CheckOneInstanceType(InstanceType::type);
-
-  INSTANCE_TYPE_LIST(TEST_INSTANCE_TYPE)
-#undef TEST_INSTANCE_TYPE
-}
-
-TEST(Object, InstanceTypeListOrder) {
-  int current = 0;
-  int last = -1;
-  InstanceType current_type = static_cast<InstanceType>(current);
-  EXPECT_EQ(current_type, InstanceType::FIRST_TYPE);
-  EXPECT_EQ(current_type, InstanceType::INTERNALIZED_STRING_TYPE);
-#define TEST_INSTANCE_TYPE(type)                                           \
-  current_type = InstanceType::type;                                       \
-  current = static_cast<int>(current_type);                                \
-  if (current > static_cast<int>(LAST_NAME_TYPE)) {                        \
-    EXPECT_LE(last + 1, current);                                          \
-  }                                                                        \
-  EXPECT_LT(last, current) << " INSTANCE_TYPE_LIST is not ordered: "       \
-                           << "last = " << static_cast<InstanceType>(last) \
-                           << " vs. current = " << current_type;           \
-  last = current;
-
-  INSTANCE_TYPE_LIST(TEST_INSTANCE_TYPE)
-#undef TEST_INSTANCE_TYPE
-}
-
-TEST(Object, StructListOrder) {
-  int current = static_cast<int>(InstanceType::ACCESS_CHECK_INFO_TYPE);
-  int last = current - 1;
-  ASSERT_LT(0, last);
-  InstanceType current_type = static_cast<InstanceType>(current);
-#define TEST_STRUCT(type, class, name)                 \
-  current_type = InstanceType::type##_TYPE;            \
-  current = static_cast<int>(current_type);            \
-  EXPECT_EQ(last + 1, current)                         \
-      << " STRUCT_LIST is not ordered: "               \
-      << " last = " << static_cast<InstanceType>(last) \
-      << " vs. current = " << current_type;            \
-  last = current;
-
-  STRUCT_LIST(TEST_STRUCT)
-#undef TEST_STRUCT
-}
-
-typedef TestWithIsolate ObjectWithIsolate;
-
-TEST_F(ObjectWithIsolate, DictionaryGrowth) {
-  Handle<NumberDictionary> dict = NumberDictionary::New(isolate(), 1);
-  Handle<Object> value = isolate()->factory()->null_value();
-  PropertyDetails details = PropertyDetails::Empty();
-
-  // This test documents the expected growth behavior of a dictionary getting
-  // elements added to it one by one.
-  STATIC_ASSERT(HashTableBase::kMinCapacity == 4);
-  uint32_t i = 1;
-  // 3 elements fit into the initial capacity.
-  for (; i <= 3; i++) {
-    dict = NumberDictionary::Add(dict, i, value, details);
-    CHECK_EQ(4, dict->Capacity());
-  }
-  // 4th element triggers growth.
-  DCHECK_EQ(4, i);
-  for (; i <= 5; i++) {
-    dict = NumberDictionary::Add(dict, i, value, details);
-    CHECK_EQ(8, dict->Capacity());
-  }
-  // 6th element triggers growth.
-  DCHECK_EQ(6, i);
-  for (; i <= 11; i++) {
-    dict = NumberDictionary::Add(dict, i, value, details);
-    CHECK_EQ(16, dict->Capacity());
-  }
-  // 12th element triggers growth.
-  DCHECK_EQ(12, i);
-  for (; i <= 21; i++) {
-    dict = NumberDictionary::Add(dict, i, value, details);
-    CHECK_EQ(32, dict->Capacity());
-  }
-  // 22nd element triggers growth.
-  DCHECK_EQ(22, i);
-  for (; i <= 43; i++) {
-    dict = NumberDictionary::Add(dict, i, value, details);
-    CHECK_EQ(64, dict->Capacity());
-  }
-  // 44th element triggers growth.
-  DCHECK_EQ(44, i);
-  for (; i <= 50; i++) {
-    dict = NumberDictionary::Add(dict, i, value, details);
-    CHECK_EQ(128, dict->Capacity());
-  }
-
-  // If we grow by larger chunks, the next (sufficiently big) power of 2 is
-  // chosen as the capacity.
-  dict = NumberDictionary::New(isolate(), 1);
-  dict = NumberDictionary::EnsureCapacity(dict, 65);
-  CHECK_EQ(128, dict->Capacity());
-
-  dict = NumberDictionary::New(isolate(), 1);
-  dict = NumberDictionary::EnsureCapacity(dict, 30);
-  CHECK_EQ(64, dict->Capacity());
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/unittests/register-configuration-unittest.cc b/src/v8/test/unittests/register-configuration-unittest.cc
deleted file mode 100644
index 0688a5e..0000000
--- a/src/v8/test/unittests/register-configuration-unittest.cc
+++ /dev/null
@@ -1,163 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/register-configuration.h"
-#include "testing/gtest-support.h"
-
-namespace v8 {
-namespace internal {
-
-const MachineRepresentation kFloat32 = MachineRepresentation::kFloat32;
-const MachineRepresentation kFloat64 = MachineRepresentation::kFloat64;
-const MachineRepresentation kSimd128 = MachineRepresentation::kSimd128;
-
-class RegisterConfigurationUnitTest : public ::testing::Test {
- public:
-  RegisterConfigurationUnitTest() {}
-  virtual ~RegisterConfigurationUnitTest() {}
-};
-
-TEST_F(RegisterConfigurationUnitTest, BasicProperties) {
-  const int kNumGeneralRegs = 3;
-  const int kNumDoubleRegs = 4;
-  const int kNumAllocatableGeneralRegs = 2;
-  const int kNumAllocatableDoubleRegs = 2;
-  int general_codes[kNumAllocatableGeneralRegs] = {1, 2};
-  int double_codes[kNumAllocatableDoubleRegs] = {2, 3};
-
-  RegisterConfiguration test(
-      kNumGeneralRegs, kNumDoubleRegs, kNumAllocatableGeneralRegs,
-      kNumAllocatableDoubleRegs, general_codes, double_codes,
-      RegisterConfiguration::OVERLAP, nullptr, nullptr, nullptr, nullptr);
-
-  EXPECT_EQ(test.num_general_registers(), kNumGeneralRegs);
-  EXPECT_EQ(test.num_double_registers(), kNumDoubleRegs);
-  EXPECT_EQ(test.num_allocatable_general_registers(),
-            kNumAllocatableGeneralRegs);
-  EXPECT_EQ(test.num_allocatable_double_registers(), kNumAllocatableDoubleRegs);
-  EXPECT_EQ(test.num_allocatable_float_registers(), kNumAllocatableDoubleRegs);
-  EXPECT_EQ(test.num_allocatable_simd128_registers(),
-            kNumAllocatableDoubleRegs);
-
-  EXPECT_EQ(test.allocatable_general_codes_mask(),
-            (1 << general_codes[0]) | (1 << general_codes[1]));
-  EXPECT_EQ(test.GetAllocatableGeneralCode(0), general_codes[0]);
-  EXPECT_EQ(test.GetAllocatableGeneralCode(1), general_codes[1]);
-  EXPECT_EQ(test.allocatable_double_codes_mask(),
-            (1 << double_codes[0]) | (1 << double_codes[1]));
-  EXPECT_EQ(test.GetAllocatableFloatCode(0), double_codes[0]);
-  EXPECT_EQ(test.GetAllocatableDoubleCode(0), double_codes[0]);
-  EXPECT_EQ(test.GetAllocatableSimd128Code(0), double_codes[0]);
-  EXPECT_EQ(test.GetAllocatableFloatCode(1), double_codes[1]);
-  EXPECT_EQ(test.GetAllocatableDoubleCode(1), double_codes[1]);
-  EXPECT_EQ(test.GetAllocatableSimd128Code(1), double_codes[1]);
-}
-
-TEST_F(RegisterConfigurationUnitTest, CombineAliasing) {
-  const int kNumGeneralRegs = 3;
-  const int kNumDoubleRegs = 4;
-  const int kNumAllocatableGeneralRegs = 2;
-  const int kNumAllocatableDoubleRegs = 3;
-  int general_codes[] = {1, 2};
-  int double_codes[] = {2, 3, 16};  // reg 16 should not alias registers 32, 33.
-
-  RegisterConfiguration test(
-      kNumGeneralRegs, kNumDoubleRegs, kNumAllocatableGeneralRegs,
-      kNumAllocatableDoubleRegs, general_codes, double_codes,
-      RegisterConfiguration::COMBINE, nullptr, nullptr, nullptr, nullptr);
-
-  // There are 3 allocatable double regs, but only 2 can alias float regs.
-  EXPECT_EQ(test.num_allocatable_float_registers(), 4);
-
-  // Test that float registers combine in pairs to form double registers.
-  EXPECT_EQ(test.GetAllocatableFloatCode(0), double_codes[0] * 2);
-  EXPECT_EQ(test.GetAllocatableFloatCode(1), double_codes[0] * 2 + 1);
-  EXPECT_EQ(test.GetAllocatableFloatCode(2), double_codes[1] * 2);
-  EXPECT_EQ(test.GetAllocatableFloatCode(3), double_codes[1] * 2 + 1);
-
-  // There are 3 allocatable double regs, but only 2 pair to form 1 SIMD reg.
-  EXPECT_EQ(test.num_allocatable_simd128_registers(), 1);
-
-  // Test that even-odd pairs of double regs combine to form a SIMD reg.
-  EXPECT_EQ(test.GetAllocatableSimd128Code(0), double_codes[0] / 2);
-
-  // Registers alias themselves.
-  EXPECT_TRUE(test.AreAliases(kFloat32, 0, kFloat32, 0));
-  EXPECT_TRUE(test.AreAliases(kFloat64, 0, kFloat64, 0));
-  EXPECT_TRUE(test.AreAliases(kSimd128, 0, kSimd128, 0));
-  // Registers don't alias other registers of the same size.
-  EXPECT_FALSE(test.AreAliases(kFloat32, 1, kFloat32, 0));
-  EXPECT_FALSE(test.AreAliases(kFloat64, 1, kFloat64, 0));
-  EXPECT_FALSE(test.AreAliases(kSimd128, 1, kSimd128, 0));
-  // Float registers combine in pairs to alias a double with index / 2, and
-  // in 4's to alias a simd128 with index / 4.
-  EXPECT_TRUE(test.AreAliases(kFloat32, 0, kFloat64, 0));
-  EXPECT_TRUE(test.AreAliases(kFloat32, 1, kFloat64, 0));
-  EXPECT_TRUE(test.AreAliases(kFloat32, 0, kSimd128, 0));
-  EXPECT_TRUE(test.AreAliases(kFloat32, 1, kSimd128, 0));
-  EXPECT_TRUE(test.AreAliases(kFloat32, 2, kSimd128, 0));
-  EXPECT_TRUE(test.AreAliases(kFloat32, 3, kSimd128, 0));
-  EXPECT_TRUE(test.AreAliases(kFloat64, 0, kFloat32, 0));
-  EXPECT_TRUE(test.AreAliases(kFloat64, 0, kFloat32, 1));
-  EXPECT_TRUE(test.AreAliases(kSimd128, 0, kFloat32, 0));
-  EXPECT_TRUE(test.AreAliases(kSimd128, 0, kFloat32, 1));
-  EXPECT_TRUE(test.AreAliases(kSimd128, 0, kFloat32, 2));
-  EXPECT_TRUE(test.AreAliases(kSimd128, 0, kFloat32, 3));
-
-  EXPECT_FALSE(test.AreAliases(kFloat32, 0, kFloat64, 1));
-  EXPECT_FALSE(test.AreAliases(kFloat32, 1, kFloat64, 1));
-  EXPECT_FALSE(test.AreAliases(kFloat32, 0, kSimd128, 1));
-  EXPECT_FALSE(test.AreAliases(kFloat32, 1, kSimd128, 1));
-  EXPECT_FALSE(test.AreAliases(kFloat64, 0, kSimd128, 1));
-  EXPECT_FALSE(test.AreAliases(kFloat64, 1, kSimd128, 1));
-
-  EXPECT_TRUE(test.AreAliases(kFloat64, 0, kFloat32, 1));
-  EXPECT_TRUE(test.AreAliases(kFloat64, 1, kFloat32, 2));
-  EXPECT_TRUE(test.AreAliases(kFloat64, 1, kFloat32, 3));
-  EXPECT_TRUE(test.AreAliases(kFloat64, 2, kFloat32, 4));
-  EXPECT_TRUE(test.AreAliases(kFloat64, 2, kFloat32, 5));
-
-  EXPECT_TRUE(test.AreAliases(kSimd128, 0, kFloat64, 1));
-  EXPECT_TRUE(test.AreAliases(kSimd128, 1, kFloat64, 2));
-  EXPECT_TRUE(test.AreAliases(kSimd128, 1, kFloat64, 3));
-  EXPECT_TRUE(test.AreAliases(kSimd128, 2, kFloat64, 4));
-  EXPECT_TRUE(test.AreAliases(kSimd128, 2, kFloat64, 5));
-
-  int alias_base_index = -1;
-  EXPECT_EQ(test.GetAliases(kFloat32, 0, kFloat32, &alias_base_index), 1);
-  EXPECT_EQ(alias_base_index, 0);
-  EXPECT_EQ(test.GetAliases(kFloat64, 1, kFloat64, &alias_base_index), 1);
-  EXPECT_EQ(alias_base_index, 1);
-  EXPECT_EQ(test.GetAliases(kFloat32, 0, kFloat64, &alias_base_index), 1);
-  EXPECT_EQ(alias_base_index, 0);
-  EXPECT_EQ(test.GetAliases(kFloat32, 1, kFloat64, &alias_base_index), 1);
-  EXPECT_EQ(test.GetAliases(kFloat32, 2, kFloat64, &alias_base_index), 1);
-  EXPECT_EQ(alias_base_index, 1);
-  EXPECT_EQ(test.GetAliases(kFloat32, 3, kFloat64, &alias_base_index), 1);
-  EXPECT_EQ(alias_base_index, 1);
-  EXPECT_EQ(test.GetAliases(kFloat64, 0, kFloat32, &alias_base_index), 2);
-  EXPECT_EQ(alias_base_index, 0);
-  EXPECT_EQ(test.GetAliases(kFloat64, 1, kFloat32, &alias_base_index), 2);
-  EXPECT_EQ(alias_base_index, 2);
-
-  // Non-allocatable codes still alias.
-  EXPECT_EQ(test.GetAliases(kFloat64, 2, kFloat32, &alias_base_index), 2);
-  EXPECT_EQ(alias_base_index, 4);
-  // High numbered double and simd regs don't alias nonexistent float registers.
-  EXPECT_EQ(
-      test.GetAliases(kFloat64, RegisterConfiguration::kMaxFPRegisters / 2,
-                      kFloat32, &alias_base_index),
-      0);
-  EXPECT_EQ(
-      test.GetAliases(kFloat64, RegisterConfiguration::kMaxFPRegisters / 2 + 1,
-                      kFloat32, &alias_base_index),
-      0);
-  EXPECT_EQ(
-      test.GetAliases(kFloat64, RegisterConfiguration::kMaxFPRegisters - 1,
-                      kFloat32, &alias_base_index),
-      0);
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/unittests/source-position-table-unittest.cc b/src/v8/test/unittests/source-position-table-unittest.cc
deleted file mode 100644
index 1ad6dec..0000000
--- a/src/v8/test/unittests/source-position-table-unittest.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/v8.h"
-
-#include "src/objects.h"
-#include "src/source-position-table.h"
-#include "test/unittests/test-utils.h"
-
-namespace v8 {
-namespace internal {
-namespace interpreter {
-
-class SourcePositionTableTest : public TestWithIsolate {
- public:
-  SourcePositionTableTest() {}
-  ~SourcePositionTableTest() override {}
-
-  SourcePosition toPos(int offset) {
-    return SourcePosition(offset, offset % 10 - 1);
-  }
-};
-
-// Some random offsets, mostly at 'suspicious' bit boundaries.
-static int offsets[] = {0,   1,   2,    3,    4,     30,      31,  32,
-                        33,  62,  63,   64,   65,    126,     127, 128,
-                        129, 250, 1000, 9999, 12000, 31415926};
-
-TEST_F(SourcePositionTableTest, EncodeStatement) {
-  SourcePositionTableBuilder builder;
-  for (size_t i = 0; i < arraysize(offsets); i++) {
-    builder.AddPosition(offsets[i], toPos(offsets[i]), true);
-  }
-
-  // To test correctness, we rely on the assertions in ToSourcePositionTable().
-  // (Also below.)
-  CHECK(!builder.ToSourcePositionTable(isolate()).is_null());
-}
-
-TEST_F(SourcePositionTableTest, EncodeStatementDuplicates) {
-  SourcePositionTableBuilder builder;
-  for (size_t i = 0; i < arraysize(offsets); i++) {
-    builder.AddPosition(offsets[i], toPos(offsets[i]), true);
-    builder.AddPosition(offsets[i], toPos(offsets[i] + 1), true);
-  }
-
-  // To test correctness, we rely on the assertions in ToSourcePositionTable().
-  // (Also below.)
-  CHECK(!builder.ToSourcePositionTable(isolate()).is_null());
-}
-
-TEST_F(SourcePositionTableTest, EncodeExpression) {
-  SourcePositionTableBuilder builder;
-  for (size_t i = 0; i < arraysize(offsets); i++) {
-    builder.AddPosition(offsets[i], toPos(offsets[i]), false);
-  }
-  CHECK(!builder.ToSourcePositionTable(isolate()).is_null());
-}
-
-TEST_F(SourcePositionTableTest, EncodeAscending) {
-  SourcePositionTableBuilder builder;
-
-  int code_offset = 0;
-  int source_position = 0;
-  for (size_t i = 0; i < arraysize(offsets); i++) {
-    code_offset += offsets[i];
-    source_position += offsets[i];
-    if (i % 2) {
-      builder.AddPosition(code_offset, toPos(source_position), true);
-    } else {
-      builder.AddPosition(code_offset, toPos(source_position), false);
-    }
-  }
-
-  // Also test negative offsets for source positions:
-  for (size_t i = 0; i < arraysize(offsets); i++) {
-    code_offset += offsets[i];
-    source_position -= offsets[i];
-    if (i % 2) {
-      builder.AddPosition(code_offset, toPos(source_position), true);
-    } else {
-      builder.AddPosition(code_offset, toPos(source_position), false);
-    }
-  }
-
-  CHECK(!builder.ToSourcePositionTable(isolate()).is_null());
-}
-
-}  // namespace interpreter
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/unittests/unicode-unittest.cc b/src/v8/test/unittests/unicode-unittest.cc
deleted file mode 100644
index e5ccaca..0000000
--- a/src/v8/test/unittests/unicode-unittest.cc
+++ /dev/null
@@ -1,444 +0,0 @@
-// Copyright 2016 the V8 project 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 <memory>
-#include <string>
-#include <vector>
-
-#include "src/unicode-decoder.h"
-#include "src/unicode-inl.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace v8 {
-namespace internal {
-
-namespace {
-
-using Utf8Decoder = unibrow::Utf8Decoder<512>;
-
-void Decode(Utf8Decoder* decoder, const std::string& str) {
-  // Put the string in its own buffer on the heap to make sure that
-  // AddressSanitizer's heap-buffer-overflow logic can see what's going on.
-  std::unique_ptr<char[]> buffer(new char[str.length()]);
-  memcpy(buffer.get(), str.data(), str.length());
-  decoder->Reset(buffer.get(), str.length());
-}
-
-void DecodeNormally(const std::vector<byte>& bytes,
-                    std::vector<unibrow::uchar>* output) {
-  size_t cursor = 0;
-  while (cursor < bytes.size()) {
-    output->push_back(
-        unibrow::Utf8::ValueOf(bytes.data() + cursor, bytes.size(), &cursor));
-  }
-}
-
-void DecodeIncrementally(const std::vector<byte>& bytes,
-                         std::vector<unibrow::uchar>* output) {
-  unibrow::Utf8::Utf8IncrementalBuffer buffer = 0;
-  unibrow::Utf8::State state = unibrow::Utf8::State::kAccept;
-  for (size_t i = 0; i < bytes.size();) {
-    unibrow::uchar result =
-        unibrow::Utf8::ValueOfIncremental(bytes[i], &i, &state, &buffer);
-    if (result != unibrow::Utf8::kIncomplete) {
-      output->push_back(result);
-    }
-  }
-  unibrow::uchar result = unibrow::Utf8::ValueOfIncrementalFinish(&state);
-  if (result != unibrow::Utf8::kBufferEmpty) {
-    output->push_back(result);
-  }
-}
-
-}  // namespace
-
-TEST(UnicodeTest, ReadOffEndOfUtf8String) {
-  Utf8Decoder decoder;
-
-  // Not enough continuation bytes before string ends.
-  Decode(&decoder, "\xE0");
-  Decode(&decoder, "\xED");
-  Decode(&decoder, "\xF0");
-  Decode(&decoder, "\xF4");
-}
-
-TEST(UnicodeTest, IncrementalUTF8DecodingVsNonIncrementalUtf8Decoding) {
-  // Unfortunately, V8 has two UTF-8 decoders. This test checks that they
-  // produce the same result. This test was inspired by
-  // https://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt .
-  typedef struct {
-    std::vector<byte> bytes;
-    std::vector<unibrow::uchar> unicode_expected;
-  } TestCase;
-
-  TestCase data[] = {
-      // Correct UTF-8 text.
-      {{0xCE, 0xBA, 0xE1, 0xBD, 0xB9, 0xCF, 0x83, 0xCE, 0xBC, 0xCE, 0xB5},
-       {0x3BA, 0x1F79, 0x3C3, 0x3BC, 0x3B5}},
-
-      // First possible sequence of a certain length:
-      // 1 byte
-      {{0x00}, {0x0}},
-      // 2 bytes
-      {{0xC2, 0x80}, {0x80}},
-      // 3 bytes
-      {{0xE0, 0xA0, 0x80}, {0x800}},
-      // 4 bytes
-      {{0xF0, 0x90, 0x80, 0x80}, {0x10000}},
-      // 5 bytes (not supported)
-      {{0xF8, 0x88, 0x80, 0x80, 0x80},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      // 6 bytes (not supported)
-      {{0xFC, 0x84, 0x80, 0x80, 0x80, 0x80},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-
-      // Last possible sequence of certain length:
-      // 1 byte
-      {{0x7F}, {0x7F}},
-      // 2 bytes
-      {{0xDF, 0xBF}, {0x7FF}},
-      // 3 bytes
-      {{0xEF, 0xBF, 0xBF}, {0xFFFF}},
-      // 4 bytes (this sequence is not a valid code point)
-      {{0xF7, 0xBF, 0xBF, 0xBF}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      // 5 bytes (not supported)
-      {{0xFB, 0xBF, 0xBF, 0xBF, 0xBF},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      // 6 bytes (not supported)
-      {{0xFD, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      // Other boundary conditions:
-      {{0xED, 0x9F, 0xBF}, {0xD7FF}},
-      {{0xEE, 0x80, 0x80}, {0xE000}},
-      // U+fffd (invalid code point)
-      {{0xEF, 0xBF, 0xBD}, {0xFFFD}},
-      // U+10ffff (last valid code point)
-      {{0xF4, 0x8F, 0xBF, 0xBF}, {0x10FFFF}},
-      // First invalid (too large) code point
-      {{0xF4, 0x90, 0x80, 0x80}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-
-      // Malformed sequences:
-      // Unexpected continuation bytes:
-      // First continuation byte
-      {{0x80}, {0xFFFD}},
-      // Last continuation byte
-      {{0xBF}, {0xFFFD}},
-      // 2 continuation bytes
-      {{0x80, 0xBF}, {0xFFFD, 0xFFFD}},
-      // 3 continuation bytes
-      {{0x80, 0xBF, 0x80}, {0xFFFD, 0xFFFD, 0xFFFD}},
-      // 4 continuation bytes
-      {{0x80, 0xBF, 0x80, 0xBF}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      // 5 continuation bytes
-      {{0x80, 0xBF, 0x80, 0xBF, 0x80},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      // 6 continuation bytes
-      {{0x80, 0xBF, 0x80, 0xBF, 0x80, 0xBF},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      // 7 continuation bytes
-      {{0x80, 0xBF, 0x80, 0xBF, 0x80, 0xBF, 0xBF},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      // Sequence of all 64 possible continuation bytes
-      {{0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A,
-        0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95,
-        0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, 0xA0,
-        0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB,
-        0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6,
-        0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
-        0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
-        0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
-        0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
-        0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
-        0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
-        0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
-        0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      // Using each possible continuation byte in a two-byte sequence:
-      {{0xD0, 0x80, 0xD0, 0x81, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0x84, 0xD0, 0x85,
-        0xD0, 0x86, 0xD0, 0x87, 0xD0, 0x88, 0xD0, 0x89, 0xD0, 0x8A, 0xD0, 0x8B,
-        0xD0, 0x8C, 0xD0, 0x8D, 0xD0, 0x8E, 0xD0, 0x8F, 0xD0, 0x90, 0xD0, 0x91,
-        0xD0, 0x92, 0xD0, 0x93, 0xD0, 0x94, 0xD0, 0x95, 0xD0, 0x96, 0xD0, 0x97,
-        0xD0, 0x98, 0xD0, 0x99, 0xD0, 0x9A, 0xD0, 0x9B, 0xD0, 0x9C, 0xD0, 0x9D,
-        0xD0, 0x9E, 0xD0, 0x9F, 0xD0, 0xA0, 0xD0, 0xA1, 0xD0, 0xA2, 0xD0, 0xA3,
-        0xD0, 0xA4, 0xD0, 0xA5, 0xD0, 0xA6, 0xD0, 0xA7, 0xD0, 0xA8, 0xD0, 0xA9,
-        0xD0, 0xAA, 0xD0, 0xAB, 0xD0, 0xAC, 0xD0, 0xAD, 0xD0, 0xAE, 0xD0, 0xAF,
-        0xD0, 0xB0, 0xD0, 0xB1, 0xD0, 0xB2, 0xD0, 0xB3, 0xD0, 0xB4, 0xD0, 0xB5,
-        0xD0, 0xB6, 0xD0, 0xB7, 0xD0, 0xB8, 0xD0, 0xB9, 0xD0, 0xBA, 0xD0, 0xBB,
-        0xD0, 0xBC, 0xD0, 0xBD, 0xD0, 0xBE, 0xD0, 0xBF},
-       {0x400, 0x401, 0x402, 0x403, 0x404, 0x405, 0x406, 0x407, 0x408, 0x409,
-        0x40A, 0x40B, 0x40C, 0x40D, 0x40E, 0x40F, 0x410, 0x411, 0x412, 0x413,
-        0x414, 0x415, 0x416, 0x417, 0x418, 0x419, 0x41A, 0x41B, 0x41C, 0x41D,
-        0x41E, 0x41F, 0x420, 0x421, 0x422, 0x423, 0x424, 0x425, 0x426, 0x427,
-        0x428, 0x429, 0x42A, 0x42B, 0x42C, 0x42D, 0x42E, 0x42F, 0x430, 0x431,
-        0x432, 0x433, 0x434, 0x435, 0x436, 0x437, 0x438, 0x439, 0x43A, 0x43B,
-        0x43C, 0x43D, 0x43E, 0x43F}},
-
-      // Lonely first bytes:
-      // All 32 first bytes of 32-byte sequences, each followed by a space
-      // (generates 32 invalid char + space sequences.
-      {{0xC0, 0x20, 0xC1, 0x20, 0xC2, 0x20, 0xC3, 0x20, 0xC4, 0x20, 0xC5,
-        0x20, 0xC6, 0x20, 0xC7, 0x20, 0xC8, 0x20, 0xC9, 0x20, 0xCA, 0x20,
-        0xCB, 0x20, 0xCC, 0x20, 0xCD, 0x20, 0xCE, 0x20, 0xCF, 0x20, 0xD0,
-        0x20, 0xD1, 0x20, 0xD2, 0x20, 0xD3, 0x20, 0xD4, 0x20, 0xD5, 0x20,
-        0xD6, 0x20, 0xD7, 0x20, 0xD8, 0x20, 0xD9, 0x20, 0xDA, 0x20, 0xDB,
-        0x20, 0xDC, 0x20, 0xDD, 0x20, 0xDE, 0x20, 0xDF, 0x20},
-       {0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20,
-        0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20,
-        0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20,
-        0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20,
-        0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20,
-        0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20,
-        0xFFFD, 0x20, 0xFFFD, 0x20}},
-      // All 16 first bytes of 3-byte sequences, each followed by a space
-      // (generates 16 invalid char + space sequences):
-      {{0xE0, 0x20, 0xE1, 0x20, 0xE2, 0x20, 0xE3, 0x20, 0xE4, 0x20, 0xE5,
-        0x20, 0xE6, 0x20, 0xE7, 0x20, 0xE8, 0x20, 0xE9, 0x20, 0xEA, 0x20,
-        0xEB, 0x20, 0xEC, 0x20, 0xED, 0x20, 0xEE, 0x20, 0xEF, 0x20},
-       {0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20,
-        0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20,
-        0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20,
-        0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20}},
-      // All 8 first bytes of 4-byte sequences, each followed by a space
-      // (generates 8 invalid char + space sequences):
-      {{0xF0, 0x20, 0xF1, 0x20, 0xF2, 0x20, 0xF3, 0x20, 0xF4, 0x20, 0xF5, 0x20,
-        0xF6, 0x20, 0xF7, 0x20},
-       {0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20,
-        0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20}},
-      // All 4 first bytes of 5-byte sequences (not supported), each followed by
-      // a space (generates 4 invalid char + space sequences):
-      {{0xF8, 0x20, 0xF9, 0x20, 0xFA, 0x20, 0xFB, 0x20},
-       {0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20, 0xFFFD, 0x20}},
-      // All 2 first bytes of 6-byte sequences (not supported), each followed by
-      // a space (generates 2 invalid char + space sequences):
-      {{0xFC, 0x20, 0xFD, 0x20}, {0xFFFD, 0x20, 0xFFFD, 0x20}},
-
-      // Sequences with last continuation byte missing. Normally the whole
-      // incomplete sequence generates a single invalid character (exceptions
-      // explained below).
-
-      // 2-byte sequences with last byte missing
-      {{0xC0}, {0xFFFD}},
-      {{0xDF}, {0xFFFD}},
-      // 3-byte sequences with last byte missing.
-      {{0xE8, 0x80}, {0xFFFD}},
-      {{0xE0, 0xBF}, {0xFFFD}},
-      {{0xEF, 0xBF}, {0xFFFD}},
-      // Start of an overlong sequence. The first "maximal subpart" is the first
-      // byte; it creates an invalid character. Each following byte generates an
-      // invalid character too.
-      {{0xE0, 0x80}, {0xFFFD, 0xFFFD}},
-      // 4-byte sequences with last byte missing
-      {{0xF1, 0x80, 0x80}, {0xFFFD}},
-      {{0xF4, 0x8F, 0xBF}, {0xFFFD}},
-      // Start of an overlong sequence. The first "maximal subpart" is the first
-      // byte; it creates an invalid character. Each following byte generates an
-      // invalid character too.
-      {{0xF0, 0x80, 0x80}, {0xFFFD, 0xFFFD, 0xFFFD}},
-      // 5-byte sequences (not supported) with last byte missing
-      {{0xF8, 0x80, 0x80, 0x80}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xFB, 0xBF, 0xBF, 0xBF}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      // 6-byte sequences (not supported) with last byte missing
-      {{0xFC, 0x80, 0x80, 0x80, 0x80},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xFD, 0xBF, 0xBF, 0xBF, 0xBF},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-
-      // Concatenation of incomplete sequences: above incomplete sequences
-      // concatenated.
-      {{0xC0, 0xDF, 0xE8, 0x80, 0xE0, 0xBF, 0xEF, 0xBF, 0xE0, 0x80,
-        0xF1, 0x80, 0x80, 0xF4, 0x8F, 0xBF, 0xF0, 0x80, 0x80, 0xF8,
-        0x80, 0x80, 0x80, 0xFB, 0xBF, 0xBF, 0xBF, 0xFC, 0x80, 0x80,
-        0x80, 0x80, 0xFD, 0xBF, 0xBF, 0xBF, 0xBF},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
-        0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
-        0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
-        0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-
-      // Incomplete sequence tests repeated with a space after the incomplete
-      // sequence.
-
-      // 2-byte sequences with last byte missing
-      {{0xC0, 0x20}, {0xFFFD, 0x20}},
-      {{0xDF, 0x20}, {0xFFFD, 0x20}},
-      // 3-byte sequences with last byte missing
-      {{0xE8, 0x80, 0x20}, {0xFFFD, 0x20}},
-      {{0xE0, 0xBF, 0x20}, {0xFFFD, 0x20}},
-      {{0xEF, 0xBF, 0x20}, {0xFFFD, 0x20}},
-      // Start of overlong 3-byte sequence with last byte missing
-      {{0xE0, 0x80, 0x20}, {0xFFFD, 0xFFFD, 0x20}},
-      // 4-byte sequences with last byte missing
-      {{0xF1, 0x80, 0x80, 0x20}, {0xFFFD, 0x20}},
-      {{0xF4, 0x8F, 0xBF, 0x20}, {0xFFFD, 0x20}},
-      // Start of overlong 4-byte sequence with last byte missing
-      {{0xF0, 0x80, 0x80, 0x20}, {0xFFFD, 0xFFFD, 0xFFFD, 0x20}},
-      // 5-byte sequences (not supported) with last byte missing
-      {{0xF8, 0x80, 0x80, 0x80, 0x20}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x20}},
-      {{0xFB, 0xBF, 0xBF, 0xBF, 0x20}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x20}},
-      // 6-byte sequences (not supported) with last byte missing
-      {{0xFC, 0x80, 0x80, 0x80, 0x80, 0x20},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x20}},
-      {{0xFD, 0xBF, 0xBF, 0xBF, 0xBF, 0x20},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x20}},
-
-      // Impossible bytes
-      {{0xFE}, {0xFFFD}},
-      {{0xFF}, {0xFFFD}},
-      {{0xFE, 0xFE, 0xFF, 0xFF}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      // Lead-byte-like bytes which aren't valid lead bytes.
-      {{0xC0}, {0xFFFD}},
-      {{0xC0, 0xAA}, {0xFFFD, 0xFFFD}},
-      {{0xC1}, {0xFFFD}},
-      {{0xC1, 0xAA}, {0xFFFD, 0xFFFD}},
-      {{0xF5}, {0xFFFD}},
-      {{0xF5, 0xAA, 0xAA, 0xAA}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xF6}, {0xFFFD}},
-      {{0xF6, 0xAA, 0xAA, 0xAA}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xF7}, {0xFFFD}},
-      {{0xF7, 0xAA, 0xAA, 0xAA}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xF8}, {0xFFFD}},
-      {{0xF8, 0xAA, 0xAA, 0xAA}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xF9}, {0xFFFD}},
-      {{0xF9, 0xAA, 0xAA, 0xAA}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xFA}, {0xFFFD}},
-      {{0xFA, 0xAA, 0xAA, 0xAA}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xFB}, {0xFFFD}},
-      {{0xFB, 0xAA, 0xAA, 0xAA}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xFC}, {0xFFFD}},
-      {{0xFC, 0xAA, 0xAA, 0xAA}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xFD}, {0xFFFD}},
-      {{0xFD, 0xAA, 0xAA, 0xAA}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xFE}, {0xFFFD}},
-      {{0xFE, 0xAA, 0xAA, 0xAA}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xFF}, {0xFFFD}},
-      {{0xFF, 0xAA, 0xAA, 0xAA}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-
-      // Overlong sequences:
-
-      // Overlong encodings for "/"
-      {{0xC0, 0xAF}, {0xFFFD, 0xFFFD}},
-      {{0xE0, 0x80, 0xAF}, {0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xF0, 0x80, 0x80, 0xAF}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      // 5-byte sequence (not supported anyway)
-      {{0xF8, 0x80, 0x80, 0x80, 0xAF},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      // 6-byte sequence (not supported anyway)
-      {{0xFC, 0x80, 0x80, 0x80, 0x80, 0xAF},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-
-      // Maximum overlong sequences
-      {{0xC1, 0xBF}, {0xFFFD, 0xFFFD}},
-      {{0xE0, 0x9F, 0xBF}, {0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xF0, 0x8F, 0xBF, 0xBF}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      // 5-byte sequence (not supported anyway)
-      {{0xF8, 0x87, 0xBF, 0xBF, 0xBF},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      // 6-byte sequence (not supported anyway)
-      {{0xFC, 0x83, 0xBF, 0xBF, 0xBF, 0xBF},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-
-      // Overlong encodings for 0
-      {{0xC0, 0x80}, {0xFFFD, 0xFFFD}},
-      {{0xE0, 0x80, 0x80}, {0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xF0, 0x80, 0x80, 0x80}, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      // 5-byte sequence (not supported anyway)
-      {{0xF8, 0x80, 0x80, 0x80, 0x80},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      // 6-byte sequence (not supported anyway)
-      {{0xFC, 0x80, 0x80, 0x80, 0x80, 0x80},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-
-      // Illegal code positions:
-
-      // Single UTF-16 surrogates
-      {{0xED, 0xA0, 0x80}, {0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xED, 0xA0, 0x80}, {0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xED, 0xAD, 0xBF}, {0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xED, 0xAE, 0x80}, {0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xED, 0xAF, 0xBF}, {0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xED, 0xB0, 0x80}, {0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xED, 0xBE, 0x80}, {0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xED, 0xBF, 0xBF}, {0xFFFD, 0xFFFD, 0xFFFD}},
-
-      // Paired surrogates
-      {{0xED, 0xA0, 0x80, 0xED, 0xB0, 0x80},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xED, 0xA0, 0x80, 0xED, 0xBF, 0xBF},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xED, 0xAD, 0xBF, 0xED, 0xB0, 0x80},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xED, 0xAD, 0xBF, 0xED, 0xBF, 0xBF},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xED, 0xAE, 0x80, 0xED, 0xB0, 0x80},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xED, 0xAE, 0x80, 0xED, 0xBF, 0xBF},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xED, 0xAF, 0xBF, 0xED, 0xB0, 0x80},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-      {{0xED, 0xAF, 0xBF, 0xED, 0xBF, 0xBF},
-       {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD}},
-
-      // Surrogates with the last byte missing.
-      {{0xED, 0xA0}, {0xFFFD, 0xFFFD}},
-      {{0xED, 0xA0}, {0xFFFD, 0xFFFD}},
-      {{0xED, 0xAD}, {0xFFFD, 0xFFFD}},
-      {{0xED, 0xAE}, {0xFFFD, 0xFFFD}},
-      {{0xED, 0xAF}, {0xFFFD, 0xFFFD}},
-      {{0xED, 0xB0}, {0xFFFD, 0xFFFD}},
-      {{0xED, 0xBE}, {0xFFFD, 0xFFFD}},
-      {{0xED, 0xBF}, {0xFFFD, 0xFFFD}},
-
-      // Other non-characters
-      {{0xEF, 0xBF, 0xBE}, {0xFFFE}},
-      {{0xEF, 0xBF, 0xBF}, {0xFFFF}},
-      {{0xEF, 0xB7, 0x90, 0xEF, 0xB7, 0x91, 0xEF, 0xB7, 0x92, 0xEF, 0xB7, 0x93,
-        0xEF, 0xB7, 0x94, 0xEF, 0xB7, 0x95, 0xEF, 0xB7, 0x96, 0xEF, 0xB7, 0x97,
-        0xEF, 0xB7, 0x98, 0xEF, 0xB7, 0x99, 0xEF, 0xB7, 0x9A, 0xEF, 0xB7, 0x9B,
-        0xEF, 0xB7, 0x9C, 0xEF, 0xB7, 0x9D, 0xEF, 0xB7, 0x9E, 0xEF, 0xB7, 0x9F,
-        0xEF, 0xB7, 0xA0, 0xEF, 0xB7, 0xA1, 0xEF, 0xB7, 0xA2, 0xEF, 0xB7, 0xA3,
-        0xEF, 0xB7, 0xA4, 0xEF, 0xB7, 0xA5, 0xEF, 0xB7, 0xA6, 0xEF, 0xB7, 0xA7,
-        0xEF, 0xB7, 0xA8, 0xEF, 0xB7, 0xA9, 0xEF, 0xB7, 0xAA, 0xEF, 0xB7, 0xAB,
-        0xEF, 0xB7, 0xAC, 0xEF, 0xB7, 0xAD, 0xEF, 0xB7, 0xAE, 0xEF, 0xB7, 0xAF},
-       {0xFDD0, 0xFDD1, 0xFDD2, 0xFDD3, 0xFDD4, 0xFDD5, 0xFDD6, 0xFDD7,
-        0xFDD8, 0xFDD9, 0xFDDA, 0xFDDB, 0xFDDC, 0xFDDD, 0xFDDE, 0xFDDF,
-        0xFDE0, 0xFDE1, 0xFDE2, 0xFDE3, 0xFDE4, 0xFDE5, 0xFDE6, 0xFDE7,
-        0xFDE8, 0xFDE9, 0xFDEA, 0xFDEB, 0xFDEC, 0xFDED, 0xFDEE, 0xFDEF}},
-      {{0xF0, 0x9F, 0xBF, 0xBE, 0xF0, 0x9F, 0xBF, 0xBF, 0xF0, 0xAF, 0xBF,
-        0xBE, 0xF0, 0xAF, 0xBF, 0xBF, 0xF0, 0xBF, 0xBF, 0xBE, 0xF0, 0xBF,
-        0xBF, 0xBF, 0xF1, 0x8F, 0xBF, 0xBE, 0xF1, 0x8F, 0xBF, 0xBF, 0xF1,
-        0x9F, 0xBF, 0xBE, 0xF1, 0x9F, 0xBF, 0xBF, 0xF1, 0xAF, 0xBF, 0xBE,
-        0xF1, 0xAF, 0xBF, 0xBF, 0xF1, 0xBF, 0xBF, 0xBE, 0xF1, 0xBF, 0xBF,
-        0xBF, 0xF2, 0x8F, 0xBF, 0xBE, 0xF2, 0x8F, 0xBF, 0xBF},
-       {0x1FFFE, 0x1FFFF, 0x2FFFE, 0x2FFFF, 0x3FFFE, 0x3FFFF, 0x4FFFE, 0x4FFFF,
-        0x5FFFE, 0x5FFFF, 0x6FFFE, 0x6FFFF, 0x7FFFE, 0x7FFFF, 0x8FFFE,
-        0x8FFFF}},
-  };
-
-  for (auto test : data) {
-    // For figuring out which test fails:
-    fprintf(stderr, "test: ");
-    for (auto b : test.bytes) {
-      fprintf(stderr, "%x ", b);
-    }
-    fprintf(stderr, "\n");
-
-    std::vector<unibrow::uchar> output_normal;
-    DecodeNormally(test.bytes, &output_normal);
-
-    CHECK_EQ(output_normal.size(), test.unicode_expected.size());
-    for (size_t i = 0; i < output_normal.size(); ++i) {
-      CHECK_EQ(output_normal[i], test.unicode_expected[i]);
-    }
-
-    std::vector<unibrow::uchar> output_incremental;
-    DecodeIncrementally(test.bytes, &output_incremental);
-
-    CHECK_EQ(output_incremental.size(), test.unicode_expected.size());
-    for (size_t i = 0; i < output_incremental.size(); ++i) {
-      CHECK_EQ(output_incremental[i], test.unicode_expected[i]);
-    }
-  }
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/unittests/unittests.gyp b/src/v8/test/unittests/unittests.gyp
deleted file mode 100644
index 50e820e..0000000
--- a/src/v8/test/unittests/unittests.gyp
+++ /dev/null
@@ -1,305 +0,0 @@
-# Copyright 2014 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# The sources are kept automatically in sync with BUILD.gn.
-
-{
-  'variables': {
-    'v8_code': 1,
-    'unittests_sources': [  ### gcmole(all) ###
-      'allocation-unittest.cc',
-      'api/access-check-unittest.cc',
-      'api/exception-unittest.cc',
-      'api/interceptor-unittest.cc',
-      'api/isolate-unittest.cc',
-      'api/remote-object-unittest.cc',
-      'api/v8-object-unittest.cc',
-      'asmjs/asm-scanner-unittest.cc',
-      'asmjs/asm-types-unittest.cc',
-      'asmjs/switch-logic-unittest.cc',
-      'base/atomic-utils-unittest.cc',
-      'base/bits-unittest.cc',
-      'base/cpu-unittest.cc',
-      'base/division-by-constant-unittest.cc',
-      'base/flags-unittest.cc',
-      'base/functional-unittest.cc',
-      'base/ieee754-unittest.cc',
-      'base/logging-unittest.cc',
-      'base/macros-unittest.cc',
-      'base/iterator-unittest.cc',
-      'base/ostreams-unittest.cc',
-      'base/platform/condition-variable-unittest.cc',
-      'base/platform/mutex-unittest.cc',
-      'base/platform/platform-unittest.cc',
-      'base/platform/semaphore-unittest.cc',
-      'base/platform/time-unittest.cc',
-      'base/sys-info-unittest.cc',
-      'base/template-utils-unittest.cc',
-      'base/utils/random-number-generator-unittest.cc',
-      'bigint-unittest.cc',
-      'cancelable-tasks-unittest.cc',
-      'char-predicates-unittest.cc',
-      "code-stub-assembler-unittest.cc",
-      "code-stub-assembler-unittest.h",
-      'compiler/branch-elimination-unittest.cc',
-      'compiler/bytecode-analysis-unittest.cc',
-      'compiler/checkpoint-elimination-unittest.cc',
-      "compiler/code-assembler-unittest.cc",
-      "compiler/code-assembler-unittest.h",
-      'compiler/common-operator-reducer-unittest.cc',
-      'compiler/common-operator-unittest.cc',
-      'compiler/compiler-test-utils.h',
-      'compiler/control-equivalence-unittest.cc',
-      'compiler/control-flow-optimizer-unittest.cc',
-      'compiler/dead-code-elimination-unittest.cc',
-      'compiler/diamond-unittest.cc',
-      'compiler/effect-control-linearizer-unittest.cc',
-      'compiler/graph-reducer-unittest.cc',
-      'compiler/graph-reducer-unittest.h',
-      'compiler/graph-trimmer-unittest.cc',
-      'compiler/graph-unittest.cc',
-      'compiler/graph-unittest.h',
-      'compiler/instruction-unittest.cc',
-      'compiler/instruction-selector-unittest.cc',
-      'compiler/instruction-selector-unittest.h',
-      'compiler/instruction-sequence-unittest.cc',
-      'compiler/instruction-sequence-unittest.h',
-      'compiler/int64-lowering-unittest.cc',
-      'compiler/js-builtin-reducer-unittest.cc',
-      'compiler/js-create-lowering-unittest.cc',
-      'compiler/js-intrinsic-lowering-unittest.cc',
-      'compiler/js-operator-unittest.cc',
-      'compiler/js-typed-lowering-unittest.cc',
-      'compiler/linkage-tail-call-unittest.cc',
-      'compiler/live-range-builder.h',
-      'compiler/regalloc/live-range-unittest.cc',
-      'compiler/load-elimination-unittest.cc',
-      'compiler/loop-peeling-unittest.cc',
-      'compiler/machine-operator-reducer-unittest.cc',
-      'compiler/machine-operator-unittest.cc',
-      'compiler/regalloc/move-optimizer-unittest.cc',
-      'compiler/node-cache-unittest.cc',
-      'compiler/node-matchers-unittest.cc',
-      'compiler/node-properties-unittest.cc',
-      'compiler/node-test-utils.cc',
-      'compiler/node-test-utils.h',
-      'compiler/node-unittest.cc',
-      'compiler/opcodes-unittest.cc',
-      'compiler/persistent-unittest.cc',
-      'compiler/regalloc/register-allocator-unittest.cc',
-      'compiler/schedule-unittest.cc',
-      'compiler/scheduler-unittest.cc',
-      'compiler/scheduler-rpo-unittest.cc',
-      'compiler/simplified-lowering-unittest.cc',
-      'compiler/simplified-operator-reducer-unittest.cc',
-      'compiler/simplified-operator-unittest.cc',
-      'compiler/state-values-utils-unittest.cc',
-      'compiler/typed-optimization-unittest.cc',
-      'compiler/typer-unittest.cc',
-      'compiler/value-numbering-reducer-unittest.cc',
-      'compiler/zone-stats-unittest.cc',
-      'compiler-dispatcher/compiler-dispatcher-tracer-unittest.cc',
-      'compiler-dispatcher/compiler-dispatcher-unittest.cc',
-      'compiler-dispatcher/optimizing-compile-dispatcher-unittest.cc',
-      'compiler-dispatcher/unoptimized-compile-job-unittest.cc',
-      'counters-unittest.cc',
-      'detachable-vector-unittest.cc',
-      'eh-frame-iterator-unittest.cc',
-      'eh-frame-writer-unittest.cc',
-      'heap/barrier-unittest.cc',
-      'heap/bitmap-unittest.cc',
-      'heap/embedder-tracing-unittest.cc',
-      'heap/gc-idle-time-handler-unittest.cc',
-      'heap/gc-tracer-unittest.cc',
-      'heap/item-parallel-job-unittest.cc',
-      'heap/marking-unittest.cc',
-      'heap/memory-reducer-unittest.cc',
-      'heap/heap-unittest.cc',
-      'heap/scavenge-job-unittest.cc',
-      'heap/slot-set-unittest.cc',
-      'heap/spaces-unittest.cc',
-      'heap/unmapper-unittest.cc',
-      'heap/worklist-unittest.cc',
-      'interpreter/bytecodes-unittest.cc',
-      'interpreter/bytecode-array-builder-unittest.cc',
-      'interpreter/bytecode-array-iterator-unittest.cc',
-      'interpreter/bytecode-array-random-iterator-unittest.cc',
-      'interpreter/bytecode-array-writer-unittest.cc',
-      'interpreter/bytecode-decoder-unittest.cc',
-      'interpreter/bytecode-node-unittest.cc',
-      'interpreter/bytecode-operands-unittest.cc',
-      'interpreter/bytecode-register-allocator-unittest.cc',
-      'interpreter/bytecode-register-optimizer-unittest.cc',
-      'interpreter/bytecode-source-info-unittest.cc',
-      'interpreter/bytecode-utils.h',
-      'interpreter/constant-array-builder-unittest.cc',
-      'interpreter/interpreter-assembler-unittest.cc',
-      'interpreter/interpreter-assembler-unittest.h',
-      'libplatform/default-platform-unittest.cc',
-      'libplatform/task-queue-unittest.cc',
-      'libplatform/worker-thread-unittest.cc',
-      'locked-queue-unittest.cc',
-      'object-unittest.cc',
-      'parser/ast-value-unittest.cc',
-      'parser/preparser-unittest.cc',
-      'register-configuration-unittest.cc',
-      'run-all-unittests.cc',
-      'source-position-table-unittest.cc',
-      'test-helpers.cc',
-      'test-helpers.h',
-      'test-utils.h',
-      'test-utils.cc',
-      'unicode-unittest.cc',
-      'utils-unittest.cc',
-      'value-serializer-unittest.cc',
-      'zone/segmentpool-unittest.cc',
-      'zone/zone-allocator-unittest.cc',
-      'zone/zone-chunk-list-unittest.cc',
-      'zone/zone-unittest.cc',
-      'wasm/control-transfer-unittest.cc',
-      'wasm/decoder-unittest.cc',
-      'wasm/function-body-decoder-unittest.cc',
-      'wasm/wasm-code-manager-unittest.cc',
-      'wasm/leb-helper-unittest.cc',
-      'wasm/loop-assignment-analysis-unittest.cc',
-      'wasm/module-decoder-unittest.cc',
-      'wasm/streaming-decoder-unittest.cc',
-      'wasm/trap-handler-unittest.cc',
-      'wasm/wasm-macro-gen-unittest.cc',
-      'wasm/wasm-module-builder-unittest.cc',
-      'wasm/wasm-opcodes-unittest.cc',
-    ],
-    'unittests_sources_arm': [  ### gcmole(arch:arm) ###
-      'compiler/arm/instruction-selector-arm-unittest.cc',
-    ],
-    'unittests_sources_arm64': [  ### gcmole(arch:arm64) ###
-      'compiler/arm64/instruction-selector-arm64-unittest.cc',
-    ],
-    'unittests_sources_ia32': [  ### gcmole(arch:ia32) ###
-      'compiler/ia32/instruction-selector-ia32-unittest.cc',
-    ],
-    'unittests_sources_mips': [  ### gcmole(arch:mips) ###
-      'compiler/mips/instruction-selector-mips-unittest.cc',
-    ],
-    'unittests_sources_mips64': [  ### gcmole(arch:mips64) ###
-      'compiler/mips64/instruction-selector-mips64-unittest.cc',
-    ],
-    'unittests_sources_x64': [  ### gcmole(arch:x64) ###
-      'compiler/x64/instruction-selector-x64-unittest.cc',
-    ],
-    'unittests_sources_ppc': [  ### gcmole(arch:ppc) ###
-      'compiler/ppc/instruction-selector-ppc-unittest.cc',
-    ],
-    'unittests_sources_s390': [  ### gcmole(arch:s390) ###
-      'compiler/s390/instruction-selector-s390-unittest.cc',
-    ],
-  },
-  'includes': ['../../gypfiles/toolchain.gypi', '../../gypfiles/features.gypi'],
-  'targets': [
-    {
-      'target_name': 'unittests',
-      'type': 'executable',
-      'variables': {
-        'optimize': 'max',
-      },
-      'dependencies': [
-        '../../testing/gmock.gyp:gmock',
-        '../../testing/gtest.gyp:gtest',
-        '../../src/v8.gyp:v8',
-        '../../src/v8.gyp:v8_libbase',
-        '../../src/v8.gyp:v8_libplatform',
-        '../../src/v8.gyp:v8_maybe_snapshot',
-      ],
-      'include_dirs': [
-        '../..',
-      ],
-      'sources': [
-        '<@(unittests_sources)',
-      ],
-      'conditions': [
-        ['v8_target_arch=="arm"', {
-          'sources': [
-            '<@(unittests_sources_arm)',
-          ],
-        }],
-        ['v8_target_arch=="arm64"', {
-          'sources': [
-            '<@(unittests_sources_arm64)',
-          ],
-        }],
-        ['v8_target_arch=="ia32"', {
-          'sources': [
-            '<@(unittests_sources_ia32)',
-          ],
-        }],
-        ['v8_target_arch=="mips"', {
-          'sources': [
-            '<@(unittests_sources_mips)',
-          ],
-        }],
-        ['v8_target_arch=="mipsel"', {
-          'sources': [
-            '<@(unittests_sources_mips)',
-          ],
-        }],
-        ['v8_target_arch=="mips64"', {
-          'sources': [
-            '<@(unittests_sources_mips64)',
-          ],
-        }],
-        ['v8_target_arch=="mips64el"', {
-          'sources': [
-            '<@(unittests_sources_mips64)',
-          ],
-        }],
-        ['v8_target_arch=="x64"', {
-          'sources': [
-            '<@(unittests_sources_x64)',
-          ],
-        }],
-        ['v8_target_arch=="ppc" or v8_target_arch=="ppc64"', {
-          'sources': [
-            '<@(unittests_sources_ppc)',
-          ],
-        }],
-        ['v8_target_arch=="s390" or v8_target_arch=="s390x"', {
-          'sources': [
-            '<@(unittests_sources_s390)',
-          ],
-        }],
-        ['OS=="aix"', {
-          'ldflags': [ '-Wl,-bbigtoc' ],
-        }],
-        ['v8_enable_i18n_support==1', {
-          'dependencies': [
-            '<(icu_gyp_path):icui18n',
-            '<(icu_gyp_path):icuuc',
-          ],
-        }],
-        ['v8_use_snapshot=="true"', {
-          'dependencies': ['../../src/v8.gyp:v8_initializers'],
-        }],
-      ],
-    },
-  ],
-  'conditions': [
-    ['test_isolation_mode != "noop"', {
-      'targets': [
-        {
-          'target_name': 'unittests_run',
-          'type': 'none',
-          'dependencies': [
-            'unittests',
-          ],
-          'includes': [
-            '../../gypfiles/isolate.gypi',
-          ],
-          'sources': [
-            'unittests.isolate',
-          ],
-        },
-      ],
-    }],
-  ],
-}
diff --git a/src/v8/test/unittests/unittests.isolate b/src/v8/test/unittests/unittests.isolate
deleted file mode 100644
index ec3bae4..0000000
--- a/src/v8/test/unittests/unittests.isolate
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'variables': {
-    'files': [
-      '<(PRODUCT_DIR)/unittests<(EXECUTABLE_SUFFIX)',
-      './testcfg.py',
-      './unittests.status',
-    ],
-  },
-  'includes': [
-    '../../src/base.isolate',
-    '../../tools/testrunner/testrunner.isolate',
-  ],
-}
diff --git a/src/v8/test/unittests/utils-unittest.cc b/src/v8/test/unittests/utils-unittest.cc
deleted file mode 100644
index 65088d8..0000000
--- a/src/v8/test/unittests/utils-unittest.cc
+++ /dev/null
@@ -1,113 +0,0 @@
-// Copyright 2014 the V8 project 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 <limits>
-
-#include "src/utils.h"
-#include "testing/gtest-support.h"
-
-namespace v8 {
-namespace internal {
-
-template <typename T>
-class UtilsTest : public ::testing::Test {};
-
-typedef ::testing::Types<signed char, unsigned char,
-                         short,                    // NOLINT(runtime/int)
-                         unsigned short,           // NOLINT(runtime/int)
-                         int, unsigned int, long,  // NOLINT(runtime/int)
-                         unsigned long,            // NOLINT(runtime/int)
-                         long long,                // NOLINT(runtime/int)
-                         unsigned long long,       // NOLINT(runtime/int)
-                         int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t,
-                         int64_t, uint64_t>
-    IntegerTypes;
-
-TYPED_TEST_CASE(UtilsTest, IntegerTypes);
-
-TYPED_TEST(UtilsTest, SaturateSub) {
-  TypeParam min = std::numeric_limits<TypeParam>::min();
-  TypeParam max = std::numeric_limits<TypeParam>::max();
-  EXPECT_EQ(SaturateSub<TypeParam>(min, 0), min);
-  EXPECT_EQ(SaturateSub<TypeParam>(max, 0), max);
-  EXPECT_EQ(SaturateSub<TypeParam>(max, min), max);
-  EXPECT_EQ(SaturateSub<TypeParam>(min, max), min);
-  EXPECT_EQ(SaturateSub<TypeParam>(min, max / 3), min);
-  EXPECT_EQ(SaturateSub<TypeParam>(min + 1, 2), min);
-  if (std::numeric_limits<TypeParam>::is_signed) {
-    EXPECT_EQ(SaturateSub<TypeParam>(min, min), static_cast<TypeParam>(0));
-    EXPECT_EQ(SaturateSub<TypeParam>(0, min), max);
-    EXPECT_EQ(SaturateSub<TypeParam>(max / 3, min), max);
-    EXPECT_EQ(SaturateSub<TypeParam>(max / 5, min), max);
-    EXPECT_EQ(SaturateSub<TypeParam>(min / 3, max), min);
-    EXPECT_EQ(SaturateSub<TypeParam>(min / 9, max), min);
-    EXPECT_EQ(SaturateSub<TypeParam>(max, min / 3), max);
-    EXPECT_EQ(SaturateSub<TypeParam>(min, max / 3), min);
-    EXPECT_EQ(SaturateSub<TypeParam>(max / 3 * 2, min / 2), max);
-    EXPECT_EQ(SaturateSub<TypeParam>(min / 3 * 2, max / 2), min);
-  } else {
-    EXPECT_EQ(SaturateSub<TypeParam>(min, min), min);
-    EXPECT_EQ(SaturateSub<TypeParam>(0, min), min);
-    EXPECT_EQ(SaturateSub<TypeParam>(0, max), min);
-    EXPECT_EQ(SaturateSub<TypeParam>(max / 3, max), min);
-    EXPECT_EQ(SaturateSub<TypeParam>(max - 3, max), min);
-  }
-  TypeParam test_cases[] = {static_cast<TypeParam>(min / 23),
-                            static_cast<TypeParam>(max / 3),
-                            63,
-                            static_cast<TypeParam>(min / 6),
-                            static_cast<TypeParam>(max / 55),
-                            static_cast<TypeParam>(min / 2),
-                            static_cast<TypeParam>(max / 2),
-                            0,
-                            1,
-                            2,
-                            3,
-                            4,
-                            42};
-  TRACED_FOREACH(TypeParam, x, test_cases) {
-    TRACED_FOREACH(TypeParam, y, test_cases) {
-      if (std::numeric_limits<TypeParam>::is_signed) {
-        EXPECT_EQ(SaturateSub<TypeParam>(x, y), x - y);
-      } else {
-        EXPECT_EQ(SaturateSub<TypeParam>(x, y), y > x ? min : x - y);
-      }
-    }
-  }
-}
-
-TYPED_TEST(UtilsTest, SaturateAdd) {
-  TypeParam min = std::numeric_limits<TypeParam>::min();
-  TypeParam max = std::numeric_limits<TypeParam>::max();
-  EXPECT_EQ(SaturateAdd<TypeParam>(min, min), min);
-  EXPECT_EQ(SaturateAdd<TypeParam>(max, max), max);
-  EXPECT_EQ(SaturateAdd<TypeParam>(min, min / 3), min);
-  EXPECT_EQ(SaturateAdd<TypeParam>(max / 8 * 7, max / 3 * 2), max);
-  EXPECT_EQ(SaturateAdd<TypeParam>(min / 3 * 2, min / 8 * 7), min);
-  EXPECT_EQ(SaturateAdd<TypeParam>(max / 20 * 18, max / 25 * 18), max);
-  EXPECT_EQ(SaturateAdd<TypeParam>(min / 3 * 2, min / 3 * 2), min);
-  EXPECT_EQ(SaturateAdd<TypeParam>(max - 1, 2), max);
-  EXPECT_EQ(SaturateAdd<TypeParam>(max - 100, 101), max);
-  TypeParam test_cases[] = {static_cast<TypeParam>(min / 23),
-                            static_cast<TypeParam>(max / 3),
-                            63,
-                            static_cast<TypeParam>(min / 6),
-                            static_cast<TypeParam>(max / 55),
-                            static_cast<TypeParam>(min / 2),
-                            static_cast<TypeParam>(max / 2),
-                            0,
-                            1,
-                            2,
-                            3,
-                            4,
-                            42};
-  TRACED_FOREACH(TypeParam, x, test_cases) {
-    TRACED_FOREACH(TypeParam, y, test_cases) {
-      EXPECT_EQ(SaturateAdd<TypeParam>(x, y), x + y);
-    }
-  }
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/unittests/value-serializer-unittest.cc b/src/v8/test/unittests/value-serializer-unittest.cc
deleted file mode 100644
index c143b58..0000000
--- a/src/v8/test/unittests/value-serializer-unittest.cc
+++ /dev/null
@@ -1,3068 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/value-serializer.h"
-
-#include <algorithm>
-#include <string>
-
-#include "include/v8.h"
-#include "src/api.h"
-#include "src/base/build_config.h"
-#include "src/objects-inl.h"
-#include "src/wasm/wasm-objects.h"
-#include "test/unittests/test-utils.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace v8 {
-namespace {
-
-using ::testing::_;
-using ::testing::Invoke;
-using ::testing::Return;
-
-class ValueSerializerTest : public TestWithIsolate {
- protected:
-  ValueSerializerTest()
-      : serialization_context_(Context::New(isolate())),
-        deserialization_context_(Context::New(isolate())) {
-    // Create a host object type that can be tested through
-    // serialization/deserialization delegates below.
-    Local<FunctionTemplate> function_template = v8::FunctionTemplate::New(
-        isolate(), [](const FunctionCallbackInfo<Value>& args) {
-          args.Holder()->SetInternalField(0, args[0]);
-          args.Holder()->SetInternalField(1, args[1]);
-        });
-    function_template->InstanceTemplate()->SetInternalFieldCount(2);
-    function_template->InstanceTemplate()->SetAccessor(
-        StringFromUtf8("value"),
-        [](Local<String> property, const PropertyCallbackInfo<Value>& args) {
-          args.GetReturnValue().Set(args.Holder()->GetInternalField(0));
-        });
-    function_template->InstanceTemplate()->SetAccessor(
-        StringFromUtf8("value2"),
-        [](Local<String> property, const PropertyCallbackInfo<Value>& args) {
-          args.GetReturnValue().Set(args.Holder()->GetInternalField(1));
-        });
-    for (Local<Context> context :
-         {serialization_context_, deserialization_context_}) {
-      context->Global()
-          ->CreateDataProperty(
-              context, StringFromUtf8("ExampleHostObject"),
-              function_template->GetFunction(context).ToLocalChecked())
-          .ToChecked();
-    }
-    host_object_constructor_template_ = function_template;
-    isolate_ = reinterpret_cast<i::Isolate*>(isolate());
-  }
-
-  ~ValueSerializerTest() {
-    // In some cases unhandled scheduled exceptions from current test produce
-    // that Context::New(isolate()) from next test's constructor returns NULL.
-    // In order to prevent that, we added destructor which will clear scheduled
-    // exceptions just for the current test from test case.
-    if (isolate_->has_scheduled_exception()) {
-      isolate_->clear_scheduled_exception();
-    }
-  }
-
-  const Local<Context>& serialization_context() {
-    return serialization_context_;
-  }
-  const Local<Context>& deserialization_context() {
-    return deserialization_context_;
-  }
-
-  bool ExpectInlineWasm() const { return expect_inline_wasm_; }
-  void SetExpectInlineWasm(bool value) { expect_inline_wasm_ = value; }
-
-  // Overridden in more specific fixtures.
-  virtual ValueSerializer::Delegate* GetSerializerDelegate() { return nullptr; }
-  virtual void BeforeEncode(ValueSerializer*) {}
-  virtual void AfterEncode() {}
-  virtual ValueDeserializer::Delegate* GetDeserializerDelegate() {
-    return nullptr;
-  }
-  virtual void BeforeDecode(ValueDeserializer*) {}
-
-  template <typename InputFunctor, typename OutputFunctor>
-  void RoundTripTest(const InputFunctor& input_functor,
-                     const OutputFunctor& output_functor) {
-    EncodeTest(input_functor,
-               [this, &output_functor](const std::vector<uint8_t>& data) {
-                 DecodeTest(data, output_functor);
-               });
-  }
-
-  // Variant for the common case where a script is used to build the original
-  // value.
-  template <typename OutputFunctor>
-  void RoundTripTest(const char* source, const OutputFunctor& output_functor) {
-    RoundTripTest([this, source]() { return EvaluateScriptForInput(source); },
-                  output_functor);
-  }
-
-  // Variant which uses JSON.parse/stringify to check the result.
-  void RoundTripJSON(const char* source) {
-    RoundTripTest(
-        [this, source]() {
-          return JSON::Parse(serialization_context_, StringFromUtf8(source))
-              .ToLocalChecked();
-        },
-        [this, source](Local<Value> value) {
-          ASSERT_TRUE(value->IsObject());
-          EXPECT_EQ(source, Utf8Value(JSON::Stringify(deserialization_context_,
-                                                      value.As<Object>())
-                                          .ToLocalChecked()));
-        });
-  }
-
-  Maybe<std::vector<uint8_t>> DoEncode(Local<Value> value) {
-    Local<Context> context = serialization_context();
-    ValueSerializer serializer(isolate(), GetSerializerDelegate());
-    BeforeEncode(&serializer);
-    serializer.WriteHeader();
-    if (!serializer.WriteValue(context, value).FromMaybe(false)) {
-      return Nothing<std::vector<uint8_t>>();
-    }
-    AfterEncode();
-    std::pair<uint8_t*, size_t> buffer = serializer.Release();
-    std::vector<uint8_t> result(buffer.first, buffer.first + buffer.second);
-    free(buffer.first);
-    return Just(std::move(result));
-  }
-
-  template <typename InputFunctor, typename EncodedDataFunctor>
-  void EncodeTest(const InputFunctor& input_functor,
-                  const EncodedDataFunctor& encoded_data_functor) {
-    Context::Scope scope(serialization_context());
-    TryCatch try_catch(isolate());
-    Local<Value> input_value = input_functor();
-    std::vector<uint8_t> buffer;
-    ASSERT_TRUE(DoEncode(input_value).To(&buffer));
-    ASSERT_FALSE(try_catch.HasCaught());
-    encoded_data_functor(buffer);
-  }
-
-  template <typename InputFunctor, typename MessageFunctor>
-  void InvalidEncodeTest(const InputFunctor& input_functor,
-                         const MessageFunctor& functor) {
-    Context::Scope scope(serialization_context());
-    TryCatch try_catch(isolate());
-    Local<Value> input_value = input_functor();
-    ASSERT_TRUE(DoEncode(input_value).IsNothing());
-    functor(try_catch.Message());
-  }
-
-  template <typename MessageFunctor>
-  void InvalidEncodeTest(const char* source, const MessageFunctor& functor) {
-    InvalidEncodeTest(
-        [this, source]() { return EvaluateScriptForInput(source); }, functor);
-  }
-
-  void InvalidEncodeTest(const char* source) {
-    InvalidEncodeTest(source, [](Local<Message>) {});
-  }
-
-  template <typename OutputFunctor>
-  void DecodeTest(const std::vector<uint8_t>& data,
-                  const OutputFunctor& output_functor) {
-    Local<Context> context = deserialization_context();
-    Context::Scope scope(context);
-    TryCatch try_catch(isolate());
-    ValueDeserializer deserializer(isolate(), &data[0],
-                                   static_cast<int>(data.size()),
-                                   GetDeserializerDelegate());
-    deserializer.SetSupportsLegacyWireFormat(true);
-    deserializer.SetExpectInlineWasm(ExpectInlineWasm());
-    BeforeDecode(&deserializer);
-    ASSERT_TRUE(deserializer.ReadHeader(context).FromMaybe(false));
-    Local<Value> result;
-    ASSERT_TRUE(deserializer.ReadValue(context).ToLocal(&result));
-    ASSERT_FALSE(result.IsEmpty());
-    ASSERT_FALSE(try_catch.HasCaught());
-    ASSERT_TRUE(
-        context->Global()
-            ->CreateDataProperty(context, StringFromUtf8("result"), result)
-            .FromMaybe(false));
-    output_functor(result);
-    ASSERT_FALSE(try_catch.HasCaught());
-  }
-
-  template <typename OutputFunctor>
-  void DecodeTestForVersion0(const std::vector<uint8_t>& data,
-                             const OutputFunctor& output_functor) {
-    Local<Context> context = deserialization_context();
-    Context::Scope scope(context);
-    TryCatch try_catch(isolate());
-    ValueDeserializer deserializer(isolate(), &data[0],
-                                   static_cast<int>(data.size()),
-                                   GetDeserializerDelegate());
-    deserializer.SetSupportsLegacyWireFormat(true);
-    deserializer.SetExpectInlineWasm(ExpectInlineWasm());
-    BeforeDecode(&deserializer);
-    ASSERT_TRUE(deserializer.ReadHeader(context).FromMaybe(false));
-    ASSERT_EQ(0u, deserializer.GetWireFormatVersion());
-    Local<Value> result;
-    ASSERT_TRUE(deserializer.ReadValue(context).ToLocal(&result));
-    ASSERT_FALSE(result.IsEmpty());
-    ASSERT_FALSE(try_catch.HasCaught());
-    ASSERT_TRUE(
-        context->Global()
-            ->CreateDataProperty(context, StringFromUtf8("result"), result)
-            .FromMaybe(false));
-    output_functor(result);
-    ASSERT_FALSE(try_catch.HasCaught());
-  }
-
-  void InvalidDecodeTest(const std::vector<uint8_t>& data) {
-    Local<Context> context = deserialization_context();
-    Context::Scope scope(context);
-    TryCatch try_catch(isolate());
-    ValueDeserializer deserializer(isolate(), &data[0],
-                                   static_cast<int>(data.size()),
-                                   GetDeserializerDelegate());
-    deserializer.SetSupportsLegacyWireFormat(true);
-    deserializer.SetExpectInlineWasm(ExpectInlineWasm());
-    BeforeDecode(&deserializer);
-    Maybe<bool> header_result = deserializer.ReadHeader(context);
-    if (header_result.IsNothing()) {
-      EXPECT_TRUE(try_catch.HasCaught());
-      return;
-    }
-    ASSERT_TRUE(header_result.ToChecked());
-    ASSERT_TRUE(deserializer.ReadValue(context).IsEmpty());
-    EXPECT_TRUE(try_catch.HasCaught());
-  }
-
-  Local<Value> EvaluateScriptForInput(const char* utf8_source) {
-    Local<String> source = StringFromUtf8(utf8_source);
-    Local<Script> script =
-        Script::Compile(serialization_context_, source).ToLocalChecked();
-    return script->Run(serialization_context_).ToLocalChecked();
-  }
-
-  bool EvaluateScriptForResultBool(const char* utf8_source) {
-    Local<String> source = StringFromUtf8(utf8_source);
-    Local<Script> script =
-        Script::Compile(deserialization_context_, source).ToLocalChecked();
-    Local<Value> value = script->Run(deserialization_context_).ToLocalChecked();
-    return value->BooleanValue(deserialization_context_).FromJust();
-  }
-
-  Local<String> StringFromUtf8(const char* source) {
-    return String::NewFromUtf8(isolate(), source, NewStringType::kNormal)
-        .ToLocalChecked();
-  }
-
-  std::string Utf8Value(Local<Value> value) {
-    String::Utf8Value utf8(isolate(), value);
-    return std::string(*utf8, utf8.length());
-  }
-
-  Local<Object> NewHostObject(Local<Context> context, int argc,
-                              Local<Value> argv[]) {
-    return host_object_constructor_template_->GetFunction(context)
-        .ToLocalChecked()
-        ->NewInstance(context, argc, argv)
-        .ToLocalChecked();
-  }
-
-  Local<Object> NewDummyUint8Array() {
-    static uint8_t data[] = {4, 5, 6};
-    Local<ArrayBuffer> ab =
-        ArrayBuffer::New(isolate(), static_cast<void*>(data), sizeof(data));
-    return Uint8Array::New(ab, 0, sizeof(data));
-  }
-
- private:
-  Local<Context> serialization_context_;
-  Local<Context> deserialization_context_;
-  Local<FunctionTemplate> host_object_constructor_template_;
-  i::Isolate* isolate_;
-  bool expect_inline_wasm_ = false;
-
-  DISALLOW_COPY_AND_ASSIGN(ValueSerializerTest);
-};
-
-TEST_F(ValueSerializerTest, DecodeInvalid) {
-  // Version tag but no content.
-  InvalidDecodeTest({0xFF});
-  // Version too large.
-  InvalidDecodeTest({0xFF, 0x7F, 0x5F});
-  // Nonsense tag.
-  InvalidDecodeTest({0xFF, 0x09, 0xDD});
-}
-
-TEST_F(ValueSerializerTest, RoundTripOddball) {
-  RoundTripTest([this]() { return Undefined(isolate()); },
-                [](Local<Value> value) { EXPECT_TRUE(value->IsUndefined()); });
-  RoundTripTest([this]() { return True(isolate()); },
-                [](Local<Value> value) { EXPECT_TRUE(value->IsTrue()); });
-  RoundTripTest([this]() { return False(isolate()); },
-                [](Local<Value> value) { EXPECT_TRUE(value->IsFalse()); });
-  RoundTripTest([this]() { return Null(isolate()); },
-                [](Local<Value> value) { EXPECT_TRUE(value->IsNull()); });
-}
-
-TEST_F(ValueSerializerTest, DecodeOddball) {
-  // What this code is expected to generate.
-  DecodeTest({0xFF, 0x09, 0x5F},
-             [](Local<Value> value) { EXPECT_TRUE(value->IsUndefined()); });
-  DecodeTest({0xFF, 0x09, 0x54},
-             [](Local<Value> value) { EXPECT_TRUE(value->IsTrue()); });
-  DecodeTest({0xFF, 0x09, 0x46},
-             [](Local<Value> value) { EXPECT_TRUE(value->IsFalse()); });
-  DecodeTest({0xFF, 0x09, 0x30},
-             [](Local<Value> value) { EXPECT_TRUE(value->IsNull()); });
-
-  // What v9 of the Blink code generates.
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x5F, 0x00},
-             [](Local<Value> value) { EXPECT_TRUE(value->IsUndefined()); });
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x54, 0x00},
-             [](Local<Value> value) { EXPECT_TRUE(value->IsTrue()); });
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x46, 0x00},
-             [](Local<Value> value) { EXPECT_TRUE(value->IsFalse()); });
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x30, 0x00},
-             [](Local<Value> value) { EXPECT_TRUE(value->IsNull()); });
-
-  // v0 (with no explicit version).
-  DecodeTest({0x5F, 0x00},
-             [](Local<Value> value) { EXPECT_TRUE(value->IsUndefined()); });
-  DecodeTest({0x54, 0x00},
-             [](Local<Value> value) { EXPECT_TRUE(value->IsTrue()); });
-  DecodeTest({0x46, 0x00},
-             [](Local<Value> value) { EXPECT_TRUE(value->IsFalse()); });
-  DecodeTest({0x30, 0x00},
-             [](Local<Value> value) { EXPECT_TRUE(value->IsNull()); });
-}
-
-TEST_F(ValueSerializerTest, RoundTripNumber) {
-  RoundTripTest([this]() { return Integer::New(isolate(), 42); },
-                [](Local<Value> value) {
-                  ASSERT_TRUE(value->IsInt32());
-                  EXPECT_EQ(42, Int32::Cast(*value)->Value());
-                });
-  RoundTripTest([this]() { return Integer::New(isolate(), -31337); },
-                [](Local<Value> value) {
-                  ASSERT_TRUE(value->IsInt32());
-                  EXPECT_EQ(-31337, Int32::Cast(*value)->Value());
-                });
-  RoundTripTest(
-      [this]() {
-        return Integer::New(isolate(), std::numeric_limits<int32_t>::min());
-      },
-      [](Local<Value> value) {
-        ASSERT_TRUE(value->IsInt32());
-        EXPECT_EQ(std::numeric_limits<int32_t>::min(),
-                  Int32::Cast(*value)->Value());
-      });
-  RoundTripTest([this]() { return Number::New(isolate(), -0.25); },
-                [](Local<Value> value) {
-                  ASSERT_TRUE(value->IsNumber());
-                  EXPECT_EQ(-0.25, Number::Cast(*value)->Value());
-                });
-  RoundTripTest(
-      [this]() {
-        return Number::New(isolate(), std::numeric_limits<double>::quiet_NaN());
-      },
-      [](Local<Value> value) {
-        ASSERT_TRUE(value->IsNumber());
-        EXPECT_TRUE(std::isnan(Number::Cast(*value)->Value()));
-      });
-}
-
-TEST_F(ValueSerializerTest, DecodeNumber) {
-  // 42 zig-zag encoded (signed)
-  DecodeTest({0xFF, 0x09, 0x49, 0x54}, [](Local<Value> value) {
-    ASSERT_TRUE(value->IsInt32());
-    EXPECT_EQ(42, Int32::Cast(*value)->Value());
-  });
-  // 42 varint encoded (unsigned)
-  DecodeTest({0xFF, 0x09, 0x55, 0x2A}, [](Local<Value> value) {
-    ASSERT_TRUE(value->IsInt32());
-    EXPECT_EQ(42, Int32::Cast(*value)->Value());
-  });
-  // 160 zig-zag encoded (signed)
-  DecodeTest({0xFF, 0x09, 0x49, 0xC0, 0x02}, [](Local<Value> value) {
-    ASSERT_TRUE(value->IsInt32());
-    ASSERT_EQ(160, Int32::Cast(*value)->Value());
-  });
-  // 160 varint encoded (unsigned)
-  DecodeTest({0xFF, 0x09, 0x55, 0xA0, 0x01}, [](Local<Value> value) {
-    ASSERT_TRUE(value->IsInt32());
-    ASSERT_EQ(160, Int32::Cast(*value)->Value());
-  });
-#if defined(V8_TARGET_LITTLE_ENDIAN)
-  // IEEE 754 doubles, little-endian byte order
-  DecodeTest({0xFF, 0x09, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD0, 0xBF},
-             [](Local<Value> value) {
-               ASSERT_TRUE(value->IsNumber());
-               EXPECT_EQ(-0.25, Number::Cast(*value)->Value());
-             });
-  // quiet NaN
-  DecodeTest({0xFF, 0x09, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x7F},
-             [](Local<Value> value) {
-               ASSERT_TRUE(value->IsNumber());
-               EXPECT_TRUE(std::isnan(Number::Cast(*value)->Value()));
-             });
-  // signaling NaN
-  DecodeTest({0xFF, 0x09, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF4, 0x7F},
-             [](Local<Value> value) {
-               ASSERT_TRUE(value->IsNumber());
-               EXPECT_TRUE(std::isnan(Number::Cast(*value)->Value()));
-             });
-#endif
-  // TODO(jbroman): Equivalent test for big-endian machines.
-}
-
-// String constants (in UTF-8) used for string encoding tests.
-static const char kHelloString[] = "Hello";
-static const char kQuebecString[] = "\x51\x75\xC3\xA9\x62\x65\x63";
-static const char kEmojiString[] = "\xF0\x9F\x91\x8A";
-
-TEST_F(ValueSerializerTest, RoundTripString) {
-  RoundTripTest([this]() { return String::Empty(isolate()); },
-                [](Local<Value> value) {
-                  ASSERT_TRUE(value->IsString());
-                  EXPECT_EQ(0, String::Cast(*value)->Length());
-                });
-  // Inside ASCII.
-  RoundTripTest([this]() { return StringFromUtf8(kHelloString); },
-                [this](Local<Value> value) {
-                  ASSERT_TRUE(value->IsString());
-                  EXPECT_EQ(5, String::Cast(*value)->Length());
-                  EXPECT_EQ(kHelloString, Utf8Value(value));
-                });
-  // Inside Latin-1 (i.e. one-byte string), but not ASCII.
-  RoundTripTest([this]() { return StringFromUtf8(kQuebecString); },
-                [this](Local<Value> value) {
-                  ASSERT_TRUE(value->IsString());
-                  EXPECT_EQ(6, String::Cast(*value)->Length());
-                  EXPECT_EQ(kQuebecString, Utf8Value(value));
-                });
-  // An emoji (decodes to two 16-bit chars).
-  RoundTripTest([this]() { return StringFromUtf8(kEmojiString); },
-                [this](Local<Value> value) {
-                  ASSERT_TRUE(value->IsString());
-                  EXPECT_EQ(2, String::Cast(*value)->Length());
-                  EXPECT_EQ(kEmojiString, Utf8Value(value));
-                });
-}
-
-TEST_F(ValueSerializerTest, DecodeString) {
-  // Decoding the strings above from UTF-8.
-  DecodeTest({0xFF, 0x09, 0x53, 0x00}, [](Local<Value> value) {
-    ASSERT_TRUE(value->IsString());
-    EXPECT_EQ(0, String::Cast(*value)->Length());
-  });
-  DecodeTest({0xFF, 0x09, 0x53, 0x05, 'H', 'e', 'l', 'l', 'o'},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsString());
-               EXPECT_EQ(5, String::Cast(*value)->Length());
-               EXPECT_EQ(kHelloString, Utf8Value(value));
-             });
-  DecodeTest({0xFF, 0x09, 0x53, 0x07, 'Q', 'u', 0xC3, 0xA9, 'b', 'e', 'c'},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsString());
-               EXPECT_EQ(6, String::Cast(*value)->Length());
-               EXPECT_EQ(kQuebecString, Utf8Value(value));
-             });
-  DecodeTest({0xFF, 0x09, 0x53, 0x04, 0xF0, 0x9F, 0x91, 0x8A},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsString());
-               EXPECT_EQ(2, String::Cast(*value)->Length());
-               EXPECT_EQ(kEmojiString, Utf8Value(value));
-             });
-
-  // And from Latin-1 (for the ones that fit).
-  DecodeTest({0xFF, 0x0A, 0x22, 0x00}, [](Local<Value> value) {
-    ASSERT_TRUE(value->IsString());
-    EXPECT_EQ(0, String::Cast(*value)->Length());
-  });
-  DecodeTest({0xFF, 0x0A, 0x22, 0x05, 'H', 'e', 'l', 'l', 'o'},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsString());
-               EXPECT_EQ(5, String::Cast(*value)->Length());
-               EXPECT_EQ(kHelloString, Utf8Value(value));
-             });
-  DecodeTest({0xFF, 0x0A, 0x22, 0x06, 'Q', 'u', 0xE9, 'b', 'e', 'c'},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsString());
-               EXPECT_EQ(6, String::Cast(*value)->Length());
-               EXPECT_EQ(kQuebecString, Utf8Value(value));
-             });
-
-// And from two-byte strings (endianness dependent).
-#if defined(V8_TARGET_LITTLE_ENDIAN)
-  DecodeTest({0xFF, 0x09, 0x63, 0x00}, [](Local<Value> value) {
-    ASSERT_TRUE(value->IsString());
-    EXPECT_EQ(0, String::Cast(*value)->Length());
-  });
-  DecodeTest({0xFF, 0x09, 0x63, 0x0A, 'H', '\0', 'e', '\0', 'l', '\0', 'l',
-              '\0', 'o', '\0'},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsString());
-               EXPECT_EQ(5, String::Cast(*value)->Length());
-               EXPECT_EQ(kHelloString, Utf8Value(value));
-             });
-  DecodeTest({0xFF, 0x09, 0x63, 0x0C, 'Q', '\0', 'u', '\0', 0xE9, '\0', 'b',
-              '\0', 'e', '\0', 'c', '\0'},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsString());
-               EXPECT_EQ(6, String::Cast(*value)->Length());
-               EXPECT_EQ(kQuebecString, Utf8Value(value));
-             });
-  DecodeTest({0xFF, 0x09, 0x63, 0x04, 0x3D, 0xD8, 0x4A, 0xDC},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsString());
-               EXPECT_EQ(2, String::Cast(*value)->Length());
-               EXPECT_EQ(kEmojiString, Utf8Value(value));
-             });
-#endif
-  // TODO(jbroman): The same for big-endian systems.
-}
-
-TEST_F(ValueSerializerTest, DecodeInvalidString) {
-  // UTF-8 string with too few bytes available.
-  InvalidDecodeTest({0xFF, 0x09, 0x53, 0x10, 'v', '8'});
-  // One-byte string with too few bytes available.
-  InvalidDecodeTest({0xFF, 0x0A, 0x22, 0x10, 'v', '8'});
-#if defined(V8_TARGET_LITTLE_ENDIAN)
-  // Two-byte string with too few bytes available.
-  InvalidDecodeTest({0xFF, 0x09, 0x63, 0x10, 'v', '\0', '8', '\0'});
-  // Two-byte string with an odd byte length.
-  InvalidDecodeTest({0xFF, 0x09, 0x63, 0x03, 'v', '\0', '8'});
-#endif
-  // TODO(jbroman): The same for big-endian systems.
-}
-
-TEST_F(ValueSerializerTest, EncodeTwoByteStringUsesPadding) {
-  // As long as the output has a version that Blink expects to be able to read,
-  // we must respect its alignment requirements. It requires that two-byte
-  // characters be aligned.
-  EncodeTest(
-      [this]() {
-        // We need a string whose length will take two bytes to encode, so that
-        // a padding byte is needed to keep the characters aligned. The string
-        // must also have a two-byte character, so that it gets the two-byte
-        // encoding.
-        std::string string(200, ' ');
-        string += kEmojiString;
-        return StringFromUtf8(string.c_str());
-      },
-      [](const std::vector<uint8_t>& data) {
-        // This is a sufficient but not necessary condition. This test assumes
-        // that the wire format version is one byte long, but is flexible to
-        // what that value may be.
-        const uint8_t expected_prefix[] = {0x00, 0x63, 0x94, 0x03};
-        ASSERT_GT(data.size(), sizeof(expected_prefix) + 2);
-        EXPECT_EQ(0xFF, data[0]);
-        EXPECT_GE(data[1], 0x09);
-        EXPECT_LE(data[1], 0x7F);
-        EXPECT_TRUE(std::equal(std::begin(expected_prefix),
-                               std::end(expected_prefix), data.begin() + 2));
-      });
-}
-
-TEST_F(ValueSerializerTest, RoundTripDictionaryObject) {
-  // Empty object.
-  RoundTripTest("({})", [this](Local<Value> value) {
-    ASSERT_TRUE(value->IsObject());
-    EXPECT_TRUE(EvaluateScriptForResultBool(
-        "Object.getPrototypeOf(result) === Object.prototype"));
-    EXPECT_TRUE(EvaluateScriptForResultBool(
-        "Object.getOwnPropertyNames(result).length === 0"));
-  });
-  // String key.
-  RoundTripTest("({ a: 42 })", [this](Local<Value> value) {
-    ASSERT_TRUE(value->IsObject());
-    EXPECT_TRUE(EvaluateScriptForResultBool("result.hasOwnProperty('a')"));
-    EXPECT_TRUE(EvaluateScriptForResultBool("result.a === 42"));
-    EXPECT_TRUE(EvaluateScriptForResultBool(
-        "Object.getOwnPropertyNames(result).length === 1"));
-  });
-  // Integer key (treated as a string, but may be encoded differently).
-  RoundTripTest("({ 42: 'a' })", [this](Local<Value> value) {
-    ASSERT_TRUE(value->IsObject());
-    EXPECT_TRUE(EvaluateScriptForResultBool("result.hasOwnProperty('42')"));
-    EXPECT_TRUE(EvaluateScriptForResultBool("result[42] === 'a'"));
-    EXPECT_TRUE(EvaluateScriptForResultBool(
-        "Object.getOwnPropertyNames(result).length === 1"));
-  });
-  // Key order must be preserved.
-  RoundTripTest("({ x: 1, y: 2, a: 3 })", [this](Local<Value> value) {
-    EXPECT_TRUE(EvaluateScriptForResultBool(
-        "Object.getOwnPropertyNames(result).toString() === 'x,y,a'"));
-  });
-  // A harder case of enumeration order.
-  // Indexes first, in order (but not 2^32 - 1, which is not an index), then the
-  // remaining (string) keys, in the order they were defined.
-  RoundTripTest(
-      "({ a: 2, 0xFFFFFFFF: 1, 0xFFFFFFFE: 3, 1: 0 })",
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Object.getOwnPropertyNames(result).toString() === "
-            "'1,4294967294,a,4294967295'"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a === 2"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[0xFFFFFFFF] === 1"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[0xFFFFFFFE] === 3"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[1] === 0"));
-      });
-  // This detects a fairly subtle case: the object itself must be in the map
-  // before its properties are deserialized, so that references to it can be
-  // resolved.
-  RoundTripTest(
-      "(() => { var y = {}; y.self = y; return y; })()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsObject());
-        EXPECT_TRUE(EvaluateScriptForResultBool("result === result.self"));
-      });
-}
-
-TEST_F(ValueSerializerTest, DecodeDictionaryObject) {
-  // Empty object.
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x6F, 0x7B, 0x00, 0x00},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsObject());
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Object.getPrototypeOf(result) === Object.prototype"));
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Object.getOwnPropertyNames(result).length === 0"));
-             });
-  // String key.
-  DecodeTest(
-      {0xFF, 0x09, 0x3F, 0x00, 0x6F, 0x3F, 0x01, 0x53, 0x01, 0x61, 0x3F, 0x01,
-       0x49, 0x54, 0x7B, 0x01},
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsObject());
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.hasOwnProperty('a')"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a === 42"));
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Object.getOwnPropertyNames(result).length === 1"));
-      });
-  // Integer key (treated as a string, but may be encoded differently).
-  DecodeTest(
-      {0xFF, 0x09, 0x3F, 0x00, 0x6F, 0x3F, 0x01, 0x49, 0x54, 0x3F, 0x01, 0x53,
-       0x01, 0x61, 0x7B, 0x01},
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsObject());
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.hasOwnProperty('42')"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[42] === 'a'"));
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Object.getOwnPropertyNames(result).length === 1"));
-      });
-  // Key order must be preserved.
-  DecodeTest(
-      {0xFF, 0x09, 0x3F, 0x00, 0x6F, 0x3F, 0x01, 0x53, 0x01, 0x78, 0x3F, 0x01,
-       0x49, 0x02, 0x3F, 0x01, 0x53, 0x01, 0x79, 0x3F, 0x01, 0x49, 0x04, 0x3F,
-       0x01, 0x53, 0x01, 0x61, 0x3F, 0x01, 0x49, 0x06, 0x7B, 0x03},
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Object.getOwnPropertyNames(result).toString() === 'x,y,a'"));
-      });
-  // A harder case of enumeration order.
-  DecodeTest(
-      {0xFF, 0x09, 0x3F, 0x00, 0x6F, 0x3F, 0x01, 0x49, 0x02, 0x3F, 0x01,
-       0x49, 0x00, 0x3F, 0x01, 0x55, 0xFE, 0xFF, 0xFF, 0xFF, 0x0F, 0x3F,
-       0x01, 0x49, 0x06, 0x3F, 0x01, 0x53, 0x01, 0x61, 0x3F, 0x01, 0x49,
-       0x04, 0x3F, 0x01, 0x53, 0x0A, 0x34, 0x32, 0x39, 0x34, 0x39, 0x36,
-       0x37, 0x32, 0x39, 0x35, 0x3F, 0x01, 0x49, 0x02, 0x7B, 0x04},
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Object.getOwnPropertyNames(result).toString() === "
-            "'1,4294967294,a,4294967295'"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a === 2"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[0xFFFFFFFF] === 1"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[0xFFFFFFFE] === 3"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[1] === 0"));
-      });
-  // This detects a fairly subtle case: the object itself must be in the map
-  // before its properties are deserialized, so that references to it can be
-  // resolved.
-  DecodeTest(
-      {0xFF, 0x09, 0x3F, 0x00, 0x6F, 0x3F, 0x01, 0x53, 0x04, 0x73,
-       0x65, 0x6C, 0x66, 0x3F, 0x01, 0x5E, 0x00, 0x7B, 0x01, 0x00},
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsObject());
-        EXPECT_TRUE(EvaluateScriptForResultBool("result === result.self"));
-      });
-}
-
-TEST_F(ValueSerializerTest, InvalidDecodeObjectWithInvalidKeyType) {
-  // Objects which would need conversion to string shouldn't be present as
-  // object keys. The serializer would have obtained them from the own property
-  // keys list, which should only contain names and indices.
-  InvalidDecodeTest(
-      {0xFF, 0x09, 0x6F, 0x61, 0x00, 0x40, 0x00, 0x00, 0x7B, 0x01});
-}
-
-TEST_F(ValueSerializerTest, RoundTripOnlyOwnEnumerableStringKeys) {
-  // Only "own" properties should be serialized, not ones on the prototype.
-  RoundTripTest("(() => { var x = {}; x.__proto__ = {a: 4}; return x; })()",
-                [this](Local<Value> value) {
-                  EXPECT_TRUE(EvaluateScriptForResultBool("!('a' in result)"));
-                });
-  // Only enumerable properties should be serialized.
-  RoundTripTest(
-      "(() => {"
-      "  var x = {};"
-      "  Object.defineProperty(x, 'a', {value: 1, enumerable: false});"
-      "  return x;"
-      "})()",
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool("!('a' in result)"));
-      });
-  // Symbol keys should not be serialized.
-  RoundTripTest("({ [Symbol()]: 4 })", [this](Local<Value> value) {
-    EXPECT_TRUE(EvaluateScriptForResultBool(
-        "Object.getOwnPropertySymbols(result).length === 0"));
-  });
-}
-
-TEST_F(ValueSerializerTest, RoundTripTrickyGetters) {
-  // Keys are enumerated before any setters are called, but if there is no own
-  // property when the value is to be read, then it should not be serialized.
-  RoundTripTest("({ get a() { delete this.b; return 1; }, b: 2 })",
-                [this](Local<Value> value) {
-                  EXPECT_TRUE(EvaluateScriptForResultBool("!('b' in result)"));
-                });
-  // Keys added after the property enumeration should not be serialized.
-  RoundTripTest("({ get a() { this.b = 3; }})", [this](Local<Value> value) {
-    EXPECT_TRUE(EvaluateScriptForResultBool("!('b' in result)"));
-  });
-  // But if you remove a key and add it back, that's fine. But it will appear in
-  // the original place in enumeration order.
-  RoundTripTest(
-      "({ get a() { delete this.b; this.b = 4; }, b: 2, c: 3 })",
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Object.getOwnPropertyNames(result).toString() === 'a,b,c'"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.b === 4"));
-      });
-  // Similarly, it only matters if a property was enumerable when the
-  // enumeration happened.
-  RoundTripTest(
-      "({ get a() {"
-      "    Object.defineProperty(this, 'b', {value: 2, enumerable: false});"
-      "}, b: 1})",
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.b === 2"));
-      });
-  RoundTripTest(
-      "(() => {"
-      "  var x = {"
-      "    get a() {"
-      "      Object.defineProperty(this, 'b', {value: 2, enumerable: true});"
-      "    }"
-      "  };"
-      "  Object.defineProperty(x, 'b',"
-      "      {value: 1, enumerable: false, configurable: true});"
-      "  return x;"
-      "})()",
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool("!('b' in result)"));
-      });
-  // The property also should not be read if it can only be found on the
-  // prototype chain (but not as an own property) after enumeration.
-  RoundTripTest(
-      "(() => {"
-      "  var x = { get a() { delete this.b; }, b: 1 };"
-      "  x.__proto__ = { b: 0 };"
-      "  return x;"
-      "})()",
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool("!('b' in result)"));
-      });
-  // If an exception is thrown by script, encoding must fail and the exception
-  // must be thrown.
-  InvalidEncodeTest("({ get a() { throw new Error('sentinel'); } })",
-                    [this](Local<Message> message) {
-                      ASSERT_FALSE(message.IsEmpty());
-                      EXPECT_NE(std::string::npos,
-                                Utf8Value(message->Get()).find("sentinel"));
-                    });
-}
-
-TEST_F(ValueSerializerTest, RoundTripDictionaryObjectForTransitions) {
-  // A case which should run on the fast path, and should reach all of the
-  // different cases:
-  // 1. no known transition (first time creating this kind of object)
-  // 2. expected transitions match to end
-  // 3. transition partially matches, but falls back due to new property 'w'
-  // 4. transition to 'z' is now a full transition (needs to be looked up)
-  // 5. same for 'w'
-  // 6. new property after complex transition succeeded
-  // 7. new property after complex transition failed (due to new property)
-  RoundTripJSON(
-      "[{\"x\":1,\"y\":2,\"z\":3}"
-      ",{\"x\":4,\"y\":5,\"z\":6}"
-      ",{\"x\":5,\"y\":6,\"w\":7}"
-      ",{\"x\":6,\"y\":7,\"z\":8}"
-      ",{\"x\":0,\"y\":0,\"w\":0}"
-      ",{\"x\":3,\"y\":1,\"w\":4,\"z\":1}"
-      ",{\"x\":5,\"y\":9,\"k\":2,\"z\":6}]");
-  // A simpler case that uses two-byte strings.
-  RoundTripJSON(
-      "[{\"\xF0\x9F\x91\x8A\":1,\"\xF0\x9F\x91\x8B\":2}"
-      ",{\"\xF0\x9F\x91\x8A\":3,\"\xF0\x9F\x91\x8C\":4}"
-      ",{\"\xF0\x9F\x91\x8A\":5,\"\xF0\x9F\x91\x9B\":6}]");
-}
-
-TEST_F(ValueSerializerTest, DecodeDictionaryObjectVersion0) {
-  // Empty object.
-  DecodeTestForVersion0(
-      {0x7B, 0x00}, [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsObject());
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Object.getPrototypeOf(result) === Object.prototype"));
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Object.getOwnPropertyNames(result).length === 0"));
-      });
-  // String key.
-  DecodeTestForVersion0(
-      {0x53, 0x01, 0x61, 0x49, 0x54, 0x7B, 0x01, 0x00},
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsObject());
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Object.getPrototypeOf(result) === Object.prototype"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.hasOwnProperty('a')"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a === 42"));
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Object.getOwnPropertyNames(result).length === 1"));
-      });
-  // Integer key (treated as a string, but may be encoded differently).
-  DecodeTestForVersion0(
-      {0x49, 0x54, 0x53, 0x01, 0x61, 0x7B, 0x01, 0x00},
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsObject());
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.hasOwnProperty('42')"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[42] === 'a'"));
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Object.getOwnPropertyNames(result).length === 1"));
-      });
-  // Key order must be preserved.
-  DecodeTestForVersion0(
-      {0x53, 0x01, 0x78, 0x49, 0x02, 0x53, 0x01, 0x79, 0x49, 0x04, 0x53, 0x01,
-       0x61, 0x49, 0x06, 0x7B, 0x03, 0x00},
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Object.getOwnPropertyNames(result).toString() === 'x,y,a'"));
-      });
-  // A property and an element.
-  DecodeTestForVersion0(
-      {0x49, 0x54, 0x53, 0x01, 0x61, 0x53, 0x01, 0x61, 0x49, 0x54, 0x7B, 0x02},
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Object.getOwnPropertyNames(result).toString() === '42,a'"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[42] === 'a'"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a === 42"));
-      });
-}
-
-TEST_F(ValueSerializerTest, RoundTripArray) {
-  // A simple array of integers.
-  RoundTripTest("[1, 2, 3, 4, 5]", [this](Local<Value> value) {
-    ASSERT_TRUE(value->IsArray());
-    EXPECT_EQ(5u, Array::Cast(*value)->Length());
-    EXPECT_TRUE(EvaluateScriptForResultBool(
-        "Object.getPrototypeOf(result) === Array.prototype"));
-    EXPECT_TRUE(
-        EvaluateScriptForResultBool("result.toString() === '1,2,3,4,5'"));
-  });
-  // A long (sparse) array.
-  RoundTripTest(
-      "(() => { var x = new Array(1000); x[500] = 42; return x; })()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        EXPECT_EQ(1000u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[500] === 42"));
-      });
-  // Duplicate reference.
-  RoundTripTest(
-      "(() => { var y = {}; return [y, y]; })()", [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        ASSERT_EQ(2u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[0] === result[1]"));
-      });
-  // Duplicate reference in a sparse array.
-  RoundTripTest(
-      "(() => { var x = new Array(1000); x[1] = x[500] = {}; return x; })()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        ASSERT_EQ(1000u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(
-            EvaluateScriptForResultBool("typeof result[1] === 'object'"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[1] === result[500]"));
-      });
-  // Self reference.
-  RoundTripTest(
-      "(() => { var y = []; y[0] = y; return y; })()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        ASSERT_EQ(1u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[0] === result"));
-      });
-  // Self reference in a sparse array.
-  RoundTripTest(
-      "(() => { var y = new Array(1000); y[519] = y; return y; })()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        ASSERT_EQ(1000u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[519] === result"));
-      });
-  // Array with additional properties.
-  RoundTripTest(
-      "(() => { var y = [1, 2]; y.foo = 'bar'; return y; })()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        ASSERT_EQ(2u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.toString() === '1,2'"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.foo === 'bar'"));
-      });
-  // Sparse array with additional properties.
-  RoundTripTest(
-      "(() => { var y = new Array(1000); y.foo = 'bar'; return y; })()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        ASSERT_EQ(1000u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "result.toString() === ','.repeat(999)"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.foo === 'bar'"));
-      });
-  // The distinction between holes and undefined elements must be maintained.
-  RoundTripTest("[,undefined]", [this](Local<Value> value) {
-    ASSERT_TRUE(value->IsArray());
-    ASSERT_EQ(2u, Array::Cast(*value)->Length());
-    EXPECT_TRUE(
-        EvaluateScriptForResultBool("typeof result[0] === 'undefined'"));
-    EXPECT_TRUE(
-        EvaluateScriptForResultBool("typeof result[1] === 'undefined'"));
-    EXPECT_TRUE(EvaluateScriptForResultBool("!result.hasOwnProperty(0)"));
-    EXPECT_TRUE(EvaluateScriptForResultBool("result.hasOwnProperty(1)"));
-  });
-}
-
-TEST_F(ValueSerializerTest, DecodeArray) {
-  // A simple array of integers.
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x41, 0x05, 0x3F, 0x01, 0x49, 0x02,
-              0x3F, 0x01, 0x49, 0x04, 0x3F, 0x01, 0x49, 0x06, 0x3F, 0x01,
-              0x49, 0x08, 0x3F, 0x01, 0x49, 0x0A, 0x24, 0x00, 0x05, 0x00},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsArray());
-               EXPECT_EQ(5u, Array::Cast(*value)->Length());
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Object.getPrototypeOf(result) === Array.prototype"));
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "result.toString() === '1,2,3,4,5'"));
-             });
-  // A long (sparse) array.
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x61, 0xE8, 0x07, 0x3F, 0x01, 0x49,
-              0xE8, 0x07, 0x3F, 0x01, 0x49, 0x54, 0x40, 0x01, 0xE8, 0x07},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsArray());
-               EXPECT_EQ(1000u, Array::Cast(*value)->Length());
-               EXPECT_TRUE(EvaluateScriptForResultBool("result[500] === 42"));
-             });
-  // Duplicate reference.
-  DecodeTest(
-      {0xFF, 0x09, 0x3F, 0x00, 0x41, 0x02, 0x3F, 0x01, 0x6F, 0x7B, 0x00, 0x3F,
-       0x02, 0x5E, 0x01, 0x24, 0x00, 0x02},
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        ASSERT_EQ(2u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[0] === result[1]"));
-      });
-  // Duplicate reference in a sparse array.
-  DecodeTest(
-      {0xFF, 0x09, 0x3F, 0x00, 0x61, 0xE8, 0x07, 0x3F, 0x01, 0x49,
-       0x02, 0x3F, 0x01, 0x6F, 0x7B, 0x00, 0x3F, 0x02, 0x49, 0xE8,
-       0x07, 0x3F, 0x02, 0x5E, 0x01, 0x40, 0x02, 0xE8, 0x07, 0x00},
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        ASSERT_EQ(1000u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(
-            EvaluateScriptForResultBool("typeof result[1] === 'object'"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[1] === result[500]"));
-      });
-  // Self reference.
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x41, 0x01, 0x3F, 0x01, 0x5E, 0x00, 0x24,
-              0x00, 0x01, 0x00},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsArray());
-               ASSERT_EQ(1u, Array::Cast(*value)->Length());
-               EXPECT_TRUE(EvaluateScriptForResultBool("result[0] === result"));
-             });
-  // Self reference in a sparse array.
-  DecodeTest(
-      {0xFF, 0x09, 0x3F, 0x00, 0x61, 0xE8, 0x07, 0x3F, 0x01, 0x49,
-       0x8E, 0x08, 0x3F, 0x01, 0x5E, 0x00, 0x40, 0x01, 0xE8, 0x07},
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        ASSERT_EQ(1000u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[519] === result"));
-      });
-  // Array with additional properties.
-  DecodeTest(
-      {0xFF, 0x09, 0x3F, 0x00, 0x41, 0x02, 0x3F, 0x01, 0x49, 0x02, 0x3F,
-       0x01, 0x49, 0x04, 0x3F, 0x01, 0x53, 0x03, 0x66, 0x6F, 0x6F, 0x3F,
-       0x01, 0x53, 0x03, 0x62, 0x61, 0x72, 0x24, 0x01, 0x02, 0x00},
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        ASSERT_EQ(2u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.toString() === '1,2'"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.foo === 'bar'"));
-      });
-  // Sparse array with additional properties.
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x61, 0xE8, 0x07, 0x3F, 0x01,
-              0x53, 0x03, 0x66, 0x6F, 0x6F, 0x3F, 0x01, 0x53, 0x03,
-              0x62, 0x61, 0x72, 0x40, 0x01, 0xE8, 0x07, 0x00},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsArray());
-               ASSERT_EQ(1000u, Array::Cast(*value)->Length());
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "result.toString() === ','.repeat(999)"));
-               EXPECT_TRUE(EvaluateScriptForResultBool("result.foo === 'bar'"));
-             });
-  // The distinction between holes and undefined elements must be maintained.
-  // Note that since the previous output from Chrome fails this test, an
-  // encoding using the sparse format was constructed instead.
-  DecodeTest(
-      {0xFF, 0x09, 0x61, 0x02, 0x49, 0x02, 0x5F, 0x40, 0x01, 0x02},
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        ASSERT_EQ(2u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(
-            EvaluateScriptForResultBool("typeof result[0] === 'undefined'"));
-        EXPECT_TRUE(
-            EvaluateScriptForResultBool("typeof result[1] === 'undefined'"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("!result.hasOwnProperty(0)"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.hasOwnProperty(1)"));
-      });
-}
-
-TEST_F(ValueSerializerTest, DecodeInvalidOverLargeArray) {
-  // So large it couldn't exist in the V8 heap, and its size couldn't fit in a
-  // SMI on 32-bit systems (2^30).
-  InvalidDecodeTest({0xFF, 0x09, 0x41, 0x80, 0x80, 0x80, 0x80, 0x04});
-  // Not so large, but there isn't enough data left in the buffer.
-  InvalidDecodeTest({0xFF, 0x09, 0x41, 0x01});
-}
-
-TEST_F(ValueSerializerTest, RoundTripArrayWithNonEnumerableElement) {
-  // Even though this array looks like [1,5,3], the 5 should be missing from the
-  // perspective of structured clone, which only clones properties that were
-  // enumerable.
-  RoundTripTest(
-      "(() => {"
-      "  var x = [1,2,3];"
-      "  Object.defineProperty(x, '1', {enumerable:false, value:5});"
-      "  return x;"
-      "})()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        ASSERT_EQ(3u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(EvaluateScriptForResultBool("!result.hasOwnProperty('1')"));
-      });
-}
-
-TEST_F(ValueSerializerTest, RoundTripArrayWithTrickyGetters) {
-  // If an element is deleted before it is serialized, then it's deleted.
-  RoundTripTest(
-      "(() => {"
-      "  var x = [{ get a() { delete x[1]; }}, 42];"
-      "  return x;"
-      "})()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        ASSERT_EQ(2u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(
-            EvaluateScriptForResultBool("typeof result[1] === 'undefined'"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("!result.hasOwnProperty(1)"));
-      });
-  // Same for sparse arrays.
-  RoundTripTest(
-      "(() => {"
-      "  var x = [{ get a() { delete x[1]; }}, 42];"
-      "  x.length = 1000;"
-      "  return x;"
-      "})()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        ASSERT_EQ(1000u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(
-            EvaluateScriptForResultBool("typeof result[1] === 'undefined'"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("!result.hasOwnProperty(1)"));
-      });
-  // If the length is changed, then the resulting array still has the original
-  // length, but elements that were not yet serialized are gone.
-  RoundTripTest(
-      "(() => {"
-      "  var x = [1, { get a() { x.length = 0; }}, 3, 4];"
-      "  return x;"
-      "})()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        ASSERT_EQ(4u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[0] === 1"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("!result.hasOwnProperty(2)"));
-      });
-  // The same is true if the length is shortened, but there are still items
-  // remaining.
-  RoundTripTest(
-      "(() => {"
-      "  var x = [1, { get a() { x.length = 3; }}, 3, 4];"
-      "  return x;"
-      "})()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        ASSERT_EQ(4u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[2] === 3"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("!result.hasOwnProperty(3)"));
-      });
-  // Same for sparse arrays.
-  RoundTripTest(
-      "(() => {"
-      "  var x = [1, { get a() { x.length = 0; }}, 3, 4];"
-      "  x.length = 1000;"
-      "  return x;"
-      "})()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        ASSERT_EQ(1000u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[0] === 1"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("!result.hasOwnProperty(2)"));
-      });
-  RoundTripTest(
-      "(() => {"
-      "  var x = [1, { get a() { x.length = 3; }}, 3, 4];"
-      "  x.length = 1000;"
-      "  return x;"
-      "})()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        ASSERT_EQ(1000u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[2] === 3"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("!result.hasOwnProperty(3)"));
-      });
-  // If a getter makes a property non-enumerable, it should still be enumerated
-  // as enumeration happens once before getters are invoked.
-  RoundTripTest(
-      "(() => {"
-      "  var x = [{ get a() {"
-      "    Object.defineProperty(x, '1', { value: 3, enumerable: false });"
-      "  }}, 2];"
-      "  return x;"
-      "})()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        ASSERT_EQ(2u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[1] === 3"));
-      });
-  // Same for sparse arrays.
-  RoundTripTest(
-      "(() => {"
-      "  var x = [{ get a() {"
-      "    Object.defineProperty(x, '1', { value: 3, enumerable: false });"
-      "  }}, 2];"
-      "  x.length = 1000;"
-      "  return x;"
-      "})()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        ASSERT_EQ(1000u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[1] === 3"));
-      });
-  // Getters on the array itself must also run.
-  RoundTripTest(
-      "(() => {"
-      "  var x = [1, 2, 3];"
-      "  Object.defineProperty(x, '1', { enumerable: true, get: () => 4 });"
-      "  return x;"
-      "})()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        ASSERT_EQ(3u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[1] === 4"));
-      });
-  // Same for sparse arrays.
-  RoundTripTest(
-      "(() => {"
-      "  var x = [1, 2, 3];"
-      "  Object.defineProperty(x, '1', { enumerable: true, get: () => 4 });"
-      "  x.length = 1000;"
-      "  return x;"
-      "})()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        ASSERT_EQ(1000u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[1] === 4"));
-      });
-  // Even with a getter that deletes things, we don't read from the prototype.
-  RoundTripTest(
-      "(() => {"
-      "  var x = [{ get a() { delete x[1]; } }, 2];"
-      "  x.__proto__ = Object.create(Array.prototype, { 1: { value: 6 } });"
-      "  return x;"
-      "})()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        ASSERT_EQ(2u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(EvaluateScriptForResultBool("!(1 in result)"));
-      });
-  // Same for sparse arrays.
-  RoundTripTest(
-      "(() => {"
-      "  var x = [{ get a() { delete x[1]; } }, 2];"
-      "  x.__proto__ = Object.create(Array.prototype, { 1: { value: 6 } });"
-      "  x.length = 1000;"
-      "  return x;"
-      "})()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        ASSERT_EQ(1000u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(EvaluateScriptForResultBool("!(1 in result)"));
-      });
-}
-
-TEST_F(ValueSerializerTest, DecodeSparseArrayVersion0) {
-  // Empty (sparse) array.
-  DecodeTestForVersion0({0x40, 0x00, 0x00, 0x00},
-                        [](Local<Value> value) {
-                          ASSERT_TRUE(value->IsArray());
-                          ASSERT_EQ(0u, Array::Cast(*value)->Length());
-                        });
-  // Sparse array with a mixture of elements and properties.
-  DecodeTestForVersion0(
-      {0x55, 0x00, 0x53, 0x01, 'a',  0x55, 0x02, 0x55, 0x05, 0x53,
-       0x03, 'f',  'o',  'o',  0x53, 0x03, 'b',  'a',  'r',  0x53,
-       0x03, 'b',  'a',  'z',  0x49, 0x0B, 0x40, 0x04, 0x03, 0x00},
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        EXPECT_EQ(3u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(
-            EvaluateScriptForResultBool("result.toString() === 'a,,5'"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("!(1 in result)"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.foo === 'bar'"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.baz === -6"));
-      });
-  // Sparse array in a sparse array (sanity check of nesting).
-  DecodeTestForVersion0(
-      {0x55, 0x01, 0x55, 0x01, 0x54, 0x40, 0x01, 0x02, 0x40, 0x01, 0x02, 0x00},
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsArray());
-        EXPECT_EQ(2u, Array::Cast(*value)->Length());
-        EXPECT_TRUE(EvaluateScriptForResultBool("!(0 in result)"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[1] instanceof Array"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("!(0 in result[1])"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[1][1] === true"));
-      });
-}
-
-TEST_F(ValueSerializerTest, RoundTripDenseArrayContainingUndefined) {
-  // In previous serialization versions, this would be interpreted as an absent
-  // property.
-  RoundTripTest("[undefined]", [this](Local<Value> value) {
-    ASSERT_TRUE(value->IsArray());
-    EXPECT_EQ(1u, Array::Cast(*value)->Length());
-    EXPECT_TRUE(EvaluateScriptForResultBool("result.hasOwnProperty(0)"));
-    EXPECT_TRUE(EvaluateScriptForResultBool("result[0] === undefined"));
-  });
-}
-
-TEST_F(ValueSerializerTest, DecodeDenseArrayContainingUndefined) {
-  // In previous versions, "undefined" in a dense array signified absence of the
-  // element (for compatibility). In new versions, it has a separate encoding.
-  DecodeTest({0xFF, 0x09, 0x41, 0x01, 0x5F, 0x24, 0x00, 0x01},
-             [this](Local<Value> value) {
-               EXPECT_TRUE(EvaluateScriptForResultBool("!(0 in result)"));
-             });
-  DecodeTest(
-      {0xFF, 0x0B, 0x41, 0x01, 0x5F, 0x24, 0x00, 0x01},
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool("0 in result"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result[0] === undefined"));
-      });
-  DecodeTest({0xFF, 0x0B, 0x41, 0x01, 0x2D, 0x24, 0x00, 0x01},
-             [this](Local<Value> value) {
-               EXPECT_TRUE(EvaluateScriptForResultBool("!(0 in result)"));
-             });
-}
-
-TEST_F(ValueSerializerTest, RoundTripDate) {
-  RoundTripTest("new Date(1e6)", [this](Local<Value> value) {
-    ASSERT_TRUE(value->IsDate());
-    EXPECT_EQ(1e6, Date::Cast(*value)->ValueOf());
-    EXPECT_TRUE(EvaluateScriptForResultBool(
-        "Object.getPrototypeOf(result) === Date.prototype"));
-  });
-  RoundTripTest("new Date(Date.UTC(1867, 6, 1))", [this](Local<Value> value) {
-    ASSERT_TRUE(value->IsDate());
-    EXPECT_TRUE(EvaluateScriptForResultBool(
-        "result.toISOString() === '1867-07-01T00:00:00.000Z'"));
-  });
-  RoundTripTest("new Date(NaN)", [](Local<Value> value) {
-    ASSERT_TRUE(value->IsDate());
-    EXPECT_TRUE(std::isnan(Date::Cast(*value)->ValueOf()));
-  });
-  RoundTripTest(
-      "({ a: new Date(), get b() { return this.a; } })",
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a instanceof Date"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a === result.b"));
-      });
-}
-
-TEST_F(ValueSerializerTest, DecodeDate) {
-#if defined(V8_TARGET_LITTLE_ENDIAN)
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x80, 0x84,
-              0x2E, 0x41, 0x00},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsDate());
-               EXPECT_EQ(1e6, Date::Cast(*value)->ValueOf());
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Object.getPrototypeOf(result) === Date.prototype"));
-             });
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x44, 0x00, 0x00, 0x20, 0x45, 0x27, 0x89,
-              0x87, 0xC2, 0x00},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsDate());
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "result.toISOString() === '1867-07-01T00:00:00.000Z'"));
-             });
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-              0xF8, 0x7F, 0x00},
-             [](Local<Value> value) {
-               ASSERT_TRUE(value->IsDate());
-               EXPECT_TRUE(std::isnan(Date::Cast(*value)->ValueOf()));
-             });
-#else
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x44, 0x41, 0x2E, 0x84, 0x80, 0x00, 0x00,
-              0x00, 0x00, 0x00},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsDate());
-               EXPECT_EQ(1e6, Date::Cast(*value)->ValueOf());
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Object.getPrototypeOf(result) === Date.prototype"));
-             });
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x44, 0xC2, 0x87, 0x89, 0x27, 0x45, 0x20,
-              0x00, 0x00, 0x00},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsDate());
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "result.toISOString() === '1867-07-01T00:00:00.000Z'"));
-             });
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x44, 0x7F, 0xF8, 0x00, 0x00, 0x00, 0x00,
-              0x00, 0x00, 0x00},
-             [](Local<Value> value) {
-               ASSERT_TRUE(value->IsDate());
-               EXPECT_TRUE(std::isnan(Date::Cast(*value)->ValueOf()));
-             });
-#endif
-  DecodeTest(
-      {0xFF, 0x09, 0x3F, 0x00, 0x6F, 0x3F, 0x01, 0x53, 0x01, 0x61, 0x3F,
-       0x01, 0x44, 0x00, 0x20, 0x39, 0x50, 0x37, 0x6A, 0x75, 0x42, 0x3F,
-       0x02, 0x53, 0x01, 0x62, 0x3F, 0x02, 0x5E, 0x01, 0x7B, 0x02},
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a instanceof Date"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a === result.b"));
-      });
-}
-
-TEST_F(ValueSerializerTest, RoundTripValueObjects) {
-  RoundTripTest("new Boolean(true)", [this](Local<Value> value) {
-    EXPECT_TRUE(EvaluateScriptForResultBool(
-        "Object.getPrototypeOf(result) === Boolean.prototype"));
-    EXPECT_TRUE(EvaluateScriptForResultBool("result.valueOf() === true"));
-  });
-  RoundTripTest("new Boolean(false)", [this](Local<Value> value) {
-    EXPECT_TRUE(EvaluateScriptForResultBool(
-        "Object.getPrototypeOf(result) === Boolean.prototype"));
-    EXPECT_TRUE(EvaluateScriptForResultBool("result.valueOf() === false"));
-  });
-  RoundTripTest(
-      "({ a: new Boolean(true), get b() { return this.a; }})",
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a instanceof Boolean"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a === result.b"));
-      });
-  RoundTripTest("new Number(-42)", [this](Local<Value> value) {
-    EXPECT_TRUE(EvaluateScriptForResultBool(
-        "Object.getPrototypeOf(result) === Number.prototype"));
-    EXPECT_TRUE(EvaluateScriptForResultBool("result.valueOf() === -42"));
-  });
-  RoundTripTest("new Number(NaN)", [this](Local<Value> value) {
-    EXPECT_TRUE(EvaluateScriptForResultBool(
-        "Object.getPrototypeOf(result) === Number.prototype"));
-    EXPECT_TRUE(EvaluateScriptForResultBool("Number.isNaN(result.valueOf())"));
-  });
-  RoundTripTest(
-      "({ a: new Number(6), get b() { return this.a; }})",
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a instanceof Number"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a === result.b"));
-      });
-  RoundTripTest("new String('Qu\\xe9bec')", [this](Local<Value> value) {
-    EXPECT_TRUE(EvaluateScriptForResultBool(
-        "Object.getPrototypeOf(result) === String.prototype"));
-    EXPECT_TRUE(
-        EvaluateScriptForResultBool("result.valueOf() === 'Qu\\xe9bec'"));
-    EXPECT_TRUE(EvaluateScriptForResultBool("result.length === 6"));
-  });
-  RoundTripTest("new String('\\ud83d\\udc4a')", [this](Local<Value> value) {
-    EXPECT_TRUE(EvaluateScriptForResultBool(
-        "Object.getPrototypeOf(result) === String.prototype"));
-    EXPECT_TRUE(
-        EvaluateScriptForResultBool("result.valueOf() === '\\ud83d\\udc4a'"));
-    EXPECT_TRUE(EvaluateScriptForResultBool("result.length === 2"));
-  });
-  RoundTripTest(
-      "({ a: new String(), get b() { return this.a; }})",
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a instanceof String"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a === result.b"));
-      });
-}
-
-TEST_F(ValueSerializerTest, RejectsOtherValueObjects) {
-  // This is a roundabout way of getting an instance of Symbol.
-  InvalidEncodeTest("Object.valueOf.apply(Symbol())");
-}
-
-TEST_F(ValueSerializerTest, DecodeValueObjects) {
-  DecodeTest(
-      {0xFF, 0x09, 0x3F, 0x00, 0x79, 0x00}, [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Object.getPrototypeOf(result) === Boolean.prototype"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.valueOf() === true"));
-      });
-  DecodeTest(
-      {0xFF, 0x09, 0x3F, 0x00, 0x78, 0x00}, [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Object.getPrototypeOf(result) === Boolean.prototype"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.valueOf() === false"));
-      });
-  DecodeTest(
-      {0xFF, 0x09, 0x3F, 0x00, 0x6F, 0x3F, 0x01, 0x53, 0x01, 0x61, 0x3F, 0x01,
-       0x79, 0x3F, 0x02, 0x53, 0x01, 0x62, 0x3F, 0x02, 0x5E, 0x01, 0x7B, 0x02},
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a instanceof Boolean"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a === result.b"));
-      });
-#if defined(V8_TARGET_LITTLE_ENDIAN)
-  DecodeTest(
-      {0xFF, 0x09, 0x3F, 0x00, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45,
-       0xC0, 0x00},
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Object.getPrototypeOf(result) === Number.prototype"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.valueOf() === -42"));
-      });
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-              0xF8, 0x7F, 0x00},
-             [this](Local<Value> value) {
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Object.getPrototypeOf(result) === Number.prototype"));
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Number.isNaN(result.valueOf())"));
-             });
-#else
-  DecodeTest(
-      {0xFF, 0x09, 0x3F, 0x00, 0x6E, 0xC0, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00},
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Object.getPrototypeOf(result) === Number.prototype"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.valueOf() === -42"));
-      });
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x6E, 0x7F, 0xF8, 0x00, 0x00, 0x00, 0x00,
-              0x00, 0x00, 0x00},
-             [this](Local<Value> value) {
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Object.getPrototypeOf(result) === Number.prototype"));
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Number.isNaN(result.valueOf())"));
-             });
-#endif
-  DecodeTest(
-      {0xFF, 0x09, 0x3F, 0x00, 0x6F, 0x3F, 0x01, 0x53, 0x01, 0x61, 0x3F,
-       0x01, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x40, 0x3F,
-       0x02, 0x53, 0x01, 0x62, 0x3F, 0x02, 0x5E, 0x01, 0x7B, 0x02},
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a instanceof Number"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a === result.b"));
-      });
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x73, 0x07, 0x51, 0x75, 0xC3, 0xA9, 0x62,
-              0x65, 0x63, 0x00},
-             [this](Local<Value> value) {
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Object.getPrototypeOf(result) === String.prototype"));
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "result.valueOf() === 'Qu\\xe9bec'"));
-               EXPECT_TRUE(EvaluateScriptForResultBool("result.length === 6"));
-             });
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x73, 0x04, 0xF0, 0x9F, 0x91, 0x8A},
-             [this](Local<Value> value) {
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Object.getPrototypeOf(result) === String.prototype"));
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "result.valueOf() === '\\ud83d\\udc4a'"));
-               EXPECT_TRUE(EvaluateScriptForResultBool("result.length === 2"));
-             });
-  DecodeTest(
-      {0xFF, 0x09, 0x3F, 0x00, 0x6F, 0x3F, 0x01, 0x53, 0x01,
-       0x61, 0x3F, 0x01, 0x73, 0x00, 0x3F, 0x02, 0x53, 0x01,
-       0x62, 0x3F, 0x02, 0x5E, 0x01, 0x7B, 0x02, 0x00},
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a instanceof String"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a === result.b"));
-      });
-
-  // String object containing a Latin-1 string.
-  DecodeTest({0xFF, 0x0C, 0x73, 0x22, 0x06, 'Q', 'u', 0xE9, 'b', 'e', 'c'},
-             [this](Local<Value> value) {
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Object.getPrototypeOf(result) === String.prototype"));
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "result.valueOf() === 'Qu\\xe9bec'"));
-               EXPECT_TRUE(EvaluateScriptForResultBool("result.length === 6"));
-             });
-}
-
-TEST_F(ValueSerializerTest, RoundTripRegExp) {
-  RoundTripTest("/foo/g", [this](Local<Value> value) {
-    ASSERT_TRUE(value->IsRegExp());
-    EXPECT_TRUE(EvaluateScriptForResultBool(
-        "Object.getPrototypeOf(result) === RegExp.prototype"));
-    EXPECT_TRUE(EvaluateScriptForResultBool("result.toString() === '/foo/g'"));
-  });
-  RoundTripTest("new RegExp('Qu\\xe9bec', 'i')", [this](Local<Value> value) {
-    ASSERT_TRUE(value->IsRegExp());
-    EXPECT_TRUE(
-        EvaluateScriptForResultBool("result.toString() === '/Qu\\xe9bec/i'"));
-  });
-  RoundTripTest("new RegExp('\\ud83d\\udc4a', 'ug')",
-                [this](Local<Value> value) {
-                  ASSERT_TRUE(value->IsRegExp());
-                  EXPECT_TRUE(EvaluateScriptForResultBool(
-                      "result.toString() === '/\\ud83d\\udc4a/gu'"));
-                });
-  RoundTripTest(
-      "({ a: /foo/gi, get b() { return this.a; }})",
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a instanceof RegExp"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a === result.b"));
-      });
-}
-
-TEST_F(ValueSerializerTest, DecodeRegExp) {
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x52, 0x03, 0x66, 0x6F, 0x6F, 0x01},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsRegExp());
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Object.getPrototypeOf(result) === RegExp.prototype"));
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "result.toString() === '/foo/g'"));
-             });
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x52, 0x07, 0x51, 0x75, 0xC3, 0xA9, 0x62,
-              0x65, 0x63, 0x02},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsRegExp());
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "result.toString() === '/Qu\\xe9bec/i'"));
-             });
-  DecodeTest(
-      {0xFF, 0x09, 0x3F, 0x00, 0x52, 0x04, 0xF0, 0x9F, 0x91, 0x8A, 0x11, 0x00},
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsRegExp());
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "result.toString() === '/\\ud83d\\udc4a/gu'"));
-      });
-  DecodeTest(
-      {0xFF, 0x09, 0x3F, 0x00, 0x6F, 0x3F, 0x01, 0x53, 0x01, 0x61,
-       0x3F, 0x01, 0x52, 0x03, 0x66, 0x6F, 0x6F, 0x03, 0x3F, 0x02,
-       0x53, 0x01, 0x62, 0x3F, 0x02, 0x5E, 0x01, 0x7B, 0x02, 0x00},
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a instanceof RegExp"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a === result.b"));
-      });
-
-  // RegExp containing a Latin-1 string.
-  DecodeTest(
-      {0xFF, 0x0C, 0x52, 0x22, 0x06, 'Q', 'u', 0xE9, 'b', 'e', 'c', 0x02},
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsRegExp());
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "result.toString() === '/Qu\\xe9bec/i'"));
-      });
-}
-
-// Tests that invalid flags are not accepted by the deserializer.
-TEST_F(ValueSerializerTest, DecodeRegExpDotAll) {
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x52, 0x03, 0x66, 0x6F, 0x6F, 0x1F},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsRegExp());
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Object.getPrototypeOf(result) === RegExp.prototype"));
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "result.toString() === '/foo/gimuy'"));
-             });
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x52, 0x03, 0x66, 0x6F, 0x6F, 0x3F},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsRegExp());
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Object.getPrototypeOf(result) === RegExp.prototype"));
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "result.toString() === '/foo/gimsuy'"));
-             });
-  InvalidDecodeTest(
-      {0xFF, 0x09, 0x3F, 0x00, 0x52, 0x03, 0x66, 0x6F, 0x6F, 0x7F});
-}
-
-TEST_F(ValueSerializerTest, RoundTripMap) {
-  RoundTripTest(
-      "(() => { var m = new Map(); m.set(42, 'foo'); return m; })()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsMap());
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Object.getPrototypeOf(result) === Map.prototype"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.size === 1"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.get(42) === 'foo'"));
-      });
-  RoundTripTest("(() => { var m = new Map(); m.set(m, m); return m; })()",
-                [this](Local<Value> value) {
-                  ASSERT_TRUE(value->IsMap());
-                  EXPECT_TRUE(EvaluateScriptForResultBool("result.size === 1"));
-                  EXPECT_TRUE(EvaluateScriptForResultBool(
-                      "result.get(result) === result"));
-                });
-  // Iteration order must be preserved.
-  RoundTripTest(
-      "(() => {"
-      "  var m = new Map();"
-      "  m.set(1, 0); m.set('a', 0); m.set(3, 0); m.set(2, 0);"
-      "  return m;"
-      "})()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsMap());
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Array.from(result.keys()).toString() === '1,a,3,2'"));
-      });
-}
-
-TEST_F(ValueSerializerTest, DecodeMap) {
-  DecodeTest(
-      {0xFF, 0x09, 0x3F, 0x00, 0x3B, 0x3F, 0x01, 0x49, 0x54, 0x3F, 0x01, 0x53,
-       0x03, 0x66, 0x6F, 0x6F, 0x3A, 0x02},
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsMap());
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Object.getPrototypeOf(result) === Map.prototype"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.size === 1"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.get(42) === 'foo'"));
-      });
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3B, 0x3F, 0x01, 0x5E, 0x00, 0x3F, 0x01,
-              0x5E, 0x00, 0x3A, 0x02, 0x00},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsMap());
-               EXPECT_TRUE(EvaluateScriptForResultBool("result.size === 1"));
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "result.get(result) === result"));
-             });
-  // Iteration order must be preserved.
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3B, 0x3F, 0x01, 0x49, 0x02, 0x3F,
-              0x01, 0x49, 0x00, 0x3F, 0x01, 0x53, 0x01, 0x61, 0x3F, 0x01,
-              0x49, 0x00, 0x3F, 0x01, 0x49, 0x06, 0x3F, 0x01, 0x49, 0x00,
-              0x3F, 0x01, 0x49, 0x04, 0x3F, 0x01, 0x49, 0x00, 0x3A, 0x08},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsMap());
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Array.from(result.keys()).toString() === '1,a,3,2'"));
-             });
-}
-
-TEST_F(ValueSerializerTest, RoundTripMapWithTrickyGetters) {
-  // Even if an entry is removed or reassigned, the original key/value pair is
-  // used.
-  RoundTripTest(
-      "(() => {"
-      "  var m = new Map();"
-      "  m.set(0, { get a() {"
-      "    m.delete(1); m.set(2, 'baz'); m.set(3, 'quux');"
-      "  }});"
-      "  m.set(1, 'foo');"
-      "  m.set(2, 'bar');"
-      "  return m;"
-      "})()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsMap());
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Array.from(result.keys()).toString() === '0,1,2'"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.get(1) === 'foo'"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.get(2) === 'bar'"));
-      });
-  // However, deeper modifications of objects yet to be serialized still apply.
-  RoundTripTest(
-      "(() => {"
-      "  var m = new Map();"
-      "  var key = { get a() { value.foo = 'bar'; } };"
-      "  var value = { get a() { key.baz = 'quux'; } };"
-      "  m.set(key, value);"
-      "  return m;"
-      "})()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsMap());
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "!('baz' in Array.from(result.keys())[0])"));
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Array.from(result.values())[0].foo === 'bar'"));
-      });
-}
-
-TEST_F(ValueSerializerTest, RoundTripSet) {
-  RoundTripTest(
-      "(() => { var s = new Set(); s.add(42); s.add('foo'); return s; })()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsSet());
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Object.getPrototypeOf(result) === Set.prototype"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.size === 2"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.has(42)"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.has('foo')"));
-      });
-  RoundTripTest(
-      "(() => { var s = new Set(); s.add(s); return s; })()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsSet());
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.size === 1"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.has(result)"));
-      });
-  // Iteration order must be preserved.
-  RoundTripTest(
-      "(() => {"
-      "  var s = new Set();"
-      "  s.add(1); s.add('a'); s.add(3); s.add(2);"
-      "  return s;"
-      "})()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsSet());
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Array.from(result.keys()).toString() === '1,a,3,2'"));
-      });
-}
-
-TEST_F(ValueSerializerTest, DecodeSet) {
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x27, 0x3F, 0x01, 0x49, 0x54, 0x3F, 0x01,
-              0x53, 0x03, 0x66, 0x6F, 0x6F, 0x2C, 0x02},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsSet());
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Object.getPrototypeOf(result) === Set.prototype"));
-               EXPECT_TRUE(EvaluateScriptForResultBool("result.size === 2"));
-               EXPECT_TRUE(EvaluateScriptForResultBool("result.has(42)"));
-               EXPECT_TRUE(EvaluateScriptForResultBool("result.has('foo')"));
-             });
-  DecodeTest(
-      {0xFF, 0x09, 0x3F, 0x00, 0x27, 0x3F, 0x01, 0x5E, 0x00, 0x2C, 0x01, 0x00},
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsSet());
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.size === 1"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.has(result)"));
-      });
-  // Iteration order must be preserved.
-  DecodeTest(
-      {0xFF, 0x09, 0x3F, 0x00, 0x27, 0x3F, 0x01, 0x49, 0x02, 0x3F, 0x01, 0x53,
-       0x01, 0x61, 0x3F, 0x01, 0x49, 0x06, 0x3F, 0x01, 0x49, 0x04, 0x2C, 0x04},
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsSet());
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Array.from(result.keys()).toString() === '1,a,3,2'"));
-      });
-}
-
-TEST_F(ValueSerializerTest, RoundTripSetWithTrickyGetters) {
-  // Even if an element is added or removed during serialization, the original
-  // set of elements is used.
-  RoundTripTest(
-      "(() => {"
-      "  var s = new Set();"
-      "  s.add({ get a() { s.delete(1); s.add(2); } });"
-      "  s.add(1);"
-      "  return s;"
-      "})()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsSet());
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Array.from(result.keys()).toString() === '[object Object],1'"));
-      });
-  // However, deeper modifications of objects yet to be serialized still apply.
-  RoundTripTest(
-      "(() => {"
-      "  var s = new Set();"
-      "  var first = { get a() { second.foo = 'bar'; } };"
-      "  var second = { get a() { first.baz = 'quux'; } };"
-      "  s.add(first);"
-      "  s.add(second);"
-      "  return s;"
-      "})()",
-      [this](Local<Value> value) {
-        ASSERT_TRUE(value->IsSet());
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "!('baz' in Array.from(result.keys())[0])"));
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Array.from(result.keys())[1].foo === 'bar'"));
-      });
-}
-
-TEST_F(ValueSerializerTest, RoundTripArrayBuffer) {
-  RoundTripTest("new ArrayBuffer()", [this](Local<Value> value) {
-    ASSERT_TRUE(value->IsArrayBuffer());
-    EXPECT_EQ(0u, ArrayBuffer::Cast(*value)->ByteLength());
-    EXPECT_TRUE(EvaluateScriptForResultBool(
-        "Object.getPrototypeOf(result) === ArrayBuffer.prototype"));
-  });
-  RoundTripTest("new Uint8Array([0, 128, 255]).buffer",
-                [this](Local<Value> value) {
-                  ASSERT_TRUE(value->IsArrayBuffer());
-                  EXPECT_EQ(3u, ArrayBuffer::Cast(*value)->ByteLength());
-                  EXPECT_TRUE(EvaluateScriptForResultBool(
-                      "new Uint8Array(result).toString() === '0,128,255'"));
-                });
-  RoundTripTest(
-      "({ a: new ArrayBuffer(), get b() { return this.a; }})",
-      [this](Local<Value> value) {
-        EXPECT_TRUE(
-            EvaluateScriptForResultBool("result.a instanceof ArrayBuffer"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a === result.b"));
-      });
-}
-
-TEST_F(ValueSerializerTest, DecodeArrayBuffer) {
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x42, 0x00},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsArrayBuffer());
-               EXPECT_EQ(0u, ArrayBuffer::Cast(*value)->ByteLength());
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Object.getPrototypeOf(result) === ArrayBuffer.prototype"));
-             });
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x42, 0x03, 0x00, 0x80, 0xFF, 0x00},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsArrayBuffer());
-               EXPECT_EQ(3u, ArrayBuffer::Cast(*value)->ByteLength());
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "new Uint8Array(result).toString() === '0,128,255'"));
-             });
-  DecodeTest(
-      {0xFF, 0x09, 0x3F, 0x00, 0x6F, 0x3F, 0x01, 0x53, 0x01,
-       0x61, 0x3F, 0x01, 0x42, 0x00, 0x3F, 0x02, 0x53, 0x01,
-       0x62, 0x3F, 0x02, 0x5E, 0x01, 0x7B, 0x02, 0x00},
-      [this](Local<Value> value) {
-        EXPECT_TRUE(
-            EvaluateScriptForResultBool("result.a instanceof ArrayBuffer"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a === result.b"));
-      });
-}
-
-TEST_F(ValueSerializerTest, DecodeInvalidArrayBuffer) {
-  InvalidDecodeTest({0xFF, 0x09, 0x42, 0xFF, 0xFF, 0x00});
-}
-
-// An array buffer allocator that never has available memory.
-class OOMArrayBufferAllocator : public ArrayBuffer::Allocator {
- public:
-  void* Allocate(size_t) override { return nullptr; }
-  void* AllocateUninitialized(size_t) override { return nullptr; }
-  void* Reserve(size_t length) override { return nullptr; }
-  void Free(void* data, size_t length, AllocationMode mode) override {}
-  void Free(void*, size_t) override {}
-  void SetProtection(void* data, size_t length,
-                     Protection protection) override {}
-};
-
-TEST_F(ValueSerializerTest, DecodeArrayBufferOOM) {
-  // This test uses less of the harness, because it has to customize the
-  // isolate.
-  OOMArrayBufferAllocator allocator;
-  Isolate::CreateParams params;
-  params.array_buffer_allocator = &allocator;
-  Isolate* isolate = Isolate::New(params);
-  {
-    Isolate::Scope isolate_scope(isolate);
-    HandleScope handle_scope(isolate);
-    Local<Context> context = Context::New(isolate);
-    Context::Scope context_scope(context);
-    TryCatch try_catch(isolate);
-
-    const std::vector<uint8_t> data = {0xFF, 0x09, 0x3F, 0x00, 0x42,
-                                       0x03, 0x00, 0x80, 0xFF, 0x00};
-    ValueDeserializer deserializer(isolate, &data[0],
-                                   static_cast<int>(data.size()), nullptr);
-    deserializer.SetSupportsLegacyWireFormat(true);
-    ASSERT_TRUE(deserializer.ReadHeader(context).FromMaybe(false));
-    ASSERT_FALSE(try_catch.HasCaught());
-    EXPECT_TRUE(deserializer.ReadValue(context).IsEmpty());
-    EXPECT_TRUE(try_catch.HasCaught());
-  }
-  isolate->Dispose();
-}
-
-// Includes an ArrayBuffer wrapper marked for transfer from the serialization
-// context to the deserialization context.
-class ValueSerializerTestWithArrayBufferTransfer : public ValueSerializerTest {
- protected:
-  static const size_t kTestByteLength = 4;
-
-  ValueSerializerTestWithArrayBufferTransfer() {
-    {
-      Context::Scope scope(serialization_context());
-      input_buffer_ = ArrayBuffer::New(isolate(), nullptr, 0);
-    }
-    {
-      Context::Scope scope(deserialization_context());
-      output_buffer_ = ArrayBuffer::New(isolate(), kTestByteLength);
-      const uint8_t data[kTestByteLength] = {0x00, 0x01, 0x80, 0xFF};
-      memcpy(output_buffer_->GetContents().Data(), data, kTestByteLength);
-    }
-  }
-
-  const Local<ArrayBuffer>& input_buffer() { return input_buffer_; }
-  const Local<ArrayBuffer>& output_buffer() { return output_buffer_; }
-
-  void BeforeEncode(ValueSerializer* serializer) override {
-    serializer->TransferArrayBuffer(0, input_buffer_);
-  }
-
-  void AfterEncode() override { input_buffer_->Neuter(); }
-
-  void BeforeDecode(ValueDeserializer* deserializer) override {
-    deserializer->TransferArrayBuffer(0, output_buffer_);
-  }
-
- private:
-  Local<ArrayBuffer> input_buffer_;
-  Local<ArrayBuffer> output_buffer_;
-};
-
-TEST_F(ValueSerializerTestWithArrayBufferTransfer,
-       RoundTripArrayBufferTransfer) {
-  RoundTripTest([this]() { return input_buffer(); },
-                [this](Local<Value> value) {
-                  ASSERT_TRUE(value->IsArrayBuffer());
-                  EXPECT_EQ(output_buffer(), value);
-                  EXPECT_TRUE(EvaluateScriptForResultBool(
-                      "new Uint8Array(result).toString() === '0,1,128,255'"));
-                });
-  RoundTripTest(
-      [this]() {
-        Local<Object> object = Object::New(isolate());
-        EXPECT_TRUE(object
-                        ->CreateDataProperty(serialization_context(),
-                                             StringFromUtf8("a"),
-                                             input_buffer())
-                        .FromMaybe(false));
-        EXPECT_TRUE(object
-                        ->CreateDataProperty(serialization_context(),
-                                             StringFromUtf8("b"),
-                                             input_buffer())
-                        .FromMaybe(false));
-        return object;
-      },
-      [this](Local<Value> value) {
-        EXPECT_TRUE(
-            EvaluateScriptForResultBool("result.a instanceof ArrayBuffer"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a === result.b"));
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "new Uint8Array(result.a).toString() === '0,1,128,255'"));
-      });
-}
-
-TEST_F(ValueSerializerTest, RoundTripTypedArray) {
-// Check that the right type comes out the other side for every kind of typed
-// array.
-#define TYPED_ARRAY_ROUND_TRIP_TEST(Type, type, TYPE, ctype, size)      \
-  RoundTripTest("new " #Type "Array(2)", [this](Local<Value> value) {   \
-    ASSERT_TRUE(value->Is##Type##Array());                              \
-    EXPECT_EQ(2u * size, TypedArray::Cast(*value)->ByteLength());       \
-    EXPECT_EQ(2u, TypedArray::Cast(*value)->Length());                  \
-    EXPECT_TRUE(EvaluateScriptForResultBool(                            \
-        "Object.getPrototypeOf(result) === " #Type "Array.prototype")); \
-  });
-  TYPED_ARRAYS(TYPED_ARRAY_ROUND_TRIP_TEST)
-#undef TYPED_ARRAY_CASE
-
-  // Check that values of various kinds are suitably preserved.
-  RoundTripTest("new Uint8Array([1, 128, 255])", [this](Local<Value> value) {
-    EXPECT_TRUE(
-        EvaluateScriptForResultBool("result.toString() === '1,128,255'"));
-  });
-  RoundTripTest("new Int16Array([0, 256, -32768])", [this](Local<Value> value) {
-    EXPECT_TRUE(
-        EvaluateScriptForResultBool("result.toString() === '0,256,-32768'"));
-  });
-  RoundTripTest("new Float32Array([0, -0.5, NaN, Infinity])",
-                [this](Local<Value> value) {
-                  EXPECT_TRUE(EvaluateScriptForResultBool(
-                      "result.toString() === '0,-0.5,NaN,Infinity'"));
-                });
-
-  // Array buffer views sharing a buffer should do so on the other side.
-  // Similarly, multiple references to the same typed array should be resolved.
-  RoundTripTest(
-      "(() => {"
-      "  var buffer = new ArrayBuffer(32);"
-      "  return {"
-      "    u8: new Uint8Array(buffer),"
-      "    get u8_2() { return this.u8; },"
-      "    f32: new Float32Array(buffer, 4, 5),"
-      "    b: buffer,"
-      "  };"
-      "})()",
-      [this](Local<Value> value) {
-        EXPECT_TRUE(
-            EvaluateScriptForResultBool("result.u8 instanceof Uint8Array"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.u8 === result.u8_2"));
-        EXPECT_TRUE(
-            EvaluateScriptForResultBool("result.f32 instanceof Float32Array"));
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "result.u8.buffer === result.f32.buffer"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.f32.byteOffset === 4"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.f32.length === 5"));
-      });
-}
-
-TEST_F(ValueSerializerTest, DecodeTypedArray) {
-  // Check that the right type comes out the other side for every kind of typed
-  // array.
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3F, 0x00, 0x42, 0x02, 0x00, 0x00, 0x56,
-              0x42, 0x00, 0x02},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsUint8Array());
-               EXPECT_EQ(2u, TypedArray::Cast(*value)->ByteLength());
-               EXPECT_EQ(2u, TypedArray::Cast(*value)->Length());
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Object.getPrototypeOf(result) === Uint8Array.prototype"));
-             });
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3F, 0x00, 0x42, 0x02, 0x00, 0x00, 0x56,
-              0x62, 0x00, 0x02},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsInt8Array());
-               EXPECT_EQ(2u, TypedArray::Cast(*value)->ByteLength());
-               EXPECT_EQ(2u, TypedArray::Cast(*value)->Length());
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Object.getPrototypeOf(result) === Int8Array.prototype"));
-             });
-#if defined(V8_TARGET_LITTLE_ENDIAN)
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3F, 0x00, 0x42, 0x04, 0x00, 0x00, 0x00,
-              0x00, 0x56, 0x57, 0x00, 0x04},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsUint16Array());
-               EXPECT_EQ(4u, TypedArray::Cast(*value)->ByteLength());
-               EXPECT_EQ(2u, TypedArray::Cast(*value)->Length());
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Object.getPrototypeOf(result) === Uint16Array.prototype"));
-             });
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3F, 0x00, 0x42, 0x04, 0x00, 0x00, 0x00,
-              0x00, 0x56, 0x77, 0x00, 0x04},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsInt16Array());
-               EXPECT_EQ(4u, TypedArray::Cast(*value)->ByteLength());
-               EXPECT_EQ(2u, TypedArray::Cast(*value)->Length());
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Object.getPrototypeOf(result) === Int16Array.prototype"));
-             });
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3F, 0x00, 0x42, 0x08, 0x00, 0x00,
-              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x44, 0x00, 0x08},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsUint32Array());
-               EXPECT_EQ(8u, TypedArray::Cast(*value)->ByteLength());
-               EXPECT_EQ(2u, TypedArray::Cast(*value)->Length());
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Object.getPrototypeOf(result) === Uint32Array.prototype"));
-             });
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3F, 0x00, 0x42, 0x08, 0x00, 0x00,
-              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x64, 0x00, 0x08},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsInt32Array());
-               EXPECT_EQ(8u, TypedArray::Cast(*value)->ByteLength());
-               EXPECT_EQ(2u, TypedArray::Cast(*value)->Length());
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Object.getPrototypeOf(result) === Int32Array.prototype"));
-             });
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3F, 0x00, 0x42, 0x08, 0x00, 0x00,
-              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x66, 0x00, 0x08},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsFloat32Array());
-               EXPECT_EQ(8u, TypedArray::Cast(*value)->ByteLength());
-               EXPECT_EQ(2u, TypedArray::Cast(*value)->Length());
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Object.getPrototypeOf(result) === Float32Array.prototype"));
-             });
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3F, 0x00, 0x42, 0x10, 0x00, 0x00,
-              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-              0x00, 0x00, 0x00, 0x00, 0x56, 0x46, 0x00, 0x10},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsFloat64Array());
-               EXPECT_EQ(16u, TypedArray::Cast(*value)->ByteLength());
-               EXPECT_EQ(2u, TypedArray::Cast(*value)->Length());
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Object.getPrototypeOf(result) === Float64Array.prototype"));
-             });
-#endif  // V8_TARGET_LITTLE_ENDIAN
-
-  // Check that values of various kinds are suitably preserved.
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3F, 0x00, 0x42, 0x03, 0x01, 0x80, 0xFF,
-              0x56, 0x42, 0x00, 0x03, 0x00},
-             [this](Local<Value> value) {
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "result.toString() === '1,128,255'"));
-             });
-#if defined(V8_TARGET_LITTLE_ENDIAN)
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3F, 0x00, 0x42, 0x06, 0x00, 0x00, 0x00,
-              0x01, 0x00, 0x80, 0x56, 0x77, 0x00, 0x06},
-             [this](Local<Value> value) {
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "result.toString() === '0,256,-32768'"));
-             });
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3F, 0x00, 0x42, 0x10, 0x00, 0x00,
-              0x00, 0x00, 0x00, 0x00, 0x00, 0xBF, 0x00, 0x00, 0xC0, 0x7F,
-              0x00, 0x00, 0x80, 0x7F, 0x56, 0x66, 0x00, 0x10},
-             [this](Local<Value> value) {
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "result.toString() === '0,-0.5,NaN,Infinity'"));
-             });
-#endif  // V8_TARGET_LITTLE_ENDIAN
-
-  // Array buffer views sharing a buffer should do so on the other side.
-  // Similarly, multiple references to the same typed array should be resolved.
-  DecodeTest(
-      {0xFF, 0x09, 0x3F, 0x00, 0x6F, 0x3F, 0x01, 0x53, 0x02, 0x75, 0x38, 0x3F,
-       0x01, 0x3F, 0x01, 0x42, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x56, 0x42, 0x00, 0x20, 0x3F, 0x03, 0x53, 0x04, 0x75, 0x38, 0x5F,
-       0x32, 0x3F, 0x03, 0x5E, 0x02, 0x3F, 0x03, 0x53, 0x03, 0x66, 0x33, 0x32,
-       0x3F, 0x03, 0x3F, 0x03, 0x5E, 0x01, 0x56, 0x66, 0x04, 0x14, 0x3F, 0x04,
-       0x53, 0x01, 0x62, 0x3F, 0x04, 0x5E, 0x01, 0x7B, 0x04, 0x00},
-      [this](Local<Value> value) {
-        EXPECT_TRUE(
-            EvaluateScriptForResultBool("result.u8 instanceof Uint8Array"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.u8 === result.u8_2"));
-        EXPECT_TRUE(
-            EvaluateScriptForResultBool("result.f32 instanceof Float32Array"));
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "result.u8.buffer === result.f32.buffer"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.f32.byteOffset === 4"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.f32.length === 5"));
-      });
-}
-
-TEST_F(ValueSerializerTest, DecodeInvalidTypedArray) {
-  // Byte offset out of range.
-  InvalidDecodeTest(
-      {0xFF, 0x09, 0x42, 0x02, 0x00, 0x00, 0x56, 0x42, 0x03, 0x01});
-  // Byte offset in range, offset + length out of range.
-  InvalidDecodeTest(
-      {0xFF, 0x09, 0x42, 0x02, 0x00, 0x00, 0x56, 0x42, 0x01, 0x03});
-  // Byte offset not divisible by element size.
-  InvalidDecodeTest(
-      {0xFF, 0x09, 0x42, 0x04, 0x00, 0x00, 0x00, 0x00, 0x56, 0x77, 0x01, 0x02});
-  // Byte length not divisible by element size.
-  InvalidDecodeTest(
-      {0xFF, 0x09, 0x42, 0x04, 0x00, 0x00, 0x00, 0x00, 0x56, 0x77, 0x02, 0x01});
-  // Invalid view type (0xFF).
-  InvalidDecodeTest(
-      {0xFF, 0x09, 0x42, 0x02, 0x00, 0x00, 0x56, 0xFF, 0x01, 0x01});
-}
-
-TEST_F(ValueSerializerTest, RoundTripDataView) {
-  RoundTripTest("new DataView(new ArrayBuffer(4), 1, 2)",
-                [this](Local<Value> value) {
-                  ASSERT_TRUE(value->IsDataView());
-                  EXPECT_EQ(1u, DataView::Cast(*value)->ByteOffset());
-                  EXPECT_EQ(2u, DataView::Cast(*value)->ByteLength());
-                  EXPECT_EQ(4u, DataView::Cast(*value)->Buffer()->ByteLength());
-                  EXPECT_TRUE(EvaluateScriptForResultBool(
-                      "Object.getPrototypeOf(result) === DataView.prototype"));
-                });
-}
-
-TEST_F(ValueSerializerTest, DecodeDataView) {
-  DecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x3F, 0x00, 0x42, 0x04, 0x00, 0x00, 0x00,
-              0x00, 0x56, 0x3F, 0x01, 0x02},
-             [this](Local<Value> value) {
-               ASSERT_TRUE(value->IsDataView());
-               EXPECT_EQ(1u, DataView::Cast(*value)->ByteOffset());
-               EXPECT_EQ(2u, DataView::Cast(*value)->ByteLength());
-               EXPECT_EQ(4u, DataView::Cast(*value)->Buffer()->ByteLength());
-               EXPECT_TRUE(EvaluateScriptForResultBool(
-                   "Object.getPrototypeOf(result) === DataView.prototype"));
-             });
-}
-
-TEST_F(ValueSerializerTest, DecodeInvalidDataView) {
-  // Byte offset out of range.
-  InvalidDecodeTest(
-      {0xFF, 0x09, 0x42, 0x02, 0x00, 0x00, 0x56, 0x3F, 0x03, 0x01});
-  // Byte offset in range, offset + length out of range.
-  InvalidDecodeTest(
-      {0xFF, 0x09, 0x42, 0x02, 0x00, 0x00, 0x56, 0x3F, 0x01, 0x03});
-}
-
-class ValueSerializerTestWithSharedArrayBufferTransfer
-    : public ValueSerializerTest {
- protected:
-  ValueSerializerTestWithSharedArrayBufferTransfer()
-      : serializer_delegate_(this) {}
-
-  void InitializeData(const std::vector<uint8_t>& data) {
-    data_ = data;
-    {
-      Context::Scope scope(serialization_context());
-      input_buffer_ =
-          SharedArrayBuffer::New(isolate(), data_.data(), data_.size());
-    }
-    {
-      Context::Scope scope(deserialization_context());
-      output_buffer_ =
-          SharedArrayBuffer::New(isolate(), data_.data(), data_.size());
-    }
-  }
-
-  const Local<SharedArrayBuffer>& input_buffer() { return input_buffer_; }
-  const Local<SharedArrayBuffer>& output_buffer() { return output_buffer_; }
-
-  void BeforeDecode(ValueDeserializer* deserializer) override {
-    deserializer->TransferSharedArrayBuffer(0, output_buffer_);
-  }
-
-  static void SetUpTestCase() {
-    flag_was_enabled_ = i::FLAG_harmony_sharedarraybuffer;
-    i::FLAG_harmony_sharedarraybuffer = true;
-    ValueSerializerTest::SetUpTestCase();
-  }
-
-  static void TearDownTestCase() {
-    ValueSerializerTest::TearDownTestCase();
-    i::FLAG_harmony_sharedarraybuffer = flag_was_enabled_;
-    flag_was_enabled_ = false;
-  }
-
- protected:
-// GMock doesn't use the "override" keyword.
-#if __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Winconsistent-missing-override"
-#endif
-
-  class SerializerDelegate : public ValueSerializer::Delegate {
-   public:
-    explicit SerializerDelegate(
-        ValueSerializerTestWithSharedArrayBufferTransfer* test)
-        : test_(test) {}
-    MOCK_METHOD2(GetSharedArrayBufferId,
-                 Maybe<uint32_t>(Isolate* isolate,
-                                 Local<SharedArrayBuffer> shared_array_buffer));
-    void ThrowDataCloneError(Local<String> message) override {
-      test_->isolate()->ThrowException(Exception::Error(message));
-    }
-
-   private:
-    ValueSerializerTestWithSharedArrayBufferTransfer* test_;
-  };
-
-#if __clang__
-#pragma clang diagnostic pop
-#endif
-
-  ValueSerializer::Delegate* GetSerializerDelegate() override {
-    return &serializer_delegate_;
-  }
-
-  SerializerDelegate serializer_delegate_;
-
- private:
-  static bool flag_was_enabled_;
-  std::vector<uint8_t> data_;
-  Local<SharedArrayBuffer> input_buffer_;
-  Local<SharedArrayBuffer> output_buffer_;
-};
-
-bool ValueSerializerTestWithSharedArrayBufferTransfer::flag_was_enabled_ =
-    false;
-
-TEST_F(ValueSerializerTestWithSharedArrayBufferTransfer,
-       RoundTripSharedArrayBufferTransfer) {
-  InitializeData({0x00, 0x01, 0x80, 0xFF});
-
-  EXPECT_CALL(serializer_delegate_,
-              GetSharedArrayBufferId(isolate(), input_buffer()))
-      .WillRepeatedly(Return(Just(0U)));
-
-  RoundTripTest([this]() { return input_buffer(); },
-                [this](Local<Value> value) {
-                  ASSERT_TRUE(value->IsSharedArrayBuffer());
-                  EXPECT_EQ(output_buffer(), value);
-                  EXPECT_TRUE(EvaluateScriptForResultBool(
-                      "new Uint8Array(result).toString() === '0,1,128,255'"));
-                });
-  RoundTripTest(
-      [this]() {
-        Local<Object> object = Object::New(isolate());
-        EXPECT_TRUE(object
-                        ->CreateDataProperty(serialization_context(),
-                                             StringFromUtf8("a"),
-                                             input_buffer())
-                        .FromMaybe(false));
-        EXPECT_TRUE(object
-                        ->CreateDataProperty(serialization_context(),
-                                             StringFromUtf8("b"),
-                                             input_buffer())
-                        .FromMaybe(false));
-        return object;
-      },
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "result.a instanceof SharedArrayBuffer"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a === result.b"));
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "new Uint8Array(result.a).toString() === '0,1,128,255'"));
-      });
-}
-
-TEST_F(ValueSerializerTestWithSharedArrayBufferTransfer,
-       RoundTripWebAssemblyMemory) {
-  bool flag_was_enabled = i::FLAG_experimental_wasm_threads;
-  i::FLAG_experimental_wasm_threads = true;
-
-  std::vector<uint8_t> data = {0x00, 0x01, 0x80, 0xFF};
-  data.resize(65536);
-  InitializeData(data);
-
-  EXPECT_CALL(serializer_delegate_,
-              GetSharedArrayBufferId(isolate(), input_buffer()))
-      .WillRepeatedly(Return(Just(0U)));
-
-  RoundTripTest(
-      [this]() -> Local<Value> {
-        const int32_t kMaxPages = 1;
-        auto i_isolate = reinterpret_cast<i::Isolate*>(isolate());
-        i::Handle<i::JSArrayBuffer> obj = Utils::OpenHandle(*input_buffer());
-        return Utils::Convert<i::WasmMemoryObject, Value>(
-            i::WasmMemoryObject::New(i_isolate, obj, kMaxPages));
-      },
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "result instanceof WebAssembly.Memory"));
-        EXPECT_TRUE(
-            EvaluateScriptForResultBool("result.buffer.byteLength === 65536"));
-        EXPECT_TRUE(
-            EvaluateScriptForResultBool("new Uint8Array(result.buffer, 0, "
-                                        "4).toString() === '0,1,128,255'"));
-      });
-
-  i::FLAG_experimental_wasm_threads = flag_was_enabled;
-}
-
-TEST_F(ValueSerializerTest, UnsupportedHostObject) {
-  InvalidEncodeTest("new ExampleHostObject()");
-  InvalidEncodeTest("({ a: new ExampleHostObject() })");
-}
-
-class ValueSerializerTestWithHostObject : public ValueSerializerTest {
- protected:
-  ValueSerializerTestWithHostObject() : serializer_delegate_(this) {}
-
-  static const uint8_t kExampleHostObjectTag;
-
-  void WriteExampleHostObjectTag() {
-    serializer_->WriteRawBytes(&kExampleHostObjectTag, 1);
-  }
-
-  bool ReadExampleHostObjectTag() {
-    const void* tag;
-    return deserializer_->ReadRawBytes(1, &tag) &&
-           *reinterpret_cast<const uint8_t*>(tag) == kExampleHostObjectTag;
-  }
-
-// GMock doesn't use the "override" keyword.
-#if __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Winconsistent-missing-override"
-#endif
-
-  class SerializerDelegate : public ValueSerializer::Delegate {
-   public:
-    explicit SerializerDelegate(ValueSerializerTestWithHostObject* test)
-        : test_(test) {}
-    MOCK_METHOD2(WriteHostObject,
-                 Maybe<bool>(Isolate* isolate, Local<Object> object));
-    void ThrowDataCloneError(Local<String> message) override {
-      test_->isolate()->ThrowException(Exception::Error(message));
-    }
-
-   private:
-    ValueSerializerTestWithHostObject* test_;
-  };
-
-  class DeserializerDelegate : public ValueDeserializer::Delegate {
-   public:
-    MOCK_METHOD1(ReadHostObject, MaybeLocal<Object>(Isolate* isolate));
-  };
-
-#if __clang__
-#pragma clang diagnostic pop
-#endif
-
-  ValueSerializer::Delegate* GetSerializerDelegate() override {
-    return &serializer_delegate_;
-  }
-  void BeforeEncode(ValueSerializer* serializer) override {
-    serializer_ = serializer;
-  }
-  ValueDeserializer::Delegate* GetDeserializerDelegate() override {
-    return &deserializer_delegate_;
-  }
-  void BeforeDecode(ValueDeserializer* deserializer) override {
-    deserializer_ = deserializer;
-  }
-
-  SerializerDelegate serializer_delegate_;
-  DeserializerDelegate deserializer_delegate_;
-  ValueSerializer* serializer_;
-  ValueDeserializer* deserializer_;
-
-  friend class SerializerDelegate;
-  friend class DeserializerDelegate;
-};
-
-// This is a tag that is used in V8. Using this ensures that we have separate
-// tag namespaces.
-const uint8_t ValueSerializerTestWithHostObject::kExampleHostObjectTag = 'T';
-
-TEST_F(ValueSerializerTestWithHostObject, RoundTripUint32) {
-  // The host can serialize data as uint32_t.
-  EXPECT_CALL(serializer_delegate_, WriteHostObject(isolate(), _))
-      .WillRepeatedly(Invoke([this](Isolate*, Local<Object> object) {
-        uint32_t value = 0;
-        EXPECT_TRUE(object->GetInternalField(0)
-                        ->Uint32Value(serialization_context())
-                        .To(&value));
-        WriteExampleHostObjectTag();
-        serializer_->WriteUint32(value);
-        return Just(true);
-      }));
-  EXPECT_CALL(deserializer_delegate_, ReadHostObject(isolate()))
-      .WillRepeatedly(Invoke([this](Isolate*) {
-        EXPECT_TRUE(ReadExampleHostObjectTag());
-        uint32_t value = 0;
-        EXPECT_TRUE(deserializer_->ReadUint32(&value));
-        Local<Value> argv[] = {Integer::NewFromUnsigned(isolate(), value)};
-        return NewHostObject(deserialization_context(), arraysize(argv), argv);
-      }));
-  RoundTripTest("new ExampleHostObject(42)", [this](Local<Value> value) {
-    ASSERT_TRUE(value->IsObject());
-    ASSERT_TRUE(Object::Cast(*value)->InternalFieldCount());
-    EXPECT_TRUE(EvaluateScriptForResultBool(
-        "Object.getPrototypeOf(result) === ExampleHostObject.prototype"));
-    EXPECT_TRUE(EvaluateScriptForResultBool("result.value === 42"));
-  });
-  RoundTripTest(
-      "new ExampleHostObject(0xCAFECAFE)", [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.value === 0xCAFECAFE"));
-      });
-}
-
-TEST_F(ValueSerializerTestWithHostObject, RoundTripUint64) {
-  // The host can serialize data as uint64_t.
-  EXPECT_CALL(serializer_delegate_, WriteHostObject(isolate(), _))
-      .WillRepeatedly(Invoke([this](Isolate*, Local<Object> object) {
-        uint32_t value = 0, value2 = 0;
-        EXPECT_TRUE(object->GetInternalField(0)
-                        ->Uint32Value(serialization_context())
-                        .To(&value));
-        EXPECT_TRUE(object->GetInternalField(1)
-                        ->Uint32Value(serialization_context())
-                        .To(&value2));
-        WriteExampleHostObjectTag();
-        serializer_->WriteUint64((static_cast<uint64_t>(value) << 32) | value2);
-        return Just(true);
-      }));
-  EXPECT_CALL(deserializer_delegate_, ReadHostObject(isolate()))
-      .WillRepeatedly(Invoke([this](Isolate*) {
-        EXPECT_TRUE(ReadExampleHostObjectTag());
-        uint64_t value_packed;
-        EXPECT_TRUE(deserializer_->ReadUint64(&value_packed));
-        Local<Value> argv[] = {
-            Integer::NewFromUnsigned(isolate(),
-                                     static_cast<uint32_t>(value_packed >> 32)),
-            Integer::NewFromUnsigned(isolate(),
-                                     static_cast<uint32_t>(value_packed))};
-        return NewHostObject(deserialization_context(), arraysize(argv), argv);
-      }));
-  RoundTripTest("new ExampleHostObject(42, 0)", [this](Local<Value> value) {
-    ASSERT_TRUE(value->IsObject());
-    ASSERT_TRUE(Object::Cast(*value)->InternalFieldCount());
-    EXPECT_TRUE(EvaluateScriptForResultBool(
-        "Object.getPrototypeOf(result) === ExampleHostObject.prototype"));
-    EXPECT_TRUE(EvaluateScriptForResultBool("result.value === 42"));
-    EXPECT_TRUE(EvaluateScriptForResultBool("result.value2 === 0"));
-  });
-  RoundTripTest(
-      "new ExampleHostObject(0xFFFFFFFF, 0x12345678)",
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.value === 0xFFFFFFFF"));
-        EXPECT_TRUE(
-            EvaluateScriptForResultBool("result.value2 === 0x12345678"));
-      });
-}
-
-TEST_F(ValueSerializerTestWithHostObject, RoundTripDouble) {
-  // The host can serialize data as double.
-  EXPECT_CALL(serializer_delegate_, WriteHostObject(isolate(), _))
-      .WillRepeatedly(Invoke([this](Isolate*, Local<Object> object) {
-        double value = 0;
-        EXPECT_TRUE(object->GetInternalField(0)
-                        ->NumberValue(serialization_context())
-                        .To(&value));
-        WriteExampleHostObjectTag();
-        serializer_->WriteDouble(value);
-        return Just(true);
-      }));
-  EXPECT_CALL(deserializer_delegate_, ReadHostObject(isolate()))
-      .WillRepeatedly(Invoke([this](Isolate*) {
-        EXPECT_TRUE(ReadExampleHostObjectTag());
-        double value = 0;
-        EXPECT_TRUE(deserializer_->ReadDouble(&value));
-        Local<Value> argv[] = {Number::New(isolate(), value)};
-        return NewHostObject(deserialization_context(), arraysize(argv), argv);
-      }));
-  RoundTripTest("new ExampleHostObject(-3.5)", [this](Local<Value> value) {
-    ASSERT_TRUE(value->IsObject());
-    ASSERT_TRUE(Object::Cast(*value)->InternalFieldCount());
-    EXPECT_TRUE(EvaluateScriptForResultBool(
-        "Object.getPrototypeOf(result) === ExampleHostObject.prototype"));
-    EXPECT_TRUE(EvaluateScriptForResultBool("result.value === -3.5"));
-  });
-  RoundTripTest("new ExampleHostObject(NaN)", [this](Local<Value> value) {
-    EXPECT_TRUE(EvaluateScriptForResultBool("Number.isNaN(result.value)"));
-  });
-  RoundTripTest("new ExampleHostObject(Infinity)", [this](Local<Value> value) {
-    EXPECT_TRUE(EvaluateScriptForResultBool("result.value === Infinity"));
-  });
-  RoundTripTest("new ExampleHostObject(-0)", [this](Local<Value> value) {
-    EXPECT_TRUE(EvaluateScriptForResultBool("1/result.value === -Infinity"));
-  });
-}
-
-TEST_F(ValueSerializerTestWithHostObject, RoundTripRawBytes) {
-  // The host can serialize arbitrary raw bytes.
-  const struct {
-    uint64_t u64;
-    uint32_t u32;
-    char str[12];
-  } sample_data = {0x1234567812345678, 0x87654321, "Hello world"};
-  EXPECT_CALL(serializer_delegate_, WriteHostObject(isolate(), _))
-      .WillRepeatedly(
-          Invoke([this, &sample_data](Isolate*, Local<Object> object) {
-            WriteExampleHostObjectTag();
-            serializer_->WriteRawBytes(&sample_data, sizeof(sample_data));
-            return Just(true);
-          }));
-  EXPECT_CALL(deserializer_delegate_, ReadHostObject(isolate()))
-      .WillRepeatedly(Invoke([this, &sample_data](Isolate*) {
-        EXPECT_TRUE(ReadExampleHostObjectTag());
-        const void* copied_data = nullptr;
-        EXPECT_TRUE(
-            deserializer_->ReadRawBytes(sizeof(sample_data), &copied_data));
-        if (copied_data) {
-          EXPECT_EQ(0, memcmp(&sample_data, copied_data, sizeof(sample_data)));
-        }
-        return NewHostObject(deserialization_context(), 0, nullptr);
-      }));
-  RoundTripTest("new ExampleHostObject()", [this](Local<Value> value) {
-    ASSERT_TRUE(value->IsObject());
-    ASSERT_TRUE(Object::Cast(*value)->InternalFieldCount());
-    EXPECT_TRUE(EvaluateScriptForResultBool(
-        "Object.getPrototypeOf(result) === ExampleHostObject.prototype"));
-  });
-}
-
-TEST_F(ValueSerializerTestWithHostObject, RoundTripSameObject) {
-  // If the same object exists in two places, the delegate should be invoked
-  // only once, and the objects should be the same (by reference equality) on
-  // the other side.
-  EXPECT_CALL(serializer_delegate_, WriteHostObject(isolate(), _))
-      .WillOnce(Invoke([this](Isolate*, Local<Object> object) {
-        WriteExampleHostObjectTag();
-        return Just(true);
-      }));
-  EXPECT_CALL(deserializer_delegate_, ReadHostObject(isolate()))
-      .WillOnce(Invoke([this](Isolate*) {
-        EXPECT_TRUE(ReadExampleHostObjectTag());
-        return NewHostObject(deserialization_context(), 0, nullptr);
-      }));
-  RoundTripTest(
-      "({ a: new ExampleHostObject(), get b() { return this.a; }})",
-      [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "result.a instanceof ExampleHostObject"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a === result.b"));
-      });
-}
-
-TEST_F(ValueSerializerTestWithHostObject, DecodeSimpleHostObject) {
-  EXPECT_CALL(deserializer_delegate_, ReadHostObject(isolate()))
-      .WillRepeatedly(Invoke([this](Isolate*) {
-        EXPECT_TRUE(ReadExampleHostObjectTag());
-        return NewHostObject(deserialization_context(), 0, nullptr);
-      }));
-  DecodeTest(
-      {0xFF, 0x0D, 0x5C, kExampleHostObjectTag}, [this](Local<Value> value) {
-        EXPECT_TRUE(EvaluateScriptForResultBool(
-            "Object.getPrototypeOf(result) === ExampleHostObject.prototype"));
-      });
-}
-
-class ValueSerializerTestWithHostArrayBufferView
-    : public ValueSerializerTestWithHostObject {
- protected:
-  void BeforeEncode(ValueSerializer* serializer) override {
-    ValueSerializerTestWithHostObject::BeforeEncode(serializer);
-    serializer_->SetTreatArrayBufferViewsAsHostObjects(true);
-  }
-};
-
-TEST_F(ValueSerializerTestWithHostArrayBufferView, RoundTripUint8ArrayInput) {
-  EXPECT_CALL(serializer_delegate_, WriteHostObject(isolate(), _))
-      .WillOnce(Invoke([this](Isolate*, Local<Object> object) {
-        EXPECT_TRUE(object->IsUint8Array());
-        WriteExampleHostObjectTag();
-        return Just(true);
-      }));
-  EXPECT_CALL(deserializer_delegate_, ReadHostObject(isolate()))
-      .WillOnce(Invoke([this](Isolate*) {
-        EXPECT_TRUE(ReadExampleHostObjectTag());
-        return NewDummyUint8Array();
-      }));
-  RoundTripTest(
-      "({ a: new Uint8Array([1, 2, 3]), get b() { return this.a; }})",
-      [this](Local<Value> value) {
-        EXPECT_TRUE(
-            EvaluateScriptForResultBool("result.a instanceof Uint8Array"));
-        EXPECT_TRUE(
-            EvaluateScriptForResultBool("result.a.toString() === '4,5,6'"));
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.a === result.b"));
-      });
-}
-
-// It's expected that WebAssembly has more exhaustive tests elsewhere; this
-// mostly checks that the logic to embed it in structured clone serialization
-// works correctly.
-
-// A simple module which exports an "increment" function.
-// Copied from test/mjsunit/wasm/incrementer.wasm.
-const unsigned char kIncrementerWasm[] = {
-    0,   97, 115, 109, 1, 0,  0, 0, 1,   6,   1,  96,  1,   127, 1,   127,
-    3,   2,  1,   0,   7, 13, 1, 9, 105, 110, 99, 114, 101, 109, 101, 110,
-    116, 0,  0,   10,  9, 1,  7, 0, 32,  0,   65, 1,   106, 11,
-};
-
-class ValueSerializerTestWithWasm : public ValueSerializerTest {
- public:
-  static const char* kUnsupportedSerialization;
-
-  ValueSerializerTestWithWasm()
-      : serialize_delegate_(&transfer_modules_),
-        deserialize_delegate_(&transfer_modules_) {}
-
-  void Reset() {
-    current_serializer_delegate_ = nullptr;
-    transfer_modules_.clear();
-    SetExpectInlineWasm(false);
-  }
-
-  void EnableTransferSerialization() {
-    current_serializer_delegate_ = &serialize_delegate_;
-  }
-
-  void EnableTransferDeserialization() {
-    current_deserializer_delegate_ = &deserialize_delegate_;
-  }
-
-  void EnableThrowingSerializer() {
-    current_serializer_delegate_ = &throwing_serializer_;
-  }
-
-  void EnableDefaultDeserializer() {
-    current_deserializer_delegate_ = &default_deserializer_;
-  }
-
- protected:
-  static void SetUpTestCase() {
-    g_saved_flag = i::FLAG_expose_wasm;
-    i::FLAG_expose_wasm = true;
-    ValueSerializerTest::SetUpTestCase();
-  }
-
-  static void TearDownTestCase() {
-    ValueSerializerTest::TearDownTestCase();
-    i::FLAG_expose_wasm = g_saved_flag;
-    g_saved_flag = false;
-  }
-
-  class ThrowingSerializer : public ValueSerializer::Delegate {
-   public:
-    Maybe<uint32_t> GetWasmModuleTransferId(
-        Isolate* isolate, Local<WasmCompiledModule> module) override {
-      isolate->ThrowException(Exception::Error(
-          String::NewFromOneByte(
-              isolate,
-              reinterpret_cast<const uint8_t*>(kUnsupportedSerialization),
-              NewStringType::kNormal)
-              .ToLocalChecked()));
-      return Nothing<uint32_t>();
-    }
-
-    void ThrowDataCloneError(Local<String> message) override { UNREACHABLE(); }
-  };
-
-  class SerializeToTransfer : public ValueSerializer::Delegate {
-   public:
-    SerializeToTransfer(
-        std::vector<WasmCompiledModule::TransferrableModule>* modules)
-        : modules_(modules) {}
-    Maybe<uint32_t> GetWasmModuleTransferId(
-        Isolate* isolate, Local<WasmCompiledModule> module) override {
-      modules_->push_back(module->GetTransferrableModule());
-      return Just(static_cast<uint32_t>(modules_->size()) - 1);
-    }
-
-    void ThrowDataCloneError(Local<String> message) override { UNREACHABLE(); }
-
-   private:
-    std::vector<WasmCompiledModule::TransferrableModule>* modules_;
-  };
-
-  class DeserializeFromTransfer : public ValueDeserializer::Delegate {
-   public:
-    DeserializeFromTransfer(
-        std::vector<WasmCompiledModule::TransferrableModule>* modules)
-        : modules_(modules) {}
-
-    MaybeLocal<WasmCompiledModule> GetWasmModuleFromId(Isolate* isolate,
-                                                       uint32_t id) override {
-      return WasmCompiledModule::FromTransferrableModule(isolate,
-                                                         modules_->at(id));
-    }
-
-   private:
-    std::vector<WasmCompiledModule::TransferrableModule>* modules_;
-  };
-
-  ValueSerializer::Delegate* GetSerializerDelegate() override {
-    return current_serializer_delegate_;
-  }
-
-  ValueDeserializer::Delegate* GetDeserializerDelegate() override {
-    return current_deserializer_delegate_;
-  }
-
-  Local<WasmCompiledModule> MakeWasm() {
-    return WasmCompiledModule::DeserializeOrCompile(
-               isolate(), {nullptr, 0},
-               {kIncrementerWasm, sizeof(kIncrementerWasm)})
-        .ToLocalChecked();
-  }
-
-  void ExpectPass() {
-    RoundTripTest(
-        [this]() { return MakeWasm(); },
-        [this](Local<Value> value) {
-          ASSERT_TRUE(value->IsWebAssemblyCompiledModule());
-          EXPECT_TRUE(EvaluateScriptForResultBool(
-              "new WebAssembly.Instance(result).exports.increment(8) === 9"));
-        });
-  }
-
-  void ExpectFail() {
-    EncodeTest(
-        [this]() { return MakeWasm(); },
-        [this](const std::vector<uint8_t>& data) { InvalidDecodeTest(data); });
-  }
-
-  Local<Value> GetComplexObjectWithDuplicate() {
-    Local<Value> wasm_module = MakeWasm();
-    serialization_context()
-        ->Global()
-        ->CreateDataProperty(serialization_context(),
-                             StringFromUtf8("wasm_module"), wasm_module)
-        .FromMaybe(false);
-    Local<Script> script =
-        Script::Compile(
-            serialization_context(),
-            StringFromUtf8("({mod1: wasm_module, num: 2, mod2: wasm_module})"))
-            .ToLocalChecked();
-    return script->Run(serialization_context()).ToLocalChecked();
-  }
-
-  void VerifyComplexObject(Local<Value> value) {
-    ASSERT_TRUE(value->IsObject());
-    EXPECT_TRUE(EvaluateScriptForResultBool(
-        "result.mod1 instanceof WebAssembly.Module"));
-    EXPECT_TRUE(EvaluateScriptForResultBool(
-        "result.mod2 instanceof WebAssembly.Module"));
-    EXPECT_TRUE(EvaluateScriptForResultBool("result.num === 2"));
-  }
-
-  Local<Value> GetComplexObjectWithMany() {
-    Local<Value> wasm_module1 = MakeWasm();
-    Local<Value> wasm_module2 = MakeWasm();
-    serialization_context()
-        ->Global()
-        ->CreateDataProperty(serialization_context(),
-                             StringFromUtf8("wasm_module1"), wasm_module1)
-        .FromMaybe(false);
-    serialization_context()
-        ->Global()
-        ->CreateDataProperty(serialization_context(),
-                             StringFromUtf8("wasm_module2"), wasm_module2)
-        .FromMaybe(false);
-    Local<Script> script =
-        Script::Compile(
-            serialization_context(),
-            StringFromUtf8(
-                "({mod1: wasm_module1, num: 2, mod2: wasm_module2})"))
-            .ToLocalChecked();
-    return script->Run(serialization_context()).ToLocalChecked();
-  }
-
- private:
-  static bool g_saved_flag;
-  std::vector<WasmCompiledModule::TransferrableModule> transfer_modules_;
-  SerializeToTransfer serialize_delegate_;
-  DeserializeFromTransfer deserialize_delegate_;
-  ValueSerializer::Delegate* current_serializer_delegate_ = nullptr;
-  ValueDeserializer::Delegate* current_deserializer_delegate_ = nullptr;
-  ThrowingSerializer throwing_serializer_;
-  ValueDeserializer::Delegate default_deserializer_;
-};
-
-bool ValueSerializerTestWithWasm::g_saved_flag = false;
-const char* ValueSerializerTestWithWasm::kUnsupportedSerialization =
-    "Wasm Serialization Not Supported";
-
-// The default implementation of the serialization
-// delegate throws when trying to serialize wasm. The
-// embedder must decide serialization policy.
-TEST_F(ValueSerializerTestWithWasm, DefaultSerializationDelegate) {
-  EnableThrowingSerializer();
-  InvalidEncodeTest(
-      [this]() { return MakeWasm(); },
-      [](Local<Message> message) {
-        size_t msg_len = static_cast<size_t>(message->Get()->Length());
-        std::unique_ptr<char[]> buff(new char[msg_len + 1]);
-        message->Get()->WriteOneByte(reinterpret_cast<uint8_t*>(buff.get()));
-        // the message ends with the custom error string
-        size_t custom_msg_len = strlen(kUnsupportedSerialization);
-        ASSERT_GE(msg_len, custom_msg_len);
-        size_t start_pos = msg_len - custom_msg_len;
-        ASSERT_EQ(strcmp(&buff.get()[start_pos], kUnsupportedSerialization), 0);
-      });
-}
-
-// The default deserializer throws if wasm transfer is attempted
-TEST_F(ValueSerializerTestWithWasm, DefaultDeserializationDelegate) {
-  EnableTransferSerialization();
-  EnableDefaultDeserializer();
-  EncodeTest(
-      [this]() { return MakeWasm(); },
-      [this](const std::vector<uint8_t>& data) { InvalidDecodeTest(data); });
-}
-
-// We only want to allow deserialization through
-// transferred modules - which requres both serializer
-// and deserializer to understand that - or through
-// explicitly allowing inlined data, which requires
-// deserializer opt-in (we default the serializer to
-// inlined data because we don't trust that data on the
-// receiving end anyway).
-
-TEST_F(ValueSerializerTestWithWasm, RoundtripWasmTransfer) {
-  EnableTransferSerialization();
-  EnableTransferDeserialization();
-  ExpectPass();
-}
-
-TEST_F(ValueSerializerTestWithWasm, RountripWasmInline) {
-  SetExpectInlineWasm(true);
-  ExpectPass();
-}
-
-TEST_F(ValueSerializerTestWithWasm, CannotDeserializeWasmInlineData) {
-  ExpectFail();
-}
-
-TEST_F(ValueSerializerTestWithWasm, CannotTransferWasmWhenExpectingInline) {
-  EnableTransferSerialization();
-  SetExpectInlineWasm(true);
-  ExpectFail();
-}
-
-TEST_F(ValueSerializerTestWithWasm, ComplexObjectDuplicateTransfer) {
-  EnableTransferSerialization();
-  EnableTransferDeserialization();
-  RoundTripTest(
-      [this]() { return GetComplexObjectWithDuplicate(); },
-      [this](Local<Value> value) {
-        VerifyComplexObject(value);
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.mod1 === result.mod2"));
-      });
-}
-
-TEST_F(ValueSerializerTestWithWasm, ComplexObjectDuplicateInline) {
-  SetExpectInlineWasm(true);
-  RoundTripTest(
-      [this]() { return GetComplexObjectWithDuplicate(); },
-      [this](Local<Value> value) {
-        VerifyComplexObject(value);
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.mod1 === result.mod2"));
-      });
-}
-
-TEST_F(ValueSerializerTestWithWasm, ComplexObjectWithManyTransfer) {
-  EnableTransferSerialization();
-  EnableTransferDeserialization();
-  RoundTripTest(
-      [this]() { return GetComplexObjectWithMany(); },
-      [this](Local<Value> value) {
-        VerifyComplexObject(value);
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.mod1 != result.mod2"));
-      });
-}
-
-TEST_F(ValueSerializerTestWithWasm, ComplexObjectWithManyInline) {
-  SetExpectInlineWasm(true);
-  RoundTripTest(
-      [this]() { return GetComplexObjectWithMany(); },
-      [this](Local<Value> value) {
-        VerifyComplexObject(value);
-        EXPECT_TRUE(EvaluateScriptForResultBool("result.mod1 != result.mod2"));
-      });
-}
-
-// As produced around Chrome 56.
-const unsigned char kSerializedIncrementerWasm[] = {
-    0xFF, 0x09, 0x3F, 0x00, 0x57, 0x79, 0x2D, 0x00, 0x61, 0x73, 0x6D, 0x0D,
-    0x00, 0x00, 0x00, 0x01, 0x06, 0x01, 0x60, 0x01, 0x7F, 0x01, 0x7F, 0x03,
-    0x02, 0x01, 0x00, 0x07, 0x0D, 0x01, 0x09, 0x69, 0x6E, 0x63, 0x72, 0x65,
-    0x6D, 0x65, 0x6E, 0x74, 0x00, 0x00, 0x0A, 0x08, 0x01, 0x06, 0x00, 0x20,
-    0x00, 0x41, 0x01, 0x6A, 0xF8, 0x04, 0xA1, 0x06, 0xDE, 0xC0, 0xC6, 0x44,
-    0x3C, 0x29, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x02, 0x00, 0x00, 0x81, 0x4E,
-    0xCE, 0x7C, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x30, 0x02,
-    0x00, 0x00, 0xB0, 0x25, 0x30, 0xE3, 0xF2, 0xDB, 0x2E, 0x48, 0x00, 0x00,
-    0x00, 0x80, 0xE8, 0x00, 0x00, 0x80, 0xE0, 0x01, 0x00, 0x80, 0x00, 0x00,
-    0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x07, 0x08, 0x00, 0x00, 0x09, 0x04,
-    0x10, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3C, 0x8C, 0xC0, 0x00, 0x00,
-    0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x01, 0x10, 0x8C, 0xC0, 0x00, 0x00,
-    0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x70, 0x94, 0x01, 0x0C, 0x8B,
-    0xC1, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x25, 0xDC, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x9E, 0x01, 0x10, 0x8C, 0xC0, 0x00, 0x00,
-    0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x84, 0xC0, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x05, 0x7D, 0x01, 0x1A, 0xE1, 0x02, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x23, 0x88, 0x42, 0x32, 0x03,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x04, 0x00,
-    0x00, 0x02, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
-    0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x49, 0x3B, 0xA5, 0x60, 0x0C, 0x00,
-    0x00, 0x0F, 0x86, 0x04, 0x00, 0x00, 0x00, 0x83, 0xC0, 0x01, 0xC3, 0x55,
-    0x48, 0x89, 0xE5, 0x49, 0xBA, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
-    0x00, 0x41, 0x52, 0x48, 0x83, 0xEC, 0x08, 0x48, 0x89, 0x45, 0xF0, 0x48,
-    0xBB, 0xB0, 0x67, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0xC0, 0x48,
-    0xBE, 0xE1, 0x57, 0x81, 0x85, 0xF6, 0x14, 0x00, 0x00, 0xE8, 0xFC, 0x3C,
-    0xEA, 0xFF, 0x48, 0x8B, 0x45, 0xF0, 0x48, 0x8B, 0xE5, 0x5D, 0xEB, 0xBF,
-    0x66, 0x90, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x44, 0x00,
-    0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x0F, 0x20, 0x84, 0x0F, 0x7D, 0x01, 0x0D, 0x00, 0x0F, 0x04,
-    0x6D, 0x08, 0x0F, 0xF0, 0x02, 0x80, 0x94, 0x01, 0x0C, 0x8B, 0xC1, 0x00,
-    0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xED, 0xA9, 0x2D, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x9E, 0xE0, 0x38, 0x1A, 0x61, 0x03, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x23, 0x88, 0x42, 0x32, 0x03, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9A, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x4E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
-    0x02, 0xF9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
-    0xFF, 0x00, 0x00, 0x00, 0x00, 0x55, 0x48, 0x89, 0xE5, 0x56, 0x57, 0x48,
-    0x8B, 0x45, 0x10, 0xE8, 0x11, 0xED, 0xED, 0xFF, 0xA8, 0x01, 0x0F, 0x85,
-    0x2D, 0x00, 0x00, 0x00, 0x48, 0xC1, 0xE8, 0x20, 0xC5, 0xF9, 0x57, 0xC0,
-    0xC5, 0xFB, 0x2A, 0xC0, 0xC4, 0xE1, 0xFB, 0x2C, 0xC0, 0x48, 0x83, 0xF8,
-    0x01, 0x0F, 0x80, 0x34, 0x00, 0x00, 0x00, 0x8B, 0xC0, 0xE8, 0x27, 0xFE,
-    0xFF, 0xFF, 0x48, 0xC1, 0xE0, 0x20, 0x48, 0x8B, 0xE5, 0x5D, 0xC2, 0x10,
-    0x00, 0x49, 0x39, 0x45, 0xA0, 0x0F, 0x84, 0x07, 0x00, 0x00, 0x00, 0xC5,
-    0xFB, 0x10, 0x40, 0x07, 0xEB, 0xCE, 0x49, 0xBA, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0xF8, 0x7F, 0xC4, 0xC1, 0xF9, 0x6E, 0xC2, 0xEB, 0xBD, 0x48,
-    0x83, 0xEC, 0x08, 0xC5, 0xFB, 0x11, 0x04, 0x24, 0xE8, 0xCC, 0xFE, 0xFF,
-    0xFF, 0x48, 0x83, 0xC4, 0x08, 0xEB, 0xB8, 0x66, 0x90, 0x02, 0x00, 0x00,
-    0x00, 0x03, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
-    0x0F, 0x39, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0xFF, 0x00,
-    0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x20, 0x84,
-    0x0F, 0xCC, 0x6E, 0x7D, 0x01, 0x72, 0x98, 0x00, 0x0F, 0xDC, 0x6D, 0x0C,
-    0x0F, 0xB0, 0x84, 0x0D, 0x04, 0x84, 0xE3, 0xC0, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x84, 0xE0, 0x84, 0x84, 0x18, 0x2F, 0x2F, 0x2F,
-    0x2F, 0x2F};
-
-TEST_F(ValueSerializerTestWithWasm, DecodeWasmModule) {
-  if ((true)) return;  // TODO(mtrofin): fix this test
-  std::vector<uint8_t> raw(
-      kSerializedIncrementerWasm,
-      kSerializedIncrementerWasm + sizeof(kSerializedIncrementerWasm));
-  DecodeTest(raw, [this](Local<Value> value) {
-    ASSERT_TRUE(value->IsWebAssemblyCompiledModule());
-    EXPECT_TRUE(EvaluateScriptForResultBool(
-        "new WebAssembly.Instance(result).exports.increment(8) === 9"));
-  });
-}
-
-// As above, but with empty compiled data. Should work due to fallback to wire
-// data.
-const unsigned char kSerializedIncrementerWasmWithInvalidCompiledData[] = {
-    0xFF, 0x09, 0x3F, 0x00, 0x57, 0x79, 0x2D, 0x00, 0x61, 0x73, 0x6D,
-    0x0D, 0x00, 0x00, 0x00, 0x01, 0x06, 0x01, 0x60, 0x01, 0x7F, 0x01,
-    0x7F, 0x03, 0x02, 0x01, 0x00, 0x07, 0x0D, 0x01, 0x09, 0x69, 0x6E,
-    0x63, 0x72, 0x65, 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x00, 0x0A, 0x08,
-    0x01, 0x06, 0x00, 0x20, 0x00, 0x41, 0x01, 0x6A, 0x00};
-
-TEST_F(ValueSerializerTestWithWasm, DecodeWasmModuleWithInvalidCompiledData) {
-  if ((true)) return;  // TODO(titzer): regenerate this test
-  std::vector<uint8_t> raw(
-      kSerializedIncrementerWasmWithInvalidCompiledData,
-      kSerializedIncrementerWasmWithInvalidCompiledData +
-          sizeof(kSerializedIncrementerWasmWithInvalidCompiledData));
-  DecodeTest(raw, [this](Local<Value> value) {
-    ASSERT_TRUE(value->IsWebAssemblyCompiledModule());
-    EXPECT_TRUE(EvaluateScriptForResultBool(
-        "new WebAssembly.Instance(result).exports.increment(8) === 9"));
-  });
-}
-
-// As above, but also with empty wire data. Should fail.
-const unsigned char kSerializedIncrementerWasmInvalid[] = {
-    0xFF, 0x09, 0x3F, 0x00, 0x57, 0x79, 0x00, 0x00};
-
-TEST_F(ValueSerializerTestWithWasm,
-       DecodeWasmModuleWithInvalidCompiledAndWireData) {
-  std::vector<uint8_t> raw(kSerializedIncrementerWasmInvalid,
-                           kSerializedIncrementerWasmInvalid +
-                               sizeof(kSerializedIncrementerWasmInvalid));
-  InvalidDecodeTest(raw);
-}
-
-TEST_F(ValueSerializerTestWithWasm, DecodeWasmModuleWithInvalidDataLength) {
-  InvalidDecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x57, 0x79, 0x7F, 0x00});
-  InvalidDecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x57, 0x79, 0x00, 0x7F});
-}
-
-}  // namespace
-}  // namespace v8
diff --git a/src/v8/test/unittests/wasm/trap-handler-unittest.cc b/src/v8/test/unittests/wasm/trap-handler-unittest.cc
deleted file mode 100644
index eb57864..0000000
--- a/src/v8/test/unittests/wasm/trap-handler-unittest.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright 2017 the V8 project 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 "src/trap-handler/trap-handler.h"
-#include "include/v8.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-#if V8_OS_POSIX
-#include <setjmp.h>
-#include <signal.h>
-#endif
-
-namespace {
-
-#if V8_OS_POSIX
-
-void CrashOnPurpose() { *reinterpret_cast<volatile int*>(42); }
-
-// When using V8::RegisterDefaultSignalHandler, we save the old one to fall back
-// on if V8 doesn't handle the signal. This allows tools like ASan to register a
-// handler early on during the process startup and still generate stack traces
-// on failures.
-class SignalHandlerFallbackTest : public ::testing::Test {
- protected:
-  virtual void SetUp() {
-    struct sigaction action;
-    action.sa_sigaction = SignalHandler;
-    sigemptyset(&action.sa_mask);
-    action.sa_flags = SA_SIGINFO;
-    sigaction(SIGSEGV, &action, &old_segv_action_);
-    sigaction(SIGBUS, &action, &old_bus_action_);
-  }
-
-  virtual void TearDown() {
-    // be a good citizen and restore the old signal handler.
-    sigaction(SIGSEGV, &old_segv_action_, nullptr);
-    sigaction(SIGBUS, &old_bus_action_, nullptr);
-  }
-
-  static sigjmp_buf continuation_;
-
- private:
-  static void SignalHandler(int signal, siginfo_t* info, void*) {
-    siglongjmp(continuation_, 1);
-  }
-  struct sigaction old_segv_action_;
-  struct sigaction old_bus_action_;  // We get SIGBUS on Mac sometimes.
-};
-sigjmp_buf SignalHandlerFallbackTest::continuation_;
-
-TEST_F(SignalHandlerFallbackTest, DoTest) {
-  const int save_sigs = 1;
-  if (!sigsetjmp(continuation_, save_sigs)) {
-    v8::V8::RegisterDefaultSignalHandler();
-    CrashOnPurpose();
-    FAIL();
-  } else {
-    // Our signal handler ran.
-    v8::internal::trap_handler::RestoreOriginalSignalHandler();
-    SUCCEED();
-    return;
-  }
-  FAIL();
-}
-
-#endif
-
-}  //  namespace
diff --git a/src/v8/test/unittests/zone/segmentpool-unittest.cc b/src/v8/test/unittests/zone/segmentpool-unittest.cc
deleted file mode 100644
index b3556a9..0000000
--- a/src/v8/test/unittests/zone/segmentpool-unittest.cc
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2016 the V8 project 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 "src/zone/accounting-allocator.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace v8 {
-namespace internal {
-
-TEST(Zone, SegmentPoolConstraints) {
-  size_t sizes[]{
-      0,  // Corner case
-      AccountingAllocator::kMaxPoolSize,
-      GB  // Something really large
-  };
-
-  AccountingAllocator allocator;
-  for (size_t size : sizes) {
-    allocator.ConfigureSegmentPool(size);
-    size_t total_size = 0;
-    for (size_t power = 0; power < AccountingAllocator::kNumberBuckets;
-         ++power) {
-      total_size +=
-          allocator.unused_segments_max_sizes_[power] * (size_t(1) << power);
-    }
-    EXPECT_LE(total_size, size);
-  }
-}
-
-}  // namespace internal
-}  // namespace v8
diff --git a/src/v8/test/wasm-spec-tests/wasm-spec-tests.gyp b/src/v8/test/wasm-spec-tests/wasm-spec-tests.gyp
deleted file mode 100644
index 711f982..0000000
--- a/src/v8/test/wasm-spec-tests/wasm-spec-tests.gyp
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2017 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'conditions': [
-    ['test_isolation_mode != "noop"', {
-      'targets': [
-        {
-          'target_name': 'wasm_spec_tests_run',
-          'type': 'none',
-          'dependencies': [
-            '../../src/d8.gyp:d8_run',
-          ],
-          'includes': [
-            '../../gypfiles/features.gypi',
-            '../../gypfiles/isolate.gypi',
-          ],
-          'sources': [
-            'wasm-spec-tests.isolate',
-          ],
-        },
-      ],
-    }],
-  ],
-}
diff --git a/src/v8/test/wasm-spec-tests/wasm-spec-tests.isolate b/src/v8/test/wasm-spec-tests/wasm-spec-tests.isolate
deleted file mode 100644
index 4c29f9f..0000000
--- a/src/v8/test/wasm-spec-tests/wasm-spec-tests.isolate
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright 2017 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'variables': {
-    'files': [
-      './',
-    ],
-  },
-  'includes': [
-    '../../src/d8.isolate',
-    '../../tools/testrunner/testrunner.isolate',
-  ],
-}
-
diff --git a/src/v8/test/webkit/webkit.gyp b/src/v8/test/webkit/webkit.gyp
deleted file mode 100644
index cd4c4b9..0000000
--- a/src/v8/test/webkit/webkit.gyp
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'conditions': [
-    ['test_isolation_mode != "noop"', {
-      'targets': [
-        {
-          'target_name': 'webkit_run',
-          'type': 'none',
-          'dependencies': [
-            '../../src/d8.gyp:d8_run',
-          ],
-          'includes': [
-            '../../gypfiles/features.gypi',
-            '../../gypfiles/isolate.gypi',
-          ],
-          'sources': [
-            'webkit.isolate',
-          ],
-        },
-      ],
-    }],
-  ],
-}
diff --git a/src/v8/test/webkit/webkit.isolate b/src/v8/test/webkit/webkit.isolate
deleted file mode 100644
index dbeca5e..0000000
--- a/src/v8/test/webkit/webkit.isolate
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'variables': {
-    'files': [
-      './',
-    ],
-  },
-  'includes': [
-    '../../src/d8.isolate',
-    '../../tools/testrunner/testrunner.isolate',
-  ],
-}
\ No newline at end of file
diff --git a/src/v8/testing/gmock.gyp b/src/v8/testing/gmock.gyp
deleted file mode 100644
index 89c97e3..0000000
--- a/src/v8/testing/gmock.gyp
+++ /dev/null
@@ -1,72 +0,0 @@
-# Copyright 2014 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      'target_name': 'gmock',
-      'type': 'static_library',
-      'dependencies': [
-        'gtest.gyp:gtest',
-      ],
-      'sources': [
-        # Sources based on files in r173 of gmock.
-        'gmock/include/gmock/gmock-actions.h',
-        'gmock/include/gmock/gmock-cardinalities.h',
-        'gmock/include/gmock/gmock-generated-actions.h',
-        'gmock/include/gmock/gmock-generated-function-mockers.h',
-        'gmock/include/gmock/gmock-generated-matchers.h',
-        'gmock/include/gmock/gmock-generated-nice-strict.h',
-        'gmock/include/gmock/gmock-matchers.h',
-        'gmock/include/gmock/gmock-spec-builders.h',
-        'gmock/include/gmock/gmock.h',
-        'gmock/include/gmock/internal/gmock-generated-internal-utils.h',
-        'gmock/include/gmock/internal/gmock-internal-utils.h',
-        'gmock/include/gmock/internal/gmock-port.h',
-        'gmock/src/gmock-all.cc',
-        'gmock/src/gmock-cardinalities.cc',
-        'gmock/src/gmock-internal-utils.cc',
-        'gmock/src/gmock-matchers.cc',
-        'gmock/src/gmock-spec-builders.cc',
-        'gmock/src/gmock.cc',
-        'gmock-support.h',  # gMock helpers
-        'gmock_custom/gmock/internal/custom/gmock-port.h',
-      ],
-      'sources!': [
-        'gmock/src/gmock-all.cc',  # Not needed by our build.
-      ],
-      'include_dirs': [
-        'gmock_custom',
-        'gmock',
-        'gmock/include',
-      ],
-      'all_dependent_settings': {
-        'include_dirs': [
-          'gmock_custom',
-          'gmock/include',  # So that gmock headers can find themselves.
-        ],
-      },
-      'export_dependent_settings': [
-        'gtest.gyp:gtest',
-      ],
-      'conditions': [
-        ['want_separate_host_toolset==1', {
-          'toolsets': ['host', 'target'],
-        }, {
-          'toolsets': ['target'],
-        }],
-      ],
-    },
-    {
-      'target_name': 'gmock_main',
-      'type': 'static_library',
-      'dependencies': [
-        'gmock',
-      ],
-      'sources': [
-        'gmock/src/gmock_main.cc',
-      ],
-    },
-  ],
-}
diff --git a/src/v8/testing/gmock_custom/gmock/internal/custom/gmock-port.h b/src/v8/testing/gmock_custom/gmock/internal/custom/gmock-port.h
deleted file mode 100644
index 1e8d86d..0000000
--- a/src/v8/testing/gmock_custom/gmock/internal/custom/gmock-port.h
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Copied from http://crrev.com/6ad76b419eacefc4/testing/gmock_custom/gmock/internal/custom/gmock-port.h
-
-#ifndef TESTING_GMOCK_CUSTOM_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
-#define TESTING_GMOCK_CUSTOM_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
-
-#include <type_traits>
-
-namespace std {
-
-// Provide alternative implementation of std::is_default_constructible for
-// old, pre-4.7 of libstdc++, where is_default_constructible is missing.
-// <20120322 below implies pre-4.7.0. In addition we blacklist several version
-// that released after 4.7.0 from pre-4.7.0 branch. 20120702 implies 4.5.4, and
-// 20121127 implies 4.6.4.
-#if defined(__GLIBCXX__) &&   \
-  (__GLIBCXX__ < 20120322 ||  \
-   __GLIBCXX__ == 20120702 || \
-   __GLIBCXX__ == 20121127)
-template <typename T>
-using is_default_constructible = std::is_constructible<T>;
-#endif
-
-}
-
-#endif  // TESTING_GMOCK_CUSTOM_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
diff --git a/src/v8/testing/gtest.gyp b/src/v8/testing/gtest.gyp
deleted file mode 100644
index a94ee88..0000000
--- a/src/v8/testing/gtest.gyp
+++ /dev/null
@@ -1,122 +0,0 @@
-# Copyright 2014 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      'target_name': 'gtest',
-      'toolsets': ['host', 'target'],
-      'type': 'static_library',
-      'sources': [
-        'gtest/include/gtest/gtest-death-test.h',
-        'gtest/include/gtest/gtest-message.h',
-        'gtest/include/gtest/gtest-param-test.h',
-        'gtest/include/gtest/gtest-printers.h',
-        'gtest/include/gtest/gtest-spi.h',
-        'gtest/include/gtest/gtest-test-part.h',
-        'gtest/include/gtest/gtest-typed-test.h',
-        'gtest/include/gtest/gtest.h',
-        'gtest/include/gtest/gtest_pred_impl.h',
-        'gtest/include/gtest/internal/gtest-death-test-internal.h',
-        'gtest/include/gtest/internal/gtest-filepath.h',
-        'gtest/include/gtest/internal/gtest-internal.h',
-        'gtest/include/gtest/internal/gtest-linked_ptr.h',
-        'gtest/include/gtest/internal/gtest-param-util-generated.h',
-        'gtest/include/gtest/internal/gtest-param-util.h',
-        'gtest/include/gtest/internal/gtest-port.h',
-        'gtest/include/gtest/internal/gtest-string.h',
-        'gtest/include/gtest/internal/gtest-tuple.h',
-        'gtest/include/gtest/internal/gtest-type-util.h',
-        'gtest/src/gtest-all.cc',
-        'gtest/src/gtest-death-test.cc',
-        'gtest/src/gtest-filepath.cc',
-        'gtest/src/gtest-internal-inl.h',
-        'gtest/src/gtest-port.cc',
-        'gtest/src/gtest-printers.cc',
-        'gtest/src/gtest-test-part.cc',
-        'gtest/src/gtest-typed-test.cc',
-        'gtest/src/gtest.cc',
-        'gtest-support.h',
-      ],
-      'sources!': [
-        'gtest/src/gtest-all.cc',  # Not needed by our build.
-      ],
-      'include_dirs': [
-        'gtest',
-        'gtest/include',
-      ],
-      'dependencies': [
-        'gtest_prod',
-      ],
-      'defines': [
-        # In order to allow regex matches in gtest to be shared between Windows
-        # and other systems, we tell gtest to always use it's internal engine.
-        'GTEST_HAS_POSIX_RE=0',
-        'GTEST_LANG_CXX11=1',
-      ],
-      'all_dependent_settings': {
-        'defines': [
-          'GTEST_HAS_POSIX_RE=0',
-          'GTEST_LANG_CXX11=1',
-        ],
-      },
-      'conditions': [
-        ['OS=="android"', {
-          'defines': [
-            'GTEST_HAS_CLONE=0',
-          ],
-          'direct_dependent_settings': {
-            'defines': [
-              'GTEST_HAS_CLONE=0',
-            ],
-          },
-        }],
-      ],
-      'direct_dependent_settings': {
-        'defines': [
-          'UNIT_TEST',
-        ],
-        'include_dirs': [
-          'gtest/include',  # So that gtest headers can find themselves.
-        ],
-        'target_conditions': [
-          ['_type=="executable"', {
-            'test': 1,
-            'conditions': [
-              ['OS=="mac"', {
-                'run_as': {
-                  'action????': ['${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}'],
-                },
-              }],
-              ['OS=="win"', {
-                'run_as': {
-                  'action????': ['$(TargetPath)', '--gtest_print_time'],
-                },
-              }],
-            ],
-          }],
-        ],
-        'msvs_disabled_warnings': [4800],
-      },
-    },
-    {
-      'target_name': 'gtest_main',
-      'type': 'static_library',
-      'dependencies': [
-        'gtest',
-      ],
-      'sources': [
-        'gtest/src/gtest_main.cc',
-      ],
-    },
-    {
-      'target_name': 'gtest_prod',
-      'toolsets': ['host', 'target'],
-      'type': 'none',
-      'sources': [
-        'gtest/include/gtest/gtest_prod.h',
-      ],
-    },
-  ],
-}
diff --git a/src/v8/third_party/inspector_protocol/CheckProtocolCompatibility.py b/src/v8/third_party/inspector_protocol/CheckProtocolCompatibility.py
deleted file mode 100755
index c70162a..0000000
--- a/src/v8/third_party/inspector_protocol/CheckProtocolCompatibility.py
+++ /dev/null
@@ -1,479 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2011 Google Inc. 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.
-#
-# Inspector protocol validator.
-#
-# Tests that subsequent protocol changes are not breaking backwards compatibility.
-# Following violations are reported:
-#
-#   - Domain has been removed
-#   - Command has been removed
-#   - Required command parameter was added or changed from optional
-#   - Required response parameter was removed or changed to optional
-#   - Event has been removed
-#   - Required event parameter was removed or changed to optional
-#   - Parameter type has changed.
-#
-# For the parameters with composite types the above checks are also applied
-# recursively to every property of the type.
-#
-# Adding --show_changes to the command line prints out a list of valid public API changes.
-
-import copy
-import os.path
-import optparse
-import sys
-
-try:
-    import json
-except ImportError:
-    import simplejson as json
-
-
-def list_to_map(items, key):
-    result = {}
-    for item in items:
-        if "experimental" not in item and "hidden" not in item:
-            result[item[key]] = item
-    return result
-
-
-def named_list_to_map(container, name, key):
-    if name in container:
-        return list_to_map(container[name], key)
-    return {}
-
-
-def removed(reverse):
-    if reverse:
-        return "added"
-    return "removed"
-
-
-def required(reverse):
-    if reverse:
-        return "optional"
-    return "required"
-
-
-def compare_schemas(d_1, d_2, reverse):
-    errors = []
-    domains_1 = copy.deepcopy(d_1)
-    domains_2 = copy.deepcopy(d_2)
-    types_1 = normalize_types_in_schema(domains_1)
-    types_2 = normalize_types_in_schema(domains_2)
-
-    domains_by_name_1 = list_to_map(domains_1, "domain")
-    domains_by_name_2 = list_to_map(domains_2, "domain")
-
-    for name in domains_by_name_1:
-        domain_1 = domains_by_name_1[name]
-        if name not in domains_by_name_2:
-            errors.append("%s: domain has been %s" % (name, removed(reverse)))
-            continue
-        compare_domains(domain_1, domains_by_name_2[name], types_1, types_2, errors, reverse)
-    return errors
-
-
-def compare_domains(domain_1, domain_2, types_map_1, types_map_2, errors, reverse):
-    domain_name = domain_1["domain"]
-    commands_1 = named_list_to_map(domain_1, "commands", "name")
-    commands_2 = named_list_to_map(domain_2, "commands", "name")
-    for name in commands_1:
-        command_1 = commands_1[name]
-        if name not in commands_2:
-            errors.append("%s.%s: command has been %s" % (domain_1["domain"], name, removed(reverse)))
-            continue
-        compare_commands(domain_name, command_1, commands_2[name], types_map_1, types_map_2, errors, reverse)
-
-    events_1 = named_list_to_map(domain_1, "events", "name")
-    events_2 = named_list_to_map(domain_2, "events", "name")
-    for name in events_1:
-        event_1 = events_1[name]
-        if name not in events_2:
-            errors.append("%s.%s: event has been %s" % (domain_1["domain"], name, removed(reverse)))
-            continue
-        compare_events(domain_name, event_1, events_2[name], types_map_1, types_map_2, errors, reverse)
-
-
-def compare_commands(domain_name, command_1, command_2, types_map_1, types_map_2, errors, reverse):
-    context = domain_name + "." + command_1["name"]
-
-    params_1 = named_list_to_map(command_1, "parameters", "name")
-    params_2 = named_list_to_map(command_2, "parameters", "name")
-    # Note the reversed order: we allow removing but forbid adding parameters.
-    compare_params_list(context, "parameter", params_2, params_1, types_map_2, types_map_1, 0, errors, not reverse)
-
-    returns_1 = named_list_to_map(command_1, "returns", "name")
-    returns_2 = named_list_to_map(command_2, "returns", "name")
-    compare_params_list(context, "response parameter", returns_1, returns_2, types_map_1, types_map_2, 0, errors, reverse)
-
-
-def compare_events(domain_name, event_1, event_2, types_map_1, types_map_2, errors, reverse):
-    context = domain_name + "." + event_1["name"]
-    params_1 = named_list_to_map(event_1, "parameters", "name")
-    params_2 = named_list_to_map(event_2, "parameters", "name")
-    compare_params_list(context, "parameter", params_1, params_2, types_map_1, types_map_2, 0, errors, reverse)
-
-
-def compare_params_list(context, kind, params_1, params_2, types_map_1, types_map_2, depth, errors, reverse):
-    for name in params_1:
-        param_1 = params_1[name]
-        if name not in params_2:
-            if "optional" not in param_1:
-                errors.append("%s.%s: required %s has been %s" % (context, name, kind, removed(reverse)))
-            continue
-
-        param_2 = params_2[name]
-        if param_2 and "optional" in param_2 and "optional" not in param_1:
-            errors.append("%s.%s: %s %s is now %s" % (context, name, required(reverse), kind, required(not reverse)))
-            continue
-        type_1 = extract_type(param_1, types_map_1, errors)
-        type_2 = extract_type(param_2, types_map_2, errors)
-        compare_types(context + "." + name, kind, type_1, type_2, types_map_1, types_map_2, depth, errors, reverse)
-
-
-def compare_types(context, kind, type_1, type_2, types_map_1, types_map_2, depth, errors, reverse):
-    if depth > 5:
-        return
-
-    base_type_1 = type_1["type"]
-    base_type_2 = type_2["type"]
-
-    if base_type_1 != base_type_2:
-        errors.append("%s: %s base type mismatch, '%s' vs '%s'" % (context, kind, base_type_1, base_type_2))
-    elif base_type_1 == "object":
-        params_1 = named_list_to_map(type_1, "properties", "name")
-        params_2 = named_list_to_map(type_2, "properties", "name")
-        # If both parameters have the same named type use it in the context.
-        if "id" in type_1 and "id" in type_2 and type_1["id"] == type_2["id"]:
-            type_name = type_1["id"]
-        else:
-            type_name = "<object>"
-        context += " %s->%s" % (kind, type_name)
-        compare_params_list(context, "property", params_1, params_2, types_map_1, types_map_2, depth + 1, errors, reverse)
-    elif base_type_1 == "array":
-        item_type_1 = extract_type(type_1["items"], types_map_1, errors)
-        item_type_2 = extract_type(type_2["items"], types_map_2, errors)
-        compare_types(context, kind, item_type_1, item_type_2, types_map_1, types_map_2, depth + 1, errors, reverse)
-
-
-def extract_type(typed_object, types_map, errors):
-    if "type" in typed_object:
-        result = {"id": "<transient>", "type": typed_object["type"]}
-        if typed_object["type"] == "object":
-            result["properties"] = []
-        elif typed_object["type"] == "array":
-            result["items"] = typed_object["items"]
-        return result
-    elif "$ref" in typed_object:
-        ref = typed_object["$ref"]
-        if ref not in types_map:
-            errors.append("Can not resolve type: %s" % ref)
-            types_map[ref] = {"id": "<transient>", "type": "object"}
-        return types_map[ref]
-
-
-def normalize_types_in_schema(domains):
-    types = {}
-    for domain in domains:
-        domain_name = domain["domain"]
-        normalize_types(domain, domain_name, types)
-    return types
-
-
-def normalize_types(obj, domain_name, types):
-    if isinstance(obj, list):
-        for item in obj:
-            normalize_types(item, domain_name, types)
-    elif isinstance(obj, dict):
-        for key, value in obj.items():
-            if key == "$ref" and value.find(".") == -1:
-                obj[key] = "%s.%s" % (domain_name, value)
-            elif key == "id":
-                obj[key] = "%s.%s" % (domain_name, value)
-                types[obj[key]] = obj
-            else:
-                normalize_types(value, domain_name, types)
-
-
-def load_schema(file_name, domains):
-    # pylint: disable=W0613
-    if not os.path.isfile(file_name):
-        return
-    input_file = open(file_name, "r")
-    json_string = input_file.read()
-    parsed_json = json.loads(json_string)
-    domains += parsed_json["domains"]
-    return parsed_json["version"]
-
-
-def self_test():
-    def create_test_schema_1():
-        return [
-            {
-                "domain": "Network",
-                "types": [
-                    {
-                        "id": "LoaderId",
-                        "type": "string"
-                    },
-                    {
-                        "id": "Headers",
-                        "type": "object"
-                    },
-                    {
-                        "id": "Request",
-                        "type": "object",
-                        "properties": [
-                            {"name": "url", "type": "string"},
-                            {"name": "method", "type": "string"},
-                            {"name": "headers", "$ref": "Headers"},
-                            {"name": "becameOptionalField", "type": "string"},
-                            {"name": "removedField", "type": "string"},
-                        ]
-                    }
-                ],
-                "commands": [
-                    {
-                        "name": "removedCommand",
-                    },
-                    {
-                        "name": "setExtraHTTPHeaders",
-                        "parameters": [
-                            {"name": "headers", "$ref": "Headers"},
-                            {"name": "mismatched", "type": "string"},
-                            {"name": "becameOptional", "$ref": "Headers"},
-                            {"name": "removedRequired", "$ref": "Headers"},
-                            {"name": "becameRequired", "$ref": "Headers", "optional": True},
-                            {"name": "removedOptional", "$ref": "Headers", "optional": True},
-                        ],
-                        "returns": [
-                            {"name": "mimeType", "type": "string"},
-                            {"name": "becameOptional", "type": "string"},
-                            {"name": "removedRequired", "type": "string"},
-                            {"name": "becameRequired", "type": "string", "optional": True},
-                            {"name": "removedOptional", "type": "string", "optional": True},
-                        ]
-                    }
-                ],
-                "events": [
-                    {
-                        "name": "requestWillBeSent",
-                        "parameters": [
-                            {"name": "frameId", "type": "string", "experimental": True},
-                            {"name": "request", "$ref": "Request"},
-                            {"name": "becameOptional", "type": "string"},
-                            {"name": "removedRequired", "type": "string"},
-                            {"name": "becameRequired", "type": "string", "optional": True},
-                            {"name": "removedOptional", "type": "string", "optional": True},
-                        ]
-                    },
-                    {
-                        "name": "removedEvent",
-                        "parameters": [
-                            {"name": "errorText", "type": "string"},
-                            {"name": "canceled", "type": "boolean", "optional": True}
-                        ]
-                    }
-                ]
-            },
-            {
-                "domain":  "removedDomain"
-            }
-        ]
-
-    def create_test_schema_2():
-        return [
-            {
-                "domain": "Network",
-                "types": [
-                    {
-                        "id": "LoaderId",
-                        "type": "string"
-                    },
-                    {
-                        "id": "Request",
-                        "type": "object",
-                        "properties": [
-                            {"name": "url", "type": "string"},
-                            {"name": "method", "type": "string"},
-                            {"name": "headers", "type": "object"},
-                            {"name": "becameOptionalField", "type": "string", "optional": True},
-                        ]
-                    }
-                ],
-                "commands": [
-                    {
-                        "name": "addedCommand",
-                    },
-                    {
-                        "name": "setExtraHTTPHeaders",
-                        "parameters": [
-                            {"name": "headers", "type": "object"},
-                            {"name": "mismatched", "type": "object"},
-                            {"name": "becameOptional", "type": "object", "optional": True},
-                            {"name": "addedRequired", "type": "object"},
-                            {"name": "becameRequired", "type": "object"},
-                            {"name": "addedOptional", "type": "object", "optional": True},
-                        ],
-                        "returns": [
-                            {"name": "mimeType", "type": "string"},
-                            {"name": "becameOptional", "type": "string", "optional": True},
-                            {"name": "addedRequired", "type": "string"},
-                            {"name": "becameRequired", "type": "string"},
-                            {"name": "addedOptional", "type": "string", "optional": True},
-                        ]
-                    }
-                ],
-                "events": [
-                    {
-                        "name": "requestWillBeSent",
-                        "parameters": [
-                            {"name": "request", "$ref": "Request"},
-                            {"name": "becameOptional", "type": "string", "optional": True},
-                            {"name": "addedRequired", "type": "string"},
-                            {"name": "becameRequired", "type": "string"},
-                            {"name": "addedOptional", "type": "string", "optional": True},
-                        ]
-                    },
-                    {
-                        "name": "addedEvent"
-                    }
-                ]
-            },
-            {
-                "domain": "addedDomain"
-            }
-        ]
-
-    expected_errors = [
-        "removedDomain: domain has been removed",
-        "Network.removedCommand: command has been removed",
-        "Network.removedEvent: event has been removed",
-        "Network.setExtraHTTPHeaders.mismatched: parameter base type mismatch, 'object' vs 'string'",
-        "Network.setExtraHTTPHeaders.addedRequired: required parameter has been added",
-        "Network.setExtraHTTPHeaders.becameRequired: optional parameter is now required",
-        "Network.setExtraHTTPHeaders.removedRequired: required response parameter has been removed",
-        "Network.setExtraHTTPHeaders.becameOptional: required response parameter is now optional",
-        "Network.requestWillBeSent.removedRequired: required parameter has been removed",
-        "Network.requestWillBeSent.becameOptional: required parameter is now optional",
-        "Network.requestWillBeSent.request parameter->Network.Request.removedField: required property has been removed",
-        "Network.requestWillBeSent.request parameter->Network.Request.becameOptionalField: required property is now optional",
-    ]
-
-    expected_errors_reverse = [
-        "addedDomain: domain has been added",
-        "Network.addedEvent: event has been added",
-        "Network.addedCommand: command has been added",
-        "Network.setExtraHTTPHeaders.mismatched: parameter base type mismatch, 'string' vs 'object'",
-        "Network.setExtraHTTPHeaders.removedRequired: required parameter has been removed",
-        "Network.setExtraHTTPHeaders.becameOptional: required parameter is now optional",
-        "Network.setExtraHTTPHeaders.addedRequired: required response parameter has been added",
-        "Network.setExtraHTTPHeaders.becameRequired: optional response parameter is now required",
-        "Network.requestWillBeSent.becameRequired: optional parameter is now required",
-        "Network.requestWillBeSent.addedRequired: required parameter has been added",
-    ]
-
-    def is_subset(subset, superset, message):
-        for i in range(len(subset)):
-            if subset[i] not in superset:
-                sys.stderr.write("%s error: %s\n" % (message, subset[i]))
-                return False
-        return True
-
-    def errors_match(expected, actual):
-        return (is_subset(actual, expected, "Unexpected") and
-                is_subset(expected, actual, "Missing"))
-
-    return (errors_match(expected_errors,
-                         compare_schemas(create_test_schema_1(), create_test_schema_2(), False)) and
-            errors_match(expected_errors_reverse,
-                         compare_schemas(create_test_schema_2(), create_test_schema_1(), True)))
-
-
-def load_domains_and_baselines(file_name, domains, baseline_domains):
-    version = load_schema(os.path.normpath(file_name), domains)
-    suffix = "-%s.%s.json" % (version["major"], version["minor"])
-    baseline_file = file_name.replace(".json", suffix)
-    load_schema(os.path.normpath(baseline_file), baseline_domains)
-    return version
-
-
-def main():
-    if not self_test():
-        sys.stderr.write("Self-test failed")
-        return 1
-
-    cmdline_parser = optparse.OptionParser()
-    cmdline_parser.add_option("--show_changes")
-    cmdline_parser.add_option("--expected_errors")
-    cmdline_parser.add_option("--stamp")
-    arg_options, arg_values = cmdline_parser.parse_args()
-
-    if len(arg_values) < 1:
-        sys.stderr.write("Usage: %s [--show_changes] <protocol-1> [, <protocol-2>...]\n" % sys.argv[0])
-        return 1
-
-    domains = []
-    baseline_domains = []
-    version = load_domains_and_baselines(arg_values[0], domains, baseline_domains)
-    for dependency in arg_values[1:]:
-        load_domains_and_baselines(dependency, domains, baseline_domains)
-
-    expected_errors = []
-    if arg_options.expected_errors:
-        expected_errors_file = open(arg_options.expected_errors, "r")
-        expected_errors = json.loads(expected_errors_file.read())["errors"]
-        expected_errors_file.close()
-
-    errors = compare_schemas(baseline_domains, domains, False)
-    unexpected_errors = []
-    for i in range(len(errors)):
-        if errors[i] not in expected_errors:
-            unexpected_errors.append(errors[i])
-    if len(unexpected_errors) > 0:
-        sys.stderr.write("  Compatibility checks FAILED\n")
-        for error in unexpected_errors:
-            sys.stderr.write("    %s\n" % error)
-        return 1
-
-    if arg_options.show_changes:
-        changes = compare_schemas(domains, baseline_domains, True)
-        if len(changes) > 0:
-            print "  Public changes since %s:" % version
-            for change in changes:
-                print "    %s" % change
-
-    if arg_options.stamp:
-        with open(arg_options.stamp, 'a') as _:
-            pass
-
-if __name__ == '__main__':
-    sys.exit(main())
diff --git a/src/v8/third_party/inspector_protocol/CodeGenerator.py b/src/v8/third_party/inspector_protocol/CodeGenerator.py
deleted file mode 100644
index e630b02..0000000
--- a/src/v8/third_party/inspector_protocol/CodeGenerator.py
+++ /dev/null
@@ -1,654 +0,0 @@
-# Copyright 2016 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 os.path
-import sys
-import optparse
-import collections
-import functools
-import re
-import copy
-try:
-    import json
-except ImportError:
-    import simplejson as json
-
-# Path handling for libraries and templates
-# Paths have to be normalized because Jinja uses the exact template path to
-# determine the hash used in the cache filename, and we need a pre-caching step
-# to be concurrency-safe. Use absolute path because __file__ is absolute if
-# module is imported, and relative if executed directly.
-# If paths differ between pre-caching and individual file compilation, the cache
-# is regenerated, which causes a race condition and breaks concurrent build,
-# since some compile processes will try to read the partially written cache.
-module_path, module_filename = os.path.split(os.path.realpath(__file__))
-
-def read_config():
-    # pylint: disable=W0703
-    def json_to_object(data, output_base, config_base):
-        def json_object_hook(object_dict):
-            items = [(k, os.path.join(config_base, v) if k == "path" else v) for (k, v) in object_dict.items()]
-            items = [(k, os.path.join(output_base, v) if k == "output" else v) for (k, v) in items]
-            keys, values = zip(*items)
-            return collections.namedtuple('X', keys)(*values)
-        return json.loads(data, object_hook=json_object_hook)
-
-    def init_defaults(config_tuple, path, defaults):
-        keys = list(config_tuple._fields)  # pylint: disable=E1101
-        values = [getattr(config_tuple, k) for k in keys]
-        for i in xrange(len(keys)):
-            if hasattr(values[i], "_fields"):
-                values[i] = init_defaults(values[i], path + "." + keys[i], defaults)
-        for optional in defaults:
-            if optional.find(path + ".") != 0:
-                continue
-            optional_key = optional[len(path) + 1:]
-            if optional_key.find(".") == -1 and optional_key not in keys:
-                keys.append(optional_key)
-                values.append(defaults[optional])
-        return collections.namedtuple('X', keys)(*values)
-
-    try:
-        cmdline_parser = optparse.OptionParser()
-        cmdline_parser.add_option("--output_base")
-        cmdline_parser.add_option("--jinja_dir")
-        cmdline_parser.add_option("--config")
-        cmdline_parser.add_option("--config_value", action="append", type="string")
-        arg_options, _ = cmdline_parser.parse_args()
-        jinja_dir = arg_options.jinja_dir
-        if not jinja_dir:
-            raise Exception("jinja directory must be specified")
-        jinja_dir = jinja_dir.decode('utf8')
-        output_base = arg_options.output_base
-        if not output_base:
-            raise Exception("Base output directory must be specified")
-        output_base = output_base.decode('utf8')
-        config_file = arg_options.config
-        if not config_file:
-            raise Exception("Config file name must be specified")
-        config_file = config_file.decode('utf8')
-        config_base = os.path.dirname(config_file)
-        config_values = arg_options.config_value
-        if not config_values:
-            config_values = []
-    except Exception:
-        # Work with python 2 and 3 http://docs.python.org/py3k/howto/pyporting.html
-        exc = sys.exc_info()[1]
-        sys.stderr.write("Failed to parse command-line arguments: %s\n\n" % exc)
-        exit(1)
-
-    try:
-        config_json_file = open(config_file, "r")
-        config_json_string = config_json_file.read()
-        config_partial = json_to_object(config_json_string, output_base, config_base)
-        config_json_file.close()
-        defaults = {
-            ".use_snake_file_names": False,
-            ".use_title_case_methods": False,
-            ".imported": False,
-            ".imported.export_macro": "",
-            ".imported.export_header": False,
-            ".imported.header": False,
-            ".imported.package": False,
-            ".imported.options": False,
-            ".protocol.export_macro": "",
-            ".protocol.export_header": False,
-            ".protocol.options": False,
-            ".exported": False,
-            ".exported.export_macro": "",
-            ".exported.export_header": False,
-            ".lib": False,
-            ".lib.export_macro": "",
-            ".lib.export_header": False,
-        }
-        for key_value in config_values:
-            parts = key_value.split("=")
-            if len(parts) == 2:
-                defaults["." + parts[0]] = parts[1]
-        return (jinja_dir, config_file, init_defaults(config_partial, "", defaults))
-    except Exception:
-        # Work with python 2 and 3 http://docs.python.org/py3k/howto/pyporting.html
-        exc = sys.exc_info()[1]
-        sys.stderr.write("Failed to parse config file: %s\n\n" % exc)
-        exit(1)
-
-
-# ---- Begin of utilities exposed to generator ----
-
-
-def to_title_case(name):
-    return name[:1].upper() + name[1:]
-
-
-def dash_to_camelcase(word):
-    prefix = ""
-    if word[0] == "-":
-        prefix = "Negative"
-        word = word[1:]
-    return prefix + "".join(to_title_case(x) or "-" for x in word.split("-"))
-
-
-def to_snake_case(name):
-    return re.sub(r"([a-z0-9])([A-Z])", r"\1_\2", name, sys.maxint).lower()
-
-
-def to_method_case(config, name):
-    if config.use_title_case_methods:
-        return to_title_case(name)
-    return name
-
-
-def join_arrays(dict, keys):
-    result = []
-    for key in keys:
-        if key in dict:
-            result += dict[key]
-    return result
-
-
-def format_include(config, header, file_name=None):
-    if file_name is not None:
-        header = header + "/" + file_name + ".h"
-    header = "\"" + header + "\"" if header[0] not in "<\"" else header
-    if config.use_snake_file_names:
-        header = to_snake_case(header)
-    return header
-
-
-def to_file_name(config, file_name):
-    if config.use_snake_file_names:
-        return to_snake_case(file_name).replace(".cpp", ".cc")
-    return file_name
-
-
-# ---- End of utilities exposed to generator ----
-
-
-def initialize_jinja_env(jinja_dir, cache_dir, config):
-    # pylint: disable=F0401
-    sys.path.insert(1, os.path.abspath(jinja_dir))
-    import jinja2
-
-    jinja_env = jinja2.Environment(
-        loader=jinja2.FileSystemLoader(module_path),
-        # Bytecode cache is not concurrency-safe unless pre-cached:
-        # if pre-cached this is read-only, but writing creates a race condition.
-        bytecode_cache=jinja2.FileSystemBytecodeCache(cache_dir),
-        keep_trailing_newline=True,  # newline-terminate generated files
-        lstrip_blocks=True,  # so can indent control flow tags
-        trim_blocks=True)
-    jinja_env.filters.update({"to_title_case": to_title_case, "dash_to_camelcase": dash_to_camelcase, "to_method_case": functools.partial(to_method_case, config)})
-    jinja_env.add_extension("jinja2.ext.loopcontrols")
-    return jinja_env
-
-
-def create_imported_type_definition(domain_name, type, imported_namespace):
-    # pylint: disable=W0622
-    return {
-        "return_type": "std::unique_ptr<%s::%s::API::%s>" % (imported_namespace, domain_name, type["id"]),
-        "pass_type": "std::unique_ptr<%s::%s::API::%s>" % (imported_namespace, domain_name, type["id"]),
-        "to_raw_type": "%s.get()",
-        "to_pass_type": "std::move(%s)",
-        "to_rvalue": "std::move(%s)",
-        "type": "std::unique_ptr<%s::%s::API::%s>" % (imported_namespace, domain_name, type["id"]),
-        "raw_type": "%s::%s::API::%s" % (imported_namespace, domain_name, type["id"]),
-        "raw_pass_type": "%s::%s::API::%s*" % (imported_namespace, domain_name, type["id"]),
-        "raw_return_type": "%s::%s::API::%s*" % (imported_namespace, domain_name, type["id"]),
-    }
-
-
-def create_user_type_definition(domain_name, type):
-    # pylint: disable=W0622
-    return {
-        "return_type": "std::unique_ptr<protocol::%s::%s>" % (domain_name, type["id"]),
-        "pass_type": "std::unique_ptr<protocol::%s::%s>" % (domain_name, type["id"]),
-        "to_raw_type": "%s.get()",
-        "to_pass_type": "std::move(%s)",
-        "to_rvalue": "std::move(%s)",
-        "type": "std::unique_ptr<protocol::%s::%s>" % (domain_name, type["id"]),
-        "raw_type": "protocol::%s::%s" % (domain_name, type["id"]),
-        "raw_pass_type": "protocol::%s::%s*" % (domain_name, type["id"]),
-        "raw_return_type": "protocol::%s::%s*" % (domain_name, type["id"]),
-    }
-
-
-def create_object_type_definition():
-    # pylint: disable=W0622
-    return {
-        "return_type": "std::unique_ptr<protocol::DictionaryValue>",
-        "pass_type": "std::unique_ptr<protocol::DictionaryValue>",
-        "to_raw_type": "%s.get()",
-        "to_pass_type": "std::move(%s)",
-        "to_rvalue": "std::move(%s)",
-        "type": "std::unique_ptr<protocol::DictionaryValue>",
-        "raw_type": "protocol::DictionaryValue",
-        "raw_pass_type": "protocol::DictionaryValue*",
-        "raw_return_type": "protocol::DictionaryValue*",
-    }
-
-
-def create_any_type_definition():
-    # pylint: disable=W0622
-    return {
-        "return_type": "std::unique_ptr<protocol::Value>",
-        "pass_type": "std::unique_ptr<protocol::Value>",
-        "to_raw_type": "%s.get()",
-        "to_pass_type": "std::move(%s)",
-        "to_rvalue": "std::move(%s)",
-        "type": "std::unique_ptr<protocol::Value>",
-        "raw_type": "protocol::Value",
-        "raw_pass_type": "protocol::Value*",
-        "raw_return_type": "protocol::Value*",
-    }
-
-
-def create_string_type_definition():
-    # pylint: disable=W0622
-    return {
-        "return_type": "String",
-        "pass_type": "const String&",
-        "to_pass_type": "%s",
-        "to_raw_type": "%s",
-        "to_rvalue": "%s",
-        "type": "String",
-        "raw_type": "String",
-        "raw_pass_type": "const String&",
-        "raw_return_type": "String",
-    }
-
-
-def create_primitive_type_definition(type):
-    # pylint: disable=W0622
-    typedefs = {
-        "number": "double",
-        "integer": "int",
-        "boolean": "bool"
-    }
-    defaults = {
-        "number": "0",
-        "integer": "0",
-        "boolean": "false"
-    }
-    jsontypes = {
-        "number": "TypeDouble",
-        "integer": "TypeInteger",
-        "boolean": "TypeBoolean",
-    }
-    return {
-        "return_type": typedefs[type],
-        "pass_type": typedefs[type],
-        "to_pass_type": "%s",
-        "to_raw_type": "%s",
-        "to_rvalue": "%s",
-        "type": typedefs[type],
-        "raw_type": typedefs[type],
-        "raw_pass_type": typedefs[type],
-        "raw_return_type": typedefs[type],
-        "default_value": defaults[type]
-    }
-
-
-def wrap_array_definition(type):
-    # pylint: disable=W0622
-    return {
-        "return_type": "std::unique_ptr<protocol::Array<%s>>" % type["raw_type"],
-        "pass_type": "std::unique_ptr<protocol::Array<%s>>" % type["raw_type"],
-        "to_raw_type": "%s.get()",
-        "to_pass_type": "std::move(%s)",
-        "to_rvalue": "std::move(%s)",
-        "type": "std::unique_ptr<protocol::Array<%s>>" % type["raw_type"],
-        "raw_type": "protocol::Array<%s>" % type["raw_type"],
-        "raw_pass_type": "protocol::Array<%s>*" % type["raw_type"],
-        "raw_return_type": "protocol::Array<%s>*" % type["raw_type"],
-        "out_type": "protocol::Array<%s>&" % type["raw_type"],
-    }
-
-
-class Protocol(object):
-    def __init__(self, config):
-        self.config = config
-        self.json_api = {"domains": []}
-        self.imported_domains = []
-        self.exported_domains = []
-        self.generate_domains = self.read_protocol_file(config.protocol.path)
-
-        if config.protocol.options:
-            self.generate_domains = [rule.domain for rule in config.protocol.options]
-            self.exported_domains = [rule.domain for rule in config.protocol.options if hasattr(rule, "exported")]
-
-        if config.imported:
-            self.imported_domains = self.read_protocol_file(config.imported.path)
-            if config.imported.options:
-                self.imported_domains = [rule.domain for rule in config.imported.options]
-
-        self.patch_full_qualified_refs()
-        self.create_notification_types()
-        self.create_type_definitions()
-        self.generate_used_types()
-
-
-    def read_protocol_file(self, file_name):
-        input_file = open(file_name, "r")
-        json_string = input_file.read()
-        input_file.close()
-        parsed_json = json.loads(json_string)
-        version = parsed_json["version"]["major"] + "." + parsed_json["version"]["minor"]
-        domains = []
-        for domain in parsed_json["domains"]:
-            domains.append(domain["domain"])
-            domain["version"] = version
-        self.json_api["domains"] += parsed_json["domains"]
-        return domains
-
-
-    def patch_full_qualified_refs(self):
-        def patch_full_qualified_refs_in_domain(json, domain_name):
-            if isinstance(json, list):
-                for item in json:
-                    patch_full_qualified_refs_in_domain(item, domain_name)
-            if not isinstance(json, dict):
-                return
-            for key in json:
-                if key == "type" and json[key] == "string":
-                    json[key] = domain_name + ".string"
-                if key != "$ref":
-                    patch_full_qualified_refs_in_domain(json[key], domain_name)
-                    continue
-                if json["$ref"].find(".") == -1:
-                    json["$ref"] = domain_name + "." + json["$ref"]
-            return
-
-        for domain in self.json_api["domains"]:
-            patch_full_qualified_refs_in_domain(domain, domain["domain"])
-
-
-    def all_references(self, json):
-        refs = set()
-        if isinstance(json, list):
-            for item in json:
-                refs |= self.all_references(item)
-        if not isinstance(json, dict):
-            return refs
-        for key in json:
-            if key != "$ref":
-                refs |= self.all_references(json[key])
-            else:
-                refs.add(json["$ref"])
-        return refs
-
-    def generate_used_types(self):
-        all_refs = set()
-        for domain in self.json_api["domains"]:
-            domain_name = domain["domain"]
-            if "commands" in domain:
-                for command in domain["commands"]:
-                    if self.generate_command(domain_name, command["name"]):
-                        all_refs |= self.all_references(command)
-            if "events" in domain:
-                for event in domain["events"]:
-                    if self.generate_event(domain_name, event["name"]):
-                        all_refs |= self.all_references(event)
-                        all_refs.add(domain_name + "." + to_title_case(event["name"]) + "Notification")
-
-        dependencies = self.generate_type_dependencies()
-        queue = set(all_refs)
-        while len(queue):
-            ref = queue.pop()
-            if ref in dependencies:
-                queue |= dependencies[ref] - all_refs
-                all_refs |= dependencies[ref]
-        self.used_types = all_refs
-
-
-    def generate_type_dependencies(self):
-        dependencies = dict()
-        domains_with_types = (x for x in self.json_api["domains"] if "types" in x)
-        for domain in domains_with_types:
-            domain_name = domain["domain"]
-            for type in domain["types"]:
-                related_types = self.all_references(type)
-                if len(related_types):
-                    dependencies[domain_name + "." + type["id"]] = related_types
-        return dependencies
-
-
-    def create_notification_types(self):
-        for domain in self.json_api["domains"]:
-            if "events" in domain:
-                for event in domain["events"]:
-                    event_type = dict()
-                    event_type["description"] = "Wrapper for notification params"
-                    event_type["type"] = "object"
-                    event_type["id"] = to_title_case(event["name"]) + "Notification"
-                    if "parameters" in event:
-                        event_type["properties"] = copy.deepcopy(event["parameters"])
-                    if "types" not in domain:
-                        domain["types"] = list()
-                    domain["types"].append(event_type)
-
-
-    def create_type_definitions(self):
-        imported_namespace = "::".join(self.config.imported.namespace) if self.config.imported else ""
-        self.type_definitions = {}
-        self.type_definitions["number"] = create_primitive_type_definition("number")
-        self.type_definitions["integer"] = create_primitive_type_definition("integer")
-        self.type_definitions["boolean"] = create_primitive_type_definition("boolean")
-        self.type_definitions["object"] = create_object_type_definition()
-        self.type_definitions["any"] = create_any_type_definition()
-        for domain in self.json_api["domains"]:
-            self.type_definitions[domain["domain"] + ".string"] = create_string_type_definition()
-            if not ("types" in domain):
-                continue
-            for type in domain["types"]:
-                type_name = domain["domain"] + "." + type["id"]
-                if type["type"] == "object" and domain["domain"] in self.imported_domains:
-                    self.type_definitions[type_name] = create_imported_type_definition(domain["domain"], type, imported_namespace)
-                elif type["type"] == "object":
-                    self.type_definitions[type_name] = create_user_type_definition(domain["domain"], type)
-                elif type["type"] == "array":
-                    items_type = type["items"]["type"]
-                    self.type_definitions[type_name] = wrap_array_definition(self.type_definitions[items_type])
-                elif type["type"] == domain["domain"] + ".string":
-                    self.type_definitions[type_name] = create_string_type_definition()
-                else:
-                    self.type_definitions[type_name] = create_primitive_type_definition(type["type"])
-
-
-    def check_options(self, options, domain, name, include_attr, exclude_attr, default):
-        for rule in options:
-            if rule.domain != domain:
-                continue
-            if include_attr and hasattr(rule, include_attr):
-                return name in getattr(rule, include_attr)
-            if exclude_attr and hasattr(rule, exclude_attr):
-                return name not in getattr(rule, exclude_attr)
-            return default
-        return False
-
-
-    # ---- Begin of methods exposed to generator
-
-
-    def type_definition(self, name):
-        return self.type_definitions[name]
-
-
-    def resolve_type(self, prop):
-        if "$ref" in prop:
-            return self.type_definitions[prop["$ref"]]
-        if prop["type"] == "array":
-            return wrap_array_definition(self.resolve_type(prop["items"]))
-        return self.type_definitions[prop["type"]]
-
-
-    def generate_command(self, domain, command):
-        if not self.config.protocol.options:
-            return domain in self.generate_domains
-        return self.check_options(self.config.protocol.options, domain, command, "include", "exclude", True)
-
-
-    def generate_event(self, domain, event):
-        if not self.config.protocol.options:
-            return domain in self.generate_domains
-        return self.check_options(self.config.protocol.options, domain, event, "include_events", "exclude_events", True)
-
-
-    def generate_type(self, domain, typename):
-        return domain + "." + typename in self.used_types
-
-
-    def is_async_command(self, domain, command):
-        if not self.config.protocol.options:
-            return False
-        return self.check_options(self.config.protocol.options, domain, command, "async", None, False)
-
-
-    def is_exported(self, domain, name):
-        if not self.config.protocol.options:
-            return False
-        return self.check_options(self.config.protocol.options, domain, name, "exported", None, False)
-
-
-    def is_imported(self, domain, name):
-        if not self.config.imported:
-            return False
-        if not self.config.imported.options:
-            return domain in self.imported_domains
-        return self.check_options(self.config.imported.options, domain, name, "imported", None, False)
-
-
-    def is_exported_domain(self, domain):
-        return domain in self.exported_domains
-
-
-    def generate_disable(self, domain):
-        if "commands" not in domain:
-            return True
-        for command in domain["commands"]:
-            if command["name"] == "disable" and self.generate_command(domain["domain"], "disable"):
-                return False
-        return True
-
-
-    def is_imported_dependency(self, domain):
-        return domain in self.generate_domains or domain in self.imported_domains
-
-
-def main():
-    jinja_dir, config_file, config = read_config()
-
-    protocol = Protocol(config)
-
-    if not config.exported and len(protocol.exported_domains):
-        sys.stderr.write("Domains [%s] are exported, but config is missing export entry\n\n" % ", ".join(protocol.exported_domains))
-        exit(1)
-
-    if not os.path.exists(config.protocol.output):
-        os.mkdir(config.protocol.output)
-    if len(protocol.exported_domains) and not os.path.exists(config.exported.output):
-        os.mkdir(config.exported.output)
-    jinja_env = initialize_jinja_env(jinja_dir, config.protocol.output, config)
-
-    inputs = []
-    inputs.append(__file__)
-    inputs.append(config_file)
-    inputs.append(config.protocol.path)
-    if config.imported:
-        inputs.append(config.imported.path)
-    templates_dir = os.path.join(module_path, "templates")
-    inputs.append(os.path.join(templates_dir, "TypeBuilder_h.template"))
-    inputs.append(os.path.join(templates_dir, "TypeBuilder_cpp.template"))
-    inputs.append(os.path.join(templates_dir, "Exported_h.template"))
-    inputs.append(os.path.join(templates_dir, "Imported_h.template"))
-
-    h_template = jinja_env.get_template("templates/TypeBuilder_h.template")
-    cpp_template = jinja_env.get_template("templates/TypeBuilder_cpp.template")
-    exported_template = jinja_env.get_template("templates/Exported_h.template")
-    imported_template = jinja_env.get_template("templates/Imported_h.template")
-
-    outputs = dict()
-
-    for domain in protocol.json_api["domains"]:
-        class_name = domain["domain"]
-        template_context = {
-            "protocol": protocol,
-            "config": config,
-            "domain": domain,
-            "join_arrays": join_arrays,
-            "format_include": functools.partial(format_include, config),
-        }
-
-        if domain["domain"] in protocol.generate_domains:
-            outputs[os.path.join(config.protocol.output, to_file_name(config, class_name + ".h"))] = h_template.render(template_context)
-            outputs[os.path.join(config.protocol.output, to_file_name(config, class_name + ".cpp"))] = cpp_template.render(template_context)
-            if domain["domain"] in protocol.exported_domains:
-                outputs[os.path.join(config.exported.output, to_file_name(config, class_name + ".h"))] = exported_template.render(template_context)
-        if domain["domain"] in protocol.imported_domains:
-            outputs[os.path.join(config.protocol.output, to_file_name(config, class_name + ".h"))] = imported_template.render(template_context)
-
-    if config.lib:
-        template_context = {
-            "config": config,
-            "format_include": functools.partial(format_include, config),
-        }
-
-        lib_templates_dir = os.path.join(module_path, "lib")
-        # Note these should be sorted in the right order.
-        # TODO(dgozman): sort them programmatically based on commented includes.
-        lib_h_templates = [
-            "Collections_h.template",
-            "ErrorSupport_h.template",
-            "Values_h.template",
-            "Object_h.template",
-            "ValueConversions_h.template",
-            "Maybe_h.template",
-            "Array_h.template",
-            "DispatcherBase_h.template",
-            "Parser_h.template",
-        ]
-
-        lib_cpp_templates = [
-            "Protocol_cpp.template",
-            "ErrorSupport_cpp.template",
-            "Values_cpp.template",
-            "Object_cpp.template",
-            "DispatcherBase_cpp.template",
-            "Parser_cpp.template",
-        ]
-
-        forward_h_templates = [
-            "Forward_h.template",
-            "Allocator_h.template",
-            "FrontendChannel_h.template",
-        ]
-
-        def generate_lib_file(file_name, template_files):
-            parts = []
-            for template_file in template_files:
-                inputs.append(os.path.join(lib_templates_dir, template_file))
-                template = jinja_env.get_template("lib/" + template_file)
-                parts.append(template.render(template_context))
-            outputs[file_name] = "\n\n".join(parts)
-
-        generate_lib_file(os.path.join(config.lib.output, to_file_name(config, "Forward.h")), forward_h_templates)
-        generate_lib_file(os.path.join(config.lib.output, to_file_name(config, "Protocol.h")), lib_h_templates)
-        generate_lib_file(os.path.join(config.lib.output, to_file_name(config, "Protocol.cpp")), lib_cpp_templates)
-
-    # Make gyp / make generatos happy, otherwise make rebuilds world.
-    inputs_ts = max(map(os.path.getmtime, inputs))
-    up_to_date = True
-    for output_file in outputs.iterkeys():
-        if not os.path.exists(output_file) or os.path.getmtime(output_file) < inputs_ts:
-            up_to_date = False
-            break
-    if up_to_date:
-        sys.exit()
-
-    for file_name, content in outputs.iteritems():
-        out_file = open(file_name, "w")
-        out_file.write(content)
-        out_file.close()
-
-
-main()
diff --git a/src/v8/third_party/inspector_protocol/ConcatenateProtocols.py b/src/v8/third_party/inspector_protocol/ConcatenateProtocols.py
deleted file mode 100755
index a7cbc99..0000000
--- a/src/v8/third_party/inspector_protocol/ConcatenateProtocols.py
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2016 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 os.path
-import sys
-
-try:
-    import json
-except ImportError:
-    import simplejson as json
-
-
-def main(argv):
-    if len(argv) < 1:
-        sys.stderr.write("Usage: %s <protocol-1> [<protocol-2> [, <protocol-3>...]] <output-file>\n" % sys.argv[0])
-        return 1
-
-    domains = []
-    version = None
-    for protocol in argv[:-1]:
-        file_name = os.path.normpath(protocol)
-        if not os.path.isfile(file_name):
-            sys.stderr.write("Cannot find %s\n" % file_name)
-            return 1
-        input_file = open(file_name, "r")
-        json_string = input_file.read()
-        parsed_json = json.loads(json_string)
-        domains += parsed_json["domains"]
-        version = parsed_json["version"]
-
-    output_file = open(argv[-1], "w")
-    json.dump({"version": version, "domains": domains}, output_file, indent=4, sort_keys=False, separators=(',', ': '))
-    output_file.close()
-
-
-if __name__ == '__main__':
-    sys.exit(main(sys.argv[1:]))
diff --git a/src/v8/third_party/inspector_protocol/ConvertProtocolToJSON.py b/src/v8/third_party/inspector_protocol/ConvertProtocolToJSON.py
deleted file mode 100644
index 56fc09d..0000000
--- a/src/v8/third_party/inspector_protocol/ConvertProtocolToJSON.py
+++ /dev/null
@@ -1,183 +0,0 @@
-# Copyright 2017 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 collections
-import json
-import os.path
-import re
-import sys
-
-file_name = None
-description = ''
-
-primitiveTypes = ['integer', 'number', 'boolean', 'string', 'object', 'any', 'array']
-
-
-def assignType(item, type, isArray=False):
-    if isArray:
-        item['type'] = 'array'
-        item['items'] = collections.OrderedDict()
-        assignType(item['items'], type)
-        return
-
-    if type == 'enum':
-        type = 'string'
-    if type in primitiveTypes:
-        item['type'] = type
-    else:
-        item['$ref'] = type
-
-
-def createItem(d, experimental, deprecated, name=None):
-    result = collections.OrderedDict(d)
-    if name:
-        result['name'] = name
-    global description
-    if description:
-        result['description'] = description.strip()
-    if experimental:
-        result['experimental'] = True
-    if deprecated:
-        result['deprecated'] = True
-    return result
-
-
-def parse(data):
-    protocol = collections.OrderedDict()
-    protocol['version'] = collections.OrderedDict()
-    protocol['domains'] = []
-    domain = None
-    item = None
-    subitems = None
-    nukeDescription = False
-    global description
-    lines = data.split('\n')
-    for i in range(0, len(lines)):
-        if nukeDescription:
-            description = ''
-            nukeDescription = False
-        line = lines[i]
-        trimLine = line.strip()
-
-        if trimLine.startswith('#'):
-            if len(description):
-              description += '\n'
-            description += trimLine[2:]
-            continue
-        else:
-            nukeDescription = True
-
-        if len(trimLine) == 0:
-            continue
-
-        match = re.compile('^(experimental )?(deprecated )?domain (.*)').match(line)
-        if match:
-            domain = createItem({'domain' : match.group(3)}, match.group(1), match.group(2))
-            protocol['domains'].append(domain)
-            continue
-
-        match = re.compile('^  depends on ([^\s]+)').match(line)
-        if match:
-            if 'dependencies' not in domain:
-                domain['dependencies'] = []
-            domain['dependencies'].append(match.group(1))
-            continue
-
-        match = re.compile('^  (experimental )?(deprecated )?type (.*) extends (array of )?([^\s]+)').match(line)
-        if match:
-            if 'types' not in domain:
-                domain['types'] = []
-            item = createItem({'id': match.group(3)}, match.group(1), match.group(2))
-            assignType(item, match.group(5), match.group(4))
-            domain['types'].append(item)
-            continue
-
-        match = re.compile('^  (experimental )?(deprecated )?(command|event) (.*)').match(line)
-        if match:
-            list = []
-            if match.group(3) == 'command':
-                if 'commands' in domain:
-                    list = domain['commands']
-                else:
-                    list = domain['commands'] = []
-            else:
-                if 'events' in domain:
-                    list = domain['events']
-                else:
-                    list = domain['events'] = []
-
-            item = createItem({}, match.group(1), match.group(2), match.group(4))
-            list.append(item)
-            continue
-
-        match = re.compile('^      (experimental )?(deprecated )?(optional )?(array of )?([^\s]+) ([^\s]+)').match(line)
-        if match:
-            param = createItem({}, match.group(1), match.group(2), match.group(6))
-            if match.group(3):
-                param['optional'] = True
-            assignType(param, match.group(5), match.group(4))
-            if match.group(5) == 'enum':
-                enumliterals = param['enum'] = []
-            subitems.append(param)
-            continue
-
-        match = re.compile('^    (parameters|returns|properties)').match(line)
-        if match:
-            subitems = item[match.group(1)] = []
-            continue
-
-        match = re.compile('^    enum').match(line)
-        if match:
-            enumliterals = item['enum'] = []
-            continue
-
-        match = re.compile('^version').match(line)
-        if match:
-            continue
-
-        match = re.compile('^  major (\d+)').match(line)
-        if match:
-            protocol['version']['major'] = match.group(1)
-            continue
-
-        match = re.compile('^  minor (\d+)').match(line)
-        if match:
-            protocol['version']['minor'] = match.group(1)
-            continue
-
-        match = re.compile('^    redirect ([^\s]+)').match(line)
-        if match:
-            item['redirect'] = match.group(1)
-            continue
-
-        match = re.compile('^      (  )?[^\s]+$').match(line)
-        if match:
-            # enum literal
-            enumliterals.append(trimLine)
-            continue
-
-        print 'Error in %s:%s, illegal token: \t%s' % (file_name, i, line)
-        sys.exit(1)
-    return protocol
-
-def main(argv):
-    if len(argv) < 2:
-        sys.stderr.write("Usage: %s <protocol.pdl> <protocol.json>\n" % sys.argv[0])
-        return 1
-    global file_name
-    file_name = os.path.normpath(argv[0])
-    input_file = open(file_name, "r")
-    pdl_string = input_file.read()
-    protocol = parse(pdl_string)
-    output_file = open(argv[0].replace('.pdl', '.json'), 'wb')
-    json.dump(protocol, output_file, indent=4, separators=(',', ': '))
-    output_file.close()
-
-    output_file = open(os.path.normpath(argv[1]), 'wb')
-    json.dump(protocol, output_file, indent=4, separators=(',', ': '))
-    output_file.close()
-
-
-if __name__ == '__main__':
-    sys.exit(main(sys.argv[1:]))
diff --git a/src/v8/third_party/inspector_protocol/inspector_protocol.gypi b/src/v8/third_party/inspector_protocol/inspector_protocol.gypi
deleted file mode 100644
index 05aa646..0000000
--- a/src/v8/third_party/inspector_protocol/inspector_protocol.gypi
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright 2016 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.
-
-{
-  'variables': {
-    'inspector_protocol_files': [
-      "lib/base_string_adapter_cc.template",
-      "lib/base_string_adapter_h.template",
-      "lib/DispatcherBase_cpp.template",
-      "lib/DispatcherBase_h.template",
-      "lib/ErrorSupport_cpp.template",
-      "lib/ErrorSupport_h.template",
-      "lib/Forward_h.template",
-      "lib/FrontendChannel_h.template",
-      "lib/Object_cpp.template",
-      "lib/Object_h.template",
-      "lib/Parser_cpp.template",
-      "lib/Parser_h.template",
-      "lib/Protocol_cpp.template",
-      "lib/ValueConversions_h.template",
-      "lib/Values_cpp.template",
-      "lib/Values_h.template",
-      "templates/Exported_h.template",
-      "templates/Imported_h.template",
-      "templates/TypeBuilder_cpp.template",
-      "templates/TypeBuilder_h.template",
-      'code_generator.py',
-    ]
-  }
-}
diff --git a/src/v8/third_party/inspector_protocol/lib/Allocator_h.template b/src/v8/third_party/inspector_protocol/lib/Allocator_h.template
deleted file mode 100644
index 8f8109d..0000000
--- a/src/v8/third_party/inspector_protocol/lib/Allocator_h.template
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2016 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.
-
-#ifndef {{"_".join(config.protocol.namespace)}}_Allocator_h
-#define {{"_".join(config.protocol.namespace)}}_Allocator_h
-
-{% for namespace in config.protocol.namespace %}
-namespace {{namespace}} {
-{% endfor %}
-
-enum NotNullTagEnum { NotNullLiteral };
-
-#define PROTOCOL_DISALLOW_NEW()                                 \
-    private:                                                    \
-        void* operator new(size_t) = delete;                    \
-        void* operator new(size_t, NotNullTagEnum, void*) = delete; \
-        void* operator new(size_t, void*) = delete;             \
-    public:
-
-#define PROTOCOL_DISALLOW_COPY(ClassName) \
-    private: \
-        ClassName(const ClassName&) = delete; \
-        ClassName& operator=(const ClassName&) = delete
-
-{% for namespace in config.protocol.namespace %}
-} // namespace {{namespace}}
-{% endfor %}
-
-#endif // !defined({{"_".join(config.protocol.namespace)}}_Allocator_h)
diff --git a/src/v8/third_party/inspector_protocol/lib/Array_h.template b/src/v8/third_party/inspector_protocol/lib/Array_h.template
deleted file mode 100644
index 3854f6e..0000000
--- a/src/v8/third_party/inspector_protocol/lib/Array_h.template
+++ /dev/null
@@ -1,136 +0,0 @@
-// Copyright 2016 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.
-
-#ifndef {{"_".join(config.protocol.namespace)}}_Array_h
-#define {{"_".join(config.protocol.namespace)}}_Array_h
-
-//#include "ErrorSupport.h"
-//#include "Forward.h"
-//#include "ValueConversions.h"
-//#include "Values.h"
-
-{% for namespace in config.protocol.namespace %}
-namespace {{namespace}} {
-{% endfor %}
-
-template<typename T>
-class Array {
-public:
-    static std::unique_ptr<Array<T>> create()
-    {
-        return std::unique_ptr<Array<T>>(new Array<T>());
-    }
-
-    static std::unique_ptr<Array<T>> fromValue(protocol::Value* value, ErrorSupport* errors)
-    {
-        protocol::ListValue* array = ListValue::cast(value);
-        if (!array) {
-            errors->addError("array expected");
-            return nullptr;
-        }
-        std::unique_ptr<Array<T>> result(new Array<T>());
-        errors->push();
-        for (size_t i = 0; i < array->size(); ++i) {
-            errors->setName(StringUtil::fromInteger(i));
-            std::unique_ptr<T> item = ValueConversions<T>::fromValue(array->at(i), errors);
-            result->m_vector.push_back(std::move(item));
-        }
-        errors->pop();
-        if (errors->hasErrors())
-            return nullptr;
-        return result;
-    }
-
-    void addItem(std::unique_ptr<T> value)
-    {
-        m_vector.push_back(std::move(value));
-    }
-
-    size_t length()
-    {
-        return m_vector.size();
-    }
-
-    T* get(size_t index)
-    {
-        return m_vector[index].get();
-    }
-
-    std::unique_ptr<protocol::ListValue> toValue()
-    {
-        std::unique_ptr<protocol::ListValue> result = ListValue::create();
-        for (auto& item : m_vector)
-            result->pushValue(ValueConversions<T>::toValue(item));
-        return result;
-    }
-
-private:
-    std::vector<std::unique_ptr<T>> m_vector;
-};
-
-template<typename T>
-class ArrayBase {
-public:
-    static std::unique_ptr<Array<T>> create()
-    {
-        return std::unique_ptr<Array<T>>(new Array<T>());
-    }
-
-    static std::unique_ptr<Array<T>> fromValue(protocol::Value* value, ErrorSupport* errors)
-    {
-        protocol::ListValue* array = ListValue::cast(value);
-        if (!array) {
-            errors->addError("array expected");
-            return nullptr;
-        }
-        errors->push();
-        std::unique_ptr<Array<T>> result(new Array<T>());
-        for (size_t i = 0; i < array->size(); ++i) {
-            errors->setName(StringUtil::fromInteger(i));
-            T item = ValueConversions<T>::fromValue(array->at(i), errors);
-            result->m_vector.push_back(item);
-        }
-        errors->pop();
-        if (errors->hasErrors())
-            return nullptr;
-        return result;
-    }
-
-    void addItem(const T& value)
-    {
-        m_vector.push_back(value);
-    }
-
-    size_t length()
-    {
-        return m_vector.size();
-    }
-
-    T get(size_t index)
-    {
-        return m_vector[index];
-    }
-
-    std::unique_ptr<protocol::ListValue> toValue()
-    {
-        std::unique_ptr<protocol::ListValue> result = ListValue::create();
-        for (auto& item : m_vector)
-            result->pushValue(ValueConversions<T>::toValue(item));
-        return result;
-    }
-
-private:
-    std::vector<T> m_vector;
-};
-
-template<> class Array<String> : public ArrayBase<String> {};
-template<> class Array<int> : public ArrayBase<int> {};
-template<> class Array<double> : public ArrayBase<double> {};
-template<> class Array<bool> : public ArrayBase<bool> {};
-
-{% for namespace in config.protocol.namespace %}
-} // namespace {{namespace}}
-{% endfor %}
-
-#endif // !defined({{"_".join(config.protocol.namespace)}}_Array_h)
diff --git a/src/v8/third_party/inspector_protocol/lib/Collections_h.template b/src/v8/third_party/inspector_protocol/lib/Collections_h.template
deleted file mode 100644
index 7505a17..0000000
--- a/src/v8/third_party/inspector_protocol/lib/Collections_h.template
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2016 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.
-
-#ifndef {{"_".join(config.protocol.namespace)}}_Collections_h
-#define {{"_".join(config.protocol.namespace)}}_Collections_h
-
-#include {{format_include(config.protocol.package, "Forward")}}
-#include <cstddef>
-
-#if defined(__APPLE__) && !defined(_LIBCPP_VERSION)
-#include <map>
-#include <set>
-
-{% for namespace in config.protocol.namespace %}
-namespace {{namespace}} {
-{% endfor %}
-
-template <class Key, class T> using HashMap = std::map<Key, T>;
-template <class Key> using HashSet = std::set<Key>;
-
-{% for namespace in config.protocol.namespace %}
-} // namespace {{namespace}}
-{% endfor %}
-
-#else
-#include <unordered_map>
-#include <unordered_set>
-
-{% for namespace in config.protocol.namespace %}
-namespace {{namespace}} {
-{% endfor %}
-
-template <class Key, class T> using HashMap = std::unordered_map<Key, T>;
-template <class Key> using HashSet = std::unordered_set<Key>;
-
-{% for namespace in config.protocol.namespace %}
-} // namespace {{namespace}}
-{% endfor %}
-
-#endif // defined(__APPLE__) && !defined(_LIBCPP_VERSION)
-
-#endif // !defined({{"_".join(config.protocol.namespace)}}_Collections_h)
diff --git a/src/v8/third_party/inspector_protocol/lib/Maybe_h.template b/src/v8/third_party/inspector_protocol/lib/Maybe_h.template
deleted file mode 100644
index 71593ac..0000000
--- a/src/v8/third_party/inspector_protocol/lib/Maybe_h.template
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright 2016 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.
-
-#ifndef {{"_".join(config.protocol.namespace)}}_Maybe_h
-#define {{"_".join(config.protocol.namespace)}}_Maybe_h
-
-//#include "Forward.h"
-
-{% for namespace in config.protocol.namespace %}
-namespace {{namespace}} {
-{% endfor %}
-
-template<typename T>
-class Maybe {
-public:
-    Maybe() : m_value() { }
-    Maybe(std::unique_ptr<T> value) : m_value(std::move(value)) { }
-    Maybe(Maybe&& other) : m_value(std::move(other.m_value)) { }
-    void operator=(std::unique_ptr<T> value) { m_value = std::move(value); }
-    T* fromJust() const { DCHECK(m_value); return m_value.get(); }
-    T* fromMaybe(T* defaultValue) const { return m_value ? m_value.get() : defaultValue; }
-    bool isJust() const { return !!m_value; }
-    std::unique_ptr<T> takeJust() { DCHECK(m_value); return std::move(m_value); }
-private:
-    std::unique_ptr<T> m_value;
-};
-
-template<typename T>
-class MaybeBase {
-public:
-    MaybeBase() : m_isJust(false) { }
-    MaybeBase(T value) : m_isJust(true), m_value(value) { }
-    MaybeBase(MaybeBase&& other) : m_isJust(other.m_isJust), m_value(std::move(other.m_value)) { }
-    void operator=(T value) { m_value = value; m_isJust = true; }
-    T fromJust() const { DCHECK(m_isJust); return m_value; }
-    T fromMaybe(const T& defaultValue) const { return m_isJust ? m_value : defaultValue; }
-    bool isJust() const { return m_isJust; }
-    T takeJust() { DCHECK(m_isJust); return m_value; }
-
-protected:
-    bool m_isJust;
-    T m_value;
-};
-
-template<>
-class Maybe<bool> : public MaybeBase<bool> {
-public:
-    Maybe() { }
-    Maybe(bool value) : MaybeBase(value) { }
-    Maybe(Maybe&& other) : MaybeBase(std::move(other)) { }
-    using MaybeBase::operator=;
-};
-
-template<>
-class Maybe<int> : public MaybeBase<int> {
-public:
-    Maybe() { }
-    Maybe(int value) : MaybeBase(value) { }
-    Maybe(Maybe&& other) : MaybeBase(std::move(other)) { }
-    using MaybeBase::operator=;
-};
-
-template<>
-class Maybe<double> : public MaybeBase<double> {
-public:
-    Maybe() { }
-    Maybe(double value) : MaybeBase(value) { }
-    Maybe(Maybe&& other) : MaybeBase(std::move(other)) { }
-    using MaybeBase::operator=;
-};
-
-template<>
-class Maybe<String> : public MaybeBase<String> {
-public:
-    Maybe() { }
-    Maybe(const String& value) : MaybeBase(value) { }
-    Maybe(Maybe&& other) : MaybeBase(std::move(other)) { }
-    using MaybeBase::operator=;
-};
-
-{% for namespace in config.protocol.namespace %}
-} // namespace {{namespace}}
-{% endfor %}
-
-#endif // !defined({{"_".join(config.protocol.namespace)}}_Maybe_h)
diff --git a/src/v8/tools/check-static-initializers.gyp b/src/v8/tools/check-static-initializers.gyp
deleted file mode 100644
index cfeacfc..0000000
--- a/src/v8/tools/check-static-initializers.gyp
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'conditions': [
-    ['test_isolation_mode != "noop"', {
-      'targets': [
-        {
-          'target_name': 'check_static_initializers_run',
-          'type': 'none',
-          'dependencies': [
-            '../src/d8.gyp:d8_run',
-          ],
-          'includes': [
-            '../gypfiles/features.gypi',
-            '../gypfiles/isolate.gypi',
-          ],
-          'sources': [
-            'check-static-initializers.isolate',
-          ],
-        },
-      ],
-    }],
-  ],
-}
diff --git a/src/v8/tools/check-static-initializers.isolate b/src/v8/tools/check-static-initializers.isolate
deleted file mode 100644
index d1197d3..0000000
--- a/src/v8/tools/check-static-initializers.isolate
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright 2016 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'variables': {
-    'command': [
-      'check-static-initializers.sh',
-    ],
-    'files': [
-      'check-static-initializers.sh',
-    ],
-  },
-  'includes': [
-    '../src/d8.isolate',
-  ],
-}
diff --git a/src/v8/tools/foozzie/BUILD.gn b/src/v8/tools/foozzie/BUILD.gn
deleted file mode 100644
index 532c1fa..0000000
--- a/src/v8/tools/foozzie/BUILD.gn
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright 2017 the V8 project 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("../../gni/v8.gni")
-
-if (v8_correctness_fuzzer) {
-  copy("v8_correctness_fuzzer_resources") {
-    sources = [
-      "v8_commands.py",
-      "v8_foozzie.py",
-      "v8_mock.js",
-      "v8_mock_archs.js",
-      "v8_suppressions.js",
-      "v8_suppressions.py",
-    ]
-    outputs = [ "$root_out_dir/{{source_file_part}}" ]
-  }
-}
diff --git a/src/v8/tools/foozzie/testdata/failure_output.txt b/src/v8/tools/foozzie/testdata/failure_output.txt
deleted file mode 100644
index 85b1d7a..0000000
--- a/src/v8/tools/foozzie/testdata/failure_output.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# V8 correctness failure
-# V8 correctness configs: x64,ignition:x64,ignition_turbo
-# V8 correctness sources: f60
-# V8 correctness suppression: 
-#
-# CHECK
-#
-# Compared x64,ignition with x64,ignition_turbo
-#
-# Flags of x64,ignition:
---abort_on_stack_or_string_length_overflow --expose-gc --allow-natives-syntax --invoke-weak-callbacks --omit-quit --es-staging --random-seed 12345 --turbo-filter=~ --noopt --suppress-asm-messages
-# Flags of x64,ignition_turbo:
---abort_on_stack_or_string_length_overflow --expose-gc --allow-natives-syntax --invoke-weak-callbacks --omit-quit --es-staging --random-seed 12345 --suppress-asm-messages --stress-scavenge=100
-#
-# Difference:
-- unknown
-+ not unknown
-#
-# Source file:
-name/to/file.js
-#
-### Start of configuration x64,ignition:
-
-1
-v8-foozzie source: name/to/a/file.js
-2
-v8-foozzie source: name/to/file.js
-  weird error
-        ^
-3
-unknown
-
-
-### End of configuration x64,ignition
-#
-### Start of configuration x64,ignition_turbo:
-
-1
-v8-foozzie source: name/to/a/file.js
-2
-v8-foozzie source: name/to/file.js
-  weird other error
-^
-3
-not unknown
-
-
-### End of configuration x64,ignition_turbo
-
diff --git a/src/v8/tools/foozzie/testdata/fuzz-123.js b/src/v8/tools/foozzie/testdata/fuzz-123.js
deleted file mode 100644
index fbde573..0000000
--- a/src/v8/tools/foozzie/testdata/fuzz-123.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Empty test dummy.
-print("js-mutation: start generated test case");
diff --git a/src/v8/tools/foozzie/testdata/test_d8_1.py b/src/v8/tools/foozzie/testdata/test_d8_1.py
deleted file mode 100644
index 15a93fa..0000000
--- a/src/v8/tools/foozzie/testdata/test_d8_1.py
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 2016 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-print """
-1
-v8-foozzie source: name/to/a/file.js
-2
-v8-foozzie source: name/to/file.js
-  weird error
-        ^
-3
-unknown
-"""
diff --git a/src/v8/tools/foozzie/testdata/test_d8_2.py b/src/v8/tools/foozzie/testdata/test_d8_2.py
deleted file mode 100644
index f2bdacf..0000000
--- a/src/v8/tools/foozzie/testdata/test_d8_2.py
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 2016 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-print """
-1
-v8-foozzie source: name/to/a/file.js
-2
-v8-foozzie source: name/to/file.js
-  weird other error
-^
-3
-unknown
-"""
diff --git a/src/v8/tools/foozzie/testdata/test_d8_3.py b/src/v8/tools/foozzie/testdata/test_d8_3.py
deleted file mode 100644
index a6c8682..0000000
--- a/src/v8/tools/foozzie/testdata/test_d8_3.py
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 2016 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-print """
-1
-v8-foozzie source: name/to/a/file.js
-2
-v8-foozzie source: name/to/file.js
-  weird other error
-^
-3
-not unknown
-"""
diff --git a/src/v8/tools/foozzie/testdata/v8_build_config.json b/src/v8/tools/foozzie/testdata/v8_build_config.json
deleted file mode 100644
index ea27b1c..0000000
--- a/src/v8/tools/foozzie/testdata/v8_build_config.json
+++ /dev/null
@@ -1 +0,0 @@
-{"v8_current_cpu": "x64"}
diff --git a/src/v8/tools/foozzie/v8_commands.py b/src/v8/tools/foozzie/v8_commands.py
deleted file mode 100644
index 0b3cae7..0000000
--- a/src/v8/tools/foozzie/v8_commands.py
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright 2016 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Fork from commands.py and output.py in v8 test driver.
-
-import signal
-import subprocess
-import sys
-from threading import Event, Timer
-
-
-class Output(object):
-  def __init__(self, exit_code, timed_out, stdout, pid):
-    self.exit_code = exit_code
-    self.timed_out = timed_out
-    self.stdout = stdout
-    self.pid = pid
-
-  def HasCrashed(self):
-    # Timed out tests will have exit_code -signal.SIGTERM.
-    if self.timed_out:
-      return False
-    return (self.exit_code < 0 and
-            self.exit_code != -signal.SIGABRT)
-
-  def HasTimedOut(self):
-    return self.timed_out
-
-
-def Execute(args, cwd, timeout=None):
-  popen_args = [c for c in args if c != ""]
-  try:
-    process = subprocess.Popen(
-      args=popen_args,
-      stdout=subprocess.PIPE,
-      stderr=subprocess.STDOUT,
-      cwd=cwd
-    )
-  except Exception as e:
-    sys.stderr.write("Error executing: %s\n" % popen_args)
-    raise e
-
-  timeout_event = Event()
-
-  def kill_process():
-    timeout_event.set()
-    try:
-      process.kill()
-    except OSError:
-      sys.stderr.write('Error: Process %s already ended.\n' % process.pid)
-
-
-  timer = Timer(timeout, kill_process)
-  timer.start()
-  stdout, _ = process.communicate()
-  timer.cancel()
-
-  return Output(
-      process.returncode,
-      timeout_event.is_set(),
-      stdout.decode('utf-8', 'replace').encode('utf-8'),
-      process.pid,
-  )
diff --git a/src/v8/tools/foozzie/v8_foozzie.py b/src/v8/tools/foozzie/v8_foozzie.py
deleted file mode 100755
index 9bb3512..0000000
--- a/src/v8/tools/foozzie/v8_foozzie.py
+++ /dev/null
@@ -1,380 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2016 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-V8 correctness fuzzer launcher script.
-"""
-
-import argparse
-import hashlib
-import itertools
-import json
-import os
-import random
-import re
-import sys
-import traceback
-
-import v8_commands
-import v8_suppressions
-
-CONFIGS = dict(
-  default=[
-    '--suppress-asm-messages',
-  ],
-  ignition=[
-    '--turbo-filter=~',
-    '--noopt',
-    '--suppress-asm-messages',
-  ],
-  ignition_asm=[
-    '--turbo-filter=~',
-    '--noopt',
-    '--validate-asm',
-    '--stress-validate-asm',
-    '--suppress-asm-messages',
-  ],
-  ignition_eager=[
-    '--turbo-filter=~',
-    '--noopt',
-    '--no-lazy',
-    '--no-lazy-inner-functions',
-    '--suppress-asm-messages',
-  ],
-  ignition_turbo=[
-    '--suppress-asm-messages',
-  ],
-  ignition_turbo_opt=[
-    '--always-opt',
-    '--suppress-asm-messages',
-  ],
-  ignition_turbo_opt_eager=[
-    '--always-opt',
-    '--no-lazy',
-    '--no-lazy-inner-functions',
-    '--suppress-asm-messages',
-  ],
-  slow_path=[
-    '--force-slow-path',
-    '--suppress-asm-messages',
-  ],
-  slow_path_opt=[
-    '--always-opt',
-    '--force-slow-path',
-    '--suppress-asm-messages',
-  ],
-  trusted=[
-    '--no-untrusted-code-mitigations',
-    '--suppress-asm-messages',
-  ],
-  trusted_opt=[
-    '--always-opt',
-    '--no-untrusted-code-mitigations',
-    '--suppress-asm-messages',
-  ],
-)
-
-# Additional flag experiments. List of tuples like
-# (<likelihood to use flags in [0,1)>, <flag>).
-ADDITIONAL_FLAGS = [
-  (0.1, '--stress-marking=100'),
-  (0.1, '--stress-scavenge=100'),
-  (0.1, '--stress-compaction-random'),
-  (0.1, '--random-gc-interval=2000'),
-]
-
-# Timeout in seconds for one d8 run.
-TIMEOUT = 3
-
-# Return codes.
-RETURN_PASS = 0
-RETURN_FAIL = 2
-
-BASE_PATH = os.path.dirname(os.path.abspath(__file__))
-PREAMBLE = [
-  os.path.join(BASE_PATH, 'v8_mock.js'),
-  os.path.join(BASE_PATH, 'v8_suppressions.js'),
-]
-ARCH_MOCKS = os.path.join(BASE_PATH, 'v8_mock_archs.js')
-
-FLAGS = ['--abort_on_stack_or_string_length_overflow', '--expose-gc',
-         '--allow-natives-syntax', '--invoke-weak-callbacks', '--omit-quit',
-         '--es-staging']
-
-SUPPORTED_ARCHS = ['ia32', 'x64', 'arm', 'arm64']
-
-# Output for suppressed failure case.
-FAILURE_HEADER_TEMPLATE = """#
-# V8 correctness failure
-# V8 correctness configs: %(configs)s
-# V8 correctness sources: %(source_key)s
-# V8 correctness suppression: %(suppression)s
-"""
-
-# Extended output for failure case. The 'CHECK' is for the minimizer.
-FAILURE_TEMPLATE = FAILURE_HEADER_TEMPLATE + """#
-# CHECK
-#
-# Compared %(first_config_label)s with %(second_config_label)s
-#
-# Flags of %(first_config_label)s:
-%(first_config_flags)s
-# Flags of %(second_config_label)s:
-%(second_config_flags)s
-#
-# Difference:
-%(difference)s
-#
-# Source file:
-%(source)s
-#
-### Start of configuration %(first_config_label)s:
-%(first_config_output)s
-### End of configuration %(first_config_label)s
-#
-### Start of configuration %(second_config_label)s:
-%(second_config_output)s
-### End of configuration %(second_config_label)s
-"""
-
-FUZZ_TEST_RE = re.compile(r'.*fuzz(-\d+\.js)')
-SOURCE_RE = re.compile(r'print\("v8-foozzie source: (.*)"\);')
-
-# The number of hex digits used from the hash of the original source file path.
-# Keep the number small to avoid duplicate explosion.
-ORIGINAL_SOURCE_HASH_LENGTH = 3
-
-# Placeholder string if no original source file could be determined.
-ORIGINAL_SOURCE_DEFAULT = 'none'
-
-
-def infer_arch(d8):
-  """Infer the V8 architecture from the build configuration next to the
-  executable.
-  """
-  with open(os.path.join(os.path.dirname(d8), 'v8_build_config.json')) as f:
-    arch = json.load(f)['v8_current_cpu']
-  return 'ia32' if arch == 'x86' else arch
-
-
-def parse_args():
-  parser = argparse.ArgumentParser()
-  parser.add_argument(
-    '--random-seed', type=int, required=True,
-    help='random seed passed to both runs')
-  parser.add_argument(
-      '--first-config', help='first configuration', default='ignition')
-  parser.add_argument(
-      '--second-config', help='second configuration', default='ignition_turbo')
-  parser.add_argument(
-      '--first-d8', default='d8',
-      help='optional path to first d8 executable, '
-           'default: bundled in the same directory as this script')
-  parser.add_argument(
-      '--second-d8',
-      help='optional path to second d8 executable, default: same as first')
-  parser.add_argument('testcase', help='path to test case')
-  options = parser.parse_args()
-
-  # Ensure we have a test case.
-  assert (os.path.exists(options.testcase) and
-          os.path.isfile(options.testcase)), (
-      'Test case %s doesn\'t exist' % options.testcase)
-
-  # Use first d8 as default for second d8.
-  options.second_d8 = options.second_d8 or options.first_d8
-
-  # Ensure absolute paths.
-  if not os.path.isabs(options.first_d8):
-    options.first_d8 = os.path.join(BASE_PATH, options.first_d8)
-  if not os.path.isabs(options.second_d8):
-    options.second_d8 = os.path.join(BASE_PATH, options.second_d8)
-
-  # Ensure executables exist.
-  assert os.path.exists(options.first_d8)
-  assert os.path.exists(options.second_d8)
-
-  # Infer architecture from build artifacts.
-  options.first_arch = infer_arch(options.first_d8)
-  options.second_arch = infer_arch(options.second_d8)
-
-  # Ensure we make a sane comparison.
-  if (options.first_arch == options.second_arch and
-      options.first_config == options.second_config):
-    parser.error('Need either arch or config difference.')
-  assert options.first_arch in SUPPORTED_ARCHS
-  assert options.second_arch in SUPPORTED_ARCHS
-  assert options.first_config in CONFIGS
-  assert options.second_config in CONFIGS
-
-  return options
-
-
-def get_meta_data(content):
-  """Extracts original-source-file paths from test case content."""
-  sources = []
-  for line in content.splitlines():
-    match = SOURCE_RE.match(line)
-    if match:
-      sources.append(match.group(1))
-  return {'sources': sources}
-
-
-def content_bailout(content, ignore_fun):
-  """Print failure state and return if ignore_fun matches content."""
-  bug = (ignore_fun(content) or '').strip()
-  if bug:
-    print FAILURE_HEADER_TEMPLATE % dict(
-        configs='', source_key='', suppression=bug)
-    return True
-  return False
-
-
-def pass_bailout(output, step_number):
-  """Print info and return if in timeout or crash pass states."""
-  if output.HasTimedOut():
-    # Dashed output, so that no other clusterfuzz tools can match the
-    # words timeout or crash.
-    print '# V8 correctness - T-I-M-E-O-U-T %d' % step_number
-    return True
-  if output.HasCrashed():
-    print '# V8 correctness - C-R-A-S-H %d' % step_number
-    return True
-  return False
-
-
-def fail_bailout(output, ignore_by_output_fun):
-  """Print failure state and return if ignore_by_output_fun matches output."""
-  bug = (ignore_by_output_fun(output.stdout) or '').strip()
-  if bug:
-    print FAILURE_HEADER_TEMPLATE % dict(
-        configs='', source_key='', suppression=bug)
-    return True
-  return False
-
-
-def main():
-  options = parse_args()
-  rng = random.Random(options.random_seed)
-
-  # Suppressions are architecture and configuration specific.
-  suppress = v8_suppressions.get_suppression(
-      options.first_arch, options.first_config,
-      options.second_arch, options.second_config,
-  )
-
-  # Static bailout based on test case content or metadata.
-  with open(options.testcase) as f:
-    content = f.read()
-  if content_bailout(get_meta_data(content), suppress.ignore_by_metadata):
-    return RETURN_FAIL
-  if content_bailout(content, suppress.ignore_by_content):
-    return RETURN_FAIL
-
-  # Set up runtime arguments.
-  common_flags = FLAGS + ['--random-seed', str(options.random_seed)]
-  first_config_flags = common_flags + CONFIGS[options.first_config]
-  second_config_flags = common_flags + CONFIGS[options.second_config]
-
-  # Add additional flags to second config based on experiment percentages.
-  for p, flag in ADDITIONAL_FLAGS:
-    if rng.random() < p:
-      second_config_flags.append(flag)
-
-  def run_d8(d8, config_flags):
-    preamble = PREAMBLE[:]
-    if options.first_arch != options.second_arch:
-      preamble.append(ARCH_MOCKS)
-    args = [d8] + config_flags + preamble + [options.testcase]
-    print " ".join(args)
-    if d8.endswith('.py'):
-      # Wrap with python in tests.
-      args = [sys.executable] + args
-    return v8_commands.Execute(
-        args,
-        cwd=os.path.dirname(os.path.abspath(options.testcase)),
-        timeout=TIMEOUT,
-    )
-
-  first_config_output = run_d8(options.first_d8, first_config_flags)
-
-  # Early bailout based on first run's output.
-  if pass_bailout(first_config_output, 1):
-    return RETURN_PASS
-
-  second_config_output = run_d8(options.second_d8, second_config_flags)
-
-  # Bailout based on second run's output.
-  if pass_bailout(second_config_output, 2):
-    return RETURN_PASS
-
-  difference, source = suppress.diff(
-      first_config_output.stdout, second_config_output.stdout)
-
-  if source:
-    source_key = hashlib.sha1(source).hexdigest()[:ORIGINAL_SOURCE_HASH_LENGTH]
-  else:
-    source = ORIGINAL_SOURCE_DEFAULT
-    source_key = ORIGINAL_SOURCE_DEFAULT
-
-  if difference:
-    # Only bail out due to suppressed output if there was a difference. If a
-    # suppression doesn't show up anymore in the statistics, we might want to
-    # remove it.
-    if fail_bailout(first_config_output, suppress.ignore_by_output1):
-      return RETURN_FAIL
-    if fail_bailout(second_config_output, suppress.ignore_by_output2):
-      return RETURN_FAIL
-
-    # The first three entries will be parsed by clusterfuzz. Format changes
-    # will require changes on the clusterfuzz side.
-    first_config_label = '%s,%s' % (options.first_arch, options.first_config)
-    second_config_label = '%s,%s' % (options.second_arch, options.second_config)
-    print (FAILURE_TEMPLATE % dict(
-        configs='%s:%s' % (first_config_label, second_config_label),
-        source_key=source_key,
-        suppression='', # We can't tie bugs to differences.
-        first_config_label=first_config_label,
-        second_config_label=second_config_label,
-        first_config_flags=' '.join(first_config_flags),
-        second_config_flags=' '.join(second_config_flags),
-        first_config_output=
-            first_config_output.stdout.decode('utf-8', 'replace'),
-        second_config_output=
-            second_config_output.stdout.decode('utf-8', 'replace'),
-        source=source,
-        difference=difference.decode('utf-8', 'replace'),
-    )).encode('utf-8', 'replace')
-    return RETURN_FAIL
-
-  # TODO(machenbach): Figure out if we could also return a bug in case there's
-  # no difference, but one of the line suppressions has matched - and without
-  # the match there would be a difference.
-
-  print '# V8 correctness - pass'
-  return RETURN_PASS
-
-
-if __name__ == "__main__":
-  try:
-    result = main()
-  except SystemExit:
-    # Make sure clusterfuzz reports internal errors and wrong usage.
-    # Use one label for all internal and usage errors.
-    print FAILURE_HEADER_TEMPLATE % dict(
-        configs='', source_key='', suppression='wrong_usage')
-    result = RETURN_FAIL
-  except MemoryError:
-    # Running out of memory happens occasionally but is not actionable.
-    print '# V8 correctness - pass'
-    result = RETURN_PASS
-  except Exception as e:
-    print FAILURE_HEADER_TEMPLATE % dict(
-        configs='', source_key='', suppression='internal_error')
-    print '# Internal error: %s' % e
-    traceback.print_exc(file=sys.stdout)
-    result = RETURN_FAIL
-
-  sys.exit(result)
diff --git a/src/v8/tools/foozzie/v8_foozzie_test.py b/src/v8/tools/foozzie/v8_foozzie_test.py
deleted file mode 100644
index ffe18a8..0000000
--- a/src/v8/tools/foozzie/v8_foozzie_test.py
+++ /dev/null
@@ -1,111 +0,0 @@
-# Copyright 2016 the V8 project 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 os
-import subprocess
-import sys
-import unittest
-
-import v8_foozzie
-import v8_suppressions
-
-BASE_DIR = os.path.dirname(os.path.abspath(__file__))
-FOOZZIE = os.path.join(BASE_DIR, 'v8_foozzie.py')
-TEST_DATA = os.path.join(BASE_DIR, 'testdata')
-
-class UnitTest(unittest.TestCase):
-  def testDiff(self):
-    # TODO(machenbach): Mock out suppression configuration.
-    suppress = v8_suppressions.get_suppression(
-        'x64', 'ignition', 'x64', 'ignition_turbo')
-    one = ''
-    two = ''
-    diff = None, None
-    self.assertEquals(diff, suppress.diff(one, two))
-
-    one = 'a \n  b\nc();'
-    two = 'a \n  b\nc();'
-    diff = None, None
-    self.assertEquals(diff, suppress.diff(one, two))
-
-    # Ignore line before caret, caret position and error message.
-    one = """
-undefined
-weird stuff
-      ^
-somefile.js: TypeError: undefined is not a function
-  undefined
-"""
-    two = """
-undefined
-other weird stuff
-            ^
-somefile.js: TypeError: baz is not a function
-  undefined
-"""
-    diff = None, None
-    self.assertEquals(diff, suppress.diff(one, two))
-
-    one = """
-Still equal
-Extra line
-"""
-    two = """
-Still equal
-"""
-    diff = '- Extra line', None
-    self.assertEquals(diff, suppress.diff(one, two))
-
-    one = """
-Still equal
-"""
-    two = """
-Still equal
-Extra line
-"""
-    diff = '+ Extra line', None
-    self.assertEquals(diff, suppress.diff(one, two))
-
-    one = """
-undefined
-somefile.js: TypeError: undefined is not a constructor
-"""
-    two = """
-undefined
-otherfile.js: TypeError: undefined is not a constructor
-"""
-    diff = """- somefile.js: TypeError: undefined is not a constructor
-+ otherfile.js: TypeError: undefined is not a constructor""", None
-    self.assertEquals(diff, suppress.diff(one, two))
-
-
-def cut_verbose_output(stdout):
-  return '\n'.join(stdout.split('\n')[2:])
-
-
-def run_foozzie(first_d8, second_d8):
-  return subprocess.check_output([
-    sys.executable, FOOZZIE,
-    '--random-seed', '12345',
-    '--first-d8', os.path.join(TEST_DATA, first_d8),
-    '--second-d8', os.path.join(TEST_DATA, second_d8),
-    '--first-config', 'ignition',
-    '--second-config', 'ignition_turbo',
-    os.path.join(TEST_DATA, 'fuzz-123.js'),
-  ])
-
-
-class SystemTest(unittest.TestCase):
-  def testSyntaxErrorDiffPass(self):
-    stdout = run_foozzie('test_d8_1.py', 'test_d8_2.py')
-    self.assertEquals('# V8 correctness - pass\n', cut_verbose_output(stdout))
-
-  def testDifferentOutputFail(self):
-    with open(os.path.join(TEST_DATA, 'failure_output.txt')) as f:
-      expected_output = f.read()
-    with self.assertRaises(subprocess.CalledProcessError) as ctx:
-      run_foozzie('test_d8_1.py', 'test_d8_3.py')
-    e = ctx.exception
-    self.assertEquals(v8_foozzie.RETURN_FAIL, e.returncode)
-    self.assertEquals(expected_output, cut_verbose_output(e.output))
diff --git a/src/v8/tools/foozzie/v8_mock.js b/src/v8/tools/foozzie/v8_mock.js
deleted file mode 100644
index 5d15304..0000000
--- a/src/v8/tools/foozzie/v8_mock.js
+++ /dev/null
@@ -1,136 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This is intended for permanent JS behavior changes for mocking out
-// non-deterministic behavior. For temporary suppressions, please refer to
-// v8_suppressions.js.
-// This file is loaded before each correctness test cases and won't get
-// minimized.
-
-
-// This will be overridden in the test cases. The override can be minimized.
-var __PrettyPrint = function __PrettyPrint(msg) { print(msg); };
-
-// Mock Math.random.
-(function () {
-  var index = 0
-  Math.random = function() {
-    index = (index + 1) % 10;
-    return index / 10.0;
-  }
-})();
-
-// Mock Date.
-(function () {
-  var index = 0
-  var mockDate = 1477662728696
-  var mockDateNow = function() {
-    index = (index + 1) % 10
-    mockDate = mockDate + index + 1
-    return mockDate
-  }
-
-  var origDate = Date;
-  var constructDate = function(args) {
-    if (args.length == 1) {
-      var result = new origDate(args[0]);
-    } else if (args.length == 2) {
-      var result = new origDate(args[0], args[1]);
-    } else if (args.length == 3) {
-      var result = new origDate(args[0], args[1], args[2]);
-    } else if (args.length == 4) {
-      var result = new origDate(args[0], args[1], args[2], args[3]);
-    } else if (args.length == 5) {
-      var result = new origDate(args[0], args[1], args[2], args[3], args[4]);
-    } else if (args.length == 6) {
-      var result = new origDate(
-          args[0], args[1], args[2], args[3], args[4], args[5]);
-    } else if (args.length >= 7) {
-      var result = new origDate(
-          args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
-    } else {
-      var result = new origDate(mockDateNow());
-    }
-    result.constructor = function(...args) { return constructDate(args); }
-    Object.defineProperty(
-        result, "constructor", { configurable: false, writable: false });
-    return result
-  }
-
-  var handler = {
-    apply: function (target, thisArg, args) {
-      return constructDate(args)
-    },
-    construct: function (target, args, newTarget) {
-      return constructDate(args)
-    },
-    get: function(target, property, receiver) {
-      if (property == "now") {
-        return mockDateNow;
-      }
-    },
-  }
-
-  Date = new Proxy(Date, handler);
-})();
-
-// Mock performace.now().
-(function () {
-  performance.now = function () { return 1.2; }
-})();
-
-// Mock stack traces.
-Error.prepareStackTrace = function (error, structuredStackTrace) {
-  return "";
-};
-Object.defineProperty(
-    Error, 'prepareStackTrace', { configurable: false, writable: false });
-
-// Mock buffer access in float typed arrays because of varying NaN patterns.
-// Note, for now we just use noop forwarding proxies, because they already
-// turn off optimizations.
-(function () {
-  var mock = function(arrayType) {
-    var handler = {
-      construct: function(target, args) {
-        var obj = new (Function.prototype.bind.apply(arrayType, [null].concat(args)));
-        return new Proxy(obj, {
-          get: function(x, prop) {
-            if (typeof x[prop] == "function")
-              return x[prop].bind(obj)
-            return x[prop];
-          },
-        });
-      },
-    };
-    return new Proxy(arrayType, handler);
-  }
-
-  Float32Array = mock(Float32Array);
-  Float64Array = mock(Float64Array);
-})();
-
-// Mock Worker.
-(function () {
-  var index = 0;
-  // TODO(machenbach): Randomize this for each test case, but keep stable
-  // during comparison. Also data and random above.
-  var workerMessages = [
-    undefined, 0, -1, "", "foo", 42, [], {}, [0], {"x": 0}
-  ];
-  Worker = function(code){
-    try {
-      __PrettyPrint(eval(code));
-    } catch(e) {
-      __PrettyPrint(e);
-    }
-    this.getMessage = function(){
-      index = (index + 1) % 10;
-      return workerMessages[index];
-    }
-    this.postMessage = function(msg){
-      __PrettyPrint(msg);
-    }
-  };
-})();
diff --git a/src/v8/tools/foozzie/v8_mock_archs.js b/src/v8/tools/foozzie/v8_mock_archs.js
deleted file mode 100644
index 507f31a..0000000
--- a/src/v8/tools/foozzie/v8_mock_archs.js
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This is intended for permanent JS behavior changes for mocking out
-// non-deterministic behavior. For temporary suppressions, please refer to
-// v8_suppressions.js.
-// This mocks only architecture specific differences. Refer to v8_mocks.js
-// for the general case.
-// This file is loaded before each correctness test cases and won't get
-// minimized.
-
-// Mock maximum typed-array length and limit to 1MiB.
-(function () {
-  var mock = function(arrayType) {
-    var handler = {
-      construct: function(target, args) {
-        var arrayLength = args[0]
-        if (args.length > 0 &&
-            Number.isInteger(args[0]) &&
-            args[0] > 1048576) {
-          args[0] = 1048576
-        } else if (args.length > 2 &&
-                   Number.isInteger(args[2]) &&
-                   args[2] > 1048576) {
-          args[2] = 1048576
-        }
-        return new (
-            Function.prototype.bind.apply(arrayType, [null].concat(args)));
-      },
-    };
-    return new Proxy(arrayType, handler);
-  }
-
-  ArrayBuffer = mock(ArrayBuffer);
-  Int8Array = mock(Int8Array);
-  Uint8Array = mock(Uint8Array);
-  Uint8ClampedArray = mock(Uint8ClampedArray);
-  Int16Array = mock(Int16Array);
-  Uint16Array = mock(Uint16Array);
-  Int32Array = mock(Int32Array);
-  Uint32Array = mock(Uint32Array);
-  Float32Array = mock(Float32Array);
-  Float64Array = mock(Float64Array);
-})();
-
-// Mock typed array set function and limit maximum offset to 1MiB.
-(function () {
-  var typedArrayTypes = [
-    Int8Array,
-    Uint8Array,
-    Uint8ClampedArray,
-    Int16Array,
-    Uint16Array,
-    Int32Array,
-    Uint32Array,
-    Float32Array,
-    Float64Array,
-  ];
-  for (let typedArrayType of typedArrayTypes) {
-    let set = typedArrayType.prototype.set
-    typedArrayType.prototype.set = function(array, offset) {
-      set.apply(this, [array, offset > 1048576 ? 1048576 : offset])
-    };
-  }
-})();
diff --git a/src/v8/tools/foozzie/v8_suppressions.js b/src/v8/tools/foozzie/v8_suppressions.js
deleted file mode 100644
index 011e727..0000000
--- a/src/v8/tools/foozzie/v8_suppressions.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This file is loaded before each correctness test case and after v8_mock.js.
-// You can temporarily change JS behavior here to silence known problems.
-// Please refer to a bug in a comment and remove the suppression once the
-// problem is fixed.
-
-// Suppress http://crbug.com/662429
-(function () {
-  var oldMathPow = Math.pow
-  Math.pow = function(a, b){
-    if (b < 0) {
-      return 0.000017;
-    } else {
-      return oldMathPow(a, b);
-    }
-  }
-})();
-
-// Suppress http://crbug.com/693426
-(function () {
-  var oldMathPow = Math.pow
-  Math.pow = function(a, b){
-    var s = "" + oldMathPow(a, b)
-    // Low tech precision mock. Limit digits in string representation.
-    // The phrases Infinity and NaN don't match the split("e").
-    s = s.split("e");
-    s[0] = s[0].substr(0, 17);
-    return parseFloat(s.join("e"));
-  }
-})();
diff --git a/src/v8/tools/foozzie/v8_suppressions.py b/src/v8/tools/foozzie/v8_suppressions.py
deleted file mode 100644
index 87b1972..0000000
--- a/src/v8/tools/foozzie/v8_suppressions.py
+++ /dev/null
@@ -1,324 +0,0 @@
-# Copyright 2016 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-Suppressions for V8 correctness fuzzer failures.
-
-We support three types of suppressions:
-1. Ignore test case by pattern.
-Map a regular expression to a bug entry. A new failure will be reported
-when the pattern matches a JS test case.
-Subsequent matches will be recoreded under the first failure.
-
-2. Ignore test run by output pattern:
-Map a regular expression to a bug entry. A new failure will be reported
-when the pattern matches the output of a particular run.
-Subsequent matches will be recoreded under the first failure.
-
-3. Relax line-to-line comparisons with expressions of lines to ignore and
-lines to be normalized (i.e. ignore only portions of lines).
-These are not tied to bugs, be careful to not silently switch off this tool!
-
-Alternatively, think about adding a behavior change to v8_suppressions.js
-to silence a particular class of problems.
-"""
-
-import itertools
-import re
-
-# Max line length for regular experessions checking for lines to ignore.
-MAX_LINE_LENGTH = 512
-
-# For ignoring lines before carets and to ignore caret positions.
-CARET_RE = re.compile(r'^\s*\^\s*$')
-
-# Ignore by original source files. Map from bug->list of relative file paths in
-# V8, e.g. '/v8/test/mjsunit/d8-performance-now.js' including /v8/. A test will
-# be suppressed if one of the files below was used to mutate the test.
-IGNORE_SOURCES = {
-  # This contains a usage of f.arguments that often fires.
-  'crbug.com/662424': [
-    '/v8/test/mjsunit/bugs/bug-222.js',
-    '/v8/test/mjsunit/bugs/bug-941049.js',
-    '/v8/test/mjsunit/regress/regress-crbug-668795.js',
-    '/v8/test/mjsunit/regress/regress-1079.js',
-    '/v8/test/mjsunit/regress/regress-2989.js',
-  ],
-
-  'crbug.com/688159': [
-    '/v8/test/mjsunit/es7/exponentiation-operator.js',
-  ],
-
-  # TODO(machenbach): Implement blacklisting files for particular configs only,
-  # here ignition_eager.
-  'crbug.com/691589': [
-    '/v8/test/mjsunit/regress/regress-1200351.js',
-  ],
-
-  'crbug.com/691587': [
-    '/v8/test/mjsunit/asm/regress-674089.js',
-  ],
-
-  'crbug.com/774805': [
-    '/v8/test/mjsunit/console.js',
-  ],
-}
-
-# Ignore by test case pattern. Map from config->bug->regexp. Config '' is used
-# to match all configurations. Otherwise use either a compiler configuration,
-# e.g. ignition or validate_asm or an architecture, e.g. x64 or ia32.
-# Bug is preferred to be a crbug.com/XYZ, but can be any short distinguishable
-# label.
-# Regular expressions are assumed to be compiled. We use regexp.search.
-IGNORE_TEST_CASES = {
-  'slow_path': {
-    'crbug.com/800651':
-        re.compile(r'async', re.S),
-  },
-  'slow_path_opt': {
-    'crbug.com/800651':
-        re.compile(r'async', re.S),
-  },
-}
-
-# Ignore by output pattern. Map from config->bug->regexp. See IGNORE_TEST_CASES
-# on how to specify config keys.
-# Bug is preferred to be a crbug.com/XYZ, but can be any short distinguishable
-# label.
-# Regular expressions are assumed to be compiled. We use regexp.search.
-IGNORE_OUTPUT = {
-  '': {
-    'crbug.com/664068':
-        re.compile(r'RangeError(?!: byte length)', re.S),
-    'crbug.com/667678':
-        re.compile(r'\[native code\]', re.S),
-    'crbug.com/689877':
-        re.compile(r'^.*SyntaxError: .*Stack overflow$', re.M),
-  },
-}
-
-# Lines matching any of the following regular expressions will be ignored
-# if appearing on both sides. The capturing groups need to match exactly.
-# Use uncompiled regular expressions - they'll be compiled later.
-ALLOWED_LINE_DIFFS = [
-  # Ignore caret position in stack traces.
-  r'^\s*\^\s*$',
-
-  # Ignore some stack trace headers as messages might not match.
-  r'^(.*)TypeError: .* is not a function$',
-  r'^(.*)TypeError: .* is not a constructor$',
-  r'^(.*)TypeError: (.*) is not .*$',
-  r'^(.*)ReferenceError: .* is not defined$',
-  r'^(.*):\d+: ReferenceError: .* is not defined$',
-
-  # These are rarely needed. It includes some cases above.
-  r'^\w*Error: .* is not .*$',
-  r'^(.*) \w*Error: .* is not .*$',
-  r'^(.*):\d+: \w*Error: .* is not .*$',
-
-  # Some test cases just print the message.
-  r'^.* is not a function(.*)$',
-  r'^(.*) is not a .*$',
-
-  # crbug.com/680064. This subsumes one of the above expressions.
-  r'^(.*)TypeError: .* function$',
-
-  # crbug.com/664068
-  r'^(.*)(?:Array buffer allocation failed|Invalid array buffer length)(.*)$',
-]
-
-# Lines matching any of the following regular expressions will be ignored.
-# Use uncompiled regular expressions - they'll be compiled later.
-IGNORE_LINES = [
-  r'^Warning: unknown flag .*$',
-  r'^Warning: .+ is deprecated.*$',
-  r'^Try --help for options$',
-
-  # crbug.com/705962
-  r'^\s\[0x[0-9a-f]+\]$',
-]
-
-
-###############################################################################
-# Implementation - you should not need to change anything below this point.
-
-# Compile regular expressions.
-ALLOWED_LINE_DIFFS = [re.compile(exp) for exp in ALLOWED_LINE_DIFFS]
-IGNORE_LINES = [re.compile(exp) for exp in IGNORE_LINES]
-
-ORIGINAL_SOURCE_PREFIX = 'v8-foozzie source: '
-
-def line_pairs(lines):
-  return itertools.izip_longest(
-      lines, itertools.islice(lines, 1, None), fillvalue=None)
-
-
-def caret_match(line1, line2):
-  if (not line1 or
-      not line2 or
-      len(line1) > MAX_LINE_LENGTH or
-      len(line2) > MAX_LINE_LENGTH):
-    return False
-  return bool(CARET_RE.match(line1) and CARET_RE.match(line2))
-
-
-def short_line_output(line):
-  if len(line) <= MAX_LINE_LENGTH:
-    # Avoid copying.
-    return line
-  return line[0:MAX_LINE_LENGTH] + '...'
-
-
-def ignore_by_regexp(line1, line2, allowed):
-  if len(line1) > MAX_LINE_LENGTH or len(line2) > MAX_LINE_LENGTH:
-    return False
-  for exp in allowed:
-    match1 = exp.match(line1)
-    match2 = exp.match(line2)
-    if match1 and match2:
-      # If there are groups in the regexp, ensure the groups matched the same
-      # things.
-      if match1.groups() == match2.groups():  # tuple comparison
-        return True
-  return False
-
-
-def diff_output(output1, output2, allowed, ignore1, ignore2):
-  """Returns a tuple (difference, source).
-
-  The difference is None if there's no difference, otherwise a string
-  with a readable diff.
-
-  The source is the last source output within the test case, or None if no
-  such output existed.
-  """
-  def useful_line(ignore):
-    def fun(line):
-      return all(not e.match(line) for e in ignore)
-    return fun
-
-  lines1 = filter(useful_line(ignore1), output1)
-  lines2 = filter(useful_line(ignore2), output2)
-
-  # This keeps track where we are in the original source file of the fuzz
-  # test case.
-  source = None
-
-  for ((line1, lookahead1), (line2, lookahead2)) in itertools.izip_longest(
-      line_pairs(lines1), line_pairs(lines2), fillvalue=(None, None)):
-
-    # Only one of the two iterators should run out.
-    assert not (line1 is None and line2 is None)
-
-    # One iterator ends earlier.
-    if line1 is None:
-      return '+ %s' % short_line_output(line2), source
-    if line2 is None:
-      return '- %s' % short_line_output(line1), source
-
-    # If lines are equal, no further checks are necessary.
-    if line1 == line2:
-      # Instrumented original-source-file output must be equal in both
-      # versions. It only makes sense to update it here when both lines
-      # are equal.
-      if line1.startswith(ORIGINAL_SOURCE_PREFIX):
-        source = line1[len(ORIGINAL_SOURCE_PREFIX):]
-      continue
-
-    # Look ahead. If next line is a caret, ignore this line.
-    if caret_match(lookahead1, lookahead2):
-      continue
-
-    # Check if a regexp allows these lines to be different.
-    if ignore_by_regexp(line1, line2, allowed):
-      continue
-
-    # Lines are different.
-    return (
-        '- %s\n+ %s' % (short_line_output(line1), short_line_output(line2)),
-        source,
-    )
-
-  # No difference found.
-  return None, source
-
-
-def get_suppression(arch1, config1, arch2, config2):
-  return V8Suppression(arch1, config1, arch2, config2)
-
-
-class Suppression(object):
-  def diff(self, output1, output2):
-    return None
-
-  def ignore_by_metadata(self, metadata):
-    return None
-
-  def ignore_by_content(self, testcase):
-    return None
-
-  def ignore_by_output1(self, output):
-    return None
-
-  def ignore_by_output2(self, output):
-    return None
-
-
-class V8Suppression(Suppression):
-  def __init__(self, arch1, config1, arch2, config2):
-    self.arch1 = arch1
-    self.config1 = config1
-    self.arch2 = arch2
-    self.config2 = config2
-
-  def diff(self, output1, output2):
-    return diff_output(
-        output1.splitlines(),
-        output2.splitlines(),
-        ALLOWED_LINE_DIFFS,
-        IGNORE_LINES,
-        IGNORE_LINES,
-    )
-
-  def ignore_by_content(self, testcase):
-    # Strip off test case preamble.
-    try:
-      lines = testcase.splitlines()
-      lines = lines[lines.index(
-          'print("js-mutation: start generated test case");'):]
-      content = '\n'.join(lines)
-    except ValueError:
-      # Search the whole test case if preamble can't be found. E.g. older
-      # already minimized test cases might have dropped the delimiter line.
-      content = testcase
-    for key in ['', self.arch1, self.arch2, self.config1, self.config2]:
-      for bug, exp in IGNORE_TEST_CASES.get(key, {}).iteritems():
-        if exp.search(content):
-          return bug
-    return None
-
-  def ignore_by_metadata(self, metadata):
-    for bug, sources in IGNORE_SOURCES.iteritems():
-      for source in sources:
-        if source in metadata['sources']:
-          return bug
-    return None
-
-  def ignore_by_output1(self, output):
-    return self.ignore_by_output(output, self.arch1, self.config1)
-
-  def ignore_by_output2(self, output):
-    return self.ignore_by_output(output, self.arch2, self.config2)
-
-  def ignore_by_output(self, output, arch, config):
-    def check(mapping):
-      for bug, exp in mapping.iteritems():
-        if exp.search(output):
-          return bug
-      return None
-    for key in ['', arch, config]:
-      bug = check(IGNORE_OUTPUT.get(key, {}))
-      if bug:
-        return bug
-    return None
diff --git a/src/v8/tools/gcmole/download_gcmole_tools.py b/src/v8/tools/gcmole/download_gcmole_tools.py
deleted file mode 100755
index af27723..0000000
--- a/src/v8/tools/gcmole/download_gcmole_tools.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2016 the V8 project 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 os
-import re
-import subprocess
-
-GCMOLE_PATH = os.path.dirname(os.path.abspath(__file__))
-SHA1_PATH = os.path.join(GCMOLE_PATH, 'gcmole-tools.tar.gz.sha1')
-
-if re.search(r'\bgcmole=1', os.environ.get('GYP_DEFINES', '')):
-  subprocess.check_call([
-    'download_from_google_storage',
-    '-b', 'chrome-v8-gcmole',
-    '-u', '--no_resume',
-    '-s', SHA1_PATH,
-    '--platform=linux*'
-  ])
diff --git a/src/v8/tools/gcmole/run-gcmole.isolate b/src/v8/tools/gcmole/run-gcmole.isolate
deleted file mode 100644
index 0fba2a1..0000000
--- a/src/v8/tools/gcmole/run-gcmole.isolate
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright 2016 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'variables': {
-    'command': [
-      'run-gcmole.py',
-    ],
-    'files': [
-      'gccause.lua',
-      'gcmole.lua',
-      'parallel.py',
-      'run-gcmole.py',
-      # The following contains all relevant source and gyp files.
-      '../../BUILD.gn',
-      '../../base/',
-      '../../include/',
-      '../../src/',
-      '../../test/cctest/',
-      '../../testing/gtest/include/gtest/gtest_prod.h',
-      '../../third_party/icu/source/',
-    ],
-  },
-  'conditions': [
-    ['gcmole==1', {
-      'variables': {
-        'files': [
-          # This assumes gcmole tools have been fetched by a hook
-          # into v8/tools/gcmole/gcmole_tools.
-          'gcmole-tools/',
-        ],
-      },
-    }],
-  ],
-}
diff --git a/src/v8/tools/gcmole/run_gcmole.gyp b/src/v8/tools/gcmole/run_gcmole.gyp
deleted file mode 100644
index 7d206bf..0000000
--- a/src/v8/tools/gcmole/run_gcmole.gyp
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright 2016 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'conditions': [
-    ['test_isolation_mode != "noop"', {
-      'targets': [
-        {
-          'target_name': 'run_gcmole_run',
-          'type': 'none',
-          'includes': [
-            '../../gypfiles/features.gypi',
-            '../../gypfiles/isolate.gypi',
-          ],
-          'sources': [
-            'run-gcmole.isolate',
-          ],
-        },
-      ],
-    }],
-  ],
-}
diff --git a/src/v8/tools/gcov.sh b/src/v8/tools/gcov.sh
deleted file mode 100755
index d727704..0000000
--- a/src/v8/tools/gcov.sh
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2017 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Build and collect code coverage data, cummulatively, on specified architectures.
-
-BUILD_TYPE=${BUILD_TYPE:-Release}
-
-declare -A modes=( [Release]=release [Debug]=debug )
-declare -A pairs=( [arm]=ia32 [arm64]=x64 [ia32]=ia32 [x64]=x64 )
-
-if [ -z ${modes[$BUILD_TYPE]} ]
-then
-    echo "BUILD_TYPE must be {<unspecified>|Release|Debug}"
-    echo "Release is default"
-    exit
-fi
-
-mode=${modes[$BUILD_TYPE]}
-
-echo "Using build:" $BUILD_TYPE
-v8_root=$(readlink -f $(dirname $BASH_SOURCE)/../)
-work_dir=$v8_root/cov
-build_dir=$work_dir/$BUILD_TYPE
-
-if [ -z $@ ]
-then
-    echo "Pass at least one target architecture"
-    echo "Supported architectures: x64 ia32 arm arm64"
-    echo ""
-    echo "Example: ./tools/gcov.sh x64 arm"
-    echo ""
-    echo "Optionally, set BUILD_TYPE env variable to"
-    echo "either Debug or Release, to use the corresponding build."
-    echo "By default, BUILD_TYPE is Release."
-    echo ""
-    echo "Example: BUILD_TYPE=Debug ./tools/gcov.sh x64 arm"
-    echo ""
-    exit
-fi
-
-lcov --directory=$build_dir --zerocounters
-
-# Mapping v8 build terminology to gnu compiler terminology:
-#   target_arch is the host, and
-#   v8_target_arch is the target
-
-for v8_target_arch in "$@"
-do
-    target_arch=${pairs[$v8_target_arch]}
-    if [ -z $target_arch ]
-    then
-        echo "Skipping unknown architecture: " $v8_target_arch
-    else
-        echo "Building" $v8_target_arch
-        GYP_DEFINES="component=static_library use_goma=1 target_arch=$target_arch v8_target_arch=$v8_target_arch coverage=1 clang=0" python $v8_root/gypfiles/gyp_v8.py -G output_dir=$work_dir
-        ninja -C $build_dir -j2000
-        $v8_root/tools/run-tests.py --gcov-coverage --arch=$v8_target_arch --mode=$mode --shell-dir=$build_dir --variants=exhaustive
-    fi
-done
-
-lcov --directory=$build_dir --capture --output-file $work_dir/app.info
-genhtml --output-directory $work_dir/html $work_dir/app.info
-echo "Done"
-echo "Output available at: " $work_dir/html/index.html
diff --git a/src/v8/tools/gyp_flag_compare.py b/src/v8/tools/gyp_flag_compare.py
deleted file mode 100755
index 86fa5c4..0000000
--- a/src/v8/tools/gyp_flag_compare.py
+++ /dev/null
@@ -1,280 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright 2016 the V8 project authors. All rights reserved.
-# Copyright 2014 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.
-
-"""Given the output of -t commands from a ninja build for a gyp and GN generated
-build, report on differences between the command lines."""
-
-
-import os
-import shlex
-import subprocess
-import sys
-
-
-# Must be in v8/.
-BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
-os.chdir(BASE_DIR)
-
-
-g_total_differences = 0
-
-
-def FindAndRemoveArgWithValue(command_line, argname):
-  """Given a command line as a list, remove and return the value of an option
-  that takes a value as a separate entry.
-
-  Modifies |command_line| in place.
-  """
-  if argname not in command_line:
-    return ''
-  location = command_line.index(argname)
-  value = command_line[location + 1]
-  command_line[location:location + 2] = []
-  return value
-
-
-def MergeSpacedArgs(command_line, argname):
-  """Combine all arguments |argname| with their values, separated by a space."""
-  i = 0
-  result = []
-  while i < len(command_line):
-    arg = command_line[i]
-    if arg == argname:
-      result.append(arg + ' ' + command_line[i + 1])
-      i += 1
-    else:
-      result.append(arg)
-    i += 1
-  return result
-
-
-def NormalizeSymbolArguments(command_line):
-  """Normalize -g arguments.
-
-  If there's no -g args, it's equivalent to -g0. -g2 is equivalent to -g.
-  Modifies |command_line| in place.
-  """
-  # Strip -g0 if there's no symbols.
-  have_some_symbols = False
-  for x in command_line:
-    if x.startswith('-g') and x != '-g0':
-      have_some_symbols = True
-  if not have_some_symbols and '-g0' in command_line:
-    command_line.remove('-g0')
-
-  # Rename -g2 to -g.
-  if '-g2' in command_line:
-    command_line[command_line.index('-g2')] = '-g'
-
-
-def GetFlags(lines, build_dir):
-  """Turn a list of command lines into a semi-structured dict."""
-  is_win = sys.platform == 'win32'
-  flags_by_output = {}
-  for line in lines:
-    command_line = shlex.split(line.strip(), posix=not is_win)[1:]
-
-    output_name = FindAndRemoveArgWithValue(command_line, '-o')
-    dep_name = FindAndRemoveArgWithValue(command_line, '-MF')
-
-    NormalizeSymbolArguments(command_line)
-
-    command_line = MergeSpacedArgs(command_line, '-Xclang')
-
-    cc_file = [x for x in command_line if x.endswith('.cc') or
-                                          x.endswith('.c') or
-                                          x.endswith('.cpp')]
-    if len(cc_file) != 1:
-      print 'Skipping %s' % command_line
-      continue
-    assert len(cc_file) == 1
-
-    if is_win:
-      rsp_file = [x for x in command_line if x.endswith('.rsp')]
-      assert len(rsp_file) <= 1
-      if rsp_file:
-        rsp_file = os.path.join(build_dir, rsp_file[0][1:])
-        with open(rsp_file, "r") as open_rsp_file:
-          command_line = shlex.split(open_rsp_file, posix=False)
-
-    defines = [x for x in command_line if x.startswith('-D')]
-    include_dirs = [x for x in command_line if x.startswith('-I')]
-    dash_f = [x for x in command_line if x.startswith('-f')]
-    warnings = \
-        [x for x in command_line if x.startswith('/wd' if is_win else '-W')]
-    others = [x for x in command_line if x not in defines and \
-                                         x not in include_dirs and \
-                                         x not in dash_f and \
-                                         x not in warnings and \
-                                         x not in cc_file]
-
-    for index, value in enumerate(include_dirs):
-      if value == '-Igen':
-        continue
-      path = value[2:]
-      if not os.path.isabs(path):
-        path = os.path.join(build_dir, path)
-      include_dirs[index] = '-I' + os.path.normpath(path)
-
-    # GYP supports paths above the source root like <(DEPTH)/../foo while such
-    # paths are unsupported by gn. But gn allows to use system-absolute paths
-    # instead (paths that start with single '/'). Normalize all paths.
-    cc_file = [os.path.normpath(os.path.join(build_dir, cc_file[0]))]
-
-    # Filter for libFindBadConstructs.so having a relative path in one and
-    # absolute path in the other.
-    others_filtered = []
-    for x in others:
-      if x.startswith('-Xclang ') and x.endswith('libFindBadConstructs.so'):
-        others_filtered.append(
-            '-Xclang ' +
-            os.path.join(os.getcwd(),
-                         os.path.normpath(
-                             os.path.join('out/gn_flags', x.split(' ', 1)[1]))))
-      elif x.startswith('-B'):
-        others_filtered.append(
-            '-B' +
-            os.path.join(os.getcwd(),
-                         os.path.normpath(os.path.join('out/gn_flags', x[2:]))))
-      else:
-        others_filtered.append(x)
-    others = others_filtered
-
-    flags_by_output[cc_file[0]] = {
-      'output': output_name,
-      'depname': dep_name,
-      'defines': sorted(defines),
-      'include_dirs': sorted(include_dirs),  # TODO(scottmg): This is wrong.
-      'dash_f': sorted(dash_f),
-      'warnings': sorted(warnings),
-      'other': sorted(others),
-    }
-  return flags_by_output
-
-
-def CompareLists(gyp, gn, name, dont_care_gyp=None, dont_care_gn=None):
-  """Return a report of any differences between gyp and gn lists, ignoring
-  anything in |dont_care_{gyp|gn}| respectively."""
-  global g_total_differences
-  if not dont_care_gyp:
-    dont_care_gyp = []
-  if not dont_care_gn:
-    dont_care_gn = []
-  output = ''
-  if gyp[name] != gn[name]:
-    gyp_set = set(gyp[name])
-    gn_set = set(gn[name])
-    missing_in_gyp = gyp_set - gn_set
-    missing_in_gn = gn_set - gyp_set
-    missing_in_gyp -= set(dont_care_gyp)
-    missing_in_gn -= set(dont_care_gn)
-    if missing_in_gyp or missing_in_gn:
-      output += '  %s differ:\n' % name
-    if missing_in_gyp:
-      output += '    In gyp, but not in GN:\n      %s' % '\n      '.join(
-          sorted(missing_in_gyp)) + '\n'
-      g_total_differences += len(missing_in_gyp)
-    if missing_in_gn:
-      output += '    In GN, but not in gyp:\n      %s' % '\n      '.join(
-          sorted(missing_in_gn)) + '\n\n'
-      g_total_differences += len(missing_in_gn)
-  return output
-
-
-def Run(command_line):
-  """Run |command_line| as a subprocess and return stdout. Raises on error."""
-  try:
-    return subprocess.check_output(command_line, shell=True)
-  except subprocess.CalledProcessError as e:
-    # Rescue the output we got until the exception happened.
-    print '#### Stdout: ####################################################'
-    print e.output
-    print '#################################################################'
-    raise
-
-
-def main():
-  if len(sys.argv) < 4:
-    print ('usage: %s gn_outdir gyp_outdir gn_target '
-           '[gyp_target1, gyp_target2, ...]' % __file__)
-    return 1
-
-  if len(sys.argv) == 4:
-    sys.argv.append(sys.argv[3])
-  gn_out_dir = sys.argv[1]
-  print >> sys.stderr, 'Expecting gn outdir in %s...' % gn_out_dir
-  gn = Run('ninja -C %s -t commands %s' % (gn_out_dir, sys.argv[3]))
-  if sys.platform == 'win32':
-    # On Windows flags are stored in .rsp files which are created during build.
-    print >> sys.stderr, 'Building in %s...' % gn_out_dir
-    Run('ninja -C %s -d keeprsp %s' % (gn_out_dir, sys.argv[3]))
-
-  gyp_out_dir = sys.argv[2]
-  print >> sys.stderr, 'Expecting gyp outdir in %s...' % gyp_out_dir
-  gyp = Run('ninja -C %s -t commands %s' % (gyp_out_dir, " ".join(sys.argv[4:])))
-  if sys.platform == 'win32':
-    # On Windows flags are stored in .rsp files which are created during build.
-    print >> sys.stderr, 'Building in %s...' % gyp_out_dir
-    Run('ninja -C %s -d keeprsp %s' % (gyp_out_dir, " ".join(sys.argv[4:])))
-
-  all_gyp_flags = GetFlags(gyp.splitlines(),
-                           os.path.join(os.getcwd(), gyp_out_dir))
-  all_gn_flags = GetFlags(gn.splitlines(),
-                          os.path.join(os.getcwd(), gn_out_dir))
-  gyp_files = set(all_gyp_flags.keys())
-  gn_files = set(all_gn_flags.keys())
-  different_source_list = gyp_files != gn_files
-  if different_source_list:
-    print 'Different set of sources files:'
-    print '  In gyp, not in GN:\n    %s' % '\n    '.join(
-        sorted(gyp_files - gn_files))
-    print '  In GN, not in gyp:\n    %s' % '\n    '.join(
-        sorted(gn_files - gyp_files))
-    print '\nNote that flags will only be compared for files in both sets.\n'
-  file_list = gyp_files & gn_files
-  files_with_given_differences = {}
-  for filename in sorted(file_list):
-    gyp_flags = all_gyp_flags[filename]
-    gn_flags = all_gn_flags[filename]
-    differences = CompareLists(gyp_flags, gn_flags, 'dash_f')
-    differences += CompareLists(gyp_flags, gn_flags, 'defines')
-    differences += CompareLists(gyp_flags, gn_flags, 'include_dirs',
-                                ['-I%s' % os.path.dirname(BASE_DIR)])
-    differences += CompareLists(gyp_flags, gn_flags, 'warnings',
-        # More conservative warnings in GN we consider to be OK.
-        dont_care_gyp=[
-          '/wd4091',  # 'keyword' : ignored on left of 'type' when no variable
-                      # is declared.
-          '/wd4456',  # Declaration hides previous local declaration.
-          '/wd4457',  # Declaration hides function parameter.
-          '/wd4458',  # Declaration hides class member.
-          '/wd4459',  # Declaration hides global declaration.
-          '/wd4702',  # Unreachable code.
-          '/wd4800',  # Forcing value to bool 'true' or 'false'.
-          '/wd4838',  # Conversion from 'type' to 'type' requires a narrowing
-                      # conversion.
-        ] if sys.platform == 'win32' else None,
-        dont_care_gn=[
-          '-Wendif-labels',
-          '-Wextra',
-          '-Wsign-compare',
-        ] if not sys.platform == 'win32' else None)
-    differences += CompareLists(gyp_flags, gn_flags, 'other')
-    if differences:
-      files_with_given_differences.setdefault(differences, []).append(filename)
-
-  for diff, files in files_with_given_differences.iteritems():
-    print '\n'.join(sorted(files))
-    print diff
-
-  print 'Total differences:', g_total_differences
-  # TODO(scottmg): Return failure on difference once we're closer to identical.
-  return 0
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/src/v8/tools/isolate_driver.py b/src/v8/tools/isolate_driver.py
deleted file mode 100644
index a6bcfbf..0000000
--- a/src/v8/tools/isolate_driver.py
+++ /dev/null
@@ -1,340 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Copyright 2014 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.
-
-"""Adaptor script called through build/isolate.gypi.
-
-Creates a wrapping .isolate which 'includes' the original one, that can be
-consumed by tools/swarming_client/isolate.py. Path variables are determined
-based on the current working directory. The relative_cwd in the .isolated file
-is determined based on the .isolate file that declare the 'command' variable to
-be used so the wrapping .isolate doesn't affect this value.
-
-This script loads build.ninja and processes it to determine all the executables
-referenced by the isolated target. It adds them in the wrapping .isolate file.
-
-WARNING: The target to use for build.ninja analysis is the base name of the
-.isolate file plus '_run'. For example, 'foo_test.isolate' would have the target
-'foo_test_run' analysed.
-"""
-
-import errno
-import glob
-import json
-import logging
-import os
-import posixpath
-import StringIO
-import subprocess
-import sys
-import time
-
-TOOLS_DIR = os.path.dirname(os.path.abspath(__file__))
-SWARMING_CLIENT_DIR = os.path.join(TOOLS_DIR, 'swarming_client')
-SRC_DIR = os.path.dirname(TOOLS_DIR)
-
-sys.path.insert(0, SWARMING_CLIENT_DIR)
-
-import isolate_format
-
-
-def load_ninja_recursively(build_dir, ninja_path, build_steps):
-  """Crudely extracts all the subninja and build referenced in ninja_path.
-
-  In particular, it ignores rule and variable declarations. The goal is to be
-  performant (well, as much as python can be performant) which is currently in
-  the <200ms range for a complete chromium tree. As such the code is laid out
-  for performance instead of readability.
-  """
-  logging.debug('Loading %s', ninja_path)
-  try:
-    with open(os.path.join(build_dir, ninja_path), 'rb') as f:
-      line = None
-      merge_line = ''
-      subninja = []
-      for line in f:
-        line = line.rstrip()
-        if not line:
-          continue
-
-        if line[-1] == '$':
-          # The next line needs to be merged in.
-          merge_line += line[:-1]
-          continue
-
-        if merge_line:
-          line = merge_line + line
-          merge_line = ''
-
-        statement = line[:line.find(' ')]
-        if statement == 'build':
-          # Save the dependency list as a raw string. Only the lines needed will
-          # be processed with raw_build_to_deps(). This saves a good 70ms of
-          # processing time.
-          build_target, dependencies = line[6:].split(': ', 1)
-          # Interestingly, trying to be smart and only saving the build steps
-          # with the intended extensions ('', '.stamp', '.so') slows down
-          # parsing even if 90% of the build rules can be skipped.
-          # On Windows, a single step may generate two target, so split items
-          # accordingly. It has only been seen for .exe/.exe.pdb combos.
-          for i in build_target.strip().split():
-            build_steps[i] = dependencies
-        elif statement == 'subninja':
-          subninja.append(line[9:])
-  except IOError:
-    print >> sys.stderr, 'Failed to open %s' % ninja_path
-    raise
-
-  total = 1
-  for rel_path in subninja:
-    try:
-      # Load each of the files referenced.
-      # TODO(maruel): Skip the files known to not be needed. It saves an aweful
-      # lot of processing time.
-      total += load_ninja_recursively(build_dir, rel_path, build_steps)
-    except IOError:
-      print >> sys.stderr, '... as referenced by %s' % ninja_path
-      raise
-  return total
-
-
-def load_ninja(build_dir):
-  """Loads the tree of .ninja files in build_dir."""
-  build_steps = {}
-  total = load_ninja_recursively(build_dir, 'build.ninja', build_steps)
-  logging.info('Loaded %d ninja files, %d build steps', total, len(build_steps))
-  return build_steps
-
-
-def using_blacklist(item):
-  """Returns True if an item should be analyzed.
-
-  Ignores many rules that are assumed to not depend on a dynamic library. If
-  the assumption doesn't hold true anymore for a file format, remove it from
-  this list. This is simply an optimization.
-  """
-  # *.json is ignored below, *.isolated.gen.json is an exception, it is produced
-  # by isolate_driver.py in 'test_isolation_mode==prepare'.
-  if item.endswith('.isolated.gen.json'):
-    return True
-  IGNORED = (
-    '.a', '.cc', '.css', '.dat', '.def', '.frag', '.h', '.html', '.isolate',
-    '.js', '.json', '.manifest', '.o', '.obj', '.pak', '.png', '.pdb', '.py',
-    '.strings', '.test', '.txt', '.vert',
-  )
-  # ninja files use native path format.
-  ext = os.path.splitext(item)[1]
-  if ext in IGNORED:
-    return False
-  # Special case Windows, keep .dll.lib but discard .lib.
-  if item.endswith('.dll.lib'):
-    return True
-  if ext == '.lib':
-    return False
-  return item not in ('', '|', '||')
-
-
-def raw_build_to_deps(item):
-  """Converts a raw ninja build statement into the list of interesting
-  dependencies.
-  """
-  # TODO(maruel): Use a whitelist instead? .stamp, .so.TOC, .dylib.TOC,
-  # .dll.lib, .exe and empty.
-  # The first item is the build rule, e.g. 'link', 'cxx', 'phony', etc.
-  return filter(using_blacklist, item.split(' ')[1:])
-
-
-def collect_deps(target, build_steps, dependencies_added, rules_seen):
-  """Recursively adds all the interesting dependencies for |target|
-  into |dependencies_added|.
-  """
-  if rules_seen is None:
-    rules_seen = set()
-  if target in rules_seen:
-    # TODO(maruel): Figure out how it happens.
-    logging.warning('Circular dependency for %s!', target)
-    return
-  rules_seen.add(target)
-  try:
-    dependencies = raw_build_to_deps(build_steps[target])
-  except KeyError:
-    logging.info('Failed to find a build step to generate: %s', target)
-    return
-  logging.debug('collect_deps(%s) -> %s', target, dependencies)
-  for dependency in dependencies:
-    dependencies_added.add(dependency)
-    collect_deps(dependency, build_steps, dependencies_added, rules_seen)
-
-
-def post_process_deps(build_dir, dependencies):
-  """Processes the dependency list with OS specific rules."""
-  def filter_item(i):
-    if i.endswith('.so.TOC'):
-      # Remove only the suffix .TOC, not the .so!
-      return i[:-4]
-    if i.endswith('.dylib.TOC'):
-      # Remove only the suffix .TOC, not the .dylib!
-      return i[:-4]
-    if i.endswith('.dll.lib'):
-      # Remove only the suffix .lib, not the .dll!
-      return i[:-4]
-    return i
-
-  def is_exe(i):
-    # This script is only for adding new binaries that are created as part of
-    # the component build.
-    ext = os.path.splitext(i)[1]
-    # On POSIX, executables have no extension.
-    if ext not in ('', '.dll', '.dylib', '.exe', '.nexe', '.so'):
-      return False
-    if os.path.isabs(i):
-      # In some rare case, there's dependency set explicitly on files outside
-      # the checkout.
-      return False
-
-    # Check for execute access and strip directories. This gets rid of all the
-    # phony rules.
-    p = os.path.join(build_dir, i)
-    return os.access(p, os.X_OK) and not os.path.isdir(p)
-
-  return filter(is_exe, map(filter_item, dependencies))
-
-
-def create_wrapper(args, isolate_index, isolated_index):
-  """Creates a wrapper .isolate that add dynamic libs.
-
-  The original .isolate is not modified.
-  """
-  cwd = os.getcwd()
-  isolate = args[isolate_index]
-  # The code assumes the .isolate file is always specified path-less in cwd. Fix
-  # if this assumption doesn't hold true.
-  assert os.path.basename(isolate) == isolate, isolate
-
-  # This will look like ../out/Debug. This is based against cwd. Note that this
-  # must equal the value provided as PRODUCT_DIR.
-  build_dir = os.path.dirname(args[isolated_index])
-
-  # This will look like chrome/unit_tests.isolate. It is based against SRC_DIR.
-  # It's used to calculate temp_isolate.
-  src_isolate = os.path.relpath(os.path.join(cwd, isolate), SRC_DIR)
-
-  # The wrapping .isolate. This will look like
-  # ../out/Debug/gen/chrome/unit_tests.isolate.
-  temp_isolate = os.path.join(build_dir, 'gen', src_isolate)
-  temp_isolate_dir = os.path.dirname(temp_isolate)
-
-  # Relative path between the new and old .isolate file.
-  isolate_relpath = os.path.relpath(
-      '.', temp_isolate_dir).replace(os.path.sep, '/')
-
-  # It's a big assumption here that the name of the isolate file matches the
-  # primary target '_run'. Fix accordingly if this doesn't hold true, e.g.
-  # complain to maruel@.
-  target = isolate[:-len('.isolate')] + '_run'
-  build_steps = load_ninja(build_dir)
-  binary_deps = set()
-  collect_deps(target, build_steps, binary_deps, None)
-  binary_deps = post_process_deps(build_dir, binary_deps)
-  logging.debug(
-      'Binary dependencies:%s', ''.join('\n  ' + i for i in binary_deps))
-
-  # Now do actual wrapping .isolate.
-  isolate_dict = {
-    'includes': [
-      posixpath.join(isolate_relpath, isolate),
-    ],
-    'variables': {
-      # Will look like ['<(PRODUCT_DIR)/lib/flibuser_prefs.so'].
-      'files': sorted(
-          '<(PRODUCT_DIR)/%s' % i.replace(os.path.sep, '/')
-          for i in binary_deps),
-    },
-  }
-  # Some .isolate files have the same temp directory and the build system may
-  # run this script in parallel so make directories safely here.
-  try:
-    os.makedirs(temp_isolate_dir)
-  except OSError as e:
-    if e.errno != errno.EEXIST:
-      raise
-  comment = (
-      '# Warning: this file was AUTOGENERATED.\n'
-      '# DO NO EDIT.\n')
-  out = StringIO.StringIO()
-  isolate_format.print_all(comment, isolate_dict, out)
-  isolate_content = out.getvalue()
-  with open(temp_isolate, 'wb') as f:
-    f.write(isolate_content)
-  logging.info('Added %d dynamic libs', len(binary_deps))
-  logging.debug('%s', isolate_content)
-  args[isolate_index] = temp_isolate
-
-
-def prepare_isolate_call(args, output):
-  """Gathers all information required to run isolate.py later.
-
-  Dumps it as JSON to |output| file.
-  """
-  with open(output, 'wb') as f:
-    json.dump({
-      'args': args,
-      'dir': os.getcwd(),
-      'version': 1,
-    }, f, indent=2, sort_keys=True)
-
-
-def rebase_directories(args, abs_base):
-  """Rebases all paths to be relative to abs_base."""
-  def replace(index):
-    args[index] = os.path.relpath(os.path.abspath(args[index]), abs_base)
-  for i, arg in enumerate(args):
-    if arg in ['--isolate', '--isolated']:
-      replace(i + 1)
-    if arg == '--path-variable':
-      # Path variables have a triple form: --path-variable NAME <path>.
-      replace(i + 2)
-
-
-def main():
-  logging.basicConfig(level=logging.ERROR, format='%(levelname)7s %(message)s')
-  args = sys.argv[1:]
-  mode = args[0] if args else None
-  isolate = None
-  isolated = None
-  for i, arg in enumerate(args):
-    if arg == '--isolate':
-      isolate = i + 1
-    if arg == '--isolated':
-      isolated = i + 1
-  if isolate is None or isolated is None or not mode:
-    print >> sys.stderr, 'Internal failure'
-    return 1
-
-  # Make sure all paths are relative to the isolate file. This is an
-  # expectation of the go binaries. In gn, this script is not called
-  # relative to the isolate file, but relative to the product dir.
-  new_base = os.path.abspath(os.path.dirname(args[isolate]))
-  rebase_directories(args, new_base)
-  assert args[isolate] == os.path.basename(args[isolate])
-  os.chdir(new_base)
-
-  create_wrapper(args, isolate, isolated)
-
-  # In 'prepare' mode just collect all required information for postponed
-  # isolated.py invocation later, store it in *.isolated.gen.json file.
-  if mode == 'prepare':
-    prepare_isolate_call(args[1:], args[isolated] + '.gen.json')
-    return 0
-
-  swarming_client = os.path.join(SRC_DIR, 'tools', 'swarming_client')
-  sys.stdout.flush()
-  result = subprocess.call(
-      [sys.executable, os.path.join(swarming_client, 'isolate.py')] + args)
-  return result
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/src/v8/tools/jsfunfuzz/download_jsfunfuzz.py b/src/v8/tools/jsfunfuzz/download_jsfunfuzz.py
deleted file mode 100644
index 2925213..0000000
--- a/src/v8/tools/jsfunfuzz/download_jsfunfuzz.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2016 the V8 project 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 os
-import re
-import subprocess
-
-FUZZ_PATH = os.path.dirname(os.path.abspath(__file__))
-SHA1_PATH = os.path.join(FUZZ_PATH, 'jsfunfuzz.tar.gz.sha1')
-
-if re.search(r'\bjsfunfuzz=1', os.environ.get('GYP_DEFINES', '')):
-  subprocess.check_call([
-    'download_from_google_storage',
-    '-b', 'chrome-v8-jsfunfuzz',
-    '-u', '--no_resume',
-    '-s', SHA1_PATH,
-    '--platform=linux*'
-  ])
diff --git a/src/v8/tools/jsfunfuzz/jsfunfuzz.gyp b/src/v8/tools/jsfunfuzz/jsfunfuzz.gyp
deleted file mode 100644
index 8938e44..0000000
--- a/src/v8/tools/jsfunfuzz/jsfunfuzz.gyp
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2016 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'conditions': [
-    ['test_isolation_mode != "noop"', {
-      'targets': [
-        {
-          'target_name': 'jsfunfuzz_run',
-          'type': 'none',
-          'dependencies': [
-            '../../src/d8.gyp:d8_run',
-          ],
-          'includes': [
-            '../../gypfiles/features.gypi',
-            '../../gypfiles/isolate.gypi',
-          ],
-          'sources': [
-            'jsfunfuzz.isolate',
-          ],
-        },
-      ],
-    }],
-  ],
-}
diff --git a/src/v8/tools/jsfunfuzz/jsfunfuzz.isolate b/src/v8/tools/jsfunfuzz/jsfunfuzz.isolate
deleted file mode 100644
index 56cb4a7..0000000
--- a/src/v8/tools/jsfunfuzz/jsfunfuzz.isolate
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright 2016 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'variables': {
-    'command': [
-      'fuzz-harness.sh',
-    ],
-    'files': [
-      # Grab current directory. This avoids adding logic for checking the
-      # existence of the jsfunfuzz subdirectory.
-      './',
-    ],
-  },
-  'includes': [
-    '../../src/d8.isolate',
-  ],
-}
diff --git a/src/v8/tools/jsmin.py b/src/v8/tools/jsmin.py
deleted file mode 100644
index 236f511..0000000
--- a/src/v8/tools/jsmin.py
+++ /dev/null
@@ -1,298 +0,0 @@
-#!/usr/bin/python2.4
-
-# 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.
-
-"""A JavaScript minifier.
-
-It is far from being a complete JS parser, so there are many valid
-JavaScript programs that will be ruined by it.  Another strangeness is that
-it accepts $ and % as parts of identifiers.  It doesn't merge lines or strip
-out blank lines in order to ease debugging.  Variables at the top scope are
-properties of the global object so we can't rename them.  It is assumed that
-you introduce variables with var as if JavaScript followed C++ scope rules
-around curly braces, so the declaration must be above the first use.
-
-Use as:
-import jsmin
-minifier = JavaScriptMinifier()
-program1 = minifier.JSMinify(program1)
-program2 = minifier.JSMinify(program2)
-"""
-
-import re
-
-
-class JavaScriptMinifier(object):
-  """An object that you can feed code snippets to to get them minified."""
-
-  def __init__(self):
-    # We prepopulate the list of identifiers that shouldn't be used.  These
-    # short language keywords could otherwise be used by the script as variable
-    # names.
-    self.seen_identifiers = {"do": True, "in": True}
-    self.identifier_counter = 0
-    self.in_comment = False
-    self.map = {}
-    self.nesting = 0
-
-  def LookAtIdentifier(self, m):
-    """Records identifiers or keywords that we see in use.
-
-    (So we can avoid renaming variables to these strings.)
-    Args:
-      m: The match object returned by re.search.
-
-    Returns:
-      Nothing.
-    """
-    identifier = m.group(1)
-    self.seen_identifiers[identifier] = True
-
-  def Push(self):
-    """Called when we encounter a '{'."""
-    self.nesting += 1
-
-  def Pop(self):
-    """Called when we encounter a '}'."""
-    self.nesting -= 1
-    # We treat each top-level opening brace as a single scope that can span
-    # several sets of nested braces.
-    if self.nesting == 0:
-      self.map = {}
-      self.identifier_counter = 0
-
-  def Declaration(self, m):
-    """Rewrites bits of the program selected by a regexp.
-
-    These can be curly braces, literal strings, function declarations and var
-    declarations.  (These last two must be on one line including the opening
-    curly brace of the function for their variables to be renamed).
-
-    Args:
-      m: The match object returned by re.search.
-
-    Returns:
-      The string that should replace the match in the rewritten program.
-    """
-    matched_text = m.group(0)
-
-    if matched_text.startswith("`") and matched_text.endswith("`"):
-      return re.sub(r"\$\{([\w$%]+)\}",
-                    lambda m: '${' + self.FindNewName(m.group(1)) + '}',
-                    matched_text)
-
-    if matched_text == "{":
-      self.Push()
-      return matched_text
-    if matched_text == "}":
-      self.Pop()
-      return matched_text
-    if re.match("[\"'/]", matched_text):
-      return matched_text
-    m = re.match(r"var ", matched_text)
-    if m:
-      var_names = matched_text[m.end():]
-      var_names = re.split(r",", var_names)
-      return "var " + ",".join(map(self.FindNewName, var_names))
-    m = re.match(r"(function\b[^(]*)\((.*)\)\{$", matched_text)
-    if m:
-      up_to_args = m.group(1)
-      args = m.group(2)
-      args = re.split(r",", args)
-      self.Push()
-      return up_to_args + "(" + ",".join(map(self.FindNewName, args)) + "){"
-
-    if matched_text in self.map:
-      return self.map[matched_text]
-
-    return matched_text
-
-  def CharFromNumber(self, number):
-    """A single-digit base-52 encoding using a-zA-Z."""
-    if number < 26:
-      return chr(number + 97)
-    number -= 26
-    return chr(number + 65)
-
-  def FindNewName(self, var_name):
-    """Finds a new 1-character or 2-character name for a variable.
-
-    Enters it into the mapping table for this scope.
-
-    Args:
-      var_name: The name of the variable before renaming.
-
-    Returns:
-      The new name of the variable.
-    """
-    new_identifier = ""
-    # Variable names that end in _ are member variables of the global object,
-    # so they can be visible from code in a different scope.  We leave them
-    # alone.
-    if var_name in self.map:
-      return self.map[var_name]
-    if self.nesting == 0:
-      return var_name
-    # Do not rename arguments object.
-    if var_name == 'arguments':
-      return 'arguments'
-    while True:
-      identifier_first_char = self.identifier_counter % 52
-      identifier_second_char = self.identifier_counter // 52
-      new_identifier = self.CharFromNumber(identifier_first_char)
-      if identifier_second_char != 0:
-        new_identifier = (
-            self.CharFromNumber(identifier_second_char - 1) + new_identifier)
-      self.identifier_counter += 1
-      if not new_identifier in self.seen_identifiers:
-        break
-
-    self.map[var_name] = new_identifier
-    return new_identifier
-
-  def RemoveSpaces(self, m):
-    """Returns literal strings unchanged, replaces other inputs with group 2.
-
-    Other inputs are replaced with the contents of capture 1.  This is either
-    a single space or an empty string.
-
-    Args:
-      m: The match object returned by re.search.
-
-    Returns:
-      The string that should be inserted instead of the matched text.
-    """
-    entire_match = m.group(0)
-    replacement = m.group(1)
-    if re.match(r"'.*'$", entire_match):
-      return entire_match
-    if re.match(r'".*"$', entire_match):
-      return entire_match
-    if re.match(r"`.*`$", entire_match):
-      return entire_match
-    if re.match(r"/.+/$", entire_match):
-      return entire_match
-    return replacement
-
-  def JSMinify(self, text):
-    """The main entry point.  Takes a text and returns a compressed version.
-
-    The compressed version hopefully does the same thing.  Line breaks are
-    preserved.
-
-    Args:
-      text: The text of the code snippet as a multiline string.
-
-    Returns:
-      The compressed text of the code snippet as a multiline string.
-    """
-    new_lines = []
-    for line in re.split(r"\n", text):
-      line = line.replace("\t", " ")
-      if self.in_comment:
-        m = re.search(r"\*/", line)
-        if m:
-          line = line[m.end():]
-          self.in_comment = False
-        else:
-          new_lines.append("")
-          continue
-
-      if not self.in_comment:
-        line = re.sub(r"/\*.*?\*/", " ", line)
-        line = re.sub(r"//.*", "", line)
-        m = re.search(r"/\*", line)
-        if m:
-          line = line[:m.start()]
-          self.in_comment = True
-
-      # Strip leading and trailing spaces.
-      line = re.sub(r"^ +", "", line)
-      line = re.sub(r" +$", "", line)
-      # A regexp that matches a literal string surrounded by "double quotes".
-      # This regexp can handle embedded backslash-escaped characters including
-      # embedded backslash-escaped double quotes.
-      double_quoted_string = r'"(?:[^"\\]|\\.)*"'
-      # A regexp that matches a literal string surrounded by 'single quotes'.
-      single_quoted_string = r"'(?:[^'\\]|\\.)*'"
-      # A regexp that matches a template string
-      template_string = r"`(?:[^`\\]|\\.)*`"
-      # A regexp that matches a regexp literal surrounded by /slashes/.
-      # Don't allow a regexp to have a ) before the first ( since that's a
-      # syntax error and it's probably just two unrelated slashes.
-      # Also don't allow it to come after anything that can only be the
-      # end of a primary expression.
-      slash_quoted_regexp = r"(?<![\w$'\")\]])/(?:(?=\()|(?:[^()/\\]|\\.)+)(?:\([^/\\]|\\.)*/"
-      # Replace multiple spaces with a single space.
-      line = re.sub("|".join([double_quoted_string,
-                              single_quoted_string,
-                              template_string,
-                              slash_quoted_regexp,
-                              "( )+"]),
-                    self.RemoveSpaces,
-                    line)
-      # Strip single spaces unless they have an identifier character both before
-      # and after the space.  % and $ are counted as identifier characters.
-      line = re.sub("|".join([double_quoted_string,
-                              single_quoted_string,
-                              template_string,
-                              slash_quoted_regexp,
-                              r"(?<![a-zA-Z_0-9$%]) | (?![a-zA-Z_0-9$%])()"]),
-                    self.RemoveSpaces,
-                    line)
-      # Collect keywords and identifiers that are already in use.
-      if self.nesting == 0:
-        re.sub(r"([a-zA-Z0-9_$%]+)", self.LookAtIdentifier, line)
-      function_declaration_regexp = (
-          r"\bfunction"              # Function definition keyword...
-          r"( [\w$%]+)?"             # ...optional function name...
-          r"\([\w$%,]+\)\{")         # ...argument declarations.
-      # Unfortunately the keyword-value syntax { key:value } makes the key look
-      # like a variable where in fact it is a literal string.  We use the
-      # presence or absence of a question mark to try to distinguish between
-      # this case and the ternary operator: "condition ? iftrue : iffalse".
-      if re.search(r"\?", line):
-        block_trailing_colon = r""
-      else:
-        block_trailing_colon = r"(?![:\w$%])"
-      # Variable use.  Cannot follow a period precede a colon.
-      variable_use_regexp = r"(?<![.\w$%])[\w$%]+" + block_trailing_colon
-      line = re.sub("|".join([double_quoted_string,
-                              single_quoted_string,
-                              template_string,
-                              slash_quoted_regexp,
-                              r"\{",                  # Curly braces.
-                              r"\}",
-                              r"\bvar [\w$%,]+",      # var declarations.
-                              function_declaration_regexp,
-                              variable_use_regexp]),
-                    self.Declaration,
-                    line)
-      new_lines.append(line)
-
-    return "\n".join(new_lines) + "\n"
diff --git a/src/v8/tools/lldbinit b/src/v8/tools/lldbinit
deleted file mode 100755
index be828dc..0000000
--- a/src/v8/tools/lldbinit
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright 2017 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Print HeapObjects.
-command regex -h 'Print a v8 JavaScript object' job 's/(.+)/expr -- '_v8_internal_Print_Object((void*)(%1))/'
-
-# Print v8::Local handle value.
-command regex -h 'Print content of a v8::Local handle' jlh 's/(.+)/expr -- '_v8_internal_Print_Object(*(v8::internal::Object**)(*%1))/'
-
-# Print Code objects containing given PC.
-command regex -h 'Print a v8 Code object from an internal code address' jco 's/(.+)/expr -- '_v8_internal_Print_Code((void*)(*%1))/'
-
-# Print FeedbackVector
-command regex -h 'Print a v8 FeedbackVector object' jfv 's/(.+)/expr -- '_v8_internal_Print_FeedbackVector((void*)(%1))/'
-
-# Print FeedbackMetadata
-command regex -h 'Print a v8 FeedbackMetadata object' jfm 's/(.+)/expr -- '_v8_internal_Print_FeedbackMetadata((void*)(%1))/'
-
-# Print DescriptorArray.
-command regex -h 'Print a v8 DescriptorArray object' jda 's/(.+)/expr -- '_v8_internal_Print_DescriptorArray((void*)(%1))/'
-
-# Print LayoutDescriptor.
-command regex -h 'Print a v8 LayoutDescriptor object' jld 's/(.+)/expr -- '_v8_internal_Print_LayoutDescriptor((void*)(%1))/'
-
-# Print TransitionArray.
-command regex -h 'Print a v8 TransitionArray object' jta 's/(.+)/expr -- '_v8_internal_Print_TransitionArray((void*)(%1))/'
-
-command regex -h 'Print the transition tree of a v8 Map' jtt 's/(.+)/expr -- '_v8_internal_Print_TransitionTree((void*)(%1))/'
-
-command script import ~/lldb_commands.py
diff --git a/src/v8/tools/mingw-generate-makefiles.sh b/src/v8/tools/mingw-generate-makefiles.sh
deleted file mode 100755
index 67715fc..0000000
--- a/src/v8/tools/mingw-generate-makefiles.sh
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/bin/sh
-# Copyright 2013 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.
-
-# Monkey-patch GYP.
-cat > tools/gyp/gyp.mingw << EOF
-#!/usr/bin/env python
-
-# Copyright (c) 2009 Google Inc. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import sys
-
-# TODO(mark): sys.path manipulation is some temporary testing stuff.
-try:
-  import gyp
-except ImportError, e:
-  import os.path
-  sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), 'pylib'))
-  import gyp
-  
-def MonkeyBuildFileTargets(target_list, build_file):
-  """From a target_list, returns the subset from the specified build_file.
-  """
-  build_file = build_file.replace('/', '\\\\')
-  return [p for p in target_list if gyp.common.BuildFile(p) == build_file]
-gyp.common.BuildFileTargets = MonkeyBuildFileTargets
-
-import gyp.generator.make
-import os
-def Monkey_ITIP(self):
-  """Returns the location of the final output for an installable target."""
-  sep = os.path.sep
-  # Xcode puts shared_library results into PRODUCT_DIR, and some gyp files
-  # rely on this. Emulate this behavior for mac.
-  if (self.type == 'shared_library' and
-      (self.flavor != 'mac' or self.toolset != 'target')):
-    # Install all shared libs into a common directory (per toolset) for
-    # convenient access with LD_LIBRARY_PATH.
-    return '\$(builddir)%slib.%s%s%s' % (sep, self.toolset, sep, self.alias)
-  return '\$(builddir)' + sep + self.alias
-gyp.generator.make.MakefileWriter._InstallableTargetInstallPath = Monkey_ITIP
-
-if __name__ == '__main__':
-  sys.exit(gyp.main(sys.argv[1:]))
-EOF
-
-# Delete old generated Makefiles.
-find out -name '*.mk' -or -name 'Makefile*' -exec rm {} \;
-
-# Generate fresh Makefiles.
-mv tools/gyp/gyp tools/gyp/gyp.original
-mv tools/gyp/gyp.mingw tools/gyp/gyp
-make out/Makefile.ia32
-mv tools/gyp/gyp tools/gyp/gyp.mingw
-mv tools/gyp/gyp.original tools/gyp/gyp
-
-# Patch generated Makefiles: replace most backslashes with forward slashes,
-# fix library names in linker flags.
-FILES=$(find out -name '*.mk' -or -name 'Makefile*')
-for F in $FILES ; do
-  echo "Patching $F..."
-  cp $F $F.orig
-  cat $F.orig \
-    | sed -e 's|\([)a-zA-Z0-9]\)\\\([a-zA-Z]\)|\1/\2|g' \
-          -e 's|\([)a-zA-Z0-9]\)\\\\\([a-zA-Z]\)|\1/\2|g' \
-          -e 's|'%s/n'|'%s\\\\n'|g' \
-          -e 's|-lwinmm\.lib|-lwinmm|g' \
-          -e 's|-lws2_32\.lib|-lws2_32|g' \
-    > $F
-  rm $F.orig
-done
diff --git a/src/v8/tools/node/backport_node.py b/src/v8/tools/node/backport_node.py
deleted file mode 100755
index 50b0b07..0000000
--- a/src/v8/tools/node/backport_node.py
+++ /dev/null
@@ -1,126 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2017 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-Use this script to cherry-pick a V8 commit to backport to a Node.js checkout.
-
-Requirements:
-  - Node.js checkout to backport to.
-  - V8 checkout that contains the commit to cherry-pick.
-
-Usage:
-  $ backport_node.py <path_to_v8> <path_to_node> <commit-hash>
-
-  This will apply the commit to <path_to_node>/deps/v8 and create a commit in
-  the Node.js checkout, increment patch level, and copy over the original
-  commit message.
-
-Optional flags:
-  --no-review  Run `gclient sync` on the V8 checkout before updating.
-"""
-
-import argparse
-import os
-import subprocess
-import re
-import sys
-
-TARGET_SUBDIR = os.path.join("deps", "v8")
-VERSION_FILE = os.path.join("include", "v8-version.h")
-VERSION_PATTERN = r'(?<=#define V8_PATCH_LEVEL )\d+'
-
-def FileToText(file_name):
-  with open(file_name) as f:
-    return f.read()
-
-def TextToFile(text, file_name):
-  with open(file_name, "w") as f:
-    f.write(text)
-
-
-def Clean(options):
-  print ">> Cleaning target directory."
-  subprocess.check_call(["git", "clean", "-fd"],
-                        cwd = os.path.join(options.node_path, TARGET_SUBDIR))
-
-def CherryPick(options):
-  print ">> Apply patch."
-  patch = subprocess.Popen(["git", "diff-tree", "-p", options.commit],
-                           stdout=subprocess.PIPE, cwd=options.v8_path)
-  patch.wait()
-  try:
-    subprocess.check_output(["git", "apply", "-3", "--directory=%s" % TARGET_SUBDIR],
-                            stdin=patch.stdout, cwd=options.node_path)
-  except:
-    print ">> In another shell, please resolve patch conflicts"
-    print ">> and `git add` affected files."
-    print ">> Finally continue by entering RESOLVED."
-    while raw_input("[RESOLVED]") != "RESOLVED":
-      print ">> You need to type RESOLVED"
-
-def UpdateVersion(options):
-  print ">> Increment patch level."
-  version_file = os.path.join(options.node_path, TARGET_SUBDIR, VERSION_FILE)
-  text = FileToText(version_file)
-  def increment(match):
-    patch = int(match.group(0))
-    return str(patch + 1)
-  text = re.sub(VERSION_PATTERN, increment, text, flags=re.MULTILINE)
-  TextToFile(text, version_file)
-
-def CreateCommit(options):
-  print ">> Creating commit."
-  # Find short hash from source.
-  shorthash = subprocess.check_output(
-      ["git", "rev-parse", "--short", options.commit],
-      cwd=options.v8_path).strip()
-
-  # Commit message
-  title = "deps: backport %s from upstream V8"  % shorthash
-  body = subprocess.check_output(
-      ["git", "log", options.commit, "-1", "--format=%B"],
-      cwd=options.v8_path).strip()
-  body = '\n'.join("  " + line for line in body.splitlines())
-
-  message = title + "\n\nOriginal commit message:\n\n" + body
-
-  # Create commit at target.
-  review_message = "--no-edit" if options.no_review else "--edit"
-  git_commands = [
-    ["git", "checkout", "-b", "backport_%s" % shorthash],  # new branch
-    ["git", "add", TARGET_SUBDIR],                         # add files
-    ["git", "commit", "-m", message, review_message]       # new commit
-  ]
-  for command in git_commands:
-    subprocess.check_call(command, cwd=options.node_path)
-
-def ParseOptions(args):
-  parser = argparse.ArgumentParser(description="Backport V8 commit to Node.js")
-  parser.add_argument("v8_path", help="Path to V8 checkout")
-  parser.add_argument("node_path", help="Path to Node.js checkout")
-  parser.add_argument("commit", help="Commit to backport")
-  parser.add_argument("--no-review", action="store_true",
-                      help="Skip editing commit message")
-  options = parser.parse_args(args)
-  options.v8_path = os.path.abspath(options.v8_path)
-  assert os.path.isdir(options.v8_path)
-  options.node_path = os.path.abspath(options.node_path)
-  assert os.path.isdir(options.node_path)
-  return options
-
-def Main(args):
-  options = ParseOptions(args)
-  Clean(options)
-  try:
-    CherryPick(options)
-    UpdateVersion(options)
-    CreateCommit(options)
-  except:
-    print ">> Failed. Resetting."
-    subprocess.check_output(["git", "reset", "--hard"], cwd=options.node_path)
-    raise
-
-if __name__ == "__main__":
-  Main(sys.argv[1:])
diff --git a/src/v8/tools/node/build_gn.py b/src/v8/tools/node/build_gn.py
deleted file mode 100755
index 8ab2a63..0000000
--- a/src/v8/tools/node/build_gn.py
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2017 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-Use this script to build libv8_monolith.a as dependency for Node.js
-Required dependencies can be fetched with fetch_deps.py.
-
-Usage: build_gn.py <Debug/Release> <v8-path> <build-path> [<build-flags>]...
-
-Build flags are passed either as "strings" or numeric value. True/false
-are represented as 1/0. E.g.
-
-  v8_promise_internal_field_count=2
-  target_cpu="x64"
-  v8_enable_disassembler=0
-"""
-
-import os
-import subprocess
-import sys
-
-import node_common
-
-GN_ARGS = [
-  "v8_monolithic = true",
-  "is_component_build = false",
-  "v8_use_external_startup_data = false",
-  "use_custom_libcxx = false",
-  "use_sysroot = false",
-]
-
-BUILD_SUBDIR = "gn"
-
-# TODO: make this cross-platform.
-GN_SUBDIR = ["buildtools", "linux64", "gn"]
-
-def Build(v8_path, build_path, depot_tools, is_debug, build_flags):
-  print "Setting GN args."
-  lines = []
-  lines.extend(GN_ARGS)
-  for flag in build_flags:
-    flag = flag.replace("=1", "=true")
-    flag = flag.replace("=0", "=false")
-    flag = flag.replace("target_cpu=ia32", "target_cpu=\"x86\"")
-    lines.append(flag)
-  lines.append("is_debug = %s" % ("true" if is_debug else "false"))
-  with open(os.path.join(build_path, "args.gn"), "w") as args_file:
-    args_file.write("\n".join(lines))
-  gn = os.path.join(v8_path, *GN_SUBDIR)
-  subprocess.check_call([gn, "gen", "-C", build_path], cwd=v8_path)
-  ninja = os.path.join(depot_tools, "ninja")
-  print "Building."
-  subprocess.check_call([ninja, "-v", "-C", build_path, "v8_monolith"],
-                        cwd=v8_path)
-
-def Main(v8_path, build_path, is_debug, build_flags):
-  # Verify paths.
-  v8_path = os.path.abspath(v8_path)
-  assert os.path.isdir(v8_path)
-  build_path = os.path.abspath(build_path)
-  build_path = os.path.join(build_path, BUILD_SUBDIR)
-  if not os.path.isdir(build_path):
-    os.makedirs(build_path)
-
-  # Check that we have depot tools.
-  depot_tools = node_common.EnsureDepotTools(v8_path, False)
-
-  # Build with GN.
-  Build(v8_path, build_path, depot_tools, is_debug, build_flags)
-
-if __name__ == "__main__":
-  # TODO: use argparse to parse arguments.
-  build_mode = sys.argv[1]
-  v8_path = sys.argv[2]
-  build_path = sys.argv[3]
-  assert build_mode == "Debug" or build_mode == "Release"
-  is_debug = build_mode == "Debug"
-  # TODO: introduce "--" flag for pass-through flags.
-  build_flags = sys.argv[4:]
-  Main(v8_path, build_path, is_debug, build_flags)
diff --git a/src/v8/tools/node/test_backport_node.py b/src/v8/tools/node/test_backport_node.py
deleted file mode 100755
index 3c61a40..0000000
--- a/src/v8/tools/node/test_backport_node.py
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2017 the V8 project 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 os
-import shutil
-import subprocess
-import sys
-import tempfile
-import unittest
-
-import backport_node
-
-# Base paths.
-BASE_DIR = os.path.dirname(os.path.abspath(__file__))
-TEST_DATA = os.path.join(BASE_DIR, 'testdata')
-
-def gitify(path):
-  files = os.listdir(path)
-  subprocess.check_call(['git', 'init'], cwd=path)
-  subprocess.check_call(['git', 'add'] + files, cwd=path)
-  subprocess.check_call(['git', 'commit', '-m', 'Initial'], cwd=path)
-
-class TestUpdateNode(unittest.TestCase):
-  def setUp(self):
-    self.workdir = tempfile.mkdtemp(prefix='tmp_test_node_')
-
-  def tearDown(self):
-    shutil.rmtree(self.workdir)
-
-  def testUpdate(self):
-    v8_cwd = os.path.join(self.workdir, 'v8')
-    node_cwd = os.path.join(self.workdir, 'node')
-
-    # Set up V8 test fixture.
-    shutil.copytree(src=os.path.join(TEST_DATA, 'v8'), dst=v8_cwd)
-    gitify(v8_cwd)
-
-    # Set up node test fixture.
-    shutil.copytree(src=os.path.join(TEST_DATA, 'node'), dst=node_cwd)
-    gitify(os.path.join(node_cwd))
-
-    # Add a patch.
-    with open(os.path.join(v8_cwd, 'v8_foo'), 'w') as f:
-      f.write('zonk')
-    subprocess.check_call(['git', 'add', 'v8_foo'], cwd=v8_cwd)
-    subprocess.check_call(['git', 'commit', '-m', "Title\n\nBody"], cwd=v8_cwd)
-    commit = subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=v8_cwd).strip()
-
-    # Run update script.
-    backport_node.Main([v8_cwd, node_cwd, commit, "--no-review"])
-
-    # Check message.
-    message = subprocess.check_output(['git', 'log', '-1', '--format=%B'], cwd=node_cwd)
-    self.assertIn('Original commit message:\n\n  Title\n\n  Body', message)
-
-    # Check patch.
-    gitlog = subprocess.check_output(
-        ['git', 'diff', 'master', '--cached', '--', 'deps/v8/v8_foo'],
-        cwd=node_cwd,
-    )
-    self.assertIn('+zonk', gitlog.strip())
-
-    # Check version.
-    version_file = os.path.join(node_cwd, "deps", "v8", "include", "v8-version.h")
-    self.assertIn('#define V8_PATCH_LEVEL 4322', backport_node.FileToText(version_file))
-
-if __name__ == "__main__":
-  unittest.main()
diff --git a/src/v8/tools/node/test_update_node.py b/src/v8/tools/node/test_update_node.py
deleted file mode 100755
index 1a29b4e..0000000
--- a/src/v8/tools/node/test_update_node.py
+++ /dev/null
@@ -1,120 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2017 the V8 project 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 os
-import shutil
-import subprocess
-import sys
-import tempfile
-import unittest
-
-import update_node
-
-# Base paths.
-BASE_DIR = os.path.dirname(os.path.abspath(__file__))
-TEST_DATA = os.path.join(BASE_DIR, 'testdata')
-
-# Expectations.
-EXPECTED_GITIGNORE = """
-/testing/gtest/*
-!/testing/gtest/include
-/testing/gtest/include/*
-!/testing/gtest/include/gtest
-/testing/gtest/include/gtest/*
-!/testing/gtest/include/gtest/gtest_prod.h
-!/third_party/jinja2
-!/third_party/markupsafe
-/unrelated
-"""
-
-EXPECTED_GIT_DIFF = """
- create mode 100644 deps/v8/base/trace_event/common/common
- rename deps/v8/baz/{delete_me => v8_new} (100%)
- delete mode 100644 deps/v8/include/v8-version.h
- rename deps/v8/{delete_me => new/v8_new} (100%)
- create mode 100644 deps/v8/third_party/jinja2/jinja2
- create mode 100644 deps/v8/third_party/markupsafe/markupsafe
- create mode 100644 deps/v8/v8_new
-"""
-
-ADDED_FILES = [
-  'v8_new',
-  'new/v8_new',
-  'baz/v8_new',
-  'testing/gtest/gtest_new',
-  'testing/gtest/new/gtest_new',
-  'testing/gtest/baz/gtest_new',
-  'third_party/jinja2/jinja2',
-  'third_party/markupsafe/markupsafe'
-]
-
-REMOVED_FILES = [
-  'delete_me',
-  'baz/delete_me',
-  'testing/gtest/delete_me',
-  'testing/gtest/baz/delete_me',
-]
-
-def gitify(path):
-  files = os.listdir(path)
-  subprocess.check_call(['git', 'init'], cwd=path)
-  subprocess.check_call(['git', 'add'] + files, cwd=path)
-  subprocess.check_call(['git', 'commit', '-m', 'Initial'], cwd=path)
-
-
-class TestUpdateNode(unittest.TestCase):
-  def setUp(self):
-    self.workdir = tempfile.mkdtemp(prefix='tmp_test_node_')
-
-  def tearDown(self):
-    shutil.rmtree(self.workdir)
-
-  def testUpdate(self):
-    v8_cwd = os.path.join(self.workdir, 'v8')
-    node_cwd = os.path.join(self.workdir, 'node')
-
-    # Set up V8 test fixture.
-    shutil.copytree(src=os.path.join(TEST_DATA, 'v8'), dst=v8_cwd)
-    gitify(v8_cwd)
-    for repository in update_node.SUB_REPOSITORIES:
-      gitify(os.path.join(v8_cwd, *repository))
-
-    # Set up node test fixture.
-    shutil.copytree(src=os.path.join(TEST_DATA, 'node'), dst=node_cwd)
-    gitify(os.path.join(node_cwd))
-
-    # Add a patch.
-    with open(os.path.join(v8_cwd, 'v8_foo'), 'w') as f:
-      f.write('zonk')
-    subprocess.check_call(['git', 'add', 'v8_foo'], cwd=v8_cwd)
-
-    # Run update script.
-    update_node.Main([v8_cwd, node_cwd, "--commit", "--with-patch"])
-
-    # Check expectations.
-    with open(os.path.join(node_cwd, 'deps', 'v8', '.gitignore')) as f:
-      actual_gitignore = f.read()
-    self.assertEquals(EXPECTED_GITIGNORE.strip(), actual_gitignore.strip())
-    for f in ADDED_FILES:
-      added_file = os.path.join(node_cwd, 'deps', 'v8', *f.split('/'))
-      self.assertTrue(os.path.exists(added_file))
-    for f in REMOVED_FILES:
-      removed_file = os.path.join(node_cwd, 'deps', 'v8', *f.split('/'))
-      self.assertFalse(os.path.exists(removed_file))
-    gitlog = subprocess.check_output(
-        ['git', 'diff', 'master', '--summary'],
-        cwd=node_cwd,
-    )
-    self.assertEquals(EXPECTED_GIT_DIFF.strip(), gitlog.strip())
-
-    # Check patch.
-    gitlog = subprocess.check_output(
-        ['git', 'diff', 'master', '--cached', '--', 'deps/v8/v8_foo'],
-        cwd=node_cwd,
-    )
-    self.assertIn('+zonk', gitlog.strip())
-
-if __name__ == "__main__":
-  unittest.main()
diff --git a/src/v8/tools/node/testdata/node/deps/v8/baz/delete_me b/src/v8/tools/node/testdata/node/deps/v8/baz/delete_me
deleted file mode 100644
index eb1ae45..0000000
--- a/src/v8/tools/node/testdata/node/deps/v8/baz/delete_me
+++ /dev/null
@@ -1 +0,0 @@
-...
diff --git a/src/v8/tools/node/testdata/node/deps/v8/baz/v8_foo b/src/v8/tools/node/testdata/node/deps/v8/baz/v8_foo
deleted file mode 100644
index eb1ae45..0000000
--- a/src/v8/tools/node/testdata/node/deps/v8/baz/v8_foo
+++ /dev/null
@@ -1 +0,0 @@
-...
diff --git a/src/v8/tools/node/testdata/node/deps/v8/delete_me b/src/v8/tools/node/testdata/node/deps/v8/delete_me
deleted file mode 100644
index eb1ae45..0000000
--- a/src/v8/tools/node/testdata/node/deps/v8/delete_me
+++ /dev/null
@@ -1 +0,0 @@
-...
diff --git a/src/v8/tools/node/testdata/node/deps/v8/include/v8-version.h b/src/v8/tools/node/testdata/node/deps/v8/include/v8-version.h
deleted file mode 100644
index fe8b271..0000000
--- a/src/v8/tools/node/testdata/node/deps/v8/include/v8-version.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_INCLUDE_VERSION_H_  // V8_VERSION_H_ conflicts with src/version.h
-#define V8_INCLUDE_VERSION_H_
-
-// These macros define the version number for the current version.
-// NOTE these macros are used by some of the tool scripts and the build
-// system so their names cannot be changed without changing the scripts.
-#define V8_MAJOR_VERSION 1
-#define V8_MINOR_VERSION 2
-#define V8_BUILD_NUMBER 3
-#define V8_PATCH_LEVEL 4321
-
-// Use 1 for candidates and 0 otherwise.
-// (Boolean macro values are not supported by all preprocessors.)
-#define V8_IS_CANDIDATE_VERSION 0
-
-#endif  // V8_INCLUDE_VERSION_H_
diff --git a/src/v8/tools/node/testdata/node/deps/v8/v8_foo b/src/v8/tools/node/testdata/node/deps/v8/v8_foo
deleted file mode 100644
index eb1ae45..0000000
--- a/src/v8/tools/node/testdata/node/deps/v8/v8_foo
+++ /dev/null
@@ -1 +0,0 @@
-...
diff --git a/src/v8/tools/node/testdata/v8/base/trace_event/common/common b/src/v8/tools/node/testdata/v8/base/trace_event/common/common
deleted file mode 100644
index e69de29..0000000
--- a/src/v8/tools/node/testdata/v8/base/trace_event/common/common
+++ /dev/null
diff --git a/src/v8/tools/node/testdata/v8/baz/v8_foo b/src/v8/tools/node/testdata/v8/baz/v8_foo
deleted file mode 100644
index eb1ae45..0000000
--- a/src/v8/tools/node/testdata/v8/baz/v8_foo
+++ /dev/null
@@ -1 +0,0 @@
-...
diff --git a/src/v8/tools/node/testdata/v8/baz/v8_new b/src/v8/tools/node/testdata/v8/baz/v8_new
deleted file mode 100644
index eb1ae45..0000000
--- a/src/v8/tools/node/testdata/v8/baz/v8_new
+++ /dev/null
@@ -1 +0,0 @@
-...
diff --git a/src/v8/tools/node/testdata/v8/new/v8_new b/src/v8/tools/node/testdata/v8/new/v8_new
deleted file mode 100644
index eb1ae45..0000000
--- a/src/v8/tools/node/testdata/v8/new/v8_new
+++ /dev/null
@@ -1 +0,0 @@
-...
diff --git a/src/v8/tools/node/testdata/v8/v8_foo b/src/v8/tools/node/testdata/v8/v8_foo
deleted file mode 100644
index eb1ae45..0000000
--- a/src/v8/tools/node/testdata/v8/v8_foo
+++ /dev/null
@@ -1 +0,0 @@
-...
diff --git a/src/v8/tools/node/testdata/v8/v8_new b/src/v8/tools/node/testdata/v8/v8_new
deleted file mode 100644
index eb1ae45..0000000
--- a/src/v8/tools/node/testdata/v8/v8_new
+++ /dev/null
@@ -1 +0,0 @@
-...
diff --git a/src/v8/tools/node/update_node.py b/src/v8/tools/node/update_node.py
deleted file mode 100755
index ebd953a..0000000
--- a/src/v8/tools/node/update_node.py
+++ /dev/null
@@ -1,167 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2017 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-Use this script to update V8 in a Node.js checkout.
-
-Requirements:
-  - Node.js checkout in which V8 should be updated.
-  - V8 checkout at the commit to which Node.js should be updated.
-
-Usage:
-  $ update_node.py <path_to_v8> <path_to_node>
-
-  This will synchronize the content of <path_to_node>/deps/v8 with <path_to_v8>,
-  and a few V8 dependencies require in Node.js. It will also update .gitignore
-  appropriately.
-
-Optional flags:
-  --gclient     Run `gclient sync` on the V8 checkout before updating.
-  --commit      Create commit with the updated V8 in the Node.js checkout.
-  --with-patch  Also include currently staged files in the V8 checkout.
-"""
-
-import argparse
-import os
-import shutil
-import subprocess
-import sys
-import stat
-import node_common
-
-TARGET_SUBDIR = os.path.join("deps", "v8")
-
-SUB_REPOSITORIES = [ ["base", "trace_event", "common"],
-                     ["testing", "gtest"],
-                     ["third_party", "jinja2"],
-                     ["third_party", "markupsafe"] ]
-
-DELETE_FROM_GITIGNORE = [ "/base",
-                          "/testing/gtest",
-                          "/third_party/jinja2",
-                          "/third_party/markupsafe" ]
-
-# Node.js requires only a single header file from gtest to build V8.
-# Both jinja2 and markupsafe are required to generate part of the inspector.
-ADD_TO_GITIGNORE = [ "/testing/gtest/*",
-                     "!/testing/gtest/include",
-                     "/testing/gtest/include/*",
-                     "!/testing/gtest/include/gtest",
-                     "/testing/gtest/include/gtest/*",
-                     "!/testing/gtest/include/gtest/gtest_prod.h",
-                     "!/third_party/jinja2",
-                     "!/third_party/markupsafe" ]
-
-def RunGclient(path):
-  assert os.path.isdir(path)
-  print ">> Running gclient sync"
-  subprocess.check_call(["gclient", "sync", "--nohooks"], cwd=path)
-
-def CommitPatch(options):
-  """Makes a dummy commit for the changes in the index.
-
-  On trybots, bot_updated applies the patch to the index. We commit it to make
-  the fake git clone fetch it into node.js. We can leave the commit, as
-  bot_update will ensure a clean state on each run.
-  """
-  print ">> Committing patch"
-  subprocess.check_call(
-      ["git", "-c", "user.name=fake", "-c", "user.email=fake@chromium.org",
-       "commit", "--allow-empty", "-m", "placeholder-commit"],
-      cwd=options.v8_path,
-  )
-
-def UpdateTarget(repository, options):
-  source = os.path.join(options.v8_path, *repository)
-  target = os.path.join(options.node_path, TARGET_SUBDIR, *repository)
-  print ">> Updating target directory %s" % target
-  print ">>     from active branch at %s" % source
-  if not os.path.exists(target):
-    os.makedirs(target)
-  # Remove possible remnants of previous incomplete runs.
-  node_common.UninitGit(target)
-
-  git_commands = [
-    ["git", "init"],                             # initialize target repo
-    ["git", "remote", "add", "origin", source],  # point to the source repo
-    ["git", "fetch", "origin", "HEAD"],          # sync to the current branch
-    ["git", "reset", "--hard", "FETCH_HEAD"],    # reset to the current branch
-    ["git", "clean", "-fd"],                     # delete removed files
-  ]
-  try:
-    for command in git_commands:
-      subprocess.check_call(command, cwd=target)
-  except:
-    raise
-  finally:
-    node_common.UninitGit(target)
-
-def UpdateGitIgnore(options):
-  file_name = os.path.join(options.node_path, TARGET_SUBDIR, ".gitignore")
-  assert os.path.isfile(file_name)
-  print ">> Updating .gitignore with lines"
-  with open(file_name) as gitignore:
-    content = gitignore.readlines()
-  content = [x.strip() for x in content]
-  for x in DELETE_FROM_GITIGNORE:
-    if x in content:
-      print "- %s" % x
-      content.remove(x)
-  for x in ADD_TO_GITIGNORE:
-    if x not in content:
-      print "+ %s" % x
-      content.append(x)
-  content.sort(key=lambda x: x[1:] if x.startswith("!") else x)
-  with open(file_name, "w") as gitignore:
-    for x in content:
-      gitignore.write("%s\n" % x)
-
-def CreateCommit(options):
-  print ">> Creating commit."
-  # Find git hash from source.
-  githash = subprocess.check_output(["git", "rev-parse", "--short", "HEAD"],
-                                    cwd=options.v8_path).strip()
-  # Create commit at target.
-  git_commands = [
-    ["git", "checkout", "-b", "update_v8_to_%s" % githash],  # new branch
-    ["git", "add", "."],                                     # add files
-    ["git", "commit", "-m", "Update V8 to %s" % githash]     # new commit
-  ]
-  for command in git_commands:
-    subprocess.check_call(command, cwd=options.node_path)
-
-def ParseOptions(args):
-  parser = argparse.ArgumentParser(description="Update V8 in Node.js")
-  parser.add_argument("v8_path", help="Path to V8 checkout")
-  parser.add_argument("node_path", help="Path to Node.js checkout")
-  parser.add_argument("--gclient", action="store_true", help="Run gclient sync")
-  parser.add_argument("--commit", action="store_true", help="Create commit")
-  parser.add_argument("--with-patch", action="store_true",
-                      help="Apply also staged files")
-  options = parser.parse_args(args)
-  assert os.path.isdir(options.v8_path)
-  options.v8_path = os.path.abspath(options.v8_path)
-  assert os.path.isdir(options.node_path)
-  options.node_path = os.path.abspath(options.node_path)
-  return options
-
-def Main(args):
-  options = ParseOptions(args)
-  if options.gclient:
-    RunGclient(options.v8_path)
-  # Commit patch on trybots to main V8 repository.
-  if options.with_patch:
-    CommitPatch(options)
-  # Update main V8 repository.
-  UpdateTarget([""], options)
-  # Patch .gitignore before updating sub-repositories.
-  UpdateGitIgnore(options)
-  for repo in SUB_REPOSITORIES:
-    UpdateTarget(repo, options)
-  if options.commit:
-    CreateCommit(options)
-
-if __name__ == "__main__":
-  Main(sys.argv[1:])
diff --git a/src/v8/tools/parser-shell.cc b/src/v8/tools/parser-shell.cc
deleted file mode 100644
index 1a49223..0000000
--- a/src/v8/tools/parser-shell.cc
+++ /dev/null
@@ -1,189 +0,0 @@
-// Copyright 2014 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.
-
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string>
-#include <vector>
-#include "src/v8.h"
-
-#include "include/libplatform/libplatform.h"
-#include "src/api.h"
-#include "src/compiler.h"
-#include "src/objects-inl.h"
-#include "src/parsing/parse-info.h"
-#include "src/parsing/parsing.h"
-#include "src/parsing/preparse-data-format.h"
-#include "src/parsing/preparse-data.h"
-#include "src/parsing/preparser.h"
-#include "src/parsing/scanner-character-streams.h"
-#include "tools/shell-utils.h"
-
-using namespace v8::internal;
-
-class StringResource8 : public v8::String::ExternalOneByteStringResource {
- public:
-  StringResource8(const char* data, int length)
-      : data_(data), length_(length) { }
-  virtual size_t length() const { return length_; }
-  virtual const char* data() const { return data_; }
-
- private:
-  const char* data_;
-  int length_;
-};
-
-std::pair<v8::base::TimeDelta, v8::base::TimeDelta> RunBaselineParser(
-    const char* fname, Encoding encoding, int repeat, v8::Isolate* isolate,
-    v8::Local<v8::Context> context) {
-  int length = 0;
-  const byte* source = ReadFileAndRepeat(fname, &length, repeat);
-  v8::Local<v8::String> source_handle;
-  switch (encoding) {
-    case UTF8: {
-      source_handle = v8::String::NewFromUtf8(
-                          isolate, reinterpret_cast<const char*>(source),
-                          v8::NewStringType::kNormal).ToLocalChecked();
-      break;
-    }
-    case UTF16: {
-      source_handle =
-          v8::String::NewFromTwoByte(
-              isolate, reinterpret_cast<const uint16_t*>(source),
-              v8::NewStringType::kNormal, length / 2).ToLocalChecked();
-      break;
-    }
-    case LATIN1: {
-      StringResource8* string_resource =
-          new StringResource8(reinterpret_cast<const char*>(source), length);
-      source_handle = v8::String::NewExternalOneByte(isolate, string_resource)
-                          .ToLocalChecked();
-      break;
-    }
-  }
-  v8::base::TimeDelta parse_time1, parse_time2;
-  Handle<Script> script =
-      reinterpret_cast<i::Isolate*>(isolate)->factory()->NewScript(
-          v8::Utils::OpenHandle(*source_handle));
-  i::ScriptData* cached_data_impl = NULL;
-  // First round of parsing (produce data to cache).
-  {
-    ParseInfo info(script);
-    info.set_cached_data(&cached_data_impl);
-    info.set_compile_options(v8::ScriptCompiler::kProduceParserCache);
-    v8::base::ElapsedTimer timer;
-    timer.Start();
-    bool success =
-        parsing::ParseProgram(&info, reinterpret_cast<i::Isolate*>(isolate));
-    parse_time1 = timer.Elapsed();
-    if (!success) {
-      fprintf(stderr, "Parsing failed\n");
-      return std::make_pair(v8::base::TimeDelta(), v8::base::TimeDelta());
-    }
-  }
-  // Second round of parsing (consume cached data).
-  {
-    ParseInfo info(script);
-    info.set_cached_data(&cached_data_impl);
-    info.set_compile_options(v8::ScriptCompiler::kConsumeParserCache);
-    v8::base::ElapsedTimer timer;
-    timer.Start();
-    bool success =
-        parsing::ParseProgram(&info, reinterpret_cast<i::Isolate*>(isolate));
-    parse_time2 = timer.Elapsed();
-    if (!success) {
-      fprintf(stderr, "Parsing failed\n");
-      return std::make_pair(v8::base::TimeDelta(), v8::base::TimeDelta());
-    }
-  }
-  return std::make_pair(parse_time1, parse_time2);
-}
-
-
-int main(int argc, char* argv[]) {
-  v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
-  v8::V8::InitializeICUDefaultLocation(argv[0]);
-  std::unique_ptr<v8::Platform> platform = v8::platform::NewDefaultPlatform();
-  v8::V8::InitializePlatform(platform.get());
-  v8::V8::Initialize();
-  v8::V8::InitializeExternalStartupData(argv[0]);
-
-  Encoding encoding = LATIN1;
-  std::vector<std::string> fnames;
-  std::string benchmark;
-  int repeat = 1;
-  for (int i = 0; i < argc; ++i) {
-    if (strcmp(argv[i], "--latin1") == 0) {
-      encoding = LATIN1;
-    } else if (strcmp(argv[i], "--utf8") == 0) {
-      encoding = UTF8;
-    } else if (strcmp(argv[i], "--utf16") == 0) {
-      encoding = UTF16;
-    } else if (strncmp(argv[i], "--benchmark=", 12) == 0) {
-      benchmark = std::string(argv[i]).substr(12);
-    } else if (strncmp(argv[i], "--repeat=", 9) == 0) {
-      std::string repeat_str = std::string(argv[i]).substr(9);
-      repeat = atoi(repeat_str.c_str());
-    } else if (i > 0 && argv[i][0] != '-') {
-      fnames.push_back(std::string(argv[i]));
-    }
-  }
-  v8::Isolate::CreateParams create_params;
-  create_params.array_buffer_allocator =
-      v8::ArrayBuffer::Allocator::NewDefaultAllocator();
-  v8::Isolate* isolate = v8::Isolate::New(create_params);
-  {
-    v8::Isolate::Scope isolate_scope(isolate);
-    v8::HandleScope handle_scope(isolate);
-    v8::Local<v8::ObjectTemplate> global = v8::ObjectTemplate::New(isolate);
-    v8::Local<v8::Context> context = v8::Context::New(isolate, NULL, global);
-    DCHECK(!context.IsEmpty());
-    {
-      v8::Context::Scope scope(context);
-      double first_parse_total = 0;
-      double second_parse_total = 0;
-      for (size_t i = 0; i < fnames.size(); i++) {
-        std::pair<v8::base::TimeDelta, v8::base::TimeDelta> time =
-            RunBaselineParser(fnames[i].c_str(), encoding, repeat, isolate,
-                              context);
-        first_parse_total += time.first.InMillisecondsF();
-        second_parse_total += time.second.InMillisecondsF();
-      }
-      if (benchmark.empty()) benchmark = "Baseline";
-      printf("%s(FirstParseRunTime): %.f ms\n", benchmark.c_str(),
-             first_parse_total);
-      printf("%s(SecondParseRunTime): %.f ms\n", benchmark.c_str(),
-             second_parse_total);
-    }
-  }
-  v8::V8::Dispose();
-  v8::V8::ShutdownPlatform();
-  delete create_params.array_buffer_allocator;
-  return 0;
-}
diff --git a/src/v8/tools/parser-shell.gyp b/src/v8/tools/parser-shell.gyp
deleted file mode 100644
index 9b94888..0000000
--- a/src/v8/tools/parser-shell.gyp
+++ /dev/null
@@ -1,60 +0,0 @@
-# Copyright 2013 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_code': 1,
-    'v8_enable_i18n_support%': 1,
-  },
-  'includes': ['../gypfiles/toolchain.gypi', '../gypfiles/features.gypi'],
-  'targets': [
-    {
-      'target_name': 'parser-shell',
-      'type': 'executable',
-      'dependencies': [
-        '../src/v8.gyp:v8',
-        '../src/v8.gyp:v8_libbase',
-        '../src/v8.gyp:v8_libplatform',
-      ],
-      'conditions': [
-        ['v8_enable_i18n_support==1', {
-          'dependencies': [
-            '<(icu_gyp_path):icui18n',
-            '<(icu_gyp_path):icuuc',
-          ],
-        }],
-      ],
-      'include_dirs+': [
-        '..',
-      ],
-      'sources': [
-        'parser-shell.cc',
-        'shell-utils.h',
-      ],
-    },
-  ],
-}
diff --git a/src/v8/tools/perf-to-html.py b/src/v8/tools/perf-to-html.py
deleted file mode 100755
index e397936..0000000
--- a/src/v8/tools/perf-to-html.py
+++ /dev/null
@@ -1,381 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-'''
-python %prog
-
-Convert a perf trybot JSON file into a pleasing HTML page. It can read
-from standard input or via the --filename option. Examples:
-
-  cat results.json | %prog --title "ia32 results"
-  %prog -f results.json -t "ia32 results" -o results.html
-'''
-
-import json
-import math
-from optparse import OptionParser
-import os
-import shutil
-import sys
-import tempfile
-
-PERCENT_CONSIDERED_SIGNIFICANT = 0.5
-PROBABILITY_CONSIDERED_SIGNIFICANT = 0.02
-PROBABILITY_CONSIDERED_MEANINGLESS = 0.05
-
-
-def ComputeZ(baseline_avg, baseline_sigma, mean, n):
-  if baseline_sigma == 0:
-    return 1000.0;
-  return abs((mean - baseline_avg) / (baseline_sigma / math.sqrt(n)))
-
-
-# Values from http://www.fourmilab.ch/rpkp/experiments/analysis/zCalc.html
-def ComputeProbability(z):
-  if z > 2.575829: # p 0.005: two sided < 0.01
-    return 0
-  if z > 2.326348: # p 0.010
-    return 0.01
-  if z > 2.170091: # p 0.015
-    return 0.02
-  if z > 2.053749: # p 0.020
-    return 0.03
-  if z > 1.959964: # p 0.025: two sided < 0.05
-    return 0.04
-  if z > 1.880793: # p 0.030
-    return 0.05
-  if z > 1.811910: # p 0.035
-    return 0.06
-  if z > 1.750686: # p 0.040
-    return 0.07
-  if z > 1.695397: # p 0.045
-    return 0.08
-  if z > 1.644853: # p 0.050: two sided < 0.10
-    return 0.09
-  if z > 1.281551: # p 0.100: two sided < 0.20
-    return 0.10
-  return 0.20 # two sided p >= 0.20
-
-
-class Result:
-  def __init__(self, test_name, count, hasScoreUnits, result, sigma,
-               master_result, master_sigma):
-    self.result_ = float(result)
-    self.sigma_ = float(sigma)
-    self.master_result_ = float(master_result)
-    self.master_sigma_ = float(master_sigma)
-    self.significant_ = False
-    self.notable_ = 0
-    self.percentage_string_ = ""
-    # compute notability and significance.
-    try:
-      if hasScoreUnits:
-        compare_num = 100*self.result_/self.master_result_ - 100
-      else:
-        compare_num = 100*self.master_result_/self.result_ - 100
-      if abs(compare_num) > 0.1:
-        self.percentage_string_ = "%3.1f" % (compare_num)
-        z = ComputeZ(self.master_result_, self.master_sigma_, self.result_, count)
-        p = ComputeProbability(z)
-        if p < PROBABILITY_CONSIDERED_SIGNIFICANT:
-          self.significant_ = True
-        if compare_num >= PERCENT_CONSIDERED_SIGNIFICANT:
-          self.notable_ = 1
-        elif compare_num <= -PERCENT_CONSIDERED_SIGNIFICANT:
-          self.notable_ = -1
-    except ZeroDivisionError:
-      self.percentage_string_ = "NaN"
-      self.significant_ = True
-
-  def result(self):
-    return self.result_
-
-  def sigma(self):
-    return self.sigma_
-
-  def master_result(self):
-    return self.master_result_
-
-  def master_sigma(self):
-    return self.master_sigma_
-
-  def percentage_string(self):
-    return self.percentage_string_;
-
-  def isSignificant(self):
-    return self.significant_
-
-  def isNotablyPositive(self):
-    return self.notable_ > 0
-
-  def isNotablyNegative(self):
-    return self.notable_ < 0
-
-
-class Benchmark:
-  def __init__(self, name, data):
-    self.name_ = name
-    self.tests_ = {}
-    for test in data:
-      # strip off "<name>/" prefix, allowing for subsequent "/"s
-      test_name = test.split("/", 1)[1]
-      self.appendResult(test_name, data[test])
-
-  # tests is a dictionary of Results
-  def tests(self):
-    return self.tests_
-
-  def SortedTestKeys(self):
-    keys = self.tests_.keys()
-    keys.sort()
-    t = "Total"
-    if t in keys:
-      keys.remove(t)
-      keys.append(t)
-    return keys
-
-  def name(self):
-    return self.name_
-
-  def appendResult(self, test_name, test_data):
-    with_string = test_data["result with patch   "]
-    data = with_string.split()
-    master_string = test_data["result without patch"]
-    master_data = master_string.split()
-    runs = int(test_data["runs"])
-    units = test_data["units"]
-    hasScoreUnits = units == "score"
-    self.tests_[test_name] = Result(test_name,
-                                    runs,
-                                    hasScoreUnits,
-                                    data[0], data[2],
-                                    master_data[0], master_data[2])
-
-
-class BenchmarkRenderer:
-  def __init__(self, output_file):
-    self.print_output_ = []
-    self.output_file_ = output_file
-
-  def Print(self, str_data):
-    self.print_output_.append(str_data)
-
-  def FlushOutput(self):
-    string_data = "\n".join(self.print_output_)
-    print_output = []
-    if self.output_file_:
-      # create a file
-      with open(self.output_file_, "w") as text_file:
-        text_file.write(string_data)
-    else:
-      print(string_data)
-
-  def RenderOneBenchmark(self, benchmark):
-    self.Print("<h2>")
-    self.Print("<a name=\"" + benchmark.name() + "\">")
-    self.Print(benchmark.name() + "</a> <a href=\"#top\">(top)</a>")
-    self.Print("</h2>");
-    self.Print("<table class=\"benchmark\">")
-    self.Print("<thead>")
-    self.Print("  <th>Test</th>")
-    self.Print("  <th>Result</th>")
-    self.Print("  <th>Master</th>")
-    self.Print("  <th>%</th>")
-    self.Print("</thead>")
-    self.Print("<tbody>")
-    tests = benchmark.tests()
-    for test in benchmark.SortedTestKeys():
-      t = tests[test]
-      self.Print("  <tr>")
-      self.Print("    <td>" + test + "</td>")
-      self.Print("    <td>" + str(t.result()) + "</td>")
-      self.Print("    <td>" + str(t.master_result()) + "</td>")
-      t = tests[test]
-      res = t.percentage_string()
-      if t.isSignificant():
-        res = self.bold(res)
-      if t.isNotablyPositive():
-        res = self.green(res)
-      elif t.isNotablyNegative():
-        res = self.red(res)
-      self.Print("    <td>" + res + "</td>")
-      self.Print("  </tr>")
-    self.Print("</tbody>")
-    self.Print("</table>")
-
-  def ProcessJSONData(self, data, title):
-    self.Print("<h1>" + title + "</h1>")
-    self.Print("<ul>")
-    for benchmark in data:
-     if benchmark != "errors":
-       self.Print("<li><a href=\"#" + benchmark + "\">" + benchmark + "</a></li>")
-    self.Print("</ul>")
-    for benchmark in data:
-      if benchmark != "errors":
-        benchmark_object = Benchmark(benchmark, data[benchmark])
-        self.RenderOneBenchmark(benchmark_object)
-
-  def bold(self, data):
-    return "<b>" + data + "</b>"
-
-  def red(self, data):
-    return "<font color=\"red\">" + data + "</font>"
-
-
-  def green(self, data):
-    return "<font color=\"green\">" + data + "</font>"
-
-  def PrintHeader(self):
-    data = """<html>
-<head>
-<title>Output</title>
-<style type="text/css">
-/*
-Style inspired by Andy Ferra's gist at https://gist.github.com/andyferra/2554919
-*/
-body {
-  font-family: Helvetica, arial, sans-serif;
-  font-size: 14px;
-  line-height: 1.6;
-  padding-top: 10px;
-  padding-bottom: 10px;
-  background-color: white;
-  padding: 30px;
-}
-h1, h2, h3, h4, h5, h6 {
-  margin: 20px 0 10px;
-  padding: 0;
-  font-weight: bold;
-  -webkit-font-smoothing: antialiased;
-  cursor: text;
-  position: relative;
-}
-h1 {
-  font-size: 28px;
-  color: black;
-}
-
-h2 {
-  font-size: 24px;
-  border-bottom: 1px solid #cccccc;
-  color: black;
-}
-
-h3 {
-  font-size: 18px;
-}
-
-h4 {
-  font-size: 16px;
-}
-
-h5 {
-  font-size: 14px;
-}
-
-h6 {
-  color: #777777;
-  font-size: 14px;
-}
-
-p, blockquote, ul, ol, dl, li, table, pre {
-  margin: 15px 0;
-}
-
-li p.first {
-  display: inline-block;
-}
-
-ul, ol {
-  padding-left: 30px;
-}
-
-ul :first-child, ol :first-child {
-  margin-top: 0;
-}
-
-ul :last-child, ol :last-child {
-  margin-bottom: 0;
-}
-
-table {
-  padding: 0;
-}
-
-table tr {
-  border-top: 1px solid #cccccc;
-  background-color: white;
-  margin: 0;
-  padding: 0;
-}
-
-table tr:nth-child(2n) {
-  background-color: #f8f8f8;
-}
-
-table tr th {
-  font-weight: bold;
-  border: 1px solid #cccccc;
-  text-align: left;
-  margin: 0;
-  padding: 6px 13px;
-}
-table tr td {
-  border: 1px solid #cccccc;
-  text-align: left;
-  margin: 0;
-  padding: 6px 13px;
-}
-table tr th :first-child, table tr td :first-child {
-  margin-top: 0;
-}
-table tr th :last-child, table tr td :last-child {
-  margin-bottom: 0;
-}
-</style>
-</head>
-<body>
-"""
-    self.Print(data)
-
-  def PrintFooter(self):
-    data = """</body>
-</html>
-"""
-    self.Print(data)
-
-
-def Render(opts, args):
-  if opts.filename:
-    with open(opts.filename) as json_data:
-      data = json.load(json_data)
-  else:
-    # load data from stdin
-    data = json.load(sys.stdin)
-
-  if opts.title:
-    title = opts.title
-  elif opts.filename:
-    title = opts.filename
-  else:
-    title = "Benchmark results"
-  renderer = BenchmarkRenderer(opts.output)
-  renderer.PrintHeader()
-  renderer.ProcessJSONData(data, title)
-  renderer.PrintFooter()
-  renderer.FlushOutput()
-
-
-if __name__ == '__main__':
-  parser = OptionParser(usage=__doc__)
-  parser.add_option("-f", "--filename", dest="filename",
-                    help="Specifies the filename for the JSON results "
-                         "rather than reading from stdin.")
-  parser.add_option("-t", "--title", dest="title",
-                    help="Optional title of the web page.")
-  parser.add_option("-o", "--output", dest="output",
-                    help="Write html output to this file rather than stdout.")
-
-  (opts, args) = parser.parse_args()
-  Render(opts, args)
diff --git a/src/v8/tools/release/releases.py b/src/v8/tools/release/releases.py
deleted file mode 100755
index 7b659cc..0000000
--- a/src/v8/tools/release/releases.py
+++ /dev/null
@@ -1,576 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2014 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This script retrieves the history of all V8 branches and
-# their corresponding Chromium revisions.
-
-# Requires a chromium checkout with branch heads:
-# gclient sync --with_branch_heads
-# gclient fetch
-
-import argparse
-import csv
-import itertools
-import json
-import os
-import re
-import sys
-
-from common_includes import *
-
-CONFIG = {
-  "BRANCHNAME": "retrieve-v8-releases",
-  "PERSISTFILE_BASENAME": "/tmp/v8-releases-tempfile",
-}
-
-# Expression for retrieving the bleeding edge revision from a commit message.
-PUSH_MSG_SVN_RE = re.compile(r".* \(based on bleeding_edge revision r(\d+)\)$")
-PUSH_MSG_GIT_RE = re.compile(r".* \(based on ([a-fA-F0-9]+)\)$")
-
-# Expression for retrieving the merged patches from a merge commit message
-# (old and new format).
-MERGE_MESSAGE_RE = re.compile(r"^.*[M|m]erged (.+)(\)| into).*$", re.M)
-
-CHERRY_PICK_TITLE_GIT_RE = re.compile(r"^.* \(cherry\-pick\)\.?$")
-
-# New git message for cherry-picked CLs. One message per line.
-MERGE_MESSAGE_GIT_RE = re.compile(r"^Merged ([a-fA-F0-9]+)\.?$")
-
-# Expression for retrieving reverted patches from a commit message (old and
-# new format).
-ROLLBACK_MESSAGE_RE = re.compile(r"^.*[R|r]ollback of (.+)(\)| in).*$", re.M)
-
-# New git message for reverted CLs. One message per line.
-ROLLBACK_MESSAGE_GIT_RE = re.compile(r"^Rollback of ([a-fA-F0-9]+)\.?$")
-
-# Expression for retrieving the code review link.
-REVIEW_LINK_RE = re.compile(r"^Review URL: (.+)$", re.M)
-
-# Expression with three versions (historical) for extracting the v8 revision
-# from the chromium DEPS file.
-DEPS_RE = re.compile(r"""^\s*(?:["']v8_revision["']: ["']"""
-                     """|\(Var\("googlecode_url"\) % "v8"\) \+ "\/trunk@"""
-                     """|"http\:\/\/v8\.googlecode\.com\/svn\/trunk@)"""
-                     """([^"']+)["'].*$""", re.M)
-
-# Expression to pick tag and revision for bleeding edge tags. To be used with
-# output of 'svn log'.
-BLEEDING_EDGE_TAGS_RE = re.compile(
-    r"A \/tags\/([^\s]+) \(from \/branches\/bleeding_edge\:(\d+)\)")
-
-OMAHA_PROXY_URL = "http://omahaproxy.appspot.com/"
-
-def SortBranches(branches):
-  """Sort branches with version number names."""
-  return sorted(branches, key=SortingKey, reverse=True)
-
-
-def FilterDuplicatesAndReverse(cr_releases):
-  """Returns the chromium releases in reverse order filtered by v8 revision
-  duplicates.
-
-  cr_releases is a list of [cr_rev, v8_hsh] reverse-sorted by cr_rev.
-  """
-  last = ""
-  result = []
-  for release in reversed(cr_releases):
-    if last == release[1]:
-      continue
-    last = release[1]
-    result.append(release)
-  return result
-
-
-def BuildRevisionRanges(cr_releases):
-  """Returns a mapping of v8 revision -> chromium ranges.
-  The ranges are comma-separated, each range has the form R1:R2. The newest
-  entry is the only one of the form R1, as there is no end range.
-
-  cr_releases is a list of [cr_rev, v8_hsh] reverse-sorted by cr_rev.
-  cr_rev either refers to a chromium commit position or a chromium branch
-  number.
-  """
-  range_lists = {}
-  cr_releases = FilterDuplicatesAndReverse(cr_releases)
-
-  # Visit pairs of cr releases from oldest to newest.
-  for cr_from, cr_to in itertools.izip(
-      cr_releases, itertools.islice(cr_releases, 1, None)):
-
-    # Assume the chromium revisions are all different.
-    assert cr_from[0] != cr_to[0]
-
-    ran = "%s:%d" % (cr_from[0], int(cr_to[0]) - 1)
-
-    # Collect the ranges in lists per revision.
-    range_lists.setdefault(cr_from[1], []).append(ran)
-
-  # Add the newest revision.
-  if cr_releases:
-    range_lists.setdefault(cr_releases[-1][1], []).append(cr_releases[-1][0])
-
-  # Stringify and comma-separate the range lists.
-  return dict((hsh, ", ".join(ran)) for hsh, ran in range_lists.iteritems())
-
-
-def MatchSafe(match):
-  if match:
-    return match.group(1)
-  else:
-    return ""
-
-
-class Preparation(Step):
-  MESSAGE = "Preparation."
-
-  def RunStep(self):
-    self.CommonPrepare()
-    self.PrepareBranch()
-
-
-class RetrieveV8Releases(Step):
-  MESSAGE = "Retrieve all V8 releases."
-
-  def ExceedsMax(self, releases):
-    return (self._options.max_releases > 0
-            and len(releases) > self._options.max_releases)
-
-  def GetMasterHashFromPush(self, title):
-    return MatchSafe(PUSH_MSG_GIT_RE.match(title))
-
-  def GetMergedPatches(self, body):
-    patches = MatchSafe(MERGE_MESSAGE_RE.search(body))
-    if not patches:
-      patches = MatchSafe(ROLLBACK_MESSAGE_RE.search(body))
-      if patches:
-        # Indicate reverted patches with a "-".
-        patches = "-%s" % patches
-    return patches
-
-  def GetMergedPatchesGit(self, body):
-    patches = []
-    for line in body.splitlines():
-      patch = MatchSafe(MERGE_MESSAGE_GIT_RE.match(line))
-      if patch:
-        patches.append(patch)
-      patch = MatchSafe(ROLLBACK_MESSAGE_GIT_RE.match(line))
-      if patch:
-        patches.append("-%s" % patch)
-    return ", ".join(patches)
-
-
-  def GetReleaseDict(
-      self, git_hash, master_position, master_hash, branch, version,
-      patches, cl_body):
-    revision = self.GetCommitPositionNumber(git_hash)
-    return {
-      # The cr commit position number on the branch.
-      "revision": revision,
-      # The git revision on the branch.
-      "revision_git": git_hash,
-      # The cr commit position number on master.
-      "master_position": master_position,
-      # The same for git.
-      "master_hash": master_hash,
-      # The branch name.
-      "branch": branch,
-      # The version for displaying in the form 3.26.3 or 3.26.3.12.
-      "version": version,
-      # The date of the commit.
-      "date": self.GitLog(n=1, format="%ci", git_hash=git_hash),
-      # Merged patches if available in the form 'r1234, r2345'.
-      "patches_merged": patches,
-      # Default for easier output formatting.
-      "chromium_revision": "",
-      # Default for easier output formatting.
-      "chromium_branch": "",
-      # Link to the CL on code review. Candiates pushes are not uploaded,
-      # so this field will be populated below with the recent roll CL link.
-      "review_link": MatchSafe(REVIEW_LINK_RE.search(cl_body)),
-      # Link to the commit message on google code.
-      "revision_link": ("https://code.google.com/p/v8/source/detail?r=%s"
-                        % revision),
-    }
-
-  def GetRelease(self, git_hash, branch):
-    self.ReadAndPersistVersion()
-    base_version = [self["major"], self["minor"], self["build"]]
-    version = ".".join(base_version)
-    body = self.GitLog(n=1, format="%B", git_hash=git_hash)
-
-    patches = ""
-    if self["patch"] != "0":
-      version += ".%s" % self["patch"]
-      if CHERRY_PICK_TITLE_GIT_RE.match(body.splitlines()[0]):
-        patches = self.GetMergedPatchesGit(body)
-      else:
-        patches = self.GetMergedPatches(body)
-
-    if SortingKey("4.2.69") <= SortingKey(version):
-      master_hash = self.GetLatestReleaseBase(version=version)
-    else:
-      # Legacy: Before version 4.2.69, the master revision was determined
-      # by commit message.
-      title = self.GitLog(n=1, format="%s", git_hash=git_hash)
-      master_hash = self.GetMasterHashFromPush(title)
-    master_position = ""
-    if master_hash:
-      master_position = self.GetCommitPositionNumber(master_hash)
-    return self.GetReleaseDict(
-        git_hash, master_position, master_hash, branch, version,
-        patches, body), self["patch"]
-
-  def GetReleasesFromBranch(self, branch):
-    self.GitReset(self.vc.RemoteBranch(branch))
-    if branch == self.vc.MasterBranch():
-      return self.GetReleasesFromMaster()
-
-    releases = []
-    try:
-      for git_hash in self.GitLog(format="%H").splitlines():
-        if VERSION_FILE not in self.GitChangedFiles(git_hash):
-          continue
-        if self.ExceedsMax(releases):
-          break  # pragma: no cover
-        if not self.GitCheckoutFileSafe(VERSION_FILE, git_hash):
-          break  # pragma: no cover
-
-        release, patch_level = self.GetRelease(git_hash, branch)
-        releases.append(release)
-
-        # Follow branches only until their creation point.
-        # TODO(machenbach): This omits patches if the version file wasn't
-        # manipulated correctly. Find a better way to detect the point where
-        # the parent of the branch head leads to the trunk branch.
-        if branch != self.vc.CandidateBranch() and patch_level == "0":
-          break
-
-    # Allow Ctrl-C interrupt.
-    except (KeyboardInterrupt, SystemExit):  # pragma: no cover
-      pass
-
-    # Clean up checked-out version file.
-    self.GitCheckoutFileSafe(VERSION_FILE, "HEAD")
-    return releases
-
-  def GetReleaseFromRevision(self, revision):
-    releases = []
-    try:
-      if (VERSION_FILE not in self.GitChangedFiles(revision) or
-          not self.GitCheckoutFileSafe(VERSION_FILE, revision)):
-        print "Skipping revision %s" % revision
-        return []  # pragma: no cover
-
-      branches = map(
-          str.strip,
-          self.Git("branch -r --contains %s" % revision).strip().splitlines(),
-      )
-      branch = ""
-      for b in branches:
-        if b.startswith("origin/"):
-          branch = b.split("origin/")[1]
-          break
-        if b.startswith("branch-heads/"):
-          branch = b.split("branch-heads/")[1]
-          break
-      else:
-        print "Could not determine branch for %s" % revision
-
-      release, _ = self.GetRelease(revision, branch)
-      releases.append(release)
-
-    # Allow Ctrl-C interrupt.
-    except (KeyboardInterrupt, SystemExit):  # pragma: no cover
-      pass
-
-    # Clean up checked-out version file.
-    self.GitCheckoutFileSafe(VERSION_FILE, "HEAD")
-    return releases
-
-
-  def RunStep(self):
-    self.GitCreateBranch(self._config["BRANCHNAME"])
-    releases = []
-    if self._options.branch == 'recent':
-      # List every release from the last 7 days.
-      revisions = self.GetRecentReleases(max_age=7 * DAY_IN_SECONDS)
-      for revision in revisions:
-        releases += self.GetReleaseFromRevision(revision)
-    elif self._options.branch == 'all':  # pragma: no cover
-      # Retrieve the full release history.
-      for branch in self.vc.GetBranches():
-        releases += self.GetReleasesFromBranch(branch)
-      releases += self.GetReleasesFromBranch(self.vc.CandidateBranch())
-      releases += self.GetReleasesFromBranch(self.vc.MasterBranch())
-    else:  # pragma: no cover
-      # Retrieve history for a specified branch.
-      assert self._options.branch in (self.vc.GetBranches() +
-          [self.vc.CandidateBranch(), self.vc.MasterBranch()])
-      releases += self.GetReleasesFromBranch(self._options.branch)
-
-    self["releases"] = sorted(releases,
-                              key=lambda r: SortingKey(r["version"]),
-                              reverse=True)
-
-
-class UpdateChromiumCheckout(Step):
-  MESSAGE = "Update the chromium checkout."
-
-  def RunStep(self):
-    cwd = self._options.chromium
-    self.GitFetchOrigin("+refs/heads/*:refs/remotes/origin/*",
-                        "+refs/branch-heads/*:refs/remotes/branch-heads/*",
-                        cwd=cwd)
-    # Update v8 checkout in chromium.
-    self.GitFetchOrigin(cwd=os.path.join(cwd, "v8"))
-
-
-def ConvertToCommitNumber(step, revision):
-  # Simple check for git hashes.
-  if revision.isdigit() and len(revision) < 8:
-    return revision
-  return step.GetCommitPositionNumber(
-      revision, cwd=os.path.join(step._options.chromium, "v8"))
-
-
-class RetrieveChromiumV8Releases(Step):
-  MESSAGE = "Retrieve V8 releases from Chromium DEPS."
-
-  def RunStep(self):
-    cwd = self._options.chromium
-
-    # All v8 revisions we are interested in.
-    releases_dict = dict((r["revision_git"], r) for r in self["releases"])
-
-    cr_releases = []
-    count_past_last_v8 = 0
-    try:
-      for git_hash in self.GitLog(
-          format="%H", grep="V8", branch="origin/master",
-          path="DEPS", cwd=cwd).splitlines():
-        deps = self.GitShowFile(git_hash, "DEPS", cwd=cwd)
-        match = DEPS_RE.search(deps)
-        if match:
-          cr_rev = self.GetCommitPositionNumber(git_hash, cwd=cwd)
-          if cr_rev:
-            v8_hsh = match.group(1)
-            cr_releases.append([cr_rev, v8_hsh])
-
-          if count_past_last_v8:
-            count_past_last_v8 += 1  # pragma: no cover
-
-          if count_past_last_v8 > 20:
-            break  # pragma: no cover
-
-          # Stop as soon as we find a v8 revision that we didn't fetch in the
-          # v8-revision-retrieval part above (i.e. a revision that's too old).
-          # Just iterate a few more times in case there were reverts.
-          if v8_hsh not in releases_dict:
-            count_past_last_v8 += 1  # pragma: no cover
-
-    # Allow Ctrl-C interrupt.
-    except (KeyboardInterrupt, SystemExit):  # pragma: no cover
-      pass
-
-    # Add the chromium ranges to the v8 candidates and master releases.
-    all_ranges = BuildRevisionRanges(cr_releases)
-
-    for hsh, ranges in all_ranges.iteritems():
-      releases_dict.get(hsh, {})["chromium_revision"] = ranges
-
-
-# TODO(machenbach): Unify common code with method above.
-class RetrieveChromiumBranches(Step):
-  MESSAGE = "Retrieve Chromium branch information."
-
-  def RunStep(self):
-    cwd = self._options.chromium
-
-    # All v8 revisions we are interested in.
-    releases_dict = dict((r["revision_git"], r) for r in self["releases"])
-
-    # Filter out irrelevant branches.
-    branches = filter(lambda r: re.match(r"branch-heads/\d+", r),
-                      self.GitRemotes(cwd=cwd))
-
-    # Transform into pure branch numbers.
-    branches = map(lambda r: int(re.match(r"branch-heads/(\d+)", r).group(1)),
-                   branches)
-
-    branches = sorted(branches, reverse=True)
-
-    cr_branches = []
-    count_past_last_v8 = 0
-    try:
-      for branch in branches:
-        deps = self.GitShowFile(
-            "refs/branch-heads/%d" % branch, "DEPS", cwd=cwd)
-        match = DEPS_RE.search(deps)
-        if match:
-          v8_hsh = match.group(1)
-          cr_branches.append([str(branch), v8_hsh])
-
-          if count_past_last_v8:
-            count_past_last_v8 += 1  # pragma: no cover
-
-          if count_past_last_v8 > 20:
-            break  # pragma: no cover
-
-          # Stop as soon as we find a v8 revision that we didn't fetch in the
-          # v8-revision-retrieval part above (i.e. a revision that's too old).
-          # Just iterate a few more times in case there were reverts.
-          if v8_hsh not in releases_dict:
-            count_past_last_v8 += 1  # pragma: no cover
-
-    # Allow Ctrl-C interrupt.
-    except (KeyboardInterrupt, SystemExit):  # pragma: no cover
-      pass
-
-    # Add the chromium branches to the v8 candidate releases.
-    all_ranges = BuildRevisionRanges(cr_branches)
-    for revision, ranges in all_ranges.iteritems():
-      releases_dict.get(revision, {})["chromium_branch"] = ranges
-
-
-class RetrieveInformationOnChromeReleases(Step):
-  MESSAGE = 'Retrieves relevant information on the latest Chrome releases'
-
-  def Run(self):
-
-    params = None
-    result_raw = self.ReadURL(
-                             OMAHA_PROXY_URL + "all.json",
-                             params,
-                             wait_plan=[5, 20]
-                             )
-    recent_releases = json.loads(result_raw)
-
-    canaries = []
-
-    for current_os in recent_releases:
-      for current_version in current_os["versions"]:
-        if current_version["channel"] != "canary":
-          continue
-
-        current_candidate = self._CreateCandidate(current_version)
-        canaries.append(current_candidate)
-
-    chrome_releases = {"canaries": canaries}
-    self["chrome_releases"] = chrome_releases
-
-  def _GetGitHashForV8Version(self, v8_version):
-    if v8_version == "N/A":
-      return ""
-
-    real_v8_version = v8_version
-    if v8_version.split(".")[3]== "0":
-      real_v8_version = v8_version[:-2]
-
-    try:
-      return self.GitGetHashOfTag(real_v8_version)
-    except GitFailedException:
-      return ""
-
-  def _CreateCandidate(self, current_version):
-    params = None
-    url_to_call = (OMAHA_PROXY_URL + "v8.json?version="
-                   + current_version["previous_version"])
-    result_raw = self.ReadURL(
-                         url_to_call,
-                         params,
-                         wait_plan=[5, 20]
-                         )
-    previous_v8_version = json.loads(result_raw)["v8_version"]
-    v8_previous_version_hash = self._GetGitHashForV8Version(previous_v8_version)
-
-    current_v8_version = current_version["v8_version"]
-    v8_version_hash = self._GetGitHashForV8Version(current_v8_version)
-
-    current_candidate = {
-                        "chrome_version": current_version["version"],
-                        "os": current_version["os"],
-                        "release_date": current_version["current_reldate"],
-                        "v8_version": current_v8_version,
-                        "v8_version_hash": v8_version_hash,
-                        "v8_previous_version": previous_v8_version,
-                        "v8_previous_version_hash": v8_previous_version_hash,
-                       }
-    return current_candidate
-
-
-class CleanUp(Step):
-  MESSAGE = "Clean up."
-
-  def RunStep(self):
-    self.CommonCleanup()
-
-
-class WriteOutput(Step):
-  MESSAGE = "Print output."
-
-  def Run(self):
-
-    output = {
-              "releases": self["releases"],
-              "chrome_releases": self["chrome_releases"],
-              }
-
-    if self._options.csv:
-      with open(self._options.csv, "w") as f:
-        writer = csv.DictWriter(f,
-                                ["version", "branch", "revision",
-                                 "chromium_revision", "patches_merged"],
-                                restval="",
-                                extrasaction="ignore")
-        for release in self["releases"]:
-          writer.writerow(release)
-    if self._options.json:
-      with open(self._options.json, "w") as f:
-        f.write(json.dumps(output))
-    if not self._options.csv and not self._options.json:
-      print output  # pragma: no cover
-
-
-class Releases(ScriptsBase):
-  def _PrepareOptions(self, parser):
-    parser.add_argument("-b", "--branch", default="recent",
-                        help=("The branch to analyze. If 'all' is specified, "
-                              "analyze all branches. If 'recent' (default) "
-                              "is specified, track beta, stable and "
-                              "candidates."))
-    parser.add_argument("-c", "--chromium",
-                        help=("The path to your Chromium src/ "
-                              "directory to automate the V8 roll."))
-    parser.add_argument("--csv", help="Path to a CSV file for export.")
-    parser.add_argument("-m", "--max-releases", type=int, default=0,
-                        help="The maximum number of releases to track.")
-    parser.add_argument("--json", help="Path to a JSON file for export.")
-
-  def _ProcessOptions(self, options):  # pragma: no cover
-    options.force_readline_defaults = True
-    return True
-
-  def _Config(self):
-    return {
-      "BRANCHNAME": "retrieve-v8-releases",
-      "PERSISTFILE_BASENAME": "/tmp/v8-releases-tempfile",
-    }
-
-  def _Steps(self):
-
-    return [
-      Preparation,
-      RetrieveV8Releases,
-      UpdateChromiumCheckout,
-      RetrieveChromiumV8Releases,
-      RetrieveChromiumBranches,
-      RetrieveInformationOnChromeReleases,
-      CleanUp,
-      WriteOutput,
-    ]
-
-
-if __name__ == "__main__":  # pragma: no cover
-  sys.exit(Releases().Run())
diff --git a/src/v8/tools/release/update_node.py b/src/v8/tools/release/update_node.py
deleted file mode 100755
index d060e5c..0000000
--- a/src/v8/tools/release/update_node.py
+++ /dev/null
@@ -1,176 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2017 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-Use this script to update V8 in a Node.js checkout.
-
-Requirements:
-  - Node.js checkout in which V8 should be updated.
-  - V8 checkout at the commit to which Node.js should be updated.
-
-Usage:
-  $ update_node.py <path_to_v8> <path_to_node>
-
-  This will synchronize the content of <path_to_node>/deps/v8 with <path_to_v8>,
-  and a few V8 dependencies require in Node.js. It will also update .gitignore
-  appropriately.
-
-Optional flags:
-  --gclient     Run `gclient sync` on the V8 checkout before updating.
-  --commit      Create commit with the updated V8 in the Node.js checkout.
-  --with-patch  Also include currently staged files in the V8 checkout.
-"""
-
-import argparse
-import os
-import shutil
-import subprocess
-import sys
-import stat
-
-TARGET_SUBDIR = os.path.join("deps", "v8")
-
-SUB_REPOSITORIES = [ ["base", "trace_event", "common"],
-                     ["testing", "gtest"],
-                     ["third_party", "jinja2"],
-                     ["third_party", "markupsafe"] ]
-
-DELETE_FROM_GITIGNORE = [ "/base",
-                          "/testing/gtest",
-                          "/third_party/jinja2",
-                          "/third_party/markupsafe" ]
-
-# Node.js requires only a single header file from gtest to build V8.
-# Both jinja2 and markupsafe are required to generate part of the inspector.
-ADD_TO_GITIGNORE = [ "/testing/gtest/*",
-                     "!/testing/gtest/include",
-                     "/testing/gtest/include/*",
-                     "!/testing/gtest/include/gtest",
-                     "/testing/gtest/include/gtest/*",
-                     "!/testing/gtest/include/gtest/gtest_prod.h",
-                     "!/third_party/jinja2",
-                     "!/third_party/markupsafe" ]
-
-def RunGclient(path):
-  assert os.path.isdir(path)
-  print ">> Running gclient sync"
-  subprocess.check_call(["gclient", "sync", "--nohooks"], cwd=path)
-
-def UninitGit(path):
-  target = os.path.join(path, ".git")
-  if os.path.isdir(target):
-    print ">> Cleaning up %s" % path
-    def OnRmError(func, path, exec_info):
-      # This might happen on Windows
-      os.chmod(path, stat.S_IWRITE)
-      os.unlink(path)
-    shutil.rmtree(target, onerror=OnRmError)
-
-def CommitPatch(options):
-  """Makes a dummy commit for the changes in the index.
-
-  On trybots, bot_updated applies the patch to the index. We commit it to make
-  the fake git clone fetch it into node.js. We can leave the commit, as
-  bot_update will ensure a clean state on each run.
-  """
-  print ">> Committing patch"
-  subprocess.check_call(
-      ["git", "-c", "user.name=fake", "-c", "user.email=fake@chromium.org",
-       "commit", "--allow-empty", "-m", "placeholder-commit"],
-      cwd=options.v8_path,
-  )
-
-def UpdateTarget(repository, options):
-  source = os.path.join(options.v8_path, *repository)
-  target = os.path.join(options.node_path, TARGET_SUBDIR, *repository)
-  print ">> Updating target directory %s" % target
-  print ">>     from active branch at %s" % source
-  if not os.path.exists(target):
-    os.makedirs(target)
-  # Remove possible remnants of previous incomplete runs.
-  UninitGit(target)
-
-  git_commands = [
-    ["git", "init"],                             # initialize target repo
-    ["git", "remote", "add", "origin", source],  # point to the source repo
-    ["git", "fetch", "origin", "HEAD"],          # sync to the current branch
-    ["git", "reset", "--hard", "FETCH_HEAD"],    # reset to the current branch
-    ["git", "clean", "-fd"],                     # delete removed files
-  ]
-  try:
-    for command in git_commands:
-      subprocess.check_call(command, cwd=target)
-  except:
-    raise
-  finally:
-    UninitGit(target)
-
-def UpdateGitIgnore(options):
-  file_name = os.path.join(options.node_path, TARGET_SUBDIR, ".gitignore")
-  assert os.path.isfile(file_name)
-  print ">> Updating .gitignore with lines"
-  with open(file_name) as gitignore:
-    content = gitignore.readlines()
-  content = [x.strip() for x in content]
-  for x in DELETE_FROM_GITIGNORE:
-    if x in content:
-      print "- %s" % x
-      content.remove(x)
-  for x in ADD_TO_GITIGNORE:
-    if x not in content:
-      print "+ %s" % x
-      content.append(x)
-  content.sort(key=lambda x: x[1:] if x.startswith("!") else x)
-  with open(file_name, "w") as gitignore:
-    for x in content:
-      gitignore.write("%s\n" % x)
-
-def CreateCommit(options):
-  print ">> Creating commit."
-  # Find git hash from source.
-  githash = subprocess.check_output(["git", "rev-parse", "--short", "HEAD"],
-                                    cwd=options.v8_path).strip()
-  # Create commit at target.
-  git_commands = [
-    ["git", "checkout", "-b", "update_v8_to_%s" % githash],  # new branch
-    ["git", "add", "."],                                     # add files
-    ["git", "commit", "-m", "Update V8 to %s" % githash]     # new commit
-  ]
-  for command in git_commands:
-    subprocess.check_call(command, cwd=options.node_path)
-
-def ParseOptions(args):
-  parser = argparse.ArgumentParser(description="Update V8 in Node.js")
-  parser.add_argument("v8_path", help="Path to V8 checkout")
-  parser.add_argument("node_path", help="Path to Node.js checkout")
-  parser.add_argument("--gclient", action="store_true", help="Run gclient sync")
-  parser.add_argument("--commit", action="store_true", help="Create commit")
-  parser.add_argument("--with-patch", action="store_true",
-                      help="Apply also staged files")
-  options = parser.parse_args(args)
-  assert os.path.isdir(options.v8_path)
-  options.v8_path = os.path.abspath(options.v8_path)
-  assert os.path.isdir(options.node_path)
-  options.node_path = os.path.abspath(options.node_path)
-  return options
-
-def Main(args):
-  options = ParseOptions(args)
-  if options.gclient:
-    RunGclient(options.v8_path)
-  # Commit patch on trybots to main V8 repository.
-  if options.with_patch:
-    CommitPatch(options)
-  # Update main V8 repository.
-  UpdateTarget([""], options)
-  # Patch .gitignore before updating sub-repositories.
-  UpdateGitIgnore(options)
-  for repo in SUB_REPOSITORIES:
-    UpdateTarget(repo, options)
-  if options.commit:
-    CreateCommit(options)
-
-if __name__ == "__main__":
-  Main(sys.argv[1:])
diff --git a/src/v8/tools/run-deopt-fuzzer.gyp b/src/v8/tools/run-deopt-fuzzer.gyp
deleted file mode 100644
index 9eb6b53..0000000
--- a/src/v8/tools/run-deopt-fuzzer.gyp
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2016 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'conditions': [
-    ['test_isolation_mode != "noop"', {
-      'targets': [
-        {
-          'target_name': 'run_deopt_fuzzer_run',
-          'type': 'none',
-          'dependencies': [
-            '../src/d8.gyp:d8_run',
-          ],
-          'includes': [
-            '../gypfiles/features.gypi',
-            '../gypfiles/isolate.gypi',
-          ],
-          'sources': [
-            'run-deopt-fuzzer.isolate',
-          ],
-        },
-      ],
-    }],
-  ],
-}
diff --git a/src/v8/tools/run-deopt-fuzzer.isolate b/src/v8/tools/run-deopt-fuzzer.isolate
deleted file mode 100644
index 196fb5d..0000000
--- a/src/v8/tools/run-deopt-fuzzer.isolate
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright 2016 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'variables': {
-    'command': [
-      'run-deopt-fuzzer.py',
-    ],
-    'files': [
-      'run-deopt-fuzzer.py',
-    ],
-  },
-  'includes': [
-    'testrunner/testrunner.isolate',
-    '../src/d8.isolate',
-    '../test/mjsunit/mjsunit.isolate',
-    '../test/webkit/webkit.isolate',
-  ],
-}
diff --git a/src/v8/tools/run-deopt-fuzzer.py b/src/v8/tools/run-deopt-fuzzer.py
deleted file mode 100755
index ac2344b..0000000
--- a/src/v8/tools/run-deopt-fuzzer.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2017 the V8 project 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 sys
-
-from testrunner import deopt_fuzzer
-
-
-if __name__ == "__main__":
-  sys.exit(deopt_fuzzer.DeoptFuzzer().execute())
diff --git a/src/v8/tools/run-gc-fuzzer.py b/src/v8/tools/run-gc-fuzzer.py
deleted file mode 100755
index 6311d4f..0000000
--- a/src/v8/tools/run-gc-fuzzer.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2017 the V8 project 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 sys
-
-from testrunner import gc_fuzzer
-
-
-if __name__ == "__main__":
-  sys.exit(gc_fuzzer.GCFuzzer().execute())
diff --git a/src/v8/tools/run-num-fuzzer.gyp b/src/v8/tools/run-num-fuzzer.gyp
deleted file mode 100644
index bd3b9d6..0000000
--- a/src/v8/tools/run-num-fuzzer.gyp
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2017 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'conditions': [
-    ['test_isolation_mode != "noop"', {
-      'targets': [
-        {
-          'target_name': 'run_num_fuzzer_run',
-          'type': 'none',
-          'dependencies': [
-            '../src/d8.gyp:d8_run',
-          ],
-          'includes': [
-            '../gypfiles/features.gypi',
-            '../gypfiles/isolate.gypi',
-          ],
-          'sources': [
-            'run-num-fuzzer.isolate',
-          ],
-        },
-      ],
-    }],
-  ],
-}
diff --git a/src/v8/tools/run-num-fuzzer.isolate b/src/v8/tools/run-num-fuzzer.isolate
deleted file mode 100644
index d0aca42..0000000
--- a/src/v8/tools/run-num-fuzzer.isolate
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright 2017 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'variables': {
-    'command': [
-      'run-deopt-fuzzer.py',
-    ],
-    'files': [
-      'run-deopt-fuzzer.py',
-      'run-gc-fuzzer.py',
-    ],
-  },
-  'includes': [
-    'testrunner/testrunner.isolate',
-    '../src/d8.isolate',
-    '../test/benchmarks/benchmarks.isolate',
-    '../test/mjsunit/mjsunit.isolate',
-    '../test/webkit/webkit.isolate',
-  ],
-}
diff --git a/src/v8/tools/testrunner/deopt_fuzzer.py b/src/v8/tools/testrunner/deopt_fuzzer.py
deleted file mode 100755
index 5e6b79f..0000000
--- a/src/v8/tools/testrunner/deopt_fuzzer.py
+++ /dev/null
@@ -1,336 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2017 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-
-from os.path import join
-import json
-import math
-import multiprocessing
-import os
-import random
-import shlex
-import sys
-import time
-
-# Adds testrunner to the path hence it has to be imported at the beggining.
-import base_runner
-
-from testrunner.local import execution
-from testrunner.local import progress
-from testrunner.local import testsuite
-from testrunner.local import utils
-from testrunner.local import verbose
-from testrunner.objects import context
-
-
-DEFAULT_SUITES = ["mjsunit", "webkit"]
-TIMEOUT_DEFAULT = 60
-
-# Double the timeout for these:
-SLOW_ARCHS = ["arm",
-              "mipsel"]
-MAX_DEOPT = 1000000000
-DISTRIBUTION_MODES = ["smooth", "random"]
-
-
-class DeoptFuzzer(base_runner.BaseTestRunner):
-  def __init__(self, *args, **kwargs):
-    super(DeoptFuzzer, self).__init__(*args, **kwargs)
-
-  class RandomDistribution:
-    def __init__(self, seed=None):
-      seed = seed or random.randint(1, sys.maxint)
-      print "Using random distribution with seed %d" % seed
-      self._random = random.Random(seed)
-
-    def Distribute(self, n, m):
-      if n > m:
-        n = m
-      return self._random.sample(xrange(1, m + 1), n)
-
-  class SmoothDistribution:
-    """Distribute n numbers into the interval [1:m].
-    F1: Factor of the first derivation of the distribution function.
-    F2: Factor of the second derivation of the distribution function.
-    With F1 and F2 set to 0, the distribution will be equal.
-    """
-    def __init__(self, factor1=2.0, factor2=0.2):
-      self._factor1 = factor1
-      self._factor2 = factor2
-
-    def Distribute(self, n, m):
-      if n > m:
-        n = m
-      if n <= 1:
-        return [ 1 ]
-
-      result = []
-      x = 0.0
-      dx = 1.0
-      ddx = self._factor1
-      dddx = self._factor2
-      for i in range(0, n):
-        result += [ x ]
-        x += dx
-        dx += ddx
-        ddx += dddx
-
-      # Project the distribution into the interval [0:M].
-      result = [ x * m / result[-1] for x in result ]
-
-      # Equalize by n. The closer n is to m, the more equal will be the
-      # distribution.
-      for (i, x) in enumerate(result):
-        # The value of x if it was equally distributed.
-        equal_x = i / float(n - 1) * float(m - 1) + 1
-
-        # Difference factor between actual and equal distribution.
-        diff = 1 - (x / equal_x)
-
-        # Equalize x dependent on the number of values to distribute.
-        result[i] = int(x + (i + 1) * diff)
-      return result
-
-
-  def _distribution(self, options):
-    if options.distribution_mode == "random":
-      return self.RandomDistribution(options.seed)
-    if options.distribution_mode == "smooth":
-      return self.SmoothDistribution(options.distribution_factor1,
-                                     options.distribution_factor2)
-
-
-  def _add_parser_options(self, parser):
-    parser.add_option("--command-prefix",
-                      help="Prepended to each shell command used to run a test",
-                      default="")
-    parser.add_option("--coverage", help=("Exponential test coverage "
-                      "(range 0.0, 1.0) - 0.0: one test, 1.0 all tests (slow)"),
-                      default=0.4, type="float")
-    parser.add_option("--coverage-lift", help=("Lifts test coverage for tests "
-                      "with a small number of deopt points (range 0, inf)"),
-                      default=20, type="int")
-    parser.add_option("--distribution-factor1", help=("Factor of the first "
-                      "derivation of the distribution function"), default=2.0,
-                      type="float")
-    parser.add_option("--distribution-factor2", help=("Factor of the second "
-                      "derivation of the distribution function"), default=0.7,
-                      type="float")
-    parser.add_option("--distribution-mode", help=("How to select deopt points "
-                      "for a given test (smooth|random)"),
-                      default="smooth")
-    parser.add_option("--dump-results-file", help=("Dump maximum number of "
-                      "deopt points per test to a file"))
-    parser.add_option("--extra-flags",
-                      help="Additional flags to pass to each test command",
-                      default="")
-    parser.add_option("--isolates", help="Whether to test isolates",
-                      default=False, action="store_true")
-    parser.add_option("-j", help="The number of parallel tasks to run",
-                      default=0, type="int")
-    parser.add_option("-p", "--progress",
-                      help=("The style of progress indicator"
-                            " (verbose, dots, color, mono)"),
-                      choices=progress.PROGRESS_INDICATORS.keys(),
-                      default="mono")
-    parser.add_option("--seed", help="The seed for the random distribution",
-                      type="int")
-    parser.add_option("-t", "--timeout", help="Timeout in seconds",
-                      default= -1, type="int")
-    parser.add_option("--random-seed", default=0, dest="random_seed",
-                      help="Default seed for initializing random generator")
-    parser.add_option("--fuzzer-random-seed", default=0,
-                      help="Default seed for initializing fuzzer random "
-                      "generator")
-    return parser
-
-
-  def _process_options(self, options):
-    # Special processing of other options, sorted alphabetically.
-    options.command_prefix = shlex.split(options.command_prefix)
-    options.extra_flags = shlex.split(options.extra_flags)
-    if options.j == 0:
-      options.j = multiprocessing.cpu_count()
-    while options.random_seed == 0:
-      options.random_seed = random.SystemRandom().randint(-2147483648,
-                                                          2147483647)
-    if not options.distribution_mode in DISTRIBUTION_MODES:
-      print "Unknown distribution mode %s" % options.distribution_mode
-      return False
-    if options.distribution_factor1 < 0.0:
-      print ("Distribution factor1 %s is out of range. Defaulting to 0.0"
-          % options.distribution_factor1)
-      options.distribution_factor1 = 0.0
-    if options.distribution_factor2 < 0.0:
-      print ("Distribution factor2 %s is out of range. Defaulting to 0.0"
-          % options.distribution_factor2)
-      options.distribution_factor2 = 0.0
-    if options.coverage < 0.0 or options.coverage > 1.0:
-      print ("Coverage %s is out of range. Defaulting to 0.4"
-          % options.coverage)
-      options.coverage = 0.4
-    if options.coverage_lift < 0:
-      print ("Coverage lift %s is out of range. Defaulting to 0"
-          % options.coverage_lift)
-      options.coverage_lift = 0
-    return True
-
-  def _calculate_n_tests(self, m, options):
-    """Calculates the number of tests from m deopt points with exponential
-    coverage.
-    The coverage is expected to be between 0.0 and 1.0.
-    The 'coverage lift' lifts the coverage for tests with smaller m values.
-    """
-    c = float(options.coverage)
-    l = float(options.coverage_lift)
-    return int(math.pow(m, (m * c + l) / (m + l)))
-
-  def _get_default_suite_names(self):
-    return DEFAULT_SUITES
-
-  def _do_execute(self, suites, args, options):
-    print(">>> Running tests for %s.%s" % (self.build_config.arch,
-                                           self.mode_name))
-
-    dist = self._distribution(options)
-
-    # Populate context object.
-    timeout = options.timeout
-    if timeout == -1:
-      # Simulators are slow, therefore allow a longer default timeout.
-      if self.build_config.arch in SLOW_ARCHS:
-        timeout = 2 * TIMEOUT_DEFAULT;
-      else:
-        timeout = TIMEOUT_DEFAULT;
-
-    timeout *= self.mode_options.timeout_scalefactor
-    ctx = context.Context(self.build_config.arch,
-                          self.mode_options.execution_mode,
-                          self.outdir,
-                          self.mode_options.flags, options.verbose,
-                          timeout, options.isolates,
-                          options.command_prefix,
-                          options.extra_flags,
-                          False,  # Keep i18n on by default.
-                          options.random_seed,
-                          True,  # No sorting of test cases.
-                          0,  # Don't rerun failing tests.
-                          0,  # No use of a rerun-failing-tests maximum.
-                          False,  # No no_harness mode.
-                          False,  # Don't use perf data.
-                          False)  # Coverage not supported.
-
-    # Find available test suites and read test cases from them.
-    variables = {
-      "arch": self.build_config.arch,
-      "asan": self.build_config.asan,
-      "byteorder": sys.byteorder,
-      "dcheck_always_on": self.build_config.dcheck_always_on,
-      "deopt_fuzzer": True,
-      "gc_fuzzer": False,
-      "gc_stress": False,
-      "gcov_coverage": self.build_config.gcov_coverage,
-      "isolates": options.isolates,
-      "mode": self.mode_options.status_mode,
-      "msan": self.build_config.msan,
-      "no_harness": False,
-      "no_i18n": self.build_config.no_i18n,
-      "no_snap": self.build_config.no_snap,
-      "novfp3": False,
-      "predictable": self.build_config.predictable,
-      "simulator": utils.UseSimulator(self.build_config.arch),
-      "simulator_run": False,
-      "system": utils.GuessOS(),
-      "tsan": self.build_config.tsan,
-      "ubsan_vptr": self.build_config.ubsan_vptr,
-    }
-    num_tests = 0
-    test_id = 0
-
-    # Remember test case prototypes for the fuzzing phase.
-    test_backup = dict((s, []) for s in suites)
-
-    for s in suites:
-      s.ReadStatusFile(variables)
-      s.ReadTestCases(ctx)
-      if len(args) > 0:
-        s.FilterTestCasesByArgs(args)
-      s.FilterTestCasesByStatus(False)
-
-      test_backup[s] = s.tests
-      analysis_flags = ["--deopt-every-n-times", "%d" % MAX_DEOPT,
-                        "--print-deopt-stress"]
-      s.tests = [t.create_variant(t.variant, analysis_flags, 'analysis')
-                 for t in s.tests]
-      num_tests += len(s.tests)
-      for t in s.tests:
-        t.id = test_id
-        t.cmd = t.get_command(ctx)
-        test_id += 1
-
-    if num_tests == 0:
-      print "No tests to run."
-      return 0
-
-    print(">>> Collection phase")
-    progress_indicator = progress.PROGRESS_INDICATORS[options.progress]()
-    runner = execution.Runner(suites, progress_indicator, ctx)
-
-    exit_code = runner.Run(options.j)
-
-    print(">>> Analysis phase")
-    num_tests = 0
-    test_id = 0
-    for s in suites:
-      test_results = {}
-      for t in s.tests:
-        for line in runner.outputs[t].stdout.splitlines():
-          if line.startswith("=== Stress deopt counter: "):
-            test_results[t.path] = MAX_DEOPT - int(line.split(" ")[-1])
-      for t in s.tests:
-        if t.path not in test_results:
-          print "Missing results for %s" % t.path
-      if options.dump_results_file:
-        results_dict = dict((t.path, n) for (t, n) in test_results.iteritems())
-        with file("%s.%d.txt" % (options.dump_results_file, time.time()),
-                  "w") as f:
-          f.write(json.dumps(results_dict))
-
-      # Reset tests and redistribute the prototypes from the collection phase.
-      s.tests = []
-      if options.verbose:
-        print "Test distributions:"
-      for t in test_backup[s]:
-        max_deopt = test_results.get(t.path, 0)
-        if max_deopt == 0:
-          continue
-        n_deopt = self._calculate_n_tests(max_deopt, options)
-        distribution = dist.Distribute(n_deopt, max_deopt)
-        if options.verbose:
-          print "%s %s" % (t.path, distribution)
-        for n, d in enumerate(distribution):
-          fuzzing_flags = ["--deopt-every-n-times", "%d" % d]
-          s.tests.append(t.create_variant(t.variant, fuzzing_flags, n))
-      num_tests += len(s.tests)
-      for t in s.tests:
-        t.id = test_id
-        t.cmd = t.get_command(ctx)
-        test_id += 1
-
-    if num_tests == 0:
-      print "No tests to run."
-      return exit_code
-
-    print(">>> Deopt fuzzing phase (%d test cases)" % num_tests)
-    progress_indicator = progress.PROGRESS_INDICATORS[options.progress]()
-    runner = execution.Runner(suites, progress_indicator, ctx)
-
-    code = runner.Run(options.j)
-    return exit_code or code
-
-
-if __name__ == '__main__':
-  sys.exit(DeoptFuzzer().execute())
diff --git a/src/v8/tools/testrunner/gc_fuzzer.py b/src/v8/tools/testrunner/gc_fuzzer.py
deleted file mode 100755
index 18be227..0000000
--- a/src/v8/tools/testrunner/gc_fuzzer.py
+++ /dev/null
@@ -1,280 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2017 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-
-from os.path import join
-import itertools
-import json
-import math
-import multiprocessing
-import os
-import random
-import shlex
-import sys
-import time
-
-# Adds testrunner to the path hence it has to be imported at the beggining.
-import base_runner
-
-from testrunner.local import execution
-from testrunner.local import progress
-from testrunner.local import testsuite
-from testrunner.local import utils
-from testrunner.local import verbose
-from testrunner.objects import context
-
-
-DEFAULT_SUITES = ["mjsunit", "webkit", "benchmarks"]
-TIMEOUT_DEFAULT = 60
-
-# Double the timeout for these:
-SLOW_ARCHS = ["arm",
-              "mipsel"]
-
-
-class GCFuzzer(base_runner.BaseTestRunner):
-  def __init__(self, *args, **kwargs):
-    super(GCFuzzer, self).__init__(*args, **kwargs)
-
-    self.fuzzer_rng = None
-
-  def _add_parser_options(self, parser):
-    parser.add_option("--command-prefix",
-                      help="Prepended to each shell command used to run a test",
-                      default="")
-    parser.add_option("--coverage", help=("Exponential test coverage "
-                      "(range 0.0, 1.0) - 0.0: one test, 1.0 all tests (slow)"),
-                      default=0.4, type="float")
-    parser.add_option("--coverage-lift", help=("Lifts test coverage for tests "
-                      "with a low memory size reached (range 0, inf)"),
-                      default=20, type="int")
-    parser.add_option("--dump-results-file", help="Dump maximum limit reached")
-    parser.add_option("--extra-flags",
-                      help="Additional flags to pass to each test command",
-                      default="")
-    parser.add_option("--isolates", help="Whether to test isolates",
-                      default=False, action="store_true")
-    parser.add_option("-j", help="The number of parallel tasks to run",
-                      default=0, type="int")
-    parser.add_option("-p", "--progress",
-                      help=("The style of progress indicator"
-                            " (verbose, dots, color, mono)"),
-                      choices=progress.PROGRESS_INDICATORS.keys(),
-                      default="mono")
-    parser.add_option("-t", "--timeout", help="Timeout in seconds",
-                      default= -1, type="int")
-    parser.add_option("--random-seed", default=0,
-                      help="Default seed for initializing random generator")
-    parser.add_option("--fuzzer-random-seed", default=0,
-                      help="Default seed for initializing fuzzer random "
-                      "generator")
-    parser.add_option("--stress-compaction", default=False, action="store_true",
-                      help="Enable stress_compaction_percentage flag")
-
-    parser.add_option("--distribution-factor1", help="DEPRECATED")
-    parser.add_option("--distribution-factor2", help="DEPRECATED")
-    parser.add_option("--distribution-mode", help="DEPRECATED")
-    parser.add_option("--seed", help="DEPRECATED")
-    return parser
-
-
-  def _process_options(self, options):
-    # Special processing of other options, sorted alphabetically.
-    options.command_prefix = shlex.split(options.command_prefix)
-    options.extra_flags = shlex.split(options.extra_flags)
-    if options.j == 0:
-      options.j = multiprocessing.cpu_count()
-    while options.random_seed == 0:
-      options.random_seed = random.SystemRandom().randint(-2147483648,
-                                                          2147483647)
-    while options.fuzzer_random_seed == 0:
-      options.fuzzer_random_seed = random.SystemRandom().randint(-2147483648,
-                                                                 2147483647)
-    self.fuzzer_rng = random.Random(options.fuzzer_random_seed)
-    return True
-
-  def _calculate_n_tests(self, m, options):
-    """Calculates the number of tests from m points with exponential coverage.
-    The coverage is expected to be between 0.0 and 1.0.
-    The 'coverage lift' lifts the coverage for tests with smaller m values.
-    """
-    c = float(options.coverage)
-    l = float(options.coverage_lift)
-    return int(math.pow(m, (m * c + l) / (m + l)))
-
-  def _get_default_suite_names(self):
-    return DEFAULT_SUITES
-
-  def _do_execute(self, suites, args, options):
-    print(">>> Running tests for %s.%s" % (self.build_config.arch,
-                                           self.mode_name))
-
-    # Populate context object.
-    timeout = options.timeout
-    if timeout == -1:
-      # Simulators are slow, therefore allow a longer default timeout.
-      if self.build_config.arch in SLOW_ARCHS:
-        timeout = 2 * TIMEOUT_DEFAULT;
-      else:
-        timeout = TIMEOUT_DEFAULT;
-
-    timeout *= self.mode_options.timeout_scalefactor
-    ctx = context.Context(self.build_config.arch,
-                          self.mode_options.execution_mode,
-                          self.outdir,
-                          self.mode_options.flags, options.verbose,
-                          timeout, options.isolates,
-                          options.command_prefix,
-                          options.extra_flags,
-                          False,  # Keep i18n on by default.
-                          options.random_seed,
-                          True,  # No sorting of test cases.
-                          0,  # Don't rerun failing tests.
-                          0,  # No use of a rerun-failing-tests maximum.
-                          False,  # No no_harness mode.
-                          False,  # Don't use perf data.
-                          False)  # Coverage not supported.
-
-    num_tests = self._load_tests(args, options, suites, ctx)
-    if num_tests == 0:
-      print "No tests to run."
-      return 0
-
-    test_backup = dict(map(lambda s: (s, s.tests), suites))
-
-    print('>>> Collection phase')
-    for s in suites:
-      analysis_flags = ['--fuzzer-gc-analysis']
-      s.tests = map(lambda t: t.create_variant(t.variant, analysis_flags,
-                                               'analysis'),
-                    s.tests)
-      for t in s.tests:
-        t.cmd = t.get_command(ctx)
-
-    progress_indicator = progress.PROGRESS_INDICATORS[options.progress]()
-    runner = execution.Runner(suites, progress_indicator, ctx)
-    exit_code = runner.Run(options.j)
-
-    print('>>> Analysis phase')
-    test_results = dict()
-    for s in suites:
-      for t in s.tests:
-        # Skip failed tests.
-        if t.output_proc.has_unexpected_output(runner.outputs[t]):
-          print '%s failed, skipping' % t.path
-          continue
-        max_limit = self._get_max_limit_reached(runner.outputs[t])
-        if max_limit:
-          test_results[t.path] = max_limit
-
-    runner = None
-
-    if options.dump_results_file:
-      with file("%s.%d.txt" % (options.dump_results_file, time.time()),
-                "w") as f:
-        f.write(json.dumps(test_results))
-
-    num_tests = 0
-    for s in suites:
-      s.tests = []
-      for t in test_backup[s]:
-        max_percent = test_results.get(t.path, 0)
-        if not max_percent or max_percent < 1.0:
-          continue
-        max_percent = int(max_percent)
-
-        subtests_count = self._calculate_n_tests(max_percent, options)
-
-        if options.verbose:
-          print ('%s [x%d] (max marking limit=%.02f)' %
-                 (t.path, subtests_count, max_percent))
-        for i in xrange(0, subtests_count):
-          fuzzer_seed = self._next_fuzzer_seed()
-          fuzzing_flags = [
-            '--stress_marking', str(max_percent),
-            '--fuzzer_random_seed', str(fuzzer_seed),
-          ]
-          if options.stress_compaction:
-            fuzzing_flags.append('--stress_compaction_random')
-          s.tests.append(t.create_variant(t.variant, fuzzing_flags, i))
-      for t in s.tests:
-        t.cmd = t.get_command(ctx)
-      num_tests += len(s.tests)
-
-    if num_tests == 0:
-      print "No tests to run."
-      return exit_code
-
-    print(">>> Fuzzing phase (%d test cases)" % num_tests)
-    progress_indicator = progress.PROGRESS_INDICATORS[options.progress]()
-    runner = execution.Runner(suites, progress_indicator, ctx)
-
-    return runner.Run(options.j) or exit_code
-
-  def _load_tests(self, args, options, suites, ctx):
-    # Find available test suites and read test cases from them.
-    variables = {
-      "arch": self.build_config.arch,
-      "asan": self.build_config.asan,
-      "byteorder": sys.byteorder,
-      "dcheck_always_on": self.build_config.dcheck_always_on,
-      "deopt_fuzzer": False,
-      "gc_fuzzer": True,
-      "gc_stress": False,
-      "gcov_coverage": self.build_config.gcov_coverage,
-      "isolates": options.isolates,
-      "mode": self.mode_options.status_mode,
-      "msan": self.build_config.msan,
-      "no_harness": False,
-      "no_i18n": self.build_config.no_i18n,
-      "no_snap": self.build_config.no_snap,
-      "novfp3": False,
-      "predictable": self.build_config.predictable,
-      "simulator": utils.UseSimulator(self.build_config.arch),
-      "simulator_run": False,
-      "system": utils.GuessOS(),
-      "tsan": self.build_config.tsan,
-      "ubsan_vptr": self.build_config.ubsan_vptr,
-    }
-
-    num_tests = 0
-    test_id = 0
-    for s in suites:
-      s.ReadStatusFile(variables)
-      s.ReadTestCases(ctx)
-      if len(args) > 0:
-        s.FilterTestCasesByArgs(args)
-      s.FilterTestCasesByStatus(False)
-
-      num_tests += len(s.tests)
-      for t in s.tests:
-        t.id = test_id
-        test_id += 1
-
-    return num_tests
-
-  # Parses test stdout and returns what was the highest reached percent of the
-  # incremental marking limit (0-100).
-  @staticmethod
-  def _get_max_limit_reached(output):
-    if not output.stdout:
-      return None
-
-    for l in reversed(output.stdout.splitlines()):
-      if l.startswith('### Maximum marking limit reached ='):
-        return float(l.split()[6])
-
-    return None
-
-  def _next_fuzzer_seed(self):
-    fuzzer_seed = None
-    while not fuzzer_seed:
-      fuzzer_seed = self.fuzzer_rng.randint(-2147483648, 2147483647)
-    return fuzzer_seed
-
-
-if __name__ == '__main__':
-  sys.exit(GCFuzzer().execute())
diff --git a/src/v8/tools/testrunner/local/execution.py b/src/v8/tools/testrunner/local/execution.py
deleted file mode 100644
index d6d0725..0000000
--- a/src/v8/tools/testrunner/local/execution.py
+++ /dev/null
@@ -1,293 +0,0 @@
-# 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.
-
-
-import collections
-import os
-import re
-import shutil
-import sys
-import traceback
-
-from . import command
-from . import perfdata
-from . import statusfile
-from . import utils
-from . pool import Pool
-from ..objects import predictable
-
-
-# Base dir of the v8 checkout.
-BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(
-    os.path.abspath(__file__)))))
-TEST_DIR = os.path.join(BASE_DIR, "test")
-
-
-# Structure that keeps global information per worker process.
-ProcessContext = collections.namedtuple(
-    'process_context', ['sancov_dir'])
-
-
-TestJobResult = collections.namedtuple(
-    'TestJobResult', ['id', 'outproc_result'])
-
-def MakeProcessContext(sancov_dir):
-  return ProcessContext(sancov_dir)
-
-
-# Global function for multiprocessing, because pickling a static method doesn't
-# work on Windows.
-def run_job(job, process_context):
-  return job.run(process_context)
-
-
-class Job(object):
-  """Stores data to be sent over the multi-process boundary.
-
-  All contained fields will be pickled/unpickled.
-  """
-
-  def run(self, process_context):
-    raise NotImplementedError()
-
-
-class TestJob(Job):
-  def __init__(self, test_id, cmd, outproc, run_num):
-    self.test_id = test_id
-    self.cmd = cmd
-    self.outproc = outproc
-    self.run_num = run_num
-
-  def _rename_coverage_data(self, out, sancov_dir):
-    """Rename coverage data.
-
-    Rename files with PIDs to files with unique test IDs, because the number
-    of tests might be higher than pid_max. E.g.:
-    d8.1234.sancov -> d8.test.42.1.sancov, where 1234 was the process' PID,
-    42 is the test ID and 1 is the attempt (the same test might be rerun on
-    failures).
-    """
-    if sancov_dir and out.pid is not None:
-      # Doesn't work on windows so basename is sufficient to get the shell name.
-      shell = os.path.basename(self.cmd.shell)
-      sancov_file = os.path.join(sancov_dir, "%s.%d.sancov" % (shell, out.pid))
-
-      # Some tests are expected to fail and don't produce coverage data.
-      if os.path.exists(sancov_file):
-        parts = sancov_file.split(".")
-        new_sancov_file = ".".join(
-            parts[:-2] +
-            ["test", str(self.test_id), str(self.run_num)] +
-            parts[-1:]
-        )
-        assert not os.path.exists(new_sancov_file)
-        os.rename(sancov_file, new_sancov_file)
-
-  def run(self, context):
-    output = self.cmd.execute()
-    self._rename_coverage_data(output, context.sancov_dir)
-    return TestJobResult(self.test_id, self.outproc.process(output))
-
-
-class Runner(object):
-
-  def __init__(self, suites, progress_indicator, context, outproc_factory=None):
-    self.datapath = os.path.join("out", "testrunner_data")
-    self.perf_data_manager = perfdata.GetPerfDataManager(
-        context, self.datapath)
-    self.perfdata = self.perf_data_manager.GetStore(context.arch, context.mode)
-    self.perf_failures = False
-    self.printed_allocations = False
-    self.outproc_factory = outproc_factory or (lambda test: test.output_proc)
-    self.tests = [t for s in suites for t in s.tests]
-
-    # TODO(majeski): Pass dynamically instead of keeping them in the runner.
-    # Maybe some observer?
-    self.outputs = {t: None for t in self.tests}
-
-    self.suite_names = [s.name for s in suites]
-
-    # Always pre-sort by status file, slowest tests first.
-    self.tests.sort(key=lambda t: t.is_slow, reverse=True)
-
-    # Sort by stored duration if not opted out.
-    if not context.no_sorting:
-      self.tests.sort(key=lambda t: self.perfdata.FetchPerfData(t) or 1.0,
-                      reverse=True)
-
-    self._CommonInit(suites, progress_indicator, context)
-
-  def _CommonInit(self, suites, progress_indicator, context):
-    self.total = 0
-    for s in suites:
-      for t in s.tests:
-        t.id = self.total
-        self.total += 1
-    self.indicator = progress_indicator
-    progress_indicator.SetRunner(self)
-    self.context = context
-    self.succeeded = 0
-    self.remaining = self.total
-    self.failed = []
-    self.crashed = 0
-    self.reran_tests = 0
-
-  def _RunPerfSafe(self, fun):
-    try:
-      fun()
-    except Exception, e:
-      print("PerfData exception: %s" % e)
-      self.perf_failures = True
-
-  def _MaybeRerun(self, pool, test, result):
-    if test.run <= self.context.rerun_failures_count:
-      # Possibly rerun this test if its run count is below the maximum per
-      # test. <= as the flag controls reruns not including the first run.
-      if test.run == 1:
-        # Count the overall number of reran tests on the first rerun.
-        if self.reran_tests < self.context.rerun_failures_max:
-          self.reran_tests += 1
-        else:
-          # Don't rerun this if the overall number of rerun tests has been
-          # reached.
-          return
-      if (test.run >= 2 and
-          result.output.duration > self.context.timeout / 20.0):
-        # Rerun slow tests at most once.
-        return
-
-      # Rerun this test.
-      test.run += 1
-      pool.add([
-          TestJob(test.id, test.cmd, self.outproc_factory(test), test.run)
-      ])
-      self.remaining += 1
-      self.total += 1
-
-  def _ProcessTest(self, test, result, pool):
-    self.outputs[test] = result.output
-    has_unexpected_output = result.has_unexpected_output
-    if has_unexpected_output:
-      self.failed.append(test)
-      if result.output.HasCrashed():
-        self.crashed += 1
-    else:
-      self.succeeded += 1
-    self.remaining -= 1
-    # For the indicator, everything that happens after the first run is treated
-    # as unexpected even if it flakily passes in order to include it in the
-    # output.
-    self.indicator.HasRun(test, result.output,
-                          has_unexpected_output or test.run > 1)
-    if has_unexpected_output:
-      # Rerun test failures after the indicator has processed the results.
-      self._VerbosePrint("Attempting to rerun test after failure.")
-      self._MaybeRerun(pool, test, result)
-    # Update the perf database if the test succeeded.
-    return not has_unexpected_output
-
-  def Run(self, jobs):
-    self.indicator.Starting()
-    self._RunInternal(jobs)
-    self.indicator.Done()
-    if self.failed:
-      return 1
-    elif self.remaining:
-      return 2
-    return 0
-
-  def _RunInternal(self, jobs):
-    pool = Pool(jobs)
-    test_map = {}
-    queued_exception = [None]
-    def gen_tests():
-      for test in self.tests:
-        assert test.id >= 0
-        test_map[test.id] = test
-        try:
-          yield [
-              TestJob(test.id, test.cmd, self.outproc_factory(test), test.run)
-          ]
-        except Exception, e:
-          # If this failed, save the exception and re-raise it later (after
-          # all other tests have had a chance to run).
-          queued_exception[0] = e, traceback.format_exc()
-          continue
-    try:
-      it = pool.imap_unordered(
-          fn=run_job,
-          gen=gen_tests(),
-          process_context_fn=MakeProcessContext,
-          process_context_args=[self.context.sancov_dir],
-      )
-      for result in it:
-        if result.heartbeat:
-          self.indicator.Heartbeat()
-          continue
-
-        job_result = result.value
-        test_id = job_result.id
-        outproc_result = job_result.outproc_result
-
-        test = test_map[test_id]
-        update_perf = self._ProcessTest(test, outproc_result, pool)
-        if update_perf:
-          self._RunPerfSafe(lambda: self.perfdata.UpdatePerfData(
-              test, outproc_result.output.duration))
-    except KeyboardInterrupt:
-      raise
-    except:
-      traceback.print_exc()
-      raise
-    finally:
-      self._VerbosePrint("Closing process pool.")
-      pool.terminate()
-      self._VerbosePrint("Closing database connection.")
-      self._RunPerfSafe(self.perf_data_manager.close)
-      if self.perf_failures:
-        # Nuke perf data in case of failures. This might not work on windows as
-        # some files might still be open.
-        print "Deleting perf test data due to db corruption."
-        shutil.rmtree(self.datapath)
-    if queued_exception[0]:
-      e, stacktrace = queued_exception[0]
-      print stacktrace
-      raise e
-
-  def _VerbosePrint(self, text):
-    if self.context.verbose:
-      print text
-      sys.stdout.flush()
-
-
-class BreakNowException(Exception):
-  def __init__(self, value):
-    super(BreakNowException, self).__init__()
-    self.value = value
-
-  def __str__(self):
-    return repr(self.value)
diff --git a/src/v8/tools/testrunner/local/junit_output.py b/src/v8/tools/testrunner/local/junit_output.py
deleted file mode 100644
index 52f31ec..0000000
--- a/src/v8/tools/testrunner/local/junit_output.py
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright 2013 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.
-
-
-import xml.etree.ElementTree as xml
-
-
-class JUnitTestOutput:
-  def __init__(self, test_suite_name):
-    self.root = xml.Element("testsuite")
-    self.root.attrib["name"] = test_suite_name
-
-  def HasRunTest(self, test_name, test_cmd, test_duration, test_failure):
-    testCaseElement = xml.Element("testcase")
-    testCaseElement.attrib["name"] = test_name
-    testCaseElement.attrib["cmd"] = test_cmd
-    testCaseElement.attrib["time"] = str(round(test_duration, 3))
-    if len(test_failure):
-      failureElement = xml.Element("failure")
-      failureElement.text = test_failure
-      testCaseElement.append(failureElement)
-    self.root.append(testCaseElement)
-
-  def FinishAndWrite(self, f):
-    xml.ElementTree(self.root).write(f, "UTF-8")
diff --git a/src/v8/tools/testrunner/local/perfdata.py b/src/v8/tools/testrunner/local/perfdata.py
deleted file mode 100644
index 4cb618b..0000000
--- a/src/v8/tools/testrunner/local/perfdata.py
+++ /dev/null
@@ -1,141 +0,0 @@
-# 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.
-
-
-import os
-import shelve
-import threading
-
-
-class PerfDataEntry(object):
-  def __init__(self):
-    self.avg = 0.0
-    self.count = 0
-
-  def AddResult(self, result):
-    kLearnRateLimiter = 99  # Greater value means slower learning.
-    # We use an approximation of the average of the last 100 results here:
-    # The existing average is weighted with kLearnRateLimiter (or less
-    # if there are fewer data points).
-    effective_count = min(self.count, kLearnRateLimiter)
-    self.avg = self.avg * effective_count + result
-    self.count = effective_count + 1
-    self.avg /= self.count
-
-
-class PerfDataStore(object):
-  def __init__(self, datadir, arch, mode):
-    filename = os.path.join(datadir, "%s.%s.perfdata" % (arch, mode))
-    self.database = shelve.open(filename, protocol=2)
-    self.closed = False
-    self.lock = threading.Lock()
-
-  def __del__(self):
-    self.close()
-
-  def close(self):
-    if self.closed: return
-    self.database.close()
-    self.closed = True
-
-  def FetchPerfData(self, test):
-    """Returns the observed duration for |test| as read from the store."""
-    key = test.get_id()
-    if key in self.database:
-      return self.database[key].avg
-    return None
-
-  def UpdatePerfData(self, test, duration):
-    """Updates the persisted value in the store with duration."""
-    testkey = test.get_id()
-    self.RawUpdatePerfData(testkey, duration)
-
-  def RawUpdatePerfData(self, testkey, duration):
-    with self.lock:
-      if testkey in self.database:
-        entry = self.database[testkey]
-      else:
-        entry = PerfDataEntry()
-      entry.AddResult(duration)
-      self.database[testkey] = entry
-
-
-class PerfDataManager(object):
-  def __init__(self, datadir):
-    self.datadir = os.path.abspath(datadir)
-    if not os.path.exists(self.datadir):
-      os.makedirs(self.datadir)
-    self.stores = {}  # Keyed by arch, then mode.
-    self.closed = False
-    self.lock = threading.Lock()
-
-  def __del__(self):
-    self.close()
-
-  def close(self):
-    if self.closed: return
-    for arch in self.stores:
-      modes = self.stores[arch]
-      for mode in modes:
-        store = modes[mode]
-        store.close()
-    self.closed = True
-
-  def GetStore(self, arch, mode):
-    with self.lock:
-      if not arch in self.stores:
-        self.stores[arch] = {}
-      modes = self.stores[arch]
-      if not mode in modes:
-        modes[mode] = PerfDataStore(self.datadir, arch, mode)
-      return modes[mode]
-
-
-class NullPerfDataStore(object):
-  def UpdatePerfData(self, test, duration):
-    pass
-
-  def FetchPerfData(self, test):
-    return None
-
-
-class NullPerfDataManager(object):
-  def __init__(self):
-    pass
-
-  def GetStore(self, *args, **kwargs):
-    return NullPerfDataStore()
-
-  def close(self):
-    pass
-
-
-def GetPerfDataManager(context, datadir):
-  if context.use_perf_data:
-    return PerfDataManager(datadir)
-  else:
-    return NullPerfDataManager()
diff --git a/src/v8/tools/testrunner/local/progress.py b/src/v8/tools/testrunner/local/progress.py
deleted file mode 100644
index f6ebddf..0000000
--- a/src/v8/tools/testrunner/local/progress.py
+++ /dev/null
@@ -1,452 +0,0 @@
-# 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.
-
-
-from functools import wraps
-import json
-import os
-import sys
-import time
-
-from . import junit_output
-from . import statusfile
-from ..testproc import progress as progress_proc
-
-
-class ProgressIndicator(object):
-
-  def __init__(self):
-    self.runner = None
-
-  def SetRunner(self, runner):
-    self.runner = runner
-
-  def Starting(self):
-    pass
-
-  def Done(self):
-    pass
-
-  def HasRun(self, test, output, has_unexpected_output):
-    pass
-
-  def Heartbeat(self):
-    pass
-
-  def PrintFailureHeader(self, test):
-    if test.output_proc.negative:
-      negative_marker = '[negative] '
-    else:
-      negative_marker = ''
-    print "=== %(label)s %(negative)s===" % {
-      'label': test,
-      'negative': negative_marker,
-    }
-
-  def ToProgressIndicatorProc(self):
-    print ('Warning: %s is not available as a processor' %
-           self.__class__.__name__)
-    return None
-
-
-class IndicatorNotifier(object):
-  """Holds a list of progress indicators and notifies them all on events."""
-  def __init__(self):
-    self.indicators = []
-
-  def Register(self, indicator):
-    self.indicators.append(indicator)
-
-  def ToProgressIndicatorProcs(self):
-    return [i.ToProgressIndicatorProc() for i in self.indicators]
-
-
-# Forge all generic event-dispatching methods in IndicatorNotifier, which are
-# part of the ProgressIndicator interface.
-for func_name in ProgressIndicator.__dict__:
-  func = getattr(ProgressIndicator, func_name)
-  if callable(func) and not func.__name__.startswith('_'):
-    def wrap_functor(f):
-      @wraps(f)
-      def functor(self, *args, **kwargs):
-        """Generic event dispatcher."""
-        for indicator in self.indicators:
-          getattr(indicator, f.__name__)(*args, **kwargs)
-      return functor
-    setattr(IndicatorNotifier, func_name, wrap_functor(func))
-
-
-class SimpleProgressIndicator(ProgressIndicator):
-  """Abstract base class for {Verbose,Dots}ProgressIndicator"""
-
-  def Starting(self):
-    print 'Running %i tests' % self.runner.total
-
-  def Done(self):
-    print
-    for failed in self.runner.failed:
-      output = self.runner.outputs[failed]
-      self.PrintFailureHeader(failed)
-      if output.stderr:
-        print "--- stderr ---"
-        print output.stderr.strip()
-      if output.stdout:
-        print "--- stdout ---"
-        print output.stdout.strip()
-      print "Command: %s" % failed.cmd.to_string()
-      if output.HasCrashed():
-        print "exit code: %d" % output.exit_code
-        print "--- CRASHED ---"
-      if output.HasTimedOut():
-        print "--- TIMEOUT ---"
-    if len(self.runner.failed) == 0:
-      print "==="
-      print "=== All tests succeeded"
-      print "==="
-    else:
-      print
-      print "==="
-      print "=== %i tests failed" % len(self.runner.failed)
-      if self.runner.crashed > 0:
-        print "=== %i tests CRASHED" % self.runner.crashed
-      print "==="
-
-
-class VerboseProgressIndicator(SimpleProgressIndicator):
-
-  def HasRun(self, test, output, has_unexpected_output):
-    if has_unexpected_output:
-      if output.HasCrashed():
-        outcome = 'CRASH'
-      else:
-        outcome = 'FAIL'
-    else:
-      outcome = 'pass'
-    print 'Done running %s: %s' % (test, outcome)
-    sys.stdout.flush()
-
-  def Heartbeat(self):
-    print 'Still working...'
-    sys.stdout.flush()
-
-  def ToProgressIndicatorProc(self):
-    return progress_proc.VerboseProgressIndicator()
-
-
-class DotsProgressIndicator(SimpleProgressIndicator):
-
-  def HasRun(self, test, output, has_unexpected_output):
-    total = self.runner.succeeded + len(self.runner.failed)
-    if (total > 1) and (total % 50 == 1):
-      sys.stdout.write('\n')
-    if has_unexpected_output:
-      if output.HasCrashed():
-        sys.stdout.write('C')
-        sys.stdout.flush()
-      elif output.HasTimedOut():
-        sys.stdout.write('T')
-        sys.stdout.flush()
-      else:
-        sys.stdout.write('F')
-        sys.stdout.flush()
-    else:
-      sys.stdout.write('.')
-      sys.stdout.flush()
-
-  def ToProgressIndicatorProc(self):
-    return progress_proc.DotsProgressIndicator()
-
-
-class CompactProgressIndicator(ProgressIndicator):
-  """Abstract base class for {Color,Monochrome}ProgressIndicator"""
-
-  def __init__(self, templates):
-    super(CompactProgressIndicator, self).__init__()
-    self.templates = templates
-    self.last_status_length = 0
-    self.start_time = time.time()
-
-  def Done(self):
-    self.PrintProgress('Done')
-    print ""  # Line break.
-
-  def HasRun(self, test, output, has_unexpected_output):
-    self.PrintProgress(str(test))
-    if has_unexpected_output:
-      self.ClearLine(self.last_status_length)
-      self.PrintFailureHeader(test)
-      stdout = output.stdout.strip()
-      if len(stdout):
-        print self.templates['stdout'] % stdout
-      stderr = output.stderr.strip()
-      if len(stderr):
-        print self.templates['stderr'] % stderr
-      print "Command: %s" % test.cmd.to_string()
-      if output.HasCrashed():
-        print "exit code: %d" % output.exit_code
-        print "--- CRASHED ---"
-      if output.HasTimedOut():
-        print "--- TIMEOUT ---"
-
-  def Truncate(self, string, length):
-    if length and (len(string) > (length - 3)):
-      return string[:(length - 3)] + "..."
-    else:
-      return string
-
-  def PrintProgress(self, name):
-    self.ClearLine(self.last_status_length)
-    elapsed = time.time() - self.start_time
-    progress = 0 if not self.runner.total else (
-        ((self.runner.total - self.runner.remaining) * 100) //
-          self.runner.total)
-    status = self.templates['status_line'] % {
-      'passed': self.runner.succeeded,
-      'progress': progress,
-      'failed': len(self.runner.failed),
-      'test': name,
-      'mins': int(elapsed) / 60,
-      'secs': int(elapsed) % 60
-    }
-    status = self.Truncate(status, 78)
-    self.last_status_length = len(status)
-    print status,
-    sys.stdout.flush()
-
-
-class ColorProgressIndicator(CompactProgressIndicator):
-
-  def __init__(self):
-    templates = {
-      'status_line': ("[%(mins)02i:%(secs)02i|"
-                      "\033[34m%%%(progress) 4d\033[0m|"
-                      "\033[32m+%(passed) 4d\033[0m|"
-                      "\033[31m-%(failed) 4d\033[0m]: %(test)s"),
-      'stdout': "\033[1m%s\033[0m",
-      'stderr': "\033[31m%s\033[0m",
-    }
-    super(ColorProgressIndicator, self).__init__(templates)
-
-  def ClearLine(self, last_line_length):
-    print "\033[1K\r",
-
-  def ToProgressIndicatorProc(self):
-    return progress_proc.ColorProgressIndicator()
-
-
-class MonochromeProgressIndicator(CompactProgressIndicator):
-
-  def __init__(self):
-    templates = {
-      'status_line': ("[%(mins)02i:%(secs)02i|%%%(progress) 4d|"
-                      "+%(passed) 4d|-%(failed) 4d]: %(test)s"),
-      'stdout': '%s',
-      'stderr': '%s',
-    }
-    super(MonochromeProgressIndicator, self).__init__(templates)
-
-  def ClearLine(self, last_line_length):
-    print ("\r" + (" " * last_line_length) + "\r"),
-
-  def ToProgressIndicatorProc(self):
-    return progress_proc.MonochromeProgressIndicator()
-
-
-class JUnitTestProgressIndicator(ProgressIndicator):
-  def __init__(self, junitout, junittestsuite):
-    super(JUnitTestProgressIndicator, self).__init__()
-    self.junitout = junitout
-    self.juinttestsuite = junittestsuite
-    self.outputter = junit_output.JUnitTestOutput(junittestsuite)
-    if junitout:
-      self.outfile = open(junitout, "w")
-    else:
-      self.outfile = sys.stdout
-
-  def Done(self):
-    self.outputter.FinishAndWrite(self.outfile)
-    if self.outfile != sys.stdout:
-      self.outfile.close()
-
-  def HasRun(self, test, output, has_unexpected_output):
-    fail_text = ""
-    if has_unexpected_output:
-      stdout = output.stdout.strip()
-      if len(stdout):
-        fail_text += "stdout:\n%s\n" % stdout
-      stderr = output.stderr.strip()
-      if len(stderr):
-        fail_text += "stderr:\n%s\n" % stderr
-      fail_text += "Command: %s" % test.cmd.to_string()
-      if output.HasCrashed():
-        fail_text += "exit code: %d\n--- CRASHED ---" % output.exit_code
-      if output.HasTimedOut():
-        fail_text += "--- TIMEOUT ---"
-    self.outputter.HasRunTest(
-        test_name=str(test),
-        test_cmd=test.cmd.to_string(relative=True),
-        test_duration=output.duration,
-        test_failure=fail_text)
-
-  def ToProgressIndicatorProc(self):
-    if self.outfile != sys.stdout:
-      self.outfile.close()
-    return progress_proc.JUnitTestProgressIndicator(self.junitout,
-                                                    self.junittestsuite)
-
-
-class JsonTestProgressIndicator(ProgressIndicator):
-
-  def __init__(self, json_test_results, arch, mode, random_seed):
-    super(JsonTestProgressIndicator, self).__init__()
-    self.json_test_results = json_test_results
-    self.arch = arch
-    self.mode = mode
-    self.random_seed = random_seed
-    self.results = []
-    self.tests = []
-
-  def ToProgressIndicatorProc(self):
-    return progress_proc.JsonTestProgressIndicator(
-        self.json_test_results, self.arch, self.mode, self.random_seed)
-
-  def Done(self):
-    complete_results = []
-    if os.path.exists(self.json_test_results):
-      with open(self.json_test_results, "r") as f:
-        # Buildbot might start out with an empty file.
-        complete_results = json.loads(f.read() or "[]")
-
-    duration_mean = None
-    if self.tests:
-      # Get duration mean.
-      duration_mean = (
-          sum(duration for (_, duration) in self.tests) /
-          float(len(self.tests)))
-
-    # Sort tests by duration.
-    self.tests.sort(key=lambda (_, duration): duration, reverse=True)
-    slowest_tests = [
-      {
-        "name": str(test),
-        "flags": test.cmd.args,
-        "command": test.cmd.to_string(relative=True),
-        "duration": duration,
-        "marked_slow": test.is_slow,
-      } for (test, duration) in self.tests[:20]
-    ]
-
-    complete_results.append({
-      "arch": self.arch,
-      "mode": self.mode,
-      "results": self.results,
-      "slowest_tests": slowest_tests,
-      "duration_mean": duration_mean,
-      "test_total": len(self.tests),
-    })
-
-    with open(self.json_test_results, "w") as f:
-      f.write(json.dumps(complete_results))
-
-  def HasRun(self, test, output, has_unexpected_output):
-    # Buffer all tests for sorting the durations in the end.
-    self.tests.append((test, output.duration))
-    if not has_unexpected_output:
-      # Omit tests that run as expected. Passing tests of reruns after failures
-      # will have unexpected_output to be reported here has well.
-      return
-
-    self.results.append({
-      "name": str(test),
-      "flags": test.cmd.args,
-      "command": test.cmd.to_string(relative=True),
-      "run": test.run,
-      "stdout": output.stdout,
-      "stderr": output.stderr,
-      "exit_code": output.exit_code,
-      "result": test.output_proc.get_outcome(output),
-      "expected": test.expected_outcomes,
-      "duration": output.duration,
-
-      # TODO(machenbach): This stores only the global random seed from the
-      # context and not possible overrides when using random-seed stress.
-      "random_seed": self.random_seed,
-      "target_name": test.get_shell(),
-      "variant": test.variant,
-    })
-
-
-class FlakinessTestProgressIndicator(ProgressIndicator):
-
-  def __init__(self, json_test_results):
-    super(FlakinessTestProgressIndicator, self).__init__()
-    self.json_test_results = json_test_results
-    self.results = {}
-    self.summary = {
-      "PASS": 0,
-      "FAIL": 0,
-      "CRASH": 0,
-      "TIMEOUT": 0,
-    }
-    self.seconds_since_epoch = time.time()
-
-  def Done(self):
-    with open(self.json_test_results, "w") as f:
-      json.dump({
-        "interrupted": False,
-        "num_failures_by_type": self.summary,
-        "path_delimiter": "/",
-        "seconds_since_epoch": self.seconds_since_epoch,
-        "tests": self.results,
-        "version": 3,
-      }, f)
-
-  def HasRun(self, test, output, has_unexpected_output):
-    key = test.get_id()
-    outcome = test.output_proc.get_outcome(output)
-    assert outcome in ["PASS", "FAIL", "CRASH", "TIMEOUT"]
-    if test.run == 1:
-      # First run of this test.
-      self.results[key] = {
-        "actual": outcome,
-        "expected": " ".join(test.expected_outcomes),
-        "times": [output.duration],
-      }
-      self.summary[outcome] = self.summary[outcome] + 1
-    else:
-      # This is a rerun and a previous result exists.
-      result = self.results[key]
-      result["actual"] = "%s %s" % (result["actual"], outcome)
-      result["times"].append(output.duration)
-
-
-PROGRESS_INDICATORS = {
-  'verbose': VerboseProgressIndicator,
-  'dots': DotsProgressIndicator,
-  'color': ColorProgressIndicator,
-  'mono': MonochromeProgressIndicator
-}
diff --git a/src/v8/tools/testrunner/objects/context.py b/src/v8/tools/testrunner/objects/context.py
deleted file mode 100644
index a3dd56d..0000000
--- a/src/v8/tools/testrunner/objects/context.py
+++ /dev/null
@@ -1,51 +0,0 @@
-# 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.
-
-
-class Context():
-  def __init__(self, arch, mode, shell_dir, mode_flags, verbose, timeout,
-               isolates, command_prefix, extra_flags, noi18n, random_seed,
-               no_sorting, rerun_failures_count, rerun_failures_max, no_harness,
-               use_perf_data, sancov_dir, infra_staging=False):
-    self.arch = arch
-    self.mode = mode
-    self.shell_dir = shell_dir
-    self.mode_flags = mode_flags
-    self.verbose = verbose
-    self.timeout = timeout
-    self.isolates = isolates
-    self.command_prefix = command_prefix
-    self.extra_flags = extra_flags
-    self.noi18n = noi18n
-    self.random_seed = random_seed
-    self.no_sorting = no_sorting
-    self.rerun_failures_count = rerun_failures_count
-    self.rerun_failures_max = rerun_failures_max
-    self.no_harness = no_harness
-    self.use_perf_data = use_perf_data
-    self.sancov_dir = sancov_dir
-    self.infra_staging = infra_staging
diff --git a/src/v8/tools/testrunner/testrunner.isolate b/src/v8/tools/testrunner/testrunner.isolate
deleted file mode 100644
index 56667c2..0000000
--- a/src/v8/tools/testrunner/testrunner.isolate
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-  'variables': {
-    'command': [
-      '../run-tests.py',
-    ],
-    'files': [
-      '<(PRODUCT_DIR)/v8_build_config.json',
-      '../run-tests.py',
-      './'
-    ],
-  },
-  'conditions': [
-    ['coverage==1 and sanitizer_coverage=="bb,trace-pc-guard"', {
-      'variables': {
-        'files': [
-          '../sanitizers/sancov_merger.py',
-          '../../third_party/llvm/projects/compiler-rt/lib/sanitizer_common/scripts/sancov.py',
-        ],
-      },
-    }],
-  ],
-}
diff --git a/src/v8/tools/turbolizer/code-view.js b/src/v8/tools/turbolizer/code-view.js
deleted file mode 100644
index 7f9728a..0000000
--- a/src/v8/tools/turbolizer/code-view.js
+++ /dev/null
@@ -1,170 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-"use strict";
-
-class CodeView extends View {
-  constructor(divID, PR, sourceText, sourcePosition, broker) {
-    super(divID, broker, null, false);
-    let view = this;
-    view.PR = PR;
-    view.mouseDown = false;
-    view.broker = broker;
-    view.allSpans = [];
-
-    var selectionHandler = {
-      clear: function() { broker.clear(selectionHandler); },
-      select: function(items, selected) {
-        var handler = this;
-        var broker = view.broker;
-        for (let span of items) {
-          if (selected) {
-            span.classList.add("selected");
-          } else {
-            span.classList.remove("selected");
-          }
-        }
-        var locations = [];
-        for (var span of items) {
-          locations.push({pos_start: span.start, pos_end: span.end});
-        }
-        broker.clear(selectionHandler);
-        broker.select(selectionHandler, locations, selected);
-      },
-      selectionDifference: function(span1, inclusive1, span2, inclusive2) {
-        var pos1 = span1.start;
-        var pos2 = span2.start;
-        var result = [];
-        var lineListDiv = view.divNode.firstChild.firstChild.childNodes;
-        for (var i = 0; i < lineListDiv.length; i++) {
-          var currentLineElement = lineListDiv[i];
-          var spans = currentLineElement.childNodes;
-          for (var j = 0; j < spans.length; ++j) {
-            var currentSpan = spans[j];
-            if (currentSpan.start > pos1 ||
-                (inclusive1 && currentSpan.start == pos1)) {
-              if (currentSpan.start < pos2 ||
-                  (inclusive2 && currentSpan.start == pos2)) {
-                result.push(currentSpan);
-              }
-            }
-          }
-        }
-        return result;
-      },
-      brokeredSelect: function(locations, selected) {
-        let firstSelect = view.selection.isEmpty();
-        for (let location of locations) {
-          let start = location.pos_start;
-          let end = location.pos_end;
-          if (start && end) {
-            let lower = 0;
-            let upper = view.allSpans.length;
-            if (upper > 0) {
-              while ((upper - lower) > 1) {
-                var middle = Math.floor((upper + lower) / 2);
-                var lineStart = view.allSpans[middle].start;
-                if (lineStart < start) {
-                  lower = middle;
-                } else if (lineStart > start) {
-                  upper = middle;
-                } else {
-                  lower = middle;
-                  break;
-                }
-              }
-              var currentSpan = view.allSpans[lower];
-              var currentLineElement = currentSpan.parentNode;
-              if ((currentSpan.start <= start && start < currentSpan.end) ||
-                  (currentSpan.start <= end && end < currentSpan.end)) {
-                if (firstSelect) {
-                  makeContainerPosVisible(
-                      view.divNode, currentLineElement.offsetTop);
-                  firstSelect = false;
-                }
-                view.selection.select(currentSpan, selected);
-              }
-            }
-          }
-        }
-      },
-      brokeredClear: function() { view.selection.clear(); },
-    };
-    view.selection = new Selection(selectionHandler);
-    broker.addSelectionHandler(selectionHandler);
-
-    view.handleSpanMouseDown = function(e) {
-      e.stopPropagation();
-      if (!e.shiftKey) {
-        view.selection.clear();
-      }
-      view.selection.select(this, true);
-      view.mouseDown = true;
-    }
-
-    view.handleSpanMouseMove = function(e) {
-      if (view.mouseDown) {
-        view.selection.extendTo(this);
-      }
-    }
-
-    view.handleCodeMouseDown = function(e) { view.selection.clear(); }
-
-    document.addEventListener('mouseup', function(e) {
-      view.mouseDown = false;
-    }, false);
-
-    view.initializeCode(sourceText, sourcePosition);
-  }
-
-  initializeContent(data, rememberedSelection) { this.data = data; }
-
-  initializeCode(sourceText, sourcePosition) {
-    var view = this;
-    var codePre = document.createElement("pre");
-    codePre.classList.add("prettyprint");
-    view.divNode.innerHTML = "";
-    view.divNode.appendChild(codePre);
-    if (sourceText != "") {
-      codePre.classList.add("linenums");
-      codePre.textContent = sourceText;
-      try {
-        // Wrap in try to work when offline.
-        view.PR.prettyPrint();
-      } catch (e) {
-      }
-
-      view.divNode.onmousedown = this.handleCodeMouseDown;
-
-      var base = sourcePosition;
-      var current = 0;
-      var lineListDiv = view.divNode.firstChild.firstChild.childNodes;
-      for (let i = 0; i < lineListDiv.length; i++) {
-        var currentLineElement = lineListDiv[i];
-        currentLineElement.id = "li" + i;
-        var pos = base + current;
-        currentLineElement.pos = pos;
-        var spans = currentLineElement.childNodes;
-        for (let j = 0; j < spans.length; ++j) {
-          var currentSpan = spans[j];
-          if (currentSpan.nodeType == 1) {
-            currentSpan.start = pos;
-            currentSpan.end = pos + currentSpan.textContent.length;
-            currentSpan.onmousedown = this.handleSpanMouseDown;
-            currentSpan.onmousemove = this.handleSpanMouseMove;
-            view.allSpans.push(currentSpan);
-          }
-          current += currentSpan.textContent.length;
-          pos = base + current;
-        }
-        while ((current < sourceText.length) &&
-               (sourceText[current] == '\n' || sourceText[current] == '\r')) {
-          ++current;
-        }
-      }
-    }
-  }
-
-  deleteContent() {}
-}
diff --git a/src/v8/tools/turbolizer/constants.js b/src/v8/tools/turbolizer/constants.js
deleted file mode 100644
index da92c45..0000000
--- a/src/v8/tools/turbolizer/constants.js
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var MAX_RANK_SENTINEL = 0;
-var GRAPH_MARGIN = 250;
-var WIDTH = 'width';
-var HEIGHT = 'height';
-var VISIBILITY = 'visibility';
-var SOURCE_PANE_ID = 'left';
-var SOURCE_COLLAPSE_ID = 'source-shrink';
-var SOURCE_EXPAND_ID = 'source-expand';
-var INTERMEDIATE_PANE_ID = 'middle';
-var EMPTY_PANE_ID = 'empty';
-var GRAPH_PANE_ID = 'graph';
-var SCHEDULE_PANE_ID = 'schedule';
-var GENERATED_PANE_ID = 'right';
-var DISASSEMBLY_PANE_ID = 'disassembly';
-var DISASSEMBLY_COLLAPSE_ID = 'disassembly-shrink';
-var DISASSEMBLY_EXPAND_ID = 'disassembly-expand';
-var COLLAPSE_PANE_BUTTON_VISIBLE = 'button-input';
-var COLLAPSE_PANE_BUTTON_INVISIBLE = 'button-input-invisible';
-var UNICODE_BLOCK = '&#9611;';
-var PROF_COLS = [
-  { perc:   0, col: { r: 255, g: 255, b: 255 } },
-  { perc: 0.5, col: { r: 255, g: 255, b: 128 } },
-  { perc:   5, col: { r: 255, g: 128, b:   0 } },
-  { perc:  15, col: { r: 255, g:   0, b:   0 } },
-  { perc: 100, col: { r:   0, g:   0, b:   0 } }
-];
diff --git a/src/v8/tools/turbolizer/disassembly-view.js b/src/v8/tools/turbolizer/disassembly-view.js
deleted file mode 100644
index ecee049..0000000
--- a/src/v8/tools/turbolizer/disassembly-view.js
+++ /dev/null
@@ -1,273 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-"use strict";
-
-class DisassemblyView extends TextView {
-  constructor(id, broker) {
-    super(id, broker, null, false);
-
-    let view = this;
-    let ADDRESS_STYLE = {
-      css: 'tag',
-      location: function(text) {
-        ADDRESS_STYLE.last_address = text;
-        return undefined;
-      }
-    };
-    let ADDRESS_LINK_STYLE = {
-      css: 'tag',
-      link: function(text) {
-        view.select(function(location) { return location.address == text; }, true, true);
-      }
-    };
-    let UNCLASSIFIED_STYLE = {
-      css: 'com'
-    };
-    let NUMBER_STYLE = {
-      css: 'lit'
-    };
-    let COMMENT_STYLE = {
-      css: 'com'
-    };
-    let POSITION_STYLE = {
-      css: 'com',
-      location: function(text) {
-        view.pos_start = Number(text);
-      }
-    };
-    let OPCODE_STYLE = {
-      css: 'kwd',
-      location: function(text) {
-        if (BLOCK_HEADER_STYLE.block_id != undefined) {
-          return {
-            address: ADDRESS_STYLE.last_address,
-            block_id: BLOCK_HEADER_STYLE.block_id
-          };
-        } else {
-          return {
-            address: ADDRESS_STYLE.last_address
-          };
-        }
-      }
-    };
-    const BLOCK_HEADER_STYLE = {
-      css: 'com',
-      block_id: -1,
-      location: function(text) {
-        let matches = /\d+/.exec(text);
-        if (!matches) return undefined;
-        BLOCK_HEADER_STYLE.block_id = Number(matches[0]);
-        return {
-          block_id: BLOCK_HEADER_STYLE.block_id
-        };
-      },
-    };
-    const SOURCE_POSITION_HEADER_STYLE = {
-      css: 'com',
-      location: function(text) {
-        let matches = /(\d+):(\d+)/.exec(text);
-        if (!matches) return undefined;
-        let li = Number(matches[1]);
-        if (view.pos_lines === null) return undefined;
-        let pos = view.pos_lines[li-1] + Number(matches[2]);
-        return {
-          pos_start: pos,
-          pos_end: pos + 1
-        };
-      },
-    };
-    view.SOURCE_POSITION_HEADER_REGEX = /^(\s*-- .+:)(\d+:\d+)( --)/;
-    let patterns = [
-      [
-        [/^0x[0-9a-f]{8,16}/, ADDRESS_STYLE, 1],
-        [view.SOURCE_POSITION_HEADER_REGEX, SOURCE_POSITION_HEADER_STYLE, -1],
-        [/^\s+-- B\d+ start.*/, BLOCK_HEADER_STYLE, -1],
-        [/^.*/, UNCLASSIFIED_STYLE, -1]
-      ],
-      [
-        [/^\s+[0-9a-f]+\s+[0-9a-f]+\s+/, NUMBER_STYLE, 2],
-        [/^.*/, null, -1]
-      ],
-      [
-        [/^\S+\s+/, OPCODE_STYLE, 3],
-        [/^\S+$/, OPCODE_STYLE, -1],
-        [/^.*/, null, -1]
-      ],
-      [
-        [/^\s+/, null],
-        [/^[^\(;]+$/, null, -1],
-        [/^[^\(;]+/, null],
-        [/^\(/, null, 4],
-        [/^;/, COMMENT_STYLE, 5]
-      ],
-      [
-        [/^0x[0-9a-f]{8,16}/, ADDRESS_LINK_STYLE],
-        [/^[^\)]/, null],
-        [/^\)$/, null, -1],
-        [/^\)/, null, 3]
-      ],
-      [
-        [/^; debug\: position /, COMMENT_STYLE, 6],
-        [/^.+$/, COMMENT_STYLE, -1]
-      ],
-      [
-        [/^\d+$/, POSITION_STYLE, -1],
-      ]
-    ];
-    view.setPatterns(patterns);
-  }
-
-  lineLocation(li) {
-    let view = this;
-    let result = undefined;
-    for (let i = 0; i < li.children.length; ++i) {
-      let fragment = li.children[i];
-      let location = fragment.location;
-      if (location != null) {
-        if (location.block_id != undefined) {
-          if (result === undefined) result = {};
-          result.block_id = location.block_id;
-        }
-        if (location.address != undefined) {
-          if (result === undefined) result = {};
-          result.address = location.address;
-        }
-        if (location.pos_start != undefined && location.pos_end != undefined) {
-          if (result === undefined) result = {};
-          result.pos_start = location.pos_start;
-          result.pos_end = location.pos_end;
-        }
-        else if (view.pos_start != -1) {
-          if (result === undefined) result = {};
-          result.pos_start = view.pos_start;
-          result.pos_end = result.pos_start + 1;
-        }
-      }
-    }
-    return result;
-  }
-
-  initializeContent(data, rememberedSelection) {
-    this.data = data;
-    super.initializeContent(data, rememberedSelection);
-  }
-
-  initializeCode(sourceText, sourcePosition) {
-    let view = this;
-    view.pos_start = -1;
-    view.addr_event_counts = null;
-    view.total_event_counts = null;
-    view.max_event_counts = null;
-    view.pos_lines = new Array();
-    // Comment lines for line 0 include sourcePosition already, only need to
-    // add sourcePosition for lines > 0.
-    view.pos_lines[0] = sourcePosition;
-    if (sourceText != "") {
-      let base = sourcePosition;
-      let current = 0;
-      let source_lines = sourceText.split("\n");
-      for (let i = 1; i < source_lines.length; i++) {
-        // Add 1 for newline character that is split off.
-        current += source_lines[i-1].length + 1;
-        view.pos_lines[i] = base + current;
-      }
-    }
-  }
-
-  initializePerfProfile(eventCounts) {
-    let view = this;
-    if (eventCounts !== undefined) {
-      view.addr_event_counts = eventCounts;
-
-      view.total_event_counts = {};
-      view.max_event_counts = {};
-      for (let ev_name in view.addr_event_counts) {
-        let keys = Object.keys(view.addr_event_counts[ev_name]);
-        let values = keys.map(key => view.addr_event_counts[ev_name][key]);
-        view.total_event_counts[ev_name] = values.reduce((a, b) => a + b);
-        view.max_event_counts[ev_name] = values.reduce((a, b) => Math.max(a, b));
-      }
-    }
-    else {
-      view.addr_event_counts = null;
-      view.total_event_counts = null;
-      view.max_event_counts = null;
-    }
-  }
-
-  // Shorten decimals and remove trailing zeroes for readability.
-  humanize(num) {
-    return num.toFixed(3).replace(/\.?0+$/, "") + "%";
-  }
-
-  // Interpolate between the given start and end values by a fraction of val/max.
-  interpolate(val, max, start, end) {
-    return start + (end - start) * (val / max);
-  }
-
-  processLine(line) {
-    let view = this;
-    let func = function(match, p1, p2, p3) {
-      let nums = p2.split(":");
-      let li = Number(nums[0]);
-      let pos = Number(nums[1]);
-      if(li === 0)
-        pos -= view.pos_lines[0];
-      li++;
-      return p1 + li + ":" + pos + p3;
-    };
-    line = line.replace(view.SOURCE_POSITION_HEADER_REGEX, func);
-    let fragments = super.processLine(line);
-
-    // Add profiling data per instruction if available.
-    if (view.total_event_counts) {
-      let matches = /^(0x[0-9a-fA-F]+)\s+\d+\s+[0-9a-fA-F]+/.exec(line);
-      if (matches) {
-        let newFragments = [];
-        for (let event in view.addr_event_counts) {
-          let count = view.addr_event_counts[event][matches[1]];
-          let str = " ";
-          let css_cls = "prof";
-          if(count !== undefined) {
-            let perc = count / view.total_event_counts[event] * 100;
-
-            let col = { r: 255, g: 255, b: 255 };
-            for (let i = 0; i < PROF_COLS.length; i++) {
-              if (perc === PROF_COLS[i].perc) {
-                col = PROF_COLS[i].col;
-                break;
-              }
-              else if (perc > PROF_COLS[i].perc && perc < PROF_COLS[i + 1].perc) {
-                let col1 = PROF_COLS[i].col;
-                let col2 = PROF_COLS[i + 1].col;
-
-                let val = perc - PROF_COLS[i].perc;
-                let max = PROF_COLS[i + 1].perc - PROF_COLS[i].perc;
-
-                col.r = Math.round(view.interpolate(val, max, col1.r, col2.r));
-                col.g = Math.round(view.interpolate(val, max, col1.g, col2.g));
-                col.b = Math.round(view.interpolate(val, max, col1.b, col2.b));
-                break;
-              }
-            }
-
-            str = UNICODE_BLOCK;
-
-            let fragment = view.createFragment(str, css_cls);
-            fragment.title = event + ": " + view.humanize(perc) + " (" + count + ")";
-            fragment.style.color = "rgb(" + col.r + ", " + col.g + ", " + col.b + ")";
-
-            newFragments.push(fragment);
-          }
-          else
-            newFragments.push(view.createFragment(str, css_cls));
-
-        }
-        fragments = newFragments.concat(fragments);
-      }
-    }
-    return fragments;
-  }
-}
diff --git a/src/v8/tools/turbolizer/edge.js b/src/v8/tools/turbolizer/edge.js
deleted file mode 100644
index c0f63a0..0000000
--- a/src/v8/tools/turbolizer/edge.js
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var MINIMUM_EDGE_SEPARATION = 20;
-
-function isEdgeInitiallyVisible(target, index, source, type) {
-  return type == "control" && (target.cfg || source.cfg);
-}
-
-var Edge = function(target, index, source, type) {
-  this.target = target;
-  this.source = source;
-  this.index = index;
-  this.type = type;
-  this.backEdgeNumber = 0;
-  this.visible = isEdgeInitiallyVisible(target, index, source, type);
-};
-
-Edge.prototype.stringID = function() {
-  return this.source.id + "," + this.index +  "," + this.target.id;
-};
-
-Edge.prototype.isVisible = function() {
-  return this.visible && this.source.visible && this.target.visible;
-};
-
-Edge.prototype.getInputHorizontalPosition = function(graph) {
-  if (this.backEdgeNumber > 0) {
-    return graph.maxGraphNodeX + this.backEdgeNumber * MINIMUM_EDGE_SEPARATION;
-  }
-  var source = this.source;
-  var target = this.target;
-  var index = this.index;
-  var input_x = target.x + target.getInputX(index);
-  var inputApproach = target.getInputApproach(this.index);
-  var outputApproach = source.getOutputApproach(graph);
-  if (inputApproach > outputApproach) {
-    return input_x;
-  } else {
-    var inputOffset = MINIMUM_EDGE_SEPARATION * (index + 1);
-    return (target.x < source.x)
-      ? (target.x + target.getTotalNodeWidth() + inputOffset)
-      : (target.x - inputOffset)
-  }
-}
-
-Edge.prototype.generatePath = function(graph) {
-  var target = this.target;
-  var source = this.source;
-  var input_x = target.x + target.getInputX(this.index);
-  var arrowheadHeight = 7;
-  var input_y = target.y - 2 * DEFAULT_NODE_BUBBLE_RADIUS - arrowheadHeight;
-  var output_x = source.x + source.getOutputX();
-  var output_y = source.y + graph.getNodeHeight(source) + DEFAULT_NODE_BUBBLE_RADIUS;
-  var inputApproach = target.getInputApproach(this.index);
-  var outputApproach = source.getOutputApproach(graph);
-  var horizontalPos = this.getInputHorizontalPosition(graph);
-
-  var result = "M" + output_x + "," + output_y +
-    "L" + output_x + "," + outputApproach +
-    "L" + horizontalPos + "," + outputApproach;
-
-  if (horizontalPos != input_x) {
-    result += "L" + horizontalPos + "," + inputApproach;
-  } else {
-    if (inputApproach < outputApproach) {
-      inputApproach = outputApproach;
-    }
-  }
-
-  result += "L" + input_x + "," + inputApproach +
-    "L" + input_x + "," + input_y;
-  return result;
-}
-
-Edge.prototype.isBackEdge = function() {
-  return this.target.hasBackEdges() && (this.target.rank < this.source.rank);
-}
diff --git a/src/v8/tools/turbolizer/empty-view.js b/src/v8/tools/turbolizer/empty-view.js
deleted file mode 100644
index 66caf59..0000000
--- a/src/v8/tools/turbolizer/empty-view.js
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-"use strict";
-
-class EmptyView extends View {
-  constructor(id, broker) {
-    super(id, broker);
-    this.svg = this.divElement.append("svg").attr('version','1.1').attr("width", "100%");
-  }
-
-  initializeContent(data, rememberedSelection) {
-    this.svg.attr("height", document.documentElement.clientHeight + "px");
-  }
-
-  deleteContent() {
-  }
-}
diff --git a/src/v8/tools/turbolizer/expand-all.jpg b/src/v8/tools/turbolizer/expand-all.jpg
deleted file mode 100644
index df64a2c..0000000
--- a/src/v8/tools/turbolizer/expand-all.jpg
+++ /dev/null
Binary files differ
diff --git a/src/v8/tools/turbolizer/graph-layout.js b/src/v8/tools/turbolizer/graph-layout.js
deleted file mode 100644
index e9b44b4..0000000
--- a/src/v8/tools/turbolizer/graph-layout.js
+++ /dev/null
@@ -1,493 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var DEFAULT_NODE_ROW_SEPARATION = 130
-
-var traceLayout = false;
-
-function newGraphOccupation(graph){
-  var isSlotFilled = [];
-  var maxSlot = 0;
-  var minSlot = 0;
-  var nodeOccupation = [];
-
-  function slotToIndex(slot) {
-    if (slot >= 0) {
-      return slot * 2;
-    } else {
-      return slot * 2 + 1;
-    }
-  }
-
-  function indexToSlot(index) {
-    if ((index % 0) == 0) {
-      return index / 2;
-    } else {
-      return -((index - 1) / 2);
-    }
-  }
-
-  function positionToSlot(pos) {
-    return Math.floor(pos / NODE_INPUT_WIDTH);
-  }
-
-  function slotToLeftPosition(slot) {
-    return slot * NODE_INPUT_WIDTH
-  }
-
-  function slotToRightPosition(slot) {
-    return (slot + 1) * NODE_INPUT_WIDTH
-  }
-
-  function findSpace(pos, width, direction) {
-    var widthSlots = Math.floor((width + NODE_INPUT_WIDTH - 1) /
-                                NODE_INPUT_WIDTH);
-    var currentSlot = positionToSlot(pos + width / 2);
-    var currentScanSlot = currentSlot;
-    var widthSlotsRemainingLeft = widthSlots;
-    var widthSlotsRemainingRight = widthSlots;
-    var slotsChecked = 0;
-    while (true) {
-      var mod = slotsChecked++ % 2;
-      currentScanSlot = currentSlot + (mod ? -1 : 1) * (slotsChecked >> 1);
-      if (!isSlotFilled[slotToIndex(currentScanSlot)]) {
-        if (mod) {
-          if (direction <= 0) --widthSlotsRemainingLeft
-        } else {
-          if (direction >= 0) --widthSlotsRemainingRight
-        }
-        if (widthSlotsRemainingLeft == 0 ||
-            widthSlotsRemainingRight == 0 ||
-            (widthSlotsRemainingLeft + widthSlotsRemainingRight) == widthSlots &&
-            (widthSlots == slotsChecked)) {
-          if (mod) {
-            return [currentScanSlot, widthSlots];
-          } else {
-            return [currentScanSlot - widthSlots + 1, widthSlots];
-          }
-        }
-      } else {
-        if (mod) {
-          widthSlotsRemainingLeft = widthSlots;
-        } else {
-          widthSlotsRemainingRight = widthSlots;
-        }
-      }
-    }
-  }
-
-  function setIndexRange(from, to, value) {
-    if (to < from) {
-      throw("illegal slot range");
-    }
-    while (from <= to) {
-      if (from > maxSlot) {
-        maxSlot = from;
-      }
-      if (from < minSlot) {
-        minSlot = from;
-      }
-      isSlotFilled[slotToIndex(from++)] = value;
-    }
-  }
-
-  function occupySlotRange(from, to) {
-    if (traceLayout) {
-      console.log("Occupied [" + slotToLeftPosition(from) + "  " + slotToLeftPosition(to + 1) + ")");
-    }
-    setIndexRange(from, to, true);
-  }
-
-  function clearSlotRange(from, to) {
-    if (traceLayout) {
-      console.log("Cleared [" + slotToLeftPosition(from) + "  " + slotToLeftPosition(to + 1) + ")");
-    }
-    setIndexRange(from, to, false);
-  }
-
-  function occupyPositionRange(from, to) {
-    occupySlotRange(positionToSlot(from), positionToSlot(to - 1));
-  }
-
-  function clearPositionRange(from, to) {
-    clearSlotRange(positionToSlot(from), positionToSlot(to - 1));
-  }
-
-  function occupyPositionRangeWithMargin(from, to, margin) {
-    var fromMargin = from - Math.floor(margin);
-    var toMargin = to + Math.floor(margin);
-    occupyPositionRange(fromMargin, toMargin);
-  }
-
-  function clearPositionRangeWithMargin(from, to, margin) {
-    var fromMargin = from - Math.floor(margin);
-    var toMargin = to + Math.floor(margin);
-    clearPositionRange(fromMargin, toMargin);
-  }
-
-  var occupation = {
-    occupyNodeInputs: function(node) {
-      for (var i = 0; i < node.inputs.length; ++i) {
-        if (node.inputs[i].isVisible()) {
-          var edge = node.inputs[i];
-          if (!edge.isBackEdge()) {
-            var source = edge.source;
-            var horizontalPos = edge.getInputHorizontalPosition(graph);
-            if (traceLayout) {
-              console.log("Occupying input " + i + " of " + node.id + " at " + horizontalPos);
-            }
-            occupyPositionRangeWithMargin(horizontalPos,
-                                          horizontalPos,
-                                          NODE_INPUT_WIDTH / 2);
-          }
-        }
-      }
-    },
-    occupyNode: function(node) {
-      var getPlacementHint = function(n) {
-        var pos = 0;
-        var direction = -1;
-        var outputEdges = 0;
-        var inputEdges = 0;
-        for (var k = 0; k < n.outputs.length; ++k) {
-          var outputEdge = n.outputs[k];
-          if (outputEdge.isVisible()) {
-            var output = n.outputs[k].target;
-            for (var l = 0; l < output.inputs.length; ++l) {
-              if (output.rank > n.rank) {
-                var inputEdge = output.inputs[l];
-                if (inputEdge.isVisible()) {
-                  ++inputEdges;
-                }
-                if (output.inputs[l].source == n) {
-                  pos += output.x + output.getInputX(l) + NODE_INPUT_WIDTH / 2;
-                  outputEdges++;
-                  if (l >= (output.inputs.length / 2)) {
-                    direction = 1;
-                  }
-                }
-              }
-            }
-          }
-        }
-        if (outputEdges != 0) {
-          pos = pos / outputEdges;
-        }
-        if (outputEdges > 1 || inputEdges == 1) {
-          direction = 0;
-        }
-        return [direction, pos];
-      }
-      var width = node.getTotalNodeWidth();
-      var margin = MINIMUM_EDGE_SEPARATION;
-      var paddedWidth = width + 2 * margin;
-      var placementHint = getPlacementHint(node);
-      var x = placementHint[1] - paddedWidth + margin;
-      if (traceLayout) {
-        console.log("Node " + node.id + " placement hint [" + x + ", " + (x + paddedWidth) + ")");
-      }
-      var placement = findSpace(x, paddedWidth, placementHint[0]);
-      var firstSlot = placement[0];
-      var slotWidth = placement[1];
-      var endSlotExclusive = firstSlot + slotWidth - 1;
-      occupySlotRange(firstSlot, endSlotExclusive);
-      nodeOccupation.push([firstSlot, endSlotExclusive]);
-      if (placementHint[0] < 0) {
-        return slotToLeftPosition(firstSlot + slotWidth) - width - margin;
-      } else if (placementHint[0] > 0) {
-        return slotToLeftPosition(firstSlot) + margin;
-      } else {
-        return slotToLeftPosition(firstSlot + slotWidth / 2) - (width / 2);
-      }
-    },
-    clearOccupiedNodes: function() {
-      nodeOccupation.forEach(function(o) {
-        clearSlotRange(o[0], o[1]);
-      });
-      nodeOccupation = [];
-    },
-    clearNodeOutputs: function(source) {
-      source.outputs.forEach(function(edge) {
-        if (edge.isVisible()) {
-          var target = edge.target;
-          for (var i = 0; i < target.inputs.length; ++i) {
-            if (target.inputs[i].source === source) {
-              var horizontalPos = edge.getInputHorizontalPosition(graph);
-              clearPositionRangeWithMargin(horizontalPos,
-                                           horizontalPos,
-                                           NODE_INPUT_WIDTH / 2);
-            }
-          }
-        }
-      });
-    },
-    print: function() {
-      var s = "";
-      for (var currentSlot = -40; currentSlot < 40; ++currentSlot) {
-        if (currentSlot != 0) {
-          s += " ";
-        } else {
-          s += "|";
-        }
-      }
-      console.log(s);
-      s = "";
-      for (var currentSlot2 = -40; currentSlot2 < 40; ++currentSlot2) {
-        if (isSlotFilled[slotToIndex(currentSlot2)]) {
-          s += "*";
-        } else {
-          s += " ";
-        }
-      }
-      console.log(s);
-    }
-  }
-  return occupation;
-}
-
-function layoutNodeGraph(graph) {
-  // First determine the set of nodes that have no outputs. Those are the
-  // basis for bottom-up DFS to determine rank and node placement.
-  var endNodesHasNoOutputs = [];
-  var startNodesHasNoInputs = [];
-  graph.nodes.forEach(function(n, i){
-    endNodesHasNoOutputs[n.id] = true;
-    startNodesHasNoInputs[n.id] = true;
-  });
-  graph.edges.forEach(function(e, i){
-    endNodesHasNoOutputs[e.source.id] = false;
-    startNodesHasNoInputs[e.target.id] = false;
-  });
-
-  // Finialize the list of start and end nodes.
-  var endNodes = [];
-  var startNodes = [];
-  var visited = [];
-  var rank = [];
-  graph.nodes.forEach(function(n, i){
-    if (endNodesHasNoOutputs[n.id]) {
-      endNodes.push(n);
-    }
-    if (startNodesHasNoInputs[n.id]) {
-      startNodes.push(n);
-    }
-    visited[n.id] = false;
-    rank[n.id] = -1;
-    n.rank = 0;
-    n.visitOrderWithinRank = 0;
-    n.outputApproach = MINIMUM_NODE_OUTPUT_APPROACH;
-  });
-
-
-  var maxRank = 0;
-  var visited = [];
-  var dfsStack = [];
-  var visitOrderWithinRank = 0;
-
-  var worklist = startNodes.slice();
-  while (worklist.length != 0) {
-    var n = worklist.pop();
-    var changed = false;
-    if (n.rank == MAX_RANK_SENTINEL) {
-      n.rank = 1;
-      changed = true;
-    }
-    var begin = 0;
-    var end = n.inputs.length;
-    if (n.opcode == 'Phi' || n.opcode == 'EffectPhi') {
-      // Keep with merge or loop node
-      begin = n.inputs.length - 1;
-    } else if (n.hasBackEdges()) {
-      end = 1;
-    }
-    for (var l = begin; l < end; ++l) {
-      var input = n.inputs[l].source;
-      if (input.visible && input.rank >= n.rank) {
-        n.rank = input.rank + 1;
-        changed = true;
-      }
-    }
-    if (changed) {
-      var hasBackEdges = n.hasBackEdges();
-      for (var l = n.outputs.length - 1; l >= 0; --l) {
-        if (hasBackEdges && (l != 0)) {
-          worklist.unshift(n.outputs[l].target);
-        } else {
-          worklist.push(n.outputs[l].target);
-        }
-      }
-    }
-    if (n.rank > maxRank) {
-      maxRank = n.rank;
-    }
-  }
-
-   visited = [];
-  function dfsFindRankLate(n) {
-    if (visited[n.id]) return;
-    visited[n.id] = true;
-    var originalRank = n.rank;
-    var newRank = n.rank;
-    var firstInput = true;
-    for (var l = 0; l < n.outputs.length; ++l) {
-      var output = n.outputs[l].target;
-      dfsFindRankLate(output);
-      var outputRank = output.rank;
-      if (output.visible && (firstInput || outputRank <= newRank) &&
-          (outputRank > originalRank)) {
-        newRank = outputRank - 1;
-      }
-      firstInput = false;
-    }
-    if (n.opcode != "Start" && n.opcode != "Phi" && n.opcode != "EffectPhi") {
-      n.rank = newRank;
-    }
-  }
-
-  startNodes.forEach(dfsFindRankLate);
-
-  visited = [];
-  function dfsRankOrder(n) {
-    if (visited[n.id]) return;
-    visited[n.id] = true;
-    for (var l = 0; l < n.outputs.length; ++l) {
-      var edge = n.outputs[l];
-      if (edge.isVisible()) {
-        var output = edge.target;
-        dfsRankOrder(output);
-      }
-    }
-    if (n.visitOrderWithinRank == 0) {
-      n.visitOrderWithinRank = ++visitOrderWithinRank;
-    }
-  }
-  startNodes.forEach(dfsRankOrder);
-
-  endNodes.forEach(function(n) {
-    n.rank = maxRank + 1;
-  });
-
-  var rankSets = [];
-  // Collect sets for each rank.
-  graph.nodes.forEach(function(n, i){
-    n.y = n.rank * (DEFAULT_NODE_ROW_SEPARATION + graph.getNodeHeight(n) +
-                    2 * DEFAULT_NODE_BUBBLE_RADIUS);
-    if (n.visible) {
-      if (rankSets[n.rank] === undefined) {
-        rankSets[n.rank] = [n];
-      } else {
-        rankSets[n.rank].push(n);
-      }
-    }
-  });
-
-  // Iterate backwards from highest to lowest rank, placing nodes so that they
-  // spread out from the "center" as much as possible while still being
-  // compact and not overlapping live input lines.
-  var occupation = newGraphOccupation(graph);
-  var rankCount = 0;
-
-  rankSets.reverse().forEach(function(rankSet) {
-
-    for (var i = 0; i < rankSet.length; ++i) {
-      occupation.clearNodeOutputs(rankSet[i]);
-    }
-
-    if (traceLayout) {
-      console.log("After clearing outputs");
-      occupation.print();
-    }
-
-    var placedCount = 0;
-    rankSet = rankSet.sort(function(a,b) {
-      return a.visitOrderWithinRank < b.visitOrderWithinRank;
-    });
-    for (var i = 0; i < rankSet.length; ++i) {
-      var nodeToPlace = rankSet[i];
-      if (nodeToPlace.visible) {
-        nodeToPlace.x = occupation.occupyNode(nodeToPlace);
-        if (traceLayout) {
-          console.log("Node " + nodeToPlace.id + " is placed between [" + nodeToPlace.x + ", " + (nodeToPlace.x + nodeToPlace.getTotalNodeWidth()) + ")");
-        }
-        var staggeredFlooredI = Math.floor(placedCount++ % 3);
-        var delta = MINIMUM_EDGE_SEPARATION * staggeredFlooredI
-        nodeToPlace.outputApproach += delta;
-      } else {
-        nodeToPlace.x = 0;
-      }
-    }
-
-    if (traceLayout) {
-      console.log("Before clearing nodes");
-      occupation.print();
-    }
-
-    occupation.clearOccupiedNodes();
-
-    if (traceLayout) {
-      console.log("After clearing nodes");
-      occupation.print();
-    }
-
-    for (var i = 0; i < rankSet.length; ++i) {
-      var node = rankSet[i];
-      occupation.occupyNodeInputs(node);
-    }
-
-    if (traceLayout) {
-      console.log("After occupying inputs");
-      occupation.print();
-    }
-
-    if (traceLayout) {
-      console.log("After determining bounding box");
-      occupation.print();
-    }
-  });
-
-  graph.maxBackEdgeNumber = 0;
-  graph.visibleEdges.each(function (e) {
-    if (e.isBackEdge()) {
-      e.backEdgeNumber = ++graph.maxBackEdgeNumber;
-    } else {
-      e.backEdgeNumber = 0;
-    }
-  });
-
-  redetermineGraphBoundingBox(graph);
-
-}
-
-function redetermineGraphBoundingBox(graph) {
-  graph.minGraphX = 0;
-  graph.maxGraphNodeX = 1;
-  graph.maxGraphX = undefined;  // see below
-  graph.minGraphY = 0;
-  graph.maxGraphY = 1;
-
-  for (var i = 0; i < graph.nodes.length; ++i) {
-    var node = graph.nodes[i];
-
-    if (!node.visible) {
-      continue;
-    }
-
-    if (node.x < graph.minGraphX) {
-      graph.minGraphX = node.x;
-    }
-    if ((node.x + node.getTotalNodeWidth()) > graph.maxGraphNodeX) {
-      graph.maxGraphNodeX = node.x + node.getTotalNodeWidth();
-    }
-    if ((node.y - 50) < graph.minGraphY) {
-      graph.minGraphY = node.y - 50;
-    }
-    if ((node.y + graph.getNodeHeight(node) + 50) > graph.maxGraphY) {
-      graph.maxGraphY = node.y + graph.getNodeHeight(node) + 50;
-    }
-  }
-
-  graph.maxGraphX = graph.maxGraphNodeX +
-    graph.maxBackEdgeNumber * MINIMUM_EDGE_SEPARATION;
-
-}
diff --git a/src/v8/tools/turbolizer/graph-view.js b/src/v8/tools/turbolizer/graph-view.js
deleted file mode 100644
index cdbc40c..0000000
--- a/src/v8/tools/turbolizer/graph-view.js
+++ /dev/null
@@ -1,1063 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-"use strict";
-
-class GraphView extends View {
-  constructor (d3, id, nodes, edges, broker) {
-    super(id, broker);
-    var graph = this;
-
-    var svg = this.divElement.append("svg").attr('version','1.1').attr("width", "100%");
-    graph.svg = svg;
-
-    graph.nodes = nodes || [];
-    graph.edges = edges || [];
-
-    graph.minGraphX = 0;
-    graph.maxGraphX = 1;
-    graph.minGraphY = 0;
-    graph.maxGraphY = 1;
-
-    graph.state = {
-      selection: null,
-      mouseDownNode: null,
-      justDragged: false,
-      justScaleTransGraph: false,
-      lastKeyDown: -1,
-      showTypes: false
-    };
-
-    var selectionHandler = {
-      clear: function() {
-        broker.clear(selectionHandler);
-      },
-      select: function(items, selected) {
-        var locations = [];
-        for (var d of items) {
-          if (selected) {
-            d.classList.add("selected");
-          } else {
-            d.classList.remove("selected");
-          }
-          var data = d.__data__;
-          locations.push({ pos_start: data.pos, pos_end: data.pos + 1, node_id: data.id});
-        }
-        broker.select(selectionHandler, locations, selected);
-      },
-      selectionDifference: function(span1, inclusive1, span2, inclusive2) {
-        // Should not be called
-      },
-      brokeredSelect: function(locations, selected) {
-        var test = [].entries().next();
-        var selection = graph.nodes
-          .filter(function(n) {
-            var pos = n.pos;
-            for (var location of locations) {
-              var start = location.pos_start;
-              var end = location.pos_end;
-              var id = location.node_id;
-              if (end != undefined) {
-                if (pos >= start && pos < end) {
-                  return true;
-                }
-              } else if (start != undefined) {
-                if (pos === start) {
-                  return true;
-                }
-              } else {
-                if (n.id === id) {
-                  return true;
-                }
-              }
-            }
-            return false;
-          });
-        var newlySelected = new Set();
-        selection.forEach(function(n) {
-          newlySelected.add(n);
-          if (!n.visible) {
-            n.visible = true;
-          }
-        });
-        graph.updateGraphVisibility();
-        graph.visibleNodes.each(function(n) {
-          if (newlySelected.has(n)) {
-            graph.state.selection.select(this, selected);
-          }
-        });
-        graph.updateGraphVisibility();
-        graph.viewSelection();
-      },
-      brokeredClear: function() {
-        graph.state.selection.clear();
-      }
-    };
-    broker.addSelectionHandler(selectionHandler);
-
-    graph.state.selection = new Selection(selectionHandler);
-
-    var defs = svg.append('svg:defs');
-    defs.append('svg:marker')
-      .attr('id', 'end-arrow')
-      .attr('viewBox', '0 -4 8 8')
-      .attr('refX', 2)
-      .attr('markerWidth', 2.5)
-      .attr('markerHeight', 2.5)
-      .attr('orient', 'auto')
-      .append('svg:path')
-      .attr('d', 'M0,-4L8,0L0,4');
-
-    this.graphElement = svg.append("g");
-    graph.visibleEdges = this.graphElement.append("g").selectAll("g");
-    graph.visibleNodes = this.graphElement.append("g").selectAll("g");
-
-    graph.drag = d3.behavior.drag()
-      .origin(function(d){
-        return {x: d.x, y: d.y};
-      })
-      .on("drag", function(args){
-        graph.state.justDragged = true;
-        graph.dragmove.call(graph, args);
-      })
-
-    d3.select("#upload").on("click", partial(this.uploadAction, graph));
-    d3.select("#layout").on("click", partial(this.layoutAction, graph));
-    d3.select("#show-all").on("click", partial(this.showAllAction, graph));
-    d3.select("#hide-dead").on("click", partial(this.hideDeadAction, graph));
-    d3.select("#hide-unselected").on("click", partial(this.hideUnselectedAction, graph));
-    d3.select("#hide-selected").on("click", partial(this.hideSelectedAction, graph));
-    d3.select("#zoom-selection").on("click", partial(this.zoomSelectionAction, graph));
-    d3.select("#toggle-types").on("click", partial(this.toggleTypesAction, graph));
-    d3.select("#search-input").on("keydown", partial(this.searchInputAction, graph));
-
-    // listen for key events
-    d3.select(window).on("keydown", function(e){
-      graph.svgKeyDown.call(graph);
-    })
-      .on("keyup", function(){
-        graph.svgKeyUp.call(graph);
-      });
-    svg.on("mousedown", function(d){graph.svgMouseDown.call(graph, d);});
-    svg.on("mouseup", function(d){graph.svgMouseUp.call(graph, d);});
-
-    graph.dragSvg = d3.behavior.zoom()
-      .on("zoom", function(){
-        if (d3.event.sourceEvent.shiftKey){
-          return false;
-        } else{
-          graph.zoomed.call(graph);
-        }
-        return true;
-      })
-      .on("zoomstart", function(){
-        if (!d3.event.sourceEvent.shiftKey) d3.select('body').style("cursor", "move");
-      })
-      .on("zoomend", function(){
-        d3.select('body').style("cursor", "auto");
-      });
-
-    svg.call(graph.dragSvg).on("dblclick.zoom", null);
-  }
-
-  static get selectedClass() {
-    return "selected";
-  }
-  static get rectClass() {
-    return "nodeStyle";
-  }
-  static get activeEditId() {
-    return "active-editing";
-  }
-  static get nodeRadius() {
-    return 50;
-  }
-
-  getNodeHeight(d) {
-    if (this.state.showTypes) {
-      return d.normalheight + d.labelbbox.height;
-    } else {
-      return d.normalheight;
-    }
-  }
-
-  getEdgeFrontier(nodes, inEdges, edgeFilter) {
-    let frontier = new Set();
-    nodes.forEach(function(element) {
-      var edges = inEdges ? element.__data__.inputs : element.__data__.outputs;
-      var edgeNumber = 0;
-      edges.forEach(function(edge) {
-        if (edgeFilter == undefined || edgeFilter(edge, edgeNumber)) {
-          frontier.add(edge);
-        }
-        ++edgeNumber;
-      });
-    });
-    return frontier;
-  }
-
-  getNodeFrontier(nodes, inEdges, edgeFilter) {
-    let graph = this;
-    var frontier = new Set();
-    var newState = true;
-    var edgeFrontier = graph.getEdgeFrontier(nodes, inEdges, edgeFilter);
-    // Control key toggles edges rather than just turning them on
-    if (d3.event.ctrlKey) {
-      edgeFrontier.forEach(function(edge) {
-        if (edge.visible) {
-          newState = false;
-        }
-      });
-    }
-    edgeFrontier.forEach(function(edge) {
-      edge.visible = newState;
-      if (newState) {
-        var node = inEdges ? edge.source : edge.target;
-        node.visible = true;
-        frontier.add(node);
-      }
-    });
-    graph.updateGraphVisibility();
-    if (newState) {
-      return graph.visibleNodes.filter(function(n) {
-        return frontier.has(n);
-      });
-    } else {
-      return undefined;
-    }
-  }
-
-  dragmove(d) {
-    var graph = this;
-    d.x += d3.event.dx;
-    d.y += d3.event.dy;
-    graph.updateGraphVisibility();
-  }
-
-  initializeContent(data, rememberedSelection) {
-    this.createGraph(data, rememberedSelection);
-    if (rememberedSelection != null) {
-      this.attachSelection(rememberedSelection);
-      this.connectVisibleSelectedNodes();
-      this.viewSelection();
-    }
-    this.updateGraphVisibility();
-  }
-
-  deleteContent() {
-    if (this.visibleNodes) {
-      this.nodes = [];
-      this.edges = [];
-      this.nodeMap = [];
-      this.updateGraphVisibility();
-    }
-  };
-
-  measureText(text) {
-    var textMeasure = document.getElementById('text-measure');
-    textMeasure.textContent = text;
-    return {
-      width: textMeasure.getBBox().width,
-      height: textMeasure.getBBox().height,
-    };
-  }
-
-  createGraph(data, initiallyVisibileIds) {
-    var g = this;
-    g.nodes = data.nodes;
-    g.nodeMap = [];
-    g.nodes.forEach(function(n, i){
-      n.__proto__ = Node;
-      n.visible = false;
-      n.x = 0;
-      n.y = 0;
-      n.rank = MAX_RANK_SENTINEL;
-      n.inputs = [];
-      n.outputs = [];
-      n.rpo = -1;
-      n.outputApproach = MINIMUM_NODE_OUTPUT_APPROACH;
-      n.cfg = n.control;
-      g.nodeMap[n.id] = n;
-      n.displayLabel = n.getDisplayLabel();
-      n.labelbbox = g.measureText(n.displayLabel);
-      n.typebbox = g.measureText(n.getDisplayType());
-      var innerwidth = Math.max(n.labelbbox.width, n.typebbox.width);
-      n.width = Math.alignUp(innerwidth + NODE_INPUT_WIDTH * 2,
-                             NODE_INPUT_WIDTH);
-      var innerheight = Math.max(n.labelbbox.height, n.typebbox.height);
-      n.normalheight = innerheight + 20;
-    });
-    g.edges = [];
-    data.edges.forEach(function(e, i){
-      var t = g.nodeMap[e.target];
-      var s = g.nodeMap[e.source];
-      var newEdge = new Edge(t, e.index, s, e.type);
-      t.inputs.push(newEdge);
-      s.outputs.push(newEdge);
-      g.edges.push(newEdge);
-      if (e.type == 'control') {
-        s.cfg = true;
-      }
-    });
-    g.nodes.forEach(function(n, i) {
-      n.visible = isNodeInitiallyVisible(n);
-      if (initiallyVisibileIds != undefined) {
-        if (initiallyVisibileIds.has(n.id)) {
-          n.visible = true;
-        }
-      }
-    });
-    g.fitGraphViewToWindow();
-    g.updateGraphVisibility();
-    g.layoutGraph();
-    g.updateGraphVisibility();
-    g.viewWholeGraph();
-  }
-
-  connectVisibleSelectedNodes() {
-    var graph = this;
-    graph.state.selection.selection.forEach(function(element) {
-      var edgeNumber = 0;
-      element.__data__.inputs.forEach(function(edge) {
-        if (edge.source.visible && edge.target.visible) {
-          edge.visible = true;
-        }
-      });
-      element.__data__.outputs.forEach(function(edge) {
-        if (edge.source.visible && edge.target.visible) {
-          edge.visible = true;
-        }
-      });
-    });
-  }
-
-  updateInputAndOutputBubbles() {
-    var g = this;
-    var s = g.visibleBubbles;
-    s.classed("filledBubbleStyle", function(c) {
-      var components = this.id.split(',');
-      if (components[0] == "ib") {
-        var edge = g.nodeMap[components[3]].inputs[components[2]];
-        return edge.isVisible();
-      } else {
-        return g.nodeMap[components[1]].areAnyOutputsVisible() == 2;
-      }
-    }).classed("halfFilledBubbleStyle", function(c) {
-      var components = this.id.split(',');
-      if (components[0] == "ib") {
-        var edge = g.nodeMap[components[3]].inputs[components[2]];
-        return false;
-      } else {
-        return g.nodeMap[components[1]].areAnyOutputsVisible() == 1;
-      }
-    }).classed("bubbleStyle", function(c) {
-      var components = this.id.split(',');
-      if (components[0] == "ib") {
-        var edge = g.nodeMap[components[3]].inputs[components[2]];
-        return !edge.isVisible();
-      } else {
-        return g.nodeMap[components[1]].areAnyOutputsVisible() == 0;
-      }
-    });
-    s.each(function(c) {
-      var components = this.id.split(',');
-      if (components[0] == "ob") {
-        var from = g.nodeMap[components[1]];
-        var x = from.getOutputX();
-        var y = g.getNodeHeight(from) + DEFAULT_NODE_BUBBLE_RADIUS;
-        var transform = "translate(" + x + "," + y + ")";
-        this.setAttribute('transform', transform);
-      }
-    });
-  }
-
-  attachSelection(s) {
-    var graph = this;
-    if (s.size != 0) {
-      this.visibleNodes.each(function(n) {
-        if (s.has(this.__data__.id)) {
-          graph.state.selection.select(this, true);
-        }
-      });
-    }
-  }
-
-  detachSelection() {
-    var selection = this.state.selection.detachSelection();
-    var s = new Set();
-    for (var i of selection) {
-      s.add(i.__data__.id);
-    };
-    return s;
-  }
-
-  pathMouseDown(path, d) {
-    d3.event.stopPropagation();
-    this.state.selection.clear();
-    this.state.selection.add(path);
-  };
-
-  nodeMouseDown(node, d) {
-    d3.event.stopPropagation();
-    this.state.mouseDownNode = d;
-  }
-
-  nodeMouseUp(d3node, d) {
-    var graph = this,
-    state = graph.state,
-    consts = graph.consts;
-
-    var mouseDownNode = state.mouseDownNode;
-
-    if (!mouseDownNode) return;
-
-    if (state.justDragged) {
-      // dragged, not clicked
-      redetermineGraphBoundingBox(graph);
-      state.justDragged = false;
-    } else{
-      // clicked, not dragged
-      var extend = d3.event.shiftKey;
-      var selection = graph.state.selection;
-      if (!extend) {
-        selection.clear();
-      }
-      selection.select(d3node[0][0], true);
-    }
-  }
-
-  selectSourcePositions(start, end, selected) {
-    var graph = this;
-    var map = [];
-    var sel = graph.nodes.filter(function(n) {
-      var pos = (n.pos === undefined)
-        ? -1
-        : n.getFunctionRelativeSourcePosition(graph);
-      if (pos >= start && pos < end) {
-        map[n.id] = true;
-        n.visible = true;
-      }
-    });
-    graph.updateGraphVisibility();
-    graph.visibleNodes.filter(function(n) { return map[n.id]; })
-      .each(function(n) {
-        var selection = graph.state.selection;
-        selection.select(d3.select(this), selected);
-      });
-  }
-
-  selectAllNodes(inEdges, filter) {
-    var graph = this;
-    if (!d3.event.shiftKey) {
-      graph.state.selection.clear();
-    }
-    graph.state.selection.select(graph.visibleNodes[0], true);
-    graph.updateGraphVisibility();
-  }
-
-  uploadAction(graph) {
-    document.getElementById("hidden-file-upload").click();
-  }
-
-  layoutAction(graph) {
-    graph.updateGraphVisibility();
-    graph.layoutGraph();
-    graph.updateGraphVisibility();
-    graph.viewWholeGraph();
-  }
-
-  showAllAction(graph) {
-    graph.nodes.filter(function(n) { n.visible = true; })
-    graph.edges.filter(function(e) { e.visible = true; })
-    graph.updateGraphVisibility();
-    graph.viewWholeGraph();
-  }
-
-  hideDeadAction(graph) {
-    graph.nodes.filter(function(n) { if (!n.isLive()) n.visible = false; })
-    graph.updateGraphVisibility();
-  }
-
-  hideUnselectedAction(graph) {
-    var unselected = graph.visibleNodes.filter(function(n) {
-      return !this.classList.contains("selected");
-    });
-    unselected.each(function(n) {
-      n.visible = false;
-    });
-    graph.updateGraphVisibility();
-  }
-
-  hideSelectedAction(graph) {
-    var selected = graph.visibleNodes.filter(function(n) {
-      return this.classList.contains("selected");
-    });
-    selected.each(function(n) {
-      n.visible = false;
-    });
-    graph.state.selection.clear();
-    graph.updateGraphVisibility();
-  }
-
-  zoomSelectionAction(graph) {
-    graph.viewSelection();
-  }
-
-  toggleTypesAction(graph) {
-    graph.toggleTypes();
-  }
-
-  searchInputAction(graph) {
-    if (d3.event.keyCode == 13) {
-      graph.state.selection.clear();
-      var query = this.value;
-      window.sessionStorage.setItem("lastSearch", query);
-
-      var reg = new RegExp(query);
-      var filterFunction = function(n) {
-        return (reg.exec(n.getDisplayLabel()) != null ||
-                (graph.state.showTypes && reg.exec(n.getDisplayType())) ||
-                reg.exec(n.opcode) != null);
-      };
-      if (d3.event.ctrlKey) {
-        graph.nodes.forEach(function(n, i) {
-          if (filterFunction(n)) {
-            n.visible = true;
-          }
-        });
-        graph.updateGraphVisibility();
-      }
-      var selected = graph.visibleNodes.each(function(n) {
-        if (filterFunction(n)) {
-          graph.state.selection.select(this, true);
-        }
-      });
-      graph.connectVisibleSelectedNodes();
-      graph.updateGraphVisibility();
-      this.blur();
-      graph.viewSelection();
-    }
-    d3.event.stopPropagation();
-  }
-
-  svgMouseDown() {
-    this.state.graphMouseDown = true;
-  }
-
-  svgMouseUp() {
-    var graph = this,
-    state = graph.state;
-    if (state.justScaleTransGraph) {
-      // Dragged
-      state.justScaleTransGraph = false;
-    } else {
-      // Clicked
-      if (state.mouseDownNode == null) {
-        graph.state.selection.clear();
-      }
-    }
-    state.mouseDownNode = null;
-    state.graphMouseDown = false;
-  }
-
-  svgKeyDown() {
-    var state = this.state;
-    var graph = this;
-
-    // Don't handle key press repetition
-    if(state.lastKeyDown !== -1) return;
-
-    var showSelectionFrontierNodes = function(inEdges, filter, select) {
-      var frontier = graph.getNodeFrontier(state.selection.selection, inEdges, filter);
-      if (frontier != undefined) {
-        if (select) {
-          if (!d3.event.shiftKey) {
-            state.selection.clear();
-          }
-          state.selection.select(frontier[0], true);
-        }
-        graph.updateGraphVisibility();
-      }
-      allowRepetition = false;
-    }
-
-    var allowRepetition = true;
-    var eventHandled = true; // unless the below switch defaults
-    switch(d3.event.keyCode) {
-    case 49:
-    case 50:
-    case 51:
-    case 52:
-    case 53:
-    case 54:
-    case 55:
-    case 56:
-    case 57:
-      // '1'-'9'
-      showSelectionFrontierNodes(true,
-          (edge, index) => { return index == (d3.event.keyCode - 49); },
-          false);
-      break;
-    case 97:
-    case 98:
-    case 99:
-    case 100:
-    case 101:
-    case 102:
-    case 103:
-    case 104:
-    case 105:
-      // 'numpad 1'-'numpad 9'
-      showSelectionFrontierNodes(true,
-          (edge, index) => { return index == (d3.event.keyCode - 97); },
-          false);
-      break;
-    case 67:
-      // 'c'
-      showSelectionFrontierNodes(true,
-          (edge, index) => { return edge.type == 'control'; },
-          false);
-      break;
-    case 69:
-      // 'e'
-      showSelectionFrontierNodes(true,
-          (edge, index) => { return edge.type == 'effect'; },
-          false);
-      break;
-    case 79:
-      // 'o'
-      showSelectionFrontierNodes(false, undefined, false);
-      break;
-    case 73:
-      // 'i'
-      showSelectionFrontierNodes(true, undefined, false);
-      break;
-    case 65:
-      // 'a'
-      graph.selectAllNodes();
-      allowRepetition = false;
-      break;
-    case 38:
-    case 40: {
-      showSelectionFrontierNodes(d3.event.keyCode == 38, undefined, true);
-      break;
-    }
-    case 82:
-      // 'r'
-      if (!d3.event.ctrlKey) {
-        this.layoutAction(this);
-      } else {
-        eventHandled = false;
-      }
-      break;
-    case 191:
-      // '/'
-      document.getElementById("search-input").focus();
-      document.getElementById("search-input").select();
-      break;
-    default:
-      eventHandled = false;
-      break;
-    }
-    if (eventHandled) {
-      d3.event.preventDefault();
-    }
-    if (!allowRepetition) {
-      state.lastKeyDown = d3.event.keyCode;
-    }
-  }
-
-  svgKeyUp() {
-    this.state.lastKeyDown = -1
-  };
-
-  layoutEdges() {
-    var graph = this;
-    graph.maxGraphX = graph.maxGraphNodeX;
-    this.visibleEdges.attr("d", function(edge){
-      return edge.generatePath(graph);
-    });
-  }
-
-  layoutGraph() {
-    layoutNodeGraph(this);
-  }
-
-  // call to propagate changes to graph
-  updateGraphVisibility() {
-
-    var graph = this,
-    state = graph.state;
-
-    var filteredEdges = graph.edges.filter(function(e) { return e.isVisible(); });
-    var visibleEdges = graph.visibleEdges.data(filteredEdges, function(edge) {
-      return edge.stringID();
-    });
-
-    // add new paths
-    visibleEdges.enter()
-      .append('path')
-      .style('marker-end','url(#end-arrow)')
-      .classed('hidden', function(e) {
-        return !e.isVisible();
-      })
-      .attr("id", function(edge){ return "e," + edge.stringID(); })
-      .on("mousedown", function(d){
-        graph.pathMouseDown.call(graph, d3.select(this), d);
-      })
-      .attr("adjacentToHover", "false");
-
-    // Set the correct styles on all of the paths
-    visibleEdges.classed('value', function(e) {
-      return e.type == 'value' || e.type == 'context';
-    }).classed('control', function(e) {
-      return e.type == 'control';
-    }).classed('effect', function(e) {
-      return e.type == 'effect';
-    }).classed('frame-state', function(e) {
-      return e.type == 'frame-state';
-    }).attr('stroke-dasharray', function(e) {
-      if (e.type == 'frame-state') return "10,10";
-      return (e.type == 'effect') ? "5,5" : "";
-    });
-
-    // remove old links
-    visibleEdges.exit().remove();
-
-    graph.visibleEdges = visibleEdges;
-
-    // update existing nodes
-    var filteredNodes = graph.nodes.filter(function(n) { return n.visible; });
-    graph.visibleNodes = graph.visibleNodes.data(filteredNodes, function(d) {
-      return d.id;
-    });
-    graph.visibleNodes.attr("transform", function(n){
-      return "translate(" + n.x + "," + n.y + ")";
-    }).select('rect').
-      attr(HEIGHT, function(d) { return graph.getNodeHeight(d); });
-
-    // add new nodes
-    var newGs = graph.visibleNodes.enter()
-      .append("g");
-
-    newGs.classed("turbonode", function(n) { return true; })
-      .classed("control", function(n) { return n.isControl(); })
-      .classed("live", function(n) { return n.isLive(); })
-      .classed("dead", function(n) { return !n.isLive(); })
-      .classed("javascript", function(n) { return n.isJavaScript(); })
-      .classed("input", function(n) { return n.isInput(); })
-      .classed("simplified", function(n) { return n.isSimplified(); })
-      .classed("machine", function(n) { return n.isMachine(); })
-      .attr("transform", function(d){ return "translate(" + d.x + "," + d.y + ")";})
-      .on("mousedown", function(d){
-        graph.nodeMouseDown.call(graph, d3.select(this), d);
-      })
-      .on("mouseup", function(d){
-        graph.nodeMouseUp.call(graph, d3.select(this), d);
-      })
-      .on('mouseover', function(d){
-        var nodeSelection = d3.select(this);
-        let node = graph.nodeMap[d.id];
-        let adjInputEdges = graph.visibleEdges.filter(e => { return e.target === node; });
-        let adjOutputEdges = graph.visibleEdges.filter(e => { return e.source === node; });
-        adjInputEdges.attr('relToHover', "input");
-        adjOutputEdges.attr('relToHover', "output");
-        let adjInputNodes = adjInputEdges.data().map(e => e.source);
-        graph.visibleNodes.data(adjInputNodes, function(d) {
-          return d.id;
-        }).attr('relToHover', "input");
-        let adjOutputNodes = adjOutputEdges.data().map(e => e.target);
-        graph.visibleNodes.data(adjOutputNodes, function(d) {
-          return d.id;
-        }).attr('relToHover', "output");
-        graph.updateGraphVisibility();
-      })
-      .on('mouseout', function(d){
-        var nodeSelection = d3.select(this);
-        let node = graph.nodeMap[d.id];
-        let adjEdges = graph.visibleEdges.filter(e => { return e.target === node  || e.source === node; });
-        adjEdges.attr('relToHover', "none");
-        let adjNodes = adjEdges.data().map(e => e.target).concat(adjEdges.data().map(e => e.source));
-        let nodes = graph.visibleNodes.data(adjNodes, function(d) {
-          return d.id;
-        }).attr('relToHover', "none");
-        graph.updateGraphVisibility();
-      })
-      .call(graph.drag);
-
-    newGs.append("rect")
-      .attr("rx", 10)
-      .attr("ry", 10)
-      .attr(WIDTH, function(d) {
-        return d.getTotalNodeWidth();
-      })
-      .attr(HEIGHT, function(d) {
-        return graph.getNodeHeight(d);
-      })
-
-    function appendInputAndOutputBubbles(g, d) {
-      for (var i = 0; i < d.inputs.length; ++i) {
-        var x = d.getInputX(i);
-        var y = -DEFAULT_NODE_BUBBLE_RADIUS;
-        var s = g.append('circle')
-          .classed("filledBubbleStyle", function(c) {
-            return d.inputs[i].isVisible();
-          } )
-          .classed("bubbleStyle", function(c) {
-            return !d.inputs[i].isVisible();
-          } )
-          .attr("id", "ib," + d.inputs[i].stringID())
-          .attr("r", DEFAULT_NODE_BUBBLE_RADIUS)
-          .attr("transform", function(d) {
-            return "translate(" + x + "," + y + ")";
-          })
-          .on("mousedown", function(d){
-            var components = this.id.split(',');
-            var node = graph.nodeMap[components[3]];
-            var edge = node.inputs[components[2]];
-            var visible = !edge.isVisible();
-            node.setInputVisibility(components[2], visible);
-            d3.event.stopPropagation();
-            graph.updateGraphVisibility();
-          });
-      }
-      if (d.outputs.length != 0) {
-        var x = d.getOutputX();
-        var y = graph.getNodeHeight(d) + DEFAULT_NODE_BUBBLE_RADIUS;
-        var s = g.append('circle')
-          .classed("filledBubbleStyle", function(c) {
-            return d.areAnyOutputsVisible() == 2;
-          } )
-          .classed("halFilledBubbleStyle", function(c) {
-            return d.areAnyOutputsVisible() == 1;
-          } )
-          .classed("bubbleStyle", function(c) {
-            return d.areAnyOutputsVisible() == 0;
-          } )
-          .attr("id", "ob," + d.id)
-          .attr("r", DEFAULT_NODE_BUBBLE_RADIUS)
-          .attr("transform", function(d) {
-            return "translate(" + x + "," + y + ")";
-          })
-          .on("mousedown", function(d) {
-            d.setOutputVisibility(d.areAnyOutputsVisible() == 0);
-            d3.event.stopPropagation();
-            graph.updateGraphVisibility();
-          });
-      }
-    }
-
-    newGs.each(function(d){
-      appendInputAndOutputBubbles(d3.select(this), d);
-    });
-
-    newGs.each(function(d){
-      d3.select(this).append("text")
-        .classed("label", true)
-        .attr("text-anchor","right")
-        .attr("dx", 5)
-        .attr("dy", 5)
-        .append('tspan')
-        .text(function(l) {
-          return d.getDisplayLabel();
-        })
-        .append("title")
-        .text(function(l) {
-          return d.getTitle();
-        })
-      if (d.type != undefined) {
-        d3.select(this).append("text")
-          .classed("label", true)
-          .classed("type", true)
-          .attr("text-anchor","right")
-          .attr("dx", 5)
-          .attr("dy", d.labelbbox.height + 5)
-          .append('tspan')
-          .text(function(l) {
-            return d.getDisplayType();
-          })
-          .append("title")
-          .text(function(l) {
-            return d.getType();
-          })
-      }
-    });
-
-    graph.visibleNodes.select('.type').each(function (d) {
-      this.setAttribute('visibility', graph.state.showTypes ? 'visible' : 'hidden');
-    });
-
-    // remove old nodes
-    graph.visibleNodes.exit().remove();
-
-    graph.visibleBubbles = d3.selectAll('circle');
-
-    graph.updateInputAndOutputBubbles();
-
-    graph.layoutEdges();
-
-    graph.svg.style.height = '100%';
-  }
-
-  getVisibleTranslation(translate, scale) {
-    var graph = this;
-    var height = (graph.maxGraphY - graph.minGraphY + 2 * GRAPH_MARGIN) * scale;
-    var width = (graph.maxGraphX - graph.minGraphX + 2 * GRAPH_MARGIN) * scale;
-
-    var dimensions = this.getSvgViewDimensions();
-
-    var baseY = translate[1];
-    var minY = (graph.minGraphY - GRAPH_MARGIN) * scale;
-    var maxY = (graph.maxGraphY + GRAPH_MARGIN) * scale;
-
-    var adjustY = 0;
-    var adjustYCandidate = 0;
-    if ((maxY + baseY) < dimensions[1]) {
-      adjustYCandidate = dimensions[1] - (maxY + baseY);
-      if ((minY + baseY + adjustYCandidate) > 0) {
-        adjustY = (dimensions[1] / 2) - (maxY - (height / 2)) - baseY;
-      } else {
-        adjustY = adjustYCandidate;
-      }
-    } else if (-baseY < minY) {
-      adjustYCandidate = -(baseY + minY);
-      if ((maxY + baseY + adjustYCandidate) < dimensions[1]) {
-        adjustY = (dimensions[1] / 2) - (maxY - (height / 2)) - baseY;
-      } else {
-        adjustY = adjustYCandidate;
-      }
-    }
-    translate[1] += adjustY;
-
-    var baseX = translate[0];
-    var minX = (graph.minGraphX - GRAPH_MARGIN) * scale;
-    var maxX = (graph.maxGraphX + GRAPH_MARGIN) * scale;
-
-    var adjustX = 0;
-    var adjustXCandidate = 0;
-    if ((maxX + baseX) < dimensions[0]) {
-      adjustXCandidate = dimensions[0] - (maxX + baseX);
-      if ((minX + baseX + adjustXCandidate) > 0) {
-        adjustX = (dimensions[0] / 2) - (maxX - (width / 2)) - baseX;
-      } else {
-        adjustX = adjustXCandidate;
-      }
-    } else if (-baseX < minX) {
-      adjustXCandidate = -(baseX + minX);
-      if ((maxX + baseX + adjustXCandidate) < dimensions[0]) {
-        adjustX = (dimensions[0] / 2) - (maxX - (width / 2)) - baseX;
-      } else {
-        adjustX = adjustXCandidate;
-      }
-    }
-    translate[0] += adjustX;
-    return translate;
-  }
-
-  translateClipped(translate, scale, transition) {
-    var graph = this;
-    var graphNode = this.graphElement[0][0];
-    var translate = this.getVisibleTranslation(translate, scale);
-    if (transition) {
-      graphNode.classList.add('visible-transition');
-      clearTimeout(graph.transitionTimout);
-      graph.transitionTimout = setTimeout(function(){
-        graphNode.classList.remove('visible-transition');
-      }, 1000);
-    }
-    var translateString = "translate(" + translate[0] + "px," + translate[1] + "px) scale(" + scale + ")";
-    graphNode.style.transform = translateString;
-    graph.dragSvg.translate(translate);
-    graph.dragSvg.scale(scale);
-  }
-
-  zoomed(){
-    this.state.justScaleTransGraph = true;
-    var scale =  this.dragSvg.scale();
-    this.translateClipped(d3.event.translate, scale);
-  }
-
-
-  getSvgViewDimensions() {
-    var canvasWidth = this.parentNode.clientWidth;
-    var documentElement = document.documentElement;
-    var canvasHeight = documentElement.clientHeight;
-    return [canvasWidth, canvasHeight];
-  }
-
-
-  minScale() {
-    var graph = this;
-    var dimensions = this.getSvgViewDimensions();
-    var width = graph.maxGraphX - graph.minGraphX;
-    var height = graph.maxGraphY - graph.minGraphY;
-    var minScale = dimensions[0] / (width + GRAPH_MARGIN * 2);
-    var minScaleYCandidate = dimensions[1] / (height + GRAPH_MARGIN * 2);
-    if (minScaleYCandidate < minScale) {
-      minScale = minScaleYCandidate;
-    }
-    this.dragSvg.scaleExtent([minScale, 1.5]);
-    return minScale;
-  }
-
-  fitGraphViewToWindow() {
-    this.svg.attr("height", document.documentElement.clientHeight + "px");
-    this.translateClipped(this.dragSvg.translate(), this.dragSvg.scale());
-  }
-
-  toggleTypes() {
-    var graph = this;
-    graph.state.showTypes = !graph.state.showTypes;
-    var element = document.getElementById('toggle-types');
-    if (graph.state.showTypes) {
-      element.classList.add('button-input-toggled');
-    } else {
-      element.classList.remove('button-input-toggled');
-    }
-    graph.updateGraphVisibility();
-  }
-
-  viewSelection() {
-    var graph = this;
-    var minX, maxX, minY, maxY;
-    var hasSelection = false;
-    graph.visibleNodes.each(function(n) {
-      if (this.classList.contains("selected")) {
-        hasSelection = true;
-        minX = minX ? Math.min(minX, n.x) : n.x;
-        maxX = maxX ? Math.max(maxX, n.x + n.getTotalNodeWidth()) :
-          n.x + n.getTotalNodeWidth();
-        minY = minY ? Math.min(minY, n.y) : n.y;
-        maxY = maxY ? Math.max(maxY, n.y + graph.getNodeHeight(n)) :
-          n.y + graph.getNodeHeight(n);
-      }
-    });
-    if (hasSelection) {
-      graph.viewGraphRegion(minX - NODE_INPUT_WIDTH, minY - 60,
-                            maxX + NODE_INPUT_WIDTH, maxY + 60,
-                            true);
-    }
-  }
-
-  viewGraphRegion(minX, minY, maxX, maxY, transition) {
-    var graph = this;
-    var dimensions = this.getSvgViewDimensions();
-    var width = maxX - minX;
-    var height = maxY - minY;
-    var scale = Math.min(dimensions[0] / width, dimensions[1] / height);
-    scale = Math.min(1.5, scale);
-    scale = Math.max(graph.minScale(), scale);
-    var translation = [-minX*scale, -minY*scale];
-    translation = graph.getVisibleTranslation(translation, scale);
-    graph.translateClipped(translation, scale, transition);
-  }
-
-  viewWholeGraph() {
-    var graph = this;
-    var minScale = graph.minScale();
-    var translation = [0, 0];
-    translation = graph.getVisibleTranslation(translation, minScale);
-    graph.translateClipped(translation, minScale);
-  }
-}
diff --git a/src/v8/tools/turbolizer/hide-selected.png b/src/v8/tools/turbolizer/hide-selected.png
deleted file mode 100644
index 207cdbb..0000000
--- a/src/v8/tools/turbolizer/hide-selected.png
+++ /dev/null
Binary files differ
diff --git a/src/v8/tools/turbolizer/hide-unselected.png b/src/v8/tools/turbolizer/hide-unselected.png
deleted file mode 100644
index 15617b0..0000000
--- a/src/v8/tools/turbolizer/hide-unselected.png
+++ /dev/null
Binary files differ
diff --git a/src/v8/tools/turbolizer/lang-disassembly.js b/src/v8/tools/turbolizer/lang-disassembly.js
deleted file mode 100644
index 590f9fd..0000000
--- a/src/v8/tools/turbolizer/lang-disassembly.js
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-PR.registerLangHandler(
-    PR.createSimpleLexer(
-      [
-        [PR.PR_STRING,        /^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$))/, null, '\''],
-        [PR.PR_PLAIN,         /^\s+/, null, ' \r\n\t\xA0']
-      ],
-      [ // fallthroughStylePatterns
-        [PR.PR_COMMENT,       /;; debug: position \d+/, null],
-      ]),
-    ['disassembly']);
diff --git a/src/v8/tools/turbolizer/layout-icon.png b/src/v8/tools/turbolizer/layout-icon.png
deleted file mode 100644
index 95a517a..0000000
--- a/src/v8/tools/turbolizer/layout-icon.png
+++ /dev/null
Binary files differ
diff --git a/src/v8/tools/turbolizer/live.png b/src/v8/tools/turbolizer/live.png
deleted file mode 100644
index ac72bb9..0000000
--- a/src/v8/tools/turbolizer/live.png
+++ /dev/null
Binary files differ
diff --git a/src/v8/tools/turbolizer/monkey.js b/src/v8/tools/turbolizer/monkey.js
deleted file mode 100644
index 129f8b3..0000000
--- a/src/v8/tools/turbolizer/monkey.js
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-Array.prototype.getStaggeredFromMiddle = function(i) {
-  if (i >= this.length) {
-    throw("getStaggeredFromMiddle: OOB");
-  }
-  var middle = Math.floor(this.length / 2);
-  var index = middle + (((i % 2) == 0) ? (i / 2) : (((1 - i) / 2) - 1));
-  return this[index];
-}
-
-Array.prototype.contains = function(obj) {
-  var i = this.length;
-  while (i--) {
-    if (this[i] === obj) {
-      return true;
-    }
-  }
-  return false;
-}
-
-Math.alignUp = function(raw, multiple) {
-  return Math.floor((raw + multiple - 1) / multiple) * multiple;
-}
diff --git a/src/v8/tools/turbolizer/node.js b/src/v8/tools/turbolizer/node.js
deleted file mode 100644
index b718cdc..0000000
--- a/src/v8/tools/turbolizer/node.js
+++ /dev/null
@@ -1,147 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var TYPE_HEIGHT = 25;
-var DEFAULT_NODE_BUBBLE_RADIUS = 12;
-var NODE_INPUT_WIDTH = 50;
-var MINIMUM_NODE_INPUT_APPROACH = 15 + 2 * DEFAULT_NODE_BUBBLE_RADIUS;
-var MINIMUM_NODE_OUTPUT_APPROACH = 15;
-
-function isNodeInitiallyVisible(node) {
-  return node.cfg;
-}
-
-var Node = {
-  isControl: function() {
-    return this.control;
-  },
-  isInput: function() {
-    return this.opcode == 'Parameter' || this.opcode.endsWith('Constant');
-  },
-  isLive: function() {
-    return this.live !== false;
-  },
-  isJavaScript: function() {
-    return this.opcode.startsWith('JS');
-  },
-  isSimplified: function() {
-    if (this.isJavaScript()) return false;
-    return this.opcode.endsWith('Phi') ||
-      this.opcode.startsWith('Boolean') ||
-      this.opcode.startsWith('Number') ||
-      this.opcode.startsWith('String') ||
-      this.opcode.startsWith('Change') ||
-      this.opcode.startsWith('Object') ||
-      this.opcode.startsWith('Reference') ||
-      this.opcode.startsWith('Any') ||
-      this.opcode.endsWith('ToNumber') ||
-      (this.opcode == 'AnyToBoolean') ||
-      (this.opcode.startsWith('Load') && this.opcode.length > 4) ||
-      (this.opcode.startsWith('Store') && this.opcode.length > 5);
-  },
-  isMachine: function() {
-    return !(this.isControl() || this.isInput() ||
-             this.isJavaScript() || this.isSimplified());
-  },
-  getTotalNodeWidth: function() {
-    var inputWidth = this.inputs.length * NODE_INPUT_WIDTH;
-    return Math.max(inputWidth, this.width);
-  },
-  getTitle: function() {
-    var propsString;
-    if (this.properties === undefined) {
-      propsString = "";
-    } else if (this.properties === "") {
-      propsString = "no properties";
-    } else {
-      propsString = "[" + this.properties + "]";
-    }
-    return this.title + "\n" + propsString + "\n" + this.opinfo;
-  },
-  getDisplayLabel: function() {
-    var result = this.id + ":" + this.label;
-    if (result.length > 40) {
-      return this.id + ":" + this.opcode;
-    } else  {
-      return result;
-    }
-  },
-  getType: function() {
-    return this.type;
-  },
-  getDisplayType: function() {
-    var type_string = this.type;
-    if (type_string == undefined) return "";
-    if (type_string.length > 24) {
-      type_string = type_string.substr(0, 25) + "...";
-    }
-    return type_string;
-  },
-  deepestInputRank: function() {
-    var deepestRank = 0;
-    this.inputs.forEach(function(e) {
-      if (e.isVisible() && !e.isBackEdge()) {
-        if (e.source.rank > deepestRank) {
-          deepestRank = e.source.rank;
-        }
-      }
-    });
-    return deepestRank;
-  },
-  areAnyOutputsVisible: function() {
-    var visibleCount = 0;
-    this.outputs.forEach(function(e) { if (e.isVisible()) ++visibleCount; });
-    if (this.outputs.length == visibleCount) return 2;
-    if (visibleCount != 0) return 1;
-    return 0;
-  },
-  setOutputVisibility: function(v) {
-    var result = false;
-    this.outputs.forEach(function(e) {
-      e.visible = v;
-      if (v) {
-        if (!e.target.visible) {
-          e.target.visible = true;
-          result = true;
-        }
-      }
-    });
-    return result;
-  },
-  setInputVisibility: function(i, v) {
-    var edge = this.inputs[i];
-    edge.visible = v;
-    if (v) {
-      if (!edge.source.visible) {
-        edge.source.visible = true;
-        return true;
-      }
-    }
-    return false;
-  },
-  getInputApproach: function(index) {
-    return this.y - MINIMUM_NODE_INPUT_APPROACH -
-      (index % 4) * MINIMUM_EDGE_SEPARATION - DEFAULT_NODE_BUBBLE_RADIUS
-  },
-  getOutputApproach: function(graph, index) {
-    return this.y + this.outputApproach + graph.getNodeHeight(this) +
-      + DEFAULT_NODE_BUBBLE_RADIUS;
-  },
-  getInputX: function(index) {
-    var result = this.getTotalNodeWidth() - (NODE_INPUT_WIDTH / 2) +
-        (index - this.inputs.length + 1) * NODE_INPUT_WIDTH;
-    return result;
-  },
-  getOutputX: function() {
-    return this.getTotalNodeWidth() - (NODE_INPUT_WIDTH / 2);
-  },
-  getFunctionRelativeSourcePosition: function(graph) {
-    return this.pos - graph.sourcePosition;
-  },
-  hasBackEdges: function() {
-    return (this.opcode == "Loop") ||
-      ((this.opcode == "Phi" || this.opcode == "EffectPhi") &&
-       this.inputs[this.inputs.length - 1].source.opcode == "Loop");
-  }
-};
diff --git a/src/v8/tools/turbolizer/schedule-view.js b/src/v8/tools/turbolizer/schedule-view.js
deleted file mode 100644
index ef47892..0000000
--- a/src/v8/tools/turbolizer/schedule-view.js
+++ /dev/null
@@ -1,128 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-"use strict";
-
-class ScheduleView extends TextView {
-  constructor(id, broker) {
-    super(id, broker, null, false);
-    let view = this;
-    let BLOCK_STYLE = {
-      css: 'tag'
-    };
-    const BLOCK_HEADER_STYLE = {
-      css: 'com',
-      block_id: -1,
-      location: function(text) {
-        let matches = /\d+/.exec(text);
-        if (!matches) return undefined;
-        BLOCK_HEADER_STYLE.block_id = Number(matches[0]);
-        return {
-          block_id: BLOCK_HEADER_STYLE.block_id
-        };
-      },
-    };
-    const BLOCK_LINK_STYLE = {
-      css: 'tag',
-      link: function(text) {
-        let id = Number(text.substr(1));
-        view.select(function(location) { return location.block_id == id; }, true, true);
-      }
-    };
-    const ID_STYLE = {
-      css: 'tag',
-      location: function(text) {
-        let matches = /\d+/.exec(text);
-        return {
-          node_id: Number(matches[0]),
-          block_id: BLOCK_HEADER_STYLE.block_id
-        };
-      },
-    };
-    const ID_LINK_STYLE = {
-      css: 'tag',
-      link: function(text) {
-        let id = Number(text);
-        view.select(function(location) { return location.node_id == id; }, true, true);
-      }
-    };
-    const NODE_STYLE = { css: 'kwd' };
-    const GOTO_STYLE = { css: 'kwd',
-      goto_id: -2,
-      location: function(text) {
-        return {
-          node_id: GOTO_STYLE.goto_id--,
-          block_id: BLOCK_HEADER_STYLE.block_id
-        };
-      }
-    }
-    const ARROW_STYLE = { css: 'kwd' };
-    let patterns = [
-      [
-        [/^--- BLOCK B\d+/, BLOCK_HEADER_STYLE, 1],
-        [/^\s+\d+: /, ID_STYLE, 2],
-        [/^\s+Goto/, GOTO_STYLE, 6],
-        [/^.*/, null, -1]
-      ],
-      [
-        [/^ +/, null],
-        [/^\(deferred\)/, BLOCK_HEADER_STYLE],
-        [/^B\d+/, BLOCK_LINK_STYLE],
-        [/^<-/, ARROW_STYLE],
-        [/^->/, ARROW_STYLE],
-        [/^,/, null],
-        [/^---/, BLOCK_HEADER_STYLE, -1]
-      ],
-      // Parse opcode including []
-      [
-        [/^[A-Za-z0-9_]+(\[.*\])?$/, NODE_STYLE, -1],
-        [/^[A-Za-z0-9_]+(\[(\[.*?\]|.)*?\])?/, NODE_STYLE, 3]
-      ],
-      // Parse optional parameters
-      [
-        [/^ /, null, 4],
-        [/^\(/, null],
-        [/^\d+/, ID_LINK_STYLE],
-        [/^, /, null],
-        [/^\)$/, null, -1],
-        [/^\)/, null, 4],
-      ],
-      [
-        [/^ -> /, ARROW_STYLE, 5],
-        [/^.*/, null, -1]
-      ],
-      [
-        [/^B\d+$/, BLOCK_LINK_STYLE, -1],
-        [/^B\d+/, BLOCK_LINK_STYLE],
-        [/^, /, null]
-      ],
-      [
-        [/^ -> /, ARROW_STYLE],
-        [/^B\d+$/, BLOCK_LINK_STYLE, -1]
-      ]
-    ];
-    this.setPatterns(patterns);
-  }
-
-  initializeContent(data, rememberedSelection) {
-    super.initializeContent(data, rememberedSelection);
-    var graph = this;
-    var locations = [];
-    for (var id of rememberedSelection) {
-      locations.push({ node_id : id });
-    }
-    this.selectLocations(locations, true, true);
-  }
-
-  detachSelection() {
-    var selection = this.selection.detachSelection();
-    var s = new Set();
-    for (var i of selection) {
-      if (i.location.node_id != undefined && i.location.node_id > 0) {
-        s.add(i.location.node_id);
-      }
-    };
-    return s;
-  }
-}
diff --git a/src/v8/tools/turbolizer/search.png b/src/v8/tools/turbolizer/search.png
deleted file mode 100644
index 12dc3e3..0000000
--- a/src/v8/tools/turbolizer/search.png
+++ /dev/null
Binary files differ
diff --git a/src/v8/tools/turbolizer/selection-broker.js b/src/v8/tools/turbolizer/selection-broker.js
deleted file mode 100644
index 822cf1c..0000000
--- a/src/v8/tools/turbolizer/selection-broker.js
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var SelectionBroker = function() {
-  this.brokers = [];
-  this.dispatching = false;
-  this.lastDispatchingHandler = null;
-  this.nodePositionMap = [];
-  this.sortedPositionList = [];
-  this.positionNodeMap = [];
-};
-
-SelectionBroker.prototype.addSelectionHandler = function(handler) {
-  this.brokers.push(handler);
-}
-
-SelectionBroker.prototype.setNodePositionMap = function(map) {
-  let broker = this;
-  if (!map) return;
-  broker.nodePositionMap = map;
-  broker.positionNodeMap = [];
-  broker.sortedPositionList = [];
-  let next = 0;
-  for (let i in broker.nodePositionMap) {
-    broker.sortedPositionList[next] = Number(broker.nodePositionMap[i]);
-    broker.positionNodeMap[next++] = i;
-  }
-  broker.sortedPositionList = sortUnique(broker.sortedPositionList,
-                                       function(a,b) { return a - b; });
-  this.positionNodeMap.sort(function(a,b) {
-    let result = broker.nodePositionMap[a] - broker.nodePositionMap[b];
-    if (result != 0) return result;
-    return a - b;
-  });
-}
-
-SelectionBroker.prototype.select = function(from, locations, selected) {
-  let broker = this;
-  if (!broker.dispatching) {
-    broker.lastDispatchingHandler = from;
-    try {
-      broker.dispatching = true;
-      let enrichLocations = function(locations) {
-        result = [];
-        for (let location of locations) {
-          let newLocation = {};
-          if (location.pos_start != undefined) {
-            newLocation.pos_start = location.pos_start;
-          }
-          if (location.pos_end != undefined) {
-            newLocation.pos_end = location.pos_end;
-          }
-          if (location.node_id != undefined) {
-            newLocation.node_id = location.node_id;
-          }
-          if (location.block_id != undefined) {
-            newLocation.block_id = location.block_id;
-          }
-          if (newLocation.pos_start == undefined &&
-              newLocation.pos_end == undefined &&
-              newLocation.node_id != undefined) {
-            if (broker.nodePositionMap && broker.nodePositionMap[location.node_id]) {
-              newLocation.pos_start = broker.nodePositionMap[location.node_id];
-              newLocation.pos_end = location.pos_start + 1;
-            }
-          }
-          result.push(newLocation);
-        }
-        return result;
-      }
-      locations = enrichLocations(locations);
-      for (var b of this.brokers) {
-        if (b != from) {
-          b.brokeredSelect(locations, selected);
-        }
-      }
-    }
-    finally {
-      broker.dispatching = false;
-    }
-  }
-}
-
-SelectionBroker.prototype.clear = function(from) {
-  this.lastDispatchingHandler = null;
-  if (!this.dispatching) {
-    try {
-      this.dispatching = true;
-      this.brokers.forEach(function(b) {
-        if (b != from) {
-          b.brokeredClear();
-        }
-      });
-    } finally {
-      this.dispatching = false;
-    }
-  }
-}
diff --git a/src/v8/tools/turbolizer/selection.js b/src/v8/tools/turbolizer/selection.js
deleted file mode 100644
index 26f1bde..0000000
--- a/src/v8/tools/turbolizer/selection.js
+++ /dev/null
@@ -1,108 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var Selection = function(handler) {
-  this.handler = handler;
-  this.selectionBase = null;
-  this.lastSelection = null;
-  this.selection = new Set();
-}
-
-
-Selection.prototype.isEmpty = function() {
-  return this.selection.size == 0;
-}
-
-
-Selection.prototype.clear = function() {
-  var handler = this.handler;
-  this.selectionBase = null;
-  this.lastSelection = null;
-  handler.select(this.selection, false);
-  handler.clear();
-  this.selection = new Set();
-}
-
-
-count = 0;
-
-Selection.prototype.select = function(s, isSelected) {
-  var handler = this.handler;
-  if (!(Symbol.iterator in Object(s))) { s = [s]; }
-  if (isSelected) {
-    let first = true;
-    for (let i of s) {
-      if (first) {
-        this.selectionBase = i;
-        this.lastSelection = i;
-        first = false;
-      }
-      this.selection.add(i);
-    }
-    handler.select(this.selection, true);
-  } else {
-    let unselectSet = new Set();
-    for (let i of s) {
-      if (this.selection.has(i)) {
-        unselectSet.add(i);
-        this.selection.delete(i);
-      }
-    }
-    handler.select(unselectSet, false);
-  }
-}
-
-
-Selection.prototype.extendTo = function(pos) {
-  if (pos == this.lastSelection || this.lastSelection === null) return;
-
-  var handler = this.handler;
-  var pos_diff = handler.selectionDifference(pos, true, this.lastSelection, false);
-  var unselect_diff = [];
-  if (pos_diff.length == 0) {
-    pos_diff = handler.selectionDifference(this.selectionBase, false, pos, true);
-    if (pos_diff.length != 0) {
-      unselect_diff = handler.selectionDifference(this.lastSelection, true, this.selectionBase, false);
-      this.selection = new Set();
-      this.selection.add(this.selectionBase);
-      for (var d of pos_diff) {
-        this.selection.add(d);
-      }
-    } else {
-      unselect_diff = handler.selectionDifference(this.lastSelection, true, pos, false);
-      for (var d of unselect_diff) {
-        this.selection.delete(d);
-      }
-    }
-  } else {
-    unselect_diff = handler.selectionDifference(this.selectionBase, false, this.lastSelection, true);
-    if (unselect_diff != 0) {
-      pos_diff = handler.selectionDifference(pos, true, this.selectionBase, false);
-      if (pos_diff.length == 0) {
-        unselect_diff = handler.selectionDifference(pos, false, this.lastSelection, true);
-      }
-      for (var d of unselect_diff) {
-        this.selection.delete(d);
-      }
-    }
-    if (pos_diff.length != 0) {
-      for (var d of pos_diff) {
-        this.selection.add(d);
-      }
-    }
-  }
-  handler.select(unselect_diff, false);
-  handler.select(pos_diff, true);
-  this.lastSelection = pos;
-}
-
-
-Selection.prototype.detachSelection = function() {
-  var result = new Set();
-  for (var i of this.selection) {
-    result.add(i);
-  }
-  this.clear();
-  return result;
-}
diff --git a/src/v8/tools/turbolizer/text-view.js b/src/v8/tools/turbolizer/text-view.js
deleted file mode 100644
index 6822500..0000000
--- a/src/v8/tools/turbolizer/text-view.js
+++ /dev/null
@@ -1,296 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-"use strict";
-
-class TextView extends View {
-  constructor(id, broker, patterns, allowSpanSelection) {
-    super(id, broker);
-    let view = this;
-    view.hide();
-    view.textListNode = view.divNode.getElementsByTagName('ul')[0];
-    view.fillerSvgElement = view.divElement.append("svg").attr('version','1.1').attr("width", "0");
-    view.patterns = patterns;
-    view.allowSpanSelection = allowSpanSelection;
-    view.nodeToLineMap = [];
-    var selectionHandler = {
-      clear: function() {
-        broker.clear(selectionHandler);
-      },
-      select: function(items, selected) {
-        for (let i of items) {
-          if (selected) {
-            i.classList.add("selected");
-          } else {
-            i.classList.remove("selected");
-          }
-        }
-        broker.clear(selectionHandler);
-        broker.select(selectionHandler, view.getLocations(items), selected);
-      },
-      selectionDifference: function(span1, inclusive1, span2, inclusive2) {
-        return null;
-      },
-      brokeredSelect: function(locations, selected) {
-        view.selectLocations(locations, selected, true);
-      },
-      brokeredClear: function() {
-        view.selection.clear();
-      }
-    };
-    view.selection = new Selection(selectionHandler);
-    broker.addSelectionHandler(selectionHandler);
-  }
-
-  setPatterns(patterns) {
-    let view = this;
-    view.patterns = patterns;
-  }
-
-  clearText() {
-    let view = this;
-    while (view.textListNode.firstChild) {
-      view.textListNode.removeChild(view.textListNode.firstChild);
-    }
-  }
-
-  sameLocation(l1, l2) {
-    let view = this;
-    if (l1.block_id != undefined && l2.block_id != undefined &&
-      l1.block_id == l2.block_id && l1.node_id === undefined) {
-      return true;
-    }
-
-    if (l1.address != undefined && l1.address == l2.address) {
-      return true;
-    }
-
-    let node1 = l1.node_id;
-    let node2 = l2.node_id;
-
-    if (node1 === undefined || node2 == undefined) {
-      if (l1.pos_start === undefined || l2.pos_start == undefined) {
-        return false;
-      }
-      if (l1.pos_start == -1 || l2.pos_start == -1) {
-        return false;
-      }
-      if (l1.pos_start < l2.pos_start) {
-        return l1.pos_end > l2.pos_start;
-      } {
-        return l1.pos_start < l2.pos_end;
-      }
-    }
-
-    return l1.node_id == l2.node_id;
-  }
-
-  selectLocations(locations, selected, makeVisible) {
-    let view = this;
-    let s = new Set();
-    for (let l of locations) {
-      for (let i = 0; i < view.textListNode.children.length; ++i) {
-        let child = view.textListNode.children[i];
-        if (child.location != undefined && view.sameLocation(l, child.location)) {
-          s.add(child);
-        }
-      }
-    }
-    view.selectCommon(s, selected, makeVisible);
-  }
-
-  getLocations(items) {
-    let result = [];
-    let lastObject = null;
-    for (let i of items) {
-      if (i.location) {
-        result.push(i.location);
-      }
-    }
-    return result;
-  }
-
-  createFragment(text, style) {
-    let view = this;
-    let span = document.createElement("SPAN");
-    span.onmousedown = function(e) {
-      view.mouseDownSpan(span, e);
-    }
-    if (style != undefined) {
-      span.classList.add(style);
-    }
-    span.innerHTML = text;
-    return span;
-  }
-
-  appendFragment(li, fragment) {
-    li.appendChild(fragment);
-  }
-
-  processLine(line) {
-    let view = this;
-    let result = [];
-    let patternSet = 0;
-    while (true) {
-      let beforeLine = line;
-      for (let pattern of view.patterns[patternSet]) {
-        let matches = line.match(pattern[0]);
-        if (matches != null) {
-          if (matches[0] != '') {
-            let style = pattern[1] != null ? pattern[1] : {};
-            let text = matches[0];
-            if (text != '') {
-              let fragment = view.createFragment(matches[0], style.css);
-              if (style.link) {
-                fragment.classList.add('linkable-text');
-                fragment.link = style.link;
-              }
-              result.push(fragment);
-              if (style.location != undefined) {
-                let location = style.location(text);
-                if (location != undefined) {
-                  fragment.location = location;
-                }
-              }
-            }
-            line = line.substr(matches[0].length);
-          }
-          let nextPatternSet = patternSet;
-          if (pattern.length > 2) {
-            nextPatternSet = pattern[2];
-          }
-          if (line == "") {
-            if (nextPatternSet != -1) {
-              throw("illegal parsing state in text-view in patternSet" + patternSet);
-            }
-            return result;
-          }
-          patternSet = nextPatternSet;
-          break;
-        }
-      }
-      if (beforeLine == line) {
-        throw("input not consumed in text-view in patternSet" + patternSet);
-      }
-    }
-  }
-
-  select(s, selected, makeVisible) {
-    let view = this;
-    view.selection.clear();
-    view.selectCommon(s, selected, makeVisible);
-  }
-
-  selectCommon(s, selected, makeVisible) {
-    let view = this;
-    let firstSelect = makeVisible && view.selection.isEmpty();
-    if ((typeof s) === 'function') {
-      for (let i = 0; i < view.textListNode.children.length; ++i) {
-        let child = view.textListNode.children[i];
-        if (child.location && s(child.location)) {
-          if (firstSelect) {
-            makeContainerPosVisible(view.parentNode, child.offsetTop);
-            firstSelect = false;
-          }
-          view.selection.select(child, selected);
-        }
-      }
-    } else if (typeof s[Symbol.iterator] === 'function') {
-      if (firstSelect) {
-        for (let i of s) {
-          makeContainerPosVisible(view.parentNode, i.offsetTop);
-          break;
-        }
-      }
-      view.selection.select(s, selected);
-    } else {
-      if (firstSelect) {
-        makeContainerPosVisible(view.parentNode, s.offsetTop);
-      }
-      view.selection.select(s, selected);
-    }
-  }
-
-  mouseDownLine(li, e) {
-    let view = this;
-    e.stopPropagation();
-    if (!e.shiftKey) {
-      view.selection.clear();
-    }
-    if (li.location != undefined) {
-      view.selectLocations([li.location], true, false);
-    }
-  }
-
-  mouseDownSpan(span, e) {
-    let view = this;
-    if (view.allowSpanSelection) {
-      e.stopPropagation();
-      if (!e.shiftKey) {
-        view.selection.clear();
-      }
-      select(li, true);
-    } else if (span.link) {
-      span.link(span.textContent);
-      e.stopPropagation();
-    }
-  }
-
-  processText(text) {
-    let view = this;
-    let textLines = text.split(/[\n]/);
-    let lineNo = 0;
-    for (let line of textLines) {
-      let li = document.createElement("LI");
-      li.onmousedown = function(e) {
-        view.mouseDownLine(li, e);
-      }
-      li.className = "nolinenums";
-      li.lineNo = lineNo++;
-      let fragments = view.processLine(line);
-      for (let fragment of fragments) {
-        view.appendFragment(li, fragment);
-      }
-      let lineLocation = view.lineLocation(li);
-      if (lineLocation != undefined) {
-        li.location = lineLocation;
-      }
-      view.textListNode.appendChild(li);
-    }
-  }
-
-  initializeContent(data, rememberedSelection) {
-    let view = this;
-    view.selection.clear();
-    view.clearText();
-    view.processText(data);
-    var fillerSize = document.documentElement.clientHeight -
-        view.textListNode.clientHeight;
-    if (fillerSize < 0) {
-      fillerSize = 0;
-    }
-    view.fillerSvgElement.attr("height", fillerSize);
-  }
-
-  deleteContent() {
-  }
-
-  isScrollable() {
-    return true;
-  }
-
-  detachSelection() {
-    return null;
-  }
-
-  lineLocation(li) {
-    let view = this;
-    for (let i = 0; i < li.children.length; ++i) {
-      let fragment = li.children[i];
-      if (fragment.location != undefined && !view.allowSpanSelection) {
-        return fragment.location;
-      }
-    }
-  }
-}
diff --git a/src/v8/tools/turbolizer/turbo-visualizer.js b/src/v8/tools/turbolizer/turbo-visualizer.js
deleted file mode 100644
index c043848..0000000
--- a/src/v8/tools/turbolizer/turbo-visualizer.js
+++ /dev/null
@@ -1,323 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-class Snapper {
-
-  constructor(resizer) {
-    let snapper = this;
-    snapper.resizer = resizer;
-    snapper.sourceExpand = d3.select("#" + SOURCE_EXPAND_ID);
-    snapper.sourceCollapse = d3.select("#" + SOURCE_COLLAPSE_ID);
-    snapper.disassemblyExpand = d3.select("#" + DISASSEMBLY_EXPAND_ID);
-    snapper.disassemblyCollapse = d3.select("#" + DISASSEMBLY_COLLAPSE_ID);
-
-    d3.select("#source-collapse").on("click", function(){
-      resizer.snapper.toggleSourceExpanded();
-    });
-    d3.select("#disassembly-collapse").on("click", function(){
-      resizer.snapper.toggleDisassemblyExpanded();
-    });
-  }
-
-  getLastExpandedState(type, default_state) {
-    var state = window.sessionStorage.getItem("expandedState-"+type);
-    if (state === null) return default_state;
-    return state === 'true';
-  }
-
-  setLastExpandedState(type, state) {
-    window.sessionStorage.setItem("expandedState-"+type, state);
-  }
-
-  toggleSourceExpanded() {
-    this.setSourceExpanded(!this.sourceExpand.classed("invisible"));
-  }
-
-  sourceExpandUpdate(newState) {
-    this.setLastExpandedState("source", newState);
-    this.sourceExpand.classed("invisible", newState);
-    this.sourceCollapse.classed("invisible", !newState);
-  }
-
-  setSourceExpanded(newState) {
-    if (this.sourceExpand.classed("invisible") === newState) return;
-    this.sourceExpandUpdate(newState);
-    let resizer = this.resizer;
-    if (newState) {
-      resizer.sep_left = resizer.sep_left_snap;
-      resizer.sep_left_snap = 0;
-    } else {
-      resizer.sep_left_snap = resizer.sep_left;
-      resizer.sep_left = 0;
-    }
-    resizer.updatePanes();
-  }
-
-  toggleDisassemblyExpanded() {
-    this.setDisassemblyExpanded(!this.disassemblyExpand.classed("invisible"));
-  }
-
-  disassemblyExpandUpdate(newState) {
-    this.setLastExpandedState("disassembly", newState);
-    this.disassemblyExpand.classed("invisible", newState);
-    this.disassemblyCollapse.classed("invisible", !newState);
-  }
-
-  setDisassemblyExpanded(newState) {
-    console.log(newState)
-    if (this.disassemblyExpand.classed("invisible") === newState) return;
-    this.disassemblyExpandUpdate(newState);
-    let resizer = this.resizer;
-    if (newState) {
-      resizer.sep_right = resizer.sep_right_snap;
-      resizer.sep_right_snap = resizer.client_width;
-      console.log("set expand")
-    } else {
-      resizer.sep_right_snap = resizer.sep_right;
-      resizer.sep_right = resizer.client_width;
-      console.log("set collapse")
-    }
-    resizer.updatePanes();
-  }
-
-  panesUpated() {
-    this.sourceExpandUpdate(this.resizer.sep_left > this.resizer.dead_width);
-    this.disassemblyExpandUpdate(this.resizer.sep_right <
-      (this.resizer.client_width - this.resizer.dead_width));
-  }
-}
-
-class Resizer {
-  constructor(panes_updated_callback, dead_width) {
-    let resizer = this;
-    resizer.snapper = new Snapper(resizer)
-    resizer.panes_updated_callback = panes_updated_callback;
-    resizer.dead_width = dead_width
-    resizer.client_width = d3.select("body").node().getBoundingClientRect().width;
-    resizer.left = d3.select("#" + SOURCE_PANE_ID);
-    resizer.middle = d3.select("#" + INTERMEDIATE_PANE_ID);
-    resizer.right = d3.select("#" + GENERATED_PANE_ID);
-    resizer.resizer_left = d3.select('.resizer-left');
-    resizer.resizer_right = d3.select('.resizer-right');
-    resizer.sep_left = resizer.client_width/3;
-    resizer.sep_right = resizer.client_width/3*2;
-    resizer.sep_left_snap = 0;
-    resizer.sep_right_snap = 0;
-    // Offset to prevent resizers from sliding slightly over one another.
-    resizer.sep_width_offset = 7;
-
-    let dragResizeLeft = d3.behavior.drag()
-      .on('drag', function() {
-        let x = d3.mouse(this.parentElement)[0];
-        resizer.sep_left = Math.min(Math.max(0,x), resizer.sep_right-resizer.sep_width_offset);
-        resizer.updatePanes();
-      })
-      .on('dragstart', function() {
-        resizer.resizer_left.classed("dragged", true);
-        let x = d3.mouse(this.parentElement)[0];
-        if (x > dead_width) {
-          resizer.sep_left_snap = resizer.sep_left;
-        }
-      })
-      .on('dragend', function() {
-        resizer.resizer_left.classed("dragged", false);
-      });
-    resizer.resizer_left.call(dragResizeLeft);
-
-    let dragResizeRight = d3.behavior.drag()
-      .on('drag', function() {
-        let x = d3.mouse(this.parentElement)[0];
-        resizer.sep_right = Math.max(resizer.sep_left+resizer.sep_width_offset, Math.min(x, resizer.client_width));
-        resizer.updatePanes();
-      })
-      .on('dragstart', function() {
-        resizer.resizer_right.classed("dragged", true);
-        let x = d3.mouse(this.parentElement)[0];
-        if (x < (resizer.client_width-dead_width)) {
-          resizer.sep_right_snap = resizer.sep_right;
-        }
-      })
-      .on('dragend', function() {
-        resizer.resizer_right.classed("dragged", false);
-      });;
-    resizer.resizer_right.call(dragResizeRight);
-    window.onresize = function(){
-      resizer.updateWidths();
-      /*fitPanesToParents();*/
-      resizer.updatePanes();
-    };
-  }
-
-  updatePanes() {
-    let left_snapped = this.sep_left === 0;
-    let right_snapped = this.sep_right >= this.client_width - 1;
-    this.resizer_left.classed("snapped", left_snapped);
-    this.resizer_right.classed("snapped", right_snapped);
-    this.left.style('width', this.sep_left + 'px');
-    this.middle.style('width', (this.sep_right-this.sep_left) + 'px');
-    this.right.style('width', (this.client_width - this.sep_right) + 'px');
-    this.resizer_left.style('left', this.sep_left + 'px');
-    this.resizer_right.style('right', (this.client_width - this.sep_right - 1) + 'px');
-
-    this.snapper.panesUpated();
-    this.panes_updated_callback();
-  }
-
-  updateWidths() {
-    this.client_width = d3.select("body").node().getBoundingClientRect().width;
-    this.sep_right = Math.min(this.sep_right, this.client_width);
-    this.sep_left = Math.min(Math.max(0, this.sep_left), this.sep_right);
-  }
-}
-
-document.onload = (function(d3){
-  "use strict";
-  var jsonObj;
-  var svg  = null;
-  var graph = null;
-  var schedule = null;
-  var empty = null;
-  var currentPhaseView = null;
-  var disassemblyView = null;
-  var sourceView = null;
-  var selectionBroker = null;
-  let resizer = new Resizer(panesUpdatedCallback, 100);
-
-  function panesUpdatedCallback() {
-    graph.fitGraphViewToWindow();
-  }
-
-  function hideCurrentPhase() {
-    var rememberedSelection = null;
-    if (currentPhaseView != null) {
-      rememberedSelection = currentPhaseView.detachSelection();
-      currentPhaseView.hide();
-      currentPhaseView = null;
-    }
-    return rememberedSelection;
-  }
-
-  function displayPhaseView(view, data) {
-    var rememberedSelection = hideCurrentPhase();
-    view.show(data, rememberedSelection);
-    d3.select("#middle").classed("scrollable", view.isScrollable());
-    currentPhaseView = view;
-  }
-
-  function displayPhase(phase) {
-    if (phase.type == 'graph') {
-      displayPhaseView(graph, phase.data);
-    } else if (phase.type == 'schedule') {
-      displayPhaseView(schedule, phase.data);
-    } else {
-      displayPhaseView(empty, null);
-    }
-  }
-
-  function fitPanesToParents() {
-    d3.select("#left").classed("scrollable", false)
-    d3.select("#right").classed("scrollable", false);
-
-    graph.fitGraphViewToWindow();
-
-    d3.select("#left").classed("scrollable", true);
-    d3.select("#right").classed("scrollable", true);
-  }
-
-  selectionBroker = new SelectionBroker();
-
-  function initializeHandlers(g) {
-    d3.select("#hidden-file-upload").on("change", function() {
-      if (window.File && window.FileReader && window.FileList) {
-        var uploadFile = this.files[0];
-        var filereader = new window.FileReader();
-        var consts = Node.consts;
-        filereader.onload = function(){
-          var txtRes = filereader.result;
-          // If the JSON isn't properly terminated, assume compiler crashed and
-          // add best-guess empty termination
-          if (txtRes[txtRes.length-2] == ',') {
-            txtRes += '{"name":"disassembly","type":"disassembly","data":""}]}';
-          }
-          try{
-            jsonObj = JSON.parse(txtRes);
-
-            hideCurrentPhase();
-
-            selectionBroker.setNodePositionMap(jsonObj.nodePositions);
-
-            sourceView.initializeCode(jsonObj.source, jsonObj.sourcePosition);
-            disassemblyView.initializeCode(jsonObj.source);
-
-            var selectMenu = document.getElementById('display-selector');
-            var disassemblyPhase = null;
-            selectMenu.innerHTML = '';
-            for (var i = 0; i < jsonObj.phases.length; ++i) {
-              var optionElement = document.createElement("option");
-              optionElement.text = jsonObj.phases[i].name;
-              if (optionElement.text == 'disassembly') {
-                disassemblyPhase = jsonObj.phases[i];
-              } else {
-                selectMenu.add(optionElement, null);
-              }
-            }
-
-            disassemblyView.initializePerfProfile(jsonObj.eventCounts);
-            disassemblyView.show(disassemblyPhase.data, null);
-
-            var initialPhaseIndex = +window.sessionStorage.getItem("lastSelectedPhase");
-            if (!(initialPhaseIndex in jsonObj.phases)) {
-              initialPhaseIndex = 0;
-            }
-
-            // We wish to show the remembered phase {lastSelectedPhase}, but
-            // this will crash if the first view we switch to is a
-            // ScheduleView. So we first switch to the first phase, which
-            // should never be a ScheduleView.
-            displayPhase(jsonObj.phases[0]);
-            displayPhase(jsonObj.phases[initialPhaseIndex]);
-            selectMenu.selectedIndex = initialPhaseIndex;
-
-            selectMenu.onchange = function(item) {
-              window.sessionStorage.setItem("lastSelectedPhase", selectMenu.selectedIndex);
-              displayPhase(jsonObj.phases[selectMenu.selectedIndex]);
-            }
-
-            fitPanesToParents();
-
-            d3.select("#search-input").attr("value", window.sessionStorage.getItem("lastSearch") || "");
-
-          }
-          catch(err) {
-            window.console.log("caught exception, clearing session storage just in case");
-            window.sessionStorage.clear(); // just in case
-            window.console.log("showing error");
-            window.alert("Invalid TurboFan JSON file\n" +
-                         "error: " + err.message);
-            return;
-          }
-        };
-        filereader.readAsText(uploadFile);
-      } else {
-        alert("Can't load graph");
-      }
-    });
-  }
-
-  sourceView = new CodeView(SOURCE_PANE_ID, PR, "", 0, selectionBroker);
-  disassemblyView = new DisassemblyView(DISASSEMBLY_PANE_ID, selectionBroker);
-  graph = new GraphView(d3, GRAPH_PANE_ID, [], [], selectionBroker);
-  schedule = new ScheduleView(SCHEDULE_PANE_ID, selectionBroker);
-  empty = new EmptyView(EMPTY_PANE_ID, selectionBroker);
-
-  initializeHandlers(graph);
-
-  resizer.snapper.setSourceExpanded(resizer.snapper.getLastExpandedState("source", true));
-  resizer.snapper.setDisassemblyExpanded(resizer.snapper.getLastExpandedState("disassembly", false));
-
-  displayPhaseView(empty, null);
-  fitPanesToParents();
-  resizer.updatePanes();
-
-})(window.d3);
diff --git a/src/v8/tools/turbolizer/types.png b/src/v8/tools/turbolizer/types.png
deleted file mode 100644
index 8fead8f..0000000
--- a/src/v8/tools/turbolizer/types.png
+++ /dev/null
Binary files differ
diff --git a/src/v8/tools/turbolizer/util.js b/src/v8/tools/turbolizer/util.js
deleted file mode 100644
index 282221a..0000000
--- a/src/v8/tools/turbolizer/util.js
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-"use strict";
-
-function makeContainerPosVisible(container, pos) {
-  var height = container.offsetHeight;
-  var margin = Math.floor(height / 4);
-  if (pos < container.scrollTop + margin) {
-    pos -= margin;
-    if (pos < 0) pos = 0;
-    container.scrollTop = pos;
-    return;
-  }
-  if (pos > (container.scrollTop + 3 * margin)) {
-    pos = pos - 3 * margin;
-    if (pos < 0) pos = 0;
-    container.scrollTop = pos;
-  }
-}
-
-
-function lowerBound(a, value, compare, lookup) {
-  let first = 0;
-  let count = a.length;
-  while (count > 0) {
-    let step = Math.floor(count / 2);
-    let middle = first + step;
-    let middle_value = (lookup === undefined) ? a[middle] : lookup(a, middle);
-    let result = (compare === undefined) ? (middle_value < value) : compare(middle_value, value);
-    if (result) {
-      first = middle + 1;
-      count -= step + 1;
-    } else {
-      count = step;
-    }
-  }
-  return first;
-}
-
-
-function upperBound(a, value, compare, lookup) {
-  let first = 0;
-  let count = a.length;
-  while (count > 0) {
-    let step = Math.floor(count / 2);
-    let middle = first + step;
-    let middle_value = (lookup === undefined) ? a[middle] : lookup(a, middle);
-    let result = (compare === undefined) ? (value < middle_value) : compare(value, middle_value);
-    if (!result) {
-      first = middle + 1;
-      count -= step + 1;
-    } else {
-      count = step;
-    }
-  }
-  return first;
-}
-
-
-function sortUnique(arr, f) {
-  arr = arr.sort(f);
-  let ret = [arr[0]];
-  for (var i = 1; i < arr.length; i++) {
-    if (arr[i-1] !== arr[i]) {
-      ret.push(arr[i]);
-    }
-  }
-  return ret;
-}
-
-// Partial application without binding the receiver
-function partial(f) {
-  var arguments1 = Array.prototype.slice.call(arguments, 1);
-  return function() {
-    var arguments2 = Array.from(arguments);
-    f.apply(this, arguments1.concat(arguments2));
-  }
-}
diff --git a/src/v8/tools/turbolizer/view.js b/src/v8/tools/turbolizer/view.js
deleted file mode 100644
index a7c1f1e..0000000
--- a/src/v8/tools/turbolizer/view.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-"use strict";
-
-class View {
-  constructor(id, broker) {
-    this.divElement = d3.select("#" + id);
-    this.divNode = this.divElement[0][0];
-    this.parentNode = this.divNode.parentNode;
-  }
-
-  isScrollable() {
-    return false;
-  }
-
-  show(data, rememberedSelection) {
-    this.parentNode.appendChild(this.divElement[0][0]);
-    this.initializeContent(data, rememberedSelection);
-    this.divElement.attr(VISIBILITY, 'visible');
-  }
-
-  hide() {
-    this.divElement.attr(VISIBILITY, 'hidden');
-    this.deleteContent();
-    this.parentNode.removeChild(this.divNode);
-  }
-
-  detachSelection() {
-    return null;
-  }
-}
diff --git a/src/v8/tools/verify_source_deps.py b/src/v8/tools/verify_source_deps.py
deleted file mode 100755
index c49d51a..0000000
--- a/src/v8/tools/verify_source_deps.py
+++ /dev/null
@@ -1,187 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-Script to print potentially missing source dependencies based on the actual
-.h and .cc files in the source tree and which files are included in the gyp
-and gn files. The latter inclusion is overapproximated.
-
-TODO(machenbach): If two source files with the same name exist, but only one
-is referenced from a gyp/gn file, we won't necessarily detect it.
-"""
-
-import itertools
-import re
-import os
-import subprocess
-import sys
-
-
-V8_BASE = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
-
-GYP_FILES = [
-  os.path.join(V8_BASE, 'src', 'd8.gyp'),
-  os.path.join(V8_BASE, 'src', 'v8.gyp'),
-  os.path.join(V8_BASE, 'src', 'inspector', 'inspector.gypi'),
-  os.path.join(V8_BASE, 'src', 'third_party', 'vtune', 'v8vtune.gyp'),
-  os.path.join(V8_BASE, 'samples', 'samples.gyp'),
-  os.path.join(V8_BASE, 'test', 'cctest', 'cctest.gyp'),
-  os.path.join(V8_BASE, 'test', 'fuzzer', 'fuzzer.gyp'),
-  os.path.join(V8_BASE, 'test', 'unittests', 'unittests.gyp'),
-  os.path.join(V8_BASE, 'test', 'inspector', 'inspector.gyp'),
-  os.path.join(V8_BASE, 'test', 'mkgrokdump', 'mkgrokdump.gyp'),
-  os.path.join(V8_BASE, 'testing', 'gmock.gyp'),
-  os.path.join(V8_BASE, 'testing', 'gtest.gyp'),
-  os.path.join(V8_BASE, 'tools', 'parser-shell.gyp'),
-]
-
-ALL_GYP_PREFIXES = [
-  '..',
-  'common',
-  os.path.join('src', 'third_party', 'vtune'),
-  'src',
-  'samples',
-  'testing',
-  'tools',
-  os.path.join('test', 'cctest'),
-  os.path.join('test', 'common'),
-  os.path.join('test', 'fuzzer'),
-  os.path.join('test', 'unittests'),
-  os.path.join('test', 'inspector'),
-  os.path.join('test', 'mkgrokdump'),
-]
-
-GYP_UNSUPPORTED_FEATURES = [
-  'gcmole',
-  'setup-isolate-deserialize.cc',
-  'v8-version.h'
-]
-
-GN_FILES = [
-  os.path.join(V8_BASE, 'BUILD.gn'),
-  os.path.join(V8_BASE, 'build', 'secondary', 'testing', 'gmock', 'BUILD.gn'),
-  os.path.join(V8_BASE, 'build', 'secondary', 'testing', 'gtest', 'BUILD.gn'),
-  os.path.join(V8_BASE, 'src', 'inspector', 'BUILD.gn'),
-  os.path.join(V8_BASE, 'test', 'cctest', 'BUILD.gn'),
-  os.path.join(V8_BASE, 'test', 'unittests', 'BUILD.gn'),
-  os.path.join(V8_BASE, 'test', 'inspector', 'BUILD.gn'),
-  os.path.join(V8_BASE, 'test', 'mkgrokdump', 'BUILD.gn'),
-  os.path.join(V8_BASE, 'tools', 'BUILD.gn'),
-]
-
-GN_UNSUPPORTED_FEATURES = [
-  'aix',
-  'cygwin',
-  'freebsd',
-  'gcmole',
-  'openbsd',
-  'ppc',
-  'qnx',
-  'solaris',
-  'vtune',
-  'v8-version.h',
-]
-
-ALL_GN_PREFIXES = [
-  '..',
-  os.path.join('src', 'inspector'),
-  'src',
-  'testing',
-  os.path.join('test', 'cctest'),
-  os.path.join('test', 'unittests'),
-  os.path.join('test', 'inspector'),
-  os.path.join('test', 'mkgrokdump'),
-]
-
-def pathsplit(path):
-  return re.split('[/\\\\]', path)
-
-def path_no_prefix(path, prefixes):
-  for prefix in prefixes:
-    if path.startswith(prefix + os.sep):
-      return path_no_prefix(path[len(prefix) + 1:], prefixes)
-  return path
-
-
-def isources(prefixes):
-  cmd = ['git', 'ls-tree', '-r', 'HEAD', '--full-name', '--name-only']
-  for f in subprocess.check_output(cmd, universal_newlines=True).split('\n'):
-    if not (f.endswith('.h') or f.endswith('.cc')):
-      continue
-    yield path_no_prefix(os.path.join(*pathsplit(f)), prefixes)
-
-
-def iflatten(obj):
-  if isinstance(obj, dict):
-    for value in obj.values():
-      for i in iflatten(value):
-        yield i
-  elif isinstance(obj, list):
-    for value in obj:
-      for i in iflatten(value):
-        yield i
-  elif isinstance(obj, basestring):
-    yield path_no_prefix(os.path.join(*pathsplit(obj)), ALL_GYP_PREFIXES)
-
-
-def iflatten_gyp_file(gyp_file):
-  """Overaproximates all values in the gyp file.
-
-  Iterates over all string values recursively. Removes '../' path prefixes.
-  """
-  with open(gyp_file) as f:
-    return iflatten(eval(f.read()))
-
-
-def iflatten_gn_file(gn_file):
-  """Overaproximates all values in the gn file.
-
-  Iterates over all double quoted strings.
-  """
-  with open(gn_file) as f:
-    for line in f.read().splitlines():
-      match = re.match(r'.*"([^"]*)".*', line)
-      if match:
-        yield path_no_prefix(
-            os.path.join(*pathsplit(match.group(1))), ALL_GN_PREFIXES)
-
-
-def icheck_values(values, prefixes):
-  for source_file in isources(prefixes):
-    if source_file not in values:
-      yield source_file
-
-
-def missing_gyp_files():
-  gyp_values = set(itertools.chain(
-    *[iflatten_gyp_file(gyp_file) for gyp_file in GYP_FILES]
-    ))
-  gyp_files = sorted(icheck_values(gyp_values, ALL_GYP_PREFIXES))
-  return filter(
-      lambda x: not any(i in x for i in GYP_UNSUPPORTED_FEATURES), gyp_files)
-
-
-def missing_gn_files():
-  gn_values = set(itertools.chain(
-    *[iflatten_gn_file(gn_file) for gn_file in GN_FILES]
-    ))
-
-  gn_files = sorted(icheck_values(gn_values, ALL_GN_PREFIXES))
-  return filter(
-      lambda x: not any(i in x for i in GN_UNSUPPORTED_FEATURES), gn_files)
-
-
-def main():
-  print "----------- Files not in gyp: ------------"
-  for i in missing_gyp_files():
-    print i
-
-  print "\n----------- Files not in gn: -------------"
-  for i in missing_gn_files():
-    print i
-  return 0
-
-if '__main__' == __name__:
-  sys.exit(main())